From c9a3a8dd3957f990c954999adf4eaa8591f9485a Mon Sep 17 00:00:00 2001 From: blogic Date: Fri, 5 Oct 2012 10:14:26 +0000 Subject: [PATCH] branch Attitude Adjustment packages git-svn-id: svn://svn.openwrt.org/openwrt/branches/packages_12.09@33626 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .gitignore | 2 + admin/debootstrap/Makefile | 54 + admin/debootstrap/files/pkgdetails.c | 347 + admin/debootstrap/patches/100-busybox_fix.patch | 11 + admin/gkrellmd/Makefile | 60 + admin/gkrellmd/files/gkrellmd.init | 16 + admin/gkrellmd/patches/100-conf.patch | 40 + admin/htop/Makefile | 53 + admin/monit/Makefile | 91 + admin/monit/files/monit.init | 16 + admin/monit/patches/001-no_sslv2.patch | 0 admin/monit/patches/002-uclibc_loadavg.patch | 0 admin/muninlite/Makefile | 51 + admin/muninlite/files/etc/xinetd.d/munin | 10 + admin/muninlite/patches/001-no_disks.patch | 12 + admin/muninlite/patches/002-hostname.patch | 11 + admin/muninlite/patches/100-fix-no-ethtool.patch | 21 + admin/muninlite/patches/200-add-tap-dev.patch | 20 + admin/muninlite/patches/210-add-bridge-devs.patch | 22 + admin/nagios-plugins/Makefile | 52 + admin/nagios-plugins/patches/002-plugins.patch | 74 + .../patches/003-pgsl-header-fix.patch | 11 + admin/nagios/Makefile | 75 + admin/nrpe/Makefile | 59 + admin/nrpe/files/nrpe.cfg | 208 + admin/nrpe/files/nrpe.init | 20 + admin/nrpe/patches/100-openssl-dh.patch | 17 + admin/nsca/Makefile | 60 + admin/osiris/Makefile | 50 + admin/osiris/files/osirisd.init | 15 + admin/osiris/patches/001-configure-cross.patch | 22 + admin/osiris/patches/002-osirisd-pidfile.patch | 68 + admin/osiris/patches/003-openssl-0.9.8+.patch | 16 + admin/osiris/patches/004-no_openssl_ripe.patch | 59 + admin/osiris/patches/006-mod_nvram.patch | 213 + admin/osiris/patches/007-mod_uptime.patch | 243 + .../patches/010-dont-add-host-include-paths.patch | 16 + admin/ostiary/Makefile | 88 + admin/ostiary/files/ostiaryd.init | 27 + admin/ostiary/files/ssh_disable | 4 + admin/ostiary/files/ssh_enable | 4 + admin/pmacct/Makefile | 178 + admin/pmacct/files/nfacctd.conf | 29 + admin/pmacct/files/nfacctd.default | 1 + admin/pmacct/files/nfacctd.init | 19 + admin/pmacct/files/pmacctd.conf | 27 + admin/pmacct/files/pmacctd.default | 1 + admin/pmacct/files/pmacctd.init | 19 + admin/pmacct/files/sfacctd.conf | 27 + admin/pmacct/files/sfacctd.default | 1 + admin/pmacct/files/sfacctd.init | 19 + admin/pmacct/files/uacctd.conf | 28 + admin/pmacct/files/uacctd.default | 1 + admin/pmacct/files/uacctd.init | 19 + admin/sudo/Makefile | 76 + admin/sudo/files/sudo.init | 11 + admin/syslog-ng/Makefile | 63 + admin/syslog-ng/files/syslog-ng.conf | 16 + admin/syslog-ng/files/syslog-ng.init | 17 + admin/syslog-ng/patches/001-no_lfl.patch | 38 + admin/syslog-ng3/Makefile | 72 + admin/syslog-ng3/files/syslog-ng.conf | 37 + admin/syslog-ng3/files/syslog-ng.init | 19 + admin/zabbix/Makefile | 149 + admin/zabbix/files/zabbix_agentd.conf | 85 + admin/zabbix/files/zabbix_agentd.init | 25 + admin/zabbix/patches/001-cross_compile.patch | 29 + .../patches/002-fix-res_send-on-uclibc.patch | 35 + admin/zabbix/patches/002-uclibc_loadavg.patch | 49 + devel/binutils/Makefile | 113 + devel/build-essential/Makefile | 33 + devel/build-essential/files/usr/src/hello/hello.c | 8 + devel/cppunit/Makefile | 49 + devel/diffutils/Makefile | 59 + devel/dmalloc/Makefile | 78 + devel/dmalloc/patches/100-configure_pagesize.patch | 44 + devel/dmalloc/patches/110-configure_cxx.patch | 38 + devel/dmalloc/patches/120-makefile_shared.patch | 305 + devel/dmalloc/patches/130-makefile_destdir.patch | 97 + devel/dmalloc/patches/200-fix_return_address.patch | 45 + devel/dmalloc/patches/210-fix_threads.patch | 11 + .../dmalloc/patches/300-fix_summarize_script.patch | 8 + devel/dmalloc/patches/400-undef-strndup.patch | 10 + devel/electric-fence/Makefile | 63 + devel/gcc/Makefile | 90 + devel/ksymoops/Makefile | 58 + devel/make/Makefile | 37 + devel/oprofile/Makefile | 89 + .../100-use_insmod_instead_of_modprobe.patch | 20 + devel/oprofile/patches/101-remove_24_support.patch | 64 + devel/patch/Makefile | 43 + devel/patch/patches/100-install.patch | 18 + devel/perf/Makefile | 52 + ipv6/6scripts/Makefile | 51 + ipv6/6scripts/files/6bridge.conf | 2 + ipv6/6scripts/files/6bridge.init | 53 + ipv6/6scripts/files/6tunnel.conf | 18 + ipv6/6scripts/files/6tunnel.init | 65 + ipv6/6scripts/files/he-tun.ppp | 24 + ipv6/6tunnel/Makefile | 41 + .../patches/100-arm-fix-optc-initialization.patch | 11 + ipv6/ahcpd/Makefile | 53 + ipv6/ahcpd/files/ahcpd.config | 32 + ipv6/ahcpd/files/ahcpd.init | 109 + ipv6/aiccu/Makefile | 51 + ipv6/aiccu/patches/100-cross_compile.patch | 101 + ipv6/aiccu/patches/200-add_dn_skipname.patch | 70 + ipv6/aiccu/patches/300-resolver-uclibc.patch | 29 + ipv6/dhcp6/Makefile | 80 + ipv6/dhcp6/patches/001-opt_flags.patch | 94 + ipv6/dhcp6/patches/002-gcc_lvalue.patch | 11 + ipv6/dhcp6/patches/003-debug.patch | 22 + ipv6/dibbler/Makefile | 134 + ipv6/dibbler/files/dibbler-client.init | 13 + ipv6/dibbler/files/dibbler-relay.init | 13 + ipv6/dibbler/files/dibbler-server.init | 13 + ipv6/gw6c/Makefile | 80 + ipv6/gw6c/files/gw6c.config | 66 + ipv6/gw6c/files/gw6c.init | 111 + ipv6/gw6c/files/openwrt.sh | 181 + ipv6/ipv6calc/Makefile | 119 + ipv6/miredo/Makefile | 105 + ipv6/miredo/files/client-hook | 70 + ipv6/miredo/files/miredo-server.init | 14 + ipv6/miredo/files/miredo.init | 15 + ipv6/miredo/patches/100-uclibc.patch | 21 + ipv6/miredo/patches/110-fix_compile_error.patch | 12 + ipv6/miredo/patches/120-automake-compat.patch | 23 + ipv6/mrd6/Makefile | 75 + ipv6/mrd6/files/mrd6.conf | 14 + ipv6/mrd6/files/mrd6.init | 13 + ipv6/mrd6/patches/001-add_missing_include.patch | 10 + ipv6/mrd6/patches/002-missing_netlink_defs.patch | 58 + ipv6/mrd6/patches/003-debian.patch | 71 + ipv6/mrd6/patches/004-ambiguous_call_fix.patch | 13 + ipv6/ndisc/Makefile | 98 + ipv6/ndisc/patches/100-favor_bsd.patch | 20 + ipv6/ndisc/patches/110-strverscmp.patch | 175 + ipv6/ndppd/Makefile | 69 + ipv6/ndppd/files/ndppd.init | 16 + ipv6/ptrtd/Makefile | 43 + ipv6/ptrtd/files/ptrtd.init | 15 + ipv6/ptrtd/patches/100-ptrtd-0.5.2-openwrt.patch | 41 + ipv6/radvd/Makefile | 79 + ipv6/radvd/files/radvd.config | 32 + ipv6/radvd/files/radvd.init | 416 + .../patches/100-silent-netlink-config-reload.patch | 67 + ipv6/send/Makefile | 58 + .../patches/001-libnetfilter_queue_update.patch | 388 + ipv6/send/patches/002-handle_max_bits_conf.patch | 50 + .../send/patches/003-keysig_8bytes_alignment.patch | 20 + .../patches/004-always_link_with_ncurses.patch | 26 + ipv6/send/patches/005-use-bundled-libconfig.patch | 22 + ipv6/send/patches/006-openssl-1.0.0-compat.patch | 143 + ipv6/shorewall6-lite/Makefile | 66 + ipv6/shorewall6-lite/files/hostname | 2 + ipv6/shorewall6-lite/files/hotplug_iface | 12 + ipv6/shorewall6-lite/files/shorewall-lite.init | 20 + ipv6/shorewall6-lite/files/vardir | 2 + ipv6/shorewall6-lite/patches/110-MODULESDIR.patch | 20 + ipv6/shorewall6-lite/patches/120-LOGFILE.patch | 10 + ipv6/tayga/Makefile | 47 + ipv6/tayga/files/tayga.hotplug | 37 + ipv6/tayga/files/tayga.sh | 152 + ipv6/thc-ipv6/Makefile | 70 + ipv6/thc-ipv6/patches/100-optional-openssl.patch | 93 + ipv6/totd/Makefile | 60 + ipv6/totd/files/totd.conf | 17 + ipv6/totd/files/totd.init | 14 + ipv6/totd/patches/001-no_warning_as_errors.patch | 11 + ipv6/tspc/Makefile | 52 + ipv6/tspc/patches/001-debian_patches.patch | 228 + ipv6/tunslip6/Makefile | 52 + ipv6/wide-dhcpv6/Makefile | 145 + ipv6/wide-dhcpv6/files/dhcp6c-dnsmasq.hotplug | 53 + ipv6/wide-dhcpv6/files/dhcp6c-radvd.hotplug | 3 + ipv6/wide-dhcpv6/files/dhcp6c-state | 18 + ipv6/wide-dhcpv6/files/dhcp6c.config | 42 + ipv6/wide-dhcpv6/files/dhcp6c.hotplug | 20 + ipv6/wide-dhcpv6/files/dhcp6c.init | 172 + ipv6/wide-dhcpv6/files/dhcp6s.config | 4 + ipv6/wide-dhcpv6/files/dhcp6s.hotplug | 20 + ipv6/wide-dhcpv6/files/dhcp6s.init | 37 + .../wide-dhcpv6/patches/000-cftoken-noyywrap.patch | 9 + .../wide-dhcpv6/patches/001-linux_old_compat.patch | 37 + .../patches/002-fix-dprintf-clash.patch | 56 + lang/4th/Makefile | 43 + lang/arm/Makefile | 51 + lang/cython/Makefile | 49 + lang/distribute/Makefile | 69 + lang/egenix-mx/Makefile | 94 + lang/eggdrop/Makefile | 57 + lang/eggdrop/patches/001-makefile_in.patch | 11 + lang/eggdrop/patches/002-eggdrop_h.patch | 12 + lang/eggdrop/patches/003-language_c.patch | 25 + lang/eggdrop/patches/004-main_c.patch | 14 + lang/erlang/Makefile | 327 + lang/erlang/patches/101-emulator_includes.patch | 11 + lang/erlang/patches/103-disable_emacs.patch | 11 + lang/gst-python/Makefile | 71 + lang/ipython/Makefile | 58 + lang/jamvm/Makefile | 67 + lang/jsonpath/Makefile | 46 + lang/kid/Makefile | 50 + lang/kid/patches/000-setup.patch | 20 + lang/logilab-astng/Makefile | 46 + lang/logilab-common/Makefile | 46 + lang/lsqlite3/Makefile | 53 + lang/luaexpat/Makefile | 55 + lang/luaexpat/files/compat-5.1r5/compat-5.1.c | 97 + lang/luaexpat/files/compat-5.1r5/compat-5.1.h | 13 + lang/luaexpat/files/compat-5.1r5/compat-5.1.lua | 267 + lang/luaexpat/patches/001-compile-fix.patch | 10 + lang/luafilesystem/Makefile | 63 + lang/luaposix/Makefile | 52 + lang/luaposix/patches/100-eglibc-compat.patch | 26 + lang/luaprofiler/Makefile | 54 + lang/luaprofiler/patches/100-link.patch | 11 + lang/luasec/Makefile | 57 + lang/luasoap/Makefile | 50 + lang/luasocket/Makefile | 59 + lang/luasql/Makefile | 121 + lang/mako/Makefile | 56 + lang/numpy/Makefile | 51 + lang/numpy/patches/100-compile.patch | 112 + lang/perl-compress-bzip2/Makefile | 39 + lang/perl-dbi/Makefile | 39 + lang/perl-html-parser/Makefile | 39 + lang/perl-html-tagset/Makefile | 39 + lang/perl-html-tree/Makefile | 39 + lang/perl-lockfile-simple/Makefile | 39 + lang/perl-net-telnet/Makefile | 44 + lang/perl-uri/Makefile | 39 + lang/perl-www-curl/Makefile | 39 + ...00-perl-www-curl_disable_curl-config_hack.patch | 11 + lang/perl-www-mechanize/Makefile | 44 + lang/perl-www/Makefile | 39 + lang/perl/Makefile | 200 + lang/perl/files/Module/ScanDeps.pm | 1083 + lang/perl/files/config.sh-arm.in | 1068 + lang/perl/files/config.sh-armeb.in | 1068 + lang/perl/files/config.sh-avr32.in | 1070 + lang/perl/files/config.sh-i486.in | 1068 + lang/perl/files/config.sh-mips.in | 1068 + lang/perl/files/config.sh-mipsel.in | 1068 + lang/perl/files/config.sh-powerpc.in | 1068 + lang/perl/files/perlmod-deps.sh | 81 + lang/perl/files/scan-perlbase.sh | 176 + lang/perl/files/strippm.sh | 11 + lang/perl/patches/100-static_uudmap.patch | 49 + ...01-fix-cross-compile-endianness-detection.patch | 22 + ...00-host-libc-dir-moved-debian+derivatives.patch | 27 + lang/perl/perlbase.mk | 1640 + lang/perl/perlmod.mk | 53 + lang/php-pear-db/Makefile | 43 + .../patches/100-php5-deprecation-fixes.patch | 34 + lang/php-pear-xmlrpc/Makefile | 46 + lang/php-pear/Makefile | 44 + .../patches/000-remove_deprecation_messages.patch | 62 + lang/php4/Makefile | 369 + lang/php4/files/php.ini | 561 + lang/php4/files/php.init | 12 + lang/php4/patches/002-configure.patch | 83 + lang/php4/patches/003-dns_skipname.patch | 22 + lang/php4/patches/004-uts_domainname.patch | 11 + lang/php4/patches/100-compile_fix.patch | 18 + lang/php4/patches/110-openssl-1.0.0-compat.patch | 72 + lang/php5/Makefile | 576 + lang/php5/files/php.ini | 311 + lang/php5/files/php5-fastcgi.config | 3 + lang/php5/files/php5-fastcgi.init | 30 + lang/php5/patches/005-APC.patch | 22543 ++++++++ lang/php5/patches/010-PECL-dio.patch | 3546 ++ .../011-PECL-dio-additional-baudrates.patch | 29 + lang/php5/patches/020-PECL-add-libevent.patch | 1857 + lang/php5/patches/030-PECL-add-http.patch | 29944 +++++++++++ lang/php5/patches/090-restore-sqlite2.patch | 50845 +++++++++++++++++++ lang/php5/patches/091-fix-sqlite2.patch | 101 + .../101-fix_membar_producer_link_error_gcc3x.patch | 11 + ...02-debian_patches_use_embedded_timezonedb.patch | 620 + ...03-debian_patches_use_embedded_timezonedb.patch | 19 + .../patches/950-Fix-dl-cross-compiling-issue.patch | 14 + lang/php5/pecl.mk | 40 + lang/psycopg/Makefile | 57 + lang/pybluez/Makefile | 54 + lang/pyclips/Makefile | 48 + lang/pyevent/Makefile | 45 + .../patches/000-libenevt_path_from_env.patch | 20 + lang/pyevent/patches/001-event-pyx-python25.patch | 11 + lang/pygobject/Makefile | 113 + .../patches/010-binary-constants-module.patch | 386 + lang/pymysql/Makefile | 51 + lang/pymysql/patches/000-setup.patch | 12 + lang/pymysql/patches/010-threadsafe.patch | 11 + lang/pyopenssl/Makefile | 48 + lang/pypcap/Makefile | 47 + lang/pypcap/patches/000-no_cpickle.patch | 142 + lang/pypcap/patches/001-python2_5.patch | 11 + lang/pyrrd/Makefile | 50 + lang/pyrrd/patches/101-cross.patch | 10 + lang/pyrrd/patches/200-fetch.patch | 31 + lang/pyserial/Makefile | 49 + lang/pysqlite/Makefile | 58 + lang/pysqlite/files/setup.cfg.in | 5 + lang/python-cjson/Makefile | 48 + .../patches/001-unicode-buffer-overflow.patch | 79 + lang/python-crypto/Makefile | 46 + lang/python-curl/Makefile | 45 + lang/python-curl/patches/001-no_static.patch | 12 + lang/python-dbus/Makefile | 72 + lang/python-django/Makefile | 51 + lang/python-eeml/Makefile | 52 + lang/python-eeml/patches/101-cross.patch | 12 + lang/python-flup/Makefile | 52 + lang/python-ifconfig/Makefile | 48 + lang/python-ifconfig/patches/001-errorcheck.patch | 69 + .../patches/002-checkflags-up.patch | 39 + lang/python-imaging-library/Makefile | 59 + .../patches/101-cross_compile.patch | 33 + lang/python-json/Makefile | 48 + lang/python-mimms/Makefile | 58 + lang/python-pyosc/Makefile | 52 + lang/python-sip/Makefile | 148 + lang/python-sip/files/python-sip-package.mk | 10 + lang/python-sip/files/sipconfig.macros.template | 87 + lang/python-sip/patches/100-cross-compile.patch | 208 + lang/python-webpy/Makefile | 52 + lang/python/Makefile | 508 + lang/python/files/python-package.mk | 77 + lang/python/patches/000-cross-compile.patch | 112 + .../patches/020-dont-compile-python-files.patch | 33 + lang/python/patches/030-fixup-include-dirs.patch | 50 + .../040-dont-import-cross-compiled-modules.patch | 43 + .../patches/070-dont-clean-ipkg-install.patch | 23 + .../patches/080-distutils-dont_adjust_files.patch | 63 + lang/python/patches/110-enable-zlib.patch | 15 + .../120-force-internal-modules-for-hashlib.patch | 25 + lang/python/patches/130-readline-setup.patch | 36 + lang/python/patches/140-verbose-sharedmods.patch | 11 + lang/python2-chardet/Makefile | 47 + lang/pyusb/Makefile | 46 + lang/pyxdg/Makefile | 47 + lang/pyyaml/Makefile | 47 + lang/ruby/Makefile | 486 + ...001-Add-option-which-enable-SSLv2-support.patch | 53 + lang/sigscheme/Makefile | 50 + lang/simplejson/Makefile | 46 + lang/sqlite3-ruby/Makefile | 50 + lang/tcl/Makefile | 67 + .../100-disable_tzdata_and_msgs_install.patch | 22 + lang/tcl/patches/200-fix_mips_build.patch | 20 + lang/telepathy-python/Makefile | 49 + lang/twisted/Makefile | 248 + lang/twisted/patches/000-select_submodules.patch | 25 + lang/twisted/patches/001-dont_use_zope.patch | 162 + lang/urbi/Makefile | 66 + lang/urbi/patches/001-no_examples.patch | 31 + lang/urbi/patches/005-fix-gcc_4_3-compile.patch | 22 + lang/xapian-bindings/Makefile | 50 + lang/yapsnmp/Makefile | 67 + lang/yapsnmp/patches/000-compile_fix.patch | 334 + lang/yapsnmp/patches/001-automake-compat.patch | 46 + libs/aalib/Makefile | 60 + libs/aalib/patches/001-destdir.patch | 91 + libs/alsa-lib/Makefile | 88 + libs/alsa-lib/patches/001-link_fix.patch | 26 + .../patches/003-mips-atomic-static-inline.patch | 40 + libs/alsa-lib/patches/004-ccache.patch | 27 + libs/apr-util/Makefile | 75 + libs/apr-util/patches/001-automake-compat.patch | 21 + libs/apr/Makefile | 77 + libs/apr/patches/001-autoconf-compat.patch | 22 + libs/apr/patches/101-fix_apr_time_now.patch | 13 + libs/argp-standalone/Makefile | 37 + .../patches/001-throw-in-funcdef.patch | 79 + libs/argtable/Makefile | 61 + libs/avahi/Makefile | 313 + libs/avahi/files/avahi-daemon.conf | 28 + libs/avahi/files/avahi-daemon.init | 23 + libs/avahi/files/service-http | 10 + libs/avahi/files/service-ssh | 9 + .../010-step_back_autotools-no-gettext.patch | 80 + libs/axtls/Makefile | 93 + libs/axtls/files/config | 126 + libs/axtls/patches/001-opt_flags.patch | 32 + libs/axtls/patches/002-axhttpd_install.patch | 15 + libs/bluez-libs/Makefile | 50 + .../patches/010-dont-override-libdir.patch | 15 + libs/boost/Makefile | 377 + libs/boost/patches/100-do-not-use-librt.patch | 25 + libs/c-ares/Makefile | 47 + libs/cgilib/Makefile | 55 + libs/cgilib/patches/200-cgitest_bugfix.patch | 11 + libs/cgilib/patches/300-cpp_bugfix.patch | 22 + libs/check/Makefile | 61 + libs/classpath/Makefile | 88 + libs/classpath/patches/000-fix_include.patch | 14 + libs/clearsilver/Config.in | 11 + libs/clearsilver/Makefile | 101 + .../clearsilver/patches/001-gcc-vs-dollar-cc.patch | 11 + .../patches/002-make-install-depends.patch | 99 + libs/clearsilver/patches/003-disable-tests.patch | 11 + libs/clearsilver/patches/100-remove_warnings.patch | 690 + .../patches/101-fix_content_type_ff3.patch | 11 + .../patches/102-add_x_requested_http_headers.patch | 11 + libs/clinkc/Makefile | 54 + libs/confuse/Makefile | 77 + libs/confuse/patches/001-no_werror.patch | 24 + libs/credis/Makefile | 51 + libs/credis/patches/200-Makefile.patch | 15 + libs/curl/Makefile | 116 + libs/curl/patches/100-cross-compile.patch | 117 + libs/curl/patches/200-no_docs_tests.patch | 22 + libs/cyrus-sasl/Makefile | 108 + libs/cyrus-sasl/patches/001-automake-compat.patch | 125 + .../cyrus-sasl/patches/200-fix_avr32_compile.patch | 11 + libs/db47/Makefile | 98 + libs/db47/patches/001-sequence_lock.patch | 56 + libs/db47/patches/002-lock.patch | 43 + libs/db47/patches/003-dead_lock.patch | 212 + libs/dbus-glib/Makefile | 74 + libs/dbus-glib/patches/001-cross.patch | 96 + .../patches/003-disable-tests-docs-examples.patch | 29 + libs/elfutils/Makefile | 65 + .../patches/001-elfutils-portability.patch | 1243 + libs/elfutils/patches/002-no_tests.patch | 22 + .../patches/003-no_warnings_as_errors.patch | 99 + libs/elfutils/patches/004-memcpy_def.patch | 14 + libs/elfutils/patches/005-only_libdw_libelf.patch | 27 + libs/elfutils/patches/006-libdw_LIBS.patch | 24 + libs/eventlog/Makefile | 49 + libs/expat/Makefile | 66 + libs/ezxml/Makefile | 53 + libs/ezxml/patches/100-cross_compile.patch | 16 + libs/ezxml/patches/101-build_shared.patch | 26 + libs/ezxml/patches/200-ezxml_parse_str.patch | 36 + libs/ezxml/patches/201-ezxml_int.patch | 123 + libs/ezxml/patches/202-ezxml_child.patch | 20 + libs/ezxml/patches/203-ezxml_cut.patch | 23 + libs/faad2/Makefile | 96 + libs/fcgi/Makefile | 80 + libs/fcgi/patches/100-fcgio-int-type-fix.patch | 38 + libs/fcgi/patches/110-no_examples.patch | 24 + libs/fftw3/Makefile | 118 + libs/fftw3/patches/001-makefile.patch | 20 + libs/file/Makefile | 91 + libs/firewall-mod-save/Makefile | 51 + libs/firewall-mod-save/files/20_save.sh | 73 + libs/flac/Makefile | 72 + libs/flac/patches/001-no-docs-and-examples.patch | 73 + libs/flac/patches/002-no-utility.patch | 24 + libs/flac/patches/010-automake-compat.patch | 11 + libs/freetype/Makefile | 72 + libs/fribidi/Makefile | 46 + libs/ftplib/Makefile | 51 + .../patches/001-fix_ascii_read_without_eol.patch | 38 + .../ftplib/patches/002-check_getserv_by_name.patch | 28 + libs/gd/Makefile | 77 + libs/gd/patches/100-configure_fix.patch | 30 + libs/gd/patches/101-gdlib-config.patch | 20 + libs/gdbm/Makefile | 56 + libs/gettext-full/Makefile | 63 + libs/gettext-full/patches/001-autotools.patch | 35 + .../patches/001-no_examples_and_tests.patch | 22 + .../patches/003-gettext-error_print_progname.patch | 11 + .../004-gnulib-uclibc-sched_param-def.patch | 17 + .../patches/005-uclibc-0.9.30-compat.patch | 22 + libs/gettext-full/patches/100-error_progname.patch | 10 + .../gettext-full/patches/120-uclibc-nolocale.patch | 11 + .../patches/150-disable_libxml_iconv.patch | 22 + libs/gettext-full/patches/160-eglibc_stdio.patch | 36 + libs/gettext/Makefile | 63 + libs/gettext/src/include/libintl.h | 53 + libs/gettext/src/m4/codeset.m4 | 21 + libs/gettext/src/m4/gettext.m4 | 383 + libs/gettext/src/m4/intl.m4 | 294 + libs/gettext/src/m4/intldir.m4 | 19 + libs/gettext/src/m4/intlmacosx.m4 | 51 + libs/gettext/src/m4/lcmessage.m4 | 31 + libs/gettext/src/m4/nls.m4 | 32 + libs/gettext/src/m4/po.m4 | 449 + libs/giflib/Makefile | 56 + libs/glib/Makefile | 85 + libs/glib/patches/001-automake-compat.patch | 286 + libs/glib/patches/002-glibconfig-sysdefs.h.patch | 9 + libs/glib/patches/003-gcc-3.4-compat.patch | 22 + libs/glib/patches/004-underquoted-glib.m4.patch | 11 + libs/glib2/Makefile | 100 + libs/glib2/patches/001-automake-compat.patch | 12 + .../patches/002-missing-gthread-include.patch | 10 + libs/glib2/patches/010-move-iconv-to-libs.patch | 10 + .../patches/020-no-docs-tests-translations.patch | 81 + libs/glibmm/Makefile | 65 + ...-disable-examples-tests-doc-tools-scripts.patch | 125 + libs/gmp/Makefile | 62 + libs/gnutls/Makefile | 186 + libs/gnutls/patches/001-no_doc_tests_po.patch | 65 + libs/gperf/Makefile | 39 + libs/gpgme/Makefile | 63 + libs/gsl/Makefile | 53 + libs/gsm/Makefile | 93 + libs/gsm/patches/001-debian-libsgm-1.0.10-13.patch | 428 + libs/howl/Makefile | 148 + libs/howl/files/autoipd.init | 15 + libs/howl/files/mDNSResponder.conf | 2 + libs/howl/files/mDNSResponder.init | 14 + libs/howl/files/nifd.init | 14 + libs/howl/patches/001-config.patch | 14 + libs/howl/patches/002-debug_log.patch | 10 + libs/howl/patches/003-proto_fix.patch | 11 + libs/howl/patches/004-linux_types.patch | 11 + libs/id3lib/Makefile | 52 + libs/id3lib/patches/100-missing_include.patch | 11 + ...-fix-configure-remove-check-for-iomanip_h.patch | 24 + libs/id3lib/patches/130-fix-includes.patch | 25 + libs/id3lib/patches/140-dont-build-examples.patch | 15 + libs/iksemel/Makefile | 68 + libs/iksemel/patches/001-missing-macros.patch | 163 + libs/intltool/Makefile | 46 + libs/jansson/Makefile | 43 + .../01-jansson-add-jason_object_deep_update.patch | 50 + .../patches/100-add-jason_object_deep_update.patch | 10 + libs/jpeg/Makefile | 98 + libs/jpeg/patches/001-allow-ccache.patch | 11 + libs/jpeg/patches/200-crop.patch | 1896 + libs/keynote/Makefile | 56 + libs/keynote/patches/001-build.patch | 345 + libs/keynote/patches/002-cross_compile.patch | 588 + libs/ldns/Makefile | 80 + libs/leptonica/Makefile | 47 + libs/libIDL2/Makefile | 71 + libs/libaio/Makefile | 59 + .../001-arches_from_debian_package_0.3.106-8.patch | 770 + libs/libaio/patches/002-avr32_support.patch | 118 + libs/libamsel/Makefile | 56 + libs/libao/Makefile | 62 + libs/libart/Makefile | 74 + libs/libassuan/Makefile | 64 + libs/libatomicops/Makefile | 57 + libs/libaudiofile/Makefile | 77 + .../patches/001-audiofile-config-libdirs.patch | 13 + libs/libcap/Makefile | 55 + libs/libcelt/Makefile | 57 + libs/libcli/Makefile | 56 + libs/libconfig/Makefile | 61 + libs/libcroco/Makefile | 59 + libs/libcroco/patches/001-automake-compat.patch | 11 + libs/libcrypto++/Makefile | 57 + .../patches/001-strict_gcc43_include.patch | 16 + .../patches/002-cryptest_data_files_location.patch | 500 + libs/libcrypto++/patches/003-autoconf_files.patch | 822 + libs/libcunit/Makefile | 71 + libs/libdaemon/Makefile | 70 + libs/libdaq/Makefile | 70 + libs/libdaq/patches/001-cross-compile-test.patch | 18 + libs/libdbi/Makefile | 47 + libs/libdbi/patches/001-no_docs.patch | 24 + libs/libdirectfb/Makefile | 118 + libs/libdirectfb/patches/disable-asm.patch | 13 + libs/libdlna/Makefile | 78 + libs/libdlna/patches/100-configure_fix.patch | 120 + libs/libdlna/patches/200-parallel-build.patch | 17 + libs/libdlna/patches/300-ffmpeg_compat.patch | 39 + libs/libdmapsharing/Makefile | 66 + .../libdmapsharing/patches/001-diable_pixbuf.patch | 24 + libs/libdnet/Makefile | 144 + libs/libdnet/patches/001-dnet_config.patch | 23 + libs/libdnet/patches/002-fix_avr32_compile.patch | 20 + libs/libdnet/patches/010-gcc4.patch | 20 + libs/libdvbpsi/Makefile | 56 + libs/libdvbpsi/patches/001-no_doc_examples.patch | 25 + libs/libdvdread/Makefile | 65 + libs/libelf/Makefile | 61 + libs/libevent/Makefile | 66 + libs/libevent2/Makefile | 156 + libs/libexif/Makefile | 59 + libs/libexif/patches/100-no_doc.patch | 11 + libs/libffi/Makefile | 74 + libs/libfreecwmp/Makefile | 44 + libs/libfreefare/Makefile | 79 + libs/libfreenect/Makefile | 44 + libs/libftdi/Makefile | 49 + libs/libgcrypt/Makefile | 70 + libs/libgcrypt/patches/001-no_docs_tests.patch | 26 + libs/libgpg-error/Makefile | 79 + libs/libgphoto2/Makefile | 103 + libs/libgphoto2/patches/001-automake-compat.patch | 53 + .../002-no-tests-docs-examples-translations.patch | 86 + libs/libgssapi/Makefile | 51 + libs/libiconv-full/Makefile | 86 + .../libiconv-full/patches/100-strip_charsets.patch | 3438 ++ libs/libiconv-full/patches/101-autotools.patch | 26014 ++++++++++ .../patches/103-configure_ac_fix.patch | 31 + .../patches/200-work-with-libtool2.patch | 17 + libs/libiconv/COPYING | 504 + libs/libiconv/COPYRIGHT | 20 + libs/libiconv/Makefile | 79 + libs/libiconv/src/iconv.c | 440 + libs/libiconv/src/include/charmaps.h | 80 + libs/libiconv/src/include/charmaps/iso-8859-10.h | 24 + libs/libiconv/src/include/charmaps/iso-8859-13.h | 24 + libs/libiconv/src/include/charmaps/iso-8859-14.h | 25 + libs/libiconv/src/include/charmaps/iso-8859-16.h | 24 + libs/libiconv/src/include/charmaps/iso-8859-2.h | 24 + libs/libiconv/src/include/charmaps/iso-8859-3.h | 24 + libs/libiconv/src/include/charmaps/iso-8859-4.h | 24 + libs/libiconv/src/include/charmaps/iso-8859-5.h | 24 + libs/libiconv/src/include/charmaps/iso-8859-6.h | 24 + libs/libiconv/src/include/charmaps/iso-8859-7.h | 24 + libs/libiconv/src/include/charmaps/iso-8859-8.h | 24 + libs/libiconv/src/include/charmaps/iso-8859-9.h | 24 + libs/libiconv/src/include/charmaps/koi8-r.h | 24 + libs/libiconv/src/include/charmaps/windows-1250.h | 24 + libs/libiconv/src/include/charmaps/windows-1251.h | 24 + libs/libiconv/src/include/charmaps/windows-1252.h | 25 + libs/libiconv/src/include/charmaps/windows-1253.h | 24 + libs/libiconv/src/include/charmaps/windows-1254.h | 24 + libs/libiconv/src/include/charmaps/windows-1255.h | 24 + libs/libiconv/src/include/charmaps/windows-1256.h | 24 + libs/libiconv/src/include/charmaps/windows-1257.h | 24 + libs/libiconv/src/include/charmaps/windows-1258.h | 24 + libs/libiconv/src/include/charmaps/windows-874.h | 24 + libs/libiconv/src/include/iconv.h | 32 + libs/libiconv/src/m4/iconv.m4 | 214 + libs/libid3tag/Makefile | 59 + libs/libidn/Makefile | 59 + libs/libidn/patches/001-remove-libtool.patch | 10 + .../patches/002-disable-po-docs-examples.patch | 22 + libs/libimobiledevice/Makefile | 91 + libs/libinklevel/Makefile | 58 + libs/libinklevel/patches/001-configure.patch | 275 + libs/libinklevel/patches/002-disable_parport.patch | 55 + .../patches/003-fix_usb_device_location.patch | 20 + libs/liblo/Makefile | 83 + libs/libmad/Makefile | 82 + .../patches/001-mips_removal_h_constraint.patch | 70 + libs/libmbus/Makefile | 105 + libs/libmcrypt/Makefile | 60 + libs/libmicrohttpd/Makefile | 53 + libs/libmicroxml/Makefile | 53 + libs/libmikmod/Makefile | 77 + libs/libmikmod/patches/001-disable-doc.patch | 21 + libs/libmikmod/patches/003-automake-compat.patch | 16 + libs/libmms/Makefile | 62 + libs/libmnl/Makefile | 74 + libs/libmodbus/Makefile | 50 + libs/libmpcdec/Makefile | 55 + libs/libmpcdec/patches/001-automake-compat.patch | 10 + libs/libmpcdec/patches/100-fixed_point.patch | 11 + libs/libmpd/Makefile | 53 + libs/libmpdclient/Makefile | 67 + libs/libmpeg2/Makefile | 60 + libs/libmpeg2/patches/101-ppc_no_altivec.patch | 66 + .../patches/102-arm_data_preload_check.patch | 19 + libs/libnatpmp/Makefile | 83 + libs/libnatpmp/patches/001-cross_compile.patch | 12 + libs/libnet-1.0.x/Makefile | 74 + .../patches/100-debian_subset.patch.gz | Bin 0 -> 208420 bytes libs/libnet-1.0.x/patches/150-portability.patch | 28 + libs/libnet-1.1.x/Makefile | 75 + libs/libnet-1.1.x/patches/100-debian-subset.patch | 107 + libs/libnet-1.1.x/patches/150-portability.patch | 14 + libs/libnet-1.1.x/patches/160-endian_cache.patch | 18 + libs/libnetfilter-conntrack/Makefile | 72 + libs/libnetfilter-log/Makefile | 72 + libs/libnetfilter-queue/Makefile | 72 + libs/libnfc/Makefile | 118 + libs/libnfnetlink/Makefile | 69 + libs/libnfsidmap/Makefile | 53 + libs/libnfsidmap/patches/000-no-getgrouplist.patch | 17 + libs/libnids/Makefile | 66 + libs/libnids/patches/001-no_asm_for_i386.patch | 12 + libs/libnids/patches/002-configure.patch | 62 + libs/libnids/patches/003-missing_else.patch | 11 + libs/libogg/Makefile | 55 + libs/liboil/Makefile | 65 + .../patches/001-no-tools-docs-examples.patch | 22 + libs/liboil/patches/002-pkgconfig.patch | 19 + libs/libol/Makefile | 69 + libs/liboping/Makefile | 82 + libs/liboping/patches/01-no-werror.patch | 11 + libs/libosip2/Makefile | 63 + libs/libosip2/patches/001-automake-compat.patch | 8 + libs/libowfat/Makefile | 59 + libs/libpam/Makefile | 71 + libs/libpam/patches/000-OE-libpam-xtests.patch | 35 + libs/libpam/patches/000-OE-pam-no-innetgr.patch | 85 + libs/libpam/patches/001-no_nis.patch | 68 + libs/libpam/patches/002-no_yywrap.patch | 26 + libs/libpam/patches/003-no_doc.patch | 36 + libs/libpam/patches/004-fix_lib64.patch | 16 + libs/libpam/patches/005-fix_ruserok.patch | 364 + libs/libpam/patches/006-fix_xdr.patch | 272 + libs/libpar2/Makefile | 58 + .../patches/100-par2cmdline-0.4-packed.patch | 217 + libs/libpfm/Makefile | 63 + libs/libplist/Makefile | 96 + libs/libpng/Makefile | 64 + libs/libpng/patches/100-config_fix.patch | 10 + libs/libpng/patches/200-CVE-2011-3026.patch | 40 + libs/libpthread-stubs/Makefile | 48 + libs/libptmalloc3/Makefile | 44 + libs/libptmalloc3/patches/100-nothreads.patch | 20 + libs/librpcsecgss/Makefile | 53 + libs/librsync/Makefile | 59 + libs/librsync/patches/001-4gb_files.patch | 31 + libs/libsamplerate/Makefile | 53 + libs/libsamplerate/patches/001-fix-m4-loop.patch | 18 + libs/libsdl/Makefile | 161 + libs/libsdl/patches/001-automake-compat.patch | 5 + libs/libsdl_mixer/Makefile | 77 + libs/libsdl_mixer/files/sdl-config | 3 + .../libsdl_mixer/patches/001-automake-compat.patch | 10 + libs/libsdl_mixer/patches/002-fix-linking.patch | 17 + libs/libsdl_sound/Makefile | 62 + libs/libshout/Makefile | 66 + libs/libshout/patches/100-ogg-c.patch | 13 + libs/libshout/patches/110-shout-ogg-c.patch | 13 + libs/libshout/patches/120-vorbis-c.patch | 13 + .../patches/140-no_example_doc_win32.patch | 21 + libs/libsigc++/Makefile | 61 + .../patches/001-no_doc_tests_examples.patch | 22 + libs/libsml/Makefile | 51 + libs/libsml/patches/010-no-examples-tests.patch | 13 + libs/libsml/patches/020-ldflags.patch | 11 + libs/libsml/patches/030-cross-compile.patch | 8 + libs/libsndfile/Makefile | 61 + libs/libsndfile/patches/001-automake-compat.patch | 10 + libs/libsoup/Makefile | 64 + libs/libspe2/Makefile | 47 + .../patches/001-remove_tls_requirement.patch | 93 + libs/libsrtp/Makefile | 54 + .../1003_fix_mips_namespace_collision.patch | 59 + libs/libsrtp/patches/1005_fix_data_alignment.patch | 33 + libs/libsrtp/patches/1007_update_Doxyfile.patch | 94 + libs/libsrtp/patches/1008_shared-lib.patch | 55 + libs/libssh2/Makefile | 52 + libs/libsynce/Makefile | 65 + libs/libtasn1/Makefile | 63 + libs/libtheora/Makefile | 64 + libs/libtheora/patches/001-no_docs_tests.patch | 45 + libs/libtorrent/Makefile | 70 + .../patches/000-upstream-gcc46-fixes.patch | 31 + .../libtorrent/patches/100-fix_cross_compile.patch | 31 + .../patches/120-fix-ipv6_socket_datagram.patch | 26 + libs/libtwin/Makefile | 69 + libs/libtwin/patches/100-compile_fix.patch | 11 + libs/libupnp/Makefile | 75 + libs/libusb-1.0/Makefile | 56 + libs/libusb-1.0/patches/001-timerfd.patch | 33 + libs/libusb/Makefile | 90 + libs/libusb/patches/000-debian_packed.patch | 52 + libs/libusb/patches/001-debian_ansi_types.patch | 194 + libs/libusb/patches/002-no_libusbpp.patch | 106 + libs/libusb/patches/003-automake-compat.patch | 10 + libs/libusb/patches/004-no_unused.patch | 11 + libs/libv4l/Makefile | 113 + libs/libv4l/patches/001-no-shm_open-fix.patch | 57 + .../patches/002-allow-disabling-libjpeg.patch | 160 + libs/libv4l/patches/003-add-missing-libs.patch | 66 + libs/libv4l/patches/004-disable-qv4l2.patch | 24 + libs/libvncserver/Makefile | 59 + .../libvncserver/patches/001-automake-compat.patch | 6426 +++ libs/libvncserver/patches/100-noexamples.patch | 43 + libs/libvorbis/Makefile | 61 + libs/libvorbis/patches/001-automake-compat.patch | 10 + libs/libvorbisidec/Makefile | 52 + libs/libxapian/Makefile | 85 + libs/libxapian/patches/001-missing_includes.patch | 50 + .../patches/002-xapian_config_no_ltlibs.patch | 55 + libs/libxml2/Makefile | 105 + libs/libxml2/patches/001-debian_CVEs.patch | 1028 + libs/libxslt/Makefile | 146 + libs/libyaml/Makefile | 48 + libs/libzip/Makefile | 74 + libs/libzstream/Makefile | 69 + libs/lzo/Makefile | 56 + libs/matrixssl/Makefile | 57 + libs/matrixssl/patches/100-matrixssl_1.2.4.patch | 1971 + libs/matrixssl/patches/200-compile-fixes.patch | 64 + libs/mxml/Makefile | 55 + libs/mxml/patches/001-targets.patch | 12 + libs/mysql/Makefile | 205 + libs/mysql/conf/my.cnf | 54 + libs/mysql/files/lex_hash.h | 6190 +++ libs/mysql/files/mysqld.init | 30 + libs/mysql/patches/500-cross_compile.patch | 1444 + .../patches/501-disable-pthread-and-tests.patch | 117 + libs/mysql/patches/502-fix-hostname.patch | 11 + libs/nacl/Makefile | 47 + libs/nacl/do-openwrt | 206 + libs/neon/Makefile | 63 + libs/neon/patches/001-automake-compat.patch | 5 + libs/newt/Makefile | 76 + .../patches/100-compile-fix-broken-makefile.patch | 68 + .../patches/110-disable-snackmodule-python.patch | 45 + libs/nmeap/Makefile | 41 + libs/nmeap/patches/100-no_test.patch | 21 + libs/opal/Makefile | 69 + libs/opal/patches/010-fix-gcc_4_3-compile.patch | 25 + libs/opencdk/Makefile | 76 + libs/opencdk/patches/100-fix-tests-build | 22 + libs/opencdk/patches/200-verify-clearsigned.patch | 13 + libs/openh323/Makefile | 49 + libs/openh323/patches/001-configure.patch | 122 + libs/openldap/Makefile | 150 + libs/openldap/files/ldap.init | 19 + libs/openldap/patches/001-automake-compat.patch | 312 + libs/openldap/patches/020-autofs-schema.patch | 26 + libs/openldap/patches/750-no-strip.patch | 22 + libs/orbit2/Makefile | 103 + libs/orbit2/patches/001-remove-libtool.patch | 6648 +++ .../orbit2/patches/010-dont-run-testprograms.patch | 38 + libs/ortp/Makefile | 75 + libs/ossp-js/Makefile | 119 + libs/pcre/Makefile | 86 + libs/pcre/patches/750-pcre_config_cross.patch | 26 + libs/phidget21/Makefile | 86 + libs/poco/Makefile | 58 + libs/poco/patches/100-sharedmemory.patch | 26 + libs/polarssl/Makefile | 81 + libs/polarssl/patches/100-disable-testsuites.patch | 29 + libs/popt/Makefile | 59 + libs/popt/patches/002-no-intl.patch | 81 + libs/postgresql/Makefile | 250 + libs/postgresql/files/postgresql.config | 5 + libs/postgresql/files/postgresql.init | 93 + libs/postgresql/patches/200-ranlib.patch | 10 + .../patches/800-busybox-default-pager.patch | 13 + libs/protobuf-c/Makefile | 57 + libs/protobuf/Makefile | 74 + libs/pthsem/Makefile | 59 + libs/ptlib/Makefile | 109 + libs/ptlib/patches/010-fix-gcc_4_3-compile.patch | 13 + libs/ptlib/patches/020-uclibc-res_nsearch.patch | 14 + libs/pwlib/Makefile | 90 + libs/pwlib/patches/002-lib_mak.patch | 11 + libs/radiusclient-ng/Makefile | 96 + .../patches/001-cross_compile.patch | 48 + libs/radlib/Makefile | 62 + .../patches/001-cross_compile_link_bug.patch | 71 + libs/rblibtorrent/Makefile | 77 + .../patches/enable-shared-linking.patch | 11 + libs/re/Makefile | 64 + libs/rem/Makefile | 62 + libs/rrdtool-1.0.x/Makefile | 131 + .../patches/001-no_ordering_cd_joke.patch | 21 + libs/rrdtool-1.0.x/patches/002-no_timezone.patch | 24 + .../rrdtool-1.0.x/patches/020-x86-float-cast.patch | 13 + libs/sctp/Makefile | 60 + libs/serdisplib/Makefile | 57 + libs/shflags/Makefile | 48 + libs/shflags/patches/000-strip.patch | 763 + libs/slang2/Makefile | 97 + libs/slang2/files/ncurses5-config | 6 + libs/spandsp/Makefile | 46 + libs/spandsp/patches/100-compile-fixes.patch | 23 + libs/speex/Makefile | 104 + libs/sqlite2/Makefile | 101 + libs/sqlite3/Makefile | 102 + libs/st2205tool/Makefile | 59 + libs/st2205tool/patches/100-base-makefile.patch | 45 + libs/st2205tool/patches/110-libst-makefile.patch | 25 + libs/st2205tool/patches/120-setpic-makefile.patch | 18 + libs/sysfsutils/Makefile | 69 + libs/sysfsutils/patches/200-mnt_path_check.patch | 55 + libs/taglib/Makefile | 72 + libs/taglib/patches/100-uclibc++-compat.patch | 49 + libs/tcp_wrappers/Makefile | 61 + libs/tcp_wrappers/patches/001-debian_subset.patch | 936 + libs/tcp_wrappers/patches/002-opt_cflags.patch | 12 + .../tcp_wrappers/patches/003-scaffold_malloc.patch | 17 + libs/tcp_wrappers/patches/004-ipv4_prefix.patch | 72 + libs/tiff/Makefile | 105 + libs/tokyocabinet/Makefile | 62 + .../100-remove_extra_paths_from_configure.patch | 75 + .../patches/200-uclibc_0.9.30_compat.patch | 29 + libs/ucl/Makefile | 57 + libs/ucl/patches/001-autoconf-compat.patch | 11 + libs/unixodbc/Makefile | 115 + libs/unixodbc/files/unixodbc_conf.h | 22 + libs/ustl/Makefile | 63 + libs/ustl/files/Common.mk | 74 + libs/ustl/files/config.h | 286 + libs/ustl/patches/001-install-DESTDIR.patch | 56 + libs/ustl/patches/002-install_path.patch | 12 + .../patches/003-fix_stream_bounds_check_dep.patch | 54 + libs/vips/Makefile | 80 + libs/vips/patches/001-no_cpp.patch | 279 + libs/wt/Makefile | 164 + libs/wt/patches/100-fix_random_dev.patch | 38 + libs/wxbase/Makefile | 133 + libs/xmlrpc-c/Makefile | 218 + libs/xmlrpc-c/patches/001-config.mk.in.patch | 11 + libs/xmlrpc-c/patches/002-automake-compat.patch | 13 + libs/xmpp4r/Makefile | 46 + libs/zaptel-1.4.x/Makefile | 176 + libs/zaptel-1.4.x/files/10-create-device-node | 9 + .../patches/002-upstream_hrtimer.patch | 52 + .../patches/100-no_hrtimer_on_x86_only.patch | 22 + libs/zaptel-1.4.x/patches/200-Makefile-pwd.patch | 14 + libs/zaptel-1.4.x/patches/330-uname_m.patch | 15 + libs/zaptel-1.4.x/patches/340-2.6.32.patch | 16 + libs/zaptel-1.4.x/patches/350-2.6.34.patch | 11 + libs/zaptel-1.4.x/patches/360-slab.patch | 31 + libs/zaptel-1.4.x/patches/370-2.6.36.patch | 39 + libs/zaptel-1.4.x/patches/371-3.x.patch | 23 + libs/zaptel-1.4.x/patches/380-use_cross_ar.patch | 23 + .../patches/390-include_spinlock_h.patch | 19 + libs/zaptel/Makefile | 59 + .../patches/110-Makefile-tonezone_install.patch | 19 + mail/dovecot/Makefile | 71 + mail/dovecot/files/dovecot.init | 23 + mail/dovecot/patches/001-configure_in.patch | 31 + mail/dovecot/patches/002-example_conf.patch | 87 + mail/fetchmail/Makefile | 83 + mail/imapfilter/Makefile | 69 + mail/imapfilter/patches/010-pathnames.patch | 31 + mail/mini_sendmail/Makefile | 48 + mail/mini_sendmail/patches/200-fullname.patch | 36 + mail/mini_sendmail/patches/500-flags.patch | 17 + mail/msmtp/Makefile | 122 + mail/mutt/Makefile | 48 + mail/mutt/patches/001-no_po_and_docs.patch | 11 + mail/nullmailer/Makefile | 60 + mail/procmail/Makefile | 47 + mail/procmail/patches/001-procmail_openwrt.patch | 51 + mail/procmail/patches/100-rename_getline.patch | 52 + mail/ssmtp/Makefile | 62 + mail/xmail/Makefile | 59 + mail/xmail/files/xmail.config | 111 + mail/xmail/files/xmail.init | 221 + mail/xmail/patches/010-Makefile.common.patch | 21 + mail/xmail/patches/020-Makefile.lnx.patch | 15 + mail/xmail/patches/030-sysmachine.patch | 28 + mail/xmail/patches/040-honour_opt_flags.patch | 15 + multimedia/crtmpserver/Makefile | 85 + .../patches/010-link-crypt-for-lua.patch | 13 + multimedia/crtmpserver/patches/020-add-rpath.patch | 15 + .../crtmpserver/patches/030-default-config.patch | 53 + .../crtmpserver/patches/040-use-select.patch | 13 + .../patches/050-add-missing-make-defines.patch | 22 + .../patches/060-add-dl-for-crypto.patch | 13 + multimedia/darkice/Makefile | 58 + .../darkice/patches/001-upstream_svn_r494.patch | 15 + multimedia/ffmpeg/Config.in | 314 + multimedia/ffmpeg/Makefile | 431 + multimedia/fswebcam/Makefile | 45 + multimedia/ftpd-topfield/Makefile | 48 + .../ftpd-topfield/files/ftpd-topfield.config | 4 + multimedia/ftpd-topfield/files/ftpd-topfield.init | 35 + .../patches/001-kernel_header_rename.patch | 14 + multimedia/gmediaserver/Makefile | 67 + multimedia/gmediaserver/files/gmediaserver.config | 3 + multimedia/gmediaserver/files/gmediaserver.init | 27 + .../gmediaserver/patches/010-compile-fixes.patch | 144 + multimedia/gphoto2/Makefile | 53 + .../gphoto2/patches/001-automake-compat.patch | 10 + .../patches/002-disable-docs-translations.patch | 45 + multimedia/gphoto2/patches/100-gpdebug.patch | 11 + multimedia/graphicsmagick/Makefile | 98 + multimedia/gst-ffmpeg/Config.in | 269 + multimedia/gst-ffmpeg/Makefile | 170 + multimedia/gst-plugins-bad/Makefile | 252 + .../gst-plugins-bad/patches/000-gettext.patch | 23 + multimedia/gst-plugins-base/Makefile | 242 + .../gst-plugins-base/patches/001-no_docs.patch | 34 + .../gst-plugins-base/patches/002-no_tests.patch | 36 + .../patches/003-no_translations.patch | 46 + multimedia/gst-plugins-good/Makefile | 173 + .../gst-plugins-good/patches/001-no_docs.patch | 20 + .../gst-plugins-good/patches/002-no_tests.patch | 20 + .../patches/003-no_translations.patch | 30 + multimedia/gst-plugins-ugly/Makefile | 134 + .../gst-plugins-ugly/patches/001-no_docs.patch | 22 + .../gst-plugins-ugly/patches/002-no_tests.patch | 22 + .../patches/003-no_translations.patch | 32 + multimedia/gstreamer/Makefile | 197 + multimedia/gstreamer/patches/001-no_docs.patch | 36 + multimedia/gstreamer/patches/002-no_tests.patch | 39 + .../gstreamer/patches/003-no_translations.patch | 45 + multimedia/hasciicam/Makefile | 39 + multimedia/icecast/Makefile | 91 + multimedia/icecast/libvorbisidec.mk | 41 + .../icecast/patches/001-icecast-2.3.0-tremor.patch | 155 + .../patches/010-fix_libcurl_test_crap.patch | 11 + multimedia/imagemagick/Makefile | 157 + multimedia/kissdx/Makefile | 64 + multimedia/kissdx/files/kissdx.config | 34 + multimedia/kissdx/files/kissdx.init | 115 + multimedia/minidlna/Makefile | 91 + multimedia/minidlna/files/minidlna.config | 17 + multimedia/minidlna/files/minidlna.init | 91 + .../minidlna/patches/010-genconfig-checks.patch | 92 + .../minidlna/patches/020-makefile-tweaks.patch | 48 + .../minidlna/patches/030-missing-include.patch | 10 + multimedia/mjpg-streamer/Makefile | 57 + .../mjpg-streamer/files/mjpg-streamer.config | 7 + .../mjpg-streamer/files/mjpg-streamer.hotplug | 11 + multimedia/mjpg-streamer/files/mjpg-streamer.init | 57 + multimedia/motion/Makefile | 52 + multimedia/motion/patches/002-honor_cppflags.patch | 19 + multimedia/peercast/Makefile | 64 + multimedia/peercast/files/peercast.ini | 81 + multimedia/peercast/files/peercast.init | 14 + multimedia/puppy/Makefile | 36 + multimedia/ushare/Makefile | 75 + multimedia/ushare/files/ushare.config | 9 + multimedia/ushare/files/ushare.init | 68 + .../ushare/patches/100-configure_grep_fix.patch | 12 + multimedia/ushare/patches/200-compile-fixes.patch | 202 + net/aircrack-ng/Makefile | 52 + .../100-add-ignore-channel-negative-1.patch | 52 + net/aircrack-ptw/Makefile | 45 + net/aircrack-ptw/patches/001-smaller.patch | 12 + net/airpwn/Makefile | 70 + net/amule/Makefile | 86 + net/amule/patches/001-no_backtrace.patch | 98 + net/amwall/Makefile | 56 + net/amwall/patches/010-compile_fix.patch | 21 + net/aodv-uu/Makefile | 104 + net/aodv-uu/files/aodv-uu.modules | 1 + net/aodv-uu/patches/001-normalize.patch | 64 + ...02-linux_2.6.19_ip_route_me_harder_change.patch | 49 + ...linux_2.6.19_security_netlink_recv_change.patch | 16 + .../patches/004-linux_2.6.19_includes.patch | 28 + net/aodv-uu/patches/005-linux_2.6.22_skbuff.patch | 164 + net/aoetools/Makefile | 47 + net/apache/Makefile | 164 + net/apache/patches/001-Makefile_in.patch | 14 + net/apache/patches/002-test_char_h.patch | 26 + net/apache/patches/003-logdir_fix.patch | 33 + net/apache/patches/004-pidfile_fix.patch | 11 + net/apache/patches/005-httpd_conf.patch | 60 + net/apcupsd/Makefile | 74 + net/apcupsd/files/apccontrol | 146 + net/apcupsd/files/apcupsd.conf | 322 + net/apcupsd/files/apcupsd.init | 12 + net/apcupsd/files/apcupsd_mail.conf | 7 + net/apcupsd/files/changeme | 17 + net/apcupsd/files/commfailure | 17 + net/apcupsd/files/commok | 17 + net/apcupsd/files/offbattery | 17 + net/apcupsd/files/onbattery | 17 + net/apcupsd/patches/010-fix-include-paths.patch | 13 + net/apf/Makefile | 46 + net/appweb/Makefile | 104 + net/appweb/patches/001-add-ipv6-in-configure.patch | 11 + net/aprx/Makefile | 52 + net/aprx/files/aprx.init | 15 + net/aprx/patches/100-Makefile_in.patch | 27 + net/aria2/Makefile | 57 + net/arpd/Makefile | 54 + net/arpd/patches/001-configure_no_bpf.patch | 12 + net/arpd/patches/002-function_string.patch | 42 + net/arpd/patches/003-pcap_and_arg.patch | 76 + net/arpd/patches/004-no_dnet_config_check.patch | 12 + .../005-remove-dropped-libevent-features.patch | 29 + net/arpwatch/Makefile | 62 + net/arpwatch/files/arpwatch.init | 12 + net/asterisk-1.8.x/Makefile | 686 + net/asterisk-1.8.x/files/asterisk.default | 4 + net/asterisk-1.8.x/files/asterisk.init | 21 + .../patches/100-build_tools-iconv.patch | 11 + .../patches/200-addons-defaultenable.patch | 77 + net/asterisk-1.8.x/patches/500-nres.patch | 11 + net/asterisk-1.8.x/patches/600-CVE-2012-2186.patch | 10 + .../src-lantiq/channels/chan_lantiq.c | 1560 + .../src-lantiq/configs/lantiq.conf.sample | 138 + net/asterisk-chan-sccp-b/Makefile | 59 + net/asterisk-chan-sccp-b/files/sccp.openwrt.conf | 89 + .../patches/200-register-file-version.patch | 19 + net/asterisk-chan-sccp-b/patches/300-stdarg.patch | 10 + net/atftp/Makefile | 69 + net/atftp/patches/100-mconfig.patch | 21 + net/atftp/patches/110-services.patch | 79 + net/atftp/patches/120-retry_setting.patch | 121 + net/atftp/patches/130-missing_include.patch | 21 + net/autossh/Makefile | 50 + net/autossh/files/autossh.config | 5 + net/autossh/files/autossh.hotplug | 14 + net/autossh/files/autossh.init | 30 + net/axel/Makefile | 61 + net/babel/Makefile | 59 + net/babel/files/babeld.conf | 40 + net/babel/files/babeld.config | 69 + net/babel/files/babeld.init | 136 + net/bahamut/Makefile | 58 + net/bahamut/patches/001-cross_compile.patch | 71 + net/bahamut/patches/002-glibc_fix.patch | 37 + net/bahamut/patches/010-dont-use-host-zlib.patch | 16 + net/baresip/Makefile | 151 + net/baresip/files/baresip.init | 14 + net/baresip/patches/100-videodev-compat.patch | 11 + net/batman-adv/Config.in | 17 + net/batman-adv/Makefile | 120 + net/batman-adv/files/etc/config/batman-adv | 18 + .../files/etc/hotplug.d/net/99-batman-adv | 16 + net/batman-adv/files/lib/batman-adv/config.sh | 78 + net/batman-adv/files/usr/sbin/batman-adv | 60 + ...v-make-batadv_test_bit-return-0-or-1-only.patch | 50 + ...-adv-Fix-change-mac-address-of-soft-iface.patch | 45 + ...Fix-symmetry-check-route-flapping-in-mult.patch | 71 + net/batman/Makefile | 152 + net/batman/files/etc/config/batmand | 12 + net/batman/files/etc/config/vis | 3 + net/batman/files/etc/init.d/batmand | 66 + net/batman/files/etc/init.d/vis | 19 + net/batman/patches/100-2.6.36.patch | 47 + net/bind/Makefile | 198 + net/bind/files/bind/db.0 | 12 + net/bind/files/bind/db.127 | 13 + net/bind/files/bind/db.255 | 12 + net/bind/files/bind/db.local | 13 + net/bind/files/bind/db.root | 45 + net/bind/files/bind/named.conf.example | 45 + net/bind/files/named.init | 40 + net/bind/patches/001-no-tests.patch | 22 + net/bing/Makefile | 41 + net/bird/Makefile | 160 + net/bird/files/bird4.conf | 121 + net/bird/files/bird4.init | 21 + net/bird/files/bird4loop | 24 + net/bird/files/bird6.conf | 121 + net/bird/files/bird6.init | 21 + net/bird/files/bird6loop | 24 + net/bird/patches/0001-change_config_name.patch | 20 + net/bitchx/Makefile | 70 + net/bitchx/files/bitchxrc | 2 + net/bitchx/files/bitchxrc.init | 11 + net/bitchx/patches/001-fix_declarations.patch | 24 + net/bitchx/patches/002-tparm.patch | 10 + net/bitlbee/Makefile | 88 + net/bitlbee/files/bitlbee.init | 13 + .../patches/100-cross_compile_configure_fix | 98 + net/bmon/Makefile | 49 + net/bmon/patches/001-bugfixes.patch | 26 + net/bmx6/Makefile | 102 + net/bmx6/files/etc/config/bmx6 | 23 + net/bmx6/files/etc/init.d/bmx6 | 20 + net/bmxd/Makefile | 75 + net/bmxd/files/etc/config/bmxd | 9 + net/bmxd/files/etc/init.d/bmxd | 51 + net/btpd/Makefile | 58 + net/btpd/files/btpd.config | 7 + net/btpd/files/btpd.init | 61 + net/btpd/patches/000-sha1.diff | 731 + net/btpd/patches/001-gettime.patch | 11 + net/btpd/patches/002-config.h.patch | 13 + net/btpd/patches/100-clock.diff | 4 + net/bwm/Makefile | 38 + net/bwm/patches/001-debian.patch | 45 + net/bwping/Makefile | 41 + net/cbtt/Makefile | 84 + net/cbtt/patches/100-compile.patch | 35 + net/cdp/Makefile | 52 + net/cdp/patches/001-compile_fixes.patch | 13 + net/chaosvpn/Makefile | 48 + net/chaosvpn/files/chaosvpn.hotplug | 3 + net/chaosvpn/files/chaosvpn.init | 21 + net/chaosvpn/files/chaosvpn_config.sh | 14 + net/chaosvpn/patches/001-dist-makefile.patch | 30 + net/chillispot/Makefile | 57 + net/chillispot/files/chillispot.init | 19 + net/chillispot/patches/001-endian_fix.patch | 135 + .../patches/102-less_memory-footprint.patch | 12 + net/chillispot/patches/110-macallowed_fix.patch | 21 + .../patches/120-fix_bufferoverflow.patch | 11 + .../patches/150-chillispot-rmtctrl.patch | 1529 + net/chillispot/patches/200-gcc_fix.patch | 57 + net/chrony/Makefile | 72 + net/chrony/files/chrony.conf | 17 + net/chrony/files/chrony.keys | 1 + net/chrony/files/ntpd.config | 6 + net/chrony/files/ntpd.hotplug | 21 + net/chrony/files/ntpd.init | 56 + net/chrony/patches/001-crosscompile.patch | 25 + net/chrony/patches/002-ipv6_disabled_fixes.patch | 34 + net/cifs-utils/Makefile | 40 + net/click/Makefile | 75 + net/click/files/roofnet.init | 15 + net/click/patches/100-compile_fix.patch | 22 + net/click/patches/110-multithread_fix.patch | 12 + net/cmdftp/Makefile | 46 + net/conntrack-tools/Makefile | 59 + net/coova-chilli/Makefile | 57 + net/corkscrew/Makefile | 37 + net/crowdcontrol/Makefile | 57 + net/ctorrent/Makefile | 84 + net/ctorrent/patches/100-CVE-2009-1759.patch | 364 + net/cups-bjnp/Makefile | 47 + net/cups/Makefile | 120 + net/cups/files/cupsd.init | 19 + net/cups/files/etc/cups/classes.conf | 7 + net/cups/files/etc/cups/client.conf | 9 + net/cups/files/etc/cups/cupsd.conf | 47 + net/cups/files/etc/cups/printers.conf | 23 + net/cups/patches/100-makefile-targets.patch | 13 + net/cups/patches/140-uname.patch | 11 + net/cups/patches/150-64bit_host_fix.patch | 64 + net/cups/patches/160-ppdc.patch | 16 + net/curlftpfs/Makefile | 50 + net/curlftpfs/patches/001-uclibc_mod.patch | 37 + net/cutter/Makefile | 43 + net/daemonlogger/Makefile | 44 + net/dansguardian/Makefile | 62 + net/dansguardian/patches/001-include_dir.patch | 29 + net/dante/Makefile | 111 + net/dante/patches/001-automake-compat.patch | 482 + net/dante/patches/100-do-not-use-defdname.patch | 42 + net/dante/patches/200-fix-RTLD_NEXT.patch | 36 + net/darkstat/Makefile | 61 + net/darkstat/files/darkstat.config | 4 + net/darkstat/files/darkstat.init | 34 + net/ddns-scripts/Makefile | 42 + net/ddns-scripts/files/etc/config/ddns | 95 + net/ddns-scripts/files/etc/hotplug.d/iface/25-ddns | 9 + .../files/usr/lib/ddns/dynamic_dns_functions.sh | 136 + .../files/usr/lib/ddns/dynamic_dns_updater.sh | 354 + net/ddns-scripts/files/usr/lib/ddns/services | 59 + net/ddns-scripts/files/usr/lib/ddns/url_escape.sed | 25 + net/deluge/Makefile | 111 + net/deluge/files/deluge.config | 6 + net/deluge/files/deluge.init | 86 + net/dhcp-forwarder/Makefile | 49 + net/dhcp-forwarder/files/dhcp-fwd.init | 17 + net/dhcpcd/Makefile | 41 + net/dhcpcd/patches/001-run_dir.patch | 11 + net/dircproxy/Makefile | 37 + net/ditg/Makefile | 53 + net/djbdns/Changelog | 43 + net/djbdns/Makefile | 209 + net/djbdns/README | 319 + net/djbdns/files/axfrdns.init | 73 + net/djbdns/files/axfrdns/tcp | 5 + net/djbdns/files/djbdns.conf | 41 + net/djbdns/files/dnscache.init | 122 + net/djbdns/files/dnscache/dnsroots.global | 0 net/djbdns/files/dnscache/ignoreip-update | 95 + net/djbdns/files/dnscache/servers/@ | 0 net/djbdns/files/dnsqrx | 9 + net/djbdns/files/dnsroots-update | 9 + net/djbdns/files/rbldns.init | 67 + net/djbdns/files/rbldns/data | 5 + net/djbdns/files/tinydns.init | 63 + net/djbdns/files/tinydns/add-alias | 2 + net/djbdns/files/tinydns/add-childns | 2 + net/djbdns/files/tinydns/add-host | 2 + net/djbdns/files/tinydns/add-mx | 2 + net/djbdns/files/tinydns/add-ns | 2 + net/djbdns/files/tinydns/data | 59 + net/djbdns/files/walldns.init | 61 + net/djbdns/patches/010-crosscompile.patch | 170 + net/djbdns/patches/020-dnsroots-update.patch | 19 + .../patches/030-srv-records-and-axfrget.patch | 135 + .../patches/040-dnscache-less-chatty-log.patch | 39 + net/djbdns/patches/050-tinydns-mmap-leak.patch | 22 + .../patches/060-dnscache-big-udp-packets.patch | 11 + .../patches/070-dnscache-dpos-tcp-servfail.patch | 10 + .../patches/080-dnscache-cache-negatives.patch | 41 + net/djbdns/patches/090-tinydns-one-second.patch | 40 + net/djbdns/patches/110-dnscache-cachestats.patch | 89 + .../patches/120-compiler-temporary-filename.patch | 93 + .../patches/140-dnsnamex-extra-command.patch | 156 + .../patches/200-dnscache-cname-handling.patch | 226 + .../patches/210-dnscache-strict-forwardonly.patch | 47 + .../patches/220-dnscacheip-space-separator.patch | 11 + .../patches/230-tinydns-data-semantic-error.patch | 194 + .../240-tinydns-alias-chain-truncation.patch | 87 + net/djbdns/patches/250-dnscache-slogging.patch | 122 + net/djbdns/patches/260-dnsfilter-replace.patch | 71 + net/djbdns/patches/270-dnscache-sigpipe-fix.patch | 16 + net/djbdns/patches/280-dnscache-ignoreip2.patch | 117 + .../300-bugfix-dnscache-dempsky-poison.patch | 11 + ...0-bugfix-dnscache-merge-outgoing-requests.patch | 328 + .../320-bugfix-dnscache-cache-soa-records.patch | 67 + net/dmapd/Makefile | 61 + net/dmapd/files/dmapd.init | 30 + net/dmapd/patches/001-dmapd_conf.patch | 11 + net/dns2tcp/Makefile | 47 + net/dsl-qos-queue/Makefile | 49 + net/dsl-qos-queue/patches/001-cross_compile.patch | 40 + net/dsl-qos-queue/patches/002-include.patch | 20 + net/dsl-qos-queue/patches/010-ports_fix.patch | 22 + .../patches/020-fix_shebang_line.patch | 8 + net/dsniff/Makefile | 62 + net/dsniff/patches/001-arpspoof_fix.patch | 53 + net/dsniff/patches/001-decode_pop.patch | 122 + net/dsniff/patches/001-dns.patch | 704 + net/dsniff/patches/003-gdbm.patch | 206 + net/dsniff/patches/004-no_yp.patch | 45 + net/dsniff/patches/005-openssl_fix.patch | 11 + net/dsniff/patches/006-pcap_header.patch | 13 + net/dsniff/patches/007-time_h.patch | 22 + net/dsniff/patches/008-md5_include.patch | 13 + net/dsniff/patches/010-clk-tck-fix.patch | 15 + net/dudders/Makefile | 67 + net/dudders/files/dudders.config | 7 + net/dudders/files/dudders.hotplug | 46 + net/e169-stats/Makefile | 37 + net/e169-stats/patches/01-make.patch | 11 + net/ekg/Makefile | 51 + net/ekg/patches/100-compile-fixes.patch | 62 + net/elinks/Makefile | 92 + net/elinks/patches/002-fix_avr32_compile | 20 + net/etherpuppet/Makefile | 50 + net/etherwake/Makefile | 54 + net/etherwake/files/etherwake.config | 28 + net/etherwake/files/etherwake.init | 132 + net/etherwake/patches/100-no_ether_hostton.patch | 37 + net/ethtool/Makefile | 40 + net/ethtool/patches/100-ixp4xx.patch | 203 + net/ettercap/Makefile | 75 + net/ettercap/patches/001-cross_compiling.patch | 23 + .../patches/002-libnet_check_honor_ldflags.patch | 24 + net/ettercap/patches/003-automake-compat.patch | 34 + net/ez-ipupdate/Makefile | 48 + net/ez-ipupdate/files/ez-ipupdate.config | 14 + net/ez-ipupdate/files/ez-ipupdate.hotplug | 81 + net/ez-ipupdate/files/ez-ipupdate.init | 18 + net/ez-ipupdate/patches/001-debian_subset.patch | 568 + .../patches/002-ez_ipupdate_everydns.patch | 209 + net/ez-ipupdate/patches/003-dnsexit.patch | 263 + net/ez-ipupdate/patches/004-zoneedit.patch | 12 + net/faifa/Makefile | 96 + net/fakeidentd/Makefile | 46 + net/fakeidentd/files/fakeidentd.init | 12 + net/flow-tools/Makefile | 44 + .../patches/001-cross_compile_configure_fix.patch | 11 + net/flow-tools/patches/002-flex_lib.patch | 46 + .../patches/010-python_script_location_fix.patch | 30 + .../patches/020-invalid_lvalue_in_assignment.patch | 171 + .../patches/030-avoid_external_debug_var.patch | 13 + .../patches/050-fix-64bit_temp_time_t.patch | 41 + .../060-fix_uninitialized_var_in_flow_send.patch | 13 + .../patches/070-extra_ftpdu_verify_debugging.patch | 49 + .../080-fix_uninitialized_var_in_flow_export.patch | 13 + net/fping/Makefile | 61 + net/fping/patches/001-debian.patch | 165 + net/fprobe-ulog/Makefile | 50 + net/fprobe/Makefile | 47 + net/freepops/Makefile | 67 + net/freeradius2/Makefile | 612 + net/freeradius2/files/radiusd.init | 22 + net/freeradius2/patches/001-fix-makefile.patch | 10 + net/freeradius2/patches/002-config.patch | 588 + net/freeradius2/patches/004-ldap_configure.patch | 4253 ++ net/freeradius2/patches/008-honor_ccpflags.patch | 15 + net/freeswitch/Makefile | 798 + .../etc.minimal/autoload_configs/acl.conf.xml | 32 + .../autoload_configs/callcenter.conf.xml | 38 + .../etc.minimal/autoload_configs/console.conf.xml | 56 + .../autoload_configs/dingaling.conf.xml | 9 + .../autoload_configs/event_socket.conf.xml | 9 + .../autoload_configs/local_stream.conf.xml | 49 + .../etc.minimal/autoload_configs/lua.conf.xml | 30 + .../etc.minimal/autoload_configs/modules.conf.xml | 130 + .../autoload_configs/post_load_modules.conf.xml | 4 + .../etc.minimal/autoload_configs/sofia.conf.xml | 18 + .../etc.minimal/autoload_configs/spandsp.conf.xml | 73 + .../etc.minimal/autoload_configs/switch.conf.xml | 123 + .../autoload_configs/timezones.conf.xml | 551 + .../files/etc.minimal/dialplan/default.xml | 162 + .../files/etc.minimal/dialplan/default/PLACEHOLDER | 0 .../files/etc.minimal/dialplan/public.xml | 68 + .../files/etc.minimal/dialplan/public/PLACEHOLDER | 0 .../files/etc.minimal/directory/default.xml | 43 + .../files/etc.minimal/directory/default/1000.xml | 18 + .../files/etc.minimal/directory/default/1001.xml | 18 + .../files/etc.minimal/directory/default/1002.xml | 18 + .../files/etc.minimal/directory/default/1003.xml | 18 + .../files/etc.minimal/directory/default/1004.xml | 18 + .../etc.minimal/directory/default/default.xml | 26 + net/freeswitch/files/etc.minimal/freeswitch.xml | 71 + net/freeswitch/files/etc.minimal/fur_elise.ttml | 83 + .../files/etc.minimal/jingle_profiles/client.xml | 32 + .../files/etc.minimal/jingle_profiles/server.xml | 21 + net/freeswitch/files/etc.minimal/mime.types | 983 + .../files/etc.minimal/sip_profiles/external.xml | 78 + .../etc.minimal/sip_profiles/external/example.xml | 38 + .../files/etc.minimal/sip_profiles/internal.xml | 296 + .../etc.minimal/sip_profiles/internal/example.xml | 36 + net/freeswitch/files/etc.minimal/tetris.ttml | 69 + net/freeswitch/files/etc.minimal/tones.conf | 63 + net/freeswitch/files/etc.minimal/vars.xml | 203 + .../blacklist/autoload_configs/blacklist.conf.xml | 11 + .../etc.packages/blacklist/blacklists/blocked.list | 0 .../cdr_csv/autoload_configs/cdr_csv.conf.xml | 22 + .../autoload_configs/cdr_pg_csv.conf.xml | 40 + .../autoload_configs/event_multicast.conf.xml | 14 + .../autoload_configs/http_cache.conf.xml | 8 + .../logfile/autoload_configs/logfile.conf.xml | 26 + .../autoload_configs/pocketsphinx.conf.xml | 12 + .../rtmp/autoload_configs/rtmp.conf.xml | 17 + .../files/etc.packages/say-de/lang/de/de.xml | 11 + .../etc.packages/say-de/lang/de/demo/demo.xml | 71 + .../files/etc.packages/say-de/lang/de/vm/tts.xml | 214 + .../etc.packages/say-en/lang/en/demo/demo-ivr.xml | 148 + .../etc.packages/say-en/lang/en/demo/demo.xml | 71 + .../etc.packages/say-en/lang/en/dir/sounds.xml | 119 + .../files/etc.packages/say-en/lang/en/dir/tts.xml | 95 + .../files/etc.packages/say-en/lang/en/en.xml | 13 + .../etc.packages/say-en/lang/en/ivr/sounds.xml | 65 + .../etc.packages/say-en/lang/en/vm/sounds.xml | 404 + .../files/etc.packages/say-en/lang/en/vm/tts.xml | 239 + .../etc.packages/say-fr/lang/fr/demo/demo.xml | 18 + .../etc.packages/say-fr/lang/fr/dir/sounds.xml | 121 + .../files/etc.packages/say-fr/lang/fr/dir/tts.xml | 101 + .../files/etc.packages/say-fr/lang/fr/fr.xml | 12 + .../etc.packages/say-fr/lang/fr/vm/sounds.xml | 246 + .../etc.packages/say-he/lang/he/demo/demo-ivr.xml | 148 + .../etc.packages/say-he/lang/he/demo/demo.xml | 71 + .../etc.packages/say-he/lang/he/dir/sounds.xml | 121 + .../files/etc.packages/say-he/lang/he/he.xml | 11 + .../etc.packages/say-he/lang/he/vm/sounds.xml | 404 + .../etc.packages/say-ru/lang/ru/demo/demo-ivr.xml | 145 + .../etc.packages/say-ru/lang/ru/demo/demo.xml | 100 + .../etc.packages/say-ru/lang/ru/dir/sounds.xml | 121 + .../files/etc.packages/say-ru/lang/ru/dir/tts.xml | 96 + .../files/etc.packages/say-ru/lang/ru/ru.xml | 13 + .../etc.packages/say-ru/lang/ru/vm/sounds.xml | 365 + .../files/etc.packages/say-ru/lang/ru/vm/tts.xml | 239 + .../files/etc.packages/sms/chatplan/default.xml | 14 + .../syslog/autoload_configs/syslog.conf.xml | 18 + .../autoload_configs/tts_commandline.conf.xml | 15 + .../unimrcp/autoload_configs/unimrcp.conf.xml | 23 + .../voicemail/autoload_configs/voicemail.conf.xml | 70 + .../xml-cdr/autoload_configs/xml_cdr.conf.xml | 71 + net/freeswitch/files/freeswitch.config | 11 + net/freeswitch/files/freeswitch.default | 11 + net/freeswitch/files/freeswitch.hotplug | 65 + net/freeswitch/files/freeswitch.init | 40 + .../patches/000-build-openwrt_rules.mk.patch | 7 + .../patches/001-build-modules_conf_in.patch | 33 + net/freeswitch/patches/002-Makefile.am.patch | 49 + net/freeswitch/patches/003-libs-esl-Makefile.patch | 22 + ...c-mod-applications-mod_mp4-mp4_helper_hpp.patch | 13 + .../005-src-mod-codecs-mod_opus-Makefile.patch | 18 + .../patches/006-src-include-timerfd_wrap_h.patch | 27 + ...07-src-mod-endpoints-mod_gsmopen-Makefile.patch | 26 + ...-src-mod-event_handlers-mod_snmp-Makefile.patch | 16 + .../009-src-mod-codecs-mod_silk-Makefile.patch | 15 + net/freeswitch/patches/010-ppc_asm.patch | 13 + net/frickin/Makefile | 54 + net/frickin/files/frickin.config | 13 + net/frickin/files/frickin.init | 58 + net/fwknop/Makefile | 119 + net/fwknop/patches/001-fix_config.patch | 32 + net/fwknop/patches/002-fix_init.patch | 17 + net/gatling/Makefile | 43 + net/gatling/patches/001-fix_ld_libs.patch | 11 + net/gatling/patches/002-fix_flags.patch | 14 + net/gatling/patches/010-add_semicolon.patch | 11 + net/gesftpserver/Makefile | 53 + net/git/Makefile | 70 + net/git/patches/100-convert_builtin.patch | 248 + net/gpsd/Makefile | 159 + net/gpsd/files/gpsd.config | 5 + net/gpsd/files/gpsd.hotplug | 16 + net/gpsd/files/gpsd.init | 32 + net/haproxy/Makefile | 61 + net/haproxy/files/haproxy.cfg | 100 + net/haproxy/files/haproxy.hotplug | 8 + net/haproxy/files/haproxy.init | 23 + .../patches/001-haproxy-1.4.x-sendproxy.patch | 441 + net/hiawatha/Makefile | 63 + net/horst/Makefile | 43 + net/horst/patches/100-compile-fixes.patch | 21 + net/hping3/Makefile | 43 + net/hping3/patches/100-makefile.patch | 48 + net/hping3/patches/101-endianness.patch | 52 + net/hping3/patches/102-lib_rename.patch | 11 + net/hsflowd/Makefile | 73 + net/hsflowd/files/hsflowd.config | 11 + net/hsflowd/files/hsflowd.init | 72 + net/hsflowd/files/sflowovsd.init | 17 + net/hsflowd/patches/100-crosscompile.patch | 91 + net/hsflowd/patches/200-uclibc-compat.patch | 63 + net/hsflowd/patches/300-config_files_path.patch | 16 + net/hsflowd/patches/400-sflowovsd_assert.patch | 12 + net/htpdate/Makefile | 56 + net/htpdate/files/htpdate.default | 1 + net/htpdate/files/htpdate.init | 19 + net/htpdate/patches/100-adjtimex.patch | 20 + net/httping/Makefile | 74 + net/httping/patches/002-version.patch | 29 + net/httptunnel/Makefile | 48 + net/httptunnel/files/httptunnel.config | 4 + net/httptunnel/files/httptunnel.init | 27 + net/icmptx/Makefile | 46 + net/icmptx/patches/001-cross_compile.patch | 24 + net/ifstat/Makefile | 53 + net/ifstat/patches/001-configure_cross.patch | 913 + net/iftop/Makefile | 40 + net/iftop/patches/001-debian_armeb.patch | 11 + net/iftop/patches/002-debian_frozen_order.patch | 10 + net/iftop/patches/003-debian_arm.patch | 15 + net/iftop/patches/004-debian_bar_display.patch | 11 + net/iftop/patches/005-debian_bar_bytes.patch | 11 + net/igmpproxy/Makefile | 57 + net/igmpproxy/files/igmpproxy.config | 11 + net/igmpproxy/files/igmpproxy.init | 63 + ...ackets-with-IP-Router-Alert-option-RFC-21.patch | 79 + ...ult-interface-state-to-disabled-wrt-29458.patch | 43 + ...mp-reports-for-downstream-interfaces-wrt-.patch | 164 + ...mp-reports-forwarding-to-upstream-interfa.patch | 62 + ...-use-monotic-clock-instead-of-time-of-day.patch | 120 + net/imsnif/Makefile | 62 + net/imsnif/files/imsnif | 16 + net/imsnif/patches/001-openwrt_paths.patch | 62 + net/imspector/Makefile | 86 + net/imspector/files/imspector.config | 112 + net/imspector/files/imspector.init | 56 + .../patches/010-openssl-1.0.0-compat.patch | 14 + net/iodine/Makefile | 69 + net/iodine/files/iodined.config | 5 + net/iodine/files/iodined.init | 23 + net/iodine/patches/010-cross-compile.patch | 22 + net/ipcad/Makefile | 63 + net/ipcad/patches/001-honor_cppflags.patch | 10 + net/ipcad/patches/010-no-host-includes.patch | 16 + net/iperf/Makefile | 84 + ...et-report-next-time-in-single-thread-mode.patch | 14 + net/ipkungfu/Makefile | 80 + .../patches/001-replace-modprobe-with-insmod.patch | 22 + net/ipsec-tools/Makefile | 93 + net/ipsec-tools/files/racoon.init | 17 + .../patches/001-ipsec-tools-def-psk.patch | 25 + net/ipsec-tools/patches/001-no_libfl.patch | 22 + net/ipsec-tools/patches/002-patch8-utmp.patch | 73 + .../patches/003-microsoft-fqdn-in-main.patch | 14 + net/ipsec-tools/patches/005-isakmp-fix.patch | 11 + net/ipset/Makefile | 80 + net/ipset/patches/100-export.h.patch | 20 + net/ipset/patches/200-remove-ipv6_addr_copy.patch | 22 + net/ipset/patches/210-fix-ipv6_skip_exthdr.patch | 29 + net/iptables-snmp/Makefile | 46 + net/iptables-snmp/patches/001-use_libiptc.patch | 25 + net/iptraf/Makefile | 64 + net/iptraf/patches/001-cross_compile.patch | 23 + net/iptraf/patches/002-ifaces.patch | 281 + net/iptraf/patches/003-exit_menu.patch | 11 + net/iptraf/patches/004-includes_fix.patch | 20 + net/iptraf/patches/005-atheros.patch | 40 + net/iptraf/patches/005-no_size_cmd.patch | 11 + net/ipupdate/Makefile | 70 + net/ipupdate/patches/100-name_conflict.patch | 115 + net/ipupdate/patches/200-byteorder.patch | 11 + net/iputils/Makefile | 178 + net/iputils/patches/001-iputils.patch | 14 + net/iputils/patches/002-fix-ipv6.patch | 14 + net/iputils/patches/003-fix-makefile.patch | 18 + net/iputils/patches/010-ping6_uclibc_resolv.patch | 200 + net/iputils/patches/011-ping6_use_gnu_source.patch | 11 + net/irssi-glib1/Makefile | 51 + .../patches/100-cross_compiling_fix.patch | 61 + net/irssi/Makefile | 98 + net/isakmpd/Makefile | 51 + net/isakmpd/patches/010-debian_3.patch | 1753 + net/isakmpd/patches/020-standardize.patch | 154 + net/isakmpd/patches/030-openssl_hashes.patch | 161 + net/isakmpd/patches/040-security_fix.patch | 18 + net/isakmpd/patches/050-ar_cross.patch | 13 + net/isc-dhcp/Makefile | 212 + net/isc-dhcp/files/dhclient-script | 281 + net/isc-dhcp/files/dhclient.init | 30 + net/isc-dhcp/files/dhclient6.conf | 2 + net/isc-dhcp/files/dhclient6.init | 30 + net/isc-dhcp/files/dhcpd.conf | 13 + net/isc-dhcp/files/dhcpd.init | 33 + net/isc-dhcp/files/dhcpd6.conf | 30 + net/isc-dhcp/files/dhcpd6.init | 33 + net/isc-dhcp/patches/000-compile.patch | 24 + net/jtg/Makefile | 50 + net/kamailio/Makefile | 268 + net/kamailio/files/kamailio.default | 13 + net/kamailio/files/kamailio.init | 19 + net/kamailio/patches/005-config_h.patch | 20 + net/kamailio/patches/007-modules_build.patch | 137 + net/kamailio3/Makefile | 284 + net/kamailio3/files/kamailio.default | 13 + net/kamailio3/files/kamailio.init | 15 + net/kamailio3/patches/100-cross_compile.patch | 13 + net/karma/Makefile | 60 + net/keepalived/Makefile | 69 + net/keepalived/files/keepalived.init | 14 + net/kismet/Makefile | 125 + net/kismet/files/ap_manuf | 240 + net/kismet/files/client_manuf | 455 + net/kismet/files/kismet.conf | 287 + net/kismet/files/kismet_drone.conf | 121 + net/kismet/files/kismet_ui.conf | 61 + .../patches/010-dont-add-host-include-paths.patch | 14 + net/knock/Makefile | 92 + net/knock/patches/010_eglibc_define_PATH_MAX.patch | 11 + net/krb5/Makefile | 130 + net/krb5/files/krb5kdc | 17 + net/krb5/patches/001-krb5kdc-dir-to-etc.patch | 51 + net/krb5/patches/002-MITKRB5-SA-2011-002.patch | 112 + net/l2tpd/Makefile | 61 + net/l2tpd/files/l2tpd.conf | 29 + net/l2tpd/files/l2tpd.init | 18 + net/l2tpd/files/options.l2tpd | 17 + net/l2tpd/patches/001-debian-2.patch | 3394 ++ net/l2tpd/patches/002-debian-2-pty-rev.patch | 21 + net/l2tpd/patches/003-jacco-pty.patch | 1194 + net/l2tpd/patches/004-gcc4.patch | 12 + net/l2tpd/patches/004-nonblock.patch | 26 + net/l2tpd/patches/005-df-disable.patch | 25 + net/l2tpns/Makefile | 61 + .../001-honor_includes_no_fifo_scheduler.patch | 51 + net/l2tpv3tun/Makefile | 50 + net/l2tpv3tun/files/l2tp.sh | 213 + net/l2tpv3tun/patches/010-custom_ifname.patch | 20 + net/l2tpv3tun/patches/100-nl_handle_alloc.patch | 23 + net/l7-protocols/Makefile | 78 + .../patches/100-testing_crosscompile.patch | 27 + net/l7-protocols/patches/101-testing-timeit.patch | 102 + .../patches/102-testing-doallspeeds.patch | 16 + net/leafnode/Makefile | 90 + net/leafnode/files/leafnode.init | 13 + net/leafnode/files/news | 2 + net/leafnode/files/nntp | 10 + net/lft/Makefile | 71 + net/lft/patches/001-no_strip.patch | 11 + net/lftp/Makefile | 60 + net/lftp/patches/001-libintl.patch | 18 + net/lighttpd/Makefile | 327 + net/lighttpd/files/lighttpd.conf | 231 + net/lighttpd/files/lighttpd.init | 16 + net/linuxigd/Makefile | 69 + net/linuxigd/files/upnpd.conf | 71 + net/linuxigd/files/upnpd.init | 24 + net/linuxigd/patches/001-iptables_defs.patch | 73 + .../patches/002-netfilter_nat_headers.patch | 16 + net/linuxigd/patches/003-Makefile-fix.patch | 13 + .../patches/004-iptables-1.4.3.2-compat.patch | 101 + net/linuxigd/patches/005-includes.patch | 30 + net/lispmob/Makefile | 128 + net/lispmob/patches/010-disable-modprobe.patch | 29 + net/live/Makefile | 44 + net/live/patches/101-openwrt.patch | 23 + net/lldpd/Makefile | 54 + net/lldpd/files/lldpd.config | 8 + net/lldpd/files/lldpd.init | 40 + net/lldpd/patches/001-no-multiuser.patch | 40 + net/lldpd/patches/002-no-stack-protector.patch | 10 + net/lsm/Makefile | 62 + net/lsm/files/connections.conf | 13 + net/lsm/files/lsm.conf | 42 + net/lsm/files/lsm.init | 19 + net/lsm/files/lsm_script | 77 + net/mac-to-devinfo/Makefile | 98 + net/mac-to-devinfo/files/clean-devinfo | 26 + net/mac-to-devinfo/files/devinfo-functions.sh | 122 + net/mac-to-devinfo/files/ip-to-devinfo | 80 + net/mac-to-devinfo/files/mac-to-devinfo | 197 + net/mac-to-devinfo/files/macdevdb | 8 + net/mac-to-devinfo/files/mactodevinfo | 2 + net/mac-to-devinfo/files/netdiscover-to-devinfo | 67 + net/mac-to-devinfo/files/netsmap-to-devinfo | 156 + net/mac-to-devinfo/files/prep-devinfo | 31 + net/mac-to-devinfo/files/smap-to-devinfo | 102 + net/madwimax/Makefile | 49 + net/madwimax/files/20-madwimax | 22 + net/madwimax/files/event.sh | 18 + net/madwimax/files/madwimax.init | 6 + net/madwimax/patches/001-fix_detection_on_be.patch | 33 + net/maradns/Makefile | 73 + net/maradns/files/maradns.init | 18 + net/maradns/files/mararc | 9 + net/maradns/patches/001-cross_compile_fix.patch | 11 + net/matrixtunnel/Makefile | 53 + net/mdk3/Makefile | 41 + net/mdk3/patches/001-radiotap_needs_types_h.patch | 11 + net/mdk3/patches/010-fix-dependencies.patch | 17 + net/mdnsresponder/Makefile | 162 + net/mdnsresponder/files/mDNSResponder.conf | 4 + net/mdnsresponder/files/mDNSResponder.init | 14 + net/mdnsresponder/files/mdnsd.init | 14 + net/mdnsresponder/patches/001-cross_compile.patch | 125 + net/mdnsresponder/patches/002-uclibc.patch | 21 + net/memcached/Makefile | 68 + net/memcached/files/memcached.config | 6 + net/memcached/files/memcached.init | 27 + net/memcached/patches/100-fix_iov_max.patch | 23 + net/mercurial/Makefile | 50 + net/mercurial/patches/001-no_bzip2.patch | 183 + net/mgen/Makefile | 53 + net/mgen/patches/100-ipv6.patch | 24 + net/miau/Makefile | 57 + net/miau/files/miau.init | 28 + net/miax/Makefile | 51 + net/miax/patches/001-cross.patch | 24 + net/mii-tool/Makefile | 41 + .../patches/001-include_linux_sockios.patch | 12 + net/mini_httpd/Makefile | 189 + net/mini_httpd/files/matrixssl_helper.c | 455 + net/mini_httpd/files/matrixssl_helper.h | 39 + net/mini_httpd/files/mini_httpd-ssl.conf | 7 + net/mini_httpd/files/mini_httpd.conf | 5 + net/mini_httpd/files/mini_httpd.default | 1 + net/mini_httpd/files/mini_httpd.init | 18 + net/mini_httpd/files/mini_httpd.pem | 29 + net/mini_httpd/patches/001-cgi_path.patch | 16 + net/mini_httpd/patches/500-matrixssl.patch | 161 + net/mini_snmpd/Makefile | 61 + net/mini_snmpd/files/mini_snmpd.config | 16 + net/mini_snmpd/files/mini_snmpd.init | 65 + net/mini_snmpd/patches/100-dualstack.patch | 218 + net/mini_snmpd/patches/101-opt_flags.patch | 14 + .../patches/102-mib_fix_uninitialized_memory.patch | 34 + .../103-mib_encode_snmp_element_oid_fix.patch | 21 + net/miniupnpc/Makefile | 72 + net/miniupnpc/patches/100-no_minixml_test.patch | 13 + net/miniupnpc/patches/200-miniupnpc_desc.patch | 11 + net/miniupnpd/Makefile | 56 + net/miniupnpd/files/miniupnpd.firewall.hotplug | 50 + net/miniupnpd/files/miniupnpd.iface.hotplug | 8 + net/miniupnpd/files/miniupnpd.init | 199 + net/miniupnpd/files/upnpd.config | 24 + net/mosquitto/Makefile | 101 + net/mosquitto/files/mosquitto.init | 29 + .../patches/100-disable-memory-reporting.patch | 12 + net/mosquitto/patches/101-disable-docbook.patch | 11 + net/mrtg/Makefile | 55 + .../patches/001-rm-printf-longlong-fmt-test.patch | 50 + net/mtr/Makefile | 67 + net/mtr/patches/501-dns.patch | 510 + net/mtr/patches/502-fix-res_ninit.patch | 31 + net/mtr/patches/520-libresolv_fix.patch | 17 + net/mtr/patches/521-gtk_fix.patch | 27 + net/multiwan/Makefile | 47 + net/multiwan/files/etc/config/multiwan | 57 + net/multiwan/files/etc/init.d/multiwan | 20 + net/multiwan/files/usr/bin/multiwan | 1043 + net/mutella/Makefile | 54 + net/mutella/patches/001-no_backtrace.patch | 15 + net/mutella/patches/002-gcc4_fixes.patch | 12 + net/mutella/patches/003-gcc4_3_fixes.patch | 34 + net/mutella/patches/004-no-host-paths.patch | 58 + net/mvprelay/Makefile | 43 + net/n2n/Makefile | 55 + net/n2n/files/n2n.config | 7 + net/n2n/files/n2n.init | 56 + net/natpmp/Makefile | 61 + net/natpmp/files/natpmp.config | 4 + net/natpmp/files/natpmp.init | 76 + net/nbd/Makefile | 52 + net/nbtscan/Makefile | 50 + net/ncftp/Makefile | 68 + net/ndyndns/Makefile | 54 + net/ndyndns/files/ndyndns.conf.sample | 7 + net/ndyndns/files/ndyndns.init | 21 + .../patches/010-dont-add-host-includes.patch | 24 + net/ndyndns/patches/020-ndyndns.patch | 211 + net/net-snmp/Makefile | 262 + net/net-snmp/files/snmpd.conf | 82 + net/net-snmp/files/snmpd.default | 1 + net/net-snmp/files/snmpd.init | 135 + net/net-snmp/patches/100-debian-statistics.patch | 22 + net/net-snmp/patches/110-debian-makefiles.patch | 40 + net/net-snmp/patches/120-debian-searchdirs.patch | 14 + net/net-snmp/patches/130-debian-extramibs.patch | 6261 +++ net/net-snmp/patches/140-debian-docfiles.patch | 95 + .../patches/150-debian-defaultconfig.patch | 142 + net/net-snmp/patches/160-no_ldconfig.patch | 12 + net/net-snmp/patches/170-ldflags.patch | 11 + net/net-snmp/patches/750-ieee802dot11.patch | 6156 +++ net/net-tools/Makefile | 324 + net/net-tools/patches/001-config.patch | 209 + net/net-tools/patches/002-compile-fixes.patch | 74 + net/netatalk/Makefile | 84 + net/netatalk/files/AppleVolumes.default | 2 + net/netatalk/files/afpd.conf | 1 + net/netatalk/files/afpd.init | 23 + net/netatalk/patches/001-automake-compat.patch | 9 + net/netcat/Makefile | 57 + net/netcat/patches/001-netcat_flag_count.patch | 22 + net/netdiscover/Makefile | 41 + net/netdiscover/patches/00-add-machine-ouput.patch | 467 + net/netdiscover/patches/01-initfix+end-fix.patch | 34 + net/netio/Config.in | 4 + net/netio/Makefile | 41 + net/netio/patches/001-Makefile.patch | 11 + net/netperf/Makefile | 45 + net/netperf/files/netserver.init | 12 + net/netperf/patches/001-dccp.patch | 38 + net/netpipe/Makefile | 49 + net/netstat-nat/Makefile | 42 + net/nfs-kernel-server/Makefile | 152 + net/nfs-kernel-server/files/nfsd.exports | 1 + net/nfs-kernel-server/files/nfsd.init | 40 + .../patches/100-nfs_utils_uclibc.patch | 49 + .../patches/101-no_malloc_h.patch | 10 + .../patches/200-osd_login-install.patch | 10 + net/nfs-server/Makefile | 53 + net/nfs-server/files/nfsd.exports | 1 + net/nfs-server/files/nfsd.init | 15 + net/nfs-server/patches/001-build_config.patch | 67 + net/nfs-server/patches/002-cross_compile_fix.patch | 149 + net/nfs-server/patches/003-debian_subset.patch | 698 + net/nfs-server/patches/004-gcc34_fix.patch | 24 + net/nfs-server/patches/005-remove_warning.patch | 30 + net/nginx/Config.in | 39 + net/nginx/Makefile | 103 + net/nginx/files/nginx.init | 24 + net/nginx/patches/101-feature_test_fix.patch | 107 + net/nginx/patches/102-sizeof_test_fix.patch | 26 + net/nginx/patches/103-sys_nerr.patch | 12 + net/nginx/patches/200-config.patch | 18 + net/ngircd/Makefile | 93 + net/ngircd/files/ngircd.init | 11 + net/ngrep/Makefile | 53 + net/ngrep/patches/001-makefile_in.patch | 20 + net/ngrep/patches/001-ngrep.patch | 12 + net/nmap/Makefile | 139 + net/nocatauth/Makefile | 68 + net/nocatauth/files/nocatauth-gateway | 14 + net/nocatauth/patches/001-ptp-local.patch | 56 + net/nocatauth/patches/002-openwrt.patch | 30 + net/nocatauth/patches/003-fix-module-loading | 31 + net/nocatauth/patches/004-fw_detect.patch | 55 + net/nocatsplash/Makefile | 58 + net/nocatsplash/patches/001-openwrt_firewall.patch | 19 + net/nodogsplash/Makefile | 79 + net/nodogsplash/files/nodogsplash.init | 176 + .../patches/001-crash_on_missing_rdir_param.patch | 18 + .../patches/002-deprecated_iptables_syntax.patch | 11 + net/nprobe/Makefile | 75 + net/nprobe/patches/001-automake-compat.patch | 46 + net/nprobe/patches/002-path_to_pcap.patch | 13 + net/nprobe/patches/003-ipv6_fix.patch | 35 + net/nstx/Makefile | 64 + net/nstx/patches/001-debian_changes.patch | 382 + net/ntpclient/Makefile | 53 + net/ntpclient/files/ntpclient.config | 23 + net/ntpclient/files/ntpclient.hotplug | 78 + net/ntpclient/patches/100-daemon.patch | 24 + net/ntpd/Makefile | 197 + net/ntpd/files/ntp.conf | 26 + net/ntpd/files/ntpd.hotplug | 10 + net/ntpd/files/ntpd.init | 21 + net/ntpd/files/ntpdate.init | 13 + net/ntripcaster/Makefile | 49 + net/ntripclient/Makefile | 43 + net/ntripserver/Makefile | 43 + net/nufw/Makefile | 117 + net/nufw/patches/001-no_doc_tests.patch | 23 + net/nufw/patches/002-debian_fixes.patch | 22788 +++++++++ net/nuttcp/Makefile | 80 + net/nzbget/Makefile | 69 + net/nzbget/patches/001-openssl-1.0.0-compat.patch | 32 + net/nzbgetweb/Makefile | 66 + net/nzbgetweb/files/httpd.conf | 1 + net/nzbgetweb/files/lib/xmlrpc.inc | 3776 ++ net/nzbgetweb/files/lib/xmlrpc_wrappers.inc | 955 + net/nzbgetweb/files/lib/xmlrpcs.inc | 1246 + net/obfsproxy/Makefile | 45 + net/obfsproxy/patches/001-no-werror.patch | 9 + net/obfsproxy/patches/002-no-build-hardening.patch | 12 + net/oidentd/Makefile | 44 + net/oidentd/files/oidentd.init | 12 + net/olsrd/Makefile | 264 + net/olsrd/files/olsrd.config | 26 + net/olsrd/files/olsrd.init | 715 + net/olsrd/files/olsrd_secure_key | 1 + ...-olsrd-fix-stack-corruption-in-net_output.patch | 52 + net/openconnect/Makefile | 49 + net/openconnect/files/openconnect.sh | 56 + net/openconnect/files/vpnc-script | 156 + net/openconnect/patches/100-passwd_file.patch | 100 + net/opendchub/Makefile | 44 + net/openl2tp/Makefile | 128 + net/openl2tp/patches/001-makefile.patch | 70 + net/openl2tp/patches/002-no_libfl.patch | 22 + net/openl2tp/patches/010-ppp_unix.patch | 11 + net/openl2tp/src/l2tp_rpc.h | 1475 + net/openl2tp/src/l2tp_rpc_client.c | 426 + net/openl2tp/src/l2tp_rpc_server.c | 665 + net/openl2tp/src/l2tp_rpc_xdr.c | 2957 ++ net/opennhrp/Makefile | 57 + net/opennhrp/files/opennhrp.init | 15 + net/openntpd/Makefile | 75 + net/openntpd/files/ntpd.conf | 6 + net/openntpd/files/ntpd.config | 3 + net/openntpd/files/ntpd.hotplug | 12 + net/openntpd/files/ntpd.init | 18 + net/openntpd/patches/001-adjtimex_linux.patch | 178 + net/openntpd/patches/002-save_freq_drift.patch | 92 + net/openntpd/patches/003-no_permission_check.patch | 11 + net/openrrcp/Makefile | 44 + net/openser/Makefile | 339 + net/openser/patches/001-openser_cfg.patch | 33 + net/openser/patches/002-sc.patch | 41 + net/openser/patches/003-makefile_defs.patch | 71 + net/openser/patches/004-cfg_lex.patch | 13 + net/openser/patches/005-config_h.patch | 33 + net/openser/patches/006-sc_dbtext.patch | 22 + net/openser/patches/007-modules_build.patch | 57 + net/opensips/Makefile | 272 + net/opensips/files/opensips.default | 13 + net/opensips/files/opensips.init | 19 + net/opensips/patches/001-no_rej.patch | 21 + net/opensips/patches/005-config_h.patch | 20 + net/opensips/patches/007-modules_build.patch | 102 + net/openslp/Makefile | 55 + net/openslp/files/etc/init.d/slpd | 14 + net/openslp/files/etc/slp.conf | 28 + net/openslp/files/etc/slp.reg | 2 + net/openslp/files/etc/slp.spi | 0 net/openssh/Makefile | 206 + net/openssh/files/sshd.init | 44 + net/openssh/patches/100-no_cast_fix.patch | 12 + net/openssh/patches/110-no_ripemd_fix.patch | 13 + .../patches/130-implicit_memset_decl_fix.patch | 12 + .../patches/140-pam_uclibc_pthreads_fix.patch | 84 + net/openssh/patches/200-dscp-qos.patch | 21 + net/openswan/Makefile | 109 + net/openswan/files/ipsec.conf | 8 + net/openswan/files/ipsec.config | 2 + net/openswan/files/ipsec.init | 393 + net/openswan/files/ipsec.secrets | 7 + net/openswan/files/ipsec.upgrade | 3 + net/openswan/patches/100-cross_compile.patch | 30 + net/openswan/patches/120-no_manpages.patch | 60 + net/openswan/patches/140-generated_autoconf.patch | 365 + net/openvpn-devel/Config-nossl.in | 68 + net/openvpn-devel/Config-openssl.in | 68 + net/openvpn-devel/Config-polarssl.in | 68 + net/openvpn-devel/Makefile | 152 + net/openvpn-devel/files | 1 + net/openvpn/Config.in | 79 + net/openvpn/Makefile | 169 + net/openvpn/files/easy-rsa.index | 0 net/openvpn/files/easy-rsa.serial | 1 + net/openvpn/files/openvpn.config | 398 + net/openvpn/files/openvpn.init | 154 + net/openvpn/files/openvpn.upgrade | 1 + net/openvpn/patches/001-easy_rsa.patch | 152 + net/p910nd/Makefile | 55 + net/p910nd/files/p910nd.config | 5 + net/p910nd/files/p910nd.init | 50 + net/paris-traceroute/Makefile | 48 + net/parprouted/Makefile | 59 + net/parprouted/files/parprouted.config | 11 + net/parprouted/files/parprouted.init | 44 + net/parprouted/patches/001-parprouted.patch | 33 + net/pcapsipdump/Makefile | 50 + net/pcapsipdump/patches/001-cross_compile.patch | 16 + .../patches/002-elif_else_replacement.patch | 12 + net/pdnsd/Makefile | 55 + net/pdnsd/files/pdnsd.init | 46 + net/peerguardian/Makefile | 65 + net/peerguardian/files/peerguardian.init | 12 + .../patches/001-no_host_includes.patch | 13 + net/peerguardian/patches/002-new_libipq.patch | 32 + .../patches/003-gcc_4_3-compile-fix.patch | 20 + net/peervpn/Makefile | 42 + net/pen/Makefile | 58 + net/pepperspot/Makefile | 63 + net/pepperspot/files/pepperspot.init | 19 + net/pepperspot/patches/101-cflags.patch | 22 + net/pepperspot/patches/102-no_warnings.patch | 134 + net/pepperspot/patches/110-fix-compile.patch | 247 + net/pepsal/Makefile | 44 + net/polipo/Makefile | 59 + net/polipo/files/polipo.config | 42 + net/polipo/files/polipo.init | 150 + net/portmap/Makefile | 48 + net/portmap/files/portmap.init | 13 + net/portmap/patches/101-no_pie.patch | 12 + net/portsentry/Makefile | 49 + net/portsentry/files/portsentry.init | 22 + net/portsentry/patches/100-conf_location.patch | 13 + net/portsentry/patches/101-postsentry_c.patch | 14 + net/pptpd/Makefile | 63 + net/pptpd/files/options.pptpd | 23 + net/pptpd/files/pptpd.conf | 5 + net/pptpd/files/pptpd.init | 21 + net/pptpd/patches/001-bad_pqueue_debug.patch | 18 + net/pptpd/patches/002-makefile_fix.patch | 11 + net/pptpd/patches/003-opt_flags.patch | 12 + net/privoxy/Makefile | 61 + net/privoxy/files/privoxy.config | 27 + net/privoxy/files/privoxy.init | 16 + net/proftpd/Makefile | 62 + net/proftpd/files/proftpd.init | 41 + net/proftpd/patches/001-automake-compat.patch | 145 + net/proftpd/patches/002-mempcpy_def.patch | 12 + net/prosody/Makefile | 87 + net/prosody/files/prosody.init | 41 + net/prosody/patches/001-conf.patch | 37 + net/psybnc/Makefile | 68 + net/psybnc/patches/001-makefile.patch | 59 + net/psybnc/patches/002-conf.patch | 14 + net/psybnc/patches/003-psybnc.patch | 105 + net/psybnc/patches/004-start_script.patch | 16 + .../patches/005-fix_endianess_detection.patch | 31 + net/ptpd/Makefile | 44 + net/ptpd/files/ptpd.init | 12 + net/ptunnel/Makefile | 62 + net/ptunnel/files/ptunnel.config | 2 + net/ptunnel/files/ptunnel.init | 30 + net/ptunnel/patches/001-prefix.patch | 13 + net/ptunnel/patches/002-no_selinux.patch | 20 + net/pure-ftpd/Makefile | 92 + net/pure-ftpd/files/pure-ftpd.config | 10 + net/pure-ftpd/files/pure-ftpd.init | 107 + .../patches/010-dont-add-host-paths.patch | 29 + net/pyload/Makefile | 49 + net/pyload/files/pyload.init | 12 + net/pyrit/Makefile | 49 + net/qolyester/Makefile | 43 + net/quagga/Makefile | 306 + net/quagga/files/quagga | 335 + net/quagga/files/quagga.conf | 7 + net/quagga/files/quagga.init | 11 + .../patches/001-bgpd-fix-args-consolidation.patch | 11 + net/quagga/patches/002-fix-metric-output.patch | 58 + .../003-bgpd-fix-route-map-match-peer-local.patch | 20 + .../patches/004-fix-sockunion-memleaks.patch | 539 + .../patches/005-zebra-connected-in-mrib.patch | 21 + net/quagga/patches/006-fix-no-ipv6.patch | 127 + .../007-drop-heuristic-ipv6-recognition.patch | 90 + .../patches/008-fix-thread_cancel_event.patch | 27 + .../009-bgpd-fix-vpn4-soft-reconfiguration.patch | 89 + .../010-bgpd-fix-struct-attr_extra-leak.patch | 17 + net/quagga/patches/011-isisd-fix-typo.patch | 11 + net/quagga/patches/110-fix_ipctl_forwarding.patch | 25 + net/quagga/patches/120-quagga_manet.patch | 243 + net/quagga/patches/130-fix_cpp.patch | 11 + net/quagga/patches/140-holdtimer-set.patch | 22 + net/quagga/patches/150-no-cross-fs-link.patch | 40 + net/quagga/patches/160-pgbgp.patch | 3104 ++ net/quagga/patches/161-pgbgp-addon.patch | 318 + net/quagga/patches/170-use-supported-pagers.patch | 29 + net/quicktun/Makefile | 69 + net/quicktun/files/quicktun.config | 55 + net/quicktun/files/quicktun.init | 141 + net/raddump/Makefile | 44 + net/radsecproxy/Makefile | 56 + net/radsecproxy/files/radsecproxy.init | 12 + net/radsecproxy/patches/100-missing-return.patch | 58 + net/rarpd/Makefile | 59 + net/rarpd/files/rarpd.config | 13 + net/rarpd/files/rarpd.init | 79 + net/reaim/Makefile | 42 + net/reaim/files/reaim.init | 26 + net/reaim/patches/501-cross_compile-install.patch | 16 + net/reaver/Makefile | 53 + .../patches/0001-wpscrack-big-endian-fixes.patch | 565 + ...rent-directory-for-storing-and-loading-se.patch | 53 + ...-use-less-useless-spaces-in-output-to-fit.patch | 38 + net/redir/Makefile | 36 + net/redir/patches/00_honor_copts.patch | 12 + net/redir/patches/01_fix_max_bandwidth_docs.patch | 54 + net/redir/patches/02_use_ntohs.patch | 43 + net/redir/patches/03_fix_tcp_wrappers.patch | 25 + net/redir/patches/04_fix_timeouts.patch | 38 + net/redir/patches/06_fix_shaper_buffer.patch | 56 + net/remotefs/Makefile | 75 + net/remotefs/files/rfsd | 25 + net/restund/Makefile | 117 + net/restund/files/restund.init | 15 + net/rinetd/Makefile | 59 + net/rinetd/files/rinetd.config | 33 + net/rinetd/files/rinetd.init | 64 + net/rinetd/patches/001-crosscompile.patch | 12 + net/rp-l2tp/Makefile | 68 + net/rp-l2tp/files/rp-l2tpd.init | 13 + net/rp-l2tp/patches/001-cross.patch | 235 + net/rp-pppoe/Makefile | 135 + net/rp-pppoe/files/pppoe-client.init | 12 + net/rp-pppoe/files/pppoe-relay.default | 1 + net/rp-pppoe/files/pppoe-relay.init | 15 + net/rp-pppoe/files/pppoe-server.default | 1 + net/rp-pppoe/files/pppoe-server.init | 15 + net/rp-pppoe/patches/100-configure.patch | 11 + net/rrs/Makefile | 89 + net/rrs/patches/001-shell.patch | 13 + net/rrs/patches/002-no_sslv2.patch | 46 + net/rrs/patches/003-honour_copts.patch | 12 + net/rssh/Makefile | 62 + net/rssh/patches/001-destdir.patch | 22 + net/rsync/Makefile | 82 + net/rsync/files/rsyncd.conf | 15 + net/rsync/files/rsyncd.init | 14 + net/rtorrent/Makefile | 60 + net/rtorrent/patches/100-fix-cross_compile.patch | 22 + net/rtorrent/patches/120-fix-ncurses.patch | 13 + net/rtpproxy/Makefile | 38 + net/samba36/Makefile | 140 + net/samba36/files/samba.config | 6 + net/samba36/files/samba.init | 97 + net/samba36/files/smb.conf.template | 34 + net/samba36/patches/100-configure_fixes.patch | 14 + net/samba36/patches/110-multicall.patch | 117 + net/samba36/patches/111-owrt_smbpasswd.patch | 277 + net/samba36/patches/120-add_missing_ifdef.patch | 26 + .../patches/200-remove_printer_support.patch | 356 + net/samba36/patches/210-remove_ad_support.patch | 88 + net/samba36/patches/220-remove_services.patch | 98 + .../patches/230-remove_winreg_support.patch | 146 + net/samba36/patches/240-remove_dfs_api.patch | 71 + net/samba36/patches/250-remove_domain_logon.patch | 185 + net/samba36/patches/260-remove_samr.patch | 155 + .../patches/270-remove_registry_backend.patch | 43 + net/samba36/patches/280-strip_srvsvc.patch | 143 + net/samba36/patches/290-remove_lsa.patch | 73 + net/samba36/patches/300-assert_debug_level.patch | 11 + net/samba36/patches/310-remove_error_strings.patch | 253 + net/samba36/patches/320-debug_level_checks.patch | 22 + net/samba36/patches/330-librpc_default_print.patch | 8854 ++++ net/scanlogd/Makefile | 64 + net/scanlogd/files/scanlogd.init | 19 + net/scdp/Makefile | 50 + net/seeks/Makefile | 115 + net/seeks/files/seeks.init | 12 + net/seeks/patches/050-better_icu_detection.patch | 39 + .../patches/100-no_tests-and-add-iconv-link.patch | 34 + .../patches/200-add_pcre_headers_to_plugins.patch | 32 + net/ser2net/Makefile | 50 + net/serialoverip/Makefile | 45 + net/serialoverip/patches/001-compile-fixes.patch | 76 + net/shat/Makefile | 45 + net/shorewall-lite/Makefile | 66 + net/shorewall-lite/files/hostname | 2 + net/shorewall-lite/files/hotplug_iface | 12 + net/shorewall-lite/files/lsm_script | 43 + net/shorewall-lite/files/shorewall-lite.init | 20 + net/shorewall-lite/files/vardir | 2 + net/shorewall-lite/patches/110-MODULESDIR.patch | 20 + net/shorewall-lite/patches/120-LOGFILE.patch | 11 + net/sipp/Makefile | 60 + net/siproxd/Makefile | 86 + net/siproxd/files/siproxd.config | 3 + net/siproxd/files/siproxd.init | 235 + .../patches/010-fix-bogus-libltdl-dependency.patch | 26 + net/sipsak/Makefile | 43 + net/sipsak/patches/001-ssp.patch | 22 + net/sipsak/patches/002-no_cares_ruli.patch | 276 + net/slurm/Makefile | 59 + net/slurm/patches/001-no_host_curses.patch | 67 + net/smap/Makefile | 64 + net/smap/patches/00-fix-broadcast.patch | 62 + .../patches/01-add-tecom-supported-header.patch | 12 + .../patches/02-segfault-and-toofast-bugfixes.patch | 63 + net/smcroute/Makefile | 50 + net/smcroute/files/smcroute.init | 11 + net/smcroute/patches/001-socket_path.patch | 11 + net/smcroute/patches/002-optimize_size.patch | 12 + net/smtptrapd/Makefile | 52 + net/smtptrapd/files/smtptrapd.init | 125 + net/smtptrapd/patches/200-missing_opt.patch | 12 + net/snort-wireless/Makefile | 147 + net/snort-wireless/files/snort-wireless.default | 2 + net/snort-wireless/files/snort-wireless.init | 23 + .../patches/500-no-config-search.patch | 35 + .../patches/750-lightweight-config.patch | 178 + net/snort/Makefile | 181 + net/snort/files/snort.bin | 3 + net/snort/files/snort.default | 2 + net/snort/files/snort.init | 20 + net/snort/files/snort.local.rules | 5 + net/snort/patches/001-automake-compat.patch | 4 + net/snort/patches/100-INADDR_NONE.patch | 40 + net/snort/patches/101-PCAP.patch | 31 + .../patches/150-config-preprocessors-disable.patch | 491 + .../patches/160-mysql_cross_compiling_checks.patch | 66 + net/snort/patches/200-snortsam.patch | 3016 ++ net/socat/Makefile | 56 + net/socat/patches/501-honor_ldflags.patch | 12 + net/softflowd/Makefile | 52 + net/softflowd/files/softflowd.config | 13 + net/softflowd/files/softflowd.init | 73 + net/spawn-fcgi/Makefile | 39 + net/speedtouch-usb-firmware/Makefile | 75 + net/squid/Makefile | 189 + net/squid/patches/001-cross_compile.patch | 561 + net/squid/patches/002-no_sslv2.patch | 15 + net/squid/patches/003-configure.patch | 50 + net/squid/patches/004-include-autoconf.patch | 15 + net/squid/patches/005-lib-makefile.patch | 179 + net/srelay/Makefile | 49 + net/srelay/files/srelay.conf | 2 + net/srelay/files/srelay.init | 14 + net/sscep/Makefile | 52 + net/sscep/patches/001-certnanny.patch | 3009 ++ net/sshfs/Makefile | 59 + net/sshtunnel/Makefile | 46 + net/sshtunnel/files/sshtunnel.init | 184 + net/sshtunnel/files/sshtunnel.sh | 21 + net/sshtunnel/files/uci_sshtunnel | 51 + net/sslcat/Makefile | 43 + net/sslh/Makefile | 50 + net/sslh/files/sslh.config | 30 + net/sslh/files/sslh.init | 57 + net/sslh/patches/001-no_sslh_select.patch | 29 + net/sslsniff/Makefile | 51 + net/sslsniff/patches/01-cross-compile.patch | 24 + net/sslstrip/Makefile | 56 + net/ssltunnel/Makefile | 57 + net/strongswan/Config.in | 28 + net/strongswan/Makefile | 498 + net/strongswan/files/ipsec.secrets | 1 + net/strongswan/patches/201-no-modprobe.patch | 28 + net/strongswan/patches/203-uci.patch | 20 + net/stun/Makefile | 87 + net/stun/files/stund.config | 5 + net/stun/files/stund.init | 30 + net/stun/patches/001-fix_non_i386.patch | 27 + net/stun/patches/002-linking_order.patch | 19 + net/stunnel/Makefile | 65 + net/stunnel/files/stunnel.init | 34 + net/stunnel/patches/001-remove-libtool.patch | 6661 +++ net/stunnel/patches/100-cross-compile.patch | 126 + net/stunnel/patches/101-no-comp.patch | 28 + net/stunnel/patches/102-no-ssl2.patch | 13 + net/stunnel/patches/103-no-zlib-link.patch | 12 + net/stunnel/patches/104-fix-paths.patch | 42 + net/stunnel/patches/105-stunnel-conf.patch | 54 + .../patches/106-stunnel-xforwardedfor.patch | 248 + net/subversion/Makefile | 129 + net/subversion/files/subversion.config | 3 + net/subversion/files/subversion.init | 37 + net/synce-dccm/Makefile | 54 + net/tcpdump/Makefile | 84 + net/tcpdump/patches/001-remove_pcap_debug.patch | 23 + .../patches/002-remove_static_libpcap_check.patch | 77 + net/tcpdump/patches/004-fix_3g_iface.patch | 28 + net/tcpdump/patches/100-tcpdump_mini.patch | 748 + net/tcptraceroute/Makefile | 46 + .../patches/001-configure_cross_compile.patch | 62 + net/tctool/Makefile | 44 + net/tctool/patches/001_Makefile_fix.diff | 30 + net/tctool/patches/005-fix-gcc_4_3-compile.patch | 12 + net/tftp-hpa/Makefile | 62 + net/tftp-hpa/files/tftpd-hpa.init | 13 + net/tig/Makefile | 43 + net/tinc/Makefile | 59 + net/tinc/files/tinc.config | 56 + net/tinc/files/tinc.init | 236 + net/tinc/files/tinc.upgrade | 1 + net/tinyproxy/Makefile | 50 + net/tinyproxy/files/tinyproxy.config | 251 + net/tinyproxy/files/tinyproxy.init | 138 + net/tinyproxy/patches/010-no-docs-and-tests.patch | 86 + .../patches/020-config_and_pid-path.patch | 13 + .../030-allow_bind_in_transparent_mode.patch | 22 + .../040-fix_url_filter_in_transparent_mode.patch | 110 + net/tinyproxy/patches/120-fix_INET6.patch | 38 + net/tmsnc/Makefile | 49 + net/tor-alpha/Makefile | 118 + net/tor-alpha/files/tor.init | 30 + net/tor-alpha/patches/001-torrc.patch | 21 + net/tor/Makefile | 80 + net/tor/files/tor.init | 30 + net/tor/patches/001-torrc.patch | 21 + net/transmission/Makefile | 122 + net/transmission/files/transmission.config | 71 + net/transmission/files/transmission.init | 111 + .../010_libtransmission_fallocate64_eglibc.patch | 13 + net/transocks/Makefile | 46 + net/tsocks/Makefile | 47 + net/tsocks/patches/100-no_static.patch | 11 + net/ttcp/Makefile | 38 + net/ttcp/ttcp.c | 2374 + net/uanytun/Makefile | 207 + net/uanytun/files/uanytun-nocrypt.config | 88 + net/uanytun/files/uanytun.config | 116 + net/uanytun/files/uanytun.init | 104 + net/ucarp/Makefile | 49 + net/ucarp/files/ucarp.conf | 22 + net/ucarp/files/ucarp.init | 43 + .../patches/100-configure-cross-compilation.patch | 178 + net/ucspi-tcp/Makefile | 54 + net/ucspi-tcp/patches/100-cross_compile.patch | 196 + net/udp-broadcast-relay/Makefile | 48 + net/udpcast/Makefile | 42 + net/udpxy/Makefile | 52 + net/udpxy/files/udpxy.init | 27 + net/uftp/Makefile | 163 + net/uhub/Makefile | 53 + net/uhub/patches/100-user_struct.patch | 1664 + net/ulogd/Makefile | 146 + net/ulogd/files/ulogd.default | 1 + net/ulogd/files/ulogd.init | 17 + net/ulogd/patches/001-pcap_flags.patch | 12 + net/ulogd/patches/002-inc.patch | 24 + net/ulogd/patches/003-fix-bad-rpath.patch | 33 + net/umurmur/Makefile | 95 + net/unbound/Makefile | 173 + net/unbound/files/named.cache | 88 + net/unbound/files/root.key | 1 + net/unbound/files/unbound.init | 14 + net/unbound/patches/001-conf.patch | 154 + net/unfs3/Makefile | 54 + net/unfs3/files/unfs3.exports | 1 + net/unfs3/files/unfs3.init | 12 + net/unfs3/patches/100-no_lfl.patch | 43 + net/uob-nomad/Makefile | 65 + net/uob-nomad/patches/001-inet_sr.patch | 11 + net/uob-nomad/patches/002-hostname.patch | 34 + net/uob-nomad/patches/003-conf.patch | 21 + net/uob-nomad/patches/004-linux26_header_fix.patch | 14 + net/updatedd/Makefile | 155 + net/updatedd/files/updatedd.config | 6 + net/updatedd/files/updatedd.hotplug | 14 + net/updatedd/files/updatedd.init | 38 + net/updatedd/patches/001-service_libname.patch | 84 + net/updatedd/patches/002-ovh-dyndnshost.patch | 12 + net/updatedd/patches/003-zoneedit-url-fix.patch | 11 + net/updatedd/patches/004-fix_liberty_dep.patch | 122 + net/usbip/Makefile | 105 + net/usbip/patches/001-upstream_svn_r99.diff | 11 + net/usbip/patches/002-upstream_svn_r152.patch | 229 + net/uucp/Makefile | 45 + net/vblade/Makefile | 50 + net/vblade/files/vblade.config | 14 + net/vblade/files/vblade.init | 24 + net/veth/Makefile | 45 + net/veth/patches/100-veth-makefile-cflags.patch | 14 + net/veth/patches/200-drop-multicast.patch | 32 + net/vgp/Makefile | 44 + net/vnc-reflector/Makefile | 51 + .../patches/001-honor_include_lib_path.patch | 25 + net/vncrepeater/Makefile | 59 + net/vncrepeater/patches/001-uclibcxx_linking.patch | 32 + net/vnstat/Makefile | 108 + net/vnstat/files/vnstat.config | 5 + net/vnstat/files/vnstat.defaults | 12 + net/vnstat/files/vnstat.init | 77 + net/vnstat/patches/001-conf.patch | 19 + net/vnstat/patches/002-no_install_strip.patch | 35 + net/vnstat/patches/003-no_install_uname.patch | 15 + net/vnstat/patches/004-install_bsd_fix.patch | 21 + net/vpnc-scripts/Makefile | 56 + net/vpnc-scripts/files/etc/vpnc/connect.d/ifstate | 7 + net/vpnc/Makefile | 61 + net/vpnc/patches/001-cross.patch | 29 + net/vpnc/patches/002-vpn_script.patch | 41 + net/vpnc/patches/003-no_makeman.patch | 11 + net/vpzone/Makefile | 47 + net/vpzone/files/vpzone.conf | 28 + net/vpzone/files/vpzone.init | 15 + net/vpzone/patches/001-no_werror.patch | 22 + net/vpzone/patches/002-ipv6_inc_fix.patch | 11 + net/vrrpd/Makefile | 57 + net/vrrpd/files/vrrpd.config | 29 + net/vrrpd/files/vrrpd.init | 87 + net/vsftpd/Makefile | 50 + net/vsftpd/files/vsftpd.conf | 17 + net/vsftpd/files/vsftpd.init | 13 + net/vsftpd/patches/001-destdir.patch | 47 + net/vsftpd/patches/002-find_libs.patch | 13 + net/vsftpd/patches/003-chroot.patch | 11 + net/vsftpd/patches/004-disable-capabilities.patch | 12 + net/vtun/Makefile | 78 + net/vtun/patches/100-lzo2.patch | 37 + net/wavemon/Makefile | 49 + net/wccpd/Makefile | 42 + net/wdiag/Makefile | 44 + net/weechat/Makefile | 58 + net/wget/Makefile | 124 + net/wifidog/Makefile | 57 + net/wifidog/files/wifidog.conf | 193 + net/wifidog/files/wifidog.init | 17 + net/wing/Makefile | 94 + net/wing/files/etc/uci-defaults/wing | 24 + net/wing/files/lib/netifd/proto/wing.sh | 169 + net/wing/files/usr/bin/wing_status | 135 + net/wiviz/Makefile | 49 + net/wiviz/files/www/cgi-bin/wiviz/get.cgi | 15 + net/wiviz/files/www/cgi-bin/wiviz/set.cgi | 3 + net/wiviz/files/www/wiviz/adhoc-idle.gif | Bin 0 -> 332 bytes net/wiviz/files/www/wiviz/adhoc-idle.png | Bin 0 -> 730 bytes net/wiviz/files/www/wiviz/adhoc.gif | Bin 0 -> 451 bytes net/wiviz/files/www/wiviz/adhoc.png | Bin 0 -> 714 bytes net/wiviz/files/www/wiviz/ap-idle.gif | Bin 0 -> 812 bytes net/wiviz/files/www/wiviz/ap-idle.png | Bin 0 -> 814 bytes net/wiviz/files/www/wiviz/ap-wep-idle.gif | Bin 0 -> 812 bytes net/wiviz/files/www/wiviz/ap-wep-idle.png | Bin 0 -> 814 bytes net/wiviz/files/www/wiviz/ap-wep.gif | Bin 0 -> 1455 bytes net/wiviz/files/www/wiviz/ap-wep.png | Bin 0 -> 1997 bytes net/wiviz/files/www/wiviz/ap.gif | Bin 0 -> 1468 bytes net/wiviz/files/www/wiviz/ap.png | Bin 0 -> 1825 bytes net/wiviz/files/www/wiviz/pip-idle.gif | Bin 0 -> 190 bytes net/wiviz/files/www/wiviz/pip-idle.png | Bin 0 -> 331 bytes net/wiviz/files/www/wiviz/pip.gif | Bin 0 -> 190 bytes net/wiviz/files/www/wiviz/pip.png | Bin 0 -> 323 bytes net/wiviz/files/www/wiviz/station-idle.gif | Bin 0 -> 754 bytes net/wiviz/files/www/wiviz/station-idle.png | Bin 0 -> 1778 bytes net/wiviz/files/www/wiviz/station.gif | Bin 0 -> 929 bytes net/wiviz/files/www/wiviz/station.png | Bin 0 -> 2476 bytes net/wiviz/files/www/wiviz/wiviz.css | 76 + net/wiviz/files/www/wiviz/wiviz.html | 81 + net/wiviz/files/www/wiviz/wiviz.js | 291 + net/wiviz/src/Makefile | 25 + net/wiviz/src/channelhopper.c | 48 + net/wiviz/src/channelhopper.h | 19 + net/wiviz/src/structs.h | 169 + net/wiviz/src/wiviz.c | 572 + net/wiviz/src/wl_access.c | 73 + net/wiviz/src/wl_access.h | 77 + net/wknock/Makefile | 48 + net/wol/Makefile | 54 + net/wol/files/wol.config | 3 + net/wol/files/wol.init | 30 + net/wput/Makefile | 44 + net/wput/patches/100-socketlib.diff | 22 + net/wput/patches/102-wput.diff | 48 + net/wrt-radauth/Makefile | 50 + net/wrt-radauth/patches/001-ldpath.patch | 12 + net/wshaper/Makefile | 55 + net/wshaper/files/wshaper.config | 4 + net/wshaper/files/wshaper.htb | 161 + net/wshaper/files/wshaper.init | 10 + net/xinetd/Makefile | 62 + net/xinetd/files/xinetd.conf | 6 + net/xinetd/files/xinetd.init | 15 + net/xinetd/patches/001-ar.patch | 66 + net/xinetd/patches/002-destdir.patch | 27 + net/xinetd/patches/003-rpc_fix.patch | 19 + net/xl2tpd/Makefile | 68 + net/xl2tpd/README | 23 + net/xl2tpd/files/l2tp.sh | 115 + net/xl2tpd/files/options.xl2tpd | 13 + net/xl2tpd/files/xl2tp-secrets | 5 + net/xl2tpd/files/xl2tpd.conf | 23 + net/xl2tpd/files/xl2tpd.conf.sample | 73 + net/xl2tpd/files/xl2tpd.init | 18 + net/xl2tpd/patches/100-makefile_opt_flags.patch | 12 + .../patches/110-makefile_dont_build_pfc.patch | 43 + net/xl2tpd/patches/120-kernel-mode-l2tp.patch | 368 + net/xl2tpd/patches/130-no-kill-ipparam.patch | 11 + net/xsupplicant/Makefile | 70 + net/xsupplicant/patches/001-no-lfl.patch | 22 + .../patches/002-disable-procfs-check.patch | 22 + net/xsupplicant/patches/003-compile_fix.patch | 11 + .../005-no_private_linux_header_includes.patch | 48 + net/xsupplicant/patches/006-no_wireless_h.patch | 61 + net/xtables-addons/Makefile | 151 + net/xtables-addons/patches/001-no_depmod.patch | 16 + .../patches/002-fix-kernel-version-detection.patch | 22 + .../patches/003-redundant-bracket.patch | 11 + .../patches/004-linux_3_3_compat.patch | 11 + .../patches/005-powerpc_includes.patch | 12 + .../patches/100-add-rtsp-conntrack.patch | 1334 + .../patches/200-add-lua-packetscript.patch | 18230 +++++++ .../patches/201-fix-lua-packetscript.patch | 89 + net/yaddns/Makefile | 46 + net/yaddns/files/etc/config/ddns | 67 + net/yaddns/files/etc/hotplug.d/iface/25-ddns | 115 + net/yaddns/files/usr/lib/ddns/services | 5 + net/yafc/Makefile | 52 + net/yate/Makefile | 276 + ...d_dn_skipname_missing_from_many_libresolv.patch | 111 + net/znc/Makefile | 292 + net/znc/files/znc.conf | 26 + net/znc/files/znc.init | 156 + .../patches/001-move_rootcheck_after_config.patch | 52 + net/znc/patches/002-Uclibcpp_build_fix.patch | 34 + net/znc/patches/003-Reduce_rebuild_time.patch | 32 + skels/Makefile.template | 52 + skels/files/package.conf | 4 + skels/files/package.init | 40 + sound/cmus/Makefile | 96 + sound/cmus/patches/010-do_not_use_ACS_VLINE.patch | 11 + sound/empcd/Makefile | 51 + sound/flite/Makefile | 63 + sound/flite/patches/100-shared_libs | 182 + sound/ices/Makefile | 59 + sound/lame/Makefile | 79 + sound/lame/patches/001-automake-compat.patch | 33 + sound/listener/Makefile | 48 + sound/listener/files/listener.conf | 20 + sound/listener/patches/100-makefile.patch | 31 + sound/madplay/Makefile | 60 + sound/mocp/Makefile | 58 + sound/mocp/patches/001-moc-ffmpeg-update.patch | 34 + sound/mpc/Makefile | 55 + sound/mpc/files/pls-handler.sh | 5 + sound/mpd/Makefile | 211 + sound/mpd/files/mpd.init | 28 + sound/mpd/files/mpd.service | 9 + sound/mpd/patches/100-compile-fixes.patch | 27 + sound/mpdas/Makefile | 62 + sound/mpdas/files/mpdas.init | 15 + sound/mpdas/files/mpdasrc | 5 + sound/mpdas/patches/001-flags.patch | 20 + sound/mt-daapd/Makefile | 61 + sound/mt-daapd/files/mt-daapd.init | 19 + sound/pianobar/Makefile | 82 + sound/pianobar/patches/001-verbose.patch | 57 + sound/pianobar/patches/002-force-symlinks.patch | 24 + sound/pulseaudio/Makefile | 265 + sound/pulseaudio/files/pulseaudio.init | 27 + .../patches/001-no_default_64mb_alloc.patch | 13 + sound/scmpc/Makefile | 59 + sound/scmpc/files/scmpc.init | 15 + sound/scmpc/patches/100-Rules.patch | 11 + sound/shell-fm/Makefile | 61 + sound/shell-fm/files/shell-fm.init | 14 + sound/shell-fm/files/shell-fm.rc | 9 + sound/sox/Makefile | 89 + sound/sox/patches/001-cross_compile.patch | 22 + sound/sox/patches/010-fix_uclibc_build_issue.patch | 20 + sound/streamripper/Makefile | 55 + utils/acpid/Makefile | 65 + utils/acpid/files/acpid.hotplug | 7 + utils/acpid/files/acpid.init | 25 + utils/acpid/files/default | 5 + utils/alsa-utils/Makefile | 92 + utils/alsa-utils/patches/100-uClibc-compat.patch | 25 + utils/anyremote/Makefile | 51 + utils/anyremote/files/anyremote.cfg | 66 + utils/anyremote/files/anyremote.init | 15 + .../patches/010-dont-add-host-includes.patch | 13 + utils/ap51-flash/Makefile | 58 + utils/ap51-flash/files/ap51-flash.config | 6 + utils/ap51-flash/files/ap51-flash.init | 50 + utils/ap51-flash/files/ap51-flash.sh | 21 + utils/at/Makefile | 53 + utils/at/files/atd.init | 23 + utils/at/patches/100-cross-compile.patch | 30 + utils/at/patches/110-getloadavg.patch | 14 + utils/avrdude/Makefile | 59 + utils/avrusbboot/Makefile | 55 + utils/avrusbboot/patches/001-fix_makefile.patch | 18 + utils/avrusbboot/patches/002-fix_compilation.patch | 9 + utils/bandwidthd/Makefile | 60 + utils/bandwidthd/files/bandwidthd.config | 11 + utils/bandwidthd/files/bandwidthd.init | 88 + utils/bandwidthd/files/logo.gif | Bin 0 -> 7573 bytes .../patches/010-dont-add-host-paths.patch | 36 + .../patches/100-fix_config_file_location | 31 + utils/bash-completion/Makefile | 53 + utils/bash/Makefile | 65 + utils/bash/patches/001-compile-fix.patch | 15 + .../bash/patches/002-force-internal-readline.patch | 24 + utils/bash/patches/101-upstream-bash42-001.patch | 65 + utils/bash/patches/102-upstream-bash42-002.patch | 50 + utils/bash/patches/103-upstream-bash42-003.patch | 231 + utils/bash/patches/104-upstream-bash42-004.patch | 40 + utils/bash/patches/105-upstream-bash42-005.patch | 114 + utils/bash/patches/106-upstream-bash42-006.patch | 37 + utils/bash/patches/107-upstream-bash42-007.patch | 39 + utils/bash/patches/108-upstream-bash42-008.patch | 65 + utils/bash/patches/109-upstream-bash42-009.patch | 65 + utils/bash/patches/110-upstream-bash42-010.patch | 56 + utils/bash/patches/111-upstream-bash42-011.patch | 41 + utils/bash/patches/112-upstream-bash42-012.patch | 145 + utils/bash/patches/113-upstream-bash42-013.patch | 43 + utils/bash/patches/114-upstream-bash42-014.patch | 38 + utils/bash/patches/115-upstream-bash42-015.patch | 71 + utils/bash/patches/116-upstream-bash42-016.patch | 37 + utils/bash/patches/117-upstream-bash42-017.patch | 42 + utils/bash/patches/118-upstream-bash42-018.patch | 57 + utils/bash/patches/119-upstream-bash42-019.patch | 42 + utils/bash/patches/120-upstream-bash42-020.patch | 47 + utils/bash/patches/121-upstream-bash42-021.patch | 48 + utils/bash/patches/122-upstream-bash42-022.patch | 46 + utils/bash/patches/123-upstream-bash42-023.patch | 53 + utils/bash/patches/124-upstream-bash42-024.patch | 40 + utils/bash/patches/125-upstream-bash42-025.patch | 111 + utils/bash/patches/126-upstream-bash42-026.patch | 48 + utils/bash/patches/127-upstream-bash42-027.patch | 38 + utils/bash/patches/128-upstream-bash42-028.patch | 46 + utils/bash/patches/129-no_doc.patch | 14 + utils/bc/Makefile | 61 + utils/bc/patches/001-disable-doc.patch | 21 + utils/bemused/Makefile | 67 + utils/bemused/files/bemused-bookmarks | 8 + utils/bemused/files/bemused.conf | 43 + utils/bemused/files/bemused.init | 12 + utils/bemused/patches/110-missing_includes.patch | 11 + utils/bemused/patches/200-cxx-compile-fixes.patch | 71 + utils/bluelog/Makefile | 88 + utils/bluelog/files/bluelog.init | 13 + utils/bluez-hcidump/Makefile | 41 + utils/bluez-utils/Makefile | 75 + utils/bluez-utils/files/bluetooth.config | 32 + utils/bluez-utils/files/bluetooth.dbus | 37 + utils/bluez-utils/files/bluez-utils.init | 131 + utils/bluez-utils/files/givepin | 14 + utils/bluez-utils/patches/001-include_limits.patch | 20 + .../bluez-utils/patches/002-hcid_pin_helper.patch | 20 + utils/bluez-utils/patches/100-enokey.patch | 22 + utils/bluez-utils/patches/200-uart-speed.patch | 40 + utils/boblight/Makefile | 124 + utils/boblight/files/boblight.init | 13 + utils/bonnie++/Makefile | 49 + utils/bonnie++/patches/001-cross_compile_fix.patch | 32 + .../patches/002-add-verbose-error-messages.patch | 47 + utils/boxbackup/Makefile | 140 + utils/boxbackup/files/bbstoreaccounts | 34 + utils/boxbackup/files/bbstored.config | 26 + utils/boxbackup/files/bbstored.init | 22 + utils/boxbackup/files/bbstored.sh | 164 + utils/bsdiff/Makefile | 42 + utils/bsdiff/patches/001-makefile.patch | 11 + utils/btrfs-progs/Makefile | 55 + utils/btrfs-progs/files/btrfs-scan.init | 9 + utils/btrfs-progs/patches/001-Makefile-gcc-fix | 53 + utils/byobu/Makefile | 56 + utils/bzip2/Makefile | 76 + utils/calcurse/Makefile | 39 + utils/calvaria/Makefile | 40 + utils/calvaria/files/src/Makefile | 32 + utils/calvaria/files/src/cal2p54.c | 940 + utils/calvaria/files/src/calvaria.c | 514 + utils/ccid/Makefile | 47 + utils/ccrypt/Makefile | 37 + utils/ccrypt/patches/001-no-intl.patch | 104 + utils/cdparanoia/Makefile | 53 + .../patches/002-fixbecrash-private-keyword.patch | 908 + utils/cdparanoia/patches/010-fix_configure.patch | 40 + utils/cksfv/Makefile | 36 + utils/clish/Makefile | 52 + utils/cmdpad/Makefile | 57 + utils/cmdpad/files/cmdpad.init | 14 + utils/cmdpad/patches/100-Makefile.patch | 35 + utils/cmdpad/patches/120-kernel26-compat.patch | 15 + utils/cmdpad/patches/130-no_zombie.patch | 18 + utils/cmdpad/patches/140-compile_fix.patch | 11 + utils/collectd/Makefile | 310 + utils/collectd/files/collectd.conf | 90 + utils/collectd/files/collectd.init | 15 + .../patches/001-undefined-AM_PATH_LIBGCRYPT.patch | 4 + utils/collectd/patches/003-remove-werror.patch | 66 + .../patches/100-rrdtool-add-rrasingle-option.patch | 57 + utils/collectd/patches/110-net-device-stats.patch | 46 + utils/collectd/patches/120-fix_kernel_2.6.37.patch | 78 + .../patches/130-fix_netlink_kernel_3.3-patch | 50 + .../patches/200-fix-git-describe-error.patch | 11 + utils/collectd/patches/400-fix-olsrd-get-all.patch | 11 + utils/collectd/patches/900-add-iwinfo-plugin.patch | 275 + utils/coreutils/Makefile | 109 + .../coreutils/patches/001-no_docs_man_tests.patch | 22 + .../patches/002-fix_compile_with_uclibc.patch | 12 + utils/cpusage/Makefile | 47 + utils/cpusage/src/cpusage.c | 426 + utils/crypto-tools/Makefile | 37 + utils/cryptsetup/Makefile | 50 + utils/cwiid/Makefile | 108 + utils/cwiid/patches/100-dump_gtk_wmdemo.patch | 69 + utils/daemontools/Makefile | 51 + utils/daemontools/patches/crosscompile.patch | 205 + utils/daemontools/patches/svscanboot.patch | 16 + utils/dash/Makefile | 41 + utils/dbus/Makefile | 187 + utils/dbus/files/dbus-launch | 12 + utils/dbus/files/dbus.init | 17 + utils/deco/Makefile | 48 + utils/deco/patches/100-tty.c.patch | 11 + utils/devio/Makefile | 38 + utils/devmem2/Makefile | 37 + utils/devmem2/src/Makefile | 13 + utils/devmem2/src/devmem2.c | 132 + utils/dfu-util/Makefile | 51 + utils/dfu-util/patches/001-no_static_binary.patch | 12 + utils/dialog/Makefile | 37 + utils/digitemp/Makefile | 83 + utils/dir300-flash/Makefile | 63 + utils/disktype/Makefile | 43 + utils/dmidecode/Makefile | 44 + utils/dosfstools/Makefile | 96 + utils/dosfstools/files/dosfsck.sh | 30 + .../dosfstools/patches/002-linux_26_headers.patch | 54 + utils/dstat/Makefile | 47 + utils/dt/Makefile | 52 + utils/dtach/Makefile | 48 + utils/empty/Makefile | 41 + utils/event_test/Makefile | 37 + utils/event_test/src/Makefile | 17 + utils/event_test/src/evtest.c | 309 + utils/fancontroled/Makefile | 54 + utils/fancontroled/files/fancontroled.init | 25 + utils/firmwarehotplug/Makefile | 51 + .../patches/001-no_documentation.patch | 12 + .../patches/100-compile-fixes.patch | 36 + utils/flashrom/Makefile | 45 + utils/flashrom/patches/001-msr_dev_path.patch | 21 + utils/fortune-mod/Makefile | 45 + utils/fortune-mod/patches/01-strfile-64bit-fix | 156 + utils/fowsr/Makefile | 44 + utils/foxboard-utils/Makefile | 47 + utils/freecwmp/Config.in | 26 + utils/freecwmp/Makefile | 133 + utils/freecwmp/files/freecwmpd.init | 12 + utils/fxload/Makefile | 42 + utils/fxload/patches/010-compile_fix.patch | 18 + utils/gadgetfs-test/Makefile | 112 + .../patches/001-linux_usb_org_2007_11_29.patch | 214 + utils/gawk/Makefile | 52 + utils/gnokii/Makefile | 68 + utils/gnupg/Makefile | 65 + utils/gnuplot/Makefile | 60 + utils/gnuplot/patches/010-Makefile.in.patch | 11 + utils/gpiotoggling/Makefile | 38 + utils/gzip/Makefile | 61 + utils/gzip/patches/001-rsyncable.patch | 248 + utils/haserl/Makefile | 32 + utils/haveged/Makefile | 41 + utils/haveged/files/haveged.init | 16 + utils/hd-idle/Makefile | 47 + utils/hd-idle/files/hd-idle.config | 6 + utils/hd-idle/files/hd-idle.init | 80 + utils/hdparm/Makefile | 37 + utils/heyu/Makefile | 58 + utils/heyu/files/x10.conf | 24 + utils/heyu/patches/001-avoid_configure.patch | 261 + utils/hplip/Makefile | 80 + utils/hplip/files/20-hplip | 20 + utils/hplip/files/hplib.conf | 2 + utils/huaweiaktbbo/Makefile | 41 + utils/huaweiaktbbo/src/huaweiAktBbo.c | 95 + utils/i2c-tools/Makefile | 89 + utils/i2c-tools/patches/100-linux_include.patch | 10 + utils/ink/Makefile | 33 + utils/input-utils/Makefile | 45 + utils/input-utils/patches/001-EVIOCGKEYCODE2.patch | 220 + utils/input-utils/patches/002-version-check.patch | 34 + utils/io/Makefile | 43 + utils/io/src/io.c | 425 + utils/ipmitool/Makefile | 49 + utils/ipmitool/patches/100-cubic_root.patch | 149 + utils/ipmitool/patches/101-cross_compile.patch | 44 + utils/joe/Makefile | 49 + utils/joe/patches/001-mathaway.patch | 58 + utils/klish/Makefile | 96 + utils/kmemtrace-user/Makefile | 58 + utils/lcd4linux-tew673gru/Makefile | 33 + .../files/lcd4linux_tew673gru.conf | 243 + .../lcd4linux-tew673gru/files/openwrt_220x176.png | Bin 0 -> 13128 bytes utils/lcd4linux-tew673gru/files/tew673gru-lcd | 14 + utils/lcd4linux/Config.in | 501 + utils/lcd4linux/Makefile | 321 + utils/lcd4linux/files/lcd4linux.init | 15 + utils/lcd4linux/patches/100-drv_RouterBoard.patch | 11 + .../patches/110-uclibc-logarithm-fix.patch | 11 + .../120-remove-as-needed-linker-option.patch | 11 + utils/lcd4linux/patches/140-no_repnop_T6963.patch | 22 + utils/lcd4linux/patches/150-addlibmpdclient.patch | 2624 + utils/lcd4linux/patches/160-uinput_defs.patch | 24 + .../patches/170-add-generic-spidev-driver.patch | 195 + ...to-specify-drv_generic_graphic_real_clear.patch | 45 + .../patches/172-add-TEW673GRU-driver.patch | 552 + utils/lcdproc/Makefile | 61 + utils/lcdproc/files/LCDd | 11 + utils/lcdproc/files/lcdexec | 11 + utils/lcdproc/files/lcdproc | 11 + utils/lcdproc/files/lcdvc | 11 + utils/less/Makefile | 88 + utils/lilo/Makefile | 53 + utils/lilo/files/README | 35 + utils/lilo/files/bdlilo.conf | 30 + utils/lilo/files/boot.msg | 7 + utils/lilo/files/lilo.conf | 26 + utils/lilo/files/mkbootable | 15 + utils/lirc/Makefile | 142 + utils/lm-sensors/Makefile | 112 + utils/lm-sensors/files/sensors.conf | 117 + utils/lmbench/Makefile | 122 + .../lmbench/patches/001-fix_socklen_t_define.patch | 11 + utils/lmbench/patches/002-install-cache.patch | 10 + utils/lmbench/patches/003-add-LDLIBS.patch | 30 + .../100-bw_mem-add-newline-after-usage.patch | 11 + utils/logrotate/Makefile | 62 + utils/logrotate/files/logrotate.conf | 30 + utils/loop-aes/Makefile | 52 + utils/loop-aes/patches/001-no_sync.patch | 13 + utils/lrzsz/Makefile | 56 + utils/lrzsz/patches/100-install_delete_fix.patch | 20 + utils/lsof/Makefile | 55 + utils/lsof/patches/001-lsof_makefile.patch | 13 + utils/lsof/patches/002-lsof_noportmap.patch | 18 + utils/lsof/patches/003-lsof_selinux.patch | 11 + utils/lsof/patches/004-lsof_ccv.patch | 12 + utils/lvm2/Makefile | 87 + utils/lvm2/files/lvm2.init | 12 + utils/lvm2/patches/000-compile.patch | 11 + utils/macchanger/Makefile | 41 + utils/maemo-kexec/Config.in | 20 + utils/maemo-kexec/Makefile | 57 + utils/maemo-kexec/files/sbin/bootmaemo | 11 + utils/mc/Config.in | 20 + utils/mc/Makefile | 96 + utils/md5deep/Makefile | 40 + utils/md5deep/patches/101-cross_compile.patch | 20 + utils/mdadm/Makefile | 47 + utils/mdadm/patches/000-compile.patch | 11 + utils/mdadm/patches/100-cross_compile.patch | 19 + utils/memtester/Makefile | 45 + utils/memtester/patches/100-quiet.diff | 331 + utils/mg/Makefile | 56 + utils/mgetty/Makefile | 131 + utils/mgetty/patches/001-mgetty.patch | 88 + utils/microcom/Makefile | 47 + utils/microcom/patches/001-cross_compile.patch | 29 + utils/minicom/Makefile | 37 + .../patches/010-resolve-getline-conflict.patch | 111 + utils/mksh/Makefile | 81 + utils/mksh/patches/100-dot_mkshrc | 38 + utils/msr-tools/Makefile | 54 + utils/msr-tools/patches/100-multiprocessor.patch | 28 + utils/mtd-utils/Makefile | 115 + .../100-mtd-debug-add-bad-block-counter.patch | 73 + utils/mtd-utils/patches/130-lzma_jffs2.patch | 5031 ++ utils/mtd-utils/patches/131-fix_lib_compile.patch | 11 + .../patches/135-mkubifs_optional_lzo.patch | 119 + .../patches/136-mkubifs-fix-rinoperm-options.patch | 28 + ...37-mkubifs-allow-to-overwrite-volume-data.patch | 61 + .../patches/150-fix_ubi-utils_static.patch | 32 + utils/nano/Makefile | 52 + utils/ntfs-3g/Makefile | 235 + utils/ntfs-3g/patches-2011.4.12/001-options.patch | 20 + utils/ntfsprogs/Makefile | 61 + utils/ntfsprogs/patches/001-autoconf_fixes.patch | 52 + utils/nvramtool/Makefile | 56 + utils/open2300/Makefile | 58 + utils/open2300/patches/x1.patch | 68 + utils/open2300/patches/x2.patch | 168 + utils/owfs/Makefile | 246 + utils/oww/Makefile | 48 + utils/oww/files/oww.init | 13 + utils/pciutils/Makefile | 67 + .../patches/100-remove-no-timestamping.patch | 11 + utils/pciutils/patches/101-no-strip.patch | 11 + utils/pciutils/patches/102-compressed-ids.patch | 31 + utils/pciutils/patches/103-relative-path-ids.patch | 11 + utils/pciutils/patches/104-resolv.patch | 11 + utils/pcmciautils/Makefile | 53 + .../files/etc/hotplug.d/pcmcia/pcmcia.agent | 28 + .../hotplug.d/pcmcia_socket/pcmcia_socket.agent | 18 + utils/pcmciautils/files/etc/init.d/pcmcia | 25 + utils/pcmciautils/files/etc/init.d/pcmcia_socket | 19 + utils/pcsc-lite/Makefile | 98 + utils/pcsc-lite/files/pcscd.init | 14 + utils/petitboot/Makefile | 113 + utils/petitboot/files/petitboot.init | 22 + utils/petitboot/patches/010-petitboot-fixups.diff | 391 + .../patches/020-petitboot-fix-pb-twin.diff | 1521 + utils/petitboot/petitboot-config.in | 65 + utils/picocom/Makefile | 43 + utils/pipacs/Makefile | 39 + utils/pipacs/src/Makefile | 14 + utils/pipacs/src/parser.c | 907 + utils/pipacs/src/parser.h | 60 + utils/pipacs/src/pipacs.c | 589 + utils/powertop/Makefile | 40 + utils/powertop/patches/100-no-wide-ncurses.patch | 11 + utils/powertop/patches/200-no-gettext.patch | 48 + utils/pps-tools/Makefile | 50 + utils/pps-tools/patches/001-source.patch | 480 + utils/procps/Makefile | 61 + utils/procps/patches/010-make_fix.patch | 11 + utils/procps/patches/020_hz_fix.patch | 41 + utils/psmisc/Makefile | 65 + utils/psplash/Makefile | 55 + utils/psplash/files/image_480x640.h | 9452 ++++ utils/psplash/files/image_generic.h | 5475 ++ utils/psplash/files/psplash.init | 11 + utils/psplash/patches/000-adjust-for-openwrt.patch | 42 + .../001-hide-msgfield-and-progressbar.patch | 25 + utils/pv/Makefile | 44 + utils/pwcrypt/Makefile | 36 + utils/pwgen/Makefile | 45 + utils/rcs/Makefile | 40 + utils/rcs/patches/000-debian.patch | 4879 ++ utils/rcs/patches/100-cross_compile.patch | 413 + utils/rdiff-backup/Makefile | 57 + utils/rdiff-backup/patches/001-python_path.patch | 8 + utils/reiserfsprogs/Makefile | 43 + utils/remind/Makefile | 45 + utils/restorefactory/Makefile | 38 + utils/restorefactory/files/hotplug_restorefactory | 31 + .../files/uci_defaults_restorefactory | 10 + utils/rng-tools/Makefile | 44 + utils/rng-tools/files/rngd.init | 16 + utils/rrdcollect/Makefile | 158 + utils/rrdcollect/files/rrd.conf | 381 + utils/rrdcollect/files/rrd.sh | 288 + utils/rrdcollect/files/rrdcollect.conf | 33 + utils/rrdcollect/files/rrdcollect.init | 25 + utils/rrdtool/Makefile | 141 + .../patches/010-dont-add-host-include-paths.patch | 34 + utils/rrdtool/patches/020-x86-float-cast.patch | 13 + utils/rrdtool/patches/030-automake-compat.patch | 13 + utils/rsyncrypto/Makefile | 46 + utils/sane-backends/Makefile | 122 + .../patches/000-upstream-libv4l.patch | 32 + .../patches/001-upstream-keep-usb-device.patch | 68 + .../sane-backends/patches/002-remove-uneeded.patch | 11 + .../patches/010-dont-add-host-include-path.patch | 12 + .../sane-backends/patches/020-non-i386-qcam.patch | 20 + utils/schedtools/Makefile | 38 + utils/scponly/Makefile | 54 + .../patches/001-elif_else_replacement.patch | 12 + utils/screen/Makefile | 52 + utils/screen/files/etc/screenrc | 1 + utils/screen/patches/100-cross_compile_fix.patch | 530 + utils/sdparm/Makefile | 41 + utils/sed/Makefile | 44 + utils/setpwc/Makefile | 42 + utils/setserial/Makefile | 56 + utils/setserial/files/setserial.config | 6 + utils/setserial/files/setserial.init | 34 + utils/setserial/patches/100-compile-fixes.patch | 70 + utils/sg3-utils/Makefile | 53 + utils/shadow/Makefile | 102 + .../shadow/patches/004-disable-ruser-lookup.patch | 10 + utils/sierra-pcmcia/Makefile | 39 + utils/sispmctl/Makefile | 50 + utils/smartmontools/Makefile | 92 + utils/smartmontools/files/smartd.conf | 1 + utils/smartmontools/files/smartd.init | 16 + utils/ssldump/Makefile | 54 + utils/ssldump/patches/001-missing_headers.patch | 23 + utils/strace/Makefile | 53 + .../patches-4.5.16/001-arm_eabi_syscalls.patch | 64 + .../patches-4.5.16/002-arm_bad_syscall.patch | 20 + .../strace/patches-4.5.16/003-avr32_support.patch | 2080 + .../strace/patches-4.5.16/004-mips64_support.patch | 3342 ++ .../strace/patches-4.5.16/004-no_cacheflush.patch | 13 + utils/strace/patches-4.5.16/010-cris_support.patch | 345 + utils/stress/Makefile | 45 + utils/sysstat/Makefile | 59 + utils/sysstat/files/config | 4 + utils/sysstat/files/sysstat.init | 12 + utils/tar/Makefile | 60 + utils/taskwarrior/Makefile | 43 + utils/tcpser/Makefile | 56 + utils/tcsh/Makefile | 52 + utils/tcsh/patches/001-gethost | 11 + utils/tcsh/patches/002-NLS | 9 + utils/tesseract/Makefile | 57 + utils/testusb/Makefile | 43 + utils/testusb/src/testusb.c | 427 + utils/time/Makefile | 57 + utils/time/patches/001-fix-configure.patch | 22 + utils/time/patches/002-fix-rusage.patch | 11 + utils/tmux/Makefile | 43 + utils/tmux/patches/100-b64_ntop-conflict.patch | 41 + utils/triggerhappy/Makefile | 52 + utils/triggerhappy/files/triggerhappy-example.conf | 14 + utils/triggerhappy/files/triggerhappy.hotplug | 15 + utils/triggerhappy/files/triggerhappy.init | 10 + .../patches/100-fix-LINUX_INPUT_H.patch | 11 + utils/unrar/Makefile | 48 + utils/unzip/Makefile | 56 + utils/upx/Makefile | 51 + utils/upx/patches/100-disable_doc.patch | 11 + utils/usb-modeswitch-data/Makefile | 42 + utils/usb-modeswitch/Makefile | 47 + utils/usb-modeswitch/files/modeswitch.hotplug | 140 + utils/usbmuxd/Makefile | 86 + utils/usbutils/Makefile | 46 + utils/usbutils/patches/100-ids-relative-path.patch | 11 + .../usbutils/patches/110-gzip-update-usbids.patch | 36 + utils/valgrind/Makefile | 162 + utils/valgrind/files/default.supp | 42 + .../valgrind/patches/100-fix_configure_check.patch | 11 + utils/valgrind/patches/110-add_a_out_h.patch | 157 + utils/valgrind/src/abort.c | 3 + utils/vim/Makefile | 192 + utils/vim/files/vimrc | 12 + utils/vim/files/vimrc.full | 24 + utils/vim/patches/001-cross_compile.patch | 38 + utils/watchcat/Makefile | 43 + utils/watchcat/files/initd_watchcat | 108 + utils/watchcat/files/uci_defaults_watchcat | 10 + utils/watchcat/files/watchcat.sh | 69 + utils/wattsup/Makefile | 31 + utils/wattsup/src/Makefile | 8 + utils/wattsup/src/wattsup.c | 1877 + utils/wifitoggle/Makefile | 43 + utils/wifitoggle/files/wifitoggle.config | 11 + utils/wifitoggle/files/wifitoggle.hotplug | 170 + utils/wview/Makefile | 170 + utils/wview/files/etc/init.d/wview | 55 + utils/wview/patches/010-fix-cross-compile.patch | 499 + utils/wview/patches/020-use-standard-awk.patch | 20 + utils/wx200d/Makefile | 51 + utils/xdelta3/Makefile | 42 + .../patches/001-decrease-default-window-size.patch | 19 + utils/zile/Makefile | 45 + utils/zip/Makefile | 56 + utils/zoneinfo/Makefile | 254 + 2990 files changed, 518691 insertions(+) create mode 100644 .gitignore create mode 100644 admin/debootstrap/Makefile create mode 100644 admin/debootstrap/files/pkgdetails.c create mode 100644 admin/debootstrap/patches/100-busybox_fix.patch create mode 100644 admin/gkrellmd/Makefile create mode 100644 admin/gkrellmd/files/gkrellmd.init create mode 100644 admin/gkrellmd/patches/100-conf.patch create mode 100644 admin/htop/Makefile create mode 100644 admin/monit/Makefile create mode 100644 admin/monit/files/monit.init create mode 100644 admin/monit/patches/001-no_sslv2.patch create mode 100644 admin/monit/patches/002-uclibc_loadavg.patch create mode 100644 admin/muninlite/Makefile create mode 100644 admin/muninlite/files/etc/xinetd.d/munin create mode 100644 admin/muninlite/patches/001-no_disks.patch create mode 100644 admin/muninlite/patches/002-hostname.patch create mode 100644 admin/muninlite/patches/100-fix-no-ethtool.patch create mode 100644 admin/muninlite/patches/200-add-tap-dev.patch create mode 100644 admin/muninlite/patches/210-add-bridge-devs.patch create mode 100644 admin/nagios-plugins/Makefile create mode 100644 admin/nagios-plugins/patches/002-plugins.patch create mode 100644 admin/nagios-plugins/patches/003-pgsl-header-fix.patch create mode 100644 admin/nagios/Makefile create mode 100644 admin/nrpe/Makefile create mode 100644 admin/nrpe/files/nrpe.cfg create mode 100644 admin/nrpe/files/nrpe.init create mode 100644 admin/nrpe/patches/100-openssl-dh.patch create mode 100644 admin/nsca/Makefile create mode 100644 admin/osiris/Makefile create mode 100644 admin/osiris/files/osirisd.init create mode 100644 admin/osiris/patches/001-configure-cross.patch create mode 100644 admin/osiris/patches/002-osirisd-pidfile.patch create mode 100644 admin/osiris/patches/003-openssl-0.9.8+.patch create mode 100644 admin/osiris/patches/004-no_openssl_ripe.patch create mode 100644 admin/osiris/patches/006-mod_nvram.patch create mode 100644 admin/osiris/patches/007-mod_uptime.patch create mode 100644 admin/osiris/patches/010-dont-add-host-include-paths.patch create mode 100644 admin/ostiary/Makefile create mode 100644 admin/ostiary/files/ostiaryd.init create mode 100644 admin/ostiary/files/ssh_disable create mode 100644 admin/ostiary/files/ssh_enable create mode 100644 admin/pmacct/Makefile create mode 100644 admin/pmacct/files/nfacctd.conf create mode 100644 admin/pmacct/files/nfacctd.default create mode 100644 admin/pmacct/files/nfacctd.init create mode 100644 admin/pmacct/files/pmacctd.conf create mode 100644 admin/pmacct/files/pmacctd.default create mode 100644 admin/pmacct/files/pmacctd.init create mode 100644 admin/pmacct/files/sfacctd.conf create mode 100644 admin/pmacct/files/sfacctd.default create mode 100644 admin/pmacct/files/sfacctd.init create mode 100644 admin/pmacct/files/uacctd.conf create mode 100644 admin/pmacct/files/uacctd.default create mode 100644 admin/pmacct/files/uacctd.init create mode 100644 admin/sudo/Makefile create mode 100755 admin/sudo/files/sudo.init create mode 100644 admin/syslog-ng/Makefile create mode 100644 admin/syslog-ng/files/syslog-ng.conf create mode 100644 admin/syslog-ng/files/syslog-ng.init create mode 100644 admin/syslog-ng/patches/001-no_lfl.patch create mode 100644 admin/syslog-ng3/Makefile create mode 100644 admin/syslog-ng3/files/syslog-ng.conf create mode 100644 admin/syslog-ng3/files/syslog-ng.init create mode 100644 admin/zabbix/Makefile create mode 100644 admin/zabbix/files/zabbix_agentd.conf create mode 100644 admin/zabbix/files/zabbix_agentd.init create mode 100644 admin/zabbix/patches/001-cross_compile.patch create mode 100644 admin/zabbix/patches/002-fix-res_send-on-uclibc.patch create mode 100644 admin/zabbix/patches/002-uclibc_loadavg.patch create mode 100644 devel/binutils/Makefile create mode 100644 devel/build-essential/Makefile create mode 100644 devel/build-essential/files/usr/src/hello/hello.c create mode 100644 devel/cppunit/Makefile create mode 100644 devel/diffutils/Makefile create mode 100644 devel/dmalloc/Makefile create mode 100644 devel/dmalloc/patches/100-configure_pagesize.patch create mode 100644 devel/dmalloc/patches/110-configure_cxx.patch create mode 100644 devel/dmalloc/patches/120-makefile_shared.patch create mode 100644 devel/dmalloc/patches/130-makefile_destdir.patch create mode 100644 devel/dmalloc/patches/200-fix_return_address.patch create mode 100644 devel/dmalloc/patches/210-fix_threads.patch create mode 100644 devel/dmalloc/patches/300-fix_summarize_script.patch create mode 100644 devel/dmalloc/patches/400-undef-strndup.patch create mode 100644 devel/electric-fence/Makefile create mode 100644 devel/gcc/Makefile create mode 100644 devel/ksymoops/Makefile create mode 100644 devel/make/Makefile create mode 100644 devel/oprofile/Makefile create mode 100644 devel/oprofile/patches/100-use_insmod_instead_of_modprobe.patch create mode 100644 devel/oprofile/patches/101-remove_24_support.patch create mode 100644 devel/patch/Makefile create mode 100644 devel/patch/patches/100-install.patch create mode 100644 devel/perf/Makefile create mode 100644 ipv6/6scripts/Makefile create mode 100644 ipv6/6scripts/files/6bridge.conf create mode 100644 ipv6/6scripts/files/6bridge.init create mode 100644 ipv6/6scripts/files/6tunnel.conf create mode 100644 ipv6/6scripts/files/6tunnel.init create mode 100644 ipv6/6scripts/files/he-tun.ppp create mode 100644 ipv6/6tunnel/Makefile create mode 100644 ipv6/6tunnel/patches/100-arm-fix-optc-initialization.patch create mode 100644 ipv6/ahcpd/Makefile create mode 100644 ipv6/ahcpd/files/ahcpd.config create mode 100644 ipv6/ahcpd/files/ahcpd.init create mode 100644 ipv6/aiccu/Makefile create mode 100644 ipv6/aiccu/patches/100-cross_compile.patch create mode 100644 ipv6/aiccu/patches/200-add_dn_skipname.patch create mode 100644 ipv6/aiccu/patches/300-resolver-uclibc.patch create mode 100644 ipv6/dhcp6/Makefile create mode 100644 ipv6/dhcp6/patches/001-opt_flags.patch create mode 100644 ipv6/dhcp6/patches/002-gcc_lvalue.patch create mode 100644 ipv6/dhcp6/patches/003-debug.patch create mode 100644 ipv6/dibbler/Makefile create mode 100644 ipv6/dibbler/files/dibbler-client.init create mode 100644 ipv6/dibbler/files/dibbler-relay.init create mode 100644 ipv6/dibbler/files/dibbler-server.init create mode 100644 ipv6/gw6c/Makefile create mode 100644 ipv6/gw6c/files/gw6c.config create mode 100755 ipv6/gw6c/files/gw6c.init create mode 100755 ipv6/gw6c/files/openwrt.sh create mode 100644 ipv6/ipv6calc/Makefile create mode 100644 ipv6/miredo/Makefile create mode 100644 ipv6/miredo/files/client-hook create mode 100644 ipv6/miredo/files/miredo-server.init create mode 100644 ipv6/miredo/files/miredo.init create mode 100644 ipv6/miredo/patches/100-uclibc.patch create mode 100644 ipv6/miredo/patches/110-fix_compile_error.patch create mode 100644 ipv6/miredo/patches/120-automake-compat.patch create mode 100644 ipv6/mrd6/Makefile create mode 100644 ipv6/mrd6/files/mrd6.conf create mode 100644 ipv6/mrd6/files/mrd6.init create mode 100644 ipv6/mrd6/patches/001-add_missing_include.patch create mode 100644 ipv6/mrd6/patches/002-missing_netlink_defs.patch create mode 100644 ipv6/mrd6/patches/003-debian.patch create mode 100644 ipv6/mrd6/patches/004-ambiguous_call_fix.patch create mode 100644 ipv6/ndisc/Makefile create mode 100644 ipv6/ndisc/patches/100-favor_bsd.patch create mode 100644 ipv6/ndisc/patches/110-strverscmp.patch create mode 100644 ipv6/ndppd/Makefile create mode 100644 ipv6/ndppd/files/ndppd.init create mode 100644 ipv6/ptrtd/Makefile create mode 100644 ipv6/ptrtd/files/ptrtd.init create mode 100644 ipv6/ptrtd/patches/100-ptrtd-0.5.2-openwrt.patch create mode 100644 ipv6/radvd/Makefile create mode 100644 ipv6/radvd/files/radvd.config create mode 100644 ipv6/radvd/files/radvd.init create mode 100644 ipv6/radvd/patches/100-silent-netlink-config-reload.patch create mode 100644 ipv6/send/Makefile create mode 100644 ipv6/send/patches/001-libnetfilter_queue_update.patch create mode 100644 ipv6/send/patches/002-handle_max_bits_conf.patch create mode 100644 ipv6/send/patches/003-keysig_8bytes_alignment.patch create mode 100644 ipv6/send/patches/004-always_link_with_ncurses.patch create mode 100644 ipv6/send/patches/005-use-bundled-libconfig.patch create mode 100644 ipv6/send/patches/006-openssl-1.0.0-compat.patch create mode 100644 ipv6/shorewall6-lite/Makefile create mode 100644 ipv6/shorewall6-lite/files/hostname create mode 100644 ipv6/shorewall6-lite/files/hotplug_iface create mode 100644 ipv6/shorewall6-lite/files/shorewall-lite.init create mode 100644 ipv6/shorewall6-lite/files/vardir create mode 100644 ipv6/shorewall6-lite/patches/110-MODULESDIR.patch create mode 100644 ipv6/shorewall6-lite/patches/120-LOGFILE.patch create mode 100644 ipv6/tayga/Makefile create mode 100644 ipv6/tayga/files/tayga.hotplug create mode 100644 ipv6/tayga/files/tayga.sh create mode 100644 ipv6/thc-ipv6/Makefile create mode 100644 ipv6/thc-ipv6/patches/100-optional-openssl.patch create mode 100644 ipv6/totd/Makefile create mode 100644 ipv6/totd/files/totd.conf create mode 100644 ipv6/totd/files/totd.init create mode 100644 ipv6/totd/patches/001-no_warning_as_errors.patch create mode 100644 ipv6/tspc/Makefile create mode 100644 ipv6/tspc/patches/001-debian_patches.patch create mode 100644 ipv6/tunslip6/Makefile create mode 100644 ipv6/wide-dhcpv6/Makefile create mode 100644 ipv6/wide-dhcpv6/files/dhcp6c-dnsmasq.hotplug create mode 100644 ipv6/wide-dhcpv6/files/dhcp6c-radvd.hotplug create mode 100644 ipv6/wide-dhcpv6/files/dhcp6c-state create mode 100644 ipv6/wide-dhcpv6/files/dhcp6c.config create mode 100644 ipv6/wide-dhcpv6/files/dhcp6c.hotplug create mode 100644 ipv6/wide-dhcpv6/files/dhcp6c.init create mode 100644 ipv6/wide-dhcpv6/files/dhcp6s.config create mode 100644 ipv6/wide-dhcpv6/files/dhcp6s.hotplug create mode 100644 ipv6/wide-dhcpv6/files/dhcp6s.init create mode 100644 ipv6/wide-dhcpv6/patches/000-cftoken-noyywrap.patch create mode 100644 ipv6/wide-dhcpv6/patches/001-linux_old_compat.patch create mode 100644 ipv6/wide-dhcpv6/patches/002-fix-dprintf-clash.patch create mode 100644 lang/4th/Makefile create mode 100644 lang/arm/Makefile create mode 100644 lang/cython/Makefile create mode 100644 lang/distribute/Makefile create mode 100644 lang/egenix-mx/Makefile create mode 100644 lang/eggdrop/Makefile create mode 100644 lang/eggdrop/patches/001-makefile_in.patch create mode 100644 lang/eggdrop/patches/002-eggdrop_h.patch create mode 100644 lang/eggdrop/patches/003-language_c.patch create mode 100644 lang/eggdrop/patches/004-main_c.patch create mode 100644 lang/erlang/Makefile create mode 100644 lang/erlang/patches/101-emulator_includes.patch create mode 100644 lang/erlang/patches/103-disable_emacs.patch create mode 100644 lang/gst-python/Makefile create mode 100644 lang/ipython/Makefile create mode 100644 lang/jamvm/Makefile create mode 100644 lang/jsonpath/Makefile create mode 100644 lang/kid/Makefile create mode 100644 lang/kid/patches/000-setup.patch create mode 100644 lang/logilab-astng/Makefile create mode 100644 lang/logilab-common/Makefile create mode 100644 lang/lsqlite3/Makefile create mode 100644 lang/luaexpat/Makefile create mode 100644 lang/luaexpat/files/compat-5.1r5/compat-5.1.c create mode 100644 lang/luaexpat/files/compat-5.1r5/compat-5.1.h create mode 100644 lang/luaexpat/files/compat-5.1r5/compat-5.1.lua create mode 100644 lang/luaexpat/patches/001-compile-fix.patch create mode 100644 lang/luafilesystem/Makefile create mode 100644 lang/luaposix/Makefile create mode 100644 lang/luaposix/patches/100-eglibc-compat.patch create mode 100644 lang/luaprofiler/Makefile create mode 100644 lang/luaprofiler/patches/100-link.patch create mode 100644 lang/luasec/Makefile create mode 100644 lang/luasoap/Makefile create mode 100644 lang/luasocket/Makefile create mode 100644 lang/luasql/Makefile create mode 100644 lang/mako/Makefile create mode 100644 lang/numpy/Makefile create mode 100644 lang/numpy/patches/100-compile.patch create mode 100644 lang/perl-compress-bzip2/Makefile create mode 100644 lang/perl-dbi/Makefile create mode 100644 lang/perl-html-parser/Makefile create mode 100644 lang/perl-html-tagset/Makefile create mode 100644 lang/perl-html-tree/Makefile create mode 100644 lang/perl-lockfile-simple/Makefile create mode 100644 lang/perl-net-telnet/Makefile create mode 100644 lang/perl-uri/Makefile create mode 100644 lang/perl-www-curl/Makefile create mode 100644 lang/perl-www-curl/patches/100-perl-www-curl_disable_curl-config_hack.patch create mode 100644 lang/perl-www-mechanize/Makefile create mode 100644 lang/perl-www/Makefile create mode 100644 lang/perl/Makefile create mode 100644 lang/perl/files/Module/ScanDeps.pm create mode 100644 lang/perl/files/config.sh-arm.in create mode 100644 lang/perl/files/config.sh-armeb.in create mode 100644 lang/perl/files/config.sh-avr32.in create mode 100644 lang/perl/files/config.sh-i486.in create mode 100644 lang/perl/files/config.sh-mips.in create mode 100644 lang/perl/files/config.sh-mipsel.in create mode 100644 lang/perl/files/config.sh-powerpc.in create mode 100644 lang/perl/files/perlmod-deps.sh create mode 100644 lang/perl/files/scan-perlbase.sh create mode 100644 lang/perl/files/strippm.sh create mode 100644 lang/perl/patches/100-static_uudmap.patch create mode 100644 lang/perl/patches/101-fix-cross-compile-endianness-detection.patch create mode 100644 lang/perl/patches/200-host-libc-dir-moved-debian+derivatives.patch create mode 100644 lang/perl/perlbase.mk create mode 100644 lang/perl/perlmod.mk create mode 100644 lang/php-pear-db/Makefile create mode 100644 lang/php-pear-db/patches/100-php5-deprecation-fixes.patch create mode 100644 lang/php-pear-xmlrpc/Makefile create mode 100644 lang/php-pear/Makefile create mode 100644 lang/php-pear/patches/000-remove_deprecation_messages.patch create mode 100644 lang/php4/Makefile create mode 100644 lang/php4/files/php.ini create mode 100644 lang/php4/files/php.init create mode 100644 lang/php4/patches/002-configure.patch create mode 100644 lang/php4/patches/003-dns_skipname.patch create mode 100644 lang/php4/patches/004-uts_domainname.patch create mode 100644 lang/php4/patches/100-compile_fix.patch create mode 100644 lang/php4/patches/110-openssl-1.0.0-compat.patch create mode 100644 lang/php5/Makefile create mode 100644 lang/php5/files/php.ini create mode 100644 lang/php5/files/php5-fastcgi.config create mode 100644 lang/php5/files/php5-fastcgi.init create mode 100644 lang/php5/patches/005-APC.patch create mode 100644 lang/php5/patches/010-PECL-dio.patch create mode 100644 lang/php5/patches/011-PECL-dio-additional-baudrates.patch create mode 100644 lang/php5/patches/020-PECL-add-libevent.patch create mode 100644 lang/php5/patches/030-PECL-add-http.patch create mode 100644 lang/php5/patches/090-restore-sqlite2.patch create mode 100644 lang/php5/patches/091-fix-sqlite2.patch create mode 100644 lang/php5/patches/101-fix_membar_producer_link_error_gcc3x.patch create mode 100644 lang/php5/patches/102-debian_patches_use_embedded_timezonedb.patch create mode 100644 lang/php5/patches/103-debian_patches_use_embedded_timezonedb.patch create mode 100644 lang/php5/patches/950-Fix-dl-cross-compiling-issue.patch create mode 100644 lang/php5/pecl.mk create mode 100644 lang/psycopg/Makefile create mode 100644 lang/pybluez/Makefile create mode 100644 lang/pyclips/Makefile create mode 100644 lang/pyevent/Makefile create mode 100644 lang/pyevent/patches/000-libenevt_path_from_env.patch create mode 100644 lang/pyevent/patches/001-event-pyx-python25.patch create mode 100644 lang/pygobject/Makefile create mode 100644 lang/pygobject/patches/010-binary-constants-module.patch create mode 100644 lang/pymysql/Makefile create mode 100644 lang/pymysql/patches/000-setup.patch create mode 100644 lang/pymysql/patches/010-threadsafe.patch create mode 100644 lang/pyopenssl/Makefile create mode 100644 lang/pypcap/Makefile create mode 100644 lang/pypcap/patches/000-no_cpickle.patch create mode 100644 lang/pypcap/patches/001-python2_5.patch create mode 100644 lang/pyrrd/Makefile create mode 100644 lang/pyrrd/patches/101-cross.patch create mode 100644 lang/pyrrd/patches/200-fetch.patch create mode 100644 lang/pyserial/Makefile create mode 100644 lang/pysqlite/Makefile create mode 100644 lang/pysqlite/files/setup.cfg.in create mode 100644 lang/python-cjson/Makefile create mode 100644 lang/python-cjson/patches/001-unicode-buffer-overflow.patch create mode 100644 lang/python-crypto/Makefile create mode 100644 lang/python-curl/Makefile create mode 100644 lang/python-curl/patches/001-no_static.patch create mode 100644 lang/python-dbus/Makefile create mode 100644 lang/python-django/Makefile create mode 100644 lang/python-eeml/Makefile create mode 100644 lang/python-eeml/patches/101-cross.patch create mode 100644 lang/python-flup/Makefile create mode 100644 lang/python-ifconfig/Makefile create mode 100644 lang/python-ifconfig/patches/001-errorcheck.patch create mode 100644 lang/python-ifconfig/patches/002-checkflags-up.patch create mode 100644 lang/python-imaging-library/Makefile create mode 100644 lang/python-imaging-library/patches/101-cross_compile.patch create mode 100644 lang/python-json/Makefile create mode 100644 lang/python-mimms/Makefile create mode 100644 lang/python-pyosc/Makefile create mode 100644 lang/python-sip/Makefile create mode 100644 lang/python-sip/files/python-sip-package.mk create mode 100644 lang/python-sip/files/sipconfig.macros.template create mode 100644 lang/python-sip/patches/100-cross-compile.patch create mode 100644 lang/python-webpy/Makefile create mode 100644 lang/python/Makefile create mode 100644 lang/python/files/python-package.mk create mode 100644 lang/python/patches/000-cross-compile.patch create mode 100644 lang/python/patches/020-dont-compile-python-files.patch create mode 100644 lang/python/patches/030-fixup-include-dirs.patch create mode 100644 lang/python/patches/040-dont-import-cross-compiled-modules.patch create mode 100644 lang/python/patches/070-dont-clean-ipkg-install.patch create mode 100644 lang/python/patches/080-distutils-dont_adjust_files.patch create mode 100644 lang/python/patches/110-enable-zlib.patch create mode 100644 lang/python/patches/120-force-internal-modules-for-hashlib.patch create mode 100644 lang/python/patches/130-readline-setup.patch create mode 100644 lang/python/patches/140-verbose-sharedmods.patch create mode 100644 lang/python2-chardet/Makefile create mode 100644 lang/pyusb/Makefile create mode 100644 lang/pyxdg/Makefile create mode 100644 lang/pyyaml/Makefile create mode 100644 lang/ruby/Makefile create mode 100644 lang/ruby/patches/0001-Add-option-which-enable-SSLv2-support.patch create mode 100644 lang/sigscheme/Makefile create mode 100644 lang/simplejson/Makefile create mode 100644 lang/sqlite3-ruby/Makefile create mode 100644 lang/tcl/Makefile create mode 100644 lang/tcl/patches/100-disable_tzdata_and_msgs_install.patch create mode 100644 lang/tcl/patches/200-fix_mips_build.patch create mode 100644 lang/telepathy-python/Makefile create mode 100644 lang/twisted/Makefile create mode 100644 lang/twisted/patches/000-select_submodules.patch create mode 100644 lang/twisted/patches/001-dont_use_zope.patch create mode 100644 lang/urbi/Makefile create mode 100644 lang/urbi/patches/001-no_examples.patch create mode 100644 lang/urbi/patches/005-fix-gcc_4_3-compile.patch create mode 100644 lang/xapian-bindings/Makefile create mode 100644 lang/yapsnmp/Makefile create mode 100644 lang/yapsnmp/patches/000-compile_fix.patch create mode 100644 lang/yapsnmp/patches/001-automake-compat.patch create mode 100644 libs/aalib/Makefile create mode 100644 libs/aalib/patches/001-destdir.patch create mode 100644 libs/alsa-lib/Makefile create mode 100644 libs/alsa-lib/patches/001-link_fix.patch create mode 100644 libs/alsa-lib/patches/003-mips-atomic-static-inline.patch create mode 100644 libs/alsa-lib/patches/004-ccache.patch create mode 100644 libs/apr-util/Makefile create mode 100644 libs/apr-util/patches/001-automake-compat.patch create mode 100644 libs/apr/Makefile create mode 100644 libs/apr/patches/001-autoconf-compat.patch create mode 100644 libs/apr/patches/101-fix_apr_time_now.patch create mode 100644 libs/argp-standalone/Makefile create mode 100644 libs/argp-standalone/patches/001-throw-in-funcdef.patch create mode 100644 libs/argtable/Makefile create mode 100644 libs/avahi/Makefile create mode 100644 libs/avahi/files/avahi-daemon.conf create mode 100644 libs/avahi/files/avahi-daemon.init create mode 100644 libs/avahi/files/service-http create mode 100644 libs/avahi/files/service-ssh create mode 100644 libs/avahi/patches/010-step_back_autotools-no-gettext.patch create mode 100644 libs/axtls/Makefile create mode 100644 libs/axtls/files/config create mode 100644 libs/axtls/patches/001-opt_flags.patch create mode 100644 libs/axtls/patches/002-axhttpd_install.patch create mode 100644 libs/bluez-libs/Makefile create mode 100644 libs/bluez-libs/patches/010-dont-override-libdir.patch create mode 100644 libs/boost/Makefile create mode 100644 libs/boost/patches/100-do-not-use-librt.patch create mode 100644 libs/c-ares/Makefile create mode 100644 libs/cgilib/Makefile create mode 100644 libs/cgilib/patches/200-cgitest_bugfix.patch create mode 100644 libs/cgilib/patches/300-cpp_bugfix.patch create mode 100644 libs/check/Makefile create mode 100644 libs/classpath/Makefile create mode 100644 libs/classpath/patches/000-fix_include.patch create mode 100644 libs/clearsilver/Config.in create mode 100644 libs/clearsilver/Makefile create mode 100644 libs/clearsilver/patches/001-gcc-vs-dollar-cc.patch create mode 100644 libs/clearsilver/patches/002-make-install-depends.patch create mode 100644 libs/clearsilver/patches/003-disable-tests.patch create mode 100644 libs/clearsilver/patches/100-remove_warnings.patch create mode 100644 libs/clearsilver/patches/101-fix_content_type_ff3.patch create mode 100644 libs/clearsilver/patches/102-add_x_requested_http_headers.patch create mode 100644 libs/clinkc/Makefile create mode 100644 libs/confuse/Makefile create mode 100644 libs/confuse/patches/001-no_werror.patch create mode 100644 libs/credis/Makefile create mode 100644 libs/credis/patches/200-Makefile.patch create mode 100644 libs/curl/Makefile create mode 100644 libs/curl/patches/100-cross-compile.patch create mode 100644 libs/curl/patches/200-no_docs_tests.patch create mode 100644 libs/cyrus-sasl/Makefile create mode 100644 libs/cyrus-sasl/patches/001-automake-compat.patch create mode 100644 libs/cyrus-sasl/patches/200-fix_avr32_compile.patch create mode 100644 libs/db47/Makefile create mode 100644 libs/db47/patches/001-sequence_lock.patch create mode 100644 libs/db47/patches/002-lock.patch create mode 100644 libs/db47/patches/003-dead_lock.patch create mode 100644 libs/dbus-glib/Makefile create mode 100644 libs/dbus-glib/patches/001-cross.patch create mode 100644 libs/dbus-glib/patches/003-disable-tests-docs-examples.patch create mode 100644 libs/elfutils/Makefile create mode 100644 libs/elfutils/patches/001-elfutils-portability.patch create mode 100644 libs/elfutils/patches/002-no_tests.patch create mode 100644 libs/elfutils/patches/003-no_warnings_as_errors.patch create mode 100644 libs/elfutils/patches/004-memcpy_def.patch create mode 100644 libs/elfutils/patches/005-only_libdw_libelf.patch create mode 100644 libs/elfutils/patches/006-libdw_LIBS.patch create mode 100644 libs/eventlog/Makefile create mode 100644 libs/expat/Makefile create mode 100644 libs/ezxml/Makefile create mode 100644 libs/ezxml/patches/100-cross_compile.patch create mode 100644 libs/ezxml/patches/101-build_shared.patch create mode 100644 libs/ezxml/patches/200-ezxml_parse_str.patch create mode 100644 libs/ezxml/patches/201-ezxml_int.patch create mode 100644 libs/ezxml/patches/202-ezxml_child.patch create mode 100644 libs/ezxml/patches/203-ezxml_cut.patch create mode 100644 libs/faad2/Makefile create mode 100644 libs/fcgi/Makefile create mode 100644 libs/fcgi/patches/100-fcgio-int-type-fix.patch create mode 100644 libs/fcgi/patches/110-no_examples.patch create mode 100644 libs/fftw3/Makefile create mode 100644 libs/fftw3/patches/001-makefile.patch create mode 100644 libs/file/Makefile create mode 100644 libs/firewall-mod-save/Makefile create mode 100644 libs/firewall-mod-save/files/20_save.sh create mode 100644 libs/flac/Makefile create mode 100644 libs/flac/patches/001-no-docs-and-examples.patch create mode 100644 libs/flac/patches/002-no-utility.patch create mode 100644 libs/flac/patches/010-automake-compat.patch create mode 100644 libs/freetype/Makefile create mode 100644 libs/fribidi/Makefile create mode 100644 libs/ftplib/Makefile create mode 100644 libs/ftplib/patches/001-fix_ascii_read_without_eol.patch create mode 100644 libs/ftplib/patches/002-check_getserv_by_name.patch create mode 100644 libs/gd/Makefile create mode 100644 libs/gd/patches/100-configure_fix.patch create mode 100644 libs/gd/patches/101-gdlib-config.patch create mode 100644 libs/gdbm/Makefile create mode 100644 libs/gettext-full/Makefile create mode 100644 libs/gettext-full/patches/001-autotools.patch create mode 100644 libs/gettext-full/patches/001-no_examples_and_tests.patch create mode 100644 libs/gettext-full/patches/003-gettext-error_print_progname.patch create mode 100644 libs/gettext-full/patches/004-gnulib-uclibc-sched_param-def.patch create mode 100644 libs/gettext-full/patches/005-uclibc-0.9.30-compat.patch create mode 100644 libs/gettext-full/patches/100-error_progname.patch create mode 100644 libs/gettext-full/patches/120-uclibc-nolocale.patch create mode 100644 libs/gettext-full/patches/150-disable_libxml_iconv.patch create mode 100644 libs/gettext-full/patches/160-eglibc_stdio.patch create mode 100644 libs/gettext/Makefile create mode 100644 libs/gettext/src/include/libintl.h create mode 100644 libs/gettext/src/m4/codeset.m4 create mode 100644 libs/gettext/src/m4/gettext.m4 create mode 100644 libs/gettext/src/m4/intl.m4 create mode 100644 libs/gettext/src/m4/intldir.m4 create mode 100644 libs/gettext/src/m4/intlmacosx.m4 create mode 100644 libs/gettext/src/m4/lcmessage.m4 create mode 100644 libs/gettext/src/m4/nls.m4 create mode 100644 libs/gettext/src/m4/po.m4 create mode 100644 libs/giflib/Makefile create mode 100644 libs/glib/Makefile create mode 100644 libs/glib/patches/001-automake-compat.patch create mode 100644 libs/glib/patches/002-glibconfig-sysdefs.h.patch create mode 100644 libs/glib/patches/003-gcc-3.4-compat.patch create mode 100644 libs/glib/patches/004-underquoted-glib.m4.patch create mode 100644 libs/glib2/Makefile create mode 100644 libs/glib2/patches/001-automake-compat.patch create mode 100644 libs/glib2/patches/002-missing-gthread-include.patch create mode 100644 libs/glib2/patches/010-move-iconv-to-libs.patch create mode 100644 libs/glib2/patches/020-no-docs-tests-translations.patch create mode 100644 libs/glibmm/Makefile create mode 100644 libs/glibmm/patches/100-disable-examples-tests-doc-tools-scripts.patch create mode 100644 libs/gmp/Makefile create mode 100644 libs/gnutls/Makefile create mode 100644 libs/gnutls/patches/001-no_doc_tests_po.patch create mode 100644 libs/gperf/Makefile create mode 100644 libs/gpgme/Makefile create mode 100644 libs/gsl/Makefile create mode 100644 libs/gsm/Makefile create mode 100644 libs/gsm/patches/001-debian-libsgm-1.0.10-13.patch create mode 100644 libs/howl/Makefile create mode 100644 libs/howl/files/autoipd.init create mode 100644 libs/howl/files/mDNSResponder.conf create mode 100644 libs/howl/files/mDNSResponder.init create mode 100644 libs/howl/files/nifd.init create mode 100644 libs/howl/patches/001-config.patch create mode 100644 libs/howl/patches/002-debug_log.patch create mode 100644 libs/howl/patches/003-proto_fix.patch create mode 100644 libs/howl/patches/004-linux_types.patch create mode 100644 libs/id3lib/Makefile create mode 100644 libs/id3lib/patches/100-missing_include.patch create mode 100644 libs/id3lib/patches/120-fix-configure-remove-check-for-iomanip_h.patch create mode 100644 libs/id3lib/patches/130-fix-includes.patch create mode 100644 libs/id3lib/patches/140-dont-build-examples.patch create mode 100644 libs/iksemel/Makefile create mode 100644 libs/iksemel/patches/001-missing-macros.patch create mode 100644 libs/intltool/Makefile create mode 100644 libs/jansson/Makefile create mode 100644 libs/jansson/patches/01-jansson-add-jason_object_deep_update.patch create mode 100644 libs/jansson/patches/100-add-jason_object_deep_update.patch create mode 100644 libs/jpeg/Makefile create mode 100644 libs/jpeg/patches/001-allow-ccache.patch create mode 100644 libs/jpeg/patches/200-crop.patch create mode 100644 libs/keynote/Makefile create mode 100644 libs/keynote/patches/001-build.patch create mode 100644 libs/keynote/patches/002-cross_compile.patch create mode 100644 libs/ldns/Makefile create mode 100644 libs/leptonica/Makefile create mode 100644 libs/libIDL2/Makefile create mode 100644 libs/libaio/Makefile create mode 100644 libs/libaio/patches/001-arches_from_debian_package_0.3.106-8.patch create mode 100644 libs/libaio/patches/002-avr32_support.patch create mode 100644 libs/libamsel/Makefile create mode 100644 libs/libao/Makefile create mode 100644 libs/libart/Makefile create mode 100644 libs/libassuan/Makefile create mode 100644 libs/libatomicops/Makefile create mode 100644 libs/libaudiofile/Makefile create mode 100644 libs/libaudiofile/patches/001-audiofile-config-libdirs.patch create mode 100644 libs/libcap/Makefile create mode 100644 libs/libcelt/Makefile create mode 100644 libs/libcli/Makefile create mode 100644 libs/libconfig/Makefile create mode 100644 libs/libcroco/Makefile create mode 100644 libs/libcroco/patches/001-automake-compat.patch create mode 100644 libs/libcrypto++/Makefile create mode 100644 libs/libcrypto++/patches/001-strict_gcc43_include.patch create mode 100644 libs/libcrypto++/patches/002-cryptest_data_files_location.patch create mode 100644 libs/libcrypto++/patches/003-autoconf_files.patch create mode 100644 libs/libcunit/Makefile create mode 100644 libs/libdaemon/Makefile create mode 100644 libs/libdaq/Makefile create mode 100644 libs/libdaq/patches/001-cross-compile-test.patch create mode 100644 libs/libdbi/Makefile create mode 100644 libs/libdbi/patches/001-no_docs.patch create mode 100644 libs/libdirectfb/Makefile create mode 100644 libs/libdirectfb/patches/disable-asm.patch create mode 100644 libs/libdlna/Makefile create mode 100644 libs/libdlna/patches/100-configure_fix.patch create mode 100644 libs/libdlna/patches/200-parallel-build.patch create mode 100644 libs/libdlna/patches/300-ffmpeg_compat.patch create mode 100644 libs/libdmapsharing/Makefile create mode 100644 libs/libdmapsharing/patches/001-diable_pixbuf.patch create mode 100644 libs/libdnet/Makefile create mode 100644 libs/libdnet/patches/001-dnet_config.patch create mode 100644 libs/libdnet/patches/002-fix_avr32_compile.patch create mode 100644 libs/libdnet/patches/010-gcc4.patch create mode 100644 libs/libdvbpsi/Makefile create mode 100644 libs/libdvbpsi/patches/001-no_doc_examples.patch create mode 100644 libs/libdvdread/Makefile create mode 100644 libs/libelf/Makefile create mode 100644 libs/libevent/Makefile create mode 100644 libs/libevent2/Makefile create mode 100644 libs/libexif/Makefile create mode 100644 libs/libexif/patches/100-no_doc.patch create mode 100644 libs/libffi/Makefile create mode 100644 libs/libfreecwmp/Makefile create mode 100644 libs/libfreefare/Makefile create mode 100644 libs/libfreenect/Makefile create mode 100644 libs/libftdi/Makefile create mode 100644 libs/libgcrypt/Makefile create mode 100644 libs/libgcrypt/patches/001-no_docs_tests.patch create mode 100644 libs/libgpg-error/Makefile create mode 100644 libs/libgphoto2/Makefile create mode 100644 libs/libgphoto2/patches/001-automake-compat.patch create mode 100644 libs/libgphoto2/patches/002-no-tests-docs-examples-translations.patch create mode 100644 libs/libgssapi/Makefile create mode 100644 libs/libiconv-full/Makefile create mode 100644 libs/libiconv-full/patches/100-strip_charsets.patch create mode 100644 libs/libiconv-full/patches/101-autotools.patch create mode 100644 libs/libiconv-full/patches/103-configure_ac_fix.patch create mode 100644 libs/libiconv-full/patches/200-work-with-libtool2.patch create mode 100644 libs/libiconv/COPYING create mode 100644 libs/libiconv/COPYRIGHT create mode 100644 libs/libiconv/Makefile create mode 100644 libs/libiconv/src/iconv.c create mode 100644 libs/libiconv/src/include/charmaps.h create mode 100644 libs/libiconv/src/include/charmaps/iso-8859-10.h create mode 100644 libs/libiconv/src/include/charmaps/iso-8859-13.h create mode 100644 libs/libiconv/src/include/charmaps/iso-8859-14.h create mode 100644 libs/libiconv/src/include/charmaps/iso-8859-16.h create mode 100644 libs/libiconv/src/include/charmaps/iso-8859-2.h create mode 100644 libs/libiconv/src/include/charmaps/iso-8859-3.h create mode 100644 libs/libiconv/src/include/charmaps/iso-8859-4.h create mode 100644 libs/libiconv/src/include/charmaps/iso-8859-5.h create mode 100644 libs/libiconv/src/include/charmaps/iso-8859-6.h create mode 100644 libs/libiconv/src/include/charmaps/iso-8859-7.h create mode 100644 libs/libiconv/src/include/charmaps/iso-8859-8.h create mode 100644 libs/libiconv/src/include/charmaps/iso-8859-9.h create mode 100644 libs/libiconv/src/include/charmaps/koi8-r.h create mode 100644 libs/libiconv/src/include/charmaps/windows-1250.h create mode 100644 libs/libiconv/src/include/charmaps/windows-1251.h create mode 100644 libs/libiconv/src/include/charmaps/windows-1252.h create mode 100644 libs/libiconv/src/include/charmaps/windows-1253.h create mode 100644 libs/libiconv/src/include/charmaps/windows-1254.h create mode 100644 libs/libiconv/src/include/charmaps/windows-1255.h create mode 100644 libs/libiconv/src/include/charmaps/windows-1256.h create mode 100644 libs/libiconv/src/include/charmaps/windows-1257.h create mode 100644 libs/libiconv/src/include/charmaps/windows-1258.h create mode 100644 libs/libiconv/src/include/charmaps/windows-874.h create mode 100644 libs/libiconv/src/include/iconv.h create mode 100644 libs/libiconv/src/m4/iconv.m4 create mode 100644 libs/libid3tag/Makefile create mode 100644 libs/libidn/Makefile create mode 100644 libs/libidn/patches/001-remove-libtool.patch create mode 100644 libs/libidn/patches/002-disable-po-docs-examples.patch create mode 100644 libs/libimobiledevice/Makefile create mode 100644 libs/libinklevel/Makefile create mode 100644 libs/libinklevel/patches/001-configure.patch create mode 100644 libs/libinklevel/patches/002-disable_parport.patch create mode 100644 libs/libinklevel/patches/003-fix_usb_device_location.patch create mode 100644 libs/liblo/Makefile create mode 100644 libs/libmad/Makefile create mode 100644 libs/libmad/patches/001-mips_removal_h_constraint.patch create mode 100644 libs/libmbus/Makefile create mode 100644 libs/libmcrypt/Makefile create mode 100644 libs/libmicrohttpd/Makefile create mode 100644 libs/libmicroxml/Makefile create mode 100644 libs/libmikmod/Makefile create mode 100644 libs/libmikmod/patches/001-disable-doc.patch create mode 100644 libs/libmikmod/patches/003-automake-compat.patch create mode 100644 libs/libmms/Makefile create mode 100644 libs/libmnl/Makefile create mode 100644 libs/libmodbus/Makefile create mode 100644 libs/libmpcdec/Makefile create mode 100644 libs/libmpcdec/patches/001-automake-compat.patch create mode 100644 libs/libmpcdec/patches/100-fixed_point.patch create mode 100644 libs/libmpd/Makefile create mode 100644 libs/libmpdclient/Makefile create mode 100644 libs/libmpeg2/Makefile create mode 100644 libs/libmpeg2/patches/101-ppc_no_altivec.patch create mode 100644 libs/libmpeg2/patches/102-arm_data_preload_check.patch create mode 100644 libs/libnatpmp/Makefile create mode 100644 libs/libnatpmp/patches/001-cross_compile.patch create mode 100644 libs/libnet-1.0.x/Makefile create mode 100644 libs/libnet-1.0.x/patches/100-debian_subset.patch.gz create mode 100644 libs/libnet-1.0.x/patches/150-portability.patch create mode 100644 libs/libnet-1.1.x/Makefile create mode 100644 libs/libnet-1.1.x/patches/100-debian-subset.patch create mode 100644 libs/libnet-1.1.x/patches/150-portability.patch create mode 100644 libs/libnet-1.1.x/patches/160-endian_cache.patch create mode 100644 libs/libnetfilter-conntrack/Makefile create mode 100644 libs/libnetfilter-log/Makefile create mode 100644 libs/libnetfilter-queue/Makefile create mode 100644 libs/libnfc/Makefile create mode 100644 libs/libnfnetlink/Makefile create mode 100644 libs/libnfsidmap/Makefile create mode 100644 libs/libnfsidmap/patches/000-no-getgrouplist.patch create mode 100644 libs/libnids/Makefile create mode 100644 libs/libnids/patches/001-no_asm_for_i386.patch create mode 100644 libs/libnids/patches/002-configure.patch create mode 100644 libs/libnids/patches/003-missing_else.patch create mode 100644 libs/libogg/Makefile create mode 100644 libs/liboil/Makefile create mode 100644 libs/liboil/patches/001-no-tools-docs-examples.patch create mode 100644 libs/liboil/patches/002-pkgconfig.patch create mode 100644 libs/libol/Makefile create mode 100644 libs/liboping/Makefile create mode 100644 libs/liboping/patches/01-no-werror.patch create mode 100644 libs/libosip2/Makefile create mode 100644 libs/libosip2/patches/001-automake-compat.patch create mode 100644 libs/libowfat/Makefile create mode 100644 libs/libpam/Makefile create mode 100644 libs/libpam/patches/000-OE-libpam-xtests.patch create mode 100644 libs/libpam/patches/000-OE-pam-no-innetgr.patch create mode 100644 libs/libpam/patches/001-no_nis.patch create mode 100644 libs/libpam/patches/002-no_yywrap.patch create mode 100644 libs/libpam/patches/003-no_doc.patch create mode 100644 libs/libpam/patches/004-fix_lib64.patch create mode 100644 libs/libpam/patches/005-fix_ruserok.patch create mode 100644 libs/libpam/patches/006-fix_xdr.patch create mode 100644 libs/libpar2/Makefile create mode 100644 libs/libpar2/patches/100-par2cmdline-0.4-packed.patch create mode 100644 libs/libpfm/Makefile create mode 100644 libs/libplist/Makefile create mode 100644 libs/libpng/Makefile create mode 100644 libs/libpng/patches/100-config_fix.patch create mode 100644 libs/libpng/patches/200-CVE-2011-3026.patch create mode 100644 libs/libpthread-stubs/Makefile create mode 100644 libs/libptmalloc3/Makefile create mode 100644 libs/libptmalloc3/patches/100-nothreads.patch create mode 100644 libs/librpcsecgss/Makefile create mode 100644 libs/librsync/Makefile create mode 100644 libs/librsync/patches/001-4gb_files.patch create mode 100644 libs/libsamplerate/Makefile create mode 100644 libs/libsamplerate/patches/001-fix-m4-loop.patch create mode 100644 libs/libsdl/Makefile create mode 100644 libs/libsdl/patches/001-automake-compat.patch create mode 100644 libs/libsdl_mixer/Makefile create mode 100755 libs/libsdl_mixer/files/sdl-config create mode 100644 libs/libsdl_mixer/patches/001-automake-compat.patch create mode 100644 libs/libsdl_mixer/patches/002-fix-linking.patch create mode 100644 libs/libsdl_sound/Makefile create mode 100644 libs/libshout/Makefile create mode 100644 libs/libshout/patches/100-ogg-c.patch create mode 100644 libs/libshout/patches/110-shout-ogg-c.patch create mode 100644 libs/libshout/patches/120-vorbis-c.patch create mode 100644 libs/libshout/patches/140-no_example_doc_win32.patch create mode 100644 libs/libsigc++/Makefile create mode 100644 libs/libsigc++/patches/001-no_doc_tests_examples.patch create mode 100644 libs/libsml/Makefile create mode 100644 libs/libsml/patches/010-no-examples-tests.patch create mode 100644 libs/libsml/patches/020-ldflags.patch create mode 100644 libs/libsml/patches/030-cross-compile.patch create mode 100644 libs/libsndfile/Makefile create mode 100644 libs/libsndfile/patches/001-automake-compat.patch create mode 100644 libs/libsoup/Makefile create mode 100644 libs/libspe2/Makefile create mode 100644 libs/libspe2/patches/001-remove_tls_requirement.patch create mode 100644 libs/libsrtp/Makefile create mode 100644 libs/libsrtp/patches/1003_fix_mips_namespace_collision.patch create mode 100644 libs/libsrtp/patches/1005_fix_data_alignment.patch create mode 100644 libs/libsrtp/patches/1007_update_Doxyfile.patch create mode 100644 libs/libsrtp/patches/1008_shared-lib.patch create mode 100644 libs/libssh2/Makefile create mode 100644 libs/libsynce/Makefile create mode 100644 libs/libtasn1/Makefile create mode 100644 libs/libtheora/Makefile create mode 100644 libs/libtheora/patches/001-no_docs_tests.patch create mode 100644 libs/libtorrent/Makefile create mode 100644 libs/libtorrent/patches/000-upstream-gcc46-fixes.patch create mode 100644 libs/libtorrent/patches/100-fix_cross_compile.patch create mode 100644 libs/libtorrent/patches/120-fix-ipv6_socket_datagram.patch create mode 100644 libs/libtwin/Makefile create mode 100644 libs/libtwin/patches/100-compile_fix.patch create mode 100644 libs/libupnp/Makefile create mode 100644 libs/libusb-1.0/Makefile create mode 100644 libs/libusb-1.0/patches/001-timerfd.patch create mode 100644 libs/libusb/Makefile create mode 100644 libs/libusb/patches/000-debian_packed.patch create mode 100644 libs/libusb/patches/001-debian_ansi_types.patch create mode 100644 libs/libusb/patches/002-no_libusbpp.patch create mode 100644 libs/libusb/patches/003-automake-compat.patch create mode 100644 libs/libusb/patches/004-no_unused.patch create mode 100644 libs/libv4l/Makefile create mode 100644 libs/libv4l/patches/001-no-shm_open-fix.patch create mode 100644 libs/libv4l/patches/002-allow-disabling-libjpeg.patch create mode 100644 libs/libv4l/patches/003-add-missing-libs.patch create mode 100644 libs/libv4l/patches/004-disable-qv4l2.patch create mode 100644 libs/libvncserver/Makefile create mode 100644 libs/libvncserver/patches/001-automake-compat.patch create mode 100644 libs/libvncserver/patches/100-noexamples.patch create mode 100644 libs/libvorbis/Makefile create mode 100644 libs/libvorbis/patches/001-automake-compat.patch create mode 100644 libs/libvorbisidec/Makefile create mode 100644 libs/libxapian/Makefile create mode 100644 libs/libxapian/patches/001-missing_includes.patch create mode 100644 libs/libxapian/patches/002-xapian_config_no_ltlibs.patch create mode 100644 libs/libxml2/Makefile create mode 100644 libs/libxml2/patches/001-debian_CVEs.patch create mode 100644 libs/libxslt/Makefile create mode 100644 libs/libyaml/Makefile create mode 100644 libs/libzip/Makefile create mode 100644 libs/libzstream/Makefile create mode 100644 libs/lzo/Makefile create mode 100644 libs/matrixssl/Makefile create mode 100644 libs/matrixssl/patches/100-matrixssl_1.2.4.patch create mode 100644 libs/matrixssl/patches/200-compile-fixes.patch create mode 100644 libs/mxml/Makefile create mode 100644 libs/mxml/patches/001-targets.patch create mode 100644 libs/mysql/Makefile create mode 100644 libs/mysql/conf/my.cnf create mode 100644 libs/mysql/files/lex_hash.h create mode 100644 libs/mysql/files/mysqld.init create mode 100644 libs/mysql/patches/500-cross_compile.patch create mode 100644 libs/mysql/patches/501-disable-pthread-and-tests.patch create mode 100644 libs/mysql/patches/502-fix-hostname.patch create mode 100644 libs/nacl/Makefile create mode 100755 libs/nacl/do-openwrt create mode 100644 libs/neon/Makefile create mode 100644 libs/neon/patches/001-automake-compat.patch create mode 100644 libs/newt/Makefile create mode 100644 libs/newt/patches/100-compile-fix-broken-makefile.patch create mode 100644 libs/newt/patches/110-disable-snackmodule-python.patch create mode 100644 libs/nmeap/Makefile create mode 100644 libs/nmeap/patches/100-no_test.patch create mode 100644 libs/opal/Makefile create mode 100644 libs/opal/patches/010-fix-gcc_4_3-compile.patch create mode 100644 libs/opencdk/Makefile create mode 100644 libs/opencdk/patches/100-fix-tests-build create mode 100644 libs/opencdk/patches/200-verify-clearsigned.patch create mode 100644 libs/openh323/Makefile create mode 100644 libs/openh323/patches/001-configure.patch create mode 100644 libs/openldap/Makefile create mode 100644 libs/openldap/files/ldap.init create mode 100644 libs/openldap/patches/001-automake-compat.patch create mode 100644 libs/openldap/patches/020-autofs-schema.patch create mode 100644 libs/openldap/patches/750-no-strip.patch create mode 100644 libs/orbit2/Makefile create mode 100644 libs/orbit2/patches/001-remove-libtool.patch create mode 100644 libs/orbit2/patches/010-dont-run-testprograms.patch create mode 100644 libs/ortp/Makefile create mode 100644 libs/ossp-js/Makefile create mode 100644 libs/pcre/Makefile create mode 100644 libs/pcre/patches/750-pcre_config_cross.patch create mode 100644 libs/phidget21/Makefile create mode 100644 libs/poco/Makefile create mode 100644 libs/poco/patches/100-sharedmemory.patch create mode 100644 libs/polarssl/Makefile create mode 100644 libs/polarssl/patches/100-disable-testsuites.patch create mode 100644 libs/popt/Makefile create mode 100644 libs/popt/patches/002-no-intl.patch create mode 100644 libs/postgresql/Makefile create mode 100644 libs/postgresql/files/postgresql.config create mode 100644 libs/postgresql/files/postgresql.init create mode 100644 libs/postgresql/patches/200-ranlib.patch create mode 100644 libs/postgresql/patches/800-busybox-default-pager.patch create mode 100644 libs/protobuf-c/Makefile create mode 100644 libs/protobuf/Makefile create mode 100644 libs/pthsem/Makefile create mode 100644 libs/ptlib/Makefile create mode 100644 libs/ptlib/patches/010-fix-gcc_4_3-compile.patch create mode 100644 libs/ptlib/patches/020-uclibc-res_nsearch.patch create mode 100644 libs/pwlib/Makefile create mode 100644 libs/pwlib/patches/002-lib_mak.patch create mode 100644 libs/radiusclient-ng/Makefile create mode 100644 libs/radiusclient-ng/patches/001-cross_compile.patch create mode 100644 libs/radlib/Makefile create mode 100644 libs/radlib/patches/001-cross_compile_link_bug.patch create mode 100644 libs/rblibtorrent/Makefile create mode 100644 libs/rblibtorrent/patches/enable-shared-linking.patch create mode 100644 libs/re/Makefile create mode 100644 libs/rem/Makefile create mode 100644 libs/rrdtool-1.0.x/Makefile create mode 100644 libs/rrdtool-1.0.x/patches/001-no_ordering_cd_joke.patch create mode 100644 libs/rrdtool-1.0.x/patches/002-no_timezone.patch create mode 100644 libs/rrdtool-1.0.x/patches/020-x86-float-cast.patch create mode 100644 libs/sctp/Makefile create mode 100644 libs/serdisplib/Makefile create mode 100644 libs/shflags/Makefile create mode 100644 libs/shflags/patches/000-strip.patch create mode 100644 libs/slang2/Makefile create mode 100755 libs/slang2/files/ncurses5-config create mode 100644 libs/spandsp/Makefile create mode 100644 libs/spandsp/patches/100-compile-fixes.patch create mode 100644 libs/speex/Makefile create mode 100644 libs/sqlite2/Makefile create mode 100644 libs/sqlite3/Makefile create mode 100644 libs/st2205tool/Makefile create mode 100644 libs/st2205tool/patches/100-base-makefile.patch create mode 100644 libs/st2205tool/patches/110-libst-makefile.patch create mode 100644 libs/st2205tool/patches/120-setpic-makefile.patch create mode 100644 libs/sysfsutils/Makefile create mode 100644 libs/sysfsutils/patches/200-mnt_path_check.patch create mode 100644 libs/taglib/Makefile create mode 100644 libs/taglib/patches/100-uclibc++-compat.patch create mode 100644 libs/tcp_wrappers/Makefile create mode 100644 libs/tcp_wrappers/patches/001-debian_subset.patch create mode 100644 libs/tcp_wrappers/patches/002-opt_cflags.patch create mode 100644 libs/tcp_wrappers/patches/003-scaffold_malloc.patch create mode 100644 libs/tcp_wrappers/patches/004-ipv4_prefix.patch create mode 100644 libs/tiff/Makefile create mode 100644 libs/tokyocabinet/Makefile create mode 100644 libs/tokyocabinet/patches/100-remove_extra_paths_from_configure.patch create mode 100644 libs/tokyocabinet/patches/200-uclibc_0.9.30_compat.patch create mode 100644 libs/ucl/Makefile create mode 100644 libs/ucl/patches/001-autoconf-compat.patch create mode 100644 libs/unixodbc/Makefile create mode 100644 libs/unixodbc/files/unixodbc_conf.h create mode 100644 libs/ustl/Makefile create mode 100644 libs/ustl/files/Common.mk create mode 100644 libs/ustl/files/config.h create mode 100644 libs/ustl/patches/001-install-DESTDIR.patch create mode 100644 libs/ustl/patches/002-install_path.patch create mode 100644 libs/ustl/patches/003-fix_stream_bounds_check_dep.patch create mode 100644 libs/vips/Makefile create mode 100644 libs/vips/patches/001-no_cpp.patch create mode 100644 libs/wt/Makefile create mode 100644 libs/wt/patches/100-fix_random_dev.patch create mode 100644 libs/wxbase/Makefile create mode 100644 libs/xmlrpc-c/Makefile create mode 100644 libs/xmlrpc-c/patches/001-config.mk.in.patch create mode 100644 libs/xmlrpc-c/patches/002-automake-compat.patch create mode 100644 libs/xmpp4r/Makefile create mode 100644 libs/zaptel-1.4.x/Makefile create mode 100644 libs/zaptel-1.4.x/files/10-create-device-node create mode 100644 libs/zaptel-1.4.x/patches/002-upstream_hrtimer.patch create mode 100644 libs/zaptel-1.4.x/patches/100-no_hrtimer_on_x86_only.patch create mode 100644 libs/zaptel-1.4.x/patches/200-Makefile-pwd.patch create mode 100644 libs/zaptel-1.4.x/patches/330-uname_m.patch create mode 100644 libs/zaptel-1.4.x/patches/340-2.6.32.patch create mode 100644 libs/zaptel-1.4.x/patches/350-2.6.34.patch create mode 100644 libs/zaptel-1.4.x/patches/360-slab.patch create mode 100644 libs/zaptel-1.4.x/patches/370-2.6.36.patch create mode 100644 libs/zaptel-1.4.x/patches/371-3.x.patch create mode 100644 libs/zaptel-1.4.x/patches/380-use_cross_ar.patch create mode 100644 libs/zaptel-1.4.x/patches/390-include_spinlock_h.patch create mode 100644 libs/zaptel/Makefile create mode 100644 libs/zaptel/patches/110-Makefile-tonezone_install.patch create mode 100644 mail/dovecot/Makefile create mode 100644 mail/dovecot/files/dovecot.init create mode 100644 mail/dovecot/patches/001-configure_in.patch create mode 100644 mail/dovecot/patches/002-example_conf.patch create mode 100644 mail/fetchmail/Makefile create mode 100644 mail/imapfilter/Makefile create mode 100644 mail/imapfilter/patches/010-pathnames.patch create mode 100644 mail/mini_sendmail/Makefile create mode 100644 mail/mini_sendmail/patches/200-fullname.patch create mode 100644 mail/mini_sendmail/patches/500-flags.patch create mode 100644 mail/msmtp/Makefile create mode 100644 mail/mutt/Makefile create mode 100644 mail/mutt/patches/001-no_po_and_docs.patch create mode 100644 mail/nullmailer/Makefile create mode 100644 mail/procmail/Makefile create mode 100644 mail/procmail/patches/001-procmail_openwrt.patch create mode 100644 mail/procmail/patches/100-rename_getline.patch create mode 100644 mail/ssmtp/Makefile create mode 100644 mail/xmail/Makefile create mode 100644 mail/xmail/files/xmail.config create mode 100644 mail/xmail/files/xmail.init create mode 100644 mail/xmail/patches/010-Makefile.common.patch create mode 100644 mail/xmail/patches/020-Makefile.lnx.patch create mode 100644 mail/xmail/patches/030-sysmachine.patch create mode 100644 mail/xmail/patches/040-honour_opt_flags.patch create mode 100644 multimedia/crtmpserver/Makefile create mode 100644 multimedia/crtmpserver/patches/010-link-crypt-for-lua.patch create mode 100644 multimedia/crtmpserver/patches/020-add-rpath.patch create mode 100644 multimedia/crtmpserver/patches/030-default-config.patch create mode 100644 multimedia/crtmpserver/patches/040-use-select.patch create mode 100644 multimedia/crtmpserver/patches/050-add-missing-make-defines.patch create mode 100644 multimedia/crtmpserver/patches/060-add-dl-for-crypto.patch create mode 100644 multimedia/darkice/Makefile create mode 100644 multimedia/darkice/patches/001-upstream_svn_r494.patch create mode 100644 multimedia/ffmpeg/Config.in create mode 100644 multimedia/ffmpeg/Makefile create mode 100644 multimedia/fswebcam/Makefile create mode 100644 multimedia/ftpd-topfield/Makefile create mode 100644 multimedia/ftpd-topfield/files/ftpd-topfield.config create mode 100644 multimedia/ftpd-topfield/files/ftpd-topfield.init create mode 100644 multimedia/ftpd-topfield/patches/001-kernel_header_rename.patch create mode 100644 multimedia/gmediaserver/Makefile create mode 100644 multimedia/gmediaserver/files/gmediaserver.config create mode 100644 multimedia/gmediaserver/files/gmediaserver.init create mode 100644 multimedia/gmediaserver/patches/010-compile-fixes.patch create mode 100644 multimedia/gphoto2/Makefile create mode 100644 multimedia/gphoto2/patches/001-automake-compat.patch create mode 100644 multimedia/gphoto2/patches/002-disable-docs-translations.patch create mode 100644 multimedia/gphoto2/patches/100-gpdebug.patch create mode 100644 multimedia/graphicsmagick/Makefile create mode 100644 multimedia/gst-ffmpeg/Config.in create mode 100644 multimedia/gst-ffmpeg/Makefile create mode 100644 multimedia/gst-plugins-bad/Makefile create mode 100644 multimedia/gst-plugins-bad/patches/000-gettext.patch create mode 100644 multimedia/gst-plugins-base/Makefile create mode 100644 multimedia/gst-plugins-base/patches/001-no_docs.patch create mode 100644 multimedia/gst-plugins-base/patches/002-no_tests.patch create mode 100644 multimedia/gst-plugins-base/patches/003-no_translations.patch create mode 100644 multimedia/gst-plugins-good/Makefile create mode 100644 multimedia/gst-plugins-good/patches/001-no_docs.patch create mode 100644 multimedia/gst-plugins-good/patches/002-no_tests.patch create mode 100644 multimedia/gst-plugins-good/patches/003-no_translations.patch create mode 100644 multimedia/gst-plugins-ugly/Makefile create mode 100644 multimedia/gst-plugins-ugly/patches/001-no_docs.patch create mode 100644 multimedia/gst-plugins-ugly/patches/002-no_tests.patch create mode 100644 multimedia/gst-plugins-ugly/patches/003-no_translations.patch create mode 100644 multimedia/gstreamer/Makefile create mode 100644 multimedia/gstreamer/patches/001-no_docs.patch create mode 100644 multimedia/gstreamer/patches/002-no_tests.patch create mode 100644 multimedia/gstreamer/patches/003-no_translations.patch create mode 100644 multimedia/hasciicam/Makefile create mode 100644 multimedia/icecast/Makefile create mode 100644 multimedia/icecast/libvorbisidec.mk create mode 100644 multimedia/icecast/patches/001-icecast-2.3.0-tremor.patch create mode 100644 multimedia/icecast/patches/010-fix_libcurl_test_crap.patch create mode 100644 multimedia/imagemagick/Makefile create mode 100644 multimedia/kissdx/Makefile create mode 100644 multimedia/kissdx/files/kissdx.config create mode 100755 multimedia/kissdx/files/kissdx.init create mode 100644 multimedia/minidlna/Makefile create mode 100644 multimedia/minidlna/files/minidlna.config create mode 100644 multimedia/minidlna/files/minidlna.init create mode 100644 multimedia/minidlna/patches/010-genconfig-checks.patch create mode 100644 multimedia/minidlna/patches/020-makefile-tweaks.patch create mode 100644 multimedia/minidlna/patches/030-missing-include.patch create mode 100644 multimedia/mjpg-streamer/Makefile create mode 100644 multimedia/mjpg-streamer/files/mjpg-streamer.config create mode 100644 multimedia/mjpg-streamer/files/mjpg-streamer.hotplug create mode 100644 multimedia/mjpg-streamer/files/mjpg-streamer.init create mode 100644 multimedia/motion/Makefile create mode 100644 multimedia/motion/patches/002-honor_cppflags.patch create mode 100644 multimedia/peercast/Makefile create mode 100644 multimedia/peercast/files/peercast.ini create mode 100644 multimedia/peercast/files/peercast.init create mode 100644 multimedia/puppy/Makefile create mode 100644 multimedia/ushare/Makefile create mode 100644 multimedia/ushare/files/ushare.config create mode 100644 multimedia/ushare/files/ushare.init create mode 100644 multimedia/ushare/patches/100-configure_grep_fix.patch create mode 100644 multimedia/ushare/patches/200-compile-fixes.patch create mode 100644 net/aircrack-ng/Makefile create mode 100644 net/aircrack-ng/patches/100-add-ignore-channel-negative-1.patch create mode 100644 net/aircrack-ptw/Makefile create mode 100644 net/aircrack-ptw/patches/001-smaller.patch create mode 100644 net/airpwn/Makefile create mode 100644 net/amule/Makefile create mode 100644 net/amule/patches/001-no_backtrace.patch create mode 100644 net/amwall/Makefile create mode 100644 net/amwall/patches/010-compile_fix.patch create mode 100644 net/aodv-uu/Makefile create mode 100644 net/aodv-uu/files/aodv-uu.modules create mode 100644 net/aodv-uu/patches/001-normalize.patch create mode 100644 net/aodv-uu/patches/002-linux_2.6.19_ip_route_me_harder_change.patch create mode 100644 net/aodv-uu/patches/003-linux_2.6.19_security_netlink_recv_change.patch create mode 100644 net/aodv-uu/patches/004-linux_2.6.19_includes.patch create mode 100644 net/aodv-uu/patches/005-linux_2.6.22_skbuff.patch create mode 100644 net/aoetools/Makefile create mode 100644 net/apache/Makefile create mode 100644 net/apache/patches/001-Makefile_in.patch create mode 100644 net/apache/patches/002-test_char_h.patch create mode 100644 net/apache/patches/003-logdir_fix.patch create mode 100644 net/apache/patches/004-pidfile_fix.patch create mode 100644 net/apache/patches/005-httpd_conf.patch create mode 100644 net/apcupsd/Makefile create mode 100644 net/apcupsd/files/apccontrol create mode 100644 net/apcupsd/files/apcupsd.conf create mode 100644 net/apcupsd/files/apcupsd.init create mode 100644 net/apcupsd/files/apcupsd_mail.conf create mode 100644 net/apcupsd/files/changeme create mode 100644 net/apcupsd/files/commfailure create mode 100644 net/apcupsd/files/commok create mode 100644 net/apcupsd/files/offbattery create mode 100644 net/apcupsd/files/onbattery create mode 100644 net/apcupsd/patches/010-fix-include-paths.patch create mode 100644 net/apf/Makefile create mode 100644 net/appweb/Makefile create mode 100644 net/appweb/patches/001-add-ipv6-in-configure.patch create mode 100644 net/aprx/Makefile create mode 100644 net/aprx/files/aprx.init create mode 100644 net/aprx/patches/100-Makefile_in.patch create mode 100644 net/aria2/Makefile create mode 100644 net/arpd/Makefile create mode 100644 net/arpd/patches/001-configure_no_bpf.patch create mode 100644 net/arpd/patches/002-function_string.patch create mode 100644 net/arpd/patches/003-pcap_and_arg.patch create mode 100644 net/arpd/patches/004-no_dnet_config_check.patch create mode 100644 net/arpd/patches/005-remove-dropped-libevent-features.patch create mode 100644 net/arpwatch/Makefile create mode 100644 net/arpwatch/files/arpwatch.init create mode 100644 net/asterisk-1.8.x/Makefile create mode 100644 net/asterisk-1.8.x/files/asterisk.default create mode 100644 net/asterisk-1.8.x/files/asterisk.init create mode 100644 net/asterisk-1.8.x/patches/100-build_tools-iconv.patch create mode 100644 net/asterisk-1.8.x/patches/200-addons-defaultenable.patch create mode 100644 net/asterisk-1.8.x/patches/500-nres.patch create mode 100644 net/asterisk-1.8.x/patches/600-CVE-2012-2186.patch create mode 100644 net/asterisk-1.8.x/src-lantiq/channels/chan_lantiq.c create mode 100644 net/asterisk-1.8.x/src-lantiq/configs/lantiq.conf.sample create mode 100644 net/asterisk-chan-sccp-b/Makefile create mode 100644 net/asterisk-chan-sccp-b/files/sccp.openwrt.conf create mode 100644 net/asterisk-chan-sccp-b/patches/200-register-file-version.patch create mode 100644 net/asterisk-chan-sccp-b/patches/300-stdarg.patch create mode 100644 net/atftp/Makefile create mode 100644 net/atftp/patches/100-mconfig.patch create mode 100644 net/atftp/patches/110-services.patch create mode 100644 net/atftp/patches/120-retry_setting.patch create mode 100644 net/atftp/patches/130-missing_include.patch create mode 100644 net/autossh/Makefile create mode 100644 net/autossh/files/autossh.config create mode 100644 net/autossh/files/autossh.hotplug create mode 100644 net/autossh/files/autossh.init create mode 100644 net/axel/Makefile create mode 100644 net/babel/Makefile create mode 100644 net/babel/files/babeld.conf create mode 100644 net/babel/files/babeld.config create mode 100755 net/babel/files/babeld.init create mode 100644 net/bahamut/Makefile create mode 100644 net/bahamut/patches/001-cross_compile.patch create mode 100644 net/bahamut/patches/002-glibc_fix.patch create mode 100644 net/bahamut/patches/010-dont-use-host-zlib.patch create mode 100644 net/baresip/Makefile create mode 100644 net/baresip/files/baresip.init create mode 100644 net/baresip/patches/100-videodev-compat.patch create mode 100644 net/batman-adv/Config.in create mode 100644 net/batman-adv/Makefile create mode 100644 net/batman-adv/files/etc/config/batman-adv create mode 100644 net/batman-adv/files/etc/hotplug.d/net/99-batman-adv create mode 100644 net/batman-adv/files/lib/batman-adv/config.sh create mode 100644 net/batman-adv/files/usr/sbin/batman-adv create mode 100644 net/batman-adv/patches/0001-batman-adv-make-batadv_test_bit-return-0-or-1-only.patch create mode 100644 net/batman-adv/patches/0002-batman-adv-Fix-change-mac-address-of-soft-iface.patch create mode 100644 net/batman-adv/patches/0003-batman-adv-Fix-symmetry-check-route-flapping-in-mult.patch create mode 100644 net/batman/Makefile create mode 100644 net/batman/files/etc/config/batmand create mode 100644 net/batman/files/etc/config/vis create mode 100644 net/batman/files/etc/init.d/batmand create mode 100644 net/batman/files/etc/init.d/vis create mode 100644 net/batman/patches/100-2.6.36.patch create mode 100644 net/bind/Makefile create mode 100644 net/bind/files/bind/db.0 create mode 100644 net/bind/files/bind/db.127 create mode 100644 net/bind/files/bind/db.255 create mode 100644 net/bind/files/bind/db.local create mode 100644 net/bind/files/bind/db.root create mode 100644 net/bind/files/bind/named.conf.example create mode 100644 net/bind/files/named.init create mode 100644 net/bind/patches/001-no-tests.patch create mode 100644 net/bing/Makefile create mode 100644 net/bird/Makefile create mode 100644 net/bird/files/bird4.conf create mode 100644 net/bird/files/bird4.init create mode 100644 net/bird/files/bird4loop create mode 100644 net/bird/files/bird6.conf create mode 100644 net/bird/files/bird6.init create mode 100644 net/bird/files/bird6loop create mode 100644 net/bird/patches/0001-change_config_name.patch create mode 100644 net/bitchx/Makefile create mode 100644 net/bitchx/files/bitchxrc create mode 100644 net/bitchx/files/bitchxrc.init create mode 100644 net/bitchx/patches/001-fix_declarations.patch create mode 100644 net/bitchx/patches/002-tparm.patch create mode 100644 net/bitlbee/Makefile create mode 100644 net/bitlbee/files/bitlbee.init create mode 100644 net/bitlbee/patches/100-cross_compile_configure_fix create mode 100644 net/bmon/Makefile create mode 100644 net/bmon/patches/001-bugfixes.patch create mode 100644 net/bmx6/Makefile create mode 100644 net/bmx6/files/etc/config/bmx6 create mode 100644 net/bmx6/files/etc/init.d/bmx6 create mode 100644 net/bmxd/Makefile create mode 100644 net/bmxd/files/etc/config/bmxd create mode 100644 net/bmxd/files/etc/init.d/bmxd create mode 100644 net/btpd/Makefile create mode 100644 net/btpd/files/btpd.config create mode 100644 net/btpd/files/btpd.init create mode 100644 net/btpd/patches/000-sha1.diff create mode 100644 net/btpd/patches/001-gettime.patch create mode 100644 net/btpd/patches/002-config.h.patch create mode 100644 net/btpd/patches/100-clock.diff create mode 100644 net/bwm/Makefile create mode 100644 net/bwm/patches/001-debian.patch create mode 100644 net/bwping/Makefile create mode 100644 net/cbtt/Makefile create mode 100644 net/cbtt/patches/100-compile.patch create mode 100644 net/cdp/Makefile create mode 100644 net/cdp/patches/001-compile_fixes.patch create mode 100644 net/chaosvpn/Makefile create mode 100644 net/chaosvpn/files/chaosvpn.hotplug create mode 100644 net/chaosvpn/files/chaosvpn.init create mode 100644 net/chaosvpn/files/chaosvpn_config.sh create mode 100644 net/chaosvpn/patches/001-dist-makefile.patch create mode 100644 net/chillispot/Makefile create mode 100644 net/chillispot/files/chillispot.init create mode 100644 net/chillispot/patches/001-endian_fix.patch create mode 100644 net/chillispot/patches/102-less_memory-footprint.patch create mode 100644 net/chillispot/patches/110-macallowed_fix.patch create mode 100644 net/chillispot/patches/120-fix_bufferoverflow.patch create mode 100644 net/chillispot/patches/150-chillispot-rmtctrl.patch create mode 100644 net/chillispot/patches/200-gcc_fix.patch create mode 100644 net/chrony/Makefile create mode 100644 net/chrony/files/chrony.conf create mode 100644 net/chrony/files/chrony.keys create mode 100644 net/chrony/files/ntpd.config create mode 100644 net/chrony/files/ntpd.hotplug create mode 100644 net/chrony/files/ntpd.init create mode 100644 net/chrony/patches/001-crosscompile.patch create mode 100644 net/chrony/patches/002-ipv6_disabled_fixes.patch create mode 100644 net/cifs-utils/Makefile create mode 100644 net/click/Makefile create mode 100644 net/click/files/roofnet.init create mode 100644 net/click/patches/100-compile_fix.patch create mode 100644 net/click/patches/110-multithread_fix.patch create mode 100644 net/cmdftp/Makefile create mode 100644 net/conntrack-tools/Makefile create mode 100644 net/coova-chilli/Makefile create mode 100644 net/corkscrew/Makefile create mode 100644 net/crowdcontrol/Makefile create mode 100644 net/ctorrent/Makefile create mode 100644 net/ctorrent/patches/100-CVE-2009-1759.patch create mode 100644 net/cups-bjnp/Makefile create mode 100644 net/cups/Makefile create mode 100644 net/cups/files/cupsd.init create mode 100644 net/cups/files/etc/cups/classes.conf create mode 100644 net/cups/files/etc/cups/client.conf create mode 100644 net/cups/files/etc/cups/cupsd.conf create mode 100644 net/cups/files/etc/cups/printers.conf create mode 100644 net/cups/patches/100-makefile-targets.patch create mode 100644 net/cups/patches/140-uname.patch create mode 100644 net/cups/patches/150-64bit_host_fix.patch create mode 100644 net/cups/patches/160-ppdc.patch create mode 100644 net/curlftpfs/Makefile create mode 100644 net/curlftpfs/patches/001-uclibc_mod.patch create mode 100644 net/cutter/Makefile create mode 100644 net/daemonlogger/Makefile create mode 100644 net/dansguardian/Makefile create mode 100644 net/dansguardian/patches/001-include_dir.patch create mode 100644 net/dante/Makefile create mode 100644 net/dante/patches/001-automake-compat.patch create mode 100644 net/dante/patches/100-do-not-use-defdname.patch create mode 100644 net/dante/patches/200-fix-RTLD_NEXT.patch create mode 100644 net/darkstat/Makefile create mode 100644 net/darkstat/files/darkstat.config create mode 100644 net/darkstat/files/darkstat.init create mode 100644 net/ddns-scripts/Makefile create mode 100644 net/ddns-scripts/files/etc/config/ddns create mode 100644 net/ddns-scripts/files/etc/hotplug.d/iface/25-ddns create mode 100644 net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh create mode 100755 net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh create mode 100644 net/ddns-scripts/files/usr/lib/ddns/services create mode 100644 net/ddns-scripts/files/usr/lib/ddns/url_escape.sed create mode 100644 net/deluge/Makefile create mode 100644 net/deluge/files/deluge.config create mode 100644 net/deluge/files/deluge.init create mode 100644 net/dhcp-forwarder/Makefile create mode 100644 net/dhcp-forwarder/files/dhcp-fwd.init create mode 100644 net/dhcpcd/Makefile create mode 100644 net/dhcpcd/patches/001-run_dir.patch create mode 100644 net/dircproxy/Makefile create mode 100644 net/ditg/Makefile create mode 100644 net/djbdns/Changelog create mode 100644 net/djbdns/Makefile create mode 100644 net/djbdns/README create mode 100644 net/djbdns/files/axfrdns.init create mode 100644 net/djbdns/files/axfrdns/tcp create mode 100644 net/djbdns/files/djbdns.conf create mode 100644 net/djbdns/files/dnscache.init create mode 100644 net/djbdns/files/dnscache/dnsroots.global create mode 100644 net/djbdns/files/dnscache/ignoreip-update create mode 100644 net/djbdns/files/dnscache/servers/@ create mode 100644 net/djbdns/files/dnsqrx create mode 100644 net/djbdns/files/dnsroots-update create mode 100644 net/djbdns/files/rbldns.init create mode 100644 net/djbdns/files/rbldns/data create mode 100644 net/djbdns/files/tinydns.init create mode 100644 net/djbdns/files/tinydns/add-alias create mode 100644 net/djbdns/files/tinydns/add-childns create mode 100644 net/djbdns/files/tinydns/add-host create mode 100644 net/djbdns/files/tinydns/add-mx create mode 100644 net/djbdns/files/tinydns/add-ns create mode 100644 net/djbdns/files/tinydns/data create mode 100644 net/djbdns/files/walldns.init create mode 100644 net/djbdns/patches/010-crosscompile.patch create mode 100644 net/djbdns/patches/020-dnsroots-update.patch create mode 100644 net/djbdns/patches/030-srv-records-and-axfrget.patch create mode 100644 net/djbdns/patches/040-dnscache-less-chatty-log.patch create mode 100644 net/djbdns/patches/050-tinydns-mmap-leak.patch create mode 100644 net/djbdns/patches/060-dnscache-big-udp-packets.patch create mode 100644 net/djbdns/patches/070-dnscache-dpos-tcp-servfail.patch create mode 100644 net/djbdns/patches/080-dnscache-cache-negatives.patch create mode 100644 net/djbdns/patches/090-tinydns-one-second.patch create mode 100644 net/djbdns/patches/110-dnscache-cachestats.patch create mode 100644 net/djbdns/patches/120-compiler-temporary-filename.patch create mode 100644 net/djbdns/patches/140-dnsnamex-extra-command.patch create mode 100644 net/djbdns/patches/200-dnscache-cname-handling.patch create mode 100644 net/djbdns/patches/210-dnscache-strict-forwardonly.patch create mode 100644 net/djbdns/patches/220-dnscacheip-space-separator.patch create mode 100644 net/djbdns/patches/230-tinydns-data-semantic-error.patch create mode 100644 net/djbdns/patches/240-tinydns-alias-chain-truncation.patch create mode 100644 net/djbdns/patches/250-dnscache-slogging.patch create mode 100644 net/djbdns/patches/260-dnsfilter-replace.patch create mode 100644 net/djbdns/patches/270-dnscache-sigpipe-fix.patch create mode 100644 net/djbdns/patches/280-dnscache-ignoreip2.patch create mode 100644 net/djbdns/patches/300-bugfix-dnscache-dempsky-poison.patch create mode 100644 net/djbdns/patches/310-bugfix-dnscache-merge-outgoing-requests.patch create mode 100644 net/djbdns/patches/320-bugfix-dnscache-cache-soa-records.patch create mode 100644 net/dmapd/Makefile create mode 100644 net/dmapd/files/dmapd.init create mode 100644 net/dmapd/patches/001-dmapd_conf.patch create mode 100644 net/dns2tcp/Makefile create mode 100644 net/dsl-qos-queue/Makefile create mode 100644 net/dsl-qos-queue/patches/001-cross_compile.patch create mode 100644 net/dsl-qos-queue/patches/002-include.patch create mode 100644 net/dsl-qos-queue/patches/010-ports_fix.patch create mode 100644 net/dsl-qos-queue/patches/020-fix_shebang_line.patch create mode 100644 net/dsniff/Makefile create mode 100644 net/dsniff/patches/001-arpspoof_fix.patch create mode 100644 net/dsniff/patches/001-decode_pop.patch create mode 100644 net/dsniff/patches/001-dns.patch create mode 100644 net/dsniff/patches/003-gdbm.patch create mode 100644 net/dsniff/patches/004-no_yp.patch create mode 100644 net/dsniff/patches/005-openssl_fix.patch create mode 100644 net/dsniff/patches/006-pcap_header.patch create mode 100644 net/dsniff/patches/007-time_h.patch create mode 100644 net/dsniff/patches/008-md5_include.patch create mode 100644 net/dsniff/patches/010-clk-tck-fix.patch create mode 100644 net/dudders/Makefile create mode 100644 net/dudders/files/dudders.config create mode 100644 net/dudders/files/dudders.hotplug create mode 100644 net/e169-stats/Makefile create mode 100644 net/e169-stats/patches/01-make.patch create mode 100644 net/ekg/Makefile create mode 100644 net/ekg/patches/100-compile-fixes.patch create mode 100644 net/elinks/Makefile create mode 100644 net/elinks/patches/002-fix_avr32_compile create mode 100644 net/etherpuppet/Makefile create mode 100644 net/etherwake/Makefile create mode 100644 net/etherwake/files/etherwake.config create mode 100644 net/etherwake/files/etherwake.init create mode 100644 net/etherwake/patches/100-no_ether_hostton.patch create mode 100644 net/ethtool/Makefile create mode 100644 net/ethtool/patches/100-ixp4xx.patch create mode 100644 net/ettercap/Makefile create mode 100644 net/ettercap/patches/001-cross_compiling.patch create mode 100644 net/ettercap/patches/002-libnet_check_honor_ldflags.patch create mode 100644 net/ettercap/patches/003-automake-compat.patch create mode 100644 net/ez-ipupdate/Makefile create mode 100644 net/ez-ipupdate/files/ez-ipupdate.config create mode 100644 net/ez-ipupdate/files/ez-ipupdate.hotplug create mode 100644 net/ez-ipupdate/files/ez-ipupdate.init create mode 100644 net/ez-ipupdate/patches/001-debian_subset.patch create mode 100644 net/ez-ipupdate/patches/002-ez_ipupdate_everydns.patch create mode 100644 net/ez-ipupdate/patches/003-dnsexit.patch create mode 100644 net/ez-ipupdate/patches/004-zoneedit.patch create mode 100644 net/faifa/Makefile create mode 100644 net/fakeidentd/Makefile create mode 100644 net/fakeidentd/files/fakeidentd.init create mode 100644 net/flow-tools/Makefile create mode 100644 net/flow-tools/patches/001-cross_compile_configure_fix.patch create mode 100644 net/flow-tools/patches/002-flex_lib.patch create mode 100644 net/flow-tools/patches/010-python_script_location_fix.patch create mode 100644 net/flow-tools/patches/020-invalid_lvalue_in_assignment.patch create mode 100644 net/flow-tools/patches/030-avoid_external_debug_var.patch create mode 100644 net/flow-tools/patches/050-fix-64bit_temp_time_t.patch create mode 100644 net/flow-tools/patches/060-fix_uninitialized_var_in_flow_send.patch create mode 100644 net/flow-tools/patches/070-extra_ftpdu_verify_debugging.patch create mode 100644 net/flow-tools/patches/080-fix_uninitialized_var_in_flow_export.patch create mode 100644 net/fping/Makefile create mode 100644 net/fping/patches/001-debian.patch create mode 100644 net/fprobe-ulog/Makefile create mode 100644 net/fprobe/Makefile create mode 100644 net/freepops/Makefile create mode 100644 net/freeradius2/Makefile create mode 100644 net/freeradius2/files/radiusd.init create mode 100644 net/freeradius2/patches/001-fix-makefile.patch create mode 100644 net/freeradius2/patches/002-config.patch create mode 100644 net/freeradius2/patches/004-ldap_configure.patch create mode 100644 net/freeradius2/patches/008-honor_ccpflags.patch create mode 100644 net/freeswitch/Makefile create mode 100644 net/freeswitch/files/etc.minimal/autoload_configs/acl.conf.xml create mode 100644 net/freeswitch/files/etc.minimal/autoload_configs/callcenter.conf.xml create mode 100644 net/freeswitch/files/etc.minimal/autoload_configs/console.conf.xml create mode 100644 net/freeswitch/files/etc.minimal/autoload_configs/dingaling.conf.xml create mode 100644 net/freeswitch/files/etc.minimal/autoload_configs/event_socket.conf.xml create mode 100644 net/freeswitch/files/etc.minimal/autoload_configs/local_stream.conf.xml create mode 100644 net/freeswitch/files/etc.minimal/autoload_configs/lua.conf.xml create mode 100644 net/freeswitch/files/etc.minimal/autoload_configs/modules.conf.xml create mode 100644 net/freeswitch/files/etc.minimal/autoload_configs/post_load_modules.conf.xml create mode 100644 net/freeswitch/files/etc.minimal/autoload_configs/sofia.conf.xml create mode 100644 net/freeswitch/files/etc.minimal/autoload_configs/spandsp.conf.xml create mode 100644 net/freeswitch/files/etc.minimal/autoload_configs/switch.conf.xml create mode 100644 net/freeswitch/files/etc.minimal/autoload_configs/timezones.conf.xml create mode 100644 net/freeswitch/files/etc.minimal/dialplan/default.xml create mode 100644 net/freeswitch/files/etc.minimal/dialplan/default/PLACEHOLDER create mode 100644 net/freeswitch/files/etc.minimal/dialplan/public.xml create mode 100644 net/freeswitch/files/etc.minimal/dialplan/public/PLACEHOLDER create mode 100644 net/freeswitch/files/etc.minimal/directory/default.xml create mode 100644 net/freeswitch/files/etc.minimal/directory/default/1000.xml create mode 100644 net/freeswitch/files/etc.minimal/directory/default/1001.xml create mode 100644 net/freeswitch/files/etc.minimal/directory/default/1002.xml create mode 100644 net/freeswitch/files/etc.minimal/directory/default/1003.xml create mode 100644 net/freeswitch/files/etc.minimal/directory/default/1004.xml create mode 100644 net/freeswitch/files/etc.minimal/directory/default/default.xml create mode 100644 net/freeswitch/files/etc.minimal/freeswitch.xml create mode 100644 net/freeswitch/files/etc.minimal/fur_elise.ttml create mode 100644 net/freeswitch/files/etc.minimal/jingle_profiles/client.xml create mode 100644 net/freeswitch/files/etc.minimal/jingle_profiles/server.xml create mode 100644 net/freeswitch/files/etc.minimal/mime.types create mode 100644 net/freeswitch/files/etc.minimal/sip_profiles/external.xml create mode 100644 net/freeswitch/files/etc.minimal/sip_profiles/external/example.xml create mode 100644 net/freeswitch/files/etc.minimal/sip_profiles/internal.xml create mode 100644 net/freeswitch/files/etc.minimal/sip_profiles/internal/example.xml create mode 100644 net/freeswitch/files/etc.minimal/tetris.ttml create mode 100644 net/freeswitch/files/etc.minimal/tones.conf create mode 100644 net/freeswitch/files/etc.minimal/vars.xml create mode 100644 net/freeswitch/files/etc.packages/blacklist/autoload_configs/blacklist.conf.xml create mode 100644 net/freeswitch/files/etc.packages/blacklist/blacklists/blocked.list create mode 100644 net/freeswitch/files/etc.packages/cdr_csv/autoload_configs/cdr_csv.conf.xml create mode 100644 net/freeswitch/files/etc.packages/cdr_pg_csv/autoload_configs/cdr_pg_csv.conf.xml create mode 100644 net/freeswitch/files/etc.packages/event_multicast/autoload_configs/event_multicast.conf.xml create mode 100644 net/freeswitch/files/etc.packages/http_cache/autoload_configs/http_cache.conf.xml create mode 100644 net/freeswitch/files/etc.packages/logfile/autoload_configs/logfile.conf.xml create mode 100644 net/freeswitch/files/etc.packages/pocketsphinx/autoload_configs/pocketsphinx.conf.xml create mode 100644 net/freeswitch/files/etc.packages/rtmp/autoload_configs/rtmp.conf.xml create mode 100644 net/freeswitch/files/etc.packages/say-de/lang/de/de.xml create mode 100644 net/freeswitch/files/etc.packages/say-de/lang/de/demo/demo.xml create mode 100644 net/freeswitch/files/etc.packages/say-de/lang/de/vm/tts.xml create mode 100644 net/freeswitch/files/etc.packages/say-en/lang/en/demo/demo-ivr.xml create mode 100644 net/freeswitch/files/etc.packages/say-en/lang/en/demo/demo.xml create mode 100644 net/freeswitch/files/etc.packages/say-en/lang/en/dir/sounds.xml create mode 100644 net/freeswitch/files/etc.packages/say-en/lang/en/dir/tts.xml create mode 100644 net/freeswitch/files/etc.packages/say-en/lang/en/en.xml create mode 100644 net/freeswitch/files/etc.packages/say-en/lang/en/ivr/sounds.xml create mode 100644 net/freeswitch/files/etc.packages/say-en/lang/en/vm/sounds.xml create mode 100644 net/freeswitch/files/etc.packages/say-en/lang/en/vm/tts.xml create mode 100644 net/freeswitch/files/etc.packages/say-fr/lang/fr/demo/demo.xml create mode 100644 net/freeswitch/files/etc.packages/say-fr/lang/fr/dir/sounds.xml create mode 100644 net/freeswitch/files/etc.packages/say-fr/lang/fr/dir/tts.xml create mode 100644 net/freeswitch/files/etc.packages/say-fr/lang/fr/fr.xml create mode 100644 net/freeswitch/files/etc.packages/say-fr/lang/fr/vm/sounds.xml create mode 100644 net/freeswitch/files/etc.packages/say-he/lang/he/demo/demo-ivr.xml create mode 100644 net/freeswitch/files/etc.packages/say-he/lang/he/demo/demo.xml create mode 100644 net/freeswitch/files/etc.packages/say-he/lang/he/dir/sounds.xml create mode 100644 net/freeswitch/files/etc.packages/say-he/lang/he/he.xml create mode 100644 net/freeswitch/files/etc.packages/say-he/lang/he/vm/sounds.xml create mode 100644 net/freeswitch/files/etc.packages/say-ru/lang/ru/demo/demo-ivr.xml create mode 100644 net/freeswitch/files/etc.packages/say-ru/lang/ru/demo/demo.xml create mode 100644 net/freeswitch/files/etc.packages/say-ru/lang/ru/dir/sounds.xml create mode 100644 net/freeswitch/files/etc.packages/say-ru/lang/ru/dir/tts.xml create mode 100644 net/freeswitch/files/etc.packages/say-ru/lang/ru/ru.xml create mode 100644 net/freeswitch/files/etc.packages/say-ru/lang/ru/vm/sounds.xml create mode 100644 net/freeswitch/files/etc.packages/say-ru/lang/ru/vm/tts.xml create mode 100644 net/freeswitch/files/etc.packages/sms/chatplan/default.xml create mode 100644 net/freeswitch/files/etc.packages/syslog/autoload_configs/syslog.conf.xml create mode 100644 net/freeswitch/files/etc.packages/tts_commandline/autoload_configs/tts_commandline.conf.xml create mode 100644 net/freeswitch/files/etc.packages/unimrcp/autoload_configs/unimrcp.conf.xml create mode 100644 net/freeswitch/files/etc.packages/voicemail/autoload_configs/voicemail.conf.xml create mode 100644 net/freeswitch/files/etc.packages/xml-cdr/autoload_configs/xml_cdr.conf.xml create mode 100644 net/freeswitch/files/freeswitch.config create mode 100644 net/freeswitch/files/freeswitch.default create mode 100644 net/freeswitch/files/freeswitch.hotplug create mode 100644 net/freeswitch/files/freeswitch.init create mode 100644 net/freeswitch/patches/000-build-openwrt_rules.mk.patch create mode 100644 net/freeswitch/patches/001-build-modules_conf_in.patch create mode 100644 net/freeswitch/patches/002-Makefile.am.patch create mode 100644 net/freeswitch/patches/003-libs-esl-Makefile.patch create mode 100644 net/freeswitch/patches/004-src-mod-applications-mod_mp4-mp4_helper_hpp.patch create mode 100644 net/freeswitch/patches/005-src-mod-codecs-mod_opus-Makefile.patch create mode 100644 net/freeswitch/patches/006-src-include-timerfd_wrap_h.patch create mode 100644 net/freeswitch/patches/007-src-mod-endpoints-mod_gsmopen-Makefile.patch create mode 100644 net/freeswitch/patches/008-src-mod-event_handlers-mod_snmp-Makefile.patch create mode 100644 net/freeswitch/patches/009-src-mod-codecs-mod_silk-Makefile.patch create mode 100644 net/freeswitch/patches/010-ppc_asm.patch create mode 100644 net/frickin/Makefile create mode 100644 net/frickin/files/frickin.config create mode 100644 net/frickin/files/frickin.init create mode 100644 net/fwknop/Makefile create mode 100644 net/fwknop/patches/001-fix_config.patch create mode 100644 net/fwknop/patches/002-fix_init.patch create mode 100644 net/gatling/Makefile create mode 100644 net/gatling/patches/001-fix_ld_libs.patch create mode 100644 net/gatling/patches/002-fix_flags.patch create mode 100644 net/gatling/patches/010-add_semicolon.patch create mode 100644 net/gesftpserver/Makefile create mode 100644 net/git/Makefile create mode 100644 net/git/patches/100-convert_builtin.patch create mode 100644 net/gpsd/Makefile create mode 100644 net/gpsd/files/gpsd.config create mode 100644 net/gpsd/files/gpsd.hotplug create mode 100644 net/gpsd/files/gpsd.init create mode 100644 net/haproxy/Makefile create mode 100644 net/haproxy/files/haproxy.cfg create mode 100644 net/haproxy/files/haproxy.hotplug create mode 100644 net/haproxy/files/haproxy.init create mode 100644 net/haproxy/patches/001-haproxy-1.4.x-sendproxy.patch create mode 100644 net/hiawatha/Makefile create mode 100644 net/horst/Makefile create mode 100644 net/horst/patches/100-compile-fixes.patch create mode 100644 net/hping3/Makefile create mode 100644 net/hping3/patches/100-makefile.patch create mode 100644 net/hping3/patches/101-endianness.patch create mode 100644 net/hping3/patches/102-lib_rename.patch create mode 100644 net/hsflowd/Makefile create mode 100644 net/hsflowd/files/hsflowd.config create mode 100644 net/hsflowd/files/hsflowd.init create mode 100644 net/hsflowd/files/sflowovsd.init create mode 100644 net/hsflowd/patches/100-crosscompile.patch create mode 100644 net/hsflowd/patches/200-uclibc-compat.patch create mode 100644 net/hsflowd/patches/300-config_files_path.patch create mode 100644 net/hsflowd/patches/400-sflowovsd_assert.patch create mode 100644 net/htpdate/Makefile create mode 100644 net/htpdate/files/htpdate.default create mode 100644 net/htpdate/files/htpdate.init create mode 100644 net/htpdate/patches/100-adjtimex.patch create mode 100644 net/httping/Makefile create mode 100644 net/httping/patches/002-version.patch create mode 100644 net/httptunnel/Makefile create mode 100644 net/httptunnel/files/httptunnel.config create mode 100644 net/httptunnel/files/httptunnel.init create mode 100644 net/icmptx/Makefile create mode 100644 net/icmptx/patches/001-cross_compile.patch create mode 100644 net/ifstat/Makefile create mode 100644 net/ifstat/patches/001-configure_cross.patch create mode 100644 net/iftop/Makefile create mode 100644 net/iftop/patches/001-debian_armeb.patch create mode 100644 net/iftop/patches/002-debian_frozen_order.patch create mode 100644 net/iftop/patches/003-debian_arm.patch create mode 100644 net/iftop/patches/004-debian_bar_display.patch create mode 100644 net/iftop/patches/005-debian_bar_bytes.patch create mode 100644 net/igmpproxy/Makefile create mode 100644 net/igmpproxy/files/igmpproxy.config create mode 100644 net/igmpproxy/files/igmpproxy.init create mode 100644 net/igmpproxy/patches/001-Send-IGMP-packets-with-IP-Router-Alert-option-RFC-21.patch create mode 100644 net/igmpproxy/patches/002-Change-default-interface-state-to-disabled-wrt-29458.patch create mode 100644 net/igmpproxy/patches/003-Restrict-igmp-reports-for-downstream-interfaces-wrt-.patch create mode 100644 net/igmpproxy/patches/004-Restrict-igmp-reports-forwarding-to-upstream-interfa.patch create mode 100644 net/igmpproxy/patches/100-use-monotic-clock-instead-of-time-of-day.patch create mode 100644 net/imsnif/Makefile create mode 100755 net/imsnif/files/imsnif create mode 100644 net/imsnif/patches/001-openwrt_paths.patch create mode 100644 net/imspector/Makefile create mode 100644 net/imspector/files/imspector.config create mode 100644 net/imspector/files/imspector.init create mode 100644 net/imspector/patches/010-openssl-1.0.0-compat.patch create mode 100644 net/iodine/Makefile create mode 100644 net/iodine/files/iodined.config create mode 100644 net/iodine/files/iodined.init create mode 100644 net/iodine/patches/010-cross-compile.patch create mode 100644 net/ipcad/Makefile create mode 100644 net/ipcad/patches/001-honor_cppflags.patch create mode 100644 net/ipcad/patches/010-no-host-includes.patch create mode 100644 net/iperf/Makefile create mode 100644 net/iperf/patches/001-set-report-next-time-in-single-thread-mode.patch create mode 100644 net/ipkungfu/Makefile create mode 100644 net/ipkungfu/patches/001-replace-modprobe-with-insmod.patch create mode 100644 net/ipsec-tools/Makefile create mode 100644 net/ipsec-tools/files/racoon.init create mode 100644 net/ipsec-tools/patches/001-ipsec-tools-def-psk.patch create mode 100644 net/ipsec-tools/patches/001-no_libfl.patch create mode 100644 net/ipsec-tools/patches/002-patch8-utmp.patch create mode 100644 net/ipsec-tools/patches/003-microsoft-fqdn-in-main.patch create mode 100644 net/ipsec-tools/patches/005-isakmp-fix.patch create mode 100644 net/ipset/Makefile create mode 100644 net/ipset/patches/100-export.h.patch create mode 100644 net/ipset/patches/200-remove-ipv6_addr_copy.patch create mode 100644 net/ipset/patches/210-fix-ipv6_skip_exthdr.patch create mode 100644 net/iptables-snmp/Makefile create mode 100644 net/iptables-snmp/patches/001-use_libiptc.patch create mode 100644 net/iptraf/Makefile create mode 100644 net/iptraf/patches/001-cross_compile.patch create mode 100644 net/iptraf/patches/002-ifaces.patch create mode 100644 net/iptraf/patches/003-exit_menu.patch create mode 100644 net/iptraf/patches/004-includes_fix.patch create mode 100644 net/iptraf/patches/005-atheros.patch create mode 100644 net/iptraf/patches/005-no_size_cmd.patch create mode 100644 net/ipupdate/Makefile create mode 100644 net/ipupdate/patches/100-name_conflict.patch create mode 100644 net/ipupdate/patches/200-byteorder.patch create mode 100644 net/iputils/Makefile create mode 100644 net/iputils/patches/001-iputils.patch create mode 100644 net/iputils/patches/002-fix-ipv6.patch create mode 100644 net/iputils/patches/003-fix-makefile.patch create mode 100644 net/iputils/patches/010-ping6_uclibc_resolv.patch create mode 100644 net/iputils/patches/011-ping6_use_gnu_source.patch create mode 100644 net/irssi-glib1/Makefile create mode 100644 net/irssi-glib1/patches/100-cross_compiling_fix.patch create mode 100644 net/irssi/Makefile create mode 100644 net/isakmpd/Makefile create mode 100644 net/isakmpd/patches/010-debian_3.patch create mode 100644 net/isakmpd/patches/020-standardize.patch create mode 100644 net/isakmpd/patches/030-openssl_hashes.patch create mode 100644 net/isakmpd/patches/040-security_fix.patch create mode 100644 net/isakmpd/patches/050-ar_cross.patch create mode 100644 net/isc-dhcp/Makefile create mode 100644 net/isc-dhcp/files/dhclient-script create mode 100644 net/isc-dhcp/files/dhclient.init create mode 100644 net/isc-dhcp/files/dhclient6.conf create mode 100644 net/isc-dhcp/files/dhclient6.init create mode 100644 net/isc-dhcp/files/dhcpd.conf create mode 100644 net/isc-dhcp/files/dhcpd.init create mode 100644 net/isc-dhcp/files/dhcpd6.conf create mode 100644 net/isc-dhcp/files/dhcpd6.init create mode 100644 net/isc-dhcp/patches/000-compile.patch create mode 100644 net/jtg/Makefile create mode 100644 net/kamailio/Makefile create mode 100644 net/kamailio/files/kamailio.default create mode 100755 net/kamailio/files/kamailio.init create mode 100644 net/kamailio/patches/005-config_h.patch create mode 100644 net/kamailio/patches/007-modules_build.patch create mode 100644 net/kamailio3/Makefile create mode 100644 net/kamailio3/files/kamailio.default create mode 100644 net/kamailio3/files/kamailio.init create mode 100644 net/kamailio3/patches/100-cross_compile.patch create mode 100644 net/karma/Makefile create mode 100644 net/keepalived/Makefile create mode 100644 net/keepalived/files/keepalived.init create mode 100644 net/kismet/Makefile create mode 100644 net/kismet/files/ap_manuf create mode 100644 net/kismet/files/client_manuf create mode 100644 net/kismet/files/kismet.conf create mode 100644 net/kismet/files/kismet_drone.conf create mode 100644 net/kismet/files/kismet_ui.conf create mode 100644 net/kismet/patches/010-dont-add-host-include-paths.patch create mode 100644 net/knock/Makefile create mode 100644 net/knock/patches/010_eglibc_define_PATH_MAX.patch create mode 100644 net/krb5/Makefile create mode 100644 net/krb5/files/krb5kdc create mode 100644 net/krb5/patches/001-krb5kdc-dir-to-etc.patch create mode 100644 net/krb5/patches/002-MITKRB5-SA-2011-002.patch create mode 100644 net/l2tpd/Makefile create mode 100644 net/l2tpd/files/l2tpd.conf create mode 100644 net/l2tpd/files/l2tpd.init create mode 100644 net/l2tpd/files/options.l2tpd create mode 100644 net/l2tpd/patches/001-debian-2.patch create mode 100644 net/l2tpd/patches/002-debian-2-pty-rev.patch create mode 100644 net/l2tpd/patches/003-jacco-pty.patch create mode 100644 net/l2tpd/patches/004-gcc4.patch create mode 100644 net/l2tpd/patches/004-nonblock.patch create mode 100644 net/l2tpd/patches/005-df-disable.patch create mode 100644 net/l2tpns/Makefile create mode 100644 net/l2tpns/patches/001-honor_includes_no_fifo_scheduler.patch create mode 100644 net/l2tpv3tun/Makefile create mode 100644 net/l2tpv3tun/files/l2tp.sh create mode 100644 net/l2tpv3tun/patches/010-custom_ifname.patch create mode 100644 net/l2tpv3tun/patches/100-nl_handle_alloc.patch create mode 100644 net/l7-protocols/Makefile create mode 100644 net/l7-protocols/patches/100-testing_crosscompile.patch create mode 100644 net/l7-protocols/patches/101-testing-timeit.patch create mode 100644 net/l7-protocols/patches/102-testing-doallspeeds.patch create mode 100644 net/leafnode/Makefile create mode 100644 net/leafnode/files/leafnode.init create mode 100644 net/leafnode/files/news create mode 100644 net/leafnode/files/nntp create mode 100644 net/lft/Makefile create mode 100644 net/lft/patches/001-no_strip.patch create mode 100644 net/lftp/Makefile create mode 100644 net/lftp/patches/001-libintl.patch create mode 100644 net/lighttpd/Makefile create mode 100644 net/lighttpd/files/lighttpd.conf create mode 100644 net/lighttpd/files/lighttpd.init create mode 100644 net/linuxigd/Makefile create mode 100644 net/linuxigd/files/upnpd.conf create mode 100644 net/linuxigd/files/upnpd.init create mode 100644 net/linuxigd/patches/001-iptables_defs.patch create mode 100644 net/linuxigd/patches/002-netfilter_nat_headers.patch create mode 100644 net/linuxigd/patches/003-Makefile-fix.patch create mode 100644 net/linuxigd/patches/004-iptables-1.4.3.2-compat.patch create mode 100644 net/linuxigd/patches/005-includes.patch create mode 100644 net/lispmob/Makefile create mode 100644 net/lispmob/patches/010-disable-modprobe.patch create mode 100644 net/live/Makefile create mode 100644 net/live/patches/101-openwrt.patch create mode 100644 net/lldpd/Makefile create mode 100644 net/lldpd/files/lldpd.config create mode 100644 net/lldpd/files/lldpd.init create mode 100644 net/lldpd/patches/001-no-multiuser.patch create mode 100644 net/lldpd/patches/002-no-stack-protector.patch create mode 100644 net/lsm/Makefile create mode 100644 net/lsm/files/connections.conf create mode 100644 net/lsm/files/lsm.conf create mode 100644 net/lsm/files/lsm.init create mode 100644 net/lsm/files/lsm_script create mode 100644 net/mac-to-devinfo/Makefile create mode 100644 net/mac-to-devinfo/files/clean-devinfo create mode 100644 net/mac-to-devinfo/files/devinfo-functions.sh create mode 100644 net/mac-to-devinfo/files/ip-to-devinfo create mode 100644 net/mac-to-devinfo/files/mac-to-devinfo create mode 100644 net/mac-to-devinfo/files/macdevdb create mode 100644 net/mac-to-devinfo/files/mactodevinfo create mode 100644 net/mac-to-devinfo/files/netdiscover-to-devinfo create mode 100644 net/mac-to-devinfo/files/netsmap-to-devinfo create mode 100644 net/mac-to-devinfo/files/prep-devinfo create mode 100644 net/mac-to-devinfo/files/smap-to-devinfo create mode 100644 net/madwimax/Makefile create mode 100644 net/madwimax/files/20-madwimax create mode 100644 net/madwimax/files/event.sh create mode 100755 net/madwimax/files/madwimax.init create mode 100644 net/madwimax/patches/001-fix_detection_on_be.patch create mode 100644 net/maradns/Makefile create mode 100644 net/maradns/files/maradns.init create mode 100644 net/maradns/files/mararc create mode 100644 net/maradns/patches/001-cross_compile_fix.patch create mode 100644 net/matrixtunnel/Makefile create mode 100644 net/mdk3/Makefile create mode 100644 net/mdk3/patches/001-radiotap_needs_types_h.patch create mode 100644 net/mdk3/patches/010-fix-dependencies.patch create mode 100644 net/mdnsresponder/Makefile create mode 100644 net/mdnsresponder/files/mDNSResponder.conf create mode 100644 net/mdnsresponder/files/mDNSResponder.init create mode 100755 net/mdnsresponder/files/mdnsd.init create mode 100644 net/mdnsresponder/patches/001-cross_compile.patch create mode 100644 net/mdnsresponder/patches/002-uclibc.patch create mode 100644 net/memcached/Makefile create mode 100644 net/memcached/files/memcached.config create mode 100644 net/memcached/files/memcached.init create mode 100644 net/memcached/patches/100-fix_iov_max.patch create mode 100644 net/mercurial/Makefile create mode 100644 net/mercurial/patches/001-no_bzip2.patch create mode 100644 net/mgen/Makefile create mode 100644 net/mgen/patches/100-ipv6.patch create mode 100644 net/miau/Makefile create mode 100644 net/miau/files/miau.init create mode 100644 net/miax/Makefile create mode 100644 net/miax/patches/001-cross.patch create mode 100644 net/mii-tool/Makefile create mode 100644 net/mii-tool/patches/001-include_linux_sockios.patch create mode 100644 net/mini_httpd/Makefile create mode 100644 net/mini_httpd/files/matrixssl_helper.c create mode 100644 net/mini_httpd/files/matrixssl_helper.h create mode 100644 net/mini_httpd/files/mini_httpd-ssl.conf create mode 100644 net/mini_httpd/files/mini_httpd.conf create mode 100644 net/mini_httpd/files/mini_httpd.default create mode 100644 net/mini_httpd/files/mini_httpd.init create mode 100644 net/mini_httpd/files/mini_httpd.pem create mode 100644 net/mini_httpd/patches/001-cgi_path.patch create mode 100644 net/mini_httpd/patches/500-matrixssl.patch create mode 100644 net/mini_snmpd/Makefile create mode 100644 net/mini_snmpd/files/mini_snmpd.config create mode 100644 net/mini_snmpd/files/mini_snmpd.init create mode 100644 net/mini_snmpd/patches/100-dualstack.patch create mode 100644 net/mini_snmpd/patches/101-opt_flags.patch create mode 100644 net/mini_snmpd/patches/102-mib_fix_uninitialized_memory.patch create mode 100644 net/mini_snmpd/patches/103-mib_encode_snmp_element_oid_fix.patch create mode 100644 net/miniupnpc/Makefile create mode 100644 net/miniupnpc/patches/100-no_minixml_test.patch create mode 100644 net/miniupnpc/patches/200-miniupnpc_desc.patch create mode 100644 net/miniupnpd/Makefile create mode 100644 net/miniupnpd/files/miniupnpd.firewall.hotplug create mode 100644 net/miniupnpd/files/miniupnpd.iface.hotplug create mode 100644 net/miniupnpd/files/miniupnpd.init create mode 100644 net/miniupnpd/files/upnpd.config create mode 100644 net/mosquitto/Makefile create mode 100755 net/mosquitto/files/mosquitto.init create mode 100644 net/mosquitto/patches/100-disable-memory-reporting.patch create mode 100644 net/mosquitto/patches/101-disable-docbook.patch create mode 100644 net/mrtg/Makefile create mode 100644 net/mrtg/patches/001-rm-printf-longlong-fmt-test.patch create mode 100644 net/mtr/Makefile create mode 100644 net/mtr/patches/501-dns.patch create mode 100644 net/mtr/patches/502-fix-res_ninit.patch create mode 100644 net/mtr/patches/520-libresolv_fix.patch create mode 100644 net/mtr/patches/521-gtk_fix.patch create mode 100644 net/multiwan/Makefile create mode 100644 net/multiwan/files/etc/config/multiwan create mode 100755 net/multiwan/files/etc/init.d/multiwan create mode 100755 net/multiwan/files/usr/bin/multiwan create mode 100644 net/mutella/Makefile create mode 100644 net/mutella/patches/001-no_backtrace.patch create mode 100644 net/mutella/patches/002-gcc4_fixes.patch create mode 100644 net/mutella/patches/003-gcc4_3_fixes.patch create mode 100644 net/mutella/patches/004-no-host-paths.patch create mode 100644 net/mvprelay/Makefile create mode 100644 net/n2n/Makefile create mode 100644 net/n2n/files/n2n.config create mode 100644 net/n2n/files/n2n.init create mode 100644 net/natpmp/Makefile create mode 100644 net/natpmp/files/natpmp.config create mode 100644 net/natpmp/files/natpmp.init create mode 100644 net/nbd/Makefile create mode 100644 net/nbtscan/Makefile create mode 100644 net/ncftp/Makefile create mode 100644 net/ndyndns/Makefile create mode 100644 net/ndyndns/files/ndyndns.conf.sample create mode 100644 net/ndyndns/files/ndyndns.init create mode 100644 net/ndyndns/patches/010-dont-add-host-includes.patch create mode 100644 net/ndyndns/patches/020-ndyndns.patch create mode 100644 net/net-snmp/Makefile create mode 100644 net/net-snmp/files/snmpd.conf create mode 100644 net/net-snmp/files/snmpd.default create mode 100644 net/net-snmp/files/snmpd.init create mode 100644 net/net-snmp/patches/100-debian-statistics.patch create mode 100644 net/net-snmp/patches/110-debian-makefiles.patch create mode 100644 net/net-snmp/patches/120-debian-searchdirs.patch create mode 100644 net/net-snmp/patches/130-debian-extramibs.patch create mode 100644 net/net-snmp/patches/140-debian-docfiles.patch create mode 100644 net/net-snmp/patches/150-debian-defaultconfig.patch create mode 100644 net/net-snmp/patches/160-no_ldconfig.patch create mode 100644 net/net-snmp/patches/170-ldflags.patch create mode 100644 net/net-snmp/patches/750-ieee802dot11.patch create mode 100644 net/net-tools/Makefile create mode 100644 net/net-tools/patches/001-config.patch create mode 100644 net/net-tools/patches/002-compile-fixes.patch create mode 100644 net/netatalk/Makefile create mode 100644 net/netatalk/files/AppleVolumes.default create mode 100644 net/netatalk/files/afpd.conf create mode 100644 net/netatalk/files/afpd.init create mode 100644 net/netatalk/patches/001-automake-compat.patch create mode 100644 net/netcat/Makefile create mode 100644 net/netcat/patches/001-netcat_flag_count.patch create mode 100644 net/netdiscover/Makefile create mode 100644 net/netdiscover/patches/00-add-machine-ouput.patch create mode 100644 net/netdiscover/patches/01-initfix+end-fix.patch create mode 100644 net/netio/Config.in create mode 100644 net/netio/Makefile create mode 100644 net/netio/patches/001-Makefile.patch create mode 100644 net/netperf/Makefile create mode 100644 net/netperf/files/netserver.init create mode 100644 net/netperf/patches/001-dccp.patch create mode 100644 net/netpipe/Makefile create mode 100644 net/netstat-nat/Makefile create mode 100644 net/nfs-kernel-server/Makefile create mode 100644 net/nfs-kernel-server/files/nfsd.exports create mode 100644 net/nfs-kernel-server/files/nfsd.init create mode 100644 net/nfs-kernel-server/patches/100-nfs_utils_uclibc.patch create mode 100644 net/nfs-kernel-server/patches/101-no_malloc_h.patch create mode 100644 net/nfs-kernel-server/patches/200-osd_login-install.patch create mode 100644 net/nfs-server/Makefile create mode 100644 net/nfs-server/files/nfsd.exports create mode 100644 net/nfs-server/files/nfsd.init create mode 100644 net/nfs-server/patches/001-build_config.patch create mode 100644 net/nfs-server/patches/002-cross_compile_fix.patch create mode 100644 net/nfs-server/patches/003-debian_subset.patch create mode 100644 net/nfs-server/patches/004-gcc34_fix.patch create mode 100644 net/nfs-server/patches/005-remove_warning.patch create mode 100644 net/nginx/Config.in create mode 100644 net/nginx/Makefile create mode 100644 net/nginx/files/nginx.init create mode 100644 net/nginx/patches/101-feature_test_fix.patch create mode 100644 net/nginx/patches/102-sizeof_test_fix.patch create mode 100644 net/nginx/patches/103-sys_nerr.patch create mode 100644 net/nginx/patches/200-config.patch create mode 100644 net/ngircd/Makefile create mode 100644 net/ngircd/files/ngircd.init create mode 100644 net/ngrep/Makefile create mode 100644 net/ngrep/patches/001-makefile_in.patch create mode 100644 net/ngrep/patches/001-ngrep.patch create mode 100644 net/nmap/Makefile create mode 100644 net/nocatauth/Makefile create mode 100755 net/nocatauth/files/nocatauth-gateway create mode 100644 net/nocatauth/patches/001-ptp-local.patch create mode 100644 net/nocatauth/patches/002-openwrt.patch create mode 100644 net/nocatauth/patches/003-fix-module-loading create mode 100644 net/nocatauth/patches/004-fw_detect.patch create mode 100644 net/nocatsplash/Makefile create mode 100644 net/nocatsplash/patches/001-openwrt_firewall.patch create mode 100644 net/nodogsplash/Makefile create mode 100644 net/nodogsplash/files/nodogsplash.init create mode 100644 net/nodogsplash/patches/001-crash_on_missing_rdir_param.patch create mode 100644 net/nodogsplash/patches/002-deprecated_iptables_syntax.patch create mode 100644 net/nprobe/Makefile create mode 100644 net/nprobe/patches/001-automake-compat.patch create mode 100644 net/nprobe/patches/002-path_to_pcap.patch create mode 100644 net/nprobe/patches/003-ipv6_fix.patch create mode 100644 net/nstx/Makefile create mode 100644 net/nstx/patches/001-debian_changes.patch create mode 100644 net/ntpclient/Makefile create mode 100644 net/ntpclient/files/ntpclient.config create mode 100644 net/ntpclient/files/ntpclient.hotplug create mode 100644 net/ntpclient/patches/100-daemon.patch create mode 100644 net/ntpd/Makefile create mode 100644 net/ntpd/files/ntp.conf create mode 100644 net/ntpd/files/ntpd.hotplug create mode 100644 net/ntpd/files/ntpd.init create mode 100644 net/ntpd/files/ntpdate.init create mode 100644 net/ntripcaster/Makefile create mode 100644 net/ntripclient/Makefile create mode 100644 net/ntripserver/Makefile create mode 100644 net/nufw/Makefile create mode 100644 net/nufw/patches/001-no_doc_tests.patch create mode 100644 net/nufw/patches/002-debian_fixes.patch create mode 100644 net/nuttcp/Makefile create mode 100644 net/nzbget/Makefile create mode 100644 net/nzbget/patches/001-openssl-1.0.0-compat.patch create mode 100644 net/nzbgetweb/Makefile create mode 100644 net/nzbgetweb/files/httpd.conf create mode 100644 net/nzbgetweb/files/lib/xmlrpc.inc create mode 100644 net/nzbgetweb/files/lib/xmlrpc_wrappers.inc create mode 100644 net/nzbgetweb/files/lib/xmlrpcs.inc create mode 100644 net/obfsproxy/Makefile create mode 100644 net/obfsproxy/patches/001-no-werror.patch create mode 100644 net/obfsproxy/patches/002-no-build-hardening.patch create mode 100644 net/oidentd/Makefile create mode 100644 net/oidentd/files/oidentd.init create mode 100644 net/olsrd/Makefile create mode 100644 net/olsrd/files/olsrd.config create mode 100644 net/olsrd/files/olsrd.init create mode 100644 net/olsrd/files/olsrd_secure_key create mode 100644 net/olsrd/patches/100-olsrd-fix-stack-corruption-in-net_output.patch create mode 100644 net/openconnect/Makefile create mode 100755 net/openconnect/files/openconnect.sh create mode 100755 net/openconnect/files/vpnc-script create mode 100644 net/openconnect/patches/100-passwd_file.patch create mode 100644 net/opendchub/Makefile create mode 100644 net/openl2tp/Makefile create mode 100644 net/openl2tp/patches/001-makefile.patch create mode 100644 net/openl2tp/patches/002-no_libfl.patch create mode 100644 net/openl2tp/patches/010-ppp_unix.patch create mode 100644 net/openl2tp/src/l2tp_rpc.h create mode 100644 net/openl2tp/src/l2tp_rpc_client.c create mode 100644 net/openl2tp/src/l2tp_rpc_server.c create mode 100644 net/openl2tp/src/l2tp_rpc_xdr.c create mode 100644 net/opennhrp/Makefile create mode 100755 net/opennhrp/files/opennhrp.init create mode 100644 net/openntpd/Makefile create mode 100644 net/openntpd/files/ntpd.conf create mode 100644 net/openntpd/files/ntpd.config create mode 100644 net/openntpd/files/ntpd.hotplug create mode 100644 net/openntpd/files/ntpd.init create mode 100644 net/openntpd/patches/001-adjtimex_linux.patch create mode 100644 net/openntpd/patches/002-save_freq_drift.patch create mode 100644 net/openntpd/patches/003-no_permission_check.patch create mode 100644 net/openrrcp/Makefile create mode 100644 net/openser/Makefile create mode 100644 net/openser/patches/001-openser_cfg.patch create mode 100644 net/openser/patches/002-sc.patch create mode 100644 net/openser/patches/003-makefile_defs.patch create mode 100644 net/openser/patches/004-cfg_lex.patch create mode 100644 net/openser/patches/005-config_h.patch create mode 100644 net/openser/patches/006-sc_dbtext.patch create mode 100644 net/openser/patches/007-modules_build.patch create mode 100644 net/opensips/Makefile create mode 100644 net/opensips/files/opensips.default create mode 100755 net/opensips/files/opensips.init create mode 100644 net/opensips/patches/001-no_rej.patch create mode 100644 net/opensips/patches/005-config_h.patch create mode 100644 net/opensips/patches/007-modules_build.patch create mode 100644 net/openslp/Makefile create mode 100644 net/openslp/files/etc/init.d/slpd create mode 100644 net/openslp/files/etc/slp.conf create mode 100644 net/openslp/files/etc/slp.reg create mode 100644 net/openslp/files/etc/slp.spi create mode 100644 net/openssh/Makefile create mode 100644 net/openssh/files/sshd.init create mode 100644 net/openssh/patches/100-no_cast_fix.patch create mode 100644 net/openssh/patches/110-no_ripemd_fix.patch create mode 100644 net/openssh/patches/130-implicit_memset_decl_fix.patch create mode 100644 net/openssh/patches/140-pam_uclibc_pthreads_fix.patch create mode 100644 net/openssh/patches/200-dscp-qos.patch create mode 100644 net/openswan/Makefile create mode 100644 net/openswan/files/ipsec.conf create mode 100644 net/openswan/files/ipsec.config create mode 100755 net/openswan/files/ipsec.init create mode 100644 net/openswan/files/ipsec.secrets create mode 100644 net/openswan/files/ipsec.upgrade create mode 100644 net/openswan/patches/100-cross_compile.patch create mode 100644 net/openswan/patches/120-no_manpages.patch create mode 100644 net/openswan/patches/140-generated_autoconf.patch create mode 100644 net/openvpn-devel/Config-nossl.in create mode 100644 net/openvpn-devel/Config-openssl.in create mode 100644 net/openvpn-devel/Config-polarssl.in create mode 100644 net/openvpn-devel/Makefile create mode 120000 net/openvpn-devel/files create mode 100644 net/openvpn/Config.in create mode 100644 net/openvpn/Makefile create mode 100644 net/openvpn/files/easy-rsa.index create mode 100644 net/openvpn/files/easy-rsa.serial create mode 100644 net/openvpn/files/openvpn.config create mode 100644 net/openvpn/files/openvpn.init create mode 100644 net/openvpn/files/openvpn.upgrade create mode 100644 net/openvpn/patches/001-easy_rsa.patch create mode 100644 net/p910nd/Makefile create mode 100644 net/p910nd/files/p910nd.config create mode 100644 net/p910nd/files/p910nd.init create mode 100644 net/paris-traceroute/Makefile create mode 100644 net/parprouted/Makefile create mode 100755 net/parprouted/files/parprouted.config create mode 100644 net/parprouted/files/parprouted.init create mode 100644 net/parprouted/patches/001-parprouted.patch create mode 100644 net/pcapsipdump/Makefile create mode 100644 net/pcapsipdump/patches/001-cross_compile.patch create mode 100644 net/pcapsipdump/patches/002-elif_else_replacement.patch create mode 100644 net/pdnsd/Makefile create mode 100644 net/pdnsd/files/pdnsd.init create mode 100644 net/peerguardian/Makefile create mode 100644 net/peerguardian/files/peerguardian.init create mode 100644 net/peerguardian/patches/001-no_host_includes.patch create mode 100644 net/peerguardian/patches/002-new_libipq.patch create mode 100644 net/peerguardian/patches/003-gcc_4_3-compile-fix.patch create mode 100644 net/peervpn/Makefile create mode 100644 net/pen/Makefile create mode 100644 net/pepperspot/Makefile create mode 100644 net/pepperspot/files/pepperspot.init create mode 100644 net/pepperspot/patches/101-cflags.patch create mode 100644 net/pepperspot/patches/102-no_warnings.patch create mode 100644 net/pepperspot/patches/110-fix-compile.patch create mode 100644 net/pepsal/Makefile create mode 100644 net/polipo/Makefile create mode 100644 net/polipo/files/polipo.config create mode 100644 net/polipo/files/polipo.init create mode 100644 net/portmap/Makefile create mode 100644 net/portmap/files/portmap.init create mode 100644 net/portmap/patches/101-no_pie.patch create mode 100644 net/portsentry/Makefile create mode 100644 net/portsentry/files/portsentry.init create mode 100644 net/portsentry/patches/100-conf_location.patch create mode 100644 net/portsentry/patches/101-postsentry_c.patch create mode 100644 net/pptpd/Makefile create mode 100644 net/pptpd/files/options.pptpd create mode 100644 net/pptpd/files/pptpd.conf create mode 100644 net/pptpd/files/pptpd.init create mode 100644 net/pptpd/patches/001-bad_pqueue_debug.patch create mode 100644 net/pptpd/patches/002-makefile_fix.patch create mode 100644 net/pptpd/patches/003-opt_flags.patch create mode 100644 net/privoxy/Makefile create mode 100644 net/privoxy/files/privoxy.config create mode 100644 net/privoxy/files/privoxy.init create mode 100644 net/proftpd/Makefile create mode 100644 net/proftpd/files/proftpd.init create mode 100644 net/proftpd/patches/001-automake-compat.patch create mode 100644 net/proftpd/patches/002-mempcpy_def.patch create mode 100644 net/prosody/Makefile create mode 100644 net/prosody/files/prosody.init create mode 100644 net/prosody/patches/001-conf.patch create mode 100644 net/psybnc/Makefile create mode 100644 net/psybnc/patches/001-makefile.patch create mode 100644 net/psybnc/patches/002-conf.patch create mode 100644 net/psybnc/patches/003-psybnc.patch create mode 100644 net/psybnc/patches/004-start_script.patch create mode 100644 net/psybnc/patches/005-fix_endianess_detection.patch create mode 100644 net/ptpd/Makefile create mode 100644 net/ptpd/files/ptpd.init create mode 100644 net/ptunnel/Makefile create mode 100644 net/ptunnel/files/ptunnel.config create mode 100644 net/ptunnel/files/ptunnel.init create mode 100644 net/ptunnel/patches/001-prefix.patch create mode 100644 net/ptunnel/patches/002-no_selinux.patch create mode 100644 net/pure-ftpd/Makefile create mode 100644 net/pure-ftpd/files/pure-ftpd.config create mode 100644 net/pure-ftpd/files/pure-ftpd.init create mode 100644 net/pure-ftpd/patches/010-dont-add-host-paths.patch create mode 100644 net/pyload/Makefile create mode 100644 net/pyload/files/pyload.init create mode 100644 net/pyrit/Makefile create mode 100644 net/qolyester/Makefile create mode 100644 net/quagga/Makefile create mode 100644 net/quagga/files/quagga create mode 100644 net/quagga/files/quagga.conf create mode 100644 net/quagga/files/quagga.init create mode 100644 net/quagga/patches/001-bgpd-fix-args-consolidation.patch create mode 100644 net/quagga/patches/002-fix-metric-output.patch create mode 100644 net/quagga/patches/003-bgpd-fix-route-map-match-peer-local.patch create mode 100644 net/quagga/patches/004-fix-sockunion-memleaks.patch create mode 100644 net/quagga/patches/005-zebra-connected-in-mrib.patch create mode 100644 net/quagga/patches/006-fix-no-ipv6.patch create mode 100644 net/quagga/patches/007-drop-heuristic-ipv6-recognition.patch create mode 100644 net/quagga/patches/008-fix-thread_cancel_event.patch create mode 100644 net/quagga/patches/009-bgpd-fix-vpn4-soft-reconfiguration.patch create mode 100644 net/quagga/patches/010-bgpd-fix-struct-attr_extra-leak.patch create mode 100644 net/quagga/patches/011-isisd-fix-typo.patch create mode 100644 net/quagga/patches/110-fix_ipctl_forwarding.patch create mode 100644 net/quagga/patches/120-quagga_manet.patch create mode 100644 net/quagga/patches/130-fix_cpp.patch create mode 100644 net/quagga/patches/140-holdtimer-set.patch create mode 100644 net/quagga/patches/150-no-cross-fs-link.patch create mode 100644 net/quagga/patches/160-pgbgp.patch create mode 100644 net/quagga/patches/161-pgbgp-addon.patch create mode 100644 net/quagga/patches/170-use-supported-pagers.patch create mode 100644 net/quicktun/Makefile create mode 100644 net/quicktun/files/quicktun.config create mode 100644 net/quicktun/files/quicktun.init create mode 100644 net/raddump/Makefile create mode 100644 net/radsecproxy/Makefile create mode 100644 net/radsecproxy/files/radsecproxy.init create mode 100644 net/radsecproxy/patches/100-missing-return.patch create mode 100644 net/rarpd/Makefile create mode 100644 net/rarpd/files/rarpd.config create mode 100644 net/rarpd/files/rarpd.init create mode 100644 net/reaim/Makefile create mode 100644 net/reaim/files/reaim.init create mode 100644 net/reaim/patches/501-cross_compile-install.patch create mode 100644 net/reaver/Makefile create mode 100644 net/reaver/patches/0001-wpscrack-big-endian-fixes.patch create mode 100644 net/reaver/patches/0002-Use-the-current-directory-for-storing-and-loading-se.patch create mode 100644 net/reaver/patches/0003-wash-wpsmon-use-less-useless-spaces-in-output-to-fit.patch create mode 100644 net/redir/Makefile create mode 100644 net/redir/patches/00_honor_copts.patch create mode 100644 net/redir/patches/01_fix_max_bandwidth_docs.patch create mode 100644 net/redir/patches/02_use_ntohs.patch create mode 100644 net/redir/patches/03_fix_tcp_wrappers.patch create mode 100644 net/redir/patches/04_fix_timeouts.patch create mode 100644 net/redir/patches/06_fix_shaper_buffer.patch create mode 100644 net/remotefs/Makefile create mode 100755 net/remotefs/files/rfsd create mode 100644 net/restund/Makefile create mode 100644 net/restund/files/restund.init create mode 100755 net/rinetd/Makefile create mode 100644 net/rinetd/files/rinetd.config create mode 100755 net/rinetd/files/rinetd.init create mode 100644 net/rinetd/patches/001-crosscompile.patch create mode 100644 net/rp-l2tp/Makefile create mode 100644 net/rp-l2tp/files/rp-l2tpd.init create mode 100644 net/rp-l2tp/patches/001-cross.patch create mode 100644 net/rp-pppoe/Makefile create mode 100644 net/rp-pppoe/files/pppoe-client.init create mode 100644 net/rp-pppoe/files/pppoe-relay.default create mode 100644 net/rp-pppoe/files/pppoe-relay.init create mode 100644 net/rp-pppoe/files/pppoe-server.default create mode 100644 net/rp-pppoe/files/pppoe-server.init create mode 100644 net/rp-pppoe/patches/100-configure.patch create mode 100644 net/rrs/Makefile create mode 100644 net/rrs/patches/001-shell.patch create mode 100644 net/rrs/patches/002-no_sslv2.patch create mode 100644 net/rrs/patches/003-honour_copts.patch create mode 100644 net/rssh/Makefile create mode 100644 net/rssh/patches/001-destdir.patch create mode 100644 net/rsync/Makefile create mode 100644 net/rsync/files/rsyncd.conf create mode 100644 net/rsync/files/rsyncd.init create mode 100644 net/rtorrent/Makefile create mode 100644 net/rtorrent/patches/100-fix-cross_compile.patch create mode 100644 net/rtorrent/patches/120-fix-ncurses.patch create mode 100644 net/rtpproxy/Makefile create mode 100644 net/samba36/Makefile create mode 100644 net/samba36/files/samba.config create mode 100755 net/samba36/files/samba.init create mode 100644 net/samba36/files/smb.conf.template create mode 100644 net/samba36/patches/100-configure_fixes.patch create mode 100644 net/samba36/patches/110-multicall.patch create mode 100644 net/samba36/patches/111-owrt_smbpasswd.patch create mode 100644 net/samba36/patches/120-add_missing_ifdef.patch create mode 100644 net/samba36/patches/200-remove_printer_support.patch create mode 100644 net/samba36/patches/210-remove_ad_support.patch create mode 100644 net/samba36/patches/220-remove_services.patch create mode 100644 net/samba36/patches/230-remove_winreg_support.patch create mode 100644 net/samba36/patches/240-remove_dfs_api.patch create mode 100644 net/samba36/patches/250-remove_domain_logon.patch create mode 100644 net/samba36/patches/260-remove_samr.patch create mode 100644 net/samba36/patches/270-remove_registry_backend.patch create mode 100644 net/samba36/patches/280-strip_srvsvc.patch create mode 100644 net/samba36/patches/290-remove_lsa.patch create mode 100644 net/samba36/patches/300-assert_debug_level.patch create mode 100644 net/samba36/patches/310-remove_error_strings.patch create mode 100644 net/samba36/patches/320-debug_level_checks.patch create mode 100644 net/samba36/patches/330-librpc_default_print.patch create mode 100644 net/scanlogd/Makefile create mode 100644 net/scanlogd/files/scanlogd.init create mode 100644 net/scdp/Makefile create mode 100644 net/seeks/Makefile create mode 100644 net/seeks/files/seeks.init create mode 100644 net/seeks/patches/050-better_icu_detection.patch create mode 100644 net/seeks/patches/100-no_tests-and-add-iconv-link.patch create mode 100644 net/seeks/patches/200-add_pcre_headers_to_plugins.patch create mode 100644 net/ser2net/Makefile create mode 100644 net/serialoverip/Makefile create mode 100644 net/serialoverip/patches/001-compile-fixes.patch create mode 100644 net/shat/Makefile create mode 100644 net/shorewall-lite/Makefile create mode 100644 net/shorewall-lite/files/hostname create mode 100644 net/shorewall-lite/files/hotplug_iface create mode 100644 net/shorewall-lite/files/lsm_script create mode 100644 net/shorewall-lite/files/shorewall-lite.init create mode 100644 net/shorewall-lite/files/vardir create mode 100644 net/shorewall-lite/patches/110-MODULESDIR.patch create mode 100644 net/shorewall-lite/patches/120-LOGFILE.patch create mode 100644 net/sipp/Makefile create mode 100644 net/siproxd/Makefile create mode 100644 net/siproxd/files/siproxd.config create mode 100644 net/siproxd/files/siproxd.init create mode 100644 net/siproxd/patches/010-fix-bogus-libltdl-dependency.patch create mode 100644 net/sipsak/Makefile create mode 100644 net/sipsak/patches/001-ssp.patch create mode 100644 net/sipsak/patches/002-no_cares_ruli.patch create mode 100644 net/slurm/Makefile create mode 100644 net/slurm/patches/001-no_host_curses.patch create mode 100644 net/smap/Makefile create mode 100644 net/smap/patches/00-fix-broadcast.patch create mode 100644 net/smap/patches/01-add-tecom-supported-header.patch create mode 100644 net/smap/patches/02-segfault-and-toofast-bugfixes.patch create mode 100644 net/smcroute/Makefile create mode 100644 net/smcroute/files/smcroute.init create mode 100644 net/smcroute/patches/001-socket_path.patch create mode 100644 net/smcroute/patches/002-optimize_size.patch create mode 100644 net/smtptrapd/Makefile create mode 100644 net/smtptrapd/files/smtptrapd.init create mode 100644 net/smtptrapd/patches/200-missing_opt.patch create mode 100644 net/snort-wireless/Makefile create mode 100644 net/snort-wireless/files/snort-wireless.default create mode 100644 net/snort-wireless/files/snort-wireless.init create mode 100644 net/snort-wireless/patches/500-no-config-search.patch create mode 100644 net/snort-wireless/patches/750-lightweight-config.patch create mode 100644 net/snort/Makefile create mode 100644 net/snort/files/snort.bin create mode 100644 net/snort/files/snort.default create mode 100644 net/snort/files/snort.init create mode 100644 net/snort/files/snort.local.rules create mode 100644 net/snort/patches/001-automake-compat.patch create mode 100644 net/snort/patches/100-INADDR_NONE.patch create mode 100644 net/snort/patches/101-PCAP.patch create mode 100644 net/snort/patches/150-config-preprocessors-disable.patch create mode 100644 net/snort/patches/160-mysql_cross_compiling_checks.patch create mode 100644 net/snort/patches/200-snortsam.patch create mode 100644 net/socat/Makefile create mode 100644 net/socat/patches/501-honor_ldflags.patch create mode 100644 net/softflowd/Makefile create mode 100644 net/softflowd/files/softflowd.config create mode 100644 net/softflowd/files/softflowd.init create mode 100644 net/spawn-fcgi/Makefile create mode 100644 net/speedtouch-usb-firmware/Makefile create mode 100644 net/squid/Makefile create mode 100644 net/squid/patches/001-cross_compile.patch create mode 100644 net/squid/patches/002-no_sslv2.patch create mode 100644 net/squid/patches/003-configure.patch create mode 100644 net/squid/patches/004-include-autoconf.patch create mode 100644 net/squid/patches/005-lib-makefile.patch create mode 100644 net/srelay/Makefile create mode 100644 net/srelay/files/srelay.conf create mode 100644 net/srelay/files/srelay.init create mode 100644 net/sscep/Makefile create mode 100644 net/sscep/patches/001-certnanny.patch create mode 100644 net/sshfs/Makefile create mode 100644 net/sshtunnel/Makefile create mode 100644 net/sshtunnel/files/sshtunnel.init create mode 100644 net/sshtunnel/files/sshtunnel.sh create mode 100644 net/sshtunnel/files/uci_sshtunnel create mode 100644 net/sslcat/Makefile create mode 100644 net/sslh/Makefile create mode 100644 net/sslh/files/sslh.config create mode 100644 net/sslh/files/sslh.init create mode 100644 net/sslh/patches/001-no_sslh_select.patch create mode 100644 net/sslsniff/Makefile create mode 100644 net/sslsniff/patches/01-cross-compile.patch create mode 100644 net/sslstrip/Makefile create mode 100644 net/ssltunnel/Makefile create mode 100644 net/strongswan/Config.in create mode 100644 net/strongswan/Makefile create mode 100644 net/strongswan/files/ipsec.secrets create mode 100644 net/strongswan/patches/201-no-modprobe.patch create mode 100644 net/strongswan/patches/203-uci.patch create mode 100644 net/stun/Makefile create mode 100644 net/stun/files/stund.config create mode 100644 net/stun/files/stund.init create mode 100644 net/stun/patches/001-fix_non_i386.patch create mode 100644 net/stun/patches/002-linking_order.patch create mode 100644 net/stunnel/Makefile create mode 100644 net/stunnel/files/stunnel.init create mode 100644 net/stunnel/patches/001-remove-libtool.patch create mode 100644 net/stunnel/patches/100-cross-compile.patch create mode 100644 net/stunnel/patches/101-no-comp.patch create mode 100644 net/stunnel/patches/102-no-ssl2.patch create mode 100644 net/stunnel/patches/103-no-zlib-link.patch create mode 100644 net/stunnel/patches/104-fix-paths.patch create mode 100644 net/stunnel/patches/105-stunnel-conf.patch create mode 100644 net/stunnel/patches/106-stunnel-xforwardedfor.patch create mode 100644 net/subversion/Makefile create mode 100644 net/subversion/files/subversion.config create mode 100644 net/subversion/files/subversion.init create mode 100644 net/synce-dccm/Makefile create mode 100644 net/tcpdump/Makefile create mode 100644 net/tcpdump/patches/001-remove_pcap_debug.patch create mode 100644 net/tcpdump/patches/002-remove_static_libpcap_check.patch create mode 100644 net/tcpdump/patches/004-fix_3g_iface.patch create mode 100644 net/tcpdump/patches/100-tcpdump_mini.patch create mode 100644 net/tcptraceroute/Makefile create mode 100644 net/tcptraceroute/patches/001-configure_cross_compile.patch create mode 100644 net/tctool/Makefile create mode 100644 net/tctool/patches/001_Makefile_fix.diff create mode 100644 net/tctool/patches/005-fix-gcc_4_3-compile.patch create mode 100644 net/tftp-hpa/Makefile create mode 100644 net/tftp-hpa/files/tftpd-hpa.init create mode 100644 net/tig/Makefile create mode 100644 net/tinc/Makefile create mode 100644 net/tinc/files/tinc.config create mode 100644 net/tinc/files/tinc.init create mode 100644 net/tinc/files/tinc.upgrade create mode 100644 net/tinyproxy/Makefile create mode 100644 net/tinyproxy/files/tinyproxy.config create mode 100644 net/tinyproxy/files/tinyproxy.init create mode 100644 net/tinyproxy/patches/010-no-docs-and-tests.patch create mode 100644 net/tinyproxy/patches/020-config_and_pid-path.patch create mode 100644 net/tinyproxy/patches/030-allow_bind_in_transparent_mode.patch create mode 100644 net/tinyproxy/patches/040-fix_url_filter_in_transparent_mode.patch create mode 100644 net/tinyproxy/patches/120-fix_INET6.patch create mode 100644 net/tmsnc/Makefile create mode 100644 net/tor-alpha/Makefile create mode 100644 net/tor-alpha/files/tor.init create mode 100644 net/tor-alpha/patches/001-torrc.patch create mode 100644 net/tor/Makefile create mode 100644 net/tor/files/tor.init create mode 100644 net/tor/patches/001-torrc.patch create mode 100644 net/transmission/Makefile create mode 100644 net/transmission/files/transmission.config create mode 100644 net/transmission/files/transmission.init create mode 100644 net/transmission/patches/010_libtransmission_fallocate64_eglibc.patch create mode 100644 net/transocks/Makefile create mode 100644 net/tsocks/Makefile create mode 100644 net/tsocks/patches/100-no_static.patch create mode 100644 net/ttcp/Makefile create mode 100644 net/ttcp/ttcp.c create mode 100644 net/uanytun/Makefile create mode 100644 net/uanytun/files/uanytun-nocrypt.config create mode 100644 net/uanytun/files/uanytun.config create mode 100644 net/uanytun/files/uanytun.init create mode 100644 net/ucarp/Makefile create mode 100644 net/ucarp/files/ucarp.conf create mode 100644 net/ucarp/files/ucarp.init create mode 100644 net/ucarp/patches/100-configure-cross-compilation.patch create mode 100644 net/ucspi-tcp/Makefile create mode 100644 net/ucspi-tcp/patches/100-cross_compile.patch create mode 100644 net/udp-broadcast-relay/Makefile create mode 100644 net/udpcast/Makefile create mode 100644 net/udpxy/Makefile create mode 100644 net/udpxy/files/udpxy.init create mode 100644 net/uftp/Makefile create mode 100644 net/uhub/Makefile create mode 100644 net/uhub/patches/100-user_struct.patch create mode 100644 net/ulogd/Makefile create mode 100644 net/ulogd/files/ulogd.default create mode 100644 net/ulogd/files/ulogd.init create mode 100644 net/ulogd/patches/001-pcap_flags.patch create mode 100644 net/ulogd/patches/002-inc.patch create mode 100644 net/ulogd/patches/003-fix-bad-rpath.patch create mode 100644 net/umurmur/Makefile create mode 100644 net/unbound/Makefile create mode 100644 net/unbound/files/named.cache create mode 100644 net/unbound/files/root.key create mode 100755 net/unbound/files/unbound.init create mode 100644 net/unbound/patches/001-conf.patch create mode 100644 net/unfs3/Makefile create mode 100644 net/unfs3/files/unfs3.exports create mode 100644 net/unfs3/files/unfs3.init create mode 100644 net/unfs3/patches/100-no_lfl.patch create mode 100644 net/uob-nomad/Makefile create mode 100644 net/uob-nomad/patches/001-inet_sr.patch create mode 100644 net/uob-nomad/patches/002-hostname.patch create mode 100644 net/uob-nomad/patches/003-conf.patch create mode 100644 net/uob-nomad/patches/004-linux26_header_fix.patch create mode 100644 net/updatedd/Makefile create mode 100644 net/updatedd/files/updatedd.config create mode 100644 net/updatedd/files/updatedd.hotplug create mode 100644 net/updatedd/files/updatedd.init create mode 100644 net/updatedd/patches/001-service_libname.patch create mode 100644 net/updatedd/patches/002-ovh-dyndnshost.patch create mode 100644 net/updatedd/patches/003-zoneedit-url-fix.patch create mode 100644 net/updatedd/patches/004-fix_liberty_dep.patch create mode 100644 net/usbip/Makefile create mode 100644 net/usbip/patches/001-upstream_svn_r99.diff create mode 100644 net/usbip/patches/002-upstream_svn_r152.patch create mode 100644 net/uucp/Makefile create mode 100644 net/vblade/Makefile create mode 100644 net/vblade/files/vblade.config create mode 100644 net/vblade/files/vblade.init create mode 100644 net/veth/Makefile create mode 100644 net/veth/patches/100-veth-makefile-cflags.patch create mode 100644 net/veth/patches/200-drop-multicast.patch create mode 100644 net/vgp/Makefile create mode 100644 net/vnc-reflector/Makefile create mode 100644 net/vnc-reflector/patches/001-honor_include_lib_path.patch create mode 100644 net/vncrepeater/Makefile create mode 100644 net/vncrepeater/patches/001-uclibcxx_linking.patch create mode 100644 net/vnstat/Makefile create mode 100644 net/vnstat/files/vnstat.config create mode 100644 net/vnstat/files/vnstat.defaults create mode 100644 net/vnstat/files/vnstat.init create mode 100644 net/vnstat/patches/001-conf.patch create mode 100644 net/vnstat/patches/002-no_install_strip.patch create mode 100644 net/vnstat/patches/003-no_install_uname.patch create mode 100644 net/vnstat/patches/004-install_bsd_fix.patch create mode 100644 net/vpnc-scripts/Makefile create mode 100644 net/vpnc-scripts/files/etc/vpnc/connect.d/ifstate create mode 100644 net/vpnc/Makefile create mode 100644 net/vpnc/patches/001-cross.patch create mode 100644 net/vpnc/patches/002-vpn_script.patch create mode 100644 net/vpnc/patches/003-no_makeman.patch create mode 100644 net/vpzone/Makefile create mode 100644 net/vpzone/files/vpzone.conf create mode 100644 net/vpzone/files/vpzone.init create mode 100644 net/vpzone/patches/001-no_werror.patch create mode 100644 net/vpzone/patches/002-ipv6_inc_fix.patch create mode 100644 net/vrrpd/Makefile create mode 100644 net/vrrpd/files/vrrpd.config create mode 100644 net/vrrpd/files/vrrpd.init create mode 100644 net/vsftpd/Makefile create mode 100644 net/vsftpd/files/vsftpd.conf create mode 100644 net/vsftpd/files/vsftpd.init create mode 100644 net/vsftpd/patches/001-destdir.patch create mode 100644 net/vsftpd/patches/002-find_libs.patch create mode 100644 net/vsftpd/patches/003-chroot.patch create mode 100644 net/vsftpd/patches/004-disable-capabilities.patch create mode 100644 net/vtun/Makefile create mode 100644 net/vtun/patches/100-lzo2.patch create mode 100644 net/wavemon/Makefile create mode 100644 net/wccpd/Makefile create mode 100644 net/wdiag/Makefile create mode 100644 net/weechat/Makefile create mode 100644 net/wget/Makefile create mode 100644 net/wifidog/Makefile create mode 100644 net/wifidog/files/wifidog.conf create mode 100644 net/wifidog/files/wifidog.init create mode 100644 net/wing/Makefile create mode 100644 net/wing/files/etc/uci-defaults/wing create mode 100644 net/wing/files/lib/netifd/proto/wing.sh create mode 100755 net/wing/files/usr/bin/wing_status create mode 100644 net/wiviz/Makefile create mode 100755 net/wiviz/files/www/cgi-bin/wiviz/get.cgi create mode 100755 net/wiviz/files/www/cgi-bin/wiviz/set.cgi create mode 100755 net/wiviz/files/www/wiviz/adhoc-idle.gif create mode 100755 net/wiviz/files/www/wiviz/adhoc-idle.png create mode 100755 net/wiviz/files/www/wiviz/adhoc.gif create mode 100755 net/wiviz/files/www/wiviz/adhoc.png create mode 100755 net/wiviz/files/www/wiviz/ap-idle.gif create mode 100755 net/wiviz/files/www/wiviz/ap-idle.png create mode 100755 net/wiviz/files/www/wiviz/ap-wep-idle.gif create mode 100755 net/wiviz/files/www/wiviz/ap-wep-idle.png create mode 100755 net/wiviz/files/www/wiviz/ap-wep.gif create mode 100755 net/wiviz/files/www/wiviz/ap-wep.png create mode 100755 net/wiviz/files/www/wiviz/ap.gif create mode 100755 net/wiviz/files/www/wiviz/ap.png create mode 100755 net/wiviz/files/www/wiviz/pip-idle.gif create mode 100755 net/wiviz/files/www/wiviz/pip-idle.png create mode 100755 net/wiviz/files/www/wiviz/pip.gif create mode 100755 net/wiviz/files/www/wiviz/pip.png create mode 100755 net/wiviz/files/www/wiviz/station-idle.gif create mode 100755 net/wiviz/files/www/wiviz/station-idle.png create mode 100755 net/wiviz/files/www/wiviz/station.gif create mode 100755 net/wiviz/files/www/wiviz/station.png create mode 100755 net/wiviz/files/www/wiviz/wiviz.css create mode 100755 net/wiviz/files/www/wiviz/wiviz.html create mode 100755 net/wiviz/files/www/wiviz/wiviz.js create mode 100644 net/wiviz/src/Makefile create mode 100644 net/wiviz/src/channelhopper.c create mode 100644 net/wiviz/src/channelhopper.h create mode 100644 net/wiviz/src/structs.h create mode 100644 net/wiviz/src/wiviz.c create mode 100644 net/wiviz/src/wl_access.c create mode 100644 net/wiviz/src/wl_access.h create mode 100644 net/wknock/Makefile create mode 100644 net/wol/Makefile create mode 100644 net/wol/files/wol.config create mode 100644 net/wol/files/wol.init create mode 100644 net/wput/Makefile create mode 100644 net/wput/patches/100-socketlib.diff create mode 100644 net/wput/patches/102-wput.diff create mode 100644 net/wrt-radauth/Makefile create mode 100644 net/wrt-radauth/patches/001-ldpath.patch create mode 100644 net/wshaper/Makefile create mode 100644 net/wshaper/files/wshaper.config create mode 100755 net/wshaper/files/wshaper.htb create mode 100644 net/wshaper/files/wshaper.init create mode 100644 net/xinetd/Makefile create mode 100644 net/xinetd/files/xinetd.conf create mode 100644 net/xinetd/files/xinetd.init create mode 100644 net/xinetd/patches/001-ar.patch create mode 100644 net/xinetd/patches/002-destdir.patch create mode 100644 net/xinetd/patches/003-rpc_fix.patch create mode 100644 net/xl2tpd/Makefile create mode 100644 net/xl2tpd/README create mode 100644 net/xl2tpd/files/l2tp.sh create mode 100644 net/xl2tpd/files/options.xl2tpd create mode 100644 net/xl2tpd/files/xl2tp-secrets create mode 100644 net/xl2tpd/files/xl2tpd.conf create mode 100644 net/xl2tpd/files/xl2tpd.conf.sample create mode 100644 net/xl2tpd/files/xl2tpd.init create mode 100644 net/xl2tpd/patches/100-makefile_opt_flags.patch create mode 100644 net/xl2tpd/patches/110-makefile_dont_build_pfc.patch create mode 100644 net/xl2tpd/patches/120-kernel-mode-l2tp.patch create mode 100644 net/xl2tpd/patches/130-no-kill-ipparam.patch create mode 100644 net/xsupplicant/Makefile create mode 100644 net/xsupplicant/patches/001-no-lfl.patch create mode 100644 net/xsupplicant/patches/002-disable-procfs-check.patch create mode 100644 net/xsupplicant/patches/003-compile_fix.patch create mode 100644 net/xsupplicant/patches/005-no_private_linux_header_includes.patch create mode 100644 net/xsupplicant/patches/006-no_wireless_h.patch create mode 100644 net/xtables-addons/Makefile create mode 100644 net/xtables-addons/patches/001-no_depmod.patch create mode 100644 net/xtables-addons/patches/002-fix-kernel-version-detection.patch create mode 100644 net/xtables-addons/patches/003-redundant-bracket.patch create mode 100644 net/xtables-addons/patches/004-linux_3_3_compat.patch create mode 100644 net/xtables-addons/patches/005-powerpc_includes.patch create mode 100644 net/xtables-addons/patches/100-add-rtsp-conntrack.patch create mode 100644 net/xtables-addons/patches/200-add-lua-packetscript.patch create mode 100644 net/xtables-addons/patches/201-fix-lua-packetscript.patch create mode 100644 net/yaddns/Makefile create mode 100644 net/yaddns/files/etc/config/ddns create mode 100644 net/yaddns/files/etc/hotplug.d/iface/25-ddns create mode 100644 net/yaddns/files/usr/lib/ddns/services create mode 100644 net/yafc/Makefile create mode 100644 net/yate/Makefile create mode 100644 net/yate/patches/100-add_dn_skipname_missing_from_many_libresolv.patch create mode 100644 net/znc/Makefile create mode 100644 net/znc/files/znc.conf create mode 100644 net/znc/files/znc.init create mode 100644 net/znc/patches/001-move_rootcheck_after_config.patch create mode 100644 net/znc/patches/002-Uclibcpp_build_fix.patch create mode 100644 net/znc/patches/003-Reduce_rebuild_time.patch create mode 100644 skels/Makefile.template create mode 100644 skels/files/package.conf create mode 100755 skels/files/package.init create mode 100644 sound/cmus/Makefile create mode 100644 sound/cmus/patches/010-do_not_use_ACS_VLINE.patch create mode 100644 sound/empcd/Makefile create mode 100644 sound/flite/Makefile create mode 100644 sound/flite/patches/100-shared_libs create mode 100644 sound/ices/Makefile create mode 100644 sound/lame/Makefile create mode 100644 sound/lame/patches/001-automake-compat.patch create mode 100644 sound/listener/Makefile create mode 100644 sound/listener/files/listener.conf create mode 100644 sound/listener/patches/100-makefile.patch create mode 100644 sound/madplay/Makefile create mode 100644 sound/mocp/Makefile create mode 100644 sound/mocp/patches/001-moc-ffmpeg-update.patch create mode 100644 sound/mpc/Makefile create mode 100644 sound/mpc/files/pls-handler.sh create mode 100644 sound/mpd/Makefile create mode 100644 sound/mpd/files/mpd.init create mode 100644 sound/mpd/files/mpd.service create mode 100644 sound/mpd/patches/100-compile-fixes.patch create mode 100644 sound/mpdas/Makefile create mode 100644 sound/mpdas/files/mpdas.init create mode 100644 sound/mpdas/files/mpdasrc create mode 100644 sound/mpdas/patches/001-flags.patch create mode 100644 sound/mt-daapd/Makefile create mode 100644 sound/mt-daapd/files/mt-daapd.init create mode 100644 sound/pianobar/Makefile create mode 100644 sound/pianobar/patches/001-verbose.patch create mode 100644 sound/pianobar/patches/002-force-symlinks.patch create mode 100644 sound/pulseaudio/Makefile create mode 100644 sound/pulseaudio/files/pulseaudio.init create mode 100644 sound/pulseaudio/patches/001-no_default_64mb_alloc.patch create mode 100644 sound/scmpc/Makefile create mode 100644 sound/scmpc/files/scmpc.init create mode 100644 sound/scmpc/patches/100-Rules.patch create mode 100644 sound/shell-fm/Makefile create mode 100644 sound/shell-fm/files/shell-fm.init create mode 100644 sound/shell-fm/files/shell-fm.rc create mode 100644 sound/sox/Makefile create mode 100644 sound/sox/patches/001-cross_compile.patch create mode 100644 sound/sox/patches/010-fix_uclibc_build_issue.patch create mode 100644 sound/streamripper/Makefile create mode 100644 utils/acpid/Makefile create mode 100644 utils/acpid/files/acpid.hotplug create mode 100644 utils/acpid/files/acpid.init create mode 100644 utils/acpid/files/default create mode 100644 utils/alsa-utils/Makefile create mode 100644 utils/alsa-utils/patches/100-uClibc-compat.patch create mode 100644 utils/anyremote/Makefile create mode 100644 utils/anyremote/files/anyremote.cfg create mode 100644 utils/anyremote/files/anyremote.init create mode 100644 utils/anyremote/patches/010-dont-add-host-includes.patch create mode 100644 utils/ap51-flash/Makefile create mode 100644 utils/ap51-flash/files/ap51-flash.config create mode 100644 utils/ap51-flash/files/ap51-flash.init create mode 100755 utils/ap51-flash/files/ap51-flash.sh create mode 100644 utils/at/Makefile create mode 100755 utils/at/files/atd.init create mode 100644 utils/at/patches/100-cross-compile.patch create mode 100644 utils/at/patches/110-getloadavg.patch create mode 100644 utils/avrdude/Makefile create mode 100644 utils/avrusbboot/Makefile create mode 100644 utils/avrusbboot/patches/001-fix_makefile.patch create mode 100644 utils/avrusbboot/patches/002-fix_compilation.patch create mode 100644 utils/bandwidthd/Makefile create mode 100644 utils/bandwidthd/files/bandwidthd.config create mode 100644 utils/bandwidthd/files/bandwidthd.init create mode 100644 utils/bandwidthd/files/logo.gif create mode 100644 utils/bandwidthd/patches/010-dont-add-host-paths.patch create mode 100644 utils/bandwidthd/patches/100-fix_config_file_location create mode 100644 utils/bash-completion/Makefile create mode 100644 utils/bash/Makefile create mode 100644 utils/bash/patches/001-compile-fix.patch create mode 100644 utils/bash/patches/002-force-internal-readline.patch create mode 100644 utils/bash/patches/101-upstream-bash42-001.patch create mode 100644 utils/bash/patches/102-upstream-bash42-002.patch create mode 100644 utils/bash/patches/103-upstream-bash42-003.patch create mode 100644 utils/bash/patches/104-upstream-bash42-004.patch create mode 100644 utils/bash/patches/105-upstream-bash42-005.patch create mode 100644 utils/bash/patches/106-upstream-bash42-006.patch create mode 100644 utils/bash/patches/107-upstream-bash42-007.patch create mode 100644 utils/bash/patches/108-upstream-bash42-008.patch create mode 100644 utils/bash/patches/109-upstream-bash42-009.patch create mode 100644 utils/bash/patches/110-upstream-bash42-010.patch create mode 100644 utils/bash/patches/111-upstream-bash42-011.patch create mode 100644 utils/bash/patches/112-upstream-bash42-012.patch create mode 100644 utils/bash/patches/113-upstream-bash42-013.patch create mode 100644 utils/bash/patches/114-upstream-bash42-014.patch create mode 100644 utils/bash/patches/115-upstream-bash42-015.patch create mode 100644 utils/bash/patches/116-upstream-bash42-016.patch create mode 100644 utils/bash/patches/117-upstream-bash42-017.patch create mode 100644 utils/bash/patches/118-upstream-bash42-018.patch create mode 100644 utils/bash/patches/119-upstream-bash42-019.patch create mode 100644 utils/bash/patches/120-upstream-bash42-020.patch create mode 100644 utils/bash/patches/121-upstream-bash42-021.patch create mode 100644 utils/bash/patches/122-upstream-bash42-022.patch create mode 100644 utils/bash/patches/123-upstream-bash42-023.patch create mode 100644 utils/bash/patches/124-upstream-bash42-024.patch create mode 100644 utils/bash/patches/125-upstream-bash42-025.patch create mode 100644 utils/bash/patches/126-upstream-bash42-026.patch create mode 100644 utils/bash/patches/127-upstream-bash42-027.patch create mode 100644 utils/bash/patches/128-upstream-bash42-028.patch create mode 100644 utils/bash/patches/129-no_doc.patch create mode 100644 utils/bc/Makefile create mode 100644 utils/bc/patches/001-disable-doc.patch create mode 100644 utils/bemused/Makefile create mode 100644 utils/bemused/files/bemused-bookmarks create mode 100644 utils/bemused/files/bemused.conf create mode 100644 utils/bemused/files/bemused.init create mode 100644 utils/bemused/patches/110-missing_includes.patch create mode 100644 utils/bemused/patches/200-cxx-compile-fixes.patch create mode 100644 utils/bluelog/Makefile create mode 100644 utils/bluelog/files/bluelog.init create mode 100644 utils/bluez-hcidump/Makefile create mode 100644 utils/bluez-utils/Makefile create mode 100644 utils/bluez-utils/files/bluetooth.config create mode 100644 utils/bluez-utils/files/bluetooth.dbus create mode 100644 utils/bluez-utils/files/bluez-utils.init create mode 100644 utils/bluez-utils/files/givepin create mode 100644 utils/bluez-utils/patches/001-include_limits.patch create mode 100644 utils/bluez-utils/patches/002-hcid_pin_helper.patch create mode 100644 utils/bluez-utils/patches/100-enokey.patch create mode 100644 utils/bluez-utils/patches/200-uart-speed.patch create mode 100644 utils/boblight/Makefile create mode 100644 utils/boblight/files/boblight.init create mode 100644 utils/bonnie++/Makefile create mode 100644 utils/bonnie++/patches/001-cross_compile_fix.patch create mode 100644 utils/bonnie++/patches/002-add-verbose-error-messages.patch create mode 100644 utils/boxbackup/Makefile create mode 100755 utils/boxbackup/files/bbstoreaccounts create mode 100644 utils/boxbackup/files/bbstored.config create mode 100644 utils/boxbackup/files/bbstored.init create mode 100644 utils/boxbackup/files/bbstored.sh create mode 100644 utils/bsdiff/Makefile create mode 100644 utils/bsdiff/patches/001-makefile.patch create mode 100644 utils/btrfs-progs/Makefile create mode 100644 utils/btrfs-progs/files/btrfs-scan.init create mode 100644 utils/btrfs-progs/patches/001-Makefile-gcc-fix create mode 100644 utils/byobu/Makefile create mode 100644 utils/bzip2/Makefile create mode 100644 utils/calcurse/Makefile create mode 100644 utils/calvaria/Makefile create mode 100644 utils/calvaria/files/src/Makefile create mode 100644 utils/calvaria/files/src/cal2p54.c create mode 100644 utils/calvaria/files/src/calvaria.c create mode 100644 utils/ccid/Makefile create mode 100644 utils/ccrypt/Makefile create mode 100644 utils/ccrypt/patches/001-no-intl.patch create mode 100644 utils/cdparanoia/Makefile create mode 100644 utils/cdparanoia/patches/002-fixbecrash-private-keyword.patch create mode 100644 utils/cdparanoia/patches/010-fix_configure.patch create mode 100644 utils/cksfv/Makefile create mode 100644 utils/clish/Makefile create mode 100644 utils/cmdpad/Makefile create mode 100644 utils/cmdpad/files/cmdpad.init create mode 100644 utils/cmdpad/patches/100-Makefile.patch create mode 100644 utils/cmdpad/patches/120-kernel26-compat.patch create mode 100644 utils/cmdpad/patches/130-no_zombie.patch create mode 100644 utils/cmdpad/patches/140-compile_fix.patch create mode 100644 utils/collectd/Makefile create mode 100644 utils/collectd/files/collectd.conf create mode 100644 utils/collectd/files/collectd.init create mode 100644 utils/collectd/patches/001-undefined-AM_PATH_LIBGCRYPT.patch create mode 100644 utils/collectd/patches/003-remove-werror.patch create mode 100644 utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch create mode 100644 utils/collectd/patches/110-net-device-stats.patch create mode 100644 utils/collectd/patches/120-fix_kernel_2.6.37.patch create mode 100644 utils/collectd/patches/130-fix_netlink_kernel_3.3-patch create mode 100644 utils/collectd/patches/200-fix-git-describe-error.patch create mode 100644 utils/collectd/patches/400-fix-olsrd-get-all.patch create mode 100644 utils/collectd/patches/900-add-iwinfo-plugin.patch create mode 100644 utils/coreutils/Makefile create mode 100644 utils/coreutils/patches/001-no_docs_man_tests.patch create mode 100644 utils/coreutils/patches/002-fix_compile_with_uclibc.patch create mode 100644 utils/cpusage/Makefile create mode 100644 utils/cpusage/src/cpusage.c create mode 100644 utils/crypto-tools/Makefile create mode 100644 utils/cryptsetup/Makefile create mode 100644 utils/cwiid/Makefile create mode 100644 utils/cwiid/patches/100-dump_gtk_wmdemo.patch create mode 100644 utils/daemontools/Makefile create mode 100644 utils/daemontools/patches/crosscompile.patch create mode 100644 utils/daemontools/patches/svscanboot.patch create mode 100644 utils/dash/Makefile create mode 100644 utils/dbus/Makefile create mode 100644 utils/dbus/files/dbus-launch create mode 100644 utils/dbus/files/dbus.init create mode 100644 utils/deco/Makefile create mode 100644 utils/deco/patches/100-tty.c.patch create mode 100644 utils/devio/Makefile create mode 100644 utils/devmem2/Makefile create mode 100644 utils/devmem2/src/Makefile create mode 100644 utils/devmem2/src/devmem2.c create mode 100644 utils/dfu-util/Makefile create mode 100644 utils/dfu-util/patches/001-no_static_binary.patch create mode 100644 utils/dialog/Makefile create mode 100644 utils/digitemp/Makefile create mode 100644 utils/dir300-flash/Makefile create mode 100644 utils/disktype/Makefile create mode 100644 utils/dmidecode/Makefile create mode 100644 utils/dosfstools/Makefile create mode 100644 utils/dosfstools/files/dosfsck.sh create mode 100644 utils/dosfstools/patches/002-linux_26_headers.patch create mode 100644 utils/dstat/Makefile create mode 100644 utils/dt/Makefile create mode 100644 utils/dtach/Makefile create mode 100644 utils/empty/Makefile create mode 100644 utils/event_test/Makefile create mode 100644 utils/event_test/src/Makefile create mode 100644 utils/event_test/src/evtest.c create mode 100644 utils/fancontroled/Makefile create mode 100644 utils/fancontroled/files/fancontroled.init create mode 100644 utils/firmwarehotplug/Makefile create mode 100644 utils/firmwarehotplug/patches/001-no_documentation.patch create mode 100644 utils/firmwarehotplug/patches/100-compile-fixes.patch create mode 100644 utils/flashrom/Makefile create mode 100644 utils/flashrom/patches/001-msr_dev_path.patch create mode 100644 utils/fortune-mod/Makefile create mode 100644 utils/fortune-mod/patches/01-strfile-64bit-fix create mode 100644 utils/fowsr/Makefile create mode 100644 utils/foxboard-utils/Makefile create mode 100644 utils/freecwmp/Config.in create mode 100644 utils/freecwmp/Makefile create mode 100644 utils/freecwmp/files/freecwmpd.init create mode 100644 utils/fxload/Makefile create mode 100644 utils/fxload/patches/010-compile_fix.patch create mode 100644 utils/gadgetfs-test/Makefile create mode 100644 utils/gadgetfs-test/patches/001-linux_usb_org_2007_11_29.patch create mode 100644 utils/gawk/Makefile create mode 100644 utils/gnokii/Makefile create mode 100644 utils/gnupg/Makefile create mode 100644 utils/gnuplot/Makefile create mode 100644 utils/gnuplot/patches/010-Makefile.in.patch create mode 100644 utils/gpiotoggling/Makefile create mode 100644 utils/gzip/Makefile create mode 100644 utils/gzip/patches/001-rsyncable.patch create mode 100644 utils/haserl/Makefile create mode 100644 utils/haveged/Makefile create mode 100644 utils/haveged/files/haveged.init create mode 100644 utils/hd-idle/Makefile create mode 100644 utils/hd-idle/files/hd-idle.config create mode 100644 utils/hd-idle/files/hd-idle.init create mode 100644 utils/hdparm/Makefile create mode 100644 utils/heyu/Makefile create mode 100644 utils/heyu/files/x10.conf create mode 100644 utils/heyu/patches/001-avoid_configure.patch create mode 100644 utils/hplip/Makefile create mode 100644 utils/hplip/files/20-hplip create mode 100644 utils/hplip/files/hplib.conf create mode 100644 utils/huaweiaktbbo/Makefile create mode 100644 utils/huaweiaktbbo/src/huaweiAktBbo.c create mode 100644 utils/i2c-tools/Makefile create mode 100644 utils/i2c-tools/patches/100-linux_include.patch create mode 100644 utils/ink/Makefile create mode 100644 utils/input-utils/Makefile create mode 100644 utils/input-utils/patches/001-EVIOCGKEYCODE2.patch create mode 100644 utils/input-utils/patches/002-version-check.patch create mode 100644 utils/io/Makefile create mode 100644 utils/io/src/io.c create mode 100644 utils/ipmitool/Makefile create mode 100644 utils/ipmitool/patches/100-cubic_root.patch create mode 100644 utils/ipmitool/patches/101-cross_compile.patch create mode 100644 utils/joe/Makefile create mode 100644 utils/joe/patches/001-mathaway.patch create mode 100644 utils/klish/Makefile create mode 100644 utils/kmemtrace-user/Makefile create mode 100644 utils/lcd4linux-tew673gru/Makefile create mode 100644 utils/lcd4linux-tew673gru/files/lcd4linux_tew673gru.conf create mode 100644 utils/lcd4linux-tew673gru/files/openwrt_220x176.png create mode 100755 utils/lcd4linux-tew673gru/files/tew673gru-lcd create mode 100644 utils/lcd4linux/Config.in create mode 100644 utils/lcd4linux/Makefile create mode 100644 utils/lcd4linux/files/lcd4linux.init create mode 100644 utils/lcd4linux/patches/100-drv_RouterBoard.patch create mode 100644 utils/lcd4linux/patches/110-uclibc-logarithm-fix.patch create mode 100644 utils/lcd4linux/patches/120-remove-as-needed-linker-option.patch create mode 100644 utils/lcd4linux/patches/140-no_repnop_T6963.patch create mode 100644 utils/lcd4linux/patches/150-addlibmpdclient.patch create mode 100644 utils/lcd4linux/patches/160-uinput_defs.patch create mode 100644 utils/lcd4linux/patches/170-add-generic-spidev-driver.patch create mode 100644 utils/lcd4linux/patches/171-allow-to-specify-drv_generic_graphic_real_clear.patch create mode 100644 utils/lcd4linux/patches/172-add-TEW673GRU-driver.patch create mode 100644 utils/lcdproc/Makefile create mode 100755 utils/lcdproc/files/LCDd create mode 100755 utils/lcdproc/files/lcdexec create mode 100755 utils/lcdproc/files/lcdproc create mode 100755 utils/lcdproc/files/lcdvc create mode 100644 utils/less/Makefile create mode 100644 utils/lilo/Makefile create mode 100644 utils/lilo/files/README create mode 100644 utils/lilo/files/bdlilo.conf create mode 100644 utils/lilo/files/boot.msg create mode 100644 utils/lilo/files/lilo.conf create mode 100755 utils/lilo/files/mkbootable create mode 100644 utils/lirc/Makefile create mode 100644 utils/lm-sensors/Makefile create mode 100644 utils/lm-sensors/files/sensors.conf create mode 100644 utils/lmbench/Makefile create mode 100644 utils/lmbench/patches/001-fix_socklen_t_define.patch create mode 100644 utils/lmbench/patches/002-install-cache.patch create mode 100644 utils/lmbench/patches/003-add-LDLIBS.patch create mode 100644 utils/lmbench/patches/100-bw_mem-add-newline-after-usage.patch create mode 100644 utils/logrotate/Makefile create mode 100644 utils/logrotate/files/logrotate.conf create mode 100644 utils/loop-aes/Makefile create mode 100644 utils/loop-aes/patches/001-no_sync.patch create mode 100644 utils/lrzsz/Makefile create mode 100644 utils/lrzsz/patches/100-install_delete_fix.patch create mode 100644 utils/lsof/Makefile create mode 100644 utils/lsof/patches/001-lsof_makefile.patch create mode 100644 utils/lsof/patches/002-lsof_noportmap.patch create mode 100644 utils/lsof/patches/003-lsof_selinux.patch create mode 100644 utils/lsof/patches/004-lsof_ccv.patch create mode 100644 utils/lvm2/Makefile create mode 100644 utils/lvm2/files/lvm2.init create mode 100644 utils/lvm2/patches/000-compile.patch create mode 100644 utils/macchanger/Makefile create mode 100644 utils/maemo-kexec/Config.in create mode 100644 utils/maemo-kexec/Makefile create mode 100755 utils/maemo-kexec/files/sbin/bootmaemo create mode 100644 utils/mc/Config.in create mode 100644 utils/mc/Makefile create mode 100644 utils/md5deep/Makefile create mode 100644 utils/md5deep/patches/101-cross_compile.patch create mode 100644 utils/mdadm/Makefile create mode 100644 utils/mdadm/patches/000-compile.patch create mode 100644 utils/mdadm/patches/100-cross_compile.patch create mode 100644 utils/memtester/Makefile create mode 100644 utils/memtester/patches/100-quiet.diff create mode 100644 utils/mg/Makefile create mode 100644 utils/mgetty/Makefile create mode 100644 utils/mgetty/patches/001-mgetty.patch create mode 100644 utils/microcom/Makefile create mode 100644 utils/microcom/patches/001-cross_compile.patch create mode 100644 utils/minicom/Makefile create mode 100644 utils/minicom/patches/010-resolve-getline-conflict.patch create mode 100644 utils/mksh/Makefile create mode 100644 utils/mksh/patches/100-dot_mkshrc create mode 100644 utils/msr-tools/Makefile create mode 100644 utils/msr-tools/patches/100-multiprocessor.patch create mode 100644 utils/mtd-utils/Makefile create mode 100644 utils/mtd-utils/patches/100-mtd-debug-add-bad-block-counter.patch create mode 100644 utils/mtd-utils/patches/130-lzma_jffs2.patch create mode 100644 utils/mtd-utils/patches/131-fix_lib_compile.patch create mode 100644 utils/mtd-utils/patches/135-mkubifs_optional_lzo.patch create mode 100644 utils/mtd-utils/patches/136-mkubifs-fix-rinoperm-options.patch create mode 100644 utils/mtd-utils/patches/137-mkubifs-allow-to-overwrite-volume-data.patch create mode 100644 utils/mtd-utils/patches/150-fix_ubi-utils_static.patch create mode 100644 utils/nano/Makefile create mode 100644 utils/ntfs-3g/Makefile create mode 100644 utils/ntfs-3g/patches-2011.4.12/001-options.patch create mode 100644 utils/ntfsprogs/Makefile create mode 100644 utils/ntfsprogs/patches/001-autoconf_fixes.patch create mode 100644 utils/nvramtool/Makefile create mode 100644 utils/open2300/Makefile create mode 100644 utils/open2300/patches/x1.patch create mode 100644 utils/open2300/patches/x2.patch create mode 100644 utils/owfs/Makefile create mode 100644 utils/oww/Makefile create mode 100644 utils/oww/files/oww.init create mode 100644 utils/pciutils/Makefile create mode 100644 utils/pciutils/patches/100-remove-no-timestamping.patch create mode 100644 utils/pciutils/patches/101-no-strip.patch create mode 100644 utils/pciutils/patches/102-compressed-ids.patch create mode 100644 utils/pciutils/patches/103-relative-path-ids.patch create mode 100644 utils/pciutils/patches/104-resolv.patch create mode 100644 utils/pcmciautils/Makefile create mode 100644 utils/pcmciautils/files/etc/hotplug.d/pcmcia/pcmcia.agent create mode 100644 utils/pcmciautils/files/etc/hotplug.d/pcmcia_socket/pcmcia_socket.agent create mode 100755 utils/pcmciautils/files/etc/init.d/pcmcia create mode 100755 utils/pcmciautils/files/etc/init.d/pcmcia_socket create mode 100644 utils/pcsc-lite/Makefile create mode 100644 utils/pcsc-lite/files/pcscd.init create mode 100644 utils/petitboot/Makefile create mode 100644 utils/petitboot/files/petitboot.init create mode 100644 utils/petitboot/patches/010-petitboot-fixups.diff create mode 100644 utils/petitboot/patches/020-petitboot-fix-pb-twin.diff create mode 100644 utils/petitboot/petitboot-config.in create mode 100644 utils/picocom/Makefile create mode 100644 utils/pipacs/Makefile create mode 100644 utils/pipacs/src/Makefile create mode 100644 utils/pipacs/src/parser.c create mode 100644 utils/pipacs/src/parser.h create mode 100644 utils/pipacs/src/pipacs.c create mode 100644 utils/powertop/Makefile create mode 100644 utils/powertop/patches/100-no-wide-ncurses.patch create mode 100644 utils/powertop/patches/200-no-gettext.patch create mode 100644 utils/pps-tools/Makefile create mode 100644 utils/pps-tools/patches/001-source.patch create mode 100644 utils/procps/Makefile create mode 100644 utils/procps/patches/010-make_fix.patch create mode 100644 utils/procps/patches/020_hz_fix.patch create mode 100644 utils/psmisc/Makefile create mode 100644 utils/psplash/Makefile create mode 100644 utils/psplash/files/image_480x640.h create mode 100644 utils/psplash/files/image_generic.h create mode 100755 utils/psplash/files/psplash.init create mode 100644 utils/psplash/patches/000-adjust-for-openwrt.patch create mode 100644 utils/psplash/patches/001-hide-msgfield-and-progressbar.patch create mode 100644 utils/pv/Makefile create mode 100644 utils/pwcrypt/Makefile create mode 100644 utils/pwgen/Makefile create mode 100644 utils/rcs/Makefile create mode 100644 utils/rcs/patches/000-debian.patch create mode 100644 utils/rcs/patches/100-cross_compile.patch create mode 100644 utils/rdiff-backup/Makefile create mode 100644 utils/rdiff-backup/patches/001-python_path.patch create mode 100644 utils/reiserfsprogs/Makefile create mode 100644 utils/remind/Makefile create mode 100644 utils/restorefactory/Makefile create mode 100755 utils/restorefactory/files/hotplug_restorefactory create mode 100755 utils/restorefactory/files/uci_defaults_restorefactory create mode 100644 utils/rng-tools/Makefile create mode 100644 utils/rng-tools/files/rngd.init create mode 100644 utils/rrdcollect/Makefile create mode 100644 utils/rrdcollect/files/rrd.conf create mode 100644 utils/rrdcollect/files/rrd.sh create mode 100644 utils/rrdcollect/files/rrdcollect.conf create mode 100644 utils/rrdcollect/files/rrdcollect.init create mode 100644 utils/rrdtool/Makefile create mode 100644 utils/rrdtool/patches/010-dont-add-host-include-paths.patch create mode 100644 utils/rrdtool/patches/020-x86-float-cast.patch create mode 100644 utils/rrdtool/patches/030-automake-compat.patch create mode 100644 utils/rsyncrypto/Makefile create mode 100644 utils/sane-backends/Makefile create mode 100644 utils/sane-backends/patches/000-upstream-libv4l.patch create mode 100644 utils/sane-backends/patches/001-upstream-keep-usb-device.patch create mode 100644 utils/sane-backends/patches/002-remove-uneeded.patch create mode 100644 utils/sane-backends/patches/010-dont-add-host-include-path.patch create mode 100644 utils/sane-backends/patches/020-non-i386-qcam.patch create mode 100644 utils/schedtools/Makefile create mode 100644 utils/scponly/Makefile create mode 100644 utils/scponly/patches/001-elif_else_replacement.patch create mode 100644 utils/screen/Makefile create mode 100644 utils/screen/files/etc/screenrc create mode 100644 utils/screen/patches/100-cross_compile_fix.patch create mode 100644 utils/sdparm/Makefile create mode 100644 utils/sed/Makefile create mode 100644 utils/setpwc/Makefile create mode 100644 utils/setserial/Makefile create mode 100644 utils/setserial/files/setserial.config create mode 100644 utils/setserial/files/setserial.init create mode 100644 utils/setserial/patches/100-compile-fixes.patch create mode 100644 utils/sg3-utils/Makefile create mode 100644 utils/shadow/Makefile create mode 100644 utils/shadow/patches/004-disable-ruser-lookup.patch create mode 100644 utils/sierra-pcmcia/Makefile create mode 100644 utils/sispmctl/Makefile create mode 100644 utils/smartmontools/Makefile create mode 100644 utils/smartmontools/files/smartd.conf create mode 100644 utils/smartmontools/files/smartd.init create mode 100644 utils/ssldump/Makefile create mode 100644 utils/ssldump/patches/001-missing_headers.patch create mode 100644 utils/strace/Makefile create mode 100644 utils/strace/patches-4.5.16/001-arm_eabi_syscalls.patch create mode 100644 utils/strace/patches-4.5.16/002-arm_bad_syscall.patch create mode 100644 utils/strace/patches-4.5.16/003-avr32_support.patch create mode 100644 utils/strace/patches-4.5.16/004-mips64_support.patch create mode 100644 utils/strace/patches-4.5.16/004-no_cacheflush.patch create mode 100644 utils/strace/patches-4.5.16/010-cris_support.patch create mode 100644 utils/stress/Makefile create mode 100644 utils/sysstat/Makefile create mode 100644 utils/sysstat/files/config create mode 100755 utils/sysstat/files/sysstat.init create mode 100644 utils/tar/Makefile create mode 100644 utils/taskwarrior/Makefile create mode 100644 utils/tcpser/Makefile create mode 100644 utils/tcsh/Makefile create mode 100644 utils/tcsh/patches/001-gethost create mode 100644 utils/tcsh/patches/002-NLS create mode 100644 utils/tesseract/Makefile create mode 100644 utils/testusb/Makefile create mode 100644 utils/testusb/src/testusb.c create mode 100644 utils/time/Makefile create mode 100644 utils/time/patches/001-fix-configure.patch create mode 100644 utils/time/patches/002-fix-rusage.patch create mode 100644 utils/tmux/Makefile create mode 100644 utils/tmux/patches/100-b64_ntop-conflict.patch create mode 100644 utils/triggerhappy/Makefile create mode 100644 utils/triggerhappy/files/triggerhappy-example.conf create mode 100644 utils/triggerhappy/files/triggerhappy.hotplug create mode 100644 utils/triggerhappy/files/triggerhappy.init create mode 100644 utils/triggerhappy/patches/100-fix-LINUX_INPUT_H.patch create mode 100644 utils/unrar/Makefile create mode 100644 utils/unzip/Makefile create mode 100644 utils/upx/Makefile create mode 100644 utils/upx/patches/100-disable_doc.patch create mode 100644 utils/usb-modeswitch-data/Makefile create mode 100644 utils/usb-modeswitch/Makefile create mode 100644 utils/usb-modeswitch/files/modeswitch.hotplug create mode 100644 utils/usbmuxd/Makefile create mode 100644 utils/usbutils/Makefile create mode 100644 utils/usbutils/patches/100-ids-relative-path.patch create mode 100644 utils/usbutils/patches/110-gzip-update-usbids.patch create mode 100644 utils/valgrind/Makefile create mode 100644 utils/valgrind/files/default.supp create mode 100644 utils/valgrind/patches/100-fix_configure_check.patch create mode 100644 utils/valgrind/patches/110-add_a_out_h.patch create mode 100644 utils/valgrind/src/abort.c create mode 100644 utils/vim/Makefile create mode 100644 utils/vim/files/vimrc create mode 100644 utils/vim/files/vimrc.full create mode 100644 utils/vim/patches/001-cross_compile.patch create mode 100644 utils/watchcat/Makefile create mode 100644 utils/watchcat/files/initd_watchcat create mode 100644 utils/watchcat/files/uci_defaults_watchcat create mode 100644 utils/watchcat/files/watchcat.sh create mode 100644 utils/wattsup/Makefile create mode 100644 utils/wattsup/src/Makefile create mode 100644 utils/wattsup/src/wattsup.c create mode 100644 utils/wifitoggle/Makefile create mode 100755 utils/wifitoggle/files/wifitoggle.config create mode 100755 utils/wifitoggle/files/wifitoggle.hotplug create mode 100644 utils/wview/Makefile create mode 100644 utils/wview/files/etc/init.d/wview create mode 100644 utils/wview/patches/010-fix-cross-compile.patch create mode 100644 utils/wview/patches/020-use-standard-awk.patch create mode 100644 utils/wx200d/Makefile create mode 100644 utils/xdelta3/Makefile create mode 100644 utils/xdelta3/patches/001-decrease-default-window-size.patch create mode 100644 utils/zile/Makefile create mode 100644 utils/zip/Makefile create mode 100644 utils/zoneinfo/Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6ffab9a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.orig +*.rej diff --git a/admin/debootstrap/Makefile b/admin/debootstrap/Makefile new file mode 100644 index 0000000..63d98fa --- /dev/null +++ b/admin/debootstrap/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2010 Gianluigi Tiesi +# Copyright (C) 2011-2012 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:=debootstrap +PKG_VERSION:=1.0.42 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb +PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap +PKG_MD5SUM:=749638b8afc0c3e2a06c9b31cfe40b55 + +UNPACK_CMD=ar -p "$(DL_DIR)/$(PKG_SOURCE)" data.tar.xz | xzcat | tar -C $(1) -xf - + +include $(INCLUDE_DIR)/package.mk + +define Package/debootstrap + SECTION:=admin + CATEGORY:=Administration + TITLE:=Bootstrap a basic Debian system + URL:=http://wiki.debian.org/Debootstrap + DEPENDS:=+coreutils-chroot +coreutils-sha1sum + MAINTAINER:=Luka Perkov +endef + +define Package/debootstrap/description + debootstrap is used to create a Debian base system from scratch, without + requiring the availability of dpkg or apt. It does this by downloading .deb + files from a mirror site, and carefully unpacking them into a directory which + can eventually be chrooted into. +endef + +define Build/Compile +# file pkgdetails.c was imported from debian package base-installer version 1.123 + $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) ./files/pkgdetails.c -o $(PKG_BUILD_DIR)/usr/share/debootstrap/pkgdetails +endef + +define Package/debootstrap/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/usr/sbin/$(PKG_NAME) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/share/debootstrap + $(INSTALL_BIN) $(PKG_BUILD_DIR)/usr/share/debootstrap/pkgdetails $(1)/usr/share/debootstrap + $(INSTALL_DATA) $(PKG_BUILD_DIR)/usr/share/debootstrap/functions $(1)/usr/share/debootstrap + $(INSTALL_DIR) $(1)/usr/share/debootstrap/scripts + $(INSTALL_DATA) $(PKG_BUILD_DIR)/usr/share/debootstrap/scripts/* $(1)/usr/share/debootstrap/scripts +endef + +$(eval $(call BuildPackage,debootstrap)) diff --git a/admin/debootstrap/files/pkgdetails.c b/admin/debootstrap/files/pkgdetails.c new file mode 100644 index 0000000..99ee190 --- /dev/null +++ b/admin/debootstrap/files/pkgdetails.c @@ -0,0 +1,347 @@ +#include +#include +#include +#include +#include +#include + +#define MAX_LINE 1000 +#define MAX_PKGS 100 + +char *checksum_field=NULL; + +static void oom_die(void) +{ + fputs("Out of memory!\n", stderr); + exit(1); +} + +static char *xvasprintf(const char *fmt, va_list ap) { + char *ret; + + if (vasprintf (&ret, fmt, ap) < 0) { + if (errno == ENOMEM) + oom_die(); + return NULL; + } + return ret; +} + +static char *xasprintf(const char *fmt, ...) { + va_list ap; + char *ret; + + va_start(ap, fmt); + ret = xvasprintf(fmt, ap); + va_end(ap); + return ret; +} + +static char *fieldcpy(char *dst, char *fld) { + while (*fld && *fld != ':') + fld++; + if (!*(fld++)) + return NULL; + while (isspace(*fld)) fld++; + return strcpy(dst, fld); +} + +static void outputdeps(char *deps) { + char *pch = deps; + + while (1) { + while (isspace(*pch)) pch++; + if (!*pch) break; + + while (*pch && *pch != '(' && *pch != '|' && *pch != ',' + && !isspace(*pch)) + { + fputc(*pch++, stdout); + } + fputc('\n', stdout); + while (*pch && *pch++ != ',') (void)NULL; + } +} + +static void dogetdeps(char *pkgsfile, char **in_pkgs, int pkgc) { + char buf[MAX_LINE]; + char cur_pkg[MAX_LINE]; + char cur_deps[MAX_LINE]; + char cur_predeps[MAX_LINE]; + char prev_pkg[MAX_LINE]; + char *pkgs[MAX_PKGS]; + int i; + int skip; + FILE *f; + int output_pkg = -1; + + cur_pkg[0] = cur_deps[0] = cur_predeps[0] = prev_pkg[0] = '\0'; + + for (i = 0; i < pkgc; i++) pkgs[i] = in_pkgs[i]; + + f = fopen(pkgsfile, "r"); + if (f == NULL) { + perror(pkgsfile); + exit(1); + } + + skip = 1; + while (fgets(buf, sizeof(buf), f)) { + if (*buf && buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0'; + if (strncasecmp(buf, "Package:", 8) == 0) { + int any = 0; + skip = 1; + fieldcpy(cur_pkg, buf); + if (strcmp(cur_pkg, prev_pkg) != 0) { + if (output_pkg != -1) + pkgs[output_pkg] = NULL; + if (cur_deps[0]) + outputdeps(cur_deps); + if (cur_predeps[0]) + outputdeps(cur_predeps); + strcpy(prev_pkg, cur_pkg); + } + cur_deps[0] = cur_predeps[0] = '\0'; + output_pkg = -1; + for (i = 0; i < pkgc; i++) { + if (!pkgs[i]) continue; + any = 1; + if (strcmp(cur_pkg, pkgs[i]) == 0) { + skip = 0; + output_pkg = i; + break; + } + } + if (!any) break; + } else if (!skip && strncasecmp(buf, "Depends:", 8) == 0) + fieldcpy(cur_deps, buf); + else if (!skip && strncasecmp(buf, "Pre-Depends:", 12) == 0) + fieldcpy(cur_predeps, buf); + } + if (cur_deps[0]) + outputdeps(cur_deps); + if (cur_predeps[0]) + outputdeps(cur_predeps); + fclose(f); +} + +static void dopkgmirrorpkgs(int uniq, char *mirror, char *pkgsfile, + char *fieldname, char **in_pkgs, int pkgc) +{ + char buf[MAX_LINE]; + char cur_field[MAX_LINE]; + char cur_pkg[MAX_LINE]; + char cur_ver[MAX_LINE]; + char cur_arch[MAX_LINE]; + char cur_size[MAX_LINE]; + char cur_checksum[MAX_LINE]; + char cur_filename[MAX_LINE]; + char prev_pkg[MAX_LINE]; + char *pkgs[MAX_PKGS]; + int i; + FILE *f; + char *output = NULL; + int output_pkg = -1; + + cur_field[0] = cur_pkg[0] = cur_ver[0] = cur_arch[0] = cur_filename[0] = prev_pkg[0] = '\0'; + + for (i = 0; i < pkgc; i++) pkgs[i] = in_pkgs[i]; + + f = fopen(pkgsfile, "r"); + if (f == NULL) { + perror(pkgsfile); + exit(1); + } + while (fgets(buf, sizeof(buf), f)) { + if (*buf && buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0'; + if (strncasecmp(buf, fieldname, strlen(fieldname)) == 0) { + fieldcpy(cur_field, buf); + } + if (strncasecmp(buf, "Package:", 8) == 0) { + fieldcpy(cur_pkg, buf); + if (strcmp(cur_pkg, prev_pkg) != 0) { + if (output) + fputs(output, stdout); + if (uniq && output_pkg != -1) + pkgs[output_pkg] = NULL; + strcpy(prev_pkg, cur_pkg); + } + free(output); + output = NULL; + output_pkg = -1; + } else if (strncasecmp(buf, "Version:", 8) == 0) { + fieldcpy(cur_ver, buf); + } else if (strncasecmp(buf, "Architecture:", 13) == 0) { + fieldcpy(cur_arch, buf); + } else if (strncasecmp(buf, "Size:", 5) == 0) { + fieldcpy(cur_size, buf); + } else if (strncasecmp(buf, checksum_field, strlen(checksum_field)) == 0 + && buf[strlen(checksum_field)] == ':') { + fieldcpy(cur_checksum, buf); + } else if (strncasecmp(buf, "Filename:", 9) == 0) { + fieldcpy(cur_filename, buf); + } else if (!*buf) { + int any = 0; + for (i = 0; i < pkgc; i++) { + if (!pkgs[i]) continue; + any = 1; + if (strcmp(cur_field, pkgs[i]) == 0) { + free(output); + output = xasprintf("%s %s %s %s %s %s %s\n", cur_pkg, cur_ver, cur_arch, mirror, cur_filename, cur_checksum, cur_size); + output_pkg = i; + break; + } + } + if (!any) break; + cur_field[0] = '\0'; + } + } + if (output) + fputs(output, stdout); + if (uniq && output_pkg != -1) + pkgs[output_pkg] = NULL; + fclose(f); + + /* any that weren't found are returned as "pkg -" */ + if (uniq) { + for (i = 0; i < pkgc; i++) { + if (pkgs[i]) { + printf("%s -\n", pkgs[i]); + } + } + } +} + +static void dopkgstanzas(char *pkgsfile, char **pkgs, int pkgc) +{ + char buf[MAX_LINE]; + char *accum; + size_t accum_size = 0, accum_alloc = MAX_LINE * 2; + char cur_pkg[MAX_LINE]; + FILE *f; + + accum = malloc(accum_alloc); + if (!accum) + oom_die(); + + f = fopen(pkgsfile, "r"); + if (f == NULL) { + perror(pkgsfile); + free(accum); + exit(1); + } + while (fgets(buf, sizeof(buf), f)) { + if (*buf) { + size_t len = strlen(buf); + if (accum_size + len + 1 > accum_alloc) { + accum_alloc = (accum_size + len + 1) * 2; + accum = realloc(accum, accum_alloc); + if (!accum) + oom_die(); + } + strcpy(accum + accum_size, buf); + accum_size += len; + } + if (*buf && buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0'; + if (strncasecmp(buf, "Package:", 8) == 0) { + fieldcpy(cur_pkg, buf); + } else if (!*buf) { + int i; + for (i = 0; i < pkgc; i++) { + if (!pkgs[i]) continue; + if (strcmp(cur_pkg, pkgs[i]) == 0) { + fputs(accum, stdout); + if (accum[accum_size - 1] != '\n') + fputs("\n\n", stdout); + else if (accum[accum_size - 2] != '\n') + fputc('\n', stdout); + break; + } + } + *accum = '\0'; + accum_size = 0; + } + } + fclose(f); + + free(accum); +} + +static int dotranslatewgetpercent(int low, int high, int end, char *str) { + int ch; + int val, lastval; + + /* print out anything that looks like a % on its own line, appropriately + * scaled */ + + lastval = val = 0; + while ( (ch = getchar()) != EOF ) { + if (isdigit(ch)) { + val *= 10; val += ch - '0'; + } else if (ch == '%') { + float f = (float) val / 100.0 * (high - low) + low; + if (str) { + printf("P: %d %d %s\n", (int) f, end, str); + } else { + printf("P: %d %d\n", (int) f, end); + } + lastval = val; + } else { + val = 0; + } + } + return lastval == 100; +} + +int main(int argc, char *argv[]) { + checksum_field=getenv("DEBOOTSTRAP_CHECKSUM_FIELD"); + if (checksum_field == NULL) { + checksum_field="MD5sum"; + } + + if ((argc == 6 || argc == 5) && strcmp(argv[1], "WGET%") == 0) { + if (dotranslatewgetpercent(atoi(argv[2]), atoi(argv[3]), + atoi(argv[4]), argc == 6 ? argv[5] : NULL)) + { + exit(0); + } else { + exit(1); + } + } else if (argc >= 4 && strcmp(argv[1], "GETDEPS") == 0) { + int i; + for (i = 3; argc - i > MAX_PKGS; i += MAX_PKGS) { + dogetdeps(argv[2], argv+i, MAX_PKGS); + } + dogetdeps(argv[2], argv+i, argc-i); + exit(0); + } else if (argc >= 5 && strcmp(argv[1], "PKGS") == 0) { + int i; + for (i = 4; argc - i > MAX_PKGS; i += MAX_PKGS) { + dopkgmirrorpkgs(1, argv[2], argv[3], "Package:", argv+i, MAX_PKGS); + } + dopkgmirrorpkgs(1, argv[2], argv[3], "Package:", argv+i, argc-i); + exit(0); + } else if (argc >= 6 && strcmp(argv[1], "FIELD") == 0) { + int i; + for (i = 5; argc - i > MAX_PKGS; i += MAX_PKGS) { + dopkgmirrorpkgs(0, argv[3], argv[4], argv[2], argv+i, MAX_PKGS); + } + dopkgmirrorpkgs(0, argv[3], argv[4], argv[2], argv+i, argc-i); + exit(0); + } else if (argc >= 4 && strcmp(argv[1], "STANZAS") == 0) { + int i; + for (i = 3; argc - i > MAX_PKGS; i += MAX_PKGS) { + dopkgstanzas(argv[2], argv+i, MAX_PKGS); + } + dopkgstanzas(argv[2], argv+i, argc-i); + exit(0); + } else { + fprintf(stderr, "usage: %s PKGS mirror packagesfile pkgs..\n", argv[0]); + fprintf(stderr, " or: %s FIELD field mirror packagesfile pkgs..\n", + argv[0]); + fprintf(stderr, " or: %s GETDEPS packagesfile pkgs..\n", argv[0]); + fprintf(stderr, " or: %s STANZAS packagesfile pkgs..\n", argv[0]); + fprintf(stderr, " or: %s WGET%% low high end reason\n", argv[0]); + exit(1); + } +} diff --git a/admin/debootstrap/patches/100-busybox_fix.patch b/admin/debootstrap/patches/100-busybox_fix.patch new file mode 100644 index 0000000..74875a0 --- /dev/null +++ b/admin/debootstrap/patches/100-busybox_fix.patch @@ -0,0 +1,11 @@ +--- a/usr/share/debootstrap/functions ++++ b/usr/share/debootstrap/functions +@@ -857,8 +857,6 @@ choose_extractor () { + + if [ -n "$EXTRACTOR_OVERRIDE" ]; then + extractor="$EXTRACTOR_OVERRIDE" +- elif type dpkg-deb >/dev/null 2>&1; then +- extractor="dpkg-deb" + else + extractor="ar" + fi diff --git a/admin/gkrellmd/Makefile b/admin/gkrellmd/Makefile new file mode 100644 index 0000000..d60bb1a --- /dev/null +++ b/admin/gkrellmd/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2007-2009 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:=gkrellmd +PKG_VERSION:=2.3.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=gkrellm-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://members.dslextreme.com/users/billw/gkrellm/ +PKG_MD5SUM:=009d8dddd3ce5cc83a4bb4d559ee922d + +PKG_BUILD_DIR:=$(BUILD_DIR)/gkrellm-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/gkrellmd + SECTION:=admin + CATEGORY:=Administration + DEPENDS:=+glib1 + TITLE:=The GNU Krell Monitors Server + URL:=http://gkrellm.net/ +endef + +define Package/gkrellmd/description + Gkrellmd Listens for connections from gkrellm clients. When + a gkrellm client connects to a gkrellmd server all builtin + monitors collect their data from the server. +endef + +define Package/gkrellmd/conffiles +/etc/$(PKG_NAME).conf +endef + +define Build/Compile + CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CPPFLAGS)" \ + LDFLAGS="$(EXTRA_LDFLAGS) " \ + $(MAKE) -C $(PKG_BUILD_DIR)/server \ + CC="$(TARGET_CC)" \ + glib12="yes" \ + without-libsensors="yes" \ + GLIB12_LIB="$(TARGET_LDFLAGS) -lglib -lgmodule" \ + GLIB12_INCLUDE="-I$(STAGING_DIR)/usr/include/glib-1.2 -I$(STAGING_DIR)/usr/lib/glib/include" +endef + +define Package/gkrellmd/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/server/$(PKG_NAME) $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/server/$(PKG_NAME).conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) +endef + +$(eval $(call BuildPackage,gkrellmd)) diff --git a/admin/gkrellmd/files/gkrellmd.init b/admin/gkrellmd/files/gkrellmd.init new file mode 100644 index 0000000..5bd88a9 --- /dev/null +++ b/admin/gkrellmd/files/gkrellmd.init @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007 OpenWrt.org + +START=60 +BIN=gkrellmd +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid + +start() { + mkdir -p $RUN_D + $BIN $OPTIONS +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) +} diff --git a/admin/gkrellmd/patches/100-conf.patch b/admin/gkrellmd/patches/100-conf.patch new file mode 100644 index 0000000..f90ca28 --- /dev/null +++ b/admin/gkrellmd/patches/100-conf.patch @@ -0,0 +1,40 @@ +Index: gkrellm-2.3.1/server/gkrellmd.conf +=================================================================== +--- gkrellm-2.3.1.orig/server/gkrellmd.conf 2008-03-09 10:19:26.000000000 +0100 ++++ gkrellm-2.3.1/server/gkrellmd.conf 2008-03-09 10:19:26.000000000 +0100 +@@ -4,7 +4,7 @@ + # the client update frequency. Values may be from 1 to 10 and should be + # smaller values to reduce network traffic. + # +-update-hz 3 ++update-hz 10 + + # Limit number of simultaneous clients allowed to connect. + # +@@ -13,7 +13,7 @@ + # Specify a specific network interface to listen on for connections. + # By default gkrellmd listens on all available network interfaces. + # +-address 127.0.0.1 ++#address 127.0.0.1 + + # Specify the port to listen on for connections. + # +@@ -29,14 +29,14 @@ + + # Drop privileges after startup (you must start gkrellmd as root to do it). + # +-#user nobody ++user nobody + #group proc + + # Create a PID file for the running gkrellmd. Default is no PID file. +-#pidfile /var/run/gkrellmd.pid ++pidfile /var/run/gkrellmd.pid + + # Run in background and detach from the controlling terminal +-#detach ++detach + + # Time interval between checks for various monitors. If nfs-interval + # is <= 0 then gkrellmd will not read data for nfs file system types. diff --git a/admin/htop/Makefile b/admin/htop/Makefile new file mode 100644 index 0000000..2e5d559 --- /dev/null +++ b/admin/htop/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2007-2012 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:=htop +PKG_VERSION:=1.0.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=d3b80d905a6bff03f13896870787f901 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/htop + SECTION:=admin + CATEGORY:=Administration + TITLE:=Interactive processes viewer + DEPENDS:=+libncurses + URL:=http://htop.sourceforge.net/ +endef + +define Package/htop/description + Htop is an ncursed-based process viewer similar to top, but + it allows to scroll the list vertically and horizontally to + see all processes and their full command lines. +endef + +CONFIGURE_ARGS += \ + --disable-native-affinity \ + --disable-unicode \ + --enable-hwloc + +CONFIGURE_VARS += \ + ac_cv_file__proc_stat=yes \ + ac_cv_file__proc_meminfo=yes \ + ac_cv_func_malloc_0_nonnull=yes \ + ac_cv_func_realloc_0_nonnull=yes + +define Package/htop/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,htop)) diff --git a/admin/monit/Makefile b/admin/monit/Makefile new file mode 100644 index 0000000..cace2be --- /dev/null +++ b/admin/monit/Makefile @@ -0,0 +1,91 @@ +# +# Copyright (C) 2006-2011 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:=monit +PKG_VERSION:=5.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://mmonit.com/monit/dist +PKG_MD5SUM:=f1f391241d44059d0d3e5d26f4ec5ddf + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/monit/Default + SECTION:=admin + CATEGORY:=Administration + DEPENDS:= +libpthread + TITLE:=System services monitoring utility + URL:=http://mmonit.com/monit/ +endef + +define Package/monit/Default/description + An utility for monitoring services on a Unix system +endef + +define Package/monit +$(call Package/monit/Default) + DEPENDS+= +libopenssl + TITLE+= (with SSL support) + VARIANT:=ssl +endef + +define Package/monit/description +$(call Package/monit/Default/description) + This package is built with SSL support. +endef + +define Package/monit-nossl +$(call Package/monit/Default) + TITLE+= (without SSL support) + VARIANT:=nossl +endef + +define Package/monit-nossl/description +$(call Package/monit/Default/description) + This package is built without SSL support. +endef + +CONFIGURE_ARGS += \ + --without-pam \ + libmonit_cv_setjmp_available=yes \ + libmonit_cv_vsnprintf_c99_conformant=yes + +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS += \ + --with-ssl \ + --with-ssl-dir="$(STAGING_DIR)/usr" +endif + +ifeq ($(BUILD_VARIANT),nossl) + CONFIGURE_ARGS += \ + --without-ssl +endif + +define Package/monit/conffiles +/etc/monitrc +endef + +define Package/monit/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/monitrc $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/monit.init $(1)/etc/init.d/monit + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/monit $(1)/usr/bin/ +endef + +Package/monit-nossl/conffiles = $(Package/monit/conffiles) +Package/monit-nossl/install = $(Package/monit/install) + +$(eval $(call BuildPackage,monit)) +$(eval $(call BuildPackage,monit-nossl)) diff --git a/admin/monit/files/monit.init b/admin/monit/files/monit.init new file mode 100644 index 0000000..ed68700 --- /dev/null +++ b/admin/monit/files/monit.init @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2012 OpenWrt.org + +START=60 + +SERVICE_USE_PID=1 + +start() { + [ -f /etc/monitrc ] || return 1 + #chmod 0700 /etc/monitrc + service_start /usr/bin/monit +} + +stop() { + service_stop /usr/bin/monit +} diff --git a/admin/monit/patches/001-no_sslv2.patch b/admin/monit/patches/001-no_sslv2.patch new file mode 100644 index 0000000..e69de29 diff --git a/admin/monit/patches/002-uclibc_loadavg.patch b/admin/monit/patches/002-uclibc_loadavg.patch new file mode 100644 index 0000000..e69de29 diff --git a/admin/muninlite/Makefile b/admin/muninlite/Makefile new file mode 100644 index 0000000..d241707 --- /dev/null +++ b/admin/muninlite/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2006-2011 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:=muninlite +PKG_VERSION:=1.0.4 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=a8cc86f0cc536a6c22dc298f4ed55339 + +include $(INCLUDE_DIR)/package.mk + +define Package/muninlite + SECTION:=admin + CATEGORY:=Administration + DEPENDS:=+xinetd + TITLE:=Munin node implemented in shell + URL:=http://sourceforge.net/projects/muninlite/ +endef + +define Package/muninlite/Default/description + Munin node implemented in shell. + Munin is a monitoring system for Unix networks. +endef + +define Package/muninlite/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/munin-node $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/xinetd.d + $(INSTALL_DATA) ./files/etc/xinetd.d/munin $(1)/etc/xinetd.d/ +endef + +define Package/muninlite/conffiles +/etc/xinetd.d/munin +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +$(eval $(call BuildPackage,muninlite)) diff --git a/admin/muninlite/files/etc/xinetd.d/munin b/admin/muninlite/files/etc/xinetd.d/munin new file mode 100644 index 0000000..012d71b --- /dev/null +++ b/admin/muninlite/files/etc/xinetd.d/munin @@ -0,0 +1,10 @@ +service munin +{ + socket_type = stream + protocol = tcp + wait = no + user = root + group = root + server = /usr/sbin/munin-node + disable = no +} diff --git a/admin/muninlite/patches/001-no_disks.patch b/admin/muninlite/patches/001-no_disks.patch new file mode 100644 index 0000000..bf9b2b1 --- /dev/null +++ b/admin/muninlite/patches/001-no_disks.patch @@ -0,0 +1,12 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,7 @@ + + +-PLUGINS=df cpu if_ if_err_ load memory processes swap netstat uptime interrupts irqstats ntpdate plugindir_ +-#PLUGINS=cpu if_ if_err_ load memory processes netstat uptime interrupts irqstats ++#PLUGINS=df cpu if_ if_err_ load memory processes swap netstat uptime interrupts irqstats ntpdate plugindir_ ++PLUGINS=cpu if_ if_err_ load memory processes netstat uptime interrupts irqstats + + munin-node: plugins/* munin-node.conf + @VERSION=$$(cat VERSION); \ diff --git a/admin/muninlite/patches/002-hostname.patch b/admin/muninlite/patches/002-hostname.patch new file mode 100644 index 0000000..5d87168 --- /dev/null +++ b/admin/muninlite/patches/002-hostname.patch @@ -0,0 +1,11 @@ +--- a/munin-node.in ++++ b/munin-node.in +@@ -113,7 +113,7 @@ PLUGINS=$RES + + # ===== MAIN LOOP ===== + FUNCTIONS="list nodes config fetch version quit" +-HOSTNAME=$(hostname -f 2>/dev/null || hostname) ++HOSTNAME=$(/sbin/uci get "system.@system[0].hostname" 2>/dev/null || cat /proc/sys/kernel/hostname) + echo "# munin node at $HOSTNAME" + while read arg0 arg1 + do diff --git a/admin/muninlite/patches/100-fix-no-ethtool.patch b/admin/muninlite/patches/100-fix-no-ethtool.patch new file mode 100644 index 0000000..88f7e30 --- /dev/null +++ b/admin/muninlite/patches/100-fix-no-ethtool.patch @@ -0,0 +1,21 @@ +--- a/plugins/if_ ++++ b/plugins/if_ +@@ -15,10 +15,14 @@ config_if() { + echo "up.min 0" + echo "up.negative down" + echo "up.cdef up,8,*" +- if ethtool $1 | grep -q Speed; then +- MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\ -f2) * 1000000)) +- echo "up.max $MAX" +- echo "down.max $MAX" ++ if [ -n "$(which ethtool)" ]; then ++ if [ -x "$(which ethtool)" ]; then ++ if ethtool $1 | grep -q Speed; then ++ MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\ -f2) * 1000000)) ++ echo "up.max $MAX" ++ echo "down.max $MAX" ++ fi ++ fi + fi + } + fetch_if() { diff --git a/admin/muninlite/patches/200-add-tap-dev.patch b/admin/muninlite/patches/200-add-tap-dev.patch new file mode 100644 index 0000000..fa46ce6 --- /dev/null +++ b/admin/muninlite/patches/200-add-tap-dev.patch @@ -0,0 +1,20 @@ +--- a/munin-node.in ++++ b/munin-node.in +@@ -72,7 +72,7 @@ RES="" + for PLUG in $PLUGINS + do + if [ "$PLUG" = "if_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); + do + INTERRES=$(echo $INTER | sed 's/\./VLAN/') + RES="$RES if_$INTERRES" +@@ -80,7 +80,7 @@ do + eval "config_if_${INTERRES}() { config_if $INTER $@; };" + done + elif [ "$PLUG" = "if_err_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); + do + INTERRES=$(echo $INTER | sed 's/\./VLAN/') + RES="$RES if_err_$INTERRES" diff --git a/admin/muninlite/patches/210-add-bridge-devs.patch b/admin/muninlite/patches/210-add-bridge-devs.patch new file mode 100644 index 0000000..c5453d8 --- /dev/null +++ b/admin/muninlite/patches/210-add-bridge-devs.patch @@ -0,0 +1,22 @@ +--- a/munin-node.in ++++ b/munin-node.in +@@ -72,7 +72,8 @@ RES="" + for PLUG in $PLUGINS + do + if [ "$PLUG" = "if_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g ++s/\-/_/g'); + do + INTERRES=$(echo $INTER | sed 's/\./VLAN/') + RES="$RES if_$INTERRES" +@@ -80,7 +81,8 @@ do + eval "config_if_${INTERRES}() { config_if $INTER $@; };" + done + elif [ "$PLUG" = "if_err_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g ++s/\-/_/g'); + do + INTERRES=$(echo $INTER | sed 's/\./VLAN/') + RES="$RES if_err_$INTERRES" diff --git a/admin/nagios-plugins/Makefile b/admin/nagios-plugins/Makefile new file mode 100644 index 0000000..6bb7a23 --- /dev/null +++ b/admin/nagios-plugins/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=nagios-plugins +PKG_VERSION:=1.4.14 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/nagiosplug +PKG_MD5SUM:=a1835a48a777863ed2583de3c82446a9 + +PKG_FIXUP:=patch-libtool +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +comma:= , + +define Package/nagios-plugins + SECTION:=admin + CATEGORY:=Administration + DEPENDS:=$(CXX_DEPENDS) +libpq +libopenssl +libradiusclient-ng +libopenldap + TITLE:=plugins for Nagios checks + URL:=http://nagiosplug.sourceforge.net/ +endef + +CONFIGURE_ARGS += \ + --without-mysql \ + --with-openssl="$(STAGING_DIR)/usr" \ + --with-ping-command="/bin/ping -w %d -c %d %s" \ + --with-ping6-command="/bin/ping6 -w %d -c %d %s" \ + --with-ps-command="/bin/ps -Aopid" \ + --with-ps-cols="6" \ + --with-ps-format="%d %s %d %s %s %n" \ + --with-ps-varlist="&procuid$(comma)&procpid$(comma)&procvsz$(comma)procstat$(comma)procprog$(comma)&pos" \ + --with-uptime-command="/usr/bin/uptime" \ + --with-ssh-command="/usr/bin/ssh" \ + --with-nslookup-command="/usr/bin/nslookup" + +define Package/nagios-plugins/install + $(INSTALL_DIR) $(1)/usr/libexec/nagios + $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/libexec/nagios/ +endef + +$(eval $(call BuildPackage,nagios-plugins)) diff --git a/admin/nagios-plugins/patches/002-plugins.patch b/admin/nagios-plugins/patches/002-plugins.patch new file mode 100644 index 0000000..402aaba --- /dev/null +++ b/admin/nagios-plugins/patches/002-plugins.patch @@ -0,0 +1,74 @@ +--- a/configure ++++ b/configure +@@ -28209,7 +28209,7 @@ fi + + if test "$ac_cv_have_decl_swapctl" = "yes"; + then +- EXTRAS="$EXTRAS check_swap" ++ EXTRAS="$EXTRAS" + { echo "$as_me:$LINENO: checking for 2-arg (SVR4) swapctl" >&5 + echo $ECHO_N "checking for 2-arg (SVR4) swapctl... $ECHO_C" >&6; } + if test "$ac_cv_type_swaptbl_t" = "yes" -a \ +@@ -28348,7 +28348,7 @@ cat >>confdefs.h <<\_ACEOF + #define HAVE_SWAP 1 + _ACEOF + +- EXTRAS="$EXTRAS check_swap" ++ EXTRAS="$EXTRAS" + fi + if test "x$ac_cv_swap_command" != "x" + then +@@ -28400,7 +28400,7 @@ cat >>confdefs.h <<_ACEOF + #define PROC_MEMINFO "$ac_cv_proc_meminfo" + _ACEOF + +- EXTRAS="$EXTRAS check_swap" ++ EXTRAS="$EXTRAS" + fi + + # Extract the first word of "dig", so it can be a program name with args. +--- a/plugins/Makefile.am ++++ b/plugins/Makefile.am +@@ -34,8 +34,8 @@ libexec_PROGRAMS = check_apt check_clust + check_tcp_programs = check_ftp check_imap check_nntp check_pop \ + check_udp check_clamd @check_tcp_ssl@ + +-EXTRA_PROGRAMS = check_mysql check_radius check_pgsql check_snmp check_hpjd \ +- check_swap check_fping check_ldap check_game check_dig \ ++EXTRA_PROGRAMS = check_mysql check_radius check_snmp check_hpjd \ ++ check_fping check_ldap check_game check_dig \ + check_nagios check_by_ssh check_dns check_nt check_ide_smart \ + check_procs check_mysql_query check_apt + +--- a/plugins/Makefile.in ++++ b/plugins/Makefile.in +@@ -32,7 +32,7 @@ POST_UNINSTALL = : + build_triplet = @build@ + host_triplet = @host@ + libexec_PROGRAMS = check_apt$(EXEEXT) check_cluster$(EXEEXT) \ +- check_disk$(EXEEXT) check_dummy$(EXEEXT) check_http$(EXEEXT) \ ++ check_dummy$(EXEEXT) check_http$(EXEEXT) \ + check_load$(EXEEXT) check_mrtg$(EXEEXT) \ + check_mrtgtraf$(EXEEXT) check_ntp$(EXEEXT) \ + check_ntp_peer$(EXEEXT) check_nwstat$(EXEEXT) \ +@@ -41,8 +41,8 @@ libexec_PROGRAMS = check_apt$(EXEEXT) ch + check_time$(EXEEXT) check_ntp_time$(EXEEXT) check_ups$(EXEEXT) \ + check_users$(EXEEXT) negate$(EXEEXT) urlize$(EXEEXT) @EXTRAS@ + EXTRA_PROGRAMS = check_mysql$(EXEEXT) check_radius$(EXEEXT) \ +- check_pgsql$(EXEEXT) check_snmp$(EXEEXT) check_hpjd$(EXEEXT) \ +- check_swap$(EXEEXT) check_fping$(EXEEXT) check_ldap$(EXEEXT) \ ++ check_snmp$(EXEEXT) check_hpjd$(EXEEXT) \ ++ check_fping$(EXEEXT) check_ldap$(EXEEXT) \ + check_game$(EXEEXT) check_dig$(EXEEXT) check_nagios$(EXEEXT) \ + check_by_ssh$(EXEEXT) check_dns$(EXEEXT) check_nt$(EXEEXT) \ + check_ide_smart$(EXEEXT) check_procs$(EXEEXT) \ +--- a/plugins/check_pgsql.c ++++ b/plugins/check_pgsql.c +@@ -39,6 +39,7 @@ const char *email = "nagiosplug-devel@li + #include + #include + ++#define NAMEDATALEN 64 + #define DEFAULT_DB "template1" + #define DEFAULT_HOST "127.0.0.1" + diff --git a/admin/nagios-plugins/patches/003-pgsl-header-fix.patch b/admin/nagios-plugins/patches/003-pgsl-header-fix.patch new file mode 100644 index 0000000..8496e80 --- /dev/null +++ b/admin/nagios-plugins/patches/003-pgsl-header-fix.patch @@ -0,0 +1,11 @@ +--- a/plugins/check_pgsql.c ++++ b/plugins/check_pgsql.c +@@ -37,7 +37,7 @@ const char *email = "nagiosplug-devel@li + + #include "netutils.h" + #include +-#include ++#include + + #define NAMEDATALEN 64 + #define DEFAULT_DB "template1" diff --git a/admin/nagios/Makefile b/admin/nagios/Makefile new file mode 100644 index 0000000..b9a4159 --- /dev/null +++ b/admin/nagios/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2008-2011 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:=nagios +PKG_VERSION:=2.10 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/nagios +PKG_MD5SUM:=8c3a29e138f2ff8c8abbd3dd8a40c4b6 + +include $(INCLUDE_DIR)/package.mk + +define Package/nagios + SECTION:=admin + CATEGORY:=Administration + DEPENDS:=+libpthread +microperl +libltdl + TITLE:=service and network monitoring program + URL:=http://www.nagios.org/ +endef + +define Package/nagios/description + service and network monitoring program +endef + +EXTRA_CFLAGS += $(TARGET_CPPFLAGS) + +CONFIGURE_VARS += \ + ac_cv_lib_gd_gdImagePng_1=no \ + ac_cv_lib_gd_gdImagePng_2=no \ + ac_cv_lib_gd_gdImagePng_3=no \ + ac_cv_lib_gd_gdImagePng_4=no + +CONFIGURE_ARGS += \ + --with-nagios-user="root" \ + --with-nagios-group="root" \ + --sysconfdir="/etc/nagios" \ + --without-gd-lib \ + --without-gd-inc \ + CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + INSTALL_OPTS="" \ + STRIP=: \ + all install install-config +endef + +define Package/nagios/install + $(INSTALL_DIR) $(1)/etc/nagios + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/nagios/* $(1)/etc/nagios/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{nagios,nagiostats} $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/* $(1)/usr/share/ +endef + +define Package/nagios/conffiles +/etc/nagios/cgi.cfg +/etc/nagios/commands.cfg +/etc/nagios/localhost.cfg +/etc/nagios/nagios.cfg +/etc/nagios/resource.cfg +endef + +$(eval $(call BuildPackage,nagios)) diff --git a/admin/nrpe/Makefile b/admin/nrpe/Makefile new file mode 100644 index 0000000..9495885 --- /dev/null +++ b/admin/nrpe/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2007-2011 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:=nrpe +PKG_VERSION:=2.12 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/nagios +PKG_MD5SUM:=b2d75e2962f1e3151ef58794d60c9e97 + +include $(INCLUDE_DIR)/package.mk + +define Package/nrpe + SECTION:=admin + CATEGORY:=Administration + DEPENDS:=+libopenssl +libwrap + TITLE:=Daemon to execute Nagios check commands on remote hosts + URL:=http://www.nagios.org/download +endef + +define Package/nrpe/description + The NRPE addon is designed to allow you to execute Nagios plugins on + remote Linux/Unix machines. The main reason for doing this is to allow + Nagios to monitor "local" resources (like CPU load, memory usage, etc.) + on remote machines. Since these public resources are not usually + exposed to external machines, an agent like NRPE must be installed on + the remote Linux/Unix machines. +endef + +CONFIGURE_ARGS += \ + --with-ssl="$(STAGING_DIR)/usr" \ + --with-ssl-lib="$(STAGING_DIR)/usr/lib" + +define Package/nrpe/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DATA) ./files/nrpe.cfg $(1)/etc/nrpe.cfg + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/nrpe $(1)/usr/sbin + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) +endef + +define Package/nrpe/conffiles +/etc/nrpe.cfg +endef + +$(eval $(call RequireCommand,openssl, \ + $(PKG_NAME) requires openssl installed on the host-system. \ +)) + +$(eval $(call BuildPackage,nrpe)) + diff --git a/admin/nrpe/files/nrpe.cfg b/admin/nrpe/files/nrpe.cfg new file mode 100644 index 0000000..e84bed7 --- /dev/null +++ b/admin/nrpe/files/nrpe.cfg @@ -0,0 +1,208 @@ +############################################################################# +# Sample NRPE Config File +# Written by: Ethan Galstad (nagios@nagios.org) +# +# Last Modified: 03-09-2007 +# +# NOTES: +# This is a sample configuration file for the NRPE daemon. It needs to be +# located on the remote host that is running the NRPE daemon, not the host +# from which the check_nrpe client is being executed. +############################################################################# + + +# PID FILE +# The name of the file in which the NRPE daemon should write it's process ID +# number. The file is only written if the NRPE daemon is started by the root +# user and is running in standalone mode. + +pid_file=/var/run/nrpe.pid + + + +# PORT NUMBER +# Port number we should wait for connections on. +# NOTE: This must be a non-priviledged port (i.e. > 1024). +# NOTE: This option is ignored if NRPE is running under either inetd or xinetd + +server_port=5666 + + + +# SERVER ADDRESS +# Address that nrpe should bind to in case there are more than one interface +# and you do not want nrpe to bind on all interfaces. +# NOTE: This option is ignored if NRPE is running under either inetd or xinetd + +server_address=192.168.1.1 + + +# NRPE USER +# This determines the effective user that the NRPE daemon should run as. +# You can either supply a username or a UID. +# +# NOTE: This option is ignored if NRPE is running under either inetd or xinetd + +nrpe_user=nagios + + + +# NRPE GROUP +# This determines the effective group that the NRPE daemon should run as. +# You can either supply a group name or a GID. +# +# NOTE: This option is ignored if NRPE is running under either inetd or xinetd + +nrpe_group=nagios + + + +# ALLOWED HOST ADDRESSES +# This is an optional comma-delimited list of IP address or hostnames +# that are allowed to talk to the NRPE daemon. +# +# Note: The daemon only does rudimentary checking of the client's IP +# address. I would highly recommend adding entries in your /etc/hosts.allow +# file to allow only the specified host to connect to the port +# you are running this daemon on. +# +# NOTE: This option is ignored if NRPE is running under either inetd or xinetd + +allowed_hosts=192.168.1.2 + + + +# COMMAND ARGUMENT PROCESSING +# This option determines whether or not the NRPE daemon will allow clients +# to specify arguments to commands that are executed. This option only works +# if the daemon was configured with the --enable-command-args configure script +# option. +# +# *** ENABLING THIS OPTION IS A SECURITY RISK! *** +# Read the SECURITY file for information on some of the security implications +# of enabling this variable. +# +# Values: 0=do not allow arguments, 1=allow command arguments + +dont_blame_nrpe=0 + + + +# COMMAND PREFIX +# This option allows you to prefix all commands with a user-defined string. +# A space is automatically added between the specified prefix string and the +# command line from the command definition. +# +# *** THIS EXAMPLE MAY POSE A POTENTIAL SECURITY RISK, SO USE WITH CAUTION! *** +# Usage scenario: +# Execute restricted commmands using sudo. For this to work, you need to add +# the nagios user to your /etc/sudoers. An example entry for alllowing +# execution of the plugins from might be: +# +# nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/ +# +# This lets the nagios user run all commands in that directory (and only them) +# without asking for a password. If you do this, make sure you don't give +# random users write access to that directory or its contents! + +# command_prefix=/usr/bin/sudo + + + +# DEBUGGING OPTION +# This option determines whether or not debugging messages are logged to the +# syslog facility. +# Values: 0=debugging off, 1=debugging on + +debug=0 + + + +# COMMAND TIMEOUT +# This specifies the maximum number of seconds that the NRPE daemon will +# allow plugins to finish executing before killing them off. + +command_timeout=60 + + + +# CONNECTION TIMEOUT +# This specifies the maximum number of seconds that the NRPE daemon will +# wait for a connection to be established before exiting. This is sometimes +# seen where a network problem stops the SSL being established even though +# all network sessions are connected. This causes the nrpe daemons to +# accumulate, eating system resources. Do not set this too low. + +connection_timeout=300 + + + +# WEEK RANDOM SEED OPTION +# This directive allows you to use SSL even if your system does not have +# a /dev/random or /dev/urandom (on purpose or because the necessary patches +# were not applied). The random number generator will be seeded from a file +# which is either a file pointed to by the environment valiable $RANDFILE +# or $HOME/.rnd. If neither exists, the pseudo random number generator will +# be initialized and a warning will be issued. +# Values: 0=only seed from /dev/[u]random, 1=also seed from weak randomness + +#allow_weak_random_seed=1 + + + +# INCLUDE CONFIG FILE +# This directive allows you to include definitions from an external config file. + +#include= + + + +# INCLUDE CONFIG DIRECTORY +# This directive allows you to include definitions from config files (with a +# .cfg extension) in one or more directories (with recursion). + +#include_dir= +#include_dir= + + + +# COMMAND DEFINITIONS +# Command definitions that this daemon will run. Definitions +# are in the following format: +# +# command[]= +# +# When the daemon receives a request to return the results of +# it will execute the command specified by the argument. +# +# Unlike Nagios, the command line cannot contain macros - it must be +# typed exactly as it should be executed. +# +# Note: Any plugins that are used in the command lines must reside +# on the machine that this daemon is running on! The examples below +# assume that you have plugins installed in a /usr/local/nagios/libexec +# directory. Also note that you will have to modify the definitions below +# to match the argument format the plugins expect. Remember, these are +# examples only! + + +# The following examples use hardcoded command arguments... + +command[check_users]=/usr/libexec/nagios/check_users -w 3 -c 5 +command[check_load]=/usr/libexec/nagios/check_load -w 7,4,2 -c 10,5,3 +command[check_tmp]=/usr/libexec/nagios/check_disk -w 50% -c 25% -p /tmp +command[check_zombie_procs]=/usr/libexec/nagios/check_procs -w 1 -c 3 -s Z +command[check_total_procs]=/usr/libexec/nagios/check_procs -w 25 -c 30 + + + +# The following examples allow user-supplied arguments and can +# only be used if the NRPE daemon was compiled with support for +# command arguments *AND* the dont_blame_nrpe directive in this +# config file is set to '1'. This poses a potential security risk, so +# make sure you read the SECURITY file before doing this. + +#command[check_users]=/usr/lib/check_users -w $ARG1$ -c $ARG2$ +#command[check_load]=/usr/lib/check_load -w $ARG1$ -c $ARG2$ +#command[check_disk]=/usr/lib/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$ +#command[check_procs]=/usr/lib/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$ diff --git a/admin/nrpe/files/nrpe.init b/admin/nrpe/files/nrpe.init new file mode 100644 index 0000000..4632ac1 --- /dev/null +++ b/admin/nrpe/files/nrpe.init @@ -0,0 +1,20 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=70 + +SERVICE_USE_PID=1 + +start() { + user_exists nagios 50 || user_add nagios 50 + group_exists nagios 50 || group_add nagios 50 + [ -d /var/run/nagios ] || { + mkdir -m 0755 -p /var/run/nagios + chown nagios:nagios /var/run/nagios + } + service_start /usr/sbin/nrpe -c /etc/nrpe.cfg -d +} + +stop() { + service_stop /usr/sbin/nrpe +} diff --git a/admin/nrpe/patches/100-openssl-dh.patch b/admin/nrpe/patches/100-openssl-dh.patch new file mode 100644 index 0000000..0b7f8c9 --- /dev/null +++ b/admin/nrpe/patches/100-openssl-dh.patch @@ -0,0 +1,17 @@ +--- a/configure ++++ b/configure +@@ -6694,11 +6694,9 @@ + + echo "" + echo "*** Generating DH Parameters for SSL/TLS ***" +- if test -f "$ssldir/sbin/openssl"; then +- sslbin=$ssldir/sbin/openssl +- else +- sslbin=$ssldir/bin/openssl +- fi ++ # Use host openssl as it just generates some random stuff, ++ # nothing machine-specific ++ sslbin=/usr/bin/openssl + # awk to strip off meta data at bottom of dhparam output + $sslbin dhparam -C 512 | awk '/^-----/ {exit} {print}' > include/dh.h + fi diff --git a/admin/nsca/Makefile b/admin/nsca/Makefile new file mode 100644 index 0000000..56789c7 --- /dev/null +++ b/admin/nsca/Makefile @@ -0,0 +1,60 @@ +# +# 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:=nsca +PKG_VERSION:=2.7.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/nagios +PKG_MD5SUM:=33a98e7975f633a9489d7a8938ed6131 + +include $(INCLUDE_DIR)/package.mk + +define Package/send-nsca + SECTION:=admin + CATEGORY:=Administration + DEPENDS:=+libmcrypt + TITLE:=Nagios Service Check Acceptor (NSCA) client + URL:=http://www.nagios.org/ +endef + +define Package/send-nsca/description + This is the client program that is used to send service check + information from a remote machine to the nsca daemon on the central + machine that runs Nagios. +endef + +define Package/send-nsca/conffiles +/etc/send_nsca.cfg +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --with-nsca-user="root" \ + --with-nsca-grp="root" \ + --with-libmcrypt-prefix="$(STAGING_DIR)/usr" \ + , \ + CFLAGS="$$$$CFLAGS $$$$CPPFLAGS" \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + send_nsca +endef + +define Package/send-nsca/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/sample-config/send_nsca.cfg $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/send_nsca $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,send-nsca)) diff --git a/admin/osiris/Makefile b/admin/osiris/Makefile new file mode 100644 index 0000000..d93689b --- /dev/null +++ b/admin/osiris/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2006-2011 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:=osiris +PKG_VERSION:=4.2.3 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://osiris.shmoo.com/data/ +PKG_MD5SUM:=1951c7dc0fe729af9ffaf58910340d12 + +PKG_FIXUP:=autoreconf +PKG_LIBTOOL_PATHS:=src/db-4.2.52/build_unix +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/osirisd + SECTION:=admin + CATEGORY:=Administration + DEPENDS:=+libopenssl +libpthread + TITLE:=Host integrity monitoring system (scanning agent) + URL:=http://osiris.shmoo.com/ +endef + +CONFIGURE_ARGS += \ + --with-osiris-user=root \ + --with-root-dir=/var/lib/osiris \ + --with-readline=no, \ + ac_cv_openssldir="$(STAGING_DIR)/usr" + +MAKE_FLAGS += \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + INTERACTIVE=0 + +define Package/osirisd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/osirisd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/osirisd.init $(1)/etc/init.d/osirisd +endef + +$(eval $(call BuildPackage,osirisd)) diff --git a/admin/osiris/files/osirisd.init b/admin/osiris/files/osirisd.init new file mode 100644 index 0000000..1ce739b --- /dev/null +++ b/admin/osiris/files/osirisd.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +start() { + mkdir -0755 -p /var/lib/osiris + service_start /usr/sbin/osirisd +} + +stop() { + service_stop /usr/sbin/osirisd +} diff --git a/admin/osiris/patches/001-configure-cross.patch b/admin/osiris/patches/001-configure-cross.patch new file mode 100644 index 0000000..025a3f8 --- /dev/null +++ b/admin/osiris/patches/001-configure-cross.patch @@ -0,0 +1,22 @@ +--- osiris-4.1.8-orig/configure 2005-04-13 15:22:13.000000000 +0200 ++++ osiris-4.1.8-1/configure 2005-04-22 23:11:32.000000000 +0200 +@@ -3606,7 +3606,7 @@ + esac + + +-DB_CONFIG_ARGS="--enable-shared=no --enable-static=yes" ++DB_CONFIG_ARGS="--target=${target_alias} --host=${host_alias} --build=${build_alias} --enable-shared=no --enable-static=yes" + + case "${OS_NAME}" in + MINGW32*) +--- osiris-4.1.8-orig/configure.ac 2005-04-13 15:22:13.000000000 +0200 ++++ osiris-4.1.8-1/configure.ac 2005-04-22 23:11:32.000000000 +0200 +@@ -270,7 +270,7 @@ + + dnl configure local copy of Berkely DB: + +-DB_CONFIG_ARGS="--enable-shared=no --enable-static=yes" ++DB_CONFIG_ARGS="--target=${target_alias} --host=${host_alias} --build=${build_alias} --enable-shared=no --enable-static=yes" + + case "${OS_NAME}" in + MINGW32*) diff --git a/admin/osiris/patches/002-osirisd-pidfile.patch b/admin/osiris/patches/002-osirisd-pidfile.patch new file mode 100644 index 0000000..80c52db --- /dev/null +++ b/admin/osiris/patches/002-osirisd-pidfile.patch @@ -0,0 +1,68 @@ +--- osiris-4.1.8-orig/src/osirisd/osirisd.c 2005-04-14 01:00:55.000000000 +0200 ++++ osiris-4.1.8-1/src/osirisd/osirisd.c 2005-04-22 23:11:32.000000000 +0200 +@@ -218,6 +218,8 @@ + + #ifdef USE_PRIVSEP + rootpriv_setup_pidfile(); ++#else ++ setup_pidfile(); + #endif + + process(); +--- osiris-4.1.8-orig/src/osirisd/rootpriv.c 2005-04-14 00:55:59.000000000 +0200 ++++ osiris-4.1.8-1/src/osirisd/rootpriv.c 2005-04-22 23:25:10.000000000 +0200 +@@ -35,6 +35,10 @@ + #include "logging.h" + #include "rootpriv.h" + ++#ifndef WIN32 ++extern char pid_file[MAX_PATH_LENGTH]; ++#endif ++ + #ifdef USE_PRIVSEP + + /* this is defined in regex, and sometimes conflicts with stuff */ +@@ -80,10 +84,6 @@ + extern pid_t child_pid; + extern int rootpriv_pipe[2]; /* socketpair used for rootpriv comm. */ + +-#ifndef WIN32 +-extern char pid_file[MAX_PATH_LENGTH]; +-#endif +- + #define INCOMING_ROOT_REQUEST() ( FD_ISSET( rootpriv_pipe[1], &root_read_set ) ) + + +@@ -292,17 +292,6 @@ + #endif + } + +-void setup_pidfile() +-{ +- FILE *pidfile = fopen( pid_file, "wb" ); +- +- if( pidfile != NULL ) +- { +- fprintf( pidfile, "%ld\n", (long)getpid() ); +- fclose( pidfile ); +- } +-} +- + void handle_signals() + { + pid_t pid; +@@ -789,3 +778,14 @@ + + #endif /* USE_PRIVSEP */ + ++void setup_pidfile() ++{ ++ FILE *pidfile = fopen( pid_file, "wb" ); ++ ++ if( pidfile != NULL ) ++ { ++ fprintf( pidfile, "%ld\n", (long)getpid() ); ++ fclose( pidfile ); ++ } ++} ++ diff --git a/admin/osiris/patches/003-openssl-0.9.8+.patch b/admin/osiris/patches/003-openssl-0.9.8+.patch new file mode 100644 index 0000000..806cf3a --- /dev/null +++ b/admin/osiris/patches/003-openssl-0.9.8+.patch @@ -0,0 +1,16 @@ +diff -ruN osiris-4.1.9-old/src/osirismd/md_control.c osiris-4.1.9-new/src/osirismd/md_control.c +--- osiris-4.1.9-old/src/osirismd/md_control.c 2005-03-24 16:36:07.000000000 +0100 ++++ osiris-4.1.9-new/src/osirismd/md_control.c 2006-03-28 01:32:32.000000000 +0200 +@@ -3262,9 +3262,9 @@ + int index; + char checksum[41]; + +- SHA_Init( &context ); +- SHA_Update( &context, key, (unsigned long)keysize ); +- SHA_Final( &( digest[0] ), &context ); ++ SHA1_Init( &context ); ++ SHA1_Update( &context, key, (unsigned long)keysize ); ++ SHA1_Final( &( digest[0] ), &context ); + + for ( index = 0; index < SHA_DIGEST_LENGTH; index++ ) + { diff --git a/admin/osiris/patches/004-no_openssl_ripe.patch b/admin/osiris/patches/004-no_openssl_ripe.patch new file mode 100644 index 0000000..75a9e9d --- /dev/null +++ b/admin/osiris/patches/004-no_openssl_ripe.patch @@ -0,0 +1,59 @@ +diff -urN osiris-4.2.1/src/libosiris/filter_ripemd.c osiris-4.2.1.new/src/libosiris/filter_ripemd.c +--- osiris-4.2.1/src/libosiris/filter_ripemd.c 2006-07-28 03:22:37.000000000 +0200 ++++ osiris-4.2.1.new/src/libosiris/filter_ripemd.c 2006-11-29 12:16:00.000000000 +0100 +@@ -55,9 +55,9 @@ + { + context->filter_argument += 2; + } +- ++#ifndef OPENSSL_NO_RIPEMD + hash_file_ripemd( file_path, context->file_handle, hash, sizeof(hash) ); +- ++#endif + if( strcmp( hash, context->filter_argument ) == 0 ) + { + return TRUE; +diff -urN osiris-4.2.1/src/libosiris/ssl_utilities.c osiris-4.2.1.new/src/libosiris/ssl_utilities.c +--- osiris-4.2.1/src/libosiris/ssl_utilities.c 2006-07-28 03:22:37.000000000 +0200 ++++ osiris-4.2.1.new/src/libosiris/ssl_utilities.c 2006-11-29 12:17:33.000000000 +0100 +@@ -51,7 +51,9 @@ + #include + #include + #include ++#ifndef OPENSSL_NO_RIPEMD + #include ++#endif + + #ifdef WIN32 + #include +@@ -348,6 +350,7 @@ + int hash_file_ripemd( const char *file_path, FILE *file, + char *buffer, int buffer_size ) + { ++#ifndef OPENSSL_NO_RIPEMD + int fno; + FILE *file_to_hash = file; + RIPEMD160_CTX context; +@@ -430,7 +433,7 @@ + osi_strlcpy( buffer, file_hash, buffer_size ); + return 0; + } +- ++#endif + return -1; + } + +diff -urN osiris-4.2.1/src/libosiris/utilities.c osiris-4.2.1.new/src/libosiris/utilities.c +--- osiris-4.2.1/src/libosiris/utilities.c 2006-07-28 03:22:37.000000000 +0200 ++++ osiris-4.2.1.new/src/libosiris/utilities.c 2006-11-29 12:16:38.000000000 +0100 +@@ -60,8 +60,9 @@ + + #include + #include ++#ifndef OPENSSL_NO_RIPEMD + #include +- ++#endif + #include "utilities.h" + #include "error.h" + diff --git a/admin/osiris/patches/006-mod_nvram.patch b/admin/osiris/patches/006-mod_nvram.patch new file mode 100644 index 0000000..69b6cd6 --- /dev/null +++ b/admin/osiris/patches/006-mod_nvram.patch @@ -0,0 +1,213 @@ +Description: The mod_nvram module was developed specifically to monitor + configuration settings stored in nvram on Linksys devices. + In the future, this module could be used to monitor other + attributes of similar devices. +Version: 0.1 + +--- osiris-4.1.8-orig/src/osirisd/modules/mod_nvram/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ osiris-4.1.8-1/src/osirisd/modules/mod_nvram/Makefile 2005-04-22 23:11:32.000000000 +0200 +@@ -0,0 +1,16 @@ ++ ++include ../Makefile ++ ++SRCS=mod_nvram.c ++OBJS=$(SRCS:.c=.o) ++ ++module: ${SRCS} ${OBJS} ++ ++INCS=-I../.. -I../../../libosiris -I../../../libfileapi -I../../../.. ++ ++# meta-rule for compiling any "C" source file. ++$(OBJS): $(SRCS) ++ $(CC) $(DEFS) $(DEFAULT_INCLUDES) ${INCLUDES} ${INCS} $(AM_CPPFLAGS) \ ++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $(SRCS) ++ cp $@ .. ++ +--- osiris-4.1.8-orig/src/osirisd/modules/mod_nvram/README 1970-01-01 01:00:00.000000000 +0100 ++++ osiris-4.1.8-1/src/osirisd/modules/mod_nvram/README 2005-04-22 23:11:32.000000000 +0200 +@@ -0,0 +1,40 @@ ++ ++Module: mod_nvram ++Author: Brian Wotring (brian@shmoo.com) ++ ++ ++ ++DESCRIPTION: ++ ++The mod_nvram module reads the key=value pairs stored in nvram. This ++is primarily for Linksys routers, but could be modified to run on ++other systems if necessary. On the routers like the WRT54G, the ++nvram settings hold sensitive information that needs to be monitored. ++The format for the record structure is as follows: ++ ++ name:value ++ ++USE: ++ ++To use this module, all that is needed is to include it in the System ++block of a scan configuration, e.g.: ++ ++ ++ ... ++ Include mod_nvram ++ ... ++ ++ ++ ++PARAMETERS: ++ ++There are no parameters for this module. ++ ++PLATFORMS: ++ ++Currently, only for the Linksys WRT54G and WRT54GS devices. ++ ++NOTES: ++ ++ ++ +--- osiris-4.1.8-orig/src/osirisd/modules/mod_nvram/mod_nvram.c 1970-01-01 01:00:00.000000000 +0100 ++++ osiris-4.1.8-1/src/osirisd/modules/mod_nvram/mod_nvram.c 2005-04-22 23:11:32.000000000 +0200 +@@ -0,0 +1,142 @@ ++ ++/****************************************************************************** ++** ++** This program is free software; you can redistribute it and/or ++** modify it, however, you cannot sell it. ++** ++** 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. ++** ++** You should have received a copy of the license attached to the ++** use of this software. If not, visit www.shmoo.com/osiris for ++** details. ++** ++******************************************************************************/ ++ ++/***************************************************************************** ++** ++** File: mod_users.c ++** Date: January 1, 2004 ++** ++** Author: Brian Wotring ++** Purpose: platform specific methods for reading user file information. ++** ++******************************************************************************/ ++ ++#include "libosiris.h" ++#include "libfileapi.h" ++#include "rootpriv.h" ++#include "common.h" ++#include "version.h" ++ ++#include "scanner.h" ++#include "logging.h" ++ ++ ++#define NVRAM_PATH "/usr/sbin/nvram" ++#define NVRAM_ARG "show" ++ ++static const char *MODULE_NAME = "mod_nvram"; ++ ++ ++void mod_nvram( SCANNER *scanner ) ++{ ++ int pid; ++ int pc[2]; ++ int cp[2]; ++ char temp_line[4096]; ++ FILE *file; ++ SCAN_RECORD_TEXT_1 record; ++ ++ if( pipe(pc) < 0) ++ { ++ log_error( "mod_nvram: error creating pipe!" ); ++ return; ++ } ++ ++ if( pipe(cp) < 0) ++ { ++ log_error( "mod_nvram: error creating pipe!" ); ++ return; ++ } ++ ++ /* Create a child to run nvram command. */ ++ ++ switch( pid = fork() ) ++ { ++ case -1: ++ log_error( "nvram: fork error!" ); ++ return; ++ ++ case 0: ++ ++ /* child */ ++ ++ close(1); ++ dup( cp[1]); ++ close(0); ++ close( pc[1]); ++ close( cp[0]); ++ execl( NVRAM_PATH, NVRAM_PATH, NVRAM_ARG, NULL ); ++ exit(0); ++ ++ default: ++ ++ /* parent */ ++ ++ close(pc[1]); ++ close(cp[1]); ++ ++ file = fdopen( cp[0], "r" ); ++ ++ for(;;) ++ { ++ char *line; ++ char *key_end; ++ ++ line = fgets( temp_line, sizeof( temp_line ), file ); ++ ++ if( line == NULL) ++ { ++ break; ++ } ++ ++ line = trim_white_space( line ); ++ ++ /* skip commented and empty lines. */ ++ ++ if( ( line == NULL ) || ( line[0] == '#' ) ) ++ { ++ continue; ++ } ++ ++ /* locate the username, this is the first item in the colon list. */ ++ ++ if( ( key_end = strchr( line, '=' ) ) == NULL ) ++ { ++ continue; ++ } ++ ++ initialize_scan_record( (SCAN_RECORD *)&record, ++ SCAN_RECORD_TYPE_TEXT_1 ); ++ ++ osi_strlcpy( record.module_name, MODULE_NAME, ++ sizeof( record.module_name ) ); ++ ++ /* user the key as a key/path for this record. */ ++ ++ (*key_end) = '\0'; ++ key_end++; ++ osi_strlcpy( record.name, "nvram:", sizeof( record.name ) ); ++ osi_strlcat( record.name, line, sizeof( record.name ) ); ++ ++ /* now copy in the value into the data portion. */ ++ /* and send this record on its way. */ ++ ++ osi_strlcpy( record.data, key_end, sizeof( record.data ) ); ++ send_scan_data( scanner, (SCAN_RECORD *)&record ); ++ } ++ } ++} ++ diff --git a/admin/osiris/patches/007-mod_uptime.patch b/admin/osiris/patches/007-mod_uptime.patch new file mode 100644 index 0000000..2bfeec6 --- /dev/null +++ b/admin/osiris/patches/007-mod_uptime.patch @@ -0,0 +1,243 @@ +Description: The mod_uptime module obtains the system boot time value + for comparison with scans. +Version: 0.2 + +--- osiris-4.1.8-orig/src/osirisd/modules/mod_uptime/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ osiris-4.1.8-1/src/osirisd/modules/mod_uptime/Makefile 2005-04-22 23:11:32.000000000 +0200 +@@ -0,0 +1,16 @@ ++ ++include ../Makefile ++ ++SRCS=mod_uptime.c ++OBJS=$(SRCS:.c=.o) ++ ++module: ${SRCS} ${OBJS} ++ ++INCS=-I../.. -I../../../libosiris -I../../../libfileapi -I../../../.. ++ ++# meta-rule for compiling any "C" source file. ++$(OBJS): $(SRCS) ++ $(CC) $(DEFS) $(DEFAULT_INCLUDES) ${INCLUDES} ${INCS} $(AM_CPPFLAGS) \ ++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $(SRCS) ++ cp $@ .. ++ +--- osiris-4.1.8-orig/src/osirisd/modules/mod_uptime/README 1970-01-01 01:00:00.000000000 +0100 ++++ osiris-4.1.8-1/src/osirisd/modules/mod_uptime/README 2005-04-22 23:11:32.000000000 +0200 +@@ -0,0 +1,36 @@ ++ ++Module: mod_uptime ++Author: Brian Wotring (brian@shmoo.com) ++ ++ ++ ++DESCRIPTION: ++ ++The mod_uptime module obtains the system boot time value for comparison ++with scans. ++ ++USE: ++ ++To use this module, all that is needed is to include it in the System ++block of a scan configuration, e.g.: ++ ++ ++ ... ++ Include mod_uptime ++ ... ++ ++ ++ ++PARAMETERS: ++ ++There are no parameters for this module. ++ ++PLATFORMS: ++ ++Currently, this module is implemented for FreeBSD, OpenBSD, ++Linux, Solaris, and Mac OS X. ++ ++NOTES: ++ ++ ++ +--- osiris-4.1.8-orig/src/osirisd/modules/mod_uptime/mod_uptime.c 1970-01-01 01:00:00.000000000 +0100 ++++ osiris-4.1.8-1/src/osirisd/modules/mod_uptime/mod_uptime.c 2005-04-22 23:11:32.000000000 +0200 +@@ -0,0 +1,178 @@ ++ ++/****************************************************************************** ++** ++** This program is free software; you can redistribute it and/or ++** modify it, however, you cannot sell it. ++** ++** 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. ++** ++** You should have received a copy of the license attached to the ++** use of this software. If not, visit www.shmoo.com/osiris for ++** details. ++** ++******************************************************************************/ ++ ++/***************************************************************************** ++** ++** File: mod_uptime.c ++** Date: March 22, 2004 ++** ++** Author: Brian Wotring ++** Purpose: platform specific methods for obtaining the system boot time. ++** ++******************************************************************************/ ++ ++#include "libosiris.h" ++#include "libfileapi.h" ++#include "rootpriv.h" ++#include "common.h" ++#include "version.h" ++ ++#include "scanner.h" ++#include "logging.h" ++#include "config.h" ++ ++#ifdef HAVE_SYS_SYSCTL_H ++#include ++#endif ++ ++#ifdef SYSTEM_SUNOS ++#include ++#endif ++ ++#ifdef SYSTEM_LINUX ++#include ++#endif ++ ++#define PROC_FILE "/proc/uptime" ++#define OSI_WTMP_FILE "/var/log/wtmp" ++ ++static const char *MODULE_NAME = "mod_uptime"; ++ ++ ++void mod_uptime( SCANNER *scanner ) ++{ ++ SCAN_RECORD_TEXT_1 record; ++ char *time = NULL; ++ char *temp; ++ ++ initialize_scan_record( (SCAN_RECORD *)&record, ++ SCAN_RECORD_TYPE_TEXT_1 ); ++ ++ osi_strlcpy( record.module_name, MODULE_NAME, ++ sizeof( record.module_name ) ); ++ ++#if defined(SYSTEM_FREEBSD) || defined(SYSTEM_OPENBSD) || defined(SYSTEM_DARWIN) ++ { ++ time_t t; ++ struct timeval result; ++ ++ int request[2] = { CTL_KERN, KERN_BOOTTIME }; ++ size_t result_len = sizeof(result); ++ ++ if( sysctl( request, 2, &result, &result_len, NULL, 0 ) < 0) ++ { ++ log_error( "unable to obtain uptime value." ); ++ return; ++ } ++ ++ t = result.tv_sec; ++ time = ctime( &t ); ++ } ++ ++#elif defined(SYSTEM_SUNOS) ++ { ++ struct utmpx * ent; ++ time_t t; ++ ++ while( ( ent = getutxent() ) ) ++ { ++ if( !strcmp( "system boot", ent->ut_line ) ) ++ { ++ t = ent->ut_tv.tv_sec; ++ time = ctime( &t ); ++ } ++ } ++ } ++ ++#elif defined(SYSTEM_LINUX) ++ { ++ FILE *fp; ++ time_t t; ++ struct utmp ut; ++ ++ char buf[40]; ++ char buf2[10]; ++ int filecount = 0; ++ ++next_file: ++ ++ osi_strlcpy( buf, OSI_WTMP_FILE, sizeof( buf ) ); ++ ++ if( filecount > 0 ) ++ { ++ osi_snprintf( buf2, sizeof(buf2), "%d", filecount ); ++ osi_strlcat( buf, buf2, sizeof(buf) ); ++ } ++ ++ fp = osi_fopen( buf, "r", 0 ); ++ ++ if( fp == NULL ) ++ { ++ log_error( "unable to obtain uptime value." ); ++ return; ++ } ++ ++ while(1) ++ { ++ int rc = fread( &ut, 1, sizeof(ut), fp ); ++ ++ /* end of file, try next. */ ++ ++ if( rc == 0 ) ++ { ++ filecount++; ++ fclose( fp ); ++ ++ goto next_file; ++ } ++ ++ /* found restart event. */ ++ ++ if( ( strcmp( ut.ut_name, "reboot" ) == 0 ) || ++ ( strcmp( ut.ut_name, "shutdown" ) == 0 ) ) ++ { ++ ++ t = ut.ut_time; ++ time = ctime( &t ); ++ ++ break; ++ } ++ } ++ ++ fclose( fp ); ++ } ++#endif ++ ++ if( time == NULL ) ++ { ++ log_error( "unable to obtain uptime value." ); ++ return; ++ } ++ ++ /* remove any trailing newline from the ctime() calls. */ ++ ++ if( ( temp = strchr( time, '\n' ) ) ) ++ { ++ (*temp) = '\0'; ++ } ++ ++ osi_strlcpy( record.name, "uptime", sizeof( record.name ) ); ++ osi_strlcpy( record.data, time, sizeof( record.data ) ); ++ ++ send_scan_data( scanner, (SCAN_RECORD *)&record ); ++} ++ ++ diff --git a/admin/osiris/patches/010-dont-add-host-include-paths.patch b/admin/osiris/patches/010-dont-add-host-include-paths.patch new file mode 100644 index 0000000..84e4ab6 --- /dev/null +++ b/admin/osiris/patches/010-dont-add-host-include-paths.patch @@ -0,0 +1,16 @@ +diff --git a/configure b/configure +index f7f5ce9..322a49d 100755 +--- a/configure ++++ b/configure +@@ -4448,11 +4448,6 @@ cat >>confdefs.h <<_ACEOF + #define SYSTEM_LINUX 1 + _ACEOF + +- +- rc=`grep -c krb5 /usr/include/openssl/ssl.h` +- if test $rc -ne 0; then +- CPPFLAGS="-I/usr/kerberos/include/ ${CPPFLAGS}" +- fi + ;; + BSD*) + diff --git a/admin/ostiary/Makefile b/admin/ostiary/Makefile new file mode 100644 index 0000000..757c595 --- /dev/null +++ b/admin/ostiary/Makefile @@ -0,0 +1,88 @@ +# +# Copyright (C) 2008-2011 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:=ostiary +PKG_VERSION:=4.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://ingles.homeunix.net/software/ost/latest/ +PKG_MD5SUM:=420d1fda246097d7e4d1277f39069578 + +include $(INCLUDE_DIR)/package.mk + +define Package/ostiary + SECTION:=admin + CATEGORY:=Administration + TITLE:=Simple, Secure Remote Script Execution + URL:=http://ingles.homeunix.net/software/ost/index.html +endef + +define Package/ostiary/description + Designed to allow you to run a fixed set of commands remotely, + without giving everyone else access to the same commands. + + Provides - ostiaryd daemon (~25kb) + - ostclient (~9kb) +endef + +EXTRA_CFLAGS += $(TARGET_CPPFLAGS) + +CONFIGURE_ARGS += \ + --prefix="/usr/bin" \ + --sysconfdir="/etc/ostiaryd" \ + CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + INSTALL_OPTS="" \ + STRIP="" \ + ostiaryd ostclient +endef + +define Package/ostiary/install + $(INSTALL_DIR) $(1)/etc/ostiaryd + $(INSTALL_CONF) $(PKG_BUILD_DIR)/tests/ostiary.cfg $(1)/etc/ostiaryd/ostiary.cfg + $(INSTALL_DIR) $(1)/etc/ostiaryd/scripts + $(INSTALL_BIN) ./files/{ssh_enable,ssh_disable} $(1)/etc/ostiaryd/scripts + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/ostiaryd.init $(1)/etc/init.d/ostiaryd + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/{ostiaryd,ostclient} $(1)/usr/bin/ +endef + + + + +define Package/ostiary/postinst +#!/bin/sh +# check if we are on real system +if [ -z "$${IPKG_INSTROOT}" ]; then + echo "Enabling rc.d symlink for ostiaryd" + /etc/init.d/ostiaryd enable +fi +exit 0 +endef + +define Package/ostiary/prerm +#!/bin/sh +# check if we are on real system +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ostiaryd stop + echo "Removing rc.d symlink for ostiaryd" + /etc/init.d/ostiaryd disable + echo "Any config backups and scripts you created are not removed automatically." + echo "To finish cleanup, backup any files you want to keep, then run rm -f /etc/ostiaryd" +fi +exit 0 +endef + + +$(eval $(call BuildPackage,ostiary)) diff --git a/admin/ostiary/files/ostiaryd.init b/admin/ostiary/files/ostiaryd.init new file mode 100644 index 0000000..6c4ee09 --- /dev/null +++ b/admin/ostiary/files/ostiaryd.init @@ -0,0 +1,27 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2012 OpenWrt.org + +START=85 +MYSERVICE=ostiaryd + + +start() { + echo starting $MYSERVICE... + /usr/bin/$MYSERVICE + sleep 1 + echo done +} + +stop() { + + if ps ax | grep -v grep | grep -v rc.common | grep $MYSERVICE> /dev/null + then + echo "stopping $MYSERVICE..." + pkill -9 $MYSERVICE + sleep 1 + echo done + else + echo "$MYSERVICE is not running" + fi +} + diff --git a/admin/ostiary/files/ssh_disable b/admin/ostiary/files/ssh_disable new file mode 100644 index 0000000..1d4304f --- /dev/null +++ b/admin/ostiary/files/ssh_disable @@ -0,0 +1,4 @@ +#!/bin/sh + +logger Ostiary is dis-abling SSH +iptables -D zone_wan -p tcp --dport 22001 -j ACCEPT diff --git a/admin/ostiary/files/ssh_enable b/admin/ostiary/files/ssh_enable new file mode 100644 index 0000000..0987cde --- /dev/null +++ b/admin/ostiary/files/ssh_enable @@ -0,0 +1,4 @@ +#!/bin/sh + +logger Ostiary is enabling SSH +iptables -I zone_wan -p tcp --dport 22001 -j ACCEPT diff --git a/admin/pmacct/Makefile b/admin/pmacct/Makefile new file mode 100644 index 0000000..4299a82 --- /dev/null +++ b/admin/pmacct/Makefile @@ -0,0 +1,178 @@ +# +# Copyright (C) 2006-2012 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:=pmacct +PKG_VERSION:=0.14.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.pmacct.net/ +PKG_MD5SUM:=4588531f0e8033fe82ad7fb22d1bbdb7 + +PKG_BUILD_DEPENDS:=libpcap + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_CONFIG_DEPENDS:= \ + CONFIG_IPV6 \ + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/pmacct/Default + SECTION:=admin + CATEGORY:=Administration + SUBMENU:=Pmacct suite + URL:=http://www.pmacct.net/ + DEPENDS=+libpcap +endef + +define Package/pmacct-client + $(call Package/pmacct/Default) + TITLE:=Command-line client to gather data from the IMT plugin + VARIANT:=basic +endef + +define Package/nfacctd/Default + $(call Package/pmacct/Default) + TITLE:=NetFlow accounting daemon +endef + +define Package/pmacctd/Default + $(call Package/pmacct/Default) + TITLE:=IP pcap-based accounting daemon +endef + +define Package/sfacctd/Default + $(call Package/pmacct/Default) + TITLE:=sFlow accounting daemon +endef + +define Package/uacctd/Default + $(call Package/pmacct/Default) + DEPENDS+= +iptables-mod-ulog + TITLE:=ulog accounting daemon +endef + + +CONFIGURE_ARGS+= \ + $(call autoconf_bool,CONFIG_IPV6,ipv6) \ + --with-pcap-includes="$(STAGING_DIR)/usr/include" \ + --with-pcap-libs="$(STAGING_DIR)/usr/lib" \ + --enable-ulog \ + +ifeq ($(BUILD_VARIANT),basic) + + CONFIGURE_ARGS += \ + --disable-mysql \ + --disable-pgsql \ + --disable-sqlite3 \ + +endif + +ifeq ($(BUILD_VARIANT),mysql) + + CONFIGURE_ARGS += \ + --enable-mysql \ + --with-mysql-includes="$(STAGING_DIR)/usr/include" \ + --with-mysql-libs="$(STAGING_DIR)/usr/lib/mysql" \ + --disable-pgsql \ + --disable-sqlite3 \ + + CONFIGURE_VARS+= \ + LIBS="-lz" \ + +endif + +ifeq ($(BUILD_VARIANT),pgsql) + + CONFIGURE_ARGS += \ + --disable-mysql \ + --enable-pgsql \ + --with-pgsql-includes="$(STAGING_DIR)/usr/include" \ + --with-pgsql-libs="$(STAGING_DIR)/usr/lib" \ + --disable-sqlite3 \ + +endif + +ifeq ($(BUILD_VARIANT),sqlite) + + CONFIGURE_ARGS += \ + --disable-mysql \ + --disable-pgsql \ + --enable-sqlite3 \ + --with-sqlite3-includes="$(STAGING_DIR)/usr/include" \ + --with-sqlite3-libs="$(STAGING_DIR)/usr/lib" \ + +endif + + +define Package/pmacct-client/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/src/pmacct $(1)/usr/sbin/ +endef + + +# $(1): build variant {basic,mysql,pgsql,sqlite} +# $(2): package name prefix {nfacctd,pmacctd,sfacctd,uacctd} +# $(3): package name suffix {,-mysql,-pgsql,-sqlite} +# $(4): additional title (with MySQL support, ...) +# $(5): additional dependencies (+libmysqlclient, ...) + +define BuildPackage/Template + + define Package/$(2)$(3) + $(call Package/$(2)/Default) + DEPENDS+= $(5) + TITLE+= $(4) + VARIANT:=$(1) + endef + + define Package/$(2)$(3)/conffiles +/etc/default/$(2) +/etc/$(2).conf + endef + + define Package/$(2)$(3)/install + $(INSTALL_DIR) $$(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/$(2) $$(1)/usr/sbin/ + $(INSTALL_DIR) $$(1)/etc + $(INSTALL_DATA) ./files/$(2).conf $$(1)/etc/ + $(INSTALL_DIR) $$(1)/etc/default + $(INSTALL_DATA) ./files/$(2).default $$(1)/etc/default/$(2) + $(INSTALL_DIR) $$(1)/etc/init.d + $(INSTALL_BIN) ./files/$(2).init $$(1)/etc/init.d/$(2) + endef + + $$(eval $$(call BuildPackage,$(2)$(3))) + +endef + +$(eval $(call BuildPackage,pmacct-client)) + +$(eval $(call BuildPackage/Template,basic,nfacctd,,,)) +$(eval $(call BuildPackage/Template,basic,pmacctd,,,)) +$(eval $(call BuildPackage/Template,basic,sfacctd,,,)) +$(eval $(call BuildPackage/Template,basic,uacctd,,,)) + +$(eval $(call BuildPackage/Template,mysql,nfacctd,-mysql,with MySQL support,+libmysqlclient)) +$(eval $(call BuildPackage/Template,mysql,pmacctd,-mysql,with MySQL support,+libmysqlclient)) +$(eval $(call BuildPackage/Template,mysql,sfacctd,-mysql,with MySQL support,+libmysqlclient)) +$(eval $(call BuildPackage/Template,mysql,uacctd,-mysql,with MySQL support,+libmysqlclient)) + +$(eval $(call BuildPackage/Template,pgsql,nfacctd,-pgsql,with PostgreSQL support,+libpq)) +$(eval $(call BuildPackage/Template,pgsql,pmacctd,-pgsql,with PostgreSQL support,+libpq)) +$(eval $(call BuildPackage/Template,pgsql,sfacctd,-pgsql,with PostgreSQL support,+libpq)) +$(eval $(call BuildPackage/Template,pgsql,uacctd,-pgsql,with PostgreSQL support,+libpq)) + +$(eval $(call BuildPackage/Template,sqlite,nfacctd,-sqlite,with SQLite support,+libsqlite3 +zlib)) +$(eval $(call BuildPackage/Template,sqlite,pmacctd,-sqlite,with SQLite support,+libsqlite3 +zlib)) +$(eval $(call BuildPackage/Template,sqlite,sfacctd,-sqlite,with SQLite support,+libsqlite3 +zlib)) +$(eval $(call BuildPackage/Template,sqlite,uacctd,-sqlite,with SQLite support,+libsqlite3 +zlib)) diff --git a/admin/pmacct/files/nfacctd.conf b/admin/pmacct/files/nfacctd.conf new file mode 100644 index 0000000..27b8956 --- /dev/null +++ b/admin/pmacct/files/nfacctd.conf @@ -0,0 +1,29 @@ +! +! nfacctd configuration example +! +! debug: true +daemonize: true +pidfile: /var/run/nfacctd.pid +! aggregate_filter[dummy]: src net 192.168.0.0/16 +aggregate: src_host, dst_host +! plugin_buffer_size: 1024 +! nfacctd_port: 5678 +! nfacctd_time_secs: true +! nfacctd_time_new: true +plugins: memory +imt_buckets: 65537 +imt_mem_pools_size: 65536 +! imt_mem_pools_number: 0 +! plugins: mysql +! plugins: pgsql +! plugins: sqlite3 +! sql_db: pmacct +! sql_table: acct +! sql_table_version: 2 +! sql_passwd: arealsmartpwd +! sql_user: pmacct +! sql_refresh_time: 90 +! sql_optimize_clauses: true +! sql_history: 10m +! sql_history_roundoff: mh +! networks_file: ./networks.example diff --git a/admin/pmacct/files/nfacctd.default b/admin/pmacct/files/nfacctd.default new file mode 100644 index 0000000..9315b28 --- /dev/null +++ b/admin/pmacct/files/nfacctd.default @@ -0,0 +1 @@ +OPTIONS="-f /etc/nfacctd.conf" diff --git a/admin/pmacct/files/nfacctd.init b/admin/pmacct/files/nfacctd.init new file mode 100644 index 0000000..66b9021 --- /dev/null +++ b/admin/pmacct/files/nfacctd.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +PROG="nfacctd" +DEFAULT="/etc/default/$PROG" +COMMAND="/usr/sbin/$PROG" + +start() { + [ -f $DEFAULT ] && . $DEFAULT + service_start $COMMAND $OPTIONS +} + +stop() { + service_stop $COMMAND +} diff --git a/admin/pmacct/files/pmacctd.conf b/admin/pmacct/files/pmacctd.conf new file mode 100644 index 0000000..e7e4892 --- /dev/null +++ b/admin/pmacct/files/pmacctd.conf @@ -0,0 +1,27 @@ +! +! pmacctd configuration example +! +! debug: true +interface: vlan1 +daemonize: true +pidfile: /var/run/pmacctd.pid +pmacctd_id: 1 +aggregate: src_host,dst_host +! aggregate: src_net,dst_net +plugins: memory +imt_buckets: 65537 +imt_mem_pools_size: 65536 +! imt_mem_pools_number: 0 +! plugins: mysql +! plugins: pgsql +! plugins: sqlite3 +! sql_db: pmacct +! sql_table: acct +! sql_table_version: 2 +! sql_passwd: arealsmartpwd +! sql_user: pmacct +! sql_refresh_time: 90 +! sql_optimize_clauses: true +! sql_history: 10m +! sql_history_roundoff: mh +! networks_file: ./networks.example diff --git a/admin/pmacct/files/pmacctd.default b/admin/pmacct/files/pmacctd.default new file mode 100644 index 0000000..3c06f08 --- /dev/null +++ b/admin/pmacct/files/pmacctd.default @@ -0,0 +1 @@ +OPTIONS="-f /etc/pmacctd.conf" diff --git a/admin/pmacct/files/pmacctd.init b/admin/pmacct/files/pmacctd.init new file mode 100644 index 0000000..3d75bcf --- /dev/null +++ b/admin/pmacct/files/pmacctd.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +PROG="pmacctd" +DEFAULT="/etc/default/$PROG" +COMMAND="/usr/sbin/$PROG" + +start() { + [ -f $DEFAULT ] && . $DEFAULT + service_start $COMMAND $OPTIONS +} + +stop() { + service_stop $COMMAND +} diff --git a/admin/pmacct/files/sfacctd.conf b/admin/pmacct/files/sfacctd.conf new file mode 100644 index 0000000..3d25e54 --- /dev/null +++ b/admin/pmacct/files/sfacctd.conf @@ -0,0 +1,27 @@ +! +! sfacctd configuration example +! +! debug: true +daemonize: true +pidfile: /var/run/sfacctd.pid +! aggregate_filter[dummy]: src net 192.168.0.0/16 +aggregate: src_host, dst_host +! plugin_buffer_size: 1024 +! sfacctd_port: 5678 +plugins: memory +imt_buckets: 65537 +imt_mem_pools_size: 65536 +! imt_mem_pools_number: 0 +! plugins: mysql +! plugins: pgsql +! plugins: sqlite3 +! sql_db: pmacct +! sql_table: acct +! sql_table_version: 2 +! sql_passwd: arealsmartpwd +! sql_user: pmacct +! sql_refresh_time: 90 +! sql_optimize_clauses: true +! sql_history: 10m +! sql_history_roundoff: mh +! networks_file: ./networks.example diff --git a/admin/pmacct/files/sfacctd.default b/admin/pmacct/files/sfacctd.default new file mode 100644 index 0000000..abd0c34 --- /dev/null +++ b/admin/pmacct/files/sfacctd.default @@ -0,0 +1 @@ +OPTIONS="-f /etc/sfacctd.conf" diff --git a/admin/pmacct/files/sfacctd.init b/admin/pmacct/files/sfacctd.init new file mode 100644 index 0000000..16468d4 --- /dev/null +++ b/admin/pmacct/files/sfacctd.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +PROG="sfacctd" +DEFAULT="/etc/default/$PROG" +COMMAND="/usr/sbin/$PROG" + +start() { + [ -f $DEFAULT ] && . $DEFAULT + service_start $COMMAND $OPTIONS +} + +stop() { + service_stop $COMMAND +} diff --git a/admin/pmacct/files/uacctd.conf b/admin/pmacct/files/uacctd.conf new file mode 100644 index 0000000..c8cdd7d --- /dev/null +++ b/admin/pmacct/files/uacctd.conf @@ -0,0 +1,28 @@ +! +! uacctd configuration example +! +! debug: true + +uacctd_group : 1 + +daemonize: true +pidfile: /var/run/uacctd.pid +aggregate: src_host,dst_host +! aggregate: src_net,dst_net +plugins: memory +imt_buckets: 65537 +imt_mem_pools_size: 65536 +! imt_mem_pools_number: 0 +! plugins: mysql +! plugins: pgsql +! plugins: sqlite3 +! sql_db: uacct +! sql_table: acct +! sql_table_version: 2 +! sql_passwd: arealsmartpwd +! sql_user: uacct +! sql_refresh_time: 90 +! sql_optimize_clauses: true +! sql_history: 10m +! sql_history_roundoff: mh +! networks_file: ./networks.example diff --git a/admin/pmacct/files/uacctd.default b/admin/pmacct/files/uacctd.default new file mode 100644 index 0000000..7b2834e --- /dev/null +++ b/admin/pmacct/files/uacctd.default @@ -0,0 +1 @@ +OPTIONS="-f /etc/uacctd.conf" diff --git a/admin/pmacct/files/uacctd.init b/admin/pmacct/files/uacctd.init new file mode 100644 index 0000000..39b27ba --- /dev/null +++ b/admin/pmacct/files/uacctd.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +PROG="uacctd" +DEFAULT="/etc/default/$PROG" +COMMAND="/usr/sbin/$PROG" + +start() { + [ -f $DEFAULT ] && . $DEFAULT + service_start $COMMAND $OPTIONS +} + +stop() { + service_stop $COMMAND +} diff --git a/admin/sudo/Makefile b/admin/sudo/Makefile new file mode 100644 index 0000000..9e9aa1a --- /dev/null +++ b/admin/sudo/Makefile @@ -0,0 +1,76 @@ +# +# Copyright (C) 2006-2011 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:=sudo +PKG_VERSION:=1.7.8p1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.sudo.ws/sudo/dist +PKG_MD5SUM:=5552b9aabc43e34bbc8dc557c098a933 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/sudo + SECTION:=admin + CATEGORY:=Administration + TITLE:=Delegate authority to run commands + URL:=http://www.sudo.ws/ +endef + +define Package/sudo/description + Sudo (su "do") allows a system administrator to delegate authority to + give certain users (or groups of users) the ability to run some (or + all) commands as root or another user while providing an audit trail of + the commands and their arguments. +endef + +define Package/sudo/conffiles +/etc/sudoers +endef + +CONFIGURE_ARGS+= \ + --without-pam \ + --disable-pam-session \ + --with-editor=/bin/vi \ + --without-lecture \ + --disable-zlib + +CONFIGURE_VARS+= \ + sudo_cv_uid_t_len=10 \ + sudo_cv_func_unsetenv_void=no + +define Package/sudo/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/sudo $(1)/usr/bin/ + chmod 4755 $(1)/usr/bin/sudo + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/visudo $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/sudoers $(1)/etc/ + chmod 0440 $(1)/etc/sudoers + $(INSTALL_DIR) $(1)/etc/sudoers.d + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/sudo_noexec.so $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/sudo.init $(1)/etc/init.d/sudo +endef + +define Package/sudo/postinst +#!/bin/sh + +[ -n "$$IPKG_INSTROOT" ] || { + /etc/init.d/sudo enable + /etc/init.d/sudo start +} +endef + +$(eval $(call BuildPackage,sudo)) diff --git a/admin/sudo/files/sudo.init b/admin/sudo/files/sudo.init new file mode 100755 index 0000000..9df2737 --- /dev/null +++ b/admin/sudo/files/sudo.init @@ -0,0 +1,11 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2011 OpenWrt.org + +START=99 + +start() { + [ -d /var/lib/sudo ] || { + mkdir -m 0755 -p /var/lib/sudo + chmod 0700 /var/lib/sudo + } +} diff --git a/admin/syslog-ng/Makefile b/admin/syslog-ng/Makefile new file mode 100644 index 0000000..4e5898e --- /dev/null +++ b/admin/syslog-ng/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2006-2012 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:=syslog-ng +PKG_VERSION:=1.6.12 +PKG_RELEASE:=6 +PKG_MD5SUM:=a3cbfdb6e1e5beea181a7349749719f3 + +PKG_SOURCE_URL:= \ + http://www.balabit.com/downloads/files/syslog-ng/sources/1.6/src \ + http://www.balabit.com/downloads/files/syslog-ng/stable/src +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/syslog-ng + SECTION:=admin + CATEGORY:=Administration + DEPENDS:=+libol +librt + TITLE:=A powerful syslog daemon + URL:=http://www.balabit.com/products/syslog_ng/ +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/syslog-ng.conf +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-dependency-tracking \ + --disable-full-static \ + --enable-tcp-wrapper \ + --with-libol="$(STAGING_DIR)/host/bin" \ + , \ + CPPFLAGS="-I$(STAGING_DIR)/usr/include/libol $(TARGET_CPPFLAGS)" \ + LDFLAGS="-L$(STAGING_DIR)/usr/lib/libol $(TARGET_LDFLAGS)" \ + ) +endef + +define Package/syslog-ng/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/syslog-ng $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/syslog-ng.init $(1)/etc/init.d/syslog-ng + $(INSTALL_DIR) $(1)/etc/syslog-ng + $(INSTALL_DATA) ./files/syslog-ng.conf $(1)/etc/syslog-ng/ +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 index 0000000..658abea --- /dev/null +++ b/admin/syslog-ng/files/syslog-ng.conf @@ -0,0 +1,16 @@ +options { + chain_hostnames(off); + sync(0); + + # The default action of syslog-ng 1.6.0 is to log a STATS line + # to the file every 10 minutes. That's pretty ugly after a while. + # Change it to every 12 hours so you get a nice daily update of + # how many messages syslog-ng missed (0). + stats(43200); +}; + +source src { unix-stream("/dev/log"); internal(); }; + +destination messages { file("/var/log/messages"); }; + +log { source(src); destination(messages); }; diff --git a/admin/syslog-ng/files/syslog-ng.init b/admin/syslog-ng/files/syslog-ng.init new file mode 100644 index 0000000..07b8a05 --- /dev/null +++ b/admin/syslog-ng/files/syslog-ng.init @@ -0,0 +1,17 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +start() { + [ -f /etc/syslog-ng/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/admin/syslog-ng/patches/001-no_lfl.patch b/admin/syslog-ng/patches/001-no_lfl.patch new file mode 100644 index 0000000..ce33d95 --- /dev/null +++ b/admin/syslog-ng/patches/001-no_lfl.patch @@ -0,0 +1,38 @@ +diff -ubr /tmp/syslog-ng-1.6.12/configure syslog-ng-1.6.12/configure +--- /tmp/syslog-ng-1.6.12/configure 2007-02-02 02:58:41.000000000 -0600 ++++ syslog-ng-1.6.12/configure 2007-03-03 20:39:40.000000000 -0600 +@@ -3695,7 +3695,7 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lfl $LIBS" ++LIBS="$LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +diff -ubr /tmp/syslog-ng-1.6.12/Makefile.in syslog-ng-1.6.12/Makefile.in +--- /tmp/syslog-ng-1.6.12/Makefile.in 2007-02-02 02:58:41.000000000 -0600 ++++ syslog-ng-1.6.12/Makefile.in 2007-03-03 20:38:56.000000000 -0600 +@@ -65,7 +65,7 @@ + INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ + LDFLAGS = @LDFLAGS@ + LEX = @LEX@ +-LEXLIB = @LEXLIB@ ++LEXLIB = + LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ + LIBOBJS = @LIBOBJS@ + LIBOL_DIR = @LIBOL_DIR@ +diff -ubr /tmp/syslog-ng-1.6.12/src/cfg-lex.c syslog-ng-1.6.12/src/cfg-lex.c +--- /tmp/syslog-ng-1.6.12/src/cfg-lex.c 2006-08-22 03:43:36.000000000 -0500 ++++ syslog-ng-1.6.12/src/cfg-lex.c 2007-03-03 20:36:52.000000000 -0600 +@@ -668,7 +668,9 @@ + #ifdef __cplusplus + extern "C" int yywrap (void ); + #else +-extern int yywrap (void ); ++int yywrap (void ) { ++ return 1; ++} + #endif + #endif + diff --git a/admin/syslog-ng3/Makefile b/admin/syslog-ng3/Makefile new file mode 100644 index 0000000..a3dbe25 --- /dev/null +++ b/admin/syslog-ng3/Makefile @@ -0,0 +1,72 @@ +# +# Copyright (C) 2006-2011 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:=syslog-ng +PKG_VERSION:=3.0.5 +PKG_RELEASE:=5 + +PKG_SOURCE_URL:=http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/$(PKG_VERSION)/source/ +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz +PKG_MD5SUM:=28f0d9ff2243b330e8cd6311ef9b2f12 + +PKG_CONFIG_DEPENDS:= \ + CONFIG_IPV6 \ + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/syslog-ng3 + SECTION:=admin + CATEGORY:=Administration + DEPENDS:=+libpcre +glib2 +libeventlog +libopenssl +libwrap +libpthread +librt +zlib +libdbi + TITLE:=A powerful syslog daemon + URL:=http://www.balabit.com/network-security/syslog-ng/opensource-logging-system/ +endef + +define Package/syslog-ng3/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-ng3/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 \ + --enable-tcp-wrapper \ + --disable-glibtest \ + --disable-spoof-source \ + --disable-sql \ + --enable-prce \ + --disable-linux-caps \ + +TARGET_CPPFLAGS += \ + -I$(STAGING_DIR)/usr/include/eventlog + +CONFIGURE_VARS += \ + LIBDBI_CFLAGS="-I$(STAGING_DIR)/usr/include" + +define Package/syslog-ng3/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/syslog-ng $(1)/usr/sbin/ + $(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 +endef + +$(eval $(call BuildPackage,syslog-ng3)) diff --git a/admin/syslog-ng3/files/syslog-ng.conf b/admin/syslog-ng3/files/syslog-ng.conf new file mode 100644 index 0000000..972848c --- /dev/null +++ b/admin/syslog-ng3/files/syslog-ng.conf @@ -0,0 +1,37 @@ +@version:3.0 + +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-ng3/files/syslog-ng.init b/admin/syslog-ng3/files/syslog-ng.init new file mode 100644 index 0000000..a8bad3d --- /dev/null +++ b/admin/syslog-ng3/files/syslog-ng.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +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/admin/zabbix/Makefile b/admin/zabbix/Makefile new file mode 100644 index 0000000..50b7df6 --- /dev/null +++ b/admin/zabbix/Makefile @@ -0,0 +1,149 @@ +# +# Copyright (C) 2006-2012 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:=zabbix +PKG_VERSION:=2.0.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/zabbix +PKG_MD5SUM:=d34d398beddee0eaa999789100cf74e3 + +PKG_INSTALL:=1 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/zabbix/Default + SECTION:=admin + CATEGORY:=Administration + TITLE:=Zabbix + URL:=http://www.zabbix.com/ + SUBMENU:=zabbix + MAINTAINER:=Mirko Vogt +endef + +define Package/zabbix-agent + $(call Package/zabbix/Default) + TITLE+= agent +endef + +define Package/zabbix-agentd + $(call Package/zabbix/Default) + TITLE+= agentd +endef + +define Package/zabbix-sender + $(call Package/zabbix/Default) + TITLE+= sender +endef + +define Package/zabbix-get + $(call Package/zabbix/Default) + TITLE+= get +endef + +define Package/zabbix-server + $(call Package/zabbix/Default) + TITLE+= server + DEPENDS += +libsqlite3 +endef + +define Package/zabbix-proxy + $(call Package/zabbix/Default) + TITLE+= proxy + DEPENDS += +libsqlite3 +endef + +CONFIGURE_ARGS+= \ + --enable-agent \ + --enable-server \ + --enable-proxy \ + --disable-java \ + --with-sqlite3="$(STAGING_DIR)/usr" + +MAKE_FLAGS += ARCH="linux" + +define Package/zabbix/install/sbin + $(INSTALL_DIR) \ + $(1)/usr/sbin + + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/sbin/zabbix_$(2) \ + $(1)/usr/sbin/ +endef + +define Package/zabbix/install/bin + $(INSTALL_DIR) \ + $(1)/usr/bin + + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/zabbix_$(2) \ + $(1)/usr/bin/ +endef + +define Package/zabbix/install/etc + $(INSTALL_DIR) \ + $(1)/etc + + $(INSTALL_CONF) \ + $(PKG_INSTALL_DIR)/etc/zabbix_$(2).conf \ + $(1)/etc/ +endef + +define Package/zabbix/install/init.d + $(INSTALL_DIR) \ + $(1)/etc/init.d + + $(INSTALL_BIN) \ + ./files/zabbix_$(2).init \ + $(1)/etc/init.d/zabbix_$(2) +endef + +define Package/zabbix-$(1)/conffiles + /etc/zabbix/zabbix_$(1).conf +endef + +define Package/zabbix-agent/install + $(call Package/zabbix/install/sbin,$(1),agent) + $(call Package/zabbix/install/etc,$(1),agent) +endef + +define Package/zabbix-agentd/install + $(call Package/zabbix/install/sbin,$(1),agentd) + $(call Package/zabbix/install/etc,$(1),agentd) + $(call Package/zabbix/install/init.d,$(1),agentd) +endef + +define Package/zabbix-sender/install + $(call Package/zabbix/install/bin,$(1),sender) +endef + +define Package/zabbix-get/install + $(call Package/zabbix/install/bin,$(1),get) +endef + +define Package/zabbix-server/install + $(call Package/zabbix/install/sbin,$(1),server) + $(call Package/zabbix/install/etc,$(1),server) +endef + +define Package/zabbix-proxy/install + $(call Package/zabbix/install/sbin,$(1),proxy) + $(call Package/zabbix/install/etc,$(1),proxy) +endef + +$(eval $(call BuildPackage,zabbix-agent)) +$(eval $(call BuildPackage,zabbix-agentd)) +$(eval $(call BuildPackage,zabbix-sender)) +$(eval $(call BuildPackage,zabbix-server)) +$(eval $(call BuildPackage,zabbix-proxy)) +$(eval $(call BuildPackage,zabbix-get)) diff --git a/admin/zabbix/files/zabbix_agentd.conf b/admin/zabbix/files/zabbix_agentd.conf new file mode 100644 index 0000000..4cc2f51 --- /dev/null +++ b/admin/zabbix/files/zabbix_agentd.conf @@ -0,0 +1,85 @@ +# This is config file for zabbix_agentd +# To get more information about ZABBIX, go http://www.zabbix.com + +############ GENERAL PARAMETERS ################# + +# List of comma delimited IP addresses (or hostnames) of ZABBIX servers. +# No spaces allowed. First entry is used for sending active checks. +# Note that hostnames must resolve hostname->IP address and +# IP address->hostname. + +Server=127.0.0.1 + +# Server port for sending active checks + +#ServerPort=10051 + +# Unique hostname. Required for active checks. + +Hostname=localhost + +# Listen port. Default is 10050 + +#ListenPort=10050 + +# IP address to bind agent +# If missing, bind to all available IPs + +#ListenIP=127.0.0.1 + +# Number of pre-forked instances of zabbix_agentd. +# Default value is 5 +# This parameter must be between 1 and 16 + +StartAgents=5 + +# How often refresh list of active checks. 2 minutes by default. + +#RefreshActiveChecks=120 + +# Disable active checks. The agent will work in passive mode listening server. + +#DisableActive=1 + +# Enable remote commands for ZABBIX agent. By default remote commands disabled. + +#EnableRemoteCommands=1 + +# Specifies debug level +# 0 - debug is not created +# 1 - critical information +# 2 - error information +# 3 - warnings +# 4 - information (default) +# 5 - for debugging (produces lots of information) + +DebugLevel=3 + +# Name of PID file + +PidFile=/var/run/zabbix/zabbix_agentd.pid + +# Name of log file. +# If not set, syslog will be used + +LogFile=/var/log/zabbix/zabbix_agentd.log + +# Spend no more than Timeout seconds on processing +# Must be between 1 and 30 + +Timeout=3 + +####### USER-DEFINED MONITORED PARAMETERS ####### +# Format: UserParameter=, +# Note that shell command must not return empty string or EOL only +#UserParameter=system.test,who|wc -l +### Set of parameter for monitoring MySQL server (v3.23.42 and later) +### Change -u and add -p if required +#UserParameter=mysql.ping,mysqladmin -uroot ping|grep alive|wc -l +#UserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T" +#UserParameter=mysql.threads,mysqladmin -uroot status|cut -f3 -d":"|cut -f1 -d"Q" +#UserParameter=mysql.questions,mysqladmin -uroot status|cut -f4 -d":"|cut -f1 -d"S" +#UserParameter=mysql.slowqueries,mysqladmin -uroot status|cut -f5 -d":"|cut -f1 -d"O" +#UserParameter=mysql.qps,mysqladmin -uroot status|cut -f9 -d":" +#UserParameter=mysql.version,mysql -V + diff --git a/admin/zabbix/files/zabbix_agentd.init b/admin/zabbix/files/zabbix_agentd.init new file mode 100644 index 0000000..3c70009 --- /dev/null +++ b/admin/zabbix/files/zabbix_agentd.init @@ -0,0 +1,25 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2011 OpenWrt.org + +START=60 + +SERVICE_PID_FILE=/var/run/zabbix/zabbix_agentd.pid + +start() { + [ -f /etc/zabbix/zabbix_agentd.conf ] || return 1 + user_exists zabbix 53 || user_add zabbix 53 + group_exists zabbix 53 || group_add zabbix 53 + [ -d /var/log/zabbix ] || { + mkdir -m0755 -p /var/log/zabbix + chown zabbix:zabbix /var/log/zabbix + } + [ -d /var/run/zabbix ] || { + mkdir -m0755 -p /var/run/zabbix + chown zabbix:zabbix /var/run/zabbix + } + service_start /usr/sbin/zabbix_agentd +} + +stop() { + service_stop /usr/sbin/zabbix_agentd +} diff --git a/admin/zabbix/patches/001-cross_compile.patch b/admin/zabbix/patches/001-cross_compile.patch new file mode 100644 index 0000000..6e96dfb --- /dev/null +++ b/admin/zabbix/patches/001-cross_compile.patch @@ -0,0 +1,29 @@ +--- a/configure.in 2012-06-21 21:32:23.707912790 +0000 ++++ b/configure.in 2012-06-21 21:33:36.213554564 +0000 +@@ -806,25 +806,8 @@ + + dnl Check for %qu format (FreeBSD 4.x) + dnl FreeBSD 4.x does not support %llu +-AC_MSG_CHECKING(for long long format) +-AC_TRY_RUN( +-[ +-#include +-int main() +-{ +- uint64_t i; +- +- sscanf("200000000010020", "%qu", &i); +- +- if (i == 200000000010020) return 0; +- else return -1; +-} +-], +-AC_DEFINE(HAVE_LONG_LONG_QU, 1 ,[Define to 1 if format '%qu' exists.]) +-AC_MSG_RESULT(yes), +-AC_MSG_RESULT(no)) +- + dnl option -rdynamic is needed for readable backtraces ++ + AC_MSG_CHECKING(for -rdynamic linking option) + saved_LDFLAGS="$LDFLAGS" + LDFLAGS="-rdynamic $LDFLAGS" diff --git a/admin/zabbix/patches/002-fix-res_send-on-uclibc.patch b/admin/zabbix/patches/002-fix-res_send-on-uclibc.patch new file mode 100644 index 0000000..63a6891 --- /dev/null +++ b/admin/zabbix/patches/002-fix-res_send-on-uclibc.patch @@ -0,0 +1,35 @@ +--- a/configure.in 2012-05-21 14:07:37.000000000 +0000 ++++ b/configure.in 2012-06-21 19:46:34.843662509 +0000 +@@ -149,6 +149,10 @@ + AC_MSG_ERROR([Unable to DNS lookup functions "${found_resolv}"]) + fi + LIBS="${LIBS} ${RESOLV_LIBS}" ++AC_SEARCH_LIBS([res_mkquery], [], [AC_DEFINE([HAVE_RES_MKQUERY], 1, [Define if res_mkquery exists])]) ++AC_SEARCH_LIBS([__res_mkquery], [], [AC_DEFINE([HAVE_RES_MKQUERY], 1, [Define if res_mkquery exists])]) ++AC_SEARCH_LIBS([res_send], [], [AC_DEFINE([HAVE_RES_SEND], 1, [Define if res_send exists])]) ++AC_SEARCH_LIBS([__res_send], [], [AC_DEFINE([HAVE_RES_SEND], 1, [Define if res_send exists])]) + + dnl ***************************************************************** + dnl * * +--- a/src/libs/zbxsysinfo/common/net.c 2012-06-21 19:49:46.610567432 +0000 ++++ b/src/libs/zbxsysinfo/common/net.c 2012-06-21 19:50:35.816628541 +0000 +@@ -418,6 +418,7 @@ + #else /* not _WINDOWS */ + res_init(); /* initialize always, settings might have changed */ + ++#if defined(HAVE_RES_MKQUERY) && defined(HAVE_RES_SEND) + if (-1 == (res = res_mkquery(QUERY, zone, C_IN, type, NULL, 0, NULL, buf, sizeof(buf)))) + return SYSINFO_RET_FAIL; + +@@ -436,6 +437,11 @@ + _res.retry = retry; + + res = res_send(buf, res, answer.buffer, sizeof(answer.buffer)); ++#else /* defined(HAVE_RES_QUERY) && defined(HAVE_RES_SEND) */ ++ /* retrand and retry are ignored */ ++ if (-1 == (res = res_query(zone, C_IN, type, answer.buffer, sizeof(answer.buffer)))) ++ return SYSINFO_RET_FAIL; ++#endif + + hp = (HEADER *)answer.buffer; + diff --git a/admin/zabbix/patches/002-uclibc_loadavg.patch b/admin/zabbix/patches/002-uclibc_loadavg.patch new file mode 100644 index 0000000..6439edf --- /dev/null +++ b/admin/zabbix/patches/002-uclibc_loadavg.patch @@ -0,0 +1,49 @@ +diff -urN zabbix-1.6/src/libs/zbxsysinfo/linux/cpu.c zabbix-1.6.new/src/libs/zbxsysinfo/linux/cpu.c +--- zabbix-1.6/src/libs/zbxsysinfo/linux/cpu.c 2008-09-18 22:15:26.000000000 +0200 ++++ zabbix-1.6.new/src/libs/zbxsysinfo/linux/cpu.c 2008-09-30 19:32:54.000000000 +0200 +@@ -22,6 +22,45 @@ + #include "sysinfo.h" + #include "stats.h" + ++ ++/* uclibc and dietlibc do not have this junk -ReneR */ ++#if defined (__UCLIBC__) || defined (__dietlibc__) ++static int getloadavg (double loadavg[], int nelem) ++{ ++ int fd; ++ ++ fd = open ("/proc/loadavg", O_RDONLY); ++ if (fd < 0) ++ return -1; ++ else ++ { ++ char buf[65], *p; ++ ssize_t nread; ++ int i; ++ ++ nread = read (fd, buf, sizeof buf - 1); ++ close (fd); ++ if (nread <= 0) ++ return -1; ++ buf[nread - 1] = '\0'; ++ ++ if (nelem > 3) ++ nelem = 3; ++ p = buf; ++ for (i = 0; i < nelem; ++i) ++ { ++ char *endp; ++ loadavg[i] = strtod (p, &endp); ++ if (endp == p) ++ return -1; ++ p = endp; ++ } ++ ++ return i; ++ } ++} ++#endif ++ + int SYSTEM_CPU_NUM(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) + { + char mode[128]; diff --git a/devel/binutils/Makefile b/devel/binutils/Makefile new file mode 100644 index 0000000..fc07eda --- /dev/null +++ b/devel/binutils/Makefile @@ -0,0 +1,113 @@ +# +# Copyright (C) 2006-2011 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:=binutils +PKG_VERSION:=$(strip $(subst ",, $(CONFIG_BINUTILS_VERSION))) +#")) +PKG_RELEASE:=5 + +PKG_SOURCE_URL:=@GNU/binutils +PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2 +PKG_MD5SUM:= + +PATCH_DIR:=$(TOPDIR)/toolchain/binutils/patches/$(PKG_VERSION) + +PKG_FIXUP:=autoreconf +PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl +PKG_REMOVE_FILES:=libtool.m4 +PKG_INSTALL:=1 + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/binutils + SECTION:=devel + CATEGORY:=Development + TITLE:=binutils + DEPENDS:=+objdump +endef + +define Package/objdump + SECTION:=devel + CATEGORY:=Development + TITLE:=objdump + DEPENDS:=+zlib +endef + +define Package/binutils/description + The Binutils package contains a linker, an assembler, and other tools for handling object files +endef + +CONFIGURE_ARGS = \ + --target=$(REAL_GNU_TARGET_NAME) \ + --host=$(REAL_GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=/usr \ + --disable-multilib \ + --disable-werror \ + --disable-nls \ + --enable-shared \ + $(SOFT_FLOAT_CONFIG_OPTION) \ + $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) + +TARGET_CFLAGS += $(FPIC) +TARGET_LDFLAGS := -L$(PKG_BUILD_DIR)/libiberty $(TARGET_LDFLAGS) + +define Build/Configure + $(call Build/Configure/Default) + $(call Build/Compile/Default, \ + configure-bfd \ + configure-binutils \ + configure-etc \ + configure-gas \ + configure-gprof \ + configure-intl \ + configure-ld \ + configure-libiberty \ + configure-opcodes \ + ) + $(MAKE) CFLAGS="$(TARGET_CFLAGS)" -C $(PKG_BUILD_DIR)/bfd/po Makefile +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/{lib,include} + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/* \ + $(1)/usr/lib/ + $(CP) \ + $(PKG_BUILD_DIR)/include/*.h \ + $(1)/usr/include/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/* \ + $(1)/usr/include/ + rm -f $(1)/usr/include/gdbm.h +endef + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew + $(call Build/Compile/Default) +endef + +define Package/objdump/install + $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/bin/objdump $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopcodes*.so $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so $(1)/usr/lib/ +endef + +define Package/binutils/install + $(INSTALL_DIR) $(1)/usr $(1)/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/ + mv $(1)/usr/bin/strings $(1)/bin/strings + rm -f $(1)/usr/bin/objdump +endef + +$(eval $(call BuildPackage,binutils)) +$(eval $(call BuildPackage,objdump)) diff --git a/devel/build-essential/Makefile b/devel/build-essential/Makefile new file mode 100644 index 0000000..f22611d --- /dev/null +++ b/devel/build-essential/Makefile @@ -0,0 +1,33 @@ +# +# Copyright (C) 2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# blogic@openwrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=build-essential +PKG_RELEASE:=1 +PKG_VERSION:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/build-essential + SECTION:=devel + CATEGORY:=Development + TITLE:=Build essentials + DEPENDS=+gcc +make +binutils +patch +diffutils @NO_STRIP + PKGARCH:=all +endef + +define Build/Compile + +endef + +define Package/build-essential/install + cp -r ./files/* $(1) +endef + +$(eval $(call BuildPackage,build-essential)) diff --git a/devel/build-essential/files/usr/src/hello/hello.c b/devel/build-essential/files/usr/src/hello/hello.c new file mode 100644 index 0000000..e693fd8 --- /dev/null +++ b/devel/build-essential/files/usr/src/hello/hello.c @@ -0,0 +1,8 @@ +#include + +int main(int argc, char **argv) +{ + printf("Hello OpenWrt\n"); + + return 0; +} diff --git a/devel/cppunit/Makefile b/devel/cppunit/Makefile new file mode 100644 index 0000000..91b74e6 --- /dev/null +++ b/devel/cppunit/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2011 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:=cppunit +PKG_VERSION:=1.12.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/cppunit +PKG_MD5SUM:=bd30e9cf5523cdfc019b94f5e1d7fd19 + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk + +define Package/cppunit + SECTION:=devel + CATEGORY:=Development + TITLE:=Unit Testing Library for C++ + URL:=http://cppunit.sourceforge.net/ + DEPENDS:=+libstdcpp +endef + +define Package/cppunit/description + Unit Testing Library for C++ +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/cppunit + $(CP) $(PKG_INSTALL_DIR)/usr/include/cppunit $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcppunit*so* $(1)/usr/lib/ +endef + +define Package/cppunit/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcppunit*so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,cppunit)) diff --git a/devel/diffutils/Makefile b/devel/diffutils/Makefile new file mode 100644 index 0000000..05cd360 --- /dev/null +++ b/devel/diffutils/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2008-2012 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:=diffutils +PKG_VERSION:=3.0 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/diffutils +PKG_MD5SUM:=684aaba1baab743a2a90e52162ff07da + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/diffutils + SECTION:=devel + CATEGORY:=Development + DEPENDS:=+USE_EGLIBC:librt + TITLE:=diffutils + URL:=http://www.gnu.org/software/diffutils/ +endef + +define Package/diffutils/description + The Diffutils package contains programs that show the differences between + files or directories. +endef + +CONFIGURE_VARS += \ + ac_cv_func_mempcpy=n \ + +define Package/diffutils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{sdiff,diff3,diff,cmp} $(1)/usr/bin/ +endef + +define Package/diffutils/preinst +#!/bin/sh +for x in sdiff diff3 diff cmp; do + [ -L "$${IPKG_INSTROOT}/usr/bin/$$x" ] && rm -f "$${IPKG_INSTROOT}/usr/bin/$$x" +done +exit 0 +endef + +define Package/diffutils/postrm +#!/bin/sh +for x in sdiff diff3 diff cmp; do + /bin/busybox $$x -h 2>&1 | grep -q BusyBox && ln -sf ../../bin/busybox /usr/bin/$$x +done +exit 0 +endef + +$(eval $(call BuildPackage,diffutils)) diff --git a/devel/dmalloc/Makefile b/devel/dmalloc/Makefile new file mode 100644 index 0000000..9e3e664 --- /dev/null +++ b/devel/dmalloc/Makefile @@ -0,0 +1,78 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=dmalloc +PKG_VERSION:=5.5.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://dmalloc.com/releases/ +PKG_MD5SUM:=f92e5606c23a8092f3d5694e8d1c932e + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/dmalloc/Default + SECTION:=devel + CATEGORY:=Development + TITLE:=Dmalloc + URL:=http://www.dmalloc.com/ +endef + +define Package/libdmalloc + $(call Package/dmalloc/Default) + TITLE+= (library) + DEPENDS:=@USE_EGLIBC +endef + +define Package/dmalloc-utils + $(call Package/dmalloc/Default) + DEPENDS:=+libdmalloc + TITLE+= (utilities) +endef + +define Package/dmalloc/description +The debug memory allocation or dmalloc library has been designed as a drop in +replacement for the system's malloc, realloc, calloc, free and other memory +management routines while providing powerful debugging facilities configurable +at runtime. These facilities include such things as memory-leak tracking, +fence-post write detection, file/line number reporting, and general logging of +statistics. +endef + +CONFIGURE_ARGS += \ + --disable-cxx \ + --with-pagesize=12 + +TARGET_CFLAGS += $(FPIC) + +MAKE_INSTALL_FLAGS += installsl + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/dmalloc.h $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libdmalloc.{a,so*} $(1)/usr/lib/ +endef + +define Package/libdmalloc/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libdmalloc.so* $(1)/usr/lib/ +endef + +define Package/dmalloc-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dmalloc $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libdmalloc)) +$(eval $(call BuildPackage,dmalloc-utils)) diff --git a/devel/dmalloc/patches/100-configure_pagesize.patch b/devel/dmalloc/patches/100-configure_pagesize.patch new file mode 100644 index 0000000..0482d7a --- /dev/null +++ b/devel/dmalloc/patches/100-configure_pagesize.patch @@ -0,0 +1,44 @@ +--- a/configure ++++ b/configure +@@ -857,6 +857,11 @@ Optional Features: + --enable-threads build in thread support (disabled by default) + --enable-shlib build shared libraries (disabled by default) + ++Optional Packages: ++ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] ++ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) ++ --with-pagesize=nbits log base 2 of machine page size ++ + Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags +@@ -5307,6 +5312,14 @@ done + echo "$as_me:$LINENO: checking basic-block size" >&5 + echo $ECHO_N "checking basic-block size... $ECHO_C" >&6 + ac_cv_page_size=0 ++ ++# Check whether --with-pagesize or --without-pagesize was given. ++if test "${with_pagesize+set}" = set; then ++ withval="$with_pagesize" ++ case "$withval" in ?|1?) ac_cv_page_size=$withval; esac ++else ++ : # default to probing, set above ++fi; + if test $ac_cv_page_size = 0; then + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +--- a/configure.ac ++++ b/configure.ac +@@ -349,6 +349,12 @@ AC_MSG_RESULT([$ac_cv_use_mmap]) + AC_CHECK_FUNCS(getpagesize) + AC_MSG_CHECKING([basic-block size]) + ac_cv_page_size=0 ++AC_ARG_WITH(pagesize, ++ [ AC_HELP_STRING([--with-pagesize=nbits], ++ [log base 2 of machine page size] ) ], ++ [ case "$withval" in ?|1?) ac_cv_page_size=$withval; esac ], ++ [ : # default to probing, set above ], ++) + if test $ac_cv_page_size = 0; then + AC_RUN_IFELSE([main() { if (getpagesize()<=2048) exit(0); else exit(1); }], + [ ac_cv_page_size=11 ] ) diff --git a/devel/dmalloc/patches/110-configure_cxx.patch b/devel/dmalloc/patches/110-configure_cxx.patch new file mode 100644 index 0000000..4a2e8d7 --- /dev/null +++ b/devel/dmalloc/patches/110-configure_cxx.patch @@ -0,0 +1,38 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -56,10 +56,11 @@ AC_PROG_CC + AC_PROG_CXX + + # see if we actually have a CXX program +-if test "$ac_cv_prog_CXX" = "" -o ! -x "$ac_cv_prog_CXX"; then +- AC_MSG_WARN(could not find C++ compiler $ac_cv_prog_CXX) +- enable_cxx=no +-fi ++# FIXME: always returns no ++#if test "$ac_cv_prog_CXX" = "" -o ! -x "$ac_cv_prog_CXX"; then ++# AC_MSG_WARN(could not find C++ compiler $ac_cv_prog_CXX) ++# enable_cxx=no ++#fi + + # hopefully we have a stdc c-compiler + if test "$ac_cv_prog_cc_stdc" = "no" ; then +--- a/configure ++++ b/configure +@@ -2648,11 +2648,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # see if we actually have a CXX program +-if test "$ac_cv_prog_CXX" = "" -o ! -x "$ac_cv_prog_CXX"; then +- { echo "$as_me:$LINENO: WARNING: could not find C++ compiler $ac_cv_prog_CXX" >&5 +-echo "$as_me: WARNING: could not find C++ compiler $ac_cv_prog_CXX" >&2;} +- enable_cxx=no +-fi ++# FIXME: always returns no ++#if test "$ac_cv_prog_CXX" = "" -o ! -x "$ac_cv_prog_CXX"; then ++# { echo "$as_me:$LINENO: WARNING: could not find C++ compiler $ac_cv_prog_CXX" >&5 ++#echo "$as_me: WARNING: could not find C++ compiler $ac_cv_prog_CXX" >&2;} ++# enable_cxx=no ++#fi + + # hopefully we have a stdc c-compiler + if test "$ac_cv_prog_cc_stdc" = "no" ; then diff --git a/devel/dmalloc/patches/120-makefile_shared.patch b/devel/dmalloc/patches/120-makefile_shared.patch new file mode 100644 index 0000000..1fd6ae4 --- /dev/null +++ b/devel/dmalloc/patches/120-makefile_shared.patch @@ -0,0 +1,305 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -41,7 +41,7 @@ LIBRARY = lib$(MODULE).a + + # thread version of the library + LIB_TH = lib$(MODULE)th.a +-LIB_TH_SL = lib$(MODULE)th.@shlibext@ ++LIB_TH_SL = lib$(MODULE)th.@shlibext@.5.5.2 + @TH_ON@BUILD_ALL_1 = threads + @TH_ON@INSTALL_LIB_1 = installth + @SL_ON@BUILD_THREADS_1 = $(LIB_TH_SL) +@@ -50,8 +50,8 @@ LIB_TH_SL = lib$(MODULE)th.@shlibext@ + @TH_ON@@SL_ON@INSTALL_LIB_2 = installthsl + + # C++ version of the library +-LIB_CXX = lib$(MODULE)xx.a +-LIB_CXX_SL = lib$(MODULE)xx.@shlibext@ ++LIB_CXX = lib$(MODULE)cxx.a ++LIB_CXX_SL = lib$(MODULE)cxx.@shlibext@.5.5.2 + @CXX_ON@BUILD_ALL_3 = $(LIB_CXX) + @CXX_ON@INSTALL_LIB_3 = installcxx + @SL_ON@BUILD_CXX_3 = $(LIB_CXX_SL) +@@ -61,7 +61,7 @@ LIB_CXX_SL = lib$(MODULE)xx.@shlibext@ + + # threads + C++ + LIB_TH_CXX = lib$(MODULE)thcxx.a +-LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlibext@ ++LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlibext@.5.5.2 + @TH_ON@@CXX_ON@BUILD_ALL_5 = $(LIB_TH_CXX) + @TH_ON@@CXX_ON@INSTALL_LIB_5 = installthcxx + @TH_ON@BUILD_CXX_5 = $(LIB_TH_CXX) +@@ -76,7 +76,7 @@ LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlib + @CXX_ON@@SL_ON@INSTALL_THREADS_6 = installthcxxsl + + # shared versions of the libraries +-LIB_SL = lib$(MODULE).@shlibext@ ++LIB_SL = lib$(MODULE).@shlibext@.5.5.2 + @SL_ON@BUILD_ALL_7 = $(LIB_SL) + @SL_ON@INSTALL_LIB_7 = installsl + @SL_ON@BUILD_TH_CXX_7 = $(LIB_TH_CXX_SL) +@@ -145,9 +145,13 @@ SHELL = /bin/sh + + HFLS = dmalloc.h + OBJS = arg_check.o compat.o dmalloc_rand.o dmalloc_tab.o env.o heap.o ++OBJS_SL = arg_check_sl.o compat_sl.o dmalloc_rand_sl.o dmalloc_tab_sl.o env_sl.o heap_sl.o + NORMAL_OBJS = chunk.o error.o malloc.o ++NORMAL_OBJS_SL = chunk_sl.o error_sl.o malloc_sl.o + THREAD_OBJS = chunk_th.o error_th.o malloc_th.o ++THREAD_OBJS_SL = chunk_th_sl.o error_th_sl.o malloc_th_sl.o + CXX_OBJS = dmallocc.o ++CXX_OBJS_SL = dmallocc_sl.o + + CFLAGS = $(CCFLAGS) + TEST = $(MODULE)_t +@@ -160,9 +164,9 @@ all : $(BUILD_ALL) + + clean : + rm -f $(A_OUT) core *.o *.t +- rm -f $(LIBRARY) $(LIB_TH) $(LIB_CXX) $(LIB_TH_CXX) $(TEST) $(TEST_FC) +- rm -f $(LIB_TH_SL) $(LIB_CXX_SL) $(LIB_TH_CXX_SL) $(LIB_SL) ++ rm -f $(TEST) $(TEST_FC) + rm -f $(UTIL) dmalloc.h ++ rm -f lib$(MODULE)*.* + + realclean : clean + +@@ -181,43 +185,43 @@ installincs : $(HFLS) + $(INSTALL_DATA) $(HFLS) $(includedir) + + installthsl : $(LIB_TH_SL) +- $(srcdir)/mkinstalldirs $(libdir) +- $(INSTALL_PROGRAM) $(LIB_TH_SL) $(libdir) ++ $(srcdir)/mkinstalldirs $(shlibdir) ++ $(INSTALL) $(LIB_TH_SL) $(shlibdir) + + installth : $(INSTALL_THREADS) + $(srcdir)/mkinstalldirs $(libdir) +- $(INSTALL_PROGRAM) $(LIB_TH) $(libdir) ++ $(INSTALL) $(LIB_TH) $(libdir) + @CXX_OFF@ @echo "Enter 'make installthcxx' to install the threaded C++ library" + @SL_OFF@ @echo "Enter 'make installthsl' to install the threaded shared-library" + + installthcxxsl : $(LIB_TH_CXX_SL) + $(srcdir)/mkinstalldirs $(shlibdir) +- $(INSTALL_PROGRAM) $(LIB_TH_CXX_SL) $(shlibdir) ++ $(INSTALL) $(LIB_TH_CXX_SL) $(shlibdir) + + installthcxx : $(INSTALL_TH_CXX) + $(srcdir)/mkinstalldirs $(libdir) +- $(INSTALL_PROGRAM) $(LIB_TH_CXX) $(libdir) ++ $(INSTALL) $(LIB_TH_CXX) $(libdir) + @SL_OFF@ @echo "Enter 'make installthcxxsl' to install the threaded C++ shared-library" + + installcxxsl : $(LIB_CXX_SL) +- $(srcdir)/mkinstalldirs $(libdir) +- $(INSTALL_PROGRAM) $(LIB_CXX_SL) $(libdir) ++ $(srcdir)/mkinstalldirs $(shlibdir) ++ $(INSTALL) $(LIB_CXX_SL) $(shlibdir) + + installcxx : $(INSTALL_CXX) + $(srcdir)/mkinstalldirs $(libdir) +- $(INSTALL_PROGRAM) $(LIB_CXX) $(libdir) ++ $(INSTALL) $(LIB_CXX) $(libdir) + @TH_OFF@ @echo "Enter 'make installthcxx' to install the threaded C++ library" + @SL_OFF@ @echo "Enter 'make installcxxsl' to install the C++ shared-library" + + installsl : $(LIB_SL) + $(srcdir)/mkinstalldirs $(shlibdir) +- $(INSTALL_PROGRAM) $(LIB_SL) $(shlibdir) ++ $(INSTALL) $(LIB_SL) $(shlibdir) + @CXX_OFF@ @echo "Enter 'make installcxxsl' to install the C++ shared-library" + @TH_OFF@ @echo "Enter 'make installthsl' to install thread shared-library" + + installlib : $(INSTALL_LIB) + $(srcdir)/mkinstalldirs $(libdir) +- $(INSTALL_PROGRAM) $(LIBRARY) $(libdir) ++ $(INSTALL) $(LIBRARY) $(libdir) + @RANLIB@ $(libdir)/$(LIBRARY) + @SL_OFF@ @echo "Enter 'make installsl' to install $(LIB_SL) in $(shlibdir)" + @CXX_OFF@ @echo "Enter 'make installcxx' to install the C++ library" +@@ -255,10 +259,8 @@ shlib : $(BUILD_SL) + # NOTE: you may have to edit the configure.ac script to get this to + # work on your operating system. Please send feedback to the author + # via: http://256.com/gray/email.html +-$(LIB_SL) : $(LIBRARY) +- rm -f $@ $@.t +- @shlinkargs@ $(LIBRARY) $(OBJS) $(NORMAL_OBJS) +- mv $@.t $@ ++$(LIB_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL) ++ $(CC) -shared -Wl,-soname,libdmalloc.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL) + + $(LIBRARY) : $(OBJS) $(NORMAL_OBJS) + ar cr $@ $? +@@ -268,32 +270,26 @@ $(LIB_TH) : $(OBJS) $(THREAD_OBJS) + ar cr $@ $? + @RANLIB@ $@ + +-$(LIB_TH_SL) : $(LIB_TH) +- rm -f $@ $@.t +- @shlinkargs@ $(LIB_TH) $(OBJS) $(THREAD_OBJS) +- mv $@.t $@ ++$(LIB_TH_SL) : $(OBJS_SL) $(THREAD_OBJS_SL) ++ $(CC) -shared -Wl,-soname,libdmallocth.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL) + + $(LIB_CXX) : $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS) + ar cr $@ $? + @RANLIB@ $@ + +-$(LIB_CXX_SL) : $(LIB_CXX) +- rm -f $@ $@.t +- @shlinkargs@ $(LIB_CXX) $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS) +- mv $@.t $@ ++$(LIB_CXX_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL) ++ $(CC) -shared -Wl,-soname,libdmalloccxx.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL) + + $(LIB_TH_CXX) : $(OBJS) $(THREAD_OBJS) $(CXX_OBJS) + ar cr $@ $? + @RANLIB@ $@ + +-$(LIB_TH_CXX_SL) : $(LIB_TH_CXX) +- rm -f $@ $@.t +- @shlinkargs@ $(LIB_TH_CXX) $(OBJS) $(THREAD_OBJS) $(CXX_OBJS) +- mv $@.t $@ ++$(LIB_TH_CXX_SL) : $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL) ++ $(CC) -shared -Wl,-soname,libdmallocthcxx.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL) + +-threadssl : $(LIB_TH_SL) ++threadssl : $(LIB_TH_SL)$(ver) + +-threadscxxsl : $(LIB_TH_CXX_SL) ++threadscxxsl : $(LIB_TH_CXX_SL)$(ver) + + threadscxx : $(BUILD_TH_CXX) + @SL_OFF@ @echo "Enter 'make threadscxxsl' to build the threaded C++ shared-library" +@@ -302,7 +298,7 @@ threads : $(BUILD_THREADS) + @CXX_OFF@ @echo "Enter 'make threadscxx' to build the threaded C++ library" + @SL_OFF@ @echo "Enter 'make threadssl' to build the threaded shared library" + +-cxxsl : $(LIB_CXX_SL) ++cxxsl : $(LIB_CXX_SL)$(ver) + + cxx : $(BUILD_CXX) + @SL_OFF@ @echo "Enter 'make cxxsl' to build the cxx shared library" +@@ -371,6 +367,11 @@ dmallocc.o : $(srcdir)/dmallocc.cc + $(CXX) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(INCS) -c $(srcdir)/dmallocc.cc \ + -o ./$@ + ++dmallocc_sl.o : $(srcdir)/dmallocc.cc ++ rm -f $@ ++ $(CXX) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $(srcdir)/dmallocc.cc \ ++ -o ./$@ ++ + # + # auto configure settings - uncomment if you are doing configure + # development on the library +@@ -395,38 +396,109 @@ dmallocc.o : $(srcdir)/dmallocc.cc + + arg_check.o: arg_check.c conf.h settings.h dmalloc.h chunk.h debug_tok.h \ + dmalloc_loc.h error.h arg_check.h ++arg_check_sl.o: arg_check.c conf.h settings.h dmalloc.h chunk.h debug_tok.h \ ++ dmalloc_loc.h error.h arg_check.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + chunk.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \ + dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \ + error_val.h heap.h ++chunk_sl.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \ ++ dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \ ++ error_val.h heap.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + compat.o: compat.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h ++compat_sl.o: compat.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + dmalloc.o: dmalloc.c conf.h settings.h dmalloc_argv.h dmalloc.h compat.h \ + debug_tok.h dmalloc_loc.h env.h error_val.h version.h ++dmalloc_sl.o: dmalloc.c conf.h settings.h dmalloc_argv.h dmalloc.h compat.h \ ++ debug_tok.h dmalloc_loc.h env.h error_val.h version.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + dmalloc_argv.o: dmalloc_argv.c conf.h settings.h dmalloc_argv.h \ + dmalloc_argv_loc.h compat.h ++dmalloc_argv_sl.o: dmalloc_argv.c conf.h settings.h dmalloc_argv.h \ ++ dmalloc_argv_loc.h compat.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + dmalloc_fc_t.o: dmalloc_fc_t.c conf.h settings.h dmalloc.h dmalloc_argv.h \ + dmalloc_rand.h debug_tok.h dmalloc_loc.h error_val.h ++dmalloc_fc_t_sl.o: dmalloc_fc_t.c conf.h settings.h dmalloc.h dmalloc_argv.h \ ++ dmalloc_rand.h debug_tok.h dmalloc_loc.h error_val.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + dmalloc_rand.o: dmalloc_rand.c dmalloc_rand.h ++dmalloc_rand_sl.o: dmalloc_rand.c dmalloc_rand.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + dmalloc_t.o: dmalloc_t.c conf.h settings.h compat.h dmalloc.h \ + dmalloc_argv.h dmalloc_rand.h arg_check.h debug_tok.h dmalloc_loc.h \ + error_val.h heap.h ++dmalloc_t_sl.o: dmalloc_t.c conf.h settings.h compat.h dmalloc.h \ ++ dmalloc_argv.h dmalloc_rand.h arg_check.h debug_tok.h dmalloc_loc.h \ ++ error_val.h heap.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + dmalloc_tab.o: dmalloc_tab.c conf.h settings.h chunk.h compat.h dmalloc.h \ + dmalloc_loc.h error.h error_val.h dmalloc_tab.h dmalloc_tab_loc.h ++dmalloc_tab_sl.o: dmalloc_tab.c conf.h settings.h chunk.h compat.h dmalloc.h \ ++ dmalloc_loc.h error.h error_val.h dmalloc_tab.h dmalloc_tab_loc.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + env.o: env.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h \ + debug_tok.h env.h error.h ++env_sl.o: env.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h \ ++ debug_tok.h env.h error.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + error.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \ + dmalloc_loc.h env.h error.h error_val.h version.h ++error_sl.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \ ++ dmalloc_loc.h env.h error.h error_val.h version.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + heap.o: heap.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \ + dmalloc_loc.h error.h error_val.h heap.h ++heap_sl.o: heap.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \ ++ dmalloc_loc.h error.h error_val.h heap.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + malloc.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \ + debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \ + malloc_funcs.h return.h ++malloc_sl.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \ ++ debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \ ++ malloc_funcs.h return.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + protect.o: protect.c conf.h settings.h dmalloc.h dmalloc_loc.h error.h \ + heap.h protect.h ++protect_sl.o: protect.c conf.h settings.h dmalloc.h dmalloc_loc.h error.h \ ++ heap.h protect.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + chunk_th.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \ + dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \ + error_val.h heap.h ++chunk_th_sl.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \ ++ dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \ ++ error_val.h heap.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + error_th.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \ + dmalloc_loc.h env.h error.h error_val.h version.h ++error_th_sl.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \ ++ dmalloc_loc.h env.h error.h error_val.h version.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ + malloc_th.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \ + debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \ + malloc_funcs.h return.h ++malloc_th_sl.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \ ++ debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \ ++ malloc_funcs.h return.h ++ rm -f $@ ++ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@ diff --git a/devel/dmalloc/patches/130-makefile_destdir.patch b/devel/dmalloc/patches/130-makefile_destdir.patch new file mode 100644 index 0000000..88a2da9 --- /dev/null +++ b/devel/dmalloc/patches/130-makefile_destdir.patch @@ -0,0 +1,97 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -178,66 +178,66 @@ distclean : clean + # rm -f configure + + installdirs : +- $(srcdir)/mkinstalldirs $(includedir) $(libdir) $(bindir) ++ $(srcdir)/mkinstalldirs $(DESTDIR)$(includedir) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) + + installincs : $(HFLS) +- $(srcdir)/mkinstalldirs $(includedir) +- $(INSTALL_DATA) $(HFLS) $(includedir) ++ $(srcdir)/mkinstalldirs $(DESTDIR)$(includedir) ++ $(INSTALL_DATA) $(HFLS) $(DESTDIR)$(includedir) + + installthsl : $(LIB_TH_SL) +- $(srcdir)/mkinstalldirs $(shlibdir) +- $(INSTALL) $(LIB_TH_SL) $(shlibdir) ++ $(srcdir)/mkinstalldirs $(DESTDIR)$(shlibdir) ++ $(INSTALL) $(LIB_TH_SL) $(DESTDIR)$(shlibdir) + + installth : $(INSTALL_THREADS) +- $(srcdir)/mkinstalldirs $(libdir) +- $(INSTALL) $(LIB_TH) $(libdir) ++ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) ++ $(INSTALL) $(LIB_TH) $(DESTDIR)$(libdir) + @CXX_OFF@ @echo "Enter 'make installthcxx' to install the threaded C++ library" + @SL_OFF@ @echo "Enter 'make installthsl' to install the threaded shared-library" + + installthcxxsl : $(LIB_TH_CXX_SL) +- $(srcdir)/mkinstalldirs $(shlibdir) +- $(INSTALL) $(LIB_TH_CXX_SL) $(shlibdir) ++ $(srcdir)/mkinstalldirs $(DESTDIR)$(shlibdir) ++ $(INSTALL) $(LIB_TH_CXX_SL) $(DESTDIR)$(shlibdir) + + installthcxx : $(INSTALL_TH_CXX) +- $(srcdir)/mkinstalldirs $(libdir) +- $(INSTALL) $(LIB_TH_CXX) $(libdir) ++ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) ++ $(INSTALL) $(LIB_TH_CXX) $(DESTDIR)$(libdir) + @SL_OFF@ @echo "Enter 'make installthcxxsl' to install the threaded C++ shared-library" + + installcxxsl : $(LIB_CXX_SL) +- $(srcdir)/mkinstalldirs $(shlibdir) +- $(INSTALL) $(LIB_CXX_SL) $(shlibdir) ++ $(srcdir)/mkinstalldirs $(DESTDIR)$(shlibdir) ++ $(INSTALL) $(LIB_CXX_SL) $(DESTDIR)$(shlibdir) + + installcxx : $(INSTALL_CXX) +- $(srcdir)/mkinstalldirs $(libdir) +- $(INSTALL) $(LIB_CXX) $(libdir) ++ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) ++ $(INSTALL) $(LIB_CXX) $(DESTDIR)$(libdir) + @TH_OFF@ @echo "Enter 'make installthcxx' to install the threaded C++ library" + @SL_OFF@ @echo "Enter 'make installcxxsl' to install the C++ shared-library" + + installsl : $(LIB_SL) +- $(srcdir)/mkinstalldirs $(shlibdir) +- $(INSTALL) $(LIB_SL) $(shlibdir) ++ $(srcdir)/mkinstalldirs $(DESTDIR)$(shlibdir) ++ $(INSTALL) $(LIB_SL) $(DESTDIR)$(shlibdir) + @CXX_OFF@ @echo "Enter 'make installcxxsl' to install the C++ shared-library" + @TH_OFF@ @echo "Enter 'make installthsl' to install thread shared-library" + + installlib : $(INSTALL_LIB) +- $(srcdir)/mkinstalldirs $(libdir) +- $(INSTALL) $(LIBRARY) $(libdir) +- @RANLIB@ $(libdir)/$(LIBRARY) +-@SL_OFF@ @echo "Enter 'make installsl' to install $(LIB_SL) in $(shlibdir)" ++ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) ++ $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir) ++ @RANLIB@ $(DESTDIR)$(libdir)/$(LIBRARY) ++@SL_OFF@ @echo "Enter 'make installsl' to install $(LIB_SL) in $(DESTDIR)$(shlibdir)" + @CXX_OFF@ @echo "Enter 'make installcxx' to install the C++ library" + @TH_OFF@ @echo "Enter 'make installth' to install thread library" + + installdocs : $(srcdir)/docs/$(HTMLFILE) $(srcdir)/docs/$(TEXIFILE) \ + $(srcdir)/docs/$(PDFFILE) +- $(srcdir)/mkinstalldirs $(docdir) +- $(INSTALL_DATA) $(srcdir)/docs/$(HTMLFILE) $(docdir) +- $(INSTALL_DATA) $(srcdir)/docs/$(TEXIFILE) $(docdir) +- $(INSTALL_DATA) $(srcdir)/docs/$(PDFFILE) $(docdir) ++ $(srcdir)/mkinstalldirs $(DESTDIR)$(docdir) ++ $(INSTALL_DATA) $(srcdir)/docs/$(HTMLFILE) $(DESTDIR)$(docdir) ++ $(INSTALL_DATA) $(srcdir)/docs/$(TEXIFILE) $(DESTDIR)$(docdir) ++ $(INSTALL_DATA) $(srcdir)/docs/$(PDFFILE) $(DESTDIR)$(docdir) + + install : installincs installlib $(UTIL) +- $(srcdir)/mkinstalldirs $(bindir) +- $(INSTALL_PROGRAM) $(UTIL) $(bindir) +- @echo "Enter 'make installdocs' to install $(DOCFILES) in $(docdir)" ++ $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) ++ $(INSTALL_PROGRAM) $(UTIL) $(DESTDIR)$(bindir) ++ @echo "Enter 'make installdocs' to install $(DOCFILES) in $(DESTDIR)$(docdir)" + + dmalloc.h.2 : $(srcdir)/configure + $(SHELL) $(srcdir)/configure diff --git a/devel/dmalloc/patches/200-fix_return_address.patch b/devel/dmalloc/patches/200-fix_return_address.patch new file mode 100644 index 0000000..0fb35e4 --- /dev/null +++ b/devel/dmalloc/patches/200-fix_return_address.patch @@ -0,0 +1,45 @@ +--- a/configure ++++ b/configure +@@ -7120,7 +7120,7 @@ echo "$as_me:$LINENO: checking return.h + echo $ECHO_N "checking return.h macros work... $ECHO_C" >&6 + if test "$cross_compiling" = yes; then + cat >>confdefs.h <<\_ACEOF +-#define RETURN_MACROS_WORK 0 ++#define RETURN_MACROS_WORK 1 + _ACEOF + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 +--- a/return.h ++++ b/return.h +@@ -106,25 +106,19 @@ + /*************************************/ + + /* +- * For DEC Mips machines running Ultrix ++ * For Mips machines running Linux + */ + #if __mips + + /* +- * I have no idea how to get inline assembly with the default cc. +- * Anyone know how? +- */ +- +-#if 0 +- +-/* + * NOTE: we assume here that file is global. + * +- * $31 is the frame pointer. $2 looks to be the return address but maybe +- * not consistently. ++ * $31 is the return address. + */ +-#define GET_RET_ADDR(file) asm("sw $2, file") +- ++#if (_MIPS_SZLONG == 32) ++#define GET_RET_ADDR(file) asm("sw $31, %0" : "=m" (file)) ++#else ++#define GET_RET_ADDR(file) asm("sd $31, %0" : "=m" (file)) + #endif + + #endif /* __mips */ diff --git a/devel/dmalloc/patches/210-fix_threads.patch b/devel/dmalloc/patches/210-fix_threads.patch new file mode 100644 index 0000000..c3cbd90 --- /dev/null +++ b/devel/dmalloc/patches/210-fix_threads.patch @@ -0,0 +1,11 @@ +--- a/settings.dist ++++ b/settings.dist +@@ -409,7 +409,7 @@ + */ + + #ifndef LOCK_THREADS +-#define LOCK_THREADS 0 ++#define LOCK_THREADS 1 + #endif + + #if LOCK_THREADS diff --git a/devel/dmalloc/patches/300-fix_summarize_script.patch b/devel/dmalloc/patches/300-fix_summarize_script.patch new file mode 100644 index 0000000..d50106d --- /dev/null +++ b/devel/dmalloc/patches/300-fix_summarize_script.patch @@ -0,0 +1,8 @@ +--- a/contrib/dmalloc_summarize.pl ++++ b/contrib/dmalloc_summarize.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl5 -w ++#!/usr/bin/perl -w + # + # dmalloc_summarize -- summarizes dmalloc log files + # diff --git a/devel/dmalloc/patches/400-undef-strndup.patch b/devel/dmalloc/patches/400-undef-strndup.patch new file mode 100644 index 0000000..e7141ed --- /dev/null +++ b/devel/dmalloc/patches/400-undef-strndup.patch @@ -0,0 +1,10 @@ +--- dmalloc-5.5.2/dmalloc.h.3 2012-04-11 22:59:21.624323311 +0200 ++++ dmalloc-5.5.2.mod/dmalloc.h.3 2012-04-11 23:00:53.612325497 +0200 +@@ -405,6 +405,7 @@ + * + * string -> String we are duplicating. + */ ++#undef strdup + extern + char *strdup(const char *string); + #endif /* ifndef DMALLOC_STRDUP_MACRO */ diff --git a/devel/electric-fence/Makefile b/devel/electric-fence/Makefile new file mode 100644 index 0000000..1153350 --- /dev/null +++ b/devel/electric-fence/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:= electric-fence +PKG_VERSION:=2.1.13 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION)-0.1.tar.gz +PKG_SOURCE_URL:=http://perens.com/FreeSoftware/ElectricFence +PKG_MD5SUM:=59e4e7817a30aff52d8971ce00e1ad35 + +include $(INCLUDE_DIR)/package.mk + +define Package/electric-fence + SECTION:=devel + CATEGORY:=Development + TITLE:=electric-fence + URL:=http://perens.com/FreeSoftware/ElectricFence/ + DEPENDS:=@USE_EGLIBC + MAINTAINER:=Mirko Vogt +endef + +TARGET_CFLAGS += -fPIC +TARGET_LDFLAGS += -lpthread + +define Build/Compile + rm -f $(PKG_BUILD_DIR)/libefence.so $(PKG_BUILD_DIR)/libefence.a + $(TARGET_CC) $(TARGET_CFLAGS) -c $(PKG_BUILD_DIR)/efence.c -o $(PKG_BUILD_DIR)/efence.o + $(TARGET_CC) $(TARGET_CFLAGS) -c $(PKG_BUILD_DIR)/page.c -o $(PKG_BUILD_DIR)/page.o + $(TARGET_CC) $(TARGET_CFLAGS) -c $(PKG_BUILD_DIR)/print.c -o $(PKG_BUILD_DIR)/print.o + $(TARGET_CC) -shared $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/libefence.so $(PKG_BUILD_DIR)/efence.o $(PKG_BUILD_DIR)/page.o $(PKG_BUILD_DIR)/print.o + $(AR) crv $(LD_FLAGS) $(PKG_BUILD_DIR)/libefence.a $(PKG_BUILD_DIR)/efence.o $(PKG_BUILD_DIR)/page.o $(PKG_BUILD_DIR)/print.o +endef + +define Build/InstallDev + $(INSTALL_DIR) \ + $(1)/usr/lib + + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/libefence.so \ + $(1)/usr/lib/ + + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/libefence.a \ + $(1)/usr/lib/ +endef + +define Package/electric-fence/install + $(INSTALL_DIR) \ + $(1)/usr/lib + + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/libefence.so \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,electric-fence)) diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile new file mode 100644 index 0000000..90ef1d9 --- /dev/null +++ b/devel/gcc/Makefile @@ -0,0 +1,90 @@ +# +# Copyright (C) 2008 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:=gcc +PKG_VERSION:=$(strip $(subst ",, $(CONFIG_GCC_VERSION)))#")) +PKG_RELEASE:=1 +PATCH_DIR=$(TOPDIR)/toolchain/gcc/patches/$(PKG_VERSION) +PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(PKG_VERSION) \ + http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(PKG_VERSION) \ + ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(PKG_VERSION) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_MD5SUM:=354853e0b2da90c527e35aabb8d6f1e6 + +include $(INCLUDE_DIR)/package.mk + +SEP:=, +TARGET_LANGUAGES:="c$(if $(CONFIG_INSTALL_LIBSTDCPP),$(SEP)c++)$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)" +EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-biarch --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-uclibc) + +define Package/gcc + SECTION:=devel + CATEGORY:=Development + TITLE:=gcc + DEPENDS:=@TARGET_x86 @NO_STRIP +endef + +define Package/gcc/description + build a native toolchain for compiling on target +endef + +define Build/Prepare + $(call Build/Prepare/Default) + $(SED) 's,\(version_string.. = "[0-9\.]*\).*\(";\),\1 (OpenWrt-2.0)\2,' $(PKG_BUILD_DIR)/gcc/version.c + $(SED) 's,\(bug_report_url.. = "\).*\(";\),\1\2,' $(PKG_BUILD_DIR)/gcc/version.c + (cd $(PKG_BUILD_DIR)/libstdc++-v3; autoconf;); + $(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(PKG_BUILD_DIR)/libstdc++-v3/configure +endef + +define Build/Configure + (cd $(PKG_BUILD_DIR); rm -f config.cache; \ + SHELL="$(BASH)" \ + $(TARGET_CONFIGURE_OPTS) \ + $(PKG_BUILD_DIR)/configure \ + $(TARGET_CONFIGURE_ARGS) \ + --build=$(GNU_HOST_NAME) \ + --host=$(REAL_GNU_TARGET_NAME) \ + --target=$(REAL_GNU_TARGET_NAME) \ + --enable-languages=$(TARGET_LANGUAGES) \ + --enable-shared \ + --disable-__cxa_atexit \ + --enable-target-optspace \ + --with-gnu-ld \ + --disable-nls \ + --disable-libmudflap \ + --disable-multilib \ + $(EXTRA_TARGET) \ + $(SOFT_FLOAT_CONFIG_OPTION) \ + $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \ + ); +endef + +define Build/Compile + export SHELL="$(BASH)"; $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE_ARGS) all install + # Set up the symlinks to enable lying about target name. + set -e; \ + (cd $(TOOLCHAIN_DIR); \ + ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \ + cd bin; \ + for app in $(REAL_GNU_TARGET_NAME)-* ; do \ + ln -sf $$$${app} \ + $(GNU_TARGET_NAME)$$$${app##$(REAL_GNU_TARGET_NAME)}; \ + done; \ + ); +endef + +define Package/gcc/install + $(INSTALL_DIR) $(1)/usr/lib/ + cp -r $(PKG_INSTALL_DIR)/* $(1) + cp -r $(TOOLCHAIN_DIR)/include $(1)/usr/ + cp $(TOOLCHAIN_DIR)/lib/crt* $(1)/usr/lib/ + cp $(TOOLCHAIN_DIR)/lib/libc.so $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,gcc)) diff --git a/devel/ksymoops/Makefile b/devel/ksymoops/Makefile new file mode 100644 index 0000000..af09a4f --- /dev/null +++ b/devel/ksymoops/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=ksymoops +PKG_VERSION:=2.4.11 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/ksymoops/v2.4/ +PKG_MD5SUM:=4a8249e182a5dbc75e566d162e9f3314 + +PKG_BUILD_DEPENDS:=binutils + +include $(INCLUDE_DIR)/package.mk + +define Package/ksymoops + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=@mips||mipsel||m68k||i386 +zlib + TITLE:=Interpret oops of the kernel + URL:=http://www.kernel.org/pub/linux/utils/kernel/ksymoops/v2.4/ + MENU:=1 +endef + +define Package/kexec-tools/description +endef + +define Build/Configure +endef + +TARGET=$(strip $(shell echo $(TARGET_CFLAGS) | cut -d- -f4 | cut -d= -f2)) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + BFD_PREFIX="$(STAGING_DIR)/usr" \ + DEF_TARGET='\"$(TARGET)\"' \ + DEF_ARCH='\"$(ARCH)\"' \ + DEF_MAP='\"$(LINUX_DIR)/System.map\"' \ + CROSS="$(TARGET_CROSS)" \ + INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ + LDFLAGS="-lz" \ + all install +endef + +define Package/ksymoops/install + $(INSTALL_DIR) $(1)/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/$(TARGET_CROSS)ksymoops $(1)/bin/ksymoops +endef + +$(eval $(call BuildPackage,ksymoops)) diff --git a/devel/make/Makefile b/devel/make/Makefile new file mode 100644 index 0000000..0430d4c --- /dev/null +++ b/devel/make/Makefile @@ -0,0 +1,37 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=make +PKG_VERSION:=3.81 +PKG_RELEASE:=1 +PKG_SOURCE_URL:=@GNU/make +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_MD5SUM:=354853e0b2da90c527e35aabb8d6f1e6 +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/make + SECTION:=devel + CATEGORY:=Development + DEPENDS:=+libelf + TITLE:=make + URL:=http://www.gnu.org/software/make/ +endef + +define Package/make/description + The Make package contains a program for compiling packages +endef + +define Package/make/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/make $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,make)) diff --git a/devel/oprofile/Makefile b/devel/oprofile/Makefile new file mode 100644 index 0000000..ff88eea --- /dev/null +++ b/devel/oprofile/Makefile @@ -0,0 +1,89 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=oprofile +PKG_VERSION:=0.9.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/oprofile/ +PKG_MD5SUM:=8b5d1d9b65f84420bcc3234777ad3be3 + +PKG_BUILD_DEPENDS:=binutils +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/kernel.mk + +define Package/oprofile + SECTION:=devel + CATEGORY:=Development + TITLE:=OProfile System Profiler + URL:=http://oprofile.sourceforge.net + DEPENDS:=+libpopt +kmod-oprofile +libstdcpp +objdump +endef + +define Package/oprofile/description + A transparent low-overhead system-wide profiler. +endef + +define Package/oprofile-utils + SECTION:=devel + CATEGORY:=Development + TITLE:=OProfile System Profiler (extra utilities) + URL:=http://oprofile.sourceforge.net + DEPENDS:=oprofile +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --with-kernel-support \ + --without-x \ + ) +endef + +TARGET_CXXFLAGS += -fpermissive +TARGET_LDFLAGS := -L$(STAGING_DIR)/usr/lib $(TARGET_LDFLAGS) + +define Package/oprofile-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/opannotate \ + $(PKG_INSTALL_DIR)/usr/bin/oparchive \ + $(PKG_INSTALL_DIR)/usr/bin/opgprof \ + $(1)/usr/bin +endef + +define Package/oprofile/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/* \ + $(1)/usr/bin + + rm -f \ + $(1)/usr/bin/opannotate \ + $(1)/usr/bin/oparchive \ + $(1)/usr/bin/opgprof + + $(INSTALL_DIR) $(1)/usr/lib/oprofile + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/oprofile/*.so* \ + $(1)/usr/lib/oprofile/ + + $(INSTALL_DIR) $(1)/usr/share/oprofile + $(CP) \ + $(PKG_INSTALL_DIR)/usr/share/oprofile/stl.pat \ + $(PKG_INSTALL_DIR)/usr/share/oprofile/$(patsubst x86,i386,$(LINUX_KARCH)) \ + $(1)/usr/share/oprofile/ +endef + +$(eval $(call BuildPackage,oprofile)) +$(eval $(call BuildPackage,oprofile-utils)) diff --git a/devel/oprofile/patches/100-use_insmod_instead_of_modprobe.patch b/devel/oprofile/patches/100-use_insmod_instead_of_modprobe.patch new file mode 100644 index 0000000..1010798 --- /dev/null +++ b/devel/oprofile/patches/100-use_insmod_instead_of_modprobe.patch @@ -0,0 +1,20 @@ +--- a/utils/opcontrol ++++ b/utils/opcontrol +@@ -248,7 +248,7 @@ load_module_26() + { + grep oprofilefs /proc/filesystems >/dev/null + if test "$?" -ne 0; then +- modprobe oprofile ++ insmod oprofile + if test "$?" != "0"; then + # couldn't load the module + return +@@ -278,7 +278,7 @@ load_module_24() + { + grep oprof /proc/devices >/dev/null + if test "$?" -ne 0; then +- modprobe oprofile ++ insmod oprofile + if test "$?" != "0"; then + # couldn't load a module + return diff --git a/devel/oprofile/patches/101-remove_24_support.patch b/devel/oprofile/patches/101-remove_24_support.patch new file mode 100644 index 0000000..99eb928 --- /dev/null +++ b/devel/oprofile/patches/101-remove_24_support.patch @@ -0,0 +1,64 @@ +--- a/daemon/Makefile.am ++++ b/daemon/Makefile.am +@@ -1,4 +1,4 @@ +-SUBDIRS = liblegacy . ++SUBDIRS = . + + oprofiled_SOURCES = \ + init.c \ +@@ -49,7 +49,6 @@ AM_CFLAGS = @OP_CFLAGS@ -fno-omit-frame- + bin_PROGRAMS = oprofiled + + oprofiled_LDADD = \ +- liblegacy/liblegacy.a \ + ../libabi/libabi.a \ + ../libdb/libodb.a \ + ../libop/libop.a \ +--- a/daemon/Makefile.in ++++ b/daemon/Makefile.in +@@ -70,7 +70,7 @@ am_oprofiled_OBJECTS = init.$(OBJEXT) op + opd_extended.$(OBJEXT) opd_ibs.$(OBJEXT) \ + opd_ibs_trans.$(OBJEXT) + oprofiled_OBJECTS = $(am_oprofiled_OBJECTS) +-oprofiled_DEPENDENCIES = liblegacy/liblegacy.a ../libabi/libabi.a \ ++oprofiled_DEPENDENCIES = ../libabi/libabi.a \ + ../libdb/libodb.a ../libop/libop.a ../libutil/libutil.a + DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) + depcomp = $(SHELL) $(top_srcdir)/depcomp +@@ -285,7 +285,7 @@ top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + topdir = @topdir@ +-SUBDIRS = liblegacy . ++SUBDIRS = . + oprofiled_SOURCES = \ + init.c \ + oprofiled.c \ +@@ -331,7 +331,6 @@ AM_CPPFLAGS = \ + # -fno-omit-frame-pointer needed for daemon build: see ChangeLog-2004 02-23 + AM_CFLAGS = @OP_CFLAGS@ -fno-omit-frame-pointer + oprofiled_LDADD = \ +- liblegacy/liblegacy.a \ + ../libabi/libabi.a \ + ../libdb/libodb.a \ + ../libop/libop.a \ +--- a/daemon/oprofiled.c ++++ b/daemon/oprofiled.c +@@ -77,7 +77,6 @@ static char * events; + static char * ext_feature; + static int showvers; + static struct oprofiled_ops * opd_ops; +-extern struct oprofiled_ops opd_24_ops; + extern struct oprofiled_ops opd_26_ops; + + #define OPD_IMAGE_FILTER_HASH_SIZE 32 +@@ -477,9 +476,6 @@ static void opd_options(int argc, char c + static struct oprofiled_ops * get_ops(void) + { + switch (op_get_interface()) { +- case OP_INTERFACE_24: +- printf("Using 2.4 OProfile kernel interface.\n"); +- return &opd_24_ops; + case OP_INTERFACE_26: + printf("Using 2.6+ OProfile kernel interface.\n"); + return &opd_26_ops; diff --git a/devel/patch/Makefile b/devel/patch/Makefile new file mode 100644 index 0000000..fa3f14a --- /dev/null +++ b/devel/patch/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2008-2009 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:=patch +PKG_VERSION:=2.5.9 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/patch +PKG_MD5SUM:=dacfb618082f8d3a2194601193cf8716 + +include $(INCLUDE_DIR)/package.mk + +define Package/patch + SECTION:=devel + CATEGORY:=Development + TITLE:=patch + URL:=http://www.gnu.org/ +endef + +define Package/patch/description + The Patch package contains a program for modifying or creating files + by applying a "patch" file typically created by the diff program. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + exec_prefix="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/patch/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/bin/patch $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,patch)) diff --git a/devel/patch/patches/100-install.patch b/devel/patch/patches/100-install.patch new file mode 100644 index 0000000..8d34ba6 --- /dev/null +++ b/devel/patch/patches/100-install.patch @@ -0,0 +1,18 @@ +diff -urN patch-2.5.4.orig/Makefile.in patch-2.5.4/Makefile.in +--- patch-2.5.4.orig/Makefile.in 2008-06-11 10:08:08.000000000 +0200 ++++ patch-2.5.4/Makefile.in 2008-06-11 10:08:26.000000000 +0200 +@@ -42,12 +42,12 @@ + VERSION = @VERSION@ + + prefix = @prefix@ +-exec_prefix = @exec_prefix@ ++exec_prefix += @exec_prefix@ + + bindir = $(exec_prefix)/bin + + # Where to put the manual pages. +-mandir = @mandir@ ++mandir = $(exec_prefix)/@mandir@ + man1dir = $(mandir)/man1 + # Extension (including `.') for the manual page filenames. + man1ext = .1 diff --git a/devel/perf/Makefile b/devel/perf/Makefile new file mode 100644 index 0000000..3bd4384 --- /dev/null +++ b/devel/perf/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=perf +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/perf + SECTION:=devel + CATEGORY:=Development + DEPENDS:= +libdw +libpthread +librt @BROKEN + TITLE:=Linux performance monitoring tool + VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE) + URL:=http://www.kernel.org +endef + +define Package/perf/description + perf is the Linux performance monitoring tool +endef + +define Build/Prepare +endef + +define Build/Compile + $(MAKE) -C $(LINUX_DIR)/tools/perf \ + ARCH="$(LINUX_KARCH)" \ + NO_LIBPERL=1 \ + NO_LIBPYTHON=1 \ + NO_NEWT=1 \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + CC="$(TARGET_CC)" \ + LD="$(TARGET_CROSS)ld" \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + V=1 \ + prefix=/usr +endef + +define Package/perf/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(LINUX_DIR)/tools/perf/perf $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,perf)) diff --git a/ipv6/6scripts/Makefile b/ipv6/6scripts/Makefile new file mode 100644 index 0000000..434e756 --- /dev/null +++ b/ipv6/6scripts/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2007-2012 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:=6scripts +PKG_VERSION:=0.1 +PKG_RELEASE:=7 + +include $(INCLUDE_DIR)/package.mk + +define Package/6scripts + SECTION:=ipv6 + CATEGORY:=IPv6 + DEPENDS:=+kmod-ipv6 + TITLE:=IPv6 scripts + PKGARCH:=all +endef + +define Package/6scripts/description +IPv6 scripts to setup ipv6 connectivy using 6to4 tunnels +or bridged ipv6 connectivity. +endef + +define Package/6scripts/conffiles +/etc/config/6tunnel +/etc/config/6bridge +endef + +define Build/Compile +endef + +define Build/Configure +endef + +define Package/6scripts/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/6tunnel.conf $(1)/etc/config/6tunnel + $(INSTALL_DATA) ./files/6bridge.conf $(1)/etc/config/6bridge + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/6tunnel.init $(1)/etc/init.d/6tunnel + $(INSTALL_BIN) ./files/6bridge.init $(1)/etc/init.d/6bridge + $(INSTALL_DIR) $(1)/etc/ppp/ip-up.d/ + $(INSTALL_DATA) ./files/he-tun.ppp $(1)/etc/ppp/ip-up.d/ +endef + +$(eval $(call BuildPackage,6scripts)) diff --git a/ipv6/6scripts/files/6bridge.conf b/ipv6/6scripts/files/6bridge.conf new file mode 100644 index 0000000..e2980ad --- /dev/null +++ b/ipv6/6scripts/files/6bridge.conf @@ -0,0 +1,2 @@ +config 6bridge + option bridge 'bripv6' diff --git a/ipv6/6scripts/files/6bridge.init b/ipv6/6scripts/files/6bridge.init new file mode 100644 index 0000000..94e3993 --- /dev/null +++ b/ipv6/6scripts/files/6bridge.init @@ -0,0 +1,53 @@ +#!/bin/sh /etc/rc.common + +START=46 +STOP=46 + +start_service() { + local section="$1" + + . /lib/functions/network.sh + + network_get_physdev LAN lan || return 1 + network_get_physdev WAN wan || return 1 + config_get bridge "$section" bridge + + brctl addbr $bridge + brctl addif $bridge $LAN + brctl addif $bridge $WAN + brctl setfd $bridge 0 + + ebtables -t broute -A BROUTING -i $WAN -p ! ipv6 -j DROP + ifconfig $bridge up +} + +stop_service() { + local section="$1" + + . /lib/functions/network.sh + + network_get_physdev LAN lan || return 1 + network_get_physdev WAN wan || return 1 + config_get bridge "$section" bridge + + ifconfig $bridge down + ebtables -t broute -F + + brctl delif $bridge $WAN + brctl delif $bridge $LAN + brctl delbr $bridge +} + +start() { + if ! [ -f /proc/net/if_inet6 ]; then + echo "IPv6 not enabled, install kmod-ipv6"; + exit 1 + fi + config_load "6bridge" + config_foreach start_service 6bridge +} + +stop() { + config_load "6bridge" + config_foreach stop_service 6bridge +} diff --git a/ipv6/6scripts/files/6tunnel.conf b/ipv6/6scripts/files/6tunnel.conf new file mode 100644 index 0000000..f65691d --- /dev/null +++ b/ipv6/6scripts/files/6tunnel.conf @@ -0,0 +1,18 @@ +config 6tunnel + option tnlifname 'sixbone' + # provide your tunnel providers' ipv4 address + option remoteip4 '' + # provide your public ipv4 address + option localip4 '' + # provide your local ipv6 address including prefix, + # eg. 2001:610::2/64 + option localip6 '' + # provide your tunnel providers' ipv6 address excluding + # prefix, eg. 2001:610::1 + option remoteip6 '' + # this should provide an mtu for your tunnel interface + option mtu '1280' + # this should provide a ttl for your tunnel interface + option ttl '64' + # provide your tunnel provider's delegated block (/64 or /48) + option delegatedip6 '' diff --git a/ipv6/6scripts/files/6tunnel.init b/ipv6/6scripts/files/6tunnel.init new file mode 100644 index 0000000..06ca29b --- /dev/null +++ b/ipv6/6scripts/files/6tunnel.init @@ -0,0 +1,65 @@ +#!/bin/sh /etc/rc.common + +START=46 +STOP=46 + +start_service() { + local section="$1" + + . /lib/functions/network.sh + + network_get_device LAN lan || return 1 + config_get tnlifname "$section" tnlifname + config_get remoteip4 "$section" remoteip4 + config_get localip4 "$section" localip4 + config_get localip6 "$section" localip6 + config_get remoteip6 "$section" remoteip6 + config_get ttl "$section" ttl + config_get mtu "$section" mtu + config_get delegatedip6 "$section" delegatedip6 + + ip tunnel add $tnlifname mode sit remote $remoteip4 local $localip4 ttl 255 + ifconfig $tnlifname up + ip link set mtu $mtu dev $tnlifname + ip tunnel change $tnlifname ttl $ttl + ip addr add $localip6 dev $tnlifname + ip -6 route add ::/0 dev $tnlifname + ip -6 route add 2000::/3 via $remoteip6 + ip -6 route add $delegatedip6 dev $LAN +} + +stop_service() { + local section="$1" + + . /lib/functions/network.sh + + network_get_device LAN lan || return 1 + config_get tnlifname "$section" tnlifname + config_get remoteip4 "$section" remoteip4 + config_get localip4 "$section" localip4 + config_get localip6 "$section" localip6 + config_get remoteip6 "$section" remoteip6 + config_get ttl "$section" ttl + config_get mtu "$section" mtu + config_get delegatedip6 "$section" delegatedip6 + + ip -6 ro del $delegatedip6 dev $LAN + ip -6 ro del 2000::/3 via $remoteip6 + ip -6 ro del ::/0 dev $tnlifname + ip addr del $localip6 dev $tnlifname + ifconfig $tnlifname down + ip tunnel del $tnlifname +} +start() { + if ! [ -x /usr/sbin/ip ]; then + echo "ip is required to setup the tunnel"; + exit 1 + fi + config_load "6tunnel" + config_foreach start_service 6tunnel +} + +stop() { + config_load "6tunnel" + config_foreach stop_service 6tunnel +} diff --git a/ipv6/6scripts/files/he-tun.ppp b/ipv6/6scripts/files/he-tun.ppp new file mode 100644 index 0000000..ab12d40 --- /dev/null +++ b/ipv6/6scripts/files/he-tun.ppp @@ -0,0 +1,24 @@ +#!/bin/sh + +. /lib/functions.sh + +ipaddr="$PPP_LOCAL" + +update_tun() { + local cfg="$1" + + config_get tunnelid "$cfg" tunnelid + config_get username "$cfg" username + config_get password "$cfg" password + config_get tunnel "$cfg" tunnel + + password=`echo -n $password | md5sum | cut -d ' ' -f 1` + wget -q -O /dev/null "http://ipv4.tunnelbroker.net/ipv4_end.php?ipv4b=$ipaddr&pass=$password&user_id=$username&tunnel_id=$tunnelid" + + uci set "6tunnel.@$tunnel[0].localip4=$ipaddr" + uci commit 6tunnel + /etc/init.d/6tunnel restart +} + +config_load "hetun" +config_foreach update_tun diff --git a/ipv6/6tunnel/Makefile b/ipv6/6tunnel/Makefile new file mode 100644 index 0000000..f864cd9 --- /dev/null +++ b/ipv6/6tunnel/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2007-2012 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:=6tunnel +PKG_VERSION:=0.11rc2 +PKG_RELEASE:=3 +PKG_MD5SUM:=74e02d4f0704b3083a01feda66033449 + +PKG_SOURCE_URL:=http://toxygen.net/6tunnel/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz + +include $(INCLUDE_DIR)/package.mk + +define Package/6tunnel + SECTION:=ipv6 + CATEGORY:=IPv6 + DEPENDS:=+libpcap +kmod-sit + TITLE:=IPv4 / IPv6 tunnel proxy + URL:=http://toxygen.net/6tunnel/ +endef + +define Package/6tunnel/description +IPv4 / IPv6 tunnel proxy +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/$(PKG_NAME) $(PKG_BUILD_DIR)/$(PKG_NAME).c +endef + +define Package/6tunnel/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/6tunnel $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,6tunnel)) diff --git a/ipv6/6tunnel/patches/100-arm-fix-optc-initialization.patch b/ipv6/6tunnel/patches/100-arm-fix-optc-initialization.patch new file mode 100644 index 0000000..e84da61 --- /dev/null +++ b/ipv6/6tunnel/patches/100-arm-fix-optc-initialization.patch @@ -0,0 +1,11 @@ +--- a/6tunnel.c ++++ b/6tunnel.c +@@ -508,7 +508,7 @@ int main(int argc, char **argv) + { + int force = 0, lsock, csock, one = 0, jeden = 1, local_port; + int detach = 1, listen6 = 0, sa_len, conn_limit = 0; +- char optc, *username = NULL, *bind_host = NULL; ++ char optc = -1, *username = NULL, *bind_host = NULL; + struct sockaddr *sa; + struct sockaddr_in laddr, caddr; + struct sockaddr_in6 laddr6; diff --git a/ipv6/ahcpd/Makefile b/ipv6/ahcpd/Makefile new file mode 100644 index 0000000..41db0d8 --- /dev/null +++ b/ipv6/ahcpd/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2007-2011 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:=ahcpd +PKG_VERSION:=0.53 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.pps.jussieu.fr/~jch/software/files/ +PKG_MD5SUM:=a1a610bf20965aa522cd766bf3d5829a + + +include $(INCLUDE_DIR)/package.mk + +define Package/ahcpd + SECTION:=ipv6 + CATEGORY:=IPv6 + TITLE:=Ad-Hoc Configuration Protocol daemon + URL:=http://www.pps.jussieu.fr/~jch/software/ahcp/ + MAINTAINER:=Gabriel Kerneis + DEPENDS:=+kmod-ipv6 +ip +librt +endef + +define Package/ahcpd/description + Ahcpd is a daemon for configuring an IPv6 network using the Ad-Hoc + Configuration Protocol (AHCP). AHCP is designed for wireless mesh + networks, where IPv6 autoconfiguration and DHCPv6 do not work, but may + also be used on wired networks. +endef + +define Package/ahcpd/conffiles +/etc/config/ahcpd +endef + +define Package/ahcpd/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/etc/ahcp + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ahcp-config.sh $(1)/etc/ahcp/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ahcpd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/ahcpd.config $(1)/etc/config/ahcpd + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/ahcpd.init $(1)/etc/init.d/ahcpd +endef + +$(eval $(call BuildPackage,ahcpd)) diff --git a/ipv6/ahcpd/files/ahcpd.config b/ipv6/ahcpd/files/ahcpd.config new file mode 100644 index 0000000..0996251 --- /dev/null +++ b/ipv6/ahcpd/files/ahcpd.config @@ -0,0 +1,32 @@ +package ahcpd + +config ahcpd + # Choose ahcp mode: client (default), server or forwarder + ## option 'mode' 'client' + # Uncomment the following lines to enable ahcpd on the desired + # interfaces. + ## list 'interface' 'lan' + ## list 'interface' 'wlan' + + # The following only makes sense in 'server' mode. + # Tweak to suit your needs. + ## list 'prefix' 'fde6:20f5:c9ac:358::/64' + ## list 'prefix' '192.168.4.128/25' + ## list 'name_server' 'fde6:20f5:c9ac:358::1' + ## list 'name_server' '192.168.4.1' + ## list 'ntp_server' '192.168.4.2' + ## option 'lease_dir' '/var/lib/leases' + + # option 'id_file' '/var/lib/ahcp-unique-id' + # option 'log_file' '/var/log/ahcpd.log' + # The configuration file is not necessary since you can configure + # everything from this file. But still, you might prefer using it. + ## option 'conf_file' '/etc/ahcp/ahcp.conf' + + # option 'multicast_address' 'ff02::cca6:c0f9:e182:5359' + # option 'port' '5359' + # option 'ipv4_only' 'false' + # option 'ipv6_only' 'false' + # option 'lease_time' '3666' + # option 'debug' '1' + diff --git a/ipv6/ahcpd/files/ahcpd.init b/ipv6/ahcpd/files/ahcpd.init new file mode 100644 index 0000000..6654b00 --- /dev/null +++ b/ipv6/ahcpd/files/ahcpd.init @@ -0,0 +1,109 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=71 + +SERVICE_USE_PID=1 + +EXTRA_COMMANDS="status" +EXTRA_HELP=" status Print ahcpd's status to the log file." + +append_bool() { + local section="$1" + local option="$2" + local value="$3" + local _loctmp + config_get_bool _loctmp "$section" "$option" 0 + [ "$_loctmp" -gt 0 ] && append args "$value" +} + +append_parm() { + local section="$1" + local option="$2" + local switch="$3" + local _loctmp + config_get _loctmp "$section" "$option" + [ -z "$_loctmp" ] && return 0 + append args "$switch $_loctmp" +} + +append_stmt() { + local name="$1" + local switch="$2" + append args "-C '$switch $name'" +} + +append_opt_stmt() { + local section="$1" + local option="$2" + local switch="$3" + local _loctmp + config_get _loctmp "$section" "$option" + [ -z "$_loctmp" ] && return 0 + append args "-C '$switch $_loctmp'" +} + +ahcp_addif() { + local ifname=$(uci_get_state network "$1" ifname "$1") + append interfaces "$ifname" +} + +ahcp_server() { + local cfg="$1" + + append_opt_stmt "$cfg" 'mode' 'mode' + append_opt_stmt "$cfg" 'lease_dir' 'lease-dir' + config_list_foreach "$cfg" 'prefix' append_stmt 'prefix' + config_list_foreach "$cfg" 'name_server' append_stmt 'name-server' + config_list_foreach "$cfg" 'ntp_server' append_stmt 'ntp-server' + + append_parm "$cfg" 'id_file' '-i' + append_parm "$cfg" 'log_file' '-L' +} + +ahcp_config() { + local cfg="$1" + local interface + local _loctmp + + config_list_foreach "$cfg" 'interface' ahcp_addif + + # Add interfaces with "option proto ahcp" in /etc/config/network + # (only for client mode) + config_get _loctmp "$cfg" "mode" + if [ -z "$_loctmp" -o "$_loctmp" = "client" ]; then + for interface in $(uci -P /var/state show network|grep proto=ahcp|cut -d. -f2); do + ahcp_addif $interface + done + fi + + append_bool "$cfg" 'ipv4_only' '-4' + append_bool "$cfg" 'ipv6_only' '-6' + append_bool "$cfg" 'no_dns' '-N' + + append_parm "$cfg" 'multicast_address' '-m' + append_parm "$cfg" 'port' '-p' + append_parm "$cfg" 'lease_time' '-t' + append_parm "$cfg" 'debug' '-d' + append_parm "$cfg" 'conf_file' '-c' + append_parm "$cfg" 'script' '-s' +} + +start() { + mkdir -p /var/lib + config_load ahcpd + unset args + unset interfaces + config_foreach ahcp_config ahcpd + config_foreach ahcp_server ahcpd + [ -z "$interfaces" ] && return 0 + service_start /usr/sbin/ahcpd -D $args $interfaces +} + +stop() { + service_stop /usr/sbin/ahcpd +} + +status() { + SERVICE_SIG="USR1" service_signal /usr/sbin/ahcpd +} diff --git a/ipv6/aiccu/Makefile b/ipv6/aiccu/Makefile new file mode 100644 index 0000000..b6f3fa3 --- /dev/null +++ b/ipv6/aiccu/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2006-2012 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:=aiccu +PKG_VERSION:=20070115 +PKG_RELEASE:=10 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.sixxs.net/archive/sixxs/aiccu/unix +PKG_MD5SUM:=c9bcc83644ed788e22a7c3f3d4021350 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/aiccu + SECTION:=ipv6 + CATEGORY:=IPv6 + DEPENDS:=+libpthread +ip +kmod-sit +kmod-tun + TITLE:=SixXS Automatic IPv6 Connectivity Client Utility + URL:=http://www.sixxs.net/tools/aiccu/ +endef + +define Build/Configure + $(SED) "s,strip,/bin/true," $(PKG_BUILD_DIR)/unix-console/Makefile +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" OS_NAME="Linux" OS_VERSION="$(LINUX_VERSION)" \ + EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ + EXTRA_LDFLAGS="$(TARGET_LDFLAGS) -pthread" \ + DEBUG=0 +endef + +define Package/aiccu/conffiles +/etc/config/aiccu +endef + +define Package/aiccu/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/unix-console/$(PKG_NAME) $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,aiccu)) diff --git a/ipv6/aiccu/patches/100-cross_compile.patch b/ipv6/aiccu/patches/100-cross_compile.patch new file mode 100644 index 0000000..dbdc50a --- /dev/null +++ b/ipv6/aiccu/patches/100-cross_compile.patch @@ -0,0 +1,101 @@ +--- aiccu/unix-console/Makefile.orig 2007-09-02 23:19:39.000000000 +0200 ++++ aiccu/unix-console/Makefile 2007-09-02 23:20:11.000000000 +0200 +@@ -25,7 +25,8 @@ + # CWARNS += -Wpacked + + #CFLAGS += $(CWARNS) -D_GNU_SOURCE -D_DEBUG -g3 -O0 +-CFLAGS += $(CWARNS) -D_GNU_SOURCE ++CFLAGS += $(CWARNS) $(EXTRA_CFLAGS) -D_GNU_SOURCE ++LDFLAGS += $(EXTRA_LDFLAGS) + CC = @gcc + RM = rm + +@@ -40,25 +41,25 @@ + # GnuTLS Support ? + # Used by TIC to secure that communication + # Currently defaultly builds only on Linux, but other platforms might easily also support it +-ifeq ($(shell uname | grep -c "Linux"),1) ++ifneq ($(HAVE_GNUTLS),) + CFLAGS += -D AICCU_GNUTLS + LDFLAGS += -lgnutls + endif + + # Linux +-ifeq ($(shell uname | grep -c "Linux"),1) ++ifeq ($(OS_NAME),Linux) + CFLAGS += -D_LINUX -D HAS_IFHEAD -D AICCU_TYPE="\"linux\"" + SRCS += ../common/aiccu_linux.c + OBJS += ../common/aiccu_linux.o +-LDFLAGS += -lpthread -lresolv ++LDFLAGS += -pthread -lresolv + endif + + # FreeBSD +-ifeq ($(shell uname | grep -c "FreeBSD"),1) ++ifeq ($(OS_NAME),FreeBSD) + CFLAGS += -D_FREEBSD + + # FreeBSD 4.x +-ifeq ($(shell uname -r | cut -c 1),4) ++ifeq ($(shell echo $(OS_VERSION) | cut -c 1),4) + CFLAGS += -D AICCU_TYPE="\"freebsd4\"" + SRCS += ../common/aiccu_freebsd4.c + OBJS += ../common/aiccu_freebsd4.o +@@ -71,7 +72,7 @@ + endif + + # DragonFlyBSD +-ifeq ($(shell uname | grep -c "DragonFly"),1) ++ifeq ($(OS_NAME),DragonFly) + CFLAGS += -D_DFBSD -D NEED_IFHEAD -D AICCU_TYPE="\"dragonfly\"" + SRCS += ../common/aiccu_freebsd4.c + OBJS += ../common/aiccu_freebsd4.o +@@ -79,7 +80,7 @@ + endif + + # NetBSD +-ifeq ($(shell uname | grep -c "NetBSD"),1) ++ifeq ($(OS_NAME),NetBSD) + CFLAGS += -D_NETBSD -D AICCU_TYPE="\"kame\"" + + # Check if net/if_tun.h has TUNSIFHEAD and enable support for it +@@ -97,10 +98,10 @@ + endif + + # OpenBSD +-ifeq ($(shell uname | grep -c "OpenBSD"),1) ++ifeq ($(OS_NAME),OpenBSD) + CFLAGS += -D_OPENBSD -D HAS_IFHEAD + # 2.7-2.9 +-ifeq ($(shell uname -r | cut -c 1),2) ++ifeq ($(shell echo $(OS_VERSION) | cut -c 1),2) + CFLAGS += -D AICCU_TYPE="\"openbsd2\"" + SRCS += ../common/aiccu_openbsd2.c + OBJS += ../common/aiccu_openbsd2.o +@@ -114,7 +115,7 @@ + endif + + # Darwin +-ifeq ($(shell uname | grep -c "Darwin"),1) ++ifeq ($(OS_NAME),Darwin) + CFLAGS += -D_DARWIN -D NEED_IFHEAD -D AICCU_TYPE="\"darwin\"" + SRCS += ../common/aiccu_darwin.c + OBJS += ../common/aiccu_darwin.o +@@ -122,7 +123,7 @@ + endif + + # SunOS / Solaris +-ifeq ($(shell uname | grep -c "SunOS"),1) ++ifeq ($(OS_NAME),SunOS) + CFLAGS += -D_SUNOS -D AICCU_TYPE="\"sunos\"" + SRCS += ../common/aiccu_sunos.c + OBJS += ../common/aiccu_sunos.o +@@ -130,7 +131,7 @@ + endif + + # AIX +-ifeq ($(shell uname | grep -c "AIX"),1) ++ifeq ($(OS_NAME),AIX) + CC = @/usr/vac/bin/xlc_r + CFLAGS = -qthreaded -q64 -qlanglvl=stdc99 -bmaxdata:0xD0000000 -D_64BIT -g -qdbxextra -qfullpath -qheapdebug -qformat=all -qcheck=all + CFLAGS += -D AICCU_CONSOLE diff --git a/ipv6/aiccu/patches/200-add_dn_skipname.patch b/ipv6/aiccu/patches/200-add_dn_skipname.patch new file mode 100644 index 0000000..ca6afce --- /dev/null +++ b/ipv6/aiccu/patches/200-add_dn_skipname.patch @@ -0,0 +1,70 @@ +diff -Nru aiccu.old/common/dn_skipname.c aiccu/common/dn_skipname.c +--- aiccu.old/common/dn_skipname.c 1970-01-01 02:00:00.000000000 +0200 ++++ aiccu/common/dn_skipname.c 2006-11-04 00:50:23.000000000 +0200 +@@ -0,0 +1,51 @@ ++#include ++#include ++ ++/* Ripped from glibc 2.4 sources. */ ++ ++/* ++ * ns_name_skip(ptrptr, eom) ++ * Advance *ptrptr to skip over the compressed name it points at. ++ * return: ++ * 0 on success, -1 (with errno set) on failure. ++ */ ++int ns_name_skip(const u_char **ptrptr, const u_char *eom) ++{ ++ const u_char *cp; ++ u_int n; ++ ++ cp = *ptrptr; ++ while (cp < eom && (n = *cp++) != 0) ++ { ++ /* Check for indirection. */ ++ switch (n & NS_CMPRSFLGS) { ++ case 0: /* normal case, n == len */ ++ cp += n; ++ continue; ++ case NS_CMPRSFLGS: /* indirection */ ++ cp++; ++ break; ++ default: /* illegal type */ ++ errno = EMSGSIZE; ++ return (-1); ++ } ++ break; ++ } ++ if (cp > eom) ++ { ++ errno = EMSGSIZE; ++ return (-1); ++ } ++ *ptrptr = cp; ++ return (0); ++} ++ ++int dn_skipname(const u_char *ptr, const u_char *eom) ++{ ++ const u_char *saveptr = ptr; ++ ++ if(ns_name_skip(&ptr, eom) == -1) ++ return (-1); ++ return (ptr - saveptr); ++} ++ +diff -Nru aiccu.old/unix-console/Makefile aiccu/unix-console/Makefile +--- aiccu.old/unix-console/Makefile 2006-11-04 00:51:20.000000000 +0200 ++++ aiccu/unix-console/Makefile 2006-11-04 00:48:51.000000000 +0200 +@@ -10,9 +10,9 @@ + # $Date: 2006-07-25 09:20:48 $ + # **********************************************************/ + +-SRCS = main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c ../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c ../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c ++SRCS = main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c ../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c ../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c ../common/dn_skipname.c + INCS = ../common/tun.h ../common/aiccu.h ../common/hash_md5.h ../common/hash_sha1.h ../common/common.h ../common/heartbeat.h ../common/tic.h ../common/ayiya.h ../common/resolver.h +-OBJS = main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o ../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o ../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o ++OBJS = main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o ../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o ../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o ../common/dn_skipname.o + + # New features not fully implemented and thus disabled for now + #CFLAGS += -D NEWSTUFF_TSP -D NEWSTUFF_TEEPEE diff --git a/ipv6/aiccu/patches/300-resolver-uclibc.patch b/ipv6/aiccu/patches/300-resolver-uclibc.patch new file mode 100644 index 0000000..fbd6a50 --- /dev/null +++ b/ipv6/aiccu/patches/300-resolver-uclibc.patch @@ -0,0 +1,29 @@ +--- aiccu/common/resolver.c.orig 2007-09-02 23:10:58.000000000 +0200 ++++ aiccu/common/resolver.c 2007-09-02 23:11:01.000000000 +0200 +@@ -26,7 +26,7 @@ + + int getrrs(const char *label, int rrtype, void gotrec(unsigned int num, int type, const char *record)) + { +-#ifdef _LINUX ++#if defined(_LINUX) && !defined(__UCLIBC__) + struct __res_state res; + #endif + unsigned char answer[8192]; +@@ -38,7 +38,7 @@ + uint16_t type = 0, class = 0; + uint32_t ttl = 0; + +-#ifdef _LINUX ++#if defined(_LINUX) && !defined(__UCLIBC__) + memset(&res, 0, sizeof(res)); + res.options = RES_DEBUG; + res_ninit(&res); +@@ -47,7 +47,7 @@ + #endif + + memset(answer, 0, sizeof(answer)); +-#ifdef _LINUX ++#if defined(_LINUX) && !defined(__UCLIBC__) + ret = res_nquery(&res, label, C_IN, rrtype, answer, sizeof(answer)); + #else + ret = res_query(label, C_IN, rrtype, answer, sizeof(answer)); diff --git a/ipv6/dhcp6/Makefile b/ipv6/dhcp6/Makefile new file mode 100644 index 0000000..056814a --- /dev/null +++ b/ipv6/dhcp6/Makefile @@ -0,0 +1,80 @@ +# +# Copyright (C) 2006-2009 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:=dhcp6 +PKG_VERSION:=1.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=dhcpv6-linux-$(PKG_VERSION).zip +PKG_SOURCE_URL:=@SF/dhcpv6-linux +PKG_MD5SUM:=86193dfa62137db3ea459543db4f1102 + +include $(INCLUDE_DIR)/package.mk + +PKG_UNPACK:=unzip -d $(PKG_BUILD_DIR)/ $(DL_DIR)/$(PKG_SOURCE) + +define Package/dhcp6/Default + SECTION:=ipv6 + CATEGORY:=IPv6 + DEPENDS:=+libncurses + TITLE:=IPv6 DHCP + URL:=http://sourceforge.net/projects/dhcpv6-linux +endef + +define Package/dhcp6-client + $(call Package/dhcp6/Default) + TITLE+= client +endef + +define Package/dhcp6-client/conffiles +/etc/dhcp6/solicit.conf +endef + +define Package/dhcp6-server + $(call Package/dhcp6/Default) + TITLE+= server +endef + +define Package/dhcp6-server/conffiles +/etc/dhcpd6/dhcpd6.conf +/etc/dhcpd6/leases6.conf +/etc/dhcpd6/partial_leases6.conf +endef + +define Build/Prepare + $(call Build/Prepare/Default) + # prevent package from rebuilding + find $(PKG_BUILD_DIR) | xargs touch +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/client \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" + $(MAKE) -C $(PKG_BUILD_DIR)/server \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" +endef + +define Package/dhcp6-client/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/dhcp6 + $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/cli $(1)/usr/sbin/dhcp6client + $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/solicit.conf $(1)/etc/dhcp6/ +endef + +define Package/dhcp6-server/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/dhcpd6 + $(INSTALL_BIN) $(PKG_BUILD_DIR)/server/serv $(1)/usr/sbin/dhcpd6 + $(INSTALL_BIN) $(PKG_BUILD_DIR)/server/*.conf $(1)/etc/dhcpd6/ +endef + +$(eval $(call BuildPackage,dhcp6-client)) +$(eval $(call BuildPackage,dhcp6-server)) diff --git a/ipv6/dhcp6/patches/001-opt_flags.patch b/ipv6/dhcp6/patches/001-opt_flags.patch new file mode 100644 index 0000000..326f210 --- /dev/null +++ b/ipv6/dhcp6/patches/001-opt_flags.patch @@ -0,0 +1,94 @@ +diff -urN orig/dhcp6-1.0/client/Makefile dhcp6-1.0/client/Makefile +--- orig/dhcp6-1.0/client/Makefile 2025-06-28 23:21:40.000000000 +0200 ++++ dhcp6-1.0/client/Makefile 2005-12-13 13:43:11.000000000 +0100 +@@ -3,40 +3,40 @@ + STD_HEADERS = stdhead.h head.h struct.h options_type.h message_type.h states.h timer_val.h constants.h macros.h status_codes.h + OBJECT_FILES = client.o solicit.o clilib.o parse.o request.o decline.o renew.o rebind.o release.o + HEADER_FILES = solicit.h clilib.h parse.h request.h decline.h renew.h rebind.h release.h +- ++CFLAGS = -g3 + + dhcpv6_client : dhcpv6_client.c cli +- $(CC) -g3 dhcpv6_client.c -o dhcpv6_client ++ $(CC) $(CFLAGS) $(LDFLAGS) dhcpv6_client.c -o dhcpv6_client + + cli : $(OBJECT_FILES) +- $(CC) -g3 $(OBJECT_FILES) -o cli -lncurses ++ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJECT_FILES) -o cli -lncurses + + client.o : client.c $(STD_HEADERS) $(HEADER_FILES) +- $(CC) -g3 -c client.c -o client.o ++ $(CC) $(CFLAGS) -c client.c -o client.o + + release.o : release.c release.h clilib.h +- $(CC) -g3 -c release.c -o release.o ++ $(CC) $(CFLAGS) -c release.c -o release.o + + rebind.o : rebind.c rebind.h clilib.h +- $(CC) -g3 -c rebind.c -o rebind.o ++ $(CC) $(CFLAGS) -c rebind.c -o rebind.o + + renew.o : renew.c renew.h clilib.h +- $(CC) -g3 -c renew.c -o renew.o ++ $(CC) $(CFLAGS) -c renew.c -o renew.o + + request.o : request.c request.h clilib.h +- $(CC) -g3 -c request.c -o request.o ++ $(CC) $(CFLAGS) -c request.c -o request.o + + decline.o : decline.c decline.h clilib.h parse.h solicit.h +- $(CC) -g3 -c decline.c -o decline.o ++ $(CC) $(CFLAGS) -c decline.c -o decline.o + + solicit.o : solicit.c solicit.h clilib.h parse.h +- $(CC) -g3 -c solicit.c -o solicit.o ++ $(CC) $(CFLAGS) -c solicit.c -o solicit.o + + clilib.o : clilib.c clilib.h parse.h +- $(CC) -g3 -c clilib.c -o clilib.o ++ $(CC) $(CFLAGS) -c clilib.c -o clilib.o + + parse.o : parse.c parse.h clilib.h +- $(CC) -g3 -c parse.c -o parse.o ++ $(CC) $(CFLAGS) -c parse.c -o parse.o + + clean : + rm -f *.o cli dhcpv6_client +--- orig/dhcp6-1.0/server/Makefile 2002-06-28 14:50:04.000000000 +0200 ++++ dhcp6-1.0/server/Makefile 2005-12-13 11:35:53.000000000 +0100 +@@ -1,27 +1,28 @@ + CC = gcc + STD_HEADERS = stdhead.h head.h struct.h options_type.h message_type.h macros.h status_codes.h constants.h + OBJECT_FILES = server.o lib.o advertise.o parse.o leases.o reply.o ++CFLAGS = -g3 + + serv: $(OBJECT_FILES) +- $(CC) -g3 $(OBJECT_FILES) -o serv ++ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJECT_FILES) -o serv + + lib.o: lib.c lib.h $(STD_HEADERS) +- $(CC) -g3 -c lib.c -o lib.o ++ $(CC) $(CFLAGS) -c lib.c -o lib.o + + parse.o: parse.c parse.h $(STD_HEADERS) +- $(CC) -g3 -c parse.c -o parse.o ++ $(CC) $(CFLAGS) -c parse.c -o parse.o + + leases.o: leases.c leases.h $(STD_HEADERS) +- $(CC) -g3 -c leases.c -o leases.o ++ $(CC) $(CFLAGS) -c leases.c -o leases.o + + advertise.o: advertise.c advertise.h $(STD_HEADERS) +- $(CC) -g3 -c advertise.c -o advertise.o ++ $(CC) $(CFLAGS) -c advertise.c -o advertise.o + + reply.o: reply.c reply.h $(STD_HEADERS) +- $(CC) -g3 -c reply.c -o reply.o ++ $(CC) $(CFLAGS) -c reply.c -o reply.o + + server.o: server.c lib.h advertise.h reply.h leases.h parse.h $(STD_HEADERS) +- $(CC) -g3 -c server.c -o server.o ++ $(CC) $(CFLAGS) -c server.c -o server.o + + clean: + rm -f *.o serv diff --git a/ipv6/dhcp6/patches/002-gcc_lvalue.patch b/ipv6/dhcp6/patches/002-gcc_lvalue.patch new file mode 100644 index 0000000..e5deda6 --- /dev/null +++ b/ipv6/dhcp6/patches/002-gcc_lvalue.patch @@ -0,0 +1,11 @@ +--- dhcp6-1.0/client/solicit.c 2025-06-28 23:21:40.000000000 -0700 ++++ dhcp6-1.0-patched/client/solicit.c 2006-04-27 15:32:52.000000000 -0700 +@@ -18,7 +18,7 @@ + dhcp_message_ptr -> opt = add_client_id_option (interface_details); + + opt_ptr = (struct OPTIONS *) dhcp_message_ptr -> opt; +- (struct OPTIONS *) ((struct DUID *) opt_ptr -> opt_data) -> opt = add_ia_option (interface_details); ++ ((struct DUID *) opt_ptr -> opt_data) -> opt = add_ia_option (interface_details); + return dhcp_message_ptr; + } + diff --git a/ipv6/dhcp6/patches/003-debug.patch b/ipv6/dhcp6/patches/003-debug.patch new file mode 100644 index 0000000..7968df2 --- /dev/null +++ b/ipv6/dhcp6/patches/003-debug.patch @@ -0,0 +1,22 @@ +diff -urN orig/dhcp6-1.0/client/clilib.c dhcp6-1.0/client/clilib.c +--- orig/dhcp6-1.0/client/clilib.c 2025-06-28 23:21:40.000000000 +0200 ++++ dhcp6-1.0/client/clilib.c 2005-12-13 13:42:43.000000000 +0100 +@@ -554,7 +554,7 @@ + + void generate_trans_id (u_int32_t *trans_id) + { +- extern u_int32_t g_trans_id; ++ extern int g_trans_id; + time_t t; + srand (time (&t)); + *trans_id = 0; +@@ -890,9 +890,7 @@ + break; + + default : +-#if DEBUG == 3 + printf ("Unrecognized DUID type\n"); +-#endif + } + + next_opt = (struct OPTIONS *) malloc (sizeof (struct OPTIONS)); diff --git a/ipv6/dibbler/Makefile b/ipv6/dibbler/Makefile new file mode 100644 index 0000000..4b104b8 --- /dev/null +++ b/ipv6/dibbler/Makefile @@ -0,0 +1,134 @@ +# +# Copyright (C) 2006-2012 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:=dibbler +PKG_VERSION:=0.8.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://klub.com.pl/dhcpv6/dibbler +PKG_MD5SUM:=313044c95af3091607127a05c338d8ec + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/dibbler/Default + SECTION:=ipv6 + CATEGORY:=IPv6 + DEPENDS:=$(CXX_DEPENDS) +libpthread + TITLE:=Dibbler, a portable DHCPv6 implementation + URL:=http://klub.com.pl/dhcpv6/ +endef + +define Package/dibbler/Default/description + Dibbler is a portable DHCPv6 implementation. It supports stateful (i.e. + IPv6 address granting) as well as stateless (i.e. option granting) + autoconfiguration for IPv6. +endef + +define Package/dibbler-client + $(call Package/dibbler/Default) + TITLE+= (client) +endef + +define Package/dibbler-client/conffiles +/etc/dibbler/client.conf +endef + +define Package/dibbler-client/description + $(call Package/dibbler/Default/description) + This package contains the dibbler client. +endef + +define Package/dibbler-relay + $(call Package/dibbler/Default) + TITLE+= (relay) +endef + +define Package/dibbler-relay/conffiles +/etc/dibbler/relay.conf +endef + +define Package/dibbler-relay/description + $(call Package/dibbler/Default/description) + This package contains the dibbler relay. +endef + +define Package/dibbler-requestor + $(call Package/dibbler/Default) + TITLE+= (requestor) +endef + +define Package/dibbler-requestor/description + $(call Package/dibbler/Default/description) + This package contains the dibbler requestor. +endef + +define Package/dibbler-server + $(call Package/dibbler/Default) + TITLE+= (server) +endef + +define Package/dibbler-server/conffiles +/etc/dibbler/server.conf +endef + +define Package/dibbler-server/description + $(call Package/dibbler/Default/description) + This package contains the dibbler server. +endef + +define Package/dibbler-client/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dibbler-client $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/dibbler + $(INSTALL_CONF) \ + $(PKG_BUILD_DIR)/doc/examples/client.conf \ + $(1)/etc/dibbler/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) \ + ./files/dibbler-client.init \ + $(1)/etc/init.d/dibbler-client +endef + +define Package/dibbler-relay/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dibbler-relay $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/dibbler + $(INSTALL_CONF) \ + $(PKG_BUILD_DIR)/doc/examples/relay.conf \ + $(1)/etc/dibbler/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) \ + ./files/dibbler-relay.init \ + $(1)/etc/init.d/dibbler-relay +endef + +define Package/dibbler-requestor/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dibbler-requestor $(1)/usr/sbin/ +endef + +define Package/dibbler-server/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dibbler-server $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/dibbler + $(INSTALL_CONF) \ + $(PKG_BUILD_DIR)/doc/examples/server.conf \ + $(1)/etc/dibbler/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) \ + ./files/dibbler-server.init \ + $(1)/etc/init.d/dibbler-server +endef + +$(eval $(call BuildPackage,dibbler-client)) +$(eval $(call BuildPackage,dibbler-relay)) +$(eval $(call BuildPackage,dibbler-requestor)) +$(eval $(call BuildPackage,dibbler-server)) diff --git a/ipv6/dibbler/files/dibbler-client.init b/ipv6/dibbler/files/dibbler-client.init new file mode 100644 index 0000000..04e8a4d --- /dev/null +++ b/ipv6/dibbler/files/dibbler-client.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common + +START=90 +STOP=90 + +start() { + mkdir -p /var/lib/dibbler + dibbler-client start +} + +stop() { + dibbler-client stop +} diff --git a/ipv6/dibbler/files/dibbler-relay.init b/ipv6/dibbler/files/dibbler-relay.init new file mode 100644 index 0000000..9f42e22 --- /dev/null +++ b/ipv6/dibbler/files/dibbler-relay.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common + +START=90 +STOP=90 + +start() { + mkdir -p /var/lib/dibbler + dibbler-relay start +} + +stop() { + dibbler-relay stop +} diff --git a/ipv6/dibbler/files/dibbler-server.init b/ipv6/dibbler/files/dibbler-server.init new file mode 100644 index 0000000..0a93c2a --- /dev/null +++ b/ipv6/dibbler/files/dibbler-server.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common + +START=90 +STOP=90 + +start() { + mkdir -p /var/lib/dibbler + dibbler-server start +} + +stop() { + dibbler-server stop +} diff --git a/ipv6/gw6c/Makefile b/ipv6/gw6c/Makefile new file mode 100644 index 0000000..a505e40 --- /dev/null +++ b/ipv6/gw6c/Makefile @@ -0,0 +1,80 @@ +# +# Copyright (C) 2008-2011 OpenWrt.org +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=gw6c +PKG_VERSION:=5.1 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://openwrt.linux-appliance.net/sources +PKG_MD5SUM:=eeac7292a622681651ec3bd9b2e5b061 +PKG_BUILD_DIR:=$(BUILD_DIR)/gw6-$(PKG_VERSION) + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/gw6c + SECTION:=ipv6 + CATEGORY:=IPv6 + DEPENDS:=+libpthread +ip +kmod-tun +kmod-ipv6 $(CXX_DEPENDS) +radvd + TITLE:=IPv6 tunnel client software + URL:=http://www.go6.net +endef + +define Package/gw6c/description + Client to configure an IPv6 tunnel to + Hexago/freenet6/go6.net's migration broker. +endef + +GW6C_OPTS:= \ + C_COMPILER="$(TARGET_CC) -c -DNO_STDLIBCXX" \ + COMPILER="$(TARGET_CXX) -c -DNO_STDLIBCXX" \ + CPP_FLAGS="$(TARGET_CFLAGS) -I. -Wall -DNDEBUG $(TARGET_CPPFLAGS)" \ + RANLIB="$(TARGET_CROSS)ranlib" \ + ARCHIVER="$(TARGET_CROSS)ar" \ + C_LINKER="$(TARGET_CC)" \ + LINKER="$(TARGET_CXX)" \ + exportdir=$(PKG_BUILD_DIR)/gw6c \ + export + +define Build/Configure + $(INSTALL_DIR) $(PKG_BUILD_DIR)/gw6c/include + $(INSTALL_DATA) $(PKG_BUILD_DIR)/gw6c-config/gw6cconfig/gw6c_c_wrapper.h \ + $(PKG_BUILD_DIR)/gw6c/include +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/gw6c-config \ + $(GW6C_OPTS) + $(MAKE) -C $(PKG_BUILD_DIR)/gw6c-messaging \ + $(GW6C_OPTS) + $(MAKE) -C $(PKG_BUILD_DIR)/tspc-advanced \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -fno-builtin -Wall -I$(PKG_BUILD_DIR)/tspc-advanced/include \ + -I$(PKG_BUILD_DIR)/tspc-advanced/platform/openwrt -I$(PKG_BUILD_DIR)/tspc-advanced" \ + LDFLAGS="-L$(PKG_BUILD_DIR)/tspc-advanced/gw6cconfig \ + -L$(PKG_BUILD_DIR)/tspc-advanced/gw6cmessaging \ + $(TARGET_LDFLAGS) $(LIBGCC_S)" \ + target="openwrt" \ + installdir="$(PKG_INSTALL_DIR)" +endef + +define Package/gw6c/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tspc-advanced/bin/$(PKG_NAME) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/share/gw6c/template + $(CP) ./files/openwrt.sh $(1)/usr/share/gw6c/template + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/gw6c.init $(1)/etc/init.d/gw6c + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/gw6c.config $(1)/etc/config/gw6c +endef + +define Package/gw6c/conffiles +/etc/config/gw6c +endef + +$(eval $(call BuildPackage,gw6c)) diff --git a/ipv6/gw6c/files/gw6c.config b/ipv6/gw6c/files/gw6c.config new file mode 100644 index 0000000..e634c98 --- /dev/null +++ b/ipv6/gw6c/files/gw6c.config @@ -0,0 +1,66 @@ +config gw6c basic + #Comment out next line to enable gw6c + option disabled 1 + + #Leave empty if connecting anonymously + option userid + option passwd + + #For anonymous use anon.frenet6.net and + #account holders should use broker.freenet6.net + option server anon.freenet6.net + + #auth_method + #Use anonymous with anonymous access and + #any if you are account holder + option auth_method anonymous + +config gw6c routing + #host_type + option host_type host + option prefixlen 48 + option ifprefix br-lan + + #DNS server list to which the reverse prefix + #will be delegated. Separate servers with : + option dns_server + +config gw6c advanced + #Location where to store configuration file + option gw6c_conf /tmp/gw6c.conf + option gw6c_dir /usr/share/gw6c + option auto_retry yes + option retry_delay 30 + option keepalive yes + #keepalive interval + option interval 30 + #tunnel_mode + option if_tunnel_mode v6anyv4 + option if_v6v4 sit1 + option if_v6udpv4 tun + option if_v4v6 sit0 + option client_v4 auto + option client_v6 auto + option template openwrt + option proxy_client no + +config gw6c broker + option broker_list /tmp/gw6c-broker-list.txt + option last_server /tmp/gw6c-last-server.txt + # Always use last known working server? + option always_same_serv no + +config gw6c logging + option log_console 0 + option log_stderr 1 + option log_file 0 + option log_syslog 0 + + option log_filename /var/log/gw6c.log + option log_rotation yes + #Max size when using log file rotation + #possible values: 16|32|128|1024 + option log_maxsize 32 + + # + option syslog_facility USER diff --git a/ipv6/gw6c/files/gw6c.init b/ipv6/gw6c/files/gw6c.init new file mode 100755 index 0000000..f311324 --- /dev/null +++ b/ipv6/gw6c/files/gw6c.init @@ -0,0 +1,111 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org +# Copyright (C) 2007 RoadRunner.cx + +START=52 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +genconf() { + + [ -f /etc/config/gw6c ] || { + echo "You are missing configuration file /etc/config/gw6c" + return 1 + } + + config_load "gw6c" + + config_get DISABLED basic disabled + + [ "$DISABLED" == "1" ] && { + echo "You haven't edited your configuration file. Gateway6 is disabled." + return 1 + } + + config_get USERID basic userid + config_get PASSWORD basic passwd + config_get SERVER basic server + config_get AUTH_METHOD basic auth_method + + config_get HOST_TYPE routing host_type + config_get PREFIX_LEN routing prefixlen + config_get IF_PREFIX routing ifprefix + config_get DNS_SERVER routing dns_server + + config_get GW6C_CONF advanced gw6c_conf + config_get GW6C_DIR advanced gw6c_dir + config_get AUTO_RETRY advanced auto_retry + config_get RETRY_DELAY advanced retry_delay + config_get KEEPALIVE advanced keepalive + config_get KEEPALIVE_INTERVAL advanced interval + config_get TUNNEL_MODE advanced if_tunnel_mode + config_get IF_V6V4 advanced if_v6v4 + config_get IF_V6UDPV4 advanced if_v6udpv4 + config_get IF_V4V6 advanced if_v4v6 + config_get CLIENT_V4 advanced client_v4 + config_get CLIENT_V6 advanced client_v6 + config_get TEMPLATE advanced template + config_get PROXY_CLIENT advanced proxy_client + + config_get BROKER_LIST broker broker_list + config_get LAST_SERVER broker last_server + config_get ALWAYS_SAMESERV broker always_same_serv + + config_get LOG_CONSOLE logging log_console + config_get LOG_STDERR logging log_stderr + config_get LOG_FILE logging log_file + config_get LOG_SYSLOG logging log_syslog + config_get LOG_FILENAME logging log_filename + config_get LOG_ROTATE logging log_rotation + config_get LOG_MAXSIZE logging log_maxsize + config_get SYSLOG_FACILITY logging syslog_facility + + cat >$GW6C_CONF < /proc/sys/net/ipv6/conf/all/forwarding + } +} diff --git a/ipv6/gw6c/files/openwrt.sh b/ipv6/gw6c/files/openwrt.sh new file mode 100755 index 0000000..75d418f --- /dev/null +++ b/ipv6/gw6c/files/openwrt.sh @@ -0,0 +1,181 @@ +#!/bin/sh +# +# openwrt.sh,v 1.1.4.1 2007/01/12 19:16:12 dgregoire Exp +# +# This source code copyright (c) Hexago Inc. 2002-2007. +# +# LICENSE NOTICE: You may use and modify this source code only if you +# have executed a valid license agreement with Hexago Inc. granting +# you the right to do so, the said license agreement governing such +# use and modifications. Copyright or other intellectual property +# notices are not to be removed from the source code. +# +# Note: IPV6 support and tun Support must be enabled before calling this script. +# + + +LANGUAGE=C + +if [ -z $TSP_VERBOSE ]; then + TSP_VERBOSE=0 +fi + +KillProcess() +{ + if [ ! -z $TSP_VERBOSE ]; then + if [ $TSP_VERBOSE -ge 2 ]; then + echo killing $* + fi + fi + PID=`ps axww | grep $1 | grep -v grep | awk '{ print $1;}'` + echo $PID + if [ ! -z $PID ]; then + kill $PID + fi +} + +Display() +{ + if [ -z $TSP_VERBOSE ]; then + return; + fi + if [ $TSP_VERBOSE -lt $1 ]; then + return; + fi + shift + echo "$*" +} + +Exec() +{ + if [ ! -z $TSP_VERBOSE ]; then + if [ $TSP_VERBOSE -ge 2 ]; then + echo $* + fi + fi + $* # Execute command + if [ $? -ne 0 ]; then + echo "Error while executing $1" + echo " Command: $*" + exit 1 + fi +} + +ExecNoCheck() +{ + if [ ! -z $TSP_VERBOSE ]; then + if [ $TSP_VERBOSE -ge 2 ]; then + echo $* + fi + fi + $* # Execute command +} + +# Program localization + +Display 1 "--- Start of configuration script. ---" +Display 1 "Script: " `basename $0` + +ifconfig=/sbin/ifconfig +route=/sbin/route +ipconfig=/usr/sbin/ip +rtadvd=/usr/sbin/radvd +rtadvd_pid=/var/run/radvd.pid +sysctl=/sbin/sysctl +rtadvdconfigfilename=gw6c-radvd.conf +rtadvdconfigfile=/tmp/$rtadvdconfigfilename + +if [ -z $TSP_HOME_DIR ]; then + echo "TSP_HOME_DIR variable not specified!;" + exit 1 +fi + +if [ ! -d $TSP_HOME_DIR ]; then + echo "Error : directory $TSP_HOME_DIR does not exist" + exit 1 +fi +# + +if [ -z $TSP_HOST_TYPE ]; then + echo Error: TSP_HOST_TYPE not defined. + exit 1 +fi + +if [ X"${TSP_HOST_TYPE}" = X"host" ] || [ X"${TSP_HOST_TYPE}" = X"router" ]; then + # + # Configured tunnel config (IPv6) + Display 1 "$TSP_TUNNEL_INTERFACE setup" + if [ X"${TSP_TUNNEL_MODE}" = X"v6v4" ]; then + Display 1 "Setting up link to $TSP_SERVER_ADDRESS_IPV4" + ExecNoCheck $ipconfig tunnel del $TSP_TUNNEL_INTERFACE + ExecNoCheck sleep 1 + Exec $ipconfig tunnel add $TSP_TUNNEL_INTERFACE mode sit ttl 64 remote $TSP_SERVER_ADDRESS_IPV4 + fi + + Exec $ifconfig $TSP_TUNNEL_INTERFACE up + + PREF=`echo $TSP_CLIENT_ADDRESS_IPV6 | sed "s/:0*/:/g" |cut -d : -f1-2` + OLDADDR=`$ifconfig $TSP_TUNNEL_INTERFACE | grep "inet6.* $PREF" | sed -e "s/^.*inet6 addr: //" -e "s/ Scope.*\$//"` + if [ ! -z $OLDADDR ]; then + Display 1 "Removing old IPv6 address $OLDADDR" + Exec $ifconfig $TSP_TUNNEL_INTERFACE inet6 del $OLDADDR + fi + Display 1 "This host is: $TSP_CLIENT_ADDRESS_IPV6/$TSP_TUNNEL_PREFIXLEN" + Exec $ifconfig $TSP_TUNNEL_INTERFACE add $TSP_CLIENT_ADDRESS_IPV6/$TSP_TUNNEL_PREFIXLEN + Exec $ifconfig $TSP_TUNNEL_INTERFACE mtu 1280 + # + # Default route + Display 1 "Adding default route" + ExecNoCheck $route -A inet6 del ::/0 2>/dev/null # delete old default route + ExecNoCheck $route -A inet6 del 2000::/3 2>/dev/null # delete old gw route + Exec $route -A inet6 add ::/0 dev $TSP_TUNNEL_INTERFACE + Exec $route -A inet6 add 2000::/3 dev $TSP_TUNNEL_INTERFACE +fi + +# Router configuration if required +if [ X"${TSP_HOST_TYPE}" = X"router" ]; then + Display 1 "Router configuration" + Display 1 "Kernel setup" + if [ X"${TSP_PREFIXLEN}" != X"64" ]; then + #Better way on linux to avoid loop with the remaining /48? + $route -A inet6 add $TSP_PREFIX::/$TSP_PREFIXLEN dev $TSP_HOME_INTERFACE 2>/dev/null + fi + Display 1 "Adding prefix to $TSP_HOME_INTERFACE" + OLDADDR=`$ifconfig $TSP_HOME_INTERFACE | grep "inet6.* $PREF" | sed -e "s/^.*inet6 addr: //" -e "s/ Scope.*\$//"` + if [ ! -z $OLDADDR ]; then + Display 1 "Removing old IPv6 address $OLDADDR" + Exec $ifconfig $TSP_HOME_INTERFACE del $OLDADDR + fi + Exec $ifconfig $TSP_HOME_INTERFACE add $TSP_PREFIX::1/64 + # Router advertisement configuration + Display 1 "Create new $rtadvdconfigfile" + echo "##### rtadvd.conf made by Gateway6 Client ####" > "$rtadvdconfigfile" + echo "interface $TSP_HOME_INTERFACE" >> "$rtadvdconfigfile" + echo "{" >> "$rtadvdconfigfile" + echo " AdvSendAdvert on;" >> "$rtadvdconfigfile" + echo " prefix $TSP_PREFIX::/64" >> "$rtadvdconfigfile" + echo " {" >> "$rtadvdconfigfile" + echo " AdvOnLink on;" >> "$rtadvdconfigfile" + echo " AdvAutonomous on;" >> "$rtadvdconfigfile" + echo " };" >> "$rtadvdconfigfile" + echo "};" >> "$rtadvdconfigfile" + echo "" >> "$rtadvdconfigfile" + /etc/init.d/radvd stop + # Then enable forwarding. Killing + # radvd disables forwarding and radvd + # does NOT start without forwarding enabled + Exec $sysctl -w net.ipv6.conf.all.forwarding=1 # ipv6_forwarding enabled + if [ -f $rtadvdconfigfile ]; then + Exec $rtadvd -p $rtadvd_pid -C $rtadvdconfigfile + Display 1 "Starting radvd: $rtadvd -p $rtadvd_pid -C $rtadvdconfigfile" + else + echo "Error : file $rtadvdconfigfile not found" + exit 1 + fi +fi + +Display 1 "--- End of configuration script. ---" + +exit 0 + +#--------------------------------------------------------------------- diff --git a/ipv6/ipv6calc/Makefile b/ipv6/ipv6calc/Makefile new file mode 100644 index 0000000..0397f8a --- /dev/null +++ b/ipv6/ipv6calc/Makefile @@ -0,0 +1,119 @@ +# +# Copyright (C) 2008-2012 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:=ipv6calc +PKG_VERSION:=0.93.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc +PKG_MD5SUM:=9a5b7fdd1a90cd621dc43623976d912a + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ipv6calc/Default + SECTION:=ipv6 + CATEGORY:=IPv6 + URL:=http://www.deepspace6.net/projects/ipv6calc.html +endef + +define Package/ipv6calc/Default/description + ipv6calc is a small utility written in programming languate C to manipulate + (not only) IPv6 addresses. Intentions were convering a given IPv6 address + into compressed format, convering a given IPv6 address into the same format + like shown in /proc/net/if_inet6 and (because it was not difficulty) + migrating the Perl program ip6_int into. Now only one utiltity is needed to + do a lot. +endef + +define Package/ipv6calc + $(call Package/ipv6calc/Default) + TITLE:=IPv6 addresses calculations (full) + VARIANT:=full +endef + +define Package/ipv6calc/description + $(call Package/ipv6calc/Default/description) + This package contains an ipv6calc with the internal databases enabled. +endef + +define Package/ipv6calc-mini + $(call Package/ipv6calc/Default) + TITLE:=IPv6 addresses calculations (mini) + VARIANT:=mini +endef + +define Package/ipv6calc-mini/description + $(call Package/ipv6calc/Default/description) + This package contains an ipv6calc with the internal databases disabled. +endef + +define Package/ipv6log + $(call Package/ipv6calc/Default) + TITLE:=Webserver log helper programs (full) + VARIANT:=full +endef + +define Package/ipv6log/description + $(call Package/ipv6calc/Default/description) + This package contains webserver log anonymization, conversion, and statistics + helper programs with the internal databases enabled. +endef + +define Package/ipv6log-mini + $(call Package/ipv6calc/Default) + TITLE:=Webserver log helper programs (mini) + VARIANT:=mini +endef + +define Package/ipv6log-mini/description + $(call Package/ipv6calc/Default/description) + This package contains webserver log anonymization, conversion, and statistics + helper programs with the internal databases disabled. +endef + +ifeq ($(BUILD_VARIANT),full) + CONFIGURE_ARGS += \ + --enable-db-ieee \ + --enable-db-ipv4 \ + --enable-db-ipv6 +endif + +ifeq ($(BUILD_VARIANT),mini) + CONFIGURE_ARGS += \ + --disable-db-ieee \ + --disable-db-ipv4 \ + --disable-db-ipv6 +endif + +MAKE_FLAGS += \ + CC="$(TARGET_CC)" \ + COPTS="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)" + +define Package/ipv6calc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ipv6calc $(1)/usr/bin/ +endef + +Package/ipv6calc-mini/install = $(Package/ipv6calc/install) + +define Package/ipv6log/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ipv6log* $(1)/usr/bin/ +endef + +Package/ipv6log-mini/install = $(Package/ipv6log/install) + +$(eval $(call BuildPackage,ipv6calc)) +$(eval $(call BuildPackage,ipv6calc-mini)) +$(eval $(call BuildPackage,ipv6log)) +$(eval $(call BuildPackage,ipv6log-mini)) diff --git a/ipv6/miredo/Makefile b/ipv6/miredo/Makefile new file mode 100644 index 0000000..7c26ed5 --- /dev/null +++ b/ipv6/miredo/Makefile @@ -0,0 +1,105 @@ +# +# Copyright (C) 2006-2012 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:=miredo +PKG_VERSION:=1.2.4 +PKG_RELEASE:=3 + +PKG_SOURCE_URL:=http://www.remlab.net/files/miredo +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_MD5SUM:=1281e7e75bddbde244cd778d99fa22d4 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/miredo/Default + SECTION:=ipv6 + CATEGORY:=IPv6 + SUBMENU:=miredo: Teredo (IPv6 tunneling over UDP through NAT) + URL:=http://www.remlab.net/miredo/ +endef + +define Package/miredo-common +$(call Package/miredo/Default) + TITLE:=Teredo (IPv6 tunneling over UDP through NAT) shared libraries + DEPENDS+= +ip +libpthread +librt $(CXX_DEPENDS) +kmod-ipv6 +kmod-tun +endef + +define Package/miredo-server +$(call Package/miredo/Default) + TITLE:=Teredo (IPv6 tunneling over UDP through NAT) server daemon + DEPENDS+= +miredo-common +endef + +define Package/miredo-server/conffiles +/etc/miredo/miredo-server.conf +endef + +define Package/miredo-client +$(call Package/miredo/Default) + TITLE:=Teredo (IPv6 tunneling over UDP through NAT) client and relay daemon + DEPENDS+= +miredo-common +endef + +define Package/miredo-client/conffiles +/etc/miredo/miredo.conf +endef + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --with-gnu-ld \ + --disable-rpath \ + --disable-chroot \ + --enable-teredo-client \ + --enable-miredo-user=root \ + --without-Judy + +EXTRA_CXXFLAGS=-fno-rtti + +CONFIGURE_VARS += \ + LIBS="-lm" \ + ac_cv_file__proc_self_maps=yes \ + ac_cv_header_sys_capability_h=no + +MAKE_FLAGS := CXXLINK="$(TARGET_CXX)" + +define Package/miredo-common/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lib{teredo,tun6}.so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/miredo + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/miredo/miredo-privproc $(1)/usr/lib/miredo +endef + +define Package/miredo-server/install + $(INSTALL_DIR) $(1)/etc/miredo + $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/miredo/examples/miredo-server.conf $(1)/etc/miredo/miredo-server.conf + $(INSTALL_BIN) ./files/client-hook $(1)/etc/miredo/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/miredo-server.init $(1)/etc/init.d/miredo-server + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/miredo-server $(1)/usr/sbin/ +endef + +define Package/miredo-client/install + $(INSTALL_DIR) $(1)/etc/miredo + $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/miredo/examples/miredo.conf $(1)/etc/miredo/miredo.conf + $(INSTALL_BIN) ./files/client-hook $(1)/etc/miredo/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/miredo.init $(1)/etc/init.d/miredo + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/miredo $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,miredo-common)) +$(eval $(call BuildPackage,miredo-server)) +$(eval $(call BuildPackage,miredo-client)) diff --git a/ipv6/miredo/files/client-hook b/ipv6/miredo/files/client-hook new file mode 100644 index 0000000..b4c3ce8 --- /dev/null +++ b/ipv6/miredo/files/client-hook @@ -0,0 +1,70 @@ +#! /bin/sh +# +# Miredo client hook script for Linux/iproute2 +# Copyright © 2007 Rémi Denis-Courmont. +# Distributed under the terms of the GNU General Public License version 2. + +# Linux iproute2 path: +IP="/usr/sbin/ip" + +# Linux default route default metric is 1024 +# (we put 1029 so that Teredo is used as a last resort): +METRIC=1029 + +# Linux routing table ID +# (possible values: 1-252 from /etc/iproute/rt_tables): +TABLE="teredo" + +# Linux routing rule priority +# (possible values: 1-32765, lowest number is highest priority): +PRIO=32765 + +# MTU for the tunnel interface +# (default: specified by the Teredo server, or 1280) +#MTU=1400 + +if ! test -x "$IP"; then + echo "$0: iproute2 is required! Please install it." >&2 + exit 1 +fi + +# Nothing to do with destroy event +if test "$STATE" = "destroy"; then exit 0; fi + +# If the source routing table is not configured, ignore it. +if ! "$IP" route show table "$TABLE" >/dev/null 2>&1; then + unset TABLE +else + if test "$OLD_ADDRESS"; then + "$IP" -6 rule del from "$OLD_ADDRESS" \ + prio "$PRIO" table "$TABLE" 2>/dev/null + fi + "$IP" -6 route flush table "$TABLE" 2>/dev/null +fi + +"$IP" -6 route flush dev "$IFACE" 2>/dev/null +"$IP" -6 address flush dev "$IFACE" 2>/dev/null + +"$IP" -6 link set dev "$IFACE" "$STATE" +if test "$MTU"; then + "$IP" link set dev "$IFACE" mtu "$MTU" +fi + +case "$STATE" in + up) + "$IP" -6 address add "${LLADDRESS}/64" dev "$IFACE" + "$IP" -6 address add "${ADDRESS}/32" dev "$IFACE" + "$IP" -6 route add default dev "$IFACE" metric "$METRIC" + + if test "$TABLE"; then + "$IP" -6 route add default dev "$IFACE" table "$TABLE" + "$IP" -6 rule add from "$ADDRESS" \ + prio "$PRIO" table "$TABLE" + fi +esac + +# This should be required when changing policy routing rules, but it +# seems to confuse certain kernels into removing our default route! +#"$IP" -6 route flush cache 2>/dev/null + +exit 0 diff --git a/ipv6/miredo/files/miredo-server.init b/ipv6/miredo/files/miredo-server.init new file mode 100644 index 0000000..e82820f --- /dev/null +++ b/ipv6/miredo/files/miredo-server.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +start() { + service_start /usr/sbin/miredo-server +} + +stop() { + service_stop /usr/sbin/miredo-server +} diff --git a/ipv6/miredo/files/miredo.init b/ipv6/miredo/files/miredo.init new file mode 100644 index 0000000..0a83c96 --- /dev/null +++ b/ipv6/miredo/files/miredo.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +# XXX: miredo create a pid file but using it doesn't seem to work +#SERVICE_USE_PID=1 + +start() { + service_start /usr/sbin/miredo +} + +stop() { + service_stop /usr/sbin/miredo +} diff --git a/ipv6/miredo/patches/100-uclibc.patch b/ipv6/miredo/patches/100-uclibc.patch new file mode 100644 index 0000000..8818402 --- /dev/null +++ b/ipv6/miredo/patches/100-uclibc.patch @@ -0,0 +1,21 @@ +--- a/libteredo/maintain.c ++++ b/libteredo/maintain.c +@@ -59,7 +59,7 @@ + + static inline void gettime (struct timespec *now) + { +-#if (_POSIX_CLOCK_SELECTION - 0 >= 0) && (_POSIX_MONOTONIC_CLOCK - 0 >= 0) ++#if (_POSIX_CLOCK_SELECTION - 0 >= 0) && (_POSIX_MONOTONIC_CLOCK - 0 >= 0) && !defined(__UCLIBC__) + if (clock_gettime (CLOCK_MONOTONIC, now) == 0) + return; + #else +--- a/libteredo/tunnel.h ++++ b/libteredo/tunnel.h +@@ -32,6 +32,7 @@ + # define LIBTEREDO_TUNNEL_H + + # include ++# include + + # ifdef __cplusplus + extern "C" { diff --git a/ipv6/miredo/patches/110-fix_compile_error.patch b/ipv6/miredo/patches/110-fix_compile_error.patch new file mode 100644 index 0000000..a49b3f2 --- /dev/null +++ b/ipv6/miredo/patches/110-fix_compile_error.patch @@ -0,0 +1,12 @@ +--- a/src/main.c ++++ b/src/main.c +@@ -300,7 +300,9 @@ + if (val) + { + error_errno ("cap_set_proc"); ++#ifdef MIREDO_DEFAULT_USERNAME + setuid_notice (); ++#endif + return -1; + } + #endif diff --git a/ipv6/miredo/patches/120-automake-compat.patch b/ipv6/miredo/patches/120-automake-compat.patch new file mode 100644 index 0000000..608bba5 --- /dev/null +++ b/ipv6/miredo/patches/120-automake-compat.patch @@ -0,0 +1,23 @@ +Index: miredo-1.2.4/src/Makefile.am +=================================================================== +--- miredo-1.2.4.orig/src/Makefile.am 2012-04-17 01:15:14.000000000 +0300 ++++ miredo-1.2.4/src/Makefile.am 2012-04-17 01:17:45.000000000 +0300 +@@ -32,7 +32,8 @@ + -DPKGLIBDIR=\"$(pkglibdir)\" + + sbin_PROGRAMS = miredo miredo-server miredo-checkconf +-pkglib_PROGRAMS = ++programfilesdir = $(pkglibdir) ++programfiles_PROGRAMS = + EXTRA_PROGRAMS = privproc + noinst_LTLIBRARIES = libmiredo.la + TESTS = +@@ -59,7 +60,7 @@ + miredo_privproc_SOURCES = privproc.c privproc.h + miredo_privproc_LDADD = ../libteredo/libteredo.la $(LIBCAP) + if TEREDO_CLIENT +-pkglib_PROGRAMS += miredo-privproc ++programfiles_PROGRAMS += miredo-privproc + TESTS += miredo-checkconf + endif + diff --git a/ipv6/mrd6/Makefile b/ipv6/mrd6/Makefile new file mode 100644 index 0000000..b62caa4 --- /dev/null +++ b/ipv6/mrd6/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2006-2011 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:=mrd6 +PKG_VERSION:=0.9.6 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/m/mrd6/ +PKG_MD5SUM:=a59d87857654ff92426062ad5664fcd6 + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/mrd6 + SECTION:=ipv6 + CATEGORY:=IPv6 + TITLE:=IPv6 multicast routing daemon + URL:=http://fivebits.net/proj/mrd6 + DEPENDS:=+kmod-ipv6 +libstdcpp +endef + +define Package/mrd6/description + Multicast is becoming a major component in next generation networks, used + in several scenarios, from video broadcasting to multimedia conferencing. + In order to be implemented, new technology needs supporting hardware and + software across a set of devices and systems. MRD6 is an implementation of + a modular IPv6 Multicast Routing Framework for the Linux operating system + and provides MLDv2 (as well as MLDv1), PIM-SM and MBGP support. +endef + +MRD6_MAKEFLAGS:= \ + $(TARGET_CONFIGURE_OPTS) \ + OPTIMIZE=yes \ + SPACE_OPTIMIZE=yes \ + FULL_STATIC=no \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -DNO_INET6_OPTION -fno-builtin -fno-rtti" \ + LDFLAGS="$(TARGET_LDFLAGS) -ldl -lm" \ + MODULE_CXX="\$$$$(CC) -shared \$$$$(CXXFLAGS) \$$$$(LDFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + PREFIX="/usr" + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/src $(MRD6_MAKEFLAGS) all +endef + +define Build/Install + $(MAKE) -C $(PKG_BUILD_DIR)/src $(MRD6_MAKEFLAGS) install +endef + +define Package/mrd6/conffiles +/etc/mrd6.conf +endef + +define Package/mrd6/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_CONF) ./files/mrd6.conf $(1)/etc + $(INSTALL_BIN) ./files/mrd6.init $(1)/etc/init.d/mrd6 + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mrd $(1)/usr/sbin/mrd6 + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mrd6sh $(1)/usr/bin/mrd6sh + $(INSTALL_DIR) $(1)/usr/lib/mrd6 + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/mrd6/bgp.so $(1)/usr/lib/mrd6/bgp.so +endef + +$(eval $(call BuildPackage,mrd6)) diff --git a/ipv6/mrd6/files/mrd6.conf b/ipv6/mrd6/files/mrd6.conf new file mode 100644 index 0000000..283ebd4 --- /dev/null +++ b/ipv6/mrd6/files/mrd6.conf @@ -0,0 +1,14 @@ +log { + attach stderr normal; + attach default "/var/log/mrd6.log" message_err; +} + +interfaces disable br-lan; // Should be vlan0 + eth1 but Linux bridge seems broken for multicast +interfaces disable eth0; // Interface to internal bridge +handle-proper-bridge = true; // use ETH_P_ALL to see all packets on wrt54g + +// The default configured RP is m6bone's Renater RP. +// Change this according to your setup + +groups ff00::/8 pim rp = 2001:660:3007:300:1::; + diff --git a/ipv6/mrd6/files/mrd6.init b/ipv6/mrd6/files/mrd6.init new file mode 100644 index 0000000..2481840 --- /dev/null +++ b/ipv6/mrd6/files/mrd6.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +start() { + service_start /usr/sbin/mrd6 -f /etc/mrd6.conf -D +} + +stop() { + service_stop /usr/sbin/mrd6 +} + diff --git a/ipv6/mrd6/patches/001-add_missing_include.patch b/ipv6/mrd6/patches/001-add_missing_include.patch new file mode 100644 index 0000000..5501909 --- /dev/null +++ b/ipv6/mrd6/patches/001-add_missing_include.patch @@ -0,0 +1,10 @@ +--- a/include/mrd/support/ptree.h ++++ b/include/mrd/support/ptree.h +@@ -35,6 +35,7 @@ + #ifndef _Ptree_h_ + #define _Ptree_h_ + ++#include + #include + #include + #include diff --git a/ipv6/mrd6/patches/002-missing_netlink_defs.patch b/ipv6/mrd6/patches/002-missing_netlink_defs.patch new file mode 100644 index 0000000..28ab711 --- /dev/null +++ b/ipv6/mrd6/patches/002-missing_netlink_defs.patch @@ -0,0 +1,58 @@ +Index: mrd6-0.9.5/include/mrdpriv/linux/netlink_missing_defs.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mrd6-0.9.5/include/mrdpriv/linux/netlink_missing_defs.h 2007-09-21 13:19:06.000000000 +0200 +@@ -0,0 +1,41 @@ ++#include ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) ++ ++#include ++#include ++#include ++ ++#ifndef IFA_RTA ++#define IFA_RTA(r) \ ++ ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg)))) ++#endif ++#ifndef IFA_PAYLOAD ++#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg)) ++#endif ++ ++#ifndef IFLA_RTA ++#define IFLA_RTA(r) \ ++ ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg)))) ++#endif ++#ifndef IFLA_PAYLOAD ++#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) ++#endif ++ ++#ifndef NDA_RTA ++#define NDA_RTA(r) \ ++ ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg)))) ++#endif ++#ifndef NDA_PAYLOAD ++#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg)) ++#endif ++ ++#ifndef NDTA_RTA ++#define NDTA_RTA(r) \ ++ ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndtmsg)))) ++#endif ++#ifndef NDTA_PAYLOAD ++#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg)) ++#endif ++ ++#endif +Index: mrd6-0.9.5/src/linux/linux_unicast_route.cpp +=================================================================== +--- mrd6-0.9.5.orig/src/linux/linux_unicast_route.cpp 2007-09-21 13:19:05.000000000 +0200 ++++ mrd6-0.9.5/src/linux/linux_unicast_route.cpp 2007-09-21 13:19:06.000000000 +0200 +@@ -23,6 +23,7 @@ + */ + + #include ++#include + + #include + #include diff --git a/ipv6/mrd6/patches/003-debian.patch b/ipv6/mrd6/patches/003-debian.patch new file mode 100644 index 0000000..6b99958 --- /dev/null +++ b/ipv6/mrd6/patches/003-debian.patch @@ -0,0 +1,71 @@ +--- mrd6-0.9.6.orig/src/log.cpp ++++ mrd6-0.9.6/src/log.cpp +@@ -667,3 +667,12 @@ + os.nprintf(32, "%p", val); + } + ++#ifdef __s390__ ++const char *stream_type_format_parameter(size_t) { ++ return "u"; ++} ++ ++void stream_push_formated_type(base_stream &os, size_t val) { ++ os.nprintf(32, "%z", val); ++} ++#endif +--- mrd6-0.9.6.orig/src/mrd.cpp ++++ mrd6-0.9.6/src/mrd.cpp +@@ -44,6 +44,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -2338,7 +2339,8 @@ + + out.xprintf("Uptime: %{duration}\n", time_duration((time(0) - m_startup) * 1000)); + out.xprintf("Performed tasks: %u (spent %llu ms)\n", m_tasks_stat, m_tasks_time_spent); +- out.xprintf("Registered sockets: %u reading, %u writing\n", m_read.size(), m_write.size()); ++ out.xprintf("Registered sockets: %u reading, %u writing\n", ++ (uint32_t)m_read.size(), (uint32_t)m_write.size()); + out.xprintf("MRIB prefix count: %u\n", mrib().registry_prefix_count()); + out.xprintf("Interface count: %u\n", m_intflist.size()); + out.xprintf("Group state count: %u\n", m_grplist.size()); +--- mrd6-0.9.6.orig/src/bgp/bgp.cpp ++++ mrd6-0.9.6/src/bgp/bgp.cpp +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + + #include + +--- mrd6-0.9.6.orig/src/linux/mrd_components.cpp ++++ mrd6-0.9.6/src/linux/mrd_components.cpp +@@ -92,8 +92,6 @@ + #if defined(__GLIBC__) + #if defined(__i386__) + return (void *)base->uc_mcontext.gregs[REG_EIP]; +-#elif defined(__mips__) +- return (void *)base->uc_mcontext.gpregs[CTX_EPC]; + #endif + #endif + return 0; +--- mrd6-0.9.6.orig/include/mrd/log.h ++++ mrd6-0.9.6/include/mrd/log.h +@@ -53,6 +53,12 @@ + void stream_push_formated_type(base_stream &, const char *val); + void stream_push_formated_type(base_stream &, const void *val); + ++ ++#ifdef __s390__ ++const char *stream_type_format_parameter(size_t); ++void stream_push_formated_type(base_stream &, size_t val); ++#endif ++ + /*! + * base log stream + */ diff --git a/ipv6/mrd6/patches/004-ambiguous_call_fix.patch b/ipv6/mrd6/patches/004-ambiguous_call_fix.patch new file mode 100644 index 0000000..a72eb24 --- /dev/null +++ b/ipv6/mrd6/patches/004-ambiguous_call_fix.patch @@ -0,0 +1,13 @@ +--- a/src/mrd.cpp ++++ b/src/mrd.cpp +@@ -2342,8 +2342,8 @@ bool mrd::show_info(base_stream &out, co + out.xprintf("Registered sockets: %u reading, %u writing\n", + (uint32_t)m_read.size(), (uint32_t)m_write.size()); + out.xprintf("MRIB prefix count: %u\n", mrib().registry_prefix_count()); +- out.xprintf("Interface count: %u\n", m_intflist.size()); +- out.xprintf("Group state count: %u\n", m_grplist.size()); ++ out.xprintf("Interface count: %u\n", (uint32_t)m_intflist.size()); ++ out.xprintf("Group state count: %u\n", (uint32_t)m_grplist.size()); + + return true; + } diff --git a/ipv6/ndisc/Makefile b/ipv6/ndisc/Makefile new file mode 100644 index 0000000..249e96a --- /dev/null +++ b/ipv6/ndisc/Makefile @@ -0,0 +1,98 @@ +# +# Copyright (C) 2006-2012 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:=ndisc6 +PKG_VERSION:=1.0.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.remlab.net/files/ndisc6 +PKG_MD5SUM:=50cb4c19606cf6ff2b7388e71832f579 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ndisc + SECTION:=ipv6 + CATEGORY:=IPv6 + SUBMENU:=IPv6 discovery tools + TITLE:=IPv6 discovery tools + URL:=http://www.remlab.net/ndisc6/ + DEPENDS:=+libpthread +librt +endef + +define Package/ndisc/description +IPv6 discovery tools +endef + +define Package/ndisc6 + $(call Package/ndisc) + TITLE:=An ICMPv6 neighbour discovery tool +endef + +define Package/ndisc6/description +An ICMPv6 neighbour discovery tools +endef + +define Package/rdisc6 + $(call Package/ndisc) + TITLE:=An ICMPv6 router discovery tool +endef + +define Package/rdisc6/description +An ICMPv6 router discovery tool +endef + +define Package/traceroute6 + $(call Package/ndisc) + TITLE:=An IPv6-based traceroute implementation +endef + +define Package/traceroute6/description +An IPv6-based traceroute implementation +endef + +define Package/rdnssd + $(call Package/ndisc) + TITLE:=DNS server discovery daemon +endef + +define Package/rdnssd/description +A recursive DNS server discovery daemon gathering +information through stateless IPv6 autoconfiguration (RFC5006) +endef + +TARGET_CFLAGS += -std=c99 + +define Package/ndisc6/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ndisc6 $(1)/usr/bin/ +endef + +define Package/rdisc6/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdisc6 $(1)/usr/bin/ +endef + +define Package/traceroute6/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{rl,tcp}traceroute6 $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tracert6 $(1)/usr/bin/ +endef + +define Package/rdnssd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rdnssd $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,ndisc6)) +$(eval $(call BuildPackage,rdisc6)) +$(eval $(call BuildPackage,traceroute6)) +$(eval $(call BuildPackage,rdnssd)) diff --git a/ipv6/ndisc/patches/100-favor_bsd.patch b/ipv6/ndisc/patches/100-favor_bsd.patch new file mode 100644 index 0000000..ed6090d --- /dev/null +++ b/ipv6/ndisc/patches/100-favor_bsd.patch @@ -0,0 +1,20 @@ +--- a/src/trace-tcp.c ++++ b/src/trace-tcp.c +@@ -24,6 +24,7 @@ + + #undef _GNU_SOURCE + #define _BSD_SOURCE 1 ++#define __FAVOR_BSD 1 + + #include + #include +--- a/src/trace-udp.c ++++ b/src/trace-udp.c +@@ -24,6 +24,7 @@ + + #undef _GNU_SOURCE + #define _BSD_SOURCE 1 ++#define __FAVOR_BSD 1 + + #include + #include diff --git a/ipv6/ndisc/patches/110-strverscmp.patch b/ipv6/ndisc/patches/110-strverscmp.patch new file mode 100644 index 0000000..345661f --- /dev/null +++ b/ipv6/ndisc/patches/110-strverscmp.patch @@ -0,0 +1,175 @@ +--- a/rdnssd/Makefile.am ++++ b/rdnssd/Makefile.am +@@ -30,7 +30,8 @@ conf_SCRIPTS = merge-hook + # rdnssd + rdnssd_SOURCES = rdnssd.c rdnssd.h \ + icmp.c \ +- netlink.c ++ netlink.c \ ++ strverscmp.c + rdnssd_LDADD = $(LIBRT) \ + @top_builddir@/compat/libcompat.a + +--- a/rdnssd/Makefile.in ++++ b/rdnssd/Makefile.in +@@ -60,7 +60,7 @@ CONFIG_CLEAN_FILES = + CONFIG_CLEAN_VPATH_FILES = + am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(confdir)" + PROGRAMS = $(sbin_PROGRAMS) +-am_rdnssd_OBJECTS = rdnssd.$(OBJEXT) icmp.$(OBJEXT) netlink.$(OBJEXT) ++am_rdnssd_OBJECTS = rdnssd.$(OBJEXT) icmp.$(OBJEXT) netlink.$(OBJEXT) strverscmp.$(OBJEXT) + rdnssd_OBJECTS = $(am_rdnssd_OBJECTS) + am__DEPENDENCIES_1 = + rdnssd_DEPENDENCIES = $(am__DEPENDENCIES_1) \ +@@ -251,7 +251,8 @@ conf_SCRIPTS = merge-hook + # rdnssd + rdnssd_SOURCES = rdnssd.c rdnssd.h \ + icmp.c \ +- netlink.c ++ netlink.c \ ++ strverscmp.c + + rdnssd_LDADD = $(LIBRT) \ + @top_builddir@/compat/libcompat.a +@@ -373,6 +374,7 @@ distclean-compile: + + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icmp.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strverscmp.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdnssd.Po@am__quote@ + + .c.o: +--- /dev/null ++++ b/rdnssd/strverscmp.c +@@ -0,0 +1,131 @@ ++/* Compare strings while treating digits characters numerically. ++ Copyright (C) 1997, 2000, 2002, 2004 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Jean-François Bignolles , 1997. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License along ++ with this program; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++#include ++ ++/* states: S_N: normal, S_I: comparing integral part, S_F: comparing ++ fractional parts, S_Z: idem but with leading Zeroes only */ ++#define S_N 0x0 ++#define S_I 0x4 ++#define S_F 0x8 ++#define S_Z 0xC ++ ++/* result_type: CMP: return diff; LEN: compare using len_diff/diff */ ++#define CMP 2 ++#define LEN 3 ++ ++ ++/* ISDIGIT differs from isdigit, as follows: ++ - Its arg may be any int or unsigned int; it need not be an unsigned char. ++ - It's guaranteed to evaluate its argument exactly once. ++ - It's typically faster. ++ POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to ++ ISDIGIT_LOCALE unless it's important to use the locale's definition ++ of `digit' even when the host does not conform to POSIX. */ ++#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9) ++ ++#undef __strverscmp ++#undef strverscmp ++ ++#ifndef weak_alias ++# define __strverscmp strverscmp ++#endif ++ ++/* Compare S1 and S2 as strings holding indices/version numbers, ++ returning less than, equal to or greater than zero if S1 is less than, ++ equal to or greater than S2 (for more info, see the texinfo doc). ++*/ ++ ++int ++__strverscmp (const char *s1, const char *s2) ++{ ++ const unsigned char *p1 = (const unsigned char *) s1; ++ const unsigned char *p2 = (const unsigned char *) s2; ++ unsigned char c1, c2; ++ int state; ++ int diff; ++ ++ /* Symbol(s) 0 [1-9] others (padding) ++ Transition (10) 0 (01) d (00) x (11) - */ ++ static const unsigned int next_state[] = ++ { ++ /* state x d 0 - */ ++ /* S_N */ S_N, S_I, S_Z, S_N, ++ /* S_I */ S_N, S_I, S_I, S_I, ++ /* S_F */ S_N, S_F, S_F, S_F, ++ /* S_Z */ S_N, S_F, S_Z, S_Z ++ }; ++ ++ static const int result_type[] = ++ { ++ /* state x/x x/d x/0 x/- d/x d/d d/0 d/- ++ 0/x 0/d 0/0 0/- -/x -/d -/0 -/- */ ++ ++ /* S_N */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, ++ CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, ++ /* S_I */ CMP, -1, -1, CMP, 1, LEN, LEN, CMP, ++ 1, LEN, LEN, CMP, CMP, CMP, CMP, CMP, ++ /* S_F */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, ++ CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, ++ /* S_Z */ CMP, 1, 1, CMP, -1, CMP, CMP, CMP, ++ -1, CMP, CMP, CMP ++ }; ++ ++ if (p1 == p2) ++ return 0; ++ ++ c1 = *p1++; ++ c2 = *p2++; ++ /* Hint: '0' is a digit too. */ ++ state = S_N | ((c1 == '0') + (ISDIGIT (c1) != 0)); ++ ++ while ((diff = c1 - c2) == 0 && c1 != '\0') ++ { ++ state = next_state[state]; ++ c1 = *p1++; ++ c2 = *p2++; ++ state |= (c1 == '0') + (ISDIGIT (c1) != 0); ++ } ++ ++ state = result_type[state << 2 | ((c2 == '0') + (ISDIGIT (c2) != 0))]; ++ ++ switch (state) ++ { ++ case CMP: ++ return diff; ++ ++ case LEN: ++ while (ISDIGIT (*p1++)) ++ if (!ISDIGIT (*p2++)) ++ return 1; ++ ++ return ISDIGIT (*p2) ? -1 : diff; ++ ++ default: ++ return state; ++ } ++} ++#ifdef weak_alias ++weak_alias (__strverscmp, strverscmp) ++#endif diff --git a/ipv6/ndppd/Makefile b/ipv6/ndppd/Makefile new file mode 100644 index 0000000..8ffcacb --- /dev/null +++ b/ipv6/ndppd/Makefile @@ -0,0 +1,69 @@ +# +# Copyright (C) 2007-2011 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:=ndppd +PKG_VERSION:=0.2.2 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz + +# Latest release +PKG_SOURCE_URL:=http://www.priv.nu/projects/ndppd/files/ +PKG_MD5SUM:=d90c4b65777a62274c1837dba341e5a8 + +# Development snapshot +#PKG_SOURCE_URL=git://github.com/Tuhox/ndppd.git +#PKG_SOURCE_VERSION=master +#PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/ndppd + SECTION:=ipv6 + CATEGORY:=IPv6 + TITLE:=NDP Proxy Daemon + URL:=http://www.priv.nu/projects/ndppd/ + MAINTAINER:=Gabriel Kerneis + DEPENDS:=+kmod-ipv6 $(CXX_DEPENDS) +endef + +define Package/ndppd/description + ndppd, or NDP Proxy Daemon, is a daemon that proxies NDP (Neighbor Discovery + Protocol) messages between interfaces. ndppd currently only supports Neighbor + Solicitation Messages and Neighbor Advertisement Messages. + + The ndp_proxy provided by Linux doesn't support listing proxies, and only hosts + are supported. No subnets. ndppd solves this by listening for Neighbor + Solicitation messages on an interface, then query the internal interfaces for + that target IP before finally sending a Neighbor Advertisement message. +endef + +define Package/ndppd/conffiles +/etc/ndppd.conf +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CXX="$(TARGET_CXX)" \ + CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++0x -fno-rtti" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + LIBS="-lc" \ + ndppd +endef + +define Package/ndppd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ndppd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/ndppd.init $(1)/etc/init.d/ndppd + $(INSTALL_CONF) $(PKG_BUILD_DIR)/ndppd.conf-dist $(1)/etc/ndppd.conf +endef + +$(eval $(call BuildPackage,ndppd)) diff --git a/ipv6/ndppd/files/ndppd.init b/ipv6/ndppd/files/ndppd.init new file mode 100644 index 0000000..4cf0e8a --- /dev/null +++ b/ipv6/ndppd/files/ndppd.init @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=90 + +SERVICE_USE_PID=1 +SERVICE_PID_FILE=/var/run/ndppd.pid + +start() { + mkdir -p /var/run + service_start /usr/sbin/ndppd -p $SERVICE_PID_FILE -d +} + +stop() { + service_stop /usr/sbin/ndppd +} diff --git a/ipv6/ptrtd/Makefile b/ipv6/ptrtd/Makefile new file mode 100644 index 0000000..4e1aa65 --- /dev/null +++ b/ipv6/ptrtd/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2006-2011 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:=ptrtd +PKG_VERSION:=0.5.2 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://v6web.litech.org/ptrtd/dist/ +PKG_MD5SUM:=bfe026445fdc4fe509a9c70ec4551744 + +include $(INCLUDE_DIR)/package.mk + +define Package/ptrtd + SECTION:=ipv6 + CATEGORY:=IPv6 + DEPENDS:=+kmod-ipv6 +kmod-tun +ip + TITLE:=Portable Transport Relay Translator Daemon + URL:=http://v6web.litech.org/ptrtd/ +endef + +define Package/ptrtd/description + The Portable Transport Relay Translator Daemon (pTRTd) + is a method of allowing IPv6 hosts to communicate with IPv4 hosts. +endef + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS)" + +define Package/ptrtd/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/ptrtd.init $(1)/etc/init.d/ptrtd +endef + +$(eval $(call BuildPackage,ptrtd)) diff --git a/ipv6/ptrtd/files/ptrtd.init b/ipv6/ptrtd/files/ptrtd.init new file mode 100644 index 0000000..6d7cf68 --- /dev/null +++ b/ipv6/ptrtd/files/ptrtd.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=60 + +PREFIX="3ffe:abcd:1234:9876::" +LEN=64 + +start() { + service_start /usr/sbin/ptrtd -p $PREFIX -l $LEN +} + +stop() { + service_stop /usr/sbin/ptrtd +} diff --git a/ipv6/ptrtd/patches/100-ptrtd-0.5.2-openwrt.patch b/ipv6/ptrtd/patches/100-ptrtd-0.5.2-openwrt.patch new file mode 100644 index 0000000..3a9d003 --- /dev/null +++ b/ipv6/ptrtd/patches/100-ptrtd-0.5.2-openwrt.patch @@ -0,0 +1,41 @@ +--- ptrtd-0.5.2/ptrtd.old 2007-02-22 16:10:57.896689015 +0100 ++++ ptrtd-0.5.2/ptrtd.c 2007-02-22 16:11:39.194388792 +0100 +@@ -201,13 +201,13 @@ + if( do_config ) + { + printf( "Tunnel: %s\n", ifname ); +- sprintf( cmd, "/sbin/ip link set %s up", ifname ); ++ sprintf( cmd, "/usr/sbin/ip link set %s up", ifname ); + printf( "command: %s\n", cmd ); + system( cmd ); +- sprintf( cmd, "/sbin/ip addr add fe80::1/64 dev %s", ifname ); ++ sprintf( cmd, "/usr/sbin/ip addr add fe80::1/64 dev %s", ifname ); + printf( "command: %s\n", cmd ); + system( cmd ); +- sprintf( cmd, "/sbin/ip route add %s/%d dev %s via fe80::5", ++ sprintf( cmd, "/usr/sbin/ip route add %s/%d dev %s via fe80::5", + prefix, plen, ifname ); + printf( "command: %s\n", cmd ); + system( cmd ); +--- ptrtd-0.5.2/tap802ipd.old 2007-02-22 16:11:22.600920230 +0100 ++++ ptrtd-0.5.2/tap802ipd.c 2007-02-22 16:11:51.040581581 +0100 +@@ -125,16 +125,16 @@ + + tap_get_name( (struct iface *)tap_iface, ifname ); + printf( "Tunnel: %s\n", ifname ); +- sprintf( cmd, "/sbin/ip link set %s address %02x:%02x:%02x:%02x:%02x:%02x up\n", ifname, ++ sprintf( cmd, "/usr/sbin/ip link set %s address %02x:%02x:%02x:%02x:%02x:%02x up\n", ifname, + ip_iface->hwaddr[0], ip_iface->hwaddr[1], + ip_iface->hwaddr[2], ip_iface->hwaddr[3], + ip_iface->hwaddr[4], ip_iface->hwaddr[5] ); + printf( "command: %s\n", cmd ); + system( cmd ); +- //sprintf( cmd, "/sbin/ip addr add fe80::1/64 dev %s", ifname ); ++ //sprintf( cmd, "/usr/sbin/ip addr add fe80::1/64 dev %s", ifname ); + //printf( "command: %s\n", cmd ); + //system( cmd ); +- //sprintf( cmd, "/sbin/ip route add %s/%d dev %s via fe80::5", prefix, plen, ifname ); ++ //sprintf( cmd, "/usr/sbin/ip route add %s/%d dev %s via fe80::5", prefix, plen, ifname ); + //printf( "command: %s\n", cmd ); + //system( cmd ); + } diff --git a/ipv6/radvd/Makefile b/ipv6/radvd/Makefile new file mode 100644 index 0000000..571d9de --- /dev/null +++ b/ipv6/radvd/Makefile @@ -0,0 +1,79 @@ +# +# Copyright (C) 2006-2012 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:=radvd +PKG_VERSION:=1.9.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://v6web.litech.org/radvd/dist \ + http://download.sourcemage.org/mirror +PKG_MD5SUM:=e807ad7e9a76d46b6133df391385cd31 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/radvd/Default + SECTION:=ipv6 + CATEGORY:=IPv6 + TITLE:=IPv6 Routing Advertisement + URL:=http://v6web.litech.org/radvd/ + DEPENDS:=+kmod-ipv6 +libdaemon +endef + +define Package/radvd + $(call Package/radvd/Default) + TITLE+= Daemon +endef + +define Package/radvd/description +radvd is the router advertisement daemon for IPv6. It listens to router +solicitations and sends router advertisements as described in "Neighbor +Discovery for IP Version 6 (IPv6)" (RFC 4861). With these advertisements hosts +can automatically configure their addresses and some other parameters. They also +can choose a default router based on these advertisements. +endef + +define Package/radvdump + $(call Package/radvd/Default) + TITLE+= Dumper +endef + +define Package/radvdump/description +radvdump prints out the contents of incoming router advertisements sent by radvd +or some other software implementing (parts of) "Neighbor Discovery for IP +Version 6 (IPv6)" (RFC 4861). +endef + +CONFIGURE_ARGS += \ + --with-configfile=/etc/radvd.conf \ + --with-logfile=/var/log/radvd.log \ + --with-pidfile=/var/run/radvd.pid + +define Package/radvd/conffiles +/etc/config/radvd +endef + +define Package/radvd/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/radvd.config $(1)/etc/config/radvd + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/radvd.init $(1)/etc/init.d/radvd + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radvd $(1)/usr/sbin/ +endef + +define Package/radvdump/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radvdump $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,radvd)) +$(eval $(call BuildPackage,radvdump)) diff --git a/ipv6/radvd/files/radvd.config b/ipv6/radvd/files/radvd.config new file mode 100644 index 0000000..1616c15 --- /dev/null +++ b/ipv6/radvd/files/radvd.config @@ -0,0 +1,32 @@ +config interface + option interface 'lan' + option AdvSendAdvert 1 + option AdvManagedFlag 0 + option AdvOtherConfigFlag 0 + list client '' + option ignore 1 + +config prefix + option interface 'lan' + # If not specified, a non-link-local prefix of the interface is used + list prefix '' + option AdvOnLink 1 + option AdvAutonomous 1 + option AdvRouterAddr 0 + option ignore 1 + +config route + option interface 'lan' + list prefix '' + option ignore 1 + +config rdnss + option interface 'lan' + # If not specified, the link-local address of the interface is used + list addr '' + option ignore 1 + +config dnssl + option interface 'lan' + list suffix '' + option ignore 1 diff --git a/ipv6/radvd/files/radvd.init b/ipv6/radvd/files/radvd.init new file mode 100644 index 0000000..8311c35 --- /dev/null +++ b/ipv6/radvd/files/radvd.init @@ -0,0 +1,416 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2011 OpenWrt.org +# Copyright (C) 2008 Alina Friedrichsen + +START=50 + +SERVICE_USE_PID=1 + +RADVD_INTERFACE_STRING_OPTIONS='MaxRtrAdvInterval MinRtrAdvInterval MinDelayBetweenRAs AdvLinkMTU AdvReachableTime AdvRetransTimer AdvCurHopLimit AdvDefaultLifetime AdvDefaultPreference HomeAgentLifetime HomeAgentPreference' +RADVD_INTERFACE_BOOLEAN_OPTIONS='IgnoreIfMissing AdvSendAdvert UnicastOnly AdvManagedFlag AdvOtherConfigFlag AdvSourceLLAddress AdvHomeAgentFlag AdvHomeAgentInfo AdvMobRtrSupportFlag AdvIntervalOpt' + +RADVD_PREFIX_STRING_OPTIONS='AdvValidLifetime AdvPreferredLifetime' +RADVD_PREFIX_BOOLEAN_OPTIONS='AdvOnLink AdvAutonomous AdvRouterAddr DeprecatePrefix DecrementLifetimes' + +RADVD_ROUTE_STRING_OPTIONS='AdvRouteLifetime AdvRoutePreference' +RADVD_ROUTE_BOOLEAN_OPTIONS='RemoveRoute' + +RADVD_RDNSS_STRING_OPTIONS='AdvRDNSSLifetime FlushRDNSS' + +RADVD_DNSSL_STRING_OPTIONS='AdvDNSSLLifetime FlushDNSSL' + +validate_varname() { + local varname=$1 + [ -z "$varname" -o "$varname" != "${varname%%[!A-Za-z0-9_]*}" ] && return 1 + return 0 +} + +validate_ip6addr() { + local ip6addr=$1 + [ -z "$ip6addr" -o "$ip6addr" != "${ip6addr%%[!A-Fa-f0-9.:]*}" ] && return 1 + return 0 +} + +validate_ip6prefix() { + local ip6prefix=$1 + [ -z "$ip6prefix" -o "$ip6prefix" != "${ip6prefix%%[!A-Fa-f0-9./:]*}" ] && return 1 + return 0 +} + +validate_radvd_string() { + local radvd_string=$1 + [ -z "$radvd_string" -o "$radvd_string" != "${radvd_string%%[!A-Za-z0-9.:_-]*}" ] && return 1 + return 0 +} + +get_ip6addr() { + local ifname=$1 + local scope=$2 + local iproute2_scope + local ifconfig_scope + local ip6addr + + case "$scope" in + host) iproute2_scope=host ifconfig_scope=Host;; + link) iproute2_scope=link ifconfig_scope=Link;; + site) iproute2_scope=site ifconfig_scope=Site;; + global) iproute2_scope=global ifconfig_scope=Global;; + "") get_ip6addr "$ifname" global || get_ip6addr "$ifname" site; return;; + *) return 1;; + esac + + ip6addr=$(LANG=C ip -f inet6 -- addr show dev "$ifname" 2> /dev/null | sed -n -e 's/^ *inet6 \([A-Fa-f0-9.:]*[/][0-9]*\) scope '"$iproute2_scope"' $/\1/p' | head -n 1) + if [ -z "$ip6addr" ]; then + ip6addr=$(LANG=C ifconfig "$ifname" 2> /dev/null | sed -n -e 's/^ *inet6 addr: \([A-Fa-f0-9.:]*[/][0-9]*\) Scope:'"$ifconfig_scope"'$/\1/p' | tail -n 1) + [ -z "$ip6addr" ] && return 1 + fi + + printf '%s\n' "$ip6addr" + + return 0 +} + +radvd_find_config_file() { + local cfg=$1 + validate_varname "$cfg" || return 0 + + config_get_bool ignore "$cfg" ignore 0 + [ "$ignore" -ne 0 ] && return 0 + config_get RADVD_CONFIG_FILE "$cfg" config_file + + return 0 +} + +radvd_add_interface() { + local cfg=$1 + validate_varname "$cfg" || return 0 + local ignore + local interfaces + local interface + local list_interface + local exist + + config_get_bool ignore "$cfg" ignore 0 + [ "$ignore" -ne 0 ] && return 0 + + config_get interfaces "$cfg" interface + for interface in $interfaces; do + validate_varname "$interface" || continue + exist=0 + for list_interface in $RADVD_INTERFACES; do + [ "$interface" = "$list_interface" ] && exist=1 + done + [ "$exist" -eq 0 ] && RADVD_INTERFACES="$RADVD_INTERFACES $interface" + done + + return 0 +} + +radvd_write_interface() { + local cfg=$1 + validate_varname "$cfg" || return 0 + local ignore + local interfaces + local interface + local name + local value + + config_get_bool ignore "$cfg" ignore 0 + [ "$ignore" -ne 0 ] && return 0 + + config_get interfaces "$cfg" interface + exist=0 + for interface in $interfaces; do + [ "$INTERFACE" = "$interface" ] && exist=1 + done + [ "$exist" -eq 0 ] && return 0 + + for name in $RADVD_INTERFACE_STRING_OPTIONS; do + config_get value "$cfg" "$name" + validate_radvd_string "$value" || continue + printf '\t%s %s;\n' "$name" "$value" + done + + for name in $RADVD_INTERFACE_BOOLEAN_OPTIONS; do + config_get value "$cfg" "$name" + [ -z "$value" ] && continue + config_get_bool value "$cfg" "$name" 0 + if [ "$value" -ne 0 ]; then + printf '\t%s on;\n' "$name" + else + printf '\t%s off;\n' "$name" + fi + done + + config_get clients "$cfg" client + if [ -n "$clients" ]; then + printf '\n\tclients\n\t{\n' + + for client in $clients; do + validate_ip6addr "$client" || continue + printf '\t\t%s;\n' "$client" + done + + printf '\t};\n' + fi + + return 0 +} + +radvd_write_prefix() { + local cfg=$1 + validate_varname "$cfg" || return 0 + local ignore + local interfaces + local interface + local device + local prefixes + local prefix + local name + local value + local cfgt + + config_get_bool ignore "$cfg" ignore 0 + [ "$ignore" -ne 0 ] && return 0 + + config_get interfaces "$cfg" interface + exist=0 + for interface in $interfaces; do + [ "$INTERFACE" = "$interface" ] && exist=1 + done + [ "$exist" -eq 0 ] && return 0 + + config_get prefixes "$cfg" prefix + if [ -z "$prefixes" ]; then + prefixes=$(get_ip6addr "$IFNAME") || return 0 + fi + + for prefix in $prefixes; do + validate_ip6prefix "$prefix" || continue + printf '\n\tprefix %s\n\t{\n' "$prefix" + + for name in $RADVD_PREFIX_STRING_OPTIONS; do + config_get value "$cfg" "$name" + validate_radvd_string "$value" || continue + printf '\t\t%s %s;\n' "$name" "$value" + done + + for name in $RADVD_PREFIX_BOOLEAN_OPTIONS; do + config_get value "$cfg" "$name" + [ -z "$value" ] && continue + config_get_bool value "$cfg" "$name" 0 + if [ "$value" -ne 0 ]; then + printf '\t\t%s on;\n' "$name" + else + printf '\t\t%s off;\n' "$name" + fi + done + + config_get value "$cfg" Base6Interface + if [ -n "$value" ]; then + if network_get_device device "$value"; then + printf '\t\t%s %s;\n' "Base6Interface" "$device" + fi + fi + + config_get value "$cfg" Base6to4Interface + if [ -n "$value" ]; then + if network_get_device device "$value"; then + printf '\t\t%s %s;\n' "Base6to4Interface" "$device" + fi + fi + + printf '\t};\n' + done + + return 0 +} + +radvd_write_route() { + local cfg=$1 + validate_varname "$cfg" || return 0 + local ignore + local interfaces + local interface + local prefixes + local prefix + local name + local value + + config_get_bool ignore "$cfg" ignore 0 + [ "$ignore" -ne 0 ] && return 0 + + config_get interfaces "$cfg" interface + exist=0 + for interface in $interfaces; do + [ "$INTERFACE" = "$interface" ] && exist=1 + done + [ "$exist" -eq 0 ] && return 0 + + config_get prefixes "$cfg" prefix + for prefix in $prefixes; do + validate_ip6prefix "$prefix" || continue + printf '\n\troute %s\n\t{\n' "$prefix" + + for name in $RADVD_ROUTE_STRING_OPTIONS; do + config_get value "$cfg" "$name" + validate_radvd_string "$value" || continue + printf '\t\t%s %s;\n' "$name" "$value" + done + + for name in $RADVD_ROUTE_BOOLEAN_OPTIONS; do + config_get value "$cfg" "$name" + [ -z "$value" ] && continue + config_get_bool value "$cfg" "$name" 0 + if [ "$value" -ne 0 ]; then + printf '\t\t%s on;\n' "$name" + else + printf '\t\t%s off;\n' "$name" + fi + done + + printf '\t};\n' + done + + return 0 +} + +radvd_write_rdnss() { + local cfg=$1 + validate_varname "$cfg" || return 0 + local ignore + local interfaces + local interface + local addrs + local addr + local addr_list + local name + local value + local i + + config_get_bool ignore "$cfg" ignore 0 + [ "$ignore" -ne 0 ] && return 0 + + config_get interfaces "$cfg" interface + exist=0 + for interface in $interfaces; do + [ "$INTERFACE" = "$interface" ] && exist=1 + done + [ "$exist" -eq 0 ] && return 0 + + config_get addrs "$cfg" addr + i=0 + for addr in $addrs; do + [ "$i" -ge 3 ] && break + validate_ip6addr "$addr" || continue + addr_list="$addr_list $addr" + i=$(($i+1)) + done + + if [ -z "$addr_list" ]; then + addr=$(get_ip6addr "$IFNAME" link) || return 0 + addr_list=" ${addr%%[/]*}" + fi + + printf '\n\tRDNSS%s\n\t{\n' "$addr_list" + + for name in $RADVD_RDNSS_STRING_OPTIONS; do + config_get value "$cfg" "$name" + validate_radvd_string "$value" || continue + printf '\t\t%s %s;\n' "$name" "$value" + done + + printf '\t};\n' + + return 0 +} + +radvd_write_dnssl() { + local cfg=$1 + validate_varname "$cfg" || return 0 + local ignore + local interfaces + local interface + local suffixes + local suffix + local suffix_list + local name + local value + + config_get_bool ignore "$cfg" ignore 0 + [ "$ignore" -ne 0 ] && return 0 + + config_get interfaces "$cfg" interface + exist=0 + for interface in $interfaces; do + [ "$INTERFACE" = "$interface" ] && exist=1 + done + [ "$exist" -eq 0 ] && return 0 + + config_get suffixes "$cfg" suffix + for suffix in $suffixes; do + validate_radvd_string "$suffix" || continue + suffix_list="$suffix_list $suffix" + done + + printf '\n\tDNSSL%s\n\t{\n' "$suffix_list" + + for name in $RADVD_DNSSL_STRING_OPTIONS; do + config_get value "$cfg" "$name" + validate_radvd_string "$value" || continue + printf '\t\t%s %s;\n' "$name" "$value" + done + + printf '\t};\n' + + return 0 +} + +radvd_write_config() { + . /lib/functions/network.sh + + RADVD_INTERFACES= + config_foreach radvd_add_interface interface + config_foreach radvd_add_interface prefix + config_foreach radvd_add_interface route + config_foreach radvd_add_interface RDNSS + config_foreach radvd_add_interface DNSSL + + for INTERFACE in $RADVD_INTERFACES; do + network_get_device IFNAME "$INTERFACE" || continue + printf 'interface %s\n{\n' "$IFNAME" + config_foreach radvd_write_interface interface + config_foreach radvd_write_prefix prefix + config_foreach radvd_write_route route + config_foreach radvd_write_rdnss rdnss + config_foreach radvd_write_dnssl dnssl + printf '};\n\n' + done + + return 0 +} + +start() { + config_load radvd + + RADVD_CONFIG_FILE= + config_foreach radvd_find_config_file radvd + + if [ -z "$RADVD_CONFIG_FILE" ]; then + mkdir -p -- /var/etc/ + radvd_write_config > /var/etc/radvd.conf + if [ -s "/var/etc/radvd.conf" ]; then + RADVD_CONFIG_FILE=/var/etc/radvd.conf + fi + fi + + [ -z "$RADVD_CONFIG_FILE" ] && return 1 + + sysctl -w net.ipv6.conf.all.forwarding=1 > /dev/null 2> /dev/null + + service_start /usr/sbin/radvd -C "$RADVD_CONFIG_FILE" -m stderr_syslog -p /var/run/radvd.pid +} + +stop() { + service_stop /usr/sbin/radvd +} diff --git a/ipv6/radvd/patches/100-silent-netlink-config-reload.patch b/ipv6/radvd/patches/100-silent-netlink-config-reload.patch new file mode 100644 index 0000000..049d654 --- /dev/null +++ b/ipv6/radvd/patches/100-silent-netlink-config-reload.patch @@ -0,0 +1,67 @@ +--- a/netlink.c ++++ b/netlink.c +@@ -67,7 +67,7 @@ void process_netlink_msg(int sock) + else { + dlog(LOG_DEBUG, 3, "%s, ifindex %d, flags is *NOT* running", ifname, ifinfo->ifi_index); + } +- reload_config(); ++ reload_config(LOG_DEBUG); + } + } + +--- a/radvd.c ++++ b/radvd.c +@@ -443,7 +443,7 @@ void main_loop(void) + if (sighup_received) + { + dlog(LOG_INFO, 3, "sig hup received.\n"); +- reload_config(); ++ reload_config(LOG_INFO); + sighup_received = 0; + } + +@@ -552,11 +552,11 @@ stop_adverts(void) + } + } + +-void reload_config(void) ++void reload_config(int loglevel) + { + struct Interface *iface; + +- flog(LOG_INFO, "attempting to reread config file"); ++ flog(loglevel, "attempting to reread config file"); + + iface=IfaceList; + while(iface) +@@ -626,7 +626,7 @@ void reload_config(void) + config_interface(); + kickoff_adverts(); + +- flog(LOG_INFO, "resuming normal operation"); ++ flog(loglevel, "resuming normal operation"); + } + + void +--- a/radvd.h ++++ b/radvd.h +@@ -185,7 +185,7 @@ int yylex(void); + + /* radvd.c */ + int check_ip6_forwarding(void); +-void reload_config(void); ++void reload_config(int); + void reset_prefix_lifetimes(void); + + /* timer.c */ +--- a/send.c ++++ b/send.c +@@ -154,7 +154,7 @@ send_ra(struct Interface *iface, struct + * reload_config() will kick off new timers anyway. This avoids + * timer list corruption. + */ +- reload_config(); ++ reload_config(LOG_INFO); + return -1; + } + } diff --git a/ipv6/send/Makefile b/ipv6/send/Makefile new file mode 100644 index 0000000..b08a109 --- /dev/null +++ b/ipv6/send/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2008-2009 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:=send +PKG_VERSION:=0.2-5.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)d_$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://mobisend.org/debian-mobisend/pool/main/s/sendd/ +PKG_MD5SUM:=99c18e5d965e57d580f146d00145251a +PKG_BUILD_DIR:=$(BUILD_DIR)/sendd-0.2 + +PKG_BUILD_PARALLEL:=0 + +include $(INCLUDE_DIR)/package.mk + +define Package/send + SECTION:=ipv6 + CATEGORY:=IPv6 + TITLE:=Secure Neighbor Discovery implementation + URL:=http://mobisend.org/debian-mobisend.html + DEPENDS:=+kmod-ipv6 +ip6tables +libnetfilter-queue +libopenssl +libreadline +libncurses +endef + +define Package/send/description + DoCoMo's Open Source SEND project provides an implementation of RFC 3971 + Secure Neighbor Discovery (SEND). SEND cryptographically secures the + IPv6 neighbor discovery protocol, countering the threats discussed in + RFC 3756 (IPv6 Neighbor Discovery (ND) Trust Models and Threats). +endef + +define Package/send/conffiles +/etc/sendd/sendd.conf +/etc/sendd/params.conf +endef + +TARGET_CPPFLAGS+=-D_GNU_SOURCE + +MAKE_FLAGS += \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/libnetfilter_queue $(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS) -lnfnetlink" \ + +define Package/send/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/sendd/sendd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/sendd/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/examples/sendd.conf $(1)/etc/sendd/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/examples/params.conf $(1)/etc/sendd/ +endef + +$(eval $(call BuildPackage,send)) diff --git a/ipv6/send/patches/001-libnetfilter_queue_update.patch b/ipv6/send/patches/001-libnetfilter_queue_update.patch new file mode 100644 index 0000000..f300d7c --- /dev/null +++ b/ipv6/send/patches/001-libnetfilter_queue_update.patch @@ -0,0 +1,388 @@ +# Update sendd to: +# +# - use $DESTDIR for prefix (Debian interest) +# - use libnetfilter_queue instead of deprecated libipq +# +# Under GPLv2 - Copyright (C) 2008 - EADS - Arnaud Ebalard +--- a/Makefile.config ++++ b/Makefile.config +@@ -19,7 +19,7 @@ OS=linux + #CC=gcc-4.0 + + # Where to install +-prefix=/usr ++prefix=$(DESTDIR)/usr + + # Set to "y" to build MT versions of sendd and cgatool + USE_THREADS=n +--- a/README ++++ b/README +@@ -20,7 +20,7 @@ Linux: + o CONFIG_NETFILTER, CONFIG_IPV6, CONFIG_IP6_NF_QUEUE, CONFIG_IP6_NF_IPTABLES, + CONFIG_IP6_NF_FILTER enabled in your kernel config. + o netfilter ip6tables command +- o netfilter libipq development library and headers ++ o netfilter libnetfilter_queue development library and headers + + FreeBSD: + o NETGRAPH, NETGRAPH_BPF, NETGRAPH_ETHER, NETGRAPH_SOCKET enabled in +--- a/cgatool/Makefile ++++ b/cgatool/Makefile +@@ -25,7 +25,7 @@ endif + + ifeq ($(USE_CONSOLE),y) + ifeq ($(USE_READLINE),y) +-LDLIBS += -lreadline -lncurses ++LDLIBS += -lreadline + endif + endif + +--- a/sendd/Makefile ++++ b/sendd/Makefile +@@ -37,7 +37,7 @@ endif + + ifeq ($(USE_CONSOLE),y) + ifeq ($(USE_READLINE),y) +-LDLIBS += -lreadline -lncurses ++LDLIBS += -lreadline + endif + endif + +--- a/sendd/os-linux/Makefile ++++ b/sendd/os-linux/Makefile +@@ -1,23 +1,5 @@ + + OBJS += os/addr.o os/ipq.o os/rand.o os/snd_linux.o +-OSLIBS= -ldl -lipq ++OSLIBS= -lnetfilter_queue + +-OSEXTRA= os/sendd os/snd_upd_fw +- +-ETCINIT= /etc/init.d +-EXTRAINSTALL= $(ETCINIT)/sendd $(ETCINIT)/snd_upd_fw $(ETCINIT)/snd_fw_functions.sh +-EXTRAUNINSTALL=$(EXTRAINSTALL) +-EXTRACLEAN= os/sendd os/snd_upd_fw os/snd_fw_functions.sh +- +-$(ETCINIT)/%: os/% +- install $< $@ +- +-os/%: os/%.in +- sed "s/@etcinit@/\/etc\/init.d/g" $< > $@ +- +-os/%: os/%.in2 +- @./os/find_ip6tables.sh +- +-# Sometimes libipq.h is installed in include/libipq.h, other times it is +-# installed in include/libipq/libipq.h. This rule helps cpp to find it. +-os/ipq.o: CPPFLAGS += -I/usr/include/libipq -I/usr/local/include/libipq ++os/ipq.o: CPPFLAGS += -I/usr/include/libnetfilter_queue +--- a/sendd/os-linux/ipq.c ++++ b/sendd/os-linux/ipq.c +@@ -32,8 +32,9 @@ + + #include + #include ++#include + #include +-#include ++#include + + #include "config.h" + #include +@@ -42,122 +43,170 @@ + #include "../sendd_local.h" + #include "snd_linux.h" + +-static struct ipq_handle *qh; +- + extern unsigned if_nametoindex(const char *); + +-static inline void +-process_pkt(ipq_packet_msg_t *pkt, struct sbuff *b) +-{ ++struct nfq_handle *h = NULL; ++struct nfq_q_handle *qh = NULL; ++ ++/* This is the default queue number used in our init script */ ++#define SND_DEFAULT_NFQUEUE_NUMBER 13 ++ ++/* The sbuff is must be made available to the callback function that will ++ handle the packet */ ++struct callback_data { ++ struct sbuff *b; ++}; ++ ++struct callback_data process_pkt_data; ++ ++/* nfqueue callback */ ++static int process_pkt(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg, ++ struct nfq_data *nfa, void *data) ++{ ++ struct callback_data * d = (struct callback_data *)data; ++ struct nfqnl_msg_packet_hdr *ph; ++ struct sbuff *b = d->b; ++ char *pkt_data; + int in, ifidx; + +- b->data = pkt->payload; +- b->len = pkt->data_len; ++ b->len = nfq_get_payload(nfa, &pkt_data); ++ if (b->len == -1) { ++ applog(LOG_ERR, "%s: nfq_get_payload() failed.", __FUNCTION__); ++ return 0; ++ } ++ b->data = (unsigned char *)pkt_data; + +- if (*(pkt->indev_name)) { ++ if ((ifidx = nfq_get_indev(nfa)) && ifidx != 0) + in = 1; +- ifidx = if_nametoindex(pkt->indev_name); +- } else if (*(pkt->outdev_name)) { ++ else if ((ifidx = nfq_get_outdev(nfa)) && ifidx != 0) + in = 0; +- ifidx = if_nametoindex(pkt->outdev_name); +- } else { ++ else { + applog(LOG_ERR, "%s: pkt has neither indev nor outdev", + __FUNCTION__); + snd_put_buf(b); +- return; ++ return 0; + } + +- snd_recv_pkt(b, ifidx, in, pkt); +-} ++ /* Grab packet header to get its id later */ ++ ph = nfq_get_msg_packet_hdr(nfa); /* FIXME Check return value */ + +-static void +-ipq_recv_pkt(void) +-{ +- int r; +- struct sbuff *b = snd_get_buf(); ++ snd_recv_pkt(b, ifidx, in, (void *)ph); + +- if (b == NULL) { +- return; +- } +- if ((r = ipq_read(qh, b->head, b->rem, -1)) < 0) { +- applog(LOG_ERR, "%s: ipq_read(): %s", __FUNCTION__, +- ipq_errstr()); +- goto fail; +- } else if (r == 0) { +- /* timeout */ +- goto fail; +- } +- +- switch ((r = ipq_message_type(b->head))) { +- case NLMSG_ERROR: +- applog(LOG_ERR, "%s: nlmsg error: %s", __FUNCTION__, +- strerror(ipq_get_msgerr(b->head))); +- goto fail; +- case IPQM_PACKET: +- process_pkt(ipq_get_packet(b->head), b); +- return; +- default: +- break; +- } +- +-fail: +- snd_put_buf(b); ++ return 1; + } + + void +-linux_ipq_add_fds(fd_set *fds, int *maxfd) ++linux_nfq_add_fds(fd_set *fds, int *maxfd) + { +- FD_SET(qh->fd, fds); +- *maxfd = sendd_max(*maxfd, qh->fd); ++ int fd = nfnl_fd(nfq_nfnlh(h)); ++ ++ FD_SET(fd, fds); ++ *maxfd = sendd_max(*maxfd, fd); + } + + void +-linux_ipq_dispatch_fds(fd_set *fds) ++linux_nfq_dispatch_fds(fd_set *fds) + { +- if (FD_ISSET(qh->fd, fds)) { +- ipq_recv_pkt(); ++ int fd = nfnl_fd(nfq_nfnlh(h)); ++ int r; ++ ++ if (FD_ISSET(fd, fds)) { ++ struct sbuff *b = snd_get_buf(); ++ ++ if (b == NULL) { ++ return; ++ } ++ ++ if ((r = recv(fd, b->head, b->rem, 0)) && r <= 0) { ++ if (r < 0) /* not a timeout */ ++ applog(LOG_ERR, "%s: recv failed.", ++ __FUNCTION__); ++ snd_put_buf(b); ++ return; ++ } ++ ++ process_pkt_data.b = b; /* make sbuff available to ++ callback function */ ++ nfq_handle_packet(h, (char *)b->head, r); + } + } + + void + os_specific_deliver_pkt(void *p, struct sbuff *b, int drop, int changed) + { +- ipq_packet_msg_t *pkt = p; +- void *newpkt = NULL; ++ struct nfqnl_msg_packet_hdr *ph = (struct nfqnl_msg_packet_hdr *)p; ++ unsigned char *newpkt = NULL; + int plen = 0; ++ uint32_t id = 0; ++ ++ if (ph) ++ id = ntohl(ph->packet_id); + + if (changed && !drop) { +- newpkt = sbuff_data(b); ++ newpkt = (unsigned char *)b->data; + plen = b->len; + } + +- ipq_set_verdict(qh, pkt->packet_id, drop ? NF_DROP : NF_ACCEPT, +- plen, newpkt); ++ nfq_set_verdict(qh, id, drop ? NF_DROP : NF_ACCEPT, plen, newpkt); + snd_put_buf(b); + } + + int +-linux_ipq_init(void) ++linux_nfq_init(void) + { +- if ((qh = ipq_create_handle(0, PF_INET6)) == NULL) { +- applog(LOG_ERR, "%s: ipq_create_handle() failed: %s", +- __FUNCTION__, ipq_errstr()); +- return (-1); +- } +- if (ipq_set_mode(qh, IPQ_COPY_PACKET, SND_MAX_PKT) < 0) { +- applog(LOG_ERR, "%s: ipq_set_mode() failed: %s", +- __FUNCTION__, ipq_errstr()); +- if (errno == ECONNREFUSED) { +- applog(LOG_ERR, "%s: perhaps you need to modprobe " +- "ip6_queue?", __FUNCTION__); +- } +- return (-1); ++ struct nfnl_handle *nh; ++ u_int16_t nfqueue_num = SND_DEFAULT_NFQUEUE_NUMBER; ++ ++ /* Get netfilter queue connection handle */ ++ h = nfq_open(); ++ if (!h) { ++ applog(LOG_ERR, "%s: nfq_open() failed.", __FUNCTION__); ++ return -1; ++ } ++ ++ /* Unbinding existing nfqueue handlers for AF_INET6. We ignore the ++ return value: http://www.spinics.net/lists/netfilter/msg42063.html. ++ Note that this call is required, otherwise, nfq_bind_pf() fails. */ ++ nfq_unbind_pf(h, PF_INET6); ++ ++ if (nfq_bind_pf(h, PF_INET6) < 0) { ++ applog(LOG_ERR, "%s: nfq_bind_pf failed.\n", __FUNCTION__); ++ return -1; ++ } ++ ++ /* Binding this socket to queue number nfqueue_num and installing ++ our packet handler */ ++ qh = nfq_create_queue(h, nfqueue_num, ++ (nfq_callback *) &process_pkt, ++ (void *)&process_pkt_data); ++ if (!qh) { ++ applog(LOG_ERR, "%s: nfq_create_queue() failed.\n", ++ __FUNCTION__); ++ return -1; ++ } ++ ++ /* Asking for entire copy of queued packets */ ++ if (nfq_set_mode(qh, NFQNL_COPY_PACKET, 0xffff) < 0) { /* XXX was SND_MAX_PKT */ ++ fprintf(stderr, "nfq_set_mode() failed.\n"); ++ return -1; + } +- return (0); ++ ++ /* XXX - Check if we have an interest in setting queue length */ ++ ++ /* The netlink handle associated with our queue connection handle */ ++ nh = nfq_nfnlh(h); ++ ++ return 0; + } + + void +-linux_ipq_fini(void) ++linux_nfq_fini(void) + { +- ipq_destroy_handle(qh); ++ /* Remove the binding for our queue handler*/ ++ if (qh != NULL) ++ nfq_destroy_queue(qh); ++ ++ /* Close connection associated with our connection handler */ ++ if (h != NULL) ++ nfq_close(h); + } +--- a/sendd/os-linux/snd_linux.c ++++ b/sendd/os-linux/snd_linux.c +@@ -40,13 +40,13 @@ + void + os_specific_add_fds(fd_set *fds, int *maxfd) + { +- linux_ipq_add_fds(fds, maxfd); ++ linux_nfq_add_fds(fds, maxfd); + } + + void + os_specific_dispatch_fds(fd_set *fds) + { +- linux_ipq_dispatch_fds(fds); ++ linux_nfq_dispatch_fds(fds); + } + + int +@@ -59,7 +59,7 @@ int + os_specific_init(void) + { + if (linux_rand_init() < 0 || +- linux_ipq_init() < 0) { ++ linux_nfq_init() < 0) { + return (-1); + } + return (0); +@@ -68,6 +68,6 @@ os_specific_init(void) + void + os_specific_fini(void) + { +- linux_ipq_fini(); ++ linux_nfq_fini(); + linux_rand_fini(); + } +--- a/sendd/os-linux/snd_linux.h ++++ b/sendd/os-linux/snd_linux.h +@@ -33,10 +33,10 @@ + #ifndef _SEND_LINUX_H + #define _SEND_LINUX_H + +-extern void linux_ipq_add_fds(fd_set *, int *); +-extern void linux_ipq_dispatch_fds(fd_set *); +-extern int linux_ipq_init(void); +-extern void linux_ipq_fini(void); ++extern void linux_nfq_add_fds(fd_set *, int *); ++extern void linux_nfq_dispatch_fds(fd_set *); ++extern int linux_nfq_init(void); ++extern void linux_nfq_fini(void); + + extern void linux_rand_fini(void); + extern int linux_rand_init(void); diff --git a/ipv6/send/patches/002-handle_max_bits_conf.patch b/ipv6/send/patches/002-handle_max_bits_conf.patch new file mode 100644 index 0000000..ab4008c --- /dev/null +++ b/ipv6/send/patches/002-handle_max_bits_conf.patch @@ -0,0 +1,50 @@ +This patch allows one to specify a maximum number of bits +for the CGA and RSA key size. RFC specifies that an implementation +may optionnaly honor this setting (5.1.3). This is particularly +useful on embedded systems where both the entropy and the processing +power are limited. + +--- a/sendd/config.c ++++ b/sendd/config.c +@@ -82,6 +82,7 @@ struct snd_conf snd_confs[] = { + SND_CFS(snd_cga_params, NULL, 1), + SND_CFIB(snd_full_secure, 1, 0), + SND_CFII(snd_min_key_bits, 1024, "bits", 0), ++ SND_CFII(snd_max_key_bits, 2048, "bits", 0), + SND_CFII(snd_nonce_cache_gc_intvl, 2, "seconds", 0), + SND_CFII(snd_pfx_cache_gc_intvl, 40, "seconds", 0), + SND_CFS(snd_pkixip_conf, NULL, 0), +--- a/sendd/sig_rfc3971.c ++++ b/sendd/sig_rfc3971.c +@@ -147,7 +147,7 @@ ver(struct iovec *iov, int iovlen, uint8 + EVP_MD_CTX ctx[1]; + EVP_PKEY *pub; + int rv = -1; +- int i, real_slen, min_bits; ++ int i, real_slen, min_bits, max_bits; + DEFINE_TIMESTAMP_VARS(); + + DBG_HEXDUMP(&dbg_cryptox, "key: ", key, klen); +@@ -164,6 +164,12 @@ ver(struct iovec *iov, int iovlen, uint8 + "minimum: %d)", EVP_PKEY_bits(pub), min_bits); + return (-1); + } ++ max_bits = snd_conf_get_int(snd_max_key_bits); ++ if (EVP_PKEY_bits(pub) > max_bits) { ++ DBG(&dbg_snd, "Peer key too strong: %d bits (configured " ++ "maximum: %d)", EVP_PKEY_bits(pub), max_bits); ++ return (-1); ++ } + + real_slen = EVP_PKEY_size(pub); + if (real_slen < slen) { +--- a/sendd/snd_config.h ++++ b/sendd/snd_config.h +@@ -42,6 +42,7 @@ enum snd_conf_syms { + snd_cga_params, + snd_full_secure, + snd_min_key_bits, ++ snd_max_key_bits, + snd_nonce_cache_gc_intvl, + snd_pfx_cache_gc_intvl, + snd_pkixip_conf, diff --git a/ipv6/send/patches/003-keysig_8bytes_alignment.patch b/ipv6/send/patches/003-keysig_8bytes_alignment.patch new file mode 100644 index 0000000..561cc3e --- /dev/null +++ b/ipv6/send/patches/003-keysig_8bytes_alignment.patch @@ -0,0 +1,20 @@ +This patch aligns the structure describing the RSA signature +option to 8 bytes. Before that, send was padding with N bytes +(4 on 32-bits architectures) using a cast in sendd/proto_sig.c : + + so = (struct snd_opt_sig *)(nd_so); + +which would align to the number of bytes representing a pointer +on your architecture. + +--- a/sendd/snd_proto.h ++++ b/sendd/snd_proto.h +@@ -69,7 +69,7 @@ struct snd_opt_sig { + uint32_t reserved; /* opt hdr + reserved */ + uint8_t keyhash[SND_KEYHASH_LEN]; + uint8_t sig[0]; +-}; ++} __attribute__((aligned(8))); + + struct snd_opt_timestamp { + uint8_t type; diff --git a/ipv6/send/patches/004-always_link_with_ncurses.patch b/ipv6/send/patches/004-always_link_with_ncurses.patch new file mode 100644 index 0000000..367baae --- /dev/null +++ b/ipv6/send/patches/004-always_link_with_ncurses.patch @@ -0,0 +1,26 @@ +We should always link with libncurses. This is not noticeable +when building the debian packages because we install libncurses5 +runtime library as a dependency. + +--- a/cgatool/Makefile ++++ b/cgatool/Makefile +@@ -17,7 +17,7 @@ LDLIBS= $(DEPLIBS) + LDFLAGS= -L../libs/.libs + endif + +-LDLIBS += -lcrypto ++LDLIBS += -lcrypto -lncurses + + ifeq ($(USE_THREADS),y) + LDLIBS += -lpthread +--- a/sendd/Makefile ++++ b/sendd/Makefile +@@ -28,7 +28,7 @@ LDLIBS= $(DEPLIBS) + LDFLAGS= -L../libs/.libs + endif + +-LDLIBS += -lcrypto ++LDLIBS += -lcrypto -lncurses + LDLIBS += $(OSLIBS) + + ifeq ($(USE_THREADS),y) diff --git a/ipv6/send/patches/005-use-bundled-libconfig.patch b/ipv6/send/patches/005-use-bundled-libconfig.patch new file mode 100644 index 0000000..99435f9 --- /dev/null +++ b/ipv6/send/patches/005-use-bundled-libconfig.patch @@ -0,0 +1,22 @@ +--- a/cgatool/cgatool.c ++++ b/cgatool/cgatool.c +@@ -49,7 +49,7 @@ + + #include "config.h" + #include +-#include ++#include "../libs/libconfig/libconfig.h" + #include + + #include +--- a/sendd/config.c ++++ b/sendd/config.c +@@ -38,7 +38,7 @@ + #include + + #include "config.h" +-#include ++#include "../libs/libconfig/libconfig.h" + #include + + #include "sendd_local.h" diff --git a/ipv6/send/patches/006-openssl-1.0.0-compat.patch b/ipv6/send/patches/006-openssl-1.0.0-compat.patch new file mode 100644 index 0000000..1df8a93 --- /dev/null +++ b/ipv6/send/patches/006-openssl-1.0.0-compat.patch @@ -0,0 +1,143 @@ +--- a/include/cga_keyutils.h ++++ b/include/cga_keyutils.h +@@ -40,8 +40,8 @@ + + extern int cga_add_key(cga_ctx_t *, EVP_PKEY *, int, uint16_t); + extern EVP_PKEY *cga_der2key(uint8_t *, int ); +-extern STACK *cga_der2keys(uint8_t *, int ); +-extern void cga_free_keystack(STACK *); ++extern STACK_OF(GENERAL_NAME) *cga_der2keys(uint8_t *, int ); ++extern void cga_free_keystack(STACK_OF(GENERAL_NAME) *); + extern uint8_t *cga_key2der(EVP_PKEY *, int *); + extern int cga_load_cert(cga_ctx_t *, const char *); + extern int cga_load_key(cga_ctx_t *, const char *); +--- a/libs/libcga/cga_keyutils.c ++++ b/libs/libcga/cga_keyutils.c +@@ -215,7 +215,7 @@ cga_set_key(cga_ctx_t *cga, EVP_PKEY *k) + } + + void +-cga_free_keystack(STACK *sk) ++cga_free_keystack(STACK_OF(GENERAL_NAME) *sk) + { + EVP_PKEY *k; + +@@ -232,14 +232,14 @@ cga_free_keystack(STACK *sk) + * + * Returns a stack of EVP_PKEYs on success. + */ +-STACK * ++STACK_OF(GENERAL_NAME) * + cga_der2keys(uint8_t *der, int dlen) + { + uint8_t *dk; + EVP_PKEY *k; + int klen, elen; + uint16_t type; +- STACK *sk; ++ STACK_OF(GENERAL_NAME) *sk; + + if ((sk = sk_new_null()) == NULL) { + APPLOG_NOMEM(); +--- a/include/pkixip_ext.h ++++ b/include/pkixip_ext.h +@@ -54,7 +54,7 @@ extern int pkixip_add2stores_cert(X509 * + extern int pkixip_add2stores_file(const char *); + extern int pkixip_add_store(int *, int (*cmp)(X509_OBJECT **, X509_OBJECT **)); + extern void *pkixip_find_cert(void *, int); +-extern STACK *pkixip_get_mychain(void); ++extern STACK_OF(GENERAL_NAME) *pkixip_get_mychain(void); + extern X509_STORE_CTX *pkixip_get_store_ctx(void); + extern int pkixip_has_ext(X509 *x); + extern X509 *pkixip_load_cert(const char *); +--- a/libs/libpkixipext/x509.c ++++ b/libs/libpkixipext/x509.c +@@ -62,14 +62,14 @@ X509V3_EXT_METHOD pkix_ip_ext_method = { + i2v : (X509V3_EXT_I2V)i2v_IPAddrBlocks, + }; + +-static STACK *stores[PKIXIP_MAX_STORES]; ++static STACK_OF(GENERAL_NAME) *stores[PKIXIP_MAX_STORES]; + static X509_STORE_CTX *ctx_bysubj; + static int next_store = 1; + static void *(*wrap_store_cert)(X509 *x); + static void (*trustanchor_cb)(X509 *x); + pthread_mutex_t stores_lock = PTHREAD_MUTEX_INITIALIZER; + +-static STACK *mychain; ++static STACK_OF(GENERAL_NAME) *mychain; + + /* Lifted from openssl x509_lu.c */ + static int +@@ -243,7 +243,7 @@ pkixip_load_pkey(const char *f) + return (pkey); + } + +-static STACK * ++static STACK_OF(GENERAL_NAME) * + pkixip_get_store(int handle) + { + if (handle >= PKIXIP_MAX_STORES || handle < 0) { +@@ -257,7 +257,7 @@ pkixip_get_store(int handle) + void + pkixip_walk_store(int (*cb)(X509 *, void *), void *cookie, int handle) + { +- STACK *objs; ++ STACK_OF(GENERAL_NAME) *objs; + int i; + X509_OBJECT *xo; + +@@ -282,7 +282,7 @@ done: + void * + pkixip_find_cert(void *k, int handle) + { +- STACK *store; ++ STACK_OF(GENERAL_NAME) *store; + int i; + void *r = NULL; + +@@ -305,7 +305,7 @@ done: + /* Caller must hold stores_lock */ + static int + pkixip_do_add_store(int handle, int (*cmp)(X509_OBJECT **, X509_OBJECT **), +- STACK *objs) ++ STACK_OF(GENERAL_NAME) *objs) + { + if (objs == NULL && (objs = sk_X509_OBJECT_new(cmp)) == NULL) { + applog(LOG_CRIT, "no memory"); +@@ -538,7 +538,7 @@ done: + return (r); + } + +-STACK * ++STACK_OF(GENERAL_NAME) * + pkixip_get_mychain(void) + { + return (mychain); +--- a/sendd/cpa.c ++++ b/sendd/cpa.c +@@ -183,13 +183,13 @@ next: + } + + static int +-can_handle_cps(uint8_t *ops, int len, STACK *chain, X509 **x) ++can_handle_cps(uint8_t *ops, int len, STACK_OF(GENERAL_NAME) *chain, X509 **x) + { + int i, j, r = 0; + X509_NAME *dn; + X509 x509_s; + X509_CINF cinf_s; +- STACK *dchain; ++ STACK_OF(GENERAL_NAME) *dchain; + STACK_OF(X509_NAME) *dns; + + *x = NULL; +@@ -239,7 +239,7 @@ snd_handle_cps(struct sbuff *b, struct s + { + uint8_t *msg = sbuff_data(b); + int len = b->len; +- STACK *chain; ++ STACK_OF(GENERAL_NAME) *chain; + X509 *x, *trx = NULL; + int i, tot, olen; + uint8_t *ops; diff --git a/ipv6/shorewall6-lite/Makefile b/ipv6/shorewall6-lite/Makefile new file mode 100644 index 0000000..e082b89 --- /dev/null +++ b/ipv6/shorewall6-lite/Makefile @@ -0,0 +1,66 @@ +# +# Copyright (C) 2008 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:=shorewall6-lite +PKG_VERSION:=4.4.22.2 +PKG_DIRECTORY:=4.4.22 +PKG_RELEASE:=2 + +PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/4.4/shorewall-$(PKG_DIRECTORY)/ \ + http://www1.shorewall.net/pub/shorewall/4.4/shorewall-$(PKG_DIRECTORY)/ \ + http://slovakia.shorewall.net/pub/shorewall/4.4/shorewall-$(PKG_DIRECTORY)/ \ + http://shorewall.de/pub/shorewall/4.4/shorewall-$(PKG_DIRECTORY)/ \ + http://www.shorewall.com.au/4.4/shorewall-$(PKG_DIRECTORY)/ \ + http://shorewall.infohiiway.com/pub/shorewall/4.4/shorewall-$(PKG_DIRECTORY)/ \ + http://www.shorewall.com.ar/pub/shorewall/shorewall/4.4/shorewall-$(PKG_DIRECTORY)/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_MD5SUM:=3ad7ba3790388bb562d3c937ba02fa31 + +include $(INCLUDE_DIR)/package.mk + +define Package/shorewall6-lite + SECTION:=ipv6 + CATEGORY:=IPv6 + DEPENDS:=+ip +ip6tables + TITLE:=Shorewall6 Lite + URL:=http://www.shorewall.net/ + SUBMENU:=Firewall +endef + +define Package/shorewall6-lite/description + Shoreline Firewall 6 Lite is an iptables-based firewall for Linux systems. +endef + +define Package/shorewall6-lite/conffiles +/etc/shorewall6-lite/shorewall6-lite.conf +/etc/shorewall6-lite/vardir +endef + +define Build/Compile + rm -rf $(PKG_INSTALL_DIR) + mkdir -p $(PKG_INSTALL_DIR) + PREFIX=$(PKG_INSTALL_DIR) $(PKG_BUILD_DIR)/install.sh +endef + +define Package/shorewall6-lite/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_DIR) $(1)/etc/shorewall6-lite + $(INSTALL_DIR) $(1)/usr/share + $(INSTALL_BIN) ./files/shorewall-lite.init $(1)/etc/init.d/shorewall6-lite + $(INSTALL_BIN) ./files/hotplug_iface $(1)/etc/hotplug.d/iface/05-shorewall6-lite + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/shorewall6-lite $(1)/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/share/shorewall6-lite $(1)/usr/share + $(INSTALL_BIN) ./files/hostname $(1)/usr/share/shorewall6-lite + $(CP) $(PKG_INSTALL_DIR)/etc/shorewall6-lite $(1)/etc + $(CP) ./files/vardir $(1)/etc/shorewall6-lite +endef + +$(eval $(call BuildPackage,shorewall6-lite)) diff --git a/ipv6/shorewall6-lite/files/hostname b/ipv6/shorewall6-lite/files/hostname new file mode 100644 index 0000000..42e1643 --- /dev/null +++ b/ipv6/shorewall6-lite/files/hostname @@ -0,0 +1,2 @@ +#!/bin/sh +cat /proc/sys/kernel/hostname diff --git a/ipv6/shorewall6-lite/files/hotplug_iface b/ipv6/shorewall6-lite/files/hotplug_iface new file mode 100644 index 0000000..58ecbf9 --- /dev/null +++ b/ipv6/shorewall6-lite/files/hotplug_iface @@ -0,0 +1,12 @@ +#!/bin/sh + +# should restart shorewall when an interface comes up + +[ ifup = "$ACTION" ] && { + /etc/init.d/shorewall6-lite restart +} + +[ ifdown = "$ACTION" ] && { + # might need to restore some routing + /etc/init.d/shorewall6-lite restart +} diff --git a/ipv6/shorewall6-lite/files/shorewall-lite.init b/ipv6/shorewall6-lite/files/shorewall-lite.init new file mode 100644 index 0000000..ca24bbc --- /dev/null +++ b/ipv6/shorewall6-lite/files/shorewall-lite.init @@ -0,0 +1,20 @@ +#!/bin/sh /etc/rc.common + +START=46 +start() { + touch /var/log/messages + mkdir -p /var/lock/subsys + /sbin/shorewall6-lite -qq start -f +} + +stop() { + /sbin/shorewall6-lite -qq stop +} + +restart() { + if [ -f /etc/shorewall6-lite/state/restore ] ; then + /sbin/shorewall6-lite -qq restore + else + /sbin/shorewall6-lite -qq restart + fi +} diff --git a/ipv6/shorewall6-lite/files/vardir b/ipv6/shorewall6-lite/files/vardir new file mode 100644 index 0000000..e7a9030 --- /dev/null +++ b/ipv6/shorewall6-lite/files/vardir @@ -0,0 +1,2 @@ +# move state dir out of ram +VARDIR=/etc/shorewall6-lite/state diff --git a/ipv6/shorewall6-lite/patches/110-MODULESDIR.patch b/ipv6/shorewall6-lite/patches/110-MODULESDIR.patch new file mode 100644 index 0000000..cb01e8c --- /dev/null +++ b/ipv6/shorewall6-lite/patches/110-MODULESDIR.patch @@ -0,0 +1,20 @@ +--- a/lib.common ++++ b/lib.common +@@ -292,7 +292,7 @@ + + [ -n "${MODULE_SUFFIX:=o gz ko o.gz ko.gz}" ] + +- [ -z "$MODULESDIR" ] && MODULESDIR=/lib/modules/$(uname -r)/kernel/net/ipv6/netfilter:/lib/modules/$(uname -r)/kernel/net/netfilter:/lib/modules/$(uname -r)/kernel/net/sched ++ [ -z "$MODULESDIR" ] && MODULESDIR=/lib/modules/$(uname -r)/kernel/net/ipv6/netfilter:/lib/modules/$(uname -r)/kernel/net/netfilter:/lib/modules/$(uname -r)/kernel/net/sched:/lib/modules/$(uname -r) + MODULES=$(lsmod | cut -d ' ' -f1) + + for directory in $(split $MODULESDIR); do +@@ -328,7 +328,7 @@ + [ -n "${MODULE_SUFFIX:=o gz ko o.gz ko.gz}" ] + + [ -z "$MODULESDIR" ] && \ +- MODULESDIR=/lib/modules/$(uname -r)/kernel/net/ipv6/netfilter:/lib/modules/$(uname -r)/kernel/net/netfilter:/lib/modules/$(uname -r)/kernel/net/sched ++ MODULESDIR=/lib/modules/$(uname -r)/kernel/net/ipv6/netfilter:/lib/modules/$(uname -r)/kernel/net/netfilter:/lib/modules/$(uname -r)/kernel/net/sched:/lib/modules/$(uname -r) + + for directory in $(split $MODULESDIR); do + [ -d $directory ] && moduledirectories="$moduledirectories $directory" diff --git a/ipv6/shorewall6-lite/patches/120-LOGFILE.patch b/ipv6/shorewall6-lite/patches/120-LOGFILE.patch new file mode 100644 index 0000000..7fc11cd --- /dev/null +++ b/ipv6/shorewall6-lite/patches/120-LOGFILE.patch @@ -0,0 +1,10 @@ +--- a/shorewall6-lite.conf 2009-12-05 22:37:43.000000000 -0500 ++++ b/shorewall6-lite.conf 2009-12-05 22:37:51.000000000 -0500 +@@ -28,7 +28,7 @@ + # L O G G I N G + ############################################################################### + +-LOGFILE= ++LOGFILE=/dev/null + + diff --git a/ipv6/tayga/Makefile b/ipv6/tayga/Makefile new file mode 100644 index 0000000..5d043ae --- /dev/null +++ b/ipv6/tayga/Makefile @@ -0,0 +1,47 @@ +# $Id: Makefile 5624 2006-11-23 00:29:07Z nbd $ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=tayga +PKG_VERSION:=0.9.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=tayga-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.litech.org/tayga/ +PKG_MD5SUM:=7a7b24165ce008df772f398d86fa280e +PKG_CAT:=bzcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/tayga-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/tayga + SECTION:=ipv6 + CATEGORY:=IPv6 + DEPENDS:=+ip +kmod-ipv6 +kmod-tun + TITLE:=Out-of-kernel stateless NAT64 implementation for Linux + URL:=http://www.litech.org/tayga/ +endef + +define Package/tayga/description + TAYGA is an out-of-kernel stateless NAT64 implementation for + Linux. It uses the TUN driver to exchange packets with the + kernel, which is the same driver used by OpenVPN and QEMU/KVM. +endef + +# TODO: port scripts to netifd +ifdef CONFIG_PACAKGE_netifd + define Package/tayga/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tayga $(1)/usr/sbin/ + endef +else + define Package/tayga/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/lib/network $(1)/etc/hotplug.d/iface + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tayga $(1)/usr/sbin/ + $(INSTALL_DATA) ./files/tayga.sh $(1)/lib/network/tayga.sh + $(INSTALL_DATA) ./files/tayga.hotplug $(1)/etc/hotplug.d/iface/95-tayga + endef +endif + +$(eval $(call BuildPackage,tayga)) diff --git a/ipv6/tayga/files/tayga.hotplug b/ipv6/tayga/files/tayga.hotplug new file mode 100644 index 0000000..fb989bd --- /dev/null +++ b/ipv6/tayga/files/tayga.hotplug @@ -0,0 +1,37 @@ +#!/bin/sh + +if [ "$ACTION" = ifup ]; then + . /lib/functions.sh + + include /lib/network + scan_interfaces + + update_tunnel() { + local cfg="$1" + + local proto + config_get proto "$cfg" proto + [ "$proto" = tayga ] || return 0 + + local wandev4 + config_get wandev4 "$cfg" wan4_device "$(find_tayga_wanif4)" + + local wandev6 + config_get wandev6 "$cfg" wan6_device "$(find_tayga_wanif6)" + + [ "$wandev4" = "$DEVICE" ] || [ "$wandev6" = "$DEVICE" ] || return 0 + + local wanip4=$(find_tayga_wanip4 "$wandev4") + local wanip6=$(find_tayga_wanip6 "$wandev6") + + [ -n "$wanip4" ] && [ -n "$wanip6" ] && { + uci_set_state network "$cfg" ipv4addr "$wanip4" + uci_set_state network "$cfg" ipv6addr "$wanip6" + + logger -t tayga-update "Re-establishing tayga NAT64 due to change on $INTERFACE ($DEVICE)" + ifup "$cfg" & + } + } + + config_foreach update_tunnel interface +fi diff --git a/ipv6/tayga/files/tayga.sh b/ipv6/tayga/files/tayga.sh new file mode 100644 index 0000000..a9edb6d --- /dev/null +++ b/ipv6/tayga/files/tayga.sh @@ -0,0 +1,152 @@ +# tayga.sh - NAT64 backend + +find_tayga_wanif4() { + local if=$(ip -4 r l e 0.0.0.0/0); if="${if#default* dev }"; if="${if%% *}" + [ -n "$if" ] && grep -qs "^ *$if:" /proc/net/dev && echo "$if" +} + +find_tayga_wanip4() { + local ip=$(ip -4 a s dev "$1"); ip="${ip#*inet }" + echo "${ip%%[^0-9.]*}" +} + +find_tayga_wanif6() { + local if=$(ip -6 r l e ::/0); if="${if#default* dev }"; if="${if%% *}" + [ -n "$if" ] && grep -qs "^ *$if:" /proc/net/dev && echo "$if" +} + +find_tayga_wanip6() { + local ip=$(ip -6 a s dev "$1"); ip="${ip#*inet6 }" + echo "${ip%%[^0-9A-Fa-f:]*}" +} + +# Hook into scan_interfaces() to synthesize a .device option +# This is needed for /sbin/ifup to properly dispatch control +# to setup_interface_tayga() even if no .ifname is set in +# the configuration. +scan_tayga() { + config_set "$1" device "tayga-$1" +} + +coldplug_interface_tayga() { + setup_interface_tayga "tayga-$1" "$1" +} + +tayga_add_static_mappings() { + local tmpconf="$1" + + ( + . /lib/functions.sh + config_load firewall + + tayga_map_rule_add() { + local cfg="$1" + local tmpconf="$2" + local ipv4_addr ipv6_addr + config_get ipv4_addr "$cfg" ipv4_addr "" + config_get ipv6_addr "$cfg" ipv6_addr "" + [ -n "$ipv4_addr" ] && [ -n "$ipv6_addr" ] && + echo "map $ipv4_addr $ipv6_addr" >>$tmpconf + } + + config_foreach tayga_map_rule_add nat64 "$tmpconf" + ) +} + +setup_interface_tayga() { + local iface="$1" + local cfg="$2" + local link="tayga-$cfg" + + local ipv4_addr ipv6_addr prefix dynamic_pool + + config_get ipv4_addr "$cfg" ipv4_addr + config_get ipv6_addr "$cfg" ipv6_addr + config_get prefix "$cfg" prefix + config_get dynamic_pool "$cfg" dynamic_pool + + local args + + include /lib/network + scan_interfaces + + local wanip4=$(uci_get network "$cfg" ipv4addr) + local wanip6=$(uci_get network "$cfg" ipv6addr) + + local wanif4=$(find_tayga_wanif4) + local wanif6=$(find_tayga_wanif6) + + [ -z "$wanip4" ] && { + [ -n "$wanif4" ] && { + wanip4=$(find_tayga_wanip4 "$wanif4") + uci_set_state network "$cfg" wan4_device "$wanif4" + } + } + + [ -z "$wanip6" ] && { + [ -n "$wanif6" ] && { + wanip6=$(find_tayga_wanip6 "$wanif6") + uci_set_state network "$cfg" wan6_device "$wanif6" + } + } + + [ -n "$wanip4" ] && [ -n "$wanip6" ] || { + echo "Cannot determine local IPv4 and IPv6 addressed for tayga NAT64 $cfg - skipping" + return 1 + } + + local tmpconf="/var/etc/tayga-$cfg.conf" + args="-c $tmpconf" + mkdir -p /var/etc + mkdir -p /var/run/tayga/$cfg + + echo "tun-device $link" >$tmpconf + echo "ipv4-addr $ipv4_addr" >>$tmpconf + [ -n "$ipv6_addr" ] && + echo "ipv6-addr $ipv6_addr" >>$tmpconf + [ -n "$prefix" ] && + echo "prefix $prefix" >>$tmpconf + + tayga_add_static_mappings "$tmpconf" + + [ -n "$dynamic_pool" ] && + echo "dynamic-pool $dynamic_pool" >>$tmpconf + echo "data-dir /var/run/tayga/$cfg" >>$tmpconf + + # creating the tunnel below will trigger a net subsystem event + # prevent it from touching or iface by disabling .auto here + uci_set_state network "$cfg" ifname $link + uci_set_state network "$cfg" auto 0 + + # here we create TUN device and check configuration + tayga $args --mktun || return 1 + + ip link set "$link" up + + ip addr add "$wanip4" dev "$link" + ip addr add "$wanip6" dev "$link" + + [ -n "$dynamic_pool" ] && + ip -4 route add "$dynamic_pool" dev "$link" + [ -n "$prefix" ] && + ip -6 route add "$prefix" dev "$link" + + start-stop-daemon -S -x tayga -- $args -p /var/run/$link.pid + + env -i ACTION="ifup" DEVICE="$link" INTERFACE="$cfg" PROTO="tayga" \ + /sbin/hotplug-call iface +} + +stop_interface_tayga() { + local cfg="$1" + local link="tayga-$cfg" + + env -i ACTION="ifdown" DEVICE="$link" INTERFACE="$cfg" PROTO="tayga" \ + /sbin/hotplug-call iface + + service_kill tayga "/var/run/$link.pid" + + ip link set "$link" down + ip addr flush dev "$link" + ip route flush dev "$link" +} diff --git a/ipv6/thc-ipv6/Makefile b/ipv6/thc-ipv6/Makefile new file mode 100644 index 0000000..3e4c9fa --- /dev/null +++ b/ipv6/thc-ipv6/Makefile @@ -0,0 +1,70 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=thc-ipv6 +PKG_VERSION:=0.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://freeworld.thc.org/releases/ +PKG_MD5SUM:=01715cfa7f5d4a53fe8f142a10c38c78 + +include $(INCLUDE_DIR)/package.mk + +define Package/thc-ipv6/Default + SECTION:=ipv6 + CATEGORY:=IPv6 + DEPENDS:=+libpcap + URL:=http://freeworld.thc.org/ +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + OPT="$(TARGET_CFLAGS) -L$(STAGING_DIR)/usr/lib -I$(PKG_BUILD_DIR) -I$(STAGING_DIR)/usr/include" all +endef + + +define BuildTool + + PKG_CONFIG_DEPENDS+=CONFIG_PACKAGE_$(1) + + define Package/$(1) + $$(call Package/thc-ipv6/Default) + TITLE:=$(2) + SUBMENU:=IPv6 attack and analyzing toolset (thc-ipv6) + endef + + define Package/$(1)/description + $(3) + endef + + define Package/$(1)/install + $(INSTALL_DIR) $$(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(1) $$(1)/usr/sbin/$(1) + endef + + $$(eval $$(call BuildPackage,$(1))) + +endef + + +#$(eval $(call BuildTool,NAME,TITLE,DESCRIPTION)) +$(eval $(call BuildTool,parasite6,ARP spoofer for IPv6,Provides false answers to Neighbor Solitication requests)) +$(eval $(call BuildTool,dos-new-ip6,DAD spoofer,Prevents new IPv6 interfaces to come up by spoofing DAD)) +$(eval $(call BuildTool,detect-new-ip6,Host detector,Detects new IPv6 addresses joining the network)) +$(eval $(call BuildTool,fake_router6,Router spoofer,Send Router Advertisements and try to become the default router)) +$(eval $(call BuildTool,fake_advertise6,RA spoofer,Advertise arbitary IPv6 addresses)) +$(eval $(call BuildTool,fake_mld6,Multicast membership spoofer,Advertise local host in arbitary multicast groups)) +$(eval $(call BuildTool,fake_mipv6,MIPv6 update spoofer,Spoof MIPv6 updates to redirect packets directed at the home-address)) +$(eval $(call BuildTool,redir6,Route injector,Inject IPv6 routes to redirect traffic to other routers)) +$(eval $(call BuildTool,smurf6,Local smurfer,Smurf the target or all-nodes multicast group with ICMPv6 echo replies)) +$(eval $(call BuildTool,alive6,Host presence scanner,Find active IPv6 hosts in the network segment)) +$(eval $(call BuildTool,toobig6,MTU injector,Inject MTU values in a IPv6 host)) +$(eval $(call BuildTool,rsmurf6,Remote smurfer,Smurf the local network of a target host by exploiting Linux implementation errors)) diff --git a/ipv6/thc-ipv6/patches/100-optional-openssl.patch b/ipv6/thc-ipv6/patches/100-optional-openssl.patch new file mode 100644 index 0000000..96f6ceb --- /dev/null +++ b/ipv6/thc-ipv6/patches/100-optional-openssl.patch @@ -0,0 +1,93 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,8 +1,8 @@ + CC=gcc + #OPT=-Wall -ggdb +-OPT=-O2 +-LIB=-lpcap -lssl -lcrypto +-PROGRAM=parasite6 dos-new-ip6 detect-new-ip6 fake_router6 fake_advertise6 fake_mld6 fake_mipv6 redir6 smurf6 alive6 toobig6 rsmurf6 test_implementation6 sendpees6 ++OPT=-O2 $(if $(USE_SSL),-DUSE_SSL,) ++LIB=-lpcap $(if $(USE_SSL),-lssl -lcrypto,) ++PROGRAM=parasite6 dos-new-ip6 detect-new-ip6 fake_router6 fake_advertise6 fake_mld6 fake_mipv6 redir6 smurf6 alive6 toobig6 rsmurf6 test_implementation6 $(if $(USE_SSL),sendpees6,) + + all: thc-ipv6-lib.o $(PROGRAM) + +--- a/thc-ipv6-lib.c ++++ b/thc-ipv6-lib.c +@@ -37,8 +37,10 @@ + #include + #include "thc-ipv6.h" + /* libssl */ ++#ifdef USE_SSL + #include + #include ++#endif + + + +@@ -1507,7 +1509,7 @@ + * 2006/07 + */ + +- ++#ifdef USE_SSL + thc_key_t *thc_generate_key(int key_len) + { + thc_key_t *key; +@@ -1598,6 +1600,7 @@ + + return cga_hdr; + } ++#endif + + thc_timestamp_hdr *generate_timestamp(void) + { +@@ -1632,6 +1635,7 @@ + return nonce; + } + ++#ifdef USE_SSL + thc_rsa_hdr *thc_generate_rsa(char *data2sign, int data2sign_len, thc_cga_hdr *cga_hdr, thc_key_t *key) + { + thc_rsa_hdr *rsa_hdr; +@@ -1827,3 +1831,4 @@ + + return 0; + } ++#endif +--- a/thc-ipv6.h ++++ b/thc-ipv6.h +@@ -10,7 +10,9 @@ + #define _THC_IPV6_H + + #include ++#ifdef USE_SSL + #include ++#endif + + #define VERSION "v0.7" + #define AUTHOR "van Hauser / THC " +@@ -228,10 +230,12 @@ + char *pad; + } thc_rsa_hdr; + ++#ifdef USE_SSL + typedef struct { + RSA *rsa; + int len; + } thc_key_t; ++#endif + + typedef struct { + unsigned char *data; +@@ -239,8 +243,10 @@ + int len; + } opt_t; + ++#ifdef USE_SSL + extern thc_key_t *thc_generate_key(int key_len); + extern thc_cga_hdr *thc_generate_cga(unsigned char *prefix, thc_key_t *key, unsigned char **cga); ++#endif + + #endif + diff --git a/ipv6/totd/Makefile b/ipv6/totd/Makefile new file mode 100644 index 0000000..e67bc57 --- /dev/null +++ b/ipv6/totd/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2006-2011 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:=totd +PKG_VERSION:=1.5.1 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.dillema.net/software/totd +PKG_MD5SUM:=7edaedae9f6aca5912dd6c123582cf08 + +include $(INCLUDE_DIR)/package.mk + +define Package/totd + SECTION:=ipv6 + CATEGORY:=IPv6 + DEPENDS:=+kmod-ipv6 + TITLE:=Small DNS proxy that supports IPv6/IPv4 record translation + URL:=http://www.dillema.net/software/totd.html +endef + +define Package/totd/description + totd is a small DNS proxy nameserver which supports IPv6 and enable IPv6 + only sites to access IPv4 sites by using some translation mechanism such + as NAT-PT, KAME faith, etc... +endef + +define Package/totd/conffiles +/etc/totd.conf +endef + +# uses GNU configure + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + CC="$(TARGET_CC)" \ + all +endef + +define Package/totd/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/ + $(INSTALL_CONF) ./files/totd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/totd.init $(1)/etc/init.d/totd +endef + +define Package/totd/conffiles +/etc/totd.conf +endef + +$(eval $(call BuildPackage,totd)) diff --git a/ipv6/totd/files/totd.conf b/ipv6/totd/files/totd.conf new file mode 100644 index 0000000..37e0458 --- /dev/null +++ b/ipv6/totd/files/totd.conf @@ -0,0 +1,17 @@ +; Totd sample configuration file +; you can have multiple forwarders, totd will always prefer +; forwarders listed early and only use forwarders listed later +; if the first ones are unresponsive. +forwarder 192.168.1.1 port 5353 +; you can have multiple prefixes or even no prefixes at all +; totd uses them in round-robin fashion +prefix 3ffe:abcd:1234:9876:: +; the port totd listens on for incoming requests +port 53 +; the pidfile to use (default: /var/run/totd.pid) +pidfile /var/run/totd.pid +; interfaces totd listens on (UDP only for now and not on Linux) +; If left out totd will only open wildcard sockets. +; interfaces lo br0 +; 6to4 reverse lookup +; stf diff --git a/ipv6/totd/files/totd.init b/ipv6/totd/files/totd.init new file mode 100644 index 0000000..9c2dd74 --- /dev/null +++ b/ipv6/totd/files/totd.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=60 + +SERVICE_USE_PID=1 + +start() { + service_start /usr/sbin/totd -c /etc/totd.conf +} + +stop() { + service_stop /usr/sbin/totd +} diff --git a/ipv6/totd/patches/001-no_warning_as_errors.patch b/ipv6/totd/patches/001-no_warning_as_errors.patch new file mode 100644 index 0000000..3f8f3b4 --- /dev/null +++ b/ipv6/totd/patches/001-no_warning_as_errors.patch @@ -0,0 +1,11 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -19,7 +19,7 @@ TOT_CONFIG_FILE=@sysconfdir@/totd.conf + + INSTALL = /usr/bin/install + +-CFLAGS = @CFLAGS@ @DEFS@ -Werror -Wall -DTOTCONF=\"$(TOT_CONFIG_FILE)\" @OPTFLAGS@ $(INCLUDEPATH) ++CFLAGS = @CFLAGS@ @DEFS@ -Wall -DTOTCONF=\"$(TOT_CONFIG_FILE)\" @OPTFLAGS@ $(INCLUDEPATH) + + # When debugging is enabled by --enable-malloc-debug flag to the configure + # script, the @DBMALLOC@ substitution will contain the empty string, thus diff --git a/ipv6/tspc/Makefile b/ipv6/tspc/Makefile new file mode 100644 index 0000000..8133f27 --- /dev/null +++ b/ipv6/tspc/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2006-2011 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:=tspc +PKG_VERSION:=2.1.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://ftp.fr.debian.org/debian/pool/main/t/tspc/ +PKG_MD5SUM:=65183cae002feaacd8bc92d6a5404cc2 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)2 + +include $(INCLUDE_DIR)/package.mk + +define Package/tspc + SECTION:=ipv6 + CATEGORY:=IPv6 + TITLE:=Client for Hexago's (Freenet6's) IPv6 service + URL:=http://www.hexago.com +endef + +define Package/tspc/description + Client to configure an IPv6 tunnel to + Hexago's (Freenet6's) migration broker. +endef + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/include -I$(PKG_BUILD_DIR)/platform/linux" \ + target=linux \ + all + +define Package/tspc/install + $(INSTALL_DIR) $(1)/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/tspc $(1)/bin/ + $(INSTALL_DIR) $(1)/etc/tsp + $(INSTALL_CONF) $(PKG_BUILD_DIR)/bin/tspc.conf.sample $(1)/etc/tsp/tspc.conf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/template/linux.sh $(1)/etc/tsp/setup.sh + $(INSTALL_BIN) $(PKG_BUILD_DIR)/template/checktunnel.sh $(1)/etc/tsp/ +endef + +define Package/tspc/conffiles +/etc/tsp/tspc.conf +endef + +$(eval $(call BuildPackage,tspc)) diff --git a/ipv6/tspc/patches/001-debian_patches.patch b/ipv6/tspc/patches/001-debian_patches.patch new file mode 100644 index 0000000..3a958f6 --- /dev/null +++ b/ipv6/tspc/patches/001-debian_patches.patch @@ -0,0 +1,228 @@ +diff -Nur tspc2/conf/Makefile tspc2.owrt/conf/Makefile +--- tspc2/conf/Makefile 2004-03-29 17:37:56.000000000 +0200 ++++ tspc2.owrt/conf/Makefile 2007-02-19 16:07:05.000000000 +0100 +@@ -42,7 +42,7 @@ + sed -e "s+@ifname_tun@+$(ifname_tun)+" -e "s+@ifname@+$(ifname)+" -e "s+@target@+$(target)+" -e "s+@tsp_dir@+$(configdir)+" tspc.conf.in >$(BIN)/tspc.conf.sample; \ + fi + +- chmod 700 $(BIN)/tspc.conf.sample ++ chmod 600 $(BIN)/tspc.conf.sample + + + clean: +diff -Nur tspc2/conf/tspc.conf.in tspc2.owrt/conf/tspc.conf.in +--- tspc2/conf/tspc.conf.in 2004-06-15 17:01:01.000000000 +0200 ++++ tspc2.owrt/conf/tspc.conf.in 2007-02-19 16:07:05.000000000 +0100 +@@ -18,13 +18,6 @@ + # to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, + # MA 02111-1307 USA + #------------------------------------------------------------------------------ +-# +-# +-# tsp directory: +-# the only use is for the OS scripts which will be taken +-# from $tsp_dir/template +-# +-tsp_dir=@tsp_dir@ + + # + # authentication method: +@@ -66,28 +59,19 @@ + + # + # Name of the script: +-# template=checktunnel|freebsd|netbsd|linux|windows|darwin|cisco| +-# solaris|openbsd ++# template=checktunnel|setup + # + # the value is the file name of the script in the tsp_dir/template directory + # The script will be executed after the TSP session is completed. The script + # is configuring the tunnel interface and routes. + # checktunnel is only printing information and does not configure any tunnel +-# freebsd is for FreeBSD 4.X and above +-# netbsd is for NetBSD 1.6 and above +-# linux is for Linux (most distributions) +-# windows is for WindowsXP +-# darwin is for MacOS X 10.2 and above +-# cisco is for Cisco IOS. This script prints the cisco configuration while +-# not configuring the cisco itself. +-# solaris is for Solaris 8 and above. +-# openbsd is for OpenBSD 3.X and above ++# setup will do the actual work + # you could customize your own script, name it and put the filename in + # the template variable. + # on unix, '.sh' is added to the name of the script. + # on windows, '.bat' is added to the name of the script. + # +-template=@target@ ++template=setup + + # + # 'server' is the tunnel broker identifier +diff -Nur tspc2/platform/linux/tsp_local.c tspc2.owrt/platform/linux/tsp_local.c +--- tspc2/platform/linux/tsp_local.c 2004-07-07 21:25:47.000000000 +0200 ++++ tspc2.owrt/platform/linux/tsp_local.c 2007-02-19 16:07:18.000000000 +0100 +@@ -59,13 +59,13 @@ + + /* these globals are defined by US used by alot of things in */ + +-char *FileName = "tspc.conf"; +-char *LogFile = "tspc.log"; ++char *FileName = "/etc/tsp/tspc.conf"; ++char *LogFile = "/var/log/tspc.log"; + char *LogFileName = NULL; +-char *ScriptInterpretor = "/bin/sh"; ++char *ScriptInterpretor = ""; + char *ScriptExtension = "sh"; + char *ScriptDir = NULL; +-char *TspHomeDir = "/usr/local/etc/tsp"; ++char *TspHomeDir = "/etc/tsp"; + char DirSeparator = '/'; + + int Verbose = 0; +@@ -143,7 +143,7 @@ + { + int tunfd; + +- Display(0, ELInfo, "tspStartLocal", "Going daemon, check %s for tunnel creation status", LogFile); ++ Display(1, ELInfo, "tspStartLocal", "Going daemon, check %s for tunnel creation status", LogFile); + + if (daemon(0,0) == -1) { + Display(1, ELError, "tspStartLocal", "Unable to fork."); +diff -Nur tspc2/src/lib/config.c tspc2.owrt/src/lib/config.c +--- tspc2/src/lib/config.c 2004-06-29 17:06:13.000000000 +0200 ++++ tspc2.owrt/src/lib/config.c 2007-02-19 16:07:11.000000000 +0100 +@@ -474,14 +474,17 @@ + if(IsPresent(Conf->dns_server)) { + char *Server; + char *dns = strdup(Conf->dns_server); ++ struct addrinfo *contact; + if (eq(Conf->host_type, "host")) { + Display(1,ELError, "tspVerifyConfig", "DNS delegation is not supported for host_type=host"); + status = 1; + } + for(Server = strtok(dns, ":");Server; Server = strtok(NULL, ":")) { +- if(gethostbyname(Server) == NULL) { ++ if(getaddrinfo(Server, "domain", 0, &contact)!=0) { + Display(1,ELError, "tspVerifyConfig", "DNS server name %s is not resolving.", Server); + status = 1; ++ } else { ++ freeaddrinfo(contact); + } + } + free(dns); +diff -Nur tspc2/src/tsp/tsp_client.c tspc2.owrt/src/tsp/tsp_client.c +--- tspc2/src/tsp/tsp_client.c 2004-04-20 17:10:58.000000000 +0200 ++++ tspc2.owrt/src/tsp/tsp_client.c 2007-02-19 16:07:18.000000000 +0100 +@@ -275,7 +275,7 @@ + + start_show: + +- Display(0, ELInfo, "tspSetupTunnel", "Got tunnel parameters from server, setting up local tunnel"); ++ Display(1, ELInfo, "tspSetupTunnel", "Got tunnel parameters from server, setting up local tunnel"); + + /* and start the show */ + ret = tspStartLocal(socket, conf, &t, nt[conf->transport]); +@@ -337,8 +337,8 @@ + LogInit("tspc", LogFile); + + Display( 1, ELInfo, "tspMain", "----- TSP Client Version %s Initializing -------------------------", TSP_CLIENT_VERSION); +- Display( 0, ELInfo, "tspMain", IDENTIFICATION); +- Display( 0, ELInfo, "tspMain", "Initializing (use -h for help)\n"); ++ Display( 1, ELInfo, "tspMain", IDENTIFICATION); ++ Display( 1, ELInfo, "tspMain", "Initializing (use -h for help)\n"); + + if((status = tspInitialize(argc, argv, &c)) != 0) { // *** we have no uninitialize + if (status == -1) { +@@ -361,12 +361,12 @@ + + /* first try with RUDP */ + c.transport = NET_TOOLS_T_RUDP; +- Display( 0, ELInfo, "tspMain", "\nConnecting to server with reliable udp"); ++ Display( 1, ELInfo, "tspMain", "\nConnecting to server with reliable udp"); + + try_server: + + if (c.transport == NET_TOOLS_T_TCP) +- Display( 0, ELInfo, "tspMain", "\nConnecting to server with tcp"); ++ Display( 1, ELInfo, "tspMain", "\nConnecting to server with tcp"); + + Display( 1, ELInfo, "tspMain", "Using TSP protocol version %s", + TspProtocolVersionStrings[version_index]); +diff -Nur tspc2/template/linux.sh tspc2.owrt/template/linux.sh +--- tspc2/template/linux.sh 2004-06-23 23:29:20.000000000 +0200 ++++ tspc2.owrt/template/linux.sh 2007-02-19 16:08:39.000000000 +0100 +@@ -135,9 +135,7 @@ + # + # Default route + Display 1 "Adding default route" +- ExecNoCheck $route -A inet6 del ::/0 2>/dev/null # delete old default route + ExecNoCheck $route -A inet6 del 2000::/3 2>/dev/null # delete old gw route +- Exec $route -A inet6 add ::/0 dev $TSP_TUNNEL_INTERFACE + Exec $route -A inet6 add 2000::/3 dev $TSP_TUNNEL_INTERFACE + fi + +@@ -147,9 +145,10 @@ + Display 1 "Kernel setup" + if [ X"${TSP_PREFIXLEN}" != X"64" ]; then + #Better way on linux to avoid loop with the remaining /48? +- $route -A inet6 add $TSP_PREFIX::/$TSP_PREFIXLEN dev $TSP_HOME_INTERFACE 2>/dev/null ++ ExecNoCheck $route -A inet6 del $TSP_PREFIX::/$TSP_PREFIXLEN dev $TSP_HOME_INTERFACE 2>/dev/null ++ Exec $route -A inet6 add $TSP_PREFIX::/$TSP_PREFIXLEN dev $TSP_HOME_INTERFACE + fi +- Exec $sysctl -w net.ipv6.conf.all.forwarding=1 # ipv6_forwarding enabled ++ Exec $sysctl -q -w net.ipv6.conf.all.forwarding=1 # ipv6_forwarding enabled + Display 1 "Adding prefix to $TSP_HOME_INTERFACE" + OLDADDR=`$ifconfig $TSP_HOME_INTERFACE | grep "inet6.* $PREF" | sed -e "s/^.*inet6 addr: //" -e "s/ Scope.*\$//"` + if [ ! -z $OLDADDR ]; then +@@ -157,28 +156,28 @@ + Exec $ifconfig $TSP_HOME_INTERFACE inet6 del $OLDADDR + fi + Exec $ifconfig $TSP_HOME_INTERFACE add $TSP_PREFIX::1/64 +- # Router advertisement configuration +- Display 1 "Create new $rtadvdconfigfile" +- echo "##### rtadvd.conf made by TSP ####" > "$rtadvdconfigfile" +- echo "interface $TSP_HOME_INTERFACE" >> "$rtadvdconfigfile" +- echo "{" >> "$rtadvdconfigfile" +- echo " AdvSendAdvert on;" >> "$rtadvdconfigfile" +- echo " prefix $TSP_PREFIX::/64" >> "$rtadvdconfigfile" +- echo " {" >> "$rtadvdconfigfile" +- echo " AdvOnLink on;" >> "$rtadvdconfigfile" +- echo " AdvAutonomous on;" >> "$rtadvdconfigfile" +- echo " };" >> "$rtadvdconfigfile" +- echo "};" >> "$rtadvdconfigfile" +- echo "" >> "$rtadvdconfigfile" +- /etc/init.d/radvd stop +- if [ -f $rtadvdconfigfile ]; then +- KillProcess $rtadvdconfigfile +- Exec $rtadvd -u radvd -C $rtadvdconfigfile +- Display 1 "Starting radvd: $rtadvd -u radvd -C $rtadvdconfigfile" +- else +- echo "Error : file $rtadvdconfigfile not found" +- exit 1 +- fi ++# # Router advertisement configuration ++# Display 1 "Create new $rtadvdconfigfile" ++# echo "##### rtadvd.conf made by TSP ####" > "$rtadvdconfigfile" ++# echo "interface $TSP_HOME_INTERFACE" >> "$rtadvdconfigfile" ++# echo "{" >> "$rtadvdconfigfile" ++# echo " AdvSendAdvert on;" >> "$rtadvdconfigfile" ++# echo " prefix $TSP_PREFIX::/64" >> "$rtadvdconfigfile" ++# echo " {" >> "$rtadvdconfigfile" ++# echo " AdvOnLink on;" >> "$rtadvdconfigfile" ++# echo " AdvAutonomous on;" >> "$rtadvdconfigfile" ++# echo " };" >> "$rtadvdconfigfile" ++# echo "};" >> "$rtadvdconfigfile" ++# echo "" >> "$rtadvdconfigfile" ++# /etc/init.d/radvd stop ++# if [ -f $rtadvdconfigfile ]; then ++# KillProcess $rtadvdconfigfile ++# Exec $rtadvd -u radvd -C $rtadvdconfigfile ++# Display 1 "Starting radvd: $rtadvd -u radvd -C $rtadvdconfigfile" ++# else ++# echo "Error : file $rtadvdconfigfile not found" ++# exit 1 ++# fi + fi + + Display 1 "--- End of configuration script. ---" diff --git a/ipv6/tunslip6/Makefile b/ipv6/tunslip6/Makefile new file mode 100644 index 0000000..c8f3411 --- /dev/null +++ b/ipv6/tunslip6/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# This Makefile is a skeleton +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=contiki +PKG_VERSION:=2.5 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip +PKG_SOURCE_URL:=http://downloads.sourceforge.net/project/contiki/Contiki/Contiki%20$(PKG_VERSION)/ +PKG_MD5SUM:=e2dbc5a42a899177d20d285c13bb3702 + +#PKG_BUILD_DIR:=$(BUILD_DIR)/tools +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/tunslip6 + SECTION:=ipv6 + CATEGORY:=IPv6 + DEPENDS:=+kmod-slip + TITLE:=tunslip6 from Contiki OS + URL:=http://www.contiki-os.org/ +endef + +define Package/tun6slip/description + SLIP utility tool for connecting to Contiki 6LoWPAN devices. +endef + +define Build/Compile + # pass CFLAGS again to override -O2 set by configure + $(MAKE) -C $(PKG_BUILD_DIR)/tools \ + CROSS_COMPILE="$(KERNEL_CROSS)" \ + ARCH="$(LINUX_KARCH)" \ + KERNELDIR=$(LINUX_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + tunslip6 +endef + +define Package/tunslip6/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/tools/tunslip6 $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,tunslip6)) diff --git a/ipv6/wide-dhcpv6/Makefile b/ipv6/wide-dhcpv6/Makefile new file mode 100644 index 0000000..d44d0a8 --- /dev/null +++ b/ipv6/wide-dhcpv6/Makefile @@ -0,0 +1,145 @@ +# +# Copyright (C) 2010-2012 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:=wide-dhcpv6 +PKG_VERSION:=20080615 +PKG_RELEASE:=11 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=1011e165850fe40d3e332dad2bfd30b3 + +include $(INCLUDE_DIR)/package.mk + +define Package/wide-dhcpv6/Default + SECTION:=ipv6 + CATEGORY:=IPv6 + TITLE:=WIDE-DHCPv6 + SUBMENU:=wide-dhcpv6 + DEPENDS:=+kmod-ipv6 + URL:=https://sourceforge.net/projects/wide-dhcpv6/ + MAINTAINER:=Andrew Byrne +endef + +define Package/wide-dhcpv6-client + $(call Package/wide-dhcpv6/Default) + TITLE+= client +endef + +define Package/wide-dhcpv6-client/description + WIDE-DHCPv6 is an open-source implementation of Dynamic Host Configuration Protocol + for IPv6 (DHCPv6) originally developed by the KAME project. The implementation + mainly conforms to the following standards: RFC3315,3319,3633,3646,4075,4272,etc. + + This package installs the client component. +endef + +define Package/wide-dhcpv6-server + $(call Package/wide-dhcpv6/Default) + TITLE+= server +endef + +define Package/wide-dhcpv6-server/description + WIDE-DHCPv6 is an open-source implementation of Dynamic Host Configuration Protocol + for IPv6 (DHCPv6) originally developed by the KAME project. The implementation + mainly conforms to the following standards: RFC3315,3319,3633,3646,4075,4272,etc. + + This package installs the server component. +endef + +define Package/wide-dhcpv6-relay + $(call Package/wide-dhcpv6/Default) + TITLE+= relay +endef + +define Package/wide-dhcpv6-relay/description + WIDE-DHCPv6 is an open-source implementation of Dynamic Host Configuration Protocol + for IPv6 (DHCPv6) originally developed by the KAME project. The implementation + mainly conforms to the following standards: RFC3315,3319,3633,3646,4075,4272,etc. + + This package installs the relay component. +endef + +define Package/wide-dhcpv6-control + $(call Package/wide-dhcpv6/Default) + TITLE+= client and server control utility +endef + +define Package/wide-dhcpv6-control/description + WIDE-DHCPv6 is an open-source implementation of Dynamic Host Configuration Protocol + for IPv6 (DHCPv6) originally developed by the KAME project. The implementation + mainly conforms to the following standards: RFC3315,3319,3633,3646,4075,4272,etc. + + This package installs the client and server control utility. +endef + +TARGET_CFLAGS+=-D_GNU_SOURCE + +define Build/Configure + $(call Build/Configure/Default,--with-localdbdir=/var) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + EXTRA_CFLAGS="-include debug.h" \ + all +endef + +define Package/wide-dhcpv6-client/conffiles +/etc/config/dhcp6c +endef + +define Package/wide-dhcpv6-client/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dhcp6c $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/dhcp6c.config $(1)/etc/config/dhcp6c + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/dhcp6c.init $(1)/etc/init.d/dhcp6c + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_DATA) ./files/dhcp6c.hotplug $(1)/etc/hotplug.d/iface/40-dhcp6c + $(INSTALL_DIR) $(1)/etc/hotplug.d/dhcp6c + $(INSTALL_DATA) ./files/dhcp6c-dnsmasq.hotplug $(1)/etc/hotplug.d/dhcp6c/10-dnsmasq + $(INSTALL_DATA) ./files/dhcp6c-radvd.hotplug $(1)/etc/hotplug.d/dhcp6c/20-radvd + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/dhcp6c-state $(1)/usr/bin/dhcp6c-state +endef + +define Package/wide-dhcpv6-server/conffiles +/etc/config/dhcp6s +endef + +define Package/wide-dhcpv6-server/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dhcp6s $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/dhcp6s.conf.sample $(1)/etc + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/dhcp6s.config $(1)/etc/config/dhcp6s + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/dhcp6s.init $(1)/etc/init.d/dhcp6s + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_DATA) ./files/dhcp6s.hotplug $(1)/etc/hotplug.d/iface/50-dhcp6s +endef + +define Package/wide-dhcpv6-relay/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dhcp6relay $(1)/usr/sbin +endef + +define Package/wide-dhcpv6-control/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dhcp6ctl $(1)/usr/sbin +endef + +$(eval $(call BuildPackage,wide-dhcpv6-client)) +$(eval $(call BuildPackage,wide-dhcpv6-server)) +$(eval $(call BuildPackage,wide-dhcpv6-relay)) +$(eval $(call BuildPackage,wide-dhcpv6-control)) diff --git a/ipv6/wide-dhcpv6/files/dhcp6c-dnsmasq.hotplug b/ipv6/wide-dhcpv6/files/dhcp6c-dnsmasq.hotplug new file mode 100644 index 0000000..61850cf --- /dev/null +++ b/ipv6/wide-dhcpv6/files/dhcp6c-dnsmasq.hotplug @@ -0,0 +1,53 @@ +#!/bin/sh + +. /lib/functions.sh + +getoption() { + local cfg=$1 + config_get resolvfile "$cfg" resolvfile +} + +config_load dhcp6c + +local dns +config_get dns basic dns none +[ $dns != "dnsmasq" ] && return 0 + +if [ "$ACTION" = "start" ]; then + + local domain_name_servers + config_get domain_name_servers state domain_name_servers + + if [ -n "$domain_name_servers" ]; then + + config_load dhcp + + local resolvfile + config_foreach getoption dnsmasq + + if [ -n "$resolvfile" ]; then + + cp -pf $resolvfile "$resolvfile.dhcp6c_backup" + + for nameserver in $domain_name_servers; do + echo nameserver $nameserver >> $resolvfile + done + + fi + + fi + +fi + +if [ "$ACTION" = "stop" ]; then + + config_load dhcp + + local resolvfile + config_foreach getoption dnsmasq + if [ -f "$resolvfile.dhcp6c_backup" ]; then + mv -f "$resolvfile.dhcp6c_backup" $resolvfile + fi + +fi + diff --git a/ipv6/wide-dhcpv6/files/dhcp6c-radvd.hotplug b/ipv6/wide-dhcpv6/files/dhcp6c-radvd.hotplug new file mode 100644 index 0000000..5c08e8c --- /dev/null +++ b/ipv6/wide-dhcpv6/files/dhcp6c-radvd.hotplug @@ -0,0 +1,3 @@ +#!/bin/sh + +[ -f /etc/config/radvd ] && /etc/init.d/radvd restart diff --git a/ipv6/wide-dhcpv6/files/dhcp6c-state b/ipv6/wide-dhcpv6/files/dhcp6c-state new file mode 100644 index 0000000..c777724 --- /dev/null +++ b/ipv6/wide-dhcpv6/files/dhcp6c-state @@ -0,0 +1,18 @@ +#!/bin/sh + +. /lib/functions.sh + +uci_revert_state dhcp6c state +uci_set_state dhcp6c state "" dhcp6c_state +uci_set_state dhcp6c state domain_name_servers "$new_domain_name_servers" +uci_set_state dhcp6c state domain_name "$new_domain_name" +uci_set_state dhcp6c state ntp_servers "$new_ntp_servers" +uci_set_state dhcp6c state sip_server_address "$new_sip_servers" +uci_set_state dhcp6c state sip_server_domain_name "$new_sip_name" +uci_set_state dhcp6c state nis_server_address "$new_nis_servers" +uci_set_state dhcp6c state nis_domain_name "$new_nis_name" +uci_set_state dhcp6c state nisp_server_address "$new_nisp_servers" +uci_set_state dhcp6c state nisp_domain_name "$new_nisp_name" +uci_set_state dhcp6c state bcmcs_server_address "$new_bcmcs_servers" +uci_set_state dhcp6c state bcmcs_server_domain_name "$new_bcmcs_name" + diff --git a/ipv6/wide-dhcpv6/files/dhcp6c.config b/ipv6/wide-dhcpv6/files/dhcp6c.config new file mode 100644 index 0000000..04a3ca9 --- /dev/null +++ b/ipv6/wide-dhcpv6/files/dhcp6c.config @@ -0,0 +1,42 @@ +config 'dhcp6c' 'basic' + option 'enabled' '0' # 1 = enabled; 0 = disabled + option 'interface' 'wan' # This is the interface the DHCPv6 client will run on + option 'dns' 'dnsmasq' # Which DNS server you run (only dnsmasq currently supported) + option 'debug' '0' # 1 = enable debugging; 0 = disable debugging + + # Send options (1 = send; 0 = do not send) + option 'pd' '1' # Prefix Delegation + option 'na' '0' # Non-Temporary Address + option 'rapid_commit' '1' # Rapid Commit + + # Request options (1 = request; 0 = do not request) + option 'domain_name_servers' '1' + option 'domain_name' '0' + option 'ntp_servers' '0' + option 'sip_server_address' '0' + option 'sip_server_domain_name' '0' + option 'nis_server_address' '0' + option 'nis_domain_name' '0' + option 'nisp_server_address' '0' + option 'nisp_domain_name' '0' + option 'bcmcs_server_address' '0' + option 'bcmcs_server_domain_name' '0' + + # Override the used DUID, by default it is derived from the interface MAC + # The given value must be uppercase and globally unique! + #option 'duid' '00:03:00:06:D8:5D:4C:A5:03:F2' + + # Script to run when a reply is received + option 'script' '/usr/bin/dhcp6c-state' + +# Define one or more interfaces on which prefixes should be assigned +config 'interface' 'loopback' + option 'enabled' '1' # 1 = enabled; 0 = disabled + option 'sla_id' '0' # Site level aggregator identifier specified in decimal (subnet) + option 'sla_len' '4' # Site level aggregator length (64 - size of prefix being delegated) + # e.g. /60 from ISP -> 64 - 60 = 4 + +config 'interface' 'lan' + option 'enabled' '1' + option 'sla_id' '1' + option 'sla_len' '4' diff --git a/ipv6/wide-dhcpv6/files/dhcp6c.hotplug b/ipv6/wide-dhcpv6/files/dhcp6c.hotplug new file mode 100644 index 0000000..947c53c --- /dev/null +++ b/ipv6/wide-dhcpv6/files/dhcp6c.hotplug @@ -0,0 +1,20 @@ +#!/bin/sh + +include /lib/network + +config_load "dhcp6c" + +local enabled +config_get_bool enabled basic enabled 0 +[ $enabled -eq 0 ] && return 0 + +local client_interface +config_get client_interface basic interface + +if [ "$INTERFACE" = "$client_interface" ] && [ "$ACTION" = "ifup" ]; then + /etc/init.d/dhcp6c start +fi + +if [ "$INTERFACE" = "$client_interface" ] && [ "$ACTION" = "ifdown" ]; then + /etc/init.d/dhcp6c stop +fi diff --git a/ipv6/wide-dhcpv6/files/dhcp6c.init b/ipv6/wide-dhcpv6/files/dhcp6c.init new file mode 100644 index 0000000..6e224d6 --- /dev/null +++ b/ipv6/wide-dhcpv6/files/dhcp6c.init @@ -0,0 +1,172 @@ +#!/bin/sh /etc/rc.common + +DHCP6C_REQUEST_OPTIONS='domain_name_servers domain_name ntp_servers sip_server_address sip_domain_name nis_server_address nis_domain_name nisp_server_address nisp_domain_name bcmcs_server_address bcmcs_domain_name' + +dhcp6c_write_duid() { + local mac="${1:-$(ifconfig "$client_device" | sed -ne 's/[[:space:]]*$//; s/.*HWaddr //p')}" + local pat="[0-9A-F][0-9A-F]" + + case "$mac" in + # exactly 6 octets -> assume type 3 (DUID-LL - RFC3315, 9.4) + $pat:$pat:$pat:$pat:$pat:$pat) + local oIFS="$IFS"; IFS=":"; set -- $mac; IFS="$oIFS" + + # low endian + if [ "$(printf \\1 | hexdump -n1 -ve '8/2 "" "%04x" ""')" = "0001" ]; then + printf \\x0a\\x00 + + # big endian + else + printf \\x00\\x0a + fi + + printf \\x00\\x03\\x00\\x06\\x$1\\x$2\\x$3\\x$4\\x$5\\x$6 + logger -t dhcp6c "Using MAC address DUID 00:03:00:06:$1:$2:$3:$4:$5:$6" + ;; + # at least 7 octets -> could be type 1 or type 2 + $pat:$pat:$pat:$pat:$pat:$pat:*) + local len_id=":$(echo "$mac" | sed -e 's/[^:]//g')" + local len_hi=$(printf "%02x" $((${#len_id} / 0xFF)) ) + local len_lo=$(printf "%02x" $((${#len_id} % 0xFF)) ) + + # low endian + if [ "$(printf \\1 | hexdump -n1 -ve '8/2 "" "%04x" ""')" = "0001" ]; then + printf \\x$len_lo\\x$len_hi + + # big endian + else + printf \\x$len_hi\\x$len_lo + fi + + printf $(echo "$mac" | sed -e 's/^/\\x/; s/:/\\x/g') + logger -t dhcp6c "Using user provided DUID $mac" + ;; + *) + logger -t dhcp6c "Unable to derive DUID from interface '$client_device' and no valid user DUID given" + ;; + esac +} + +dhcp6c_write_interface() { + local cfg=$1 + local sla_id + local sla_len + local enabled + local device + + config_get_bool enabled "$cfg" enabled 0 + + if [ $enabled -ne 0 ]; then + config_get sla_id "$cfg" sla_id + config_get sla_len "$cfg" sla_len + + network_get_device device "$cfg" && { + printf '\tprefix-interface %s {\n' "$device" + printf '\t\tsla-id %s;\n' "$sla_id" + printf '\t\tsla-len %s;\n' "$sla_len" + printf '\t};\n' + } + fi +} + +dhcp6c_write_request() { + printf '\trequest %s;\n' $1 | sed -e s/_/-/g +} + +dhcp6c_write_config() { + local pd + local na + config_get_bool pd basic pd 0 + config_get_bool na basic na 0 + + printf 'interface %s {\n' "$client_ifname" + + if [ $pd -ne 0 ]; then + printf '\tsend ia-pd 0;\n' + fi + + if [ $na -ne 0 ]; then + printf '\tsend ia-na 0;\n' + fi + + local rapid_commit + config_get_bool rapid_commit basic rapid_commit 0 + [ $rapid_commit -ne 0 ] && printf '\tsend rapid-commit;\n' + + local script + config_get script basic script + [ "$script" != "" ] && printf '\tscript "%s";\n' "$script" + + local request + local value + for request in $DHCP6C_REQUEST_OPTIONS; do + config_get_bool value basic "$request" 0 + [ $value -ne 0 ] && dhcp6c_write_request "$request" + done + + printf '};\n\n' + + if [ $pd -ne 0 ]; then + printf 'id-assoc pd 0 {\n' + config_foreach dhcp6c_write_interface interface + printf '};\n\n' + fi + + if [ $na -ne 0 ]; then + printf 'id-assoc na 0 {\n' + printf '};\n\n' + fi + + return 0 +} + +start() { + [ ! -e /etc/dhcp6cctlkey ] && `dd if=/dev/urandom count=1 2> /dev/null | md5sum | cut -d" " -f1 > /etc/dhcp6cctlkey` + + [ -e /var/run/dhcp6c.pid ] && return 0 + + . /lib/functions/network.sh + + config_load "dhcp6c" + + local enabled + config_get_bool enabled basic enabled 0 + [ $enabled -eq 0 ] && return 0 + + local user_duid + config_get user_duid basic duid + + logger -t dhcp6c starting dhcp6c + + local client_interface client_ifname client_device + config_get client_interface basic interface + network_get_device client_ifname "$client_interface" + network_get_physdev client_device "$client_interface" || client_device="$client_ifname" + + local config_file="/var/etc/dhcp6c.conf" + local duid_file="/var/dhcp6c_duid" + mkdir -m 755 -p /var/etc + dhcp6c_write_config > $config_file + dhcp6c_write_duid "$user_duid" > $duid_file + + local debug + local debug_option + config_get_bool debug basic debug 0 + [ $debug -eq 1 ] && debug_option="-D" + /usr/sbin/dhcp6c -c $config_file $debug_option $client_ifname + + sleep 3 + ACTION=start /sbin/hotplug-call dhcp6c + + return 0 +} + +stop() { + logger -t dhcp6c stopping dhcp6c + service_kill dhcp6c /var/run/dhcp6c.pid + rm -f /var/etc/dhcp6c.conf /var/run/dhcp6c.pid + ACTION=stop /sbin/hotplug-call dhcp6c + return 0 +} + + diff --git a/ipv6/wide-dhcpv6/files/dhcp6s.config b/ipv6/wide-dhcpv6/files/dhcp6s.config new file mode 100644 index 0000000..dda53d1 --- /dev/null +++ b/ipv6/wide-dhcpv6/files/dhcp6s.config @@ -0,0 +1,4 @@ +config 'dhcp6s' 'basic' + option 'enabled' '0' # 1 = enabled; 0 = disabled + option 'interface' 'lan' # This is the interface the DHCPv6 server will run on + option 'config_file' '/etc/dhcp6s.conf' # Config file (as this UCI config doesn't fully support all options) diff --git a/ipv6/wide-dhcpv6/files/dhcp6s.hotplug b/ipv6/wide-dhcpv6/files/dhcp6s.hotplug new file mode 100644 index 0000000..7260149 --- /dev/null +++ b/ipv6/wide-dhcpv6/files/dhcp6s.hotplug @@ -0,0 +1,20 @@ +#!/bin/sh + +include /lib/network + +config_load "dhcp6s" + +local enabled +config_get_bool enabled basic enabled 0 +[ $enabled -eq 0 ] && return 0 + +local server_interface +config_get server_interface basic interface + +if [ "$INTERFACE" = "$server_interface" ] && [ "$ACTION" = "ifup" ]; then + /etc/init.d/dhcp6s start +fi + +if [ "$INTERFACE" = "$server_interface" ] && [ "$ACTION" = "ifdown" ]; then + /etc/init.d/dhcp6s stop +fi diff --git a/ipv6/wide-dhcpv6/files/dhcp6s.init b/ipv6/wide-dhcpv6/files/dhcp6s.init new file mode 100644 index 0000000..6141e72 --- /dev/null +++ b/ipv6/wide-dhcpv6/files/dhcp6s.init @@ -0,0 +1,37 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2012 OpenWrt.org + +SERVICE_USE_PID=1 + +start() { + [ ! -e /etc/dhcp6sctlkey ] && `dd if=/dev/urandom count=1 2> /dev/null | md5sum | cut -d" " -f1 > /etc/dhcp6sctlkey` + + [ -e /var/run/dhcp6s.pid ] && return 0 + + . /lib/functions/network.sh + + config_load "dhcp6s" + + local enabled + config_get_bool enabled basic enabled 0 + [ $enabled -eq 0 ] && return 0 + + logger starting dhcp6s + + local server_interface server_ifname + config_get server_interface basic interface + network_get_device server_ifname "$server_interface" || return 1 + + local config_file + config_get config_file basic config_file + + [ ! -e $config_file ] && return 1 + + service_start /usr/sbin/dhcp6s -c $config_file $server_ifname +} + +stop() { + logger stopping dhcp6s + service_stop /usr/sbin/dhcp6s +} + diff --git a/ipv6/wide-dhcpv6/patches/000-cftoken-noyywrap.patch b/ipv6/wide-dhcpv6/patches/000-cftoken-noyywrap.patch new file mode 100644 index 0000000..df1361e --- /dev/null +++ b/ipv6/wide-dhcpv6/patches/000-cftoken-noyywrap.patch @@ -0,0 +1,9 @@ +--- a/cftoken.l 2007-03-21 10:52:55.000000000 +0100 ++++ b/cftoken.l 2009-06-12 15:40:03.000000000 +0200 +@@ -1,5 +1,6 @@ + /* $KAME: cftoken.l,v 1.35 2005/01/12 06:06:11 suz Exp $ */ + ++%option noyywrap + %{ + /* + * Copyright (C) 2002 WIDE Project. diff --git a/ipv6/wide-dhcpv6/patches/001-linux_old_compat.patch b/ipv6/wide-dhcpv6/patches/001-linux_old_compat.patch new file mode 100644 index 0000000..6dca9f3 --- /dev/null +++ b/ipv6/wide-dhcpv6/patches/001-linux_old_compat.patch @@ -0,0 +1,37 @@ +--- wide-dhcpv6-20080615.orig/common.h 2007-03-21 20:52:57.000000000 +1100 ++++ wide-dhcpv6-20080615/common.h 2009-11-29 16:00:02.000000000 +1100 +@@ -187,3 +187,34 @@ + #ifndef HAVE_STRLCPY + extern size_t strlcpy __P((char *, const char *, size_t)); + #endif ++ ++/* ++ * compat hacks in case libc and kernel get out of sync: ++ * ++ * glibc 2.4 and uClibc 0.9.29 introduce IPV6_RECVPKTINFO etc. and change IPV6_PKTINFO ++ * This is only supported in Linux kernel >= 2.6.14 ++ * ++ * This is only an approximation because the kernel version that libc was compiled against ++ * could be older or newer than the one being run. But this should not be a problem -- ++ * we just keep using the old kernel interface. ++ * ++ * these are placed here because they're needed in all of socket.c, recv.c and send.c ++ */ ++#ifdef __linux__ ++# if defined IPV6_RECVHOPLIMIT || defined IPV6_RECVPKTINFO ++# include ++# if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) ++# if defined IPV6_RECVHOPLIMIT && defined IPV6_2292HOPLIMIT ++# undef IPV6_RECVHOPLIMIT ++# define IPV6_RECVHOPLIMIT IPV6_2292HOPLIMIT ++# endif ++# if defined IPV6_RECVPKTINFO && defined IPV6_2292PKTINFO ++# undef IPV6_RECVPKTINFO ++# undef IPV6_PKTINFO ++# define IPV6_RECVPKTINFO IPV6_2292PKTINFO ++# define IPV6_PKTINFO IPV6_2292PKTINFO ++# endif ++# endif ++# endif ++#endif ++ diff --git a/ipv6/wide-dhcpv6/patches/002-fix-dprintf-clash.patch b/ipv6/wide-dhcpv6/patches/002-fix-dprintf-clash.patch new file mode 100644 index 0000000..a1efcae --- /dev/null +++ b/ipv6/wide-dhcpv6/patches/002-fix-dprintf-clash.patch @@ -0,0 +1,56 @@ +Index: wide-dhcpv6-20080615/common.c +=================================================================== +--- wide-dhcpv6-20080615.orig/common.c 2010-11-02 22:07:03.161000001 +0100 ++++ wide-dhcpv6-20080615/common.c 2010-11-02 22:07:19.532000002 +0100 +@@ -3207,7 +3207,7 @@ + } + + void +-dprintf(int level, const char *fname, const char *fmt, ...) ++my_dprintf(int level, const char *fname, const char *fmt, ...) + { + va_list ap; + char logbuf[LINE_MAX]; +Index: wide-dhcpv6-20080615/Makefile.in +=================================================================== +--- wide-dhcpv6-20080615.orig/Makefile.in 2010-11-02 22:07:03.151000001 +0100 ++++ wide-dhcpv6-20080615/Makefile.in 2010-11-02 22:07:19.533000002 +0100 +@@ -37,7 +37,7 @@ + group= @group@ + + CFLAGS= @CFLAGS@ @DEFS@ -DSYSCONFDIR=\"${sysconfdir}\" \ +- -DLOCALDBDIR=\"${localdbdir}\" ++ -DLOCALDBDIR=\"${localdbdir}\" $(EXTRA_CFLAGS) + LDFLAGS=@LDFLAGS@ + LIBOBJS=@LIBOBJS@ + LIBS= @LIBS@ @LEXLIB@ +Index: wide-dhcpv6-20080615/common.h +=================================================================== +--- wide-dhcpv6-20080615.orig/common.h 2010-11-02 22:07:23.187000002 +0100 ++++ wide-dhcpv6-20080615/common.h 2010-11-02 22:08:43.646001043 +0100 +@@ -155,7 +155,6 @@ + extern int in6_addrscopebyif __P((struct in6_addr *, char *)); + extern int in6_scope __P((struct in6_addr *)); + extern void setloglevel __P((int)); +-extern void dprintf __P((int, const char *, const char *, ...)); + extern int get_duid __P((char *, struct duid *)); + extern void dhcp6_init_options __P((struct dhcp6_optinfo *)); + extern void dhcp6_clear_options __P((struct dhcp6_optinfo *)); +Index: wide-dhcpv6-20080615/debug.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ wide-dhcpv6-20080615/debug.h 2010-11-02 22:14:58.354999418 +0100 +@@ -0,0 +1,13 @@ ++#ifndef MY_DEBUG_H_ ++#define MY_DEBUG_H_ ++ ++/* First include stdio.h, which may contain the prototype for the external dprintf. ++ * We do not want that. We redefine dprintf to our local implementation. */ ++#include ++#define dprintf my_dprintf ++#ifndef __P ++# define __P(x) x ++#endif ++extern void my_dprintf __P((int, const char *, const char *, ...)); ++ ++#endif /* MY_DEBUG_H_ */ diff --git a/lang/4th/Makefile b/lang/4th/Makefile new file mode 100644 index 0000000..fc12d93 --- /dev/null +++ b/lang/4th/Makefile @@ -0,0 +1,43 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=4th +PKG_VERSION:=3.61.5 +PKG_RELEASE:=1 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-nano.tar.gz +PKG_SOURCE_URL:=http://4th.googlecode.com/files/ +PKG_MD5SUM:=2d6ddad0e595a7549a425ce33cebd830 + +include $(INCLUDE_DIR)/package.mk + +define Package/4th + MAINTAINER:="Xiangfu Liu" + TITLE:=4th + SECTION:=lang + CATEGORY:=Languages + URL:=http://thebeez.home.xs4all.nl/4tH/ +endef + +define Package/4th/description + 4th forth compiler +endef + +MAKE_VARS += \ + LIBRARIES="${PKG_INSTALL_DIR}/usr/lib" \ + BINARIES="${PKG_INSTALL_DIR}/usr/bin" +MAKE_FLAGS += \ + -C $(PKG_BUILD_DIR)/sources -f Makefile.NAN + +define Package/4th/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/sources/4th $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/sources/4tsh $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/sources/pp4th $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/sources/lib4th.a $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,4th)) diff --git a/lang/arm/Makefile b/lang/arm/Makefile new file mode 100644 index 0000000..939edd0 --- /dev/null +++ b/lang/arm/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2011-2012 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:=arm +PKG_VERSION:=1.4.5.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=https://archive.torproject.org/arm +PKG_MD5SUM:=f85f306e50b90796ab7097d948e8fcf2 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/arm + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Terminal status monitor for Tor relays + URL:=http://www.atagar.com/arm/ + DEPENDS:=+python +python-ncurses +python-readline +endef + +define Package/arm/description + Command line application for monitoring Tor, providing real time status + information such as the current configuration, bandwidth usage, message log, + connections, etc. This uses a curses interface much like 'top' does for system + usage. The application is intended for command-line aficionados, ssh + connections, and anyone with a tty terminal for checking their relay's status. +endef + +define Build/Compile + $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)") +endef + +define Package/arm/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/arm $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/arm $(1)/usr/share/ +endef + +$(eval $(call BuildPackage,arm)) diff --git a/lang/cython/Makefile b/lang/cython/Makefile new file mode 100644 index 0000000..0e02fdf --- /dev/null +++ b/lang/cython/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cython +PKG_VERSION:=0.10.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=Cython-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.cython.org/ +PKG_BUILD_DIR:=$(BUILD_DIR)/Cython-$(PKG_VERSION) +PKG_MD5SUM:=684103ed37472d9beef3a38e0d5c431d + +PKG_BUILD_DEPENDS:=python + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/cython + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=cython + URL:=http://www.cython.org + DEPENDS:=+python-mini +endef + +define Package/cython/description + Cython is a language that should make writing C extensions for the Python language easier +endef + +define Build/Compile + # <--no-cython-compile> required, otherwise setup.py calls the target-gcc to create so-files which obviously can't be used by on the host system. + $(call Build/Compile/PyMod,,install --no-cython-compile --prefix="$(PKG_INSTALL_DIR)/usr") +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR) + $(CP) \ + $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \ + $(1)$(PYTHON_PKG_DIR) +endef + +$(eval $(call BuildPackage,cython)) diff --git a/lang/distribute/Makefile b/lang/distribute/Makefile new file mode 100644 index 0000000..c38d277 --- /dev/null +++ b/lang/distribute/Makefile @@ -0,0 +1,69 @@ +# +# 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:=distribute +PKG_VERSION:=0.6.21 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://pypi.python.org/packages/source/d/$(PKG_NAME)/ +PKG_MD5SUM:=f783444754861f9b33e9f4083bd97b60 +PKG_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)/ + +HOST_BUILD_DEPENDS:=python + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +PYTHON:=$(HOST_PYTHON_BIN) + +define Package/distribute + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Distribute + URL:=http://pypi.python.org/pypi/distribute + DEPENDS:=+python + PROVIDES:=setuptools +endef + +define Package/distribute/description + Distribute (fork of Setuptools) is a collection of extensions to Distutils +endef + +define Host/Compile + $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR)) +endef + +define Host/Install + $(INSTALL_DIR) $(STAGING_DIR)$(PYTHON_PKG_DIR) + $(CP) \ + $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \ + $(STAGING_DIR)$(PYTHON_PKG_DIR)/ +endef + +define Build/Compile + $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR)) +endef + +define Package/distribute/install + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR) + $(CP) \ + $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \ + $(1)$(PYTHON_PKG_DIR)/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/easy_install \ + $(1)/usr/bin/ + $(SED) '1s/#\!.*/#\!\/usr\/bin\/python/' $(1)/usr/bin/easy_install +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,distribute)) diff --git a/lang/egenix-mx/Makefile b/lang/egenix-mx/Makefile new file mode 100644 index 0000000..301dc0b --- /dev/null +++ b/lang/egenix-mx/Makefile @@ -0,0 +1,94 @@ +# +# Copyright (C) 2007-2008 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:=egenix-mx +PKG_VERSION:=2.0.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-base-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.egenix.com/python/ +PKG_MD5SUM:=66841151728a06f92d0b8dd2ed317a29 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-base-$(PKG_VERSION) +PKG_BUILD_DEPENDS:=python + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/python-egenix-mx + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + DEPENDS:=+python-mini + TITLE:=Egenix mxBase + URL:=http://www.egenix.com/products/python/mxBase/ +endef + +define Package/python-egenix-mx/description + This package contains a set of base packages from Egenix required by other + python packages. +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false) + $(call Build/Compile/PyMod,., \ + build --build-lib="foo", \ + BASECFLAGS="$(TARGET_CFLAGS)" \ + OPT="" \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/mx/BeeBase/mxBeeBase + $(CP) \ + $(PKG_BUILD_DIR)/mx/BeeBase/mxBeeBase/mxh.h \ + $(PKG_BUILD_DIR)/mx/BeeBase/mxBeeBase/btr.h \ + $(PKG_BUILD_DIR)/mx/BeeBase/mxBeeBase/mxBeeBase.h \ + $(1)$(PYTHON_PKG_DIR)/mx/BeeBase/mxBeeBase/ + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/mx/DateTime/mxDateTime + $(CP) \ + $(PKG_BUILD_DIR)/mx/DateTime/mxDateTime/mxh.h \ + $(PKG_BUILD_DIR)/mx/DateTime/mxDateTime/mxDateTime.h \ + $(1)$(PYTHON_PKG_DIR)/mx/DateTime/mxDateTime/ + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/mx/Proxy/mxProxy + $(CP) \ + $(PKG_BUILD_DIR)/mx/Proxy/mxProxy/mxh.h \ + $(PKG_BUILD_DIR)/mx/Proxy/mxProxy/mxProxy.h \ + $(1)$(PYTHON_PKG_DIR)/mx/Proxy/mxProxy/ + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/mx/Queue/mxQueue + $(CP) \ + $(PKG_BUILD_DIR)/mx/Queue/mxQueue/mxh.h \ + $(PKG_BUILD_DIR)/mx/Queue/mxQueue/mxQueue.h \ + $(1)$(PYTHON_PKG_DIR)/mx/Queue/mxQueue/ + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/mx/TextTools/mxTextTools + $(CP) \ + $(PKG_BUILD_DIR)/mx/TextTools/mxTextTools/mxh.h \ + $(PKG_BUILD_DIR)/mx/TextTools/mxTextTools/mxbmse.h \ + $(PKG_BUILD_DIR)/mx/TextTools/mxTextTools/mxte.h \ + $(PKG_BUILD_DIR)/mx/TextTools/mxTextTools/mxTextTools.h \ + $(1)$(PYTHON_PKG_DIR)/mx/TextTools/mxTextTools/ + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/mx/Tools/mxTools + $(CP) \ + $(PKG_BUILD_DIR)/mx/Tools/mxTools/mxh.h \ + $(PKG_BUILD_DIR)/mx/Tools/mxTools/mxTools.h \ + $(1)$(PYTHON_PKG_DIR)/mx/Tools/mxTools/ +endef + +define PyPackage/python-egenix-mx/install + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR) + $(CP) $(PKG_BUILD_DIR)/foo/mx $(1)$(PYTHON_PKG_DIR)/ + ln -sf $(1)$(PYTHON_PKG_DIR)/mx/BeeBase/ExitFunctions.py \ + $(1)$(PYTHON_PKG_DIR)/mx/Misc/ + rm -rf $(1)$(PYTHON_PKG_DIR)/mx/*/Examples +endef + +$(eval $(call PyPackage,python-egenix-mx)) +$(eval $(call BuildPackage,python-egenix-mx)) diff --git a/lang/eggdrop/Makefile b/lang/eggdrop/Makefile new file mode 100644 index 0000000..fc8349d --- /dev/null +++ b/lang/eggdrop/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2008 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:=eggdrop +PKG_VERSION:=1.6.17 +PKG_RELEASE:=1 + +PKG_SOURCE:=eggdrop$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.eggheads.org/pub/eggdrop/source/1.6 +PKG_MD5SUM:=68e181201483dee398f9904e8652e6ca + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)$(PKG_VERSION) +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/eggdrop + SECTION:=lang + CATEGORY:=Languages + TITLE:=EggDrop IRC BOT + DEPENDS:=+tcl +zlib + URL:=http://www.eggheads.org +endef + +define Package/eggdrop/description + EggDrop IRC BOT +endef + +CONFIGURE_ARGS+=\ + --prefix="$(PKG_INSTALL_DIR)/eggdrop" \ + --enable-threads \ + --with-tcllib="$(STAGING_DIR)/usr/lib/libtcl8.5.so" \ + --with-tclinc="$(STAGING_DIR)/usr/include/tcl.h" + +define Build/Compile + $(MAKE) config -C $(PKG_BUILD_DIR) + $(call Build/Compile/Default) +endef + +define Build/Install + $(call Build/Install/Default) + rm -Rvf $(PKG_INSTALL_DIR)/eggdrop/doc +endef + +define Package/eggdrop/install + $(INSTALL_DIR) $(1)/eggdrop + $(CP) $(PKG_INSTALL_DIR)/* $(1)/eggdrop +endef + +$(eval $(call BuildPackage,eggdrop)) diff --git a/lang/eggdrop/patches/001-makefile_in.patch b/lang/eggdrop/patches/001-makefile_in.patch new file mode 100644 index 0000000..8c09c41 --- /dev/null +++ b/lang/eggdrop/patches/001-makefile_in.patch @@ -0,0 +1,11 @@ +--- eggdrop/Makefile.in 2004-07-25 07:17:33.000000000 -0400 ++++ eggdrop-patched/Makefile.in 2005-05-01 04:33:56.890000000 -0400 +@@ -71,7 +71,7 @@ + + modconf = $(top_srcdir)/misc/modconfig --top_srcdir=$(top_srcdir) + +-egg_test_run = EGG_LANGDIR=$(top_srcdir)/language ./$(EGGEXEC) -v ++egg_test_run = EGG_LANGDIR=$(top_srcdir)/language #./$(EGGEXEC) -v + + post_config = echo "" && \ + echo "You can now compile the bot, using \"make\"." && \ diff --git a/lang/eggdrop/patches/002-eggdrop_h.patch b/lang/eggdrop/patches/002-eggdrop_h.patch new file mode 100644 index 0000000..311b63c --- /dev/null +++ b/lang/eggdrop/patches/002-eggdrop_h.patch @@ -0,0 +1,12 @@ +--- eggdrop/src/eggdrop.h 2008-09-08 21:09:57.000000000 +0100 ++++ eggdrop-patched/src/eggdrop.h 2008-09-08 21:11:46.000000000 +0100 +@@ -218,9 +218,6 @@ + # define sigemptyset(x) ((*(int *)(x))=0) + #endif + +-#ifndef HAVE_SOCKLEN_T +-typedef int socklen_t; +-#endif + + /* + * Handy aliases for memory tracking and core dumps diff --git a/lang/eggdrop/patches/003-language_c.patch b/lang/eggdrop/patches/003-language_c.patch new file mode 100644 index 0000000..d67d4fc --- /dev/null +++ b/lang/eggdrop/patches/003-language_c.patch @@ -0,0 +1,25 @@ +--- eggdrop/src/language.c 2004-04-06 07:56:38.000000000 +0100 ++++ eggdrop-patched/src/language.c 2008-09-08 23:24:34.000000000 +0100 +@@ -240,8 +240,19 @@ + #else + if (sscanf(lbuf, "0x%x,%500c", &lidx, ltext) != 2) { + #endif +- putlog(LOG_MISC, "*", "Malformed text line in %s at %d.", +- langfile, lline); ++ ltexts++; ++ ctmp = strchr(ltext, '\n'); ++ *ctmp = 0; ++ while (ltext[strlen(ltext) - 1] == '\\') { ++ ltext[strlen(ltext) - 1] = 0; ++ if (fgets(lbuf, 511, FLANG)) { ++ lline++; ++ ctmp = strchr(lbuf, '\n'); ++ *ctmp = 0; ++ ltext = nrealloc(ltext, strlen(lbuf) + strlen(ltext) + 1); ++ strcpy(strchr(ltext, 0), lbuf); ++ } ++ } + } else { + ltexts++; + ctmp = strchr(ltext, '\n'); + diff --git a/lang/eggdrop/patches/004-main_c.patch b/lang/eggdrop/patches/004-main_c.patch new file mode 100644 index 0000000..ad263cd --- /dev/null +++ b/lang/eggdrop/patches/004-main_c.patch @@ -0,0 +1,14 @@ +--- eggdrop/src/main.c 2004-07-02 22:21:08.000000000 +0100 ++++ eggdrop/src/main-patched/main.c 2008-09-08 21:37:18.000000000 +0100 +@@ -792,8 +792,8 @@ + printf("\n%s\n", version); + + /* Don't allow eggdrop to run as root */ +- if (((int) getuid() == 0) || ((int) geteuid() == 0)) +- fatal("ERROR: Eggdrop will not run as root!", 0); ++ if (((int) getuid() == 666) || ((int) geteuid() == 666)) ++ fatal("ERROR: Eggdrop will not run the devil!", 0); + + init_dcc_max(); + init_userent(); + diff --git a/lang/erlang/Makefile b/lang/erlang/Makefile new file mode 100644 index 0000000..ddba81c --- /dev/null +++ b/lang/erlang/Makefile @@ -0,0 +1,327 @@ +# +# Copyright (C) 2009-2012 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:=erlang +PKG_VERSION:=R15B01 +PKG_RELEASE:=4 + +PKG_SOURCE:=otp_src_$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:= http://www.erlang.org/download/ \ + http://erlang.mirror.su.se/ +PKG_MD5SUM:=f12d00f6e62b36ad027d6c0c08905fad + +PKG_BUILD_DEPENDS:=erlang/host openssl + +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/otp_src_$(PKG_VERSION) +PKG_BUILD_DIR:=$(BUILD_DIR)/otp_src_$(PKG_VERSION) + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk + +define Package/erlang/Default + SUBMENU:=Erlang + SECTION:=lang + CATEGORY:=Languages + TITLE:=Erlang/OTP programming language + URL:=http://www.erlang.org/ +endef + +define Package/erlang/Default/description + Erlang/OTP is a general-purpose programming language and runtime + environment. Erlang has built-in support for concurrency, distribution + and fault tolerance. +endef + + +define Package/erlang +$(call Package/erlang/Default) + DEPENDS+= +libncurses +librt +zlib + PROVIDES:= erlang-erts=5.9 erlang-kernel=2.15 erlang-sasl=2.2 erlang-stdlib=1.18 +endef + +define Package/erlang/description +$(call Package/erlang/Default/description) + . + This package contains the runtime implementation and a minimal set of + modules (erts, kernel, sasl & stdlib). +endef + + +define Package/erlang-asn1 +$(call Package/erlang/Default) + TITLE:=Abstract Syntax Notation One (ASN.1) support + VERSION:=1.6.19 + DEPENDS+= +erlang +erlang-syntax-tools +endef + +define Package/erlang-asn1/description +$(call Package/erlang/Default/description) + . + This Erlang/OTP package provides Abstract Syntax Notation One (ASN.1) + support. +endef + + +define Package/erlang-compiler +$(call Package/erlang/Default) + TITLE:=Byte code compiler + VERSION:=4.8 + DEPENDS+= +erlang +erlang-hipe +endef + +define Package/erlang-compiler/description +$(call Package/erlang/Default/description) + . + This Erlang/OTP package provides a byte code compiler for Erlang which + produces highly compact code. +endef + + +define Package/erlang-crypto +$(call Package/erlang/Default) + TITLE:=Cryptography support + VERSION:=2.1 + DEPENDS+= +erlang +libopenssl +endef + +define Package/erlang-crypto/description +$(call Package/erlang/Default/description) + . + This Erlang/OTP package provides functions for computation of message + digests, and encryption and decryption functions. +endef + + +define Package/erlang-hipe +$(call Package/erlang/Default) + TITLE:=High Performance Erlang + VERSION:=3.9 + DEPENDS+= +erlang +endef + +define Package/erlang-hipe/description +$(call Package/erlang/Default/description) + . + This Erlang/OTP package provides HiPE (High Performance Erlang) + support. +endef + + +define Package/erlang-inets +$(call Package/erlang/Default) + TITLE:=Internet clients and servers + VERSION:=5.8 + DEPENDS+= +erlang +endef + +define Package/erlang-inets/description +$(call Package/erlang/Default/description) + . + This Erlang/OTP package provides a container for Internet clients and + servers. Currently a FTP client, a HTTP client and server, and a tftp + client and server have been incorporated in Inets. +endef + + +define Package/erlang-mnesia +$(call Package/erlang/Default) + TITLE:=Distributed database + VERSION:=4.6 + DEPENDS+= +erlang +endef + +define Package/erlang-mnesia/description +$(call Package/erlang/Default/description) + . + This Erlang/OTP package provides a distributed DataBase Management + System (DBMS), appropriate for telecommunications applications and + other Erlang applications which require continuous operation and + exhibit soft real-time properties. +endef + + +define Package/erlang-runtime-tools +$(call Package/erlang/Default) + TITLE:=Low-profile debugging/tracing tools + VERSION:=1.8.7 + DEPENDS+= +erlang +endef + +define Package/erlang-runtime-tools/description +$(call Package/erlang/Default/description) + . + This Erlang/OTP package provides low footprint tracing/debugging tools + suitable for inclusion in a production system. +endef + + +define Package/erlang-snmp +$(call Package/erlang/Default) + TITLE:=Simple Network Management Protocol (SNMP) support + VERSION:=4.21.4 + DEPENDS+= +erlang +erlang-asn1 +endef + +define Package/erlang-snmp/description +$(call Package/erlang/Default/description) + . + This Erlang/OTP package provides Simple Network Management Protocol + (SNMP) support including a MIB compiler and tools for creating SNMP + agents. +endef + + +define Package/erlang-ssh +$(call Package/erlang/Default) + TITLE:=Secure Shell (SSH) support + VERSION:=2.0.9 + DEPENDS+= +erlang +erlang-crypto +endef + +define Package/erlang-ssh/description +$(call Package/erlang/Default/description) + . + This Erlang/OTP package provides an implementation of the Secure Shell + protocol, with SSH & SFTP support. +endef + + +define Package/erlang-ssl +$(call Package/erlang/Default) + TITLE:=Secure Sockets Layer (SSL) support + VERSION:=5.0 + DEPENDS+= +erlang +erlang-crypto +endef + +define Package/erlang-ssl/description +$(call Package/erlang/Default/description) + . + This Erlang/OTP package provides support for secure communication over + sockets. +endef + + +define Package/erlang-syntax-tools +$(call Package/erlang/Default) + TITLE:=Abstract Erlang syntax trees handling support + VERSION:=1.6.7.2 + DEPENDS+= +erlang +endef + +define Package/erlang-syntax-tools/description +$(call Package/erlang/Default/description) + . + This Erlang/OTP package provides support for handling abstract Erlang + syntax trees. +endef + + +# Host + +HOST_CONFIGURE_ARGS += \ + --disable-hipe \ + --disable-smp-support \ + --without-javac \ + --without-ssl + +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR) all +endef + +define Host/Install + $(MAKE) -C $(HOST_BUILD_DIR) install +endef + + +# Target + +CONFIGURE_ARGS += \ + --disable-hipe \ + --disable-smp-support \ + --without-javac \ + --enable-dynamic-ssl-lib + +CONFIGURE_VARS += \ + SHLIB_LD="$(TARGET_CC)" \ + TARGET_ARCH="$(TARGET_ARCH)" \ + ac_cv_func_mmap_fixed_mapped=yes \ + ac_cv_path_WX_CONFIG_PATH=no \ + erl_xcomp_getaddrinfo=no \ + erl_xcomp_sysroot="$(STAGING_DIR)" + +EXTRA_LDFLAGS+=-lz + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + noboot + $(MAKE) -C $(PKG_BUILD_DIR) \ + INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ + install +endef + +define Package/erlang/install + $(INSTALL_DIR) $(1)/usr/bin + for f in epmd erl erlc escript run_erl; do \ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/$$$$f $(1)/usr/bin/ ; \ + done + $(INSTALL_DIR) $(1)/usr/lib/erlang/bin + for f in erl erlc escript run_erl start start.boot start.script start_clean.boot start_erl start_sasl.boot to_erl; do \ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/bin/$$$$f $(1)/usr/lib/erlang/bin/ ; \ + done + $(INSTALL_DIR) $(1)/usr/lib/erlang/lib + for m in erts kernel sasl stdlib; do \ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/lib/$$$$m-* $(1)/usr/lib/erlang/lib/ ; \ + rm -rf $(1)/usr/lib/erlang/lib/$$$$m-*/examples ; \ + rm -rf $(1)/usr/lib/erlang/lib/$$$$m-*/src ; \ + done + $(INSTALL_DIR) $(1)/usr/lib/erlang + $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/erts-* $(1)/usr/lib/erlang/ + rm -rf $(1)/usr/lib/erlang/erts-*/{doc,include,lib,man,src} + rm -rf $(1)/usr/lib/erlang/erts-*/bin/*.src + $(INSTALL_DIR) $(1)/usr/lib/erlang/releases + $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/releases/* $(1)/usr/lib/erlang/releases/ + $(SED) 's,%ERL_ROOT%,/usr/lib/erlang,g' \ + $(1)/usr/lib/erlang/releases/RELEASES.src + mv -f $(1)/usr/lib/erlang/releases/RELEASES.src \ + $(1)/usr/lib/erlang/releases/RELEASES + for f in bin/erl bin/start erts-*/bin/erl erts-*/bin/start; do \ + $(SED) 's,^\(ROOTDIR\)=.*,\1=/usr/lib/erlang,g' \ + $(1)/usr/lib/erlang/$$$$f ; \ + done +endef + + +define BuildModule + + define Package/erlang-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/erlang/lib + for m in $(2); do \ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/lib/$$$$$$$$m-* $$(1)/usr/lib/erlang/lib/ ; \ + rm -rf $$(1)/usr/lib/erlang/lib/$$$$$$$$m-*/{examples,priv/obj,src} ; \ + done + endef + + $$(eval $$(call BuildPackage,erlang-$(1))) + +endef + + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,erlang)) +$(eval $(call BuildModule,asn1,asn1)) +$(eval $(call BuildModule,compiler,compiler)) +$(eval $(call BuildModule,crypto,crypto)) +$(eval $(call BuildModule,hipe,hipe)) +$(eval $(call BuildModule,inets,inets)) +$(eval $(call BuildModule,mnesia,mnesia)) +$(eval $(call BuildModule,runtime-tools,runtime_tools)) +$(eval $(call BuildModule,snmp,snmp)) +$(eval $(call BuildModule,ssh,ssh)) +$(eval $(call BuildModule,ssl,ssl)) +$(eval $(call BuildModule,syntax-tools,syntax_tools)) diff --git a/lang/erlang/patches/101-emulator_includes.patch b/lang/erlang/patches/101-emulator_includes.patch new file mode 100644 index 0000000..933c73e --- /dev/null +++ b/lang/erlang/patches/101-emulator_includes.patch @@ -0,0 +1,11 @@ +--- a/erts/emulator/Makefile.in ++++ b/erts/emulator/Makefile.in +@@ -591,7 +591,7 @@ endif + + + $(OBJDIR)/%.o: beam/%.c +- $(CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@ ++ $(CC) $(INCLUDES) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) -c $< -o $@ + + else + diff --git a/lang/erlang/patches/103-disable_emacs.patch b/lang/erlang/patches/103-disable_emacs.patch new file mode 100644 index 0000000..9412195 --- /dev/null +++ b/lang/erlang/patches/103-disable_emacs.patch @@ -0,0 +1,11 @@ +--- a/lib/tools/Makefile ++++ b/lib/tools/Makefile +@@ -23,7 +23,7 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk + # Macros + # ---------------------------------------------------- + +-SUB_DIRECTORIES = c_src src doc/src examples priv emacs ++SUB_DIRECTORIES = c_src src doc/src examples priv + + include vsn.mk + VSN = $(TOOLS_VSN) diff --git a/lang/gst-python/Makefile b/lang/gst-python/Makefile new file mode 100644 index 0000000..5ae2d4d --- /dev/null +++ b/lang/gst-python/Makefile @@ -0,0 +1,71 @@ +# +# Copyright (C) 2008-2009 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:=gst-python +PKG_VERSION:=0.10.13 +PKG_RELEASE:=1 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-python/ +PKG_MD5SUM:=870440c6aad304112961ef5700d7698f +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk +$(call include_mk, python-package.mk) + + +TARGET_CFLAGS += $(FPIC) +CONFIGURE_VARS += PYTHON=$(HOST_PYTHON) + +define Package/gst-python + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=python bindings for gstreamer + URL:=http://gstreamer.freedesktop.org/ + DEPENDS:=+gstreamer +gst-plugins-base +python-gobject +python-mini +endef + +define Package/gst-python/description + python bindings for gstreamer +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/ + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \ + $(1)/usr/lib/pkgconfig/ + + $(SED) \ + "s,^defsdir=.*,defsdir=$(STAGING_DIR)/usr/share/gst-python/0.10/defs/,g" \ + $(1)/usr/lib/pkgconfig/gst-python-0.10.pc + + $(INSTALL_DIR) $(1)/usr/share/gst-python/0.10/defs + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/gst-python/0.10/defs/* \ + $(1)/usr/share/gst-python/0.10/defs/ +endef + +define Package/gst-python/install + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/gst-0.10/gst/extend + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/{gstoption.so,pygst.pth,pygst.py} \ + $(1)$(PYTHON_PKG_DIR)/ + + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/gst-0.10/gst/*.{so,py} \ + $(1)$(PYTHON_PKG_DIR)/gst-0.10/gst/ + + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/gst-0.10/gst/extend/*.py \ + $(1)$(PYTHON_PKG_DIR)/gst-0.10/gst/extend/ +endef + +$(eval $(call BuildPackage,gst-python)) diff --git a/lang/ipython/Makefile b/lang/ipython/Makefile new file mode 100644 index 0000000..a240e13 --- /dev/null +++ b/lang/ipython/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ipython +PKG_VERSION:=0.8.2 +PKG_RELEASE:=1 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://ipython.scipy.org/dist/ +PKG_FIXUP:=autoreconf +PKG_MD5SUM:=fd5a1b6e518898a4aee8b8d8b428af70 + +include $(INCLUDE_DIR)/package.mk + +define Package/ipython + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=ipython + URL:=http://ipython.scipy.org/ +endef + +define Package/ipython/description + An enhanced interactive Python shell from the SciPy project +endef + +define Build/Configure + (cd $(PKG_BUILD_DIR); \ + if [ -x $(CONFIGURE_CMD) ]; then \ + $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/ && \ + $(CONFIGURE_VARS) \ + PYTHON=/usr/bin/python \ + $(CONFIGURE_CMD) \ + $(CONFIGURE_ARGS) ;\ + fi \ + ) +endef + +define Build/Compile + cd $(PKG_BUILD_DIR) ; $(CONFIGURE_VARS) ./setup.py install --prefix="$(PKG_INSTALL_DIR)/usr" +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1) + $(CP) $(PKG_INSTALL_DIR)/* $(1)/ +endef + +define Package/ipython/install + $(INSTALL_DIR) $(1) + $(CP) $(PKG_INSTALL_DIR)/* $(1)/ +endef + +$(eval $(call BuildPackage,ipython)) diff --git a/lang/jamvm/Makefile b/lang/jamvm/Makefile new file mode 100644 index 0000000..4d87908 --- /dev/null +++ b/lang/jamvm/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=jamvm +PKG_VERSION:=1.6.0-git +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://git.berlios.de/jamvm +PKG_SOURCE_VERSION:=4617da717ecb05654ea5bb9572338061106a414d +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz +PKG_MIRROR_MD5SUM:=fd546a48f9e248d21d879664240892a1 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/jamvm + SUBMENU:=Java + SECTION:=lang + CATEGORY:=Languages + TITLE:=A compact Java Virtual Machine + URL:=http://sourceforge.net/projects/jamvm + DEPENDS:=+zlib +libpthread +librt +classpath @!avr32 +endef + +define Package/jamvm/description + JamVM is a new Java Virtual Machine which conforms to the JVM + specification version (blue book). In comparison to most other VM's (free + and commercial) it is extremely small.However, unlike other small VMs + (e.g. KVM) it is designed to support the full specification, and includes + support for object finalisation, Soft/Weak/Phantom References, the Java + Native Interface (JNI) and the Reflection API. +endef + +CONFIGURE_ARGS += \ + --with-java-runtime-library=gnuclasspath \ + --with-classpath-install-dir=/usr \ + --disable-int-inlining \ + --disable-shared \ + --without-pic + +MAKE_FLAGS += \ + GLIBJ_ZIP=$(STAGING_DIR)/usr/share/classpath/glibj.zip + +define Package/jamvm/install + $(INSTALL_DIR) $(1)/usr + $(CP) \ + $(PKG_INSTALL_DIR)/usr/bin \ + $(PKG_INSTALL_DIR)/usr/share \ + $(1)/usr/ +endef + +define Build/InstallDev + $(CP) $(PKG_INSTALL_DIR)/* $(1)/ +endef + +$(eval $(call BuildPackage,jamvm)) + diff --git a/lang/jsonpath/Makefile b/lang/jsonpath/Makefile new file mode 100644 index 0000000..25cb124 --- /dev/null +++ b/lang/jsonpath/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2011 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:=jsonpath +PKG_VERSION:=0.52.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.ultimate.com/phil/python/download/ +PKG_MD5SUM:=4cd0c3a70acbc67d2915d64f132cdb4f +PKG_BUILD_DEPENDS:=python + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/jsonpath + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=JsonPath - XPath implementation + URL:=http://goessner.net/articles/JsonPath/ + DEPENDS:=+python +endef + +define Package/jsonpath/description + An XPath implementation for JSON +endef + +define Build/Compile + $(call Build/Compile/PyMod,,install --prefix="$(PKG_INSTALL_DIR)/usr") +endef + +define Package/jsonpath/install + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR) + $(CP) \ + $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \ + $(1)$(PYTHON_PKG_DIR) +endef + +$(eval $(call BuildPackage,jsonpath)) diff --git a/lang/kid/Makefile b/lang/kid/Makefile new file mode 100644 index 0000000..252c6f1 --- /dev/null +++ b/lang/kid/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2007-2008 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:=kid +PKG_VERSION:=0.9.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.kid-templating.org/dist/0.9.6/dist +PKG_MD5SUM:=31e7156698a6f214b4067afb9e13728f + +PKG_BUILD_DEPENDS:=python + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/python-kid + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + DEPENDS:=+python + TITLE:=XML-based Templating + URL:=http://www.kid-templating.org/ +endef + +define Package/python-kid/description + Kid is a simple template language for XML based vocabularies written in + Python. +endef + +define PyPackage/python-kid/filespec ++|$(PYTHON_PKG_DIR)/kid +-|$(PYTHON_PKG_DIR)/kid/test +endef + +define Build/Compile + $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false) + $(call Build/Compile/PyMod,., \ + install --prefix="$(PKG_INSTALL_DIR)/usr", \ + ) +endef + +$(eval $(call PyPackage,python-kid)) +$(eval $(call BuildPackage,python-kid)) diff --git a/lang/kid/patches/000-setup.patch b/lang/kid/patches/000-setup.patch new file mode 100644 index 0000000..aeb059e --- /dev/null +++ b/lang/kid/patches/000-setup.patch @@ -0,0 +1,20 @@ +diff -urN kid-0.9.6_orig/setup.py kid-0.9.6/setup.py +--- kid-0.9.6/setup.py 2007-07-16 13:02:49.000000000 +0200 ++++ kid-0.9.6/setup.py 2007-08-15 14:39:37.000000000 +0200 +@@ -1,15 +1,12 @@ + #!/usr/bin/env python + + # bootstrap setuptools if necessary +-from ez_setup import use_setuptools +-use_setuptools() ++from distutils.core import setup + + import os + + execfile(os.path.join("kid", "release.py")) + +-from setuptools import setup, find_packages +- + setup( + name="kid", + version=version, diff --git a/lang/logilab-astng/Makefile b/lang/logilab-astng/Makefile new file mode 100644 index 0000000..c25a36c --- /dev/null +++ b/lang/logilab-astng/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2008 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:=logilab-astng +PKG_VERSION:=0.17.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.logilab.fr/pub/astng/ +PKG_MD5SUM:=a654d65a4644fb984d840906cf8b27d5 + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/logilab-astng + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=logilab-astng + URL:=http://www.logilab.fr + DEPENDS:=+python-mini +endef + +define Package/logilab-astng/description + The aim of this module is to provide a common base representation of python source code for projects such as pychecker, pyreverse, pylint... +endef + +define Build/Compile + $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false) + $(call Build/Compile/PyMod,., \ + install --prefix="$(PKG_INSTALL_DIR)/usr", \ + ) +endef + +define Package/logilab-astng/install + $(INSTALL_DIR) $(1) + $(CP) $(PKG_INSTALL_DIR)/* $(1)/ +endef + +$(eval $(call BuildPackage,logilab-astng)) diff --git a/lang/logilab-common/Makefile b/lang/logilab-common/Makefile new file mode 100644 index 0000000..94b2671 --- /dev/null +++ b/lang/logilab-common/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2008 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:=logilab-common +PKG_VERSION:=0.29.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.logilab.fr/pub/common/ +PKG_MD5SUM:=90f679e0d4ed19e2bf083fb932cde922 + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/logilab-common + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=logilab-common + URL:=http://www.logilab.fr + DEPENDS:=+python-mini +endef + +define Package/logilab-common/description + a bunch of modules providing low level functionnalities shared among some python projects devel +endef + +define Build/Compile + $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false) + $(call Build/Compile/PyMod,., \ + install --prefix="$(PKG_INSTALL_DIR)/usr", \ + ) +endef + +define Package/logilab-common/install + $(INSTALL_DIR) $(1) + $(CP) $(PKG_INSTALL_DIR)/* $(1)/ +endef + +$(eval $(call BuildPackage,logilab-common)) diff --git a/lang/lsqlite3/Makefile b/lang/lsqlite3/Makefile new file mode 100644 index 0000000..b5e15d3 --- /dev/null +++ b/lang/lsqlite3/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2009-2011 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:=lsqlite3 +PKG_VERSION:=7 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://luaforge.net/frs/download.php/4472 +PKG_MD5SUM:=ef7afdd3ea7a29333daa951cda3175bb + +include $(INCLUDE_DIR)/package.mk + +define Package/lsqlite3 + SUBMENU:=Lua + SECTION:=lang + CATEGORY:=Languages + TITLE:=LuaSQLite3 + URL:=http://luasqlite.luaforge.net/lsqlite3.html + DEPENDS:=+lua +libsqlite3 +endef + +define Package/lsqlite3/description + LuaSQLite 3 is a thin wrapper around the public domain SQLite3 database engine. +endef + +define Build/Configure +endef + +TARGET_CFLAGS += $(FPIC) $(TARGET_CPPFLAGS) -std=c99 + +TARGET_LDFLAGS += -llua -lsqlite3 + +MAKE_FLAGS += \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + INCS="$(TARGET_CPPFLAGS)" \ + LIBS="$(TARGET_LDFLAGS)" \ + SHFLAGS="-shared" \ + UNAME="Linux" + +define Package/lsqlite3/install + $(INSTALL_DIR) $(1)/usr/lib/lua + $(CP) $(PKG_BUILD_DIR)/lsqlite3.so $(1)/usr/lib/lua/ +endef + +$(eval $(call BuildPackage,lsqlite3)) diff --git a/lang/luaexpat/Makefile b/lang/luaexpat/Makefile new file mode 100644 index 0000000..ded0229 --- /dev/null +++ b/lang/luaexpat/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2009 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:=luaexpat +PKG_VERSION:=1.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://luaforge.net/frs/download.php/2469 +PKG_MD5SUM:=6ecb895ccf5cff1e7f2facd438b1f8d0 + +include $(INCLUDE_DIR)/package.mk + +define Package/luaexpat + SUBMENU:=Lua + SECTION:=lang + CATEGORY:=Languages + TITLE:=LuaExpat + URL:=http://www.keplerproject.org/luaexpat/ + DEPENDS:=+lua +libexpat +endef + +define Package/luaexpat/description + LuaExpat is a SAX XML parser based on the Expat library. +endef + +define Build/Configure +endef + +define Build/Compile + $(CP) files/compat-5.1r5 $(PKG_BUILD_DIR)/compat-5.1r5 + $(MAKE) -C $(PKG_BUILD_DIR) \ + EXPAT_INC="$(STAGING_DIR)/usr/include/" \ + LUA_INC="$(STAGING_DIR)/usr/include/" \ + LUA_LIBDIR="$(STAGING_DIR)/usr/lib/" \ + COMPAT_DIR="$(PKG_BUILD_DIR)/compat-5.1r5" \ + LIB_OPTION="-shared $(TARGET_LDFLAGS)" \ + CC="$(TARGET_CC) $(TARGET_CFLAGS) $(FPIC) -std=c99" \ + LD="$(TARGET_CROSS)ld -shared" +endef + +define Package/luaexpat/install + $(INSTALL_DIR) $(1)/usr/lib/lua + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lxp.so.1.1.0 $(1)/usr/lib/lua/lxp.so + $(INSTALL_DIR) $(1)/usr/lib/lua/lxp + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lxp/lom.lua $(1)/usr/lib/lua/lxp +endef + +$(eval $(call BuildPackage,luaexpat)) diff --git a/lang/luaexpat/files/compat-5.1r5/compat-5.1.c b/lang/luaexpat/files/compat-5.1r5/compat-5.1.c new file mode 100644 index 0000000..6fdb8b7 --- /dev/null +++ b/lang/luaexpat/files/compat-5.1r5/compat-5.1.c @@ -0,0 +1,97 @@ +/* +** Compat-5.1 +** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat) +** $Id: compat-5.1.c,v 1.13 2006/02/20 21:12:47 carregal Exp $ +*/ + +#include +#include +#include "lua.h" +#include "lauxlib.h" +#include "compat-5.1.h" + +static void getfield(lua_State *L, int idx, const char *name) { + const char *end = strchr(name, '.'); + lua_pushvalue(L, idx); + while (end) { + lua_pushlstring(L, name, end - name); + lua_gettable(L, -2); + lua_remove(L, -2); + if (lua_isnil(L, -1)) return; + name = end+1; + end = strchr(name, '.'); + } + lua_pushstring(L, name); + lua_gettable(L, -2); + lua_remove(L, -2); +} + +static void setfield(lua_State *L, int idx, const char *name) { + const char *end = strchr(name, '.'); + lua_pushvalue(L, idx); + while (end) { + lua_pushlstring(L, name, end - name); + lua_gettable(L, -2); + /* create table if not found */ + if (lua_isnil(L, -1)) { + lua_pop(L, 1); + lua_newtable(L); + lua_pushlstring(L, name, end - name); + lua_pushvalue(L, -2); + lua_settable(L, -4); + } + lua_remove(L, -2); + name = end+1; + end = strchr(name, '.'); + } + lua_pushstring(L, name); + lua_pushvalue(L, -3); + lua_settable(L, -3); + lua_pop(L, 2); +} + +LUALIB_API void luaL_module(lua_State *L, const char *libname, + const luaL_reg *l, int nup) { + if (libname) { + getfield(L, LUA_GLOBALSINDEX, libname); /* check whether lib already exists */ + if (lua_isnil(L, -1)) { + int env, ns; + lua_pop(L, 1); /* get rid of nil */ + lua_pushliteral(L, "require"); + lua_gettable(L, LUA_GLOBALSINDEX); /* look for require */ + lua_getfenv(L, -1); /* getfenv(require) */ + lua_remove(L, -2); /* remove function require */ + env = lua_gettop(L); + + lua_newtable(L); /* create namespace for lib */ + ns = lua_gettop(L); + getfield(L, env, "package.loaded"); /* get package.loaded table */ + if (lua_isnil(L, -1)) { /* create package.loaded table */ + lua_pop(L, 1); /* remove previous result */ + lua_newtable(L); + lua_pushvalue(L, -1); + setfield(L, env, "package.loaded"); + } + else if (!lua_istable(L, -1)) + luaL_error(L, "name conflict for library `%s'", libname); + lua_pushstring(L, libname); + lua_pushvalue(L, ns); + lua_settable(L, -3); /* package.loaded[libname] = ns */ + lua_pop(L, 1); /* get rid of package.loaded table */ + lua_pushvalue(L, ns); /* copy namespace */ + setfield(L, LUA_GLOBALSINDEX, libname); + lua_remove (L, env); /* remove env */ + } + lua_insert(L, -(nup+1)); /* move library table to below upvalues */ + } + for (; l->name; l++) { + int i; + lua_pushstring(L, l->name); + for (i=0; ifunc, nup); + lua_settable(L, -(nup+3)); + } + lua_pop(L, nup); /* remove upvalues */ +} + diff --git a/lang/luaexpat/files/compat-5.1r5/compat-5.1.h b/lang/luaexpat/files/compat-5.1r5/compat-5.1.h new file mode 100644 index 0000000..97570d9 --- /dev/null +++ b/lang/luaexpat/files/compat-5.1r5/compat-5.1.h @@ -0,0 +1,13 @@ +/* +** Compat-5.1 +** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat/) +** $Id: compat-5.1.h,v 1.8 2006/02/20 21:12:47 carregal Exp $ +*/ + +#ifndef COMPAT_H + +LUALIB_API void luaL_module(lua_State *L, const char *libname, + const luaL_reg *l, int nup); +#define luaL_openlib luaL_module + +#endif diff --git a/lang/luaexpat/files/compat-5.1r5/compat-5.1.lua b/lang/luaexpat/files/compat-5.1r5/compat-5.1.lua new file mode 100644 index 0000000..0938d56 --- /dev/null +++ b/lang/luaexpat/files/compat-5.1r5/compat-5.1.lua @@ -0,0 +1,267 @@ +-- +-- Compat-5.1 +-- Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat) +-- According to Lua 5.1 +-- $Id: compat-5.1.lua,v 1.22 2006/02/20 21:12:47 carregal Exp $ +-- + +_COMPAT51 = "Compat-5.1 R5" + +local LUA_DIRSEP = '/' +local LUA_OFSEP = '_' +local OLD_LUA_OFSEP = '' +local POF = 'luaopen_' +local LUA_PATH_MARK = '?' +local LUA_IGMARK = ':' + +local assert, error, getfenv, ipairs, loadfile, loadlib, pairs, setfenv, setmetatable, type = assert, error, getfenv, ipairs, loadfile, loadlib, pairs, setfenv, setmetatable, type +local find, format, gfind, gsub, sub = string.find, string.format, string.gfind, string.gsub, string.sub + +-- +-- avoid overwriting the package table if it's already there +-- +package = package or {} +local _PACKAGE = package + +package.path = LUA_PATH or os.getenv("LUA_PATH") or + ("./?.lua;" .. + "/usr/local/share/lua/5.0/?.lua;" .. + "/usr/local/share/lua/5.0/?/?.lua;" .. + "/usr/local/share/lua/5.0/?/init.lua" ) + +package.cpath = LUA_CPATH or os.getenv("LUA_CPATH") or + "./?.so;" .. + "./l?.so;" .. + "/usr/local/lib/lua/5.0/?.so;" .. + "/usr/local/lib/lua/5.0/l?.so" + +-- +-- make sure require works with standard libraries +-- +package.loaded = package.loaded or {} +package.loaded.debug = debug +package.loaded.string = string +package.loaded.math = math +package.loaded.io = io +package.loaded.os = os +package.loaded.table = table +package.loaded.base = _G +package.loaded.coroutine = coroutine +local _LOADED = package.loaded + +-- +-- avoid overwriting the package.preload table if it's already there +-- +package.preload = package.preload or {} +local _PRELOAD = package.preload + + +-- +-- looks for a file `name' in given path +-- +local function findfile (name, pname) + name = gsub (name, "%.", LUA_DIRSEP) + local path = _PACKAGE[pname] + assert (type(path) == "string", format ("package.%s must be a string", pname)) + for c in gfind (path, "[^;]+") do + c = gsub (c, "%"..LUA_PATH_MARK, name) + local f = io.open (c) + if f then + f:close () + return c + end + end + return nil -- not found +end + + +-- +-- check whether library is already loaded +-- +local function loader_preload (name) + assert (type(name) == "string", format ( + "bad argument #1 to `require' (string expected, got %s)", type(name))) + assert (type(_PRELOAD) == "table", "`package.preload' must be a table") + return _PRELOAD[name] +end + + +-- +-- Lua library loader +-- +local function loader_Lua (name) + assert (type(name) == "string", format ( + "bad argument #1 to `require' (string expected, got %s)", type(name))) + local filename = findfile (name, "path") + if not filename then + return false + end + local f, err = loadfile (filename) + if not f then + error (format ("error loading module `%s' (%s)", name, err)) + end + return f +end + + +local function mkfuncname (name) + name = gsub (name, "^.*%"..LUA_IGMARK, "") + name = gsub (name, "%.", LUA_OFSEP) + return POF..name +end + +local function old_mkfuncname (name) + --name = gsub (name, "^.*%"..LUA_IGMARK, "") + name = gsub (name, "%.", OLD_LUA_OFSEP) + return POF..name +end + +-- +-- C library loader +-- +local function loader_C (name) + assert (type(name) == "string", format ( + "bad argument #1 to `require' (string expected, got %s)", type(name))) + local filename = findfile (name, "cpath") + if not filename then + return false + end + local funcname = mkfuncname (name) + local f, err = loadlib (filename, funcname) + if not f then + funcname = old_mkfuncname (name) + f, err = loadlib (filename, funcname) + if not f then + error (format ("error loading module `%s' (%s)", name, err)) + end + end + return f +end + + +local function loader_Croot (name) + local p = gsub (name, "^([^.]*).-$", "%1") + if p == "" then + return + end + local filename = findfile (p, "cpath") + if not filename then + return + end + local funcname = mkfuncname (name) + local f, err, where = loadlib (filename, funcname) + if f then + return f + elseif where ~= "init" then + error (format ("error loading module `%s' (%s)", name, err)) + end +end + +-- create `loaders' table +package.loaders = package.loaders or { loader_preload, loader_Lua, loader_C, loader_Croot, } +local _LOADERS = package.loaders + + +-- +-- iterate over available loaders +-- +local function load (name, loaders) + -- iterate over available loaders + assert (type (loaders) == "table", "`package.loaders' must be a table") + for i, loader in ipairs (loaders) do + local f = loader (name) + if f then + return f + end + end + error (format ("module `%s' not found", name)) +end + +-- sentinel +local sentinel = function () end + +-- +-- new require +-- +function _G.require (modname) + assert (type(modname) == "string", format ( + "bad argument #1 to `require' (string expected, got %s)", type(name))) + local p = _LOADED[modname] + if p then -- is it there? + if p == sentinel then + error (format ("loop or previous error loading module '%s'", modname)) + end + return p -- package is already loaded + end + local init = load (modname, _LOADERS) + _LOADED[modname] = sentinel + local actual_arg = _G.arg + _G.arg = { modname } + local res = init (modname) + if res then + _LOADED[modname] = res + end + _G.arg = actual_arg + if _LOADED[modname] == sentinel then + _LOADED[modname] = true + end + return _LOADED[modname] +end + + +-- findtable +local function findtable (t, f) + assert (type(f)=="string", "not a valid field name ("..tostring(f)..")") + local ff = f.."." + local ok, e, w = find (ff, '(.-)%.', 1) + while ok do + local nt = rawget (t, w) + if not nt then + nt = {} + t[w] = nt + elseif type(t) ~= "table" then + return sub (f, e+1) + end + t = nt + ok, e, w = find (ff, '(.-)%.', e+1) + end + return t +end + +-- +-- new package.seeall function +-- +function _PACKAGE.seeall (module) + local t = type(module) + assert (t == "table", "bad argument #1 to package.seeall (table expected, got "..t..")") + local meta = getmetatable (module) + if not meta then + meta = {} + setmetatable (module, meta) + end + meta.__index = _G +end + + +-- +-- new module function +-- +function _G.module (modname, ...) + local ns = _LOADED[modname] + if type(ns) ~= "table" then + ns = findtable (_G, modname) + if not ns then + error (string.format ("name conflict for module '%s'", modname)) + end + _LOADED[modname] = ns + end + if not ns._NAME then + ns._NAME = modname + ns._M = ns + ns._PACKAGE = gsub (modname, "[^.]*$", "") + end + setfenv (2, ns) + for i, f in ipairs (arg) do + f (ns) + end +end diff --git a/lang/luaexpat/patches/001-compile-fix.patch b/lang/luaexpat/patches/001-compile-fix.patch new file mode 100644 index 0000000..c2e863a --- /dev/null +++ b/lang/luaexpat/patches/001-compile-fix.patch @@ -0,0 +1,10 @@ +--- a/config ++++ b/config +@@ -31,6 +31,6 @@ + -Wshadow \ + -Wwrite-strings + +-CFLAGS = $(CWARNS) -ansi -O2 -I$(LUA_INC) \ ++CFLAGS = $(CWARNS) -O2 -I$(LUA_INC) \ + -I$(COMPAT_DIR) -I$(EXPAT_INC) + CC = gcc diff --git a/lang/luafilesystem/Makefile b/lang/luafilesystem/Makefile new file mode 100644 index 0000000..ffdd05e --- /dev/null +++ b/lang/luafilesystem/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=luafilesystem +PKG_VERSION:=1.5.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://github.com/downloads/keplerproject/luafilesystem/ +PKG_MD5SUM:=3cf4882bbce956e7a0b010f148f194a3 + +include $(INCLUDE_DIR)/package.mk + +define Package/luafilesystem + SUBMENU:=Lua + SECTION:=lang + CATEGORY:=Languages + TITLE:=LuaFileSystem + URL:=http://keplerproject.github.com/luafilesystem/ + DEPENDS:=+liblua +endef + +define Package/luafilesystem/description + This package contains the LuaFileSystem library, a set of portable + functions for directory creation, listing and deletion and for file + locking. +endef + +define Build/Configure +endef + +TARGET_CFLAGS += $(FPIC) $(TARGET_CPPFLAGS) + +TARGET_LDFLAGS += -llua + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) -std=gnu99" \ + LDFLAGS="$(TARGET_LDFLAGS)" + $(TARGET_CROSS)ar r $(PKG_BUILD_DIR)/src/luafilesystem.a $(PKG_BUILD_DIR)/src/lfs.o +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR)/usr/include + $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/lua + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lfs.h $(STAGING_DIR)/usr/include + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/lfs.so $(STAGING_DIR)/usr/lib/lua + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/luafilesystem.a $(STAGING_DIR)/usr/lib/lua +endef + +define Package/luafilesystem/install + $(INSTALL_DIR) $(1)/usr/lib/lua + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/lfs.so $(1)/usr/lib/lua/lfs.so +endef + +$(eval $(call BuildPackage,luafilesystem)) diff --git a/lang/luaposix/Makefile b/lang/luaposix/Makefile new file mode 100644 index 0000000..46cb211 --- /dev/null +++ b/lang/luaposix/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2011 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:=luaposix +PKG_VERSION:=5.1.11 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://luaforge.net/frs/download.php/4813 +PKG_MD5SUM:=edb76911dbdabe98dec49e3d8a126227 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/luaposix + SUBMENU:=Lua + SECTION:=lang + CATEGORY:=Languages + TITLE:=luaposix + URL:=http://luaposix.luaforge.net/ + DEPENDS:=+lua +librt +endef + +define Package/luaposix/description + luaposix is a general POSIX library for Lua providing access + to various low level libc functions. +endef + +define Build/Configure +endef + +TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC) -std=gnu99 + +ifneq ($(CONFIG_USE_EGLIBC),) + ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),) + TARGET_CFLAGS += -DNO_GETLOGIN + endif +endif + + +define Package/luaposix/install + $(INSTALL_DIR) $(1)/usr/lib/lua + $(INSTALL_BIN) $(PKG_BUILD_DIR)/posix.so $(1)/usr/lib/lua +endef + +$(eval $(call BuildPackage,luaposix)) diff --git a/lang/luaposix/patches/100-eglibc-compat.patch b/lang/luaposix/patches/100-eglibc-compat.patch new file mode 100644 index 0000000..96a6fce --- /dev/null +++ b/lang/luaposix/patches/100-eglibc-compat.patch @@ -0,0 +1,26 @@ +--- a/lposix.c ++++ b/lposix.c +@@ -960,11 +960,13 @@ static int Pctermid(lua_State *L) /** c + } + + ++#ifndef NO_GETLOGIN + static int Pgetlogin(lua_State *L) /** getlogin() */ + { + lua_pushstring(L, getlogin()); + return 1; + } ++#endif + + + static void Fgetpasswd(lua_State *L, int i, const void *data) +@@ -1778,7 +1780,9 @@ static const luaL_reg R[] = + #if _POSIX_VERSION >= 200112L + {"getgroups", Pgetgroups}, + #endif ++#ifndef NO_GETLOGIN + {"getlogin", Pgetlogin}, ++#endif + {"getopt_long", Pgetopt_long}, + {"getpasswd", Pgetpasswd}, + {"getpid", Pgetpid}, diff --git a/lang/luaprofiler/Makefile b/lang/luaprofiler/Makefile new file mode 100644 index 0000000..1ecc694 --- /dev/null +++ b/lang/luaprofiler/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2006-2009 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:=luaprofiler +PKG_VERSION:=2.0.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://luaforge.net/frs/download.php/3400 +PKG_MD5SUM:=611435c8e61e1a330ee0aa8ddc9c124a + +include $(INCLUDE_DIR)/package.mk + +define Package/luaprofiler + SUBMENU:=Lua + SECTION:=lang + CATEGORY:=Languages + TITLE:=Lua Profiler + URL:=http://luaprofiler.luaforge.net + DEPENDS:=+lua +endef + +define Package/luaprofiler/description + Profile any Lua application +endef + +define Build/Configure + +endef + +TARGET_CFLAGS += $(FPIC) $(TARGET_CPPFLAGS) + +TARGET_LDFLAGS += -llua + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) -std=gnu99" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + -f Makefile.linux +endef + +define Package/luaprofiler/install + $(INSTALL_DIR) $(1)/usr/lib/lua + $(CP) $(PKG_BUILD_DIR)/bin/profiler.so $(1)/usr/lib/lua/ +endef + +$(eval $(call BuildPackage,luaprofiler)) diff --git a/lang/luaprofiler/patches/100-link.patch b/lang/luaprofiler/patches/100-link.patch new file mode 100644 index 0000000..804e39c --- /dev/null +++ b/lang/luaprofiler/patches/100-link.patch @@ -0,0 +1,11 @@ +--- a/Makefile.linux ++++ b/Makefile.linux +@@ -4,7 +4,7 @@ OBJS= src/clocks.o src/core_profiler.o s + + + profiler: $(OBJS) +- mkdir -p bin && $(LD) -Bshareable -o $(PROFILER_OUTPUT) $(OBJS) ++ mkdir -p bin && $(LD) -Bshareable -o $(PROFILER_OUTPUT) $(OBJS) $(LDFLAGS) + + clean: + rm -f $(PROFILER_OUTPUT) src/*.o diff --git a/lang/luasec/Makefile b/lang/luasec/Makefile new file mode 100644 index 0000000..50d7741 --- /dev/null +++ b/lang/luasec/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=luasec +PKG_VERSION:=0.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://luaforge.net/frs/download.php/4255 +PKG_MD5SUM:=712158d60207bdbb6215fc7e07d8db24 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/luasec + SUBMENU:=Lua + SECTION:=lang + CATEGORY:=Languages + TITLE:=LuaSec + URL:=http://luasec.luaforge.net/ + DEPENDS:=+lua +libopenssl +luasocket +endef + +define Package/luasec/description + LuaSec is a binding for OpenSSL library to provide TLS/SSL communication. +endef + +define Build/Configure +endef + +MAKE_PATH = ./src + +MAKE_FLAGS += \ + INCDIR="$(TARGET_CPPFLAGS)" \ + LIBDIR="$(TARGET_LDFLAGS)" \ + CC="$(TARGET_CC) $(TARGET_CFLAGS) -std=gnu99" \ + LD="$(TARGET_CROSS)ld -shared" \ + LUACPATH="$(PKG_INSTALL_DIR)/usr/lib/lua" \ + LUAPATH="$(PKG_INSTALL_DIR)/usr/lib/lua" \ + linux \ + +define Package/luasec/install + $(INSTALL_DIR) $(1)/usr/lib/lua + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lua/ssl.so $(1)/usr/lib/lua/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/ssl.lua $(1)/usr/lib/lua/ + $(INSTALL_DIR) $(1)/usr/lib/lua/ssl + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/ssl/https.lua $(1)/usr/lib/lua/ssl/ +endef + +$(eval $(call BuildPackage,luasec)) diff --git a/lang/luasoap/Makefile b/lang/luasoap/Makefile new file mode 100644 index 0000000..6d650b7 --- /dev/null +++ b/lang/luasoap/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2011 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:=luasoap +PKG_VERSION:=2.0.2 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/downloads/tomasguisasola/luasoap/ +PKG_MD5SUM:=3aafa06f3a65e65f4ee08e12b89ec583 + +include $(INCLUDE_DIR)/package.mk + +define Package/luasoap + SUBMENU:=Lua + SECTION:=lang + CATEGORY:=Languages + TITLE:=LuaSOAP + URL:=https://github.com/tomasguisasola/luasoap + DEPENDS:=+lua +luaexpat +luasec +luasocket +endef + +define Package/luasoap/description + LuaSOAP is a library of functions to deal with SOAP. +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/luasoap/install + $(INSTALL_DIR) $(1)/usr/lib/lua + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/soap.lua $(1)/usr/lib/lua/ + $(INSTALL_DIR) $(1)/usr/lib/lua/soap + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{client,server}.lua $(1)/usr/lib/lua/soap/ + $(INSTALL_DIR) $(1)/usr/lib/lua/soap/client + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/client/https.lua $(1)/usr/lib/lua/soap/client/ + $(INSTALL_DIR) $(1)/usr/lib/lua/soap/tests + $(INSTALL_DATA) $(PKG_BUILD_DIR)/tests/test{,-http,-server}.lua $(1)/usr/lib/lua/soap/tests/ +endef + +$(eval $(call BuildPackage,luasoap)) diff --git a/lang/luasocket/Makefile b/lang/luasocket/Makefile new file mode 100644 index 0000000..6dc88cd --- /dev/null +++ b/lang/luasocket/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2009 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:=luasocket +PKG_VERSION:=2.0.2 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://luaforge.net/frs/download.php/2664 +PKG_MD5SUM:=41445b138deb7bcfe97bff957503da8e + +include $(INCLUDE_DIR)/package.mk + +define Package/luasocket + SUBMENU:=Lua + SECTION:=lang + CATEGORY:=Languages + TITLE:=LuaSocket + URL:=http://luasocket.luaforge.net/ + DEPENDS:=+lua +endef + +define Package/luasocket/description + LuaSocket is the most comprehensive networking support + library for the Lua language. It provides easy access to + TCP, UDP, DNS, SMTP, FTP, HTTP, MIME and much more. +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/ \ + LIBDIR="$(TARGET_LDFLAGS)" \ + CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -std=gnu99" \ + LD="$(TARGET_CROSS)ld -shared" \ + all +endef + + +define Package/luasocket/install + $(INSTALL_DIR) $(1)/usr/lib/lua + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{ltn12,mime,socket}.lua $(1)/usr/lib/lua + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mime.so.1.0.2 $(1)/usr/lib/lua + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/socket.so.2.0.2 $(1)/usr/lib/lua + $(INSTALL_DIR) $(1)/usr/lib/lua/mime + ln -sf ../mime.so.1.0.2 $(1)/usr/lib/lua/mime/core.so + $(INSTALL_DIR) $(1)/usr/lib/lua/socket + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{ftp,http,smtp,tp,url}.lua $(1)/usr/lib/lua/socket + ln -sf ../socket.so.2.0.2 $(1)/usr/lib/lua/socket/core.so +endef + +$(eval $(call BuildPackage,luasocket)) diff --git a/lang/luasql/Makefile b/lang/luasql/Makefile new file mode 100644 index 0000000..eaf494b --- /dev/null +++ b/lang/luasql/Makefile @@ -0,0 +1,121 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=luasql +PKG_VERSION:=2.1.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://luaforge.net/frs/download.php/2686/ +PKG_MD5SUM:=63bdd57de4b9d1be336ba112d8cb69eb + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/luasql/Default + SUBMENU:=Lua + SECTION:=lang + CATEGORY:=Languages + TITLE:=Lua SQL binding + URL:=http://www.keplerproject.org/luasql/ + DEPENDS:= +lua +endef + +define Package/luasql/Default/description + LuaSQL is a simple interface from Lua to a DBMS. +endef + + +define Package/luasql-mysql +$(call Package/luasql/Default) + TITLE+= for MySQL + DEPENDS+= +libmysqlclient + VARIANT:=mysql +endef + +define Package/luasql-mysql/description +$(call Package/luasql/Default/description) + . + This package contains the MySQL binding. +endef + + +define Package/luasql-pgsql +$(call Package/luasql/Default) + TITLE+= for PostgreSQL + DEPENDS+= +libpq + VARIANT:=postgres +endef + +define Package/luasql-pgsql/description +$(call Package/luasql/Default/description) + . + This package contains the PostgreSQL binding. +endef + + +define Package/luasql-sqlite3 +$(call Package/luasql/Default) + TITLE+= for SQLite 3 + DEPENDS+= +libsqlite3 + VARIANT:=sqlite3 +endef + +define Package/luasql-sqlite3/description +$(call Package/luasql/Default/description) + . + This package contains the SQLite 3 binding. +endef + + +TARGET_CFLAGS += $(FPIC) -std=gnu99 +TARGET_CPPFLAGS += -DLUA_USE_LINUX + +ifeq ($(BUILD_VARIANT),mysql) + TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/mysql + TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient -lz +endif + +ifeq ($(BUILD_VARIANT),postgres) + TARGET_LDFLAGS += -lpq +endif + +ifeq ($(BUILD_VARIANT),sqlite3) + TARGET_LDFLAGS += -lsqlite3 -lpthread +endif + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + T="$(BUILD_VARIANT)" \ + PREFIX="$(STAGING_DIR)/usr" \ + LUA_LIBDIR="$(STAGING_DIR)/usr/lib/lua" \ + DRIVER_INCS="$(TARGET_CPPFLAGS)" \ + DRIVER_LIBS="$(TARGET_LDFLAGS)" \ + CC="$(TARGET_CROSS)gcc" \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + lib + $(MAKE) -C $(PKG_BUILD_DIR) \ + T="$(BUILD_VARIANT)" \ + LUA_LIBDIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \ + install +endef + +define Build/Install/Default + $(INSTALL_DIR) $(1)/usr/lib/lua/luasql + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lua/luasql/*.so $(1)/usr/lib/lua/luasql/ +endef + +Package/luasql-mysql/install = $(Build/Install/Default) +Package/luasql-pgsql/install = $(Build/Install/Default) +Package/luasql-sqlite3/install = $(Build/Install/Default) + +$(eval $(call BuildPackage,luasql-mysql)) +$(eval $(call BuildPackage,luasql-pgsql)) +$(eval $(call BuildPackage,luasql-sqlite3)) diff --git a/lang/mako/Makefile b/lang/mako/Makefile new file mode 100644 index 0000000..ad935c6 --- /dev/null +++ b/lang/mako/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2008 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:=mako +PKG_VERSION:=0.2.5 +PKG_RELEASE:=1 + +PKG_SOURCE:=Mako-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.makotemplates.org/downloads/ +PKG_MD5SUM:=d8ca783630dc5e93970a2075532fa643 + +PKG_BUILD_DEPENDS:=distribute/host +PKG_BUILD_DIR:=$(BUILD_DIR)/$(subst .tar.gz,,$(PKG_SOURCE)) + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/mako + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Mako Templates for Python + URL:=http://www.makotemplates.org/ + DEPENDS:=+python +endef + +define Package/mako/description +Mako is a template library written in Python. It provides a familiar, +non-XML syntax which compiles into Python modules for maximum +performance. Mako's syntax and API borrows from the best ideas of many +others, including Django templates, Cheetah, Myghty, and +Genshi. Conceptually, Mako is an embedded Python (i.e. Python Server +Page) language, which refines the familiar ideas of componentized +layout and inheritance to produce one of the most straightforward and +flexible models available, while also maintaining close ties to Python +calling and scoping semantics. +endef + +define Build/Compile + $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR)) +endef + +define Package/mako/install + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR) + $(CP) \ + $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \ + $(1)$(PYTHON_PKG_DIR)/ +endef + +$(eval $(call BuildPackage,mako)) diff --git a/lang/numpy/Makefile b/lang/numpy/Makefile new file mode 100644 index 0000000..e9985cc --- /dev/null +++ b/lang/numpy/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2008-2009 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:=numpy +PKG_VERSION:=1.0.4 +PKG_RELEASE:=1 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/numpy +PKG_MD5SUM:=8f011e9d7697da570efaac61c51725e0 + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/numpy + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=numpy + URL:=http://numpy.sf.net + DEPENDS:=+python-mini @TARGET_x86||TARGET_olpc||TARGET_uml @BROKEN +endef + +define Package/numpy/description + API to GTK and glade library from python +endef + +define Build/Compile + cd $(PKG_BUILD_DIR) ; $(CONFIGURE_VARS) $(MAKE_VARS) python2.5 ./setup.py install --prefix="$(PKG_INSTALL_DIR)/usr" +endef + +define Package/numpy/install + $(INSTALL_DIR) $(1) + $(CP) $(PKG_INSTALL_DIR)/* $(1)/ +endef + +define Require/python25-dev +[ -e /usr/include/python2.5/pyconfig.h ] +endef + +$(eval $(call Require,python25-dev, \ + Please install Python 2.5 (including development headers and libraries) \ +)) + +$(eval $(call BuildPackage,numpy)) + diff --git a/lang/numpy/patches/100-compile.patch b/lang/numpy/patches/100-compile.patch new file mode 100644 index 0000000..632e409 --- /dev/null +++ b/lang/numpy/patches/100-compile.patch @@ -0,0 +1,112 @@ +diff -urN numpy-1.0.4/numpy/core/include/numpy/ufuncobject.h numpy-1.0.4.patched/numpy/core/include/numpy/ufuncobject.h +--- numpy-1.0.4/numpy/core/include/numpy/ufuncobject.h 2007-11-07 22:05:15.000000000 +0000 ++++ numpy-1.0.4.patched/numpy/core/include/numpy/ufuncobject.h 2008-05-25 11:07:14.000000000 +0100 +@@ -284,7 +284,7 @@ + #elif defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) + + #if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__) +-#include ++#include "fenv/fenv.h" + #elif defined(__CYGWIN__) + #include "fenv/fenv.c" + #endif +diff -urN numpy-1.0.4/numpy/core/setup.py numpy-1.0.4.patched/numpy/core/setup.py +--- numpy-1.0.4/numpy/core/setup.py 2007-11-07 22:06:43.000000000 +0000 ++++ numpy-1.0.4.patched/numpy/core/setup.py 2008-05-25 11:07:14.000000000 +0100 +@@ -36,6 +36,7 @@ + + def generate_config_h(ext, build_dir): + target = join(build_dir,'config.h') ++ log.info("-----------------------abc") + if newer(__file__,target): + config_cmd = config.get_config_cmd() + log.info('Generating %s',target) +@@ -73,6 +74,7 @@ + nosmp = 1 + except KeyError: + nosmp = 0 ++ nosmp = 1 + if nosmp: moredefs = [('NPY_ALLOW_THREADS', '0')] + else: moredefs = [] + # +@@ -123,8 +125,9 @@ + target_f.write('#define %s\n' % (d)) + else: + target_f.write('#define %s %s\n' % (d[0],d[1])) +- if not nosmp: # default is to use WITH_THREAD +- target_f.write('#ifdef WITH_THREAD\n#define NPY_ALLOW_THREADS 1\n#else\n#define NPY_ALLOW_THREADS 0\n#endif\n') ++ log.info("-----------------------abc") ++ #if not nosmp: # default is to use WITH_THREAD ++ target_f.write('#ifdef WITH_THREAD\n#define NPY_ALLOW_THREADS 1\n#else\n#define NPY_ALLOW_THREADS 0\n#endif\n') + target_f.close() + print 'File:',target + target_f = open(target) +diff -urN numpy-1.0.4/numpy/distutils/unixccompiler.py numpy-1.0.4.patched/numpy/distutils/unixccompiler.py +--- numpy-1.0.4/numpy/distutils/unixccompiler.py 2007-11-07 22:05:15.000000000 +0000 ++++ numpy-1.0.4.patched/numpy/distutils/unixccompiler.py 2008-05-25 11:07:14.000000000 +0100 +@@ -9,11 +9,36 @@ + from numpy.distutils.ccompiler import replace_method + + import log ++def UnixCCompiler__link_executable (self, ++ objects, ++ output_progname, ++ output_dir=None, ++ libraries=None, ++ library_dirs=None, ++ runtime_library_dirs=None, ++ debug=0, ++ extra_preargs=None, ++ extra_postargs=None, ++ target_lang=None): ++ if output_progname == "_configtest": ++ self.spawn(['gcc', '-lm', '-o',output_progname]+objects, display = "") ++ else: ++ print "#### Running " + str(CCompiler.EXECUTABLE) ++ self.link(CCompiler.EXECUTABLE, objects, ++ self.executable_filename(output_progname), output_dir, ++ libraries, library_dirs, runtime_library_dirs, None, ++ debug, extra_preargs, extra_postargs+ ['-lm'], None, target_lang) ++ ++replace_method(UnixCCompiler, 'link_executable', UnixCCompiler__link_executable) + + # Note that UnixCCompiler._compile appeared in Python 2.3 + def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): + display = '%s: %s' % (os.path.basename(self.compiler_so[0]),src) + try: ++ if src == "_configtest.c": ++ self.spawn(['gcc', '-fwrapv', '-O2', '-Wall', '-Wstrict-prototypes', '-I/umc/blogic/olpc/staging_dir/i386/usr/include', '-I/umc/blogic/olpc/staging_dir/i386/include', '-I/umc/blogic/olpc/staging_dir/i386/usr/include/python2.5','-I/umc/blogic/olpc/staging_dir/i386/usr/include', '-I/umc/blogic/olpc/staging_dir/i386/include', '-fPIC'] + cc_args + [src, '-o', obj] + ++ extra_postargs, display = display) ++ else: + self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + + extra_postargs, display = display) + except DistutilsExecError, msg: +diff -urN numpy-1.0.4/numpy/numarray/_capi.c numpy-1.0.4.patched/numpy/numarray/_capi.c +--- numpy-1.0.4/numpy/numarray/_capi.c 2007-11-07 22:05:16.000000000 +0000 ++++ numpy-1.0.4.patched/numpy/numarray/_capi.c 2008-05-25 11:07:14.000000000 +0100 +@@ -5,7 +5,7 @@ + #include + + #if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__) +-#include ++#include "numpy/fenv/fenv.h" + #elif defined(__CYGWIN__) + #include "numpy/fenv/fenv.h" + #include "numpy/fenv/fenv.c" +diff -urN numpy-1.0.4.p2/numpy/core/setup.py numpy-1.0.4/numpy/core/setup.py +--- numpy-1.0.4.p2/numpy/core/setup.py 2008-05-25 11:18:19.000000000 +0100 ++++ numpy-1.0.4/numpy/core/setup.py 2008-05-25 11:18:52.000000000 +0100 +@@ -6,13 +6,11 @@ + from distutils.dep_util import newer + + FUNCTIONS_TO_CHECK = [ +- ('expl', 'HAVE_LONGDOUBLE_FUNCS'), + ('expf', 'HAVE_FLOAT_FUNCS'), + ('log1p', 'HAVE_LOG1P'), + ('expm1', 'HAVE_EXPM1'), + ('asinh', 'HAVE_INVERSE_HYPERBOLIC'), + ('atanhf', 'HAVE_INVERSE_HYPERBOLIC_FLOAT'), +- ('atanhl', 'HAVE_INVERSE_HYPERBOLIC_LONGDOUBLE'), + ('isnan', 'HAVE_ISNAN'), + ('isinf', 'HAVE_ISINF'), + ('rint', 'HAVE_RINT'), diff --git a/lang/perl-compress-bzip2/Makefile b/lang/perl-compress-bzip2/Makefile new file mode 100644 index 0000000..940749a --- /dev/null +++ b/lang/perl-compress-bzip2/Makefile @@ -0,0 +1,39 @@ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=perl-compress-bzip2 +PKG_VERSION:=2.09 +PKG_RELEASE:=3 +PKG_MD5SUM:=1699fde3e86f2a036f135ae606d456bf + +PKG_SOURCE_URL:=http://search.cpan.org/CPAN/authors/id/A/AR/ARJAY +PKG_SOURCE:=Compress-Bzip2-$(PKG_VERSION).tar.gz + +PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Compress-Bzip2-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../perl/perlmod.mk + +define Package/perl-compress-bzip2 + SUBMENU:=Perl + SECTION:=lang + CATEGORY:=Languages + TITLE:=Perl interface to bzip2 compression library + URL:=http://search.cpan.org/dist/Compress-Bzip2/ + DEPENDS:=perl +libbz2 +endef + +define Build/Configure + $(call perlmod/Configure,,BUILD_BZLIB=0) +endef + +define Build/Compile + $(call perlmod/Compile,,) +endef + +define Package/perl-compress-bzip2/install + $(call perlmod/Install,$(1),Compress auto/Compress) +endef + + +$(eval $(call BuildPackage,perl-compress-bzip2)) diff --git a/lang/perl-dbi/Makefile b/lang/perl-dbi/Makefile new file mode 100644 index 0000000..27a13b9 --- /dev/null +++ b/lang/perl-dbi/Makefile @@ -0,0 +1,39 @@ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=perl-dbi +PKG_VERSION:=1.604 +PKG_RELEASE:=1 +PKG_MD5SUM:=358511d60eb3daba913d49236c469802 + +PKG_SOURCE_URL:=http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/ +PKG_SOURCE:=DBI-$(PKG_VERSION).tar.gz + +PKG_BUILD_DIR:=$(BUILD_DIR)/perl/DBI-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../perl/perlmod.mk + +define Package/perl-dbi +SUBMENU:=Perl +SECTION:=lang +CATEGORY:=Languages +TITLE:=Database independent interface for Perl +URL:=http://search.cpan.org/dist/DBI/ +DEPENDS:=perl +perlbase-essential +endef + +define Build/Configure + $(call perlmod/Configure,,) +endef + +define Build/Compile + $(call perlmod/Compile,,) +endef + +define Package/perl-dbi/install + $(call perlmod/Install,$(1),DB* auto/DBI,DBI/W32ODBC.pm auto/DBI/*.h) +endef + + +$(eval $(call BuildPackage,perl-dbi)) diff --git a/lang/perl-html-parser/Makefile b/lang/perl-html-parser/Makefile new file mode 100644 index 0000000..1dabc46 --- /dev/null +++ b/lang/perl-html-parser/Makefile @@ -0,0 +1,39 @@ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=perl-html-parser +PKG_VERSION:=3.56 +PKG_RELEASE:=1 +PKG_MD5SUM:=bddc432e5ed9df4d4153a62234f04fc2 + +PKG_SOURCE_URL:=http://search.cpan.org/CPAN/authors/id/G/GA/GAAS +PKG_SOURCE:=HTML-Parser-$(PKG_VERSION).tar.gz + +PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTML-Parser-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../perl/perlmod.mk + +define Package/perl-html-parser +SUBMENU:=Perl +SECTION:=lang +CATEGORY:=Languages +TITLE:=A collection of modules that parse HTML text documents +URL:=http://search.cpan.org/dist/HTML-Parser/ +DEPENDS:=perl +perl-html-tagset +perl-uri +endef + +define Build/Configure + $(call perlmod/Configure,,) +endef + +define Build/Compile + $(call perlmod/Compile,,) +endef + +define Package/perl-html-parser/install + $(call perlmod/Install,$(1),HTML auto/HTML) +endef + + +$(eval $(call BuildPackage,perl-html-parser)) diff --git a/lang/perl-html-tagset/Makefile b/lang/perl-html-tagset/Makefile new file mode 100644 index 0000000..380796e --- /dev/null +++ b/lang/perl-html-tagset/Makefile @@ -0,0 +1,39 @@ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=perl-html-tagset +PKG_VERSION:=3.20 +PKG_RELEASE:=1 +PKG_MD5SUM:=d2bfa18fe1904df7f683e96611e87437 + +PKG_SOURCE_URL:=http://search.cpan.org/CPAN/authors/id/P/PE/PETDANCE +PKG_SOURCE:=HTML-Tagset-$(PKG_VERSION).tar.gz + +PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTML-Tagset-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../perl/perlmod.mk + +define Package/perl-html-tagset +SUBMENU:=Perl +SECTION:=lang +CATEGORY:=Languages +TITLE:=Data tables pertaining to HTML +URL:=http://search.cpan.org/dist/HTML-Tagset/ +DEPENDS:=perl +endef + +define Build/Configure + $(call perlmod/Configure,,) +endef + +define Build/Compile + $(call perlmod/Compile,,) +endef + +define Package/perl-html-tagset/install + $(call perlmod/Install,$(1),HTML) +endef + + +$(eval $(call BuildPackage,perl-html-tagset)) diff --git a/lang/perl-html-tree/Makefile b/lang/perl-html-tree/Makefile new file mode 100644 index 0000000..04691d1 --- /dev/null +++ b/lang/perl-html-tree/Makefile @@ -0,0 +1,39 @@ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=perl-html-tree +PKG_VERSION:=3.23 +PKG_RELEASE:=2 +PKG_MD5SUM:=6352f50be402301f79b580dd235d7762 + +PKG_SOURCE_URL:=http://search.cpan.org/CPAN/authors/id/P/PE/PETEK +PKG_SOURCE:=HTML-Tree-$(PKG_VERSION).tar.gz + +PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTML-Tree-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../perl/perlmod.mk + +define Package/perl-html-tree +SUBMENU:=Perl +SECTION:=lang +CATEGORY:=Languages +TITLE:=represent and create HTML syntax trees +URL:=http://search.cpan.org/dist/HTML-Tree/ +DEPENDS:=perl +perl-html-parser +perl-html-tagset +endef + +define Build/Configure + $(call perlmod/Configure,,) +endef + +define Build/Compile + $(call perlmod/Compile,,) +endef + +define Package/perl-html-tree/install + $(call perlmod/Install,$(1),HTML) +endef + + +$(eval $(call BuildPackage,perl-html-tree)) diff --git a/lang/perl-lockfile-simple/Makefile b/lang/perl-lockfile-simple/Makefile new file mode 100644 index 0000000..685493e --- /dev/null +++ b/lang/perl-lockfile-simple/Makefile @@ -0,0 +1,39 @@ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=perl-lockfile-simple +PKG_VERSION:=0.206 +PKG_RELEASE:=1 +PKG_MD5SUM:=d8966c3fb799aefcaaf80f845057a1fa + +PKG_SOURCE_URL:=http://search.cpan.org/CPAN/authors/id/J/JV/JV +PKG_SOURCE:=LockFile-Simple-$(PKG_VERSION).tar.gz + +PKG_BUILD_DIR:=$(BUILD_DIR)/perl/LockFile-Simple-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../perl/perlmod.mk + +define Package/perl-lockfile-simple +SUBMENU:=Perl +SECTION:=lang +CATEGORY:=Languages +TITLE:=Simple advisory file locking +URL:=http://search.cpan.org/dist/LockFile-Simple/ +DEPENDS:=perl +endef + +define Build/Configure + $(call perlmod/Configure,,) +endef + +define Build/Compile + $(call perlmod/Compile,,) +endef + +define Package/perl-lockfile-simple/install + $(call perlmod/Install,$(1),LockFile auto/LockFile) +endef + + +$(eval $(call BuildPackage,perl-lockfile-simple)) diff --git a/lang/perl-net-telnet/Makefile b/lang/perl-net-telnet/Makefile new file mode 100644 index 0000000..9b94990 --- /dev/null +++ b/lang/perl-net-telnet/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2011 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-net-telnet +PKG_VERSION:=3.03 +PKG_RELEASE:=1 +PKG_MD5SUM:=2f7d34b09d6117baefe89d44cff9d5fc + +PKG_SOURCE_URL:=http://search.cpan.org/CPAN/authors/id/J/JR/JROGERS +PKG_SOURCE:=Net-Telnet-$(PKG_VERSION).tar.gz + +PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Net-Telnet-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../perl/perlmod.mk + +define Package/perl-net-telnet +SUBMENU:=Perl +SECTION:=lang +CATEGORY:=Languages +TITLE:=Telnet client +URL:=http://search.cpan.org/~jrogers/Net-Telnet-3.03/ +DEPENDS:=perl +endef + +define Build/Configure + $(call perlmod/Configure,,) +endef + +define Build/Compile + $(call perlmod/Compile,,) +endef + +define Package/perl-net-telnet/install + $(call perlmod/Install,$(1),Net auto/Net) +endef + +$(eval $(call BuildPackage,perl-net-telnet)) diff --git a/lang/perl-uri/Makefile b/lang/perl-uri/Makefile new file mode 100644 index 0000000..d6938bf --- /dev/null +++ b/lang/perl-uri/Makefile @@ -0,0 +1,39 @@ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=perl-uri +PKG_VERSION:=1.36 +PKG_RELEASE:=1 +PKG_MD5SUM:=a97bbdd38b31c6b2672fdc3060fae34b + +PKG_SOURCE_URL:=http://search.cpan.org/CPAN/authors/id/G/GA/GAAS +PKG_SOURCE:=URI-$(PKG_VERSION).tar.gz + +PKG_BUILD_DIR:=$(BUILD_DIR)/perl/URI-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../perl/perlmod.mk + +define Package/perl-uri +SUBMENU:=Perl +SECTION:=lang +CATEGORY:=Languages +TITLE:=Manipulates and accesses URI strings +URL:=http://search.cpan.org/dist/URI/ +DEPENDS:=perl +endef + +define Build/Configure + $(call perlmod/Configure,,) +endef + +define Build/Compile + $(call perlmod/Compile,,) +endef + +define Package/perl-uri/install + $(call perlmod/Install,$(1),URI URI.pm) +endef + + +$(eval $(call BuildPackage,perl-uri)) diff --git a/lang/perl-www-curl/Makefile b/lang/perl-www-curl/Makefile new file mode 100644 index 0000000..4ada0f6 --- /dev/null +++ b/lang/perl-www-curl/Makefile @@ -0,0 +1,39 @@ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=perl-www-curl +PKG_VERSION:=4.00 +PKG_RELEASE:=1 +PKG_MD5SUM:=f34eb29f59a811869a4f77bfc0df2f5d + +PKG_SOURCE_URL:=http://search.cpan.org/CPAN/authors/id/S/SZ/SZBALINT +PKG_SOURCE:=WWW-Curl-$(PKG_VERSION).tar.gz + +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 +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 index 0000000..2b31454 --- /dev/null +++ b/lang/perl-www-curl/patches/100-perl-www-curl_disable_curl-config_hack.patch @@ -0,0 +1,11 @@ +--- WWW-Curl-4.00.config/Makefile.PL 2008-04-21 23:18:39.000000000 +0200 ++++ WWW-Curl-4.00/Makefile.PL 2008-04-21 23:18:52.000000000 +0200 +@@ -11,7 +11,7 @@ + no_index directory => 'template'; + # This is a hack. If you have libcurl installed, just specify curl.h below + # and comment out this line. +-requires_external_bin 'curl-config'; ++#requires_external_bin 'curl-config'; + + # This utility helper generates the constants function from curl.h + # It is normally only used by the maintainer, but if you're curl is older diff --git a/lang/perl-www-mechanize/Makefile b/lang/perl-www-mechanize/Makefile new file mode 100644 index 0000000..a1ad32f --- /dev/null +++ b/lang/perl-www-mechanize/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=perl-www-mechanize +PKG_VERSION:=1.58 +PKG_RELEASE:=1 + +PKG_SOURCE:=WWW-Mechanize-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://search.cpan.org/CPAN/authors/id/P/PE/PETDANCE/ +PKG_MD5SUM:=c928d1bf3218bfe0c0d99096cf34db52 + +PKG_BUILD_DIR:=$(BUILD_DIR)/perl/WWW-Mechanize-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../perl/perlmod.mk + +define Package/perl-www-mechanize + SUBMENU:=Perl + SECTION:=lang + CATEGORY:=Languages + TITLE:=Perl WWW Mechanize + URL:=http://search.cpan.org/dist/WWW-Mechanize/ + DEPENDS:=perl +perl-www +endef + +define Build/Configure + $(call perlmod/Configure,$(STAGING_DIR)/usr/include,) +endef + +define Build/Compile + $(call perlmod/Compile,,) +endef + +define Package/perl-www-mechanize/install + $(call perlmod/Install,$(1),WWW/Mechanize WWW/Mechanize.pm) +endef + +$(eval $(call BuildPackage,perl-www-mechanize)) diff --git a/lang/perl-www/Makefile b/lang/perl-www/Makefile new file mode 100644 index 0000000..ca8b431 --- /dev/null +++ b/lang/perl-www/Makefile @@ -0,0 +1,39 @@ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=perl-www +PKG_VERSION:=5.812 +PKG_RELEASE:=1 +PKG_MD5SUM:=86c6121170efe55fc0d33cdc967561bc + +PKG_SOURCE_URL:=http://search.cpan.org/CPAN/authors/id/G/GA/GAAS +PKG_SOURCE:=libwww-perl-$(PKG_VERSION).tar.gz + +PKG_BUILD_DIR:=$(BUILD_DIR)/perl/libwww-perl-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../perl/perlmod.mk + +define Package/perl-www +SUBMENU:=Perl +SECTION:=lang +CATEGORY:=Languages +TITLE:=WWW client/server library for Perl (aka LWP) +URL:=http://search.cpan.org/dist/libwww-perl/ +DEPENDS:=perl +perl-html-parser +perl-uri +endef + +define Build/Configure + $(call perlmod/Configure,-n,) +endef + +define Build/Compile + $(call perlmod/Compile,,) +endef + +define Package/perl-www/install + $(call perlmod/Install,$(1),File HTML HTTP LWP LWP.pm Net WWW) +endef + + +$(eval $(call BuildPackage,perl-www)) diff --git a/lang/perl/Makefile b/lang/perl/Makefile new file mode 100644 index 0000000..b059ac4 --- /dev/null +++ b/lang/perl/Makefile @@ -0,0 +1,200 @@ +# +# Copyright (C) 2006-2011 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 +PKG_VERSION:=5.10.0 +PKG_RELEASE:=7 +PKG_MD5SUM:=d2c39b002ebfd2c3c5dba589365c5a71 + +PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \ + ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \ + ftp://ftp.gmd.de/mirrors/CPAN/src/5.0 \ + ftp://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz + +PKG_BUILD_DIR:=$(BUILD_DIR)/perl/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +ifneq ($(CONFIG_USE_EGLIBC),) +EXTRA_LIBS:=bsd +EXTRA_LIBDIRS:=$(STAGING_DIR)/lib +endif + +define Package/perl/Default + SUBMENU:=Perl + SECTION:=lang + CATEGORY:=Languages + TITLE:=The Perl intepreter + URL:=http://www.perl.com/ + DEPENDS:=+USE_EGLIBC:libbsd +endef + +define Package/microperl +$(call Package/perl/Default) + TITLE+=(minimal version) +endef + +define Package/microperl/description + A perl package without operating-specific functions such as readdir. +endef + +define Build/Template + +$(STAMP_CONFIGURED)-$(1): $(STAMP_PREPARED) + -$(MAKE) -C $(PKG_BUILD_DIR) clean + $(call Build/$(1)/Configure) + touch $$@ + +$(STAMP_BUILT)-$(1): $(STAMP_CONFIGURED)-$(1) + $(call Build/$(1)/Compile) + touch $$@ + +$(STAMP_BUILT): $(STAMP_BUILT)-$(1) + +endef + +define Build/microperl/Configure +endef + +define Build/microperl/Compile + $(MAKE) -C $(PKG_BUILD_DIR) -f Makefile.micro \ + CC="$(TARGET_CC)" OPTIMIZE="$(TARGET_CFLAGS)" + $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/microperl $(PKG_INSTALL_DIR)/usr/bin/ +endef + +define Package/microperl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/microperl $(1)/usr/bin/ +endef + +include perlmod.mk + +define Package/perl +$(call Package/perl/Default) +endef + +define Package/perl/description + Perl is a stable, cross platform programming language. + It is used for mission critical projects in the public and private sectors + and is widely used to program web applications of all needs. +endef + +define Build/perl/Configure + @echo + @echo "===> Stage 1: Configure host perl" + @echo + mkdir -p $(PKG_BUILD_DIR)/host-perl + (cd $(PKG_BUILD_DIR)/host-perl && sh ../Configure -der -Dmksymlinks -Uusedl -Dotherlibdirs=$(PERL_LIB)) + + @echo + @echo "===> Stage 2: Build host perl binary with static extensions" + @echo + $(MAKE) -C $(PKG_BUILD_DIR)/host-perl + + @echo + @echo "===> Stage 3: Configure target perl" + @echo + -$(MAKE) -C $(PKG_BUILD_DIR) clean + sed \ + -e 's!%%CC%%!$(TARGET_CC)!g' \ + -e 's!%%CFLAGS%%!$(TARGET_CFLAGS) -DUSE_CROSS_COMPILE $(TARGET_CPPFLAGS)!g' \ + -e 's!%%CPP%%!$(TARGET_CROSS)gcc -E!g' \ + -e 's!%%AR%%!$(TARGET_CROSS)ar!g' \ + -e 's!%%LD%%!$(TARGET_CROSS)gcc!g' \ + -e 's!%%LDFLAGS%%!-rdynamic $(TARGET_LDFLAGS)!g' \ + -e 's!%%LIBDIRS%%!$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib!g' \ + -e 's!%%INCDIRS%%!$(STAGING_DIR)/include $(STAGING_DIR)/usr/include!g' \ + -e 's!%%EXTRA_PERLLIBS%%!$(EXTRA_LIBS:%=-l%)!g' \ + -e 's!%%EXTRA_PERLLIBDIRS%%!$(EXTRA_LIBDIRS:%=-L%)!g' \ + files/config.sh-$(patsubst i386,i486,$(ARCH)).in \ + > $(PKG_BUILD_DIR)/config.sh + (cd $(PKG_BUILD_DIR) && ./Configure -S) +endef + +define Build/perl/Compile + @echo + @echo "===> Stage 4: Build target miniperl binary" + @echo + install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h + -rm -f $(PKG_BUILD_DIR)/miniperl + $(MAKE) -C $(PKG_BUILD_DIR) miniperl + mkdir -p $(PKG_BUILD_DIR)/target-bin + install -m 0755 $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/target-bin/ + + @echo + @echo "===> Stage 5: Build target perl binary" + @echo + -rm -f $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/perl + install -m 0755 $(PKG_BUILD_DIR)/host-perl/miniperl $(PKG_BUILD_DIR)/ + touch $(PKG_BUILD_DIR)/miniperl + $(MAKE) -C $(PKG_BUILD_DIR) perl + install -m 0755 $(PKG_BUILD_DIR)/perl $(PKG_BUILD_DIR)/target-bin/ + + @echo + @echo "===> Stage 6: Build target extensions and utils" + @echo + -rm -f $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/perl + install -m 0755 $(PKG_BUILD_DIR)/host-perl/miniperl $(PKG_BUILD_DIR)/ + ln -sf miniperl $(PKG_BUILD_DIR)/perl + touch $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/perl + $(MAKE) -C $(PKG_BUILD_DIR) + + @echo + @echo "===> Stage 7: Install Perl into staging dir" + @echo + -rm -f $(PKG_BUILD_DIR)/perl + $(INSTALL_BIN) $(PKG_BUILD_DIR)/host-perl/perl $(PKG_BUILD_DIR)/ + (cd $(PKG_BUILD_DIR) && ./perl installperl --destdir=$(STAGING_DIR)) + + @echo + @echo "===> Stage 8: Install Perl into a temporary root" + @echo + -rm -f $(PKG_BUILD_DIR)/perl + $(INSTALL_BIN) $(PKG_BUILD_DIR)/target-bin/perl $(PKG_BUILD_DIR) + -rm -rf $(PKG_INSTALL_DIR) + mkdir -p $(PKG_INSTALL_DIR) + (cd $(PKG_BUILD_DIR) && host-perl/miniperl installperl --destdir=$(PKG_INSTALL_DIR)) +endef + +define Package/perl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/perl$(PKG_VERSION) $(1)/usr/bin + ln -nsf perl$(PKG_VERSION) $(1)/usr/bin/perl +endef + +ifneq ($(CONFIG_PACKAGE_microperl),) +define Build/microperl + $(call Build/Template,microperl) +endef +endif +$(eval $(Build/microperl)) + +ifneq ($(CONFIG_PACKAGE_perl),) +define Build/perl + $(call Build/Template,perl) +endef +endif +$(eval $(Build/perl)) + +define Build/Configure +endef + +define Build/Compile +endef + +$(eval $(call RequireCommand,rsync, \ + $(PKG_NAME) requires rsync installed on the host-system. \ +)) + +$(eval $(call BuildPackage,microperl)) +$(eval $(call BuildPackage,perl)) + +-include perlbase.mk diff --git a/lang/perl/files/Module/ScanDeps.pm b/lang/perl/files/Module/ScanDeps.pm new file mode 100644 index 0000000..4f3a7d5 --- /dev/null +++ b/lang/perl/files/Module/ScanDeps.pm @@ -0,0 +1,1083 @@ +package Module::ScanDeps; + +use 5.004; +use strict; +use vars qw( $VERSION @EXPORT @EXPORT_OK $CurrentPackage ); + +$VERSION = '0.62'; +@EXPORT = qw( scan_deps scan_deps_runtime ); +@EXPORT_OK = qw( scan_line scan_chunk add_deps scan_deps_runtime ); + +use Config; +use Exporter; +use base 'Exporter'; +use constant dl_ext => ".$Config{dlext}"; +use constant lib_ext => $Config{lib_ext}; +use constant is_insensitive_fs => ( + -s $0 + and (-s lc($0) || -1) == (-s uc($0) || -1) + and (-s lc($0) || -1) == -s $0 +); + +use Cwd (); +use File::Path (); +use File::Temp (); +use File::Basename (); +use FileHandle; + +=head1 NAME + +Module::ScanDeps - Recursively scan Perl code for dependencies + +=head1 VERSION + +This document describes version 0.61 of Module::ScanDeps, released +June 30, 2006. + +=head1 SYNOPSIS + +Via the command-line program L: + + % scandeps.pl *.pm # Print PREREQ_PM section for *.pm + % scandeps.pl -e "use utf8" # Read script from command line + % scandeps.pl -B *.pm # Include core modules + % scandeps.pl -V *.pm # Show autoload/shared/data files + +Used in a program; + + use Module::ScanDeps; + + # standard usage + my $hash_ref = scan_deps( + files => [ 'a.pl', 'b.pl' ], + recurse => 1, + ); + + # shorthand; assume recurse == 1 + my $hash_ref = scan_deps( 'a.pl', 'b.pl' ); + + # App::Packer::Frontend compatible interface + # see App::Packer::Frontend for the structure returned by get_files + my $scan = Module::ScanDeps->new; + $scan->set_file( 'a.pl' ); + $scan->set_options( add_modules => [ 'Test::More' ] ); + $scan->calculate_info; + my $files = $scan->get_files; + +=head1 DESCRIPTION + +This module scans potential modules used by perl programs, and returns a +hash reference; its keys are the module names as appears in C<%INC> +(e.g. C); the values are hash references with this structure: + + { + file => '/usr/local/lib/perl5/5.8.0/Test/More.pm', + key => 'Test/More.pm', + type => 'module', # or 'autoload', 'data', 'shared' + used_by => [ 'Test/Simple.pm', ... ], + } + +One function, C, is exported by default. Three other +functions (C, C, C) are exported upon +request. + +Users of B may also use this module as the dependency-checking +frontend, by tweaking their F like below: + + use Module::ScanDeps; + ... + my $packer = App::Packer->new( frontend => 'Module::ScanDeps' ); + ... + +Please see L for detailed explanation on +the structure returned by C. + +=head2 B + + $rv_ref = scan_deps( + files => \@files, recurse => $recurse, + rv => \%rv, skip => \%skip, + compile => $compile, execute => $execute, + ); + $rv_ref = scan_deps(@files); # shorthand, with recurse => 1 + +This function scans each file in C<@files>, registering their +dependencies into C<%rv>, and returns a reference to the updated +C<%rv>. The meaning of keys and values are explained above. + +If C<$recurse> is true, C will call itself recursively, +to perform a breadth-first search on text files (as defined by the +-T operator) found in C<%rv>. + +If the C<\%skip> is specified, files that exists as its keys are +skipped. This is used internally to avoid infinite recursion. + +If C<$compile> or C<$execute> is true, runs C in either +compile-only or normal mode, then inspects their C<%INC> after +termination to determine additional runtime dependencies. + +If C<$execute> is an array reference, runs the files contained +in it instead of C<@files>. + +=head2 B + +Like B, but skips the static scanning part. + +=head2 B + + @modules = scan_line($line); + +Splits a line into chunks (currently with the semicolon characters), and +return the union of C calls of them. + +If the line is C<__END__> or C<__DATA__>, a single C<__END__> element is +returned to signify the end of the program. + +Similarly, it returns a single C<__POD__> if the line matches C; +the caller is responsible for skipping appropriate number of lines +until C<=cut>, before calling C again. + +=head2 B + + $module = scan_chunk($chunk); + @modules = scan_chunk($chunk); + +Apply various heuristics to C<$chunk> to find and return the module +name(s) it contains. In scalar context, returns only the first module +or C. + +=head2 B + + $rv_ref = add_deps( rv => \%rv, modules => \@modules ); + $rv_ref = add_deps( @modules ); # shorthand, without rv + +Resolves a list of module names to its actual on-disk location, by +finding in C<@INC>; modules that cannot be found are skipped. + +This function populates the C<%rv> hash with module/filename pairs, and +returns a reference to it. + +=head1 CAVEATS + +This module intentially ignores the B hack on FreeBSD -- the +additional directory is removed from C<@INC> altogether. + +The static-scanning heuristic is not likely to be 100% accurate, especially +on modules that dynamically load other modules. + +Chunks that span multiple lines are not handled correctly. For example, +this one works: + + use base 'Foo::Bar'; + +But this one does not: + + use base + 'Foo::Bar'; + +=cut + +my $SeenTk; + +# Pre-loaded module dependencies {{{ +my %Preload = ( + 'AnyDBM_File.pm' => [qw( SDBM_File.pm )], + 'Authen/SASL.pm' => 'sub', + 'Bio/AlignIO.pm' => 'sub', + 'Bio/Assembly/IO.pm' => 'sub', + 'Bio/Biblio/IO.pm' => 'sub', + 'Bio/ClusterIO.pm' => 'sub', + 'Bio/CodonUsage/IO.pm' => 'sub', + 'Bio/DB/Biblio.pm' => 'sub', + 'Bio/DB/Flat.pm' => 'sub', + 'Bio/DB/GFF.pm' => 'sub', + 'Bio/DB/Taxonomy.pm' => 'sub', + 'Bio/Graphics/Glyph.pm' => 'sub', + 'Bio/MapIO.pm' => 'sub', + 'Bio/Matrix/IO.pm' => 'sub', + 'Bio/Matrix/PSM/IO.pm' => 'sub', + 'Bio/OntologyIO.pm' => 'sub', + 'Bio/PopGen/IO.pm' => 'sub', + 'Bio/Restriction/IO.pm' => 'sub', + 'Bio/Root/IO.pm' => 'sub', + 'Bio/SearchIO.pm' => 'sub', + 'Bio/SeqIO.pm' => 'sub', + 'Bio/Structure/IO.pm' => 'sub', + 'Bio/TreeIO.pm' => 'sub', + 'Bio/LiveSeq/IO.pm' => 'sub', + 'Bio/Variation/IO.pm' => 'sub', + 'Crypt/Random.pm' => sub { + _glob_in_inc('Crypt/Random/Provider', 1); + }, + 'Crypt/Random/Generator.pm' => sub { + _glob_in_inc('Crypt/Random/Provider', 1); + }, + 'DBI.pm' => sub { + grep !/\bProxy\b/, _glob_in_inc('DBD', 1); + }, + 'DBIx/SearchBuilder.pm' => 'sub', + 'DBIx/ReportBuilder.pm' => 'sub', + 'Device/ParallelPort.pm' => 'sub', + 'Device/SerialPort.pm' => [ qw( + termios.ph asm/termios.ph sys/termiox.ph sys/termios.ph sys/ttycom.ph + ) ], + 'ExtUtils/MakeMaker.pm' => sub { + grep /\bMM_/, _glob_in_inc('ExtUtils', 1); + }, + 'File/Basename.pm' => [qw( re.pm )], + 'File/Spec.pm' => sub { + require File::Spec; + map { my $name = $_; $name =~ s!::!/!g; "$name.pm" } @File::Spec::ISA; + }, + 'HTTP/Message.pm' => [ qw( + URI/URL.pm URI.pm + ) ], + 'IO.pm' => [ qw( + IO/Handle.pm IO/Seekable.pm IO/File.pm + IO/Pipe.pm IO/Socket.pm IO/Dir.pm + ) ], + 'IO/Socket.pm' => [qw( IO/Socket/UNIX.pm )], + 'LWP/UserAgent.pm' => [ qw( + URI/URL.pm URI/http.pm LWP/Protocol/http.pm + LWP/Protocol/https.pm + ), _glob_in_inc("LWP/Authen", 1) ], + 'Locale/Maketext/Lexicon.pm' => 'sub', + 'Locale/Maketext/GutsLoader.pm' => [qw( Locale/Maketext/Guts.pm )], + 'Mail/Audit.pm' => 'sub', + 'Math/BigInt.pm' => 'sub', + 'Math/BigFloat.pm' => 'sub', + 'Math/Symbolic.pm' => 'sub', + 'Module/Build.pm' => 'sub', + 'Module/Pluggable.pm' => sub { + _glob_in_inc('$CurrentPackage/Plugin', 1); + }, + 'MIME/Decoder.pm' => 'sub', + 'Net/DNS/RR.pm' => 'sub', + 'Net/FTP.pm' => 'sub', + 'Net/SSH/Perl.pm' => 'sub', + 'PDF/API2/Resource/Font.pm' => 'sub', + 'PDF/API2/Basic/TTF/Font.pm' => sub { + _glob_in_inc('PDF/API2/Basic/TTF', 1); + }, + 'PDF/Writer.pm' => 'sub', + 'POE' => [ qw( + POE/Kernel.pm POE/Session.pm + ) ], + 'POE/Kernel.pm' => [ + map "POE/Resource/$_.pm", qw( + Aliases Events Extrefs FileHandles + SIDs Sessions Signals Statistics + ) + ], + 'Parse/AFP.pm' => 'sub', + 'Parse/Binary.pm' => 'sub', + 'Regexp/Common.pm' => 'sub', + 'SerialJunk.pm' => [ qw( + termios.ph asm/termios.ph sys/termiox.ph sys/termios.ph sys/ttycom.ph + ) ], + 'SOAP/Lite.pm' => sub { + (($] >= 5.008 ? ('utf8.pm') : ()), _glob_in_inc('SOAP/Transport', 1)); + }, + 'SQL/Parser.pm' => sub { + _glob_in_inc('SQL/Dialects', 1); + }, + 'SVK/Command.pm' => sub { + _glob_in_inc('SVK', 1); + }, + 'SVN/Core.pm' => sub { + _glob_in_inc('SVN', 1), + map "auto/SVN/$_->{name}", _glob_in_inc('auto/SVN'), + }, + 'Template.pm' => 'sub', + 'Term/ReadLine.pm' => 'sub', + 'Test/Deep.pm' => 'sub', + 'Tk.pm' => sub { + $SeenTk = 1; + qw( Tk/FileSelect.pm Encode/Unicode.pm ); + }, + 'Tk/Balloon.pm' => [qw( Tk/balArrow.xbm )], + 'Tk/BrowseEntry.pm' => [qw( Tk/cbxarrow.xbm Tk/arrowdownwin.xbm )], + 'Tk/ColorEditor.pm' => [qw( Tk/ColorEdit.xpm )], + 'Tk/DragDrop/Common.pm' => sub { + _glob_in_inc('Tk/DragDrop', 1), + }, + 'Tk/FBox.pm' => [qw( Tk/folder.xpm Tk/file.xpm )], + 'Tk/Getopt.pm' => [qw( Tk/openfolder.xpm Tk/win.xbm )], + 'Tk/Toplevel.pm' => [qw( Tk/Wm.pm )], + 'URI.pm' => sub { + grep !/.\b[_A-Z]/, _glob_in_inc('URI', 1); + }, + 'Win32/EventLog.pm' => [qw( Win32/IPC.pm )], + 'Win32/Exe.pm' => 'sub', + 'Win32/TieRegistry.pm' => [qw( Win32API/Registry.pm )], + 'Win32/SystemInfo.pm' => [qw( Win32/cpuspd.dll )], + 'XML/Parser.pm' => sub { + _glob_in_inc('XML/Parser/Style', 1), + _glob_in_inc('XML/Parser/Encodings', 1), + }, + 'XML/Parser/Expat.pm' => sub { + ($] >= 5.008) ? ('utf8.pm') : (); + }, + 'XML/SAX.pm' => [qw( XML/SAX/ParserDetails.ini ) ], + 'XMLRPC/Lite.pm' => sub { + _glob_in_inc('XMLRPC/Transport', 1),; + }, + 'diagnostics.pm' => sub { + # shamelessly taken and adapted from diagnostics.pm + use Config; + my($privlib, $archlib) = @Config{qw(privlibexp archlibexp)}; + if ($^O eq 'VMS') { + require VMS::Filespec; + $privlib = VMS::Filespec::unixify($privlib); + $archlib = VMS::Filespec::unixify($archlib); + } + + for ( + "pod/perldiag.pod", + "Pod/perldiag.pod", + "pod/perldiag-$Config{version}.pod", + "Pod/perldiag-$Config{version}.pod", + "pods/perldiag.pod", + "pods/perldiag-$Config{version}.pod", + ) { + return $_ if _find_in_inc($_); + } + + for ( + "$archlib/pods/perldiag.pod", + "$privlib/pods/perldiag-$Config{version}.pod", + "$privlib/pods/perldiag.pod", + ) { + return $_ if -f $_; + } + + return 'pod/perldiag.pod'; + }, + 'utf8.pm' => [ + 'utf8_heavy.pl', do { + my $dir = 'unicore'; + my @subdirs = qw( To ); + my @files = map "$dir/lib/$_->{name}", _glob_in_inc("$dir/lib"); + + if (@files) { + # 5.8.x + push @files, (map "$dir/$_.pl", qw( Exact Canonical )); + } + else { + # 5.6.x + $dir = 'unicode'; + @files = map "$dir/Is/$_->{name}", _glob_in_inc("$dir/Is") + or return; + push @subdirs, 'In'; + } + + foreach my $subdir (@subdirs) { + foreach (_glob_in_inc("$dir/$subdir")) { + push @files, "$dir/$subdir/$_->{name}"; + } + } + @files; + } + ], + 'charnames.pm' => [ + _find_in_inc('unicore/Name.pl') ? 'unicore/Name.pl' : 'unicode/Name.pl' + ], +); + +# }}} + +my $Keys = 'files|keys|recurse|rv|skip|first|execute|compile'; +sub scan_deps { + my %args = ( + rv => {}, + (@_ and $_[0] =~ /^(?:$Keys)$/o) ? @_ : (files => [@_], recurse => 1) + ); + + scan_deps_static(\%args); + + if ($args{execute} or $args{compile}) { + scan_deps_runtime( + rv => $args{rv}, + files => $args{files}, + execute => $args{execute}, + compile => $args{compile}, + skip => $args{skip} + ); + } + + return ($args{rv}); +} + +sub scan_deps_static { + my ($args) = @_; + my ($files, $keys, $recurse, $rv, $skip, $first, $execute, $compile) = + @$args{qw( files keys recurse rv skip first execute compile )}; + + $rv ||= {}; + $skip ||= {}; + + foreach my $file (@{$files}) { + my $key = shift @{$keys}; + next if $skip->{$file}++; + next if is_insensitive_fs() + and $file ne lc($file) and $skip->{lc($file)}++; + + local *FH; + open FH, $file or die "Cannot open $file: $!"; + + $SeenTk = 0; + + # Line-by-line scanning + LINE: + while () { + chomp(my $line = $_); + foreach my $pm (scan_line($line)) { + last LINE if $pm eq '__END__'; + + if ($pm eq '__POD__') { + while () { last if (/^=cut/) } + next LINE; + } + + $pm = 'CGI/Apache.pm' if /^Apache(?:\.pm)$/; + + add_deps( + used_by => $key, + rv => $rv, + modules => [$pm], + skip => $skip + ); + + my $preload = $Preload{$pm} or next; + if ($preload eq 'sub') { + $pm =~ s/\.p[mh]$//i; + $preload = [ _glob_in_inc($pm, 1) ]; + } + elsif (UNIVERSAL::isa($preload, 'CODE')) { + $preload = [ $preload->($pm) ]; + } + + add_deps( + used_by => $key, + rv => $rv, + modules => $preload, + skip => $skip + ); + } + } + close FH; + + # }}} + } + + # Top-level recursion handling {{{ + while ($recurse) { + my $count = keys %$rv; + my @files = sort grep -T $_->{file}, values %$rv; + scan_deps_static({ + files => [ map $_->{file}, @files ], + keys => [ map $_->{key}, @files ], + rv => $rv, + skip => $skip, + recurse => 0, + }) or ($args->{_deep} and return); + last if $count == keys %$rv; + } + + # }}} + + return $rv; +} + +sub scan_deps_runtime { + my %args = ( + perl => $^X, + rv => {}, + (@_ and $_[0] =~ /^(?:$Keys)$/o) ? @_ : (files => [@_], recurse => 1) + ); + my ($files, $rv, $execute, $compile, $skip, $perl) = + @args{qw( files rv execute compile skip perl )}; + + $files = (ref($files)) ? $files : [$files]; + + my ($inchash, $incarray, $dl_shared_objects) = ({}, [], []); + if ($compile) { + my $file; + + foreach $file (@$files) { + ($inchash, $dl_shared_objects, $incarray) = ({}, [], []); + _compile($perl, $file, $inchash, $dl_shared_objects, $incarray); + + my $rv_sub = _make_rv($inchash, $dl_shared_objects, $incarray); + _merge_rv($rv_sub, $rv); + } + } + elsif ($execute) { + my $excarray = (ref($execute)) ? $execute : [@$files]; + my $exc; + my $first_flag = 1; + foreach $exc (@$excarray) { + ($inchash, $dl_shared_objects, $incarray) = ({}, [], []); + _execute( + $perl, $exc, $inchash, $dl_shared_objects, $incarray, + $first_flag + ); + $first_flag = 0; + } + + my $rv_sub = _make_rv($inchash, $dl_shared_objects, $incarray); + _merge_rv($rv_sub, $rv); + } + + return ($rv); +} + +sub scan_line { + my $line = shift; + my %found; + + return '__END__' if $line =~ /^__(?:END|DATA)__$/; + return '__POD__' if $line =~ /^=\w/; + + $line =~ s/\s*#.*$//; + $line =~ s/[\\\/]+/\//g; + + foreach (split(/;/, $line)) { + if (/^\s*package\s+(\w+)/) { + $CurrentPackage = $1; + $CurrentPackage =~ s{::}{/}g; + return; + } + return if /^\s*(use|require)\s+[\d\._]+/; + if (my ($autouse) = /^\s*use\s+autouse\s+(["'].*?["']|\w+)/) + { + $autouse =~ s/["']//g; + $autouse =~ s{::}{/}g; + return ("autouse.pm", "$autouse.pm"); + } + + if (my ($libs) = /\b(?:use\s+lib\s+|(?:unshift|push)\W+\@INC\W+)(.+)/) + { + my $archname = + defined($Config{archname}) ? $Config{archname} : ''; + my $ver = defined($Config{version}) ? $Config{version} : ''; + foreach (grep(/\w/, split(/["';() ]/, $libs))) { + unshift(@INC, "$_/$ver") if -d "$_/$ver"; + unshift(@INC, "$_/$archname") if -d "$_/$archname"; + unshift(@INC, "$_/$ver/$archname") if -d "$_/$ver/$archname"; + } + next; + } + + $found{$_}++ for scan_chunk($_); + } + + return sort keys %found; +} + +sub scan_chunk { + my $chunk = shift; + + # Module name extraction heuristics {{{ + my $module = eval { + $_ = $chunk; + + return [ 'base.pm', + map { s{::}{/}g; "$_.pm" } + grep { length and !/^q[qw]?$/ } split(/[^\w:]+/, $1) ] + if /^\s* use \s+ base \s+ (.*)/sx; + + return [ 'Class/Autouse.pm', + map { s{::}{/}g; "$_.pm" } + grep { length and !/^:|^q[qw]?$/ } split(/[^\w:]+/, $1) ] + if /^\s* use \s+ Class::Autouse \s+ (.*)/sx + or /^\s* Class::Autouse \s* -> \s* autouse \s* (.*)/sx; + + return [ 'POE.pm', + map { s{::}{/}g; "POE/$_.pm" } + grep { length and !/^q[qw]?$/ } split(/[^\w:]+/, $1) ] + if /^\s* use \s+ POE \s+ (.*)/sx; + + return [ 'encoding.pm', + map { _find_encoding($_) } + grep { length and !/^q[qw]?$/ } split(/[^\w:-]+/, $1) ] + if /^\s* use \s+ encoding \s+ (.*)/sx; + + return $1 if /(?:^|\s)(?:use|no|require)\s+([\w:\.\-\\\/\"\']+)/; + return $1 + if /(?:^|\s)(?:use|no|require)\s+\(\s*([\w:\.\-\\\/\"\']+)\s*\)/; + + if ( s/(?:^|\s)eval\s+\"([^\"]+)\"/$1/ + or s/(?:^|\s)eval\s*\(\s*\"([^\"]+)\"\s*\)/$1/) + { + return $1 if /(?:^|\s)(?:use|no|require)\s+([\w:\.\-\\\/\"\']*)/; + } + + return "File/Glob.pm" if /<[^>]*[^\$\w>][^>]*>/; + return "DBD/$1.pm" if /\b[Dd][Bb][Ii]:(\w+):/; + if (/(?:(:encoding)|\b(?:en|de)code)\(\s*['"]?([-\w]+)/) { + my $mod = _find_encoding($2); + return [ 'PerlIO.pm', $mod ] if $1 and $mod; + return $mod if $mod; + } + return $1 if /(?:^|\s)(?:do|require)\s+[^"]*"(.*?)"/; + return $1 if /(?:^|\s)(?:do|require)\s+[^']*'(.*?)'/; + return $1 if /[^\$]\b([\w:]+)->\w/ and $1 ne 'Tk'; + return $1 if /\b(\w[\w:]*)::\w+\(/; + + if ($SeenTk) { + my @modules; + while (/->\s*([A-Z]\w+)/g) { + push @modules, "Tk/$1.pm"; + } + while (/->\s*Scrolled\W+([A-Z]\w+)/g) { + push @modules, "Tk/$1.pm"; + push @modules, "Tk/Scrollbar.pm"; + } + return \@modules; + } + return; + }; + + # }}} + + return unless defined($module); + return wantarray ? @$module : $module->[0] if ref($module); + + $module =~ s/^['"]//; + return unless $module =~ /^\w/; + + $module =~ s/\W+$//; + $module =~ s/::/\//g; + return if $module =~ /^(?:[\d\._]+|'.*[^']|".*[^"])$/; + + $module .= ".pm" unless $module =~ /\./; + return $module; +} + +sub _find_encoding { + return unless $] >= 5.008 and eval { require Encode; %Encode::ExtModule }; + + my $mod = $Encode::ExtModule{ Encode::find_encoding($_[0])->name } + or return; + $mod =~ s{::}{/}g; + return "$mod.pm"; +} + +sub _add_info { + my ($rv, $module, $file, $used_by, $type) = @_; + return unless defined($module) and defined($file); + + $rv->{$module} ||= { + file => $file, + key => $module, + type => $type, + }; + + push @{ $rv->{$module}{used_by} }, $used_by + if defined($used_by) + and $used_by ne $module + and !grep { $_ eq $used_by } @{ $rv->{$module}{used_by} }; +} + +sub add_deps { + my %args = + ((@_ and $_[0] =~ /^(?:modules|rv|used_by)$/) + ? @_ + : (rv => (ref($_[0]) ? shift(@_) : undef), modules => [@_])); + + my $rv = $args{rv} || {}; + my $skip = $args{skip} || {}; + my $used_by = $args{used_by}; + + foreach my $module (@{ $args{modules} }) { + if (exists $rv->{$module}) { + _add_info($rv, undef, undef, $used_by, undef); + next; + } + + my $file = _find_in_inc($module) or next; + next if $skip->{$file}; + next if is_insensitive_fs() and $skip->{lc($file)}; + + my $type = 'module'; + $type = 'data' unless $file =~ /\.p[mh]$/i; + _add_info($rv, $module, $file, $used_by, $type); + + if ($module =~ /(.*?([^\/]*))\.p[mh]$/i) { + my ($path, $basename) = ($1, $2); + + foreach (_glob_in_inc("auto/$path")) { + next if $skip->{$_->{file}}; + next if is_insensitive_fs() and $skip->{lc($_->{file})}; + next if $_->{file} =~ m{\bauto/$path/.*/}; # weed out subdirs + next if $_->{name} =~ m/(?:^|\/)\.(?:exists|packlist)$/; + my $ext = lc($1) if $_->{name} =~ /(\.[^.]+)$/; + next if $ext eq lc(lib_ext()); + my $type = 'shared' if $ext eq lc(dl_ext()); + $type = 'autoload' if $ext eq '.ix' or $ext eq '.al'; + $type ||= 'data'; + + _add_info($rv, "auto/$path/$_->{name}", $_->{file}, $module, + $type); + } + } + } + + return $rv; +} + +sub _find_in_inc { + my $file = shift; + + # absolute file names + return $file if -f $file; + + foreach my $dir (grep !/\bBSDPAN\b/, @INC) { + return "$dir/$file" if -f "$dir/$file"; + } + return; +} + +sub _glob_in_inc { + my $subdir = shift; + my $pm_only = shift; + my @files; + + require File::Find; + + $subdir =~ s/\$CurrentPackage/$CurrentPackage/; + + foreach my $dir (map "$_/$subdir", grep !/\bBSDPAN\b/, @INC) { + next unless -d $dir; + File::Find::find( + sub { + my $name = $File::Find::name; + $name =~ s!^\Q$dir\E/!!; + return if $pm_only and lc($name) !~ /\.p[mh]$/i; + push @files, $pm_only + ? "$subdir/$name" + : { file => $File::Find::name, + name => $name, + } + if -f; + }, + $dir + ); + } + + return @files; +} + +# App::Packer compatibility functions + +sub new { + my ($class, $self) = @_; + return bless($self ||= {}, $class); +} + +sub set_file { + my $self = shift; + foreach my $script (@_) { + my $basename = $script; + $basename =~ s/.*\///; + $self->{main} = { + key => $basename, + file => $script, + }; + } +} + +sub set_options { + my $self = shift; + my %args = @_; + foreach my $module (@{ $args{add_modules} }) { + $module =~ s/::/\//g; + $module .= '.pm' unless $module =~ /\.p[mh]$/i; + my $file = _find_in_inc($module) or next; + $self->{files}{$module} = $file; + } +} + +sub calculate_info { + my $self = shift; + my $rv = scan_deps( + keys => [ $self->{main}{key}, sort keys %{ $self->{files} }, ], + files => [ $self->{main}{file}, + map { $self->{files}{$_} } sort keys %{ $self->{files} }, + ], + recurse => 1, + ); + + my $info = { + main => { file => $self->{main}{file}, + store_as => $self->{main}{key}, + }, + }; + + my %cache = ($self->{main}{key} => $info->{main}); + foreach my $key (sort keys %{ $self->{files} }) { + my $file = $self->{files}{$key}; + + $cache{$key} = $info->{modules}{$key} = { + file => $file, + store_as => $key, + used_by => [ $self->{main}{key} ], + }; + } + + foreach my $key (sort keys %{$rv}) { + my $val = $rv->{$key}; + if ($cache{ $val->{key} }) { + push @{ $info->{ $val->{type} }->{ $val->{key} }->{used_by} }, + @{ $val->{used_by} }; + } + else { + $cache{ $val->{key} } = $info->{ $val->{type} }->{ $val->{key} } = + { file => $val->{file}, + store_as => $val->{key}, + used_by => $val->{used_by}, + }; + } + } + + $self->{info} = { main => $info->{main} }; + + foreach my $type (sort keys %{$info}) { + next if $type eq 'main'; + + my @val; + if (UNIVERSAL::isa($info->{$type}, 'HASH')) { + foreach my $val (sort values %{ $info->{$type} }) { + @{ $val->{used_by} } = map $cache{$_} || "!!$_!!", + @{ $val->{used_by} }; + push @val, $val; + } + } + + $type = 'modules' if $type eq 'module'; + $self->{info}{$type} = \@val; + } +} + +sub get_files { + my $self = shift; + return $self->{info}; +} + +# scan_deps_runtime utility functions + +sub _compile { + my ($perl, $file, $inchash, $dl_shared_objects, $incarray) = @_; + + my ($fhout, $fname) = File::Temp::tempfile("XXXXXX"); + my $fhin = FileHandle->new($file) or die "Couldn't open $file\n"; + + my $line = do { local $/; <$fhin> }; + $line =~ s/use Module::ScanDeps::DataFeed.*?\n//sg; + $line =~ s/^(.*?)((?:[\r\n]+__(?:DATA|END)__[\r\n]+)|$)/ +use Module::ScanDeps::DataFeed '$fname.out'; +sub { +$1 +} +$2/s; + $fhout->print($line); + $fhout->close; + $fhin->close; + + system($perl, $fname); + + _extract_info("$fname.out", $inchash, $dl_shared_objects, $incarray); + unlink("$fname"); + unlink("$fname.out"); +} + +sub _execute { + my ($perl, $file, $inchash, $dl_shared_objects, $incarray, $firstflag) = @_; + + $DB::single = $DB::single = 1; + my ($fhout, $fname) = File::Temp::tempfile("XXXXXX"); + $fname = _abs_path($fname); + my $fhin = FileHandle->new($file) or die "Couldn't open $file"; + + my $line = do { local $/; <$fhin> }; + $line =~ s/use Module::ScanDeps::DataFeed.*?\n//sg; + $line = "use Module::ScanDeps::DataFeed '$fname.out';\n" . $line; + $fhout->print($line); + $fhout->close; + $fhin->close; + + File::Path::rmtree( ['_Inline'], 0, 1); # XXX hack + system($perl, $fname) == 0 or die "SYSTEM ERROR in executing $file: $?"; + + _extract_info("$fname.out", $inchash, $dl_shared_objects, $incarray); + unlink("$fname"); + unlink("$fname.out"); +} + +sub _make_rv { + my ($inchash, $dl_shared_objects, $inc_array) = @_; + + my $rv = {}; + my @newinc = map(quotemeta($_), @$inc_array); + my $inc = join('|', sort { length($b) <=> length($a) } @newinc); + + require File::Spec; + + my $key; + foreach $key (keys(%$inchash)) { + my $newkey = $key; + $newkey =~ s"^(?:(?:$inc)/?)""sg if File::Spec->file_name_is_absolute($newkey); + + $rv->{$newkey} = { + 'used_by' => [], + 'file' => $inchash->{$key}, + 'type' => _gettype($inchash->{$key}), + 'key' => $key + }; + } + + my $dl_file; + foreach $dl_file (@$dl_shared_objects) { + my $key = $dl_file; + $key =~ s"^(?:(?:$inc)/?)""s; + + $rv->{$key} = { + 'used_by' => [], + 'file' => $dl_file, + 'type' => 'shared', + 'key' => $key + }; + } + + return $rv; +} + +sub _extract_info { + my ($fname, $inchash, $dl_shared_objects, $incarray) = @_; + + use vars qw(%inchash @dl_shared_objects @incarray); + my $fh = FileHandle->new($fname) or die "Couldn't open $fname"; + my $line = do { local $/; <$fh> }; + $fh->close; + + eval $line; + + $inchash->{$_} = $inchash{$_} for keys %inchash; + @$dl_shared_objects = @dl_shared_objects; + @$incarray = @incarray; +} + +sub _gettype { + my $name = shift; + my $dlext = quotemeta(dl_ext()); + + return 'autoload' if $name =~ /(?:\.ix|\.al|\.bs)$/i; + return 'module' if $name =~ /\.p[mh]$/i; + return 'shared' if $name =~ /\.$dlext$/i; + return 'data'; +} + +sub _merge_rv { + my ($rv_sub, $rv) = @_; + + my $key; + foreach $key (keys(%$rv_sub)) { + my %mark; + if ($rv->{$key} and _not_dup($key, $rv, $rv_sub)) { + warn "Different modules for file '$key' were found.\n" + . " -> Using '" . _abs_path($rv_sub->{$key}{file}) . "'.\n" + . " -> Ignoring '" . _abs_path($rv->{$key}{file}) . "'.\n"; + $rv->{$key}{used_by} = [ + grep (!$mark{$_}++, + @{ $rv->{$key}{used_by} }, + @{ $rv_sub->{$key}{used_by} }) + ]; + @{ $rv->{$key}{used_by} } = grep length, @{ $rv->{$key}{used_by} }; + $rv->{$key}{file} = $rv_sub->{$key}{file}; + } + elsif ($rv->{$key}) { + $rv->{$key}{used_by} = [ + grep (!$mark{$_}++, + @{ $rv->{$key}{used_by} }, + @{ $rv_sub->{$key}{used_by} }) + ]; + @{ $rv->{$key}{used_by} } = grep length, @{ $rv->{$key}{used_by} }; + } + else { + $rv->{$key} = { + used_by => [ @{ $rv_sub->{$key}{used_by} } ], + file => $rv_sub->{$key}{file}, + key => $rv_sub->{$key}{key}, + type => $rv_sub->{$key}{type} + }; + + @{ $rv->{$key}{used_by} } = grep length, @{ $rv->{$key}{used_by} }; + } + } +} + +sub _not_dup { + my ($key, $rv1, $rv2) = @_; + (_abs_path($rv1->{$key}{file}) ne _abs_path($rv2->{$key}{file})); +} + +sub _abs_path { + return join( + '/', + Cwd::abs_path(File::Basename::dirname($_[0])), + File::Basename::basename($_[0]), + ); +} + +1; + +__END__ + +=head1 SEE ALSO + +L is a bundled utility that writes C section +for a number of files. + +An application of B is to generate executables from +scripts that contains prerequisite modules; this module supports two +such projects, L and L. Please see their respective +documentations on CPAN for further information. + +=head1 AUTHORS + +Audrey Tang Eautrijus@autrijus.orgE + +Parts of heuristics were deduced from: + +=over 4 + +=item * + +B by ActiveState Tools Corp L + +=item * + +B by IndigoStar, Inc L + +=back + +The B function is contributed by Edward S. Peschko. + +L is the official website for this module. You +can write to the mailing list at Epar@perl.orgE, or send an empty +mail to Epar-subscribe@perl.orgE to participate in the discussion. + +Please submit bug reports to Ebug-Module-ScanDeps@rt.cpan.orgE. + +=head1 COPYRIGHT + +Copyright 2002, 2003, 2004, 2005, 2006 by +Audrey Tang Eautrijus@autrijus.orgE. + +This program is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. + +See L + +=cut diff --git a/lang/perl/files/config.sh-arm.in b/lang/perl/files/config.sh-arm.in new file mode 100644 index 0000000..a21991f --- /dev/null +++ b/lang/perl/files/config.sh-arm.in @@ -0,0 +1,1068 @@ +#!/bin/sh +# +# This file was produced by running the Configure script. It holds all the +# definitions figured out by Configure. Should you modify one of these values, +# do not forget to propagate your changes by running "Configure -der". You may +# instead choose to run each of the .SH files by yourself, or "Configure -S". +# + +# Package name : perl5 +# Source directory : . +# Configuration time: Fri Jul 20 04:18:17 MDT 2007 +# Configured by : root +# Target system : linux maia 2.6.22 #1 wed jul 11 12:24:09 cest 2007 armv5tel unknown unknown gnulinux + +Author='' +Date='$Date' +Header='' +Id='$Id' +Locker='' +Log='$Log' +Mcc='Mcc' +RCSfile='$RCSfile' +Revision='$Revision' +Source='' +State='' +_a='.a' +_exe='' +_o='.o' +afs='false' +afsroot='/afs' +alignbytes='4' +ansi2knr='' +aphostname='/bin/hostname' +api_revision='5' +api_subversion='0' +api_version='10' +api_versionstring='5.10.0' +ar='ar' +archlib='' +archlibexp='' +archname64='' +archname='arm-linux-uclibc' +archobjs='' +asctime_r_proto='0' +awk='awk' +baserev='5.0' +bash='' +bin='/usr/bin' +binexp='/usr/bin' +bison='bison' +byacc='byacc' +byteorder='1234' +c='' +castflags='0' +cat='cat' +cc='%%CC%%' +cccdlflags='-fPIC' +ccdlflags='-Wl,-E' +ccflags='%%CFLAGS%%' +ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' +ccname='gcc' +ccsymbols='__ARM_ARCH_3__=1' +ccversion='' +cf_by='root' +cf_email='root@maia.dev.null' +cf_time='Fri Jul 20 04:18:17 MDT 2007' +chgrp='' +chmod='chmod' +chown='' +clocktype='clock_t' +comm='comm' +compress='' +contains='grep' +cp='cp' +cpio='' +cpp='cpp' +cpp_stuff='42' +cppccsymbols='' +cppflags='%%CFLAGS%%' +cpplast='-' +cppminus='-' +cpprun='%%CPP%%' +cppstdin='%%CPP%%' +cppsymbols='__ELF__=1 _FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC__=3 __GNUC_MINOR__=4 __GNU_LIBRARY__=6 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=199506L _POSIX_SOURCE=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 linux=1 __linux=1 __linux__=1 unix=1 __unix=1 __unix__=1' +crypt_r_proto='0' +cryptlib='' +csh='csh' +ctermid_r_proto='0' +ctime_r_proto='0' +d_Gconvert='sprintf((b),"%.*g",(n),(x))' +d_PRIEUldbl='define' +d_PRIFUldbl='define' +d_PRIGUldbl='define' +d_PRIXU64='define' +d_PRId64='define' +d_PRIeldbl='define' +d_PRIfldbl='define' +d_PRIgldbl='define' +d_PRIi64='define' +d_PRIo64='define' +d_PRIu64='define' +d_PRIx64='define' +d_SCNfldbl='define' +d__fwalk='undef' +d_access='define' +d_accessx='undef' +d_aintl='undef' +d_alarm='define' +d_archlib='undef' +d_asctime_r='undef' +d_atolf='undef' +d_atoll='define' +d_attribute_format='define' +d_attribute_malloc='define' +d_attribute_nonnull='define' +d_attribute_noreturn='define' +d_attribute_pure='define' +d_attribute_unused='define' +d_attribute_warn_unused_result='define' +d_bcmp='define' +d_bcopy='define' +d_bsd='undef' +d_bsdgetpgrp='undef' +d_bsdsetpgrp='undef' +d_builtin_choose_expr='define' +d_builtin_expect='undef' +d_bzero='define' +d_c99_variadic_macros='define' +d_casti32='define' +d_castneg='define' +d_charvspr='undef' +d_chown='define' +d_chroot='define' +d_chsize='undef' +d_class='undef' +d_clearenv='define' +d_closedir='define' +d_cmsghdr_s='define' +d_const='define' +d_copysignl='undef' +d_cplusplus='undef' +d_crypt='define' +d_crypt_r='undef' +d_csh='undef' +d_ctermid='define' +d_ctermid_r='undef' +d_ctime_r='undef' +d_cuserid='define' +d_dbl_dig='define' +d_dbminitproto='undef' +d_difftime='define' +d_dir_dd_fd='undef' +d_dirfd='define' +d_dirnamlen='undef' +d_dlerror='define' +d_dlopen='define' +d_dlsymun='undef' +d_dosuid='undef' +d_drand48_r='undef' +d_drand48proto='define' +d_dup2='define' +d_eaccess='undef' +d_endgrent='define' +d_endgrent_r='undef' +d_endhent='define' +d_endhostent_r='undef' +d_endnent='define' +d_endnetent_r='undef' +d_endpent='define' +d_endprotoent_r='undef' +d_endpwent='define' +d_endpwent_r='undef' +d_endsent='define' +d_endservent_r='undef' +d_eofnblk='define' +d_eunice='undef' +d_faststdio='undef' +d_fchdir='define' +d_fchmod='define' +d_fchown='define' +d_fcntl='define' +d_fcntl_can_lock='define' +d_fd_macros='define' +d_fd_set='define' +d_fds_bits='undef' +d_fgetpos='define' +d_finite='define' +d_finitel='undef' +d_flexfnam='define' +d_flock='define' +d_flockproto='define' +d_fork='define' +d_fp_class='undef' +d_fpathconf='define' +d_fpclass='undef' +d_fpclassify='undef' +d_fpclassl='undef' +d_fpos64_t='undef' +d_frexpl='undef' +d_fs_data_s='undef' +d_fseeko='define' +d_fsetpos='define' +d_fstatfs='define' +d_fstatvfs='define' +d_fsync='define' +d_ftello='define' +d_ftime='undef' +d_futimes='undef' +d_getcwd='define' +d_getespwnam='undef' +d_getfsstat='undef' +d_getgrent='define' +d_getgrent_r='undef' +d_getgrgid_r='undef' +d_getgrnam_r='undef' +d_getgrps='define' +d_gethbyaddr='define' +d_gethbyname='define' +d_gethent='define' +d_gethname='define' +d_gethostbyaddr_r='undef' +d_gethostbyname_r='undef' +d_gethostent_r='undef' +d_gethostprotos='define' +d_getitimer='define' +d_getlogin='define' +d_getlogin_r='undef' +d_getmnt='undef' +d_getmntent='define' +d_getnbyaddr='define' +d_getnbyname='define' +d_getnent='define' +d_getnetbyaddr_r='undef' +d_getnetbyname_r='undef' +d_getnetent_r='undef' +d_getnetprotos='define' +d_getpagsz='define' +d_getpbyname='define' +d_getpbynumber='define' +d_getpent='define' +d_getpgid='define' +d_getpgrp2='undef' +d_getpgrp='define' +d_getppid='define' +d_getprior='define' +d_getprotobyname_r='undef' +d_getprotobynumber_r='undef' +d_getprotoent_r='undef' +d_getprotoprotos='define' +d_getprpwnam='undef' +d_getpwent='define' +d_getpwent_r='undef' +d_getpwnam_r='undef' +d_getpwuid_r='undef' +d_getsbyname='define' +d_getsbyport='define' +d_getsent='define' +d_getservbyname_r='undef' +d_getservbyport_r='undef' +d_getservent_r='undef' +d_getservprotos='define' +d_getspnam='define' +d_getspnam_r='undef' +d_gettimeod='define' +d_gmtime_r='undef' +d_gnulibc='undef' +d_grpasswd='define' +d_hasmntopt='define' +d_htonl='define' +d_ilogbl='undef' +d_inc_version_list='undef' +d_index='undef' +d_inetaton='define' +d_int64_t='define' +d_isascii='define' +d_isfinite='undef' +d_isinf='define' +d_isnan='define' +d_isnanl='undef' +d_killpg='define' +d_lchown='define' +d_ldbl_dig='define' +d_libm_lib_version='define' +d_link='define' +d_localtime_r='undef' +d_localtime_r_needs_tzset='undef' +d_locconv='define' +d_lockf='define' +d_longdbl='define' +d_longlong='define' +d_lseekproto='define' +d_lstat='define' +d_madvise='define' +d_malloc_good_size='undef' +d_malloc_size='undef' +d_mblen='define' +d_mbstowcs='define' +d_mbtowc='define' +d_memchr='define' +d_memcmp='define' +d_memcpy='define' +d_memmove='define' +d_memset='define' +d_mkdir='define' +d_mkdtemp='define' +d_mkfifo='define' +d_mkstemp='define' +d_mkstemps='undef' +d_mktime='define' +d_mmap='define' +d_modfl='undef' +d_modfl_pow32_bug='undef' +d_modflproto='undef' +d_mprotect='define' +d_msg='define' +d_msg_ctrunc='define' +d_msg_dontroute='define' +d_msg_oob='define' +d_msg_peek='define' +d_msg_proxy='define' +d_msgctl='define' +d_msgget='define' +d_msghdr_s='define' +d_msgrcv='define' +d_msgsnd='define' +d_msync='define' +d_munmap='define' +d_mymalloc='undef' +d_nice='define' +d_nl_langinfo='define' +d_nv_preserves_uv='define' +d_nv_zero_is_allbits_zero='define' +d_off64_t='undef' +d_old_pthread_create_joinable='undef' +d_oldpthreads='undef' +d_oldsock='undef' +d_open3='define' +d_pathconf='define' +d_pause='define' +d_perl_otherlibdirs='undef' +d_phostname='undef' +d_pipe='define' +d_poll='define' +d_portable='define' +d_printf_format_null='define' +d_procselfexe='define' +d_pseudofork='undef' +d_pthread_atfork='undef' +d_pthread_attr_setscope='define' +d_pthread_yield='undef' +d_pwage='undef' +d_pwchange='undef' +d_pwclass='undef' +d_pwcomment='undef' +d_pwexpire='undef' +d_pwgecos='define' +d_pwpasswd='define' +d_pwquota='undef' +d_qgcvt='undef' +d_quad='define' +d_random_r='undef' +d_readdir64_r='undef' +d_readdir='define' +d_readdir_r='undef' +d_readlink='define' +d_readv='define' +d_recvmsg='define' +d_rename='define' +d_rewinddir='define' +d_rmdir='define' +d_safebcpy='undef' +d_safemcpy='undef' +d_sanemcmp='define' +d_sbrkproto='define' +d_scalbnl='undef' +d_sched_yield='define' +d_scm_rights='define' +d_seekdir='define' +d_select='define' +d_sem='define' +d_semctl='define' +d_semctl_semid_ds='define' +d_semctl_semun='define' +d_semget='define' +d_semop='define' +d_sendmsg='define' +d_setegid='define' +d_seteuid='define' +d_setgrent='define' +d_setgrent_r='undef' +d_setgrps='define' +d_sethent='define' +d_sethostent_r='undef' +d_setitimer='define' +d_setlinebuf='define' +d_setlocale='define' +d_setlocale_r='undef' +d_setnent='define' +d_setnetent_r='undef' +d_setpent='define' +d_setpgid='define' +d_setpgrp2='undef' +d_setpgrp='define' +d_setprior='define' +d_setproctitle='undef' +d_setprotoent_r='undef' +d_setpwent='define' +d_setpwent_r='undef' +d_setregid='define' +d_setresgid='define' +d_setresuid='define' +d_setreuid='define' +d_setrgid='undef' +d_setruid='undef' +d_setsent='define' +d_setservent_r='undef' +d_setsid='define' +d_setvbuf='define' +d_sfio='undef' +d_shm='define' +d_shmat='define' +d_shmatprototype='define' +d_shmctl='define' +d_shmdt='define' +d_shmget='define' +d_sigaction='define' +d_signbit='undef' +d_sigprocmask='define' +d_sigsetjmp='define' +d_sitearch='define' +d_snprintf='define' +d_sockatmark='undef' +d_sockatmarkproto='undef' +d_socket='define' +d_socklen_t='define' +d_sockpair='define' +d_socks5_init='undef' +d_sprintf_returns_strlen='define' +d_sqrtl='undef' +d_srand48_r='undef' +d_srandom_r='undef' +d_sresgproto='undef' +d_sresuproto='undef' +d_statblks='define' +d_statfs_f_flags='undef' +d_statfs_s='define' +d_statvfs='define' +d_stdio_cnt_lval='undef' +d_stdio_ptr_lval='undef' +d_stdio_ptr_lval_nochange_cnt='undef' +d_stdio_ptr_lval_sets_cnt='undef' +d_stdio_stream_array='undef' +d_stdiobase='undef' +d_stdstdio='undef' +d_strchr='define' +d_strcoll='define' +d_strctcpy='define' +d_strerrm='strerror(e)' +d_strerror='define' +d_strerror_r='undef' +d_strftime='define' +d_strlcat='define' +d_strlcpy='define' +d_strtod='define' +d_strtol='define' +d_strtold='define' +d_strtoll='define' +d_strtoq='define' +d_strtoul='define' +d_strtoull='define' +d_strtouq='define' +d_strxfrm='define' +d_suidsafe='undef' +d_symlink='define' +d_syscall='define' +d_syscallproto='define' +d_sysconf='define' +d_sysernlst='' +d_syserrlst='undef' +d_system='define' +d_tcgetpgrp='define' +d_tcsetpgrp='define' +d_telldir='define' +d_telldirproto='define' +d_time='define' +d_times='define' +d_tm_tm_gmtoff='define' +d_tm_tm_zone='define' +d_tmpnam_r='undef' +d_truncate='define' +d_ttyname_r='undef' +d_tzname='define' +d_u32align='undef' +d_ualarm='define' +d_umask='define' +d_uname='define' +d_union_semun='undef' +d_unordered='undef' +d_unsetenv='define' +d_usleep='define' +d_usleepproto='define' +d_ustat='define' +d_vendorarch='undef' +d_vendorbin='undef' +d_vendorlib='undef' +d_vendorscript='undef' +d_vfork='undef' +d_void_closedir='undef' +d_voidsig='define' +d_voidtty='' +d_volatile='define' +d_vprintf='define' +d_vsnprintf='define' +d_wait4='define' +d_waitpid='define' +d_wcstombs='define' +d_wctomb='define' +d_writev='define' +d_xenix='undef' +date='date' +db_hashtype='u_int32_t' +db_prefixtype='size_t' +db_version_major='' +db_version_minor='' +db_version_patch='' +defvoidused='15' +direntrytype='struct dirent' +dlext='so' +dlsrc='dl_dlopen.xs' +doublesize='8' +drand01='drand48()' +drand48_r_proto='0' +dynamic_ext='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' +eagain='EAGAIN' +ebcdic='undef' +echo='echo' +egrep='egrep' +emacs='' +endgrent_r_proto='0' +endhostent_r_proto='0' +endnetent_r_proto='0' +endprotoent_r_proto='0' +endpwent_r_proto='0' +endservent_r_proto='0' +eunicefix=':' +exe_ext='' +expr='expr' +extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib' +extras='' +fflushNULL='define' +fflushall='undef' +find='' +firstmakefile='makefile' +flex='' +fpossize='20' +fpostype='fpos_t' +freetype='void' +from=':' +full_ar='%%AR%%' +full_csh='csh' +full_sed='sed' +gccansipedantic='' +gccosandvers='' +gccversion='3.4.3' +getgrent_r_proto='0' +getgrgid_r_proto='0' +getgrnam_r_proto='0' +gethostbyaddr_r_proto='0' +gethostbyname_r_proto='0' +gethostent_r_proto='0' +getlogin_r_proto='0' +getnetbyaddr_r_proto='0' +getnetbyname_r_proto='0' +getnetent_r_proto='0' +getprotobyname_r_proto='0' +getprotobynumber_r_proto='0' +getprotoent_r_proto='0' +getpwent_r_proto='0' +getpwnam_r_proto='0' +getpwuid_r_proto='0' +getservbyname_r_proto='0' +getservbyport_r_proto='0' +getservent_r_proto='0' +getspnam_r_proto='0' +gidformat='"lu"' +gidsign='1' +gidsize='4' +gidtype='gid_t' +glibpth='/usr/shlib /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib /usr/ucblib /usr/local/lib ' +gmake='gmake' +gmtime_r_proto='0' +gnulibc_version='' +grep='grep' +groupcat='cat /etc/group' +groupstype='gid_t' +gzip='gzip' +h_fcntl='false' +h_sysfile='true' +hint='recommended' +hostcat='cat /etc/hosts' +html1dir=' ' +html1direxp='' +html3dir=' ' +html3direxp='' +i16size='2' +i16type='short' +i32size='4' +i32type='long' +i64size='8' +i64type='long long' +i8size='1' +i8type='char' +i_arpainet='define' +i_bsdioctl='' +i_crypt='define' +i_db='define' +i_dbm='undef' +i_dirent='define' +i_dld='undef' +i_dlfcn='define' +i_fcntl='undef' +i_float='define' +i_fp='undef' +i_fp_class='undef' +i_gdbm='define' +i_grp='define' +i_ieeefp='undef' +i_inttypes='define' +i_langinfo='define' +i_libutil='undef' +i_limits='define' +i_locale='define' +i_machcthr='undef' +i_malloc='define' +i_math='define' +i_memory='undef' +i_mntent='define' +i_ndbm='undef' +i_netdb='define' +i_neterrno='undef' +i_netinettcp='define' +i_niin='define' +i_poll='define' +i_prot='undef' +i_pthread='define' +i_pwd='define' +i_rpcsvcdbm='undef' +i_sfio='undef' +i_sgtty='undef' +i_shadow='define' +i_socks='undef' +i_stdarg='define' +i_stddef='define' +i_stdlib='define' +i_string='define' +i_sunmath='undef' +i_sysaccess='undef' +i_sysdir='define' +i_sysfile='define' +i_sysfilio='undef' +i_sysin='undef' +i_sysioctl='define' +i_syslog='define' +i_sysmman='define' +i_sysmode='undef' +i_sysmount='define' +i_sysndir='undef' +i_sysparam='define' +i_sysresrc='define' +i_syssecrt='undef' +i_sysselct='define' +i_syssockio='undef' +i_sysstat='define' +i_sysstatfs='define' +i_sysstatvfs='define' +i_systime='define' +i_systimek='undef' +i_systimes='define' +i_systypes='define' +i_sysuio='define' +i_sysun='define' +i_sysutsname='define' +i_sysvfs='define' +i_syswait='define' +i_termio='undef' +i_termios='define' +i_time='define' +i_unistd='define' +i_ustat='define' +i_utime='define' +i_values='define' +i_varargs='undef' +i_varhdr='stdarg.h' +i_vfork='undef' +ignore_versioned_solibs='y' +inc_version_list=' ' +inc_version_list_init='0' +incpath='' +inews='' +installarchlib='/usr/lib/perl5/5.10' +installbin='/usr/bin' +initialinstalllocation='/usr/bin' +installhtml1dir='' +installhtml3dir='' +installman1dir='' +installman3dir='' +installprefix='/usr' +installprefixexp='/usr' +installprivlib='/usr/lib/perl5/5.10' +installscript='/usr/bin' +installsitearch='/usr/lib/perl5/5.10' +installsitebin='/usr/bin' +installsitehtml1dir='' +installsitehtml3dir='' +installsitelib='/usr/lib/perl5/5.10' +installsiteman1dir='' +installsiteman3dir='' +installsitescript='/usr/bin' +installstyle='lib/perl5' +installusrbinperl='define' +installvendorarch='' +installvendorbin='' +installvendorhtml1dir='' +installvendorhtml3dir='' +installvendorlib='' +installvendorman1dir='' +installvendorman3dir='' +installvendorscript='' +intsize='4' +issymlink='test -h' +ivdformat='"ld"' +ivsize='4' +ivtype='long' +known_extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize Win32 Win32API/File Win32CORE XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' +ksh='' +ld='%%LD%%' +lddlflags='-shared %%LDFLAGS%%' +ldflags='%%EXTRA_PERLLIBDIRS%%' +ldflags_uselargefiles='' +ldlibpthname='LD_LIBRARY_PATH' +less='less' +lib_ext='.a' +libc='' +libperl='libperl.a' +libpth='%%LIBDIRS%%' +libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc' +libsdirs='%%LIBDIRS%%' +libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' +libspath='%%LIBDIRS%%' +libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD' +libswanted_uselargefiles='' +line='' +lint='' +lkflags='' +ln='ln' +lns='/bin/ln -s' +localtime_r_proto='0' +locincpth=' ' +loclibpth=' ' +longdblsize='8' +longlongsize='8' +longsize='4' +lp='' +lpr='' +ls='ls' +lseeksize='8' +lseektype='off_t' +mad='undef' +madlyh='' +madlyobj='' +madlysrc='' +mail='' +mailx='' +make='make' +make_set_make='#' +mallocobj='' +mallocsrc='' +malloctype='void *' +man1dir=' ' +man1direxp='' +man1ext='0' +man3dir=' ' +man3direxp='' +man3ext='0' +mips_type='' +mistrustnm='' +mkdir='mkdir' +mmaptype='void *' +modetype='mode_t' +more='more' +multiarch='undef' +mv='' +myarchname='arm-linux-uclibc' +mydomain='.dev.null' +myhostname='maia' +myuname='linux maia 2.6.22 #1 wed jul 11 12:24:09 cest 2007 armv5tel unknown unknown gnulinux ' +n='-n' +need_va_copy='undef' +netdb_hlen_type='size_t' +netdb_host_type='const void *' +netdb_name_type='const char *' +netdb_net_type='in_addr_t' +nm='nm' +nm_opt='' +nm_so_opt='--dynamic' +nonxs_ext='Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib' +nroff='nroff' +nvEUformat='"E"' +nvFUformat='"F"' +nvGUformat='"G"' +nv_preserves_uv_bits='32' +nveformat='"e"' +nvfformat='"f"' +nvgformat='"g"' +nvsize='8' +nvtype='double' +o_nonblock='O_NONBLOCK' +obj_ext='.o' +old_pthread_create_joinable='' +optimize='-O2' +orderlib='false' +osname='linux' +osvers='2.6.22' +otherlibdirs=' ' +package='perl5' +pager='/usr/bin/less' +passcat='cat /etc/passwd' +patchlevel='10' +path_sep=':' +perl5='' +perl='' +perl_patchlevel='' +perladmin='root@maia.dev.null' +perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%' +perlpath='/usr/bin/perl' +pg='pg' +phostname='hostname' +pidtype='pid_t' +plibpth='' +pmake='' +pr='' +prefix='/usr' +prefixexp='/usr' +privlib='/usr/lib/perl5/5.10' +privlibexp='/usr/lib/perl5/5.10' +procselfexe='"/proc/self/exe"' +prototype='define' +ptrsize='4' +quadkind='3' +quadtype='long long' +randbits='48' +randfunc='drand48' +random_r_proto='0' +randseedtype='long' +ranlib=':' +rd_nodata='-1' +readdir64_r_proto='0' +readdir_r_proto='0' +revision='5' +rm='rm' +rm_try='/bin/rm -f try try a.out .out try.[cho] try..o core core.try* try.core*' +rmail='' +run='' +runnm='false' +sPRIEUldbl='"E"' +sPRIFUldbl='"F"' +sPRIGUldbl='"G"' +sPRIXU64='"LX"' +sPRId64='"Ld"' +sPRIeldbl='"e"' +sPRIfldbl='"f"' +sPRIgldbl='"g"' +sPRIi64='"Li"' +sPRIo64='"Lo"' +sPRIu64='"Lu"' +sPRIx64='"Lx"' +sSCNfldbl='"f"' +sched_yield='sched_yield()' +scriptdir='/usr/bin' +scriptdirexp='/usr/bin' +sed='sed' +seedfunc='srand48' +selectminbits='32' +selecttype='fd_set *' +sendmail='' +setgrent_r_proto='0' +sethostent_r_proto='0' +setlocale_r_proto='0' +setnetent_r_proto='0' +setprotoent_r_proto='0' +setpwent_r_proto='0' +setservent_r_proto='0' +sh='/bin/sh' +shar='' +sharpbang='#!' +shmattype='void *' +shortsize='2' +shrpenv='' +shsharp='true' +sig_count='64' +sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN NUM33 NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 RTMAX IOT CLD POLL UNUSED ' +sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "RTMIN", "NUM33", "NUM34", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0' +sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 6 17 29 31 ' +sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 6, 17, 29, 31, 0' +sig_size='68' +signal_t='void' +sitearch='' +sitearchexp='' +sitebin='/usr/bin' +sitebinexp='/usr/bin' +sitehtml1dir='' +sitehtml1direxp='' +sitehtml3dir='' +sitehtml3direxp='' +sitelib='' +#sitelib_stem='/usr/lib/perl5/site_perl' +sitelibexp='' +siteman1dir='' +siteman1direxp='' +siteman3dir='' +siteman3direxp='' +siteprefix='/usr' +siteprefixexp='/usr' +sitescript='/usr/bin' +sitescriptexp='/usr/bin' +sizesize='4' +sizetype='size_t' +sleep='' +smail='' +so='so' +sockethdr='' +socketlib='' +socksizetype='socklen_t' +sort='sort' +spackage='Perl5' +spitshell='cat' +srand48_r_proto='0' +srandom_r_proto='0' +src='.' +ssizetype='ssize_t' +startperl='#!/usr/bin/perl' +startsh='#!/bin/sh' +static_ext=' ' +stdchar='char' +stdio_base='((fp)->_base)' +stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)' +stdio_cnt='((fp)->_cnt)' +stdio_filbuf='' +stdio_ptr='((fp)->_ptr)' +stdio_stream_array='' +strerror_r_proto='0' +#strings='/usr/include/string.h' +submit='' +subversion='0' +sysman='/usr/share/man/man1' +tail='' +tar='' +targetarch='arm-linux-uclibc' +tbl='' +tee='' +test='test' +#timeincl='/usr/include/sys/time.h /usr/include/time.h ' +timetype='time_t' +tmpnam_r_proto='0' +to=':' +touch='touch' +tr='tr' +trnl='\n' +troff='' +ttyname_r_proto='0' +u16size='2' +u16type='unsigned short' +u32size='4' +u32type='unsigned long' +u64size='8' +u64type='unsigned long long' +u8size='1' +u8type='unsigned char' +uidformat='"lu"' +uidsign='1' +uidsize='4' +uidtype='uid_t' +uname='uname' +uniq='uniq' +uquadtype='unsigned long long' +use5005threads='undef' +use64bitall='undef' +use64bitint='undef' +usecrosscompile='define' +usedl='define' +usefaststdio='undef' +useithreads='undef' +uselargefiles='define' +uselongdouble='undef' +usemallocwrap='define' +usemorebits='undef' +usemultiplicity='undef' +usemymalloc='n' +usenm='true' +useopcode='true' +useperlio='define' +useposix='true' +usereentrant='undef' +userelocatableinc='undef' +usesfio='false' +useshrplib='false' +usesitecustomize='undef' +usesocks='undef' +usethreads='undef' +usevendorprefix='undef' +usevfork='false' +usrinc='%%INCDIRS%%' +uuname='' +uvXUformat='"lX"' +uvoformat='"lo"' +uvsize='4' +uvtype='unsigned long' +uvuformat='"lu"' +uvxformat='"lx"' +vendorarch='' +vendorarchexp='' +vendorbin='' +vendorbinexp='' +vendorhtml1dir=' ' +vendorhtml1direxp='' +vendorhtml3dir=' ' +vendorhtml3direxp='' +vendorlib='' +vendorlib_stem='' +vendorlibexp='' +vendorman1dir=' ' +vendorman1direxp='' +vendorman3dir=' ' +vendorman3direxp='' +vendorprefix='' +vendorprefixexp='' +vendorscript='' +vendorscriptexp='' +version='5.10.0' +version_patchlevel_string='version 10 subversion 0' +versiononly='undef' +vi='' +voidflags='15' +xlibpth='/usr/lib/386 /lib/386' +yacc='yacc' +yaccflags='' +zcat='' +zip='zip' +# Configure command line arguments. +config_arg0='./Configure' +config_args='-der' +config_argc=1 +config_arg1='-der' +PERL_REVISION=5 +PERL_VERSION=10 +PERL_SUBVERSION=0 +PERL_API_REVISION=5 +PERL_API_VERSION=10 +PERL_API_SUBVERSION=0 +PERL_PATCHLEVEL= +PERL_CONFIG_SH=true +# Fix problem with HiRes timer. +d_nanosleep='define' +d_clock_gettime='define' +d_clock_getres='define' +d_clock_nanosleep='define' +d_clock='define' diff --git a/lang/perl/files/config.sh-armeb.in b/lang/perl/files/config.sh-armeb.in new file mode 100644 index 0000000..81bc555 --- /dev/null +++ b/lang/perl/files/config.sh-armeb.in @@ -0,0 +1,1068 @@ +#!/bin/sh +# +# This file was produced by running the Configure script. It holds all the +# definitions figured out by Configure. Should you modify one of these values, +# do not forget to propagate your changes by running "Configure -der". You may +# instead choose to run each of the .SH files by yourself, or "Configure -S". +# + +# Package name : perl5 +# Source directory : . +# Configuration time: Fri Jul 20 04:39:05 MDT 2007 +# Configured by : root +# Target system : linux maia 2.6.22 #1 wed jul 11 12:24:09 cest 2007 armv5teb unknown unknown gnulinux + +Author='' +Date='$Date' +Header='' +Id='$Id' +Locker='' +Log='$Log' +Mcc='Mcc' +RCSfile='$RCSfile' +Revision='$Revision' +Source='' +State='' +_a='.a' +_exe='' +_o='.o' +afs='false' +afsroot='/afs' +alignbytes='4' +ansi2knr='' +aphostname='/bin/hostname' +api_revision='5' +api_subversion='0' +api_version='10' +api_versionstring='5.10.0' +ar='ar' +archlib='' +archlibexp='' +archname64='' +archname='armeb-linux-uclibc' +archobjs='' +asctime_r_proto='0' +awk='awk' +baserev='5.0' +bash='' +bin='/usr/bin' +binexp='/usr/bin' +bison='bison' +byacc='byacc' +byteorder='4321' +c='' +castflags='0' +cat='cat' +cc='%%CC%%' +cccdlflags='-fPIC' +ccdlflags='-Wl,-E' +ccflags='%%CFLAGS%%' +ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' +ccname='gcc' +ccsymbols='__ARM_ARCH_3__=1' +ccversion='' +cf_by='root' +cf_email='root@maia.dev.null' +cf_time='Fri Jul 20 04:39:05 MDT 2007' +chgrp='' +chmod='chmod' +chown='' +clocktype='clock_t' +comm='comm' +compress='' +contains='grep' +cp='cp' +cpio='' +cpp='cpp' +cpp_stuff='42' +cppccsymbols='' +cppflags='%%CFLAGS%%' +cpplast='-' +cppminus='-' +cpprun='%%CPP%%' +cppstdin='%%CPP%%' +cppsymbols='__ELF__=1 _FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC__=3 __GNUC_MINOR__=4 __GNU_LIBRARY__=6 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=199506L _POSIX_SOURCE=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 linux=1 __linux=1 __linux__=1 unix=1 __unix=1 __unix__=1' +crypt_r_proto='0' +cryptlib='' +csh='csh' +ctermid_r_proto='0' +ctime_r_proto='0' +d_Gconvert='sprintf((b),"%.*g",(n),(x))' +d_PRIEUldbl='define' +d_PRIFUldbl='define' +d_PRIGUldbl='define' +d_PRIXU64='define' +d_PRId64='define' +d_PRIeldbl='define' +d_PRIfldbl='define' +d_PRIgldbl='define' +d_PRIi64='define' +d_PRIo64='define' +d_PRIu64='define' +d_PRIx64='define' +d_SCNfldbl='define' +d__fwalk='undef' +d_access='define' +d_accessx='undef' +d_aintl='undef' +d_alarm='define' +d_archlib='undef' +d_asctime_r='undef' +d_atolf='undef' +d_atoll='define' +d_attribute_format='define' +d_attribute_malloc='define' +d_attribute_nonnull='define' +d_attribute_noreturn='define' +d_attribute_pure='define' +d_attribute_unused='define' +d_attribute_warn_unused_result='define' +d_bcmp='define' +d_bcopy='define' +d_bsd='undef' +d_bsdgetpgrp='undef' +d_bsdsetpgrp='undef' +d_builtin_choose_expr='define' +d_builtin_expect='undef' +d_bzero='define' +d_c99_variadic_macros='define' +d_casti32='define' +d_castneg='define' +d_charvspr='undef' +d_chown='define' +d_chroot='define' +d_chsize='undef' +d_class='undef' +d_clearenv='define' +d_closedir='define' +d_cmsghdr_s='define' +d_const='define' +d_copysignl='undef' +d_cplusplus='undef' +d_crypt='define' +d_crypt_r='undef' +d_csh='undef' +d_ctermid='define' +d_ctermid_r='undef' +d_ctime_r='undef' +d_cuserid='define' +d_dbl_dig='define' +d_dbminitproto='undef' +d_difftime='define' +d_dir_dd_fd='undef' +d_dirfd='define' +d_dirnamlen='undef' +d_dlerror='define' +d_dlopen='define' +d_dlsymun='undef' +d_dosuid='undef' +d_drand48_r='undef' +d_drand48proto='define' +d_dup2='define' +d_eaccess='undef' +d_endgrent='define' +d_endgrent_r='undef' +d_endhent='define' +d_endhostent_r='undef' +d_endnent='define' +d_endnetent_r='undef' +d_endpent='define' +d_endprotoent_r='undef' +d_endpwent='define' +d_endpwent_r='undef' +d_endsent='define' +d_endservent_r='undef' +d_eofnblk='define' +d_eunice='undef' +d_faststdio='undef' +d_fchdir='define' +d_fchmod='define' +d_fchown='define' +d_fcntl='define' +d_fcntl_can_lock='define' +d_fd_macros='define' +d_fd_set='define' +d_fds_bits='undef' +d_fgetpos='define' +d_finite='define' +d_finitel='undef' +d_flexfnam='define' +d_flock='define' +d_flockproto='define' +d_fork='define' +d_fp_class='undef' +d_fpathconf='define' +d_fpclass='undef' +d_fpclassify='undef' +d_fpclassl='undef' +d_fpos64_t='undef' +d_frexpl='undef' +d_fs_data_s='undef' +d_fseeko='define' +d_fsetpos='define' +d_fstatfs='define' +d_fstatvfs='define' +d_fsync='define' +d_ftello='define' +d_ftime='undef' +d_futimes='undef' +d_getcwd='define' +d_getespwnam='undef' +d_getfsstat='undef' +d_getgrent='define' +d_getgrent_r='undef' +d_getgrgid_r='undef' +d_getgrnam_r='undef' +d_getgrps='define' +d_gethbyaddr='define' +d_gethbyname='define' +d_gethent='define' +d_gethname='define' +d_gethostbyaddr_r='undef' +d_gethostbyname_r='undef' +d_gethostent_r='undef' +d_gethostprotos='define' +d_getitimer='define' +d_getlogin='define' +d_getlogin_r='undef' +d_getmnt='undef' +d_getmntent='define' +d_getnbyaddr='define' +d_getnbyname='define' +d_getnent='define' +d_getnetbyaddr_r='undef' +d_getnetbyname_r='undef' +d_getnetent_r='undef' +d_getnetprotos='define' +d_getpagsz='define' +d_getpbyname='define' +d_getpbynumber='define' +d_getpent='define' +d_getpgid='define' +d_getpgrp2='undef' +d_getpgrp='define' +d_getppid='define' +d_getprior='define' +d_getprotobyname_r='undef' +d_getprotobynumber_r='undef' +d_getprotoent_r='undef' +d_getprotoprotos='define' +d_getprpwnam='undef' +d_getpwent='define' +d_getpwent_r='undef' +d_getpwnam_r='undef' +d_getpwuid_r='undef' +d_getsbyname='define' +d_getsbyport='define' +d_getsent='define' +d_getservbyname_r='undef' +d_getservbyport_r='undef' +d_getservent_r='undef' +d_getservprotos='define' +d_getspnam='define' +d_getspnam_r='undef' +d_gettimeod='define' +d_gmtime_r='undef' +d_gnulibc='undef' +d_grpasswd='define' +d_hasmntopt='define' +d_htonl='define' +d_ilogbl='undef' +d_inc_version_list='undef' +d_index='undef' +d_inetaton='define' +d_int64_t='define' +d_isascii='define' +d_isfinite='undef' +d_isinf='define' +d_isnan='define' +d_isnanl='undef' +d_killpg='define' +d_lchown='define' +d_ldbl_dig='define' +d_libm_lib_version='define' +d_link='define' +d_localtime_r='undef' +d_localtime_r_needs_tzset='undef' +d_locconv='define' +d_lockf='define' +d_longdbl='define' +d_longlong='define' +d_lseekproto='define' +d_lstat='define' +d_madvise='define' +d_malloc_good_size='undef' +d_malloc_size='undef' +d_mblen='define' +d_mbstowcs='define' +d_mbtowc='define' +d_memchr='define' +d_memcmp='define' +d_memcpy='define' +d_memmove='define' +d_memset='define' +d_mkdir='define' +d_mkdtemp='define' +d_mkfifo='define' +d_mkstemp='define' +d_mkstemps='undef' +d_mktime='define' +d_mmap='define' +d_modfl='undef' +d_modfl_pow32_bug='undef' +d_modflproto='undef' +d_mprotect='define' +d_msg='define' +d_msg_ctrunc='define' +d_msg_dontroute='define' +d_msg_oob='define' +d_msg_peek='define' +d_msg_proxy='define' +d_msgctl='define' +d_msgget='define' +d_msghdr_s='define' +d_msgrcv='define' +d_msgsnd='define' +d_msync='define' +d_munmap='define' +d_mymalloc='undef' +d_nice='define' +d_nl_langinfo='define' +d_nv_preserves_uv='define' +d_nv_zero_is_allbits_zero='define' +d_off64_t='undef' +d_old_pthread_create_joinable='undef' +d_oldpthreads='undef' +d_oldsock='undef' +d_open3='define' +d_pathconf='define' +d_pause='define' +d_perl_otherlibdirs='undef' +d_phostname='undef' +d_pipe='define' +d_poll='define' +d_portable='define' +d_printf_format_null='define' +d_procselfexe='define' +d_pseudofork='undef' +d_pthread_atfork='undef' +d_pthread_attr_setscope='define' +d_pthread_yield='undef' +d_pwage='undef' +d_pwchange='undef' +d_pwclass='undef' +d_pwcomment='undef' +d_pwexpire='undef' +d_pwgecos='define' +d_pwpasswd='define' +d_pwquota='undef' +d_qgcvt='undef' +d_quad='define' +d_random_r='undef' +d_readdir64_r='undef' +d_readdir='define' +d_readdir_r='undef' +d_readlink='define' +d_readv='define' +d_recvmsg='define' +d_rename='define' +d_rewinddir='define' +d_rmdir='define' +d_safebcpy='undef' +d_safemcpy='undef' +d_sanemcmp='define' +d_sbrkproto='define' +d_scalbnl='undef' +d_sched_yield='define' +d_scm_rights='define' +d_seekdir='define' +d_select='define' +d_sem='define' +d_semctl='define' +d_semctl_semid_ds='define' +d_semctl_semun='define' +d_semget='define' +d_semop='define' +d_sendmsg='define' +d_setegid='define' +d_seteuid='define' +d_setgrent='define' +d_setgrent_r='undef' +d_setgrps='define' +d_sethent='define' +d_sethostent_r='undef' +d_setitimer='define' +d_setlinebuf='define' +d_setlocale='define' +d_setlocale_r='undef' +d_setnent='define' +d_setnetent_r='undef' +d_setpent='define' +d_setpgid='define' +d_setpgrp2='undef' +d_setpgrp='define' +d_setprior='define' +d_setproctitle='undef' +d_setprotoent_r='undef' +d_setpwent='define' +d_setpwent_r='undef' +d_setregid='define' +d_setresgid='define' +d_setresuid='define' +d_setreuid='define' +d_setrgid='undef' +d_setruid='undef' +d_setsent='define' +d_setservent_r='undef' +d_setsid='define' +d_setvbuf='define' +d_sfio='undef' +d_shm='define' +d_shmat='define' +d_shmatprototype='define' +d_shmctl='define' +d_shmdt='define' +d_shmget='define' +d_sigaction='define' +d_signbit='undef' +d_sigprocmask='define' +d_sigsetjmp='define' +d_sitearch='define' +d_snprintf='define' +d_sockatmark='undef' +d_sockatmarkproto='undef' +d_socket='define' +d_socklen_t='define' +d_sockpair='define' +d_socks5_init='undef' +d_sprintf_returns_strlen='define' +d_sqrtl='undef' +d_srand48_r='undef' +d_srandom_r='undef' +d_sresgproto='undef' +d_sresuproto='undef' +d_statblks='define' +d_statfs_f_flags='undef' +d_statfs_s='define' +d_statvfs='define' +d_stdio_cnt_lval='undef' +d_stdio_ptr_lval='undef' +d_stdio_ptr_lval_nochange_cnt='undef' +d_stdio_ptr_lval_sets_cnt='undef' +d_stdio_stream_array='undef' +d_stdiobase='undef' +d_stdstdio='undef' +d_strchr='define' +d_strcoll='define' +d_strctcpy='define' +d_strerrm='strerror(e)' +d_strerror='define' +d_strerror_r='undef' +d_strftime='define' +d_strlcat='define' +d_strlcpy='define' +d_strtod='define' +d_strtol='define' +d_strtold='define' +d_strtoll='define' +d_strtoq='define' +d_strtoul='define' +d_strtoull='define' +d_strtouq='define' +d_strxfrm='define' +d_suidsafe='undef' +d_symlink='define' +d_syscall='define' +d_syscallproto='define' +d_sysconf='define' +d_sysernlst='' +d_syserrlst='undef' +d_system='define' +d_tcgetpgrp='define' +d_tcsetpgrp='define' +d_telldir='define' +d_telldirproto='define' +d_time='define' +d_times='define' +d_tm_tm_gmtoff='define' +d_tm_tm_zone='define' +d_tmpnam_r='undef' +d_truncate='define' +d_ttyname_r='undef' +d_tzname='define' +d_u32align='undef' +d_ualarm='define' +d_umask='define' +d_uname='define' +d_union_semun='undef' +d_unordered='undef' +d_unsetenv='define' +d_usleep='define' +d_usleepproto='define' +d_ustat='define' +d_vendorarch='undef' +d_vendorbin='undef' +d_vendorlib='undef' +d_vendorscript='undef' +d_vfork='undef' +d_void_closedir='undef' +d_voidsig='define' +d_voidtty='' +d_volatile='define' +d_vprintf='define' +d_vsnprintf='define' +d_wait4='define' +d_waitpid='define' +d_wcstombs='define' +d_wctomb='define' +d_writev='define' +d_xenix='undef' +date='date' +db_hashtype='u_int32_t' +db_prefixtype='size_t' +db_version_major='' +db_version_minor='' +db_version_patch='' +defvoidused='15' +direntrytype='struct dirent' +dlext='so' +dlsrc='dl_dlopen.xs' +doublesize='8' +drand01='drand48()' +drand48_r_proto='0' +dynamic_ext='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' +eagain='EAGAIN' +ebcdic='undef' +echo='echo' +egrep='egrep' +emacs='' +endgrent_r_proto='0' +endhostent_r_proto='0' +endnetent_r_proto='0' +endprotoent_r_proto='0' +endpwent_r_proto='0' +endservent_r_proto='0' +eunicefix=':' +exe_ext='' +expr='expr' +extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib' +extras='' +fflushNULL='define' +fflushall='undef' +find='' +firstmakefile='makefile' +flex='' +fpossize='20' +fpostype='fpos_t' +freetype='void' +from=':' +full_ar='%%AR%%' +full_csh='csh' +full_sed='sed' +gccansipedantic='' +gccosandvers='' +gccversion='3.4.3' +getgrent_r_proto='0' +getgrgid_r_proto='0' +getgrnam_r_proto='0' +gethostbyaddr_r_proto='0' +gethostbyname_r_proto='0' +gethostent_r_proto='0' +getlogin_r_proto='0' +getnetbyaddr_r_proto='0' +getnetbyname_r_proto='0' +getnetent_r_proto='0' +getprotobyname_r_proto='0' +getprotobynumber_r_proto='0' +getprotoent_r_proto='0' +getpwent_r_proto='0' +getpwnam_r_proto='0' +getpwuid_r_proto='0' +getservbyname_r_proto='0' +getservbyport_r_proto='0' +getservent_r_proto='0' +getspnam_r_proto='0' +gidformat='"lu"' +gidsign='1' +gidsize='4' +gidtype='gid_t' +glibpth='/usr/shlib /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib /usr/ucblib /usr/local/lib ' +gmake='gmake' +gmtime_r_proto='0' +gnulibc_version='' +grep='grep' +groupcat='cat /etc/group' +groupstype='gid_t' +gzip='gzip' +h_fcntl='false' +h_sysfile='true' +hint='recommended' +hostcat='cat /etc/hosts' +html1dir=' ' +html1direxp='' +html3dir=' ' +html3direxp='' +i16size='2' +i16type='short' +i32size='4' +i32type='long' +i64size='8' +i64type='long long' +i8size='1' +i8type='char' +i_arpainet='define' +i_bsdioctl='' +i_crypt='define' +i_db='define' +i_dbm='undef' +i_dirent='define' +i_dld='undef' +i_dlfcn='define' +i_fcntl='undef' +i_float='define' +i_fp='undef' +i_fp_class='undef' +i_gdbm='define' +i_grp='define' +i_ieeefp='undef' +i_inttypes='define' +i_langinfo='define' +i_libutil='undef' +i_limits='define' +i_locale='define' +i_machcthr='undef' +i_malloc='define' +i_math='define' +i_memory='undef' +i_mntent='define' +i_ndbm='undef' +i_netdb='define' +i_neterrno='undef' +i_netinettcp='define' +i_niin='define' +i_poll='define' +i_prot='undef' +i_pthread='define' +i_pwd='define' +i_rpcsvcdbm='undef' +i_sfio='undef' +i_sgtty='undef' +i_shadow='define' +i_socks='undef' +i_stdarg='define' +i_stddef='define' +i_stdlib='define' +i_string='define' +i_sunmath='undef' +i_sysaccess='undef' +i_sysdir='define' +i_sysfile='define' +i_sysfilio='undef' +i_sysin='undef' +i_sysioctl='define' +i_syslog='define' +i_sysmman='define' +i_sysmode='undef' +i_sysmount='define' +i_sysndir='undef' +i_sysparam='define' +i_sysresrc='define' +i_syssecrt='undef' +i_sysselct='define' +i_syssockio='undef' +i_sysstat='define' +i_sysstatfs='define' +i_sysstatvfs='define' +i_systime='define' +i_systimek='undef' +i_systimes='define' +i_systypes='define' +i_sysuio='define' +i_sysun='define' +i_sysutsname='define' +i_sysvfs='define' +i_syswait='define' +i_termio='undef' +i_termios='define' +i_time='define' +i_unistd='define' +i_ustat='define' +i_utime='define' +i_values='define' +i_varargs='undef' +i_varhdr='stdarg.h' +i_vfork='undef' +ignore_versioned_solibs='y' +inc_version_list=' ' +inc_version_list_init='0' +incpath='' +inews='' +installarchlib='/usr/lib/perl5/5.10' +installbin='/usr/bin' +initialinstalllocation='/usr/bin' +installhtml1dir='' +installhtml3dir='' +installman1dir='' +installman3dir='' +installprefix='/usr' +installprefixexp='/usr' +installprivlib='/usr/lib/perl5/5.10' +installscript='/usr/bin' +installsitearch='/usr/lib/perl5/5.10' +installsitebin='/usr/bin' +installsitehtml1dir='' +installsitehtml3dir='' +installsitelib='/usr/lib/perl5/5.10' +installsiteman1dir='' +installsiteman3dir='' +installsitescript='/usr/bin' +installstyle='lib/perl5' +installusrbinperl='define' +installvendorarch='' +installvendorbin='' +installvendorhtml1dir='' +installvendorhtml3dir='' +installvendorlib='' +installvendorman1dir='' +installvendorman3dir='' +installvendorscript='' +intsize='4' +issymlink='test -h' +ivdformat='"ld"' +ivsize='4' +ivtype='long' +known_extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize Win32 Win32API/File Win32CORE XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' +ksh='' +ld='%%LD%%' +lddlflags='-shared %%LDFLAGS%%' +ldflags='%%EXTRA_PERLLIBDIRS%%' +ldflags_uselargefiles='' +ldlibpthname='LD_LIBRARY_PATH' +less='less' +lib_ext='.a' +libc='' +libperl='libperl.a' +libpth='%%LIBDIRS%%' +libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc' +libsdirs='%%LIBDIRS%%' +libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' +libspath='%%LIBDIRS%%' +libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD' +libswanted_uselargefiles='' +line='' +lint='' +lkflags='' +ln='ln' +lns='/bin/ln -s' +localtime_r_proto='0' +locincpth=' ' +loclibpth=' ' +longdblsize='8' +longlongsize='8' +longsize='4' +lp='' +lpr='' +ls='ls' +lseeksize='8' +lseektype='off_t' +mad='undef' +madlyh='' +madlyobj='' +madlysrc='' +mail='' +mailx='' +make='make' +make_set_make='#' +mallocobj='' +mallocsrc='' +malloctype='void *' +man1dir=' ' +man1direxp='' +man1ext='0' +man3dir=' ' +man3direxp='' +man3ext='0' +mips_type='' +mistrustnm='' +mkdir='mkdir' +mmaptype='void *' +modetype='mode_t' +more='more' +multiarch='undef' +mv='' +myarchname='armeb-linux-uclibc' +mydomain='.dev.null' +myhostname='maia' +myuname='linux maia 2.6.22 #1 wed jul 11 12:24:09 cest 2007 armv5teb unknown unknown gnulinux ' +n='-n' +need_va_copy='undef' +netdb_hlen_type='size_t' +netdb_host_type='const void *' +netdb_name_type='const char *' +netdb_net_type='in_addr_t' +nm='nm' +nm_opt='' +nm_so_opt='--dynamic' +nonxs_ext='Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib' +nroff='nroff' +nvEUformat='"E"' +nvFUformat='"F"' +nvGUformat='"G"' +nv_preserves_uv_bits='32' +nveformat='"e"' +nvfformat='"f"' +nvgformat='"g"' +nvsize='8' +nvtype='double' +o_nonblock='O_NONBLOCK' +obj_ext='.o' +old_pthread_create_joinable='' +optimize='-O2' +orderlib='false' +osname='linux' +osvers='2.6.22' +otherlibdirs=' ' +package='perl5' +pager='/usr/bin/less' +passcat='cat /etc/passwd' +patchlevel='10' +path_sep=':' +perl5='' +perl='' +perl_patchlevel='' +perladmin='root@maia.dev.null' +perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%' +perlpath='/usr/bin/perl' +pg='pg' +phostname='hostname' +pidtype='pid_t' +plibpth='' +pmake='' +pr='' +prefix='/usr' +prefixexp='/usr' +privlib='/usr/lib/perl5/5.10' +privlibexp='/usr/lib/perl5/5.10' +procselfexe='"/proc/self/exe"' +prototype='define' +ptrsize='4' +quadkind='3' +quadtype='long long' +randbits='48' +randfunc='drand48' +random_r_proto='0' +randseedtype='long' +ranlib=':' +rd_nodata='-1' +readdir64_r_proto='0' +readdir_r_proto='0' +revision='5' +rm='rm' +rm_try='/bin/rm -f try try a.out .out try.[cho] try..o core core.try* try.core*' +rmail='' +run='' +runnm='false' +sPRIEUldbl='"E"' +sPRIFUldbl='"F"' +sPRIGUldbl='"G"' +sPRIXU64='"LX"' +sPRId64='"Ld"' +sPRIeldbl='"e"' +sPRIfldbl='"f"' +sPRIgldbl='"g"' +sPRIi64='"Li"' +sPRIo64='"Lo"' +sPRIu64='"Lu"' +sPRIx64='"Lx"' +sSCNfldbl='"f"' +sched_yield='sched_yield()' +scriptdir='/usr/bin' +scriptdirexp='/usr/bin' +sed='sed' +seedfunc='srand48' +selectminbits='32' +selecttype='fd_set *' +sendmail='' +setgrent_r_proto='0' +sethostent_r_proto='0' +setlocale_r_proto='0' +setnetent_r_proto='0' +setprotoent_r_proto='0' +setpwent_r_proto='0' +setservent_r_proto='0' +sh='/bin/sh' +shar='' +sharpbang='#!' +shmattype='void *' +shortsize='2' +shrpenv='' +shsharp='true' +sig_count='64' +sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN NUM33 NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 RTMAX IOT CLD POLL UNUSED ' +sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "RTMIN", "NUM33", "NUM34", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0' +sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 6 17 29 31 ' +sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 6, 17, 29, 31, 0' +sig_size='68' +signal_t='void' +sitearch='' +sitearchexp='' +sitebin='/usr/bin' +sitebinexp='/usr/bin' +sitehtml1dir='' +sitehtml1direxp='' +sitehtml3dir='' +sitehtml3direxp='' +sitelib='' +#sitelib_stem='/usr/lib/perl5/site_perl' +sitelibexp='' +siteman1dir='' +siteman1direxp='' +siteman3dir='' +siteman3direxp='' +siteprefix='/usr' +siteprefixexp='/usr' +sitescript='/usr/bin' +sitescriptexp='/usr/bin' +sizesize='4' +sizetype='size_t' +sleep='' +smail='' +so='so' +sockethdr='' +socketlib='' +socksizetype='socklen_t' +sort='sort' +spackage='Perl5' +spitshell='cat' +srand48_r_proto='0' +srandom_r_proto='0' +src='.' +ssizetype='ssize_t' +startperl='#!/usr/bin/perl' +startsh='#!/bin/sh' +static_ext=' ' +stdchar='char' +stdio_base='((fp)->_base)' +stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)' +stdio_cnt='((fp)->_cnt)' +stdio_filbuf='' +stdio_ptr='((fp)->_ptr)' +stdio_stream_array='' +strerror_r_proto='0' +#strings='/usr/include/string.h' +submit='' +subversion='0' +sysman='/usr/share/man/man1' +tail='' +tar='' +targetarch='armeb-linux-uclibc' +tbl='' +tee='' +test='test' +#timeincl='/usr/include/sys/time.h /usr/include/time.h ' +timetype='time_t' +tmpnam_r_proto='0' +to=':' +touch='touch' +tr='tr' +trnl='\n' +troff='' +ttyname_r_proto='0' +u16size='2' +u16type='unsigned short' +u32size='4' +u32type='unsigned long' +u64size='8' +u64type='unsigned long long' +u8size='1' +u8type='unsigned char' +uidformat='"lu"' +uidsign='1' +uidsize='4' +uidtype='uid_t' +uname='uname' +uniq='uniq' +uquadtype='unsigned long long' +use5005threads='undef' +use64bitall='undef' +use64bitint='undef' +usecrosscompile='define' +usedl='define' +usefaststdio='undef' +useithreads='undef' +uselargefiles='define' +uselongdouble='undef' +usemallocwrap='define' +usemorebits='undef' +usemultiplicity='undef' +usemymalloc='n' +usenm='true' +useopcode='true' +useperlio='define' +useposix='true' +usereentrant='undef' +userelocatableinc='undef' +usesfio='false' +useshrplib='false' +usesitecustomize='undef' +usesocks='undef' +usethreads='undef' +usevendorprefix='undef' +usevfork='false' +usrinc='%%INCDIRS%%' +uuname='' +uvXUformat='"lX"' +uvoformat='"lo"' +uvsize='4' +uvtype='unsigned long' +uvuformat='"lu"' +uvxformat='"lx"' +vendorarch='' +vendorarchexp='' +vendorbin='' +vendorbinexp='' +vendorhtml1dir=' ' +vendorhtml1direxp='' +vendorhtml3dir=' ' +vendorhtml3direxp='' +vendorlib='' +vendorlib_stem='' +vendorlibexp='' +vendorman1dir=' ' +vendorman1direxp='' +vendorman3dir=' ' +vendorman3direxp='' +vendorprefix='' +vendorprefixexp='' +vendorscript='' +vendorscriptexp='' +version='5.10.0' +version_patchlevel_string='version 10 subversion 0' +versiononly='undef' +vi='' +voidflags='15' +xlibpth='/usr/lib/386 /lib/386' +yacc='yacc' +yaccflags='' +zcat='' +zip='zip' +# Configure command line arguments. +config_arg0='./Configure' +config_args='-der' +config_argc=1 +config_arg1='-der' +PERL_REVISION=5 +PERL_VERSION=10 +PERL_SUBVERSION=0 +PERL_API_REVISION=5 +PERL_API_VERSION=10 +PERL_API_SUBVERSION=0 +PERL_PATCHLEVEL= +PERL_CONFIG_SH=true +# Fix problem with HiRes timer. +d_nanosleep='define' +d_clock_gettime='define' +d_clock_getres='define' +d_clock_nanosleep='define' +d_clock='define' diff --git a/lang/perl/files/config.sh-avr32.in b/lang/perl/files/config.sh-avr32.in new file mode 100644 index 0000000..1108364 --- /dev/null +++ b/lang/perl/files/config.sh-avr32.in @@ -0,0 +1,1070 @@ +#!/bin/sh +# +# This file was produced by running the Configure script. It holds all the +# definitions figured out by Configure. Should you modify one of these values, +# do not forget to propagate your changes by running "Configure -der". You may +# instead choose to run each of the .SH files by yourself, or "Configure -S". +# + +# Package name : perl5 +# Source directory : . +# Configuration time: Fri Jul 20 04:39:05 MDT 2007 +# Configured by : root +# Target system : linux maia 2.6.22 #1 wed jul 11 12:24:09 cest 2007 armv5teb unknown unknown gnulinux + +Author='' +Date='$Date' +Header='' +Id='$Id' +Locker='' +Log='$Log' +Mcc='Mcc' +RCSfile='$RCSfile' +Revision='$Revision' +Source='' +State='' +_a='.a' +_exe='' +_o='.o' +afs='false' +afsroot='/afs' +alignbytes='8' +ansi2knr='' +aphostname='/bin/hostname' +api_revision='5' +api_subversion='0' +api_version='10' +api_versionstring='5.10.0' +ar='ar' +archlib='' +archlibexp='' +archname64='' +archname='avr32-linux-uclibc' +archobjs='' +asctime_r_proto='0' +awk='awk' +baserev='5.0' +bash='' +bin='/usr/bin' +binexp='/usr/bin' +bison='bison' +byacc='byacc' +byteorder='4321' +c='' +castflags='0' +cat='cat' +cc='%%CC%%' +cccdlflags='-fPIC' +ccdlflags='-Wl,-E' +ccflags='%%CFLAGS%%' +ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' +ccname='gcc' +ccsymbols='' +ccversion='' +cf_by='root' +cf_email='root@maia.dev.null' +cf_time='Fri Jul 20 04:39:05 MDT 2007' +chgrp='' +chmod='chmod' +chown='' +clocktype='clock_t' +comm='comm' +compress='' +contains='grep' +cp='cp' +cpio='' +cpp='cpp' +cpp_stuff='42' +cppccsymbols='' +cppflags='%%CFLAGS%%' +cpplast='-' +cppminus='-' +cpprun='%%CPP%%' +cppstdin='%%CPP%%' +cppsymbols='__ELF__=1 _FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC__=3 __GNUC_MINOR__=4 __GNU_LIBRARY__=6 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=199506L _POSIX_SOURCE=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 linux=1 __linux=1 __linux__=1 unix=1 __unix=1 __unix__=1' +crypt_r_proto='0' +cryptlib='' +csh='csh' +ctermid_r_proto='0' +ctime_r_proto='0' +# Matteo Croce, Mon, 21 Apr 2008 03:19:30 +0200 +# Fixes perl: can't resolve symbol 'gcvt' +d_Gconvert='sprintf((b),"%.*g",(n),(x))' +d_PRIEUldbl='define' +d_PRIFUldbl='define' +d_PRIGUldbl='define' +d_PRIXU64='define' +d_PRId64='define' +d_PRIeldbl='define' +d_PRIfldbl='define' +d_PRIgldbl='define' +d_PRIi64='define' +d_PRIo64='define' +d_PRIu64='define' +d_PRIx64='define' +d_SCNfldbl='define' +d__fwalk='undef' +d_access='define' +d_accessx='undef' +d_aintl='undef' +d_alarm='define' +d_archlib='undef' +d_asctime_r='undef' +d_atolf='undef' +d_atoll='define' +d_attribute_format='define' +d_attribute_malloc='define' +d_attribute_nonnull='define' +d_attribute_noreturn='define' +d_attribute_pure='define' +d_attribute_unused='define' +d_attribute_warn_unused_result='define' +d_bcmp='define' +d_bcopy='define' +d_bsd='undef' +d_bsdgetpgrp='undef' +d_bsdsetpgrp='undef' +d_builtin_choose_expr='define' +d_builtin_expect='undef' +d_bzero='define' +d_c99_variadic_macros='define' +d_casti32='define' +d_castneg='define' +d_charvspr='undef' +d_chown='define' +d_chroot='define' +d_chsize='undef' +d_class='undef' +d_clearenv='define' +d_closedir='define' +d_cmsghdr_s='define' +d_const='define' +d_copysignl='undef' +d_cplusplus='undef' +d_crypt='define' +d_crypt_r='undef' +d_csh='undef' +d_ctermid='define' +d_ctermid_r='undef' +d_ctime_r='undef' +d_cuserid='define' +d_dbl_dig='define' +d_dbminitproto='undef' +d_difftime='define' +d_dir_dd_fd='undef' +d_dirfd='define' +d_dirnamlen='undef' +d_dlerror='define' +d_dlopen='define' +d_dlsymun='undef' +d_dosuid='undef' +d_drand48_r='undef' +d_drand48proto='define' +d_dup2='define' +d_eaccess='undef' +d_endgrent='define' +d_endgrent_r='undef' +d_endhent='define' +d_endhostent_r='undef' +d_endnent='define' +d_endnetent_r='undef' +d_endpent='define' +d_endprotoent_r='undef' +d_endpwent='define' +d_endpwent_r='undef' +d_endsent='define' +d_endservent_r='undef' +d_eofnblk='define' +d_eunice='undef' +d_faststdio='undef' +d_fchdir='define' +d_fchmod='define' +d_fchown='define' +d_fcntl='define' +d_fcntl_can_lock='define' +d_fd_macros='define' +d_fd_set='define' +d_fds_bits='undef' +d_fgetpos='define' +d_finite='define' +d_finitel='undef' +d_flexfnam='define' +d_flock='define' +d_flockproto='define' +d_fork='define' +d_fp_class='undef' +d_fpathconf='define' +d_fpclass='undef' +d_fpclassify='undef' +d_fpclassl='undef' +d_fpos64_t='undef' +d_frexpl='undef' +d_fs_data_s='undef' +d_fseeko='define' +d_fsetpos='define' +d_fstatfs='define' +d_fstatvfs='define' +d_fsync='define' +d_ftello='define' +d_ftime='undef' +d_futimes='undef' +d_getcwd='define' +d_getespwnam='undef' +d_getfsstat='undef' +d_getgrent='define' +d_getgrent_r='undef' +d_getgrgid_r='undef' +d_getgrnam_r='undef' +d_getgrps='define' +d_gethbyaddr='define' +d_gethbyname='define' +d_gethent='define' +d_gethname='define' +d_gethostbyaddr_r='undef' +d_gethostbyname_r='undef' +d_gethostent_r='undef' +d_gethostprotos='define' +d_getitimer='define' +d_getlogin='define' +d_getlogin_r='undef' +d_getmnt='undef' +d_getmntent='define' +d_getnbyaddr='define' +d_getnbyname='define' +d_getnent='define' +d_getnetbyaddr_r='undef' +d_getnetbyname_r='undef' +d_getnetent_r='undef' +d_getnetprotos='define' +d_getpagsz='define' +d_getpbyname='define' +d_getpbynumber='define' +d_getpent='define' +d_getpgid='define' +d_getpgrp2='undef' +d_getpgrp='define' +d_getppid='define' +d_getprior='define' +d_getprotobyname_r='undef' +d_getprotobynumber_r='undef' +d_getprotoent_r='undef' +d_getprotoprotos='define' +d_getprpwnam='undef' +d_getpwent='define' +d_getpwent_r='undef' +d_getpwnam_r='undef' +d_getpwuid_r='undef' +d_getsbyname='define' +d_getsbyport='define' +d_getsent='define' +d_getservbyname_r='undef' +d_getservbyport_r='undef' +d_getservent_r='undef' +d_getservprotos='define' +d_getspnam='define' +d_getspnam_r='undef' +d_gettimeod='define' +d_gmtime_r='undef' +d_gnulibc='undef' +d_grpasswd='define' +d_hasmntopt='define' +d_htonl='define' +d_ilogbl='undef' +d_inc_version_list='undef' +d_index='undef' +d_inetaton='define' +d_int64_t='define' +d_isascii='define' +d_isfinite='undef' +d_isinf='define' +d_isnan='define' +d_isnanl='undef' +d_killpg='define' +d_lchown='define' +d_ldbl_dig='define' +d_libm_lib_version='define' +d_link='define' +d_localtime_r='undef' +d_localtime_r_needs_tzset='undef' +d_locconv='define' +d_lockf='define' +d_longdbl='define' +d_longlong='define' +d_lseekproto='define' +d_lstat='define' +d_madvise='define' +d_malloc_good_size='undef' +d_malloc_size='undef' +d_mblen='define' +d_mbstowcs='define' +d_mbtowc='define' +d_memchr='define' +d_memcmp='define' +d_memcpy='define' +d_memmove='define' +d_memset='define' +d_mkdir='define' +d_mkdtemp='define' +d_mkfifo='define' +d_mkstemp='define' +d_mkstemps='undef' +d_mktime='define' +d_mmap='define' +d_modfl='undef' +d_modfl_pow32_bug='undef' +d_modflproto='undef' +d_mprotect='define' +d_msg='define' +d_msg_ctrunc='define' +d_msg_dontroute='define' +d_msg_oob='define' +d_msg_peek='define' +d_msg_proxy='define' +d_msgctl='define' +d_msgget='define' +d_msghdr_s='define' +d_msgrcv='define' +d_msgsnd='define' +d_msync='define' +d_munmap='define' +d_mymalloc='undef' +d_nice='define' +d_nl_langinfo='define' +d_nv_preserves_uv='define' +d_nv_zero_is_allbits_zero='define' +d_off64_t='undef' +d_old_pthread_create_joinable='undef' +d_oldpthreads='undef' +d_oldsock='undef' +d_open3='define' +d_pathconf='define' +d_pause='define' +d_perl_otherlibdirs='undef' +d_phostname='undef' +d_pipe='define' +d_poll='define' +d_portable='define' +d_printf_format_null='define' +d_procselfexe='define' +d_pseudofork='undef' +d_pthread_atfork='undef' +d_pthread_attr_setscope='define' +d_pthread_yield='undef' +d_pwage='undef' +d_pwchange='undef' +d_pwclass='undef' +d_pwcomment='undef' +d_pwexpire='undef' +d_pwgecos='define' +d_pwpasswd='define' +d_pwquota='undef' +d_qgcvt='undef' +d_quad='define' +d_random_r='undef' +d_readdir64_r='undef' +d_readdir='define' +d_readdir_r='undef' +d_readlink='define' +d_readv='define' +d_recvmsg='define' +d_rename='define' +d_rewinddir='define' +d_rmdir='define' +d_safebcpy='undef' +d_safemcpy='undef' +d_sanemcmp='define' +d_sbrkproto='define' +d_scalbnl='undef' +d_sched_yield='define' +d_scm_rights='define' +d_seekdir='define' +d_select='define' +d_sem='define' +d_semctl='define' +d_semctl_semid_ds='define' +d_semctl_semun='define' +d_semget='define' +d_semop='define' +d_sendmsg='define' +d_setegid='define' +d_seteuid='define' +d_setgrent='define' +d_setgrent_r='undef' +d_setgrps='define' +d_sethent='define' +d_sethostent_r='undef' +d_setitimer='define' +d_setlinebuf='define' +d_setlocale='define' +d_setlocale_r='undef' +d_setnent='define' +d_setnetent_r='undef' +d_setpent='define' +d_setpgid='define' +d_setpgrp2='undef' +d_setpgrp='define' +d_setprior='define' +d_setproctitle='undef' +d_setprotoent_r='undef' +d_setpwent='define' +d_setpwent_r='undef' +d_setregid='define' +d_setresgid='define' +d_setresuid='define' +d_setreuid='define' +d_setrgid='undef' +d_setruid='undef' +d_setsent='define' +d_setservent_r='undef' +d_setsid='define' +d_setvbuf='define' +d_sfio='undef' +d_shm='define' +d_shmat='define' +d_shmatprototype='define' +d_shmctl='define' +d_shmdt='define' +d_shmget='define' +d_sigaction='define' +d_signbit='undef' +d_sigprocmask='define' +d_sigsetjmp='define' +d_sitearch='define' +d_snprintf='define' +d_sockatmark='undef' +d_sockatmarkproto='undef' +d_socket='define' +d_socklen_t='define' +d_sockpair='define' +d_socks5_init='undef' +d_sprintf_returns_strlen='define' +d_sqrtl='undef' +d_srand48_r='undef' +d_srandom_r='undef' +d_sresgproto='undef' +d_sresuproto='undef' +d_statblks='define' +d_statfs_f_flags='undef' +d_statfs_s='define' +d_statvfs='define' +d_stdio_cnt_lval='undef' +d_stdio_ptr_lval='undef' +d_stdio_ptr_lval_nochange_cnt='undef' +d_stdio_ptr_lval_sets_cnt='undef' +d_stdio_stream_array='undef' +d_stdiobase='undef' +d_stdstdio='undef' +d_strchr='define' +d_strcoll='define' +d_strctcpy='define' +d_strerrm='strerror(e)' +d_strerror='define' +d_strerror_r='undef' +d_strftime='define' +d_strlcat='define' +d_strlcpy='define' +d_strtod='define' +d_strtol='define' +d_strtold='define' +d_strtoll='define' +d_strtoq='define' +d_strtoul='define' +d_strtoull='define' +d_strtouq='define' +d_strxfrm='define' +d_suidsafe='undef' +d_symlink='define' +d_syscall='define' +d_syscallproto='define' +d_sysconf='define' +d_sysernlst='' +d_syserrlst='undef' +d_system='define' +d_tcgetpgrp='define' +d_tcsetpgrp='define' +d_telldir='define' +d_telldirproto='define' +d_time='define' +d_times='define' +d_tm_tm_gmtoff='define' +d_tm_tm_zone='define' +d_tmpnam_r='undef' +d_truncate='define' +d_ttyname_r='undef' +d_tzname='define' +d_u32align='undef' +d_ualarm='define' +d_umask='define' +d_uname='define' +d_union_semun='undef' +d_unordered='undef' +d_unsetenv='define' +d_usleep='define' +d_usleepproto='define' +d_ustat='define' +d_vendorarch='undef' +d_vendorbin='undef' +d_vendorlib='undef' +d_vendorscript='undef' +d_vfork='undef' +d_void_closedir='undef' +d_voidsig='define' +d_voidtty='' +d_volatile='define' +d_vprintf='define' +d_vsnprintf='define' +d_wait4='define' +d_waitpid='define' +d_wcstombs='define' +d_wctomb='define' +d_writev='define' +d_xenix='undef' +date='date' +db_hashtype='u_int32_t' +db_prefixtype='size_t' +db_version_major='' +db_version_minor='' +db_version_patch='' +defvoidused='15' +direntrytype='struct dirent' +dlext='so' +dlsrc='dl_dlopen.xs' +doublesize='8' +drand01='drand48()' +drand48_r_proto='0' +dynamic_ext='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' +eagain='EAGAIN' +ebcdic='undef' +echo='echo' +egrep='egrep' +emacs='' +endgrent_r_proto='0' +endhostent_r_proto='0' +endnetent_r_proto='0' +endprotoent_r_proto='0' +endpwent_r_proto='0' +endservent_r_proto='0' +eunicefix=':' +exe_ext='' +expr='expr' +extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib' +extras='' +fflushNULL='define' +fflushall='undef' +find='' +firstmakefile='makefile' +flex='' +fpossize='20' +fpostype='fpos_t' +freetype='void' +from=':' +full_ar='%%AR%%' +full_csh='csh' +full_sed='sed' +gccansipedantic='' +gccosandvers='' +gccversion='3.4.3' +getgrent_r_proto='0' +getgrgid_r_proto='0' +getgrnam_r_proto='0' +gethostbyaddr_r_proto='0' +gethostbyname_r_proto='0' +gethostent_r_proto='0' +getlogin_r_proto='0' +getnetbyaddr_r_proto='0' +getnetbyname_r_proto='0' +getnetent_r_proto='0' +getprotobyname_r_proto='0' +getprotobynumber_r_proto='0' +getprotoent_r_proto='0' +getpwent_r_proto='0' +getpwnam_r_proto='0' +getpwuid_r_proto='0' +getservbyname_r_proto='0' +getservbyport_r_proto='0' +getservent_r_proto='0' +getspnam_r_proto='0' +gidformat='"lu"' +gidsign='1' +gidsize='4' +gidtype='gid_t' +glibpth='/usr/shlib /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib /usr/ucblib /usr/local/lib ' +gmake='gmake' +gmtime_r_proto='0' +gnulibc_version='' +grep='grep' +groupcat='cat /etc/group' +groupstype='gid_t' +gzip='gzip' +h_fcntl='false' +h_sysfile='true' +hint='recommended' +hostcat='cat /etc/hosts' +html1dir=' ' +html1direxp='' +html3dir=' ' +html3direxp='' +i16size='2' +i16type='short' +i32size='4' +i32type='long' +i64size='8' +i64type='long long' +i8size='1' +i8type='char' +i_arpainet='define' +i_bsdioctl='' +i_crypt='define' +i_db='define' +i_dbm='undef' +i_dirent='define' +i_dld='undef' +i_dlfcn='define' +i_fcntl='undef' +i_float='define' +i_fp='undef' +i_fp_class='undef' +i_gdbm='define' +i_grp='define' +i_ieeefp='undef' +i_inttypes='define' +i_langinfo='define' +i_libutil='undef' +i_limits='define' +i_locale='define' +i_machcthr='undef' +i_malloc='define' +i_math='define' +i_memory='undef' +i_mntent='define' +i_ndbm='undef' +i_netdb='define' +i_neterrno='undef' +i_netinettcp='define' +i_niin='define' +i_poll='define' +i_prot='undef' +i_pthread='define' +i_pwd='define' +i_rpcsvcdbm='undef' +i_sfio='undef' +i_sgtty='undef' +i_shadow='define' +i_socks='undef' +i_stdarg='define' +i_stddef='define' +i_stdlib='define' +i_string='define' +i_sunmath='undef' +i_sysaccess='undef' +i_sysdir='define' +i_sysfile='define' +i_sysfilio='undef' +i_sysin='undef' +i_sysioctl='define' +i_syslog='define' +i_sysmman='define' +i_sysmode='undef' +i_sysmount='define' +i_sysndir='undef' +i_sysparam='define' +i_sysresrc='define' +i_syssecrt='undef' +i_sysselct='define' +i_syssockio='undef' +i_sysstat='define' +i_sysstatfs='define' +i_sysstatvfs='define' +i_systime='define' +i_systimek='undef' +i_systimes='define' +i_systypes='define' +i_sysuio='define' +i_sysun='define' +i_sysutsname='define' +i_sysvfs='define' +i_syswait='define' +i_termio='undef' +i_termios='define' +i_time='define' +i_unistd='define' +i_ustat='define' +i_utime='define' +i_values='define' +i_varargs='undef' +i_varhdr='stdarg.h' +i_vfork='undef' +ignore_versioned_solibs='y' +inc_version_list=' ' +inc_version_list_init='0' +incpath='' +inews='' +installarchlib='/usr/lib/perl5/5.10' +installbin='/usr/bin' +initialinstalllocation='/usr/bin' +installhtml1dir='' +installhtml3dir='' +installman1dir='' +installman3dir='' +installprefix='/usr' +installprefixexp='/usr' +installprivlib='/usr/lib/perl5/5.10' +installscript='/usr/bin' +installsitearch='/usr/lib/perl5/5.10' +installsitebin='/usr/bin' +installsitehtml1dir='' +installsitehtml3dir='' +installsitelib='/usr/lib/perl5/5.10' +installsiteman1dir='' +installsiteman3dir='' +installsitescript='/usr/bin' +installstyle='lib/perl5' +installusrbinperl='define' +installvendorarch='' +installvendorbin='' +installvendorhtml1dir='' +installvendorhtml3dir='' +installvendorlib='' +installvendorman1dir='' +installvendorman3dir='' +installvendorscript='' +intsize='4' +issymlink='test -h' +ivdformat='"ld"' +ivsize='4' +ivtype='long' +known_extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize Win32 Win32API/File Win32CORE XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' +ksh='' +ld='%%LD%%' +lddlflags='-shared %%LDFLAGS%%' +ldflags='%%EXTRA_PERLLIBDIRS%%' +ldflags_uselargefiles='' +ldlibpthname='LD_LIBRARY_PATH' +less='less' +lib_ext='.a' +libc='' +libperl='libperl.a' +libpth='%%LIBDIRS%%' +libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc' +libsdirs='%%LIBDIRS%%' +libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' +libspath='%%LIBDIRS%%' +libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD' +libswanted_uselargefiles='' +line='' +lint='' +lkflags='' +ln='ln' +lns='/bin/ln -s' +localtime_r_proto='0' +locincpth=' ' +loclibpth=' ' +longdblsize='8' +longlongsize='8' +longsize='4' +lp='' +lpr='' +ls='ls' +lseeksize='8' +lseektype='off_t' +mad='undef' +madlyh='' +madlyobj='' +madlysrc='' +mail='' +mailx='' +make='make' +make_set_make='#' +mallocobj='' +mallocsrc='' +malloctype='void *' +man1dir=' ' +man1direxp='' +man1ext='0' +man3dir=' ' +man3direxp='' +man3ext='0' +mips_type='' +mistrustnm='' +mkdir='mkdir' +mmaptype='void *' +modetype='mode_t' +more='more' +multiarch='undef' +mv='' +myarchname='avr32-linux-uclibc' +mydomain='.dev.null' +myhostname='maia' +myuname='linux maia 2.6.22 #1 wed jul 11 12:24:09 cest 2007 armv5teb unknown unknown gnulinux ' +n='-n' +need_va_copy='undef' +netdb_hlen_type='size_t' +netdb_host_type='const void *' +netdb_name_type='const char *' +netdb_net_type='in_addr_t' +nm='nm' +nm_opt='' +nm_so_opt='--dynamic' +nonxs_ext='Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib' +nroff='nroff' +nvEUformat='"E"' +nvFUformat='"F"' +nvGUformat='"G"' +nv_preserves_uv_bits='32' +nveformat='"e"' +nvfformat='"f"' +nvgformat='"g"' +nvsize='8' +nvtype='double' +o_nonblock='O_NONBLOCK' +obj_ext='.o' +old_pthread_create_joinable='' +optimize='-O2' +orderlib='false' +osname='linux' +osvers='2.6.22' +otherlibdirs=' ' +package='perl5' +pager='/usr/bin/less' +passcat='cat /etc/passwd' +patchlevel='10' +path_sep=':' +perl5='' +perl='' +perl_patchlevel='' +perladmin='root@maia.dev.null' +perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%' +perlpath='/usr/bin/perl' +pg='pg' +phostname='hostname' +pidtype='pid_t' +plibpth='' +pmake='' +pr='' +prefix='/usr' +prefixexp='/usr' +privlib='/usr/lib/perl5/5.10' +privlibexp='/usr/lib/perl5/5.10' +procselfexe='"/proc/self/exe"' +prototype='define' +ptrsize='4' +quadkind='3' +quadtype='long long' +randbits='48' +randfunc='drand48' +random_r_proto='0' +randseedtype='long' +ranlib=':' +rd_nodata='-1' +readdir64_r_proto='0' +readdir_r_proto='0' +revision='5' +rm='rm' +rm_try='/bin/rm -f try try a.out .out try.[cho] try..o core core.try* try.core*' +rmail='' +run='' +runnm='false' +sPRIEUldbl='"E"' +sPRIFUldbl='"F"' +sPRIGUldbl='"G"' +sPRIXU64='"LX"' +sPRId64='"Ld"' +sPRIeldbl='"e"' +sPRIfldbl='"f"' +sPRIgldbl='"g"' +sPRIi64='"Li"' +sPRIo64='"Lo"' +sPRIu64='"Lu"' +sPRIx64='"Lx"' +sSCNfldbl='"f"' +sched_yield='sched_yield()' +scriptdir='/usr/bin' +scriptdirexp='/usr/bin' +sed='sed' +seedfunc='srand48' +selectminbits='32' +selecttype='fd_set *' +sendmail='' +setgrent_r_proto='0' +sethostent_r_proto='0' +setlocale_r_proto='0' +setnetent_r_proto='0' +setprotoent_r_proto='0' +setpwent_r_proto='0' +setservent_r_proto='0' +sh='/bin/sh' +shar='' +sharpbang='#!' +shmattype='void *' +shortsize='2' +shrpenv='' +shsharp='true' +sig_count='64' +sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN NUM33 NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 RTMAX IOT CLD POLL UNUSED ' +sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "RTMIN", "NUM33", "NUM34", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0' +sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 6 17 29 31 ' +sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 6, 17, 29, 31, 0' +sig_size='68' +signal_t='void' +sitearch='' +sitearchexp='' +sitebin='/usr/bin' +sitebinexp='/usr/bin' +sitehtml1dir='' +sitehtml1direxp='' +sitehtml3dir='' +sitehtml3direxp='' +sitelib='' +#sitelib_stem='/usr/lib/perl5/site_perl' +sitelibexp='' +siteman1dir='' +siteman1direxp='' +siteman3dir='' +siteman3direxp='' +siteprefix='/usr' +siteprefixexp='/usr' +sitescript='/usr/bin' +sitescriptexp='/usr/bin' +sizesize='4' +sizetype='size_t' +sleep='' +smail='' +so='so' +sockethdr='' +socketlib='' +socksizetype='socklen_t' +sort='sort' +spackage='Perl5' +spitshell='cat' +srand48_r_proto='0' +srandom_r_proto='0' +src='.' +ssizetype='ssize_t' +startperl='#!/usr/bin/perl' +startsh='#!/bin/sh' +static_ext=' ' +stdchar='char' +stdio_base='((fp)->_base)' +stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)' +stdio_cnt='((fp)->_cnt)' +stdio_filbuf='' +stdio_ptr='((fp)->_ptr)' +stdio_stream_array='' +strerror_r_proto='0' +#strings='/usr/include/string.h' +submit='' +subversion='0' +sysman='/usr/share/man/man1' +tail='' +tar='' +targetarch='avr32-linux-uclibc' +tbl='' +tee='' +test='test' +#timeincl='/usr/include/sys/time.h /usr/include/time.h ' +timetype='time_t' +tmpnam_r_proto='0' +to=':' +touch='touch' +tr='tr' +trnl='\n' +troff='' +ttyname_r_proto='0' +u16size='2' +u16type='unsigned short' +u32size='4' +u32type='unsigned long' +u64size='8' +u64type='unsigned long long' +u8size='1' +u8type='unsigned char' +uidformat='"lu"' +uidsign='1' +uidsize='4' +uidtype='uid_t' +uname='uname' +uniq='uniq' +uquadtype='unsigned long long' +use5005threads='undef' +use64bitall='undef' +use64bitint='undef' +usecrosscompile='undef' +usedl='define' +usefaststdio='undef' +useithreads='undef' +uselargefiles='define' +uselongdouble='undef' +usemallocwrap='define' +usemorebits='undef' +usemultiplicity='undef' +usemymalloc='n' +usenm='true' +useopcode='true' +useperlio='define' +useposix='true' +usereentrant='undef' +userelocatableinc='undef' +usesfio='false' +useshrplib='false' +usesitecustomize='undef' +usesocks='undef' +usethreads='undef' +usevendorprefix='undef' +usevfork='false' +usrinc='%%INCDIRS%%' +uuname='' +uvXUformat='"lX"' +uvoformat='"lo"' +uvsize='4' +uvtype='unsigned long' +uvuformat='"lu"' +uvxformat='"lx"' +vendorarch='' +vendorarchexp='' +vendorbin='' +vendorbinexp='' +vendorhtml1dir=' ' +vendorhtml1direxp='' +vendorhtml3dir=' ' +vendorhtml3direxp='' +vendorlib='' +vendorlib_stem='' +vendorlibexp='' +vendorman1dir=' ' +vendorman1direxp='' +vendorman3dir=' ' +vendorman3direxp='' +vendorprefix='' +vendorprefixexp='' +vendorscript='' +vendorscriptexp='' +version='5.10.0' +version_patchlevel_string='version 10 subversion 0' +versiononly='undef' +vi='' +voidflags='15' +xlibpth='/usr/lib/386 /lib/386' +yacc='yacc' +yaccflags='' +zcat='' +zip='zip' +# Configure command line arguments. +config_arg0='./Configure' +config_args='-der' +config_argc=1 +config_arg1='-der' +PERL_REVISION=5 +PERL_VERSION=10 +PERL_SUBVERSION=0 +PERL_API_REVISION=5 +PERL_API_VERSION=10 +PERL_API_SUBVERSION=0 +PERL_PATCHLEVEL= +PERL_CONFIG_SH=true +# Fix problem with HiRes timer. +d_nanosleep='define' +d_clock_gettime='define' +d_clock_getres='define' +d_clock_nanosleep='define' +d_clock='define' diff --git a/lang/perl/files/config.sh-i486.in b/lang/perl/files/config.sh-i486.in new file mode 100644 index 0000000..d05fdd0 --- /dev/null +++ b/lang/perl/files/config.sh-i486.in @@ -0,0 +1,1068 @@ +#!/bin/sh +# +# This file was produced by running the Configure script. It holds all the +# definitions figured out by Configure. Should you modify one of these values, +# do not forget to propagate your changes by running "Configure -der". You may +# instead choose to run each of the .SH files by yourself, or "Configure -S". +# + +# Package name : perl5 +# Source directory : . +# Configuration time: Sat Apr 19 15:51:11 MDT 2008 +# Configured by : root +# Target system : linux maia 2.6.25 #2 sat apr 19 09:46:49 cest 2008 i686 unknown unknown gnulinux + +Author='' +Date='$Date' +Header='' +Id='$Id' +Locker='' +Log='$Log' +Mcc='Mcc' +RCSfile='$RCSfile' +Revision='$Revision' +Source='' +State='' +_a='.a' +_exe='' +_o='.o' +afs='false' +afsroot='/afs' +alignbytes='4' +ansi2knr='' +aphostname='/bin/hostname' +api_revision='5' +api_subversion='0' +api_version='10' +api_versionstring='5.10.0' +ar='ar' +archlib='' +archlibexp='' +archname64='' +archname='i386-linux-uclibc' +archobjs='' +asctime_r_proto='0' +awk='awk' +baserev='5.0' +bash='' +bin='/usr/bin' +binexp='/usr/bin' +bison='bison' +byacc='byacc' +byteorder='1234' +c='' +castflags='0' +cat='cat' +cc='%%CC%%' +cccdlflags='-fPIC' +ccdlflags='-Wl,-E' +ccflags='%%CFLAGS%%' +ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' +ccname='gcc' +ccsymbols='' +ccversion='' +cf_by='root' +cf_email='root@maia.dev.null' +cf_time='Sat Apr 19 15:51:11 MDT 2008' +chgrp='' +chmod='chmod' +chown='' +clocktype='clock_t' +comm='comm' +compress='' +contains='grep' +cp='cp' +cpio='' +cpp='cpp' +cpp_stuff='42' +cppccsymbols='' +cppflags='%%CFLAGS%%' +cpplast='-' +cppminus='-' +cpprun='%%CPP%%' +cppstdin='%%CPP%%' +cppsymbols='__ELF__=1 _FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC__=3 __GNUC_MINOR__=4 __GNU_LIBRARY__=6 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=199506L _POSIX_SOURCE=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 i386=1 __i386=1 __i386__=1 linux=1 __linux=1 __linux__=1 unix=1 __unix=1 __unix__=1' +crypt_r_proto='0' +cryptlib='' +csh='csh' +ctermid_r_proto='0' +ctime_r_proto='0' +d_Gconvert='sprintf((b),"%.*g",(n),(x))' +d_PRIEUldbl='define' +d_PRIFUldbl='define' +d_PRIGUldbl='define' +d_PRIXU64='define' +d_PRId64='define' +d_PRIeldbl='define' +d_PRIfldbl='define' +d_PRIgldbl='define' +d_PRIi64='define' +d_PRIo64='define' +d_PRIu64='define' +d_PRIx64='define' +d_SCNfldbl='define' +d__fwalk='undef' +d_access='define' +d_accessx='undef' +d_aintl='undef' +d_alarm='define' +d_archlib='undef' +d_asctime_r='undef' +d_atolf='undef' +d_atoll='define' +d_attribute_format='define' +d_attribute_malloc='define' +d_attribute_nonnull='define' +d_attribute_noreturn='define' +d_attribute_pure='define' +d_attribute_unused='define' +d_attribute_warn_unused_result='define' +d_bcmp='define' +d_bcopy='define' +d_bsd='undef' +d_bsdgetpgrp='undef' +d_bsdsetpgrp='undef' +d_builtin_choose_expr='define' +d_builtin_expect='undef' +d_bzero='define' +d_c99_variadic_macros='define' +d_casti32='undef' +d_castneg='define' +d_charvspr='undef' +d_chown='define' +d_chroot='define' +d_chsize='undef' +d_class='undef' +d_clearenv='define' +d_closedir='define' +d_cmsghdr_s='define' +d_const='define' +d_copysignl='undef' +d_cplusplus='undef' +d_crypt='define' +d_crypt_r='undef' +d_csh='undef' +d_ctermid='define' +d_ctermid_r='undef' +d_ctime_r='undef' +d_cuserid='define' +d_dbl_dig='define' +d_dbminitproto='undef' +d_difftime='define' +d_dir_dd_fd='undef' +d_dirfd='define' +d_dirnamlen='undef' +d_dlerror='define' +d_dlopen='define' +d_dlsymun='undef' +d_dosuid='undef' +d_drand48_r='undef' +d_drand48proto='define' +d_dup2='define' +d_eaccess='undef' +d_endgrent='define' +d_endgrent_r='undef' +d_endhent='define' +d_endhostent_r='undef' +d_endnent='define' +d_endnetent_r='undef' +d_endpent='define' +d_endprotoent_r='undef' +d_endpwent='define' +d_endpwent_r='undef' +d_endsent='define' +d_endservent_r='undef' +d_eofnblk='define' +d_eunice='undef' +d_faststdio='undef' +d_fchdir='define' +d_fchmod='define' +d_fchown='define' +d_fcntl='define' +d_fcntl_can_lock='define' +d_fd_macros='define' +d_fd_set='define' +d_fds_bits='undef' +d_fgetpos='define' +d_finite='define' +d_finitel='undef' +d_flexfnam='define' +d_flock='define' +d_flockproto='define' +d_fork='define' +d_fp_class='undef' +d_fpathconf='define' +d_fpclass='undef' +d_fpclassify='undef' +d_fpclassl='undef' +d_fpos64_t='undef' +d_frexpl='undef' +d_fs_data_s='undef' +d_fseeko='define' +d_fsetpos='define' +d_fstatfs='define' +d_fstatvfs='define' +d_fsync='define' +d_ftello='define' +d_ftime='undef' +d_futimes='undef' +d_getcwd='define' +d_getespwnam='undef' +d_getfsstat='undef' +d_getgrent='define' +d_getgrent_r='undef' +d_getgrgid_r='undef' +d_getgrnam_r='undef' +d_getgrps='define' +d_gethbyaddr='define' +d_gethbyname='define' +d_gethent='define' +d_gethname='define' +d_gethostbyaddr_r='undef' +d_gethostbyname_r='undef' +d_gethostent_r='undef' +d_gethostprotos='define' +d_getitimer='define' +d_getlogin='define' +d_getlogin_r='undef' +d_getmnt='undef' +d_getmntent='define' +d_getnbyaddr='define' +d_getnbyname='define' +d_getnent='define' +d_getnetbyaddr_r='undef' +d_getnetbyname_r='undef' +d_getnetent_r='undef' +d_getnetprotos='define' +d_getpagsz='define' +d_getpbyname='define' +d_getpbynumber='define' +d_getpent='define' +d_getpgid='define' +d_getpgrp2='undef' +d_getpgrp='define' +d_getppid='define' +d_getprior='define' +d_getprotobyname_r='undef' +d_getprotobynumber_r='undef' +d_getprotoent_r='undef' +d_getprotoprotos='define' +d_getprpwnam='undef' +d_getpwent='define' +d_getpwent_r='undef' +d_getpwnam_r='undef' +d_getpwuid_r='undef' +d_getsbyname='define' +d_getsbyport='define' +d_getsent='define' +d_getservbyname_r='undef' +d_getservbyport_r='undef' +d_getservent_r='undef' +d_getservprotos='define' +d_getspnam='define' +d_getspnam_r='undef' +d_gettimeod='define' +d_gmtime_r='undef' +d_gnulibc='undef' +d_grpasswd='define' +d_hasmntopt='define' +d_htonl='define' +d_ilogbl='undef' +d_inc_version_list='undef' +d_index='undef' +d_inetaton='define' +d_int64_t='define' +d_isascii='define' +d_isfinite='undef' +d_isinf='define' +d_isnan='define' +d_isnanl='undef' +d_killpg='define' +d_lchown='define' +d_ldbl_dig='define' +d_libm_lib_version='define' +d_link='define' +d_localtime_r='undef' +d_localtime_r_needs_tzset='undef' +d_locconv='define' +d_lockf='define' +d_longdbl='define' +d_longlong='define' +d_lseekproto='define' +d_lstat='define' +d_madvise='define' +d_malloc_good_size='undef' +d_malloc_size='undef' +d_mblen='define' +d_mbstowcs='define' +d_mbtowc='define' +d_memchr='define' +d_memcmp='define' +d_memcpy='define' +d_memmove='define' +d_memset='define' +d_mkdir='define' +d_mkdtemp='define' +d_mkfifo='define' +d_mkstemp='define' +d_mkstemps='undef' +d_mktime='define' +d_mmap='define' +d_modfl='undef' +d_modfl_pow32_bug='undef' +d_modflproto='define' +d_mprotect='define' +d_msg='define' +d_msg_ctrunc='define' +d_msg_dontroute='define' +d_msg_oob='define' +d_msg_peek='define' +d_msg_proxy='define' +d_msgctl='define' +d_msgget='define' +d_msghdr_s='define' +d_msgrcv='define' +d_msgsnd='define' +d_msync='define' +d_munmap='define' +d_mymalloc='undef' +d_nice='define' +d_nl_langinfo='define' +d_nv_preserves_uv='define' +d_nv_zero_is_allbits_zero='define' +d_off64_t='undef' +d_old_pthread_create_joinable='undef' +d_oldpthreads='undef' +d_oldsock='undef' +d_open3='define' +d_pathconf='define' +d_pause='define' +d_perl_otherlibdirs='undef' +d_phostname='undef' +d_pipe='define' +d_poll='define' +d_portable='define' +d_printf_format_null='define' +d_procselfexe='define' +d_pseudofork='undef' +d_pthread_atfork='undef' +d_pthread_attr_setscope='define' +d_pthread_yield='undef' +d_pwage='undef' +d_pwchange='undef' +d_pwclass='undef' +d_pwcomment='undef' +d_pwexpire='undef' +d_pwgecos='define' +d_pwpasswd='define' +d_pwquota='undef' +d_qgcvt='undef' +d_quad='define' +d_random_r='undef' +d_readdir64_r='undef' +d_readdir='define' +d_readdir_r='undef' +d_readlink='define' +d_readv='define' +d_recvmsg='define' +d_rename='define' +d_rewinddir='define' +d_rmdir='define' +d_safebcpy='undef' +d_safemcpy='undef' +d_sanemcmp='define' +d_sbrkproto='define' +d_scalbnl='undef' +d_sched_yield='define' +d_scm_rights='define' +d_seekdir='define' +d_select='define' +d_sem='define' +d_semctl='define' +d_semctl_semid_ds='define' +d_semctl_semun='define' +d_semget='define' +d_semop='define' +d_sendmsg='define' +d_setegid='define' +d_seteuid='define' +d_setgrent='define' +d_setgrent_r='undef' +d_setgrps='define' +d_sethent='define' +d_sethostent_r='undef' +d_setitimer='define' +d_setlinebuf='define' +d_setlocale='define' +d_setlocale_r='undef' +d_setnent='define' +d_setnetent_r='undef' +d_setpent='define' +d_setpgid='define' +d_setpgrp2='undef' +d_setpgrp='define' +d_setprior='define' +d_setproctitle='undef' +d_setprotoent_r='undef' +d_setpwent='define' +d_setpwent_r='undef' +d_setregid='define' +d_setresgid='define' +d_setresuid='define' +d_setreuid='define' +d_setrgid='undef' +d_setruid='undef' +d_setsent='define' +d_setservent_r='undef' +d_setsid='define' +d_setvbuf='define' +d_sfio='undef' +d_shm='define' +d_shmat='define' +d_shmatprototype='define' +d_shmctl='define' +d_shmdt='define' +d_shmget='define' +d_sigaction='define' +d_signbit='undef' +d_sigprocmask='define' +d_sigsetjmp='define' +d_sitearch='define' +d_snprintf='define' +d_sockatmark='undef' +d_sockatmarkproto='undef' +d_socket='define' +d_socklen_t='define' +d_sockpair='define' +d_socks5_init='undef' +d_sprintf_returns_strlen='define' +d_sqrtl='undef' +d_srand48_r='undef' +d_srandom_r='undef' +d_sresgproto='undef' +d_sresuproto='undef' +d_statblks='define' +d_statfs_f_flags='undef' +d_statfs_s='define' +d_statvfs='define' +d_stdio_cnt_lval='undef' +d_stdio_ptr_lval='undef' +d_stdio_ptr_lval_nochange_cnt='undef' +d_stdio_ptr_lval_sets_cnt='undef' +d_stdio_stream_array='undef' +d_stdiobase='undef' +d_stdstdio='undef' +d_strchr='define' +d_strcoll='define' +d_strctcpy='define' +d_strerrm='strerror(e)' +d_strerror='define' +d_strerror_r='undef' +d_strftime='define' +d_strlcat='define' +d_strlcpy='define' +d_strtod='define' +d_strtol='define' +d_strtold='define' +d_strtoll='define' +d_strtoq='define' +d_strtoul='define' +d_strtoull='define' +d_strtouq='define' +d_strxfrm='define' +d_suidsafe='undef' +d_symlink='define' +d_syscall='define' +d_syscallproto='define' +d_sysconf='define' +d_sysernlst='' +d_syserrlst='undef' +d_system='define' +d_tcgetpgrp='define' +d_tcsetpgrp='define' +d_telldir='define' +d_telldirproto='define' +d_time='define' +d_times='define' +d_tm_tm_gmtoff='define' +d_tm_tm_zone='define' +d_tmpnam_r='undef' +d_truncate='define' +d_ttyname_r='undef' +d_tzname='define' +d_u32align='undef' +d_ualarm='define' +d_umask='define' +d_uname='define' +d_union_semun='undef' +d_unordered='undef' +d_unsetenv='define' +d_usleep='define' +d_usleepproto='define' +d_ustat='define' +d_vendorarch='undef' +d_vendorbin='undef' +d_vendorlib='undef' +d_vendorscript='undef' +d_vfork='undef' +d_void_closedir='undef' +d_voidsig='define' +d_voidtty='' +d_volatile='define' +d_vprintf='define' +d_vsnprintf='define' +d_wait4='define' +d_waitpid='define' +d_wcstombs='define' +d_wctomb='define' +d_writev='define' +d_xenix='undef' +date='date' +db_hashtype='u_int32_t' +db_prefixtype='size_t' +db_version_major='' +db_version_minor='' +db_version_patch='' +defvoidused='15' +direntrytype='struct dirent' +dlext='so' +dlsrc='dl_dlopen.xs' +doublesize='8' +drand01='drand48()' +drand48_r_proto='0' +dynamic_ext='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' +eagain='EAGAIN' +ebcdic='undef' +echo='echo' +egrep='egrep' +emacs='' +endgrent_r_proto='0' +endhostent_r_proto='0' +endnetent_r_proto='0' +endprotoent_r_proto='0' +endpwent_r_proto='0' +endservent_r_proto='0' +eunicefix=':' +exe_ext='' +expr='expr' +extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib' +extras='' +fflushNULL='define' +fflushall='undef' +find='' +firstmakefile='makefile' +flex='' +fpossize='20' +fpostype='fpos_t' +freetype='void' +from=':' +full_ar='%%AR%%' +full_csh='csh' +full_sed='sed' +gccansipedantic='' +gccosandvers='' +gccversion='3.4.3' +getgrent_r_proto='0' +getgrgid_r_proto='0' +getgrnam_r_proto='0' +gethostbyaddr_r_proto='0' +gethostbyname_r_proto='0' +gethostent_r_proto='0' +getlogin_r_proto='0' +getnetbyaddr_r_proto='0' +getnetbyname_r_proto='0' +getnetent_r_proto='0' +getprotobyname_r_proto='0' +getprotobynumber_r_proto='0' +getprotoent_r_proto='0' +getpwent_r_proto='0' +getpwnam_r_proto='0' +getpwuid_r_proto='0' +getservbyname_r_proto='0' +getservbyport_r_proto='0' +getservent_r_proto='0' +getspnam_r_proto='0' +gidformat='"lu"' +gidsign='1' +gidsize='4' +gidtype='gid_t' +glibpth='/usr/shlib /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib /usr/ucblib /usr/local/lib ' +gmake='gmake' +gmtime_r_proto='0' +gnulibc_version='' +grep='grep' +groupcat='cat /etc/group' +groupstype='gid_t' +gzip='gzip' +h_fcntl='false' +h_sysfile='true' +hint='recommended' +hostcat='cat /etc/hosts' +html1dir=' ' +html1direxp='' +html3dir=' ' +html3direxp='' +i16size='2' +i16type='short' +i32size='4' +i32type='long' +i64size='8' +i64type='long long' +i8size='1' +i8type='char' +i_arpainet='define' +i_bsdioctl='' +i_crypt='define' +i_db='define' +i_dbm='undef' +i_dirent='define' +i_dld='undef' +i_dlfcn='define' +i_fcntl='undef' +i_float='define' +i_fp='undef' +i_fp_class='undef' +i_gdbm='define' +i_grp='define' +i_ieeefp='undef' +i_inttypes='define' +i_langinfo='define' +i_libutil='undef' +i_limits='define' +i_locale='define' +i_machcthr='undef' +i_malloc='define' +i_math='define' +i_memory='undef' +i_mntent='define' +i_ndbm='undef' +i_netdb='define' +i_neterrno='undef' +i_netinettcp='define' +i_niin='define' +i_poll='define' +i_prot='undef' +i_pthread='define' +i_pwd='define' +i_rpcsvcdbm='undef' +i_sfio='undef' +i_sgtty='undef' +i_shadow='define' +i_socks='undef' +i_stdarg='define' +i_stddef='define' +i_stdlib='define' +i_string='define' +i_sunmath='undef' +i_sysaccess='undef' +i_sysdir='define' +i_sysfile='define' +i_sysfilio='undef' +i_sysin='undef' +i_sysioctl='define' +i_syslog='define' +i_sysmman='define' +i_sysmode='undef' +i_sysmount='define' +i_sysndir='undef' +i_sysparam='define' +i_sysresrc='define' +i_syssecrt='undef' +i_sysselct='define' +i_syssockio='undef' +i_sysstat='define' +i_sysstatfs='define' +i_sysstatvfs='define' +i_systime='define' +i_systimek='undef' +i_systimes='define' +i_systypes='define' +i_sysuio='define' +i_sysun='define' +i_sysutsname='define' +i_sysvfs='define' +i_syswait='define' +i_termio='undef' +i_termios='define' +i_time='define' +i_unistd='define' +i_ustat='define' +i_utime='define' +i_values='define' +i_varargs='undef' +i_varhdr='stdarg.h' +i_vfork='undef' +ignore_versioned_solibs='y' +inc_version_list=' ' +inc_version_list_init='0' +incpath='' +inews='' +installarchlib='/usr/lib/perl5/5.10' +installbin='/usr/bin' +initialinstalllocation='/usr/bin' +installhtml1dir='' +installhtml3dir='' +installman1dir='' +installman3dir='' +installprefix='/usr' +installprefixexp='/usr' +installprivlib='/usr/lib/perl5/5.10' +installscript='/usr/bin' +installsitearch='/usr/lib/perl5/5.10' +installsitebin='/usr/bin' +installsitehtml1dir='' +installsitehtml3dir='' +installsitelib='/usr/lib/perl5/5.10' +installsiteman1dir='' +installsiteman3dir='' +installsitescript='/usr/bin' +installstyle='lib/perl5' +installusrbinperl='define' +installvendorarch='' +installvendorbin='' +installvendorhtml1dir='' +installvendorhtml3dir='' +installvendorlib='' +installvendorman1dir='' +installvendorman3dir='' +installvendorscript='' +intsize='4' +issymlink='test -h' +ivdformat='"ld"' +ivsize='4' +ivtype='long' +known_extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize Win32 Win32API/File Win32CORE XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' +ksh='' +ld='%%LD%%' +lddlflags='-shared %%LDFLAGS%%' +ldflags='%%EXTRA_PERLLIBDIRS%%' +ldflags_uselargefiles='' +ldlibpthname='LD_LIBRARY_PATH' +less='less' +lib_ext='.a' +libc='' +libperl='libperl.a' +libpth='%%LIBDIRS%%' +libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc' +libsdirs='%%LIBDIRS%%' +libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' +libspath='%%LIBDIRS%%' +libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD' +libswanted_uselargefiles='' +line='' +lint='' +lkflags='' +ln='ln' +lns='/bin/ln -s' +localtime_r_proto='0' +locincpth=' ' +loclibpth=' ' +longdblsize='12' +longlongsize='8' +longsize='4' +lp='' +lpr='' +ls='ls' +lseeksize='8' +lseektype='off_t' +mad='undef' +madlyh='' +madlyobj='' +madlysrc='' +mail='' +mailx='' +make='make' +make_set_make='#' +mallocobj='' +mallocsrc='' +malloctype='void *' +man1dir=' ' +man1direxp='' +man1ext='0' +man3dir=' ' +man3direxp='' +man3ext='0' +mips_type='' +mistrustnm='' +mkdir='mkdir' +mmaptype='void *' +modetype='mode_t' +more='more' +multiarch='undef' +mv='' +myarchname='i386-linux-uclibc' +mydomain='.dev.null' +myhostname='maia' +myuname='linux maia 2.6.25 #2 sat apr 19 09:46:49 cest 2008 i686 unknown unknown gnulinux ' +n='-n' +need_va_copy='undef' +netdb_hlen_type='size_t' +netdb_host_type='const void *' +netdb_name_type='const char *' +netdb_net_type='in_addr_t' +nm='nm' +nm_opt='' +nm_so_opt='--dynamic' +nonxs_ext='Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib' +nroff='nroff' +nvEUformat='"E"' +nvFUformat='"F"' +nvGUformat='"G"' +nv_preserves_uv_bits='32' +nveformat='"e"' +nvfformat='"f"' +nvgformat='"g"' +nvsize='8' +nvtype='double' +o_nonblock='O_NONBLOCK' +obj_ext='.o' +old_pthread_create_joinable='' +optimize='-O2' +orderlib='false' +osname='linux' +osvers='2.6.25' +otherlibdirs=' ' +package='perl5' +pager='/usr/bin/less' +passcat='cat /etc/passwd' +patchlevel='10' +path_sep=':' +perl5='' +perl='' +perl_patchlevel='' +perladmin='root@maia.dev.null' +perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%' +perlpath='/usr/bin/perl' +pg='pg' +phostname='hostname' +pidtype='pid_t' +plibpth='' +pmake='' +pr='' +prefix='/usr' +prefixexp='/usr' +privlib='/usr/lib/perl5/5.10' +privlibexp='/usr/lib/perl5/5.10' +procselfexe='"/proc/self/exe"' +prototype='define' +ptrsize='4' +quadkind='3' +quadtype='long long' +randbits='48' +randfunc='drand48' +random_r_proto='0' +randseedtype='long' +ranlib=':' +rd_nodata='-1' +readdir64_r_proto='0' +readdir_r_proto='0' +revision='5' +rm='rm' +rm_try='/bin/rm -f try try a.out .out try.[cho] try..o core core.try* try.core*' +rmail='' +run='' +runnm='false' +sPRIEUldbl='"LE"' +sPRIFUldbl='"LF"' +sPRIGUldbl='"LG"' +sPRIXU64='"LX"' +sPRId64='"Ld"' +sPRIeldbl='"Le"' +sPRIfldbl='"Lf"' +sPRIgldbl='"Lg"' +sPRIi64='"Li"' +sPRIo64='"Lo"' +sPRIu64='"Lu"' +sPRIx64='"Lx"' +sSCNfldbl='"Lf"' +sched_yield='sched_yield()' +scriptdir='/usr/bin' +scriptdirexp='/usr/bin' +sed='sed' +seedfunc='srand48' +selectminbits='32' +selecttype='fd_set *' +sendmail='' +setgrent_r_proto='0' +sethostent_r_proto='0' +setlocale_r_proto='0' +setnetent_r_proto='0' +setprotoent_r_proto='0' +setpwent_r_proto='0' +setservent_r_proto='0' +sh='/bin/sh' +shar='' +sharpbang='#!' +shmattype='void *' +shortsize='2' +shrpenv='' +shsharp='true' +sig_count='64' +sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN NUM33 NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 RTMAX IOT CLD POLL UNUSED ' +sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "RTMIN", "NUM33", "NUM34", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0' +sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 6 17 29 31 ' +sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 6, 17, 29, 31, 0' +sig_size='68' +signal_t='void' +sitearch='' +sitearchexp='' +sitebin='/usr/bin' +sitebinexp='/usr/bin' +sitehtml1dir='' +sitehtml1direxp='' +sitehtml3dir='' +sitehtml3direxp='' +sitelib='' +#sitelib_stem='/usr/lib/perl5/site_perl' +sitelibexp='' +siteman1dir='' +siteman1direxp='' +siteman3dir='' +siteman3direxp='' +siteprefix='/usr' +siteprefixexp='/usr' +sitescript='/usr/bin' +sitescriptexp='/usr/bin' +sizesize='4' +sizetype='size_t' +sleep='' +smail='' +so='so' +sockethdr='' +socketlib='' +socksizetype='socklen_t' +sort='sort' +spackage='Perl5' +spitshell='cat' +srand48_r_proto='0' +srandom_r_proto='0' +src='.' +ssizetype='ssize_t' +startperl='#!/usr/bin/perl' +startsh='#!/bin/sh' +static_ext=' ' +stdchar='char' +stdio_base='((fp)->_base)' +stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)' +stdio_cnt='((fp)->_cnt)' +stdio_filbuf='' +stdio_ptr='((fp)->_ptr)' +stdio_stream_array='' +strerror_r_proto='0' +#strings='/usr/include/string.h' +submit='' +subversion='0' +sysman='/usr/share/man/man1' +tail='' +tar='' +targetarch='i386-linux-uclibc' +tbl='' +tee='' +test='test' +#timeincl='/usr/include/sys/time.h /usr/include/time.h ' +timetype='time_t' +tmpnam_r_proto='0' +to=':' +touch='touch' +tr='tr' +trnl='\n' +troff='' +ttyname_r_proto='0' +u16size='2' +u16type='unsigned short' +u32size='4' +u32type='unsigned long' +u64size='8' +u64type='unsigned long long' +u8size='1' +u8type='unsigned char' +uidformat='"lu"' +uidsign='1' +uidsize='4' +uidtype='uid_t' +uname='uname' +uniq='uniq' +uquadtype='unsigned long long' +use5005threads='undef' +use64bitall='undef' +use64bitint='undef' +usecrosscompile='define' +usedl='define' +usefaststdio='undef' +useithreads='undef' +uselargefiles='define' +uselongdouble='undef' +usemallocwrap='define' +usemorebits='undef' +usemultiplicity='undef' +usemymalloc='n' +usenm='true' +useopcode='true' +useperlio='define' +useposix='true' +usereentrant='undef' +userelocatableinc='undef' +usesfio='false' +useshrplib='false' +usesitecustomize='undef' +usesocks='undef' +usethreads='undef' +usevendorprefix='undef' +usevfork='false' +usrinc='%%INCDIRS%%' +uuname='' +uvXUformat='"lX"' +uvoformat='"lo"' +uvsize='4' +uvtype='unsigned long' +uvuformat='"lu"' +uvxformat='"lx"' +vendorarch='' +vendorarchexp='' +vendorbin='' +vendorbinexp='' +vendorhtml1dir=' ' +vendorhtml1direxp='' +vendorhtml3dir=' ' +vendorhtml3direxp='' +vendorlib='' +vendorlib_stem='' +vendorlibexp='' +vendorman1dir=' ' +vendorman1direxp='' +vendorman3dir=' ' +vendorman3direxp='' +vendorprefix='' +vendorprefixexp='' +vendorscript='' +vendorscriptexp='' +version='5.10.0' +version_patchlevel_string='version 10 subversion 0' +versiononly='undef' +vi='' +voidflags='15' +xlibpth='/usr/lib/386 /lib/386' +yacc='yacc' +yaccflags='' +zcat='' +zip='zip' +# Configure command line arguments. +config_arg0='./Configure' +config_args='-der' +config_argc=1 +config_arg1='-der' +PERL_REVISION=5 +PERL_VERSION=10 +PERL_SUBVERSION=0 +PERL_API_REVISION=5 +PERL_API_VERSION=10 +PERL_API_SUBVERSION=0 +PERL_PATCHLEVEL= +PERL_CONFIG_SH=true +# Fix problem with HiRes timer. +d_nanosleep='define' +d_clock_gettime='define' +d_clock_getres='define' +d_clock_nanosleep='define' +d_clock='define' diff --git a/lang/perl/files/config.sh-mips.in b/lang/perl/files/config.sh-mips.in new file mode 100644 index 0000000..8058cea --- /dev/null +++ b/lang/perl/files/config.sh-mips.in @@ -0,0 +1,1068 @@ +#!/bin/sh +# +# This file was produced by running the Configure script. It holds all the +# definitions figured out by Configure. Should you modify one of these values, +# do not forget to propagate your changes by running "Configure -der". You may +# instead choose to run each of the .SH files by yourself, or "Configure -S". +# + +# Package name : perl5 +# Source directory : . +# Configuration time: Thu Jan 25 03:12:45 MST 2007 +# Configured by : root +# Target system : linux merope 2.4.30 #1 di 23. jan 15:23:42 cet 2007 mips unknown unknown gnulinux + +Author='' +Date='$Date' +Header='' +Id='$Id' +Locker='' +Log='$Log' +Mcc='Mcc' +RCSfile='$RCSfile' +Revision='$Revision' +Source='' +State='' +_a='.a' +_exe='' +_o='.o' +afs='false' +afsroot='/afs' +alignbytes='8' +ansi2knr='' +aphostname='/bin/hostname' +api_revision='5' +api_subversion='0' +api_version='10' +api_versionstring='5.10.0' +ar='ar' +archlib='' +archlibexp='' +archname64='' +archname='mips-linux-uclibc' +archobjs='' +asctime_r_proto='0' +awk='awk' +baserev='5.0' +bash='' +bin='/usr/bin' +binexp='/usr/bin' +bison='bison' +byacc='byacc' +byteorder='4321' +c='' +castflags='0' +cat='cat' +cc='%%CC%%' +cccdlflags='-fPIC' +ccdlflags='-Wl,-E' +ccflags='%%CFLAGS%%' +ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' +ccname='gcc' +ccsymbols='' +ccversion='' +cf_by='root' +cf_email='root@merope.dev.null' +cf_time='Thu Jan 25 03:12:45 MST 2007' +chgrp='' +chmod='chmod' +chown='' +clocktype='clock_t' +comm='comm' +compress='' +contains='grep' +cp='cp' +cpio='' +cpp='cpp' +cpp_stuff='42' +cppccsymbols='' +cppflags='%%CFLAGS%%' +cpplast='-' +cppminus='-' +cpprun='%%CPP%%' +cppstdin='%%CPP%%' +cppsymbols='__ELF__=1 _FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC__=3 __GNUC_MINOR__=4 __GNU_LIBRARY__=6 LANGUAGE_C=1 _LANGUAGE_C=1 __LANGUAGE_C=1 __LANGUAGE_C__=1 _LARGEFILE_SOURCE=1 MIPSEL=1 _MIPSEL=1 __MIPSEL=1 __MIPSEL__=1 _MIPS_FPSET=16 _MIPS_ISA=_MIPS_ISA_MIPS1 _MIPS_SIM=1 _MIPS_SZINT=32 _MIPS_SZLONG=32 _MIPS_SZPTR=32 __PIC__=1 _POSIX_C_SOURCE=199506L _POSIX_SOURCE=1 R3000=1 _R3000=1 __R3000=1 __R3000__=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 linux=1 __linux=1 __linux__=1 mips=1 _mips=1 __mips=1 __mips__=1 __pic__=1 unix=1 __unix=1 __unix__=1' +crypt_r_proto='0' +cryptlib='' +csh='csh' +ctermid_r_proto='0' +ctime_r_proto='0' +d_Gconvert='sprintf((b),"%.*g",(n),(x))' +d_PRIEUldbl='define' +d_PRIFUldbl='define' +d_PRIGUldbl='define' +d_PRIXU64='define' +d_PRId64='define' +d_PRIeldbl='define' +d_PRIfldbl='define' +d_PRIgldbl='define' +d_PRIi64='define' +d_PRIo64='define' +d_PRIu64='define' +d_PRIx64='define' +d_SCNfldbl='define' +d__fwalk='undef' +d_access='define' +d_accessx='undef' +d_aintl='undef' +d_alarm='define' +d_archlib='undef' +d_asctime_r='undef' +d_atolf='undef' +d_atoll='define' +d_attribute_format='define' +d_attribute_malloc='define' +d_attribute_nonnull='define' +d_attribute_noreturn='define' +d_attribute_pure='define' +d_attribute_unused='define' +d_attribute_warn_unused_result='define' +d_bcmp='define' +d_bcopy='define' +d_bsd='undef' +d_bsdgetpgrp='undef' +d_bsdsetpgrp='undef' +d_builtin_choose_expr='define' +d_builtin_expect='undef' +d_bzero='define' +d_c99_variadic_macros='define' +d_casti32='define' +d_castneg='define' +d_charvspr='undef' +d_chown='define' +d_chroot='define' +d_chsize='undef' +d_class='undef' +d_clearenv='define' +d_closedir='define' +d_cmsghdr_s='define' +d_const='define' +d_copysignl='undef' +d_cplusplus='undef' +d_crypt='define' +d_crypt_r='undef' +d_csh='undef' +d_ctermid='define' +d_ctermid_r='undef' +d_ctime_r='undef' +d_cuserid='define' +d_dbl_dig='define' +d_dbminitproto='undef' +d_difftime='define' +d_dir_dd_fd='undef' +d_dirfd='define' +d_dirnamlen='undef' +d_dlerror='define' +d_dlopen='define' +d_dlsymun='undef' +d_dosuid='undef' +d_drand48_r='undef' +d_drand48proto='define' +d_dup2='define' +d_eaccess='undef' +d_endgrent='define' +d_endgrent_r='undef' +d_endhent='define' +d_endhostent_r='undef' +d_endnent='define' +d_endnetent_r='undef' +d_endpent='define' +d_endprotoent_r='undef' +d_endpwent='define' +d_endpwent_r='undef' +d_endsent='define' +d_endservent_r='undef' +d_eofnblk='define' +d_eunice='undef' +d_faststdio='undef' +d_fchdir='define' +d_fchmod='define' +d_fchown='define' +d_fcntl='define' +d_fcntl_can_lock='define' +d_fd_macros='define' +d_fd_set='define' +d_fds_bits='undef' +d_fgetpos='define' +d_finite='define' +d_finitel='undef' +d_flexfnam='define' +d_flock='define' +d_flockproto='define' +d_fork='define' +d_fp_class='undef' +d_fpathconf='define' +d_fpclass='undef' +d_fpclassify='undef' +d_fpclassl='undef' +d_fpos64_t='undef' +d_frexpl='undef' +d_fs_data_s='undef' +d_fseeko='define' +d_fsetpos='define' +d_fstatfs='define' +d_fstatvfs='define' +d_fsync='define' +d_ftello='define' +d_ftime='undef' +d_futimes='undef' +d_getcwd='define' +d_getespwnam='undef' +d_getfsstat='undef' +d_getgrent='define' +d_getgrent_r='undef' +d_getgrgid_r='undef' +d_getgrnam_r='undef' +d_getgrps='define' +d_gethbyaddr='define' +d_gethbyname='define' +d_gethent='define' +d_gethname='define' +d_gethostbyaddr_r='undef' +d_gethostbyname_r='undef' +d_gethostent_r='undef' +d_gethostprotos='define' +d_getitimer='define' +d_getlogin='define' +d_getlogin_r='undef' +d_getmnt='undef' +d_getmntent='define' +d_getnbyaddr='define' +d_getnbyname='define' +d_getnent='define' +d_getnetbyaddr_r='undef' +d_getnetbyname_r='undef' +d_getnetent_r='undef' +d_getnetprotos='define' +d_getpagsz='define' +d_getpbyname='define' +d_getpbynumber='define' +d_getpent='define' +d_getpgid='define' +d_getpgrp2='undef' +d_getpgrp='define' +d_getppid='define' +d_getprior='define' +d_getprotobyname_r='undef' +d_getprotobynumber_r='undef' +d_getprotoent_r='undef' +d_getprotoprotos='define' +d_getprpwnam='undef' +d_getpwent='define' +d_getpwent_r='undef' +d_getpwnam_r='undef' +d_getpwuid_r='undef' +d_getsbyname='define' +d_getsbyport='define' +d_getsent='define' +d_getservbyname_r='undef' +d_getservbyport_r='undef' +d_getservent_r='undef' +d_getservprotos='define' +d_getspnam='define' +d_getspnam_r='undef' +d_gettimeod='define' +d_gmtime_r='undef' +d_gnulibc='undef' +d_grpasswd='define' +d_hasmntopt='define' +d_htonl='define' +d_ilogbl='undef' +d_inc_version_list='undef' +d_index='undef' +d_inetaton='define' +d_int64_t='define' +d_isascii='define' +d_isfinite='undef' +d_isinf='define' +d_isnan='define' +d_isnanl='undef' +d_killpg='define' +d_lchown='define' +d_ldbl_dig='define' +d_libm_lib_version='define' +d_link='define' +d_localtime_r='undef' +d_localtime_r_needs_tzset='undef' +d_locconv='define' +d_lockf='define' +d_longdbl='define' +d_longlong='define' +d_lseekproto='define' +d_lstat='define' +d_madvise='define' +d_malloc_good_size='undef' +d_malloc_size='undef' +d_mblen='define' +d_mbstowcs='define' +d_mbtowc='define' +d_memchr='define' +d_memcmp='define' +d_memcpy='define' +d_memmove='define' +d_memset='define' +d_mkdir='define' +d_mkdtemp='define' +d_mkfifo='define' +d_mkstemp='define' +d_mkstemps='undef' +d_mktime='define' +d_mmap='define' +d_modfl='undef' +d_modfl_pow32_bug='undef' +d_modflproto='undef' +d_mprotect='define' +d_msg='define' +d_msg_ctrunc='define' +d_msg_dontroute='define' +d_msg_oob='define' +d_msg_peek='define' +d_msg_proxy='define' +d_msgctl='define' +d_msgget='define' +d_msghdr_s='define' +d_msgrcv='define' +d_msgsnd='define' +d_msync='define' +d_munmap='define' +d_mymalloc='undef' +d_nice='define' +d_nl_langinfo='define' +d_nv_preserves_uv='define' +d_nv_zero_is_allbits_zero='define' +d_off64_t='undef' +d_old_pthread_create_joinable='undef' +d_oldpthreads='undef' +d_oldsock='undef' +d_open3='define' +d_pathconf='define' +d_pause='define' +d_perl_otherlibdirs='undef' +d_phostname='undef' +d_pipe='define' +d_poll='define' +d_portable='define' +d_printf_format_null='define' +d_procselfexe='define' +d_pseudofork='undef' +d_pthread_atfork='undef' +d_pthread_attr_setscope='define' +d_pthread_yield='undef' +d_pwage='undef' +d_pwchange='undef' +d_pwclass='undef' +d_pwcomment='undef' +d_pwexpire='undef' +d_pwgecos='define' +d_pwpasswd='define' +d_pwquota='undef' +d_qgcvt='undef' +d_quad='define' +d_random_r='undef' +d_readdir64_r='undef' +d_readdir='define' +d_readdir_r='undef' +d_readlink='define' +d_readv='define' +d_recvmsg='define' +d_rename='define' +d_rewinddir='define' +d_rmdir='define' +d_safebcpy='undef' +d_safemcpy='undef' +d_sanemcmp='define' +d_sbrkproto='define' +d_scalbnl='undef' +d_sched_yield='define' +d_scm_rights='define' +d_seekdir='define' +d_select='define' +d_sem='define' +d_semctl='define' +d_semctl_semid_ds='define' +d_semctl_semun='define' +d_semget='define' +d_semop='define' +d_sendmsg='define' +d_setegid='define' +d_seteuid='define' +d_setgrent='define' +d_setgrent_r='undef' +d_setgrps='define' +d_sethent='define' +d_sethostent_r='undef' +d_setitimer='define' +d_setlinebuf='define' +d_setlocale='define' +d_setlocale_r='undef' +d_setnent='define' +d_setnetent_r='undef' +d_setpent='define' +d_setpgid='define' +d_setpgrp2='undef' +d_setpgrp='define' +d_setprior='define' +d_setproctitle='undef' +d_setprotoent_r='undef' +d_setpwent='define' +d_setpwent_r='undef' +d_setregid='define' +d_setresgid='define' +d_setresuid='define' +d_setreuid='define' +d_setrgid='undef' +d_setruid='undef' +d_setsent='define' +d_setservent_r='undef' +d_setsid='define' +d_setvbuf='define' +d_sfio='undef' +d_shm='define' +d_shmat='define' +d_shmatprototype='define' +d_shmctl='define' +d_shmdt='define' +d_shmget='define' +d_sigaction='define' +d_signbit='undef' +d_sigprocmask='define' +d_sigsetjmp='define' +d_sitearch='define' +d_snprintf='define' +d_sockatmark='undef' +d_sockatmarkproto='undef' +d_socket='define' +d_socklen_t='define' +d_sockpair='define' +d_socks5_init='undef' +d_sprintf_returns_strlen='define' +d_sqrtl='undef' +d_srand48_r='undef' +d_srandom_r='undef' +d_sresgproto='undef' +d_sresuproto='undef' +d_statblks='define' +d_statfs_f_flags='undef' +d_statfs_s='define' +d_statvfs='define' +d_stdio_cnt_lval='undef' +d_stdio_ptr_lval='undef' +d_stdio_ptr_lval_nochange_cnt='undef' +d_stdio_ptr_lval_sets_cnt='undef' +d_stdio_stream_array='undef' +d_stdiobase='undef' +d_stdstdio='undef' +d_strchr='define' +d_strcoll='define' +d_strctcpy='define' +d_strerrm='strerror(e)' +d_strerror='define' +d_strerror_r='undef' +d_strftime='define' +d_strlcat='define' +d_strlcpy='define' +d_strtod='define' +d_strtol='define' +d_strtold='define' +d_strtoll='define' +d_strtoq='define' +d_strtoul='define' +d_strtoull='define' +d_strtouq='define' +d_strxfrm='define' +d_suidsafe='undef' +d_symlink='define' +d_syscall='define' +d_syscallproto='define' +d_sysconf='define' +d_sysernlst='' +d_syserrlst='undef' +d_system='define' +d_tcgetpgrp='define' +d_tcsetpgrp='define' +d_telldir='define' +d_telldirproto='define' +d_time='define' +d_times='define' +d_tm_tm_gmtoff='define' +d_tm_tm_zone='define' +d_tmpnam_r='undef' +d_truncate='define' +d_ttyname_r='undef' +d_tzname='define' +d_u32align='undef' +d_ualarm='define' +d_umask='define' +d_uname='define' +d_union_semun='undef' +d_unordered='undef' +d_unsetenv='define' +d_usleep='define' +d_usleepproto='define' +d_ustat='define' +d_vendorarch='undef' +d_vendorbin='undef' +d_vendorlib='undef' +d_vendorscript='undef' +d_vfork='undef' +d_void_closedir='undef' +d_voidsig='define' +d_voidtty='' +d_volatile='define' +d_vprintf='define' +d_vsnprintf='define' +d_wait4='define' +d_waitpid='define' +d_wcstombs='define' +d_wctomb='define' +d_writev='define' +d_xenix='undef' +date='date' +db_hashtype='u_int32_t' +db_prefixtype='size_t' +db_version_major='' +db_version_minor='' +db_version_patch='' +defvoidused='15' +direntrytype='struct dirent' +dlext='so' +dlsrc='dl_dlopen.xs' +doublesize='8' +drand01='drand48()' +drand48_r_proto='0' +dynamic_ext='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' +eagain='EAGAIN' +ebcdic='undef' +echo='echo' +egrep='egrep' +emacs='' +endgrent_r_proto='0' +endhostent_r_proto='0' +endnetent_r_proto='0' +endprotoent_r_proto='0' +endpwent_r_proto='0' +endservent_r_proto='0' +eunicefix=':' +exe_ext='' +expr='expr' +extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib' +extras='' +fflushNULL='define' +fflushall='undef' +find='' +firstmakefile='makefile' +flex='' +fpossize='24' +fpostype='fpos_t' +freetype='void' +from=':' +full_ar='%%AR%%' +full_csh='csh' +full_sed='sed' +gccansipedantic='' +gccosandvers='' +gccversion='3.4.3' +getgrent_r_proto='0' +getgrgid_r_proto='0' +getgrnam_r_proto='0' +gethostbyaddr_r_proto='0' +gethostbyname_r_proto='0' +gethostent_r_proto='0' +getlogin_r_proto='0' +getnetbyaddr_r_proto='0' +getnetbyname_r_proto='0' +getnetent_r_proto='0' +getprotobyname_r_proto='0' +getprotobynumber_r_proto='0' +getprotoent_r_proto='0' +getpwent_r_proto='0' +getpwnam_r_proto='0' +getpwuid_r_proto='0' +getservbyname_r_proto='0' +getservbyport_r_proto='0' +getservent_r_proto='0' +getspnam_r_proto='0' +gidformat='"lu"' +gidsign='1' +gidsize='4' +gidtype='gid_t' +glibpth='/usr/shlib /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib /usr/ucblib /usr/local/lib ' +gmake='gmake' +gmtime_r_proto='0' +gnulibc_version='' +grep='grep' +groupcat='cat /etc/group' +groupstype='gid_t' +gzip='gzip' +h_fcntl='false' +h_sysfile='true' +hint='recommended' +hostcat='cat /etc/hosts' +html1dir=' ' +html1direxp='' +html3dir=' ' +html3direxp='' +i16size='2' +i16type='short' +i32size='4' +i32type='long' +i64size='8' +i64type='long long' +i8size='1' +i8type='char' +i_arpainet='define' +i_bsdioctl='' +i_crypt='define' +i_db='define' +i_dbm='undef' +i_dirent='define' +i_dld='undef' +i_dlfcn='define' +i_fcntl='undef' +i_float='define' +i_fp='undef' +i_fp_class='undef' +i_gdbm='define' +i_grp='define' +i_ieeefp='undef' +i_inttypes='define' +i_langinfo='define' +i_libutil='undef' +i_limits='define' +i_locale='define' +i_machcthr='undef' +i_malloc='define' +i_math='define' +i_memory='undef' +i_mntent='define' +i_ndbm='undef' +i_netdb='define' +i_neterrno='undef' +i_netinettcp='define' +i_niin='define' +i_poll='define' +i_prot='undef' +i_pthread='define' +i_pwd='define' +i_rpcsvcdbm='undef' +i_sfio='undef' +i_sgtty='undef' +i_shadow='define' +i_socks='undef' +i_stdarg='define' +i_stddef='define' +i_stdlib='define' +i_string='define' +i_sunmath='undef' +i_sysaccess='undef' +i_sysdir='define' +i_sysfile='define' +i_sysfilio='undef' +i_sysin='undef' +i_sysioctl='define' +i_syslog='define' +i_sysmman='define' +i_sysmode='undef' +i_sysmount='define' +i_sysndir='undef' +i_sysparam='define' +i_sysresrc='define' +i_syssecrt='undef' +i_sysselct='define' +i_syssockio='undef' +i_sysstat='define' +i_sysstatfs='define' +i_sysstatvfs='define' +i_systime='define' +i_systimek='undef' +i_systimes='define' +i_systypes='define' +i_sysuio='define' +i_sysun='define' +i_sysutsname='define' +i_sysvfs='define' +i_syswait='define' +i_termio='undef' +i_termios='define' +i_time='define' +i_unistd='define' +i_ustat='define' +i_utime='define' +i_values='define' +i_varargs='undef' +i_varhdr='stdarg.h' +i_vfork='undef' +ignore_versioned_solibs='y' +inc_version_list=' ' +inc_version_list_init='0' +incpath='' +inews='' +installarchlib='/usr/lib/perl5/5.10' +installbin='/usr/bin' +initialinstalllocation='/usr/bin' +installhtml1dir='' +installhtml3dir='' +installman1dir='' +installman3dir='' +installprefix='/usr' +installprefixexp='/usr' +installprivlib='/usr/lib/perl5/5.10' +installscript='/usr/bin' +installsitearch='/usr/lib/perl5/5.10' +installsitebin='/usr/bin' +installsitehtml1dir='' +installsitehtml3dir='' +installsitelib='/usr/lib/perl5/5.10' +installsiteman1dir='' +installsiteman3dir='' +installsitescript='/usr/bin' +installstyle='lib/perl5' +installusrbinperl='define' +installvendorarch='' +installvendorbin='' +installvendorhtml1dir='' +installvendorhtml3dir='' +installvendorlib='' +installvendorman1dir='' +installvendorman3dir='' +installvendorscript='' +intsize='4' +issymlink='test -h' +ivdformat='"ld"' +ivsize='4' +ivtype='long' +known_extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize Win32 Win32API/File Win32CORE XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' +ksh='' +ld='%%LD%%' +lddlflags='-shared %%LDFLAGS%%' +ldflags='%%EXTRA_PERLLIBDIRS%%' +ldflags_uselargefiles='' +ldlibpthname='LD_LIBRARY_PATH' +less='less' +lib_ext='.a' +libc='' +libperl='libperl.a' +libpth='%%LIBDIRS%%' +libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc' +libsdirs='%%LIBDIRS%%' +libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' +libspath='%%LIBDIRS%%' +libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD' +libswanted_uselargefiles='' +line='' +lint='' +lkflags='' +ln='ln' +lns='/bin/ln -s' +localtime_r_proto='0' +locincpth=' ' +loclibpth=' ' +longdblsize='8' +longlongsize='8' +longsize='4' +lp='' +lpr='' +ls='ls' +lseeksize='8' +lseektype='off_t' +mad='undef' +madlyh='' +madlyobj='' +madlysrc='' +mail='' +mailx='' +make='make' +make_set_make='#' +mallocobj='' +mallocsrc='' +malloctype='void *' +man1dir=' ' +man1direxp='' +man1ext='0' +man3dir=' ' +man3direxp='' +man3ext='0' +mips_type='' +mistrustnm='' +mkdir='mkdir' +mmaptype='void *' +modetype='mode_t' +more='more' +multiarch='undef' +mv='' +myarchname='mips-linux-uclibc' +mydomain='.dev.null' +myhostname='merope' +myuname='linux merope 2.4.30 #1 di 23. jan 15:23:42 cet 2007 mips unknown unknown gnulinux ' +n='-n' +need_va_copy='undef' +netdb_hlen_type='size_t' +netdb_host_type='const void *' +netdb_name_type='const char *' +netdb_net_type='in_addr_t' +nm='nm' +nm_opt='' +nm_so_opt='--dynamic' +nonxs_ext='Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib' +nroff='nroff' +nvEUformat='"E"' +nvFUformat='"F"' +nvGUformat='"G"' +nv_preserves_uv_bits='32' +nveformat='"e"' +nvfformat='"f"' +nvgformat='"g"' +nvsize='8' +nvtype='double' +o_nonblock='O_NONBLOCK' +obj_ext='.o' +old_pthread_create_joinable='' +optimize='-O2' +orderlib='false' +osname='linux' +osvers='2.4.30' +otherlibdirs=' ' +package='perl5' +pager='/usr/bin/less' +passcat='cat /etc/passwd' +patchlevel='10' +path_sep=':' +perl5='' +perl='' +perl_patchlevel='' +perladmin='root@merope.dev.null' +perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%' +perlpath='/usr/bin/perl' +pg='pg' +phostname='hostname' +pidtype='pid_t' +plibpth='' +pmake='' +pr='' +prefix='/usr' +prefixexp='/usr' +privlib='/usr/lib/perl5/5.10' +privlibexp='/usr/lib/perl5/5.10' +procselfexe='"/proc/self/exe"' +prototype='define' +ptrsize='4' +quadkind='3' +quadtype='long long' +randbits='48' +randfunc='drand48' +random_r_proto='0' +randseedtype='long' +ranlib=':' +rd_nodata='-1' +readdir64_r_proto='0' +readdir_r_proto='0' +revision='5' +rm='rm' +rm_try='/bin/rm -f try try a.out .out try.[cho] try..o core core.try* try.core*' +rmail='' +run='' +runnm='false' +sPRIEUldbl='"E"' +sPRIFUldbl='"F"' +sPRIGUldbl='"G"' +sPRIXU64='"LX"' +sPRId64='"Ld"' +sPRIeldbl='"e"' +sPRIfldbl='"f"' +sPRIgldbl='"g"' +sPRIi64='"Li"' +sPRIo64='"Lo"' +sPRIu64='"Lu"' +sPRIx64='"Lx"' +sSCNfldbl='"f"' +sched_yield='sched_yield()' +scriptdir='/usr/bin' +scriptdirexp='/usr/bin' +sed='sed' +seedfunc='srand48' +selectminbits='32' +selecttype='fd_set *' +sendmail='' +setgrent_r_proto='0' +sethostent_r_proto='0' +setlocale_r_proto='0' +setnetent_r_proto='0' +setprotoent_r_proto='0' +setpwent_r_proto='0' +setservent_r_proto='0' +sh='/bin/sh' +shar='' +sharpbang='#!' +shmattype='void *' +shortsize='2' +shrpenv='' +shsharp='true' +sig_count='128' +sig_name='ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM USR1 USR2 CHLD PWR WINCH URG IO STOP TSTP CONT TTIN TTOU VTALRM PROF XCPU XFSZ RTMIN NUM33 NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 NUM63 NUM64 NUM65 NUM66 NUM67 NUM68 NUM69 NUM70 NUM71 NUM72 NUM73 NUM74 NUM75 NUM76 NUM77 NUM78 NUM79 NUM80 NUM81 NUM82 NUM83 NUM84 NUM85 NUM86 NUM87 NUM88 NUM89 NUM90 NUM91 NUM92 NUM93 NUM94 NUM95 NUM96 NUM97 NUM98 NUM99 NUM100 NUM101 NUM102 NUM103 NUM104 NUM105 NUM106 NUM107 NUM108 NUM109 NUM110 NUM111 NUM112 NUM113 NUM114 NUM115 NUM116 NUM117 NUM118 NUM119 NUM120 NUM121 NUM122 NUM123 NUM124 NUM125 NUM126 RTMAX IOT CLD POLL ' +sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "EMT", "FPE", "KILL", "BUS", "SEGV", "SYS", "PIPE", "ALRM", "TERM", "USR1", "USR2", "CHLD", "PWR", "WINCH", "URG", "IO", "STOP", "TSTP", "CONT", "TTIN", "TTOU", "VTALRM", "PROF", "XCPU", "XFSZ", "RTMIN", "NUM33", "NUM34", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "NUM63", "NUM64", "NUM65", "NUM66", "NUM67", "NUM68", "NUM69", "NUM70", "NUM71", "NUM72", "NUM73", "NUM74", "NUM75", "NUM76", "NUM77", "NUM78", "NUM79", "NUM80", "NUM81", "NUM82", "NUM83", "NUM84", "NUM85", "NUM86", "NUM87", "NUM88", "NUM89", "NUM90", "NUM91", "NUM92", "NUM93", "NUM94", "NUM95", "NUM96", "NUM97", "NUM98", "NUM99", "NUM100", "NUM101", "NUM102", "NUM103", "NUM104", "NUM105", "NUM106", "NUM107", "NUM108", "NUM109", "NUM110", "NUM 111", "NUM112", "NUM113", "NUM114", "NUM115", "NUM116", "NUM117", "NUM118", "NUM119", "NUM120", "NUM121", "NUM122", "NUM123", "NUM124", "NUM125", "NUM126", "RTMAX", "IOT", "CLD", "POLL", 0' +sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 6 18 22 ' +sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 6, 18, 22, 0' +sig_size='131' +signal_t='void' +sitearch='' +sitearchexp='' +sitebin='/usr/bin' +sitebinexp='/usr/bin' +sitehtml1dir='' +sitehtml1direxp='' +sitehtml3dir='' +sitehtml3direxp='' +sitelib='' +#sitelib_stem='/usr/lib/perl5/site_perl' +sitelibexp='' +siteman1dir='' +siteman1direxp='' +siteman3dir='' +siteman3direxp='' +siteprefix='/usr' +siteprefixexp='/usr' +sitescript='/usr/bin' +sitescriptexp='/usr/bin' +sizesize='4' +sizetype='size_t' +sleep='' +smail='' +so='so' +sockethdr='' +socketlib='' +socksizetype='socklen_t' +sort='sort' +spackage='Perl5' +spitshell='cat' +srand48_r_proto='0' +srandom_r_proto='0' +src='.' +ssizetype='ssize_t' +startperl='#!/usr/bin/perl' +startsh='#!/bin/sh' +static_ext=' ' +stdchar='char' +stdio_base='((fp)->_base)' +stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)' +stdio_cnt='((fp)->_cnt)' +stdio_filbuf='' +stdio_ptr='((fp)->_ptr)' +stdio_stream_array='' +strerror_r_proto='0' +#strings='/usr/include/string.h' +submit='' +subversion='0' +sysman='/usr/share/man/man1' +tail='' +tar='' +targetarch='mips-linux-uclibc' +tbl='' +tee='' +test='test' +#timeincl='/usr/include/sys/time.h /usr/include/time.h ' +timetype='time_t' +tmpnam_r_proto='0' +to=':' +touch='touch' +tr='tr' +trnl='\n' +troff='' +ttyname_r_proto='0' +u16size='2' +u16type='unsigned short' +u32size='4' +u32type='unsigned long' +u64size='8' +u64type='unsigned long long' +u8size='1' +u8type='unsigned char' +uidformat='"lu"' +uidsign='1' +uidsize='4' +uidtype='uid_t' +uname='uname' +uniq='uniq' +uquadtype='unsigned long long' +use5005threads='undef' +use64bitall='undef' +use64bitint='undef' +usecrosscompile='define' +usedl='define' +usefaststdio='undef' +useithreads='undef' +uselargefiles='define' +uselongdouble='undef' +usemallocwrap='define' +usemorebits='undef' +usemultiplicity='undef' +usemymalloc='n' +usenm='true' +useopcode='true' +useperlio='define' +useposix='true' +usereentrant='undef' +userelocatableinc='undef' +usesfio='false' +useshrplib='false' +usesitecustomize='undef' +usesocks='undef' +usethreads='undef' +usevendorprefix='undef' +usevfork='false' +usrinc='%%INCDIRS%%' +uuname='' +uvXUformat='"lX"' +uvoformat='"lo"' +uvsize='4' +uvtype='unsigned long' +uvuformat='"lu"' +uvxformat='"lx"' +vendorarch='' +vendorarchexp='' +vendorbin='' +vendorbinexp='' +vendorhtml1dir=' ' +vendorhtml1direxp='' +vendorhtml3dir=' ' +vendorhtml3direxp='' +vendorlib='' +vendorlib_stem='' +vendorlibexp='' +vendorman1dir=' ' +vendorman1direxp='' +vendorman3dir=' ' +vendorman3direxp='' +vendorprefix='' +vendorprefixexp='' +vendorscript='' +vendorscriptexp='' +version='5.10.0' +version_patchlevel_string='version 10 subversion 0' +versiononly='undef' +vi='' +voidflags='15' +xlibpth='/usr/lib/386 /lib/386' +yacc='yacc' +yaccflags='' +zcat='' +zip='zip' +# Configure command line arguments. +config_arg0='./Configure' +config_args='-der' +config_argc=1 +config_arg1='-der' +PERL_REVISION=5 +PERL_VERSION=10 +PERL_SUBVERSION=0 +PERL_API_REVISION=5 +PERL_API_VERSION=10 +PERL_API_SUBVERSION=0 +PERL_PATCHLEVEL= +PERL_CONFIG_SH=true +# Fix problem with HiRes timer. +d_nanosleep='define' +d_clock_gettime='define' +d_clock_getres='define' +d_clock_nanosleep='define' +d_clock='define' diff --git a/lang/perl/files/config.sh-mipsel.in b/lang/perl/files/config.sh-mipsel.in new file mode 100644 index 0000000..0c9fd2f --- /dev/null +++ b/lang/perl/files/config.sh-mipsel.in @@ -0,0 +1,1068 @@ +#!/bin/sh +# +# This file was produced by running the Configure script. It holds all the +# definitions figured out by Configure. Should you modify one of these values, +# do not forget to propagate your changes by running "Configure -der". You may +# instead choose to run each of the .SH files by yourself, or "Configure -S". +# + +# Package name : perl5 +# Source directory : . +# Configuration time: Thu Jan 25 03:12:45 MST 2007 +# Configured by : root +# Target system : linux merope 2.4.30 #1 di 23. jan 15:23:42 cet 2007 mips unknown unknown gnulinux + +Author='' +Date='$Date' +Header='' +Id='$Id' +Locker='' +Log='$Log' +Mcc='Mcc' +RCSfile='$RCSfile' +Revision='$Revision' +Source='' +State='' +_a='.a' +_exe='' +_o='.o' +afs='false' +afsroot='/afs' +alignbytes='8' +ansi2knr='' +aphostname='/bin/hostname' +api_revision='5' +api_subversion='0' +api_version='10' +api_versionstring='5.10.0' +ar='ar' +archlib='' +archlibexp='' +archname64='' +archname='mipsel-linux-uclibc' +archobjs='' +asctime_r_proto='0' +awk='awk' +baserev='5.0' +bash='' +bin='/usr/bin' +binexp='/usr/bin' +bison='bison' +byacc='byacc' +byteorder='1234' +c='' +castflags='0' +cat='cat' +cc='%%CC%%' +cccdlflags='-fPIC' +ccdlflags='-Wl,-E' +ccflags='%%CFLAGS%%' +ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' +ccname='gcc' +ccsymbols='' +ccversion='' +cf_by='root' +cf_email='root@merope.dev.null' +cf_time='Thu Jan 25 03:12:45 MST 2007' +chgrp='' +chmod='chmod' +chown='' +clocktype='clock_t' +comm='comm' +compress='' +contains='grep' +cp='cp' +cpio='' +cpp='cpp' +cpp_stuff='42' +cppccsymbols='' +cppflags='%%CFLAGS%%' +cpplast='-' +cppminus='-' +cpprun='%%CPP%%' +cppstdin='%%CPP%%' +cppsymbols='__ELF__=1 _FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC__=3 __GNUC_MINOR__=4 __GNU_LIBRARY__=6 LANGUAGE_C=1 _LANGUAGE_C=1 __LANGUAGE_C=1 __LANGUAGE_C__=1 _LARGEFILE_SOURCE=1 MIPSEL=1 _MIPSEL=1 __MIPSEL=1 __MIPSEL__=1 _MIPS_FPSET=16 _MIPS_ISA=_MIPS_ISA_MIPS1 _MIPS_SIM=1 _MIPS_SZINT=32 _MIPS_SZLONG=32 _MIPS_SZPTR=32 __PIC__=1 _POSIX_C_SOURCE=199506L _POSIX_SOURCE=1 R3000=1 _R3000=1 __R3000=1 __R3000__=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 linux=1 __linux=1 __linux__=1 mips=1 _mips=1 __mips=1 __mips__=1 __pic__=1 unix=1 __unix=1 __unix__=1' +crypt_r_proto='0' +cryptlib='' +csh='csh' +ctermid_r_proto='0' +ctime_r_proto='0' +d_Gconvert='sprintf((b),"%.*g",(n),(x))' +d_PRIEUldbl='define' +d_PRIFUldbl='define' +d_PRIGUldbl='define' +d_PRIXU64='define' +d_PRId64='define' +d_PRIeldbl='define' +d_PRIfldbl='define' +d_PRIgldbl='define' +d_PRIi64='define' +d_PRIo64='define' +d_PRIu64='define' +d_PRIx64='define' +d_SCNfldbl='define' +d__fwalk='undef' +d_access='define' +d_accessx='undef' +d_aintl='undef' +d_alarm='define' +d_archlib='undef' +d_asctime_r='undef' +d_atolf='undef' +d_atoll='define' +d_attribute_format='define' +d_attribute_malloc='define' +d_attribute_nonnull='define' +d_attribute_noreturn='define' +d_attribute_pure='define' +d_attribute_unused='define' +d_attribute_warn_unused_result='define' +d_bcmp='define' +d_bcopy='define' +d_bsd='undef' +d_bsdgetpgrp='undef' +d_bsdsetpgrp='undef' +d_builtin_choose_expr='define' +d_builtin_expect='undef' +d_bzero='define' +d_c99_variadic_macros='define' +d_casti32='define' +d_castneg='define' +d_charvspr='undef' +d_chown='define' +d_chroot='define' +d_chsize='undef' +d_class='undef' +d_clearenv='define' +d_closedir='define' +d_cmsghdr_s='define' +d_const='define' +d_copysignl='undef' +d_cplusplus='undef' +d_crypt='define' +d_crypt_r='undef' +d_csh='undef' +d_ctermid='define' +d_ctermid_r='undef' +d_ctime_r='undef' +d_cuserid='define' +d_dbl_dig='define' +d_dbminitproto='undef' +d_difftime='define' +d_dir_dd_fd='undef' +d_dirfd='define' +d_dirnamlen='undef' +d_dlerror='define' +d_dlopen='define' +d_dlsymun='undef' +d_dosuid='undef' +d_drand48_r='undef' +d_drand48proto='define' +d_dup2='define' +d_eaccess='undef' +d_endgrent='define' +d_endgrent_r='undef' +d_endhent='define' +d_endhostent_r='undef' +d_endnent='define' +d_endnetent_r='undef' +d_endpent='define' +d_endprotoent_r='undef' +d_endpwent='define' +d_endpwent_r='undef' +d_endsent='define' +d_endservent_r='undef' +d_eofnblk='define' +d_eunice='undef' +d_faststdio='undef' +d_fchdir='define' +d_fchmod='define' +d_fchown='define' +d_fcntl='define' +d_fcntl_can_lock='define' +d_fd_macros='define' +d_fd_set='define' +d_fds_bits='undef' +d_fgetpos='define' +d_finite='define' +d_finitel='undef' +d_flexfnam='define' +d_flock='define' +d_flockproto='define' +d_fork='define' +d_fp_class='undef' +d_fpathconf='define' +d_fpclass='undef' +d_fpclassify='undef' +d_fpclassl='undef' +d_fpos64_t='undef' +d_frexpl='undef' +d_fs_data_s='undef' +d_fseeko='define' +d_fsetpos='define' +d_fstatfs='define' +d_fstatvfs='define' +d_fsync='define' +d_ftello='define' +d_ftime='undef' +d_futimes='undef' +d_getcwd='define' +d_getespwnam='undef' +d_getfsstat='undef' +d_getgrent='define' +d_getgrent_r='undef' +d_getgrgid_r='undef' +d_getgrnam_r='undef' +d_getgrps='define' +d_gethbyaddr='define' +d_gethbyname='define' +d_gethent='define' +d_gethname='define' +d_gethostbyaddr_r='undef' +d_gethostbyname_r='undef' +d_gethostent_r='undef' +d_gethostprotos='define' +d_getitimer='define' +d_getlogin='define' +d_getlogin_r='undef' +d_getmnt='undef' +d_getmntent='define' +d_getnbyaddr='define' +d_getnbyname='define' +d_getnent='define' +d_getnetbyaddr_r='undef' +d_getnetbyname_r='undef' +d_getnetent_r='undef' +d_getnetprotos='define' +d_getpagsz='define' +d_getpbyname='define' +d_getpbynumber='define' +d_getpent='define' +d_getpgid='define' +d_getpgrp2='undef' +d_getpgrp='define' +d_getppid='define' +d_getprior='define' +d_getprotobyname_r='undef' +d_getprotobynumber_r='undef' +d_getprotoent_r='undef' +d_getprotoprotos='define' +d_getprpwnam='undef' +d_getpwent='define' +d_getpwent_r='undef' +d_getpwnam_r='undef' +d_getpwuid_r='undef' +d_getsbyname='define' +d_getsbyport='define' +d_getsent='define' +d_getservbyname_r='undef' +d_getservbyport_r='undef' +d_getservent_r='undef' +d_getservprotos='define' +d_getspnam='define' +d_getspnam_r='undef' +d_gettimeod='define' +d_gmtime_r='undef' +d_gnulibc='undef' +d_grpasswd='define' +d_hasmntopt='define' +d_htonl='define' +d_ilogbl='undef' +d_inc_version_list='undef' +d_index='undef' +d_inetaton='define' +d_int64_t='define' +d_isascii='define' +d_isfinite='undef' +d_isinf='define' +d_isnan='define' +d_isnanl='undef' +d_killpg='define' +d_lchown='define' +d_ldbl_dig='define' +d_libm_lib_version='define' +d_link='define' +d_localtime_r='undef' +d_localtime_r_needs_tzset='undef' +d_locconv='define' +d_lockf='define' +d_longdbl='define' +d_longlong='define' +d_lseekproto='define' +d_lstat='define' +d_madvise='define' +d_malloc_good_size='undef' +d_malloc_size='undef' +d_mblen='define' +d_mbstowcs='define' +d_mbtowc='define' +d_memchr='define' +d_memcmp='define' +d_memcpy='define' +d_memmove='define' +d_memset='define' +d_mkdir='define' +d_mkdtemp='define' +d_mkfifo='define' +d_mkstemp='define' +d_mkstemps='undef' +d_mktime='define' +d_mmap='define' +d_modfl='undef' +d_modfl_pow32_bug='undef' +d_modflproto='undef' +d_mprotect='define' +d_msg='define' +d_msg_ctrunc='define' +d_msg_dontroute='define' +d_msg_oob='define' +d_msg_peek='define' +d_msg_proxy='define' +d_msgctl='define' +d_msgget='define' +d_msghdr_s='define' +d_msgrcv='define' +d_msgsnd='define' +d_msync='define' +d_munmap='define' +d_mymalloc='undef' +d_nice='define' +d_nl_langinfo='define' +d_nv_preserves_uv='define' +d_nv_zero_is_allbits_zero='define' +d_off64_t='undef' +d_old_pthread_create_joinable='undef' +d_oldpthreads='undef' +d_oldsock='undef' +d_open3='define' +d_pathconf='define' +d_pause='define' +d_perl_otherlibdirs='undef' +d_phostname='undef' +d_pipe='define' +d_poll='define' +d_portable='define' +d_printf_format_null='define' +d_procselfexe='define' +d_pseudofork='undef' +d_pthread_atfork='undef' +d_pthread_attr_setscope='define' +d_pthread_yield='undef' +d_pwage='undef' +d_pwchange='undef' +d_pwclass='undef' +d_pwcomment='undef' +d_pwexpire='undef' +d_pwgecos='define' +d_pwpasswd='define' +d_pwquota='undef' +d_qgcvt='undef' +d_quad='define' +d_random_r='undef' +d_readdir64_r='undef' +d_readdir='define' +d_readdir_r='undef' +d_readlink='define' +d_readv='define' +d_recvmsg='define' +d_rename='define' +d_rewinddir='define' +d_rmdir='define' +d_safebcpy='undef' +d_safemcpy='undef' +d_sanemcmp='define' +d_sbrkproto='define' +d_scalbnl='undef' +d_sched_yield='define' +d_scm_rights='define' +d_seekdir='define' +d_select='define' +d_sem='define' +d_semctl='define' +d_semctl_semid_ds='define' +d_semctl_semun='define' +d_semget='define' +d_semop='define' +d_sendmsg='define' +d_setegid='define' +d_seteuid='define' +d_setgrent='define' +d_setgrent_r='undef' +d_setgrps='define' +d_sethent='define' +d_sethostent_r='undef' +d_setitimer='define' +d_setlinebuf='define' +d_setlocale='define' +d_setlocale_r='undef' +d_setnent='define' +d_setnetent_r='undef' +d_setpent='define' +d_setpgid='define' +d_setpgrp2='undef' +d_setpgrp='define' +d_setprior='define' +d_setproctitle='undef' +d_setprotoent_r='undef' +d_setpwent='define' +d_setpwent_r='undef' +d_setregid='define' +d_setresgid='define' +d_setresuid='define' +d_setreuid='define' +d_setrgid='undef' +d_setruid='undef' +d_setsent='define' +d_setservent_r='undef' +d_setsid='define' +d_setvbuf='define' +d_sfio='undef' +d_shm='define' +d_shmat='define' +d_shmatprototype='define' +d_shmctl='define' +d_shmdt='define' +d_shmget='define' +d_sigaction='define' +d_signbit='undef' +d_sigprocmask='define' +d_sigsetjmp='define' +d_sitearch='define' +d_snprintf='define' +d_sockatmark='undef' +d_sockatmarkproto='undef' +d_socket='define' +d_socklen_t='define' +d_sockpair='define' +d_socks5_init='undef' +d_sprintf_returns_strlen='define' +d_sqrtl='undef' +d_srand48_r='undef' +d_srandom_r='undef' +d_sresgproto='undef' +d_sresuproto='undef' +d_statblks='define' +d_statfs_f_flags='undef' +d_statfs_s='define' +d_statvfs='define' +d_stdio_cnt_lval='undef' +d_stdio_ptr_lval='undef' +d_stdio_ptr_lval_nochange_cnt='undef' +d_stdio_ptr_lval_sets_cnt='undef' +d_stdio_stream_array='undef' +d_stdiobase='undef' +d_stdstdio='undef' +d_strchr='define' +d_strcoll='define' +d_strctcpy='define' +d_strerrm='strerror(e)' +d_strerror='define' +d_strerror_r='undef' +d_strftime='define' +d_strlcat='define' +d_strlcpy='define' +d_strtod='define' +d_strtol='define' +d_strtold='define' +d_strtoll='define' +d_strtoq='define' +d_strtoul='define' +d_strtoull='define' +d_strtouq='define' +d_strxfrm='define' +d_suidsafe='undef' +d_symlink='define' +d_syscall='define' +d_syscallproto='define' +d_sysconf='define' +d_sysernlst='' +d_syserrlst='undef' +d_system='define' +d_tcgetpgrp='define' +d_tcsetpgrp='define' +d_telldir='define' +d_telldirproto='define' +d_time='define' +d_times='define' +d_tm_tm_gmtoff='define' +d_tm_tm_zone='define' +d_tmpnam_r='undef' +d_truncate='define' +d_ttyname_r='undef' +d_tzname='define' +d_u32align='undef' +d_ualarm='define' +d_umask='define' +d_uname='define' +d_union_semun='undef' +d_unordered='undef' +d_unsetenv='define' +d_usleep='define' +d_usleepproto='define' +d_ustat='define' +d_vendorarch='undef' +d_vendorbin='undef' +d_vendorlib='undef' +d_vendorscript='undef' +d_vfork='undef' +d_void_closedir='undef' +d_voidsig='define' +d_voidtty='' +d_volatile='define' +d_vprintf='define' +d_vsnprintf='define' +d_wait4='define' +d_waitpid='define' +d_wcstombs='define' +d_wctomb='define' +d_writev='define' +d_xenix='undef' +date='date' +db_hashtype='u_int32_t' +db_prefixtype='size_t' +db_version_major='' +db_version_minor='' +db_version_patch='' +defvoidused='15' +direntrytype='struct dirent' +dlext='so' +dlsrc='dl_dlopen.xs' +doublesize='8' +drand01='drand48()' +drand48_r_proto='0' +dynamic_ext='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' +eagain='EAGAIN' +ebcdic='undef' +echo='echo' +egrep='egrep' +emacs='' +endgrent_r_proto='0' +endhostent_r_proto='0' +endnetent_r_proto='0' +endprotoent_r_proto='0' +endpwent_r_proto='0' +endservent_r_proto='0' +eunicefix=':' +exe_ext='' +expr='expr' +extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib' +extras='' +fflushNULL='define' +fflushall='undef' +find='' +firstmakefile='makefile' +flex='' +fpossize='24' +fpostype='fpos_t' +freetype='void' +from=':' +full_ar='%%AR%%' +full_csh='csh' +full_sed='sed' +gccansipedantic='' +gccosandvers='' +gccversion='3.4.3' +getgrent_r_proto='0' +getgrgid_r_proto='0' +getgrnam_r_proto='0' +gethostbyaddr_r_proto='0' +gethostbyname_r_proto='0' +gethostent_r_proto='0' +getlogin_r_proto='0' +getnetbyaddr_r_proto='0' +getnetbyname_r_proto='0' +getnetent_r_proto='0' +getprotobyname_r_proto='0' +getprotobynumber_r_proto='0' +getprotoent_r_proto='0' +getpwent_r_proto='0' +getpwnam_r_proto='0' +getpwuid_r_proto='0' +getservbyname_r_proto='0' +getservbyport_r_proto='0' +getservent_r_proto='0' +getspnam_r_proto='0' +gidformat='"lu"' +gidsign='1' +gidsize='4' +gidtype='gid_t' +glibpth='/usr/shlib /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib /usr/ucblib /usr/local/lib ' +gmake='gmake' +gmtime_r_proto='0' +gnulibc_version='' +grep='grep' +groupcat='cat /etc/group' +groupstype='gid_t' +gzip='gzip' +h_fcntl='false' +h_sysfile='true' +hint='recommended' +hostcat='cat /etc/hosts' +html1dir=' ' +html1direxp='' +html3dir=' ' +html3direxp='' +i16size='2' +i16type='short' +i32size='4' +i32type='long' +i64size='8' +i64type='long long' +i8size='1' +i8type='char' +i_arpainet='define' +i_bsdioctl='' +i_crypt='define' +i_db='define' +i_dbm='undef' +i_dirent='define' +i_dld='undef' +i_dlfcn='define' +i_fcntl='undef' +i_float='define' +i_fp='undef' +i_fp_class='undef' +i_gdbm='define' +i_grp='define' +i_ieeefp='undef' +i_inttypes='define' +i_langinfo='define' +i_libutil='undef' +i_limits='define' +i_locale='define' +i_machcthr='undef' +i_malloc='define' +i_math='define' +i_memory='undef' +i_mntent='define' +i_ndbm='undef' +i_netdb='define' +i_neterrno='undef' +i_netinettcp='define' +i_niin='define' +i_poll='define' +i_prot='undef' +i_pthread='define' +i_pwd='define' +i_rpcsvcdbm='undef' +i_sfio='undef' +i_sgtty='undef' +i_shadow='define' +i_socks='undef' +i_stdarg='define' +i_stddef='define' +i_stdlib='define' +i_string='define' +i_sunmath='undef' +i_sysaccess='undef' +i_sysdir='define' +i_sysfile='define' +i_sysfilio='undef' +i_sysin='undef' +i_sysioctl='define' +i_syslog='define' +i_sysmman='define' +i_sysmode='undef' +i_sysmount='define' +i_sysndir='undef' +i_sysparam='define' +i_sysresrc='define' +i_syssecrt='undef' +i_sysselct='define' +i_syssockio='undef' +i_sysstat='define' +i_sysstatfs='define' +i_sysstatvfs='define' +i_systime='define' +i_systimek='undef' +i_systimes='define' +i_systypes='define' +i_sysuio='define' +i_sysun='define' +i_sysutsname='define' +i_sysvfs='define' +i_syswait='define' +i_termio='undef' +i_termios='define' +i_time='define' +i_unistd='define' +i_ustat='define' +i_utime='define' +i_values='define' +i_varargs='undef' +i_varhdr='stdarg.h' +i_vfork='undef' +ignore_versioned_solibs='y' +inc_version_list=' ' +inc_version_list_init='0' +incpath='' +inews='' +installarchlib='/usr/lib/perl5/5.10' +installbin='/usr/bin' +initialinstalllocation='/usr/bin' +installhtml1dir='' +installhtml3dir='' +installman1dir='' +installman3dir='' +installprefix='/usr' +installprefixexp='/usr' +installprivlib='/usr/lib/perl5/5.10' +installscript='/usr/bin' +installsitearch='/usr/lib/perl5/5.10' +installsitebin='/usr/bin' +installsitehtml1dir='' +installsitehtml3dir='' +installsitelib='/usr/lib/perl5/5.10' +installsiteman1dir='' +installsiteman3dir='' +installsitescript='/usr/bin' +installstyle='lib/perl5' +installusrbinperl='define' +installvendorarch='' +installvendorbin='' +installvendorhtml1dir='' +installvendorhtml3dir='' +installvendorlib='' +installvendorman1dir='' +installvendorman3dir='' +installvendorscript='' +intsize='4' +issymlink='test -h' +ivdformat='"ld"' +ivsize='4' +ivtype='long' +known_extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize Win32 Win32API/File Win32CORE XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' +ksh='' +ld='%%LD%%' +lddlflags='-shared %%LDFLAGS%%' +ldflags='%%EXTRA_PERLLIBDIRS%%' +ldflags_uselargefiles='' +ldlibpthname='LD_LIBRARY_PATH' +less='less' +lib_ext='.a' +libc='' +libperl='libperl.a' +libpth='%%LIBDIRS%%' +libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc' +libsdirs='%%LIBDIRS%%' +libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' +libspath='%%LIBDIRS%%' +libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD' +libswanted_uselargefiles='' +line='' +lint='' +lkflags='' +ln='ln' +lns='/bin/ln -s' +localtime_r_proto='0' +locincpth=' ' +loclibpth=' ' +longdblsize='8' +longlongsize='8' +longsize='4' +lp='' +lpr='' +ls='ls' +lseeksize='8' +lseektype='off_t' +mad='undef' +madlyh='' +madlyobj='' +madlysrc='' +mail='' +mailx='' +make='make' +make_set_make='#' +mallocobj='' +mallocsrc='' +malloctype='void *' +man1dir=' ' +man1direxp='' +man1ext='0' +man3dir=' ' +man3direxp='' +man3ext='0' +mips_type='' +mistrustnm='' +mkdir='mkdir' +mmaptype='void *' +modetype='mode_t' +more='more' +multiarch='undef' +mv='' +myarchname='mipsel-linux-uclibc' +mydomain='.dev.null' +myhostname='merope' +myuname='linux merope 2.4.30 #1 di 23. jan 15:23:42 cet 2007 mips unknown unknown gnulinux ' +n='-n' +need_va_copy='undef' +netdb_hlen_type='size_t' +netdb_host_type='const void *' +netdb_name_type='const char *' +netdb_net_type='in_addr_t' +nm='nm' +nm_opt='' +nm_so_opt='--dynamic' +nonxs_ext='Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib' +nroff='nroff' +nvEUformat='"E"' +nvFUformat='"F"' +nvGUformat='"G"' +nv_preserves_uv_bits='32' +nveformat='"e"' +nvfformat='"f"' +nvgformat='"g"' +nvsize='8' +nvtype='double' +o_nonblock='O_NONBLOCK' +obj_ext='.o' +old_pthread_create_joinable='' +optimize='-O2' +orderlib='false' +osname='linux' +osvers='2.4.30' +otherlibdirs=' ' +package='perl5' +pager='/usr/bin/less' +passcat='cat /etc/passwd' +patchlevel='10' +path_sep=':' +perl5='' +perl='' +perl_patchlevel='' +perladmin='root@merope.dev.null' +perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%' +perlpath='/usr/bin/perl' +pg='pg' +phostname='hostname' +pidtype='pid_t' +plibpth='' +pmake='' +pr='' +prefix='/usr' +prefixexp='/usr' +privlib='/usr/lib/perl5/5.10' +privlibexp='/usr/lib/perl5/5.10' +procselfexe='"/proc/self/exe"' +prototype='define' +ptrsize='4' +quadkind='3' +quadtype='long long' +randbits='48' +randfunc='drand48' +random_r_proto='0' +randseedtype='long' +ranlib=':' +rd_nodata='-1' +readdir64_r_proto='0' +readdir_r_proto='0' +revision='5' +rm='rm' +rm_try='/bin/rm -f try try a.out .out try.[cho] try..o core core.try* try.core*' +rmail='' +run='' +runnm='false' +sPRIEUldbl='"E"' +sPRIFUldbl='"F"' +sPRIGUldbl='"G"' +sPRIXU64='"LX"' +sPRId64='"Ld"' +sPRIeldbl='"e"' +sPRIfldbl='"f"' +sPRIgldbl='"g"' +sPRIi64='"Li"' +sPRIo64='"Lo"' +sPRIu64='"Lu"' +sPRIx64='"Lx"' +sSCNfldbl='"f"' +sched_yield='sched_yield()' +scriptdir='/usr/bin' +scriptdirexp='/usr/bin' +sed='sed' +seedfunc='srand48' +selectminbits='32' +selecttype='fd_set *' +sendmail='' +setgrent_r_proto='0' +sethostent_r_proto='0' +setlocale_r_proto='0' +setnetent_r_proto='0' +setprotoent_r_proto='0' +setpwent_r_proto='0' +setservent_r_proto='0' +sh='/bin/sh' +shar='' +sharpbang='#!' +shmattype='void *' +shortsize='2' +shrpenv='' +shsharp='true' +sig_count='128' +sig_name='ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM USR1 USR2 CHLD PWR WINCH URG IO STOP TSTP CONT TTIN TTOU VTALRM PROF XCPU XFSZ RTMIN NUM33 NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 NUM63 NUM64 NUM65 NUM66 NUM67 NUM68 NUM69 NUM70 NUM71 NUM72 NUM73 NUM74 NUM75 NUM76 NUM77 NUM78 NUM79 NUM80 NUM81 NUM82 NUM83 NUM84 NUM85 NUM86 NUM87 NUM88 NUM89 NUM90 NUM91 NUM92 NUM93 NUM94 NUM95 NUM96 NUM97 NUM98 NUM99 NUM100 NUM101 NUM102 NUM103 NUM104 NUM105 NUM106 NUM107 NUM108 NUM109 NUM110 NUM111 NUM112 NUM113 NUM114 NUM115 NUM116 NUM117 NUM118 NUM119 NUM120 NUM121 NUM122 NUM123 NUM124 NUM125 NUM126 RTMAX IOT CLD POLL ' +sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "EMT", "FPE", "KILL", "BUS", "SEGV", "SYS", "PIPE", "ALRM", "TERM", "USR1", "USR2", "CHLD", "PWR", "WINCH", "URG", "IO", "STOP", "TSTP", "CONT", "TTIN", "TTOU", "VTALRM", "PROF", "XCPU", "XFSZ", "RTMIN", "NUM33", "NUM34", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "NUM63", "NUM64", "NUM65", "NUM66", "NUM67", "NUM68", "NUM69", "NUM70", "NUM71", "NUM72", "NUM73", "NUM74", "NUM75", "NUM76", "NUM77", "NUM78", "NUM79", "NUM80", "NUM81", "NUM82", "NUM83", "NUM84", "NUM85", "NUM86", "NUM87", "NUM88", "NUM89", "NUM90", "NUM91", "NUM92", "NUM93", "NUM94", "NUM95", "NUM96", "NUM97", "NUM98", "NUM99", "NUM100", "NUM101", "NUM102", "NUM103", "NUM104", "NUM105", "NUM106", "NUM107", "NUM108", "NUM109", "NUM110", "NUM111", "NUM112", "NUM113", "NUM114", "NUM115", "NUM116", "NUM117", "NUM118", "NUM119", "NUM120", "NUM121", "NUM122", "NUM123", "NUM124", "NUM125", "NUM126", "RTMAX", "IOT", "CLD", "POLL", 0' +sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 6 18 22 ' +sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 6, 18, 22, 0' +sig_size='131' +signal_t='void' +sitearch='' +sitearchexp='' +sitebin='/usr/bin' +sitebinexp='/usr/bin' +sitehtml1dir='' +sitehtml1direxp='' +sitehtml3dir='' +sitehtml3direxp='' +sitelib='' +#sitelib_stem='/usr/lib/perl5/site_perl' +sitelibexp='' +siteman1dir='' +siteman1direxp='' +siteman3dir='' +siteman3direxp='' +siteprefix='/usr' +siteprefixexp='/usr' +sitescript='/usr/bin' +sitescriptexp='/usr/bin' +sizesize='4' +sizetype='size_t' +sleep='' +smail='' +so='so' +sockethdr='' +socketlib='' +socksizetype='socklen_t' +sort='sort' +spackage='Perl5' +spitshell='cat' +srand48_r_proto='0' +srandom_r_proto='0' +src='.' +ssizetype='ssize_t' +startperl='#!/usr/bin/perl' +startsh='#!/bin/sh' +static_ext=' ' +stdchar='char' +stdio_base='((fp)->_base)' +stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)' +stdio_cnt='((fp)->_cnt)' +stdio_filbuf='' +stdio_ptr='((fp)->_ptr)' +stdio_stream_array='' +strerror_r_proto='0' +#strings='/usr/include/string.h' +submit='' +subversion='0' +sysman='/usr/share/man/man1' +tail='' +tar='' +targetarch='mipsel-linux-uclibc' +tbl='' +tee='' +test='test' +#timeincl='/usr/include/sys/time.h /usr/include/time.h ' +timetype='time_t' +tmpnam_r_proto='0' +to=':' +touch='touch' +tr='tr' +trnl='\n' +troff='' +ttyname_r_proto='0' +u16size='2' +u16type='unsigned short' +u32size='4' +u32type='unsigned long' +u64size='8' +u64type='unsigned long long' +u8size='1' +u8type='unsigned char' +uidformat='"lu"' +uidsign='1' +uidsize='4' +uidtype='uid_t' +uname='uname' +uniq='uniq' +uquadtype='unsigned long long' +use5005threads='undef' +use64bitall='undef' +use64bitint='undef' +usecrosscompile='define' +usedl='define' +usefaststdio='undef' +useithreads='undef' +uselargefiles='define' +uselongdouble='undef' +usemallocwrap='define' +usemorebits='undef' +usemultiplicity='undef' +usemymalloc='n' +usenm='true' +useopcode='true' +useperlio='define' +useposix='true' +usereentrant='undef' +userelocatableinc='undef' +usesfio='false' +useshrplib='false' +usesitecustomize='undef' +usesocks='undef' +usethreads='undef' +usevendorprefix='undef' +usevfork='false' +usrinc='%%INCDIRS%%' +uuname='' +uvXUformat='"lX"' +uvoformat='"lo"' +uvsize='4' +uvtype='unsigned long' +uvuformat='"lu"' +uvxformat='"lx"' +vendorarch='' +vendorarchexp='' +vendorbin='' +vendorbinexp='' +vendorhtml1dir=' ' +vendorhtml1direxp='' +vendorhtml3dir=' ' +vendorhtml3direxp='' +vendorlib='' +vendorlib_stem='' +vendorlibexp='' +vendorman1dir=' ' +vendorman1direxp='' +vendorman3dir=' ' +vendorman3direxp='' +vendorprefix='' +vendorprefixexp='' +vendorscript='' +vendorscriptexp='' +version='5.10.0' +version_patchlevel_string='version 10 subversion 0' +versiononly='undef' +vi='' +voidflags='15' +xlibpth='/usr/lib/386 /lib/386' +yacc='yacc' +yaccflags='' +zcat='' +zip='zip' +# Configure command line arguments. +config_arg0='./Configure' +config_args='-der' +config_argc=1 +config_arg1='-der' +PERL_REVISION=5 +PERL_VERSION=10 +PERL_SUBVERSION=0 +PERL_API_REVISION=5 +PERL_API_VERSION=10 +PERL_API_SUBVERSION=0 +PERL_PATCHLEVEL= +PERL_CONFIG_SH=true +# Fix problem with HiRes timer. +d_nanosleep='define' +d_clock_gettime='define' +d_clock_getres='define' +d_clock_nanosleep='define' +d_clock='define' diff --git a/lang/perl/files/config.sh-powerpc.in b/lang/perl/files/config.sh-powerpc.in new file mode 100644 index 0000000..e626586 --- /dev/null +++ b/lang/perl/files/config.sh-powerpc.in @@ -0,0 +1,1068 @@ +#!/bin/sh +# +# This file was produced by running the Configure script. It holds all the +# definitions figured out by Configure. Should you modify one of these values, +# do not forget to propagate your changes by running "Configure -der". You may +# instead choose to run each of the .SH files by yourself, or "Configure -S". +# + +# Package name : perl5 +# Source directory : . +# Configuration time: Fri Jul 20 04:26:18 MDT 2007 +# Configured by : root +# Target system : linux maia 2.6.22 #1 wed jul 11 12:24:09 cest 2007 ppc unknown unknown gnulinux + +Author='' +Date='$Date' +Header='' +Id='$Id' +Locker='' +Log='$Log' +Mcc='Mcc' +RCSfile='$RCSfile' +Revision='$Revision' +Source='' +State='' +_a='.a' +_exe='' +_o='.o' +afs='false' +afsroot='/afs' +alignbytes='8' +ansi2knr='' +aphostname='/bin/hostname' +api_revision='5' +api_subversion='0' +api_version='10' +api_versionstring='5.10.0' +ar='ar' +archlib='' +archlibexp='' +archname64='' +archname='powerpc-linux-uclibc' +archobjs='' +asctime_r_proto='0' +awk='awk' +baserev='5.0' +bash='' +bin='/usr/bin' +binexp='/usr/bin' +bison='bison' +byacc='byacc' +byteorder='4321' +c='' +castflags='0' +cat='cat' +cc='%%CC%%' +cccdlflags='-fPIC' +ccdlflags='-Wl,-E' +ccflags='%%CFLAGS%%' +ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' +ccname='gcc' +ccsymbols='__gnu_linux__=1 __linux=1 __linux__=1 __unix=1 __unix__=1 system=linux system=posix system=unix' +ccversion='' +cf_by='root' +cf_email='root@maia.dev.null' +cf_time='Fri Jul 20 04:26:18 MDT 2007' +chgrp='' +chmod='chmod' +chown='' +clocktype='clock_t' +comm='comm' +compress='' +contains='grep' +cp='cp' +cpio='' +cpp='cpp' +cpp_stuff='42' +cppccsymbols='linux=1 unix=1' +cppflags='%%CFLAGS%%' +cpplast='-' +cppminus='-' +cpprun='%%CPP%%' +cppstdin='%%CPP%%' +cppsymbols='_BIG_ENDIAN=1 __BIG_ENDIAN__=1 __ELF__=1 _FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC__=3 __GNUC_MINOR__=4 __GNU_LIBRARY__=6 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=199506L _POSIX_SOURCE=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 __linux=1 __linux__=1 __unix=1 __unix__=1' +crypt_r_proto='0' +cryptlib='' +csh='csh' +ctermid_r_proto='0' +ctime_r_proto='0' +d_Gconvert='sprintf((b),"%.*g",(n),(x))' +d_PRIEUldbl='define' +d_PRIFUldbl='define' +d_PRIGUldbl='define' +d_PRIXU64='define' +d_PRId64='define' +d_PRIeldbl='define' +d_PRIfldbl='define' +d_PRIgldbl='define' +d_PRIi64='define' +d_PRIo64='define' +d_PRIu64='define' +d_PRIx64='define' +d_SCNfldbl='define' +d__fwalk='undef' +d_access='define' +d_accessx='undef' +d_aintl='undef' +d_alarm='define' +d_archlib='undef' +d_asctime_r='undef' +d_atolf='undef' +d_atoll='define' +d_attribute_format='define' +d_attribute_malloc='define' +d_attribute_nonnull='define' +d_attribute_noreturn='define' +d_attribute_pure='define' +d_attribute_unused='define' +d_attribute_warn_unused_result='define' +d_bcmp='define' +d_bcopy='define' +d_bsd='undef' +d_bsdgetpgrp='undef' +d_bsdsetpgrp='undef' +d_builtin_choose_expr='define' +d_builtin_expect='undef' +d_bzero='define' +d_c99_variadic_macros='define' +d_casti32='undef' +d_castneg='define' +d_charvspr='undef' +d_chown='define' +d_chroot='define' +d_chsize='undef' +d_class='undef' +d_clearenv='define' +d_closedir='define' +d_cmsghdr_s='define' +d_const='define' +d_copysignl='undef' +d_cplusplus='undef' +d_crypt='define' +d_crypt_r='undef' +d_csh='undef' +d_ctermid='define' +d_ctermid_r='undef' +d_ctime_r='undef' +d_cuserid='define' +d_dbl_dig='define' +d_dbminitproto='undef' +d_difftime='define' +d_dir_dd_fd='undef' +d_dirfd='define' +d_dirnamlen='undef' +d_dlerror='define' +d_dlopen='define' +d_dlsymun='undef' +d_dosuid='undef' +d_drand48_r='undef' +d_drand48proto='define' +d_dup2='define' +d_eaccess='undef' +d_endgrent='define' +d_endgrent_r='undef' +d_endhent='define' +d_endhostent_r='undef' +d_endnent='define' +d_endnetent_r='undef' +d_endpent='define' +d_endprotoent_r='undef' +d_endpwent='define' +d_endpwent_r='undef' +d_endsent='define' +d_endservent_r='undef' +d_eofnblk='define' +d_eunice='undef' +d_faststdio='undef' +d_fchdir='define' +d_fchmod='define' +d_fchown='define' +d_fcntl='define' +d_fcntl_can_lock='define' +d_fd_macros='define' +d_fd_set='define' +d_fds_bits='undef' +d_fgetpos='define' +d_finite='define' +d_finitel='undef' +d_flexfnam='define' +d_flock='define' +d_flockproto='define' +d_fork='define' +d_fp_class='undef' +d_fpathconf='define' +d_fpclass='undef' +d_fpclassify='undef' +d_fpclassl='undef' +d_fpos64_t='undef' +d_frexpl='undef' +d_fs_data_s='undef' +d_fseeko='define' +d_fsetpos='define' +d_fstatfs='define' +d_fstatvfs='define' +d_fsync='define' +d_ftello='define' +d_ftime='undef' +d_futimes='undef' +d_getcwd='define' +d_getespwnam='undef' +d_getfsstat='undef' +d_getgrent='define' +d_getgrent_r='undef' +d_getgrgid_r='undef' +d_getgrnam_r='undef' +d_getgrps='define' +d_gethbyaddr='define' +d_gethbyname='define' +d_gethent='define' +d_gethname='define' +d_gethostbyaddr_r='undef' +d_gethostbyname_r='undef' +d_gethostent_r='undef' +d_gethostprotos='define' +d_getitimer='define' +d_getlogin='define' +d_getlogin_r='undef' +d_getmnt='undef' +d_getmntent='define' +d_getnbyaddr='define' +d_getnbyname='define' +d_getnent='define' +d_getnetbyaddr_r='undef' +d_getnetbyname_r='undef' +d_getnetent_r='undef' +d_getnetprotos='define' +d_getpagsz='define' +d_getpbyname='define' +d_getpbynumber='define' +d_getpent='define' +d_getpgid='define' +d_getpgrp2='undef' +d_getpgrp='define' +d_getppid='define' +d_getprior='define' +d_getprotobyname_r='undef' +d_getprotobynumber_r='undef' +d_getprotoent_r='undef' +d_getprotoprotos='define' +d_getprpwnam='undef' +d_getpwent='define' +d_getpwent_r='undef' +d_getpwnam_r='undef' +d_getpwuid_r='undef' +d_getsbyname='define' +d_getsbyport='define' +d_getsent='define' +d_getservbyname_r='undef' +d_getservbyport_r='undef' +d_getservent_r='undef' +d_getservprotos='define' +d_getspnam='define' +d_getspnam_r='undef' +d_gettimeod='define' +d_gmtime_r='undef' +d_gnulibc='undef' +d_grpasswd='define' +d_hasmntopt='define' +d_htonl='define' +d_ilogbl='undef' +d_inc_version_list='undef' +d_index='undef' +d_inetaton='define' +d_int64_t='define' +d_isascii='define' +d_isfinite='undef' +d_isinf='define' +d_isnan='define' +d_isnanl='undef' +d_killpg='define' +d_lchown='define' +d_ldbl_dig='define' +d_libm_lib_version='define' +d_link='define' +d_localtime_r='undef' +d_localtime_r_needs_tzset='undef' +d_locconv='define' +d_lockf='define' +d_longdbl='define' +d_longlong='define' +d_lseekproto='define' +d_lstat='define' +d_madvise='define' +d_malloc_good_size='undef' +d_malloc_size='undef' +d_mblen='define' +d_mbstowcs='define' +d_mbtowc='define' +d_memchr='define' +d_memcmp='define' +d_memcpy='define' +d_memmove='define' +d_memset='define' +d_mkdir='define' +d_mkdtemp='define' +d_mkfifo='define' +d_mkstemp='define' +d_mkstemps='undef' +d_mktime='define' +d_mmap='define' +d_modfl='undef' +d_modfl_pow32_bug='undef' +d_modflproto='undef' +d_mprotect='define' +d_msg='define' +d_msg_ctrunc='define' +d_msg_dontroute='define' +d_msg_oob='define' +d_msg_peek='define' +d_msg_proxy='define' +d_msgctl='define' +d_msgget='define' +d_msghdr_s='define' +d_msgrcv='define' +d_msgsnd='define' +d_msync='define' +d_munmap='define' +d_mymalloc='undef' +d_nice='define' +d_nl_langinfo='define' +d_nv_preserves_uv='define' +d_nv_zero_is_allbits_zero='define' +d_off64_t='undef' +d_old_pthread_create_joinable='undef' +d_oldpthreads='undef' +d_oldsock='undef' +d_open3='define' +d_pathconf='define' +d_pause='define' +d_perl_otherlibdirs='undef' +d_phostname='undef' +d_pipe='define' +d_poll='define' +d_portable='define' +d_printf_format_null='define' +d_procselfexe='define' +d_pseudofork='undef' +d_pthread_atfork='undef' +d_pthread_attr_setscope='define' +d_pthread_yield='undef' +d_pwage='undef' +d_pwchange='undef' +d_pwclass='undef' +d_pwcomment='undef' +d_pwexpire='undef' +d_pwgecos='define' +d_pwpasswd='define' +d_pwquota='undef' +d_qgcvt='undef' +d_quad='define' +d_random_r='undef' +d_readdir64_r='undef' +d_readdir='define' +d_readdir_r='undef' +d_readlink='define' +d_readv='define' +d_recvmsg='define' +d_rename='define' +d_rewinddir='define' +d_rmdir='define' +d_safebcpy='undef' +d_safemcpy='undef' +d_sanemcmp='define' +d_sbrkproto='define' +d_scalbnl='undef' +d_sched_yield='define' +d_scm_rights='define' +d_seekdir='define' +d_select='define' +d_sem='define' +d_semctl='define' +d_semctl_semid_ds='define' +d_semctl_semun='define' +d_semget='define' +d_semop='define' +d_sendmsg='define' +d_setegid='define' +d_seteuid='define' +d_setgrent='define' +d_setgrent_r='undef' +d_setgrps='define' +d_sethent='define' +d_sethostent_r='undef' +d_setitimer='define' +d_setlinebuf='define' +d_setlocale='define' +d_setlocale_r='undef' +d_setnent='define' +d_setnetent_r='undef' +d_setpent='define' +d_setpgid='define' +d_setpgrp2='undef' +d_setpgrp='define' +d_setprior='define' +d_setproctitle='undef' +d_setprotoent_r='undef' +d_setpwent='define' +d_setpwent_r='undef' +d_setregid='define' +d_setresgid='define' +d_setresuid='define' +d_setreuid='define' +d_setrgid='undef' +d_setruid='undef' +d_setsent='define' +d_setservent_r='undef' +d_setsid='define' +d_setvbuf='define' +d_sfio='undef' +d_shm='define' +d_shmat='define' +d_shmatprototype='define' +d_shmctl='define' +d_shmdt='define' +d_shmget='define' +d_sigaction='define' +d_signbit='undef' +d_sigprocmask='define' +d_sigsetjmp='define' +d_sitearch='define' +d_snprintf='define' +d_sockatmark='undef' +d_sockatmarkproto='undef' +d_socket='define' +d_socklen_t='define' +d_sockpair='define' +d_socks5_init='undef' +d_sprintf_returns_strlen='define' +d_sqrtl='undef' +d_srand48_r='undef' +d_srandom_r='undef' +d_sresgproto='undef' +d_sresuproto='undef' +d_statblks='define' +d_statfs_f_flags='undef' +d_statfs_s='define' +d_statvfs='define' +d_stdio_cnt_lval='undef' +d_stdio_ptr_lval='undef' +d_stdio_ptr_lval_nochange_cnt='undef' +d_stdio_ptr_lval_sets_cnt='undef' +d_stdio_stream_array='undef' +d_stdiobase='undef' +d_stdstdio='undef' +d_strchr='define' +d_strcoll='define' +d_strctcpy='define' +d_strerrm='strerror(e)' +d_strerror='define' +d_strerror_r='undef' +d_strftime='define' +d_strlcat='define' +d_strlcpy='define' +d_strtod='define' +d_strtol='define' +d_strtold='define' +d_strtoll='define' +d_strtoq='define' +d_strtoul='define' +d_strtoull='define' +d_strtouq='define' +d_strxfrm='define' +d_suidsafe='undef' +d_symlink='define' +d_syscall='define' +d_syscallproto='define' +d_sysconf='define' +d_sysernlst='' +d_syserrlst='undef' +d_system='define' +d_tcgetpgrp='define' +d_tcsetpgrp='define' +d_telldir='define' +d_telldirproto='define' +d_time='define' +d_times='define' +d_tm_tm_gmtoff='define' +d_tm_tm_zone='define' +d_tmpnam_r='undef' +d_truncate='define' +d_ttyname_r='undef' +d_tzname='define' +d_u32align='undef' +d_ualarm='define' +d_umask='define' +d_uname='define' +d_union_semun='undef' +d_unordered='undef' +d_unsetenv='define' +d_usleep='define' +d_usleepproto='define' +d_ustat='define' +d_vendorarch='undef' +d_vendorbin='undef' +d_vendorlib='undef' +d_vendorscript='undef' +d_vfork='undef' +d_void_closedir='undef' +d_voidsig='define' +d_voidtty='' +d_volatile='define' +d_vprintf='define' +d_vsnprintf='define' +d_wait4='define' +d_waitpid='define' +d_wcstombs='define' +d_wctomb='define' +d_writev='define' +d_xenix='undef' +date='date' +db_hashtype='u_int32_t' +db_prefixtype='size_t' +db_version_major='' +db_version_minor='' +db_version_patch='' +defvoidused='15' +direntrytype='struct dirent' +dlext='so' +dlsrc='dl_dlopen.xs' +doublesize='8' +drand01='drand48()' +drand48_r_proto='0' +dynamic_ext='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' +eagain='EAGAIN' +ebcdic='undef' +echo='echo' +egrep='egrep' +emacs='' +endgrent_r_proto='0' +endhostent_r_proto='0' +endnetent_r_proto='0' +endprotoent_r_proto='0' +endpwent_r_proto='0' +endservent_r_proto='0' +eunicefix=':' +exe_ext='' +expr='expr' +extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib' +extras='' +fflushNULL='define' +fflushall='undef' +find='' +firstmakefile='makefile' +flex='' +fpossize='24' +fpostype='fpos_t' +freetype='void' +from=':' +full_ar='%%AR%%' +full_csh='csh' +full_sed='sed' +gccansipedantic='' +gccosandvers='' +gccversion='3.4.3' +getgrent_r_proto='0' +getgrgid_r_proto='0' +getgrnam_r_proto='0' +gethostbyaddr_r_proto='0' +gethostbyname_r_proto='0' +gethostent_r_proto='0' +getlogin_r_proto='0' +getnetbyaddr_r_proto='0' +getnetbyname_r_proto='0' +getnetent_r_proto='0' +getprotobyname_r_proto='0' +getprotobynumber_r_proto='0' +getprotoent_r_proto='0' +getpwent_r_proto='0' +getpwnam_r_proto='0' +getpwuid_r_proto='0' +getservbyname_r_proto='0' +getservbyport_r_proto='0' +getservent_r_proto='0' +getspnam_r_proto='0' +gidformat='"lu"' +gidsign='1' +gidsize='4' +gidtype='gid_t' +glibpth='/usr/shlib /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib /usr/ucblib /usr/local/lib ' +gmake='gmake' +gmtime_r_proto='0' +gnulibc_version='' +grep='grep' +groupcat='cat /etc/group' +groupstype='gid_t' +gzip='gzip' +h_fcntl='false' +h_sysfile='true' +hint='recommended' +hostcat='cat /etc/hosts' +html1dir=' ' +html1direxp='' +html3dir=' ' +html3direxp='' +i16size='2' +i16type='short' +i32size='4' +i32type='long' +i64size='8' +i64type='long long' +i8size='1' +i8type='char' +i_arpainet='define' +i_bsdioctl='' +i_crypt='define' +i_db='define' +i_dbm='undef' +i_dirent='define' +i_dld='undef' +i_dlfcn='define' +i_fcntl='undef' +i_float='define' +i_fp='undef' +i_fp_class='undef' +i_gdbm='define' +i_grp='define' +i_ieeefp='undef' +i_inttypes='define' +i_langinfo='define' +i_libutil='undef' +i_limits='define' +i_locale='define' +i_machcthr='undef' +i_malloc='define' +i_math='define' +i_memory='undef' +i_mntent='define' +i_ndbm='undef' +i_netdb='define' +i_neterrno='undef' +i_netinettcp='define' +i_niin='define' +i_poll='define' +i_prot='undef' +i_pthread='define' +i_pwd='define' +i_rpcsvcdbm='undef' +i_sfio='undef' +i_sgtty='undef' +i_shadow='define' +i_socks='undef' +i_stdarg='define' +i_stddef='define' +i_stdlib='define' +i_string='define' +i_sunmath='undef' +i_sysaccess='undef' +i_sysdir='define' +i_sysfile='define' +i_sysfilio='undef' +i_sysin='undef' +i_sysioctl='define' +i_syslog='define' +i_sysmman='define' +i_sysmode='undef' +i_sysmount='define' +i_sysndir='undef' +i_sysparam='define' +i_sysresrc='define' +i_syssecrt='undef' +i_sysselct='define' +i_syssockio='undef' +i_sysstat='define' +i_sysstatfs='define' +i_sysstatvfs='define' +i_systime='define' +i_systimek='undef' +i_systimes='define' +i_systypes='define' +i_sysuio='define' +i_sysun='define' +i_sysutsname='define' +i_sysvfs='define' +i_syswait='define' +i_termio='undef' +i_termios='define' +i_time='define' +i_unistd='define' +i_ustat='define' +i_utime='define' +i_values='define' +i_varargs='undef' +i_varhdr='stdarg.h' +i_vfork='undef' +ignore_versioned_solibs='y' +inc_version_list=' ' +inc_version_list_init='0' +incpath='' +inews='' +installarchlib='/usr/lib/perl5/5.10' +installbin='/usr/bin' +initialinstalllocation='/usr/bin' +installhtml1dir='' +installhtml3dir='' +installman1dir='' +installman3dir='' +installprefix='/usr' +installprefixexp='/usr' +installprivlib='/usr/lib/perl5/5.10' +installscript='/usr/bin' +installsitearch='/usr/lib/perl5/5.10' +installsitebin='/usr/bin' +installsitehtml1dir='' +installsitehtml3dir='' +installsitelib='/usr/lib/perl5/5.10' +installsiteman1dir='' +installsiteman3dir='' +installsitescript='/usr/bin' +installstyle='lib/perl5' +installusrbinperl='define' +installvendorarch='' +installvendorbin='' +installvendorhtml1dir='' +installvendorhtml3dir='' +installvendorlib='' +installvendorman1dir='' +installvendorman3dir='' +installvendorscript='' +intsize='4' +issymlink='test -h' +ivdformat='"ld"' +ivsize='4' +ivtype='long' +known_extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize Win32 Win32API/File Win32CORE XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' +ksh='' +ld='%%LD%%' +lddlflags='-shared %%LDFLAGS%%' +ldflags='%%EXTRA_PERLLIBDIRS%%' +ldflags_uselargefiles='' +ldlibpthname='LD_LIBRARY_PATH' +less='less' +lib_ext='.a' +libc='' +libperl='libperl.a' +libpth='%%LIBDIRS%%' +libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc' +libsdirs='%%LIBDIRS%%' +libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' +libspath='%%LIBDIRS%%' +libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD' +libswanted_uselargefiles='' +line='' +lint='' +lkflags='' +ln='ln' +lns='/bin/ln -s' +localtime_r_proto='0' +locincpth=' ' +loclibpth=' ' +longdblsize='8' +longlongsize='8' +longsize='4' +lp='' +lpr='' +ls='ls' +lseeksize='8' +lseektype='off_t' +mad='undef' +madlyh='' +madlyobj='' +madlysrc='' +mail='' +mailx='' +make='make' +make_set_make='#' +mallocobj='' +mallocsrc='' +malloctype='void *' +man1dir=' ' +man1direxp='' +man1ext='0' +man3dir=' ' +man3direxp='' +man3ext='0' +mips_type='' +mistrustnm='' +mkdir='mkdir' +mmaptype='void *' +modetype='mode_t' +more='more' +multiarch='undef' +mv='' +myarchname='powerpc-linux-uclibc' +mydomain='.dev.null' +myhostname='maia' +myuname='linux maia 2.6.22 #1 wed jul 11 12:24:09 cest 2007 ppc unknown unknown gnulinux ' +n='-n' +need_va_copy='define' +netdb_hlen_type='size_t' +netdb_host_type='const void *' +netdb_name_type='const char *' +netdb_net_type='in_addr_t' +nm='nm' +nm_opt='' +nm_so_opt='--dynamic' +nonxs_ext='Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib' +nroff='nroff' +nvEUformat='"E"' +nvFUformat='"F"' +nvGUformat='"G"' +nv_preserves_uv_bits='32' +nveformat='"e"' +nvfformat='"f"' +nvgformat='"g"' +nvsize='8' +nvtype='double' +o_nonblock='O_NONBLOCK' +obj_ext='.o' +old_pthread_create_joinable='' +optimize='-O2' +orderlib='false' +osname='linux' +osvers='2.6.22' +otherlibdirs=' ' +package='perl5' +pager='/usr/bin/less' +passcat='cat /etc/passwd' +patchlevel='10' +path_sep=':' +perl5='' +perl='' +perl_patchlevel='' +perladmin='root@maia.dev.null' +perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%' +perlpath='/usr/bin/perl' +pg='pg' +phostname='hostname' +pidtype='pid_t' +plibpth='' +pmake='' +pr='' +prefix='/usr' +prefixexp='/usr' +privlib='/usr/lib/perl5/5.10' +privlibexp='/usr/lib/perl5/5.10' +procselfexe='"/proc/self/exe"' +prototype='define' +ptrsize='4' +quadkind='3' +quadtype='long long' +randbits='48' +randfunc='drand48' +random_r_proto='0' +randseedtype='long' +ranlib=':' +rd_nodata='-1' +readdir64_r_proto='0' +readdir_r_proto='0' +revision='5' +rm='rm' +rm_try='/bin/rm -f try try a.out .out try.[cho] try..o core core.try* try.core*' +rmail='' +run='' +runnm='false' +sPRIEUldbl='"E"' +sPRIFUldbl='"F"' +sPRIGUldbl='"G"' +sPRIXU64='"LX"' +sPRId64='"Ld"' +sPRIeldbl='"e"' +sPRIfldbl='"f"' +sPRIgldbl='"g"' +sPRIi64='"Li"' +sPRIo64='"Lo"' +sPRIu64='"Lu"' +sPRIx64='"Lx"' +sSCNfldbl='"f"' +sched_yield='sched_yield()' +scriptdir='/usr/bin' +scriptdirexp='/usr/bin' +sed='sed' +seedfunc='srand48' +selectminbits='32' +selecttype='fd_set *' +sendmail='' +setgrent_r_proto='0' +sethostent_r_proto='0' +setlocale_r_proto='0' +setnetent_r_proto='0' +setprotoent_r_proto='0' +setpwent_r_proto='0' +setservent_r_proto='0' +sh='/bin/sh' +shar='' +sharpbang='#!' +shmattype='void *' +shortsize='2' +shrpenv='' +shsharp='true' +sig_count='64' +sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN NUM33 NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 RTMAX IOT CLD POLL UNUSED ' +sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "RTMIN", "NUM33", "NUM34", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0' +sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 6 17 29 31 ' +sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 6, 17, 29, 31, 0' +sig_size='68' +signal_t='void' +sitearch='' +sitearchexp='' +sitebin='/usr/bin' +sitebinexp='/usr/bin' +sitehtml1dir='' +sitehtml1direxp='' +sitehtml3dir='' +sitehtml3direxp='' +sitelib='' +#sitelib_stem='/usr/lib/perl5/site_perl' +sitelibexp='' +siteman1dir='' +siteman1direxp='' +siteman3dir='' +siteman3direxp='' +siteprefix='/usr' +siteprefixexp='/usr' +sitescript='/usr/bin' +sitescriptexp='/usr/bin' +sizesize='4' +sizetype='size_t' +sleep='' +smail='' +so='so' +sockethdr='' +socketlib='' +socksizetype='socklen_t' +sort='sort' +spackage='Perl5' +spitshell='cat' +srand48_r_proto='0' +srandom_r_proto='0' +src='.' +ssizetype='ssize_t' +startperl='#!/usr/bin/perl' +startsh='#!/bin/sh' +static_ext=' ' +stdchar='char' +stdio_base='((fp)->_base)' +stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)' +stdio_cnt='((fp)->_cnt)' +stdio_filbuf='' +stdio_ptr='((fp)->_ptr)' +stdio_stream_array='' +strerror_r_proto='0' +#strings='/usr/include/string.h' +submit='' +subversion='0' +sysman='/usr/share/man/man1' +tail='' +tar='' +targetarch='powerpc-linux-uclibc' +tbl='' +tee='' +test='test' +#timeincl='/usr/include/sys/time.h /usr/include/time.h ' +timetype='time_t' +tmpnam_r_proto='0' +to=':' +touch='touch' +tr='tr' +trnl='\n' +troff='' +ttyname_r_proto='0' +u16size='2' +u16type='unsigned short' +u32size='4' +u32type='unsigned long' +u64size='8' +u64type='unsigned long long' +u8size='1' +u8type='unsigned char' +uidformat='"lu"' +uidsign='1' +uidsize='4' +uidtype='uid_t' +uname='uname' +uniq='uniq' +uquadtype='unsigned long long' +use5005threads='undef' +use64bitall='undef' +use64bitint='undef' +usecrosscompile='define' +usedl='define' +usefaststdio='undef' +useithreads='undef' +uselargefiles='define' +uselongdouble='undef' +usemallocwrap='define' +usemorebits='undef' +usemultiplicity='undef' +usemymalloc='n' +usenm='true' +useopcode='true' +useperlio='define' +useposix='true' +usereentrant='undef' +userelocatableinc='undef' +usesfio='false' +useshrplib='false' +usesitecustomize='undef' +usesocks='undef' +usethreads='undef' +usevendorprefix='undef' +usevfork='false' +usrinc='%%INCDIRS%%' +uuname='' +uvXUformat='"lX"' +uvoformat='"lo"' +uvsize='4' +uvtype='unsigned long' +uvuformat='"lu"' +uvxformat='"lx"' +vendorarch='' +vendorarchexp='' +vendorbin='' +vendorbinexp='' +vendorhtml1dir=' ' +vendorhtml1direxp='' +vendorhtml3dir=' ' +vendorhtml3direxp='' +vendorlib='' +vendorlib_stem='' +vendorlibexp='' +vendorman1dir=' ' +vendorman1direxp='' +vendorman3dir=' ' +vendorman3direxp='' +vendorprefix='' +vendorprefixexp='' +vendorscript='' +vendorscriptexp='' +version='5.10.0' +version_patchlevel_string='version 10 subversion 0' +versiononly='undef' +vi='' +voidflags='15' +xlibpth='/usr/lib/386 /lib/386' +yacc='yacc' +yaccflags='' +zcat='' +zip='zip' +# Configure command line arguments. +config_arg0='./Configure' +config_args='-der' +config_argc=1 +config_arg1='-der' +PERL_REVISION=5 +PERL_VERSION=10 +PERL_SUBVERSION=0 +PERL_API_REVISION=5 +PERL_API_VERSION=10 +PERL_API_SUBVERSION=0 +PERL_PATCHLEVEL= +PERL_CONFIG_SH=true +# Fix problem with HiRes timer. +d_nanosleep='define' +d_clock_gettime='define' +d_clock_getres='define' +d_clock_nanosleep='define' +d_clock='define' diff --git a/lang/perl/files/perlmod-deps.sh b/lang/perl/files/perlmod-deps.sh new file mode 100644 index 0000000..d144b4d --- /dev/null +++ b/lang/perl/files/perlmod-deps.sh @@ -0,0 +1,81 @@ +#!/bin/sh +# +# Generate perl module package dependencies +# +# Copyright (C) 2007 Peter Colberg +# Licensed under the terms of the GNU General Public License. +# + +if [ $# -lt 3 ]; then + echo >&2 "Usage: $(basename $0) STAGING-DIR PERL-BUILD-DIR [FILES...] [DIRECTORIES...]" + exit 1 +fi + +STAGING_DIR="$1" +PERL_BIN="$STAGING_DIR/usr/bin/perl" +PERL_LIB="$STAGING_DIR/usr/lib/perl5/5.10" +INC_DIR="$(dirname $0)" +shift + +"$PERL_BIN" -I"$INC_DIR" -I"$PERL_LIB" - "$@" <<'PERL_SCRIPT' +use strict; +use warnings; + +use Module::ScanDeps; +use File::Find; +use Cwd; + +our $sitelib = "/usr/lib/perl5/5.10"; + +sub scandeps { + my $builddir = Cwd::abs_path(shift); + my @scanpaths = @_; + my ($curdir, @pkgdirs, $dir, @deps, %depends, $file); + our ($pkg, %bundles, $path, @files); + + @pkgdirs = glob($builddir . "/*/ipkg"); + $curdir = getcwd(); + @INC = (); + for $dir (@pkgdirs) { + chdir($dir) or die "$dir: $!"; + for $pkg (glob("*")) { + chdir($dir . "/" . $pkg . $sitelib) or next; + push @INC, getcwd(); + sub wanted { + return unless (-f $_); + s/^\.\///; + $bundles{$_} = $pkg; + } + find({ wanted => \&wanted, no_chdir => 1 }, "."); + } + } + chdir($curdir) or die "$curdir: $!\n"; + + for $path (@scanpaths) { + sub scan_wanted { + return unless (-f $_ and /\.(pl|pm)$/); + push @files, $_; + } + if (-f $path) { + push @files, $path; + } + elsif (-d $path) { + find({ wanted => \&scan_wanted, no_chdir => 1 }, $path); + } + } + + @deps = keys %{scan_deps(files => \@files, recurse => 0)}; + for $file (grep { not exists $bundles{$_} } @deps) { + warn "could not resolve dependency: $file\n"; + } + %depends = map { $bundles{$_}, 1 } grep { exists $bundles{$_} } @deps; + + if (%depends) { + print join(' ', 'perl', sort keys %depends), "\n"; + } +} + +if (@ARGV > 1) { + scandeps(@ARGV); +} +PERL_SCRIPT diff --git a/lang/perl/files/scan-perlbase.sh b/lang/perl/files/scan-perlbase.sh new file mode 100644 index 0000000..d9fe80a --- /dev/null +++ b/lang/perl/files/scan-perlbase.sh @@ -0,0 +1,176 @@ +#!/bin/sh +# +# Generate perl base modules package definitions +# +# Copyright (C) 2007 Peter Colberg +# Licensed under the terms of the GNU General Public License. +# + +if [ $# -lt 1 ]; then + echo >&2 "Usage: $(basename $0) STAGING-DIR [OUTFILE]" + exit 1 +fi + +STAGING_DIR="$1" +PERL_BIN="$STAGING_DIR/usr/bin/perl" +PERL_LIB="$STAGING_DIR/usr/lib/perl5/5.10" +INC_DIR="$(dirname $0)" +shift + +"$PERL_BIN" -I"$INC_DIR" -I"$PERL_LIB" - "$PERL_LIB" "$@" <<'PERL_SCRIPT' +use strict; +use warnings; + +use Module::ScanDeps; +use File::Find; +use File::Basename; + +our $skipfiles = 'CORE vmsish.pm auto/sdbm'; + +our %defmodules = ( + 'essential' => 'lib.pm vars.pm strict.pm warnings.pm warnings Carp Carp.pm Exporter Exporter.pm locale.pm subs.pm overload.pm constant.pm', + 'getoptpl' => 'getopt.pl getopts.pl', + 'utf8' => 'utf8_heavy.pl', + 'Getopt' => 'newgetopt.pl', + 'open' => 'open2.pl open3.pl', + 'Config' => 'Config_heavy.pl', + 'bytes' => 'bytes_heavy.pl', +); + +our %defdepends = ( + 'DB_File' => 'libdb1-compat', + 'GDBM_File' => 'libgdbm', +); + +our $prefix = 'perlbase-'; + +sub template ($) { + $_ = $_[0]; + return < \&wanted, no_chdir => 1}, '.'); + + for $pkg (keys %modules) { + $packages{$pkg} = []; + $excludes{$pkg} = []; + $depends{$pkg} = {}; + } + + for $file (keys %files) { + $mod = $files{$file}; + $parent = $files{dirname($file)}; + + if (defined ($mod)) { + if (defined ($parent) and not ($parent eq $mod)) { + push @{$packages{$mod}}, $file; + push @{$excludes{$parent}}, $file; + } + elsif (not defined ($parent)) { + push @{$packages{$mod}}, $file; + } + } + elsif (defined ($parent)) { + push @{$excludes{$parent}}, $file; + } + } + + for $mod (keys %defdepends) { + ($pkg = $prefix . $mod) =~ tr/A-Z_/a-z-/; + for $dep (split / /, $defdepends{$mod}) { + ${$depends{$pkg}}{$dep} = 1; + } + } + + @INC = ('.'); + for $file (grep { -f $_ and defined $files{$_} } keys %files) { + @deps = keys %{scan_deps(files => [ $file ], recurse => 0)}; + $pkg = $files{$file}; + + for $dep (grep { not defined $files{$_} } @deps) { + warn "$file: could not resolve dependency: $dep\n"; + } + for $dep (grep { defined $files{$_} } @deps) { + next if ($files{$dep} eq $pkg); + ${$depends{$pkg}}{$files{$dep}} = 1; + } + } + + for $pkg (sort keys %packages) { + push @result, template({ + package => $pkg, + module => $modules{$pkg}, + depends => join(' ', 'perl', sort keys %{$depends{$pkg}}), + files => join(' ', sort @{$packages{$pkg}}), + exclude => join(' ', sort @{$excludes{$pkg}}), + }); + } + + return join('', @result); +} + + +if (@ARGV > 1) { + open FILE, ">$ARGV[1]" or die "$ARGV[1]: $!\n"; + print FILE scandeps($ARGV[0]); + close FILE; +} +else { + print scandeps($ARGV[0] or '.'); +} +PERL_SCRIPT diff --git a/lang/perl/files/strippm.sh b/lang/perl/files/strippm.sh new file mode 100644 index 0000000..b83d2b4 --- /dev/null +++ b/lang/perl/files/strippm.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# Attempt to strip comments and pod docs from perl modules +# + +[ "$#" -gt 0 ] || set . +echo "---> Stripping modules in: $@" >&2 +find "$@" -name \*.pm -or -name \*.pl -or -name \*.pod | while read fn; do + echo " $fn" >&2 + sed -i -e '/^=\(head\|pod\|item\|over\|back\)/,/^=cut/d; /^=\(head\|pod\|item\|over\|back\)/,$d; /^#$/d; /^#[^!"'"'"']/d' "$fn" +done diff --git a/lang/perl/patches/100-static_uudmap.patch b/lang/perl/patches/100-static_uudmap.patch new file mode 100644 index 0000000..e0821cc --- /dev/null +++ b/lang/perl/patches/100-static_uudmap.patch @@ -0,0 +1,49 @@ +--- /dev/null ++++ b/generate_uudmap +@@ -0,0 +1,7 @@ ++#!/bin/bash ++echo \{ ++for i in {0..31}; do echo -n ' 0,'; done ++echo ++for i in {0..63}; do echo -n " $i,"; done ++echo ++echo \} +--- a/Makefile.micro ++++ b/Makefile.micro +@@ -173,13 +173,8 @@ uperlapi$(_O): $(HE) perlapi.c perlapi.h + uxsutils$(_O): $(HE) xsutils.c + $(CC) $(CCFLAGS) -o $@ $(CFLAGS) xsutils.c + +-uudmap.h: generate_uudmap$(_X) +- $(RUN) ./generate_uudmap$(_X) >uudmap.h +- +-generate_uudmap$(_O): generate_uudmap.c +- $(CC) $(CCFLAGS) -o $@ $(CFLAGS) generate_uudmap.c +- +-generate_uudmap$(_X): generate_uudmap$(_O) +- $(LD) -o generate_uudmap $(LDFLAGS) generate_uudmap$(_O) $(LIBS) ++uudmap.h: ++ chmod a+x generate_uudmap ++ $(RUN) ./generate_uudmap >uudmap.h + + # That's it, folks! +--- a/Makefile.SH ++++ b/Makefile.SH +@@ -478,11 +478,13 @@ opmini\$(OBJ_EXT): opmini.c + + globals\$(OBJ_EXT): uudmap.h + +-uudmap.h: generate_uudmap\$(EXE_EXT) +- \$(RUN) ./generate_uudmap\$(EXE_EXT) >uudmap.h ++uudmap.h: generate_uudmap ++ chmod a+x generate_uudmap ++ \$(RUN) ./generate_uudmap >uudmap.h + +-generate_uudmap\$(EXE_EXT): generate_uudmap\$(OBJ_EXT) +- \$(CC) -o generate_uudmap \$(LDFLAGS) generate_uudmap\$(OBJ_EXT) \$(libs) ++generate_uudmap: ++ cp ../generate_uudmap . ++ touch generate_uudmap + + !GROK!THIS! + $spitshell >>Makefile <<'!NO!SUBS!' diff --git a/lang/perl/patches/101-fix-cross-compile-endianness-detection.patch b/lang/perl/patches/101-fix-cross-compile-endianness-detection.patch new file mode 100644 index 0000000..8fea9c0 --- /dev/null +++ b/lang/perl/patches/101-fix-cross-compile-endianness-detection.patch @@ -0,0 +1,22 @@ +--- a/config_h.SH ++++ b/config_h.SH +@@ -53,6 +53,19 @@ sed <$CONFIG_H -e 's!^#und + #ifndef _config_h_ + #define _config_h_ + ++#if defined(USE_CROSS_COMPILE) && !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) ++# include ++# if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN) ++# if (__BYTE_ORDER == __LITTLE_ENDIAN) ++# define __LITTLE_ENDIAN__ ++# elif (__BYTE_ORDER == __BIG_ENDIAN) ++# define __BIG_ENDIAN__ ++# else ++# error Unknown endianness ++# endif ++# endif ++#endif ++ + /* LOC_SED: + * This symbol holds the complete pathname to the sed program. + */ diff --git a/lang/perl/patches/200-host-libc-dir-moved-debian+derivatives.patch b/lang/perl/patches/200-host-libc-dir-moved-debian+derivatives.patch new file mode 100644 index 0000000..2a0dd6b --- /dev/null +++ b/lang/perl/patches/200-host-libc-dir-moved-debian+derivatives.patch @@ -0,0 +1,27 @@ +--- a/hints/linux.sh ++++ b/hints/linux.sh +@@ -133,6 +133,24 @@ case "$optimize" in + ;; + esac + ++# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries ++# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us ++# where to look. We don't want gcc's own libraries, however, so we ++# filter those out. ++# This could be conditional on Unbuntu, but other distributions may ++# follow suit, and this scheme seems to work even on rather old gcc's. ++# This unconditionally uses gcc because even if the user is using another ++# compiler, we still need to find the math library and friends, and I don't ++# know how other compilers will cope with that situation. ++# Still, as an escape hatch, allow Configure command line overrides to ++# plibpth to bypass this check. ++case "$plibpth" in ++'') plibpth=`gcc -print-search-dirs | grep libraries | ++ cut -f2- -d= | tr ':' $trnl | grep -v 'gcc'` ++ plibpth="$plibpth" # Collapse all entries on one line ++ ;; ++esac ++ + # Are we using ELF? Thanks to Kenneth Albanowski + # for this test. + cat >try.c <<'EOM' diff --git a/lang/perl/perlbase.mk b/lang/perl/perlbase.mk new file mode 100644 index 0000000..d1cad97 --- /dev/null +++ b/lang/perl/perlbase.mk @@ -0,0 +1,1640 @@ +define Package/perlbase-template +SUBMENU:=Perl +SECTION:=lang +CATEGORY:=Languages +URL:=http://www.cpan.org/ +DEPENDS:=perl +endef + +define Package/perlbase-abbrev +$(call Package/perlbase-template) +TITLE:=abbrev perl module +endef + +define Package/perlbase-abbrev/install +$(call perlmod/Install,$(1),abbrev.pl,) +endef + +$(eval $(call BuildPackage,perlbase-abbrev)) + + +define Package/perlbase-anydbm-file +$(call Package/perlbase-template) +TITLE:=AnyDBM_File perl module +endef + +define Package/perlbase-anydbm-file/install +$(call perlmod/Install,$(1),AnyDBM_File.pm,) +endef + +$(eval $(call BuildPackage,perlbase-anydbm-file)) + + +define Package/perlbase-archive +$(call Package/perlbase-template) +TITLE:=Archive perl module +endef + +define Package/perlbase-archive/install +$(call perlmod/Install,$(1),Archive,) +endef + +$(eval $(call BuildPackage,perlbase-archive)) + + +define Package/perlbase-assert +$(call Package/perlbase-template) +TITLE:=assert perl module +endef + +define Package/perlbase-assert/install +$(call perlmod/Install,$(1),assert.pl,) +endef + +$(eval $(call BuildPackage,perlbase-assert)) + + +define Package/perlbase-attribute +$(call Package/perlbase-template) +TITLE:=Attribute perl module +endef + +define Package/perlbase-attribute/install +$(call perlmod/Install,$(1),Attribute,) +endef + +$(eval $(call BuildPackage,perlbase-attribute)) + + +define Package/perlbase-attributes +$(call Package/perlbase-template) +TITLE:=attributes perl module +endef + +define Package/perlbase-attributes/install +$(call perlmod/Install,$(1),attributes.pm,) +endef + +$(eval $(call BuildPackage,perlbase-attributes)) + + +define Package/perlbase-attrs +$(call Package/perlbase-template) +TITLE:=attrs perl module +endef + +define Package/perlbase-attrs/install +$(call perlmod/Install,$(1),attrs.pm auto/attrs,) +endef + +$(eval $(call BuildPackage,perlbase-attrs)) + + +define Package/perlbase-autoloader +$(call Package/perlbase-template) +TITLE:=AutoLoader perl module +endef + +define Package/perlbase-autoloader/install +$(call perlmod/Install,$(1),AutoLoader.pm,) +endef + +$(eval $(call BuildPackage,perlbase-autoloader)) + + +define Package/perlbase-autosplit +$(call Package/perlbase-template) +TITLE:=AutoSplit perl module +endef + +define Package/perlbase-autosplit/install +$(call perlmod/Install,$(1),AutoSplit.pm,) +endef + +$(eval $(call BuildPackage,perlbase-autosplit)) + + +define Package/perlbase-autouse +$(call Package/perlbase-template) +TITLE:=autouse perl module +endef + +define Package/perlbase-autouse/install +$(call perlmod/Install,$(1),autouse.pm,) +endef + +$(eval $(call BuildPackage,perlbase-autouse)) + + +define Package/perlbase-b +$(call Package/perlbase-template) +TITLE:=B perl module +endef + +define Package/perlbase-b/install +$(call perlmod/Install,$(1),B B.pm auto/B,) +endef + +$(eval $(call BuildPackage,perlbase-b)) + + +define Package/perlbase-base +$(call Package/perlbase-template) +TITLE:=base perl module +endef + +define Package/perlbase-base/install +$(call perlmod/Install,$(1),base.pm,) +endef + +$(eval $(call BuildPackage,perlbase-base)) + + +define Package/perlbase-benchmark +$(call Package/perlbase-template) +TITLE:=Benchmark perl module +endef + +define Package/perlbase-benchmark/install +$(call perlmod/Install,$(1),Benchmark.pm,) +endef + +$(eval $(call BuildPackage,perlbase-benchmark)) + + +define Package/perlbase-bigfloat +$(call Package/perlbase-template) +TITLE:=bigfloat perl module +endef + +define Package/perlbase-bigfloat/install +$(call perlmod/Install,$(1),bigfloat.pl,) +endef + +$(eval $(call BuildPackage,perlbase-bigfloat)) + + +define Package/perlbase-bigint +$(call Package/perlbase-template) +TITLE:=bigint perl module +endef + +define Package/perlbase-bigint/install +$(call perlmod/Install,$(1),bigint.pl bigint.pm,) +endef + +$(eval $(call BuildPackage,perlbase-bigint)) + + +define Package/perlbase-bignum +$(call Package/perlbase-template) +TITLE:=bignum perl module +endef + +define Package/perlbase-bignum/install +$(call perlmod/Install,$(1),bignum.pm,) +endef + +$(eval $(call BuildPackage,perlbase-bignum)) + + +define Package/perlbase-bigrat +$(call Package/perlbase-template) +TITLE:=bigrat perl module +endef + +define Package/perlbase-bigrat/install +$(call perlmod/Install,$(1),bigrat.pl bigrat.pm,) +endef + +$(eval $(call BuildPackage,perlbase-bigrat)) + + +define Package/perlbase-blib +$(call Package/perlbase-template) +TITLE:=blib perl module +endef + +define Package/perlbase-blib/install +$(call perlmod/Install,$(1),blib.pm,) +endef + +$(eval $(call BuildPackage,perlbase-blib)) + + +define Package/perlbase-bytes +$(call Package/perlbase-template) +TITLE:=bytes perl module +endef + +define Package/perlbase-bytes/install +$(call perlmod/Install,$(1),bytes.pm bytes_heavy.pl,) +endef + +$(eval $(call BuildPackage,perlbase-bytes)) + + +define Package/perlbase-cacheout +$(call Package/perlbase-template) +TITLE:=cacheout perl module +endef + +define Package/perlbase-cacheout/install +$(call perlmod/Install,$(1),cacheout.pl,) +endef + +$(eval $(call BuildPackage,perlbase-cacheout)) + + +define Package/perlbase-cgi +$(call Package/perlbase-template) +TITLE:=CGI perl module +endef + +define Package/perlbase-cgi/install +$(call perlmod/Install,$(1),CGI CGI.pm,) +endef + +$(eval $(call BuildPackage,perlbase-cgi)) + + +define Package/perlbase-charnames +$(call Package/perlbase-template) +TITLE:=charnames perl module +endef + +define Package/perlbase-charnames/install +$(call perlmod/Install,$(1),charnames.pm,) +endef + +$(eval $(call BuildPackage,perlbase-charnames)) + + +define Package/perlbase-class +$(call Package/perlbase-template) +TITLE:=Class perl module +endef + +define Package/perlbase-class/install +$(call perlmod/Install,$(1),Class,) +endef + +$(eval $(call BuildPackage,perlbase-class)) + + +define Package/perlbase-complete +$(call Package/perlbase-template) +TITLE:=complete perl module +endef + +define Package/perlbase-complete/install +$(call perlmod/Install,$(1),complete.pl,) +endef + +$(eval $(call BuildPackage,perlbase-complete)) + + +define Package/perlbase-compress +$(call Package/perlbase-template) +TITLE:=Compress perl module +endef + +define Package/perlbase-compress/install +$(call perlmod/Install,$(1),Compress auto/Compress,) +endef + +$(eval $(call BuildPackage,perlbase-compress)) + + +define Package/perlbase-config +$(call Package/perlbase-template) +TITLE:=Config perl module +endef + +define Package/perlbase-config/install +$(call perlmod/Install,$(1),Config Config.pm Config_heavy.pl,) +endef + +$(eval $(call BuildPackage,perlbase-config)) + + +define Package/perlbase-cpan +$(call Package/perlbase-template) +TITLE:=CPAN perl module +endef + +define Package/perlbase-cpan/install +$(call perlmod/Install,$(1),CPAN CPAN.pm,) +endef + +$(eval $(call BuildPackage,perlbase-cpan)) + + +define Package/perlbase-cpanplus +$(call Package/perlbase-template) +TITLE:=CPANPLUS perl module +endef + +define Package/perlbase-cpanplus/install +$(call perlmod/Install,$(1),CPANPLUS CPANPLUS.pm,CPANPLUS/FAQ.pod CPANPLUS/Hacking.pod CPANPLUS/Shell/Default/Plugins/HOWTO.pod) +endef + +$(eval $(call BuildPackage,perlbase-cpanplus)) + + +define Package/perlbase-ctime +$(call Package/perlbase-template) +TITLE:=ctime perl module +endef + +define Package/perlbase-ctime/install +$(call perlmod/Install,$(1),ctime.pl,) +endef + +$(eval $(call BuildPackage,perlbase-ctime)) + + +define Package/perlbase-cwd +$(call Package/perlbase-template) +TITLE:=Cwd perl module +endef + +define Package/perlbase-cwd/install +$(call perlmod/Install,$(1),Cwd.pm auto/Cwd,) +endef + +$(eval $(call BuildPackage,perlbase-cwd)) + + +define Package/perlbase-data +$(call Package/perlbase-template) +TITLE:=Data perl module +endef + +define Package/perlbase-data/install +$(call perlmod/Install,$(1),Data auto/Data,) +endef + +$(eval $(call BuildPackage,perlbase-data)) + + +define Package/perlbase-db +$(call Package/perlbase-template) +TITLE:=DB perl module +DEPENDS+= +libdb47 +endef + +define Package/perlbase-db/install +$(call perlmod/Install,$(1),DB.pm,) +endef + +$(eval $(call BuildPackage,perlbase-db)) + + +define Package/perlbase-db-file +$(call Package/perlbase-template) +TITLE:=DB_File perl module +DEPENDS+= +libdb47 +endef + +define Package/perlbase-db-file/install +$(call perlmod/Install,$(1),DB_File.pm auto/DB_File,) +endef + +$(eval $(call BuildPackage,perlbase-db-file)) + + +define Package/perlbase-dbm-filter +$(call Package/perlbase-template) +TITLE:=DBM_Filter perl module +endef + +define Package/perlbase-dbm-filter/install +$(call perlmod/Install,$(1),DBM_Filter DBM_Filter.pm,) +endef + +$(eval $(call BuildPackage,perlbase-dbm-filter)) + + +define Package/perlbase-devel +$(call Package/perlbase-template) +TITLE:=Devel perl module +endef + +define Package/perlbase-devel/install +$(call perlmod/Install,$(1),Devel auto/Devel,) +endef + +$(eval $(call BuildPackage,perlbase-devel)) + + +define Package/perlbase-diagnostics +$(call Package/perlbase-template) +TITLE:=diagnostics perl module +endef + +define Package/perlbase-diagnostics/install +$(call perlmod/Install,$(1),diagnostics.pm,) +endef + +$(eval $(call BuildPackage,perlbase-diagnostics)) + + +define Package/perlbase-digest +$(call Package/perlbase-template) +TITLE:=Digest perl module +endef + +define Package/perlbase-digest/install +$(call perlmod/Install,$(1),Digest Digest.pm auto/Digest,) +endef + +$(eval $(call BuildPackage,perlbase-digest)) + + +define Package/perlbase-dirhandle +$(call Package/perlbase-template) +TITLE:=DirHandle perl module +endef + +define Package/perlbase-dirhandle/install +$(call perlmod/Install,$(1),DirHandle.pm,) +endef + +$(eval $(call BuildPackage,perlbase-dirhandle)) + + +define Package/perlbase-dotsh +$(call Package/perlbase-template) +TITLE:=dotsh perl module +endef + +define Package/perlbase-dotsh/install +$(call perlmod/Install,$(1),dotsh.pl,) +endef + +$(eval $(call BuildPackage,perlbase-dotsh)) + + +define Package/perlbase-dumpvalue +$(call Package/perlbase-template) +TITLE:=Dumpvalue perl module +endef + +define Package/perlbase-dumpvalue/install +$(call perlmod/Install,$(1),Dumpvalue.pm,) +endef + +$(eval $(call BuildPackage,perlbase-dumpvalue)) + + +define Package/perlbase-dumpvar +$(call Package/perlbase-template) +TITLE:=dumpvar perl module +endef + +define Package/perlbase-dumpvar/install +$(call perlmod/Install,$(1),dumpvar.pl,) +endef + +$(eval $(call BuildPackage,perlbase-dumpvar)) + + +define Package/perlbase-dynaloader +$(call Package/perlbase-template) +TITLE:=DynaLoader perl module +endef + +define Package/perlbase-dynaloader/install +$(call perlmod/Install,$(1),DynaLoader.pm auto/DynaLoader,) +endef + +$(eval $(call BuildPackage,perlbase-dynaloader)) + + +define Package/perlbase-encode +$(call Package/perlbase-template) +TITLE:=Encode perl module +endef + +define Package/perlbase-encode/install +$(call perlmod/Install,$(1),Encode Encode.pm auto/Encode,Encode/PerlIO.pod Encode/Supported.pod) +endef + +$(eval $(call BuildPackage,perlbase-encode)) + + +define Package/perlbase-encoding +$(call Package/perlbase-template) +TITLE:=encoding perl module +endef + +define Package/perlbase-encoding/install +$(call perlmod/Install,$(1),encoding encoding.pm,) +endef + +$(eval $(call BuildPackage,perlbase-encoding)) + + +define Package/perlbase-english +$(call Package/perlbase-template) +TITLE:=English perl module +endef + +define Package/perlbase-english/install +$(call perlmod/Install,$(1),English.pm,) +endef + +$(eval $(call BuildPackage,perlbase-english)) + + +define Package/perlbase-env +$(call Package/perlbase-template) +TITLE:=Env perl module +endef + +define Package/perlbase-env/install +$(call perlmod/Install,$(1),Env.pm,) +endef + +$(eval $(call BuildPackage,perlbase-env)) + + +define Package/perlbase-errno +$(call Package/perlbase-template) +TITLE:=Errno perl module +endef + +define Package/perlbase-errno/install +$(call perlmod/Install,$(1),Errno.pm,) +endef + +$(eval $(call BuildPackage,perlbase-errno)) + + +define Package/perlbase-essential +$(call Package/perlbase-template) +TITLE:=essential perl module +endef + +define Package/perlbase-essential/install +$(call perlmod/Install,$(1),Carp Carp.pm Exporter Exporter.pm constant.pm lib.pm locale.pm overload.pm strict.pm subs.pm vars.pm warnings warnings.pm,) +endef + +$(eval $(call BuildPackage,perlbase-essential)) + + +define Package/perlbase-exceptions +$(call Package/perlbase-template) +TITLE:=exceptions perl module +endef + +define Package/perlbase-exceptions/install +$(call perlmod/Install,$(1),exceptions.pl,) +endef + +$(eval $(call BuildPackage,perlbase-exceptions)) + + +define Package/perlbase-extutils +$(call Package/perlbase-template) +TITLE:=ExtUtils perl module +endef + +define Package/perlbase-extutils/install +$(call perlmod/Install,$(1),ExtUtils,ExtUtils/MakeMaker/FAQ.pod ExtUtils/MakeMaker/Tutorial.pod) +endef + +$(eval $(call BuildPackage,perlbase-extutils)) + + +define Package/perlbase-fastcwd +$(call Package/perlbase-template) +TITLE:=fastcwd perl module +endef + +define Package/perlbase-fastcwd/install +$(call perlmod/Install,$(1),fastcwd.pl,) +endef + +$(eval $(call BuildPackage,perlbase-fastcwd)) + + +define Package/perlbase-fatal +$(call Package/perlbase-template) +TITLE:=Fatal perl module +endef + +define Package/perlbase-fatal/install +$(call perlmod/Install,$(1),Fatal.pm,) +endef + +$(eval $(call BuildPackage,perlbase-fatal)) + + +define Package/perlbase-fcntl +$(call Package/perlbase-template) +TITLE:=Fcntl perl module +endef + +define Package/perlbase-fcntl/install +$(call perlmod/Install,$(1),Fcntl.pm auto/Fcntl,) +endef + +$(eval $(call BuildPackage,perlbase-fcntl)) + + +define Package/perlbase-feature +$(call Package/perlbase-template) +TITLE:=feature perl module +endef + +define Package/perlbase-feature/install +$(call perlmod/Install,$(1),feature.pm,) +endef + +$(eval $(call BuildPackage,perlbase-feature)) + + +define Package/perlbase-fields +$(call Package/perlbase-template) +TITLE:=fields perl module +endef + +define Package/perlbase-fields/install +$(call perlmod/Install,$(1),fields.pm,) +endef + +$(eval $(call BuildPackage,perlbase-fields)) + + +define Package/perlbase-file +$(call Package/perlbase-template) +TITLE:=File perl module +endef + +define Package/perlbase-file/install +$(call perlmod/Install,$(1),File auto/File,) +endef + +$(eval $(call BuildPackage,perlbase-file)) + + +define Package/perlbase-filecache +$(call Package/perlbase-template) +TITLE:=FileCache perl module +endef + +define Package/perlbase-filecache/install +$(call perlmod/Install,$(1),FileCache.pm,) +endef + +$(eval $(call BuildPackage,perlbase-filecache)) + + +define Package/perlbase-filehandle +$(call Package/perlbase-template) +TITLE:=FileHandle perl module +endef + +define Package/perlbase-filehandle/install +$(call perlmod/Install,$(1),FileHandle.pm,) +endef + +$(eval $(call BuildPackage,perlbase-filehandle)) + + +define Package/perlbase-filetest +$(call Package/perlbase-template) +TITLE:=filetest perl module +endef + +define Package/perlbase-filetest/install +$(call perlmod/Install,$(1),filetest.pm,) +endef + +$(eval $(call BuildPackage,perlbase-filetest)) + + +define Package/perlbase-filter +$(call Package/perlbase-template) +TITLE:=Filter perl module +endef + +define Package/perlbase-filter/install +$(call perlmod/Install,$(1),Filter auto/Filter,) +endef + +$(eval $(call BuildPackage,perlbase-filter)) + + +define Package/perlbase-find +$(call Package/perlbase-template) +TITLE:=find perl module +endef + +define Package/perlbase-find/install +$(call perlmod/Install,$(1),find.pl,) +endef + +$(eval $(call BuildPackage,perlbase-find)) + + +define Package/perlbase-findbin +$(call Package/perlbase-template) +TITLE:=FindBin perl module +endef + +define Package/perlbase-findbin/install +$(call perlmod/Install,$(1),FindBin.pm,) +endef + +$(eval $(call BuildPackage,perlbase-findbin)) + + +define Package/perlbase-finddepth +$(call Package/perlbase-template) +TITLE:=finddepth perl module +endef + +define Package/perlbase-finddepth/install +$(call perlmod/Install,$(1),finddepth.pl,) +endef + +$(eval $(call BuildPackage,perlbase-finddepth)) + + +define Package/perlbase-flush +$(call Package/perlbase-template) +TITLE:=flush perl module +endef + +define Package/perlbase-flush/install +$(call perlmod/Install,$(1),flush.pl,) +endef + +$(eval $(call BuildPackage,perlbase-flush)) + + +define Package/perlbase-gdbm-file +$(call Package/perlbase-template) +TITLE:=GDBM_File perl module +DEPENDS+= +libgdbm +endef + +define Package/perlbase-gdbm-file/install +$(call perlmod/Install,$(1),GDBM_File.pm auto/GDBM_File,) +endef + +$(eval $(call BuildPackage,perlbase-gdbm-file)) + + +define Package/perlbase-getcwd +$(call Package/perlbase-template) +TITLE:=getcwd perl module +endef + +define Package/perlbase-getcwd/install +$(call perlmod/Install,$(1),getcwd.pl,) +endef + +$(eval $(call BuildPackage,perlbase-getcwd)) + + +define Package/perlbase-getopt +$(call Package/perlbase-template) +TITLE:=Getopt perl module +endef + +define Package/perlbase-getopt/install +$(call perlmod/Install,$(1),Getopt newgetopt.pl,) +endef + +$(eval $(call BuildPackage,perlbase-getopt)) + + +define Package/perlbase-getoptpl +$(call Package/perlbase-template) +TITLE:=getoptpl perl module +endef + +define Package/perlbase-getoptpl/install +$(call perlmod/Install,$(1),getopt.pl getopts.pl,) +endef + +$(eval $(call BuildPackage,perlbase-getoptpl)) + + +define Package/perlbase-hash +$(call Package/perlbase-template) +TITLE:=Hash perl module +endef + +define Package/perlbase-hash/install +$(call perlmod/Install,$(1),Hash auto/Hash,) +endef + +$(eval $(call BuildPackage,perlbase-hash)) + + +define Package/perlbase-hostname +$(call Package/perlbase-template) +TITLE:=hostname perl module +endef + +define Package/perlbase-hostname/install +$(call perlmod/Install,$(1),hostname.pl,) +endef + +$(eval $(call BuildPackage,perlbase-hostname)) + + +define Package/perlbase-i18n +$(call Package/perlbase-template) +TITLE:=I18N perl module +endef + +define Package/perlbase-i18n/install +$(call perlmod/Install,$(1),I18N auto/I18N,) +endef + +$(eval $(call BuildPackage,perlbase-i18n)) + + +define Package/perlbase-if +$(call Package/perlbase-template) +TITLE:=if perl module +endef + +define Package/perlbase-if/install +$(call perlmod/Install,$(1),if.pm,) +endef + +$(eval $(call BuildPackage,perlbase-if)) + + +define Package/perlbase-importenv +$(call Package/perlbase-template) +TITLE:=importenv perl module +endef + +define Package/perlbase-importenv/install +$(call perlmod/Install,$(1),importenv.pl,) +endef + +$(eval $(call BuildPackage,perlbase-importenv)) + + +define Package/perlbase-integer +$(call Package/perlbase-template) +TITLE:=integer perl module +endef + +define Package/perlbase-integer/install +$(call perlmod/Install,$(1),integer.pm,) +endef + +$(eval $(call BuildPackage,perlbase-integer)) + + +define Package/perlbase-io +$(call Package/perlbase-template) +TITLE:=IO perl module +endef + +define Package/perlbase-io/install +$(call perlmod/Install,$(1),IO IO.pm auto/IO,) +endef + +$(eval $(call BuildPackage,perlbase-io)) + + +define Package/perlbase-ipc +$(call Package/perlbase-template) +TITLE:=IPC perl module +endef + +define Package/perlbase-ipc/install +$(call perlmod/Install,$(1),IPC auto/IPC,) +endef + +$(eval $(call BuildPackage,perlbase-ipc)) + + +define Package/perlbase-less +$(call Package/perlbase-template) +TITLE:=less perl module +endef + +define Package/perlbase-less/install +$(call perlmod/Install,$(1),less.pm,) +endef + +$(eval $(call BuildPackage,perlbase-less)) + + +define Package/perlbase-list +$(call Package/perlbase-template) +TITLE:=List perl module +endef + +define Package/perlbase-list/install +$(call perlmod/Install,$(1),List auto/List,) +endef + +$(eval $(call BuildPackage,perlbase-list)) + + +define Package/perlbase-locale +$(call Package/perlbase-template) +TITLE:=Locale perl module +endef + +define Package/perlbase-locale/install +$(call perlmod/Install,$(1),Locale,Locale/Constants.pod Locale/Country.pod Locale/Currency.pod Locale/Language.pod Locale/Maketext.pod Locale/Maketext/TPJ13.pod Locale/Script.pod) +endef + +$(eval $(call BuildPackage,perlbase-locale)) + + +define Package/perlbase-log +$(call Package/perlbase-template) +TITLE:=Log perl module +endef + +define Package/perlbase-log/install +$(call perlmod/Install,$(1),Log,) +endef + +$(eval $(call BuildPackage,perlbase-log)) + + +define Package/perlbase-look +$(call Package/perlbase-template) +TITLE:=look perl module +endef + +define Package/perlbase-look/install +$(call perlmod/Install,$(1),look.pl,) +endef + +$(eval $(call BuildPackage,perlbase-look)) + + +define Package/perlbase-math +$(call Package/perlbase-template) +TITLE:=Math perl module +endef + +define Package/perlbase-math/install +$(call perlmod/Install,$(1),Math auto/Math,) +endef + +$(eval $(call BuildPackage,perlbase-math)) + + +define Package/perlbase-memoize +$(call Package/perlbase-template) +TITLE:=Memoize perl module +endef + +define Package/perlbase-memoize/install +$(call perlmod/Install,$(1),Memoize Memoize.pm,) +endef + +$(eval $(call BuildPackage,perlbase-memoize)) + + +define Package/perlbase-mime +$(call Package/perlbase-template) +TITLE:=MIME perl module +endef + +define Package/perlbase-mime/install +$(call perlmod/Install,$(1),MIME auto/MIME,) +endef + +$(eval $(call BuildPackage,perlbase-mime)) + + +define Package/perlbase-module +$(call Package/perlbase-template) +TITLE:=Module perl module +endef + +define Package/perlbase-module/install +$(call perlmod/Install,$(1),Module,Module/Build/API.pod Module/Build/Authoring.pod) +endef + +$(eval $(call BuildPackage,perlbase-module)) + + +define Package/perlbase-mro +$(call Package/perlbase-template) +TITLE:=mro perl module +endef + +define Package/perlbase-mro/install +$(call perlmod/Install,$(1),mro.pm,) +endef + +$(eval $(call BuildPackage,perlbase-mro)) + + +define Package/perlbase-net +$(call Package/perlbase-template) +TITLE:=Net perl module +endef + +define Package/perlbase-net/install +$(call perlmod/Install,$(1),Net,Net/libnetFAQ.pod) +endef + +$(eval $(call BuildPackage,perlbase-net)) + + +define Package/perlbase-next +$(call Package/perlbase-template) +TITLE:=NEXT perl module +endef + +define Package/perlbase-next/install +$(call perlmod/Install,$(1),NEXT.pm,) +endef + +$(eval $(call BuildPackage,perlbase-next)) + + +define Package/perlbase-o +$(call Package/perlbase-template) +TITLE:=O perl module +endef + +define Package/perlbase-o/install +$(call perlmod/Install,$(1),O.pm,) +endef + +$(eval $(call BuildPackage,perlbase-o)) + + +define Package/perlbase-object +$(call Package/perlbase-template) +TITLE:=Object perl module +endef + +define Package/perlbase-object/install +$(call perlmod/Install,$(1),Object,) +endef + +$(eval $(call BuildPackage,perlbase-object)) + + +define Package/perlbase-opcode +$(call Package/perlbase-template) +TITLE:=Opcode perl module +endef + +define Package/perlbase-opcode/install +$(call perlmod/Install,$(1),Opcode.pm auto/Opcode,) +endef + +$(eval $(call BuildPackage,perlbase-opcode)) + + +define Package/perlbase-open +$(call Package/perlbase-template) +TITLE:=open perl module +endef + +define Package/perlbase-open/install +$(call perlmod/Install,$(1),open.pm open2.pl open3.pl,) +endef + +$(eval $(call BuildPackage,perlbase-open)) + + +define Package/perlbase-ops +$(call Package/perlbase-template) +TITLE:=ops perl module +endef + +define Package/perlbase-ops/install +$(call perlmod/Install,$(1),ops.pm,) +endef + +$(eval $(call BuildPackage,perlbase-ops)) + + +define Package/perlbase-package +$(call Package/perlbase-template) +TITLE:=Package perl module +endef + +define Package/perlbase-package/install +$(call perlmod/Install,$(1),Package,) +endef + +$(eval $(call BuildPackage,perlbase-package)) + + +define Package/perlbase-params +$(call Package/perlbase-template) +TITLE:=Params perl module +endef + +define Package/perlbase-params/install +$(call perlmod/Install,$(1),Params,) +endef + +$(eval $(call BuildPackage,perlbase-params)) + + +define Package/perlbase-perl5db +$(call Package/perlbase-template) +TITLE:=perl5db perl module +endef + +define Package/perlbase-perl5db/install +$(call perlmod/Install,$(1),perl5db.pl,) +endef + +$(eval $(call BuildPackage,perlbase-perl5db)) + + +define Package/perlbase-perlio +$(call Package/perlbase-template) +TITLE:=PerlIO perl module +endef + +define Package/perlbase-perlio/install +$(call perlmod/Install,$(1),PerlIO PerlIO.pm auto/PerlIO,) +endef + +$(eval $(call BuildPackage,perlbase-perlio)) + +define Package/perlbase-pod +$(call Package/perlbase-template) +TITLE:=Pod perl module +endef + +define Package/perlbase-pod/install +$(call perlmod/Install,$(1),Pod,) +endef + +$(eval $(call BuildPackage,perlbase-pod)) + + +define Package/perlbase-posix +$(call Package/perlbase-template) +TITLE:=POSIX perl module +endef + +define Package/perlbase-posix/install +$(call perlmod/Install,$(1),POSIX.pm auto/POSIX,) +endef + +$(eval $(call BuildPackage,perlbase-posix)) + + +define Package/perlbase-pwd +$(call Package/perlbase-template) +TITLE:=pwd perl module +endef + +define Package/perlbase-pwd/install +$(call perlmod/Install,$(1),pwd.pl,) +endef + +$(eval $(call BuildPackage,perlbase-pwd)) + + +define Package/perlbase-re +$(call Package/perlbase-template) +TITLE:=re perl module +endef + +define Package/perlbase-re/install +$(call perlmod/Install,$(1),auto/re re.pm,) +endef + +$(eval $(call BuildPackage,perlbase-re)) + + +define Package/perlbase-safe +$(call Package/perlbase-template) +TITLE:=Safe perl module +endef + +define Package/perlbase-safe/install +$(call perlmod/Install,$(1),Safe.pm,) +endef + +$(eval $(call BuildPackage,perlbase-safe)) + + +define Package/perlbase-scalar +$(call Package/perlbase-template) +TITLE:=Scalar perl module +endef + +define Package/perlbase-scalar/install +$(call perlmod/Install,$(1),Scalar,) +endef + +$(eval $(call BuildPackage,perlbase-scalar)) + + +define Package/perlbase-sdbm-file +$(call Package/perlbase-template) +TITLE:=SDBM_File perl module +endef + +define Package/perlbase-sdbm-file/install +$(call perlmod/Install,$(1),SDBM_File.pm auto/SDBM_File,) +endef + +$(eval $(call BuildPackage,perlbase-sdbm-file)) + + +define Package/perlbase-search +$(call Package/perlbase-template) +TITLE:=Search perl module +endef + +define Package/perlbase-search/install +$(call perlmod/Install,$(1),Search,) +endef + +$(eval $(call BuildPackage,perlbase-search)) + + +define Package/perlbase-selectsaver +$(call Package/perlbase-template) +TITLE:=SelectSaver perl module +endef + +define Package/perlbase-selectsaver/install +$(call perlmod/Install,$(1),SelectSaver.pm,) +endef + +$(eval $(call BuildPackage,perlbase-selectsaver)) + + +define Package/perlbase-selfloader +$(call Package/perlbase-template) +TITLE:=SelfLoader perl module +endef + +define Package/perlbase-selfloader/install +$(call perlmod/Install,$(1),SelfLoader.pm,) +endef + +$(eval $(call BuildPackage,perlbase-selfloader)) + + +define Package/perlbase-shell +$(call Package/perlbase-template) +TITLE:=Shell perl module +endef + +define Package/perlbase-shell/install +$(call perlmod/Install,$(1),Shell.pm,) +endef + +$(eval $(call BuildPackage,perlbase-shell)) + + +define Package/perlbase-shellwords +$(call Package/perlbase-template) +TITLE:=shellwords perl module +endef + +define Package/perlbase-shellwords/install +$(call perlmod/Install,$(1),shellwords.pl,) +endef + +$(eval $(call BuildPackage,perlbase-shellwords)) + + +define Package/perlbase-sigtrap +$(call Package/perlbase-template) +TITLE:=sigtrap perl module +endef + +define Package/perlbase-sigtrap/install +$(call perlmod/Install,$(1),sigtrap.pm,) +endef + +$(eval $(call BuildPackage,perlbase-sigtrap)) + + +define Package/perlbase-socket +$(call Package/perlbase-template) +TITLE:=Socket perl module +endef + +define Package/perlbase-socket/install +$(call perlmod/Install,$(1),Socket.pm auto/Socket,) +endef + +$(eval $(call BuildPackage,perlbase-socket)) + + +define Package/perlbase-sort +$(call Package/perlbase-template) +TITLE:=sort perl module +endef + +define Package/perlbase-sort/install +$(call perlmod/Install,$(1),sort.pm,) +endef + +$(eval $(call BuildPackage,perlbase-sort)) + + +define Package/perlbase-stat +$(call Package/perlbase-template) +TITLE:=stat perl module +endef + +define Package/perlbase-stat/install +$(call perlmod/Install,$(1),stat.pl,) +endef + +$(eval $(call BuildPackage,perlbase-stat)) + + +define Package/perlbase-storable +$(call Package/perlbase-template) +TITLE:=Storable perl module +endef + +define Package/perlbase-storable/install +$(call perlmod/Install,$(1),Storable.pm auto/Storable,) +endef + +$(eval $(call BuildPackage,perlbase-storable)) + + +define Package/perlbase-switch +$(call Package/perlbase-template) +TITLE:=Switch perl module +endef + +define Package/perlbase-switch/install +$(call perlmod/Install,$(1),Switch.pm,) +endef + +$(eval $(call BuildPackage,perlbase-switch)) + + +define Package/perlbase-symbol +$(call Package/perlbase-template) +TITLE:=Symbol perl module +endef + +define Package/perlbase-symbol/install +$(call perlmod/Install,$(1),Symbol.pm,) +endef + +$(eval $(call BuildPackage,perlbase-symbol)) + + +define Package/perlbase-sys +$(call Package/perlbase-template) +TITLE:=Sys perl module +endef + +define Package/perlbase-sys/install +$(call perlmod/Install,$(1),Sys auto/Sys,) +endef + +$(eval $(call BuildPackage,perlbase-sys)) + + +define Package/perlbase-syslog +$(call Package/perlbase-template) +TITLE:=syslog perl module +endef + +define Package/perlbase-syslog/install +$(call perlmod/Install,$(1),syslog.pl,) +endef + +$(eval $(call BuildPackage,perlbase-syslog)) + + +define Package/perlbase-tainted +$(call Package/perlbase-template) +TITLE:=tainted perl module +endef + +define Package/perlbase-tainted/install +$(call perlmod/Install,$(1),tainted.pl,) +endef + +$(eval $(call BuildPackage,perlbase-tainted)) + + +define Package/perlbase-term +$(call Package/perlbase-template) +TITLE:=Term perl module +endef + +define Package/perlbase-term/install +$(call perlmod/Install,$(1),Term,) +endef + +$(eval $(call BuildPackage,perlbase-term)) + + +define Package/perlbase-termcap +$(call Package/perlbase-template) +TITLE:=termcap perl module +endef + +define Package/perlbase-termcap/install +$(call perlmod/Install,$(1),termcap.pl,) +endef + +$(eval $(call BuildPackage,perlbase-termcap)) + + +define Package/perlbase-test +$(call Package/perlbase-template) +TITLE:=Test perl module +endef + +define Package/perlbase-test/install +$(call perlmod/Install,$(1),Test Test.pm,Test/Harness/TAP.pod Test/Tutorial.pod) +endef + +$(eval $(call BuildPackage,perlbase-test)) + + +define Package/perlbase-text +$(call Package/perlbase-template) +TITLE:=Text perl module +endef + +define Package/perlbase-text/install +$(call perlmod/Install,$(1),Text auto/Text,) +endef + +$(eval $(call BuildPackage,perlbase-text)) + + +define Package/perlbase-thread +$(call Package/perlbase-template) +TITLE:=Thread perl module +endef + +define Package/perlbase-thread/install +$(call perlmod/Install,$(1),Thread Thread.pm,) +endef + +$(eval $(call BuildPackage,perlbase-thread)) + + +define Package/perlbase-threads +$(call Package/perlbase-template) +TITLE:=threads perl module +endef + +define Package/perlbase-threads/install +$(call perlmod/Install,$(1),auto/threads threads threads.pm,) +endef + +$(eval $(call BuildPackage,perlbase-threads)) + + +define Package/perlbase-tie +$(call Package/perlbase-template) +TITLE:=Tie perl module +endef + +define Package/perlbase-tie/install +$(call perlmod/Install,$(1),Tie,) +endef + +$(eval $(call BuildPackage,perlbase-tie)) + + +define Package/perlbase-time +$(call Package/perlbase-template) +TITLE:=Time perl module +endef + +define Package/perlbase-time/install +$(call perlmod/Install,$(1),Time auto/Time,) +endef + +$(eval $(call BuildPackage,perlbase-time)) + + +define Package/perlbase-timelocal +$(call Package/perlbase-template) +TITLE:=timelocal perl module +endef + +define Package/perlbase-timelocal/install +$(call perlmod/Install,$(1),timelocal.pl,) +endef + +$(eval $(call BuildPackage,perlbase-timelocal)) + + +define Package/perlbase-unicode +$(call Package/perlbase-template) +TITLE:=Unicode perl module +endef + +define Package/perlbase-unicode/install +$(call perlmod/Install,$(1),Unicode auto/Unicode,) +endef + +$(eval $(call BuildPackage,perlbase-unicode)) + + +define Package/perlbase-unicore +$(call Package/perlbase-template) +TITLE:=unicore perl module +endef + +define Package/perlbase-unicore/install +$(call perlmod/Install,$(1),unicore,) +endef + +$(eval $(call BuildPackage,perlbase-unicore)) + + +define Package/perlbase-universal +$(call Package/perlbase-template) +TITLE:=UNIVERSAL perl module +endef + +define Package/perlbase-universal/install +$(call perlmod/Install,$(1),UNIVERSAL.pm,) +endef + +$(eval $(call BuildPackage,perlbase-universal)) + + +define Package/perlbase-user +$(call Package/perlbase-template) +TITLE:=User perl module +endef + +define Package/perlbase-user/install +$(call perlmod/Install,$(1),User,) +endef + +$(eval $(call BuildPackage,perlbase-user)) + + +define Package/perlbase-utf8 +$(call Package/perlbase-template) +TITLE:=utf8 perl module +endef + +define Package/perlbase-utf8/install +$(call perlmod/Install,$(1),utf8.pm utf8_heavy.pl,) +endef + +$(eval $(call BuildPackage,perlbase-utf8)) + + +define Package/perlbase-validate +$(call Package/perlbase-template) +TITLE:=validate perl module +endef + +define Package/perlbase-validate/install +$(call perlmod/Install,$(1),validate.pl,) +endef + +$(eval $(call BuildPackage,perlbase-validate)) + + +define Package/perlbase-version +$(call Package/perlbase-template) +TITLE:=version perl module +endef + +define Package/perlbase-version/install +$(call perlmod/Install,$(1),version.pm,) +endef + +$(eval $(call BuildPackage,perlbase-version)) + + +define Package/perlbase-xsloader +$(call Package/perlbase-template) +TITLE:=XSLoader perl module +endef + +define Package/perlbase-xsloader/install +$(call perlmod/Install,$(1),XSLoader.pm,) +endef + +$(eval $(call BuildPackage,perlbase-xsloader)) diff --git a/lang/perl/perlmod.mk b/lang/perl/perlmod.mk new file mode 100644 index 0000000..157b0f3 --- /dev/null +++ b/lang/perl/perlmod.mk @@ -0,0 +1,53 @@ +# This makefile simplifies perl module builds. +# + +# Build environment +PERL_CMD := $(STAGING_DIR)/usr/bin/perl +PERL_LIB := $(STAGING_DIR)/usr/lib/perl5/5.10 + +# Module install prefix +PERL_SITELIB := /usr/lib/perl5/5.10 + +define perlmod/Configure + (cd $(PKG_BUILD_DIR); \ + PERL5LIB=$(PERL_LIB) \ + PERL_MM_USE_DEFAULT=1 \ + $(2) \ + $(PERL_CMD) Makefile.PL \ + $(1) \ + PERL_LIB=$(PERL_LIB) \ + PERL_ARCHLIB=$(PERL_LIB) \ + INSTALLSITELIB=$(PERL_SITELIB) \ + INSTALLSITEARCH=$(PERL_SITELIB) \ + DESTDIR=$(PKG_INSTALL_DIR) \ + ); +endef + +define perlmod/Compile + PERL5LIB=$(PERL_LIB) \ + $(2) \ + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(1) \ + install +endef + +define perlmod/Install + $(INSTALL_DIR) $(strip $(1))$(PERL_SITELIB) + (cd $(PKG_INSTALL_DIR)$(PERL_SITELIB) && \ + rsync --relative -rlHp --itemize-changes \ + --exclude=\*.pod \ + --exclude=.packlist \ + $(addprefix --exclude=/,$(strip $(3))) \ + --prune-empty-dirs \ + $(strip $(2)) $(strip $(1))$(PERL_SITELIB)) + + chmod -R u+w $(strip $(1))$(PERL_SITELIB) + + @echo "---> Stripping modules in: $(strip $(1))$(PERL_SITELIB)" + find $(strip $(1))$(PERL_SITELIB) -name \*.pm -or -name \*.pl | \ + xargs -r sed -i \ + -e '/^=\(head\|pod\|item\|over\|back\)/,/^=cut/d' \ + -e '/^=\(head\|pod\|item\|over\|back\)/,$$$$d' \ + -e '/^#$$$$/d' \ + -e '/^#[^!"'"'"']/d' +endef diff --git a/lang/php-pear-db/Makefile b/lang/php-pear-db/Makefile new file mode 100644 index 0000000..e135d09 --- /dev/null +++ b/lang/php-pear-db/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=php-pear-db +PKG_VERSION:=1.7.11 +PKG_RELEASE:=1 + +PKG_SOURCE:=DB-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://download.pear.php.net/package +PKG_MD5SUM:=a57302138757500706e075a4d3d87ef7 + +PKG_BUILD_DIR:=$(BUILD_DIR)/DB-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/php-pear-db + SUBMENU:=PHP + SECTION:=lang + CATEGORY:=Languages + TITLE:=PEAR DB module + URL:=http://pear.php.net/package/DB + DEPENDS:=php-pear +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/php-pear-db/install + $(INSTALL_DIR) $(1)/usr/lib/php + $(CP) $(PKG_BUILD_DIR)/DB.php $(PKG_BUILD_DIR)/DB \ + $(1)/usr/lib/php/ +endef + +$(eval $(call BuildPackage,php-pear-db)) diff --git a/lang/php-pear-db/patches/100-php5-deprecation-fixes.patch b/lang/php-pear-db/patches/100-php5-deprecation-fixes.patch new file mode 100644 index 0000000..714b678 --- /dev/null +++ b/lang/php-pear-db/patches/100-php5-deprecation-fixes.patch @@ -0,0 +1,34 @@ +diff -ubrN DB-1.7.11-orig/DB/common.php DB-1.7.11/DB/common.php +--- DB-1.7.11-orig/DB/common.php 2007-03-28 02:11:15.000000000 -0500 ++++ DB-1.7.11/DB/common.php 2007-06-11 14:49:37.000000000 -0500 +@@ -1014,7 +1014,7 @@ + if ($result === DB_OK || DB::isError($result)) { + return $result; + } else { +- $tmp =& new DB_result($this, $result); ++ $tmp = new DB_result($this, $result); + return $tmp; + } + } +@@ -1217,7 +1217,7 @@ + if ($result === DB_OK || DB::isError($result)) { + return $result; + } else { +- $tmp =& new DB_result($this, $result); ++ $tmp = new DB_result($this, $result); + return $tmp; + } + } +diff -ubrN DB-1.7.11-orig/DB.php DB-1.7.11/DB.php +--- DB-1.7.11-orig/DB.php 2007-03-28 02:11:15.000000000 -0500 ++++ DB-1.7.11/DB.php 2007-06-11 14:49:42.000000000 -0500 +@@ -591,7 +591,8 @@ + */ + function isError($value) + { +- return is_a($value, 'DB_Error'); ++ return $value instanceof DB_Error; ++ // return is_a($value, 'DB_Error'); + } + + // }}} diff --git a/lang/php-pear-xmlrpc/Makefile b/lang/php-pear-xmlrpc/Makefile new file mode 100644 index 0000000..23f7679 --- /dev/null +++ b/lang/php-pear-xmlrpc/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=php-pear-xmlrpc +PKG_VERSION:=1.5.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=XML_RPC-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://download.pear.php.net/package +PKG_MD5SUM:=1b516162ad65971b5fd04a7c279627ec + +PKG_BUILD_DIR:=$(BUILD_DIR)/XML_RPC-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/php-pear-xmlrpc + SUBMENU:=PHP + SECTION:=lang + CATEGORY:=Languages + TITLE:=PEAR XML-RPC module + URL:=http://pear.php.net/package/XML_RPC + DEPENDS:=php-pear + PKGARCH:=all +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/php-pear-xmlrpc/install + $(INSTALL_DIR) $(1)/usr/lib/php/XML + $(CP) $(PKG_BUILD_DIR)/Dump.php \ + $(PKG_BUILD_DIR)/RPC.php \ + $(PKG_BUILD_DIR)/Server.php \ + $(1)/usr/lib/php/XML/ +endef + +$(eval $(call BuildPackage,php-pear-xmlrpc)) diff --git a/lang/php-pear/Makefile b/lang/php-pear/Makefile new file mode 100644 index 0000000..22fe6fe --- /dev/null +++ b/lang/php-pear/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=php-pear +PKG_VERSION:=1.5.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=PEAR-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://download.pear.php.net/package +PKG_MD5SUM:=06432c4768fdd7df2c4982c973d3f429 + +PKG_BUILD_DIR:=$(BUILD_DIR)/PEAR-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/php-pear + SUBMENU:=PHP + SECTION:=lang + CATEGORY:=Languages + TITLE:=PEAR + URL:=http://pear.php.net/package/PEAR + DEPENDS:=+php5 +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/php-pear/install + $(INSTALL_DIR) $(1)/usr/lib/php + $(CP) $(PKG_BUILD_DIR)/PEAR.php $(PKG_BUILD_DIR)/PEAR \ + $(1)/usr/lib/php/ +endef + +$(eval $(call BuildPackage,php-pear)) + diff --git a/lang/php-pear/patches/000-remove_deprecation_messages.patch b/lang/php-pear/patches/000-remove_deprecation_messages.patch new file mode 100644 index 0000000..0f79cfc --- /dev/null +++ b/lang/php-pear/patches/000-remove_deprecation_messages.patch @@ -0,0 +1,62 @@ +--- PEAR-1.5.4/PEAR.php 2007-05-07 23:10:49.000000000 -0500 ++++ PEAR-1.5.4/PEAR.php.new 2007-05-23 16:36:05.699498250 -0500 +@@ -278,7 +278,8 @@ + */ + function isError($data, $code = null) + { +- if (is_a($data, 'PEAR_Error')) { ++ //if (is_a($data, 'PEAR_Error')) { ++ if ( $data instanceof PEAR_Error ) { + if (is_null($code)) { + return true; + } elseif (is_string($code)) { +@@ -334,7 +335,8 @@ + + function setErrorHandling($mode = null, $options = null) + { +- if (isset($this) && is_a($this, 'PEAR')) { ++ //if (isset($this) && is_a($this, 'PEAR')) { ++ if ( isset($this) && $this instanceof PEAR ) { + $setmode = &$this->_default_error_mode; + $setoptions = &$this->_default_error_options; + } else { +@@ -588,7 +590,8 @@ + $code = null, + $userinfo = null) + { +- if (isset($this) && is_a($this, 'PEAR')) { ++ //if (isset($this) && is_a($this, 'PEAR')) { ++ if ( isset($this) && $this instanceof PEAR ) { + $a = &$this->raiseError($message, $code, null, null, $userinfo); + return $a; + } else { +@@ -686,7 +689,8 @@ + function pushErrorHandling($mode, $options = null) + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; +- if (isset($this) && is_a($this, 'PEAR')) { ++ //if (isset($this) && is_a($this, 'PEAR')) { ++ if (isset($this) && $this instanceof PEAR ) { + $def_mode = &$this->_default_error_mode; + $def_options = &$this->_default_error_options; + } else { +@@ -695,7 +699,8 @@ + } + $stack[] = array($def_mode, $def_options); + +- if (isset($this) && is_a($this, 'PEAR')) { ++ //if (isset($this) && is_a($this, 'PEAR')) { ++ if (isset($this) && $this instanceof PEAR ) { + $this->setErrorHandling($mode, $options); + } else { + PEAR::setErrorHandling($mode, $options); +@@ -720,7 +725,8 @@ + array_pop($stack); + list($mode, $options) = $stack[sizeof($stack) - 1]; + array_pop($stack); +- if (isset($this) && is_a($this, 'PEAR')) { ++ //if (isset($this) && is_a($this, 'PEAR')) { ++ if (isset($this) && $this instanceof PEAR ) { + $this->setErrorHandling($mode, $options); + } else { + PEAR::setErrorHandling($mode, $options); diff --git a/lang/php4/Makefile b/lang/php4/Makefile new file mode 100644 index 0000000..2ba1bf3 --- /dev/null +++ b/lang/php4/Makefile @@ -0,0 +1,369 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=php4 +PKG_VERSION:=4.4.9 +PKG_RELEASE:=1 + +PKG_SOURCE:=php-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.php.net/distributions/ +PKG_MD5SUM:=2e3b2a0e27f10cb84fd00e5ecd7a1880 +PKG_BUILD_DIR:=$(BUILD_DIR)/php-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/php4/Default + SUBMENU:=PHP + SECTION:=lang + CATEGORY:=Languages + TITLE:=PHP4 Hypertext preprocessor + DEPENDS:=@!TARGET_ixp4xx + URL:=http://www.php.net/ +endef + +define Package/php4/Default/description + PHP is a widely-used general-purpose scripting language that is especially + suited for Web development and can be embedded into HTML. +endef + +define Package/php4 + $(call Package/php4/Default) + DEPENDS:=+libopenssl +zlib +endef + +define Package/php4/description +$(call Package/php4/Default/description) + This package contains only the PHP config file. You must actually choose + your PHP flavour (cli, cgi or fastcgi). +endef + +define Package/php4-cli + $(call Package/php4/Default) + DEPENDS:=php4 + TITLE+= (CLI) +endef + +define Package/php4-cli/description +$(call Package/php4/Default/description) + This package contains the CLI version of the PHP4 interpreter. +endef + +define Package/php4-cgi + $(call Package/php4/Default) + DEPENDS:=php4 + TITLE+= (CGI) +endef + +define Package/php4-cgi/description +$(call Package/php4/Default/description) + This package contains the CGI version of the PHP4 interpreter. +endef + +define Package/php4-fastcgi + $(call Package/php4/Default) + DEPENDS:=php4 + TITLE+= (FastCGI) +endef + +define Package/php4-fastcgi/description +$(call Package/php4/Default/description) + This package contains the FastCGI version of the PHP4 interpreter. +endef + +define Package/php4-mod-curl + $(call Package/php4/Default) + DEPENDS:=php4 +libcurl + TITLE:=cURL module +endef + +define Package/php4-mod-ftp + $(call Package/php4/Default) + DEPENDS:=php4 + TITLE:=FTP module +endef + +define Package/php4-mod-gd + $(call Package/php4/Default) + DEPENDS:=php4 +libgd + TITLE:=GD graphics module +endef + +define Package/php4-mod-gmp + $(call Package/php4/Default) + DEPENDS:=php4 +libgmp + TITLE:=GMP module +endef + +define Package/php4-mod-ldap + $(call Package/php4/Default) + DEPENDS:=php4 +libopenldap + TITLE:=LDAP module +endef + +define Package/php4-mod-mysql + $(call Package/php4/Default) + DEPENDS:=php4 +libmysqlclient + TITLE:=MySQL module +endef + +define Package/php4-mod-openssl + $(call Package/php4/Default) + DEPENDS:=php4 +libopenssl + TITLE:=OpenSSL module +endef + +define Package/php4-mod-pcre + $(call Package/php4/Default) + DEPENDS:=php4 +libpcre + TITLE:=PCRE module +endef + +define Package/php4-mod-pgsql + $(call Package/php4/Default) + DEPENDS:=php4 +libpq + TITLE:=PostgreSQL module +endef + +define Package/php4-mod-session + $(call Package/php4/Default) + DEPENDS:=php4 + TITLE:=Session module +endef + +define Package/php4-mod-sockets + $(call Package/php4/Default) + DEPENDS:=php4 + TITLE:=Sockets module +endef + +define Package/php4-mod-xml + $(call Package/php4/Default) + DEPENDS:=php4 +libexpat + TITLE:=XML module +endef + +PKG_CONFIGURE_LIBS:= -lcrypto -lssl +PKG_CONFIGURE_OPTS:= \ + --enable-shared \ + --disable-static \ + --disable-rpath \ + --disable-debug \ + --without-pear \ + \ + --with-config-file-path=/etc \ + --enable-magic-quotes \ + --enable-memory-limit \ + --disable-overload \ + --disable-short-tags \ + \ + --disable-ctype \ + --disable-dom \ + --enable-ftp=shared \ + --without-gettext \ + --without-iconv \ + --disable-mbstring \ + --disable-mbregex \ + --with-openssl=shared,"$(STAGING_DIR)/usr" \ + --with-kerberos=no \ + --with-openssl-dir="$(STAGING_DIR)/usr" \ + --enable-session=shared \ + --enable-sockets=shared \ + --disable-tokenizer \ + --with-zlib="$(STAGING_DIR)/usr" \ + --with-zlib-dir="$(STAGING_DIR)/usr" \ + +ifneq ($(SDK),) + PKG_BUILD_DEPENDS:=libopenssl zlib libcurl libgd libgmp libopenldap libmysqlclient libpq libexpat +# force PKG_CONFIGURE_{LIBS,OPTS} below when built in the SDK + CONFIG_PACKAGE_php4-cli:=m + CONFIG_PACKAGE_php4-cgi:=m + CONFIG_PACKAGE_php4-fastcgi:=m + CONFIG_PACKAGE_php4-mod-curl:=m + CONFIG_PACKAGE_php4-mod-gd:=m + CONFIG_PACKAGE_php4-mod-gmp:=m + CONFIG_PACKAGE_php4-mod-ldap:=m + CONFIG_PACKAGE_php4-mod-mysql:=m + CONFIG_PACKAGE_php4-mod-pcre:=m + CONFIG_PACKAGE_php4-mod-pgsql:=m + CONFIG_PACKAGE_php4-mod-xml:=m +endif + +ifneq ($(CONFIG_PACKAGE_php4-mod-curl),) + PKG_CONFIGURE_OPTS+= --with-curl=shared,"$(STAGING_DIR)/usr" +else + PKG_CONFIGURE_OPTS+= --without-curl +endif +ifneq ($(CONFIG_PACKAGE_php4-mod-gd),) + PKG_CONFIGURE_OPTS+= --with-gd=shared,"$(STAGING_DIR)/usr" \ + --without-freetype-dir \ + --with-jpeg-dir="$(STAGING_DIR)/usr" \ + --with-png-dir="$(STAGING_DIR)/usr" \ + --without-xpm-dir \ + --without-ttf \ + --without-t1lib \ + --enable-gd-native-ttf \ + --disable-gd-jis-conv +else + PKG_CONFIGURE_OPTS+= --without-gd +endif +ifneq ($(CONFIG_PACKAGE_php4-mod-gmp),) + PKG_CONFIGURE_OPTS+= --with-gmp=shared,"$(STAGING_DIR)/usr" +else + PKG_CONFIGURE_OPTS+= --without-gmp +endif +ifneq ($(CONFIG_PACKAGE_php4-mod-ldap),) + PKG_CONFIGURE_OPTS+= --with-ldap=shared,"$(STAGING_DIR)/usr" + --with-ldap-sasl="$(STAGING_DIR)/usr" +else + PKG_CONFIGURE_OPTS+= --without-ldap +endif +ifneq ($(CONFIG_PACKAGE_php4-mod-mysql),) + PKG_CONFIGURE_OPTS+= --with-mysql=shared,"$(STAGING_DIR)/usr" +else + PKG_CONFIGURE_OPTS+= --without-mysql +endif +ifneq ($(CONFIG_PACKAGE_php4-mod-pcre),) + PKG_CONFIGURE_OPTS+= --with-pcre-regex=shared,"$(STAGING_DIR)/usr" +else + PKG_CONFIGURE_OPTS+= --without-pcre-regex +endif +ifneq ($(CONFIG_PACKAGE_php4-mod-pgsql),) + PKG_CONFIGURE_OPTS+= --with-pgsql=shared,"$(STAGING_DIR)/usr" +else + PKG_CONFIGURE_OPTS+= --without-pgsql +endif +ifneq ($(CONFIG_PACKAGE_php4-mod-xml),) + PKG_CONFIGURE_OPTS+= --enable-xml=shared \ + --with-expat-dir="$(STAGING_DIR)/usr" +else + PKG_CONFIGURE_OPTS+= --disable-xml +endif + +define Build/Configure +endef + +TARGET_CFLAGS += $(if $(CONFIG_BIG_ENDIAN),-DIEEE_BIG_ENDIAN,-DIEEE_LITTLE_ENDIAN) $(FPIC) + +ifneq ($(CONFIG_PACKAGE_php4-cli),) + define Build/Compile/php4-cli + -$(MAKE) -C $(PKG_BUILD_DIR) clean + $(call Build/Configure/Default, \ + $(PKG_CONFIGURE_OPTS) \ + --enable-cli \ + --disable-cgi \ + --disable-fastcgi \ + --enable-force-cgi-redirect \ + --enable-discard-path \ + , \ + LIBS="$(PKG_CONFIGURE_LIBS)" \ + php_cv_cc_rpath="no" \ + ) + LD_LIBRARY_PATH="" $(MAKE) -C $(PKG_BUILD_DIR) + mv $(PKG_BUILD_DIR)/sapi/cli/php $(PKG_BUILD_DIR)/php-cli + endef +endif + +ifneq ($(CONFIG_PACKAGE_php4-cgi),) + define Build/Compile/php4-cgi + -$(MAKE) -C $(PKG_BUILD_DIR) clean + $(call Build/Configure/Default, \ + $(PKG_CONFIGURE_OPTS) \ + --disable-cli \ + --enable-cgi \ + --disable-fastcgi \ + --enable-force-cgi-redirect \ + --enable-discard-path \ + , \ + LIBS="$(PKG_CONFIGURE_LIBS)" \ + php_cv_cc_rpath="no" \ + ) + LD_LIBRARY_PATH="" $(MAKE) -C $(PKG_BUILD_DIR) + mv $(PKG_BUILD_DIR)/sapi/cgi/php $(PKG_BUILD_DIR)/php-cgi + endef +endif + +ifneq ($(CONFIG_PACKAGE_php4-fastcgi),) + define Build/Compile/php4-fastcgi + -$(MAKE) -C $(PKG_BUILD_DIR) clean + $(call Build/Configure/Default, \ + $(PKG_CONFIGURE_OPTS) \ + --disable-cli \ + --enable-cgi \ + --enable-fastcgi \ + --enable-force-cgi-redirect \ + --enable-discard-path \ + , \ + LIBS="$(PKG_CONFIGURE_LIBS)" \ + php_cv_cc_rpath="no" \ + ) + LD_LIBRARY_PATH="" $(MAKE) -C $(PKG_BUILD_DIR) + mv $(PKG_BUILD_DIR)/sapi/cgi/php $(PKG_BUILD_DIR)/php-fastcgi + endef +endif + +define Build/Compile + $(call Build/Compile/php4-cli) + $(call Build/Compile/php4-cgi) + $(call Build/Compile/php4-fastcgi) +endef + +define Package/php4/conffiles +/etc/php.ini +endef + +define Package/php4/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/php.ini $(1)/etc/ +endef + +define Package/php4-cli/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/php-cli $(1)/usr/bin/php +endef + +define Package/php4-cgi/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/php-cgi $(1)/usr/bin/php +endef + +define Package/php4-fastcgi/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/php-fastcgi $(1)/usr/sbin/php + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/php.init $(1)/etc/init.d/php +endef + +define BuildPlugin + define Package/$(1)/install + [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/php + for m in $(2); do \ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$$$$$$$${m}.so $$(1)/usr/lib/php/ ; \ + done + endef + + $$(eval $$(call BuildPackage,$(1))) +endef + +$(eval $(call BuildPackage,php4)) +$(eval $(call BuildPackage,php4-cli)) +$(eval $(call BuildPackage,php4-cgi)) +$(eval $(call BuildPackage,php4-fastcgi)) +$(eval $(call BuildPlugin,php4-mod-curl,curl)) +$(eval $(call BuildPlugin,php4-mod-ftp,ftp)) +$(eval $(call BuildPlugin,php4-mod-gd,gd)) +$(eval $(call BuildPlugin,php4-mod-gmp,gmp)) +$(eval $(call BuildPlugin,php4-mod-ldap,ldap)) +$(eval $(call BuildPlugin,php4-mod-mysql,mysql)) +$(eval $(call BuildPlugin,php4-mod-openssl,openssl)) +$(eval $(call BuildPlugin,php4-mod-pcre,pcre)) +$(eval $(call BuildPlugin,php4-mod-pgsql,pgsql)) +$(eval $(call BuildPlugin,php4-mod-session,session)) +$(eval $(call BuildPlugin,php4-mod-sockets,sockets)) +$(eval $(call BuildPlugin,php4-mod-xml,xml)) + diff --git a/lang/php4/files/php.ini b/lang/php4/files/php.ini new file mode 100644 index 0000000..ae16d0b --- /dev/null +++ b/lang/php4/files/php.ini @@ -0,0 +1,561 @@ +[PHP] + +cgi.fix_pathinfo=1 + +zend.ze1_compatibility_mode = Off + +;short_open_tag = Off +asp_tags = Off +precision = 12 +y2k_compliance = On +output_buffering = Off + +zlib.output_compression = Off +;zlib.output_handler = +implicit_flush = Off + +unserialize_callback_func= +serialize_precision = 100 + +allow_call_time_pass_reference = On + +safe_mode = Off + +safe_mode_gid = Off + +safe_mode_include_dir = + +safe_mode_exec_dir = + +safe_mode_allowed_env_vars = PHP_ + +safe_mode_protected_env_vars = LD_LIBRARY_PATH + +;open_basedir = + +disable_functions = + +disable_classes = + +; Colors for Syntax Highlighting mode. Anything that's acceptable in +; would work. +;highlight.string = #DD0000 +;highlight.comment = #FF9900 +;highlight.keyword = #007700 +;highlight.bg = #FFFFFF +;highlight.default = #0000BB +;highlight.html = #000000 + +expose_php = On + + +;;;;;;;;;;;;;;;;;;; +; Resource Limits ; +;;;;;;;;;;;;;;;;;;; + +max_execution_time = 30 ; Maximum execution time of each script, in seconds +max_input_time = 60 ; Maximum amount of time each script may spend parsing request data +memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Error handling and logging ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; error_reporting is a bit-field. Or each number up to get desired error +; reporting level +; E_ALL - All errors and warnings (doesn't include E_STRICT) +; E_ERROR - fatal run-time errors +; E_WARNING - run-time warnings (non-fatal errors) +; E_PARSE - compile-time parse errors +; E_NOTICE - run-time notices (these are warnings which often result +; from a bug in your code, but it's possible that it was +; intentional (e.g., using an uninitialized variable and +; relying on the fact it's automatically initialized to an +; empty string) +; E_STRICT - run-time notices, enable to have PHP suggest changes +; to your code which will ensure the best interoperability +; and forward compatibility of your code +; E_CORE_ERROR - fatal errors that occur during PHP's initial startup +; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's +; initial startup +; E_COMPILE_ERROR - fatal compile-time errors +; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) +; E_USER_ERROR - user-generated error message +; E_USER_WARNING - user-generated warning message +; E_USER_NOTICE - user-generated notice message +; +; Examples: +; +; - Show all errors, except for notices and coding standards warnings +; +;error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT +; +; - Show all errors, except for notices +; +;error_reporting = E_ALL & ~E_NOTICE +; +; - Show only errors +; +;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR +; +; - Show all errors except for notices and coding standards warnings +; +error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT + +; Print out errors (as a part of the output). For production web sites, +; you're strongly encouraged to turn this feature off, and use error logging +; instead (see below). Keeping display_errors enabled on a production web site +; may reveal security information to end users, such as file paths on your Web +; server, your database schema or other information. +display_errors = On + +; Even when display_errors is on, errors that occur during PHP's startup +; sequence are not displayed. It's strongly recommended to keep +; display_startup_errors off, except for when debugging. +display_startup_errors = Off + +; Log errors into a log file (server-specific log, stderr, or error_log (below)) +; As stated above, you're strongly advised to use error logging in place of +; error displaying on production web sites. +log_errors = Off + +; Set maximum length of log_errors. In error_log information about the source is +; added. The default is 1024 and 0 allows to not apply any maximum length at all. +log_errors_max_len = 1024 + +; Do not log repeated messages. Repeated errors must occur in same file on same +; line until ignore_repeated_source is set true. +ignore_repeated_errors = Off + +; Ignore source of message when ignoring repeated messages. When this setting +; is On you will not log errors with repeated messages from different files or +; sourcelines. +ignore_repeated_source = Off + +; If this parameter is set to Off, then memory leaks will not be shown (on +; stdout or in the log). This has only effect in a debug compile, and if +; error reporting includes E_WARNING in the allowed list +report_memleaks = On + +; Store the last error/warning message in $php_errormsg (boolean). +track_errors = Off + +; Disable the inclusion of HTML tags in error messages. +; Note: Never use this feature for production boxes. +;html_errors = Off + +; If html_errors is set On PHP produces clickable error messages that direct +; to a page describing the error or function causing the error in detail. +; You can download a copy of the PHP manual from http://www.php.net/docs.php +; and change docref_root to the base URL of your local copy including the +; leading '/'. You must also specify the file extension being used including +; the dot. +; Note: Never use this feature for production boxes. +;docref_root = "/phpmanual/" +;docref_ext = .html + +; String to output before an error message. +;error_prepend_string = "" + +; String to output after an error message. +;error_append_string = "" + +; Log errors to specified file. +;error_log = filename + +; Log errors to syslog (Event Log on NT, not valid in Windows 95). +;error_log = syslog + + +;;;;;;;;;;;;;;;;; +; Data Handling ; +;;;;;;;;;;;;;;;;; +; +; Note - track_vars is ALWAYS enabled as of PHP 4.0.3 + +; The separator used in PHP generated URLs to separate arguments. +; Default is "&". +;arg_separator.output = "&" + +; List of separator(s) used by PHP to parse input URLs into variables. +; Default is "&". +; NOTE: Every character in this directive is considered as separator! +;arg_separator.input = ";&" + +; This directive describes the order in which PHP registers GET, POST, Cookie, +; Environment and Built-in variables (G, P, C, E & S respectively, often +; referred to as EGPCS or GPC). Registration is done from left to right, newer +; values override older values. +variables_order = "EGPCS" + +; Whether or not to register the EGPCS variables as global variables. You may +; want to turn this off if you don't want to clutter your scripts' global scope +; with user data. This makes most sense when coupled with track_vars - in which +; case you can access all of the GPC variables through the $HTTP_*_VARS[], +; variables. +; +; You should do your best to write your scripts so that they do not require +; register_globals to be on; Using form variables as globals can easily lead +; to possible security problems, if the code is not very well thought of. +register_globals = Off + +; Whether or not to register the old-style input arrays, HTTP_GET_VARS +; and friends. If you're not using them, it's recommended to turn them off, +; for performance reasons. +register_long_arrays = On + +; This directive tells PHP whether to declare the argv&argc variables (that +; would contain the GET information). If you don't use these variables, you +; should turn it off for increased performance. +register_argc_argv = On + +; Maximum size of POST data that PHP will accept. +post_max_size = 8M + +; Magic quotes +; + +; Magic quotes for incoming GET/POST/Cookie data. +magic_quotes_gpc = On + +; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc. +magic_quotes_runtime = Off + +; Use Sybase-style magic quotes (escape ' with '' instead of \'). +magic_quotes_sybase = Off + +; Automatically add files before or after any PHP document. +auto_prepend_file = +auto_append_file = + +; As of 4.0b4, PHP always outputs a character encoding by default in +; the Content-type: header. To disable sending of the charset, simply +; set it to be empty. +; +; PHP's built-in default is text/html +default_mimetype = "text/html" +;default_charset = "iso-8859-1" + +; Always populate the $HTTP_RAW_POST_DATA variable. +;always_populate_raw_post_data = On + + +;;;;;;;;;;;;;;;;;;;;;;;;; +; Paths and Directories ; +;;;;;;;;;;;;;;;;;;;;;;;;; + +; UNIX: "/path1:/path2" +;include_path = ".:/php/includes" +; +; Windows: "\path1;\path2" +;include_path = ".;c:\php\includes" + +; The root of the PHP pages, used only if nonempty. +; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root +; if you are running php as a CGI under any web server (other than IIS) +; see documentation for security issues. The alternate is to use the +; cgi.force_redirect configuration below +doc_root = /www + +; The directory under which PHP opens the script using /~username used only +; if nonempty. +user_dir = + +; Directory in which the loadable extensions (modules) reside. +extension_dir = "/usr/lib/php" + +; Whether or not to enable the dl() function. The dl() function does NOT work +; properly in multithreaded servers, such as IIS or Zeus, and is automatically +; disabled on them. +enable_dl = On + +; cgi.force_redirect is necessary to provide security running PHP as a CGI under +; most web servers. Left undefined, PHP turns this on by default. You can +; turn it off here AT YOUR OWN RISK +; **You CAN safely turn this off for IIS, in fact, you MUST.** +; cgi.force_redirect = 1 + +; if cgi.nph is enabled it will force cgi to always sent Status: 200 with +; every request. +; cgi.nph = 1 + +; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape +; (iPlanet) web servers, you MAY need to set an environment variable name that PHP +; will look for to know it is OK to continue execution. Setting this variable MAY +; cause security issues, KNOW WHAT YOU ARE DOING FIRST. +; cgi.redirect_status_env = ; + +; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate +; security tokens of the calling client. This allows IIS to define the +; security context that the request runs under. mod_fastcgi under Apache +; does not currently support this feature (03/17/2002) +; Set to 1 if running under IIS. Default is zero. +; fastcgi.impersonate = 1; + +; cgi.rfc2616_headers configuration option tells PHP what type of headers to +; use when sending HTTP response code. If it's set 0 PHP sends Status: header that +; is supported by Apache. When this option is set to 1 PHP will send +; RFC2616 compliant header. +; Default is zero. +;cgi.rfc2616_headers = 0 + + +;;;;;;;;;;;;;;;; +; File Uploads ; +;;;;;;;;;;;;;;;; + +; Whether to allow HTTP file uploads. +file_uploads = On + +; Temporary directory for HTTP uploaded files (will use system default if not +; specified). +upload_tmp_dir = /tmp + +; Maximum allowed size for uploaded files. +upload_max_filesize = 2M + + +;;;;;;;;;;;;;;;;;; +; Fopen wrappers ; +;;;;;;;;;;;;;;;;;; + +; Whether to allow the treatment of URLs (like http:// or ftp://) as files. +allow_url_fopen = On + +; Define the anonymous ftp password (your email address) +;from="john@doe.com" + +; Define the User-Agent string +; user_agent="PHP" + +; Default timeout for socket based streams (seconds) +default_socket_timeout = 60 + +; If your scripts have to deal with files from Macintosh systems, +; or you are running on a Mac and need to deal with files from +; unix or win32 systems, setting this flag will cause PHP to +; automatically detect the EOL character in those files so that +; fgets() and file() will work regardless of the source of the file. +; auto_detect_line_endings = Off + + +;;;;;;;;;;;;;;;;;;;;;; +; Dynamic Extensions ; +;;;;;;;;;;;;;;;;;;;;;; +; +; If you wish to have an extension loaded automatically, use the following +; syntax: +; +; extension=modulename.extension +; +; For example, on Windows: +; +; extension=msql.dll +; +; ... or under UNIX: +; +; extension=msql.so +; +; Note that it should be the name of the module only; no directory information +; needs to go here. Specify the location of the extension with the +; extension_dir directive above. + + +;Windows Extensions +;Note that ODBC support is built in, so no dll is needed for it. +; + +;extension=ftp.so +;extension=gd.so +;extension=mysql.so +;extension=pcre.so +;extension=session.so +;extension=sockets.so +;extension=xml.so + + + + +;;;;;;;;;;;;;;;;;;; +; Module Settings ; +;;;;;;;;;;;;;;;;;;; + +[SQL] +sql.safe_mode = Off + +[Session] +; Handler used to store/retrieve data. +session.save_handler = files + +; Argument passed to save_handler. In the case of files, this is the path +; where data files are stored. Note: Windows users have to change this +; variable in order to use PHP's session functions. +; +; As of PHP 4.0.1, you can define the path as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if you +; or your OS have problems with lots of files in one directory, and is +; a more efficient layout for servers that handle lots of sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +session.save_path = "/tmp" + +; Whether to use cookies. +session.use_cookies = 1 + +; This option enables administrators to make their users invulnerable to +; attacks which involve passing session ids in URLs; defaults to 0. +; session.use_only_cookies = 1 + +; Name of the session (used as cookie name). +session.name = PHPSESSID + +; Initialize session on request startup. +session.auto_start = 0 + +; Lifetime in seconds of cookie or, if 0, until browser is restarted. +session.cookie_lifetime = 0 + +; The path for which the cookie is valid. +session.cookie_path = / + +; The domain for which the cookie is valid. +session.cookie_domain = + +; Handler used to serialize data. php is the standard serializer of PHP. +session.serialize_handler = php + +; Define the probability that the 'garbage collection' process is started +; on every session initialization. +; The probability is calculated by using gc_probability/gc_divisor, +; e.g. 1/100 means there is a 1% chance that the GC process starts +; on each request. + +session.gc_probability = 1 +session.gc_divisor = 100 + +; After this number of seconds, stored data will be seen as 'garbage' and +; cleaned up by the garbage collection process. +session.gc_maxlifetime = 1440 + +; NOTE: If you are using the subdirectory option for storing session files +; (see session.save_path above), then garbage collection does *not* +; happen automatically. You will need to do your own garbage +; collection through a shell script, cron entry, or some other method. +; For example, the following script would is the equivalent of +; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): +; cd /path/to/sessions; find -cmin +24 | xargs rm + +; PHP 4.2 and less have an undocumented feature/bug that allows you to +; to initialize a session variable in the global scope, albeit register_globals +; is disabled. PHP 4.3 and later will warn you, if this feature is used. +; You can disable the feature and the warning separately. At this time, +; the warning is only displayed, if bug_compat_42 is enabled. + +session.bug_compat_42 = 1 +session.bug_compat_warn = 1 + +; Check HTTP Referer to invalidate externally stored URLs containing ids. +; HTTP_REFERER has to contain this substring for the session to be +; considered as valid. +session.referer_check = + +; How many bytes to read from the file. +session.entropy_length = 0 + +; Specified here to create the session id. +session.entropy_file = + +;session.entropy_length = 16 + +;session.entropy_file = /dev/urandom + +; Set to {nocache,private,public,} to determine HTTP caching aspects +; or leave this empty to avoid sending anti-caching headers. +session.cache_limiter = nocache + +; Document expires after n minutes. +session.cache_expire = 180 + +; trans sid support is disabled by default. +; Use of trans sid may risk your users security. +; Use this option with caution. +; - User may send URL contains active session ID +; to other person via. email/irc/etc. +; - URL that contains active session ID may be stored +; in publically accessible computer. +; - User may access your site with the same session ID +; always using URL stored in browser's history or bookmarks. +session.use_trans_sid = 0 + +; Select a hash function +; 0: MD5 (128 bits) +; 1: SHA-1 (160 bits) +session.hash_function = 0 + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; +; 4 bits: 0-9, a-f +; 5 bits: 0-9, a-v +; 6 bits: 0-9, a-z, A-Z, "-", "," +session.hash_bits_per_character = 4 + +; The URL rewriter will look for URLs in a defined set of HTML tags. +; form/fieldset are special; if you include them here, the rewriter will +; add a hidden field with the info which is otherwise appended +; to URLs. If you want XHTML conformity, remove the form entry. +; Note that all valid entries require a "=", even if no value follows. +url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset=" + + +[Assertion] +; Assert(expr); active by default. +;assert.active = On + +; Issue a PHP warning for each failed assertion. +;assert.warning = On + +; Don't bail out by default. +;assert.bail = Off + +; User-function to be called if an assertion fails. +;assert.callback = 0 + +; Eval the expression with current error_reporting(). Set to true if you want +; error_reporting(0) around the eval(). +;assert.quiet_eval = 0 + + + + + +[exif] +; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. +; With mbstring support this will automatically be converted into the encoding +; given by corresponding encode setting. When empty mbstring.internal_encoding +; is used. For the decode settings you can distinguish between motorola and +; intel byte order. A decode setting cannot be empty. +;exif.encode_unicode = ISO-8859-15 +;exif.decode_unicode_motorola = UCS-2BE +;exif.decode_unicode_intel = UCS-2LE +;exif.encode_jis = +;exif.decode_jis_motorola = JIS +;exif.decode_jis_intel = JIS + diff --git a/lang/php4/files/php.init b/lang/php4/files/php.init new file mode 100644 index 0000000..373f396 --- /dev/null +++ b/lang/php4/files/php.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 + +start() { + $BIN -b $PORT & +} + +stop() { + killall php +} + diff --git a/lang/php4/patches/002-configure.patch b/lang/php4/patches/002-configure.patch new file mode 100644 index 0000000..af47d5b --- /dev/null +++ b/lang/php4/patches/002-configure.patch @@ -0,0 +1,83 @@ +--- a/configure ++++ b/configure +@@ -12503,7 +12503,7 @@ fi + ac_libs=$LIBS + LIBS="$LIBS -ldl" + if test "$cross_compiling" = yes; then +- found=no ++ found=yes + else + cat > conftest.$ac_ext <&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + if test "$cross_compiling" = yes; then +- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&6 + echo "configure:43893: checking if iconv supports errno" >&5 + if test "$cross_compiling" = yes; then +- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <= 0x10000000L ++#define OPENSSL_D2I_X509_CAST d2i_of_void * ++#else ++#define OPENSSL_D2I_X509_CAST char *(*)() ++#define LHASH_OF(x) LHASH ++#endif ++ + static unsigned char arg2_force_ref[] = + { 2, BYREF_NONE, BYREF_FORCE }; + static unsigned char arg2and3_force_ref[] = +@@ -179,8 +186,8 @@ inline static int php_openssl_safe_mode_ + static char default_ssl_conf_filename[MAXPATHLEN]; + + struct php_x509_request { +- LHASH * global_config; /* Global SSL config */ +- LHASH * req_config; /* SSL config for this request */ ++ LHASH_OF(CONF_VALUE) * global_config; /* Global SSL config */ ++ LHASH_OF(CONF_VALUE) * req_config; /* SSL config for this request */ + const EVP_MD * md_alg; + const EVP_MD * digest; + char * section_name, +@@ -340,7 +347,7 @@ static inline int php_openssl_config_che + const char * section_label, + const char * config_filename, + const char * section, +- LHASH * config TSRMLS_DC) ++ LHASH_OF(CONF_VALUE) * config TSRMLS_DC) + { + X509V3_CTX ctx; + +@@ -720,7 +727,7 @@ static X509 * php_openssl_x509_from_zval + if (in == NULL) + return NULL; + +- cert = (X509 *) PEM_ASN1_read_bio((char *(*)())d2i_X509, ++ cert = (X509 *) PEM_ASN1_read_bio((OPENSSL_D2I_X509_CAST)d2i_X509, + PEM_STRING_X509, in, + NULL, NULL, NULL); + BIO_free(in); +@@ -1859,7 +1866,7 @@ static int php_openssl_is_private_key(EV + case EVP_PKEY_RSA2: + assert(pkey->pkey.rsa != NULL); + +- if (NULL == pkey->pkey.rsa->p || NULL == pkey->pkey.rsa->q) ++ if (NULL == pkey->pkey.rsa || NULL == pkey->pkey.rsa->p || NULL == pkey->pkey.rsa->q) + return 0; + break; + #endif +@@ -1871,7 +1878,7 @@ static int php_openssl_is_private_key(EV + case EVP_PKEY_DSA4: + assert(pkey->pkey.dsa != NULL); + +- if (NULL == pkey->pkey.dsa->p || NULL == pkey->pkey.dsa->q || NULL == pkey->pkey.dsa->priv_key) ++ if (NULL == pkey->pkey.dsa || NULL == pkey->pkey.dsa->p || NULL == pkey->pkey.dsa->q || NULL == pkey->pkey.dsa->priv_key) + return 0; + break; + #endif +@@ -1879,7 +1886,7 @@ static int php_openssl_is_private_key(EV + case EVP_PKEY_DH: + assert(pkey->pkey.dh != NULL); + +- if (NULL == pkey->pkey.dh->p || NULL == pkey->pkey.dh->priv_key) ++ if (NULL == pkey->pkey.dh || NULL == pkey->pkey.dh->p || NULL == pkey->pkey.dh->priv_key) + return 0; + break; + #endif diff --git a/lang/php5/Makefile b/lang/php5/Makefile new file mode 100644 index 0000000..9d3170f --- /dev/null +++ b/lang/php5/Makefile @@ -0,0 +1,576 @@ +# +# Copyright (C) 2006-2012 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:=php +PKG_VERSION:=5.4.5 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.php.net/distributions/ +PKG_MD5SUM:=ffcc7f4dcf2b79d667fe0c110e6cb724 + +PKG_FIXUP:=libtool no-autoreconf +PKG_BUILD_PARALLEL:=1 + +PHP5_MODULES = \ + apc \ + calendar ctype curl \ + fileinfo \ + dio dom \ + exif \ + ftp \ + gettext gd gmp \ + hash http \ + iconv \ + json \ + ldap libevent \ + mbstring mcrypt mysql mysqli \ + openssl \ + pcntl pdo pdo-mysql pdo-pgsql pdo-sqlite pgsql \ + session shmop simplexml soap sockets sqlite sqlite3 sysvmsg sysvsem sysvshm \ + tokenizer \ + xml xmlreader xmlwriter zip \ + +PKG_CONFIG_DEPENDS:= \ + CONFIG_PACKAGE_php5-cgi CONFIG_PACKAGE_php5-cli \ + $(patsubst %,CONFIG_PACKAGE_php5-mod-%,$(PHP5_MODULES)) \ + CONFIG_PHP5_FILTER CONFIG_PHP5_LIBXML CONFIG_PHP5_SYSTEMTZDATA + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/php5/Default + SUBMENU:=PHP + SECTION:=lang + CATEGORY:=Languages + TITLE:=PHP5 Hypertext preprocessor + URL:=http://www.php.net/ + MAINTAINER:=Michael Heimpold + DEPENDS:=php5 +endef + +define Package/php5/Default/description + PHP is a widely-used general-purpose scripting language that is especially + suited for Web development and can be embedded into HTML. +endef + +define Package/php5/config + config PHP5_FILTER + bool "PHP5 Filter support" + depends on PACKAGE_php5-cli || PACKAGE_php5-cgi + + config PHP5_LIBXML + bool "PHP5 LIBXML support" + depends on PACKAGE_php5-cli || PACKAGE_php5-cgi + + config PHP5_SYSTEMTZDATA + bool "Use system timezone data instead of php's built-in database" + depends on PACKAGE_php5-cli || PACKAGE_php5-cgi + select PACKAGE_zoneinfo-core + default y + help + Enabling this feature automatically selects the zoneinfo-core package + which contains data for UTC timezone. To use other timezones you have + to install the corresponding zoneinfo-... package(s). +endef + +define Package/php5 + $(call Package/php5/Default) + + DEPENDS:=+libpcre +zlib \ + +PHP5_LIBXML:libxml2 +endef + +define Package/php5/description + $(call Package/php5/Default/description) + This package contains only the PHP config file. You must actually choose + your PHP flavour (cli, cgi or fastcgi). +endef + +define Package/php5-cli + $(call Package/php5/Default) + TITLE+= (CLI) +endef + +define Package/php5-cli/description + $(call Package/php5/Default/description) + This package contains the CLI version of the PHP5 interpreter. +endef + +define Package/php5-cgi + $(call Package/php5/Default) + TITLE+= (CGI & FastCGI) +endef + +define Package/php5-cgi/description + $(call Package/php5/Default/description) + This package contains the CGI version of the PHP5 interpreter. +endef + +define Package/php5-fastcgi + $(call Package/php5/Default) + DEPENDS+= +php5-cgi + TITLE:=FastCGI startup script +endef + +define Package/php5-fastcgi/description + As FastCGI support is now a core feature the php5-fastcgi package now depends + on the php5-cgi package, containing just the startup script. +endef + +CONFIGURE_ARGS+= \ + --enable-shared \ + --disable-static \ + --disable-rpath \ + --disable-debug \ + --without-pear \ + \ + --with-config-file-path=/etc \ + --with-config-file-scan-dir=/etc/php5 \ + --disable-short-tags \ + \ + --with-zlib="$(STAGING_DIR)/usr" \ + --with-zlib-dir="$(STAGING_DIR)/usr" \ + --with-pcre-regex="$(STAGING_DIR)/usr" \ + --disable-phar + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-cli),) + CONFIGURE_ARGS+= --enable-cli +else + CONFIGURE_ARGS+= --disable-cli +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-cgi),) + CONFIGURE_ARGS+= --enable-cgi +else + CONFIGURE_ARGS+= --disable-cgi +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-apc),) + CONFIGURE_ARGS+= --enable-apc=shared --disable-apc-mmap --disable-apc-pthreadmutex +else + CONFIGURE_ARGS+= --disable-apc +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-calendar),) + CONFIGURE_ARGS+= --enable-calendar=shared +else + CONFIGURE_ARGS+= --disable-calendar +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-ctype),) + CONFIGURE_ARGS+= --enable-ctype=shared +else + CONFIGURE_ARGS+= --disable-ctype +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-curl),) + CONFIGURE_ARGS+= --with-curl=shared,"$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --without-curl +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-fileinfo),) + CONFIGURE_ARGS+= --enable-fileinfo=shared +else + CONFIGURE_ARGS+= --disable-fileinfo +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-gettext),) + CONFIGURE_ARGS+= --with-gettext=shared,"$(STAGING_DIR)/usr/lib/libintl-full" +else + CONFIGURE_ARGS+= --without-gettext +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-dio),) + CONFIGURE_ARGS+= --enable-dio=shared +else + CONFIGURE_ARGS+= --disable-dio +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-dom),) + CONFIGURE_ARGS+= --enable-dom=shared +else + CONFIGURE_ARGS+= --disable-dom +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-exif),) + CONFIGURE_ARGS+= --enable-exif=shared +else + CONFIGURE_ARGS+= --disable-exif +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-ftp),) + CONFIGURE_ARGS+= --enable-ftp=shared +else + CONFIGURE_ARGS+= --disable-ftp +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-gd),) + CONFIGURE_ARGS+= \ + --with-gd=shared \ + --without-freetype-dir \ + --with-jpeg-dir="$(STAGING_DIR)/usr" \ + --with-png-dir="$(STAGING_DIR)/usr" \ + --without-xpm-dir \ + --without-t1lib \ + --enable-gd-native-ttf \ + --disable-gd-jis-conv +else + CONFIGURE_ARGS+= --without-gd +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-gmp),) + CONFIGURE_ARGS+= --with-gmp=shared,"$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --without-gmp +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-hash),) + CONFIGURE_ARGS+= --enable-hash=shared +else + CONFIGURE_ARGS+= --disable-hash +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-http),) + CONFIGURE_ARGS+= \ + --enable-http=shared \ + --without-http-shared-deps \ + --with-http-curl-requests="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --disable-http +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-iconv),) + CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)" +else + CONFIGURE_ARGS+= --without-iconv +endif + +ifneq ($(CONFIG_PACKAGE_php5-mod-json),) + CONFIGURE_ARGS+= --enable-json=shared +else + CONFIGURE_ARGS+= --disable-json +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-ldap),) + CONFIGURE_ARGS+= \ + --with-ldap=shared,"$(STAGING_DIR)/usr" \ + --with-ldap-sasl="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --without-ldap +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-libevent),) + CONFIGURE_ARGS+= --with-libevent=shared,"$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --without-libevent +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-mbstring),) + CONFIGURE_ARGS+= --enable-mbstring=shared --enable-mbregex +else + CONFIGURE_ARGS+= --disable-mbstring +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-mcrypt),) + CONFIGURE_ARGS+= --with-mcrypt=shared,"$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --without-mcrypt +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-mysql),) + CONFIGURE_ARGS+= --with-mysql=shared,"$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --without-mysql +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-mysqli),) + CONFIGURE_ARGS+= --with-mysqli=shared,"$(STAGING_DIR)/usr/bin/mysql_config" +else + CONFIGURE_ARGS+= --without-mysqli +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-openssl),) + CONFIGURE_ARGS+= \ + --with-openssl=shared,"$(STAGING_DIR)/usr" \ + --with-kerberos=no \ + --with-openssl-dir="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --without-openssl +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-pcntl),) + CONFIGURE_ARGS+= --enable-pcntl=shared +else + CONFIGURE_ARGS+= --disable-pcntl +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-pdo),) + CONFIGURE_ARGS+= --enable-pdo=shared + ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-pdo-mysql),) + CONFIGURE_ARGS+= --with-pdo-mysql=shared,"$(STAGING_DIR)/usr" + else + CONFIGURE_ARGS+= --without-pdo-mysql + endif + ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-pdo-pgsql),) + CONFIGURE_ARGS+= --with-pdo-pgsql=shared,"$(STAGING_DIR)/usr" + else + CONFIGURE_ARGS+= --without-pdo-pgsql + endif + ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-pdo-sqlite),) + CONFIGURE_ARGS+= --with-pdo-sqlite=shared,"$(STAGING_DIR)/usr" + else + CONFIGURE_ARGS+= --without-pdo-sqlite + endif +else + CONFIGURE_ARGS+= --disable-pdo +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-pgsql),) + CONFIGURE_ARGS+= --with-pgsql=shared,"$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --without-pgsql +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-session),) + CONFIGURE_ARGS+= --enable-session=shared +else + CONFIGURE_ARGS+= --disable-session +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-shmop),) + CONFIGURE_ARGS+= --enable-shmop=shared +else + CONFIGURE_ARGS+= --disable-shmop +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-simplexml),) + CONFIGURE_ARGS+= --enable-simplexml=shared +else + CONFIGURE_ARGS+= --disable-simplexml +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-soap),) + CONFIGURE_ARGS+= --enable-soap=shared +else + CONFIGURE_ARGS+= --disable-soap +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-sockets),) + CONFIGURE_ARGS+= --enable-sockets=shared +else + CONFIGURE_ARGS+= --disable-sockets +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-sqlite),) + CONFIGURE_ARGS+= --with-sqlite=shared,"$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --without-sqlite +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-sqlite3),) + CONFIGURE_ARGS+= --with-sqlite3=shared,"$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --without-sqlite3 +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-sysvmsg),) + CONFIGURE_ARGS+= --enable-sysvmsg=shared +else + CONFIGURE_ARGS+= --disable-sysvmsg +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-sysvsem),) + CONFIGURE_ARGS+= --enable-sysvsem=shared +else + CONFIGURE_ARGS+= --disable-sysvsem +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-sysvshm),) + CONFIGURE_ARGS+= --enable-sysvshm=shared +else + CONFIGURE_ARGS+= --disable-sysvshm +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-tokenizer),) + CONFIGURE_ARGS+= --enable-tokenizer=shared +else + CONFIGURE_ARGS+= --disable-tokenizer +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-xml),) + CONFIGURE_ARGS+= --enable-xml=shared,"$(STAGING_DIR)/usr" + ifneq ($(CONFIG_PHP5_LIBXML),) + CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2" + else + CONFIGURE_ARGS+= --with-libexpat-dir="$(STAGING_DIR)/usr" + endif +else + CONFIGURE_ARGS+= --disable-xml +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-xmlreader),) + CONFIGURE_ARGS+= --enable-xmlreader=shared,"$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --disable-xmlreader +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-xmlwriter),) + CONFIGURE_ARGS+= --enable-xmlwriter=shared,"$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --disable-xmlwriter +endif + +ifneq ($(CONFIG_PACKAGE_php5-mod-zip),) + CONFIGURE_ARGS+= --enable-zip=shared +else + CONFIGURE_ARGS+= --disable-zip +endif + +ifneq ($(SDK)$(CONFIG_PHP5_FILTER),) + CONFIGURE_ARGS+= --enable-filter +else + CONFIGURE_ARGS+= --disable-filter +endif + +ifneq ($(SDK)$(CONFIG_PHP5_LIBXML),) + CONFIGURE_ARGS+= --enable-libxml + CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2" +else + CONFIGURE_ARGS+= --disable-libxml +endif + +ifneq ($(CONFIG_PHP5_SYSTEMTZDATA),) + CONFIGURE_ARGS+= --with-system-tzdata +else + CONFIGURE_ARGS+= --without-system-tzdata +endif + +CONFIGURE_VARS+= \ + ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no) \ + php_cv_cc_rpath="no" \ + iconv_impl_name="gnu_libiconv" \ + ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \ + +define Package/php5/conffiles +/etc/php.ini +endef + +define Package/php5/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/php.ini $(1)/etc/ +endef + +define Package/php5-cli/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/sapi/cli/php $(1)/usr/bin/php-cli +endef + +define Package/php5-cgi/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/sapi/cgi/php-cgi $(1)/usr/bin/php-cgi + ln -sf php-cgi $(1)/usr/bin/php-fcgi +endef + +define Package/php5-fastcgi/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/php5-fastcgi.config $(1)/etc/config/php5-fastcgi + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/php5-fastcgi.init $(1)/etc/init.d/php5-fastcgi +endef + +define Build/Prepare + $(call Build/Prepare/Default) + ( cd $(PKG_BUILD_DIR); touch configure.in; ./buildconf --force ) +endef + +define Build/InstallDev + mkdir -p $(PKG_BUILD_DIR)/staging/usr/bin + make -C $(PKG_BUILD_DIR) install INSTALL_ROOT=$(PKG_BUILD_DIR)/staging + rm -f $(PKG_BUILD_DIR)/staging/usr/bin/php + $(CP) $(PKG_BUILD_DIR)/staging/* $(STAGING_DIR_HOST) + sed -i -e "s#prefix='/usr'#prefix='$(STAGING_DIR_HOST)/usr'#" $(STAGING_DIR_HOST)/usr/bin/phpize + sed -i -e "s#exec_prefix=\"\`eval echo /usr\`\"#exec_prefix='$(STAGING_DIR_HOST)/usr'#" $(STAGING_DIR_HOST)/usr/bin/phpize +endef + +define BuildModule + + define Package/php5-mod-$(1) + $(call Package/php5/Default) + + ifneq ($(3),) + DEPENDS+=$(3) + endif + + TITLE:=$(2) shared module + endef + + define Package/php5-mod-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/php + $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/ + $(INSTALL_DIR) $$(1)/etc/php5 + echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php5/$(subst -,_,$(1)).ini + endef + + $$(eval $$(call BuildPackage,php5-mod-$(1))) + +endef + +$(eval $(call BuildPackage,php5)) +$(eval $(call BuildPackage,php5-cli)) +$(eval $(call BuildPackage,php5-cgi)) +$(eval $(call BuildPackage,php5-fastcgi)) + +#$(eval $(call BuildModule,NAME,TITLE[,PKG DEPENDS])) +$(eval $(call BuildModule,apc,APC,+PACKAGE_php5-mod-apc:librt)) +$(eval $(call BuildModule,calendar,Calendar)) +$(eval $(call BuildModule,ctype,Ctype)) +$(eval $(call BuildModule,curl,cURL,+PACKAGE_php5-mod-curl:libcurl)) +$(eval $(call BuildModule,fileinfo,Fileinfo,+PACKAGE_php5-mod-fileinfo:libmagic)) +$(eval $(call BuildModule,dio,Direct IO)) +$(eval $(call BuildModule,dom,DOM,+@PHP5_LIBXML +PACKAGE_php5-mod-dom:libxml2)) +$(eval $(call BuildModule,exif,EXIF)) +$(eval $(call BuildModule,ftp,FTP,+PACKAGE_php5-mod-ftp:libopenssl)) +$(eval $(call BuildModule,gettext,Gettext,+PACKAGE_php5-mod-gettext:libintl-full)) +$(eval $(call BuildModule,gd,GD graphics,+PACKAGE_php5-mod-gd:libjpeg +PACKAGE_php5-mod-gd:libpng)) +$(eval $(call BuildModule,gmp,GMP,+PACKAGE_php5-mod-gmp:libgmp)) +$(eval $(call BuildModule,hash,Hash)) +$(eval $(call BuildModule,http,HTTP,+PACKAGE_php5-mod-http:libcurl +PACKAGE_php5-mod-http:libevent2 +PACKAGE_php5-mod-http:librt)) +$(eval $(call BuildModule,iconv,iConv,+PACKAGE_php5-mod-iconv:libiconv)) +$(eval $(call BuildModule,json,JSON)) +$(eval $(call BuildModule,ldap,LDAP,+PACKAGE_php5-mod-ldap:libopenldap +PACKAGE_php5-mod-ldap:libsasl2)) +$(eval $(call BuildModule,libevent,libevent,+PACKAGE_php5-mod-libevent:libevent2)) +$(eval $(call BuildModule,mbstring,MBString)) +$(eval $(call BuildModule,mcrypt,Mcrypt,+PACKAGE_php5-mod-mcrypt:libmcrypt +PACKAGE_php5-mod-mcrypt:libltdl)) +$(eval $(call BuildModule,mysql,MySQL,+PACKAGE_php5-mod-mysql:libmysqlclient)) +$(eval $(call BuildModule,mysqli,MySQL Improved Extension,+PACKAGE_php5-mod-mysqli:libmysqlclient)) +$(eval $(call BuildModule,openssl,OpenSSL,+PACKAGE_php5-mod-openssl:libopenssl)) +$(eval $(call BuildModule,pcntl,PCNTL)) +$(eval $(call BuildModule,pdo,PHP Data Objects)) +$(eval $(call BuildModule,pdo-mysql,PDO driver for MySQL,+php5-mod-pdo +PACKAGE_php5-mod-pdo-mysql:libmysqlclient)) +$(eval $(call BuildModule,pdo-pgsql,PDO driver for PostgreSQL,+php5-mod-pdo +PACKAGE_php5-mod-pdo-pgsql:libpq)) +$(eval $(call BuildModule,pdo-sqlite,PDO driver for SQLite 3.x,+php5-mod-pdo +PACKAGE_php5-mod-pdo-sqlite:libsqlite3 +PACKAGE_php5-mod-pdo-sqlite:libpthread +PACKAGE_php5-mod-pdo-sqlite:librt)) +$(eval $(call BuildModule,pgsql,PostgreSQL,+PACKAGE_php5-mod-pgsql:libpq)) +$(eval $(call BuildModule,session,Session)) +$(eval $(call BuildModule,shmop,Shared Memory)) +$(eval $(call BuildModule,simplexml,SimpleXML,+@PHP5_LIBXML +PACKAGE_php5-mod-simplexml:libxml2)) +$(eval $(call BuildModule,soap,SOAP,+@PHP5_LIBXML +PACKAGE_php5-mod-soap:libxml2)) +$(eval $(call BuildModule,sockets,Sockets)) +$(eval $(call BuildModule,sqlite,SQLite 2.x,+PACKAGE_php5-mod-sqlite:libsqlite2)) +$(eval $(call BuildModule,sqlite3,SQLite3,+PACKAGE_php5-mod-sqlite3:libsqlite3 +PACKAGE_php5-mod-sqlite3:libpthread)) +$(eval $(call BuildModule,sysvmsg,System V messages)) +$(eval $(call BuildModule,sysvsem,System V shared memory)) +$(eval $(call BuildModule,sysvshm,System V semaphore)) +$(eval $(call BuildModule,tokenizer,Tokenizer)) +$(eval $(call BuildModule,xml,XML,+PHP5_LIBXML:libxml2 +!PHP5_LIBXML:libexpat)) +$(eval $(call BuildModule,xmlreader,XMLReader,+@PHP5_LIBXML +PACKAGE_php5-mod-xmlreader:libxml2 +PACKAGE_php5-mod-xmlreader:libiconv)) +$(eval $(call BuildModule,xmlwriter,XMLWriter,+@PHP5_LIBXML +PACKAGE_php5-mod-xmlwriter:libxml2 +PACKAGE_php5-mod-xmlwriter:libiconv)) +$(eval $(call BuildModule,zip,ZIP,+PACKAGE_php5-mod-zip:zlib)) diff --git a/lang/php5/files/php.ini b/lang/php5/files/php.ini new file mode 100644 index 0000000..6fe2a31 --- /dev/null +++ b/lang/php5/files/php.ini @@ -0,0 +1,311 @@ +[PHP] + +zend.ze1_compatibility_mode = Off + +; Language Options + +engine = On +;short_open_tag = Off +precision = 12 +y2k_compliance = On +output_buffering = Off +;output_handler = +zlib.output_compression = Off +;zlib.output_compression_level = -1 +;zlib.output_handler = +implicit_flush = Off +unserialize_callback_func = +serialize_precision = 100 + +;open_basedir = +disable_functions = +disable_classes = + +; Colors for Syntax Highlighting mode. Anything that's acceptable in +; would work. +;highlight.string = #DD0000 +;highlight.comment = #FF9900 +;highlight.keyword = #007700 +;highlight.bg = #FFFFFF +;highlight.default = #0000BB +;highlight.html = #000000 + +;ignore_user_abort = On +;realpath_cache_size = 16k +;realpath_cache_ttl = 120 + +; Miscellaneous + +expose_php = On + +; Resource Limits + +max_execution_time = 30 ; Maximum execution time of each script, in seconds. +max_input_time = 60 ; Maximum amount of time each script may spend parsing request data. +;max_input_nesting_level = 64 +memory_limit = 8M ; Maximum amount of memory a script may consume. + +; Error handling and logging + +; Error Level Constants: +; E_ALL - All errors and warnings (includes E_STRICT as of PHP 6.0.0) +; E_ERROR - fatal run-time errors +; E_RECOVERABLE_ERROR - almost fatal run-time errors +; E_WARNING - run-time warnings (non-fatal errors) +; E_PARSE - compile-time parse errors +; E_NOTICE - run-time notices (these are warnings which often result +; from a bug in your code, but it's possible that it was +; intentional (e.g., using an uninitialized variable and +; relying on the fact it's automatically initialized to an +; empty string) +; E_STRICT - run-time notices, enable to have PHP suggest changes +; to your code which will ensure the best interoperability +; and forward compatibility of your code +; E_CORE_ERROR - fatal errors that occur during PHP's initial startup +; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's +; initial startup +; E_COMPILE_ERROR - fatal compile-time errors +; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) +; E_USER_ERROR - user-generated error message +; E_USER_WARNING - user-generated warning message +; E_USER_NOTICE - user-generated notice message +; E_DEPRECATED - warn about code that will not work in future versions +; of PHP +; E_USER_DEPRECATED - user-generated deprecation warnings +; +; Common Values: +; E_ALL & ~E_NOTICE (Show all errors, except for notices and coding standards warnings.) +; E_ALL & ~E_NOTICE | E_STRICT (Show all errors, except for notices) +; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) +; E_ALL | E_STRICT (Show all errors, warnings and notices including coding standards.) +; Default Value: E_ALL & ~E_NOTICE +error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT + +display_errors = On +display_startup_errors = Off +log_errors = Off +log_errors_max_len = 1024 +ignore_repeated_errors = Off +ignore_repeated_source = Off +report_memleaks = On +;report_zend_debug = 0 +track_errors = Off +;html_errors = Off +;docref_root = "/phpmanual/" +;docref_ext = .html +;error_prepend_string = "" +;error_append_string = "" +; Log errors to specified file. +;error_log = /var/log/php_errors.log +; Log errors to syslog. +;error_log = syslog + +; Data Handling + +;arg_separator.output = "&" +;arg_separator.input = ";&" +variables_order = "EGPCS" +request_order = "GP" +register_globals = Off +register_long_arrays = Off +register_argc_argv = On +auto_globals_jit = On +post_max_size = 8M +;magic_quotes_gpc = Off +magic_quotes_runtime = Off +magic_quotes_sybase = Off +auto_prepend_file = +auto_append_file = +default_mimetype = "text/html" +;default_charset = "iso-8859-1" +;always_populate_raw_post_data = On + +; Paths and Directories + +; UNIX: "/path1:/path2" +;include_path = ".:/php/includes" +doc_root = "/www" +user_dir = +extension_dir = "/usr/lib/php" +enable_dl = On +;cgi.force_redirect = 1 +;cgi.nph = 1 +;cgi.redirect_status_env = ; +cgi.fix_pathinfo=1 +;fastcgi.impersonate = 1; +;fastcgi.logging = 0 +;cgi.rfc2616_headers = 0 + +; File Uploads + +file_uploads = On +upload_tmp_dir = "/tmp" +upload_max_filesize = 2M +max_file_uploads = 20 + +; Fopen wrappers + +allow_url_fopen = On +allow_url_include = Off +;from="john@doe.com" +;user_agent="PHP" +default_socket_timeout = 60 +;auto_detect_line_endings = Off + +; Dynamic Extensions + +;extension=ctype.so +;extension=curl.so +;extension=dom.so +;extension=exif.so +;extension=ftp.so +;extension=gd.so +;extension=gmp.so +;extension=hash.so +;extension=iconv.so +;extension=json.so +;extension=ldap.so +;extension=mbstring.so +;extension=mcrypt.so +;extension=mysql.so +;extension=openssl.so +;extension=pcre.so +;extension=pdo.so +;extension=pdo-mysql.so +;extension=pdo-pgsql.so +;extension=pdo_sqlite.so +;extension=pgsql.so +;extension=session.so +;extension=soap.so +;extension=sockets.so +;extension=sqlite.so +;extension=sqlite3.so +;extension=tokenizer.so +;extension=xml.so +;extension=xmlreader.so +;extension=xmlwriter.so + +; Module Settings + +[APC] +apc.enabled = 1 +apc.shm_segments = 1 ;The number of shared memory segments to allocate for the compiler cache. +apc.shm_size = 4M ;The size of each shared memory segment. + +[Date] +;date.timezone = +;date.default_latitude = 31.7667 +;date.default_longitude = 35.2333 +;date.sunrise_zenith = 90.583333 +;date.sunset_zenith = 90.583333 + +[filter] +;filter.default = unsafe_raw +;filter.default_flags = + +[iconv] +;iconv.input_encoding = ISO-8859-1 +;iconv.internal_encoding = ISO-8859-1 +;iconv.output_encoding = ISO-8859-1 + +[sqlite] +;sqlite.assoc_case = 0 + +[sqlite3] +;sqlite3.extension_dir = + +[Pdo_mysql] +pdo_mysql.cache_size = 2000 +pdo_mysql.default_socket= + +[MySQL] +mysql.allow_local_infile = On +mysql.allow_persistent = On +mysql.cache_size = 2000 +mysql.max_persistent = -1 +mysql.max_links = -1 +mysql.default_port = +mysql.default_socket = +mysql.default_host = +mysql.default_user = +mysql.default_password = +mysql.connect_timeout = 60 +mysql.trace_mode = Off + +[PostgresSQL] +pgsql.allow_persistent = On +pgsql.auto_reset_persistent = Off +pgsql.max_persistent = -1 +pgsql.max_links = -1 +pgsql.ignore_notice = 0 +pgsql.log_notice = 0 + +[Session] +session.save_handler = files +session.save_path = "/tmp" +session.use_cookies = 1 +;session.cookie_secure = +session.use_only_cookies = 1 +session.name = PHPSESSID +session.auto_start = 0 +session.cookie_lifetime = 0 +session.cookie_path = / +session.cookie_domain = +session.cookie_httponly = +session.serialize_handler = php +session.gc_probability = 1 +session.gc_divisor = 100 +session.gc_maxlifetime = 1440 +session.bug_compat_42 = On +session.bug_compat_warn = On +session.referer_check = +session.entropy_length = 0 +;session.entropy_file = /dev/urandom +session.entropy_file = +;session.entropy_length = 16 +session.cache_limiter = nocache +session.cache_expire = 180 +session.use_trans_sid = 0 +session.hash_function = 0 +session.hash_bits_per_character = 4 +url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset=" + +[mbstring] +;mbstring.language = Japanese +;mbstring.internal_encoding = EUC-JP +;mbstring.http_input = auto +;mbstring.http_output = SJIS +;mbstring.encoding_translation = Off +;mbstring.detect_order = auto +;mbstring.substitute_character = none; +;mbstring.func_overload = 0 +;mbstring.strict_detection = Off +;mbstring.http_output_conv_mimetype= +;mbstring.script_encoding= + +[gd] +;gd.jpeg_ignore_warning = 0 + +[exif] +;exif.encode_unicode = ISO-8859-15 +;exif.decode_unicode_motorola = UCS-2BE +;exif.decode_unicode_intel = UCS-2LE +;exif.encode_jis = +;exif.decode_jis_motorola = JIS +;exif.decode_jis_intel = JIS + +[soap] +soap.wsdl_cache_enabled=1 +soap.wsdl_cache_dir="/tmp" +soap.wsdl_cache_ttl=86400 +soap.wsdl_cache_limit = 5 + +[sysvshm] +;sysvshm.init_mem = 10000 + +[ldap] +ldap.max_links = -1 + +[mcrypt] +;mcrypt.algorithms_dir= +;mcrypt.modes_dir= diff --git a/lang/php5/files/php5-fastcgi.config b/lang/php5/files/php5-fastcgi.config new file mode 100644 index 0000000..039d3bb --- /dev/null +++ b/lang/php5/files/php5-fastcgi.config @@ -0,0 +1,3 @@ +config php5-fastcgi + option enabled 1 + option port '1026' diff --git a/lang/php5/files/php5-fastcgi.init b/lang/php5/files/php5-fastcgi.init new file mode 100644 index 0000000..0c452ad --- /dev/null +++ b/lang/php5/files/php5-fastcgi.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org + +START=50 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +start_instance() { + local section="$1" + local enabled + local port + + config_get_bool enabled "$section" 'enabled' 0 + config_get port "$section" 'port' 1026 + + [ $enabled -gt 0 ] || return 1 + + PHP_FCGI_CHILDREN='' \ + service_start /usr/bin/php-fcgi -b $port +} + +start() { + config_load 'php5-fastcgi' + config_foreach start_instance 'php5-fastcgi' +} + +stop() { + service_stop /usr/bin/php-fcgi +} diff --git a/lang/php5/patches/005-APC.patch b/lang/php5/patches/005-APC.patch new file mode 100644 index 0000000..b6c5e3b --- /dev/null +++ b/lang/php5/patches/005-APC.patch @@ -0,0 +1,22543 @@ +diff -Naur a/ext/apc/apc_bin.c b/ext/apc/apc_bin.c +--- a/ext/apc/apc_bin.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_bin.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,987 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Brian Shire | ++ +----------------------------------------------------------------------+ ++ ++ */ ++ ++/* $Id: apc_bin.c 324017 2012-03-08 09:46:22Z pajoye $ */ ++ ++/* Creates a binary architecture specific output to a string or file containing ++ * the current cache contents for both fies and user variables. This is accomplished ++ * via the apc_copy_* functions and "swizzling" pointer values to a position ++ * independent value, and unswizzling them on restoration. ++ */ ++ ++#include "apc_globals.h" ++#include "apc_bin.h" ++#include "apc_zend.h" ++#include "apc_php.h" ++#include "apc_sma.h" ++#include "apc_pool.h" ++#include "ext/standard/md5.h" ++#include "ext/standard/crc32.h" ++ ++extern apc_cache_t* apc_cache; ++extern apc_cache_t* apc_user_cache; ++ ++extern int _apc_store(char *strkey, int strkey_len, const zval *val, const uint ttl, const int exclusive TSRMLS_DC); /* this is hacky */ ++ ++#define APC_BINDUMP_DEBUG 0 ++ ++ ++#if APC_BINDUMP_DEBUG ++ ++#define SWIZZLE(bd, ptr) \ ++ do { \ ++ if((long)bd < (long)ptr && (ulong)ptr < ((long)bd + bd->size)) { \ ++ printf("SWIZZLE: %x ~> ", ptr); \ ++ ptr = (void*)((long)(ptr) - (long)(bd)); \ ++ printf("%x in %s on line %d", ptr, __FILE__, __LINE__); \ ++ } else if((long)ptr > bd->size) { /* not swizzled */ \ ++ apc_error("pointer to be swizzled is not within allowed memory range! (%x < %x < %x) in %s on %d" TSRMLS_CC, (long)bd, ptr, ((long)bd + bd->size), __FILE__, __LINE__); \ ++ return; \ ++ } \ ++ printf("\n"); \ ++ } while(0); ++ ++#define UNSWIZZLE(bd, ptr) \ ++ do { \ ++ printf("UNSWIZZLE: %x -> ", ptr); \ ++ ptr = (void*)((long)(ptr) + (long)(bd)); \ ++ printf("%x in %s on line %d \n", ptr, __FILE__, __LINE__); \ ++ } while(0); ++ ++#else /* !APC_BINDUMP_DEBUG */ ++ ++#define SWIZZLE(bd, ptr) \ ++ do { \ ++ if((long)bd < (long)ptr && (ulong)ptr < ((long)bd + bd->size)) { \ ++ ptr = (void*)((long)(ptr) - (long)(bd)); \ ++ } else if((ulong)ptr > bd->size) { /* not swizzled */ \ ++ apc_error("pointer to be swizzled is not within allowed memory range! (%x < %x < %x) in %s on %d" TSRMLS_CC, (long)bd, ptr, ((long)bd + bd->size), __FILE__, __LINE__); \ ++ return NULL; \ ++ } \ ++ } while(0); ++ ++#define UNSWIZZLE(bd, ptr) \ ++ do { \ ++ ptr = (void*)((long)(ptr) + (long)(bd)); \ ++ } while(0); ++ ++#endif ++ ++ ++static void *apc_bd_alloc(size_t size TSRMLS_DC); ++static void apc_bd_free(void *ptr TSRMLS_DC); ++static void *apc_bd_alloc_ex(void *ptr_new, size_t size TSRMLS_DC); ++ ++typedef void (*apc_swizzle_cb_t)(apc_bd_t *bd, zend_llist *ll, void *ptr TSRMLS_DC); ++ ++#if APC_BINDUMP_DEBUG ++#define apc_swizzle_ptr(bd, ll, ptr) _apc_swizzle_ptr(bd, ll, (void*)ptr, __FILE__, __LINE__ TSRMLS_CC) ++#else ++#define apc_swizzle_ptr(bd, ll, ptr) _apc_swizzle_ptr(bd, ll, (void*)ptr, NULL, 0 TSRMLS_CC) ++#endif ++ ++static void _apc_swizzle_ptr(apc_bd_t *bd, zend_llist *ll, void **ptr, const char* file, int line TSRMLS_DC); ++static void apc_swizzle_function(apc_bd_t *bd, zend_llist *ll, zend_function *func TSRMLS_DC); ++static void apc_swizzle_class_entry(apc_bd_t *bd, zend_llist *ll, zend_class_entry *ce TSRMLS_DC); ++static void apc_swizzle_hashtable(apc_bd_t *bd, zend_llist *ll, HashTable *ht, apc_swizzle_cb_t swizzle_cb, int is_ptr TSRMLS_DC); ++static void apc_swizzle_zval(apc_bd_t *bd, zend_llist *ll, zval *zv TSRMLS_DC); ++static void apc_swizzle_op_array(apc_bd_t *bd, zend_llist *ll, zend_op_array *op_array TSRMLS_DC); ++static void apc_swizzle_property_info(apc_bd_t *bd, zend_llist *ll, zend_property_info *pi TSRMLS_DC); ++static void apc_swizzle_function_entry(apc_bd_t *bd, zend_llist *ll, const zend_function_entry *fe TSRMLS_DC); ++static void apc_swizzle_arg_info_array(apc_bd_t *bd, zend_llist *ll, const zend_arg_info* arg_info_array, uint num_args TSRMLS_DC); ++ ++static apc_bd_t* apc_swizzle_bd(apc_bd_t* bd, zend_llist *ll TSRMLS_DC); ++static int apc_unswizzle_bd(apc_bd_t *bd, int flags TSRMLS_DC); ++ ++ ++/* {{{ apc_bd_alloc ++ * callback for copy_* functions */ ++static void *apc_bd_alloc(size_t size TSRMLS_DC) { ++ return apc_bd_alloc_ex(NULL, size TSRMLS_CC); ++} /* }}} */ ++ ++ ++/* {{{ apc_bd_free ++ * callback for copy_* functions */ ++static void apc_bd_free(void *ptr TSRMLS_DC) { ++ size_t *size; ++ if(zend_hash_index_find(&APCG(apc_bd_alloc_list), (ulong)ptr, (void**)&size) == FAILURE) { ++ apc_error("apc_bd_free could not free pointer (not found in list: %x)" TSRMLS_CC, ptr); ++ return; ++ } ++ APCG(apc_bd_alloc_ptr) = (void*)((size_t)APCG(apc_bd_alloc_ptr) - *size); ++ zend_hash_index_del(&APCG(apc_bd_alloc_list), (ulong)ptr); ++} /* }}} */ ++ ++ ++/* {{{ apc_bd_alloc_ex ++ * set ranges or allocate a block of data from an already (e)malloc'd range. ++ * if ptr_new is not NULL, it will reset the pointer to start at ptr_new, ++ * with a range of size. If ptr_new is NULL, returns the next available ++ * block of given size. ++ */ ++static void *apc_bd_alloc_ex(void *ptr_new, size_t size TSRMLS_DC) { ++ void *rval; ++ ++ rval = APCG(apc_bd_alloc_ptr); ++ if(ptr_new != NULL) { /* reset ptrs */ ++ APCG(apc_bd_alloc_ptr) = ptr_new; ++ APCG(apc_bd_alloc_ubptr) = (void*)((unsigned char *) ptr_new + size); ++ } else { /* alloc block */ ++ APCG(apc_bd_alloc_ptr) = (void*)((size_t)APCG(apc_bd_alloc_ptr) + size); ++#if APC_BINDUMP_DEBUG ++ apc_notice("apc_bd_alloc: rval: 0x%x ptr: 0x%x ubptr: 0x%x size: %d" TSRMLS_CC, rval, APCG(apc_bd_alloc_ptr), APCG(apc_bd_alloc_ubptr), size); ++#endif ++ if(APCG(apc_bd_alloc_ptr) > APCG(apc_bd_alloc_ubptr)) { ++ apc_error("Exceeded bounds check in apc_bd_alloc_ex by %d bytes." TSRMLS_CC, (unsigned char *) APCG(apc_bd_alloc_ptr) - (unsigned char *) APCG(apc_bd_alloc_ubptr)); ++ return NULL; ++ } ++ zend_hash_index_update(&APCG(apc_bd_alloc_list), (ulong)rval, &size, sizeof(size_t), NULL); ++ } ++ ++ return rval; ++} /* }}} */ ++ ++ ++/* {{{ _apc_swizzle_ptr */ ++static void _apc_swizzle_ptr(apc_bd_t *bd, zend_llist *ll, void **ptr, const char* file, int line TSRMLS_DC) { ++ if(*ptr) { ++ if((long)bd < (long)*ptr && (ulong)*ptr < ((long)bd + bd->size)) { ++ zend_llist_add_element(ll, &ptr); ++#if APC_BINDUMP_DEBUG ++ printf("[%06d] apc_swizzle_ptr: %x -> %x ", zend_llist_count(ll), ptr, *ptr); ++ printf(" in %s on line %d \n", file, line); ++#endif ++ } else if((ulong)ptr > bd->size) { ++ apc_error("pointer to be swizzled is not within allowed memory range! (%x < %x < %x) in %s on %d" TSRMLS_CC, (long)bd, *ptr, ((long)bd + bd->size), file, line); \ ++ return; ++ } ++ } ++} /* }}} */ ++ ++ ++/* {{{ apc_swizzle_op_array */ ++static void apc_swizzle_op_array(apc_bd_t *bd, zend_llist *ll, zend_op_array *op_array TSRMLS_DC) { ++ uint i; ++ ++#ifdef ZEND_ENGINE_2 ++ apc_swizzle_arg_info_array(bd, ll, op_array->arg_info, op_array->num_args TSRMLS_CC); ++ apc_swizzle_ptr(bd, ll, &op_array->arg_info); ++#else ++ if (op_array->arg_types) { ++ apc_swizzle_ptr(bd, ll, &op_array->arg_types); ++ } ++#endif ++ ++ apc_swizzle_ptr(bd, ll, &op_array->function_name); ++ apc_swizzle_ptr(bd, ll, &op_array->filename); ++ apc_swizzle_ptr(bd, ll, &op_array->refcount); ++ ++ /* swizzle op_array */ ++ for(i=0; i < op_array->last; i++) { ++#ifndef ZEND_ENGINE_2_4 ++ if(op_array->opcodes[i].result.op_type == IS_CONST) { ++ apc_swizzle_zval(bd, ll, &op_array->opcodes[i].result.u.constant TSRMLS_CC); ++ } ++ if(op_array->opcodes[i].op1.op_type == IS_CONST) { ++ apc_swizzle_zval(bd, ll, &op_array->opcodes[i].op1.u.constant TSRMLS_CC); ++ } ++ if(op_array->opcodes[i].op2.op_type == IS_CONST) { ++ apc_swizzle_zval(bd, ll, &op_array->opcodes[i].op2.u.constant TSRMLS_CC); ++ } ++#endif ++ switch (op_array->opcodes[i].opcode) { ++ case ZEND_JMP: ++#ifdef ZEND_ENGINE_2_4 ++ apc_swizzle_ptr(bd, ll, &op_array->opcodes[i].op1.jmp_addr); ++#else ++ apc_swizzle_ptr(bd, ll, &op_array->opcodes[i].op1.u.jmp_addr); ++#endif ++ case ZEND_JMPZ: ++ case ZEND_JMPNZ: ++ case ZEND_JMPZ_EX: ++ case ZEND_JMPNZ_EX: ++#ifdef ZEND_ENGINE_2_4 ++ apc_swizzle_ptr(bd, ll, &op_array->opcodes[i].op2.jmp_addr); ++#else ++ apc_swizzle_ptr(bd, ll, &op_array->opcodes[i].op2.u.jmp_addr); ++#endif ++ } ++ } ++ apc_swizzle_ptr(bd, ll, &op_array->opcodes); ++ ++ /* break-continue array ptr */ ++ if(op_array->brk_cont_array) { ++ apc_swizzle_ptr(bd, ll, &op_array->brk_cont_array); ++ } ++ ++ /* static voriables */ ++ if(op_array->static_variables) { ++ apc_swizzle_hashtable(bd, ll, op_array->static_variables, (apc_swizzle_cb_t)apc_swizzle_zval, 1 TSRMLS_CC); ++ apc_swizzle_ptr(bd, ll, &op_array->static_variables); ++ } ++ ++#ifdef ZEND_ENGINE_2 ++ /* try-catch */ ++ if(op_array->try_catch_array) { ++ apc_swizzle_ptr(bd, ll, &op_array->try_catch_array); ++ } ++#endif ++ ++#ifdef ZEND_ENGINE_2_1 /* PHP 5.1 */ ++ /* vars */ ++ if(op_array->vars) { ++ for(i=0; (signed int) i < op_array->last_var; i++) { ++ apc_swizzle_ptr(bd, ll, &op_array->vars[i].name); ++ } ++ apc_swizzle_ptr(bd, ll, &op_array->vars); ++ } ++#endif ++ ++#ifdef ZEND_ENGINE_2 ++ /* doc comment */ ++ if(op_array->doc_comment) { ++ apc_swizzle_ptr(bd, ll, &op_array->doc_comment); ++ } ++#endif ++ ++} /* }}} */ ++ ++ ++/* {{{ apc_swizzle_function */ ++static void apc_swizzle_function(apc_bd_t *bd, zend_llist *ll, zend_function *func TSRMLS_DC) { ++ apc_swizzle_op_array(bd, ll, &func->op_array TSRMLS_CC); ++#ifdef ZEND_ENGINE_2 ++ if(func->common.scope) { ++ apc_swizzle_ptr(bd, ll, &func->common.scope); ++ } ++#endif ++} /* }}} */ ++ ++ ++/* {{{ apc_swizzle_class_entry */ ++static void apc_swizzle_class_entry(apc_bd_t *bd, zend_llist *ll, zend_class_entry *ce TSRMLS_DC) { ++ ++ uint i; ++ ++ if(ce->name) { ++ apc_swizzle_ptr(bd, ll, &ce->name); ++ } ++ ++ if (ce->type == ZEND_USER_CLASS && ZEND_CE_DOC_COMMENT(ce)) { ++ apc_swizzle_ptr(bd, ll, &ZEND_CE_DOC_COMMENT(ce)); ++ } ++ ++#ifndef ZEND_ENGINE_2 ++ apc_swizzle_ptr(bd, ll, &ce->refcount); ++#endif ++ ++ apc_swizzle_hashtable(bd, ll, &ce->function_table, (apc_swizzle_cb_t)apc_swizzle_function, 0 TSRMLS_CC); ++#ifdef ZEND_ENGINE_2_4 ++ if (ce->default_properties_table) { ++ for (i = 0; i < ce->default_properties_count; i++) { ++ if (ce->default_properties_table[i]) { ++ apc_swizzle_ptr(bd, ll, &ce->default_properties_table[i]); ++ apc_swizzle_zval(bd, ll, ce->default_properties_table[i] TSRMLS_CC); ++ } ++ } ++ } ++#else ++ apc_swizzle_hashtable(bd, ll, &ce->default_properties, (apc_swizzle_cb_t)apc_swizzle_zval, 1 TSRMLS_CC); ++#endif ++ ++#ifdef ZEND_ENGINE_2 ++ apc_swizzle_hashtable(bd, ll, &ce->properties_info, (apc_swizzle_cb_t)apc_swizzle_property_info, 0 TSRMLS_CC); ++#endif ++ ++#ifdef ZEND_ENGINE_2_4 ++ if (ce->default_static_members_table) { ++ for (i = 0; i < ce->default_static_members_count; i++) { ++ if (ce->default_static_members_table[i]) { ++ apc_swizzle_ptr(bd, ll, &ce->default_static_members_table[i]); ++ apc_swizzle_zval(bd, ll, ce->default_static_members_table[i] TSRMLS_CC); ++ } ++ } ++ } ++ ce->static_members_table = ce->default_static_members_table; ++#else ++ apc_swizzle_hashtable(bd, ll, &ce->default_static_members, (apc_swizzle_cb_t)apc_swizzle_zval, 1 TSRMLS_CC); ++ ++ if(ce->static_members != &ce->default_static_members) { ++ apc_swizzle_hashtable(bd, ll, ce->static_members, (apc_swizzle_cb_t)apc_swizzle_zval, 1 TSRMLS_CC); ++ } else { ++ apc_swizzle_ptr(bd, ll, &ce->static_members); ++ } ++#endif ++ ++ apc_swizzle_hashtable(bd, ll, &ce->constants_table, (apc_swizzle_cb_t)apc_swizzle_zval, 1 TSRMLS_CC); ++ ++ if(ce->type == ZEND_INTERNAL_CLASS && ZEND_CE_BUILTIN_FUNCTIONS(ce)) { ++ for(i=0; ZEND_CE_BUILTIN_FUNCTIONS(ce)[i].fname; i++) { ++ apc_swizzle_function_entry(bd, ll, &ZEND_CE_BUILTIN_FUNCTIONS(ce)[i] TSRMLS_CC); ++ } ++ } ++ ++ apc_swizzle_ptr(bd, ll, &ce->constructor); ++ apc_swizzle_ptr(bd, ll, &ce->destructor); ++ apc_swizzle_ptr(bd, ll, &ce->clone); ++ apc_swizzle_ptr(bd, ll, &ce->__get); ++ apc_swizzle_ptr(bd, ll, &ce->__set); ++ apc_swizzle_ptr(bd, ll, &ce->__unset); ++ apc_swizzle_ptr(bd, ll, &ce->__isset); ++ apc_swizzle_ptr(bd, ll, &ce->__call); ++ apc_swizzle_ptr(bd, ll, &ce->serialize_func); ++ apc_swizzle_ptr(bd, ll, &ce->unserialize_func); ++ ++#ifdef ZEND_ENGINE_2_2 ++ apc_swizzle_ptr(bd, ll, &ce->__tostring); ++#endif ++ ++ if (ce->type == ZEND_USER_CLASS) { ++ apc_swizzle_ptr(bd, ll, &ZEND_CE_FILENAME(ce)); ++ } ++} /* }}} */ ++ ++ ++/* {{{ apc_swizzle_property_info */ ++static void apc_swizzle_property_info(apc_bd_t *bd, zend_llist *ll, zend_property_info *pi TSRMLS_DC) { ++ apc_swizzle_ptr(bd, ll, &pi->name); ++ apc_swizzle_ptr(bd, ll, &pi->doc_comment); ++ ++#ifdef ZEND_ENGINE_2_2 ++ apc_swizzle_ptr(bd, ll, &pi->ce); ++#endif ++} /* }}} */ ++ ++ ++/* {{{ apc_swizzle_function_entry */ ++static void apc_swizzle_function_entry(apc_bd_t *bd, zend_llist *ll, const zend_function_entry *fe TSRMLS_DC) { ++ apc_swizzle_ptr(bd, ll, &fe->fname); ++ apc_swizzle_arg_info_array(bd, ll, fe->arg_info, fe->num_args TSRMLS_CC); ++ apc_swizzle_ptr(bd, ll, &fe->arg_info); ++} /* }}} */ ++ ++ ++/* {{{ apc_swizzle_arg_info_array */ ++static void apc_swizzle_arg_info_array(apc_bd_t *bd, zend_llist *ll, const zend_arg_info* arg_info_array, uint num_args TSRMLS_DC) { ++ if(arg_info_array) { ++ uint i; ++ ++ for(i=0; i < num_args; i++) { ++ apc_swizzle_ptr(bd, ll, &arg_info_array[i].name); ++ apc_swizzle_ptr(bd, ll, &arg_info_array[i].class_name); ++ } ++ } ++ ++} /* }}} */ ++ ++ ++/* {{{ apc_swizzle_hashtable */ ++static void apc_swizzle_hashtable(apc_bd_t *bd, zend_llist *ll, HashTable *ht, apc_swizzle_cb_t swizzle_cb, int is_ptr TSRMLS_DC) { ++ uint i; ++ Bucket **bp, **bp_prev; ++ ++ bp = &ht->pListHead; ++ while(*bp) { ++ bp_prev = bp; ++ bp = &(*bp)->pListNext; ++ if(is_ptr) { ++ swizzle_cb(bd, ll, *(void**)(*bp_prev)->pData TSRMLS_CC); ++ apc_swizzle_ptr(bd, ll, (*bp_prev)->pData); ++ } else { ++ swizzle_cb(bd, ll, (void**)(*bp_prev)->pData TSRMLS_CC); ++ } ++ apc_swizzle_ptr(bd, ll, &(*bp_prev)->pData); ++ if((*bp_prev)->pDataPtr) { ++ apc_swizzle_ptr(bd, ll, &(*bp_prev)->pDataPtr); ++ } ++ if((*bp_prev)->pListLast) { ++ apc_swizzle_ptr(bd, ll, &(*bp_prev)->pListLast); ++ } ++ if((*bp_prev)->pNext) { ++ apc_swizzle_ptr(bd, ll, &(*bp_prev)->pNext); ++ } ++ if((*bp_prev)->pLast) { ++ apc_swizzle_ptr(bd, ll, &(*bp_prev)->pLast); ++ } ++ apc_swizzle_ptr(bd, ll, bp_prev); ++ } ++ for(i=0; i < ht->nTableSize; i++) { ++ if(ht->arBuckets[i]) { ++ apc_swizzle_ptr(bd, ll, &ht->arBuckets[i]); ++ } ++ } ++ apc_swizzle_ptr(bd, ll, &ht->pListTail); ++ ++ apc_swizzle_ptr(bd, ll, &ht->arBuckets); ++} /* }}} */ ++ ++ ++/* {{{ apc_swizzle_zval */ ++static void apc_swizzle_zval(apc_bd_t *bd, zend_llist *ll, zval *zv TSRMLS_DC) { ++ ++ if(APCG(copied_zvals).nTableSize) { ++ if(zend_hash_index_exists(&APCG(copied_zvals), (ulong)zv)) { ++ return; ++ } ++ zend_hash_index_update(&APCG(copied_zvals), (ulong)zv, (void**)&zv, sizeof(zval*), NULL); ++ } ++ ++ switch(zv->type & IS_CONSTANT_TYPE_MASK) { ++ case IS_NULL: ++ case IS_LONG: ++ case IS_DOUBLE: ++ case IS_BOOL: ++ case IS_RESOURCE: ++ /* nothing to do */ ++ break; ++ case IS_CONSTANT: ++ case IS_STRING: ++ apc_swizzle_ptr(bd, ll, &zv->value.str.val); ++ break; ++ case IS_ARRAY: ++ case IS_CONSTANT_ARRAY: ++ apc_swizzle_hashtable(bd, ll, zv->value.ht, (apc_swizzle_cb_t)apc_swizzle_zval, 1 TSRMLS_CC); ++ apc_swizzle_ptr(bd, ll, &zv->value.ht); ++ break; ++ case IS_OBJECT: ++ break; ++ default: ++ assert(0); /* shouldn't happen */ ++ } ++} /* }}} */ ++ ++ ++/* {{{ apc_swizzle_bd */ ++static apc_bd_t* apc_swizzle_bd(apc_bd_t* bd, zend_llist *ll TSRMLS_DC) { ++ int count, i; ++ PHP_MD5_CTX context; ++ unsigned char digest[16]; ++ register php_uint32 crc; ++ php_uint32 crcinit = 0; ++ char *crc_p; ++ void ***ptr; ++ void ***ptr_list; ++ ++ count = zend_llist_count(ll); ++ ptr_list = emalloc(count * sizeof(void**)); ++ ptr = zend_llist_get_first(ll); ++ for(i=0; i < count; i++) { ++#if APC_BINDUMP_DEBUG ++ printf("[%06d] ", i+1); ++#endif ++ SWIZZLE(bd, **ptr); /* swizzle ptr */ ++ if((long)bd < (long)*ptr && (ulong)*ptr < ((long)bd + bd->size)) { /* exclude ptrs that aren't actually included in the ptr list */ ++#if APC_BINDUMP_DEBUG ++ printf("[------] "); ++#endif ++ SWIZZLE(bd, *ptr); /* swizzle ptr list */ ++ ptr_list[i] = *ptr; ++ } ++ ptr = zend_llist_get_next(ll); ++ } ++ SWIZZLE(bd, bd->entries); ++ ++ if(count > 0) { ++ bd = erealloc(bd, bd->size + (count * sizeof(void**))); ++ bd->num_swizzled_ptrs = count; ++ bd->swizzled_ptrs = (void***)((unsigned char *)bd + bd->size -2); /* extra -1 for null termination */ ++ bd->size += count * sizeof(void**); ++ memcpy(bd->swizzled_ptrs, ptr_list, count * sizeof(void**)); ++ SWIZZLE(bd, bd->swizzled_ptrs); ++ } else { ++ bd->num_swizzled_ptrs = 0; ++ bd->swizzled_ptrs = NULL; ++ } ++ ((char*)bd)[bd->size-1] = 0; /* silence null termination for zval strings */ ++ efree(ptr_list); ++ bd->swizzled = 1; ++ ++ /* Generate MD5/CRC32 checksum */ ++ for(i=0; i<16; i++) { bd->md5[i] = 0; } ++ bd->crc=0; ++ PHP_MD5Init(&context); ++ PHP_MD5Update(&context, (const unsigned char*)bd, bd->size); ++ PHP_MD5Final(digest, &context); ++ crc = crcinit^0xFFFFFFFF; ++ crc_p = (char*)bd; ++ for(i=bd->size; i--; ++crc_p) { ++ crc = ((crc >> 8) & 0x00FFFFFF) ^ crc32tab[(crc ^ (*crc_p)) & 0xFF ]; ++ } ++ memcpy(bd->md5, digest, 16); ++ bd->crc = crc; ++ ++ return bd; ++} /* }}} */ ++ ++ ++/* {{{ apc_unswizzle_bd */ ++static int apc_unswizzle_bd(apc_bd_t *bd, int flags TSRMLS_DC) { ++ int i; ++ unsigned char md5_orig[16]; ++ unsigned char digest[16]; ++ PHP_MD5_CTX context; ++ register php_uint32 crc; ++ php_uint32 crcinit = 0; ++ php_uint32 crc_orig; ++ char *crc_p; ++ ++ /* Verify the md5 or crc32 before we unswizzle */ ++ memcpy(md5_orig, bd->md5, 16); ++ for(i=0; i<16; i++) { bd->md5[i] = 0; } ++ crc_orig = bd->crc; ++ bd->crc=0; ++ if(flags & APC_BIN_VERIFY_MD5) { ++ PHP_MD5Init(&context); ++ PHP_MD5Update(&context, (const unsigned char*)bd, bd->size); ++ PHP_MD5Final(digest, &context); ++ if(memcmp(md5_orig, digest, 16)) { ++ apc_error("MD5 checksum of binary dump failed." TSRMLS_CC); ++ return -1; ++ } ++ } ++ if(flags & APC_BIN_VERIFY_CRC32) { ++ crc = crcinit^0xFFFFFFFF; ++ crc_p = (char*)bd; ++ for(i=bd->size; i--; ++crc_p) { ++ crc = ((crc >> 8) & 0x00FFFFFF) ^ crc32tab[(crc ^ (*crc_p)) & 0xFF ]; ++ } ++ if(crc_orig != crc) { ++ apc_error("CRC32 checksum of binary dump failed." TSRMLS_CC); ++ return -1; ++ } ++ } ++ memcpy(bd->md5, md5_orig, 16); /* add back md5 checksum */ ++ bd->crc = crc_orig; ++ ++ UNSWIZZLE(bd, bd->entries); ++ UNSWIZZLE(bd, bd->swizzled_ptrs); ++ for(i=0; i < bd->num_swizzled_ptrs; i++) { ++ if(bd->swizzled_ptrs[i]) { ++ UNSWIZZLE(bd, bd->swizzled_ptrs[i]); ++ if(*bd->swizzled_ptrs[i] && (*bd->swizzled_ptrs[i] < (void*)bd)) { ++ UNSWIZZLE(bd, *bd->swizzled_ptrs[i]); ++ } ++ } ++ } ++ ++ bd->swizzled=0; ++ ++ return 0; ++} /* }}} */ ++ ++ ++/* {{{ apc_bin_checkfilter */ ++static int apc_bin_checkfilter(HashTable *filter, const char *key, uint key_len) { ++ zval **zptr; ++ ++ if(filter == NULL) { ++ return 1; ++ } ++ ++ if(zend_hash_find(filter, (char*)key, key_len, (void**)&zptr) == SUCCESS) { ++ if(Z_TYPE_PP(zptr) == IS_LONG && Z_LVAL_PP(zptr) == 0) { ++ return 0; ++ } ++ } else { ++ return 0; ++ } ++ ++ ++ return 1; ++} /* }}} */ ++ ++/* {{{ apc_bin_fixup_op_array */ ++static inline void apc_bin_fixup_op_array(zend_op_array *op_array) { ++ ulong i; ++ for (i = 0; i < op_array->last; i++) { ++ op_array->opcodes[i].handler = zend_opcode_handlers[APC_OPCODE_HANDLER_DECODE(&op_array->opcodes[i])]; ++ } ++} ++/* }}} */ ++ ++/* {{{ apc_bin_fixup_class_entry */ ++static inline void apc_bin_fixup_class_entry(zend_class_entry *ce) { ++ zend_function *fe; ++ HashPosition hpos; ++ ++ /* fixup the opcodes in each method */ ++ zend_hash_internal_pointer_reset_ex(&ce->function_table, &hpos); ++ while(zend_hash_get_current_data_ex(&ce->function_table, (void**)&fe, &hpos) == SUCCESS) { ++ apc_bin_fixup_op_array(&fe->op_array); ++ zend_hash_move_forward_ex(&ce->function_table, &hpos); ++ } ++ ++ /* fixup hashtable destructor pointers */ ++ ce->function_table.pDestructor = (dtor_func_t)zend_function_dtor; ++#ifndef ZEND_ENGINE_2_4 ++ ce->default_properties.pDestructor = (dtor_func_t)zval_ptr_dtor_wrapper; ++#endif ++ ce->properties_info.pDestructor = (dtor_func_t)zval_ptr_dtor_wrapper; ++#ifndef ZEND_ENGINE_2_4 ++ ce->default_static_members.pDestructor = (dtor_func_t)zval_ptr_dtor_wrapper; ++ if (ce->static_members) { ++ ce->static_members->pDestructor = (dtor_func_t)zval_ptr_dtor_wrapper; ++ } ++#endif ++ ce->constants_table.pDestructor = (dtor_func_t)zval_ptr_dtor_wrapper; ++} ++/* }}} */ ++ ++/* {{{ apc_bin_dump */ ++apc_bd_t* apc_bin_dump(HashTable *files, HashTable *user_vars TSRMLS_DC) { ++ ++ int i; ++ uint fcount; ++ slot_t *sp; ++ apc_bd_entry_t *ep; ++ int count=0; ++ apc_bd_t *bd; ++ zend_llist ll; ++ zend_function *efp, *sfp; ++ long size=0; ++ apc_context_t ctxt; ++ void *pool_ptr; ++ ++ zend_llist_init(&ll, sizeof(void*), NULL, 0); ++ zend_hash_init(&APCG(apc_bd_alloc_list), 0, NULL, NULL, 0); ++ ++ /* flip the hash for faster filter checking */ ++ files = apc_flip_hash(files); ++ user_vars = apc_flip_hash(user_vars); ++ ++ /* get size and entry counts */ ++ for(i=0; i < apc_user_cache->num_slots; i++) { ++ sp = apc_user_cache->slots[i]; ++ for(; sp != NULL; sp = sp->next) { ++ if(apc_bin_checkfilter(user_vars, sp->key.data.user.identifier, sp->key.data.user.identifier_len)) { ++ size += sizeof(apc_bd_entry_t*) + sizeof(apc_bd_entry_t); ++ size += sp->value->mem_size - (sizeof(apc_cache_entry_t) - sizeof(apc_cache_entry_value_t)); ++ count++; ++ } ++ } ++ } ++ for(i=0; i < apc_cache->num_slots; i++) { ++ sp = apc_cache->slots[i]; ++ for(; sp != NULL; sp = sp->next) { ++ if(sp->key.type == APC_CACHE_KEY_FPFILE) { ++ if(apc_bin_checkfilter(files, sp->key.data.fpfile.fullpath, sp->key.data.fpfile.fullpath_len+1)) { ++ size += sizeof(apc_bd_entry_t*) + sizeof(apc_bd_entry_t); ++ size += sp->value->mem_size - (sizeof(apc_cache_entry_t) - sizeof(apc_cache_entry_value_t)); ++ count++; ++ } ++ } else { ++ /* TODO: Currently we don't support APC_CACHE_KEY_FILE type. We need to store the path and re-stat on load */ ++ apc_warning("Excluding some files from apc_bin_dump[file]. Cached files must be included using full path with apc.stat=0." TSRMLS_CC); ++ } ++ } ++ } ++ ++ size += sizeof(apc_bd_t) +1; /* +1 for null termination */ ++ bd = emalloc(size); ++ bd->size = size; ++ pool_ptr = emalloc(sizeof(apc_pool)); ++ apc_bd_alloc_ex(pool_ptr, sizeof(apc_pool) TSRMLS_CC); ++ ctxt.pool = apc_pool_create(APC_UNPOOL, apc_bd_alloc, apc_bd_free, NULL, NULL TSRMLS_CC); /* ideally the pool wouldn't be alloc'd as part of this */ ++ if (!ctxt.pool) { /* TODO need to cleanup */ ++ apc_warning("Unable to allocate memory for pool." TSRMLS_CC); ++ return NULL; ++ } ++ ctxt.copy = APC_COPY_IN_USER; /* avoid stupid ALLOC_ZVAL calls here, hack */ ++ apc_bd_alloc_ex((void*)((long)bd + sizeof(apc_bd_t)), bd->size - sizeof(apc_bd_t) -1 TSRMLS_CC); ++ bd->num_entries = count; ++ bd->entries = apc_bd_alloc_ex(NULL, sizeof(apc_bd_entry_t) * count TSRMLS_CC); ++ ++ /* User entries */ ++ zend_hash_init(&APCG(copied_zvals), 0, NULL, NULL, 0); ++ count = 0; ++ for(i=0; i < apc_user_cache->num_slots; i++) { ++ sp = apc_user_cache->slots[i]; ++ for(; sp != NULL; sp = sp->next) { ++ if(apc_bin_checkfilter(user_vars, sp->key.data.user.identifier, sp->key.data.user.identifier_len)) { ++ ep = &bd->entries[count]; ++ ep->type = sp->value->type; ++ ep->val.user.info = apc_bd_alloc(sp->value->data.user.info_len TSRMLS_CC); ++ memcpy(ep->val.user.info, sp->value->data.user.info, sp->value->data.user.info_len); ++ ep->val.user.info_len = sp->value->data.user.info_len; ++ ep->val.user.val = apc_copy_zval(NULL, sp->value->data.user.val, &ctxt TSRMLS_CC); ++ ep->val.user.ttl = sp->value->data.user.ttl; ++ ++ /* swizzle pointers */ ++ apc_swizzle_ptr(bd, &ll, &bd->entries[count].val.user.info); ++ zend_hash_clean(&APCG(copied_zvals)); ++ apc_swizzle_zval(bd, &ll, bd->entries[count].val.user.val TSRMLS_CC); ++ apc_swizzle_ptr(bd, &ll, &bd->entries[count].val.user.val); ++ ++ count++; ++ } ++ } ++ } ++ zend_hash_destroy(&APCG(copied_zvals)); ++ APCG(copied_zvals).nTableSize=0; ++ ++ /* File entries */ ++ for(i=0; i < apc_cache->num_slots; i++) { ++ for(sp=apc_cache->slots[i]; sp != NULL; sp = sp->next) { ++ if(sp->key.type == APC_CACHE_KEY_FPFILE) { ++ if(apc_bin_checkfilter(files, sp->key.data.fpfile.fullpath, sp->key.data.fpfile.fullpath_len+1)) { ++ ep = &bd->entries[count]; ++ ep->type = sp->key.type; ++ ep->val.file.filename = apc_bd_alloc(strlen(sp->value->data.file.filename) + 1 TSRMLS_CC); ++ strcpy(ep->val.file.filename, sp->value->data.file.filename); ++ ep->val.file.op_array = apc_copy_op_array(NULL, sp->value->data.file.op_array, &ctxt TSRMLS_CC); ++ ++ for(ep->num_functions=0; sp->value->data.file.functions[ep->num_functions].function != NULL;) { ep->num_functions++; } ++ ep->val.file.functions = apc_bd_alloc(sizeof(apc_function_t) * ep->num_functions TSRMLS_CC); ++ for(fcount=0; fcount < ep->num_functions; fcount++) { ++ memcpy(&ep->val.file.functions[fcount], &sp->value->data.file.functions[fcount], sizeof(apc_function_t)); ++ ep->val.file.functions[fcount].name = apc_xmemcpy(sp->value->data.file.functions[fcount].name, sp->value->data.file.functions[fcount].name_len+1, apc_bd_alloc TSRMLS_CC); ++ ep->val.file.functions[fcount].name_len = sp->value->data.file.functions[fcount].name_len; ++ ep->val.file.functions[fcount].function = apc_bd_alloc(sizeof(zend_function) TSRMLS_CC); ++ efp = ep->val.file.functions[fcount].function; ++ sfp = sp->value->data.file.functions[fcount].function; ++ switch(sfp->type) { ++ case ZEND_INTERNAL_FUNCTION: ++ case ZEND_OVERLOADED_FUNCTION: ++ efp->op_array = sfp->op_array; ++ break; ++ case ZEND_USER_FUNCTION: ++ case ZEND_EVAL_CODE: ++ apc_copy_op_array(&efp->op_array, &sfp->op_array, &ctxt TSRMLS_CC); ++ break; ++ default: ++ assert(0); ++ } ++#ifdef ZEND_ENGINE_2 ++ efp->common.prototype = NULL; ++ efp->common.fn_flags = sfp->common.fn_flags & (~ZEND_ACC_IMPLEMENTED_ABSTRACT); ++#endif ++ apc_swizzle_ptr(bd, &ll, &ep->val.file.functions[fcount].name); ++ apc_swizzle_ptr(bd, &ll, (void**)&ep->val.file.functions[fcount].function); ++ apc_swizzle_op_array(bd, &ll, &efp->op_array TSRMLS_CC); ++ } ++ ++ ++ for(ep->num_classes=0; sp->value->data.file.classes[ep->num_classes].class_entry != NULL;) { ep->num_classes++; } ++ ep->val.file.classes = apc_bd_alloc(sizeof(apc_class_t) * ep->num_classes TSRMLS_CC); ++ for(fcount=0; fcount < ep->num_classes; fcount++) { ++ ep->val.file.classes[fcount].name = apc_xmemcpy(sp->value->data.file.classes[fcount].name, sp->value->data.file.classes[fcount].name_len + 1, apc_bd_alloc TSRMLS_CC); ++ ep->val.file.classes[fcount].name_len = sp->value->data.file.classes[fcount].name_len; ++ ep->val.file.classes[fcount].class_entry = apc_copy_class_entry(NULL, sp->value->data.file.classes[fcount].class_entry, &ctxt TSRMLS_CC); ++ ep->val.file.classes[fcount].parent_name = apc_xstrdup(sp->value->data.file.classes[fcount].parent_name, apc_bd_alloc TSRMLS_CC); ++ ++ apc_swizzle_ptr(bd, &ll, &ep->val.file.classes[fcount].name); ++ apc_swizzle_ptr(bd, &ll, &ep->val.file.classes[fcount].parent_name); ++ apc_swizzle_class_entry(bd, &ll, ep->val.file.classes[fcount].class_entry TSRMLS_CC); ++ apc_swizzle_ptr(bd, &ll, &ep->val.file.classes[fcount].class_entry); ++ } ++ ++ apc_swizzle_ptr(bd, &ll, &bd->entries[count].val.file.filename); ++ apc_swizzle_op_array(bd, &ll, bd->entries[count].val.file.op_array TSRMLS_CC); ++ apc_swizzle_ptr(bd, &ll, &bd->entries[count].val.file.op_array); ++ apc_swizzle_ptr(bd, &ll, (void**)&ep->val.file.functions); ++ apc_swizzle_ptr(bd, &ll, (void**)&ep->val.file.classes); ++ ++ count++; ++ } else { ++ /* TODO: Currently we don't support APC_CACHE_KEY_FILE type. We need to store the path and re-stat on load */ ++ } ++ } ++ } ++ } ++ ++ /* append swizzle pointer list to bd */ ++ bd = apc_swizzle_bd(bd, &ll TSRMLS_CC); ++ zend_llist_destroy(&ll); ++ zend_hash_destroy(&APCG(apc_bd_alloc_list)); ++ ++ if(files) { ++ zend_hash_destroy(files); ++ efree(files); ++ } ++ if(user_vars) { ++ zend_hash_destroy(user_vars); ++ efree(user_vars); ++ } ++ ++ efree(pool_ptr); ++ ++ return bd; ++} /* }}} */ ++ ++ ++/* {{{ apc_bin_load */ ++int apc_bin_load(apc_bd_t *bd, int flags TSRMLS_DC) { ++ ++ apc_bd_entry_t *ep; ++ uint i, i2; ++ int ret; ++ time_t t; ++ zend_op_array *alloc_op_array = NULL; ++ apc_function_t *alloc_functions = NULL; ++ apc_class_t *alloc_classes = NULL; ++ apc_cache_entry_t *cache_entry; ++ apc_cache_key_t cache_key; ++ apc_context_t ctxt; ++ ++ if (bd->swizzled) { ++ if(apc_unswizzle_bd(bd, flags TSRMLS_CC) < 0) { ++ return -1; ++ } ++ } ++ ++ t = apc_time(); ++ ++ for(i = 0; i < bd->num_entries; i++) { ++ ctxt.pool = apc_pool_create(APC_SMALL_POOL, apc_sma_malloc, apc_sma_free, apc_sma_protect, apc_sma_unprotect TSRMLS_CC); ++ if (!ctxt.pool) { /* TODO need to cleanup previous pools */ ++ apc_warning("Unable to allocate memory for pool." TSRMLS_CC); ++ goto failure; ++ } ++ ep = &bd->entries[i]; ++ switch (ep->type) { ++ case APC_CACHE_KEY_FILE: ++ /* TODO: Currently we don't support APC_CACHE_KEY_FILE type. We need to store the path and re-stat on load (or something else perhaps?) */ ++ break; ++ case APC_CACHE_KEY_FPFILE: ++ ctxt.copy = APC_COPY_IN_OPCODE; ++ ++ HANDLE_BLOCK_INTERRUPTIONS(); ++#if NONBLOCKING_LOCK_AVAILABLE ++ if(APCG(write_lock)) { ++ if(!apc_cache_write_lock(apc_cache TSRMLS_CC)) { ++ HANDLE_UNBLOCK_INTERRUPTIONS(); ++ return -1; ++ } ++ } ++#endif ++ if(! (alloc_op_array = apc_copy_op_array(NULL, ep->val.file.op_array, &ctxt TSRMLS_CC))) { ++ goto failure; ++ } ++ apc_bin_fixup_op_array(alloc_op_array); ++ ++ if(! (alloc_functions = apc_sma_malloc(sizeof(apc_function_t) * (ep->num_functions + 1) TSRMLS_CC))) { ++ goto failure; ++ } ++ for(i2=0; i2 < ep->num_functions; i2++) { ++ if(! (alloc_functions[i2].name = apc_xmemcpy(ep->val.file.functions[i2].name, ep->val.file.functions[i2].name_len + 1, apc_sma_malloc TSRMLS_CC))) { ++ goto failure; ++ } ++ alloc_functions[i2].name_len = ep->val.file.functions[i2].name_len; ++ if(! (alloc_functions[i2].function = apc_sma_malloc(sizeof(zend_function) TSRMLS_CC))) { ++ goto failure; ++ } ++ switch(ep->val.file.functions[i2].function->type) { ++ case ZEND_INTERNAL_FUNCTION: ++ case ZEND_OVERLOADED_FUNCTION: ++ alloc_functions[i2].function->op_array = ep->val.file.functions[i2].function->op_array; ++ break; ++ case ZEND_USER_FUNCTION: ++ case ZEND_EVAL_CODE: ++ if (!apc_copy_op_array(&alloc_functions[i2].function->op_array, &ep->val.file.functions[i2].function->op_array, &ctxt TSRMLS_CC)) { ++ goto failure; ++ } ++ apc_bin_fixup_op_array(&alloc_functions[i2].function->op_array); ++ break; ++ default: ++ assert(0); ++ } ++#ifdef ZEND_ENGINE_2 ++ alloc_functions[i2].function->common.prototype=NULL; ++ alloc_functions[i2].function->common.fn_flags=ep->val.file.functions[i2].function->common.fn_flags & (~ZEND_ACC_IMPLEMENTED_ABSTRACT); ++#endif ++ } ++ alloc_functions[i2].name = NULL; ++ alloc_functions[i2].function = NULL; ++ ++ if(! (alloc_classes = apc_sma_malloc(sizeof(apc_class_t) * (ep->num_classes + 1) TSRMLS_CC))) { ++ goto failure; ++ } ++ for(i2=0; i2 < ep->num_classes; i2++) { ++ if(! (alloc_classes[i2].name = apc_xmemcpy(ep->val.file.classes[i2].name, ep->val.file.classes[i2].name_len+1, apc_sma_malloc TSRMLS_CC))) { ++ goto failure; ++ } ++ alloc_classes[i2].name_len = ep->val.file.classes[i2].name_len; ++ if(! (alloc_classes[i2].class_entry = apc_copy_class_entry(NULL, ep->val.file.classes[i2].class_entry, &ctxt TSRMLS_CC))) { ++ goto failure; ++ } ++ apc_bin_fixup_class_entry(alloc_classes[i2].class_entry); ++ if(! (alloc_classes[i2].parent_name = apc_xstrdup(ep->val.file.classes[i2].parent_name, apc_sma_malloc TSRMLS_CC))) { ++ if(ep->val.file.classes[i2].parent_name != NULL) { ++ goto failure; ++ } ++ } ++ } ++ alloc_classes[i2].name = NULL; ++ alloc_classes[i2].class_entry = NULL; ++ ++ if(!(cache_entry = apc_cache_make_file_entry(ep->val.file.filename, alloc_op_array, alloc_functions, alloc_classes, &ctxt TSRMLS_CC))) { ++ goto failure; ++ } ++ ++ if (!apc_cache_make_file_key(&cache_key, ep->val.file.filename, PG(include_path), t TSRMLS_CC)) { ++ goto failure; ++ } ++ ++ if ((ret = apc_cache_insert(apc_cache, cache_key, cache_entry, &ctxt, t TSRMLS_CC)) != 1) { ++ if(ret==-1) { ++ goto failure; ++ } ++ } ++ ++#if NONBLOCKING_LOCK_AVAILABLE ++ if(APCG(write_lock)) { ++ apc_cache_write_unlock(apc_cache TSRMLS_CC); ++ } ++#endif ++ HANDLE_UNBLOCK_INTERRUPTIONS(); ++ ++ break; ++ case APC_CACHE_KEY_USER: ++ ctxt.copy = APC_COPY_IN_USER; ++ _apc_store(ep->val.user.info, ep->val.user.info_len, ep->val.user.val, ep->val.user.ttl, 0 TSRMLS_CC); ++ break; ++ default: ++ break; ++ } ++ } ++ ++ return 0; ++ ++failure: ++ apc_pool_destroy(ctxt.pool TSRMLS_CC); ++ apc_warning("Unable to allocate memory for apc binary load/dump functionality." TSRMLS_CC); ++#if NONBLOCKING_LOCK_AVAILABLE ++ if(APCG(write_lock)) { ++ apc_cache_write_unlock(apc_cache TSRMLS_CC); ++ } ++#endif ++ HANDLE_UNBLOCK_INTERRUPTIONS(); ++ return -1; ++} /* }}} */ ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_bin.h b/ext/apc/apc_bin.h +--- a/ext/apc/apc_bin.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_bin.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,63 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Brian Shire | ++ +----------------------------------------------------------------------+ ++ ++ */ ++ ++/* $Id: apc_bin.h 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#ifndef APC_BINDUMP_H ++#define APC_BINDUMP_H ++ ++#include "apc.h" ++#include "apc_php.h" ++#include "ext/standard/basic_functions.h" ++ ++/* APC binload flags */ ++#define APC_BIN_VERIFY_MD5 1 << 0 ++#define APC_BIN_VERIFY_CRC32 1 << 1 ++ ++typedef struct _apc_bd_entry_t { ++ unsigned char type; ++ uint num_functions; ++ uint num_classes; ++ apc_cache_entry_value_t val; ++} apc_bd_entry_t; ++ ++typedef struct _apc_bd_t { ++ unsigned int size; ++ int swizzled; ++ unsigned char md5[16]; ++ php_uint32 crc; ++ unsigned int num_entries; ++ apc_bd_entry_t *entries; ++ int num_swizzled_ptrs; ++ void ***swizzled_ptrs; ++} apc_bd_t; ++ ++apc_bd_t* apc_bin_dump(HashTable *files, HashTable *user_vars TSRMLS_DC); ++int apc_bin_load(apc_bd_t *bd, int flags TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc.c b/ext/apc/apc.c +--- a/ext/apc/apc.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,670 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | George Schlossnagle | ++ | Rasmus Lerdorf | ++ | Arun C. Murthy | ++ | Gopal Vijayaraghavan | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc.c 326710 2012-07-19 20:51:04Z rasmus $ */ ++ ++#include "apc.h" ++#include "apc_zend.h" ++#include "apc_cache.h" ++#include "apc_globals.h" ++#include "php.h" ++ ++#if HAVE_PCRE || HAVE_BUNDLED_PCRE ++/* Deal with problem present until php-5.2.2 where php_pcre.h was not installed correctly */ ++# if !HAVE_BUNDLED_PCRE && PHP_MAJOR_VERSION == 5 && (PHP_MINOR_VERSION < 2 || (PHP_MINOR_VERSION == 2 && PHP_RELEASE_VERSION < 2)) ++# include "apc_php_pcre.h" ++# else ++# include "ext/pcre/php_pcre.h" ++# endif ++# include "ext/standard/php_smart_str.h" ++#endif ++ ++#define NELEMS(a) (sizeof(a)/sizeof((a)[0])) ++ ++/* {{{ memory allocation wrappers */ ++ ++void* apc_emalloc(size_t n TSRMLS_DC) ++{ ++ void* p = malloc(n); ++ if (p == NULL) { ++ apc_error("apc_emalloc: malloc failed to allocate %u bytes:" TSRMLS_CC, n); ++ return NULL; ++ } ++ return p; ++} ++ ++void* apc_erealloc(void* p, size_t n TSRMLS_DC) ++{ ++ void *new; ++ new = realloc(p, n); ++ if (new == NULL) { ++ apc_error("apc_erealloc: realloc failed to allocate %u bytes:" TSRMLS_CC, n); ++ return NULL; ++ } ++ return new; ++} ++ ++void apc_efree(void* p TSRMLS_DC) ++{ ++ if (p == NULL) { ++ apc_error("apc_efree: attempt to free null pointer" TSRMLS_CC); ++ return; ++ } ++ free(p); ++} ++ ++char* APC_ALLOC apc_estrdup(const char* s TSRMLS_DC) ++{ ++ int len; ++ char* dup; ++ ++ if (s == NULL) { ++ return NULL; ++ } ++ len = strlen(s); ++ dup = (char*) malloc(len+1); ++ if (dup == NULL) { ++ apc_error("apc_estrdup: malloc failed to allocate %u bytes:" TSRMLS_CC, len+1); ++ return NULL; ++ } ++ memcpy(dup, s, len); ++ dup[len] = '\0'; ++ return dup; ++} ++ ++void* APC_ALLOC apc_xstrdup(const char* s, apc_malloc_t f TSRMLS_DC) ++{ ++ return s != NULL ? apc_xmemcpy(s, strlen(s)+1, f TSRMLS_CC) : NULL; ++} ++ ++void* APC_ALLOC apc_xmemcpy(const void* p, size_t n, apc_malloc_t f TSRMLS_DC) ++{ ++ void* q; ++ ++ if (p != NULL && (q = f(n TSRMLS_CC)) != NULL) { ++ memcpy(q, p, n); ++ return q; ++ } ++ return NULL; ++} ++ ++/* }}} */ ++ ++/* {{{ console display functions */ ++#ifdef ZTS ++# define APC_PRINT_FUNCTION_PARAMETER TSRMLS_C ++#else ++# define APC_PRINT_FUNCTION_PARAMETER format ++#endif ++ ++#define APC_PRINT_FUNCTION(name, verbosity) \ ++ void apc_##name(const char *format TSRMLS_DC, ...) \ ++ { \ ++ va_list args; \ ++ \ ++ va_start(args, APC_PRINT_FUNCTION_PARAMETER); \ ++ php_verror(NULL, "", verbosity, format, args TSRMLS_CC); \ ++ va_end(args); \ ++ } ++ ++APC_PRINT_FUNCTION(error, E_ERROR) ++APC_PRINT_FUNCTION(warning, E_WARNING) ++APC_PRINT_FUNCTION(notice, E_NOTICE) ++ ++#ifdef __DEBUG_APC__ ++APC_PRINT_FUNCTION(debug, E_NOTICE) ++#else ++void apc_debug(const char *format TSRMLS_DC, ...) {} ++#endif ++/* }}} */ ++ ++/* {{{ string and text manipulation */ ++ ++char* apc_append(const char* s, const char* t TSRMLS_DC) ++{ ++ int slen; ++ int tlen; ++ char* p; ++ ++ slen = strlen(s); ++ tlen = strlen(t); ++ ++ p = (char*) apc_emalloc((slen + tlen + 1) * sizeof(char) TSRMLS_CC); ++ memcpy(p, s, slen); ++ memcpy(p + slen, t, tlen + 1); ++ ++ return p; ++} ++ ++char* apc_substr(const char* s, int start, int length TSRMLS_DC) ++{ ++ char* substr; ++ int src_len = strlen(s); ++ ++ /* bring start into range */ ++ if (start < 0) { ++ start = 0; ++ } ++ else if (start >= src_len) { ++ start = src_len - 1; ++ } ++ ++ /* bring length into range */ ++ if (length < 0 || src_len - start < length) { ++ length = src_len - start; ++ } ++ ++ /* create the substring */ ++ substr = apc_xmemcpy(s + start, length + 1, apc_emalloc TSRMLS_CC); ++ substr[length] = '\0'; ++ return substr; ++} ++ ++char** apc_tokenize(const char* s, char delim TSRMLS_DC) ++{ ++ char** tokens; /* array of tokens, NULL terminated */ ++ int size; /* size of tokens array */ ++ int n; /* index of next token in tokens array */ ++ int cur; /* current position in input string */ ++ int end; /* final legal position in input string */ ++ int next; /* position of next delimiter in input */ ++ ++ if (!s) { ++ return NULL; ++ } ++ ++ size = 2; ++ n = 0; ++ cur = 0; ++ end = strlen(s) - 1; ++ ++ tokens = (char**) apc_emalloc(size * sizeof(char*) TSRMLS_CC); ++ tokens[n] = NULL; ++ ++ while (cur <= end) { ++ /* search for the next delimiter */ ++ char* p = strchr(s + cur, delim); ++ next = p ? p-s : end+1; ++ ++ /* resize token array if necessary */ ++ if (n == size-1) { ++ size *= 2; ++ tokens = (char**) apc_erealloc(tokens, size * sizeof(char*) TSRMLS_CC); ++ } ++ ++ /* save the current token */ ++ tokens[n] = apc_substr(s, cur, next-cur TSRMLS_CC); ++ ++ tokens[++n] = NULL; ++ cur = next + 1; ++ } ++ ++ return tokens; ++} ++ ++/* }}} */ ++ ++ ++/* {{{ apc_win32_restat */ ++#ifdef PHP_WIN32 ++static int apc_restat(apc_fileinfo_t *fileinfo TSRMLS_DC) ++{ ++ HANDLE hFile; ++ BY_HANDLE_FILE_INFORMATION hInfo; ++ ++ hFile = CreateFile(fileinfo->fullpath, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL); ++ ++ if (!hFile) { ++ apc_debug("Cannot create a file HANDLE for %s\n" TSRMLS_CC, fileinfo->fullpath); ++ return -1; ++ } ++ ++ if (!GetFileInformationByHandle(hFile, &hInfo)) { ++ apc_debug("Cannot get file information from handle\n" TSRMLS_CC); ++ CloseHandle(hFile); ++ return -1; ++ } ++ ++ CloseHandle(hFile); ++ ++ fileinfo->st_buf.sb.st_dev = hInfo.dwVolumeSerialNumber; ++ fileinfo->st_buf.sb.st_ino = (((apc_ino_t)(hInfo.nFileIndexHigh) << 32) | (apc_ino_t) hInfo.nFileIndexLow); ++ ++ return 0; ++} ++#else ++static int apc_restat(apc_fileinfo_t *fileinfo TSRMLS_DC) ++{ ++ return 0; ++} ++#endif ++/* }}} */ ++ ++/* {{{ apc_search_paths */ ++/* similar to php_stream_stat_path */ ++#define APC_URL_STAT(wrapper, filename, pstatbuf) \ ++ ((wrapper)->wops->url_stat((wrapper), (filename), PHP_STREAM_URL_STAT_QUIET, (pstatbuf), NULL TSRMLS_CC)) ++ ++/* copy out to path_buf if path_for_open isn't the same as filename */ ++#define COPY_IF_CHANGED(p) \ ++ (char*) (((p) == filename) ? filename : \ ++ (strlcpy((char*)fileinfo->path_buf, (p), sizeof(fileinfo->path_buf))) \ ++ ? (fileinfo->path_buf) : NULL) ++ ++/* len checks can be skipped here because filename is NUL terminated */ ++#define IS_RELATIVE_PATH(filename, len) \ ++ ((filename) && (filename[0] == '.' && \ ++ (IS_SLASH(filename[1]) || \ ++ (filename[1] == '.' && \ ++ IS_SLASH(filename[2]))))) ++ ++/* {{{ stupid stringifcation */ ++#if DEFAULT_SLASH == '/' ++ #define DEFAULT_SLASH_STRING "/" ++#elif DEFAULT_SLASH == '\\' ++ #define DEFAULT_SLASH_STRING "\\" ++#else ++ #error "Unknown value for DEFAULT_SLASH" ++#endif ++/* }}} */ ++ ++int apc_search_paths(const char* filename, const char* path, apc_fileinfo_t* fileinfo TSRMLS_DC) ++{ ++ char** paths = NULL; ++ char *exec_fname; ++ int exec_fname_length; ++ int found = 0; ++ int i; ++ php_stream_wrapper *wrapper = NULL; ++ char *path_for_open = NULL; ++ ++ assert(filename && fileinfo); ++ ++ ++ wrapper = php_stream_locate_url_wrapper(filename, &path_for_open, 0 TSRMLS_CC); ++ ++ if(!wrapper || !wrapper->wops || !wrapper->wops->url_stat) { ++ return -1; ++ } ++ ++ if(wrapper != &php_plain_files_wrapper) { ++ if(APC_URL_STAT(wrapper, path_for_open, &fileinfo->st_buf) == 0) { ++ fileinfo->fullpath = COPY_IF_CHANGED(path_for_open); ++ return apc_restat(fileinfo TSRMLS_CC); ++ } ++ return -1; /* cannot stat */ ++ } ++ ++ if (IS_ABSOLUTE_PATH(path_for_open, strlen(path_for_open)) && ++ APC_URL_STAT(wrapper, path_for_open, &fileinfo->st_buf) == 0) { ++ fileinfo->fullpath = COPY_IF_CHANGED(path_for_open); ++ return apc_restat(fileinfo TSRMLS_CC); ++ } ++ ++ if (!IS_RELATIVE_PATH(path_for_open, strlen(path_for_open))) { ++ paths = apc_tokenize(path, DEFAULT_DIR_SEPARATOR TSRMLS_CC); ++ if (!paths) ++ return -1; ++ ++ /* for each directory in paths, look for filename inside */ ++ for (i = 0; paths[i]; i++) { ++ snprintf(fileinfo->path_buf, sizeof(fileinfo->path_buf), "%s%c%s", paths[i], DEFAULT_SLASH, path_for_open); ++ if (APC_URL_STAT(wrapper, fileinfo->path_buf, &fileinfo->st_buf) == 0) { ++ fileinfo->fullpath = (char*) fileinfo->path_buf; ++ found = 1; ++ break; ++ } ++ } ++ /* in cli mode PHP explicitly checks the cwd, so we should as well */ ++ if(APCG(enable_cli) && !strcmp(sapi_module.name, "cli")) { ++ snprintf(fileinfo->path_buf, sizeof(fileinfo->path_buf), ".%c%s", DEFAULT_SLASH, path_for_open); ++ if (APC_URL_STAT(wrapper, fileinfo->path_buf, &fileinfo->st_buf) == 0) { ++ fileinfo->fullpath = (char*) fileinfo->path_buf; ++ found = 1; ++ } ++ } ++ } else { ++ /* read cwd and try to fake up fullpath */ ++ fileinfo->path_buf[0] = '\0'; ++ if(VCWD_GETCWD(fileinfo->path_buf, sizeof(fileinfo->path_buf))) { ++ strlcat(fileinfo->path_buf, DEFAULT_SLASH_STRING, sizeof(fileinfo->path_buf)); ++ strlcat(fileinfo->path_buf, path_for_open, sizeof(fileinfo->path_buf)); ++ if (APC_URL_STAT(wrapper, fileinfo->path_buf, &fileinfo->st_buf) == 0) { ++ fileinfo->fullpath = (char*) fileinfo->path_buf; ++ return apc_restat(fileinfo TSRMLS_CC); ++ } ++ } ++ } ++ ++ /* check in path of the calling scripts' current working directory */ ++ /* modified from main/streams/plain_wrapper.c */ ++ if(!found && zend_is_executing(TSRMLS_C)) { ++ exec_fname = zend_get_executed_filename(TSRMLS_C); ++ exec_fname_length = strlen(exec_fname); ++ while((--exec_fname_length >= 0) && !IS_SLASH(exec_fname[exec_fname_length])); ++ if((exec_fname && exec_fname[0] != '[') && exec_fname_length > 0) { ++ /* not: [no active file] or no path */ ++ memcpy(fileinfo->path_buf, exec_fname, exec_fname_length); ++ fileinfo->path_buf[exec_fname_length] = DEFAULT_SLASH; ++ strlcpy(fileinfo->path_buf +exec_fname_length +1, path_for_open,sizeof(fileinfo->path_buf)-exec_fname_length-1); ++ /* apc_warning("filename: %s, exec_fname: %s, fileinfo->path_buf: %s" TSRMLS_CC, path_for_open, exec_fname, fileinfo->path_buf); */ ++ if (APC_URL_STAT(wrapper, fileinfo->path_buf, &fileinfo->st_buf) == 0) { ++ fileinfo->fullpath = (char*) fileinfo->path_buf; ++ found = 1; ++ } ++ } ++ } ++ ++ if(paths) { ++ /* free the value returned by apc_tokenize */ ++ for (i = 0; paths[i]; i++) { ++ apc_efree(paths[i] TSRMLS_CC); ++ } ++ apc_efree(paths TSRMLS_CC); ++ } ++ ++ return found ? apc_restat(fileinfo TSRMLS_CC) : -1; ++} ++ ++/* }}} */ ++ ++/* {{{ regular expression wrapper functions */ ++ ++#if (HAVE_PCRE || HAVE_BUNDLED_PCRE) ++typedef struct { ++ pcre *preg; ++ pcre *nreg; ++} apc_regex; ++ ++#define APC_ADD_PATTERN(match, pat) do {\ ++ if(match.len > 1) {\ ++ smart_str_appendc(&match, '|');\ ++ }\ ++ smart_str_appendc(&match, '(');\ ++ while(*pat) {\ ++ if(*pat == '/') smart_str_appendc(&match, '\\');\ ++ \ ++ smart_str_appendc(&match, *(pat++));\ ++ }\ ++ smart_str_appendc(&match, ')');\ ++} while(0) ++ ++#define APC_COMPILE_PATTERN(re, match) do {\ ++ if(match.len > 2) { /* more than just "//" */\ ++ if (((re) = pcre_get_compiled_regex(match.c, NULL, NULL TSRMLS_CC)) == NULL) {\ ++ apc_warning("apc_regex_compile_array: invalid expression '%s'" TSRMLS_CC, match.c); \ ++ smart_str_free(&match);\ ++ return NULL;\ ++ }\ ++ } else { \ ++ (re) = NULL;\ ++ }\ ++} while(0) ++ ++void* apc_regex_compile_array(char* patterns[] TSRMLS_DC) ++{ ++ apc_regex* regs; ++ int npat; ++ smart_str pmatch = {0,}; ++ smart_str nmatch = {0,}; ++ char* pattern; ++ ++ if (!patterns) ++ return NULL; ++ ++ regs = (apc_regex*) apc_emalloc(sizeof(apc_regex) TSRMLS_CC); ++ ++ smart_str_appendc(&pmatch, '/'); ++ smart_str_appendc(&nmatch, '/'); ++ ++ for (npat = 0; patterns[npat] != NULL; npat++) { ++ pattern = patterns[npat]; ++ if(pattern[0] == '+') { ++ pattern += sizeof(char); ++ APC_ADD_PATTERN(pmatch, pattern); ++ } else { ++ if(pattern[0] == '-') pattern += sizeof(char); ++ APC_ADD_PATTERN(nmatch, pattern); ++ } ++ } ++ smart_str_appendc(&pmatch, '/'); ++ smart_str_appendc(&nmatch, '/'); ++ ++ smart_str_0(&nmatch); ++ smart_str_0(&pmatch); ++ ++ APC_COMPILE_PATTERN(regs->preg, pmatch); ++ APC_COMPILE_PATTERN(regs->nreg, nmatch); ++ ++ smart_str_free(&pmatch); ++ smart_str_free(&nmatch); ++ ++ return (void*) regs; ++} ++ ++void apc_regex_destroy_array(void* p TSRMLS_DC) ++{ ++ if (p != NULL) { ++ apc_regex* regs = (apc_regex*) p; ++ apc_efree(regs TSRMLS_CC); ++ } ++} ++ ++#define APC_MATCH_PATTERN(re, input, output) do {\ ++ if (re && pcre_exec(re, NULL, (input), strlen(input), 0, 0, NULL, 0) >= 0) {\ ++ return (output);\ ++ }\ ++} while(0) ++ ++ ++int apc_regex_match_array(void* p, const char* input) ++{ ++ apc_regex* regs; ++ ++ if (!p) ++ return 0; ++ ++ regs = (apc_regex*) p; ++ ++ APC_MATCH_PATTERN(regs->preg, input, APC_POSITIVE_MATCH); ++ APC_MATCH_PATTERN(regs->nreg, input, APC_NEGATIVE_MATCH); ++ ++ return 0; ++} ++#else /* no pcre */ ++void* apc_regex_compile_array(char* patterns[] TSRMLS_DC) ++{ ++ if(patterns && patterns[0] != NULL) { ++ apc_warning("pcre missing, disabling filters" TSRMLS_CC); ++ } ++ return NULL; ++} ++void apc_regex_destroy_array(void* p) ++{ ++ /* nothing */ ++} ++int apc_regex_match_array(void* p, const char* input) ++{ ++ return 0; ++} ++#endif ++/* }}} */ ++ ++/* {{{ crc32 implementation */ ++ ++/* this table was generated by crc32gen() */ ++static unsigned int crc32tab[] = { ++ /* 0 */ 0x00000000, 0x3b83984b, 0x77073096, 0x4c84a8dd, ++ /* 4 */ 0xee0e612c, 0xd58df967, 0x990951ba, 0xa28ac9f1, ++ /* 8 */ 0x076dc419, 0x3cee5c52, 0x706af48f, 0x4be96cc4, ++ /* 12 */ 0xe963a535, 0xd2e03d7e, 0x9e6495a3, 0xa5e70de8, ++ /* 16 */ 0x0edb8832, 0x35581079, 0x79dcb8a4, 0x425f20ef, ++ /* 20 */ 0xe0d5e91e, 0xdb567155, 0x97d2d988, 0xac5141c3, ++ /* 24 */ 0x09b64c2b, 0x3235d460, 0x7eb17cbd, 0x4532e4f6, ++ /* 28 */ 0xe7b82d07, 0xdc3bb54c, 0x90bf1d91, 0xab3c85da, ++ /* 32 */ 0x1db71064, 0x2634882f, 0x6ab020f2, 0x5133b8b9, ++ /* 36 */ 0xf3b97148, 0xc83ae903, 0x84be41de, 0xbf3dd995, ++ /* 40 */ 0x1adad47d, 0x21594c36, 0x6ddde4eb, 0x565e7ca0, ++ /* 44 */ 0xf4d4b551, 0xcf572d1a, 0x83d385c7, 0xb8501d8c, ++ /* 48 */ 0x136c9856, 0x28ef001d, 0x646ba8c0, 0x5fe8308b, ++ /* 52 */ 0xfd62f97a, 0xc6e16131, 0x8a65c9ec, 0xb1e651a7, ++ /* 56 */ 0x14015c4f, 0x2f82c404, 0x63066cd9, 0x5885f492, ++ /* 60 */ 0xfa0f3d63, 0xc18ca528, 0x8d080df5, 0xb68b95be, ++ /* 64 */ 0x3b6e20c8, 0x00edb883, 0x4c69105e, 0x77ea8815, ++ /* 68 */ 0xd56041e4, 0xeee3d9af, 0xa2677172, 0x99e4e939, ++ /* 72 */ 0x3c03e4d1, 0x07807c9a, 0x4b04d447, 0x70874c0c, ++ /* 76 */ 0xd20d85fd, 0xe98e1db6, 0xa50ab56b, 0x9e892d20, ++ /* 80 */ 0x35b5a8fa, 0x0e3630b1, 0x42b2986c, 0x79310027, ++ /* 84 */ 0xdbbbc9d6, 0xe038519d, 0xacbcf940, 0x973f610b, ++ /* 88 */ 0x32d86ce3, 0x095bf4a8, 0x45df5c75, 0x7e5cc43e, ++ /* 92 */ 0xdcd60dcf, 0xe7559584, 0xabd13d59, 0x9052a512, ++ /* 96 */ 0x26d930ac, 0x1d5aa8e7, 0x51de003a, 0x6a5d9871, ++ /* 100 */ 0xc8d75180, 0xf354c9cb, 0xbfd06116, 0x8453f95d, ++ /* 104 */ 0x21b4f4b5, 0x1a376cfe, 0x56b3c423, 0x6d305c68, ++ /* 108 */ 0xcfba9599, 0xf4390dd2, 0xb8bda50f, 0x833e3d44, ++ /* 112 */ 0x2802b89e, 0x138120d5, 0x5f058808, 0x64861043, ++ /* 116 */ 0xc60cd9b2, 0xfd8f41f9, 0xb10be924, 0x8a88716f, ++ /* 120 */ 0x2f6f7c87, 0x14ece4cc, 0x58684c11, 0x63ebd45a, ++ /* 124 */ 0xc1611dab, 0xfae285e0, 0xb6662d3d, 0x8de5b576, ++ /* 128 */ 0x76dc4190, 0x4d5fd9db, 0x01db7106, 0x3a58e94d, ++ /* 132 */ 0x98d220bc, 0xa351b8f7, 0xefd5102a, 0xd4568861, ++ /* 136 */ 0x71b18589, 0x4a321dc2, 0x06b6b51f, 0x3d352d54, ++ /* 140 */ 0x9fbfe4a5, 0xa43c7cee, 0xe8b8d433, 0xd33b4c78, ++ /* 144 */ 0x7807c9a2, 0x438451e9, 0x0f00f934, 0x3483617f, ++ /* 148 */ 0x9609a88e, 0xad8a30c5, 0xe10e9818, 0xda8d0053, ++ /* 152 */ 0x7f6a0dbb, 0x44e995f0, 0x086d3d2d, 0x33eea566, ++ /* 156 */ 0x91646c97, 0xaae7f4dc, 0xe6635c01, 0xdde0c44a, ++ /* 160 */ 0x6b6b51f4, 0x50e8c9bf, 0x1c6c6162, 0x27eff929, ++ /* 164 */ 0x856530d8, 0xbee6a893, 0xf262004e, 0xc9e19805, ++ /* 168 */ 0x6c0695ed, 0x57850da6, 0x1b01a57b, 0x20823d30, ++ /* 172 */ 0x8208f4c1, 0xb98b6c8a, 0xf50fc457, 0xce8c5c1c, ++ /* 176 */ 0x65b0d9c6, 0x5e33418d, 0x12b7e950, 0x2934711b, ++ /* 180 */ 0x8bbeb8ea, 0xb03d20a1, 0xfcb9887c, 0xc73a1037, ++ /* 184 */ 0x62dd1ddf, 0x595e8594, 0x15da2d49, 0x2e59b502, ++ /* 188 */ 0x8cd37cf3, 0xb750e4b8, 0xfbd44c65, 0xc057d42e, ++ /* 192 */ 0x4db26158, 0x7631f913, 0x3ab551ce, 0x0136c985, ++ /* 196 */ 0xa3bc0074, 0x983f983f, 0xd4bb30e2, 0xef38a8a9, ++ /* 200 */ 0x4adfa541, 0x715c3d0a, 0x3dd895d7, 0x065b0d9c, ++ /* 204 */ 0xa4d1c46d, 0x9f525c26, 0xd3d6f4fb, 0xe8556cb0, ++ /* 208 */ 0x4369e96a, 0x78ea7121, 0x346ed9fc, 0x0fed41b7, ++ /* 212 */ 0xad678846, 0x96e4100d, 0xda60b8d0, 0xe1e3209b, ++ /* 216 */ 0x44042d73, 0x7f87b538, 0x33031de5, 0x088085ae, ++ /* 220 */ 0xaa0a4c5f, 0x9189d414, 0xdd0d7cc9, 0xe68ee482, ++ /* 224 */ 0x5005713c, 0x6b86e977, 0x270241aa, 0x1c81d9e1, ++ /* 228 */ 0xbe0b1010, 0x8588885b, 0xc90c2086, 0xf28fb8cd, ++ /* 232 */ 0x5768b525, 0x6ceb2d6e, 0x206f85b3, 0x1bec1df8, ++ /* 236 */ 0xb966d409, 0x82e54c42, 0xce61e49f, 0xf5e27cd4, ++ /* 240 */ 0x5edef90e, 0x655d6145, 0x29d9c998, 0x125a51d3, ++ /* 244 */ 0xb0d09822, 0x8b530069, 0xc7d7a8b4, 0xfc5430ff, ++ /* 248 */ 0x59b33d17, 0x6230a55c, 0x2eb40d81, 0x153795ca, ++ /* 252 */ 0xb7bd5c3b, 0x8c3ec470, 0xc0ba6cad, 0xfb39f4e6, ++}; ++ ++unsigned int apc_crc32(const char* buf, int len) ++{ ++ int i; ++ int k; ++ unsigned int crc; ++ ++ /* preconditioning */ ++ crc = 0xFFFFFFFF; ++ ++ for (i = 0; i < len; i++) { ++ k = (crc ^ buf[i]) & 0x000000FF; ++ crc = ((crc >> 8) & 0x00FFFFFF) ^ crc32tab[k]; ++ } ++ ++ /* postconditioning */ ++ return ~crc; ++} ++ ++/* crc32gen: generate the nth (0..255) crc32 table value */ ++#if 0 ++static unsigned long crc32gen(int n) ++{ ++ int i; ++ unsigned long crc; ++ ++ crc = n; ++ for (i = 8; i >= 0; i--) { ++ if (crc & 1) { ++ crc = (crc >> 1) ^ 0xEDB88320; ++ } ++ else { ++ crc >>= 1; ++ } ++ } ++ return crc; ++} ++#endif ++ ++/* }}} */ ++ ++ ++/* {{{ apc_flip_hash() */ ++HashTable* apc_flip_hash(HashTable *hash) { ++ zval **entry, *data; ++ HashTable *new_hash; ++ HashPosition pos; ++ ++ if(hash == NULL) return hash; ++ ++ MAKE_STD_ZVAL(data); ++ ZVAL_LONG(data, 1); ++ ++ new_hash = emalloc(sizeof(HashTable)); ++ zend_hash_init(new_hash, hash->nTableSize, NULL, ZVAL_PTR_DTOR, 0); ++ ++ zend_hash_internal_pointer_reset_ex(hash, &pos); ++ while (zend_hash_get_current_data_ex(hash, (void **)&entry, &pos) == SUCCESS) { ++ if(Z_TYPE_PP(entry) == IS_STRING) { ++ zend_hash_update(new_hash, Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) +1, &data, sizeof(data), NULL); ++ } else { ++ zend_hash_index_update(new_hash, Z_LVAL_PP(entry), &data, sizeof(data), NULL); ++ } ++ Z_ADDREF_P(data); ++ zend_hash_move_forward_ex(hash, &pos); ++ } ++ zval_ptr_dtor(&data); ++ ++ return new_hash; ++} ++/* }}} */ ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_cache.c b/ext/apc/apc_cache.c +--- a/ext/apc/apc_cache.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_cache.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,1383 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | Rasmus Lerdorf | ++ | Arun C. Murthy | ++ | Gopal Vijayaraghavan | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_cache.c 325482 2012-05-01 00:09:36Z rasmus $ */ ++ ++#include "apc_cache.h" ++#include "apc_zend.h" ++#include "apc_sma.h" ++#include "apc_globals.h" ++#include "SAPI.h" ++#include "TSRM.h" ++#include "ext/standard/md5.h" ++ ++/* TODO: rehash when load factor exceeds threshold */ ++ ++#define CHECK(p) { if ((p) == NULL) return NULL; } ++ ++/* {{{ key_equals */ ++#define key_equals(a, b) (a.inode==b.inode && a.device==b.device) ++/* }}} */ ++ ++static void apc_cache_expunge(apc_cache_t* cache, size_t size TSRMLS_DC); ++ ++/* {{{ hash */ ++static unsigned long hash(apc_cache_key_t key) ++{ ++ return (unsigned long)(key.data.file.device + key.data.file.inode); ++} ++/* }}} */ ++ ++/* {{{ string_nhash_8 */ ++#define string_nhash_8(s,len) (unsigned long)(zend_inline_hash_func((s), len)) ++/* }}} */ ++ ++/* {{{ murmurhash */ ++#if 0 ++static inline unsigned long murmurhash(const char *skey, size_t keylen) ++{ ++ const long m = 0x7fd652ad; ++ const long r = 16; ++ unsigned int h = 0xdeadbeef; ++ ++ while(keylen >= 4) ++ { ++ h += *(unsigned int*)skey; ++ h *= m; ++ h ^= h >> r; ++ ++ skey += 4; ++ keylen -= 4; ++ } ++ ++ switch(keylen) ++ { ++ case 3: ++ h += skey[2] << 16; ++ case 2: ++ h += skey[1] << 8; ++ case 1: ++ h += skey[0]; ++ h *= m; ++ h ^= h >> r; ++ }; ++ ++ h *= m; ++ h ^= h >> 10; ++ h *= m; ++ h ^= h >> 17; ++ ++ return h; ++} ++#endif ++/* }}} */ ++ ++ ++/* {{{ make_prime */ ++static int const primes[] = { ++ 257, /* 256 */ ++ 521, /* 512 */ ++ 1031, /* 1024 */ ++ 2053, /* 2048 */ ++ 3079, /* 3072 */ ++ 4099, /* 4096 */ ++ 5147, /* 5120 */ ++ 6151, /* 6144 */ ++ 7177, /* 7168 */ ++ 8209, /* 8192 */ ++ 9221, /* 9216 */ ++10243, /* 10240 */ ++11273, /* 11264 */ ++12289, /* 12288 */ ++13313, /* 13312 */ ++14341, /* 14336 */ ++15361, /* 15360 */ ++16411, /* 16384 */ ++17417, /* 17408 */ ++18433, /* 18432 */ ++19457, /* 19456 */ ++0 /* sentinel */ ++}; ++ ++static int make_prime(int n) ++{ ++ int *k = (int*)primes; ++ while(*k) { ++ if((*k) > n) return *k; ++ k++; ++ } ++ return *(k-1); ++} ++/* }}} */ ++ ++/* {{{ make_slot */ ++slot_t* make_slot(apc_cache_key_t *key, apc_cache_entry_t* value, slot_t* next, time_t t TSRMLS_DC) ++{ ++ slot_t* p = apc_pool_alloc(value->pool, sizeof(slot_t)); ++ ++ if (!p) return NULL; ++ ++ if(key->type == APC_CACHE_KEY_USER) { ++ char *identifier = (char*) apc_pmemcpy(key->data.user.identifier, key->data.user.identifier_len, value->pool TSRMLS_CC); ++ if (!identifier) { ++ return NULL; ++ } ++ key->data.user.identifier = identifier; ++ } else if(key->type == APC_CACHE_KEY_FPFILE) { ++ char *fullpath = (char*) apc_pstrdup(key->data.fpfile.fullpath, value->pool TSRMLS_CC); ++ if (!fullpath) { ++ return NULL; ++ } ++ key->data.fpfile.fullpath = fullpath; ++ } ++ p->key = key[0]; ++ p->value = value; ++ p->next = next; ++ p->num_hits = 0; ++ p->creation_time = t; ++ p->access_time = t; ++ p->deletion_time = 0; ++ return p; ++} ++/* }}} */ ++ ++/* {{{ free_slot */ ++static void free_slot(slot_t* slot TSRMLS_DC) ++{ ++ apc_pool_destroy(slot->value->pool TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ remove_slot */ ++static void remove_slot(apc_cache_t* cache, slot_t** slot TSRMLS_DC) ++{ ++ slot_t* dead = *slot; ++ *slot = (*slot)->next; ++ ++ cache->header->mem_size -= dead->value->mem_size; ++ CACHE_FAST_DEC(cache, cache->header->num_entries); ++ if (dead->value->ref_count <= 0) { ++ free_slot(dead TSRMLS_CC); ++ } ++ else { ++ dead->next = cache->header->deleted_list; ++ dead->deletion_time = time(0); ++ cache->header->deleted_list = dead; ++ } ++} ++/* }}} */ ++ ++/* {{{ process_pending_removals */ ++static void process_pending_removals(apc_cache_t* cache TSRMLS_DC) ++{ ++ slot_t** slot; ++ time_t now; ++ ++ /* This function scans the list of removed cache entries and deletes any ++ * entry whose reference count is zero (indicating that it is no longer ++ * being executed) or that has been on the pending list for more than ++ * cache->gc_ttl seconds (we issue a warning in the latter case). ++ */ ++ ++ if (!cache->header->deleted_list) ++ return; ++ ++ slot = &cache->header->deleted_list; ++ now = time(0); ++ ++ while (*slot != NULL) { ++ int gc_sec = cache->gc_ttl ? (now - (*slot)->deletion_time) : 0; ++ ++ if ((*slot)->value->ref_count <= 0 || gc_sec > cache->gc_ttl) { ++ slot_t* dead = *slot; ++ ++ if (dead->value->ref_count > 0) { ++ switch(dead->value->type) { ++ case APC_CACHE_ENTRY_FILE: ++ apc_debug("GC cache entry '%s' (dev=%d ino=%d) was on gc-list for %d seconds" TSRMLS_CC, ++ dead->value->data.file.filename, dead->key.data.file.device, dead->key.data.file.inode, gc_sec); ++ break; ++ case APC_CACHE_ENTRY_USER: ++ apc_debug("GC cache entry '%s' was on gc-list for %d seconds" TSRMLS_CC, dead->value->data.user.info, gc_sec); ++ break; ++ } ++ } ++ *slot = dead->next; ++ free_slot(dead TSRMLS_CC); ++ } ++ else { ++ slot = &(*slot)->next; ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ prevent_garbage_collection */ ++static void prevent_garbage_collection(apc_cache_entry_t* entry) ++{ ++ /* set reference counts on zend objects to an arbitrarily high value to ++ * prevent garbage collection after execution */ ++ ++ enum { BIG_VALUE = 1000 }; ++ ++ if(entry->data.file.op_array) { ++ entry->data.file.op_array->refcount[0] = BIG_VALUE; ++ } ++ if (entry->data.file.functions) { ++ int i; ++ apc_function_t* fns = entry->data.file.functions; ++ for (i=0; fns[i].function != NULL; i++) { ++ *(fns[i].function->op_array.refcount) = BIG_VALUE; ++ } ++ } ++ if (entry->data.file.classes) { ++ int i; ++ apc_class_t* classes = entry->data.file.classes; ++ for (i=0; classes[i].class_entry != NULL; i++) { ++ classes[i].class_entry->refcount = BIG_VALUE; ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ apc_cache_create */ ++apc_cache_t* apc_cache_create(int size_hint, int gc_ttl, int ttl TSRMLS_DC) ++{ ++ apc_cache_t* cache; ++ int cache_size; ++ int num_slots; ++ ++ num_slots = make_prime(size_hint > 0 ? size_hint : 2000); ++ ++ cache = (apc_cache_t*) apc_emalloc(sizeof(apc_cache_t) TSRMLS_CC); ++ cache_size = sizeof(cache_header_t) + num_slots*sizeof(slot_t*); ++ ++ cache->shmaddr = apc_sma_malloc(cache_size TSRMLS_CC); ++ if(!cache->shmaddr) { ++ apc_error("Unable to allocate shared memory for cache structures. (Perhaps your shared memory size isn't large enough?). " TSRMLS_CC); ++ return NULL; ++ } ++ memset(cache->shmaddr, 0, cache_size); ++ ++ cache->header = (cache_header_t*) cache->shmaddr; ++ cache->header->num_hits = 0; ++ cache->header->num_misses = 0; ++ cache->header->deleted_list = NULL; ++ cache->header->start_time = time(NULL); ++ cache->header->expunges = 0; ++ cache->header->busy = 0; ++ ++ cache->slots = (slot_t**) (((char*) cache->shmaddr) + sizeof(cache_header_t)); ++ cache->num_slots = num_slots; ++ cache->gc_ttl = gc_ttl; ++ cache->ttl = ttl; ++ CREATE_LOCK(cache->header->lock); ++#if NONBLOCKING_LOCK_AVAILABLE ++ CREATE_LOCK(cache->header->wrlock); ++#endif ++ memset(cache->slots, 0, sizeof(slot_t*)*num_slots); ++ cache->expunge_cb = apc_cache_expunge; ++ cache->has_lock = 0; ++ ++ return cache; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_destroy */ ++void apc_cache_destroy(apc_cache_t* cache TSRMLS_DC) ++{ ++ DESTROY_LOCK(cache->header->lock); ++#if NONBLOCKING_LOCK_AVAILABLE ++ DESTROY_LOCK(cache->header->wrlock); ++#endif ++ apc_efree(cache TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ apc_cache_clear */ ++void apc_cache_clear(apc_cache_t* cache TSRMLS_DC) ++{ ++ int i; ++ ++ if(!cache) return; ++ ++ CACHE_LOCK(cache); ++ cache->header->busy = 1; ++ cache->header->num_hits = 0; ++ cache->header->num_misses = 0; ++ cache->header->start_time = time(NULL); ++ cache->header->expunges = 0; ++ ++ for (i = 0; i < cache->num_slots; i++) { ++ slot_t* p = cache->slots[i]; ++ while (p) { ++ remove_slot(cache, &p TSRMLS_CC); ++ } ++ cache->slots[i] = NULL; ++ } ++ ++ memset(&cache->header->lastkey, 0, sizeof(apc_keyid_t)); ++ ++ cache->header->busy = 0; ++ CACHE_UNLOCK(cache); ++} ++/* }}} */ ++ ++/* {{{ apc_cache_expunge */ ++static void apc_cache_expunge(apc_cache_t* cache, size_t size TSRMLS_DC) ++{ ++ int i; ++ time_t t; ++ ++ t = apc_time(); ++ ++ if(!cache) return; ++ ++ if(!cache->ttl) { ++ /* ++ * If cache->ttl is not set, we wipe out the entire cache when ++ * we run out of space. ++ */ ++ CACHE_SAFE_LOCK(cache); ++ process_pending_removals(cache TSRMLS_CC); ++ if (apc_sma_get_avail_mem() > (size_t)(APCG(shm_size)/2)) { ++ /* probably a queued up expunge, we don't need to do this */ ++ CACHE_SAFE_UNLOCK(cache); ++ return; ++ } ++ cache->header->busy = 1; ++ CACHE_FAST_INC(cache, cache->header->expunges); ++clear_all: ++ for (i = 0; i < cache->num_slots; i++) { ++ slot_t* p = cache->slots[i]; ++ while (p) { ++ remove_slot(cache, &p TSRMLS_CC); ++ } ++ cache->slots[i] = NULL; ++ } ++ memset(&cache->header->lastkey, 0, sizeof(apc_keyid_t)); ++ cache->header->busy = 0; ++ CACHE_SAFE_UNLOCK(cache); ++ } else { ++ slot_t **p; ++ /* ++ * If the ttl for the cache is set we walk through and delete stale ++ * entries. For the user cache that is slightly confusing since ++ * we have the individual entry ttl's we can look at, but that would be ++ * too much work. So if you want the user cache expunged, set a high ++ * default apc.user_ttl and still provide a specific ttl for each entry ++ * on insert ++ */ ++ ++ CACHE_SAFE_LOCK(cache); ++ process_pending_removals(cache TSRMLS_CC); ++ if (apc_sma_get_avail_mem() > (size_t)(APCG(shm_size)/2)) { ++ /* probably a queued up expunge, we don't need to do this */ ++ CACHE_SAFE_UNLOCK(cache); ++ return; ++ } ++ cache->header->busy = 1; ++ CACHE_FAST_INC(cache, cache->header->expunges); ++ for (i = 0; i < cache->num_slots; i++) { ++ p = &cache->slots[i]; ++ while(*p) { ++ /* ++ * For the user cache we look at the individual entry ttl values ++ * and if not set fall back to the default ttl for the user cache ++ */ ++ if((*p)->value->type == APC_CACHE_ENTRY_USER) { ++ if((*p)->value->data.user.ttl) { ++ if((time_t) ((*p)->creation_time + (*p)->value->data.user.ttl) < t) { ++ remove_slot(cache, p TSRMLS_CC); ++ continue; ++ } ++ } else if(cache->ttl) { ++ if((*p)->creation_time + cache->ttl < t) { ++ remove_slot(cache, p TSRMLS_CC); ++ continue; ++ } ++ } ++ } else if((*p)->access_time < (t - cache->ttl)) { ++ remove_slot(cache, p TSRMLS_CC); ++ continue; ++ } ++ p = &(*p)->next; ++ } ++ } ++ ++ if (!apc_sma_get_avail_size(size)) { ++ /* TODO: re-do this to remove goto across locked sections */ ++ goto clear_all; ++ } ++ memset(&cache->header->lastkey, 0, sizeof(apc_keyid_t)); ++ cache->header->busy = 0; ++ CACHE_SAFE_UNLOCK(cache); ++ } ++} ++/* }}} */ ++ ++/* {{{ apc_cache_insert */ ++static inline int _apc_cache_insert(apc_cache_t* cache, ++ apc_cache_key_t key, ++ apc_cache_entry_t* value, ++ apc_context_t* ctxt, ++ time_t t ++ TSRMLS_DC) ++{ ++ slot_t** slot; ++ ++ if (!value) { ++ return 0; ++ } ++ ++ apc_debug("Inserting [%s]\n" TSRMLS_CC, value->data.file.filename); ++ ++ process_pending_removals(cache TSRMLS_CC); ++ ++ slot = &cache->slots[key.h % cache->num_slots]; ++ ++ while(*slot) { ++ if(key.type == (*slot)->key.type) { ++ if(key.type == APC_CACHE_KEY_FILE) { ++ if(key_equals((*slot)->key.data.file, key.data.file)) { ++ /* If existing slot for the same device+inode is different, remove it and insert the new version */ ++ if (ctxt->force_update || (*slot)->key.mtime != key.mtime) { ++ remove_slot(cache, slot TSRMLS_CC); ++ break; ++ } ++ return 0; ++ } else if(cache->ttl && (*slot)->access_time < (t - cache->ttl)) { ++ remove_slot(cache, slot TSRMLS_CC); ++ continue; ++ } ++ } else { /* APC_CACHE_KEY_FPFILE */ ++ if((key.h == (*slot)->key.h) && ++ !memcmp((*slot)->key.data.fpfile.fullpath, key.data.fpfile.fullpath, key.data.fpfile.fullpath_len+1)) { ++ /* Hrm.. it's already here, remove it and insert new one */ ++ remove_slot(cache, slot TSRMLS_CC); ++ break; ++ } else if(cache->ttl && (*slot)->access_time < (t - cache->ttl)) { ++ remove_slot(cache, slot TSRMLS_CC); ++ continue; ++ } ++ } ++ } ++ slot = &(*slot)->next; ++ } ++ ++ if ((*slot = make_slot(&key, value, *slot, t TSRMLS_CC)) == NULL) { ++ return -1; ++ } ++ ++ value->mem_size = ctxt->pool->size; ++ cache->header->mem_size += ctxt->pool->size; ++ CACHE_FAST_INC(cache, cache->header->num_entries); ++ CACHE_FAST_INC(cache, cache->header->num_inserts); ++ ++ return 1; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_insert */ ++int apc_cache_insert(apc_cache_t* cache, apc_cache_key_t key, apc_cache_entry_t* value, apc_context_t *ctxt, time_t t TSRMLS_DC) ++{ ++ int rval; ++ CACHE_LOCK(cache); ++ rval = _apc_cache_insert(cache, key, value, ctxt, t TSRMLS_CC); ++ CACHE_UNLOCK(cache); ++ return rval; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_insert */ ++int *apc_cache_insert_mult(apc_cache_t* cache, apc_cache_key_t* keys, apc_cache_entry_t** values, apc_context_t *ctxt, time_t t, int num_entries TSRMLS_DC) ++{ ++ int *rval; ++ int i; ++ ++ rval = emalloc(sizeof(int) * num_entries); ++ CACHE_LOCK(cache); ++ for (i=0; i < num_entries; i++) { ++ if (values[i]) { ++ ctxt->pool = values[i]->pool; ++ rval[i] = _apc_cache_insert(cache, keys[i], values[i], ctxt, t TSRMLS_CC); ++ } ++ } ++ CACHE_UNLOCK(cache); ++ return rval; ++} ++/* }}} */ ++ ++ ++/* {{{ apc_cache_user_insert */ ++int apc_cache_user_insert(apc_cache_t* cache, apc_cache_key_t key, apc_cache_entry_t* value, apc_context_t* ctxt, time_t t, int exclusive TSRMLS_DC) ++{ ++ slot_t** slot; ++ unsigned int keylen = key.data.user.identifier_len; ++ apc_keyid_t *lastkey = &cache->header->lastkey; ++ ++ if (!value) { ++ return 0; ++ } ++ ++ if(apc_cache_busy(cache)) { ++ /* cache cleanup in progress, do not wait */ ++ return 0; ++ } ++ ++ if(apc_cache_is_last_key(cache, &key, t TSRMLS_CC)) { ++ /* potential cache slam */ ++ return 0; ++ } ++ ++ CACHE_LOCK(cache); ++ ++ memset(lastkey, 0, sizeof(apc_keyid_t)); ++ ++ lastkey->h = key.h; ++ lastkey->keylen = keylen; ++ lastkey->mtime = t; ++#ifdef ZTS ++ lastkey->tid = tsrm_thread_id(); ++#else ++ lastkey->pid = getpid(); ++#endif ++ ++ /* we do not reset lastkey after the insert. Whether it is inserted ++ * or not, another insert in the same second is always a bad idea. ++ */ ++ ++ process_pending_removals(cache TSRMLS_CC); ++ ++ slot = &cache->slots[key.h % cache->num_slots]; ++ ++ while (*slot) { ++ if (((*slot)->key.h == key.h) && ++ (!memcmp((*slot)->key.data.user.identifier, key.data.user.identifier, keylen))) { ++ /* ++ * At this point we have found the user cache entry. If we are doing ++ * an exclusive insert (apc_add) we are going to bail right away if ++ * the user entry already exists and it has no ttl, or ++ * there is a ttl and the entry has not timed out yet. ++ */ ++ if(exclusive && ( !(*slot)->value->data.user.ttl || ++ ( (*slot)->value->data.user.ttl && (time_t) ((*slot)->creation_time + (*slot)->value->data.user.ttl) >= t ) ++ ) ) { ++ goto fail; ++ } ++ remove_slot(cache, slot TSRMLS_CC); ++ break; ++ } else ++ /* ++ * This is a bit nasty. The idea here is to do runtime cleanup of the linked list of ++ * slot entries so we don't always have to skip past a bunch of stale entries. We check ++ * for staleness here and get rid of them by first checking to see if the cache has a global ++ * access ttl on it and removing entries that haven't been accessed for ttl seconds and secondly ++ * we see if the entry has a hard ttl on it and remove it if it has been around longer than its ttl ++ */ ++ if((cache->ttl && (*slot)->access_time < (t - cache->ttl)) || ++ ((*slot)->value->data.user.ttl && (time_t) ((*slot)->creation_time + (*slot)->value->data.user.ttl) < t)) { ++ remove_slot(cache, slot TSRMLS_CC); ++ continue; ++ } ++ slot = &(*slot)->next; ++ } ++ ++ if ((*slot = make_slot(&key, value, *slot, t TSRMLS_CC)) == NULL) { ++ goto fail; ++ } ++ ++ value->mem_size = ctxt->pool->size; ++ cache->header->mem_size += ctxt->pool->size; ++ ++ CACHE_FAST_INC(cache, cache->header->num_entries); ++ CACHE_FAST_INC(cache, cache->header->num_inserts); ++ ++ CACHE_UNLOCK(cache); ++ ++ return 1; ++ ++fail: ++ CACHE_UNLOCK(cache); ++ ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_find_slot */ ++slot_t* apc_cache_find_slot(apc_cache_t* cache, apc_cache_key_t key, time_t t TSRMLS_DC) ++{ ++ slot_t** slot; ++ volatile slot_t* retval = NULL; ++ ++ CACHE_RDLOCK(cache); ++ if(key.type == APC_CACHE_KEY_FILE) slot = &cache->slots[hash(key) % cache->num_slots]; ++ else slot = &cache->slots[key.h % cache->num_slots]; ++ ++ while (*slot) { ++ if(key.type == (*slot)->key.type) { ++ if(key.type == APC_CACHE_KEY_FILE) { ++ if(key_equals((*slot)->key.data.file, key.data.file)) { ++ if((*slot)->key.mtime != key.mtime) { ++ #if (USE_READ_LOCKS == 0) ++ /* this is merely a memory-friendly optimization, if we do have a write-lock ++ * might as well move this to the deleted_list right-away. Otherwise an insert ++ * of the same key wil do it (or an expunge, *eventually*). ++ */ ++ remove_slot(cache, slot TSRMLS_CC); ++ #endif ++ CACHE_SAFE_INC(cache, cache->header->num_misses); ++ CACHE_RDUNLOCK(cache); ++ return NULL; ++ } ++ CACHE_SAFE_INC(cache, (*slot)->num_hits); ++ CACHE_SAFE_INC(cache, (*slot)->value->ref_count); ++ (*slot)->access_time = t; ++ prevent_garbage_collection((*slot)->value); ++ CACHE_FAST_INC(cache, cache->header->num_hits); ++ retval = *slot; ++ CACHE_RDUNLOCK(cache); ++ return (slot_t*)retval; ++ } ++ } else { /* APC_CACHE_KEY_FPFILE */ ++ if(((*slot)->key.h == key.h) && ++ !memcmp((*slot)->key.data.fpfile.fullpath, key.data.fpfile.fullpath, key.data.fpfile.fullpath_len+1)) { ++ /* TTL Check ? */ ++ CACHE_SAFE_INC(cache, (*slot)->num_hits); ++ CACHE_SAFE_INC(cache, (*slot)->value->ref_count); ++ (*slot)->access_time = t; ++ prevent_garbage_collection((*slot)->value); ++ CACHE_FAST_INC(cache, cache->header->num_hits); ++ retval = *slot; ++ CACHE_RDUNLOCK(cache); ++ return (slot_t*)retval; ++ } ++ } ++ } ++ slot = &(*slot)->next; ++ } ++ CACHE_FAST_INC(cache, cache->header->num_misses); ++ CACHE_RDUNLOCK(cache); ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_find */ ++apc_cache_entry_t* apc_cache_find(apc_cache_t* cache, apc_cache_key_t key, time_t t TSRMLS_DC) ++{ ++ slot_t * slot = apc_cache_find_slot(cache, key, t TSRMLS_CC); ++ apc_debug("apc_cache_find [%i]\n" TSRMLS_CC, key.h); ++ return (slot) ? slot->value : NULL; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_user_find */ ++apc_cache_entry_t* apc_cache_user_find(apc_cache_t* cache, char *strkey, int keylen, time_t t TSRMLS_DC) ++{ ++ slot_t** slot; ++ volatile apc_cache_entry_t* value = NULL; ++ unsigned long h; ++ ++ if(apc_cache_busy(cache)) ++ { ++ /* cache cleanup in progress */ ++ return NULL; ++ } ++ ++ CACHE_RDLOCK(cache); ++ ++ h = string_nhash_8(strkey, keylen); ++ ++ slot = &cache->slots[h % cache->num_slots]; ++ ++ while (*slot) { ++ if ((h == (*slot)->key.h) && ++ !memcmp((*slot)->key.data.user.identifier, strkey, keylen)) { ++ /* Check to make sure this entry isn't expired by a hard TTL */ ++ if((*slot)->value->data.user.ttl && (time_t) ((*slot)->creation_time + (*slot)->value->data.user.ttl) < t) { ++ #if (USE_READ_LOCKS == 0) ++ /* this is merely a memory-friendly optimization, if we do have a write-lock ++ * might as well move this to the deleted_list right-away. Otherwise an insert ++ * of the same key wil do it (or an expunge, *eventually*). ++ */ ++ remove_slot(cache, slot TSRMLS_CC); ++ #endif ++ CACHE_FAST_INC(cache, cache->header->num_misses); ++ CACHE_RDUNLOCK(cache); ++ return NULL; ++ } ++ /* Otherwise we are fine, increase counters and return the cache entry */ ++ CACHE_SAFE_INC(cache, (*slot)->num_hits); ++ CACHE_SAFE_INC(cache, (*slot)->value->ref_count); ++ (*slot)->access_time = t; ++ ++ CACHE_FAST_INC(cache, cache->header->num_hits); ++ value = (*slot)->value; ++ CACHE_RDUNLOCK(cache); ++ return (apc_cache_entry_t*)value; ++ } ++ slot = &(*slot)->next; ++ } ++ ++ CACHE_FAST_INC(cache, cache->header->num_misses); ++ CACHE_RDUNLOCK(cache); ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_user_exists */ ++apc_cache_entry_t* apc_cache_user_exists(apc_cache_t* cache, char *strkey, int keylen, time_t t TSRMLS_DC) ++{ ++ slot_t** slot; ++ volatile apc_cache_entry_t* value = NULL; ++ unsigned long h; ++ ++ if(apc_cache_busy(cache)) ++ { ++ /* cache cleanup in progress */ ++ return NULL; ++ } ++ ++ CACHE_RDLOCK(cache); ++ ++ h = string_nhash_8(strkey, keylen); ++ ++ slot = &cache->slots[h % cache->num_slots]; ++ ++ while (*slot) { ++ if ((h == (*slot)->key.h) && ++ !memcmp((*slot)->key.data.user.identifier, strkey, keylen)) { ++ /* Check to make sure this entry isn't expired by a hard TTL */ ++ if((*slot)->value->data.user.ttl && (time_t) ((*slot)->creation_time + (*slot)->value->data.user.ttl) < t) { ++ CACHE_UNLOCK(cache); ++ return NULL; ++ } ++ /* Return the cache entry ptr */ ++ value = (*slot)->value; ++ CACHE_RDUNLOCK(cache); ++ return (apc_cache_entry_t*)value; ++ } ++ slot = &(*slot)->next; ++ } ++ CACHE_RDUNLOCK(cache); ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_user_update */ ++int _apc_cache_user_update(apc_cache_t* cache, char *strkey, int keylen, apc_cache_updater_t updater, void* data TSRMLS_DC) ++{ ++ slot_t** slot; ++ int retval; ++ unsigned long h; ++ ++ if(apc_cache_busy(cache)) ++ { ++ /* cache cleanup in progress */ ++ return 0; ++ } ++ ++ CACHE_LOCK(cache); ++ ++ h = string_nhash_8(strkey, keylen); ++ slot = &cache->slots[h % cache->num_slots]; ++ ++ while (*slot) { ++ if ((h == (*slot)->key.h) && ++ !memcmp((*slot)->key.data.user.identifier, strkey, keylen)) { ++ switch(Z_TYPE_P((*slot)->value->data.user.val) & ~IS_CONSTANT_INDEX) { ++ case IS_ARRAY: ++ case IS_CONSTANT_ARRAY: ++ case IS_OBJECT: ++ { ++ if(APCG(serializer)) { ++ retval = 0; ++ break; ++ } else { ++ /* fall through */ ++ } ++ } ++ /* fall through */ ++ default: ++ { ++ retval = updater(cache, (*slot)->value, data); ++ (*slot)->key.mtime = apc_time(); ++ } ++ break; ++ } ++ CACHE_UNLOCK(cache); ++ return retval; ++ } ++ slot = &(*slot)->next; ++ } ++ CACHE_UNLOCK(cache); ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_user_delete */ ++int apc_cache_user_delete(apc_cache_t* cache, char *strkey, int keylen TSRMLS_DC) ++{ ++ slot_t** slot; ++ unsigned long h; ++ ++ CACHE_LOCK(cache); ++ ++ h = string_nhash_8(strkey, keylen); ++ ++ slot = &cache->slots[h % cache->num_slots]; ++ ++ while (*slot) { ++ if ((h == (*slot)->key.h) && ++ !memcmp((*slot)->key.data.user.identifier, strkey, keylen)) { ++ remove_slot(cache, slot TSRMLS_CC); ++ CACHE_UNLOCK(cache); ++ return 1; ++ } ++ slot = &(*slot)->next; ++ } ++ ++ CACHE_UNLOCK(cache); ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_delete */ ++int apc_cache_delete(apc_cache_t* cache, char *filename, int filename_len TSRMLS_DC) ++{ ++ slot_t** slot; ++ time_t t; ++ apc_cache_key_t key; ++ ++ t = apc_time(); ++ ++ /* try to create a cache key; if we fail, give up on caching */ ++ if (!apc_cache_make_file_key(&key, filename, PG(include_path), t TSRMLS_CC)) { ++ apc_warning("Could not stat file %s, unable to delete from cache." TSRMLS_CC, filename); ++ return -1; ++ } ++ ++ CACHE_LOCK(cache); ++ ++ if(key.type == APC_CACHE_KEY_FILE) slot = &cache->slots[hash(key) % cache->num_slots]; ++ else slot = &cache->slots[key.h % cache->num_slots]; ++ ++ while(*slot) { ++ if(key.type == (*slot)->key.type) { ++ if(key.type == APC_CACHE_KEY_FILE) { ++ if(key_equals((*slot)->key.data.file, key.data.file)) { ++ remove_slot(cache, slot TSRMLS_CC); ++ CACHE_UNLOCK(cache); ++ return 1; ++ } ++ } else { /* APC_CACHE_KEY_FPFILE */ ++ if(((*slot)->key.h == key.h) && ++ (!memcmp((*slot)->key.data.fpfile.fullpath, key.data.fpfile.fullpath, key.data.fpfile.fullpath_len+1))) { ++ remove_slot(cache, slot TSRMLS_CC); ++ CACHE_UNLOCK(cache); ++ return 1; ++ } ++ } ++ } ++ slot = &(*slot)->next; ++ } ++ ++ memset(&cache->header->lastkey, 0, sizeof(apc_keyid_t)); ++ ++ CACHE_UNLOCK(cache); ++ return 0; ++ ++} ++/* }}} */ ++ ++/* {{{ apc_cache_release */ ++void apc_cache_release(apc_cache_t* cache, apc_cache_entry_t* entry TSRMLS_DC) ++{ ++ CACHE_SAFE_DEC(cache, entry->ref_count); ++} ++/* }}} */ ++ ++/* {{{ apc_cache_make_file_key */ ++int apc_cache_make_file_key(apc_cache_key_t* key, ++ const char* filename, ++ const char* include_path, ++ time_t t ++ TSRMLS_DC) ++{ ++ struct stat *tmp_buf=NULL; ++ struct apc_fileinfo_t *fileinfo = NULL; ++ int len; ++ ++ assert(key != NULL); ++ ++ if (!filename || !SG(request_info).path_translated) { ++ apc_debug("No filename and no path_translated - bailing\n" TSRMLS_CC); ++ goto cleanup; ++ } ++ ++ len = strlen(filename); ++ if(APCG(fpstat)==0) { ++ if(IS_ABSOLUTE_PATH(filename,len) || strstr(filename, "://")) { ++ key->data.fpfile.fullpath = filename; ++ key->data.fpfile.fullpath_len = len; ++ key->h = string_nhash_8(key->data.fpfile.fullpath, key->data.fpfile.fullpath_len); ++ key->mtime = t; ++ key->type = APC_CACHE_KEY_FPFILE; ++ goto success; ++ } else if(APCG(canonicalize)) { ++ ++ fileinfo = apc_php_malloc(sizeof(apc_fileinfo_t) TSRMLS_CC); ++ ++ if (apc_search_paths(filename, include_path, fileinfo TSRMLS_CC) != 0) { ++ apc_warning("apc failed to locate %s - bailing" TSRMLS_CC, filename); ++ goto cleanup; ++ } ++ ++ if(!VCWD_REALPATH(fileinfo->fullpath, APCG(canon_path))) { ++ apc_warning("realpath failed to canonicalize %s - bailing" TSRMLS_CC, filename); ++ goto cleanup; ++ } ++ ++ key->data.fpfile.fullpath = APCG(canon_path); ++ key->data.fpfile.fullpath_len = strlen(APCG(canon_path)); ++ key->h = string_nhash_8(key->data.fpfile.fullpath, key->data.fpfile.fullpath_len); ++ key->mtime = t; ++ key->type = APC_CACHE_KEY_FPFILE; ++ goto success; ++ } ++ /* fall through to stat mode */ ++ } ++ ++ fileinfo = apc_php_malloc(sizeof(apc_fileinfo_t) TSRMLS_CC); ++ ++ assert(fileinfo != NULL); ++ ++ if(!strcmp(SG(request_info).path_translated, filename)) { ++ tmp_buf = sapi_get_stat(TSRMLS_C); /* Apache has already done this stat() for us */ ++ } ++ ++ if(tmp_buf) { ++ fileinfo->st_buf.sb = *tmp_buf; ++ } else { ++ if (apc_search_paths(filename, include_path, fileinfo TSRMLS_CC) != 0) { ++ apc_debug("Stat failed %s - bailing (%s) (%d)\n" TSRMLS_CC, filename,SG(request_info).path_translated); ++ goto cleanup; ++ } ++ } ++ ++ if(APCG(max_file_size) < fileinfo->st_buf.sb.st_size) { ++ apc_debug("File is too big %s (%d - %ld) - bailing\n" TSRMLS_CC, filename,t,fileinfo->st_buf.sb.st_size); ++ goto cleanup; ++ } ++ ++ /* ++ * This is a bit of a hack. ++ * ++ * Here I am checking to see if the file is at least 2 seconds old. ++ * The idea is that if the file is currently being written to then its ++ * mtime is going to match or at most be 1 second off of the current ++ * request time and we want to avoid caching files that have not been ++ * completely written. Of course, people should be using atomic ++ * mechanisms to push files onto live web servers, but adding this ++ * tiny safety is easier than educating the world. This is now ++ * configurable, but the default is still 2 seconds. ++ */ ++ if(APCG(file_update_protection) && (t - fileinfo->st_buf.sb.st_mtime < APCG(file_update_protection)) && !APCG(force_file_update)) { ++ apc_debug("File is too new %s (%d - %d) - bailing\n" TSRMLS_CC,filename,t,fileinfo->st_buf.sb.st_mtime); ++ goto cleanup; ++ } ++ ++ key->data.file.device = fileinfo->st_buf.sb.st_dev; ++ key->data.file.inode = fileinfo->st_buf.sb.st_ino; ++ key->h = (unsigned long) key->data.file.device + (unsigned long) key->data.file.inode; ++ ++ /* ++ * If working with content management systems that like to munge the mtime, ++ * it might be appropriate to key off of the ctime to be immune to systems ++ * that try to backdate a template. If the mtime is set to something older ++ * than the previous mtime of a template we will obviously never see this ++ * "older" template. At some point the Smarty templating system did this. ++ * I generally disagree with using the ctime here because you lose the ++ * ability to warm up new content by saving it to a temporary file, hitting ++ * it once to cache it and then renaming it into its permanent location so ++ * set the apc.stat_ctime=true to enable this check. ++ */ ++ if(APCG(stat_ctime)) { ++ key->mtime = (fileinfo->st_buf.sb.st_ctime > fileinfo->st_buf.sb.st_mtime) ? fileinfo->st_buf.sb.st_ctime : fileinfo->st_buf.sb.st_mtime; ++ } else { ++ key->mtime = fileinfo->st_buf.sb.st_mtime; ++ } ++ key->type = APC_CACHE_KEY_FILE; ++ ++success: ++ ++ if(fileinfo != NULL) { ++ apc_php_free(fileinfo TSRMLS_CC); ++ } ++ ++ return 1; ++ ++cleanup: ++ ++ if(fileinfo != NULL) { ++ apc_php_free(fileinfo TSRMLS_CC); ++ } ++ ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_make_user_key */ ++int apc_cache_make_user_key(apc_cache_key_t* key, char* identifier, int identifier_len, const time_t t) ++{ ++ assert(key != NULL); ++ ++ if (!identifier) ++ return 0; ++ ++ key->data.user.identifier = identifier; ++ key->data.user.identifier_len = identifier_len; ++ key->h = string_nhash_8(key->data.user.identifier, key->data.user.identifier_len); ++ key->mtime = t; ++ key->type = APC_CACHE_KEY_USER; ++ return 1; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_make_file_entry */ ++apc_cache_entry_t* apc_cache_make_file_entry(const char* filename, ++ zend_op_array* op_array, ++ apc_function_t* functions, ++ apc_class_t* classes, ++ apc_context_t* ctxt ++ TSRMLS_DC) ++{ ++ apc_cache_entry_t* entry; ++ apc_pool* pool = ctxt->pool; ++ ++ entry = (apc_cache_entry_t*) apc_pool_alloc(pool, sizeof(apc_cache_entry_t)); ++ if (!entry) return NULL; ++ ++ entry->data.file.filename = apc_pstrdup(filename, pool TSRMLS_CC); ++ if(!entry->data.file.filename) { ++ apc_debug("apc_cache_make_file_entry: entry->data.file.filename is NULL - bailing\n" TSRMLS_CC); ++ return NULL; ++ } ++ apc_debug("apc_cache_make_file_entry: entry->data.file.filename is [%s]\n" TSRMLS_CC,entry->data.file.filename); ++ entry->data.file.op_array = op_array; ++ entry->data.file.functions = functions; ++ entry->data.file.classes = classes; ++ ++ entry->data.file.halt_offset = apc_file_halt_offset(filename TSRMLS_CC); ++ ++ entry->type = APC_CACHE_ENTRY_FILE; ++ entry->ref_count = 0; ++ entry->mem_size = 0; ++ entry->pool = pool; ++ return entry; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_store_zval */ ++zval* apc_cache_store_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ if (Z_TYPE_P(src) == IS_ARRAY) { ++ /* Maintain a list of zvals we've copied to properly handle recursive structures */ ++ zend_hash_init(&APCG(copied_zvals), 0, NULL, NULL, 0); ++ dst = apc_copy_zval(dst, src, ctxt TSRMLS_CC); ++ zend_hash_destroy(&APCG(copied_zvals)); ++ APCG(copied_zvals).nTableSize=0; ++ } else { ++ dst = apc_copy_zval(dst, src, ctxt TSRMLS_CC); ++ } ++ ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_fetch_zval */ ++zval* apc_cache_fetch_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ if (Z_TYPE_P(src) == IS_ARRAY) { ++ /* Maintain a list of zvals we've copied to properly handle recursive structures */ ++ zend_hash_init(&APCG(copied_zvals), 0, NULL, NULL, 0); ++ dst = apc_copy_zval(dst, src, ctxt TSRMLS_CC); ++ zend_hash_destroy(&APCG(copied_zvals)); ++ APCG(copied_zvals).nTableSize=0; ++ } else { ++ dst = apc_copy_zval(dst, src, ctxt TSRMLS_CC); ++ } ++ ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_make_user_entry */ ++apc_cache_entry_t* apc_cache_make_user_entry(const char* info, int info_len, const zval* val, apc_context_t* ctxt, const unsigned int ttl TSRMLS_DC) ++{ ++ apc_cache_entry_t* entry; ++ apc_pool* pool = ctxt->pool; ++ ++ entry = (apc_cache_entry_t*) apc_pool_alloc(pool, sizeof(apc_cache_entry_t)); ++ if (!entry) return NULL; ++ ++ entry->data.user.info = apc_pmemcpy(info, info_len, pool TSRMLS_CC); ++ entry->data.user.info_len = info_len; ++ if(!entry->data.user.info) { ++ return NULL; ++ } ++ entry->data.user.val = apc_cache_store_zval(NULL, val, ctxt TSRMLS_CC); ++ if(!entry->data.user.val) { ++ return NULL; ++ } ++ INIT_PZVAL(entry->data.user.val); ++ entry->data.user.ttl = ttl; ++ entry->type = APC_CACHE_ENTRY_USER; ++ entry->ref_count = 0; ++ entry->mem_size = 0; ++ entry->pool = pool; ++ return entry; ++} ++/* }}} */ ++ ++/* {{{ */ ++static zval* apc_cache_link_info(apc_cache_t *cache, slot_t* p TSRMLS_DC) ++{ ++ zval *link = NULL; ++ char md5str[33]; ++ ++ ALLOC_INIT_ZVAL(link); ++ ++ if(!link) { ++ return NULL; ++ } ++ ++ array_init(link); ++ ++ if(p->value->type == APC_CACHE_ENTRY_FILE) { ++ add_assoc_string(link, "type", "file", 1); ++ if(p->key.type == APC_CACHE_KEY_FILE) { ++ ++ #ifdef PHP_WIN32 ++ { ++ char buf[20]; ++ sprintf(buf, "%I64d", p->key.data.file.device); ++ add_assoc_string(link, "device", buf, 1); ++ ++ sprintf(buf, "%I64d", p->key.data.file.inode); ++ add_assoc_string(link, "inode", buf, 1); ++ } ++ #else ++ add_assoc_long(link, "device", p->key.data.file.device); ++ add_assoc_long(link, "inode", p->key.data.file.inode); ++ #endif ++ ++ add_assoc_string(link, "filename", p->value->data.file.filename, 1); ++ } else { /* This is a no-stat fullpath file entry */ ++ add_assoc_long(link, "device", 0); ++ add_assoc_long(link, "inode", 0); ++ add_assoc_string(link, "filename", (char*)p->key.data.fpfile.fullpath, 1); ++ } ++ if (APCG(file_md5)) { ++ make_digest(md5str, p->key.md5); ++ add_assoc_string(link, "md5", md5str, 1); ++ } ++ } else if(p->value->type == APC_CACHE_ENTRY_USER) { ++ add_assoc_stringl(link, "info", p->value->data.user.info, p->value->data.user.info_len-1, 1); ++ add_assoc_long(link, "ttl", (long)p->value->data.user.ttl); ++ add_assoc_string(link, "type", "user", 1); ++ } ++ ++ add_assoc_double(link, "num_hits", (double)p->num_hits); ++ add_assoc_long(link, "mtime", p->key.mtime); ++ add_assoc_long(link, "creation_time", p->creation_time); ++ add_assoc_long(link, "deletion_time", p->deletion_time); ++ add_assoc_long(link, "access_time", p->access_time); ++ add_assoc_long(link, "ref_count", p->value->ref_count); ++ add_assoc_long(link, "mem_size", p->value->mem_size); ++ ++ return link; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_info */ ++zval* apc_cache_info(apc_cache_t* cache, zend_bool limited TSRMLS_DC) ++{ ++ zval *info = NULL; ++ zval *list = NULL; ++ zval *deleted_list = NULL; ++ zval *slots = NULL; ++ slot_t* p; ++ int i, j; ++ ++ if(!cache) return NULL; ++ ++ CACHE_RDLOCK(cache); ++ ++ ALLOC_INIT_ZVAL(info); ++ ++ if(!info) { ++ CACHE_RDUNLOCK(cache); ++ return NULL; ++ } ++ ++ array_init(info); ++ add_assoc_long(info, "num_slots", cache->num_slots); ++ add_assoc_long(info, "ttl", cache->ttl); ++ ++ add_assoc_double(info, "num_hits", (double)cache->header->num_hits); ++ add_assoc_double(info, "num_misses", (double)cache->header->num_misses); ++ add_assoc_double(info, "num_inserts", (double)cache->header->num_inserts); ++ add_assoc_double(info, "expunges", (double)cache->header->expunges); ++ ++ add_assoc_long(info, "start_time", cache->header->start_time); ++ add_assoc_double(info, "mem_size", (double)cache->header->mem_size); ++ add_assoc_long(info, "num_entries", cache->header->num_entries); ++#ifdef MULTIPART_EVENT_FORMDATA ++ add_assoc_long(info, "file_upload_progress", 1); ++#else ++ add_assoc_long(info, "file_upload_progress", 0); ++#endif ++#if APC_MMAP ++ add_assoc_stringl(info, "memory_type", "mmap", sizeof("mmap")-1, 1); ++#else ++ add_assoc_stringl(info, "memory_type", "IPC shared", sizeof("IPC shared")-1, 1); ++#endif ++ add_assoc_stringl(info, "locking_type", APC_LOCK_TYPE, sizeof(APC_LOCK_TYPE)-1, 1); ++ ++ if(!limited) { ++ /* For each hashtable slot */ ++ ALLOC_INIT_ZVAL(list); ++ array_init(list); ++ ++ ALLOC_INIT_ZVAL(slots); ++ array_init(slots); ++ ++ for (i = 0; i < cache->num_slots; i++) { ++ p = cache->slots[i]; ++ j = 0; ++ for (; p != NULL; p = p->next) { ++ zval *link = apc_cache_link_info(cache, p TSRMLS_CC); ++ add_next_index_zval(list, link); ++ j++; ++ } ++ if(j != 0) { ++ add_index_long(slots, (ulong)i, j); ++ } ++ } ++ ++ /* For each slot pending deletion */ ++ ALLOC_INIT_ZVAL(deleted_list); ++ array_init(deleted_list); ++ ++ for (p = cache->header->deleted_list; p != NULL; p = p->next) { ++ zval *link = apc_cache_link_info(cache, p TSRMLS_CC); ++ add_next_index_zval(deleted_list, link); ++ } ++ ++ add_assoc_zval(info, "cache_list", list); ++ add_assoc_zval(info, "deleted_list", deleted_list); ++ add_assoc_zval(info, "slot_distribution", slots); ++ } ++ ++ CACHE_RDUNLOCK(cache); ++ return info; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_unlock */ ++void apc_cache_unlock(apc_cache_t* cache TSRMLS_DC) ++{ ++ CACHE_UNLOCK(cache); ++} ++/* }}} */ ++ ++/* {{{ apc_cache_busy */ ++zend_bool apc_cache_busy(apc_cache_t* cache) ++{ ++ return cache->header->busy; ++} ++/* }}} */ ++ ++/* {{{ apc_cache_is_last_key */ ++zend_bool apc_cache_is_last_key(apc_cache_t* cache, apc_cache_key_t* key, time_t t TSRMLS_DC) ++{ ++ apc_keyid_t *lastkey = &cache->header->lastkey; ++ unsigned int keylen = key->data.user.identifier_len; ++#ifdef ZTS ++ THREAD_T tid = tsrm_thread_id(); ++ #define FROM_DIFFERENT_THREAD(k) (memcmp(&((k)->tid), &tid, sizeof(THREAD_T))!=0) ++#else ++ pid_t pid = getpid(); ++ #define FROM_DIFFERENT_THREAD(k) (pid != (k)->pid) ++#endif ++ ++ ++ /* unlocked reads, but we're not shooting for 100% success with this */ ++ if(lastkey->h == key->h && keylen == lastkey->keylen) { ++ if(lastkey->mtime == t && FROM_DIFFERENT_THREAD(lastkey)) { ++ /* potential cache slam */ ++ if(APCG(slam_defense)) { ++ apc_debug("Potential cache slam averted for key '%s'" TSRMLS_CC, key->data.user.identifier); ++ return 1; ++ } ++ } ++ } ++ ++ return 0; ++} ++/* }}} */ ++ ++#if NONBLOCKING_LOCK_AVAILABLE ++/* {{{ apc_cache_write_lock */ ++zend_bool apc_cache_write_lock(apc_cache_t* cache TSRMLS_DC) ++{ ++ return apc_lck_nb_lock(cache->header->wrlock); ++} ++/* }}} */ ++ ++/* {{{ apc_cache_write_unlock */ ++void apc_cache_write_unlock(apc_cache_t* cache TSRMLS_DC) ++{ ++ apc_lck_unlock(cache->header->wrlock); ++} ++/* }}} */ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_cache.h b/ext/apc/apc_cache.h +--- a/ext/apc/apc_cache.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_cache.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,371 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | Rasmus Lerdorf | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_cache.h 324329 2012-03-18 15:29:37Z mike $ */ ++ ++#ifndef APC_CACHE_H ++#define APC_CACHE_H ++ ++/* ++ * This module defines the shared memory file cache. Basically all of the ++ * logic for storing and retrieving cache entries lives here. ++ */ ++ ++#include "apc.h" ++#include "apc_compile.h" ++#include "apc_lock.h" ++#include "apc_pool.h" ++#include "apc_main.h" ++#include "TSRM.h" ++ ++#define APC_CACHE_ENTRY_FILE 1 ++#define APC_CACHE_ENTRY_USER 2 ++ ++#define APC_CACHE_KEY_FILE 1 ++#define APC_CACHE_KEY_USER 2 ++#define APC_CACHE_KEY_FPFILE 3 ++ ++#ifdef PHP_WIN32 ++typedef unsigned __int64 apc_ino_t; ++typedef unsigned __int64 apc_dev_t; ++#else ++typedef ino_t apc_ino_t; ++typedef dev_t apc_dev_t; ++#endif ++ ++/* {{{ cache locking macros */ ++#define CACHE_LOCK(cache) { LOCK(cache->header->lock); cache->has_lock = 1; } ++#define CACHE_UNLOCK(cache) { UNLOCK(cache->header->lock); cache->has_lock = 0; } ++#define CACHE_SAFE_LOCK(cache) { if ((++cache->has_lock) == 1) LOCK(cache->header->lock); } ++#define CACHE_SAFE_UNLOCK(cache) { if ((--cache->has_lock) == 0) UNLOCK(cache->header->lock); } ++ ++#if (RDLOCK_AVAILABLE == 1) && defined(HAVE_ATOMIC_OPERATIONS) ++#define USE_READ_LOCKS 1 ++#define CACHE_RDLOCK(cache) { RDLOCK(cache->header->lock); cache->has_lock = 0; } ++#define CACHE_RDUNLOCK(cache) { RDUNLOCK(cache->header->lock); cache->has_lock = 0; } ++#define CACHE_SAFE_INC(cache, obj) { ATOMIC_INC(obj); } ++#define CACHE_SAFE_DEC(cache, obj) { ATOMIC_DEC(obj); } ++#else ++#define USE_READ_LOCKS 0 ++#define CACHE_RDLOCK(cache) { LOCK(cache->header->lock); cache->has_lock = 1; } ++#define CACHE_RDUNLOCK(cache) { UNLOCK(cache->header->lock); cache->has_lock = 0; } ++#define CACHE_SAFE_INC(cache, obj) { CACHE_SAFE_LOCK(cache); obj++; CACHE_SAFE_UNLOCK(cache);} ++#define CACHE_SAFE_DEC(cache, obj) { CACHE_SAFE_LOCK(cache); obj--; CACHE_SAFE_UNLOCK(cache);} ++#endif ++ ++#define CACHE_FAST_INC(cache, obj) { obj++; } ++#define CACHE_FAST_DEC(cache, obj) { obj--; } ++/* }}} */ ++ ++/* {{{ struct definition: apc_cache_key_t */ ++#define T apc_cache_t* ++typedef struct apc_cache_t apc_cache_t; /* opaque cache type */ ++ ++typedef union _apc_cache_key_data_t { ++ struct { ++ apc_dev_t device; /* the filesystem device */ ++ apc_ino_t inode; /* the filesystem inode */ ++ } file; ++ struct { ++ const char *identifier; ++ int identifier_len; ++ } user; ++ struct { ++ const char *fullpath; ++ int fullpath_len; ++ } fpfile; ++} apc_cache_key_data_t; ++ ++typedef struct apc_cache_key_t apc_cache_key_t; ++struct apc_cache_key_t { ++ apc_cache_key_data_t data; ++ unsigned long h; /* pre-computed hash value */ ++ time_t mtime; /* the mtime of this cached entry */ ++ unsigned char type; ++ unsigned char md5[16]; /* md5 hash of the source file */ ++}; ++ ++ ++typedef struct apc_keyid_t apc_keyid_t; ++ ++struct apc_keyid_t { ++ unsigned int h; ++ unsigned int keylen; ++ time_t mtime; ++#ifdef ZTS ++ THREAD_T tid; ++#else ++ pid_t pid; ++#endif ++}; ++/* }}} */ ++ ++/* {{{ struct definition: apc_cache_entry_t */ ++typedef union _apc_cache_entry_value_t { ++ struct { ++ char *filename; /* absolute path to source file */ ++ zend_op_array* op_array; /* op_array allocated in shared memory */ ++ apc_function_t* functions; /* array of apc_function_t's */ ++ apc_class_t* classes; /* array of apc_class_t's */ ++ long halt_offset; /* value of __COMPILER_HALT_OFFSET__ for the file */ ++ } file; ++ struct { ++ char *info; ++ int info_len; ++ zval *val; ++ unsigned int ttl; ++ } user; ++} apc_cache_entry_value_t; ++ ++typedef struct apc_cache_entry_t apc_cache_entry_t; ++struct apc_cache_entry_t { ++ apc_cache_entry_value_t data; ++ unsigned char type; ++ int ref_count; ++ size_t mem_size; ++ apc_pool *pool; ++}; ++/* }}} */ ++ ++/* ++ * apc_cache_create creates the shared memory compiler cache. This function ++ * should be called just once (ideally in the web server parent process, e.g. ++ * in apache), otherwise you will end up with multiple caches (which won't ++ * necessarily break anything). Returns a pointer to the cache object. ++ * ++ * size_hint is a "hint" at the total number of source files that will be ++ * cached. It determines the physical size of the hash table. Passing 0 for ++ * this argument will use a reasonable default value. ++ * ++ * gc_ttl is the maximum time a cache entry may speed on the garbage ++ * collection list. This is basically a work around for the inherent ++ * unreliability of our reference counting mechanism (see apc_cache_release). ++ * ++ * ttl is the maximum time a cache entry can idle in a slot in case the slot ++ * is needed. This helps in cleaning up the cache and ensuring that entries ++ * hit frequently stay cached and ones not hit very often eventually disappear. ++ */ ++extern T apc_cache_create(int size_hint, int gc_ttl, int ttl TSRMLS_DC); ++ ++/* ++ * apc_cache_destroy releases any OS resources associated with a cache object. ++ * Under apache, this function can be safely called by the child processes ++ * when they exit. ++ */ ++extern void apc_cache_destroy(T cache TSRMLS_DC); ++ ++/* ++ * apc_cache_clear empties a cache. This can safely be called at any time, ++ * even while other server processes are executing cached source files. ++ */ ++extern void apc_cache_clear(T cache TSRMLS_DC); ++ ++/* ++ * apc_cache_insert adds an entry to the cache, using a filename as a key. ++ * Internally, the filename is translated to a canonical representation, so ++ * that relative and absolute filenames will map to a single key. Returns ++ * non-zero if the file was successfully inserted, 0 otherwise. If 0 is ++ * returned, the caller must free the cache entry by calling ++ * apc_cache_free_entry (see below). ++ * ++ * key is the value created by apc_cache_make_file_key for file keys. ++ * ++ * value is a cache entry returned by apc_cache_make_entry (see below). ++ */ ++extern int apc_cache_insert(T cache, apc_cache_key_t key, ++ apc_cache_entry_t* value, apc_context_t* ctxt, time_t t TSRMLS_DC); ++ ++extern int apc_cache_user_insert(T cache, apc_cache_key_t key, ++ apc_cache_entry_t* value, apc_context_t* ctxt, time_t t, int exclusive TSRMLS_DC); ++ ++extern int *apc_cache_insert_mult(apc_cache_t* cache, apc_cache_key_t* keys, ++ apc_cache_entry_t** values, apc_context_t *ctxt, time_t t, int num_entries TSRMLS_DC); ++ ++/* ++ * apc_cache_find searches for a cache entry by filename, and returns a ++ * pointer to the entry if found, NULL otherwise. ++ * ++ * key is a value created by apc_cache_make_file_key for file keys. ++ */ ++extern apc_cache_entry_t* apc_cache_find(T cache, apc_cache_key_t key, time_t t TSRMLS_DC); ++ ++/* ++ * apc_cache_user_find searches for a cache entry by its hashed identifier, ++ * and returns a pointer to the entry if found, NULL otherwise. ++ * ++ */ ++extern apc_cache_entry_t* apc_cache_user_find(T cache, char* strkey, int keylen, time_t t TSRMLS_DC); ++ ++/* ++ * apc_cache_user_exists searches for a cache entry by its hashed identifier, ++ * and returns a pointer to the entry if found, NULL otherwise. This is a ++ * quick non-locking version of apc_cache_user_find that does not modify the ++ * shared memory segment in any way. ++ * ++ */ ++extern apc_cache_entry_t* apc_cache_user_exists(T cache, char* strkey, int keylen, time_t t TSRMLS_DC); ++ ++/* ++ * apc_cache_delete and apc_cache_user_delete finds an entry in the cache and deletes it. ++ */ ++extern int apc_cache_delete(apc_cache_t* cache, char *filename, int filename_len TSRMLS_DC); ++extern int apc_cache_user_delete(apc_cache_t* cache, char *strkey, int keylen TSRMLS_DC); ++ ++/* apc_cach_fetch_zval takes a zval in the cache and reconstructs a runtime ++ * zval from it. ++ * ++ */ ++zval* apc_cache_fetch_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC); ++ ++/* ++ * apc_cache_release decrements the reference count associated with a cache ++ * entry. Calling apc_cache_find automatically increments the reference count, ++ * and this function must be called post-execution to return the count to its ++ * original value. Failing to do so will prevent the entry from being ++ * garbage-collected. ++ * ++ * entry is the cache entry whose ref count you want to decrement. ++ */ ++extern void apc_cache_release(T cache, apc_cache_entry_t* entry TSRMLS_DC); ++ ++/* ++ * apc_cache_make_file_key creates a key object given a relative or absolute ++ * filename and an optional list of auxillary paths to search. include_path is ++ * searched if the filename cannot be found relative to the current working ++ * directory. ++ * ++ * key points to caller-allocated storage (must not be null). ++ * ++ * filename is the path to the source file. ++ * ++ * include_path is a colon-separated list of directories to search. ++ * ++ * and finally we pass in the current request time so we can avoid ++ * caching files with a current mtime which tends to indicate that ++ * they are still being written to. ++ */ ++extern int apc_cache_make_file_key(apc_cache_key_t* key, ++ const char* filename, ++ const char* include_path, ++ time_t t ++ TSRMLS_DC); ++ ++/* ++ * apc_cache_make_file_entry creates an apc_cache_entry_t object given a filename ++ * and the compilation results returned by the PHP compiler. ++ */ ++extern apc_cache_entry_t* apc_cache_make_file_entry(const char* filename, ++ zend_op_array* op_array, ++ apc_function_t* functions, ++ apc_class_t* classes, ++ apc_context_t* ctxt ++ TSRMLS_DC); ++ ++ ++zend_bool apc_compile_cache_entry(apc_cache_key_t *key, zend_file_handle* h, int type, time_t t, zend_op_array** op_array_pp, apc_cache_entry_t** cache_entry_pp TSRMLS_DC); ++ ++/* ++ * apc_cache_make_user_entry creates an apc_cache_entry_t object given an info string ++ * and the zval to be stored. ++ */ ++extern apc_cache_entry_t* apc_cache_make_user_entry(const char* info, int info_len, const zval *val, apc_context_t* ctxt, const unsigned int ttl TSRMLS_DC); ++ ++extern int apc_cache_make_user_key(apc_cache_key_t* key, char* identifier, int identifier_len, const time_t t); ++ ++/* {{{ struct definition: slot_t */ ++typedef struct slot_t slot_t; ++struct slot_t { ++ apc_cache_key_t key; /* slot key */ ++ apc_cache_entry_t* value; /* slot value */ ++ slot_t* next; /* next slot in linked list */ ++ unsigned long num_hits; /* number of hits to this bucket */ ++ time_t creation_time; /* time slot was initialized */ ++ time_t deletion_time; /* time slot was removed from cache */ ++ time_t access_time; /* time slot was last accessed */ ++}; ++/* }}} */ ++ ++/* {{{ struct definition: cache_header_t ++ Any values that must be shared among processes should go in here. */ ++typedef struct cache_header_t cache_header_t; ++struct cache_header_t { ++ apc_lck_t lock; /* read/write lock (exclusive blocking cache lock) */ ++ apc_lck_t wrlock; /* write lock (non-blocking used to prevent cache slams) */ ++ unsigned long num_hits; /* total successful hits in cache */ ++ unsigned long num_misses; /* total unsuccessful hits in cache */ ++ unsigned long num_inserts; /* total successful inserts in cache */ ++ unsigned long expunges; /* total number of expunges */ ++ slot_t* deleted_list; /* linked list of to-be-deleted slots */ ++ time_t start_time; /* time the above counters were reset */ ++ zend_bool busy; /* Flag to tell clients when we are busy cleaning the cache */ ++ int num_entries; /* Statistic on the number of entries */ ++ size_t mem_size; /* Statistic on the memory size used by this cache */ ++ apc_keyid_t lastkey; /* the key that is being inserted (user cache) */ ++}; ++/* }}} */ ++ ++typedef void (*apc_expunge_cb_t)(T cache, size_t n TSRMLS_DC); ++ ++/* {{{ struct definition: apc_cache_t */ ++struct apc_cache_t { ++ void* shmaddr; /* process (local) address of shared cache */ ++ cache_header_t* header; /* cache header (stored in SHM) */ ++ slot_t** slots; /* array of cache slots (stored in SHM) */ ++ int num_slots; /* number of slots in cache */ ++ int gc_ttl; /* maximum time on GC list for a slot */ ++ int ttl; /* if slot is needed and entry's access time is older than this ttl, remove it */ ++ apc_expunge_cb_t expunge_cb; /* cache specific expunge callback to free up sma memory */ ++ uint has_lock; /* flag for possible recursive locks within the same process */ ++}; ++/* }}} */ ++ ++extern zval* apc_cache_info(T cache, zend_bool limited TSRMLS_DC); ++extern void apc_cache_unlock(apc_cache_t* cache TSRMLS_DC); ++extern zend_bool apc_cache_busy(apc_cache_t* cache); ++extern zend_bool apc_cache_write_lock(apc_cache_t* cache TSRMLS_DC); ++extern void apc_cache_write_unlock(apc_cache_t* cache TSRMLS_DC); ++extern zend_bool apc_cache_is_last_key(apc_cache_t* cache, apc_cache_key_t* key, time_t t TSRMLS_DC); ++ ++/* used by apc_rfc1867 to update data in-place - not to be used elsewhere */ ++ ++typedef int (*apc_cache_updater_t)(apc_cache_t*, apc_cache_entry_t*, void* data); ++extern int _apc_cache_user_update(apc_cache_t* cache, char *strkey, int keylen, ++ apc_cache_updater_t updater, void* data TSRMLS_DC); ++ ++ ++#undef T ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_compile.c b/ext/apc/apc_compile.c +--- a/ext/apc/apc_compile.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_compile.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,2164 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | Rasmus Lerdorf | ++ | Arun C. Murthy | ++ | Gopal Vijayaraghavan | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_compile.c 326703 2012-07-19 17:06:12Z rasmus $ */ ++ ++#include "apc_compile.h" ++#include "apc_globals.h" ++#include "apc_zend.h" ++#include "apc_php.h" ++#include "apc_string.h" ++#include "ext/standard/php_var.h" ++#include "ext/standard/php_smart_str.h" ++ ++typedef void* (*ht_copy_fun_t)(void*, void*, apc_context_t* TSRMLS_DC); ++//typedef void (*ht_free_fun_t)(void*, apc_context_t*); ++typedef int (*ht_check_copy_fun_t)(Bucket*, va_list); ++ ++typedef void (*ht_fixup_fun_t)(Bucket*, zend_class_entry*, zend_class_entry*); ++ ++#define CHECK(p) { if ((p) == NULL) return NULL; } ++ ++/* {{{ internal function declarations */ ++ ++static zend_function* my_bitwise_copy_function(zend_function*, zend_function*, apc_context_t* TSRMLS_DC); ++ ++/* ++ * The "copy" functions perform deep-copies on a particular data structure ++ * (passed as the second argument). They also optionally allocate space for ++ * the destination data structure if the first argument is null. ++ */ ++static zval** my_copy_zval_ptr(zval**, const zval**, apc_context_t* TSRMLS_DC); ++static zval* my_copy_zval(zval*, const zval*, apc_context_t* TSRMLS_DC); ++#ifndef ZEND_ENGINE_2_4 ++static znode* my_copy_znode(znode*, znode*, apc_context_t* TSRMLS_DC); ++#endif ++static zend_op* my_copy_zend_op(zend_op*, zend_op*, apc_context_t* TSRMLS_DC); ++static zend_function* my_copy_function(zend_function*, zend_function*, apc_context_t* TSRMLS_DC); ++static zend_function_entry* my_copy_function_entry(zend_function_entry*, const zend_function_entry*, apc_context_t* TSRMLS_DC); ++static zend_class_entry* my_copy_class_entry(zend_class_entry*, zend_class_entry*, apc_context_t* TSRMLS_DC); ++static HashTable* my_copy_hashtable_ex(HashTable*, HashTable* TSRMLS_DC, ht_copy_fun_t, int, apc_context_t*, ht_check_copy_fun_t, ...); ++#define my_copy_hashtable( dst, src, copy_fn, holds_ptr, ctxt) \ ++ my_copy_hashtable_ex(dst, src TSRMLS_CC, copy_fn, holds_ptr, ctxt, NULL) ++static HashTable* my_copy_static_variables(zend_op_array* src, apc_context_t* TSRMLS_DC); ++static zend_property_info* my_copy_property_info(zend_property_info* dst, zend_property_info* src, apc_context_t* TSRMLS_DC); ++static zend_arg_info* my_copy_arg_info_array(zend_arg_info*, const zend_arg_info*, uint, apc_context_t* TSRMLS_DC); ++static zend_arg_info* my_copy_arg_info(zend_arg_info*, const zend_arg_info*, apc_context_t* TSRMLS_DC); ++ ++/* ++ * The "fixup" functions need for ZEND_ENGINE_2 ++ */ ++static void my_fixup_function( Bucket *p, zend_class_entry *src, zend_class_entry *dst ); ++static void my_fixup_hashtable( HashTable *ht, ht_fixup_fun_t fixup, zend_class_entry *src, zend_class_entry *dst ); ++/* my_fixup_function_for_execution is the same as my_fixup_function ++ * but named differently for clarity ++ */ ++#define my_fixup_function_for_execution my_fixup_function ++ ++#ifdef ZEND_ENGINE_2_2 ++static void my_fixup_property_info( Bucket *p, zend_class_entry *src, zend_class_entry *dst ); ++#define my_fixup_property_info_for_execution my_fixup_property_info ++#endif ++ ++/* ++ * These functions return "1" if the member/function is ++ * defined/overridden in the 'current' class and not inherited. ++ */ ++static int my_check_copy_function(Bucket* src, va_list args); ++static int my_check_copy_property_info(Bucket* src, va_list args); ++#ifndef ZEND_ENGINE_2_4 ++static int my_check_copy_default_property(Bucket* p, va_list args); ++static int my_check_copy_static_member(Bucket* src, va_list args); ++#endif ++static int my_check_copy_constant(Bucket* src, va_list args); ++ ++/* }}} */ ++ ++/* {{{ apc php serializers */ ++int APC_SERIALIZER_NAME(php) (APC_SERIALIZER_ARGS) ++{ ++ smart_str strbuf = {0}; ++ php_serialize_data_t var_hash; ++ PHP_VAR_SERIALIZE_INIT(var_hash); ++ php_var_serialize(&strbuf, (zval**)&value, &var_hash TSRMLS_CC); ++ PHP_VAR_SERIALIZE_DESTROY(var_hash); ++ if(strbuf.c) { ++ *buf = (unsigned char*)strbuf.c; ++ *buf_len = strbuf.len; ++ smart_str_0(&strbuf); ++ return 1; ++ } ++ return 0; ++} ++ ++int APC_UNSERIALIZER_NAME(php) (APC_UNSERIALIZER_ARGS) ++{ ++ const unsigned char *tmp = buf; ++ php_unserialize_data_t var_hash; ++ PHP_VAR_UNSERIALIZE_INIT(var_hash); ++ if(!php_var_unserialize(value, &tmp, buf + buf_len, &var_hash TSRMLS_CC)) { ++ PHP_VAR_UNSERIALIZE_DESTROY(var_hash); ++ zval_dtor(*value); ++ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %ld of %ld bytes", (long)(tmp - buf), (long)buf_len); ++ (*value)->type = IS_NULL; ++ return 0; ++ } ++ PHP_VAR_UNSERIALIZE_DESTROY(var_hash); ++ return 1; ++} ++/* }}} */ ++ ++/* {{{ check_op_array_integrity */ ++#if 0 ++static void check_op_array_integrity(zend_op_array* src) ++{ ++ int i, j; ++ ++ /* These sorts of checks really aren't particularly effective, but they ++ * can provide a welcome sanity check when debugging. Just don't enable ++ * for production use! */ ++ ++ assert(src->refcount != NULL); ++ assert(src->opcodes != NULL); ++ assert(src->last > 0); ++ ++ for (i = 0; i < src->last; i++) { ++ zend_op* op = &src->opcodes[i]; ++ znode* nodes[] = { &op->result, &op->op1, &op->op2 }; ++ for (j = 0; j < 3; j++) { ++ assert(nodes[j]->op_type == IS_CONST || ++ nodes[j]->op_type == IS_VAR || ++ nodes[j]->op_type == IS_TMP_VAR || ++ nodes[j]->op_type == IS_UNUSED); ++ ++ if (nodes[j]->op_type == IS_CONST) { ++ int type = nodes[j]->u.constant.type; ++ assert(type == IS_RESOURCE || ++ type == IS_BOOL || ++ type == IS_LONG || ++ type == IS_DOUBLE || ++ type == IS_NULL || ++ type == IS_CONSTANT || ++ type == IS_STRING || ++ type == FLAG_IS_BC || ++ type == IS_ARRAY || ++ type == IS_CONSTANT_ARRAY || ++ type == IS_OBJECT); ++ } ++ } ++ } ++} ++#endif ++/* }}} */ ++ ++/* {{{ my_bitwise_copy_function */ ++static zend_function* my_bitwise_copy_function(zend_function* dst, zend_function* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ apc_pool* pool = ctxt->pool; ++ ++ assert(src != NULL); ++ ++ if (!dst) { ++ CHECK(dst = (zend_function*) apc_pool_alloc(pool, sizeof(src[0]))); ++ } ++ ++ /* We only need to do a bitwise copy */ ++ memcpy(dst, src, sizeof(src[0])); ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ my_copy_zval_ptr */ ++static zval** my_copy_zval_ptr(zval** dst, const zval** src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ zval* dst_new; ++ apc_pool* pool = ctxt->pool; ++ int usegc = (ctxt->copy == APC_COPY_OUT_OPCODE) || (ctxt->copy == APC_COPY_OUT_USER); ++ ++ assert(src != NULL); ++ ++ if (!dst) { ++ CHECK(dst = (zval**) apc_pool_alloc(pool, sizeof(zval*))); ++ } ++ ++ if(usegc) { ++ ALLOC_ZVAL(dst[0]); ++ CHECK(dst[0]); ++ } else { ++ CHECK((dst[0] = (zval*) apc_pool_alloc(pool, sizeof(zval)))); ++ } ++ ++ CHECK((dst_new = my_copy_zval(*dst, *src, ctxt TSRMLS_CC))); ++ ++ if(dst_new != *dst) { ++ if(usegc) { ++ FREE_ZVAL(dst[0]); ++ } ++ *dst = dst_new; ++ } ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ my_serialize_object */ ++static zval* my_serialize_object(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ smart_str buf = {0}; ++ apc_pool* pool = ctxt->pool; ++ apc_serialize_t serialize = APC_SERIALIZER_NAME(php); ++ void *config = NULL; ++ ++ if(APCG(serializer)) { /* TODO: move to ctxt */ ++ serialize = APCG(serializer)->serialize; ++ config = APCG(serializer)->config; ++ } ++ ++ if(serialize((unsigned char**)&buf.c, &buf.len, src, config TSRMLS_CC)) { ++ dst->type = src->type & ~IS_CONSTANT_INDEX; ++ dst->value.str.len = buf.len; ++ CHECK(dst->value.str.val = apc_pmemcpy(buf.c, (buf.len + 1), pool TSRMLS_CC)); ++ } ++ ++ if(buf.c) smart_str_free(&buf); ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ my_unserialize_object */ ++static zval* my_unserialize_object(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ apc_unserialize_t unserialize = APC_UNSERIALIZER_NAME(php); ++ unsigned char *p = (unsigned char*)Z_STRVAL_P(src); ++ void *config = NULL; ++ ++ if(APCG(serializer)) { /* TODO: move to ctxt */ ++ unserialize = APCG(serializer)->unserialize; ++ config = APCG(serializer)->config; ++ } ++ ++ if(unserialize(&dst, p, Z_STRLEN_P(src), config TSRMLS_CC)) { ++ return dst; ++ } else { ++ zval_dtor(dst); ++ dst->type = IS_NULL; ++ } ++ return dst; ++} ++/* }}} */ ++ ++static char *apc_string_pmemcpy(char *str, size_t len, apc_pool* pool TSRMLS_DC) ++{ ++#ifdef ZEND_ENGINE_2_4 ++#ifndef ZTS ++ if (pool->type != APC_UNPOOL) { ++ char * ret = (char*)apc_new_interned_string((const char*)str, len TSRMLS_CC); ++ if (ret) { ++ return ret; ++ } ++ } ++#endif ++#endif ++ return apc_pmemcpy(str, len, pool TSRMLS_CC); ++} ++ ++/* {{{ my_copy_zval */ ++static APC_HOTSPOT zval* my_copy_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ zval **tmp; ++ apc_pool* pool = ctxt->pool; ++ ++ assert(dst != NULL); ++ assert(src != NULL); ++ ++ memcpy(dst, src, sizeof(src[0])); ++ ++ if(APCG(copied_zvals).nTableSize) { ++ if(zend_hash_index_find(&APCG(copied_zvals), (ulong)src, (void**)&tmp) == SUCCESS) { ++ if(Z_ISREF_P((zval*)src)) { ++ Z_SET_ISREF_PP(tmp); ++ } ++ Z_ADDREF_PP(tmp); ++ return *tmp; ++ } ++ ++ zend_hash_index_update(&APCG(copied_zvals), (ulong)src, (void**)&dst, sizeof(zval*), NULL); ++ } ++ ++ ++ if(ctxt->copy == APC_COPY_OUT_USER || ctxt->copy == APC_COPY_IN_USER) { ++ /* deep copies are refcount(1), but moved up for recursive ++ * arrays, which end up being add_ref'd during its copy. */ ++ Z_SET_REFCOUNT_P(dst, 1); ++ Z_UNSET_ISREF_P(dst); ++ } else { ++ /* code uses refcount=2 for consts */ ++ Z_SET_REFCOUNT_P(dst, Z_REFCOUNT_P((zval*)src)); ++ Z_SET_ISREF_TO_P(dst, Z_ISREF_P((zval*)src)); ++ } ++ ++ switch (src->type & IS_CONSTANT_TYPE_MASK) { ++ case IS_RESOURCE: ++ case IS_BOOL: ++ case IS_LONG: ++ case IS_DOUBLE: ++ case IS_NULL: ++ break; ++ ++ case IS_CONSTANT: ++ case IS_STRING: ++ if (src->value.str.val) { ++ CHECK(dst->value.str.val = apc_string_pmemcpy(src->value.str.val, ++ src->value.str.len+1, ++ pool TSRMLS_CC)); ++ } ++ break; ++ ++ case IS_ARRAY: ++ case IS_CONSTANT_ARRAY: ++ if(APCG(serializer) == NULL || ++ ctxt->copy == APC_COPY_IN_OPCODE || ctxt->copy == APC_COPY_OUT_OPCODE) { ++ ++ CHECK(dst->value.ht = ++ my_copy_hashtable(NULL, ++ src->value.ht, ++ (ht_copy_fun_t) my_copy_zval_ptr, ++ 1, ++ ctxt)); ++ break; ++ } else { ++ /* fall through to object case */ ++ } ++ ++ case IS_OBJECT: ++ ++ dst->type = IS_NULL; ++ if(ctxt->copy == APC_COPY_IN_USER) { ++ dst = my_serialize_object(dst, src, ctxt TSRMLS_CC); ++ } else if(ctxt->copy == APC_COPY_OUT_USER) { ++ dst = my_unserialize_object(dst, src, ctxt TSRMLS_CC); ++ } ++ break; ++ ++ default: ++ assert(0); ++ } ++ ++ return dst; ++} ++/* }}} */ ++ ++#ifdef ZEND_ENGINE_2_4 ++/* {{{ my_copy_znode */ ++static void my_check_znode(zend_uchar op_type, apc_context_t* ctxt TSRMLS_DC) ++{ ++ assert(op_type == IS_CONST || ++ op_type == IS_VAR || ++ op_type == IS_CV || ++ op_type == IS_TMP_VAR || ++ op_type == IS_UNUSED); ++} ++/* }}} */ ++ ++/* {{{ my_copy_zend_op */ ++static zend_op* my_copy_zend_op(zend_op* dst, zend_op* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ assert(dst != NULL); ++ assert(src != NULL); ++ ++ memcpy(dst, src, sizeof(src[0])); ++ ++ my_check_znode(dst->result_type & ~EXT_TYPE_UNUSED, ctxt TSRMLS_CC); ++ my_check_znode(dst->op1_type, ctxt TSRMLS_CC); ++ my_check_znode(dst->op2_type, ctxt TSRMLS_CC); ++ ++ return dst; ++} ++/* }}} */ ++#else ++/* {{{ my_copy_znode */ ++static znode* my_copy_znode(znode* dst, znode* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ assert(dst != NULL); ++ assert(src != NULL); ++ ++ memcpy(dst, src, sizeof(src[0])); ++ ++#ifdef IS_CV ++ assert(dst ->op_type == IS_CONST || ++ dst ->op_type == IS_VAR || ++ dst ->op_type == IS_CV || ++ dst ->op_type == IS_TMP_VAR || ++ dst ->op_type == IS_UNUSED); ++#else ++ assert(dst ->op_type == IS_CONST || ++ dst ->op_type == IS_VAR || ++ dst ->op_type == IS_TMP_VAR || ++ dst ->op_type == IS_UNUSED); ++#endif ++ ++ if (src->op_type == IS_CONST) { ++ if(!my_copy_zval(&dst->u.constant, &src->u.constant, ctxt TSRMLS_CC)) { ++ return NULL; ++ } ++ } ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ my_copy_zend_op */ ++static zend_op* my_copy_zend_op(zend_op* dst, zend_op* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ assert(dst != NULL); ++ assert(src != NULL); ++ ++ memcpy(dst, src, sizeof(src[0])); ++ ++ CHECK(my_copy_znode(&dst->result, &src->result, ctxt TSRMLS_CC)); ++ CHECK(my_copy_znode(&dst->op1, &src->op1, ctxt TSRMLS_CC)); ++ CHECK(my_copy_znode(&dst->op2, &src->op2, ctxt TSRMLS_CC)); ++ ++ return dst; ++} ++/* }}} */ ++#endif ++ ++/* {{{ my_copy_function */ ++static zend_function* my_copy_function(zend_function* dst, zend_function* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ assert(src != NULL); ++ ++ CHECK(dst = my_bitwise_copy_function(dst, src, ctxt TSRMLS_CC)); ++ ++ switch (src->type) { ++ case ZEND_INTERNAL_FUNCTION: ++ case ZEND_OVERLOADED_FUNCTION: ++ /* shallow copy because op_array is internal */ ++ dst->op_array = src->op_array; ++ break; ++ ++ case ZEND_USER_FUNCTION: ++ case ZEND_EVAL_CODE: ++ CHECK(apc_copy_op_array(&dst->op_array, ++ &src->op_array, ++ ctxt TSRMLS_CC)); ++ break; ++ ++ default: ++ assert(0); ++ } ++ /* ++ * op_array bitwise copying overwrites what ever you modified ++ * before apc_copy_op_array - which is why this code is outside ++ * my_bitwise_copy_function. ++ */ ++ ++ /* zend_do_inheritance will re-look this up, because the pointers ++ * in prototype are from a function table of another class. It just ++ * helps if that one is from EG(class_table). ++ */ ++ dst->common.prototype = NULL; ++ ++ /* once a method is marked as ZEND_ACC_IMPLEMENTED_ABSTRACT then you ++ * have to carry around a prototype. Thankfully zend_do_inheritance ++ * sets this properly as well ++ */ ++ dst->common.fn_flags = src->common.fn_flags & (~ZEND_ACC_IMPLEMENTED_ABSTRACT); ++ ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ my_copy_function_entry */ ++static zend_function_entry* my_copy_function_entry(zend_function_entry* dst, const zend_function_entry* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ assert(src != NULL); ++ ++ if (!dst) { ++ CHECK(dst = (zend_function_entry*) apc_pool_alloc(ctxt->pool, sizeof(src[0]))); ++ } ++ ++ /* Start with a bitwise copy */ ++ memcpy(dst, src, sizeof(src[0])); ++ ++ dst->fname = NULL; ++ dst->arg_info = NULL; ++ ++ if (src->fname) { ++ CHECK((dst->fname = apc_pstrdup(src->fname, ctxt->pool TSRMLS_CC))); ++ } ++ ++ if (src->arg_info) { ++ CHECK((dst->arg_info = my_copy_arg_info_array(NULL, ++ src->arg_info, ++ src->num_args, ++ ctxt TSRMLS_CC))); ++ } ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ my_copy_property_info */ ++static zend_property_info* my_copy_property_info(zend_property_info* dst, zend_property_info* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ apc_pool* pool = ctxt->pool; ++ ++ assert(src != NULL); ++ ++ if (!dst) { ++ CHECK(dst = (zend_property_info*) apc_pool_alloc(pool, sizeof(*src))); ++ } ++ ++ /* Start with a bitwise copy */ ++ memcpy(dst, src, sizeof(*src)); ++ ++ dst->name = NULL; ++#if defined(ZEND_ENGINE_2) && PHP_MINOR_VERSION > 0 ++ dst->doc_comment = NULL; ++#endif ++ ++ if (src->name) { ++ /* private members are stored inside property_info as a mangled ++ * string of the form: ++ * \0\0\0 ++ */ ++ CHECK((dst->name = apc_string_pmemcpy(src->name, src->name_length+1, pool TSRMLS_CC))); ++ } ++ ++#if defined(ZEND_ENGINE_2) && PHP_MINOR_VERSION > 0 ++ if (src->doc_comment) { ++ CHECK((dst->doc_comment = apc_pmemcpy(src->doc_comment, (src->doc_comment_len + 1), pool TSRMLS_CC))); ++ } ++#endif ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ my_copy_property_info_for_execution */ ++static zend_property_info* my_copy_property_info_for_execution(zend_property_info* dst, zend_property_info* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ assert(src != NULL); ++ ++ if (!dst) { ++ CHECK(dst = (zend_property_info*) apc_pool_alloc(ctxt->pool, sizeof(*src))); ++ } ++ ++ /* We need only a shallow copy */ ++ memcpy(dst, src, sizeof(*src)); ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ my_copy_arg_info_array */ ++static zend_arg_info* my_copy_arg_info_array(zend_arg_info* dst, const zend_arg_info* src, uint num_args, apc_context_t* ctxt TSRMLS_DC) ++{ ++ uint i = 0; ++ ++ ++ if (!dst) { ++ CHECK(dst = (zend_arg_info*) apc_pool_alloc(ctxt->pool, (sizeof(*src) * num_args))); ++ } ++ ++ /* Start with a bitwise copy */ ++ memcpy(dst, src, sizeof(*src)*num_args); ++ ++ for(i=0; i < num_args; i++) { ++ CHECK((my_copy_arg_info( &dst[i], &src[i], ctxt TSRMLS_CC))); ++ } ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ my_copy_arg_info */ ++static zend_arg_info* my_copy_arg_info(zend_arg_info* dst, const zend_arg_info* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ apc_pool* pool = ctxt->pool; ++ ++ assert(src != NULL); ++ ++ if (!dst) { ++ CHECK(dst = (zend_arg_info*) apc_pool_alloc(pool, sizeof(*src))); ++ } ++ ++ /* Start with a bitwise copy */ ++ memcpy(dst, src, sizeof(*src)); ++ ++ dst->name = NULL; ++ dst->class_name = NULL; ++ ++ if (src->name) { ++ CHECK((dst->name = apc_string_pmemcpy((char *) src->name, src->name_len+1, pool TSRMLS_CC))); ++ } ++ ++ if (src->class_name) { ++ CHECK((dst->class_name = apc_string_pmemcpy((char *) src->class_name, src->class_name_len+1, pool TSRMLS_CC))); ++ } ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ apc_copy_class_entry */ ++zend_class_entry* apc_copy_class_entry(zend_class_entry* dst, zend_class_entry* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ return my_copy_class_entry(dst, src, ctxt TSRMLS_CC); ++} ++ ++/* {{{ my_copy_class_entry */ ++static zend_class_entry* my_copy_class_entry(zend_class_entry* dst, zend_class_entry* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ int i = 0; ++ apc_pool* pool = ctxt->pool; ++ ++ assert(src != NULL); ++ ++ if (!dst) { ++ CHECK(dst = (zend_class_entry*) apc_pool_alloc(pool, sizeof(*src))); ++ } ++ ++ /* Start with a bitwise copy */ ++ memcpy(dst, src, sizeof(*src)); ++ ++ dst->name = NULL; ++ memset(&dst->function_table, 0, sizeof(dst->function_table)); ++ ZEND_CE_DOC_COMMENT(dst) = NULL; ++ ZEND_CE_FILENAME(dst) = NULL; ++ memset(&dst->properties_info, 0, sizeof(dst->properties_info)); ++ memset(&dst->constants_table, 0, sizeof(dst->constants_table)); ++ ++ if (src->name) { ++ CHECK((dst->name = apc_pstrdup(src->name, pool TSRMLS_CC))); ++ } ++ ++ if(!(my_copy_hashtable_ex(&dst->function_table, ++ &src->function_table TSRMLS_CC, ++ (ht_copy_fun_t) my_copy_function, ++ 0, ++ ctxt, ++ (ht_check_copy_fun_t) my_check_copy_function, ++ src))) { ++ return NULL; ++ } ++ ++ /* the interfaces are populated at runtime using ADD_INTERFACE */ ++ dst->interfaces = NULL; ++ ++ /* the current count includes inherited interfaces as well, ++ the real dynamic ones are the first which are zero'd ++ out in zend_do_end_class_declaration */ ++ for(i = 0 ; (uint)i < src->num_interfaces ; i++) { ++ if(src->interfaces[i]) ++ { ++ dst->num_interfaces = i; ++ break; ++ } ++ } ++ ++ /* these will either be set inside my_fixup_hashtable or ++ * they will be copied out from parent inside zend_do_inheritance ++ */ ++ dst->parent = NULL; ++ dst->constructor = NULL; ++ dst->destructor = NULL; ++ dst->clone = NULL; ++ dst->__get = NULL; ++ dst->__set = NULL; ++ dst->__unset = NULL; ++ dst->__isset = NULL; ++ dst->__call = NULL; ++#ifdef ZEND_ENGINE_2_2 ++ dst->__tostring = NULL; ++#endif ++#ifdef ZEND_ENGINE_2_3 ++ dst->__callstatic = NULL; ++#endif ++ ++ /* unset function proxies */ ++ dst->serialize_func = NULL; ++ dst->unserialize_func = NULL; ++ ++ my_fixup_hashtable(&dst->function_table, (ht_fixup_fun_t)my_fixup_function, src, dst); ++ ++#ifdef ZEND_ENGINE_2_4 ++ dst->default_properties_count = src->default_properties_count; ++ if (src->default_properties_count) { ++ CHECK(dst->default_properties_table = (zval**) apc_pool_alloc(pool, (sizeof(zval*) * src->default_properties_count))); ++ for (i = 0; i < src->default_properties_count; i++) { ++ if (src->default_properties_table[i]) { ++ my_copy_zval_ptr(&dst->default_properties_table[i], (const zval**)&src->default_properties_table[i], ctxt TSRMLS_CC); ++ } else { ++ dst->default_properties_table[i] = NULL; ++ } ++ } ++ } else { ++ dst->default_properties_table = NULL; ++ } ++#else ++ memset(&dst->default_properties, 0, sizeof(dst->default_properties)); ++ CHECK((my_copy_hashtable_ex(&dst->default_properties, ++ &src->default_properties TSRMLS_CC, ++ (ht_copy_fun_t) my_copy_zval_ptr, ++ 1, ++ ctxt, ++ (ht_check_copy_fun_t) my_check_copy_default_property, ++ src))); ++#endif ++ ++ CHECK((my_copy_hashtable_ex(&dst->properties_info, ++ &src->properties_info TSRMLS_CC, ++ (ht_copy_fun_t) my_copy_property_info, ++ 0, ++ ctxt, ++ (ht_check_copy_fun_t) my_check_copy_property_info, ++ src))); ++ ++#ifdef ZEND_ENGINE_2_2 ++ /* php5.2 introduced a scope attribute for property info */ ++ my_fixup_hashtable(&dst->properties_info, (ht_fixup_fun_t)my_fixup_property_info_for_execution, src, dst); ++#endif ++ ++#ifdef ZEND_ENGINE_2_4 ++ dst->default_static_members_count = src->default_static_members_count; ++ ++ if (src->default_static_members_count) { ++ CHECK(dst->default_static_members_table = (zval**) apc_pool_alloc(pool, (sizeof(zval*) * src->default_static_members_count))); ++ for (i = 0; i < src->default_static_members_count; i++) { ++ if (src->default_static_members_table[i]) { ++ my_copy_zval_ptr(&dst->default_static_members_table[i], (const zval**)&src->default_static_members_table[i], ctxt TSRMLS_CC); ++ } else { ++ dst->default_static_members_table[i] = NULL; ++ } ++ } ++ } else { ++ dst->default_static_members_table = NULL; ++ } ++ dst->static_members_table = dst->default_static_members_table; ++#else ++ memset(&dst->default_static_members, 0, sizeof(dst->default_static_members)); ++ dst->static_members = NULL; ++ CHECK(my_copy_hashtable_ex(&dst->default_static_members, ++ &src->default_static_members TSRMLS_CC, ++ (ht_copy_fun_t) my_copy_zval_ptr, ++ 1, ++ ctxt, ++ (ht_check_copy_fun_t) my_check_copy_static_member, ++ src, ++ &src->default_static_members)); ++ ++ if(src->static_members != &src->default_static_members) ++ { ++ CHECK((dst->static_members = my_copy_hashtable_ex(NULL, ++ src->static_members TSRMLS_CC, ++ (ht_copy_fun_t) my_copy_zval_ptr, ++ 1, ++ ctxt, ++ (ht_check_copy_fun_t) my_check_copy_static_member, ++ src, ++ src->static_members))); ++ } ++ else ++ { ++ dst->static_members = &dst->default_static_members; ++ } ++#endif ++ ++ CHECK((my_copy_hashtable_ex(&dst->constants_table, ++ &src->constants_table TSRMLS_CC, ++ (ht_copy_fun_t) my_copy_zval_ptr, ++ 1, ++ ctxt, ++ (ht_check_copy_fun_t) my_check_copy_constant, ++ src))); ++ ++ if (src->type == ZEND_USER_CLASS && ZEND_CE_DOC_COMMENT(src)) { ++ CHECK(ZEND_CE_DOC_COMMENT(dst) = ++ apc_pmemcpy(ZEND_CE_DOC_COMMENT(src), (ZEND_CE_DOC_COMMENT_LEN(src) + 1), pool TSRMLS_CC)); ++ } ++ ++ if (src->type == ZEND_INTERNAL_CLASS && ZEND_CE_BUILTIN_FUNCTIONS(src)) { ++ int n; ++ ++ for (n = 0; src->type == ZEND_INTERNAL_CLASS && ZEND_CE_BUILTIN_FUNCTIONS(src)[n].fname != NULL; n++) {} ++ ++ CHECK((ZEND_CE_BUILTIN_FUNCTIONS(dst) = ++ (zend_function_entry*) apc_pool_alloc(pool, ((n + 1) * sizeof(zend_function_entry))))); ++ ++ for (i = 0; i < n; i++) { ++ CHECK(my_copy_function_entry((zend_function_entry*)(&ZEND_CE_BUILTIN_FUNCTIONS(dst)[i]), ++ &ZEND_CE_BUILTIN_FUNCTIONS(src)[i], ++ ctxt TSRMLS_CC)); ++ } ++ *(char**)&(ZEND_CE_BUILTIN_FUNCTIONS(dst)[n].fname) = NULL; ++ } ++ ++ if (src->type == ZEND_USER_CLASS && ZEND_CE_FILENAME(src)) { ++ CHECK((ZEND_CE_FILENAME(dst) = apc_pstrdup(ZEND_CE_FILENAME(src), pool TSRMLS_CC))); ++ } ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ my_copy_hashtable_ex */ ++static APC_HOTSPOT HashTable* my_copy_hashtable_ex(HashTable* dst, ++ HashTable* src TSRMLS_DC, ++ ht_copy_fun_t copy_fn, ++ int holds_ptrs, ++ apc_context_t* ctxt, ++ ht_check_copy_fun_t check_fn, ++ ...) ++{ ++ Bucket* curr = NULL; ++ Bucket* prev = NULL; ++ Bucket* newp = NULL; ++ int first = 1; ++ apc_pool* pool = ctxt->pool; ++ ++ assert(src != NULL); ++ ++ if (!dst) { ++ CHECK(dst = (HashTable*) apc_pool_alloc(pool, sizeof(src[0]))); ++ } ++ ++ memcpy(dst, src, sizeof(src[0])); ++ ++ /* allocate buckets for the new hashtable */ ++ CHECK((dst->arBuckets = apc_pool_alloc(pool, (dst->nTableSize * sizeof(Bucket*))))); ++ ++ memset(dst->arBuckets, 0, dst->nTableSize * sizeof(Bucket*)); ++ dst->pInternalPointer = NULL; ++ dst->pListHead = NULL; ++ ++ for (curr = src->pListHead; curr != NULL; curr = curr->pListNext) { ++ int n = curr->h % dst->nTableSize; ++ ++ if(check_fn) { ++ va_list args; ++ va_start(args, check_fn); ++ ++ /* Call the check_fn to see if the current bucket ++ * needs to be copied out ++ */ ++ if(!check_fn(curr, args)) { ++ dst->nNumOfElements--; ++ va_end(args); ++ continue; ++ } ++ ++ va_end(args); ++ } ++ ++ /* create a copy of the bucket 'curr' */ ++#ifdef ZEND_ENGINE_2_4 ++ if (!curr->nKeyLength) { ++ CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket), pool TSRMLS_CC))); ++ } else if (IS_INTERNED(curr->arKey)) { ++ CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket), pool TSRMLS_CC))); ++#ifndef ZTS ++ } else if (pool->type != APC_UNPOOL) { ++ char *arKey; ++ ++ CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket), pool TSRMLS_CC))); ++ arKey = apc_new_interned_string(curr->arKey, curr->nKeyLength TSRMLS_CC); ++ if (!arKey) { ++ CHECK((newp->arKey = (char*) apc_pmemcpy(curr->arKey, curr->nKeyLength, pool TSRMLS_CC))); ++ } else { ++ newp->arKey = arKey; ++ } ++#endif ++ } else { ++ CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket), pool TSRMLS_CC))); ++ CHECK((newp->arKey = (char*) apc_pmemcpy(curr->arKey, curr->nKeyLength, pool TSRMLS_CC))); ++ } ++#else ++ CHECK((newp = (Bucket*) apc_pmemcpy(curr, ++ (sizeof(Bucket) + curr->nKeyLength - 1), ++ pool TSRMLS_CC))); ++#endif ++ ++ /* insert 'newp' into the linked list at its hashed index */ ++ if (dst->arBuckets[n]) { ++ newp->pNext = dst->arBuckets[n]; ++ newp->pLast = NULL; ++ newp->pNext->pLast = newp; ++ } ++ else { ++ newp->pNext = newp->pLast = NULL; ++ } ++ ++ dst->arBuckets[n] = newp; ++ ++ /* copy the bucket data using our 'copy_fn' callback function */ ++ CHECK((newp->pData = copy_fn(NULL, curr->pData, ctxt TSRMLS_CC))); ++ ++ if (holds_ptrs) { ++ memcpy(&newp->pDataPtr, newp->pData, sizeof(void*)); ++ } ++ else { ++ newp->pDataPtr = NULL; ++ } ++ ++ /* insert 'newp' into the table-thread linked list */ ++ newp->pListLast = prev; ++ newp->pListNext = NULL; ++ ++ if (prev) { ++ prev->pListNext = newp; ++ } ++ ++ if (first) { ++ dst->pListHead = newp; ++ first = 0; ++ } ++ ++ prev = newp; ++ } ++ ++ dst->pListTail = newp; ++ ++ zend_hash_internal_pointer_reset(dst); ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ my_copy_static_variables */ ++static HashTable* my_copy_static_variables(zend_op_array* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ if (src->static_variables == NULL) { ++ return NULL; ++ } ++ ++ return my_copy_hashtable(NULL, ++ src->static_variables, ++ (ht_copy_fun_t) my_copy_zval_ptr, ++ 1, ++ ctxt); ++} ++/* }}} */ ++ ++/* {{{ apc_copy_zval */ ++zval* apc_copy_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ apc_pool* pool = ctxt->pool; ++ int usegc = (ctxt->copy == APC_COPY_OUT_OPCODE) || (ctxt->copy == APC_COPY_OUT_USER); ++ ++ assert(src != NULL); ++ ++ if (!dst) { ++ if(usegc) { ++ ALLOC_ZVAL(dst); ++ CHECK(dst); ++ } else { ++ CHECK(dst = (zval*) apc_pool_alloc(pool, sizeof(zval))); ++ } ++ } ++ ++ CHECK(dst = my_copy_zval(dst, src, ctxt TSRMLS_CC)); ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ apc_fixup_op_array_jumps */ ++static void apc_fixup_op_array_jumps(zend_op_array *dst, zend_op_array *src ) ++{ ++ uint i; ++ ++ for (i=0; i < dst->last; ++i) { ++ zend_op *zo = &(dst->opcodes[i]); ++ /*convert opline number to jump address*/ ++ switch (zo->opcode) { ++#ifdef ZEND_ENGINE_2_3 ++ case ZEND_GOTO: ++#endif ++ case ZEND_JMP: ++ /*Note: if src->opcodes != dst->opcodes then we need to the opline according to src*/ ++#ifdef ZEND_ENGINE_2_4 ++ zo->op1.jmp_addr = dst->opcodes + (zo->op1.jmp_addr - src->opcodes); ++#else ++ zo->op1.u.jmp_addr = dst->opcodes + (zo->op1.u.jmp_addr - src->opcodes); ++#endif ++ break; ++ case ZEND_JMPZ: ++ case ZEND_JMPNZ: ++ case ZEND_JMPZ_EX: ++ case ZEND_JMPNZ_EX: ++#ifdef ZEND_ENGINE_2_3 ++ case ZEND_JMP_SET: ++#endif ++#ifdef ZEND_ENGINE_2_4 ++ case ZEND_JMP_SET_VAR: ++#endif ++#ifdef ZEND_ENGINE_2_4 ++ zo->op2.jmp_addr = dst->opcodes + (zo->op2.jmp_addr - src->opcodes); ++#else ++ zo->op2.u.jmp_addr = dst->opcodes + (zo->op2.u.jmp_addr - src->opcodes); ++#endif ++ break; ++ default: ++ break; ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ apc_copy_op_array */ ++zend_op_array* apc_copy_op_array(zend_op_array* dst, zend_op_array* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ int i; ++ apc_fileinfo_t *fileinfo = NULL; ++ char canon_path[MAXPATHLEN]; ++ char *fullpath = NULL; ++ apc_opflags_t * flags = NULL; ++ apc_pool* pool = ctxt->pool; ++ ++ assert(src != NULL); ++ ++ if (!dst) { ++ CHECK(dst = (zend_op_array*) apc_pool_alloc(pool, sizeof(src[0]))); ++ } ++ ++ if(APCG(apc_optimize_function)) { ++ APCG(apc_optimize_function)(src TSRMLS_CC); ++ } ++ ++ /* start with a bitwise copy of the array */ ++ memcpy(dst, src, sizeof(src[0])); ++ ++ dst->function_name = NULL; ++ dst->filename = NULL; ++ dst->refcount = NULL; ++ dst->opcodes = NULL; ++ dst->brk_cont_array = NULL; ++ dst->static_variables = NULL; ++ dst->try_catch_array = NULL; ++ dst->arg_info = NULL; ++ dst->doc_comment = NULL; ++#ifdef ZEND_ENGINE_2_1 ++ dst->vars = NULL; ++#endif ++ ++ /* copy the arg types array (if set) */ ++ if (src->arg_info) { ++ CHECK(dst->arg_info = my_copy_arg_info_array(NULL, ++ src->arg_info, ++ src->num_args, ++ ctxt TSRMLS_CC)); ++ } ++ ++ if (src->function_name) { ++ CHECK(dst->function_name = apc_pstrdup(src->function_name, pool TSRMLS_CC)); ++ } ++ if (src->filename) { ++ CHECK(dst->filename = apc_pstrdup(src->filename, pool TSRMLS_CC)); ++ } ++ ++ CHECK(dst->refcount = apc_pmemcpy(src->refcount, ++ sizeof(src->refcount[0]), ++ pool TSRMLS_CC)); ++ ++#ifdef ZEND_ENGINE_2_4 ++ if (src->literals) { ++ zend_literal *p, *q, *end; ++ ++ q = src->literals; ++ p = dst->literals = (zend_literal*) apc_pool_alloc(pool, (sizeof(zend_literal) * src->last_literal)); ++ end = p + src->last_literal; ++ while (p < end) { ++ *p = *q; ++ my_copy_zval(&p->constant, &q->constant, ctxt TSRMLS_CC); ++ p++; ++ q++; ++ } ++ } ++#endif ++ ++ /* deep-copy the opcodes */ ++ CHECK(dst->opcodes = (zend_op*) apc_pool_alloc(pool, (sizeof(zend_op) * src->last))); ++ ++ if(apc_reserved_offset != -1) { ++ /* Insanity alert: the void* pointer is cast into an apc_opflags_t ++ * struct. apc_zend_init() checks to ensure that it fits in a void* */ ++ flags = (apc_opflags_t*) & (dst->reserved[apc_reserved_offset]); ++ memset(flags, 0, sizeof(apc_opflags_t)); ++ /* assert(sizeof(apc_opflags_t) <= sizeof(dst->reserved)); */ ++ } ++ ++ for (i = 0; (uint) i < src->last; i++) { ++ zend_op *zo = &(src->opcodes[i]); ++ /* a lot of files are merely constant arrays with no jumps */ ++ switch (zo->opcode) { ++#ifdef ZEND_ENGINE_2_3 ++ case ZEND_GOTO: ++#endif ++ case ZEND_JMP: ++ case ZEND_JMPZ: ++ case ZEND_JMPNZ: ++ case ZEND_JMPZ_EX: ++ case ZEND_JMPNZ_EX: ++#ifdef ZEND_ENGINE_2_3 ++ case ZEND_JMP_SET: ++#endif ++#ifdef ZEND_ENGINE_2_4 ++ case ZEND_JMP_SET_VAR: ++#endif ++ if(flags != NULL) { ++ flags->has_jumps = 1; ++ } ++ break; ++ /* auto_globals_jit was not in php-4.3.* */ ++ case ZEND_FETCH_R: ++ case ZEND_FETCH_W: ++ case ZEND_FETCH_IS: ++ case ZEND_FETCH_FUNC_ARG: ++ case ZEND_FETCH_RW: ++ case ZEND_FETCH_UNSET: ++ if(PG(auto_globals_jit) && flags != NULL) ++ { ++ /* The fetch is only required if auto_globals_jit=1 */ ++#ifdef ZEND_ENGINE_2_4 ++ if((zo->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_GLOBAL && ++ zo->op1_type == IS_CONST && ++ Z_TYPE_P(zo->op1.zv) == IS_STRING) { ++ if (Z_STRVAL_P(zo->op1.zv)[0] == '_') { ++# define SET_IF_AUTOGLOBAL(member) \ ++ if(!strcmp(Z_STRVAL_P(zo->op1.zv), #member)) \ ++ flags->member = 1 /* no ';' here */ ++#else ++ if(zo->op2.u.EA.type == ZEND_FETCH_GLOBAL && ++ zo->op1.op_type == IS_CONST && ++ zo->op1.u.constant.type == IS_STRING) { ++ znode * varname = &zo->op1; ++ if (varname->u.constant.value.str.val[0] == '_') { ++# define SET_IF_AUTOGLOBAL(member) \ ++ if(!strcmp(varname->u.constant.value.str.val, #member)) \ ++ flags->member = 1 /* no ';' here */ ++#endif ++ SET_IF_AUTOGLOBAL(_GET); ++ else SET_IF_AUTOGLOBAL(_POST); ++ else SET_IF_AUTOGLOBAL(_COOKIE); ++ else SET_IF_AUTOGLOBAL(_SERVER); ++ else SET_IF_AUTOGLOBAL(_ENV); ++ else SET_IF_AUTOGLOBAL(_FILES); ++ else SET_IF_AUTOGLOBAL(_REQUEST); ++ else SET_IF_AUTOGLOBAL(_SESSION); ++#ifdef ZEND_ENGINE_2_4 ++ else if(zend_is_auto_global( ++ Z_STRVAL_P(zo->op1.zv), ++ Z_STRLEN_P(zo->op1.zv) ++ TSRMLS_CC)) ++#else ++ else if(zend_is_auto_global( ++ varname->u.constant.value.str.val, ++ varname->u.constant.value.str.len ++ TSRMLS_CC)) ++#endif ++ { ++ flags->unknown_global = 1; ++ } ++#ifdef ZEND_ENGINE_2_4 ++ } else SET_IF_AUTOGLOBAL(GLOBALS); ++#else ++ } ++#endif ++ } ++ } ++ break; ++ case ZEND_RECV_INIT: ++#ifdef ZEND_ENGINE_2_4 ++ if(zo->op2_type == IS_CONST && ++ Z_TYPE_P(zo->op2.zv) == IS_CONSTANT_ARRAY) { ++#else ++ if(zo->op2.op_type == IS_CONST && ++ zo->op2.u.constant.type == IS_CONSTANT_ARRAY) { ++#endif ++ if(flags != NULL) { ++ flags->deep_copy = 1; ++ } ++ } ++ break; ++ default: ++#ifdef ZEND_ENGINE_2_4 ++ if((zo->op1_type == IS_CONST && ++ Z_TYPE_P(zo->op1.zv) == IS_CONSTANT_ARRAY) || ++ (zo->op2_type == IS_CONST && ++ Z_TYPE_P(zo->op2.zv) == IS_CONSTANT_ARRAY)) { ++#else ++ if((zo->op1.op_type == IS_CONST && ++ zo->op1.u.constant.type == IS_CONSTANT_ARRAY) || ++ (zo->op2.op_type == IS_CONST && ++ zo->op2.u.constant.type == IS_CONSTANT_ARRAY)) { ++#endif ++ if(flags != NULL) { ++ flags->deep_copy = 1; ++ } ++ } ++ break; ++ } ++ ++ if(!(my_copy_zend_op(dst->opcodes+i, src->opcodes+i, ctxt TSRMLS_CC))) { ++ return NULL; ++ } ++ ++#ifdef ZEND_ENGINE_2_4 ++ if (zo->op1_type == IS_CONST) { ++ dst->opcodes[i].op1.literal = src->opcodes[i].op1.literal - src->literals + dst->literals; ++ } ++ if (zo->op2_type == IS_CONST) { ++ dst->opcodes[i].op2.literal = src->opcodes[i].op2.literal - src->literals + dst->literals; ++ } ++ if (zo->result_type == IS_CONST) { ++ dst->opcodes[i].result.literal = src->opcodes[i].result.literal - src->literals + dst->literals; ++ } ++#endif ++ ++ /* This code breaks apc's rule#1 - cache what you compile */ ++ if((APCG(fpstat)==0) && APCG(canonicalize)) { ++ /* not pool allocated, because the pool allocations eat up shm space */ ++ fileinfo = (apc_fileinfo_t*) apc_php_malloc(sizeof(apc_fileinfo_t) TSRMLS_CC); ++#ifdef ZEND_ENGINE_2_4 ++ if((zo->opcode == ZEND_INCLUDE_OR_EVAL) && ++ (zo->op1_type == IS_CONST && Z_TYPE_P(zo->op1.zv) == IS_STRING)) { ++ /* constant includes */ ++ if(!IS_ABSOLUTE_PATH(Z_STRVAL_P(zo->op1.zv),Z_STRLEN_P(zo->op1.zv))) { ++ if (apc_search_paths(Z_STRVAL_P(zo->op1.zv), PG(include_path), fileinfo TSRMLS_CC) == 0) { ++#else ++ if((zo->opcode == ZEND_INCLUDE_OR_EVAL) && ++ (zo->op1.op_type == IS_CONST && zo->op1.u.constant.type == IS_STRING)) { ++ /* constant includes */ ++ if(!IS_ABSOLUTE_PATH(Z_STRVAL_P(&zo->op1.u.constant),Z_STRLEN_P(&zo->op1.u.constant))) { ++ if (apc_search_paths(Z_STRVAL_P(&zo->op1.u.constant), PG(include_path), fileinfo TSRMLS_CC) == 0) { ++#endif ++ if((fullpath = realpath(fileinfo->fullpath, canon_path))) { ++ /* everything has to go through a realpath() */ ++ zend_op *dzo = &(dst->opcodes[i]); ++#ifdef ZEND_ENGINE_2_4 ++ dzo->op1.literal = (zend_literal*) apc_pool_alloc(pool, sizeof(zend_literal)); ++ Z_STRLEN_P(dzo->op1.zv) = strlen(fullpath); ++ Z_STRVAL_P(dzo->op1.zv) = apc_pstrdup(fullpath, pool TSRMLS_CC); ++ Z_TYPE_P(dzo->op1.zv) = IS_STRING; ++ Z_SET_REFCOUNT_P(dzo->op1.zv, 2); ++ Z_SET_ISREF_P(dzo->op1.zv); ++ dzo->op1.literal->hash_value = zend_hash_func(Z_STRVAL_P(dzo->op1.zv), Z_STRLEN_P(dzo->op1.zv)+1); ++#else ++ dzo->op1.u.constant.value.str.len = strlen(fullpath); ++ dzo->op1.u.constant.value.str.val = apc_pstrdup(fullpath, pool TSRMLS_CC); ++#endif ++ } ++ } ++ } ++ } ++ apc_php_free(fileinfo TSRMLS_CC); ++ } ++ } ++ ++ if(flags == NULL || flags->has_jumps) { ++ apc_fixup_op_array_jumps(dst,src); ++ } ++ ++ /* copy the break-continue array */ ++ if (src->brk_cont_array) { ++ CHECK(dst->brk_cont_array = apc_pmemcpy(src->brk_cont_array, ++ sizeof(src->brk_cont_array[0]) * src->last_brk_cont, ++ pool TSRMLS_CC)); ++ } ++ ++ /* copy the table of static variables */ ++ if (src->static_variables) { ++ CHECK(dst->static_variables = my_copy_static_variables(src, ctxt TSRMLS_CC)); ++ } ++ ++ if (src->try_catch_array) { ++ CHECK(dst->try_catch_array = apc_pmemcpy(src->try_catch_array, ++ sizeof(src->try_catch_array[0]) * src->last_try_catch, ++ pool TSRMLS_CC)); ++ } ++ ++#ifdef ZEND_ENGINE_2_1 /* PHP 5.1 */ ++ if (src->vars) { ++ CHECK(dst->vars = apc_pmemcpy(src->vars, ++ sizeof(src->vars[0]) * src->last_var, ++ pool TSRMLS_CC)); ++ ++ for(i = 0; i < src->last_var; i++) dst->vars[i].name = NULL; ++ ++ for(i = 0; i < src->last_var; i++) { ++ CHECK(dst->vars[i].name = apc_string_pmemcpy(src->vars[i].name, ++ src->vars[i].name_len + 1, ++ pool TSRMLS_CC)); ++ } ++ } ++#endif ++ ++ if (src->doc_comment) { ++ CHECK(dst->doc_comment ++ = apc_pmemcpy(src->doc_comment, (src->doc_comment_len + 1), pool TSRMLS_CC)); ++ } ++ ++ return dst; ++} ++/* }}} */ ++ ++ ++/* {{{ apc_copy_new_functions */ ++apc_function_t* apc_copy_new_functions(int old_count, apc_context_t* ctxt TSRMLS_DC) ++{ ++ apc_function_t* array; ++ int new_count; /* number of new functions in table */ ++ int i; ++ apc_pool* pool = ctxt->pool; ++ ++ new_count = zend_hash_num_elements(CG(function_table)) - old_count; ++ assert(new_count >= 0); ++ ++ CHECK(array = ++ (apc_function_t*) ++ apc_pool_alloc(pool, (sizeof(apc_function_t) * (new_count + 1)))); ++ ++ if (new_count == 0) { ++ array[0].function = NULL; ++ return array; ++ } ++ ++ /* Skip the first `old_count` functions in the table */ ++ zend_hash_internal_pointer_reset(CG(function_table)); ++ for (i = 0; i < old_count; i++) { ++ zend_hash_move_forward(CG(function_table)); ++ } ++ ++ /* Add the next `new_count` functions to our array */ ++ for (i = 0; i < new_count; i++) { ++ char* key; ++ uint key_size; ++ zend_function* fun; ++ ++ zend_hash_get_current_key_ex(CG(function_table), ++ &key, ++ &key_size, ++ NULL, ++ 0, ++ NULL); ++ ++ zend_hash_get_current_data(CG(function_table), (void**) &fun); ++ ++ CHECK(array[i].name = apc_pmemcpy(key, (int) key_size, pool TSRMLS_CC)); ++ array[i].name_len = (int) key_size-1; ++ CHECK(array[i].function = my_copy_function(NULL, fun, ctxt TSRMLS_CC)); ++ zend_hash_move_forward(CG(function_table)); ++ } ++ ++ array[i].function = NULL; ++ return array; ++} ++/* }}} */ ++ ++/* {{{ apc_copy_new_classes */ ++apc_class_t* apc_copy_new_classes(zend_op_array* op_array, int old_count, apc_context_t *ctxt TSRMLS_DC) ++{ ++ apc_class_t* array; ++ int new_count; /* number of new classes in table */ ++ int i; ++ apc_pool* pool = ctxt->pool; ++ ++ new_count = zend_hash_num_elements(CG(class_table)) - old_count; ++ assert(new_count >= 0); ++ ++ CHECK(array = ++ (apc_class_t*) ++ apc_pool_alloc(pool, (sizeof(apc_class_t) * (new_count + 1)))); ++ ++ if (new_count == 0) { ++ array[0].class_entry = NULL; ++ return array; ++ } ++ ++ /* Skip the first `old_count` classes in the table */ ++ zend_hash_internal_pointer_reset(CG(class_table)); ++ for (i = 0; i < old_count; i++) { ++ zend_hash_move_forward(CG(class_table)); ++ } ++ ++ /* Add the next `new_count` classes to our array */ ++ for (i = 0; i < new_count; i++) { ++ char* key; ++ uint key_size; ++ zend_class_entry* elem = NULL; ++ ++ array[i].class_entry = NULL; ++ ++ zend_hash_get_current_key_ex(CG(class_table), ++ &key, ++ &key_size, ++ NULL, ++ 0, ++ NULL); ++ ++ zend_hash_get_current_data(CG(class_table), (void**) &elem); ++ ++ ++ elem = *((zend_class_entry**)elem); ++ ++ CHECK(array[i].name = apc_pmemcpy(key, (int) key_size, pool TSRMLS_CC)); ++ array[i].name_len = (int) key_size-1; ++ CHECK(array[i].class_entry = my_copy_class_entry(NULL, elem, ctxt TSRMLS_CC)); ++ ++ /* ++ * If the class has a pointer to its parent class, save the parent ++ * name so that we can enable compile-time inheritance when we reload ++ * the child class; otherwise, set the parent name to null and scan ++ * the op_array to determine if this class inherits from some base ++ * class at execution-time. ++ */ ++ ++ if (elem->parent) { ++ CHECK(array[i].parent_name = apc_pstrdup(elem->parent->name, pool TSRMLS_CC)); ++ } ++ else { ++ array[i].parent_name = NULL; ++ } ++ ++ zend_hash_move_forward(CG(class_table)); ++ } ++ ++ array[i].class_entry = NULL; ++ return array; ++} ++/* }}} */ ++ ++/* Used only by my_prepare_op_array_for_execution */ ++#ifdef ZEND_ENGINE_2_4 ++# define APC_PREPARE_FETCH_GLOBAL_FOR_EXECUTION() \ ++ /* The fetch is only required if auto_globals_jit=1 */ \ ++ if((zo->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_GLOBAL && \ ++ zo->op1_type == IS_CONST && \ ++ Z_TYPE_P(zo->op1.zv) == IS_STRING && \ ++ Z_STRVAL_P(zo->op1.zv)[0] == '_') { \ ++ (void)zend_is_auto_global(Z_STRVAL_P(zo->op1.zv), \ ++ Z_STRLEN_P(zo->op1.zv) \ ++ TSRMLS_CC); \ ++ } ++#else ++# define APC_PREPARE_FETCH_GLOBAL_FOR_EXECUTION() \ ++ /* The fetch is only required if auto_globals_jit=1 */ \ ++ if(zo->op2.u.EA.type == ZEND_FETCH_GLOBAL && \ ++ zo->op1.op_type == IS_CONST && \ ++ zo->op1.u.constant.type == IS_STRING && \ ++ zo->op1.u.constant.value.str.val[0] == '_') { \ ++ \ ++ znode* varname = &zo->op1; \ ++ (void)zend_is_auto_global(varname->u.constant.value.str.val, \ ++ varname->u.constant.value.str.len \ ++ TSRMLS_CC); \ ++ } ++#endif ++ ++/* {{{ my_prepare_op_array_for_execution */ ++static int my_prepare_op_array_for_execution(zend_op_array* dst, zend_op_array* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ /* combine my_fetch_global_vars and my_copy_data_exceptions. ++ * - Pre-fetch superglobals which would've been pre-fetched in parse phase. ++ * - If the opcode stream contain mutable data, ensure a copy. ++ * - Fixup array jumps in the same loop. ++ */ ++ int i=src->last; ++ zend_op *zo; ++ zend_op *dzo; ++ apc_opflags_t * flags = apc_reserved_offset != -1 ? ++ (apc_opflags_t*) & (src->reserved[apc_reserved_offset]) : NULL; ++ int needcopy = flags ? flags->deep_copy : 1; ++ /* auto_globals_jit was not in php4 */ ++ int do_prepare_fetch_global = PG(auto_globals_jit) && (flags == NULL || flags->unknown_global); ++ ++#define FETCH_AUTOGLOBAL(member) do { \ ++ if(flags && flags->member == 1) { \ ++ zend_is_auto_global(#member,\ ++ (sizeof(#member) - 1)\ ++ TSRMLS_CC);\ ++ } \ ++} while(0); ++ ++ FETCH_AUTOGLOBAL(_GET); ++ FETCH_AUTOGLOBAL(_POST); ++ FETCH_AUTOGLOBAL(_COOKIE); ++ FETCH_AUTOGLOBAL(_SERVER); ++ FETCH_AUTOGLOBAL(_ENV); ++ FETCH_AUTOGLOBAL(_FILES); ++ FETCH_AUTOGLOBAL(_REQUEST); ++ FETCH_AUTOGLOBAL(_SESSION); ++#ifdef ZEND_ENGINE_2_4 ++ FETCH_AUTOGLOBAL(GLOBALS); ++#endif ++ ++ if(needcopy) { ++ ++#ifdef ZEND_ENGINE_2_4 ++ if (src->literals) { ++ zend_literal *p, *q, *end; ++ ++ q = src->literals; ++ p = dst->literals = (zend_literal*) apc_xmemcpy(src->literals, ++ sizeof(zend_literal) * src->last_literal, ++ apc_php_malloc TSRMLS_CC); ++ end = p + src->last_literal; ++ while (p < end) { ++ if (Z_TYPE(q->constant) == IS_CONSTANT_ARRAY) { ++ my_copy_zval(&p->constant, &q->constant, ctxt TSRMLS_CC); ++ } ++ p++; ++ q++; ++ } ++ } ++#endif ++ ++ dst->opcodes = (zend_op*) apc_xmemcpy(src->opcodes, ++ sizeof(zend_op) * src->last, ++ apc_php_malloc TSRMLS_CC); ++ zo = src->opcodes; ++ dzo = dst->opcodes; ++ while(i > 0) { ++ ++#ifdef ZEND_ENGINE_2_4 ++ if(zo->op1_type == IS_CONST) { ++ dzo->op1.literal = zo->op1.literal - src->literals + dst->literals; ++ } ++ if(zo->op2_type == IS_CONST) { ++ dzo->op2.literal = zo->op2.literal - src->literals + dst->literals; ++ } ++ if(zo->result_type == IS_CONST) { ++ dzo->result.literal = zo->result.literal - src->literals + dst->literals; ++ } ++#else ++ if( ((zo->op1.op_type == IS_CONST && ++ zo->op1.u.constant.type == IS_CONSTANT_ARRAY)) || ++ ((zo->op2.op_type == IS_CONST && ++ zo->op2.u.constant.type == IS_CONSTANT_ARRAY))) { ++ ++ if(!(my_copy_zend_op(dzo, zo, ctxt TSRMLS_CC))) { ++ assert(0); /* emalloc failed or a bad constant array */ ++ } ++ } ++#endif ++ ++ switch(zo->opcode) { ++#ifdef ZEND_ENGINE_2_3 ++ case ZEND_GOTO: ++#endif ++ case ZEND_JMP: ++#ifdef ZEND_ENGINE_2_4 ++ dzo->op1.jmp_addr = dst->opcodes + ++ (zo->op1.jmp_addr - src->opcodes); ++#else ++ dzo->op1.u.jmp_addr = dst->opcodes + ++ (zo->op1.u.jmp_addr - src->opcodes); ++#endif ++ break; ++ case ZEND_JMPZ: ++ case ZEND_JMPNZ: ++ case ZEND_JMPZ_EX: ++ case ZEND_JMPNZ_EX: ++#ifdef ZEND_ENGINE_2_3 ++ case ZEND_JMP_SET: ++#endif ++#ifdef ZEND_ENGINE_2_4 ++ case ZEND_JMP_SET_VAR: ++#endif ++#ifdef ZEND_ENGINE_2_4 ++ dzo->op2.jmp_addr = dst->opcodes + ++ (zo->op2.jmp_addr - src->opcodes); ++#else ++ dzo->op2.u.jmp_addr = dst->opcodes + ++ (zo->op2.u.jmp_addr - src->opcodes); ++#endif ++ break; ++ case ZEND_FETCH_R: ++ case ZEND_FETCH_W: ++ case ZEND_FETCH_IS: ++ case ZEND_FETCH_FUNC_ARG: ++ if(do_prepare_fetch_global) ++ { ++ APC_PREPARE_FETCH_GLOBAL_FOR_EXECUTION(); ++ } ++ break; ++ default: ++ break; ++ } ++ i--; ++ zo++; ++ dzo++; ++ } ++ } else { /* !needcopy */ ++ /* The fetch is only required if auto_globals_jit=1 */ ++ if(do_prepare_fetch_global) ++ { ++ zo = src->opcodes; ++ while(i > 0) { ++ ++ if(zo->opcode == ZEND_FETCH_R || ++ zo->opcode == ZEND_FETCH_W || ++ zo->opcode == ZEND_FETCH_IS || ++ zo->opcode == ZEND_FETCH_FUNC_ARG ++ ) { ++ APC_PREPARE_FETCH_GLOBAL_FOR_EXECUTION(); ++ } ++ ++ i--; ++ zo++; ++ } ++ } ++ } ++ return 1; ++} ++/* }}} */ ++ ++/* {{{ apc_copy_op_array_for_execution */ ++zend_op_array* apc_copy_op_array_for_execution(zend_op_array* dst, zend_op_array* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ if(dst == NULL) { ++ dst = (zend_op_array*) emalloc(sizeof(src[0])); ++ } ++ memcpy(dst, src, sizeof(src[0])); ++ dst->static_variables = my_copy_static_variables(src, ctxt TSRMLS_CC); ++ ++ /* memory leak */ ++ dst->refcount = apc_pmemcpy(src->refcount, ++ sizeof(src->refcount[0]), ++ ctxt->pool TSRMLS_CC); ++ ++ my_prepare_op_array_for_execution(dst,src, ctxt TSRMLS_CC); ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ apc_copy_function_for_execution */ ++zend_function* apc_copy_function_for_execution(zend_function* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ zend_function* dst; ++ ++ dst = (zend_function*) emalloc(sizeof(src[0])); ++ memcpy(dst, src, sizeof(src[0])); ++ apc_copy_op_array_for_execution(&(dst->op_array), &(src->op_array), ctxt TSRMLS_CC); ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ apc_copy_function_for_execution_ex */ ++zend_function* apc_copy_function_for_execution_ex(void *dummy, zend_function* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++ if(src->type==ZEND_INTERNAL_FUNCTION || src->type==ZEND_OVERLOADED_FUNCTION) return src; ++ return apc_copy_function_for_execution(src, ctxt TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ apc_copy_class_entry_for_execution */ ++zend_class_entry* apc_copy_class_entry_for_execution(zend_class_entry* src, apc_context_t* ctxt TSRMLS_DC) ++{ ++#ifdef ZEND_ENGINE_2_4 ++ int i; ++#endif ++ zend_class_entry* dst = (zend_class_entry*) apc_pool_alloc(ctxt->pool, sizeof(src[0])); ++ memcpy(dst, src, sizeof(src[0])); ++ ++ if(src->num_interfaces) ++ { ++ /* These are slots to be populated later by ADD_INTERFACE insns */ ++ dst->interfaces = apc_php_malloc( ++ (sizeof(zend_class_entry*) * src->num_interfaces) TSRMLS_CC); ++ memset(dst->interfaces, 0, ++ sizeof(zend_class_entry*) * src->num_interfaces); ++ } ++ else ++ { ++ /* assert(dst->interfaces == NULL); */ ++ } ++ ++ /* Deep-copy the class properties, because they will be modified */ ++ ++#ifdef ZEND_ENGINE_2_4 ++ dst->name = apc_string_pmemcpy((char*)src->name, src->name_length+1, ctxt->pool TSRMLS_CC); ++ dst->default_properties_count = src->default_properties_count; ++ if (src->default_properties_count) { ++ dst->default_properties_table = (zval**) apc_php_malloc((sizeof(zval*) * src->default_properties_count) TSRMLS_CC); ++ for (i = 0; i < src->default_properties_count; i++) { ++ if (src->default_properties_table[i]) { ++ my_copy_zval_ptr(&dst->default_properties_table[i], (const zval**)&src->default_properties_table[i], ctxt TSRMLS_CC); ++ } else { ++ dst->default_properties_table[i] = NULL; ++ } ++ } ++ } else { ++ dst->default_properties_table = NULL; ++ } ++#else ++ my_copy_hashtable(&dst->default_properties, ++ &src->default_properties, ++ (ht_copy_fun_t) my_copy_zval_ptr, ++ 1, ++ ctxt); ++#endif ++ ++ /* For derived classes, we must also copy the function hashtable (although ++ * we can merely bitwise copy the functions it contains) */ ++ ++ my_copy_hashtable(&dst->function_table, ++ &src->function_table, ++ (ht_copy_fun_t) apc_copy_function_for_execution_ex, ++ 0, ++ ctxt); ++ ++ my_fixup_hashtable(&dst->function_table, (ht_fixup_fun_t)my_fixup_function_for_execution, src, dst); ++ ++ /* zend_do_inheritance merges properties_info. ++ * Need only shallow copying as it doesn't hold the pointers. ++ */ ++ my_copy_hashtable(&dst->properties_info, ++ &src->properties_info, ++ (ht_copy_fun_t) my_copy_property_info_for_execution, ++ 0, ++ ctxt); ++ ++#ifdef ZEND_ENGINE_2_2 ++ /* php5.2 introduced a scope attribute for property info */ ++ my_fixup_hashtable(&dst->properties_info, (ht_fixup_fun_t)my_fixup_property_info_for_execution, src, dst); ++#endif ++ ++ /* if inheritance results in a hash_del, it might result in ++ * a pefree() of the pointers here. Deep copying required. ++ */ ++ ++ my_copy_hashtable(&dst->constants_table, ++ &src->constants_table, ++ (ht_copy_fun_t) my_copy_zval_ptr, ++ 1, ++ ctxt); ++ ++#ifdef ZEND_ENGINE_2_4 ++ dst->default_static_members_count = src->default_static_members_count; ++ if (src->default_static_members_count) { ++ dst->default_static_members_table = (zval**) apc_php_malloc((sizeof(zval*) * src->default_static_members_count) TSRMLS_CC); ++ for (i = 0; i < src->default_static_members_count; i++) { ++ if (src->default_static_members_table[i]) { ++ my_copy_zval_ptr(&dst->default_static_members_table[i], (const zval**)&src->default_static_members_table[i], ctxt TSRMLS_CC); ++ } else { ++ dst->default_static_members_table[i] = NULL; ++ } ++ } ++ } else { ++ dst->default_static_members_table = NULL; ++ } ++ dst->static_members_table = dst->default_static_members_table; ++#else ++ my_copy_hashtable(&dst->default_static_members, ++ &src->default_static_members, ++ (ht_copy_fun_t) my_copy_zval_ptr, ++ 1, ++ ctxt); ++ ++ if(src->static_members != &(src->default_static_members)) ++ { ++ dst->static_members = my_copy_hashtable(NULL, ++ src->static_members, ++ (ht_copy_fun_t) my_copy_zval_ptr, ++ 1, ++ ctxt); ++ } ++ else ++ { ++ dst->static_members = &(dst->default_static_members); ++ } ++#endif ++ ++ return dst; ++} ++/* }}} */ ++ ++/* {{{ apc_free_class_entry_after_execution */ ++void apc_free_class_entry_after_execution(zend_class_entry* src TSRMLS_DC) ++{ ++ if(src->num_interfaces > 0 && src->interfaces) { ++ apc_php_free(src->interfaces TSRMLS_CC); ++ src->interfaces = NULL; ++ src->num_interfaces = 0; ++ } ++ /* my_destroy_hashtable() does not play nice with refcounts */ ++ ++#ifdef ZEND_ENGINE_2_4 ++ if (src->default_static_members_table) { ++ int i; ++ ++ for (i = 0; i < src->default_static_members_count; i++) { ++ zval_ptr_dtor(&src->default_static_members_table[i]); ++ } ++ efree(src->default_static_members_table); ++ src->default_static_members_table = NULL; ++ } ++ src->static_members_table = NULL; ++ if (src->default_properties_table) { ++ int i; ++ ++ for (i = 0; i < src->default_properties_count; i++) { ++ if (src->default_properties_table[i]) { ++ zval_ptr_dtor(&src->default_properties_table[i]); ++ } ++ } ++ efree(src->default_properties_table); ++ src->default_properties_table = NULL; ++ } ++#else ++ zend_hash_clean(&src->default_static_members); ++ if(src->static_members != &(src->default_static_members)) ++ { ++ zend_hash_destroy(src->static_members); ++ apc_php_free(src->static_members TSRMLS_CC); ++ src->static_members = NULL; ++ } ++ else ++ { ++ src->static_members = NULL; ++ } ++ ++ zend_hash_clean(&src->default_properties); ++#endif ++ zend_hash_clean(&src->constants_table); ++ ++ /* TODO: more cleanup */ ++} ++/* }}} */ ++ ++/* {{{ apc_file_halt_offset */ ++long apc_file_halt_offset(const char *filename TSRMLS_DC) ++{ ++ zend_constant *c; ++ char *name; ++ int len; ++ char haltoff[] = "__COMPILER_HALT_OFFSET__"; ++ long value = -1; ++ ++ zend_mangle_property_name(&name, &len, haltoff, sizeof(haltoff) - 1, filename, strlen(filename), 0); ++ ++ if (zend_hash_find(EG(zend_constants), name, len+1, (void **) &c) == SUCCESS) { ++ value = Z_LVAL(c->value); ++ } ++ ++ pefree(name, 0); ++ ++ return value; ++} ++/* }}} */ ++ ++/* {{{ apc_do_halt_compiler_register */ ++void apc_do_halt_compiler_register(const char *filename, long halt_offset TSRMLS_DC) ++{ ++ char *name; ++ char haltoff[] = "__COMPILER_HALT_OFFSET__"; ++ int len; ++ ++ if(halt_offset > 0) { ++ ++ zend_mangle_property_name(&name, &len, haltoff, sizeof(haltoff) - 1, ++ filename, strlen(filename), 0); ++ ++ zend_register_long_constant(name, len+1, halt_offset, CONST_CS, 0 TSRMLS_CC); ++ ++ pefree(name, 0); ++ } ++} ++/* }}} */ ++ ++ ++ ++/* {{{ my_fixup_function */ ++static void my_fixup_function(Bucket *p, zend_class_entry *src, zend_class_entry *dst) ++{ ++ zend_function* zf = p->pData; ++ ++ #define SET_IF_SAME_NAME(member) \ ++ do { \ ++ if(src->member && !strcmp(zf->common.function_name, src->member->common.function_name)) { \ ++ dst->member = zf; \ ++ } \ ++ } \ ++ while(0) ++ ++ if(zf->common.scope == src) ++ { ++ ++ /* Fixing up the default functions for objects here since ++ * we need to compare with the newly allocated functions ++ * ++ * caveat: a sub-class method can have the same name as the ++ * parent's constructor and create problems. ++ */ ++ ++ if(zf->common.fn_flags & ZEND_ACC_CTOR) dst->constructor = zf; ++ else if(zf->common.fn_flags & ZEND_ACC_DTOR) dst->destructor = zf; ++ else if(zf->common.fn_flags & ZEND_ACC_CLONE) dst->clone = zf; ++ else ++ { ++ SET_IF_SAME_NAME(__get); ++ SET_IF_SAME_NAME(__set); ++ SET_IF_SAME_NAME(__unset); ++ SET_IF_SAME_NAME(__isset); ++ SET_IF_SAME_NAME(__call); ++#ifdef ZEND_ENGINE_2_2 ++ SET_IF_SAME_NAME(__tostring); ++#endif ++#ifdef ZEND_ENGINE_2_3 ++ SET_IF_SAME_NAME(__callstatic); ++#endif ++ } ++ zf->common.scope = dst; ++ } ++ else ++ { ++ /* no other function should reach here */ ++ assert(0); ++ } ++ ++ #undef SET_IF_SAME_NAME ++} ++/* }}} */ ++ ++#ifdef ZEND_ENGINE_2_2 ++/* {{{ my_fixup_property_info */ ++static void my_fixup_property_info(Bucket *p, zend_class_entry *src, zend_class_entry *dst) ++{ ++ zend_property_info* property_info = (zend_property_info*)p->pData; ++ ++ if(property_info->ce == src) ++ { ++ property_info->ce = dst; ++ } ++ else ++ { ++ assert(0); /* should never happen */ ++ } ++} ++/* }}} */ ++#endif ++ ++/* {{{ my_fixup_hashtable */ ++static void my_fixup_hashtable(HashTable *ht, ht_fixup_fun_t fixup, zend_class_entry *src, zend_class_entry *dst) ++{ ++ Bucket *p; ++ uint i; ++ ++ for (i = 0; i < ht->nTableSize; i++) { ++ if(!ht->arBuckets) break; ++ p = ht->arBuckets[i]; ++ while (p != NULL) { ++ fixup(p, src, dst); ++ p = p->pNext; ++ } ++ } ++} ++/* }}} */ ++ ++ ++/* {{{ my_check_copy_function */ ++static int my_check_copy_function(Bucket* p, va_list args) ++{ ++ zend_class_entry* src = va_arg(args, zend_class_entry*); ++ zend_function* zf = (zend_function*)p->pData; ++ ++ return (zf->common.scope == src); ++} ++/* }}} */ ++ ++#ifndef ZEND_ENGINE_2_4 ++/* {{{ my_check_copy_default_property */ ++static int my_check_copy_default_property(Bucket* p, va_list args) ++{ ++ zend_class_entry* src = va_arg(args, zend_class_entry*); ++ zend_class_entry* parent = src->parent; ++ zval ** child_prop = (zval**)p->pData; ++ zval ** parent_prop = NULL; ++ ++ if (parent && ++ zend_hash_quick_find(&parent->default_properties, p->arKey, ++ p->nKeyLength, p->h, (void **) &parent_prop)==SUCCESS) { ++ ++ if((parent_prop && child_prop) && (*parent_prop) == (*child_prop)) ++ { ++ return 0; ++ } ++ } ++ ++ /* possibly not in the parent */ ++ return 1; ++} ++/* }}} */ ++#endif ++ ++/* {{{ my_check_copy_property_info */ ++static int my_check_copy_property_info(Bucket* p, va_list args) ++{ ++ zend_class_entry* src = va_arg(args, zend_class_entry*); ++ zend_class_entry* parent = src->parent; ++ zend_property_info* child_info = (zend_property_info*)p->pData; ++ zend_property_info* parent_info = NULL; ++ ++#ifdef ZEND_ENGINE_2_2 ++ /* so much easier */ ++ return (child_info->ce == src); ++#endif ++ ++ if (parent && ++ zend_hash_quick_find(&parent->properties_info, p->arKey, p->nKeyLength, ++ p->h, (void **) &parent_info)==SUCCESS) { ++ if(parent_info->flags & ZEND_ACC_PRIVATE) ++ { ++ return 1; ++ } ++ if((parent_info->flags & ZEND_ACC_PPP_MASK) != ++ (child_info->flags & ZEND_ACC_PPP_MASK)) ++ { ++ /* TODO: figure out whether ACC_CHANGED is more appropriate ++ * here */ ++ return 1; ++ } ++ return 0; ++ } ++ ++ /* property doesn't exist in parent, copy into cached child */ ++ return 1; ++} ++/* }}} */ ++ ++#ifndef ZEND_ENGINE_2_4 ++/* {{{ my_check_copy_static_member */ ++static int my_check_copy_static_member(Bucket* p, va_list args) ++{ ++ zend_class_entry* src = va_arg(args, zend_class_entry*); ++ HashTable * ht = va_arg(args, HashTable*); ++ zend_class_entry* parent = src->parent; ++ HashTable * parent_ht = NULL; ++ char * member_name; ++ char * class_name = NULL; ++ ++ zend_property_info *parent_info = NULL; ++ zend_property_info *child_info = NULL; ++ zval ** parent_prop = NULL; ++ zval ** child_prop = (zval**)(p->pData); ++ ++ if(!parent) { ++ return 1; ++ } ++ ++ /* these do not need free'ing */ ++#ifdef ZEND_ENGINE_2_2 ++ zend_unmangle_property_name(p->arKey, p->nKeyLength-1, &class_name, &member_name); ++#else ++ zend_unmangle_property_name(p->arKey, &class_name, &member_name); ++#endif ++ ++ /* please refer do_inherit_property_access_check in zend_compile.c ++ * to understand why we lookup in properties_info. ++ */ ++ if((zend_hash_find(&parent->properties_info, member_name, ++ strlen(member_name)+1, (void**)&parent_info) == SUCCESS) ++ && ++ (zend_hash_find(&src->properties_info, member_name, ++ strlen(member_name)+1, (void**)&child_info) == SUCCESS)) ++ { ++ if(ht == &(src->default_static_members)) ++ { ++ parent_ht = &parent->default_static_members; ++ } ++ else ++ { ++ parent_ht = parent->static_members; ++ } ++ ++ if(zend_hash_quick_find(parent_ht, p->arKey, ++ p->nKeyLength, p->h, (void**)&parent_prop) == SUCCESS) ++ { ++ /* they point to the same zval */ ++ if(*parent_prop == *child_prop) ++ { ++ return 0; ++ } ++ } ++ } ++ ++ return 1; ++} ++/* }}} */ ++#endif ++ ++/* {{{ my_check_copy_constant */ ++static int my_check_copy_constant(Bucket* p, va_list args) ++{ ++ zend_class_entry* src = va_arg(args, zend_class_entry*); ++ zend_class_entry* parent = src->parent; ++ zval ** child_const = (zval**)p->pData; ++ zval ** parent_const = NULL; ++ ++ if (parent && ++ zend_hash_quick_find(&parent->constants_table, p->arKey, ++ p->nKeyLength, p->h, (void **) &parent_const)==SUCCESS) { ++ ++ if((parent_const && child_const) && (*parent_const) == (*child_const)) ++ { ++ return 0; ++ } ++ } ++ ++ /* possibly not in the parent */ ++ return 1; ++} ++/* }}} */ ++ ++/* {{{ apc_register_optimizer(apc_optimize_function_t optimizer) ++ * register a optimizer callback function, returns the previous callback ++ */ ++apc_optimize_function_t apc_register_optimizer(apc_optimize_function_t optimizer TSRMLS_DC) { ++ apc_optimize_function_t old_optimizer = APCG(apc_optimize_function); ++ APCG(apc_optimize_function) = optimizer; ++ return old_optimizer; ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_compile.h b/ext/apc/apc_compile.h +--- a/ext/apc/apc_compile.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_compile.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,152 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | Arun C. Murthy | ++ | Gopal Vijayaraghavan | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_compile.h 307185 2011-01-06 21:13:11Z gopalv $ */ ++ ++#ifndef APC_COMPILE_H ++#define APC_COMPILE_H ++ ++/* ++ * This module encapsulates most of the complexity involved in deep-copying ++ * the Zend compiler data structures. The routines are allocator-agnostic, so ++ * the same function can be used for copying to and from shared memory. ++ */ ++ ++#include "apc.h" ++#include "apc_php.h" ++#include "apc_main.h" ++#include "apc_serializer.h" ++ ++/* {{{ struct definition: apc_function_t */ ++typedef struct apc_function_t apc_function_t; ++struct apc_function_t { ++ char* name; /* the function name */ ++ int name_len; /* length of name */ ++ zend_function* function; /* the zend function data structure */ ++}; ++/* }}} */ ++ ++/* {{{ struct definition: apc_class_t */ ++typedef struct apc_class_t apc_class_t; ++struct apc_class_t { ++ char* name; /* the class name */ ++ int name_len; /* length of name */ ++ char* parent_name; /* the parent class name */ ++ zend_class_entry* class_entry; /* the zend class data structure */ ++}; ++/* }}} */ ++ ++/* {{{ struct definition: apc_opflags_t */ ++typedef struct apc_opflags_t apc_opflags_t; ++struct apc_opflags_t { ++ unsigned int has_jumps : 1; /* has jump offsets */ ++ unsigned int deep_copy : 1; /* needs deep copy */ ++ ++ /* autoglobal bits */ ++ unsigned int _POST : 1; ++ unsigned int _GET : 1; ++ unsigned int _COOKIE : 1; ++ unsigned int _SERVER : 1; ++ unsigned int _ENV : 1; ++ unsigned int _FILES : 1; ++ unsigned int _REQUEST : 1; ++ unsigned int _SESSION : 1; ++#ifdef ZEND_ENGINE_2_4 ++ unsigned int GLOBALS : 1; ++#endif ++ unsigned int unknown_global : 1; ++}; ++/* }}} */ ++ ++/* ++ * These are the top-level copy functions. ++ */ ++ ++extern zend_op_array* apc_copy_op_array(zend_op_array* dst, zend_op_array* src, apc_context_t* ctxt TSRMLS_DC); ++extern zend_class_entry* apc_copy_class_entry(zend_class_entry* dst, zend_class_entry* src, apc_context_t* ctxt TSRMLS_DC); ++extern apc_function_t* apc_copy_new_functions(int old_count, apc_context_t* ctxt TSRMLS_DC); ++extern apc_class_t* apc_copy_new_classes(zend_op_array* op_array, int old_count, apc_context_t* ctxt TSRMLS_DC); ++extern zval* apc_copy_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC); ++ ++#if 0 ++/* ++ * Deallocation functions corresponding to the copy functions above. ++ */ ++ ++extern void apc_free_op_array(zend_op_array* src, apc_context_t* ctxt); ++extern void apc_free_functions(apc_function_t* src, apc_context_t* ctxt); ++extern void apc_free_classes(apc_class_t* src, apc_context_t* ctxt); ++extern void apc_free_zval(zval* src, apc_context_t* ctxt); ++#endif ++ ++/* ++ * These "copy-for-execution" functions must be called after retrieving an ++ * object from the shared cache. They do the minimal amount of work necessary ++ * to allow multiple processes to concurrently execute the same VM data ++ * structures. ++ */ ++ ++extern zend_op_array* apc_copy_op_array_for_execution(zend_op_array* dst, zend_op_array* src, apc_context_t* ctxt TSRMLS_DC); ++extern zend_function* apc_copy_function_for_execution(zend_function* src, apc_context_t* ctxt TSRMLS_DC); ++extern zend_class_entry* apc_copy_class_entry_for_execution(zend_class_entry* src, apc_context_t* ctxt TSRMLS_DC); ++ ++/* ++ * The "free-after-execution" function performs a cursory clean up of the class data ++ * This is required to minimize memory leak warnings and to ensure correct destructor ++ * ordering of some variables. ++ */ ++extern void apc_free_class_entry_after_execution(zend_class_entry* src TSRMLS_DC); ++ ++/* ++ * Optimization callback definition and registration function. ++ */ ++typedef zend_op_array* (*apc_optimize_function_t) (zend_op_array* TSRMLS_DC); ++extern apc_optimize_function_t apc_register_optimizer(apc_optimize_function_t optimizer TSRMLS_DC); ++ ++/* ++ * To handle __COMPILER_HALT_OFFSET__ ++ */ ++long apc_file_halt_offset(const char* filename TSRMLS_DC); ++void apc_do_halt_compiler_register(const char *filename, long halt_offset TSRMLS_DC); ++ ++/* ++ * apc serialization functions ++ */ ++int APC_SERIALIZER_NAME(php) (APC_SERIALIZER_ARGS); ++int APC_UNSERIALIZER_NAME(php) (APC_UNSERIALIZER_ARGS); ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_debug.c b/ext/apc/apc_debug.c +--- a/ext/apc/apc_debug.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_debug.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,70 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | Arun C. Murthy | ++ | Gopal Vijayaraghavan | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++*/ ++ ++/* $Id: apc_debug.c 307048 2011-01-03 23:53:17Z kalle $ */ ++#include "apc.h" ++#include ++#include "zend.h" ++#include "zend_compile.h" ++ ++#if defined(__DEBUG_APC__) ++ ++/* keep track of vld_dump_oparray() signature */ ++typedef void (*vld_dump_f) (zend_op_array * TSRMLS_DC); ++ ++#endif ++ ++void dump(zend_op_array *op_array TSRMLS_DC) ++{ ++#if defined(__DEBUG_APC__) ++ vld_dump_f dump_op_array; ++ DL_HANDLE handle = NULL; ++ ++#ifdef PHP_WIN32 ++ handle = GetModuleHandle(NULL); ++ ++ if (!handle) { ++ apc_warning("unable to fetch current module handle." TSRMLS_CC); ++ } ++#endif ++ ++ dump_op_array = (vld_dump_f) DL_FETCH_SYMBOL(handle, "vld_dump_oparray"); ++ ++#ifdef PHP_WIN32 ++ DL_UNLOAD(handle); ++#endif ++ ++ if(dump_op_array) { ++ dump_op_array(op_array TSRMLS_CC); ++ ++ return; ++ } ++ ++ apc_warning("vld is not installed or something even worse." TSRMLS_CC); ++#endif ++} +diff -Naur a/ext/apc/apc_debug.h b/ext/apc/apc_debug.h +--- a/ext/apc/apc_debug.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_debug.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,29 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | Arun C. Murthy | ++ | Gopal Vijayaraghavan | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++*/ ++ ++void dump(zend_op_array * TSRMLS_DC); +diff -Naur a/ext/apc/apc_fcntl.c b/ext/apc/apc_fcntl.c +--- a/ext/apc/apc_fcntl.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_fcntl.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,123 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: George Schlossnagle | ++ | Rasmus Lerdorf | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_fcntl.c 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#include "apc.h" ++ ++#ifdef APC_FCNTL_LOCKS ++ ++#include "apc_fcntl.h" ++#include ++#include ++ ++int apc_fcntl_create(const char* pathname TSRMLS_DC) ++{ ++ int fd; ++ if(pathname == NULL) { ++ char lock_path[] = "/tmp/.apc.XXXXXX"; ++ mktemp(lock_path); ++ fd = open(lock_path, O_RDWR|O_CREAT, 0666); ++ if(fd > 0 ) { ++ unlink(lock_path); ++ return fd; ++ } else { ++ apc_error("apc_fcntl_create: open(%s, O_RDWR|O_CREAT, 0666) failed:" TSRMLS_CC, lock_path); ++ return -1; ++ } ++ } ++ fd = open(pathname, O_RDWR|O_CREAT, 0666); ++ if(fd > 0 ) { ++ unlink(pathname); ++ return fd; ++ } ++ apc_error("apc_fcntl_create: open(%s, O_RDWR|O_CREAT, 0666) failed:" TSRMLS_CC, pathname); ++ return -1; ++} ++ ++void apc_fcntl_destroy(int fd) ++{ ++ close(fd); ++} ++ ++static int lock_reg(int fd, int cmd, int type, off_t offset, int whence, off_t len) ++{ ++ int ret; ++ struct flock lock; ++ ++ lock.l_type = type; ++ lock.l_start = offset; ++ lock.l_whence = whence; ++ lock.l_len = len; ++ lock.l_pid = 0; ++ ++ do { ret = fcntl(fd, cmd, &lock) ; } ++ while(ret < 0 && errno == EINTR); ++ return(ret); ++} ++ ++void apc_fcntl_lock(int fd TSRMLS_DC) ++{ ++ if(lock_reg(fd, F_SETLKW, F_WRLCK, 0, SEEK_SET, 0) < 0) { ++ apc_error("apc_fcntl_lock failed:" TSRMLS_CC); ++ } ++} ++ ++void apc_fcntl_rdlock(int fd TSRMLS_DC) ++{ ++ if(lock_reg(fd, F_SETLKW, F_RDLCK, 0, SEEK_SET, 0) < 0) { ++ apc_error("apc_fcntl_rdlock failed:" TSRMLS_CC); ++ } ++} ++ ++zend_bool apc_fcntl_nonblocking_lock(int fd TSRMLS_DC) ++{ ++ if(lock_reg(fd, F_SETLK, F_WRLCK, 0, SEEK_SET, 0) < 0) { ++ if(errno==EACCES||errno==EAGAIN) return 0; ++ else apc_error("apc_fcntl_lock failed:" TSRMLS_CC); ++ } ++ return 1; ++} ++ ++void apc_fcntl_unlock(int fd TSRMLS_DC) ++{ ++ if(lock_reg(fd, F_SETLKW, F_UNLCK, 0, SEEK_SET, 0) < 0) { ++ apc_error("apc_fcntl_unlock failed:" TSRMLS_CC); ++ } ++} ++ ++#endif /* APC_FCNTL_LOCKS */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_fcntl.h b/ext/apc/apc_fcntl.h +--- a/ext/apc/apc_fcntl.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_fcntl.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,50 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: George Schlossnagle | ++ | Rasmus Lerdorf | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_fcntl.h 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#ifndef APC_FCNTL_H ++#define APC_FCNTL_H ++ ++ ++extern int apc_fcntl_create(const char* pathname TSRMLS_DC); ++extern void apc_fcntl_destroy(int fd); ++extern void apc_fcntl_lock(int fd TSRMLS_DC); ++extern void apc_fcntl_rdlock(int fd TSRMLS_DC); ++extern void apc_fcntl_unlock(int fd TSRMLS_DC); ++extern unsigned char apc_fcntl_nonblocking_lock(int fd TSRMLS_DC); ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_fcntl_win32.c b/ext/apc/apc_fcntl_win32.c +--- a/ext/apc/apc_fcntl_win32.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_fcntl_win32.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,120 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: George Schlossnagle | ++ | Edin Kadribasic | ++ | Pierre Joye | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_fcntl_win32.c 309203 2011-03-14 06:47:16Z pajoye $ */ ++ ++#include "apc.h" ++#include "apc_fcntl.h" ++#include ++#include ++#include ++#include ++#include ++#include ++ ++int apc_fcntl_create(const char* pathname TSRMLS_DC) ++{ ++ char lock_file[MAXPATHLEN]; ++ HANDLE fd; ++ DWORD tmp_dirname_len; ++ char lock_filename_tpl[] = ".apc.XXXXXX"; ++ char *lock_filename; ++ ++ tmp_dirname_len = GetTempPath(MAXPATHLEN, lock_file); ++ if (!tmp_dirname_len) { ++ return -1; ++ } ++ ++ lock_filename = _mktemp(lock_filename_tpl); ++ if (lock_filename == NULL) { ++ return -1; ++ } ++ ++ snprintf(lock_file + tmp_dirname_len, MAXPATHLEN - tmp_dirname_len - 1, "%s", lock_filename); ++ ++ fd = CreateFile(lock_file, ++ GENERIC_READ | GENERIC_WRITE, ++ FILE_SHARE_READ | FILE_SHARE_WRITE, ++ NULL, ++ OPEN_ALWAYS, ++ FILE_ATTRIBUTE_NORMAL, ++ NULL); ++ ++ if (fd == INVALID_HANDLE_VALUE) { ++ apc_error("apc_fcntl_create: could not open %s" TSRMLS_CC, lock_file); ++ return -1; ++ } ++ ++ return (int)fd; ++} ++ ++void apc_fcntl_destroy(int fd) ++{ ++ CloseHandle((HANDLE)fd); ++} ++ ++void apc_fcntl_lock(int fd TSRMLS_DC) ++{ ++ OVERLAPPED offset = {0, 0, 0, 0, NULL}; ++ ++ if (!LockFileEx((HANDLE)fd, LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &offset)) { ++ apc_error("apc_fcntl_lock failed errno:%d" TSRMLS_CC, GetLastError()); ++ } ++} ++ ++void apc_fcntl_rdlock(int fd TSRMLS_DC) ++{ ++ OVERLAPPED offset = {0, 0, 0, 0, NULL}; ++ ++ if (!LockFileEx((HANDLE)fd, 0, 0, 1, 0, &offset)) { ++ apc_error("apc_fcntl_rdlock failed errno:%d" TSRMLS_CC, GetLastError()); ++ } ++} ++ ++void apc_fcntl_unlock(int fd TSRMLS_DC) ++{ ++ OVERLAPPED offset = {0, 0, 0, 0, NULL}; ++ ++ if (!UnlockFileEx((HANDLE)fd, 0, 1, 0, &offset)) { ++ DWORD error_code = GetLastError(); ++ /* Ignore already unlocked error */ ++ if (error_code != ERROR_NOT_LOCKED) { ++ apc_error("apc_fcntl_unlock failed errno:%d" TSRMLS_CC, error_code); ++ } ++ } ++} ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_globals.h b/ext/apc/apc_globals.h +--- a/ext/apc/apc_globals.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_globals.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,152 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | George Schlossnagle | ++ | Rasmus Lerdorf | ++ | Arun C. Murthy | ++ | Gopal Vijayaraghavan | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_globals.h 307215 2011-01-07 09:54:00Z gopalv $ */ ++ ++#ifndef APC_GLOBALS_H ++#define APC_GLOBALS_H ++ ++#include "apc_cache.h" ++#include "apc_stack.h" ++#include "apc_php.h" ++#include "apc_main.h" ++ ++/* {{{ struct apc_rfc1867_data */ ++ ++typedef struct _apc_rfc1867_data apc_rfc1867_data; ++ ++struct _apc_rfc1867_data { ++ char tracking_key[64]; ++ int key_length; ++ size_t content_length; ++ char filename[128]; ++ char name[64]; ++ char *temp_filename; ++ int cancel_upload; ++ double start_time; ++ size_t bytes_processed; ++ size_t prev_bytes_processed; ++ int update_freq; ++ double rate; ++ int started; ++}; ++/* }}} */ ++ ++ ++ZEND_BEGIN_MODULE_GLOBALS(apc) ++ /* configuration parameters */ ++ zend_bool enabled; /* if true, apc is enabled (defaults to true) */ ++ long shm_segments; /* number of shared memory segments to use */ ++ long shm_size; /* size of each shared memory segment (in MB) */ ++ long num_files_hint; /* parameter to apc_cache_create */ ++ long user_entries_hint; ++ long gc_ttl; /* parameter to apc_cache_create */ ++ long ttl; /* parameter to apc_cache_create */ ++ long user_ttl; ++#if APC_MMAP ++ char *mmap_file_mask; /* mktemp-style file-mask to pass to mmap */ ++#endif ++ char** filters; /* array of regex filters that prevent caching */ ++ void* compiled_filters; /* compiled regex filters */ ++ ++ /* module variables */ ++ zend_bool initialized; /* true if module was initialized */ ++ apc_stack_t* cache_stack; /* the stack of cached executable code */ ++ zend_bool cache_by_default; /* true if files should be cached unless filtered out */ ++ /* false if files should only be cached if filtered in */ ++ long file_update_protection; /* Age in seconds before a file is eligible to be cached - 0 to disable */ ++ zend_bool enable_cli; /* Flag to override turning APC off for CLI */ ++ long max_file_size; /* Maximum size of file, in bytes that APC will be allowed to cache */ ++ zend_bool fpstat; /* true if fullpath includes should be stat'ed */ ++ zend_bool canonicalize; /* true if relative paths should be canonicalized in no-stat mode */ ++ zend_bool stat_ctime; /* true if ctime in addition to mtime should be checked */ ++ zend_bool write_lock; /* true for a global write lock */ ++ zend_bool slam_defense; /* true for user cache slam defense */ ++ zend_bool report_autofilter; /* true for auto-filter warnings */ ++ zend_bool include_once; /* Override the ZEND_INCLUDE_OR_EVAL opcode handler to avoid pointless fopen()s [still experimental] */ ++ apc_optimize_function_t apc_optimize_function; /* optimizer function callback */ ++#ifdef MULTIPART_EVENT_FORMDATA ++ zend_bool rfc1867; /* Flag to enable rfc1867 handler */ ++ char* rfc1867_prefix; /* Key prefix */ ++ char* rfc1867_name; /* Name of hidden field to activate upload progress/key suffix */ ++ double rfc1867_freq; /* Update frequency as percentage or bytes */ ++ long rfc1867_ttl; /* TTL for rfc1867 entries */ ++ apc_rfc1867_data rfc1867_data;/* Per-request data */ ++#endif ++ HashTable copied_zvals; /* my_copy recursion detection list */ ++ zend_bool force_file_update; /* force files to be updated during apc_compile_file */ ++ char canon_path[MAXPATHLEN]; /* canonical path for key data */ ++#ifdef APC_FILEHITS ++ zval *filehits; /* Files that came from the cache for this request */ ++#endif ++ zend_bool coredump_unmap; /* Trap signals that coredump and unmap shared memory */ ++ apc_cache_t *current_cache; /* current cache being modified/read */ ++ char *preload_path; ++ zend_bool file_md5; /* record md5 hash of files */ ++ void *apc_bd_alloc_ptr; /* bindump alloc() ptr */ ++ void *apc_bd_alloc_ubptr; /* bindump alloc() upper bound ptr */ ++ HashTable apc_bd_alloc_list; /* bindump alloc() ptr list */ ++ zend_bool use_request_time; /* use the SAPI request start time for TTL */ ++ zend_bool lazy_functions; /* enable/disable lazy function loading */ ++ HashTable *lazy_function_table; /* lazy function entry table */ ++ zend_bool lazy_classes; /* enable/disable lazy class loading */ ++ HashTable *lazy_class_table; /* lazy class entry table */ ++#ifdef ZEND_ENGINE_2_4 ++ long shm_strings_buffer; ++#endif ++ char *serializer_name; /* the serializer config option */ ++ apc_serializer_t *serializer;/* the actual serializer in use */ ++ZEND_END_MODULE_GLOBALS(apc) ++ ++/* (the following declaration is defined in php_apc.c) */ ++ZEND_EXTERN_MODULE_GLOBALS(apc) ++ ++#ifdef ZTS ++# define APCG(v) TSRMG(apc_globals_id, zend_apc_globals *, v) ++#else ++# define APCG(v) (apc_globals.v) ++#endif ++ ++/* True globals */ ++extern apc_cache_t* apc_cache; /* the global compiler cache */ ++extern apc_cache_t* apc_user_cache; /* the global user content cache */ ++extern void* apc_compiled_filters; /* compiled filters */ ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc.h b/ext/apc/apc.h +--- a/ext/apc/apc.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,136 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | George Schlossnagle | ++ | Rasmus Lerdorf | ++ | Arun C. Murthy | ++ | Gopal Vijayaraghavan | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc.h 307264 2011-01-08 13:20:20Z gopalv $ */ ++ ++#ifndef APC_H ++#define APC_H ++ ++/* ++ * This module defines utilities and helper functions used elsewhere in APC. ++ */ ++ ++/* Commonly needed C library headers. */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* UNIX headers (needed for struct stat) */ ++#include ++#include ++#ifndef PHP_WIN32 ++#include ++#endif ++ ++#ifdef HAVE_CONFIG_H ++#include ++#endif ++ ++#include "php.h" ++#include "main/php_streams.h" ++ ++/* typedefs for extensible memory allocators */ ++typedef void* (*apc_malloc_t)(size_t TSRMLS_DC); ++typedef void (*apc_free_t) (void * TSRMLS_DC); ++ ++/* wrappers for memory allocation routines */ ++extern void* apc_emalloc(size_t n TSRMLS_DC); ++extern void* apc_erealloc(void* p, size_t n TSRMLS_DC); ++extern void apc_efree(void* p TSRMLS_DC); ++extern char* apc_estrdup(const char* s TSRMLS_DC); ++extern void* apc_xstrdup(const char* s, apc_malloc_t f TSRMLS_DC); ++extern void* apc_xmemcpy(const void* p, size_t n, apc_malloc_t f TSRMLS_DC); ++ ++/* console display functions */ ++extern void apc_error(const char *format TSRMLS_DC, ...); ++extern void apc_warning(const char *format TSRMLS_DC, ...); ++extern void apc_notice(const char *format TSRMLS_DC, ...); ++extern void apc_debug(const char *format TSRMLS_DC, ...); ++ ++/* string and text manipulation */ ++extern char* apc_append(const char* s, const char* t TSRMLS_DC); ++extern char* apc_substr(const char* s, int start, int length TSRMLS_DC); ++extern char** apc_tokenize(const char* s, char delim TSRMLS_DC); ++ ++/* filesystem functions */ ++ ++typedef struct apc_fileinfo_t ++{ ++ char *fullpath; ++ char path_buf[MAXPATHLEN]; ++ php_stream_statbuf st_buf; ++} apc_fileinfo_t; ++ ++extern int apc_search_paths(const char* filename, const char* path, apc_fileinfo_t* fileinfo TSRMLS_DC); ++ ++/* regular expression wrapper functions */ ++extern void* apc_regex_compile_array(char* patterns[] TSRMLS_DC); ++extern void apc_regex_destroy_array(void* p TSRMLS_DC); ++extern int apc_regex_match_array(void* p, const char* input); ++ ++/* apc_crc32: returns the CRC-32 checksum of the first len bytes in buf */ ++extern unsigned int apc_crc32(const char* buf, int len); ++ ++/* apc_flip_hash flips keys and values for faster searching */ ++extern HashTable* apc_flip_hash(HashTable *hash); ++ ++#define APC_NEGATIVE_MATCH 1 ++#define APC_POSITIVE_MATCH 2 ++ ++#define apc_time() \ ++ (APCG(use_request_time) ? (time_t) sapi_get_request_time(TSRMLS_C) : time(0)); ++ ++#if defined(__GNUC__) ++# define APC_UNUSED __attribute__((unused)) ++# define APC_USED __attribute__((used)) ++# define APC_ALLOC __attribute__((malloc)) ++# define APC_HOTSPOT __attribute__((hot)) ++#else ++# define APC_UNUSED ++# define APC_USED ++# define APC_ALLOC ++# define APC_HOTSPOT ++#endif ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_iterator.c b/ext/apc/apc_iterator.c +--- a/ext/apc/apc_iterator.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_iterator.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,741 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Brian Shire | ++ +----------------------------------------------------------------------+ ++ ++ */ ++ ++/* $Id: apc_iterator.c 324326 2012-03-18 13:19:50Z pajoye $ */ ++ ++#include "php_apc.h" ++#include "apc_iterator.h" ++#include "apc_cache.h" ++#include "apc_zend.h" ++ ++#include "ext/standard/md5.h" ++ ++#include "zend_interfaces.h" ++ ++zend_class_entry *apc_iterator_ce; ++zend_object_handlers apc_iterator_object_handlers; ++ ++ ++/* {{{ apc_iterator_item */ ++static apc_iterator_item_t* apc_iterator_item_ctor(apc_iterator_t *iterator, slot_t **slot_pp TSRMLS_DC) { ++ zval *zvalue; ++ char md5str[33]; ++ slot_t *slot = *slot_pp; ++ apc_context_t ctxt = {0, }; ++ apc_iterator_item_t *item = ecalloc(1, sizeof(apc_iterator_item_t)); ++ ++ if (slot->key.type == APC_CACHE_KEY_FILE) { ++ /* keys should be unique and with stat=1 we could have multiple files with the same name, so use ' ' instead */ ++#ifdef PHP_WIN32 ++ item->key_len = spprintf(&item->key, 0, "%I64d %I64d", slot->key.data.file.device, slot->key.data.file.inode); ++#else ++ item->key_len = spprintf(&item->key, 0, "%ld %ld", (ulong)slot->key.data.file.device, (ulong)slot->key.data.file.inode); ++#endif ++ item->filename_key = estrdup(slot->value->data.file.filename); ++ } else if (slot->key.type == APC_CACHE_KEY_USER) { ++ item->key = estrndup((char*)slot->key.data.user.identifier, slot->key.data.user.identifier_len); ++ item->key_len = slot->key.data.user.identifier_len; ++ item->filename_key = item->key; ++ } else if (slot->key.type == APC_CACHE_KEY_FPFILE) { ++ item->key = estrndup((char*)slot->key.data.fpfile.fullpath, slot->key.data.fpfile.fullpath_len); ++ item->key_len = slot->key.data.fpfile.fullpath_len; ++ item->filename_key = item->key; ++ } else { ++ apc_error("Internal error, invalid entry type." TSRMLS_CC); ++ } ++ ++ ALLOC_INIT_ZVAL(item->value); ++ array_init(item->value); ++ ++ if (APC_ITER_TYPE & iterator->format) { ++ if(slot->value->type == APC_CACHE_ENTRY_FILE) { ++ add_assoc_string(item->value, "type", "file", 1); ++ } else if(slot->value->type == APC_CACHE_ENTRY_USER) { ++ add_assoc_string(item->value, "type", "user", 1); ++ } ++ } ++ if (APC_ITER_FILENAME & iterator->format) { ++ if(slot->value->type == APC_CACHE_ENTRY_FILE) { ++ if (slot->key.type == APC_CACHE_KEY_FILE) { ++ add_assoc_string(item->value, "filename", slot->value->data.file.filename, 1); ++ } else { /* APC_CACHE_FPFILE */ ++ add_assoc_string(item->value, "filename", (char*)slot->key.data.fpfile.fullpath, 1); ++ } ++ } ++ } ++ if (APC_ITER_DEVICE & iterator->format) { ++ if(slot->key.type == APC_CACHE_KEY_FILE) { ++#ifdef PHP_WIN32 ++ char buf[20]; ++ sprintf(buf, "%I64d", slot->key.data.file.device); ++ add_assoc_string(item->value, "device", buf, 1); ++#else ++ add_assoc_long(item->value, "device", slot->key.data.file.device); ++#endif ++ } ++ } ++ if (APC_ITER_INODE & iterator->format) { ++ if(slot->key.type == APC_CACHE_KEY_FILE) { ++#ifdef PHP_WIN32 ++ char buf[20]; ++ sprintf(buf, "%I64d", slot->key.data.file.device); ++ add_assoc_string(item->value, "device", buf, 1); ++#else ++ add_assoc_long(item->value, "inode", slot->key.data.file.inode); ++#endif ++ } ++ } ++ if (APC_ITER_KEY & iterator->format) { ++ add_assoc_stringl(item->value, "key", item->key, (item->key_len - 1), 1); ++ } ++ if (APC_ITER_VALUE & iterator->format) { ++ if(slot->value->type == APC_CACHE_ENTRY_USER) { ++ ++ ctxt.pool = apc_pool_create(APC_UNPOOL, apc_php_malloc, apc_php_free, NULL, NULL TSRMLS_CC); ++ ctxt.copy = APC_COPY_OUT_USER; ++ ++ MAKE_STD_ZVAL(zvalue); ++ apc_cache_fetch_zval(zvalue, slot->value->data.user.val, &ctxt TSRMLS_CC); ++ apc_pool_destroy(ctxt.pool TSRMLS_CC); ++ add_assoc_zval(item->value, "value", zvalue); ++ } ++ } ++ if (APC_ITER_MD5 & iterator->format) { ++ if(slot->value->type == APC_CACHE_ENTRY_FILE) { ++ if(APCG(file_md5) && slot->key.md5) { ++ make_digest(md5str, slot->key.md5); ++ add_assoc_string(item->value, "md5", md5str, 1); ++ } ++ } ++ } ++ if (APC_ITER_NUM_HITS & iterator->format) { ++ add_assoc_long(item->value, "num_hits", slot->num_hits); ++ } ++ if (APC_ITER_MTIME & iterator->format) { ++ add_assoc_long(item->value, "mtime", slot->key.mtime); ++ } ++ if (APC_ITER_CTIME & iterator->format) { ++ add_assoc_long(item->value, "creation_time", slot->creation_time); ++ } ++ if (APC_ITER_DTIME & iterator->format) { ++ add_assoc_long(item->value, "deletion_time", slot->deletion_time); ++ } ++ if (APC_ITER_ATIME & iterator->format) { ++ add_assoc_long(item->value, "access_time", slot->access_time); ++ } ++ if (APC_ITER_REFCOUNT & iterator->format) { ++ add_assoc_long(item->value, "ref_count", slot->value->ref_count); ++ } ++ if (APC_ITER_MEM_SIZE & iterator->format) { ++ add_assoc_long(item->value, "mem_size", slot->value->mem_size); ++ } ++ if (APC_ITER_TTL & iterator->format) { ++ if(slot->value->type == APC_CACHE_ENTRY_USER) { ++ add_assoc_long(item->value, "ttl", slot->value->data.user.ttl); ++ } ++ } ++ ++ return item; ++} ++/* }}} */ ++ ++/* {{{ apc_iterator_clone */ ++static zend_object_value apc_iterator_clone(zval *zobject TSRMLS_DC) { ++ zend_object_value value = {0}; ++ apc_error("APCIterator object cannot be cloned." TSRMLS_CC); ++ return value; ++} ++/* }}} */ ++ ++/* {{{ apc_iterator_item_dtor */ ++static void apc_iterator_item_dtor(apc_iterator_item_t *item) { ++ if (item->filename_key && item->filename_key != item->key) { ++ efree(item->filename_key); ++ } ++ if (item->key) { ++ efree(item->key); ++ } ++ if (item->value) { ++ zval_ptr_dtor(&item->value); ++ } ++ efree(item); ++} ++/* }}} */ ++ ++/* {{{ apc_iterator_destroy */ ++static void apc_iterator_destroy(void *object, zend_object_handle handle TSRMLS_DC) { ++ apc_iterator_t *iterator = (apc_iterator_t*)object; ++ ++ if (iterator->initialized == 0) { ++ return; ++ } ++ ++ while (apc_stack_size(iterator->stack) > 0) { ++ apc_iterator_item_dtor(apc_stack_pop(iterator->stack)); ++ } ++ if (iterator->regex) { ++ efree(iterator->regex); ++ } ++ if (iterator->search_hash) { ++ zend_hash_destroy(iterator->search_hash); ++ efree(iterator->search_hash); ++ } ++ iterator->initialized = 0; ++ ++} ++/* }}} */ ++ ++/* {{{ acp_iterator_free */ ++static void apc_iterator_free(void *object TSRMLS_DC) { ++ zend_object_std_dtor(object TSRMLS_CC); ++ efree(object); ++} ++/* }}} */ ++ ++/* {{{ apc_iterator_create */ ++static zend_object_value apc_iterator_create(zend_class_entry *ce TSRMLS_DC) { ++ zend_object_value retval; ++ apc_iterator_t *iterator; ++ ++ iterator = emalloc(sizeof(apc_iterator_t)); ++ iterator->obj.ce = ce; ++ ALLOC_HASHTABLE(iterator->obj.properties); ++ zend_hash_init(iterator->obj.properties, 0, NULL, ZVAL_PTR_DTOR, 0); ++#ifdef ZEND_ENGINE_2_4 ++ iterator->obj.properties_table = NULL; ++#endif ++ iterator->obj.guards = NULL; ++ iterator->initialized = 0; ++ retval.handle = zend_objects_store_put(iterator, apc_iterator_destroy, apc_iterator_free, NULL TSRMLS_CC); ++ retval.handlers = &apc_iterator_object_handlers; ++ ++ return retval; ++} ++/* }}} */ ++ ++/* {{{ apc_iterator_search_match ++ * Verify if the key matches oru search parameters ++ */ ++static int apc_iterator_search_match(apc_iterator_t *iterator, slot_t **slot) { ++ char *key; ++ int key_len; ++ char *fname_key = NULL; ++ int fname_key_len = 0; ++ int rval = 1; ++ ++ if ((*slot)->key.type == APC_CACHE_KEY_FILE) { ++ key = (*slot)->value->data.file.filename; ++ key_len = strlen(key); ++ fname_key_len = spprintf(&fname_key, 0, "%ld %ld", (*slot)->key.data.file.device, (*slot)->key.data.file.inode); ++ } else if ((*slot)->key.type == APC_CACHE_KEY_USER) { ++ key = (char*)(*slot)->key.data.user.identifier; ++ key_len = (*slot)->key.data.user.identifier_len; ++ } else if ((*slot)->key.type == APC_CACHE_KEY_FPFILE) { ++ key = (char*)(*slot)->key.data.fpfile.fullpath; ++ key_len = (*slot)->key.data.fpfile.fullpath_len; ++ } else { ++ return 0; ++ } ++ ++#ifdef ITERATOR_PCRE ++ if (iterator->regex) { ++ rval = (pcre_exec(iterator->re, NULL, key, strlen(key), 0, 0, NULL, 0) >= 0); ++ } ++#endif ++ ++ if (iterator->search_hash) { ++ rval = zend_hash_exists(iterator->search_hash, key, key_len); ++ if (!rval && fname_key) { ++ rval = zend_hash_exists(iterator->search_hash, fname_key, fname_key_len+1); ++ } ++ } ++ ++ return rval; ++} ++/* }}} */ ++ ++/* {{{ apc_iterator_check_expiry */ ++static int apc_iterator_check_expiry(apc_cache_t* cache, slot_t **slot, time_t t) ++{ ++ if((*slot)->value->type == APC_CACHE_ENTRY_USER) { ++ if((*slot)->value->data.user.ttl) { ++ if((time_t) ((*slot)->creation_time + (*slot)->value->data.user.ttl) < t) { ++ return 0; ++ } ++ } else if(cache->ttl) { ++ if((*slot)->creation_time + cache->ttl < t) { ++ return 0; ++ } ++ } ++ } else if((*slot)->access_time < (t - cache->ttl)) { ++ return 0; ++ } ++ ++ return 1; ++} ++/* }}} */ ++ ++/* {{{ apc_iterator_fetch_active */ ++static int apc_iterator_fetch_active(apc_iterator_t *iterator TSRMLS_DC) { ++ int count=0; ++ slot_t **slot; ++ apc_iterator_item_t *item; ++ time_t t; ++ ++ t = apc_time(); ++ ++ while (apc_stack_size(iterator->stack) > 0) { ++ apc_iterator_item_dtor(apc_stack_pop(iterator->stack)); ++ } ++ ++ CACHE_LOCK(iterator->cache); ++ while(count <= iterator->chunk_size && iterator->slot_idx < iterator->cache->num_slots) { ++ slot = &iterator->cache->slots[iterator->slot_idx]; ++ while(*slot) { ++ if (apc_iterator_check_expiry(iterator->cache, slot, t)) { ++ if (apc_iterator_search_match(iterator, slot)) { ++ count++; ++ item = apc_iterator_item_ctor(iterator, slot TSRMLS_CC); ++ if (item) { ++ apc_stack_push(iterator->stack, item TSRMLS_CC); ++ } ++ } ++ } ++ slot = &(*slot)->next; ++ } ++ iterator->slot_idx++; ++ } ++ CACHE_UNLOCK(iterator->cache); ++ iterator->stack_idx = 0; ++ return count; ++} ++/* }}} */ ++ ++/* {{{ apc_iterator_fetch_deleted */ ++static int apc_iterator_fetch_deleted(apc_iterator_t *iterator TSRMLS_DC) { ++ int count=0; ++ slot_t **slot; ++ apc_iterator_item_t *item; ++ ++ CACHE_LOCK(iterator->cache); ++ slot = &iterator->cache->header->deleted_list; ++ while ((*slot) && count <= iterator->slot_idx) { ++ count++; ++ slot = &(*slot)->next; ++ } ++ count = 0; ++ while ((*slot) && count < iterator->chunk_size) { ++ if (apc_iterator_search_match(iterator, slot)) { ++ count++; ++ item = apc_iterator_item_ctor(iterator, slot TSRMLS_CC); ++ if (item) { ++ apc_stack_push(iterator->stack, item TSRMLS_CC); ++ } ++ } ++ slot = &(*slot)->next; ++ } ++ CACHE_UNLOCK(iterator->cache); ++ iterator->slot_idx += count; ++ iterator->stack_idx = 0; ++ return count; ++} ++/* }}} */ ++ ++/* {{{ apc_iterator_totals */ ++static void apc_iterator_totals(apc_iterator_t *iterator TSRMLS_DC) { ++ slot_t **slot; ++ int i; ++ ++ CACHE_LOCK(iterator->cache); ++ for (i=0; i < iterator->cache->num_slots; i++) { ++ slot = &iterator->cache->slots[i]; ++ while((*slot)) { ++ if (apc_iterator_search_match(iterator, slot)) { ++ iterator->size += (*slot)->value->mem_size; ++ iterator->hits += (*slot)->num_hits; ++ iterator->count++; ++ } ++ slot = &(*slot)->next; ++ } ++ } ++ CACHE_UNLOCK(iterator->cache); ++ iterator->totals_flag = 1; ++} ++/* }}} */ ++ ++/* {{{ proto object APCIterator::__costruct(string cache [, mixed search [, long format [, long chunk_size [, long list ]]]]) */ ++PHP_METHOD(apc_iterator, __construct) { ++ zval *object = getThis(); ++ apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(object TSRMLS_CC); ++ char *cachetype; ++ int cachetype_len; ++ long format = APC_ITER_ALL; ++ long chunk_size=0; ++ zval *search = NULL; ++ long list = APC_LIST_ACTIVE; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zlll", &cachetype, &cachetype_len, &search, &format, &chunk_size, &list) == FAILURE) { ++ return; ++ } ++ ++ if (!APCG(enabled)) { ++ apc_error("APC must be enabled to use APCIterator." TSRMLS_CC); ++ } ++ ++ if (chunk_size < 0) { ++ apc_error("APCIterator chunk size must be 0 or greater." TSRMLS_CC); ++ return; ++ } ++ ++ if (format > APC_ITER_ALL) { ++ apc_error("APCIterator format is invalid." TSRMLS_CC); ++ return; ++ } ++ ++ if (list == APC_LIST_ACTIVE) { ++ iterator->fetch = apc_iterator_fetch_active; ++ } else if (list == APC_LIST_DELETED) { ++ iterator->fetch = apc_iterator_fetch_deleted; ++ } else { ++ apc_warning("APCIterator invalid list type." TSRMLS_CC); ++ return; ++ } ++ ++ if(!strcasecmp(cachetype,"user")) { ++ iterator->cache = apc_user_cache; ++ } else { ++ iterator->cache = apc_cache; ++ } ++ ++ iterator->slot_idx = 0; ++ iterator->stack_idx = 0; ++ iterator->key_idx = 0; ++ iterator->chunk_size = chunk_size == 0 ? APC_DEFAULT_CHUNK_SIZE : chunk_size; ++ iterator->stack = apc_stack_create(chunk_size TSRMLS_CC); ++ iterator->format = format; ++ iterator->totals_flag = 0; ++ iterator->count = 0; ++ iterator->size = 0; ++ iterator->hits = 0; ++ iterator->regex = NULL; ++ iterator->regex_len = 0; ++ iterator->search_hash = NULL; ++ if (search && Z_TYPE_P(search) == IS_STRING && Z_STRLEN_P(search)) { ++#ifdef ITERATOR_PCRE ++ iterator->regex = estrndup(Z_STRVAL_P(search), Z_STRLEN_P(search)); ++ iterator->regex_len = Z_STRLEN_P(search); ++ iterator->re = pcre_get_compiled_regex(Z_STRVAL_P(search), NULL, NULL TSRMLS_CC); ++ ++ if(!iterator->re) { ++ apc_error("Could not compile regular expression: %s" TSRMLS_CC, Z_STRVAL_P(search)); ++ } ++#else ++ apc_error("Regular expressions support is not enabled, please enable PCRE for APCIterator regex support" TSRMLS_CC); ++#endif ++ } else if (search && Z_TYPE_P(search) == IS_ARRAY) { ++ Z_ADDREF_P(search); ++ iterator->search_hash = apc_flip_hash(Z_ARRVAL_P(search)); ++ } ++ iterator->initialized = 1; ++} ++/* }}} */ ++ ++/* {{{ proto APCIterator::rewind() */ ++PHP_METHOD(apc_iterator, rewind) { ++ apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); ++ ++ if (zend_parse_parameters_none() == FAILURE) { ++ return; ++ } ++ ++ if (iterator->initialized == 0) { ++ RETURN_FALSE; ++ } ++ ++ iterator->slot_idx = 0; ++ iterator->stack_idx = 0; ++ iterator->key_idx = 0; ++ iterator->fetch(iterator TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ proto boolean APCIterator::valid() */ ++PHP_METHOD(apc_iterator, valid) { ++ apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); ++ ++ if (zend_parse_parameters_none() == FAILURE) { ++ return; ++ } ++ ++ if (iterator->initialized == 0) { ++ RETURN_FALSE; ++ } ++ ++ if (apc_stack_size(iterator->stack) == iterator->stack_idx) { ++ iterator->fetch(iterator TSRMLS_CC); ++ } ++ ++ RETURN_BOOL(apc_stack_size(iterator->stack) == 0 ? 0 : 1); ++} ++/* }}} */ ++ ++/* {{{ proto mixed APCIterator::current() */ ++PHP_METHOD(apc_iterator, current) { ++ apc_iterator_item_t *item; ++ apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); ++ ++ if (zend_parse_parameters_none() == FAILURE) { ++ return; ++ } ++ ++ if (iterator->initialized == 0) { ++ RETURN_FALSE; ++ } ++ ++ if (apc_stack_size(iterator->stack) == iterator->stack_idx) { ++ if (iterator->fetch(iterator TSRMLS_CC) == 0) { ++ RETURN_FALSE; ++ } ++ } ++ ++ item = apc_stack_get(iterator->stack, iterator->stack_idx); ++ RETURN_ZVAL(item->value, 1, 0); ++} ++/* }}} */ ++ ++/* {{{ proto string APCIterator::key() */ ++PHP_METHOD(apc_iterator, key) { ++ apc_iterator_item_t *item; ++ apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); ++ ++ if (zend_parse_parameters_none() == FAILURE) { ++ return; ++ } ++ ++ if (iterator->initialized == 0 || apc_stack_size(iterator->stack) == 0) { ++ RETURN_FALSE; ++ } ++ ++ if (apc_stack_size(iterator->stack) == iterator->stack_idx) { ++ if (iterator->fetch(iterator TSRMLS_CC) == 0) { ++ RETURN_FALSE; ++ } ++ } ++ ++ item = apc_stack_get(iterator->stack, iterator->stack_idx); ++ ++ if (item->key) { ++ RETURN_STRINGL(item->key, (item->key_len-1), 1); ++ } else { ++ RETURN_LONG(iterator->key_idx); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto APCIterator::next() */ ++PHP_METHOD(apc_iterator, next) { ++ apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); ++ ++ if (zend_parse_parameters_none() == FAILURE) { ++ return; ++ } ++ ++ if (iterator->initialized == 0 || apc_stack_size(iterator->stack) == 0) { ++ RETURN_FALSE; ++ } ++ ++ iterator->stack_idx++; ++ iterator->key_idx++; ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto long APCIterator::getTotalHits() */ ++PHP_METHOD(apc_iterator, getTotalHits) { ++ apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); ++ ++ if (zend_parse_parameters_none() == FAILURE) { ++ return; ++ } ++ ++ if (iterator->initialized == 0) { ++ RETURN_FALSE; ++ } ++ ++ if (iterator->totals_flag == 0) { ++ apc_iterator_totals(iterator TSRMLS_CC); ++ } ++ ++ RETURN_LONG(iterator->hits); ++} ++/* }}} */ ++ ++/* {{{ proto long APCIterator::getTotalSize() */ ++PHP_METHOD(apc_iterator, getTotalSize) { ++ apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); ++ ++ if (zend_parse_parameters_none() == FAILURE) { ++ return; ++ } ++ ++ if (iterator->initialized == 0) { ++ RETURN_FALSE; ++ } ++ ++ if (iterator->totals_flag == 0) { ++ apc_iterator_totals(iterator TSRMLS_CC); ++ } ++ ++ RETURN_LONG(iterator->size); ++} ++/* }}} */ ++ ++/* {{{ proto long APCIterator::getTotalCount() */ ++PHP_METHOD(apc_iterator, getTotalCount) { ++ apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); ++ ++ if (zend_parse_parameters_none() == FAILURE) { ++ return; ++ } ++ ++ if (iterator->initialized == 0) { ++ RETURN_FALSE; ++ } ++ ++ if (iterator->totals_flag == 0) { ++ apc_iterator_totals(iterator TSRMLS_CC); ++ } ++ ++ RETURN_LONG(iterator->count); ++} ++/* }}} */ ++ ++/* {{{ arginfo */ ++#if (PHP_MAJOR_VERSION >= 6 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3)) ++# define PHP_APC_ARGINFO ++#else ++# define PHP_APC_ARGINFO static ++#endif ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_iterator___construct, 0, 0, 1) ++ ZEND_ARG_INFO(0, cache) ++ ZEND_ARG_INFO(0, search) ++ ZEND_ARG_INFO(0, format) ++ ZEND_ARG_INFO(0, chunk_size) ++ ZEND_ARG_INFO(0, list) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_iterator_void, 0, 0, 0) ++ZEND_END_ARG_INFO() ++/* }}} */ ++ ++/* {{{ apc_iterator_functions */ ++static zend_function_entry apc_iterator_functions[] = { ++ PHP_ME(apc_iterator, __construct, arginfo_apc_iterator___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) ++ PHP_ME(apc_iterator, rewind, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) ++ PHP_ME(apc_iterator, current, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) ++ PHP_ME(apc_iterator, key, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) ++ PHP_ME(apc_iterator, next, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) ++ PHP_ME(apc_iterator, valid, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) ++ PHP_ME(apc_iterator, getTotalHits, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) ++ PHP_ME(apc_iterator, getTotalSize, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) ++ PHP_ME(apc_iterator, getTotalCount, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) ++ {NULL, NULL, NULL} ++}; ++/* }}} */ ++ ++/* {{{ apc_iterator_init */ ++int apc_iterator_init(int module_number TSRMLS_DC) { ++ zend_class_entry ce; ++ ++ INIT_CLASS_ENTRY(ce, APC_ITERATOR_NAME, apc_iterator_functions); ++ apc_iterator_ce = zend_register_internal_class(&ce TSRMLS_CC); ++ apc_iterator_ce->create_object = apc_iterator_create; ++ zend_class_implements(apc_iterator_ce TSRMLS_CC, 1, zend_ce_iterator); ++ ++ zend_register_long_constant("APC_LIST_ACTIVE", sizeof("APC_LIST_ACTIVE"), APC_LIST_ACTIVE, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_LIST_DELETED", sizeof("APC_LIST_DELETED"), APC_LIST_DELETED, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ ++ zend_register_long_constant("APC_ITER_TYPE", sizeof("APC_ITER_TYPE"), APC_ITER_TYPE, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_KEY", sizeof("APC_ITER_KEY"), APC_ITER_KEY, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_FILENAME", sizeof("APC_ITER_FILENAME"), APC_ITER_FILENAME, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_DEVICE", sizeof("APC_ITER_DEVICE"), APC_ITER_DEVICE, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_INODE", sizeof("APC_ITER_INODE"), APC_ITER_INODE, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_VALUE", sizeof("APC_ITER_VALUE"), APC_ITER_VALUE, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_MD5", sizeof("APC_ITER_MD5"), APC_ITER_MD5, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_NUM_HITS", sizeof("APC_ITER_NUM_HITS"), APC_ITER_NUM_HITS, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_MTIME", sizeof("APC_ITER_MTIME"), APC_ITER_MTIME, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_CTIME", sizeof("APC_ITER_CTIME"), APC_ITER_CTIME, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_DTIME", sizeof("APC_ITER_DTIME"), APC_ITER_DTIME, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_ATIME", sizeof("APC_ITER_ATIME"), APC_ITER_ATIME, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_REFCOUNT", sizeof("APC_ITER_REFCOUNT"), APC_ITER_REFCOUNT, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_MEM_SIZE", sizeof("APC_ITER_MEM_SIZE"), APC_ITER_MEM_SIZE, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_TTL", sizeof("APC_ITER_TTL"), APC_ITER_TTL, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_NONE", sizeof("APC_ITER_NONE"), APC_ITER_NONE, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ zend_register_long_constant("APC_ITER_ALL", sizeof("APC_ITER_ALL"), APC_ITER_ALL, CONST_PERSISTENT | CONST_CS, module_number TSRMLS_CC); ++ ++ memcpy(&apc_iterator_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); ++ apc_iterator_object_handlers.clone_obj = apc_iterator_clone; ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++ ++int apc_iterator_delete(zval *zobj TSRMLS_DC) { ++ apc_iterator_t *iterator; ++ zend_class_entry *ce = Z_OBJCE_P(zobj); ++ apc_iterator_item_t *item; ++ ++ if (!ce || !instanceof_function(ce, apc_iterator_ce TSRMLS_CC)) { ++ apc_error("apc_delete object argument must be instance of APCIterator" TSRMLS_CC); ++ return 0; ++ } ++ iterator = (apc_iterator_t*)zend_object_store_get_object(zobj TSRMLS_CC); ++ ++ if (iterator->initialized == 0) { ++ return 0; ++ } ++ ++ while (iterator->fetch(iterator TSRMLS_CC)) { ++ while (iterator->stack_idx < apc_stack_size(iterator->stack)) { ++ item = apc_stack_get(iterator->stack, iterator->stack_idx++); ++ if (iterator->cache == apc_cache) { ++ apc_cache_delete(apc_cache, item->filename_key, strlen(item->filename_key) + 1 TSRMLS_CC); ++ } else { ++ apc_cache_user_delete(apc_user_cache, item->key, item->key_len TSRMLS_CC); ++ } ++ } ++ } ++ ++ return 1; ++} ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_iterator.h b/ext/apc/apc_iterator.h +--- a/ext/apc/apc_iterator.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_iterator.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,117 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Brian Shire | ++ +----------------------------------------------------------------------+ ++ ++ */ ++ ++/* $Id: apc_iterator.h 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#ifndef APC_ITERATOR_H ++#define APC_ITERATOR_H ++ ++#include "apc.h" ++#include "apc_stack.h" ++ ++#if HAVE_PCRE || HAVE_BUNDLED_PCRE ++/* Deal with problem present until php-5.2.2 where php_pcre.h was not installed correctly */ ++# if !HAVE_BUNDLED_PCRE && PHP_MAJOR_VERSION == 5 && (PHP_MINOR_VERSION < 2 || (PHP_MINOR_VERSION == 2 && PHP_RELEASE_VERSION < 2)) ++# include "apc_php_pcre.h" ++# else ++# include "ext/pcre/php_pcre.h" ++# endif ++# include "ext/standard/php_smart_str.h" ++# define ITERATOR_PCRE 1 ++#endif ++ ++ ++#define APC_ITERATOR_NAME "APCIterator" ++ ++#define APC_DEFAULT_CHUNK_SIZE 100 ++ ++#define APC_LIST_ACTIVE 0x1 ++#define APC_LIST_DELETED 0x2 ++ ++#define APC_ITER_TYPE (1L << 0) ++#define APC_ITER_KEY (1L << 1) ++#define APC_ITER_FILENAME (1L << 2) ++#define APC_ITER_DEVICE (1L << 3) ++#define APC_ITER_INODE (1L << 4) ++#define APC_ITER_VALUE (1L << 5) ++#define APC_ITER_MD5 (1L << 6) ++#define APC_ITER_NUM_HITS (1L << 7) ++#define APC_ITER_MTIME (1L << 8) ++#define APC_ITER_CTIME (1L << 9) ++#define APC_ITER_DTIME (1L << 10) ++#define APC_ITER_ATIME (1L << 11) ++#define APC_ITER_REFCOUNT (1L << 12) ++#define APC_ITER_MEM_SIZE (1L << 13) ++#define APC_ITER_TTL (1L << 14) ++ ++#define APC_ITER_NONE (0x00000000L) ++#define APC_ITER_ALL (0xffffffffL) ++ ++typedef void* (*apc_iterator_item_cb_t)(slot_t **slot); ++ ++ ++/* {{{ apc_iterator_t */ ++typedef struct _apc_iterator_t { ++ zend_object obj; /* must always be first */ ++ short int initialized; /* sanity check in case __construct failed */ ++ long format; /* format bitmask of the return values ie: key, value, info */ ++ int (*fetch)(struct _apc_iterator_t *iterator TSRMLS_DC); ++ /* fetch callback to fetch items from cache slots or lists */ ++ apc_cache_t *cache; /* cache which we are iterating on */ ++ long slot_idx; /* index to the slot array or linked list */ ++ long chunk_size; /* number of entries to pull down per fetch */ ++ apc_stack_t *stack; /* stack of entries pulled from cache */ ++ int stack_idx; /* index into the current stack */ ++#ifdef ITERATOR_PCRE ++ pcre *re; /* regex filter on entry identifiers */ ++#endif ++ char *regex; /* original regex expression or NULL */ ++ int regex_len; /* regex length */ ++ HashTable *search_hash; /* hash of keys to iterate over */ ++ long key_idx; /* incrementing index for numerical keys */ ++ short int totals_flag; /* flag if totals have been calculated */ ++ long hits; /* hit total */ ++ size_t size; /* size total */ ++ long count; /* count total */ ++} apc_iterator_t; ++/* }}} */ ++ ++/* {{{ apc_iterator_item */ ++typedef struct _apc_iterator_item_t { ++ char *key; /* string key */ ++ long key_len; /* strlen of key */ ++ char *filename_key; /* filename key used for deletion */ ++ zval *value; ++} apc_iterator_item_t; ++/* }}} */ ++ ++ ++extern int apc_iterator_init(int module_number TSRMLS_DC); ++extern int apc_iterator_delete(zval *zobj TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_lock.h b/ext/apc/apc_lock.h +--- a/ext/apc/apc_lock.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_lock.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,160 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: George Schlossnagle | ++ | Rasmus Lerdorf | ++ | Pierre Joye | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_lock.h 311339 2011-05-22 17:18:49Z gopalv $ */ ++ ++#ifndef APC_LOCK ++#define APC_LOCK ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include "apc.h" ++#include "apc_sem.h" ++#include "apc_fcntl.h" ++#include "apc_pthreadmutex.h" ++#include "apc_pthreadrwlock.h" ++#include "apc_spin.h" ++#include "apc_windows_srwlock_kernel.h" ++ ++/* {{{ generic locking macros */ ++#define CREATE_LOCK(lock) apc_lck_create(NULL, 0, 1, lock) ++#define DESTROY_LOCK(lock) apc_lck_destroy(lock) ++#define LOCK(lock) { HANDLE_BLOCK_INTERRUPTIONS(); apc_lck_lock(lock); } ++#define RDLOCK(lock) { HANDLE_BLOCK_INTERRUPTIONS(); apc_lck_rdlock(lock); } ++#define UNLOCK(lock) { apc_lck_unlock(lock); HANDLE_UNBLOCK_INTERRUPTIONS(); } ++#define RDUNLOCK(lock) { apc_lck_rdunlock(lock); HANDLE_UNBLOCK_INTERRUPTIONS(); } ++/* }}} */ ++ ++/* atomic operations : rdlocks are impossible without these */ ++#if HAVE_ATOMIC_OPERATIONS ++# ifdef PHP_WIN32 ++# define ATOMIC_INC(a) InterlockedIncrement(&a) ++# define ATOMIC_DEC(a) InterlockedDecrement(&a) ++# else ++# define ATOMIC_INC(a) __sync_add_and_fetch(&a, 1) ++# define ATOMIC_DEC(a) __sync_sub_and_fetch(&a, 1) ++# endif ++#endif ++ ++#if defined(APC_SEM_LOCKS) ++# define APC_LOCK_TYPE "IPC Semaphore" ++# define RDLOCK_AVAILABLE 0 ++# define NONBLOCKING_LOCK_AVAILABLE 1 ++# define apc_lck_t int ++# define apc_lck_create(a,b,c,d) d=apc_sem_create((b),(c) TSRMLS_CC) ++# define apc_lck_destroy(a) apc_sem_destroy(a) ++# define apc_lck_lock(a) apc_sem_lock(a TSRMLS_CC) ++# define apc_lck_nb_lock(a) apc_sem_nonblocking_lock(a TSRMLS_CC) ++# define apc_lck_rdlock(a) apc_sem_lock(a TSRMLS_CC) ++# define apc_lck_unlock(a) apc_sem_unlock(a TSRMLS_CC) ++# define apc_lck_rdunlock(a) apc_sem_unlock(a TSRMLS_CC) ++#elif defined(APC_PTHREADMUTEX_LOCKS) ++# define APC_LOCK_TYPE "pthread mutex Locks" ++# define RDLOCK_AVAILABLE 0 ++# define NONBLOCKING_LOCK_AVAILABLE 1 ++# define apc_lck_t pthread_mutex_t ++# define apc_lck_create(a,b,c,d) apc_pthreadmutex_create((pthread_mutex_t*)&d TSRMLS_CC) ++# define apc_lck_destroy(a) apc_pthreadmutex_destroy(&a) ++# define apc_lck_lock(a) apc_pthreadmutex_lock(&a TSRMLS_CC) ++# define apc_lck_nb_lock(a) apc_pthreadmutex_nonblocking_lock(&a TSRMLS_CC) ++# define apc_lck_rdlock(a) apc_pthreadmutex_lock(&a TSRMLS_CC) ++# define apc_lck_unlock(a) apc_pthreadmutex_unlock(&a TSRMLS_CC) ++# define apc_lck_rdunlock(a) apc_pthreadmutex_unlock(&a TSRMLS_CC) ++#elif defined(APC_PTHREADRW_LOCKS) ++# define APC_LOCK_TYPE "pthread read/write Locks" ++# define RDLOCK_AVAILABLE 1 ++# define NONBLOCKING_LOCK_AVAILABLE 1 ++# define apc_lck_t pthread_rwlock_t ++# define apc_lck_create(a,b,c,d) apc_pthreadrwlock_create((pthread_rwlock_t*)&d TSRMLS_CC) ++# define apc_lck_destroy(a) apc_pthreadrwlock_destroy(&a) ++# define apc_lck_lock(a) apc_pthreadrwlock_lock(&a TSRMLS_CC) ++# define apc_lck_nb_lock(a) apc_pthreadrwlock_nonblocking_lock(&a TSRMLS_CC) ++# define apc_lck_rdlock(a) apc_pthreadrwlock_rdlock(&a TSRMLS_CC) ++# define apc_lck_unlock(a) apc_pthreadrwlock_unlock(&a TSRMLS_CC) ++# define apc_lck_rdunlock(a) apc_pthreadrwlock_unlock(&a TSRMLS_CC) ++#elif defined(APC_SPIN_LOCKS) ++# define APC_LOCK_TYPE "spin Locks" ++# define RDLOCK_AVAILABLE 0 ++# define NONBLOCKING_LOCK_AVAILABLE APC_SLOCK_NONBLOCKING_LOCK_AVAILABLE ++# define apc_lck_t slock_t ++# define apc_lck_create(a,b,c,d) apc_slock_create((slock_t*)&(d)) ++# define apc_lck_destroy(a) apc_slock_destroy(&a) ++# define apc_lck_lock(a) apc_slock_lock(&a TSRMLS_CC) ++# define apc_lck_nb_lock(a) apc_slock_nonblocking_lock(&a) ++# define apc_lck_rdlock(a) apc_slock_lock(&a TSRMLS_CC) ++# define apc_lck_unlock(a) apc_slock_unlock(&a) ++# define apc_lck_rdunlock(a) apc_slock_unlock(&a) ++#elif defined(APC_SRWLOCK_NATIVE) && defined(PHP_WIN32) ++# define APC_LOCK_TYPE "Windows Slim RWLOCK (native)" ++# define RDLOCK_AVAILABLE 1 ++# define NONBLOCKING_LOCK_AVAILABLE 0 ++# define apc_lck_t SRWLOCK ++# define apc_lck_create(a,b,c,d) InitializeSRWLock((SRWLOCK*)&(d)) ++# define apc_lck_destroy(a) ++# define apc_lck_lock(a) AcquireSRWLockExclusive(&a) ++# define apc_lck_rdlock(a) AcquireSRWLockShared(&a) ++# define apc_lck_unlock(a) ReleaseSRWLockExclusive(&a) ++# define apc_lck_rdunlock(a) ReleaseSRWLockShared(&a) ++# if NONBLOCKING_LOCK_AVAILABLE==1 /* Only in win7/2008 */ ++# define apc_lck_nb_lock(a) (TryAcquireSRWLockExclusive(&a TSRMLS_CC) == 0 ? 1 : 0); ++# endif ++#elif defined(APC_SRWLOCK_KERNEL) && defined(PHP_WIN32) ++# define APC_LOCK_TYPE "Windows Slim RWLOCK (kernel)" ++# define RDLOCK_AVAILABLE 1 ++# define NONBLOCKING_LOCK_AVAILABLE 0 ++# define apc_lck_t apc_windows_cs_rwlock_t ++# define apc_lck_create(a,b,c,d) apc_windows_cs_create((apc_windows_cs_rwlock_t*)&(d) TSRMLS_CC) ++# define apc_lck_destroy(a) apc_windows_cs_destroy(&a); ++# define apc_lck_lock(a) apc_windows_cs_lock(&a TSRMLS_CC) ++# define apc_lck_rdlock(a) apc_windows_cs_rdlock(&a TSRMLS_CC) ++# define apc_lck_unlock(a) apc_windows_cs_unlock_wr(&a TSRMLS_CC) ++# define apc_lck_rdunlock(a) apc_windows_cs_unlock_rd(&a TSRMLS_CC) ++#else ++# define APC_LOCK_TYPE "File Locks" ++# ifdef HAVE_ATOMIC_OPERATIONS ++# define RDLOCK_AVAILABLE 1 ++# endif ++# ifdef PHP_WIN32 ++# define NONBLOCKING_LOCK_AVAILABLE 0 ++# else ++# define NONBLOCKING_LOCK_AVAILABLE 1 ++# endif ++# define apc_lck_t int ++# define apc_lck_create(a,b,c,d) d=apc_fcntl_create((a) TSRMLS_CC) ++# define apc_lck_destroy(a) apc_fcntl_destroy(a) ++# define apc_lck_lock(a) apc_fcntl_lock(a TSRMLS_CC) ++# define apc_lck_nb_lock(a) apc_fcntl_nonblocking_lock(a TSRMLS_CC) ++# define apc_lck_rdlock(a) apc_fcntl_rdlock(a TSRMLS_CC) ++# define apc_lck_unlock(a) apc_fcntl_unlock(a TSRMLS_CC) ++# define apc_lck_rdunlock(a) apc_fcntl_unlock(a TSRMLS_CC) ++#endif ++ ++#endif +diff -Naur a/ext/apc/apc_main.c b/ext/apc/apc_main.c +--- a/ext/apc/apc_main.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_main.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,1030 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | Rasmus Lerdorf | ++ | Arun C. Murthy | ++ | Gopal Vijayaraghavan | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_main.c 324326 2012-03-18 13:19:50Z pajoye $ */ ++ ++#include "apc_php.h" ++#include "apc_main.h" ++#include "apc.h" ++#include "apc_lock.h" ++#include "apc_cache.h" ++#include "apc_compile.h" ++#include "apc_globals.h" ++#include "apc_sma.h" ++#include "apc_stack.h" ++#include "apc_zend.h" ++#include "apc_pool.h" ++#include "apc_string.h" ++#include "SAPI.h" ++#include "php_scandir.h" ++#include "ext/standard/php_var.h" ++#include "ext/standard/md5.h" ++ ++#define APC_MAX_SERIALIZERS 16 ++ ++/* {{{ module variables */ ++ ++/* pointer to the original Zend engine compile_file function */ ++typedef zend_op_array* (zend_compile_t)(zend_file_handle*, int TSRMLS_DC); ++static zend_compile_t *old_compile_file; ++static apc_serializer_t apc_serializers[APC_MAX_SERIALIZERS] = {{0,}}; ++ ++/* }}} */ ++ ++/* {{{ get/set old_compile_file (to interact with other extensions that need the compile hook) */ ++static zend_compile_t* set_compile_hook(zend_compile_t *ptr) ++{ ++ zend_compile_t *retval = old_compile_file; ++ ++ if (ptr != NULL) old_compile_file = ptr; ++ return retval; ++} ++/* }}} */ ++ ++/* {{{ install_function */ ++static int install_function(apc_function_t fn, apc_context_t* ctxt, int lazy TSRMLS_DC) ++{ ++ int status; ++ ++#if APC_HAVE_LOOKUP_HOOKS ++ if(lazy && fn.name[0] != '\0' && strncmp(fn.name, "__autoload", fn.name_len) != 0) { ++ status = zend_hash_add(APCG(lazy_function_table), ++ fn.name, ++ fn.name_len+1, ++ &fn, ++ sizeof(apc_function_t), ++ NULL); ++#else ++ if(0) { ++#endif ++ } else { ++ zend_function *func = apc_copy_function_for_execution(fn.function, ctxt TSRMLS_CC); ++ status = zend_hash_add(EG(function_table), ++ fn.name, ++ fn.name_len+1, ++ func, ++ sizeof(fn.function[0]), ++ NULL); ++ efree(func); ++ } ++ ++ if (status == FAILURE) { ++ /* apc_error("Cannot redeclare %s()" TSRMLS_CC, fn.name); */ ++ } ++ ++ return status; ++} ++/* }}} */ ++ ++/* {{{ apc_lookup_function_hook */ ++int apc_lookup_function_hook(char *name, int len, ulong hash, zend_function **fe) { ++ apc_function_t *fn; ++ int status = FAILURE; ++ apc_context_t ctxt = {0,}; ++ TSRMLS_FETCH(); ++ ++ ctxt.pool = apc_pool_create(APC_UNPOOL, apc_php_malloc, apc_php_free, apc_sma_protect, apc_sma_unprotect TSRMLS_CC); ++ ctxt.copy = APC_COPY_OUT_OPCODE; ++ ++ if(zend_hash_quick_find(APCG(lazy_function_table), name, len, hash, (void**)&fn) == SUCCESS) { ++ *fe = apc_copy_function_for_execution(fn->function, &ctxt TSRMLS_CC); ++ status = zend_hash_add(EG(function_table), ++ fn->name, ++ fn->name_len+1, ++ *fe, ++ sizeof(zend_function), ++ NULL); ++ } ++ ++ return status; ++} ++/* }}} */ ++ ++/* {{{ install_class */ ++static int install_class(apc_class_t cl, apc_context_t* ctxt, int lazy TSRMLS_DC) ++{ ++ zend_class_entry* class_entry = cl.class_entry; ++ zend_class_entry* parent = NULL; ++ int status; ++ zend_class_entry** allocated_ce = NULL; ++ ++ /* Special case for mangled names. Mangled names are unique to a file. ++ * There is no way two classes with the same mangled name will occur, ++ * unless a file is included twice. And if in case, a file is included ++ * twice, all mangled name conflicts can be ignored and the class redeclaration ++ * error may be deferred till runtime of the corresponding DECLARE_CLASS ++ * calls. ++ */ ++ ++ if(cl.name_len != 0 && cl.name[0] == '\0') { ++ if(zend_hash_exists(CG(class_table), cl.name, cl.name_len+1)) { ++ return SUCCESS; ++ } ++ } ++ ++ if(lazy && cl.name_len != 0 && cl.name[0] != '\0') { ++ status = zend_hash_add(APCG(lazy_class_table), ++ cl.name, ++ cl.name_len+1, ++ &cl, ++ sizeof(apc_class_t), ++ NULL); ++ if(status == FAILURE) { ++ zend_error(E_ERROR, "Cannot redeclare class %s", cl.name); ++ } ++ return status; ++ } ++ ++ /* ++ * XXX: We need to free this somewhere... ++ */ ++ allocated_ce = apc_php_malloc(sizeof(zend_class_entry*) TSRMLS_CC); ++ ++ if(!allocated_ce) { ++ return FAILURE; ++ } ++ ++ *allocated_ce = ++ class_entry = ++ apc_copy_class_entry_for_execution(cl.class_entry, ctxt TSRMLS_CC); ++ ++ ++ /* restore parent class pointer for compile-time inheritance */ ++ if (cl.parent_name != NULL) { ++ zend_class_entry** parent_ptr = NULL; ++ /* ++ * __autoload brings in the old issues with mixed inheritance. ++ * When a statically inherited class triggers autoload, it runs ++ * afoul of a potential require_once "parent.php" in the previous ++ * line, which when executed provides the parent class, but right ++ * now goes and hits __autoload which could fail. ++ * ++ * missing parent == re-compile. ++ * ++ * whether __autoload is enabled or not, because __autoload errors ++ * cause php to die. ++ * ++ * Aside: Do NOT pass *strlen(cl.parent_name)+1* because ++ * zend_lookup_class_ex does it internally anyway! ++ */ ++ status = zend_lookup_class_ex(cl.parent_name, ++ strlen(cl.parent_name), ++#ifdef ZEND_ENGINE_2_4 ++ NULL, ++#endif ++ 0, ++ &parent_ptr TSRMLS_CC); ++ if (status == FAILURE) { ++ if(APCG(report_autofilter)) { ++ apc_warning("Dynamic inheritance detected for class %s" TSRMLS_CC, cl.name); ++ } ++ class_entry->parent = NULL; ++ return status; ++ } ++ else { ++ parent = *parent_ptr; ++ class_entry->parent = parent; ++ zend_do_inheritance(class_entry, parent TSRMLS_CC); ++ } ++ ++ ++ } ++ ++ status = zend_hash_add(EG(class_table), ++ cl.name, ++ cl.name_len+1, ++ allocated_ce, ++ sizeof(zend_class_entry*), ++ NULL); ++ ++ if (status == FAILURE) { ++ apc_error("Cannot redeclare class %s" TSRMLS_CC, cl.name); ++ } ++ return status; ++} ++/* }}} */ ++ ++/* {{{ apc_lookup_class_hook */ ++int apc_lookup_class_hook(char *name, int len, ulong hash, zend_class_entry ***ce) { ++ ++ apc_class_t *cl; ++ apc_context_t ctxt = {0,}; ++ TSRMLS_FETCH(); ++ ++ if(zend_is_compiling(TSRMLS_C)) { return FAILURE; } ++ ++ if(zend_hash_quick_find(APCG(lazy_class_table), name, len, hash, (void**)&cl) == FAILURE) { ++ return FAILURE; ++ } ++ ++ ctxt.pool = apc_pool_create(APC_UNPOOL, apc_php_malloc, apc_php_free, apc_sma_protect, apc_sma_unprotect TSRMLS_CC); ++ ctxt.copy = APC_COPY_OUT_OPCODE; ++ ++ if(install_class(*cl, &ctxt, 0 TSRMLS_CC) == FAILURE) { ++ apc_warning("apc_lookup_class_hook: could not install %s" TSRMLS_CC, name); ++ return FAILURE; ++ } ++ ++ if(zend_hash_quick_find(EG(class_table), name, len, hash, (void**)ce) == FAILURE) { ++ apc_warning("apc_lookup_class_hook: known error trying to fetch class %s" TSRMLS_CC, name); ++ return FAILURE; ++ } ++ ++ return SUCCESS; ++ ++} ++/* }}} */ ++ ++/* {{{ uninstall_class */ ++static int uninstall_class(apc_class_t cl TSRMLS_DC) ++{ ++ int status; ++ ++ status = zend_hash_del(EG(class_table), ++ cl.name, ++ cl.name_len+1); ++ if (status == FAILURE) { ++ apc_error("Cannot delete class %s" TSRMLS_CC, cl.name); ++ } ++ return status; ++} ++/* }}} */ ++ ++/* {{{ copy_function_name (taken from zend_builtin_functions.c to ensure future compatibility with APC) */ ++static int copy_function_name(apc_function_t *pf TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) ++{ ++ zval *internal_ar = va_arg(args, zval *), ++ *user_ar = va_arg(args, zval *); ++ zend_function *func = pf->function; ++ ++ if (hash_key->nKeyLength == 0 || hash_key->arKey[0] == 0) { ++ return 0; ++ } ++ ++ if (func->type == ZEND_INTERNAL_FUNCTION) { ++ add_next_index_stringl(internal_ar, hash_key->arKey, hash_key->nKeyLength-1, 1); ++ } else if (func->type == ZEND_USER_FUNCTION) { ++ add_next_index_stringl(user_ar, hash_key->arKey, hash_key->nKeyLength-1, 1); ++ } ++ ++ return 0; ++} ++ ++/* {{{ copy_class_or_interface_name (taken from zend_builtin_functions.c to ensure future compatibility with APC) */ ++static int copy_class_or_interface_name(apc_class_t *cl TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) ++{ ++ zval *array = va_arg(args, zval *); ++ zend_uint mask = va_arg(args, zend_uint); ++ zend_uint comply = va_arg(args, zend_uint); ++ zend_uint comply_mask = (comply)? mask:0; ++ zend_class_entry *ce = cl->class_entry; ++ ++ if ((hash_key->nKeyLength==0 || hash_key->arKey[0]!=0) ++ && (comply_mask == (ce->ce_flags & mask))) { ++ add_next_index_stringl(array, ce->name, ce->name_length, 1); ++ } ++ return ZEND_HASH_APPLY_KEEP; ++} ++/* }}} */ ++ ++/* }}} */ ++ ++/* {{{ apc_defined_function_hook */ ++int apc_defined_function_hook(zval *internal, zval *user) { ++ TSRMLS_FETCH(); ++ zend_hash_apply_with_arguments(APCG(lazy_function_table) ++#ifdef ZEND_ENGINE_2_3 ++ TSRMLS_CC ++#endif ++ ,(apply_func_args_t) copy_function_name, 2, internal, user); ++ return 1; ++} ++/* }}} */ ++ ++/* {{{ apc_declared_class_hook */ ++int apc_declared_class_hook(zval *classes, zend_uint mask, zend_uint comply) { ++ TSRMLS_FETCH(); ++ zend_hash_apply_with_arguments(APCG(lazy_class_table) ++#ifdef ZEND_ENGINE_2_3 ++ TSRMLS_CC ++#endif ++ , (apply_func_args_t) copy_class_or_interface_name, 3, classes, mask, comply); ++ return 1; ++} ++/* }}} */ ++ ++/* {{{ cached_compile */ ++static zend_op_array* cached_compile(zend_file_handle* h, ++ int type, ++ apc_context_t* ctxt TSRMLS_DC) ++{ ++ apc_cache_entry_t* cache_entry; ++ int i, ii; ++ ++ cache_entry = (apc_cache_entry_t*) apc_stack_top(APCG(cache_stack)); ++ assert(cache_entry != NULL); ++ ++ if (cache_entry->data.file.classes) { ++ int lazy_classes = APCG(lazy_classes); ++ for (i = 0; cache_entry->data.file.classes[i].class_entry != NULL; i++) { ++ if(install_class(cache_entry->data.file.classes[i], ctxt, lazy_classes TSRMLS_CC) == FAILURE) { ++ goto default_compile; ++ } ++ } ++ } ++ ++ if (cache_entry->data.file.functions) { ++ int lazy_functions = APCG(lazy_functions); ++ for (i = 0; cache_entry->data.file.functions[i].function != NULL; i++) { ++ install_function(cache_entry->data.file.functions[i], ctxt, lazy_functions TSRMLS_CC); ++ } ++ } ++ ++ apc_do_halt_compiler_register(cache_entry->data.file.filename, cache_entry->data.file.halt_offset TSRMLS_CC); ++ ++ ++ return apc_copy_op_array_for_execution(NULL, cache_entry->data.file.op_array, ctxt TSRMLS_CC); ++ ++default_compile: ++ ++ if(cache_entry->data.file.classes) { ++ for(ii = 0; ii < i ; ii++) { ++ uninstall_class(cache_entry->data.file.classes[ii] TSRMLS_CC); ++ } ++ } ++ ++ apc_stack_pop(APCG(cache_stack)); /* pop out cache_entry */ ++ ++ apc_cache_release(apc_cache, cache_entry TSRMLS_CC); ++ ++ /* cannot free up cache data yet, it maybe in use */ ++ ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ apc_compile_cache_entry */ ++zend_bool apc_compile_cache_entry(apc_cache_key_t *key, zend_file_handle* h, int type, time_t t, zend_op_array** op_array, apc_cache_entry_t** cache_entry TSRMLS_DC) { ++ int num_functions, num_classes; ++ apc_function_t* alloc_functions; ++ zend_op_array* alloc_op_array; ++ apc_class_t* alloc_classes; ++ char *path; ++ apc_context_t ctxt; ++ ++ /* remember how many functions and classes existed before compilation */ ++ num_functions = zend_hash_num_elements(CG(function_table)); ++ num_classes = zend_hash_num_elements(CG(class_table)); ++ ++ /* compile the file using the default compile function, * ++ * we set *op_array here so we return opcodes during * ++ * a failure. We should not return prior to this line. */ ++ *op_array = old_compile_file(h, type TSRMLS_CC); ++ if (*op_array == NULL) { ++ return FAILURE; ++ } ++ ++ ctxt.pool = apc_pool_create(APC_MEDIUM_POOL, apc_sma_malloc, apc_sma_free, ++ apc_sma_protect, apc_sma_unprotect TSRMLS_CC); ++ if (!ctxt.pool) { ++ apc_warning("Unable to allocate memory for pool." TSRMLS_CC); ++ return FAILURE; ++ } ++ ctxt.copy = APC_COPY_IN_OPCODE; ++ ++ if(APCG(file_md5)) { ++ int n; ++ unsigned char buf[1024]; ++ PHP_MD5_CTX context; ++ php_stream *stream; ++ char *filename; ++ ++ if(h->opened_path) { ++ filename = h->opened_path; ++ } else { ++ filename = h->filename; ++ } ++ stream = php_stream_open_wrapper(filename, "rb", REPORT_ERRORS | ENFORCE_SAFE_MODE, NULL); ++ if(stream) { ++ PHP_MD5Init(&context); ++ while((n = php_stream_read(stream, (char*)buf, sizeof(buf))) > 0) { ++ PHP_MD5Update(&context, buf, n); ++ } ++ PHP_MD5Final(key->md5, &context); ++ php_stream_close(stream); ++ if(n<0) { ++ apc_warning("Error while reading '%s' for md5 generation." TSRMLS_CC, filename); ++ } ++ } else { ++ apc_warning("Unable to open '%s' for md5 generation." TSRMLS_CC, filename); ++ } ++ } ++ ++ if(!(alloc_op_array = apc_copy_op_array(NULL, *op_array, &ctxt TSRMLS_CC))) { ++ goto freepool; ++ } ++ ++ if(!(alloc_functions = apc_copy_new_functions(num_functions, &ctxt TSRMLS_CC))) { ++ goto freepool; ++ } ++ if(!(alloc_classes = apc_copy_new_classes(*op_array, num_classes, &ctxt TSRMLS_CC))) { ++ goto freepool; ++ } ++ ++ path = h->opened_path; ++ if(!path && key->type == APC_CACHE_KEY_FPFILE) path = (char*)key->data.fpfile.fullpath; ++ if(!path) path=h->filename; ++ ++ apc_debug("2. h->opened_path=[%s] h->filename=[%s]\n" TSRMLS_CC, h->opened_path?h->opened_path:"null",h->filename); ++ ++ if(!(*cache_entry = apc_cache_make_file_entry(path, alloc_op_array, alloc_functions, alloc_classes, &ctxt TSRMLS_CC))) { ++ goto freepool; ++ } ++ ++ return SUCCESS; ++ ++freepool: ++ apc_pool_destroy(ctxt.pool TSRMLS_CC); ++ ctxt.pool = NULL; ++ ++ return FAILURE; ++ ++} ++/* }}} */ ++ ++/* {{{ my_compile_file ++ Overrides zend_compile_file */ ++static zend_op_array* my_compile_file(zend_file_handle* h, ++ int type TSRMLS_DC) ++{ ++ apc_cache_key_t key; ++ apc_cache_entry_t* cache_entry; ++ zend_op_array* op_array = NULL; ++ time_t t; ++ apc_context_t ctxt = {0,}; ++ int bailout=0; ++ const char* filename = NULL; ++ ++ if (!APCG(enabled) || apc_cache_busy(apc_cache)) { ++ return old_compile_file(h, type TSRMLS_CC); ++ } ++ ++ if(h->opened_path) { ++ filename = h->opened_path; ++ } else { ++ filename = h->filename; ++ } ++ ++ /* check our regular expression filters */ ++ if (APCG(filters) && APCG(compiled_filters) && filename) { ++ int ret = apc_regex_match_array(APCG(compiled_filters), filename); ++ ++ if(ret == APC_NEGATIVE_MATCH || (ret != APC_POSITIVE_MATCH && !APCG(cache_by_default))) { ++ return old_compile_file(h, type TSRMLS_CC); ++ } ++ } else if(!APCG(cache_by_default)) { ++ return old_compile_file(h, type TSRMLS_CC); ++ } ++ APCG(current_cache) = apc_cache; ++ ++ ++ t = apc_time(); ++ ++ apc_debug("1. h->opened_path=[%s] h->filename=[%s]\n" TSRMLS_CC, h->opened_path?h->opened_path:"null",h->filename); ++ ++ /* try to create a cache key; if we fail, give up on caching */ ++ if (!apc_cache_make_file_key(&key, h->filename, PG(include_path), t TSRMLS_CC)) { ++ return old_compile_file(h, type TSRMLS_CC); ++ } ++ ++ if(!APCG(force_file_update)) { ++ /* search for the file in the cache */ ++ cache_entry = apc_cache_find(apc_cache, key, t TSRMLS_CC); ++ ctxt.force_update = 0; ++ } else { ++ cache_entry = NULL; ++ ctxt.force_update = 1; ++ } ++ ++ if (cache_entry != NULL) { ++ int dummy = 1; ++ ++ ctxt.pool = apc_pool_create(APC_UNPOOL, apc_php_malloc, apc_php_free, ++ apc_sma_protect, apc_sma_unprotect TSRMLS_CC); ++ if (!ctxt.pool) { ++ apc_warning("Unable to allocate memory for pool." TSRMLS_CC); ++ return old_compile_file(h, type TSRMLS_CC); ++ } ++ ctxt.copy = APC_COPY_OUT_OPCODE; ++ ++ zend_hash_add(&EG(included_files), cache_entry->data.file.filename, ++ strlen(cache_entry->data.file.filename)+1, ++ (void *)&dummy, sizeof(int), NULL); ++ ++ apc_stack_push(APCG(cache_stack), cache_entry TSRMLS_CC); ++ op_array = cached_compile(h, type, &ctxt TSRMLS_CC); ++ ++ if(op_array) { ++#ifdef APC_FILEHITS ++ /* If the file comes from the cache, add it to the global request file list */ ++ add_next_index_string(APCG(filehits), h->filename, 1); ++#endif ++ /* this is an unpool, which has no cleanup - this only free's the pool header */ ++ apc_pool_destroy(ctxt.pool TSRMLS_CC); ++ ++ /* We might leak fds without this hack */ ++ if (h->type != ZEND_HANDLE_FILENAME) { ++ zend_llist_add_element(&CG(open_files), h); ++ } ++ return op_array; ++ } ++ if(APCG(report_autofilter)) { ++ apc_warning("Autofiltering %s" TSRMLS_CC, ++ (h->opened_path ? h->opened_path : h->filename)); ++ apc_warning("Recompiling %s" TSRMLS_CC, cache_entry->data.file.filename); ++ } ++ /* TODO: check what happens with EG(included_files) */ ++ } ++ ++ /* Make sure the mtime reflects the files last known mtime, and we respect max_file_size in the case of fpstat==0 */ ++ if(key.type == APC_CACHE_KEY_FPFILE) { ++ apc_fileinfo_t fileinfo; ++ struct stat *tmp_buf = NULL; ++ if(!strcmp(SG(request_info).path_translated, h->filename)) { ++ tmp_buf = sapi_get_stat(TSRMLS_C); /* Apache has already done this stat() for us */ ++ } ++ if(tmp_buf) { ++ fileinfo.st_buf.sb = *tmp_buf; ++ } else { ++ if (apc_search_paths(h->filename, PG(include_path), &fileinfo TSRMLS_CC) != 0) { ++ apc_debug("Stat failed %s - bailing (%s) (%d)\n" TSRMLS_CC,h->filename,SG(request_info).path_translated); ++ return old_compile_file(h, type TSRMLS_CC); ++ } ++ } ++ if (APCG(max_file_size) < fileinfo.st_buf.sb.st_size) { ++ apc_debug("File is too big %s (%ld) - bailing\n" TSRMLS_CC, h->filename, fileinfo.st_buf.sb.st_size); ++ return old_compile_file(h, type TSRMLS_CC); ++ } ++ key.mtime = fileinfo.st_buf.sb.st_mtime; ++ } ++ ++ HANDLE_BLOCK_INTERRUPTIONS(); ++ ++#if NONBLOCKING_LOCK_AVAILABLE ++ if(APCG(write_lock)) { ++ if(!apc_cache_write_lock(apc_cache TSRMLS_CC)) { ++ HANDLE_UNBLOCK_INTERRUPTIONS(); ++ return old_compile_file(h, type TSRMLS_CC); ++ } ++ } ++#endif ++ ++ zend_try { ++ if (apc_compile_cache_entry(&key, h, type, t, &op_array, &cache_entry TSRMLS_CC) == SUCCESS) { ++ ctxt.pool = cache_entry->pool; ++ ctxt.copy = APC_COPY_IN_OPCODE; ++ if (apc_cache_insert(apc_cache, key, cache_entry, &ctxt, t TSRMLS_CC) != 1) { ++ apc_pool_destroy(ctxt.pool TSRMLS_CC); ++ ctxt.pool = NULL; ++ } ++ } ++ } zend_catch { ++ bailout=1; /* in the event of a bailout, ensure we don't create a dead-lock */ ++ } zend_end_try(); ++ ++ APCG(current_cache) = NULL; ++ ++#if NONBLOCKING_LOCK_AVAILABLE ++ if(APCG(write_lock)) { ++ apc_cache_write_unlock(apc_cache TSRMLS_CC); ++ } ++#endif ++ HANDLE_UNBLOCK_INTERRUPTIONS(); ++ ++ if (bailout) zend_bailout(); ++ ++ return op_array; ++} ++/* }}} */ ++ ++/* {{{ data preload */ ++ ++extern int _apc_store(char *strkey, int strkey_len, const zval *val, const unsigned int ttl, const int exclusive TSRMLS_DC); ++ ++static zval* data_unserialize(const char *filename TSRMLS_DC) ++{ ++ zval* retval; ++ long len = 0; ++ struct stat sb; ++ char *contents, *tmp; ++ FILE *fp; ++ php_unserialize_data_t var_hash; ++ ++ if(VCWD_STAT(filename, &sb) == -1) { ++ return NULL; ++ } ++ ++ fp = fopen(filename, "rb"); ++ ++ len = sizeof(char)*sb.st_size; ++ ++ tmp = contents = malloc(len); ++ ++ if(!contents) { ++ return NULL; ++ } ++ ++ if(fread(contents, 1, len, fp) < 1) { ++ free(contents); ++ return NULL; ++ } ++ ++ MAKE_STD_ZVAL(retval); ++ ++ PHP_VAR_UNSERIALIZE_INIT(var_hash); ++ ++ /* I wish I could use json */ ++ if(!php_var_unserialize(&retval, (const unsigned char**)&tmp, (const unsigned char*)(contents+len), &var_hash TSRMLS_CC)) { ++ zval_ptr_dtor(&retval); ++ return NULL; ++ } ++ ++ PHP_VAR_UNSERIALIZE_DESTROY(var_hash); ++ ++ free(contents); ++ fclose(fp); ++ ++ return retval; ++} ++ ++static int apc_load_data(const char *data_file TSRMLS_DC) ++{ ++ char *p; ++ char key[MAXPATHLEN] = {0,}; ++ unsigned int key_len; ++ zval *data; ++ ++ p = strrchr(data_file, DEFAULT_SLASH); ++ ++ if(p && p[1]) { ++ strlcpy(key, p+1, sizeof(key)); ++ p = strrchr(key, '.'); ++ ++ if(p) { ++ p[0] = '\0'; ++ key_len = strlen(key); ++ ++ data = data_unserialize(data_file TSRMLS_CC); ++ if(data) { ++ _apc_store(key, key_len, data, 0, 1 TSRMLS_CC); ++ } ++ return 1; ++ } ++ } ++ ++ return 0; ++} ++ ++static int apc_walk_dir(const char *path TSRMLS_DC) ++{ ++ char file[MAXPATHLEN]={0,}; ++ int ndir, i; ++ char *p = NULL; ++ struct dirent **namelist = NULL; ++ ++ if ((ndir = php_scandir(path, &namelist, 0, php_alphasort)) > 0) ++ { ++ for (i = 0; i < ndir; i++) ++ { ++ /* check for extension */ ++ if (!(p = strrchr(namelist[i]->d_name, '.')) ++ || (p && strcmp(p, ".data"))) ++ { ++ free(namelist[i]); ++ continue; ++ } ++ snprintf(file, MAXPATHLEN, "%s%c%s", ++ path, DEFAULT_SLASH, namelist[i]->d_name); ++ if(!apc_load_data(file TSRMLS_CC)) ++ { ++ /* print error */ ++ } ++ free(namelist[i]); ++ } ++ free(namelist); ++ } ++ ++ return 1; ++} ++ ++void apc_data_preload(TSRMLS_D) ++{ ++ if(!APCG(preload_path)) return; ++ ++ apc_walk_dir(APCG(preload_path) TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ apc_serializer hooks */ ++static int _apc_register_serializer(const char* name, apc_serialize_t serialize, ++ apc_unserialize_t unserialize, ++ void *config TSRMLS_DC) ++{ ++ int i; ++ apc_serializer_t *serializer; ++ ++ for(i = 0; i < APC_MAX_SERIALIZERS; i++) { ++ serializer = &apc_serializers[i]; ++ if(!serializer->name) { ++ /* empty entry */ ++ serializer->name = name; /* assumed to be const */ ++ serializer->serialize = serialize; ++ serializer->unserialize = unserialize; ++ serializer->config = config; ++ apc_serializers[i+1].name = NULL; ++ return 1; ++ } ++ } ++ ++ return 0; ++} ++ ++apc_serializer_t* apc_find_serializer(const char* name TSRMLS_DC) ++{ ++ int i; ++ apc_serializer_t *serializer; ++ ++ for(i = 0; i < APC_MAX_SERIALIZERS; i++) { ++ serializer = &apc_serializers[i]; ++ if(serializer->name && (strcmp(serializer->name, name) == 0)) { ++ return serializer; ++ } ++ } ++ return NULL; ++} ++ ++apc_serializer_t* apc_get_serializers(TSRMLS_D) ++{ ++ return &(apc_serializers[0]); ++} ++/* }}} */ ++ ++/* {{{ module init and shutdown */ ++ ++int apc_module_init(int module_number TSRMLS_DC) ++{ ++ /* apc initialization */ ++#if APC_MMAP ++ apc_sma_init(APCG(shm_segments), APCG(shm_size), APCG(mmap_file_mask) TSRMLS_CC); ++#else ++ apc_sma_init(APCG(shm_segments), APCG(shm_size), NULL TSRMLS_CC); ++#endif ++ apc_cache = apc_cache_create(APCG(num_files_hint), APCG(gc_ttl), APCG(ttl) TSRMLS_CC); ++ apc_user_cache = apc_cache_create(APCG(user_entries_hint), APCG(gc_ttl), APCG(user_ttl) TSRMLS_CC); ++ ++ /* override compilation */ ++ old_compile_file = zend_compile_file; ++ zend_compile_file = my_compile_file; ++ REGISTER_LONG_CONSTANT("\000apc_magic", (long)&set_compile_hook, CONST_PERSISTENT | CONST_CS); ++ REGISTER_LONG_CONSTANT("\000apc_compile_file", (long)&my_compile_file, CONST_PERSISTENT | CONST_CS); ++ REGISTER_LONG_CONSTANT(APC_SERIALIZER_CONSTANT, (long)&_apc_register_serializer, CONST_PERSISTENT | CONST_CS); ++ ++ /* test out the constant function pointer */ ++ apc_register_serializer("php", APC_SERIALIZER_NAME(php), APC_UNSERIALIZER_NAME(php), NULL TSRMLS_CC); ++ ++ assert(apc_serializers[0].name != NULL); ++ ++ apc_pool_init(); ++ ++ apc_data_preload(TSRMLS_C); ++ ++#if APC_HAVE_LOOKUP_HOOKS ++ if(APCG(lazy_functions)) { ++ zend_set_lookup_function_hook(apc_lookup_function_hook TSRMLS_CC); ++ zend_set_defined_function_hook(apc_defined_function_hook TSRMLS_CC); ++ } ++ if(APCG(lazy_classes)) { ++ zend_set_lookup_class_hook(apc_lookup_class_hook TSRMLS_CC); ++ zend_set_declared_class_hook(apc_declared_class_hook TSRMLS_CC); ++ } ++#else ++ if(APCG(lazy_functions) || APCG(lazy_classes)) { ++ apc_warning("Lazy function/class loading not available with this version of PHP, please disable APC lazy loading." TSRMLS_CC); ++ APCG(lazy_functions) = APCG(lazy_classes) = 0; ++ } ++#endif ++ ++#ifdef ZEND_ENGINE_2_4 ++#ifndef ZTS ++ apc_interned_strings_init(TSRMLS_C); ++#endif ++#endif ++ ++ APCG(initialized) = 1; ++ return 0; ++} ++ ++int apc_module_shutdown(TSRMLS_D) ++{ ++ if (!APCG(initialized)) ++ return 0; ++ ++ /* restore compilation */ ++ zend_compile_file = old_compile_file; ++ ++ /* ++ * In case we got interrupted by a SIGTERM or something else during execution ++ * we may have cache entries left on the stack that we need to check to make ++ * sure that any functions or classes these may have added to the global function ++ * and class tables are removed before we blow away the memory that hold them. ++ * ++ * This is merely to remove memory leak warnings - as the process is terminated ++ * immediately after shutdown. The following while loop can be removed without ++ * affecting anything else. ++ */ ++ while (apc_stack_size(APCG(cache_stack)) > 0) { ++ int i; ++ apc_cache_entry_t* cache_entry = (apc_cache_entry_t*) apc_stack_pop(APCG(cache_stack)); ++ if (cache_entry->data.file.functions) { ++ for (i = 0; cache_entry->data.file.functions[i].function != NULL; i++) { ++ zend_hash_del(EG(function_table), ++ cache_entry->data.file.functions[i].name, ++ cache_entry->data.file.functions[i].name_len+1); ++ } ++ } ++ if (cache_entry->data.file.classes) { ++ for (i = 0; cache_entry->data.file.classes[i].class_entry != NULL; i++) { ++ zend_hash_del(EG(class_table), ++ cache_entry->data.file.classes[i].name, ++ cache_entry->data.file.classes[i].name_len+1); ++ } ++ } ++ apc_cache_release(apc_cache, cache_entry TSRMLS_CC); ++ } ++ ++#ifdef ZEND_ENGINE_2_4 ++#ifndef ZTS ++ apc_interned_strings_shutdown(TSRMLS_C); ++#endif ++#endif ++ ++ apc_cache_destroy(apc_cache TSRMLS_CC); ++ apc_cache_destroy(apc_user_cache TSRMLS_CC); ++ apc_sma_cleanup(TSRMLS_C); ++ ++ APCG(initialized) = 0; ++ return 0; ++} ++ ++/* }}} */ ++ ++/* {{{ process init and shutdown */ ++int apc_process_init(int module_number TSRMLS_DC) ++{ ++ return 0; ++} ++ ++int apc_process_shutdown(TSRMLS_D) ++{ ++ return 0; ++} ++/* }}} */ ++ ++ ++/* {{{ apc_deactivate */ ++static void apc_deactivate(TSRMLS_D) ++{ ++ /* The execution stack was unwound, which prevented us from decrementing ++ * the reference counts on active cache entries in `my_execute`. ++ */ ++ while (apc_stack_size(APCG(cache_stack)) > 0) { ++ int i; ++ zend_class_entry* zce = NULL; ++ void ** centry = (void*)(&zce); ++ zend_class_entry** pzce = NULL; ++ ++ apc_cache_entry_t* cache_entry = ++ (apc_cache_entry_t*) apc_stack_pop(APCG(cache_stack)); ++ ++ if (cache_entry->data.file.classes) { ++ for (i = 0; cache_entry->data.file.classes[i].class_entry != NULL; i++) { ++ centry = (void**)&pzce; /* a triple indirection to get zend_class_entry*** */ ++ if(zend_hash_find(EG(class_table), ++ cache_entry->data.file.classes[i].name, ++ cache_entry->data.file.classes[i].name_len+1, ++ (void**)centry) == FAILURE) ++ { ++ /* double inclusion of conditional classes ends up failing ++ * this lookup the second time around. ++ */ ++ continue; ++ } ++ ++ zce = *pzce; ++ ++ zend_hash_del(EG(class_table), ++ cache_entry->data.file.classes[i].name, ++ cache_entry->data.file.classes[i].name_len+1); ++ ++ apc_free_class_entry_after_execution(zce TSRMLS_CC); ++ } ++ } ++ apc_cache_release(apc_cache, cache_entry TSRMLS_CC); ++ } ++} ++/* }}} */ ++ ++/* {{{ request init and shutdown */ ++ ++int apc_request_init(TSRMLS_D) ++{ ++ apc_stack_clear(APCG(cache_stack)); ++ if (!APCG(compiled_filters) && APCG(filters)) { ++ /* compile regex filters here to avoid race condition between MINIT of PCRE and APC. ++ * This should be moved to apc_cache_create() if this race condition between modules is resolved */ ++ APCG(compiled_filters) = apc_regex_compile_array(APCG(filters) TSRMLS_CC); ++ } ++ ++ if (!APCG(serializer) && APCG(serializer_name)) { ++ /* Avoid race conditions between MINIT of apc and serializer exts like igbinary */ ++ APCG(serializer) = apc_find_serializer(APCG(serializer_name) TSRMLS_CC); ++ } ++ ++#if APC_HAVE_LOOKUP_HOOKS ++ if(APCG(lazy_functions)) { ++ APCG(lazy_function_table) = emalloc(sizeof(HashTable)); ++ zend_hash_init(APCG(lazy_function_table), 0, NULL, NULL, 0); ++ } ++ if(APCG(lazy_classes)) { ++ APCG(lazy_class_table) = emalloc(sizeof(HashTable)); ++ zend_hash_init(APCG(lazy_class_table), 0, NULL, NULL, 0); ++ } ++#endif ++ ++#ifdef APC_FILEHITS ++ ALLOC_INIT_ZVAL(APCG(filehits)); ++ array_init(APCG(filehits)); ++#endif ++ ++ return 0; ++} ++ ++int apc_request_shutdown(TSRMLS_D) ++{ ++#if APC_HAVE_LOOKUP_HOOKS ++ if(APCG(lazy_class_table)) { ++ zend_hash_destroy(APCG(lazy_class_table)); ++ efree(APCG(lazy_class_table)); ++ } ++ if(APCG(lazy_function_table)) { ++ zend_hash_destroy(APCG(lazy_function_table)); ++ efree(APCG(lazy_function_table)); ++ } ++#endif ++ ++ apc_deactivate(TSRMLS_C); ++ ++#ifdef APC_FILEHITS ++ zval_ptr_dtor(&APCG(filehits)); ++#endif ++ return 0; ++} ++ ++/* }}} */ ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_main.h b/ext/apc/apc_main.h +--- a/ext/apc/apc_main.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_main.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,88 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | George Schlossnagle | ++ | Rasmus Lerdorf | ++ | Arun C. Murthy | ++ | Gopal Vijayaraghavan | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_main.h 308594 2011-02-23 12:35:33Z gopalv $ */ ++ ++#ifndef APC_MAIN_H ++#define APC_MAIN_H ++ ++#include "apc_pool.h" ++#include "apc_serializer.h" ++ ++/* ++ * This module provides the primary interface between PHP and APC. ++ */ ++ ++extern int apc_module_init(int module_number TSRMLS_DC); ++extern int apc_module_shutdown(TSRMLS_D); ++extern int apc_process_init(int module_number TSRMLS_DC); ++extern int apc_process_shutdown(TSRMLS_D); ++extern int apc_request_init(TSRMLS_D); ++extern int apc_request_shutdown(TSRMLS_D); ++ ++typedef enum _apc_copy_type { ++ APC_NO_COPY = 0, ++ APC_COPY_IN_OPCODE, ++ APC_COPY_OUT_OPCODE, ++ APC_COPY_IN_USER, ++ APC_COPY_OUT_USER ++} apc_copy_type; ++ ++typedef struct _apc_context_t ++{ ++ apc_pool *pool; ++ apc_copy_type copy; ++ unsigned int force_update:1; ++} apc_context_t; ++ ++/* {{{ struct apc_serializer_t */ ++typedef struct apc_serializer_t apc_serializer_t; ++struct apc_serializer_t { ++ const char *name; ++ apc_serialize_t serialize; ++ apc_unserialize_t unserialize; ++ void *config; ++}; ++/* }}} */ ++ ++apc_serializer_t* apc_get_serializers(TSRMLS_D); ++apc_serializer_t* apc_find_serializer(const char* name TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_mmap.c b/ext/apc/apc_mmap.c +--- a/ext/apc/apc_mmap.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_mmap.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,177 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Rasmus Lerdorf | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_mmap.c 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#include "apc.h" ++#include "apc_mmap.h" ++#include "apc_lock.h" ++ ++#if APC_MMAP ++ ++#include ++#include ++#include ++ ++/* ++ * Some operating systems (like FreeBSD) have a MAP_NOSYNC flag that ++ * tells whatever update daemons might be running to not flush dirty ++ * vm pages to disk unless absolutely necessary. My guess is that ++ * most systems that don't have this probably default to only synching ++ * to disk when absolutely necessary. ++ */ ++#ifndef MAP_NOSYNC ++#define MAP_NOSYNC 0 ++#endif ++ ++/* support for systems where MAP_ANONYMOUS is defined but not MAP_ANON, ie: HP-UX bug #14615 */ ++#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS) ++# define MAP_ANON MAP_ANONYMOUS ++#endif ++ ++apc_segment_t apc_mmap(char *file_mask, size_t size TSRMLS_DC) ++{ ++ apc_segment_t segment; ++ ++ int fd = -1; ++ int flags = MAP_SHARED | MAP_NOSYNC; ++ int remap = 1; ++ ++ /* If no filename was provided, do an anonymous mmap */ ++ if(!file_mask || (file_mask && !strlen(file_mask))) { ++#if !defined(MAP_ANON) ++ apc_error("Anonymous mmap does not apear to be available on this system (MAP_ANON/MAP_ANONYMOUS). Please see the apc.mmap_file_mask INI option." TSRMLS_CC); ++#else ++ fd = -1; ++ flags = MAP_SHARED | MAP_ANON; ++ remap = 0; ++#endif ++ } else if(!strcmp(file_mask,"/dev/zero")) { ++ fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR); ++ if(fd == -1) { ++ apc_error("apc_mmap: open on /dev/zero failed:" TSRMLS_CC); ++ goto error; ++ } ++ remap = 0; /* cannot remap */ ++ } else if(strstr(file_mask,".shm")) { ++ /* ++ * If the filemask contains .shm we try to do a POSIX-compliant shared memory ++ * backed mmap which should avoid synchs on some platforms. At least on ++ * FreeBSD this implies MAP_NOSYNC and on Linux it is equivalent of mmap'ing ++ * a file in a mounted shmfs. For this to work on Linux you need to make sure ++ * you actually have shmfs mounted. Also on Linux, make sure the file_mask you ++ * pass in has a leading / and no other /'s. eg. /apc.shm.XXXXXX ++ * On FreeBSD these are mapped onto the regular filesystem so you can put whatever ++ * path you want here. ++ */ ++ if(!mktemp(file_mask)) { ++ apc_error("apc_mmap: mktemp on %s failed:" TSRMLS_CC, file_mask); ++ goto error; ++ } ++ fd = shm_open(file_mask, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR); ++ if(fd == -1) { ++ apc_error("apc_mmap: shm_open on %s failed:" TSRMLS_CC, file_mask); ++ goto error; ++ } ++ if (ftruncate(fd, size) < 0) { ++ close(fd); ++ shm_unlink(file_mask); ++ apc_error("apc_mmap: ftruncate failed:" TSRMLS_CC); ++ goto error; ++ } ++ shm_unlink(file_mask); ++ } else { ++ /* ++ * Otherwise we do a normal filesystem mmap ++ */ ++ fd = mkstemp(file_mask); ++ if(fd == -1) { ++ apc_error("apc_mmap: mkstemp on %s failed:" TSRMLS_CC, file_mask); ++ goto error; ++ } ++ if (ftruncate(fd, size) < 0) { ++ close(fd); ++ unlink(file_mask); ++ apc_error("apc_mmap: ftruncate failed:" TSRMLS_CC); ++ goto error; ++ } ++ unlink(file_mask); ++ } ++ ++ segment.shmaddr = (void *)mmap(NULL, size, PROT_READ | PROT_WRITE, flags, fd, 0); ++ segment.size = size; ++ ++#ifdef APC_MEMPROTECT ++ if(remap) { ++ segment.roaddr = (void *)mmap(NULL, size, PROT_READ, flags, fd, 0); ++ } else { ++ segment.roaddr = NULL; ++ } ++#endif ++ ++ if((long)segment.shmaddr == -1) { ++ apc_error("apc_mmap: mmap failed:" TSRMLS_CC); ++ } ++ ++ if(fd != -1) close(fd); ++ ++ return segment; ++ ++error: ++ ++ segment.shmaddr = (void*)-1; ++ segment.size = 0; ++#ifdef APC_MEMPROTECT ++ segment.roaddr = NULL; ++#endif ++ return segment; ++} ++ ++void apc_unmap(apc_segment_t *segment TSRMLS_DC) ++{ ++ if (munmap(segment->shmaddr, segment->size) < 0) { ++ apc_warning("apc_unmap: munmap failed:" TSRMLS_CC); ++ } ++ ++#ifdef APC_MEMPROTECT ++ if (segment->roaddr && munmap(segment->roaddr, segment->size) < 0) { ++ apc_warning("apc_unmap: munmap failed:" TSRMLS_CC); ++ } ++#endif ++ ++} ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_mmap.h b/ext/apc/apc_mmap.h +--- a/ext/apc/apc_mmap.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_mmap.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,54 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Gopal V | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_mmap.h 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#ifndef APC_MMAP_H ++#define APC_MMAP_H ++ ++#include ++ ++#include "apc.h" ++#include "apc_sma.h" ++ ++/* Wrapper functions for shared memory mapped files */ ++ ++#if APC_MMAP ++apc_segment_t apc_mmap(char *file_mask, size_t size TSRMLS_DC); ++void apc_unmap(apc_segment_t* segment TSRMLS_DC); ++#endif ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc.php b/ext/apc/apc.php +--- a/ext/apc/apc.php 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc.php 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,1362 @@ ++ | ++ | Rasmus Lerdorf | ++ | Ilia Alshanetsky | ++ +----------------------------------------------------------------------+ ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++$VERSION='$Id: apc.php 325483 2012-05-01 00:34:04Z rasmus $'; ++ ++////////// READ OPTIONAL CONFIGURATION FILE //////////// ++if (file_exists("apc.conf.php")) include("apc.conf.php"); ++//////////////////////////////////////////////////////// ++ ++////////// BEGIN OF DEFAULT CONFIG AREA /////////////////////////////////////////////////////////// ++ ++defaults('USE_AUTHENTICATION',1); // Use (internal) authentication - best choice if ++ // no other authentication is available ++ // If set to 0: ++ // There will be no further authentication. You ++ // will have to handle this by yourself! ++ // If set to 1: ++ // You need to change ADMIN_PASSWORD to make ++ // this work! ++defaults('ADMIN_USERNAME','apc'); // Admin Username ++defaults('ADMIN_PASSWORD','password'); // Admin Password - CHANGE THIS TO ENABLE!!! ++ ++// (beckerr) I'm using a clear text password here, because I've no good idea how to let ++// users generate a md5 or crypt password in a easy way to fill it in above ++ ++//defaults('DATE_FORMAT', "d.m.Y H:i:s"); // German ++defaults('DATE_FORMAT', 'Y/m/d H:i:s'); // US ++ ++defaults('GRAPH_SIZE',200); // Image size ++ ++//defaults('PROXY', 'tcp://127.0.0.1:8080'); ++ ++////////// END OF DEFAULT CONFIG AREA ///////////////////////////////////////////////////////////// ++ ++ ++// "define if not defined" ++function defaults($d,$v) { ++ if (!defined($d)) define($d,$v); // or just @define(...) ++} ++ ++// rewrite $PHP_SELF to block XSS attacks ++// ++$PHP_SELF= isset($_SERVER['PHP_SELF']) ? htmlentities(strip_tags($_SERVER['PHP_SELF'],''), ENT_QUOTES, 'UTF-8') : ''; ++$time = time(); ++$host = php_uname('n'); ++if($host) { $host = '('.$host.')'; } ++if (isset($_SERVER['SERVER_ADDR'])) { ++ $host .= ' ('.$_SERVER['SERVER_ADDR'].')'; ++} ++ ++// operation constants ++define('OB_HOST_STATS',1); ++define('OB_SYS_CACHE',2); ++define('OB_USER_CACHE',3); ++define('OB_SYS_CACHE_DIR',4); ++define('OB_VERSION_CHECK',9); ++ ++// check validity of input variables ++$vardom=array( ++ 'OB' => '/^\d+$/', // operational mode switch ++ 'CC' => '/^[01]$/', // clear cache requested ++ 'DU' => '/^.*$/', // Delete User Key ++ 'SH' => '/^[a-z0-9]+$/', // shared object description ++ ++ 'IMG' => '/^[123]$/', // image to generate ++ 'LO' => '/^1$/', // login requested ++ ++ 'COUNT' => '/^\d+$/', // number of line displayed in list ++ 'SCOPE' => '/^[AD]$/', // list view scope ++ 'SORT1' => '/^[AHSMCDTZ]$/', // first sort key ++ 'SORT2' => '/^[DA]$/', // second sort key ++ 'AGGR' => '/^\d+$/', // aggregation by dir level ++ 'SEARCH' => '~^[a-zA-Z0-9/_.-]*$~' // aggregation by dir level ++); ++ ++// default cache mode ++$cache_mode='opcode'; ++ ++// cache scope ++$scope_list=array( ++ 'A' => 'cache_list', ++ 'D' => 'deleted_list' ++); ++ ++// handle POST and GET requests ++if (empty($_REQUEST)) { ++ if (!empty($_GET) && !empty($_POST)) { ++ $_REQUEST = array_merge($_GET, $_POST); ++ } else if (!empty($_GET)) { ++ $_REQUEST = $_GET; ++ } else if (!empty($_POST)) { ++ $_REQUEST = $_POST; ++ } else { ++ $_REQUEST = array(); ++ } ++} ++ ++// check parameter syntax ++foreach($vardom as $var => $dom) { ++ if (!isset($_REQUEST[$var])) { ++ $MYREQUEST[$var]=NULL; ++ } else if (!is_array($_REQUEST[$var]) && preg_match($dom.'D',$_REQUEST[$var])) { ++ $MYREQUEST[$var]=$_REQUEST[$var]; ++ } else { ++ $MYREQUEST[$var]=$_REQUEST[$var]=NULL; ++ } ++} ++ ++// check parameter sematics ++if (empty($MYREQUEST['SCOPE'])) $MYREQUEST['SCOPE']="A"; ++if (empty($MYREQUEST['SORT1'])) $MYREQUEST['SORT1']="H"; ++if (empty($MYREQUEST['SORT2'])) $MYREQUEST['SORT2']="D"; ++if (empty($MYREQUEST['OB'])) $MYREQUEST['OB']=OB_HOST_STATS; ++if (!isset($MYREQUEST['COUNT'])) $MYREQUEST['COUNT']=20; ++if (!isset($scope_list[$MYREQUEST['SCOPE']])) $MYREQUEST['SCOPE']='A'; ++ ++$MY_SELF= ++ "$PHP_SELF". ++ "?SCOPE=".$MYREQUEST['SCOPE']. ++ "&SORT1=".$MYREQUEST['SORT1']. ++ "&SORT2=".$MYREQUEST['SORT2']. ++ "&COUNT=".$MYREQUEST['COUNT']; ++$MY_SELF_WO_SORT= ++ "$PHP_SELF". ++ "?SCOPE=".$MYREQUEST['SCOPE']. ++ "&COUNT=".$MYREQUEST['COUNT']; ++ ++// authentication needed? ++// ++if (!USE_AUTHENTICATION) { ++ $AUTHENTICATED=1; ++} else { ++ $AUTHENTICATED=0; ++ if (ADMIN_PASSWORD!='password' && ($MYREQUEST['LO'] == 1 || isset($_SERVER['PHP_AUTH_USER']))) { ++ ++ if (!isset($_SERVER['PHP_AUTH_USER']) || ++ !isset($_SERVER['PHP_AUTH_PW']) || ++ $_SERVER['PHP_AUTH_USER'] != ADMIN_USERNAME || ++ $_SERVER['PHP_AUTH_PW'] != ADMIN_PASSWORD) { ++ Header("WWW-Authenticate: Basic realm=\"APC Login\""); ++ Header("HTTP/1.0 401 Unauthorized"); ++ ++ echo << ++

Rejected!

++ Wrong Username or Password!
 
  ++ Continue... ++ ++EOB; ++ exit; ++ ++ } else { ++ $AUTHENTICATED=1; ++ } ++ } ++} ++ ++// select cache mode ++if ($AUTHENTICATED && $MYREQUEST['OB'] == OB_USER_CACHE) { ++ $cache_mode='user'; ++} ++// clear cache ++if ($AUTHENTICATED && isset($MYREQUEST['CC']) && $MYREQUEST['CC']) { ++ apc_clear_cache($cache_mode); ++} ++ ++if ($AUTHENTICATED && !empty($MYREQUEST['DU'])) { ++ apc_delete($MYREQUEST['DU']); ++} ++ ++if(!function_exists('apc_cache_info') || !($cache=@apc_cache_info($cache_mode))) { ++ echo "No cache info available. APC does not appear to be running."; ++ exit; ++} ++ ++$cache_user = apc_cache_info('user', 1); ++$mem=apc_sma_info(); ++if(!$cache['num_hits']) { $cache['num_hits']=1; $time++; } // Avoid division by 0 errors on a cache clear ++ ++// don't cache this page ++// ++header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 ++header("Cache-Control: post-check=0, pre-check=0", false); ++header("Pragma: no-cache"); // HTTP/1.0 ++ ++function duration($ts) { ++ global $time; ++ $years = (int)((($time - $ts)/(7*86400))/52.177457); ++ $rem = (int)(($time-$ts)-($years * 52.177457 * 7 * 86400)); ++ $weeks = (int)(($rem)/(7*86400)); ++ $days = (int)(($rem)/86400) - $weeks*7; ++ $hours = (int)(($rem)/3600) - $days*24 - $weeks*7*24; ++ $mins = (int)(($rem)/60) - $hours*60 - $days*24*60 - $weeks*7*24*60; ++ $str = ''; ++ if($years==1) $str .= "$years year, "; ++ if($years>1) $str .= "$years years, "; ++ if($weeks==1) $str .= "$weeks week, "; ++ if($weeks>1) $str .= "$weeks weeks, "; ++ if($days==1) $str .= "$days day,"; ++ if($days>1) $str .= "$days days,"; ++ if($hours == 1) $str .= " $hours hour and"; ++ if($hours>1) $str .= " $hours hours and"; ++ if($mins == 1) $str .= " 1 minute"; ++ else $str .= " $mins minutes"; ++ return $str; ++} ++ ++// create graphics ++// ++function graphics_avail() { ++ return extension_loaded('gd'); ++} ++if (isset($MYREQUEST['IMG'])) ++{ ++ if (!graphics_avail()) { ++ exit(0); ++ } ++ ++ function fill_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1,$color2,$text='',$placeindex=0) { ++ $r=$diameter/2; ++ $w=deg2rad((360+$start+($end-$start)/2)%360); ++ ++ ++ if (function_exists("imagefilledarc")) { ++ // exists only if GD 2.0.1 is avaliable ++ imagefilledarc($im, $centerX+1, $centerY+1, $diameter, $diameter, $start, $end, $color1, IMG_ARC_PIE); ++ imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2, IMG_ARC_PIE); ++ imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color1, IMG_ARC_NOFILL|IMG_ARC_EDGED); ++ } else { ++ imagearc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2); ++ imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2); ++ imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start+1)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2); ++ imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end-1)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2); ++ imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2); ++ imagefill($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2, $color2); ++ } ++ if ($text) { ++ if ($placeindex>0) { ++ imageline($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$diameter, $placeindex*12,$color1); ++ imagestring($im,4,$diameter, $placeindex*12,$text,$color1); ++ ++ } else { ++ imagestring($im,4,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$text,$color1); ++ } ++ } ++ } ++ ++ function text_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1,$text,$placeindex=0) { ++ $r=$diameter/2; ++ $w=deg2rad((360+$start+($end-$start)/2)%360); ++ ++ if ($placeindex>0) { ++ imageline($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$diameter, $placeindex*12,$color1); ++ imagestring($im,4,$diameter, $placeindex*12,$text,$color1); ++ ++ } else { ++ imagestring($im,4,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$text,$color1); ++ } ++ } ++ ++ function fill_box($im, $x, $y, $w, $h, $color1, $color2,$text='',$placeindex='') { ++ global $col_black; ++ $x1=$x+$w-1; ++ $y1=$y+$h-1; ++ ++ imagerectangle($im, $x, $y1, $x1+1, $y+1, $col_black); ++ if($y1>$y) imagefilledrectangle($im, $x, $y, $x1, $y1, $color2); ++ else imagefilledrectangle($im, $x, $y1, $x1, $y, $color2); ++ imagerectangle($im, $x, $y1, $x1, $y, $color1); ++ if ($text) { ++ if ($placeindex>0) { ++ ++ if ($placeindex<16) ++ { ++ $px=5; ++ $py=$placeindex*12+6; ++ imagefilledrectangle($im, $px+90, $py+3, $px+90-4, $py-3, $color2); ++ imageline($im,$x,$y+$h/2,$px+90,$py,$color2); ++ imagestring($im,2,$px,$py-6,$text,$color1); ++ ++ } else { ++ if ($placeindex<31) { ++ $px=$x+40*2; ++ $py=($placeindex-15)*12+6; ++ } else { ++ $px=$x+40*2+100*intval(($placeindex-15)/15); ++ $py=($placeindex%15)*12+6; ++ } ++ imagefilledrectangle($im, $px, $py+3, $px-4, $py-3, $color2); ++ imageline($im,$x+$w,$y+$h/2,$px,$py,$color2); ++ imagestring($im,2,$px+2,$py-6,$text,$color1); ++ } ++ } else { ++ imagestring($im,4,$x+5,$y1-16,$text,$color1); ++ } ++ } ++ } ++ ++ ++ $size = GRAPH_SIZE; // image size ++ if ($MYREQUEST['IMG']==3) ++ $image = imagecreate(2*$size+150, $size+10); ++ else ++ $image = imagecreate($size+50, $size+10); ++ ++ $col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); ++ $col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30); ++ $col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60); ++ $col_black = imagecolorallocate($image, 0, 0, 0); ++ imagecolortransparent($image,$col_white); ++ ++ switch ($MYREQUEST['IMG']) { ++ ++ case 1: ++ $s=$mem['num_seg']*$mem['seg_size']; ++ $a=$mem['avail_mem']; ++ $x=$y=$size/2; ++ $fuzz = 0.000001; ++ ++ // This block of code creates the pie chart. It is a lot more complex than you ++ // would expect because we try to visualize any memory fragmentation as well. ++ $angle_from = 0; ++ $string_placement=array(); ++ for($i=0; $i<$mem['num_seg']; $i++) { ++ $ptr = 0; ++ $free = $mem['block_lists'][$i]; ++ uasort($free, 'block_sort'); ++ foreach($free as $block) { ++ if($block['offset']!=$ptr) { // Used block ++ $angle_to = $angle_from+($block['offset']-$ptr)/$s; ++ if(($angle_to+$fuzz)>1) $angle_to = 1; ++ if( ($angle_to*360) - ($angle_from*360) >= 1) { ++ fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_red); ++ if (($angle_to-$angle_from)>0.05) { ++ array_push($string_placement, array($angle_from,$angle_to)); ++ } ++ } ++ $angle_from = $angle_to; ++ } ++ $angle_to = $angle_from+($block['size'])/$s; ++ if(($angle_to+$fuzz)>1) $angle_to = 1; ++ if( ($angle_to*360) - ($angle_from*360) >= 1) { ++ fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_green); ++ if (($angle_to-$angle_from)>0.05) { ++ array_push($string_placement, array($angle_from,$angle_to)); ++ } ++ } ++ $angle_from = $angle_to; ++ $ptr = $block['offset']+$block['size']; ++ } ++ if ($ptr < $mem['seg_size']) { // memory at the end ++ $angle_to = $angle_from + ($mem['seg_size'] - $ptr)/$s; ++ if(($angle_to+$fuzz)>1) $angle_to = 1; ++ fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_red); ++ if (($angle_to-$angle_from)>0.05) { ++ array_push($string_placement, array($angle_from,$angle_to)); ++ } ++ } ++ } ++ foreach ($string_placement as $angle) { ++ text_arc($image,$x,$y,$size,$angle[0]*360,$angle[1]*360,$col_black,bsize($s*($angle[1]-$angle[0]))); ++ } ++ break; ++ ++ case 2: ++ $s=$cache['num_hits']+$cache['num_misses']; ++ $a=$cache['num_hits']; ++ ++ fill_box($image, 30,$size,50,-$a*($size-21)/$s,$col_black,$col_green,sprintf("%.1f%%",$cache['num_hits']*100/$s)); ++ fill_box($image,130,$size,50,-max(4,($s-$a)*($size-21)/$s),$col_black,$col_red,sprintf("%.1f%%",$cache['num_misses']*100/$s)); ++ break; ++ ++ case 3: ++ $s=$mem['num_seg']*$mem['seg_size']; ++ $a=$mem['avail_mem']; ++ $x=130; ++ $y=1; ++ $j=1; ++ ++ // This block of code creates the bar chart. It is a lot more complex than you ++ // would expect because we try to visualize any memory fragmentation as well. ++ for($i=0; $i<$mem['num_seg']; $i++) { ++ $ptr = 0; ++ $free = $mem['block_lists'][$i]; ++ uasort($free, 'block_sort'); ++ foreach($free as $block) { ++ if($block['offset']!=$ptr) { // Used block ++ $h=(GRAPH_SIZE-5)*($block['offset']-$ptr)/$s; ++ if ($h>0) { ++ $j++; ++ if($j<75) fill_box($image,$x,$y,50,$h,$col_black,$col_red,bsize($block['offset']-$ptr),$j); ++ else fill_box($image,$x,$y,50,$h,$col_black,$col_red); ++ } ++ $y+=$h; ++ } ++ $h=(GRAPH_SIZE-5)*($block['size'])/$s; ++ if ($h>0) { ++ $j++; ++ if($j<75) fill_box($image,$x,$y,50,$h,$col_black,$col_green,bsize($block['size']),$j); ++ else fill_box($image,$x,$y,50,$h,$col_black,$col_green); ++ } ++ $y+=$h; ++ $ptr = $block['offset']+$block['size']; ++ } ++ if ($ptr < $mem['seg_size']) { // memory at the end ++ $h = (GRAPH_SIZE-5) * ($mem['seg_size'] - $ptr) / $s; ++ if ($h > 0) { ++ fill_box($image,$x,$y,50,$h,$col_black,$col_red,bsize($mem['seg_size']-$ptr),$j++); ++ } ++ } ++ } ++ break; ++ case 4: ++ $s=$cache['num_hits']+$cache['num_misses']; ++ $a=$cache['num_hits']; ++ ++ fill_box($image, 30,$size,50,-$a*($size-21)/$s,$col_black,$col_green,sprintf("%.1f%%",$cache['num_hits']*100/$s)); ++ fill_box($image,130,$size,50,-max(4,($s-$a)*($size-21)/$s),$col_black,$col_red,sprintf("%.1f%%",$cache['num_misses']*100/$s)); ++ break; ++ ++ } ++ header("Content-type: image/png"); ++ imagepng($image); ++ exit; ++} ++ ++// pretty printer for byte values ++// ++function bsize($s) { ++ foreach (array('','K','M','G') as $i => $k) { ++ if ($s < 1024) break; ++ $s/=1024; ++ } ++ return sprintf("%5.1f %sBytes",$s,$k); ++} ++ ++// sortable table header in "scripts for this host" view ++function sortheader($key,$name,$extra='') { ++ global $MYREQUEST, $MY_SELF_WO_SORT; ++ ++ if ($MYREQUEST['SORT1']==$key) { ++ $MYREQUEST['SORT2'] = $MYREQUEST['SORT2']=='A' ? 'D' : 'A'; ++ } ++ return "$name"; ++ ++} ++ ++// create menu entry ++function menu_entry($ob,$title) { ++ global $MYREQUEST,$MY_SELF; ++ if ($MYREQUEST['OB']!=$ob) { ++ return "
  • $title
  • "; ++ } else if (empty($MYREQUEST['SH'])) { ++ return "
  • $title
  • "; ++ } else { ++ return "
  • $title
  • "; ++ } ++} ++ ++function put_login_link($s="Login") ++{ ++ global $MY_SELF,$MYREQUEST,$AUTHENTICATED; ++ // needs ADMIN_PASSWORD to be changed! ++ // ++ if (!USE_AUTHENTICATION) { ++ return; ++ } else if (ADMIN_PASSWORD=='password') ++ { ++ print <<$s ++EOB; ++ } else if ($AUTHENTICATED) { ++ print <<$s ++EOB; ++ } ++} ++ ++function block_sort($array1, $array2) ++{ ++ if ($array1['offset'] > $array2['offset']) { ++ return 1; ++ } else { ++ return -1; ++ } ++} ++ ++ ++?> ++ ++ ++APC INFO <?php echo $host ?> ++ ++ ++ ++
    ++

    ++ ++
    Opcode Cache
    ++

    ++ ++
    ++
    ++ ++
  • Refresh Data
  • ++EOB; ++echo ++ menu_entry(1,'View Host Stats'), ++ menu_entry(2,'System Cache Entries'); ++if ($AUTHENTICATED) { ++ echo menu_entry(4,'Per-Directory Entries'); ++} ++echo ++ menu_entry(3,'User Cache Entries'), ++ menu_entry(9,'Version Check'); ++ ++if ($AUTHENTICATED) { ++ echo <<Clear $cache_mode Cache ++EOB; ++} ++echo << ++EOB; ++ ++ ++// CONTENT ++echo << ++EOB; ++ ++// MAIN SWITCH STATEMENT ++ ++switch ($MYREQUEST['OB']) { ++ ++ ++ ++ ++ ++// ----------------------------------------------- ++// Host Stats ++// ----------------------------------------------- ++case OB_HOST_STATS: ++ $mem_size = $mem['num_seg']*$mem['seg_size']; ++ $mem_avail= $mem['avail_mem']; ++ $mem_used = $mem_size-$mem_avail; ++ $seg_size = bsize($mem['seg_size']); ++ $req_rate = sprintf("%.2f",($cache['num_hits']+$cache['num_misses'])/($time-$cache['start_time'])); ++ $hit_rate = sprintf("%.2f",($cache['num_hits'])/($time-$cache['start_time'])); ++ $miss_rate = sprintf("%.2f",($cache['num_misses'])/($time-$cache['start_time'])); ++ $insert_rate = sprintf("%.2f",($cache['num_inserts'])/($time-$cache['start_time'])); ++ $req_rate_user = sprintf("%.2f",($cache_user['num_hits']+$cache_user['num_misses'])/($time-$cache_user['start_time'])); ++ $hit_rate_user = sprintf("%.2f",($cache_user['num_hits'])/($time-$cache_user['start_time'])); ++ $miss_rate_user = sprintf("%.2f",($cache_user['num_misses'])/($time-$cache_user['start_time'])); ++ $insert_rate_user = sprintf("%.2f",($cache_user['num_inserts'])/($time-$cache_user['start_time'])); ++ $apcversion = phpversion('apc'); ++ $phpversion = phpversion(); ++ $number_files = $cache['num_entries']; ++ $size_files = bsize($cache['mem_size']); ++ $number_vars = $cache_user['num_entries']; ++ $size_vars = bsize($cache_user['mem_size']); ++ $i=0; ++ echo <<< EOB ++

    General Cache Information

    ++ ++ ++ ++EOB; ++ ++ if(!empty($_SERVER['SERVER_NAME'])) ++ echo "\n"; ++ if(!empty($_SERVER['SERVER_SOFTWARE'])) ++ echo "\n"; ++ ++ echo << ++EOB; ++ echo ''; ++ echo ''; ++ echo ''; ++ echo <<
    APC Version$apcversion
    PHP Version$phpversion
    APC Host{$_SERVER['SERVER_NAME']} $host
    Server Software{$_SERVER['SERVER_SOFTWARE']}
    Shared Memory{$mem['num_seg']} Segment(s) with $seg_size ++
    ({$cache['memory_type']} memory, {$cache['locking_type']} locking) ++
    Start Time',date(DATE_FORMAT,$cache['start_time']),'
    Uptime',duration($cache['start_time']),'
    File Upload Support',$cache['file_upload_progress'],'
    ++
    ++ ++

    File Cache Information

    ++ ++ ++ ++ ++ ++ ++ ++ ++ ++
    Cached Files$number_files ($size_files)
    Hits{$cache['num_hits']}
    Misses{$cache['num_misses']}
    Request Rate (hits, misses)$req_rate cache requests/second
    Hit Rate$hit_rate cache requests/second
    Miss Rate$miss_rate cache requests/second
    Insert Rate$insert_rate cache requests/second
    Cache full count{$cache['expunges']}
    ++
    ++ ++

    User Cache Information

    ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++
    Cached Variables$number_vars ($size_vars)
    Hits{$cache_user['num_hits']}
    Misses{$cache_user['num_misses']}
    Request Rate (hits, misses)$req_rate_user cache requests/second
    Hit Rate$hit_rate_user cache requests/second
    Miss Rate$miss_rate_user cache requests/second
    Insert Rate$insert_rate_user cache requests/second
    Cache full count{$cache_user['expunges']}
    ++
    ++ ++

    Runtime Settings

    ++EOB; ++ ++ $j = 0; ++ foreach (ini_get_all('apc') as $k => $v) { ++ echo "\n"; ++ $j = 1 - $j; ++ } ++ ++ if($mem['num_seg']>1 || $mem['num_seg']==1 && count($mem['block_lists'][0])>1) ++ $mem_note = "Memory Usage
    (multiple slices indicate fragments)"; ++ else ++ $mem_note = "Memory Usage"; ++ ++ echo <<< EOB ++
    ",$k,"",str_replace(',',',
    ',$v['local_value']),"
    ++
    ++ ++

    Host Status Diagrams

    ++ ++EOB; ++ $size='width='.(GRAPH_SIZE+50).' height='.(GRAPH_SIZE+10); ++ echo << ++ ++ ++ ++EOB; ++ ++ echo ++ graphics_avail() ? ++ ''. ++ "". ++ "\n" ++ : "", ++ '', ++ '\n", ++ '\n", ++ '', ++ '', ++ '\n", ++ '\n"; ++ echo <<< EOB ++ ++
    $mem_noteHits & Misses
    \"\"\"\"
     Free: ',bsize($mem_avail).sprintf(" (%.1f%%)",$mem_avail*100/$mem_size)," Hits: ',$cache['num_hits'].sprintf(" (%.1f%%)",$cache['num_hits']*100/($cache['num_hits']+$cache['num_misses'])),"
     Used: ',bsize($mem_used ).sprintf(" (%.1f%%)",$mem_used *100/$mem_size)," Misses: ',$cache['num_misses'].sprintf(" (%.1f%%)",$cache['num_misses']*100/($cache['num_hits']+$cache['num_misses'])),"
    ++ ++
    ++

    Detailed Memory Usage and Fragmentation

    ++ ++ ++ ++ ++EOB; ++ if(isset($mem['adist'])) { ++ foreach($mem['adist'] as $i=>$v) { ++ $cur = pow(2,$i); $nxt = pow(2,$i+1)-1; ++ if($i==0) $range = "1"; ++ else $range = "$cur - $nxt"; ++ echo "\n"; ++ } ++ } ++ echo <<

    ++EOB; ++ ++ // Fragementation: (freeseg - 1) / total_seg ++ $nseg = $freeseg = $fragsize = $freetotal = 0; ++ for($i=0; $i<$mem['num_seg']; $i++) { ++ $ptr = 0; ++ foreach($mem['block_lists'][$i] as $block) { ++ if ($block['offset'] != $ptr) { ++ ++$nseg; ++ } ++ $ptr = $block['offset'] + $block['size']; ++ /* Only consider blocks <5M for the fragmentation % */ ++ if($block['size']<(5*1024*1024)) $fragsize+=$block['size']; ++ $freetotal+=$block['size']; ++ } ++ $freeseg += count($mem['block_lists'][$i]); ++ } ++ ++ if ($freeseg > 1) { ++ $frag = sprintf("%.2f%% (%s out of %s in %d fragments)", ($fragsize/$freetotal)*100,bsize($fragsize),bsize($freetotal),$freeseg); ++ } else { ++ $frag = "0%"; ++ } ++ ++ if (graphics_avail()) { ++ $size='width='.(2*GRAPH_SIZE+150).' height='.(GRAPH_SIZE+10); ++ echo << ++EOB; ++ } ++ echo <<Fragmentation: $frag ++
    $range$v
    ++
    ++EOB; ++ ++ break; ++ ++ ++// ----------------------------------------------- ++// User Cache Entries ++// ----------------------------------------------- ++case OB_USER_CACHE: ++ if (!$AUTHENTICATED) { ++ echo '
    You need to login to see the user values here!
     
    '; ++ put_login_link("Login now!"); ++ echo '
    '; ++ break; ++ } ++ $fieldname='info'; ++ $fieldheading='User Entry Label'; ++ $fieldkey='info'; ++ ++// ----------------------------------------------- ++// System Cache Entries ++// ----------------------------------------------- ++case OB_SYS_CACHE: ++ if (!isset($fieldname)) ++ { ++ $fieldname='filename'; ++ $fieldheading='Script Filename'; ++ if(ini_get("apc.stat")) $fieldkey='inode'; ++ else $fieldkey='filename'; ++ } ++ if (!empty($MYREQUEST['SH'])) ++ { ++ echo <<< EOB ++
    ++ ++EOB; ++ ++ $m=0; ++ foreach($scope_list as $j => $list) { ++ foreach($cache[$list] as $i => $entry) { ++ if (md5($entry[$fieldkey])!=$MYREQUEST['SH']) continue; ++ foreach($entry as $k => $value) { ++ if (!$AUTHENTICATED) { ++ // hide all path entries if not logged in ++ $value=preg_replace('/^.*(\\/|\\\\)/','<hidden>/',$value); ++ } ++ ++ if ($k == "num_hits") { ++ $value=sprintf("%s (%.2f%%)",$value,$value*100/$cache['num_hits']); ++ } ++ if ($k == 'deletion_time') { ++ if(!$entry['deletion_time']) $value = "None"; ++ } ++ echo ++ "", ++ "", ++ "", ++ ""; ++ $m=1-$m; ++ } ++ if($fieldkey=='info') { ++ echo "\n"; ++ } ++ break; ++ } ++ } ++ ++ echo <<
    AttributeValue
    ",ucwords(preg_replace("/_/"," ",$k)),"",(preg_match("/time/",$k) && $value!='None') ? date(DATE_FORMAT,$value) : htmlspecialchars($value, ENT_QUOTES, 'UTF-8'),"
    Stored Value
    ";
    ++					$output = var_export(apc_fetch($entry[$fieldkey]),true);
    ++					echo htmlspecialchars($output, ENT_QUOTES, 'UTF-8');
    ++					echo "
    ++
    ++EOB; ++ break; ++ } ++ ++ $cols=6; ++ echo <<
    Scope: ++ ++ ", ++ ", Sorting:', ++ '', ++ '', ++ '  Search: ', ++ ' ', ++ '
    '; ++ ++ if (isset($MYREQUEST['SEARCH'])) { ++ // Don't use preg_quote because we want the user to be able to specify a ++ // regular expression subpattern. ++ $MYREQUEST['SEARCH'] = '/'.str_replace('/', '\\/', $MYREQUEST['SEARCH']).'/i'; ++ if (preg_match($MYREQUEST['SEARCH'], 'test') === false) { ++ echo '
    Error: enter a valid regular expression as a search query.
    '; ++ break; ++ } ++ } ++ ++ echo ++ '
    ', ++ '', ++ '', ++ '', ++ '', ++ '', ++ '', ++ ''; ++ ++ if($fieldname=='info') { ++ $cols+=2; ++ echo ''; ++ } ++ echo ''; ++ ++ // builds list with alpha numeric sortable keys ++ // ++ $list = array(); ++ foreach($cache[$scope_list[$MYREQUEST['SCOPE']]] as $i => $entry) { ++ switch($MYREQUEST['SORT1']) { ++ case 'A': $k=sprintf('%015d-',$entry['access_time']); break; ++ case 'H': $k=sprintf('%015d-',$entry['num_hits']); break; ++ case 'Z': $k=sprintf('%015d-',$entry['mem_size']); break; ++ case 'M': $k=sprintf('%015d-',$entry['mtime']); break; ++ case 'C': $k=sprintf('%015d-',$entry['creation_time']); break; ++ case 'T': $k=sprintf('%015d-',$entry['ttl']); break; ++ case 'D': $k=sprintf('%015d-',$entry['deletion_time']); break; ++ case 'S': $k=''; break; ++ } ++ if (!$AUTHENTICATED) { ++ // hide all path entries if not logged in ++ $list[$k.$entry[$fieldname]]=preg_replace('/^.*(\\/|\\\\)/','*hidden*/',$entry); ++ } else { ++ $list[$k.$entry[$fieldname]]=$entry; ++ } ++ } ++ ++ if ($list) { ++ ++ // sort list ++ // ++ switch ($MYREQUEST['SORT2']) { ++ case "A": krsort($list); break; ++ case "D": ksort($list); break; ++ } ++ ++ // output list ++ $i=0; ++ foreach($list as $k => $entry) { ++ if(!$MYREQUEST['SEARCH'] || preg_match($MYREQUEST['SEARCH'], $entry[$fieldname]) != 0) { ++ $field_value = htmlentities(strip_tags($entry[$fieldname],''), ENT_QUOTES, 'UTF-8'); ++ echo ++ '', ++ "', ++ '', ++ '', ++ '', ++ '', ++ ''; ++ ++ if($fieldname=='info') { ++ if($entry['ttl']) ++ echo ''; ++ else ++ echo ''; ++ } ++ if ($entry['deletion_time']) { ++ ++ echo ''; ++ } else if ($MYREQUEST['OB'] == OB_USER_CACHE) { ++ ++ echo ''; ++ } else { ++ echo ''; ++ } ++ echo ''; ++ $i++; ++ if ($i == $MYREQUEST['COUNT']) ++ break; ++ } ++ } ++ ++ } else { ++ echo ''; ++ } ++ echo <<< EOB ++
    ',sortheader('S',$fieldheading, "&OB=".$MYREQUEST['OB']),'',sortheader('H','Hits', "&OB=".$MYREQUEST['OB']),'',sortheader('Z','Size', "&OB=".$MYREQUEST['OB']),'',sortheader('A','Last accessed',"&OB=".$MYREQUEST['OB']),'',sortheader('M','Last modified',"&OB=".$MYREQUEST['OB']),'',sortheader('C','Created at', "&OB=".$MYREQUEST['OB']),'',sortheader('T','Timeout',"&OB=".$MYREQUEST['OB']),'',sortheader('D','Deleted at',"&OB=".$MYREQUEST['OB']),'
    ",$field_value,'',$entry['num_hits'],'',$entry['mem_size'],'',date(DATE_FORMAT,$entry['access_time']),'',date(DATE_FORMAT,$entry['mtime']),'',date(DATE_FORMAT,$entry['creation_time']),''.$entry['ttl'].' secondsNone', date(DATE_FORMAT,$entry['deletion_time']), ''; ++ echo '[Delete Now]'; ++ echo '  
    No data
    ++EOB; ++ ++ if ($list && $i < count($list)) { ++ echo "",count($list)-$i,' more available...'; ++ } ++ ++ echo <<< EOB ++
    ++EOB; ++ break; ++ ++ ++// ----------------------------------------------- ++// Per-Directory System Cache Entries ++// ----------------------------------------------- ++case OB_SYS_CACHE_DIR: ++ if (!$AUTHENTICATED) { ++ break; ++ } ++ ++ echo <<
    Scope: ++ ++ ", ++ ", Sorting:', ++ '', ++ '', ++ ", Group By Dir Level:', ++ ' ', ++ '
    ', ++ ++ '
    ', ++ '', ++ '', ++ '', ++ '', ++ '', ++ '', ++ '', ++ ''; ++ ++ // builds list with alpha numeric sortable keys ++ // ++ $tmp = $list = array(); ++ foreach($cache[$scope_list[$MYREQUEST['SCOPE']]] as $entry) { ++ $n = dirname($entry['filename']); ++ if ($MYREQUEST['AGGR'] > 0) { ++ $n = preg_replace("!^(/?(?:[^/\\\\]+[/\\\\]){".($MYREQUEST['AGGR']-1)."}[^/\\\\]*).*!", "$1", $n); ++ } ++ if (!isset($tmp[$n])) { ++ $tmp[$n] = array('hits'=>0,'size'=>0,'ents'=>0); ++ } ++ $tmp[$n]['hits'] += $entry['num_hits']; ++ $tmp[$n]['size'] += $entry['mem_size']; ++ ++$tmp[$n]['ents']; ++ } ++ ++ foreach ($tmp as $k => $v) { ++ switch($MYREQUEST['SORT1']) { ++ case 'A': $kn=sprintf('%015d-',$v['size'] / $v['ents']);break; ++ case 'T': $kn=sprintf('%015d-',$v['ents']); break; ++ case 'H': $kn=sprintf('%015d-',$v['hits']); break; ++ case 'Z': $kn=sprintf('%015d-',$v['size']); break; ++ case 'C': $kn=sprintf('%015d-',$v['hits'] / $v['ents']);break; ++ case 'S': $kn = $k; break; ++ } ++ $list[$kn.$k] = array($k, $v['ents'], $v['hits'], $v['size']); ++ } ++ ++ if ($list) { ++ ++ // sort list ++ // ++ switch ($MYREQUEST['SORT2']) { ++ case "A": krsort($list); break; ++ case "D": ksort($list); break; ++ } ++ ++ // output list ++ $i = 0; ++ foreach($list as $entry) { ++ echo ++ '', ++ "', ++ '', ++ '', ++ '', ++ '', ++ '', ++ ''; ++ ++ if (++$i == $MYREQUEST['COUNT']) break; ++ } ++ ++ } else { ++ echo ''; ++ } ++ echo <<< EOB ++
    ',sortheader('S','Directory Name', "&OB=".$MYREQUEST['OB']),'',sortheader('T','Number of Files',"&OB=".$MYREQUEST['OB']),'',sortheader('H','Total Hits', "&OB=".$MYREQUEST['OB']),'',sortheader('Z','Total Size', "&OB=".$MYREQUEST['OB']),'',sortheader('C','Avg. Hits', "&OB=".$MYREQUEST['OB']),'',sortheader('A','Avg. Size', "&OB=".$MYREQUEST['OB']),'
    ",$entry[0],'',$entry[1],'',$entry[2],'',$entry[3],'',round($entry[2] / $entry[1]),'',round($entry[3] / $entry[1]),'
    No data
    ++EOB; ++ ++ if ($list && $i < count($list)) { ++ echo "",count($list)-$i,' more available...'; ++ } ++ ++ echo <<< EOB ++
    ++EOB; ++ break; ++ ++// ----------------------------------------------- ++// Version check ++// ----------------------------------------------- ++case OB_VERSION_CHECK: ++ echo <<

    APC Version Information

    ++ ++ ++ ++ ++EOB; ++ if (defined('PROXY')) { ++ $ctxt = stream_context_create( array( 'http' => array( 'proxy' => PROXY, 'request_fulluri' => True ) ) ); ++ $rss = @file_get_contents("http://pecl.php.net/feeds/pkg_apc.rss", False, $ctxt); ++ } else { ++ $rss = @file_get_contents("http://pecl.php.net/feeds/pkg_apc.rss"); ++ } ++ if (!$rss) { ++ echo ''; ++ } else { ++ $apcversion = phpversion('apc'); ++ ++ preg_match('!APC ([0-9.]+)!', $rss, $match); ++ echo ''; ++ echo ''; ++ } ++ echo <<< EOB ++
    Unable to fetch version information.
    '; ++ if (version_compare($apcversion, $match[1], '>=')) { ++ echo '
    You are running the latest version of APC ('.$apcversion.')
    '; ++ $i = 3; ++ } else { ++ echo '
    You are running an older version of APC ('.$apcversion.'), ++ newer version '.$match[1].' is available at ++ http://pecl.php.net/package/APC/'.$match[1].' ++
    '; ++ $i = -1; ++ } ++ echo '

    Change Log:


    '; ++ ++ preg_match_all('!<(title|description)>([^<]+)!', $rss, $match); ++ next($match[2]); next($match[2]); ++ ++ while (list(,$v) = each($match[2])) { ++ list(,$ver) = explode(' ', $v, 2); ++ if ($i < 0 && version_compare($apcversion, $ver, '>=')) { ++ break; ++ } else if (!$i--) { ++ break; ++ } ++ echo "".htmlspecialchars($v, ENT_QUOTES, 'UTF-8')."
    "; ++ echo nl2br(htmlspecialchars(current($match[2]), ENT_QUOTES, 'UTF-8'))."
    "; ++ next($match[2]); ++ } ++ echo '
    ++ ++EOB; ++ break; ++ ++} ++ ++echo <<< EOB ++ ++EOB; ++ ++?> ++ ++ ++ ++ +diff -Naur a/ext/apc/apc_php.h b/ext/apc/apc_php.h +--- a/ext/apc/apc_php.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_php.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,81 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | George Schlossnagle | ++ | Rasmus Lerdorf | ++ | Arun C. Murthy | ++ | Gopal Vijayaraghavan | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_php.h 313808 2011-07-28 06:17:10Z gopalv $ */ ++ ++#ifndef APC_PHP_H ++#define APC_PHP_H ++ ++/* ++ * The purpose of this header file is to include all PHP and Zend headers that ++ * are typically needed elsewhere in APC. This makes it easy to insure that ++ * all required headers are available. ++ */ ++ ++#include "php.h" ++#include "zend.h" ++#include "zend_API.h" ++#include "zend_compile.h" ++#include "zend_hash.h" ++#include "zend_extensions.h" ++ ++#if ZEND_MODULE_API_NO >= 20100409 ++#define ZEND_ENGINE_2_4 ++#endif ++#if ZEND_MODULE_API_NO > 20060613 ++#define ZEND_ENGINE_2_3 ++#endif ++#if ZEND_MODULE_API_NO > 20050922 ++#define ZEND_ENGINE_2_2 ++#endif ++#if ZEND_MODULE_API_NO > 20050921 ++#define ZEND_ENGINE_2_1 ++#endif ++#ifdef ZEND_ENGINE_2_1 ++#include "zend_vm.h" ++#endif ++ ++#ifndef IS_CONSTANT_TYPE_MASK ++#define IS_CONSTANT_TYPE_MASK (~IS_CONSTANT_INDEX) ++#endif ++ ++#include "rfc1867.h" ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_php_pcre.h b/ext/apc/apc_php_pcre.h +--- a/ext/apc/apc_php_pcre.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_php_pcre.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,98 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC/PHP Version 5 | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 1997-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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: Andrei Zmievski | ++ +----------------------------------------------------------------------+ ++ */ ++ ++/* $Id: apc_php_pcre.h 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#ifndef PHP_PCRE_H ++#define PHP_PCRE_H ++ ++#if HAVE_PCRE || HAVE_BUNDLED_PCRE ++ ++#if HAVE_BUNDLED_PCRE ++#include "ext/pcre/pcrelib/pcre.h" ++#else ++#include "pcre.h" ++#endif ++ ++#if HAVE_LOCALE_H ++#include ++#endif ++ ++PHP_FUNCTION(preg_match); ++PHP_FUNCTION(preg_match_all); ++PHP_FUNCTION(preg_replace); ++PHP_FUNCTION(preg_replace_callback); ++PHP_FUNCTION(preg_split); ++PHP_FUNCTION(preg_quote); ++PHP_FUNCTION(preg_grep); ++ ++PHPAPI char *php_pcre_replace(char *regex, int regex_len, char *subject, int subject_len, zval *replace_val, int is_callable_replace, int *result_len, int limit, int *replace_count TSRMLS_DC); ++PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *options TSRMLS_DC); ++PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *preg_options, int *coptions TSRMLS_DC); ++ ++extern zend_module_entry pcre_module_entry; ++#define pcre_module_ptr &pcre_module_entry ++ ++typedef struct { ++ pcre *re; ++ pcre_extra *extra; ++ int preg_options; ++#if HAVE_SETLOCALE ++ char *locale; ++ unsigned const char *tables; ++#endif ++ int compile_options; ++ int refcount; ++} pcre_cache_entry; ++ ++PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_len TSRMLS_DC); ++ ++PHPAPI void php_pcre_match_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value, ++ zval *subpats, int global, int use_flags, long flags, long start_offset TSRMLS_DC); ++ ++PHPAPI char *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value, ++ int is_callable_replace, int *result_len, int limit, int *replace_count TSRMLS_DC); ++ ++PHPAPI void php_pcre_split_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value, ++ long limit_val, long flags TSRMLS_DC); ++ ++PHPAPI void php_pcre_grep_impl( pcre_cache_entry *pce, zval *input, zval *return_value, ++ long flags TSRMLS_DC); ++ ++ZEND_BEGIN_MODULE_GLOBALS(pcre) ++ HashTable pcre_cache; ++ long backtrack_limit; ++ long recursion_limit; ++ int error_code; ++ZEND_END_MODULE_GLOBALS(pcre) ++ ++#ifdef ZTS ++# define PCRE_G(v) TSRMG(pcre_globals_id, zend_pcre_globals *, v) ++#else ++# define PCRE_G(v) (pcre_globals.v) ++#endif ++ ++#else ++ ++#define pcre_module_ptr NULL ++ ++#endif /* HAVE_PCRE || HAVE_BUNDLED_PCRE */ ++ ++#define phpext_pcre_ptr pcre_module_ptr ++ ++#endif /* PHP_PCRE_H */ +diff -Naur a/ext/apc/apc_pool.c b/ext/apc/apc_pool.c +--- a/ext/apc/apc_pool.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_pool.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,507 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Gopal Vijayaraghavan | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Yahoo! Inc. in 2008. ++ ++ Future revisions and derivatives of this source code must acknowledge ++ Yahoo! Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_pool.c 307555 2011-01-18 07:17:21Z gopalv $ */ ++ ++ ++#include "apc_pool.h" ++#include ++ ++#ifdef HAVE_VALGRIND_MEMCHECK_H ++#include ++#endif ++ ++ ++/* {{{ forward references */ ++static apc_pool* apc_unpool_create(apc_pool_type type, apc_malloc_t, apc_free_t, apc_protect_t, apc_unprotect_t TSRMLS_DC); ++static apc_pool* apc_realpool_create(apc_pool_type type, apc_malloc_t, apc_free_t, apc_protect_t, apc_unprotect_t TSRMLS_DC); ++/* }}} */ ++ ++/* {{{ apc_pool_create */ ++apc_pool* apc_pool_create(apc_pool_type pool_type, ++ apc_malloc_t allocate, ++ apc_free_t deallocate, ++ apc_protect_t protect, ++ apc_unprotect_t unprotect ++ TSRMLS_DC) ++{ ++ if(pool_type == APC_UNPOOL) { ++ return apc_unpool_create(pool_type, allocate, deallocate, ++ protect, unprotect TSRMLS_CC); ++ } ++ ++ return apc_realpool_create(pool_type, allocate, deallocate, ++ protect, unprotect TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ apc_pool_destroy */ ++void apc_pool_destroy(apc_pool *pool TSRMLS_DC) ++{ ++ apc_free_t deallocate = pool->deallocate; ++ apc_pcleanup_t cleanup = pool->cleanup; ++ ++ cleanup(pool TSRMLS_CC); ++ deallocate(pool TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ apc_unpool implementation */ ++ ++typedef struct _apc_unpool apc_unpool; ++ ++struct _apc_unpool { ++ apc_pool parent; ++ /* apc_unpool is a lie! */ ++}; ++ ++static void* apc_unpool_alloc(apc_pool* pool, size_t size TSRMLS_DC) ++{ ++ apc_unpool *upool = (apc_unpool*)pool; ++ ++ apc_malloc_t allocate = upool->parent.allocate; ++ ++ upool->parent.size += size; ++ upool->parent.used += size; ++ ++ return allocate(size TSRMLS_CC); ++} ++ ++static void apc_unpool_free(apc_pool* pool, void *ptr TSRMLS_DC) ++{ ++ apc_unpool *upool = (apc_unpool*) pool; ++ ++ apc_free_t deallocate = upool->parent.deallocate; ++ ++ deallocate(ptr TSRMLS_CC); ++} ++ ++static void apc_unpool_cleanup(apc_pool* pool TSRMLS_DC) ++{ ++} ++ ++static apc_pool* apc_unpool_create(apc_pool_type type, ++ apc_malloc_t allocate, apc_free_t deallocate, ++ apc_protect_t protect, apc_unprotect_t unprotect ++ TSRMLS_DC) ++{ ++ apc_unpool* upool = allocate(sizeof(apc_unpool) TSRMLS_CC); ++ ++ if (!upool) { ++ return NULL; ++ } ++ ++ upool->parent.type = type; ++ upool->parent.allocate = allocate; ++ upool->parent.deallocate = deallocate; ++ ++ upool->parent.protect = protect; ++ upool->parent.unprotect = unprotect; ++ ++ upool->parent.palloc = apc_unpool_alloc; ++ upool->parent.pfree = apc_unpool_free; ++ ++ upool->parent.cleanup = apc_unpool_cleanup; ++ ++ upool->parent.used = 0; ++ upool->parent.size = 0; ++ ++ return &(upool->parent); ++} ++/* }}} */ ++ ++ ++/*{{{ apc_realpool implementation */ ++ ++/* {{{ typedefs */ ++typedef struct _pool_block ++{ ++ size_t avail; ++ size_t capacity; ++ unsigned char *mark; ++ struct _pool_block *next; ++ unsigned :0; /* this should align to word */ ++ /* data comes here */ ++}pool_block; ++ ++/* ++ parts in ? are optional and turned on for fun, memory loss, ++ and for something else that I forgot about ... ah, debugging ++ ++ |--------> data[] |<-- non word boundary (too) ++ +-------------+--------------+-----------+-------------+-------------->>> ++ | pool_block | ?sizeinfo<1> | block<1> | ?redzone<1> | ?sizeinfo<2> ++ | | (size_t) | | padded left | ++ +-------------+--------------+-----------+-------------+-------------->>> ++ */ ++ ++typedef struct _apc_realpool apc_realpool; ++ ++struct _apc_realpool ++{ ++ struct _apc_pool parent; ++ ++ size_t dsize; ++ void *owner; ++ ++ unsigned long count; ++ ++ pool_block *head; ++ pool_block first; ++}; ++ ++/* }}} */ ++ ++/* {{{ redzone code */ ++static const unsigned char decaff[] = { ++ 0xde, 0xca, 0xff, 0xc0, 0xff, 0xee, 0xba, 0xad, ++ 0xde, 0xca, 0xff, 0xc0, 0xff, 0xee, 0xba, 0xad, ++ 0xde, 0xca, 0xff, 0xc0, 0xff, 0xee, 0xba, 0xad, ++ 0xde, 0xca, 0xff, 0xc0, 0xff, 0xee, 0xba, 0xad ++}; ++ ++/* a redzone is at least 4 (0xde,0xca,0xc0,0xff) bytes */ ++#define REDZONE_SIZE(size) \ ++ ((ALIGNWORD((size)) > ((size) + 4)) ? \ ++ (ALIGNWORD((size)) - (size)) : /* does not change realsize */\ ++ ALIGNWORD((size)) - (size) + ALIGNWORD((sizeof(char)))) /* adds 1 word to realsize */ ++ ++#define SIZEINFO_SIZE ALIGNWORD(sizeof(size_t)) ++ ++#define MARK_REDZONE(block, redsize) do {\ ++ memcpy(block, decaff, redsize );\ ++ } while(0) ++ ++#define CHECK_REDZONE(block, redsize) (memcmp(block, decaff, redsize) == 0) ++ ++/* }}} */ ++ ++#define INIT_POOL_BLOCK(rpool, entry, size) do {\ ++ (entry)->avail = (entry)->capacity = (size);\ ++ (entry)->mark = ((unsigned char*)(entry)) + ALIGNWORD(sizeof(pool_block));\ ++ (entry)->next = (rpool)->head;\ ++ (rpool)->head = (entry);\ ++} while(0) ++ ++/* {{{ create_pool_block */ ++static pool_block* create_pool_block(apc_realpool *rpool, size_t size TSRMLS_DC) ++{ ++ apc_malloc_t allocate = rpool->parent.allocate; ++ ++ size_t realsize = sizeof(pool_block) + ALIGNWORD(size); ++ ++ pool_block* entry = allocate(realsize TSRMLS_CC); ++ ++ if (!entry) { ++ return NULL; ++ } ++ ++ INIT_POOL_BLOCK(rpool, entry, size); ++ ++ rpool->parent.size += realsize; ++ ++ rpool->count++; ++ ++ return entry; ++} ++/* }}} */ ++ ++/* {{{ apc_realpool_alloc */ ++static void* apc_realpool_alloc(apc_pool *pool, size_t size TSRMLS_DC) ++{ ++ apc_realpool *rpool = (apc_realpool*)pool; ++ unsigned char *p = NULL; ++ size_t realsize = ALIGNWORD(size); ++ size_t poolsize; ++ unsigned char *redzone = NULL; ++ size_t redsize = 0; ++ size_t *sizeinfo= NULL; ++ pool_block *entry = NULL; ++ unsigned long i; ++ ++ if(APC_POOL_HAS_REDZONES(pool)) { ++ redsize = REDZONE_SIZE(size); /* redsize might be re-using word size padding */ ++ realsize = size + redsize; /* recalculating realsize */ ++ } else { ++ redsize = realsize - size; /* use padding space */ ++ } ++ ++ if(APC_POOL_HAS_SIZEINFO(pool)) { ++ realsize += ALIGNWORD(sizeof(size_t)); ++ } ++ ++ /* minimize look-back, a value of 8 seems to give similar fill-ratios (+2%) ++ * as looping through the entire list. And much faster in allocations. */ ++ for(entry = rpool->head, i = 0; entry != NULL && (i < 8); entry = entry->next, i++) { ++ if(entry->avail >= realsize) { ++ goto found; ++ } ++ } ++ ++ /* upgrade the pool type to reduce overhead */ ++ if(rpool->count > 4 && rpool->dsize < 4096) { ++ rpool->dsize = 4096; ++ } else if(rpool->count > 8 && rpool->dsize < 8192) { ++ rpool->dsize = 8192; ++ } ++ ++ poolsize = ALIGNSIZE(realsize, rpool->dsize); ++ ++ entry = create_pool_block(rpool, poolsize TSRMLS_CC); ++ ++ if(!entry) { ++ return NULL; ++ } ++ ++found: ++ p = entry->mark; ++ ++ if(APC_POOL_HAS_SIZEINFO(pool)) { ++ sizeinfo = (size_t*)p; ++ p += SIZEINFO_SIZE; ++ *sizeinfo = size; ++ } ++ ++ redzone = p + size; ++ ++ if(APC_POOL_HAS_REDZONES(pool)) { ++ MARK_REDZONE(redzone, redsize); ++ } ++ ++#ifdef VALGRIND_MAKE_MEM_NOACCESS ++ if(redsize != 0) { ++ VALGRIND_MAKE_MEM_NOACCESS(redzone, redsize); ++ } ++#endif ++ ++ entry->avail -= realsize; ++ entry->mark += realsize; ++ pool->used += realsize; ++ ++#ifdef VALGRIND_MAKE_MEM_UNDEFINED ++ /* need to write before reading data off this */ ++ VALGRIND_MAKE_MEM_UNDEFINED(p, size); ++#endif ++ ++ return (void*)p; ++} ++/* }}} */ ++ ++/* {{{ apc_realpool_check_integrity */ ++/* ++ * Checking integrity at runtime, does an ++ * overwrite check only when the sizeinfo ++ * is set. ++ * ++ * Marked as used in gcc, so that this function ++ * is accessible from gdb, eventhough it is never ++ * used in code in non-debug builds. ++ */ ++static APC_USED int apc_realpool_check_integrity(apc_realpool *rpool) ++{ ++ apc_pool *pool = &(rpool->parent); ++ pool_block *entry; ++ size_t *sizeinfo = NULL; ++ unsigned char *start; ++ size_t realsize; ++ unsigned char *redzone; ++ size_t redsize; ++ ++ for(entry = rpool->head; entry != NULL; entry = entry->next) { ++ start = (unsigned char *)entry + ALIGNWORD(sizeof(pool_block)); ++ if((entry->mark - start) != (entry->capacity - entry->avail)) { ++ return 0; ++ } ++ } ++ ++ if(!APC_POOL_HAS_REDZONES(pool) || ++ !APC_POOL_HAS_SIZEINFO(pool)) { ++ (void)pool; /* remove unused warning */ ++ return 1; ++ } ++ ++ for(entry = rpool->head; entry != NULL; entry = entry->next) { ++ start = (unsigned char *)entry + ALIGNWORD(sizeof(pool_block)); ++ ++ while(start < entry->mark) { ++ sizeinfo = (size_t*)start; ++ /* redzone starts where real data ends, in a non-word boundary ++ * redsize is at least 4 bytes + whatever's needed to make it ++ * to another word boundary. ++ */ ++ redzone = start + SIZEINFO_SIZE + (*sizeinfo); ++ redsize = REDZONE_SIZE(*sizeinfo); ++#ifdef VALGRIND_MAKE_MEM_DEFINED ++ VALGRIND_MAKE_MEM_DEFINED(redzone, redsize); ++#endif ++ if(!CHECK_REDZONE(redzone, redsize)) ++ { ++ /* ++ fprintf(stderr, "Redzone check failed for %p\n", ++ start + ALIGNWORD(sizeof(size_t)));*/ ++ return 0; ++ } ++#ifdef VALGRIND_MAKE_MEM_NOACCESS ++ VALGRIND_MAKE_MEM_NOACCESS(redzone, redsize); ++#endif ++ realsize = SIZEINFO_SIZE + *sizeinfo + redsize; ++ start += realsize; ++ } ++ } ++ ++ return 1; ++} ++/* }}} */ ++ ++/* {{{ apc_realpool_free */ ++/* ++ * free does not do anything other than ++ * check for redzone values when free'ing ++ * data areas. ++ */ ++static void apc_realpool_free(apc_pool *pool, void *p TSRMLS_DC) ++{ ++} ++/* }}} */ ++ ++static void apc_realpool_cleanup(apc_pool *pool TSRMLS_DC) ++{ ++ pool_block *entry; ++ pool_block *tmp; ++ apc_realpool *rpool = (apc_realpool*)pool; ++ apc_free_t deallocate = pool->deallocate; ++ ++ assert(apc_realpool_check_integrity(rpool)!=0); ++ ++ entry = rpool->head; ++ ++ while(entry->next != NULL) { ++ tmp = entry->next; ++ deallocate(entry TSRMLS_CC); ++ entry = tmp; ++ } ++} ++ ++/* {{{ apc_realpool_create */ ++static apc_pool* apc_realpool_create(apc_pool_type type, apc_malloc_t allocate, apc_free_t deallocate, ++ apc_protect_t protect, apc_unprotect_t unprotect ++ TSRMLS_DC) ++{ ++ ++ size_t dsize = 0; ++ apc_realpool *rpool; ++ ++ switch(type & APC_POOL_SIZE_MASK) { ++ case APC_SMALL_POOL: ++ dsize = 512; ++ break; ++ ++ case APC_LARGE_POOL: ++ dsize = 8192; ++ break; ++ ++ case APC_MEDIUM_POOL: ++ dsize = 4096; ++ break; ++ ++ default: ++ return NULL; ++ } ++ ++ rpool = (apc_realpool*)allocate((sizeof(apc_realpool) + ALIGNWORD(dsize)) TSRMLS_CC); ++ ++ if(!rpool) { ++ return NULL; ++ } ++ ++ rpool->parent.type = type; ++ ++ rpool->parent.allocate = allocate; ++ rpool->parent.deallocate = deallocate; ++ ++ rpool->parent.size = sizeof(apc_realpool) + ALIGNWORD(dsize); ++ ++ rpool->parent.palloc = apc_realpool_alloc; ++ rpool->parent.pfree = apc_realpool_free; ++ ++ rpool->parent.protect = protect; ++ rpool->parent.unprotect = unprotect; ++ ++ rpool->parent.cleanup = apc_realpool_cleanup; ++ ++ rpool->dsize = dsize; ++ rpool->head = NULL; ++ rpool->count = 0; ++ ++ INIT_POOL_BLOCK(rpool, &(rpool->first), dsize); ++ ++ return &(rpool->parent); ++} ++ ++ ++/* }}} */ ++ ++/* {{{ apc_pool_init */ ++void apc_pool_init() ++{ ++ /* put all ye sanity checks here */ ++ assert(sizeof(decaff) > REDZONE_SIZE(ALIGNWORD(sizeof(char)))); ++ assert(sizeof(pool_block) == ALIGNWORD(sizeof(pool_block))); ++#if APC_POOL_DEBUG ++ assert((APC_POOL_SIZE_MASK & (APC_POOL_SIZEINFO | APC_POOL_REDZONES)) == 0); ++#endif ++} ++/* }}} */ ++ ++/* {{{ apc_pstrdup */ ++void* APC_ALLOC apc_pstrdup(const char* s, apc_pool* pool TSRMLS_DC) ++{ ++ return s != NULL ? apc_pmemcpy(s, (strlen(s) + 1), pool TSRMLS_CC) : NULL; ++} ++/* }}} */ ++ ++/* {{{ apc_pmemcpy */ ++void* APC_ALLOC apc_pmemcpy(const void* p, size_t n, apc_pool* pool TSRMLS_DC) ++{ ++ void* q; ++ ++ if (p != NULL && (q = apc_pool_alloc(pool, n)) != NULL) { ++ memcpy(q, p, n); ++ return q; ++ } ++ return NULL; ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_pool.h b/ext/apc/apc_pool.h +--- a/ext/apc/apc_pool.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_pool.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,114 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Gopal Vijayaraghavan | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Yahoo! Inc. in 2008. ++ ++ Future revisions and derivatives of this source code must acknowledge ++ Yahoo! Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_pool.h 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#ifndef APC_POOL_H ++#define APC_POOL_H ++ ++#include "apc.h" ++#include "apc_sma.h" ++ ++/* #define APC_POOL_DEBUG 1 */ ++ ++typedef enum { ++ APC_UNPOOL = 0x0, ++ APC_SMALL_POOL = 0x1, ++ APC_MEDIUM_POOL = 0x2, ++ APC_LARGE_POOL = 0x3, ++ APC_POOL_SIZE_MASK = 0x7, /* waste a bit */ ++#if APC_POOL_DEBUG ++ APC_POOL_REDZONES = 0x08, ++ APC_POOL_SIZEINFO = 0x10, ++ APC_POOL_OPT_MASK = 0x18 ++#endif ++} apc_pool_type; ++ ++#if APC_POOL_DEBUG ++#define APC_POOL_HAS_SIZEINFO(pool) ((pool->type & APC_POOL_SIZEINFO)!=0) ++#define APC_POOL_HAS_REDZONES(pool) ((pool->type & APC_POOL_REDZONES)!=0) ++#else ++/* let gcc optimize away the optional features */ ++#define APC_POOL_HAS_SIZEINFO(pool) (0) ++#define APC_POOL_HAS_REDZONES(pool) (0) ++#endif ++ ++ ++typedef struct _apc_pool apc_pool; ++ ++typedef void (*apc_pcleanup_t)(apc_pool *pool TSRMLS_DC); ++ ++typedef void* (*apc_palloc_t)(apc_pool *pool, size_t size TSRMLS_DC); ++typedef void (*apc_pfree_t) (apc_pool *pool, void* p TSRMLS_DC); ++ ++typedef void* (*apc_protect_t) (void *p); ++typedef void* (*apc_unprotect_t)(void *p); ++ ++struct _apc_pool { ++ apc_pool_type type; ++ ++ apc_malloc_t allocate; ++ apc_free_t deallocate; ++ ++ apc_palloc_t palloc; ++ apc_pfree_t pfree; ++ ++ apc_protect_t protect; ++ apc_unprotect_t unprotect; ++ ++ apc_pcleanup_t cleanup; ++ ++ size_t size; ++ size_t used; ++ ++ /* apc_realpool and apc_unpool add more here */ ++}; ++ ++#define apc_pool_alloc(pool, size) ((void *) pool->palloc(pool, size TSRMLS_CC)) ++#define apc_pool_free(pool, ptr) ((void) pool->pfree (pool, ptr TSRMLS_CC)) ++ ++#define apc_pool_protect(pool, ptr) (pool->protect ? \ ++ (pool)->protect((ptr)) : (ptr)) ++ ++#define apc_pool_unprotect(pool, ptr) (pool->unprotect ? \ ++ (pool)->unprotect((ptr)) : (ptr)) ++ ++extern void apc_pool_init(); ++ ++extern apc_pool* apc_pool_create(apc_pool_type pool_type, ++ apc_malloc_t allocate, ++ apc_free_t deallocate, ++ apc_protect_t protect, ++ apc_unprotect_t unprotect ++ TSRMLS_DC); ++ ++extern void apc_pool_destroy(apc_pool* pool TSRMLS_DC); ++ ++extern void* apc_pmemcpy(const void* p, size_t n, apc_pool* pool TSRMLS_DC); ++extern void* apc_pstrdup(const char* s, apc_pool* pool TSRMLS_DC); ++ ++#endif +diff -Naur a/ext/apc/apc_pthreadmutex.c b/ext/apc/apc_pthreadmutex.c +--- a/ext/apc/apc_pthreadmutex.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_pthreadmutex.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,111 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Brian Shire | ++ +----------------------------------------------------------------------+ ++ ++ */ ++ ++/* $Id: apc_pthreadmutex.c 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#include "apc_pthreadmutex.h" ++ ++#ifdef APC_PTHREADMUTEX_LOCKS ++ ++pthread_mutex_t *apc_pthreadmutex_create(pthread_mutex_t *lock TSRMLS_DC) ++{ ++ int result; ++ pthread_mutexattr_t* attr; ++ attr = malloc(sizeof(pthread_mutexattr_t)); ++ ++ result = pthread_mutexattr_init(attr); ++ if(result == ENOMEM) { ++ apc_error("pthread mutex error: Insufficient memory exists to create the mutex attribute object." TSRMLS_CC); ++ } else if(result == EINVAL) { ++ apc_error("pthread mutex error: attr does not point to writeable memory." TSRMLS_CC); ++ } else if(result == EFAULT) { ++ apc_error("pthread mutex error: attr is an invalid pointer." TSRMLS_CC); ++ } ++ ++#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP ++ result = pthread_mutexattr_settype(attr, PTHREAD_MUTEX_ADAPTIVE_NP); ++ if (result == EINVAL) { ++ apc_error("pthread_mutexattr_settype: unable to set adaptive mutexes" TSRMLS_CC); ++ } ++#endif ++ ++ /* pthread_mutexattr_settype(attr, PTHREAD_MUTEX_ERRORCHECK); */ ++ result = pthread_mutexattr_setpshared(attr, PTHREAD_PROCESS_SHARED); ++ if(result == EINVAL) { ++ apc_error("pthread mutex error: attr is not an initialized mutex attribute object, or pshared is not a valid process-shared state setting." TSRMLS_CC); ++ } else if(result == EFAULT) { ++ apc_error("pthread mutex error: attr is an invalid pointer." TSRMLS_CC); ++ } else if(result == ENOTSUP) { ++ apc_error("pthread mutex error: pshared was set to PTHREAD_PROCESS_SHARED." TSRMLS_CC); ++ } ++ ++ if(pthread_mutex_init(lock, attr)) { ++ apc_error("unable to initialize pthread lock" TSRMLS_CC); ++ } ++ return lock; ++} ++ ++void apc_pthreadmutex_destroy(pthread_mutex_t *lock) ++{ ++ return; /* we don't actually destroy the mutex, as it would destroy it for all processes */ ++} ++ ++void apc_pthreadmutex_lock(pthread_mutex_t *lock TSRMLS_DC) ++{ ++ int result; ++ result = pthread_mutex_lock(lock); ++ if(result == EINVAL) { ++ apc_error("unable to obtain pthread lock (EINVAL)" TSRMLS_CC); ++ } else if(result == EDEADLK) { ++ apc_error("unable to obtain pthread lock (EDEADLK)" TSRMLS_CC); ++ } ++} ++ ++void apc_pthreadmutex_unlock(pthread_mutex_t *lock TSRMLS_DC) ++{ ++ if(pthread_mutex_unlock(lock)) { ++ apc_error("unable to unlock pthread lock" TSRMLS_CC); ++ } ++} ++ ++zend_bool apc_pthreadmutex_nonblocking_lock(pthread_mutex_t *lock TSRMLS_DC) ++{ ++ int rval; ++ rval = pthread_mutex_trylock(lock); ++ if(rval == EBUSY) { /* Lock is already held */ ++ return 0; ++ } else if(rval == 0) { /* Obtained lock */ ++ return 1; ++ } else { /* Other error */ ++ apc_error("unable to obtain pthread trylock" TSRMLS_CC); ++ return 0; ++ } ++} ++ ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_pthreadmutex.h b/ext/apc/apc_pthreadmutex.h +--- a/ext/apc/apc_pthreadmutex.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_pthreadmutex.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,48 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Brian Shire | ++ +----------------------------------------------------------------------+ ++ ++ */ ++ ++/* $Id: apc_pthreadmutex.h 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#ifndef APC_PTHREADMUTEX_H ++#define APC_PTHREADMUTEX_H ++ ++#include "apc.h" ++ ++#ifdef APC_PTHREADMUTEX_LOCKS ++ ++#include ++ ++pthread_mutex_t *apc_pthreadmutex_create(pthread_mutex_t *lock TSRMLS_DC); ++void apc_pthreadmutex_destroy(pthread_mutex_t *lock); ++void apc_pthreadmutex_lock(pthread_mutex_t *lock TSRMLS_DC); ++void apc_pthreadmutex_unlock(pthread_mutex_t *lock TSRMLS_DC); ++zend_bool apc_pthreadmutex_nonblocking_lock(pthread_mutex_t *lock TSRMLS_DC); ++ ++#endif ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_pthreadrwlock.c b/ext/apc/apc_pthreadrwlock.c +--- a/ext/apc/apc_pthreadrwlock.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_pthreadrwlock.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,120 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Gopal V | ++ +----------------------------------------------------------------------+ ++ ++ */ ++ ++/* $Id: $ */ ++ ++#include "apc_pthreadrwlock.h" ++ ++#ifdef APC_PTHREADRW_LOCKS ++ ++pthread_rwlock_t *apc_pthreadrwlock_create(pthread_rwlock_t *lock TSRMLS_DC) ++{ ++ int result; ++ pthread_rwlockattr_t attr; ++ ++ result = pthread_rwlockattr_init(&attr); ++ if(result == ENOMEM) { ++ apc_error("pthread rwlock error: Insufficient memory exists to create the rwlock attribute object." TSRMLS_CC); ++ } else if(result == EINVAL) { ++ apc_error("pthread rwlock error: attr does not point to writeable memory." TSRMLS_CC); ++ } else if(result == EFAULT) { ++ apc_error("pthread rwlock error: attr is an invalid pointer." TSRMLS_CC); ++ } ++ ++#ifdef __USE_UNIX98 ++ pthread_rwlockattr_setkind_np(&attr, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); ++#endif ++ ++ result = pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); ++ if(result == EINVAL) { ++ apc_error("pthread rwlock error: attr is not an initialized rwlock attribute object, or pshared is not a valid process-shared state setting." TSRMLS_CC); ++ } else if(result == EFAULT) { ++ apc_error("pthread rwlock error: attr is an invalid pointer." TSRMLS_CC); ++ } else if(result == ENOTSUP) { ++ apc_error("pthread rwlock error: pshared was set to PTHREAD_PROCESS_SHARED." TSRMLS_CC); ++ } ++ ++ if(pthread_rwlock_init(lock, &attr)) { ++ apc_error("unable to initialize pthread rwlock" TSRMLS_CC); ++ } ++ ++ pthread_rwlockattr_destroy(&attr); ++ ++ return lock; ++} ++ ++void apc_pthreadrwlock_destroy(pthread_rwlock_t *lock) ++{ ++ return; /* we don't actually destroy the rwlock, as it would destroy it for all processes */ ++} ++ ++void apc_pthreadrwlock_lock(pthread_rwlock_t *lock TSRMLS_DC) ++{ ++ int result; ++ result = pthread_rwlock_wrlock(lock); ++ if(result == EINVAL) { ++ apc_error("unable to obtain pthread lock (EINVAL)" TSRMLS_CC); ++ } else if(result == EDEADLK) { ++ apc_error("unable to obtain pthread lock (EDEADLK)" TSRMLS_CC); ++ } ++} ++ ++void apc_pthreadrwlock_rdlock(pthread_rwlock_t *lock TSRMLS_DC) ++{ ++ int result; ++ result = pthread_rwlock_rdlock(lock); ++ if(result == EINVAL) { ++ apc_error("unable to obtain pthread lock (EINVAL)" TSRMLS_CC); ++ } else if(result == EDEADLK) { ++ apc_error("unable to obtain pthread lock (EDEADLK)" TSRMLS_CC); ++ } ++} ++ ++void apc_pthreadrwlock_unlock(pthread_rwlock_t *lock TSRMLS_DC) ++{ ++ if(pthread_rwlock_unlock(lock)) { ++ apc_error("unable to unlock pthread lock" TSRMLS_CC); ++ } ++} ++ ++zend_bool apc_pthreadrwlock_nonblocking_lock(pthread_rwlock_t *lock TSRMLS_DC) ++{ ++ int rval; ++ rval = pthread_rwlock_trywrlock(lock); ++ if(rval == EBUSY) { /* Lock is already held */ ++ return 0; ++ } else if(rval == 0) { /* Obtained lock */ ++ return 1; ++ } else { /* Other error */ ++ apc_error("unable to obtain pthread trylock" TSRMLS_CC); ++ return 0; ++ } ++} ++ ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_pthreadrwlock.h b/ext/apc/apc_pthreadrwlock.h +--- a/ext/apc/apc_pthreadrwlock.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_pthreadrwlock.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,49 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Gopal V | ++ +----------------------------------------------------------------------+ ++ ++ */ ++ ++/* $Id: apc_pthreadrwlock.h 302175 2010-08-13 06:20:28Z kalle $ */ ++ ++#ifndef APC_PTHREADRWLOCK_H ++#define APC_PTHREADRWLOCK_H ++ ++#include "apc.h" ++ ++#ifdef APC_PTHREADRW_LOCKS ++ ++#include ++ ++pthread_rwlock_t *apc_pthreadrwlock_create(pthread_rwlock_t *lock TSRMLS_DC); ++void apc_pthreadrwlock_destroy(pthread_rwlock_t *lock); ++void apc_pthreadrwlock_lock(pthread_rwlock_t *lock TSRMLS_DC); ++void apc_pthreadrwlock_rdlock(pthread_rwlock_t *lock TSRMLS_DC); ++void apc_pthreadrwlock_unlock(pthread_rwlock_t *lock TSRMLS_DC); ++zend_bool apc_pthreadrwlock_nonblocking_lock(pthread_rwlock_t *lock TSRMLS_DC); ++ ++#endif ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_rfc1867.c b/ext/apc/apc_rfc1867.c +--- a/ext/apc/apc_rfc1867.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_rfc1867.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,236 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Rasmus Lerdorf | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_rfc1867.c 309694 2011-03-25 18:47:38Z rasmus $*/ ++ ++#include "apc.h" ++#include "apc_globals.h" ++#include "rfc1867.h" ++ ++#ifdef PHP_WIN32 ++#include "win32/time.h" ++#endif ++ ++#ifdef MULTIPART_EVENT_FORMDATA ++extern int _apc_store(char *strkey, int strkey_len, const zval *val, const uint ttl, const int exclusive TSRMLS_DC); ++extern int _apc_update(char *strkey, int strkey_len, apc_cache_updater_t updater, void* data TSRMLS_DC); ++ ++static int update_bytes_processed(apc_cache_t* cache, apc_cache_entry_t* entry, void* data) { ++ int *bytes_ptr = (int*)data; ++ zval* val = entry->data.user.val; ++ ++ if(Z_TYPE_P(val) == IS_ARRAY) { ++ HashTable *ht = val->value.ht; ++ Bucket* curr = NULL; ++ for (curr = ht->pListHead; curr != NULL; curr = curr->pListNext) { ++ if(curr->nKeyLength == 8 && ++ (!memcmp(curr->arKey, "current", curr->nKeyLength))) { ++ zval* current = ((zval**)curr->pData)[0]; ++ current->value.lval = *bytes_ptr; ++ return 1; ++ } ++ } ++ } ++ ++ return 0; ++} ++ ++static double my_time() { ++ struct timeval a; ++ double t; ++ gettimeofday(&a, NULL); ++ t = a.tv_sec + (a.tv_usec/1000000.00); ++ return t; ++} ++ ++ ++#define RFC1867_DATA(name) \ ++ ((request_data)->name) ++ ++int apc_rfc1867_progress(uint event, void *event_data, void **extra TSRMLS_DC) { ++ apc_rfc1867_data *request_data = &APCG(rfc1867_data); ++ zval *track = NULL; ++ ++ switch (event) { ++ case MULTIPART_EVENT_START: ++ { ++ multipart_event_start *data = (multipart_event_start *) event_data; ++ ++ RFC1867_DATA(content_length) = data->content_length; ++ RFC1867_DATA(tracking_key)[0] = '\0'; ++ RFC1867_DATA(name)[0] = '\0'; ++ RFC1867_DATA(cancel_upload) = 0; ++ RFC1867_DATA(temp_filename) = NULL; ++ RFC1867_DATA(filename)[0] = '\0'; ++ RFC1867_DATA(key_length) = 0; ++ RFC1867_DATA(start_time) = my_time(); ++ RFC1867_DATA(bytes_processed) = 0; ++ RFC1867_DATA(prev_bytes_processed) = 0; ++ RFC1867_DATA(rate) = 0; ++ RFC1867_DATA(update_freq) = (int) APCG(rfc1867_freq); ++ RFC1867_DATA(started) = 0; ++ ++ if(RFC1867_DATA(update_freq) < 0) { // frequency is a percentage, not bytes ++ RFC1867_DATA(update_freq) = (int) (RFC1867_DATA(content_length) * APCG(rfc1867_freq) / 100); ++ } ++ } ++ break; ++ ++ case MULTIPART_EVENT_FORMDATA: ++ { ++ int prefix_len = strlen(APCG(rfc1867_prefix)); ++ multipart_event_formdata *data = (multipart_event_formdata *) event_data; ++ if(data->name && !strncasecmp(data->name, APCG(rfc1867_name), strlen(APCG(rfc1867_name))) ++ && data->value && data->length) { ++ ++ if(data->length >= sizeof(RFC1867_DATA(tracking_key)) - prefix_len) { ++ apc_warning("Key too long for '%s'. Maximum size is '%d' characters." TSRMLS_CC, ++ APCG(rfc1867_name), ++ sizeof(RFC1867_DATA(tracking_key)) - prefix_len); ++ break; ++ } ++ ++ if(RFC1867_DATA(started)) { ++ apc_warning("Upload progress key '%s' should be before the file upload entry in the form." TSRMLS_CC, ++ APCG(rfc1867_name)); ++ break; ++ } ++ ++ strlcat(RFC1867_DATA(tracking_key), APCG(rfc1867_prefix), 63); ++ strlcat(RFC1867_DATA(tracking_key), *data->value, 63); ++ RFC1867_DATA(key_length) = data->length + prefix_len; ++ RFC1867_DATA(bytes_processed) = data->post_bytes_processed; ++ } ++ } ++ break; ++ ++ case MULTIPART_EVENT_FILE_START: ++ { ++ RFC1867_DATA(started) = 1; ++ if(*RFC1867_DATA(tracking_key)) { ++ multipart_event_file_start *data = (multipart_event_file_start *) event_data; ++ ++ RFC1867_DATA(bytes_processed) = data->post_bytes_processed; ++ strlcpy(RFC1867_DATA(filename),*data->filename,128); ++ RFC1867_DATA(temp_filename) = NULL; ++ strlcpy(RFC1867_DATA(name),data->name,64); ++ ALLOC_INIT_ZVAL(track); ++ array_init(track); ++ add_assoc_long(track, "total", RFC1867_DATA(content_length)); ++ add_assoc_long(track, "current", RFC1867_DATA(bytes_processed)); ++ add_assoc_string(track, "filename", RFC1867_DATA(filename), 1); ++ add_assoc_string(track, "name", RFC1867_DATA(name), 1); ++ add_assoc_long(track, "done", 0); ++ add_assoc_double(track, "start_time", RFC1867_DATA(start_time)); ++ _apc_store(RFC1867_DATA(tracking_key), RFC1867_DATA(key_length)+1, track, APCG(rfc1867_ttl), 0 TSRMLS_CC); ++ zval_ptr_dtor(&track); ++ } ++ } ++ break; ++ ++ case MULTIPART_EVENT_FILE_DATA: ++ if(*RFC1867_DATA(tracking_key)) { ++ multipart_event_file_data *data = (multipart_event_file_data *) event_data; ++ RFC1867_DATA(bytes_processed) = data->post_bytes_processed; ++ if(RFC1867_DATA(bytes_processed) - RFC1867_DATA(prev_bytes_processed) > (uint) RFC1867_DATA(update_freq)) { ++ if(!_apc_update(RFC1867_DATA(tracking_key), RFC1867_DATA(key_length), update_bytes_processed, &RFC1867_DATA(bytes_processed) TSRMLS_CC)) { ++ ALLOC_INIT_ZVAL(track); ++ array_init(track); ++ add_assoc_long(track, "total", RFC1867_DATA(content_length)); ++ add_assoc_long(track, "current", RFC1867_DATA(bytes_processed)); ++ add_assoc_string(track, "filename", RFC1867_DATA(filename), 1); ++ add_assoc_string(track, "name", RFC1867_DATA(name), 1); ++ add_assoc_long(track, "done", 0); ++ add_assoc_double(track, "start_time", RFC1867_DATA(start_time)); ++ _apc_store(RFC1867_DATA(tracking_key), RFC1867_DATA(key_length)+1, track, APCG(rfc1867_ttl), 0 TSRMLS_CC); ++ zval_ptr_dtor(&track); ++ } ++ RFC1867_DATA(prev_bytes_processed) = RFC1867_DATA(bytes_processed); ++ } ++ } ++ break; ++ ++ case MULTIPART_EVENT_FILE_END: ++ if(*RFC1867_DATA(tracking_key)) { ++ multipart_event_file_end *data = (multipart_event_file_end *) event_data; ++ RFC1867_DATA(bytes_processed) = data->post_bytes_processed; ++ RFC1867_DATA(cancel_upload) = data->cancel_upload; ++ if(data->temp_filename) { ++ RFC1867_DATA(temp_filename) = data->temp_filename; ++ } else { ++ RFC1867_DATA(temp_filename) = ""; ++ } ++ ALLOC_INIT_ZVAL(track); ++ array_init(track); ++ add_assoc_long(track, "total", RFC1867_DATA(content_length)); ++ add_assoc_long(track, "current", RFC1867_DATA(bytes_processed)); ++ add_assoc_string(track, "filename", RFC1867_DATA(filename), 1); ++ add_assoc_string(track, "name", RFC1867_DATA(name), 1); ++ add_assoc_string(track, "temp_filename", RFC1867_DATA(temp_filename), 1); ++ add_assoc_long(track, "cancel_upload", RFC1867_DATA(cancel_upload)); ++ add_assoc_long(track, "done", 0); ++ add_assoc_double(track, "start_time", RFC1867_DATA(start_time)); ++ _apc_store(RFC1867_DATA(tracking_key), RFC1867_DATA(key_length)+1, track, APCG(rfc1867_ttl), 0 TSRMLS_CC); ++ zval_ptr_dtor(&track); ++ } ++ break; ++ ++ case MULTIPART_EVENT_END: ++ if(*RFC1867_DATA(tracking_key)) { ++ double now = my_time(); ++ multipart_event_end *data = (multipart_event_end *) event_data; ++ RFC1867_DATA(bytes_processed) = data->post_bytes_processed; ++ if(now>RFC1867_DATA(start_time)) RFC1867_DATA(rate) = 8.0*RFC1867_DATA(bytes_processed)/(now-RFC1867_DATA(start_time)); ++ else RFC1867_DATA(rate) = 8.0*RFC1867_DATA(bytes_processed); /* Too quick */ ++ ALLOC_INIT_ZVAL(track); ++ array_init(track); ++ add_assoc_long(track, "total", RFC1867_DATA(content_length)); ++ add_assoc_long(track, "current", RFC1867_DATA(bytes_processed)); ++ add_assoc_double(track, "rate", RFC1867_DATA(rate)); ++ add_assoc_string(track, "filename", RFC1867_DATA(filename), 1); ++ add_assoc_string(track, "name", RFC1867_DATA(name), 1); ++ add_assoc_long(track, "cancel_upload", RFC1867_DATA(cancel_upload)); ++ add_assoc_long(track, "done", 1); ++ add_assoc_double(track, "start_time", RFC1867_DATA(start_time)); ++ _apc_store(RFC1867_DATA(tracking_key), RFC1867_DATA(key_length)+1, track, APCG(rfc1867_ttl), 0 TSRMLS_CC); ++ zval_ptr_dtor(&track); ++ } ++ break; ++ } ++ ++ return SUCCESS; ++} ++ ++#endif ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_sem.c b/ext/apc/apc_sem.c +--- a/ext/apc/apc_sem.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_sem.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,192 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_sem.c 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#include "apc.h" ++ ++#ifdef APC_SEM_LOCKS ++ ++#include "apc_sem.h" ++#include "php.h" ++#include ++#include ++#include ++#include ++#include ++ ++#if HAVE_SEMUN ++/* we have semun, no need to define */ ++#else ++#undef HAVE_SEMUN ++union semun { ++ int val; /* value for SETVAL */ ++ struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */ ++ unsigned short *array; /* array for GETALL, SETALL */ ++ /* Linux specific part: */ ++ struct seminfo *__buf; /* buffer for IPC_INFO */ ++}; ++#define HAVE_SEMUN 1 ++#endif ++ ++#ifndef SEM_R ++# define SEM_R 0444 ++#endif ++#ifndef SEM_A ++# define SEM_A 0222 ++#endif ++ ++/* always use SEM_UNDO, otherwise we risk deadlock */ ++#define USE_SEM_UNDO ++ ++#ifdef USE_SEM_UNDO ++# define UNDO SEM_UNDO ++#else ++# define UNDO 0 ++#endif ++ ++int apc_sem_create(int proj, int initval TSRMLS_DC) ++{ ++ int semid; ++ int perms = 0777; ++ union semun arg; ++ key_t key = IPC_PRIVATE; ++ ++ if ((semid = semget(key, 1, IPC_CREAT | IPC_EXCL | perms)) >= 0) { ++ /* sempahore created for the first time, initialize now */ ++ arg.val = initval; ++ if (semctl(semid, 0, SETVAL, arg) < 0) { ++ apc_error("apc_sem_create: semctl(%d,...) failed:" TSRMLS_CC, semid); ++ } ++ } ++ else if (errno == EEXIST) { ++ /* sempahore already exists, don't initialize */ ++ if ((semid = semget(key, 1, perms)) < 0) { ++ apc_error("apc_sem_create: semget(%u,...) failed:" TSRMLS_CC, key); ++ } ++ /* insert here */ ++ } ++ else { ++ apc_error("apc_sem_create: semget(%u,...) failed:" TSRMLS_CC, key); ++ } ++ ++ return semid; ++} ++ ++void apc_sem_destroy(int semid) ++{ ++ /* we expect this call to fail often, so we do not check */ ++ union semun arg; ++ semctl(semid, 0, IPC_RMID, arg); ++} ++ ++void apc_sem_lock(int semid TSRMLS_DC) ++{ ++ struct sembuf op; ++ ++ op.sem_num = 0; ++ op.sem_op = -1; ++ op.sem_flg = UNDO; ++ ++ if (semop(semid, &op, 1) < 0) { ++ if (errno != EINTR) { ++ apc_error("apc_sem_lock: semop(%d) failed:" TSRMLS_CC, semid); ++ } ++ } ++} ++ ++int apc_sem_nonblocking_lock(int semid TSRMLS_DC) ++{ ++ struct sembuf op; ++ ++ op.sem_num = 0; ++ op.sem_op = -1; ++ op.sem_flg = UNDO | IPC_NOWAIT; ++ ++ if (semop(semid, &op, 1) < 0) { ++ if (errno == EAGAIN) { ++ return 0; /* Lock is already held */ ++ } else if (errno != EINTR) { ++ apc_error("apc_sem_lock: semop(%d) failed:" TSRMLS_CC, semid); ++ } ++ } ++ ++ return 1; /* Lock obtained */ ++} ++ ++void apc_sem_unlock(int semid TSRMLS_DC) ++{ ++ struct sembuf op; ++ ++ op.sem_num = 0; ++ op.sem_op = 1; ++ op.sem_flg = UNDO; ++ ++ if (semop(semid, &op, 1) < 0) { ++ if (errno != EINTR) { ++ apc_error("apc_sem_unlock: semop(%d) failed:" TSRMLS_CC, semid); ++ } ++ } ++} ++ ++void apc_sem_wait_for_zero(int semid TSRMLS_DC) ++{ ++ struct sembuf op; ++ ++ op.sem_num = 0; ++ op.sem_op = 0; ++ op.sem_flg = UNDO; ++ ++ if (semop(semid, &op, 1) < 0) { ++ if (errno != EINTR) { ++ apc_error("apc_sem_waitforzero: semop(%d) failed:" TSRMLS_CC, semid); ++ } ++ } ++} ++ ++int apc_sem_get_value(int semid TSRMLS_DC) ++{ ++ union semun arg; ++ unsigned short val[1]; ++ ++ arg.array = val; ++ if (semctl(semid, 0, GETALL, arg) < 0) { ++ apc_error("apc_sem_getvalue: semctl(%d,...) failed:" TSRMLS_CC, semid); ++ } ++ return val[0]; ++} ++ ++#endif /* APC_SEM_LOCKS */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_sem.h b/ext/apc/apc_sem.h +--- a/ext/apc/apc_sem.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_sem.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,52 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_sem.h 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#ifndef APC_SEM_H ++#define APC_SEM_H ++ ++/* Wrapper functions for SysV sempahores */ ++ ++extern int apc_sem_create(int proj, int initval TSRMLS_DC); ++extern void apc_sem_destroy(int semid); ++extern void apc_sem_lock(int semid TSRMLS_DC); ++extern int apc_sem_nonblocking_lock(int semid TSRMLS_DC); ++extern void apc_sem_unlock(int semid TSRMLS_DC); ++extern void apc_sem_wait_for_zero(int semid TSRMLS_DC); ++extern int apc_sem_get_value(int semid TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_serializer.h b/ext/apc/apc_serializer.h +--- a/ext/apc/apc_serializer.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_serializer.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,84 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Gopal Vijayaraghavan | ++ +----------------------------------------------------------------------+ ++ ++ */ ++ ++/* $Id: $ */ ++ ++#ifndef APC_SERIALIZER_H ++#define APC_SERIALIZER_H ++ ++/* this is a shipped .h file, do not include any other header in this file */ ++#define APC_SERIALIZER_NAME(module) module##_apc_serializer ++#define APC_UNSERIALIZER_NAME(module) module##_apc_unserializer ++ ++#define APC_SERIALIZER_ARGS unsigned char **buf, size_t *buf_len, const zval *value, void *config TSRMLS_DC ++#define APC_UNSERIALIZER_ARGS zval **value, unsigned char *buf, size_t buf_len, void *config TSRMLS_DC ++ ++typedef int (*apc_serialize_t)(APC_SERIALIZER_ARGS); ++typedef int (*apc_unserialize_t)(APC_UNSERIALIZER_ARGS); ++ ++typedef int (*apc_register_serializer_t)(const char* name, ++ apc_serialize_t serialize, ++ apc_unserialize_t unserialize, ++ void *config TSRMLS_DC); ++ ++/* ++ * ABI version for constant hooks. Increment this any time you make any changes ++ * to any function in this file. ++ */ ++#define APC_SERIALIZER_ABI "0" ++#define APC_SERIALIZER_CONSTANT "\000apc_register_serializer-" APC_SERIALIZER_ABI ++ ++#if !defined(APC_UNUSED) ++# if defined(__GNUC__) ++# define APC_UNUSED __attribute__((unused)) ++# else ++# define APC_UNUSED ++# endif ++#endif ++ ++static APC_UNUSED int apc_register_serializer(const char* name, ++ apc_serialize_t serialize, ++ apc_unserialize_t unserialize, ++ void *config TSRMLS_DC) ++{ ++ zval apc_magic_constant; ++ int retval = 0; ++ ++ /* zend_get_constant will return 1 on success, otherwise apc_magic_constant wouldn't be touched at all */ ++ if (zend_get_constant(APC_SERIALIZER_CONSTANT, sizeof(APC_SERIALIZER_CONSTANT)-1, &apc_magic_constant TSRMLS_CC)) { ++ apc_register_serializer_t register_func = (apc_register_serializer_t)(Z_LVAL(apc_magic_constant)); ++ if(register_func) { ++ retval = register_func(name, serialize, unserialize, NULL TSRMLS_CC); ++ } ++ zval_dtor(&apc_magic_constant); ++ } ++ ++ return retval; ++} ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_shm.c b/ext/apc/apc_shm.c +--- a/ext/apc/apc_shm.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_shm.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,116 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | Rasmus Lerdorf | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_shm.c 307259 2011-01-08 12:05:24Z gopalv $ */ ++ ++#include "apc_shm.h" ++#include "apc.h" ++#ifdef PHP_WIN32 ++/* shm functions are available in TSRM */ ++#include ++#define key_t long ++#else ++#include ++#include ++#include ++#endif ++ ++#ifndef SHM_R ++# define SHM_R 0444 /* read permission */ ++#endif ++#ifndef SHM_A ++# define SHM_A 0222 /* write permission */ ++#endif ++ ++int apc_shm_create(int proj, size_t size TSRMLS_DC) ++{ ++ int shmid; /* shared memory id */ ++ int oflag; /* permissions on shm */ ++ key_t key = IPC_PRIVATE; /* shm key */ ++ ++ oflag = IPC_CREAT | SHM_R | SHM_A; ++ if ((shmid = shmget(key, size, oflag)) < 0) { ++ apc_error("apc_shm_create: shmget(%d, %d, %d) failed: %s. It is possible that the chosen SHM segment size is higher than the operation system allows. Linux has usually a default limit of 32MB per segment." TSRMLS_CC, key, size, oflag, strerror(errno)); ++ } ++ ++ return shmid; ++} ++ ++void apc_shm_destroy(int shmid) ++{ ++ /* we expect this call to fail often, so we do not check */ ++ shmctl(shmid, IPC_RMID, 0); ++} ++ ++apc_segment_t apc_shm_attach(int shmid, size_t size TSRMLS_DC) ++{ ++ apc_segment_t segment; /* shm segment */ ++ ++ if ((long)(segment.shmaddr = shmat(shmid, 0, 0)) == -1) { ++ apc_error("apc_shm_attach: shmat failed:" TSRMLS_CC); ++ } ++ ++#ifdef APC_MEMPROTECT ++ ++ if ((long)(segment.roaddr = shmat(shmid, 0, SHM_RDONLY)) == -1) { ++ segment.roaddr = NULL; ++ } ++ ++#endif ++ ++ segment.size = size; ++ ++ /* ++ * We set the shmid for removal immediately after attaching to it. The ++ * segment won't disappear until all processes have detached from it. ++ */ ++ apc_shm_destroy(shmid); ++ return segment; ++} ++ ++void apc_shm_detach(apc_segment_t* segment TSRMLS_DC) ++{ ++ if (shmdt(segment->shmaddr) < 0) { ++ apc_error("apc_shm_detach: shmdt failed:" TSRMLS_CC); ++ } ++ ++#ifdef APC_MEMPROTECT ++ if (segment->roaddr && shmdt(segment->roaddr) < 0) { ++ apc_error("apc_shm_detach: shmdt failed:" TSRMLS_CC); ++ } ++#endif ++} ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_shm.h b/ext/apc/apc_shm.h +--- a/ext/apc/apc_shm.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_shm.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,56 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_shm.h 307259 2011-01-08 12:05:24Z gopalv $ */ ++ ++#ifndef APC_SHM_H ++#define APC_SHM_H ++ ++#include ++#ifdef PHP_WIN32 ++#include ++#endif ++ ++#include "apc_sma.h" ++ ++/* Wrapper functions for unix shared memory */ ++ ++extern int apc_shm_create(int proj, size_t size TSRMLS_DC); ++extern void apc_shm_destroy(int shmid); ++extern apc_segment_t apc_shm_attach(int shmid, size_t size TSRMLS_DC); ++extern void apc_shm_detach(apc_segment_t* segment TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_signal.c b/ext/apc/apc_signal.c +--- a/ext/apc/apc_signal.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_signal.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,197 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Lucas Nealan | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Facebook Inc. in 2007. ++ ++ Future revisions and derivatives of this source code must acknowledge ++ Facebook Inc. as the original contributor of this module by leaving ++ this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ */ ++ ++ /* $Id: apc_signal.c 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++ /* Allows apc to install signal handlers and maintain signalling ++ to already registered handlers. Registers all signals that ++ coredump by default and unmaps the shared memory segment ++ before the coredump. Note: PHP module init is called before ++ signals are set by Apache and thus apc_set_signals should ++ be called in request init (RINIT) ++ */ ++ ++#include "apc.h" ++ ++#if HAVE_SIGACTION ++#include ++#include "apc_globals.h" ++#include "apc_sma.h" ++#include "apc_signal.h" ++ ++static apc_signal_info_t apc_signal_info = {0}; ++ ++static int apc_register_signal(int signo, void (*handler)(int, siginfo_t*, void*) TSRMLS_DC); ++static void apc_rehandle_signal(int signo, siginfo_t *siginfo, void *context); ++static void apc_core_unmap(int signo, siginfo_t *siginfo, void *context); ++ ++/* {{{ apc_core_unmap ++ * Coredump signal handler, unmaps shm and calls previously installed handlers ++ */ ++static void apc_core_unmap(int signo, siginfo_t *siginfo, void *context) ++{ ++ TSRMLS_FETCH(); ++ ++ apc_sma_cleanup(TSRMLS_C); ++ apc_rehandle_signal(signo, siginfo, context); ++ ++#if !defined(WIN32) && !defined(NETWARE) ++ kill(getpid(), signo); ++#else ++ raise(signo); ++#endif ++} /* }}} */ ++ ++/* {{{ apc_rehandle_signal ++ * Call the previously registered handler for a signal ++ */ ++static void apc_rehandle_signal(int signo, siginfo_t *siginfo, void *context) ++{ ++ int i; ++ apc_signal_entry_t p_sig = {0}; ++ ++ for (i=0; (i < apc_signal_info.installed && p_sig.signo != signo); i++) { ++ p_sig = *apc_signal_info.prev[i]; ++ if (p_sig.signo == signo) { ++ if (p_sig.siginfo) { ++ (*(void (*)(int, siginfo_t*, void*))p_sig.handler)(signo, siginfo, context); ++ } else { ++ (*(void (*)(int))p_sig.handler)(signo); ++ } ++ } ++ } ++ ++} /* }}} */ ++ ++/* {{{ apc_register_signal ++ * Set a handler for a previously installed signal and save so we can ++ * callback when handled ++ */ ++static int apc_register_signal(int signo, void (*handler)(int, siginfo_t*, void*) TSRMLS_DC) ++{ ++ struct sigaction sa = {{0}}; ++ apc_signal_entry_t p_sig = {0}; ++ ++ if (sigaction(signo, NULL, &sa) == 0) { ++ if ((void*)sa.sa_handler == (void*)handler) { ++ return SUCCESS; ++ } ++ ++ if (sa.sa_handler != SIG_ERR && sa.sa_handler != SIG_DFL && sa.sa_handler != SIG_IGN) { ++ p_sig.signo = signo; ++ p_sig.siginfo = ((sa.sa_flags & SA_SIGINFO) == SA_SIGINFO); ++ p_sig.handler = (void *)sa.sa_handler; ++ ++ apc_signal_info.prev = (apc_signal_entry_t **)apc_erealloc(apc_signal_info.prev, (apc_signal_info.installed+1)*sizeof(apc_signal_entry_t *) TSRMLS_CC); ++ apc_signal_info.prev[apc_signal_info.installed] = (apc_signal_entry_t *)apc_emalloc(sizeof(apc_signal_entry_t) TSRMLS_CC); ++ *apc_signal_info.prev[apc_signal_info.installed++] = p_sig; ++ } else { ++ /* inherit flags and mask if already set */ ++ sigemptyset(&sa.sa_mask); ++ sa.sa_flags = 0; ++ sa.sa_flags |= SA_SIGINFO; /* we'll use a siginfo handler */ ++#if defined(SA_ONESHOT) ++ sa.sa_flags = SA_ONESHOT; ++#elif defined(SA_RESETHAND) ++ sa.sa_flags = SA_RESETHAND; ++#endif ++ } ++ sa.sa_handler = (void*)handler; ++ ++ if (sigaction(signo, &sa, NULL) < 0) { ++ apc_warning("Error installing apc signal handler for %d" TSRMLS_CC, signo); ++ } ++ ++ return SUCCESS; ++ } ++ return FAILURE; ++} /* }}} */ ++ ++/* {{{ apc_set_signals ++ * Install our signal handlers */ ++void apc_set_signals(TSRMLS_D) ++{ ++ if (APCG(coredump_unmap) && apc_signal_info.installed == 0) { ++ /* ISO C standard signals that coredump */ ++ apc_register_signal(SIGSEGV, apc_core_unmap TSRMLS_CC); ++ apc_register_signal(SIGABRT, apc_core_unmap TSRMLS_CC); ++ apc_register_signal(SIGFPE, apc_core_unmap TSRMLS_CC); ++ apc_register_signal(SIGILL, apc_core_unmap TSRMLS_CC); ++ /* extended signals that coredump */ ++#ifdef SIGBUS ++ apc_register_signal(SIGBUS, apc_core_unmap TSRMLS_CC); ++#endif ++#ifdef SIGABORT ++ apc_register_signal(SIGABORT, apc_core_unmap TSRMLS_CC); ++#endif ++#ifdef SIGEMT ++ apc_register_signal(SIGEMT, apc_core_unmap TSRMLS_CC); ++#endif ++#ifdef SIGIOT ++ apc_register_signal(SIGIOT, apc_core_unmap TSRMLS_CC); ++#endif ++#ifdef SIGQUIT ++ apc_register_signal(SIGQUIT, apc_core_unmap TSRMLS_CC); ++#endif ++#ifdef SIGSYS ++ apc_register_signal(SIGSYS, apc_core_unmap TSRMLS_CC); ++#endif ++#ifdef SIGTRAP ++ apc_register_signal(SIGTRAP, apc_core_unmap TSRMLS_CC); ++#endif ++#ifdef SIGXCPU ++ apc_register_signal(SIGXCPU, apc_core_unmap TSRMLS_CC); ++#endif ++#ifdef SIGXFSZ ++ apc_register_signal(SIGXFSZ, apc_core_unmap TSRMLS_CC); ++#endif ++ } ++} /* }}} */ ++ ++/* {{{ apc_set_signals ++ * cleanup signals for shutdown */ ++void apc_shutdown_signals(TSRMLS_D) ++{ ++ int i=0; ++ if (apc_signal_info.installed > 0) { ++ for (i=0; (i < apc_signal_info.installed); i++) { ++ apc_efree(apc_signal_info.prev[i] TSRMLS_CC); ++ } ++ apc_efree(apc_signal_info.prev TSRMLS_CC); ++ apc_signal_info.installed = 0; /* just in case */ ++ } ++} ++ ++#endif /* HAVE_SIGACTION */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_signal.h b/ext/apc/apc_signal.h +--- a/ext/apc/apc_signal.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_signal.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,51 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Lucas Nealan | ++ +----------------------------------------------------------------------+ ++ ++ */ ++ ++/* $Id: apc_signal.h 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#ifndef APC_SIGNAL_H ++#define APC_SIGNAL_H ++ ++#include "apc.h" ++#include "apc_php.h" ++ ++typedef struct apc_signal_entry_t { ++ int signo; /* signal number */ ++ int siginfo; /* siginfo style handler calling */ ++ void* handler; /* signal handler */ ++} apc_signal_entry_t; ++ ++typedef struct apc_signal_info_t { ++ int installed; /* How many signals we've installed handles for */ ++ apc_signal_entry_t **prev; /* Previous signal handlers */ ++} apc_signal_info_t; ++ ++void apc_set_signals(TSRMLS_D); ++void apc_shutdown_signals(TSRMLS_D); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_sma.c b/ext/apc/apc_sma.c +--- a/ext/apc/apc_sma.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_sma.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,765 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | Rasmus Lerdorf | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_sma.c 309489 2011-03-21 00:00:54Z pajoye $ */ ++ ++#include "apc_sma.h" ++#include "apc.h" ++#include "apc_globals.h" ++#include "apc_lock.h" ++#include "apc_shm.h" ++#include "apc_cache.h" ++ ++#include ++#include "apc_mmap.h" ++ ++#ifdef HAVE_VALGRIND_MEMCHECK_H ++#include ++#endif ++ ++enum { DEFAULT_NUMSEG=1, DEFAULT_SEGSIZE=30*1024*1024 }; ++ ++static int sma_initialized = 0; /* true if the sma has been initialized */ ++static uint sma_numseg; /* number of shm segments to allow */ ++static size_t sma_segsize; /* size of each shm segment */ ++static apc_segment_t* sma_segments; /* array of shm segments */ ++static int sma_lastseg = 0; /* index of MRU segment */ ++ ++typedef struct sma_header_t sma_header_t; ++struct sma_header_t { ++ apc_lck_t sma_lock; /* segment lock, MUST BE ALIGNED for futex locks */ ++ size_t segsize; /* size of entire segment */ ++ size_t avail; /* bytes available (not necessarily contiguous) */ ++#if ALLOC_DISTRIBUTION ++ size_t adist[30]; ++#endif ++}; ++ ++#define SMA_HDR(i) ((sma_header_t*)((sma_segments[i]).shmaddr)) ++#define SMA_ADDR(i) ((char*)(SMA_HDR(i))) ++#define SMA_RO(i) ((char*)(sma_segments[i]).roaddr) ++#define SMA_LCK(i) ((SMA_HDR(i))->sma_lock) ++ ++ ++/* do not enable for threaded http servers */ ++/* #define __APC_SMA_DEBUG__ 1 */ ++ ++#ifdef __APC_SMA_DEBUG__ ++/* global counter for identifying blocks ++ * Technically it is possible to do the same ++ * using offsets, but double allocations of the ++ * same offset can happen. */ ++static volatile size_t block_id = 0; ++#endif ++ ++#define APC_SMA_CANARIES 1 ++ ++typedef struct block_t block_t; ++struct block_t { ++ size_t size; /* size of this block */ ++ size_t prev_size; /* size of sequentially previous block, 0 if prev is allocated */ ++ size_t fnext; /* offset in segment of next free block */ ++ size_t fprev; /* offset in segment of prev free block */ ++#ifdef APC_SMA_CANARIES ++ size_t canary; /* canary to check for memory overwrites */ ++#endif ++#ifdef __APC_SMA_DEBUG__ ++ size_t id; /* identifier for the memory block */ ++#endif ++}; ++ ++/* The macros BLOCKAT and OFFSET are used for convenience throughout this ++ * module. Both assume the presence of a variable shmaddr that points to the ++ * beginning of the shared memory segment in question. */ ++ ++#define BLOCKAT(offset) ((block_t*)((char *)shmaddr + offset)) ++#define OFFSET(block) ((size_t)(((char*)block) - (char*)shmaddr)) ++ ++/* macros for getting the next or previous sequential block */ ++#define NEXT_SBLOCK(block) ((block_t*)((char*)block + block->size)) ++#define PREV_SBLOCK(block) (block->prev_size ? ((block_t*)((char*)block - block->prev_size)) : NULL) ++ ++/* Canary macros for setting, checking and resetting memory canaries */ ++#ifdef APC_SMA_CANARIES ++ #define SET_CANARY(v) (v)->canary = 0x42424242 ++ #define CHECK_CANARY(v) assert((v)->canary == 0x42424242) ++ #define RESET_CANARY(v) (v)->canary = -42 ++#else ++ #define SET_CANARY(v) ++ #define CHECK_CANARY(v) ++ #define RESET_CANARY(v) ++#endif ++ ++ ++/* {{{ MINBLOCKSIZE */ ++#define MINBLOCKSIZE (ALIGNWORD(1) + ALIGNWORD(sizeof(block_t))) ++/* }}} */ ++ ++#if 0 ++/* {{{ sma_debug_state(apc_sma_segment_t *segment, int canary_check, int verbose) ++ * useful for debuging state of memory blocks and free list, and sanity checking ++ */ ++static void sma_debug_state(void* shmaddr, int canary_check, int verbose TSRMLS_DC) { ++ sma_header_t *header = (sma_header_t*)shmaddr; ++ block_t *cur = BLOCKAT(ALIGNWORD(sizeof(sma_header_t))); ++ block_t *prv = NULL; ++ size_t avail; ++ ++ /* Verify free list */ ++ if (verbose) apc_warning("Free List: " TSRMLS_CC); ++ while(1) { ++ if (verbose) apc_warning(" 0x%x[%d] (s%d)" TSRMLS_CC, cur, OFFSET(cur), cur->size); ++ if (canary_check) CHECK_CANARY(cur); ++ if (!cur->fnext) break; ++ cur = BLOCKAT(cur->fnext); ++ avail += cur->size; ++ if (prv == cur) { ++ apc_warning("Circular list detected!" TSRMLS_CC); ++ assert(0); ++ } ++ if (prv && cur->fprev != OFFSET(prv)) { ++ apc_warning("Previous pointer does not point to previous!" TSRMLS_CC); ++ assert(0); ++ } ++ prv = cur; ++ } ++ assert(avail == header->avail); ++ ++ /* Verify each block */ ++ if (verbose) apc_warning("Block List: " TSRMLS_CC); ++ cur = BLOCKAT(ALIGNWORD(sizeof(sma_header_t))); ++ while(1) { ++ if(!cur->fnext) { ++ if (verbose) apc_warning(" 0x%x[%d] (s%d) (u)" TSRMLS_CC, cur, OFFSET(cur), cur->size); ++ } else { ++ if (verbose) apc_warning(" 0x%x[%d] (s%d) (f)" TSRMLS_CC, cur, OFFSET(cur), cur->size); ++ } ++ if (canary_check) CHECK_CANARY(cur); ++ if (!cur->size && !cur->fnext) break; ++ if (!cur->size) { ++ cur = BLOCKAT(OFFSET(cur) + ALIGNWORD(sizeof(block_t))); ++ } else { ++ cur = NEXT_SBLOCK(cur); ++ } ++ if (prv == cur) { ++ apc_warning("Circular list detected!" TSRMLS_CC); ++ assert(0); ++ } ++ prv = cur; ++ } ++} ++/* }}} */ ++#endif ++ ++/* {{{ sma_allocate: tries to allocate at least size bytes in a segment */ ++static APC_HOTSPOT size_t sma_allocate(sma_header_t* header, size_t size, size_t fragment, size_t *allocated) ++{ ++ void* shmaddr; /* header of shared memory segment */ ++ block_t* prv; /* block prior to working block */ ++ block_t* cur; /* working block in list */ ++ block_t* prvnextfit; /* block before next fit */ ++ size_t realsize; /* actual size of block needed, including header */ ++ const size_t block_size = ALIGNWORD(sizeof(struct block_t)); ++ ++ realsize = ALIGNWORD(size + block_size); ++ ++ /* ++ * First, insure that the segment contains at least realsize free bytes, ++ * even if they are not contiguous. ++ */ ++ shmaddr = header; ++ ++ if (header->avail < realsize) { ++ return -1; ++ } ++ ++ prvnextfit = 0; /* initially null (no fit) */ ++ prv = BLOCKAT(ALIGNWORD(sizeof(sma_header_t))); ++ CHECK_CANARY(prv); ++ ++ while (prv->fnext != 0) { ++ cur = BLOCKAT(prv->fnext); ++#ifdef __APC_SMA_DEBUG__ ++ CHECK_CANARY(cur); ++#endif ++ /* If it can fit realsize bytes in cur block, stop searching */ ++ if (cur->size >= realsize) { ++ prvnextfit = prv; ++ break; ++ } ++ prv = cur; ++ } ++ ++ if (prvnextfit == 0) { ++ return -1; ++ } ++ ++ prv = prvnextfit; ++ cur = BLOCKAT(prv->fnext); ++ ++ CHECK_CANARY(prv); ++ CHECK_CANARY(cur); ++ ++ if (cur->size == realsize || (cur->size > realsize && cur->size < (realsize + (MINBLOCKSIZE + fragment)))) { ++ /* cur is big enough for realsize, but too small to split - unlink it */ ++ *(allocated) = cur->size - block_size; ++ prv->fnext = cur->fnext; ++ BLOCKAT(cur->fnext)->fprev = OFFSET(prv); ++ NEXT_SBLOCK(cur)->prev_size = 0; /* block is alloc'd */ ++ } else { ++ /* nextfit is too big; split it into two smaller blocks */ ++ block_t* nxt; /* the new block (chopped part of cur) */ ++ size_t oldsize; /* size of cur before split */ ++ ++ oldsize = cur->size; ++ cur->size = realsize; ++ *(allocated) = cur->size - block_size; ++ nxt = NEXT_SBLOCK(cur); ++ nxt->prev_size = 0; /* block is alloc'd */ ++ nxt->size = oldsize - realsize; /* and fix the size */ ++ NEXT_SBLOCK(nxt)->prev_size = nxt->size; /* adjust size */ ++ SET_CANARY(nxt); ++ ++ /* replace cur with next in free list */ ++ nxt->fnext = cur->fnext; ++ nxt->fprev = cur->fprev; ++ BLOCKAT(nxt->fnext)->fprev = OFFSET(nxt); ++ BLOCKAT(nxt->fprev)->fnext = OFFSET(nxt); ++#ifdef __APC_SMA_DEBUG__ ++ nxt->id = -1; ++#endif ++ } ++ ++ cur->fnext = 0; ++ ++ /* update the block header */ ++ header->avail -= cur->size; ++#if ALLOC_DISTRIBUTION ++ header->adist[(int)(log(size)/log(2))]++; ++#endif ++ ++ SET_CANARY(cur); ++#ifdef __APC_SMA_DEBUG__ ++ cur->id = ++block_id; ++ fprintf(stderr, "allocate(realsize=%d,size=%d,id=%d)\n", (int)(size), (int)(cur->size), cur->id); ++#endif ++ ++ return OFFSET(cur) + block_size; ++} ++/* }}} */ ++ ++/* {{{ sma_deallocate: deallocates the block at the given offset */ ++static APC_HOTSPOT size_t sma_deallocate(void* shmaddr, size_t offset) ++{ ++ sma_header_t* header; /* header of shared memory segment */ ++ block_t* cur; /* the new block to insert */ ++ block_t* prv; /* the block before cur */ ++ block_t* nxt; /* the block after cur */ ++ size_t size; /* size of deallocated block */ ++ ++ offset -= ALIGNWORD(sizeof(struct block_t)); ++ assert(offset >= 0); ++ ++ /* find position of new block in free list */ ++ cur = BLOCKAT(offset); ++ ++ /* update the block header */ ++ header = (sma_header_t*) shmaddr; ++ header->avail += cur->size; ++ size = cur->size; ++ ++ if (cur->prev_size != 0) { ++ /* remove prv from list */ ++ prv = PREV_SBLOCK(cur); ++ BLOCKAT(prv->fnext)->fprev = prv->fprev; ++ BLOCKAT(prv->fprev)->fnext = prv->fnext; ++ /* cur and prv share an edge, combine them */ ++ prv->size +=cur->size; ++ RESET_CANARY(cur); ++ cur = prv; ++ } ++ ++ nxt = NEXT_SBLOCK(cur); ++ if (nxt->fnext != 0) { ++ assert(NEXT_SBLOCK(NEXT_SBLOCK(cur))->prev_size == nxt->size); ++ /* cur and nxt shared an edge, combine them */ ++ BLOCKAT(nxt->fnext)->fprev = nxt->fprev; ++ BLOCKAT(nxt->fprev)->fnext = nxt->fnext; ++ cur->size += nxt->size; ++#ifdef __APC_SMA_DEBUG__ ++ CHECK_CANARY(nxt); ++ nxt->id = -1; /* assert this or set it ? */ ++#endif ++ RESET_CANARY(nxt); ++ } ++ ++ NEXT_SBLOCK(cur)->prev_size = cur->size; ++ ++ /* insert new block after prv */ ++ prv = BLOCKAT(ALIGNWORD(sizeof(sma_header_t))); ++ cur->fnext = prv->fnext; ++ prv->fnext = OFFSET(cur); ++ cur->fprev = OFFSET(prv); ++ BLOCKAT(cur->fnext)->fprev = OFFSET(cur); ++ ++ return size; ++} ++/* }}} */ ++ ++/* {{{ apc_sma_init */ ++ ++void apc_sma_init(int numseg, size_t segsize, char *mmap_file_mask TSRMLS_DC) ++{ ++ uint i; ++ ++ if (sma_initialized) { ++ return; ++ } ++ sma_initialized = 1; ++ ++#if APC_MMAP ++ /* ++ * I don't think multiple anonymous mmaps makes any sense ++ * so force sma_numseg to 1 in this case ++ */ ++ if(!mmap_file_mask || ++ (mmap_file_mask && !strlen(mmap_file_mask)) || ++ (mmap_file_mask && !strcmp(mmap_file_mask, "/dev/zero"))) { ++ sma_numseg = 1; ++ } else { ++ sma_numseg = numseg > 0 ? numseg : DEFAULT_NUMSEG; ++ } ++#else ++ sma_numseg = numseg > 0 ? numseg : DEFAULT_NUMSEG; ++#endif ++ ++ sma_segsize = segsize > 0 ? segsize : DEFAULT_SEGSIZE; ++ ++ sma_segments = (apc_segment_t*) apc_emalloc((sma_numseg * sizeof(apc_segment_t)) TSRMLS_CC); ++ ++ for (i = 0; i < sma_numseg; i++) { ++ sma_header_t* header; ++ block_t *first, *empty, *last; ++ void* shmaddr; ++ ++#if APC_MMAP ++ sma_segments[i] = apc_mmap(mmap_file_mask, sma_segsize TSRMLS_CC); ++ if(sma_numseg != 1) memcpy(&mmap_file_mask[strlen(mmap_file_mask)-6], "XXXXXX", 6); ++#else ++ sma_segments[i] = apc_shm_attach(apc_shm_create(i, sma_segsize TSRMLS_CC), sma_segsize TSRMLS_CC); ++#endif ++ ++ sma_segments[i].size = sma_segsize; ++ ++ shmaddr = sma_segments[i].shmaddr; ++ ++ header = (sma_header_t*) shmaddr; ++ apc_lck_create(NULL, 0, 1, header->sma_lock); ++ header->segsize = sma_segsize; ++ header->avail = sma_segsize - ALIGNWORD(sizeof(sma_header_t)) - ALIGNWORD(sizeof(block_t)) - ALIGNWORD(sizeof(block_t)); ++#if ALLOC_DISTRIBUTION ++ { ++ int j; ++ for(j=0; j<30; j++) header->adist[j] = 0; ++ } ++#endif ++ first = BLOCKAT(ALIGNWORD(sizeof(sma_header_t))); ++ first->size = 0; ++ first->fnext = ALIGNWORD(sizeof(sma_header_t)) + ALIGNWORD(sizeof(block_t)); ++ first->fprev = 0; ++ first->prev_size = 0; ++ SET_CANARY(first); ++#ifdef __APC_SMA_DEBUG__ ++ block->id = -1; ++#endif ++ empty = BLOCKAT(first->fnext); ++ empty->size = header->avail - ALIGNWORD(sizeof(block_t)); ++ empty->fnext = OFFSET(empty) + empty->size; ++ empty->fprev = ALIGNWORD(sizeof(sma_header_t)); ++ empty->prev_size = 0; ++ SET_CANARY(empty); ++#ifdef __APC_SMA_DEBUG__ ++ empty->id = -1; ++#endif ++ last = BLOCKAT(empty->fnext); ++ last->size = 0; ++ last->fnext = 0; ++ last->fprev = OFFSET(empty); ++ last->prev_size = empty->size; ++ SET_CANARY(last); ++#ifdef __APC_SMA_DEBUG__ ++ last->id = -1; ++#endif ++ } ++} ++/* }}} */ ++ ++/* {{{ apc_sma_cleanup */ ++void apc_sma_cleanup(TSRMLS_D) ++{ ++ uint i; ++ ++ assert(sma_initialized); ++ ++ for (i = 0; i < sma_numseg; i++) { ++ apc_lck_destroy(SMA_LCK(i)); ++#if APC_MMAP ++ apc_unmap(&sma_segments[i] TSRMLS_CC); ++#else ++ apc_shm_detach(&sma_segments[i] TSRMLS_CC); ++#endif ++ } ++ sma_initialized = 0; ++ apc_efree(sma_segments TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ apc_sma_malloc_ex */ ++void* apc_sma_malloc_ex(size_t n, size_t fragment, size_t* allocated TSRMLS_DC) ++{ ++ size_t off; ++ uint i; ++ int nuked = 0; ++ ++restart: ++ assert(sma_initialized); ++ LOCK(SMA_LCK(sma_lastseg)); ++ ++ off = sma_allocate(SMA_HDR(sma_lastseg), n, fragment, allocated); ++ ++ if(off == -1 && APCG(current_cache)) { ++ /* retry failed allocation after we expunge */ ++ UNLOCK(SMA_LCK(sma_lastseg)); ++ APCG(current_cache)->expunge_cb(APCG(current_cache), (n+fragment) TSRMLS_CC); ++ LOCK(SMA_LCK(sma_lastseg)); ++ off = sma_allocate(SMA_HDR(sma_lastseg), n, fragment, allocated); ++ } ++ ++ if (off != -1) { ++ void* p = (void *)(SMA_ADDR(sma_lastseg) + off); ++ UNLOCK(SMA_LCK(sma_lastseg)); ++#ifdef VALGRIND_MALLOCLIKE_BLOCK ++ VALGRIND_MALLOCLIKE_BLOCK(p, n, 0, 0); ++#endif ++ return p; ++ } ++ ++ UNLOCK(SMA_LCK(sma_lastseg)); ++ ++ for (i = 0; i < sma_numseg; i++) { ++ if (i == sma_lastseg) { ++ continue; ++ } ++ LOCK(SMA_LCK(i)); ++ off = sma_allocate(SMA_HDR(i), n, fragment, allocated); ++ if(off == -1 && APCG(current_cache)) { ++ /* retry failed allocation after we expunge */ ++ UNLOCK(SMA_LCK(i)); ++ APCG(current_cache)->expunge_cb(APCG(current_cache), (n+fragment) TSRMLS_CC); ++ LOCK(SMA_LCK(i)); ++ off = sma_allocate(SMA_HDR(i), n, fragment, allocated); ++ } ++ if (off != -1) { ++ void* p = (void *)(SMA_ADDR(i) + off); ++ UNLOCK(SMA_LCK(i)); ++ sma_lastseg = i; ++#ifdef VALGRIND_MALLOCLIKE_BLOCK ++ VALGRIND_MALLOCLIKE_BLOCK(p, n, 0, 0); ++#endif ++ return p; ++ } ++ UNLOCK(SMA_LCK(i)); ++ } ++ ++ /* I've tried being nice, but now you're just asking for it */ ++ if(!nuked) { ++ apc_cache->expunge_cb(apc_cache, (n+fragment) TSRMLS_CC); ++ apc_user_cache->expunge_cb(apc_user_cache, (n+fragment) TSRMLS_CC); ++ nuked = 1; ++ goto restart; ++ } ++ ++ /* now, I've truly and well given up */ ++ ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ apc_sma_malloc */ ++void* apc_sma_malloc(size_t n TSRMLS_DC) ++{ ++ size_t allocated; ++ void *p = apc_sma_malloc_ex(n, MINBLOCKSIZE, &allocated TSRMLS_CC); ++ ++ return p; ++} ++/* }}} */ ++ ++/* {{{ apc_sma_realloc */ ++void* apc_sma_realloc(void *p, size_t n TSRMLS_DC) ++{ ++ apc_sma_free(p TSRMLS_CC); ++ return apc_sma_malloc(n TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ apc_sma_strdup */ ++char* apc_sma_strdup(const char* s TSRMLS_DC) ++{ ++ void* q; ++ int len; ++ ++ if(!s) return NULL; ++ ++ len = strlen(s)+1; ++ q = apc_sma_malloc(len TSRMLS_CC); ++ if(!q) return NULL; ++ memcpy(q, s, len); ++ return q; ++} ++/* }}} */ ++ ++/* {{{ apc_sma_free */ ++void apc_sma_free(void* p TSRMLS_DC) ++{ ++ uint i; ++ size_t offset; ++ size_t d_size; ++ ++ if (p == NULL) { ++ return; ++ } ++ ++ assert(sma_initialized); ++ ++ ++ for (i = 0; i < sma_numseg; i++) { ++ offset = (size_t)((char *)p - SMA_ADDR(i)); ++ if (p >= (void*)SMA_ADDR(i) && offset < sma_segsize) { ++ LOCK(SMA_LCK(i)); ++ d_size = sma_deallocate(SMA_HDR(i), offset); ++ UNLOCK(SMA_LCK(i)); ++#ifdef VALGRIND_FREELIKE_BLOCK ++ VALGRIND_FREELIKE_BLOCK(p, 0); ++#endif ++ return; ++ } ++ } ++ ++ apc_error("apc_sma_free: could not locate address %p" TSRMLS_CC, p); ++} ++/* }}} */ ++ ++#ifdef APC_MEMPROTECT ++/* {{{ */ ++void* apc_sma_protect(void *p) ++{ ++ unsigned int i = 0; ++ size_t offset; ++ ++ if (p == NULL) { ++ return NULL; ++ } ++ ++ if(SMA_RO(sma_lastseg) == NULL) return p; ++ ++ offset = (size_t)((char *)p - SMA_ADDR(sma_lastseg)); ++ ++ if(p >= (void*)SMA_ADDR(sma_lastseg) && offset < sma_segsize) { ++ return SMA_RO(sma_lastseg) + offset; ++ } ++ ++ for (i = 0; i < sma_numseg; i++) { ++ offset = (size_t)((char *)p - SMA_ADDR(i)); ++ if (p >= (void*)SMA_ADDR(i) && offset < sma_segsize) { ++ return SMA_RO(i) + offset; ++ } ++ } ++ ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ */ ++void* apc_sma_unprotect(void *p) ++{ ++ unsigned int i = 0; ++ size_t offset; ++ ++ if (p == NULL) { ++ return NULL; ++ } ++ ++ if(SMA_RO(sma_lastseg) == NULL) return p; ++ ++ offset = (size_t)((char *)p - SMA_RO(sma_lastseg)); ++ ++ if(p >= (void*)SMA_RO(sma_lastseg) && offset < sma_segsize) { ++ return SMA_ADDR(sma_lastseg) + offset; ++ } ++ ++ for (i = 0; i < sma_numseg; i++) { ++ offset = (size_t)((char *)p - SMA_RO(i)); ++ if (p >= (void*)SMA_RO(i) && offset < sma_segsize) { ++ return SMA_ADDR(i) + offset; ++ } ++ } ++ ++ return NULL; ++} ++/* }}} */ ++#else ++/* {{{ */ ++void* apc_sma_protect(void *p) { return p; } ++void* apc_sma_unprotect(void *p) { return p; } ++/* }}} */ ++#endif ++ ++/* {{{ apc_sma_info */ ++apc_sma_info_t* apc_sma_info(zend_bool limited TSRMLS_DC) ++{ ++ apc_sma_info_t* info; ++ apc_sma_link_t** link; ++ uint i; ++ char* shmaddr; ++ block_t* prv; ++ ++ if (!sma_initialized) { ++ return NULL; ++ } ++ ++ info = (apc_sma_info_t*) apc_emalloc(sizeof(apc_sma_info_t) TSRMLS_CC); ++ info->num_seg = sma_numseg; ++ info->seg_size = sma_segsize - (ALIGNWORD(sizeof(sma_header_t)) + ALIGNWORD(sizeof(block_t)) + ALIGNWORD(sizeof(block_t))); ++ ++ info->list = apc_emalloc(info->num_seg * sizeof(apc_sma_link_t*) TSRMLS_CC); ++ for (i = 0; i < sma_numseg; i++) { ++ info->list[i] = NULL; ++ } ++ ++ if(limited) return info; ++ ++ /* For each segment */ ++ for (i = 0; i < sma_numseg; i++) { ++ RDLOCK(SMA_LCK(i)); ++ shmaddr = SMA_ADDR(i); ++ prv = BLOCKAT(ALIGNWORD(sizeof(sma_header_t))); ++ ++ link = &info->list[i]; ++ ++ /* For each block in this segment */ ++ while (BLOCKAT(prv->fnext)->fnext != 0) { ++ block_t* cur = BLOCKAT(prv->fnext); ++#ifdef __APC_SMA_DEBUG__ ++ CHECK_CANARY(cur); ++#endif ++ ++ *link = apc_emalloc(sizeof(apc_sma_link_t) TSRMLS_CC); ++ (*link)->size = cur->size; ++ (*link)->offset = prv->fnext; ++ (*link)->next = NULL; ++ link = &(*link)->next; ++ ++ prv = cur; ++ ++#if ALLOC_DISTRIBUTION ++ sma_header_t* header = (sma_header_t*) segment->shmaddr; ++ memcpy(info->seginfo[i].adist, header->adist, sizeof(size_t) * 30); ++#endif ++ ++ } ++ RDUNLOCK(SMA_LCK(i)); ++ } ++ ++ return info; ++} ++/* }}} */ ++ ++/* {{{ apc_sma_free_info */ ++void apc_sma_free_info(apc_sma_info_t* info TSRMLS_DC) ++{ ++ int i; ++ ++ for (i = 0; i < info->num_seg; i++) { ++ apc_sma_link_t* p = info->list[i]; ++ while (p) { ++ apc_sma_link_t* q = p; ++ p = p->next; ++ apc_efree(q TSRMLS_CC); ++ } ++ } ++ apc_efree(info->list TSRMLS_CC); ++ apc_efree(info TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ apc_sma_get_avail_mem */ ++size_t apc_sma_get_avail_mem() ++{ ++ size_t avail_mem = 0; ++ uint i; ++ ++ for (i = 0; i < sma_numseg; i++) { ++ sma_header_t* header = SMA_HDR(i); ++ avail_mem += header->avail; ++ } ++ return avail_mem; ++} ++/* }}} */ ++ ++/* {{{ apc_sma_get_avail_size */ ++zend_bool apc_sma_get_avail_size(size_t size) ++{ ++ uint i; ++ ++ for (i = 0; i < sma_numseg; i++) { ++ sma_header_t* header = SMA_HDR(i); ++ if (header->avail > size) { ++ return 1; ++ } ++ } ++ return 0; ++} ++/* }}} */ ++ ++ ++#if ALLOC_DISTRIBUTION ++size_t *apc_sma_get_alloc_distribution(void) { ++ sma_header_t* header = (sma_header_t*) segment->sma_shmaddr; ++ return header->adist; ++} ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_sma.h b/ext/apc/apc_sma.h +--- a/ext/apc/apc_sma.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_sma.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,103 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_sma.h 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#ifndef APC_SMA_H ++#define APC_SMA_H ++ ++#define ALLOC_DISTRIBUTION 0 ++ ++#include "apc.h" ++ ++/* Simple shared memory allocator */ ++ ++typedef struct _apc_segment_t apc_segment_t; ++ ++struct _apc_segment_t { ++ size_t size; ++ void* shmaddr; ++#ifdef APC_MEMPROTECT ++ void* roaddr; ++#endif ++}; ++ ++extern void apc_sma_init(int numseg, size_t segsize, char *mmap_file_mask TSRMLS_DC); ++extern void apc_sma_cleanup(TSRMLS_D); ++extern void* apc_sma_malloc(size_t size TSRMLS_DC); ++extern void* apc_sma_malloc_ex(size_t size, size_t fragment, size_t* allocated TSRMLS_DC); ++extern void* apc_sma_realloc(void* p, size_t size TSRMLS_DC); ++extern char* apc_sma_strdup(const char *s TSRMLS_DC); ++extern void apc_sma_free(void* p TSRMLS_DC); ++#if ALLOC_DISTRIBUTION ++extern size_t *apc_sma_get_alloc_distribution(); ++#endif ++ ++extern void* apc_sma_protect(void *p); ++extern void* apc_sma_unprotect(void *p); ++ ++/* {{{ struct definition: apc_sma_link_t */ ++typedef struct apc_sma_link_t apc_sma_link_t; ++struct apc_sma_link_t { ++ long size; /* size of this free block */ ++ long offset; /* offset in segment of this block */ ++ apc_sma_link_t* next; /* link to next free block */ ++}; ++/* }}} */ ++ ++/* {{{ struct definition: apc_sma_info_t */ ++typedef struct apc_sma_info_t apc_sma_info_t; ++struct apc_sma_info_t { ++ int num_seg; /* number of shared memory segments */ ++ size_t seg_size; /* size of each shared memory segment */ ++ apc_sma_link_t** list; /* there is one list per segment */ ++}; ++/* }}} */ ++ ++extern apc_sma_info_t* apc_sma_info(zend_bool limited TSRMLS_DC); ++extern void apc_sma_free_info(apc_sma_info_t* info TSRMLS_DC); ++ ++extern size_t apc_sma_get_avail_mem(); ++extern zend_bool apc_sma_get_avail_size(size_t size); ++extern void apc_sma_check_integrity(); ++ ++/* {{{ ALIGNWORD: pad up x, aligned to the system's word boundary */ ++typedef union { void* p; int i; long l; double d; void (*f)(); } apc_word_t; ++#define ALIGNSIZE(x, size) ((size) * (1 + (((x)-1)/(size)))) ++#define ALIGNWORD(x) ALIGNSIZE(x, sizeof(apc_word_t)) ++/* }}} */ ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_spin.c b/ext/apc/apc_spin.c +--- a/ext/apc/apc_spin.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_spin.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,66 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Brian Shire | ++ +----------------------------------------------------------------------+ ++ ++ */ ++ ++/* $Id: apc_spin.c 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#include "apc_spin.h" ++ ++#ifdef APC_SPIN_LOCKS ++ ++slock_t *apc_slock_create(slock_t *lock) ++{ ++ S_INIT_LOCK(lock); ++ return lock; ++} ++ ++void apc_slock_destroy(slock_t *lock) ++{ ++ return; ++} ++ ++void apc_slock_lock(slock_t *lock TSRMLS_DC) ++{ ++ S_LOCK(lock); ++} ++ ++void apc_slock_unlock(slock_t *lock) ++{ ++ S_UNLOCK(lock); ++} ++ ++zend_bool apc_slock_nonblocking_lock(slock_t *lock) ++{ ++ /* Technically we aren't supposed to call this directly, but the original ++ * code provides no method for absolute non-blocking locks, so we'll call into ++ * the TAS (test and set) functionality directly ++ */ ++ return !(TAS(lock)); /* if TAS returns 0 we obtained the lock, otherwise we failed */ ++} ++ ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_spin.h b/ext/apc/apc_spin.h +--- a/ext/apc/apc_spin.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_spin.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,48 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Brian Shire | ++ +----------------------------------------------------------------------+ ++ ++ */ ++ ++/* $Id: apc_spin.h 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#ifndef APC_SPIN_H ++#define APC_SPIN_H ++ ++#include "apc.h" ++ ++#ifdef APC_SPIN_LOCKS ++ ++#include "pgsql_s_lock.h" ++ ++slock_t *apc_slock_create(slock_t *lock); ++void apc_slock_destroy(slock_t *lock); ++void apc_slock_lock(slock_t *lock TSRMLS_DC); ++zend_bool apc_slock_nonblocking_lock(slock_t *lock); ++void apc_slock_unlock(slock_t *lock); ++ ++#endif ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_stack.c b/ext/apc/apc_stack.c +--- a/ext/apc/apc_stack.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_stack.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,106 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_stack.c 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#include "apc.h" ++#include "apc_stack.h" ++ ++struct apc_stack_t { ++ void** data; ++ int capacity; ++ int size; ++}; ++ ++apc_stack_t* apc_stack_create(int size_hint TSRMLS_DC) ++{ ++ apc_stack_t* stack = (apc_stack_t*) apc_emalloc(sizeof(apc_stack_t) TSRMLS_CC); ++ ++ stack->capacity = (size_hint > 0) ? size_hint : 10; ++ stack->size = 0; ++ stack->data = (void**) apc_emalloc(sizeof(void*) * stack->capacity TSRMLS_CC); ++ ++ return stack; ++} ++ ++void apc_stack_destroy(apc_stack_t* stack TSRMLS_DC) ++{ ++ if (stack != NULL) { ++ apc_efree(stack->data TSRMLS_CC); ++ apc_efree(stack TSRMLS_CC); ++ } ++} ++ ++void apc_stack_clear(apc_stack_t* stack) ++{ ++ assert(stack != NULL); ++ stack->size = 0; ++} ++ ++void apc_stack_push(apc_stack_t* stack, void* item TSRMLS_DC) ++{ ++ assert(stack != NULL); ++ if (stack->size == stack->capacity) { ++ stack->capacity *= 2; ++ stack->data = apc_erealloc(stack->data, sizeof(void*)*stack->capacity TSRMLS_CC); ++ } ++ stack->data[stack->size++] = item; ++} ++ ++void* apc_stack_pop(apc_stack_t* stack) ++{ ++ assert(stack != NULL && stack->size > 0); ++ return stack->data[--stack->size]; ++} ++ ++void* apc_stack_top(apc_stack_t* stack) ++{ ++ assert(stack != NULL && stack->size > 0); ++ return stack->data[stack->size-1]; ++} ++ ++void* apc_stack_get(apc_stack_t* stack, int n) ++{ ++ assert(stack != NULL && stack->size > n); ++ return stack->data[n]; ++} ++ ++int apc_stack_size(apc_stack_t* stack) ++{ ++ assert(stack != NULL); ++ return stack->size; ++} ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_stack.h b/ext/apc/apc_stack.h +--- a/ext/apc/apc_stack.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_stack.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,58 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | George Schlossnagle | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_stack.h 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#ifndef APC_STACK_H ++#define APC_STACK_H ++ ++/* Basic stack datatype */ ++ ++#define T apc_stack_t* ++typedef struct apc_stack_t apc_stack_t; /* opaque stack type */ ++ ++extern T apc_stack_create(int size_hint TSRMLS_DC); ++extern void apc_stack_destroy(T stack TSRMLS_DC); ++extern void apc_stack_clear(T stack); ++extern void apc_stack_push(T stack, void* item TSRMLS_DC); ++extern void* apc_stack_pop(T stack); ++extern void* apc_stack_top(T stack); ++extern void* apc_stack_get(T stack, int n); ++extern int apc_stack_size(T stack); ++ ++#undef T ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_string.c b/ext/apc/apc_string.c +--- a/ext/apc/apc_string.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_string.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,261 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Dmitry Stogov | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_string.c 326089 2012-06-11 04:29:57Z rasmus $ */ ++ ++#include "apc.h" ++#include "apc_globals.h" ++#include "apc_php.h" ++#include "apc_lock.h" ++ ++#ifdef ZEND_ENGINE_2_4 ++ ++#ifndef ZTS ++typedef struct _apc_interned_strings_data_t { ++ char *interned_strings_start; ++ char *interned_strings_end; ++ char *interned_strings_top; ++ apc_lck_t lock; ++ HashTable interned_strings; ++} apc_interned_strings_data_t; ++ ++apc_interned_strings_data_t *apc_interned_strings_data = NULL; ++ ++#define APCSG(v) (apc_interned_strings_data->v) ++ ++static char *old_interned_strings_start; ++static char *old_interned_strings_end; ++static const char *(*old_new_interned_string)(const char *str, int len, int free_src TSRMLS_DC); ++static void (*old_interned_strings_snapshot)(TSRMLS_D); ++static void (*old_interned_strings_restore)(TSRMLS_D); ++ ++static const char *apc_dummy_new_interned_string_for_php(const char *str, int len, int free_src TSRMLS_DC) ++{ ++ return str; ++} ++ ++static void apc_dummy_interned_strings_snapshot_for_php(TSRMLS_D) ++{ ++} ++ ++static void apc_dummy_interned_strings_restore_for_php(TSRMLS_D) ++{ ++} ++#endif ++ ++const char *apc_new_interned_string(const char *arKey, int nKeyLength TSRMLS_DC) ++{ ++#ifndef ZTS ++ ulong h; ++ uint nIndex; ++ Bucket *p; ++ ++ if (arKey >= APCSG(interned_strings_start) && arKey < APCSG(interned_strings_end)) { ++ return arKey; ++ } ++ ++ h = zend_inline_hash_func(arKey, nKeyLength); ++ nIndex = h & APCSG(interned_strings).nTableMask; ++ ++ p = APCSG(interned_strings).arBuckets[nIndex]; ++ while (p != NULL) { ++ if ((p->h == h) && (p->nKeyLength == nKeyLength)) { ++ if (!memcmp(p->arKey, arKey, nKeyLength)) { ++ return p->arKey; ++ } ++ } ++ p = p->pNext; ++ } ++ ++ if (APCSG(interned_strings_top) + ZEND_MM_ALIGNED_SIZE(sizeof(Bucket) + nKeyLength + 1) >= ++ APCSG(interned_strings_end)) { ++ /* no memory */ ++ return NULL; ++ } ++ ++ p = (Bucket *) APCSG(interned_strings_top); ++ APCSG(interned_strings_top) += ZEND_MM_ALIGNED_SIZE(sizeof(Bucket) + nKeyLength + 1); ++ ++ p->arKey = (char*)(p+1); ++ memcpy(p->arKey, arKey, nKeyLength); ++ ((char *)p->arKey)[nKeyLength] = '\0'; ++ p->nKeyLength = nKeyLength; ++ p->h = h; ++ p->pData = &p->pDataPtr; ++ p->pDataPtr = p; ++ ++ p->pNext = APCSG(interned_strings).arBuckets[nIndex]; ++ p->pLast = NULL; ++ if (p->pNext) { ++ p->pNext->pLast = p; ++ } ++ APCSG(interned_strings).arBuckets[nIndex] = p; ++ ++ p->pListLast = APCSG(interned_strings).pListTail; ++ APCSG(interned_strings).pListTail = p; ++ p->pListNext = NULL; ++ if (p->pListLast != NULL) { ++ p->pListLast->pListNext = p; ++ } ++ if (!APCSG(interned_strings).pListHead) { ++ APCSG(interned_strings).pListHead = p; ++ } ++ ++ APCSG(interned_strings).nNumOfElements++; ++ ++ return p->arKey; ++#else ++ return zend_new_interned_string(arKey, nKeyLength, 0 TSRMLS_CC); ++#endif ++} ++ ++#ifndef ZTS ++static void apc_copy_internal_strings(TSRMLS_D) ++{ ++ Bucket *p, *q; ++ ++ p = CG(function_table)->pListHead; ++ while (p) { ++ if (p->nKeyLength) { ++ p->arKey = apc_new_interned_string(p->arKey, p->nKeyLength TSRMLS_CC); ++ } ++ p = p->pListNext; ++ } ++ ++ p = CG(class_table)->pListHead; ++ while (p) { ++ zend_class_entry *ce = (zend_class_entry*)(p->pDataPtr); ++ ++ if (p->nKeyLength) { ++ p->arKey = apc_new_interned_string(p->arKey, p->nKeyLength TSRMLS_CC); ++ } ++ ++ if (ce->name) { ++ ce->name = apc_new_interned_string(ce->name, ce->name_length+1 TSRMLS_CC); ++ } ++ ++ q = ce->properties_info.pListHead; ++ while (q) { ++ zend_property_info *info = (zend_property_info*)(q->pData); ++ ++ if (q->nKeyLength) { ++ q->arKey = apc_new_interned_string(q->arKey, q->nKeyLength TSRMLS_CC); ++ } ++ ++ if (info->name) { ++ info->name = apc_new_interned_string(info->name, info->name_length+1 TSRMLS_CC); ++ } ++ ++ q = q->pListNext; ++ } ++ ++ q = ce->function_table.pListHead; ++ while (q) { ++ if (q->nKeyLength) { ++ q->arKey = apc_new_interned_string(q->arKey, q->nKeyLength TSRMLS_CC); ++ } ++ q = q->pListNext; ++ } ++ ++ q = ce->constants_table.pListHead; ++ while (q) { ++ if (q->nKeyLength) { ++ q->arKey = apc_new_interned_string(q->arKey, q->nKeyLength TSRMLS_CC); ++ } ++ q = q->pListNext; ++ } ++ ++ p = p->pListNext; ++ } ++ ++ p = EG(zend_constants)->pListHead; ++ while (p) { ++ if (p->nKeyLength) { ++ p->arKey = apc_new_interned_string(p->arKey, p->nKeyLength TSRMLS_CC); ++ } ++ p = p->pListNext; ++ } ++} ++ ++void apc_interned_strings_init(TSRMLS_D) ++{ ++ int count = APCG(shm_strings_buffer) / (sizeof(Bucket) + sizeof(Bucket*) * 2); ++ ++ apc_interned_strings_data = (apc_interned_strings_data_t*) apc_sma_malloc(APCG(shm_strings_buffer) TSRMLS_CC); ++ memset((void *)apc_interned_strings_data, 0, APCG(shm_strings_buffer)); ++ ++ CREATE_LOCK(APCSG(lock)); ++ ++ zend_hash_init(&APCSG(interned_strings), count, NULL, NULL, 1); ++ APCSG(interned_strings).nTableMask = APCSG(interned_strings).nTableSize - 1; ++ APCSG(interned_strings).arBuckets = (Bucket**)((char*)apc_interned_strings_data + sizeof(apc_interned_strings_data_t)); ++ ++ APCSG(interned_strings_start) = (char*)APCSG(interned_strings).arBuckets + APCSG(interned_strings).nTableSize * sizeof(Bucket *); ++ APCSG(interned_strings_end) = (char*)apc_interned_strings_data + APCG(shm_strings_buffer); ++ APCSG(interned_strings_top) = APCSG(interned_strings_start); ++ ++ old_interned_strings_start = CG(interned_strings_start); ++ old_interned_strings_end = CG(interned_strings_end); ++ old_new_interned_string = zend_new_interned_string; ++ old_interned_strings_snapshot = zend_interned_strings_snapshot; ++ old_interned_strings_restore = zend_interned_strings_restore; ++ ++ CG(interned_strings_start) = APCSG(interned_strings_start); ++ CG(interned_strings_end) = APCSG(interned_strings_end); ++ zend_new_interned_string = apc_dummy_new_interned_string_for_php; ++ zend_interned_strings_snapshot = apc_dummy_interned_strings_snapshot_for_php; ++ zend_interned_strings_restore = apc_dummy_interned_strings_restore_for_php; ++ ++ apc_copy_internal_strings(TSRMLS_C); ++} ++ ++void apc_interned_strings_shutdown(TSRMLS_D) ++{ ++ zend_hash_clean(CG(function_table)); ++ zend_hash_clean(CG(class_table)); ++ zend_hash_clean(EG(zend_constants)); ++ ++ CG(interned_strings_start) = old_interned_strings_start; ++ CG(interned_strings_end) = old_interned_strings_end; ++ zend_new_interned_string = old_new_interned_string; ++ zend_interned_strings_snapshot = old_interned_strings_snapshot; ++ zend_interned_strings_restore = old_interned_strings_restore; ++ ++ DESTROY_LOCK(APCSG(lock)); ++} ++#endif ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_string.h b/ext/apc/apc_string.h +--- a/ext/apc/apc_string.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_string.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,51 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Dmitry Stogov | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_string.h 324145 2012-03-12 11:38:28Z pajoye $ */ ++ ++#ifndef APC_STRING ++#define APC_STRING ++ ++#include "apc.h" ++ ++#ifndef ZTS ++void apc_interned_strings_init(TSRMLS_D); ++void apc_interned_strings_shutdown(TSRMLS_D); ++#endif ++ ++const char *apc_new_interned_string(const char *arKey, int nKeyLength TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_windows_srwlock_kernel.c b/ext/apc/apc_windows_srwlock_kernel.c +--- a/ext/apc/apc_windows_srwlock_kernel.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_windows_srwlock_kernel.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,133 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Pierre Joye | ++ +----------------------------------------------------------------------+ ++ */ ++/* $Id$ */ ++/* ++ These APIs are not actually exposed nor documented. But should work fine ++ from a binary as available since XP without signature changes. ++*/ ++/* ++TODOs: ++non blocking could be possible using the fWait argument (to 0). However ++I'm not sure whether the wait handlers is actually implemented in all ++supported platforms (xp+). could be enabled later once really tested. ++ */ ++/* $Id: $ */ ++ ++#include ++ ++#ifdef APC_SRWLOCK_KERNEL ++#include "apc_windows_srwlock_kernel.h" ++ ++/* ++For references: ++void WINAPI RtlInitializeResource(LPRTL_RWLOCK rwl); ++void WINAPI RtlDeleteResource(LPRTL_RWLOCK rwl); ++BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK rwl, BYTE fWait); ++BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK rwl, BYTE fWait); ++void WINAPI RtlReleaseResource(LPRTL_RWLOCK rwl); ++*/ ++typedef void (WINAPI *tRtlInitializeResource)(LPRTL_RWLOCK rwl); ++typedef void (WINAPI *tRtlDeleteResource)(LPRTL_RWLOCK rwl); ++typedef BYTE (WINAPI *tRtlAcquireResourceExclusive)(LPRTL_RWLOCK rwl, BYTE fWait); ++typedef BYTE (WINAPI *tRtlAcquireResourceShared)(LPRTL_RWLOCK rwl, BYTE fWait); ++typedef void (WINAPI *tRtlReleaseResource)(LPRTL_RWLOCK rwl); ++typedef void (WINAPI *tRtlDumpResource)(LPRTL_RWLOCK rwl); ++ ++tRtlInitializeResource pRtlInitializeResource = 0; ++tRtlDeleteResource pRtlDeleteResource = 0; ++tRtlAcquireResourceExclusive pRtlAcquireResourceExclusive = 0; ++tRtlAcquireResourceShared pRtlAcquireResourceShared = 0; ++tRtlReleaseResource pRtlReleaseResource = 0; ++tRtlDumpResource pRtlDumpResource = 0; ++ ++HINSTANCE ntdll; ++ ++void apc_windows_cs_status(apc_windows_cs_rwlock_t *lock ); ++apc_windows_cs_rwlock_t *apc_windows_cs_create(apc_windows_cs_rwlock_t *lock TSRMLS_DC) ++{ ++ ntdll = LoadLibrary("ntdll.dll"); ++ if (ntdll == 0) { ++ return NULL; ++ } ++ ++ pRtlInitializeResource = (tRtlInitializeResource) GetProcAddress(ntdll, "RtlInitializeResource"); ++ pRtlDeleteResource = (tRtlDeleteResource) GetProcAddress(ntdll, "RtlDeleteResource"); ++ pRtlAcquireResourceExclusive = (tRtlAcquireResourceExclusive) GetProcAddress(ntdll, "RtlAcquireResourceExclusive"); ++ pRtlAcquireResourceShared = (tRtlAcquireResourceShared) GetProcAddress(ntdll, "RtlAcquireResourceShared"); ++ pRtlReleaseResource = (tRtlReleaseResource) GetProcAddress(ntdll, "RtlReleaseResource"); ++ pRtlDumpResource = (tRtlReleaseResource) GetProcAddress(ntdll, "RtlDumpResource"); ++ if (pRtlInitializeResource == 0 || pRtlDeleteResource == 0 || pRtlAcquireResourceExclusive == 0 || ++ pRtlAcquireResourceShared == 0 || pRtlReleaseResource == 0 || pRtlDumpResource == 0) { ++ return NULL; ++ } ++ pRtlInitializeResource(lock); ++ return lock; ++} ++ ++void apc_windows_cs_destroy(apc_windows_cs_rwlock_t *lock) ++{ ++ __try ++ { ++ pRtlDeleteResource(lock); ++ } ++ __except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? ++ EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) ++ { ++ /* Ignore exception (resource was freed during shutdown of another thread) */ ++ } ++ FreeLibrary(ntdll); ++ return; ++} ++ ++void apc_windows_cs_lock(apc_windows_cs_rwlock_t *lock TSRMLS_DC) ++{ ++ pRtlAcquireResourceExclusive(lock, 1); ++} ++ ++void apc_windows_cs_rdlock(apc_windows_cs_rwlock_t *lock TSRMLS_DC) ++{ ++ pRtlAcquireResourceShared(lock, 1); ++} ++ ++void apc_windows_cs_unlock_rd(apc_windows_cs_rwlock_t *lock TSRMLS_DC) ++{ ++ pRtlReleaseResource(lock); ++} ++ ++void apc_windows_cs_unlock_wr(apc_windows_cs_rwlock_t *lock TSRMLS_DC) ++{ ++ pRtlReleaseResource(lock); ++} ++ ++/* debugging purposes, output using trace msgs */ ++void apc_windows_cs_status(apc_windows_cs_rwlock_t *lock) ++{ ++ pRtlDumpResource(lock); ++ return; ++} ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_windows_srwlock_kernel.h b/ext/apc/apc_windows_srwlock_kernel.h +--- a/ext/apc/apc_windows_srwlock_kernel.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_windows_srwlock_kernel.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,74 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Pierre Joye | ++ +----------------------------------------------------------------------+ ++ */ ++/* $Id$ */ ++ ++#ifndef APC_WINDOWS_CS_RWLOCK_H ++#define APC_WINDOWS_CS_RWLOCK_H ++ ++#include "apc.h" ++ ++#ifdef APC_SRWLOCK_KERNEL ++ ++typedef struct _RTL_RWLOCK { ++ RTL_CRITICAL_SECTION rtlCS; ++ ++ HANDLE hSharedReleaseSemaphore; ++ UINT uSharedWaiters; ++ ++ HANDLE hExclusiveReleaseSemaphore; ++ UINT uExclusiveWaiters; ++ ++ INT iNumberActive; ++ HANDLE hOwningThreadId; ++ DWORD dwTimeoutBoost; ++ PVOID pDebugInfo; ++} RTL_RWLOCK, *LPRTL_RWLOCK; ++ ++#define apc_windows_cs_rwlock_t RTL_RWLOCK ++ ++struct apc_windows_cs_rwlock_t { ++ CRITICAL_SECTION cs; ++ LONG writers_waiting_count; ++ LONG readers_waiting_count; ++ DWORD active_writers_readers_flag; ++ HANDLE ready_to_read; ++ HANDLE ready_to_write; ++ DWORD reader_races_lost; ++}; ++ ++apc_windows_cs_rwlock_t *apc_windows_cs_create(apc_windows_cs_rwlock_t *lock TSRMLS_DC); ++void apc_windows_cs_destroy(apc_windows_cs_rwlock_t *lock); ++void apc_windows_cs_lock(apc_windows_cs_rwlock_t *lock TSRMLS_DC); ++void apc_windows_cs_rdlock(apc_windows_cs_rwlock_t *lock TSRMLS_DC); ++void apc_windows_cs_unlock_rd(apc_windows_cs_rwlock_t *lock TSRMLS_DC); ++void apc_windows_cs_unlock_wr(apc_windows_cs_rwlock_t *lock TSRMLS_DC); ++# if NONBLOCKING_LOCK_AVAILABLE==1 /* Only in win7/2008 */ ++zend_bool apc_pthreadrwlock_nonblocking_lock(apc_windows_cs_rwlock_t *lock TSRMLS_DC); ++# endif ++#endif ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_zend.c b/ext/apc/apc_zend.c +--- a/ext/apc/apc_zend.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_zend.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,271 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_zend.c 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++#include "apc_zend.h" ++#include "apc_globals.h" ++ ++/* true global */ ++int apc_reserved_offset; ++ ++void* apc_php_malloc(size_t n TSRMLS_DC) ++{ ++ return emalloc(n); ++} ++ ++void apc_php_free(void* p TSRMLS_DC) ++{ ++ efree(p); ++} ++ ++#ifdef APC_OPCODE_OVERRIDE ++ ++static opcode_handler_t *apc_original_opcode_handlers; ++static opcode_handler_t apc_opcode_handlers[APC_OPCODE_HANDLER_COUNT]; ++ ++#define APC_EX_T(offset) (*(temp_variable *)((char*)execute_data->Ts + offset)) ++ ++#ifdef ZEND_ENGINE_2_4 ++static zval *apc_get_zval_ptr(zend_uchar op_type, znode_op *node, zval **freeval, zend_execute_data *execute_data TSRMLS_DC) ++{ ++ *freeval = NULL; ++ ++ switch (op_type) { ++ case IS_CONST: ++ return node->zv; ++ case IS_VAR: ++ return APC_EX_T(node->var).var.ptr; ++ case IS_TMP_VAR: ++ return (*freeval = &APC_EX_T(node->var).tmp_var); ++ case IS_CV: ++ { ++ zval ***ret = &execute_data->CVs[node->var]; ++ ++ if (!*ret) { ++ zend_compiled_variable *cv = &EG(active_op_array)->vars[node->var]; ++ ++ if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void**)ret)==FAILURE) { ++ apc_notice("Undefined variable: %s" TSRMLS_CC, cv->name); ++ return &EG(uninitialized_zval); ++ } ++ } ++ return **ret; ++ } ++ case IS_UNUSED: ++ default: ++ return NULL; ++ } ++} ++#else ++static zval *apc_get_zval_ptr(znode *node, zval **freeval, zend_execute_data *execute_data TSRMLS_DC) ++{ ++ *freeval = NULL; ++ ++ switch (node->op_type) { ++ case IS_CONST: ++ return &(node->u.constant); ++ case IS_VAR: ++ return APC_EX_T(node->u.var).var.ptr; ++ case IS_TMP_VAR: ++ return (*freeval = &APC_EX_T(node->u.var).tmp_var); ++#ifdef ZEND_ENGINE_2_1 ++ case IS_CV: ++ { ++ zval ***ret = &execute_data->CVs[node->u.var]; ++ ++ if (!*ret) { ++ zend_compiled_variable *cv = &EG(active_op_array)->vars[node->u.var]; ++ ++ if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void**)ret)==FAILURE) { ++ apc_notice("Undefined variable: %s" TSRMLS_CC, cv->name); ++ return &EG(uninitialized_zval); ++ } ++ } ++ return **ret; ++ } ++#endif ++ case IS_UNUSED: ++ default: ++ return NULL; ++ } ++} ++#endif ++ ++static int ZEND_FASTCALL apc_op_ZEND_INCLUDE_OR_EVAL(ZEND_OPCODE_HANDLER_ARGS) ++{ ++ APC_ZEND_OPLINE ++ zval *freeop1 = NULL; ++ zval *inc_filename = NULL, tmp_inc_filename; ++ char realpath[MAXPATHLEN]; ++ php_stream_wrapper *wrapper; ++ char *path_for_open; ++ char *full_path = NULL; ++ int ret = 0; ++ apc_opflags_t* flags = NULL; ++ ++#ifdef ZEND_ENGINE_2_4 ++ if (opline->extended_value != ZEND_INCLUDE_ONCE && ++ opline->extended_value != ZEND_REQUIRE_ONCE) { ++ return apc_original_opcode_handlers[APC_OPCODE_HANDLER_DECODE(opline)](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); ++ } ++ ++ inc_filename = apc_get_zval_ptr(opline->op1_type, &opline->op1, &freeop1, execute_data TSRMLS_CC); ++#else ++ if (Z_LVAL(opline->op2.u.constant) != ZEND_INCLUDE_ONCE && ++ Z_LVAL(opline->op2.u.constant) != ZEND_REQUIRE_ONCE) { ++ return apc_original_opcode_handlers[APC_OPCODE_HANDLER_DECODE(opline)](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); ++ } ++ ++ inc_filename = apc_get_zval_ptr(&opline->op1, &freeop1, execute_data TSRMLS_CC); ++#endif ++ ++ if (Z_TYPE_P(inc_filename) != IS_STRING) { ++ tmp_inc_filename = *inc_filename; ++ zval_copy_ctor(&tmp_inc_filename); ++ convert_to_string(&tmp_inc_filename); ++ inc_filename = &tmp_inc_filename; ++ } ++ ++ wrapper = php_stream_locate_url_wrapper(Z_STRVAL_P(inc_filename), &path_for_open, 0 TSRMLS_CC); ++ ++ if (wrapper != &php_plain_files_wrapper || !(IS_ABSOLUTE_PATH(path_for_open, strlen(path_for_open)) || (full_path = expand_filepath(path_for_open, realpath TSRMLS_CC)))) { ++ /* Fallback to original handler */ ++ if (inc_filename == &tmp_inc_filename) { ++ zval_dtor(&tmp_inc_filename); ++ } ++ return apc_original_opcode_handlers[APC_OPCODE_HANDLER_DECODE(opline)](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); ++ } ++ ++ if (!full_path) { ++ full_path = path_for_open; ++ } ++ if (zend_hash_exists(&EG(included_files), realpath, strlen(realpath) + 1)) { ++#ifdef ZEND_ENGINE_2_4 ++ if (!(opline->result_type & EXT_TYPE_UNUSED)) { ++ ALLOC_INIT_ZVAL(APC_EX_T(opline->result.var).var.ptr); ++ ZVAL_TRUE(APC_EX_T(opline->result.var).var.ptr); ++ } ++#else ++ if (!(opline->result.u.EA.type & EXT_TYPE_UNUSED)) { ++ ALLOC_INIT_ZVAL(APC_EX_T(opline->result.u.var).var.ptr); ++ ZVAL_TRUE(APC_EX_T(opline->result.u.var).var.ptr); ++ } ++#endif ++ if (inc_filename == &tmp_inc_filename) { ++ zval_dtor(&tmp_inc_filename); ++ } ++ if (freeop1) { ++ zval_dtor(freeop1); ++ } ++ execute_data->opline++; ++ return 0; ++ } ++ ++ if (inc_filename == &tmp_inc_filename) { ++ zval_dtor(&tmp_inc_filename); ++ } ++ ++ if(apc_reserved_offset != -1) { ++ /* Insanity alert: look into apc_compile.c for why a void** is cast to a apc_opflags_t* */ ++ flags = (apc_opflags_t*) & (execute_data->op_array->reserved[apc_reserved_offset]); ++ } ++ ++ if(flags && flags->deep_copy == 1) { ++ /* Since the op array is a local copy, we can cheat our way through the file inclusion by temporarily ++ * changing the op to a plain require/include, calling its handler and finally restoring the opcode. ++ */ ++#ifdef ZEND_ENGINE_2_4 ++ opline->extended_value = (opline->extended_value == ZEND_INCLUDE_ONCE) ? ZEND_INCLUDE : ZEND_REQUIRE; ++ ret = apc_original_opcode_handlers[APC_OPCODE_HANDLER_DECODE(opline)](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); ++ opline->extended_value = (opline->extended_value == ZEND_INCLUDE) ? ZEND_INCLUDE_ONCE : ZEND_REQUIRE_ONCE; ++#else ++ Z_LVAL(opline->op2.u.constant) = (Z_LVAL(opline->op2.u.constant) == ZEND_INCLUDE_ONCE) ? ZEND_INCLUDE : ZEND_REQUIRE; ++ ret = apc_original_opcode_handlers[APC_OPCODE_HANDLER_DECODE(opline)](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); ++ Z_LVAL(opline->op2.u.constant) = (Z_LVAL(opline->op2.u.constant) == ZEND_INCLUDE) ? ZEND_INCLUDE_ONCE : ZEND_REQUIRE_ONCE; ++#endif ++ } else { ++ ret = apc_original_opcode_handlers[APC_OPCODE_HANDLER_DECODE(opline)](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); ++ } ++ ++ return ret; ++} ++ ++void apc_zend_init(TSRMLS_D) ++{ ++ zend_extension dummy_ext; ++ apc_reserved_offset = zend_get_resource_handle(&dummy_ext); ++ assert(apc_reserved_offset == dummy_ext.resource_number); ++ assert(apc_reserved_offset != -1); ++ assert(sizeof(apc_opflags_t) <= sizeof(void*)); ++ if (!APCG(include_once)) { ++ /* If we're not overriding the INCLUDE_OR_EVAL handler, then just skip this malarkey */ ++ return; ++ } ++ ++ memcpy(apc_opcode_handlers, zend_opcode_handlers, sizeof(apc_opcode_handlers)); ++ ++ /* 5.0 exposes zend_opcode_handlers differently than 5.1 and later */ ++#ifdef ZEND_ENGINE_2_1 ++ apc_original_opcode_handlers = zend_opcode_handlers; ++ zend_opcode_handlers = apc_opcode_handlers; ++#else ++ apc_original_opcode_handlers = apc_opcode_handlers; ++#endif ++ ++ APC_REPLACE_OPCODE(ZEND_INCLUDE_OR_EVAL); ++} ++ ++void apc_zend_shutdown(TSRMLS_D) ++{ ++ if (!APCG(include_once)) { ++ /* Nothing changed, nothing to restore */ ++ return; ++ } ++ ++#ifdef ZEND_ENGINE_2_1 ++ zend_opcode_handlers = apc_original_opcode_handlers; ++#else ++ memcpy(zend_opcode_handlers, apc_original_opcode_handlers, sizeof(apc_opcode_handlers)); ++#endif ++} ++ ++#else /* Opcode Overrides unavailable */ ++ ++void apc_zend_init(TSRMLS_D) { } ++void apc_zend_shutdown(TSRMLS_D) { } ++ ++#endif /* APC_OPCODE_OVERRIDE */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/apc_zend.h b/ext/apc/apc_zend.h +--- a/ext/apc/apc_zend.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/apc_zend.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,191 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: apc_zend.h 326712 2012-07-19 21:33:27Z rasmus $ */ ++ ++#ifndef APC_ZEND_H ++#define APC_ZEND_H ++ ++/* Utilities for interfacing with the zend engine */ ++ ++#include "apc.h" ++#include "apc_php.h" ++ ++#ifndef Z_REFCOUNT_P ++#define Z_REFCOUNT_P(pz) (pz)->refcount ++#define Z_REFCOUNT_PP(ppz) Z_REFCOUNT_P(*(ppz)) ++#endif ++ ++#ifndef Z_SET_REFCOUNT_P ++#define Z_SET_REFCOUNT_P(pz, rc) (pz)->refcount = rc ++#define Z_SET_REFCOUNT_PP(ppz, rc) Z_SET_REFCOUNT_P(*(ppz), rc) ++#endif ++ ++#ifndef Z_ADDREF_P ++#define Z_ADDREF_P(pz) (pz)->refcount++ ++#define Z_ADDREF_PP(ppz) Z_ADDREF_P(*(ppz)) ++#endif ++ ++#ifndef Z_DELREF_P ++#define Z_DELREF_P(pz) (pz)->refcount-- ++#define Z_DELREF_PP(ppz) Z_DELREF_P(*(ppz)) ++#endif ++ ++#ifndef Z_ISREF_P ++#define Z_ISREF_P(pz) (pz)->is_ref ++#define Z_ISREF_PP(ppz) Z_ISREF_P(*(ppz)) ++#endif ++ ++#ifndef Z_SET_ISREF_P ++#define Z_SET_ISREF_P(pz) (pz)->is_ref = 1 ++#define Z_SET_ISREF_PP(ppz) Z_SET_ISREF_P(*(ppz)) ++#endif ++ ++#ifndef Z_UNSET_ISREF_P ++#define Z_UNSET_ISREF_P(pz) (pz)->is_ref = 0 ++#define Z_UNSET_ISREF_PP(ppz) Z_UNSET_ISREF_P(*(ppz)) ++#endif ++ ++#ifndef Z_SET_ISREF_TO_P ++#define Z_SET_ISREF_TO_P(pz, isref) (pz)->is_ref = isref ++#define Z_SET_ISREF_TO_PP(ppz, isref) Z_SET_ISREF_TO_P(*(ppz), isref) ++#endif ++ ++ ++extern void* apc_php_malloc(size_t n TSRMLS_DC); ++extern void apc_php_free(void* p TSRMLS_DC); ++ ++extern void apc_zend_init(TSRMLS_D); ++extern void apc_zend_shutdown(TSRMLS_D); ++ ++ ++/* offset for apc info in op_array->reserved */ ++extern int apc_reserved_offset; ++ ++#ifndef ZEND_VM_KIND_CALL /* Not currently defined by any ZE version */ ++# define ZEND_VM_KIND_CALL 1 ++#endif ++ ++#ifndef ZEND_VM_KIND /* Indicates PHP < 5.1 */ ++# define ZEND_VM_KIND ZEND_VM_KIND_CALL ++#endif ++ ++#if defined(ZEND_ENGINE_2) && (ZEND_VM_KIND == ZEND_VM_KIND_CALL) ++# define APC_OPCODE_OVERRIDE ++#endif ++ ++#ifdef APC_OPCODE_OVERRIDE ++ ++#ifdef ZEND_ENGINE_2_1 ++/* Taken from Zend/zend_vm_execute.h */ ++#define _CONST_CODE 0 ++#define _TMP_CODE 1 ++#define _VAR_CODE 2 ++#define _UNUSED_CODE 3 ++#define _CV_CODE 4 ++static inline int _apc_opcode_handler_decode(zend_op *opline) ++{ ++ static const int apc_vm_decode[] = { ++ _UNUSED_CODE, /* 0 */ ++ _CONST_CODE, /* 1 = IS_CONST */ ++ _TMP_CODE, /* 2 = IS_TMP_VAR */ ++ _UNUSED_CODE, /* 3 */ ++ _VAR_CODE, /* 4 = IS_VAR */ ++ _UNUSED_CODE, /* 5 */ ++ _UNUSED_CODE, /* 6 */ ++ _UNUSED_CODE, /* 7 */ ++ _UNUSED_CODE, /* 8 = IS_UNUSED */ ++ _UNUSED_CODE, /* 9 */ ++ _UNUSED_CODE, /* 10 */ ++ _UNUSED_CODE, /* 11 */ ++ _UNUSED_CODE, /* 12 */ ++ _UNUSED_CODE, /* 13 */ ++ _UNUSED_CODE, /* 14 */ ++ _UNUSED_CODE, /* 15 */ ++ _CV_CODE /* 16 = IS_CV */ ++ }; ++#ifdef ZEND_ENGINE_2_4 ++ return (opline->opcode * 25) + (apc_vm_decode[opline->op1_type] * 5) + apc_vm_decode[opline->op2_type]; ++#else ++ return (opline->opcode * 25) + (apc_vm_decode[opline->op1.op_type] * 5) + apc_vm_decode[opline->op2.op_type]; ++#endif ++} ++ ++# define APC_ZEND_OPLINE zend_op *opline = execute_data->opline; ++# define APC_OPCODE_HANDLER_DECODE(opline) _apc_opcode_handler_decode(opline) ++# if PHP_MAJOR_VERSION >= 6 ++# define APC_OPCODE_HANDLER_COUNT ((25 * 152) + 1) ++# elif defined(ZEND_ENGINE_2_4) ++# define APC_OPCODE_HANDLER_COUNT ((25 * 159) + 1) /* 5 new opcodes in 5.4 - qm_assign_var, jmp_set_var, separate, bind_trais, add_trait */ ++# elif PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 ++# define APC_OPCODE_HANDLER_COUNT ((25 * 154) + 1) /* 3 new opcodes in 5.3 - unused, lambda, jmp_set */ ++# else ++# define APC_OPCODE_HANDLER_COUNT ((25 * 151) + 1) ++# endif ++# define APC_REPLACE_OPCODE(opname) { int i; for(i = 0; i < 25; i++) if (zend_opcode_handlers[(opname*25) + i]) zend_opcode_handlers[(opname*25) + i] = apc_op_##opname; } ++ ++#else /* ZE2.0 */ ++# define APC_ZEND_ONLINE ++# define APC_OPCODE_HANDLER_DECODE(opline) (opline->opcode) ++# define APC_OPCODE_HANDLER_COUNT 512 ++# define APC_REPLACE_OPCODE(opname) zend_opcode_handlers[opname] = apc_op_##opname; ++#endif ++ ++#ifndef ZEND_FASTCALL /* Added in ZE2.3.0 */ ++#define ZEND_FASTCALL ++#endif ++ ++/* Added in ZE2.3.0 */ ++#ifndef zend_parse_parameters_none ++# define zend_parse_parameters_none() zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") ++#endif ++ ++ ++#endif /* APC_OPCODE_OVERRIDE */ ++ ++#ifdef ZEND_ENGINE_2_4 ++# define ZEND_CE_FILENAME(ce) (ce)->info.user.filename ++# define ZEND_CE_DOC_COMMENT(ce) (ce)->info.user.doc_comment ++# define ZEND_CE_DOC_COMMENT_LEN(ce) (ce)->info.user.doc_comment_len ++# define ZEND_CE_BUILTIN_FUNCTIONS(ce) (ce)->info.internal.builtin_functions ++#else ++# define ZEND_CE_FILENAME(ce) (ce)->filename ++# define ZEND_CE_DOC_COMMENT(ce) (ce)->doc_comment ++# define ZEND_CE_DOC_COMMENT_LEN(ce) (ce)->doc_comment_len ++# define ZEND_CE_BUILTIN_FUNCTIONS(ce) (ce)->builtin_functions ++#endif ++ ++#endif /* APC_ZEND_H */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/CHANGELOG b/ext/apc/CHANGELOG +--- a/ext/apc/CHANGELOG 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/CHANGELOG 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,249 @@ ++ ++3.1.2 : 2008-12-12 ++ ++- pecl package.xml/build fixes (bjori) ++ ++3.1.1 : 2008-12-12 ++ ++- PHP4 compatibilty break ++- apc_pool allocator (Gopal) ++- doubly-linked sma allocator (Shire) ++- php 5.3 gc compatibility (Gopal) ++- APCIterator for easy access (Shire) ++- apc_delete_file (Shire) ++- apc_inc/apc_dec/apc_cas functions (Shire) ++- apc.canonicalize (Gopal) ++- apc.preload_path (Gopal) ++- apc.rfc1867_ttl (Shire) ++- apc.file_md5 (Shire) ++- consolidate locking macros (Shire) ++- remove futex/TSRM locks (Shire) ++- non-blocking semaphore locks (Shire) ++- zval* object rework (Gopal) ++ ++3.0.19: 2008-05-14 ++- Safe-mode and fast-cgi fixes ++- Fix double-free of builtin_functions ++- php 5.3 fixes ++ ++3.0.18: 2008-03-29 ++- Revert apc_expunge_cb bug-fix ++- Misc memleaks ++ ++3.0.17: 2008-03-26 ++- Crash fixes ++- Fix apc_add() cache expunge bug (Rasmus) ++- Added parameter to apc_fetch to determine success/failure when fetching booleans (shire) ++- Fix misc. memleaks (shire) ++ ++3.0.16: 2007-12-26 ++- Fix for longstanding cache-full crash (Christian Seiler) ++ http://news.php.net/php.pecl.dev/4951 for the details ++- Added optional shm unmap on a fatal signal feature (Lucas Nealan) ++- Added PTHREAD_MUTEX_ADAPTIVE_NP option pthread locks (Paul Saab) ++- Minor cleanups (Lucas Nealan) ++- Added configure option to enable apc_cache_info('filehits') (Shire) ++ ++3.0.15: 2007-10-18 ++- Eliminate a per-request time() syscall (Rasmus) ++- Added rfc1867 prefix, name, and freq ini options (Shire) ++- Allow deletion of individual user cache entries via apc.php (Sara) ++- Fix overzealous cleanup during RSHUTDOWN (Gopal) ++- Fix memory alignment and locking issues (Gopal) ++- Make apc_compile insert/replace entries (Shire) ++- Make mixed inheritance recompile & cache afresh (Gopal) ++- Make nostat mode search include_path for canonicalization (Gopal) ++- ZTS & other compile fixes (Gopal, Edin, Shire) ++ ++3.0.14: 2007-03-21 ++- Build fix (Shire) ++- Don't hook the upload hook if APC is disabled (Rasmus) ++- Local shadow cache support (Gopal) ++- Avoid uneccessary loops over op_arrays for "known" auto-globals (Gopal) ++- Fix apc_add() to overwrite timed out user entries (Rasmus) ++- Fix double inclusion of files with conditional classes in php4 (Gopal) ++- Allocator fixes to reduce fragmentation (Gopal) ++ ++3.0.13: 2007-02-24 ++- File upload progress (Rasmus) ++- Pthread mutex and spin locks (Shire) ++- Recursive zval support for apc_fetch/_store (Shire, Gopal) ++- apc.stat_ctime flag for ctime checks (Rasmus) ++- Multiple key fetches with apc_fetch (Shire) ++- Canary checks for shm memory deallocation (Gopal) ++- Add hooks for external optimizer (Shire) ++- Obsolete and remove apc optimizer (Gopal) ++- APC info changes - cache insert rate, hit and miss rates (Shire) ++- Fix apc_load_constants (Gopal) ++- Rewrite dump opcode code to use vld (Gopal) ++- Use apc_[ewn]print functions for error reporting (Shire) ++- Auto global fixes and refactoring (Gopal, Shire) ++- Fix memory leaks in object serialization (Ilia) ++- Memory cleanup code for destructor order (Gopal) ++- Win32 build fixes (Ilia, Wez) ++- ZTS and Php 4 build fixes (Bjori) ++- Add apc_add() function (Rasmus) ++- Add optional limited flag to apc_sma_info() (Rasmus) ++ ++3.0.12p2: 2006-09-05 ++- Package version up ++ ++3.0,12p1: 2006-09-05 ++- PHP4 build fixes ++ ++3.0.12: 2006-09-05 ++- PHP 5.2 compatibility (Gopal) ++- TSRM fixes (Gopal) ++- Add extra flags to op_array->reserved to improve op array ++ processing code (Gopal) ++- Fix crashes in optimizer and cli mode (Ilia) ++- Optimizer fixes for PHP5 (Ilia, Gopal) ++- Allow multiple inclusions of a file with a dynamic class (Gopal) ++- Php 4 function table and properties fixes (Gopal) ++- Fix memory leaks in apc_cache_info (Gopal) ++ ++3.0.11: 2006-08-16 ++- Made --enable-apc-mmap the default compile option (for real this time) ++- Add an optional flag to apc_cache_info() and some apc.php tweaks to make it ++ only fetch header information to make it useful when you have tens of ++ thousands of entries. (Brian Shire) ++- 64-bit fixes (George) ++- Don't mix Full Path and Inode keys (George) ++- Override ZEND_INCLUDE_OR_EVAL opcode (when possible) to speed up use of ++ require_once() and include_once() statements. (Sara) ++- Add a non-blocking write_lock for cache inserts. This is a better approach ++ to prevent cache slams and deprecates the slam_defense setting. (Rasmus) ++- A bit of work on the optimizer. (Sara) ++- Various memory issues resolved. (Gopal) ++ ++3.0.10: 2006-03-11 ++- Add apc.stat ini flag which defaults to 1. If set to 0, the main script and any fullpath ++ includes will not be stat'ed for any changes. You will have to restart the server if you ++ change anything. This mode increases performance quite a bit, especially if you have a ++ lot of includes. ++ ++- Get rid of the lock safety net hack I added in 3.0.9. It seems to cause more problems ++ than it solves. I'll need to revisit locking and signal handling at some point soon. ++ ++3.0.9: 2006-03-04 ++- Eliminate rand() call when slam_defense is not set (Rasmus) ++- Fix for __isset problem (Gopal) ++- Rewrite allocator from a "best fit" to a "next fit" algorithm (Rasmus) ++- Added a Cache Full counter so we have an idea how many times the segment has filled up causing an expunge (Rasmus) ++- Report back the correct number of available bytes in the segment instead of the allocated bytes. (Rasmus) ++- Add cache busy flag which is set when an expunge is underway (Rasmus) ++- Add automatic serialization of objects in apc_store() (Marcus) ++- 64-bit .ini flag fix (Rasmus) ++- Static members fix (Gopal) ++- sma_cleanup() mem leak fix (Rasmus) ++- Fix for http://pecl.php.net/bugs/5311 (Rasmus) ++- Fix autoglobals JIT bug (Gopal) ++- Fix instance bug (Gopal) ++- Add a lock cleanup safety net to request shutdown (Rasmus) ++- Fix apc.slam_defense edge-case bug (Rasmus) ++- User entry memory usage tracking support (Ilia) ++- Allow keys used in apc_store/apc_fetch/apc_delete to be binary safe and prevent conflicts between keys that are found at the start of other keys. (Ilia) ++ ++3.0.8: 2005-08-24 ++Fix invalid free in globals destructor introduced in 3.0.7 (Rasmus) ++Cache corruption fix in cache-full cleanup code (Gopal) ++ ++3.0.7: 2005-08-16 ++- Fix to apc.php to show final segment in frag chart. (Ilia) ++- A couple of win32 fixes. (Frank) ++- Add apc.enable_cli ini directive. (Rasmus) ++- Add test cases. (Marcus) ++- Fix apc_define_constants() bug - http://pecl.php.net/bugs/5084 (Rasmus) ++- Simplify user cache handling by removing the user_cache_stack (Rasmus) ++- Fix apc_fetch() memory corruption (Andrei,Rasmus) ++- Added apc.max_file_size INI setting that allows exclusion of large files from being cached. Default file size limit, 1 megabyte. (Ilia) ++ ++3.0.6: 2005-07-30 ++- Added apc.php to package.xml file. ++- Track per-entry memory usage. (Val) ++- Various apc.php fixes and enhancements. (Ralf, Ilia, Rasmus) ++- fcntl locking robustness fixes. (Rasmus) ++- Shared read-locks where possible. (Rasmus) ++- Added file_update_protection configuration parameter. (Rasmus) ++- Windows ZTS fixes (Frank) ++ ++3.0.5: 2005-07-27 ++- Make it easier for sapis that only populate file_handle->filename to use APC. (Rasmus) ++- Support extensions such as bcompiler that need to hook into compile_file. (Val) ++- Ralf Becker's apcgui code has now become the default apc.php status page. (Ralf, Rasmus, Ilia) ++- Segfault in cache cleanup code (Ilia, Rasmus) ++ ++3.0.4: 2005-07-18 ++- Add win32 support (Edin ) ++- Add --with-apxs switch to work around problem when loading APC into Apache binary compiled with LFS switches (Rasmus) ++- A couple of other minor fixes ++ ++3.0.3: 2005-07-05 ++- Fix compile problem against PHP 5.0.x ++ ++3.0.2: 2005-07-05 ++- Better shm error message ++ ++3.0.1: 2005-07-05 ++- PHP4 build fix ++ ++3.0: 2005-06-23 ++- PHP 5.1 support (Arun, Gopal, Rasmus) ++- Major Inheritance bug fix (Arun, Gopal) ++ ++2.0: 2003-02-10 ++- ground-up rewrite sharing none of the original source code (djc) ++ ++1.0.10: ++- merge mmap / shm code to be in one file, module supports both modes now [mpb 2001-05-15] ++- added apc.mode config parameter [mpb 2001-05-15] NOTE: You'll have to add ++ this parameter to your php.ini file to activate apc shm or mmap caching ++- generic source cleanup (missing includes, PATH_MAX usage etc) [mpb ++ 2001-05-15] ++- fixed: realpath return result checking in generate_key [mpb 2001-05-15] ++- updated: gui updated (extras/apc_gui-1.0.2.tar.gz) ++- experminental 'fast' cache-retrieval [djc 2001-05-20] ++- fixed regex support [gws 2001-05-16] ++- enhanced reader-writer lock support [rg 2001-05-07] ++ ++1.0.9: ++- fixed (?) memory alignment bug on 64 bit archiecures ++- added many cache visibiliy functions ++- added opional fcntl locks under shm version ++- numerous bug fixes ++ ++1.0.8: ++- added ability to detect and decompile compiled files placed as 'source' ++ [gws,dw 2001-01-30] ++- fixed apc_rstat bug [gws 2001-01-29] ++- added hack to support included urls [gws 2001-01-30] ++- fixed apc_cache_index [mb 2001-01-31] ++- added multiple regex support [gs 2001-02-03] ++- added apc_cache_info [mb,gs 2001-02-03] ++ ++1.0.7: ++- partially fixed for Solaris [gws 2001-01-29] ++- fixed mtime support for relative includes [gws 2001-01-29] ++- code cleanup [yg,ta,gws 2001-01-29] ++ ++1.0.6: ++- support for mtime in mmap [yg,gws 2001-01-27] ++- fixed indexed-array initialization bug [djc,gws 2001-01-27] ++ ++1.0.5: ++- support for relative include paths [djc,gws 2001-01-19] ++- class member array support fixed [djc 2001-01-18] ++- added apc_cache_index [gws 2001-01-18] ++ ++1.0.4: ++- support for class hierarchies greater than two levels deep [djc 2001-01-17] ++ ++1.0.3: ++- fixed support for class inheritance [djc 2001-01-16] ++ ++1.0.2: ++- support for inherited classes [gws 2001-01-15] ++- support for intialization of class variables and objects [gws 2001-01-13] ++ ++1.0.1: ++- added optional file modification time check [djc 2001-01-12] +diff -Naur a/ext/apc/config.m4 b/ext/apc/config.m4 +--- a/ext/apc/config.m4 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/config.m4 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,404 @@ ++dnl ++dnl $Id: config.m4 326700 2012-07-19 11:56:57Z ab $ ++dnl ++ ++PHP_ARG_ENABLE(apc, whether to enable APC support, ++[ --enable-apc Enable APC support]) ++ ++AC_ARG_ENABLE(apc-debug, ++[ --enable-apc-debug Enable APC debugging], ++[ ++ PHP_APC_DEBUG=$enableval ++], ++[ ++ PHP_APC_DEBUG=no ++]) ++ ++AC_MSG_CHECKING(whether we should enable cache request file info) ++AC_ARG_ENABLE(apc-filehits, ++[ --enable-apc-filehits Enable per request file info about files used from the APC cache (ie: apc_cache_info('filehits')) ], ++[ ++ PHP_APC_FILEHITS=$enableval ++ AC_MSG_RESULT($enableval) ++], ++[ ++ PHP_APC_FILEHITS=no ++ AC_MSG_RESULT(no) ++]) ++ ++AC_MSG_CHECKING(whether we should use mmap) ++AC_ARG_ENABLE(apc-mmap, ++[ --disable-apc-mmap ++ Disable mmap support and use IPC shm instead], ++[ ++ PHP_APC_MMAP=$enableval ++ AC_MSG_RESULT($enableval) ++], [ ++ PHP_APC_MMAP=yes ++ AC_MSG_RESULT(yes) ++]) ++ ++AC_MSG_CHECKING(whether we should use semaphore locking instead of fcntl) ++AC_ARG_ENABLE(apc-sem, ++[ --enable-apc-sem ++ Enable semaphore locks instead of fcntl], ++[ ++ PHP_APC_SEM=$enableval ++ AC_MSG_RESULT($enableval) ++], [ ++ PHP_APC_SEM=no ++ AC_MSG_RESULT(no) ++]) ++ ++AC_MSG_CHECKING(whether we should use pthread mutex locking) ++AC_ARG_ENABLE(apc-pthreadmutex, ++[ --disable-apc-pthreadmutex ++ Disable pthread mutex locking ], ++[ ++ PHP_APC_PTHREADMUTEX=$enableval ++ AC_MSG_RESULT($enableval) ++], ++[ ++ PHP_APC_PTHREADMUTEX=yes ++ AC_MSG_RESULT(yes) ++]) ++ ++if test "$PHP_APC_PTHREADMUTEX" != "no"; then ++ orig_LIBS="$LIBS" ++ LIBS="$LIBS -lpthread" ++ AC_TRY_RUN( ++ [ ++ #include ++ #include ++ main() { ++ pthread_mutex_t mutex; ++ pthread_mutexattr_t attr; ++ ++ if(pthread_mutexattr_init(&attr)) { ++ puts("Unable to initialize pthread attributes (pthread_mutexattr_init)."); ++ return -1; ++ } ++ if(pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)) { ++ puts("Unable to set PTHREAD_PROCESS_SHARED (pthread_mutexattr_setpshared), your system may not support shared mutex's."); ++ return -1; ++ } ++ if(pthread_mutex_init(&mutex, &attr)) { ++ puts("Unable to initialize the mutex (pthread_mutex_init)."); ++ return -1; ++ } ++ if(pthread_mutexattr_destroy(&attr)) { ++ puts("Unable to destroy mutex attributes (pthread_mutexattr_destroy)."); ++ return -1; ++ } ++ if(pthread_mutex_destroy(&mutex)) { ++ puts("Unable to destroy mutex (pthread_mutex_destroy)."); ++ return -1; ++ } ++ ++ puts("pthread mutexs are supported!"); ++ return 0; ++ } ++ ], ++ [ dnl -Success- ++ PHP_ADD_LIBRARY(pthread) ++ ], ++ [ dnl -Failure- ++ AC_MSG_WARN([It doesn't appear that pthread mutexes are supported on your system]) ++ PHP_APC_PTHREADMUTEX=no ++ ], ++ [ ++ PHP_ADD_LIBRARY(pthread) ++ ] ++ ) ++ LIBS="$orig_LIBS" ++fi ++ ++AC_MSG_CHECKING(whether we should use pthread read/write locking) ++AC_ARG_ENABLE(apc-pthreadrwlocks, ++[ --enable-apc-pthreadrwlocks ++ Enable pthread read/write locking ], ++[ ++ PHP_APC_PTHREADRWLOCK=$enableval ++ AC_MSG_RESULT($enableval) ++], ++[ ++ PHP_APC_PTHREADRWLOCK=no ++ AC_MSG_RESULT(no) ++]) ++ ++if test "$PHP_APC_PTHREADRWLOCK" != "no"; then ++ orig_LIBS="$LIBS" ++ LIBS="$LIBS -lpthread" ++ AC_TRY_RUN( ++ [ ++ #include ++ #include ++ main() { ++ pthread_rwlock_t rwlock; ++ pthread_rwlockattr_t attr; ++ ++ if(pthread_rwlockattr_init(&attr)) { ++ puts("Unable to initialize pthread attributes (pthread_rwlockattr_init)."); ++ return -1; ++ } ++ if(pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)) { ++ puts("Unable to set PTHREAD_PROCESS_SHARED (pthread_rwlockattr_setpshared), your system may not support shared rwlock's."); ++ return -1; ++ } ++ if(pthread_rwlock_init(&rwlock, &attr)) { ++ puts("Unable to initialize the rwlock (pthread_rwlock_init)."); ++ return -1; ++ } ++ if(pthread_rwlockattr_destroy(&attr)) { ++ puts("Unable to destroy rwlock attributes (pthread_rwlockattr_destroy)."); ++ return -1; ++ } ++ if(pthread_rwlock_destroy(&rwlock)) { ++ puts("Unable to destroy rwlock (pthread_rwlock_destroy)."); ++ return -1; ++ } ++ ++ puts("pthread rwlocks are supported!"); ++ return 0; ++ } ++ ], ++ [ dnl -Success- ++ PHP_ADD_LIBRARY(pthread) ++ APC_CFLAGS="-D_GNU_SOURCE" ++ ], ++ [ dnl -Failure- ++ AC_MSG_WARN([It doesn't appear that pthread rwlocks are supported on your system]) ++ PHP_APC_PTHREADRWLOCK=no ++ ], ++ [ ++ PHP_ADD_LIBRARY(pthread) ++ ] ++ ) ++ LIBS="$orig_LIBS" ++fi ++ ++ AC_CACHE_CHECK([whether the target compiler supports builtin atomics], PHP_cv_APC_GCC_ATOMICS, [ ++ ++ AC_TRY_LINK([],[ ++ int foo = 0; ++ __sync_fetch_and_add(&foo, 1); ++ __sync_bool_compare_and_swap(&foo, 0, 1); ++ return __sync_fetch_and_add(&foo, 1); ++ ], ++ [PHP_cv_APC_GCC_ATOMICS=yes], ++ [PHP_cv_APC_GCC_ATOMICS=no]) ++ ]) ++ ++ if test "x${PHP_cv_APC_GCC_ATOMICS}" != "xno"; then ++ AC_DEFINE(HAVE_ATOMIC_OPERATIONS, 1, ++ [Define this if your target compiler supports builtin atomics]) ++ else ++ if test "$PHP_APC_PTHREADRWLOCK" != "no"; then ++ AC_MSG_WARN([Disabling pthread rwlocks, because of missing atomic operations]) ++ dnl - fall back would most likely be pthread mutexes ++ PHP_APC_PTHREADRWLOCK=no ++ fi ++ fi ++ ++AC_MSG_CHECKING(whether we should use spin locks) ++AC_ARG_ENABLE(apc-spinlocks, ++[ --enable-apc-spinlocks ++ Enable spin locks EXPERIMENTAL ], ++[ ++ PHP_APC_SPINLOCKS=$enableval ++ AC_MSG_RESULT($enableval) ++], ++[ ++ PHP_APC_SPINLOCKS=no ++ AC_MSG_RESULT(no) ++]) ++ ++ ++AC_MSG_CHECKING(whether we should enable memory protection) ++AC_ARG_ENABLE(apc-memprotect, ++[ --enable-apc-memprotect ++ Enable mmap/shm memory protection], ++[ ++ PHP_APC_MEMPROTECT=$enableval ++ AC_MSG_RESULT($enableval) ++], [ ++ PHP_APC_MEMPROTECT=no ++ AC_MSG_RESULT(no) ++]) ++ ++if test "$PHP_APC" != "no"; then ++ test "$PHP_APC_MMAP" != "no" && AC_DEFINE(APC_MMAP, 1, [ ]) ++ test "$PHP_APC_FILEHITS" != "no" && AC_DEFINE(APC_FILEHITS, 1, [ ]) ++ ++ if test "$PHP_APC_DEBUG" != "no"; then ++ AC_DEFINE(__DEBUG_APC__, 1, [ ]) ++ fi ++ ++ if test "$PHP_APC_SEM" != "no"; then ++ AC_DEFINE(APC_SEM_LOCKS, 1, [ ]) ++ elif test "$PHP_APC_SPINLOCKS" != "no"; then ++ AC_DEFINE(APC_SPIN_LOCKS, 1, [ ]) ++ elif test "$PHP_APC_PTHREADRWLOCK" != "no"; then ++ AC_DEFINE(APC_PTHREADRW_LOCKS, 1, [ ]) ++ elif test "$PHP_APC_PTHREADMUTEX" != "no"; then ++ AC_DEFINE(APC_PTHREADMUTEX_LOCKS, 1, [ ]) ++ else ++ AC_DEFINE(APC_FCNTL_LOCKS, 1, [ ]) ++ fi ++ ++ if test "$PHP_APC_MEMPROTECT" != "no"; then ++ AC_DEFINE(APC_MEMPROTECT, 1, [ shm/mmap memory protection ]) ++ fi ++ ++ AC_CACHE_CHECK(for zend_set_lookup_function_hook, php_cv_zend_set_lookup_function_hook, ++ [ ++ orig_cflags=$CFLAGS ++ CFLAGS="$INCLUDES $EXTRA_INCLUDES" ++ AC_TRY_COMPILE([ ++#include "main/php.h" ++#include "Zend/zend_API.h" ++ ], [#ifndef zend_set_lookup_function_hook ++ (void) zend_set_lookup_function_hook; ++#endif], [ ++ php_cv_zend_set_lookup_function_hook=yes ++ ],[ ++ php_cv_zend_set_lookup_function_hook=no ++ ]) ++ CFLAGS=$orig_cflags ++ ]) ++ if test "$php_cv_zend_set_lookup_function_hook" = "yes"; then ++ AC_DEFINE(APC_HAVE_LOOKUP_HOOKS, 1, [ ]) ++ else ++ AC_DEFINE(APC_HAVE_LOOKUP_HOOKS, 0, [ ]) ++ fi ++ ++ AC_CHECK_FUNCS(sigaction) ++ AC_CACHE_CHECK(for union semun, php_cv_semun, ++ [ ++ AC_TRY_COMPILE([ ++#include ++#include ++#include ++ ], [union semun x; x.val=1], [ ++ php_cv_semun=yes ++ ],[ ++ php_cv_semun=no ++ ]) ++ ]) ++ if test "$php_cv_semun" = "yes"; then ++ AC_DEFINE(HAVE_SEMUN, 1, [ ]) ++ else ++ AC_DEFINE(HAVE_SEMUN, 0, [ ]) ++ fi ++ ++ AC_MSG_CHECKING(whether we should enable valgrind support) ++ AC_ARG_ENABLE(valgrind-checks, ++ [ --disable-valgrind-checks ++ Disable valgrind based memory checks], ++ [ ++ PHP_APC_VALGRIND=$enableval ++ AC_MSG_RESULT($enableval) ++ ], [ ++ PHP_APC_VALGRIND=yes ++ AC_MSG_RESULT(yes) ++ AC_CHECK_HEADER(valgrind/memcheck.h, ++ [AC_DEFINE([HAVE_VALGRIND_MEMCHECK_H],1, [enable valgrind memchecks])]) ++ ]) ++ ++ apc_sources="apc.c php_apc.c \ ++ apc_cache.c \ ++ apc_compile.c \ ++ apc_debug.c \ ++ apc_fcntl.c \ ++ apc_main.c \ ++ apc_mmap.c \ ++ apc_sem.c \ ++ apc_shm.c \ ++ apc_pthreadmutex.c \ ++ apc_pthreadrwlock.c \ ++ apc_spin.c \ ++ pgsql_s_lock.c \ ++ apc_sma.c \ ++ apc_stack.c \ ++ apc_zend.c \ ++ apc_rfc1867.c \ ++ apc_signal.c \ ++ apc_pool.c \ ++ apc_iterator.c \ ++ apc_bin.c \ ++ apc_string.c " ++ ++ PHP_CHECK_LIBRARY(rt, shm_open, [PHP_ADD_LIBRARY(rt,,APC_SHARED_LIBADD)]) ++ PHP_NEW_EXTENSION(apc, $apc_sources, $ext_shared,, \\$(APC_CFLAGS)) ++ PHP_SUBST(APC_SHARED_LIBADD) ++ PHP_SUBST(APC_CFLAGS) ++ PHP_INSTALL_HEADERS(ext/apc, [apc_serializer.h]) ++ AC_DEFINE(HAVE_APC, 1, [ ]) ++fi ++ ++PHP_ARG_ENABLE(coverage, whether to include code coverage symbols, ++[ --enable-coverage DEVELOPERS ONLY!!], no, no) ++ ++if test "$PHP_COVERAGE" = "yes"; then ++ ++ if test "$GCC" != "yes"; then ++ AC_MSG_ERROR([GCC is required for --enable-coverage]) ++ fi ++ ++ dnl Check if ccache is being used ++ case `$php_shtool path $CC` in ++ *ccache*[)] gcc_ccache=yes;; ++ *[)] gcc_ccache=no;; ++ esac ++ ++ if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then ++ AC_MSG_ERROR([ccache must be disabled when --enable-coverage option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.]) ++ fi ++ ++ lcov_version_list="1.5 1.6 1.7 1.9" ++ ++ AC_CHECK_PROG(LCOV, lcov, lcov) ++ AC_CHECK_PROG(GENHTML, genhtml, genhtml) ++ PHP_SUBST(LCOV) ++ PHP_SUBST(GENHTML) ++ ++ if test "$LCOV"; then ++ AC_CACHE_CHECK([for lcov version], php_cv_lcov_version, [ ++ php_cv_lcov_version=invalid ++ lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'` #' ++ for lcov_check_version in $lcov_version_list; do ++ if test "$lcov_version" = "$lcov_check_version"; then ++ php_cv_lcov_version="$lcov_check_version (ok)" ++ fi ++ done ++ ]) ++ else ++ lcov_msg="To enable code coverage reporting you must have one of the following LCOV versions installed: $lcov_version_list" ++ AC_MSG_ERROR([$lcov_msg]) ++ fi ++ ++ case $php_cv_lcov_version in ++ ""|invalid[)] ++ lcov_msg="You must have one of the following versions of LCOV: $lcov_version_list (found: $lcov_version)." ++ AC_MSG_ERROR([$lcov_msg]) ++ LCOV="exit 0;" ++ ;; ++ esac ++ ++ if test -z "$GENHTML"; then ++ AC_MSG_ERROR([Could not find genhtml from the LCOV package]) ++ fi ++ ++ PHP_ADD_MAKEFILE_FRAGMENT ++ ++ dnl Remove all optimization flags from CFLAGS ++ changequote({,}) ++ CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'` ++ CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'` ++ changequote([,]) ++ ++ dnl Add the special gcc flags ++ CFLAGS="$CFLAGS -O0 -ggdb -fprofile-arcs -ftest-coverage" ++ CXXFLAGS="$CXXFLAGS -ggdb -O0 -fprofile-arcs -ftest-coverage" ++fi ++dnl vim: set ts=2 +diff -Naur a/ext/apc/config.w32 b/ext/apc/config.w32 +--- a/ext/apc/config.w32 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/config.w32 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,60 @@ ++// $Id: config.w32 309203 2011-03-14 06:47:16Z pajoye $ ++// vim:ft=javascript ++ ++ARG_ENABLE('apc', 'Whether to enable APC support', 'no'); ++ARG_ENABLE('apc-debug', 'Whether to enable APC debugging', 'no'); ++ARG_ENABLE('apc-filehits', 'Whether to enable cache request file info', 'no'); ++ARG_ENABLE('apc-spinlocks', 'Whether to use spin locks (experimental)', 'no'); ++ARG_ENABLE('apc-memprotect', 'Whether to enable memory protection (experimental)', 'no'); ++ARG_ENABLE('apc-srwlock-native', 'Whether to use SRWLOCK locks native (win7/2008 only)', 'no'); ++ARG_ENABLE('apc-srwlock-kernel', 'Whether to use SRWLOCK locks (loaded at runtime)', 'no'); ++ ++if(PHP_APC != 'no') ++{ ++ var apc_sources = 'apc.c php_apc.c apc_cache.c apc_compile.c apc_debug.c ' + ++ 'apc_fcntl_win32.c apc_iterator.c apc_main.c apc_shm.c ' + ++ 'apc_sma.c apc_stack.c apc_rfc1867.c apc_zend.c apc_pool.c ' + ++ 'apc_bin.c apc_string.c'; ++ ++ if(PHP_APC_DEBUG != 'no') ++ { ++ ADD_FLAG('CFLAGS_APC', '/D __DEBUG_APC__=1'); ++ } ++ ++ if(PHP_APC_FILEHITS != 'no') ++ { ++ AC_DEFINE('APC_FILEHITS', 1); ++ } ++ ++ if(PHP_APC_MEMPROTECT != 'no') ++ { ++ AC_DEFINE('APC_MEMPROTECT', 1); ++ } ++ ++ if(PHP_APC_SRWLOCK_NATIVE != 'no') { ++ AC_DEFINE('APC_SRWLOCK_NATIVE', 1); ++ } else { ++ if(PHP_APC_SRWLOCK_KERNEL != 'no') { ++ AC_DEFINE('APC_SRWLOCK_KERNEL', 1); ++ ADD_FLAG('CFLAGS_APC', '/D WIN32_ONLY_COMPILER=1'); ++ ++ apc_sources += ' apc_windows_srwlock_kernel.c'; ++ } else { ++ if(PHP_APC_SPINLOCKS != 'no') { ++ AC_DEFINE('APC_SPIN_LOCKS', 1); ++ ADD_FLAG('CFLAGS_APC', '/D WIN32_ONLY_COMPILER=1'); ++ ++ apc_sources += ' apc_spin.c pgsql_s_lock.c'; ++ } else { ++ AC_DEFINE('APC_FCNTL_LOCKS', 1); ++ } ++ } ++ } ++ ++ AC_DEFINE('HAVE_APC', 1); ++ AC_DEFINE('HAVE_ATOMIC_OPERATIONS', 1); ++ ++ PHP_INSTALL_HEADERS("ext/apc", "apc_serializer.h"); ++ ++ EXTENSION('apc', apc_sources); ++} +diff -Naur a/ext/apc/INSTALL b/ext/apc/INSTALL +--- a/ext/apc/INSTALL 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/INSTALL 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,407 @@ ++Installation Instructions for APC ++--------------------------------- ++ ++This version of APC should work on PHP 4.3.0 - 4.4.x and ++5.1.0 - 5.2.x. Yes, that means PHP 5.0.x is no longer ++supported. Upgrade to PHP 5.1.x or 5.2.x and you will ++notice all sorts of performance increases. ++ ++CVS Instructions ++---------------- ++Building from CVS can be done like this: ++ ++ svn co http://svn.php.net/repository/pecl/apc/trunk apc ++ cd apc ++ phpize ++ ./configure --with-php-config=/usr/local/php/bin/php-config ++ make ++ export TEST_PHP_ARGS='-n' ++ make test ++ make install ++ ++Suggested Configuration (in your php.ini file) ++---------------------------------------------- ++ extension=apc.so ++ apc.enabled=1 ++ apc.shm_size=128M ++ apc.ttl=7200 ++ apc.user_ttl=7200 ++ apc.enable_cli=1 ++ ++These are fully described at the bottom of this file. ++ +++---------------------+ ++| QUICK INSTALL (DSO) | +++---------------------+ ++ ++These instructions assume your PHP installation is located in /usr/local/php and you ++want Apache optimizations (--with-apxs). ++ ++$ gunzip -c apc_x.y.tar.gz | tar xf - ++$ cd apc_x.y ++$ /usr/local/php/bin/phpize ++$ ./configure --with-php-config=/usr/local/php/bin/php-config ++$ make ++$ make install ++ ++You will probably need to run the final command (make install) as root. ++ ++The above sequence of commands will install a .so file in your PHP ++installation extension directory. The output of make install should display ++that path to the screen. ++ ++Next you must edit your php.ini file, which is normally located in ++/usr/local/php/lib/php.ini, and add the following line: ++ ++ extension="apc.so" ++ ++Replace "/path/to/php/extensions" with whatever path was displayed when you ++ran make install above. ++ ++Then restart your web server and consult the output of phpinfo(). If there is ++an informational section for APC, the installation was successful. ++ +++------------------------+ ++| QUICK INSTALL (Static) | +++------------------------+ ++ ++APC will not successfully compile on all systems as a DSO. If you run into ++problems using the DSO quick install, you can try to compile it statically ++into PHP. (The DSO install is recommended, though.) ++ ++These instructions assume the current directory is the root of the PHP source ++tree, and that you have already configured PHP by running its bundled ++configure script. ++ ++$ cd ext ++$ gunzip -c apc_x.y.tar.gz | tar xf - ++$ cd .. ++$ ./buildconf ++$ ./config.nice ++$ make ++$ make install ++ ++Once this is complete, simply restart your web server. You do not need to ++modify your php.ini file to enable APC. ++ +++-----------------+ ++| VERBOSE INSTALL | +++-----------------+ ++ ++These instructions assume your PHP installation is located in /usr/local/php. ++ ++1. Unpack your distribution file. ++ ++ You will have downloaded a file named something like apc_x.y.tar.gz. ++ Unzip this file with a command like ++ ++ gunzip apc_x.y.tar.gz ++ ++ Next you have to untar it with ++ ++ tar xvf apc_x.y.tar ++ ++ This will create an apc_x.y directory. cd into this new directory: ++ ++ cd apc_x.y ++ ++2. Run phpize. ++ ++ phpize is a script that should have been installed with PHP, and is ++ normally located in /usr/local/php/bin assuming you installed PHP in ++ /usr/local/php. (If you do not have the phpize script, you must reinstall ++ PHP and be sure not to disable PEAR.) ++ ++ Run the phpize command: ++ ++ /usr/local/php/bin/phpize ++ ++ Its output should resemble this: ++ ++ autoheader: `config.h.in' is created ++ You should update your `aclocal.m4' by running aclocal. ++ Configuring for: ++ PHP Api Version: 20020918 ++ Zend Module Api No: 20020429 ++ Zend Extension Api No: 20021010 ++ ++ phpize should create a configure script in the current directory. If you ++ get errors instead, you might be missing some required development tools, ++ such as autoconf or libtool. You can try downloading the latest versions ++ of those tools and running phpize again. ++ ++3. Run the configure script. ++ ++ phpize creates a configure script. The only option you need to specify is ++ the location of your php-config script: ++ ++ ./configure --enable-apc ++ ++ php-config should be located in the same directory as phpize. ++ ++ If you prefer to use mmap instead of the default IPC shared memory support, ++ add --enable-apc-mmap to your configure line. ++ ++ If you prefer to use sysv IPC semaphores over the safer fcntl() locks, add ++ --enable-sem to your configure line. If you don't have a problem ++ with your server segaulting, or any other unnatural accumulation of ++ semaphores on your system, the semaphore based locking is slightly faster. ++ ++4. Compile and install the files. Simply type: make install ++ ++ (You may need to be root in order to install) ++ ++ If you encounter errors from libtool or gcc during this step, please ++ contact the project maintainer (dcowgill@php.net). ++ ++5. Edit your php.ini ++ ++ make install should have printed a line resembling the following: ++ ++ Installing shared extensions: /path/to/extension/ ++ ++ Copy the path /path/to/extension/ and add the following line to your ++ php.ini file (normally located in /usr/local/php/lib/php.ini): ++ ++ extension="apc.so" ++ ++ If you don't have a php.ini file in that location, you can create it now. ++ ++6. Restart the web server and test the installation. ++ ++ Restart your web server now (for apache, it's apachectl restart) and ++ create a small test PHP file in your document root. The file should ++ contain just the following line: ++ ++ ++ ++ Request that file in a web browser. If there is an entry for APC in the ++ list of installed modules, the installation was successful. ++ ++ If APC is not listed, consult your web server error log. If it contains an ++ error message saying that it can't load the APC extension, your system ++ might not be able to load shared libraries created with PHP's build ++ system. One alternative would be to compile APC statically into PHP. See ++ the Quick Install (Static) instructions above. ++ ++ You should consult your error log anyway to see if APC generated any ++ errors. On BSD-based platforms, it is typical for APC to be unable to ++ allocate the default-sized shared memory segment. See below for hints on ++ raising your system's shared memory limitations. ++ +++-----------------+ ++| CONFIGURING APC | +++-----------------+ ++ ++Although the default APC settings are fine for many installations, serious ++users should consider tuning the following parameters: ++ ++ OPTION DESCRIPTION ++ ------------------ -------------------------------------------------- ++ apc.enabled This can be set to 0 to disable APC. This is ++ primarily useful when APC is statically compiled ++ into PHP, since there is no other way to disable ++ it (when compiled as a DSO, the zend_extension ++ line can just be commented-out). ++ (Default: 1) ++ ++ apc.shm_segments The number of shared memory segments to allocate ++ for the compiler cache. If APC is running out of ++ shared memory but you have already set ++ apc.shm_size as high as your system allows, you ++ can try raising this value. Setting this to a ++ value other than 1 has no effect in mmap mode ++ since mmap'ed shm segments don't have size limits. ++ (Default: 1) ++ ++ apc.shm_size The size of each shared memory segment in MB. ++ By default, some systems (including most BSD ++ variants) have very low limits on the size of a ++ shared memory segment. M/G suffixes must be used. ++ (Default: 30) ++ ++ ++ apc.optimization This option has been deprecated. ++ (Default: 0) ++ ++ apc.num_files_hint A "hint" about the number of distinct source files ++ that will be included or requested on your web ++ server. Set to zero or omit if you're not sure; ++ this setting is mainly useful for sites that have ++ many thousands of source files. ++ (Default: 1000) ++ ++ apc.user_entries_hint Just like num_files_hint, a "hint" about the number ++ of distinct user cache variables to store. ++ Set to zero or omit if you're not sure; ++ (Default: 4096) ++ ++ apc.ttl The number of seconds a cache entry is allowed to ++ idle in a slot in case this cache entry slot is ++ needed by another entry. Leaving this at zero ++ means that your cache could potentially fill up ++ with stale entries while newer entries won't be ++ cached. ++ (Default: 0) ++ ++ apc.user_ttl The number of seconds a user cache entry is allowed ++ to idle in a slot in case this cache entry slot is ++ needed by another entry. Leaving this at zero ++ means that your cache could potentially fill up ++ with stale entries while newer entries won't be ++ cached. ++ (Default: 0) ++ ++ ++ apc.gc_ttl The number of seconds that a cache entry may ++ remain on the garbage-collection list. This value ++ provides a failsafe in the event that a server ++ process dies while executing a cached source file; ++ if that source file is modified, the memory ++ allocated for the old version will not be ++ reclaimed until this TTL reached. Set to zero to ++ disable this feature. ++ (Default: 3600) ++ ++ apc.cache_by_default On by default, but can be set to off and used in ++ conjunction with positive apc.filters so that files ++ are only cached if matched by a positive filter. ++ (Default: On) ++ ++ apc.filters A comma-separated list of POSIX extended regular ++ expressions. If any pattern matches the source ++ filename, the file will not be cached. Note that ++ the filename used for matching is the one passed ++ to include/require, not the absolute path. If the ++ first character of the expression is a + then the ++ expression will be additive in the sense that any ++ files matched by the expression will be cached, and ++ if the first character is a - then anything matched ++ will not be cached. The - case is the default, so ++ it can be left off. ++ (Default: "") ++ ++ apc.mmap_file_mask If compiled with MMAP support by using --enable-mmap ++ this is the mktemp-style file_mask to pass to the ++ mmap module for determing whether your mmap'ed memory ++ region is going to be file-backed or shared memory ++ backed. For straight file-backed mmap, set it to ++ something like /tmp/apc.XXXXXX (exactly 6 X's). ++ To use POSIX-style shm_open/mmap put a ".shm" ++ somewhere in your mask. eg. "/apc.shm.XXXXXX" ++ You can also set it to "/dev/zero" to use your ++ kernel's /dev/zero interface to anonymous mmap'ed ++ memory. Leaving it undefined will force an ++ anonymous mmap. ++ (Default: "") ++ ++ apc.slam_defense ** DEPRECATED - Use apc.write_lock instead ** ++ On very busy servers whenever you start the server or ++ modify files you can create a race of many processes ++ all trying to cache the same file at the same time. ++ This option sets the percentage of processes that will ++ skip trying to cache an uncached file. Or think of it ++ as the probability of a single process to skip caching. ++ For example, setting this to 75 would mean that there is ++ a 75% chance that the process will not cache an uncached ++ file. So the higher the setting the greater the defense ++ against cache slams. Setting this to 0 disables this ++ feature. ++ (Default: 0) ++ ++ apc.file_update_protection ++ When you modify a file on a live web server you really ++ should do so in an atomic manner. That is, write to a ++ temporary file and rename (mv) the file into its permanent ++ position when it is ready. Many text editors, cp, tar and ++ other such programs don't do this. This means that there ++ is a chance that a file is accessed (and cached) while it ++ is still being written to. This file_update_protection ++ setting puts a delay on caching brand new files. The ++ default is 2 seconds which means that if the modification ++ timestamp (mtime) on a file shows that it is less than 2 ++ seconds old when it is accessed, it will not be cached. ++ The unfortunate person who accessed this half-written file ++ will still see weirdness, but at least it won't persist. ++ If you are certain you always atomically update your files ++ by using something like rsync which does this correctly, you ++ can turn this protection off by setting it to 0. If you ++ have a system that is flooded with io causing some update ++ procedure to take longer than 2 seconds, you may want to ++ increase this a bit. ++ (Default: 2) ++ ++ apc.enable_cli Mostly for testing and debugging. Setting this enables APC ++ for the CLI version of PHP. Normally you wouldn't want to ++ create, populate and tear down the APC cache on every CLI ++ request, but for various test scenarios it is handy to be ++ able to enable APC for the CLI version of APC easily. ++ (Default: 0) ++ ++ apc.max_file_size Prevents large files from being cached. ++ (Default: 1M) ++ ++ apc.stat Whether to stat the main script file and the fullpath ++ includes. If you turn this off you will need to restart ++ your server in order to update scripts. ++ (Default: 1) ++ ++ apc.canonicalize Whether to canonicalize paths in stat=0 mode or ++ fall back to stat behaviour if set to 0 ++ (Default: 0) ++ ++ apc.write_lock On busy servers when you first start up the server, or when ++ many files are modified, you can end up with all your processes ++ trying to compile and cache the same files. With write_lock ++ enabled, only one process at a time will try to compile an ++ uncached script while the other processes will run uncached ++ instead of sitting around waiting on a lock. ++ (Default: 1) ++ ++ apc.report_autofilter Logs any scripts that were automatically excluded from being ++ cached due to early/late binding issues. ++ (Default: 0) ++ ++ apc.rfc1867 RFC1867 File Upload Progress hook handler is only available ++ if you compiled APC against PHP 5.2.0 or later. When enabled ++ any file uploads which includes a field called ++ APC_UPLOAD_PROGRESS before the file field in an upload form ++ will cause APC to automatically create an upload_ ++ user cache entry where is the value of the ++ APC_UPLOAD_PROGRESS form entry. ++ ++ Note that the file upload tracking is not threadsafe at this ++ point, so new uploads that happen while a previous one is ++ still going will disable the tracking for the previous. ++ (Default: 0) ++ ++ apc.rfc1867_prefix Key prefix to use for the user cache entry generated by ++ rfc1867 upload progress functionality. ++ (Default: "upload_") ++ ++ apc.rfc1867_name Specify the hidden form entry name that activates APC upload ++ progress and specifies the user cache key suffix. ++ (Default: "APC_UPLOAD_PROGRESS") ++ ++ apc.rfc1867_freq The frequency that updates should be made to the user cache ++ entry for upload progress. This can take the form of a ++ percentage of the total file size or a size in bytes ++ optionally suffixed with 'k', 'm', or 'g' for kilobytes, ++ megabytes, or gigabytes respectively (case insensitive). ++ A setting of 0 updates as often as possible, which may cause ++ slower uploads. ++ (Default: 0) ++ ++ apc.localcache ** REMOVED ++ apc.localcache.size ** REMOVED ++ ++ apc.include_once_override ++ Optimize include_once and require_once calls and avoid the ++ expensive system calls used. ++ (Default: 0) ++ ++ apc.serializer ++ Defines which serializer should be used. Default is the ++ standard PHP serializer. Other can be used without having ++ to re compile apc, like igbinary for example. ++ (apc.serializer=igbinary) +diff -Naur a/ext/apc/LICENSE b/ext/apc/LICENSE +--- a/ext/apc/LICENSE 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/LICENSE 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,68 @@ ++-------------------------------------------------------------------- ++ The PHP License, version 3.01 ++Copyright (c) 1999 - 2011 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 ++ ". ++ ++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 . ++ ++PHP includes the Zend Engine, freely available at ++. +diff -Naur a/ext/apc/NOTICE b/ext/apc/NOTICE +--- a/ext/apc/NOTICE 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/NOTICE 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,43 @@ ++This is the NOTICE file that holds acknowledgements and stuff. ++ ++The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. ++This extension is being released under the PHP License for complete compliance ++with PHP and to encourage wide-spread use. It is our intention that this ++project be kept open source and that all commercial spin-offs contribute their ++modifications back into the public source-tree. ++ ++Creators: ++ Daniel Cowgill ++ George Schlossnagle ++ ++PHP5 support and major features by: ++ Arun C. Murthy ++ Gopal Vijayaraghavan ++ Rasmus Lerdorf ++ ++This software was contributed to PHP by Community Connect Inc. in 2002 ++and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++Future revisions and derivatives of this source code must acknowledge ++Community Connect Inc. as the original contributor of this module by ++leaving this note intact in the source code. ++ ++All other licensing and usage conditions are those of the PHP Group. ++ ++We would like to thank Community Connect Inc. and Yahoo! Inc. for supporting ++this project and providing a challenging and stimulating environment in ++which exciting projects can happen. ++ ++Contributors: ++ Mike Bretz bug fixes, GUI, and lots of work ++ Ricardo Galli changed read-write locks to prefer readers ++ Yann Grossel bug fixes ++ Thies Arntzen bug fixes ++ Sara Golemon optimizer work ++ ++Special Thanks: ++ Florian Baumert help debugging phplib problems ++ Thomas Duffey help debugging inheritance issues ++ Vibol Hou help debugging phplib problems ++ Angel Li diffs for ANSI comment compliance ++ Christian Rishøj help debugging phplib problems ++ Sascha Schumann memory error bug fix +diff -Naur a/ext/apc/pgsql_s_lock.c b/ext/apc/pgsql_s_lock.c +--- a/ext/apc/pgsql_s_lock.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/pgsql_s_lock.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,391 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | The following code was ported from the PostgreSQL project, please | ++ | see appropriate copyright notices that follow. | ++ | Initial conversion by Brian Shire | ++ +----------------------------------------------------------------------+ ++ ++ */ ++ ++/* $Id: pgsql_s_lock.c 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++/*------------------------------------------------------------------------- ++ * ++ * s_lock.c ++ * Hardware-dependent implementation of spinlocks. ++ * ++ * ++ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group ++ * Portions Copyright (c) 1994, Regents of the University of California ++ * ++ * ++ * IDENTIFICATION ++ * $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.47 2006/10/04 00:29:58 momjian Exp $ ++ * ++ *------------------------------------------------------------------------- ++ */ ++/* #include "postgres.h" -- Removed for APC */ ++ ++/* -- Added for APC -- */ ++#include "apc.h" ++#ifdef APC_SPIN_LOCKS ++ ++#ifdef S_LOCK_TEST ++#include ++#endif ++#ifndef WIN32 ++#include ++#endif ++/* ---- */ ++ ++#include ++#ifdef WIN32 ++#include "win32/unistd.h" ++#else ++#include ++#endif ++ ++/* #include "storage/s_lock.h" -- Removed for APC */ ++#include "pgsql_s_lock.h" ++ ++static int spins_per_delay = DEFAULT_SPINS_PER_DELAY; ++ ++ ++/* -- APC specific additions ------------------------------*/ ++/* The following dependencies have been copied from ++ * other pgsql source files. The original locations ++ * have been noted. ++ */ ++ ++/* -- from include/c.h -- */ ++#ifndef TRUE ++#define TRUE 1 ++#endif ++ ++#ifndef FALSE ++#define FALSE 0 ++#endif ++ ++/* -- from include/pg_config_manual.h -- */ ++#define MAX_RANDOM_VALUE (0x7FFFFFFF) ++ ++/* ++ * Max ++ * Return the maximum of two numbers. ++ */ ++#define Max(x, y) ((x) > (y) ? (x) : (y)) ++ ++/* -- from include/c.h -- */ ++/* ++ * Min ++ * Return the minimum of two numbers. ++ */ ++#define Min(x, y) ((x) < (y) ? (x) : (y)) ++ ++ ++/* -- from backend/port/win32/signal.c -- */ ++/* ++ * pg_usleep --- delay the specified number of microseconds. ++ * ++ * NOTE: although the delay is specified in microseconds, the effective ++ * resolution is only 1/HZ, or 10 milliseconds, on most Unixen. Expect ++ * the requested delay to be rounded up to the next resolution boundary. ++ * ++ * On machines where "long" is 32 bits, the maximum delay is ~2000 seconds. ++ */ ++void ++pg_usleep(long microsec) ++{ ++ if (microsec > 0) ++ { ++#ifndef WIN32 ++ struct timeval delay; ++ ++ delay.tv_sec = microsec / 1000000L; ++ delay.tv_usec = microsec % 1000000L; ++ (void) select(0, NULL, NULL, NULL, &delay); ++#else ++ SleepEx((microsec < 500 ? 1 : (microsec + 500) / 1000), FALSE); ++#endif ++ } ++} ++ ++/* -- End APC specific additions ------------------------------*/ ++ ++ ++/* ++ * s_lock_stuck() - complain about a stuck spinlock ++ */ ++static void ++s_lock_stuck(volatile slock_t *lock, const char *file, int line TSRMLS_DC) ++{ ++#if defined(S_LOCK_TEST) ++ fprintf(stderr, ++ "\nStuck spinlock (%p) detected at %s:%d.\n", ++ lock, file, line); ++ exit(1); ++#else ++ /* -- Removed for APC ++ elog(PANIC, "stuck spinlock (%p) detected at %s:%d", ++ lock, file, line); ++ */ ++ apc_error("Stuck spinlock (%p) detected" TSRMLS_CC, lock); ++#endif ++} ++ ++ ++/* ++ * s_lock(lock) - platform-independent portion of waiting for a spinlock. ++ */ ++void ++s_lock(volatile slock_t *lock, const char *file, int line TSRMLS_DC) ++{ ++ /* ++ * We loop tightly for awhile, then delay using pg_usleep() and try again. ++ * Preferably, "awhile" should be a small multiple of the maximum time we ++ * expect a spinlock to be held. 100 iterations seems about right as an ++ * initial guess. However, on a uniprocessor the loop is a waste of ++ * cycles, while in a multi-CPU scenario it's usually better to spin a bit ++ * longer than to call the kernel, so we try to adapt the spin loop count ++ * depending on whether we seem to be in a uniprocessor or multiprocessor. ++ * ++ * Note: you might think MIN_SPINS_PER_DELAY should be just 1, but you'd ++ * be wrong; there are platforms where that can result in a "stuck ++ * spinlock" failure. This has been seen particularly on Alphas; it seems ++ * that the first TAS after returning from kernel space will always fail ++ * on that hardware. ++ * ++ * Once we do decide to block, we use randomly increasing pg_usleep() ++ * delays. The first delay is 1 msec, then the delay randomly increases to ++ * about one second, after which we reset to 1 msec and start again. The ++ * idea here is that in the presence of heavy contention we need to ++ * increase the delay, else the spinlock holder may never get to run and ++ * release the lock. (Consider situation where spinlock holder has been ++ * nice'd down in priority by the scheduler --- it will not get scheduled ++ * until all would-be acquirers are sleeping, so if we always use a 1-msec ++ * sleep, there is a real possibility of starvation.) But we can't just ++ * clamp the delay to an upper bound, else it would take a long time to ++ * make a reasonable number of tries. ++ * ++ * We time out and declare error after NUM_DELAYS delays (thus, exactly ++ * that many tries). With the given settings, this will usually take 2 or ++ * so minutes. It seems better to fix the total number of tries (and thus ++ * the probability of unintended failure) than to fix the total time ++ * spent. ++ * ++ * The pg_usleep() delays are measured in milliseconds because 1 msec is a ++ * common resolution limit at the OS level for newer platforms. On older ++ * platforms the resolution limit is usually 10 msec, in which case the ++ * total delay before timeout will be a bit more. ++ */ ++#define MIN_SPINS_PER_DELAY 10 ++#define MAX_SPINS_PER_DELAY 1000 ++#define NUM_DELAYS 1000 ++#define MIN_DELAY_MSEC 1 ++#define MAX_DELAY_MSEC 1000 ++ ++ int spins = 0; ++ int delays = 0; ++ int cur_delay = 0; ++ ++ while (TAS(lock)) ++ { ++ /* CPU-specific delay each time through the loop */ ++ SPIN_DELAY(); ++ ++ /* Block the process every spins_per_delay tries */ ++ if (++spins >= spins_per_delay) ++ { ++ if (++delays > NUM_DELAYS) ++ s_lock_stuck(lock, file, line TSRMLS_CC); ++ ++ if (cur_delay == 0) /* first time to delay? */ ++ cur_delay = MIN_DELAY_MSEC; ++ ++ pg_usleep(cur_delay * 1000L); ++ ++#if defined(S_LOCK_TEST) ++ fprintf(stdout, "*"); ++ fflush(stdout); ++#endif ++ ++ /* increase delay by a random fraction between 1X and 2X */ ++ cur_delay += (int) (cur_delay * ++ ((double) rand() / (double) MAX_RANDOM_VALUE) + 0.5); ++ /* wrap back to minimum delay when max is exceeded */ ++ if (cur_delay > MAX_DELAY_MSEC) ++ cur_delay = MIN_DELAY_MSEC; ++ ++ spins = 0; ++ } ++ } ++ ++ /* ++ * If we were able to acquire the lock without delaying, it's a good ++ * indication we are in a multiprocessor. If we had to delay, it's a sign ++ * (but not a sure thing) that we are in a uniprocessor. Hence, we ++ * decrement spins_per_delay slowly when we had to delay, and increase it ++ * rapidly when we didn't. It's expected that spins_per_delay will ++ * converge to the minimum value on a uniprocessor and to the maximum ++ * value on a multiprocessor. ++ * ++ * Note: spins_per_delay is local within our current process. We want to ++ * average these observations across multiple backends, since it's ++ * relatively rare for this function to even get entered, and so a single ++ * backend might not live long enough to converge on a good value. That ++ * is handled by the two routines below. ++ */ ++ if (cur_delay == 0) ++ { ++ /* we never had to delay */ ++ if (spins_per_delay < MAX_SPINS_PER_DELAY) ++ spins_per_delay = Min(spins_per_delay + 100, MAX_SPINS_PER_DELAY); ++ } ++ else ++ { ++ if (spins_per_delay > MIN_SPINS_PER_DELAY) ++ spins_per_delay = Max(spins_per_delay - 1, MIN_SPINS_PER_DELAY); ++ } ++} ++ ++ ++#if 0 /* -- APC doesn't use the set_spins_per_delay or update_spins_per_delay -- */ ++/* ++ * Set local copy of spins_per_delay during backend startup. ++ * ++ * NB: this has to be pretty fast as it is called while holding a spinlock ++ */ ++void ++set_spins_per_delay(int shared_spins_per_delay) ++{ ++ spins_per_delay = shared_spins_per_delay; ++} ++ ++/* ++ * Update shared estimate of spins_per_delay during backend exit. ++ * ++ * NB: this has to be pretty fast as it is called while holding a spinlock ++ */ ++int ++update_spins_per_delay(int shared_spins_per_delay) ++{ ++ /* ++ * We use an exponential moving average with a relatively slow adaption ++ * rate, so that noise in any one backend's result won't affect the shared ++ * value too much. As long as both inputs are within the allowed range, ++ * the result must be too, so we need not worry about clamping the result. ++ * ++ * We deliberately truncate rather than rounding; this is so that single ++ * adjustments inside a backend can affect the shared estimate (see the ++ * asymmetric adjustment rules above). ++ */ ++ return (shared_spins_per_delay * 15 + spins_per_delay) / 16; ++} ++#endif ++ ++/* ++ * Various TAS implementations that cannot live in s_lock.h as no inline ++ * definition exists (yet). ++ * In the future, get rid of tas.[cso] and fold it into this file. ++ * ++ * If you change something here, you will likely need to modify s_lock.h too, ++ * because the definitions for these are split between this file and s_lock.h. ++ */ ++ ++ ++#ifdef HAVE_SPINLOCKS /* skip spinlocks if requested */ ++ ++ ++#if defined(__GNUC__) ++ ++/* ++ * All the gcc flavors that are not inlined ++ */ ++ ++ ++/* ++ * Note: all the if-tests here probably ought to be testing gcc version ++ * rather than platform, but I don't have adequate info to know what to ++ * write. Ideally we'd flush all this in favor of the inline version. ++ */ ++#if defined(__m68k__) && !defined(__linux__) ++/* really means: extern int tas(slock_t* **lock); */ ++static void ++tas_dummy() ++{ ++ __asm__ __volatile__( ++#if defined(__NetBSD__) && defined(__ELF__) ++/* no underscore for label and % for registers */ ++ "\ ++.global tas \n\ ++tas: \n\ ++ movel %sp@(0x4),%a0 \n\ ++ tas %a0@ \n\ ++ beq _success \n\ ++ moveq #-128,%d0 \n\ ++ rts \n\ ++_success: \n\ ++ moveq #0,%d0 \n\ ++ rts \n" ++#else ++ "\ ++.global _tas \n\ ++_tas: \n\ ++ movel sp@(0x4),a0 \n\ ++ tas a0@ \n\ ++ beq _success \n\ ++ moveq #-128,d0 \n\ ++ rts \n\ ++_success: \n\ ++ moveq #0,d0 \n\ ++ rts \n" ++#endif /* __NetBSD__ && __ELF__ */ ++ ); ++} ++#endif /* __m68k__ && !__linux__ */ ++#else /* not __GNUC__ */ ++ ++/* ++ * All non gcc ++ */ ++ ++ ++#if defined(sun3) ++static void ++tas_dummy() /* really means: extern int tas(slock_t ++ * *lock); */ ++{ ++ asm("LLA0:"); ++ asm(" .data"); ++ asm(" .text"); ++ asm("|#PROC# 04"); ++ asm(" .globl _tas"); ++ asm("_tas:"); ++ asm("|#PROLOGUE# 1"); ++ asm(" movel sp@(0x4),a0"); ++ asm(" tas a0@"); ++ asm(" beq LLA1"); ++ asm(" moveq #-128,d0"); ++ asm(" rts"); ++ asm("LLA1:"); ++ asm(" moveq #0,d0"); ++ asm(" rts"); ++ asm(" .data"); ++} ++#endif /* sun3 */ ++#endif /* not __GNUC__ */ ++#endif /* HAVE_SPINLOCKS */ ++ ++#endif /* APC_SPIN_LOCKS */ +diff -Naur a/ext/apc/pgsql_s_lock.h b/ext/apc/pgsql_s_lock.h +--- a/ext/apc/pgsql_s_lock.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/pgsql_s_lock.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,928 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | The following code was ported from the PostgreSQL project, please | ++ | see appropriate copyright notices that follow. | ++ | Initial conversion by Brian Shire | ++ +----------------------------------------------------------------------+ ++ ++ */ ++ ++/* $Id: pgsql_s_lock.h 307048 2011-01-03 23:53:17Z kalle $ */ ++ ++/*------------------------------------------------------------------------- ++ * ++ * s_lock.h ++ * Hardware-dependent implementation of spinlocks. ++ * ++ * NOTE: none of the macros in this file are intended to be called directly. ++ * Call them through the hardware-independent macros in spin.h. ++ * ++ * The following hardware-dependent macros must be provided for each ++ * supported platform: ++ * ++ * void S_INIT_LOCK(slock_t *lock) ++ * Initialize a spinlock (to the unlocked state). ++ * ++ * void S_LOCK(slock_t *lock) ++ * Acquire a spinlock, waiting if necessary. ++ * Time out and abort() if unable to acquire the lock in a ++ * "reasonable" amount of time --- typically ~ 1 minute. ++ * ++ * void S_UNLOCK(slock_t *lock) ++ * Unlock a previously acquired lock. ++ * ++ * bool S_LOCK_FREE(slock_t *lock) ++ * Tests if the lock is free. Returns TRUE if free, FALSE if locked. ++ * This does *not* change the state of the lock. ++ * ++ * void SPIN_DELAY(void) ++ * Delay operation to occur inside spinlock wait loop. ++ * ++ * Note to implementors: there are default implementations for all these ++ * macros at the bottom of the file. Check if your platform can use ++ * these or needs to override them. ++ * ++ * Usually, S_LOCK() is implemented in terms of an even lower-level macro ++ * TAS(): ++ * ++ * int TAS(slock_t *lock) ++ * Atomic test-and-set instruction. Attempt to acquire the lock, ++ * but do *not* wait. Returns 0 if successful, nonzero if unable ++ * to acquire the lock. ++ * ++ * TAS() is NOT part of the API, and should never be called directly. ++ * ++ * CAUTION: on some platforms TAS() may sometimes report failure to acquire ++ * a lock even when the lock is not locked. For example, on Alpha TAS() ++ * will "fail" if interrupted. Therefore TAS() should always be invoked ++ * in a retry loop, even if you are certain the lock is free. ++ * ++ * ANOTHER CAUTION: be sure that TAS() and S_UNLOCK() represent sequence ++ * points, ie, loads and stores of other values must not be moved across ++ * a lock or unlock. In most cases it suffices to make the operation be ++ * done through a "volatile" pointer. ++ * ++ * On most supported platforms, TAS() uses a tas() function written ++ * in assembly language to execute a hardware atomic-test-and-set ++ * instruction. Equivalent OS-supplied mutex routines could be used too. ++ * ++ * If no system-specific TAS() is available (ie, HAVE_SPINLOCKS is not ++ * defined), then we fall back on an emulation that uses SysV semaphores ++ * (see spin.c). This emulation will be MUCH MUCH slower than a proper TAS() ++ * implementation, because of the cost of a kernel call per lock or unlock. ++ * An old report is that Postgres spends around 40% of its time in semop(2) ++ * when using the SysV semaphore code. ++ * ++ * ++ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group ++ * Portions Copyright (c) 1994, Regents of the University of California ++ * ++ * $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.157 2006/06/07 22:24:45 momjian Exp $ ++ * ++ *------------------------------------------------------------------------- ++ */ ++#ifndef S_LOCK_H ++#define S_LOCK_H ++ ++/** APC namespace protection ************************************************/ ++/* hack to protect against any possible runtime namespace collisions...*/ ++#define pg_usleep apc_spin_pg_usleep ++#define s_lock apc_spin_s_lock ++#define spins_per_delay apc_spin_spins_per_delay ++/****************************************************************************/ ++ ++ ++/* #include "storage/pg_sema.h" -- Removed for APC */ ++ ++#define HAVE_SPINLOCKS 1 /* -- Added for APC */ ++ ++#ifdef HAVE_SPINLOCKS /* skip spinlocks if requested */ ++ ++ ++#if defined(__GNUC__) || defined(__ICC) ++/************************************************************************* ++ * All the gcc inlines ++ * Gcc consistently defines the CPU as __cpu__. ++ * Other compilers use __cpu or __cpu__ so we test for both in those cases. ++ */ ++ ++/*---------- ++ * Standard gcc asm format (assuming "volatile slock_t *lock"): ++ ++ __asm__ __volatile__( ++ " instruction \n" ++ " instruction \n" ++ " instruction \n" ++: "=r"(_res), "+m"(*lock) // return register, in/out lock value ++: "r"(lock) // lock pointer, in input register ++: "memory", "cc"); // show clobbered registers here ++ ++ * The output-operands list (after first colon) should always include ++ * "+m"(*lock), whether or not the asm code actually refers to this ++ * operand directly. This ensures that gcc believes the value in the ++ * lock variable is used and set by the asm code. Also, the clobbers ++ * list (after third colon) should always include "memory"; this prevents ++ * gcc from thinking it can cache the values of shared-memory fields ++ * across the asm code. Add "cc" if your asm code changes the condition ++ * code register, and also list any temp registers the code uses. ++ *---------- ++ */ ++ ++ ++#ifdef __i386__ /* 32-bit i386 */ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned char slock_t; ++ ++#define TAS(lock) tas(lock) ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ register slock_t _res = 1; ++ ++ /* ++ * Use a non-locking test before asserting the bus lock. Note that the ++ * extra test appears to be a small loss on some x86 platforms and a small ++ * win on others; it's by no means clear that we should keep it. ++ */ ++ __asm__ __volatile__( ++ " cmpb $0,%1 \n" ++ " jne 1f \n" ++ " lock \n" ++ " xchgb %0,%1 \n" ++ "1: \n" ++: "+q"(_res), "+m"(*lock) ++: ++: "memory", "cc"); ++ return (int) _res; ++} ++ ++#define SPIN_DELAY() spin_delay() ++ ++static __inline__ void ++spin_delay(void) ++{ ++ /* ++ * This sequence is equivalent to the PAUSE instruction ("rep" is ++ * ignored by old IA32 processors if the following instruction is ++ * not a string operation); the IA-32 Architecture Software ++ * Developer's Manual, Vol. 3, Section 7.7.2 describes why using ++ * PAUSE in the inner loop of a spin lock is necessary for good ++ * performance: ++ * ++ * The PAUSE instruction improves the performance of IA-32 ++ * processors supporting Hyper-Threading Technology when ++ * executing spin-wait loops and other routines where one ++ * thread is accessing a shared lock or semaphore in a tight ++ * polling loop. When executing a spin-wait loop, the ++ * processor can suffer a severe performance penalty when ++ * exiting the loop because it detects a possible memory order ++ * violation and flushes the core processor's pipeline. The ++ * PAUSE instruction provides a hint to the processor that the ++ * code sequence is a spin-wait loop. The processor uses this ++ * hint to avoid the memory order violation and prevent the ++ * pipeline flush. In addition, the PAUSE instruction ++ * de-pipelines the spin-wait loop to prevent it from ++ * consuming execution resources excessively. ++ */ ++ __asm__ __volatile__( ++ " rep; nop \n"); ++} ++ ++#endif /* __i386__ */ ++ ++ ++#ifdef __x86_64__ /* AMD Opteron, Intel EM64T */ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned char slock_t; ++ ++#define TAS(lock) tas(lock) ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ register slock_t _res = 1; ++ ++ /* ++ * On Opteron, using a non-locking test before the locking instruction ++ * is a huge loss. On EM64T, it appears to be a wash or small loss, ++ * so we needn't bother to try to distinguish the sub-architectures. ++ */ ++ __asm__ __volatile__( ++ " lock \n" ++ " xchgb %0,%1 \n" ++: "+q"(_res), "+m"(*lock) ++: ++: "memory", "cc"); ++ return (int) _res; ++} ++ ++#define SPIN_DELAY() spin_delay() ++ ++static __inline__ void ++spin_delay(void) ++{ ++ /* ++ * Adding a PAUSE in the spin delay loop is demonstrably a no-op on ++ * Opteron, but it may be of some use on EM64T, so we keep it. ++ */ ++ __asm__ __volatile__( ++ " rep; nop \n"); ++} ++ ++#endif /* __x86_64__ */ ++ ++ ++#if defined(__ia64__) || defined(__ia64) /* Intel Itanium */ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned int slock_t; ++ ++#define TAS(lock) tas(lock) ++ ++#ifndef __INTEL_COMPILER ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ long int ret; ++ ++ __asm__ __volatile__( ++ " xchg4 %0=%1,%2 \n" ++: "=r"(ret), "+m"(*lock) ++: "r"(1) ++: "memory"); ++ return (int) ret; ++} ++ ++#else /* __INTEL_COMPILER */ ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ int ret; ++ ++ ret = _InterlockedExchange(lock,1); /* this is a xchg asm macro */ ++ ++ return ret; ++} ++ ++#endif /* __INTEL_COMPILER */ ++#endif /* __ia64__ || __ia64 */ ++ ++ ++#if defined(__arm__) || defined(__arm) ++#define HAS_TEST_AND_SET ++ ++typedef unsigned char slock_t; ++ ++#define TAS(lock) tas(lock) ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ register slock_t _res = 1; ++ ++ __asm__ __volatile__( ++ " swpb %0, %0, [%2] \n" ++: "+r"(_res), "+m"(*lock) ++: "r"(lock) ++: "memory"); ++ return (int) _res; ++} ++ ++#endif /* __arm__ */ ++ ++ ++/* S/390 and S/390x Linux (32- and 64-bit zSeries) */ ++#if defined(__s390__) || defined(__s390x__) ++#define HAS_TEST_AND_SET ++ ++typedef unsigned int slock_t; ++ ++#define TAS(lock) tas(lock) ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ int _res = 0; ++ ++ __asm__ __volatile__( ++ " cs %0,%3,0(%2) \n" ++: "+d"(_res), "+m"(*lock) ++: "a"(lock), "d"(1) ++: "memory", "cc"); ++ return _res; ++} ++ ++#endif /* __s390__ || __s390x__ */ ++ ++ ++#if defined(__sparc__) /* Sparc */ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned char slock_t; ++ ++#define TAS(lock) tas(lock) ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ register slock_t _res; ++ ++ /* ++ * See comment in /pg/backend/port/tas/solaris_sparc.s for why this ++ * uses "ldstub", and that file uses "cas". gcc currently generates ++ * sparcv7-targeted binaries, so "cas" use isn't possible. ++ */ ++ __asm__ __volatile__( ++ " ldstub [%2], %0 \n" ++: "=r"(_res), "+m"(*lock) ++: "r"(lock) ++: "memory"); ++ return (int) _res; ++} ++ ++#endif /* __sparc__ */ ++ ++ ++/* PowerPC */ ++#if defined(__ppc__) || defined(__powerpc__) || defined(__ppc64__) || defined(__powerpc64__) ++#define HAS_TEST_AND_SET ++ ++#if defined(__ppc64__) || defined(__powerpc64__) ++typedef unsigned long slock_t; ++#else ++typedef unsigned int slock_t; ++#endif ++ ++#define TAS(lock) tas(lock) ++/* ++ * NOTE: per the Enhanced PowerPC Architecture manual, v1.0 dated 7-May-2002, ++ * an isync is a sufficient synchronization barrier after a lwarx/stwcx loop. ++ */ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ slock_t _t; ++ int _res; ++ ++ __asm__ __volatile__( ++" lwarx %0,0,%3 \n" ++" cmpwi %0,0 \n" ++" bne 1f \n" ++" addi %0,%0,1 \n" ++" stwcx. %0,0,%3 \n" ++" beq 2f \n" ++"1: li %1,1 \n" ++" b 3f \n" ++"2: \n" ++" isync \n" ++" li %1,0 \n" ++"3: \n" ++ ++: "=&r"(_t), "=r"(_res), "+m"(*lock) ++: "r"(lock) ++: "memory", "cc"); ++ return _res; ++} ++ ++/* PowerPC S_UNLOCK is almost standard but requires a "sync" instruction */ ++#define S_UNLOCK(lock) \ ++do \ ++{ \ ++ __asm__ __volatile__ (" sync \n"); \ ++ *((volatile slock_t *) (lock)) = 0; \ ++} while (0) ++ ++#endif /* powerpc */ ++ ++ ++/* Linux Motorola 68k */ ++#if (defined(__mc68000__) || defined(__m68k__)) && defined(__linux__) ++#define HAS_TEST_AND_SET ++ ++typedef unsigned char slock_t; ++ ++#define TAS(lock) tas(lock) ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ register int rv; ++ ++ __asm__ __volatile__( ++ " clrl %0 \n" ++ " tas %1 \n" ++ " sne %0 \n" ++: "=d"(rv), "+m"(*lock) ++: ++: "memory", "cc"); ++ return rv; ++} ++ ++#endif /* (__mc68000__ || __m68k__) && __linux__ */ ++ ++ ++/* ++ * VAXen -- even multiprocessor ones ++ * (thanks to Tom Ivar Helbekkmo) ++ */ ++#if defined(__vax__) ++#define HAS_TEST_AND_SET ++ ++typedef unsigned char slock_t; ++ ++#define TAS(lock) tas(lock) ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ register int _res; ++ ++ __asm__ __volatile__( ++ " movl $1, %0 \n" ++ " bbssi $0, (%2), 1f \n" ++ " clrl %0 \n" ++ "1: \n" ++: "=&r"(_res), "+m"(*lock) ++: "r"(lock) ++: "memory"); ++ return _res; ++} ++ ++#endif /* __vax__ */ ++ ++ ++#if defined(__ns32k__) /* National Semiconductor 32K */ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned char slock_t; ++ ++#define TAS(lock) tas(lock) ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ register int _res; ++ ++ __asm__ __volatile__( ++ " sbitb 0, %1 \n" ++ " sfsd %0 \n" ++: "=r"(_res), "+m"(*lock) ++: ++: "memory"); ++ return _res; ++} ++ ++#endif /* __ns32k__ */ ++ ++ ++#if defined(__alpha) || defined(__alpha__) /* Alpha */ ++/* ++ * Correct multi-processor locking methods are explained in section 5.5.3 ++ * of the Alpha AXP Architecture Handbook, which at this writing can be ++ * found at ftp://ftp.netbsd.org/pub/NetBSD/misc/dec-docs/index.html. ++ * For gcc we implement the handbook's code directly with inline assembler. ++ */ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned long slock_t; ++ ++#define TAS(lock) tas(lock) ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ register slock_t _res; ++ ++ __asm__ __volatile__( ++ " ldq $0, %1 \n" ++ " bne $0, 2f \n" ++ " ldq_l %0, %1 \n" ++ " bne %0, 2f \n" ++ " mov 1, $0 \n" ++ " stq_c $0, %1 \n" ++ " beq $0, 2f \n" ++ " mb \n" ++ " br 3f \n" ++ "2: mov 1, %0 \n" ++ "3: \n" ++: "=&r"(_res), "+m"(*lock) ++: ++: "memory", "0"); ++ return (int) _res; ++} ++ ++#define S_UNLOCK(lock) \ ++do \ ++{\ ++ __asm__ __volatile__ (" mb \n"); \ ++ *((volatile slock_t *) (lock)) = 0; \ ++} while (0) ++ ++#endif /* __alpha || __alpha__ */ ++ ++ ++#if defined(__mips__) && !defined(__sgi) /* non-SGI MIPS */ ++/* Note: on SGI we use the OS' mutex ABI, see below */ ++/* Note: R10000 processors require a separate SYNC */ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned int slock_t; ++ ++#define TAS(lock) tas(lock) ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ register volatile slock_t *_l = lock; ++ register int _res; ++ register int _tmp; ++ ++ __asm__ __volatile__( ++ " .set push \n" ++ " .set mips2 \n" ++ " .set noreorder \n" ++ " .set nomacro \n" ++ " ll %0, %2 \n" ++ " or %1, %0, 1 \n" ++ " sc %1, %2 \n" ++ " xori %1, 1 \n" ++ " or %0, %0, %1 \n" ++ " sync \n" ++ " .set pop " ++: "=&r" (_res), "=&r" (_tmp), "+R" (*_l) ++: ++: "memory"); ++ return _res; ++} ++ ++/* MIPS S_UNLOCK is almost standard but requires a "sync" instruction */ ++#define S_UNLOCK(lock) \ ++do \ ++{ \ ++ __asm__ __volatile__( \ ++ " .set push \n" \ ++ " .set mips2 \n" \ ++ " .set noreorder \n" \ ++ " .set nomacro \n" \ ++ " sync \n" \ ++ " .set pop "); \ ++ *((volatile slock_t *) (lock)) = 0; \ ++} while (0) ++ ++#endif /* __mips__ && !__sgi */ ++ ++ ++/* These live in s_lock.c, but only for gcc */ ++ ++ ++#if defined(__m68k__) && !defined(__linux__) /* non-Linux Motorola 68k */ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned char slock_t; ++#endif ++ ++ ++#endif /* __GNUC__ */ ++ ++ ++ ++/* ++ * --------------------------------------------------------------------- ++ * Platforms that use non-gcc inline assembly: ++ * --------------------------------------------------------------------- ++ */ ++ ++#if !defined(HAS_TEST_AND_SET) /* We didn't trigger above, let's try here */ ++ ++ ++#if defined(USE_UNIVEL_CC) /* Unixware compiler */ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned char slock_t; ++ ++#define TAS(lock) tas(lock) ++ ++asm int ++tas(volatile slock_t *s_lock) ++{ ++/* UNIVEL wants %mem in column 1, so we don't pg_indent this file */ ++%mem s_lock ++ pushl %ebx ++ movl s_lock, %ebx ++ movl $255, %eax ++ lock ++ xchgb %al, (%ebx) ++ popl %ebx ++} ++ ++#endif /* defined(USE_UNIVEL_CC) */ ++ ++ ++#if defined(__alpha) || defined(__alpha__) /* Tru64 Unix Alpha compiler */ ++/* ++ * The Tru64 compiler doesn't support gcc-style inline asm, but it does ++ * have some builtin functions that accomplish much the same results. ++ * For simplicity, slock_t is defined as long (ie, quadword) on Alpha ++ * regardless of the compiler in use. LOCK_LONG and UNLOCK_LONG only ++ * operate on an int (ie, longword), but that's OK as long as we define ++ * S_INIT_LOCK to zero out the whole quadword. ++ */ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned long slock_t; ++ ++#include ++#define S_INIT_LOCK(lock) (*(lock) = 0) ++#define TAS(lock) (__LOCK_LONG_RETRY((lock), 1) == 0) ++#define S_UNLOCK(lock) __UNLOCK_LONG(lock) ++ ++#endif /* __alpha || __alpha__ */ ++ ++ ++#if defined(__hppa) || defined(__hppa__) /* HP PA-RISC, GCC and HP compilers */ ++/* ++ * HP's PA-RISC ++ * ++ * See src/backend/port/hpux/tas.c.template for details about LDCWX. Because ++ * LDCWX requires a 16-byte-aligned address, we declare slock_t as a 16-byte ++ * struct. The active word in the struct is whichever has the aligned address; ++ * the other three words just sit at -1. ++ * ++ * When using gcc, we can inline the required assembly code. ++ */ ++#define HAS_TEST_AND_SET ++ ++typedef struct ++{ ++ int sema[4]; ++} slock_t; ++ ++#define TAS_ACTIVE_WORD(lock) ((volatile int *) (((long) (lock) + 15) & ~15)) ++ ++#if defined(__GNUC__) ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ volatile int *lockword = TAS_ACTIVE_WORD(lock); ++ register int lockval; ++ ++ __asm__ __volatile__( ++ " ldcwx 0(0,%2),%0 \n" ++: "=r"(lockval), "+m"(*lockword) ++: "r"(lockword) ++: "memory"); ++ return (lockval == 0); ++} ++ ++#endif /* __GNUC__ */ ++ ++#define S_UNLOCK(lock) (*TAS_ACTIVE_WORD(lock) = -1) ++ ++#define S_INIT_LOCK(lock) \ ++ do { \ ++ volatile slock_t *lock_ = (lock); \ ++ lock_->sema[0] = -1; \ ++ lock_->sema[1] = -1; \ ++ lock_->sema[2] = -1; \ ++ lock_->sema[3] = -1; \ ++ } while (0) ++ ++#define S_LOCK_FREE(lock) (*TAS_ACTIVE_WORD(lock) != 0) ++ ++#endif /* __hppa || __hppa__ */ ++ ++ ++#if defined(__hpux) && defined(__ia64) && !defined(__GNUC__) ++ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned int slock_t; ++ ++#include ++#define TAS(lock) _Asm_xchg(_SZ_W, lock, 1, _LDHINT_NONE) ++ ++#endif /* HPUX on IA64, non gcc */ ++ ++ ++#if defined(__sgi) /* SGI compiler */ ++/* ++ * SGI IRIX 5 ++ * slock_t is defined as a unsigned long. We use the standard SGI ++ * mutex API. ++ * ++ * The following comment is left for historical reasons, but is probably ++ * not a good idea since the mutex ABI is supported. ++ * ++ * This stuff may be supplemented in the future with Masato Kataoka's MIPS-II ++ * assembly from his NECEWS SVR4 port, but we probably ought to retain this ++ * for the R3000 chips out there. ++ */ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned long slock_t; ++ ++#include "mutex.h" ++#define TAS(lock) (test_and_set(lock,1)) ++#define S_UNLOCK(lock) (test_then_and(lock,0)) ++#define S_INIT_LOCK(lock) (test_then_and(lock,0)) ++#define S_LOCK_FREE(lock) (test_then_add(lock,0) == 0) ++#endif /* __sgi */ ++ ++ ++#if defined(sinix) /* Sinix */ ++/* ++ * SINIX / Reliant UNIX ++ * slock_t is defined as a struct abilock_t, which has a single unsigned long ++ * member. (Basically same as SGI) ++ */ ++#define HAS_TEST_AND_SET ++ ++#include "abi_mutex.h" ++typedef abilock_t slock_t; ++ ++#define TAS(lock) (!acquire_lock(lock)) ++#define S_UNLOCK(lock) release_lock(lock) ++#define S_INIT_LOCK(lock) init_lock(lock) ++#define S_LOCK_FREE(lock) (stat_lock(lock) == UNLOCKED) ++#endif /* sinix */ ++ ++ ++#if defined(_AIX) /* AIX */ ++/* ++ * AIX (POWER) ++ */ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned int slock_t; ++ ++#define TAS(lock) _check_lock(lock, 0, 1) ++#define S_UNLOCK(lock) _clear_lock(lock, 0) ++#endif /* _AIX */ ++ ++ ++#if defined (nextstep) /* Nextstep */ ++#define HAS_TEST_AND_SET ++ ++typedef struct mutex slock_t; ++ ++#define APC_SLOCK_NONBLOCKING_LOCK_AVAILABLE 0 /* -- APC: non-blocking lock not available in this case -- */ ++ ++#define S_LOCK(lock) mutex_lock(lock) ++#define S_UNLOCK(lock) mutex_unlock(lock) ++#define S_INIT_LOCK(lock) mutex_init(lock) ++/* For Mach, we have to delve inside the entrails of `struct mutex'. Ick! */ ++#define S_LOCK_FREE(alock) ((alock)->lock == 0) ++#endif /* nextstep */ ++ ++ ++/* These are in s_lock.c */ ++ ++ ++#if defined(sun3) /* Sun3 */ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned char slock_t; ++#endif ++ ++ ++#if defined(__sun) && (defined(__i386) || defined(__x86_64__) || defined(__sparc__) || defined(__sparc)) ++#define HAS_TEST_AND_SET ++ ++#if defined(__i386) || defined(__x86_64__) || defined(__sparcv9) || defined(__sparcv8plus) ++typedef unsigned int slock_t; ++#else ++typedef unsigned char slock_t; ++#endif ++ ++extern slock_t pg_atomic_cas(volatile slock_t *lock, slock_t with, ++ slock_t cmp); ++ ++#define TAS(a) (pg_atomic_cas((a), 1, 0) != 0) ++#endif ++ ++ ++#ifdef WIN32_ONLY_COMPILER ++typedef LONG slock_t; ++ ++#define HAS_TEST_AND_SET ++#define TAS(lock) (InterlockedCompareExchange(lock, 1, 0)) ++ ++#define SPIN_DELAY() spin_delay() ++ ++static __forceinline void ++spin_delay(void) ++{ ++ /* See comment for gcc code. Same code, MASM syntax */ ++ __asm rep nop; ++} ++ ++#endif ++ ++ ++#endif /* !defined(HAS_TEST_AND_SET) */ ++ ++ ++/* Blow up if we didn't have any way to do spinlocks */ ++#ifndef HAS_TEST_AND_SET ++/* -- APC: We have better options in APC than this, that should be specified explicitly so just fail out and notify the user -- */ ++#error Spin locking is not available on your platform, please select another locking method (see ./configure --help). ++/* #error PostgreSQL does not have native spinlock support on this platform. To continue the compilation, rerun configure using --disable-spinlocks. However, performance will be poor. Please report this to pgsql-bugs@postgresql.org. */ ++#endif ++ ++ ++#else /* !HAVE_SPINLOCKS */ ++ ++ ++/* ++ * Fake spinlock implementation using semaphores --- slow and prone ++ * to fall foul of kernel limits on number of semaphores, so don't use this ++ * unless you must! The subroutines appear in spin.c. ++ */ ++ ++/* -- Removed for APC ++typedef PGSemaphoreData slock_t; ++ ++extern bool s_lock_free_sema(volatile slock_t *lock); ++extern void s_unlock_sema(volatile slock_t *lock); ++extern void s_init_lock_sema(volatile slock_t *lock); ++extern int tas_sema(volatile slock_t *lock); ++ ++#define S_LOCK_FREE(lock) s_lock_free_sema(lock) ++#define S_UNLOCK(lock) s_unlock_sema(lock) ++#define S_INIT_LOCK(lock) s_init_lock_sema(lock) ++#define TAS(lock) tas_sema(lock) ++*/ ++ ++#endif /* HAVE_SPINLOCKS */ ++ ++ ++/* ++ * Default Definitions - override these above as needed. ++ */ ++ ++#define APC_SLOCK_NONBLOCKING_LOCK_AVAILABLE 1 /* -- APC: Non-blocking lock available for this case -- */ ++ ++#if !defined(S_LOCK) ++#define S_LOCK(lock) \ ++ do { \ ++ if (TAS(lock)) \ ++ s_lock((lock), __FILE__, __LINE__ TSRMLS_CC); \ ++ } while (0) ++#endif /* S_LOCK */ ++ ++#if !defined(S_LOCK_FREE) ++#define S_LOCK_FREE(lock) (*(lock) == 0) ++#endif /* S_LOCK_FREE */ ++ ++#if !defined(S_UNLOCK) ++#define S_UNLOCK(lock) (*((volatile slock_t *) (lock)) = 0) ++#endif /* S_UNLOCK */ ++ ++#if !defined(S_INIT_LOCK) ++#define S_INIT_LOCK(lock) S_UNLOCK(lock) ++#endif /* S_INIT_LOCK */ ++ ++#if !defined(SPIN_DELAY) ++#define SPIN_DELAY() ((void) 0) ++#endif /* SPIN_DELAY */ ++ ++#if !defined(TAS) ++extern int tas(volatile slock_t *lock); /* in port/.../tas.s, or ++ * s_lock.c */ ++ ++#define TAS(lock) tas(lock) ++#endif /* TAS */ ++ ++ ++/* ++ * Platform-independent out-of-line support routines ++ */ ++extern void s_lock(volatile slock_t *lock, const char *file, int line TSRMLS_DC); ++ ++/* Support for dynamic adjustment of spins_per_delay */ ++#define DEFAULT_SPINS_PER_DELAY 100 ++ ++#if 0 /* -- Removed from APC use -- */ ++extern void set_spins_per_delay(int shared_spins_per_delay); ++extern int update_spins_per_delay(int shared_spins_per_delay); ++#endif ++ ++#endif /* S_LOCK_H */ +diff -Naur a/ext/apc/php_apc.c b/ext/apc/php_apc.c +--- a/ext/apc/php_apc.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/php_apc.c 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,1716 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | Rasmus Lerdorf | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: php_apc.c 325875 2012-05-27 17:15:26Z felipe $ */ ++ ++#include "apc_zend.h" ++#include "apc_cache.h" ++#include "apc_iterator.h" ++#include "apc_main.h" ++#include "apc_sma.h" ++#include "apc_lock.h" ++#include "apc_bin.h" ++#include "php_globals.h" ++#include "php_ini.h" ++#include "ext/standard/info.h" ++#include "ext/standard/file.h" ++#include "ext/standard/flock_compat.h" ++#ifdef HAVE_SYS_FILE_H ++#include ++#endif ++#include "SAPI.h" ++#include "rfc1867.h" ++#include "php_apc.h" ++#include "ext/standard/md5.h" ++ ++#if HAVE_SIGACTION ++#include "apc_signal.h" ++#endif ++ ++/* {{{ PHP_FUNCTION declarations */ ++PHP_FUNCTION(apc_cache_info); ++PHP_FUNCTION(apc_clear_cache); ++PHP_FUNCTION(apc_sma_info); ++PHP_FUNCTION(apc_store); ++PHP_FUNCTION(apc_fetch); ++PHP_FUNCTION(apc_delete); ++PHP_FUNCTION(apc_delete_file); ++PHP_FUNCTION(apc_compile_file); ++PHP_FUNCTION(apc_define_constants); ++PHP_FUNCTION(apc_load_constants); ++PHP_FUNCTION(apc_add); ++PHP_FUNCTION(apc_inc); ++PHP_FUNCTION(apc_dec); ++PHP_FUNCTION(apc_cas); ++PHP_FUNCTION(apc_bin_dump); ++PHP_FUNCTION(apc_bin_load); ++PHP_FUNCTION(apc_bin_dumpfile); ++PHP_FUNCTION(apc_bin_loadfile); ++PHP_FUNCTION(apc_exists); ++/* }}} */ ++ ++/* {{{ ZEND_DECLARE_MODULE_GLOBALS(apc) */ ++ZEND_DECLARE_MODULE_GLOBALS(apc) ++ ++/* True globals */ ++apc_cache_t* apc_cache = NULL; ++apc_cache_t* apc_user_cache = NULL; ++ ++static void php_apc_init_globals(zend_apc_globals* apc_globals TSRMLS_DC) ++{ ++ apc_globals->filters = NULL; ++ apc_globals->compiled_filters = NULL; ++ apc_globals->initialized = 0; ++ apc_globals->cache_stack = apc_stack_create(0 TSRMLS_CC); ++ apc_globals->cache_by_default = 1; ++ apc_globals->fpstat = 1; ++ apc_globals->canonicalize = 1; ++ apc_globals->stat_ctime = 0; ++ apc_globals->write_lock = 1; ++ apc_globals->slam_defense = 1; ++ apc_globals->report_autofilter = 0; ++ apc_globals->include_once = 0; ++ apc_globals->apc_optimize_function = NULL; ++#ifdef MULTIPART_EVENT_FORMDATA ++ apc_globals->rfc1867 = 0; ++ memset(&(apc_globals->rfc1867_data), 0, sizeof(apc_rfc1867_data)); ++#endif ++ memset(&apc_globals->copied_zvals, 0, sizeof(HashTable)); ++ apc_globals->force_file_update = 0; ++ apc_globals->coredump_unmap = 0; ++ apc_globals->preload_path = NULL; ++ apc_globals->use_request_time = 1; ++ apc_globals->lazy_class_table = NULL; ++ apc_globals->lazy_function_table = NULL; ++ apc_globals->serializer_name = NULL; ++ apc_globals->serializer = NULL; ++} ++ ++static void php_apc_shutdown_globals(zend_apc_globals* apc_globals TSRMLS_DC) ++{ ++ /* deallocate the ignore patterns */ ++ if (apc_globals->filters != NULL) { ++ int i; ++ for (i=0; apc_globals->filters[i] != NULL; i++) { ++ apc_efree(apc_globals->filters[i] TSRMLS_CC); ++ } ++ apc_efree(apc_globals->filters TSRMLS_CC); ++ } ++ ++ /* the stack should be empty */ ++ assert(apc_stack_size(apc_globals->cache_stack) == 0); ++ ++ /* apc cleanup */ ++ apc_stack_destroy(apc_globals->cache_stack TSRMLS_CC); ++ ++ /* the rest of the globals are cleaned up in apc_module_shutdown() */ ++} ++ ++static long apc_atol(const char *str, int str_len) ++{ ++#if PHP_MAJOR_VERSION >= 6 || PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3 ++ return zend_atol(str, str_len); ++#else ++ /* Re-implement zend_atol() for 5.2.x */ ++ long retval; ++ ++ if (!str_len) { ++ str_len = strlen(str); ++ } ++ ++ retval = strtol(str, NULL, 0); ++ ++ if (str_len > 0) { ++ switch (str[str_len - 1]) { ++ case 'g': ++ case 'G': ++ retval *= 1024; ++ /* break intentionally missing */ ++ case 'm': ++ case 'M': ++ retval *= 1024; ++ /* break intentionally missing */ ++ case 'k': ++ case 'K': ++ retval *= 1024; ++ break; ++ } ++ } ++ ++ return retval; ++#endif ++} ++ ++/* }}} */ ++ ++/* {{{ PHP_INI */ ++ ++static PHP_INI_MH(OnUpdate_filters) /* {{{ */ ++{ ++ APCG(filters) = apc_tokenize(new_value, ',' TSRMLS_CC); ++ return SUCCESS; ++} ++/* }}} */ ++ ++static PHP_INI_MH(OnUpdateShmSegments) /* {{{ */ ++{ ++#if APC_MMAP ++ if(zend_atoi(new_value, new_value_length)!=1) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "apc.shm_segments setting ignored in MMAP mode"); ++ } ++ APCG(shm_segments) = 1; ++#else ++ APCG(shm_segments) = zend_atoi(new_value, new_value_length); ++#endif ++ return SUCCESS; ++} ++/* }}} */ ++ ++static PHP_INI_MH(OnUpdateShmSize) /* {{{ */ ++{ ++ long s = apc_atol(new_value, new_value_length); ++ ++ if(s <= 0) { ++ return FAILURE; ++ } ++ ++ if(s < 1048576L) { ++ /* if it's less than 1Mb, they are probably using the old syntax */ ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "apc.shm_size now uses M/G suffixes, please update your ini files"); ++ s = s * 1048576L; ++ } ++ ++ APCG(shm_size) = s; ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++#ifdef MULTIPART_EVENT_FORMDATA ++static PHP_INI_MH(OnUpdateRfc1867Freq) /* {{{ */ ++{ ++ int tmp; ++ tmp = zend_atoi(new_value, new_value_length); ++ if(tmp < 0) { ++ apc_error("rfc1867_freq must be greater than or equal to zero." TSRMLS_CC); ++ return FAILURE; ++ } ++ if(new_value[new_value_length-1] == '%') { ++ if(tmp > 100) { ++ apc_error("rfc1867_freq cannot be over 100%%" TSRMLS_CC); ++ return FAILURE; ++ } ++ APCG(rfc1867_freq) = tmp / 100.0; ++ } else { ++ APCG(rfc1867_freq) = tmp; ++ } ++ return SUCCESS; ++} ++/* }}} */ ++#endif ++ ++PHP_INI_BEGIN() ++STD_PHP_INI_BOOLEAN("apc.enabled", "1", PHP_INI_SYSTEM, OnUpdateBool, enabled, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.shm_segments", "1", PHP_INI_SYSTEM, OnUpdateShmSegments, shm_segments, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.shm_size", "32M", PHP_INI_SYSTEM, OnUpdateShmSize, shm_size, zend_apc_globals, apc_globals) ++#ifdef ZEND_ENGINE_2_4 ++STD_PHP_INI_ENTRY("apc.shm_strings_buffer", "4M", PHP_INI_SYSTEM, OnUpdateLong, shm_strings_buffer, zend_apc_globals, apc_globals) ++#endif ++STD_PHP_INI_BOOLEAN("apc.include_once_override", "0", PHP_INI_SYSTEM, OnUpdateBool, include_once, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.num_files_hint", "1000", PHP_INI_SYSTEM, OnUpdateLong, num_files_hint, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.user_entries_hint", "4096", PHP_INI_SYSTEM, OnUpdateLong, user_entries_hint, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.gc_ttl", "3600", PHP_INI_SYSTEM, OnUpdateLong, gc_ttl, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.ttl", "0", PHP_INI_SYSTEM, OnUpdateLong, ttl, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.user_ttl", "0", PHP_INI_SYSTEM, OnUpdateLong, user_ttl, zend_apc_globals, apc_globals) ++#if APC_MMAP ++STD_PHP_INI_ENTRY("apc.mmap_file_mask", NULL, PHP_INI_SYSTEM, OnUpdateString, mmap_file_mask, zend_apc_globals, apc_globals) ++#endif ++PHP_INI_ENTRY("apc.filters", NULL, PHP_INI_SYSTEM, OnUpdate_filters) ++STD_PHP_INI_BOOLEAN("apc.cache_by_default", "1", PHP_INI_ALL, OnUpdateBool, cache_by_default, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.file_update_protection", "2", PHP_INI_SYSTEM, OnUpdateLong,file_update_protection, zend_apc_globals, apc_globals) ++STD_PHP_INI_BOOLEAN("apc.enable_cli", "0", PHP_INI_SYSTEM, OnUpdateBool, enable_cli, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.max_file_size", "1M", PHP_INI_SYSTEM, OnUpdateLong, max_file_size, zend_apc_globals, apc_globals) ++STD_PHP_INI_BOOLEAN("apc.stat", "1", PHP_INI_SYSTEM, OnUpdateBool, fpstat, zend_apc_globals, apc_globals) ++STD_PHP_INI_BOOLEAN("apc.canonicalize", "1", PHP_INI_SYSTEM, OnUpdateBool, canonicalize, zend_apc_globals, apc_globals) ++STD_PHP_INI_BOOLEAN("apc.stat_ctime", "0", PHP_INI_SYSTEM, OnUpdateBool, stat_ctime, zend_apc_globals, apc_globals) ++STD_PHP_INI_BOOLEAN("apc.write_lock", "1", PHP_INI_SYSTEM, OnUpdateBool, write_lock, zend_apc_globals, apc_globals) ++STD_PHP_INI_BOOLEAN("apc.slam_defense", "1", PHP_INI_SYSTEM, OnUpdateBool, slam_defense, zend_apc_globals, apc_globals) ++STD_PHP_INI_BOOLEAN("apc.report_autofilter", "0", PHP_INI_SYSTEM, OnUpdateBool, report_autofilter,zend_apc_globals, apc_globals) ++#ifdef MULTIPART_EVENT_FORMDATA ++STD_PHP_INI_BOOLEAN("apc.rfc1867", "0", PHP_INI_SYSTEM, OnUpdateBool, rfc1867, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.rfc1867_prefix", "upload_", PHP_INI_SYSTEM, OnUpdateStringUnempty, rfc1867_prefix, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.rfc1867_name", "APC_UPLOAD_PROGRESS", PHP_INI_SYSTEM, OnUpdateStringUnempty, rfc1867_name, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.rfc1867_freq", "0", PHP_INI_SYSTEM, OnUpdateRfc1867Freq, rfc1867_freq, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.rfc1867_ttl", "3600", PHP_INI_SYSTEM, OnUpdateLong, rfc1867_ttl, zend_apc_globals, apc_globals) ++#endif ++STD_PHP_INI_BOOLEAN("apc.coredump_unmap", "0", PHP_INI_SYSTEM, OnUpdateBool, coredump_unmap, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.preload_path", (char*)NULL, PHP_INI_SYSTEM, OnUpdateString, preload_path, zend_apc_globals, apc_globals) ++STD_PHP_INI_BOOLEAN("apc.file_md5", "0", PHP_INI_SYSTEM, OnUpdateBool, file_md5, zend_apc_globals, apc_globals) ++STD_PHP_INI_BOOLEAN("apc.use_request_time", "1", PHP_INI_ALL, OnUpdateBool, use_request_time, zend_apc_globals, apc_globals) ++STD_PHP_INI_BOOLEAN("apc.lazy_functions", "0", PHP_INI_SYSTEM, OnUpdateBool, lazy_functions, zend_apc_globals, apc_globals) ++STD_PHP_INI_BOOLEAN("apc.lazy_classes", "0", PHP_INI_SYSTEM, OnUpdateBool, lazy_classes, zend_apc_globals, apc_globals) ++STD_PHP_INI_ENTRY("apc.serializer", "default", PHP_INI_SYSTEM, OnUpdateStringUnempty, serializer_name, zend_apc_globals, apc_globals) ++PHP_INI_END() ++ ++/* }}} */ ++ ++/* {{{ PHP_MINFO_FUNCTION(apc) */ ++static PHP_MINFO_FUNCTION(apc) ++{ ++ apc_serializer_t *serializer = NULL; ++ smart_str names = {0,}; ++ int i; ++ ++ php_info_print_table_start(); ++ php_info_print_table_header(2, "APC Support", APCG(enabled) ? "enabled" : "disabled"); ++ php_info_print_table_row(2, "Version", PHP_APC_VERSION); ++#ifdef __DEBUG_APC__ ++ php_info_print_table_row(2, "APC Debugging", "Enabled"); ++#else ++ php_info_print_table_row(2, "APC Debugging", "Disabled"); ++#endif ++#if APC_MMAP ++ php_info_print_table_row(2, "MMAP Support", "Enabled"); ++ php_info_print_table_row(2, "MMAP File Mask", APCG(mmap_file_mask)); ++#else ++ php_info_print_table_row(2, "MMAP Support", "Disabled"); ++#endif ++ php_info_print_table_row(2, "Locking type", APC_LOCK_TYPE); ++ ++ for( i = 0, serializer = apc_get_serializers(TSRMLS_C); ++ serializer->name != NULL; ++ serializer++, i++) { ++ if(i != 0) smart_str_appends(&names, ", "); ++ smart_str_appends(&names, serializer->name); ++ } ++ ++ if(names.c) { ++ smart_str_0(&names); ++ php_info_print_table_row(2, "Serialization Support", names.c); ++ smart_str_free(&names); ++ } else { ++ php_info_print_table_row(2, "Serialization Support", "broken"); ++ } ++ ++ php_info_print_table_row(2, "Revision", "$Revision: 325875 $"); ++ php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__); ++ php_info_print_table_end(); ++ DISPLAY_INI_ENTRIES(); ++} ++/* }}} */ ++ ++#ifdef MULTIPART_EVENT_FORMDATA ++extern int apc_rfc1867_progress(unsigned int event, void *event_data, void **extra TSRMLS_DC); ++#endif ++ ++/* {{{ PHP_MINIT_FUNCTION(apc) */ ++static PHP_MINIT_FUNCTION(apc) ++{ ++ ZEND_INIT_MODULE_GLOBALS(apc, php_apc_init_globals, php_apc_shutdown_globals); ++ ++ REGISTER_INI_ENTRIES(); ++ ++ /* Disable APC in cli mode unless overridden by apc.enable_cli */ ++ if(!APCG(enable_cli) && !strcmp(sapi_module.name, "cli")) { ++ APCG(enabled) = 0; ++ } ++ ++ if (APCG(enabled)) { ++ if(APCG(initialized)) { ++ apc_process_init(module_number TSRMLS_CC); ++ } else { ++ apc_module_init(module_number TSRMLS_CC); ++ apc_zend_init(TSRMLS_C); ++ apc_process_init(module_number TSRMLS_CC); ++#ifdef MULTIPART_EVENT_FORMDATA ++ /* File upload progress tracking */ ++ if(APCG(rfc1867)) { ++ php_rfc1867_callback = apc_rfc1867_progress; ++ } ++#endif ++ apc_iterator_init(module_number TSRMLS_CC); ++ } ++ ++ zend_register_long_constant("APC_BIN_VERIFY_MD5", sizeof("APC_BIN_VERIFY_MD5"), APC_BIN_VERIFY_MD5, (CONST_CS | CONST_PERSISTENT), module_number TSRMLS_CC); ++ zend_register_long_constant("APC_BIN_VERIFY_CRC32", sizeof("APC_BIN_VERIFY_CRC32"), APC_BIN_VERIFY_CRC32, (CONST_CS | CONST_PERSISTENT), module_number TSRMLS_CC); ++ } ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ PHP_MSHUTDOWN_FUNCTION(apc) */ ++static PHP_MSHUTDOWN_FUNCTION(apc) ++{ ++ if(APCG(enabled)) { ++ apc_process_shutdown(TSRMLS_C); ++ apc_zend_shutdown(TSRMLS_C); ++ apc_module_shutdown(TSRMLS_C); ++#ifndef ZTS ++ php_apc_shutdown_globals(&apc_globals); ++#endif ++#if HAVE_SIGACTION ++ apc_shutdown_signals(TSRMLS_C); ++#endif ++ } ++#ifdef ZTS ++ ts_free_id(apc_globals_id); ++#endif ++ UNREGISTER_INI_ENTRIES(); ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ PHP_RINIT_FUNCTION(apc) */ ++static PHP_RINIT_FUNCTION(apc) ++{ ++ if(APCG(enabled)) { ++ apc_request_init(TSRMLS_C); ++ ++#if HAVE_SIGACTION ++ apc_set_signals(TSRMLS_C); ++#endif ++ } ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ PHP_RSHUTDOWN_FUNCTION(apc) */ ++static PHP_RSHUTDOWN_FUNCTION(apc) ++{ ++ if(APCG(enabled)) { ++ apc_request_shutdown(TSRMLS_C); ++ } ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ proto array apc_cache_info([string type [, bool limited]]) */ ++PHP_FUNCTION(apc_cache_info) ++{ ++ zval* info; ++ char *cache_type; ++ int ct_len; ++ zend_bool limited = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &cache_type, &ct_len, &limited) == FAILURE) { ++ return; ++ } ++ ++ if(ZEND_NUM_ARGS()) { ++ if(!strcasecmp(cache_type,"user")) { ++ info = apc_cache_info(apc_user_cache, limited TSRMLS_CC); ++ } else if(!strcasecmp(cache_type,"filehits")) { ++#ifdef APC_FILEHITS ++ RETVAL_ZVAL(APCG(filehits), 1, 0); ++ return; ++#else ++ RETURN_FALSE; ++#endif ++ } else { ++ info = apc_cache_info(apc_cache, limited TSRMLS_CC); ++ } ++ } else { ++ info = apc_cache_info(apc_cache, limited TSRMLS_CC); ++ } ++ ++ if(!info) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "No APC info available. Perhaps APC is not enabled? Check apc.enabled in your ini file"); ++ RETURN_FALSE; ++ } ++ ++ RETURN_ZVAL(info, 0, 1); ++ ++} ++/* }}} */ ++ ++/* {{{ proto void apc_clear_cache([string cache]) */ ++PHP_FUNCTION(apc_clear_cache) ++{ ++ char *cache_type; ++ int ct_len = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &cache_type, &ct_len) == FAILURE) { ++ return; ++ } ++ ++ if(ct_len) { ++ if(!strcasecmp(cache_type, "user")) { ++ apc_cache_clear(apc_user_cache TSRMLS_CC); ++ RETURN_TRUE; ++ } ++ } ++ apc_cache_clear(apc_cache TSRMLS_CC); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto array apc_sma_info([bool limited]) */ ++PHP_FUNCTION(apc_sma_info) ++{ ++ apc_sma_info_t* info; ++ zval* block_lists; ++ int i; ++ zend_bool limited = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &limited) == FAILURE) { ++ return; ++ } ++ ++ info = apc_sma_info(limited TSRMLS_CC); ++ ++ if(!info) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "No APC SMA info available. Perhaps APC is disabled via apc.enabled?"); ++ RETURN_FALSE; ++ } ++ ++ array_init(return_value); ++ add_assoc_long(return_value, "num_seg", info->num_seg); ++ add_assoc_double(return_value, "seg_size", (double)info->seg_size); ++ add_assoc_double(return_value, "avail_mem", (double)apc_sma_get_avail_mem()); ++ ++ if(limited) { ++ apc_sma_free_info(info TSRMLS_CC); ++ return; ++ } ++ ++#if ALLOC_DISTRIBUTION ++ { ++ size_t *adist = apc_sma_get_alloc_distribution(); ++ zval* list; ++ ALLOC_INIT_ZVAL(list); ++ array_init(list); ++ for(i=0; i<30; i++) { ++ add_next_index_long(list, adist[i]); ++ } ++ add_assoc_zval(return_value, "adist", list); ++ } ++#endif ++ ALLOC_INIT_ZVAL(block_lists); ++ array_init(block_lists); ++ ++ for (i = 0; i < info->num_seg; i++) { ++ apc_sma_link_t* p; ++ zval* list; ++ ++ ALLOC_INIT_ZVAL(list); ++ array_init(list); ++ ++ for (p = info->list[i]; p != NULL; p = p->next) { ++ zval* link; ++ ++ ALLOC_INIT_ZVAL(link); ++ array_init(link); ++ ++ add_assoc_long(link, "size", p->size); ++ add_assoc_long(link, "offset", p->offset); ++ add_next_index_zval(list, link); ++ } ++ add_next_index_zval(block_lists, list); ++ } ++ add_assoc_zval(return_value, "block_lists", block_lists); ++ apc_sma_free_info(info TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ */ ++int _apc_update(char *strkey, int strkey_len, apc_cache_updater_t updater, void* data TSRMLS_DC) ++{ ++ if(!APCG(enabled)) { ++ return 0; ++ } ++ ++ if (!APCG(serializer) && APCG(serializer_name)) { ++ /* Avoid race conditions between MINIT of apc and serializer exts like igbinary */ ++ APCG(serializer) = apc_find_serializer(APCG(serializer_name) TSRMLS_CC); ++ } ++ ++ HANDLE_BLOCK_INTERRUPTIONS(); ++ APCG(current_cache) = apc_user_cache; ++ ++ if (!_apc_cache_user_update(apc_user_cache, strkey, strkey_len + 1, updater, data TSRMLS_CC)) { ++ HANDLE_UNBLOCK_INTERRUPTIONS(); ++ return 0; ++ } ++ ++ APCG(current_cache) = NULL; ++ HANDLE_UNBLOCK_INTERRUPTIONS(); ++ ++ return 1; ++} ++/* }}} */ ++ ++/* {{{ _apc_store */ ++int _apc_store(char *strkey, int strkey_len, const zval *val, const unsigned int ttl, const int exclusive TSRMLS_DC) { ++ apc_cache_entry_t *entry; ++ apc_cache_key_t key; ++ time_t t; ++ apc_context_t ctxt={0,}; ++ int ret = 1; ++ ++ t = apc_time(); ++ ++ if(!APCG(enabled)) return 0; ++ ++ if (!APCG(serializer) && APCG(serializer_name)) { ++ /* Avoid race conditions between MINIT of apc and serializer exts like igbinary */ ++ APCG(serializer) = apc_find_serializer(APCG(serializer_name) TSRMLS_CC); ++ } ++ ++ HANDLE_BLOCK_INTERRUPTIONS(); ++ ++ APCG(current_cache) = apc_user_cache; ++ ++ ctxt.pool = apc_pool_create(APC_SMALL_POOL, apc_sma_malloc, apc_sma_free, apc_sma_protect, apc_sma_unprotect TSRMLS_CC); ++ if (!ctxt.pool) { ++ apc_warning("Unable to allocate memory for pool." TSRMLS_CC); ++ return 0; ++ } ++ ctxt.copy = APC_COPY_IN_USER; ++ ctxt.force_update = 0; ++ ++ if(!ctxt.pool) { ++ ret = 0; ++ goto nocache; ++ } ++ ++ if (!apc_cache_make_user_key(&key, strkey, strkey_len, t)) { ++ goto freepool; ++ } ++ ++ if (apc_cache_is_last_key(apc_user_cache, &key, t TSRMLS_CC)) { ++ goto freepool; ++ } ++ ++ if (!(entry = apc_cache_make_user_entry(strkey, strkey_len, val, &ctxt, ttl TSRMLS_CC))) { ++ goto freepool; ++ } ++ ++ if (!apc_cache_user_insert(apc_user_cache, key, entry, &ctxt, t, exclusive TSRMLS_CC)) { ++freepool: ++ apc_pool_destroy(ctxt.pool TSRMLS_CC); ++ ret = 0; ++ } ++ ++nocache: ++ ++ APCG(current_cache) = NULL; ++ ++ HANDLE_UNBLOCK_INTERRUPTIONS(); ++ ++ return ret; ++} ++/* }}} */ ++ ++/* {{{ apc_store_helper(INTERNAL_FUNCTION_PARAMETERS, const int exclusive) ++ */ ++static void apc_store_helper(INTERNAL_FUNCTION_PARAMETERS, const int exclusive) ++{ ++ zval *key = NULL; ++ zval *val = NULL; ++ long ttl = 0L; ++ HashTable *hash; ++ HashPosition hpos; ++ zval **hentry; ++ char *hkey=NULL; ++ uint hkey_len; ++ ulong hkey_idx; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|zl", &key, &val, &ttl) == FAILURE) { ++ return; ++ } ++ ++ if (!key) RETURN_FALSE; ++ ++ if (Z_TYPE_P(key) == IS_ARRAY) { ++ hash = Z_ARRVAL_P(key); ++ array_init(return_value); ++ zend_hash_internal_pointer_reset_ex(hash, &hpos); ++ while(zend_hash_get_current_data_ex(hash, (void**)&hentry, &hpos) == SUCCESS) { ++ zend_hash_get_current_key_ex(hash, &hkey, &hkey_len, &hkey_idx, 0, &hpos); ++ if (hkey) { ++ if(!_apc_store(hkey, hkey_len, *hentry, (unsigned int)ttl, exclusive TSRMLS_CC)) { ++ add_assoc_long_ex(return_value, hkey, hkey_len, -1); /* -1: insertion error */ ++ } ++ hkey = NULL; ++ } else { ++ add_index_long(return_value, hkey_idx, -1); /* -1: insertion error */ ++ } ++ zend_hash_move_forward_ex(hash, &hpos); ++ } ++ return; ++ } else if (Z_TYPE_P(key) == IS_STRING) { ++ if (!val) RETURN_FALSE; ++ if(_apc_store(Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, val, (unsigned int)ttl, exclusive TSRMLS_CC)) ++ RETURN_TRUE; ++ } else { ++ apc_warning("apc_store expects key parameter to be a string or an array of key/value pairs." TSRMLS_CC); ++ } ++ ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto int apc_store(mixed key, mixed var [, long ttl ]) ++ */ ++PHP_FUNCTION(apc_store) { ++ apc_store_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); ++} ++/* }}} */ ++ ++/* {{{ proto int apc_add(mixed key, mixed var [, long ttl ]) ++ */ ++PHP_FUNCTION(apc_add) { ++ apc_store_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); ++} ++/* }}} */ ++ ++/* {{{ inc_updater */ ++ ++struct _inc_update_args { ++ long step; ++ long lval; ++}; ++ ++static int inc_updater(apc_cache_t* cache, apc_cache_entry_t* entry, void* data) { ++ ++ struct _inc_update_args *args = (struct _inc_update_args*) data; ++ ++ zval* val = entry->data.user.val; ++ ++ if(Z_TYPE_P(val) == IS_LONG) { ++ Z_LVAL_P(val) += args->step; ++ args->lval = Z_LVAL_P(val); ++ return 1; ++ } ++ ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ proto long apc_inc(string key [, long step [, bool& success]]) ++ */ ++PHP_FUNCTION(apc_inc) { ++ char *strkey; ++ int strkey_len; ++ struct _inc_update_args args = {1L, -1}; ++ zval *success = NULL; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz", &strkey, &strkey_len, &(args.step), &success) == FAILURE) { ++ return; ++ } ++ ++ if (success) { ++ zval_dtor(success); ++ } ++ ++ if(_apc_update(strkey, strkey_len, inc_updater, &args TSRMLS_CC)) { ++ if(success) ZVAL_TRUE(success); ++ RETURN_LONG(args.lval); ++ } ++ ++ if(success) ZVAL_FALSE(success); ++ ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto long apc_dec(string key [, long step [, bool &success]]) ++ */ ++PHP_FUNCTION(apc_dec) { ++ char *strkey; ++ int strkey_len; ++ struct _inc_update_args args = {1L, -1}; ++ zval *success = NULL; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz", &strkey, &strkey_len, &(args.step), &success) == FAILURE) { ++ return; ++ } ++ ++ if (success) { ++ zval_dtor(success); ++ } ++ ++ args.step = args.step * -1; ++ ++ if(_apc_update(strkey, strkey_len, inc_updater, &args TSRMLS_CC)) { ++ if(success) ZVAL_TRUE(success); ++ RETURN_LONG(args.lval); ++ } ++ ++ if(success) ZVAL_FALSE(success); ++ ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ cas_updater */ ++static int cas_updater(apc_cache_t* cache, apc_cache_entry_t* entry, void* data) { ++ long* vals = ((long*)data); ++ long old = vals[0]; ++ long new = vals[1]; ++ zval* val = entry->data.user.val; ++ ++ if(Z_TYPE_P(val) == IS_LONG) { ++ if(Z_LVAL_P(val) == old) { ++ Z_LVAL_P(val) = new; ++ return 1; ++ } ++ } ++ ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ proto int apc_cas(string key, int old, int new) ++ */ ++PHP_FUNCTION(apc_cas) { ++ char *strkey; ++ int strkey_len; ++ long vals[2]; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll", &strkey, &strkey_len, &vals[0], &vals[1]) == FAILURE) { ++ return; ++ } ++ ++ if(_apc_update(strkey, strkey_len, cas_updater, &vals TSRMLS_CC)) RETURN_TRUE; ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++void *apc_erealloc_wrapper(void *ptr, size_t size) { ++ return _erealloc(ptr, size, 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); ++} ++ ++/* {{{ proto mixed apc_fetch(mixed key[, bool &success]) ++ */ ++PHP_FUNCTION(apc_fetch) { ++ zval *key; ++ zval *success = NULL; ++ HashTable *hash; ++ HashPosition hpos; ++ zval **hentry; ++ zval *result; ++ zval *result_entry; ++ char *strkey; ++ int strkey_len; ++ apc_cache_entry_t* entry; ++ time_t t; ++ apc_context_t ctxt = {0,}; ++ ++ if(!APCG(enabled)) RETURN_FALSE; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &key, &success) == FAILURE) { ++ return; ++ } ++ ++ t = apc_time(); ++ ++ if (success) { ++ ZVAL_BOOL(success, 0); ++ } ++ ++ ctxt.pool = apc_pool_create(APC_UNPOOL, apc_php_malloc, apc_php_free, NULL, NULL TSRMLS_CC); ++ if (!ctxt.pool) { ++ apc_warning("Unable to allocate memory for pool." TSRMLS_CC); ++ RETURN_FALSE; ++ } ++ ctxt.copy = APC_COPY_OUT_USER; ++ ctxt.force_update = 0; ++ ++ if(Z_TYPE_P(key) != IS_STRING && Z_TYPE_P(key) != IS_ARRAY) { ++ convert_to_string(key); ++ } ++ ++ if(Z_TYPE_P(key) == IS_STRING) { ++ strkey = Z_STRVAL_P(key); ++ strkey_len = Z_STRLEN_P(key); ++ if(!strkey_len) RETURN_FALSE; ++ entry = apc_cache_user_find(apc_user_cache, strkey, (strkey_len + 1), t TSRMLS_CC); ++ if(entry) { ++ /* deep-copy returned shm zval to emalloc'ed return_value */ ++ apc_cache_fetch_zval(return_value, entry->data.user.val, &ctxt TSRMLS_CC); ++ apc_cache_release(apc_user_cache, entry TSRMLS_CC); ++ } else { ++ goto freepool; ++ } ++ } else if(Z_TYPE_P(key) == IS_ARRAY) { ++ hash = Z_ARRVAL_P(key); ++ MAKE_STD_ZVAL(result); ++ array_init(result); ++ zend_hash_internal_pointer_reset_ex(hash, &hpos); ++ while(zend_hash_get_current_data_ex(hash, (void**)&hentry, &hpos) == SUCCESS) { ++ if(Z_TYPE_PP(hentry) != IS_STRING) { ++ apc_warning("apc_fetch() expects a string or array of strings." TSRMLS_CC); ++ goto freepool; ++ } ++ entry = apc_cache_user_find(apc_user_cache, Z_STRVAL_PP(hentry), (Z_STRLEN_PP(hentry) + 1), t TSRMLS_CC); ++ if(entry) { ++ /* deep-copy returned shm zval to emalloc'ed return_value */ ++ MAKE_STD_ZVAL(result_entry); ++ apc_cache_fetch_zval(result_entry, entry->data.user.val, &ctxt TSRMLS_CC); ++ apc_cache_release(apc_user_cache, entry TSRMLS_CC); ++ zend_hash_add(Z_ARRVAL_P(result), Z_STRVAL_PP(hentry), Z_STRLEN_PP(hentry) +1, &result_entry, sizeof(zval*), NULL); ++ } /* don't set values we didn't find */ ++ zend_hash_move_forward_ex(hash, &hpos); ++ } ++ RETVAL_ZVAL(result, 0, 1); ++ } else { ++ apc_warning("apc_fetch() expects a string or array of strings." TSRMLS_CC); ++freepool: ++ apc_pool_destroy(ctxt.pool TSRMLS_CC); ++ RETURN_FALSE; ++ } ++ ++ if (success) { ++ ZVAL_BOOL(success, 1); ++ } ++ ++ apc_pool_destroy(ctxt.pool TSRMLS_CC); ++ return; ++} ++/* }}} */ ++ ++/* {{{ proto mixed apc_exists(mixed key) ++ */ ++PHP_FUNCTION(apc_exists) { ++ zval *key; ++ HashTable *hash; ++ HashPosition hpos; ++ zval **hentry; ++ char *strkey; ++ int strkey_len; ++ apc_cache_entry_t* entry; ++ zval *result; ++ zval *result_entry; ++ time_t t; ++ ++ if(!APCG(enabled)) RETURN_FALSE; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &key) == FAILURE) { ++ return; ++ } ++ ++ t = apc_time(); ++ ++ if(Z_TYPE_P(key) != IS_STRING && Z_TYPE_P(key) != IS_ARRAY) { ++ convert_to_string(key); ++ } ++ ++ if(Z_TYPE_P(key) == IS_STRING) { ++ strkey = Z_STRVAL_P(key); ++ strkey_len = Z_STRLEN_P(key); ++ if(!strkey_len) RETURN_FALSE; ++ entry = apc_cache_user_exists(apc_user_cache, strkey, strkey_len + 1, t TSRMLS_CC); ++ if(entry) { ++ RETURN_TRUE; ++ } ++ } else if(Z_TYPE_P(key) == IS_ARRAY) { ++ hash = Z_ARRVAL_P(key); ++ MAKE_STD_ZVAL(result); ++ array_init(result); ++ zend_hash_internal_pointer_reset_ex(hash, &hpos); ++ while(zend_hash_get_current_data_ex(hash, (void**)&hentry, &hpos) == SUCCESS) { ++ if(Z_TYPE_PP(hentry) != IS_STRING) { ++ apc_warning("apc_exists() expects a string or array of strings." TSRMLS_CC); ++ RETURN_FALSE; ++ } ++ ++ entry = apc_cache_user_exists(apc_user_cache, Z_STRVAL_PP(hentry), Z_STRLEN_PP(hentry) + 1, t TSRMLS_CC); ++ if(entry) { ++ MAKE_STD_ZVAL(result_entry); ++ ZVAL_BOOL(result_entry, 1); ++ zend_hash_add(Z_ARRVAL_P(result), Z_STRVAL_PP(hentry), Z_STRLEN_PP(hentry) +1, &result_entry, sizeof(zval*), NULL); ++ } /* don't set values we didn't find */ ++ zend_hash_move_forward_ex(hash, &hpos); ++ } ++ RETURN_ZVAL(result, 0, 1); ++ } else { ++ apc_warning("apc_exists() expects a string or array of strings." TSRMLS_CC); ++ } ++ ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++ ++/* {{{ proto mixed apc_delete(mixed keys) ++ */ ++PHP_FUNCTION(apc_delete) { ++ zval *keys; ++ ++ if(!APCG(enabled)) RETURN_FALSE; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &keys) == FAILURE) { ++ return; ++ } ++ ++ if (Z_TYPE_P(keys) == IS_STRING) { ++ if (!Z_STRLEN_P(keys)) RETURN_FALSE; ++ if(apc_cache_user_delete(apc_user_cache, Z_STRVAL_P(keys), (Z_STRLEN_P(keys) + 1) TSRMLS_CC)) { ++ RETURN_TRUE; ++ } else { ++ RETURN_FALSE; ++ } ++ } else if (Z_TYPE_P(keys) == IS_ARRAY) { ++ HashTable *hash = Z_ARRVAL_P(keys); ++ HashPosition hpos; ++ zval **hentry; ++ array_init(return_value); ++ zend_hash_internal_pointer_reset_ex(hash, &hpos); ++ while(zend_hash_get_current_data_ex(hash, (void**)&hentry, &hpos) == SUCCESS) { ++ if(Z_TYPE_PP(hentry) != IS_STRING) { ++ apc_warning("apc_delete() expects a string, array of strings, or APCIterator instance." TSRMLS_CC); ++ add_next_index_zval(return_value, *hentry); ++ Z_ADDREF_PP(hentry); ++ } else if(apc_cache_user_delete(apc_user_cache, Z_STRVAL_PP(hentry), (Z_STRLEN_PP(hentry) + 1) TSRMLS_CC) != 1) { ++ add_next_index_zval(return_value, *hentry); ++ Z_ADDREF_PP(hentry); ++ } ++ zend_hash_move_forward_ex(hash, &hpos); ++ } ++ return; ++ } else if (Z_TYPE_P(keys) == IS_OBJECT) { ++ if (apc_iterator_delete(keys TSRMLS_CC)) { ++ RETURN_TRUE; ++ } else { ++ RETURN_FALSE; ++ } ++ } else { ++ apc_warning("apc_delete() expects a string, array of strings, or APCIterator instance." TSRMLS_CC); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto mixed apc_delete_file(mixed keys) ++ * Deletes the given files from the opcode cache. ++ * Accepts a string, array of strings, or APCIterator object. ++ * Returns True/False, or for an Array an Array of failed files. ++ */ ++PHP_FUNCTION(apc_delete_file) { ++ zval *keys; ++ ++ if(!APCG(enabled)) RETURN_FALSE; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &keys) == FAILURE) { ++ return; ++ } ++ ++ if (Z_TYPE_P(keys) == IS_STRING) { ++ if (!Z_STRLEN_P(keys)) RETURN_FALSE; ++ if(apc_cache_delete(apc_cache, Z_STRVAL_P(keys), Z_STRLEN_P(keys) + 1 TSRMLS_CC) != 1) { ++ RETURN_FALSE; ++ } else { ++ RETURN_TRUE; ++ } ++ } else if (Z_TYPE_P(keys) == IS_ARRAY) { ++ HashTable *hash = Z_ARRVAL_P(keys); ++ HashPosition hpos; ++ zval **hentry; ++ array_init(return_value); ++ zend_hash_internal_pointer_reset_ex(hash, &hpos); ++ while(zend_hash_get_current_data_ex(hash, (void**)&hentry, &hpos) == SUCCESS) { ++ if(Z_TYPE_PP(hentry) != IS_STRING) { ++ apc_warning("apc_delete_file() expects a string, array of strings, or APCIterator instance." TSRMLS_CC); ++ add_next_index_zval(return_value, *hentry); ++ Z_ADDREF_PP(hentry); ++ } else if(apc_cache_delete(apc_cache, Z_STRVAL_PP(hentry), Z_STRLEN_PP(hentry) + 1 TSRMLS_CC) != 1) { ++ add_next_index_zval(return_value, *hentry); ++ Z_ADDREF_PP(hentry); ++ } ++ zend_hash_move_forward_ex(hash, &hpos); ++ } ++ return; ++ } else if (Z_TYPE_P(keys) == IS_OBJECT) { ++ if (apc_iterator_delete(keys TSRMLS_CC)) { ++ RETURN_TRUE; ++ } else { ++ RETURN_FALSE; ++ } ++ } else { ++ apc_warning("apc_delete_file() expects a string, array of strings, or APCIterator instance." TSRMLS_CC); ++ } ++} ++/* }}} */ ++ ++static void _apc_define_constants(zval *constants, zend_bool case_sensitive TSRMLS_DC) { ++ char *const_key; ++ unsigned int const_key_len; ++ zval **entry; ++ HashPosition pos; ++ ++ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(constants), &pos); ++ while (zend_hash_get_current_data_ex(Z_ARRVAL_P(constants), (void**)&entry, &pos) == SUCCESS) { ++ zend_constant c; ++ int key_type; ++ ulong num_key; ++ ++ key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(constants), &const_key, &const_key_len, &num_key, 0, &pos); ++ if(key_type != HASH_KEY_IS_STRING) { ++ zend_hash_move_forward_ex(Z_ARRVAL_P(constants), &pos); ++ continue; ++ } ++ switch(Z_TYPE_PP(entry)) { ++ case IS_LONG: ++ case IS_DOUBLE: ++ case IS_STRING: ++ case IS_BOOL: ++ case IS_RESOURCE: ++ case IS_NULL: ++ break; ++ default: ++ zend_hash_move_forward_ex(Z_ARRVAL_P(constants), &pos); ++ continue; ++ } ++ c.value = **entry; ++ zval_copy_ctor(&c.value); ++ c.flags = case_sensitive; ++ c.name = zend_strndup(const_key, const_key_len); ++ c.name_len = const_key_len; ++ c.module_number = PHP_USER_CONSTANT; ++ zend_register_constant(&c TSRMLS_CC); ++ ++ zend_hash_move_forward_ex(Z_ARRVAL_P(constants), &pos); ++ } ++} ++ ++/* {{{ proto mixed apc_define_constants(string key, array constants [, bool case_sensitive]) ++ */ ++PHP_FUNCTION(apc_define_constants) { ++ char *strkey; ++ int strkey_len; ++ zval *constants = NULL; ++ zend_bool case_sensitive = 1; ++ int argc = ZEND_NUM_ARGS(); ++ ++ if (zend_parse_parameters(argc TSRMLS_CC, "sa|b", &strkey, &strkey_len, &constants, &case_sensitive) == FAILURE) { ++ return; ++ } ++ ++ if(!strkey_len) RETURN_FALSE; ++ ++ _apc_define_constants(constants, case_sensitive TSRMLS_CC); ++ if(_apc_store(strkey, strkey_len + 1, constants, 0, 0 TSRMLS_CC)) RETURN_TRUE; ++ RETURN_FALSE; ++} /* }}} */ ++ ++/* {{{ proto mixed apc_load_constants(string key [, bool case_sensitive]) ++ */ ++PHP_FUNCTION(apc_load_constants) { ++ char *strkey; ++ int strkey_len; ++ apc_cache_entry_t* entry; ++ time_t t; ++ zend_bool case_sensitive = 1; ++ ++ if(!APCG(enabled)) RETURN_FALSE; ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &strkey, &strkey_len, &case_sensitive) == FAILURE) { ++ return; ++ } ++ ++ if(!strkey_len) RETURN_FALSE; ++ ++ t = apc_time(); ++ ++ entry = apc_cache_user_find(apc_user_cache, strkey, (strkey_len + 1), t TSRMLS_CC); ++ ++ if(entry) { ++ _apc_define_constants(entry->data.user.val, case_sensitive TSRMLS_CC); ++ apc_cache_release(apc_user_cache, entry TSRMLS_CC); ++ RETURN_TRUE; ++ } else { ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto mixed apc_compile_file(mixed filenames [, bool atomic]) ++ */ ++PHP_FUNCTION(apc_compile_file) { ++ zval *file; ++ zend_file_handle file_handle; ++ zend_op_array *op_array; ++ char** filters = NULL; ++ zend_bool cache_by_default = 1; ++ HashTable cg_function_table, cg_class_table; ++ HashTable *cg_orig_function_table, *cg_orig_class_table, *eg_orig_function_table, *eg_orig_class_table; ++ apc_cache_entry_t** cache_entries; ++ apc_cache_key_t* keys; ++ zend_op_array **op_arrays; ++ time_t t; ++ zval **hentry; ++ HashPosition hpos; ++ int i=0, c=0; ++ int *rval=NULL; ++ int count=0; ++ zend_bool atomic=1; ++ apc_context_t ctxt = {0,}; ++ zend_execute_data *orig_current_execute_data; ++ int atomic_fail; ++ ++ if(!APCG(enabled)) RETURN_FALSE; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &file, &atomic) == FAILURE) { ++ return; ++ } ++ ++ if (Z_TYPE_P(file) != IS_ARRAY && Z_TYPE_P(file) != IS_STRING) { ++ apc_warning("apc_compile_file argument must be a string or an array of strings" TSRMLS_CC); ++ RETURN_FALSE; ++ } ++ ++ HANDLE_BLOCK_INTERRUPTIONS(); ++ APCG(current_cache) = apc_cache; ++ ++ /* reset filters and cache_by_default */ ++ filters = APCG(filters); ++ APCG(filters) = NULL; ++ ++ cache_by_default = APCG(cache_by_default); ++ APCG(cache_by_default) = 1; ++ ++ /* Replace function/class tables to avoid namespace conflicts */ ++ zend_hash_init_ex(&cg_function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0); ++ cg_orig_function_table = CG(function_table); ++ CG(function_table) = &cg_function_table; ++ zend_hash_init_ex(&cg_class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0); ++ cg_orig_class_table = CG(class_table); ++ CG(class_table) = &cg_class_table; ++ eg_orig_function_table = EG(function_table); ++ EG(function_table) = CG(function_table); ++ eg_orig_class_table = EG(class_table); ++ EG(class_table) = CG(class_table); ++ APCG(force_file_update) = 1; ++ ++ /* Compile the file(s), loading it into the cache */ ++ if (Z_TYPE_P(file) == IS_STRING) { ++ file_handle.type = ZEND_HANDLE_FILENAME; ++ file_handle.filename = Z_STRVAL_P(file); ++ file_handle.free_filename = 0; ++ file_handle.opened_path = NULL; ++ ++ orig_current_execute_data = EG(current_execute_data); ++ zend_try { ++ op_array = zend_compile_file(&file_handle, ZEND_INCLUDE TSRMLS_CC); ++ } zend_catch { ++ EG(current_execute_data) = orig_current_execute_data; ++ EG(in_execution) = 1; ++ CG(unclean_shutdown) = 0; ++ apc_warning("Error compiling %s in apc_compile_file." TSRMLS_CC, file_handle.filename); ++ op_array = NULL; ++ } zend_end_try(); ++ if(op_array != NULL) { ++ /* Free up everything */ ++ destroy_op_array(op_array TSRMLS_CC); ++ efree(op_array); ++ RETVAL_TRUE; ++ } else { ++ RETVAL_FALSE; ++ } ++ zend_destroy_file_handle(&file_handle TSRMLS_CC); ++ ++ } else { /* IS_ARRAY */ ++ ++ array_init(return_value); ++ ++ t = apc_time(); ++ ++ op_arrays = ecalloc(Z_ARRVAL_P(file)->nNumOfElements, sizeof(zend_op_array*)); ++ cache_entries = ecalloc(Z_ARRVAL_P(file)->nNumOfElements, sizeof(apc_cache_entry_t*)); ++ keys = ecalloc(Z_ARRVAL_P(file)->nNumOfElements, sizeof(apc_cache_key_t)); ++ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(file), &hpos); ++ while(zend_hash_get_current_data_ex(Z_ARRVAL_P(file), (void**)&hentry, &hpos) == SUCCESS) { ++ if (Z_TYPE_PP(hentry) != IS_STRING) { ++ apc_warning("apc_compile_file array values must be strings, aborting." TSRMLS_CC); ++ break; ++ } ++ file_handle.type = ZEND_HANDLE_FILENAME; ++ file_handle.filename = Z_STRVAL_PP(hentry); ++ file_handle.free_filename = 0; ++ file_handle.opened_path = NULL; ++ ++ if (!apc_cache_make_file_key(&(keys[i]), file_handle.filename, PG(include_path), t TSRMLS_CC)) { ++ add_assoc_long(return_value, Z_STRVAL_PP(hentry), -1); /* -1: compilation error */ ++ apc_warning("Error compiling %s in apc_compile_file." TSRMLS_CC, file_handle.filename); ++ break; ++ } ++ ++ if (keys[i].type == APC_CACHE_KEY_FPFILE) { ++ keys[i].data.fpfile.fullpath = estrndup(keys[i].data.fpfile.fullpath, keys[i].data.fpfile.fullpath_len); ++ } else if (keys[i].type == APC_CACHE_KEY_USER) { ++ keys[i].data.user.identifier = estrndup(keys[i].data.user.identifier, keys[i].data.user.identifier_len); ++ } ++ ++ orig_current_execute_data = EG(current_execute_data); ++ zend_try { ++ if (apc_compile_cache_entry(&keys[i], &file_handle, ZEND_INCLUDE, t, &op_arrays[i], &cache_entries[i] TSRMLS_CC) != SUCCESS) { ++ op_arrays[i] = NULL; ++ cache_entries[i] = NULL; ++ add_assoc_long(return_value, Z_STRVAL_PP(hentry), -2); /* -2: input or cache insertion error */ ++ apc_warning("Error compiling %s in apc_compile_file." TSRMLS_CC, file_handle.filename); ++ } ++ } zend_catch { ++ EG(current_execute_data) = orig_current_execute_data; ++ EG(in_execution) = 1; ++ CG(unclean_shutdown) = 0; ++ op_arrays[i] = NULL; ++ cache_entries[i] = NULL; ++ add_assoc_long(return_value, Z_STRVAL_PP(hentry), -1); /* -1: compilation error */ ++ apc_warning("Error compiling %s in apc_compile_file." TSRMLS_CC, file_handle.filename); ++ } zend_end_try(); ++ ++ zend_destroy_file_handle(&file_handle TSRMLS_CC); ++ if(op_arrays[i] != NULL) { ++ count++; ++ } ++ ++ /* clean out the function/class tables */ ++ zend_hash_clean(&cg_function_table); ++ zend_hash_clean(&cg_class_table); ++ ++ zend_hash_move_forward_ex(Z_ARRVAL_P(file), &hpos); ++ i++; ++ } ++ ++ /* atomically update the cache if no errors or not atomic */ ++ ctxt.copy = APC_COPY_IN_OPCODE; ++ ctxt.force_update = 1; ++ if (count == i || !atomic) { ++ rval = apc_cache_insert_mult(apc_cache, keys, cache_entries, &ctxt, t, i TSRMLS_CC); ++ atomic_fail = 0; ++ } else { ++ atomic_fail = 1; ++ } ++ ++ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(file), &hpos); ++ for(c=0; c < i; c++) { ++ zend_hash_get_current_data_ex(Z_ARRVAL_P(file), (void**)&hentry, &hpos); ++ if (rval && rval[c] != 1) { ++ add_assoc_long(return_value, Z_STRVAL_PP(hentry), -2); /* -2: input or cache insertion error */ ++ if (cache_entries[c]) { ++ apc_pool_destroy(cache_entries[c]->pool TSRMLS_CC); ++ } ++ } ++ if (op_arrays[c]) { ++ destroy_op_array(op_arrays[c] TSRMLS_CC); ++ efree(op_arrays[c]); ++ } ++ if (atomic_fail && cache_entries[c]) { ++ apc_pool_destroy(cache_entries[c]->pool TSRMLS_CC); ++ } ++ if (keys[c].type == APC_CACHE_KEY_FPFILE) { ++ efree((void*)keys[c].data.fpfile.fullpath); ++ } else if (keys[c].type == APC_CACHE_KEY_USER) { ++ efree((void*)keys[c].data.user.identifier); ++ } ++ zend_hash_move_forward_ex(Z_ARRVAL_P(file), &hpos); ++ } ++ efree(op_arrays); ++ efree(keys); ++ efree(cache_entries); ++ if (rval) { ++ efree(rval); ++ } ++ ++ } ++ ++ /* Return class/function tables to previous states, destroy temp tables */ ++ APCG(force_file_update) = 0; ++ CG(function_table) = cg_orig_function_table; ++ zend_hash_destroy(&cg_function_table); ++ CG(class_table) = cg_orig_class_table; ++ zend_hash_destroy(&cg_class_table); ++ EG(function_table) = eg_orig_function_table; ++ EG(class_table) = eg_orig_class_table; ++ ++ /* Restore global settings */ ++ APCG(filters) = filters; ++ APCG(cache_by_default) = cache_by_default; ++ ++ APCG(current_cache) = NULL; ++ HANDLE_UNBLOCK_INTERRUPTIONS(); ++ ++} ++/* }}} */ ++ ++/* {{{ proto mixed apc_bin_dump([array files [, array user_vars]]) ++ Returns a binary dump of the given files and user variables from the APC cache. ++ A NULL for files or user_vars signals a dump of every entry, while array() will dump nothing. ++ */ ++PHP_FUNCTION(apc_bin_dump) { ++ ++ zval *z_files = NULL, *z_user_vars = NULL; ++ HashTable *h_files, *h_user_vars; ++ apc_bd_t *bd; ++ ++ if(!APCG(enabled)) { ++ apc_warning("APC is not enabled, apc_bin_dump not available." TSRMLS_CC); ++ RETURN_FALSE; ++ } ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!a!", &z_files, &z_user_vars) == FAILURE) { ++ return; ++ } ++ ++ h_files = z_files ? Z_ARRVAL_P(z_files) : NULL; ++ h_user_vars = z_user_vars ? Z_ARRVAL_P(z_user_vars) : NULL; ++ bd = apc_bin_dump(h_files, h_user_vars TSRMLS_CC); ++ if(bd) { ++ RETVAL_STRINGL((char*)bd, bd->size-1, 0); ++ } else { ++ apc_error("Unknown error encountered during apc_bin_dump." TSRMLS_CC); ++ RETVAL_NULL(); ++ } ++ ++ return; ++} ++ ++/* {{{ proto mixed apc_bin_dumpfile(array files, array user_vars, string filename, [int flags [, resource context]]) ++ Output a binary dump of the given files and user variables from the APC cache to the named file. ++ */ ++PHP_FUNCTION(apc_bin_dumpfile) { ++ ++ zval *z_files = NULL, *z_user_vars = NULL; ++ HashTable *h_files, *h_user_vars; ++ char *filename = NULL; ++ int filename_len; ++ long flags=0; ++ zval *zcontext = NULL; ++ php_stream_context *context = NULL; ++ php_stream *stream; ++ int numbytes = 0; ++ apc_bd_t *bd; ++ ++ if(!APCG(enabled)) { ++ apc_warning("APC is not enabled, apc_bin_dumpfile not available." TSRMLS_CC); ++ RETURN_FALSE; ++ } ++ ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!s|lr!", &z_files, &z_user_vars, &filename, &filename_len, &flags, &zcontext) == FAILURE) { ++ return; ++ } ++ ++ if(!filename_len) { ++ apc_error("apc_bin_dumpfile filename argument must be a valid filename." TSRMLS_CC); ++ RETURN_FALSE; ++ } ++ ++ h_files = z_files ? Z_ARRVAL_P(z_files) : NULL; ++ h_user_vars = z_user_vars ? Z_ARRVAL_P(z_user_vars) : NULL; ++ bd = apc_bin_dump(h_files, h_user_vars TSRMLS_CC); ++ if(!bd) { ++ apc_error("Unknown error encountered during apc_bin_dumpfile." TSRMLS_CC); ++ RETURN_FALSE; ++ } ++ ++ ++ /* Most of the following has been taken from the file_get/put_contents functions */ ++ ++ context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT); ++ stream = php_stream_open_wrapper_ex(filename, (flags & PHP_FILE_APPEND) ? "ab" : "wb", ++ ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context); ++ if (stream == NULL) { ++ efree(bd); ++ apc_error("Unable to write to file in apc_bin_dumpfile." TSRMLS_CC); ++ RETURN_FALSE; ++ } ++ ++ if (flags & LOCK_EX && php_stream_lock(stream, LOCK_EX)) { ++ php_stream_close(stream); ++ efree(bd); ++ apc_error("Unable to get a lock on file in apc_bin_dumpfile." TSRMLS_CC); ++ RETURN_FALSE; ++ } ++ ++ numbytes = php_stream_write(stream, (char*)bd, bd->size); ++ if(numbytes != bd->size) { ++ numbytes = -1; ++ } ++ ++ php_stream_close(stream); ++ efree(bd); ++ ++ if(numbytes < 0) { ++ apc_error("Only %d of %d bytes written, possibly out of free disk space" TSRMLS_CC, numbytes, bd->size); ++ RETURN_FALSE; ++ } ++ ++ RETURN_LONG(numbytes); ++} ++ ++/* {{{ proto mixed apc_bin_load(string data, [int flags]) ++ Load the given binary dump into the APC file/user cache. ++ */ ++PHP_FUNCTION(apc_bin_load) { ++ ++ int data_len; ++ char *data; ++ long flags = 0; ++ ++ if(!APCG(enabled)) { ++ apc_warning("APC is not enabled, apc_bin_load not available." TSRMLS_CC); ++ RETURN_FALSE; ++ } ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &flags) == FAILURE) { ++ return; ++ } ++ ++ if(!data_len || data_len != ((apc_bd_t*)data)->size -1) { ++ apc_error("apc_bin_load string argument does not appear to be a valid APC binary dump due to size (%d vs expected %d)." TSRMLS_CC, data_len, ((apc_bd_t*)data)->size -1); ++ RETURN_FALSE; ++ } ++ ++ apc_bin_load((apc_bd_t*)data, (int)flags TSRMLS_CC); ++ ++ RETURN_TRUE; ++} ++ ++/* {{{ proto mixed apc_bin_loadfile(string filename, [resource context, [int flags]]) ++ Load the given binary dump from the named file into the APC file/user cache. ++ */ ++PHP_FUNCTION(apc_bin_loadfile) { ++ ++ char *filename; ++ int filename_len; ++ zval *zcontext = NULL; ++ long flags; ++ php_stream_context *context = NULL; ++ php_stream *stream; ++ char *data; ++ int len; ++ ++ if(!APCG(enabled)) { ++ apc_warning("APC is not enabled, apc_bin_loadfile not available." TSRMLS_CC); ++ RETURN_FALSE; ++ } ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r!l", &filename, &filename_len, &zcontext, &flags) == FAILURE) { ++ return; ++ } ++ ++ if(!filename_len) { ++ apc_error("apc_bin_loadfile filename argument must be a valid filename." TSRMLS_CC); ++ RETURN_FALSE; ++ } ++ ++ context = php_stream_context_from_zval(zcontext, 0); ++ stream = php_stream_open_wrapper_ex(filename, "rb", ++ ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context); ++ if (!stream) { ++ apc_error("Unable to read from file in apc_bin_loadfile." TSRMLS_CC); ++ RETURN_FALSE; ++ } ++ ++ len = php_stream_copy_to_mem(stream, &data, PHP_STREAM_COPY_ALL, 0); ++ if(len == 0) { ++ apc_warning("File passed to apc_bin_loadfile was empty: %s." TSRMLS_CC, filename); ++ RETURN_FALSE; ++ } else if(len < 0) { ++ apc_warning("Error reading file passed to apc_bin_loadfile: %s." TSRMLS_CC, filename); ++ RETURN_FALSE; ++ } else if(len != ((apc_bd_t*)data)->size) { ++ apc_warning("file passed to apc_bin_loadfile does not appear to be valid due to size (%d vs expected %d)." TSRMLS_CC, len, ((apc_bd_t*)data)->size -1); ++ RETURN_FALSE; ++ } ++ php_stream_close(stream); ++ ++ apc_bin_load((apc_bd_t*)data, (int)flags TSRMLS_CC); ++ efree(data); ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ arginfo */ ++#if (PHP_MAJOR_VERSION >= 6 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3)) ++# define PHP_APC_ARGINFO ++#else ++# define PHP_APC_ARGINFO static ++#endif ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_store, 0, 0, 2) ++ ZEND_ARG_INFO(0, key) ++ ZEND_ARG_INFO(0, var) ++ ZEND_ARG_INFO(0, ttl) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_clear_cache, 0, 0, 0) ++ ZEND_ARG_INFO(0, info) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_sma_info, 0, 0, 0) ++ ZEND_ARG_INFO(0, limited) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_cache_info, 0, 0, 0) ++ ZEND_ARG_INFO(0, type) ++ ZEND_ARG_INFO(0, limited) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_define_constants, 0, 0, 2) ++ ZEND_ARG_INFO(0, key) ++ ZEND_ARG_INFO(0, constants) ++ ZEND_ARG_INFO(0, case_sensitive) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO(arginfo_apc_delete_file, 0) ++ ZEND_ARG_INFO(0, keys) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO(arginfo_apc_delete, 0) ++ ZEND_ARG_INFO(0, keys) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_fetch, 0, 0, 1) ++ ZEND_ARG_INFO(0, key) ++ ZEND_ARG_INFO(1, success) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_inc, 0, 0, 1) ++ ZEND_ARG_INFO(0, key) ++ ZEND_ARG_INFO(0, step) ++ ZEND_ARG_INFO(1, success) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO(arginfo_apc_cas, 0) ++ ZEND_ARG_INFO(0, key) ++ ZEND_ARG_INFO(0, old) ++ ZEND_ARG_INFO(0, new) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_load_constants, 0, 0, 1) ++ ZEND_ARG_INFO(0, key) ++ ZEND_ARG_INFO(0, case_sensitive) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_compile_file, 0, 0, 1) ++ ZEND_ARG_INFO(0, filenames) ++ ZEND_ARG_INFO(0, atomic) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_bin_dump, 0, 0, 0) ++ ZEND_ARG_INFO(0, files) ++ ZEND_ARG_INFO(0, user_vars) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_bin_dumpfile, 0, 0, 3) ++ ZEND_ARG_INFO(0, files) ++ ZEND_ARG_INFO(0, user_vars) ++ ZEND_ARG_INFO(0, filename) ++ ZEND_ARG_INFO(0, flags) ++ ZEND_ARG_INFO(0, context) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_bin_load, 0, 0, 1) ++ ZEND_ARG_INFO(0, data) ++ ZEND_ARG_INFO(0, flags) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_bin_loadfile, 0, 0, 1) ++ ZEND_ARG_INFO(0, filename) ++ ZEND_ARG_INFO(0, context) ++ ZEND_ARG_INFO(0, flags) ++ZEND_END_ARG_INFO() ++ ++PHP_APC_ARGINFO ++ZEND_BEGIN_ARG_INFO(arginfo_apc_exists, 0) ++ ZEND_ARG_INFO(0, keys) ++ZEND_END_ARG_INFO() ++/* }}} */ ++ ++/* {{{ apc_functions[] */ ++zend_function_entry apc_functions[] = { ++ PHP_FE(apc_cache_info, arginfo_apc_cache_info) ++ PHP_FE(apc_clear_cache, arginfo_apc_clear_cache) ++ PHP_FE(apc_sma_info, arginfo_apc_sma_info) ++ PHP_FE(apc_store, arginfo_apc_store) ++ PHP_FE(apc_fetch, arginfo_apc_fetch) ++ PHP_FE(apc_delete, arginfo_apc_delete) ++ PHP_FE(apc_delete_file, arginfo_apc_delete_file) ++ PHP_FE(apc_define_constants, arginfo_apc_define_constants) ++ PHP_FE(apc_load_constants, arginfo_apc_load_constants) ++ PHP_FE(apc_compile_file, arginfo_apc_compile_file) ++ PHP_FE(apc_add, arginfo_apc_store) ++ PHP_FE(apc_inc, arginfo_apc_inc) ++ PHP_FE(apc_dec, arginfo_apc_inc) ++ PHP_FE(apc_cas, arginfo_apc_cas) ++ PHP_FE(apc_bin_dump, arginfo_apc_bin_dump) ++ PHP_FE(apc_bin_load, arginfo_apc_bin_load) ++ PHP_FE(apc_bin_dumpfile, arginfo_apc_bin_dumpfile) ++ PHP_FE(apc_bin_loadfile, arginfo_apc_bin_loadfile) ++ PHP_FE(apc_exists, arginfo_apc_exists) ++ {NULL, NULL, NULL} ++}; ++/* }}} */ ++ ++/* {{{ module definition structure */ ++ ++zend_module_entry apc_module_entry = { ++ STANDARD_MODULE_HEADER, ++ "apc", ++ apc_functions, ++ PHP_MINIT(apc), ++ PHP_MSHUTDOWN(apc), ++ PHP_RINIT(apc), ++ PHP_RSHUTDOWN(apc), ++ PHP_MINFO(apc), ++ PHP_APC_VERSION, ++ STANDARD_MODULE_PROPERTIES ++}; ++ ++#ifdef COMPILE_DL_APC ++ZEND_GET_MODULE(apc) ++#endif ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/php_apc.h b/ext/apc/php_apc.h +--- a/ext/apc/php_apc.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/php_apc.h 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,54 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | APC | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 2006-2011 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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. | ++ +----------------------------------------------------------------------+ ++ | Authors: Daniel Cowgill | ++ | George Schlossnagle | ++ | Rasmus Lerdorf | ++ +----------------------------------------------------------------------+ ++ ++ This software was contributed to PHP by Community Connect Inc. in 2002 ++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. ++ Future revisions and derivatives of this source code must acknowledge ++ Community Connect Inc. as the original contributor of this module by ++ leaving this note intact in the source code. ++ ++ All other licensing and usage conditions are those of the PHP Group. ++ ++ */ ++ ++/* $Id: php_apc.h 326713 2012-07-19 22:07:31Z rasmus $ */ ++ ++#ifndef PHP_APC_H ++#define PHP_APC_H ++ ++#include "apc_php.h" ++#include "apc_globals.h" ++ ++#define PHP_APC_VERSION "3.1.11" ++ ++extern zend_module_entry apc_module_entry; ++#define apc_module_ptr &apc_module_entry ++ ++#define phpext_apc_ptr apc_module_ptr ++ ++#endif /* PHP_APC_H */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker ++ * vim<600: expandtab sw=4 ts=4 sts=4 ++ */ +diff -Naur a/ext/apc/TECHNOTES.txt b/ext/apc/TECHNOTES.txt +--- a/ext/apc/TECHNOTES.txt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/TECHNOTES.txt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,361 @@ ++APC Quick-Start Braindump ++ ++This is a rapidly written braindump of how APC currently works in the ++form of a quick-start guide to start hacking on APC. ++ ++1. Install and use APC a bit so you know what it does from the end-user's ++ perspective. ++ user-space functions are all explained here: ++ ++2. Grab the current APC code from CVS: ++ ++ cvs -d:pserver:cvsread@cvs.php.net:/repository login ++ Password: phpfi ++ cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/apc ++ ++ apc/php_apc.c has most of the code for the user-visible stuff. It is ++ also a regular PHP extension in the sense that there are MINIT, MINFO, ++ MSHUTDOWN, RSHUTDOWN, etc. functions. ++ ++3. Build it. ++ ++ cd pecl/apc ++ phpize ++ ./configure --enable-apc --enable-mmap ++ make ++ cp modules/apc.so /usr/local/lib/php ++ apachectl restart ++ ++4. Debugging Hints ++ ++ apachectl stop ++ gdb /usr/bin/httpd ++ break ?? ++ run -X ++ ++ Grab the .gdbinit from the PHP source tree and have a look at the macros. ++ ++5. Look through apc/apc_sma.c ++ It is a pretty standard memory allocator. ++ ++ apc_sma_malloc, apc_sma_realloc, apc_sma_strdup and apc_sma_free behave to the ++ caller just like malloc, realloc, strdup and free ++ ++ On server startup the MINIT hook in php_apc.c calls apc_module_init() in ++ apc_main.c which in turn calls apc_sma_init(). apc_sma_init calls into ++ apc_mmap.c to mmap the specified sized segment (I tend to just use a single ++ segment). apc_mmap.c should be self-explanatory. It mmaps a temp file and ++ then unlinks that file right after the mmap to provide automatic shared memory ++ cleanup in case the process dies. ++ ++ Once the region has been initialized we stick a header_t at the beginning ++ of the region. It contains the total size in header->segsize and the number ++ of bytes available in header->avail. ++ ++ After the header comes a bit of a hack. A zero-sized block is inserted just ++ to make things easier later on. And then a huge block that is basically ++ the size of the entire segment minus the two (for the 0-sized block, and this one) ++ block headers. ++ ++ The code for this is: ++ ++ header = (header_t*) shmaddr; ++ header->segsize = sma_segsize; ++ header->avail = sma_segsize - sizeof(header_t) - sizeof(block_t) - alignword(sizeof(int)); ++ memset(&header->lock,0,sizeof(header->lock)); ++ sma_lock = &header->lock; ++ block = BLOCKAT(sizeof(header_t)); ++ block->size = 0; ++ block->next = sizeof(header_t) + sizeof(block_t); ++ block = BLOCKAT(block->next); ++ block->size = header->avail; ++ block->next = 0; ++ ++ So the shared memory looks like this: ++ ++ +--------+-------+---------------------------------+ ++ | header | block | block | ++ +--------+-------+---------------------------------+ ++ ++ sma_shmaddrs[0] gives you the address of header ++ ++ The blocks are just a simple offset-based linked list (so no pointers): ++ ++ typedef struct block_t block_t; ++ struct block_t { ++ size_t size; /* size of this block */ ++ size_t next; /* offset in segment of next free block */ ++ size_t canary; /* canary to check for memory overwrites */ ++#ifdef __APC_SMA_DEBUG__ ++ int id; /* identifier for the memory block */ ++#endif ++ }; ++ ++ The BLOCKAT macro turns an offset into an actual address for you: ++ ++ #define BLOCKAT(offset) ((block_t*)((char *)shmaddr + offset)) ++ ++ where shmaddr = sma_shaddrs[0] ++ ++ And the OFFSET macro goes the other way: ++ ++ #define OFFSET(block) ((int)(((char*)block) - (char*)shmaddr)) ++ ++ Allocating a block with a call to apc_sma_allocate() walks through the ++ linked list of blocks until it finds one that is >= to the requested size. ++ The first call to apc_sma_allocate() will hit the second block. We then ++ chop up that block so it looks like this: ++ ++ +--------+-------+-------+-------------------------+ ++ | header | block | block | block | ++ +--------+-------+-------+-------------------------+ ++ ++ Then we unlink that block from the linked list so it won't show up ++ as an available block on the next allocate. So we actually have: ++ ++ +--------+-------+ +-------------------------+ ++ | header | block |------>| block | ++ +--------+-------+ +-------------------------+ ++ ++ And header->avail along with block->size of the remaining large ++ block are updated accordingly. The arrow there representing the ++ link which now points to a block with an offset further along in ++ the segment. ++ ++ When the block is freed using apc_sma_deallocate() the steps are ++ basically just reversed. The block is put back and then the deallocate ++ code looks at the block before and after to see if the block immediately ++ before and after are free and if so the blocks are combined. So you never ++ have 2 free blocks next to each other, apart from at the front with that ++ 0-sized dummy block. This mostly prevents fragmentation. I have been ++ toying with the idea of always allocating block at 2^n boundaries to make ++ it more likely that they will be re-used to cut down on fragmentation further. ++ That's what the POWER_OF_TWO_BLOCKSIZE you see in apc_sma.c is all about. ++ ++ Of course, anytime we fiddle with our shared memory segment we lock using ++ the locking macros, LOCK() and UNLOCK(). ++ ++ That should mostly take care of the low-level shared memory handling. ++ ++6. Next up is apc_main.c and apc_cache.c which implement the meat of the ++ cache logic. ++ ++ The apc_main.c file mostly calls functions in apc_sma.c to allocate memory ++ and apc_cache.c for actual cache manipulation. ++ ++ After the shared memory segment is created and the caches are initialized, ++ apc_module_init() installs the my_compile_file() function overriding Zend's ++ version. I'll talk about my_compile_file() and the rest of apc_compile.c ++ in the next section. For now I will stick with apc_main.c and apc_cache.c ++ and talk about the actual caches. A cache consists of a block of shared ++ memory returned by apc_sma_allocate() via apc_sma_malloc(). You will ++ notice references to apc_emalloc(). apc_emalloc() is just a thin wrapper ++ around PHP's own emalloc() function which allocates per-process memory from ++ PHP's pool-based memory allocator. Don't confuse apc_emalloc() and ++ apc_sma_malloc() as the first is per-process and the second is shared memory. ++ ++ The cache is stored in/described by this struct allocated locally using ++ emalloc(): ++ ++ struct apc_cache_t { ++ void* shmaddr; /* process (local) address of shared cache */ ++ header_t* header; /* cache header (stored in SHM) */ ++ slot_t** slots; /* array of cache slots (stored in SHM) */ ++ int num_slots; /* number of slots in cache */ ++ int gc_ttl; /* maximum time on GC list for a slot */ ++ int ttl; /* if slot is needed and entry's access time is older than this ttl, remove it */ ++ }; ++ ++ Whenever you see functions that take a 'cache' argument, this is what they ++ take. And apc_cache_create() returns a pointer to this populated struct. ++ ++ At the beginning of the cache we have a header. Remember, we are down a level now ++ from the sma stuff. The sma stuff is the low-level shared-memory allocator which ++ has its own header which is completely separate and invisible to apc_cache.c. ++ As far as apc_cache.c is concerned the block of memory it is working with could ++ have come from a call to malloc(). ++ ++ The header looks like this: ++ ++ typedef struct header_t header_t; ++ struct header_t { ++ int num_hits; /* total successful hits in cache */ ++ int num_misses; /* total unsuccessful hits in cache */ ++ slot_t* deleted_list; /* linked list of to-be-deleted slots */ ++ }; ++ ++ Since this is at the start of the shared memory segment, these values are accessible ++ across all the apache processes and hence access to them has to be locked. ++ ++ After the header we have an array of slots. The number of slots is user-defined ++ through the apc.num_slots ini hint. Each slot is described by: ++ ++ typedef struct slot_t slot_t; ++ struct slot_t { ++ apc_cache_key_t key; /* slot key */ ++ apc_cache_entry_t* value; /* slot value */ ++ slot_t* next; /* next slot in linked list */ ++ int num_hits; /* number of hits to this bucket */ ++ time_t creation_time; /* time slot was initialized */ ++ time_t deletion_time; /* time slot was removed from cache */ ++ time_t access_time; /* time slot was last accessed */ ++ }; ++ ++ The slot_t *next there is a linked list to other slots that happened to hash to the ++ same array position. ++ ++ apc_cache_insert() shows what happens on a new cache insert. ++ ++ slot = &cache->slots[hash(key) % cache->num_slots]; ++ ++ cache->slots is our array of slots in the segment. hash() is simply: ++ ++ static unsigned int hash(apc_cache_key_t key) ++ { ++ return key.data.file.device + key.data.file.inode; ++ } ++ ++ That is, we use the file's device and inode to uniquely identify it. Initially ++ we had used the file's full path, but getting that requires a realpath() call which ++ is amazingly expensive since it has to stat each component of the path to resolve ++ symlinks and get rid of relative path components. By using the device+inode we ++ can uniquely identify a file with a single stat. ++ ++ So, on an insert we find the array position in the slots array by hashing the device+inode. ++ If there are currently no other slots there, we just create the slot and stick it into ++ the array: ++ ++ *slot = make_slot(key, value, *slot, t) ++ ++ If there are other slots already at this position we walk the link list to get to ++ the end. Here is the loop: ++ ++ while (*slot) { ++ if (key_equals((*slot)->key.data.file, key.data.file)) { ++ /* If existing slot for the same device+inode is different, remove it and insert the new version */ ++ if ((*slot)->key.mtime != key.mtime) { ++ remove_slot(cache, slot); ++ break; ++ } ++ UNLOCK(cache); ++ return 0; ++ } else if(cache->ttl && (*slot)->access_time < (t - cache->ttl)) { ++ remove_slot(cache, slot); ++ continue; ++ } ++ slot = &(*slot)->next; ++ } ++ ++ That first key_equals() check sees if we have an exact match meaning the file ++ is already in the cache. Since we try to find the file in the cache before doing ++ an insert, this will generally only happen if another process managed to beat us ++ to inserting it. If we have a newer version of the file at this point we remove ++ it an insert the new version. If our version is not newer we just return without ++ doing anything. ++ ++ While walking the linked list we also check to see if the cache has a TTL defined. ++ If while walking the linked list we see a slot that has expired, we remove it ++ since we are right there looking at it. This is the only place we remove stale ++ entries unless the shared memory segment fills up and we force a full expunge via ++ apc_cache_expunge(). apc_cache_expunge() walks the entire slots array and walks ++ down every linked list removing stale slots to free up room. This is obviously ++ slow and thus only happens when we have run out of room. ++ ++ apc_cache_find() simply hashes and returns the entry if it is there. If it is there ++ but older than the mtime in the entry we are looking for, we delete the one that is ++ there and return indicating we didn't find it. ++ ++ Next we need to understand what an actual cache entry looks like. Have a look at ++ apc_cache.h for the structs. I sort of glossed over the key part earlier saying ++ that we just used the device+inode to find a hash slot. It is actually a bit more ++ complex than that because we have two kinds of caches. We have the standard file ++ cache containing opcode arrays, but we also have a user-controlled cache that the ++ user can insert whatever they want into via apc_store(). For the user cache we ++ obviously don't have a device+inode. The actual identifier is provided by the user ++ as a char *. So the key is actually a union that looks like this: ++ ++ typedef union _apc_cache_key_data_t { ++ struct { ++ int device; /* the filesystem device */ ++ int inode; /* the filesystem inode */ ++ } file; ++ struct { ++ char *identifier; ++ } user; ++ } apc_cache_key_data_t; ++ ++ struct apc_cache_key_t { ++ apc_cache_key_data_t data; ++ int mtime; /* the mtime of this cached entry */ ++ }; ++ ++ And we have two sets of functions to do inserts and finds. apc_cache_user_find() ++ and apc_cache_user_insert() operate on the user cache. ++ ++ Ok, on to the actual cache entry. Again, because we have two kinds of caches, we ++ also have the corresponding two kinds of cache entries described by this union: ++ ++ typedef union _apc_cache_entry_value_t { ++ struct { ++ char *filename; /* absolute path to source file */ ++ zend_op_array* op_array; /* op_array allocated in shared memory */ ++ apc_function_t* functions; /* array of apc_function_t's */ ++ apc_class_t* classes; /* array of apc_class_t's */ ++ } file; ++ struct { ++ char *info; ++ zval *val; ++ unsigned int ttl; ++ } user; ++ } apc_cache_entry_value_t; ++ ++ And then the actual cache entry: ++ ++ struct apc_cache_entry_t { ++ apc_cache_entry_value_t data; ++ unsigned char type; ++ int ref_count; ++ }; ++ ++ The user entry is pretty simple and not all that important for now. I will ++ concentrate on the file entries since that is what holds the actual compiled ++ opcode arrays along with the functions and classes required by the executor. ++ ++ apc_cache_make_file_entry() in apc_cache.c shows how an entry is constructed. ++ The main thing to understand here is that we need more than just the opcode ++ array, we also need the functions and classes created by the compiler when it ++ created the opcode array. As far as the executor is concerned, it doesn't know ++ that it isn't operating in normal mode being called right after the parse/compile ++ phase, so we need to recreate everything so it looks exactly like it would at ++ that point. ++ ++7. my_compile_file() and apc_compile.c ++ ++ my_compile_file() in apc_main.c controls where we get the opcodes from. If ++ the user-specified filters exclude the file from being cached, then we just ++ call the original compile function and return. Otherwise we fetch the request ++ time from Apache to avoid an extra syscall, create the key so we can look up ++ the file in the cache. If we find it we stick it on a local stack which we ++ use at cleanup time to make sure we return everything back to normal after a ++ request and call cached_compile() which installs the functions and classes ++ associated with the op_array in this entry and then copy the op_array down ++ into our memory space for execution. ++ ++ If we didn't find the file in the cache, we need to compile it and insert it. ++ To compile it we simply call the original compile function: ++ ++ op_array = old_compile_file(h, type TSRMLS_CC); ++ ++ To do the insert we need to copy the functions, classes and the opcode array ++ the compile phase created into shared memory. This all happens in apc_compile.c ++ in the apc_copy_op_array(), apc_copy_new_functions() and apc_copy_new_classes() ++ functions. Then we make the file entry and do the insert. Both of these ++ operations were described in the previous section. ++ ++8. The Optimizer ++ ++ The optimizer has been deprecated. ++ ++If you made it to the end of this, you should have a pretty good idea of where things are in ++the code. I skimmed over a lot of things, so plan on spending some time reading through the code. ++ +diff -Naur a/ext/apc/tests/apc_001.phpt b/ext/apc/tests/apc_001.phpt +--- a/ext/apc/tests/apc_001.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_001.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,32 @@ ++--TEST-- ++APC: apc_store/fetch with strings ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++ ++===DONE=== ++ ++--EXPECTF-- ++string(11) "hello world" ++string(11) "hello world" ++string(4) "nice" ++string(11) "hello world" ++===DONE=== +diff -Naur a/ext/apc/tests/apc_002.phpt b/ext/apc/tests/apc_002.phpt +--- a/ext/apc/tests/apc_002.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_002.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,34 @@ ++--TEST-- ++APC: apc_store/fetch with objects ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++a = true; ++var_dump($bar); ++ ++?> ++===DONE=== ++ ++--EXPECTF-- ++object(foo)#%d (0) { ++} ++object(foo)#%d (0) { ++} ++object(foo)#%d (1) { ++ ["a"]=> ++ bool(true) ++} ++===DONE=== +diff -Naur a/ext/apc/tests/apc_003b.phpt b/ext/apc/tests/apc_003b.phpt +--- a/ext/apc/tests/apc_003b.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_003b.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,117 @@ ++--TEST-- ++APC: apc_store/fetch with objects (php 5.3) ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++a = true; ++var_dump($bar); ++ ++class bar extends foo ++{ ++ public $pub = 'bar'; ++ protected $pro = 'bar'; ++ private $pri = 'bar'; // we don't see this, we'd need php 5.1 new serialization ++ ++ function __construct() ++ { ++ $this->bar = true; ++ } ++ ++ function change() ++ { ++ $this->pri = 'mod'; ++ } ++} ++ ++class baz extends bar ++{ ++ private $pri = 'baz'; ++ ++ function __construct() ++ { ++ parent::__construct(); ++ $this->baz = true; ++ } ++} ++ ++$baz = new baz; ++var_dump($baz); ++$baz->change(); ++var_dump($baz); ++apc_store('baz', $baz); ++unset($baz); ++var_dump(apc_fetch('baz')); ++ ++?> ++===DONE=== ++ ++--EXPECTF-- ++object(foo)#%d (0) { ++} ++object(foo)#%d (0) { ++} ++object(foo)#%d (1) { ++ ["a"]=> ++ bool(true) ++} ++object(baz)#%d (6) { ++ ["pri":"baz":private]=> ++ string(3) "baz" ++ ["pub"]=> ++ string(3) "bar" ++ ["pro":protected]=> ++ string(3) "bar" ++ ["pri":"bar":private]=> ++ string(3) "bar" ++ ["bar"]=> ++ bool(true) ++ ["baz"]=> ++ bool(true) ++} ++object(baz)#%d (6) { ++ ["pri":"baz":private]=> ++ string(3) "baz" ++ ["pub"]=> ++ string(3) "bar" ++ ["pro":protected]=> ++ string(3) "bar" ++ ["pri":"bar":private]=> ++ string(3) "mod" ++ ["bar"]=> ++ bool(true) ++ ["baz"]=> ++ bool(true) ++} ++object(baz)#%d (6) { ++ ["pri":"baz":private]=> ++ string(3) "baz" ++ ["pub"]=> ++ string(3) "bar" ++ ["pro":protected]=> ++ string(3) "bar" ++ ["pri":"bar":private]=> ++ string(3) "mod" ++ ["bar"]=> ++ bool(true) ++ ["baz"]=> ++ bool(true) ++} ++===DONE=== +diff -Naur a/ext/apc/tests/apc_003.phpt b/ext/apc/tests/apc_003.phpt +--- a/ext/apc/tests/apc_003.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_003.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,117 @@ ++--TEST-- ++APC: apc_store/fetch with objects (php pre-5.3) ++--SKIPIF-- ++= 0) { ++ echo "skip\n"; ++ } ++?> ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++a = true; ++var_dump($bar); ++ ++class bar extends foo ++{ ++ public $pub = 'bar'; ++ protected $pro = 'bar'; ++ private $pri = 'bar'; // we don't see this, we'd need php 5.1 new serialization ++ ++ function __construct() ++ { ++ $this->bar = true; ++ } ++ ++ function change() ++ { ++ $this->pri = 'mod'; ++ } ++} ++ ++class baz extends bar ++{ ++ private $pri = 'baz'; ++ ++ function __construct() ++ { ++ parent::__construct(); ++ $this->baz = true; ++ } ++} ++ ++$baz = new baz; ++var_dump($baz); ++$baz->change(); ++var_dump($baz); ++apc_store('baz', $baz); ++unset($baz); ++var_dump(apc_fetch('baz')); ++ ++?> ++===DONE=== ++ ++--EXPECTF-- ++object(foo)#%d (0) { ++} ++object(foo)#%d (0) { ++} ++object(foo)#%d (1) { ++ ["a"]=> ++ bool(true) ++} ++object(baz)#%d (6) { ++ ["pri:private"]=> ++ string(3) "baz" ++ ["pub"]=> ++ string(3) "bar" ++ ["pro:protected"]=> ++ string(3) "bar" ++ ["pri:private"]=> ++ string(3) "bar" ++ ["bar"]=> ++ bool(true) ++ ["baz"]=> ++ bool(true) ++} ++object(baz)#%d (6) { ++ ["pri:private"]=> ++ string(3) "baz" ++ ["pub"]=> ++ string(3) "bar" ++ ["pro:protected"]=> ++ string(3) "bar" ++ ["pri:private"]=> ++ string(3) "mod" ++ ["bar"]=> ++ bool(true) ++ ["baz"]=> ++ bool(true) ++} ++object(baz)#%d (6) { ++ ["pri:private"]=> ++ string(3) "baz" ++ ["pub"]=> ++ string(3) "bar" ++ ["pro:protected"]=> ++ string(3) "bar" ++ ["pri:private"]=> ++ string(3) "mod" ++ ["bar"]=> ++ bool(true) ++ ["baz"]=> ++ bool(true) ++} ++===DONE=== +diff -Naur a/ext/apc/tests/apc_004.phpt b/ext/apc/tests/apc_004.phpt +--- a/ext/apc/tests/apc_004.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_004.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,38 @@ ++--TEST-- ++APC: apc_store/fetch with bools ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++ ++===DONE=== ++ ++--EXPECTF-- ++bool(false) ++bool(false) ++bool(false) ++bool(true) ++bool(false) ++bool(false) ++bool(false) ++===DONE=== +diff -Naur a/ext/apc/tests/apc_005.phpt b/ext/apc/tests/apc_005.phpt +--- a/ext/apc/tests/apc_005.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_005.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,50 @@ ++--TEST-- ++APC: apc_store/fetch with arrays of objects ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++ ++===DONE=== ++ ++--EXPECTF-- ++array(2) { ++ [0]=> ++ object(stdClass)#1 (0) { ++ } ++ [1]=> ++ object(stdClass)#2 (0) { ++ } ++} ++array(2) { ++ [0]=> ++ object(stdClass)#1 (0) { ++ } ++ [1]=> ++ object(stdClass)#2 (0) { ++ } ++} ++array(2) { ++ [0]=> ++ object(stdClass)#3 (0) { ++ } ++ [1]=> ++ object(stdClass)#4 (0) { ++ } ++} ++===DONE=== +diff -Naur a/ext/apc/tests/apc_006.phpt b/ext/apc/tests/apc_006.phpt +--- a/ext/apc/tests/apc_006.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_006.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,73 @@ ++--TEST-- ++APC: apc_store/fetch reference test ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++apc.serializer=default ++report_memleaks=0 ++--FILE-- ++ ++===DONE=== ++ ++--EXPECTF-- ++array(9) refcount(2){ ++ [0]=> ++ string(1) "a" refcount(1) ++ [1]=> ++ &array(1) refcount(2){ ++ [0]=> ++ string(1) "c" refcount(1) ++ } ++ [2]=> ++ &array(1) refcount(2){ ++ [0]=> ++ string(1) "c" refcount(1) ++ } ++ [3]=> ++ &string(1) "d" refcount(3) ++ [4]=> ++ &string(1) "d" refcount(3) ++ [5]=> ++ &string(1) "d" refcount(3) ++ [6]=> ++ string(1) "e" refcount(2) ++ [7]=> ++ string(1) "e" refcount(2) ++ [8]=> ++ &array(2) refcount(2){ ++ [0]=> ++ string(1) "f" refcount(1) ++ [1]=> ++ &array(2) refcount(2){ ++ [0]=> ++ string(1) "f" refcount(1) ++ [1]=> ++ *RECURSION* ++ } ++ } ++} ++===DONE=== +diff -Naur a/ext/apc/tests/apc_007.phpt b/ext/apc/tests/apc_007.phpt +--- a/ext/apc/tests/apc_007.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_007.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,46 @@ ++--TEST-- ++APC: apc_inc/apc_dec test ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++ ++===DONE=== ++ ++--EXPECTF-- ++$foobar = 2 ++$foobar += 1 = 3 ++$foobar += 10 = 13 ++$foobar -= 1 = 12 ++$foobar -= 10 = 2 ++$f__bar += 1 = fail ++$perfection -= 1 = epic fail ++$foobar += 1 = 3 ++pass by ref success 1 ++$foobar -= 1 = 2 ++pass by ref success 1 ++===DONE=== +diff -Naur a/ext/apc/tests/apc_008.phpt b/ext/apc/tests/apc_008.phpt +--- a/ext/apc/tests/apc_008.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_008.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,34 @@ ++--TEST-- ++APC: apc_cas test ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++ ++===DONE=== ++ ++--EXPECTF-- ++$foobar = 2 ++$foobar == 1 ? 2 : 1 = fail ++$foobar == 2 ? 1 : 2 = ok ++$foobar = 1 ++$f__bar == 1 ? 2 : 1 = fail ++$perfection == 2 ? 1 : 2 = epic fail ++$foobar = 1 ++===DONE=== +diff -Naur a/ext/apc/tests/apc_009.phpt b/ext/apc/tests/apc_009.phpt +--- a/ext/apc/tests/apc_009.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_009.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,97 @@ ++--TEST-- ++APC: apc_delete_file test ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++apc.stat=On ++report_memleaks=0 ++--FILE-- ++ ++===DONE=== ++ ++--CLEAN-- ++ ++--EXPECTF-- ++apc_009.php Found File ++apc_009.php Not Found ++apc_009.php Not Found ++apc_009.php Not Found ++array(0) { ++} ++apc_009.php Found File ++apc_009-1.php Found File ++ ++Parse error: syntax error, unexpected '!' in %s/apc_009-2.php on line 1 ++ ++Warning: apc_compile_file(): Error compiling apc_009-2.php in apc_compile_file. in %s/apc_009.php on line 29 ++ ++Warning: apc_compile_file(): Error compiling nofile.php in apc_compile_file. in %s/apc_009.php on line 29 ++array(2) { ++ ["apc_009-2.php"]=> ++ int(-1) ++ ["nofile.php"]=> ++ int(-1) ++} ++apc_009.php Found File ++apc_009-1.php Found File ++apc_009-2.php Not Found ++nofile.php Not Found ++===DONE=== +diff -Naur a/ext/apc/tests/apc_010.phpt b/ext/apc/tests/apc_010.phpt +--- a/ext/apc/tests/apc_010.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_010.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,83 @@ ++--TEST-- ++APC: apc_store/fetch/add with array of key/value pairs. ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++ ++===DONE=== ++ ++--EXPECTF-- ++array(0) { ++} ++array(4) { ++ ["key1"]=> ++ string(6) "value1" ++ ["key2"]=> ++ string(6) "value2" ++ ["key3"]=> ++ array(2) { ++ [0]=> ++ string(7) "value3a" ++ [1]=> ++ string(7) "value3b" ++ } ++ ["key4"]=> ++ int(4) ++} ++array(2) { ++ ["key1"]=> ++ string(6) "value1" ++ ["key3"]=> ++ array(2) { ++ [0]=> ++ string(7) "value3a" ++ [1]=> ++ string(7) "value3b" ++ } ++} ++array(2) { ++ ["key1"]=> ++ int(-1) ++ ["key3"]=> ++ int(-1) ++} ++array(4) { ++ ["key1"]=> ++ string(6) "value1" ++ ["key2"]=> ++ string(6) "value2" ++ ["key3"]=> ++ array(2) { ++ [0]=> ++ string(7) "value3a" ++ [1]=> ++ string(7) "value3b" ++ } ++ ["key4"]=> ++ int(4) ++} ++===DONE=== +diff -Naur a/ext/apc/tests/apc53_001.phpt b/ext/apc/tests/apc53_001.phpt +--- a/ext/apc/tests/apc53_001.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc53_001.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,33 @@ ++--TEST-- ++APC: classes with namespaces (php 5.3) ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++ ++===DONE=== ++ ++--EXPECTF-- ++object(Foo\Bar\Baz)#1 (3) { ++ ["i"]=> ++ int(1) ++ ["f":protected]=> ++ float(3.14) ++ ["s":"Foo\Bar\Baz":private]=> ++ string(11) "hello world" ++} ++===DONE=== +diff -Naur a/ext/apc/tests/apc53_002.phpt b/ext/apc/tests/apc53_002.phpt +--- a/ext/apc/tests/apc53_002.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc53_002.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,47 @@ ++--TEST-- ++APC: global spaces (php 5.3) ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++foo(); ++var_dump(Foo\Bar\sort()); ++?> ++===DONE=== ++ ++--EXPECTF-- ++array(4) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++ [3]=> ++ int(4) ++} ++array(4) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++ [3]=> ++ int(4) ++} ++string(8) "IT WORKS" ++===DONE=== +diff -Naur a/ext/apc/tests/apc53_003.phpt b/ext/apc/tests/apc53_003.phpt +--- a/ext/apc/tests/apc53_003.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc53_003.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,31 @@ ++--TEST-- ++APC: anonymous functions (php 5.3) ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++ ++===DONE=== ++ ++--EXPECTF-- ++Hello World ++Hello PHP ++===DONE=== +diff -Naur a/ext/apc/tests/apc53_004.phpt b/ext/apc/tests/apc53_004.phpt +--- a/ext/apc/tests/apc53_004.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc53_004.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,33 @@ ++--TEST-- ++APC: closures (php 5.3) ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++ ++===DONE=== ++ ++--EXPECTF-- ++double of 9 is 18 ++triple of 4 is 12 ++===DONE=== +diff -Naur a/ext/apc/tests/apc53_005.phpt b/ext/apc/tests/apc53_005.phpt +--- a/ext/apc/tests/apc53_005.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc53_005.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,35 @@ ++--TEST-- ++APC: goto (php 5.3) ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++ ++===DONE=== ++ ++--EXPECTF-- ++1 ++2 ++4 ++5 ++7 ++8 ++10 ++===DONE=== +diff -Naur a/ext/apc/tests/apc_bin_001.phpt b/ext/apc/tests/apc_bin_001.phpt +--- a/ext/apc/tests/apc_bin_001.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_bin_001.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,24 @@ ++--TEST-- ++APC: bindump user cache ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++--FILE-- ++ ++===DONE=== ++ ++--EXPECTF-- ++bool(false) ++string(9) "testvalue" ++===DONE=== +diff -Naur a/ext/apc/tests/apc_bin_002-1.inc b/ext/apc/tests/apc_bin_002-1.inc +--- a/ext/apc/tests/apc_bin_002-1.inc 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_bin_002-1.inc 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,42 @@ ++my_method()."\n"; ++echo "class static property: ".my_class::$my_static_property."\n"; ++echo "class dynamic property: ".$my_class->my_property."\n"; ++echo "class constant: ".my_class::my_constant."\n"; ++echo "\n"; ++echo "inherited class static method: ".my_i_class::my_static_method()."\n"; ++echo "inherited class dynamic method: ".$my_i_class->my_method()."\n"; ++echo "inherited class static property: ".my_i_class::$my_static_property."\n"; ++echo "inherited class dynamic property: ".$my_i_class->my_property."\n"; ++echo "inherited class constant: ".my_i_class::my_constant."\n"; ++echo "\n"; ++ ++ ++ ++function my_function() { return "Success"; } ++ ++ ++class my_class { ++ static $my_static_property = "Success"; ++ var $my_property = "Success"; ++ const my_constant = "Success"; ++ static function my_static_method() { return "Success"; } ++ function my_method() { return "Success"; } ++} ++ ++class my_i_class extends my_class { ++ function dummy() { return 1; } ++} ++ +diff -Naur a/ext/apc/tests/apc_bin_002-2.inc b/ext/apc/tests/apc_bin_002-2.inc +--- a/ext/apc/tests/apc_bin_002-2.inc 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_bin_002-2.inc 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,5 @@ ++ +diff -Naur a/ext/apc/tests/apc_bin_002.phpt b/ext/apc/tests/apc_bin_002.phpt +--- a/ext/apc/tests/apc_bin_002.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/apc_bin_002.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,53 @@ ++--TEST-- ++APC: bindump file cache part 1 ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.stat=0 ++apc.cache_by_default=1 ++apc.filters= ++report_memleaks = Off ++--FILE-- ++ ++===DONE=== ++ ++--EXPECTF-- ++apc bindump 002 test ++ ++global scope execution: Success ++ ++function execution: Success ++ ++class static method: Success ++class dynamic method: Success ++class static property: Success ++class dynamic property: Success ++class constant: Success ++ ++inherited class static method: Success ++inherited class dynamic method: Success ++inherited class static property: Success ++inherited class dynamic property: Success ++inherited class constant: Success ++ ++===DONE=== +diff -Naur a/ext/apc/tests/iterator_001.phpt b/ext/apc/tests/iterator_001.phpt +--- a/ext/apc/tests/iterator_001.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/iterator_001.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,110 @@ ++--TEST-- ++APC: APCIterator general ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++$value) { ++ $vals[$key] = $value['key']; ++} ++ksort($vals); ++var_dump($vals); ++ ++?> ++===DONE=== ++ ++--EXPECT-- ++array(41) { ++ ["key0"]=> ++ string(4) "key0" ++ ["key1"]=> ++ string(4) "key1" ++ ["key10"]=> ++ string(5) "key10" ++ ["key11"]=> ++ string(5) "key11" ++ ["key12"]=> ++ string(5) "key12" ++ ["key13"]=> ++ string(5) "key13" ++ ["key14"]=> ++ string(5) "key14" ++ ["key15"]=> ++ string(5) "key15" ++ ["key16"]=> ++ string(5) "key16" ++ ["key17"]=> ++ string(5) "key17" ++ ["key18"]=> ++ string(5) "key18" ++ ["key19"]=> ++ string(5) "key19" ++ ["key2"]=> ++ string(4) "key2" ++ ["key20"]=> ++ string(5) "key20" ++ ["key21"]=> ++ string(5) "key21" ++ ["key22"]=> ++ string(5) "key22" ++ ["key23"]=> ++ string(5) "key23" ++ ["key24"]=> ++ string(5) "key24" ++ ["key25"]=> ++ string(5) "key25" ++ ["key26"]=> ++ string(5) "key26" ++ ["key27"]=> ++ string(5) "key27" ++ ["key28"]=> ++ string(5) "key28" ++ ["key29"]=> ++ string(5) "key29" ++ ["key3"]=> ++ string(4) "key3" ++ ["key30"]=> ++ string(5) "key30" ++ ["key31"]=> ++ string(5) "key31" ++ ["key32"]=> ++ string(5) "key32" ++ ["key33"]=> ++ string(5) "key33" ++ ["key34"]=> ++ string(5) "key34" ++ ["key35"]=> ++ string(5) "key35" ++ ["key36"]=> ++ string(5) "key36" ++ ["key37"]=> ++ string(5) "key37" ++ ["key38"]=> ++ string(5) "key38" ++ ["key39"]=> ++ string(5) "key39" ++ ["key4"]=> ++ string(4) "key4" ++ ["key40"]=> ++ string(5) "key40" ++ ["key5"]=> ++ string(4) "key5" ++ ["key6"]=> ++ string(4) "key6" ++ ["key7"]=> ++ string(4) "key7" ++ ["key8"]=> ++ string(4) "key8" ++ ["key9"]=> ++ string(4) "key9" ++} ++===DONE=== +diff -Naur a/ext/apc/tests/iterator_002.phpt b/ext/apc/tests/iterator_002.phpt +--- a/ext/apc/tests/iterator_002.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/iterator_002.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,36 @@ ++--TEST-- ++APC: APCIterator regex ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++$value) { ++ $vals[$key] = $value['key']; ++} ++ksort($vals); ++var_dump($vals); ++ ++?> ++===DONE=== ++ ++--EXPECT-- ++array(4) { ++ ["key10"]=> ++ string(5) "key10" ++ ["key20"]=> ++ string(5) "key20" ++ ["key30"]=> ++ string(5) "key30" ++ ["key40"]=> ++ string(5) "key40" ++} ++===DONE=== +diff -Naur a/ext/apc/tests/iterator_003.phpt b/ext/apc/tests/iterator_003.phpt +--- a/ext/apc/tests/iterator_003.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/iterator_003.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,110 @@ ++--TEST-- ++APC: APCIterator chunk size ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++$value) { ++ $vals[$key] = $value['key']; ++} ++ksort($vals); ++var_dump($vals); ++ ++?> ++===DONE=== ++ ++--EXPECT-- ++array(41) { ++ ["key0"]=> ++ string(4) "key0" ++ ["key1"]=> ++ string(4) "key1" ++ ["key10"]=> ++ string(5) "key10" ++ ["key11"]=> ++ string(5) "key11" ++ ["key12"]=> ++ string(5) "key12" ++ ["key13"]=> ++ string(5) "key13" ++ ["key14"]=> ++ string(5) "key14" ++ ["key15"]=> ++ string(5) "key15" ++ ["key16"]=> ++ string(5) "key16" ++ ["key17"]=> ++ string(5) "key17" ++ ["key18"]=> ++ string(5) "key18" ++ ["key19"]=> ++ string(5) "key19" ++ ["key2"]=> ++ string(4) "key2" ++ ["key20"]=> ++ string(5) "key20" ++ ["key21"]=> ++ string(5) "key21" ++ ["key22"]=> ++ string(5) "key22" ++ ["key23"]=> ++ string(5) "key23" ++ ["key24"]=> ++ string(5) "key24" ++ ["key25"]=> ++ string(5) "key25" ++ ["key26"]=> ++ string(5) "key26" ++ ["key27"]=> ++ string(5) "key27" ++ ["key28"]=> ++ string(5) "key28" ++ ["key29"]=> ++ string(5) "key29" ++ ["key3"]=> ++ string(4) "key3" ++ ["key30"]=> ++ string(5) "key30" ++ ["key31"]=> ++ string(5) "key31" ++ ["key32"]=> ++ string(5) "key32" ++ ["key33"]=> ++ string(5) "key33" ++ ["key34"]=> ++ string(5) "key34" ++ ["key35"]=> ++ string(5) "key35" ++ ["key36"]=> ++ string(5) "key36" ++ ["key37"]=> ++ string(5) "key37" ++ ["key38"]=> ++ string(5) "key38" ++ ["key39"]=> ++ string(5) "key39" ++ ["key4"]=> ++ string(4) "key4" ++ ["key40"]=> ++ string(5) "key40" ++ ["key5"]=> ++ string(4) "key5" ++ ["key6"]=> ++ string(4) "key6" ++ ["key7"]=> ++ string(4) "key7" ++ ["key8"]=> ++ string(4) "key8" ++ ["key9"]=> ++ string(4) "key9" ++} ++===DONE=== +diff -Naur a/ext/apc/tests/iterator_004.phpt b/ext/apc/tests/iterator_004.phpt +--- a/ext/apc/tests/iterator_004.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/iterator_004.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,36 @@ ++--TEST-- ++APC: APCIterator regex & chunk size & list ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++$value) { ++ $vals[$key] = $value['key']; ++} ++ksort($vals); ++var_dump($vals); ++ ++?> ++===DONE=== ++ ++--EXPECT-- ++array(4) { ++ ["key10"]=> ++ string(5) "key10" ++ ["key20"]=> ++ string(5) "key20" ++ ["key30"]=> ++ string(5) "key30" ++ ["key40"]=> ++ string(5) "key40" ++} ++===DONE=== +diff -Naur a/ext/apc/tests/iterator_005.phpt b/ext/apc/tests/iterator_005.phpt +--- a/ext/apc/tests/iterator_005.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/iterator_005.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,112 @@ ++--TEST-- ++APC: APCIterator delete ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++--FILE-- ++$value) { ++ $vals[$key] = $value['key']; ++} ++foreach($it2 as $key=>$value) { ++ $vals2[$key] = $value['key']; ++} ++ksort($vals2); ++var_dump($vals); ++var_dump($vals2); ++ ++?> ++===DONE=== ++ ++--EXPECT-- ++array(0) { ++} ++array(37) { ++ ["key0"]=> ++ string(4) "key0" ++ ["key1"]=> ++ string(4) "key1" ++ ["key11"]=> ++ string(5) "key11" ++ ["key12"]=> ++ string(5) "key12" ++ ["key13"]=> ++ string(5) "key13" ++ ["key14"]=> ++ string(5) "key14" ++ ["key15"]=> ++ string(5) "key15" ++ ["key16"]=> ++ string(5) "key16" ++ ["key17"]=> ++ string(5) "key17" ++ ["key18"]=> ++ string(5) "key18" ++ ["key19"]=> ++ string(5) "key19" ++ ["key2"]=> ++ string(4) "key2" ++ ["key21"]=> ++ string(5) "key21" ++ ["key22"]=> ++ string(5) "key22" ++ ["key23"]=> ++ string(5) "key23" ++ ["key24"]=> ++ string(5) "key24" ++ ["key25"]=> ++ string(5) "key25" ++ ["key26"]=> ++ string(5) "key26" ++ ["key27"]=> ++ string(5) "key27" ++ ["key28"]=> ++ string(5) "key28" ++ ["key29"]=> ++ string(5) "key29" ++ ["key3"]=> ++ string(4) "key3" ++ ["key31"]=> ++ string(5) "key31" ++ ["key32"]=> ++ string(5) "key32" ++ ["key33"]=> ++ string(5) "key33" ++ ["key34"]=> ++ string(5) "key34" ++ ["key35"]=> ++ string(5) "key35" ++ ["key36"]=> ++ string(5) "key36" ++ ["key37"]=> ++ string(5) "key37" ++ ["key38"]=> ++ string(5) "key38" ++ ["key39"]=> ++ string(5) "key39" ++ ["key4"]=> ++ string(4) "key4" ++ ["key5"]=> ++ string(4) "key5" ++ ["key6"]=> ++ string(4) "key6" ++ ["key7"]=> ++ string(4) "key7" ++ ["key8"]=> ++ string(4) "key8" ++ ["key9"]=> ++ string(4) "key9" ++} ++===DONE=== +diff -Naur a/ext/apc/tests/iterator_006.phpt b/ext/apc/tests/iterator_006.phpt +--- a/ext/apc/tests/iterator_006.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/iterator_006.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,1536 @@ ++--TEST-- ++APC: APCIterator formats ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++apc.file_update_protection=0 ++apc.user_entries_hint=4096 ++--FILE-- ++ $format) { ++ $it_array[$idx] = new APCIterator('user', NULL, $format); ++} ++ ++for($i = 0; $i < 11; $i++) { ++ apc_store("key$i", "value$i"); ++} ++ ++foreach ($it_array as $idx => $it) { ++ print_it($it, $idx); ++} ++ ++function print_it($it, $idx) { ++ echo "IT #$idx\n"; ++ echo "============================\n"; ++ foreach ($it as $key=>$value) { ++ var_dump($key); ++ var_dump($value); ++ } ++ echo "============================\n\n"; ++} ++ ++?> ++===DONE=== ++ ++--EXPECTF-- ++IT #0 ++============================ ++string(5) "key10" ++array(1) { ++ ["type"]=> ++ string(4) "user" ++} ++string(4) "key0" ++array(1) { ++ ["type"]=> ++ string(4) "user" ++} ++string(4) "key1" ++array(1) { ++ ["type"]=> ++ string(4) "user" ++} ++string(4) "key2" ++array(1) { ++ ["type"]=> ++ string(4) "user" ++} ++string(4) "key3" ++array(1) { ++ ["type"]=> ++ string(4) "user" ++} ++string(4) "key4" ++array(1) { ++ ["type"]=> ++ string(4) "user" ++} ++string(4) "key5" ++array(1) { ++ ["type"]=> ++ string(4) "user" ++} ++string(4) "key6" ++array(1) { ++ ["type"]=> ++ string(4) "user" ++} ++string(4) "key7" ++array(1) { ++ ["type"]=> ++ string(4) "user" ++} ++string(4) "key8" ++array(1) { ++ ["type"]=> ++ string(4) "user" ++} ++string(4) "key9" ++array(1) { ++ ["type"]=> ++ string(4) "user" ++} ++============================ ++ ++IT #1 ++============================ ++string(5) "key10" ++array(1) { ++ ["key"]=> ++ string(5) "key10" ++} ++string(4) "key0" ++array(1) { ++ ["key"]=> ++ string(4) "key0" ++} ++string(4) "key1" ++array(1) { ++ ["key"]=> ++ string(4) "key1" ++} ++string(4) "key2" ++array(1) { ++ ["key"]=> ++ string(4) "key2" ++} ++string(4) "key3" ++array(1) { ++ ["key"]=> ++ string(4) "key3" ++} ++string(4) "key4" ++array(1) { ++ ["key"]=> ++ string(4) "key4" ++} ++string(4) "key5" ++array(1) { ++ ["key"]=> ++ string(4) "key5" ++} ++string(4) "key6" ++array(1) { ++ ["key"]=> ++ string(4) "key6" ++} ++string(4) "key7" ++array(1) { ++ ["key"]=> ++ string(4) "key7" ++} ++string(4) "key8" ++array(1) { ++ ["key"]=> ++ string(4) "key8" ++} ++string(4) "key9" ++array(1) { ++ ["key"]=> ++ string(4) "key9" ++} ++============================ ++ ++IT #2 ++============================ ++string(5) "key10" ++array(0) { ++} ++string(4) "key0" ++array(0) { ++} ++string(4) "key1" ++array(0) { ++} ++string(4) "key2" ++array(0) { ++} ++string(4) "key3" ++array(0) { ++} ++string(4) "key4" ++array(0) { ++} ++string(4) "key5" ++array(0) { ++} ++string(4) "key6" ++array(0) { ++} ++string(4) "key7" ++array(0) { ++} ++string(4) "key8" ++array(0) { ++} ++string(4) "key9" ++array(0) { ++} ++============================ ++ ++IT #3 ++============================ ++string(5) "key10" ++array(0) { ++} ++string(4) "key0" ++array(0) { ++} ++string(4) "key1" ++array(0) { ++} ++string(4) "key2" ++array(0) { ++} ++string(4) "key3" ++array(0) { ++} ++string(4) "key4" ++array(0) { ++} ++string(4) "key5" ++array(0) { ++} ++string(4) "key6" ++array(0) { ++} ++string(4) "key7" ++array(0) { ++} ++string(4) "key8" ++array(0) { ++} ++string(4) "key9" ++array(0) { ++} ++============================ ++ ++IT #4 ++============================ ++string(5) "key10" ++array(0) { ++} ++string(4) "key0" ++array(0) { ++} ++string(4) "key1" ++array(0) { ++} ++string(4) "key2" ++array(0) { ++} ++string(4) "key3" ++array(0) { ++} ++string(4) "key4" ++array(0) { ++} ++string(4) "key5" ++array(0) { ++} ++string(4) "key6" ++array(0) { ++} ++string(4) "key7" ++array(0) { ++} ++string(4) "key8" ++array(0) { ++} ++string(4) "key9" ++array(0) { ++} ++============================ ++ ++IT #5 ++============================ ++string(5) "key10" ++array(1) { ++ ["value"]=> ++ string(7) "value10" ++} ++string(4) "key0" ++array(1) { ++ ["value"]=> ++ string(6) "value0" ++} ++string(4) "key1" ++array(1) { ++ ["value"]=> ++ string(6) "value1" ++} ++string(4) "key2" ++array(1) { ++ ["value"]=> ++ string(6) "value2" ++} ++string(4) "key3" ++array(1) { ++ ["value"]=> ++ string(6) "value3" ++} ++string(4) "key4" ++array(1) { ++ ["value"]=> ++ string(6) "value4" ++} ++string(4) "key5" ++array(1) { ++ ["value"]=> ++ string(6) "value5" ++} ++string(4) "key6" ++array(1) { ++ ["value"]=> ++ string(6) "value6" ++} ++string(4) "key7" ++array(1) { ++ ["value"]=> ++ string(6) "value7" ++} ++string(4) "key8" ++array(1) { ++ ["value"]=> ++ string(6) "value8" ++} ++string(4) "key9" ++array(1) { ++ ["value"]=> ++ string(6) "value9" ++} ++============================ ++ ++IT #6 ++============================ ++string(5) "key10" ++array(0) { ++} ++string(4) "key0" ++array(0) { ++} ++string(4) "key1" ++array(0) { ++} ++string(4) "key2" ++array(0) { ++} ++string(4) "key3" ++array(0) { ++} ++string(4) "key4" ++array(0) { ++} ++string(4) "key5" ++array(0) { ++} ++string(4) "key6" ++array(0) { ++} ++string(4) "key7" ++array(0) { ++} ++string(4) "key8" ++array(0) { ++} ++string(4) "key9" ++array(0) { ++} ++============================ ++ ++IT #7 ++============================ ++string(5) "key10" ++array(1) { ++ ["num_hits"]=> ++ int(0) ++} ++string(4) "key0" ++array(1) { ++ ["num_hits"]=> ++ int(0) ++} ++string(4) "key1" ++array(1) { ++ ["num_hits"]=> ++ int(0) ++} ++string(4) "key2" ++array(1) { ++ ["num_hits"]=> ++ int(0) ++} ++string(4) "key3" ++array(1) { ++ ["num_hits"]=> ++ int(0) ++} ++string(4) "key4" ++array(1) { ++ ["num_hits"]=> ++ int(0) ++} ++string(4) "key5" ++array(1) { ++ ["num_hits"]=> ++ int(0) ++} ++string(4) "key6" ++array(1) { ++ ["num_hits"]=> ++ int(0) ++} ++string(4) "key7" ++array(1) { ++ ["num_hits"]=> ++ int(0) ++} ++string(4) "key8" ++array(1) { ++ ["num_hits"]=> ++ int(0) ++} ++string(4) "key9" ++array(1) { ++ ["num_hits"]=> ++ int(0) ++} ++============================ ++ ++IT #8 ++============================ ++string(5) "key10" ++array(1) { ++ ["mtime"]=> ++ int(%d) ++} ++string(4) "key0" ++array(1) { ++ ["mtime"]=> ++ int(%d) ++} ++string(4) "key1" ++array(1) { ++ ["mtime"]=> ++ int(%d) ++} ++string(4) "key2" ++array(1) { ++ ["mtime"]=> ++ int(%d) ++} ++string(4) "key3" ++array(1) { ++ ["mtime"]=> ++ int(%d) ++} ++string(4) "key4" ++array(1) { ++ ["mtime"]=> ++ int(%d) ++} ++string(4) "key5" ++array(1) { ++ ["mtime"]=> ++ int(%d) ++} ++string(4) "key6" ++array(1) { ++ ["mtime"]=> ++ int(%d) ++} ++string(4) "key7" ++array(1) { ++ ["mtime"]=> ++ int(%d) ++} ++string(4) "key8" ++array(1) { ++ ["mtime"]=> ++ int(%d) ++} ++string(4) "key9" ++array(1) { ++ ["mtime"]=> ++ int(%d) ++} ++============================ ++ ++IT #9 ++============================ ++string(5) "key10" ++array(1) { ++ ["creation_time"]=> ++ int(%d) ++} ++string(4) "key0" ++array(1) { ++ ["creation_time"]=> ++ int(%d) ++} ++string(4) "key1" ++array(1) { ++ ["creation_time"]=> ++ int(%d) ++} ++string(4) "key2" ++array(1) { ++ ["creation_time"]=> ++ int(%d) ++} ++string(4) "key3" ++array(1) { ++ ["creation_time"]=> ++ int(%d) ++} ++string(4) "key4" ++array(1) { ++ ["creation_time"]=> ++ int(%d) ++} ++string(4) "key5" ++array(1) { ++ ["creation_time"]=> ++ int(%d) ++} ++string(4) "key6" ++array(1) { ++ ["creation_time"]=> ++ int(%d) ++} ++string(4) "key7" ++array(1) { ++ ["creation_time"]=> ++ int(%d) ++} ++string(4) "key8" ++array(1) { ++ ["creation_time"]=> ++ int(%d) ++} ++string(4) "key9" ++array(1) { ++ ["creation_time"]=> ++ int(%d) ++} ++============================ ++ ++IT #10 ++============================ ++string(5) "key10" ++array(1) { ++ ["deletion_time"]=> ++ int(0) ++} ++string(4) "key0" ++array(1) { ++ ["deletion_time"]=> ++ int(0) ++} ++string(4) "key1" ++array(1) { ++ ["deletion_time"]=> ++ int(0) ++} ++string(4) "key2" ++array(1) { ++ ["deletion_time"]=> ++ int(0) ++} ++string(4) "key3" ++array(1) { ++ ["deletion_time"]=> ++ int(0) ++} ++string(4) "key4" ++array(1) { ++ ["deletion_time"]=> ++ int(0) ++} ++string(4) "key5" ++array(1) { ++ ["deletion_time"]=> ++ int(0) ++} ++string(4) "key6" ++array(1) { ++ ["deletion_time"]=> ++ int(0) ++} ++string(4) "key7" ++array(1) { ++ ["deletion_time"]=> ++ int(0) ++} ++string(4) "key8" ++array(1) { ++ ["deletion_time"]=> ++ int(0) ++} ++string(4) "key9" ++array(1) { ++ ["deletion_time"]=> ++ int(0) ++} ++============================ ++ ++IT #11 ++============================ ++string(5) "key10" ++array(1) { ++ ["access_time"]=> ++ int(%d) ++} ++string(4) "key0" ++array(1) { ++ ["access_time"]=> ++ int(%d) ++} ++string(4) "key1" ++array(1) { ++ ["access_time"]=> ++ int(%d) ++} ++string(4) "key2" ++array(1) { ++ ["access_time"]=> ++ int(%d) ++} ++string(4) "key3" ++array(1) { ++ ["access_time"]=> ++ int(%d) ++} ++string(4) "key4" ++array(1) { ++ ["access_time"]=> ++ int(%d) ++} ++string(4) "key5" ++array(1) { ++ ["access_time"]=> ++ int(%d) ++} ++string(4) "key6" ++array(1) { ++ ["access_time"]=> ++ int(%d) ++} ++string(4) "key7" ++array(1) { ++ ["access_time"]=> ++ int(%d) ++} ++string(4) "key8" ++array(1) { ++ ["access_time"]=> ++ int(%d) ++} ++string(4) "key9" ++array(1) { ++ ["access_time"]=> ++ int(%d) ++} ++============================ ++ ++IT #12 ++============================ ++string(5) "key10" ++array(1) { ++ ["ref_count"]=> ++ int(0) ++} ++string(4) "key0" ++array(1) { ++ ["ref_count"]=> ++ int(0) ++} ++string(4) "key1" ++array(1) { ++ ["ref_count"]=> ++ int(0) ++} ++string(4) "key2" ++array(1) { ++ ["ref_count"]=> ++ int(0) ++} ++string(4) "key3" ++array(1) { ++ ["ref_count"]=> ++ int(0) ++} ++string(4) "key4" ++array(1) { ++ ["ref_count"]=> ++ int(0) ++} ++string(4) "key5" ++array(1) { ++ ["ref_count"]=> ++ int(0) ++} ++string(4) "key6" ++array(1) { ++ ["ref_count"]=> ++ int(0) ++} ++string(4) "key7" ++array(1) { ++ ["ref_count"]=> ++ int(0) ++} ++string(4) "key8" ++array(1) { ++ ["ref_count"]=> ++ int(0) ++} ++string(4) "key9" ++array(1) { ++ ["ref_count"]=> ++ int(0) ++} ++============================ ++ ++IT #13 ++============================ ++string(5) "key10" ++array(1) { ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key0" ++array(1) { ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key1" ++array(1) { ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key2" ++array(1) { ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key3" ++array(1) { ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key4" ++array(1) { ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key5" ++array(1) { ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key6" ++array(1) { ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key7" ++array(1) { ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key8" ++array(1) { ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key9" ++array(1) { ++ ["mem_size"]=> ++ int(%d) ++} ++============================ ++ ++IT #14 ++============================ ++string(5) "key10" ++array(1) { ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key0" ++array(1) { ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key1" ++array(1) { ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key2" ++array(1) { ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key3" ++array(1) { ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key4" ++array(1) { ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key5" ++array(1) { ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key6" ++array(1) { ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key7" ++array(1) { ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key8" ++array(1) { ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key9" ++array(1) { ++ ["ttl"]=> ++ int(0) ++} ++============================ ++ ++IT #15 ++============================ ++string(5) "key10" ++array(0) { ++} ++string(4) "key0" ++array(0) { ++} ++string(4) "key1" ++array(0) { ++} ++string(4) "key2" ++array(0) { ++} ++string(4) "key3" ++array(0) { ++} ++string(4) "key4" ++array(0) { ++} ++string(4) "key5" ++array(0) { ++} ++string(4) "key6" ++array(0) { ++} ++string(4) "key7" ++array(0) { ++} ++string(4) "key8" ++array(0) { ++} ++string(4) "key9" ++array(0) { ++} ++============================ ++ ++IT #16 ++============================ ++string(5) "key10" ++array(11) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(5) "key10" ++ ["value"]=> ++ string(7) "value10" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key0" ++array(11) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key0" ++ ["value"]=> ++ string(6) "value0" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key1" ++array(11) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key1" ++ ["value"]=> ++ string(6) "value1" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key2" ++array(11) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key2" ++ ["value"]=> ++ string(6) "value2" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key3" ++array(11) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key3" ++ ["value"]=> ++ string(6) "value3" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key4" ++array(11) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key4" ++ ["value"]=> ++ string(6) "value4" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key5" ++array(11) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key5" ++ ["value"]=> ++ string(6) "value5" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key6" ++array(11) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key6" ++ ["value"]=> ++ string(6) "value6" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key7" ++array(11) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key7" ++ ["value"]=> ++ string(6) "value7" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key8" ++array(11) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key8" ++ ["value"]=> ++ string(6) "value8" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++ ["ttl"]=> ++ int(0) ++} ++string(4) "key9" ++array(11) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key9" ++ ["value"]=> ++ string(6) "value9" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++ ["ttl"]=> ++ int(0) ++} ++============================ ++ ++IT #17 ++============================ ++string(5) "key10" ++array(10) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(5) "key10" ++ ["value"]=> ++ string(7) "value10" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key0" ++array(10) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key0" ++ ["value"]=> ++ string(6) "value0" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key1" ++array(10) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key1" ++ ["value"]=> ++ string(6) "value1" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key2" ++array(10) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key2" ++ ["value"]=> ++ string(6) "value2" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key3" ++array(10) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key3" ++ ["value"]=> ++ string(6) "value3" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key4" ++array(10) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key4" ++ ["value"]=> ++ string(6) "value4" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key5" ++array(10) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key5" ++ ["value"]=> ++ string(6) "value5" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key6" ++array(10) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key6" ++ ["value"]=> ++ string(6) "value6" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key7" ++array(10) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key7" ++ ["value"]=> ++ string(6) "value7" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key8" ++array(10) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key8" ++ ["value"]=> ++ string(6) "value8" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key9" ++array(10) { ++ ["type"]=> ++ string(4) "user" ++ ["key"]=> ++ string(4) "key9" ++ ["value"]=> ++ string(6) "value9" ++ ["num_hits"]=> ++ int(0) ++ ["mtime"]=> ++ int(%d) ++ ["creation_time"]=> ++ int(%d) ++ ["deletion_time"]=> ++ int(0) ++ ["access_time"]=> ++ int(%d) ++ ["ref_count"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++============================ ++ ++IT #18 ++============================ ++string(5) "key10" ++array(3) { ++ ["key"]=> ++ string(5) "key10" ++ ["num_hits"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key0" ++array(3) { ++ ["key"]=> ++ string(4) "key0" ++ ["num_hits"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key1" ++array(3) { ++ ["key"]=> ++ string(4) "key1" ++ ["num_hits"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key2" ++array(3) { ++ ["key"]=> ++ string(4) "key2" ++ ["num_hits"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key3" ++array(3) { ++ ["key"]=> ++ string(4) "key3" ++ ["num_hits"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key4" ++array(3) { ++ ["key"]=> ++ string(4) "key4" ++ ["num_hits"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key5" ++array(3) { ++ ["key"]=> ++ string(4) "key5" ++ ["num_hits"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key6" ++array(3) { ++ ["key"]=> ++ string(4) "key6" ++ ["num_hits"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key7" ++array(3) { ++ ["key"]=> ++ string(4) "key7" ++ ["num_hits"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key8" ++array(3) { ++ ["key"]=> ++ string(4) "key8" ++ ["num_hits"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++string(4) "key9" ++array(3) { ++ ["key"]=> ++ string(4) "key9" ++ ["num_hits"]=> ++ int(0) ++ ["mem_size"]=> ++ int(%d) ++} ++============================ ++ ++===DONE=== +diff -Naur a/ext/apc/tests/iterator_007.phpt b/ext/apc/tests/iterator_007.phpt +--- a/ext/apc/tests/iterator_007.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/iterator_007.phpt 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,36 @@ ++--TEST-- ++APC: APCIterator Overwriting the ctor ++--SKIPIF-- ++ ++--INI-- ++apc.enabled=1 ++apc.enable_cli=1 ++--FILE-- ++rewind(), ++ $obj->current(), ++ $obj->key(), ++ $obj->next(), ++ $obj->valid(), ++ $obj->getTotalHits(), ++ $obj->getTotalSize(), ++ $obj->getTotalCount(), ++ apc_delete($obj) ++); ++?> ++--EXPECTF-- ++bool(false) ++bool(false) ++bool(false) ++bool(false) ++bool(false) ++bool(false) ++bool(false) ++bool(false) ++bool(false) ++ +diff -Naur a/ext/apc/tests/php_5_3_ns.inc b/ext/apc/tests/php_5_3_ns.inc +--- a/ext/apc/tests/php_5_3_ns.inc 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/tests/php_5_3_ns.inc 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,18 @@ ++ +diff -Naur a/ext/apc/TODO b/ext/apc/TODO +--- a/ext/apc/TODO 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/apc/TODO 2012-07-20 00:10:35.000000000 +0200 +@@ -0,0 +1,35 @@ ++Known Bugs ++ ++1. Gallery2 doesn't work with PHP5+APC. There is something wrong ++ with the way methods are restored in some edge case I haven't ++ been able to figure out yet. ++ To reproduce install gallery2 and click down to an individual photo. ++ ++2. apc_store() probably needs some checks to skip trying to store ++ internal classes. Something along the lines of: ++ ++ if(Z_TYPE_P(val) == IS_OBJECT) { ++ zend_class_entry *ce = Z_OBJCE_P(val); ++ if(ce->type == ZEND_INTERNAL_CLASS) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot cache internal objects"); ++ RETURN_FALSE; ++ } ++ } ++ ++ in the apc_store() function in php_apc.c but I am wondering if it needs to do more ++ than that. ++ ++Windows ++ ++1. The following configurations (build arguments) have not been implemented yet ++ ++ (*) --enable-apc-mmap Memory mapping support ++ (*) --enable-apc-sem Semaphore locking support (FCNTL replacement) ++ (*) --enable-apc-phreadmutex Thread mutexes, while implemented we should probably rename the internals to thread ++ (*) --enable-apc-pthreadrwlocks Thread mutexes, read/write locking ++ ++2. Non-blocking locks is not supported either ++ ++3. Update fileinfo to support stat info in a more portable way (see PECL #17903) ++ ++4. Check whether the signal handling needs to be enabled, and if it makes sense on Windows +\ Kein Zeilenumbruch am Dateiende. diff --git a/lang/php5/patches/010-PECL-dio.patch b/lang/php5/patches/010-PECL-dio.patch new file mode 100644 index 0000000..e3b22c4 --- /dev/null +++ b/lang/php5/patches/010-PECL-dio.patch @@ -0,0 +1,3546 @@ +--- /dev/null ++++ b/ext/dio/config.m4 +@@ -0,0 +1,10 @@ ++dnl ++dnl $Id: config.m4 291957 2009-12-10 17:13:14Z cyberspice $ ++dnl ++ ++PHP_ARG_ENABLE(dio, whether to enable direct I/O support, ++[ --enable-dio Enable direct I/O support]) ++ ++if test "$PHP_DIO" != "no"; then ++ PHP_NEW_EXTENSION(dio, dio.c dio_common.c dio_posix.c dio_stream_wrappers.c, $ext_shared) ++fi +--- /dev/null ++++ b/ext/dio/dio.c +@@ -0,0 +1,871 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | PHP Version 5 | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 1997-2009 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | 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: Sterling Hughes | ++ | Author: Melanie Rhianna Lewis | ++ +----------------------------------------------------------------------+ ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include "php.h" ++#include "php_ini.h" ++#include "ext/standard/info.h" ++ ++#include "php_dio.h" ++#include "php_dio_stream_wrappers.h" ++ ++#include ++#include ++ ++#ifdef HAVE_UNISTD_H ++#include ++#endif ++ ++#include ++#ifndef PHP_WIN32 ++#include ++#endif ++ ++/* e.g. IRIX does not have CRTSCTS */ ++#ifndef CRTSCTS ++# ifdef CNEW_RTSCTS ++# define CRTSCTS CNEW_RTSCTS ++# else ++# define CRTSCTS 0 ++# endif /* CNEW_RTSCTS */ ++#endif /* !CRTSCTS */ ++ ++/* ++ +----------------------------------------------------------------------+ ++ | DEPRECATED FUNCTIONALITY | ++ +----------------------------------------------------------------------+ ++ | The functions below are from the earlier DIO versions. They will | ++ | continue to be maintained but not extended. It is thoroughly | ++ | recommended that you should use either the stream wrappers or the | ++ | DIO classes in new code. - Melanie | ++ +----------------------------------------------------------------------+ ++ */ ++ ++#define le_fd_name "Direct I/O File Descriptor" ++static int le_fd; ++ ++static int new_php_fd(php_fd_t **f, int fd) ++{ ++ if (!(*f = malloc(sizeof(php_fd_t)))) { ++ return 0; ++ } ++ (*f)->fd = fd; ++ return 1; ++} ++ ++static void _dio_close_fd(zend_rsrc_list_entry *rsrc TSRMLS_DC) ++{ ++ php_fd_t *f = (php_fd_t *) rsrc->ptr; ++ if (f) { ++ close(f->fd); ++ free(f); ++ } ++} ++ ++/* {{{ proto resource dio_open(string filename, int flags[, int mode]) ++ Open a new filename with specified permissions of flags and creation permissions of mode */ ++PHP_FUNCTION(dio_open) ++{ ++ php_fd_t *f; ++ char *file_name; ++ int file_name_length; ++ long flags; ++ long mode = 0; ++ int fd; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "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+")) { ++ RETURN_FALSE; ++ } ++ ++ if (ZEND_NUM_ARGS() == 3) { ++ fd = open(file_name, flags, mode); ++ } else { ++ fd = open(file_name, flags); ++ } ++ ++ 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)); ++ RETURN_FALSE; ++ } ++ ++ if (!new_php_fd(&f, fd)) { ++ RETURN_FALSE; ++ } ++ ++ ZEND_REGISTER_RESOURCE(return_value, f, le_fd); ++} ++/* }}} */ ++ ++#ifndef PHP_WIN32 ++ ++/* {{{ proto resource dio_fdopen(int fd) ++ Returns a resource for the specified file descriptor. */ ++PHP_FUNCTION(dio_fdopen) ++{ ++ php_fd_t *f; ++ long lfd; ++ int fd; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "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); ++ RETURN_FALSE; ++ } ++ ++ if (!new_php_fd(&f, fd)) { ++ RETURN_FALSE; ++ } ++ ++ ZEND_REGISTER_RESOURCE(return_value, f, le_fd); ++} ++/* }}} */ ++ ++ ++/* {{{ proto resource dio_dup(resource fd) ++ Opens a duplicate of the specified open resource. */ ++PHP_FUNCTION(dio_dup) ++{ ++ zval *r_fd; ++ php_fd_t *f, *df; ++ int dfd; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fd) == FAILURE) { ++ return; ++ } ++ ++ ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); ++ ++ 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)); ++ RETURN_FALSE; ++ } ++ ++ if (!new_php_fd(&df, dfd)) { ++ RETURN_FALSE; ++ } ++ ++ ZEND_REGISTER_RESOURCE(return_value, df, le_fd); ++} ++/* }}} */ ++#endif ++ ++/* {{{ proto string dio_read(resource fd[, int n]) ++ Read n bytes from fd and return them, if n is not specified, read 1k */ ++PHP_FUNCTION(dio_read) ++{ ++ zval *r_fd; ++ php_fd_t *f; ++ char *data; ++ long bytes = 1024; ++ ssize_t res; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &r_fd, &bytes) == FAILURE) { ++ return; ++ } ++ ++ ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); ++ ++ if (bytes <= 0) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0."); ++ RETURN_FALSE; ++ } ++ ++ data = emalloc(bytes + 1); ++ res = read(f->fd, data, bytes); ++ if (res <= 0) { ++ efree(data); ++ RETURN_NULL(); ++ } ++ ++ data = erealloc(data, res + 1); ++ data[res] = 0; ++ ++ RETURN_STRINGL(data, res, 0); ++} ++/* }}} */ ++ ++/* {{{ proto int dio_write(resource fd, string data[, int len]) ++ Write data to fd with optional truncation at length */ ++PHP_FUNCTION(dio_write) ++{ ++ zval *r_fd; ++ php_fd_t *f; ++ char *data; ++ int data_len; ++ 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) { ++ 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."); ++ RETURN_FALSE; ++ } ++ ++ ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); ++ ++ 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)); ++ } ++ ++ RETURN_LONG(res); ++} ++/* }}} */ ++ ++#ifndef PHP_WIN32 ++ ++/* {{{ proto bool dio_truncate(resource fd, int offset) ++ Truncate file descriptor fd to offset bytes */ ++PHP_FUNCTION(dio_truncate) ++{ ++ zval *r_fd; ++ php_fd_t *f; ++ long offset; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &r_fd, &offset) == FAILURE) { ++ return; ++ } ++ ++ ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); ++ ++ 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)); ++ RETURN_FALSE; ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++#endif ++ ++#define ADD_FIELD(f, v) add_assoc_long_ex(return_value, (f), sizeof(f), v); ++ ++/* {{{ proto array dio_stat(resource fd) ++ Get stat information about the file descriptor fd */ ++PHP_FUNCTION(dio_stat) ++{ ++ zval *r_fd; ++ php_fd_t *f; ++ struct stat s; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fd) == FAILURE) { ++ return; ++ } ++ ++ ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); ++ ++ if (fstat(f->fd, &s) == -1) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot stat %d: %s", f->fd, strerror(errno)); ++ RETURN_FALSE; ++ } ++ ++ array_init(return_value); ++ ADD_FIELD("device", s.st_dev); ++ ADD_FIELD("inode", s.st_ino); ++ ADD_FIELD("mode", s.st_mode); ++ ADD_FIELD("nlink", s.st_nlink); ++ ADD_FIELD("uid", s.st_uid); ++ ADD_FIELD("gid", s.st_gid); ++ ADD_FIELD("device_type", s.st_rdev); ++ ADD_FIELD("size", s.st_size); ++#ifndef PHP_WIN32 ++ ADD_FIELD("block_size", s.st_blksize); ++ ADD_FIELD("blocks", s.st_blocks); ++#endif ++ ADD_FIELD("atime", s.st_atime); ++ ADD_FIELD("mtime", s.st_mtime); ++ ADD_FIELD("ctime", s.st_ctime); ++} ++/* }}} */ ++ ++/* {{{ proto int dio_seek(resource fd, int pos, int whence) ++ Seek to pos on fd from whence */ ++PHP_FUNCTION(dio_seek) ++{ ++ zval *r_fd; ++ php_fd_t *f; ++ long offset; ++ long whence = SEEK_SET; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &r_fd, &offset, &whence) == FAILURE) { ++ return; ++ } ++ ++ ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); ++ ++ RETURN_LONG(lseek(f->fd, offset, whence)); ++} ++/* }}} */ ++ ++#ifndef PHP_WIN32 ++ ++/* {{{ proto mixed dio_fcntl(resource fd, int cmd[, mixed arg]) ++ Perform a c library fcntl on fd */ ++PHP_FUNCTION(dio_fcntl) ++{ ++ zval *r_fd; ++ zval *arg = NULL; ++ php_fd_t *f; ++ long cmd; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &r_fd, &cmd, &arg) == FAILURE) { ++ return; ++ } ++ ++ ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); ++ ++ switch (cmd) { ++ case F_SETLK: ++ case F_SETLKW: { ++ zval **element; ++ struct flock lk = {0}; ++ HashTable *fh; ++ ++ if (!arg) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be array or int, none given"); ++ RETURN_FALSE; ++ } ++ if (Z_TYPE_P(arg) == IS_ARRAY) { ++ fh = HASH_OF(arg); ++ if (zend_hash_find(fh, "start", sizeof("start"), (void **) &element) == FAILURE) { ++ lk.l_start = 0; ++ } else { ++ lk.l_start = Z_LVAL_PP(element); ++ } ++ ++ if (zend_hash_find(fh, "length", sizeof("length"), (void **) &element) == FAILURE) { ++ lk.l_len = 0; ++ } else { ++ lk.l_len = Z_LVAL_PP(element); ++ } ++ ++ if (zend_hash_find(fh, "whence", sizeof("whence"), (void **) &element) == FAILURE) { ++ lk.l_whence = 0; ++ } else { ++ lk.l_whence = Z_LVAL_PP(element); ++ } ++ ++ if (zend_hash_find(fh, "type", sizeof("type"), (void **) &element) == FAILURE) { ++ lk.l_type = 0; ++ } else { ++ lk.l_type = Z_LVAL_PP(element); ++ } ++ } else if (Z_TYPE_P(arg) == IS_LONG) { ++ lk.l_start = 0; ++ lk.l_len = 0; ++ 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)); ++ RETURN_FALSE; ++ } ++ ++ RETURN_LONG(fcntl(f->fd, cmd, &lk)); ++ break; ++ } ++ case F_GETLK: { ++ struct flock lk = {0}; ++ ++ fcntl(f->fd, cmd, &lk); ++ ++ array_init(return_value); ++ add_assoc_long(return_value, "type", lk.l_type); ++ add_assoc_long(return_value, "whence", lk.l_whence); ++ add_assoc_long(return_value, "start", lk.l_start); ++ add_assoc_long(return_value, "length", lk.l_len); ++ add_assoc_long(return_value, "pid", lk.l_pid); ++ ++ break; ++ } ++ case F_DUPFD: { ++ 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"); ++ RETURN_FALSE; ++ } ++ ++ 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); ++ break; ++ } ++ default: ++ if (!arg || Z_TYPE_P(arg) != IS_LONG) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be int"); ++ RETURN_FALSE; ++ } ++ ++ RETURN_LONG(fcntl(f->fd, cmd, Z_LVAL_P(arg))); ++ } ++} ++/* }}} */ ++#endif ++ ++#ifndef PHP_WIN32 ++ ++/* {{{ proto mixed dio_tcsetattr(resource fd, array args ) ++ Perform a c library tcsetattr on fd */ ++PHP_FUNCTION(dio_tcsetattr) ++{ ++ zval *r_fd; ++ zval *arg = NULL; ++ php_fd_t *f; ++ struct termios newtio; ++ 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; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &r_fd, &arg) == FAILURE) { ++ return; ++ } ++ ++ ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); ++ ++ if (Z_TYPE_P(arg) != IS_ARRAY) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING,"tcsetattr, third argument should be an associative array"); ++ return; ++ } ++ ++ fh = HASH_OF(arg); ++ ++ if (zend_hash_find(fh, "baud", sizeof("baud"), (void **) &element) == FAILURE) { ++ Baud_Rate = 9600; ++ } else { ++ Baud_Rate = Z_LVAL_PP(element); ++ } ++ ++ if (zend_hash_find(fh, "bits", sizeof("bits"), (void **) &element) == FAILURE) { ++ Data_Bits = 8; ++ } else { ++ Data_Bits = Z_LVAL_PP(element); ++ } ++ ++ if (zend_hash_find(fh, "stop", sizeof("stop"), (void **) &element) == FAILURE) { ++ Stop_Bits = 1; ++ } else { ++ Stop_Bits = Z_LVAL_PP(element); ++ } ++ ++ if (zend_hash_find(fh, "parity", sizeof("parity"), (void **) &element) == FAILURE) { ++ Parity = 0; ++ } else { ++ Parity = Z_LVAL_PP(element); ++ } ++ ++ if (zend_hash_find(fh, "flow_control", sizeof("flow_control"), (void **) &element) == FAILURE) { ++ Flow_Control = 1; ++ } else { ++ Flow_Control = Z_LVAL_PP(element); ++ } ++ ++ if (zend_hash_find(fh, "is_canonical", sizeof("is_canonical"), (void **) &element) == FAILURE) { ++ Is_Canonical = 0; ++ } else { ++ Is_Canonical = Z_LVAL_PP(element); ++ } ++ ++ /* assign to correct values... */ ++ switch (Baud_Rate) { ++ case 38400: ++ BAUD = B38400; ++ break; ++ case 19200: ++ BAUD = B19200; ++ break; ++ case 9600: ++ BAUD = B9600; ++ break; ++ case 4800: ++ BAUD = B4800; ++ break; ++ case 2400: ++ BAUD = B2400; ++ break; ++ case 1800: ++ BAUD = B1800; ++ break; ++ case 1200: ++ BAUD = B1200; ++ break; ++ case 600: ++ BAUD = B600; ++ break; ++ case 300: ++ BAUD = B300; ++ break; ++ case 200: ++ BAUD = B200; ++ break; ++ case 150: ++ BAUD = B150; ++ break; ++ case 134: ++ BAUD = B134; ++ break; ++ case 110: ++ BAUD = B110; ++ break; ++ case 75: ++ BAUD = B75; ++ break; ++ case 50: ++ BAUD = B50; ++ break; ++ default: ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid baud rate %d", Baud_Rate); ++ RETURN_FALSE; ++ } ++ switch (Data_Bits) { ++ case 8: ++ DATABITS = CS8; ++ break; ++ case 7: ++ DATABITS = CS7; ++ break; ++ case 6: ++ DATABITS = CS6; ++ break; ++ case 5: ++ DATABITS = CS5; ++ break; ++ default: ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data bits %d", Data_Bits); ++ RETURN_FALSE; ++ } ++ switch (Stop_Bits) { ++ case 1: ++ STOPBITS = 0; ++ break; ++ case 2: ++ STOPBITS = CSTOPB; ++ break; ++ default: ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop bits %d", Stop_Bits); ++ RETURN_FALSE; ++ } ++ ++ switch (Parity) { ++ case 0: ++ PARITYON = 0; ++ PARITY = 0; ++ break; ++ case 1: ++ PARITYON = PARENB; ++ PARITY = PARODD; ++ break; ++ case 2: ++ PARITYON = PARENB; ++ PARITY = 0; ++ break; ++ default: ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity %d", Parity); ++ RETURN_FALSE; ++ } ++ ++ memset(&newtio, 0, sizeof(newtio)); ++ tcgetattr(f->fd, &newtio); ++ ++ if (Is_Canonical) { ++ newtio.c_iflag = IGNPAR | ICRNL; ++ newtio.c_oflag = 0; ++ newtio.c_lflag = ICANON; ++ } else { ++ cfmakeraw(&newtio); ++ } ++ ++ newtio.c_cflag = BAUD | DATABITS | STOPBITS | PARITYON | PARITY | CLOCAL | CREAD; ++ ++#ifdef CRTSCTS ++ if (Flow_Control) { ++ newtio.c_cflag |= CRTSCTS; ++ } ++#endif ++ ++ if (Is_Canonical) ++ ++ newtio.c_cc[VMIN] = 1; ++ newtio.c_cc[VTIME] = 0; ++ tcflush(f->fd, TCIFLUSH); ++ tcsetattr(f->fd,TCSANOW,&newtio); ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++#endif ++ ++/* {{{ proto void dio_close(resource fd) ++ Close the file descriptor given by fd */ ++PHP_FUNCTION(dio_close) ++{ ++ zval *r_fd; ++ php_fd_t *f; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fd) == FAILURE) { ++ return; ++ } ++ ++ ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); ++ ++ zend_list_delete(Z_LVAL_P(r_fd)); ++} ++/* }}} */ ++ ++#define RDIOC(c) REGISTER_LONG_CONSTANT(#c, c, CONST_CS | CONST_PERSISTENT) ++ ++/* {{{ dio_init_legacy_defines ++ * Initialises the legacy PHP defines ++ */ ++static void dio_init_legacy_defines(int module_number TSRMLS_DC) { ++ RDIOC(O_RDONLY); ++ RDIOC(O_WRONLY); ++ RDIOC(O_RDWR); ++ RDIOC(O_CREAT); ++ RDIOC(O_EXCL); ++ RDIOC(O_TRUNC); ++ RDIOC(O_APPEND); ++#ifdef O_NONBLOCK ++ RDIOC(O_NONBLOCK); ++#endif ++#ifdef O_NDELAY ++ RDIOC(O_NDELAY); ++#endif ++#ifdef O_SYNC ++ RDIOC(O_SYNC); ++#endif ++#ifdef O_ASYNC ++ RDIOC(O_ASYNC); ++#endif ++#ifdef O_NOCTTY ++ RDIOC(O_NOCTTY); ++#endif ++#ifndef PHP_WIN32 ++ RDIOC(S_IRWXU); ++ RDIOC(S_IRUSR); ++ RDIOC(S_IWUSR); ++ RDIOC(S_IXUSR); ++ RDIOC(S_IRWXG); ++ RDIOC(S_IRGRP); ++ RDIOC(S_IWGRP); ++ RDIOC(S_IXGRP); ++ RDIOC(S_IRWXO); ++ RDIOC(S_IROTH); ++ RDIOC(S_IWOTH); ++ RDIOC(S_IXOTH); ++ RDIOC(F_DUPFD); ++ RDIOC(F_GETFD); ++ RDIOC(F_GETFL); ++ RDIOC(F_SETFL); ++ RDIOC(F_GETLK); ++ RDIOC(F_SETLK); ++ RDIOC(F_SETLKW); ++ RDIOC(F_SETOWN); ++ RDIOC(F_GETOWN); ++ RDIOC(F_UNLCK); ++ RDIOC(F_RDLCK); ++ RDIOC(F_WRLCK); ++#endif ++} ++ ++ZEND_BEGIN_ARG_INFO_EX(dio_open_args, 0, 0, 2) ++ ZEND_ARG_INFO(0, filename) ++ ZEND_ARG_INFO(0, flags) ++ ZEND_ARG_INFO(0, mode) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_INFO_EX(dio_fdopen_args, 0, 0, 1) ++ ZEND_ARG_INFO(0, fd) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_INFO_EX(dio_dup_args, 0, 0, 1) ++ ZEND_ARG_INFO(0, fd) ++ZEND_END_ARG_INFO() ++ ++ ++ZEND_BEGIN_ARG_INFO_EX(dio_read_args, 0, 0, 1) ++ ZEND_ARG_INFO(0, fd) ++ ZEND_ARG_INFO(0, n) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_INFO_EX(dio_write_args, 0, 0, 2) ++ ZEND_ARG_INFO(0, fd) ++ ZEND_ARG_INFO(0, data) ++ ZEND_ARG_INFO(0, len) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_INFO_EX(dio_stat_args, 0, 0, 1) ++ ZEND_ARG_INFO(0, fd) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_INFO_EX(dio_truncate_args, 0, 0, 2) ++ ZEND_ARG_INFO(0, fd) ++ ZEND_ARG_INFO(0, offset) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_INFO_EX(dio_seek_args, 0, 0, 3) ++ ZEND_ARG_INFO(0, fd) ++ ZEND_ARG_INFO(0, pos) ++ ZEND_ARG_INFO(0, whence) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_INFO_EX(dio_fcntl_args, 0, 0, 2) ++ ZEND_ARG_INFO(0, fd) ++ ZEND_ARG_INFO(0, cmd) ++ ZEND_ARG_INFO(0, arg) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_INFO_EX(dio_tcsetattr_args, 0, 0, 2) ++ ZEND_ARG_INFO(0, fd) ++ ZEND_ARG_INFO(0, args) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_INFO_EX(dio_close_args, 0, 0, 1) ++ ZEND_ARG_INFO(0, fd) ++ZEND_END_ARG_INFO() ++ ++/* ++ +----------------------------------------------------------------------+ ++ | END OF DEPRECATED FUNCTIONALITY | ++ +----------------------------------------------------------------------+ ++ */ ++ ++ZEND_BEGIN_ARG_INFO_EX(dio_raw_args, 0, 0, 2) ++ ZEND_ARG_INFO(0, filename) ++ ZEND_ARG_INFO(0, mode) ++ ZEND_ARG_INFO(0, options) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_INFO_EX(dio_serial_args, 0, 0, 2) ++ ZEND_ARG_INFO(0, filename) ++ ZEND_ARG_INFO(0, mode) ++ ZEND_ARG_INFO(0, options) ++ZEND_END_ARG_INFO() ++ ++static zend_object_handlers dio_raw_object_handlers; ++ ++static zend_function_entry dio_functions[] = { ++ /* Class functions. */ ++ ++ /* Legacy functions (Deprecated - See dio_legacy.c) */ ++ PHP_FE(dio_open, dio_open_args) ++#ifndef PHP_WIN32 ++ PHP_FE(dio_fdopen, dio_fdopen_args) ++ PHP_FE(dio_dup, dio_dup_args) ++ PHP_FE(dio_truncate, dio_truncate_args) ++#endif ++ PHP_FE(dio_stat, dio_stat_args) ++ PHP_FE(dio_seek, dio_seek_args) ++#ifndef PHP_WIN32 ++ PHP_FE(dio_fcntl, dio_fcntl_args) ++#endif ++ PHP_FE(dio_read, dio_read_args) ++ PHP_FE(dio_write, dio_write_args) ++ PHP_FE(dio_close, dio_close_args) ++#ifndef PHP_WIN32 ++ PHP_FE(dio_tcsetattr, dio_tcsetattr_args) ++#endif ++ ++ /* Stream functions */ ++ PHP_FE(dio_raw, dio_raw_args) ++ PHP_FE(dio_serial, dio_serial_args) ++ ++ /* End of functions */ ++ {NULL, NULL, NULL} ++}; ++ ++zend_module_entry dio_module_entry = { ++ STANDARD_MODULE_HEADER, ++ "dio", ++ dio_functions, ++ PHP_MINIT(dio), ++ NULL, ++ NULL, ++ NULL, ++ PHP_MINFO(dio), ++ PHP_DIO_VERSION, ++ STANDARD_MODULE_PROPERTIES ++}; ++ ++#ifdef COMPILE_DL_DIO ++ZEND_GET_MODULE(dio) ++#endif ++ ++#define DIO_UNDEF_CONST -1 ++ ++/* {{{ PHP_MINIT_FUNCTION ++ */ ++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); ++ ++ /* 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; ++} ++/* }}} */ ++ ++/* {{{ PHP_MSHUTDOWN_FUNCTION ++ */ ++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; ++} ++/* }}} */ ++ ++/* {{{ PHP_MINFO_FUNCTION ++ */ ++PHP_MINFO_FUNCTION(dio) ++{ ++ php_info_print_table_start(); ++ php_info_print_table_header(2, "dio support", "enabled"); ++ php_info_print_table_row(2, "version", PHP_DIO_VERSION); ++ php_info_print_table_end(); ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * c-basic-offset: 4 ++ * tab-width: 4 ++ * End: ++ * vim600: fdm=marker ++ * vim: sw=4 ts=4 noet ++ */ +--- /dev/null ++++ b/ext/dio/dio_common.c +@@ -0,0 +1,230 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | 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 | ++ +----------------------------------------------------------------------+ ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include "php.h" ++ ++#include "php_dio.h" ++#include "php_dio_common.h" ++ ++/* {{{ dio_init_stream_data ++ * Initialises the command parts of the stream data. ++ */ ++void dio_init_stream_data(php_dio_stream_data *data) { ++ data->stream_type = DIO_STREAM_TYPE_NONE; ++ data->end_of_file = 0; ++#ifdef DIO_HAS_FILEPERMS ++ data->has_perms = 0; ++ data->perms = 0; ++#endif ++#ifdef DIO_NONBLOCK ++ data->is_blocking = 1; ++ data->has_timeout = 0; ++ data->timeout_sec = 0; ++ data->timeout_usec = 0; ++ data->timed_out = 0; ++#endif ++ /* Serial options */ ++ data->data_rate = 9600; ++ data->data_bits = 8; ++ data->stop_bits = 1; ++ data->parity = 0; ++ data->flow_control = 1; ++ data->canonical = 1; ++} ++/* }}} */ ++ ++/* {{{ 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(©val); ++ ++ 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; ++ HashTable *opthash; ++ ++ opthash = HASH_OF(options); ++#endif ++ ++#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); ++ data->has_perms = 1; ++ } ++#endif ++ ++#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; ++ } ++ ++ /* 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); ++ } ++ ++ /* 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); ++ } ++ ++ data->has_timeout = (data->timeout_sec | data->timeout_usec) ? 1 : 0; ++#endif ++} ++/* }}} */ ++ ++/* {{{ 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) { ++ 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 (zend_hash_find(opthash, "data_bits", sizeof("data_bits"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) { ++ data->data_bits = (int)dio_convert_to_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 (zend_hash_find(opthash, "parity", sizeof("parity"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) { ++ data->parity = (int)dio_convert_to_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 (zend_hash_find(opthash, "is_canonical", sizeof("is_canonical"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) { ++ data->canonical = (int)(dio_convert_to_long(*tmpzval) ? 1 : 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ 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) { ++#if defined(DIO_HAS_FILEPERMS) || defined(DIO_NONBLOCK) ++ 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); ++ data->has_perms = 1; ++ } ++#endif ++ ++#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; ++ } ++ ++ /* 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); ++ } ++ ++ /* 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); ++ } ++ ++ data->has_timeout = (data->timeout_sec | data->timeout_usec) ? 1 : 0; ++#endif ++} ++/* }}} */ ++ ++/* {{{ 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) { ++ 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 (php_stream_context_get_option(context, "dio", "data_bits", &tmpzval) == SUCCESS && tmpzval && *tmpzval) { ++ data->data_bits = (int)dio_convert_to_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 (php_stream_context_get_option(context, "dio", "parity", &tmpzval) == SUCCESS && tmpzval && *tmpzval) { ++ data->parity = (int)dio_convert_to_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 (php_stream_context_get_option(context, "dio", "is_canonical", &tmpzval) == SUCCESS && tmpzval && *tmpzval) { ++ data->canonical = (int)(dio_convert_to_long(*tmpzval) ? 1 : 0); ++ } ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * c-basic-offset: 4 ++ * tab-width: 4 ++ * End: ++ * vim600: fdm=marker ++ * vim: sw=4 ts=4 noet ++ */ ++ +--- /dev/null ++++ b/ext/dio/dio_posix.c +@@ -0,0 +1,659 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | 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 | ++ +----------------------------------------------------------------------+ ++ */ ++ ++#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 ++ */ +--- /dev/null ++++ b/ext/dio/dio_stream_wrappers.c +@@ -0,0 +1,406 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | 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 | ++ +----------------------------------------------------------------------+ ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include "php.h" ++#include "ext/standard/url.h" ++ ++#include "php_dio.h" ++#include "php_dio_common.h" ++#include "php_dio_stream_wrappers.h" ++ ++/* ++ +----------------------------------------------------------------------+ ++ | Raw stream handling | ++ +----------------------------------------------------------------------+ ++*/ ++ ++/* {{{ dio_stream_write ++ * Write to the stream ++ */ ++static size_t dio_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) ++{ ++ return dio_common_write((php_dio_stream_data*)stream->abstract, buf, count); ++} ++/* }}} */ ++ ++/* {{{ dio_stream_read ++ * Read from the stream ++ */ ++static size_t dio_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) ++{ ++ php_dio_stream_data* data = (php_dio_stream_data*)stream->abstract; ++ size_t bytes = dio_common_read(data, buf, count); ++ stream->eof = data->end_of_file; ++ ++ return bytes; ++} ++/* }}} */ ++ ++/* {{{ dio_stream_flush ++ * Flush the stream. For raw streams this does nothing. ++ */ ++static int dio_stream_flush(php_stream *stream TSRMLS_DC) ++{ ++ return 1; ++} ++/* }}} */ ++ ++/* {{{ dio_stream_close ++ * Close the stream ++ */ ++static int dio_stream_close(php_stream *stream, int close_handle TSRMLS_DC) ++{ ++ php_dio_stream_data *abstract = (php_dio_stream_data*)stream->abstract; ++ ++ if (!dio_common_close(abstract)) { ++ return 0; ++ } ++ ++ efree(abstract); ++ return 1; ++} ++/* }}} */ ++ ++/* {{{ 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) ++{ ++ php_dio_stream_data *abstract = (php_dio_stream_data*)stream->abstract; ++ ++ switch (option) { ++ case PHP_STREAM_OPTION_META_DATA_API: ++#ifdef DIO_NONBLOCK ++ add_assoc_bool((zval *)ptrparam, "timed_out", abstract->timed_out); ++ add_assoc_bool((zval *)ptrparam, "blocked", abstract->is_blocking); ++#endif ++ add_assoc_bool((zval *)ptrparam, "eof", stream->eof); ++ return PHP_STREAM_OPTION_RETURN_OK; ++ ++#if PHP_MAJOR_VERSION >= 5 ++ case PHP_STREAM_OPTION_CHECK_LIVENESS: ++ stream->eof = abstract->end_of_file; ++ return PHP_STREAM_OPTION_RETURN_OK; ++#endif /* PHP_MAJOR_VERSION >= 5 */ ++ ++ default: ++ break; ++ } ++ ++ return dio_common_set_option(abstract, option, value, ptrparam); ++} ++/* }}} */ ++ ++php_stream_ops dio_raw_stream_ops = { ++ dio_stream_write, ++ dio_stream_read, ++ dio_stream_close, ++ dio_stream_flush, ++ "dio", ++ NULL, /* seek */ ++ NULL, /* cast */ ++ NULL, /* stat */ ++ dio_stream_set_option, ++}; ++ ++/* {{{ dio_raw_fopen_wrapper ++ * 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) { ++ php_dio_stream_data *data; ++ php_stream *stream; ++ char *filename; ++ ++ /* Check it was actually for us (not a corrupted function pointer ++ somewhere!). */ ++ if (strncmp(path, DIO_RAW_STREAM_PROTOCOL, sizeof(DIO_RAW_STREAM_PROTOCOL) - 1)) { ++ return NULL; ++ } ++ ++ /* Get the actually file system name/path. */ ++ 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)) { ++ return NULL; ++ } ++ ++ data = dio_create_stream_data(); ++ data->stream_type = DIO_STREAM_TYPE_RAW; ++ ++ /* Parse the context. */ ++ if (context) { ++ dio_stream_context_get_basic_options(context, data TSRMLS_CC); ++ } ++ ++ /* Try and open a raw stream. */ ++ if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) { ++ return NULL; ++ } ++ ++ /* Create a PHP stream based on raw stream */ ++ stream = php_stream_alloc(&dio_raw_stream_ops, data, 0, mode); ++ if (!stream) { ++ (void) dio_common_close(data); ++ efree(data); ++ } ++ ++ return stream; ++} ++/* }}} */ ++ ++static php_stream_wrapper_ops dio_raw_stream_wops = { ++ dio_raw_fopen_wrapper, ++ NULL, /* stream_close */ ++ NULL, /* stat */ ++ NULL, /* stat_url */ ++ NULL, /* opendir */ ++ DIO_RAW_STREAM_NAME ++}; ++ ++php_stream_wrapper php_dio_raw_stream_wrapper = { ++ &dio_raw_stream_wops, ++ NULL, ++ 0 ++}; ++ ++/* {{{ proto dio_raw(string filename, string mode[, array options]) ++ * Opens a raw direct IO stream. ++ */ ++PHP_FUNCTION(dio_raw) { ++ zval *options = NULL; ++ php_dio_stream_data *data; ++ php_stream *stream; ++ ++ char *filename; ++ int filename_len; ++ char *mode; ++ int mode_len; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "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)) { ++ RETURN_FALSE; ++ } ++ ++ /* Check we can actually access the file. */ ++ if (php_check_open_basedir(filename TSRMLS_CC) || DIO_SAFE_MODE_CHECK(filename, mode)) { ++ RETURN_FALSE; ++ } ++ ++ data = dio_create_stream_data(); ++ data->stream_type = DIO_STREAM_TYPE_RAW; ++ ++ if (options) { ++ dio_assoc_array_get_basic_options(options, data TSRMLS_CC); ++ } ++ ++ /* Try and open a raw stream. */ ++ if (dio_raw_open_stream(filename, mode, data TSRMLS_CC)) { ++ stream = php_stream_alloc(&dio_raw_stream_ops, data, 0, mode); ++ if (!stream) { ++ (void) dio_common_close(data); ++ efree(data); ++ RETURN_FALSE; ++ } ++ } ++ ++ php_stream_to_zval(stream, return_value); ++} ++/* }}} */ ++ ++/* ++ +----------------------------------------------------------------------+ ++ | Serial stream handling | ++ +----------------------------------------------------------------------+ ++*/ ++ ++/* {{{ dio_stream_flush ++ * Flush the stream. If the stream is read only, it flushes the read ++ * 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) ++{ ++ return dio_serial_purge((php_dio_stream_data*)stream->abstract); ++} ++/* }}} */ ++ ++/* {{{ dio_stream_close ++ * 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) ++{ ++ php_dio_stream_data *abstract = (php_dio_stream_data*)stream->abstract; ++ ++ if (!dio_serial_uninit(abstract)) { ++ return 0; ++ } ++ ++ if (!dio_common_close(abstract)) { ++ return 0; ++ } ++ ++ efree(abstract); ++ return 1; ++} ++/* }}} */ ++ ++php_stream_ops dio_serial_stream_ops = { ++ dio_stream_write, ++ dio_stream_read, ++ dio_serial_stream_close, ++ dio_serial_stream_flush, ++ "dio", ++ NULL, /* seek */ ++ NULL, /* cast */ ++ NULL, /* stat */ ++ dio_stream_set_option, ++}; ++ ++/* {{{ dio_raw_fopen_wrapper ++ * 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) { ++ php_dio_stream_data *data; ++ php_stream *stream; ++ char *filename; ++ ++ /* Check it was actually for us (not a corrupted function pointer ++ somewhere!). */ ++ if (strncmp(path, DIO_SERIAL_STREAM_PROTOCOL, sizeof(DIO_SERIAL_STREAM_PROTOCOL) - 1)) { ++ return NULL; ++ } ++ ++ /* Get the actually file system name/path. */ ++ 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)) { ++ return NULL; ++ } ++ ++ data = dio_create_stream_data(); ++ data->stream_type = DIO_STREAM_TYPE_SERIAL; ++ ++ /* 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); ++ } ++ ++ /* Try and open a serial stream. */ ++ if (!dio_serial_open_stream(filename, mode, data TSRMLS_CC)) { ++ return NULL; ++ } ++ ++ stream = php_stream_alloc(&dio_serial_stream_ops, data, 0, mode); ++ if (!stream) { ++ efree(data); ++ } ++ ++ return stream; ++} ++/* }}} */ ++ ++static php_stream_wrapper_ops dio_serial_stream_wops = { ++ dio_serial_fopen_wrapper, ++ NULL, /* stream_close */ ++ NULL, /* stat */ ++ NULL, /* stat_url */ ++ NULL, /* opendir */ ++ DIO_SERIAL_STREAM_NAME ++}; ++ ++php_stream_wrapper php_dio_serial_stream_wrapper = { ++ &dio_serial_stream_wops, ++ NULL, ++ 0 ++}; ++ ++/* {{{ proto dio_serial(string filename, string mode[, array options]) ++ * Opens a serial direct IO stream. ++ */ ++PHP_FUNCTION(dio_serial) { ++ zval *options = NULL; ++ php_dio_stream_data *data; ++ php_stream *stream; ++ ++ char *filename; ++ int filename_len; ++ char *mode; ++ int mode_len; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "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"); ++ RETURN_FALSE; ++ } ++ ++ /* Check we can actually access the file. */ ++ if (php_check_open_basedir(filename TSRMLS_CC) || DIO_SAFE_MODE_CHECK(filename, mode)) { ++ RETURN_FALSE; ++ } ++ ++ data = dio_create_stream_data(); ++ 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); ++ } ++ ++ /* Try and open a serial stream. */ ++ if (dio_serial_open_stream(filename, mode, data TSRMLS_CC)) { ++ stream = php_stream_alloc(&dio_serial_stream_ops, data, 0, mode); ++ if (!stream) { ++ efree(data); ++ RETURN_FALSE; ++ } ++ } ++ ++ php_stream_to_zval(stream, return_value); ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * c-basic-offset: 4 ++ * tab-width: 4 ++ * End: ++ * vim600: fdm=marker ++ * vim: sw=4 ts=4 noet ++ */ +--- /dev/null ++++ b/ext/dio/dio_win32.c +@@ -0,0 +1,669 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | 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 | ++ +----------------------------------------------------------------------+ ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include "php.h" ++ ++#include "php_dio_common.h" ++ ++/* {{{ 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: ++ 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 = 0; ++ break; ++ case 2: ++ val = 2; ++ break; ++ case 3: ++ val = 1; ++ 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) { ++ switch (parity) { ++ case 0: ++ case 1: ++ case 2: ++ break; ++ default: ++ return 0; ++ } ++ ++ *def = (DWORD)parity; ++ 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) { ++ wdata->handle = CreateFile(filename, wdata->desired_access, 0, ++ NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); ++ if (INVALID_HANDLE_VALUE == wdata->handle) { ++ err = GetLastError(); ++ return 0; ++ } ++ } else { ++ return 0; ++ } ++ break; ++ ++ default: ++ 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 err, 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) (%d)", data->data_rate, __LINE__); ++ 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))) { ++ err = GetLastError(); ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "GetCommState() failed! (%d)", err); ++ 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)) { ++ 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 }; ++ DWORD err; ++ ++ if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) { ++ return 0; ++ } ++ ++ if (!GetCommTimeouts(wdata->handle, &(wdata->oldcto))) { ++ err = GetLastError(); ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "SetCommTimeouts() failed! (%d) Not a comm port?", err); ++ 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)) { ++ 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 ++ */ +--- /dev/null ++++ b/ext/dio/php_dio.h +@@ -0,0 +1,60 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | PHP Version 5 | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 1997-2004 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | 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. | ++ +----------------------------------------------------------------------+ ++ */ ++ ++#ifndef PHP_DIO_H ++#define PHP_DIO_H ++ ++#include "php.h" ++#include "php_dio_common.h" ++#include "php_dio_stream_wrappers.h" ++ ++extern zend_module_entry dio_module_entry; ++#define phpext_dio_ptr &dio_module_entry ++ ++#define PHP_DIO_VERSION "0.0.4RC4" ++ ++/* Standard module functions. */ ++PHP_MINIT_FUNCTION(dio); ++PHP_MSHUTDOWN_FUNCTION(dio); ++PHP_RINIT_FUNCTION(dio); ++PHP_RSHUTDOWN_FUNCTION(dio); ++PHP_MINFO_FUNCTION(dio); ++ ++/* Legacy functions. */ ++PHP_FUNCTION(dio_open); ++PHP_FUNCTION(dio_truncate); ++PHP_FUNCTION(dio_stat); ++PHP_FUNCTION(dio_seek); ++PHP_FUNCTION(dio_read); ++PHP_FUNCTION(dio_write); ++PHP_FUNCTION(dio_fcntl); ++PHP_FUNCTION(dio_close); ++PHP_FUNCTION(dio_tcsetattr); ++ ++typedef struct { ++ int fd; ++} php_fd_t; ++ ++#endif ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * indent-tabs-mode: t ++ * End: ++ */ +--- /dev/null ++++ b/ext/dio/php_dio_common.h +@@ -0,0 +1,77 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | 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 | ++ +----------------------------------------------------------------------+ ++ */ ++ ++#ifndef PHP_DIO_COMMON_H_ ++#define PHP_DIO_COMMON_H_ ++ ++#ifdef PHP_WIN32 ++#define PHP_DIO_API __declspec(dllexport) ++#else ++#define PHP_DIO_API ++#endif ++ ++#ifdef PHP_WIN32 ++#include "php_dio_win32.h" ++#else ++#include "php_dio_posix.h" ++#endif ++ ++#define DIO_STREAM_TYPE_NONE 0 ++#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); ++ ++void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data TSRMLS_DC); ++ ++void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data TSRMLS_DC); ++ ++void dio_stream_context_get_basic_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 TSRMLS_DC); ++ ++size_t dio_common_write(php_dio_stream_data *data, const char *buf, size_t count); ++ ++size_t dio_common_read(php_dio_stream_data *data, const char *buf, size_t count); ++ ++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_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); ++ ++#endif /* PHP_DIO_COMMON_H_ */ ++ ++/* ++ * Local variables: ++ * c-basic-offset: 4 ++ * tab-width: 4 ++ * End: ++ * vim600: fdm=marker ++ * vim: sw=4 ts=4 noet ++ */ +--- /dev/null ++++ b/ext/dio/php_dio_common_data.h +@@ -0,0 +1,59 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | 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 | ++ +----------------------------------------------------------------------+ ++ */ ++ ++#ifndef PHP_DIO_COMMON_DATA_H_ ++#define PHP_DIO_COMMON_DATA_H_ ++ ++/* This is the data structure 'base class'. It is common data fields used ++ * by all versions of DIO. ++ */ ++typedef struct _php_dio_stream_data { ++ /* Stream type */ ++ int stream_type; ++ /* Stream options */ ++ int end_of_file; ++#ifdef DIO_HAS_FILEPERMS ++ int has_perms; ++ int perms; ++#endif ++#ifdef DIO_NONBLOCK ++ int is_blocking; ++ int has_timeout; ++ long timeout_sec; ++ long timeout_usec; ++ int timed_out; ++#endif ++ /* Serial options */ ++ long data_rate; ++ int data_bits; ++ int stop_bits; ++ int parity; ++ int flow_control; ++ int canonical; ++} php_dio_stream_data ; ++ ++#endif /* PHP_DIO_COMMON_DATA_H_ */ ++ ++/* ++ * Local variables: ++ * c-basic-offset: 4 ++ * tab-width: 4 ++ * End: ++ * vim600: fdm=marker ++ * vim: sw=4 ts=4 noet ++ */ +--- /dev/null ++++ b/ext/dio/php_dio_posix.h +@@ -0,0 +1,70 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | 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 | ++ +----------------------------------------------------------------------+ ++ */ ++ ++#ifndef PHP_DIO_POSIX_H_ ++#define PHP_DIO_POSIX_H_ ++ ++#include ++#include ++#include ++#include ++ ++#ifdef HAVE_UNISTD_H ++#include ++#endif ++ ++#include ++#include ++ ++ ++/** ++ * Detect if we can support non blocking IO. ++ */ ++#ifdef O_NONBLOCK ++#define DIO_NONBLOCK O_NONBLOCK ++#else ++#ifdef O_NDELAY ++#define DIO_NONBLOCK O_NDELAY ++#endif ++#endif ++ ++/** ++ * POSIXy platforms have file permissions ++ */ ++#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 ++ */ +--- /dev/null ++++ b/ext/dio/php_dio_stream_wrappers.h +@@ -0,0 +1,51 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | 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 | ++ +----------------------------------------------------------------------+ ++ */ ++ ++#ifndef PHP_DIO_STREAM_WRAPPERS_H_ ++#define PHP_DIO_STREAM_WRAPPERS_H_ ++ ++#define DIO_RAW_STREAM_NAME "dio.raw" ++#define DIO_RAW_STREAM_PROTOCOL "dio.raw://" ++#define DIO_SERIAL_STREAM_NAME "dio.serial" ++#define DIO_SERIAL_STREAM_PROTOCOL "dio.serial://" ++ ++/* To support PHP 5.4 and later */ ++#if PHP_VERSION_ID < 50399 ++#define DIO_SAFE_MODE_CHECK(f, m) (PG(safe_mode) && !php_checkuid(f, m, CHECKUID_CHECK_MODE_PARAM)) ++#else ++#define DIO_SAFE_MODE_CHECK(f, m) (0) ++#endif ++ ++extern php_stream_wrapper php_dio_raw_stream_wrapper; ++ ++PHP_FUNCTION(dio_raw); ++ ++extern php_stream_wrapper php_dio_serial_stream_wrapper; ++ ++PHP_FUNCTION(dio_serial); ++ ++#endif /* PHP_DIO_STREAM_WRAPPERS_H_ */ ++ ++/* ++ * Local variables: ++ * c-basic-offset: 4 ++ * tab-width: 4 ++ * End: ++ * vim600: fdm=marker ++ * vim: sw=4 ts=4 noet ++ */ +--- /dev/null ++++ b/ext/dio/php_dio_win32.h +@@ -0,0 +1,62 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | 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 | ++ +----------------------------------------------------------------------+ ++ */ ++ ++#ifndef PHP_DIO_WIN32_H_ ++#define PHP_DIO_WIN32_H_ ++ ++#include ++ ++/* 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 ++ */ +--- /dev/null ++++ b/ext/dio/tests/001.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++Test dio legacy open ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECT-- ++Legacy open passed +--- /dev/null ++++ b/ext/dio/tests/dio_raw_stream_001.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++Test dio raw stream open ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECT-- ++Raw open passed +--- /dev/null ++++ b/ext/dio/tests/dio_raw_stream_002.phpt +@@ -0,0 +1,27 @@ ++--TEST-- ++Test dio raw stream close ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECT-- ++Raw close passed +--- /dev/null ++++ b/ext/dio/tests/dio_raw_stream_003.phpt +@@ -0,0 +1,29 @@ ++--TEST-- ++Test dio raw stream write ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECT-- ++Raw write passed +--- /dev/null ++++ b/ext/dio/tests/dio_raw_stream_004.phpt +@@ -0,0 +1,46 @@ ++--TEST-- ++Test dio raw read ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECT-- ++Raw read passed +--- /dev/null ++++ b/ext/dio/tests/dio_raw_stream_005.phpt +@@ -0,0 +1,45 @@ ++--TEST-- ++Test dio eof read ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECT-- ++Raw feof passed +--- /dev/null ++++ b/ext/dio/tests/dio_raw_stream_006.phpt +@@ -0,0 +1,46 @@ ++--TEST-- ++Test dio raw read ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECT-- ++Raw set blocking passed +--- /dev/null ++++ b/ext/dio/tests/dio_raw_stream_007.phpt +@@ -0,0 +1,22 @@ ++--TEST-- ++Test dio_raw() call ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECT-- ++dio_raw passed diff --git a/lang/php5/patches/011-PECL-dio-additional-baudrates.patch b/lang/php5/patches/011-PECL-dio-additional-baudrates.patch new file mode 100644 index 0000000..fc534d0 --- /dev/null +++ b/lang/php5/patches/011-PECL-dio-additional-baudrates.patch @@ -0,0 +1,29 @@ +--- a/ext/dio/dio.c ++++ b/ext/dio/dio.c +@@ -501,6 +501,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; diff --git a/lang/php5/patches/020-PECL-add-libevent.patch b/lang/php5/patches/020-PECL-add-libevent.patch new file mode 100644 index 0000000..7e8ede6 --- /dev/null +++ b/lang/php5/patches/020-PECL-add-libevent.patch @@ -0,0 +1,1857 @@ +--- /dev/null ++++ b/ext/libevent/CREDITS +@@ -0,0 +1 @@ ++Antony Dovgal, Arnaud Le Blanc +--- /dev/null ++++ b/ext/libevent/config.m4 +@@ -0,0 +1,52 @@ ++dnl $Id: config.m4 287913 2009-08-31 08:45:42Z tony2001 $ ++ ++PHP_ARG_WITH(libevent, for libevent support, ++[ --with-libevent Include libevent support]) ++ ++if test "$PHP_LIBEVENT" != "no"; then ++ SEARCH_PATH="/usr /usr/local" ++ SEARCH_FOR="/include/event.h" ++ ++ if test "$PHP_LIBEVENT" = "yes"; then ++ AC_MSG_CHECKING([for libevent headers in default path]) ++ for i in $SEARCH_PATH ; do ++ if test -r $i/$SEARCH_FOR; then ++ LIBEVENT_DIR=$i ++ AC_MSG_RESULT(found in $i) ++ fi ++ done ++ else ++ AC_MSG_CHECKING([for libevent headers in $PHP_LIBEVENT]) ++ if test -r $PHP_LIBEVENT/$SEARCH_FOR; then ++ LIBEVENT_DIR=$PHP_LIBEVENT ++ AC_MSG_RESULT([found]) ++ fi ++ fi ++ ++ if test -z "$LIBEVENT_DIR"; then ++ AC_MSG_RESULT([not found]) ++ AC_MSG_ERROR([Cannot find libevent headers]) ++ fi ++ ++ PHP_ADD_INCLUDE($LIBEVENT_DIR/include) ++ ++ LIBNAME=event ++ LIBSYMBOL=event_base_new ++ ++ if test "x$PHP_LIBDIR" = "x"; then ++ PHP_LIBDIR=lib ++ fi ++ ++ PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, ++ [ ++ PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $LIBEVENT_DIR/$PHP_LIBDIR, LIBEVENT_SHARED_LIBADD) ++ ],[ ++ AC_MSG_ERROR([wrong libevent version {1.4.+ is required} or lib not found]) ++ ],[ ++ -L$LIBEVENT_DIR/$PHP_LIBDIR ++ ]) ++ ++ PHP_ADD_EXTENSION_DEP(libevent, sockets, true) ++ PHP_SUBST(LIBEVENT_SHARED_LIBADD) ++ PHP_NEW_EXTENSION(libevent, libevent.c, $ext_shared) ++fi +--- /dev/null ++++ b/ext/libevent/libevent.c +@@ -0,0 +1,1663 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | PHP Version 5 | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 1997-2008 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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: Antony Dovgal | ++ | Arnaud Le Blanc | ++ +----------------------------------------------------------------------+ ++*/ ++ ++/* $Id: libevent.c 318910 2011-11-08 12:34:37Z tony2001 $ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include "php.h" ++#include "php_ini.h" ++#include "ext/standard/info.h" ++#include "php_streams.h" ++#include "php_network.h" ++#include "php_libevent.h" ++ ++#include ++ ++#if PHP_VERSION_ID >= 50301 && (HAVE_SOCKETS || defined(COMPILE_DL_SOCKETS)) ++# include "ext/sockets/php_sockets.h" ++# define LIBEVENT_SOCKETS_SUPPORT ++#endif ++ ++#ifndef ZEND_FETCH_RESOURCE_NO_RETURN ++# define ZEND_FETCH_RESOURCE_NO_RETURN(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type) \ ++ (rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 1, resource_type)) ++#endif ++ ++#include ++ ++#if PHP_MAJOR_VERSION < 5 ++# ifdef PHP_WIN32 ++typedef SOCKET php_socket_t; ++# else ++typedef int php_socket_t; ++# endif ++ ++# ifdef ZTS ++# define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx ++# define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_ls ++# else ++# define TSRMLS_FETCH_FROM_CTX(ctx) ++# define TSRMLS_SET_CTX(ctx) ++# endif ++ ++# ifndef Z_ADDREF_P ++# define Z_ADDREF_P(x) (x)->refcount++ ++# endif ++#endif ++ ++static int le_event_base; ++static int le_event; ++static int le_bufferevent; ++ ++#ifdef COMPILE_DL_LIBEVENT ++ZEND_GET_MODULE(libevent) ++#endif ++ ++typedef struct _php_event_base_t { /* {{{ */ ++ struct event_base *base; ++ int rsrc_id; ++ zend_uint events; ++} php_event_base_t; ++/* }}} */ ++ ++typedef struct _php_event_callback_t { /* {{{ */ ++ zval *func; ++ zval *arg; ++} php_event_callback_t; ++/* }}} */ ++ ++typedef struct _php_event_t { /* {{{ */ ++ struct event *event; ++ int rsrc_id; ++ int stream_id; ++ php_event_base_t *base; ++ php_event_callback_t *callback; ++#ifdef ZTS ++ void ***thread_ctx; ++#endif ++ int in_free; ++} php_event_t; ++/* }}} */ ++ ++typedef struct _php_bufferevent_t { /* {{{ */ ++ struct bufferevent *bevent; ++ int rsrc_id; ++ php_event_base_t *base; ++ zval *readcb; ++ zval *writecb; ++ zval *errorcb; ++ zval *arg; ++#ifdef ZTS ++ void ***thread_ctx; ++#endif ++} php_bufferevent_t; ++/* }}} */ ++ ++#define ZVAL_TO_BASE(zval, base) \ ++ ZEND_FETCH_RESOURCE(base, php_event_base_t *, &zval, -1, "event base", le_event_base) ++ ++#define ZVAL_TO_EVENT(zval, event) \ ++ ZEND_FETCH_RESOURCE(event, php_event_t *, &zval, -1, "event", le_event) ++ ++#define ZVAL_TO_BEVENT(zval, bevent) \ ++ ZEND_FETCH_RESOURCE(bevent, php_bufferevent_t *, &zval, -1, "buffer event", le_bufferevent) ++ ++/* {{{ internal funcs */ ++ ++static inline void _php_event_callback_free(php_event_callback_t *callback) /* {{{ */ ++{ ++ if (!callback) { ++ return; ++ } ++ ++ zval_ptr_dtor(&callback->func); ++ if (callback->arg) { ++ zval_ptr_dtor(&callback->arg); ++ } ++ efree(callback); ++} ++/* }}} */ ++ ++static void _php_event_base_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ ++{ ++ php_event_base_t *base = (php_event_base_t*)rsrc->ptr; ++ ++ event_base_free(base->base); ++ efree(base); ++} ++/* }}} */ ++ ++static void _php_event_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ ++{ ++ php_event_t *event = (php_event_t*)rsrc->ptr; ++ int base_id = -1; ++ ++ if (event->in_free) { ++ return; ++ } ++ ++ event->in_free = 1; ++ ++ if (event->base) { ++ base_id = event->base->rsrc_id; ++ --event->base->events; ++ } ++ if (event->stream_id >= 0) { ++ zend_list_delete(event->stream_id); ++ } ++ event_del(event->event); ++ ++ _php_event_callback_free(event->callback); ++ efree(event->event); ++ efree(event); ++ ++ if (base_id >= 0) { ++ zend_list_delete(base_id); ++ } ++} ++/* }}} */ ++ ++static void _php_bufferevent_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ ++{ ++ php_bufferevent_t *bevent = (php_bufferevent_t*)rsrc->ptr; ++ int base_id = -1; ++ ++ if (bevent->base) { ++ base_id = bevent->base->rsrc_id; ++ --bevent->base->events; ++ } ++ if (bevent->readcb) { ++ zval_ptr_dtor(&(bevent->readcb)); ++ } ++ if (bevent->writecb) { ++ zval_ptr_dtor(&(bevent->writecb)); ++ } ++ if (bevent->errorcb) { ++ zval_ptr_dtor(&(bevent->errorcb)); ++ } ++ if (bevent->arg) { ++ zval_ptr_dtor(&(bevent->arg)); ++ } ++ ++ bufferevent_free(bevent->bevent); ++ efree(bevent); ++ ++ if (base_id >= 0) { ++ zend_list_delete(base_id); ++ } ++} ++/* }}} */ ++ ++static void _php_event_callback(int fd, short events, void *arg) /* {{{ */ ++{ ++ zval *args[3]; ++ php_event_t *event = (php_event_t *)arg; ++ php_event_callback_t *callback; ++ zval retval; ++ TSRMLS_FETCH_FROM_CTX(event ? event->thread_ctx : NULL); ++ ++ if (!event || !event->callback || !event->base) { ++ return; ++ } ++ ++ callback = event->callback; ++ ++ MAKE_STD_ZVAL(args[0]); ++ if (event->stream_id >= 0) { ++ ZVAL_RESOURCE(args[0], event->stream_id); ++ zend_list_addref(event->stream_id); ++ } else { ++ ZVAL_NULL(args[0]); ++ } ++ ++ MAKE_STD_ZVAL(args[1]); ++ ZVAL_LONG(args[1], events); ++ ++ args[2] = callback->arg; ++ Z_ADDREF_P(callback->arg); ++ ++ if (call_user_function(EG(function_table), NULL, callback->func, &retval, 3, args TSRMLS_CC) == SUCCESS) { ++ zval_dtor(&retval); ++ } ++ ++ zval_ptr_dtor(&(args[0])); ++ zval_ptr_dtor(&(args[1])); ++ zval_ptr_dtor(&(args[2])); ++ ++} ++/* }}} */ ++ ++static void _php_bufferevent_readcb(struct bufferevent *be, void *arg) /* {{{ */ ++{ ++ zval *args[2]; ++ zval retval; ++ php_bufferevent_t *bevent = (php_bufferevent_t *)arg; ++ TSRMLS_FETCH_FROM_CTX(bevent ? bevent->thread_ctx : NULL); ++ ++ if (!bevent || !bevent->base || !bevent->readcb) { ++ return; ++ } ++ ++ MAKE_STD_ZVAL(args[0]); ++ ZVAL_RESOURCE(args[0], bevent->rsrc_id); ++ zend_list_addref(bevent->rsrc_id); /* we do refcount-- later in zval_ptr_dtor */ ++ ++ args[1] = bevent->arg; ++ Z_ADDREF_P(args[1]); ++ ++ if (call_user_function(EG(function_table), NULL, bevent->readcb, &retval, 2, args TSRMLS_CC) == SUCCESS) { ++ zval_dtor(&retval); ++ } ++ ++ zval_ptr_dtor(&(args[0])); ++ zval_ptr_dtor(&(args[1])); ++ ++} ++/* }}} */ ++ ++static void _php_bufferevent_writecb(struct bufferevent *be, void *arg) /* {{{ */ ++{ ++ zval *args[2]; ++ zval retval; ++ php_bufferevent_t *bevent = (php_bufferevent_t *)arg; ++ TSRMLS_FETCH_FROM_CTX(bevent ? bevent->thread_ctx : NULL); ++ ++ if (!bevent || !bevent->base || !bevent->writecb) { ++ return; ++ } ++ ++ MAKE_STD_ZVAL(args[0]); ++ ZVAL_RESOURCE(args[0], bevent->rsrc_id); ++ zend_list_addref(bevent->rsrc_id); /* we do refcount-- later in zval_ptr_dtor */ ++ ++ args[1] = bevent->arg; ++ Z_ADDREF_P(args[1]); ++ ++ if (call_user_function(EG(function_table), NULL, bevent->writecb, &retval, 2, args TSRMLS_CC) == SUCCESS) { ++ zval_dtor(&retval); ++ } ++ ++ zval_ptr_dtor(&(args[0])); ++ zval_ptr_dtor(&(args[1])); ++ ++} ++/* }}} */ ++ ++static void _php_bufferevent_errorcb(struct bufferevent *be, short what, void *arg) /* {{{ */ ++{ ++ zval *args[3]; ++ zval retval; ++ php_bufferevent_t *bevent = (php_bufferevent_t *)arg; ++ TSRMLS_FETCH_FROM_CTX(bevent ? bevent->thread_ctx : NULL); ++ ++ if (!bevent || !bevent->base || !bevent->errorcb) { ++ return; ++ } ++ ++ MAKE_STD_ZVAL(args[0]); ++ ZVAL_RESOURCE(args[0], bevent->rsrc_id); ++ zend_list_addref(bevent->rsrc_id); /* we do refcount-- later in zval_ptr_dtor */ ++ ++ MAKE_STD_ZVAL(args[1]); ++ ZVAL_LONG(args[1], what); ++ ++ args[2] = bevent->arg; ++ Z_ADDREF_P(args[2]); ++ ++ if (call_user_function(EG(function_table), NULL, bevent->errorcb, &retval, 3, args TSRMLS_CC) == SUCCESS) { ++ zval_dtor(&retval); ++ } ++ ++ zval_ptr_dtor(&(args[0])); ++ zval_ptr_dtor(&(args[1])); ++ zval_ptr_dtor(&(args[2])); ++ ++} ++/* }}} */ ++ ++/* }}} */ ++ ++ ++/* {{{ proto resource event_base_new() ++ */ ++static PHP_FUNCTION(event_base_new) ++{ ++ php_event_base_t *base; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") != SUCCESS) { ++ return; ++ } ++ ++ base = emalloc(sizeof(php_event_base_t)); ++ base->base = event_base_new(); ++ if (!base->base) { ++ efree(base); ++ RETURN_FALSE; ++ } ++ ++ base->events = 0; ++ ++#if PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 4 ++ base->rsrc_id = zend_list_insert(base, le_event_base TSRMLS_CC); ++#else ++ base->rsrc_id = zend_list_insert(base, le_event_base); ++#endif ++ RETURN_RESOURCE(base->rsrc_id); ++} ++/* }}} */ ++ ++/* {{{ proto void event_base_free(resource base) ++ */ ++static PHP_FUNCTION(event_base_free) ++{ ++ zval *zbase; ++ php_event_base_t *base; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zbase) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BASE(zbase, base); ++ ++ if (base->events > 0) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "base has events attached to it and cannot be freed"); ++ RETURN_FALSE; ++ } ++ ++ zend_list_delete(base->rsrc_id); ++} ++/* }}} */ ++ ++/* {{{ proto int event_base_loop(resource base[, int flags]) ++ */ ++static PHP_FUNCTION(event_base_loop) ++{ ++ zval *zbase; ++ php_event_base_t *base; ++ long flags = 0; ++ int ret; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zbase, &flags) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BASE(zbase, base); ++ zend_list_addref(base->rsrc_id); /* make sure the base cannot be destroyed during the loop */ ++ ret = event_base_loop(base->base, flags); ++ zend_list_delete(base->rsrc_id); ++ ++ RETURN_LONG(ret); ++} ++/* }}} */ ++ ++/* {{{ proto bool event_base_loopbreak(resource base) ++ */ ++static PHP_FUNCTION(event_base_loopbreak) ++{ ++ zval *zbase; ++ php_event_base_t *base; ++ int ret; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zbase) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BASE(zbase, base); ++ ret = event_base_loopbreak(base->base); ++ if (ret == 0) { ++ RETURN_TRUE; ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto bool event_base_loopexit(resource base[, int timeout]) ++ */ ++static PHP_FUNCTION(event_base_loopexit) ++{ ++ zval *zbase; ++ php_event_base_t *base; ++ int ret; ++ long timeout = -1; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zbase, &timeout) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BASE(zbase, base); ++ ++ if (timeout < 0) { ++ ret = event_base_loopexit(base->base, NULL); ++ } else { ++ struct timeval time; ++ ++ time.tv_usec = timeout % 1000000; ++ time.tv_sec = timeout / 1000000; ++ ret = event_base_loopexit(base->base, &time); ++ } ++ ++ if (ret == 0) { ++ RETURN_TRUE; ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto bool event_base_set(resource event, resource base) ++ */ ++static PHP_FUNCTION(event_base_set) ++{ ++ zval *zbase, *zevent; ++ php_event_base_t *base, *old_base; ++ php_event_t *event; ++ int ret; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &zevent, &zbase) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BASE(zbase, base); ++ ZVAL_TO_EVENT(zevent, event); ++ ++ old_base = event->base; ++ ret = event_base_set(base->base, event->event); ++ ++ if (ret == 0) { ++ if (base != old_base) { ++ /* make sure the base is destroyed after the event */ ++ zend_list_addref(base->rsrc_id); ++ ++base->events; ++ } ++ ++ if (old_base) { ++ --old_base->events; ++ zend_list_delete(old_base->rsrc_id); ++ } ++ ++ event->base = base; ++ RETURN_TRUE; ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto bool event_base_priority_init(resource base, int npriorities) ++ */ ++static PHP_FUNCTION(event_base_priority_init) ++{ ++ zval *zbase; ++ php_event_base_t *base; ++ long npriorities; ++ int ret; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zbase, &npriorities) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BASE(zbase, base); ++ ++ if (npriorities < 0) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "npriorities cannot be less than zero"); ++ RETURN_FALSE; ++ } ++ ++ ret = event_base_priority_init(base->base, npriorities); ++ if (ret == 0) { ++ RETURN_TRUE; ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++ ++/* {{{ proto resource event_new() ++ */ ++static PHP_FUNCTION(event_new) ++{ ++ php_event_t *event; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") != SUCCESS) { ++ return; ++ } ++ ++ event = emalloc(sizeof(php_event_t)); ++ event->event = ecalloc(1, sizeof(struct event)); ++ ++ event->stream_id = -1; ++ event->callback = NULL; ++ event->base = NULL; ++ event->in_free = 0; ++ TSRMLS_SET_CTX(event->thread_ctx); ++ ++#if PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 4 ++ event->rsrc_id = zend_list_insert(event, le_event TSRMLS_CC); ++#else ++ event->rsrc_id = zend_list_insert(event, le_event); ++#endif ++ RETURN_RESOURCE(event->rsrc_id); ++} ++/* }}} */ ++ ++/* {{{ proto void event_free(resource event) ++ */ ++static PHP_FUNCTION(event_free) ++{ ++ zval *zevent; ++ php_event_t *event; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zevent) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_EVENT(zevent, event); ++ zend_list_delete(event->rsrc_id); ++} ++/* }}} */ ++ ++/* {{{ proto bool event_add(resource event[, int timeout]) ++ */ ++static PHP_FUNCTION(event_add) ++{ ++ zval *zevent; ++ php_event_t *event; ++ int ret; ++ long timeout = -1; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zevent, &timeout) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_EVENT(zevent, event); ++ ++ if (!event->base) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to add event without an event base"); ++ RETURN_FALSE; ++ } ++ ++ if (timeout < 0) { ++ ret = event_add(event->event, NULL); ++ } else { ++ struct timeval time; ++ ++ time.tv_usec = timeout % 1000000; ++ time.tv_sec = timeout / 1000000; ++ ret = event_add(event->event, &time); ++ } ++ ++ if (ret != 0) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto bool event_set(resource event, mixed fd, int events, mixed callback[, mixed arg]) ++ */ ++static PHP_FUNCTION(event_set) ++{ ++ zval *zevent, **fd, *zcallback, *zarg = NULL; ++ php_event_t *event; ++ long events; ++ php_event_callback_t *callback, *old_callback; ++ char *func_name; ++ php_stream *stream; ++ php_socket_t file_desc; ++#ifdef LIBEVENT_SOCKETS_SUPPORT ++ php_socket *php_sock; ++#endif ++ int ret; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZlz|z", &zevent, &fd, &events, &zcallback, &zarg) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_EVENT(zevent, event); ++ ++ if (events & EV_SIGNAL) { ++ /* signal support */ ++ convert_to_long_ex(fd); ++ file_desc = Z_LVAL_PP(fd); ++ if (file_desc < 0 || file_desc >= NSIG) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid signal passed"); ++ RETURN_FALSE; ++ } ++ } else { ++ if (Z_TYPE_PP(fd) == IS_RESOURCE) { ++ if (ZEND_FETCH_RESOURCE_NO_RETURN(stream, php_stream *, fd, -1, NULL, php_file_le_stream())) { ++ if (php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&file_desc, 1) != SUCCESS || file_desc < 0) { ++ RETURN_FALSE; ++ } ++ } else { ++#ifdef LIBEVENT_SOCKETS_SUPPORT ++ if (ZEND_FETCH_RESOURCE_NO_RETURN(php_sock, php_socket *, fd, -1, NULL, php_sockets_le_socket())) { ++ file_desc = php_sock->bsd_socket; ++ } else { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "fd argument must be either valid PHP stream or valid PHP socket resource"); ++ RETURN_FALSE; ++ } ++#else ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "fd argument must be valid PHP stream resource"); ++ RETURN_FALSE; ++#endif ++ } ++ } else if (Z_TYPE_PP(fd) == IS_LONG) { ++ file_desc = Z_LVAL_PP(fd); ++ if (file_desc < 0) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid file descriptor passed"); ++ RETURN_FALSE; ++ } ++ } else { ++#ifdef LIBEVENT_SOCKETS_SUPPORT ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "fd argument must be valid PHP stream or socket resource or a file descriptor of type long"); ++#else ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "fd argument must be valid PHP stream resource or a file descriptor of type long"); ++#endif ++ RETURN_FALSE; ++ } ++ } ++ ++ if (!zend_is_callable(zcallback, 0, &func_name TSRMLS_CC)) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid callback", func_name); ++ efree(func_name); ++ RETURN_FALSE; ++ } ++ efree(func_name); ++ ++ zval_add_ref(&zcallback); ++ if (zarg) { ++ zval_add_ref(&zarg); ++ } else { ++ ALLOC_INIT_ZVAL(zarg); ++ } ++ ++ callback = emalloc(sizeof(php_event_callback_t)); ++ callback->func = zcallback; ++ callback->arg = zarg; ++ ++ old_callback = event->callback; ++ event->callback = callback; ++ if (events & EV_SIGNAL) { ++ event->stream_id = -1; ++ } else { ++ zend_list_addref(Z_LVAL_PP(fd)); ++ event->stream_id = Z_LVAL_PP(fd); ++ } ++ ++ event_set(event->event, (int)file_desc, (short)events, _php_event_callback, event); ++ ++ if (old_callback) { ++ _php_event_callback_free(old_callback); ++ } ++ ++ if (event->base) { ++ ret = event_base_set(event->base->base, event->event); ++ if (ret != 0) { ++ RETURN_FALSE; ++ } ++ } ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto bool event_del(resource event) ++ */ ++static PHP_FUNCTION(event_del) ++{ ++ zval *zevent; ++ php_event_t *event; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zevent) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_EVENT(zevent, event); ++ ++ if (!event->base) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to delete event without an event base"); ++ RETURN_FALSE; ++ } ++ ++ if (event_del(event->event) == 0) { ++ RETURN_TRUE; ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto bool event_priority_set(resource event, int priority) ++ */ ++static PHP_FUNCTION(event_priority_set) ++{ ++ zval *zevent; ++ php_event_t *event; ++ long priority; ++ int ret; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zevent, &priority) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_EVENT(zevent, event); ++ ++ if (!event->base) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set event priority without an event base"); ++ RETURN_FALSE; ++ } ++ ++ ret = event_priority_set(event->event, priority); ++ ++ if (ret == 0) { ++ RETURN_TRUE; ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto bool event_timer_set(resource event, mixed callback[, mixed arg]) ++ */ ++static PHP_FUNCTION(event_timer_set) ++{ ++ zval *zevent, *zcallback, *zarg = NULL; ++ php_event_t *event; ++ php_event_callback_t *callback, *old_callback; ++ char *func_name; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz|z", &zevent, &zcallback, &zarg) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_EVENT(zevent, event); ++ ++ if (!zend_is_callable(zcallback, 0, &func_name TSRMLS_CC)) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid callback", func_name); ++ efree(func_name); ++ RETURN_FALSE; ++ } ++ efree(func_name); ++ ++ zval_add_ref(&zcallback); ++ if (zarg) { ++ zval_add_ref(&zarg); ++ } else { ++ ALLOC_INIT_ZVAL(zarg); ++ } ++ ++ callback = emalloc(sizeof(php_event_callback_t)); ++ callback->func = zcallback; ++ callback->arg = zarg; ++ ++ old_callback = event->callback; ++ event->callback = callback; ++ if (event->stream_id >= 0) { ++ zend_list_delete(event->stream_id); ++ } ++ event->stream_id = -1; ++ ++ event_set(event->event, -1, 0, _php_event_callback, event); ++ ++ if (old_callback) { ++ _php_event_callback_free(old_callback); ++ } ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto bool event_timer_pending(resource event[, int timeout]) ++ */ ++static PHP_FUNCTION(event_timer_pending) ++{ ++ zval *zevent; ++ php_event_t *event; ++ int ret; ++ long timeout = -1; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zevent, &timeout) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_EVENT(zevent, event); ++ ++ if (timeout < 0) { ++ ret = event_pending(event->event, EV_TIMEOUT, NULL); ++ } else { ++ struct timeval time; ++ ++ time.tv_usec = timeout % 1000000; ++ time.tv_sec = timeout / 1000000; ++ ret = event_pending(event->event, EV_TIMEOUT, &time); ++ } ++ ++ if (ret != 0) { ++ RETURN_FALSE; ++ } ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++ ++ ++/* {{{ proto resource event_buffer_new(mixed fd, mixed readcb, mixed writecb, mixed errorcb[, mixed arg]) ++ */ ++static PHP_FUNCTION(event_buffer_new) ++{ ++ php_bufferevent_t *bevent; ++ php_stream *stream; ++ zval *zfd, *zreadcb, *zwritecb, *zerrorcb, *zarg = NULL; ++ php_socket_t fd; ++ char *func_name; ++#ifdef LIBEVENT_SOCKETS_SUPPORT ++ php_socket *php_sock; ++#endif ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzzz|z", &zfd, &zreadcb, &zwritecb, &zerrorcb, &zarg) != SUCCESS) { ++ return; ++ } ++ ++ if (Z_TYPE_P(zfd) == IS_RESOURCE) { ++ if (ZEND_FETCH_RESOURCE_NO_RETURN(stream, php_stream *, &zfd, -1, NULL, php_file_le_stream())) { ++ if (php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&fd, 1) != SUCCESS || fd < 0) { ++ RETURN_FALSE; ++ } ++ } else { ++#ifdef LIBEVENT_SOCKETS_SUPPORT ++ if (ZEND_FETCH_RESOURCE_NO_RETURN(php_sock, php_socket *, &zfd, -1, NULL, php_sockets_le_socket())) { ++ fd = php_sock->bsd_socket; ++ } else { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "fd argument must be valid PHP stream or socket resource or a file descriptor of type long"); ++ RETURN_FALSE; ++ } ++#else ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "fd argument must be valid PHP stream resource or a file descriptor of type long"); ++ RETURN_FALSE; ++#endif ++ } ++ } else if (Z_TYPE_P(zfd) == IS_LONG) { ++ fd = Z_LVAL_P(zfd); ++ } else { ++#ifdef LIBEVENT_SOCKETS_SUPPORT ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "fd argument must be valid PHP stream or socket resource or a file descriptor of type long"); ++#else ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "fd argument must be valid PHP stream resource or a file descriptor of type long"); ++#endif ++ RETURN_FALSE; ++ } ++ ++ if (Z_TYPE_P(zreadcb) != IS_NULL) { ++ if (!zend_is_callable(zreadcb, 0, &func_name TSRMLS_CC)) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid read callback", func_name); ++ efree(func_name); ++ RETURN_FALSE; ++ } ++ efree(func_name); ++ } else { ++ zreadcb = NULL; ++ } ++ ++ if (Z_TYPE_P(zwritecb) != IS_NULL) { ++ if (!zend_is_callable(zwritecb, 0, &func_name TSRMLS_CC)) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid write callback", func_name); ++ efree(func_name); ++ RETURN_FALSE; ++ } ++ efree(func_name); ++ } else { ++ zwritecb = NULL; ++ } ++ ++ if (!zend_is_callable(zerrorcb, 0, &func_name TSRMLS_CC)) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid error callback", func_name); ++ efree(func_name); ++ RETURN_FALSE; ++ } ++ efree(func_name); ++ ++ bevent = emalloc(sizeof(php_bufferevent_t)); ++ bevent->bevent = bufferevent_new(fd, _php_bufferevent_readcb, _php_bufferevent_writecb, _php_bufferevent_errorcb, bevent); ++ ++ bevent->base = NULL; ++ ++ if (zreadcb) { ++ zval_add_ref(&zreadcb); ++ } ++ bevent->readcb = zreadcb; ++ ++ if (zwritecb) { ++ zval_add_ref(&zwritecb); ++ } ++ bevent->writecb = zwritecb; ++ ++ zval_add_ref(&zerrorcb); ++ bevent->errorcb = zerrorcb; ++ ++ if (zarg) { ++ zval_add_ref(&zarg); ++ bevent->arg = zarg; ++ } else { ++ ALLOC_INIT_ZVAL(bevent->arg); ++ } ++ ++ TSRMLS_SET_CTX(bevent->thread_ctx); ++ ++#if PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 4 ++ bevent->rsrc_id = zend_list_insert(bevent, le_bufferevent TSRMLS_CC); ++#else ++ bevent->rsrc_id = zend_list_insert(bevent, le_bufferevent); ++#endif ++ RETURN_RESOURCE(bevent->rsrc_id); ++} ++/* }}} */ ++ ++/* {{{ proto void event_buffer_free(resource bevent) ++ */ ++static PHP_FUNCTION(event_buffer_free) ++{ ++ zval *zbevent; ++ php_bufferevent_t *bevent; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zbevent) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BEVENT(zbevent, bevent); ++ zend_list_delete(bevent->rsrc_id); ++} ++/* }}} */ ++ ++/* {{{ proto bool event_buffer_base_set(resource bevent, resource base) ++ */ ++static PHP_FUNCTION(event_buffer_base_set) ++{ ++ zval *zbase, *zbevent; ++ php_event_base_t *base, *old_base; ++ php_bufferevent_t *bevent; ++ int ret; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &zbevent, &zbase) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BASE(zbase, base); ++ ZVAL_TO_BEVENT(zbevent, bevent); ++ ++ old_base = bevent->base; ++ ret = bufferevent_base_set(base->base, bevent->bevent); ++ ++ if (ret == 0) { ++ if (base != old_base) { ++ /* make sure the base is destroyed after the event */ ++ zend_list_addref(base->rsrc_id); ++ ++base->events; ++ } ++ ++ if (old_base) { ++ --old_base->events; ++ zend_list_delete(old_base->rsrc_id); ++ } ++ ++ bevent->base = base; ++ RETURN_TRUE; ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto bool event_buffer_priority_set(resource bevent, int priority) ++ */ ++static PHP_FUNCTION(event_buffer_priority_set) ++{ ++ zval *zbevent; ++ php_bufferevent_t *bevent; ++ long priority; ++ int ret; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zbevent, &priority) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BEVENT(zbevent, bevent); ++ ++ if (!bevent->base) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set event priority without an event base"); ++ RETURN_FALSE; ++ } ++ ++ ret = bufferevent_priority_set(bevent->bevent, priority); ++ ++ if (ret == 0) { ++ RETURN_TRUE; ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto bool event_buffer_write(resource bevent, string data[, int data_size]) ++ */ ++static PHP_FUNCTION(event_buffer_write) ++{ ++ zval *zbevent; ++ php_bufferevent_t *bevent; ++ char *data; ++ int data_len; ++ long data_size = -1; ++ int ret; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &zbevent, &data, &data_len, &data_size) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BEVENT(zbevent, bevent); ++ ++ if (ZEND_NUM_ARGS() < 3 || data_size < 0) { ++ data_size = data_len; ++ } else if (data_size > data_len) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_size out of range"); ++ RETURN_FALSE; ++ } ++ ++ ret = bufferevent_write(bevent->bevent, (const void *)data, data_size); ++ ++ if (ret == 0) { ++ RETURN_TRUE; ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto string event_buffer_read(resource bevent, int data_size) ++ */ ++static PHP_FUNCTION(event_buffer_read) ++{ ++ zval *zbevent; ++ php_bufferevent_t *bevent; ++ char *data; ++ long data_size; ++ int ret; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zbevent, &data_size) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BEVENT(zbevent, bevent); ++ ++ if (data_size == 0) { ++ RETURN_EMPTY_STRING(); ++ } else if (data_size < 0) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_size cannot be less than zero"); ++ RETURN_FALSE; ++ } ++ ++ data = safe_emalloc((int)data_size, sizeof(char), 1); ++ ++ ret = bufferevent_read(bevent->bevent, data, data_size); ++ if (ret > 0) { ++ if (ret > data_size) { /* paranoia */ ++ ret = data_size; ++ } ++ data[ret] = '\0'; ++ RETURN_STRINGL(data, ret, 0); ++ } ++ efree(data); ++ RETURN_EMPTY_STRING(); ++} ++/* }}} */ ++ ++/* {{{ proto bool event_buffer_enable(resource bevent, int events) ++ */ ++static PHP_FUNCTION(event_buffer_enable) ++{ ++ zval *zbevent; ++ php_bufferevent_t *bevent; ++ long events; ++ int ret; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zbevent, &events) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BEVENT(zbevent, bevent); ++ ++ ret = bufferevent_enable(bevent->bevent, events); ++ ++ if (ret == 0) { ++ RETURN_TRUE; ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto bool event_buffer_disable(resource bevent, int events) ++ */ ++static PHP_FUNCTION(event_buffer_disable) ++{ ++ zval *zbevent; ++ php_bufferevent_t *bevent; ++ long events; ++ int ret; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zbevent, &events) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BEVENT(zbevent, bevent); ++ ++ ret = bufferevent_disable(bevent->bevent, events); ++ ++ if (ret == 0) { ++ RETURN_TRUE; ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto void event_buffer_timeout_set(resource bevent, int read_timeout, int write_timeout) ++ */ ++static PHP_FUNCTION(event_buffer_timeout_set) ++{ ++ zval *zbevent; ++ php_bufferevent_t *bevent; ++ long read_timeout, write_timeout; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &zbevent, &read_timeout, &write_timeout) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BEVENT(zbevent, bevent); ++ bufferevent_settimeout(bevent->bevent, read_timeout, write_timeout); ++} ++/* }}} */ ++ ++/* {{{ proto void event_buffer_watermark_set(resource bevent, int events, int lowmark, int highmark) ++ */ ++static PHP_FUNCTION(event_buffer_watermark_set) ++{ ++ zval *zbevent; ++ php_bufferevent_t *bevent; ++ long events, lowmark, highmark; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &zbevent, &events, &lowmark, &highmark) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BEVENT(zbevent, bevent); ++ bufferevent_setwatermark(bevent->bevent, events, lowmark, highmark); ++} ++/* }}} */ ++ ++/* {{{ proto void event_buffer_fd_set(resource bevent, resource fd) ++ */ ++static PHP_FUNCTION(event_buffer_fd_set) ++{ ++ zval *zbevent, *zfd; ++ php_stream *stream; ++ php_bufferevent_t *bevent; ++ php_socket_t fd; ++#ifdef LIBEVENT_SOCKETS_SUPPORT ++ php_socket *php_sock; ++#endif ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &zbevent, &zfd) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BEVENT(zbevent, bevent); ++ ++ if (Z_TYPE_P(zfd) == IS_RESOURCE) { ++ if (ZEND_FETCH_RESOURCE_NO_RETURN(stream, php_stream *, &zfd, -1, NULL, php_file_le_stream())) { ++ if (php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&fd, 1) != SUCCESS || fd < 0) { ++ RETURN_FALSE; ++ } ++ } else { ++#ifdef LIBEVENT_SOCKETS_SUPPORT ++ if (ZEND_FETCH_RESOURCE_NO_RETURN(php_sock, php_socket *, &zfd, -1, NULL, php_sockets_le_socket())) { ++ fd = php_sock->bsd_socket; ++ } else { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "fd argument must be valid PHP stream or socket resource or a file descriptor of type long"); ++ RETURN_FALSE; ++ } ++#else ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "fd argument must be valid PHP stream resource or a file descriptor of type long"); ++ RETURN_FALSE; ++#endif ++ } ++ } else if (Z_TYPE_P(zfd) == IS_LONG) { ++ fd = Z_LVAL_P(zfd); ++ } else { ++#ifdef LIBEVENT_SOCKETS_SUPPORT ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "fd argument must be valid PHP stream or socket resource or a file descriptor of type long"); ++#else ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "fd argument must be valid PHP stream resource or a file descriptor of type long"); ++#endif ++ RETURN_FALSE; ++ } ++ ++ bufferevent_setfd(bevent->bevent, fd); ++} ++/* }}} */ ++ ++/* {{{ proto resource event_buffer_set_callback(resource bevent, mixed readcb, mixed writecb, mixed errorcb[, mixed arg]) ++ */ ++static PHP_FUNCTION(event_buffer_set_callback) ++{ ++ php_bufferevent_t *bevent; ++ zval *zbevent, *zreadcb, *zwritecb, *zerrorcb, *zarg = NULL; ++ char *func_name; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzzz|z", &zbevent, &zreadcb, &zwritecb, &zerrorcb, &zarg) != SUCCESS) { ++ return; ++ } ++ ++ ZVAL_TO_BEVENT(zbevent, bevent); ++ ++ if (Z_TYPE_P(zreadcb) != IS_NULL) { ++ if (!zend_is_callable(zreadcb, 0, &func_name TSRMLS_CC)) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid read callback", func_name); ++ efree(func_name); ++ RETURN_FALSE; ++ } ++ efree(func_name); ++ } else { ++ zreadcb = NULL; ++ } ++ ++ if (Z_TYPE_P(zwritecb) != IS_NULL) { ++ if (!zend_is_callable(zwritecb, 0, &func_name TSRMLS_CC)) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid write callback", func_name); ++ efree(func_name); ++ RETURN_FALSE; ++ } ++ efree(func_name); ++ } else { ++ zwritecb = NULL; ++ } ++ ++ if (Z_TYPE_P(zerrorcb) != IS_NULL) { ++ if (!zend_is_callable(zerrorcb, 0, &func_name TSRMLS_CC)) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid error callback", func_name); ++ efree(func_name); ++ RETURN_FALSE; ++ } ++ efree(func_name); ++ } else { ++ zerrorcb = NULL; ++ } ++ ++ if (zreadcb) { ++ zval_add_ref(&zreadcb); ++ ++ if (bevent->readcb) { ++ zval_ptr_dtor(&bevent->readcb); ++ } ++ bevent->readcb = zreadcb; ++ } else { ++ if (bevent->readcb) { ++ zval_ptr_dtor(&bevent->readcb); ++ } ++ bevent->readcb = NULL; ++ } ++ ++ if (zwritecb) { ++ zval_add_ref(&zwritecb); ++ ++ if (bevent->writecb) { ++ zval_ptr_dtor(&bevent->writecb); ++ } ++ bevent->writecb = zwritecb; ++ } else { ++ if (bevent->writecb) { ++ zval_ptr_dtor(&bevent->writecb); ++ } ++ bevent->writecb = NULL; ++ } ++ ++ if (zerrorcb) { ++ zval_add_ref(&zerrorcb); ++ ++ if (bevent->errorcb) { ++ zval_ptr_dtor(&bevent->errorcb); ++ } ++ bevent->errorcb = zerrorcb; ++ } ++ ++ if (zarg) { ++ zval_add_ref(&zarg); ++ if (bevent->arg) { ++ zval_ptr_dtor(&bevent->arg); ++ } ++ bevent->arg = zarg; ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++ ++/* {{{ PHP_MINIT_FUNCTION ++ */ ++static PHP_MINIT_FUNCTION(libevent) ++{ ++ le_event_base = zend_register_list_destructors_ex(_php_event_base_dtor, NULL, "event base", module_number); ++ le_event = zend_register_list_destructors_ex(_php_event_dtor, NULL, "event", module_number); ++ le_bufferevent = zend_register_list_destructors_ex(_php_bufferevent_dtor, NULL, "buffer event", module_number); ++ ++ REGISTER_LONG_CONSTANT("EV_TIMEOUT", EV_TIMEOUT, CONST_CS | CONST_PERSISTENT); ++ REGISTER_LONG_CONSTANT("EV_READ", EV_READ, CONST_CS | CONST_PERSISTENT); ++ REGISTER_LONG_CONSTANT("EV_WRITE", EV_WRITE, CONST_CS | CONST_PERSISTENT); ++ REGISTER_LONG_CONSTANT("EV_SIGNAL", EV_SIGNAL, CONST_CS | CONST_PERSISTENT); ++ REGISTER_LONG_CONSTANT("EV_PERSIST", EV_PERSIST, CONST_CS | CONST_PERSISTENT); ++ REGISTER_LONG_CONSTANT("EVLOOP_NONBLOCK", EVLOOP_NONBLOCK, CONST_CS | CONST_PERSISTENT); ++ REGISTER_LONG_CONSTANT("EVLOOP_ONCE", EVLOOP_ONCE, CONST_CS | CONST_PERSISTENT); ++ ++ REGISTER_LONG_CONSTANT("EVBUFFER_READ", EVBUFFER_READ, CONST_CS | CONST_PERSISTENT); ++ REGISTER_LONG_CONSTANT("EVBUFFER_WRITE", EVBUFFER_WRITE, CONST_CS | CONST_PERSISTENT); ++ REGISTER_LONG_CONSTANT("EVBUFFER_EOF", EVBUFFER_EOF, CONST_CS | CONST_PERSISTENT); ++ REGISTER_LONG_CONSTANT("EVBUFFER_ERROR", EVBUFFER_ERROR, CONST_CS | CONST_PERSISTENT); ++ REGISTER_LONG_CONSTANT("EVBUFFER_TIMEOUT", EVBUFFER_TIMEOUT, CONST_CS | CONST_PERSISTENT); ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ PHP_MINFO_FUNCTION ++ */ ++static PHP_MINFO_FUNCTION(libevent) ++{ ++ char buf[64]; ++ ++ ++ php_info_print_table_start(); ++ php_info_print_table_header(2, "libevent support", "enabled"); ++ php_info_print_table_row(2, "extension version", PHP_LIBEVENT_VERSION); ++ php_info_print_table_row(2, "Revision", "$Revision: 318910 $"); ++ ++ snprintf(buf, sizeof(buf) - 1, "%s", event_get_version()); ++ php_info_print_table_row(2, "libevent version", buf); ++ ++ php_info_print_table_end(); ++} ++/* }}} */ ++ ++#if PHP_MAJOR_VERSION >= 5 ++/* {{{ arginfo */ ++#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || PHP_MAJOR_VERSION > 5 ++# define EVENT_ARGINFO ++#else ++# define EVENT_ARGINFO static ++#endif ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_base_loop, 0, 0, 1) ++ ZEND_ARG_INFO(0, base) ++ ZEND_ARG_INFO(0, flags) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_base_loopbreak, 0, 0, 1) ++ ZEND_ARG_INFO(0, base) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_base_loopexit, 0, 0, 1) ++ ZEND_ARG_INFO(0, base) ++ ZEND_ARG_INFO(0, timeout) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_base_set, 0, 0, 2) ++ ZEND_ARG_INFO(0, event) ++ ZEND_ARG_INFO(0, base) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_base_priority_init, 0, 0, 2) ++ ZEND_ARG_INFO(0, base) ++ ZEND_ARG_INFO(0, npriorities) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO(arginfo_event_new, 0) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_add, 0, 0, 1) ++ ZEND_ARG_INFO(0, event) ++ ZEND_ARG_INFO(0, timeout) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_set, 0, 0, 4) ++ ZEND_ARG_INFO(0, event) ++ ZEND_ARG_INFO(0, fd) ++ ZEND_ARG_INFO(0, events) ++ ZEND_ARG_INFO(0, callback) ++ ZEND_ARG_INFO(0, arg) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_del, 0, 0, 1) ++ ZEND_ARG_INFO(0, event) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_priority_set, 0, 0, 2) ++ ZEND_ARG_INFO(0, event) ++ ZEND_ARG_INFO(0, priority) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_buffer_new, 0, 0, 4) ++ ZEND_ARG_INFO(0, stream) ++ ZEND_ARG_INFO(0, readcb) ++ ZEND_ARG_INFO(0, writecb) ++ ZEND_ARG_INFO(0, errorcb) ++ ZEND_ARG_INFO(0, arg) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_buffer_free, 0, 0, 1) ++ ZEND_ARG_INFO(0, bevent) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_buffer_base_set, 0, 0, 2) ++ ZEND_ARG_INFO(0, bevent) ++ ZEND_ARG_INFO(0, base) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_buffer_priority_set, 0, 0, 2) ++ ZEND_ARG_INFO(0, bevent) ++ ZEND_ARG_INFO(0, priority) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_buffer_write, 0, 0, 2) ++ ZEND_ARG_INFO(0, bevent) ++ ZEND_ARG_INFO(0, data) ++ ZEND_ARG_INFO(0, data_size) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_buffer_read, 0, 0, 2) ++ ZEND_ARG_INFO(0, bevent) ++ ZEND_ARG_INFO(0, data_size) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_buffer_disable, 0, 0, 2) ++ ZEND_ARG_INFO(0, bevent) ++ ZEND_ARG_INFO(0, events) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_buffer_timeout_set, 0, 0, 3) ++ ZEND_ARG_INFO(0, bevent) ++ ZEND_ARG_INFO(0, read_timeout) ++ ZEND_ARG_INFO(0, write_timeout) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_buffer_watermark_set, 0, 0, 4) ++ ZEND_ARG_INFO(0, bevent) ++ ZEND_ARG_INFO(0, events) ++ ZEND_ARG_INFO(0, lowmark) ++ ZEND_ARG_INFO(0, highmark) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_buffer_fd_set, 0, 0, 2) ++ ZEND_ARG_INFO(0, bevent) ++ ZEND_ARG_INFO(0, fd) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_buffer_set_callback, 0, 0, 4) ++ ZEND_ARG_INFO(0, bevent) ++ ZEND_ARG_INFO(0, readcb) ++ ZEND_ARG_INFO(0, writecb) ++ ZEND_ARG_INFO(0, errorcb) ++ ZEND_ARG_INFO(0, arg) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_timer_set, 0, 0, 2) ++ ZEND_ARG_INFO(0, event) ++ ZEND_ARG_INFO(0, callback) ++ ZEND_ARG_INFO(0, arg) ++ZEND_END_ARG_INFO() ++ ++EVENT_ARGINFO ++ZEND_BEGIN_ARG_INFO_EX(arginfo_event_timer_pending, 0, 0, 1) ++ ZEND_ARG_INFO(0, event) ++ ZEND_ARG_INFO(0, timeout) ++ZEND_END_ARG_INFO() ++/* }}} */ ++ ++/* {{{ libevent_functions[] ++ */ ++#if ZEND_MODULE_API_NO >= 20071006 ++const ++#endif ++zend_function_entry libevent_functions[] = { ++ PHP_FE(event_base_new, arginfo_event_new) ++ PHP_FE(event_base_free, arginfo_event_base_loopbreak) ++ PHP_FE(event_base_loop, arginfo_event_base_loop) ++ PHP_FE(event_base_loopbreak, arginfo_event_base_loopbreak) ++ PHP_FE(event_base_loopexit, arginfo_event_base_loopexit) ++ PHP_FE(event_base_set, arginfo_event_base_set) ++ PHP_FE(event_base_priority_init, arginfo_event_base_priority_init) ++ PHP_FE(event_new, arginfo_event_new) ++ PHP_FE(event_free, arginfo_event_del) ++ PHP_FE(event_add, arginfo_event_add) ++ PHP_FE(event_set, arginfo_event_set) ++ PHP_FE(event_del, arginfo_event_del) ++ PHP_FE(event_priority_set, arginfo_event_priority_set) ++ PHP_FE(event_buffer_new, arginfo_event_buffer_new) ++ PHP_FE(event_buffer_free, arginfo_event_buffer_free) ++ PHP_FE(event_buffer_base_set, arginfo_event_buffer_base_set) ++ PHP_FE(event_buffer_priority_set, arginfo_event_buffer_priority_set) ++ PHP_FE(event_buffer_write, arginfo_event_buffer_write) ++ PHP_FE(event_buffer_read, arginfo_event_buffer_read) ++ PHP_FE(event_buffer_enable, arginfo_event_buffer_disable) ++ PHP_FE(event_buffer_disable, arginfo_event_buffer_disable) ++ PHP_FE(event_buffer_timeout_set, arginfo_event_buffer_timeout_set) ++ PHP_FE(event_buffer_watermark_set, arginfo_event_buffer_watermark_set) ++ PHP_FE(event_buffer_fd_set, arginfo_event_buffer_fd_set) ++ PHP_FE(event_buffer_set_callback, arginfo_event_buffer_set_callback) ++ PHP_FALIAS(event_timer_new, event_new, arginfo_event_new) ++ PHP_FE(event_timer_set, arginfo_event_timer_set) ++ PHP_FE(event_timer_pending, arginfo_event_timer_pending) ++ PHP_FALIAS(event_timer_add, event_add, arginfo_event_add) ++ PHP_FALIAS(event_timer_del, event_del, arginfo_event_del) ++ {NULL, NULL, NULL} ++}; ++/* }}} */ ++#else ++/* {{{ libevent_functions[] ++ */ ++zend_function_entry libevent_functions[] = { ++ PHP_FE(event_base_new, NULL) ++ PHP_FE(event_base_free, NULL) ++ PHP_FE(event_base_loop, NULL) ++ PHP_FE(event_base_loopbreak, NULL) ++ PHP_FE(event_base_loopexit, NULL) ++ PHP_FE(event_base_set, NULL) ++ PHP_FE(event_base_priority_init, NULL) ++ PHP_FE(event_new, NULL) ++ PHP_FE(event_free, NULL) ++ PHP_FE(event_add, NULL) ++ PHP_FE(event_set, NULL) ++ PHP_FE(event_del, NULL) ++ PHP_FE(event_priority_set, NULL) ++ PHP_FE(event_buffer_new, NULL) ++ PHP_FE(event_buffer_free, NULL) ++ PHP_FE(event_buffer_base_set, NULL) ++ PHP_FE(event_buffer_priority_set, NULL) ++ PHP_FE(event_buffer_write, NULL) ++ PHP_FE(event_buffer_read, NULL) ++ PHP_FE(event_buffer_enable, NULL) ++ PHP_FE(event_buffer_disable, NULL) ++ PHP_FE(event_buffer_timeout_set, NULL) ++ PHP_FE(event_buffer_watermark_set, NULL) ++ PHP_FE(event_buffer_fd_set, NULL) ++ PHP_FALIAS(event_timer_new, event_new, NULL) ++ PHP_FE(event_timer_set, NULL) ++ PHP_FE(event_timer_pending, NULL) ++ PHP_FALIAS(event_timer_add, event_add, NULL) ++ PHP_FALIAS(event_timer_del, event_del, NULL) ++ {NULL, NULL, NULL} ++}; ++/* }}} */ ++#endif ++ ++static const zend_module_dep libevent_deps[] = { /* {{{ */ ++ ZEND_MOD_OPTIONAL("sockets") ++ {NULL, NULL, NULL} ++}; ++/* }}} */ ++ ++/* {{{ libevent_module_entry ++ */ ++zend_module_entry libevent_module_entry = { ++ STANDARD_MODULE_HEADER_EX, ++ NULL, ++ libevent_deps, ++ "libevent", ++ libevent_functions, ++ PHP_MINIT(libevent), ++ NULL, ++ NULL, ++ NULL, ++ PHP_MINFO(libevent), ++ PHP_LIBEVENT_VERSION, ++ STANDARD_MODULE_PROPERTIES ++}; ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/libevent/libevent.php +@@ -0,0 +1,58 @@ ++ +--- /dev/null ++++ b/ext/libevent/php_libevent.h +@@ -0,0 +1,68 @@ ++/* ++ +----------------------------------------------------------------------+ ++ | PHP Version 5 | ++ +----------------------------------------------------------------------+ ++ | Copyright (c) 1997-2008 The PHP Group | ++ +----------------------------------------------------------------------+ ++ | This source file is subject to version 3.01 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_01.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: Antony Dovgal | ++ | Arnaud Le Blanc | ++ +----------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_libevent.h 300687 2010-06-23 08:13:24Z tony2001 $ */ ++ ++#ifndef PHP_LIBEVENT_H ++#define PHP_LIBEVENT_H ++ ++#define PHP_LIBEVENT_VERSION "0.0.4" ++ ++extern zend_module_entry libevent_module_entry; ++#define phpext_libevent_ptr &libevent_module_entry ++ ++#ifdef ZTS ++#include "TSRM.h" ++#endif ++ ++#ifndef zend_always_inline ++# if defined(__GNUC__) ++# define zend_always_inline inline __attribute__((always_inline)) ++# elif defined(_MSC_VER) ++# define zend_always_inline __forceinline ++# else ++# define zend_always_inline inline ++# endif ++#endif ++ ++#ifndef Z_ADDREF_P ++#define Z_ADDREF_P(pz) zval_addref_p(pz) ++static zend_always_inline zend_uint zval_addref_p(zval* pz) { ++ return ++pz->refcount; ++} ++#endif ++ ++#ifndef Z_DELREF_P ++#define Z_DELREF_P(pz) zval_delref_p(pz) ++static zend_always_inline zend_uint zval_delref_p(zval* pz) { ++ return --pz->refcount; ++} ++#endif ++ ++#endif /* PHP_LIBEVENT_H */ ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ diff --git a/lang/php5/patches/030-PECL-add-http.patch b/lang/php5/patches/030-PECL-add-http.patch new file mode 100644 index 0000000..96444b8 --- /dev/null +++ b/lang/php5/patches/030-PECL-add-http.patch @@ -0,0 +1,29944 @@ +--- /dev/null ++++ b/ext/http/CREDITS +@@ -0,0 +1,2 @@ ++HTTP extension for PHP ++Michael Wallner +--- /dev/null ++++ b/ext/http/KnownIssues.txt +@@ -0,0 +1,33 @@ ++Known Issues ++============ ++$Id: KnownIssues.txt 292753 2009-12-29 12:30:43Z mike $ ++ ++PHP < 5.1.3: ++ HttpResponse::getHeader() does not work with Apache2 SAPIs. ++ Using an encoding stream filter on a stream you read from doesn't work. ++ ++Windows: ++ If you keep getting "SSL connect error" when trying to issue ++ requests, try another (newer) libeay32.dll/ssleay32.dll pair. ++ ++Internals: ++ Our http_urlencode_hash() does not differentiate between prefixes ++ for numeric or string keys. ++ Inflating raw deflated data causes a re-initialization of the inflate ++ stream where the corresponding window bits are modified to tell libz ++ to not check for zlib header bytes. This is not preventable AFAICS. ++ LFS dependant parts of libcurl are left out because of off_t, ++ respectively off64_t confusion. ++ Persistent handles and "cookiestore" request option do interfere, ++ as libcurl saves the cookies to the file on curl_easy_destroy(), ++ cookies are not saved until the CURL handle will be recycled. ++ Thus one would either need to ++ * run PHP with http.persistent.handles.limit = 0 ++ * call http_persistent_handles_clean() every request ++ * call $HttpRequest->flushCookies(), which is available ++ since libcurl v7.17.1 and does not work with the ++ procedural API ++ Anyway, none of these options is really perfect. ++ HTTP and Proxy authentication information (username/password) can not be ++ unset with NULL prior libcurl v7.19.6 and separate options for setting ++ username and password--which work--are only available since v7.19.6. +--- /dev/null ++++ b/ext/http/LICENSE +@@ -0,0 +1,47 @@ ++Copyright (c) 2004-2010, Michael Wallner . ++All rights reserved. ++ ++Redistribution and use in source and binary forms, with or without ++modification, are permitted provided that the following conditions are met: ++ ++ * Redistributions of source code must retain the above copyright notice, ++ this list of conditions and the following disclaimer. ++ * Redistributions in binary form must reproduce the above copyright ++ notice, this list of conditions and the following disclaimer in the ++ documentation and/or other materials provided with the distribution. ++ ++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ++DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE ++FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ++SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ++CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ++OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ ++=============================================================================== ++ ++The date parser in file http_date_api.c is derived from the implementation ++found in the original libcurl source, licensed under the following conditions: ++ ++Copyright (c) 1996 - 2006, Daniel Stenberg, . ++All rights reserved. ++ ++Permission to use, copy, modify, and distribute this software for any purpose ++with or without fee is hereby granted, provided that the above copyright ++notice and this permission notice appear in all copies. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN ++NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, ++DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ++OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE ++OR OTHER DEALINGS IN THE SOFTWARE. ++ ++Except as contained in this notice, the name of a copyright holder shall not ++be used in advertising or otherwise to promote the sale, use or other dealings ++in this Software without prior written authorization of the copyright holder. ++ +--- /dev/null ++++ b/ext/http/Makefile.frag +@@ -0,0 +1,23 @@ ++# vim: noet ts=1 sw=1 ++ ++phpincludedir=$(prefix)/include/php ++ ++install-http: install install-http-headers ++ ++install-http-headers: ++ @echo "Installing HTTP headers: $(INSTALL_ROOT)$(phpincludedir)/ext/http/" ++ @$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/http ++ @for f in $(PHP_HTTP_HEADERS); do \ ++ if test -f "$(top_srcdir)/$$f"; then \ ++ $(INSTALL_DATA) $(top_srcdir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \ ++ elif test -f "$(top_builddir)/$$f"; then \ ++ $(INSTALL_DATA) $(top_builddir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \ ++ elif test -f "$(top_srcdir)/ext/http/$$f"; then \ ++ $(INSTALL_DATA) $(top_srcdir)/ext/http/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \ ++ elif test -f "$(top_builddir)/ext/http/$$f"; then \ ++ $(INSTALL_DATA) $(top_builddir)/ext/http/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \ ++ else \ ++ echo "WTF? $$f"; \ ++ fi \ ++ done; ++ +--- /dev/null ++++ b/ext/http/ThanksTo.txt +@@ -0,0 +1,20 @@ ++Thanks To ++========= ++$Id: ThanksTo.txt 275653 2009-02-12 13:11:05Z mike $ ++ ++People who repeatedly reported issues with this extension in a manner ++so they could be fixed in a reasonable way, or suggested useful features ++to implement, in alphabetical order: ++ ++ Ilia Alshanetsky (ilia at php dot net) ++ Petr Czaderna (petr at hroch dot info) ++ David James (james82 at gmail dot com) ++ Thomas Landro Johnsen (thomas dot l dot johnsen at gmail dot com) ++ Clay Loveless (clay at killersoft dot com) ++ Felipe Pena (felipe at php dot net) ++ David Sklar (sklar at sklar dot com) ++ Travis Swicegood (travis at mashery dot com) ++ Alexey Zakhlestin (indeyets at gmail dot com) ++ Alexander Zhuravlev (zaa at zaa dot pp dot ru) ++ ++Thanks a lot! +--- /dev/null ++++ b/ext/http/config.m4 +@@ -0,0 +1,5 @@ ++dnl phpize stub of config9.m4 for pecl/http ++dnl $Id: config.m4 214417 2006-06-07 21:05:34Z mike $ ++dnl vim: noet ts=1 sw=1 ++ ++sinclude(config9.m4) +--- /dev/null ++++ b/ext/http/config.w32 +@@ -0,0 +1,129 @@ ++// config.w32 for pecl/http ++// $Id: config.w32 287971 2009-09-02 14:36:08Z pajoye $ ++ ++ARG_ENABLE("http", "whether to enable extended HTTP support", "no"); ++ ++function check_for_main_ext(ext, header) ++{ ++ if (!header) { ++ header = "php_"+ ext +".h"; ++ } ++ ++ /* When in configure, we're always in the root of PHP source */ ++ var ext_path = "ext\\" + ext; ++ ++ STDOUT.Write("Checking for ext/"+ ext +" ... "); ++ ++ if (FSO.FileExists(ext_path + "\\" + header)) { ++ STDOUT.WriteLine(ext_path); ++ return ext_path; ++ } ++ ++ STDOUT.WriteLine(""); ++ return false; ++} ++ ++function check_for_pecl_ext(ext, header) ++{ ++ if (!header) { ++ header = "php_"+ ext +".h"; ++ } ++ ++ var g; ++ var s = ext +"\\"+ header; ++ ++ STDOUT.Write("Checking for pecl/"+ ext +" ... "); ++ if ( (g = glob(configure_module_dirname +"\\..\\"+ s)) || ++ (g = glob(configure_module_dirname +"\\..\\..\\..\\pecl\\"+ s))) { ++ var f = g[0].substr(0, g[0].length - header.length - 1); ++ STDOUT.WriteLine(f); ++ return f; ++ } ++ STDOUT.WriteLine(""); ++ return false; ++} ++ ++if (PHP_HTTP != "no") { ++ ++ EXTENSION("http", ++ "missing.c http.c http_functions.c http_exception_object.c "+ ++ "http_util_object.c http_message_object.c http_requestpool_object.c "+ ++ "http_request_object.c http_response_object.c "+ ++ "http_api.c http_cache_api.c http_request_pool_api.c "+ ++ "http_request_api.c http_date_api.c http_headers_api.c "+ ++ "http_message_api.c http_send_api.c http_url_api.c "+ ++ "http_info_api.c http_request_method_api.c http_encoding_api.c "+ ++ "http_filter_api.c http_request_body_api.c http_querystring_object.c "+ ++ "http_deflatestream_object.c http_inflatestream_object.c "+ ++ "http_cookie_api.c http_querystring_api.c http_request_datashare_api.c "+ ++ "http_requestdatashare_object.c http_request_info.c http_persistent_handle_api.c", ++ null, ++ "/I\"" + configure_module_dirname + "/phpstr\""); ++ ADD_SOURCES(configure_module_dirname + "/phpstr", "phpstr.c", "http"); ++ AC_DEFINE("HAVE_HTTP", 1, "Have extended HTTP support"); ++ AC_DEFINE("HTTP_SHARED_DEPS", 1, "Depend on shared extensions"); ++ ++ AC_DEFINE("HAVE_GETHOSTNAME", 1); ++ AC_DEFINE("HAVE_GETSERVBYPORT", 1); ++ AC_DEFINE("HAVE_GETSERVBYNAME", 1); ++ ++ if (PHP_DEBUG != "no") { ++ ADD_FLAG("CFLAGS_HTTP", "/W3"); ++ } ++ ++ if (CHECK_HEADER_ADD_INCLUDE('zlib.h', 'CFLAGS_HTTP', '..\\zlib;' + php_usual_include_suspects)) { ++ AC_DEFINE('HTTP_HAVE_ZLIB', 1, "Have zlib library"); ++ ADD_FLAG("LDFLAGS_HTTP", "/FORCE:MULTIPLE"); ++ } else { ++ WARNING("zlib encoding functions not enabled; libraries and headers not found"); ++ } ++ ++ if (typeof(PHP_HASH) != "undefined" && PHP_HASH != "no") { ++ var f; ++ ++ if ((f = check_for_pecl_ext("hash")) || (f = check_for_main_ext("hash"))) { ++ ADD_FLAG("CFLAGS_HTTP", '/I "' + f + '" /DHTTP_HAVE_PHP_HASH_H=1'); ++ ADD_EXTENSION_DEP("http", "hash", true); ++ } ++ } ++ ++ if (PHP_SESSION != "no") { ++ ADD_EXTENSION_DEP("http", "session", true); ++ } ++ ++ if (PHP_ICONV != "no") { ++ ADD_EXTENSION_DEP("http", "iconv", true); ++ } ++ ++ CURL_LIB="libcurl_a.lib;libcurl.lib;" + (PHP_DEBUG != "no" ? "libcurld.lib":"libcurl.lib"); ++ if (CHECK_HEADER_ADD_INCLUDE("curl/curl.h", "CFLAGS_HTTP") && ++ CHECK_HEADER_ADD_INCLUDE("openssl/crypto.h", "CFLAGS_HTTP") && ++ CHECK_LIB(CURL_LIB, "http", PHP_HTTP) && ++ CHECK_LIB("ssleay32.lib", "http", PHP_HTTP) && ++ CHECK_LIB("libeay32.lib", "http", PHP_HTTP) && ++ CHECK_LIB("zlib.lib;zlib_a.lib", "http", PHP_HTTP) && ++ CHECK_LIB("winmm.lib", "http", PHP_HTTP)) { ++ AC_DEFINE("HTTP_HAVE_CURL", 1, "Have CURL library"); ++ AC_DEFINE("HTTP_HAVE_SSL", 1, "Have SSL"); ++ AC_DEFINE("HAVE_CURL_MULTI_STRERROR", 1, ""); ++ AC_DEFINE("HAVE_CURL_SHARE_STRERROR", 1, ""); ++ AC_DEFINE("HAVE_CURL_EASY_STRERROR", 1, ""); ++ AC_DEFINE("HAVE_CURL_EASY_RESET", 1, ""); ++ AC_DEFINE("HAVE_CURL_GETFORMDATA", 1, ""); ++ AC_DEFINE("HAVE_CURL_FORMGET", 1, ""); ++ AC_DEFINE("HAVE_CURL_MULTI_SETOPT", 1, ""); ++ AC_DEFINE("HAVE_CURL_MULTI_TIMEOUT", 1, ""); ++ } else { ++ WARNING("curl convenience functions not enabled; libraries and headers not found"); ++ } ++/* ++// MAGIC_LIB = PHP_DEBUG != "no" ? "libmagic-staticd.lib":"libmagic-static.lib"; ++// if (CHECK_HEADER_ADD_INCLUDE("magic.h", "CFLAGS_HTTP") && ++// CHECK_LIB(MAGIC_LIB, "http", PHP_HTTP)) { ++// AC_DEFINE("HTTP_HAVE_MAGIC", 1, "Have magic library"); ++// AC_DEFINE("USE_MAGIC_STATIC", "", ""); ++// } else { ++// WARNING("content type guessing not enabled; libraries and headers not found"); ++// } ++*/ ++} +--- /dev/null ++++ b/ext/http/config9.m4 +@@ -0,0 +1,468 @@ ++dnl config.m4 for pecl/http ++dnl $Id: config9.m4 242664 2007-09-18 19:13:37Z mike $ ++dnl vim: noet ts=1 sw=1 ++ ++PHP_ARG_ENABLE([http], [whether to enable extended HTTP support], ++[ --enable-http Enable extended HTTP support]) ++PHP_ARG_WITH([http-shared-deps], [whether to depend on extensions which have been built shared], ++[ --with-http-shared-deps ++ HTTP: disable to not depend on extensions like hash, ++ iconv and session (when built shared)], $PHP_HTTP, $PHP_HTTP) ++PHP_ARG_WITH([http-curl-requests], [whether to enable cURL HTTP request support], ++[ --with-http-curl-requests[=LIBCURLDIR] ++ HTTP: with cURL request support], $PHP_HTTP, $PHP_HTTP) ++PHP_ARG_WITH([http-curl-libevent], [whether to enable libevent support fur cURL], ++[ --with-http-curl-libevent[=LIBEVENTDIR] ++ HTTP: libevent install directory], $PHP_HTTP_CURL_REQUESTS, "") ++PHP_ARG_WITH([http-zlib-compression], [whether to enable zlib encodings support], ++[ --with-http-zlib-compression[=LIBZDIR] ++ HTTP: with zlib encodings support], $PHP_HTTP, $PHP_HTTP) ++PHP_ARG_WITH([http-magic-mime], [whether to enable response content type guessing], ++[ --with-http-magic-mime[=LIBMAGICDIR] ++ HTTP: with magic mime response content type guessing], "no", "no") ++ ++if test "$PHP_HTTP" != "no"; then ++ ++ ifdef([AC_PROG_EGREP], [ ++ AC_PROG_EGREP ++ ], [ ++ AC_CHECK_PROG(EGREP, egrep, egrep) ++ ]) ++ ifdef([AC_PROG_SED], [ ++ AC_PROG_SED ++ ], [ ++ ifdef([LT_AC_PROG_SED], [ ++ LT_AC_PROG_SED ++ ], [ ++ AC_CHECK_PROG(SED, sed, sed) ++ ]) ++ ]) ++ ++ AC_PROG_CPP ++ ++ if test "$PHP_HTTP_SHARED_DEPS" != "no"; then ++ AC_DEFINE([HTTP_SHARED_DEPS], [1], [ ]) ++ else ++ AC_DEFINE([HTTP_SHARED_DEPS], [0], [ ]) ++ fi ++ ++ dnl ++ dnl HTTP_SHARED_DEP(name[, code-if-yes[, code-if-not]]) ++ dnl ++ AC_DEFUN([HTTP_SHARED_DEP], [ ++ extname=$1 ++ haveext=$[HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__) ++ ++ AC_MSG_CHECKING([whether to add a dependency on ext/$extname]) ++ if test "$PHP_HTTP_SHARED_DEPS" = "no"; then ++ AC_MSG_RESULT([no]) ++ $3 ++ elif test "$haveext"; then ++ AC_MSG_RESULT([yes]) ++ ifdef([PHP_ADD_EXTENSION_DEP], [ ++ PHP_ADD_EXTENSION_DEP([http], $1, true) ++ ]) ++ $2 ++ else ++ AC_MSG_RESULT([no]) ++ $3 ++ fi ++ ]) ++ ++ dnl ++ dnl HTTP_HAVE_PHP_EXT(name[, code-if-yes[, code-if-not]]) ++ dnl ++ AC_DEFUN([HTTP_HAVE_PHP_EXT], [ ++ 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 ++ [HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1 ++ AC_MSG_RESULT([yes]) ++ $2 ++ else ++ [HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)= ++ AC_MSG_RESULT([no]) ++ $3 ++ fi ++ elif test "$haveext" != "no" && test "x$haveext" != "x"; then ++ [HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1 ++ AC_MSG_RESULT([yes]) ++ $2 ++ else ++ [HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)= ++ AC_MSG_RESULT([no]) ++ $3 ++ fi ++ ]) ++ ++ dnl ++ dnl odd PHP4 fix ++ dnl ++ if test "x$PHP_LIBDIR" = "x"; then ++ PHP_LIBDIR=lib ++ fi ++ ++dnl ---- ++dnl STDC ++dnl ---- ++ AC_CHECK_HEADERS([netdb.h unistd.h]) ++ PHP_CHECK_FUNC(gethostname, nsl) ++ PHP_CHECK_FUNC(getdomainname, nsl) ++ PHP_CHECK_FUNC(getservbyport, nsl) ++ PHP_CHECK_FUNC(getservbyname, nsl) ++ ++dnl ---- ++dnl ZLIB ++dnl ---- ++ if test "$PHP_HTTP_ZLIB_COMPRESSION" != "no"; then ++ AC_MSG_CHECKING([for zlib.h]) ++ ZLIB_DIR= ++ for i in "$PHP_HTTP_ZLIB_COMPRESSION" "$PHP_ZLIB_DIR" "$PHP_ZLIB" /usr/local /usr /opt; do ++ if test -f "$i/include/zlib.h"; then ++ ZLIB_DIR=$i ++ break; ++ fi ++ done ++ if test "x$ZLIB_DIR" = "x"; then ++ AC_MSG_RESULT([not found]) ++ AC_MSG_ERROR([could not find zlib.h]) ++ else ++ AC_MSG_RESULT([found in $ZLIB_DIR]) ++ AC_MSG_CHECKING([for zlib version >= 1.2.0.4]) ++ ZLIB_VERSION=`$EGREP "define ZLIB_VERSION" $ZLIB_DIR/include/zlib.h | $SED -e 's/[[^0-9\.]]//g'` ++ AC_MSG_RESULT([$ZLIB_VERSION]) ++ if test `echo $ZLIB_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*1000000 + $2*10000 + $3*100 + $4}'` -lt 1020004; then ++ AC_MSG_ERROR([libz version greater or equal to 1.2.0.4 required]) ++ else ++ PHP_ADD_INCLUDE($ZLIB_DIR/include) ++ PHP_ADD_LIBRARY_WITH_PATH(z, $ZLIB_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD) ++ AC_DEFINE([HTTP_HAVE_ZLIB], [1], [Have zlib support]) ++ fi ++ fi ++ fi ++ ++dnl ---- ++dnl CURL ++dnl ---- ++ if test "$PHP_HTTP_CURL_REQUESTS" != "no"; then ++ AC_MSG_CHECKING([for curl/curl.h]) ++ CURL_DIR= ++ for i in "$PHP_HTTP_CURL_REQUESTS" /usr/local /usr /opt; do ++ if test -f "$i/include/curl/curl.h"; then ++ CURL_DIR=$i ++ break ++ fi ++ done ++ if test "x$CURL_DIR" = "x"; then ++ AC_MSG_RESULT([not found]) ++ AC_MSG_ERROR([could not find curl/curl.h]) ++ else ++ AC_MSG_RESULT([found in $CURL_DIR]) ++ fi ++ ++ AC_MSG_CHECKING([for curl-config]) ++ CURL_CONFIG= ++ for i in "$CURL_DIR/bin/curl-config" "$CURL_DIR/curl-config" `which curl-config`; do ++ if test -x "$i"; then ++ CURL_CONFIG=$i ++ break ++ fi ++ done ++ if test "x$CURL_CONFIG" = "x"; then ++ AC_MSG_RESULT([not found]) ++ AC_MSG_ERROR([could not find curl-config]) ++ else ++ AC_MSG_RESULT([found: $CURL_CONFIG]) ++ fi ++ ++ dnl Debian stable has currently 7.13.2 (this is not a typo) ++ AC_MSG_CHECKING([for curl version >= 7.12.3]) ++ CURL_VERSION=`$CURL_CONFIG --version | $SED -e 's/[[^0-9\.]]//g'` ++ AC_MSG_RESULT([$CURL_VERSION]) ++ if test `echo $CURL_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -lt 71203; then ++ AC_MSG_ERROR([libcurl version greater or equal to 7.12.3 required]) ++ fi ++ ++ dnl ++ dnl compile tests ++ dnl ++ ++ save_INCLUDES="$INCLUDES" ++ INCLUDES= ++ save_LIBS="$LIBS" ++ LIBS= ++ save_CFLAGS="$CFLAGS" ++ CFLAGS=`$CURL_CONFIG --cflags` ++ save_LDFLAGS="$LDFLAGS" ++ LDFLAGS=`$CURL_CONFIG --libs` ++ LDFLAGS="$LDFLAGS $ld_runpath_switch$CURL_DIR/$PHP_LIBDIR" ++ ++ AC_MSG_CHECKING([for SSL support in libcurl]) ++ CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL` ++ if test "$CURL_SSL" = "SSL"; then ++ AC_MSG_RESULT([yes]) ++ AC_DEFINE([HTTP_HAVE_SSL], [1], [ ]) ++ ++ AC_MSG_CHECKING([for openssl support in libcurl]) ++ AC_TRY_RUN([ ++ #include ++ int main(int argc, char *argv[]) { ++ curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); ++ if (data && data->ssl_version && *data->ssl_version) { ++ const char *ptr = data->ssl_version; ++ while(*ptr == ' ') ++ptr; ++ return strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1); ++ } ++ return 1; ++ } ++ ], [ ++ AC_MSG_RESULT([yes]) ++ AC_CHECK_HEADER([openssl/crypto.h], [ ++ AC_DEFINE([HTTP_HAVE_OPENSSL], [1], [ ]) ++ ]) ++ ], [ ++ AC_MSG_RESULT([no]) ++ ], [ ++ AC_MSG_RESULT([no]) ++ ]) ++ ++ AC_MSG_CHECKING([for gnutls support in libcurl]) ++ AC_TRY_RUN([ ++ #include ++ int main(int argc, char *argv[]) { ++ curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); ++ if (data && data->ssl_version && *data->ssl_version) { ++ const char *ptr = data->ssl_version; ++ while(*ptr == ' ') ++ptr; ++ return strncasecmp(ptr, "GnuTLS", sizeof("GnuTLS")-1); ++ } ++ return 1; ++ } ++ ], [ ++ AC_MSG_RESULT([yes]) ++ AC_CHECK_HEADER([gcrypt.h], [ ++ AC_DEFINE([HTTP_HAVE_GNUTLS], [1], [ ]) ++ ]) ++ ], [ ++ AC_MSG_RESULT([no]) ++ ], [ ++ AC_MSG_RESULT([no]) ++ ]) ++ else ++ AC_MSG_RESULT([no]) ++ fi ++ ++ INCLUDES="$save_INCLUDES" ++ LIBS="$save_LIBS" ++ CFLAGS="$save_CFLAGS" ++ LDFLAGS="$save_LDFLAGS" ++ ++ dnl end compile tests ++ ++ AC_MSG_CHECKING([for bundled SSL CA info]) ++ CURL_CAINFO= ++ for i in `$CURL_CONFIG --ca` "/etc/ssl/certs/ca-certificates.crt"; do ++ if test -f "$i"; then ++ CURL_CAINFO="$i" ++ break ++ fi ++ done ++ if test "x$CURL_CAINFO" = "x"; then ++ AC_MSG_RESULT([not found]) ++ else ++ AC_MSG_RESULT([$CURL_CAINFO]) ++ AC_DEFINE_UNQUOTED([HTTP_CURL_CAINFO], ["$CURL_CAINFO"], [path to bundled SSL CA info]) ++ fi ++ ++ PHP_ADD_INCLUDE($CURL_DIR/include) ++ PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD) ++ PHP_EVAL_LIBLINE(`$CURL_CONFIG --libs`, HTTP_SHARED_LIBADD) ++ AC_DEFINE([HTTP_HAVE_CURL], [1], [Have cURL support]) ++ ++ PHP_CHECK_LIBRARY(curl, curl_share_strerror, ++ [AC_DEFINE([HAVE_CURL_SHARE_STRERROR], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ PHP_CHECK_LIBRARY(curl, curl_multi_strerror, ++ [AC_DEFINE([HAVE_CURL_MULTI_STRERROR], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ PHP_CHECK_LIBRARY(curl, curl_easy_strerror, ++ [AC_DEFINE([HAVE_CURL_EASY_STRERROR], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ PHP_CHECK_LIBRARY(curl, curl_easy_reset, ++ [AC_DEFINE([HAVE_CURL_EASY_RESET], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ PHP_CHECK_LIBRARY(curl, curl_formget, ++ [AC_DEFINE([HAVE_CURL_FORMGET], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ PHP_CHECK_LIBRARY(curl, curl_multi_setopt, ++ [AC_DEFINE([HAVE_CURL_MULTI_SETOPT], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ PHP_CHECK_LIBRARY(curl, curl_multi_timeout, ++ [AC_DEFINE([HAVE_CURL_MULTI_TIMEOUT], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ ++ dnl ---- ++ dnl EVENT ++ dnl ---- ++ ++ if test "$PHP_HTTP_CURL_LIBEVENT" != "no"; then ++ HTTP_HAVE_PHP_EXT([event], [ ++ AC_MSG_WARN([event support is incompatible with pecl/event; continuing without libevent support]) ++ ], [ ++ AC_MSG_CHECKING([for event.h]) ++ EVENT_DIR= ++ for i in "$PHP_HTTP_CURL_LIBEVENT" /usr/local /usr /opt; do ++ if test -f "$i/include/event.h"; then ++ EVENT_DIR=$i ++ break ++ fi ++ done ++ if test "x$EVENT_DIR" = "x"; then ++ AC_MSG_RESULT([not found]) ++ AC_MSG_WARN([continuing without libevent support]) ++ else ++ AC_MSG_RESULT([found in $EVENT_DIR]) ++ ++ AC_MSG_CHECKING([for libevent version, roughly]) ++ EVENT_VER="1.1b or lower" ++ if test -f "$EVENT_DIR/include/evhttp.h" && test -f "$EVENT_DIR/include/evdns.h"; then ++ if test -f "$EVENT_DIR/include/evrpc.h"; then ++ EVENT_VER="1.4 or greater" ++ else ++ EVENT_VER="1.2 or greater" ++ fi ++ fi ++ AC_DEFINE_UNQUOTED([HTTP_EVENT_VERSION], ["$EVENT_VER"], [ ]) ++ AC_MSG_RESULT([$EVENT_VER]) ++ ++ AC_MSG_CHECKING([for libcurl version >= 7.16.0]) ++ AC_MSG_RESULT([$CURL_VERSION]) ++ if test `echo $CURL_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -lt 71600; then ++ AC_MSG_WARN([libcurl version greater or equal to 7.16.0 required; continuing without libevent support]) ++ else ++ PHP_ADD_INCLUDE($EVENT_DIR/include) ++ PHP_ADD_LIBRARY_WITH_PATH(event, $EVENT_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD) ++ AC_DEFINE([HTTP_HAVE_EVENT], [1], [Have libevent support for cURL]) ++ PHP_CHECK_LIBRARY(curl, curl_multi_socket_action, ++ [AC_DEFINE([HAVE_CURL_MULTI_SOCKET_ACTION], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ fi ++ fi ++ ]) ++ fi ++ fi ++ ++dnl ---- ++dnl MAGIC ++dnl ---- ++ if test "$PHP_HTTP_MAGIC_MIME" != "no"; then ++ AC_MSG_CHECKING([for magic.h]) ++ MAGIC_DIR= ++ for i in "$PHP_HTTP_MAGIC_MIME" /usr/local /usr /opt; do ++ if test -f "$i/include/magic.h"; then ++ MAGIC_DIR=$i ++ break ++ fi ++ done ++ if test "x$MAGIC_DIR" = "x"; then ++ AC_MSG_RESULT([not found]) ++ AC_MSG_ERROR([could not find magic.h]) ++ else ++ AC_MSG_RESULT([found in $MAGIC_DIR]) ++ fi ++ ++ PHP_ADD_INCLUDE($MAGIC_DIR/include) ++ PHP_ADD_LIBRARY_WITH_PATH(magic, $MAGIC_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD) ++ AC_DEFINE([HTTP_HAVE_MAGIC], [1], [Have magic mime support]) ++ fi ++ ++dnl ---- ++dnl HASH ++dnl ---- ++ HTTP_HAVE_PHP_EXT([hash], [ ++ AC_MSG_CHECKING([for php_hash.h]) ++ HTTP_EXT_HASH_INCDIR= ++ for i in `echo $INCLUDES | $SED -e's/-I//g'` $abs_srcdir ../hash; do ++ if test -d $i; then ++ if test -f $i/php_hash.h; then ++ HTTP_EXT_HASH_INCDIR=$i ++ break ++ elif test -f $i/ext/hash/php_hash.h; then ++ HTTP_EXT_HASH_INCDIR=$i/ext/hash ++ break ++ fi ++ fi ++ done ++ if test "x$HTTP_EXT_HASH_INCDIR" = "x"; then ++ AC_MSG_RESULT([not found]) ++ else ++ AC_MSG_RESULT([$HTTP_EXT_HASH_INCDIR]) ++ AC_DEFINE([HTTP_HAVE_PHP_HASH_H], [1], [Have ext/hash support]) ++ PHP_ADD_INCLUDE([$HTTP_EXT_HASH_INCDIR]) ++ fi ++ ]) ++ ++dnl ---- ++dnl ICONV ++dnl ---- ++ HTTP_HAVE_PHP_EXT([iconv]) ++ ++dnl ---- ++dnl SESSION ++dnl ---- ++ HTTP_HAVE_PHP_EXT([session]) ++ ++dnl ---- ++dnl DONE ++dnl ---- ++ PHP_HTTP_SOURCES="missing.c http.c http_functions.c phpstr/phpstr.c \ ++ http_util_object.c http_message_object.c http_request_object.c http_request_pool_api.c \ ++ http_response_object.c http_exception_object.c http_requestpool_object.c \ ++ http_api.c http_cache_api.c http_request_api.c http_request_info.c http_date_api.c \ ++ http_headers_api.c http_message_api.c http_send_api.c http_url_api.c \ ++ http_info_api.c http_request_method_api.c http_encoding_api.c \ ++ http_filter_api.c http_request_body_api.c http_querystring_object.c \ ++ http_deflatestream_object.c http_inflatestream_object.c http_cookie_api.c \ ++ http_querystring_api.c http_request_datashare_api.c http_requestdatashare_object.c \ ++ http_persistent_handle_api.c" ++ ++ PHP_NEW_EXTENSION([http], $PHP_HTTP_SOURCES, $ext_shared) ++ ++ dnl shared extension deps ++ HTTP_SHARED_DEP([hash]) ++ HTTP_SHARED_DEP([iconv]) ++ HTTP_SHARED_DEP([session]) ++ ++ PHP_ADD_BUILD_DIR($ext_builddir/phpstr, 1) ++ PHP_SUBST([HTTP_SHARED_LIBADD]) ++ ++ PHP_HTTP_HEADERS="php_http_std_defs.h php_http.h php_http_api.h php_http_cache_api.h \ ++ php_http_date_api.h php_http_headers_api.h php_http_info_api.h php_http_message_api.h \ ++ php_http_request_api.h php_http_request_method_api.h php_http_send_api.h php_http_url_api.h \ ++ php_http_encoding_api.h phpstr/phpstr.h missing.h php_http_request_body_api.h \ ++ php_http_exception_object.h php_http_message_object.h php_http_request_object.h \ ++ php_http_requestpool_object.h php_http_response_object.h php_http_util_object.h \ ++ php_http_querystring_object.h php_http_deflatestream_object.h php_http_inflatestream_object.h \ ++ php_http_cookie_api.h php_http_querystring_api.h php_http_request_datashare_api.h php_http_requestdatashare_object.h \ ++ php_http_persistent_handle_api.h" ++ ifdef([PHP_INSTALL_HEADERS], [ ++ PHP_INSTALL_HEADERS(ext/http, $PHP_HTTP_HEADERS) ++ ], [ ++ PHP_SUBST([PHP_HTTP_HEADERS]) ++ PHP_ADD_MAKEFILE_FRAGMENT ++ ]) ++ ++ AC_DEFINE([HAVE_HTTP], [1], [Have extended HTTP support]) ++fi +--- /dev/null ++++ b/ext/http/docs/examples/tutorial.txt +@@ -0,0 +1,175 @@ ++ ++A Beginners Tutorial ++-------------------- ++$Revision: 208773 $ ++ ++ ++- GET Queries ++ ++ The HttpRequest class can be used to execute any HTTP request method. ++ The following example shows a simple GET request where a few query ++ parameters are supplied. Additionally potential cookies will be ++ read from and written to a file. ++ ++setOptions( ++ array( 'cookiestore' => 'google.txt', ++ ) ++); ++ ++$r->setQueryData( ++ array( 'q' => '+"pecl_http" -msg -cvs -list', ++ 'hl' => 'de' ++ ) ++); ++ ++// HttpRequest::send() returns an HttpMessage object ++// of type HttpMessage::TYPE_RESPONSE or throws an exception ++try { ++ print $r->send()->getBody(); ++} catch (HttpException $e) { ++ print $e; ++} ++?> ++ ++- Multipart Posts ++ ++ The following example shows an multipart POST request, with two form ++ fields and an image that's supposed to be uploaded to the server. ++ It's a bad habit as well as common practice to issue a redirect after ++ an received POST request, so we'll allow a redirect by enabling the ++ redirect option. ++ ++setOptions( ++ array( 'cookies' => array('MyCookie' => 'has a value'), ++ 'redirect' => true, ++ ) ++); ++ ++// common form data ++$r->setPostFields( ++ array( 'name' => 'Mike', ++ 'mail' => 'mike@php.net', ++ ) ++); ++// add the file to post (form name, file name, file type) ++touch('profile.jpg'); ++$r->addPostFile('image', 'profile.jpg', 'image/jpeg'); ++ ++try { ++ print $r->send()->getBody(); ++} catch (HttpException $e) { ++ print $e; ++} ++?> ++ ++- Parallel Requests ++ ++ It's possible to execute several HttpRequests in parallel with the ++ HttpRequestPool class. HttpRequests to send, do not need to perform ++ the same request method, but can only be attached to one HttpRequestPool ++ at the same time. ++ ++attach(new HttpRequest('http://pear.php.net', HTTP_METH_HEAD)); ++ $p->attach(new HttpRequest('http://pecl.php.net', HTTP_METH_HEAD)); ++} catch (HttpException $e) { ++ print $e; ++ exit; ++} ++ ++try { ++ $p->send(); ++ // HttpRequestPool implements an iterator over attached HttpRequest objects ++ foreach ($p as $r) { ++ echo "Checking ", $r->getUrl(), " reported ", $r->getResponseCode(), "\n"; ++ } ++} catch (HttpException $e) { ++ print $e; ++} ++?> ++ ++- Parallel Requests? ++ ++ You can use a more advanced approach by using the protected interface of ++ the HttpRequestPool class. This allows you to perform some other tasks ++ while the requests are executed. ++ ++socketPerform(); $i++) { ++ $i % 10 or print "."; ++ if (!$this->socketSelect()) { ++ throw new HttpException("Socket error!"); ++ } ++ } ++ print "\nDone!\n"; ++ } ++} ++ ++try { ++ foreach (new Pool as $r) { ++ echo "Checking ", $r->getUrl(), " reported ", $r->getResponseCode(), "\n"; ++ } ++} catch (HttpException $ex) { ++ print $e; ++} ++?> ++ ++- Cached Responses ++ ++ One of the main key features of HttpResponse is HTTP caching. HttpResponse ++ will calculate an ETag based on the http.etag_mode INI setting as well as ++ it will determine the last modification time of the sent entity. It uses ++ those two indicators to decide if the cache entry on the client side is ++ still valid and will emit an "304 Not Modified" response if applicable. ++ ++ ++ ++- Bandwidth Throttling ++ ++ HttpResponse supports a basic throttling mechanism, which is enabled by ++ setting a throttle delay and a buffer size. PHP will sleep the specified ++ amount of seconds after each sent chunk of specified bytes. ++ ++ +--- /dev/null ++++ b/ext/http/docs/http.ini +@@ -0,0 +1,61 @@ ++; example INI file for pecl/http ++; $Id: http.ini 229420 2007-02-09 14:19:40Z mike $ ++ ++[http] ++; enable if you want to transform all errors to exceptions (PHP >= 5 only) ++;http.only_exceptions = 1 ++ ++; disable if you don't want php to exit in case of redirects and cache hits; ++; a "NULL" output handler will be started instead, which discards all output ++;http.force_exit = 0 ++ ++; disable if you don't want 404 Not found status messages being sent, ++; if a file attempted to be sent with http_send_file() etc. cannot be found ++;http.send.not_found_404 = 0 ++ ++; the hashing algorithm with wich ETags are generated (MD5, SHA1, CRC32B); ++; if ext/hash is available, this can be set to any hash algorithm ext/hash supports ++; MD5 is the default and fallback algorithm ++;http.etag.mode = "MD5" ++ ++; allowed request methods ++; by default PHP ignores unkown request methods ++; PHP will exit with a response status of 405 and an Allow header ++; if it encounters a request method not contained in the specified list ++;http.request.methods.allowed = "HEAD, GET, POST" ++ ++; custom request methods ++;http.request.methods.custom = "KICK, BANN" ++ ++; log file for positive cache hits ++;http.log.cache = ++ ++; log file for redirects ++;http.log.redirect = ++ ++; log file for responses with http_send_file() etc. where the file's not been found ++;http.log.not_found = ++ ++; log file for requests with an unallowed request method ++;http.log.allowed_methods = ++ ++; composite log file (i.e. log all messages to this file) ++;http.log.composite = ++ ++; automatically deflate content if requested/supported by client ++;http.send.deflate.start_auto = 1 ++;http.send.deflate.start_flags = HTTP_DEFLATE_LEVEL_DEF ++ ++; automatically inflate sent content ++;http.send.inflate.start_auto = 0 ++;http.send.inflate.start_flags = ++ ++; global HttpRequestDataShare settings ++;http.request.datashare.cookie = 0 ++;http.request.datashare.dns = 1 ++ ++; limit of idle persistent handles per provider ++;http.persistent.handles.limit = -1 ++ ++; default ident of persistent handles ++;http.persistent.handles.ident = "GLOBAL" +--- /dev/null ++++ b/ext/http/http.c +@@ -0,0 +1,546 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http.c 300300 2010-06-09 07:29:35Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_CURL ++#define HTTP_WANT_EVENT ++#define HTTP_WANT_ZLIB ++#define HTTP_WANT_MAGIC ++#include "php_http.h" ++ ++#include "php_ini.h" ++#include "ext/standard/info.h" ++#include "zend_extensions.h" ++ ++#include "php_http_api.h" ++#include "php_http_cache_api.h" ++#include "php_http_cookie_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_filter_api.h" ++#include "php_http_message_api.h" ++#include "php_http_persistent_handle_api.h" ++#include "php_http_request_api.h" ++#include "php_http_request_datashare_api.h" ++#include "php_http_request_method_api.h" ++#include "php_http_request_pool_api.h" ++#include "php_http_send_api.h" ++#include "php_http_url_api.h" ++ ++#include "php_http_deflatestream_object.h" ++#include "php_http_exception_object.h" ++#include "php_http_inflatestream_object.h" ++#include "php_http_message_object.h" ++#include "php_http_querystring_object.h" ++#include "php_http_request_object.h" ++#include "php_http_requestdatashare_object.h" ++#include "php_http_requestpool_object.h" ++#include "php_http_response_object.h" ++#include "php_http_util_object.h" ++ ++ZEND_DECLARE_MODULE_GLOBALS(http); ++HTTP_DECLARE_ARG_PASS_INFO(); ++ ++#ifdef COMPILE_DL_HTTP ++ZEND_GET_MODULE(http) ++#endif ++ ++/* {{{ http_functions[] */ ++zend_function_entry http_functions[] = { ++ PHP_FE(http_date, NULL) ++ PHP_FE(http_build_url, http_arg_pass_ref_4) ++ PHP_FE(http_build_str, NULL) ++#ifndef ZEND_ENGINE_2 ++ PHP_FALIAS(http_build_query, http_build_str, NULL) ++#endif ++ PHP_FE(http_negotiate_language, http_arg_pass_ref_2) ++ PHP_FE(http_negotiate_charset, http_arg_pass_ref_2) ++ PHP_FE(http_negotiate_content_type, http_arg_pass_ref_2) ++ PHP_FE(http_negotiate, http_arg_pass_ref_3) ++ PHP_FE(http_redirect, NULL) ++ PHP_FE(http_throttle, NULL) ++ PHP_FE(http_send_status, NULL) ++ PHP_FE(http_send_last_modified, NULL) ++ PHP_FE(http_send_content_type, NULL) ++ PHP_FE(http_send_content_disposition, NULL) ++ PHP_FE(http_match_modified, NULL) ++ PHP_FE(http_match_etag, NULL) ++ PHP_FE(http_cache_last_modified, NULL) ++ PHP_FE(http_cache_etag, NULL) ++ PHP_FE(http_send_data, NULL) ++ PHP_FE(http_send_file, NULL) ++ PHP_FE(http_send_stream, NULL) ++ PHP_FE(http_chunked_decode, NULL) ++ PHP_FE(http_parse_message, NULL) ++ PHP_FE(http_parse_headers, NULL) ++ PHP_FE(http_parse_cookie, NULL) ++ PHP_FE(http_build_cookie, NULL) ++ PHP_FE(http_parse_params, NULL) ++ PHP_FE(http_get_request_headers, NULL) ++ PHP_FE(http_get_request_body, NULL) ++ PHP_FE(http_get_request_body_stream, NULL) ++ PHP_FE(http_match_request_header, NULL) ++ PHP_FE(http_persistent_handles_count, NULL) ++ PHP_FE(http_persistent_handles_clean, NULL) ++ PHP_FE(http_persistent_handles_ident, NULL) ++#ifdef HTTP_HAVE_CURL ++ PHP_FE(http_get, http_arg_pass_ref_3) ++ PHP_FE(http_head, http_arg_pass_ref_3) ++ PHP_FE(http_post_data, http_arg_pass_ref_4) ++ PHP_FE(http_post_fields, http_arg_pass_ref_5) ++ PHP_FE(http_put_data, http_arg_pass_ref_4) ++ PHP_FE(http_put_file, http_arg_pass_ref_4) ++ PHP_FE(http_put_stream, http_arg_pass_ref_4) ++ PHP_FE(http_request, http_arg_pass_ref_5) ++ PHP_FE(http_request_body_encode, NULL) ++#endif ++ PHP_FE(http_request_method_register, NULL) ++ PHP_FE(http_request_method_unregister, NULL) ++ PHP_FE(http_request_method_exists, NULL) ++ PHP_FE(http_request_method_name, NULL) ++ PHP_FE(ob_etaghandler, NULL) ++#ifdef HTTP_HAVE_ZLIB ++ PHP_FE(http_deflate, NULL) ++ PHP_FE(http_inflate, NULL) ++ PHP_FE(ob_deflatehandler, NULL) ++ PHP_FE(ob_inflatehandler, NULL) ++#endif ++ PHP_FE(http_support, NULL) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++/* }}} */ ++ ++PHP_MINIT_FUNCTION(http); ++PHP_MSHUTDOWN_FUNCTION(http); ++PHP_RINIT_FUNCTION(http); ++PHP_RSHUTDOWN_FUNCTION(http); ++PHP_MINFO_FUNCTION(http); ++ ++/* {{{ http_module_dep */ ++#if ZEND_EXTENSION_API_NO >= 220050617 ++static zend_module_dep http_module_deps[] = { ++# ifdef HTTP_HAVE_SPL ++ ZEND_MOD_REQUIRED("spl") ++# endif ++# ifdef HTTP_HAVE_HASH ++ ZEND_MOD_REQUIRED("hash") ++# endif ++# ifdef HTTP_HAVE_SESSION ++ ZEND_MOD_REQUIRED("session") ++# endif ++# ifdef HTTP_HAVE_ICONV ++ ZEND_MOD_REQUIRED("iconv") ++# endif ++# ifdef HTTP_HAVE_EVENT ++ ZEND_MOD_CONFLICTS("event") ++#endif ++ {NULL, NULL, NULL, 0} ++}; ++#endif ++/* }}} */ ++ ++/* {{{ http_module_entry */ ++zend_module_entry http_module_entry = { ++#if ZEND_EXTENSION_API_NO >= 220050617 ++ STANDARD_MODULE_HEADER_EX, NULL, ++ http_module_deps, ++#else ++ STANDARD_MODULE_HEADER, ++#endif ++ "http", ++ http_functions, ++ PHP_MINIT(http), ++ PHP_MSHUTDOWN(http), ++ PHP_RINIT(http), ++ PHP_RSHUTDOWN(http), ++ PHP_MINFO(http), ++ PHP_HTTP_VERSION, ++ STANDARD_MODULE_PROPERTIES ++}; ++/* }}} */ ++ ++int http_module_number; ++ ++/* {{{ http_globals */ ++static void http_globals_init_once(zend_http_globals *G) ++{ ++ memset(G, 0, sizeof(zend_http_globals)); ++} ++ ++#define http_globals_init(g) _http_globals_init((g) TSRMLS_CC) ++static inline void _http_globals_init(zend_http_globals *G TSRMLS_DC) ++{ ++#ifdef HTTP_HAVE_SAPI_RTIME ++ G->request.time = sapi_get_request_time(TSRMLS_C); ++#else ++ G->request.time = time(NULL); ++#endif ++ G->send.buffer_size = 0; ++ G->read_post_data = 0; ++} ++ ++#define http_globals_free(g) _http_globals_free((g) TSRMLS_CC) ++static inline void _http_globals_free(zend_http_globals *G TSRMLS_DC) ++{ ++ if (G->request.headers) { ++ zend_hash_destroy(G->request.headers); ++ FREE_HASHTABLE(G->request.headers); ++ G->request.headers = NULL; ++ } ++ STR_SET(G->send.content_type, NULL); ++ STR_SET(G->send.unquoted_etag, NULL); ++ if (G->server_var) { ++ zval_ptr_dtor(&G->server_var); ++ G->server_var = NULL; ++ } ++} ++ ++#if defined(ZTS) && defined(PHP_DEBUG) ++#if ZTS && PHP_DEBUG ++zend_http_globals *http_globals(void) ++{ ++ TSRMLS_FETCH(); ++ return HTTP_G; ++} ++#endif ++#endif ++/* }}} */ ++ ++/* {{{ static inline void http_check_allowed_methods(char *) */ ++#define http_check_allowed_methods(m) _http_check_allowed_methods((m) TSRMLS_CC) ++static inline void _http_check_allowed_methods(const char *methods TSRMLS_DC) ++{ ++ if (*methods && SG(request_info).request_method) { ++ if (SUCCESS != http_check_method_ex(SG(request_info).request_method, methods)) { ++ char *header; ++ spprintf(&header, 0, "Allow: %s", methods); ++ http_exit(405, header); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ PHP_INI */ ++PHP_INI_MH(http_update_allowed_methods) ++{ ++ if (*new_value) { ++ http_check_allowed_methods(new_value); ++ } ++ return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); ++} ++PHP_INI_MH(http_update_persistent_handle_ident) ++{ ++ HTTP_G->persistent.handles.ident.h = zend_hash_func(new_value, HTTP_G->persistent.handles.ident.l = new_value_length+1); ++ return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); ++} ++ ++#ifndef ZEND_ENGINE_2 ++# define OnUpdateLong OnUpdateInt ++#endif ++ ++PHP_INI_BEGIN() ++ HTTP_PHP_INI_ENTRY("http.etag.mode", "MD5", PHP_INI_ALL, OnUpdateString, etag.mode) ++ HTTP_PHP_INI_ENTRY("http.log.cache", "", PHP_INI_ALL, OnUpdateString, log.cache) ++ HTTP_PHP_INI_ENTRY("http.log.redirect", "", PHP_INI_ALL, OnUpdateString, log.redirect) ++ HTTP_PHP_INI_ENTRY("http.log.not_found", "", PHP_INI_ALL, OnUpdateString, log.not_found) ++ HTTP_PHP_INI_ENTRY("http.log.allowed_methods", "", PHP_INI_ALL, OnUpdateString, log.allowed_methods) ++ HTTP_PHP_INI_ENTRY("http.log.composite", "", PHP_INI_ALL, OnUpdateString, log.composite) ++ HTTP_PHP_INI_ENTRY("http.request.methods.allowed", "", PHP_INI_ALL, http_update_allowed_methods, request.methods.allowed) ++ HTTP_PHP_INI_ENTRY("http.request.methods.custom", "", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateString, request.methods.custom) ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) ++ HTTP_PHP_INI_ENTRY("http.request.datashare.cookie", "0", PHP_INI_SYSTEM, OnUpdateBool, request.datashare.cookie) ++ HTTP_PHP_INI_ENTRY("http.request.datashare.dns", "1", PHP_INI_SYSTEM, OnUpdateBool, request.datashare.dns) ++ HTTP_PHP_INI_ENTRY("http.request.datashare.ssl", "0", PHP_INI_SYSTEM, OnUpdateBool, request.datashare.ssl) ++ HTTP_PHP_INI_ENTRY("http.request.datashare.connect", "0", PHP_INI_SYSTEM, OnUpdateBool, request.datashare.connect) ++#endif ++#ifdef HTTP_HAVE_ZLIB ++ HTTP_PHP_INI_ENTRY("http.send.inflate.start_auto", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, send.inflate.start_auto) ++ HTTP_PHP_INI_ENTRY("http.send.inflate.start_flags", "0", PHP_INI_ALL, OnUpdateLong, send.inflate.start_flags) ++ HTTP_PHP_INI_ENTRY("http.send.deflate.start_auto", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, send.deflate.start_auto) ++ HTTP_PHP_INI_ENTRY("http.send.deflate.start_flags", "0", PHP_INI_ALL, OnUpdateLong, send.deflate.start_flags) ++#endif ++ HTTP_PHP_INI_ENTRY("http.persistent.handles.limit", "-1", PHP_INI_SYSTEM, OnUpdateLong, persistent.handles.limit) ++ HTTP_PHP_INI_ENTRY("http.persistent.handles.ident", "GLOBAL", PHP_INI_ALL, http_update_persistent_handle_ident, persistent.handles.ident.s) ++ HTTP_PHP_INI_ENTRY("http.send.not_found_404", "1", PHP_INI_ALL, OnUpdateBool, send.not_found_404) ++#ifdef ZEND_ENGINE_2 ++ HTTP_PHP_INI_ENTRY("http.only_exceptions", "0", PHP_INI_ALL, OnUpdateBool, only_exceptions) ++#endif ++ HTTP_PHP_INI_ENTRY("http.force_exit", "1", PHP_INI_ALL, OnUpdateBool, force_exit) ++PHP_INI_END() ++/* }}} */ ++ ++/* {{{ PHP_MINIT_FUNCTION */ ++PHP_MINIT_FUNCTION(http) ++{ ++ http_module_number = module_number; ++ ZEND_INIT_MODULE_GLOBALS(http, http_globals_init_once, NULL); ++ REGISTER_INI_ENTRIES(); ++ ++ if (0 ++ || SUCCESS != PHP_MINIT_CALL(http_persistent_handle) /* first */ ++ || SUCCESS != PHP_MINIT_CALL(http_cookie) ++#ifdef HTTP_HAVE_ZLIB ++ || SUCCESS != PHP_MINIT_CALL(http_encoding) ++#endif ++#ifdef HTTP_HAVE_CURL ++ || SUCCESS != PHP_MINIT_CALL(http_request) ++# ifdef ZEND_ENGINE_2 ++# endif ++#endif ++ || SUCCESS != PHP_MINIT_CALL(http_request_method) ++ || SUCCESS != PHP_MINIT_CALL(http_send) ++ || SUCCESS != PHP_MINIT_CALL(http_support) ++ || SUCCESS != PHP_MINIT_CALL(http_url) ++ ++#ifdef ZEND_ENGINE_2 ++ || SUCCESS != PHP_MINIT_CALL(http_filter) ++ || SUCCESS != PHP_MINIT_CALL(http_exception_object) ++# ifdef HTTP_HAVE_ZLIB ++ || SUCCESS != PHP_MINIT_CALL(http_deflatestream_object) ++ || SUCCESS != PHP_MINIT_CALL(http_inflatestream_object) ++# endif ++ || SUCCESS != PHP_MINIT_CALL(http_message_object) ++ || SUCCESS != PHP_MINIT_CALL(http_querystring_object) ++# ifdef HTTP_HAVE_CURL ++ || SUCCESS != PHP_MINIT_CALL(http_request_datashare) ++ || SUCCESS != PHP_MINIT_CALL(http_request_pool) ++ || SUCCESS != PHP_MINIT_CALL(http_request_object) ++ || SUCCESS != PHP_MINIT_CALL(http_requestdatashare_object) ++ || SUCCESS != PHP_MINIT_CALL(http_requestpool_object) ++# endif ++# ifndef WONKY ++ || SUCCESS != PHP_MINIT_CALL(http_response_object) ++# endif ++ || SUCCESS != PHP_MINIT_CALL(http_util_object) ++#endif ++ ) { ++ return FAILURE; ++ } ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ PHP_MSHUTDOWN_FUNCTION */ ++PHP_MSHUTDOWN_FUNCTION(http) ++{ ++ UNREGISTER_INI_ENTRIES(); ++ ++ if (0 ++#ifdef HTTP_HAVE_CURL ++ || SUCCESS != PHP_MSHUTDOWN_CALL(http_request) ++# ifdef ZEND_ENGINE_2 ++ || SUCCESS != PHP_MSHUTDOWN_CALL(http_request_datashare) ++# endif ++#endif ++ || SUCCESS != PHP_MSHUTDOWN_CALL(http_message_object) ++ || SUCCESS != PHP_MSHUTDOWN_CALL(http_persistent_handle) /* last */ ++ ) { ++ return FAILURE; ++ } ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ PHP_RINIT_FUNCTION */ ++PHP_RINIT_FUNCTION(http) ++{ ++ http_globals_init(HTTP_G); ++ ++ if (HTTP_G->request.methods.allowed && *HTTP_G->request.methods.allowed) { ++ http_check_allowed_methods(HTTP_G->request.methods.allowed); ++ } ++ ++ if (0 ++#ifdef HTTP_HAVE_ZLIB ++ || SUCCESS != PHP_RINIT_CALL(http_encoding) ++#endif ++#ifdef HTTP_HAVE_CURL ++# ifdef ZEND_ENGINE_2 ++# ifdef HTTP_HAVE_EVENT ++ || SUCCESS != PHP_RINIT_CALL(http_request_pool) ++# endif ++ || SUCCESS != PHP_RINIT_CALL(http_request_datashare) ++# endif ++#endif ++ || SUCCESS != PHP_RINIT_CALL(http_request_method) ++ ) { ++ return FAILURE; ++ } ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ PHP_RSHUTDOWN_FUNCTION */ ++PHP_RSHUTDOWN_FUNCTION(http) ++{ ++ STATUS status = SUCCESS; ++ ++ if (0 ++#ifdef HTTP_HAVE_ZLIB ++ || SUCCESS != PHP_RSHUTDOWN_CALL(http_encoding) ++#endif ++#ifdef HTTP_HAVE_CURL ++# ifdef ZEND_ENGINE_2 ++ || SUCCESS != PHP_RSHUTDOWN_CALL(http_request_datashare) ++# endif ++#endif ++ || SUCCESS != PHP_RSHUTDOWN_CALL(http_request_method) ++ ) { ++ status = FAILURE; ++ } ++ ++ http_globals_free(HTTP_G); ++ return status; ++} ++/* }}} */ ++ ++/* {{{ PHP_MINFO_FUNCTION */ ++PHP_MINFO_FUNCTION(http) ++{ ++ php_info_print_table_start(); ++ { ++ php_info_print_table_header(2, "HTTP Support", "enabled"); ++ php_info_print_table_row(2, "Extension Version", PHP_HTTP_VERSION); ++ php_info_print_table_row(2, "Registered Classes", ++#ifndef ZEND_ENGINE_2 ++ "none" ++#else ++ "HttpUtil, " ++ "HttpMessage, " ++# ifdef HTTP_HAVE_CURL ++ "HttpRequest, " ++ "HttpRequestPool, " ++ "HttpRequestDataShare, " ++# endif ++# ifdef HTTP_HAVE_ZLIB ++ "HttpDeflateStream, " ++ "HttpInflateStream, " ++# endif ++# ifndef WONKY ++ "HttpResponse, " ++# endif ++ "HttpQueryString" ++#endif ++ ); ++ php_info_print_table_row(2, "Output Handlers", "ob_deflatehandler, ob_inflatehandler, ob_etaghandler"); ++ php_info_print_table_row(2, "Stream Filters", ++#ifndef ZEND_ENGINE_2 ++ "none" ++#else ++ "http.chunked_decode, http.chunked_encode, http.deflate, http.inflate" ++#endif ++ ); ++ } ++ php_info_print_table_end(); ++ ++ php_info_print_table_start(); ++ php_info_print_table_header(3, "Used Library", "Compiled", "Linked"); ++ { ++#ifdef HTTP_HAVE_CURL ++ curl_version_info_data *cv = curl_version_info(CURLVERSION_NOW); ++ php_info_print_table_row(3, "libcurl", LIBCURL_VERSION, cv->version); ++#else ++ php_info_print_table_row(2, "libcurl", "disabled", "disabled"); ++#endif ++#ifdef HTTP_HAVE_EVENT ++ php_info_print_table_row(3, "libevent", HTTP_EVENT_VERSION, event_get_version()); ++#else ++ php_info_print_table_row(3, "libevent", "disabled", "disabled"); ++#endif ++#ifdef HTTP_HAVE_ZLIB ++ php_info_print_table_row(3, "libz", ZLIB_VERSION, zlibVersion()); ++#else ++ php_info_print_table_row(3, "libz", "disabled", "disabled"); ++#endif ++#if defined(HTTP_HAVE_MAGIC) ++ php_info_print_table_row(3, "libmagic", "unknown", "unknown"); ++#else ++ php_info_print_table_row(3, "libmagic", "disabled", "disabled"); ++#endif ++ } ++ php_info_print_table_end(); ++ ++ php_info_print_table_start(); ++ php_info_print_table_colspan_header(4, "Persistent Handles"); ++ php_info_print_table_header(4, "Provider", "Ident", "Used", "Free"); ++ { ++ HashTable *ht; ++ HashPosition pos1, pos2; ++ HashKey provider = initHashKey(0), ident = initHashKey(0); ++ zval **val, **sub, **zused, **zfree; ++ ++ if ((ht = http_persistent_handle_statall()) && zend_hash_num_elements(ht)) { ++ FOREACH_HASH_KEYVAL(pos1, ht, provider, val) { ++ if (zend_hash_num_elements(Z_ARRVAL_PP(val))) { ++ FOREACH_KEYVAL(pos2, *val, ident, sub) { ++ if ( SUCCESS == zend_hash_find(Z_ARRVAL_PP(sub), ZEND_STRS("used"), (void *) &zused) && ++ SUCCESS == zend_hash_find(Z_ARRVAL_PP(sub), ZEND_STRS("free"), (void *) &zfree)) { ++ zval *used = http_zsep(IS_STRING, *zused); ++ zval *free = http_zsep(IS_STRING, *zfree); ++ php_info_print_table_row(4, provider.str, ident.str, Z_STRVAL_P(used), Z_STRVAL_P(free)); ++ zval_ptr_dtor(&used); ++ zval_ptr_dtor(&free); ++ } else { ++ php_info_print_table_row(4, provider.str, ident.str, "0", "0"); ++ } ++ } ++ } else { ++ php_info_print_table_row(4, provider.str, "N/A", "0", "0"); ++ } ++ } ++ } else { ++ php_info_print_table_row(4, "N/A", "N/A", "0", "0"); ++ } ++ if (ht) { ++ zend_hash_destroy(ht); ++ FREE_HASHTABLE(ht); ++ } ++ } ++ php_info_print_table_end(); ++ ++ php_info_print_table_start(); ++ php_info_print_table_colspan_header(2, "Request Methods"); ++ { ++ HashPosition pos; ++ phpstr *methods = phpstr_new(); ++ char **name; ++ ++ FOREACH_HASH_VAL(pos, &HTTP_G->request.methods.registered, name) { ++ if (pos->h) { ++ phpstr_appendf(methods, "%s, ", *name); ++ } ++ } ++ phpstr_fix(methods); ++ php_info_print_table_row(2, "Registered", PHPSTR_VAL(methods)); ++ php_info_print_table_row(2, "Allowed", *HTTP_G->request.methods.allowed ? HTTP_G->request.methods.allowed : "(ANY)"); ++ phpstr_free(&methods); ++ } ++ php_info_print_table_end(); ++ ++ DISPLAY_INI_ENTRIES(); ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http.dsp +@@ -0,0 +1,257 @@ ++# Microsoft Developer Studio Project File - Name="http" - Package Owner=<4> ++# Microsoft Developer Studio Generated Build File, Format Version 6.00 ++# ** DO NOT EDIT ** ++ ++# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 ++ ++CFG=http - Win32 Release_TS ++!MESSAGE This is not a valid makefile. To build this project using NMAKE, ++!MESSAGE use the Export Makefile command and run ++!MESSAGE ++!MESSAGE NMAKE /f "http.mak". ++!MESSAGE ++!MESSAGE You can specify a configuration when running NMAKE ++!MESSAGE by defining the macro CFG on the command line. For example: ++!MESSAGE ++!MESSAGE NMAKE /f "http.mak" CFG="http - Win32 Release_TS" ++!MESSAGE ++!MESSAGE Possible choices for configuration are: ++!MESSAGE ++!MESSAGE "http - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") ++!MESSAGE "http - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") ++!MESSAGE ++ ++# Begin Project ++# PROP AllowPerConfigDependencies 0 ++# PROP Scc_ProjName "" ++# PROP Scc_LocalPath "" ++CPP=cl.exe ++MTL=midl.exe ++RSC=rc.exe ++ ++!IF "$(CFG)" == "http - Win32 Release_TS" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "Release_TS" ++# PROP BASE Intermediate_Dir "Release_TS" ++# PROP BASE Ignore_Export_Lib 0 ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "Release_TS" ++# PROP Intermediate_Dir "Release_TS" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_HTTP" /D ZTS=1 /YX /FD /c ++# ADD CPP /nologo /Gd /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HTTP_EXPORTS" /D "COMPILE_DL_HTTP" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_HTTP=1 /D HTTP_HAVE_CURL=1 /D HAVE_CURL_EASY_STRERROR=1 /D HAVE_CURL_SHARE_STRERROR=1 /D HAVE_CURL_MULTI_STRERROR=1 /D HAVE_CURL_EASY_RESET=1 /D HAVE_CURL_FORMGET=1 /D HAVE_GETHOSTNAME=1 /D HAVE_GETSERVBYPORT=1 /D HAVE_GETSERVBYNAME=1 /D "_WINSOCKAPI_=" /FR /YX /FD /c ++# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 ++# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 ++# ADD BASE RSC /l 0x406 /d "NDEBUG" ++# ADD RSC /l 0x406 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 ++# ADD LINK32 libcurl.lib ssleay32.lib libeay32.lib zlib.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_http.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib" /libpath:"..\..\..\php4\Release_TS" /libpath:"..\..\..\php4\Release_TS_Inline" ++ ++!ELSEIF "$(CFG)" == "http - Win32 Debug_TS" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "Debug_TS" ++# PROP BASE Intermediate_Dir "Debug_TS" ++# PROP BASE Ignore_Export_Lib 0 ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "Debug_TS" ++# PROP Intermediate_Dir "Debug_TS" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_HTTP" /D ZTS=1 /YX /FD /c ++# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HTTP_EXPORTS" /D "COMPILE_DL_HTTP" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_HTTP=1 /D HTTP_HAVE_CURL=1 /D HAVE_CURL_EASY_STRERROR=1 /D HAVE_CURL_SHARE_STRERROR=1 /D HAVE_CURL_MULTI_STRERROR=1 /D HAVE_CURL_EASY_RESET=1 /D HAVE_CURL_FORMGET=1 /D HAVE_GETHOSTNAME=1 /D HAVE_GETSERVBYPORT=1 /D HAVE_GETSERVBYNAME=1 /D "_WINSOCKAPI_=" /YX /FD /c ++# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 ++# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 ++# ADD BASE RSC /l 0x406 /d "NDEBUG" ++# ADD RSC /l 0x406 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 ++# ADD LINK32 libcurl.lib ssleay32.lib libeay32.lib zlib.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts_debug.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/http.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib" /libpath:"..\..\..\php4\Release_TS" /libpath:"..\..\..\php4\Release_TS_Inline" ++ ++!ENDIF ++ ++# Begin Target ++ ++# Name "http - Win32 Release_TS" ++# Name "http - Win32 Debug_TS" ++# Begin Group "Source Files" ++ ++# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" ++# Begin Source File ++ ++SOURCE=.\http.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_encoding_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_request_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_request_info.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_request_body_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_request_method_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_functions.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_persistent_handle_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_cache_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_cookie_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_date_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_headers_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_message_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_send_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_url_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_querystring_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_info_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\phpstr\phpstr.c ++# End Source File ++# End Group ++# Begin Group "Header Files" ++ ++# PROP Default_Filter "h;hpp;hxx;hm;inl" ++# Begin Source File ++ ++SOURCE=.\php_http.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_encoding_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_request_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_request_int.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_request_body_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_request_method_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_persistent_handle_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_cache_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_cookie_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_date_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_message_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_send_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_headers_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_url_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_querystring_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_info_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_std_defs.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\phpstr\phpstr.h ++# End Source File ++# End Group ++# Begin Group "Resource Files" ++ ++# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" ++# End Group ++# End Target ++# End Project +--- /dev/null ++++ b/ext/http/http_api.c +@@ -0,0 +1,754 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_api.c 323405 2012-02-21 10:05:05Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#include "php_http.h" ++ ++#include "php_output.h" ++#include "ext/standard/url.h" ++#include "ext/standard/php_lcg.h" ++ ++#include "php_http_api.h" ++#include "php_http_send_api.h" ++ ++#ifdef ZEND_ENGINE_2 ++# include "php_http_exception_object.h" ++#endif ++ ++PHP_MINIT_FUNCTION(http_support) ++{ ++ HTTP_LONG_CONSTANT("HTTP_SUPPORT", HTTP_SUPPORT); ++ HTTP_LONG_CONSTANT("HTTP_SUPPORT_REQUESTS", HTTP_SUPPORT_REQUESTS); ++ HTTP_LONG_CONSTANT("HTTP_SUPPORT_MAGICMIME", HTTP_SUPPORT_MAGICMIME); ++ HTTP_LONG_CONSTANT("HTTP_SUPPORT_ENCODINGS", HTTP_SUPPORT_ENCODINGS); ++ HTTP_LONG_CONSTANT("HTTP_SUPPORT_SSLREQUESTS", HTTP_SUPPORT_SSLREQUESTS); ++ HTTP_LONG_CONSTANT("HTTP_SUPPORT_EVENTS", HTTP_SUPPORT_EVENTS); ++ ++ HTTP_LONG_CONSTANT("HTTP_PARAMS_ALLOW_COMMA", HTTP_PARAMS_ALLOW_COMMA); ++ HTTP_LONG_CONSTANT("HTTP_PARAMS_ALLOW_FAILURE", HTTP_PARAMS_ALLOW_FAILURE); ++ HTTP_LONG_CONSTANT("HTTP_PARAMS_RAISE_ERROR", HTTP_PARAMS_RAISE_ERROR); ++ HTTP_LONG_CONSTANT("HTTP_PARAMS_DEFAULT", HTTP_PARAMS_DEFAULT); ++ ++ return SUCCESS; ++} ++ ++PHP_HTTP_API long _http_support(long feature) ++{ ++ long support = HTTP_SUPPORT; ++ ++#ifdef HTTP_HAVE_CURL ++ support |= HTTP_SUPPORT_REQUESTS; ++# ifdef HTTP_HAVE_SSL ++ support |= HTTP_SUPPORT_SSLREQUESTS; ++# endif ++# ifdef HTTP_HAVE_EVENT ++ support |= HTTP_SUPPORT_EVENTS; ++# endif ++#endif ++#ifdef HTTP_HAVE_MAGIC ++ support |= HTTP_SUPPORT_MAGICMIME; ++#endif ++#ifdef HTTP_HAVE_ZLIB ++ support |= HTTP_SUPPORT_ENCODINGS; ++#endif ++ ++ if (feature) { ++ return (feature == (support & feature)); ++ } ++ return support; ++} ++ ++/* char *pretty_key(char *, size_t, zend_bool, zend_bool) */ ++char *_http_pretty_key(char *key, size_t key_len, zend_bool uctitle, zend_bool xhyphen) ++{ ++ size_t i; ++ int wasalpha; ++ ++ if (key && key_len) { ++ if ((wasalpha = HTTP_IS_CTYPE(alpha, key[0]))) { ++ key[0] = (char) (uctitle ? HTTP_TO_CTYPE(upper, key[0]) : HTTP_TO_CTYPE(lower, key[0])); ++ } ++ for (i = 1; i < key_len; i++) { ++ if (HTTP_IS_CTYPE(alpha, key[i])) { ++ key[i] = (char) (((!wasalpha) && uctitle) ? HTTP_TO_CTYPE(upper, key[i]) : HTTP_TO_CTYPE(lower, key[i])); ++ wasalpha = 1; ++ } else { ++ if (xhyphen && (key[i] == '_')) { ++ key[i] = '-'; ++ } ++ wasalpha = 0; ++ } ++ } ++ } ++ return key; ++} ++/* }}} */ ++ ++/* {{{ http_boundary(char *, size_t) */ ++size_t _http_boundary(char *buf, size_t buf_len TSRMLS_DC) ++{ ++ return snprintf(buf, buf_len, "%lu%0.9f", (ulong) HTTP_G->request.time, (float) php_combined_lcg(TSRMLS_C)); ++} ++/* }}} */ ++ ++/* {{{ void http_error(long, long, char*) */ ++void _http_error_ex(long type TSRMLS_DC, long code, const char *format, ...) ++{ ++ va_list args; ++ ++ va_start(args, format); ++#ifdef ZEND_ENGINE_2 ++ if ((type == E_THROW) || (GLOBAL_ERROR_HANDLING == EH_THROW)) { ++ char *message; ++ zend_class_entry *ce = http_exception_get_for_code(code); ++ ++ http_try { ++ vspprintf(&message, 0, format, args); ++ zend_throw_exception(ce, message, code TSRMLS_CC); ++ efree(message); ++ } http_catch(GLOBAL_EXCEPTION_CLASS ? GLOBAL_EXCEPTION_CLASS : HTTP_EX_DEF_CE); ++ } else ++#endif ++ php_verror(NULL, "", type, format, args TSRMLS_CC); ++ va_end(args); ++} ++/* }}} */ ++ ++#ifdef ZEND_ENGINE_2 ++static inline void copy_bt_args(zval *from, zval *to TSRMLS_DC) ++{ ++ zval **args, **trace_0, *old_trace_0, *trace = NULL; ++ ++ if ((trace = zend_read_property(ZEND_EXCEPTION_GET_DEFAULT(), from, "trace", lenof("trace"), 0 TSRMLS_CC))) { ++ if (Z_TYPE_P(trace) == IS_ARRAY && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(trace), 0, (void *) &trace_0)) { ++ old_trace_0 = *trace_0; ++ if (Z_TYPE_PP(trace_0) == IS_ARRAY && SUCCESS == zend_hash_find(Z_ARRVAL_PP(trace_0), "args", sizeof("args"), (void *) &args)) { ++ if ((trace = zend_read_property(ZEND_EXCEPTION_GET_DEFAULT(), to, "trace", lenof("trace"), 0 TSRMLS_CC))) { ++ if (Z_TYPE_P(trace) == IS_ARRAY && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(trace), 0, (void *) &trace_0)) { ++ ZVAL_ADDREF(*args); ++ add_assoc_zval(*trace_0, "args", *args); ++ } ++ } ++ } ++ } ++ } ++} ++ ++/* {{{ zval *http_exception_wrap(zval *, zval *, zend_class_entry *) */ ++zval *_http_exception_wrap(zval *old_exception, zval *new_exception, zend_class_entry *ce TSRMLS_DC) ++{ ++ int inner = 1; ++ char *message; ++ zval *sub_exception, *tmp_exception; ++ ++ if (!new_exception) { ++ MAKE_STD_ZVAL(new_exception); ++ object_init_ex(new_exception, ce); ++ ++ zend_update_property(ce, new_exception, "innerException", lenof("innerException"), old_exception TSRMLS_CC); ++ copy_bt_args(old_exception, new_exception TSRMLS_CC); ++ ++ sub_exception = old_exception; ++ ++ while ((sub_exception = zend_read_property(Z_OBJCE_P(sub_exception), sub_exception, "innerException", lenof("innerException"), 0 TSRMLS_CC)) && Z_TYPE_P(sub_exception) == IS_OBJECT) { ++ ++inner; ++ } ++ ++ spprintf(&message, 0, "Exception caused by %d inner exception(s)", inner); ++ zend_update_property_string(ZEND_EXCEPTION_GET_DEFAULT(), new_exception, "message", lenof("message"), message TSRMLS_CC); ++ efree(message); ++ } else { ++ sub_exception = new_exception; ++ tmp_exception = new_exception; ++ ++ while ((tmp_exception = zend_read_property(Z_OBJCE_P(tmp_exception), tmp_exception, "innerException", lenof("innerException"), 0 TSRMLS_CC)) && Z_TYPE_P(tmp_exception) == IS_OBJECT) { ++ sub_exception = tmp_exception; ++ } ++ ++ zend_update_property(Z_OBJCE_P(sub_exception), sub_exception, "innerException", lenof("innerException"), old_exception TSRMLS_CC); ++ copy_bt_args(old_exception, new_exception TSRMLS_CC); ++ copy_bt_args(old_exception, sub_exception TSRMLS_CC); ++ } ++#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3 ++ Z_ADDREF_P(old_exception); ++ zend_exception_set_previous(new_exception, old_exception TSRMLS_CC); ++#endif ++ zval_ptr_dtor(&old_exception); ++ return new_exception; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_object_new(zend_object_value *, const char *, uint, http_object_new_t, zend_class_entry *, void *, void **) */ ++STATUS _http_object_new(zend_object_value *ov, const char *cname_str, uint cname_len, http_object_new_t create, zend_class_entry *parent_ce, void *intern_ptr, void **obj_ptr TSRMLS_DC) ++{ ++ zend_class_entry *ce = parent_ce; ++ ++ if (cname_str && cname_len) { ++ if (!(ce = zend_fetch_class(HTTP_ZAPI_CONST_CAST(char *) cname_str, cname_len, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC))) { ++ return FAILURE; ++ } ++ if (!instanceof_function(ce, parent_ce TSRMLS_CC)) { ++ http_error_ex(HE_WARNING, HTTP_E_RUNTIME, "Class %s does not extend %s", cname_str, parent_ce->name); ++ return FAILURE; ++ } ++ } ++ ++ *ov = create(ce, intern_ptr, obj_ptr TSRMLS_CC); ++ return SUCCESS; ++} ++/* }}} */ ++#endif /* ZEND_ENGINE_2 */ ++ ++/* {{{ void http_log(char *, char *, char *) */ ++void _http_log_ex(char *file, const char *ident, const char *message TSRMLS_DC) ++{ ++ time_t now; ++ struct tm nowtm; ++ char datetime[20] = {0}; ++ ++ now = HTTP_G->request.time; ++ strftime(datetime, sizeof(datetime), "%Y-%m-%d %H:%M:%S", php_localtime_r(&now, &nowtm)); ++ ++#define HTTP_LOG_WRITE(file, type, msg) \ ++ if (file && *file) { \ ++ php_stream *log = php_stream_open_wrapper_ex(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT); \ ++ \ ++ if (log) { \ ++ php_stream_printf(log TSRMLS_CC, "%s\t[%s]\t%s\t<%s>%s", datetime, type, msg, SG(request_info).request_uri, PHP_EOL); \ ++ php_stream_close(log); \ ++ } \ ++ \ ++ } ++ ++ HTTP_LOG_WRITE(file, ident, message); ++ HTTP_LOG_WRITE(HTTP_G->log.composite, ident, message); ++} ++/* }}} */ ++ ++static void http_ob_blackhole(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) ++{ ++ *handled_output = ecalloc(1,1); ++ *handled_output_len = 0; ++} ++ ++/* {{{ STATUS http_exit(int, char*, char*) */ ++STATUS _http_exit_ex(int status, char *header, char *body, zend_bool send_header TSRMLS_DC) ++{ ++ if ( (send_header && (SUCCESS != http_send_status_header(status, header))) || ++ (status && (SUCCESS != http_send_status(status)))) { ++ http_error_ex(HE_WARNING, HTTP_E_HEADER, "Failed to exit with status/header: %d - %s", status, STR_PTR(header)); ++ STR_FREE(header); ++ STR_FREE(body); ++ return FAILURE; ++ } ++ ++#ifndef PHP_OUTPUT_NEWAPI ++ if (!OG(ob_lock) && ++ !php_ob_handler_used("zlib output compression" TSRMLS_CC) && !php_ob_handler_used("ob_gzhandler" TSRMLS_CC)) { ++ php_end_ob_buffers(0 TSRMLS_CC); ++ } ++#endif ++ ++ if ((SUCCESS == sapi_send_headers(TSRMLS_C)) && body) { ++ PHPWRITE(body, strlen(body)); ++ } ++ ++ switch (status) { ++ case 301: http_log(HTTP_G->log.redirect, "301-REDIRECT", header); break; ++ case 302: http_log(HTTP_G->log.redirect, "302-REDIRECT", header); break; ++ case 303: http_log(HTTP_G->log.redirect, "303-REDIRECT", header); break; ++ case 305: http_log(HTTP_G->log.redirect, "305-REDIRECT", header); break; ++ case 307: http_log(HTTP_G->log.redirect, "307-REDIRECT", header); break; ++ case 304: http_log(HTTP_G->log.cache, "304-CACHE", header); break; ++ case 404: http_log(HTTP_G->log.not_found, "404-NOTFOUND", NULL); break; ++ case 405: http_log(HTTP_G->log.allowed_methods, "405-ALLOWED", header); break; ++ default: http_log(NULL, header, body); break; ++ } ++ ++ STR_FREE(header); ++ STR_FREE(body); ++ ++ if (HTTP_G->force_exit) { ++ zend_bailout(); ++ } else { ++#ifdef PHP_OUTPUT_NEWAPI ++ php_output_start_devnull(TSRMLS_C); ++#else ++ php_ob_set_internal_handler(http_ob_blackhole, 4096, "blackhole", 0 TSRMLS_CC); ++#endif ++ } ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_check_method(char *) */ ++STATUS _http_check_method_ex(const char *method, const char *methods) ++{ ++ const char *found; ++ ++ if ( (found = strstr(methods, method)) && ++ (found == method || !HTTP_IS_CTYPE(alpha, found[-1])) && ++ (strlen(found) >= strlen(method) && !HTTP_IS_CTYPE(alpha, found[strlen(method)]))) { ++ return SUCCESS; ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ zval *http_get_server_var_ex(char *, size_t) */ ++PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_len, zend_bool check TSRMLS_DC) ++{ ++ zval **hsv, **var; ++ char *env; ++ ++ /* if available, this is a lot faster than accessing $_SERVER */ ++ if (sapi_module.getenv) { ++ if ((!(env = sapi_module.getenv((char *) key, key_len TSRMLS_CC))) || (check && !*env)) { ++ return NULL; ++ } ++ if (HTTP_G->server_var) { ++ zval_ptr_dtor(&HTTP_G->server_var); ++ } ++ MAKE_STD_ZVAL(HTTP_G->server_var); ++ ZVAL_STRING(HTTP_G->server_var, env, 1); ++ return HTTP_G->server_var; ++ } ++ ++#ifdef ZEND_ENGINE_2 ++ zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC); ++#endif ++ ++ if ((SUCCESS != zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void *) &hsv)) || (Z_TYPE_PP(hsv) != IS_ARRAY)) { ++ return NULL; ++ } ++ if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(hsv), HTTP_ZAPI_CONST_CAST(char *) key, key_len + 1, (void *) &var))) { ++ return NULL; ++ } ++ if (check && !((Z_TYPE_PP(var) == IS_STRING) && Z_STRVAL_PP(var) && Z_STRLEN_PP(var))) { ++ return NULL; ++ } ++ return *var; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_get_request_body(char **, size_t *) */ ++PHP_HTTP_API STATUS _http_get_request_body_ex(char **body, size_t *length, zend_bool dup TSRMLS_DC) ++{ ++ *length = 0; ++ *body = NULL; ++ ++ if (SG(request_info).raw_post_data) { ++ *length = SG(request_info).raw_post_data_length; ++ *body = SG(request_info).raw_post_data; ++ ++ if (dup) { ++ *body = estrndup(*body, *length); ++ } ++ return SUCCESS; ++ } else if (sapi_module.read_post && !HTTP_G->read_post_data) { ++ char *buf = emalloc(4096); ++ int len; ++ ++ HTTP_G->read_post_data = 1; ++ ++ while (0 < (len = sapi_module.read_post(buf, 4096 TSRMLS_CC))) { ++ SG(read_post_bytes) += len; ++ *body = erealloc(*body, *length + len + 1); ++ memcpy(*body + *length, buf, len); ++ *length += len; ++ (*body)[*length] = '\0'; ++ if (len < 4096) { ++ break; ++ } ++ } ++ efree(buf); ++ ++ /* check for error */ ++ if (len < 0) { ++ STR_FREE(*body); ++ *length = 0; ++ return FAILURE; ++ } ++ ++ SG(request_info).raw_post_data = *body; ++ SG(request_info).raw_post_data_length = *length; ++ ++ if (dup) { ++ *body = estrndup(*body, *length); ++ } ++ return SUCCESS; ++ } ++ ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ php_stream *http_get_request_body_stream(void) */ ++PHP_HTTP_API php_stream *_http_get_request_body_stream(TSRMLS_D) ++{ ++ php_stream *s = NULL; ++ ++ if (SG(request_info).raw_post_data) { ++ s = php_stream_open_wrapper("php://input", "rb", 0, NULL); ++ } else if (sapi_module.read_post && !HTTP_G->read_post_data) { ++ HTTP_G->read_post_data = 1; ++ ++ if ((s = php_stream_temp_new())) { ++ char *buf = emalloc(4096); ++ int len; ++ ++ while (0 < (len = sapi_module.read_post(buf, 4096 TSRMLS_CC))) { ++ SG(read_post_bytes) += len; ++ php_stream_write(s, buf, len); ++ if (len < 4096) { ++ break; ++ } ++ } ++ efree(buf); ++ ++ if (len < 0) { ++ php_stream_close(s); ++ s = NULL; ++ } else { ++ php_stream_rewind(s); ++ } ++ } ++ } ++ ++ return s; ++} ++/* }}} */ ++ ++/* {{{ void http_parse_params_default_callback(...) */ ++PHP_HTTP_API void _http_parse_params_default_callback(void *arg, const char *key, int keylen, const char *val, int vallen TSRMLS_DC) ++{ ++ char *kdup; ++ zval tmp, *entry; ++ HashTable *ht = (HashTable *) arg; ++ ++ if (ht) { ++ INIT_ZARR(tmp, ht); ++ ++ if (vallen) { ++ MAKE_STD_ZVAL(entry); ++ array_init(entry); ++ if (keylen) { ++ kdup = estrndup(key, keylen); ++ add_assoc_stringl_ex(entry, kdup, keylen + 1, (char *) val, vallen, 1); ++ efree(kdup); ++ } else { ++ add_next_index_stringl(entry, (char *) val, vallen, 1); ++ } ++ add_next_index_zval(&tmp, entry); ++ } else { ++ add_next_index_stringl(&tmp, (char *) key, keylen, 1); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ STATUS http_parse_params(const char *, HashTable *) */ ++PHP_HTTP_API STATUS _http_parse_params_ex(const char *param, int flags, http_parse_params_callback cb, void *cb_arg TSRMLS_DC) ++{ ++#define ST_QUOTE 1 ++#define ST_VALUE 2 ++#define ST_KEY 3 ++#define ST_ASSIGN 4 ++#define ST_ADD 5 ++ ++ int st = ST_KEY, keylen = 0, vallen = 0; ++ char *s, *c, *key = NULL, *val = NULL; ++ ++ for(c = s = estrdup(param);;) { ++ continued: ++#if 0 ++ { ++ char *tk = NULL, *tv = NULL; ++ ++ if (key) { ++ if (keylen) { ++ tk= estrndup(key, keylen); ++ } else { ++ tk = ecalloc(1, 7); ++ memcpy(tk, key, 3); ++ tk[3]='.'; tk[4]='.'; tk[5]='.'; ++ } ++ } ++ if (val) { ++ if (vallen) { ++ tv = estrndup(val, vallen); ++ } else { ++ tv = ecalloc(1, 7); ++ memcpy(tv, val, 3); ++ tv[3]='.'; tv[4]='.'; tv[5]='.'; ++ } ++ } ++ fprintf(stderr, "[%6s] %c \"%s=%s\"\n", ++ ( ++ st == ST_QUOTE ? "QUOTE" : ++ st == ST_VALUE ? "VALUE" : ++ st == ST_KEY ? "KEY" : ++ st == ST_ASSIGN ? "ASSIGN" : ++ st == ST_ADD ? "ADD": ++ "HUH?" ++ ), *c?*c:'0', tk, tv ++ ); ++ STR_FREE(tk); STR_FREE(tv); ++ } ++#endif ++ switch (st) { ++ case ST_QUOTE: ++ quote: ++ if (*c == '"') { ++ if (*(c-1) == '\\') { ++ memmove(c-1, c, strlen(c)+1); ++ goto quote; ++ } else { ++ goto add; ++ } ++ } else { ++ if (!val) { ++ val = c; ++ } ++ if (!*c) { ++ --val; ++ st = ST_ADD; ++ } ++ } ++ break; ++ ++ case ST_VALUE: ++ switch (*c) { ++ case '"': ++ if (!val) { ++ st = ST_QUOTE; ++ } ++ break; ++ ++ case ' ': ++ break; ++ ++ case ';': ++ case '\0': ++ goto add; ++ break; ++ case ',': ++ if (flags & HTTP_PARAMS_ALLOW_COMMA) { ++ goto add; ++ } ++ default: ++ if (!val) { ++ val = c; ++ } ++ break; ++ } ++ break; ++ ++ case ST_KEY: ++ switch (*c) { ++ case ',': ++ if (flags & HTTP_PARAMS_ALLOW_COMMA) { ++ goto allow_comma; ++ } ++ case '\r': ++ case '\n': ++ case '\t': ++ case '\013': ++ case '\014': ++ goto failure; ++ break; ++ ++ case ' ': ++ if (key) { ++ keylen = c - key; ++ st = ST_ASSIGN; ++ } ++ break; ++ ++ case ';': ++ case '\0': ++ allow_comma: ++ if (key) { ++ keylen = c-- - key; ++ st = ST_ADD; ++ } ++ break; ++ ++ case ':': ++ if (!(flags & HTTP_PARAMS_COLON_SEPARATOR)) { ++ goto not_separator; ++ } ++ if (key) { ++ keylen = c - key; ++ st = ST_VALUE; ++ } else { ++ goto failure; ++ } ++ break; ++ ++ case '=': ++ if (flags & HTTP_PARAMS_COLON_SEPARATOR) { ++ goto not_separator; ++ } ++ if (key) { ++ keylen = c - key; ++ st = ST_VALUE; ++ } else { ++ goto failure; ++ } ++ break; ++ ++ default: ++ not_separator: ++ if (!key) { ++ key = c; ++ } ++ break; ++ } ++ break; ++ ++ case ST_ASSIGN: ++ if (*c == '=') { ++ st = ST_VALUE; ++ } else if (!*c || *c == ';' || ((flags & HTTP_PARAMS_ALLOW_COMMA) && *c == ',')) { ++ st = ST_ADD; ++ } else if (*c != ' ') { ++ goto failure; ++ } ++ break; ++ ++ case ST_ADD: ++ add: ++ if (val) { ++ vallen = c - val; ++ if (st != ST_QUOTE) { ++ while (val[vallen-1] == ' ') --vallen; ++ } ++ } else { ++ val = ""; ++ vallen = 0; ++ } ++ ++ cb(cb_arg, key, keylen, val, vallen TSRMLS_CC); ++ ++ st = ST_KEY; ++ key = val = NULL; ++ keylen = vallen = 0; ++ break; ++ } ++ if (*c) { ++ ++c; ++ } else if (st == ST_ADD) { ++ goto add; ++ } else { ++ break; ++ } ++ } ++ ++ efree(s); ++ return SUCCESS; ++ ++failure: ++ if (flags & HTTP_PARAMS_RAISE_ERROR) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Unexpected character (%c) at pos %tu of %zu", *c, c-s, strlen(s)); ++ } ++ if (flags & HTTP_PARAMS_ALLOW_FAILURE) { ++ if (st == ST_KEY) { ++ if (key) { ++ keylen = c - key; ++ } else { ++ key = c; ++ } ++ } else { ++ --c; ++ } ++ st = ST_ADD; ++ goto continued; ++ } ++ efree(s); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ array_join */ ++int apply_array_append_func(void *pDest HTTP_ZAPI_HASH_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) ++{ ++ int flags; ++ char *key = NULL; ++ HashTable *dst; ++ zval **data = NULL, **value = (zval **) pDest; ++ ++ dst = va_arg(args, HashTable *); ++ flags = va_arg(args, int); ++ ++ if ((!(flags & ARRAY_JOIN_STRONLY)) || hash_key->nKeyLength) { ++ if ((flags & ARRAY_JOIN_PRETTIFY) && hash_key->nKeyLength) { ++ key = pretty_key(estrndup(hash_key->arKey, hash_key->nKeyLength - 1), hash_key->nKeyLength - 1, 1, 1); ++ zend_hash_find(dst, key, hash_key->nKeyLength, (void *) &data); ++ } else { ++ zend_hash_quick_find(dst, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void *) &data); ++ } ++ ++ ZVAL_ADDREF(*value); ++ if (data) { ++ add_next_index_zval(http_zset(IS_ARRAY, *data), *value); ++ } else if (key) { ++ zend_hash_add(dst, key, hash_key->nKeyLength, value, sizeof(zval *), NULL); ++ } else { ++ zend_hash_quick_add(dst, hash_key->arKey, hash_key->nKeyLength, hash_key->h, value, sizeof(zval *), NULL); ++ } ++ ++ if (key) { ++ efree(key); ++ } ++ } ++ ++ return ZEND_HASH_APPLY_KEEP; ++} ++ ++int apply_array_merge_func(void *pDest HTTP_ZAPI_HASH_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) ++{ ++ int flags; ++ char *key = NULL; ++ HashTable *dst; ++ zval **value = (zval **) pDest; ++ ++ dst = va_arg(args, HashTable *); ++ flags = va_arg(args, int); ++ ++ if ((!(flags & ARRAY_JOIN_STRONLY)) || hash_key->nKeyLength) { ++ ZVAL_ADDREF(*value); ++ if ((flags & ARRAY_JOIN_PRETTIFY) && hash_key->nKeyLength) { ++ key = pretty_key(estrndup(hash_key->arKey, hash_key->nKeyLength - 1), hash_key->nKeyLength - 1, 1, 1); ++ zend_hash_update(dst, key, hash_key->nKeyLength, (void *) value, sizeof(zval *), NULL); ++ efree(key); ++ } else { ++ zend_hash_quick_update(dst, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void *) value, sizeof(zval *), NULL); ++ } ++ } ++ ++ return ZEND_HASH_APPLY_KEEP; ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_cache_api.c +@@ -0,0 +1,267 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_cache_api.c 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#include "php_http.h" ++ ++#include "php_output.h" ++#include "php_streams.h" ++ ++#include "php_http_api.h" ++#include "php_http_cache_api.h" ++#include "php_http_date_api.h" ++#include "php_http_send_api.h" ++ ++/* {{{ char *http_etag(void *, size_t, http_send_mode) */ ++PHP_HTTP_API char *_http_etag(const void *data_ptr, size_t data_len, http_send_mode data_mode TSRMLS_DC) ++{ ++ void *ctx = http_etag_init(); ++ ++ if (data_mode == SEND_DATA) { ++ http_etag_update(ctx, data_ptr, data_len); ++ } else { ++ STATUS ss = FAILURE; ++ php_stream_statbuf ssb; ++ ++ if (data_mode == SEND_RSRC) { ++ ss = php_stream_stat((php_stream *) data_ptr, &ssb); ++ } else { ++ ss = php_stream_stat_path((char *) data_ptr, &ssb); ++ } ++ ++ if (SUCCESS != ss) { ++ efree(ctx); ++ return NULL; ++ } else { ++ size_t ssb_len; ++ char ssb_buf[128]; ++ ++ ssb_len = snprintf(ssb_buf, sizeof(ssb_buf), "%ld=%ld=%ld", (long) ssb.sb.st_mtime, ++ (long) ssb.sb.st_ino, ++ (long) ssb.sb.st_size); ++ http_etag_update(ctx, ssb_buf, ssb_len); ++ } ++ } ++ ++ return http_etag_finish(ctx); ++} ++/* }}} */ ++ ++/* {{{ time_t http_last_modified(void *, http_send_mode) */ ++PHP_HTTP_API time_t _http_last_modified(const void *data_ptr, http_send_mode data_mode TSRMLS_DC) ++{ ++ php_stream_statbuf ssb; ++ ++ switch (data_mode) { ++ case SEND_DATA: return HTTP_G->request.time; ++ case SEND_RSRC: return php_stream_stat((php_stream *) data_ptr, &ssb) ? 0 : ssb.sb.st_mtime; ++ default: return php_stream_stat_path((char *) data_ptr, &ssb) ? 0 : ssb.sb.st_mtime; ++ } ++} ++/* }}} */ ++ ++/* {{{ zend_bool http_match_last_modified(char *, time_t) */ ++PHP_HTTP_API zend_bool _http_match_last_modified_ex(const char *entry, time_t t, zend_bool enforce_presence TSRMLS_DC) ++{ ++ zend_bool retval; ++ zval *zmodified; ++ char *modified, *chr_ptr; ++ ++ if (!(zmodified = http_get_server_var(entry, 1))) { ++ return !enforce_presence; ++ } ++ ++ modified = estrndup(Z_STRVAL_P(zmodified), Z_STRLEN_P(zmodified)); ++ if ((chr_ptr = strrchr(modified, ';'))) { ++ chr_ptr = 0; ++ } ++ ++ retval = (t <= http_parse_date_ex(modified, 1)); ++ efree(modified); ++ return retval; ++} ++/* }}} */ ++ ++/* {{{ zend_bool http_match_etag(char *, char *) */ ++PHP_HTTP_API zend_bool _http_match_etag_ex(const char *entry, const char *etag, zend_bool enforce_presence TSRMLS_DC) ++{ ++ zval *zetag; ++ char *quoted_etag; ++ zend_bool result; ++ ++ if (!(zetag = http_get_server_var_ex(entry, strlen(entry)+1, 1))) { ++ return !enforce_presence; ++ } ++ ++ if (NULL != strchr(Z_STRVAL_P(zetag), '*')) { ++ return 1; ++ } ++ ++ spprintf("ed_etag, 0, "\"%s\"", etag); ++ if (!strchr(Z_STRVAL_P(zetag), ',')) { ++ result = !strcmp(Z_STRVAL_P(zetag), quoted_etag); ++ } else { ++ result = (NULL != strstr(Z_STRVAL_P(zetag), quoted_etag)); ++ } ++ efree(quoted_etag); ++ ++ return result; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_cache_last_modified(time_t, time_t, char *, size_t) */ ++PHP_HTTP_API STATUS _http_cache_last_modified(time_t last_modified, ++ time_t send_modified, const char *cache_control, size_t cc_len TSRMLS_DC) ++{ ++ char *sent_header = NULL; ++ ++ if (SG(headers_sent)) { ++ return FAILURE; ++ } ++ ++ if (cc_len && (SUCCESS != http_send_cache_control(cache_control, cc_len))) { ++ return FAILURE; ++ } ++ ++ if (SUCCESS != http_send_last_modified_ex(send_modified, &sent_header)) { ++ return FAILURE; ++ } ++ ++ if (http_match_last_modified("HTTP_IF_MODIFIED_SINCE", last_modified)) { ++ http_exit_ex(304, sent_header, NULL, 0); ++ } else { ++ STR_FREE(sent_header); ++ } ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_cache_etag(char *, size_t, char *, size_t) */ ++PHP_HTTP_API STATUS _http_cache_etag(const char *etag, size_t etag_len, ++ const char *cache_control, size_t cc_len TSRMLS_DC) ++{ ++ char *sent_header = NULL; ++ ++ if (SG(headers_sent)) { ++ return FAILURE; ++ } ++ ++ if (cc_len && (SUCCESS != http_send_cache_control(cache_control, cc_len))) { ++ return FAILURE; ++ } ++ ++ if (etag_len) { ++ if (SUCCESS != http_send_etag_ex(etag, etag_len, &sent_header)) { ++ return FAILURE; ++ } ++ if (http_match_etag("HTTP_IF_NONE_MATCH", etag)) { ++ http_exit_ex(304, sent_header, NULL, 0); ++ } else { ++ STR_FREE(sent_header); ++ } ++ return SUCCESS; ++ } ++ ++ /* start ob_etaghandler */ ++ return http_start_ob_etaghandler(); ++} ++/* }}} */ ++ ++PHP_HTTP_API STATUS _http_start_ob_etaghandler(TSRMLS_D) ++{ ++ /* already running? */ ++#ifdef PHP_OUTPUT_NEWAPI ++ STATUS rv; ++ ++ if (php_output_handler_conflict(ZEND_STRL("ob_etaghandler"), ZEND_STRL("ob_etaghandler") TSRMLS_CC)) { ++ return FAILURE; ++ } ++#else ++ if (php_ob_handler_used("ob_etaghandler" TSRMLS_CC)) { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "ob_etaghandler can only be used once"); ++ return FAILURE; ++ } ++#endif ++ HTTP_G->etag.started = 1; ++#ifdef PHP_OUTPUT_NEWAPI ++ return php_output_start_internal(ZEND_STRL("ob_etaghandler"), _http_ob_etaghandler, HTTP_G->send.buffer_size, 0 TSRMLS_CC); ++#else ++ return php_start_ob_buffer_named("ob_etaghandler", HTTP_G->send.buffer_size, 0 TSRMLS_CC); ++#endif ++} ++ ++PHP_HTTP_API zend_bool _http_interrupt_ob_etaghandler(TSRMLS_D) ++{ ++ if (HTTP_G->etag.started) { ++ HTTP_G->etag.started = 0; ++ if (HTTP_G->etag.ctx) { ++ efree(HTTP_G->etag.ctx); ++ HTTP_G->etag.ctx = NULL; ++ } ++ return 1; ++ } ++ return 0; ++} ++ ++/* {{{ void http_ob_etaghandler(char *, uint, char **, uint *, int) */ ++void _http_ob_etaghandler(char *output, uint output_len, ++ char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) ++{ ++ /* passthru */ ++ *handled_output_len = output_len; ++ *handled_output = estrndup(output, output_len); ++ ++ /* are we supposed to run? */ ++ if (HTTP_G->etag.started) { ++ /* initialize the etag context */ ++ if (mode & PHP_OUTPUT_HANDLER_START) { ++ HTTP_G->etag.ctx = http_etag_init(); ++ } ++ ++ /* update */ ++ http_etag_update(HTTP_G->etag.ctx, output, output_len); ++ ++ /* finish */ ++ if (mode & PHP_OUTPUT_HANDLER_END) { ++ char *sent_header = NULL; ++ char *etag = http_etag_finish(HTTP_G->etag.ctx); ++ ++ HTTP_G->etag.ctx = NULL; ++ ++ http_send_cache_control(HTTP_DEFAULT_CACHECONTROL, lenof(HTTP_DEFAULT_CACHECONTROL)); ++ http_send_etag_ex(etag, strlen(etag), &sent_header); ++ ++ if (http_match_etag("HTTP_IF_NONE_MATCH", etag)) { ++ /* force exit; ob within ob does not work */ ++ HTTP_G->force_exit = 1; ++ http_exit_ex(304, sent_header, etag, 0); ++ } ++ ++ STR_FREE(sent_header); ++ STR_FREE(etag); ++ } ++ } ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: sw=4 ts=4 fdm=marker ++ * vim<600: sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_cookie_api.c +@@ -0,0 +1,371 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_cookie_api.c 298662 2010-04-27 13:42:32Z mike $ */ ++ ++#include "php_http.h" ++#include "php_http_api.h" ++#include "php_http_date_api.h" ++#include "php_http_cookie_api.h" ++ ++#include "ext/standard/url.h" ++ ++/* {{{ PHP_MINIT_FUNCTION(http_cookie) */ ++PHP_MINIT_FUNCTION(http_cookie) ++{ ++ HTTP_LONG_CONSTANT("HTTP_COOKIE_PARSE_RAW", HTTP_COOKIE_PARSE_RAW); ++ HTTP_LONG_CONSTANT("HTTP_COOKIE_SECURE", HTTP_COOKIE_SECURE); ++ HTTP_LONG_CONSTANT("HTTP_COOKIE_HTTPONLY", HTTP_COOKIE_HTTPONLY); ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ http_cookie_list *http_cookie_list_init(http_cookie_list *) */ ++PHP_HTTP_API http_cookie_list *_http_cookie_list_init(http_cookie_list *list ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ if (!list) { ++ list = emalloc_rel(sizeof(http_cookie_list)); ++ } ++ ++ zend_hash_init(&list->cookies, 0, NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_init(&list->extras, 0, NULL, ZVAL_PTR_DTOR, 0); ++ ++ list->path = NULL; ++ list->domain = NULL; ++ list->expires = 0; ++ list->flags = 0; ++ ++ return list; ++} ++/* }}} */ ++ ++/* {{{ void http_cookie_list_dtor(http_cookie_list *) */ ++PHP_HTTP_API void _http_cookie_list_dtor(http_cookie_list *list TSRMLS_DC) ++{ ++ if (list) { ++ zend_hash_destroy(&list->cookies); ++ zend_hash_destroy(&list->extras); ++ ++ STR_SET(list->path, NULL); ++ STR_SET(list->domain, NULL); ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_cookie_list_free(http_cookie_list **) */ ++PHP_HTTP_API void _http_cookie_list_free(http_cookie_list **list TSRMLS_DC) ++{ ++ if (list) { ++ http_cookie_list_dtor(*list); ++ efree(*list); ++ *list = NULL; ++ } ++} ++/* }}} */ ++ ++/* {{{ const char *http_cookie_list_get_cookie(http_cookie_list *, const char*, size_t) */ ++PHP_HTTP_API const char *_http_cookie_list_get_cookie(http_cookie_list *list, const char *name, size_t name_len TSRMLS_DC) ++{ ++ zval **cookie = NULL; ++ if ((SUCCESS != zend_hash_find(&list->cookies, HTTP_ZAPI_CONST_CAST(char *) name, name_len + 1, (void *) &cookie)) || (Z_TYPE_PP(cookie) != IS_STRING)) { ++ return NULL; ++ } ++ return Z_STRVAL_PP(cookie); ++} ++/* }}} */ ++ ++/* {{{ const char *http_cookie_list_get_extra(http_cookie_list *, const char *, size_t) */ ++PHP_HTTP_API const char *_http_cookie_list_get_extra(http_cookie_list *list, const char *name, size_t name_len TSRMLS_DC) ++{ ++ zval **extra = NULL; ++ if ((SUCCESS != zend_hash_find(&list->extras, HTTP_ZAPI_CONST_CAST(char *) name, name_len + 1, (void *) &extra)) || (Z_TYPE_PP(extra) != IS_STRING)) { ++ return NULL; ++ } ++ return Z_STRVAL_PP(extra); ++} ++/* }}} */ ++ ++/* {{{ void http_cookie_list_add_cookie(http_cookie_list *, const char *, size_t, const char *, size_t) */ ++PHP_HTTP_API void _http_cookie_list_add_cookie(http_cookie_list *list, const char *name, size_t name_len, const char *value, size_t value_len TSRMLS_DC) ++{ ++ zval *cookie_value; ++ char *key = estrndup(name, name_len); ++ MAKE_STD_ZVAL(cookie_value); ++ ZVAL_STRINGL(cookie_value, estrndup(value, value_len), value_len, 0); ++ zend_hash_update(&list->cookies, key, name_len + 1, (void *) &cookie_value, sizeof(zval *), NULL); ++ efree(key); ++} ++/* }}} */ ++ ++/* {{{ void http_cookie_list_add_extr(http_cookie_list *, const char *, size_t, const char *, size_t) */ ++PHP_HTTP_API void _http_cookie_list_add_extra(http_cookie_list *list, const char *name, size_t name_len, const char *value, size_t value_len TSRMLS_DC) ++{ ++ zval *cookie_value; ++ char *key = estrndup(name, name_len); ++ MAKE_STD_ZVAL(cookie_value); ++ ZVAL_STRINGL(cookie_value, estrndup(value, value_len), value_len, 0); ++ zend_hash_update(&list->extras, key, name_len + 1, (void *) &cookie_value, sizeof(zval *), NULL); ++ efree(key); ++} ++/* }}} */ ++ ++typedef struct _http_parse_param_cb_arg_t { ++ http_cookie_list *list; ++ long flags; ++ char **allowed_extras; ++} http_parse_param_cb_arg; ++ ++/* {{{ static void http_parse_cookie_callback */ ++static void http_parse_cookie_callback(void *ptr, const char *key, int keylen, const char *val, int vallen TSRMLS_DC) ++{ ++ http_parse_param_cb_arg *arg = (http_parse_param_cb_arg *) ptr; ++ ++#define _KEY_IS(s) (keylen == lenof(s) && !strncasecmp(key, (s), keylen)) ++ if _KEY_IS("path") { ++ STR_SET(arg->list->path, estrndup(val, vallen)); ++ } else if _KEY_IS("domain") { ++ STR_SET(arg->list->domain, estrndup(val, vallen)); ++ } else if _KEY_IS("expires") { ++ char *date = estrndup(val, vallen); ++ arg->list->expires = http_parse_date(date); ++ efree(date); ++ } else if _KEY_IS("secure") { ++ arg->list->flags |= HTTP_COOKIE_SECURE; ++ } else if _KEY_IS("httpOnly") { ++ arg->list->flags |= HTTP_COOKIE_HTTPONLY; ++ } else { ++ /* check for extra */ ++ if (arg->allowed_extras) { ++ char **ae = arg->allowed_extras; ++ ++ for (; *ae; ++ae) { ++ if ((size_t) keylen == strlen(*ae) && !strncasecmp(key, *ae, keylen)) { ++ if (arg->flags & HTTP_COOKIE_PARSE_RAW) { ++ http_cookie_list_add_extra(arg->list, key, keylen, val, vallen); ++ } else { ++ char *dec = estrndup(val, vallen); ++ int declen = php_url_decode(dec, vallen); ++ ++ http_cookie_list_add_extra(arg->list, key, keylen, dec, declen); ++ efree(dec); ++ } ++ return; ++ } ++ } ++ } ++ /* new cookie */ ++ if (arg->flags & HTTP_COOKIE_PARSE_RAW) { ++ http_cookie_list_add_cookie(arg->list, key, keylen, val, vallen); ++ } else { ++ char *dec = estrndup(val, vallen); ++ int declen = php_url_decode(dec, vallen); ++ ++ http_cookie_list_add_cookie(arg->list, key, keylen, dec, declen); ++ efree(dec); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ http_cookie_list *http_parse_cookie(char *, long) */ ++PHP_HTTP_API http_cookie_list *_http_parse_cookie_ex(http_cookie_list *list, const char *string, long flags, char **allowed_extras TSRMLS_DC) ++{ ++ int free_list = !list; ++ http_parse_param_cb_arg arg; ++ ++ list = http_cookie_list_init(list); ++ ++ arg.list = list; ++ arg.flags = flags; ++ arg.allowed_extras = allowed_extras; ++ ++ if (SUCCESS != http_parse_params_ex(string, HTTP_PARAMS_RAISE_ERROR, http_parse_cookie_callback, &arg)) { ++ if (free_list) { ++ http_cookie_list_free(&list); ++ } else { ++ http_cookie_list_dtor(list); ++ } ++ list = NULL; ++ } ++ ++ return list; ++} ++/* }}} */ ++ ++/* {{{ void http_cookie_list_tostruct(http_cookie_list *, zval *) */ ++PHP_HTTP_API void _http_cookie_list_tostruct(http_cookie_list *list, zval *strct TSRMLS_DC) ++{ ++ zval array, *cookies, *extras; ++ ++ INIT_ZARR(array, HASH_OF(strct)); ++ ++ MAKE_STD_ZVAL(cookies); ++ array_init(cookies); ++ zend_hash_copy(Z_ARRVAL_P(cookies), &list->cookies, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ add_assoc_zval(&array, "cookies", cookies); ++ ++ MAKE_STD_ZVAL(extras); ++ array_init(extras); ++ zend_hash_copy(Z_ARRVAL_P(extras), &list->extras, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ add_assoc_zval(&array, "extras", extras); ++ ++ add_assoc_long(&array, "flags", list->flags); ++ add_assoc_long(&array, "expires", (long) list->expires); ++ add_assoc_string(&array, "path", STR_PTR(list->path), 1); ++ add_assoc_string(&array, "domain", STR_PTR(list->domain), 1); ++} ++/* }}} */ ++ ++/* {{{ http_cookie_list *http_cookie_list_fromstruct(http_cookie_list *, zval *strct) */ ++PHP_HTTP_API http_cookie_list *_http_cookie_list_fromstruct(http_cookie_list *list, zval *strct TSRMLS_DC) ++{ ++ zval **tmp, *cpy; ++ HashTable *ht = HASH_OF(strct); ++ ++ list = http_cookie_list_init(list); ++ ++ if (SUCCESS == zend_hash_find(ht, "cookies", sizeof("cookies"), (void *) &tmp) && Z_TYPE_PP(tmp) == IS_ARRAY) { ++ zend_hash_copy(&list->cookies, Z_ARRVAL_PP(tmp), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ } ++ if (SUCCESS == zend_hash_find(ht, "extras", sizeof("extras"), (void *) &tmp) && Z_TYPE_PP(tmp) == IS_ARRAY) { ++ zend_hash_copy(&list->extras, Z_ARRVAL_PP(tmp), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ } ++ if (SUCCESS == zend_hash_find(ht, "flags", sizeof("flags"), (void *) &tmp)) { ++ switch (Z_TYPE_PP(tmp)) { ++ case IS_LONG: ++ list->flags = Z_LVAL_PP(tmp); ++ break; ++ case IS_DOUBLE: ++ list->flags = (long) Z_DVAL_PP(tmp); ++ break; ++ case IS_STRING: ++ cpy = http_zsep(IS_LONG, *tmp); ++ list->flags = Z_LVAL_P(cpy); ++ zval_ptr_dtor(&cpy); ++ break; ++ default: ++ break; ++ } ++ } ++ if (SUCCESS == zend_hash_find(ht, "expires", sizeof("expires"), (void *) &tmp)) { ++ switch (Z_TYPE_PP(tmp)) { ++ case IS_LONG: ++ list->expires = Z_LVAL_PP(tmp); ++ break; ++ case IS_DOUBLE: ++ list->expires = (long) Z_DVAL_PP(tmp); ++ break; ++ case IS_STRING: ++ cpy = http_zsep(IS_LONG, *tmp); ++ if (Z_LVAL_P(cpy)) { ++ list->expires = Z_LVAL_P(cpy); ++ } else { ++ time_t expires = http_parse_date(Z_STRVAL_PP(tmp)); ++ if (expires > 0) { ++ list->expires = expires; ++ } ++ } ++ zval_ptr_dtor(&cpy); ++ break; ++ default: ++ break; ++ } ++ } ++ if (SUCCESS == zend_hash_find(ht, "path", sizeof("path"), (void *) &tmp) && Z_TYPE_PP(tmp) == IS_STRING) { ++ list->path = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); ++ } ++ if (SUCCESS == zend_hash_find(ht, "domain", sizeof("domain"), (void *) &tmp) && Z_TYPE_PP(tmp) == IS_STRING) { ++ list->domain = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); ++ } ++ ++ return list; ++} ++/* }}} */ ++ ++/* {{{ inline append_encoded */ ++static inline void append_encoded(phpstr *buf, const char *key, size_t key_len, const char *val, size_t val_len) ++{ ++ char *enc_str[2]; ++ int enc_len[2]; ++ ++ enc_str[0] = php_url_encode(key, key_len, &enc_len[0]); ++ enc_str[1] = php_url_encode(val, val_len, &enc_len[1]); ++ ++ phpstr_append(buf, enc_str[0], enc_len[0]); ++ phpstr_appends(buf, "="); ++ phpstr_append(buf, enc_str[1], enc_len[1]); ++ phpstr_appends(buf, "; "); ++ ++ efree(enc_str[0]); ++ efree(enc_str[1]); ++} ++/* }}} */ ++ ++/* {{{ void http_cookie_list_tostring(http_cookie_list *, char **, size_t *) */ ++PHP_HTTP_API void _http_cookie_list_tostring(http_cookie_list *list, char **str, size_t *len TSRMLS_DC) ++{ ++ phpstr buf; ++ zval **val; ++ HashKey key = initHashKey(0); ++ HashPosition pos; ++ ++ phpstr_init(&buf); ++ ++ FOREACH_HASH_KEYVAL(pos, &list->cookies, key, val) { ++ if (key.type == HASH_KEY_IS_STRING && key.len) { ++ zval *tmp = http_zsep(IS_STRING, *val); ++ append_encoded(&buf, key.str, key.len-1, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp)); ++ zval_ptr_dtor(&tmp); ++ } ++ } ++ ++ if (list->domain && *list->domain) { ++ phpstr_appendf(&buf, "domain=%s; ", list->domain); ++ } ++ if (list->path && *list->path) { ++ phpstr_appendf(&buf, "path=%s; ", list->path); ++ } ++ if (list->expires) { ++ char *date = http_date(list->expires); ++ phpstr_appendf(&buf, "expires=%s; ", date); ++ efree(date); ++ } ++ ++ FOREACH_HASH_KEYVAL(pos, &list->extras, key, val) { ++ if (key.type == HASH_KEY_IS_STRING && key.len) { ++ zval *tmp = http_zsep(IS_STRING, *val); ++ append_encoded(&buf, key.str, key.len-1, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp)); ++ } ++ } ++ ++ if (list->flags & HTTP_COOKIE_SECURE) { ++ phpstr_appends(&buf, "secure; "); ++ } ++ if (list->flags & HTTP_COOKIE_HTTPONLY) { ++ phpstr_appends(&buf, "httpOnly; "); ++ } ++ ++ phpstr_fix(&buf); ++ *str = PHPSTR_VAL(&buf); ++ *len = PHPSTR_LEN(&buf); ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/http_date_api.c +@@ -0,0 +1,357 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_date_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#include "php_http.h" ++ ++#include "php_http_api.h" ++#include "php_http_date_api.h" ++ ++static inline int check_day(const char *day, size_t len); ++static inline int check_month(const char *month); ++static inline int check_tzone(const char *tzone); ++static inline time_t parse_date(const char *month); ++ ++/* {{{ day/month names */ ++static const char *days[] = { ++ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ++}; ++static const char *wkdays[] = { ++ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" ++}; ++static const char *weekdays[] = { ++ "Monday", "Tuesday", "Wednesday", ++ "Thursday", "Friday", "Saturday", "Sunday" ++}; ++static const char *months[] = { ++ "Jan", "Feb", "Mar", "Apr", "May", "Jun", ++ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ++}; ++enum assume_next { ++ DATE_MDAY, ++ DATE_YEAR, ++ DATE_TIME ++}; ++#define DS -60 ++static const struct time_zone { ++ const char *name; ++ const int offset; ++} time_zones[] = { ++ {"GMT", 0}, /* Greenwich Mean */ ++ {"UTC", 0}, /* Universal (Coordinated) */ ++ {"WET", 0}, /* Western European */ ++ {"BST", 0 DS}, /* British Summer */ ++ {"WAT", 60}, /* West Africa */ ++ {"AST", 240}, /* Atlantic Standard */ ++ {"ADT", 240 DS},/* Atlantic Daylight */ ++ {"EST", 300}, /* Eastern Standard */ ++ {"EDT", 300 DS},/* Eastern Daylight */ ++ {"CST", 360}, /* Central Standard */ ++ {"CDT", 360 DS},/* Central Daylight */ ++ {"MST", 420}, /* Mountain Standard */ ++ {"MDT", 420 DS},/* Mountain Daylight */ ++ {"PST", 480}, /* Pacific Standard */ ++ {"PDT", 480 DS},/* Pacific Daylight */ ++ {"YST", 540}, /* Yukon Standard */ ++ {"YDT", 540 DS},/* Yukon Daylight */ ++ {"HST", 600}, /* Hawaii Standard */ ++ {"HDT", 600 DS},/* Hawaii Daylight */ ++ {"CAT", 600}, /* Central Alaska */ ++ {"AHST", 600}, /* Alaska-Hawaii Standard */ ++ {"NT", 660}, /* Nome */ ++ {"IDLW", 720}, /* International Date Line West */ ++ {"CET", -60}, /* Central European */ ++ {"MET", -60}, /* Middle European */ ++ {"MEWT", -60}, /* Middle European Winter */ ++ {"MEST", -60 DS},/* Middle European Summer */ ++ {"CEST", -60 DS},/* Central European Summer */ ++ {"MESZ", -60 DS},/* Middle European Summer */ ++ {"FWT", -60}, /* French Winter */ ++ {"FST", -60 DS},/* French Summer */ ++ {"EET", -120}, /* Eastern Europe, USSR Zone 1 */ ++ {"WAST", -420}, /* West Australian Standard */ ++ {"WADT", -420 DS},/* West Australian Daylight */ ++ {"CCT", -480}, /* China Coast, USSR Zone 7 */ ++ {"JST", -540}, /* Japan Standard, USSR Zone 8 */ ++ {"EAST", -600}, /* Eastern Australian Standard */ ++ {"EADT", -600 DS},/* Eastern Australian Daylight */ ++ {"GST", -600}, /* Guam Standard, USSR Zone 9 */ ++ {"NZT", -720}, /* New Zealand */ ++ {"NZST", -720}, /* New Zealand Standard */ ++ {"NZDT", -720 DS},/* New Zealand Daylight */ ++ {"IDLE", -720}, /* International Date Line East */ ++}; ++/* }}} */ ++ ++/* {{{ Day/Month/TZ checks for http_parse_date() ++ Originally by libcurl, Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. */ ++static inline int check_day(const char *day, size_t len) ++{ ++ int i; ++ const char * const *check = (len > 3) ? &weekdays[0] : &wkdays[0]; ++ for (i = 0; i < 7; i++) { ++ if (!strcmp(day, check[0])) { ++ return i; ++ } ++ check++; ++ } ++ return -1; ++} ++ ++static inline int check_month(const char *month) ++{ ++ int i; ++ const char * const *check = &months[0]; ++ for (i = 0; i < 12; i++) { ++ if (!strcmp(month, check[0])) { ++ return i; ++ } ++ check++; ++ } ++ return -1; ++} ++ ++/* return the time zone offset between GMT and the input one, in number ++ of seconds or -1 if the timezone wasn't found/legal */ ++ ++static inline int check_tzone(const char *tzone) ++{ ++ unsigned i; ++ const struct time_zone *check = time_zones; ++ for (i = 0; i < sizeof(time_zones) / sizeof(time_zones[0]); i++) { ++ if (!strcmp(tzone, check->name)) { ++ return check->offset * 60; ++ } ++ check++; ++ } ++ return -1; ++} ++/* }}} */ ++ ++/* {{{ char *http_date(time_t) */ ++PHP_HTTP_API char *_http_date(time_t t TSRMLS_DC) ++{ ++ char *date = NULL; ++ struct tm *gmtime = NULL, tmbuf; ++ ++ memset(&tmbuf, 0, sizeof(tmbuf)); ++ if ((gmtime = php_gmtime_r(&t, &tmbuf))) { ++ spprintf(&date, 0, ++ "%s, %02d %s %04d %02d:%02d:%02d GMT", ++ days[gmtime->tm_wday], gmtime->tm_mday, ++ months[gmtime->tm_mon], gmtime->tm_year + 1900, ++ gmtime->tm_hour, gmtime->tm_min, gmtime->tm_sec ++ ); ++ } ++ ++ return date; ++} ++/* }}} */ ++ ++/* {{{ time_t http_parse_date(char *) */ ++PHP_HTTP_API time_t _http_parse_date_ex(const char *date, zend_bool silent TSRMLS_DC) ++{ ++ time_t t = parse_date(date); ++ ++ if (-1 == t && !silent) { ++ http_error_ex(HE_NOTICE, HTTP_E_RUNTIME, "Could not parse date: %s", date); ++ } ++ ++ return t; ++} ++/* }}} */ ++ ++/* time_t parse_date(char *) ++ Originally by libcurl, Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. */ ++static inline time_t parse_date(const char *date) ++{ ++ time_t t = 0; ++ int tz_offset = -1, year = -1, month = -1, monthday = -1, weekday = -1, ++ hours = -1, minutes = -1, seconds = -1; ++ struct tm tm; ++ enum assume_next dignext = DATE_MDAY; ++ const char *indate = date; ++ ++ int part = 0; /* max 6 parts */ ++ ++ while (*date && (part < 6)) { ++ int found = 0; ++ ++ while (*date && !HTTP_IS_CTYPE(alnum, *date)) { ++ date++; ++ } ++ ++ if (HTTP_IS_CTYPE(alpha, *date)) { ++ /* a name coming up */ ++ char buf[32] = ""; ++ size_t len; ++ sscanf(date, "%31[A-Za-z]", buf); ++ len = strlen(buf); ++ ++ if (weekday == -1) { ++ weekday = check_day(buf, len); ++ if (weekday != -1) { ++ found = 1; ++ } ++ } ++ ++ if (!found && (month == -1)) { ++ month = check_month(buf); ++ if (month != -1) { ++ found = 1; ++ } ++ } ++ ++ if (!found && (tz_offset == -1)) { ++ /* this just must be a time zone string */ ++ tz_offset = check_tzone(buf); ++ if (tz_offset != -1) { ++ found = 1; ++ } ++ } ++ ++ if (!found) { ++ return -1; /* bad string */ ++ } ++ date += len; ++ } ++ else if (HTTP_IS_CTYPE(digit, *date)) { ++ /* a digit */ ++ int val; ++ char *end; ++ if ((seconds == -1) && ++ (3 == sscanf(date, "%02d:%02d:%02d", &hours, &minutes, &seconds))) { ++ /* time stamp! */ ++ date += 8; ++ found = 1; ++ } ++ else { ++ val = (int) strtol(date, &end, 10); ++ ++ if ((tz_offset == -1) && ((end - date) == 4) && (val < 1300) && ++ (indate < date) && ((date[-1] == '+' || date[-1] == '-'))) { ++ /* four digits and a value less than 1300 and it is preceeded with ++ a plus or minus. This is a time zone indication. */ ++ found = 1; ++ tz_offset = (val / 100 * 60 + val % 100) * 60; ++ ++ /* the + and - prefix indicates the local time compared to GMT, ++ this we need ther reversed math to get what we want */ ++ tz_offset = date[-1] == '+' ? -tz_offset : tz_offset; ++ } ++ ++ if (((end - date) == 8) && (year == -1) && (month == -1) && (monthday == -1)) { ++ /* 8 digits, no year, month or day yet. This is YYYYMMDD */ ++ found = 1; ++ year = val / 10000; ++ month = (val % 10000) / 100 - 1; /* month is 0 - 11 */ ++ monthday = val % 100; ++ } ++ ++ if (!found && (dignext == DATE_MDAY) && (monthday == -1)) { ++ if ((val > 0) && (val < 32)) { ++ monthday = val; ++ found = 1; ++ } ++ dignext = DATE_YEAR; ++ } ++ ++ if (!found && (dignext == DATE_YEAR) && (year == -1)) { ++ year = val; ++ found = 1; ++ if (year < 1900) { ++ year += year > 70 ? 1900 : 2000; ++ } ++ if(monthday == -1) { ++ dignext = DATE_MDAY; ++ } ++ } ++ ++ if (!found) { ++ return -1; ++ } ++ ++ date = end; ++ } ++ } ++ ++ part++; ++ } ++ ++ if (-1 == seconds) { ++ seconds = minutes = hours = 0; /* no time, make it zero */ ++ } ++ ++ if ((-1 == monthday) || (-1 == month) || (-1 == year)) { ++ /* lacks vital info, fail */ ++ return -1; ++ } ++ ++ if (sizeof(time_t) < 5) { ++ /* 32 bit time_t can only hold dates to the beginning of 2038 */ ++ if (year > 2037) { ++ return 0x7fffffff; ++ } ++ } ++ ++ tm.tm_sec = seconds; ++ tm.tm_min = minutes; ++ tm.tm_hour = hours; ++ tm.tm_mday = monthday; ++ tm.tm_mon = month; ++ tm.tm_year = year - 1900; ++ tm.tm_wday = 0; ++ tm.tm_yday = 0; ++ tm.tm_isdst = 0; ++ ++ t = mktime(&tm); ++ ++ /* time zone adjust */ ++ if (t != -1) { ++ struct tm *gmt, keeptime2; ++ long delta; ++ time_t t2; ++ ++ if((gmt = php_gmtime_r(&t, &keeptime2))) { ++ tm = *gmt; /* MSVC quirks */ ++ } else { ++ return -1; /* illegal date/time */ ++ } ++ ++ t2 = mktime(&tm); ++ ++ /* Add the time zone diff (between the given timezone and GMT) and the ++ diff between the local time zone and GMT. */ ++ delta = (tz_offset != -1 ? tz_offset : 0) + (t - t2); ++ ++ if((delta > 0) && (t + delta < t)) { ++ return -1; /* time_t overflow */ ++ } ++ ++ t += delta; ++ } ++ ++ return t; ++} ++/* }}} */ ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: sw=4 ts=4 fdm=marker ++ * vim<600: sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_deflatestream_object.c +@@ -0,0 +1,317 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_deflatestream_object.c 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#define HTTP_WANT_ZLIB ++#include "php_http.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_ZLIB) ++ ++#include "php_http_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_exception_object.h" ++#include "php_http_deflatestream_object.h" ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpDeflateStream, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpDeflateStream, method, 0) ++#define HTTP_DEFLATE_ME(method, visibility) PHP_ME(HttpDeflateStream, method, HTTP_ARGS(HttpDeflateStream, method), visibility) ++ ++HTTP_BEGIN_ARGS(__construct, 0) ++ HTTP_ARG_VAL(flags, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(factory, 0) ++ HTTP_ARG_VAL(flags, 0) ++ HTTP_ARG_VAL(class_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(update, 1) ++ HTTP_ARG_VAL(data, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(flush, 0) ++ HTTP_ARG_VAL(data, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(finish, 0) ++ HTTP_ARG_VAL(data, 0) ++HTTP_END_ARGS; ++ ++#define THIS_CE http_deflatestream_object_ce ++zend_class_entry *http_deflatestream_object_ce; ++zend_function_entry http_deflatestream_object_fe[] = { ++ HTTP_DEFLATE_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) ++ HTTP_DEFLATE_ME(update, ZEND_ACC_PUBLIC) ++ HTTP_DEFLATE_ME(flush, ZEND_ACC_PUBLIC) ++ HTTP_DEFLATE_ME(finish, ZEND_ACC_PUBLIC) ++ ++ HTTP_DEFLATE_ME(factory, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++static zend_object_handlers http_deflatestream_object_handlers; ++ ++PHP_MINIT_FUNCTION(http_deflatestream_object) ++{ ++ HTTP_REGISTER_CLASS_EX(HttpDeflateStream, http_deflatestream_object, NULL, 0); ++ http_deflatestream_object_handlers.clone_obj = _http_deflatestream_object_clone_obj; ++ ++#ifndef WONKY ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_GZIP")-1, HTTP_DEFLATE_TYPE_GZIP TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_ZLIB")-1, HTTP_DEFLATE_TYPE_ZLIB TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_RAW")-1, HTTP_DEFLATE_TYPE_RAW TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("LEVEL_DEF")-1, HTTP_DEFLATE_LEVEL_DEF TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("LEVEL_MIN")-1, HTTP_DEFLATE_LEVEL_MIN TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("LEVEL_MAX")-1, HTTP_DEFLATE_LEVEL_MAX TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("STRATEGY_DEF")-1, HTTP_DEFLATE_STRATEGY_DEF TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("STRATEGY_FILT")-1, HTTP_DEFLATE_STRATEGY_FILT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("STRATEGY_HUFF")-1, HTTP_DEFLATE_STRATEGY_HUFF TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("STRATEGY_RLE")-1, HTTP_DEFLATE_STRATEGY_RLE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("STRATEGY_FIXED")-1, HTTP_DEFLATE_STRATEGY_FIXED TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("FLUSH_NONE")-1, HTTP_ENCODING_STREAM_FLUSH_NONE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("FLUSH_SYNC")-1, HTTP_ENCODING_STREAM_FLUSH_SYNC TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("FLUSH_FULL")-1, HTTP_ENCODING_STREAM_FLUSH_FULL TSRMLS_CC); ++#endif ++ ++ return SUCCESS; ++} ++ ++zend_object_value _http_deflatestream_object_new(zend_class_entry *ce TSRMLS_DC) ++{ ++ return http_deflatestream_object_new_ex(ce, NULL, NULL); ++} ++ ++zend_object_value _http_deflatestream_object_new_ex(zend_class_entry *ce, http_encoding_stream *s, http_deflatestream_object **ptr TSRMLS_DC) ++{ ++ zend_object_value ov; ++ http_deflatestream_object *o; ++ ++ o = ecalloc(1, sizeof(http_deflatestream_object)); ++ o->zo.ce = ce; ++ ++ if (ptr) { ++ *ptr = o; ++ } ++ ++ if (s) { ++ o->stream = s; ++ } ++ ++#ifdef ZEND_ENGINE_2_4 ++ zend_object_std_init(o, ce TSRMLS_CC); ++ object_properties_init(o, ce); ++#else ++ ALLOC_HASHTABLE(OBJ_PROP(o)); ++ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++#endif ++ ++ ov.handle = putObject(http_deflatestream_object, o); ++ ov.handlers = &http_deflatestream_object_handlers; ++ ++ return ov; ++} ++ ++zend_object_value _http_deflatestream_object_clone_obj(zval *this_ptr TSRMLS_DC) ++{ ++ http_encoding_stream *s; ++ zend_object_value new_ov; ++ http_deflatestream_object *new_obj = NULL; ++ getObject(http_deflatestream_object, old_obj); ++ ++ s = ecalloc(1, sizeof(http_encoding_stream)); ++ s->flags = old_obj->stream->flags; ++ deflateCopy(&s->stream, &old_obj->stream->stream); ++ s->stream.opaque = phpstr_dup(s->stream.opaque); ++ ++ new_ov = http_deflatestream_object_new_ex(old_obj->zo.ce, s, &new_obj); ++ zend_objects_clone_members(&new_obj->zo, new_ov, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); ++ ++ return new_ov; ++} ++ ++void _http_deflatestream_object_free(zend_object *object TSRMLS_DC) ++{ ++ http_deflatestream_object *o = (http_deflatestream_object *) object; ++ ++ if (o->stream) { ++ http_encoding_deflate_stream_free(&o->stream); ++ } ++ freeObject(o); ++} ++ ++/* {{{ proto void HttpDeflateStream::__construct([int flags = 0]) ++ Creates a new HttpDeflateStream object instance. */ ++PHP_METHOD(HttpDeflateStream, __construct) ++{ ++ long flags = 0; ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags)) { ++ getObject(http_deflatestream_object, obj); ++ ++ if (!obj->stream) { ++ obj->stream = http_encoding_deflate_stream_init(NULL, flags & 0x0fffffff); ++ } else { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "HttpDeflateStream cannot be initialized twice"); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto HttpDeflateStream HttpDeflateStream::factory([int flags[, string class = "HttpDeflateStream"]]) ++ Creates a new HttpDeflateStream object instance. */ ++PHP_METHOD(HttpDeflateStream, factory) ++{ ++ long flags = 0; ++ char *cn = NULL; ++ int cl = 0; ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &flags, &cn, &cl)) { ++ zend_object_value ov; ++ http_encoding_stream *s = http_encoding_deflate_stream_init(NULL, flags & 0x0fffffff); ++ ++ if (SUCCESS == http_object_new(&ov, cn, cl, _http_deflatestream_object_new_ex, http_deflatestream_object_ce, s, NULL)) { ++ RETVAL_OBJVAL(ov, 0); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto string HttpDeflateStream::update(string data) ++ Passes more data through the deflate stream. */ ++PHP_METHOD(HttpDeflateStream, update) ++{ ++ int data_len; ++ size_t encoded_len = 0; ++ char *data, *encoded = NULL; ++ getObject(http_deflatestream_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!obj->stream && !(obj->stream = http_encoding_deflate_stream_init(NULL, 0))) { ++ RETURN_FALSE; ++ } ++ ++ if (SUCCESS == http_encoding_deflate_stream_update(obj->stream, data, data_len, &encoded, &encoded_len)) { ++ RETURN_STRINGL(encoded, encoded_len, 0); ++ } else { ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpDeflateStream::flush([string data]) ++ Flushes the deflate stream. */ ++PHP_METHOD(HttpDeflateStream, flush) ++{ ++ int data_len = 0; ++ size_t updated_len = 0, encoded_len = 0; ++ char *updated = NULL, *encoded = NULL, *data = NULL; ++ getObject(http_deflatestream_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!obj->stream && !(obj->stream = http_encoding_deflate_stream_init(NULL, 0))) { ++ RETURN_FALSE; ++ } ++ ++ if (data_len) { ++ if (SUCCESS != http_encoding_deflate_stream_update(obj->stream, data, data_len, &updated, &updated_len)) { ++ RETURN_FALSE; ++ } ++ } ++ ++ if (SUCCESS == http_encoding_deflate_stream_flush(obj->stream, &encoded, &encoded_len)) { ++ if (updated_len) { ++ updated = erealloc(updated, updated_len + encoded_len + 1); ++ updated[updated_len + encoded_len] = '\0'; ++ memcpy(updated + updated_len, encoded, encoded_len); ++ STR_FREE(encoded); ++ updated_len += encoded_len; ++ RETURN_STRINGL(updated, updated_len, 0); ++ } else if (encoded) { ++ RETVAL_STRINGL(encoded, encoded_len, 0); ++ } else { ++ RETVAL_NULL(); ++ } ++ } else { ++ RETVAL_FALSE; ++ } ++ STR_FREE(updated); ++} ++/* }}} */ ++ ++/* {{{ proto string HttpDeflateStream::finish([string data]) ++ Finalizes the deflate stream. The deflate stream can be reused after finalizing. */ ++PHP_METHOD(HttpDeflateStream, finish) ++{ ++ int data_len = 0; ++ size_t updated_len = 0, encoded_len = 0; ++ char *updated = NULL, *encoded = NULL, *data = NULL; ++ getObject(http_deflatestream_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!obj->stream && !(obj->stream = http_encoding_deflate_stream_init(NULL, 0))) { ++ RETURN_FALSE; ++ } ++ ++ if (data_len) { ++ if (SUCCESS != http_encoding_deflate_stream_update(obj->stream, data, data_len, &updated, &updated_len)) { ++ RETURN_FALSE; ++ } ++ } ++ ++ if (SUCCESS == http_encoding_deflate_stream_finish(obj->stream, &encoded, &encoded_len)) { ++ if (updated_len) { ++ updated = erealloc(updated, updated_len + encoded_len + 1); ++ updated[updated_len + encoded_len] = '\0'; ++ memcpy(updated + updated_len, encoded, encoded_len); ++ STR_FREE(encoded); ++ updated_len += encoded_len; ++ RETVAL_STRINGL(updated, updated_len, 0); ++ } else { ++ STR_FREE(updated); ++ RETVAL_STRINGL(encoded, encoded_len, 0); ++ } ++ } else { ++ STR_FREE(updated); ++ RETVAL_FALSE; ++ } ++ ++ http_encoding_deflate_stream_dtor(obj->stream); ++ http_encoding_deflate_stream_init(obj->stream, obj->stream->flags); ++} ++/* }}} */ ++ ++#endif /* ZEND_ENGINE_2 && HTTP_HAVE_ZLIB*/ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_encoding_api.c +@@ -0,0 +1,796 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_encoding_api.c 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#define HTTP_WANT_ZLIB ++#include "php_http.h" ++ ++#include "php_http_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_send_api.h" ++#include "php_http_headers_api.h" ++ ++/* {{{ */ ++#ifdef HTTP_HAVE_ZLIB ++PHP_MINIT_FUNCTION(http_encoding) ++{ ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_LEVEL_DEF", HTTP_DEFLATE_LEVEL_DEF); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_LEVEL_MIN", HTTP_DEFLATE_LEVEL_MIN); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_LEVEL_MAX", HTTP_DEFLATE_LEVEL_MAX); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_TYPE_ZLIB", HTTP_DEFLATE_TYPE_ZLIB); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_TYPE_GZIP", HTTP_DEFLATE_TYPE_GZIP); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_TYPE_RAW", HTTP_DEFLATE_TYPE_RAW); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_STRATEGY_DEF", HTTP_DEFLATE_STRATEGY_DEF); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_STRATEGY_FILT", HTTP_DEFLATE_STRATEGY_FILT); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_STRATEGY_HUFF", HTTP_DEFLATE_STRATEGY_HUFF); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_STRATEGY_RLE", HTTP_DEFLATE_STRATEGY_RLE); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_STRATEGY_FIXED", HTTP_DEFLATE_STRATEGY_FIXED); ++ ++ HTTP_LONG_CONSTANT("HTTP_ENCODING_STREAM_FLUSH_NONE", HTTP_ENCODING_STREAM_FLUSH_NONE); ++ HTTP_LONG_CONSTANT("HTTP_ENCODING_STREAM_FLUSH_SYNC", HTTP_ENCODING_STREAM_FLUSH_SYNC); ++ HTTP_LONG_CONSTANT("HTTP_ENCODING_STREAM_FLUSH_FULL", HTTP_ENCODING_STREAM_FLUSH_FULL); ++ ++ return SUCCESS; ++} ++ ++PHP_RINIT_FUNCTION(http_encoding) ++{ ++ if (HTTP_G->send.inflate.start_auto) { ++#ifdef PHP_OUTPUT_NEWAPI ++ php_output_start_internal(ZEND_STRL("http inflate"), _http_ob_inflatehandler, HTTP_INFLATE_BUFFER_SIZE, 0 TSRMLS_CC); ++#else ++ php_ob_set_internal_handler(_http_ob_inflatehandler, HTTP_INFLATE_BUFFER_SIZE, "http inflate", 0 TSRMLS_CC); ++#endif ++ } ++ if (HTTP_G->send.deflate.start_auto) { ++#ifdef PHP_OUTPUT_NEWAPI ++ php_output_start_internal(ZEND_STRL("http deflate"), _http_ob_deflatehandler, HTTP_DEFLATE_BUFFER_SIZE, 0 TSRMLS_CC); ++#else ++ php_ob_set_internal_handler(_http_ob_deflatehandler, HTTP_DEFLATE_BUFFER_SIZE, "http deflate", 0 TSRMLS_CC); ++#endif ++ } ++ return SUCCESS; ++} ++ ++PHP_RSHUTDOWN_FUNCTION(http_encoding) ++{ ++ if (HTTP_G->send.deflate.stream) { ++ http_encoding_deflate_stream_free((http_encoding_stream **) &HTTP_G->send.deflate.stream); ++ } ++ if (HTTP_G->send.inflate.stream) { ++ http_encoding_inflate_stream_free((http_encoding_stream **) &HTTP_G->send.inflate.stream); ++ } ++ return SUCCESS; ++} ++#endif ++/* }}} */ ++ ++/* {{{ eol_match(char **, int *) */ ++static inline int eol_match(char **line, int *eol_len) ++{ ++ char *ptr = *line; ++ ++ while (' ' == *ptr) ++ptr; ++ ++ if (ptr == http_locate_eol(*line, eol_len)) { ++ *line = ptr; ++ return 1; ++ } else { ++ return 0; ++ } ++} ++/* }}} */ ++ ++/* {{{ char *http_encoding_dechunk(char *, size_t, char **, size_t *) */ ++PHP_HTTP_API const char *_http_encoding_dechunk(const char *encoded, size_t encoded_len, char **decoded, size_t *decoded_len TSRMLS_DC) ++{ ++ int eol_len = 0; ++ char *n_ptr = NULL; ++ const char *e_ptr = encoded; ++ ++ *decoded_len = 0; ++ *decoded = ecalloc(1, encoded_len); ++ ++ while ((encoded + encoded_len - e_ptr) > 0) { ++ ulong chunk_len = 0, rest; ++ ++ chunk_len = strtoul(e_ptr, &n_ptr, 16); ++ ++ /* we could not read in chunk size */ ++ if (n_ptr == e_ptr) { ++ /* ++ * if this is the first turn and there doesn't seem to be a chunk ++ * size at the begining of the body, do not fail on apparently ++ * not encoded data and return a copy ++ */ ++ if (e_ptr == encoded) { ++ http_error(HE_NOTICE, HTTP_E_ENCODING, "Data does not seem to be chunked encoded"); ++ memcpy(*decoded, encoded, encoded_len); ++ *decoded_len = encoded_len; ++ return encoded + encoded_len; ++ } else { ++ efree(*decoded); ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Expected chunk size at pos %tu of %zu but got trash", n_ptr - encoded, encoded_len); ++ return NULL; ++ } ++ } ++ ++ /* reached the end */ ++ if (!chunk_len) { ++ /* move over '0' chunked encoding terminator */ ++ while (*e_ptr == '0') ++e_ptr; ++ break; ++ } ++ ++ /* there should be CRLF after the chunk size, but we'll ignore SP+ too */ ++ if (*n_ptr && !eol_match(&n_ptr, &eol_len)) { ++ if (eol_len == 2) { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Expected CRLF at pos %tu of %zu but got 0x%02X 0x%02X", n_ptr - encoded, encoded_len, *n_ptr, *(n_ptr + 1)); ++ } else { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Expected LF at pos %tu of %zu but got 0x%02X", n_ptr - encoded, encoded_len, *n_ptr); ++ } ++ } ++ n_ptr += eol_len; ++ ++ /* chunk size pretends more data than we actually got, so it's probably a truncated message */ ++ if (chunk_len > (rest = encoded + encoded_len - n_ptr)) { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Truncated message: chunk size %lu exceeds remaining data size %lu at pos %tu of %zu", chunk_len, rest, n_ptr - encoded, encoded_len); ++ chunk_len = rest; ++ } ++ ++ /* copy the chunk */ ++ memcpy(*decoded + *decoded_len, n_ptr, chunk_len); ++ *decoded_len += chunk_len; ++ ++ if (chunk_len == rest) { ++ e_ptr = n_ptr + chunk_len; ++ break; ++ } else { ++ /* advance to next chunk */ ++ e_ptr = n_ptr + chunk_len + eol_len; ++ } ++ } ++ ++ return e_ptr; ++} ++/* }}} */ ++ ++/* {{{ int http_encoding_response_start(size_t) */ ++PHP_HTTP_API int _http_encoding_response_start(size_t content_length, zend_bool ignore_http_ohandler TSRMLS_DC) ++{ ++ int response = HTTP_G->send.deflate.response; ++#ifdef PHP_OUTPUT_NEWAPI ++ int ohandler = php_output_handler_started(ZEND_STRL("ob_gzhandler") TSRMLS_CC) || php_output_handler_started(ZEND_STRL("zlib output compression") TSRMLS_CC); ++#else ++ int ohandler = php_ob_handler_used("ob_gzhandler" TSRMLS_CC) || php_ob_handler_used("zlib output compression" TSRMLS_CC); ++#endif ++ ++ if (!ohandler && !ignore_http_ohandler) { ++#ifdef PHP_OUTPUT_NEWAPI ++ ohandler = php_output_handler_started(ZEND_STRL("ob_defaltehandler") TSRMLS_CC) || php_output_handler_started(ZEND_STRL("http deflate") TSRMLS_CC); ++#else ++ ohandler = php_ob_handler_used("ob_deflatehandler" TSRMLS_CC) || php_ob_handler_used("http deflate" TSRMLS_CC); ++#endif ++ } ++ ++ if (response && !ohandler) { ++#ifdef HTTP_HAVE_ZLIB ++ HashTable *selected; ++ zval zsupported; ++ ++ HTTP_G->send.deflate.encoding = 0; ++ ++ INIT_PZVAL(&zsupported); ++ array_init(&zsupported); ++ add_next_index_stringl(&zsupported, "gzip", lenof("gzip"), 1); ++ add_next_index_stringl(&zsupported, "x-gzip", lenof("x-gzip"), 1); ++ add_next_index_stringl(&zsupported, "deflate", lenof("deflate"), 1); ++ ++ if ((selected = http_negotiate_encoding(&zsupported))) { ++ STATUS hs = FAILURE; ++ char *encoding = NULL; ++ ulong idx; ++ ++ if (HASH_KEY_IS_STRING == zend_hash_get_current_key(selected, &encoding, &idx, 0) && encoding) { ++ if (!strcmp(encoding, "gzip") || !strcmp(encoding, "x-gzip")) { ++ if (SUCCESS == (hs = http_send_header_string("Content-Encoding: gzip"))) { ++ HTTP_G->send.deflate.encoding = HTTP_ENCODING_GZIP; ++ } ++ } else if (!strcmp(encoding, "deflate")) { ++ if (SUCCESS == (hs = http_send_header_string("Content-Encoding: deflate"))) { ++ HTTP_G->send.deflate.encoding = HTTP_ENCODING_DEFLATE; ++ } ++ } ++ if (SUCCESS == hs) { ++ http_send_header_string("Vary: Accept-Encoding"); ++ } ++ } ++ ++ zend_hash_destroy(selected); ++ FREE_HASHTABLE(selected); ++ } ++ ++ zval_dtor(&zsupported); ++#else ++ HTTP_G->send.deflate.encoding = 0; ++ php_start_ob_buffer_named("ob_gzhandler", 0, 0 TSRMLS_CC); ++#endif /* HTTP_HAVE_ZLIB */ ++ } else if (content_length && !ohandler) { ++ /* emit a content-length header */ ++ phpstr header; ++ ++ phpstr_init(&header); ++ phpstr_appendf(&header, "Content-Length: %zu", content_length); ++ phpstr_fix(&header); ++ http_send_header_string_ex(PHPSTR_VAL(&header), PHPSTR_LEN(&header), 1); ++ phpstr_dtor(&header); ++ } else { ++ HTTP_G->send.deflate.encoding = 0; ++ } ++ ++ return HTTP_G->send.deflate.encoding; ++} ++/* }}} */ ++ ++#ifdef HTTP_HAVE_ZLIB ++ ++/* {{{ inline int http_inflate_rounds */ ++static inline int http_inflate_rounds(z_stream *Z, int flush, char **buf, size_t *len) ++{ ++ int status = 0, round = 0; ++ phpstr buffer; ++ ++ *buf = NULL; ++ *len = 0; ++ ++ phpstr_init_ex(&buffer, Z->avail_in, PHPSTR_INIT_PREALLOC); ++ ++ do { ++ if (PHPSTR_NOMEM == phpstr_resize_ex(&buffer, buffer.size, 0, 1)) { ++ status = Z_MEM_ERROR; ++ } else { ++ Z->avail_out = buffer.free; ++ Z->next_out = (Bytef *) buffer.data + buffer.used; ++#if 0 ++ fprintf(stderr, "\n%3d: %3d PRIOR: size=%7lu,\tfree=%7lu,\tused=%7lu,\tavail_in=%7lu,\tavail_out=%7lu\n", round, status, buffer.size, buffer.free, buffer.used, Z->avail_in, Z->avail_out); ++#endif ++ status = inflate(Z, flush); ++ ++ buffer.used += buffer.free - Z->avail_out; ++ buffer.free = Z->avail_out; ++#if 0 ++ fprintf(stderr, "%3d: %3d AFTER: size=%7lu,\tfree=%7lu,\tused=%7lu,\tavail_in=%7lu,\tavail_out=%7lu\n", round, status, buffer.size, buffer.free, buffer.used, Z->avail_in, Z->avail_out); ++#endif ++ HTTP_INFLATE_BUFFER_SIZE_ALIGN(buffer.size); ++ } ++ } while ((Z_BUF_ERROR == status || (Z_OK == status && Z->avail_in)) && ++round < HTTP_INFLATE_ROUNDS); ++ ++ if (status == Z_OK || status == Z_STREAM_END) { ++ phpstr_shrink(&buffer); ++ phpstr_fix(&buffer); ++ *buf = buffer.data; ++ *len = buffer.used; ++ } else { ++ phpstr_dtor(&buffer); ++ } ++ ++ return status; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_deflate(int, char *, size_t, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_encoding_deflate(int flags, const char *data, size_t data_len, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status, level, wbits, strategy; ++ z_stream Z; ++ ++ HTTP_DEFLATE_LEVEL_SET(flags, level); ++ HTTP_DEFLATE_WBITS_SET(flags, wbits); ++ HTTP_DEFLATE_STRATEGY_SET(flags, strategy); ++ ++ memset(&Z, 0, sizeof(z_stream)); ++ *encoded = NULL; ++ *encoded_len = 0; ++ ++ status = deflateInit2(&Z, level, Z_DEFLATED, wbits, MAX_MEM_LEVEL, strategy); ++ if (Z_OK == status) { ++ *encoded_len = HTTP_DEFLATE_BUFFER_SIZE_GUESS(data_len); ++ *encoded = emalloc_rel(*encoded_len); ++ ++ Z.next_in = (Bytef *) data; ++ Z.next_out = (Bytef *) *encoded; ++ Z.avail_in = data_len; ++ Z.avail_out = *encoded_len; ++ ++ status = deflate(&Z, Z_FINISH); ++ deflateEnd(&Z); ++ ++ if (Z_STREAM_END == status) { ++ /* size buffer down to actual length */ ++ *encoded = erealloc_rel(*encoded, Z.total_out + 1); ++ (*encoded)[*encoded_len = Z.total_out] = '\0'; ++ return SUCCESS; ++ } else { ++ STR_SET(*encoded, NULL); ++ *encoded_len = 0; ++ } ++ } ++ ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Could not deflate data: %s", zError(status)); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_inflate(char *, size_t, char **, size_t) */ ++PHP_HTTP_API STATUS _http_encoding_inflate(const char *data, size_t data_len, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ z_stream Z; ++ int status, wbits = HTTP_WINDOW_BITS_ANY; ++ ++ memset(&Z, 0, sizeof(z_stream)); ++ ++retry_raw_inflate: ++ status = inflateInit2(&Z, wbits); ++ if (Z_OK == status) { ++ Z.next_in = (Bytef *) data; ++ Z.avail_in = data_len; ++ ++ switch (status = http_inflate_rounds(&Z, Z_NO_FLUSH, decoded, decoded_len)) { ++ case Z_STREAM_END: ++ inflateEnd(&Z); ++ return SUCCESS; ++ ++ case Z_OK: ++ status = Z_DATA_ERROR; ++ break; ++ ++ case Z_DATA_ERROR: ++ /* raw deflated data? */ ++ if (HTTP_WINDOW_BITS_ANY == wbits) { ++ inflateEnd(&Z); ++ wbits = HTTP_WINDOW_BITS_RAW; ++ goto retry_raw_inflate; ++ } ++ } ++ inflateEnd(&Z); ++ } ++ ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Could not inflate data: %s", zError(status)); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ http_encoding_stream *_http_encoding_deflate_stream_init(http_encoding_stream *, int) */ ++PHP_HTTP_API http_encoding_stream *_http_encoding_deflate_stream_init(http_encoding_stream *s, int flags ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status, level, wbits, strategy, free_stream; ++ ++ if ((free_stream = !s)) { ++ s = pemalloc_rel(sizeof(http_encoding_stream), (flags & HTTP_ENCODING_STREAM_PERSISTENT)); ++ } ++ memset(s, 0, sizeof(http_encoding_stream)); ++ s->flags = flags; ++ ++ HTTP_DEFLATE_LEVEL_SET(flags, level); ++ HTTP_DEFLATE_WBITS_SET(flags, wbits); ++ HTTP_DEFLATE_STRATEGY_SET(flags, strategy); ++ ++ if (Z_OK == (status = deflateInit2(&s->stream, level, Z_DEFLATED, wbits, MAX_MEM_LEVEL, strategy))) { ++ int p = (flags & HTTP_ENCODING_STREAM_PERSISTENT) ? PHPSTR_INIT_PERSISTENT:0; ++ ++ if ((s->stream.opaque = phpstr_init_ex(NULL, HTTP_DEFLATE_BUFFER_SIZE, p))) { ++ return s; ++ } ++ deflateEnd(&s->stream); ++ status = Z_MEM_ERROR; ++ } ++ ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Failed to initialize deflate encoding stream: %s", zError(status)); ++ if (free_stream) { ++ efree(s); ++ } ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ http_encoding_stream *http_encoding_inflate_stream_init(http_encoding_stream *, int) */ ++PHP_HTTP_API http_encoding_stream *_http_encoding_inflate_stream_init(http_encoding_stream *s, int flags ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status, wbits, free_stream; ++ ++ if ((free_stream = !s)) { ++ s = pemalloc_rel(sizeof(http_encoding_stream), (flags & HTTP_ENCODING_STREAM_PERSISTENT)); ++ } ++ memset(s, 0, sizeof(http_encoding_stream)); ++ s->flags = flags; ++ ++ HTTP_INFLATE_WBITS_SET(flags, wbits); ++ ++ if (Z_OK == (status = inflateInit2(&s->stream, wbits))) { ++ int p = (flags & HTTP_ENCODING_STREAM_PERSISTENT) ? PHPSTR_INIT_PERSISTENT:0; ++ ++ if ((s->stream.opaque = phpstr_init_ex(NULL, HTTP_DEFLATE_BUFFER_SIZE, p))) { ++ return s; ++ } ++ inflateEnd(&s->stream); ++ status = Z_MEM_ERROR; ++ } ++ ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Failed to initialize inflate stream: %s", zError(status)); ++ if (free_stream) { ++ efree(s); ++ } ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_deflate_stream_update(http_encoding_stream *, char *, size_t, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_encoding_deflate_stream_update(http_encoding_stream *s, const char *data, size_t data_len, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status; ++ ++ /* append input to our buffer */ ++ phpstr_append(PHPSTR(s->stream.opaque), data, data_len); ++ ++ s->stream.next_in = (Bytef *) PHPSTR_VAL(s->stream.opaque); ++ s->stream.avail_in = PHPSTR_LEN(s->stream.opaque); ++ ++ /* deflate */ ++ *encoded_len = HTTP_DEFLATE_BUFFER_SIZE_GUESS(data_len); ++ *encoded = emalloc_rel(*encoded_len); ++ s->stream.avail_out = *encoded_len; ++ s->stream.next_out = (Bytef *) *encoded; ++ ++ switch (status = deflate(&s->stream, HTTP_ENCODING_STREAM_FLUSH_FLAG(s->flags))) { ++ case Z_OK: ++ case Z_STREAM_END: ++ /* cut processed chunk off the buffer */ ++ if (s->stream.avail_in) { ++ phpstr_cut(PHPSTR(s->stream.opaque), 0, PHPSTR_LEN(s->stream.opaque) - s->stream.avail_in); ++ } else { ++ phpstr_reset(PHPSTR(s->stream.opaque)); ++ } ++ ++ /* size buffer down to actual size */ ++ *encoded_len -= s->stream.avail_out; ++ *encoded = erealloc_rel(*encoded, *encoded_len + 1); ++ (*encoded)[*encoded_len] = '\0'; ++ return SUCCESS; ++ } ++ ++ STR_SET(*encoded, NULL); ++ *encoded_len = 0; ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Failed to update deflate stream: %s", zError(status)); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_inflate_stream_update(http_encoding_stream *, char *, size_t, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_encoding_inflate_stream_update(http_encoding_stream *s, const char *data, size_t data_len, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status; ++ ++ /* append input to buffer */ ++ phpstr_append(PHPSTR(s->stream.opaque), data, data_len); ++ ++retry_raw_inflate: ++ s->stream.next_in = (Bytef *) PHPSTR_VAL(s->stream.opaque); ++ s->stream.avail_in = PHPSTR_LEN(s->stream.opaque); ++ ++ switch (status = http_inflate_rounds(&s->stream, HTTP_ENCODING_STREAM_FLUSH_FLAG(s->flags), decoded, decoded_len)) { ++ case Z_OK: ++ case Z_STREAM_END: ++ /* cut off */ ++ if (s->stream.avail_in) { ++ phpstr_cut(PHPSTR(s->stream.opaque), 0, PHPSTR_LEN(s->stream.opaque) - s->stream.avail_in); ++ } else { ++ phpstr_reset(PHPSTR(s->stream.opaque)); ++ } ++ return SUCCESS; ++ ++ case Z_DATA_ERROR: ++ /* raw deflated data ? */ ++ if (!(s->flags & HTTP_INFLATE_TYPE_RAW) && !s->stream.total_out) { ++ inflateEnd(&s->stream); ++ s->flags |= HTTP_INFLATE_TYPE_RAW; ++ inflateInit2(&s->stream, HTTP_WINDOW_BITS_RAW); ++ goto retry_raw_inflate; ++ } ++ } ++ ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Failed to update inflate stream: %s", zError(status)); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_deflate_stream_flush(http_encoding_stream *, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_encoding_deflate_stream_flush(http_encoding_stream *s, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status; ++ ++ *encoded_len = HTTP_DEFLATE_BUFFER_SIZE; ++ *encoded = emalloc_rel(*encoded_len); ++ ++ s->stream.avail_in = 0; ++ s->stream.next_in = NULL; ++ s->stream.avail_out = *encoded_len; ++ s->stream.next_out = (Bytef *) *encoded; ++ ++ switch (status = deflate(&s->stream, Z_FULL_FLUSH)) { ++ case Z_OK: ++ case Z_STREAM_END: ++ *encoded_len = HTTP_DEFLATE_BUFFER_SIZE - s->stream.avail_out; ++ *encoded = erealloc_rel(*encoded, *encoded_len + 1); ++ (*encoded)[*encoded_len] = '\0'; ++ return SUCCESS; ++ } ++ ++ STR_SET(*encoded, NULL); ++ *encoded_len = 0; ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Failed to flush deflate stream: %s", zError(status)); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_inflate_straem_flush(http_encoding_stream *, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_encoding_inflate_stream_flush(http_encoding_stream *s, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ /* noop */ ++ *decoded = estrndup("", *decoded_len = 0); ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_deflate_stream_finish(http_encoding_stream *, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_encoding_deflate_stream_finish(http_encoding_stream *s, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status; ++ ++ *encoded_len = HTTP_DEFLATE_BUFFER_SIZE; ++ *encoded = emalloc_rel(*encoded_len); ++ ++ /* deflate remaining input */ ++ s->stream.next_in = (Bytef *) PHPSTR_VAL(s->stream.opaque); ++ s->stream.avail_in = PHPSTR_LEN(s->stream.opaque); ++ ++ s->stream.avail_out = *encoded_len; ++ s->stream.next_out = (Bytef *) *encoded; ++ ++ do { ++ status = deflate(&s->stream, Z_FINISH); ++ } while (Z_OK == status); ++ ++ if (Z_STREAM_END == status) { ++ /* cut processed intp off */ ++ phpstr_cut(PHPSTR(s->stream.opaque), 0, PHPSTR_LEN(s->stream.opaque) - s->stream.avail_in); ++ ++ /* size down */ ++ *encoded_len -= s->stream.avail_out; ++ *encoded = erealloc_rel(*encoded, *encoded_len + 1); ++ (*encoded)[*encoded_len] = '\0'; ++ return SUCCESS; ++ } ++ ++ STR_SET(*encoded, NULL); ++ *encoded_len = 0; ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Failed to finish deflate stream: %s", zError(status)); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_inflate_stream_finish(http_encoding_stream *, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_encoding_inflate_stream_finish(http_encoding_stream *s, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status; ++ ++ if (!PHPSTR_LEN(s->stream.opaque)) { ++ *decoded = NULL; ++ *decoded_len = 0; ++ return SUCCESS; ++ } ++ ++ *decoded_len = (PHPSTR_LEN(s->stream.opaque) + 1) * HTTP_INFLATE_ROUNDS; ++ *decoded = emalloc_rel(*decoded_len); ++ ++ /* inflate remaining input */ ++ s->stream.next_in = (Bytef *) PHPSTR_VAL(s->stream.opaque); ++ s->stream.avail_in = PHPSTR_LEN(s->stream.opaque); ++ ++ s->stream.avail_out = *decoded_len; ++ s->stream.next_out = (Bytef *) *decoded; ++ ++ if (Z_STREAM_END == (status = inflate(&s->stream, Z_FINISH))) { ++ /* cut processed input off */ ++ phpstr_cut(PHPSTR(s->stream.opaque), 0, PHPSTR_LEN(s->stream.opaque) - s->stream.avail_in); ++ ++ /* size down */ ++ *decoded_len -= s->stream.avail_out; ++ *decoded = erealloc_rel(*decoded, *decoded_len + 1); ++ (*decoded)[*decoded_len] = '\0'; ++ return SUCCESS; ++ } ++ ++ STR_SET(*decoded, NULL); ++ *decoded_len = 0; ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Failed to finish inflate stream: %s", zError(status)); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ void http_encoding_deflate_stream_dtor(http_encoding_stream *) */ ++PHP_HTTP_API void _http_encoding_deflate_stream_dtor(http_encoding_stream *s TSRMLS_DC) ++{ ++ if (s) { ++ if (s->stream.opaque) { ++ phpstr_free((phpstr **) &s->stream.opaque); ++ } ++ deflateEnd(&s->stream); ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_encoding_inflate_stream_dtor(http_encoding_stream *) */ ++PHP_HTTP_API void _http_encoding_inflate_stream_dtor(http_encoding_stream *s TSRMLS_DC) ++{ ++ if (s) { ++ if (s->stream.opaque) { ++ phpstr_free((phpstr **) &s->stream.opaque); ++ } ++ inflateEnd(&s->stream); ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_encoding_deflate_stream_free(http_encoding_stream **) */ ++PHP_HTTP_API void _http_encoding_deflate_stream_free(http_encoding_stream **s TSRMLS_DC) ++{ ++ if (s) { ++ http_encoding_deflate_stream_dtor(*s); ++ if (*s) { ++ pefree(*s, (*s)->flags & HTTP_ENCODING_STREAM_PERSISTENT); ++ } ++ *s = NULL; ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_encoding_inflate_stream_free(http_encoding_stream **) */ ++PHP_HTTP_API void _http_encoding_inflate_stream_free(http_encoding_stream **s TSRMLS_DC) ++{ ++ if (s) { ++ http_encoding_inflate_stream_dtor(*s); ++ if (*s) { ++ pefree(*s, (*s)->flags & HTTP_ENCODING_STREAM_PERSISTENT); ++ } ++ *s = NULL; ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_ob_deflatehandler(char *, uint, char **, uint *, int) */ ++void _http_ob_deflatehandler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) ++{ ++ int encoding; ++ ++ *handled_output = NULL; ++ *handled_output_len = 0; ++ ++ if (mode & PHP_OUTPUT_HANDLER_START) { ++ int flags; ++ ++ if (HTTP_G->send.deflate.stream) { ++ zend_error(E_ERROR, "ob_deflatehandler() can only be used once"); ++ return; ++ } ++ ++ HTTP_G->send.deflate.response = 1; ++ encoding = http_encoding_response_start(0, 1); ++ HTTP_G->send.deflate.response = 0; ++ ++ switch (encoding) { ++ case HTTP_ENCODING_GZIP: ++ flags = HTTP_DEFLATE_TYPE_GZIP; ++ break; ++ ++ case HTTP_ENCODING_DEFLATE: ++ flags = HTTP_DEFLATE_TYPE_ZLIB; ++ break; ++ ++ default: ++ goto deflate_passthru_plain; ++ } ++ ++ flags |= (HTTP_G->send.deflate.start_flags &~ 0xf0); ++ HTTP_G->send.deflate.stream = http_encoding_deflate_stream_init(NULL, flags); ++ } ++ ++ if (HTTP_G->send.deflate.stream) { ++ if (output_len) { ++ size_t tmp_len; ++ ++ http_encoding_deflate_stream_update((http_encoding_stream *) HTTP_G->send.deflate.stream, output, output_len, handled_output, &tmp_len); ++ *handled_output_len = tmp_len; ++ } ++ ++ if (mode & PHP_OUTPUT_HANDLER_END) { ++ char *remaining = NULL; ++ size_t remaining_len = 0; ++ ++ http_encoding_deflate_stream_finish((http_encoding_stream *) HTTP_G->send.deflate.stream, &remaining, &remaining_len); ++ http_encoding_deflate_stream_free((http_encoding_stream **) &HTTP_G->send.deflate.stream); ++ if (remaining) { ++ *handled_output = erealloc(*handled_output, *handled_output_len + remaining_len + 1); ++ memcpy(*handled_output + *handled_output_len, remaining, remaining_len); ++ (*handled_output)[*handled_output_len += remaining_len] = '\0'; ++ efree(remaining); ++ } ++ } ++ } else { ++deflate_passthru_plain: ++ *handled_output = estrndup(output, *handled_output_len = output_len); ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_ob_inflatehandler(char *, uint, char **, uint *, int) */ ++void _http_ob_inflatehandler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) ++{ ++ *handled_output = NULL; ++ *handled_output_len = 0; ++ ++ if (mode & PHP_OUTPUT_HANDLER_START) { ++ if (HTTP_G->send.inflate.stream) { ++ zend_error(E_ERROR, "ob_inflatehandler() can only be used once"); ++ return; ++ } ++ HTTP_G->send.inflate.stream = http_encoding_inflate_stream_init(NULL, (HTTP_G->send.inflate.start_flags &~ 0xf0)); ++ } ++ ++ if (HTTP_G->send.inflate.stream) { ++ if (output_len) { ++ size_t tmp_len; ++ ++ http_encoding_inflate_stream_update((http_encoding_stream *) HTTP_G->send.inflate.stream, output, output_len, handled_output, &tmp_len); ++ *handled_output_len = tmp_len; ++ } ++ ++ if (mode & PHP_OUTPUT_HANDLER_END) { ++ char *remaining = NULL; ++ size_t remaining_len = 0; ++ ++ http_encoding_inflate_stream_finish((http_encoding_stream *) HTTP_G->send.inflate.stream, &remaining, &remaining_len); ++ http_encoding_inflate_stream_free((http_encoding_stream **) &HTTP_G->send.inflate.stream); ++ if (remaining) { ++ *handled_output = erealloc(*handled_output, *handled_output_len + remaining_len + 1); ++ memcpy(*handled_output + *handled_output_len, remaining, remaining_len); ++ (*handled_output)[*handled_output_len += remaining_len] = '\0'; ++ efree(remaining); ++ } ++ } ++ } else { ++ *handled_output = estrndup(output, *handled_output_len = output_len); ++ } ++} ++/* }}} */ ++ ++#endif /* HTTP_HAVE_ZLIB */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_exception_object.c +@@ -0,0 +1,186 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_exception_object.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#include "php_http.h" ++ ++#ifdef ZEND_ENGINE_2 ++ ++#ifndef HTTP_DBG_EXCEPTIONS ++# define HTTP_DBG_EXCEPTIONS 0 ++#endif ++ ++#include "zend_interfaces.h" ++#include "zend_exceptions.h" ++#include "php_http_exception_object.h" ++ ++zend_class_entry *http_exception_object_ce; ++zend_class_entry *HTTP_EX_CE(runtime); ++zend_class_entry *HTTP_EX_CE(header); ++zend_class_entry *HTTP_EX_CE(malformed_headers); ++zend_class_entry *HTTP_EX_CE(request_method); ++zend_class_entry *HTTP_EX_CE(message_type); ++zend_class_entry *HTTP_EX_CE(invalid_param); ++zend_class_entry *HTTP_EX_CE(encoding); ++zend_class_entry *HTTP_EX_CE(request); ++zend_class_entry *HTTP_EX_CE(request_pool); ++zend_class_entry *HTTP_EX_CE(socket); ++zend_class_entry *HTTP_EX_CE(response); ++zend_class_entry *HTTP_EX_CE(url); ++zend_class_entry *HTTP_EX_CE(querystring); ++ ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpException, method, 0) ++#define HTTP_EXCEPTION_ME(method, visibility) PHP_ME(HttpException, method, HTTP_ARGS(HttpException, method), visibility) ++ ++HTTP_EMPTY_ARGS(__toString); ++ ++zend_function_entry http_exception_object_fe[] = { ++ HTTP_EXCEPTION_ME(__toString, ZEND_ACC_PUBLIC) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++ ++#if HTTP_DBG_EXCEPTIONS ++static void http_exception_hook(zval *ex TSRMLS_DC) ++{ ++ if (ex) { ++ zval *m = zend_read_property(Z_OBJCE_P(ex), ex, "message", lenof("message"), 0 TSRMLS_CC); ++ fprintf(stderr, "*** Threw exception '%s'\n", Z_STRVAL_P(m)); ++ } else { ++ fprintf(stderr, "*** Threw NULL exception\n"); ++ } ++} ++#endif ++ ++PHP_MINIT_FUNCTION(http_exception_object) ++{ ++ HTTP_REGISTER_CLASS(HttpException, http_exception_object, ZEND_EXCEPTION_GET_DEFAULT(), 0); ++ ++ zend_declare_property_null(HTTP_EX_DEF_CE, "innerException", lenof("innerException"), ZEND_ACC_PUBLIC TSRMLS_CC); ++ ++ HTTP_REGISTER_EXCEPTION(HttpRuntimeException, HTTP_EX_CE(runtime), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpInvalidParamException, HTTP_EX_CE(invalid_param), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpHeaderException, HTTP_EX_CE(header), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpMalformedHeadersException, HTTP_EX_CE(malformed_headers), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpRequestMethodException, HTTP_EX_CE(request_method), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpMessageTypeException, HTTP_EX_CE(message_type), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpEncodingException, HTTP_EX_CE(encoding), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpRequestException, HTTP_EX_CE(request), HTTP_EX_DEF_CE); ++ ++ zend_declare_property_long(HTTP_EX_CE(request), "curlCode", lenof("curlCode"), 0, ZEND_ACC_PUBLIC TSRMLS_CC); ++ ++ HTTP_REGISTER_EXCEPTION(HttpRequestPoolException, HTTP_EX_CE(request_pool), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpSocketException, HTTP_EX_CE(socket), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpResponseException, HTTP_EX_CE(response), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpUrlException, HTTP_EX_CE(url), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpQueryStringException, HTTP_EX_CE(querystring), HTTP_EX_DEF_CE); ++ ++ HTTP_LONG_CONSTANT("HTTP_E_RUNTIME", HTTP_E_RUNTIME); ++ HTTP_LONG_CONSTANT("HTTP_E_INVALID_PARAM", HTTP_E_INVALID_PARAM); ++ HTTP_LONG_CONSTANT("HTTP_E_HEADER", HTTP_E_HEADER); ++ HTTP_LONG_CONSTANT("HTTP_E_MALFORMED_HEADERS", HTTP_E_MALFORMED_HEADERS); ++ HTTP_LONG_CONSTANT("HTTP_E_REQUEST_METHOD", HTTP_E_REQUEST_METHOD); ++ HTTP_LONG_CONSTANT("HTTP_E_MESSAGE_TYPE", HTTP_E_MESSAGE_TYPE); ++ HTTP_LONG_CONSTANT("HTTP_E_ENCODING", HTTP_E_ENCODING); ++ HTTP_LONG_CONSTANT("HTTP_E_REQUEST", HTTP_E_REQUEST); ++ HTTP_LONG_CONSTANT("HTTP_E_REQUEST_POOL", HTTP_E_REQUEST_POOL); ++ HTTP_LONG_CONSTANT("HTTP_E_SOCKET", HTTP_E_SOCKET); ++ HTTP_LONG_CONSTANT("HTTP_E_RESPONSE", HTTP_E_RESPONSE); ++ HTTP_LONG_CONSTANT("HTTP_E_URL", HTTP_E_URL); ++ HTTP_LONG_CONSTANT("HTTP_E_QUERYSTRING", HTTP_E_QUERYSTRING); ++ ++#if HTTP_DBG_EXCEPTIONS ++ zend_throw_exception_hook=http_exception_hook; ++#endif ++ ++ return SUCCESS; ++} ++ ++zend_class_entry *_http_exception_get_default() ++{ ++ return http_exception_object_ce; ++} ++ ++zend_class_entry *_http_exception_get_for_code(long code) ++{ ++ zend_class_entry *ex = http_exception_object_ce; ++ ++ switch (code) { ++ case HTTP_E_RUNTIME: ex = HTTP_EX_CE(runtime); break; ++ case HTTP_E_INVALID_PARAM: ex = HTTP_EX_CE(invalid_param); break; ++ case HTTP_E_HEADER: ex = HTTP_EX_CE(header); break; ++ case HTTP_E_MALFORMED_HEADERS: ex = HTTP_EX_CE(malformed_headers); break; ++ case HTTP_E_REQUEST_METHOD: ex = HTTP_EX_CE(request_method); break; ++ case HTTP_E_MESSAGE_TYPE: ex = HTTP_EX_CE(message_type); break; ++ case HTTP_E_ENCODING: ex = HTTP_EX_CE(encoding); break; ++ case HTTP_E_REQUEST: ex = HTTP_EX_CE(request); break; ++ case HTTP_E_REQUEST_POOL: ex = HTTP_EX_CE(request_pool); break; ++ case HTTP_E_SOCKET: ex = HTTP_EX_CE(socket); break; ++ case HTTP_E_RESPONSE: ex = HTTP_EX_CE(response); break; ++ case HTTP_E_URL: ex = HTTP_EX_CE(url); break; ++ case HTTP_E_QUERYSTRING: ex = HTTP_EX_CE(querystring); break; ++ } ++ ++ return ex; ++} ++ ++PHP_METHOD(HttpException, __toString) ++{ ++ phpstr full_str; ++ zend_class_entry *ce; ++ zval *zobj = getThis(), *retval = NULL, *m, *f, *l; ++ ++ phpstr_init(&full_str); ++ ++ do { ++ ce = Z_OBJCE_P(zobj); ++ ++ m = zend_read_property(ce, zobj, "message", lenof("message"), 0 TSRMLS_CC); ++ f = zend_read_property(ce, zobj, "file", lenof("file"), 0 TSRMLS_CC); ++ l = zend_read_property(ce, zobj, "line", lenof("line"), 0 TSRMLS_CC); ++ ++ if (m && f && l && Z_TYPE_P(m) == IS_STRING && Z_TYPE_P(f) == IS_STRING && Z_TYPE_P(l) == IS_LONG) { ++ if (zobj != getThis()) { ++ phpstr_appends(&full_str, " inner "); ++ } ++ ++ phpstr_appendf(&full_str, "exception '%.*s' with message '%.*s' in %.*s:%ld" PHP_EOL, ++ ce->name_length, ce->name, Z_STRLEN_P(m), Z_STRVAL_P(m), Z_STRLEN_P(f), Z_STRVAL_P(f), Z_LVAL_P(l) ++ ); ++ } else { ++ break; ++ } ++ ++ zobj = zend_read_property(ce, zobj, "innerException", lenof("innerException"), 0 TSRMLS_CC); ++ } while (Z_TYPE_P(zobj) == IS_OBJECT); ++ ++ if (zend_call_method_with_0_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "gettraceasstring", &retval) && Z_TYPE_P(retval) == IS_STRING) { ++ phpstr_appends(&full_str, "Stack trace:" PHP_EOL); ++ phpstr_append(&full_str, Z_STRVAL_P(retval), Z_STRLEN_P(retval)); ++ zval_ptr_dtor(&retval); ++ } ++ ++ RETURN_PHPSTR_VAL(&full_str); ++} ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_filter_api.c +@@ -0,0 +1,534 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_filter_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#define HTTP_WANT_ZLIB ++#include "php_http.h" ++ ++#ifdef ZEND_ENGINE_2 ++ ++#include "php_streams.h" ++#include "php_http_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_filter_api.h" ++ ++PHP_MINIT_FUNCTION(http_filter) ++{ ++ php_stream_filter_register_factory("http.*", &http_filter_factory TSRMLS_CC); ++ return SUCCESS; ++} ++ ++/* ++ - ++*/ ++ ++#define HTTP_FILTER_PARAMS \ ++ php_stream *stream, \ ++ php_stream_filter *this, \ ++ php_stream_bucket_brigade *buckets_in, \ ++ php_stream_bucket_brigade *buckets_out, \ ++ size_t *bytes_consumed, int flags \ ++ TSRMLS_DC ++#define HTTP_FILTER_OP(filter) \ ++ http_filter_op_ ##filter ++#define HTTP_FILTER_OPS(filter) \ ++ php_stream_filter_ops HTTP_FILTER_OP(filter) ++#define HTTP_FILTER_DTOR(filter) \ ++ http_filter_ ##filter## _dtor ++#define HTTP_FILTER_DESTRUCTOR(filter) \ ++ void HTTP_FILTER_DTOR(filter)(php_stream_filter *this TSRMLS_DC) ++#define HTTP_FILTER_FUNC(filter) \ ++ http_filter_ ##filter ++#define HTTP_FILTER_FUNCTION(filter) \ ++ php_stream_filter_status_t HTTP_FILTER_FUNC(filter)(HTTP_FILTER_PARAMS) ++#define HTTP_FILTER_BUFFER(filter) \ ++ http_filter_ ##filter## _buffer ++ ++#define NEW_BUCKET(data, length) \ ++ { \ ++ char *__data; \ ++ php_stream_bucket *__buck; \ ++ \ ++ __data = pemalloc(length, this->is_persistent); \ ++ if (!__data) { \ ++ return PSFS_ERR_FATAL; \ ++ } \ ++ memcpy(__data, data, length); \ ++ \ ++ __buck = php_stream_bucket_new(stream, __data, length, 1, this->is_persistent TSRMLS_CC); \ ++ if (!__buck) { \ ++ pefree(__data, this->is_persistent); \ ++ return PSFS_ERR_FATAL; \ ++ } \ ++ \ ++ php_stream_bucket_append(buckets_out, __buck TSRMLS_CC); \ ++ } ++ ++typedef struct _http_chunked_decode_filter_buffer_t { ++ phpstr buffer; ++ ulong hexlen; ++} HTTP_FILTER_BUFFER(chunked_decode); ++ ++#ifdef HTTP_HAVE_ZLIB ++typedef http_encoding_stream HTTP_FILTER_BUFFER(deflate); ++typedef http_encoding_stream HTTP_FILTER_BUFFER(inflate); ++#endif /* HTTP_HAVE_ZLIB */ ++ ++ ++static HTTP_FILTER_FUNCTION(chunked_decode) ++{ ++ int out_avail = 0; ++ php_stream_bucket *ptr, *nxt; ++ HTTP_FILTER_BUFFER(chunked_decode) *buffer = (HTTP_FILTER_BUFFER(chunked_decode) *) (this->abstract); ++ ++ if (bytes_consumed) { ++ *bytes_consumed = 0; ++ } ++ ++ /* new data available? */ ++ if (buckets_in->head) { ++ ++ /* fetch available bucket data */ ++ for (ptr = buckets_in->head; ptr; ptr = nxt) { ++ nxt = ptr->next; ++ if (bytes_consumed) { ++ *bytes_consumed += ptr->buflen; ++ } ++ ++ if (PHPSTR_NOMEM == phpstr_append(PHPSTR(buffer), ptr->buf, ptr->buflen)) { ++ return PSFS_ERR_FATAL; ++ } ++ ++ php_stream_bucket_unlink(ptr TSRMLS_CC); ++ php_stream_bucket_delref(ptr TSRMLS_CC); ++ } ++ } ++ if (!phpstr_fix(PHPSTR(buffer))) { ++ return PSFS_ERR_FATAL; ++ } ++ ++ /* we have data in our buffer */ ++ while (PHPSTR_LEN(buffer)) { ++ ++ /* we already know the size of the chunk and are waiting for data */ ++ if (buffer->hexlen) { ++ ++ /* not enough data buffered */ ++ if (PHPSTR_LEN(buffer) < buffer->hexlen) { ++ ++ /* flush anyway? */ ++ if (flags & PSFS_FLAG_FLUSH_INC) { ++ ++ /* flush all data (should only be chunk data) */ ++ out_avail = 1; ++ NEW_BUCKET(PHPSTR_VAL(buffer), PHPSTR_LEN(buffer)); ++ ++ /* waiting for less data now */ ++ buffer->hexlen -= PHPSTR_LEN(buffer); ++ /* no more buffered data */ ++ phpstr_reset(PHPSTR(buffer)); ++ /* break */ ++ } ++ ++ /* we have too less data and don't need to flush */ ++ else { ++ break; ++ } ++ } ++ ++ /* we seem to have all data of the chunk */ ++ else { ++ out_avail = 1; ++ NEW_BUCKET(PHPSTR_VAL(buffer), buffer->hexlen); ++ ++ /* remove outgoing data from the buffer */ ++ phpstr_cut(PHPSTR(buffer), 0, buffer->hexlen); ++ /* reset hexlen */ ++ buffer->hexlen = 0; ++ /* continue */ ++ } ++ } ++ ++ /* we don't know the length of the chunk yet */ ++ else { ++ size_t off = 0; ++ ++ /* ignore preceeding CRLFs (too loose?) */ ++ while (off < PHPSTR_LEN(buffer) && ( ++ PHPSTR_VAL(buffer)[off] == '\n' || ++ PHPSTR_VAL(buffer)[off] == '\r')) { ++ ++off; ++ } ++ if (off) { ++ phpstr_cut(PHPSTR(buffer), 0, off); ++ } ++ ++ /* still data there? */ ++ if (PHPSTR_LEN(buffer)) { ++ int eollen; ++ const char *eolstr; ++ ++ /* we need eol, so we can be sure we have all hex digits */ ++ phpstr_fix(PHPSTR(buffer)); ++ if ((eolstr = http_locate_eol(PHPSTR_VAL(buffer), &eollen))) { ++ char *stop = NULL; ++ ++ /* read in chunk size */ ++ buffer->hexlen = strtoul(PHPSTR_VAL(buffer), &stop, 16); ++ ++ /* if strtoul() stops at the beginning of the buffered data ++ there's domething oddly wrong, i.e. bad input */ ++ if (stop == PHPSTR_VAL(buffer)) { ++ return PSFS_ERR_FATAL; ++ } ++ ++ /* cut out */ ++ phpstr_cut(PHPSTR(buffer), 0, eolstr + eollen - PHPSTR_VAL(buffer)); ++ /* buffer->hexlen is 0 now or contains the size of the next chunk */ ++ /* continue */ ++ } else { ++ /* we have not enough data buffered to read in chunk size */ ++ break; ++ } ++ } ++ /* break */ ++ } ++ } ++ ++ /* flush before close, but only if we are already waiting for more data */ ++ if ((flags & PSFS_FLAG_FLUSH_CLOSE) && buffer->hexlen && PHPSTR_LEN(buffer)) { ++ out_avail = 1; ++ NEW_BUCKET(PHPSTR_VAL(buffer), PHPSTR_LEN(buffer)); ++ phpstr_reset(PHPSTR(buffer)); ++ buffer->hexlen = 0; ++ } ++ ++ return out_avail ? PSFS_PASS_ON : PSFS_FEED_ME; ++} ++ ++static HTTP_FILTER_DESTRUCTOR(chunked_decode) ++{ ++ HTTP_FILTER_BUFFER(chunked_decode) *b = (HTTP_FILTER_BUFFER(chunked_decode) *) (this->abstract); ++ ++ phpstr_dtor(PHPSTR(b)); ++ pefree(b, this->is_persistent); ++} ++ ++static HTTP_FILTER_FUNCTION(chunked_encode) ++{ ++ int out_avail = 0; ++ php_stream_bucket *ptr, *nxt; ++ ++ if (bytes_consumed) { ++ *bytes_consumed = 0; ++ } ++ ++ /* new data available? */ ++ if (buckets_in->head) { ++ phpstr buf; ++ out_avail = 1; ++ ++ phpstr_init(&buf); ++ ++ /* fetch available bucket data */ ++ for (ptr = buckets_in->head; ptr; ptr = nxt) { ++ nxt = ptr->next; ++ if (bytes_consumed) { ++ *bytes_consumed += ptr->buflen; ++ } ++ ++ phpstr_appendf(&buf, "%x" HTTP_CRLF, ptr->buflen); ++ phpstr_append(&buf, ptr->buf, ptr->buflen); ++ phpstr_appends(&buf, HTTP_CRLF); ++ ++ /* pass through */ ++ NEW_BUCKET(PHPSTR_VAL(&buf), PHPSTR_LEN(&buf)); ++ /* reset */ ++ phpstr_reset(&buf); ++ ++ php_stream_bucket_unlink(ptr TSRMLS_CC); ++ php_stream_bucket_delref(ptr TSRMLS_CC); ++ } ++ ++ /* free buffer */ ++ phpstr_dtor(&buf); ++ } ++ ++ /* terminate with "0" */ ++ if (flags & PSFS_FLAG_FLUSH_CLOSE) { ++ out_avail = 1; ++ NEW_BUCKET("0" HTTP_CRLF, lenof("0" HTTP_CRLF)); ++ } ++ ++ return out_avail ? PSFS_PASS_ON : PSFS_FEED_ME; ++} ++ ++static HTTP_FILTER_OPS(chunked_decode) = { ++ HTTP_FILTER_FUNC(chunked_decode), ++ HTTP_FILTER_DTOR(chunked_decode), ++ "http.chunked_decode" ++}; ++ ++static HTTP_FILTER_OPS(chunked_encode) = { ++ HTTP_FILTER_FUNC(chunked_encode), ++ NULL, ++ "http.chunked_encode" ++}; ++ ++#ifdef HTTP_HAVE_ZLIB ++ ++static HTTP_FILTER_FUNCTION(deflate) ++{ ++ int out_avail = 0; ++ php_stream_bucket *ptr, *nxt; ++ HTTP_FILTER_BUFFER(inflate) *buffer = (HTTP_FILTER_BUFFER(deflate) *) this->abstract; ++ ++ if (bytes_consumed) { ++ *bytes_consumed = 0; ++ } ++ ++ /* new data available? */ ++ if (buckets_in->head) { ++ ++ /* fetch available bucket data */ ++ for (ptr = buckets_in->head; ptr; ptr = nxt) { ++ char *encoded = NULL; ++ size_t encoded_len = 0; ++ ++ nxt = ptr->next; ++ if (bytes_consumed) { ++ *bytes_consumed += ptr->buflen; ++ } ++ ++ if (ptr->buflen) { ++ http_encoding_deflate_stream_update(buffer, ptr->buf, ptr->buflen, &encoded, &encoded_len); ++ if (encoded) { ++ if (encoded_len) { ++ out_avail = 1; ++ NEW_BUCKET(encoded, encoded_len); ++ } ++ efree(encoded); ++ } ++ } ++ ++ php_stream_bucket_unlink(ptr TSRMLS_CC); ++ php_stream_bucket_delref(ptr TSRMLS_CC); ++ } ++ } ++ ++ /* flush & close */ ++ if (flags & PSFS_FLAG_FLUSH_INC) { ++ char *encoded = NULL; ++ size_t encoded_len = 0; ++ ++ http_encoding_deflate_stream_flush(buffer, &encoded, &encoded_len); ++ if (encoded) { ++ if (encoded_len) { ++ out_avail = 1; ++ NEW_BUCKET(encoded, encoded_len); ++ } ++ efree(encoded); ++ } ++ } ++ ++ if (flags & PSFS_FLAG_FLUSH_CLOSE) { ++ char *encoded = NULL; ++ size_t encoded_len = 0; ++ ++ http_encoding_deflate_stream_finish(buffer, &encoded, &encoded_len); ++ if (encoded) { ++ if (encoded_len) { ++ out_avail = 1; ++ NEW_BUCKET(encoded, encoded_len); ++ } ++ efree(encoded); ++ } ++ } ++ ++ return out_avail ? PSFS_PASS_ON : PSFS_FEED_ME; ++} ++ ++static HTTP_FILTER_FUNCTION(inflate) ++{ ++ int out_avail = 0; ++ php_stream_bucket *ptr, *nxt; ++ HTTP_FILTER_BUFFER(inflate) *buffer = (HTTP_FILTER_BUFFER(inflate) *) this->abstract; ++ ++ if (bytes_consumed) { ++ *bytes_consumed = 0; ++ } ++ ++ /* new data available? */ ++ if (buckets_in->head) { ++ ++ /* fetch available bucket data */ ++ for (ptr = buckets_in->head; ptr; ptr = nxt) { ++ char *decoded = NULL; ++ size_t decoded_len = 0; ++ ++ nxt = ptr->next; ++ if (bytes_consumed) { ++ *bytes_consumed += ptr->buflen; ++ } ++ ++ if (ptr->buflen) { ++ http_encoding_inflate_stream_update(buffer, ptr->buf, ptr->buflen, &decoded, &decoded_len); ++ if (decoded) { ++ if (decoded_len) { ++ out_avail = 1; ++ NEW_BUCKET(decoded, decoded_len); ++ } ++ efree(decoded); ++ } ++ } ++ ++ php_stream_bucket_unlink(ptr TSRMLS_CC); ++ php_stream_bucket_delref(ptr TSRMLS_CC); ++ } ++ } ++ ++ /* flush & close */ ++ if (flags & PSFS_FLAG_FLUSH_INC) { ++ char *decoded = NULL; ++ size_t decoded_len = 0; ++ ++ http_encoding_inflate_stream_flush(buffer, &decoded, &decoded_len); ++ if (decoded) { ++ if (decoded_len) { ++ out_avail = 1; ++ NEW_BUCKET(decoded, decoded_len); ++ } ++ efree(decoded); ++ } ++ } ++ ++ if (flags & PSFS_FLAG_FLUSH_CLOSE) { ++ char *decoded = NULL; ++ size_t decoded_len = 0; ++ ++ http_encoding_inflate_stream_finish(buffer, &decoded, &decoded_len); ++ if (decoded) { ++ if (decoded_len) { ++ out_avail = 1; ++ NEW_BUCKET(decoded, decoded_len); ++ } ++ efree(decoded); ++ } ++ } ++ ++ return out_avail ? PSFS_PASS_ON : PSFS_FEED_ME; ++} ++ ++static HTTP_FILTER_DESTRUCTOR(deflate) ++{ ++ HTTP_FILTER_BUFFER(deflate) *buffer = (HTTP_FILTER_BUFFER(deflate) *) this->abstract; ++ http_encoding_deflate_stream_free(&buffer); ++} ++ ++static HTTP_FILTER_DESTRUCTOR(inflate) ++{ ++ HTTP_FILTER_BUFFER(inflate) *buffer = (HTTP_FILTER_BUFFER(inflate) *) this->abstract; ++ http_encoding_inflate_stream_free(&buffer); ++} ++ ++static HTTP_FILTER_OPS(deflate) = { ++ HTTP_FILTER_FUNC(deflate), ++ HTTP_FILTER_DTOR(deflate), ++ "http.deflate" ++}; ++ ++static HTTP_FILTER_OPS(inflate) = { ++ HTTP_FILTER_FUNC(inflate), ++ HTTP_FILTER_DTOR(inflate), ++ "http.inflate" ++}; ++ ++#endif /* HTTP_HAVE_ZLIB */ ++ ++static php_stream_filter *http_filter_create(const char *name, zval *params, int p TSRMLS_DC) ++{ ++ zval **tmp = ¶ms; ++ php_stream_filter *f = NULL; ++ ++ if (!strcasecmp(name, "http.chunked_decode")) { ++ HTTP_FILTER_BUFFER(chunked_decode) *b = NULL; ++ ++ if ((b = pecalloc(1, sizeof(HTTP_FILTER_BUFFER(chunked_decode)), p))) { ++ phpstr_init_ex(PHPSTR(b), 4096, p ? PHPSTR_INIT_PERSISTENT : 0); ++ if (!(f = php_stream_filter_alloc(&HTTP_FILTER_OP(chunked_decode), b, p))) { ++ pefree(b, p); ++ } ++ } ++ } else ++ ++ if (!strcasecmp(name, "http.chunked_encode")) { ++ f = php_stream_filter_alloc(&HTTP_FILTER_OP(chunked_encode), NULL, p); ++#ifdef HTTP_HAVE_ZLIB ++ } else ++ ++ if (!strcasecmp(name, "http.inflate")) { ++ int flags = p ? HTTP_ENCODING_STREAM_PERSISTENT : 0; ++ HTTP_FILTER_BUFFER(inflate) *b = NULL; ++ ++ if ((b = http_encoding_inflate_stream_init(NULL, flags))) { ++ if (!(f = php_stream_filter_alloc(&HTTP_FILTER_OP(inflate), b, p))) { ++ http_encoding_inflate_stream_free(&b); ++ } ++ } ++ } else ++ ++ if (!strcasecmp(name, "http.deflate")) { ++ int flags = p ? HTTP_ENCODING_STREAM_PERSISTENT : 0; ++ HTTP_FILTER_BUFFER(deflate) *b = NULL; ++ ++ if (params) { ++ switch (Z_TYPE_P(params)) { ++ case IS_ARRAY: ++ case IS_OBJECT: ++ if (SUCCESS != zend_hash_find(HASH_OF(params), "flags", sizeof("flags"), (void *) &tmp)) { ++ break; ++ } ++ default: ++ { ++ zval *num = http_zsep(IS_LONG, *tmp); ++ ++ flags |= (Z_LVAL_P(num) & 0x0fffffff); ++ zval_ptr_dtor(&num); ++ } ++ } ++ } ++ if ((b = http_encoding_deflate_stream_init(NULL, flags))) { ++ if (!(f = php_stream_filter_alloc(&HTTP_FILTER_OP(deflate), b, p))) { ++ http_encoding_deflate_stream_free(&b); ++ } ++ } ++#endif /* HTTP_HAVE_ZLIB */ ++ } ++ ++ return f; ++} ++ ++php_stream_filter_factory http_filter_factory = { ++ http_filter_create ++}; ++ ++#endif /* ZEND_ENGINE_2 */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/http_functions.c +@@ -0,0 +1,1424 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_functions.c 300301 2010-06-09 08:30:34Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_CURL ++#define HTTP_WANT_ZLIB ++#include "php_http.h" ++ ++#include "php_ini.h" ++#include "ext/standard/php_string.h" ++#include "zend_operators.h" ++ ++#ifdef HTTP_HAVE_SESSION ++# include "ext/session/php_session.h" ++#endif ++ ++#include "php_http_api.h" ++#include "php_http_cache_api.h" ++#include "php_http_cookie_api.h" ++#include "php_http_date_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_headers_api.h" ++#include "php_http_message_api.h" ++#include "php_http_request_api.h" ++#include "php_http_request_method_api.h" ++#include "php_http_persistent_handle_api.h" ++#include "php_http_send_api.h" ++#include "php_http_url_api.h" ++ ++/* {{{ proto string http_date([int timestamp]) ++ Compose a valid HTTP date regarding RFC 1123 looking like: "Wed, 22 Dec 2004 11:34:47 GMT" */ ++PHP_FUNCTION(http_date) ++{ ++ long t = -1; ++ char *date; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &t) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (t == -1) { ++ t = HTTP_G->request.time; ++ } ++ ++ if (!(date = http_date(t))) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Could not compose date of timestamp %ld", t); ++ RETURN_FALSE; ++ } ++ ++ RETURN_STRING(date, 0); ++} ++/* }}} */ ++ ++/* {{{ proto string http_build_url([mixed url[, mixed parts[, int flags = HTTP_URL_REPLACE|HTTP_URL_FROM_ENV[, array &new_url]]]]) ++ Build an URL. */ ++PHP_FUNCTION(http_build_url) ++{ ++ char *url_str = NULL; ++ size_t url_len = 0; ++ long flags = HTTP_URL_REPLACE|HTTP_URL_FROM_ENV; ++ zval *z_old_url = NULL, *z_new_url = NULL, *z_composed_url = NULL; ++ php_url *old_url = NULL, *new_url = NULL, *composed_url = NULL; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z!/z!/lz", &z_old_url, &z_new_url, &flags, &z_composed_url) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (z_new_url) { ++ if (Z_TYPE_P(z_new_url) == IS_ARRAY || Z_TYPE_P(z_new_url) == IS_OBJECT) { ++ new_url = http_url_from_struct(NULL, HASH_OF(z_new_url)); ++ } else { ++ convert_to_string(z_new_url); ++ if (!(new_url = php_url_parse_ex(Z_STRVAL_P(z_new_url), Z_STRLEN_P(z_new_url)))) { ++ http_error_ex(HE_WARNING, HTTP_E_URL, "Could not parse URL (%s)", Z_STRVAL_P(z_new_url)); ++ RETURN_FALSE; ++ } ++ } ++ } ++ ++ if (z_old_url) { ++ if (Z_TYPE_P(z_old_url) == IS_ARRAY || Z_TYPE_P(z_old_url) == IS_OBJECT) { ++ old_url = http_url_from_struct(NULL, HASH_OF(z_old_url)); ++ } else { ++ convert_to_string(z_old_url); ++ if (!(old_url = php_url_parse_ex(Z_STRVAL_P(z_old_url), Z_STRLEN_P(z_old_url)))) { ++ if (new_url) { ++ php_url_free(new_url); ++ } ++ http_error_ex(HE_WARNING, HTTP_E_URL, "Could not parse URL (%s)", Z_STRVAL_P(z_old_url)); ++ RETURN_FALSE; ++ } ++ } ++ } ++ ++ if (z_composed_url) { ++ http_build_url(flags, old_url, new_url, &composed_url, &url_str, &url_len); ++ http_url_tostruct(composed_url, z_composed_url); ++ php_url_free(composed_url); ++ } else { ++ http_build_url(flags, old_url, new_url, NULL, &url_str, &url_len); ++ } ++ ++ if (new_url) { ++ php_url_free(new_url); ++ } ++ if (old_url) { ++ php_url_free(old_url); ++ } ++ ++ RETURN_STRINGL(url_str, url_len, 0); ++} ++/* }}} */ ++ ++/* {{{ proto string http_build_str(array query [, string prefix[, string arg_separator]]) ++ Opponent to parse_str(). */ ++PHP_FUNCTION(http_build_str) ++{ ++ zval *formdata; ++ char *prefix = NULL, *arg_sep = INI_STR("arg_separator.output"); ++ int prefix_len = 0, arg_sep_len = strlen(arg_sep); ++ phpstr formstr; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|ss", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (!arg_sep_len) { ++ arg_sep = HTTP_URL_ARGSEP; ++ arg_sep_len = lenof(HTTP_URL_ARGSEP); ++ } ++ ++ phpstr_init(&formstr); ++ if (SUCCESS != http_urlencode_hash_recursive(HASH_OF(formdata), &formstr, arg_sep, arg_sep_len, prefix, prefix_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!formstr.used) { ++ phpstr_dtor(&formstr); ++ RETURN_NULL(); ++ } ++ ++ RETURN_PHPSTR_VAL(&formstr); ++} ++/* }}} */ ++ ++#define HTTP_DO_NEGOTIATE_DEFAULT(supported) \ ++ { \ ++ zval **value; \ ++ \ ++ zend_hash_internal_pointer_reset(Z_ARRVAL_P(supported)); \ ++ if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(supported), (void *) &value)) { \ ++ RETVAL_ZVAL(*value, 1, 0); \ ++ } else { \ ++ RETVAL_NULL(); \ ++ } \ ++ } ++ ++#define HTTP_DO_NEGOTIATE_HANDLE_DEFAULT(supported, rs_array) \ ++ HTTP_DO_NEGOTIATE_DEFAULT(supported); \ ++ if (rs_array) { \ ++ HashPosition pos; \ ++ zval **value_ptr; \ ++ \ ++ FOREACH_VAL(pos, supported, value_ptr) { \ ++ zval *value = http_zsep(IS_STRING, *value_ptr); \ ++ add_assoc_double(rs_array, Z_STRVAL_P(value), 1.0); \ ++ zval_ptr_dtor(&value); \ ++ } \ ++ } ++ ++#define HTTP_DO_NEGOTIATE_HANDLE_RESULT(result, supported, rs_array) \ ++ { \ ++ char *key; \ ++ uint key_len; \ ++ ulong idx; \ ++ \ ++ if (zend_hash_num_elements(result) && HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(result, &key, &key_len, &idx, 1, NULL)) { \ ++ RETVAL_STRINGL(key, key_len-1, 0); \ ++ } else { \ ++ HTTP_DO_NEGOTIATE_DEFAULT(supported); \ ++ } \ ++ \ ++ if (rs_array) { \ ++ zend_hash_copy(Z_ARRVAL_P(rs_array), result, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); \ ++ } \ ++ \ ++ zend_hash_destroy(result); \ ++ FREE_HASHTABLE(result); \ ++ } ++ ++#define HTTP_DO_NEGOTIATE(type, supported, rs_array) \ ++ { \ ++ HashTable *result; \ ++ if ((result = http_negotiate_ ##type(supported))) { \ ++ HTTP_DO_NEGOTIATE_HANDLE_RESULT(result, supported, rs_array); \ ++ } else { \ ++ HTTP_DO_NEGOTIATE_HANDLE_DEFAULT(supported, rs_array); \ ++ } \ ++ } ++ ++/* {{{ proto string http_negotiate_language(array supported[, array &result]) ++ Negotiate the clients preferred language. */ ++PHP_FUNCTION(http_negotiate_language) ++{ ++ zval *supported, *rs_array = NULL; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|z", &supported, &rs_array) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (rs_array) { ++ zval_dtor(rs_array); ++ array_init(rs_array); ++ } ++ ++ HTTP_DO_NEGOTIATE(language, supported, rs_array); ++} ++/* }}} */ ++ ++/* {{{ proto string http_negotiate_charset(array supported[, array &result]) ++ Negotiate the clients preferred charset. */ ++PHP_FUNCTION(http_negotiate_charset) ++{ ++ zval *supported, *rs_array = NULL; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|z", &supported, &rs_array) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (rs_array) { ++ zval_dtor(rs_array); ++ array_init(rs_array); ++ } ++ ++ HTTP_DO_NEGOTIATE(charset, supported, rs_array); ++} ++/* }}} */ ++ ++/* {{{ proto string http_negotiate_content_type(array supported[, array &result]) ++ Negotiate the clients preferred content type. */ ++PHP_FUNCTION(http_negotiate_content_type) ++{ ++ zval *supported, *rs_array = NULL; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|z", &supported, &rs_array)) { ++ RETURN_FALSE; ++ } ++ ++ if (rs_array) { ++ zval_dtor(rs_array); ++ array_init(rs_array); ++ } ++ ++ HTTP_DO_NEGOTIATE(content_type, supported, rs_array); ++} ++/* }}} */ ++ ++/* {{{ proto string http_negotiate(mixed value, array supported[, array &result]) ++ Negotiate the user supplied value. */ ++PHP_FUNCTION(http_negotiate) ++{ ++ zval *value, *supported, *rs_array = NULL; ++ HashTable *rs; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "za|z", &value, &supported, &rs_array)) { ++ RETURN_FALSE; ++ } ++ ++ if (rs_array) { ++ zval_dtor(rs_array); ++ array_init(rs_array); ++ } ++ ++ if ((rs = http_negotiate_z(value, Z_ARRVAL_P(supported), http_negotiate_default_func))) { ++ HTTP_DO_NEGOTIATE_HANDLE_RESULT(rs, supported, rs_array); ++ } else { ++ HTTP_DO_NEGOTIATE_HANDLE_DEFAULT(supported, rs_array); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool http_send_status(int status) ++ Send HTTP status code. */ ++PHP_FUNCTION(http_send_status) ++{ ++ long status = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &status) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ if (status < 100 || status > 510) { ++ http_error_ex(HE_WARNING, HTTP_E_HEADER, "Invalid HTTP status code (100-510): %d", status); ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(http_send_status(status)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_send_last_modified([int timestamp]) ++ Send a "Last-Modified" header with a valid HTTP date. */ ++PHP_FUNCTION(http_send_last_modified) ++{ ++ long t = -1; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &t) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (t == -1) { ++ t = HTTP_G->request.time; ++ } ++ ++ RETURN_SUCCESS(http_send_last_modified(t)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_send_content_type([string content_type = 'application/x-octetstream']) ++ Send the Content-Type of the sent entity. This is particularly important if you use the http_send() API. */ ++PHP_FUNCTION(http_send_content_type) ++{ ++ char *ct = "application/x-octetstream"; ++ int ct_len = lenof("application/x-octetstream"); ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ct, &ct_len) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(http_send_content_type(ct, ct_len)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_send_content_disposition(string filename[, bool inline = false]) ++ Send the Content-Disposition. */ ++PHP_FUNCTION(http_send_content_disposition) ++{ ++ char *filename; ++ int f_len; ++ zend_bool send_inline = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &filename, &f_len, &send_inline) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ RETURN_SUCCESS(http_send_content_disposition(filename, f_len, send_inline)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_match_modified([int timestamp[, bool for_range = false]]) ++ Matches the given unix timestamp against the clients "If-Modified-Since" resp. "If-Unmodified-Since" HTTP headers. */ ++PHP_FUNCTION(http_match_modified) ++{ ++ long t = -1; ++ zend_bool for_range = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lb", &t, &for_range) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ // current time if not supplied (senseless though) ++ if (t == -1) { ++ t = HTTP_G->request.time; ++ } ++ ++ if (for_range) { ++ RETURN_BOOL(http_match_last_modified("HTTP_IF_UNMODIFIED_SINCE", t)); ++ } ++ RETURN_BOOL(http_match_last_modified("HTTP_IF_MODIFIED_SINCE", t)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_match_etag(string etag[, bool for_range = false]) ++ Matches the given ETag against the clients "If-Match" resp. "If-None-Match" HTTP headers. */ ++PHP_FUNCTION(http_match_etag) ++{ ++ int etag_len; ++ char *etag; ++ zend_bool for_range = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &etag, &etag_len, &for_range) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (for_range) { ++ RETURN_BOOL(http_match_etag("HTTP_IF_MATCH", etag)); ++ } ++ RETURN_BOOL(http_match_etag("HTTP_IF_NONE_MATCH", etag)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_cache_last_modified([int timestamp_or_expires]]) ++ Attempts to cache the sent entity by its last modification date. */ ++PHP_FUNCTION(http_cache_last_modified) ++{ ++ long last_modified = 0, send_modified = 0, t; ++ zval *zlm; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &last_modified) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ HTTP_CHECK_HEADERS_SENT(RETURN_FALSE); ++ ++ t = HTTP_G->request.time; ++ ++ /* 0 or omitted */ ++ if (!last_modified) { ++ /* does the client have? (att: caching "forever") */ ++ if ((zlm = http_get_server_var("HTTP_IF_MODIFIED_SINCE", 1))) { ++ last_modified = send_modified = http_parse_date(Z_STRVAL_P(zlm)); ++ /* send current time */ ++ } else { ++ send_modified = t; ++ } ++ /* negative value is supposed to be expiration time */ ++ } else if (last_modified < 0) { ++ last_modified += t; ++ send_modified = t; ++ /* send supplied time explicitly */ ++ } else { ++ send_modified = last_modified; ++ } ++ ++ RETURN_SUCCESS(http_cache_last_modified(last_modified, send_modified, HTTP_DEFAULT_CACHECONTROL, lenof(HTTP_DEFAULT_CACHECONTROL))); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_cache_etag([string etag]) ++ Attempts to cache the sent entity by its ETag, either supplied or generated by the hash algorithm specified by the INI setting "http.etag.mode". */ ++PHP_FUNCTION(http_cache_etag) ++{ ++ char *etag = NULL; ++ int etag_len = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &etag, &etag_len) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ HTTP_CHECK_HEADERS_SENT(RETURN_FALSE); ++ ++ RETURN_SUCCESS(http_cache_etag(etag, etag_len, HTTP_DEFAULT_CACHECONTROL, lenof(HTTP_DEFAULT_CACHECONTROL))); ++} ++/* }}} */ ++ ++/* {{{ proto string ob_etaghandler(string data, int mode) ++ For use with ob_start(). Output buffer handler generating an ETag with the hash algorithm specified with the INI setting "http.etag.mode". */ ++PHP_FUNCTION(ob_etaghandler) ++{ ++ char *data; ++ int data_len; ++ long mode; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &data, &data_len, &mode)) { ++ RETURN_FALSE; ++ } ++ ++ Z_TYPE_P(return_value) = IS_STRING; ++ http_ob_etaghandler(data, data_len, &Z_STRVAL_P(return_value), (uint *) &Z_STRLEN_P(return_value), mode); ++} ++/* }}} */ ++ ++/* {{{ proto void http_throttle(double sec[, int bytes = 40960]) ++ Sets the throttle delay and send buffer size for use with http_send() API. */ ++PHP_FUNCTION(http_throttle) ++{ ++ long chunk_size = HTTP_SENDBUF_SIZE; ++ double interval; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|l", &interval, &chunk_size)) { ++ return; ++ } ++ ++ HTTP_G->send.throttle_delay = interval; ++ HTTP_G->send.buffer_size = chunk_size; ++} ++/* }}} */ ++ ++/* {{{ proto void http_redirect([string url[, array params[, bool session = false[, int status = 302]]]]) ++ Redirect to the given url. */ ++PHP_FUNCTION(http_redirect) ++{ ++ int url_len = 0; ++ size_t query_len = 0; ++ zend_bool session = 0, free_params = 0; ++ zval *params = NULL; ++ long status = HTTP_REDIRECT; ++ char *query = NULL, *url = NULL, *URI, *LOC, *RED = NULL; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sa!/bl", &url, &url_len, ¶ms, &session, &status) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++#ifdef HTTP_HAVE_SESSION ++ /* append session info */ ++ if (session) { ++ if (!params) { ++ free_params = 1; ++ MAKE_STD_ZVAL(params); ++ array_init(params); ++ } ++ if (PS(session_status) == php_session_active) { ++ if (add_assoc_string(params, PS(session_name), PS(id), 1) != SUCCESS) { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "Could not append session information"); ++ } ++ } ++ } ++#endif ++ ++ /* treat params array with http_build_query() */ ++ if (params) { ++ if (SUCCESS != http_urlencode_hash_ex(Z_ARRVAL_P(params), 0, NULL, 0, &query, &query_len)) { ++ if (free_params) { ++ zval_dtor(params); ++ FREE_ZVAL(params); ++ } ++ if (query) { ++ efree(query); ++ } ++ RETURN_FALSE; ++ } ++ } ++ ++ URI = http_absolute_url_ex(url, HTTP_URL_FROM_ENV); ++ ++ if (query_len) { ++ spprintf(&LOC, 0, "Location: %s?%s", URI, query); ++ if (status != 300) { ++ spprintf(&RED, 0, "Redirecting to %s?%s.\n", URI, query, URI, query); ++ } ++ } else { ++ spprintf(&LOC, 0, "Location: %s", URI); ++ if (status != 300) { ++ spprintf(&RED, 0, "Redirecting to %s.\n", URI, URI); ++ } ++ } ++ ++ efree(URI); ++ if (query) { ++ efree(query); ++ } ++ if (free_params) { ++ zval_dtor(params); ++ FREE_ZVAL(params); ++ } ++ ++ switch (status) { ++ case 300: ++ RETVAL_SUCCESS(http_send_status_header(status, LOC)); ++ efree(LOC); ++ return; ++ ++ case HTTP_REDIRECT_PERM: ++ case HTTP_REDIRECT_FOUND: ++ case HTTP_REDIRECT_POST: ++ case HTTP_REDIRECT_PROXY: ++ case HTTP_REDIRECT_TEMP: ++ break; ++ ++ case 306: ++ default: ++ http_error_ex(HE_NOTICE, HTTP_E_RUNTIME, "Unsupported redirection status code: %ld", status); ++ case HTTP_REDIRECT: ++ if ( SG(request_info).request_method && ++ strcasecmp(SG(request_info).request_method, "HEAD") && ++ strcasecmp(SG(request_info).request_method, "GET")) { ++ status = HTTP_REDIRECT_POST; ++ } else { ++ status = HTTP_REDIRECT_FOUND; ++ } ++ break; ++ } ++ ++ RETURN_SUCCESS(http_exit_ex(status, LOC, RED, 1)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_send_data(string data) ++ Sends raw data with support for (multiple) range requests. */ ++PHP_FUNCTION(http_send_data) ++{ ++ int data_len; ++ char *data_buf; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &data_buf, &data_len) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(http_send_data(data_buf, data_len)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_send_file(string file) ++ Sends a file with support for (multiple) range requests. */ ++PHP_FUNCTION(http_send_file) ++{ ++ char *file; ++ int flen = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &flen) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ if (!flen) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(http_send_file(file)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_send_stream(resource stream) ++ Sends an already opened stream with support for (multiple) range requests. */ ++PHP_FUNCTION(http_send_stream) ++{ ++ zval *zstream; ++ php_stream *file; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstream) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ php_stream_from_zval(file, &zstream); ++ RETURN_SUCCESS(http_send_stream(file)); ++} ++/* }}} */ ++ ++/* {{{ proto string http_chunked_decode(string encoded) ++ Decodes a string that was HTTP-chunked encoded. */ ++PHP_FUNCTION(http_chunked_decode) ++{ ++ char *encoded = NULL, *decoded = NULL; ++ size_t decoded_len = 0; ++ int encoded_len = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &encoded, &encoded_len) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (NULL != http_encoding_dechunk(encoded, encoded_len, &decoded, &decoded_len)) { ++ RETURN_STRINGL(decoded, (int) decoded_len, 0); ++ } else { ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto object http_parse_message(string message) ++ Parses (a) http_message(s) into a simple recursive object structure. */ ++PHP_FUNCTION(http_parse_message) ++{ ++ char *message; ++ int message_len; ++ http_message *msg = NULL; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &message, &message_len)) { ++ RETURN_NULL(); ++ } ++ ++ if ((msg = http_message_parse(message, message_len))) { ++ object_init(return_value); ++ http_message_tostruct_recursive(msg, return_value); ++ http_message_free(&msg); ++ } else { ++ RETURN_NULL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto array http_parse_headers(string header) ++ Parses HTTP headers into an associative array. */ ++PHP_FUNCTION(http_parse_headers) ++{ ++ char *header; ++ int header_len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &header, &header_len)) { ++ RETURN_FALSE; ++ } ++ ++ array_init(return_value); ++ if (SUCCESS != http_parse_headers(header, return_value)) { ++ zval_dtor(return_value); ++ http_error(HE_WARNING, HTTP_E_MALFORMED_HEADERS, "Failed to parse headers"); ++ RETURN_FALSE; ++ } ++} ++/* }}}*/ ++ ++/* {{{ proto object http_parse_cookie(string cookie[, int flags[, array allowed_extras]]) ++ Parses HTTP cookies like sent in a response into a struct. */ ++PHP_FUNCTION(http_parse_cookie) ++{ ++ char *cookie, **allowed_extras = NULL; ++ int i = 0, cookie_len; ++ long flags = 0; ++ zval *allowed_extras_array = NULL, **entry = NULL; ++ HashPosition pos; ++ http_cookie_list list; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|la!", &cookie, &cookie_len, &flags, &allowed_extras_array)) { ++ RETURN_FALSE; ++ } ++ ++ if (allowed_extras_array) { ++ allowed_extras = ecalloc(zend_hash_num_elements(Z_ARRVAL_P(allowed_extras_array)) + 1, sizeof(char *)); ++ FOREACH_VAL(pos, allowed_extras_array, entry) { ++ zval *data = http_zsep(IS_STRING, *entry); ++ allowed_extras[i++] = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data)); ++ zval_ptr_dtor(&data); ++ } ++ } ++ ++ if (http_parse_cookie_ex(&list, cookie, flags, allowed_extras)) { ++ object_init(return_value); ++ http_cookie_list_tostruct(&list, return_value); ++ http_cookie_list_dtor(&list); ++ } else { ++ RETVAL_FALSE; ++ } ++ ++ if (allowed_extras) { ++ for (i = 0; allowed_extras[i]; ++i) { ++ efree(allowed_extras[i]); ++ } ++ efree(allowed_extras); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string http_build_cookie(array cookie) ++ Build a cookie string from an array/object like returned by http_parse_cookie(). */ ++PHP_FUNCTION(http_build_cookie) ++{ ++ char *str = NULL; ++ size_t len = 0; ++ zval *strct; ++ http_cookie_list list; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &strct)) { ++ RETURN_FALSE; ++ } ++ ++ http_cookie_list_fromstruct(&list, strct); ++ http_cookie_list_tostring(&list, &str, &len); ++ http_cookie_list_dtor(&list); ++ ++ RETURN_STRINGL(str, len, 0); ++} ++/* }}} */ ++ ++/* {{{ proto object http_parse_params(string param[, int flags = HTTP_PARAMS_DEFAULT]) ++ Parse parameter list. */ ++PHP_FUNCTION(http_parse_params) ++{ ++ char *param; ++ int param_len; ++ zval *params; ++ long flags = HTTP_PARAMS_DEFAULT; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", ¶m, ¶m_len, &flags)) { ++ RETURN_FALSE; ++ } ++ ++ MAKE_STD_ZVAL(params); ++ array_init(params); ++ if (SUCCESS != http_parse_params(param, flags, Z_ARRVAL_P(params))) { ++ zval_ptr_dtor(¶ms); ++ RETURN_FALSE; ++ } ++ ++ object_init(return_value); ++ add_property_zval(return_value, "params", params); ++#ifdef ZEND_ENGINE_2 ++ zval_ptr_dtor(¶ms); ++#endif ++} ++/* }}} */ ++ ++/* {{{ proto array http_get_request_headers(void) ++ Get a list of incoming HTTP headers. */ ++PHP_FUNCTION(http_get_request_headers) ++{ ++ NO_ARGS; ++ ++ array_init(return_value); ++ http_get_request_headers(Z_ARRVAL_P(return_value)); ++} ++/* }}} */ ++ ++/* {{{ proto string http_get_request_body(void) ++ Get the raw request body (e.g. POST or PUT data). */ ++PHP_FUNCTION(http_get_request_body) ++{ ++ char *body; ++ size_t length; ++ ++ NO_ARGS; ++ ++ if (SUCCESS == http_get_request_body(&body, &length)) { ++ RETURN_STRINGL(body, (int) length, 0); ++ } else { ++ RETURN_NULL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto resource http_get_request_body_stream(void) ++ Create a stream to read the raw request body (e.g. POST or PUT data). This function can only be used once if the request method was another than POST. */ ++PHP_FUNCTION(http_get_request_body_stream) ++{ ++ php_stream *s; ++ ++ NO_ARGS; ++ ++ if ((s = http_get_request_body_stream())) { ++ php_stream_to_zval(s, return_value); ++ } else { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "Failed to create request body stream"); ++ RETURN_NULL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool http_match_request_header(string header, string value[, bool match_case = false]) ++ Match an incoming HTTP header. */ ++PHP_FUNCTION(http_match_request_header) ++{ ++ char *header, *value; ++ int header_len, value_len; ++ zend_bool match_case = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &header, &header_len, &value, &value_len, &match_case)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_BOOL(http_match_request_header_ex(header, value, match_case)); ++} ++/* }}} */ ++ ++/* {{{ proto object http_persistent_handles_count() */ ++PHP_FUNCTION(http_persistent_handles_count) ++{ ++ NO_ARGS; ++ object_init(return_value); ++ if (!http_persistent_handle_statall_ex(HASH_OF(return_value))) { ++ zval_dtor(return_value); ++ RETURN_NULL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void http_persistent_handles_clean([string name]) */ ++PHP_FUNCTION(http_persistent_handles_clean) ++{ ++ char *name_str = NULL; ++ int name_len = 0; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name_str, &name_len)) { ++ http_persistent_handle_cleanup_ex(name_str, name_len, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string http_persistent_handles_ident([string ident]) */ ++PHP_FUNCTION(http_persistent_handles_ident) ++{ ++ char *ident_str = NULL; ++ int ident_len = 0; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ident_str, &ident_len)) { ++ RETVAL_STRING(zend_ini_string(ZEND_STRS("http.persistent.handles.ident"), 0), 1); ++ if (ident_str && ident_len) { ++ zend_alter_ini_entry(ZEND_STRS("http.persistent.handles.ident"), ident_str, ident_len, ZEND_INI_USER, PHP_INI_STAGE_RUNTIME); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ HAVE_CURL */ ++#ifdef HTTP_HAVE_CURL ++ ++#define RETVAL_RESPONSE_OR_BODY(request) \ ++ { \ ++ zval **bodyonly; \ ++ \ ++ /* check if only the body should be returned */ \ ++ if (options && (SUCCESS == zend_hash_find(Z_ARRVAL_P(options), "bodyonly", sizeof("bodyonly"), (void *) &bodyonly)) && i_zend_is_true(*bodyonly)) { \ ++ http_message *msg = http_message_parse(PHPSTR_VAL(&request.conv.response), PHPSTR_LEN(&request.conv.response)); \ ++ \ ++ if (msg) { \ ++ RETVAL_STRINGL(PHPSTR_VAL(&msg->body), PHPSTR_LEN(&msg->body), 1); \ ++ http_message_free(&msg); \ ++ } \ ++ } else { \ ++ RETVAL_STRINGL(request.conv.response.data, request.conv.response.used, 1); \ ++ } \ ++ } ++ ++/* {{{ proto string http_get(string url[, array options[, array &info]]) ++ Performs an HTTP GET request on the supplied url. */ ++PHP_FUNCTION(http_get) ++{ ++ zval *options = NULL, *info = NULL; ++ char *URL; ++ int URL_len; ++ http_request request; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a/!z", &URL, &URL_len, &options, &info) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, HTTP_GET, URL); ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_head(string url[, array options[, array &info]]) ++ Performs an HTTP HEAD request on the supplied url. */ ++PHP_FUNCTION(http_head) ++{ ++ zval *options = NULL, *info = NULL; ++ char *URL; ++ int URL_len; ++ http_request request; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a/!z", &URL, &URL_len, &options, &info) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, HTTP_HEAD, URL); ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_post_data(string url, string data[, array options[, array &info]]) ++ Performs an HTTP POST request on the supplied url. */ ++PHP_FUNCTION(http_post_data) ++{ ++ zval *options = NULL, *info = NULL; ++ char *URL, *postdata; ++ int postdata_len, URL_len; ++ http_request_body body; ++ http_request request; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|a/!z", &URL, &URL_len, &postdata, &postdata_len, &options, &info) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, HTTP_POST, URL); ++ request.body = http_request_body_init_ex(&body, HTTP_REQUEST_BODY_CSTRING, postdata, postdata_len, 0); ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_post_fields(string url, array data[, array files[, array options[, array &info]]]) ++ Performs an HTTP POST request on the supplied url. */ ++PHP_FUNCTION(http_post_fields) ++{ ++ zval *options = NULL, *info = NULL, *fields = NULL, *files = NULL; ++ char *URL; ++ int URL_len; ++ http_request_body body; ++ http_request request; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sa!|a!a/!z", &URL, &URL_len, &fields, &files, &options, &info) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (!http_request_body_fill(&body, fields ? Z_ARRVAL_P(fields) : NULL, files ? Z_ARRVAL_P(files) : NULL)) { ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, HTTP_POST, URL); ++ request.body = &body; ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_put_file(string url, string file[, array options[, array &info]]) ++ Performs an HTTP PUT request on the supplied url. */ ++PHP_FUNCTION(http_put_file) ++{ ++ char *URL, *file; ++ int URL_len, f_len; ++ zval *options = NULL, *info = NULL; ++ php_stream *stream; ++ php_stream_statbuf ssb; ++ http_request_body body; ++ http_request request; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|a/!z", &URL, &URL_len, &file, &f_len, &options, &info)) { ++ RETURN_FALSE; ++ } ++ ++ if (!(stream = php_stream_open_wrapper_ex(file, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT))) { ++ RETURN_FALSE; ++ } ++ if (php_stream_stat(stream, &ssb)) { ++ php_stream_close(stream); ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, HTTP_PUT, URL); ++ request.body = http_request_body_init_ex(&body, HTTP_REQUEST_BODY_UPLOADFILE, stream, ssb.sb.st_size, 1); ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_put_stream(string url, resource stream[, array options[, array &info]]) ++ Performs an HTTP PUT request on the supplied url. */ ++PHP_FUNCTION(http_put_stream) ++{ ++ zval *resource, *options = NULL, *info = NULL; ++ char *URL; ++ int URL_len; ++ php_stream *stream; ++ php_stream_statbuf ssb; ++ http_request_body body; ++ http_request request; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sr|a/!z", &URL, &URL_len, &resource, &options, &info)) { ++ RETURN_FALSE; ++ } ++ ++ php_stream_from_zval(stream, &resource); ++ if (php_stream_stat(stream, &ssb)) { ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, HTTP_PUT, URL); ++ request.body = http_request_body_init_ex(&body, HTTP_REQUEST_BODY_UPLOADFILE, stream, ssb.sb.st_size, 0); ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_put_data(string url, string data[, array options[, array &info]]) ++ Performs an HTTP PUT request on the supplied url. */ ++PHP_FUNCTION(http_put_data) ++{ ++ char *URL, *data; ++ int URL_len, data_len; ++ zval *options = NULL, *info = NULL; ++ http_request_body body; ++ http_request request; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|a/!z", &URL, &URL_len, &data, &data_len, &options, &info)) { ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, HTTP_PUT, URL); ++ request.body = http_request_body_init_ex(&body, HTTP_REQUEST_BODY_CSTRING, data, data_len, 0); ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_request(int method, string url[, string body[, array options[, array &info]]]) ++ Performs a custom HTTP request on the supplied url. */ ++PHP_FUNCTION(http_request) ++{ ++ long meth; ++ char *URL, *data = NULL; ++ int URL_len, data_len = 0; ++ zval *options = NULL, *info = NULL; ++ http_request_body body; ++ http_request request; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls|sa/!z", &meth, &URL, &URL_len, &data, &data_len, &options, &info)) { ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, meth, URL); ++ request.body = http_request_body_init_ex(&body, HTTP_REQUEST_BODY_CSTRING, data, data_len, 0); ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_request_body_encode(array fields, array files) ++ Generate x-www-form-urlencoded resp. form-data encoded request body. */ ++PHP_FUNCTION(http_request_body_encode) ++{ ++ zval *fields = NULL, *files = NULL; ++ HashTable *fields_ht, *files_ht; ++ http_request_body body; ++ char *buf; ++ size_t len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!", &fields, &files)) { ++ RETURN_FALSE; ++ } ++ ++ fields_ht = (fields && Z_TYPE_P(fields) == IS_ARRAY) ? Z_ARRVAL_P(fields) : NULL; ++ files_ht = (files && Z_TYPE_P(files) == IS_ARRAY) ? Z_ARRVAL_P(files) : NULL; ++ if (http_request_body_fill(&body, fields_ht, files_ht) && (SUCCESS == http_request_body_encode(&body, &buf, &len))) { ++ RETVAL_STRINGL(buf, len, 0); ++ } else { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "Could not encode request body"); ++ RETVAL_FALSE; ++ } ++ http_request_body_dtor(&body); ++} ++#endif /* HTTP_HAVE_CURL */ ++/* }}} HAVE_CURL */ ++ ++/* {{{ proto int http_request_method_register(string method) ++ Register a custom request method. */ ++PHP_FUNCTION(http_request_method_register) ++{ ++ char *method; ++ int method_len; ++ ulong existing; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &method, &method_len)) { ++ RETURN_FALSE; ++ } ++ if ((existing = http_request_method_exists(1, 0, method))) { ++ RETURN_LONG((long) existing); ++ } ++ ++ RETVAL_LONG((long) http_request_method_register(method, method_len)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_request_method_unregister(mixed method) ++ Unregister a previously registered custom request method. */ ++PHP_FUNCTION(http_request_method_unregister) ++{ ++ zval *method; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &method)) { ++ RETURN_FALSE; ++ } ++ ++ switch (Z_TYPE_P(method)) { ++ case IS_OBJECT: ++ convert_to_string(method); ++ case IS_STRING: ++ if (is_numeric_string(Z_STRVAL_P(method), Z_STRLEN_P(method), NULL, NULL, 1)) { ++ convert_to_long(method); ++ } else { ++ int mn; ++ if (!(mn = http_request_method_exists(1, 0, Z_STRVAL_P(method)))) { ++ RETURN_FALSE; ++ } ++ zval_dtor(method); ++ ZVAL_LONG(method, (long)mn); ++ } ++ case IS_LONG: ++ RETURN_SUCCESS(http_request_method_unregister(Z_LVAL_P(method))); ++ default: ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto int http_request_method_exists(mixed method) ++ Check if a request method is registered (or available by default). */ ++PHP_FUNCTION(http_request_method_exists) ++{ ++ if (return_value_used) { ++ zval *method; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &method)) { ++ RETURN_FALSE; ++ } ++ ++ switch (Z_TYPE_P(method)) { ++ case IS_OBJECT: ++ convert_to_string(method); ++ case IS_STRING: ++ if (is_numeric_string(Z_STRVAL_P(method), Z_STRLEN_P(method), NULL, NULL, 1)) { ++ convert_to_long(method); ++ } else { ++ RETURN_LONG((long) http_request_method_exists(1, 0, Z_STRVAL_P(method))); ++ } ++ case IS_LONG: ++ RETURN_LONG((long) http_request_method_exists(0, (int) Z_LVAL_P(method), NULL)); ++ default: ++ RETURN_FALSE; ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string http_request_method_name(int method) ++ Get the literal string representation of a standard or registered request method. */ ++PHP_FUNCTION(http_request_method_name) ++{ ++ if (return_value_used) { ++ long method; ++ ++ if ((SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &method)) || (method < 0)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_STRING(estrdup(http_request_method_name((int) method)), 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ */ ++#ifdef HTTP_HAVE_ZLIB ++ ++/* {{{ proto string http_deflate(string data[, int flags = 0]) ++ Compress data with gzip, zlib AKA deflate or raw deflate encoding. */ ++PHP_FUNCTION(http_deflate) ++{ ++ char *data; ++ int data_len; ++ long flags = 0; ++ ++ RETVAL_NULL(); ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &flags)) { ++ char *encoded; ++ size_t encoded_len; ++ ++ if (SUCCESS == http_encoding_deflate(flags, data, data_len, &encoded, &encoded_len)) { ++ RETURN_STRINGL(encoded, (int) encoded_len, 0); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string http_inflate(string data) ++ Decompress data compressed with either gzip, deflate AKA zlib or raw deflate encoding. */ ++PHP_FUNCTION(http_inflate) ++{ ++ char *data; ++ int data_len; ++ ++ RETVAL_NULL(); ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &data, &data_len)) { ++ char *decoded; ++ size_t decoded_len; ++ ++ if (SUCCESS == http_encoding_inflate(data, data_len, &decoded, &decoded_len)) { ++ RETURN_STRINGL(decoded, (int) decoded_len, 0); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string ob_deflatehandler(string data, int mode) ++ For use with ob_start(). The deflate output buffer handler can only be used once. */ ++PHP_FUNCTION(ob_deflatehandler) ++{ ++ char *data; ++ int data_len; ++ long mode; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &data, &data_len, &mode)) { ++ RETURN_FALSE; ++ } ++ ++ http_ob_deflatehandler(data, data_len, &Z_STRVAL_P(return_value), (uint *) &Z_STRLEN_P(return_value), mode); ++ Z_TYPE_P(return_value) = Z_STRVAL_P(return_value) ? IS_STRING : IS_NULL; ++} ++/* }}} */ ++ ++/* {{{ proto string ob_inflatehandler(string data, int mode) ++ For use with ob_start(). Same restrictions as with ob_deflatehandler apply. */ ++PHP_FUNCTION(ob_inflatehandler) ++{ ++ char *data; ++ int data_len; ++ long mode; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &data, &data_len, &mode)) { ++ RETURN_FALSE; ++ } ++ ++ http_ob_inflatehandler(data, data_len, &Z_STRVAL_P(return_value), (uint *) &Z_STRLEN_P(return_value), mode); ++ Z_TYPE_P(return_value) = Z_STRVAL_P(return_value) ? IS_STRING : IS_NULL; ++} ++/* }}} */ ++ ++#endif /* HTTP_HAVE_ZLIB */ ++/* }}} */ ++ ++/* {{{ proto int http_support([int feature = 0]) ++ Check for feature that require external libraries. */ ++PHP_FUNCTION(http_support) ++{ ++ long feature = 0; ++ ++ RETVAL_LONG(0L); ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &feature)) { ++ RETVAL_LONG(http_support(feature)); ++ } ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_headers_api.c +@@ -0,0 +1,534 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_headers_api.c 300300 2010-06-09 07:29:35Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#include "php_http.h" ++ ++#include "ext/standard/url.h" ++#include "ext/standard/php_string.h" ++ ++#include "php_http_api.h" ++#include "php_http_headers_api.h" ++ ++#ifndef HTTP_DBG_NEG ++# define HTTP_DBG_NEG 0 ++#endif ++ ++/* {{{ static void http_grab_response_headers(void *, void *) */ ++static void http_grab_response_headers(void *data, void *arg TSRMLS_DC) ++{ ++ phpstr_appendl(PHPSTR(arg), ((sapi_header_struct *)data)->header); ++ phpstr_appends(PHPSTR(arg), HTTP_CRLF); ++} ++/* }}} */ ++ ++/* {{{ static int http_sort_q(const void *, const void *) */ ++static int http_sort_q(const void *a, const void *b TSRMLS_DC) ++{ ++ Bucket *f, *s; ++ zval result, *first, *second; ++ ++ f = *((Bucket **) a); ++ s = *((Bucket **) b); ++ ++ first = *((zval **) f->pData); ++ second= *((zval **) s->pData); ++ ++ if (numeric_compare_function(&result, first, second TSRMLS_CC) != SUCCESS) { ++ return 0; ++ } ++ return (Z_LVAL(result) > 0 ? -1 : (Z_LVAL(result) < 0 ? 1 : 0)); ++} ++/* }}} */ ++ ++/* {{{ char *http_negotiate_language_func */ ++char *_http_negotiate_language_func(const char *test, double *quality, HashTable *supported TSRMLS_DC) ++{ ++ zval **value; ++ HashPosition pos; ++ const char *dash_test; ++ ++ FOREACH_HASH_VAL(pos, supported, value) { ++#if HTTP_DBG_NEG ++ fprintf(stderr, "strcasecmp('%s', '%s')\n", Z_STRVAL_PP(value), test); ++#endif ++ if (!strcasecmp(Z_STRVAL_PP(value), test)) { ++ return Z_STRVAL_PP(value); ++ } ++ } ++ ++ /* no distinct match found, so try primaries */ ++ if ((dash_test = strchr(test, '-'))) { ++ FOREACH_HASH_VAL(pos, supported, value) { ++ int len = dash_test - test; ++#if HTTP_DBG_NEG ++ fprintf(stderr, "strncasecmp('%s', '%s', %d)\n", Z_STRVAL_PP(value), test, len); ++#endif ++ if ( (!strncasecmp(Z_STRVAL_PP(value), test, len)) && ++ ( (Z_STRVAL_PP(value)[len] == '\0') || ++ (Z_STRVAL_PP(value)[len] == '-'))) { ++ *quality *= .9; ++ return Z_STRVAL_PP(value); ++ } ++ } ++ } ++ ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ char *http_negotiate_default_func */ ++char *_http_negotiate_default_func(const char *test, double *quality, HashTable *supported TSRMLS_DC) ++{ ++ zval **value; ++ HashPosition pos; ++ ++ FOREACH_HASH_VAL(pos, supported, value) { ++#if HTTP_DBG_NEG ++ fprintf(stderr, "strcasecmp('%s', '%s')\n", Z_STRVAL_PP(value), test); ++#endif ++ if (!strcasecmp(Z_STRVAL_PP(value), test)) { ++ return Z_STRVAL_PP(value); ++ } ++ } ++ ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ HashTable *http_negotiate_z(zval *, HashTable *, negotiate_func_t) */ ++PHP_HTTP_API HashTable *_http_negotiate_z(zval *value, HashTable *supported, negotiate_func_t neg TSRMLS_DC) ++{ ++ zval *accept = http_zsep(IS_STRING, value); ++ HashTable *result = NULL; ++ ++ if (Z_STRLEN_P(accept)) { ++ zval ex_arr, ex_del; ++ ++ INIT_PZVAL(&ex_del); ++ INIT_PZVAL(&ex_arr); ++ ZVAL_STRINGL(&ex_del, ",", 1, 0); ++ array_init(&ex_arr); ++ ++ php_explode(&ex_del, accept, &ex_arr, INT_MAX); ++ ++ if (zend_hash_num_elements(Z_ARRVAL(ex_arr)) > 0) { ++ int i = 0; ++ HashPosition pos; ++ zval **entry, array; ++ ++ INIT_PZVAL(&array); ++ array_init(&array); ++ ++ FOREACH_HASH_VAL(pos, Z_ARRVAL(ex_arr), entry) { ++ int ident_len; ++ double quality; ++ char *selected, *identifier, *freeme; ++ const char *separator; ++ ++#if HTTP_DBG_NEG ++ fprintf(stderr, "Checking %s\n", Z_STRVAL_PP(entry)); ++#endif ++ ++ if ((separator = strchr(Z_STRVAL_PP(entry), ';'))) { ++ const char *ptr = separator; ++ ++ while (*++ptr && !HTTP_IS_CTYPE(digit, *ptr) && '.' != *ptr); ++ ++ quality = zend_strtod(ptr, NULL); ++ identifier = estrndup(Z_STRVAL_PP(entry), ident_len = separator - Z_STRVAL_PP(entry)); ++ } else { ++ quality = 1000.0 - i++; ++ identifier = estrndup(Z_STRVAL_PP(entry), ident_len = Z_STRLEN_PP(entry)); ++ } ++ freeme = identifier; ++ ++ while (HTTP_IS_CTYPE(space, *identifier)) { ++ ++identifier; ++ --ident_len; ++ } ++ while (ident_len && HTTP_IS_CTYPE(space, identifier[ident_len - 1])) { ++ identifier[--ident_len] = '\0'; ++ } ++ ++ if ((selected = neg(identifier, &quality, supported TSRMLS_CC))) { ++ /* don't overwrite previously set with higher quality */ ++ if (!zend_hash_exists(Z_ARRVAL(array), selected, strlen(selected) + 1)) { ++ add_assoc_double(&array, selected, quality); ++ } ++ } ++ ++ efree(freeme); ++ } ++ ++ result = Z_ARRVAL(array); ++ zend_hash_sort(result, zend_qsort, http_sort_q, 0 TSRMLS_CC); ++ } ++ ++ zval_dtor(&ex_arr); ++ } ++ ++ zval_ptr_dtor(&accept); ++ ++ return result; ++} ++/* }}} */ ++ ++/* {{{ HashTable *http_negotiate_q(const char *, HashTable *, negotiate_func_t) */ ++PHP_HTTP_API HashTable *_http_negotiate_q(const char *header, HashTable *supported, negotiate_func_t neg TSRMLS_DC) ++{ ++ zval *accept; ++ ++#if HTTP_DBG_NEG ++ fprintf(stderr, "Reading header %s: ", header); ++#endif ++ if (!(accept = http_get_server_var(header, 1))) { ++ return NULL; ++ } ++#if HTTP_DBG_NEG ++ fprintf(stderr, "%s\n", Z_STRVAL_P(accept)); ++#endif ++ ++ return http_negotiate_z(accept, supported, neg); ++} ++/* }}} */ ++ ++/* {{{ http_range_status http_get_request_ranges(HashTable *ranges, size_t) */ ++PHP_HTTP_API http_range_status _http_get_request_ranges(HashTable *ranges, size_t length TSRMLS_DC) ++{ ++ zval *zrange; ++ char *range, c; ++ long begin = -1, end = -1, *ptr; ++ ++ if ( !(zrange = http_get_server_var("HTTP_RANGE", 1)) || ++ (size_t) Z_STRLEN_P(zrange) < lenof("bytes=") || strncmp(Z_STRVAL_P(zrange), "bytes=", lenof("bytes="))) { ++ return RANGE_NO; ++ } ++ range = Z_STRVAL_P(zrange) + lenof("bytes="); ++ ptr = &begin; ++ ++ do { ++ switch (c = *(range++)) { ++ case '0': ++ /* allow 000... - shall we? */ ++ if (*ptr != -10) { ++ *ptr *= 10; ++ } ++ break; ++ ++ case '1': case '2': case '3': ++ case '4': case '5': case '6': ++ case '7': case '8': case '9': ++ /* ++ * If the value of the pointer is already set (non-negative) ++ * then multiply its value by ten and add the current value, ++ * else initialise the pointers value with the current value ++ * -- ++ * This let us recognize empty fields when validating the ++ * ranges, i.e. a "-10" for begin and "12345" for the end ++ * was the following range request: "Range: bytes=0-12345"; ++ * While a "-1" for begin and "12345" for the end would ++ * have been: "Range: bytes=-12345". ++ */ ++ if (*ptr > 0) { ++ *ptr *= 10; ++ *ptr += c - '0'; ++ } else { ++ *ptr = c - '0'; ++ } ++ break; ++ ++ case '-': ++ ptr = &end; ++ break; ++ ++ case ' ': ++ break; ++ ++ case 0: ++ case ',': ++ ++ if (length) { ++ /* validate ranges */ ++ switch (begin) { ++ /* "0-12345" */ ++ case -10: ++ switch (end) { ++ /* "0-" */ ++ case -1: ++ return RANGE_NO; ++ ++ /* "0-0" */ ++ case -10: ++ end = 0; ++ break; ++ ++ default: ++ if (length <= (size_t) end) { ++ return RANGE_ERR; ++ } ++ break; ++ } ++ begin = 0; ++ break; ++ ++ /* "-12345" */ ++ case -1: ++ /* "-", "-0" or overflow */ ++ if (end == -1 || end == -10 || length <= (size_t) end) { ++ return RANGE_ERR; ++ } ++ begin = length - end; ++ end = length - 1; ++ break; ++ ++ /* "12345-(xxx)" */ ++ default: ++ switch (end) { ++ /* "12345-0" */ ++ case -10: ++ return RANGE_ERR; ++ ++ /* "12345-" */ ++ case -1: ++ if (length <= (size_t) begin) { ++ return RANGE_ERR; ++ } ++ end = length - 1; ++ break; ++ ++ /* "12345-67890" */ ++ default: ++ if ( (length <= (size_t) begin) || ++ (length <= (size_t) end) || ++ (end < begin)) { ++ return RANGE_ERR; ++ } ++ break; ++ } ++ break; ++ } ++ } ++ { ++ zval *zentry; ++ MAKE_STD_ZVAL(zentry); ++ array_init(zentry); ++ add_index_long(zentry, 0, begin); ++ add_index_long(zentry, 1, end); ++ zend_hash_next_index_insert(ranges, &zentry, sizeof(zval *), NULL); ++ ++ begin = -1; ++ end = -1; ++ ptr = &begin; ++ } ++ break; ++ ++ default: ++ return RANGE_NO; ++ } ++ } while (c != 0); ++ ++ return RANGE_OK; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_parse_headers(char *, HashTable *, zend_bool) */ ++PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *headers, zend_bool prettify, ++ http_info_callback callback_func, void **callback_data TSRMLS_DC) ++{ ++ const char *colon = NULL, *line = NULL; ++ zval array; ++ ++ INIT_ZARR(array, headers); ++ ++ /* skip leading ws */ ++ while (HTTP_IS_CTYPE(space, *header)) ++header; ++ line = header; ++ ++#define MORE_HEADERS (*(line-1) && !(*(line-1) == '\n' && (*line == '\n' || *line == '\r'))) ++ do { ++ int value_len = 0; ++ ++ switch (*line++) { ++ case ':': ++ if (!colon) { ++ colon = line - 1; ++ } ++ break; ++ ++ case 0: ++ --value_len; /* we don't have CR so value length is one char less */ ++ case '\n': ++ if ((!*(line - 1)) || ((*line != ' ') && (*line != '\t'))) { ++ http_info i; ++ ++ if (SUCCESS == http_info_parse(header, &i)) { ++ /* response/request line */ ++ callback_func(callback_data, &headers, &i TSRMLS_CC); ++ http_info_dtor(&i); ++ Z_ARRVAL(array) = headers; ++ } else if (colon) { ++ /* "header: value" pair */ ++ if (header != colon) { ++ int keylen = colon - header; ++ const char *key = header; ++ ++ /* skip leading ws */ ++ while (keylen && HTTP_IS_CTYPE(space, *key)) --keylen, ++key; ++ /* skip trailing ws */ ++ while (keylen && HTTP_IS_CTYPE(space, key[keylen - 1])) --keylen; ++ ++ if (keylen > 0) { ++ zval **previous = NULL; ++ char *value; ++ char *keydup = estrndup(key, keylen); ++ ++ if (prettify) { ++ keydup = pretty_key(keydup, keylen, 1, 1); ++ } ++ ++ value_len += line - colon - 1; ++ ++ /* skip leading ws */ ++ while (HTTP_IS_CTYPE(space, *(++colon))) --value_len; ++ /* skip trailing ws */ ++ while (HTTP_IS_CTYPE(space, colon[value_len - 1])) --value_len; ++ ++ if (value_len > 0) { ++ value = estrndup(colon, value_len); ++ } else { ++ value = estrdup(""); ++ value_len = 0; ++ } ++ ++ /* if we already have got such a header make an array of those */ ++ if (SUCCESS == zend_hash_find(headers, keydup, keylen + 1, (void *) &previous)) { ++ /* convert to array */ ++ if (Z_TYPE_PP(previous) != IS_ARRAY) { ++ convert_to_array(*previous); ++ } ++ add_next_index_stringl(*previous, value, value_len, 0); ++ } else { ++ add_assoc_stringl(&array, keydup, value, value_len, 0); ++ } ++ efree(keydup); ++ } else { ++ /* empty key (" : ...") */ ++ return FAILURE; ++ } ++ } else { ++ /* empty key (": ...") */ ++ return FAILURE; ++ } ++ } else if (MORE_HEADERS) { ++ /* a line without a colon */ ++ return FAILURE; ++ } ++ colon = NULL; ++ value_len = 0; ++ header += line - header; ++ } ++ break; ++ } ++ } while (MORE_HEADERS); ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ void http_get_request_headers(HashTable *) */ ++PHP_HTTP_API void _http_get_request_headers(HashTable *headers TSRMLS_DC) ++{ ++ HashKey key = initHashKey(0); ++ zval **hsv, **header; ++ HashPosition pos; ++ ++ if (!HTTP_G->request.headers) { ++ ALLOC_HASHTABLE(HTTP_G->request.headers); ++ zend_hash_init(HTTP_G->request.headers, 0, NULL, ZVAL_PTR_DTOR, 0); ++ ++#ifdef ZEND_ENGINE_2 ++ zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC); ++#endif ++ ++ if (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void *) &hsv) && Z_TYPE_PP(hsv) == IS_ARRAY) { ++ FOREACH_KEY(pos, *hsv, key) { ++ if (key.type == HASH_KEY_IS_STRING && key.len > 6 && !strncmp(key.str, "HTTP_", 5)) { ++ key.len -= 5; ++ key.str = pretty_key(estrndup(key.str + 5, key.len - 1), key.len - 1, 1, 1); ++ ++ zend_hash_get_current_data_ex(Z_ARRVAL_PP(hsv), (void *) &header, &pos); ++ ZVAL_ADDREF(*header); ++ zend_hash_add(HTTP_G->request.headers, key.str, key.len, (void *) header, sizeof(zval *), NULL); ++ ++ efree(key.str); ++ } ++ } ++ } ++ } ++ ++ if (headers) { ++ zend_hash_copy(headers, HTTP_G->request.headers, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ } ++} ++/* }}} */ ++ ++/* {{{ STATUS http_get_response_headers(HashTable *) */ ++PHP_HTTP_API STATUS _http_get_response_headers(HashTable *headers_ht TSRMLS_DC) ++{ ++ STATUS status; ++ phpstr headers; ++ ++ phpstr_init(&headers); ++ zend_llist_apply_with_argument(&SG(sapi_headers).headers, http_grab_response_headers, &headers TSRMLS_CC); ++ phpstr_fix(&headers); ++ ++ status = http_parse_headers_ex(PHPSTR_VAL(&headers), headers_ht, 1); ++ phpstr_dtor(&headers); ++ ++ return status; ++} ++/* }}} */ ++ ++/* {{{ zend_bool http_match_request_header(char *, char *) */ ++PHP_HTTP_API zend_bool _http_match_request_header_ex(const char *header, const char *value, zend_bool match_case TSRMLS_DC) ++{ ++ char *name; ++ uint name_len = strlen(header); ++ zend_bool result = 0; ++ zval **data, *zvalue; ++ ++ http_get_request_headers(NULL); ++ name = pretty_key(estrndup(header, name_len), name_len, 1, 1); ++ if (SUCCESS == zend_hash_find(HTTP_G->request.headers, name, name_len+1, (void *) &data)) { ++ zvalue = http_zsep(IS_STRING, *data); ++ result = (match_case ? strcmp(Z_STRVAL_P(zvalue), value) : strcasecmp(Z_STRVAL_P(zvalue), value)) ? 0 : 1; ++ zval_ptr_dtor(&zvalue); ++ } ++ efree(name); ++ ++ return result; ++} ++/* }}} */ ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_inflatestream_object.c +@@ -0,0 +1,297 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_inflatestream_object.c 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#define HTTP_WANT_ZLIB ++#include "php_http.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_ZLIB) ++ ++#include "php_http_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_exception_object.h" ++#include "php_http_inflatestream_object.h" ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpInflateStream, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpInflateStream, method, 0) ++#define HTTP_INFLATE_ME(method, visibility) PHP_ME(HttpInflateStream, method, HTTP_ARGS(HttpInflateStream, method), visibility) ++ ++HTTP_BEGIN_ARGS(__construct, 0) ++ HTTP_ARG_VAL(flags, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(factory, 0) ++ HTTP_ARG_VAL(flags, 0) ++ HTTP_ARG_VAL(class_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(update, 1) ++ HTTP_ARG_VAL(data, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(flush, 0) ++ HTTP_ARG_VAL(data, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(finish, 0) ++ HTTP_ARG_VAL(data, 0) ++HTTP_END_ARGS; ++ ++#define THIS_CE http_inflatestream_object_ce ++zend_class_entry *http_inflatestream_object_ce; ++zend_function_entry http_inflatestream_object_fe[] = { ++ HTTP_INFLATE_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) ++ HTTP_INFLATE_ME(update, ZEND_ACC_PUBLIC) ++ HTTP_INFLATE_ME(flush, ZEND_ACC_PUBLIC) ++ HTTP_INFLATE_ME(finish, ZEND_ACC_PUBLIC) ++ ++ HTTP_INFLATE_ME(factory, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++static zend_object_handlers http_inflatestream_object_handlers; ++ ++PHP_MINIT_FUNCTION(http_inflatestream_object) ++{ ++ HTTP_REGISTER_CLASS_EX(HttpInflateStream, http_inflatestream_object, NULL, 0); ++ http_inflatestream_object_handlers.clone_obj = _http_inflatestream_object_clone_obj; ++ ++#ifndef WONKY ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("FLUSH_NONE")-1, HTTP_ENCODING_STREAM_FLUSH_NONE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("FLUSH_SYNC")-1, HTTP_ENCODING_STREAM_FLUSH_SYNC TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("FLUSH_FULL")-1, HTTP_ENCODING_STREAM_FLUSH_FULL TSRMLS_CC); ++#endif ++ ++ return SUCCESS; ++} ++ ++zend_object_value _http_inflatestream_object_new(zend_class_entry *ce TSRMLS_DC) ++{ ++ return http_inflatestream_object_new_ex(ce, NULL, NULL); ++} ++ ++zend_object_value _http_inflatestream_object_new_ex(zend_class_entry *ce, http_encoding_stream *s, http_inflatestream_object **ptr TSRMLS_DC) ++{ ++ zend_object_value ov; ++ http_inflatestream_object *o; ++ ++ o = ecalloc(1, sizeof(http_inflatestream_object)); ++ o->zo.ce = ce; ++ ++ if (ptr) { ++ *ptr = o; ++ } ++ ++ if (s) { ++ o->stream = s; ++ } ++ ++#ifdef ZEND_ENGINE_2_4 ++ zend_object_std_init(o, ce TSRMLS_CC); ++ object_properties_init(o, ce); ++#else ++ ALLOC_HASHTABLE(OBJ_PROP(o)); ++ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++#endif ++ ++ ov.handle = putObject(http_inflatestream_object, o); ++ ov.handlers = &http_inflatestream_object_handlers; ++ ++ return ov; ++} ++ ++zend_object_value _http_inflatestream_object_clone_obj(zval *this_ptr TSRMLS_DC) ++{ ++ http_encoding_stream *s; ++ zend_object_value new_ov; ++ http_inflatestream_object *new_obj = NULL; ++ getObject(http_inflatestream_object, old_obj); ++ ++ s = ecalloc(1, sizeof(http_encoding_stream)); ++ s->flags = old_obj->stream->flags; ++ inflateCopy(&s->stream, &old_obj->stream->stream); ++ s->stream.opaque = phpstr_dup(s->stream.opaque); ++ ++ new_ov = http_inflatestream_object_new_ex(old_obj->zo.ce, s, &new_obj); ++ zend_objects_clone_members(&new_obj->zo, new_ov, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); ++ ++ return new_ov; ++} ++ ++void _http_inflatestream_object_free(zend_object *object TSRMLS_DC) ++{ ++ http_inflatestream_object *o = (http_inflatestream_object *) object; ++ ++ if (o->stream) { ++ http_encoding_inflate_stream_free(&o->stream); ++ } ++ freeObject(o); ++} ++ ++/* {{{ proto void HttpInflateStream::__construct([int flags = 0]) ++ Creates a new HttpInflateStream object instance. */ ++PHP_METHOD(HttpInflateStream, __construct) ++{ ++ long flags = 0; ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags)) { ++ getObject(http_inflatestream_object, obj); ++ ++ if (!obj->stream) { ++ obj->stream = http_encoding_inflate_stream_init(NULL, flags & 0x0fffffff); ++ } else { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "HttpInflateStream cannot be initialized twice"); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto HttpInflateStream HttpInflateStream::factory([int flags[, string class = "HttpInflateStream"]]) ++ Creates a new HttpInflateStream object instance. */ ++PHP_METHOD(HttpInflateStream, factory) ++{ ++ long flags = 0; ++ char *cn = NULL; ++ int cl = 0; ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &flags, &cn, &cl)) { ++ zend_object_value ov; ++ http_encoding_stream *s = http_encoding_inflate_stream_init(NULL, flags & 0x0fffffff); ++ ++ if (SUCCESS == http_object_new(&ov, cn, cl, _http_inflatestream_object_new_ex, http_inflatestream_object_ce, s, NULL)) { ++ RETVAL_OBJVAL(ov, 0); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto string HttpInflateStream::update(string data) ++ Passes more data through the inflate stream. */ ++PHP_METHOD(HttpInflateStream, update) ++{ ++ int data_len; ++ size_t decoded_len = 0; ++ char *data, *decoded = NULL; ++ getObject(http_inflatestream_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!data_len) { ++ RETURN_STRING("", 1); ++ } ++ ++ if (!obj->stream && !(obj->stream = http_encoding_inflate_stream_init(NULL, 0))) { ++ RETURN_FALSE; ++ } ++ ++ if (SUCCESS == http_encoding_inflate_stream_update(obj->stream, data, data_len, &decoded, &decoded_len)) { ++ RETURN_STRINGL(decoded, decoded_len, 0); ++ } else { ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpInflateStream::flush([string data]) ++ Flush the inflate stream. */ ++PHP_METHOD(HttpInflateStream, flush) ++{ ++ int data_len = 0; ++ size_t decoded_len = 0; ++ char *decoded = NULL, *data = NULL; ++ getObject(http_inflatestream_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!obj->stream && !(obj->stream = http_encoding_inflate_stream_init(NULL, 0))) { ++ RETURN_FALSE; ++ } ++ ++ /* flushing the inflate stream is a no-op */ ++ if (!data_len) { ++ RETURN_STRINGL("", 0, 1); ++ } else if (SUCCESS == http_encoding_inflate_stream_update(obj->stream, data, data_len, &decoded, &decoded_len)) { ++ RETURN_STRINGL(decoded, decoded_len, 0); ++ } else { ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpInflateStream::finish([string data]) ++ Finalizes the inflate stream. The inflate stream can be reused after finalizing. */ ++PHP_METHOD(HttpInflateStream, finish) ++{ ++ int data_len = 0; ++ size_t updated_len = 0, decoded_len = 0; ++ char *updated = NULL, *decoded = NULL, *data = NULL; ++ getObject(http_inflatestream_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!obj->stream && !(obj->stream = http_encoding_inflate_stream_init(NULL, 0))) { ++ RETURN_FALSE; ++ } ++ ++ if (data_len) { ++ if (SUCCESS != http_encoding_inflate_stream_update(obj->stream, data, data_len, &updated, &updated_len)) { ++ RETURN_FALSE; ++ } ++ } ++ ++ if (SUCCESS == http_encoding_inflate_stream_finish(obj->stream, &decoded, &decoded_len)) { ++ if (updated_len) { ++ updated = erealloc(updated, updated_len + decoded_len + 1); ++ updated[updated_len + decoded_len] = '\0'; ++ memcpy(updated + updated_len, decoded, decoded_len); ++ STR_FREE(decoded); ++ updated_len += decoded_len; ++ RETVAL_STRINGL(updated, updated_len, 0); ++ } else if (decoded) { ++ STR_FREE(updated); ++ RETVAL_STRINGL(decoded, decoded_len, 0); ++ } else { ++ RETVAL_NULL(); ++ } ++ } else { ++ STR_FREE(updated); ++ RETVAL_FALSE; ++ } ++ ++ http_encoding_inflate_stream_dtor(obj->stream); ++ http_encoding_inflate_stream_init(obj->stream, obj->stream->flags); ++} ++/* }}} */ ++ ++#endif /* ZEND_ENGINE_2 && HTTP_HAVE_ZLIB*/ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_info_api.c +@@ -0,0 +1,155 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_info_api.c 304921 2010-10-26 15:27:36Z iliaa $ */ ++ ++#include "php_http.h" ++ ++#include "php_http_api.h" ++#include "php_http_info_api.h" ++ ++PHP_HTTP_API void _http_info_default_callback(void **nothing, HashTable **headers, http_info *info TSRMLS_DC) ++{ ++ zval array; ++ ++ INIT_ZARR(array, *headers); ++ ++ switch (info->type) { ++ case IS_HTTP_REQUEST: ++ add_assoc_string(&array, "Request Method", HTTP_INFO(info).request.method, 1); ++ add_assoc_string(&array, "Request Url", HTTP_INFO(info).request.url, 1); ++ break; ++ ++ case IS_HTTP_RESPONSE: ++ add_assoc_long(&array, "Response Code", (long) HTTP_INFO(info).response.code); ++ if (HTTP_INFO(info).response.status) { ++ add_assoc_string(&array, "Response Status", HTTP_INFO(info).response.status, 1); ++ } ++ break; ++ } ++} ++ ++PHP_HTTP_API void _http_info_dtor(http_info *i) ++{ ++ switch (i->type) { ++ case IS_HTTP_REQUEST: ++ STR_SET(HTTP_INFO(i).request.method, NULL); ++ STR_SET(HTTP_INFO(i).request.url, NULL); ++ break; ++ ++ case IS_HTTP_RESPONSE: ++ STR_SET(HTTP_INFO(i).response.status, NULL); ++ break; ++ ++ default: ++ break; ++ } ++} ++ ++PHP_HTTP_API STATUS _http_info_parse_ex(const char *pre_header, http_info *info, zend_bool silent TSRMLS_DC) ++{ ++ const char *end, *http; ++ ++ /* sane parameter */ ++ if ((!pre_header) || (!*pre_header)) { ++ return FAILURE; ++ } ++ ++ /* where's the end of the line */ ++ if (!(end = http_locate_eol(pre_header, NULL))) { ++ end = pre_header + strlen(pre_header); ++ } ++ ++ /* there must be HTTP/1.x in the line */ ++ if (!(http = http_locate_str(pre_header, end - pre_header, "HTTP/1.", lenof("HTTP/1.")))) { ++ return FAILURE; ++ } ++ ++ /* and nothing than SPACE or NUL after HTTP/1.x */ ++ if ( (!HTTP_IS_CTYPE(digit, http[lenof("HTTP/1.")])) || ++ (http[lenof("HTTP/1.1")] && (!HTTP_IS_CTYPE(space, http[lenof("HTTP/1.1")])))) { ++ if (!silent) { ++ http_error(HE_WARNING, HTTP_E_MALFORMED_HEADERS, "Invalid HTTP/1.x protocol identification"); ++ } ++ return FAILURE; ++ } ++ ++#if 0 ++ { ++ char *line = estrndup(pre_header, end - pre_header); ++ fprintf(stderr, "http_parse_info('%s')\n", line); ++ efree(line); ++ } ++#endif ++ ++ info->http.version = zend_strtod(http + lenof("HTTP/"), NULL); ++ ++ /* is response */ ++ if (pre_header == http) { ++ char *status = NULL; ++ const char *code = http + sizeof("HTTP/1.1"); ++ ++ info->type = IS_HTTP_RESPONSE; ++ while (' ' == *code) ++code; ++ if (code && end > code) { ++ HTTP_INFO(info).response.code = strtol(code, &status, 10); ++ } else { ++ HTTP_INFO(info).response.code = 0; ++ } ++ if (status && end > status) { ++ while (' ' == *status) ++status; ++ HTTP_INFO(info).response.status = estrndup(status, end - status); ++ } else { ++ HTTP_INFO(info).response.status = NULL; ++ } ++ ++ return SUCCESS; ++ } ++ ++ /* is request */ ++ else if (!http[lenof("HTTP/1.x")] || http[lenof("HTTP/1.x")] == '\r' || http[lenof("HTTP/1.x")] == '\n') { ++ const char *url = strchr(pre_header, ' '); ++ ++ info->type = IS_HTTP_REQUEST; ++ if (url && http > url) { ++ HTTP_INFO(info).request.method = estrndup(pre_header, url - pre_header); ++ while (' ' == *url) ++url; ++ while (' ' == *(http-1)) --http; ++ if (http > url) { ++ HTTP_INFO(info).request.url = estrndup(url, http - url); ++ } else { ++ efree(HTTP_INFO(info).request.method); ++ return FAILURE; ++ } ++ } else { ++ HTTP_INFO(info).request.method = NULL; ++ HTTP_INFO(info).request.url = NULL; ++ } ++ ++ return SUCCESS; ++ } ++ ++ /* some darn header containing HTTP/1.x */ ++ else { ++ return FAILURE; ++ } ++} ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_message_api.c +@@ -0,0 +1,739 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_message_api.c 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_CURL ++#define HTTP_WANT_ZLIB ++#include "php_http.h" ++ ++#include "php_http_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_headers_api.h" ++#include "php_http_message_api.h" ++#include "php_http_request_api.h" ++#include "php_http_send_api.h" ++#include "php_http_url_api.h" ++ ++#define http_message_info_callback _http_message_info_callback ++static void _http_message_info_callback(http_message **message, HashTable **headers, http_info *info TSRMLS_DC) ++{ ++ http_message *old = *message; ++ ++ /* advance message */ ++ if (old->type || zend_hash_num_elements(&old->hdrs) || PHPSTR_LEN(old)) { ++ (*message) = http_message_new(); ++ (*message)->parent = old; ++ (*headers) = &((*message)->hdrs); ++ } ++ ++ http_message_set_info(*message, info); ++} ++ ++#define http_message_init_type _http_message_init_type ++static inline void _http_message_init_type(http_message *message, http_message_type type) ++{ ++ message->http.version = .0; ++ ++ switch (message->type = type) { ++ case HTTP_MSG_RESPONSE: ++ message->http.info.response.code = 0; ++ message->http.info.response.status = NULL; ++ break; ++ ++ case HTTP_MSG_REQUEST: ++ message->http.info.request.method = NULL; ++ message->http.info.request.url = NULL; ++ break; ++ ++ case HTTP_MSG_NONE: ++ default: ++ break; ++ } ++} ++ ++PHP_HTTP_API http_message *_http_message_init_ex(http_message *message, http_message_type type ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ++{ ++ if (!message) { ++ message = ecalloc_rel(1, sizeof(http_message)); ++ } ++ ++ http_message_init_type(message, type); ++ message->parent = NULL; ++ phpstr_init(&message->body); ++ zend_hash_init(&message->hdrs, 0, NULL, ZVAL_PTR_DTOR, 0); ++ ++ return message; ++} ++ ++PHP_HTTP_API http_message *_http_message_init_env(http_message *message, http_message_type type TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ++{ ++ int free_msg; ++ http_info inf; ++ zval *sval, tval; ++ char *body_str; ++ size_t body_len; ++ ++ if ((free_msg = !message)) { ++ message = http_message_init_rel(NULL, HTTP_MSG_NONE); ++ } ++ ++ memset(&inf, 0, sizeof(http_info)); ++ switch (inf.type = type) { ++ case HTTP_MSG_REQUEST: ++ if ((sval = http_get_server_var("SERVER_PROTOCOL", 1)) && !strncmp(Z_STRVAL_P(sval), "HTTP/", lenof("HTTP/"))) { ++ inf.http.version = zend_strtod(Z_STRVAL_P(sval) + lenof("HTTP/"), NULL); ++ } else { ++ inf.http.version = 1.1; ++ } ++ if ((sval = http_get_server_var("REQUEST_METHOD", 1))) { ++ inf.http.info.request.method = estrdup(Z_STRVAL_P(sval)); ++ } ++ if ((sval = http_get_server_var("REQUEST_URI", 1))) { ++ inf.http.info.request.url = estrdup(Z_STRVAL_P(sval)); ++ } ++ ++ http_message_set_info(message, &inf); ++ http_get_request_headers(&message->hdrs); ++ if (SUCCESS == http_get_request_body_ex(&body_str, &body_len, 0)) { ++ phpstr_from_string_ex(&message->body, body_str, body_len); ++ } ++ break; ++ ++ case HTTP_MSG_RESPONSE: ++ if (!SG(sapi_headers).http_status_line || SUCCESS != http_info_parse_ex(SG(sapi_headers).http_status_line, &inf, 0)) { ++ inf.http.version = 1.1; ++ inf.http.info.response.code = 200; ++ inf.http.info.response.status = estrdup("Ok"); ++ } ++ ++ http_message_set_info(message, &inf); ++ http_get_response_headers(&message->hdrs); ++#ifdef PHP_OUTPUT_NEWAPI ++ if (SUCCESS == php_output_get_contents(&tval TSRMLS_CC)) { ++#else ++ if (SUCCESS == php_ob_get_buffer(&tval TSRMLS_CC)) { ++#endif ++ message->body.data = Z_STRVAL(tval); ++ message->body.used = Z_STRLEN(tval); ++ message->body.free = 1; /* "\0" */ ++ } ++ break; ++ ++ default: ++ if (free_msg) { ++ http_message_free(&message); ++ } else { ++ message = NULL; ++ } ++ break; ++ } ++ http_info_dtor(&inf); ++ ++ return message; ++} ++ ++PHP_HTTP_API void _http_message_set_type(http_message *message, http_message_type type) ++{ ++ /* just act if different */ ++ if (type != message->type) { ++ ++ /* free request info */ ++ switch (message->type) { ++ case HTTP_MSG_REQUEST: ++ STR_FREE(message->http.info.request.method); ++ STR_FREE(message->http.info.request.url); ++ break; ++ ++ case HTTP_MSG_RESPONSE: ++ STR_FREE(message->http.info.response.status); ++ break; ++ ++ default: ++ break; ++ } ++ ++ /* init */ ++ http_message_init_type(message, type); ++ } ++} ++ ++PHP_HTTP_API void _http_message_set_info(http_message *message, http_info *info) ++{ ++ http_message_set_type(message, info->type); ++ message->http.version = info->http.version; ++ switch (message->type) { ++ case IS_HTTP_REQUEST: ++ STR_SET(HTTP_INFO(message).request.url, HTTP_INFO(info).request.url ? estrdup(HTTP_INFO(info).request.url) : NULL); ++ STR_SET(HTTP_INFO(message).request.method, HTTP_INFO(info).request.method ? estrdup(HTTP_INFO(info).request.method) : NULL); ++ break; ++ ++ case IS_HTTP_RESPONSE: ++ HTTP_INFO(message).response.code = HTTP_INFO(info).response.code; ++ STR_SET(HTTP_INFO(message).response.status, HTTP_INFO(info).response.status ? estrdup(HTTP_INFO(info).response.status) : NULL); ++ break; ++ ++ default: ++ break; ++ } ++} ++ ++#define http_message_body_parse(m, ms, ml, c) _http_message_body_parse((m), (ms), (ml), (c) TSRMLS_CC) ++static inline void _http_message_body_parse(http_message *msg, const char *message, size_t message_length, const char **continue_at TSRMLS_DC) ++{ ++ zval *c; ++ size_t remaining; ++ const char *body; ++ ++ *continue_at = NULL; ++ if ((body = http_locate_body(message))) { ++ remaining = message + message_length - body; ++ ++ if ((c = http_message_header(msg, "Transfer-Encoding"))) { ++ if (strstr(Z_STRVAL_P(c), "chunked")) { ++ /* message has chunked transfer encoding */ ++ char *decoded; ++ size_t decoded_len; ++ ++ /* decode and replace Transfer-Encoding with Content-Length header */ ++ if ((*continue_at = http_encoding_dechunk(body, message + message_length - body, &decoded, &decoded_len))) { ++ zval *len; ++ char *tmp; ++ int tmp_len; ++ ++ tmp_len = (int) spprintf(&tmp, 0, "%zu", decoded_len); ++ MAKE_STD_ZVAL(len); ++ ZVAL_STRINGL(len, tmp, tmp_len, 0); ++ ++ ZVAL_ADDREF(c); ++ zend_hash_update(&msg->hdrs, "X-Original-Transfer-Encoding", sizeof("X-Original-Transfer-Encoding"), (void *) &c, sizeof(zval *), NULL); ++ zend_hash_del(&msg->hdrs, "Transfer-Encoding", sizeof("Transfer-Encoding")); ++ zend_hash_del(&msg->hdrs, "Content-Length", sizeof("Content-Length")); ++ zend_hash_update(&msg->hdrs, "Content-Length", sizeof("Content-Length"), (void *) &len, sizeof(zval *), NULL); ++ ++ phpstr_from_string_ex(PHPSTR(msg), decoded, decoded_len); ++ efree(decoded); ++ } ++ } ++ zval_ptr_dtor(&c); ++ } ++ ++ if (!*continue_at && (c = http_message_header(msg, "Content-Length"))) { ++ /* message has content-length header */ ++ ulong len = strtoul(Z_STRVAL_P(c), NULL, 10); ++ if (len > remaining) { ++ http_error_ex(HE_NOTICE, HTTP_E_MALFORMED_HEADERS, "The Content-Length header pretends a larger body than actually received (expected %lu bytes; got %lu bytes)", len, remaining); ++ len = remaining; ++ } ++ phpstr_from_string_ex(PHPSTR(msg), body, len); ++ *continue_at = body + len; ++ zval_ptr_dtor(&c); ++ } ++ ++ if (!*continue_at && (c = http_message_header(msg, "Content-Range"))) { ++ /* message has content-range header */ ++ ulong total = 0, start = 0, end = 0, len = 0; ++ ++ if (!strncasecmp(Z_STRVAL_P(c), "bytes", lenof("bytes")) && ++ ( Z_STRVAL_P(c)[lenof("bytes")] == ':' || ++ Z_STRVAL_P(c)[lenof("bytes")] == ' ' || ++ Z_STRVAL_P(c)[lenof("bytes")] == '=')) { ++ char *total_at = NULL, *end_at = NULL; ++ char *start_at = Z_STRVAL_P(c) + sizeof("bytes"); ++ ++ start = strtoul(start_at, &end_at, 10); ++ if (end_at) { ++ end = strtoul(end_at + 1, &total_at, 10); ++ if (total_at && strncmp(total_at + 1, "*", 1)) { ++ total = strtoul(total_at + 1, NULL, 10); ++ } ++ if ((len = (end + 1 - start)) > remaining) { ++ http_error_ex(HE_NOTICE, HTTP_E_MALFORMED_HEADERS, "The Content-Range header pretends a larger body than actually received (expected %lu bytes; got %lu bytes)", len, remaining); ++ len = remaining; ++ } ++ if (end >= start && (!total || end < total)) { ++ phpstr_from_string_ex(PHPSTR(msg), body, len); ++ *continue_at = body + len; ++ } ++ } ++ } ++ ++ if (!*continue_at) { ++ http_error_ex(HE_WARNING, HTTP_E_MALFORMED_HEADERS, "Invalid Content-Range header: %s", Z_STRVAL_P(c)); ++ } ++ zval_ptr_dtor(&c); ++ } ++ ++ if (!*continue_at) { ++ /* no headers that indicate content length */ ++ if (HTTP_MSG_TYPE(RESPONSE, msg)) { ++ phpstr_from_string_ex(PHPSTR(msg), body, remaining); ++ } else { ++ *continue_at = body; ++ } ++ } ++ ++#ifdef HTTP_HAVE_ZLIB ++ /* check for compressed data */ ++ if ((c = http_message_header(msg, "Content-Encoding"))) { ++ char *decoded = NULL; ++ size_t decoded_len = 0; ++ ++ if ( !strcasecmp(Z_STRVAL_P(c), "gzip") || ++ !strcasecmp(Z_STRVAL_P(c), "x-gzip") || ++ !strcasecmp(Z_STRVAL_P(c), "deflate")) { ++ http_encoding_inflate(PHPSTR_VAL(msg), PHPSTR_LEN(msg), &decoded, &decoded_len); ++ } ++ ++ if (decoded) { ++ zval *len, **original_len; ++ char *tmp; ++ int tmp_len; ++ ++ tmp_len = (int) spprintf(&tmp, 0, "%zu", decoded_len); ++ MAKE_STD_ZVAL(len); ++ ZVAL_STRINGL(len, tmp, tmp_len, 0); ++ ++ ZVAL_ADDREF(c); ++ zend_hash_update(&msg->hdrs, "X-Original-Content-Encoding", sizeof("X-Original-Content-Encoding"), (void *) &c, sizeof(zval *), NULL); ++ zend_hash_del(&msg->hdrs, "Content-Encoding", sizeof("Content-Encoding")); ++ if (SUCCESS == zend_hash_find(&msg->hdrs, "Content-Length", sizeof("Content-Length"), (void *) &original_len)) { ++ ZVAL_ADDREF(*original_len); ++ zend_hash_update(&msg->hdrs, "X-Original-Content-Length", sizeof("X-Original-Content-Length"), (void *) original_len, sizeof(zval *), NULL); ++ zend_hash_update(&msg->hdrs, "Content-Length", sizeof("Content-Length"), (void *) &len, sizeof(zval *), NULL); ++ } else { ++ zend_hash_update(&msg->hdrs, "Content-Length", sizeof("Content-Length"), (void *) &len, sizeof(zval *), NULL); ++ } ++ ++ phpstr_dtor(PHPSTR(msg)); ++ PHPSTR(msg)->data = decoded; ++ PHPSTR(msg)->used = decoded_len; ++ PHPSTR(msg)->free = 1; ++ } ++ ++ zval_ptr_dtor(&c); ++ } ++#endif /* HTTP_HAVE_ZLIB */ ++ } ++} ++ ++PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char *message, size_t message_length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ const char *continue_at; ++ zend_bool free_msg = msg ? 0 : 1; ++ ++ if ((!message) || (message_length < HTTP_MSG_MIN_SIZE)) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Empty or too short HTTP message: '%s'", message); ++ return NULL; ++ } ++ ++ msg = http_message_init_rel(msg, 0); ++ ++ if (SUCCESS != http_parse_headers_cb(message, &msg->hdrs, 1, (http_info_callback) http_message_info_callback, (void *) &msg)) { ++ if (free_msg) { ++ http_message_free(&msg); ++ } ++ http_error(HE_WARNING, HTTP_E_MALFORMED_HEADERS, "Failed to parse message headers"); ++ return NULL; ++ } ++ ++ http_message_body_parse(msg, message, message_length, &continue_at); ++ ++ /* check for following messages */ ++ if (continue_at && (continue_at < (message + message_length))) { ++ while (HTTP_IS_CTYPE(space, *continue_at)) ++continue_at; ++ if (continue_at < (message + message_length)) { ++ http_message *next = NULL, *most = NULL; ++ ++ /* set current message to parent of most parent following messages and return deepest */ ++ if ((most = next = http_message_parse_rel(NULL, continue_at, message + message_length - continue_at))) { ++ while (most->parent) most = most->parent; ++ most->parent = msg; ++ msg = next; ++ } ++ } ++ } ++ ++ return msg; ++} ++ ++PHP_HTTP_API void _http_message_tostring(http_message *msg, char **string, size_t *length) ++{ ++ phpstr str; ++ HashKey key = initHashKey(0); ++ zval **header; ++ char *data; ++ HashPosition pos1; ++ ++ phpstr_init_ex(&str, 4096, 0); ++ ++ switch (msg->type) { ++ case HTTP_MSG_REQUEST: ++ phpstr_appendf(&str, HTTP_INFO_REQUEST_FMT_ARGS(&msg->http, HTTP_CRLF)); ++ break; ++ ++ case HTTP_MSG_RESPONSE: ++ phpstr_appendf(&str, HTTP_INFO_RESPONSE_FMT_ARGS(&msg->http, HTTP_CRLF)); ++ break; ++ ++ case HTTP_MSG_NONE: ++ default: ++ break; ++ } ++ ++ FOREACH_HASH_KEYVAL(pos1, &msg->hdrs, key, header) { ++ if (key.type == HASH_KEY_IS_STRING) { ++ HashPosition pos2; ++ zval **single_header; ++ ++ switch (Z_TYPE_PP(header)) { ++ case IS_BOOL: ++ phpstr_appendf(&str, "%s: %s" HTTP_CRLF, key.str, Z_BVAL_PP(header)?"true":"false"); ++ break; ++ ++ case IS_LONG: ++ phpstr_appendf(&str, "%s: %ld" HTTP_CRLF, key.str, Z_LVAL_PP(header)); ++ break; ++ ++ case IS_DOUBLE: ++ phpstr_appendf(&str, "%s: %f" HTTP_CRLF, key.str, Z_DVAL_PP(header)); ++ break; ++ ++ case IS_STRING: ++ phpstr_appendf(&str, "%s: %s" HTTP_CRLF, key.str, Z_STRVAL_PP(header)); ++ break; ++ ++ case IS_ARRAY: ++ FOREACH_VAL(pos2, *header, single_header) { ++ switch (Z_TYPE_PP(single_header)) { ++ case IS_BOOL: ++ phpstr_appendf(&str, "%s: %s" HTTP_CRLF, key.str, Z_BVAL_PP(single_header)?"true":"false"); ++ break; ++ ++ case IS_LONG: ++ phpstr_appendf(&str, "%s: %ld" HTTP_CRLF, key.str, Z_LVAL_PP(single_header)); ++ break; ++ ++ case IS_DOUBLE: ++ phpstr_appendf(&str, "%s: %f" HTTP_CRLF, key.str, Z_DVAL_PP(single_header)); ++ break; ++ ++ case IS_STRING: ++ phpstr_appendf(&str, "%s: %s" HTTP_CRLF, key.str, Z_STRVAL_PP(single_header)); ++ break; ++ } ++ } ++ break; ++ } ++ } ++ } ++ ++ if (PHPSTR_LEN(msg)) { ++ phpstr_appends(&str, HTTP_CRLF); ++ phpstr_append(&str, PHPSTR_VAL(msg), PHPSTR_LEN(msg)); ++ phpstr_appends(&str, HTTP_CRLF); ++ } ++ ++ data = phpstr_data(&str, string, length); ++ if (!string) { ++ efree(data); ++ } ++ ++ phpstr_dtor(&str); ++} ++ ++PHP_HTTP_API void _http_message_serialize(http_message *message, char **string, size_t *length) ++{ ++ char *buf; ++ size_t len; ++ phpstr str; ++ ++ phpstr_init(&str); ++ ++ do { ++ http_message_tostring(message, &buf, &len); ++ phpstr_prepend(&str, buf, len); ++ efree(buf); ++ } while ((message = message->parent)); ++ ++ buf = phpstr_data(&str, string, length); ++ if (!string) { ++ efree(buf); ++ } ++ ++ phpstr_dtor(&str); ++} ++ ++PHP_HTTP_API http_message *_http_message_reverse(http_message *msg) ++{ ++ int i, c; ++ ++ http_message_count(c, msg); ++ ++ if (c > 1) { ++ http_message *tmp = msg, **arr = ecalloc(c, sizeof(http_message *)); ++ ++ for (i = 0; i < c; ++i) { ++ arr[i] = tmp; ++ tmp = tmp->parent; ++ } ++ arr[0]->parent = NULL; ++ for (i = 0; i < c-1; ++i) { ++ arr[i+1]->parent = arr[i]; ++ } ++ ++ msg = arr[c-1]; ++ efree(arr); ++ } ++ ++ return msg; ++} ++ ++PHP_HTTP_API http_message *_http_message_interconnect(http_message *m1, http_message *m2) ++{ ++ if (m1 && m2) { ++ int i = 0, c1, c2; ++ http_message *t1 = m1, *t2 = m2, *p1, *p2; ++ ++ http_message_count(c1, m1); ++ http_message_count(c2, m2); ++ ++ while (i++ < (c1 - c2)) { ++ t1 = t1->parent; ++ } ++ while (i++ <= c1) { ++ p1 = t1->parent; ++ p2 = t2->parent; ++ t1->parent = t2; ++ t2->parent = p1; ++ t1 = p1; ++ t2 = p2; ++ } ++ } else if (!m1 && m2) { ++ m1 = m2; ++ } ++ return m1; ++} ++ ++PHP_HTTP_API void _http_message_tostruct_recursive(http_message *msg, zval *obj TSRMLS_DC) ++{ ++ zval strct; ++ zval *headers; ++ ++ INIT_ZARR(strct, HASH_OF(obj)); ++ ++ add_assoc_long(&strct, "type", msg->type); ++ add_assoc_double(&strct, "httpVersion", msg->http.version); ++ switch (msg->type) ++ { ++ case HTTP_MSG_RESPONSE: ++ add_assoc_long(&strct, "responseCode", msg->http.info.response.code); ++ add_assoc_string(&strct, "responseStatus", STR_PTR(msg->http.info.response.status), 1); ++ break; ++ ++ case HTTP_MSG_REQUEST: ++ add_assoc_string(&strct, "requestMethod", STR_PTR(msg->http.info.request.method), 1); ++ add_assoc_string(&strct, "requestUrl", STR_PTR(msg->http.info.request.url), 1); ++ break; ++ ++ case HTTP_MSG_NONE: ++ /* avoid compiler warning */ ++ break; ++ } ++ ++ MAKE_STD_ZVAL(headers); ++ array_init(headers); ++ zend_hash_copy(Z_ARRVAL_P(headers), &msg->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ add_assoc_zval(&strct, "headers", headers); ++ ++ add_assoc_stringl(&strct, "body", PHPSTR_VAL(msg), PHPSTR_LEN(msg), 1); ++ ++ if (msg->parent) { ++ zval *parent; ++ ++ MAKE_STD_ZVAL(parent); ++ if (Z_TYPE_P(obj) == IS_ARRAY) { ++ array_init(parent); ++ } else { ++ object_init(parent); ++ } ++ add_assoc_zval(&strct, "parentMessage", parent); ++ http_message_tostruct_recursive(msg->parent, parent); ++ } else { ++ add_assoc_null(&strct, "parentMessage"); ++ } ++} ++ ++PHP_HTTP_API STATUS _http_message_send(http_message *message TSRMLS_DC) ++{ ++ STATUS rs = FAILURE; ++ ++ switch (message->type) { ++ case HTTP_MSG_RESPONSE: ++ { ++ HashKey key = initHashKey(0); ++ zval **val; ++ HashPosition pos; ++ ++ FOREACH_HASH_KEYVAL(pos, &message->hdrs, key, val) { ++ if (key.type == HASH_KEY_IS_STRING) { ++ http_send_header_zval_ex(key.str, key.len-1, val, 1); ++ } ++ } ++ rs = SUCCESS == http_send_status(message->http.info.response.code) && ++ SUCCESS == http_send_data(PHPSTR_VAL(message), PHPSTR_LEN(message)) ? ++ SUCCESS : FAILURE; ++ break; ++ } ++ ++ case HTTP_MSG_REQUEST: ++ { ++#ifdef HTTP_HAVE_CURL ++ char *uri = NULL; ++ http_request request; ++ zval **zhost, *options, *headers; ++ ++ MAKE_STD_ZVAL(options); ++ MAKE_STD_ZVAL(headers); ++ array_init(options); ++ array_init(headers); ++ zend_hash_copy(Z_ARRVAL_P(headers), &message->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ add_assoc_zval(options, "headers", headers); ++ ++ /* check host header */ ++ if (SUCCESS == zend_hash_find(&message->hdrs, "Host", sizeof("Host"), (void *) &zhost) && Z_TYPE_PP(zhost) == IS_STRING) { ++ char *colon = NULL; ++ php_url parts, *url = php_url_parse(message->http.info.request.url); ++ ++ memset(&parts, 0, sizeof(php_url)); ++ ++ /* check for port */ ++ if ((colon = strchr(Z_STRVAL_PP(zhost), ':'))) { ++ parts.port = atoi(colon + 1); ++ parts.host = estrndup(Z_STRVAL_PP(zhost), (Z_STRVAL_PP(zhost) - colon - 1)); ++ } else { ++ parts.host = estrndup(Z_STRVAL_PP(zhost), Z_STRLEN_PP(zhost)); ++ } ++ ++ http_build_url(HTTP_URL_REPLACE, url, &parts, NULL, &uri, NULL); ++ php_url_free(url); ++ efree(parts.host); ++ } else { ++ uri = http_absolute_url(message->http.info.request.url); ++ } ++ ++ if ((request.meth = http_request_method_exists(1, 0, message->http.info.request.method))) { ++ http_request_body body; ++ ++ http_request_init_ex(&request, NULL, request.meth, uri); ++ request.body = http_request_body_init_ex(&body, HTTP_REQUEST_BODY_CSTRING, PHPSTR_VAL(message), PHPSTR_LEN(message), 0); ++ if (SUCCESS == (rs = http_request_prepare(&request, Z_ARRVAL_P(options)))) { ++ http_request_exec(&request); ++ } ++ http_request_dtor(&request); ++ } else { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, ++ "Cannot send HttpMessage. Request method %s not supported", ++ message->http.info.request.method); ++ } ++ efree(uri); ++ zval_ptr_dtor(&options); ++#else ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "HTTP requests not supported - ext/http was not linked against libcurl."); ++#endif ++ break; ++ } ++ ++ case HTTP_MSG_NONE: ++ default: ++ http_error(HE_WARNING, HTTP_E_MESSAGE_TYPE, "HttpMessage is neither of type HTTP_MSG_REQUEST nor HTTP_MSG_RESPONSE"); ++ break; ++ } ++ ++ return rs; ++} ++ ++PHP_HTTP_API http_message *_http_message_dup(http_message *orig TSRMLS_DC) ++{ ++ http_message *temp, *copy = NULL; ++ http_info info; ++ ++ if (orig) { ++ info.type = orig->type; ++ info.http = orig->http; ++ ++ copy = temp = http_message_new(); ++ http_message_set_info(temp, &info); ++ zend_hash_copy(&temp->hdrs, &orig->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ phpstr_append(&temp->body, orig->body.data, orig->body.used); ++ ++ while (orig->parent) { ++ info.type = orig->parent->type; ++ info.http = orig->parent->http; ++ ++ temp->parent = http_message_new(); ++ http_message_set_info(temp->parent, &info); ++ zend_hash_copy(&temp->parent->hdrs, &orig->parent->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ phpstr_append(&temp->parent->body, orig->parent->body.data, orig->parent->body.used); ++ ++ temp = temp->parent; ++ orig = orig->parent; ++ } ++ } ++ ++ return copy; ++} ++ ++PHP_HTTP_API void _http_message_dtor(http_message *message) ++{ ++ if (message) { ++ zend_hash_destroy(&message->hdrs); ++ phpstr_dtor(PHPSTR(message)); ++ ++ switch (message->type) { ++ case HTTP_MSG_REQUEST: ++ STR_SET(message->http.info.request.method, NULL); ++ STR_SET(message->http.info.request.url, NULL); ++ break; ++ ++ case HTTP_MSG_RESPONSE: ++ STR_SET(message->http.info.response.status, NULL); ++ break; ++ ++ default: ++ break; ++ } ++ } ++} ++ ++PHP_HTTP_API void _http_message_free(http_message **message) ++{ ++ if (*message) { ++ if ((*message)->parent) { ++ http_message_free(&(*message)->parent); ++ } ++ http_message_dtor(*message); ++ efree(*message); ++ *message = NULL; ++ } ++} ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_message_object.c +@@ -0,0 +1,1555 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_message_object.c 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_CURL ++#define HTTP_WANT_MAGIC ++#include "php_http.h" ++ ++#ifdef ZEND_ENGINE_2 ++ ++#include "zend_interfaces.h" ++#include "ext/standard/url.h" ++#include "php_variables.h" ++ ++#include "php_http_api.h" ++#include "php_http_send_api.h" ++#include "php_http_url_api.h" ++#include "php_http_message_api.h" ++#include "php_http_message_object.h" ++#include "php_http_exception_object.h" ++#include "php_http_response_object.h" ++#include "php_http_request_method_api.h" ++#include "php_http_request_api.h" ++#include "php_http_request_object.h" ++#include "php_http_headers_api.h" ++ ++#if defined(HTTP_HAVE_SPL) && !defined(WONKY) ++/* SPL doesn't install its headers */ ++extern PHPAPI zend_class_entry *spl_ce_Countable; ++#endif ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpMessage, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpMessage, method, 0) ++#define HTTP_MESSAGE_ME(method, visibility) PHP_ME(HttpMessage, method, HTTP_ARGS(HttpMessage, method), visibility) ++ ++HTTP_BEGIN_ARGS(__construct, 0) ++ HTTP_ARG_VAL(message, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(factory, 0) ++ HTTP_ARG_VAL(message, 0) ++ HTTP_ARG_VAL(class_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(fromEnv, 1) ++ HTTP_ARG_VAL(type, 0) ++ HTTP_ARG_VAL(class_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getBody); ++HTTP_BEGIN_ARGS(setBody, 1) ++ HTTP_ARG_VAL(body, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(getHeader, 1) ++ HTTP_ARG_VAL(header, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getHeaders); ++HTTP_BEGIN_ARGS(setHeaders, 1) ++ HTTP_ARG_VAL(headers, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addHeaders, 1) ++ HTTP_ARG_VAL(headers, 0) ++ HTTP_ARG_VAL(append, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getType); ++HTTP_BEGIN_ARGS(setType, 1) ++ HTTP_ARG_VAL(type, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getInfo); ++HTTP_BEGIN_ARGS(setInfo, 1) ++ HTTP_ARG_VAL(http_info, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getResponseCode); ++HTTP_BEGIN_ARGS(setResponseCode, 1) ++ HTTP_ARG_VAL(response_code, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getResponseStatus); ++HTTP_BEGIN_ARGS(setResponseStatus, 1) ++ HTTP_ARG_VAL(response_status, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getRequestMethod); ++HTTP_BEGIN_ARGS(setRequestMethod, 1) ++ HTTP_ARG_VAL(request_method, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getRequestUrl); ++HTTP_BEGIN_ARGS(setRequestUrl, 1) ++ HTTP_ARG_VAL(url, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getHttpVersion); ++HTTP_BEGIN_ARGS(setHttpVersion, 1) ++ HTTP_ARG_VAL(http_version, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(guessContentType, 1) ++ HTTP_ARG_VAL(magic_file, 0) ++ HTTP_ARG_VAL(magic_mode, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getParentMessage); ++HTTP_EMPTY_ARGS(send); ++HTTP_EMPTY_ARGS(__toString); ++HTTP_BEGIN_ARGS(toString, 0) ++ HTTP_ARG_VAL(include_parent, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(toMessageTypeObject); ++ ++HTTP_EMPTY_ARGS(count); ++ ++HTTP_EMPTY_ARGS(serialize); ++HTTP_BEGIN_ARGS(unserialize, 1) ++ HTTP_ARG_VAL(serialized, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(rewind); ++HTTP_EMPTY_ARGS(valid); ++HTTP_EMPTY_ARGS(key); ++HTTP_EMPTY_ARGS(current); ++HTTP_EMPTY_ARGS(next); ++ ++HTTP_EMPTY_ARGS(detach); ++HTTP_BEGIN_ARGS(prepend, 1) ++ HTTP_ARG_OBJ(HttpMessage, message, 0) ++HTTP_END_ARGS; ++HTTP_EMPTY_ARGS(reverse); ++ ++#define http_message_object_read_prop _http_message_object_read_prop ++static zval *_http_message_object_read_prop(zval *object, zval *member, int type ZEND_LITERAL_KEY_DC TSRMLS_DC); ++#define http_message_object_write_prop _http_message_object_write_prop ++static void _http_message_object_write_prop(zval *object, zval *member, zval *value ZEND_LITERAL_KEY_DC TSRMLS_DC); ++#define http_message_object_get_prop_ptr _http_message_object_get_prop_ptr ++static zval **_http_message_object_get_prop_ptr(zval *object, zval *member ZEND_LITERAL_KEY_DC TSRMLS_DC); ++#define http_message_object_get_props _http_message_object_get_props ++static HashTable *_http_message_object_get_props(zval *object TSRMLS_DC); ++ ++#define THIS_CE http_message_object_ce ++zend_class_entry *http_message_object_ce; ++zend_function_entry http_message_object_fe[] = { ++ HTTP_MESSAGE_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) ++ HTTP_MESSAGE_ME(getBody, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setBody, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getHeader, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getHeaders, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setHeaders, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(addHeaders, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getType, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setType, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getInfo, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setInfo, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getResponseCode, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setResponseCode, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getResponseStatus, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setResponseStatus, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getRequestMethod, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setRequestMethod, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getRequestUrl, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setRequestUrl, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getHttpVersion, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setHttpVersion, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(guessContentType, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getParentMessage, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(send, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(toString, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(toMessageTypeObject, ZEND_ACC_PUBLIC) ++ ++ /* implements Countable */ ++ HTTP_MESSAGE_ME(count, ZEND_ACC_PUBLIC) ++ ++ /* implements Serializable */ ++ HTTP_MESSAGE_ME(serialize, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(unserialize, ZEND_ACC_PUBLIC) ++ ++ /* implements Iterator */ ++ HTTP_MESSAGE_ME(rewind, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(valid, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(current, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(key, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(next, ZEND_ACC_PUBLIC) ++ ++ ZEND_MALIAS(HttpMessage, __toString, toString, HTTP_ARGS(HttpMessage, __toString), ZEND_ACC_PUBLIC) ++ ++ HTTP_MESSAGE_ME(factory, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++ ZEND_MALIAS(HttpMessage, fromString, factory, HTTP_ARGS(HttpMessage, factory), ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++ HTTP_MESSAGE_ME(fromEnv, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++ ++ HTTP_MESSAGE_ME(detach, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(prepend, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(reverse, ZEND_ACC_PUBLIC) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++static zend_object_handlers http_message_object_handlers; ++ ++static HashTable http_message_object_prophandlers; ++ ++typedef void (*http_message_object_prophandler_func)(http_message_object *o, zval *v TSRMLS_DC); ++ ++typedef struct _http_message_object_prophandler { ++ http_message_object_prophandler_func read; ++ http_message_object_prophandler_func write; ++} http_message_object_prophandler; ++ ++static STATUS http_message_object_add_prophandler(const char *prop_str, size_t prop_len, http_message_object_prophandler_func read, http_message_object_prophandler_func write) { ++ http_message_object_prophandler h = { read, write }; ++ return zend_hash_add(&http_message_object_prophandlers, prop_str, prop_len, (void *) &h, sizeof(h), NULL); ++} ++static STATUS http_message_object_get_prophandler(const char *prop_str, size_t prop_len, http_message_object_prophandler **handler) { ++ return zend_hash_find(&http_message_object_prophandlers, prop_str, prop_len, (void *) handler); ++} ++static void http_message_object_prophandler_get_type(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ RETVAL_LONG(obj->message->type); ++} ++static void http_message_object_prophandler_set_type(http_message_object *obj, zval *value TSRMLS_DC) { ++ zval *cpy = http_zsep(IS_LONG, value); ++ http_message_set_type(obj->message, Z_LVAL_P(cpy)); ++ zval_ptr_dtor(&cpy); ++} ++static void http_message_object_prophandler_get_body(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ phpstr_fix(PHPSTR(obj->message)); ++ RETVAL_PHPSTR(PHPSTR(obj->message), 0, 1); ++} ++static void http_message_object_prophandler_set_body(http_message_object *obj, zval *value TSRMLS_DC) { ++ zval *cpy = http_zsep(IS_STRING, value); ++ phpstr_dtor(PHPSTR(obj->message)); ++ phpstr_from_string_ex(PHPSTR(obj->message), Z_STRVAL_P(cpy), Z_STRLEN_P(cpy)); ++ zval_ptr_dtor(&cpy); ++} ++static void http_message_object_prophandler_get_request_method(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(REQUEST, obj->message) && obj->message->http.info.request.method) { ++ RETVAL_STRING(obj->message->http.info.request.method, 1); ++ } else { ++ RETVAL_NULL(); ++ } ++} ++static void http_message_object_prophandler_set_request_method(http_message_object *obj, zval *value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(REQUEST, obj->message)) { ++ zval *cpy = http_zsep(IS_STRING, value); ++ STR_SET(obj->message->http.info.request.method, estrndup(Z_STRVAL_P(cpy), Z_STRLEN_P(cpy))); ++ zval_ptr_dtor(&cpy); ++ } ++} ++static void http_message_object_prophandler_get_request_url(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(REQUEST, obj->message) && obj->message->http.info.request.url) { ++ RETVAL_STRING(obj->message->http.info.request.url, 1); ++ } else { ++ RETVAL_NULL(); ++ } ++} ++static void http_message_object_prophandler_set_request_url(http_message_object *obj, zval *value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(REQUEST, obj->message)) { ++ zval *cpy = http_zsep(IS_STRING, value); ++ STR_SET(obj->message->http.info.request.url, estrndup(Z_STRVAL_P(cpy), Z_STRLEN_P(cpy))); ++ zval_ptr_dtor(&cpy); ++ } ++} ++static void http_message_object_prophandler_get_response_status(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(RESPONSE, obj->message) && obj->message->http.info.response.status) { ++ RETVAL_STRING(obj->message->http.info.response.status, 1); ++ } else { ++ RETVAL_NULL(); ++ } ++} ++static void http_message_object_prophandler_set_response_status(http_message_object *obj, zval *value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(RESPONSE, obj->message)) { ++ zval *cpy = http_zsep(IS_STRING, value); ++ STR_SET(obj->message->http.info.response.status, estrndup(Z_STRVAL_P(cpy), Z_STRLEN_P(cpy))); ++ zval_ptr_dtor(&cpy); ++ } ++} ++static void http_message_object_prophandler_get_response_code(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(RESPONSE, obj->message)) { ++ RETVAL_LONG(obj->message->http.info.response.code); ++ } else { ++ RETVAL_NULL(); ++ } ++} ++static void http_message_object_prophandler_set_response_code(http_message_object *obj, zval *value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(RESPONSE, obj->message)) { ++ zval *cpy = http_zsep(IS_LONG, value); ++ obj->message->http.info.response.code = Z_LVAL_P(cpy); ++ zval_ptr_dtor(&cpy); ++ } ++} ++static void http_message_object_prophandler_get_http_version(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ RETVAL_DOUBLE(obj->message->http.version); ++} ++static void http_message_object_prophandler_set_http_version(http_message_object *obj, zval *value TSRMLS_DC) { ++ zval *cpy = http_zsep(IS_DOUBLE, value); ++ obj->message->http.version = Z_DVAL_P(cpy); ++ zval_ptr_dtor(&cpy); ++} ++static void http_message_object_prophandler_get_headers(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ array_init(return_value); ++ zend_hash_copy(Z_ARRVAL_P(return_value), &obj->message->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++} ++static void http_message_object_prophandler_set_headers(http_message_object *obj, zval *value TSRMLS_DC) { ++ zval *cpy = http_zsep(IS_ARRAY, value); ++ zend_hash_clean(&obj->message->hdrs); ++ zend_hash_copy(&obj->message->hdrs, Z_ARRVAL_P(cpy), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ zval_ptr_dtor(&cpy); ++} ++static void http_message_object_prophandler_get_parent_message(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ if (obj->message->parent) { ++ RETVAL_OBJVAL(obj->parent, 1); ++ } else { ++ RETVAL_NULL(); ++ } ++} ++static void http_message_object_prophandler_set_parent_message(http_message_object *obj, zval *value TSRMLS_DC) { ++ if (Z_TYPE_P(value) == IS_OBJECT && instanceof_function(Z_OBJCE_P(value), http_message_object_ce TSRMLS_CC)) { ++ if (obj->message->parent) { ++ zval tmp; ++ tmp.value.obj = obj->parent; ++ Z_OBJ_DELREF(tmp); ++ } ++ Z_OBJ_ADDREF_P(value); ++ obj->parent = value->value.obj; ++ } ++} ++ ++PHP_MINIT_FUNCTION(http_message_object) ++{ ++ HTTP_REGISTER_CLASS_EX(HttpMessage, http_message_object, NULL, 0); ++ ++#ifndef WONKY ++# ifdef HTTP_HAVE_SPL ++ zend_class_implements(http_message_object_ce TSRMLS_CC, 3, spl_ce_Countable, zend_ce_serializable, zend_ce_iterator); ++# else ++ zend_class_implements(http_message_object_ce TSRMLS_CC, 2, zend_ce_serializable, zend_ce_iterator); ++# endif ++#else ++ zend_class_implements(http_message_object_ce TSRMLS_CC, 1, zend_ce_iterator); ++#endif ++ ++ http_message_object_handlers.clone_obj = _http_message_object_clone_obj; ++ http_message_object_handlers.read_property = http_message_object_read_prop; ++ http_message_object_handlers.write_property = http_message_object_write_prop; ++ http_message_object_handlers.get_properties = http_message_object_get_props; ++ http_message_object_handlers.get_property_ptr_ptr = http_message_object_get_prop_ptr; ++ ++ zend_hash_init(&http_message_object_prophandlers, 9, NULL, NULL, 1); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("type")-1, HTTP_MSG_NONE, ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("type")-1, http_message_object_prophandler_get_type, http_message_object_prophandler_set_type); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("body")-1, "", ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("body")-1, http_message_object_prophandler_get_body, http_message_object_prophandler_set_body); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("requestMethod")-1, "", ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("requestMethod")-1, http_message_object_prophandler_get_request_method, http_message_object_prophandler_set_request_method); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("requestUrl")-1, "", ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("requestUrl")-1, http_message_object_prophandler_get_request_url, http_message_object_prophandler_set_request_url); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("responseStatus")-1, "", ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("responseStatus")-1, http_message_object_prophandler_get_response_status, http_message_object_prophandler_set_response_status); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("responseCode")-1, 0, ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("responseCode")-1, http_message_object_prophandler_get_response_code, http_message_object_prophandler_set_response_code); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("httpVersion")-1, ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("httpVersion")-1, http_message_object_prophandler_get_http_version, http_message_object_prophandler_set_http_version); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("headers")-1, ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("headers")-1, http_message_object_prophandler_get_headers, http_message_object_prophandler_set_headers); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("parentMessage")-1, ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("parentMessage")-1, http_message_object_prophandler_get_parent_message, http_message_object_prophandler_set_parent_message); ++ ++#ifndef WONKY ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_NONE")-1, HTTP_MSG_NONE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_REQUEST")-1, HTTP_MSG_REQUEST TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_RESPONSE")-1, HTTP_MSG_RESPONSE TSRMLS_CC); ++#endif ++ ++ HTTP_LONG_CONSTANT("HTTP_MSG_NONE", HTTP_MSG_NONE); ++ HTTP_LONG_CONSTANT("HTTP_MSG_REQUEST", HTTP_MSG_REQUEST); ++ HTTP_LONG_CONSTANT("HTTP_MSG_RESPONSE", HTTP_MSG_RESPONSE); ++ ++ return SUCCESS; ++} ++ ++PHP_MSHUTDOWN_FUNCTION(http_message_object) ++{ ++ zend_hash_destroy(&http_message_object_prophandlers); ++ ++ return SUCCESS; ++} ++ ++void _http_message_object_reverse(zval *this_ptr, zval *return_value TSRMLS_DC) ++{ ++ int i; ++ getObject(http_message_object, obj); ++ ++ /* count */ ++ http_message_count(i, obj->message); ++ ++ if (i > 1) { ++ zval o; ++ zend_object_value *ovalues = NULL; ++ http_message_object **objects = NULL; ++ int last = i - 1; ++ ++ objects = ecalloc(i, sizeof(http_message_object *)); ++ ovalues = ecalloc(i, sizeof(zend_object_value)); ++ ++ /* we are the first message */ ++ objects[0] = obj; ++ ovalues[0] = getThis()->value.obj; ++ ++ /* fetch parents */ ++ INIT_PZVAL(&o); ++ o.type = IS_OBJECT; ++ for (i = 1; obj->parent.handle; ++i) { ++ o.value.obj = obj->parent; ++ ovalues[i] = o.value.obj; ++ objects[i] = obj = zend_object_store_get_object(&o TSRMLS_CC); ++ } ++ ++ /* reorder parents */ ++ for (last = --i; i; --i) { ++ objects[i]->message->parent = objects[i-1]->message; ++ objects[i]->parent = ovalues[i-1]; ++ } ++ objects[0]->message->parent = NULL; ++ objects[0]->parent.handle = 0; ++ objects[0]->parent.handlers = NULL; ++ ++ /* add ref (why?) */ ++ Z_OBJ_ADDREF_P(getThis()); ++ RETVAL_OBJVAL(ovalues[last], 1); ++ ++ efree(objects); ++ efree(ovalues); ++ } else { ++ RETURN_ZVAL(getThis(), 1, 0); ++ } ++} ++ ++void _http_message_object_prepend_ex(zval *this_ptr, zval *prepend, zend_bool top TSRMLS_DC) ++{ ++ zval m; ++ http_message *save_parent_msg = NULL; ++ zend_object_value save_parent_obj = {0, NULL}; ++ getObject(http_message_object, obj); ++ getObjectEx(http_message_object, prepend_obj, prepend); ++ ++ INIT_PZVAL(&m); ++ m.type = IS_OBJECT; ++ ++ if (!top) { ++ save_parent_obj = obj->parent; ++ save_parent_msg = obj->message->parent; ++ } else { ++ /* iterate to the most parent object */ ++ while (obj->parent.handle) { ++ m.value.obj = obj->parent; ++ obj = zend_object_store_get_object(&m TSRMLS_CC); ++ } ++ } ++ ++ /* prepend */ ++ obj->parent = prepend->value.obj; ++ obj->message->parent = prepend_obj->message; ++ ++ /* add ref */ ++ zend_objects_store_add_ref(prepend TSRMLS_CC); ++ while (prepend_obj->parent.handle) { ++ m.value.obj = prepend_obj->parent; ++ zend_objects_store_add_ref(&m TSRMLS_CC); ++ prepend_obj = zend_object_store_get_object(&m TSRMLS_CC); ++ } ++ ++ if (!top) { ++ prepend_obj->parent = save_parent_obj; ++ prepend_obj->message->parent = save_parent_msg; ++ } ++} ++ ++zend_object_value _http_message_object_new(zend_class_entry *ce TSRMLS_DC) ++{ ++ return http_message_object_new_ex(ce, NULL, NULL); ++} ++ ++zend_object_value _http_message_object_new_ex(zend_class_entry *ce, http_message *msg, http_message_object **ptr TSRMLS_DC) ++{ ++ zend_object_value ov; ++ http_message_object *o; ++ ++ o = ecalloc(1, sizeof(http_message_object)); ++ o->zo.ce = ce; ++ ++ if (ptr) { ++ *ptr = o; ++ } ++ ++ if (msg) { ++ o->message = msg; ++ if (msg->parent) { ++ o->parent = http_message_object_new_ex(ce, msg->parent, NULL); ++ } ++ } ++ ++ ++#ifdef ZEND_ENGINE_2_4 ++ zend_object_std_init(o, ce TSRMLS_CC); ++ object_properties_init(o, ce); ++#else ++ ALLOC_HASHTABLE(OBJ_PROP(o)); ++ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++#endif ++ ++ ov.handle = putObject(http_message_object, o); ++ ov.handlers = &http_message_object_handlers; ++ ++ return ov; ++} ++ ++zend_object_value _http_message_object_clone_obj(zval *this_ptr TSRMLS_DC) ++{ ++ zend_object_value new_ov; ++ http_message_object *new_obj = NULL; ++ getObject(http_message_object, old_obj); ++ ++ new_ov = http_message_object_new_ex(old_obj->zo.ce, http_message_dup(old_obj->message), &new_obj); ++ zend_objects_clone_members(&new_obj->zo, new_ov, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); ++ ++ return new_ov; ++} ++ ++void _http_message_object_free(zend_object *object TSRMLS_DC) ++{ ++ http_message_object *o = (http_message_object *) object; ++ ++ if (o->iterator) { ++ zval_ptr_dtor(&o->iterator); ++ o->iterator = NULL; ++ } ++ if (o->message) { ++ http_message_dtor(o->message); ++ efree(o->message); ++ } ++ if (o->parent.handle) { ++ zval p; ++ ++ INIT_PZVAL(&p); ++ p.type = IS_OBJECT; ++ p.value.obj = o->parent; ++ zend_objects_store_del_ref(&p TSRMLS_CC); ++ } ++ freeObject(o); ++} ++ ++static zval **_http_message_object_get_prop_ptr(zval *object, zval *member ZEND_LITERAL_KEY_DC TSRMLS_DC) { ++ getObjectEx(http_message_object, obj, object); ++ http_message_object_prophandler *handler; ++ ++ if (SUCCESS == http_message_object_get_prophandler(Z_STRVAL_P(member), Z_STRLEN_P(member), &handler)) { ++ zend_error(E_ERROR, "Cannot access HttpMessage properties by reference or array key/index"); ++ return NULL; ++ } ++ ++ return zend_get_std_object_handlers()->get_property_ptr_ptr(object, member ZEND_LITERAL_KEY_CC TSRMLS_CC); ++} ++ ++static zval *_http_message_object_read_prop(zval *object, zval *member, int type ZEND_LITERAL_KEY_DC TSRMLS_DC) ++{ ++ getObjectEx(http_message_object, obj, object); ++ http_message_object_prophandler *handler; ++ zval *return_value; ++ ++ if (SUCCESS == http_message_object_get_prophandler(Z_STRVAL_P(member), Z_STRLEN_P(member), &handler)) { ++ if (type == BP_VAR_W) { ++ zend_error(E_ERROR, "Cannot access HttpMessage properties by reference or array key/index"); ++ return NULL; ++ } ++ ++ ALLOC_ZVAL(return_value); ++#ifdef Z_SET_REFCOUNT ++ Z_SET_REFCOUNT_P(return_value, 0); ++ Z_UNSET_ISREF_P(return_value); ++#else ++ return_value->refcount = 0; ++ return_value->is_ref = 0; ++#endif ++ ++ handler->read(obj, return_value TSRMLS_CC); ++ ++ } else { ++ return_value = zend_get_std_object_handlers()->read_property(object, member, type ZEND_LITERAL_KEY_CC TSRMLS_CC); ++ } ++ ++ return return_value; ++} ++ ++static void _http_message_object_write_prop(zval *object, zval *member, zval *value ZEND_LITERAL_KEY_DC TSRMLS_DC) ++{ ++ getObjectEx(http_message_object, obj, object); ++ http_message_object_prophandler *handler; ++ ++ if (SUCCESS == http_message_object_get_prophandler(Z_STRVAL_P(member), Z_STRLEN_P(member), &handler)) { ++ handler->write(obj, value TSRMLS_CC); ++ } else { ++ zend_get_std_object_handlers()->write_property(object, member, value ZEND_LITERAL_KEY_CC TSRMLS_CC); ++ } ++} ++ ++static HashTable *_http_message_object_get_props(zval *object TSRMLS_DC) ++{ ++ zval *headers; ++ getObjectEx(http_message_object, obj, object); ++ http_message *msg = obj->message; ++ zval array, *parent; ++#ifdef ZEND_ENGINE_2_4 ++ HashTable *props = zend_get_std_object_handlers()->get_properties(object TSRMLS_CC); ++#else ++ HashTable *props = OBJ_PROP(obj); ++#endif ++ INIT_ZARR(array, props); ++ ++#define ASSOC_PROP(array, ptype, name, val) \ ++ { \ ++ char *m_prop_name; \ ++ int m_prop_len; \ ++ zend_mangle_property_name(&m_prop_name, &m_prop_len, "*", 1, name, lenof(name), 0); \ ++ add_assoc_ ##ptype## _ex(&array, m_prop_name, sizeof(name)+3, val); \ ++ efree(m_prop_name); \ ++ } ++#define ASSOC_STRING(array, name, val) ASSOC_STRINGL(array, name, val, strlen(val)) ++#define ASSOC_STRINGL(array, name, val, len) \ ++ { \ ++ char *m_prop_name; \ ++ int m_prop_len; \ ++ zend_mangle_property_name(&m_prop_name, &m_prop_len, "*", 1, name, lenof(name), 0); \ ++ add_assoc_stringl_ex(&array, m_prop_name, sizeof(name)+3, val, len, 1); \ ++ efree(m_prop_name); \ ++ } ++ ++ ASSOC_PROP(array, long, "type", msg->type); ++ ASSOC_PROP(array, double, "httpVersion", msg->http.version); ++ ++ switch (msg->type) { ++ case HTTP_MSG_REQUEST: ++ ASSOC_PROP(array, long, "responseCode", 0); ++ ASSOC_STRINGL(array, "responseStatus", "", 0); ++ ASSOC_STRING(array, "requestMethod", STR_PTR(msg->http.info.request.method)); ++ ASSOC_STRING(array, "requestUrl", STR_PTR(msg->http.info.request.url)); ++ break; ++ ++ case HTTP_MSG_RESPONSE: ++ ASSOC_PROP(array, long, "responseCode", msg->http.info.response.code); ++ ASSOC_STRING(array, "responseStatus", STR_PTR(msg->http.info.response.status)); ++ ASSOC_STRINGL(array, "requestMethod", "", 0); ++ ASSOC_STRINGL(array, "requestUrl", "", 0); ++ break; ++ ++ case HTTP_MSG_NONE: ++ default: ++ ASSOC_PROP(array, long, "responseCode", 0); ++ ASSOC_STRINGL(array, "responseStatus", "", 0); ++ ASSOC_STRINGL(array, "requestMethod", "", 0); ++ ASSOC_STRINGL(array, "requestUrl", "", 0); ++ break; ++ } ++ ++ MAKE_STD_ZVAL(headers); ++ array_init(headers); ++ zend_hash_copy(Z_ARRVAL_P(headers), &msg->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ ASSOC_PROP(array, zval, "headers", headers); ++ ASSOC_STRINGL(array, "body", PHPSTR_VAL(msg), PHPSTR_LEN(msg)); ++ ++ MAKE_STD_ZVAL(parent); ++ if (msg->parent) { ++ ZVAL_OBJVAL(parent, obj->parent, 1); ++ } else { ++ ZVAL_NULL(parent); ++ } ++ ASSOC_PROP(array, zval, "parentMessage", parent); ++ ++ return props; ++} ++ ++/* ### USERLAND ### */ ++ ++/* {{{ proto void HttpMessage::__construct([string message]) ++ Create a new HttpMessage object instance. */ ++PHP_METHOD(HttpMessage, __construct) ++{ ++ int length = 0; ++ char *message = NULL; ++ ++ getObject(http_message_object, obj); ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &message, &length) && message && length) { ++ http_message *msg = obj->message; ++ ++ http_message_dtor(msg); ++ if ((obj->message = http_message_parse_ex(msg, message, length))) { ++ if (obj->message->parent) { ++ obj->parent = http_message_object_new_ex(Z_OBJCE_P(getThis()), obj->message->parent, NULL); ++ } ++ } else { ++ obj->message = http_message_init(msg); ++ } ++ } ++ if (!obj->message) { ++ obj->message = http_message_new(); ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto static HttpMessage HttpMessage::factory([string raw_message[, string class_name = "HttpMessage"]]) ++ Create a new HttpMessage object instance. */ ++PHP_METHOD(HttpMessage, factory) ++{ ++ char *string = NULL, *cn = NULL; ++ int length = 0, cl = 0; ++ http_message *msg = NULL; ++ zend_object_value ov; ++ http_message_object *obj = NULL; ++ ++ RETVAL_NULL(); ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ss", &string, &length, &cn, &cl)) { ++ if (length) { ++ msg = http_message_parse(string, length); ++ } ++ if ((msg || !length) && SUCCESS == http_object_new(&ov, cn, cl, _http_message_object_new_ex, http_message_object_ce, msg, &obj)) { ++ RETVAL_OBJVAL(ov, 0); ++ } ++ if (obj && !obj->message) { ++ obj->message = http_message_new(); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto static HttpMessage HttpMessage::fromEnv(int type[, string class_name = "HttpMessage"]) ++ Create a new HttpMessage object from environment representing either current request or response */ ++PHP_METHOD(HttpMessage, fromEnv) ++{ ++ char *cn = NULL; ++ int cl = 0; ++ long type; ++ http_message_object *obj = NULL; ++ zend_object_value ov; ++ ++ RETVAL_NULL(); ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|s", &type, &cn, &cl)) { ++ if (SUCCESS == http_object_new(&ov, cn, cl, _http_message_object_new_ex, http_message_object_ce, http_message_init_env(NULL, type), &obj)) { ++ RETVAL_OBJVAL(ov, 0); ++ } ++ if (obj && !obj->message) { ++ obj->message = http_message_new(); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::getBody() ++ Get the body of the parsed HttpMessage. */ ++PHP_METHOD(HttpMessage, getBody) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ RETURN_PHPSTR(&obj->message->body, PHPSTR_FREE_NOT, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::setBody(string body) ++ Set the body of the HttpMessage. NOTE: Don't forget to update any headers accordingly. */ ++PHP_METHOD(HttpMessage, setBody) ++{ ++ char *body; ++ int len; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &body, &len)) { ++ phpstr_dtor(PHPSTR(obj->message)); ++ phpstr_from_string_ex(PHPSTR(obj->message), body, len); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::getHeader(string header) ++ Get message header. */ ++PHP_METHOD(HttpMessage, getHeader) ++{ ++ zval *header; ++ char *orig_header, *nice_header; ++ int header_len; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &orig_header, &header_len)) { ++ RETURN_FALSE; ++ } ++ ++ nice_header = pretty_key(estrndup(orig_header, header_len), header_len, 1, 1); ++ if ((header = http_message_header_ex(obj->message, nice_header, header_len + 1, 0))) { ++ RETVAL_ZVAL(header, 1, 1); ++ } ++ efree(nice_header); ++} ++/* }}} */ ++ ++/* {{{ proto array HttpMessage::getHeaders() ++ Get Message Headers. */ ++PHP_METHOD(HttpMessage, getHeaders) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ ++ array_init(return_value); ++ array_copy(&obj->message->hdrs, Z_ARRVAL_P(return_value)); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::setHeaders(array headers) ++ Sets new headers. */ ++PHP_METHOD(HttpMessage, setHeaders) ++{ ++ zval *new_headers = NULL; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!", &new_headers)) { ++ return; ++ } ++ ++ zend_hash_clean(&obj->message->hdrs); ++ if (new_headers) { ++ array_copy(Z_ARRVAL_P(new_headers), &obj->message->hdrs); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::addHeaders(array headers[, bool append = false]) ++ Add headers. If append is true, headers with the same name will be separated, else overwritten. */ ++PHP_METHOD(HttpMessage, addHeaders) ++{ ++ zval *new_headers; ++ zend_bool append = 0; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|b", &new_headers, &append)) { ++ return; ++ } ++ ++ array_join(Z_ARRVAL_P(new_headers), &obj->message->hdrs, append, ARRAY_JOIN_STRONLY|ARRAY_JOIN_PRETTIFY); ++} ++/* }}} */ ++ ++/* {{{ proto int HttpMessage::getType() ++ Get Message Type. (HTTP_MSG_NONE|HTTP_MSG_REQUEST|HTTP_MSG_RESPONSE) */ ++PHP_METHOD(HttpMessage, getType) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ RETURN_LONG(obj->message->type); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::setType(int type) ++ Set Message Type. (HTTP_MSG_NONE|HTTP_MSG_REQUEST|HTTP_MSG_RESPONSE) */ ++PHP_METHOD(HttpMessage, setType) ++{ ++ long type; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &type)) { ++ return; ++ } ++ http_message_set_type(obj->message, type); ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::getInfo(void) ++ Get the HTTP request/response line */ ++PHP_METHOD(HttpMessage, getInfo) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ ++ switch (obj->message->type) { ++ case HTTP_MSG_REQUEST: ++ Z_STRLEN_P(return_value) = spprintf(&Z_STRVAL_P(return_value), 0, HTTP_INFO_REQUEST_FMT_ARGS(&obj->message->http, "")); ++ break; ++ case HTTP_MSG_RESPONSE: ++ Z_STRLEN_P(return_value) = spprintf(&Z_STRVAL_P(return_value), 0, HTTP_INFO_RESPONSE_FMT_ARGS(&obj->message->http, "")); ++ break; ++ default: ++ RETURN_NULL(); ++ break; ++ } ++ Z_TYPE_P(return_value) = IS_STRING; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::setInfo(string http_info) ++ Set type and request or response info with a standard HTTP request or response line */ ++PHP_METHOD(HttpMessage, setInfo) ++{ ++ char *str; ++ int len; ++ http_info inf; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &len) && SUCCESS == http_info_parse_ex(str, &inf, 0)) { ++ getObject(http_message_object, obj); ++ ++ http_message_set_info(obj->message, &inf); ++ http_info_dtor(&inf); ++ RETURN_TRUE; ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto int HttpMessage::getResponseCode() ++ Get the Response Code of the Message. */ ++PHP_METHOD(HttpMessage, getResponseCode) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ HTTP_CHECK_MESSAGE_TYPE_RESPONSE(obj->message, RETURN_FALSE); ++ RETURN_LONG(obj->message->http.info.response.code); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::setResponseCode(int code) ++ Set the response code of an HTTP Response Message. */ ++PHP_METHOD(HttpMessage, setResponseCode) ++{ ++ long code; ++ getObject(http_message_object, obj); ++ ++ HTTP_CHECK_MESSAGE_TYPE_RESPONSE(obj->message, RETURN_FALSE); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code)) { ++ RETURN_FALSE; ++ } ++ if (code < 100 || code > 599) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid response code (100-599): %ld", code); ++ RETURN_FALSE; ++ } ++ ++ obj->message->http.info.response.code = code; ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::getResponseStatus() ++ Get the Response Status of the message (i.e. the string following the response code). */ ++PHP_METHOD(HttpMessage, getResponseStatus) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ HTTP_CHECK_MESSAGE_TYPE_RESPONSE(obj->message, RETURN_FALSE); ++ if (obj->message->http.info.response.status) { ++ RETURN_STRING(obj->message->http.info.response.status, 1); ++ } else { ++ RETURN_EMPTY_STRING(); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::setResponseStatus(string status) ++ Set the Response Status of the HTTP message (i.e. the string following the response code). */ ++PHP_METHOD(HttpMessage, setResponseStatus) ++{ ++ char *status; ++ int status_len; ++ getObject(http_message_object, obj); ++ ++ HTTP_CHECK_MESSAGE_TYPE_RESPONSE(obj->message, RETURN_FALSE); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &status, &status_len)) { ++ RETURN_FALSE; ++ } ++ STR_SET(obj->message->http.info.response.status, estrndup(status, status_len)); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::getRequestMethod() ++ Get the Request Method of the Message. */ ++PHP_METHOD(HttpMessage, getRequestMethod) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ HTTP_CHECK_MESSAGE_TYPE_REQUEST(obj->message, RETURN_FALSE); ++ if (obj->message->http.info.request.method) { ++ RETURN_STRING(obj->message->http.info.request.method, 1); ++ } else { ++ RETURN_EMPTY_STRING(); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::setRequestMethod(string method) ++ Set the Request Method of the HTTP Message. */ ++PHP_METHOD(HttpMessage, setRequestMethod) ++{ ++ char *method; ++ int method_len; ++ getObject(http_message_object, obj); ++ ++ HTTP_CHECK_MESSAGE_TYPE_REQUEST(obj->message, RETURN_FALSE); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &method, &method_len)) { ++ RETURN_FALSE; ++ } ++ if (method_len < 1) { ++ http_error(HE_WARNING, HTTP_E_INVALID_PARAM, "Cannot set HttpMessage::requestMethod to an empty string"); ++ RETURN_FALSE; ++ } ++ if (!http_request_method_exists(1, 0, method)) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Unknown request method: %s", method); ++ RETURN_FALSE; ++ } ++ ++ STR_SET(obj->message->http.info.request.method, estrndup(method, method_len)); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::getRequestUrl() ++ Get the Request URL of the Message. */ ++PHP_METHOD(HttpMessage, getRequestUrl) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ HTTP_CHECK_MESSAGE_TYPE_REQUEST(obj->message, RETURN_FALSE); ++ if (obj->message->http.info.request.url) { ++ RETURN_STRING(obj->message->http.info.request.url, 1); ++ } else { ++ RETURN_EMPTY_STRING(); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::setRequestUrl(string url) ++ Set the Request URL of the HTTP Message. */ ++PHP_METHOD(HttpMessage, setRequestUrl) ++{ ++ char *URI; ++ int URIlen; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &URI, &URIlen)) { ++ RETURN_FALSE; ++ } ++ HTTP_CHECK_MESSAGE_TYPE_REQUEST(obj->message, RETURN_FALSE); ++ if (URIlen < 1) { ++ http_error(HE_WARNING, HTTP_E_INVALID_PARAM, "Cannot set HttpMessage::requestUrl to an empty string"); ++ RETURN_FALSE; ++ } ++ ++ STR_SET(obj->message->http.info.request.url, estrndup(URI, URIlen)); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::getHttpVersion() ++ Get the HTTP Protocol Version of the Message. */ ++PHP_METHOD(HttpMessage, getHttpVersion) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ char *version; ++ getObject(http_message_object, obj); ++ ++ spprintf(&version, 0, "%1.1F", obj->message->http.version); ++ RETURN_STRING(version, 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::setHttpVersion(string version) ++ Set the HTTP Protocol version of the Message. */ ++PHP_METHOD(HttpMessage, setHttpVersion) ++{ ++ zval *zv; ++ char *version; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &zv)) { ++ return; ++ } ++ ++ convert_to_double(zv); ++ spprintf(&version, 0, "%1.1F", Z_DVAL_P(zv)); ++ if (strcmp(version, "1.0") && strcmp(version, "1.1")) { ++ efree(version); ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid HTTP protocol version (1.0 or 1.1): %g", Z_DVAL_P(zv)); ++ RETURN_FALSE; ++ } ++ efree(version); ++ obj->message->http.version = Z_DVAL_P(zv); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::guessContentType(string magic_file[, int magic_mode = MAGIC_MIME]) ++ Attempts to guess the content type of supplied payload through libmagic. */ ++PHP_METHOD(HttpMessage, guessContentType) ++{ ++#ifdef HTTP_HAVE_MAGIC ++ char *magic_file, *ct = NULL; ++ int magic_file_len; ++ long magic_mode = MAGIC_MIME; ++ ++ RETVAL_FALSE; ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &magic_file, &magic_file_len, &magic_mode)) { ++ getObject(http_message_object, obj); ++ if ((ct = http_guess_content_type(magic_file, magic_mode, PHPSTR_VAL(&obj->message->body), PHPSTR_LEN(&obj->message->body), SEND_DATA))) { ++ RETVAL_STRING(ct, 0); ++ } ++ } ++ SET_EH_NORMAL(); ++#else ++ http_error(HE_THROW, HTTP_E_RUNTIME, "Cannot guess Content-Type; libmagic not available"); ++ RETURN_FALSE; ++#endif ++} ++/* }}} */ ++ ++/* {{{ proto HttpMessage HttpMessage::getParentMessage() ++ Get parent Message. */ ++PHP_METHOD(HttpMessage, getParentMessage) ++{ ++ SET_EH_THROW_HTTP(); ++ NO_ARGS { ++ getObject(http_message_object, obj); ++ ++ if (obj->message->parent) { ++ RETVAL_OBJVAL(obj->parent, 1); ++ } else { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "HttpMessage does not have a parent message"); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::send() ++ Send the Message according to its type as Response or Request. */ ++PHP_METHOD(HttpMessage, send) ++{ ++ getObject(http_message_object, obj); ++ ++ NO_ARGS; ++ ++ RETURN_SUCCESS(http_message_send(obj->message)); ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::toString([bool include_parent = false]) ++ Get the string representation of the Message. */ ++PHP_METHOD(HttpMessage, toString) ++{ ++ if (return_value_used) { ++ char *string; ++ size_t length; ++ zend_bool include_parent = 0; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &include_parent)) { ++ RETURN_FALSE; ++ } ++ ++ if (include_parent) { ++ http_message_serialize(obj->message, &string, &length); ++ } else { ++ http_message_tostring(obj->message, &string, &length); ++ } ++ RETURN_STRINGL(string, length, 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpRequest|HttpResponse HttpMessage::toMessageTypeObject(void) ++ Creates an object regarding to the type of the message. Returns either an HttpRequest or HttpResponse object on success, or NULL on failure. */ ++PHP_METHOD(HttpMessage, toMessageTypeObject) ++{ ++ SET_EH_THROW_HTTP(); ++ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ ++ switch (obj->message->type) { ++ case HTTP_MSG_REQUEST: ++ { ++#ifdef HTTP_HAVE_CURL ++ int method; ++ char *url; ++ zval post, body, *array, *headers, *host = http_message_header(obj->message, "Host"); ++ php_url hurl, *purl = php_url_parse(STR_PTR(obj->message->http.info.request.url)); ++ ++ MAKE_STD_ZVAL(array); ++ array_init(array); ++ ++ memset(&hurl, 0, sizeof(php_url)); ++ if (host) { ++ hurl.host = Z_STRVAL_P(host); ++ zval_ptr_dtor(&host); ++ } ++ http_build_url(HTTP_URL_REPLACE, purl, &hurl, NULL, &url, NULL); ++ php_url_free(purl); ++ add_assoc_string(array, "url", url, 0); ++ ++ if ( obj->message->http.info.request.method && ++ ((method = http_request_method_exists(1, 0, obj->message->http.info.request.method)) || ++ (method = http_request_method_register(obj->message->http.info.request.method, strlen(obj->message->http.info.request.method))))) { ++ add_assoc_long(array, "method", method); ++ } ++ ++ if (10 == (int) (obj->message->http.version * 10)) { ++ add_assoc_long(array, "protocol", CURL_HTTP_VERSION_1_0); ++ } ++ ++ MAKE_STD_ZVAL(headers); ++ array_init(headers); ++ array_copy(&obj->message->hdrs, Z_ARRVAL_P(headers)); ++ add_assoc_zval(array, "headers", headers); ++ ++ object_init_ex(return_value, http_request_object_ce); ++ zend_call_method_with_1_params(&return_value, http_request_object_ce, NULL, "setoptions", NULL, array); ++ zval_ptr_dtor(&array); ++ ++ if (PHPSTR_VAL(obj->message) && PHPSTR_LEN(obj->message)) { ++ phpstr_fix(PHPSTR(obj->message)); ++ INIT_PZVAL(&body); ++ ZVAL_STRINGL(&body, PHPSTR_VAL(obj->message), PHPSTR_LEN(obj->message), 0); ++ if (method != HTTP_POST) { ++ zend_call_method_with_1_params(&return_value, http_request_object_ce, NULL, "setbody", NULL, &body); ++ } else { ++ INIT_PZVAL(&post); ++ array_init(&post); ++ ++ zval_copy_ctor(&body); ++ sapi_module.treat_data(PARSE_STRING, Z_STRVAL(body), &post TSRMLS_CC); ++ zend_call_method_with_1_params(&return_value, http_request_object_ce, NULL, "setpostfields", NULL, &post); ++ zval_dtor(&post); ++ } ++ } ++#else ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "Cannot transform HttpMessage to HttpRequest (missing curl support)"); ++#endif ++ break; ++ } ++ ++ case HTTP_MSG_RESPONSE: ++ { ++#ifndef WONKY ++ HashPosition pos1, pos2; ++ HashKey key = initHashKey(0); ++ zval **header, **h, *body; ++ ++ if (obj->message->http.info.response.code) { ++ http_send_status(obj->message->http.info.response.code); ++ } ++ ++ object_init_ex(return_value, http_response_object_ce); ++ ++ FOREACH_HASH_KEYVAL(pos1, &obj->message->hdrs, key, header) { ++ if (key.type == HASH_KEY_IS_STRING) { ++ zval *zkey; ++ ++ MAKE_STD_ZVAL(zkey); ++ ZVAL_STRINGL(zkey, key.str, key.len - 1, 1); ++ ++ switch (Z_TYPE_PP(header)) { ++ case IS_ARRAY: ++ case IS_OBJECT: ++ FOREACH_HASH_VAL(pos2, HASH_OF(*header), h) { ++ ZVAL_ADDREF(*h); ++ zend_call_method_with_2_params(&return_value, http_response_object_ce, NULL, "setheader", NULL, zkey, *h); ++ zval_ptr_dtor(h); ++ } ++ break; ++ ++ default: ++ ZVAL_ADDREF(*header); ++ zend_call_method_with_2_params(&return_value, http_response_object_ce, NULL, "setheader", NULL, zkey, *header); ++ zval_ptr_dtor(header); ++ break; ++ } ++ zval_ptr_dtor(&zkey); ++ } ++ } ++ ++ MAKE_STD_ZVAL(body); ++ ZVAL_STRINGL(body, PHPSTR_VAL(obj->message), PHPSTR_LEN(obj->message), 1); ++ zend_call_method_with_1_params(&return_value, http_response_object_ce, NULL, "setdata", NULL, body); ++ zval_ptr_dtor(&body); ++#else ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "Cannot transform HttpMessage to HttpResponse (need PHP 5.1+)"); ++#endif ++ break; ++ } ++ ++ default: ++ http_error(HE_WARNING, HTTP_E_MESSAGE_TYPE, "HttpMessage is neither of type HttpMessage::TYPE_REQUEST nor HttpMessage::TYPE_RESPONSE"); ++ break; ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto int HttpMessage::count() ++ Implements Countable::count(). Returns the number of parent messages + 1. */ ++PHP_METHOD(HttpMessage, count) ++{ ++ NO_ARGS { ++ long i; ++ getObject(http_message_object, obj); ++ ++ http_message_count(i, obj->message); ++ RETURN_LONG(i); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::serialize() ++ Implements Serializable::serialize(). Returns the serialized representation of the HttpMessage. */ ++PHP_METHOD(HttpMessage, serialize) ++{ ++ NO_ARGS { ++ char *string; ++ size_t length; ++ getObject(http_message_object, obj); ++ ++ http_message_serialize(obj->message, &string, &length); ++ RETURN_STRINGL(string, length, 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::unserialize(string serialized) ++ Implements Serializable::unserialize(). Re-constructs the HttpMessage based upon the serialized string. */ ++PHP_METHOD(HttpMessage, unserialize) ++{ ++ int length; ++ char *serialized; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &serialized, &length)) { ++ http_message *msg; ++ ++ http_message_dtor(obj->message); ++ if ((msg = http_message_parse_ex(obj->message, serialized, (size_t) length))) { ++ obj->message = msg; ++ } else { ++ http_message_init(obj->message); ++ http_error(HE_ERROR, HTTP_E_RUNTIME, "Could not unserialize HttpMessage"); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpMessage HttpMessage::detach(void) ++ Returns a clone of an HttpMessage object detached from any parent messages. */ ++PHP_METHOD(HttpMessage, detach) ++{ ++ http_info info; ++ http_message *msg; ++ getObject(http_message_object, obj); ++ ++ NO_ARGS; ++ ++ info.type = obj->message->type; ++ memcpy(&HTTP_INFO(&info), &HTTP_INFO(obj->message), sizeof(struct http_info)); ++ ++ msg = http_message_new(); ++ http_message_set_info(msg, &info); ++ ++ zend_hash_copy(&msg->hdrs, &obj->message->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ phpstr_append(&msg->body, PHPSTR_VAL(obj->message), PHPSTR_LEN(obj->message)); ++ ++ RETVAL_OBJVAL(http_message_object_new_ex(Z_OBJCE_P(getThis()), msg, NULL), 0); ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::prepend(HttpMessage message[, bool top = true]) ++ Prepends message(s) to the HTTP message. Throws HttpInvalidParamException if the message is located within the same message chain. */ ++PHP_METHOD(HttpMessage, prepend) ++{ ++ zval *prepend; ++ zend_bool top = 1; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|b", &prepend, http_message_object_ce, &top)) { ++ http_message *msg[2]; ++ getObject(http_message_object, obj); ++ getObjectEx(http_message_object, prepend_obj, prepend); ++ ++ /* safety check */ ++ for (msg[0] = obj->message; msg[0]; msg[0] = msg[0]->parent) { ++ for (msg[1] = prepend_obj->message; msg[1]; msg[1] = msg[1]->parent) { ++ if (msg[0] == msg[1]) { ++ http_error(HE_THROW, HTTP_E_INVALID_PARAM, "Cannot prepend a message located within the same message chain"); ++ return; ++ } ++ } ++ } ++ ++ http_message_object_prepend_ex(getThis(), prepend, top); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpMessage HttpMessage::reverse() ++ Reorders the message chain in reverse order. Returns the most parent HttpMessage object. */ ++PHP_METHOD(HttpMessage, reverse) ++{ ++ NO_ARGS { ++ http_message_object_reverse(getThis(), return_value); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::rewind(void) ++ Implements Iterator::rewind(). */ ++PHP_METHOD(HttpMessage, rewind) ++{ ++ NO_ARGS { ++ getObject(http_message_object, obj); ++ ++ if (obj->iterator) { ++ zval_ptr_dtor(&obj->iterator); ++ } ++ ZVAL_ADDREF(getThis()); ++ obj->iterator = getThis(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::valid(void) ++ Implements Iterator::valid(). */ ++PHP_METHOD(HttpMessage, valid) ++{ ++ NO_ARGS { ++ getObject(http_message_object, obj); ++ ++ RETURN_BOOL(obj->iterator != NULL); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::next(void) ++ Implements Iterator::next(). */ ++PHP_METHOD(HttpMessage, next) ++{ ++ NO_ARGS { ++ getObject(http_message_object, obj); ++ if (obj->iterator) { ++ getObjectEx(http_message_object, itr, obj->iterator); ++ ++ if (itr && itr->parent.handle) { ++ zval *old = obj->iterator; ++ MAKE_STD_ZVAL(obj->iterator); ++ ZVAL_OBJVAL(obj->iterator, itr->parent, 1); ++ zval_ptr_dtor(&old); ++ } else { ++ zval_ptr_dtor(&obj->iterator); ++ obj->iterator = NULL; ++ } ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto int HttpMessage::key(void) ++ Implements Iterator::key(). */ ++PHP_METHOD(HttpMessage, key) ++{ ++ NO_ARGS { ++ getObject(http_message_object, obj); ++ ++ RETURN_LONG(obj->iterator ? obj->iterator->value.obj.handle:0); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpMessage HttpMessage::current(void) ++ Implements Iterator::current(). */ ++PHP_METHOD(HttpMessage, current) ++{ ++ NO_ARGS { ++ getObject(http_message_object, obj); ++ ++ if (obj->iterator) { ++ RETURN_ZVAL(obj->iterator, 1, 0); ++ } ++ } ++} ++/* }}} */ ++ ++#endif /* ZEND_ENGINE_2 */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_persistent_handle_api.c +@@ -0,0 +1,388 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_persistent_handle_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#include "php_http.h" ++#include "php_http_api.h" ++ ++#include "php_http_persistent_handle_api.h" ++ ++#ifndef HTTP_DEBUG_PHANDLES ++# define HTTP_DEBUG_PHANDLES 0 ++#endif ++#if HTTP_DEBUG_PHANDLES ++# undef inline ++# define inline ++#endif ++ ++static HashTable http_persistent_handles_hash; ++#ifdef ZTS ++# define LOCK() tsrm_mutex_lock(http_persistent_handles_lock) ++# define UNLOCK() tsrm_mutex_unlock(http_persistent_handles_lock) ++static MUTEX_T http_persistent_handles_lock; ++#else ++# define LOCK() ++# define UNLOCK() ++#endif ++ ++typedef struct _http_persistent_handle_list_t { ++ HashTable free; ++ ulong used; ++} http_persistent_handle_list; ++ ++typedef struct _http_persistent_handle_provider_t { ++ http_persistent_handle_list list; /* "ident" => array(handles) entries */ ++ http_persistent_handle_ctor ctor; ++ http_persistent_handle_dtor dtor; ++ http_persistent_handle_copy copy; ++} http_persistent_handle_provider; ++ ++static inline http_persistent_handle_list *http_persistent_handle_list_init(http_persistent_handle_list *list) ++{ ++ int free_list; ++ ++ if ((free_list = !list)) { ++ list = pemalloc(sizeof(http_persistent_handle_list), 1); ++ } ++ ++ list->used = 0; ++ ++ if (SUCCESS != zend_hash_init(&list->free, 0, NULL, NULL, 1)) { ++ if (free_list) { ++ pefree(list, 1); ++ } ++ list = NULL; ++ } ++ ++ return list; ++} ++ ++static inline void http_persistent_handle_list_dtor(http_persistent_handle_list *list, http_persistent_handle_dtor dtor) ++{ ++ HashPosition pos; ++ void **handle; ++ ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "LSTDTOR: %p\n", list); ++#endif ++ FOREACH_HASH_VAL(pos, &list->free, handle) { ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "DESTROY: %p\n", *handle); ++#endif ++ ++ dtor(*handle); ++ } ++ zend_hash_destroy(&list->free); ++} ++ ++static inline void http_persistent_handle_list_free(http_persistent_handle_list **list, http_persistent_handle_dtor dtor) ++{ ++ http_persistent_handle_list_dtor(*list, dtor); ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "LSTFREE: %p\n", *list); ++#endif ++ pefree(*list, 1); ++ *list = NULL; ++} ++ ++static inline http_persistent_handle_list *http_persistent_handle_list_find(http_persistent_handle_provider *provider TSRMLS_DC) ++{ ++ http_persistent_handle_list **list, *new_list; ++ ++ if (SUCCESS == zend_hash_quick_find(&provider->list.free, HTTP_G->persistent.handles.ident.s, HTTP_G->persistent.handles.ident.l, HTTP_G->persistent.handles.ident.h, (void *) &list)) { ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "LSTFIND: %p\n", *list); ++#endif ++ return *list; ++ } ++ ++ if ((new_list = http_persistent_handle_list_init(NULL))) { ++ if (SUCCESS == zend_hash_quick_add(&provider->list.free, HTTP_G->persistent.handles.ident.s, HTTP_G->persistent.handles.ident.l, HTTP_G->persistent.handles.ident.h, (void *) &new_list, sizeof(http_persistent_handle_list *), (void *) &list)) { ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "LSTFIND: %p (new)\n", *list); ++#endif ++ return *list; ++ } ++ http_persistent_handle_list_free(&new_list, provider->dtor); ++ } ++ ++ return NULL; ++} ++ ++static inline STATUS http_persistent_handle_do_acquire(http_persistent_handle_provider *provider, void **handle TSRMLS_DC) ++{ ++ ulong index; ++ void **handle_ptr; ++ http_persistent_handle_list *list; ++ ++ if ((list = http_persistent_handle_list_find(provider TSRMLS_CC))) { ++ zend_hash_internal_pointer_end(&list->free); ++ if (HASH_KEY_NON_EXISTANT != zend_hash_get_current_key(&list->free, NULL, &index, 0) && SUCCESS == zend_hash_get_current_data(&list->free, (void *) &handle_ptr)) { ++ *handle = *handle_ptr; ++ zend_hash_index_del(&list->free, index); ++ } else { ++ *handle = provider->ctor(); ++ } ++ ++ if (*handle) { ++ ++provider->list.used; ++ ++list->used; ++ return SUCCESS; ++ } ++ } else { ++ *handle = NULL; ++ } ++ ++ return FAILURE; ++} ++ ++static inline STATUS http_persistent_handle_do_release(http_persistent_handle_provider *provider, void **handle TSRMLS_DC) ++{ ++ http_persistent_handle_list *list; ++ ++ if ((list = http_persistent_handle_list_find(provider TSRMLS_CC))) { ++ if (provider->list.used >= HTTP_G->persistent.handles.limit) { ++ provider->dtor(*handle); ++ } else { ++ if (SUCCESS != zend_hash_next_index_insert(&list->free, (void *) handle, sizeof(void *), NULL)) { ++ return FAILURE; ++ } ++ } ++ ++ *handle = NULL; ++ --provider->list.used; ++ --list->used; ++ return SUCCESS; ++ } ++ ++ return FAILURE; ++} ++ ++static inline STATUS http_persistent_handle_do_accrete(http_persistent_handle_provider *provider, void *old_handle, void **new_handle TSRMLS_DC) ++{ ++ http_persistent_handle_list *list; ++ ++ if (provider->copy && (*new_handle = provider->copy(old_handle))) { ++ if ((list = http_persistent_handle_list_find(provider TSRMLS_CC))) { ++ ++list->used; ++ } ++ ++provider->list.used; ++ return SUCCESS; ++ } ++ return FAILURE; ++} ++ ++static void http_persistent_handles_hash_dtor(void *p) ++{ ++ http_persistent_handle_provider *provider = (http_persistent_handle_provider *) p; ++ http_persistent_handle_list **list, *list_tmp; ++ HashPosition pos; ++ ++ FOREACH_HASH_VAL(pos, &provider->list.free, list) { ++ /* fix shutdown crash in PHP4 */ ++ list_tmp = *list; ++ http_persistent_handle_list_free(&list_tmp, provider->dtor); ++ } ++ ++ zend_hash_destroy(&provider->list.free); ++} ++ ++PHP_MINIT_FUNCTION(http_persistent_handle) ++{ ++ zend_hash_init(&http_persistent_handles_hash, 0, NULL, http_persistent_handles_hash_dtor, 1); ++#ifdef ZTS ++ http_persistent_handles_lock = tsrm_mutex_alloc(); ++#endif ++ return SUCCESS; ++} ++ ++PHP_MSHUTDOWN_FUNCTION(http_persistent_handle) ++{ ++ zend_hash_destroy(&http_persistent_handles_hash); ++#ifdef ZTS ++ tsrm_mutex_free(http_persistent_handles_lock); ++#endif ++ return SUCCESS; ++} ++ ++PHP_HTTP_API STATUS _http_persistent_handle_provide_ex(const char *name_str, size_t name_len, http_persistent_handle_ctor ctor, http_persistent_handle_dtor dtor, http_persistent_handle_copy copy) ++{ ++ STATUS status = FAILURE; ++ http_persistent_handle_provider provider; ++ ++ LOCK(); ++ if (http_persistent_handle_list_init(&provider.list)) { ++ provider.ctor = ctor; ++ provider.dtor = dtor; ++ provider.copy = copy; ++ ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "PROVIDE: %s\n", name_str); ++#endif ++ ++ if (SUCCESS == zend_hash_add(&http_persistent_handles_hash, HTTP_ZAPI_CONST_CAST(char *) name_str, name_len+1, (void *) &provider, sizeof(http_persistent_handle_provider), NULL)) { ++ status = SUCCESS; ++ } ++ } ++ UNLOCK(); ++ ++ return status; ++} ++ ++PHP_HTTP_API STATUS _http_persistent_handle_acquire_ex(const char *name_str, size_t name_len, void **handle TSRMLS_DC) ++{ ++ STATUS status = FAILURE; ++ http_persistent_handle_provider *provider; ++ ++ *handle = NULL; ++ LOCK(); ++ if (SUCCESS == zend_hash_find(&http_persistent_handles_hash, HTTP_ZAPI_CONST_CAST(char *) name_str, name_len+1, (void *) &provider)) { ++ status = http_persistent_handle_do_acquire(provider, handle TSRMLS_CC); ++ } ++ UNLOCK(); ++ ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "ACQUIRE: %p (%s)\n", *handle, name_str); ++#endif ++ ++ return status; ++} ++ ++PHP_HTTP_API STATUS _http_persistent_handle_release_ex(const char *name_str, size_t name_len, void **handle TSRMLS_DC) ++{ ++ STATUS status = FAILURE; ++ http_persistent_handle_provider *provider; ++#if HTTP_DEBUG_PHANDLES ++ void *handle_tmp = *handle; ++#endif ++ ++ LOCK(); ++ if (SUCCESS == zend_hash_find(&http_persistent_handles_hash, HTTP_ZAPI_CONST_CAST(char *) name_str, name_len+1, (void *) &provider)) { ++ status = http_persistent_handle_do_release(provider, handle TSRMLS_CC); ++ } ++ UNLOCK(); ++ ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "RELEASE: %p (%s)\n", handle_tmp, name_str); ++#endif ++ ++ return status; ++} ++ ++PHP_HTTP_API STATUS _http_persistent_handle_accrete_ex(const char *name_str, size_t name_len, void *old_handle, void **new_handle TSRMLS_DC) ++{ ++ STATUS status = FAILURE; ++ http_persistent_handle_provider *provider; ++ ++ *new_handle = NULL; ++ LOCK(); ++ if (SUCCESS == zend_hash_find(&http_persistent_handles_hash, HTTP_ZAPI_CONST_CAST(char *) name_str, name_len+1, (void *) &provider)) { ++ status = http_persistent_handle_do_accrete(provider, old_handle, new_handle TSRMLS_CC); ++ } ++ UNLOCK(); ++ ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "ACCRETE: %p > %p (%s)\n", old_handle, *new_handle, name_str); ++#endif ++ ++ return status; ++} ++ ++PHP_HTTP_API void _http_persistent_handle_cleanup_ex(const char *name_str, size_t name_len, int current_ident_only TSRMLS_DC) ++{ ++ http_persistent_handle_provider *provider; ++ http_persistent_handle_list *list, **listp; ++ HashPosition pos1, pos2; ++ ++ LOCK(); ++ if (name_str && name_len) { ++ if (SUCCESS == zend_hash_find(&http_persistent_handles_hash, HTTP_ZAPI_CONST_CAST(char *) name_str, name_len+1, (void *) &provider)) { ++ if (current_ident_only) { ++ if ((list = http_persistent_handle_list_find(provider TSRMLS_CC))) { ++ http_persistent_handle_list_dtor(list, provider->dtor); ++ http_persistent_handle_list_init(list); ++ } ++ } else { ++ FOREACH_HASH_VAL(pos1, &provider->list.free, listp) { ++ http_persistent_handle_list_dtor(*listp, provider->dtor); ++ http_persistent_handle_list_init(*listp); ++ } ++ } ++ } ++ } else { ++ FOREACH_HASH_VAL(pos1, &http_persistent_handles_hash, provider) { ++ if (current_ident_only) { ++ if ((list = http_persistent_handle_list_find(provider TSRMLS_CC))) { ++ http_persistent_handle_list_dtor(list, provider->dtor); ++ http_persistent_handle_list_init(list); ++ } ++ } else { ++ FOREACH_HASH_VAL(pos2, &provider->list.free, listp) { ++ http_persistent_handle_list_dtor(*listp, provider->dtor); ++ http_persistent_handle_list_init(*listp); ++ } ++ } ++ } ++ } ++ UNLOCK(); ++} ++ ++PHP_HTTP_API HashTable *_http_persistent_handle_statall_ex(HashTable *ht TSRMLS_DC) ++{ ++ zval *zentry[2]; ++ HashPosition pos1, pos2; ++ HashKey key1 = initHashKey(0), key2 = initHashKey(0); ++ http_persistent_handle_provider *provider; ++ http_persistent_handle_list **list; ++ ++ LOCK(); ++ if (zend_hash_num_elements(&http_persistent_handles_hash)) { ++ if (!ht) { ++ ALLOC_HASHTABLE(ht); ++ zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0); ++ } ++ ++ FOREACH_HASH_KEYVAL(pos1, &http_persistent_handles_hash, key1, provider) { ++ MAKE_STD_ZVAL(zentry[0]); ++ array_init(zentry[0]); ++ ++ FOREACH_HASH_KEYVAL(pos2, &provider->list.free, key2, list) { ++ MAKE_STD_ZVAL(zentry[1]); ++ array_init(zentry[1]); ++ add_assoc_long_ex(zentry[1], ZEND_STRS("used"), (*list)->used); ++ add_assoc_long_ex(zentry[1], ZEND_STRS("free"), zend_hash_num_elements(&(*list)->free)); ++ ++ /* use zend_hash_* not add_assoc_* (which is zend_symtable_*) as we want a string even for numbers */ ++ zend_hash_add(Z_ARRVAL_P(zentry[0]), key2.str, key2.len, &zentry[1], sizeof(zval *), NULL); ++ } ++ ++ zend_hash_add(ht, key1.str, key1.len, &zentry[0], sizeof(zval *), NULL); ++ } ++ } else if (ht) { ++ ht = NULL; ++ } ++ UNLOCK(); ++ ++ return ht; ++} ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_querystring_api.c +@@ -0,0 +1,220 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_querystring_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#include "php_http.h" ++ ++#include "php_variables.h" ++#ifdef HTTP_HAVE_ICONV ++# undef PHP_ATOM_INC ++# include "ext/iconv/php_iconv.h" ++# include "ext/standard/url.h" ++#endif ++ ++#include "php_http_api.h" ++#include "php_http_url_api.h" ++#include "php_http_querystring_api.h" ++ ++#ifdef ZEND_ENGINE_2 ++#define THIS_CE http_querystring_object_ce ++extern zend_class_entry *http_querystring_object_ce; ++#endif ++ ++ ++#define http_querystring_modify_array_ex(q, t, k, kl, i, pe) _http_querystring_modify_array_ex((q), (t), (k), (kl), (i), (pe) TSRMLS_CC) ++static inline int _http_querystring_modify_array_ex(zval *qarray, int key_type, char *key, int keylen, ulong idx, zval *params_entry TSRMLS_DC); ++#define http_querystring_modify_array(q, p) _http_querystring_modify_array((q), (p) TSRMLS_CC) ++static inline int _http_querystring_modify_array(zval *qarray, zval *params TSRMLS_DC); ++ ++ ++#ifdef HTTP_HAVE_ICONV ++PHP_HTTP_API int _http_querystring_xlate(zval *array, zval *param, const char *ie, const char *oe TSRMLS_DC) ++{ ++ HashPosition pos; ++ zval **entry = NULL; ++ char *xlate_str = NULL, *xkey; ++ size_t xlate_len = 0, xlen; ++ HashKey key = initHashKey(0); ++ ++ FOREACH_KEYVAL(pos, param, key, entry) { ++ if (key.type == HASH_KEY_IS_STRING) { ++ if (PHP_ICONV_ERR_SUCCESS != php_iconv_string(key.str, key.len-1, &xkey, &xlen, oe, ie)) { ++ http_error_ex(HE_WARNING, HTTP_E_QUERYSTRING, "Failed to convert '%.*s' from '%s' to '%s'", key.len-1, key.str, ie, oe); ++ return FAILURE; ++ } ++ } ++ ++ if (Z_TYPE_PP(entry) == IS_STRING) { ++ if (PHP_ICONV_ERR_SUCCESS != php_iconv_string(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), &xlate_str, &xlate_len, oe, ie)) { ++ if (key.type == HASH_KEY_IS_STRING) { ++ efree(xkey); ++ } ++ http_error_ex(HE_WARNING, HTTP_E_QUERYSTRING, "Failed to convert '%.*s' from '%s' to '%s'", Z_STRLEN_PP(entry), Z_STRVAL_PP(entry), ie, oe); ++ return FAILURE; ++ } ++ if (key.type == HASH_KEY_IS_STRING) { ++ add_assoc_stringl_ex(array, xkey, xlen+1, xlate_str, xlate_len, 0); ++ } else { ++ add_index_stringl(array, key.num, xlate_str, xlate_len, 0); ++ } ++ } else if (Z_TYPE_PP(entry) == IS_ARRAY) { ++ zval *subarray; ++ ++ MAKE_STD_ZVAL(subarray); ++ array_init(subarray); ++ if (key.type == HASH_KEY_IS_STRING) { ++ add_assoc_zval_ex(array, xkey, xlen+1, subarray); ++ } else { ++ add_index_zval(array, key.num, subarray); ++ } ++ if (SUCCESS != http_querystring_xlate(subarray, *entry, ie, oe)) { ++ if (key.type == HASH_KEY_IS_STRING) { ++ efree(xkey); ++ } ++ return FAILURE; ++ } ++ } ++ ++ if (key.type == HASH_KEY_IS_STRING) { ++ efree(xkey); ++ } ++ } ++ return SUCCESS; ++} ++#endif /* HAVE_ICONV */ ++ ++PHP_HTTP_API void _http_querystring_update(zval *qarray, zval *qstring TSRMLS_DC) ++{ ++ char *s = NULL; ++ size_t l = 0; ++ ++ if (Z_TYPE_P(qarray) != IS_ARRAY) { ++ convert_to_array(qarray); ++ } ++ if (SUCCESS == http_urlencode_hash_ex(Z_ARRVAL_P(qarray), 0, NULL, 0, &s, &l)) { ++ zval_dtor(qstring); ++ ZVAL_STRINGL(qstring, s, l, 0); ++ } else { ++ http_error(HE_WARNING, HTTP_E_QUERYSTRING, "Failed to update query string"); ++ } ++} ++ ++PHP_HTTP_API int _http_querystring_modify(zval *qarray, zval *params TSRMLS_DC) ++{ ++ if (Z_TYPE_P(params) == IS_ARRAY) { ++ return http_querystring_modify_array(qarray, params); ++ } else if (Z_TYPE_P(params) == IS_OBJECT) { ++#ifdef ZEND_ENGINE_2 ++ if (instanceof_function(Z_OBJCE_P(params), http_querystring_object_ce TSRMLS_CC)) { ++ return http_querystring_modify_array(qarray, zend_read_property(THIS_CE, params, ZEND_STRS("queryArray")-1, 0 TSRMLS_CC)); ++ } else { ++#endif ++ return http_querystring_modify_array(qarray, params); ++#ifdef ZEND_ENGINE_2 ++ } ++#endif ++ } else { ++ int rv; ++ zval array; ++ zval *qstring = http_zsep(IS_STRING, params); ++ ++ INIT_PZVAL(&array); ++ array_init(&array); ++ ++ sapi_module.treat_data(PARSE_STRING, estrdup(Z_STRVAL_P(qstring)), &array TSRMLS_CC); ++ zval_ptr_dtor(&qstring); ++ ++ rv = http_querystring_modify_array(qarray, &array); ++ zval_dtor(&array); ++ return rv; ++ } ++} ++ ++static inline int _http_querystring_modify_array(zval *qarray, zval *params TSRMLS_DC) ++{ ++ int rv = 0; ++ HashKey key = initHashKey(0); ++ HashPosition pos; ++ zval **params_entry = NULL; ++ ++ FOREACH_HASH_KEYVAL(pos, HASH_OF(params), key, params_entry) { ++ /* only public properties */ ++ if ((key.type != HASH_KEY_IS_STRING || *key.str) && http_querystring_modify_array_ex(qarray, key.type, key.str, key.len, key.num, *params_entry)) { ++ rv = 1; ++ } ++ } ++ ++ return rv; ++} ++ ++static inline int _http_querystring_modify_array_ex(zval *qarray, int key_type, char *key, int keylen, ulong idx, zval *params_entry TSRMLS_DC) ++{ ++ zval **qarray_entry; ++ ++ /* ensure array type */ ++ if (Z_TYPE_P(qarray) != IS_ARRAY) { ++ convert_to_array(qarray); ++ } ++ ++ /* delete */ ++ if (Z_TYPE_P(params_entry) == IS_NULL) { ++ if (key_type == HASH_KEY_IS_STRING) { ++ return (SUCCESS == zend_hash_del(Z_ARRVAL_P(qarray), key, keylen)); ++ } else { ++ return (SUCCESS == zend_hash_index_del(Z_ARRVAL_P(qarray), idx)); ++ } ++ } ++ ++ /* update */ ++ if ( ((key_type == HASH_KEY_IS_STRING) && (SUCCESS == zend_hash_find(Z_ARRVAL_P(qarray), key, keylen, (void *) &qarray_entry))) || ++ ((key_type == HASH_KEY_IS_LONG) && (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(qarray), idx, (void *) &qarray_entry)))) { ++ zval equal; ++ ++ /* recursive */ ++ if (Z_TYPE_P(params_entry) == IS_ARRAY || Z_TYPE_P(params_entry) == IS_OBJECT) { ++ return http_querystring_modify(*qarray_entry, params_entry); ++ } ++ /* equal */ ++ if ((SUCCESS == is_equal_function(&equal, *qarray_entry, params_entry TSRMLS_CC)) && Z_BVAL(equal)) { ++ return 0; ++ } ++ } ++ ++ /* add */ ++ if (Z_TYPE_P(params_entry) == IS_OBJECT) { ++ zval *new_array; ++ ++ MAKE_STD_ZVAL(new_array); ++ array_init(new_array); ++ http_querystring_modify_array(new_array, params_entry); ++ params_entry = new_array; ++ } else { ++ ZVAL_ADDREF(params_entry); ++ } ++ if (key_type == HASH_KEY_IS_STRING) { ++ add_assoc_zval_ex(qarray, key, keylen, params_entry); ++ } else { ++ add_index_zval(qarray, idx, params_entry); ++ } ++ return 1; ++} ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/http_querystring_object.c +@@ -0,0 +1,633 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_querystring_object.c 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#include "php_http.h" ++ ++#ifdef ZEND_ENGINE_2 ++ ++#include "php_variables.h" ++#include "zend_interfaces.h" ++ ++#include "php_http_api.h" ++#include "php_http_querystring_api.h" ++#include "php_http_querystring_object.h" ++#include "php_http_exception_object.h" ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpQueryString, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpQueryString, method, 0) ++#define HTTP_QUERYSTRING_ME(method, visibility) PHP_ME(HttpQueryString, method, HTTP_ARGS(HttpQueryString, method), visibility) ++#define HTTP_QUERYSTRING_GME(method, visibility) PHP_ME(HttpQueryString, method, HTTP_ARGS(HttpQueryString, __getter), visibility) ++ ++HTTP_BEGIN_ARGS(__construct, 0) ++ HTTP_ARG_VAL(global, 0) ++ HTTP_ARG_VAL(params, 0) ++HTTP_END_ARGS; ++ ++#ifndef WONKY ++HTTP_BEGIN_ARGS(singleton, 0) ++ HTTP_ARG_VAL(global, 0) ++HTTP_END_ARGS; ++#endif ++ ++HTTP_BEGIN_ARGS(factory, 0) ++ HTTP_ARG_VAL(global, 0) ++ HTTP_ARG_VAL(params, 0) ++ HTTP_ARG_VAL(class_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(toArray); ++HTTP_EMPTY_ARGS(toString); ++ ++HTTP_BEGIN_ARGS(get, 0) ++ HTTP_ARG_VAL(name, 0) ++ HTTP_ARG_VAL(type, 0) ++ HTTP_ARG_VAL(defval, 0) ++ HTTP_ARG_VAL(delete, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(set, 1) ++ HTTP_ARG_VAL(params, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(mod, 0) ++ HTTP_ARG_VAL(params, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(__getter, 1) ++ HTTP_ARG_VAL(name, 0) ++ HTTP_ARG_VAL(defval, 0) ++ HTTP_ARG_VAL(delete, 0) ++HTTP_END_ARGS; ++ ++#ifdef HTTP_HAVE_ICONV ++HTTP_BEGIN_ARGS(xlate, 2) ++ HTTP_ARG_VAL(from_encoding, 0) ++ HTTP_ARG_VAL(to_encoding, 0) ++HTTP_END_ARGS; ++#endif ++ ++HTTP_EMPTY_ARGS(serialize); ++HTTP_BEGIN_ARGS(unserialize, 1) ++ HTTP_ARG_VAL(serialized, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(offsetGet, 1) ++ HTTP_ARG_VAL(offset, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(offsetSet, 2) ++ HTTP_ARG_VAL(offset, 0) ++ HTTP_ARG_VAL(value, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(offsetExists, 1) ++ HTTP_ARG_VAL(offset, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(offsetUnset, 1) ++ HTTP_ARG_VAL(offset, 0) ++HTTP_END_ARGS; ++ ++ ++#define THIS_CE http_querystring_object_ce ++zend_class_entry *http_querystring_object_ce; ++zend_function_entry http_querystring_object_fe[] = { ++ HTTP_QUERYSTRING_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR|ZEND_ACC_FINAL) ++ ++ HTTP_QUERYSTRING_ME(toArray, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_ME(toString, ZEND_ACC_PUBLIC) ++ ZEND_MALIAS(HttpQueryString, __toString, toString, HTTP_ARGS(HttpQueryString, toString), ZEND_ACC_PUBLIC) ++ ++ HTTP_QUERYSTRING_ME(get, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_ME(set, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_ME(mod, ZEND_ACC_PUBLIC) ++ ++ HTTP_QUERYSTRING_GME(getBool, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_GME(getInt, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_GME(getFloat, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_GME(getString, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_GME(getArray, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_GME(getObject, ZEND_ACC_PUBLIC) ++ ++ HTTP_QUERYSTRING_ME(factory, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++#ifndef WONKY ++ HTTP_QUERYSTRING_ME(singleton, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++#endif ++#ifdef HTTP_HAVE_ICONV ++ HTTP_QUERYSTRING_ME(xlate, ZEND_ACC_PUBLIC) ++#endif ++ ++ /* Implements Serializable */ ++ HTTP_QUERYSTRING_ME(serialize, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_ME(unserialize, ZEND_ACC_PUBLIC) ++ ++ /* Implements ArrayAccess */ ++ HTTP_QUERYSTRING_ME(offsetGet, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_ME(offsetSet, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_ME(offsetExists, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_ME(offsetUnset, ZEND_ACC_PUBLIC) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++static zend_object_handlers http_querystring_object_handlers; ++ ++PHP_MINIT_FUNCTION(http_querystring_object) ++{ ++ HTTP_REGISTER_CLASS_EX(HttpQueryString, http_querystring_object, NULL, 0); ++ ++#ifndef WONKY ++ zend_class_implements(http_querystring_object_ce TSRMLS_CC, 2, zend_ce_serializable, zend_ce_arrayaccess); ++#endif ++ ++ zend_declare_property_null(THIS_CE, ZEND_STRS("instance")-1, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("queryArray")-1, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("queryString")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ ++#ifndef WONKY ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_BOOL")-1, HTTP_QUERYSTRING_TYPE_BOOL TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_INT")-1, HTTP_QUERYSTRING_TYPE_INT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_FLOAT")-1, HTTP_QUERYSTRING_TYPE_FLOAT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_STRING")-1, HTTP_QUERYSTRING_TYPE_STRING TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_ARRAY")-1, HTTP_QUERYSTRING_TYPE_ARRAY TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_OBJECT")-1, HTTP_QUERYSTRING_TYPE_OBJECT TSRMLS_CC); ++#endif ++ ++ HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_BOOL", HTTP_QUERYSTRING_TYPE_BOOL); ++ HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_INT", HTTP_QUERYSTRING_TYPE_INT); ++ HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_FLOAT", HTTP_QUERYSTRING_TYPE_FLOAT); ++ HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_STRING", HTTP_QUERYSTRING_TYPE_STRING); ++ HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_ARRAY", HTTP_QUERYSTRING_TYPE_ARRAY); ++ HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_OBJECT", HTTP_QUERYSTRING_TYPE_OBJECT); ++ ++ return SUCCESS; ++} ++ ++zend_object_value _http_querystring_object_new(zend_class_entry *ce TSRMLS_DC) ++{ ++ return http_querystring_object_new_ex(ce, NULL, NULL); ++} ++ ++zend_object_value _http_querystring_object_new_ex(zend_class_entry *ce, void *nothing, http_querystring_object **ptr TSRMLS_DC) ++{ ++ zend_object_value ov; ++ http_querystring_object *o; ++ ++ o = ecalloc(1, sizeof(http_querystring_object)); ++ o->zo.ce = ce; ++ ++ if (ptr) { ++ *ptr = o; ++ } ++ ++#ifdef ZEND_ENGINE_2_4 ++ zend_object_std_init(o, ce TSRMLS_CC); ++ object_properties_init(o, ce); ++#else ++ ALLOC_HASHTABLE(OBJ_PROP(o)); ++ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++#endif ++ ++ ov.handle = putObject(http_querystring_object, o); ++ ov.handlers = &http_querystring_object_handlers; ++ ++ return ov; ++} ++ ++void _http_querystring_object_free(zend_object *object TSRMLS_DC) ++{ ++ http_querystring_object *o = (http_querystring_object *) object; ++ ++ freeObject(o); ++} ++ ++/* {{{ querystring helpers */ ++#define http_querystring_instantiate(t, g, p, u) _http_querystring_instantiate((t), (g), (p), (u) TSRMLS_CC) ++static inline zval *_http_querystring_instantiate(zval *this_ptr, zend_bool global, zval *params, zend_bool defer_update TSRMLS_DC) ++{ ++ zval *qarray = NULL, *qstring = NULL, **_SERVER = NULL, **_GET = NULL, **QUERY_STRING = NULL;; ++ ++ if (!this_ptr) { ++ MAKE_STD_ZVAL(this_ptr); ++ Z_TYPE_P(this_ptr) = IS_OBJECT; ++ this_ptr->value.obj = http_querystring_object_new(http_querystring_object_ce); ++ } ++ if (global) { ++#ifdef ZEND_ENGINE_2 ++ zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC); ++#endif ++ if ( (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void *) &_SERVER)) && ++ (Z_TYPE_PP(_SERVER) == IS_ARRAY) && ++ (SUCCESS == zend_hash_find(Z_ARRVAL_PP(_SERVER), "QUERY_STRING", sizeof("QUERY_STRING"), (void *) &QUERY_STRING))) { ++ ++ qstring = *QUERY_STRING; ++#ifdef ZEND_ENGINE_2 ++ zend_is_auto_global("_GET", lenof("_GET") TSRMLS_CC); ++#endif ++ if ((SUCCESS == zend_hash_find(&EG(symbol_table), "_GET", sizeof("_GET"), (void *) &_GET)) && (Z_TYPE_PP(_GET) == IS_ARRAY)) { ++ qarray = *_GET; ++ } else { ++ http_error(HE_WARNING, HTTP_E_QUERYSTRING, "Could not acquire reference to superglobal GET array"); ++ } ++ } else { ++ http_error(HE_WARNING, HTTP_E_QUERYSTRING, "Could not acquire reference to QUERY_STRING"); ++ } ++ ++ if (qarray && qstring) { ++ if (Z_TYPE_P(qstring) != IS_STRING) { ++ convert_to_string(qstring); ++ } ++ ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, qarray TSRMLS_CC); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, qstring TSRMLS_CC); ++#ifdef Z_SET_ISREF ++ Z_SET_ISREF_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC)); ++ Z_SET_ISREF_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)); ++#else ++ zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC)->is_ref = 1; ++ zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)->is_ref = 1; ++#endif ++ ++ if (params) { ++ http_querystring_modify(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC), params); ++ } ++ if (!defer_update) { ++ http_querystring_update(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC), zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)); ++ } ++ } ++ } else { ++ MAKE_STD_ZVAL(qarray); ++ array_init(qarray); ++ ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, qarray TSRMLS_CC); ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("queryString")-1, "", 0 TSRMLS_CC); ++ ++ if (params && http_querystring_modify(qarray, params) && !defer_update) { ++ http_querystring_update(qarray, zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)); ++ } ++ ++ zval_ptr_dtor(&qarray); ++ } ++ ++ return this_ptr; ++} ++ ++#define http_querystring_get(o, t, n, l, def, del, r) _http_querystring_get((o), (t), (n), (l), (def), (del), (r) TSRMLS_CC) ++static inline void _http_querystring_get(zval *this_ptr, int type, char *name, uint name_len, zval *defval, zend_bool del, zval *return_value TSRMLS_DC) ++{ ++ zval **arrval, *qarray = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC); ++ ++ if ((Z_TYPE_P(qarray) == IS_ARRAY) && (SUCCESS == zend_hash_find(Z_ARRVAL_P(qarray), name, name_len + 1, (void *) &arrval))) { ++ if (type) { ++ zval *value = http_zsep(type, *arrval); ++ RETVAL_ZVAL(value, 1, 1); ++ } else { ++ RETVAL_ZVAL(*arrval, 1, 0); ++ } ++ ++ if (del && (SUCCESS == zend_hash_del(Z_ARRVAL_P(qarray), name, name_len + 1))) { ++ http_querystring_update(qarray, zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)); ++ } ++ } else if(defval) { ++ RETURN_ZVAL(defval, 1, 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto final void HttpQueryString::__construct([bool global = true[, mixed add]) ++ Creates a new HttpQueryString object instance. Operates on and modifies $_GET and $_SERVER['QUERY_STRING'] if global is TRUE. */ ++PHP_METHOD(HttpQueryString, __construct) ++{ ++ zend_bool global = 1; ++ zval *params = NULL; ++ ++ SET_EH_THROW_HTTP(); ++ if (!sapi_module.treat_data) { ++ http_error(HE_ERROR, HTTP_E_QUERYSTRING, "The SAPI does not have a treat_data function registered"); ++ } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bz", &global, ¶ms)) { ++ http_querystring_instantiate(getThis(), global, params, 0); ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto HttpQueryString HttpQueryString::factory([bool global = TRUE[, mixed params[, string class_name = "HttpQueryString"]) ++ Creates a new HttpQueryString object instance. */ ++PHP_METHOD(HttpQueryString, factory) ++{ ++ zend_bool global = 1; ++ zval *params = NULL; ++ char *cn = NULL; ++ int cl = 0; ++ zend_object_value ov; ++ ++ SET_EH_THROW_HTTP(); ++ if (!sapi_module.treat_data) { ++ http_error(HE_ERROR, HTTP_E_QUERYSTRING, "The SAPI does not have a treat_data function registered"); ++ } else if ( SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bzs", &global, ¶ms, &cn, &cl) && ++ SUCCESS == http_object_new(&ov, cn, cl, _http_querystring_object_new_ex, http_querystring_object_ce, NULL, NULL)) { ++ RETVAL_OBJVAL(ov, 0); ++ http_querystring_instantiate(return_value, global, params, 0); ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto string HttpQueryString::toString() ++ Returns the string representation. */ ++PHP_METHOD(HttpQueryString, toString) ++{ ++ NO_ARGS; ++ RETURN_PROP(queryString); ++} ++/* }}} */ ++ ++/* {{{ proto array HttpQueryString::toArray() ++ Returns the array representation. */ ++PHP_METHOD(HttpQueryString, toArray) ++{ ++ NO_ARGS; ++ RETURN_PROP(queryArray); ++} ++/* }}} */ ++ ++/* {{{ proto mixed HttpQueryString::get([string key[, mixed type = 0[, mixed defval = NULL[, bool delete = false]]]]) ++ Get (part of) the query string. The type parameter is either one of the HttpQueryString::TYPE_* constants or a type abbreviation like "b" for bool, "i" for int, "f" for float, "s" for string, "a" for array and "o" for a stdClass object. */ ++PHP_METHOD(HttpQueryString, get) ++{ ++ char *name = NULL; ++ int name_len = 0; ++ long type = 0; ++ zend_bool del = 0; ++ zval *ztype = NULL, *defval = NULL; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|szzb", &name, &name_len, &ztype, &defval, &del)) { ++ if (name && name_len) { ++ if (ztype) { ++ if (Z_TYPE_P(ztype) == IS_LONG) { ++ type = Z_LVAL_P(ztype); ++ } else if(Z_TYPE_P(ztype) == IS_STRING) { ++ switch (Z_STRVAL_P(ztype)[0]) { ++ case 'B': ++ case 'b': type = HTTP_QUERYSTRING_TYPE_BOOL; break; ++ case 'I': ++ case 'i': type = HTTP_QUERYSTRING_TYPE_INT; break; ++ case 'F': ++ case 'f': type = HTTP_QUERYSTRING_TYPE_FLOAT; break; ++ case 'S': ++ case 's': type = HTTP_QUERYSTRING_TYPE_STRING; break; ++ case 'A': ++ case 'a': type = HTTP_QUERYSTRING_TYPE_ARRAY; break; ++ case 'O': ++ case 'o': type = HTTP_QUERYSTRING_TYPE_OBJECT; break; ++ } ++ } ++ } ++ http_querystring_get(getThis(), type, name, name_len, defval, del, return_value); ++ } else { ++ RETURN_PROP(queryString); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpQueryString::set(mixed params) ++ Set query string entry/entries. NULL values will unset the variable. */ ++PHP_METHOD(HttpQueryString, set) ++{ ++ zval *params; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶ms)) { ++ zval *qarray = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC); ++ if (http_querystring_modify(qarray, params)) { ++ http_querystring_update(qarray, zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)); ++ } ++ } ++ ++ if (return_value_used) { ++ RETURN_PROP(queryString); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpQueryString HttpQueryString::mod(mixed params) ++ Copies the query string object and sets provided params at the clone. */ ++PHP_METHOD(HttpQueryString, mod) ++{ ++ zval *zobj, *qarr, *qstr, *params; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶ms)) { ++ zobj = http_querystring_instantiate(NULL, 0, zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC), 1); ++ qarr = zend_read_property(THIS_CE, zobj, ZEND_STRS("queryArray")-1, 0 TSRMLS_CC); ++ qstr = zend_read_property(THIS_CE, zobj, ZEND_STRS("queryString")-1, 0 TSRMLS_CC); ++ ++ http_querystring_modify(qarr, params); ++ http_querystring_update(qarr, qstr); ++ ++ RETURN_ZVAL(zobj, 1, 1); ++ } ++} ++/* }}} */ ++ ++#ifndef WONKY ++/* {{{ proto static HttpQueryString HttpQueryString::singleton([bool global = true]) ++ Get a single instance (differentiates between the global setting). */ ++PHP_METHOD(HttpQueryString, singleton) ++{ ++ zend_bool global = 1; ++ zval *instance = *zend_std_get_static_property(THIS_CE, ZEND_STRS("instance")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC); ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &global)) { ++ zval **zobj_ptr = NULL, *zobj = NULL; ++ ++ if (Z_TYPE_P(instance) == IS_ARRAY) { ++ if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(instance), global, (void *) &zobj_ptr)) { ++ RETVAL_ZVAL(*zobj_ptr, 1, 0); ++ } else { ++ zobj = http_querystring_instantiate(NULL, global, NULL, (zend_bool) !global); ++ add_index_zval(instance, global, zobj); ++ RETVAL_OBJECT(zobj, 1); ++ } ++ } else { ++ MAKE_STD_ZVAL(instance); ++ array_init(instance); ++ ++ zobj = http_querystring_instantiate(NULL, global, NULL, (zend_bool) !global); ++ add_index_zval(instance, global, zobj); ++ RETVAL_OBJECT(zobj, 1); ++ ++ zend_update_static_property(THIS_CE, ZEND_STRS("instance")-1, instance TSRMLS_CC); ++ zval_ptr_dtor(&instance); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++#endif ++ ++/* {{{ Getters by type */ ++#define HTTP_QUERYSTRING_GETTER(method, TYPE) \ ++PHP_METHOD(HttpQueryString, method) \ ++{ \ ++ char *name; \ ++ int name_len; \ ++ zval *defval = NULL; \ ++ zend_bool del = 0; \ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zb", &name, &name_len, &defval, &del)) { \ ++ http_querystring_get(getThis(), TYPE, name, name_len, defval, del, return_value); \ ++ } \ ++} ++HTTP_QUERYSTRING_GETTER(getBool, IS_BOOL); ++HTTP_QUERYSTRING_GETTER(getInt, IS_LONG); ++HTTP_QUERYSTRING_GETTER(getFloat, IS_DOUBLE); ++HTTP_QUERYSTRING_GETTER(getString, IS_STRING); ++HTTP_QUERYSTRING_GETTER(getArray, IS_ARRAY); ++HTTP_QUERYSTRING_GETTER(getObject, IS_OBJECT); ++/* }}} */ ++ ++#ifdef HTTP_HAVE_ICONV ++/* {{{ proto bool HttpQueryString::xlate(string ie, string oe) ++ Converts the query string from the source encoding ie to the target encoding oe. WARNING: Don't use any character set that can contain NUL bytes like UTF-16. */ ++PHP_METHOD(HttpQueryString, xlate) ++{ ++ char *ie, *oe; ++ int ie_len, oe_len; ++ zval xa, *qa, *qs; ++ STATUS rs; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &ie, &ie_len, &oe, &oe_len)) { ++ RETURN_FALSE; ++ } ++ ++ qa = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC); ++ qs = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC); ++ INIT_PZVAL(&xa); ++ array_init(&xa); ++ ++ if (SUCCESS == (rs = http_querystring_xlate(&xa, qa, ie, oe))) { ++ zend_hash_clean(Z_ARRVAL_P(qa)); ++ zend_hash_copy(Z_ARRVAL_P(qa), Z_ARRVAL(xa), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ http_querystring_update(qa, qs); ++ } ++ zval_dtor(&xa); ++ ++ RETURN_SUCCESS(rs); ++} ++/* }}} */ ++#endif /* HAVE_ICONV */ ++ ++/* {{{ proto string HttpQueryString::serialize() ++ Implements Serializable::serialize(). */ ++PHP_METHOD(HttpQueryString, serialize) ++{ ++ NO_ARGS; ++ RETURN_PROP(queryString); ++} ++/* }}} */ ++ ++/* {{{ proto void HttpQueryString::unserialize(string serialized) ++ Implements Serializable::unserialize(). */ ++PHP_METHOD(HttpQueryString, unserialize) ++{ ++ zval *serialized; ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &serialized)) { ++ if (Z_TYPE_P(serialized) == IS_STRING) { ++ http_querystring_instantiate(getThis(), 0, serialized, 0); ++ } else { ++ http_error(HE_WARNING, HTTP_E_QUERYSTRING, "Expected a string as parameter"); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto mixed HttpQueryString::offsetGet(string offset) ++ Implements ArrayAccess::offsetGet(). */ ++PHP_METHOD(HttpQueryString, offsetGet) ++{ ++ char *offset_str; ++ int offset_len; ++ zval **value; ++ ++ if ( (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &offset_str, &offset_len)) && ++ (SUCCESS == zend_hash_find(Z_ARRVAL_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC)), offset_str, offset_len + 1, (void *) &value))) { ++ RETVAL_ZVAL(*value, 1, 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpQueryString::offsetSet(string offset, mixed value) ++ Implements ArrayAccess::offsetGet(). */ ++PHP_METHOD(HttpQueryString, offsetSet) ++{ ++ char *offset_str; ++ int offset_len; ++ zval *value; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &offset_str, &offset_len, &value)) { ++ zval *qarr = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC), *qstr = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC); ++ ++ ZVAL_ADDREF(value); ++ add_assoc_zval_ex(qarr, offset_str, offset_len + 1, value); ++ http_querystring_update(qarr, qstr); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpQueryString::offsetExists(string offset) ++ Implements ArrayAccess::offsetExists(). */ ++PHP_METHOD(HttpQueryString, offsetExists) ++{ ++ char *offset_str; ++ int offset_len; ++ zval **value; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &offset_str, &offset_len)) { ++ RETURN_BOOL((SUCCESS == zend_hash_find(Z_ARRVAL_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC)), offset_str, offset_len + 1, (void *) &value)) && (Z_TYPE_PP(value) != IS_NULL)); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpQueryString::offsetUnset(string offset) ++ Implements ArrayAccess::offsetUnset(). */ ++PHP_METHOD(HttpQueryString, offsetUnset) ++{ ++ char *offset_str; ++ int offset_len; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &offset_str, &offset_len)) { ++ zval *qarr = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC); ++ ++ if (SUCCESS == zend_hash_del(Z_ARRVAL_P(qarr), offset_str, offset_len + 1)) { ++ http_querystring_update(qarr, zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)); ++ } ++ } ++} ++/* }}} */ ++ ++#endif /* ZEND_ENGINE_2 */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_request_api.c +@@ -0,0 +1,1326 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_request_api.c 310775 2011-05-05 06:02:50Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#ifdef HTTP_HAVE_CURL ++ ++#include "php_http_api.h" ++#include "php_http_persistent_handle_api.h" ++#include "php_http_request_api.h" ++#include "php_http_url_api.h" ++ ++#ifdef ZEND_ENGINE_2 ++# include "php_http_request_object.h" ++#endif ++ ++#include "php_http_request_int.h" ++ ++/* {{{ cruft for thread safe SSL crypto locks */ ++#ifdef HTTP_NEED_OPENSSL_TSL ++static MUTEX_T *http_openssl_tsl = NULL; ++ ++static void http_openssl_thread_lock(int mode, int n, const char * file, int line) ++{ ++ if (mode & CRYPTO_LOCK) { ++ tsrm_mutex_lock(http_openssl_tsl[n]); ++ } else { ++ tsrm_mutex_unlock(http_openssl_tsl[n]); ++ } ++} ++ ++static ulong http_openssl_thread_id(void) ++{ ++ return (ulong) tsrm_thread_id(); ++} ++#endif ++#ifdef HTTP_NEED_GNUTLS_TSL ++static int http_gnutls_mutex_create(void **m) ++{ ++ if (*((MUTEX_T *) m) = tsrm_mutex_alloc()) { ++ return SUCCESS; ++ } else { ++ return FAILURE; ++ } ++} ++ ++static int http_gnutls_mutex_destroy(void **m) ++{ ++ tsrm_mutex_free(*((MUTEX_T *) m)); ++ return SUCCESS; ++} ++ ++static int http_gnutls_mutex_lock(void **m) ++{ ++ return tsrm_mutex_lock(*((MUTEX_T *) m)); ++} ++ ++static int http_gnutls_mutex_unlock(void **m) ++{ ++ return tsrm_mutex_unlock(*((MUTEX_T *) m)); ++} ++ ++static struct gcry_thread_cbs http_gnutls_tsl = { ++ GCRY_THREAD_OPTION_USER, ++ NULL, ++ http_gnutls_mutex_create, ++ http_gnutls_mutex_destroy, ++ http_gnutls_mutex_lock, ++ http_gnutls_mutex_unlock ++}; ++#endif ++/* }}} */ ++ ++/* safe curl wrappers */ ++#define init_curl_storage(ch) \ ++ {\ ++ http_request_storage *st = pecalloc(1, sizeof(http_request_storage), 1); \ ++ curl_easy_setopt(ch, CURLOPT_PRIVATE, st); \ ++ curl_easy_setopt(ch, CURLOPT_ERRORBUFFER, st->errorbuffer); \ ++ } ++ ++static void *safe_curl_init(void) ++{ ++ CURL *ch; ++ ++ if ((ch = curl_easy_init())) { ++ init_curl_storage(ch); ++ return ch; ++ } ++ return NULL; ++} ++static void *safe_curl_copy(void *p) ++{ ++ CURL *ch; ++ ++ if ((ch = curl_easy_duphandle(p))) { ++ init_curl_storage(ch); ++ return ch; ++ } ++ return NULL; ++} ++static void safe_curl_dtor(void *p) { ++ http_request_storage *st = http_request_storage_get(p); ++ ++ curl_easy_cleanup(p); ++ ++ if (st) { ++ if (st->url) { ++ pefree(st->url, 1); ++ } ++ if (st->cookiestore) { ++ pefree(st->cookiestore, 1); ++ } ++ pefree(st, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ MINIT */ ++PHP_MINIT_FUNCTION(http_request) ++{ ++#ifdef HTTP_NEED_OPENSSL_TSL ++ /* mod_ssl, libpq or ext/curl might already have set thread lock callbacks */ ++ if (!CRYPTO_get_id_callback()) { ++ int i, c = CRYPTO_num_locks(); ++ ++ http_openssl_tsl = malloc(c * sizeof(MUTEX_T)); ++ ++ for (i = 0; i < c; ++i) { ++ http_openssl_tsl[i] = tsrm_mutex_alloc(); ++ } ++ ++ CRYPTO_set_id_callback(http_openssl_thread_id); ++ CRYPTO_set_locking_callback(http_openssl_thread_lock); ++ } ++#endif ++#ifdef HTTP_NEED_GNUTLS_TSL ++ gcry_control(GCRYCTL_SET_THREAD_CBS, &http_gnutls_tsl); ++#endif ++ ++ if (CURLE_OK != curl_global_init(CURL_GLOBAL_ALL)) { ++ return FAILURE; ++ } ++ ++ if (SUCCESS != http_persistent_handle_provide("http_request", safe_curl_init, safe_curl_dtor, safe_curl_copy)) { ++ return FAILURE; ++ } ++ ++ HTTP_LONG_CONSTANT("HTTP_AUTH_BASIC", CURLAUTH_BASIC); ++ HTTP_LONG_CONSTANT("HTTP_AUTH_DIGEST", CURLAUTH_DIGEST); ++#if HTTP_CURL_VERSION(7,19,3) ++ HTTP_LONG_CONSTANT("HTTP_AUTH_DIGEST_IE", CURLAUTH_DIGEST_IE); ++#endif ++ HTTP_LONG_CONSTANT("HTTP_AUTH_NTLM", CURLAUTH_NTLM); ++ HTTP_LONG_CONSTANT("HTTP_AUTH_GSSNEG", CURLAUTH_GSSNEGOTIATE); ++ HTTP_LONG_CONSTANT("HTTP_AUTH_ANY", CURLAUTH_ANY); ++ ++ HTTP_LONG_CONSTANT("HTTP_VERSION_NONE", CURL_HTTP_VERSION_NONE); /* to be removed */ ++ HTTP_LONG_CONSTANT("HTTP_VERSION_1_0", CURL_HTTP_VERSION_1_0); ++ HTTP_LONG_CONSTANT("HTTP_VERSION_1_1", CURL_HTTP_VERSION_1_1); ++ HTTP_LONG_CONSTANT("HTTP_VERSION_ANY", CURL_HTTP_VERSION_NONE); ++ ++ HTTP_LONG_CONSTANT("HTTP_SSL_VERSION_TLSv1", CURL_SSLVERSION_TLSv1); ++ HTTP_LONG_CONSTANT("HTTP_SSL_VERSION_SSLv2", CURL_SSLVERSION_SSLv2); ++ HTTP_LONG_CONSTANT("HTTP_SSL_VERSION_SSLv3", CURL_SSLVERSION_SSLv3); ++ HTTP_LONG_CONSTANT("HTTP_SSL_VERSION_ANY", CURL_SSLVERSION_DEFAULT); ++ ++ HTTP_LONG_CONSTANT("HTTP_IPRESOLVE_V4", CURL_IPRESOLVE_V4); ++ HTTP_LONG_CONSTANT("HTTP_IPRESOLVE_V6", CURL_IPRESOLVE_V6); ++ HTTP_LONG_CONSTANT("HTTP_IPRESOLVE_ANY", CURL_IPRESOLVE_WHATEVER); ++ ++#if HTTP_CURL_VERSION(7,15,2) ++ HTTP_LONG_CONSTANT("HTTP_PROXY_SOCKS4", CURLPROXY_SOCKS4); ++#endif ++#if HTTP_CURL_VERSION(7,18,0) ++ HTTP_LONG_CONSTANT("HTTP_PROXY_SOCKS4A", CURLPROXY_SOCKS4A); ++ HTTP_LONG_CONSTANT("HTTP_PROXY_SOCKS5_HOSTNAME", CURLPROXY_SOCKS5_HOSTNAME); ++#endif ++ HTTP_LONG_CONSTANT("HTTP_PROXY_SOCKS5", CURLPROXY_SOCKS5); ++ HTTP_LONG_CONSTANT("HTTP_PROXY_HTTP", CURLPROXY_HTTP); ++#if HTTP_CURL_VERSION(7,19,4) ++ HTTP_LONG_CONSTANT("HTTP_PROXY_HTTP_1_0", CURLPROXY_HTTP_1_0); ++#endif ++ ++#if HTTP_CURL_VERSION(7,19,1) ++ HTTP_LONG_CONSTANT("HTTP_POSTREDIR_301", CURL_REDIR_POST_301); ++ HTTP_LONG_CONSTANT("HTTP_POSTREDIR_302", CURL_REDIR_POST_302); ++ HTTP_LONG_CONSTANT("HTTP_POSTREDIR_ALL", CURL_REDIR_POST_ALL); ++#endif ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ MSHUTDOWN */ ++PHP_MSHUTDOWN_FUNCTION(http_request) ++{ ++ curl_global_cleanup(); ++#ifdef HTTP_NEED_OPENSSL_TSL ++ if (http_openssl_tsl) { ++ int i, c = CRYPTO_num_locks(); ++ ++ CRYPTO_set_id_callback(NULL); ++ CRYPTO_set_locking_callback(NULL); ++ ++ for (i = 0; i < c; ++i) { ++ tsrm_mutex_free(http_openssl_tsl[i]); ++ } ++ ++ free(http_openssl_tsl); ++ http_openssl_tsl = NULL; ++ } ++#endif ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ forward declarations */ ++#define http_request_option(r, o, k, t) _http_request_option_ex((r), (o), (k), sizeof(k), (t) TSRMLS_CC) ++#define http_request_option_ex(r, o, k, l, t) _http_request_option_ex((r), (o), (k), (l), (t) TSRMLS_CC) ++static inline zval *_http_request_option_ex(http_request *request, HashTable *options, char *key, size_t keylen, int type TSRMLS_DC); ++#define http_request_option_cache(r, k, z) _http_request_option_cache_ex((r), (k), sizeof(k), 0, (z) TSRMLS_CC) ++#define http_request_option_cache_ex(r, k, kl, h, z) _http_request_option_cache_ex((r), (k), (kl), (h), (z) TSRMLS_CC) ++static inline zval *_http_request_option_cache_ex(http_request *r, char *key, size_t keylen, ulong h, zval *opt TSRMLS_DC); ++ ++#define http_request_cookies_enabled(r) _http_request_cookies_enabled((r)) ++static inline int _http_request_cookies_enabled(http_request *r); ++ ++static size_t http_curl_read_callback(void *, size_t, size_t, void *); ++static int http_curl_progress_callback(void *, double, double, double, double); ++static int http_curl_raw_callback(CURL *, curl_infotype, char *, size_t, void *); ++static int http_curl_dummy_callback(char *data, size_t n, size_t l, void *s) { return n*l; } ++static curlioerr http_curl_ioctl_callback(CURL *, curliocmd, void *); ++/* }}} */ ++ ++/* {{{ CURL *http_curl_init(http_request *) */ ++PHP_HTTP_API CURL * _http_curl_init_ex(CURL *ch, http_request *request TSRMLS_DC) ++{ ++ if (ch || (SUCCESS == http_persistent_handle_acquire("http_request", &ch))) { ++#if defined(ZTS) ++ curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1L); ++#endif ++ curl_easy_setopt(ch, CURLOPT_HEADER, 0L); ++ curl_easy_setopt(ch, CURLOPT_FILETIME, 1L); ++ curl_easy_setopt(ch, CURLOPT_AUTOREFERER, 1L); ++ curl_easy_setopt(ch, CURLOPT_VERBOSE, 1L); ++ curl_easy_setopt(ch, CURLOPT_HEADERFUNCTION, NULL); ++ curl_easy_setopt(ch, CURLOPT_DEBUGFUNCTION, http_curl_raw_callback); ++ curl_easy_setopt(ch, CURLOPT_READFUNCTION, http_curl_read_callback); ++ curl_easy_setopt(ch, CURLOPT_IOCTLFUNCTION, http_curl_ioctl_callback); ++ curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, http_curl_dummy_callback); ++ ++ /* set context */ ++ if (request) { ++ curl_easy_setopt(ch, CURLOPT_DEBUGDATA, request); ++ ++ /* attach curl handle */ ++ request->ch = ch; ++ /* set defaults (also in http_request_reset()) */ ++ http_request_defaults(request); ++ } ++ } ++ ++ return ch; ++} ++/* }}} */ ++ ++/* {{{ CURL *http_curl_copy(CURL *) */ ++PHP_HTTP_API CURL *_http_curl_copy(CURL *ch TSRMLS_DC) ++{ ++ CURL *copy; ++ ++ if (SUCCESS == http_persistent_handle_accrete("http_request", ch, ©)) { ++ return copy; ++ } ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ void http_curl_free(CURL **) */ ++PHP_HTTP_API void _http_curl_free(CURL **ch TSRMLS_DC) ++{ ++ if (*ch) { ++ curl_easy_setopt(*ch, CURLOPT_NOPROGRESS, 1L); ++ curl_easy_setopt(*ch, CURLOPT_PROGRESSFUNCTION, NULL); ++ curl_easy_setopt(*ch, CURLOPT_VERBOSE, 0L); ++ curl_easy_setopt(*ch, CURLOPT_DEBUGFUNCTION, NULL); ++ ++ http_persistent_handle_release("http_request", ch); ++ } ++} ++/* }}} */ ++ ++/* {{{ http_request *http_request_init(http_request *) */ ++PHP_HTTP_API http_request *_http_request_init_ex(http_request *request, CURL *ch, http_request_method meth, const char *url ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ http_request *r; ++ ++ if (request) { ++ r = request; ++ } else { ++ r = emalloc_rel(sizeof(http_request)); ++ } ++ memset(r, 0, sizeof(http_request)); ++ ++ r->ch = ch; ++ r->url = (url) ? http_absolute_url(url) : NULL; ++ r->meth = (meth > 0) ? meth : HTTP_GET; ++ ++ phpstr_init(&r->conv.request); ++ phpstr_init_ex(&r->conv.response, HTTP_CURLBUF_SIZE, 0); ++ phpstr_init(&r->_cache.cookies); ++ zend_hash_init(&r->_cache.options, 0, NULL, ZVAL_PTR_DTOR, 0); ++ ++ TSRMLS_SET_CTX(r->tsrm_ls); ++ ++ return r; ++} ++/* }}} */ ++ ++/* {{{ void http_request_dtor(http_request *) */ ++PHP_HTTP_API void _http_request_dtor(http_request *request) ++{ ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ http_request_reset(request); ++ http_curl_free(&request->ch); ++ ++ phpstr_dtor(&request->_cache.cookies); ++ zend_hash_destroy(&request->_cache.options); ++ if (request->_cache.headers) { ++ curl_slist_free_all(request->_cache.headers); ++ request->_cache.headers = NULL; ++ } ++ if (request->_progress_callback) { ++ zval_ptr_dtor(&request->_progress_callback); ++ request->_progress_callback = NULL; ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_request_free(http_request **) */ ++PHP_HTTP_API void _http_request_free(http_request **request) ++{ ++ if (*request) { ++ TSRMLS_FETCH_FROM_CTX((*request)->tsrm_ls); ++ http_request_body_free(&(*request)->body); ++ http_request_dtor(*request); ++ efree(*request); ++ *request = NULL; ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_request_reset(http_request *) */ ++PHP_HTTP_API void _http_request_reset(http_request *request) ++{ ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ STR_SET(request->url, NULL); ++ request->conv.last_type = 0; ++ phpstr_dtor(&request->conv.request); ++ phpstr_dtor(&request->conv.response); ++ http_request_body_dtor(request->body); ++ http_request_defaults(request); ++ ++ if (request->ch) { ++ http_request_storage *st = http_request_storage_get(request->ch); ++ ++ if (st) { ++ if (st->url) { ++ pefree(st->url, 1); ++ st->url = NULL; ++ } ++ if (st->cookiestore) { ++ pefree(st->cookiestore, 1); ++ st->cookiestore = NULL; ++ } ++ st->errorbuffer[0] = '\0'; ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ STATUS http_request_enable_cookies(http_request *) */ ++PHP_HTTP_API STATUS _http_request_enable_cookies(http_request *request) ++{ ++ int initialized = 1; ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ HTTP_CHECK_CURL_INIT(request->ch, http_curl_init_ex(request->ch, request), initialized = 0); ++ if (initialized && (http_request_cookies_enabled(request) || (CURLE_OK == curl_easy_setopt(request->ch, CURLOPT_COOKIEFILE, "")))) { ++ return SUCCESS; ++ } ++ http_error(HE_WARNING, HTTP_E_REQUEST, "Could not enable cookies for this session"); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_request_reset_cookies(http_request *, int) */ ++PHP_HTTP_API STATUS _http_request_reset_cookies(http_request *request, int session_only) ++{ ++ int initialized = 1; ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ HTTP_CHECK_CURL_INIT(request->ch, http_curl_init_ex(request->ch, request), initialized = 0); ++ if (initialized) { ++ if (!http_request_cookies_enabled(request)) { ++ if (SUCCESS != http_request_enable_cookies(request)) { ++ return FAILURE; ++ } ++ } ++ if (session_only) { ++#if HTTP_CURL_VERSION(7,15,4) ++ if (CURLE_OK == curl_easy_setopt(request->ch, CURLOPT_COOKIELIST, "SESS")) { ++ return SUCCESS; ++ } ++#else ++ http_error(HE_WARNING, HTTP_E_REQUEST, "Could not reset session cookies (need libcurl >= v7.15.4)"); ++#endif ++ } else { ++#if HTTP_CURL_VERSION(7,14,1) ++ if (CURLE_OK == curl_easy_setopt(request->ch, CURLOPT_COOKIELIST, "ALL")) { ++ return SUCCESS; ++ } ++#else ++ http_error(HE_WARNING, HTTP_E_REQUEST, "Could not reset cookies (need libcurl >= v7.14.1)"); ++#endif ++ } ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++PHP_HTTP_API STATUS _http_request_flush_cookies(http_request *request) ++{ ++ int initialized = 1; ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ HTTP_CHECK_CURL_INIT(request->ch, http_curl_init_ex(request->ch, request), initialized = 0); ++ if (initialized) { ++ if (!http_request_cookies_enabled(request)) { ++ return FAILURE; ++ } ++#if HTTP_CURL_VERSION(7,17,1) ++ if (CURLE_OK == curl_easy_setopt(request->ch, CURLOPT_COOKIELIST, "FLUSH")) { ++ return SUCCESS; ++ } ++#else ++ http_error(HE_WARNING, HTTP_E_REQUEST, "Could not flush cookies (need libcurl >= v7.17.1)"); ++#endif ++ } ++ return FAILURE; ++} ++ ++/* {{{ void http_request_defaults(http_request *) */ ++PHP_HTTP_API void _http_request_defaults(http_request *request) ++{ ++ if (request->ch) { ++ HTTP_CURL_OPT(CURLOPT_PROGRESSFUNCTION, NULL); ++ HTTP_CURL_OPT(CURLOPT_URL, NULL); ++ HTTP_CURL_OPT(CURLOPT_NOPROGRESS, 1L); ++#if HTTP_CURL_VERSION(7,19,4) ++ HTTP_CURL_OPT(CURLOPT_NOPROXY, NULL); ++#endif ++ HTTP_CURL_OPT(CURLOPT_PROXY, NULL); ++ HTTP_CURL_OPT(CURLOPT_PROXYPORT, 0L); ++ HTTP_CURL_OPT(CURLOPT_PROXYTYPE, 0L); ++ /* libcurl < 7.19.6 does not clear auth info with USERPWD set to NULL */ ++#if HTTP_CURL_VERSION(7,19,1) ++ HTTP_CURL_OPT(CURLOPT_PROXYUSERNAME, NULL); ++ HTTP_CURL_OPT(CURLOPT_PROXYPASSWORD, NULL); ++#endif ++ HTTP_CURL_OPT(CURLOPT_PROXYAUTH, 0L); ++ HTTP_CURL_OPT(CURLOPT_HTTPPROXYTUNNEL, 0L); ++ HTTP_CURL_OPT(CURLOPT_DNS_CACHE_TIMEOUT, 60L); ++ HTTP_CURL_OPT(CURLOPT_IPRESOLVE, 0); ++ HTTP_CURL_OPT(CURLOPT_LOW_SPEED_LIMIT, 0L); ++ HTTP_CURL_OPT(CURLOPT_LOW_SPEED_TIME, 0L); ++#if HTTP_CURL_VERSION(7,15,5) ++ /* LFS weirdance ++ HTTP_CURL_OPT(CURLOPT_MAX_SEND_SPEED_LARGE, (curl_off_t) 0); ++ HTTP_CURL_OPT(CURLOPT_MAX_RECV_SPEED_LARGE, (curl_off_t) 0); ++ */ ++#endif ++ /* crashes ++ HTTP_CURL_OPT(CURLOPT_MAXCONNECTS, 5L); */ ++ HTTP_CURL_OPT(CURLOPT_FRESH_CONNECT, 0L); ++ HTTP_CURL_OPT(CURLOPT_FORBID_REUSE, 0L); ++ HTTP_CURL_OPT(CURLOPT_INTERFACE, NULL); ++ HTTP_CURL_OPT(CURLOPT_PORT, 0L); ++#if HTTP_CURL_VERSION(7,19,0) ++ HTTP_CURL_OPT(CURLOPT_ADDRESS_SCOPE, 0L); ++#endif ++#if HTTP_CURL_VERSION(7,15,2) ++ HTTP_CURL_OPT(CURLOPT_LOCALPORT, 0L); ++ HTTP_CURL_OPT(CURLOPT_LOCALPORTRANGE, 0L); ++#endif ++ /* libcurl < 7.19.6 does not clear auth info with USERPWD set to NULL */ ++#if HTTP_CURL_VERSION(7,19,1) ++ HTTP_CURL_OPT(CURLOPT_USERNAME, NULL); ++ HTTP_CURL_OPT(CURLOPT_PASSWORD, NULL); ++#endif ++ HTTP_CURL_OPT(CURLOPT_HTTPAUTH, 0L); ++ HTTP_CURL_OPT(CURLOPT_ENCODING, NULL); ++#if HTTP_CURL_VERSION(7,16,2) ++ /* we do this ourself anyway */ ++ HTTP_CURL_OPT(CURLOPT_HTTP_CONTENT_DECODING, 0L); ++ HTTP_CURL_OPT(CURLOPT_HTTP_TRANSFER_DECODING, 0L); ++#endif ++ HTTP_CURL_OPT(CURLOPT_FOLLOWLOCATION, 0L); ++#if HTTP_CURL_VERSION(7,19,1) ++ HTTP_CURL_OPT(CURLOPT_POSTREDIR, 0L); ++#elif HTTP_CURL_VERSION(7,17,1) ++ HTTP_CURL_OPT(CURLOPT_POST301, 0L); ++#endif ++ HTTP_CURL_OPT(CURLOPT_UNRESTRICTED_AUTH, 0L); ++ HTTP_CURL_OPT(CURLOPT_REFERER, NULL); ++ HTTP_CURL_OPT(CURLOPT_USERAGENT, "PECL::HTTP/" PHP_HTTP_VERSION " (PHP/" PHP_VERSION ")"); ++ HTTP_CURL_OPT(CURLOPT_HTTPHEADER, NULL); ++ HTTP_CURL_OPT(CURLOPT_COOKIE, NULL); ++ HTTP_CURL_OPT(CURLOPT_COOKIESESSION, 0L); ++ /* these options would enable curl's cookie engine by default which we don't want ++ HTTP_CURL_OPT(CURLOPT_COOKIEFILE, NULL); ++ HTTP_CURL_OPT(CURLOPT_COOKIEJAR, NULL); */ ++#if HTTP_CURL_VERSION(7,14,1) ++ HTTP_CURL_OPT(CURLOPT_COOKIELIST, NULL); ++#endif ++ HTTP_CURL_OPT(CURLOPT_RANGE, NULL); ++ HTTP_CURL_OPT(CURLOPT_RESUME_FROM, 0L); ++ HTTP_CURL_OPT(CURLOPT_MAXFILESIZE, 0L); ++ HTTP_CURL_OPT(CURLOPT_TIMECONDITION, 0L); ++ HTTP_CURL_OPT(CURLOPT_TIMEVALUE, 0L); ++ HTTP_CURL_OPT(CURLOPT_TIMEOUT, 0L); ++ HTTP_CURL_OPT(CURLOPT_CONNECTTIMEOUT, 3); ++ HTTP_CURL_OPT(CURLOPT_SSLCERT, NULL); ++ HTTP_CURL_OPT(CURLOPT_SSLCERTTYPE, NULL); ++ HTTP_CURL_OPT(CURLOPT_SSLCERTPASSWD, NULL); ++ HTTP_CURL_OPT(CURLOPT_SSLKEY, NULL); ++ HTTP_CURL_OPT(CURLOPT_SSLKEYTYPE, NULL); ++ HTTP_CURL_OPT(CURLOPT_SSLKEYPASSWD, NULL); ++ HTTP_CURL_OPT(CURLOPT_SSLENGINE, NULL); ++ HTTP_CURL_OPT(CURLOPT_SSLVERSION, 0L); ++ HTTP_CURL_OPT(CURLOPT_SSL_VERIFYPEER, 0L); ++ HTTP_CURL_OPT(CURLOPT_SSL_VERIFYHOST, 0L); ++ HTTP_CURL_OPT(CURLOPT_SSL_CIPHER_LIST, NULL); ++#if HTTP_CURL_VERSION(7,19,0) ++ HTTP_CURL_OPT(CURLOPT_ISSUERCERT, NULL); ++ #if defined(HTTP_HAVE_OPENSSL) ++ HTTP_CURL_OPT(CURLOPT_CRLFILE, NULL); ++ #endif ++#endif ++#if HTTP_CURL_VERSION(7,19,1) && defined(HTTP_HAVE_OPENSSL) ++ HTTP_CURL_OPT(CURLOPT_CERTINFO, NULL); ++#endif ++#ifdef HTTP_CURL_CAINFO ++ HTTP_CURL_OPT(CURLOPT_CAINFO, HTTP_CURL_CAINFO); ++#else ++ HTTP_CURL_OPT(CURLOPT_CAINFO, NULL); ++#endif ++ HTTP_CURL_OPT(CURLOPT_CAPATH, NULL); ++ HTTP_CURL_OPT(CURLOPT_RANDOM_FILE, NULL); ++ HTTP_CURL_OPT(CURLOPT_EGDSOCKET, NULL); ++ HTTP_CURL_OPT(CURLOPT_POSTFIELDS, NULL); ++ HTTP_CURL_OPT(CURLOPT_POSTFIELDSIZE, 0L); ++ HTTP_CURL_OPT(CURLOPT_HTTPPOST, NULL); ++ HTTP_CURL_OPT(CURLOPT_IOCTLDATA, NULL); ++ HTTP_CURL_OPT(CURLOPT_READDATA, NULL); ++ HTTP_CURL_OPT(CURLOPT_INFILESIZE, 0L); ++ HTTP_CURL_OPT(CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_NONE); ++ HTTP_CURL_OPT(CURLOPT_CUSTOMREQUEST, NULL); ++ HTTP_CURL_OPT(CURLOPT_NOBODY, 0L); ++ HTTP_CURL_OPT(CURLOPT_POST, 0L); ++ HTTP_CURL_OPT(CURLOPT_UPLOAD, 0L); ++ HTTP_CURL_OPT(CURLOPT_HTTPGET, 1L); ++ } ++} ++/* }}} */ ++ ++PHP_HTTP_API void _http_request_set_progress_callback(http_request *request, zval *cb) ++{ ++ if (request->_progress_callback) { ++ zval_ptr_dtor(&request->_progress_callback); ++ } ++ if ((request->_progress_callback = cb)) { ++ ZVAL_ADDREF(cb); ++ HTTP_CURL_OPT(CURLOPT_NOPROGRESS, 0); ++ HTTP_CURL_OPT(CURLOPT_PROGRESSDATA, request); ++ HTTP_CURL_OPT(CURLOPT_PROGRESSFUNCTION, http_curl_progress_callback); ++ } else { ++ HTTP_CURL_OPT(CURLOPT_NOPROGRESS, 1); ++ HTTP_CURL_OPT(CURLOPT_PROGRESSDATA, NULL); ++ HTTP_CURL_OPT(CURLOPT_PROGRESSFUNCTION, NULL); ++ } ++} ++ ++/* {{{ STATUS http_request_prepare(http_request *, HashTable *) */ ++PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *options) ++{ ++ zval *zoption; ++ zend_bool range_req = 0; ++ http_request_storage *storage; ++ ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ HTTP_CHECK_CURL_INIT(request->ch, http_curl_init(request), return FAILURE); ++ ++ if (!request->url) { ++ return FAILURE; ++ } ++ if (!(storage = http_request_storage_get(request->ch))) { ++ return FAILURE; ++ } ++ storage->errorbuffer[0] = '\0'; ++ /* set options */ ++ if (storage->url) { ++ pefree(storage->url, 1); ++ } ++ storage->url = pestrdup(request->url, 1); ++ HTTP_CURL_OPT(CURLOPT_URL, storage->url); ++ ++ /* progress callback */ ++ if ((zoption = http_request_option(request, options, "onprogress", -1))) { ++ http_request_set_progress_callback(request, zoption); ++ } ++ ++ /* proxy */ ++ if ((zoption = http_request_option(request, options, "proxyhost", IS_STRING))) { ++ HTTP_CURL_OPT(CURLOPT_PROXY, Z_STRVAL_P(zoption)); ++ /* type */ ++ if ((zoption = http_request_option(request, options, "proxytype", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_PROXYTYPE, Z_LVAL_P(zoption)); ++ } ++ /* port */ ++ if ((zoption = http_request_option(request, options, "proxyport", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_PROXYPORT, Z_LVAL_P(zoption)); ++ } ++ /* user:pass */ ++ if ((zoption = http_request_option(request, options, "proxyauth", IS_STRING)) && Z_STRLEN_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_PROXYUSERPWD, Z_STRVAL_P(zoption)); ++ } ++ /* auth method */ ++ if ((zoption = http_request_option(request, options, "proxyauthtype", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_PROXYAUTH, Z_LVAL_P(zoption)); ++ } ++ /* tunnel */ ++ if ((zoption = http_request_option(request, options, "proxytunnel", IS_BOOL)) && Z_BVAL_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_HTTPPROXYTUNNEL, 1L); ++ } ++ } ++#if HTTP_CURL_VERSION(7,19,4) ++ if ((zoption = http_request_option(request, options, "noproxy", IS_STRING))) { ++ HTTP_CURL_OPT(CURLOPT_NOPROXY, Z_STRVAL_P(zoption)); ++ } ++#endif ++ ++ /* dns */ ++ if ((zoption = http_request_option(request, options, "dns_cache_timeout", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_DNS_CACHE_TIMEOUT, Z_LVAL_P(zoption)); ++ } ++ if ((zoption = http_request_option(request, options, "ipresolve", IS_LONG)) && Z_LVAL_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_IPRESOLVE, Z_LVAL_P(zoption)); ++ } ++ ++ /* limits */ ++ if ((zoption = http_request_option(request, options, "low_speed_limit", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_LOW_SPEED_LIMIT, Z_LVAL_P(zoption)); ++ } ++ if ((zoption = http_request_option(request, options, "low_speed_time", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_LOW_SPEED_TIME, Z_LVAL_P(zoption)); ++ } ++#if HTTP_CURL_VERSION(7,15,5) ++ /* LSF weirdance ++ if ((zoption = http_request_option(request, options, "max_send_speed", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_MAX_SEND_SPEED_LARGE, (curl_off_t) Z_LVAL_P(zoption)); ++ } ++ if ((zoption = http_request_option(request, options, "max_recv_speed", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_MAX_RECV_SPEED_LARGE, (curl_off_t) Z_LVAL_P(zoption)); ++ } ++ */ ++#endif ++ /* crashes ++ if ((zoption = http_request_option(request, options, "maxconnects", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_MAXCONNECTS, Z_LVAL_P(zoption)); ++ } */ ++ if ((zoption = http_request_option(request, options, "fresh_connect", IS_BOOL)) && Z_BVAL_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_FRESH_CONNECT, 1L); ++ } ++ if ((zoption = http_request_option(request, options, "forbid_reuse", IS_BOOL)) && Z_BVAL_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_FORBID_REUSE, 1L); ++ } ++ ++ /* outgoing interface */ ++ if ((zoption = http_request_option(request, options, "interface", IS_STRING))) { ++ HTTP_CURL_OPT(CURLOPT_INTERFACE, Z_STRVAL_P(zoption)); ++ ++#if HTTP_CURL_VERSION(7,15,2) ++ if ((zoption = http_request_option(request, options, "portrange", IS_ARRAY))) { ++ zval **prs, **pre; ++ ++ zend_hash_internal_pointer_reset(Z_ARRVAL_P(zoption)); ++ if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(zoption), (void *) &prs)) { ++ zend_hash_move_forward(Z_ARRVAL_P(zoption)); ++ if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(zoption), (void *) &pre)) { ++ zval *prs_cpy = http_zsep(IS_LONG, *prs); ++ zval *pre_cpy = http_zsep(IS_LONG, *pre); ++ ++ if (Z_LVAL_P(prs_cpy) && Z_LVAL_P(pre_cpy)) { ++ HTTP_CURL_OPT(CURLOPT_LOCALPORT, MIN(Z_LVAL_P(prs_cpy), Z_LVAL_P(pre_cpy))); ++ HTTP_CURL_OPT(CURLOPT_LOCALPORTRANGE, labs(Z_LVAL_P(prs_cpy)-Z_LVAL_P(pre_cpy))+1L); ++ } ++ zval_ptr_dtor(&prs_cpy); ++ zval_ptr_dtor(&pre_cpy); ++ } ++ } ++ } ++#endif ++ } ++ ++ /* another port */ ++ if ((zoption = http_request_option(request, options, "port", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_PORT, Z_LVAL_P(zoption)); ++ } ++ ++ /* RFC4007 zone_id */ ++#if HTTP_CURL_VERSION(7,19,0) ++ if ((zoption = http_request_option(request, options, "address_scope", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_ADDRESS_SCOPE, Z_LVAL_P(zoption)); ++ } ++#endif ++ ++ /* auth */ ++ if ((zoption = http_request_option(request, options, "httpauth", IS_STRING)) && Z_STRLEN_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_USERPWD, Z_STRVAL_P(zoption)); ++ } ++ if ((zoption = http_request_option(request, options, "httpauthtype", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_HTTPAUTH, Z_LVAL_P(zoption)); ++ } ++ ++ /* redirects, defaults to 0 */ ++ if ((zoption = http_request_option(request, options, "redirect", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_FOLLOWLOCATION, Z_LVAL_P(zoption) ? 1L : 0L); ++ HTTP_CURL_OPT(CURLOPT_MAXREDIRS, Z_LVAL_P(zoption)); ++ if ((zoption = http_request_option(request, options, "unrestrictedauth", IS_BOOL))) { ++ HTTP_CURL_OPT(CURLOPT_UNRESTRICTED_AUTH, Z_LVAL_P(zoption)); ++ } ++#if HTTP_CURL_VERSION(7,17,1) ++ if ((zoption = http_request_option(request, options, "postredir", IS_BOOL))) { ++# if HTTP_CURL_VERSION(7,19,1) ++ HTTP_CURL_OPT(CURLOPT_POSTREDIR, Z_BVAL_P(zoption) ? 1L : 0L); ++# else ++ HTTP_CURL_OPT(CURLOPT_POST301, Z_BVAL_P(zoption) ? 1L : 0L); ++# endif ++ } ++#endif ++ } ++ ++ /* retries, defaults to 0 */ ++ if ((zoption = http_request_option(request, options, "retrycount", IS_LONG))) { ++ request->_retry.count = Z_LVAL_P(zoption); ++ if ((zoption = http_request_option(request, options, "retrydelay", IS_DOUBLE))) { ++ request->_retry.delay = Z_DVAL_P(zoption); ++ } else { ++ request->_retry.delay = 0; ++ } ++ } else { ++ request->_retry.count = 0; ++ } ++ ++ /* referer */ ++ if ((zoption = http_request_option(request, options, "referer", IS_STRING)) && Z_STRLEN_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_REFERER, Z_STRVAL_P(zoption)); ++ } ++ ++ /* useragent, default "PECL::HTTP/version (PHP/version)" */ ++ if ((zoption = http_request_option(request, options, "useragent", IS_STRING))) { ++ /* allow to send no user agent, not even default one */ ++ if (Z_STRLEN_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_USERAGENT, Z_STRVAL_P(zoption)); ++ } else { ++ HTTP_CURL_OPT(CURLOPT_USERAGENT, NULL); ++ } ++ } ++ ++ /* resume */ ++ if ((zoption = http_request_option(request, options, "resume", IS_LONG)) && (Z_LVAL_P(zoption) > 0)) { ++ range_req = 1; ++ HTTP_CURL_OPT(CURLOPT_RESUME_FROM, Z_LVAL_P(zoption)); ++ } ++ /* or range of kind array(array(0,499), array(100,1499)) */ ++ else if ((zoption = http_request_option(request, options, "range", IS_ARRAY)) && zend_hash_num_elements(Z_ARRVAL_P(zoption))) { ++ HashPosition pos1, pos2; ++ zval **rr, **rb, **re; ++ phpstr rs; ++ ++ phpstr_init(&rs); ++ FOREACH_VAL(pos1, zoption, rr) { ++ if (Z_TYPE_PP(rr) == IS_ARRAY) { ++ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(rr), &pos2); ++ if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(rr), (void *) &rb, &pos2)) { ++ zend_hash_move_forward_ex(Z_ARRVAL_PP(rr), &pos2); ++ if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(rr), (void *) &re, &pos2)) { ++ if ( ((Z_TYPE_PP(rb) == IS_LONG) || ((Z_TYPE_PP(rb) == IS_STRING) && is_numeric_string(Z_STRVAL_PP(rb), Z_STRLEN_PP(rb), NULL, NULL, 1))) && ++ ((Z_TYPE_PP(re) == IS_LONG) || ((Z_TYPE_PP(re) == IS_STRING) && is_numeric_string(Z_STRVAL_PP(re), Z_STRLEN_PP(re), NULL, NULL, 1)))) { ++ zval *rbl = http_zsep(IS_LONG, *rb); ++ zval *rel = http_zsep(IS_LONG, *re); ++ ++ if ((Z_LVAL_P(rbl) >= 0) && (Z_LVAL_P(rel) >= 0)) { ++ phpstr_appendf(&rs, "%ld-%ld,", Z_LVAL_P(rbl), Z_LVAL_P(rel)); ++ } ++ zval_ptr_dtor(&rbl); ++ zval_ptr_dtor(&rel); ++ } ++ } ++ } ++ } ++ } ++ ++ if (PHPSTR_LEN(&rs)) { ++ zval *cached_range; ++ ++ /* ditch last comma */ ++ PHPSTR_VAL(&rs)[PHPSTR_LEN(&rs)-- -1] = '\0'; ++ /* cache string */ ++ MAKE_STD_ZVAL(cached_range); ++ ZVAL_STRINGL(cached_range, PHPSTR_VAL(&rs), PHPSTR_LEN(&rs), 0); ++ HTTP_CURL_OPT(CURLOPT_RANGE, Z_STRVAL_P(http_request_option_cache(request, "range", cached_range))); ++ zval_ptr_dtor(&cached_range); ++ } ++ } ++ ++ /* additional headers, array('name' => 'value') */ ++ if (request->_cache.headers) { ++ curl_slist_free_all(request->_cache.headers); ++ request->_cache.headers = NULL; ++ } ++ if ((zoption = http_request_option(request, options, "headers", IS_ARRAY))) { ++ HashKey header_key = initHashKey(0); ++ zval **header_val; ++ HashPosition pos; ++ phpstr header; ++ ++ phpstr_init(&header); ++ FOREACH_KEYVAL(pos, zoption, header_key, header_val) { ++ if (header_key.type == HASH_KEY_IS_STRING) { ++ zval *header_cpy = http_zsep(IS_STRING, *header_val); ++ ++ if (!strcasecmp(header_key.str, "range")) { ++ range_req = 1; ++ } ++ ++ phpstr_appendf(&header, "%s: %s", header_key.str, Z_STRVAL_P(header_cpy)); ++ phpstr_fix(&header); ++ request->_cache.headers = curl_slist_append(request->_cache.headers, PHPSTR_VAL(&header)); ++ phpstr_reset(&header); ++ ++ zval_ptr_dtor(&header_cpy); ++ } ++ } ++ phpstr_dtor(&header); ++ } ++ /* etag */ ++ if ((zoption = http_request_option(request, options, "etag", IS_STRING)) && Z_STRLEN_P(zoption)) { ++ zend_bool is_quoted = !((Z_STRVAL_P(zoption)[0] != '"') || (Z_STRVAL_P(zoption)[Z_STRLEN_P(zoption)-1] != '"')); ++ phpstr header; ++ ++ phpstr_init(&header); ++ phpstr_appendf(&header, is_quoted?"%s: %s":"%s: \"%s\"", range_req?"If-Match":"If-None-Match", Z_STRVAL_P(zoption)); ++ phpstr_fix(&header); ++ request->_cache.headers = curl_slist_append(request->_cache.headers, PHPSTR_VAL(&header)); ++ phpstr_dtor(&header); ++ } ++ /* compression */ ++ if ((zoption = http_request_option(request, options, "compress", IS_BOOL)) && Z_LVAL_P(zoption)) { ++ request->_cache.headers = curl_slist_append(request->_cache.headers, "Accept-Encoding: gzip;q=1.0,deflate;q=0.5"); ++ } ++ HTTP_CURL_OPT(CURLOPT_HTTPHEADER, request->_cache.headers); ++ ++ /* lastmodified */ ++ if ((zoption = http_request_option(request, options, "lastmodified", IS_LONG))) { ++ if (Z_LVAL_P(zoption)) { ++ if (Z_LVAL_P(zoption) > 0) { ++ HTTP_CURL_OPT(CURLOPT_TIMEVALUE, Z_LVAL_P(zoption)); ++ } else { ++ HTTP_CURL_OPT(CURLOPT_TIMEVALUE, (long) HTTP_G->request.time + Z_LVAL_P(zoption)); ++ } ++ HTTP_CURL_OPT(CURLOPT_TIMECONDITION, (long) (range_req ? CURL_TIMECOND_IFUNMODSINCE : CURL_TIMECOND_IFMODSINCE)); ++ } else { ++ HTTP_CURL_OPT(CURLOPT_TIMECONDITION, CURL_TIMECOND_NONE); ++ } ++ } ++ ++ /* cookies, array('name' => 'value') */ ++ if ((zoption = http_request_option(request, options, "cookies", IS_ARRAY))) { ++ phpstr_dtor(&request->_cache.cookies); ++ if (zend_hash_num_elements(Z_ARRVAL_P(zoption))) { ++ zval *urlenc_cookies = NULL; ++ /* check whether cookies should not be urlencoded; default is to urlencode them */ ++ if ((!(urlenc_cookies = http_request_option(request, options, "encodecookies", IS_BOOL))) || Z_BVAL_P(urlenc_cookies)) { ++ if (SUCCESS == http_urlencode_hash_recursive(HASH_OF(zoption), &request->_cache.cookies, "; ", lenof("; "), NULL, 0)) { ++ phpstr_fix(&request->_cache.cookies); ++ HTTP_CURL_OPT(CURLOPT_COOKIE, request->_cache.cookies.data); ++ } ++ } else { ++ HashPosition pos; ++ HashKey cookie_key = initHashKey(0); ++ zval **cookie_val; ++ ++ FOREACH_KEYVAL(pos, zoption, cookie_key, cookie_val) { ++ if (cookie_key.type == HASH_KEY_IS_STRING) { ++ zval *val = http_zsep(IS_STRING, *cookie_val); ++ phpstr_appendf(&request->_cache.cookies, "%s=%s; ", cookie_key.str, Z_STRVAL_P(val)); ++ zval_ptr_dtor(&val); ++ } ++ } ++ ++ phpstr_fix(&request->_cache.cookies); ++ if (PHPSTR_LEN(&request->_cache.cookies)) { ++ HTTP_CURL_OPT(CURLOPT_COOKIE, PHPSTR_VAL(&request->_cache.cookies)); ++ } ++ } ++ } ++ } ++ ++ /* don't load session cookies from cookiestore */ ++ if ((zoption = http_request_option(request, options, "cookiesession", IS_BOOL)) && Z_BVAL_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_COOKIESESSION, 1L); ++ } ++ ++ /* cookiestore, read initial cookies from that file and store cookies back into that file */ ++ if ((zoption = http_request_option(request, options, "cookiestore", IS_STRING))) { ++ if (Z_STRLEN_P(zoption)) { ++ HTTP_CHECK_OPEN_BASEDIR(Z_STRVAL_P(zoption), return FAILURE); ++ } ++ if (storage->cookiestore) { ++ pefree(storage->cookiestore, 1); ++ } ++ storage->cookiestore = pestrndup(Z_STRVAL_P(zoption), Z_STRLEN_P(zoption), 1); ++ HTTP_CURL_OPT(CURLOPT_COOKIEFILE, storage->cookiestore); ++ HTTP_CURL_OPT(CURLOPT_COOKIEJAR, storage->cookiestore); ++ } ++ ++ /* maxfilesize */ ++ if ((zoption = http_request_option(request, options, "maxfilesize", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_MAXFILESIZE, Z_LVAL_P(zoption)); ++ } ++ ++ /* http protocol */ ++ if ((zoption = http_request_option(request, options, "protocol", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_HTTP_VERSION, Z_LVAL_P(zoption)); ++ } ++ ++#if HTTP_CURL_VERSION(7,16,2) ++ /* timeout, defaults to 0 */ ++ if ((zoption = http_request_option(request, options, "timeout", IS_DOUBLE))) { ++ HTTP_CURL_OPT(CURLOPT_TIMEOUT_MS, (long)(Z_DVAL_P(zoption)*1000)); ++ } ++ /* connecttimeout, defaults to 0 */ ++ if ((zoption = http_request_option(request, options, "connecttimeout", IS_DOUBLE))) { ++ HTTP_CURL_OPT(CURLOPT_CONNECTTIMEOUT_MS, (long)(Z_DVAL_P(zoption)*1000)); ++ } ++#else ++ /* timeout, defaults to 0 */ ++ if ((zoption = http_request_option(request, options, "timeout", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_TIMEOUT, Z_LVAL_P(zoption)); ++ } ++ /* connecttimeout, defaults to 0 */ ++ if ((zoption = http_request_option(request, options, "connecttimeout", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_CONNECTTIMEOUT, Z_LVAL_P(zoption)); ++ } ++#endif ++ ++ /* ssl */ ++ if ((zoption = http_request_option(request, options, "ssl", IS_ARRAY))) { ++ HashKey key = initHashKey(0); ++ zval **param; ++ HashPosition pos; ++ ++ FOREACH_KEYVAL(pos, zoption, key, param) { ++ if (key.type == HASH_KEY_IS_STRING) { ++ HTTP_CURL_OPT_STRING(CURLOPT_SSLCERT, 0, 1); ++ HTTP_CURL_OPT_STRING(CURLOPT_SSLCERTTYPE, 0, 0); ++ HTTP_CURL_OPT_STRING(CURLOPT_SSLCERTPASSWD, 0, 0); ++ ++ HTTP_CURL_OPT_STRING(CURLOPT_SSLKEY, 0, 0); ++ HTTP_CURL_OPT_STRING(CURLOPT_SSLKEYTYPE, 0, 0); ++ HTTP_CURL_OPT_STRING(CURLOPT_SSLKEYPASSWD, 0, 0); ++ ++ HTTP_CURL_OPT_STRING(CURLOPT_SSLENGINE, 0, 0); ++ HTTP_CURL_OPT_LONG(CURLOPT_SSLVERSION, 0); ++ ++ HTTP_CURL_OPT_LONG(CURLOPT_SSL_VERIFYPEER, 1); ++ HTTP_CURL_OPT_LONG(CURLOPT_SSL_VERIFYHOST, 1); ++ HTTP_CURL_OPT_STRING(CURLOPT_SSL_CIPHER_LIST, 1, 0); ++ ++ HTTP_CURL_OPT_STRING(CURLOPT_CAINFO, -3, 1); ++ HTTP_CURL_OPT_STRING(CURLOPT_CAPATH, -3, 1); ++ HTTP_CURL_OPT_STRING(CURLOPT_RANDOM_FILE, -3, 1); ++ HTTP_CURL_OPT_STRING(CURLOPT_EGDSOCKET, -3, 1); ++#if HTTP_CURL_VERSION(7,19,0) ++ HTTP_CURL_OPT_STRING(CURLOPT_ISSUERCERT, -3, 1); ++ #if defined(HTTP_HAVE_OPENSSL) ++ HTTP_CURL_OPT_STRING(CURLOPT_CRLFILE, -3, 1); ++ #endif ++#endif ++#if HTTP_CURL_VERSION(7,19,1) && defined(HTTP_HAVE_OPENSSL) ++ HTTP_CURL_OPT_LONG(CURLOPT_CERTINFO, -3); ++#endif ++ } ++ } ++ } ++ ++ /* request method */ ++ switch (request->meth) { ++ case HTTP_GET: ++ HTTP_CURL_OPT(CURLOPT_HTTPGET, 1L); ++ break; ++ ++ case HTTP_HEAD: ++ HTTP_CURL_OPT(CURLOPT_NOBODY, 1L); ++ break; ++ ++ case HTTP_POST: ++ HTTP_CURL_OPT(CURLOPT_POST, 1L); ++ break; ++ ++ case HTTP_PUT: ++ HTTP_CURL_OPT(CURLOPT_UPLOAD, 1L); ++ break; ++ ++ default: ++ if (http_request_method_exists(0, request->meth, NULL)) { ++ HTTP_CURL_OPT(CURLOPT_CUSTOMREQUEST, http_request_method_name(request->meth)); ++ } else { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Unsupported request method: %d (%s)", request->meth, request->url); ++ return FAILURE; ++ } ++ break; ++ } ++ ++ /* attach request body */ ++ if (request->body && (request->meth != HTTP_GET) && (request->meth != HTTP_HEAD) && (request->meth != HTTP_OPTIONS)) { ++ switch (request->body->type) { ++ case HTTP_REQUEST_BODY_EMPTY: ++ /* nothing */ ++ break; ++ ++ case HTTP_REQUEST_BODY_CURLPOST: ++ HTTP_CURL_OPT(CURLOPT_HTTPPOST, (struct curl_httppost *) request->body->data); ++ break; ++ ++ case HTTP_REQUEST_BODY_CSTRING: ++ if (request->meth != HTTP_PUT) { ++ HTTP_CURL_OPT(CURLOPT_POSTFIELDS, request->body->data); ++ HTTP_CURL_OPT(CURLOPT_POSTFIELDSIZE, request->body->size); ++ break; ++ } ++ /* fallthrough, PUT/UPLOAD _needs_ READDATA */ ++ case HTTP_REQUEST_BODY_UPLOADFILE: ++ HTTP_CURL_OPT(CURLOPT_IOCTLDATA, request); ++ HTTP_CURL_OPT(CURLOPT_READDATA, request); ++ HTTP_CURL_OPT(CURLOPT_INFILESIZE, request->body->size); ++ break; ++ ++ default: ++ /* shouldn't ever happen */ ++ http_error_ex(HE_ERROR, 0, "Unknown request body type: %d (%s)", request->body->type, request->url); ++ return FAILURE; ++ } ++ } ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ void http_request_exec(http_request *) */ ++PHP_HTTP_API void _http_request_exec(http_request *request) ++{ ++ uint tries = 0; ++ CURLcode result; ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++retry: ++ if (CURLE_OK != (result = curl_easy_perform(request->ch))) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "%s; %s (%s)", curl_easy_strerror(result), http_request_storage_get(request->ch)->errorbuffer, request->url); ++#ifdef ZEND_ENGINE_2 ++ if ((HTTP_G->only_exceptions || GLOBAL_ERROR_HANDLING == EH_THROW) && EG(exception)) { ++ add_property_long(EG(exception), "curlCode", result); ++ } ++#endif ++ ++ if (request->_retry.count > tries++) { ++ switch (result) { ++ case CURLE_COULDNT_RESOLVE_PROXY: ++ case CURLE_COULDNT_RESOLVE_HOST: ++ case CURLE_COULDNT_CONNECT: ++ case CURLE_WRITE_ERROR: ++ case CURLE_READ_ERROR: ++ case CURLE_OPERATION_TIMEDOUT: ++ case CURLE_SSL_CONNECT_ERROR: ++ case CURLE_GOT_NOTHING: ++ case CURLE_SSL_ENGINE_SETFAILED: ++ case CURLE_SEND_ERROR: ++ case CURLE_RECV_ERROR: ++ case CURLE_SSL_ENGINE_INITFAILED: ++ case CURLE_LOGIN_DENIED: ++ if (request->_retry.delay >= HTTP_DIFFSEC) { ++ http_sleep(request->_retry.delay); ++ } ++ goto retry; ++ default: ++ break; ++ } ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ static size_t http_curl_read_callback(void *, size_t, size_t, void *) */ ++static size_t http_curl_read_callback(void *data, size_t len, size_t n, void *ctx) ++{ ++ http_request *request = (http_request *) ctx; ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ if (request->body) { ++ switch (request->body->type) { ++ case HTTP_REQUEST_BODY_CSTRING: ++ { ++ size_t out = MIN(len * n, request->body->size - request->body->priv); ++ ++ if (out) { ++ memcpy(data, ((char *) request->body->data) + request->body->priv, out); ++ request->body->priv += out; ++ return out; ++ } ++ break; ++ } ++ ++ case HTTP_REQUEST_BODY_UPLOADFILE: ++ return php_stream_read((php_stream *) request->body->data, data, len * n); ++ } ++ } ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ static int http_curl_progress_callback(void *, double, double, double, double) */ ++static int http_curl_progress_callback(void *ctx, double dltotal, double dlnow, double ultotal, double ulnow) ++{ ++ zval *param, retval; ++ http_request *request = (http_request *) ctx; ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ INIT_PZVAL(&retval); ++ ZVAL_NULL(&retval); ++ ++ MAKE_STD_ZVAL(param); ++ array_init(param); ++ add_assoc_double(param, "dltotal", dltotal); ++ add_assoc_double(param, "dlnow", dlnow); ++ add_assoc_double(param, "ultotal", ultotal); ++ add_assoc_double(param, "ulnow", ulnow); ++ ++ with_error_handling(EH_NORMAL, NULL) { ++ request->_in_progress_cb = 1; ++ call_user_function(EG(function_table), NULL, request->_progress_callback, &retval, 1, ¶m TSRMLS_CC); ++ request->_in_progress_cb = 0; ++ } end_error_handling(); ++ ++ zval_ptr_dtor(¶m); ++ zval_dtor(&retval); ++ ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ static curlioerr http_curl_ioctl_callback(CURL *, curliocmd, void *) */ ++static curlioerr http_curl_ioctl_callback(CURL *ch, curliocmd cmd, void *ctx) ++{ ++ http_request *request = (http_request *) ctx; ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ if (cmd != CURLIOCMD_RESTARTREAD) { ++ return CURLIOE_UNKNOWNCMD; ++ } ++ ++ if (request->body) { ++ switch (request->body->type) { ++ case HTTP_REQUEST_BODY_CSTRING: ++ request->body->priv = 0; ++ return CURLIOE_OK; ++ break; ++ ++ case HTTP_REQUEST_BODY_UPLOADFILE: ++ if (SUCCESS == php_stream_rewind((php_stream *) request->body->data)) { ++ return CURLIOE_OK; ++ } ++ break; ++ } ++ } ++ ++ return CURLIOE_FAILRESTART; ++} ++/* }}} */ ++ ++/* {{{ static int http_curl_raw_callback(CURL *, curl_infotype, char *, size_t, void *) */ ++static int http_curl_raw_callback(CURL *ch, curl_infotype type, char *data, size_t length, void *ctx) ++{ ++ http_request *request = (http_request *) ctx; ++ ++#define EMPTY_HEADER(d, l) (!l || (l == 1 && d[0] == '\n') || (l == 2 && d[0] == '\r' && d[1] == '\n')) ++ switch (type) { ++ case CURLINFO_DATA_IN: ++ if (request->conv.last_type == CURLINFO_HEADER_IN) { ++ phpstr_appends(&request->conv.response, HTTP_CRLF); ++ } ++ phpstr_append(&request->conv.response, data, length); ++ break; ++ case CURLINFO_HEADER_IN: ++ if (!EMPTY_HEADER(data, length)) { ++ phpstr_append(&request->conv.response, data, length); ++ } ++ break; ++ case CURLINFO_DATA_OUT: ++ case CURLINFO_HEADER_OUT: ++ phpstr_append(&request->conv.request, data, length); ++ break; ++ default: ++ break; ++ } ++ ++#if 0 ++ { ++ const char _sym[] = "><><><"; ++ if (type) { ++ for (fprintf(stderr, "%c ", _sym[type-1]); length--; data++) { ++ fprintf(stderr, HTTP_IS_CTYPE(print, *data)?"%c":"\\x%02X", (int) *data); ++ if (*data == '\n' && length) { ++ fprintf(stderr, "\n%c ", _sym[type-1]); ++ } ++ } ++ fprintf(stderr, "\n"); ++ } else { ++ fprintf(stderr, "# %s", data); ++ } ++ } ++#endif ++ ++ if (type) { ++ request->conv.last_type = type; ++ } ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ static inline zval *http_request_option(http_request *, HashTable *, char *, size_t, int) */ ++static inline zval *_http_request_option_ex(http_request *r, HashTable *options, char *key, size_t keylen, int type TSRMLS_DC) ++{ ++ if (options) { ++ zval **zoption; ++ ulong h = zend_hash_func(key, keylen); ++ ++ if (SUCCESS == zend_hash_quick_find(options, key, keylen, h, (void *) &zoption)) { ++ zval *option, *cached; ++ ++ option = http_zsep(type, *zoption); ++ cached = http_request_option_cache_ex(r, key, keylen, h, option); ++ ++ zval_ptr_dtor(&option); ++ return cached; ++ } ++ } ++ ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ static inline zval *http_request_option_cache(http_request *, char *key, zval *) */ ++static inline zval *_http_request_option_cache_ex(http_request *r, char *key, size_t keylen, ulong h, zval *opt TSRMLS_DC) ++{ ++ ZVAL_ADDREF(opt); ++ ++ if (h) { ++ zend_hash_quick_update(&r->_cache.options, key, keylen, h, &opt, sizeof(zval *), NULL); ++ } else { ++ zend_hash_update(&r->_cache.options, key, keylen, &opt, sizeof(zval *), NULL); ++ } ++ ++ return opt; ++} ++/* }}} */ ++ ++/* {{{ static inline int http_request_cookies_enabled(http_request *) */ ++static inline int _http_request_cookies_enabled(http_request *request) { ++ http_request_storage *st; ++ ++ if (request->ch && (st = http_request_storage_get(request->ch)) && st->cookiestore) { ++ /* cookies are enabled */ ++ return 1; ++ } ++ return 0; ++} ++/* }}} */ ++ ++#endif /* HTTP_HAVE_CURL */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_request_body_api.c +@@ -0,0 +1,332 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_request_body_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#ifdef HTTP_HAVE_CURL ++ ++#include "php_http_api.h" ++#include "php_http_url_api.h" ++#include "php_http_request_body_api.h" ++ ++/* {{{ */ ++typedef struct curl_httppost *post_data[2]; ++static STATUS recursive_fields(post_data http_post_data, HashTable *fields, const char *prefix TSRMLS_DC); ++static STATUS recursive_files(post_data http_post_data, HashTable *files, const char *prefix TSRMLS_DC); ++/* }}} */ ++ ++/* {{{ http_request_body *http_request_body_new() */ ++PHP_HTTP_API http_request_body *_http_request_body_init_ex(http_request_body *body, int type, void *data, size_t size, zend_bool free ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ if (!body) { ++ body = emalloc_rel(sizeof(http_request_body)); ++ } ++ ++ body->type = type; ++ body->free = free; ++ body->priv = 0; ++ body->data = data; ++ body->size = size; ++ ++ return body; ++} ++/* }}} */ ++ ++/* {{{ http_request_body *http_request_body_fill(http_request_body *body, HashTable *, HashTable *) */ ++PHP_HTTP_API http_request_body *_http_request_body_fill(http_request_body *body, HashTable *fields, HashTable *files ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ if (files && (zend_hash_num_elements(files) > 0)) { ++ struct curl_httppost *http_post_data[2] = {NULL, NULL}; ++ ++ if (fields && SUCCESS != recursive_fields(http_post_data, fields, NULL TSRMLS_CC)) { ++ return NULL; ++ } ++ if (SUCCESS != recursive_files(http_post_data, files, NULL TSRMLS_CC)) { ++ return NULL; ++ } ++ return http_request_body_init_rel(body, HTTP_REQUEST_BODY_CURLPOST, http_post_data[0], 0, 1); ++ } else if (fields) { ++ char *encoded; ++ size_t encoded_len; ++ ++ if (SUCCESS != http_urlencode_hash_ex(fields, 1, NULL, 0, &encoded, &encoded_len)) { ++ http_error(HE_WARNING, HTTP_E_ENCODING, "Could not encode post data"); ++ return NULL; ++ } ++ ++ return http_request_body_init_rel(body, HTTP_REQUEST_BODY_CSTRING, encoded, encoded_len, 1); ++ } else { ++ return http_request_body_init_rel(body, HTTP_REQUEST_BODY_CSTRING, estrndup("", 0), 0, 1); ++ } ++} ++ ++/* STATUS http_request_body_encode(http_request_body *, char**, size_t *) */ ++PHP_HTTP_API STATUS _http_request_body_encode(http_request_body *body, char **buf, size_t *len TSRMLS_DC) ++{ ++ switch (body->type) { ++ case HTTP_REQUEST_BODY_CURLPOST: ++ { ++#ifdef HAVE_CURL_FORMGET ++ phpstr str; ++ ++ phpstr_init_ex(&str, 0x8000, 0); ++ if (curl_formget(body->data, &str, (curl_formget_callback) phpstr_append)) { ++ phpstr_dtor(&str); ++ } else { ++ phpstr_fix(&str); ++ *buf = PHPSTR_VAL(&str); ++ *len = PHPSTR_LEN(&str); ++ return SUCCESS; ++ } ++#endif ++ break; ++ } ++ ++ case HTTP_REQUEST_BODY_CSTRING: ++ *buf = estrndup(body->data, *len = body->size); ++ return SUCCESS; ++ ++ default: ++ break; ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ void http_request_body_dtor(http_request_body *) */ ++PHP_HTTP_API void _http_request_body_dtor(http_request_body *body TSRMLS_DC) ++{ ++ if (body) { ++ if (body->free) { ++ switch (body->type) { ++ case HTTP_REQUEST_BODY_CSTRING: ++ if (body->data) { ++ efree(body->data); ++ } ++ break; ++ ++ case HTTP_REQUEST_BODY_CURLPOST: ++ curl_formfree(body->data); ++ break; ++ ++ case HTTP_REQUEST_BODY_UPLOADFILE: ++ php_stream_close(body->data); ++ break; ++ } ++ } ++ memset(body, 0, sizeof(http_request_body)); ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_request_body_free(http_request_body *) */ ++PHP_HTTP_API void _http_request_body_free(http_request_body **body TSRMLS_DC) ++{ ++ if (*body) { ++ http_request_body_dtor(*body); ++ efree(*body); ++ *body = NULL; ++ } ++} ++/* }}} */ ++ ++static inline char *format_key(uint type, char *str, ulong num, const char *prefix, int numeric_key_for_empty_prefix) { ++ char *new_key = NULL; ++ ++ if (prefix && *prefix) { ++ if (type == HASH_KEY_IS_STRING) { ++ spprintf(&new_key, 0, "%s[%s]", prefix, str); ++ } else { ++ spprintf(&new_key, 0, "%s[%lu]", prefix, num); ++ } ++ } else if (type == HASH_KEY_IS_STRING) { ++ new_key = estrdup(str); ++ } else if (numeric_key_for_empty_prefix) { ++ spprintf(&new_key, 0, "%lu", num); ++ } ++ ++ return new_key; ++} ++ ++/* {{{ static STATUS recursive_fields(post_data d, HashTable *f, const char *p TSRMLS_DC) */ ++static STATUS recursive_fields(post_data http_post_data, HashTable *fields, const char *prefix TSRMLS_DC) { ++ HashKey key = initHashKey(0); ++ zval **data_ptr; ++ HashPosition pos; ++ char *new_key = NULL; ++ CURLcode err = 0; ++ ++ if (fields && !fields->nApplyCount) { ++ FOREACH_HASH_KEYVAL(pos, fields, key, data_ptr) { ++ if (key.type != HASH_KEY_IS_STRING || *key.str) { ++ new_key = format_key(key.type, key.str, key.num, prefix, 1); ++ ++ switch (Z_TYPE_PP(data_ptr)) { ++ case IS_ARRAY: ++ case IS_OBJECT: { ++ STATUS status; ++ ++ ++fields->nApplyCount; ++ status = recursive_fields(http_post_data, HASH_OF(*data_ptr), new_key TSRMLS_CC); ++ --fields->nApplyCount; ++ ++ if (SUCCESS != status) { ++ goto error; ++ } ++ break; ++ } ++ ++ default: { ++ zval *data = http_zsep(IS_STRING, *data_ptr); ++ ++ err = curl_formadd(&http_post_data[0], &http_post_data[1], ++ CURLFORM_COPYNAME, new_key, ++ CURLFORM_COPYCONTENTS, Z_STRVAL_P(data), ++ CURLFORM_CONTENTSLENGTH, (long) Z_STRLEN_P(data), ++ CURLFORM_END ++ ); ++ ++ zval_ptr_dtor(&data); ++ ++ if (CURLE_OK != err) { ++ goto error; ++ } ++ break; ++ } ++ } ++ STR_FREE(new_key); ++ } ++ } ++ } ++ ++ return SUCCESS; ++ ++error: ++ if (new_key) { ++ efree(new_key); ++ } ++ if (http_post_data[0]) { ++ curl_formfree(http_post_data[0]); ++ } ++ if (err) { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Could not encode post fields: %s", curl_easy_strerror(err)); ++ } else { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Could not encode post fields: unknown error"); ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ static STATUS recursive_files(post_data d, HashTable *f, const char *p TSRMLS_DC) */ ++static STATUS recursive_files(post_data http_post_data, HashTable *files, const char *prefix TSRMLS_DC) { ++ HashKey key = initHashKey(0); ++ zval **data_ptr; ++ HashPosition pos; ++ char *new_key = NULL; ++ CURLcode err = 0; ++ ++ if (files && !files->nApplyCount) { ++ FOREACH_HASH_KEYVAL(pos, files, key, data_ptr) { ++ zval **file_ptr, **type_ptr, **name_ptr; ++ ++ if (key.type != HASH_KEY_IS_STRING || *key.str) { ++ new_key = format_key(key.type, key.str, key.num, prefix, 0); ++ ++ if (Z_TYPE_PP(data_ptr) != IS_ARRAY && Z_TYPE_PP(data_ptr) != IS_OBJECT) { ++ if (new_key || key.type == HASH_KEY_IS_STRING) { ++ http_error_ex(HE_NOTICE, HTTP_E_INVALID_PARAM, "Unrecognized type of post file array entry '%s'", new_key ? new_key : key.str); ++ } else { ++ http_error_ex(HE_NOTICE, HTTP_E_INVALID_PARAM, "Unrecognized type of post file array entry '%lu'", key.num); ++ } ++ } else if ( SUCCESS != zend_hash_find(HASH_OF(*data_ptr), "name", sizeof("name"), (void *) &name_ptr) || ++ SUCCESS != zend_hash_find(HASH_OF(*data_ptr), "type", sizeof("type"), (void *) &type_ptr) || ++ SUCCESS != zend_hash_find(HASH_OF(*data_ptr), "file", sizeof("file"), (void *) &file_ptr)) { ++ STATUS status; ++ ++ ++files->nApplyCount; ++ status = recursive_files(http_post_data, HASH_OF(*data_ptr), new_key TSRMLS_CC); ++ --files->nApplyCount; ++ ++ if (SUCCESS != status) { ++ goto error; ++ } ++ } else { ++ const char *path; ++ zval *file = http_zsep(IS_STRING, *file_ptr); ++ zval *type = http_zsep(IS_STRING, *type_ptr); ++ zval *name = http_zsep(IS_STRING, *name_ptr); ++ ++ HTTP_CHECK_OPEN_BASEDIR(Z_STRVAL_P(file), goto error); ++ ++ /* this is blatant but should be sufficient for most cases */ ++ if (strncasecmp(Z_STRVAL_P(file), "file://", lenof("file://"))) { ++ path = Z_STRVAL_P(file); ++ } else { ++ path = Z_STRVAL_P(file) + lenof("file://"); ++ } ++ ++ if (new_key) { ++ char *tmp_key = format_key(HASH_KEY_IS_STRING, Z_STRVAL_P(name), 0, new_key, 0); ++ STR_SET(new_key, tmp_key); ++ } ++ ++ err = curl_formadd(&http_post_data[0], &http_post_data[1], ++ CURLFORM_COPYNAME, new_key ? new_key : Z_STRVAL_P(name), ++ CURLFORM_FILE, path, ++ CURLFORM_CONTENTTYPE, Z_STRVAL_P(type), ++ CURLFORM_END ++ ); ++ ++ zval_ptr_dtor(&file); ++ zval_ptr_dtor(&type); ++ zval_ptr_dtor(&name); ++ ++ if (CURLE_OK != err) { ++ goto error; ++ } ++ } ++ STR_FREE(new_key); ++ } ++ } ++ } ++ ++ return SUCCESS; ++ ++error: ++ if (new_key) { ++ efree(new_key); ++ } ++ if (http_post_data[0]) { ++ curl_formfree(http_post_data[0]); ++ } ++ if (err) { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Could not encode post files: %s", curl_easy_strerror(err)); ++ } else { ++ http_error(HE_WARNING, HTTP_E_ENCODING, "Could not encode post files: unknown error"); ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++#endif /* HTTP_HAVE_CURL */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/http_request_datashare_api.c +@@ -0,0 +1,288 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_request_datashare_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) ++ ++#include "php_http_api.h" ++#include "php_http_persistent_handle_api.h" ++#include "php_http_request_datashare_api.h" ++#include "php_http_request_api.h" ++#include "php_http_request_object.h" ++ ++static HashTable http_request_datashare_options; ++static http_request_datashare http_request_datashare_global; ++static int http_request_datashare_compare_handles(void *h1, void *h2); ++static void http_request_datashare_destroy_handles(void *el); ++#ifdef ZTS ++static void *http_request_datashare_locks_init(void); ++static void http_request_datashare_locks_dtor(void *l); ++static void http_request_datashare_lock_func(CURL *handle, curl_lock_data data, curl_lock_access locktype, void *userptr); ++static void http_request_datashare_unlock_func(CURL *handle, curl_lock_data data, void *userptr); ++#endif ++ ++http_request_datashare *_http_request_datashare_global_get(void) ++{ ++ return &http_request_datashare_global; ++} ++ ++PHP_MINIT_FUNCTION(http_request_datashare) ++{ ++ curl_lock_data val; ++ ++ if (SUCCESS != http_persistent_handle_provide("http_request_datashare", curl_share_init, (http_persistent_handle_dtor) curl_share_cleanup, NULL)) { ++ return FAILURE; ++ } ++#ifdef ZTS ++ if (SUCCESS != http_persistent_handle_provide("http_request_datashare_lock", http_request_datashare_locks_init, http_request_datashare_locks_dtor, NULL)) { ++ return FAILURE; ++ } ++#endif ++ ++ if (!http_request_datashare_init_ex(&http_request_datashare_global, 1)) { ++ return FAILURE; ++ } ++ ++ zend_hash_init(&http_request_datashare_options, 4, NULL, NULL, 1); ++#define ADD_DATASHARE_OPT(name, opt) \ ++ val = opt; \ ++ zend_hash_add(&http_request_datashare_options, name, sizeof(name), &val, sizeof(curl_lock_data), NULL) ++ ADD_DATASHARE_OPT("cookie", CURL_LOCK_DATA_COOKIE); ++ ADD_DATASHARE_OPT("dns", CURL_LOCK_DATA_DNS); ++ ADD_DATASHARE_OPT("ssl", CURL_LOCK_DATA_SSL_SESSION); ++ ADD_DATASHARE_OPT("connect", CURL_LOCK_DATA_CONNECT); ++ ++ return SUCCESS; ++} ++ ++PHP_MSHUTDOWN_FUNCTION(http_request_datashare) ++{ ++ http_request_datashare_dtor(&http_request_datashare_global); ++ zend_hash_destroy(&http_request_datashare_options); ++ ++ return SUCCESS; ++} ++ ++PHP_RINIT_FUNCTION(http_request_datashare) ++{ ++ zend_llist_init(&HTTP_G->request.datashare.handles, sizeof(zval *), http_request_datashare_destroy_handles, 0); ++ ++ return SUCCESS; ++} ++ ++PHP_RSHUTDOWN_FUNCTION(http_request_datashare) ++{ ++ zend_llist_destroy(&HTTP_G->request.datashare.handles); ++ ++ return SUCCESS; ++} ++ ++PHP_HTTP_API http_request_datashare *_http_request_datashare_init_ex(http_request_datashare *share, zend_bool persistent TSRMLS_DC) ++{ ++ zend_bool free_share; ++ ++ if ((free_share = !share)) { ++ share = pemalloc(sizeof(http_request_datashare), persistent); ++ } ++ memset(share, 0, sizeof(http_request_datashare)); ++ ++ if (SUCCESS != http_persistent_handle_acquire("http_request_datashare", &share->ch)) { ++ if (free_share) { ++ pefree(share, persistent); ++ } ++ return NULL; ++ } ++ ++ if (!(share->persistent = persistent)) { ++ share->handle.list = emalloc(sizeof(zend_llist)); ++ zend_llist_init(share->handle.list, sizeof(zval *), ZVAL_PTR_DTOR, 0); ++#ifdef ZTS ++ } else { ++ if (SUCCESS == http_persistent_handle_acquire("http_request_datashare_lock", (void *) &share->handle.locks)) { ++ curl_share_setopt(share->ch, CURLSHOPT_LOCKFUNC, http_request_datashare_lock_func); ++ curl_share_setopt(share->ch, CURLSHOPT_UNLOCKFUNC, http_request_datashare_unlock_func); ++ curl_share_setopt(share->ch, CURLSHOPT_USERDATA, share->handle.locks); ++ } ++#endif ++ } ++ ++ return share; ++} ++ ++PHP_HTTP_API STATUS _http_request_datashare_attach(http_request_datashare *share, zval *request TSRMLS_DC) ++{ ++ CURLcode rc; ++ getObjectEx(http_request_object, obj, request); ++ ++ if (obj->share) { ++ if (obj->share == share) { ++ return SUCCESS; ++ } else if (SUCCESS != http_request_datashare_detach(obj->share, request)) { ++ return FAILURE; ++ } ++ } ++ ++ HTTP_CHECK_CURL_INIT(obj->request->ch, http_curl_init_ex(obj->request->ch, obj->request), return FAILURE); ++ if (CURLE_OK != (rc = curl_easy_setopt(obj->request->ch, CURLOPT_SHARE, share->ch))) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "Could not attach HttpRequest object(#%d) to the HttpRequestDataShare: %s", Z_OBJ_HANDLE_P(request), curl_easy_strerror(rc)); ++ return FAILURE; ++ } ++ ++ obj->share = share; ++ ZVAL_ADDREF(request); ++ zend_llist_add_element(HTTP_RSHARE_HANDLES(share), (void *) &request); ++ ++ return SUCCESS; ++} ++ ++PHP_HTTP_API STATUS _http_request_datashare_detach(http_request_datashare *share, zval *request TSRMLS_DC) ++{ ++ CURLcode rc; ++ getObjectEx(http_request_object, obj, request); ++ ++ if (!obj->share) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "HttpRequest object(#%d) is not attached to any HttpRequestDataShare", Z_OBJ_HANDLE_P(request)); ++ } else if (obj->share != share) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "HttpRequest object(#%d) is not attached to this HttpRequestDataShare", Z_OBJ_HANDLE_P(request)); ++ } else if (CURLE_OK != (rc = curl_easy_setopt(obj->request->ch, CURLOPT_SHARE, NULL))) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "Could not detach HttpRequest object(#%d) from the HttpRequestDataShare: %s", Z_OBJ_HANDLE_P(request), curl_share_strerror(rc)); ++ } else { ++ obj->share = NULL; ++ zend_llist_del_element(HTTP_RSHARE_HANDLES(share), request, http_request_datashare_compare_handles); ++ return SUCCESS; ++ } ++ return FAILURE; ++} ++ ++PHP_HTTP_API void _http_request_datashare_detach_all(http_request_datashare *share TSRMLS_DC) ++{ ++ zval **r; ++ ++ while ((r = zend_llist_get_first(HTTP_RSHARE_HANDLES(share)))) { ++ http_request_datashare_detach(share, *r); ++ } ++} ++ ++PHP_HTTP_API void _http_request_datashare_dtor(http_request_datashare *share TSRMLS_DC) ++{ ++ if (!share->persistent) { ++ zend_llist_destroy(share->handle.list); ++ efree(share->handle.list); ++ } ++ http_persistent_handle_release("http_request_datashare", &share->ch); ++#ifdef ZTS ++ if (share->persistent) { ++ http_persistent_handle_release("http_request_datashare_lock", (void *) &share->handle.locks); ++ } ++#endif ++} ++ ++PHP_HTTP_API void _http_request_datashare_free(http_request_datashare **share TSRMLS_DC) ++{ ++ http_request_datashare_dtor(*share); ++ pefree(*share, (*share)->persistent); ++ *share = NULL; ++} ++ ++PHP_HTTP_API STATUS _http_request_datashare_set(http_request_datashare *share, const char *option, size_t option_len, zend_bool enable TSRMLS_DC) ++{ ++ curl_lock_data *opt; ++ CURLSHcode rc; ++ ++ if (SUCCESS == zend_hash_find(&http_request_datashare_options, (char *) option, option_len + 1, (void *) &opt)) { ++ if (CURLSHE_OK == (rc = curl_share_setopt(share->ch, enable ? CURLSHOPT_SHARE : CURLSHOPT_UNSHARE, *opt))) { ++ return SUCCESS; ++ } ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "Could not %s sharing of %s data: %s", enable ? "enable" : "disable", option, curl_share_strerror(rc)); ++ } ++ return FAILURE; ++} ++ ++static int http_request_datashare_compare_handles(void *h1, void *h2) ++{ ++ return (Z_OBJ_HANDLE_PP((zval **) h1) == Z_OBJ_HANDLE_P((zval *) h2)); ++} ++ ++static void http_request_datashare_destroy_handles(void *el) ++{ ++ zval **r = (zval **) el; ++ TSRMLS_FETCH(); ++ ++ { /* gcc 2.95 needs these braces */ ++ getObjectEx(http_request_object, obj, *r); ++ ++ curl_easy_setopt(obj->request->ch, CURLOPT_SHARE, NULL); ++ zval_ptr_dtor(r); ++ } ++} ++ ++#ifdef ZTS ++static void *http_request_datashare_locks_init(void) ++{ ++ int i; ++ http_request_datashare_lock *locks = pecalloc(CURL_LOCK_DATA_LAST, sizeof(http_request_datashare_lock), 1); ++ ++ if (locks) { ++ for (i = 0; i < CURL_LOCK_DATA_LAST; ++i) { ++ locks[i].mx = tsrm_mutex_alloc(); ++ } ++ } ++ ++ return locks; ++} ++ ++static void http_request_datashare_locks_dtor(void *l) ++{ ++ int i; ++ http_request_datashare_lock *locks = (http_request_datashare_lock *) l; ++ ++ for (i = 0; i < CURL_LOCK_DATA_LAST; ++i) { ++ tsrm_mutex_free(locks[i].mx); ++ } ++ pefree(locks, 1); ++} ++ ++static void http_request_datashare_lock_func(CURL *handle, curl_lock_data data, curl_lock_access locktype, void *userptr) ++{ ++ http_request_datashare_lock *locks = (http_request_datashare_lock *) userptr; ++ ++ /* TSRM can't distinguish shared/exclusive locks */ ++ tsrm_mutex_lock(locks[data].mx); ++ locks[data].ch = handle; ++} ++ ++static void http_request_datashare_unlock_func(CURL *handle, curl_lock_data data, void *userptr) ++{ ++ http_request_datashare_lock *locks = (http_request_datashare_lock *) userptr; ++ ++ if (locks[data].ch == handle) { ++ tsrm_mutex_unlock(locks[data].mx); ++ } ++} ++#endif ++ ++#endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */ ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_request_info.c +@@ -0,0 +1,213 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_request_info.c 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#ifdef HTTP_HAVE_CURL ++#include "php_http_request_api.h" ++ ++/* {{{ void http_request_info(http_request *, HashTable *) */ ++PHP_HTTP_API void _http_request_info(http_request *request, HashTable *info) ++{ ++ char *c; ++ long l; ++ double d; ++ struct curl_slist *s, *p; ++ zval *subarray, array; ++ INIT_ZARR(array, info); ++ ++ /* BEGIN */ ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_EFFECTIVE_URL, &c)) { ++ add_assoc_string_ex(&array, "effective_url", sizeof("effective_url"), c ? c : "", 1); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_RESPONSE_CODE, &l)) { ++ add_assoc_long_ex(&array, "response_code", sizeof("response_code"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_TOTAL_TIME, &d)) { ++ add_assoc_double_ex(&array, "total_time", sizeof("total_time"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_NAMELOOKUP_TIME, &d)) { ++ add_assoc_double_ex(&array, "namelookup_time", sizeof("namelookup_time"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_CONNECT_TIME, &d)) { ++ add_assoc_double_ex(&array, "connect_time", sizeof("connect_time"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_PRETRANSFER_TIME, &d)) { ++ add_assoc_double_ex(&array, "pretransfer_time", sizeof("pretransfer_time"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_SIZE_UPLOAD, &d)) { ++ add_assoc_double_ex(&array, "size_upload", sizeof("size_upload"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_SIZE_DOWNLOAD, &d)) { ++ add_assoc_double_ex(&array, "size_download", sizeof("size_download"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_SPEED_DOWNLOAD, &d)) { ++ add_assoc_double_ex(&array, "speed_download", sizeof("speed_download"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_SPEED_UPLOAD, &d)) { ++ add_assoc_double_ex(&array, "speed_upload", sizeof("speed_upload"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_HEADER_SIZE, &l)) { ++ add_assoc_long_ex(&array, "header_size", sizeof("header_size"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_REQUEST_SIZE, &l)) { ++ add_assoc_long_ex(&array, "request_size", sizeof("request_size"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_SSL_VERIFYRESULT, &l)) { ++ add_assoc_long_ex(&array, "ssl_verifyresult", sizeof("ssl_verifyresult"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_FILETIME, &l)) { ++ add_assoc_long_ex(&array, "filetime", sizeof("filetime"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &d)) { ++ add_assoc_double_ex(&array, "content_length_download", sizeof("content_length_download"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_CONTENT_LENGTH_UPLOAD, &d)) { ++ add_assoc_double_ex(&array, "content_length_upload", sizeof("content_length_upload"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_STARTTRANSFER_TIME, &d)) { ++ add_assoc_double_ex(&array, "starttransfer_time", sizeof("starttransfer_time"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_CONTENT_TYPE, &c)) { ++ add_assoc_string_ex(&array, "content_type", sizeof("content_type"), c ? c : "", 1); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_REDIRECT_TIME, &d)) { ++ add_assoc_double_ex(&array, "redirect_time", sizeof("redirect_time"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_REDIRECT_COUNT, &l)) { ++ add_assoc_long_ex(&array, "redirect_count", sizeof("redirect_count"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_HTTP_CONNECTCODE, &l)) { ++ add_assoc_long_ex(&array, "connect_code", sizeof("connect_code"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_HTTPAUTH_AVAIL, &l)) { ++ add_assoc_long_ex(&array, "httpauth_avail", sizeof("httpauth_avail"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_PROXYAUTH_AVAIL, &l)) { ++ add_assoc_long_ex(&array, "proxyauth_avail", sizeof("proxyauth_avail"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_OS_ERRNO, &l)) { ++ add_assoc_long_ex(&array, "os_errno", sizeof("os_errno"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_NUM_CONNECTS, &l)) { ++ add_assoc_long_ex(&array, "num_connects", sizeof("num_connects"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_SSL_ENGINES, &s)) { ++ MAKE_STD_ZVAL(subarray); ++ array_init(subarray); ++ for (p = s; p; p = p->next) { ++ if (p->data) { ++ add_next_index_string(subarray, p->data, 1); ++ } ++ } ++ add_assoc_zval_ex(&array, "ssl_engines", sizeof("ssl_engines"), subarray); ++ curl_slist_free_all(s); ++ } ++#if HTTP_CURL_VERSION(7,14,1) ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_COOKIELIST, &s)) { ++ MAKE_STD_ZVAL(subarray); ++ array_init(subarray); ++ for (p = s; p; p = p->next) { ++ if (p->data) { ++ add_next_index_string(subarray, p->data, 1); ++ } ++ } ++ add_assoc_zval_ex(&array, "cookies", sizeof("cookies"), subarray); ++ curl_slist_free_all(s); ++ } ++#endif ++#if HTTP_CURL_VERSION(7,18,2) ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_REDIRECT_URL, &c)) { ++ add_assoc_string_ex(&array, "redirect_url", sizeof("redirect_url"), c ? c : "", 1); ++ } ++#endif ++#if HTTP_CURL_VERSION(7,19,0) ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_PRIMARY_IP, &c)) { ++ add_assoc_string_ex(&array, "primary_ip", sizeof("primary_ip"), c ? c : "", 1); ++ } ++#endif ++#if HTTP_CURL_VERSION(7,19,0) ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_APPCONNECT_TIME, &d)) { ++ add_assoc_double_ex(&array, "appconnect_time", sizeof("appconnect_time"), d); ++ } ++#endif ++#if HTTP_CURL_VERSION(7,19,4) ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_CONDITION_UNMET, &l)) { ++ add_assoc_long_ex(&array, "condition_unmet", sizeof("condition_unmet"), l); ++ } ++#endif ++#if HTTP_CURL_VERSION(7,21,0) ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_PRIMARY_PORT, &l)) { ++ add_assoc_long_ex(&array, "primary_port", sizeof("primary_port"), l); ++ } ++#endif ++#if HTTP_CURL_VERSION(7,21,0) ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_LOCAL_IP, &c)) { ++ add_assoc_string_ex(&array, "local_ip", sizeof("local_ip"), c ? c : "", 1); ++ } ++#endif ++#if HTTP_CURL_VERSION(7,21,0) ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_LOCAL_PORT, &l)) { ++ add_assoc_long_ex(&array, "local_port", sizeof("local_port"), l); ++ } ++#endif ++/* END */ ++#if HTTP_CURL_VERSION(7,19,1) && defined(HTTP_HAVE_OPENSSL) ++ { ++ int i; ++ zval *ci_array; ++ struct curl_certinfo *ci; ++ char *colon, *keyname; ++ ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_CERTINFO, &ci)) { ++ MAKE_STD_ZVAL(ci_array); ++ array_init(ci_array); ++ ++ for (i = 0; i < ci->num_of_certs; ++i) { ++ s = ci->certinfo[i]; ++ ++ MAKE_STD_ZVAL(subarray); ++ array_init(subarray); ++ for (p = s; p; p = p->next) { ++ if (p->data) { ++ if ((colon = strchr(p->data, ':'))) { ++ keyname = estrndup(p->data, colon - p->data); ++ add_assoc_string_ex(subarray, keyname, colon - p->data + 1, colon + 1, 1); ++ efree(keyname); ++ } else { ++ add_next_index_string(subarray, p->data, 1); ++ } ++ } ++ } ++ add_next_index_zval(ci_array, subarray); ++ } ++ add_assoc_zval_ex(&array, "certinfo", sizeof("certinfo"), ci_array); ++ } ++ } ++#endif ++ add_assoc_string_ex(&array, "error", sizeof("error"), http_request_storage_get(request->ch)->errorbuffer, 1); ++} ++/* }}} */ ++ ++#endif /* HTTP_HAVE_CURL */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/http_request_method_api.c +@@ -0,0 +1,322 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_request_method_api.c 323406 2012-02-21 10:05:52Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#include "php_http_api.h" ++#include "php_http_request_api.h" ++#include "php_http_request_method_api.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) && !defined(WONKY) ++# include "php_http_request_object.h" ++#endif ++ ++/* {{{ char *http_request_methods[] */ ++static const char *const http_request_methods[] = { ++ "UNKNOWN", ++ /* HTTP/1.1 */ ++ "GET", ++ "HEAD", ++ "POST", ++ "PUT", ++ "DELETE", ++ "OPTIONS", ++ "TRACE", ++ "CONNECT", ++ /* WebDAV - RFC 2518 */ ++ "PROPFIND", ++ "PROPPATCH", ++ "MKCOL", ++ "COPY", ++ "MOVE", ++ "LOCK", ++ "UNLOCK", ++ /* WebDAV Versioning - RFC 3253 */ ++ "VERSION-CONTROL", ++ "REPORT", ++ "CHECKOUT", ++ "CHECKIN", ++ "UNCHECKOUT", ++ "MKWORKSPACE", ++ "UPDATE", ++ "LABEL", ++ "MERGE", ++ "BASELINE-CONTROL", ++ "MKACTIVITY", ++ /* WebDAV Access Control - RFC 3744 */ ++ "ACL", ++ NULL ++}; ++/* }}} */ ++ ++/* {{{ */ ++PHP_MINIT_FUNCTION(http_request_method) ++{ ++ /* HTTP/1.1 */ ++ HTTP_LONG_CONSTANT("HTTP_METH_GET", HTTP_GET); ++ HTTP_LONG_CONSTANT("HTTP_METH_HEAD", HTTP_HEAD); ++ HTTP_LONG_CONSTANT("HTTP_METH_POST", HTTP_POST); ++ HTTP_LONG_CONSTANT("HTTP_METH_PUT", HTTP_PUT); ++ HTTP_LONG_CONSTANT("HTTP_METH_DELETE", HTTP_DELETE); ++ HTTP_LONG_CONSTANT("HTTP_METH_OPTIONS", HTTP_OPTIONS); ++ HTTP_LONG_CONSTANT("HTTP_METH_TRACE", HTTP_TRACE); ++ HTTP_LONG_CONSTANT("HTTP_METH_CONNECT", HTTP_CONNECT); ++ /* WebDAV - RFC 2518 */ ++ HTTP_LONG_CONSTANT("HTTP_METH_PROPFIND", HTTP_PROPFIND); ++ HTTP_LONG_CONSTANT("HTTP_METH_PROPPATCH", HTTP_PROPPATCH); ++ HTTP_LONG_CONSTANT("HTTP_METH_MKCOL", HTTP_MKCOL); ++ HTTP_LONG_CONSTANT("HTTP_METH_COPY", HTTP_COPY); ++ HTTP_LONG_CONSTANT("HTTP_METH_MOVE", HTTP_MOVE); ++ HTTP_LONG_CONSTANT("HTTP_METH_LOCK", HTTP_LOCK); ++ HTTP_LONG_CONSTANT("HTTP_METH_UNLOCK", HTTP_UNLOCK); ++ /* WebDAV Versioning - RFC 3253 */ ++ HTTP_LONG_CONSTANT("HTTP_METH_VERSION_CONTROL", HTTP_VERSION_CONTROL); ++ HTTP_LONG_CONSTANT("HTTP_METH_REPORT", HTTP_REPORT); ++ HTTP_LONG_CONSTANT("HTTP_METH_CHECKOUT", HTTP_CHECKOUT); ++ HTTP_LONG_CONSTANT("HTTP_METH_CHECKIN", HTTP_CHECKIN); ++ HTTP_LONG_CONSTANT("HTTP_METH_UNCHECKOUT", HTTP_UNCHECKOUT); ++ HTTP_LONG_CONSTANT("HTTP_METH_MKWORKSPACE", HTTP_MKWORKSPACE); ++ HTTP_LONG_CONSTANT("HTTP_METH_UPDATE", HTTP_UPDATE); ++ HTTP_LONG_CONSTANT("HTTP_METH_LABEL", HTTP_LABEL); ++ HTTP_LONG_CONSTANT("HTTP_METH_MERGE", HTTP_MERGE); ++ HTTP_LONG_CONSTANT("HTTP_METH_BASELINE_CONTROL", HTTP_BASELINE_CONTROL); ++ HTTP_LONG_CONSTANT("HTTP_METH_MKACTIVITY", HTTP_MKACTIVITY); ++ /* WebDAV Access Control - RFC 3744 */ ++ HTTP_LONG_CONSTANT("HTTP_METH_ACL", HTTP_ACL); ++ ++ return SUCCESS; ++} ++ ++static void free_method(void *el) ++{ ++ efree(*(char **)el); ++} ++ ++static void unregister_method(const char *name TSRMLS_DC) ++{ ++ char *ptr, tmp[sizeof("HTTP_METH_") + HTTP_REQUEST_METHOD_MAXLEN] = "HTTP_METH_"; ++ ++ strlcpy(tmp + lenof("HTTP_METH_"), name, HTTP_REQUEST_METHOD_MAXLEN); ++ for (ptr = tmp + lenof("HTTP_METH_"); *ptr; ++ptr) { ++ if (*ptr == '-') { ++ *ptr = '_'; ++ } ++ } ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) && !defined(WONKY) ++ if (SUCCESS != zend_hash_del(&http_request_object_ce->constants_table, tmp + lenof("HTTP_"), strlen(tmp + lenof("HTTP_")) + 1)) { ++ http_error_ex(HE_NOTICE, HTTP_E_REQUEST_METHOD, "Could not unregister request method: HttpRequest::%s", tmp + lenof("HTTP_")); ++ } ++#endif ++ if (SUCCESS != zend_hash_del(EG(zend_constants), tmp, strlen(tmp) + 1)) { ++ http_error_ex(HE_NOTICE, HTTP_E_REQUEST_METHOD, "Could not unregister request method: %s", tmp); ++ } ++} ++ ++PHP_RINIT_FUNCTION(http_request_method) ++{ ++ HashTable ht; ++ ++ zend_hash_init(&HTTP_G->request.methods.registered, 0, NULL, free_method, 0); ++#define HTTP_METH_REG(m) \ ++ { \ ++ char *_m=estrdup(m); \ ++ zend_hash_next_index_insert(&HTTP_G->request.methods.registered, (void *) &_m, sizeof(char *), NULL); \ ++ } ++ HTTP_METH_REG("UNKNOWN"); ++ /* HTTP/1.1 */ ++ HTTP_METH_REG("GET"); ++ HTTP_METH_REG("HEAD"); ++ HTTP_METH_REG("POST"); ++ HTTP_METH_REG("PUT"); ++ HTTP_METH_REG("DELETE"); ++ HTTP_METH_REG("OPTIONS"); ++ HTTP_METH_REG("TRACE"); ++ HTTP_METH_REG("CONNECT"); ++ /* WebDAV - RFC 2518 */ ++ HTTP_METH_REG("PROPFIND"); ++ HTTP_METH_REG("PROPPATCH"); ++ HTTP_METH_REG("MKCOL"); ++ HTTP_METH_REG("COPY"); ++ HTTP_METH_REG("MOVE"); ++ HTTP_METH_REG("LOCK"); ++ HTTP_METH_REG("UNLOCK"); ++ /* WebDAV Versioning - RFC 3253 */ ++ HTTP_METH_REG("VERSION-CONTROL"); ++ HTTP_METH_REG("REPORT"); ++ HTTP_METH_REG("CHECKOUT"); ++ HTTP_METH_REG("CHECKIN"); ++ HTTP_METH_REG("UNCHECKOUT"); ++ HTTP_METH_REG("MKWORKSPACE"); ++ HTTP_METH_REG("UPDATE"); ++ HTTP_METH_REG("LABEL"); ++ HTTP_METH_REG("MERGE"); ++ HTTP_METH_REG("BASELINE-CONTROL"); ++ HTTP_METH_REG("MKACTIVITY"); ++ /* WebDAV Access Control - RFC 3744 */ ++ HTTP_METH_REG("ACL"); ++ ++ zend_hash_init(&ht, 0, NULL, ZVAL_PTR_DTOR, 0); ++ if (*HTTP_G->request.methods.custom && SUCCESS == http_parse_params(HTTP_G->request.methods.custom, HTTP_PARAMS_DEFAULT, &ht)) { ++ HashPosition pos; ++ zval **val; ++ ++ FOREACH_HASH_VAL(pos, &ht, val) { ++ if (Z_TYPE_PP(val) == IS_STRING) { ++ http_request_method_register(Z_STRVAL_PP(val), Z_STRLEN_PP(val)); ++ } ++ } ++ } ++ zend_hash_destroy(&ht); ++ ++ return SUCCESS; ++} ++ ++PHP_RSHUTDOWN_FUNCTION(http_request_method) ++{ ++ char **name; ++ int i, c = zend_hash_next_free_element(&HTTP_G->request.methods.registered); ++ ++ for (i = HTTP_MAX_REQUEST_METHOD; i < c; ++i) { ++ if (SUCCESS == zend_hash_index_find(&HTTP_G->request.methods.registered, i, (void *) &name)) { ++ unregister_method(*name TSRMLS_CC); ++ } ++ } ++ ++ zend_hash_destroy(&HTTP_G->request.methods.registered); ++ return SUCCESS; ++} ++ ++#define http_request_method_cncl(m, c) _http_request_method_cncl_ex((m), strlen(m), (c) TSRMLS_CC) ++#define http_request_method_cncl_ex(m, l, c) _http_request_method_cncl_ex((m), (l), (c) TSRMLS_CC) ++static STATUS _http_request_method_cncl_ex(const char *method_name, int method_name_len, char **cnst TSRMLS_DC) ++{ ++ int i; ++ char *cncl; ++ ++ if (method_name_len >= HTTP_REQUEST_METHOD_MAXLEN) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Request method too long (%s)", method_name); ++ } ++ cncl = emalloc(method_name_len + 1); ++ ++ for (i = 0; i < method_name_len; ++i) { ++ switch (method_name[i]) { ++ case '-': ++ case '_': ++ cncl[i] = method_name[i]; ++ break; ++ ++ default: ++ if (!HTTP_IS_CTYPE(alnum, method_name[i])) { ++ efree(cncl); ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Request method contains illegal characters (%s)", method_name); ++ return FAILURE; ++ } ++ cncl[i] = HTTP_TO_CTYPE(upper, method_name[i]); ++ break; ++ } ++ } ++ cncl[method_name_len] = '\0'; ++ ++ *cnst = cncl; ++ return SUCCESS; ++} ++ ++PHP_HTTP_API const char *_http_request_method_name(http_request_method m TSRMLS_DC) ++{ ++ char **name; ++ ++ if (SUCCESS == zend_hash_index_find(&HTTP_G->request.methods.registered, m, (void *) &name)) { ++ return *name; ++ } ++ return "UNKNOWN"; ++} ++ ++PHP_HTTP_API int _http_request_method_exists(int by_name, http_request_method id_num, const char *id_str TSRMLS_DC) ++{ ++ char *id_dup; ++ ++ if (by_name && (SUCCESS == http_request_method_cncl(id_str, &id_dup))) { ++ char **name; ++ HashPosition pos; ++ HashKey key = initHashKey(0); ++ ++ FOREACH_HASH_KEYVAL(pos, &HTTP_G->request.methods.registered, key, name) { ++ if (key.type == HASH_KEY_IS_LONG && !strcmp(*name, id_dup)) { ++ efree(id_dup); ++ return key.num; ++ } ++ } ++ efree(id_dup); ++ } else if (zend_hash_index_exists(&HTTP_G->request.methods.registered, id_num)){ ++ return id_num; ++ } ++ return 0; ++} ++ ++PHP_HTTP_API int _http_request_method_register(const char *method_str, int method_len TSRMLS_DC) ++{ ++ char *method_dup, *ptr, tmp[sizeof("HTTP_METH_") + HTTP_REQUEST_METHOD_MAXLEN] = "HTTP_METH_"; ++ int method_num = http_request_method_exists(1, 0, method_str); ++ ++ if (!method_num && (SUCCESS == http_request_method_cncl_ex(method_str, method_len, &method_dup))) { ++ method_num = zend_hash_next_free_element(&HTTP_G->request.methods.registered); ++ zend_hash_index_update(&HTTP_G->request.methods.registered, method_num, (void *) &method_dup, sizeof(char *), NULL); ++ ++ strlcpy(tmp + lenof("HTTP_METH_"), method_dup, HTTP_REQUEST_METHOD_MAXLEN); ++ for (ptr = tmp + lenof("HTTP_METH_"); *ptr; ++ptr) { ++ if (*ptr == '-') { ++ *ptr = '_'; ++ } ++ } ++ ++ zend_register_long_constant(tmp, strlen(tmp) + 1, method_num, CONST_CS, http_module_number TSRMLS_CC); ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) && !defined(WONKY) ++ zend_declare_class_constant_long(http_request_object_ce, tmp + lenof("HTTP_"), strlen(tmp + lenof("HTTP_")), method_num TSRMLS_CC); ++#endif ++ } ++ ++ return method_num; ++} ++ ++PHP_HTTP_API STATUS _http_request_method_unregister(int method TSRMLS_DC) ++{ ++ char **name; ++ ++ if (HTTP_STD_REQUEST_METHOD(method)) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Standard request methods cannot be unregistered"); ++ return FAILURE; ++ } ++ ++ if (SUCCESS != zend_hash_index_find(&HTTP_G->request.methods.registered, method, (void *) &name)) { ++ http_error_ex(HE_NOTICE, HTTP_E_REQUEST_METHOD, "Custom request method with id %d does not exist", method); ++ return FAILURE; ++ } ++ ++ unregister_method(*name TSRMLS_CC); ++ ++ zend_hash_index_del(&HTTP_G->request.methods.registered, method); ++ return SUCCESS; ++} ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_request_object.c +@@ -0,0 +1,1931 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_request_object.c 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) ++ ++#include "zend_interfaces.h" ++ ++#include "php_http_api.h" ++#include "php_http_cookie_api.h" ++#include "php_http_exception_object.h" ++#include "php_http_message_api.h" ++#include "php_http_message_object.h" ++#include "php_http_request_api.h" ++#include "php_http_request_object.h" ++#include "php_http_request_pool_api.h" ++#include "php_http_url_api.h" ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpRequest, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpRequest, method, 0) ++#define HTTP_REQUEST_ME(method, visibility) PHP_ME(HttpRequest, method, HTTP_ARGS(HttpRequest, method), visibility) ++#define HTTP_REQUEST_ALIAS(method, func) HTTP_STATIC_ME_ALIAS(method, func, HTTP_ARGS(HttpRequest, method)) ++#define HTTP_REQUEST_MALIAS(me, al, vis) ZEND_FENTRY(me, ZEND_MN(HttpRequest_##al), HTTP_ARGS(HttpRequest, al), vis) ++ ++HTTP_BEGIN_ARGS(__construct, 0) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(method, 0) ++ HTTP_ARG_VAL(options, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(factory, 0) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(method, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(class_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getOptions); ++HTTP_BEGIN_ARGS(setOptions, 0) ++ HTTP_ARG_VAL(options, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getSslOptions); ++HTTP_BEGIN_ARGS(setSslOptions, 0) ++ HTTP_ARG_VAL(ssl_options, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addSslOptions, 0) ++ HTTP_ARG_VAL(ssl_optins, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getHeaders); ++HTTP_BEGIN_ARGS(setHeaders, 0) ++ HTTP_ARG_VAL(headers, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addHeaders, 1) ++ HTTP_ARG_VAL(headers, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getCookies); ++HTTP_BEGIN_ARGS(setCookies, 0) ++ HTTP_ARG_VAL(cookies, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addCookies, 1) ++ HTTP_ARG_VAL(cookies, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(enableCookies); ++HTTP_BEGIN_ARGS(resetCookies, 0) ++ HTTP_ARG_VAL(session_only, 0) ++HTTP_END_ARGS; ++HTTP_EMPTY_ARGS(flushCookies); ++ ++HTTP_EMPTY_ARGS(getUrl); ++HTTP_BEGIN_ARGS(setUrl, 1) ++ HTTP_ARG_VAL(url, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getMethod); ++HTTP_BEGIN_ARGS(setMethod, 1) ++ HTTP_ARG_VAL(request_method, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getContentType); ++HTTP_BEGIN_ARGS(setContentType, 1) ++ HTTP_ARG_VAL(content_type, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getQueryData); ++HTTP_BEGIN_ARGS(setQueryData, 0) ++ HTTP_ARG_VAL(query_data, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addQueryData, 1) ++ HTTP_ARG_VAL(query_data, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getPostFields); ++HTTP_BEGIN_ARGS(setPostFields, 0) ++ HTTP_ARG_VAL(post_fields, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addPostFields, 1) ++ HTTP_ARG_VAL(post_fields, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getPostFiles); ++HTTP_BEGIN_ARGS(setPostFiles, 0) ++ HTTP_ARG_VAL(post_files, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addPostFile, 2) ++ HTTP_ARG_VAL(formname, 0) ++ HTTP_ARG_VAL(filename, 0) ++ HTTP_ARG_VAL(content_type, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getBody); ++HTTP_BEGIN_ARGS(setBody, 0) ++ HTTP_ARG_VAL(request_body_data, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addBody, 1) ++ HTTP_ARG_VAL(request_body_data, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getPutFile); ++HTTP_BEGIN_ARGS(setPutFile, 0) ++ HTTP_ARG_VAL(filename, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getPutData); ++HTTP_BEGIN_ARGS(setPutData, 0) ++ HTTP_ARG_VAL(put_data, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addPutData, 1) ++ HTTP_ARG_VAL(put_data, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getResponseData); ++HTTP_BEGIN_ARGS(getResponseHeader, 0) ++ HTTP_ARG_VAL(name, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(getResponseCookies, 0) ++ HTTP_ARG_VAL(flags, 0) ++ HTTP_ARG_VAL(allowed_extras, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getResponseBody); ++HTTP_EMPTY_ARGS(getResponseCode); ++HTTP_EMPTY_ARGS(getResponseStatus); ++HTTP_BEGIN_ARGS(getResponseInfo, 0) ++ HTTP_ARG_VAL(name, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getMessageClass); ++HTTP_BEGIN_ARGS(setMessageClass, 1) ++ HTTP_ARG_VAL(message_class_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getResponseMessage); ++HTTP_EMPTY_ARGS(getRawResponseMessage); ++HTTP_EMPTY_ARGS(getRequestMessage); ++HTTP_EMPTY_ARGS(getRawRequestMessage); ++HTTP_EMPTY_ARGS(getHistory); ++HTTP_EMPTY_ARGS(clearHistory); ++HTTP_EMPTY_ARGS(send); ++ ++HTTP_BEGIN_ARGS(get, 1) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(info, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(head, 1) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(info, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(postData, 2) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(data, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(info, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(postFields, 2) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(data, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(info, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(putData, 2) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(data, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(info, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(putFile, 2) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(file, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(info, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(putStream, 2) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(stream, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(info, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(methodRegister, 1) ++ HTTP_ARG_VAL(method_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(methodUnregister, 1) ++ HTTP_ARG_VAL(method, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(methodName, 1) ++ HTTP_ARG_VAL(method_id, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(methodExists, 1) ++ HTTP_ARG_VAL(method, 0) ++HTTP_END_ARGS; ++ ++#ifdef HAVE_CURL_FORMGET ++HTTP_BEGIN_ARGS(encodeBody, 2) ++ HTTP_ARG_VAL(fields, 0) ++ HTTP_ARG_VAL(files, 0) ++HTTP_END_ARGS; ++#endif ++ ++#define THIS_CE http_request_object_ce ++zend_class_entry *http_request_object_ce; ++zend_function_entry http_request_object_fe[] = { ++ HTTP_REQUEST_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) ++ ++ HTTP_REQUEST_ME(setOptions, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getOptions, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(setSslOptions, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getSslOptions, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(addSslOptions, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(addHeaders, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getHeaders, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(setHeaders, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(addCookies, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getCookies, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(setCookies, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(enableCookies, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(resetCookies, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(flushCookies, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setMethod, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getMethod, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setUrl, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getUrl, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setContentType, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getContentType, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setQueryData, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getQueryData, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(addQueryData, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setPostFields, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getPostFields, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(addPostFields, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setBody, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getBody, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(addBody, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_MALIAS(setRawPostData, setBody, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) ++ HTTP_REQUEST_MALIAS(getRawPostData, getBody, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) ++ HTTP_REQUEST_MALIAS(addRawPostData, addBody, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) ++ ++ HTTP_REQUEST_ME(setPostFiles, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(addPostFile, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getPostFiles, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setPutFile, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getPutFile, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setPutData, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getPutData, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(addPutData, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(send, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(getResponseData, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getResponseHeader, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getResponseCookies, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getResponseCode, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getResponseStatus, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getResponseBody, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getResponseInfo, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getResponseMessage, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getRawResponseMessage, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getRequestMessage, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getRawRequestMessage, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getHistory, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(clearHistory, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(getMessageClass, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(setMessageClass, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(factory, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++ ++ HTTP_REQUEST_ALIAS(get, http_get) ++ HTTP_REQUEST_ALIAS(head, http_head) ++ HTTP_REQUEST_ALIAS(postData, http_post_data) ++ HTTP_REQUEST_ALIAS(postFields, http_post_fields) ++ HTTP_REQUEST_ALIAS(putData, http_put_data) ++ HTTP_REQUEST_ALIAS(putFile, http_put_file) ++ HTTP_REQUEST_ALIAS(putStream, http_put_stream) ++ ++ HTTP_REQUEST_ALIAS(methodRegister, http_request_method_register) ++ HTTP_REQUEST_ALIAS(methodUnregister, http_request_method_unregister) ++ HTTP_REQUEST_ALIAS(methodName, http_request_method_name) ++ HTTP_REQUEST_ALIAS(methodExists, http_request_method_exists) ++#ifdef HAVE_CURL_FORMGET ++ HTTP_REQUEST_ALIAS(encodeBody, http_request_body_encode) ++#endif ++ EMPTY_FUNCTION_ENTRY ++}; ++static zend_object_handlers http_request_object_handlers; ++ ++PHP_MINIT_FUNCTION(http_request_object) ++{ ++ HTTP_REGISTER_CLASS_EX(HttpRequest, http_request_object, NULL, 0); ++ http_request_object_handlers.clone_obj = _http_request_object_clone_obj; ++ ++ zend_declare_property_null(THIS_CE, ZEND_STRS("options")-1, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("postFields")-1, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("postFiles")-1, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("responseInfo")-1, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("responseMessage")-1, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("responseCode")-1, 0, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("responseStatus")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("method")-1, HTTP_GET, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("url")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("contentType")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("requestBody")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("queryData")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("putFile")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("putData")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("history")-1, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("recordHistory")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("messageClass")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ ++#ifndef WONKY ++ /* ++ * Request Method Constants ++ */ ++ /* HTTP/1.1 */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_GET")-1, HTTP_GET TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_HEAD")-1, HTTP_HEAD TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_POST")-1, HTTP_POST TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_PUT")-1, HTTP_PUT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_DELETE")-1, HTTP_DELETE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_OPTIONS")-1, HTTP_OPTIONS TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_TRACE")-1, HTTP_TRACE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_CONNECT")-1, HTTP_CONNECT TSRMLS_CC); ++ /* WebDAV - RFC 2518 */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_PROPFIND")-1, HTTP_PROPFIND TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_PROPPATCH")-1, HTTP_PROPPATCH TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_MKCOL")-1, HTTP_MKCOL TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_COPY")-1, HTTP_COPY TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_MOVE")-1, HTTP_MOVE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_LOCK")-1, HTTP_LOCK TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_UNLOCK")-1, HTTP_UNLOCK TSRMLS_CC); ++ /* WebDAV Versioning - RFC 3253 */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_VERSION_CONTROL")-1, HTTP_VERSION_CONTROL TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_REPORT")-1, HTTP_REPORT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_CHECKOUT")-1, HTTP_CHECKOUT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_CHECKIN")-1, HTTP_CHECKIN TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_UNCHECKOUT")-1, HTTP_UNCHECKOUT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_MKWORKSPACE")-1, HTTP_MKWORKSPACE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_UPDATE")-1, HTTP_UPDATE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_LABEL")-1, HTTP_LABEL TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_MERGE")-1, HTTP_MERGE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_BASELINE_CONTROL")-1, HTTP_BASELINE_CONTROL TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_MKACTIVITY")-1, HTTP_MKACTIVITY TSRMLS_CC); ++ /* WebDAV Access Control - RFC 3744 */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_ACL")-1, HTTP_ACL TSRMLS_CC); ++ ++ /* ++ * HTTP Protocol Version Constants ++ */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("VERSION_1_0")-1, CURL_HTTP_VERSION_1_0 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("VERSION_1_1")-1, CURL_HTTP_VERSION_1_1 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("VERSION_NONE")-1, CURL_HTTP_VERSION_NONE TSRMLS_CC); /* to be removed */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("VERSION_ANY")-1, CURL_HTTP_VERSION_NONE TSRMLS_CC); ++ ++ /* ++ * SSL Version Constants ++ */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("SSL_VERSION_TLSv1")-1, CURL_SSLVERSION_TLSv1 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("SSL_VERSION_SSLv2")-1, CURL_SSLVERSION_SSLv2 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("SSL_VERSION_SSLv3")-1, CURL_SSLVERSION_SSLv3 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("SSL_VERSION_ANY")-1, CURL_SSLVERSION_DEFAULT TSRMLS_CC); ++ ++ /* ++ * DNS IPvX resolving ++ */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("IPRESOLVE_V4")-1, CURL_IPRESOLVE_V4 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("IPRESOLVE_V6")-1, CURL_IPRESOLVE_V6 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("IPRESOLVE_ANY")-1, CURL_IPRESOLVE_WHATEVER TSRMLS_CC); ++ ++ /* ++ * Auth Constants ++ */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("AUTH_BASIC")-1, CURLAUTH_BASIC TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("AUTH_DIGEST")-1, CURLAUTH_DIGEST TSRMLS_CC); ++#if HTTP_CURL_VERSION(7,19,3) ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("AUTH_DIGEST_IE")-1, CURLAUTH_DIGEST_IE TSRMLS_CC); ++#endif ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("AUTH_NTLM")-1, CURLAUTH_NTLM TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("AUTH_GSSNEG")-1, CURLAUTH_GSSNEGOTIATE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("AUTH_ANY")-1, CURLAUTH_ANY TSRMLS_CC); ++ ++ /* ++ * Proxy Type Constants ++ */ ++# if HTTP_CURL_VERSION(7,15,2) ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("PROXY_SOCKS4")-1, CURLPROXY_SOCKS4 TSRMLS_CC); ++# endif ++#if HTTP_CURL_VERSION(7,18,0) ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("PROXY_SOCKS4A")-1, CURLPROXY_SOCKS5 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("PROXY_SOCKS5_HOSTNAME")-1, CURLPROXY_SOCKS5 TSRMLS_CC); ++#endif ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("PROXY_SOCKS5")-1, CURLPROXY_SOCKS5 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("PROXY_HTTP")-1, CURLPROXY_HTTP TSRMLS_CC); ++# if HTTP_CURL_VERSION(7,19,4) ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("PROXY_HTTP_1_0")-1, CURLPROXY_HTTP_1_0 TSRMLS_CC); ++# endif ++#endif /* WONKY */ ++ ++ /* ++ * Post Redirection Constants ++ */ ++#if HTTP_CURL_VERSION(7,19,1) ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("POSTREDIR_301")-1, CURL_REDIR_POST_301 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("POSTREDIR_302")-1, CURL_REDIR_POST_302 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("POSTREDIR_ALL")-1, CURL_REDIR_POST_ALL TSRMLS_CC); ++#endif ++ ++ return SUCCESS; ++} ++ ++zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC) ++{ ++ return http_request_object_new_ex(ce, NULL, NULL); ++} ++ ++zend_object_value _http_request_object_new_ex(zend_class_entry *ce, CURL *ch, http_request_object **ptr TSRMLS_DC) ++{ ++ zend_object_value ov; ++ http_request_object *o; ++ ++ o = ecalloc(1, sizeof(http_request_object)); ++ o->zo.ce = ce; ++ o->request = http_request_init_ex(NULL, ch, 0, NULL); ++ ++ if (ptr) { ++ *ptr = o; ++ } ++ ++#ifdef ZEND_ENGINE_2_4 ++ zend_object_std_init(o, ce TSRMLS_CC); ++ object_properties_init(o, ce); ++#else ++ ALLOC_HASHTABLE(OBJ_PROP(o)); ++ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++#endif ++ ++ ov.handle = putObject(http_request_object, o); ++ ov.handlers = &http_request_object_handlers; ++ ++ return ov; ++} ++ ++zend_object_value _http_request_object_clone_obj(zval *this_ptr TSRMLS_DC) ++{ ++ zend_object_value new_ov; ++ http_request_object *new_obj; ++ getObject(http_request_object, old_obj); ++ ++ new_ov = http_request_object_new_ex(old_obj->zo.ce, NULL, &new_obj); ++ if (old_obj->request->ch) { ++ http_curl_init_ex(http_curl_copy(old_obj->request->ch), new_obj->request); ++ } ++ ++ zend_objects_clone_members(&new_obj->zo, new_ov, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); ++ phpstr_append(&new_obj->request->conv.request, old_obj->request->conv.request.data, old_obj->request->conv.request.used); ++ phpstr_append(&new_obj->request->conv.response, old_obj->request->conv.response.data, old_obj->request->conv.response.used); ++ ++ return new_ov; ++} ++ ++void _http_request_object_free(zend_object *object TSRMLS_DC) ++{ ++ http_request_object *o = (http_request_object *) object; ++ ++ http_request_free(&o->request); ++ freeObject(o); ++} ++ ++#define http_request_object_check_request_content_type(t) _http_request_object_check_request_content_type((t) TSRMLS_CC) ++static inline void _http_request_object_check_request_content_type(zval *this_ptr TSRMLS_DC) ++{ ++ zval *ctype = zend_read_property(THIS_CE, getThis(), ZEND_STRS("contentType")-1, 0 TSRMLS_CC); ++ ++ if (Z_STRLEN_P(ctype)) { ++ zval **headers, *opts = zend_read_property(THIS_CE, getThis(), ZEND_STRS("options")-1, 0 TSRMLS_CC); ++ ++ if ( (Z_TYPE_P(opts) == IS_ARRAY) && ++ (SUCCESS == zend_hash_find(Z_ARRVAL_P(opts), "headers", sizeof("headers"), (void *) &headers)) && ++ (Z_TYPE_PP(headers) == IS_ARRAY)) { ++ zval **ct_header; ++ ++ /* only override if not already set */ ++ if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(headers), "Content-Type", sizeof("Content-Type"), (void *) &ct_header))) { ++ add_assoc_stringl(*headers, "Content-Type", Z_STRVAL_P(ctype), Z_STRLEN_P(ctype), 1); ++ } else ++ /* or not a string, zero length string or a string of spaces */ ++ if ((Z_TYPE_PP(ct_header) != IS_STRING) || !Z_STRLEN_PP(ct_header)) { ++ add_assoc_stringl(*headers, "Content-Type", Z_STRVAL_P(ctype), Z_STRLEN_P(ctype), 1); ++ } else { ++ int i, only_space = 1; ++ ++ /* check for spaces only */ ++ for (i = 0; i < Z_STRLEN_PP(ct_header); ++i) { ++ if (!HTTP_IS_CTYPE(space, Z_STRVAL_PP(ct_header)[i])) { ++ only_space = 0; ++ break; ++ } ++ } ++ if (only_space) { ++ add_assoc_stringl(*headers, "Content-Type", Z_STRVAL_P(ctype), Z_STRLEN_P(ctype), 1); ++ } ++ } ++ } else { ++ zval *headers; ++ ++ MAKE_STD_ZVAL(headers); ++ array_init(headers); ++ add_assoc_stringl(headers, "Content-Type", Z_STRVAL_P(ctype), Z_STRLEN_P(ctype), 1); ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "addheaders", NULL, headers); ++ zval_ptr_dtor(&headers); ++ } ++ } ++} ++ ++#define http_request_object_message(zo, msg) _http_request_object_message((zo), (msg) TSRMLS_CC) ++static inline zend_object_value _http_request_object_message(zval *this_ptr, http_message *msg TSRMLS_DC) ++{ ++ zend_object_value ov; ++ zval *zcn = zend_read_property(THIS_CE, getThis(), ZEND_STRS("messageClass")-1, 0 TSRMLS_CC); ++ ++ if (Z_STRLEN_P(zcn) && (SUCCESS == http_object_new(&ov, Z_STRVAL_P(zcn), Z_STRLEN_P(zcn), _http_message_object_new_ex, http_message_object_ce, msg, NULL))) { ++ return ov; ++ } else { ++ return http_message_object_new_ex(http_message_object_ce, msg, NULL); ++ } ++} ++ ++STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ptr TSRMLS_DC) ++{ ++ STATUS status = SUCCESS; ++ char *url = http_absolute_url(Z_STRVAL_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("url")-1, 0 TSRMLS_CC))); ++ ++ if (!url) { ++ return FAILURE; ++ } ++ ++ http_request_reset(obj->request); ++ obj->request->url = url; ++ HTTP_CHECK_CURL_INIT(obj->request->ch, http_curl_init(obj->request), return FAILURE); ++ ++ switch (obj->request->meth = Z_LVAL_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("method")-1, 0 TSRMLS_CC))) ++ { ++ case HTTP_GET: ++ case HTTP_HEAD: ++ break; ++ ++ case HTTP_PUT: ++ { ++ zval *put_file = zend_read_property(THIS_CE, getThis(), ZEND_STRS("putFile")-1, 0 TSRMLS_CC); ++ ++ http_request_object_check_request_content_type(getThis()); ++ ++ if (Z_STRLEN_P(put_file)) { ++ php_stream_statbuf ssb; ++ php_stream *stream = php_stream_open_wrapper_ex(Z_STRVAL_P(put_file), "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT); ++ ++ if (stream && SUCCESS == php_stream_stat(stream, &ssb)) { ++ obj->request->body = http_request_body_init_ex(obj->request->body, HTTP_REQUEST_BODY_UPLOADFILE, stream, ssb.sb.st_size, 1); ++ } else { ++ status = FAILURE; ++ } ++ } else { ++ zval *put_data = zend_read_property(THIS_CE, getThis(), ZEND_STRS("putData")-1, 0 TSRMLS_CC); ++ obj->request->body = http_request_body_init_ex(obj->request->body, HTTP_REQUEST_BODY_CSTRING, ++ estrndup(Z_STRVAL_P(put_data), Z_STRLEN_P(put_data)), Z_STRLEN_P(put_data), 1); ++ } ++ break; ++ } ++ ++ case HTTP_POST: ++ default: ++ { ++ /* check for raw request body */ ++ zval *raw_data = zend_read_property(THIS_CE, getThis(), ZEND_STRS("requestBody")-1, 0 TSRMLS_CC); ++ ++ if (Z_STRLEN_P(raw_data)) { ++ http_request_object_check_request_content_type(getThis()); ++ obj->request->body = http_request_body_init_ex(obj->request->body, HTTP_REQUEST_BODY_CSTRING, ++ estrndup(Z_STRVAL_P(raw_data), Z_STRLEN_P(raw_data)), Z_STRLEN_P(raw_data), 1); ++ } else { ++ zval *zfields = zend_read_property(THIS_CE, getThis(), ZEND_STRS("postFields")-1, 0 TSRMLS_CC), *zfiles = zend_read_property(THIS_CE, getThis(), ZEND_STRS("postFiles")-1, 0 TSRMLS_CC); ++ HashTable *fields; ++ HashTable *files; ++ ++ fields = (Z_TYPE_P(zfields) == IS_ARRAY) ? Z_ARRVAL_P(zfields) : NULL; ++ files = (Z_TYPE_P(zfiles) == IS_ARRAY) ? Z_ARRVAL_P(zfiles) : NULL; ++ ++ if ((fields && zend_hash_num_elements(fields)) || (files && zend_hash_num_elements(files))) { ++ if (!(obj->request->body = http_request_body_fill(obj->request->body, fields, files))) { ++ status = FAILURE; ++ } ++ } ++ } ++ break; ++ } ++ } ++ ++ if (status == SUCCESS) { ++ zval *qdata = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryData")-1, 0 TSRMLS_CC); ++ zval *options = zend_read_property(THIS_CE, getThis(), ZEND_STRS("options")-1, 0 TSRMLS_CC); ++ ++ if (Z_STRLEN_P(qdata)) { ++ if (!strchr(obj->request->url, '?')) { ++ strlcat(obj->request->url, "?", HTTP_URL_MAXLEN); ++ } else { ++ strlcat(obj->request->url, "&", HTTP_URL_MAXLEN); ++ } ++ strlcat(obj->request->url, Z_STRVAL_P(qdata), HTTP_URL_MAXLEN); ++ } ++ ++ http_request_prepare(obj->request, Z_ARRVAL_P(options)); ++ ++ /* check if there's a onProgress method and add it as progress callback if one isn't already set */ ++ if (zend_hash_exists(&Z_OBJCE_P(getThis())->function_table, "onprogress", sizeof("onprogress"))) { ++ zval **entry, *pcb; ++ ++ if ( (Z_TYPE_P(options) != IS_ARRAY) ++ || (SUCCESS != zend_hash_find(Z_ARRVAL_P(options), "onprogress", sizeof("onprogress"), (void *) &entry) ++ || (!HTTP_IS_CALLABLE(*entry, 0, NULL)))) { ++ MAKE_STD_ZVAL(pcb); ++ array_init(pcb); ++ ZVAL_ADDREF(getThis()); ++ add_next_index_zval(pcb, getThis()); ++ add_next_index_stringl(pcb, "onprogress", lenof("onprogress"), 1); ++ http_request_set_progress_callback(obj->request, pcb); ++ zval_ptr_dtor(&pcb); ++ } ++ } ++ } ++ ++ return status; ++} ++ ++STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this_ptr TSRMLS_DC) ++{ ++ STATUS ret; ++ zval *info; ++ http_message *msg; ++ ++ /* always fetch info */ ++ MAKE_STD_ZVAL(info); ++ array_init(info); ++ http_request_info(obj->request, Z_ARRVAL_P(info)); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("responseInfo")-1, info TSRMLS_CC); ++ zval_ptr_dtor(&info); ++ ++ /* parse response message */ ++ phpstr_fix(&obj->request->conv.request); ++ phpstr_fix(&obj->request->conv.response); ++ ++ if ((msg = http_message_parse(PHPSTR_VAL(&obj->request->conv.response), PHPSTR_LEN(&obj->request->conv.response)))) { ++ zval *message; ++ ++ if (i_zend_is_true(zend_read_property(THIS_CE, getThis(), ZEND_STRS("recordHistory")-1, 0 TSRMLS_CC))) { ++ zval *hist, *history = zend_read_property(THIS_CE, getThis(), ZEND_STRS("history")-1, 0 TSRMLS_CC); ++ http_message *response = http_message_parse(PHPSTR_VAL(&obj->request->conv.response), PHPSTR_LEN(&obj->request->conv.response)); ++ http_message *request = http_message_parse(PHPSTR_VAL(&obj->request->conv.request), PHPSTR_LEN(&obj->request->conv.request)); ++ ++ MAKE_STD_ZVAL(hist); ++ ZVAL_OBJVAL(hist, http_request_object_message(getThis(), http_message_interconnect(response, request)), 0); ++ if (Z_TYPE_P(history) == IS_OBJECT) { ++ http_message_object_prepend(hist, history); ++ } ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("history")-1, hist TSRMLS_CC); ++ zval_ptr_dtor(&hist); ++ } ++ ++ zend_update_property_long(THIS_CE, getThis(), ZEND_STRS("responseCode")-1, msg->http.info.response.code TSRMLS_CC); ++ zend_update_property_string(THIS_CE, getThis(), ZEND_STRS("responseStatus")-1, STR_PTR(msg->http.info.response.status) TSRMLS_CC); ++ ++ MAKE_STD_ZVAL(message); ++ ZVAL_OBJVAL(message, http_request_object_message(getThis(), msg), 0); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, message TSRMLS_CC); ++ zval_ptr_dtor(&message); ++ ++ ret = SUCCESS; ++ } else { ++ /* update properties with empty values*/ ++ zval *znull; ++ ++ MAKE_STD_ZVAL(znull); ++ ZVAL_NULL(znull); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, znull TSRMLS_CC); ++ zval_ptr_dtor(&znull); ++ ++ zend_update_property_long(THIS_CE, getThis(), ZEND_STRS("responseCode")-1, 0 TSRMLS_CC); ++ zend_update_property_string(THIS_CE, getThis(), ZEND_STRS("responseStatus")-1, "" TSRMLS_CC); ++ ++ /* append request message to history */ ++ if (i_zend_is_true(zend_read_property(THIS_CE, getThis(), ZEND_STRS("recordHistory")-1, 0 TSRMLS_CC))) { ++ http_message *request; ++ ++ if ((request = http_message_parse(PHPSTR_VAL(&obj->request->conv.request), PHPSTR_LEN(&obj->request->conv.request)))) { ++ zval *hist, *history = zend_read_property(THIS_CE, getThis(), ZEND_STRS("history")-1, 0 TSRMLS_CC); ++ ++ MAKE_STD_ZVAL(hist); ++ ZVAL_OBJVAL(hist, http_request_object_message(getThis(), request), 0); ++ if (Z_TYPE_P(history) == IS_OBJECT) { ++ http_message_object_prepend(hist, history); ++ } ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("history")-1, hist TSRMLS_CC); ++ zval_ptr_dtor(&hist); ++ } ++ } ++ ++ ret = FAILURE; ++ } ++ ++ http_request_set_progress_callback(obj->request, NULL); ++ ++ if (!EG(exception) && zend_hash_exists(&Z_OBJCE_P(getThis())->function_table, "onfinish", sizeof("onfinish"))) { ++ zval *param; ++ ++ MAKE_STD_ZVAL(param); ++ ZVAL_BOOL(param, ret == SUCCESS); ++ with_error_handling(EH_NORMAL, NULL) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "onfinish", NULL, param); ++ } end_error_handling(); ++ zval_ptr_dtor(¶m); ++ } ++ ++ return ret; ++} ++#ifdef ZEND_ENGINE_2_4 ++# define APK_DC TSRMLS_DC ++#else ++# define APK_DC ++#endif ++static int apply_pretty_key(void *pDest APK_DC, int num_args, va_list args, zend_hash_key *hash_key) ++{ ++ if (hash_key->arKey && hash_key->nKeyLength > 1) { ++ hash_key->h = zend_hash_func(pretty_key(hash_key->arKey, hash_key->nKeyLength - 1, 1, 0), hash_key->nKeyLength); ++ } ++ return ZEND_HASH_APPLY_KEEP; ++} ++ ++#define http_request_object_set_options_subr(key, ow, pk) \ ++ _http_request_object_set_options_subr(INTERNAL_FUNCTION_PARAM_PASSTHRU, (key), sizeof(key), (ow), (pk)) ++static inline void _http_request_object_set_options_subr(INTERNAL_FUNCTION_PARAMETERS, char *key, size_t len, int overwrite, int prettify_keys) ++{ ++ zval *old_opts, *new_opts, *opts = NULL, **entry = NULL; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a/!", &opts)) { ++ RETURN_FALSE; ++ } ++ ++ MAKE_STD_ZVAL(new_opts); ++ array_init(new_opts); ++ old_opts = zend_read_property(THIS_CE, getThis(), ZEND_STRS("options")-1, 0 TSRMLS_CC); ++ if (Z_TYPE_P(old_opts) == IS_ARRAY) { ++ array_copy(Z_ARRVAL_P(old_opts), Z_ARRVAL_P(new_opts)); ++ } ++ ++ if (SUCCESS == zend_hash_find(Z_ARRVAL_P(new_opts), key, len, (void *) &entry)) { ++ if (overwrite) { ++ zend_hash_clean(Z_ARRVAL_PP(entry)); ++ } ++ if (opts && zend_hash_num_elements(Z_ARRVAL_P(opts))) { ++ if (overwrite) { ++ array_copy(Z_ARRVAL_P(opts), Z_ARRVAL_PP(entry)); ++ } else { ++ array_join(Z_ARRVAL_P(opts), Z_ARRVAL_PP(entry), 0, prettify_keys ? ARRAY_JOIN_PRETTIFY : 0); ++ } ++ } ++ } else if (opts) { ++ if (prettify_keys) { ++ zend_hash_apply_with_arguments(Z_ARRVAL_P(opts) HTTP_ZAPI_HASH_TSRMLS_CC, apply_pretty_key, 0, NULL); ++ } ++ ZVAL_ADDREF(opts); ++ add_assoc_zval_ex(new_opts, key, len, opts); ++ } ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("options")-1, new_opts TSRMLS_CC); ++ zval_ptr_dtor(&new_opts); ++ ++ RETURN_TRUE; ++} ++ ++#define http_request_object_get_options_subr(key) \ ++ _http_request_get_options_subr(INTERNAL_FUNCTION_PARAM_PASSTHRU, (key), sizeof(key)) ++static inline void _http_request_get_options_subr(INTERNAL_FUNCTION_PARAMETERS, char *key, size_t len) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *opts, **options; ++ ++ opts = zend_read_property(THIS_CE, getThis(), ZEND_STRS("options")-1, 0 TSRMLS_CC); ++ array_init(return_value); ++ ++ if ( (Z_TYPE_P(opts) == IS_ARRAY) && ++ (SUCCESS == zend_hash_find(Z_ARRVAL_P(opts), key, len, (void *) &options))) { ++ convert_to_array(*options); ++ array_copy(Z_ARRVAL_PP(options), Z_ARRVAL_P(return_value)); ++ } ++ } ++} ++ ++ ++/* ### USERLAND ### */ ++ ++/* {{{ proto void HttpRequest::__construct([string url[, int request_method = HTTP_METH_GET[, array options]]]) ++ Create a new HttpRequest object instance. */ ++PHP_METHOD(HttpRequest, __construct) ++{ ++ char *URL = NULL; ++ int URL_len; ++ long meth = -1; ++ zval *options = NULL; ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sla!", &URL, &URL_len, &meth, &options)) { ++ if (URL) { ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("url")-1, URL, URL_len TSRMLS_CC); ++ } ++ if (meth > -1) { ++ zend_update_property_long(THIS_CE, getThis(), ZEND_STRS("method")-1, meth TSRMLS_CC); ++ } ++ if (options) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "setoptions", NULL, options); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto HttpRequest HttpRequest::factory([string url[, int request_method HTTP_METH_GET[, array options[, string class_name = "HttpRequest"]]]]) ++ Create a new HttpRequest object instance. */ ++PHP_METHOD(HttpRequest, factory) ++{ ++ char *cn = NULL, *URL = NULL; ++ int cl = 0, URL_len = 0; ++ long meth = -1; ++ zval *options = NULL; ++ zend_object_value ov; ++ ++ SET_EH_THROW_HTTP(); ++ if ( SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sla!s", &URL, &URL_len, &meth, &options, &cn, &cl) && ++ SUCCESS == http_object_new(&ov, cn, cl, _http_request_object_new_ex, http_request_object_ce, NULL, NULL)) { ++ RETVAL_OBJVAL(ov, 0); ++ getThis() = return_value; ++ if (URL) { ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("url")-1, URL, URL_len TSRMLS_CC); ++ } ++ if (meth > -1) { ++ zend_update_property_long(THIS_CE, getThis(), ZEND_STRS("method")-1, meth TSRMLS_CC); ++ } ++ if (options) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "setoptions", NULL, options); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setOptions([array options]) ++ Set the request options to use. See http_get() for a full list of available options. */ ++PHP_METHOD(HttpRequest, setOptions) ++{ ++ HashKey key = initHashKey(0); ++ HashPosition pos; ++ zval *opts = NULL, *old_opts, *new_opts, *add_opts, **opt; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!/", &opts)) { ++ RETURN_FALSE; ++ } ++ ++ MAKE_STD_ZVAL(new_opts); ++ array_init(new_opts); ++ ++ if (!opts || !zend_hash_num_elements(Z_ARRVAL_P(opts))) { ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("options")-1, new_opts TSRMLS_CC); ++ zval_ptr_dtor(&new_opts); ++ RETURN_TRUE; ++ } ++ ++ MAKE_STD_ZVAL(add_opts); ++ array_init(add_opts); ++ /* some options need extra attention -- thus cannot use array_merge() directly */ ++ FOREACH_KEYVAL(pos, opts, key, opt) { ++ if (key.type == HASH_KEY_IS_STRING) { ++#define KEYMATCH(k, s) ((sizeof(s)==k.len) && !strcasecmp(k.str, s)) ++ if (KEYMATCH(key, "headers")) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "addheaders", NULL, *opt); ++ } else if (KEYMATCH(key, "cookies")) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "addcookies", NULL, *opt); ++ } else if (KEYMATCH(key, "ssl")) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "addssloptions", NULL, *opt); ++ } else if (KEYMATCH(key, "url") || KEYMATCH(key, "uri")) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "seturl", NULL, *opt); ++ } else if (KEYMATCH(key, "method")) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "setmethod", NULL, *opt); ++ } else if (KEYMATCH(key, "flushcookies")) { ++ getObject(http_request_object, obj); ++ if (i_zend_is_true(*opt)) { ++ http_request_flush_cookies(obj->request); ++ } ++ } else if (KEYMATCH(key, "resetcookies")) { ++ getObject(http_request_object, obj); ++ http_request_reset_cookies(obj->request, (zend_bool) i_zend_is_true(*opt)); ++ } else if (KEYMATCH(key, "enablecookies")) { ++ getObject(http_request_object, obj); ++ http_request_enable_cookies(obj->request); ++ } else if (KEYMATCH(key, "recordHistory")) { ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("recordHistory")-1, *opt TSRMLS_CC); ++ } else if (KEYMATCH(key, "messageClass")) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "setmessageclass", NULL, *opt); ++ } else if (Z_TYPE_PP(opt) == IS_NULL) { ++ old_opts = zend_read_property(THIS_CE, getThis(), ZEND_STRS("options")-1, 0 TSRMLS_CC); ++ if (Z_TYPE_P(old_opts) == IS_ARRAY) { ++ zend_hash_del(Z_ARRVAL_P(old_opts), key.str, key.len); ++ } ++ } else { ++ ZVAL_ADDREF(*opt); ++ add_assoc_zval_ex(add_opts, key.str, key.len, *opt); ++ } ++ } ++ } ++ ++ old_opts = zend_read_property(THIS_CE, getThis(), ZEND_STRS("options")-1, 0 TSRMLS_CC); ++ if (Z_TYPE_P(old_opts) == IS_ARRAY) { ++ array_copy(Z_ARRVAL_P(old_opts), Z_ARRVAL_P(new_opts)); ++ } ++ array_join(Z_ARRVAL_P(add_opts), Z_ARRVAL_P(new_opts), 0, 0); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("options")-1, new_opts TSRMLS_CC); ++ zval_ptr_dtor(&new_opts); ++ zval_ptr_dtor(&add_opts); ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequest::getOptions() ++ Get currently set options. */ ++PHP_METHOD(HttpRequest, getOptions) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(options); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setSslOptions([array options]) ++ Set SSL options. */ ++PHP_METHOD(HttpRequest, setSslOptions) ++{ ++ http_request_object_set_options_subr("ssl", 1, 0); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addSslOptions(array options) ++ Set additional SSL options. */ ++PHP_METHOD(HttpRequest, addSslOptions) ++{ ++ http_request_object_set_options_subr("ssl", 0, 0); ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequest::getSslOtpions() ++ Get previously set SSL options. */ ++PHP_METHOD(HttpRequest, getSslOptions) ++{ ++ http_request_object_get_options_subr("ssl"); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addHeaders(array headers) ++ Add request header name/value pairs. */ ++PHP_METHOD(HttpRequest, addHeaders) ++{ ++ http_request_object_set_options_subr("headers", 0, 1); ++} ++ ++/* {{{ proto bool HttpRequest::setHeaders([array headers]) ++ Set request header name/value pairs. */ ++PHP_METHOD(HttpRequest, setHeaders) ++{ ++ http_request_object_set_options_subr("headers", 1, 1); ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequest::getHeaders() ++ Get previously set request headers. */ ++PHP_METHOD(HttpRequest, getHeaders) ++{ ++ http_request_object_get_options_subr("headers"); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setCookies([array cookies]) ++ Set cookies. */ ++PHP_METHOD(HttpRequest, setCookies) ++{ ++ http_request_object_set_options_subr("cookies", 1, 0); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addCookies(array cookies) ++ Add cookies. */ ++PHP_METHOD(HttpRequest, addCookies) ++{ ++ http_request_object_set_options_subr("cookies", 0, 0); ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequest::getCookies() ++ Get previously set cookies. */ ++PHP_METHOD(HttpRequest, getCookies) ++{ ++ http_request_object_get_options_subr("cookies"); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::enableCookies() ++ Enable automatic sending of received cookies. Note that customly set cookies will be sent anyway. */ ++PHP_METHOD(HttpRequest, enableCookies) ++{ ++ NO_ARGS { ++ getObject(http_request_object, obj); ++ RETURN_SUCCESS(http_request_enable_cookies(obj->request)); ++ } ++ ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::resetCookies([bool session_only = FALSE]) ++ Reset all automatically received/sent cookies. Note that customly set cookies are not affected. */ ++PHP_METHOD(HttpRequest, resetCookies) ++{ ++ zend_bool session_only = 0; ++ getObject(http_request_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &session_only)) { ++ RETURN_FALSE; ++ } ++ RETURN_SUCCESS(http_request_reset_cookies(obj->request, session_only)); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::flushCookies() ++ Flush internal cookies to the cookiestore file */ ++PHP_METHOD(HttpRequest, flushCookies) ++{ ++ NO_ARGS { ++ getObject(http_request_object, obj); ++ RETURN_SUCCESS(http_request_flush_cookies(obj->request)); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setUrl(string url) ++ Set the request URL. */ ++PHP_METHOD(HttpRequest, setUrl) ++{ ++ char *URL = NULL; ++ int URL_len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &URL, &URL_len)) { ++ RETURN_FALSE; ++ } ++ ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("url")-1, URL, URL_len TSRMLS_CC); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getUrl() ++ Get the previously set request URL. */ ++PHP_METHOD(HttpRequest, getUrl) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(url); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setMethod(int request_method) ++ Set the request method. */ ++PHP_METHOD(HttpRequest, setMethod) ++{ ++ long meth; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &meth)) { ++ RETURN_FALSE; ++ } ++ ++ zend_update_property_long(THIS_CE, getThis(), ZEND_STRS("method")-1, meth TSRMLS_CC); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto int HttpRequest::getMethod() ++ Get the previously set request method. */ ++PHP_METHOD(HttpRequest, getMethod) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(method); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setContentType(string content_type) ++ Set the content type the post request should have. */ ++PHP_METHOD(HttpRequest, setContentType) ++{ ++ char *ctype; ++ int ct_len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ctype, &ct_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (ct_len) { ++ HTTP_CHECK_CONTENT_TYPE(ctype, RETURN_FALSE); ++ } ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("contentType")-1, ctype, ct_len TSRMLS_CC); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getContentType() ++ Get the previously content type. */ ++PHP_METHOD(HttpRequest, getContentType) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(contentType); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setQueryData([mixed query_data]) ++ Set the URL query parameters to use, overwriting previously set query parameters. */ ++PHP_METHOD(HttpRequest, setQueryData) ++{ ++ zval *qdata = NULL; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!", &qdata)) { ++ RETURN_FALSE; ++ } ++ ++ if ((!qdata) || Z_TYPE_P(qdata) == IS_NULL) { ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("queryData")-1, "", 0 TSRMLS_CC); ++ } else if ((Z_TYPE_P(qdata) == IS_ARRAY) || (Z_TYPE_P(qdata) == IS_OBJECT)) { ++ char *query_data = NULL; ++ ++ if (SUCCESS != http_urlencode_hash(HASH_OF(qdata), &query_data)) { ++ RETURN_FALSE; ++ } ++ ++ zend_update_property_string(THIS_CE, getThis(), ZEND_STRS("queryData")-1, query_data TSRMLS_CC); ++ efree(query_data); ++ } else { ++ zval *data = http_zsep(IS_STRING, qdata); ++ ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("queryData")-1, Z_STRVAL_P(data), Z_STRLEN_P(data) TSRMLS_CC); ++ zval_ptr_dtor(&data); ++ } ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getQueryData() ++ Get the current query data in form of an urlencoded query string. */ ++PHP_METHOD(HttpRequest, getQueryData) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(queryData); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addQueryData(array query_params) ++ Add parameters to the query parameter list, leaving previously set unchanged. */ ++PHP_METHOD(HttpRequest, addQueryData) ++{ ++ zval *qdata, *old_qdata; ++ char *query_data = NULL; ++ size_t query_data_len = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &qdata)) { ++ RETURN_FALSE; ++ } ++ ++ old_qdata = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryData")-1, 0 TSRMLS_CC); ++ ++ if (SUCCESS != http_urlencode_hash_ex(HASH_OF(qdata), 1, Z_STRVAL_P(old_qdata), Z_STRLEN_P(old_qdata), &query_data, &query_data_len)) { ++ RETURN_FALSE; ++ } ++ ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("queryData")-1, query_data, query_data_len TSRMLS_CC); ++ efree(query_data); ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addPostFields(array post_data) ++ Adds POST data entries, leaving previously set unchanged, unless a post entry with the same name already exists. */ ++PHP_METHOD(HttpRequest, addPostFields) ++{ ++ zval *post_data, *old_post, *new_post; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &post_data)) { ++ RETURN_FALSE; ++ } ++ ++ if (zend_hash_num_elements(Z_ARRVAL_P(post_data))) { ++ MAKE_STD_ZVAL(new_post); ++ array_init(new_post); ++ old_post = zend_read_property(THIS_CE, getThis(), ZEND_STRS("postFields")-1, 0 TSRMLS_CC); ++ if (Z_TYPE_P(old_post) == IS_ARRAY) { ++ array_copy(Z_ARRVAL_P(old_post), Z_ARRVAL_P(new_post)); ++ } ++ array_join(Z_ARRVAL_P(post_data), Z_ARRVAL_P(new_post), 0, 0); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("postFields")-1, new_post TSRMLS_CC); ++ zval_ptr_dtor(&new_post); ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setPostFields([array post_data]) ++ Set the POST data entries, overwriting previously set POST data. */ ++PHP_METHOD(HttpRequest, setPostFields) ++{ ++ zval *post, *post_data = NULL; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!", &post_data)) { ++ RETURN_FALSE; ++ } ++ ++ MAKE_STD_ZVAL(post); ++ array_init(post); ++ if (post_data && zend_hash_num_elements(Z_ARRVAL_P(post_data))) { ++ array_copy(Z_ARRVAL_P(post_data), Z_ARRVAL_P(post)); ++ } ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("postFields")-1, post TSRMLS_CC); ++ zval_ptr_dtor(&post); ++ ++ RETURN_TRUE; ++} ++/* }}}*/ ++ ++/* {{{ proto array HttpRequest::getPostFields() ++ Get previously set POST data. */ ++PHP_METHOD(HttpRequest, getPostFields) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(postFields); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setBody([string request_body_data]) ++ Set request body to send, overwriting previously set request body. Don't forget to specify a content type. */ ++PHP_METHOD(HttpRequest, setBody) ++{ ++ char *raw_data = NULL; ++ int data_len = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &raw_data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!raw_data) { ++ raw_data = ""; ++ } ++ ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("requestBody")-1, raw_data, data_len TSRMLS_CC); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addBody(string request_body_data) ++ Add request body data, leaving previously set request body data unchanged. */ ++PHP_METHOD(HttpRequest, addBody) ++{ ++ char *raw_data; ++ int data_len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &raw_data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (data_len) { ++ zval *data = zend_read_property(THIS_CE, getThis(), ZEND_STRS("requestBody")-1, 0 TSRMLS_CC); ++ ++ if (Z_STRLEN_P(data)) { ++ Z_STRVAL_P(data) = erealloc(Z_STRVAL_P(data), (Z_STRLEN_P(data) += data_len) + 1); ++ Z_STRVAL_P(data)[Z_STRLEN_P(data)] = '\0'; ++ memcpy(Z_STRVAL_P(data) + Z_STRLEN_P(data) - data_len, raw_data, data_len); ++ } else { ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("requestBody")-1, raw_data, data_len TSRMLS_CC); ++ } ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getBody() ++ Get previously set request body data. */ ++PHP_METHOD(HttpRequest, getBody) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(requestBody); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addPostFile(string name, string file[, string content_type = "application/x-octetstream"]) ++ Add a file to the POST request, leaving previously set files unchanged. */ ++PHP_METHOD(HttpRequest, addPostFile) ++{ ++ zval *entry, *old_post, *new_post; ++ char *name, *file, *type = NULL; ++ int name_len, file_len, type_len = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", &name, &name_len, &file, &file_len, &type, &type_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (type_len) { ++ HTTP_CHECK_CONTENT_TYPE(type, RETURN_FALSE); ++ } else { ++ type = "application/x-octetstream"; ++ type_len = sizeof("application/x-octetstream") - 1; ++ } ++ ++ MAKE_STD_ZVAL(entry); ++ array_init(entry); ++ ++ add_assoc_stringl(entry, "name", name, name_len, 1); ++ add_assoc_stringl(entry, "type", type, type_len, 1); ++ add_assoc_stringl(entry, "file", file, file_len, 1); ++ ++ MAKE_STD_ZVAL(new_post); ++ array_init(new_post); ++ old_post = zend_read_property(THIS_CE, getThis(), ZEND_STRS("postFiles")-1, 0 TSRMLS_CC); ++ if (Z_TYPE_P(old_post) == IS_ARRAY) { ++ array_copy(Z_ARRVAL_P(old_post), Z_ARRVAL_P(new_post)); ++ } ++ add_next_index_zval(new_post, entry); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("postFiles")-1, new_post TSRMLS_CC); ++ zval_ptr_dtor(&new_post); ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setPostFiles([array post_files]) ++ Set files to post, overwriting previously set post files. */ ++PHP_METHOD(HttpRequest, setPostFiles) ++{ ++ zval *files = NULL, *post; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!/", &files)) { ++ RETURN_FALSE; ++ } ++ ++ MAKE_STD_ZVAL(post); ++ array_init(post); ++ if (files && (Z_TYPE_P(files) == IS_ARRAY)) { ++ array_copy(Z_ARRVAL_P(files), Z_ARRVAL_P(post)); ++ } ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("postFiles")-1, post TSRMLS_CC); ++ zval_ptr_dtor(&post); ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequest::getPostFiles() ++ Get all previously added POST files. */ ++PHP_METHOD(HttpRequest, getPostFiles) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(postFiles); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setPutFile([string file]) ++ Set file to put. Affects only PUT requests. */ ++PHP_METHOD(HttpRequest, setPutFile) ++{ ++ char *file = ""; ++ int file_len = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &file, &file_len)) { ++ RETURN_FALSE; ++ } ++ ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("putFile")-1, file, file_len TSRMLS_CC); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getPutFile() ++ Get previously set put file. */ ++PHP_METHOD(HttpRequest, getPutFile) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(putFile); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setPutData([string put_data]) ++ Set PUT data to send, overwriting previously set PUT data. */ ++PHP_METHOD(HttpRequest, setPutData) ++{ ++ char *put_data = NULL; ++ int data_len = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &put_data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!put_data) { ++ put_data = ""; ++ } ++ ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("putData")-1, put_data, data_len TSRMLS_CC); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addPutData(string put_data) ++ Add PUT data, leaving previously set PUT data unchanged. */ ++PHP_METHOD(HttpRequest, addPutData) ++{ ++ char *put_data; ++ int data_len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &put_data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (data_len) { ++ zval *data = zend_read_property(THIS_CE, getThis(), ZEND_STRS("putData")-1, 0 TSRMLS_CC); ++ ++ if (Z_STRLEN_P(data)) { ++ Z_STRVAL_P(data) = erealloc(Z_STRVAL_P(data), (Z_STRLEN_P(data) += data_len) + 1); ++ Z_STRVAL_P(data)[Z_STRLEN_P(data)] = '\0'; ++ memcpy(Z_STRVAL_P(data) + Z_STRLEN_P(data) - data_len, put_data, data_len); ++ } else { ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("putData")-1, put_data, data_len TSRMLS_CC); ++ } ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getPutData() ++ Get previously set PUT data. */ ++PHP_METHOD(HttpRequest, getPutData) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(putData); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequest::getResponseData() ++ Get all response data after the request has been sent. */ ++PHP_METHOD(HttpRequest, getResponseData) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ char *body; ++ size_t body_len; ++ zval *headers, *message = zend_read_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, 0 TSRMLS_CC); ++ ++ if (Z_TYPE_P(message) == IS_OBJECT) { ++ getObjectEx(http_message_object, msg, message); ++ ++ array_init(return_value); ++ ++ MAKE_STD_ZVAL(headers); ++ array_init(headers); ++ zend_hash_copy(Z_ARRVAL_P(headers), &msg->message->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ add_assoc_zval(return_value, "headers", headers); ++ ++ phpstr_data(PHPSTR(msg->message), &body, &body_len); ++ add_assoc_stringl(return_value, "body", body, body_len, 0); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto mixed HttpRequest::getResponseHeader([string name]) ++ Get response header(s) after the request has been sent. */ ++PHP_METHOD(HttpRequest, getResponseHeader) ++{ ++ if (return_value_used) { ++ zval *header; ++ char *header_name = NULL; ++ int header_len = 0; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &header_name, &header_len)) { ++ zval *message = zend_read_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, 0 TSRMLS_CC); ++ ++ if (Z_TYPE_P(message) == IS_OBJECT) { ++ getObjectEx(http_message_object, msg, message); ++ ++ if (header_len) { ++ if ((header = http_message_header_ex(msg->message, pretty_key(header_name, header_len, 1, 1), header_len + 1, 0))) { ++ RETURN_ZVAL(header, 1, 1); ++ } ++ } else { ++ array_init(return_value); ++ zend_hash_copy(Z_ARRVAL_P(return_value), &msg->message->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ return; ++ } ++ } ++ } ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequest::getResponseCookies([int flags[, array allowed_extras]]) ++ Get response cookie(s) after the request has been sent. */ ++PHP_METHOD(HttpRequest, getResponseCookies) ++{ ++ if (return_value_used) { ++ long flags = 0; ++ zval *allowed_extras_array = NULL; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|la!", &flags, &allowed_extras_array)) { ++ int i = 0; ++ HashKey key = initHashKey(0); ++ char **allowed_extras = NULL; ++ zval **header = NULL, **entry = NULL, *message = zend_read_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, 0 TSRMLS_CC); ++ HashPosition pos, pos1, pos2; ++ ++ if (Z_TYPE_P(message) == IS_OBJECT) { ++ getObjectEx(http_message_object, msg, message); ++ ++ array_init(return_value); ++ ++ if (allowed_extras_array) { ++ allowed_extras = ecalloc(zend_hash_num_elements(Z_ARRVAL_P(allowed_extras_array)) + 1, sizeof(char *)); ++ FOREACH_VAL(pos, allowed_extras_array, entry) { ++ zval *data = http_zsep(IS_STRING, *entry); ++ allowed_extras[i++] = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data)); ++ zval_ptr_dtor(&data); ++ } ++ } ++ ++ FOREACH_HASH_KEYVAL(pos1, &msg->message->hdrs, key, header) { ++ if (key.type == HASH_KEY_IS_STRING && !strcasecmp(key.str, "Set-Cookie")) { ++ http_cookie_list list; ++ ++ if (Z_TYPE_PP(header) == IS_ARRAY) { ++ zval **single_header; ++ ++ FOREACH_VAL(pos2, *header, single_header) { ++ zval *data = http_zsep(IS_STRING, *single_header); ++ ++ if (http_parse_cookie_ex(&list, Z_STRVAL_P(data), flags, allowed_extras)) { ++ zval *cookie; ++ ++ MAKE_STD_ZVAL(cookie); ++ object_init(cookie); ++ http_cookie_list_tostruct(&list, cookie); ++ add_next_index_zval(return_value, cookie); ++ http_cookie_list_dtor(&list); ++ } ++ zval_ptr_dtor(&data); ++ } ++ } else { ++ zval *data = http_zsep(IS_STRING, *header); ++ if (http_parse_cookie_ex(&list, Z_STRVAL_P(data), flags, allowed_extras)) { ++ zval *cookie; ++ ++ MAKE_STD_ZVAL(cookie); ++ object_init(cookie); ++ http_cookie_list_tostruct(&list, cookie); ++ add_next_index_zval(return_value, cookie); ++ http_cookie_list_dtor(&list); ++ } ++ zval_ptr_dtor(&data); ++ } ++ } ++ } ++ ++ if (allowed_extras) { ++ for (i = 0; allowed_extras[i]; ++i) { ++ efree(allowed_extras[i]); ++ } ++ efree(allowed_extras); ++ } ++ ++ return; ++ } ++ } ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getResponseBody() ++ Get the response body after the request has been sent. */ ++PHP_METHOD(HttpRequest, getResponseBody) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *message = zend_read_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, 0 TSRMLS_CC); ++ ++ if (Z_TYPE_P(message) == IS_OBJECT) { ++ getObjectEx(http_message_object, msg, message); ++ RETURN_PHPSTR_DUP(&msg->message->body); ++ } else { ++ RETURN_FALSE; ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto int HttpRequest::getResponseCode() ++ Get the response code after the request has been sent. */ ++PHP_METHOD(HttpRequest, getResponseCode) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(responseCode); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getResponseStatus() ++ Get the response status (i.e. the string after the response code) after the message has been sent. */ ++PHP_METHOD(HttpRequest, getResponseStatus) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(responseStatus); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto mixed HttpRequest::getResponseInfo([string name]) ++ Get response info after the request has been sent. */ ++PHP_METHOD(HttpRequest, getResponseInfo) ++{ ++ if (return_value_used) { ++ zval *info, **infop; ++ char *info_name = NULL; ++ int info_len = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &info_name, &info_len)) { ++ RETURN_FALSE; ++ } ++ ++ info = zend_read_property(THIS_CE, getThis(), ZEND_STRS("responseInfo")-1, 0 TSRMLS_CC); ++ ++ if (Z_TYPE_P(info) != IS_ARRAY) { ++ RETURN_FALSE; ++ } ++ ++ if (info_len && info_name) { ++ if (SUCCESS == zend_hash_find(Z_ARRVAL_P(info), pretty_key(info_name, info_len, 0, 0), info_len + 1, (void *) &infop)) { ++ RETURN_ZVAL(*infop, 1, 0); ++ } else { ++ http_error_ex(HE_NOTICE, HTTP_E_INVALID_PARAM, "Could not find response info named %s", info_name); ++ RETURN_FALSE; ++ } ++ } else { ++ RETURN_ZVAL(info, 1, 0); ++ } ++ } ++} ++/* }}}*/ ++ ++/* {{{ proto HttpMessage HttpRequest::getResponseMessage() ++ Get the full response as HttpMessage object after the request has been sent. */ ++PHP_METHOD(HttpRequest, getResponseMessage) ++{ ++ NO_ARGS { ++ zval *message; ++ ++ SET_EH_THROW_HTTP(); ++ message = zend_read_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, 0 TSRMLS_CC); ++ if (Z_TYPE_P(message) == IS_OBJECT) { ++ RETVAL_OBJECT(message, 1); ++ } else { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "HttpRequest does not contain a response message"); ++ } ++ SET_EH_NORMAL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpMessage HttpRequest::getRequestMessage() ++ Get sent HTTP message. */ ++PHP_METHOD(HttpRequest, getRequestMessage) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ http_message *msg; ++ getObject(http_request_object, obj); ++ ++ SET_EH_THROW_HTTP(); ++ if ((msg = http_message_parse(PHPSTR_VAL(&obj->request->conv.request), PHPSTR_LEN(&obj->request->conv.request)))) { ++ RETVAL_OBJVAL(http_request_object_message(getThis(), msg), 0); ++ } ++ SET_EH_NORMAL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getRawRequestMessage() ++ Get sent HTTP message. */ ++PHP_METHOD(HttpRequest, getRawRequestMessage) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_request_object, obj); ++ ++ RETURN_PHPSTR_DUP(&obj->request->conv.request); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getRawResponseMessage() ++ Get the entire HTTP response. */ ++PHP_METHOD(HttpRequest, getRawResponseMessage) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_request_object, obj); ++ ++ RETURN_PHPSTR_DUP(&obj->request->conv.response); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpMessage HttpRequest::getHistory() ++ Get all sent requests and received responses as an HttpMessage object. */ ++PHP_METHOD(HttpRequest, getHistory) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *hist; ++ ++ SET_EH_THROW_HTTP(); ++ hist = zend_read_property(THIS_CE, getThis(), ZEND_STRS("history")-1, 0 TSRMLS_CC); ++ if (Z_TYPE_P(hist) == IS_OBJECT) { ++ RETVAL_OBJECT(hist, 1); ++ } else { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "The history is empty"); ++ } ++ SET_EH_NORMAL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpRequest::clearHistory() ++ Clear the history. */ ++PHP_METHOD(HttpRequest, clearHistory) ++{ ++ NO_ARGS { ++ zval *hist; ++ ++ MAKE_STD_ZVAL(hist); ++ ZVAL_NULL(hist); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("history")-1, hist TSRMLS_CC); ++ zval_ptr_dtor(&hist); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getMessageClass() ++ Get the message class name. */ ++PHP_METHOD(HttpRequest, getMessageClass) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP("messageClass"); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void setMessageClass(string class_name) ++ Set the message class name. */ ++PHP_METHOD(HttpRequest, setMessageClass) ++{ ++ char *cn; ++ int cl; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &cn, &cl)) { ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("messageClass")-1, cn, cl TSRMLS_CC); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpMessage HttpRequest::send() ++ Send the HTTP request. */ ++PHP_METHOD(HttpRequest, send) ++{ ++ getObject(http_request_object, obj); ++ ++ NO_ARGS; ++ ++ SET_EH_THROW_HTTP(); ++ ++ RETVAL_FALSE; ++ ++ if (obj->pool) { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "Cannot perform HttpRequest::send() while attached to an HttpRequestPool"); ++ } else if (SUCCESS == http_request_object_requesthandler(obj, getThis())) { ++ http_request_exec(obj->request); ++ if (SUCCESS == http_request_object_responsehandler(obj, getThis())) { ++ RETVAL_OBJECT(zend_read_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, 0 TSRMLS_CC), 1); ++ } ++ } ++ ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++#endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_request_pool_api.c +@@ -0,0 +1,660 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_request_pool_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#define HTTP_WANT_EVENT ++#include "php_http.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) ++ ++#include "php_http_api.h" ++#include "php_http_exception_object.h" ++#include "php_http_persistent_handle_api.h" ++#include "php_http_request_api.h" ++#include "php_http_request_object.h" ++#include "php_http_request_pool_api.h" ++#include "php_http_requestpool_object.h" ++ ++#ifndef HTTP_DEBUG_REQPOOLS ++# define HTTP_DEBUG_REQPOOLS 0 ++#endif ++ ++#ifdef HTTP_HAVE_EVENT ++typedef struct _http_request_pool_event_t { ++ struct event evnt; ++ http_request_pool *pool; ++} http_request_pool_event; ++ ++static void http_request_pool_timeout_callback(int socket, short action, void *event_data); ++static void http_request_pool_event_callback(int socket, short action, void *event_data); ++static int http_request_pool_socket_callback(CURL *easy, curl_socket_t s, int action, void *, void *); ++static void http_request_pool_timer_callback(CURLM *multi, long timeout_ms, void *timer_data); ++#endif ++ ++static int http_request_pool_compare_handles(void *h1, void *h2); ++ ++PHP_MINIT_FUNCTION(http_request_pool) ++{ ++ if (SUCCESS != http_persistent_handle_provide("http_request_pool", curl_multi_init, (http_persistent_handle_dtor) curl_multi_cleanup, NULL)) { ++ return FAILURE; ++ } ++ return SUCCESS; ++} ++ ++#ifdef HTTP_HAVE_EVENT ++PHP_RINIT_FUNCTION(http_request_pool) ++{ ++ if (!HTTP_G->request.pool.event.base && !(HTTP_G->request.pool.event.base = event_init())) { ++ return FAILURE; ++ } ++ ++ return SUCCESS; ++} ++#endif ++ ++/* {{{ http_request_pool *http_request_pool_init(http_request_pool *) */ ++PHP_HTTP_API http_request_pool *_http_request_pool_init(http_request_pool *pool TSRMLS_DC) ++{ ++ zend_bool free_pool; ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Initializing request pool %p\n", pool); ++#endif ++ ++ if ((free_pool = (!pool))) { ++ pool = emalloc(sizeof(http_request_pool)); ++ pool->ch = NULL; ++ } ++ ++ if (SUCCESS != http_persistent_handle_acquire("http_request_pool", &pool->ch)) { ++ if (free_pool) { ++ efree(pool); ++ } ++ return NULL; ++ } ++ ++ TSRMLS_SET_CTX(pool->tsrm_ls); ++ ++#ifdef HTTP_HAVE_EVENT ++ pool->timeout = ecalloc(1, sizeof(struct event)); ++ curl_multi_setopt(pool->ch, CURLMOPT_SOCKETDATA, pool); ++ curl_multi_setopt(pool->ch, CURLMOPT_SOCKETFUNCTION, http_request_pool_socket_callback); ++ curl_multi_setopt(pool->ch, CURLMOPT_TIMERDATA, pool); ++ curl_multi_setopt(pool->ch, CURLMOPT_TIMERFUNCTION, http_request_pool_timer_callback); ++#endif ++ ++ pool->unfinished = 0; ++ zend_llist_init(&pool->finished, sizeof(zval *), (llist_dtor_func_t) ZVAL_PTR_DTOR, 0); ++ zend_llist_init(&pool->handles, sizeof(zval *), (llist_dtor_func_t) ZVAL_PTR_DTOR, 0); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Initialized request pool %p\n", pool); ++#endif ++ ++ return pool; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_request_pool_attach(http_request_pool *, zval *) */ ++PHP_HTTP_API STATUS _http_request_pool_attach(http_request_pool *pool, zval *request) ++{ ++#ifdef ZTS ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++#endif ++ getObjectEx(http_request_object, req, request); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Attaching HttpRequest(#%d) %p to pool %p\n", Z_OBJ_HANDLE_P(request), req, pool); ++#endif ++ ++ if (req->pool) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "HttpRequest object(#%d) is already member of %s HttpRequestPool", Z_OBJ_HANDLE_P(request), req->pool == pool ? "this" : "another"); ++ } else if (SUCCESS != http_request_object_requesthandler(req, request)) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "Could not initialize HttpRequest object(#%d) for attaching to the HttpRequestPool", Z_OBJ_HANDLE_P(request)); ++ } else { ++ CURLMcode code = curl_multi_add_handle(pool->ch, req->request->ch); ++ ++ if (CURLM_OK != code) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_POOL, "Could not attach HttpRequest object(#%d) to the HttpRequestPool: %s", Z_OBJ_HANDLE_P(request), curl_multi_strerror(code)); ++ } else { ++ req->pool = pool; ++ ++ ZVAL_ADDREF(request); ++ zend_llist_add_element(&pool->handles, &request); ++ ++pool->unfinished; ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "> %d HttpRequests attached to pool %p\n", zend_llist_count(&pool->handles), pool); ++#endif ++ return SUCCESS; ++ } ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_request_pool_detach(http_request_pool *, zval *) */ ++PHP_HTTP_API STATUS _http_request_pool_detach(http_request_pool *pool, zval *request) ++{ ++ CURLMcode code; ++#ifdef ZTS ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++#endif ++ getObjectEx(http_request_object, req, request); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Detaching HttpRequest(#%d) %p from pool %p\n", Z_OBJ_HANDLE_P(request), req, pool); ++#endif ++ ++ if (!req->pool) { ++ /* not attached to any pool */ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "HttpRequest object(#%d) %p is not attached to any HttpRequestPool\n", Z_OBJ_HANDLE_P(request), req); ++#endif ++ } else if (req->pool != pool) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "HttpRequest object(#%d) is not attached to this HttpRequestPool", Z_OBJ_HANDLE_P(request)); ++ } else if (req->request->_in_progress_cb) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_POOL, "HttpRequest object(#%d) cannot be detached from the HttpRequestPool while executing the progress callback", Z_OBJ_HANDLE_P(request)); ++ } else if (CURLM_OK != (code = curl_multi_remove_handle(pool->ch, req->request->ch))) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_POOL, "Could not detach HttpRequest object(#%d) from the HttpRequestPool: %s", Z_OBJ_HANDLE_P(request), curl_multi_strerror(code)); ++ } else { ++ req->pool = NULL; ++ zend_llist_del_element(&pool->finished, request, http_request_pool_compare_handles); ++ zend_llist_del_element(&pool->handles, request, http_request_pool_compare_handles); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "> %d HttpRequests remaining in pool %p\n", zend_llist_count(&pool->handles), pool); ++#endif ++ ++ return SUCCESS; ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ void http_request_pool_apply(http_request_pool *, http_request_pool_apply_func) */ ++PHP_HTTP_API void _http_request_pool_apply(http_request_pool *pool, http_request_pool_apply_func cb) ++{ ++ int count = zend_llist_count(&pool->handles); ++ ++ if (count) { ++ int i = 0; ++ zend_llist_position pos; ++ zval **handle, **handles = emalloc(count * sizeof(zval *)); ++ ++ for (handle = zend_llist_get_first_ex(&pool->handles, &pos); handle; handle = zend_llist_get_next_ex(&pool->handles, &pos)) { ++ handles[i++] = *handle; ++ } ++ ++ /* should never happen */ ++ if (i != count) { ++ zend_error(E_ERROR, "number of fetched request handles do not match overall count"); ++ count = i; ++ } ++ ++ for (i = 0; i < count; ++i) { ++ if (cb(pool, handles[i])) { ++ break; ++ } ++ } ++ efree(handles); ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_request_pool_apply_with_arg(http_request_pool *, http_request_pool_apply_with_arg_func, void *) */ ++PHP_HTTP_API void _http_request_pool_apply_with_arg(http_request_pool *pool, http_request_pool_apply_with_arg_func cb, void *arg) ++{ ++ int count = zend_llist_count(&pool->handles); ++ ++ if (count) { ++ int i = 0; ++ zend_llist_position pos; ++ zval **handle, **handles = emalloc(count * sizeof(zval *)); ++ ++ for (handle = zend_llist_get_first_ex(&pool->handles, &pos); handle; handle = zend_llist_get_next_ex(&pool->handles, &pos)) { ++ handles[i++] = *handle; ++ } ++ ++ /* should never happen */ ++ if (i != count) { ++ zend_error(E_ERROR, "number of fetched request handles do not match overall count"); ++ count = i; ++ } ++ ++ for (i = 0; i < count; ++i) { ++ if (cb(pool, handles[i], arg)) { ++ break; ++ } ++ } ++ efree(handles); ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_request_pool_detach_all(http_request_pool *) */ ++PHP_HTTP_API void _http_request_pool_detach_all(http_request_pool *pool) ++{ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Detaching %d requests from pool %p\n", zend_llist_count(&pool->handles), pool); ++#endif ++ http_request_pool_apply(pool, _http_request_pool_detach); ++} ++/* }}} */ ++ ++/* {{{ STATUS http_request_pool_send(http_request_pool *) */ ++PHP_HTTP_API STATUS _http_request_pool_send(http_request_pool *pool) ++{ ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Attempt to send %d requests of pool %p\n", zend_llist_count(&pool->handles), pool); ++#endif ++ ++#ifdef HTTP_HAVE_EVENT ++ if (pool->useevents) { ++ do { ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "& Starting event dispatcher of pool %p\n", pool); ++#endif ++ event_base_dispatch(HTTP_G->request.pool.event.base); ++ } while (pool->unfinished); ++ } else ++#endif ++ { ++ while (http_request_pool_perform(pool)) { ++ if (SUCCESS != http_request_pool_select(pool)) { ++#ifdef PHP_WIN32 ++ /* see http://msdn.microsoft.com/library/en-us/winsock/winsock/windows_sockets_error_codes_2.asp */ ++ http_error_ex(HE_WARNING, HTTP_E_SOCKET, "WinSock error: %d", WSAGetLastError()); ++#else ++ http_error(HE_WARNING, HTTP_E_SOCKET, strerror(errno)); ++#endif ++ return FAILURE; ++ } ++ } ++ } ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Finished sending %d HttpRequests of pool %p (still unfinished: %d)\n", zend_llist_count(&pool->handles), pool, pool->unfinished); ++#endif ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ void http_request_pool_dtor(http_request_pool *) */ ++PHP_HTTP_API void _http_request_pool_dtor(http_request_pool *pool) ++{ ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Destructing request pool %p\n", pool); ++#endif ++ ++#ifdef HTTP_HAVE_EVENT ++ efree(pool->timeout); ++#endif ++ ++ http_request_pool_detach_all(pool); ++ ++ pool->unfinished = 0; ++ zend_llist_clean(&pool->finished); ++ zend_llist_clean(&pool->handles); ++ http_persistent_handle_release("http_request_pool", &pool->ch); ++} ++/* }}} */ ++ ++#ifdef PHP_WIN32 ++# define SELECT_ERROR SOCKET_ERROR ++#else ++# define SELECT_ERROR -1 ++#endif ++ ++/* {{{ STATUS http_request_pool_select(http_request_pool *) */ ++PHP_HTTP_API STATUS _http_request_pool_select(http_request_pool *pool) ++{ ++ return http_request_pool_select_ex(pool, NULL); ++} ++/* }}} */ ++ ++/* {{{ STATUS http_request_pool_select_ex(http_request_pool *, struct timeval *) */ ++PHP_HTTP_API STATUS _http_request_pool_select_ex(http_request_pool *pool, struct timeval *custom_timeout) ++{ ++ int MAX; ++ fd_set R, W, E; ++ struct timeval timeout; ++ ++#ifdef HTTP_HAVE_EVENT ++ if (pool->useevents) { ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "not implemented; use HttpRequest callbacks"); ++ return FAILURE; ++ } ++#endif ++ ++ if (custom_timeout && timerisset(custom_timeout)) { ++ timeout = *custom_timeout; ++ } else { ++ http_request_pool_timeout(pool, &timeout); ++ } ++ ++ FD_ZERO(&R); ++ FD_ZERO(&W); ++ FD_ZERO(&E); ++ ++ if (CURLM_OK == curl_multi_fdset(pool->ch, &R, &W, &E, &MAX)) { ++ if (MAX == -1) { ++ http_sleep((double) timeout.tv_sec + (double) (timeout.tv_usec / HTTP_MCROSEC)); ++ return SUCCESS; ++ } else if (SELECT_ERROR != select(MAX + 1, &R, &W, &E, &timeout)) { ++ return SUCCESS; ++ } ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ int http_request_pool_perform(http_request_pool *) */ ++PHP_HTTP_API int _http_request_pool_perform(http_request_pool *pool) ++{ ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ ++#ifdef HTTP_HAVE_EVENT ++ if (pool->useevents) { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "not implemented; use HttpRequest callbacks"); ++ return FAILURE; ++ } ++#endif ++ ++ while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(pool->ch, &pool->unfinished)); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "%u unfinished requests of pool %p remaining\n", pool->unfinished, pool); ++#endif ++ ++ http_request_pool_responsehandler(pool); ++ ++ return pool->unfinished; ++} ++/* }}} */ ++ ++/* {{{ void http_request_pool_responsehandler(http_request_pool *) */ ++void _http_request_pool_responsehandler(http_request_pool *pool) ++{ ++ CURLMsg *msg; ++ int remaining = 0; ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ ++ do { ++ msg = curl_multi_info_read(pool->ch, &remaining); ++ if (msg && CURLMSG_DONE == msg->msg) { ++ if (CURLE_OK != msg->data.result) { ++ http_request_storage *st = http_request_storage_get(msg->easy_handle); ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "%s; %s (%s)", curl_easy_strerror(msg->data.result), st?st->errorbuffer:"", st?st->url:""); ++ } ++ http_request_pool_apply_with_arg(pool, _http_request_pool_apply_responsehandler, msg->easy_handle); ++ } ++ } while (remaining); ++} ++/* }}} */ ++ ++/* {{{ int http_request_pool_apply_responsehandler(http_request_pool *, zval *, void *) */ ++int _http_request_pool_apply_responsehandler(http_request_pool *pool, zval *req, void *ch) ++{ ++#ifdef ZTS ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++#endif ++ getObjectEx(http_request_object, obj, req); ++ ++ if ((!ch) || obj->request->ch == (CURL *) ch) { ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Fetching data from HttpRequest(#%d) %p of pool %p\n", Z_OBJ_HANDLE_P(req), obj, obj->pool); ++#endif ++ ++ ZVAL_ADDREF(req); ++ zend_llist_add_element(&obj->pool->finished, &req); ++ http_request_object_responsehandler(obj, req); ++ return 1; ++ } ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ struct timeval *_http_request_pool_timeout(http_request_pool *, struct timeval *) */ ++struct timeval *_http_request_pool_timeout(http_request_pool *pool, struct timeval *timeout) ++{ ++#ifdef HAVE_CURL_MULTI_TIMEOUT ++ long max_tout = 1000; ++ ++ if ((CURLM_OK == curl_multi_timeout(pool->ch, &max_tout)) && (max_tout > 0)) { ++ timeout->tv_sec = max_tout / 1000; ++ timeout->tv_usec = (max_tout % 1000) * 1000; ++ } else { ++#endif ++ timeout->tv_sec = 0; ++ timeout->tv_usec = 1000; ++#ifdef HAVE_CURL_MULTI_TIMEOUT ++ } ++#endif ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Calculating timeout (%lu, %lu) of pool %p\n", (ulong) timeout->tv_sec, (ulong) timeout->tv_usec, pool); ++#endif ++ ++ return timeout; ++} ++/* }}} */ ++ ++/*#*/ ++ ++/* {{{ static int http_request_pool_compare_handles(void *, void *) */ ++static int http_request_pool_compare_handles(void *h1, void *h2) ++{ ++ return (Z_OBJ_HANDLE_PP((zval **) h1) == Z_OBJ_HANDLE_P((zval *) h2)); ++} ++/* }}} */ ++ ++#ifdef HTTP_HAVE_EVENT ++/* {{{ static void http_request_pool_timeout_callback(int, short, void *) */ ++static void http_request_pool_timeout_callback(int socket, short action, void *event_data) ++{ ++ http_request_pool *pool = event_data; ++ ++ if (pool->useevents) { ++ CURLMcode rc; ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Timeout occurred of pool %p\n", pool); ++#endif ++ ++ while (CURLM_CALL_MULTI_PERFORM == (rc = curl_multi_socket(pool->ch, CURL_SOCKET_TIMEOUT, &pool->unfinished))); ++ ++ if (CURLM_OK != rc) { ++ http_error(HE_WARNING, HTTP_E_SOCKET, curl_multi_strerror(rc)); ++ } ++ ++ http_request_pool_responsehandler(pool); ++ } ++} ++/* }}} */ ++ ++/* {{{ static void http_request_pool_event_callback(int, short, void *) */ ++static void http_request_pool_event_callback(int socket, short action, void *event_data) ++{ ++ http_request_pool_event *ev = event_data; ++ http_request_pool *pool = ev->pool; ++ ++ if (pool->useevents) { ++ CURLMcode rc = CURLE_OK; ++ TSRMLS_FETCH_FROM_CTX(ev->pool->tsrm_ls); ++ ++#if HTTP_DEBUG_REQPOOLS ++ { ++ static const char event_strings[][20] = {"NONE","TIMEOUT","READ","TIMEOUT|READ","WRITE","TIMEOUT|WRITE","READ|WRITE","TIMEOUT|READ|WRITE","SIGNAL"}; ++ fprintf(stderr, "Event on socket %d (%s) event %p of pool %p\n", socket, event_strings[action], ev, pool); ++ } ++#endif ++ ++ /* don't use 'ev' below this loop as it might 've been freed in the socket callback */ ++ do { ++#ifdef HAVE_CURL_MULTI_SOCKET_ACTION ++ switch (action & (EV_READ|EV_WRITE)) { ++ case EV_READ: ++ rc = curl_multi_socket_action(pool->ch, socket, CURL_CSELECT_IN, &pool->unfinished); ++ break; ++ case EV_WRITE: ++ rc = curl_multi_socket_action(pool->ch, socket, CURL_CSELECT_OUT, &pool->unfinished); ++ break; ++ case EV_READ|EV_WRITE: ++ rc = curl_multi_socket_action(pool->ch, socket, CURL_CSELECT_IN|CURL_CSELECT_OUT, &pool->unfinished); ++ break; ++ default: ++ http_error_ex(HE_WARNING, HTTP_E_SOCKET, "Unknown event %d", (int) action); ++ return; ++ } ++#else ++ rc = curl_multi_socket(pool->ch, socket, &pool->unfinished); ++#endif ++ } while (CURLM_CALL_MULTI_PERFORM == rc); ++ ++ switch (rc) { ++ case CURLM_BAD_SOCKET: ++#if 0 ++ fprintf(stderr, "!!! Bad socket: %d (%d)\n", socket, (int) action); ++#endif ++ case CURLM_OK: ++ break; ++ default: ++ http_error(HE_WARNING, HTTP_E_SOCKET, curl_multi_strerror(rc)); ++ break; ++ } ++ ++ http_request_pool_responsehandler(pool); ++ ++ /* remove timeout if there are no transfers left */ ++ if (!pool->unfinished && event_initialized(pool->timeout) && event_pending(pool->timeout, EV_TIMEOUT, NULL)) { ++ event_del(pool->timeout); ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Removed timeout of pool %p\n", pool); ++#endif ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ static int http_request_pool_socket_callback(CURL *, curl_socket_t, int, void *, void *) */ ++static int http_request_pool_socket_callback(CURL *easy, curl_socket_t sock, int action, void *socket_data, void *assign_data) ++{ ++ http_request_pool *pool = socket_data; ++ ++ if (pool->useevents) { ++ int events = EV_PERSIST; ++ http_request_pool_event *ev = assign_data; ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ ++ if (!ev) { ++ ev = ecalloc(1, sizeof(http_request_pool_event)); ++ ev->pool = pool; ++ curl_multi_assign(pool->ch, sock, ev); ++ event_base_set(HTTP_G->request.pool.event.base, &ev->evnt); ++ } else { ++ event_del(&ev->evnt); ++ } ++ ++#if HTTP_DEBUG_REQPOOLS ++ { ++ static const char action_strings[][8] = {"NONE", "IN", "OUT", "INOUT", "REMOVE"}; ++ http_request *r; ++ curl_easy_getinfo(easy, CURLINFO_PRIVATE, &r); ++ fprintf(stderr, "Callback on socket %2d (%8s) event %p of pool %p (%d)\n", (int) sock, action_strings[action], ev, pool, pool->unfinished); ++ } ++#endif ++ ++ switch (action) { ++ case CURL_POLL_IN: ++ events |= EV_READ; ++ break; ++ case CURL_POLL_OUT: ++ events |= EV_WRITE; ++ break; ++ case CURL_POLL_INOUT: ++ events |= EV_READ|EV_WRITE; ++ break; ++ ++ case CURL_POLL_REMOVE: ++ efree(ev); ++ case CURL_POLL_NONE: ++ return 0; ++ ++ default: ++ http_error_ex(HE_WARNING, HTTP_E_SOCKET, "Unknown socket action %d", action); ++ return -1; ++ } ++ ++ event_set(&ev->evnt, sock, events, http_request_pool_event_callback, ev); ++ event_add(&ev->evnt, NULL); ++ } ++ ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ static void http_request_pool_timer_callback(CURLM *, long, void*) */ ++static void http_request_pool_timer_callback(CURLM *multi, long timeout_ms, void *timer_data) ++{ ++ http_request_pool *pool = timer_data; ++ ++ if (pool->useevents) { ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ struct timeval timeout; ++ ++ if (!event_initialized(pool->timeout)) { ++ event_set(pool->timeout, -1, 0, http_request_pool_timeout_callback, pool); ++ event_base_set(HTTP_G->request.pool.event.base, pool->timeout); ++ } else if (event_pending(pool->timeout, EV_TIMEOUT, NULL)) { ++ event_del(pool->timeout); ++ } ++ ++ if (timeout_ms > 0) { ++ timeout.tv_sec = timeout_ms / 1000; ++ timeout.tv_usec = (timeout_ms % 1000) * 1000; ++ } else { ++ http_request_pool_timeout(pool, &timeout); ++ } ++ ++ event_add(pool->timeout, &timeout); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Updating timeout %lu (%lu, %lu) of pool %p\n", (ulong) timeout_ms, (ulong) timeout.tv_sec, (ulong) timeout.tv_usec, pool); ++#endif ++ } ++} ++/* }}} */ ++#endif /* HTTP_HAVE_EVENT */ ++ ++#endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */ ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_requestdatashare_object.c +@@ -0,0 +1,332 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_requestdatashare_object.c 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) ++ ++#include "zend_interfaces.h" ++ ++#include "php_http_api.h" ++#include "php_http_exception_object.h" ++#include "php_http_request_api.h" ++#include "php_http_request_object.h" ++#include "php_http_request_datashare_api.h" ++#include "php_http_requestdatashare_object.h" ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpRequestDataShare, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpRequestDataShare, method, 0) ++#define HTTP_RSHARE_ME(method, visibility) PHP_ME(HttpRequestDataShare, method, HTTP_ARGS(HttpRequestDataShare, method), visibility) ++ ++#if defined(HAVE_SPL) && !defined(WONKY) ++/* SPL doesn't install its headers */ ++extern PHPAPI zend_class_entry *spl_ce_Countable; ++#endif ++ ++HTTP_EMPTY_ARGS(__destruct); ++HTTP_EMPTY_ARGS(count); ++ ++HTTP_BEGIN_ARGS(attach, 1) ++ HTTP_ARG_OBJ(HttpRequest, request, 0) ++HTTP_END_ARGS; ++HTTP_BEGIN_ARGS(detach, 1) ++ HTTP_ARG_OBJ(HttpRequest, request, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(reset); ++ ++HTTP_BEGIN_ARGS(factory, 0) ++ HTTP_ARG_VAL(global, 0) ++ HTTP_ARG_VAL(class_name, 0) ++HTTP_END_ARGS; ++ ++#ifndef WONKY ++HTTP_BEGIN_ARGS(singleton, 0) ++ HTTP_ARG_VAL(global, 0) ++HTTP_END_ARGS; ++#endif ++ ++ ++#define http_requestdatashare_object_read_prop _http_requestdatashare_object_read_prop ++static zval *_http_requestdatashare_object_read_prop(zval *object, zval *member, int type ZEND_LITERAL_KEY_DC TSRMLS_DC); ++#define http_requestdatashare_object_write_prop _http_requestdatashare_object_write_prop ++static void _http_requestdatashare_object_write_prop(zval *object, zval *member, zval *value ZEND_LITERAL_KEY_DC TSRMLS_DC); ++#define http_requestdatashare_instantiate(t, g) _http_requestdatashare_instantiate((t), (g) TSRMLS_CC) ++static inline zval *_http_requestdatashare_instantiate(zval *this_ptr, zend_bool global TSRMLS_DC); ++ ++#define THIS_CE http_requestdatashare_object_ce ++zend_class_entry *http_requestdatashare_object_ce; ++zend_function_entry http_requestdatashare_object_fe[] = { ++ HTTP_RSHARE_ME(__destruct, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR) ++ HTTP_RSHARE_ME(count, ZEND_ACC_PUBLIC) ++ HTTP_RSHARE_ME(attach, ZEND_ACC_PUBLIC) ++ HTTP_RSHARE_ME(detach, ZEND_ACC_PUBLIC) ++ HTTP_RSHARE_ME(reset, ZEND_ACC_PUBLIC) ++ HTTP_RSHARE_ME(factory, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++#ifndef WONKY ++ HTTP_RSHARE_ME(singleton, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++#endif ++ EMPTY_FUNCTION_ENTRY ++}; ++static zend_object_handlers http_requestdatashare_object_handlers; ++ ++PHP_MINIT_FUNCTION(http_requestdatashare_object) ++{ ++ HTTP_REGISTER_CLASS_EX(HttpRequestDataShare, http_requestdatashare_object, NULL, 0); ++ http_requestdatashare_object_handlers.clone_obj = NULL; ++ http_requestdatashare_object_handlers.read_property = http_requestdatashare_object_read_prop; ++ http_requestdatashare_object_handlers.write_property = http_requestdatashare_object_write_prop; ++ ++#if defined(HAVE_SPL) && !defined(WONKY) ++ zend_class_implements(http_requestdatashare_object_ce TSRMLS_CC, 1, spl_ce_Countable); ++#endif ++ ++ zend_declare_property_null(THIS_CE, ZEND_STRS("instance")-1, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("cookie")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("dns")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("ssl")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("connect")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); ++ ++ return SUCCESS; ++} ++ ++zend_object_value _http_requestdatashare_object_new(zend_class_entry *ce TSRMLS_DC) ++{ ++ return http_requestdatashare_object_new_ex(ce, NULL, NULL); ++} ++ ++zend_object_value _http_requestdatashare_object_new_ex(zend_class_entry *ce, http_request_datashare *share, http_requestdatashare_object **ptr TSRMLS_DC) ++{ ++ zend_object_value ov; ++ http_requestdatashare_object *o; ++ ++ o = ecalloc(1, sizeof(http_requestdatashare_object)); ++ o->zo.ce = ce; ++ ++ if (share) { ++ o->share = share; ++ } else { ++ o->share = http_request_datashare_new(); ++ } ++ ++ if (ptr) { ++ *ptr = o; ++ } ++ ++#ifdef ZEND_ENGINE_2_4 ++ zend_object_std_init(o, ce TSRMLS_CC); ++ object_properties_init(o, ce); ++#else ++ ALLOC_HASHTABLE(OBJ_PROP(o)); ++ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++#endif ++ ++ ov.handle = putObject(http_requestdatashare_object, o); ++ ov.handlers = &http_requestdatashare_object_handlers; ++ ++ return ov; ++} ++ ++void _http_requestdatashare_object_free(zend_object *object TSRMLS_DC) ++{ ++ http_requestdatashare_object *o = (http_requestdatashare_object *) object; ++ ++ if (!o->share->persistent) { ++ http_request_datashare_free(&o->share); ++ } ++ freeObject(o); ++} ++ ++static zval *_http_requestdatashare_object_read_prop(zval *object, zval *member, int type ZEND_LITERAL_KEY_DC TSRMLS_DC) ++{ ++ if (type == BP_VAR_W && ++#ifdef ZEND_ENGINE_2_4 ++ zend_hash_exists(&THIS_CE->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1) ++#else ++ zend_hash_exists(&THIS_CE->default_properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1) ++#endif ++ ) { ++ zend_error(E_ERROR, "Cannot access HttpRequestDataShare default properties by reference or array key/index"); ++ return NULL; ++ } ++ ++ return zend_get_std_object_handlers()->read_property(object, member, type ZEND_LITERAL_KEY_CC TSRMLS_CC); ++} ++ ++static void _http_requestdatashare_object_write_prop(zval *object, zval *member, zval *value ZEND_LITERAL_KEY_DC TSRMLS_DC) ++{ ++ if ( ++#ifdef ZEND_ENGINE_2_4 ++ zend_hash_exists(&THIS_CE->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1) ++#else ++ zend_hash_exists(&THIS_CE->default_properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1) ++#endif ++ ) { ++ int status; ++ getObjectEx(http_requestdatashare_object, obj, object); ++ ++ status = http_request_datashare_set(obj->share, Z_STRVAL_P(member), Z_STRLEN_P(member), (zend_bool) i_zend_is_true(value)); ++ if (SUCCESS != status) { ++ return; ++ } ++ } ++ ++ zend_get_std_object_handlers()->write_property(object, member, value ZEND_LITERAL_KEY_CC TSRMLS_CC); ++} ++ ++/* {{{ proto void HttpRequestDataShare::__destruct() ++ Clean up HttpRequestDataShare object. */ ++PHP_METHOD(HttpRequestDataShare, __destruct) ++{ ++ NO_ARGS { ++ getObject(http_requestdatashare_object, obj); ++ http_request_datashare_detach_all(obj->share); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto int HttpRequestDataShare::count() ++ Implements Countable::count(). */ ++PHP_METHOD(HttpRequestDataShare, count) ++{ ++ getObject(http_requestdatashare_object, obj); ++ ++ NO_ARGS; ++ ++ RETURN_LONG(zend_llist_count(HTTP_RSHARE_HANDLES(obj->share))); ++} ++/* }}} */ ++ ++PHP_METHOD(HttpRequestDataShare, attach) ++{ ++ zval *request; ++ getObject(http_requestdatashare_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &request, http_request_object_ce)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(http_request_datashare_attach(obj->share, request)); ++} ++ ++PHP_METHOD(HttpRequestDataShare, detach) ++{ ++ zval *request; ++ getObject(http_requestdatashare_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &request, http_request_object_ce)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(http_request_datashare_detach(obj->share, request)); ++} ++ ++PHP_METHOD(HttpRequestDataShare, reset) ++{ ++ NO_ARGS { ++ getObject(http_requestdatashare_object, obj); ++ http_request_datashare_detach_all(obj->share); ++ } ++} ++ ++PHP_METHOD(HttpRequestDataShare, factory) ++{ ++ zend_bool global = 0; ++ char *cn = NULL; ++ int cl = 0; ++ zend_object_value ov; ++ ++ SET_EH_THROW_HTTP(); ++ if ( SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bs", &global, &cn, &cl) && ++ SUCCESS == http_object_new(&ov, cn, cl, _http_requestdatashare_object_new_ex, http_requestdatashare_object_ce, NULL, NULL)) { ++ RETVAL_OBJVAL(ov, 0); ++ http_requestdatashare_instantiate(return_value, global); ++ } ++ SET_EH_NORMAL(); ++} ++ ++#ifndef WONKY ++/* {{{ proto static HttpRequestDataShare HttpRequestDataShare::singleton([bool global = false]) ++ Get a single instance (differentiates between the global setting). */ ++PHP_METHOD(HttpRequestDataShare, singleton) ++{ ++ zend_bool global = 0; ++ zval *instance = *zend_std_get_static_property(THIS_CE, ZEND_STRS("instance")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC); ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &global)) { ++ zval **zobj_ptr = NULL, *zobj = NULL; ++ ++ if (Z_TYPE_P(instance) == IS_ARRAY) { ++ if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(instance), global, (void *) &zobj_ptr)) { ++ RETVAL_ZVAL(*zobj_ptr, 1, 0); ++ } else { ++ zobj = http_requestdatashare_instantiate(NULL, global); ++ add_index_zval(instance, global, zobj); ++ RETVAL_OBJECT(zobj, 1); ++ } ++ } else { ++ MAKE_STD_ZVAL(instance); ++ array_init(instance); ++ ++ zobj = http_requestdatashare_instantiate(NULL, global); ++ add_index_zval(instance, global, zobj); ++ RETVAL_OBJECT(zobj, 1); ++ ++ zend_update_static_property(THIS_CE, ZEND_STRS("instance")-1, instance TSRMLS_CC); ++ zval_ptr_dtor(&instance); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++#endif /* !WONKY */ ++ ++static inline zval *_http_requestdatashare_instantiate(zval *this_ptr, zend_bool global TSRMLS_DC) ++{ ++ if (!this_ptr) { ++ MAKE_STD_ZVAL(this_ptr); ++ Z_TYPE_P(this_ptr) = IS_OBJECT; ++ this_ptr->value.obj = http_requestdatashare_object_new_ex(http_requestdatashare_object_ce, global ? http_request_datashare_global_get() : NULL, NULL); ++ } ++ if (global) { ++ if (HTTP_G->request.datashare.cookie) { ++ zend_update_property_bool(THIS_CE, getThis(), ZEND_STRS("cookie")-1, HTTP_G->request.datashare.cookie TSRMLS_CC); ++ } ++ if (HTTP_G->request.datashare.dns) { ++ zend_update_property_bool(THIS_CE, getThis(), ZEND_STRS("dns")-1, HTTP_G->request.datashare.dns TSRMLS_CC); ++ } ++ if (HTTP_G->request.datashare.ssl) { ++ zend_update_property_bool(THIS_CE, getThis(), ZEND_STRS("ssl")-1, HTTP_G->request.datashare.ssl TSRMLS_CC); ++ } ++ if (HTTP_G->request.datashare.connect) { ++ zend_update_property_bool(THIS_CE, getThis(), ZEND_STRS("connect")-1, HTTP_G->request.datashare.connect TSRMLS_CC); ++ } ++ } ++ return this_ptr; ++} ++ ++#endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_requestpool_object.c +@@ -0,0 +1,471 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_requestpool_object.c 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) ++ ++#include "zend_interfaces.h" ++ ++#include "php_http_api.h" ++#include "php_http_exception_object.h" ++#include "php_http_request_api.h" ++#include "php_http_request_object.h" ++#include "php_http_request_pool_api.h" ++#include "php_http_requestpool_object.h" ++ ++#if defined(HAVE_SPL) && !defined(WONKY) ++/* SPL doesn't install its headers */ ++extern PHPAPI zend_class_entry *spl_ce_Countable; ++#endif ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpRequestPool, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpRequestPool, method, 0) ++#define HTTP_REQPOOL_ME(method, visibility) PHP_ME(HttpRequestPool, method, HTTP_ARGS(HttpRequestPool, method), visibility) ++ ++HTTP_EMPTY_ARGS(__construct); ++ ++HTTP_EMPTY_ARGS(__destruct); ++HTTP_EMPTY_ARGS(reset); ++ ++HTTP_BEGIN_ARGS(attach, 1) ++ HTTP_ARG_OBJ(HttpRequest, request, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(detach, 1) ++ HTTP_ARG_OBJ(HttpRequest, request, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(send); ++HTTP_EMPTY_ARGS(socketPerform); ++HTTP_BEGIN_ARGS(socketSelect, 0) ++ HTTP_ARG_VAL(timeout, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(valid); ++HTTP_EMPTY_ARGS(current); ++HTTP_EMPTY_ARGS(key); ++HTTP_EMPTY_ARGS(next); ++HTTP_EMPTY_ARGS(rewind); ++ ++HTTP_EMPTY_ARGS(count); ++ ++HTTP_EMPTY_ARGS(getAttachedRequests); ++HTTP_EMPTY_ARGS(getFinishedRequests); ++ ++HTTP_BEGIN_ARGS(enablePipelining, 0) ++ HTTP_ARG_VAL(enable, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(enableEvents, 0) ++ HTTP_ARG_VAL(enable, 0) ++HTTP_END_ARGS; ++ ++zend_class_entry *http_requestpool_object_ce; ++zend_function_entry http_requestpool_object_fe[] = { ++ HTTP_REQPOOL_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) ++ HTTP_REQPOOL_ME(__destruct, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR) ++ HTTP_REQPOOL_ME(attach, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(detach, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(send, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(reset, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQPOOL_ME(socketPerform, ZEND_ACC_PROTECTED) ++ HTTP_REQPOOL_ME(socketSelect, ZEND_ACC_PROTECTED) ++ ++ /* implements Iterator */ ++ HTTP_REQPOOL_ME(valid, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(current, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(key, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(next, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(rewind, ZEND_ACC_PUBLIC) ++ ++ /* implmenents Countable */ ++ HTTP_REQPOOL_ME(count, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQPOOL_ME(getAttachedRequests, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(getFinishedRequests, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQPOOL_ME(enablePipelining, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(enableEvents, ZEND_ACC_PUBLIC) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++static zend_object_handlers http_requestpool_object_handlers; ++ ++PHP_MINIT_FUNCTION(http_requestpool_object) ++{ ++ HTTP_REGISTER_CLASS_EX(HttpRequestPool, http_requestpool_object, NULL, 0); ++ http_requestpool_object_handlers.clone_obj = NULL; ++ ++#if defined(HAVE_SPL) && !defined(WONKY) ++ zend_class_implements(http_requestpool_object_ce TSRMLS_CC, 2, spl_ce_Countable, zend_ce_iterator); ++#else ++ zend_class_implements(http_requestpool_object_ce TSRMLS_CC, 1, zend_ce_iterator); ++#endif ++ ++ return SUCCESS; ++} ++ ++zend_object_value _http_requestpool_object_new(zend_class_entry *ce TSRMLS_DC) ++{ ++ zend_object_value ov; ++ http_requestpool_object *o; ++ ++ o = ecalloc(1, sizeof(http_requestpool_object)); ++ o->zo.ce = ce; ++ ++ http_request_pool_init(&o->pool); ++ ++#ifdef ZEND_ENGINE_2_4 ++ zend_object_std_init(o, ce TSRMLS_CC); ++ object_properties_init(o, ce); ++#else ++ ALLOC_HASHTABLE(OBJ_PROP(o)); ++ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++#endif ++ ++ ov.handle = putObject(http_requestpool_object, o); ++ ov.handlers = &http_requestpool_object_handlers; ++ ++ return ov; ++} ++ ++void _http_requestpool_object_free(zend_object *object TSRMLS_DC) ++{ ++ http_requestpool_object *o = (http_requestpool_object *) object; ++ ++ http_request_pool_dtor(&o->pool); ++ freeObject(o); ++} ++ ++#define http_requestpool_object_llist2array _http_requestpool_object_llist2array ++static void _http_requestpool_object_llist2array(zval **req, zval *array TSRMLS_DC) ++{ ++ ZVAL_ADDREF(*req); ++ add_next_index_zval(array, *req); ++} ++ ++/* ### USERLAND ### */ ++ ++/* {{{ proto void HttpRequestPool::__construct([HttpRequest request[, ...]]) ++ Creates a new HttpRequestPool object instance. */ ++PHP_METHOD(HttpRequestPool, __construct) ++{ ++ int argc = ZEND_NUM_ARGS(); ++ zval ***argv = safe_emalloc(argc, sizeof(zval *), 0); ++ getObject(http_requestpool_object, obj); ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_get_parameters_array_ex(argc, argv)) { ++ int i; ++ ++ for (i = 0; i < argc; ++i) { ++ if (Z_TYPE_PP(argv[i]) == IS_OBJECT && instanceof_function(Z_OBJCE_PP(argv[i]), http_request_object_ce TSRMLS_CC)) { ++ http_request_pool_attach(&obj->pool, *(argv[i])); ++ } ++ } ++ } ++ efree(argv); ++ http_final(HTTP_EX_CE(request_pool)); ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto void HttpRequestPool::__destruct() ++ Clean up HttpRequestPool object. */ ++PHP_METHOD(HttpRequestPool, __destruct) ++{ ++ getObject(http_requestpool_object, obj); ++ ++ NO_ARGS; ++ ++ http_request_pool_detach_all(&obj->pool); ++} ++/* }}} */ ++ ++/* {{{ proto void HttpRequestPool::reset() ++ Detach all attached HttpRequest objects. */ ++PHP_METHOD(HttpRequestPool, reset) ++{ ++ getObject(http_requestpool_object, obj); ++ ++ NO_ARGS; ++ ++ obj->iterator.pos = 0; ++ http_request_pool_detach_all(&obj->pool); ++} ++ ++/* {{{ proto bool HttpRequestPool::attach(HttpRequest request) ++ Attach an HttpRequest object to this HttpRequestPool. WARNING: set all options prior attaching! */ ++PHP_METHOD(HttpRequestPool, attach) ++{ ++ zval *request; ++ STATUS status = FAILURE; ++ getObject(http_requestpool_object, obj); ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &request, http_request_object_ce)) { ++ if (obj->iterator.pos > 0 && obj->iterator.pos < zend_llist_count(&obj->pool.handles)) { ++ http_error(HE_THROW, HTTP_E_REQUEST_POOL, "Cannot attach to the HttpRequestPool while the iterator is active"); ++ } else { ++ status = http_request_pool_attach(&obj->pool, request); ++ } ++ } ++ SET_EH_NORMAL(); ++ RETURN_SUCCESS(status); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequestPool::detach(HttpRequest request) ++ Detach an HttpRequest object from this HttpRequestPool. */ ++PHP_METHOD(HttpRequestPool, detach) ++{ ++ zval *request; ++ STATUS status = FAILURE; ++ getObject(http_requestpool_object, obj); ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &request, http_request_object_ce)) { ++ obj->iterator.pos = -1; ++ status = http_request_pool_detach(&obj->pool, request); ++ } ++ SET_EH_NORMAL(); ++ RETURN_SUCCESS(status); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequestPool::send() ++ Send all attached HttpRequest objects in parallel. */ ++PHP_METHOD(HttpRequestPool, send) ++{ ++ STATUS status; ++ getObject(http_requestpool_object, obj); ++ ++ NO_ARGS; ++ ++ SET_EH_THROW_HTTP(); ++ status = http_request_pool_send(&obj->pool); ++ SET_EH_NORMAL(); ++ ++ /* rethrow as HttpRequestPoolException */ ++ http_final(HTTP_EX_CE(request_pool)); ++ ++ RETURN_SUCCESS(status); ++} ++/* }}} */ ++ ++/* {{{ proto protected bool HttpRequestPool::socketPerform() ++ Returns TRUE until each request has finished its transaction. */ ++PHP_METHOD(HttpRequestPool, socketPerform) ++{ ++ getObject(http_requestpool_object, obj); ++ ++ NO_ARGS; ++ ++ if (0 < http_request_pool_perform(&obj->pool)) { ++ RETURN_TRUE; ++ } else { ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto protected bool HttpRequestPool::socketSelect([double timeout]) */ ++PHP_METHOD(HttpRequestPool, socketSelect) ++{ ++ double timeout = 0; ++ struct timeval custom_timeout, *custom_timeout_ptr = NULL; ++ getObject(http_requestpool_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|d", &timeout)) { ++ RETURN_FALSE; ++ } ++ if (ZEND_NUM_ARGS() && timeout > 0) { ++ custom_timeout.tv_sec = (time_t) timeout; ++ custom_timeout.tv_usec = HTTP_USEC(timeout) % HTTP_MCROSEC; ++ custom_timeout_ptr = &custom_timeout; ++ } ++ ++ RETURN_SUCCESS(http_request_pool_select_ex(&obj->pool, custom_timeout_ptr)); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequestPool::valid() ++ Implements Iterator::valid(). */ ++PHP_METHOD(HttpRequestPool, valid) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_requestpool_object, obj); ++ RETURN_BOOL(obj->iterator.pos >= 0 && obj->iterator.pos < zend_llist_count(&obj->pool.handles)); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpRequest HttpRequestPool::current() ++ Implements Iterator::current(). */ ++PHP_METHOD(HttpRequestPool, current) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ long pos = 0; ++ zval **current = NULL; ++ zend_llist_position lpos; ++ getObject(http_requestpool_object, obj); ++ ++ if (obj->iterator.pos < zend_llist_count(&obj->pool.handles)) { ++ for ( current = zend_llist_get_first_ex(&obj->pool.handles, &lpos); ++ current && obj->iterator.pos != pos++; ++ current = zend_llist_get_next_ex(&obj->pool.handles, &lpos)); ++ if (current) { ++ RETURN_OBJECT(*current, 1); ++ } ++ } ++ RETURN_NULL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto int HttpRequestPool::key() ++ Implements Iterator::key(). */ ++PHP_METHOD(HttpRequestPool, key) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_requestpool_object, obj); ++ RETURN_LONG(obj->iterator.pos); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpRequestPool::next() ++ Implements Iterator::next(). */ ++PHP_METHOD(HttpRequestPool, next) ++{ ++ NO_ARGS { ++ getObject(http_requestpool_object, obj); ++ ++(obj->iterator.pos); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpRequestPool::rewind() ++ Implements Iterator::rewind(). */ ++PHP_METHOD(HttpRequestPool, rewind) ++{ ++ NO_ARGS { ++ getObject(http_requestpool_object, obj); ++ obj->iterator.pos = 0; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto int HttpRequestPool::count() ++ Implements Countable::count(). */ ++PHP_METHOD(HttpRequestPool, count) ++{ ++ NO_ARGS { ++ getObject(http_requestpool_object, obj); ++ RETURN_LONG((long) zend_llist_count(&obj->pool.handles)); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequestPool::getAttachedRequests() ++ Get attached HttpRequest objects. */ ++PHP_METHOD(HttpRequestPool, getAttachedRequests) ++{ ++ getObject(http_requestpool_object, obj); ++ ++ NO_ARGS; ++ ++ array_init(return_value); ++ zend_llist_apply_with_argument(&obj->pool.handles, ++ (llist_apply_with_arg_func_t) http_requestpool_object_llist2array, ++ return_value TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequestPool::getFinishedRequests() ++ Get attached HttpRequest objects that already have finished their work. */ ++PHP_METHOD(HttpRequestPool, getFinishedRequests) ++{ ++ getObject(http_requestpool_object, obj); ++ ++ NO_ARGS; ++ ++ array_init(return_value); ++ zend_llist_apply_with_argument(&obj->pool.finished, ++ (llist_apply_with_arg_func_t) http_requestpool_object_llist2array, ++ return_value TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequestPool::enablePipelining([bool enable = true]) ++ Enables pipelining support for all attached requests if support in libcurl is given. */ ++PHP_METHOD(HttpRequestPool, enablePipelining) ++{ ++ zend_bool enable = 1; ++#if defined(HAVE_CURL_MULTI_SETOPT) && HTTP_CURL_VERSION(7,16,0) ++ getObject(http_requestpool_object, obj); ++#endif ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &enable)) { ++ RETURN_FALSE; ++ } ++#if defined(HAVE_CURL_MULTI_SETOPT) && HTTP_CURL_VERSION(7,16,0) ++ if (CURLM_OK == curl_multi_setopt(obj->pool.ch, CURLMOPT_PIPELINING, (long) enable)) { ++ RETURN_TRUE; ++ } ++#endif ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequestPool::enableEvents([bool enable = true]) ++ Enables event-driven I/O if support in libcurl is given. */ ++PHP_METHOD(HttpRequestPool, enableEvents) ++{ ++ zend_bool enable = 1; ++#if defined(HTTP_HAVE_EVENT) ++ getObject(http_requestpool_object, obj); ++#endif ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &enable)) { ++#if defined(HTTP_HAVE_EVENT) ++ obj->pool.useevents = enable; ++ RETURN_TRUE; ++#endif ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++#endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_response_object.c +@@ -0,0 +1,927 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_response_object.c 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_MAGIC ++#include "php_http.h" ++ ++/* broken static properties in PHP 5.0 */ ++#if defined(ZEND_ENGINE_2) && !defined(WONKY) ++ ++#include "php_ini.h" ++ ++#include "php_http_api.h" ++#include "php_http_cache_api.h" ++#include "php_http_exception_object.h" ++#include "php_http_headers_api.h" ++#include "php_http_response_object.h" ++#include "php_http_send_api.h" ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpResponse, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpResponse, method, 0) ++#define HTTP_RESPONSE_ME(method, visibility) PHP_ME(HttpResponse, method, HTTP_ARGS(HttpResponse, method), visibility|ZEND_ACC_STATIC) ++#define HTTP_RESPONSE_ALIAS(method, func) HTTP_STATIC_ME_ALIAS(method, func, HTTP_ARGS(HttpResponse, method)) ++ ++HTTP_BEGIN_ARGS(setHeader, 1) ++ HTTP_ARG_VAL(name, 0) ++ HTTP_ARG_VAL(value, 0) ++ HTTP_ARG_VAL(replace, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(getHeader, 0) ++ HTTP_ARG_VAL(name, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getETag); ++HTTP_BEGIN_ARGS(setETag, 1) ++ HTTP_ARG_VAL(etag, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getLastModified); ++HTTP_BEGIN_ARGS(setLastModified, 1) ++ HTTP_ARG_VAL(timestamp, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getCache); ++HTTP_BEGIN_ARGS(setCache, 1) ++ HTTP_ARG_VAL(cache, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getGzip); ++HTTP_BEGIN_ARGS(setGzip, 1) ++ HTTP_ARG_VAL(gzip, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getCacheControl); ++HTTP_BEGIN_ARGS(setCacheControl, 1) ++ HTTP_ARG_VAL(cache_control, 0) ++ HTTP_ARG_VAL(max_age, 0) ++ HTTP_ARG_VAL(must_revalidate, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getContentType); ++HTTP_BEGIN_ARGS(setContentType, 1) ++ HTTP_ARG_VAL(content_type, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(guessContentType, 1) ++ HTTP_ARG_VAL(magic_file, 0) ++ HTTP_ARG_VAL(magic_mode, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getContentDisposition); ++HTTP_BEGIN_ARGS(setContentDisposition, 1) ++ HTTP_ARG_VAL(filename, 0) ++ HTTP_ARG_VAL(send_inline, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getThrottleDelay); ++HTTP_BEGIN_ARGS(setThrottleDelay, 1) ++ HTTP_ARG_VAL(seconds, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getBufferSize); ++HTTP_BEGIN_ARGS(setBufferSize, 1) ++ HTTP_ARG_VAL(bytes, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getData); ++HTTP_BEGIN_ARGS(setData, 1) ++ HTTP_ARG_VAL(data, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getStream); ++HTTP_BEGIN_ARGS(setStream, 1) ++ HTTP_ARG_VAL(stream, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getFile); ++HTTP_BEGIN_ARGS(setFile, 1) ++ HTTP_ARG_VAL(filepath, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(send, 0) ++ HTTP_ARG_VAL(clean_ob, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(capture); ++ ++HTTP_BEGIN_ARGS(redirect, 0) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(params, 0) ++ HTTP_ARG_VAL(session, 0) ++ HTTP_ARG_VAL(permanent, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(status, 1) ++ HTTP_ARG_VAL(code, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getRequestHeaders); ++HTTP_EMPTY_ARGS(getRequestBody); ++HTTP_EMPTY_ARGS(getRequestBodyStream); ++ ++#define THIS_CE http_response_object_ce ++zend_class_entry *http_response_object_ce; ++zend_function_entry http_response_object_fe[] = { ++ ++ HTTP_RESPONSE_ME(setHeader, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getHeader, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setETag, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getETag, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setLastModified, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getLastModified, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setContentDisposition, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getContentDisposition, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setContentType, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getContentType, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(guessContentType, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setCache, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getCache, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setCacheControl, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getCacheControl, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setGzip, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getGzip, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setThrottleDelay, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getThrottleDelay, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setBufferSize, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getBufferSize, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setData, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getData, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setFile, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getFile, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setStream, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getStream, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(send, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(capture, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ALIAS(redirect, http_redirect) ++ HTTP_RESPONSE_ALIAS(status, http_send_status) ++ HTTP_RESPONSE_ALIAS(getRequestHeaders, http_get_request_headers) ++ HTTP_RESPONSE_ALIAS(getRequestBody, http_get_request_body) ++ HTTP_RESPONSE_ALIAS(getRequestBodyStream, http_get_request_body_stream) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++ ++PHP_MINIT_FUNCTION(http_response_object) ++{ ++ HTTP_REGISTER_CLASS(HttpResponse, http_response_object, NULL, 0); ++ ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("sent")-1, 0, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("catch")-1, 0, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("mode")-1, -1, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("stream")-1, 0, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("file")-1, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("data")-1, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("cache")-1, 0, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("gzip")-1, 0, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("eTag")-1, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("lastModified")-1, 0, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("cacheControl")-1, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("contentType")-1, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("contentDisposition")-1, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("bufferSize")-1, 0, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_double(THIS_CE, ZEND_STRS("throttleDelay")-1, 0.0, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ ++#ifndef WONKY ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("REDIRECT")-1, HTTP_REDIRECT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("REDIRECT_PERM")-1, HTTP_REDIRECT_PERM TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("REDIRECT_FOUND")-1, HTTP_REDIRECT_FOUND TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("REDIRECT_POST")-1, HTTP_REDIRECT_POST TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("REDIRECT_PROXY")-1, HTTP_REDIRECT_PROXY TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("REDIRECT_TEMP")-1, HTTP_REDIRECT_TEMP TSRMLS_CC); ++#endif /* WONKY */ ++ ++ return SUCCESS; ++} ++ ++/* ### USERLAND ### */ ++ ++/* {{{ proto static bool HttpResponse::setHeader(string name[, mixed value[, bool replace = true]]) ++ Send an HTTP header. */ ++PHP_METHOD(HttpResponse, setHeader) ++{ ++ zend_bool replace = 1; ++ char *name; ++ int name_len = 0; ++ zval *value = NULL; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/!b", &name, &name_len, &value, &replace)) { ++ RETURN_FALSE; ++ } ++ if (SG(headers_sent)) { ++ http_error(HE_WARNING, HTTP_E_HEADER, "Cannot add another header when headers have already been sent"); ++ RETURN_FALSE; ++ } ++ if (!name_len) { ++ http_error(HE_WARNING, HTTP_E_HEADER, "Cannot send anonymous headers"); ++ RETURN_FALSE; ++ } ++ http_send_header_zval_ex(name, name_len, &value, replace); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto static mixed HttpResponse::getHeader([string name]) ++ Get header(s) about to be sent. */ ++PHP_METHOD(HttpResponse, getHeader) ++{ ++ char *name = NULL; ++ int name_len = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (name && name_len) { ++ zval **header; ++ HashTable headers_ht; ++ ++ zend_hash_init(&headers_ht, sizeof(zval *), NULL, ZVAL_PTR_DTOR, 0); ++ if ( (SUCCESS == http_get_response_headers(&headers_ht)) && ++ (SUCCESS == zend_hash_find(&headers_ht, name, name_len + 1, (void *) &header))) { ++ RETVAL_ZVAL(*header, 1, 0); ++ } else { ++ RETVAL_NULL(); ++ } ++ zend_hash_destroy(&headers_ht); ++ } else { ++ array_init(return_value); ++ http_get_response_headers(Z_ARRVAL_P(return_value)); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setCache(bool cache) ++ Whether it should be attempted to cache the entity. */ ++PHP_METHOD(HttpResponse, setCache) ++{ ++ zend_bool do_cache = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &do_cache)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(zend_update_static_property_bool(THIS_CE, ZEND_STRS("cache")-1, do_cache TSRMLS_CC)); ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::getCache() ++ Get current caching setting. */ ++PHP_METHOD(HttpResponse, getCache) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *cache = http_zsep(IS_BOOL, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("cache")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(cache, 1, 1); ++ } ++} ++/* }}}*/ ++ ++/* {{{ proto static bool HttpResponse::setGzip(bool gzip) ++ Enable on-thy-fly gzipping of the sent entity. */ ++PHP_METHOD(HttpResponse, setGzip) ++{ ++ zend_bool do_gzip = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &do_gzip)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(zend_update_static_property_bool(THIS_CE, ZEND_STRS("gzip")-1, do_gzip TSRMLS_CC)); ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::getGzip() ++ Get current gzipping setting. */ ++PHP_METHOD(HttpResponse, getGzip) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *gzip = http_zsep(IS_BOOL, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("gzip")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(gzip, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setCacheControl(string control[, int max_age = 0[, bool must_revalidate = true]]) ++ Set a custom cache-control header, usually being "private" or "public"; The max_age parameter controls how long the cache entry is valid on the client side. */ ++PHP_METHOD(HttpResponse, setCacheControl) ++{ ++ char *ccontrol, *cctl; ++ int cc_len; ++ long max_age = 0; ++ zend_bool must_revalidate = 1; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lb", &ccontrol, &cc_len, &max_age, &must_revalidate)) { ++ RETURN_FALSE; ++ } ++ ++ if (strcmp(ccontrol, "public") && strcmp(ccontrol, "private") && strcmp(ccontrol, "no-cache")) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Cache-Control '%s' doesn't match public, private or no-cache", ccontrol); ++ RETURN_FALSE; ++ } else { ++ size_t cctl_len = spprintf(&cctl, 0, "%s,%s max-age=%ld", ccontrol, must_revalidate?" must-revalidate,":"", max_age); ++ RETVAL_SUCCESS(zend_update_static_property_stringl(THIS_CE, ZEND_STRS("cacheControl")-1, cctl, cctl_len TSRMLS_CC)); ++ efree(cctl); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static string HttpResponse::getCacheControl() ++ Get current Cache-Control header setting. */ ++PHP_METHOD(HttpResponse, getCacheControl) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *cctl = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("cacheControl")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(cctl, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setContentType(string content_type) ++ Set the content-type of the sent entity. */ ++PHP_METHOD(HttpResponse, setContentType) ++{ ++ char *ctype; ++ int ctype_len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ctype, &ctype_len)) { ++ RETURN_FALSE; ++ } ++ ++ HTTP_CHECK_CONTENT_TYPE(ctype, RETURN_FALSE); ++ RETURN_SUCCESS(zend_update_static_property_stringl(THIS_CE, ZEND_STRS("contentType")-1, ctype, ctype_len TSRMLS_CC)); ++} ++/* }}} */ ++ ++/* {{{ proto static string HttpResponse::getContentType() ++ Get current Content-Type header setting. */ ++PHP_METHOD(HttpResponse, getContentType) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *ctype = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("contentType")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(ctype, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static string HttpResponse::guessContentType(string magic_file[, int magic_mode = MAGIC_MIME]) ++ Attempts to guess the content type of supplied payload through libmagic. */ ++PHP_METHOD(HttpResponse, guessContentType) ++{ ++#ifdef HTTP_HAVE_MAGIC ++ char *magic_file, *ct = NULL; ++ int magic_file_len; ++ long magic_mode = MAGIC_MIME; ++ ++ RETVAL_FALSE; ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &magic_file, &magic_file_len, &magic_mode)) { ++ switch (Z_LVAL_P(*zend_std_get_static_property(THIS_CE, ZEND_STRS("mode")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))) { ++ case SEND_DATA: ++ { ++ zval *data = *zend_std_get_static_property(THIS_CE, ZEND_STRS("data")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC); ++ ct = http_guess_content_type(magic_file, magic_mode, Z_STRVAL_P(data), Z_STRLEN_P(data), SEND_DATA); ++ break; ++ } ++ ++ case SEND_RSRC: ++ { ++ php_stream *s; ++ zval *z = *zend_std_get_static_property(THIS_CE, ZEND_STRS("stream")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC); ++ z->type = IS_RESOURCE; ++ php_stream_from_zval(s, &z); ++ ct = http_guess_content_type(magic_file, magic_mode, s, 0, SEND_RSRC); ++ break; ++ } ++ ++ default: ++ ct = http_guess_content_type(magic_file, magic_mode, Z_STRVAL_P(*zend_std_get_static_property(THIS_CE, ZEND_STRS("file")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC)), 0, -1); ++ break; ++ } ++ if (ct) { ++ zend_update_static_property_string(THIS_CE, ZEND_STRS("contentType")-1, ct TSRMLS_CC); ++ RETVAL_STRING(ct, 0); ++ } ++ } ++ SET_EH_NORMAL(); ++#else ++ http_error(HE_THROW, HTTP_E_RUNTIME, "Cannot guess Content-Type; libmagic not available"); ++ RETURN_FALSE; ++#endif ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setContentDisposition(string filename[, bool inline = false]) ++ Set the Content-Disposition. */ ++PHP_METHOD(HttpResponse, setContentDisposition) ++{ ++ char *file, *cd; ++ int file_len; ++ size_t cd_len; ++ zend_bool send_inline = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &file, &file_len, &send_inline)) { ++ RETURN_FALSE; ++ } ++ ++ cd_len = spprintf(&cd, 0, "%s; filename=\"%s\"", send_inline ? "inline" : "attachment", file); ++ RETVAL_SUCCESS(zend_update_static_property_stringl(THIS_CE, ZEND_STRS("contentDisposition")-1, cd, cd_len TSRMLS_CC)); ++ efree(cd); ++} ++/* }}} */ ++ ++/* {{{ proto static string HttpResponse::getContentDisposition() ++ Get current Content-Disposition setting. */ ++PHP_METHOD(HttpResponse, getContentDisposition) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *cdisp = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("contentDisposition")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(cdisp, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setETag(string etag) ++ Set a custom ETag. Use this only if you know what you're doing. */ ++PHP_METHOD(HttpResponse, setETag) ++{ ++ char *etag; ++ int etag_len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &etag, &etag_len)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(zend_update_static_property_stringl(THIS_CE, ZEND_STRS("eTag")-1, etag, etag_len TSRMLS_CC)); ++} ++/* }}} */ ++ ++/* {{{ proto static string HttpResponse::getETag() ++ Get calculated or previously set custom ETag. */ ++PHP_METHOD(HttpResponse, getETag) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *etag = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("eTag")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(etag, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setLastModified(int timestamp) ++ Set a custom Last-Modified date. */ ++PHP_METHOD(HttpResponse, setLastModified) ++{ ++ long lm; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &lm)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(zend_update_static_property_long(THIS_CE, ZEND_STRS("lastModified")-1, lm TSRMLS_CC)); ++} ++/* }}} */ ++ ++/* {{{ proto static int HttpResponse::getLastModified() ++ Get calculated or previously set custom Last-Modified date. */ ++PHP_METHOD(HttpResponse, getLastModified) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *lmod = http_zsep(IS_LONG, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("lastModified")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(lmod, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setThrottleDelay(double seconds) ++ Sets the throttle delay for use with HttpResponse::setBufferSize(). */ ++PHP_METHOD(HttpResponse, setThrottleDelay) ++{ ++ double seconds; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &seconds)) { ++ RETURN_FALSE; ++ } ++ RETURN_SUCCESS(zend_update_static_property_double(THIS_CE, ZEND_STRS("throttleDelay")-1, seconds TSRMLS_CC)); ++} ++/* }}} */ ++ ++/* {{{ proto static double HttpResponse::getThrottleDelay() ++ Get the current throttle delay. */ ++PHP_METHOD(HttpResponse, getThrottleDelay) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *tdel = http_zsep(IS_DOUBLE, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("throttleDelay")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(tdel, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setBufferSize(int bytes) ++ Sets the send buffer size for use with HttpResponse::setThrottleDelay(). */ ++PHP_METHOD(HttpResponse, setBufferSize) ++{ ++ long bytes; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &bytes)) { ++ RETURN_FALSE; ++ } ++ RETURN_SUCCESS(zend_update_static_property_long(THIS_CE, ZEND_STRS("bufferSize")-1, bytes TSRMLS_CC)); ++} ++/* }}} */ ++ ++/* {{{ proto static int HttpResponse::getBufferSize() ++ Get current buffer size. */ ++PHP_METHOD(HttpResponse, getBufferSize) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *bsize = http_zsep(IS_LONG, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("bufferSize")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(bsize, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setData(mixed data) ++ Set the data to be sent. */ ++PHP_METHOD(HttpResponse, setData) ++{ ++ char *etag; ++ zval *the_data; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &the_data)) { ++ RETURN_FALSE; ++ } ++ if (Z_TYPE_P(the_data) != IS_STRING) { ++ convert_to_string(the_data); ++ } ++ ++ if ( (SUCCESS != zend_update_static_property(THIS_CE, ZEND_STRS("data")-1, the_data TSRMLS_CC)) || ++ (SUCCESS != zend_update_static_property_long(THIS_CE, ZEND_STRS("mode")-1, SEND_DATA TSRMLS_CC))) { ++ RETURN_FALSE; ++ } ++ ++ zend_update_static_property_long(THIS_CE, ZEND_STRS("lastModified")-1, http_last_modified(the_data, SEND_DATA) TSRMLS_CC); ++ if ((etag = http_etag(Z_STRVAL_P(the_data), Z_STRLEN_P(the_data), SEND_DATA))) { ++ zend_update_static_property_string(THIS_CE, ZEND_STRS("eTag")-1, etag TSRMLS_CC); ++ efree(etag); ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto static string HttpResponse::getData() ++ Get the previously set data to be sent. */ ++PHP_METHOD(HttpResponse, getData) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *the_data = *zend_std_get_static_property(THIS_CE, ZEND_STRS("data")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC); ++ ++ RETURN_ZVAL(the_data, 1, 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setStream(resource stream) ++ Set the resource to be sent. */ ++PHP_METHOD(HttpResponse, setStream) ++{ ++ char *etag; ++ zval *the_stream; ++ php_stream *the_real_stream; ++ php_stream_statbuf ssb; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &the_stream)) { ++ RETURN_FALSE; ++ } ++ ++ php_stream_from_zval(the_real_stream, &the_stream); ++ if (php_stream_stat(the_real_stream, &ssb)) { ++ RETURN_FALSE; ++ } ++ ++ if ( (SUCCESS != zend_update_static_property_long(THIS_CE, ZEND_STRS("stream")-1, Z_LVAL_P(the_stream) TSRMLS_CC)) || ++ (SUCCESS != zend_update_static_property_long(THIS_CE, ZEND_STRS("mode")-1, SEND_RSRC TSRMLS_CC))) { ++ RETURN_FALSE; ++ } ++ zend_list_addref(Z_LVAL_P(the_stream)); ++ ++ zend_update_static_property_long(THIS_CE, ZEND_STRS("lastModified")-1, http_last_modified(the_real_stream, SEND_RSRC) TSRMLS_CC); ++ if ((etag = http_etag(the_real_stream, 0, SEND_RSRC))) { ++ zend_update_static_property_string(THIS_CE, ZEND_STRS("eTag")-1, etag TSRMLS_CC); ++ efree(etag); ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto static resource HttpResponse::getStream() ++ Get the previously set resource to be sent. */ ++PHP_METHOD(HttpResponse, getStream) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *stream = http_zsep(IS_LONG, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("stream")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_RESOURCE(Z_LVAL_P(stream)); ++ zval_ptr_dtor(&stream); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setFile(string file) ++ Set the file to be sent. */ ++PHP_METHOD(HttpResponse, setFile) ++{ ++ char *the_file, *etag; ++ int file_len; ++ php_stream_statbuf ssb; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &the_file, &file_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (php_stream_stat_path(the_file, &ssb)) { ++ RETURN_FALSE; ++ } ++ ++ if ( (SUCCESS != zend_update_static_property_stringl(THIS_CE, ZEND_STRS("file")-1, the_file, file_len TSRMLS_CC)) || ++ (SUCCESS != zend_update_static_property_long(THIS_CE, ZEND_STRS("mode")-1, -1 TSRMLS_CC))) { ++ RETURN_FALSE; ++ } ++ ++ zend_update_static_property_long(THIS_CE, ZEND_STRS("lastModified")-1, http_last_modified(the_file, -1) TSRMLS_CC); ++ if ((etag = http_etag(the_file, 0, -1))) { ++ zend_update_static_property_string(THIS_CE, ZEND_STRS("eTag")-1, etag TSRMLS_CC); ++ efree(etag); ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto static string HttpResponse::getFile() ++ Get the previously set file to be sent. */ ++PHP_METHOD(HttpResponse, getFile) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *file = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("file")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(file, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::send([bool clean_ob = true]) ++ Finally send the entity. */ ++PHP_METHOD(HttpResponse, send) ++{ ++ zval *sent; ++ zend_bool clean_ob = 1; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &clean_ob)) { ++ RETURN_FALSE; ++ } ++ ++ HTTP_CHECK_HEADERS_SENT(RETURN_FALSE); ++ ++ sent = *zend_std_get_static_property(THIS_CE, ZEND_STRS("sent")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC); ++ if (Z_LVAL_P(sent)) { ++ http_error(HE_WARNING, HTTP_E_RESPONSE, "Cannot send HttpResponse, response has already been sent"); ++ RETURN_FALSE; ++ } else { ++ Z_LVAL_P(sent) = 1; ++ } ++ ++ /* capture mode */ ++ if (i_zend_is_true(*zend_std_get_static_property(THIS_CE, ZEND_STRS("catch")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))) { ++ zval *zetag, *the_data; ++ ++ MAKE_STD_ZVAL(the_data); ++#ifdef PHP_OUTPUT_NEWAPI ++ php_output_get_contents(the_data TSRMLS_CC); ++#else ++ php_ob_get_buffer(the_data TSRMLS_CC); ++#endif ++ zend_update_static_property(THIS_CE, ZEND_STRS("data")-1, the_data TSRMLS_CC); ++ ZVAL_LONG(*zend_std_get_static_property(THIS_CE, ZEND_STRS("mode")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC), SEND_DATA); ++ ++ zetag = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("eTag")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ if (!Z_STRLEN_P(zetag)) { ++ char *etag = http_etag(Z_STRVAL_P(the_data), Z_STRLEN_P(the_data), SEND_DATA); ++ if (etag) { ++ zend_update_static_property_string(THIS_CE, ZEND_STRS("eTag")-1, etag TSRMLS_CC); ++ efree(etag); ++ } ++ } ++ zval_ptr_dtor(&the_data); ++ zval_ptr_dtor(&zetag); ++ ++ clean_ob = 1; ++ } ++ ++ if (clean_ob) { ++ /* interrupt on-the-fly etag generation */ ++ HTTP_G->etag.started = 0; ++ /* discard previous output buffers */ ++#ifdef PHP_OUTPUT_NEWAPI ++ php_output_discard_all(TSRMLS_C); ++#else ++ php_end_ob_buffers(0 TSRMLS_CC); ++#endif ++ } ++ ++ /* caching */ ++ if (i_zend_is_true(*zend_std_get_static_property(THIS_CE, ZEND_STRS("cache")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))) { ++ zval *cctl, *etag, *lmod; ++ ++ lmod = http_zsep(IS_LONG, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("lastModified")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ etag = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("eTag")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ cctl = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("cacheControl")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ ++ if (Z_LVAL_P(lmod) || Z_STRLEN_P(etag)) { ++ if (Z_STRLEN_P(cctl)) { ++ http_send_cache_control(Z_STRVAL_P(cctl), Z_STRLEN_P(cctl)); ++ } else { ++ http_send_cache_control(HTTP_DEFAULT_CACHECONTROL, lenof(HTTP_DEFAULT_CACHECONTROL)); ++ } ++ if (Z_STRLEN_P(etag)) { ++ http_send_etag(Z_STRVAL_P(etag), Z_STRLEN_P(etag)); ++ } ++ if (Z_LVAL_P(lmod)) { ++ http_send_last_modified(Z_LVAL_P(lmod)); ++ } ++ } ++ ++ zval_ptr_dtor(&etag); ++ zval_ptr_dtor(&lmod); ++ zval_ptr_dtor(&cctl); ++ } ++ ++ /* content type */ ++ { ++ zval *ctype = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("contentType")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ if (Z_STRLEN_P(ctype)) { ++ http_send_content_type(Z_STRVAL_P(ctype), Z_STRLEN_P(ctype)); ++ } else { ++ char *ctypes = INI_STR("default_mimetype"); ++ size_t ctlen = ctypes ? strlen(ctypes) : 0; ++ ++ if (ctlen) { ++ http_send_content_type(ctypes, ctlen); ++ } else { ++ http_send_content_type("application/x-octetstream", lenof("application/x-octetstream")); ++ } ++ } ++ zval_ptr_dtor(&ctype); ++ } ++ ++ /* content disposition */ ++ { ++ zval *cd = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("contentDisposition")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ if (Z_STRLEN_P(cd)) { ++ http_send_header_ex("Content-Disposition", lenof("Content-Disposition"), Z_STRVAL_P(cd), Z_STRLEN_P(cd), 1, NULL); ++ } ++ zval_ptr_dtor(&cd); ++ } ++ ++ /* throttling */ ++ { ++ zval *bsize = http_zsep(IS_LONG, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("bufferSize")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ zval *delay = http_zsep(IS_DOUBLE, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("throttleDelay")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ HTTP_G->send.buffer_size = Z_LVAL_P(bsize); ++ HTTP_G->send.throttle_delay = Z_DVAL_P(delay); ++ zval_ptr_dtor(&bsize); ++ zval_ptr_dtor(&delay); ++ } ++ ++ /* gzip */ ++ HTTP_G->send.deflate.response = i_zend_is_true(*zend_std_get_static_property(THIS_CE, ZEND_STRS("gzip")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC)); ++ ++ /* send */ ++ switch (Z_LVAL_P(*zend_std_get_static_property(THIS_CE, ZEND_STRS("mode")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))) { ++ case SEND_DATA: ++ { ++ zval *zdata = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("data")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_SUCCESS(http_send_data(Z_STRVAL_P(zdata), Z_STRLEN_P(zdata))); ++ zval_ptr_dtor(&zdata); ++ return; ++ } ++ ++ case SEND_RSRC: ++ { ++ php_stream *the_real_stream; ++ zval *the_stream = http_zsep(IS_LONG, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("stream")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ the_stream->type = IS_RESOURCE; ++ php_stream_from_zval(the_real_stream, &the_stream); ++ RETVAL_SUCCESS(http_send_stream(the_real_stream)); ++ zval_ptr_dtor(&the_stream); ++ return; ++ } ++ ++ default: ++ { ++ zval *file = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("file")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_SUCCESS(http_send_file(Z_STRVAL_P(file))); ++ zval_ptr_dtor(&file); ++ return; ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static void HttpResponse::capture() ++ Capture script output. ++ */ ++PHP_METHOD(HttpResponse, capture) ++{ ++ NO_ARGS; ++ ++ HTTP_CHECK_HEADERS_SENT(RETURN_FALSE); ++ ++ zend_update_static_property_long(THIS_CE, ZEND_STRS("catch")-1, 1 TSRMLS_CC); ++#ifdef PHP_OUTPUT_NEWAPI ++ php_output_discard_all(TSRMLS_C); ++ php_output_start_default(TSRMLS_C); ++#else ++ php_end_ob_buffers(0 TSRMLS_CC); ++ php_start_ob_buffer(NULL, 0, 0 TSRMLS_CC); ++#endif ++ ++ /* register shutdown function */ ++ { ++ zval func, retval, arg, *argp[1]; ++ ++ INIT_PZVAL(&arg); ++ INIT_PZVAL(&func); ++ INIT_PZVAL(&retval); ++ ZVAL_STRINGL(&func, "register_shutdown_function", lenof("register_shutdown_function"), 0); ++ ++ array_init(&arg); ++ add_next_index_stringl(&arg, "HttpResponse", lenof("HttpResponse"), 1); ++ add_next_index_stringl(&arg, "send", lenof("send"), 1); ++ argp[0] = &arg; ++ call_user_function(EG(function_table), NULL, &func, &retval, 1, argp TSRMLS_CC); ++ zval_dtor(&arg); ++ } ++} ++/* }}} */ ++ ++#endif /* ZEND_ENGINE_2 && !WONKY */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_send_api.c +@@ -0,0 +1,611 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_send_api.c 312028 2011-06-10 22:03:12Z felipe $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_ZLIB ++#define HTTP_WANT_MAGIC ++#include "php_http.h" ++ ++#include "php_streams.h" ++ ++#include "php_http_api.h" ++#include "php_http_cache_api.h" ++#include "php_http_date_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_headers_api.h" ++#include "php_http_send_api.h" ++ ++/* {{{ http_flush() */ ++#define http_flush(d, l) _http_flush(NULL, (d), (l) TSRMLS_CC) ++static inline void _http_flush(void *nothing, const char *data, size_t data_len TSRMLS_DC) ++{ ++ PHPWRITE(data, data_len); ++ /* we really only need to flush when throttling is enabled, ++ because we push the data as fast as possible anyway if not */ ++ if (HTTP_G->send.throttle_delay >= HTTP_DIFFSEC) { ++#if defined(PHP_VERSION_ID) && (PHP_VERSION_ID >= 50399) ++ php_output_end_all(TSRMLS_C); ++#else ++ if (OG(ob_nesting_level)) { ++ php_end_ob_buffer(1, 1 TSRMLS_CC); ++ } ++ if (!OG(implicit_flush)) { ++ sapi_flush(TSRMLS_C); ++ } ++#endif ++ http_sleep(HTTP_G->send.throttle_delay); ++ } ++} ++/* }}} */ ++ ++/* {{{ http_send_response_start */ ++#define http_send_response_start(b, cl) _http_send_response_start((b), (cl) TSRMLS_CC) ++static inline void _http_send_response_start(void **buffer, size_t content_length TSRMLS_DC) ++{ ++ int encoding; ++ ++ if ((encoding = http_encoding_response_start(content_length, 0))) { ++#ifdef HTTP_HAVE_ZLIB ++ *((http_encoding_stream **) buffer) = http_encoding_deflate_stream_init(NULL, ++ (encoding == HTTP_ENCODING_GZIP) ? ++ HTTP_DEFLATE_TYPE_GZIP : HTTP_DEFLATE_TYPE_ZLIB); ++#endif ++ } ++ /* flush headers */ ++ sapi_flush(TSRMLS_C); ++} ++/* }}} */ ++ ++/* {{{ http_send_response_data_plain */ ++#define http_send_response_data_plain(b, d, dl) _http_send_response_data_plain((b), (d), (dl) TSRMLS_CC) ++static inline void _http_send_response_data_plain(void **buffer, const char *data, size_t data_len TSRMLS_DC) ++{ ++ if (HTTP_G->send.deflate.response && HTTP_G->send.deflate.encoding) { ++#ifdef HTTP_HAVE_ZLIB ++ char *encoded; ++ size_t encoded_len; ++ http_encoding_stream *s = *((http_encoding_stream **) buffer); ++ ++ http_encoding_deflate_stream_update(s, data, data_len, &encoded, &encoded_len); ++ if (HTTP_G->send.buffer_size) { ++ phpstr_chunked_output((phpstr **) &s->storage, encoded, encoded_len, HTTP_G->send.buffer_size, _http_flush, NULL TSRMLS_CC); ++ } else { ++ http_flush(encoded, encoded_len); ++ } ++ efree(encoded); ++#else ++ http_error(HE_ERROR, HTTP_E_RESPONSE, "Attempt to send GZIP response despite being able to do so; please report this bug"); ++#endif ++ } else if (HTTP_G->send.buffer_size) { ++ phpstr_chunked_output((phpstr **) buffer, data, data_len, HTTP_G->send.buffer_size, _http_flush, NULL TSRMLS_CC); ++ } else { ++ http_flush(data, data_len); ++ } ++} ++/* }}} */ ++ ++/* {{{ http_send_response_data_fetch */ ++#define http_send_response_data_fetch(b, d, l, m, s, e) _http_send_response_data_fetch((b), (d), (l), (m), (s), (e) TSRMLS_CC) ++static inline void _http_send_response_data_fetch(void **buffer, const void *data, size_t data_len, http_send_mode mode, size_t begin, size_t end TSRMLS_DC) ++{ ++ long bsz, got, len = end - begin; ++ ++ if (!(bsz = HTTP_G->send.buffer_size)) { ++ bsz = HTTP_SENDBUF_SIZE; ++ } ++ ++ switch (mode) { ++ case SEND_RSRC: { ++ php_stream *s = (php_stream *) data; ++ if (SUCCESS == php_stream_seek(s, begin, SEEK_SET)) { ++ char *buf = emalloc(bsz); ++ ++ while (len > 0) { ++ got = php_stream_read(s, buf, MIN(len, bsz)); ++ http_send_response_data_plain(buffer, buf, got); ++ len -= got; ++ } ++ ++ efree(buf); ++ } ++ break; ++ } ++ case SEND_DATA: { ++ const char *buf = ((const char *) data) + begin; ++ while (len > 0) { ++ got = MIN(len, bsz); ++ http_send_response_data_plain(buffer, buf, got); ++ len -= got; ++ buf += got; ++ } ++ break; ++ } ++ EMPTY_SWITCH_DEFAULT_CASE(); ++ } ++} ++/* }}} */ ++ ++/* {{{ http_send_response_finish */ ++#define http_send_response_finish(b) _http_send_response_finish((b) TSRMLS_CC) ++static inline void _http_send_response_finish(void **buffer TSRMLS_DC) ++{ ++ if (HTTP_G->send.deflate.response && HTTP_G->send.deflate.encoding) { ++#ifdef HTTP_HAVE_ZLIB ++ char *encoded = NULL; ++ size_t encoded_len = 0; ++ http_encoding_stream *s = *((http_encoding_stream **) buffer); ++ ++ http_encoding_deflate_stream_finish(s, &encoded, &encoded_len); ++ if (HTTP_G->send.buffer_size) { ++ phpstr_chunked_output((phpstr **) &s->storage, encoded, encoded_len, 0, _http_flush, NULL TSRMLS_CC); ++ } else { ++ http_flush(encoded, encoded_len); ++ } ++ http_encoding_deflate_stream_free(&s); ++ STR_FREE(encoded); ++#else ++ http_error(HE_ERROR, HTTP_E_RESPONSE, "Attempt to send GZIP response despite being able to do so; please report this bug"); ++#endif ++ } else if (HTTP_G->send.buffer_size) { ++ phpstr_chunked_output((phpstr **) buffer, NULL, 0, 0, _http_flush, NULL TSRMLS_CC); ++ } ++} ++/* }}} */ ++ ++/* {{{ */ ++PHP_MINIT_FUNCTION(http_send) ++{ ++ HTTP_LONG_CONSTANT("HTTP_REDIRECT", HTTP_REDIRECT); ++ HTTP_LONG_CONSTANT("HTTP_REDIRECT_PERM", HTTP_REDIRECT_PERM); ++ HTTP_LONG_CONSTANT("HTTP_REDIRECT_FOUND", HTTP_REDIRECT_FOUND); ++ HTTP_LONG_CONSTANT("HTTP_REDIRECT_POST", HTTP_REDIRECT_POST); ++ HTTP_LONG_CONSTANT("HTTP_REDIRECT_PROXY", HTTP_REDIRECT_PROXY); ++ HTTP_LONG_CONSTANT("HTTP_REDIRECT_TEMP", HTTP_REDIRECT_TEMP); ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ http_find_header */ ++typedef struct { ++ const char *h; ++ size_t l; ++} http_response_header_t; ++ ++static int http_find_header(void *data, void *arg) ++{ ++ http_response_header_t *h = arg; ++ sapi_header_struct *s = data; ++ ++ return (!strncasecmp(s->header, h->h, h->l)) && s->header[h->l] == ':'; ++} ++/* }}} */ ++ ++/* {{{ void http_hide_header(char *) */ ++PHP_HTTP_API void _http_hide_header_ex(const char *name, size_t name_len TSRMLS_DC) ++{ ++ http_response_header_t h = {name, name_len}; ++ zend_llist_del_element(&SG(sapi_headers).headers, (void *) &h, http_find_header); ++} ++/* }}} */ ++ ++/* {{{ void http_send_header_zval(char*, zval **, zend_bool) */ ++PHP_HTTP_API void _http_send_header_zval_ex(const char *name, size_t name_len, zval **val, zend_bool replace TSRMLS_DC) ++{ ++ if (!val || !*val || Z_TYPE_PP(val) == IS_NULL || (Z_TYPE_PP(val) == IS_STRING && !Z_STRLEN_PP(val))) { ++ http_hide_header_ex(name, name_len); ++ } else if (Z_TYPE_PP(val) == IS_ARRAY || Z_TYPE_PP(val) == IS_OBJECT) { ++ zend_bool first = replace; ++ zval **data_ptr; ++ HashPosition pos; ++ ++ FOREACH_HASH_VAL(pos, HASH_OF(*val), data_ptr) { ++ zval *data = http_zsep(IS_STRING, *data_ptr); ++ ++ http_send_header_ex(name, name_len, Z_STRVAL_P(data), Z_STRLEN_P(data), first, NULL); ++ zval_ptr_dtor(&data); ++ first = 0; ++ } ++ } else { ++ zval *data = http_zsep(IS_STRING, *val); ++ ++ http_send_header_ex(name, name_len, Z_STRVAL_P(data), Z_STRLEN_P(data), replace, NULL); ++ zval_ptr_dtor(&data); ++ } ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send_header(char *, char *, zend_bool) */ ++PHP_HTTP_API STATUS _http_send_header_ex(const char *name, size_t name_len, const char *value, size_t value_len, zend_bool replace, char **sent_header TSRMLS_DC) ++{ ++ STATUS ret; ++ ++ if (value && value_len) { ++ size_t header_len = sizeof(": ") + name_len + value_len + 1; ++ char *header = emalloc(header_len + 1); ++ ++ header[header_len] = '\0'; ++ header_len = snprintf(header, header_len, "%s: %s", name, value); ++ ret = http_send_header_string_ex(header, header_len, replace); ++ if (sent_header) { ++ *sent_header = header; ++ } else { ++ efree(header); ++ } ++ } else { ++ http_hide_header_ex(name, name_len); ++ ret = SUCCESS; ++ } ++ return ret; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send_status_header(int, char *) */ ++PHP_HTTP_API STATUS _http_send_status_header_ex(int status, const char *header, size_t header_len, zend_bool replace TSRMLS_DC) ++{ ++ STATUS ret; ++ sapi_header_line h = {(char *) header, header_len, status}; ++ if (SUCCESS != (ret = sapi_header_op(replace ? SAPI_HEADER_REPLACE : SAPI_HEADER_ADD, &h TSRMLS_CC))) { ++ http_error_ex(HE_WARNING, HTTP_E_HEADER, "Could not send header: %s (%d)", header, status); ++ } ++ return ret; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send_last_modified(int) */ ++PHP_HTTP_API STATUS _http_send_last_modified_ex(time_t t, char **sent_header TSRMLS_DC) ++{ ++ STATUS ret; ++ char *date = http_date(t); ++ ++ if (!date) { ++ return FAILURE; ++ } ++ ++ ret = http_send_header_ex("Last-Modified", lenof("Last-Modified"), date, strlen(date), 1, sent_header); ++ efree(date); ++ ++ /* remember */ ++ HTTP_G->send.last_modified = t; ++ ++ return ret; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send_etag(char *, size_t) */ ++PHP_HTTP_API STATUS _http_send_etag_ex(const char *etag, size_t etag_len, char **sent_header TSRMLS_DC) ++{ ++ STATUS status; ++ char *etag_header; ++ size_t etag_header_len; ++ ++ if (!etag_len){ ++ http_error_ex(HE_WARNING, HTTP_E_HEADER, "Attempt to send empty ETag (previous: %s)\n", HTTP_G->send.unquoted_etag); ++ return FAILURE; ++ } ++ ++ etag_header_len = spprintf(&etag_header, 0, "ETag: \"%s\"", etag); ++ status = http_send_header_string_ex(etag_header, etag_header_len, 1); ++ ++ /* remember */ ++ STR_SET(HTTP_G->send.unquoted_etag, estrndup(etag, etag_len)); ++ ++ if (sent_header) { ++ *sent_header = etag_header; ++ } else { ++ efree(etag_header); ++ } ++ ++ return status; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send_content_type(char *, size_t) */ ++PHP_HTTP_API STATUS _http_send_content_type(const char *content_type, size_t ct_len TSRMLS_DC) ++{ ++ HTTP_CHECK_CONTENT_TYPE(content_type, return FAILURE); ++ ++ /* remember for multiple ranges */ ++ STR_FREE(HTTP_G->send.content_type); ++ HTTP_G->send.content_type = estrndup(content_type, ct_len); ++ ++ return http_send_header_ex("Content-Type", lenof("Content-Type"), content_type, ct_len, 1, NULL); ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send_content_disposition(char *, size_t, zend_bool) */ ++PHP_HTTP_API STATUS _http_send_content_disposition(const char *filename, size_t f_len, zend_bool send_inline TSRMLS_DC) ++{ ++ STATUS status; ++ char *cd_header; ++ ++ if (send_inline) { ++ cd_header = ecalloc(1, sizeof("Content-Disposition: inline; filename=\"\"") + f_len); ++ sprintf(cd_header, "Content-Disposition: inline; filename=\"%s\"", filename); ++ } else { ++ cd_header = ecalloc(1, sizeof("Content-Disposition: attachment; filename=\"\"") + f_len); ++ sprintf(cd_header, "Content-Disposition: attachment; filename=\"%s\"", filename); ++ } ++ ++ status = http_send_header_string(cd_header); ++ efree(cd_header); ++ return status; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send(void *, size_t, http_send_mode) */ ++PHP_HTTP_API STATUS _http_send_ex(const void *data_ptr, size_t data_size, http_send_mode data_mode, zend_bool no_cache TSRMLS_DC) ++{ ++ void *s = NULL; ++ HashTable ranges; ++ http_range_status range_status; ++ ++ if (!data_ptr) { ++ return FAILURE; ++ } ++ if (!data_size) { ++ return SUCCESS; ++ } ++ ++ /* enable partial dl and resume */ ++ http_send_header_string("Accept-Ranges: bytes"); ++ ++ zend_hash_init(&ranges, 0, NULL, ZVAL_PTR_DTOR, 0); ++ range_status = http_get_request_ranges(&ranges, data_size); ++ ++ switch (range_status) { ++ case RANGE_ERR: ++ { ++ zend_hash_destroy(&ranges); ++ http_send_status(416); ++ return FAILURE; ++ } ++ case RANGE_OK: ++ { ++ /* Range Request - only send ranges if entity hasn't changed */ ++ if ( http_got_server_var("HTTP_IF_RANGE") && ++ !http_match_etag("HTTP_IF_RANGE", HTTP_G->send.unquoted_etag) && ++ !http_match_last_modified("HTTP_IF_RANGE", HTTP_G->send.last_modified)) { ++ /* fallthrough to send full entity with 200 Ok */ ++ no_cache = 1; ++ } else if ( !http_match_etag_ex("HTTP_IF_MATCH", HTTP_G->send.unquoted_etag, 0) || ++ !http_match_last_modified_ex("HTTP_IF_UNMODIFIED_SINCE", HTTP_G->send.last_modified, 0) || ++ !http_match_last_modified_ex("HTTP_UNLESS_MODIFIED_SINCE", HTTP_G->send.last_modified, 0)) { ++ /* 412 Precondition failed */ ++ zend_hash_destroy(&ranges); ++ http_send_status(412); ++ return FAILURE; ++ } else if (zend_hash_num_elements(&ranges) == 1) { ++ /* single range */ ++ zval **range, **begin, **end; ++ ++ if ( SUCCESS != zend_hash_index_find(&ranges, 0, (void *) &range) || ++ SUCCESS != zend_hash_index_find(Z_ARRVAL_PP(range), 0, (void *) &begin) || ++ SUCCESS != zend_hash_index_find(Z_ARRVAL_PP(range), 1, (void *) &end)) { ++ /* this should never happen */ ++ zend_hash_destroy(&ranges); ++ http_send_status(500); ++ return FAILURE; ++ } else { ++ phpstr header; ++ ++ phpstr_init(&header); ++ phpstr_appendf(&header, "Content-Range: bytes %ld-%ld/%zu", Z_LVAL_PP(begin), Z_LVAL_PP(end), data_size); ++ phpstr_fix(&header); ++ http_send_status_header_ex(206, PHPSTR_VAL(&header), PHPSTR_LEN(&header), 1); ++ phpstr_dtor(&header); ++ http_send_response_start(&s, Z_LVAL_PP(end)-Z_LVAL_PP(begin)+1); ++ http_send_response_data_fetch(&s, data_ptr, data_size, data_mode, Z_LVAL_PP(begin), Z_LVAL_PP(end) + 1); ++ http_send_response_finish(&s); ++ zend_hash_destroy(&ranges); ++ return SUCCESS; ++ } ++ } else { ++ /* multi range */ ++ HashPosition pos; ++ zval **range, **begin, **end; ++ const char *content_type = HTTP_G->send.content_type; ++ char boundary_str[32]; ++ size_t boundary_len; ++ phpstr header, preface; ++ ++ boundary_len = http_boundary(boundary_str, sizeof(boundary_str)); ++ phpstr_init(&header); ++ phpstr_appendf(&header, "Content-Type: multipart/byteranges; boundary=%s", boundary_str); ++ phpstr_fix(&header); ++ http_send_status_header_ex(206, PHPSTR_VAL(&header), PHPSTR_LEN(&header), 1); ++ phpstr_dtor(&header); ++ http_send_response_start(&s, 0); ++ ++ if (!content_type) { ++ content_type = "application/x-octetstream"; ++ } ++ ++ phpstr_init(&preface); ++ FOREACH_HASH_VAL(pos, &ranges, range) { ++ if ( SUCCESS == zend_hash_index_find(Z_ARRVAL_PP(range), 0, (void *) &begin) && ++ SUCCESS == zend_hash_index_find(Z_ARRVAL_PP(range), 1, (void *) &end)) { ++ ++#define HTTP_RANGE_PREFACE \ ++ HTTP_CRLF "--%s" \ ++ HTTP_CRLF "Content-Type: %s" \ ++ HTTP_CRLF "Content-Range: bytes %ld-%ld/%zu" \ ++ HTTP_CRLF HTTP_CRLF ++ ++ phpstr_appendf(&preface, HTTP_RANGE_PREFACE, boundary_str, content_type, Z_LVAL_PP(begin), Z_LVAL_PP(end), data_size); ++ phpstr_fix(&preface); ++ http_send_response_data_plain(&s, PHPSTR_VAL(&preface), PHPSTR_LEN(&preface)); ++ phpstr_reset(&preface); ++ http_send_response_data_fetch(&s, data_ptr, data_size, data_mode, Z_LVAL_PP(begin), Z_LVAL_PP(end) + 1); ++ } ++ } ++ phpstr_dtor(&preface); ++ ++ http_send_response_data_plain(&s, HTTP_CRLF "--", lenof(HTTP_CRLF "--")); ++ http_send_response_data_plain(&s, boundary_str, boundary_len); ++ http_send_response_data_plain(&s, "--", lenof("--")); ++ ++ http_send_response_finish(&s); ++ zend_hash_destroy(&ranges); ++ return SUCCESS; ++ } ++ } ++ case RANGE_NO: ++ { ++ zend_hash_destroy(&ranges); ++ ++ /* send 304 Not Modified if etag matches - DON'T return on ETag generation failure */ ++ if (!no_cache && (http_interrupt_ob_etaghandler() || (HTTP_G->send.unquoted_etag != NULL))) { ++ char *etag = NULL; ++ ++ if (HTTP_G->send.unquoted_etag) { ++ etag = estrdup(HTTP_G->send.unquoted_etag); ++ } ++ ++ if (etag || (etag = http_etag(data_ptr, data_size, data_mode))) { ++ char *sent_header = NULL; ++ ++ http_send_etag_ex(etag, strlen(etag), &sent_header); ++ if (http_match_etag("HTTP_IF_NONE_MATCH", etag)) { ++ return http_exit_ex(304, sent_header, NULL, 0); ++ } else { ++ STR_FREE(sent_header); ++ /* no caching for Last-Modified if ETags really don't match */ ++ no_cache = http_got_server_var("HTTP_IF_NONE_MATCH"); ++ } ++ efree(etag); ++ } ++ } ++ ++ /* send 304 Not Modified if last modified matches */ ++ if (!no_cache && HTTP_G->send.last_modified && http_match_last_modified("HTTP_IF_MODIFIED_SINCE", HTTP_G->send.last_modified)) { ++ char *sent_header = NULL; ++ http_send_last_modified_ex(HTTP_G->send.last_modified, &sent_header); ++ return http_exit_ex(304, sent_header, NULL, 0); ++ } ++ ++ /* send full response */ ++ http_send_response_start(&s, data_size); ++ http_send_response_data_fetch(&s, data_ptr, data_size, data_mode, 0, data_size); ++ http_send_response_finish(&s); ++ return SUCCESS; ++ } ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send_stream(php_stream *) */ ++PHP_HTTP_API STATUS _http_send_stream_ex(php_stream *file, zend_bool close_stream, zend_bool no_cache TSRMLS_DC) ++{ ++ STATUS status; ++ php_stream_statbuf ssb; ++ int orig_flags; ++ ++ if ((!file) || php_stream_stat(file, &ssb)) { ++ char *defct = sapi_get_default_content_type(TSRMLS_C); ++ ++ http_hide_header("Content-Disposition"); ++ http_send_content_type(defct, strlen(defct)); ++ http_error(HE_WARNING, HTTP_E_RESPONSE, "File not found; stat failed"); ++ STR_FREE(defct); ++ ++ if (HTTP_G->send.not_found_404) { ++ http_exit_ex(404, NULL, estrdup("File not found\n"), 0); ++ } ++ return FAILURE; ++ } ++ ++ orig_flags = file->flags; ++ file->flags |= PHP_STREAM_FLAG_NO_BUFFER; ++ status = http_send_ex(file, ssb.sb.st_size, SEND_RSRC, no_cache); ++ file->flags = orig_flags; ++ ++ if (close_stream) { ++ php_stream_close(file); ++ } ++ ++ return status; ++} ++/* }}} */ ++ ++/* {{{ char *http_guess_content_type(char *magic_file, long magic_mode, void *data, size_t size, http_send_mode mode) */ ++PHP_HTTP_API char *_http_guess_content_type(const char *magicfile, long magicmode, void *data_ptr, size_t data_len, http_send_mode data_mode TSRMLS_DC) ++{ ++ char *ct = NULL; ++ ++#ifdef HTTP_HAVE_MAGIC ++ struct magic_set *magic = NULL; ++ ++ HTTP_CHECK_OPEN_BASEDIR(magicfile, return NULL); ++ ++ if (!data_ptr) { ++ http_error(HE_WARNING, HTTP_E_INVALID_PARAM, "Supplied payload is empty"); ++ } else if (!(magic = magic_open(magicmode &~ MAGIC_MIME))) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid magic mode: %ld", magicmode); ++ } else if (-1 == magic_load(magic, magicfile)) { ++ http_error_ex(HE_WARNING, HTTP_E_RUNTIME, "Failed to load magic database '%s' (%s)", magicfile, magic_error(magic)); ++ } else { ++ const char *ctype = NULL; ++ ++ magic_setflags(magic, magicmode); ++ ++ switch (data_mode) { ++ case SEND_RSRC: ++ { ++ char *buffer; ++ size_t b_len; ++ ++ b_len = php_stream_copy_to_mem(data_ptr, &buffer, 65536, 0); ++ ctype = magic_buffer(magic, buffer, b_len); ++ efree(buffer); ++ break; ++ } ++ ++ case SEND_DATA: ++ ctype = magic_buffer(magic, data_ptr, data_len); ++ break; ++ ++ default: ++ HTTP_CHECK_OPEN_BASEDIR(data_ptr, magic_close(magic); return NULL); ++ ctype = magic_file(magic, data_ptr); ++ break; ++ } ++ ++ if (ctype) { ++ ct = estrdup(ctype); ++ } else { ++ http_error_ex(HE_WARNING, HTTP_E_RUNTIME, "Failed to guess Content-Type: %s", magic_error(magic)); ++ } ++ } ++ if (magic) { ++ magic_close(magic); ++ } ++#else ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "Cannot guess Content-Type; libmagic not available"); ++#endif ++ ++ return ct; ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: sw=4 ts=4 fdm=marker ++ * vim<600: sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_url_api.c +@@ -0,0 +1,482 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_url_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_NETDB ++#include "php_http.h" ++ ++#include "zend_ini.h" ++#include "php_output.h" ++#include "ext/standard/php_string.h" ++ ++#include "php_http_api.h" ++#include "php_http_querystring_api.h" ++#include "php_http_url_api.h" ++ ++static inline char *localhostname(void) ++{ ++ char hostname[1024] = {0}; ++ ++#ifdef PHP_WIN32 ++ if (SUCCESS == gethostname(hostname, lenof(hostname))) { ++ return estrdup(hostname); ++ } ++#elif defined(HAVE_GETHOSTNAME) ++ if (SUCCESS == gethostname(hostname, lenof(hostname))) { ++# if defined(HAVE_GETDOMAINNAME) ++ size_t hlen = strlen(hostname); ++ if (hlen <= lenof(hostname) - lenof("(none)")) { ++ hostname[hlen++] = '.'; ++ if (SUCCESS == getdomainname(&hostname[hlen], lenof(hostname) - hlen)) { ++ if (!strcmp(&hostname[hlen], "(none)")) { ++ hostname[hlen - 1] = '\0'; ++ } ++ return estrdup(hostname); ++ } ++ } ++# endif ++ if (strcmp(hostname, "(none)")) { ++ return estrdup(hostname); ++ } ++ } ++#endif ++ return estrndup("localhost", lenof("localhost")); ++} ++ ++PHP_MINIT_FUNCTION(http_url) ++{ ++ HTTP_LONG_CONSTANT("HTTP_URL_REPLACE", HTTP_URL_REPLACE); ++ HTTP_LONG_CONSTANT("HTTP_URL_JOIN_PATH", HTTP_URL_JOIN_PATH); ++ HTTP_LONG_CONSTANT("HTTP_URL_JOIN_QUERY", HTTP_URL_JOIN_QUERY); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_USER", HTTP_URL_STRIP_USER); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_PASS", HTTP_URL_STRIP_PASS); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_AUTH", HTTP_URL_STRIP_AUTH); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_PORT", HTTP_URL_STRIP_PORT); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_PATH", HTTP_URL_STRIP_PATH); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_QUERY", HTTP_URL_STRIP_QUERY); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_FRAGMENT", HTTP_URL_STRIP_FRAGMENT); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_ALL", HTTP_URL_STRIP_ALL); ++ HTTP_LONG_CONSTANT("HTTP_URL_FROM_ENV", HTTP_URL_FROM_ENV); ++ return SUCCESS; ++} ++ ++PHP_HTTP_API char *_http_absolute_url_ex(const char *url, int flags TSRMLS_DC) ++{ ++ char *abs = NULL; ++ php_url *purl = NULL; ++ ++ if (url) { ++ purl = php_url_parse(abs = estrdup(url)); ++ STR_SET(abs, NULL); ++ if (!purl) { ++ http_error_ex(HE_WARNING, HTTP_E_URL, "Could not parse URL (%s)", url); ++ return NULL; ++ } ++ } ++ ++ http_build_url(flags, purl, NULL, NULL, &abs, NULL); ++ ++ if (purl) { ++ php_url_free(purl); ++ } ++ ++ return abs; ++} ++ ++/* {{{ void http_build_url(int flags, const php_url *, const php_url *, php_url **, char **, size_t *) */ ++PHP_HTTP_API void _http_build_url(int flags, const php_url *old_url, const php_url *new_url, php_url **url_ptr, char **url_str, size_t *url_len TSRMLS_DC) ++{ ++#if defined(HAVE_GETSERVBYPORT) || defined(HAVE_GETSERVBYNAME) ++ struct servent *se; ++#endif ++ php_url *url = ecalloc(1, sizeof(php_url)); ++ ++#define __URLSET(u,n) \ ++ ((u)&&(u)->n) ++#define __URLCPY(n) \ ++ url->n = __URLSET(new_url,n) ? estrdup(new_url->n) : (__URLSET(old_url,n) ? estrdup(old_url->n) : NULL) ++ ++ if (!(flags & HTTP_URL_STRIP_PORT)) { ++ url->port = __URLSET(new_url, port) ? new_url->port : ((old_url) ? old_url->port : 0); ++ } ++ if (!(flags & HTTP_URL_STRIP_USER)) { ++ __URLCPY(user); ++ } ++ if (!(flags & HTTP_URL_STRIP_PASS)) { ++ __URLCPY(pass); ++ } ++ ++ __URLCPY(scheme); ++ __URLCPY(host); ++ ++ if (!(flags & HTTP_URL_STRIP_PATH)) { ++ if ((flags & HTTP_URL_JOIN_PATH) && __URLSET(old_url, path) && __URLSET(new_url, path) && *new_url->path != '/') { ++ size_t old_path_len = strlen(old_url->path), new_path_len = strlen(new_url->path); ++ ++ url->path = ecalloc(1, old_path_len + new_path_len + 1 + 1); ++ ++ strcat(url->path, old_url->path); ++ if (url->path[old_path_len - 1] != '/') { ++ php_dirname(url->path, old_path_len); ++ strcat(url->path, "/"); ++ } ++ strcat(url->path, new_url->path); ++ } else { ++ __URLCPY(path); ++ } ++ } ++ if (!(flags & HTTP_URL_STRIP_QUERY)) { ++ if ((flags & HTTP_URL_JOIN_QUERY) && __URLSET(new_url, query) && __URLSET(old_url, query)) { ++ zval qarr, qstr; ++ ++ INIT_PZVAL(&qstr); ++ INIT_PZVAL(&qarr); ++ array_init(&qarr); ++ ++ ZVAL_STRING(&qstr, old_url->query, 0); ++ http_querystring_modify(&qarr, &qstr); ++ ZVAL_STRING(&qstr, new_url->query, 0); ++ http_querystring_modify(&qarr, &qstr); ++ ++ ZVAL_NULL(&qstr); ++ http_querystring_update(&qarr, &qstr); ++ url->query = Z_STRVAL(qstr); ++ zval_dtor(&qarr); ++ } else { ++ __URLCPY(query); ++ } ++ } ++ if (!(flags & HTTP_URL_STRIP_FRAGMENT)) { ++ __URLCPY(fragment); ++ } ++ ++ if (!url->scheme) { ++ if (flags & HTTP_URL_FROM_ENV) { ++ zval *https = http_get_server_var("HTTPS", 1); ++ if (https && !strcasecmp(Z_STRVAL_P(https), "ON")) { ++ url->scheme = estrndup("https", lenof("https")); ++ } else switch (url->port) { ++ case 443: ++ url->scheme = estrndup("https", lenof("https")); ++ break; ++ ++#ifndef HAVE_GETSERVBYPORT ++ default: ++#endif ++ case 80: ++ case 0: ++ url->scheme = estrndup("http", lenof("http")); ++ break; ++ ++#ifdef HAVE_GETSERVBYPORT ++ default: ++ if ((se = getservbyport(htons(url->port), "tcp")) && se->s_name) { ++ url->scheme = estrdup(se->s_name); ++ } else { ++ url->scheme = estrndup("http", lenof("http")); ++ } ++ break; ++#endif ++ } ++ } else { ++ url->scheme = estrndup("http", lenof("http")); ++ } ++ } ++ ++ if (!url->host) { ++ if (flags & HTTP_URL_FROM_ENV) { ++ zval *zhost; ++ ++ if ((((zhost = http_get_server_var("HTTP_HOST", 1)) || ++ (zhost = http_get_server_var("SERVER_NAME", 1)))) && Z_STRLEN_P(zhost)) { ++ url->host = estrndup(Z_STRVAL_P(zhost), Z_STRLEN_P(zhost)); ++ } else { ++ url->host = localhostname(); ++ } ++ } else { ++ url->host = estrndup("localhost", lenof("localhost")); ++ } ++ } ++ ++ if (!url->path) { ++ if ((flags & HTTP_URL_FROM_ENV) && SG(request_info).request_uri && SG(request_info).request_uri[0]) { ++ const char *q = strchr(SG(request_info).request_uri, '?'); ++ ++ if (q) { ++ url->path = estrndup(SG(request_info).request_uri, q - SG(request_info).request_uri); ++ } else { ++ url->path = estrdup(SG(request_info).request_uri); ++ } ++ } else { ++ url->path = estrndup("/", 1); ++ } ++ } else if (url->path[0] != '/') { ++ if ((flags & HTTP_URL_FROM_ENV) && SG(request_info).request_uri && SG(request_info).request_uri[0]) { ++ size_t ulen = strlen(SG(request_info).request_uri); ++ size_t plen = strlen(url->path); ++ char *path; ++ ++ if (SG(request_info).request_uri[ulen-1] != '/') { ++ for (--ulen; ulen && SG(request_info).request_uri[ulen - 1] != '/'; --ulen); ++ } ++ ++ path = emalloc(ulen + plen + 1); ++ memcpy(path, SG(request_info).request_uri, ulen); ++ memcpy(path + ulen, url->path, plen); ++ path[ulen + plen] = '\0'; ++ STR_SET(url->path, path); ++ } else { ++ size_t plen = strlen(url->path); ++ char *path = emalloc(plen + 1 + 1); ++ ++ path[0] = '/'; ++ memcpy(&path[1], url->path, plen + 1); ++ STR_SET(url->path, path); ++ } ++ } ++ /* replace directory references if path is not a single slash */ ++ if (url->path[0] && (url->path[0] != '/' || url->path[1])) { ++ char *ptr, *end = url->path + strlen(url->path) + 1; ++ ++ for (ptr = strstr(url->path, "/."); ptr; ptr = strstr(ptr, "/.")) { ++ switch (ptr[2]) { ++ case '\0': ++ ptr[1] = '\0'; ++ break; ++ ++ case '/': ++ memmove(&ptr[1], &ptr[3], end - &ptr[3]); ++ break; ++ ++ case '.': ++ if (ptr[3] == '/') { ++ char *pos = &ptr[4]; ++ while (ptr != url->path) { ++ if (*--ptr == '/') { ++ break; ++ } ++ } ++ memmove(&ptr[1], pos, end - pos); ++ break; ++ } else if (!ptr[3]) { ++ /* .. at the end */ ++ ptr[1] = '\0'; ++ } ++ /* fallthrough */ ++ ++ default: ++ /* something else */ ++ ++ptr; ++ break; ++ } ++ } ++ } ++ ++ if (url->port) { ++ if ( ((url->port == 80) && !strcmp(url->scheme, "http")) ++ || ((url->port ==443) && !strcmp(url->scheme, "https")) ++#ifdef HAVE_GETSERVBYNAME ++ || ((se = getservbyname(url->scheme, "tcp")) && se->s_port && ++ (url->port == ntohs(se->s_port))) ++#endif ++ ) { ++ url->port = 0; ++ } ++ } ++ ++ if (url_str) { ++ size_t len; ++ ++ *url_str = emalloc(HTTP_URL_MAXLEN + 1); ++ ++ **url_str = '\0'; ++ strlcat(*url_str, url->scheme, HTTP_URL_MAXLEN); ++ strlcat(*url_str, "://", HTTP_URL_MAXLEN); ++ ++ if (url->user && *url->user) { ++ strlcat(*url_str, url->user, HTTP_URL_MAXLEN); ++ if (url->pass && *url->pass) { ++ strlcat(*url_str, ":", HTTP_URL_MAXLEN); ++ strlcat(*url_str, url->pass, HTTP_URL_MAXLEN); ++ } ++ strlcat(*url_str, "@", HTTP_URL_MAXLEN); ++ } ++ ++ strlcat(*url_str, url->host, HTTP_URL_MAXLEN); ++ ++ if (url->port) { ++ char port_str[8]; ++ ++ snprintf(port_str, sizeof(port_str), "%d", (int) url->port); ++ strlcat(*url_str, ":", HTTP_URL_MAXLEN); ++ strlcat(*url_str, port_str, HTTP_URL_MAXLEN); ++ } ++ ++ strlcat(*url_str, url->path, HTTP_URL_MAXLEN); ++ ++ if (url->query && *url->query) { ++ strlcat(*url_str, "?", HTTP_URL_MAXLEN); ++ strlcat(*url_str, url->query, HTTP_URL_MAXLEN); ++ } ++ ++ if (url->fragment && *url->fragment) { ++ strlcat(*url_str, "#", HTTP_URL_MAXLEN); ++ strlcat(*url_str, url->fragment, HTTP_URL_MAXLEN); ++ } ++ ++ if (HTTP_URL_MAXLEN == (len = strlen(*url_str))) { ++ http_error(HE_NOTICE, HTTP_E_URL, "Length of URL exceeds HTTP_URL_MAXLEN"); ++ } ++ if (url_len) { ++ *url_len = len; ++ } ++ } ++ ++ if (url_ptr) { ++ *url_ptr = url; ++ } else { ++ php_url_free(url); ++ } ++} ++/* }}} */ ++ ++/* {{{ STATUS http_urlencode_hash_ex(HashTable *, zend_bool, char *, size_t, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_urlencode_hash_ex(HashTable *hash, zend_bool override_argsep, ++ char *pre_encoded_data, size_t pre_encoded_len, ++ char **encoded_data, size_t *encoded_len TSRMLS_DC) ++{ ++ char *arg_sep; ++ size_t arg_sep_len; ++ phpstr *qstr = phpstr_new(); ++ ++ if (override_argsep || !(arg_sep_len = strlen(arg_sep = INI_STR("arg_separator.output")))) { ++ arg_sep = HTTP_URL_ARGSEP; ++ arg_sep_len = lenof(HTTP_URL_ARGSEP); ++ } ++ ++ if (pre_encoded_len && pre_encoded_data) { ++ phpstr_append(qstr, pre_encoded_data, pre_encoded_len); ++ } ++ ++ if (SUCCESS != http_urlencode_hash_recursive(hash, qstr, arg_sep, arg_sep_len, NULL, 0)) { ++ phpstr_free(&qstr); ++ return FAILURE; ++ } ++ ++ phpstr_data(qstr, encoded_data, encoded_len); ++ phpstr_free(&qstr); ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ http_urlencode_hash_recursive */ ++PHP_HTTP_API STATUS _http_urlencode_hash_recursive(HashTable *ht, phpstr *str, const char *arg_sep, size_t arg_sep_len, const char *prefix, size_t prefix_len TSRMLS_DC) ++{ ++ HashKey key = initHashKey(0); ++ zval **data = NULL; ++ HashPosition pos; ++ ++ if (!ht || !str) { ++ http_error(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid parameters"); ++ return FAILURE; ++ } ++ if (ht->nApplyCount > 0) { ++ return SUCCESS; ++ } ++ ++ FOREACH_HASH_KEYVAL(pos, ht, key, data) { ++ char *encoded_key; ++ int encoded_len; ++ phpstr new_prefix; ++ ++ if (!data || !*data) { ++ phpstr_dtor(str); ++ return FAILURE; ++ } ++ ++ if (key.type == HASH_KEY_IS_STRING) { ++ if (!*key.str) { ++ /* only public properties */ ++ continue; ++ } ++ if (key.len && key.str[key.len - 1] == '\0') { ++ --key.len; ++ } ++ encoded_key = php_url_encode(key.str, key.len, &encoded_len); ++ } else { ++ encoded_len = spprintf(&encoded_key, 0, "%ld", key.num); ++ } ++ ++ { ++ phpstr_init(&new_prefix); ++ if (prefix && prefix_len) { ++ phpstr_append(&new_prefix, prefix, prefix_len); ++ phpstr_appends(&new_prefix, "%5B"); ++ } ++ ++ phpstr_append(&new_prefix, encoded_key, encoded_len); ++ efree(encoded_key); ++ ++ if (prefix && prefix_len) { ++ phpstr_appends(&new_prefix, "%5D"); ++ } ++ phpstr_fix(&new_prefix); ++ } ++ ++ if (Z_TYPE_PP(data) == IS_ARRAY || Z_TYPE_PP(data) == IS_OBJECT) { ++ STATUS status; ++ ++ht->nApplyCount; ++ status = http_urlencode_hash_recursive(HASH_OF(*data), str, arg_sep, arg_sep_len, PHPSTR_VAL(&new_prefix), PHPSTR_LEN(&new_prefix)); ++ --ht->nApplyCount; ++ if (SUCCESS != status) { ++ phpstr_dtor(&new_prefix); ++ phpstr_dtor(str); ++ return FAILURE; ++ } ++ } else { ++ zval *val = http_zsep(IS_STRING, *data); ++ ++ if (PHPSTR_LEN(str)) { ++ phpstr_append(str, arg_sep, arg_sep_len); ++ } ++ phpstr_append(str, PHPSTR_VAL(&new_prefix), PHPSTR_LEN(&new_prefix)); ++ phpstr_appends(str, "="); ++ ++ if (Z_STRLEN_P(val) && Z_STRVAL_P(val)) { ++ char *encoded_val; ++ int encoded_len; ++ ++ encoded_val = php_url_encode(Z_STRVAL_P(val), Z_STRLEN_P(val), &encoded_len); ++ phpstr_append(str, encoded_val, encoded_len); ++ efree(encoded_val); ++ } ++ ++ zval_ptr_dtor(&val); ++ } ++ phpstr_dtor(&new_prefix); ++ } ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_util_object.c +@@ -0,0 +1,158 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_util_object.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#include "php_http.h" ++ ++#ifdef ZEND_ENGINE_2 ++ ++#include "ext/standard/php_http.h" ++ ++#include "php_http_util_object.h" ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpUtil, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpUtil, method, 0) ++ ++#define HTTP_UTIL_ALIAS(method, func) HTTP_STATIC_ME_ALIAS(method, func, HTTP_ARGS(HttpUtil, method)) ++ ++HTTP_BEGIN_ARGS(date, 0) ++ HTTP_ARG_VAL(timestamp, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(buildStr, 1) ++ HTTP_ARG_VAL(query, 0) ++ HTTP_ARG_VAL(prefix, 0) ++ HTTP_ARG_VAL(arg_sep, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(buildUrl, 1) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(parts, 0) ++ HTTP_ARG_VAL(flags, 0) ++ HTTP_ARG_VAL(composed, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(negotiateLanguage, 1) ++ HTTP_ARG_VAL(supported, 0) ++ HTTP_ARG_VAL(result, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(negotiateCharset, 1) ++ HTTP_ARG_VAL(supported, 0) ++ HTTP_ARG_VAL(result, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(negotiateContentType, 1) ++ HTTP_ARG_VAL(supported, 0) ++ HTTP_ARG_VAL(result, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(matchModified, 1) ++ HTTP_ARG_VAL(last_modified, 0) ++ HTTP_ARG_VAL(for_range, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(matchEtag, 1) ++ HTTP_ARG_VAL(plain_etag, 0) ++ HTTP_ARG_VAL(for_range, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(matchRequestHeader, 2) ++ HTTP_ARG_VAL(header_name, 0) ++ HTTP_ARG_VAL(header_value, 0) ++ HTTP_ARG_VAL(case_sensitive, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(parseMessage, 1) ++ HTTP_ARG_VAL(message_string, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(parseHeaders, 1) ++ HTTP_ARG_VAL(headers_string, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(parseCookie, 1) ++ HTTP_ARG_VAL(cookie_string, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(buildCookie, 1) ++ HTTP_ARG_VAL(cookie_array, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(parseParams, 1) ++ HTTP_ARG_VAL(param_string, 0) ++ HTTP_ARG_VAL(flags, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(chunkedDecode, 1) ++ HTTP_ARG_VAL(encoded_string, 0) ++HTTP_END_ARGS; ++ ++#ifdef HTTP_HAVE_ZLIB ++HTTP_BEGIN_ARGS(deflate, 1) ++ HTTP_ARG_VAL(plain, 0) ++ HTTP_ARG_VAL(flags, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(inflate, 1) ++ HTTP_ARG_VAL(encoded, 0) ++HTTP_END_ARGS; ++#endif ++ ++HTTP_BEGIN_ARGS(support, 0) ++ HTTP_ARG_VAL(feature, 0) ++HTTP_END_ARGS; ++ ++zend_class_entry *http_util_object_ce; ++zend_function_entry http_util_object_fe[] = { ++ HTTP_UTIL_ALIAS(date, http_date) ++ HTTP_UTIL_ALIAS(buildUrl, http_build_url) ++ HTTP_UTIL_ALIAS(buildStr, http_build_str) ++ HTTP_UTIL_ALIAS(negotiateLanguage, http_negotiate_language) ++ HTTP_UTIL_ALIAS(negotiateCharset, http_negotiate_charset) ++ HTTP_UTIL_ALIAS(negotiateContentType, http_negotiate_content_type) ++ HTTP_UTIL_ALIAS(matchModified, http_match_modified) ++ HTTP_UTIL_ALIAS(matchEtag, http_match_etag) ++ HTTP_UTIL_ALIAS(matchRequestHeader, http_match_request_header) ++ HTTP_UTIL_ALIAS(parseMessage, http_parse_message) ++ HTTP_UTIL_ALIAS(parseHeaders, http_parse_headers) ++ HTTP_UTIL_ALIAS(parseCookie, http_parse_cookie) ++ HTTP_UTIL_ALIAS(buildCookie, http_build_cookie) ++ HTTP_UTIL_ALIAS(parseParams, http_parse_params) ++ HTTP_UTIL_ALIAS(chunkedDecode, http_chunked_decode) ++#ifdef HTTP_HAVE_ZLIB ++ HTTP_UTIL_ALIAS(deflate, http_deflate) ++ HTTP_UTIL_ALIAS(inflate, http_inflate) ++#endif /* HTTP_HAVE_ZLIB */ ++ HTTP_UTIL_ALIAS(support, http_support) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++ ++PHP_MINIT_FUNCTION(http_util_object) ++{ ++ HTTP_REGISTER_CLASS(HttpUtil, http_util_object, NULL, 0); ++ return SUCCESS; ++} ++ ++#endif /* ZEND_ENGINE_2 */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/lib/BigGet.php +@@ -0,0 +1,213 @@ ++ ++ * @license BSD, revised ++ * @version $Revision: 220502 $ ++ */ ++class BigGet extends HttpRequestPool ++{ ++ /** ++ * File split size ++ */ ++ const SIZE = 1048576; ++ ++ /** ++ * Parallel Request count ++ */ ++ const RMAX = 5; ++ ++ /** ++ * Whether to output debug messages ++ * ++ * @var bool ++ */ ++ public $dbg = false; ++ ++ /** ++ * URL ++ * ++ * @var string ++ */ ++ private $url; ++ ++ /** ++ * Temp file prefix ++ * ++ * @var string ++ */ ++ private $tmp; ++ ++ /** ++ * Size of requested resource ++ * ++ * @var int ++ */ ++ private $size; ++ ++ /** ++ * Whether the requests have been sent ++ * ++ * @var bool ++ */ ++ private $sent = false; ++ ++ /** ++ * Request counter ++ * ++ * @var int ++ */ ++ private $count = 0; ++ ++ /** ++ * Static constructor ++ * ++ * @param string $url ++ * @param string $tmp ++ * @return BigGet ++ * @throws Exception ++ */ ++ public static function url($url, $tmp = '/tmp') ++ { ++ $head = new HttpRequest($url, HttpRequest::METH_HEAD); ++ $headers = $head->send()->getHeaders(); ++ ++ if (200 != $head->getResponseCode()) { ++ throw new HttpException("Did not receive '200 Ok' from HEAD $url"); ++ } ++ if (!isset($headers['Accept-Ranges'])) { ++ throw new HttpException("Did not receive an Accept-Ranges header from HEAD $url"); ++ } ++ if (!isset($headers['Content-Length'])) { ++ throw new HttpException("Did not receive a Content-Length header from HEAD $url"); ++ } ++ ++ $bigget = new BigGet; ++ $bigget->url = $url; ++ $bigget->tmp = tempnam($tmp, 'BigGet.'); ++ $bigget->size = $headers['Content-Length']; ++ return $bigget; ++ } ++ ++ /** ++ * Save the resource to a file ++ * ++ * @param string $file ++ * @return bool ++ * @throws Exception ++ */ ++ public function saveTo($file) ++ { ++ $this->sent or $this->send(); ++ ++ if ($w = fopen($this->tmp, 'wb')) { ++ ++ $this->dbg && print "\nCopying temp files to $file ...\n"; ++ ++ foreach (glob($this->tmp .".????") as $tmp) { ++ ++ $this->dbg && print "\t$tmp\n"; ++ ++ if ($r = fopen($tmp, 'rb')) { ++ stream_copy_to_stream($r, $w); ++ fclose($r); ++ } ++ unlink($tmp); ++ } ++ fclose($w); ++ rename($this->tmp, $file); ++ ++ $this->dbg && print "\nDone.\n"; ++ ++ return true; ++ } ++ return false; ++ } ++ ++ /** ++ * Overrides HttpRequestPool::send() ++ * ++ * @return void ++ * @throws Exception ++ */ ++ public function send() ++ { ++ $this->sent = true; ++ ++ // use max RMAX simultanous requests with a req size of SIZE ++ while ($this->count < self::RMAX && -1 != $offset = $this->getRangeOffset()) { ++ $this->attachNew($offset); ++ } ++ ++ while ($this->socketPerform()) { ++ if (!$this->socketSelect()) { ++ throw new HttpSocketException; ++ } ++ } ++ } ++ ++ /** ++ * Overrides HttpRequestPool::socketPerform() ++ * ++ * @return bool ++ */ ++ protected function socketPerform() ++ { ++ $rs = parent::socketPerform(); ++ ++ foreach ($this->getFinishedRequests() as $r) { ++ $this->detach($r); ++ ++ if (206 != $rc = $r->getResponseCode()) { ++ throw new HttpException("Unexpected response code: $rc"); ++ } ++ ++ file_put_contents(sprintf("%s.%04d", $this->tmp, $r->id), $r->getResponseBody()); ++ ++ if (-1 != $offset = $this->getRangeOffset()) { ++ $this->attachNew($offset); ++ } ++ } ++ ++ return $rs; ++ } ++ ++ private function attachNew($offset) ++ { ++ $stop = min($this->count * self::SIZE + self::SIZE, $this->size) - 1; ++ ++ $this->dbg && print "Attaching new request to get range: $offset-$stop\n"; ++ ++ $req = new BigGetRequest( ++ $this->url, ++ HttpRequest::METH_GET, ++ array( ++ 'headers' => array( ++ 'Range' => "bytes=$offset-$stop" ++ ) ++ ) ++ ); ++ $this->attach($req); ++ $req->id = $this->count++; ++ } ++ ++ private function getRangeOffset() ++ { ++ return ($this->size >= $start = $this->count * self::SIZE) ? $start : -1; ++ } ++} ++ ++ ++/** ++ * BigGet request ++ * @ignore ++ */ ++class BigGetRequest extends HttpRequest ++{ ++ public $id; ++} ++ ++?> +--- /dev/null ++++ b/ext/http/lib/FeedAggregator.php +@@ -0,0 +1,187 @@ ++ ++ * @license BSD, revised ++ * @package pecl/http ++ * @version $Revision: 208774 $ ++ */ ++class FeedAggregator ++{ ++ /** ++ * Cache directory ++ * ++ * @var string ++ */ ++ public $directory; ++ ++ /** ++ * Feeds ++ * ++ * @var array ++ */ ++ protected $feeds = array(); ++ ++ /** ++ * Constructor ++ * ++ * @param string $directory ++ */ ++ public function __construct($directory = 'feeds') ++ { ++ $this->setDirectory($directory); ++ } ++ ++ /** ++ * Set cache directory ++ * ++ * @param string $directory ++ */ ++ public function setDirectory($directory) ++ { ++ $this->directory = $directory; ++ foreach (glob($this->directory .'/*.xml') as $feed) { ++ $this->feeds[basename($feed, '.xml')] = filemtime($feed); ++ } ++ } ++ ++ /** ++ * Strips all special chars ++ * ++ * @param string $url ++ * @return string ++ */ ++ public function url2name($url) ++ { ++ return preg_replace('/[^\w\.-]+/', '_', $url); ++ } ++ ++ /** ++ * Checks if $url is a known feed ++ * ++ * @param string $url ++ * @return bool ++ */ ++ public function hasFeed($url) ++ { ++ return isset($this->feeds[$this->url2name($url)]); ++ } ++ ++ /** ++ * Add an URL as feed ++ * ++ * @param string $url ++ * @return void ++ * @throws Exception ++ */ ++ public function addFeed($url) ++ { ++ $r = $this->setupRequest($url); ++ $r->send(); ++ $this->handleResponse($r); ++ } ++ ++ /** ++ * Add several URLs as feeds ++ * ++ * @param array $urls ++ * @return void ++ * @throws Exception ++ */ ++ public function addFeeds(array $urls) ++ { ++ $pool = new HttpRequestPool; ++ foreach ($urls as $url) { ++ $pool->attach($r = $this->setupRequest($url)); ++ } ++ $pool->send(); ++ ++ foreach ($pool as $request) { ++ $this->handleResponse($request); ++ } ++ } ++ ++ /** ++ * Load a feed (from cache) ++ * ++ * @param string $url ++ * @return string ++ * @throws Exception ++ */ ++ public function getFeed($url) ++ { ++ $this->addFeed($url); ++ return $this->loadFeed($this->url2name($url)); ++ } ++ ++ /** ++ * Load several feeds (from cache) ++ * ++ * @param array $urls ++ * @return array ++ * @throws Exception ++ */ ++ public function getFeeds(array $urls) ++ { ++ $feeds = array(); ++ $this->addFeeds($urls); ++ foreach ($urls as $url) { ++ $feeds[] = $this->loadFeed($this->url2name($url)); ++ } ++ return $feeds; ++ } ++ ++ protected function saveFeed($file, $contents) ++ { ++ if (file_put_contents($this->directory .'/'. $file .'.xml', $contents)) { ++ $this->feeds[$file] = time(); ++ } else { ++ throw new Exception("Could not save feed contents to $file.xml"); ++ } ++ } ++ ++ protected function loadFeed($file) ++ { ++ if (isset($this->feeds[$file])) { ++ if ($data = file_get_contents($this->directory .'/'. $file .'.xml')) { ++ return $data; ++ } else { ++ throw new Exception("Could not load feed contents from $file.xml"); ++ } ++ } else { ++ throw new Exception("Unknown feed/file $file.xml"); ++ } ++ } ++ ++ protected function setupRequest($url, $escape = true) ++ { ++ $r = new HttpRequest($url); ++ $r->setOptions(array('redirect' => true)); ++ ++ $file = $escape ? $this->url2name($url) : $url; ++ ++ if (isset($this->feeds[$file])) { ++ $r->setOptions(array('lastmodified' => $this->feeds[$file])); ++ } ++ ++ return $r; ++ } ++ ++ protected function handleResponse(HttpRequest $r) ++ { ++ if ($r->getResponseCode() != 304) { ++ if ($r->getResponseCode() != 200) { ++ throw new Exception("Unexpected response code ". $r->getResponseCode()); ++ } ++ if (!strlen($body = $r->getResponseBody())) { ++ throw new Exception("Received empty feed from ". $r->getUrl()); ++ } ++ $this->saveFeed($this->url2name($r->getUrl()), $body); ++ } ++ } ++} ++ ++?> +--- /dev/null ++++ b/ext/http/lib/PgLobStream.php +@@ -0,0 +1,100 @@ ++ ++ * // GET /image.php?image=1234 ++ * if (PgLobStream::$loId = (int) $_GET['image']) { ++ * if ($lob = fopen('pglob://dbname=database user=mike', 'r')) { ++ * HttpResponse::setContentType('image/jpeg'); ++ * HttpResponse::setStream($lob); ++ * HttpResponse::send(); ++ * } ++ * } ++ * ++ * ++ * @copyright Michael Wallner, ++ * @license BSD, revised ++ * @package pecl/http ++ * @version $Revision: 210232 $ ++ */ ++class PgLobStream ++{ ++ private $dbh; ++ private $loh; ++ private $lon; ++ private $size = 0; ++ ++ public static $loId; ++ ++ function stream_open($path, $mode) ++ { ++ $path = trim(parse_url($path, PHP_URL_HOST)); ++ ++ if ($path) { ++ if ($this->dbh = pg_connect($path)) { ++ if (pg_query($this->dbh, 'BEGIN')) { ++ if (is_resource($this->loh = pg_lo_open($this->dbh, $this->lon = self::$loId, $mode))) { ++ pg_lo_seek($this->loh, 0, PGSQL_SEEK_END); ++ $this->size = (int) pg_lo_tell($this->loh); ++ pg_lo_seek($this->loh, 0, PGSQL_SEEK_SET); ++ return true; ++ } ++ } ++ } ++ } ++ return false; ++ } ++ ++ function stream_read($length) ++ { ++ return pg_lo_read($this->loh, $length); ++ } ++ ++ function stream_seek($offset, $whence = PGSQL_SEEK_SET) ++ { ++ return pg_lo_seek($this->loh, $offset, $whence); ++ } ++ ++ function stream_tell() ++ { ++ return pg_lo_tell($this->loh); ++ } ++ ++ function stream_eof() ++ { ++ return pg_lo_tell($this->loh) >= $this->size; ++ } ++ ++ function stream_flush() ++ { ++ return true; ++ } ++ ++ function stream_stat() ++ { ++ return array('size' => $this->size, 'ino' => $this->lon); ++ } ++ ++ function stream_write($data) ++ { ++ return pg_lo_write($this->loh, $data); ++ } ++ ++ function stream_close() ++ { ++ if (pg_lo_close($this->loh)) { ++ return pg_query($this->dbh, 'COMMIT'); ++ } else { ++ pg_query($this->dbh, 'ROLLBACK'); ++ return false; ++ } ++ } ++} ++ ++stream_register_wrapper('pglob', 'PgLobStream'); ++ ++?> +--- /dev/null ++++ b/ext/http/lib/XmlRpcClient.php +@@ -0,0 +1,119 @@ ++ ++ * __request->setOptions(array('compress' => true)); ++ * try { ++ * print_r($rpc->vpop->listdomain(array('domain' => 'example.com'))); ++ * } catch (Exception $ex) { ++ * echo $ex; ++ * } ++ * ?> ++ * ++ * ++ * @copyright Michael Wallner, ++ * @license BSD, revised ++ * @package pecl/http ++ * @version $Revision: 227268 $ ++ */ ++class XmlRpcClient ++{ ++ /** ++ * RPC namespace ++ * ++ * @var string ++ */ ++ public $__namespace; ++ ++ /** ++ * HttpRequest instance ++ * ++ * @var HttpRequest ++ */ ++ public $__request; ++ ++ /** ++ * Client charset ++ * ++ * @var string ++ */ ++ public $__encoding = "iso-8859-1"; ++ ++ /** ++ * RPC options ++ * ++ * @var array ++ */ ++ public $__options; ++ ++ /** ++ * Constructor ++ * ++ * @param string $url RPC endpoint ++ * @param string $namespace RPC namespace ++ * @param array $options HttpRequest options ++ */ ++ public function __construct($url, $namespace = '', array $options = null) ++ { ++ $this->__request = new HttpRequest($url, HttpRequest::METH_POST, (array) $options); ++ $this->__namespace = $namespace; ++ } ++ ++ /** ++ * RPC method proxy ++ * ++ * @param string $method RPC method name ++ * @param array $params RPC method arguments ++ * @return mixed decoded RPC response ++ * @throws Exception ++ */ ++ public function __call($method, array $params) ++ { ++ if (strlen($this->__namespace)) { ++ $method = $this->__namespace .'.'. $method; ++ } ++ $this->__request->setContentType("text/xml"); ++ $this->__request->setRawPostData( ++ xmlrpc_encode_request($method, $params, ++ array("encoding" => $this->__encoding) + (array) $this->__options)); ++ $response = $this->__request->send(); ++ if ($response->getResponseCode() != 200) { ++ throw new Exception( ++ $response->getResponseStatus(), ++ $response->getResponseCode() ++ ); ++ } ++ ++ $data = xmlrpc_decode($response->getBody(), $this->__encoding); ++ if (xmlrpc_is_fault($data)) { ++ throw new Exception( ++ (string) $data['faultString'], ++ (int) $data['faultCode'] ++ ); ++ } ++ ++ return $data; ++ } ++ ++ /** ++ * Returns self, where namespace is set to variable name ++ * ++ * @param string $ns ++ * @return XmlRpcRequest ++ */ ++ public function __get($ns) ++ { ++ $this->__namespace = $ns; ++ return $this; ++ } ++} ++ ++?> +--- /dev/null ++++ b/ext/http/lib/XmlRpcServer.php +@@ -0,0 +1,254 @@ ++ ++ * registerHandler(new Handler); ++ * XmlRpcServer::run(); ++ * } catch (Exception $ex) { ++ * XmlRpcServer::error($ex->getCode(), $ex->getMessage()); ++ * } ++ * ++ * ++ * @copyright Michael Wallner, ++ * @license BSD, revised ++ * @package pecl/http ++ * @version $Revision: 227268 $ ++ */ ++ ++class XmlRpcServer extends HttpResponse ++{ ++ /** ++ * Server charset ++ * ++ * @var string ++ */ ++ public static $encoding = "iso-8859-1"; ++ ++ /** ++ * RPC namespace ++ * ++ * @var string ++ */ ++ public $namespace; ++ ++ /** ++ * RPC handler attached to this server instance ++ * ++ * @var XmlRpcRequestHandler ++ */ ++ protected $handler; ++ ++ private static $xmlreq; ++ private static $xmlrpc; ++ private static $refcnt = 0; ++ private static $handle = array(); ++ ++ /** ++ * Create a new XmlRpcServer instance ++ * ++ * @param string $namespace ++ * @param string $encoding ++ */ ++ public function __construct($namespace) ++ { ++ $this->namespace = $namespace; ++ self::initialize(); ++ } ++ ++ /** ++ * Destructor ++ */ ++ public function __destruct() ++ { ++ if (self::$refcnt && !--self::$refcnt) { ++ xmlrpc_server_destroy(self::$xmlrpc); ++ } ++ } ++ ++ /** ++ * Static factory ++ * ++ * @param string $namespace ++ * @return XmlRpcServer ++ */ ++ public static function factory($namespace) ++ { ++ return new XmlRpcServer($namespace); ++ } ++ ++ /** ++ * Run all servers and send response ++ * ++ * @param array $options ++ */ ++ public static function run(array $options = null) ++ { ++ self::initialize(false, true); ++ self::setContentType("text/xml; charset=". self::$encoding); ++ echo xmlrpc_server_call_method(self::$xmlrpc, self::$xmlreq, null, ++ array("encoding" => self::$encoding) + (array) $options); ++ } ++ ++ /** ++ * Test hook; call instead of XmlRpcServer::run() ++ * ++ * @param string $method ++ * @param array $params ++ * @param array $request_options ++ * @param array $response_options ++ */ ++ public static function test($method, array $params, array $request_options = null, array $response_options = null) ++ { ++ self::$xmlreq = xmlrpc_encode_request($method, $params, $request_options); ++ self::run($response_options); ++ } ++ ++ /** ++ * Optional XMLRPC error handler ++ * ++ * @param int $code ++ * @param string $msg ++ */ ++ public static function error($code, $msg, array $options = null) ++ { ++ echo xmlrpc_encode(array("faultCode" => $code, "faultString" => $msg), ++ array("encoding" => self::$encoding) + (array) $options); ++ } ++ ++ /** ++ * Register a single method ++ * ++ * @param string $name ++ * @param mixed $callback ++ * @param mixed $dispatch ++ * @param array $spec ++ */ ++ public function registerMethod($name, $callback, $dispatch = null, array $spec = null) ++ { ++ if (!is_callable($callback, false, $cb_name)) { ++ throw new Exception("$cb_name is not a valid callback"); ++ } ++ if (isset($dispatch)) { ++ if (!is_callable($dispatch, false, $cb_name)) { ++ throw new Exception("$cb_name is not a valid callback"); ++ } ++ xmlrpc_server_register_method(self::$xmlrpc, $name, $dispatch); ++ self::$handle[$name] = $callback; ++ } else { ++ xmlrpc_server_register_method(self::$xmlrpc, $name, $callback); ++ } ++ ++ if (isset($spec)) { ++ xmlrpc_server_add_introspection_data(self::$xmlrpc, $spec); ++ } ++ } ++ ++ /** ++ * Register an XmlRpcRequestHandler for this server instance ++ * ++ * @param XmlRpcRequestHandler $handler ++ */ ++ public function registerHandler(XmlRpcRequestHandler $handler) ++ { ++ $this->handler = $handler; ++ ++ foreach (get_class_methods($handler) as $method) { ++ if (!strncmp($method, "xmlrpc", 6)) { ++ $this->registerMethod( ++ $this->method($method, $handler->getNamespace()), ++ array($handler, $method), array($this, "dispatch")); ++ } ++ } ++ ++ $handler->getIntrospectionData($spec); ++ if (is_array($spec)) { ++ xmlrpc_server_add_introspection_data(self::$xmlrpc, $spec); ++ } ++ } ++ ++ private function method($method, $namespace = null) ++ { ++ if (!strlen($namespace)) { ++ $namespace = strlen($this->namespace) ? $this->namespace : "xmlrpc"; ++ } ++ return $namespace .".". strtolower($method[6]) . substr($method, 7); ++ } ++ ++ private function dispatch($method, array $params = null) ++ { ++ if (array_key_exists($method, self::$handle)) { ++ return call_user_func(self::$handle[$method], $params); ++ } ++ throw new Exception("Unknown XMLRPC method: $method"); ++ } ++ ++ private static function initialize($server = true, $data = false) ++ { ++ if ($data) { ++ if (!self::$xmlreq && !(self::$xmlreq = http_get_request_body())) { ++ throw new Exception("Failed to fetch XMLRPC request body"); ++ } ++ } ++ if ($server) { ++ if (!self::$xmlrpc && !(self::$xmlrpc = xmlrpc_server_create())) { ++ throw new Exception("Failed to initialize XMLRPC server"); ++ } ++ ++self::$refcnt; ++ } ++ } ++} ++ ++/** ++ * XmlRpcRequestHandler ++ * ++ * Define XMLRPC methods with an "xmlrpc" prefix, eg: ++ * ++ * class IntOp implements XmlRpcRequestHandler { ++ * public function getNamespace() { ++ * return "int"; ++ * } ++ * public function getInstrospectionData(array &$spec = null) { ++ * } ++ * // XMLRPC method name: int.sumValues ++ * public function xmlrpcSumValues(array $values) { ++ * return array_sum($values); ++ * } ++ * } ++ * ++ */ ++interface XmlRpcRequestHandler ++{ ++ public function getNamespace(); ++ public function getIntrospectionData(array &$spec = null); ++} ++ ++/** ++ * XmlRpcRequestHandlerStub ++ */ ++abstract class XmlRpcRequestHandlerStub implements XmlRpcRequestHandler ++{ ++ public function getNamespace() ++ { ++ } ++ public function getIntrospectionData(array &$spec = null) ++ { ++ } ++} ++ ++?> +--- /dev/null ++++ b/ext/http/missing.c +@@ -0,0 +1,74 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: missing.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifdef HAVE_CONFIG_H ++# include "config.h" ++#endif ++ ++#include "php.h" ++#include "missing.h" ++ ++#ifdef WONKY ++int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC) ++{ ++ zval *property = pemalloc(sizeof(zval), ce->type & ZEND_INTERNAL_CLASS); ++ INIT_PZVAL(property); ++ ZVAL_DOUBLE(property, value); ++ return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC); ++} ++ ++void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC) ++{ ++ zval *tmp = ecalloc(1, sizeof(zval)); ++ ZVAL_DOUBLE(tmp, value); ++ zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC); ++} ++ ++int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC) ++{ ++ zval *property = pemalloc(sizeof(zval), ce->type & ZEND_INTERNAL_CLASS); ++ INIT_PZVAL(property); ++ ZVAL_BOOL(property, value); ++ return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC); ++} ++ ++void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC) ++{ ++ zval *tmp = ecalloc(1, sizeof(zval)); ++ ZVAL_BOOL(tmp, value); ++ zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC); ++} ++ ++void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC) ++{ ++ zval *tmp; ++ ++ ALLOC_ZVAL(tmp); ++ tmp->is_ref = 0; ++ tmp->refcount = 0; ++ ZVAL_STRINGL(tmp, value, value_len, 1); ++ zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC); ++} ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/missing.h +@@ -0,0 +1,184 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: missing.h 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#ifndef PHP_HTTP_MISSING ++#define PHP_HTTP_MISSING ++ ++#include "php_version.h" ++ ++#if ZEND_MODULE_API_NO >= 20100409 ++#define ZEND_ENGINE_2_4 ++#endif ++ ++#if defined(PHP_VERSION_ID) && (PHP_VERSION_ID >= 50399) ++# define ZEND_LITERAL_KEY_DC , const zend_literal *_zend_literal_key ++# define ZEND_LITERAL_KEY_CC , _zend_literal_key ++# define ZEND_LITERAL_NIL_CC , NULL ++# define HTTP_CHECK_OPEN_BASEDIR(file, act) \ ++ if ((PG(open_basedir) && *PG(open_basedir))) \ ++ { \ ++ const char *tmp = file; \ ++ \ ++ if (!strncasecmp(tmp, "file:", lenof("file:"))) { \ ++ tmp += lenof("file:"); \ ++ while ((tmp - (const char *)file < 7) && (*tmp == '/' || *tmp == '\\')) ++tmp; \ ++ } \ ++ \ ++ if ( (tmp != file || !strstr(file, "://")) && \ ++ (!*tmp || php_check_open_basedir(tmp TSRMLS_CC))) { \ ++ act; \ ++ } \ ++ } ++ ++#else ++# define ZEND_LITERAL_KEY_DC ++# define ZEND_LITERAL_KEY_CC ++# define ZEND_LITERAL_NIL_CC ++# define HTTP_CHECK_OPEN_BASEDIR(file, act) \ ++ if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) \ ++ { \ ++ const char *tmp = file; \ ++ \ ++ if (!strncasecmp(tmp, "file:", lenof("file:"))) { \ ++ tmp += lenof("file:"); \ ++ while ((tmp - (const char *)file < 7) && (*tmp == '/' || *tmp == '\\')) ++tmp; \ ++ } \ ++ \ ++ if ( (tmp != file || !strstr(file, "://")) && \ ++ (!*tmp || php_check_open_basedir(tmp TSRMLS_CC) || \ ++ (PG(safe_mode) && !php_checkuid(tmp, "rb+", CHECKUID_CHECK_MODE_PARAM)))) { \ ++ act; \ ++ } \ ++ } ++ ++#endif ++ ++#if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION >= 3) ++# define HTTP_ZAPI_HASH_TSRMLS_CC TSRMLS_CC ++# define HTTP_ZAPI_HASH_TSRMLS_DC TSRMLS_DC ++# define HTTP_ZAPI_CONST_CAST(t) (const t) ++# define GLOBAL_ERROR_HANDLING EG(error_handling) ++# define GLOBAL_EXCEPTION_CLASS EG(exception_class) ++# define HTTP_IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp) TSRMLS_CC) ++# define HTTP_STATIC_ARG_INFO ++#else ++# define HTTP_ZAPI_HASH_TSRMLS_CC ++# define HTTP_ZAPI_HASH_TSRMLS_DC ++# define HTTP_ZAPI_CONST_CAST(t) (t) ++# define GLOBAL_ERROR_HANDLING PG(error_handling) ++# define GLOBAL_EXCEPTION_CLASS PG(exception_class) ++# define HTTP_IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp)) ++# define HTTP_STATIC_ARG_INFO static ++#endif ++ ++#if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION == 0) ++# define WONKY ++#endif ++ ++#ifndef pemalloc_rel ++# define pemalloc_rel(size, persistent) ((persistent)?malloc(size):emalloc_rel(size)) ++#endif ++ ++#ifndef ZEND_ACC_DEPRECATED ++# define ZEND_ACC_DEPRECATED 0 ++#endif ++ ++#if PHP_MAJOR_VERSION == 4 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION < 10 ++# define php_url_parse_ex(u, l) php_url_parse(u) ++#endif ++ ++#ifndef TSRMLS_FETCH_FROM_CTX ++# ifdef ZTS ++# define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx ++# else ++# define TSRMLS_FETCH_FROM_CTX(ctx) ++# endif ++#endif ++ ++#ifndef TSRMLS_SET_CTX ++# ifdef ZTS ++# define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_ls ++# else ++# define TSRMLS_SET_CTX(ctx) ++# endif ++#endif ++ ++#ifndef ZVAL_ADDREF ++# define ZVAL_ADDREF Z_ADDREF_P ++#endif ++ ++#ifndef SEPARATE_ARG_IF_REF ++#define SEPARATE_ARG_IF_REF(zv) \ ++ if (PZVAL_IS_REF(zv)) { \ ++ zval *ov = zv; \ ++ ALLOC_INIT_ZVAL(zv); \ ++ Z_TYPE_P(zv) = Z_TYPE_P(ov); \ ++ zv->value = ov->value; \ ++ zval_copy_ctor(zv); \ ++ } else { \ ++ ZVAL_ADDREF(zv); \ ++ } ++#endif ++ ++#ifndef ZVAL_ZVAL ++#define ZVAL_ZVAL(z, zv, copy, dtor) { \ ++ int is_ref, refcount; \ ++ is_ref = (z)->is_ref; \ ++ refcount = (z)->refcount; \ ++ *(z) = *(zv); \ ++ if (copy) { \ ++ zval_copy_ctor(z); \ ++ } \ ++ if (dtor) { \ ++ if (!copy) { \ ++ ZVAL_NULL(zv); \ ++ } \ ++ zval_ptr_dtor(&zv); \ ++ } \ ++ (z)->is_ref = is_ref; \ ++ (z)->refcount = refcount; \ ++ } ++#endif ++#ifndef RETVAL_ZVAL ++# define RETVAL_ZVAL(zv, copy, dtor) ZVAL_ZVAL(return_value, zv, copy, dtor) ++#endif ++#ifndef RETURN_ZVAL ++# define RETURN_ZVAL(zv, copy, dtor) { RETVAL_ZVAL(zv, copy, dtor); return; } ++#endif ++ ++#ifndef ZEND_MN ++# define ZEND_MN(name) ZEND_FN(name) ++#endif ++ ++#ifdef WONKY ++extern int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC); ++extern void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC); ++ ++extern int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC); ++extern void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC); ++ ++extern void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC); ++#endif ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http.h +@@ -0,0 +1,262 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http.h 324012 2012-03-08 08:44:32Z mike $ */ ++ ++#ifndef PHP_EXT_HTTP_H ++#define PHP_EXT_HTTP_H ++ ++#define PHP_HTTP_VERSION "1.7.4" ++ ++#ifdef HAVE_CONFIG_H ++# include "config.h" ++#else ++# ifndef PHP_WIN32 ++# include "php_config.h" ++# endif ++#endif ++ ++#include "php.h" ++#include "missing.h" ++#include "php_http_std_defs.h" ++#include "phpstr/phpstr.h" ++ ++#ifdef HTTP_WANT_SAPI ++# if PHP_API_VERSION > 20041225 ++# define HTTP_HAVE_SAPI_RTIME ++# endif ++# include "SAPI.h" ++#endif ++ ++#ifdef HTTP_WANT_NETDB ++# ifdef PHP_WIN32 ++# define HTTP_HAVE_NETDB ++# include ++# elif defined(HAVE_NETDB_H) ++# define HTTP_HAVE_NETDB ++# include ++# ifdef HAVE_UNISTD_H ++# include ++# endif ++# endif ++#endif ++ ++#if defined(HTTP_WANT_CURL) && defined(HTTP_HAVE_CURL) ++# ifdef PHP_WIN32 ++# include ++# define CURL_STATICLIB ++# endif ++# include ++# define HTTP_CURL_VERSION(x, y, z) (LIBCURL_VERSION_NUM >= (((x)<<16) + ((y)<<8) + (z))) ++# ++# if defined(HTTP_WANT_EVENT) && defined(HTTP_HAVE_EVENT) ++# include ++# endif ++#endif ++ ++#if defined(HTTP_WANT_MAGIC) && defined(HTTP_HAVE_MAGIC) ++# if defined(PHP_WIN32) && !defined(USE_MAGIC_DLL) && !defined(USE_MAGIC_STATIC) ++# define USE_MAGIC_STATIC ++# endif ++# include ++#endif ++ ++#if defined(HTTP_WANT_ZLIB) && defined(HTTP_HAVE_ZLIB) ++# include ++#endif ++ ++#include ++#define HTTP_IS_CTYPE(type, c) is##type((int) (unsigned char) (c)) ++#define HTTP_TO_CTYPE(type, c) to##type((int) (unsigned char) (c)) ++ ++extern zend_module_entry http_module_entry; ++#define phpext_http_ptr &http_module_entry ++ ++extern int http_module_number; ++ ++ZEND_BEGIN_MODULE_GLOBALS(http) ++ ++ struct _http_globals_etag { ++ char *mode; ++ void *ctx; ++ zend_bool started; ++ } etag; ++ ++ struct _http_globals_log { ++ char *cache; ++ char *redirect; ++ char *not_found; ++ char *allowed_methods; ++ char *composite; ++ } log; ++ ++ struct _http_globals_send { ++ double throttle_delay; ++ size_t buffer_size; ++ char *content_type; ++ char *unquoted_etag; ++ time_t last_modified; ++ struct _http_globals_send_deflate { ++ zend_bool response; ++ zend_bool start_auto; ++ long start_flags; ++ int encoding; ++ void *stream; ++ } deflate; ++ struct _http_globals_send_inflate { ++ zend_bool start_auto; ++ long start_flags; ++ void *stream; ++ } inflate; ++ zend_bool not_found_404; ++ } send; ++ ++ struct _http_globals_request { ++ time_t time; ++ HashTable *headers; ++ struct _http_globals_request_methods { ++ HashTable registered; ++ char *allowed; ++ char *custom; ++ } methods; ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) ++ struct _http_globals_request_datashare { ++ zend_llist handles; ++ zend_bool cookie; ++ zend_bool dns; ++ zend_bool ssl; ++ zend_bool connect; ++ } datashare; ++#endif ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_EVENT) ++ struct _http_globals_request_pool { ++ struct _http_globals_request_pool_event { ++ void *base; ++ } event; ++ } pool; ++#endif ++ } request; ++ ++ struct _http_globals_persistent { ++ struct _http_globals_persistent_handles { ++ ulong limit; ++ struct _http_globals_persistent_handles_ident { ++ ulong h; ++ char *s; ++ size_t l; ++ } ident; ++ } handles; ++ } persistent; ++ ++#ifdef ZEND_ENGINE_2 ++ zend_bool only_exceptions; ++#endif ++ ++ zend_bool force_exit; ++ zend_bool read_post_data; ++ zval *server_var; ++ ++ZEND_END_MODULE_GLOBALS(http) ++ ++ZEND_EXTERN_MODULE_GLOBALS(http); ++ ++#ifdef ZTS ++# include "TSRM.h" ++# define HTTP_G ((zend_http_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(http_globals_id)]) ++#else ++# define HTTP_G (&http_globals) ++#endif ++ ++#if defined(HAVE_ICONV) && (HTTP_SHARED_DEPS || !defined(COMPILE_DL_ICONV)) ++# define HTTP_HAVE_ICONV ++#endif ++ ++#if defined(HAVE_PHP_SESSION) && (HTTP_SHARED_DEPS || !defined(COMPILE_DL_SESSION)) ++# define HTTP_HAVE_SESSION ++#endif ++ ++#if defined(HAVE_HASH_EXT) && (HTTP_SHARED_DEPS || !defined(COMPILE_DL_HASH)) && defined(HTTP_HAVE_PHP_HASH_H) ++# define HTTP_HAVE_HASH ++#endif ++ ++#if defined(HAVE_SPL) ++# define HTTP_HAVE_SPL ++#endif ++ ++PHP_FUNCTION(http_date); ++PHP_FUNCTION(http_build_url); ++PHP_FUNCTION(http_build_str); ++PHP_FUNCTION(http_negotiate_language); ++PHP_FUNCTION(http_negotiate_charset); ++PHP_FUNCTION(http_negotiate_content_type); ++PHP_FUNCTION(http_negotiate); ++PHP_FUNCTION(http_redirect); ++PHP_FUNCTION(http_throttle); ++PHP_FUNCTION(http_send_status); ++PHP_FUNCTION(http_send_last_modified); ++PHP_FUNCTION(http_send_content_type); ++PHP_FUNCTION(http_send_content_disposition); ++PHP_FUNCTION(http_match_modified); ++PHP_FUNCTION(http_match_etag); ++PHP_FUNCTION(http_cache_last_modified); ++PHP_FUNCTION(http_cache_etag); ++PHP_FUNCTION(http_send_data); ++PHP_FUNCTION(http_send_file); ++PHP_FUNCTION(http_send_stream); ++PHP_FUNCTION(http_chunked_decode); ++PHP_FUNCTION(http_parse_message); ++PHP_FUNCTION(http_parse_headers); ++PHP_FUNCTION(http_parse_cookie); ++PHP_FUNCTION(http_build_cookie); ++PHP_FUNCTION(http_parse_params); ++PHP_FUNCTION(http_get_request_headers); ++PHP_FUNCTION(http_get_request_body); ++PHP_FUNCTION(http_get_request_body_stream); ++PHP_FUNCTION(http_match_request_header); ++PHP_FUNCTION(http_persistent_handles_count); ++PHP_FUNCTION(http_persistent_handles_clean); ++PHP_FUNCTION(http_persistent_handles_ident); ++#ifdef HTTP_HAVE_CURL ++PHP_FUNCTION(http_get); ++PHP_FUNCTION(http_head); ++PHP_FUNCTION(http_post_data); ++PHP_FUNCTION(http_post_fields); ++PHP_FUNCTION(http_put_data); ++PHP_FUNCTION(http_put_file); ++PHP_FUNCTION(http_put_stream); ++PHP_FUNCTION(http_request); ++PHP_FUNCTION(http_request_body_encode); ++#endif /* HTTP_HAVE_CURL */ ++PHP_FUNCTION(http_request_method_register); ++PHP_FUNCTION(http_request_method_unregister); ++PHP_FUNCTION(http_request_method_exists); ++PHP_FUNCTION(http_request_method_name); ++PHP_FUNCTION(ob_etaghandler); ++#ifdef HTTP_HAVE_ZLIB ++PHP_FUNCTION(http_deflate); ++PHP_FUNCTION(http_inflate); ++PHP_FUNCTION(ob_deflatehandler); ++PHP_FUNCTION(ob_inflatehandler); ++#endif ++PHP_FUNCTION(http_support); ++ ++#endif /* PHP_HTTP_H */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_api.h +@@ -0,0 +1,326 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_api.h 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#ifndef PHP_HTTP_API_H ++#define PHP_HTTP_API_H ++ ++#define HTTP_SUPPORT 0x01L ++#define HTTP_SUPPORT_REQUESTS 0x02L ++#define HTTP_SUPPORT_MAGICMIME 0x04L ++#define HTTP_SUPPORT_ENCODINGS 0x08L ++#define HTTP_SUPPORT_SSLREQUESTS 0x20L ++#define HTTP_SUPPORT_PERSISTENCE 0x40L ++#define HTTP_SUPPORT_EVENTS 0x80L ++ ++#define HTTP_PARAMS_ALLOW_COMMA 0x01 ++#define HTTP_PARAMS_ALLOW_FAILURE 0x02 ++#define HTTP_PARAMS_RAISE_ERROR 0x04 ++#define HTTP_PARAMS_DEFAULT (HTTP_PARAMS_ALLOW_COMMA|HTTP_PARAMS_ALLOW_FAILURE|HTTP_PARAMS_RAISE_ERROR) ++#define HTTP_PARAMS_COLON_SEPARATOR 0x10 ++ ++extern PHP_MINIT_FUNCTION(http_support); ++ ++#define http_support(f) _http_support(f) ++PHP_HTTP_API long _http_support(long feature); ++ ++#define pretty_key(key, key_len, uctitle, xhyphen) _http_pretty_key(key, key_len, uctitle, xhyphen) ++extern char *_http_pretty_key(char *key, size_t key_len, zend_bool uctitle, zend_bool xhyphen); ++ ++#define http_boundary(b, l) _http_boundary((b), (l) TSRMLS_CC) ++extern size_t _http_boundary(char *buf, size_t len TSRMLS_DC); ++ ++#define http_error(type, code, string) _http_error_ex(type, code, "%s", string) ++#define http_error_ex _http_error_ex ++extern void _http_error_ex(long type TSRMLS_DC, long code, const char *format, ...); ++ ++ ++#ifdef ZEND_ENGINE_2 ++#define http_exception_wrap(o, n, ce) _http_exception_wrap((o), (n), (ce) TSRMLS_CC) ++extern zval *_http_exception_wrap(zval *old_exception, zval *new_exception, zend_class_entry *ce TSRMLS_DC); ++ ++#define http_try \ ++{ \ ++ zval *old_exception = EG(exception); \ ++ EG(exception) = NULL; ++#define http_catch(ex_ce) \ ++ if (EG(exception) && old_exception) { \ ++ EG(exception) = http_exception_wrap(old_exception, EG(exception), ex_ce); \ ++ } \ ++} ++#define http_final(ex_ce) \ ++ if (EG(exception)) { \ ++ EG(exception) = http_exception_wrap(EG(exception), NULL, ex_ce); \ ++ } ++ ++typedef zend_object_value (*http_object_new_t)(zend_class_entry *ce, void *, void ** TSRMLS_DC); ++ ++#define http_object_new(ov, cn, cl, co, ce, i, pp) _http_object_new((ov), (cn), (cl), (http_object_new_t) (co), (ce), (i), (void *) (pp) TSRMLS_CC) ++extern STATUS _http_object_new(zend_object_value *ov, const char *cname_str, uint cname_len, http_object_new_t create, zend_class_entry *parent_ce, void *intern_ptr, void **obj_ptr TSRMLS_DC); ++#endif /* ZEND_ENGINE_2 */ ++ ++ ++#define HTTP_CHECK_CURL_INIT(ch, init, action) \ ++ if ((!(ch)) && (!((ch) = init))) { \ ++ http_error(HE_WARNING, HTTP_E_REQUEST, "Could not initialize curl"); \ ++ action; \ ++ } ++#define HTTP_CHECK_CONTENT_TYPE(ct, action) \ ++ if (!strchr((ct), '/')) { \ ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, \ ++ "Content type \"%s\" does not seem to contain a primary and a secondary part", (ct)); \ ++ action; \ ++ } ++#define HTTP_CHECK_MESSAGE_TYPE_RESPONSE(msg, action) \ ++ if (!HTTP_MSG_TYPE(RESPONSE, (msg))) { \ ++ http_error(HE_NOTICE, HTTP_E_MESSAGE_TYPE, "HttpMessage is not of type HTTP_MSG_RESPONSE"); \ ++ action; \ ++ } ++#define HTTP_CHECK_MESSAGE_TYPE_REQUEST(msg, action) \ ++ if (!HTTP_MSG_TYPE(REQUEST, (msg))) { \ ++ http_error(HE_NOTICE, HTTP_E_MESSAGE_TYPE, "HttpMessage is not of type HTTP_MSG_REQUEST"); \ ++ action; \ ++ } ++#define HTTP_CHECK_GZIP_LEVEL(level, action) \ ++ if (level < -1 || level > 9) { \ ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid compression level (-1 to 9): %d", level); \ ++ action; \ ++ } ++#ifndef PHP_OUTPUT_NEWAPI ++# define HTTP_GET_OUTPUT_START() \ ++ char *output_start_filename = php_get_output_start_filename(TSRMLS_C); \ ++ int output_start_lineno = php_get_output_start_lineno(TSRMLS_C) ++#else ++# define HTTP_GET_OUTPUT_START() \ ++ char *output_start_filename = php_output_get_start_filename(TSRMLS_C); \ ++ int output_start_lineno = php_output_get_start_lineno(TSRMLS_C) ++#endif ++#define HTTP_CHECK_HEADERS_SENT(action) \ ++ if (SG(headers_sent) && !SG(request_info).no_headers) { \ ++ HTTP_GET_OUTPUT_START(); \ ++ if (output_start_filename) { \ ++ http_error_ex(HE_WARNING, HTTP_E_HEADER, "Cannot modify header information - headers already sent by (output started at %s:%d)", \ ++ output_start_filename, output_start_lineno); \ ++ } else { \ ++ http_error(HE_WARNING, HTTP_E_HEADER, "Cannot modify header information - headers already sent"); \ ++ } \ ++ action; \ ++ } ++ ++#define http_log(f, i, m) _http_log_ex((f), (i), (m) TSRMLS_CC) ++extern void _http_log_ex(char *file, const char *ident, const char *message TSRMLS_DC); ++ ++#define http_exit(s, h) http_exit_ex((s), (h), NULL, 1) ++#define http_exit_ex(s, h, b, e) _http_exit_ex((s), (h), (b), (e) TSRMLS_CC) ++extern STATUS _http_exit_ex(int status, char *header, char *body, zend_bool send_header TSRMLS_DC); ++ ++#define http_check_method(m) http_check_method_ex((m), HTTP_KNOWN_METHODS) ++#define http_check_method_ex(m, a) _http_check_method_ex((m), (a)) ++extern STATUS _http_check_method_ex(const char *method, const char *methods); ++ ++#define http_got_server_var(v) (NULL != http_get_server_var_ex((v), strlen(v), 1)) ++#define http_get_server_var(v, c) http_get_server_var_ex((v), strlen(v), (c)) ++#define http_get_server_var_ex(v, l, c) _http_get_server_var_ex((v), (l), (c) TSRMLS_CC) ++PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_len, zend_bool check TSRMLS_DC); ++ ++#define http_get_request_body(b, l) _http_get_request_body_ex((b), (l), 1 TSRMLS_CC) ++#define http_get_request_body_ex(b, l, d) _http_get_request_body_ex((b), (l), (d) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_get_request_body_ex(char **body, size_t *length, zend_bool dup TSRMLS_DC); ++ ++#define http_get_request_body_stream() _http_get_request_body_stream(TSRMLS_C) ++PHP_HTTP_API php_stream *_http_get_request_body_stream(TSRMLS_D); ++ ++ ++typedef void (*http_parse_params_callback)(void *cb_arg, const char *key, int keylen, const char *val, int vallen TSRMLS_DC); ++ ++#define http_parse_params_default_callback _http_parse_params_default_callback ++PHP_HTTP_API void _http_parse_params_default_callback(void *ht, const char *key, int keylen, const char *val, int vallen TSRMLS_DC); ++ ++#define http_parse_params(s, f, ht) _http_parse_params_ex((s), (f), _http_parse_params_default_callback, (ht) TSRMLS_CC) ++#define http_parse_params_ex(s, f, cb, a) _http_parse_params_ex((s), (f), (cb), (a) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_parse_params_ex(const char *params, int flags, http_parse_params_callback cb, void *cb_arg TSRMLS_DC); ++ ++ ++#define http_sleep(s) _http_sleep(s) ++static inline void _http_sleep(double s) ++{ ++#define HTTP_DIFFSEC (0.001) ++#define HTTP_MLLISEC (1000) ++#define HTTP_MCROSEC (1000 * 1000) ++#define HTTP_NANOSEC (1000 * 1000 * 1000) ++#define HTTP_MSEC(s) ((long)(s * HTTP_MLLISEC)) ++#define HTTP_USEC(s) ((long)(s * HTTP_MCROSEC)) ++#define HTTP_NSEC(s) ((long)(s * HTTP_NANOSEC)) ++ ++#if defined(PHP_WIN32) ++ Sleep((DWORD) HTTP_MSEC(s)); ++#elif defined(HAVE_USLEEP) ++ usleep(HTTP_USEC(s)); ++#elif defined(HAVE_NANOSLEEP) ++ struct timespec req, rem; ++ ++ req.tv_sec = (time_t) s; ++ req.tv_nsec = HTTP_NSEC(s) % HTTP_NANOSEC; ++ ++ while (nanosleep(&req, &rem) && (errno == EINTR) && (HTTP_NSEC(rem.tv_sec) + rem.tv_nsec) > HTTP_NSEC(HTTP_DIFFSEC))) { ++ req.tv_sec = rem.tv_sec; ++ req.tv_nsec = rem.tv_nsec; ++ } ++#else ++ struct timeval timeout; ++ ++ timeout.tv.sec = (time_t) s; ++ timeout.tv_usec = HTTP_USEC(s) % HTTP_MCROSEC; ++ ++ select(0, NULL, NULL, NULL, &timeout); ++#endif ++} ++ ++#define http_locate_str _http_locate_str ++static inline const char *_http_locate_str(const char *h, size_t h_len, const char *n, size_t n_len) ++{ ++ const char *p, *e; ++ ++ if (n_len && h_len) { ++ e = h + h_len; ++ do { ++ if (*h == *n) { ++ for (p = n; *p == h[p-n]; ++p) { ++ if (p == n+n_len-1) { ++ return h; ++ } ++ } ++ } ++ } while (h++ != e); ++ } ++ ++ return NULL; ++} ++ ++#define http_locate_body _http_locate_body ++static inline const char *_http_locate_body(const char *message) ++{ ++ const char *body = NULL, *msg = message; ++ ++ while (*msg) { ++ if (*msg == '\n') { ++ if (*(msg+1) == '\n') { ++ body = msg + 2; ++ break; ++ } else if (*(msg+1) == '\r' && *(msg+2) == '\n') { ++ body = msg + 3; ++ break; ++ } ++ } ++ ++msg; ++ } ++ return body; ++} ++ ++#define http_locate_eol _http_locate_eol ++static inline const char *_http_locate_eol(const char *line, int *eol_len) ++{ ++ const char *eol = strpbrk(line, "\r\n"); ++ ++ if (eol_len) { ++ *eol_len = eol ? ((eol[0] == '\r' && eol[1] == '\n') ? 2 : 1) : 0; ++ } ++ return eol; ++} ++ ++#define http_zset(t, z) _http_zset((t), (z)) ++static inline zval *_http_zset(int type, zval *z) ++{ ++ if (Z_TYPE_P(z) != type) { ++ switch (type) { ++ case IS_NULL: convert_to_null(z); break; ++ case IS_BOOL: convert_to_boolean(z); break; ++ case IS_LONG: convert_to_long(z); break; ++ case IS_DOUBLE: convert_to_double(z); break; ++ case IS_STRING: convert_to_string(z); break; ++ case IS_ARRAY: convert_to_array(z); break; ++ case IS_OBJECT: convert_to_object(z); break; ++ } ++ } ++ return z; ++} ++#define http_zsep(t, z) _http_zsep_ex((t), (z), NULL) ++#define http_zsep_ex(t, z, p) _http_zsep_ex((t), (z), (p)) ++static inline zval *_http_zsep_ex(int type, zval *z, zval **p) { ++ ZVAL_ADDREF(z); ++ if (Z_TYPE_P(z) != type) { ++ switch (type) { ++ case IS_NULL: convert_to_null_ex(&z); break; ++ case IS_BOOL: convert_to_boolean_ex(&z); break; ++ case IS_LONG: convert_to_long_ex(&z); break; ++ case IS_DOUBLE: convert_to_double_ex(&z); break; ++ case IS_STRING: convert_to_string_ex(&z); break; ++ case IS_ARRAY: convert_to_array_ex(&z); break; ++ case IS_OBJECT: convert_to_object_ex(&z); break; ++ } ++ } else { ++ SEPARATE_ZVAL_IF_NOT_REF(&z); ++ } ++ if (p) { ++ *p = z; ++ } ++ return z; ++} ++ ++typedef struct _HashKey { ++ char *str; ++ uint len; ++ ulong num; ++ uint dup:1; ++ uint type:31; ++} HashKey; ++#define initHashKey(dup) {NULL, 0, 0, (dup), 0} ++ ++#define FOREACH_VAL(pos, array, val) FOREACH_HASH_VAL(pos, Z_ARRVAL_P(array), val) ++#define FOREACH_HASH_VAL(pos, hash, val) \ ++ for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \ ++ zend_hash_get_current_data_ex(hash, (void *) &val, &pos) == SUCCESS; \ ++ zend_hash_move_forward_ex(hash, &pos)) ++ ++#define FOREACH_KEY(pos, array, key) FOREACH_HASH_KEY(pos, Z_ARRVAL_P(array), key) ++#define FOREACH_HASH_KEY(pos, hash, _key) \ ++ for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \ ++ ((_key).type = zend_hash_get_current_key_ex(hash, &(_key).str, &(_key).len, &(_key).num, (zend_bool) (_key).dup, &pos)) != HASH_KEY_NON_EXISTANT; \ ++ zend_hash_move_forward_ex(hash, &pos)) \ ++ ++#define FOREACH_KEYVAL(pos, array, key, val) FOREACH_HASH_KEYVAL(pos, Z_ARRVAL_P(array), key, val) ++#define FOREACH_HASH_KEYVAL(pos, hash, _key, val) \ ++ for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \ ++ ((_key).type = zend_hash_get_current_key_ex(hash, &(_key).str, &(_key).len, &(_key).num, (zend_bool) (_key).dup, &pos)) != HASH_KEY_NON_EXISTANT && \ ++ zend_hash_get_current_data_ex(hash, (void *) &val, &pos) == SUCCESS; \ ++ zend_hash_move_forward_ex(hash, &pos)) ++ ++#define array_copy(src, dst) zend_hash_copy(dst, src, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)) ++#define ARRAY_JOIN_STRONLY 1 ++#define ARRAY_JOIN_PRETTIFY 2 ++#define array_join(src, dst, append, flags) zend_hash_apply_with_arguments(src HTTP_ZAPI_HASH_TSRMLS_CC, (append)?apply_array_append_func:apply_array_merge_func, 2, dst, (int)flags) ++ ++extern int apply_array_append_func(void *pDest HTTP_ZAPI_HASH_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key); ++extern int apply_array_merge_func(void *pDest HTTP_ZAPI_HASH_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_cache_api.h +@@ -0,0 +1,162 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_cache_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_CACHE_API_H ++#define PHP_HTTP_CACHE_API_H ++ ++#include "php_http_send_api.h" ++ ++#include "ext/standard/crc32.h" ++#include "ext/standard/sha1.h" ++#include "ext/standard/md5.h" ++ ++#ifdef HTTP_HAVE_HASH ++# include "php_hash.h" ++#endif ++ ++#define http_etag_digest(d, l) _http_etag_digest((d), (l)) ++static inline char *_http_etag_digest(const unsigned char *digest, int len) ++{ ++ static const char hexdigits[17] = "0123456789abcdef"; ++ int i; ++ char *hex = emalloc(len * 2 + 1); ++ char *ptr = hex; ++ ++ for (i = 0; i < len; ++i) { ++ *ptr++ = hexdigits[digest[i] >> 4]; ++ *ptr++ = hexdigits[digest[i] & 0xF]; ++ } ++ *ptr = '\0'; ++ ++ return hex; ++} ++ ++#define http_etag_init() _http_etag_init(TSRMLS_C) ++static inline void *_http_etag_init(TSRMLS_D) ++{ ++ void *ctx = NULL; ++ char *mode = HTTP_G->etag.mode; ++ ++#ifdef HTTP_HAVE_HASH ++ const php_hash_ops *eho = NULL; ++ ++ if (mode && (eho = php_hash_fetch_ops(mode, strlen(mode)))) { ++ ctx = emalloc(eho->context_size); ++ eho->hash_init(ctx); ++ } else ++#endif ++ if (mode && ((!strcasecmp(mode, "crc32")) || (!strcasecmp(mode, "crc32b")))) { ++ ctx = emalloc(sizeof(uint)); ++ *((uint *) ctx) = ~0; ++ } else if (mode && !strcasecmp(mode, "sha1")) { ++ PHP_SHA1Init(ctx = emalloc(sizeof(PHP_SHA1_CTX))); ++ } else { ++ PHP_MD5Init(ctx = emalloc(sizeof(PHP_MD5_CTX))); ++ } ++ ++ return ctx; ++} ++ ++#define http_etag_finish(c) _http_etag_finish((c) TSRMLS_CC) ++static inline char *_http_etag_finish(void *ctx TSRMLS_DC) ++{ ++ unsigned char digest[128] = {0}; ++ char *etag = NULL, *mode = HTTP_G->etag.mode; ++ ++#ifdef HTTP_HAVE_HASH ++ const php_hash_ops *eho = NULL; ++ ++ if (mode && (eho = php_hash_fetch_ops(mode, strlen(mode)))) { ++ eho->hash_final(digest, ctx); ++ etag = http_etag_digest(digest, eho->digest_size); ++ } else ++#endif ++ if (mode && ((!strcasecmp(mode, "crc32")) || (!strcasecmp(mode, "crc32b")))) { ++ *((uint *) ctx) = ~*((uint *) ctx); ++ etag = http_etag_digest((const unsigned char *) ctx, sizeof(uint)); ++ } else if (mode && (!strcasecmp(mode, "sha1"))) { ++ PHP_SHA1Final(digest, ctx); ++ etag = http_etag_digest(digest, 20); ++ } else { ++ PHP_MD5Final(digest, ctx); ++ etag = http_etag_digest(digest, 16); ++ } ++ efree(ctx); ++ ++ return etag; ++} ++ ++#define http_etag_update(c, d, l) _http_etag_update((c), (d), (l) TSRMLS_CC) ++static inline void _http_etag_update(void *ctx, const char *data_ptr, size_t data_len TSRMLS_DC) ++{ ++ char *mode = HTTP_G->etag.mode; ++#ifdef HTTP_HAVE_HASH ++ const php_hash_ops *eho = NULL; ++ ++ if (mode && (eho = php_hash_fetch_ops(mode, strlen(mode)))) { ++ eho->hash_update(ctx, (const unsigned char *) data_ptr, data_len); ++ } else ++#endif ++ if (mode && ((!strcasecmp(mode, "crc32")) || (!strcasecmp(mode, "crc32b")))) { ++ uint i, c = *((uint *) ctx); ++ for (i = 0; i < data_len; ++i) { ++ CRC32(c, data_ptr[i]); ++ } ++ *((uint *)ctx) = c; ++ } else if (mode && (!strcasecmp(mode, "sha1"))) { ++ PHP_SHA1Update(ctx, (const unsigned char *) data_ptr, data_len); ++ } else { ++ PHP_MD5Update(ctx, (const unsigned char *) data_ptr, data_len); ++ } ++} ++ ++#define http_ob_etaghandler(o, l, ho, hl, m) _http_ob_etaghandler((o), (l), (ho), (hl), (m) TSRMLS_CC) ++extern void _http_ob_etaghandler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC); ++ ++#define http_etag(p, l, m) _http_etag((p), (l), (m) TSRMLS_CC) ++PHP_HTTP_API char *_http_etag(const void *data_ptr, size_t data_len, http_send_mode data_mode TSRMLS_DC); ++ ++#define http_last_modified(p, m) _http_last_modified((p), (m) TSRMLS_CC) ++PHP_HTTP_API time_t _http_last_modified(const void *data_ptr, http_send_mode data_mode TSRMLS_DC); ++ ++#define http_match_last_modified(entry, modified) _http_match_last_modified_ex((entry), (modified), 1 TSRMLS_CC) ++#define http_match_last_modified_ex(entry, modified, ep) _http_match_last_modified_ex((entry), (modified), (ep) TSRMLS_CC) ++PHP_HTTP_API zend_bool _http_match_last_modified_ex(const char *entry, time_t t, zend_bool enforce_presence TSRMLS_DC); ++ ++#define http_match_etag(entry, etag) _http_match_etag_ex((entry), (etag), 1 TSRMLS_CC) ++#define http_match_etag_ex(entry, etag, ep) _http_match_etag_ex((entry), (etag), (ep) TSRMLS_CC) ++PHP_HTTP_API zend_bool _http_match_etag_ex(const char *entry, const char *etag, zend_bool enforce_presence TSRMLS_DC); ++ ++#define http_cache_last_modified(l, s, cc, ccl) _http_cache_last_modified((l), (s), (cc), (ccl) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_cache_last_modified(time_t last_modified, time_t send_modified, const char *cache_control, size_t cc_len TSRMLS_DC); ++ ++#define http_cache_etag(e, el, cc, ccl) _http_cache_etag((e), (el), (cc), (ccl) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_cache_etag(const char *etag, size_t etag_len, const char *cache_control, size_t cc_len TSRMLS_DC); ++ ++#define http_start_ob_etaghandler() _http_start_ob_etaghandler(TSRMLS_C) ++PHP_HTTP_API STATUS _http_start_ob_etaghandler(TSRMLS_D); ++#define http_interrupt_ob_etaghandler() _http_interrupt_ob_etaghandler(TSRMLS_C) ++PHP_HTTP_API zend_bool _http_interrupt_ob_etaghandler(TSRMLS_D); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_cookie_api.h +@@ -0,0 +1,86 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_cookie_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_COOKIE_API_H ++#define PHP_HTTP_COOKIE_API_H ++ ++#define HTTP_COOKIE_SECURE 0x10L ++#define HTTP_COOKIE_HTTPONLY 0x20L ++ ++#define HTTP_COOKIE_PARSE_RAW 0x01L ++ ++extern PHP_MINIT_FUNCTION(http_cookie); ++ ++/* ++ generally a netscape cookie compliant struct, recognizing httpOnly attribute, too; ++ cookie params like those from rfc2109 and rfc2965 are just put into extras, if ++ one specifies them in allowed extras, else they're treated like cookies themself ++*/ ++typedef struct _http_cookie_list_t { ++ HashTable cookies; ++ HashTable extras; ++ long flags; ++ char *path; ++ char *domain; ++ time_t expires; ++} http_cookie_list; ++ ++#define http_cookie_list_new() _http_cookie_list_init(NULL ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++#define http_cookie_list_init(l) _http_cookie_list_init((l) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API http_cookie_list *_http_cookie_list_init(http_cookie_list *list ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++ ++#define http_cookie_list_dtor(l) _http_cookie_list_dtor((l) TSRMLS_CC) ++PHP_HTTP_API void _http_cookie_list_dtor(http_cookie_list *list TSRMLS_DC); ++ ++#define http_cookie_list_free(l) _http_cookie_list_free((l) TSRMLS_CC) ++PHP_HTTP_API void _http_cookie_list_free(http_cookie_list **list TSRMLS_DC); ++ ++#define http_cookie_list_has_cookie(list, name, name_len) zend_hash_exists(&(list)->cookies, (name), (name_len)+1) ++#define http_cookie_list_has_extra(list, name, name_len) zend_hash_exists(&(list)->extras, (name), (name_len)+1) ++ ++#define http_cookie_list_add_cookie(l, n, nl, v, vl) _http_cookie_list_add_cookie((l), (n), (nl), (v), (vl) TSRMLS_CC) ++PHP_HTTP_API void _http_cookie_list_add_cookie(http_cookie_list *list, const char *name, size_t name_len, const char *value, size_t value_len TSRMLS_DC); ++ ++#define http_cookie_list_add_extra(l, n , nl, v, vl) _http_cookie_list_add_extra((l), (n), (nl), (v), (vl) TSRMLS_CC) ++PHP_HTTP_API void _http_cookie_list_add_extra(http_cookie_list *list, const char *name, size_t name_len, const char *value, size_t value_len TSRMLS_DC); ++ ++#define http_cookie_list_get_cookie(l, n, nl) _http_cookie_list_get_cookie((l), (n), (nl) TSRMLS_CC) ++PHP_HTTP_API const char *_http_cookie_list_get_cookie(http_cookie_list *list, const char *name, size_t name_len TSRMLS_DC); ++ ++#define http_cookie_list_get_extra(l, n, nl) _http_cookie_list_get_extra((l), (n), (nl) TSRMLS_CC) ++PHP_HTTP_API const char *_http_cookie_list_get_extra(http_cookie_list *list, const char *name, size_t name_len TSRMLS_DC); ++ ++#define http_parse_cookie(s) _http_parse_cookie_ex(NULL, (s), 0, NULL TSRMLS_CC) ++#define http_parse_cookie_ex(l, s, f, a) _http_parse_cookie_ex((l), (s), (f), (a) TSRMLS_CC) ++PHP_HTTP_API http_cookie_list *_http_parse_cookie_ex(http_cookie_list * list, const char *string, long flags, char **allowed_extras TSRMLS_DC); ++ ++#define http_cookie_list_tostruct(l, s) _http_cookie_list_tostruct((l), (s) TSRMLS_CC) ++PHP_HTTP_API void _http_cookie_list_tostruct(http_cookie_list *list, zval *strct TSRMLS_DC); ++ ++#define http_cookie_list_fromstruct(l, s) _http_cookie_list_fromstruct((l), (s) TSRMLS_CC) ++PHP_HTTP_API http_cookie_list *_http_cookie_list_fromstruct(http_cookie_list *list, zval *strct TSRMLS_DC); ++ ++#define http_cookie_list_tostring(l, str, len) _http_cookie_list_tostring((l), (str), (len) TSRMLS_CC) ++PHP_HTTP_API void _http_cookie_list_tostring(http_cookie_list *list, char **str, size_t *len TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/php_http_date_api.h +@@ -0,0 +1,35 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_date_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_DATE_API_H ++#define PHP_HTTP_DATE_API_H ++ ++#define http_date(t) _http_date((t) TSRMLS_CC) ++PHP_HTTP_API char *_http_date(time_t t TSRMLS_DC); ++ ++#define http_parse_date(d) _http_parse_date_ex((d), 0 TSRMLS_CC) ++#define http_parse_date_ex(d, s) _http_parse_date_ex((d), (s) TSRMLS_CC) ++PHP_HTTP_API time_t _http_parse_date_ex(const char *date, zend_bool silent TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_deflatestream_object.h +@@ -0,0 +1,57 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_deflatestream_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_DEFLATESTREAM_OBJECT_H ++#define PHP_HTTP_DEFLATESTREAM_OBJECT_H ++#ifdef HTTP_HAVE_ZLIB ++#ifdef ZEND_ENGINE_2 ++ ++typedef struct _http_deflatestream_object_t { ++ zend_object zo; ++ http_encoding_stream *stream; ++} http_deflatestream_object; ++ ++extern zend_class_entry *http_deflatestream_object_ce; ++extern zend_function_entry http_deflatestream_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_deflatestream_object); ++ ++#define http_deflatestream_object_new(ce) _http_deflatestream_object_new((ce) TSRMLS_CC) ++extern zend_object_value _http_deflatestream_object_new(zend_class_entry *ce TSRMLS_DC); ++#define http_deflatestream_object_new_ex(ce, s, ptr) _http_deflatestream_object_new_ex((ce), (s), (ptr) TSRMLS_CC) ++extern zend_object_value _http_deflatestream_object_new_ex(zend_class_entry *ce, http_encoding_stream *s, http_deflatestream_object **ptr TSRMLS_DC); ++#define http_deflatestream_object_clone(zobj) _http_deflatestream_object_clone_obj(zobj TSRMLS_CC) ++extern zend_object_value _http_deflatestream_object_clone_obj(zval *object TSRMLS_DC); ++#define http_deflatestream_object_free(o) _http_deflatestream_object_free((o) TSRMLS_CC) ++extern void _http_deflatestream_object_free(zend_object *object TSRMLS_DC); ++ ++PHP_METHOD(HttpDeflateStream, __construct); ++PHP_METHOD(HttpDeflateStream, factory); ++PHP_METHOD(HttpDeflateStream, update); ++PHP_METHOD(HttpDeflateStream, flush); ++PHP_METHOD(HttpDeflateStream, finish); ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_encoding_api.h +@@ -0,0 +1,192 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_encoding_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_ENCODING_API_H ++#define PHP_HTTP_ENCODING_API_H ++ ++#define http_encoding_dechunk(e, el, d, dl) _http_encoding_dechunk((e), (el), (d), (dl) TSRMLS_CC) ++PHP_HTTP_API const char *_http_encoding_dechunk(const char *encoded, size_t encoded_len, char **decoded, size_t *decoded_len TSRMLS_DC); ++ ++#define http_encoding_response_start(cl, i) _http_encoding_response_start((cl), (i) TSRMLS_CC) ++PHP_HTTP_API int _http_encoding_response_start(size_t content_length, zend_bool ignore_http_ohandler TSRMLS_DC); ++ ++#ifdef HTTP_HAVE_ZLIB ++ ++extern PHP_MINIT_FUNCTION(http_encoding); ++extern PHP_RINIT_FUNCTION(http_encoding); ++extern PHP_RSHUTDOWN_FUNCTION(http_encoding); ++ ++typedef enum _http_encoding_type_t { ++ HTTP_ENCODING_NONE, ++ HTTP_ENCODING_GZIP, ++ HTTP_ENCODING_DEFLATE, ++} http_encoding_type; ++ ++#define HTTP_INFLATE_ROUNDS 100 ++ ++#define HTTP_DEFLATE_BUFFER_SIZE_GUESS(S) \ ++ (((size_t) ((double) S * (double) 1.015)) + 10 + 8 + 4 + 1) ++#define HTTP_INFLATE_BUFFER_SIZE_GUESS(S) \ ++ (((S) + 1) << 3) ++#define HTTP_INFLATE_BUFFER_SIZE_ALIGN(S) \ ++ ((S) += (S) >> (3)) ++ ++#define HTTP_DEFLATE_BUFFER_SIZE 0x8000 ++#define HTTP_INFLATE_BUFFER_SIZE 0x1000 ++ ++#define HTTP_DEFLATE_LEVEL_DEF 0x00000000 ++#define HTTP_DEFLATE_LEVEL_MIN 0x00000001 ++#define HTTP_DEFLATE_LEVEL_MAX 0x00000009 ++#define HTTP_DEFLATE_TYPE_ZLIB 0x00000000 ++#define HTTP_DEFLATE_TYPE_GZIP 0x00000010 ++#define HTTP_DEFLATE_TYPE_RAW 0x00000020 ++#define HTTP_DEFLATE_STRATEGY_DEF 0x00000000 ++#define HTTP_DEFLATE_STRATEGY_FILT 0x00000100 ++#define HTTP_DEFLATE_STRATEGY_HUFF 0x00000200 ++#define HTTP_DEFLATE_STRATEGY_RLE 0x00000300 ++#define HTTP_DEFLATE_STRATEGY_FIXED 0x00000400 ++ ++#define HTTP_DEFLATE_LEVEL_SET(flags, level) \ ++ switch (flags & 0xf) \ ++ { \ ++ default: \ ++ if ((flags & 0xf) < 10) { \ ++ level = flags & 0xf; \ ++ break; \ ++ } \ ++ case HTTP_DEFLATE_LEVEL_DEF: \ ++ level = Z_DEFAULT_COMPRESSION; \ ++ break; \ ++ } ++ ++#define HTTP_DEFLATE_WBITS_SET(flags, wbits) \ ++ switch (flags & 0xf0) \ ++ { \ ++ case HTTP_DEFLATE_TYPE_GZIP: \ ++ wbits = HTTP_WINDOW_BITS_GZIP; \ ++ break; \ ++ case HTTP_DEFLATE_TYPE_RAW: \ ++ wbits = HTTP_WINDOW_BITS_RAW; \ ++ break; \ ++ default: \ ++ wbits = HTTP_WINDOW_BITS_ZLIB; \ ++ break; \ ++ } ++ ++#define HTTP_INFLATE_WBITS_SET(flags, wbits) \ ++ if (flags & HTTP_INFLATE_TYPE_RAW) { \ ++ wbits = HTTP_WINDOW_BITS_RAW; \ ++} else { \ ++ wbits = HTTP_WINDOW_BITS_ANY; \ ++} ++ ++#define HTTP_DEFLATE_STRATEGY_SET(flags, strategy) \ ++ switch (flags & 0xf00) \ ++ { \ ++ case HTTP_DEFLATE_STRATEGY_FILT: \ ++ strategy = Z_FILTERED; \ ++ break; \ ++ case HTTP_DEFLATE_STRATEGY_HUFF: \ ++ strategy = Z_HUFFMAN_ONLY; \ ++ break; \ ++ case HTTP_DEFLATE_STRATEGY_RLE: \ ++ strategy = Z_RLE; \ ++ break; \ ++ case HTTP_DEFLATE_STRATEGY_FIXED: \ ++ strategy = Z_FIXED; \ ++ break; \ ++ default: \ ++ strategy = Z_DEFAULT_STRATEGY; \ ++ break; \ ++ } ++ ++#define HTTP_WINDOW_BITS_ZLIB 0x0000000f ++#define HTTP_WINDOW_BITS_GZIP 0x0000001f ++#define HTTP_WINDOW_BITS_ANY 0x0000002f ++#define HTTP_WINDOW_BITS_RAW -0x000000f ++ ++#ifndef Z_FIXED ++/* Z_FIXED does not exist prior 1.2.2.2 */ ++# define Z_FIXED 0 ++#endif ++ ++#define HTTP_INFLATE_TYPE_ZLIB 0x00000000 ++#define HTTP_INFLATE_TYPE_GZIP 0x00000000 ++#define HTTP_INFLATE_TYPE_RAW 0x00000001 ++ ++#define HTTP_ENCODING_STREAM_FLUSH_NONE 0x00000000 ++#define HTTP_ENCODING_STREAM_FLUSH_SYNC 0x00100000 ++#define HTTP_ENCODING_STREAM_FLUSH_FULL 0x00200000 ++ ++#define HTTP_ENCODING_STREAM_FLUSH_FLAG(f) \ ++ (((f) & HTTP_ENCODING_STREAM_FLUSH_FULL) ? Z_FULL_FLUSH : \ ++ (((f) & HTTP_ENCODING_STREAM_FLUSH_SYNC) ? Z_SYNC_FLUSH : Z_NO_FLUSH)) ++ ++#define HTTP_ENCODING_STREAM_PERSISTENT 0x01000000 ++ ++typedef struct _http_encoding_stream_t { ++ z_stream stream; ++ int flags; ++ void *storage; ++} http_encoding_stream; ++ ++#define http_encoding_deflate(f, d, dl, r, rl) _http_encoding_deflate((f), (d), (dl), (r), (rl) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_deflate(int flags, const char *data, size_t data_len, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_inflate(d, dl, r, rl) _http_encoding_inflate((d), (dl), (r), (rl) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_inflate(const char *data, size_t data_len, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++ ++#define http_encoding_deflate_stream_init(s, f) _http_encoding_deflate_stream_init((s), (f) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API http_encoding_stream *_http_encoding_deflate_stream_init(http_encoding_stream *s, int flags ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_deflate_stream_update(s, d, dl, e, el) _http_encoding_deflate_stream_update((s), (d), (dl), (e), (el) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_deflate_stream_update(http_encoding_stream *s, const char *data, size_t data_len, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_deflate_stream_flush(s, e, el) _http_encoding_deflate_stream_flush((s), (e), (el) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_deflate_stream_flush(http_encoding_stream *s, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_deflate_stream_finish(s, e, el) _http_encoding_deflate_stream_finish((s), (e), (el) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_deflate_stream_finish(http_encoding_stream *s, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_deflate_stream_dtor(s) _http_encoding_deflate_stream_dtor((s) TSRMLS_CC) ++PHP_HTTP_API void _http_encoding_deflate_stream_dtor(http_encoding_stream *s TSRMLS_DC); ++#define http_encoding_deflate_stream_free(s) _http_encoding_deflate_stream_free((s) TSRMLS_CC) ++PHP_HTTP_API void _http_encoding_deflate_stream_free(http_encoding_stream **s TSRMLS_DC); ++ ++#define http_encoding_inflate_stream_init(s, f) _http_encoding_inflate_stream_init((s), (f) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API http_encoding_stream *_http_encoding_inflate_stream_init(http_encoding_stream *s, int flags ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_inflate_stream_update(s, d, dl, e, el) _http_encoding_inflate_stream_update((s), (d), (dl), (e), (el) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_inflate_stream_update(http_encoding_stream *s, const char *data, size_t data_len, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_inflate_stream_flush(s, d, dl) _http_encoding_inflate_stream_flush((s), (d), (dl) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_inflate_stream_flush(http_encoding_stream *s, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_inflate_stream_finish(s, e, el) _http_encoding_inflate_stream_finish((s), (e), (el) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_inflate_stream_finish(http_encoding_stream *s, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_inflate_stream_dtor(s) _http_encoding_inflate_stream_dtor((s) TSRMLS_CC) ++PHP_HTTP_API void _http_encoding_inflate_stream_dtor(http_encoding_stream *s TSRMLS_DC); ++#define http_encoding_inflate_stream_free(s) _http_encoding_inflate_stream_free((s) TSRMLS_CC) ++PHP_HTTP_API void _http_encoding_inflate_stream_free(http_encoding_stream **s TSRMLS_DC); ++ ++#define http_ob_deflatehandler(o, ol, h, hl, m) _http_ob_deflatehandler((o), (ol), (h), (hl), (m) TSRMLS_CC) ++extern void _http_ob_deflatehandler(char *, uint, char **, uint *, int TSRMLS_DC); ++ ++#define http_ob_inflatehandler(o, ol, h, hl, m) _http_ob_inflatehandler((o), (ol), (h), (hl), (m) TSRMLS_CC) ++extern void _http_ob_inflatehandler(char *, uint, char **, uint *, int TSRMLS_DC); ++ ++#endif /* HTTP_HAVE_ZLIB */ ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/php_http_exception_object.h +@@ -0,0 +1,60 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_exception_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_EXCEPTION_OBJECT_H ++#define PHP_HTTP_EXCEPTION_OBJECT_H ++#ifdef ZEND_ENGINE_2 ++ ++#include "zend_exceptions.h" ++ ++PHP_MINIT_FUNCTION(http_exception_object); ++ ++#define HTTP_EX_DEF_CE http_exception_object_ce ++#define HTTP_EX_CE(name) http_ ##name## _exception_object_ce ++ ++extern zend_class_entry *http_exception_object_ce; ++extern zend_class_entry *HTTP_EX_CE(runtime); ++extern zend_class_entry *HTTP_EX_CE(header); ++extern zend_class_entry *HTTP_EX_CE(malformed_headers); ++extern zend_class_entry *HTTP_EX_CE(request_method); ++extern zend_class_entry *HTTP_EX_CE(message_type); ++extern zend_class_entry *HTTP_EX_CE(invalid_param); ++extern zend_class_entry *HTTP_EX_CE(encoding); ++extern zend_class_entry *HTTP_EX_CE(request); ++extern zend_class_entry *HTTP_EX_CE(request_pool); ++extern zend_class_entry *HTTP_EX_CE(socket); ++extern zend_class_entry *HTTP_EX_CE(response); ++extern zend_class_entry *HTTP_EX_CE(url); ++extern zend_function_entry http_exception_object_fe[]; ++ ++#define http_exception_get_default _http_exception_get_default ++extern zend_class_entry *_http_exception_get_default(); ++ ++#define http_exception_get_for_code(c) _http_exception_get_for_code(c) ++extern zend_class_entry *_http_exception_get_for_code(long code); ++ ++PHP_METHOD(HttpException, __toString); ++ ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_filter_api.h +@@ -0,0 +1,33 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_filter_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_FILTER_API_H ++#define PHP_HTTP_FILTER_API_H ++#ifdef ZEND_ENGINE_2 ++ ++extern php_stream_filter_factory http_filter_factory; ++PHP_MINIT_FUNCTION(http_filter); ++ ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_headers_api.h +@@ -0,0 +1,77 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_headers_api.h 300300 2010-06-09 07:29:35Z mike $ */ ++ ++#ifndef PHP_HTTP_HEADERS_API_H ++#define PHP_HTTP_HEADERS_API_H ++ ++#include "php_http_info_api.h" ++ ++typedef enum http_range_status_t { ++ RANGE_OK, ++ RANGE_NO, ++ RANGE_ERR ++} http_range_status; ++ ++#define http_parse_headers(h, a) _http_parse_headers_ex((h), Z_ARRVAL_P(a), 1, http_info_default_callback, NULL TSRMLS_CC) ++#define http_parse_headers_ex(h, ht, p) _http_parse_headers_ex((h), (ht), (p), http_info_default_callback, NULL TSRMLS_CC) ++#define http_parse_headers_cb(h, ht, p, f, d) _http_parse_headers_ex((h), (ht), (p), (f), (d) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *headers, zend_bool prettify, http_info_callback callback_func, void **callback_data TSRMLS_DC); ++ ++typedef char *(*negotiate_func_t)(const char *test, double *quality, HashTable *supported TSRMLS_DC); ++ ++#define http_negotiate_language_func _http_negotiate_language_func ++extern char *_http_negotiate_language_func(const char *test, double *quality, HashTable *supported TSRMLS_DC); ++#define http_negotiate_content_type_func _http_negotiate_default_func ++#define http_negotiate_encoding_func _http_negotiate_default_func ++#define http_negotiate_charset_func _http_negotiate_default_func ++#define http_negotiate_default_func _http_negotiate_default_func ++extern char *_http_negotiate_default_func(const char *test, double *quality, HashTable *supported TSRMLS_DC); ++ ++#define http_negotiate_language(zsupported) http_negotiate_language_ex(Z_ARRVAL_P(zsupported)) ++#define http_negotiate_language_ex(supported) http_negotiate_q("HTTP_ACCEPT_LANGUAGE", (supported), http_negotiate_language_func) ++#define http_negotiate_charset(zsupported) http_negotiate_charset_ex(Z_ARRVAL_P(zsupported)) ++#define http_negotiate_charset_ex(supported) http_negotiate_q("HTTP_ACCEPT_CHARSET", (supported), http_negotiate_charset_func) ++#define http_negotiate_encoding(zsupported) http_negotiate_encoding_ex(Z_ARRVAL_P(zsupported)) ++#define http_negotiate_encoding_ex(supported) http_negotiate_q("HTTP_ACCEPT_ENCODING", (supported), http_negotiate_encoding_func) ++#define http_negotiate_content_type(zsupported) http_negotiate_content_type_ex(Z_ARRVAL_P(zsupported)) ++#define http_negotiate_content_type_ex(supported) http_negotiate_q("HTTP_ACCEPT", (supported), http_negotiate_content_type_func) ++#define http_negotiate_q(e, s, n) _http_negotiate_q((e), (s), (n) TSRMLS_CC) ++PHP_HTTP_API HashTable *_http_negotiate_q(const char *header, HashTable *supported, negotiate_func_t neg TSRMLS_DC); ++#define http_negotiate_z(z, s, n) _http_negotiate_z((z), (s), (n) TSRMLS_CC) ++PHP_HTTP_API HashTable *_http_negotiate_z(zval *value, HashTable *supported, negotiate_func_t neg TSRMLS_DC); ++ ++#define http_get_request_ranges(r, l) _http_get_request_ranges((r), (l) TSRMLS_CC) ++PHP_HTTP_API http_range_status _http_get_request_ranges(HashTable *ranges, size_t length TSRMLS_DC); ++ ++#define http_get_request_headers(h) _http_get_request_headers((h) TSRMLS_CC) ++PHP_HTTP_API void _http_get_request_headers(HashTable *headers TSRMLS_DC); ++ ++#define http_get_response_headers(h) _http_get_response_headers((h) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_get_response_headers(HashTable *headers_ht TSRMLS_DC); ++ ++#define http_match_request_header(h, v) http_match_request_header_ex((h), (v), 0) ++#define http_match_request_header_ex(h, v, c) _http_match_request_header_ex((h), (v), (c) TSRMLS_CC) ++PHP_HTTP_API zend_bool _http_match_request_header_ex(const char *header, const char *value, zend_bool match_case TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_inflatestream_object.h +@@ -0,0 +1,57 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_inflatestream_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_INFLATESTREAM_OBJECT_H ++#define PHP_HTTP_INFLATESTREAM_OBJECT_H ++#ifdef HTTP_HAVE_ZLIB ++#ifdef ZEND_ENGINE_2 ++ ++typedef struct _http_inflatestream_object_t { ++ zend_object zo; ++ http_encoding_stream *stream; ++} http_inflatestream_object; ++ ++extern zend_class_entry *http_inflatestream_object_ce; ++extern zend_function_entry http_inflatestream_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_inflatestream_object); ++ ++#define http_inflatestream_object_new(ce) _http_inflatestream_object_new((ce) TSRMLS_CC) ++extern zend_object_value _http_inflatestream_object_new(zend_class_entry *ce TSRMLS_DC); ++#define http_inflatestream_object_new_ex(ce, s, ptr) _http_inflatestream_object_new_ex((ce), (s), (ptr) TSRMLS_CC) ++extern zend_object_value _http_inflatestream_object_new_ex(zend_class_entry *ce, http_encoding_stream *s, http_inflatestream_object **ptr TSRMLS_DC); ++#define http_inflatestream_object_clone(zobj) _http_inflatestream_object_clone_obj(zobj TSRMLS_CC) ++extern zend_object_value _http_inflatestream_object_clone_obj(zval *object TSRMLS_DC); ++#define http_inflatestream_object_free(o) _http_inflatestream_object_free((o) TSRMLS_CC) ++extern void _http_inflatestream_object_free(zend_object *object TSRMLS_DC); ++ ++PHP_METHOD(HttpInflateStream, __construct); ++PHP_METHOD(HttpInflateStream, factory); ++PHP_METHOD(HttpInflateStream, update); ++PHP_METHOD(HttpInflateStream, flush); ++PHP_METHOD(HttpInflateStream, finish); ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_info_api.h +@@ -0,0 +1,79 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_info_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_INFO_API_H ++#define PHP_HTTP_INFO_API_H ++ ++#define IS_HTTP_REQUEST 1 ++#define IS_HTTP_RESPONSE 2 ++ ++#define HTTP_INFO(ptr) (ptr)->http.info ++ ++#define HTTP_INFO_REQUEST_FMT_ARGS(_http_ptr, _EOL) "%s %s HTTP/%1.1f" _EOL, \ ++ (_http_ptr)->info.request.method?(_http_ptr)->info.request.method:"UNKNOWN", \ ++ (_http_ptr)->info.request.url?(_http_ptr)->info.request.url:"/", \ ++ (_http_ptr)->version>0.0?(_http_ptr)->version:1.1 ++ ++#define HTTP_INFO_RESPONSE_FMT_ARGS(_http_ptr, _EOL) "HTTP/%1.1f %d%s%s" _EOL, \ ++ (_http_ptr)->version>0.0?(_http_ptr)->version:1.1, \ ++ (_http_ptr)->info.response.code?(_http_ptr)->info.response.code:200, \ ++ (_http_ptr)->info.response.status&&*(_http_ptr)->info.response.status ? " ":"", \ ++ STR_PTR((_http_ptr)->info.response.status) ++ ++typedef struct _http_request_info_t { ++ char *method; ++ char *url; ++} http_request_info; ++ ++typedef struct _http_response_info_t { ++ int code; ++ char *status; ++} http_response_info; ++ ++typedef union _http_info_union_t { ++ http_request_info request; ++ http_response_info response; ++} http_info_union; ++ ++struct http_info { ++ http_info_union info; ++ double version; ++}; ++ ++typedef struct _http_info_t { ++ struct http_info http; ++ int type; ++} http_info; ++ ++typedef void (*http_info_callback)(void **callback_data, HashTable **headers, http_info *info TSRMLS_DC); ++ ++#define http_info_default_callback _http_info_default_callback ++PHP_HTTP_API void _http_info_default_callback(void **nothing, HashTable **headers, http_info *info TSRMLS_DC); ++#define http_info_dtor _http_info_dtor ++PHP_HTTP_API void _http_info_dtor(http_info *info); ++#define http_info_parse(p, i) _http_info_parse_ex((p), (i), 1 TSRMLS_CC) ++#define http_info_parse_ex(p, i, s) _http_info_parse_ex((p), (i), (s) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_info_parse_ex(const char *pre_header, http_info *info , zend_bool silent TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_message_api.h +@@ -0,0 +1,131 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_message_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_MESSAGE_API_H ++#define PHP_HTTP_MESSAGE_API_H ++ ++#include "php_http_info_api.h" ++ ++typedef enum _http_message_type_t { ++ HTTP_MSG_NONE = 0, ++ HTTP_MSG_REQUEST = IS_HTTP_REQUEST, ++ HTTP_MSG_RESPONSE = IS_HTTP_RESPONSE, ++} http_message_type; ++ ++typedef struct _http_message_t http_message; ++ ++struct _http_message_t { ++ phpstr body; ++ HashTable hdrs; ++ http_message_type type; ++ struct http_info http; ++ http_message *parent; ++}; ++ ++/* required minimum length of an HTTP message "HTTP/1.1" */ ++#define HTTP_MSG_MIN_SIZE 8 ++ ++/* shorthand for type checks */ ++#define HTTP_MSG_TYPE(TYPE, msg) ((msg) && ((msg)->type == HTTP_MSG_ ##TYPE)) ++ ++#define http_message_new() http_message_init_ex(NULL, 0) ++#define http_message_init(m) http_message_init_ex((m), 0) ++#define http_message_init_ex(m, t) _http_message_init_ex((m), (t) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) ++#define http_message_init_rel(m, t) _http_message_init_ex((m), (t) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC) ++PHP_HTTP_API http_message *_http_message_init_ex(http_message *m, http_message_type t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); ++#define http_message_init_env(m, t) _http_message_init_env((m), (t) TSRMLS_CC ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) ++PHP_HTTP_API http_message *_http_message_init_env(http_message *m, http_message_type t TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); ++ ++#define http_message_set_type(m, t) _http_message_set_type((m), (t)) ++PHP_HTTP_API void _http_message_set_type(http_message *m, http_message_type t); ++ ++#define http_message_set_info(m, i) _http_message_set_info((m), (i)) ++PHP_HTTP_API void _http_message_set_info(http_message *message, http_info *info); ++ ++#define http_message_header(m, h) _http_message_header_ex((m), (h), sizeof(h), 1) ++#define http_message_header_ex _http_message_header_ex ++static inline zval *_http_message_header_ex(http_message *msg, char *key_str, size_t key_len, int join) ++{ ++ zval **header; ++ if (SUCCESS == zend_hash_find(&msg->hdrs, key_str, key_len, (void *) &header)) { ++ if (join && Z_TYPE_PP(header) == IS_ARRAY) { ++ zval *header_str, **val; ++ HashPosition pos; ++ phpstr str; ++ ++ phpstr_init(&str); ++ MAKE_STD_ZVAL(header_str); ++ FOREACH_VAL(pos, *header, val) { ++ phpstr_appendf(&str, PHPSTR_LEN(&str) ? ", %s":"%s", Z_STRVAL_PP(val)); ++ } ++ phpstr_fix(&str); ++ ZVAL_STRINGL(header_str, PHPSTR_VAL(&str), PHPSTR_LEN(&str), 0); ++ return header_str; ++ } else { ++ ZVAL_ADDREF(*header); ++ return *header; ++ } ++ } ++ return NULL; ++} ++ ++#define http_message_count(c, m) \ ++{ \ ++ http_message *__tmp_msg = (m); \ ++ for (c = 0; __tmp_msg; __tmp_msg = __tmp_msg->parent, ++(c)); \ ++} ++ ++#define http_message_parse(m, l) http_message_parse_ex(NULL, (m), (l)) ++#define http_message_parse_ex(h, m, l) _http_message_parse_ex((h), (m), (l) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++#define http_message_parse_rel(h, m, l) _http_message_parse_ex((h), (m), (l) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC TSRMLS_CC) ++PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char *message, size_t length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++ ++#define http_message_tostring(m, s, l) _http_message_tostring((m), (s), (l)) ++PHP_HTTP_API void _http_message_tostring(http_message *msg, char **string, size_t *length); ++ ++#define http_message_serialize(m, s, l) _http_message_serialize((m), (s), (l)) ++PHP_HTTP_API void _http_message_serialize(http_message *message, char **string, size_t *length); ++ ++#define http_message_reverse(m) _http_message_reverse(m) ++PHP_HTTP_API http_message *_http_message_reverse(http_message *msg); ++ ++#define http_message_interconnect(m1, m2) _http_message_interconnect((m1), (m2)) ++PHP_HTTP_API http_message *_http_message_interconnect(http_message *m1, http_message *m2); ++ ++#define http_message_tostruct_recursive(m, s) _http_message_tostruct_recursive((m), (s) TSRMLS_CC) ++PHP_HTTP_API void _http_message_tostruct_recursive(http_message *msg, zval *strct TSRMLS_DC); ++ ++#define http_message_send(m) _http_message_send((m) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_message_send(http_message *message TSRMLS_DC); ++ ++#define http_message_dup(m) _http_message_dup((m) TSRMLS_CC) ++PHP_HTTP_API http_message *_http_message_dup(http_message *msg TSRMLS_DC); ++ ++#define http_message_dtor(m) _http_message_dtor((m)) ++PHP_HTTP_API void _http_message_dtor(http_message *message); ++ ++#define http_message_free(m) _http_message_free((m)) ++PHP_HTTP_API void _http_message_free(http_message **message); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_message_object.h +@@ -0,0 +1,115 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_message_object.h 298590 2010-04-26 11:46:35Z mike $ */ ++ ++#ifndef PHP_HTTP_MESSAGE_OBJECT_H ++#define PHP_HTTP_MESSAGE_OBJECT_H ++#ifdef ZEND_ENGINE_2 ++ ++typedef struct _http_message_object_t { ++ zend_object zo; ++ http_message *message; ++ zend_object_value parent; ++ zval *iterator; ++} http_message_object; ++ ++extern zend_class_entry *http_message_object_ce; ++extern zend_function_entry http_message_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_message_object); ++extern PHP_MSHUTDOWN_FUNCTION(http_message_object); ++ ++#define http_message_object_prepend(o, p) http_message_object_prepend_ex((o), (p), 1) ++#define http_message_object_prepend_ex(o, p, t) _http_message_object_prepend_ex((o), (p), (t) TSRMLS_CC) ++extern void _http_message_object_prepend_ex(zval *this_ptr, zval *prepend, zend_bool top TSRMLS_DC); ++ ++#define http_message_object_reverse(t, r) _http_message_object_reverse((t), (r) TSRMLS_CC) ++extern void _http_message_object_reverse(zval *this_ptr, zval *return_value TSRMLS_DC); ++ ++#define http_message_object_new(ce) _http_message_object_new((ce) TSRMLS_CC) ++extern zend_object_value _http_message_object_new(zend_class_entry *ce TSRMLS_DC); ++#define http_message_object_new_ex(ce, msg, ptr) _http_message_object_new_ex((ce), (msg), (ptr) TSRMLS_CC) ++extern zend_object_value _http_message_object_new_ex(zend_class_entry *ce, http_message *msg, http_message_object **ptr TSRMLS_DC); ++#define http_message_object_clone(zobj) _http_message_object_clone_obj(zobj TSRMLS_CC) ++extern zend_object_value _http_message_object_clone_obj(zval *object TSRMLS_DC); ++#define http_message_object_free(o) _http_message_object_free((o) TSRMLS_CC) ++extern void _http_message_object_free(zend_object *object TSRMLS_DC); ++ ++#define HTTP_MSG_CHECK_OBJ(obj, dofail) \ ++ if (!(obj)->message) { \ ++ http_error(E_WARNING, HTTP_E_MSG, "HttpMessage is empty"); \ ++ dofail; \ ++ } ++#define HTTP_MSG_CHECK_STD() HTTP_MSG_CHECK_OBJ(obj, RETURN_FALSE) ++ ++#define HTTP_MSG_INIT_OBJ(obj) \ ++ if (!(obj)->message) { \ ++ (obj)->message = http_message_new(); \ ++ } ++#define HTTP_MSG_INIT_STD() HTTP_MSG_INIT_OBJ(obj) ++ ++PHP_METHOD(HttpMessage, __construct); ++PHP_METHOD(HttpMessage, getBody); ++PHP_METHOD(HttpMessage, setBody); ++PHP_METHOD(HttpMessage, getHeader); ++PHP_METHOD(HttpMessage, getHeaders); ++PHP_METHOD(HttpMessage, setHeaders); ++PHP_METHOD(HttpMessage, addHeaders); ++PHP_METHOD(HttpMessage, getType); ++PHP_METHOD(HttpMessage, setType); ++PHP_METHOD(HttpMessage, getInfo); ++PHP_METHOD(HttpMessage, setInfo); ++PHP_METHOD(HttpMessage, getResponseCode); ++PHP_METHOD(HttpMessage, setResponseCode); ++PHP_METHOD(HttpMessage, getResponseStatus); ++PHP_METHOD(HttpMessage, setResponseStatus); ++PHP_METHOD(HttpMessage, getRequestMethod); ++PHP_METHOD(HttpMessage, setRequestMethod); ++PHP_METHOD(HttpMessage, getRequestUrl); ++PHP_METHOD(HttpMessage, setRequestUrl); ++PHP_METHOD(HttpMessage, getHttpVersion); ++PHP_METHOD(HttpMessage, setHttpVersion); ++PHP_METHOD(HttpMessage, guessContentType); ++PHP_METHOD(HttpMessage, getParentMessage); ++PHP_METHOD(HttpMessage, send); ++PHP_METHOD(HttpMessage, toString); ++PHP_METHOD(HttpMessage, toMessageTypeObject); ++ ++PHP_METHOD(HttpMessage, count); ++PHP_METHOD(HttpMessage, serialize); ++PHP_METHOD(HttpMessage, unserialize); ++PHP_METHOD(HttpMessage, rewind); ++PHP_METHOD(HttpMessage, valid); ++PHP_METHOD(HttpMessage, current); ++PHP_METHOD(HttpMessage, key); ++PHP_METHOD(HttpMessage, next); ++ ++PHP_METHOD(HttpMessage, factory); ++PHP_METHOD(HttpMessage, fromEnv); ++ ++PHP_METHOD(HttpMessage, detach); ++PHP_METHOD(HttpMessage, prepend); ++PHP_METHOD(HttpMessage, reverse); ++ ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_persistent_handle_api.h +@@ -0,0 +1,58 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_persistent_handle_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef HTTP_PERSISTENT_HANDLE_H ++#define HTTP_PERSISTENT_HANDLE_H ++ ++typedef void *(*http_persistent_handle_ctor)(void); ++typedef void (*http_persistent_handle_dtor)(void *handle); ++typedef void *(*http_persistent_handle_copy)(void *handle); ++ ++PHP_MINIT_FUNCTION(http_persistent_handle); ++PHP_MSHUTDOWN_FUNCTION(http_persistent_handle); ++ ++#define http_persistent_handle_provide(n, c, d, cc) _http_persistent_handle_provide_ex((n), strlen(n), (c), (d), (cc)) ++#define http_persistent_handle_provide_ex(n, l, c, d, cc) _http_persistent_handle_provide_ex((n), (l), (c), (d), (cc)) ++PHP_HTTP_API STATUS _http_persistent_handle_provide_ex(const char *name_str, size_t name_len, http_persistent_handle_ctor ctor, http_persistent_handle_dtor dtor, http_persistent_handle_copy copy); ++ ++#define http_persistent_handle_cleanup(n, c) _http_persistent_handle_cleanup_ex((n), strlen(n), (c) TSRMLS_CC) ++#define http_persistent_handle_cleanup_ex(n, l,c ) _http_persistent_handle_cleanup_ex((n), (l), (c) TSRMLS_CC) ++PHP_HTTP_API void _http_persistent_handle_cleanup_ex(const char *name_str, size_t name_len, int current_ident_only TSRMLS_DC); ++ ++#define http_persistent_handle_statall() _http_persistent_handle_statall_ex(NULL TSRMLS_CC) ++#define http_persistent_handle_statall_ex(ht) _http_persistent_handle_statall_ex((ht) TSRMLS_CC) ++PHP_HTTP_API HashTable *_http_persistent_handle_statall_ex(HashTable *ht TSRMLS_DC); ++ ++#define http_persistent_handle_acquire(n, h) _http_persistent_handle_acquire_ex((n), strlen(n), (h) TSRMLS_CC) ++#define http_persistent_handle_acquire_ex(n, l, h) _http_persistent_handle_acquire_ex((n), (l), (h) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_persistent_handle_acquire_ex(const char *name_str, size_t name_len, void **handle TSRMLS_DC); ++ ++#define http_persistent_handle_release(n, h) _http_persistent_handle_release_ex((n), strlen(n), (h) TSRMLS_CC) ++#define http_persistent_handle_release_ex(n, l, h) _http_persistent_handle_release_ex((n), (l), (h) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_persistent_handle_release_ex(const char *name_str, size_t name_len, void **handle TSRMLS_DC); ++ ++#define http_persistent_handle_accrete(n, oh, nh) _http_persistent_handle_accrete_ex((n), strlen(n), (oh), (nh) TSRMLS_CC) ++#define http_persistent_handle_accrete_ex(n, l, oh, nh) _http_persistent_handle_accrete_ex((n), (l), (oh), (nh) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_persistent_handle_accrete_ex(const char *name_str, size_t name_len, void *old_handle, void **new_handle TSRMLS_DC); ++ ++#endif /* HTTP_PERSISTENT_HANDLE_H */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/php_http_querystring_api.h +@@ -0,0 +1,38 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_querystring_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_QUERYSTRING_API_H ++#define PHP_HTTP_QUERYSTRING_API_H ++ ++#ifdef HTTP_HAVE_ICONV ++#define http_querystring_xlate(a, p, ie, oe) _http_querystring_xlate((a), (p), (ie), (oe) TSRMLS_CC) ++PHP_HTTP_API int _http_querystring_xlate(zval *array, zval *param, const char *ie, const char *oe TSRMLS_DC); ++#endif ++ ++#define http_querystring_update(qa, qs) _http_querystring_update((qa), (qs) TSRMLS_CC) ++PHP_HTTP_API void _http_querystring_update(zval *qarray, zval *qstring TSRMLS_DC); ++ ++#define http_querystring_modify(q, p) _http_querystring_modify((q), (p) TSRMLS_CC) ++PHP_HTTP_API int _http_querystring_modify(zval *qarray, zval *params TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/php_http_querystring_object.h +@@ -0,0 +1,78 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_querystring_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_QUERYSTRING_OBJECT_H ++#define PHP_HTTP_QUERYSTRING_OBJECT_H ++#ifdef ZEND_ENGINE_2 ++ ++typedef struct _http_querystring_object_t { ++ zend_object zo; ++} http_querystring_object; ++ ++#define HTTP_QUERYSTRING_TYPE_BOOL IS_BOOL ++#define HTTP_QUERYSTRING_TYPE_INT IS_LONG ++#define HTTP_QUERYSTRING_TYPE_FLOAT IS_DOUBLE ++#define HTTP_QUERYSTRING_TYPE_STRING IS_STRING ++#define HTTP_QUERYSTRING_TYPE_ARRAY IS_ARRAY ++#define HTTP_QUERYSTRING_TYPE_OBJECT IS_OBJECT ++ ++extern zend_class_entry *http_querystring_object_ce; ++extern zend_function_entry http_querystring_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_querystring_object); ++ ++#define http_querystring_object_new(ce) _http_querystring_object_new((ce) TSRMLS_CC) ++extern zend_object_value _http_querystring_object_new(zend_class_entry *ce TSRMLS_DC); ++#define http_querystring_object_new_ex(ce, n, ptr) _http_querystring_object_new_ex((ce), (n), (ptr) TSRMLS_CC) ++extern zend_object_value _http_querystring_object_new_ex(zend_class_entry *ce, void *nothing, http_querystring_object **ptr TSRMLS_DC); ++#define http_querystring_object_free(o) _http_querystring_object_free((o) TSRMLS_CC) ++extern void _http_querystring_object_free(zend_object *object TSRMLS_DC); ++ ++PHP_METHOD(HttpQueryString, __construct); ++PHP_METHOD(HttpQueryString, toString); ++PHP_METHOD(HttpQueryString, toArray); ++PHP_METHOD(HttpQueryString, get); ++PHP_METHOD(HttpQueryString, set); ++PHP_METHOD(HttpQueryString, mod); ++PHP_METHOD(HttpQueryString, getBool); ++PHP_METHOD(HttpQueryString, getInt); ++PHP_METHOD(HttpQueryString, getFloat); ++PHP_METHOD(HttpQueryString, getString); ++PHP_METHOD(HttpQueryString, getArray); ++PHP_METHOD(HttpQueryString, getObject); ++#ifdef HTTP_HAVE_ICONV ++PHP_METHOD(HttpQueryString, xlate); ++#endif ++PHP_METHOD(HttpQueryString, factory); ++#ifndef WONKY ++PHP_METHOD(HttpQueryString, singleton); ++#endif ++PHP_METHOD(HttpQueryString, serialize); ++PHP_METHOD(HttpQueryString, unserialize); ++PHP_METHOD(HttpQueryString, offsetGet); ++PHP_METHOD(HttpQueryString, offsetSet); ++PHP_METHOD(HttpQueryString, offsetExists); ++PHP_METHOD(HttpQueryString, offsetUnset); ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_request_api.h +@@ -0,0 +1,144 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_request_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUEST_API_H ++#define PHP_HTTP_REQUEST_API_H ++ ++#ifdef HTTP_HAVE_CURL ++ ++#include "php_http_request_body_api.h" ++#include "php_http_request_method_api.h" ++ ++extern PHP_MINIT_FUNCTION(http_request); ++extern PHP_MSHUTDOWN_FUNCTION(http_request); ++ ++typedef struct _http_request_t { ++ CURL *ch; ++ char *url; ++ http_request_method meth; ++ http_request_body *body; ++ ++ struct { ++ curl_infotype last_type; ++ phpstr request; ++ phpstr response; ++ } conv; ++ ++ struct { ++ phpstr cookies; ++ HashTable options; ++ struct curl_slist *headers; ++ } _cache; ++ ++ struct { ++ uint count; ++ double delay; ++ } _retry; ++ ++ char _error[CURL_ERROR_SIZE+1]; ++ zval *_progress_callback; ++ ++#ifdef ZTS ++ void ***tsrm_ls; ++#endif ++ ++ uint _in_progress_cb:1; ++ ++} http_request; ++ ++#ifndef pestrndup ++# define pestrndup(s,l,p) _pestrndup((s),(l),(p)) ++static inline void *_pestrndup(const void *s, size_t l, int p) ++{ ++ void *d = pemalloc(l+1, p); ++ memcpy(d, s, l); ++ ((char *) d)[l] = '\0'; ++ return d; ++} ++#endif ++ ++/* CURLOPT_PRIVATE storage living as long as a CURL handle */ ++typedef struct _http_request_storage_t { ++ char *url; ++ char *cookiestore; ++ char errorbuffer[CURL_ERROR_SIZE]; ++} http_request_storage; ++ ++static inline http_request_storage *http_request_storage_get(CURL *ch) ++{ ++ http_request_storage *st = NULL; ++ curl_easy_getinfo(ch, CURLINFO_PRIVATE, &st); ++ return st; ++} ++ ++#define http_curl_init(r) http_curl_init_ex(NULL, (r)) ++#define http_curl_init_ex(c, r) _http_curl_init_ex((c), (r) TSRMLS_CC) ++PHP_HTTP_API CURL *_http_curl_init_ex(CURL *ch, http_request *request TSRMLS_DC); ++ ++#define http_curl_free(c) _http_curl_free((c) TSRMLS_CC) ++PHP_HTTP_API void _http_curl_free(CURL **ch TSRMLS_DC); ++ ++#define http_curl_copy(c) _http_curl_copy((c) TSRMLS_CC) ++PHP_HTTP_API CURL *_http_curl_copy(CURL *ch TSRMLS_DC); ++ ++#define http_request_new() _http_request_init_ex(NULL, NULL, 0, NULL ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++#define http_request_init(r) _http_request_init_ex((r), NULL, 0, NULL ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++#define http_request_init_ex(r, c, m, u) _http_request_init_ex((r), (c), (m), (u) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API http_request *_http_request_init_ex(http_request *request, CURL *ch, http_request_method meth, const char *url ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++ ++#define http_request_dtor(r) _http_request_dtor((r)) ++PHP_HTTP_API void _http_request_dtor(http_request *request); ++ ++#define http_request_free(r) _http_request_free((r)) ++PHP_HTTP_API void _http_request_free(http_request **request); ++ ++#define http_request_reset(r) _http_request_reset(r) ++PHP_HTTP_API void _http_request_reset(http_request *r); ++ ++#define http_request_enable_cookies(r) _http_request_enable_cookies(r) ++PHP_HTTP_API STATUS _http_request_enable_cookies(http_request *request); ++ ++#define http_request_reset_cookies(r, s) _http_request_reset_cookies((r), (s)) ++PHP_HTTP_API STATUS _http_request_reset_cookies(http_request *request, int session_only); ++ ++#define http_request_flush_cookies(r) _http_request_flush_cookies(r) ++PHP_HTTP_API STATUS _http_request_flush_cookies(http_request *request); ++ ++#define http_request_defaults(r) _http_request_defaults(r) ++PHP_HTTP_API void _http_request_defaults(http_request *request); ++ ++#define http_request_prepare(r, o) _http_request_prepare((r), (o)) ++PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *options); ++ ++#define http_request_exec(r) _http_request_exec((r)) ++PHP_HTTP_API void _http_request_exec(http_request *request); ++ ++#define http_request_info(r, i) _http_request_info((r), (i)) ++PHP_HTTP_API void _http_request_info(http_request *request, HashTable *info); ++ ++#define http_request_set_progress_callback(r, cb) _http_request_set_progress_callback((r), (cb)) ++PHP_HTTP_API void _http_request_set_progress_callback(http_request *request, zval *cb); ++ ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_request_body_api.h +@@ -0,0 +1,62 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_request_body_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUEST_BODY_API_H ++#define PHP_HTTP_REQUEST_BODY_API_H ++ ++#ifdef HTTP_HAVE_CURL ++ ++#define HTTP_REQUEST_BODY_EMPTY 0 ++#define HTTP_REQUEST_BODY_CSTRING 1 ++#define HTTP_REQUEST_BODY_CURLPOST 2 ++#define HTTP_REQUEST_BODY_UPLOADFILE 3 ++typedef struct _http_request_body_t { ++ void *data; ++ size_t size; ++ uint type:3; ++ uint free:1; ++ uint priv:28; ++} http_request_body; ++ ++ ++#define http_request_body_new() http_request_body_init(NULL) ++#define http_request_body_init(b) http_request_body_init_ex((b), 0, NULL, 0, 0) ++#define http_request_body_init_ex(b, t, d, l, f) _http_request_body_init_ex((b), (t), (d), (l), (f) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++#define http_request_body_init_rel(b, t, d, l, f) _http_request_body_init_ex((b), (t), (d), (l), (f) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC TSRMLS_CC) ++PHP_HTTP_API http_request_body *_http_request_body_init_ex(http_request_body *body, int type, void *data, size_t len, zend_bool free ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++ ++#define http_request_body_fill(b, fields, files) _http_request_body_fill((b), (fields), (files) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API http_request_body *_http_request_body_fill(http_request_body *body, HashTable *fields, HashTable *files ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++ ++#define http_request_body_encode(b, s, l) _http_request_body_encode((b), (s), (l) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_request_body_encode(http_request_body *body, char **buf, size_t *len TSRMLS_DC); ++ ++#define http_request_body_dtor(b) _http_request_body_dtor((b) TSRMLS_CC) ++PHP_HTTP_API void _http_request_body_dtor(http_request_body *body TSRMLS_DC); ++ ++#define http_request_body_free(b) _http_request_body_free((b) TSRMLS_CC) ++PHP_HTTP_API void _http_request_body_free(http_request_body **body TSRMLS_DC); ++ ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_request_datashare_api.h +@@ -0,0 +1,88 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_request_datashare_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUEST_DATASHARE_API_H ++#define PHP_HTTP_REQUEST_DATASHARE_API_H ++#ifdef HTTP_HAVE_CURL ++#ifdef ZEND_ENGINE_2 ++ ++#ifdef ZTS ++typedef struct _http_request_datashare_lock_t { ++ CURL *ch; ++ MUTEX_T mx; ++} http_request_datashare_lock; ++ ++typedef union _http_request_datashare_handle_t { ++ zend_llist *list; ++ http_request_datashare_lock *locks; ++} http_request_datashare_handle; ++#else ++typedef struct _http_request_datashare_handle_t { ++ zend_llist *list; ++} http_request_datashare_handle; ++#endif ++ ++typedef struct _http_request_datashare_t { ++ CURLSH *ch; ++ zend_bool persistent; ++ http_request_datashare_handle handle; ++} http_request_datashare; ++ ++#define HTTP_RSHARE_HANDLES(s) ((s)->persistent ? &HTTP_G->request.datashare.handles : (s)->handle.list) ++ ++#define http_request_datashare_global_get _http_request_datashare_global_get ++extern http_request_datashare *_http_request_datashare_global_get(void); ++ ++extern PHP_MINIT_FUNCTION(http_request_datashare); ++extern PHP_MSHUTDOWN_FUNCTION(http_request_datashare); ++extern PHP_RINIT_FUNCTION(http_request_datashare); ++extern PHP_RSHUTDOWN_FUNCTION(http_request_datashare); ++ ++#define http_request_datashare_new() _http_request_datashare_init_ex(NULL, 0 TSRMLS_CC) ++#define http_request_datashare_init(s) _http_request_datashare_init_ex((s), 0 TSRMLS_CC) ++#define http_request_datashare_init_ex(s, p) _http_request_datashare_init_ex((s), (p) TSRMLS_CC) ++PHP_HTTP_API http_request_datashare *_http_request_datashare_init_ex(http_request_datashare *share, zend_bool persistent TSRMLS_DC); ++ ++#define http_request_datashare_attach(s, r) _http_request_datashare_attach((s), (r) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_request_datashare_attach(http_request_datashare *share, zval *request TSRMLS_DC); ++ ++#define http_request_datashare_detach(s, r) _http_request_datashare_detach((s), (r) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_request_datashare_detach(http_request_datashare *share, zval *request TSRMLS_DC); ++ ++#define http_request_datashare_detach_all(s) _http_request_datashare_detach_all((s) TSRMLS_CC) ++PHP_HTTP_API void _http_request_datashare_detach_all(http_request_datashare *share TSRMLS_DC); ++ ++#define http_request_datashare_dtor(s) _http_request_datashare_dtor((s) TSRMLS_CC) ++PHP_HTTP_API void _http_request_datashare_dtor(http_request_datashare *share TSRMLS_DC); ++ ++#define http_request_datashare_free(s) _http_request_datashare_free((s) TSRMLS_CC) ++PHP_HTTP_API void _http_request_datashare_free(http_request_datashare **share TSRMLS_DC); ++ ++#define http_request_datashare_set(s, o, l, e) _http_request_datashare_set((s), (o), (l), (e) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_request_datashare_set(http_request_datashare *share, const char *option, size_t option_len, zend_bool enable TSRMLS_DC); ++ ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_request_int.h +@@ -0,0 +1,72 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_request_int.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#if defined(ZTS) && defined(HTTP_HAVE_SSL) ++# ifdef PHP_WIN32 ++# define HTTP_NEED_OPENSSL_TSL ++# include ++# else /* !PHP_WIN32 */ ++# if defined(HTTP_HAVE_OPENSSL) ++# define HTTP_NEED_OPENSSL_TSL ++# include ++# elif defined(HTTP_HAVE_GNUTLS) ++# define HTTP_NEED_GNUTLS_TSL ++# include ++# else ++# warning \ ++ "libcurl was compiled with SSL support, but configure could not determine which" \ ++ "library was used; thus no SSL crypto locking callbacks will be set, which may " \ ++ "cause random crashes on SSL requests" ++# endif /* HTTP_HAVE_OPENSSL || HTTP_HAVE_GNUTLS */ ++# endif /* PHP_WIN32 */ ++#endif /* ZTS && HTTP_HAVE_SSL */ ++ ++#define HTTP_CURL_OPT(OPTION, p) curl_easy_setopt((request->ch), OPTION, (p)) ++ ++#define HTTP_CURL_OPT_STRING(OPTION, ldiff, obdc) \ ++ { \ ++ char *K = #OPTION; \ ++ HTTP_CURL_OPT_STRING_EX(K+lenof("CURLOPT_KEY")+ldiff, OPTION, obdc); \ ++ } ++#define HTTP_CURL_OPT_STRING_EX(keyname, optname, obdc) \ ++ if (!strcasecmp(key.str, keyname)) { \ ++ zval *copy = http_request_option_cache_ex(request, keyname, strlen(keyname)+1, 0, http_zsep(IS_STRING, *param)); \ ++ if (obdc) { \ ++ HTTP_CHECK_OPEN_BASEDIR(Z_STRVAL_P(copy), return FAILURE); \ ++ } \ ++ HTTP_CURL_OPT(optname, Z_STRVAL_P(copy)); \ ++ zval_ptr_dtor(©); \ ++ continue; \ ++ } ++#define HTTP_CURL_OPT_LONG(OPTION, ldiff) \ ++ { \ ++ char *K = #OPTION; \ ++ HTTP_CURL_OPT_LONG_EX(K+lenof("CURLOPT_KEY")+ldiff, OPTION); \ ++ } ++#define HTTP_CURL_OPT_LONG_EX(keyname, optname) \ ++ if (!strcasecmp(key.str, keyname)) { \ ++ zval *copy = http_zsep(IS_LONG, *param); \ ++ HTTP_CURL_OPT(optname, Z_LVAL_P(copy)); \ ++ zval_ptr_dtor(©); \ ++ continue; \ ++ } ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/php_http_request_method_api.h +@@ -0,0 +1,85 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_request_method_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUEST_METHOD_API_H ++#define PHP_HTTP_REQUEST_METHOD_API_H ++ ++typedef enum _http_request_method_t { ++ /* force the enum to be signed */ ++ HTTP_NEG_REQUEST_METHOD =-1, ++ HTTP_NO_REQUEST_METHOD = 0, ++ /* HTTP/1.1 */ ++ HTTP_GET = 1, ++ HTTP_HEAD = 2, ++ HTTP_POST = 3, ++ HTTP_PUT = 4, ++ HTTP_DELETE = 5, ++ HTTP_OPTIONS = 6, ++ HTTP_TRACE = 7, ++ HTTP_CONNECT = 8, ++ /* WebDAV - RFC 2518 */ ++ HTTP_PROPFIND = 9, ++ HTTP_PROPPATCH = 10, ++ HTTP_MKCOL = 11, ++ HTTP_COPY = 12, ++ HTTP_MOVE = 13, ++ HTTP_LOCK = 14, ++ HTTP_UNLOCK = 15, ++ /* WebDAV Versioning - RFC 3253 */ ++ HTTP_VERSION_CONTROL = 16, ++ HTTP_REPORT = 17, ++ HTTP_CHECKOUT = 18, ++ HTTP_CHECKIN = 19, ++ HTTP_UNCHECKOUT = 20, ++ HTTP_MKWORKSPACE = 21, ++ HTTP_UPDATE = 22, ++ HTTP_LABEL = 23, ++ HTTP_MERGE = 24, ++ HTTP_BASELINE_CONTROL = 25, ++ HTTP_MKACTIVITY = 26, ++ /* WebDAV Access Control - RFC 3744 */ ++ HTTP_ACL = 27, ++ HTTP_MAX_REQUEST_METHOD = 28 ++} http_request_method; ++ ++#define HTTP_MIN_REQUEST_METHOD (HTTP_NO_REQUEST_METHOD + 1) ++#define HTTP_STD_REQUEST_METHOD(m) ((m > HTTP_NO_REQUEST_METHOD) && (m < HTTP_MAX_REQUEST_METHOD)) ++ ++extern PHP_MINIT_FUNCTION(http_request_method); ++extern PHP_RINIT_FUNCTION(http_request_method); ++extern PHP_RSHUTDOWN_FUNCTION(http_request_method); ++ ++#define http_request_method_name(m) _http_request_method_name((m) TSRMLS_CC) ++PHP_HTTP_API const char *_http_request_method_name(http_request_method m TSRMLS_DC); ++ ++#define http_request_method_exists(u, l, c) _http_request_method_exists((u), (l), (c) TSRMLS_CC) ++PHP_HTTP_API int _http_request_method_exists(int by_name, http_request_method id, const char *name TSRMLS_DC); ++ ++#define http_request_method_register(m, l) _http_request_method_register((m), (l) TSRMLS_CC) ++PHP_HTTP_API int _http_request_method_register(const char *method, int method_name_len TSRMLS_DC); ++ ++#define http_request_method_unregister(mn) _http_request_method_unregister((mn) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_request_method_unregister(int method TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_request_object.h +@@ -0,0 +1,118 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_request_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUEST_OBJECT_H ++#define PHP_HTTP_REQUEST_OBJECT_H ++#ifdef HTTP_HAVE_CURL ++#ifdef ZEND_ENGINE_2 ++ ++#include "php_http_request_api.h" ++#include "php_http_request_pool_api.h" ++#include "php_http_request_datashare_api.h" ++ ++typedef struct _http_request_object_t { ++ zend_object zo; ++ http_request *request; ++ http_request_pool *pool; ++ http_request_datashare *share; ++} http_request_object; ++ ++extern zend_class_entry *http_request_object_ce; ++extern zend_function_entry http_request_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_request_object); ++ ++#define http_request_object_new(ce) _http_request_object_new((ce) TSRMLS_CC) ++extern zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC); ++#define http_request_object_new_ex(ce, ch, ptr) _http_request_object_new_ex((ce), (ch), (ptr) TSRMLS_CC) ++extern zend_object_value _http_request_object_new_ex(zend_class_entry *ce, CURL *ch, http_request_object **ptr TSRMLS_DC); ++#define http_request_object_clone(zv) _http_request_object_clone_obj((zv) TSRMLS_CC) ++extern zend_object_value _http_request_object_clone_obj(zval *zobject TSRMLS_DC); ++#define http_request_object_free(o) _http_request_object_free((o) TSRMLS_CC) ++extern void _http_request_object_free(zend_object *object TSRMLS_DC); ++ ++#define http_request_object_requesthandler(req, this) _http_request_object_requesthandler((req), (this) TSRMLS_CC) ++extern STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ptr TSRMLS_DC); ++#define http_request_object_responsehandler(req, this) _http_request_object_responsehandler((req), (this) TSRMLS_CC) ++extern STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this_ptr TSRMLS_DC); ++ ++PHP_METHOD(HttpRequest, __construct); ++PHP_METHOD(HttpRequest, setOptions); ++PHP_METHOD(HttpRequest, getOptions); ++PHP_METHOD(HttpRequest, addSslOptions); ++PHP_METHOD(HttpRequest, setSslOptions); ++PHP_METHOD(HttpRequest, getSslOptions); ++PHP_METHOD(HttpRequest, addHeaders); ++PHP_METHOD(HttpRequest, getHeaders); ++PHP_METHOD(HttpRequest, setHeaders); ++PHP_METHOD(HttpRequest, addCookies); ++PHP_METHOD(HttpRequest, getCookies); ++PHP_METHOD(HttpRequest, setCookies); ++PHP_METHOD(HttpRequest, enableCookies); ++PHP_METHOD(HttpRequest, resetCookies); ++PHP_METHOD(HttpRequest, flushCookies); ++PHP_METHOD(HttpRequest, setMethod); ++PHP_METHOD(HttpRequest, getMethod); ++PHP_METHOD(HttpRequest, setUrl); ++PHP_METHOD(HttpRequest, getUrl); ++PHP_METHOD(HttpRequest, setContentType); ++PHP_METHOD(HttpRequest, getContentType); ++PHP_METHOD(HttpRequest, setQueryData); ++PHP_METHOD(HttpRequest, getQueryData); ++PHP_METHOD(HttpRequest, addQueryData); ++PHP_METHOD(HttpRequest, setPostFields); ++PHP_METHOD(HttpRequest, getPostFields); ++PHP_METHOD(HttpRequest, addPostFields); ++PHP_METHOD(HttpRequest, getBody); ++PHP_METHOD(HttpRequest, setBody); ++PHP_METHOD(HttpRequest, addBody); ++PHP_METHOD(HttpRequest, addPostFile); ++PHP_METHOD(HttpRequest, setPostFiles); ++PHP_METHOD(HttpRequest, getPostFiles); ++PHP_METHOD(HttpRequest, setPutFile); ++PHP_METHOD(HttpRequest, getPutFile); ++PHP_METHOD(HttpRequest, getPutData); ++PHP_METHOD(HttpRequest, setPutData); ++PHP_METHOD(HttpRequest, addPutData); ++PHP_METHOD(HttpRequest, send); ++PHP_METHOD(HttpRequest, getResponseData); ++PHP_METHOD(HttpRequest, getResponseHeader); ++PHP_METHOD(HttpRequest, getResponseCookies); ++PHP_METHOD(HttpRequest, getResponseCode); ++PHP_METHOD(HttpRequest, getResponseStatus); ++PHP_METHOD(HttpRequest, getResponseBody); ++PHP_METHOD(HttpRequest, getResponseInfo); ++PHP_METHOD(HttpRequest, getResponseMessage); ++PHP_METHOD(HttpRequest, getRawResponseMessage); ++PHP_METHOD(HttpRequest, getRequestMessage); ++PHP_METHOD(HttpRequest, getRawRequestMessage); ++PHP_METHOD(HttpRequest, getHistory); ++PHP_METHOD(HttpRequest, clearHistory); ++PHP_METHOD(HttpRequest, getMessageClass); ++PHP_METHOD(HttpRequest, setMessageClass); ++PHP_METHOD(HttpRequest, factory); ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_request_pool_api.h +@@ -0,0 +1,97 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_request_pool_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUEST_POOL_API_H ++#define PHP_HTTP_REQUEST_POOL_API_H ++#ifdef HTTP_HAVE_CURL ++#ifdef ZEND_ENGINE_2 ++ ++typedef struct _http_request_pool_t { ++ CURLM *ch; ++ zend_llist finished; ++ zend_llist handles; ++ int unfinished; ++#ifdef ZTS ++ void ***tsrm_ls; ++#endif ++#ifdef HTTP_HAVE_EVENT ++ struct event *timeout; ++ unsigned useevents:1; ++ unsigned runsocket:1; ++#endif ++} http_request_pool; ++ ++typedef int (*http_request_pool_apply_func)(http_request_pool *pool, zval *request); ++typedef int (*http_request_pool_apply_with_arg_func)(http_request_pool *pool, zval *request, void *arg); ++ ++PHP_MINIT_FUNCTION(http_request_pool); ++#ifdef HTTP_HAVE_EVENT ++PHP_RINIT_FUNCTION(http_request_pool); ++#endif ++ ++#define http_request_pool_timeout _http_request_pool_timeout ++extern struct timeval *_http_request_pool_timeout(http_request_pool *pool, struct timeval *timeout); ++ ++#define http_request_pool_responsehandler _http_request_pool_responsehandler ++extern void _http_request_pool_responsehandler(http_request_pool *pool); ++ ++#define http_request_pool_apply_responsehandler _http_request_pool_responsehandler ++extern int _http_request_pool_apply_responsehandler(http_request_pool *pool, zval *req, void *ch); ++ ++#define http_request_pool_init(p) _http_request_pool_init((p) TSRMLS_CC) ++PHP_HTTP_API http_request_pool *_http_request_pool_init(http_request_pool *pool TSRMLS_DC); ++ ++#define http_request_pool_attach(p, r) _http_request_pool_attach((p), (r)) ++PHP_HTTP_API STATUS _http_request_pool_attach(http_request_pool *pool, zval *request); ++ ++#define http_request_pool_detach(p, r) _http_request_pool_detach((p), (r)) ++PHP_HTTP_API STATUS _http_request_pool_detach(http_request_pool *pool, zval *request); ++ ++#define http_request_pool_apply(p, f) _http_request_pool_apply((p), (f)) ++PHP_HTTP_API void _http_request_pool_apply(http_request_pool *pool, http_request_pool_apply_func cb); ++ ++#define http_request_pool_apply_with_arg(p, f, a) _http_request_pool_apply_with_arg((p), (f), (a)) ++PHP_HTTP_API void _http_request_pool_apply_with_arg(http_request_pool *pool, http_request_pool_apply_with_arg_func cb, void *arg); ++ ++#define http_request_pool_detach_all(p) _http_request_pool_detach_all((p)) ++PHP_HTTP_API void _http_request_pool_detach_all(http_request_pool *pool); ++ ++#define http_request_pool_send(p) _http_request_pool_send((p)) ++PHP_HTTP_API STATUS _http_request_pool_send(http_request_pool *pool); ++ ++#define http_request_pool_select _http_request_pool_select ++PHP_HTTP_API STATUS _http_request_pool_select(http_request_pool *pool); ++ ++#define http_request_pool_select_ex _http_request_pool_select_ex ++PHP_HTTP_API STATUS _http_request_pool_select_ex(http_request_pool *pool, struct timeval *custom_timeout); ++ ++#define http_request_pool_perform(p) _http_request_pool_perform((p)) ++PHP_HTTP_API int _http_request_pool_perform(http_request_pool *pool); ++ ++#define http_request_pool_dtor(p) _http_request_pool_dtor((p)) ++PHP_HTTP_API void _http_request_pool_dtor(http_request_pool *pool); ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_requestdatashare_object.h +@@ -0,0 +1,59 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_requestdatashare_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUEST_DATASHARE_OBJECT_H ++#define PHP_HTTP_REQUEST_DATASHARE_OBJECT_H ++#ifdef HTTP_HAVE_CURL ++#ifdef ZEND_ENGINE_2 ++ ++typedef struct _http_requestdatashare_object_t { ++ zend_object zo; ++ http_request_datashare *share; ++} http_requestdatashare_object; ++ ++extern zend_class_entry *http_requestdatashare_object_ce; ++extern zend_function_entry http_requestdatashare_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_requestdatashare_object); ++ ++#define http_requestdatashare_object_new(ce) _http_requestdatashare_object_new((ce) TSRMLS_CC) ++extern zend_object_value _http_requestdatashare_object_new(zend_class_entry *ce TSRMLS_DC); ++#define http_requestdatashare_object_new_ex(ce, s, ptr) _http_requestdatashare_object_new_ex((ce), (s), (ptr) TSRMLS_CC) ++extern zend_object_value _http_requestdatashare_object_new_ex(zend_class_entry *ce, http_request_datashare *share, http_requestdatashare_object **ptr TSRMLS_DC); ++#define http_requestdatashare_object_free(o) _http_requestdatashare_object_free((o) TSRMLS_CC) ++extern void _http_requestdatashare_object_free(zend_object *object TSRMLS_DC); ++ ++PHP_METHOD(HttpRequestDataShare, __destruct); ++PHP_METHOD(HttpRequestDataShare, count); ++PHP_METHOD(HttpRequestDataShare, attach); ++PHP_METHOD(HttpRequestDataShare, detach); ++PHP_METHOD(HttpRequestDataShare, reset); ++PHP_METHOD(HttpRequestDataShare, factory); ++#ifndef WONKY ++PHP_METHOD(HttpRequestDataShare, singleton); ++#endif ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_requestpool_object.h +@@ -0,0 +1,69 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_requestpool_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUESTPOOL_OBJECT_H ++#define PHP_HTTP_REQUESTPOOL_OBJECT_H ++#ifdef HTTP_HAVE_CURL ++#ifdef ZEND_ENGINE_2 ++ ++typedef struct _http_requestpool_object_t { ++ zend_object zo; ++ http_request_pool pool; ++ struct { ++ long pos; ++ } iterator; ++} http_requestpool_object; ++ ++extern zend_class_entry *http_requestpool_object_ce; ++extern zend_function_entry http_requestpool_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_requestpool_object); ++ ++#define http_requestpool_object_new(ce) _http_requestpool_object_new(ce TSRMLS_CC) ++extern zend_object_value _http_requestpool_object_new(zend_class_entry *ce TSRMLS_DC); ++#define http_requestpool_object_free(o) _http_requestpool_object_free(o TSRMLS_CC) ++extern void _http_requestpool_object_free(zend_object *object TSRMLS_DC); ++ ++PHP_METHOD(HttpRequestPool, __construct); ++PHP_METHOD(HttpRequestPool, __destruct); ++PHP_METHOD(HttpRequestPool, attach); ++PHP_METHOD(HttpRequestPool, detach); ++PHP_METHOD(HttpRequestPool, send); ++PHP_METHOD(HttpRequestPool, reset); ++PHP_METHOD(HttpRequestPool, socketPerform); ++PHP_METHOD(HttpRequestPool, socketSelect); ++PHP_METHOD(HttpRequestPool, valid); ++PHP_METHOD(HttpRequestPool, current); ++PHP_METHOD(HttpRequestPool, key); ++PHP_METHOD(HttpRequestPool, next); ++PHP_METHOD(HttpRequestPool, rewind); ++PHP_METHOD(HttpRequestPool, count); ++PHP_METHOD(HttpRequestPool, getAttachedRequests); ++PHP_METHOD(HttpRequestPool, getFinishedRequests); ++PHP_METHOD(HttpRequestPool, enablePipelining); ++PHP_METHOD(HttpRequestPool, enableEvents); ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_response_object.h +@@ -0,0 +1,67 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_response_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_RESPONSE_OBJECT_H ++#define PHP_HTTP_RESPONSE_OBJECT_H ++#ifdef ZEND_ENGINE_2 ++#ifndef WONKY ++ ++extern zend_class_entry *http_response_object_ce; ++extern zend_function_entry http_response_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_response_object); ++ ++PHP_METHOD(HttpResponse, setHeader); ++PHP_METHOD(HttpResponse, getHeader); ++PHP_METHOD(HttpResponse, setETag); ++PHP_METHOD(HttpResponse, getETag); ++PHP_METHOD(HttpResponse, setLastModified); ++PHP_METHOD(HttpResponse, getLastModified); ++PHP_METHOD(HttpResponse, setContentDisposition); ++PHP_METHOD(HttpResponse, getContentDisposition); ++PHP_METHOD(HttpResponse, setContentType); ++PHP_METHOD(HttpResponse, getContentType); ++PHP_METHOD(HttpResponse, guessContentType); ++PHP_METHOD(HttpResponse, setCache); ++PHP_METHOD(HttpResponse, getCache); ++PHP_METHOD(HttpResponse, setCacheControl); ++PHP_METHOD(HttpResponse, getCacheControl); ++PHP_METHOD(HttpResponse, setGzip); ++PHP_METHOD(HttpResponse, getGzip); ++PHP_METHOD(HttpResponse, setThrottleDelay); ++PHP_METHOD(HttpResponse, getThrottleDelay); ++PHP_METHOD(HttpResponse, setBufferSize); ++PHP_METHOD(HttpResponse, getBufferSize); ++PHP_METHOD(HttpResponse, setData); ++PHP_METHOD(HttpResponse, getData); ++PHP_METHOD(HttpResponse, setFile); ++PHP_METHOD(HttpResponse, getFile); ++PHP_METHOD(HttpResponse, setStream); ++PHP_METHOD(HttpResponse, getStream); ++PHP_METHOD(HttpResponse, send); ++PHP_METHOD(HttpResponse, capture); ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_send_api.h +@@ -0,0 +1,91 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_send_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_SEND_API_H ++#define PHP_HTTP_SEND_API_H ++ ++typedef enum _http_send_mode_t { ++ SEND_DATA, ++ SEND_RSRC ++} http_send_mode; ++ ++#define HTTP_REDIRECT 0L ++#define HTTP_REDIRECT_PERM 301L ++#define HTTP_REDIRECT_FOUND 302L ++#define HTTP_REDIRECT_POST 303L ++#define HTTP_REDIRECT_PROXY 305L ++#define HTTP_REDIRECT_TEMP 307L ++ ++extern PHP_MINIT_FUNCTION(http_send); ++ ++#define http_send_status(s) sapi_header_op(SAPI_HEADER_SET_STATUS, (void *) (long) (s) TSRMLS_CC) ++#define http_send_header(n, v, r) _http_send_header_ex((n), strlen(n), (v), strlen(v), (r), NULL TSRMLS_CC) ++#define http_send_header_ex(n, nl, v, vl, r, s) _http_send_header_ex((n), (nl), (v), (vl), (r), (s) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_header_ex(const char *name, size_t name_len, const char *value, size_t value_len, zend_bool replace, char **sent_header TSRMLS_DC); ++#define http_send_header_string(h) _http_send_status_header_ex(0, (h), strlen(h), 1 TSRMLS_CC) ++#define http_send_header_string_ex(h, l, r) _http_send_status_header_ex(0, (h), (l), (r) TSRMLS_CC) ++#define http_send_status_header(s, h) _http_send_status_header_ex((s), (h), (h)?strlen(h):0, 1 TSRMLS_CC) ++#define http_send_status_header_ex(s, h, l, r) _http_send_status_header_ex((s), (h), (l), (r) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_status_header_ex(int status, const char *header, size_t header_len, zend_bool replace TSRMLS_DC); ++ ++#define http_send_header_zval(n, z, r) http_send_header_zval_ex((n), strlen(n), (z), (r)) ++#define http_send_header_zval_ex(n, l, z, r) _http_send_header_zval_ex((n), (l), (z), (r) TSRMLS_CC) ++PHP_HTTP_API void _http_send_header_zval_ex(const char *name, size_t name_len, zval **val, zend_bool replace TSRMLS_DC); ++ ++#define http_hide_header(h) http_hide_header_ex((h), strlen(h)) ++#define http_hide_header_ex(h, l) _http_hide_header_ex((h), (l) TSRMLS_CC) ++PHP_HTTP_API void _http_hide_header_ex(const char *name, size_t name_len TSRMLS_DC); ++ ++#define http_send_last_modified(t) _http_send_last_modified_ex((t), NULL TSRMLS_CC) ++#define http_send_last_modified_ex(t, s) _http_send_last_modified_ex((t), (s) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_last_modified_ex(time_t t, char **sent_header TSRMLS_DC); ++ ++#define http_send_etag(e, l) _http_send_etag_ex((e), (l), NULL TSRMLS_CC) ++#define http_send_etag_ex(e, l, s) _http_send_etag_ex((e), (l), (s) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_etag_ex(const char *etag, size_t etag_len, char **sent_header TSRMLS_DC); ++ ++#define http_send_cache_control(cc, cl) http_send_header_ex("Cache-Control", lenof("Cache-Control"), (cc), (cl), 1, NULL) ++ ++#define http_send_content_type(c, l) _http_send_content_type((c), (l) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_content_type(const char *content_type, size_t ct_len TSRMLS_DC); ++ ++#define http_send_content_disposition(f, l, i) _http_send_content_disposition((f), (l), (i) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_content_disposition(const char *filename, size_t f_len, zend_bool send_inline TSRMLS_DC); ++ ++#define http_send_data(d, l) http_send((d), (l), SEND_DATA) ++#define http_send_data_ex(d, l, nc) http_send_ex((d), (l), SEND_DATA, (nc)) ++#define http_send(d, s, m) _http_send_ex((d), (s), (m), 0 TSRMLS_CC) ++#define http_send_ex(d, s, m, nc) _http_send_ex((d), (s), (m), (nc) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_ex(const void *data, size_t data_size, http_send_mode mode, zend_bool no_cache TSRMLS_DC); ++ ++#define http_send_file(f) http_send_stream_ex(php_stream_open_wrapper_ex(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT), 1, 0) ++#define http_send_file_ex(f, nc) http_send_stream_ex(php_stream_open_wrapper_ex(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT), 1, (nc)) ++#define http_send_stream(s) http_send_stream_ex((s), 0, 0) ++#define http_send_stream_ex(s, c, nc) _http_send_stream_ex((s), (c), (nc) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_stream_ex(php_stream *s, zend_bool close_stream, zend_bool no_cache TSRMLS_DC); ++ ++#define http_guess_content_type(mf, mm, d, l, m) _http_guess_content_type((mf), (mm), (d), (l), (m) TSRMLS_CC) ++PHP_HTTP_API char *_http_guess_content_type(const char *magic_file, long magic_mode, void *data_ptr, size_t data_len, http_send_mode mode TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_std_defs.h +@@ -0,0 +1,410 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_std_defs.h 323304 2012-02-17 21:13:24Z mike $ */ ++ ++#ifndef PHP_HTTP_STD_DEFS_H ++#define PHP_HTTP_STD_DEFS_H ++ ++#if defined(PHP_WIN32) ++# if defined(HTTP_EXPORTS) ++# define PHP_HTTP_API __declspec(dllexport) ++# elif defined(COMPILE_DL_HTTP) ++# define PHP_HTTP_API __declspec(dllimport) ++# else ++# define PHP_HTTP_API ++# endif ++#else ++# define PHP_HTTP_API ++#endif ++ ++/* make functions that return SUCCESS|FAILURE more obvious */ ++typedef int STATUS; ++ ++/* lenof() */ ++#define lenof(S) (sizeof(S) - 1) ++ ++#ifndef MIN ++# define MIN(a,b) (ab?a:b) ++#endif ++ ++/* STR_SET() */ ++#ifndef STR_SET ++# define STR_SET(STR, SET) \ ++ { \ ++ STR_FREE(STR); \ ++ STR = SET; \ ++ } ++#endif ++ ++#define STR_PTR(s) (s?s:"") ++ ++#define INIT_ZARR(zv, ht) \ ++ { \ ++ INIT_PZVAL(&(zv)); \ ++ Z_TYPE(zv) = IS_ARRAY; \ ++ Z_ARRVAL(zv) = (ht); \ ++ } ++ ++/* return bool (v == SUCCESS) */ ++#define RETVAL_SUCCESS(v) RETVAL_BOOL(SUCCESS == (v)) ++#define RETURN_SUCCESS(v) RETURN_BOOL(SUCCESS == (v)) ++/* return object(values) */ ++#define RETVAL_OBJECT(o, addref) \ ++ RETVAL_OBJVAL((o)->value.obj, addref) ++#define RETURN_OBJECT(o, addref) \ ++ RETVAL_OBJECT(o, addref); \ ++ return ++#define RETVAL_OBJVAL(ov, addref) \ ++ ZVAL_OBJVAL(return_value, ov, addref) ++#define RETURN_OBJVAL(ov, addref) \ ++ RETVAL_OBJVAL(ov, addref); \ ++ return ++#define ZVAL_OBJVAL(zv, ov, addref) \ ++ (zv)->type = IS_OBJECT; \ ++ (zv)->value.obj = (ov);\ ++ if (addref && Z_OBJ_HT_P(zv)->add_ref) { \ ++ Z_OBJ_HT_P(zv)->add_ref((zv) TSRMLS_CC); \ ++ } ++/* return property */ ++#define RETVAL_PROP(n) RETVAL_PROP_EX(getThis(), n) ++#define RETURN_PROP(n) RETURN_PROP_EX(getThis(), n) ++#define RETVAL_PROP_EX(this, n) \ ++ { \ ++ zval *__prop = zend_read_property(THIS_CE, this, ZEND_STRS(#n)-1, 0 TSRMLS_CC); \ ++ RETVAL_ZVAL(__prop, 1, 0); \ ++ } ++#define RETURN_PROP_EX(this, n) \ ++ { \ ++ zval *__prop = zend_read_property(THIS_CE, this, ZEND_STRS(#n)-1, 0 TSRMLS_CC); \ ++ RETURN_ZVAL(__prop, 1, 0); \ ++ } ++ ++/* function accepts no args */ ++#define NO_ARGS zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ""); ++ ++/* CR LF */ ++#define HTTP_CRLF "\r\n" ++ ++/* default cache control */ ++#define HTTP_DEFAULT_CACHECONTROL "private, must-revalidate, max-age=0" ++ ++/* max URL length */ ++#define HTTP_URL_MAXLEN 4096 ++ ++/* max request method length */ ++#define HTTP_REQUEST_METHOD_MAXLEN 31 ++ ++/* def URL arg separator */ ++#define HTTP_URL_ARGSEP "&" ++ ++/* send buffer size */ ++#define HTTP_SENDBUF_SIZE 40960 ++ ++/* CURL buffer size */ ++#define HTTP_CURLBUF_SIZE 16384 ++ ++/* known methods */ ++#define HTTP_KNOWN_METHODS \ ++ /* HTTP 1.1 */ \ ++ "GET, HEAD, POST, PUT, DELETE, OPTIONS, TRACE, CONNECT, " \ ++ /* WebDAV - RFC 2518 */ \ ++ "PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK, " \ ++ /* WebDAV Versioning - RFC 3253 */ \ ++ "VERSION-CONTROL, REPORT, CHECKOUT, CHECKIN, UNCHECKOUT, " \ ++ "MKWORKSPACE, UPDATE, LABEL, MERGE, BASELINE-CONTROL, MKACTIVITY, " \ ++ /* WebDAV Access Control - RFC 3744 */ \ ++ "ACL, " \ ++ /* END */ ++ ++#ifdef ZEND_ENGINE_2 ++# include "ext/standard/file.h" ++# define HTTP_DEFAULT_STREAM_CONTEXT FG(default_context) ++#else ++# define HTTP_DEFAULT_STREAM_CONTEXT NULL ++#endif ++ ++#define HTTP_PHP_INI_ENTRY(entry, default, scope, updater, global) \ ++ STD_PHP_INI_ENTRY(entry, default, scope, updater, global, zend_http_globals, http_globals) ++#define HTTP_PHP_INI_ENTRY_EX(entry, default, scope, updater, displayer, global) \ ++ STD_PHP_INI_ENTRY_EX(entry, default, scope, updater, global, zend_http_globals, http_globals, displayer) ++ ++ ++#define HTTP_LONG_CONSTANT(name, const) REGISTER_LONG_CONSTANT(name, const, CONST_CS | CONST_PERSISTENT) ++ ++/* {{{ objects & properties */ ++#ifdef ZEND_ENGINE_2 ++ ++# define HTTP_STATIC_ME_ALIAS(me, al, ai) ZEND_FENTRY(me, ZEND_FN(al), ai, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ++ ++# define HTTP_REGISTER_CLASS_EX(classname, name, parent, flags) \ ++ { \ ++ zend_class_entry ce; \ ++ memset(&ce, 0, sizeof(zend_class_entry)); \ ++ INIT_CLASS_ENTRY(ce, #classname, name## _fe); \ ++ ce.create_object = _ ##name## _new; \ ++ name## _ce = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \ ++ name## _ce->ce_flags |= flags; \ ++ memcpy(& name## _handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); \ ++ } ++ ++# define HTTP_REGISTER_CLASS(classname, name, parent, flags) \ ++ { \ ++ zend_class_entry ce; \ ++ memset(&ce, 0, sizeof(zend_class_entry)); \ ++ INIT_CLASS_ENTRY(ce, #classname, name## _fe); \ ++ ce.create_object = NULL; \ ++ name## _ce = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \ ++ name## _ce->ce_flags |= flags; \ ++ } ++ ++# define HTTP_REGISTER_EXCEPTION(classname, cename, parent) \ ++ { \ ++ zend_class_entry ce; \ ++ memset(&ce, 0, sizeof(zend_class_entry)); \ ++ INIT_CLASS_ENTRY(ce, #classname, NULL); \ ++ ce.create_object = NULL; \ ++ cename = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \ ++ } ++ ++# define getObject(t, o) getObjectEx(t, o, getThis()) ++# define getObjectEx(t, o, v) t * o = ((t *) zend_object_store_get_object(v TSRMLS_CC)) ++# define putObject(t, o) zend_objects_store_put(o, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) _ ##t## _free, NULL TSRMLS_CC); ++# if defined(ZEND_ENGINE_2_4) ++# define freeObject(o) \ ++ zend_object_std_dtor(o TSRMLS_CC); \ ++ efree(o); ++# elif !defined(WONKY) ++# define freeObject(o) \ ++ if (OBJ_GUARDS(o)) { \ ++ zend_hash_destroy(OBJ_GUARDS(o)); \ ++ FREE_HASHTABLE(OBJ_GUARDS(o)); \ ++ } \ ++ if (OBJ_PROP(o)) { \ ++ zend_hash_destroy(OBJ_PROP(o)); \ ++ FREE_HASHTABLE(OBJ_PROP(o)); \ ++ } \ ++ efree(o); ++# else ++# define freeObject(o) \ ++ if (OBJ_PROP(o)) { \ ++ zend_hash_destroy(OBJ_PROP(o)); \ ++ FREE_HASHTABLE(OBJ_PROP(o)); \ ++ } \ ++ efree(o); ++# endif ++# define OBJ_PROP(o) (o)->zo.properties ++# define OBJ_GUARDS(o) (o)->zo.guards ++ ++# define ACC_PROP_PRIVATE(ce, flags) ((flags & ZEND_ACC_PRIVATE) && (EG(scope) && ce == EG(scope)) ++# define ACC_PROP_PROTECTED(ce, flags) ((flags & ZEND_ACC_PROTECTED) && (zend_check_protected(ce, EG(scope)))) ++# define ACC_PROP_PUBLIC(flags) (flags & ZEND_ACC_PUBLIC) ++# define ACC_PROP(ce, flags) (ACC_PROP_PUBLIC(flags) || ACC_PROP_PRIVATE(ce, flags) || ACC_PROP_PROTECTED(ce, flags)) ++ ++# define SET_EH_THROW_HTTP() SET_EH_THROW_EX(http_exception_get_default()) ++# define SET_EH_THROW_EX(ex) php_set_error_handling(EH_THROW, ex TSRMLS_CC) ++# define SET_EH_NORMAL() php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC) ++ ++#endif /* ZEND_ENGINE_2 */ ++/* }}} */ ++ ++#ifdef ZEND_ENGINE_2 ++# define with_error_handling(eh, ec) \ ++ { \ ++ error_handling_t __eh = GLOBAL_ERROR_HANDLING; \ ++ zend_class_entry *__ec= GLOBAL_EXCEPTION_CLASS; \ ++ php_set_error_handling(eh, ec TSRMLS_CC); ++# define end_error_handling() \ ++ php_set_error_handling(__eh, __ec TSRMLS_CC); \ ++ } ++#else ++# define with_error_handling(eh, ec) ++# define end_error_handling() ++#endif ++ ++#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION > 5 ++# define ZEND_EXCEPTION_GET_DEFAULT() zend_exception_get_default(TSRMLS_C) ++#else ++# define ZEND_EXCEPTION_GET_DEFAULT() zend_exception_get_default() ++#endif ++ ++#ifndef E_THROW ++# define E_THROW 0 ++#endif ++#ifdef ZEND_ENGINE_2 ++# define HE_THROW E_THROW TSRMLS_CC ++# define HE_NOTICE (HTTP_G->only_exceptions ? E_THROW : E_NOTICE) TSRMLS_CC ++# define HE_WARNING (HTTP_G->only_exceptions ? E_THROW : E_WARNING) TSRMLS_CC ++# define HE_ERROR (HTTP_G->only_exceptions ? E_THROW : E_ERROR) TSRMLS_CC ++#else ++# define HE_THROW E_WARNING TSRMLS_CC ++# define HE_NOTICE E_NOTICE TSRMLS_CC ++# define HE_WARNING E_WARNING TSRMLS_CC ++# define HE_ERROR E_ERROR TSRMLS_CC ++#endif ++ ++#define HTTP_E_RUNTIME 1L ++#define HTTP_E_INVALID_PARAM 2L ++#define HTTP_E_HEADER 3L ++#define HTTP_E_MALFORMED_HEADERS 4L ++#define HTTP_E_REQUEST_METHOD 5L ++#define HTTP_E_MESSAGE_TYPE 6L ++#define HTTP_E_ENCODING 7L ++#define HTTP_E_REQUEST 8L ++#define HTTP_E_REQUEST_POOL 9L ++#define HTTP_E_SOCKET 10L ++#define HTTP_E_RESPONSE 11L ++#define HTTP_E_URL 12L ++#define HTTP_E_QUERYSTRING 13L ++ ++#ifdef ZEND_ENGINE_2 ++# define HTTP_BEGIN_ARGS_EX(class, method, ret_ref, req_args) HTTP_STATIC_ARG_INFO ZEND_BEGIN_ARG_INFO_EX(args_for_ ##class## _ ##method , 0, ret_ref, req_args) ++# define HTTP_BEGIN_ARGS_AR(class, method, ret_ref, req_args) HTTP_STATIC_ARG_INFO ZEND_BEGIN_ARG_INFO_EX(args_for_ ##class## _ ##method , 1, ret_ref, req_args) ++# define HTTP_END_ARGS } ++# define HTTP_EMPTY_ARGS_EX(class, method, ret_ref) HTTP_BEGIN_ARGS_EX(class, method, ret_ref, 0) HTTP_END_ARGS ++# define HTTP_ARGS(class, method) args_for_ ##class## _ ##method ++# define HTTP_ARG_VAL(name, pass_ref) ZEND_ARG_INFO(pass_ref, name) ++# define HTTP_ARG_OBJ(class, name, allow_null) ZEND_ARG_OBJ_INFO(0, name, class, allow_null) ++#endif ++ ++#ifdef ZEND_ENGINE_2 ++# define EMPTY_FUNCTION_ENTRY {NULL, NULL, NULL, 0, 0} ++#else ++# define EMPTY_FUNCTION_ENTRY {NULL, NULL, NULL} ++#endif ++ ++#ifdef HTTP_HAVE_CURL ++# ifdef ZEND_ENGINE_2 ++# define HTTP_DECLARE_ARG_PASS_INFO() \ ++ HTTP_STATIC_ARG_INFO \ ++ ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_2, 0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(1) \ ++ ZEND_END_ARG_INFO(); \ ++ \ ++ HTTP_STATIC_ARG_INFO \ ++ ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_3, 0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(1) \ ++ ZEND_END_ARG_INFO(); \ ++ \ ++ HTTP_STATIC_ARG_INFO \ ++ ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_4, 0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(1) \ ++ ZEND_END_ARG_INFO(); \ ++ \ ++ HTTP_STATIC_ARG_INFO \ ++ ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_5, 0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(1) \ ++ ZEND_END_ARG_INFO(); ++ ++# else ++# define HTTP_DECLARE_ARG_PASS_INFO() \ ++ static unsigned char http_arg_pass_ref_2[] = {2, BYREF_NONE, BYREF_FORCE}; \ ++ static unsigned char http_arg_pass_ref_3[] = {3, BYREF_NONE, BYREF_NONE, BYREF_FORCE}; \ ++ static unsigned char http_arg_pass_ref_4[] = {4, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE}; \ ++ static unsigned char http_arg_pass_ref_5[] = {5, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE}; ++# endif /* ZEND_ENGINE_2 */ ++#else ++# ifdef ZEND_ENGINE_2 ++# define HTTP_DECLARE_ARG_PASS_INFO() \ ++ HTTP_STATIC_ARG_INFO \ ++ ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_2, 0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(1) \ ++ ZEND_END_ARG_INFO(); \ ++\ ++ HTTP_STATIC_ARG_INFO \ ++ ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_3, 0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(1) \ ++ ZEND_END_ARG_INFO(); \ ++\ ++ HTTP_STATIC_ARG_INFO \ ++ ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_4, 0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(1) \ ++ ZEND_END_ARG_INFO(); ++# else ++# define HTTP_DECLARE_ARG_PASS_INFO() \ ++ static unsigned char http_arg_pass_ref_2[] = {2, BYREF_NONE, BYREF_FORCE}; \ ++ static unsigned char http_arg_pass_ref_3[] = {3, BYREF_NONE, BYREF_NONE, BYREF_FORCE}; \ ++ static unsigned char http_arg_pass_ref_4[] = {4, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE}; ++# endif /* ZEND_ENGINE_2 */ ++#endif /* HTTP_HAVE_CURL */ ++ ++ ++#ifndef HAVE_CURL_SHARE_STRERROR ++# define curl_share_strerror(dummy) "unknown error" ++#endif ++#ifndef HAVE_CURL_EASY_STRERROR ++# define curl_easy_strerror(dummy) "unknown error" ++#endif ++#ifndef HAVE_CURL_MULTI_STRERROR ++# define curl_multi_strerror(dummy) "unknown error" ++#endif ++ ++#define PHP_MINIT_CALL(func) PHP_MINIT(func)(INIT_FUNC_ARGS_PASSTHRU) ++#define PHP_RINIT_CALL(func) PHP_RINIT(func)(INIT_FUNC_ARGS_PASSTHRU) ++#define PHP_MSHUTDOWN_CALL(func) PHP_MSHUTDOWN(func)(SHUTDOWN_FUNC_ARGS_PASSTHRU) ++#define PHP_RSHUTDOWN_CALL(func) PHP_RSHUTDOWN(func)(SHUTDOWN_FUNC_ARGS_PASSTHRU) ++ ++#define Z_OBJ_DELREF(z) \ ++ if (Z_OBJ_HT(z)->del_ref) { \ ++ Z_OBJ_HT(z)->del_ref(&(z) TSRMLS_CC); \ ++ } ++#define Z_OBJ_ADDREF(z) \ ++ if (Z_OBJ_HT(z)->add_ref) { \ ++ Z_OBJ_HT(z)->add_ref(&(z) TSRMLS_CC); \ ++ } ++#define Z_OBJ_DELREF_P(z) \ ++ if (Z_OBJ_HT_P(z)->del_ref) { \ ++ Z_OBJ_HT_P(z)->del_ref((z) TSRMLS_CC); \ ++ } ++#define Z_OBJ_ADDREF_P(z) \ ++ if (Z_OBJ_HT_P(z)->add_ref) { \ ++ Z_OBJ_HT_P(z)->add_ref((z) TSRMLS_CC); \ ++ } ++#define Z_OBJ_DELREF_PP(z) \ ++ if (Z_OBJ_HT_PP(z)->del_ref) { \ ++ Z_OBJ_HT_PP(z)->del_ref(*(z) TSRMLS_CC); \ ++ } ++#define Z_OBJ_ADDREF_PP(z) \ ++ if (Z_OBJ_HT_PP(z)->add_ref) { \ ++ Z_OBJ_HT_PP(z)->add_ref(*(z) TSRMLS_CC); \ ++ } ++ ++#endif /* PHP_HTTP_STD_DEFS_H */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_url_api.h +@@ -0,0 +1,165 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_url_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_URL_API_H ++#define PHP_HTTP_URL_API_H ++ ++#include "ext/standard/url.h" ++ ++extern PHP_MINIT_FUNCTION(http_url); ++ ++#define http_absolute_url(u) _http_absolute_url_ex((u), HTTP_URL_REPLACE TSRMLS_CC) ++#define http_absolute_url_ex(u, f) _http_absolute_url_ex((u), (f) TSRMLS_CC) ++PHP_HTTP_API char *_http_absolute_url_ex(const char *url, int flags TSRMLS_DC); ++ ++#define HTTP_URL_REPLACE 0x000 ++#define HTTP_URL_JOIN_PATH 0x001 ++#define HTTP_URL_JOIN_QUERY 0x002 ++#define HTTP_URL_STRIP_USER 0x004 ++#define HTTP_URL_STRIP_PASS 0x008 ++#define HTTP_URL_STRIP_AUTH (HTTP_URL_STRIP_USER|HTTP_URL_STRIP_PASS) ++#define HTTP_URL_STRIP_PORT 0x020 ++#define HTTP_URL_STRIP_PATH 0x040 ++#define HTTP_URL_STRIP_QUERY 0x080 ++#define HTTP_URL_STRIP_FRAGMENT 0x100 ++#define HTTP_URL_STRIP_ALL ( \ ++ HTTP_URL_STRIP_AUTH | \ ++ HTTP_URL_STRIP_PORT | \ ++ HTTP_URL_STRIP_PATH | \ ++ HTTP_URL_STRIP_QUERY | \ ++ HTTP_URL_STRIP_FRAGMENT \ ++) ++#define HTTP_URL_FROM_ENV 0x1000 ++ ++#define http_build_url(f, o, n, p, s, l) _http_build_url((f), (o), (n), (p), (s), (l) TSRMLS_CC) ++PHP_HTTP_API void _http_build_url(int flags, const php_url *old_url, const php_url *new_url, php_url **url_ptr, char **url_str, size_t *url_len TSRMLS_DC); ++ ++#define http_urlencode_hash(h, q) _http_urlencode_hash_ex((h), 1, NULL, 0, (q), NULL TSRMLS_CC) ++#define http_urlencode_hash_ex(h, o, p, pl, q, ql) _http_urlencode_hash_ex((h), (o), (p), (pl), (q), (ql) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_urlencode_hash_ex(HashTable *hash, zend_bool override_argsep, char *pre_encoded_data, size_t pre_encoded_len, char **encoded_data, size_t *encoded_len TSRMLS_DC); ++ ++#define http_urlencode_hash_recursive(ht, s, as, al, pr, pl) _http_urlencode_hash_recursive((ht), (s), (as), (al), (pr), (pl) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_urlencode_hash_recursive(HashTable *ht, phpstr *str, const char *arg_sep, size_t arg_sep_len, const char *prefix, size_t prefix_len TSRMLS_DC); ++ ++#define http_url_from_struct(u, ht) _http_url_from_struct((u), (ht) TSRMLS_CC) ++static inline php_url *_http_url_from_struct(php_url *url, HashTable *ht TSRMLS_DC) ++{ ++ zval **e; ++ ++ if (!url) { ++ url = ecalloc(1, sizeof(php_url)); ++ } ++ ++ if ((SUCCESS == zend_hash_find(ht, "scheme", sizeof("scheme"), (void *) &e)) ++ && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { ++ url->scheme = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); ++ } ++ if ((SUCCESS == zend_hash_find(ht, "user", sizeof("user"), (void *) &e)) ++ && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { ++ url->user = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); ++ } ++ if ((SUCCESS == zend_hash_find(ht, "pass", sizeof("pass"), (void *) &e)) ++ && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { ++ url->pass = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); ++ } ++ if ((SUCCESS == zend_hash_find(ht, "host", sizeof("host"), (void *) &e)) ++ && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { ++ url->host = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); ++ } ++ if ((SUCCESS == zend_hash_find(ht, "path", sizeof("path"), (void *) &e)) ++ && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { ++ url->path = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); ++ } ++ if ((SUCCESS == zend_hash_find(ht, "query", sizeof("query"), (void *) &e)) ++ && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { ++ url->query = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); ++ } ++ if ((SUCCESS == zend_hash_find(ht, "fragment", sizeof("fragment"), (void *) &e)) ++ && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { ++ url->fragment = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); ++ } ++ if (SUCCESS == zend_hash_find(ht, "port", sizeof("port"), (void *) &e)) { ++ if (Z_TYPE_PP(e) == IS_LONG) { ++ url->port = (unsigned short) Z_LVAL_PP(e); ++ } else { ++ zval *o = http_zsep(IS_LONG, *e); ++ ++ url->port = (unsigned short) Z_LVAL_P(o); ++ zval_ptr_dtor(&o); ++ } ++ } ++ ++ return url; ++} ++ ++#define http_url_tostruct(u, strct) _http_url_tostruct((u), (strct) TSRMLS_CC) ++static inline HashTable *_http_url_tostruct(php_url *url, zval *strct TSRMLS_DC) ++{ ++ zval arr; ++ ++ if (strct) { ++ switch (Z_TYPE_P(strct)) { ++ default: ++ zval_dtor(strct); ++ array_init(strct); ++ case IS_ARRAY: ++ case IS_OBJECT: ++ INIT_ZARR(arr, HASH_OF(strct)); ++ } ++ } else { ++ INIT_PZVAL(&arr); ++ array_init(&arr); ++ } ++ ++ if (url) { ++ if (url->scheme) { ++ add_assoc_string(&arr, "scheme", url->scheme, 1); ++ } ++ if (url->user) { ++ add_assoc_string(&arr, "user", url->user, 1); ++ } ++ if (url->pass) { ++ add_assoc_string(&arr, "pass", url->pass, 1); ++ } ++ if (url->host) { ++ add_assoc_string(&arr, "host", url->host, 1); ++ } ++ if (url->port) { ++ add_assoc_long(&arr, "port", (long) url->port); ++ } ++ if (url->path) { ++ add_assoc_string(&arr, "path", url->path, 1); ++ } ++ if (url->query) { ++ add_assoc_string(&arr, "query", url->query, 1); ++ } ++ if (url->fragment) { ++ add_assoc_string(&arr, "fragment", url->fragment, 1); ++ } ++ } ++ ++ return Z_ARRVAL(arr); ++} ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_util_object.h +@@ -0,0 +1,35 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_util_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_UTIL_OBJECT_H ++#define PHP_HTTP_UTIL_OBJECT_H ++#ifdef ZEND_ENGINE_2 ++ ++extern zend_class_entry *http_util_object_ce; ++extern zend_function_entry http_util_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_util_object); ++ ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/phpstr/phpstr.c +@@ -0,0 +1,379 @@ ++ ++/* $Id: phpstr.c 211942 2006-04-24 17:17:09Z mike $ */ ++ ++#include "php.h" ++#include "phpstr.h" ++ ++PHPSTR_API phpstr *phpstr_init_ex(phpstr *buf, size_t chunk_size, int flags) ++{ ++ if (!buf) { ++ buf = pemalloc(sizeof(phpstr), flags & PHPSTR_INIT_PERSISTENT); ++ } ++ ++ if (buf) { ++ buf->size = (chunk_size) ? chunk_size : PHPSTR_DEFAULT_SIZE; ++ buf->pmem = (flags & PHPSTR_INIT_PERSISTENT) ? 1 : 0; ++ buf->data = (flags & PHPSTR_INIT_PREALLOC) ? pemalloc(buf->size, buf->pmem) : NULL; ++ buf->free = (flags & PHPSTR_INIT_PREALLOC) ? buf->size : 0; ++ buf->used = 0; ++ } ++ ++ return buf; ++} ++ ++PHPSTR_API phpstr *phpstr_from_string_ex(phpstr *buf, const char *string, size_t length) ++{ ++ if ((buf = phpstr_init(buf))) { ++ if (PHPSTR_NOMEM == phpstr_append(buf, string, length)) { ++ pefree(buf, buf->pmem); ++ buf = NULL; ++ } ++ } ++ return buf; ++} ++ ++PHPSTR_API size_t phpstr_resize_ex(phpstr *buf, size_t len, size_t override_size, int allow_error) ++{ ++ char *ptr = NULL; ++#if 0 ++ fprintf(stderr, "RESIZE: size=%lu, used=%lu, free=%lu\n", buf->size, buf->used, buf->free); ++#endif ++ if (buf->free < len) { ++ size_t size = override_size ? override_size : buf->size; ++ ++ while ((size + buf->free) < len) { ++ size <<= 1; ++ } ++ ++ if (allow_error) { ++ ptr = perealloc_recoverable(buf->data, buf->used + buf->free + size, buf->pmem); ++ } else { ++ ptr = perealloc(buf->data, buf->used + buf->free + size, buf->pmem); ++ } ++ ++ if (ptr) { ++ buf->data = ptr; ++ } else { ++ return PHPSTR_NOMEM; ++ } ++ ++ buf->free += size; ++ return size; ++ } ++ return 0; ++} ++ ++PHPSTR_API size_t phpstr_shrink(phpstr *buf) ++{ ++ /* avoid another realloc on fixation */ ++ if (buf->free > 1) { ++ char *ptr = perealloc(buf->data, buf->used + 1, buf->pmem); ++ ++ if (ptr) { ++ buf->data = ptr; ++ } else { ++ return PHPSTR_NOMEM; ++ } ++ buf->free = 1; ++ } ++ return buf->used; ++} ++ ++PHPSTR_API size_t phpstr_append(phpstr *buf, const char *append, size_t append_len) ++{ ++ if (PHPSTR_NOMEM == phpstr_resize(buf, append_len)) { ++ return PHPSTR_NOMEM; ++ } ++ memcpy(buf->data + buf->used, append, append_len); ++ buf->used += append_len; ++ buf->free -= append_len; ++ return append_len; ++} ++ ++PHPSTR_API size_t phpstr_appendf(phpstr *buf, const char *format, ...) ++{ ++ va_list argv; ++ char *append; ++ size_t append_len, alloc; ++ ++ va_start(argv, format); ++ append_len = vspprintf(&append, 0, format, argv); ++ va_end(argv); ++ ++ alloc = phpstr_append(buf, append, append_len); ++ efree(append); ++ ++ if (PHPSTR_NOMEM == alloc) { ++ return PHPSTR_NOMEM; ++ } ++ return append_len; ++} ++ ++PHPSTR_API size_t phpstr_insert(phpstr *buf, const char *insert, size_t insert_len, size_t offset) ++{ ++ if (PHPSTR_NOMEM == phpstr_resize(buf, insert_len)) { ++ return PHPSTR_NOMEM; ++ } ++ memmove(buf->data + offset + insert_len, buf->data + offset, insert_len); ++ memcpy(buf->data + offset, insert, insert_len); ++ buf->used += insert_len; ++ buf->free -= insert_len; ++ return insert_len; ++} ++ ++PHPSTR_API size_t phpstr_insertf(phpstr *buf, size_t offset, const char *format, ...) ++{ ++ va_list argv; ++ char *insert; ++ size_t insert_len, alloc; ++ ++ va_start(argv, format); ++ insert_len = vspprintf(&insert, 0, format, argv); ++ va_end(argv); ++ ++ alloc = phpstr_insert(buf, insert, insert_len, offset); ++ efree(insert); ++ ++ if (PHPSTR_NOMEM == alloc) { ++ return PHPSTR_NOMEM; ++ } ++ return insert_len; ++} ++ ++PHPSTR_API size_t phpstr_prepend(phpstr *buf, const char *prepend, size_t prepend_len) ++{ ++ if (PHPSTR_NOMEM == phpstr_resize(buf, prepend_len)) { ++ return PHPSTR_NOMEM; ++ } ++ memmove(buf->data + prepend_len, buf->data, buf->used); ++ memcpy(buf->data, prepend, prepend_len); ++ buf->used += prepend_len; ++ buf->free -= prepend_len; ++ return prepend_len; ++} ++ ++PHPSTR_API size_t phpstr_prependf(phpstr *buf, const char *format, ...) ++{ ++ va_list argv; ++ char *prepend; ++ size_t prepend_len, alloc; ++ ++ va_start(argv, format); ++ prepend_len = vspprintf(&prepend, 0, format, argv); ++ va_end(argv); ++ ++ alloc = phpstr_prepend(buf, prepend, prepend_len); ++ efree(prepend); ++ ++ if (PHPSTR_NOMEM == alloc) { ++ return PHPSTR_NOMEM; ++ } ++ return prepend_len; ++} ++ ++PHPSTR_API char *phpstr_data(const phpstr *buf, char **into, size_t *len) ++{ ++ char *copy = ecalloc(1, buf->used + 1); ++ memcpy(copy, buf->data, buf->used); ++ if (into) { ++ *into = copy; ++ } ++ if (len) { ++ *len = buf->used; ++ } ++ return copy; ++} ++ ++PHPSTR_API phpstr *phpstr_dup(const phpstr *buf) ++{ ++ phpstr *dup = phpstr_clone(buf); ++ if (PHPSTR_NOMEM == phpstr_append(dup, buf->data, buf->used)) { ++ phpstr_free(&dup); ++ } ++ return dup; ++} ++ ++PHPSTR_API size_t phpstr_cut(phpstr *buf, size_t offset, size_t length) ++{ ++ if (offset >= buf->used) { ++ return 0; ++ } ++ if (offset + length > buf->used) { ++ length = buf->used - offset; ++ } ++ memmove(buf->data + offset, buf->data + offset + length, buf->used - length); ++ buf->used -= length; ++ buf->free += length; ++ return length; ++} ++ ++PHPSTR_API phpstr *phpstr_sub(const phpstr *buf, size_t offset, size_t length) ++{ ++ if (offset >= buf->used) { ++ return NULL; ++ } else { ++ size_t need = 1 + ((length + offset) > buf->used ? (buf->used - offset) : (length - offset)); ++ phpstr *sub = phpstr_init_ex(NULL, need, PHPSTR_INIT_PREALLOC | (buf->pmem ? PHPSTR_INIT_PERSISTENT:0)); ++ if (sub) { ++ if (PHPSTR_NOMEM == phpstr_append(sub, buf->data + offset, need)) { ++ phpstr_free(&sub); ++ } else { ++ sub->size = buf->size; ++ } ++ } ++ return sub; ++ } ++} ++ ++PHPSTR_API phpstr *phpstr_right(const phpstr *buf, size_t length) ++{ ++ if (length < buf->used) { ++ return phpstr_sub(buf, buf->used - length, length); ++ } else { ++ return phpstr_sub(buf, 0, buf->used); ++ } ++} ++ ++ ++PHPSTR_API phpstr *phpstr_merge_va(phpstr *buf, unsigned argc, va_list argv) ++{ ++ unsigned i = 0; ++ buf = phpstr_init(buf); ++ ++ if (buf) { ++ while (argc > i++) { ++ phpstr_free_t f = va_arg(argv, phpstr_free_t); ++ phpstr *current = va_arg(argv, phpstr *); ++ phpstr_append(buf, current->data, current->used); ++ FREE_PHPSTR(f, current); ++ } ++ } ++ ++ return buf; ++} ++ ++PHPSTR_API phpstr *phpstr_merge_ex(phpstr *buf, unsigned argc, ...) ++{ ++ va_list argv; ++ phpstr *ret; ++ ++ va_start(argv, argc); ++ ret = phpstr_merge_va(buf, argc, argv); ++ va_end(argv); ++ return ret; ++} ++ ++PHPSTR_API phpstr *phpstr_merge(unsigned argc, ...) ++{ ++ va_list argv; ++ phpstr *ret; ++ ++ va_start(argv, argc); ++ ret = phpstr_merge_va(NULL, argc, argv); ++ va_end(argv); ++ return ret; ++} ++ ++PHPSTR_API phpstr *phpstr_fix(phpstr *buf) ++{ ++ if (PHPSTR_NOMEM == phpstr_resize_ex(buf, 1, 1, 0)) { ++ return NULL; ++ } ++ buf->data[buf->used] = '\0'; ++ return buf; ++} ++ ++PHPSTR_API int phpstr_cmp(phpstr *left, phpstr *right) ++{ ++ if (left->used > right->used) { ++ return -1; ++ } else if (right->used > left->used) { ++ return 1; ++ } else { ++ return memcmp(left->data, right->data, left->used); ++ } ++} ++ ++PHPSTR_API void phpstr_reset(phpstr *buf) ++{ ++ buf->free += buf->used; ++ buf->used = 0; ++} ++ ++PHPSTR_API void phpstr_dtor(phpstr *buf) ++{ ++ if (buf->data) { ++ pefree(buf->data, buf->pmem); ++ buf->data = NULL; ++ } ++ buf->used = 0; ++ buf->free = 0; ++} ++ ++PHPSTR_API void phpstr_free(phpstr **buf) ++{ ++ if (*buf) { ++ phpstr_dtor(*buf); ++ pefree(*buf, (*buf)->pmem); ++ *buf = NULL; ++ } ++} ++ ++PHPSTR_API size_t phpstr_chunk_buffer(phpstr **s, const char *data, size_t data_len, char **chunk, size_t chunk_size) ++{ ++ phpstr *storage; ++ ++ *chunk = NULL; ++ ++ if (!*s) { ++ *s = phpstr_init_ex(NULL, chunk_size << 1, chunk_size ? PHPSTR_INIT_PREALLOC : 0); ++ } ++ storage = *s; ++ ++ if (data_len) { ++ phpstr_append(storage, data, data_len); ++ } ++ ++ if (!chunk_size) { ++ phpstr_data(storage, chunk, &chunk_size); ++ phpstr_free(s); ++ return chunk_size; ++ } ++ ++ if (storage->used >= (chunk_size = storage->size >> 1)) { ++ *chunk = estrndup(storage->data, chunk_size); ++ phpstr_cut(storage, 0, chunk_size); ++ return chunk_size; ++ } ++ ++ return 0; ++} ++ ++PHPSTR_API void phpstr_chunked_output(phpstr **s, const char *data, size_t data_len, size_t chunk_len, phpstr_passthru_func passthru, void *opaque TSRMLS_DC) ++{ ++ char *chunk = NULL; ++ size_t got = 0; ++ ++ while ((got = phpstr_chunk_buffer(s, data, data_len, &chunk, chunk_len))) { ++ passthru(opaque, chunk, got TSRMLS_CC); ++ if (!chunk_len) { ++ /* we already got the last chunk, ++ and freed all resources */ ++ break; ++ } ++ data = NULL; ++ data_len = 0; ++ STR_SET(chunk, NULL); ++ } ++ STR_FREE(chunk); ++} ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: sw=4 ts=4 fdm=marker ++ * vim<600: sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/phpstr/phpstr.h +@@ -0,0 +1,224 @@ ++ ++/* $Id: phpstr.h 229282 2007-02-07 15:31:50Z mike $ */ ++ ++#ifndef _PHPSTR_H_ ++#define _PHPSTR_H_ ++ ++#ifndef PHPSTR_DEFAULT_SIZE ++# define PHPSTR_DEFAULT_SIZE 256 ++#endif ++ ++#define PHPSTR_NOMEM ((size_t) -1) ++ ++#ifndef STR_FREE ++# define STR_FREE(STR) \ ++ { \ ++ if (STR) { \ ++ efree(STR); \ ++ } \ ++ } ++#endif ++#ifndef STR_SET ++# define STR_SET(STR, SET) \ ++ { \ ++ STR_FREE(STR); \ ++ STR = SET; \ ++ } ++#endif ++#ifndef TSRMLS_D ++# define TSRMLS_D ++# define TSRMLS_DC ++# define TSRMLS_CC ++# define TSRMLS_C ++#endif ++#ifdef PHP_ATTRIBUTE_FORMAT ++# define PHPSTR_ATTRIBUTE_FORMAT(f, a, b) PHP_ATTRIBUTE_FORMAT(f, a, b) ++#else ++# define PHPSTR_ATTRIBUTE_FORMAT(f, a, b) ++#endif ++#ifndef pemalloc ++# define pemalloc(s,p) malloc(s) ++# define pefree(x,p) free(x) ++# define perealloc(x,s,p) realloc(x,s) ++# define perealloc_recoverable perealloc ++# define ecalloc calloc ++static inline void *estrndup(void *p, size_t s) ++{ ++ char *r = (char *) malloc(s+1); ++ if (r) memcpy((void *) r, p, s), r[s] = '\0'; ++ return (void *) r; ++} ++#endif ++ ++#if defined(PHP_WIN32) ++# if defined(PHPSTR_EXPORTS) ++# define PHPSTR_API __declspec(dllexport) ++# elif defined(COMPILE_DL_PHPSTR) ++# define PHPSTR_API __declspec(dllimport) ++# else ++# define PHPSTR_API ++# endif ++#else ++# define PHPSTR_API ++#endif ++ ++#define PHPSTR(p) ((phpstr *) (p)) ++#define PHPSTR_VAL(p) (PHPSTR(p))->data ++#define PHPSTR_LEN(p) (PHPSTR(p))->used ++ ++#define FREE_PHPSTR_PTR(STR) pefree(STR, STR->pmem) ++#define FREE_PHPSTR_VAL(STR) phpstr_dtor(STR) ++#define FREE_PHPSTR_ALL(STR) phpstr_free(&(STR)) ++#define FREE_PHPSTR(free, STR) \ ++ switch (free) \ ++ { \ ++ case PHPSTR_FREE_NOT: break; \ ++ case PHPSTR_FREE_PTR: pefree(STR, STR->pmem); break; \ ++ case PHPSTR_FREE_VAL: phpstr_dtor(STR); break; \ ++ case PHPSTR_FREE_ALL: \ ++ { \ ++ phpstr *PTR = (STR); \ ++ phpstr_free(&PTR); \ ++ } \ ++ break; \ ++ default: break; \ ++ } ++ ++#define RETURN_PHPSTR_PTR(STR) RETURN_PHPSTR((STR), PHPSTR_FREE_PTR, 0) ++#define RETURN_PHPSTR_VAL(STR) RETURN_PHPSTR((STR), PHPSTR_FREE_NOT, 0) ++#define RETURN_PHPSTR_DUP(STR) RETURN_PHPSTR((STR), PHPSTR_FREE_NOT, 1) ++#define RETVAL_PHPSTR_PTR(STR) RETVAL_PHPSTR((STR), PHPSTR_FREE_PTR, 0) ++#define RETVAL_PHPSTR_VAL(STR) RETVAL_PHPSTR((STR), PHPSTR_FREE_NOT, 0) ++#define RETVAL_PHPSTR_DUP(STR) RETVAL_PHPSTR((STR), PHPSTR_FREE_NOT, 1) ++/* RETURN_PHPSTR(buf, PHPSTR_FREE_PTR, 0) */ ++#define RETURN_PHPSTR(STR, free, dup) \ ++ RETVAL_PHPSTR((STR), (free), (dup)); \ ++ return; ++ ++#define RETVAL_PHPSTR(STR, free, dup) \ ++ phpstr_fix(STR); \ ++ RETVAL_STRINGL((STR)->data, (STR)->used, (dup)); \ ++ FREE_PHPSTR((free), (STR)); ++ ++typedef struct _phpstr_t { ++ char *data; ++ size_t used; ++ size_t free; ++ size_t size; ++ unsigned pmem:1; ++ unsigned reserved:31; ++} phpstr; ++ ++typedef enum _phpstr_free_t { ++ PHPSTR_FREE_NOT = 0, ++ PHPSTR_FREE_PTR, /* pefree() */ ++ PHPSTR_FREE_VAL, /* phpstr_dtor() */ ++ PHPSTR_FREE_ALL /* phpstr_free() */ ++} phpstr_free_t; ++ ++#define PHPSTR_ALL_FREE(STR) PHPSTR_FREE_ALL,(STR) ++#define PHPSTR_PTR_FREE(STR) PHPSTR_FREE_PTR,(STR) ++#define PHPSTR_VAL_FREE(STR) PHPSTR_FREE_VAL,(STR) ++#define PHPSTR_NOT_FREE(STR) PHPSTR_FREE_NOT,(STR) ++ ++#define PHPSTR_INIT_PREALLOC 0x01 ++#define PHPSTR_INIT_PERSISTENT 0x02 ++ ++/* create a new phpstr */ ++#define phpstr_new() phpstr_init(NULL) ++#define phpstr_init(b) phpstr_init_ex(b, PHPSTR_DEFAULT_SIZE, 0) ++#define phpstr_clone(phpstr_pointer) phpstr_init_ex(NULL, (phpstr_pointer)->size, (phpstr_pointer)->pmem ? PHPSTR_INIT_PERSISTENT:0) ++PHPSTR_API phpstr *phpstr_init_ex(phpstr *buf, size_t chunk_size, int flags); ++ ++/* create a phpstr from a zval or c-string */ ++#define phpstr_from_zval(z) phpstr_from_string(Z_STRVAL(z), Z_STRLEN(z)) ++#define phpstr_from_zval_ex(b, z) phpstr_from_string_ex(b, Z_STRVAL(z), Z_STRLEN(z)) ++#define phpstr_from_string(s, l) phpstr_from_string_ex(NULL, (s), (l)) ++PHPSTR_API phpstr *phpstr_from_string_ex(phpstr *buf, const char *string, size_t length); ++ ++/* usually only called from within the internal functions */ ++#define phpstr_resize(b, s) phpstr_resize_ex((b), (s), 0, 0) ++PHPSTR_API size_t phpstr_resize_ex(phpstr *buf, size_t len, size_t override_size, int allow_error); ++ ++/* shrink memory chunk to actually used size (+1) */ ++PHPSTR_API size_t phpstr_shrink(phpstr *buf); ++ ++/* append data to the phpstr */ ++#define phpstr_appends(b, a) phpstr_append((b), (a), sizeof(a)-1) ++#define phpstr_appendl(b, a) phpstr_append((b), (a), strlen(a)) ++PHPSTR_API size_t phpstr_append(phpstr *buf, const char *append, size_t append_len); ++PHPSTR_API size_t phpstr_appendf(phpstr *buf, const char *format, ...) PHPSTR_ATTRIBUTE_FORMAT(printf, 2, 3); ++ ++/* insert data at a specific position of the phpstr */ ++#define phpstr_inserts(b, i, o) phpstr_insert((b), (i), sizeof(i)-1, (o)) ++#define phpstr_insertl(b, i, o) phpstr_insert((b), (i), strlen(i), (o)) ++PHPSTR_API size_t phpstr_insert(phpstr *buf, const char *insert, size_t insert_len, size_t offset); ++PHPSTR_API size_t phpstr_insertf(phpstr *buf, size_t offset, const char *format, ...) PHPSTR_ATTRIBUTE_FORMAT(printf, 3, 4); ++ ++/* prepend data */ ++#define phpstr_prepends(b, p) phpstr_prepend((b), (p), sizeof(p)-1) ++#define phpstr_prependl(b, p) phpstr_prepend((b), (p), strlen(p)) ++PHPSTR_API size_t phpstr_prepend(phpstr *buf, const char *prepend, size_t prepend_len); ++PHPSTR_API size_t phpstr_prependf(phpstr *buf, const char *format, ...) PHPSTR_ATTRIBUTE_FORMAT(printf, 2, 3); ++ ++/* get a zero-terminated string */ ++PHPSTR_API char *phpstr_data(const phpstr *buf, char **into, size_t *len); ++ ++/* get a part of the phpstr */ ++#define phpstr_mid(b, o, l) phpstr_sub((b), (o), (l)) ++#define phpstr_left(b, l) phpstr_sub((b), 0, (l)) ++PHPSTR_API phpstr *phpstr_right(const phpstr *buf, size_t length); ++PHPSTR_API phpstr *phpstr_sub(const phpstr *buf, size_t offset, size_t len); ++ ++/* remove a substring */ ++PHPSTR_API size_t phpstr_cut(phpstr *buf, size_t offset, size_t length); ++ ++/* get a complete phpstr duplicate */ ++PHPSTR_API phpstr *phpstr_dup(const phpstr *buf); ++ ++/* merge several phpstr objects ++ use like: ++ ++ phpstr *final = phpstr_merge(3, ++ PHPSTR_NOT_FREE(&keep), ++ PHPSTR_ALL_FREE(middle_ptr), ++ PHPSTR_VAL_FREE(&local); ++*/ ++PHPSTR_API phpstr *phpstr_merge(unsigned argc, ...); ++PHPSTR_API phpstr *phpstr_merge_ex(phpstr *buf, unsigned argc, ...); ++PHPSTR_API phpstr *phpstr_merge_va(phpstr *buf, unsigned argc, va_list argv); ++ ++/* sets a trailing NUL byte */ ++PHPSTR_API phpstr *phpstr_fix(phpstr *buf); ++ ++/* memcmp for phpstr objects */ ++PHPSTR_API int phpstr_cmp(phpstr *left, phpstr *right); ++ ++/* reset phpstr object */ ++PHPSTR_API void phpstr_reset(phpstr *buf); ++ ++/* free a phpstr objects contents */ ++PHPSTR_API void phpstr_dtor(phpstr *buf); ++ ++/* free a phpstr object completely */ ++PHPSTR_API void phpstr_free(phpstr **buf); ++ ++/* stores data in a phpstr until it reaches chunk_size */ ++PHPSTR_API size_t phpstr_chunk_buffer(phpstr **s, const char *data, size_t data_len, char **chunk, size_t chunk_size); ++ ++typedef void (*phpstr_passthru_func)(void *opaque, const char *, size_t TSRMLS_DC); ++ ++/* wrapper around phpstr_chunk_buffer, which passes available chunks to passthru() */ ++PHPSTR_API void phpstr_chunked_output(phpstr **s, const char *data, size_t data_len, size_t chunk_size, phpstr_passthru_func passthru, void *opaque TSRMLS_DC); ++ ++#endif ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: sw=4 ts=4 fdm=marker ++ * vim<600: sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/tests/HttpMessage_001.phpt +@@ -0,0 +1,70 @@ ++--TEST-- ++HttpMessage ++--SKIPIF-- ++ ++--FILE-- ++getResponseStatus()); ++ ++$x = $m->getParentMessage(); ++$x = $m->getParentMessage(); ++$x = $m->getParentMessage(); ++ ++var_dump($m->getBody()); ++var_dump(HttpMessage::fromString($m->toString(true))->toString(true)); ++try { ++ do { ++ var_dump($m->toString()); ++ } while ($m = $m->getParentMessage()); ++} catch (HttpException $ex) { ++} ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++string(15) "Partial content" ++string(1) "X" ++string(190) "HTTP/1.1 301 ++Location: /anywhere ++HTTP/1.1 302 ++Location: /somewhere ++HTTP/1.1 206 Partial content ++Content-Range: bytes=2-3 ++X-Original-Transfer-Encoding: chunked ++Content-Length: 1 ++ ++X ++" ++string(119) "HTTP/1.1 206 Partial content ++Content-Range: bytes=2-3 ++X-Original-Transfer-Encoding: chunked ++Content-Length: 1 ++ ++X ++" ++string(36) "HTTP/1.1 302 ++Location: /somewhere ++" ++string(35) "HTTP/1.1 301 ++Location: /anywhere ++" ++Done +--- /dev/null ++++ b/ext/http/tests/HttpMessage_002.phpt +@@ -0,0 +1,65 @@ ++--TEST-- ++HttpMessage properties ++--SKIPIF-- ++ ++--FILE-- ++var_property); ++ var_dump($this->public_property); ++ var_dump($this->protected_property); ++ var_dump($this->private_property); ++ var_dump($this->non_ex_property); ++ $this->var_property.='_property'; ++ $this->public_property.='_property'; ++ $this->protected_property.='_property'; ++ $this->private_property.='_property'; ++ $this->non_ex_property = 'non_ex'; ++ var_dump($this->var_property); ++ var_dump($this->public_property); ++ var_dump($this->protected_property); ++ var_dump($this->private_property); ++ var_dump($this->non_ex_property); ++ ++ print_r($this->headers); ++ $this->headers['Foo'] = 'Bar'; ++ } ++} ++ ++error_reporting(E_ALL|E_STRICT); ++ ++echo "-TEST\n"; ++$m = new Message; ++$m->test(); ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++string(3) "var" ++string(6) "public" ++string(9) "protected" ++string(7) "private" ++ ++Notice: Undefined property: Message::$non_ex_property in %s ++NULL ++string(12) "var_property" ++string(15) "public_property" ++string(18) "protected_property" ++string(16) "private_property" ++string(6) "non_ex" ++Array ++( ++) ++%aFatal error%sCannot access HttpMessage properties by reference or array key/index in%s +--- /dev/null ++++ b/ext/http/tests/HttpMessage_003.phpt +@@ -0,0 +1,70 @@ ++--TEST-- ++HttpMessage implements Serializable, Countable ++--SKIPIF-- ++ ++--FILE-- ++count()); ++var_dump($m->serialize()); ++$m->unserialize("HTTP/1.1 200 Ok\r\nServer: Funky/1.0"); ++var_dump($m); ++var_dump($m->count()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++int(3) ++string(148) "HTTP/1.1 301 ++Location: /anywhere ++HTTP/1.1 302 ++Location: /somewhere ++HTTP/1.1 200 ++X-Original-Transfer-Encoding: chunked ++Content-Length: 1 ++ ++X ++" ++object(HttpMessage)#%d (%d) { ++ ["type%s]=> ++ int(2) ++ ["body%s]=> ++ string(0) "" ++ ["requestMethod%s]=> ++ string(0) "" ++ ["requestUrl%s]=> ++ string(0) "" ++ ["responseStatus%s]=> ++ string(2) "Ok" ++ ["responseCode%s]=> ++ int(200) ++ ["httpVersion%s]=> ++ float(1.1) ++ ["headers%s]=> ++ array(1) { ++ ["Server"]=> ++ string(9) "Funky/1.0" ++ } ++ ["parentMessage%s]=> ++ NULL ++} ++int(1) ++Done +--- /dev/null ++++ b/ext/http/tests/HttpMessage_004.phpt +@@ -0,0 +1,36 @@ ++--TEST-- ++HttpMessage::detach() ++--SKIPIF-- ++ ++--FILE-- ++detach(); ++$d->addHeaders(array('Server'=>'Funky/2.0')); ++var_dump($d->getHeaders() == $m->getHeaders()); ++var_dump($d->getBody()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++bool(false) ++string(3) "Hi!" ++Done +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/HttpMessage_005.phpt +@@ -0,0 +1,86 @@ ++--TEST-- ++HttpMessage::prepend() ++--SKIPIF-- ++ ++--FILE-- ++prepend($m2); ++$m2 = NULL; ++echo $m1->toString(true); ++ ++$m1->prepend($m1->detach(), false); ++echo $m1->toString(true); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++GET http://example.com/ HTTP/1.0 ++HTTP/1.1 200 ok ++Server: Funky/2.0 ++Content-Type: text/html ++Content-Length: 9 ++ ++Hi there! ++GET / HTTP/1.1 ++Host: example.com ++Accept: */* ++Connection: close ++HTTP/1.1 200 ok ++Server: Funky/1.0 ++Content-Type: text/plain ++Content-Length: 3 ++ ++Hi! ++GET http://example.com/ HTTP/1.0 ++HTTP/1.1 200 ok ++Server: Funky/2.0 ++Content-Type: text/html ++Content-Length: 9 ++ ++Hi there! ++GET / HTTP/1.1 ++Host: example.com ++Accept: */* ++Connection: close ++HTTP/1.1 200 ok ++Server: Funky/1.0 ++Content-Type: text/plain ++Content-Length: 3 ++ ++Hi! ++HTTP/1.1 200 ok ++Server: Funky/1.0 ++Content-Type: text/plain ++Content-Length: 3 ++ ++Hi! ++Done +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/HttpMessage_006.phpt +@@ -0,0 +1,35 @@ ++--TEST-- ++HttpMessage iterator ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++== ++HTTP/1.1 304 Not Modified ++== ++GET /foo HTTP/1.1 ++== ++HTTP/1.1 200 OK ++== ++GET / HTTP/1.1 ++Done +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/HttpMessage_007.phpt +@@ -0,0 +1,46 @@ ++--TEST-- ++HttpMessage::reverse() ++--SKIPIF-- ++ ++--FILE-- ++toString(true); ++echo "===\n"; ++echo HttpMessage::fromString($s)->reverse()->toString(true); ++ ++$m = new HttpMessage($s); ++$r = $m->reverse(); ++unset($m); ++var_dump($r->count()); ++echo $r->toString(true); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++GET /first HTTP/1.1 ++HTTP/1.1 200 Ok-first ++GET /second HTTP/1.1 ++HTTP/1.1 200 Ok-second ++GET /third HTTP/1.1 ++HTTP/1.1 200 Ok-third ++=== ++HTTP/1.1 200 Ok-third ++GET /third HTTP/1.1 ++HTTP/1.1 200 Ok-second ++GET /second HTTP/1.1 ++HTTP/1.1 200 Ok-first ++GET /first HTTP/1.1 ++int(6) ++HTTP/1.1 200 Ok-third ++GET /third HTTP/1.1 ++HTTP/1.1 200 Ok-second ++GET /second HTTP/1.1 ++HTTP/1.1 200 Ok-first ++GET /first HTTP/1.1 ++Done +--- /dev/null ++++ b/ext/http/tests/HttpMessage_008.phpt +@@ -0,0 +1,41 @@ ++--TEST-- ++HttpMessage::toMessageTypeObject() ++--SKIPIF-- ++ ++--FILE-- ++"b",1=>2),null); ++ ++$m = new HttpMessage; ++$m->setType(HttpMessage::TYPE_REQUEST); ++$m->setRequestMethod('POST'); ++$m->setRequestUrl("http://www.example.com"); ++$m->setHttpVersion('1.1'); ++$m->addHeaders( ++ array( ++ "Content-Type" => "application/x-www-form-urlencoded", ++ "Host" => "www.example.com", ++ "Content-Length"=> strlen($b), ++ ) ++); ++$m->setBody($b); ++$r = $m->toMessageTypeObject(); ++echo $m,"\n"; ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++POST http://www.example.com HTTP/1.1 ++Content-Type: application/x-www-form-urlencoded ++Host: www.example.com ++Content-Length: 7 ++ ++a=b&1=2 ++ ++Done +--- /dev/null ++++ b/ext/http/tests/HttpMessage_009_bug16700.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++Bug #16700 - child classes of HttpMessage cannot not have array properties ++--SKIPIF-- ++ ++--FILE-- ++properties['foo'] = 'bar'; ++echo $child->properties['foo'], "\n"; ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++bar ++Done +--- /dev/null ++++ b/ext/http/tests/HttpQueryString_001.phpt +@@ -0,0 +1,116 @@ ++--TEST-- ++HttpQueryString global ++--SKIPIF-- ++ ++--FILE-- ++'b','c'=>'3.4','r'=>array(1,2,3)); ++$_SERVER['QUERY_STRING'] = 'a=b&c=3.4&r[0]=1&r[1]=2&r[2]=3'; ++ ++var_dump(HttpQueryString::singleton()->get()); ++var_dump(HttpQueryString::singleton()->get('n')); ++var_dump(HttpQueryString::singleton()->get('a')); ++var_dump(HttpQueryString::singleton()->get('a', "i", 0, true)); ++var_dump(HttpQueryString::singleton()->get('a', "string", 'hi!')); ++var_dump(HttpQueryString::singleton()->get('c')); ++var_dump(HttpQueryString::singleton()->get('c', HttpQueryString::TYPE_INT)); ++var_dump(HttpQueryString::singleton()->get('c', HttpQueryString::TYPE_FLOAT)); ++var_dump(HttpQueryString::singleton()->get('c', HttpQueryString::TYPE_BOOL)); ++var_dump(HttpQueryString::singleton()->get('r')); ++var_dump(HttpQueryString::singleton()->get('r', HttpQueryString::TYPE_ARRAY)); ++var_dump(HttpQueryString::singleton()->get('r', HttpQueryString::TYPE_OBJECT)); ++ ++HttpQueryString::singleton()->set(new HttpQueryString(false, 'z[0]=2')); ++ ++HttpQueryString::singleton()->set(array('a'=>'b', 'c'=> "3.4")); ++HttpQueryString::singleton()->set(array('a' => NULL)); ++ ++var_dump(HttpQueryString::singleton()); ++var_dump($_GET); ++var_dump($_SERVER['QUERY_STRING']); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++string(42) "a=b&c=3.4&r%5B0%5D=1&r%5B1%5D=2&r%5B2%5D=3" ++NULL ++string(1) "b" ++int(0) ++string(3) "hi!" ++string(3) "3.4" ++int(3) ++float(3.4) ++bool(true) ++array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++} ++array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++} ++object(stdClass)#%d (%d) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++} ++object(HttpQueryString)#1 (2) { ++ ["queryArray%s]=> ++ &array(3) { ++ ["c"]=> ++ string(3) "3.4" ++ ["r"]=> ++ array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++ } ++ ["z"]=> ++ array(1) { ++ [0]=> ++ string(1) "2" ++ } ++ } ++ ["queryString%s]=> ++ &string(49) "c=3.4&r%5B0%5D=1&r%5B1%5D=2&r%5B2%5D=3&z%5B0%5D=2" ++} ++array(3) { ++ ["c"]=> ++ string(3) "3.4" ++ ["r"]=> ++ array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++ } ++ ["z"]=> ++ array(1) { ++ [0]=> ++ string(1) "2" ++ } ++} ++string(49) "c=3.4&r%5B0%5D=1&r%5B1%5D=2&r%5B2%5D=3&z%5B0%5D=2" ++Done +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/HttpQueryString_002.phpt +@@ -0,0 +1,108 @@ ++--TEST-- ++HttpQueryString local ++--SKIPIF-- ++ ++--FILE-- ++'b','c'=>'3.4','r'=>array(1,2,3))); ++var_dump($q->get()); ++var_dump($q->get('n')); ++var_dump($q->get('a')); ++var_dump($q->get('a', "i", 0, true)); ++var_dump($q->get('a', "string", 'hi!')); ++var_dump($q->get('c')); ++var_dump($q->get('c', HttpQueryString::TYPE_INT)); ++var_dump($q->get('c', HttpQueryString::TYPE_FLOAT)); ++var_dump($q->get('c', HttpQueryString::TYPE_BOOL)); ++var_dump($q->get('r')); ++var_dump($q->get('r', HttpQueryString::TYPE_ARRAY)); ++var_dump($q->get('r', HttpQueryString::TYPE_OBJECT)); ++ ++$q->set('z[0]=2'); ++$q->set(array('a'=>'b', 'c'=> "3.4")); ++$q->set(array('a' => NULL)); ++ ++var_dump($q); ++var_dump($array); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++string(42) "a=b&c=3.4&r%5B0%5D=1&r%5B1%5D=2&r%5B2%5D=3" ++NULL ++string(1) "b" ++int(0) ++string(3) "hi!" ++string(3) "3.4" ++int(3) ++float(3.4) ++bool(true) ++array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++} ++array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++} ++object(stdClass)#%d (%d) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++} ++object(HttpQueryString)#1 (2) { ++ ["queryArray%s]=> ++ array(3) { ++ ["c"]=> ++ string(3) "3.4" ++ ["r"]=> ++ array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++ } ++ ["z"]=> ++ array(1) { ++ [0]=> ++ string(1) "2" ++ } ++ } ++ ["queryString%s]=> ++ string(49) "c=3.4&r%5B0%5D=1&r%5B1%5D=2&r%5B2%5D=3&z%5B0%5D=2" ++} ++array(3) { ++ ["a"]=> ++ string(1) "b" ++ ["c"]=> ++ string(3) "3.4" ++ ["r"]=> ++ array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++ } ++} ++Done +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/HttpQueryString_003.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++HttpQueryString xlate ++--SKIPIF-- ++ ++--FILE-- ++get()); ++$qs->xlate("latin1", "utf8"); ++var_dump($qs->get()); ++$qs->xlate("utf8", "latin1"); ++var_dump($qs->get()); ++echo "Done\n"; ++--EXPECTF-- ++%aTEST ++string(29) "%E4%5B0%5D=%FC&%F6%5Ba%5D=%DF" ++string(41) "%C3%A4%5B0%5D=%C3%BC&%C3%B6%5Ba%5D=%C3%9F" ++string(29) "%E4%5B0%5D=%FC&%F6%5Ba%5D=%DF" ++Done +--- /dev/null ++++ b/ext/http/tests/HttpQueryString_004.phpt +@@ -0,0 +1,54 @@ ++--TEST-- ++HttpQueryString w/ objects ++--SKIPIF-- ++ ++--FILE-- ++bar = (object) array("baz"=>1); ++ $this->dont_show = 'xxx'; ++ $this->dont_show2 = 'zzz'; ++ } ++} ++$foo = new test_props; ++var_dump($q = new HttpQueryString(false, $foo)); ++$foo->bar->baz = 0; ++var_dump($q->mod($foo)); ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++object(HttpQueryString)#3 (2) { ++ ["queryArray%s]=> ++ array(1) { ++ ["bar"]=> ++ array(1) { ++ ["baz"]=> ++ int(1) ++ } ++ } ++ ["queryString%s]=> ++ string(14) "bar%5Bbaz%5D=1" ++} ++object(HttpQueryString)#4 (2) { ++ ["queryArray%s]=> ++ array(1) { ++ ["bar"]=> ++ array(1) { ++ ["baz"]=> ++ int(0) ++ } ++ } ++ ["queryString%s]=> ++ string(14) "bar%5Bbaz%5D=0" ++} ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequestDataShare_001.phpt +@@ -0,0 +1,38 @@ ++--TEST-- ++HttpRequestDataShare ++--SKIPIF-- ++ ++--FILE-- ++dns = true; ++$s->cookie = true; ++ ++$r1 = new HttpRequest("http://www.google.com/"); ++$r2 = new HttpRequest("http://www.google.com/"); ++ ++$r1->enableCookies(); ++$r2->enableCookies(); ++ ++$s->attach($r1); ++$s->attach($r2); ++ ++$r1->send(); ++$r2->send(); ++ ++$s->reset(); ++ ++var_dump(current($r1->getResponseCookies())->cookies["PREF"] === HttpUtil::parseCookie($r2->getRequestMessage()->getHeader("Cookie"))->cookies["PREF"]); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++bool(true) ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequestDataShare_002.phpt +@@ -0,0 +1,52 @@ ++--TEST-- ++HttpRequestDataShare global ++--SKIPIF-- ++ ++--FILE-- ++cookie = true; ++var_dump($s); ++ ++$r1 = new HttpRequest("http://www.google.com/"); ++$r2 = new HttpRequest("http://www.google.com/"); ++ ++$r1->enableCookies(); ++$r2->enableCookies(); ++ ++$s->attach($r1); ++$s->attach($r2); ++ ++$r1->send(); ++$r2->send(); ++ ++$s->reset(); ++ ++if (current($r1->getResponseCookies())->cookies["PREF"] !== HttpUtil::parseCookie($r2->getRequestMessage()->getHeader("Cookie"))->cookies["PREF"]) { ++ var_dump( ++ current($r1->getResponseCookies())->cookies["PREF"], ++ HttpUtil::parseCookie($r2->getRequestMessage()->getHeader("Cookie"))->cookies["PREF"] ++ ); ++} ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++object(HttpRequestDataShare)#1 (4) { ++ ["cookie"]=> ++ bool(true) ++ ["dns"]=> ++ bool(true) ++ ["ssl"]=> ++ bool(false) ++ ["connect"]=> ++ bool(false) ++} ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequestPool_001.phpt +@@ -0,0 +1,51 @@ ++--TEST-- ++HttpRequestPool ++--SKIPIF-- ++ ++--FILE-- ++addPostFields(array('a'=>1,'b'=>2)) ; ++ ++$pool = new HttpRequestPool( ++ new HttpRequest('http://www.php.net/', HTTP_METH_HEAD), ++ $post ++); ++ ++$pool->send(); ++ ++foreach ($pool as $req) { ++ echo $req->getUrl(), '=', ++ $req->getResponseCode(), ':', ++ $req->getResponseMessage()->getResponseCode(), "\n"; ++} ++ ++foreach ($pool as $req) { ++ try { ++ $pool->attach(new HttpRequest('http://foo.bar')); ++ } catch (HttpRequestPoolException $x) { ++ echo ".\n"; ++ } ++} ++ ++foreach ($pool as $req) { ++ $pool->detach($req); ++} ++ ++echo "Done\n"; ++?> ++ ++--EXPECTF-- ++%aTEST ++http://www.php.net/=200:200 ++http://dev.iworks.at/ext-http/.print_request.php=200:200 ++. ++. ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequestPool_002.phpt +@@ -0,0 +1,51 @@ ++--TEST-- ++extending HttpRequestPool ++--SKIPIF-- ++ ++--FILE-- ++socketPerform()) { ++ if (!$this->socketSelect()) { ++ throw new HttpSocketException; ++ } ++ } ++ } ++ ++ protected final function socketPerform() ++ { ++ $result = parent::socketPerform(); ++ ++ echo "."; ++ foreach ($this->getFinishedRequests() as $r) { ++ echo "=", $r->getResponseCode(), "="; ++ $this->detach($r); ++ } ++ ++ return $result; ++ } ++} ++ ++$pool = new MyPool( ++ new HttpRequest('http://www.php.net/', HTTP_METH_HEAD), ++ new HttpRequest('http://www.php.net/', HTTP_METH_HEAD), ++ new HttpRequest('http://www.php.net/', HTTP_METH_HEAD) ++); ++ ++$pool->send(); ++ ++echo "\nDone\n"; ++?> ++--EXPECTREGEX-- ++.+TEST ++\.*=200=\.*=200=\.*=200= ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequestPool_003.phpt +@@ -0,0 +1,175 @@ ++--TEST-- ++HttpRequestPool chain ++--SKIPIF-- ++ ++--FILE-- ++dir = (is_dir($cache_dir) or @mkdir($cache_dir)) ? $cache_dir : null; ++ ++ foreach (array_map('trim', file($urls_file)) as $url) { ++ $this->all[$url] = $this->dir ? $this->dir .'/'. md5($url) : null; ++ } ++ ++ $this->send(); ++ } ++ ++ public final function send() ++ { ++ if (RMAX) { ++ $now = array_slice($this->all, 0, RMAX); ++ $this->rem = array_slice($this->all, RMAX); ++ } else { ++ $now = $urls; ++ $this->rem = array(); ++ } ++ ++ foreach ($now as $url => $file) { ++ $this->attach( ++ new HttpRequest( ++ $url, ++ HttpRequest::METH_GET, ++ array( ++ 'redirect' => 5, ++ 'compress' => GZIP, ++ 'timeout' => TOUT, ++ 'connecttimeout' => TOUT, ++ 'lastmodified' => is_file($file)?filemtime($file):0 ++ ) ++ ) ++ ); ++ } ++ ++ while ($this->socketPerform()) { ++ if (!$this->socketSelect()) { ++ throw new HttpSocketException; ++ } ++ } ++ } ++ ++ protected final function socketPerform() ++ { ++ try { ++ $rc = parent::socketPerform(); ++ } catch (HttpRequestException $x) { ++ // a request may have thrown an exception, ++ // but it is still save to continue ++ echo $x->getMessage(), "\n"; ++ } ++ ++ foreach ($this->getFinishedRequests() as $r) { ++ $this->detach($r); ++ ++ $u = $r->getUrl(); ++ $c = $r->getResponseCode(); ++ $b = $r->getResponseBody(); ++ ++ printf("%d %s %d\n", $c, $u, strlen($b)); ++ ++ if ($c == 200 && $this->dir) { ++ file_put_contents($this->all[$u], $b); ++ } ++ ++ if ($a = each($this->rem)) { ++ list($url, $file) = $a; ++ $this->attach( ++ new HttpRequest( ++ $url, ++ HttpRequest::METH_GET, ++ array( ++ 'redirect' => 5, ++ 'compress' => GZIP, ++ 'timeout' => TOUT, ++ 'connecttimeout' => TOUT, ++ 'lastmodified' => is_file($file)?filemtime($file):0 ++ ) ++ ) ++ ); ++ } ++ } ++ return $rc; ++ } ++} ++ ++define('GZIP', true); ++define('TOUT', 50); ++define('RMAX', 10); ++chdir(dirname(__FILE__)); ++ ++$time = microtime(true); ++$pool = new Pool(); ++printf("Elapsed: %0.3fs\n", microtime(true)-$time); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++Elapsed: %fs ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequestPool_004.phpt +@@ -0,0 +1,19 @@ ++--TEST-- ++HttpRequestPool::__destruct() invalid curl handle ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequestPool_005.phpt +@@ -0,0 +1,46 @@ ++--TEST-- ++HttpRequestPool exception ++--SKIPIF-- ++ ++--FILE-- ++send(); ++} catch (HttpRequestPoolException $x) { ++ for ($i=0; $x; ++$i, $x = @$x->innerException) { ++ printf("%s%s: %s\n", str_repeat("\t", $i), get_class($x), $x->getMessage()); ++ } ++ var_dump($i); ++} ++$p = new HttpRequestPool(new HttpRequest('http://_____'), new HttpRequest('http://_____')); ++try { ++ $p->send(); ++} catch (HttpRequestPoolException $x) { ++ for ($i=0; $x; ++$i, $x = @$x->innerException) { ++ printf("%s%s: %s\n", str_repeat("\t", $i), get_class($x), $x->getMessage()); ++ } ++ var_dump($i); ++} ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++HttpRequestPoolException: Exception caused by 2 inner exception(s) ++ HttpInvalidParamException: Empty or too short HTTP message: '' ++ HttpRequestException: %souldn't resolve host name; %s (http://_____/) ++int(3) ++HttpRequestPoolException: Exception caused by 4 inner exception(s) ++ HttpInvalidParamException: Empty or too short HTTP message: '' ++ HttpRequestException: %souldn't resolve host name; %s (http://_____/) ++ HttpInvalidParamException: Empty or too short HTTP message: '' ++ HttpRequestException: %souldn't resolve host name; %s (http://_____/) ++int(5) ++Done ++ +--- /dev/null ++++ b/ext/http/tests/HttpRequestPool_006.phpt +@@ -0,0 +1,50 @@ ++--TEST-- ++HttpRequestPool detaching in callbacks ++--SKIPIF-- ++ ++--FILE-- ++getUrl()])) { ++ $i[$this->getUrl()] = true; ++ try { ++ $GLOBALS['p']->detach($this); ++ } catch (Exception $ex) { ++ echo $ex, "\n"; ++ } ++ } ++ } ++ function onFinish() { ++ $GLOBALS['p']->detach($this); ++ } ++} ++$p = new HttpRequestPool(new r("http://at.php.net"), new r("http://de.php.net")); ++$p->send(); ++var_dump($p->getAttachedRequests()); ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++exception 'HttpRequestPoolException' with message 'HttpRequest object(#%d) cannot be detached from the HttpRequestPool while executing the progress callback' in %aHttpRequestPool_006.php:%d ++Stack trace: ++#0 %aHttpRequestPool_006.php(%d): HttpRequestPool->detach(Object(r)) ++#1 [internal function]: r->onProgress(Array) ++#2 %aHttpRequestPool_006.php(%d): HttpRequestPool->send() ++#3 {main} ++exception 'HttpRequestPoolException' with message 'HttpRequest object(#%d) cannot be detached from the HttpRequestPool while executing the progress callback' in %aHttpRequestPool_006.php:%d ++Stack trace: ++#0 %aHttpRequestPool_006.php(%d): HttpRequestPool->detach(Object(r)) ++#1 [internal function]: r->onProgress(Array) ++#2 %aHttpRequestPool_006.php(%d): HttpRequestPool->send() ++#3 {main} ++array(0) { ++} ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequest_001.phpt +@@ -0,0 +1,51 @@ ++--TEST-- ++HttpRequest options ++--SKIPIF-- ++ ++--FILE-- ++11, 'headers'=>array('X-Foo'=>'Bar'))); ++$r2 = new HttpRequest; ++$r2->setOptions(array('redirect'=>99, 'headers'=>array('X-Bar'=>'Foo'))); ++$o1 = $r1->getOptions(); ++$o2 = $r2->getOptions(); ++$r1->setOptions($o2); ++$r2->setOptions($o1); ++print_r(array($o1, $o2)); ++var_dump(serialize($r1->getOptions()) === serialize($r2->getOptions())); ++$r1 = null; ++$r2 = null; ++?> ++--EXPECTF-- ++%aTEST ++Array ++( ++ [0] => Array ++ ( ++ [headers] => Array ++ ( ++ [X-Foo] => Bar ++ [X-Bar] => Foo ++ ) ++ ++ [redirect] => 11 ++ ) ++ ++ [1] => Array ++ ( ++ [headers] => Array ++ ( ++ [X-Bar] => Foo ++ [X-Foo] => Bar ++ ) ++ ++ [redirect] => 99 ++ ) ++ ++) ++bool(false) +--- /dev/null ++++ b/ext/http/tests/HttpRequest_002.phpt +@@ -0,0 +1,86 @@ ++--TEST-- ++HttpRequest GET/POST ++--SKIPIF-- ++ ++--FILE-- ++send(); ++print_r($r->getResponseInfo()); ++ ++$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST); ++$r->addCookies(array('MyCookie' => 'foobar')); ++$r->addQueryData(array('gq'=>'foobar','gi'=>10)); ++$r->addPostFields(array('pq'=>'foobar','pi'=>10)); ++$r->addPostFile('upload', dirname(__FILE__).'/data.txt', 'text/plain'); ++$r->send(); ++echo $r->getResponseBody(); ++var_dump($r->getResponseMessage()->getResponseCode()); ++ ++echo "Done"; ++?> ++--EXPECTF-- ++%aTEST ++Array ++( ++ [effective_url] => http://www.google.com/ ++ [response_code] => 302 ++ [total_time] => %f ++ [namelookup_time] => %f ++ [connect_time] => %f ++ [pretransfer_time] => %f ++ [size_upload] => %d ++ [size_download] => %d ++ [speed_download] => %d ++ [speed_upload] => %d ++ [header_size] => %d ++ [request_size] => %d ++ [ssl_verifyresult] => %d ++ [filetime] => -1 ++ [content_length_download] => %d ++ [content_length_upload] => %d ++ [starttransfer_time] => %f ++ [content_type] => %s ++ [redirect_time] => %d ++ [redirect_count] => %d ++ [connect_code] => %d ++ [httpauth_avail] => %d ++ [proxyauth_avail] => %d ++ [os_errno] => %d ++ [num_connects] => %d ++ [ssl_engines] => Array ++ %a ++ [cookies] => Array ++ %a ++ [error] => ++) ++Array ++( ++ [gq] => foobar ++ [gi] => 10 ++ [pq] => foobar ++ [pi] => 10 ++ [MyCookie] => foobar ++) ++Array ++( ++ [upload] => Array ++ ( ++ [name] => data.txt ++ [type] => text/plain ++ [tmp_name] => %a ++ [error] => 0 ++ [size] => 1010 ++ ) ++ ++) ++int(200) ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequest_003.phpt +@@ -0,0 +1,54 @@ ++--TEST-- ++HttpRequest SSL ++--SKIPIF-- ++ ++--FILE-- ++ '3', 'ssl' => array('version' => '3', 'verifyhost' => '1')); ++$r = new HttpRequest('https://ssl.irmler.at/iworks/data.txt'); ++$r->setOptions($o); ++$r->send(); ++var_dump($r->getResponseBody()); ++var_dump(is_object($r->getResponseMessage())); ++var_dump(is_object($r->getResponseMessage())); ++var_dump(is_object($r->getResponseMessage())); ++var_dump($o); ++$r->setOptions($o); ++$r->send(); ++var_dump($o); ++?> ++--EXPECTF-- ++%aTEST ++string(10) "1234567890" ++bool(true) ++bool(true) ++bool(true) ++array(2) { ++ ["redirect"]=> ++ string(1) "3" ++ ["ssl"]=> ++ array(2) { ++ ["version"]=> ++ string(1) "3" ++ ["verifyhost"]=> ++ string(1) "1" ++ } ++} ++array(2) { ++ ["redirect"]=> ++ string(1) "3" ++ ["ssl"]=> ++ array(2) { ++ ["version"]=> ++ string(1) "3" ++ ["verifyhost"]=> ++ string(1) "1" ++ } ++} ++ +--- /dev/null ++++ b/ext/http/tests/HttpRequest_004.phpt +@@ -0,0 +1,162 @@ ++--TEST-- ++HttpRequest multiple posts ++--SKIPIF-- ++ ++--FILE-- ++ 1, 'dbl' => M_PI), ++ array('str' => 'something', 'nil' => null) ++); ++ ++echo "\nFirst Request\n"; ++$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HttpRequest::METH_POST); ++$r->setPostFields($fields[0]); ++$r->addPostFields($fields[1]); ++var_dump($r->send()->getBody()); ++var_dump($fields); ++ ++echo "\nSecond Request\n"; ++$r->setPostFields($fields); ++var_dump($r->send()->getBody()); ++var_dump($fields); ++ ++echo "\nThird Request\n"; ++$r->addPostFields(array('x' => 'X')); ++var_dump($r->send()->getBody()); ++var_dump($fields); ++ ++echo "\nFourth Request\n"; ++$r->setPostFields(array()); ++var_dump($r->send()->getBody()); ++var_dump($fields); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++ ++First Request ++string(%d) "Array ++( ++ [int] => 1 ++ [dbl] => 3.1415926535898 ++ [str] => something ++ [nil] => ++) ++string(44) "int=1&dbl=3.1415926535898&str=something&nil=" ++" ++array(2) { ++ [0]=> ++ array(2) { ++ ["int"]=> ++ int(1) ++ ["dbl"]=> ++ float(3.1415926535898) ++ } ++ [1]=> ++ array(2) { ++ ["str"]=> ++ string(9) "something" ++ ["nil"]=> ++ NULL ++ } ++} ++ ++Second Request ++string(%d) "Array ++( ++ [0] => Array ++ ( ++ [int] => 1 ++ [dbl] => 3.1415926535898 ++ ) ++ ++ [1] => Array ++ ( ++ [str] => something ++ [nil] => ++ ) ++ ++) ++string(72) "0%5Bint%5D=1&0%5Bdbl%5D=3.1415926535898&1%5Bstr%5D=something&1%5Bnil%5D=" ++" ++array(2) { ++ [0]=> ++ array(2) { ++ ["int"]=> ++ int(1) ++ ["dbl"]=> ++ float(3.1415926535898) ++ } ++ [1]=> ++ array(2) { ++ ["str"]=> ++ string(9) "something" ++ ["nil"]=> ++ NULL ++ } ++} ++ ++Third Request ++string(%d) "Array ++( ++ [0] => Array ++ ( ++ [int] => 1 ++ [dbl] => 3.1415926535898 ++ ) ++ ++ [1] => Array ++ ( ++ [str] => something ++ [nil] => ++ ) ++ ++ [x] => X ++) ++string(76) "0%5Bint%5D=1&0%5Bdbl%5D=3.1415926535898&1%5Bstr%5D=something&1%5Bnil%5D=&x=X" ++" ++array(2) { ++ [0]=> ++ array(2) { ++ ["int"]=> ++ int(1) ++ ["dbl"]=> ++ float(3.1415926535898) ++ } ++ [1]=> ++ array(2) { ++ ["str"]=> ++ string(9) "something" ++ ["nil"]=> ++ NULL ++ } ++} ++ ++Fourth Request ++string(13) "string(0) "" ++" ++array(2) { ++ [0]=> ++ array(2) { ++ ["int"]=> ++ int(1) ++ ["dbl"]=> ++ float(3.1415926535898) ++ } ++ [1]=> ++ array(2) { ++ ["str"]=> ++ string(9) "something" ++ ["nil"]=> ++ NULL ++ } ++} ++Done ++ +--- /dev/null ++++ b/ext/http/tests/HttpRequest_005.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++HttpRequest accessors ++--SKIPIF-- ++ ++--FILE-- ++ 3 && substr($method, 0, 3) == 'get') ++ $x = $r->$method(); ++ } catch (HttpException $e) { ++ } ++} ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequest_006.phpt +@@ -0,0 +1,147 @@ ++--TEST-- ++HttpRequest XMLRPC ++--SKIPIF-- ++ ++--FILE-- ++setContentType('text/xml'); ++$r->setBody(xmlrpc_encode_request('testMethod', array('foo' => 'bar'))); ++var_dump($r->send()); ++var_dump($r->send()); ++var_dump($r->send()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++object(HttpMessage)#%d (%d) { ++ ["type:protected"]=> ++ int(2) ++ ["body:protected"]=> ++ string(309) "string(294) " ++ ++testMethod ++ ++ ++ ++ ++ ++ foo ++ ++ bar ++ ++ ++ ++ ++ ++ ++ ++" ++" ++ ["requestMethod:protected"]=> ++ string(0) "" ++ ["requestUrl:protected"]=> ++ string(0) "" ++ ["responseStatus:protected"]=> ++ string(2) "OK" ++ ["responseCode:protected"]=> ++ int(200) ++ ["httpVersion:protected"]=> ++ float(1.1) ++ ["headers:protected"]=> ++ array(6) { ++ %a ++ } ++ ["parentMessage:protected"]=> ++ NULL ++} ++object(HttpMessage)#%d (%d) { ++ ["type:protected"]=> ++ int(2) ++ ["body:protected"]=> ++ string(309) "string(294) " ++ ++testMethod ++ ++ ++ ++ ++ ++ foo ++ ++ bar ++ ++ ++ ++ ++ ++ ++ ++" ++" ++ ["requestMethod:protected"]=> ++ string(0) "" ++ ["requestUrl:protected"]=> ++ string(0) "" ++ ["responseStatus:protected"]=> ++ string(2) "OK" ++ ["responseCode:protected"]=> ++ int(200) ++ ["httpVersion:protected"]=> ++ float(1.1) ++ ["headers:protected"]=> ++ array(6) { ++ %a ++ } ++ ["parentMessage:protected"]=> ++ NULL ++} ++object(HttpMessage)#%d (%d) { ++ ["type:protected"]=> ++ int(2) ++ ["body:protected"]=> ++ string(309) "string(294) " ++ ++testMethod ++ ++ ++ ++ ++ ++ foo ++ ++ bar ++ ++ ++ ++ ++ ++ ++ ++" ++" ++ ["requestMethod:protected"]=> ++ string(0) "" ++ ["requestUrl:protected"]=> ++ string(0) "" ++ ["responseStatus:protected"]=> ++ string(2) "OK" ++ ["responseCode:protected"]=> ++ int(200) ++ ["httpVersion:protected"]=> ++ float(1.1) ++ ["headers:protected"]=> ++ array(6) { ++ %a ++ } ++ ["parentMessage:protected"]=> ++ NULL ++} ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequest_007.phpt +@@ -0,0 +1,63 @@ ++--TEST-- ++HttpRequest PUT ++--SKIPIF-- ++ ++--FILE-- ++recordHistory = true; ++$r->addHeaders(array('content-type' => 'text/plain')); ++$r->setPutFile(__FILE__); ++$r->send(); ++var_dump($r->getHistory()->toString(true)); ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++string(%d) "PUT /ext-http/.print_put.php5 HTTP/1.1 ++User-Agent: PECL::HTTP/%a ++Host: dev.iworks.at ++Accept: */* ++Content-Type: text/plain ++Content-Length: %d ++Expect: 100-continue ++ ++recordHistory = true; ++$r->addHeaders(array('content-type' => 'text/plain')); ++$r->setPutFile(__FILE__); ++$r->send(); ++var_dump($r->getHistory()->toString(true)); ++echo "Done\n"; ++?> ++ ++HTTP/1.1 100 Continue ++HTTP/1.1 200 OK ++Date: %a ++Server: %a ++Vary: Accept-Encoding ++Content-Length: %d ++Content-Type: text/html ++ ++recordHistory = true; ++$r->addHeaders(array('content-type' => 'text/plain')); ++$r->setPutFile(__FILE__); ++$r->send(); ++var_dump($r->getHistory()->toString(true)); ++echo "Done\n"; ++?> ++ ++" ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequest_008.phpt +@@ -0,0 +1,32 @@ ++--TEST-- ++HttpRequest custom request method ++--SKIPIF-- ++ ++--FILE-- ++setContentType('text/plain'); ++$r->setBody('Yep, this is FOOBAR!'); ++var_dump($r->send()->getResponseCode()); ++var_dump($r->getRawRequestMessage()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++int(200) ++string(%d) "FOOBAR /ext-http/.print_request.php HTTP/1.1 ++User-Agent: %a ++Host: dev.iworks.at ++Accept: */* ++Content-Type: text/plain ++Content-Length: 20 ++ ++Yep, this is FOOBAR!" ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequest_009.phpt +@@ -0,0 +1,48 @@ ++--TEST-- ++HttpRequest callbacks ++--SKIPIF-- ++ ++--FILE-- ++getResponseCode()); ++ } ++} ++ ++$r = new _R('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST); ++$r->addPostFile('upload', __FILE__, 'text/plain'); ++$r->send(); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++Array ++( ++ [dltotal] => %f ++ [dlnow] => %f ++ [ultotal] => %f ++ [ulnow] => %f ++) ++%array ++( ++ [dltotal] => %f ++ [dlnow] => %f ++ [ultotal] => %f ++ [ulnow] => %f ++) ++int(200) ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequest_010.phpt +@@ -0,0 +1,48 @@ ++--TEST-- ++HttpRequest cookie API ++--SKIPIF-- ++ ++--FILE-- ++send(); ++$c[0] = $r->getResponseInfo("cookies"); ++if (!empty($c[0])) { ++ var_dump('$c[0]', $c[0]); ++} ++ ++var_dump($r->enableCookies()); ++$r->send(); ++ ++$c[1] = $r->getResponseInfo("cookies"); ++if (empty($c[1])) { ++ var_dump('$c[1]', $c[1]); ++} ++ ++var_dump($r->resetCookies()); ++$r->send(); ++ ++$c[2] = $r->getResponseInfo("cookies"); ++if ($c[1] === $c[2]) { ++ var_dump('$c[1]', $c[1], '$c[2]', $c[2]); ++} ++ ++$r->send(); ++$c[3] = $r->getResponseInfo("cookies"); ++if ($c[2] !== $c[3]) { ++ var_dump('$c[2]', $c[2], '$c[3]', $c[3]); ++} ++ ++echo "Done\n"; ++--EXPECTF-- ++%aTEST ++bool(true) ++bool(true) ++Done +--- /dev/null ++++ b/ext/http/tests/HttpResponse_001.phpt +@@ -0,0 +1,25 @@ ++--TEST-- ++HttpResponse - send data with caching headers ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: public, must-revalidate, max-age=3600 ++Last-Modified: %a, %d %a 20%d %d:%d:%d GMT ++Content-Type: %a ++Accept-Ranges: bytes ++ETag: "3858f62230ac3c915f300c664312c63f" ++Content-Length: 6 ++ ++foobar +--- /dev/null ++++ b/ext/http/tests/HttpResponse_002.phpt +@@ -0,0 +1,25 @@ ++--TEST-- ++HttpResponse - send gzipped file ++--SKIPIF-- ++ ++--ENV-- ++HTTP_ACCEPT_ENCODING=gzip ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Content-Type: %a ++Accept-Ranges: bytes ++Content-Encoding: gzip ++Vary: Accept-Encoding ++ ++%a +--- /dev/null ++++ b/ext/http/tests/HttpResponse_003.phpt +@@ -0,0 +1,30 @@ ++--TEST-- ++HttpResponse - send gzipped file with caching headers ++--SKIPIF-- ++ ++--ENV-- ++HTTP_ACCEPT_ENCODING=gzip ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: public, must-revalidate, max-age=3600 ++Last-Modified: %a, %d %a 20%d %d:%d:%d GMT ++Content-Type: %a ++Accept-Ranges: bytes ++ETag: "%a" ++Content-Encoding: gzip ++Vary: Accept-Encoding ++ ++%a +--- /dev/null ++++ b/ext/http/tests/HttpResponse_004.phpt +@@ -0,0 +1,27 @@ ++--TEST-- ++HttpResponse - send cached gzipped data ++--SKIPIF-- ++ ++--ENV-- ++HTTP_IF_NONE_MATCH="900150983cd24fb0d6963f7d28e17f72" ++HTTP_ACCEPT_ENCODING=gzip ++--FILE-- ++ ++--EXPECTF-- ++Status: 304%s ++X-Powered-By: PHP/%s ++Cache-Control: public, must-revalidate, max-age=3600 ++Last-Modified: %s ++Accept-Ranges: bytes ++ETag: "900150983cd24fb0d6963f7d28e17f72" +--- /dev/null ++++ b/ext/http/tests/HttpResponse_005.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++HttpResponse file not found ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++Status: 404%s ++X-Powered-By: PHP/%s ++Content-Type: text/plain ++ ++File not found +--- /dev/null ++++ b/ext/http/tests/allowed_methods_002.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++allowed methods ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++Status: 405%s ++X-Powered-By: PHP/%a ++Allow: POST ++Content-type: %a ++ +--- /dev/null ++++ b/ext/http/tests/allowed_methods_002_logging.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++logging allowed methods ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=example.com ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d [405-ALLOWED] Allow: POST <%a> ++Done +--- /dev/null ++++ b/ext/http/tests/bug_15800.phpt +@@ -0,0 +1,49 @@ ++--TEST-- ++Bug #15800 Double free when zval is separated in convert_to_* ++--SKIPIF-- ++ ++--FILE-- ++ array('verifypeer'=>'1')); ++debug_zval_dump($o); ++ ++$r = new HttpRequest('http://www.google.com'); ++$r->setOptions($o); ++$r->send(); ++debug_zval_dump($o); ++ ++unset($r); ++debug_zval_dump($o); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++array(1) refcount(2){ ++ ["ssl"]=> ++ array(1) refcount(1){ ++ ["verifypeer"]=> ++ string(1) "1" refcount(1) ++ } ++} ++array(1) refcount(2){ ++ ["ssl"]=> ++ array(1) refcount(1){ ++ ["verifypeer"]=> ++ string(1) "1" refcount(3) ++ } ++} ++array(1) refcount(2){ ++ ["ssl"]=> ++ array(1) refcount(1){ ++ ["verifypeer"]=> ++ string(1) "1" refcount(1) ++ } ++} ++Done +--- /dev/null ++++ b/ext/http/tests/build_str_001.phpt +@@ -0,0 +1,30 @@ ++--TEST-- ++http_build_str ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++a=b ++a=b&c%5B0%5D=1 ++a=b&c%5B0%5D=1&d%5Be%5D=f ++foo%5B0%5D=1&foo%5B1%5D=2&foo%5B2%5D%5B0%5D=3 ++Done +--- /dev/null ++++ b/ext/http/tests/build_url_001.phpt +@@ -0,0 +1,18 @@ ++--TEST-- ++http_build_url() with relative paths ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++http://%a/page ++http://%a/with/some/path/ ++Done +--- /dev/null ++++ b/ext/http/tests/build_url_002.phpt +@@ -0,0 +1,30 @@ ++--TEST-- ++http_build_url() with parse_url() ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++https://www.example.com:9999/replaced?q=1#n ++https://www.example.com:9999/replaced?q=1#n ++Array ++( ++ [scheme] => https ++ [host] => www.example.com ++ [port] => 9999 ++ [path] => /replaced ++ [query] => q=1 ++ [fragment] => n ++) ++Done +--- /dev/null ++++ b/ext/http/tests/build_url_003.phpt +@@ -0,0 +1,26 @@ ++--TEST-- ++http_build_url() ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=www.example.com ++--FILE-- ++ 'https'))); ++printf("-%s-\n", http_build_url($url, array('scheme' => 'https', 'host' => 'ssl.example.com'))); ++printf("-%s-\n", http_build_url($url, array('scheme' => 'ftp', 'host' => 'ftp.example.com', 'port' => 21))); ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++-http://www.example.com/path/?query#anchor- ++-https://www.example.com/path/?query#anchor- ++-https://ssl.example.com/path/?query#anchor- ++-ftp://ftp.example.com/path/?query#anchor- ++Done +--- /dev/null ++++ b/ext/http/tests/build_url_004.phpt +@@ -0,0 +1,22 @@ ++--TEST-- ++http_build_url flags ++--SKPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++http://www.example.com/foo/baz ++http://www.example.com/foo/baz ++http://mike@www.example.com/foo/baz ++http://www.example.com/?a%5B0%5D=1&a%5B1%5D=b&b=c ++Done +--- /dev/null ++++ b/ext/http/tests/chunked_decode_001.phpt +@@ -0,0 +1,25 @@ ++--TEST-- ++http_chunked_decode() "\r\n" ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++string(12) "abra ++cadabra" ++ +--- /dev/null ++++ b/ext/http/tests/chunked_decode_002.phpt +@@ -0,0 +1,25 @@ ++--TEST-- ++http_chunked_decode() "\n" ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++string(12) "abra ++cadabra" ++ +--- /dev/null ++++ b/ext/http/tests/chunked_decode_003.phpt +@@ -0,0 +1,27 @@ ++--TEST-- ++http_chunked_decode() truncated message ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++%aWarning%ahttp_chunked_decode()%aTruncated message: chunk size 255 exceeds remaining data size 12 at pos 34 of 46 in%a ++string(24) "abra ++cadabra ++all we got ++" +--- /dev/null ++++ b/ext/http/tests/chunked_decode_004.phpt +@@ -0,0 +1,26 @@ ++--TEST-- ++http_chunked_decode() truncated message ending with NUL after a chunk ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++string(24) "abra ++cadabra ++all we got ++" +--- /dev/null ++++ b/ext/http/tests/cloning_001.phpt +@@ -0,0 +1,29 @@ ++--TEST-- ++cloning ++--SKIPIF-- ++ ++--FILE-- ++setOptions(array('redirect' => 3)); ++var_dump($r1->getOptions() == $r2->getOptions()); ++$r1->setUrl('http://www.google.com/'); ++var_dump($r1->getUrl() == $r2->getUrl()); ++$r1->send(); ++var_dump($r1->getResponseInfo() == $r2->getResponseInfo()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++bool(false) ++bool(false) ++bool(false) ++Done +--- /dev/null ++++ b/ext/http/tests/data.txt +@@ -0,0 +1,10 @@ ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +--- /dev/null ++++ b/ext/http/tests/date_001.phpt +@@ -0,0 +1,17 @@ ++--TEST-- ++http_date() with timestamp ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++Thu, 01 Jan 1970 00:00:01 GMT ++Fri, 13 Feb 2009 23:31:30 GMT ++ +--- /dev/null ++++ b/ext/http/tests/date_002.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++http_date() without timestamp ++--SKIPIF-- ++ ++--FILE-- ++ 1); ++echo "$t\n$d\nDone\n"; ++?> ++--EXPECTF-- ++%aTEST ++bool(true) ++%d ++%a, %d %a %d %d:%d:%d GMT ++Done +--- /dev/null ++++ b/ext/http/tests/encoding_objects_001.phpt +@@ -0,0 +1,35 @@ ++--TEST-- ++encoding stream objects ++--SKIPIF-- ++ ++--FILE-- ++flush($d->flush("Hi ")); ++echo $i->finish($d->finish("there!\n")); ++echo $i->finish($d->finish("Yo...\n")); ++ ++$id = $i->update($d->update($pd = file_get_contents(__FILE__))); ++foreach (glob('*.phpt') as $f) { ++ $id .= $i->update($d->update($tmp = file_get_contents($f))); ++ $pd .= $tmp; ++} ++$id .= $i->finish($d->finish()); ++ ++var_dump($id == $pd); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++Hi there! ++Yo... ++bool(true) ++Done ++ +--- /dev/null ++++ b/ext/http/tests/encodings.phpt +@@ -0,0 +1,44 @@ ++--TEST-- ++encodings ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++bool(true) ++bool(true) ++bool(true) ++Done +--- /dev/null ++++ b/ext/http/tests/etag_mode_031.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++crc32 etag (may fail because PHPs crc32 is actually crc32b) ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++Accept-Ranges: bytes ++ETag: "4e818847" ++Content-Length: 4 ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/etag_mode_032.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++sha1 etag ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++Accept-Ranges: bytes ++ETag: "03cfd743661f07975fa2f1220c5194cbaff48451" ++Content-Length: 4 ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/etag_mode_033.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++md5 etag ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++Accept-Ranges: bytes ++ETag: "0bee89b07a248e27c83fc3d5951213c1" ++Content-Length: 4 ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/etag_mode_034.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++ext/hash etag ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++Accept-Ranges: bytes ++ETag: "edeaaff3f1774ad2888673770c6d64097e391bc362d7d6fb34982ddf0efd18cb" ++Content-Length: 4 ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/etag_mode_041.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++ob crc32 etag (may fail because PHPs crc32 is actually crc32b) ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++ETag: "4e818847" ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/etag_mode_042.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++ob sha1 etag ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++ETag: "03cfd743661f07975fa2f1220c5194cbaff48451" ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/etag_mode_043.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++ob md5 etag ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++ETag: "0bee89b07a248e27c83fc3d5951213c1" ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/etag_mode_044.phpt +@@ -0,0 +1,22 @@ ++--TEST-- ++ob ext/hash etag ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++ETag: "edeaaff3f1774ad2888673770c6d64097e391bc362d7d6fb34982ddf0efd18cb" ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/exceptions.phpt +@@ -0,0 +1,53 @@ ++--TEST-- ++exceptions ++--SKIPIF-- ++ ++--FILE-- ++ 'Runtime', ++ HTTP_E_INVALID_PARAM => 'InvalidParam', ++ HTTP_E_HEADER => 'Header', ++ HTTP_E_MALFORMED_HEADERS => 'MalformedHeaders', ++ HTTP_E_REQUEST_METHOD => 'RequestMethod', ++ HTTP_E_MESSAGE_TYPE => 'MessageType', ++ HTTP_E_ENCODING => 'Encoding', ++ HTTP_E_REQUEST => 'Request', ++ HTTP_E_REQUEST_POOL => 'RequestPool', ++ HTTP_E_SOCKET => 'Socket', ++ HTTP_E_RESPONSE => 'Response', ++ HTTP_E_URL => 'Url', ++); ++ ++foreach ($e as $i => $c) { ++ try { ++ $n = "Http{$c}Exception"; ++ throw new $n; ++ } catch (HttpException $x) { ++ printf("%2d: %s\n", $i, get_class($x)); ++ } ++} ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++ 1: HttpRuntimeException ++ 2: HttpInvalidParamException ++ 3: HttpHeaderException ++ 4: HttpMalformedHeadersException ++ 5: HttpRequestMethodException ++ 6: HttpMessageTypeException ++ 7: HttpEncodingException ++ 8: HttpRequestException ++ 9: HttpRequestPoolException ++10: HttpSocketException ++11: HttpResponseException ++12: HttpUrlException ++Done +--- /dev/null ++++ b/ext/http/tests/get_request_data_001.phpt +@@ -0,0 +1,40 @@ ++--TEST-- ++get request data ++--SKIPIF-- ++ ++--POST-- ++a=b&c=d ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++Array ++( ++ [Accept-Charset] => iso-8859-1, * ++ [Accept-Encoding] => none ++ [Host] => localhost ++ [User-Agent] => Mozilla/5.0 ++) ++string(7) "a=b&c=d" ++string(7) "a=b&c=d" ++string(7) "a=b&c=d" ++string(7) "a=b&c=d" ++Done +--- /dev/null ++++ b/ext/http/tests/log.inc +@@ -0,0 +1,23 @@ ++ +--- /dev/null ++++ b/ext/http/tests/match_request_header_001.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++http_match_request_header() ++--SKIPIF-- ++ ++--ENV-- ++HTTP_FOO=bar ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++bool(true) ++bool(true) ++bool(false) ++Done +--- /dev/null ++++ b/ext/http/tests/negotiation_001.phpt +@@ -0,0 +1,64 @@ ++--TEST-- ++negotiation ++--SKIPIF-- ++ ++--ENV-- ++HTTP_ACCEPT=application/xml, application/xhtml+xml, text/html ; q = .8 ++HTTP_ACCEPT_LANGUAGE=de-AT,de-DE;q=0.8,en-GB;q=0.3,en-US;q=0.2 ++HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7 ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++string(2) "de" ++string(2) "de" ++string(10) "iso-8859-1" ++string(10) "iso-8859-1" ++string(21) "application/xhtml+xml" ++string(21) "application/xhtml+xml" ++string(7) "unknown" ++string(7) "unknown" ++string(7) "unknown" ++Array ++( ++ [de] => 900 ++ [en] => 0.27 ++) ++Array ++( ++ [iso-8859-1] => 1000 ++ [utf-8] => 0.7 ++) ++Array ++( ++ [application/xhtml+xml] => 999 ++ [text/html] => 0.8 ++) ++Done +--- /dev/null ++++ b/ext/http/tests/ob_deflatehandler_001.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++ob_deflatehandler ++--SKIPIF-- ++ ++--ENV-- ++HTTP_ACCEPT_ENCODING=gzip ++--FILE-- ++ ++--EXPECTF-- ++%a ++Content-Encoding: gzip ++Vary: Accept-Encoding ++%a ++ +--- /dev/null ++++ b/ext/http/tests/ob_inflatehandler_001.phpt +@@ -0,0 +1,16 @@ ++--TEST-- ++ob_inflatehandler ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++ +--- /dev/null ++++ b/ext/http/tests/parse_cookie_001.phpt +@@ -0,0 +1,41 @@ ++--TEST-- ++parse cookie ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++object(stdClass)%a { ++ ["cookies"]=> ++ array(3) { ++ ["name"]=> ++ string(5) "value" ++ ["foo"]=> ++ string(7) "bar"baz" ++ ["hey"]=> ++ string(6) "got"it" ++ } ++ ["extras"]=> ++ array(1) { ++ ["comment"]=> ++ string(0) "" ++ } ++ ["flags"]=> ++ int(32) ++ ["expires"]=> ++ int(1) ++ ["path"]=> ++ string(1) "/" ++ ["domain"]=> ++ string(0) "" ++} ++Done +--- /dev/null ++++ b/ext/http/tests/parse_cookie_002.phpt +@@ -0,0 +1,80 @@ ++--TEST-- ++parse cookie ++--SKIPIF-- ++ ++--FILE-- ++cookies['foo']); ++var_dump(http_parse_cookie('foo;')->cookies['foo']); ++var_dump(http_parse_cookie('foo ')->cookies['foo']); ++var_dump(http_parse_cookie('foo ;')->cookies['foo']); ++var_dump(http_parse_cookie('foo ; ')->cookies['foo']); ++var_dump(http_parse_cookie('foo=')->cookies['foo']); ++var_dump(http_parse_cookie('foo=;')->cookies['foo']); ++var_dump(http_parse_cookie('foo =')->cookies['foo']); ++var_dump(http_parse_cookie('foo =;')->cookies['foo']); ++var_dump(http_parse_cookie('foo= ')->cookies['foo']); ++var_dump(http_parse_cookie('foo= ;')->cookies['foo']); ++ ++var_dump(http_parse_cookie('foo=1')->cookies['foo']); ++var_dump(http_parse_cookie('foo=1;')->cookies['foo']); ++var_dump(http_parse_cookie('foo=1 ;')->cookies['foo']); ++var_dump(http_parse_cookie('foo= 1;')->cookies['foo']); ++var_dump(http_parse_cookie('foo = 1;')->cookies['foo']); ++var_dump(http_parse_cookie('foo = 1 ;')->cookies['foo']); ++var_dump(http_parse_cookie('foo=1')->cookies['foo']); ++var_dump(http_parse_cookie('foo= 1')->cookies['foo']); ++ ++var_dump(http_parse_cookie('foo="1"')->cookies['foo']); ++var_dump(http_parse_cookie('foo="1" ')->cookies['foo']); ++var_dump(http_parse_cookie('foo="1";')->cookies['foo']); ++var_dump(http_parse_cookie('foo = "1" ;')->cookies['foo']); ++var_dump(http_parse_cookie('foo= "1" ')->cookies['foo']); ++ ++var_dump(http_parse_cookie('foo=""')->cookies['foo']); ++var_dump(http_parse_cookie('foo="\""')->cookies['foo']); ++var_dump(http_parse_cookie('foo=" "')->cookies['foo']); ++var_dump(http_parse_cookie('foo= "')->cookies['foo']); ++var_dump(http_parse_cookie('foo=" ')->cookies['foo']); ++var_dump(http_parse_cookie('foo= " ')->cookies['foo']); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(0) "" ++string(1) """ ++string(1) " " ++string(1) """ ++string(1) """ ++string(1) """ ++Done +--- /dev/null ++++ b/ext/http/tests/parse_headers_001.phpt +@@ -0,0 +1,41 @@ ++--TEST-- ++http_parse_headers() ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++Array ++( ++ [Host] => Array ++ ( ++ [0] => localhost ++ [1] => ambigious ++ ) ++ ++ [Nospace] => here ++ [Muchspace] => there ++ [Empty] => ++ [Empty2] => ++ [Folded] => one ++ two ++ three ++) ++ +--- /dev/null ++++ b/ext/http/tests/parse_message_001.phpt +@@ -0,0 +1,18 @@ ++--TEST-- ++http_parse_message() ++--SKIPIF-- ++ ++--FILE-- ++body; ++echo "Done\n"; ++--EXPECTF-- ++%aTEST ++%aThe document has moved%a ++Done +--- /dev/null ++++ b/ext/http/tests/parse_message_002.phpt +@@ -0,0 +1,39 @@ ++--TEST-- ++identity encoding trap ++--SKIPIF-- ++ ++--FILE-- ++ 2 ++ [httpVersion] => 1.1 ++ [responseCode] => 200 ++ [responseStatus] => Ok ++ [headers] => Array ++ ( ++ [Transfer-Encoding] => identity ++ [Content-Length] => 3 ++ [Content-Type] => text/plain ++ ) ++ ++ [body] => Hi! ++ [parentMessage] => ++) ++Done +--- /dev/null ++++ b/ext/http/tests/parse_message_003.phpt +@@ -0,0 +1,31 @@ ++--TEST-- ++content range message ++--SKIPIF-- ++ ++--FILE-- ++body); ++ ++$message = ++"HTTP/1.1 200 Ok\n". ++"Content-Range: bytes 0-1/1\n\n". ++"X\n"; ++ ++$msg = http_parse_message($message); ++ ++echo "Done\n"; ++--EXPECTF-- ++%aTEST ++string(2) "OK" ++%a Invalid Content-Range header: bytes 0-1/1 in%a ++Done +--- /dev/null ++++ b/ext/http/tests/parse_message_004.phpt +@@ -0,0 +1,115 @@ ++--TEST-- ++http_parse_message() recursive ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++object(stdClass)%a { ++ ["type"]=> ++ int(2) ++ ["httpVersion"]=> ++ float(1.1) ++ ["responseCode"]=> ++ int(200) ++ ["responseStatus"]=> ++ string(2) "Ok" ++ ["headers"]=> ++ array(2) { ++ ["Server"]=> ++ string(9) "Funky/1.0" ++ ["Content-Length"]=> ++ string(2) "10" ++ } ++ ["body"]=> ++ string(10) "1234567890" ++ ["parentMessage"]=> ++ object(stdClass)%a { ++ ["type"]=> ++ int(1) ++ ["httpVersion"]=> ++ float(1.1) ++ ["requestMethod"]=> ++ string(3) "GET" ++ ["requestUrl"]=> ++ string(1) "/" ++ ["headers"]=> ++ array(2) { ++ ["Host"]=> ++ string(15) "www.example.com" ++ ["Accept"]=> ++ string(3) "*/*" ++ } ++ ["body"]=> ++ string(0) "" ++ ["parentMessage"]=> ++ object(stdClass)%a { ++ ["type"]=> ++ int(2) ++ ["httpVersion"]=> ++ float(1.1) ++ ["responseCode"]=> ++ int(200) ++ ["responseStatus"]=> ++ string(2) "Ok" ++ ["headers"]=> ++ array(2) { ++ ["Server"]=> ++ string(9) "Funky/1.0" ++ ["Content-Length"]=> ++ string(2) "10" ++ } ++ ["body"]=> ++ string(0) "" ++ ["parentMessage"]=> ++ object(stdClass)%a { ++ ["type"]=> ++ int(1) ++ ["httpVersion"]=> ++ float(1.1) ++ ["requestMethod"]=> ++ string(4) "HEAD" ++ ["requestUrl"]=> ++ string(1) "/" ++ ["headers"]=> ++ array(2) { ++ ["Host"]=> ++ string(15) "www.example.com" ++ ["Accept"]=> ++ string(3) "*/*" ++ } ++ ["body"]=> ++ string(0) "" ++ ["parentMessage"]=> ++ NULL ++ } ++ } ++ } ++} ++Done +--- /dev/null ++++ b/ext/http/tests/parse_message_005.phpt +@@ -0,0 +1,60 @@ ++--TEST-- ++http_parse_message() content range header w/(o) = ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++stdClass Object ++( ++ [type] => 2 ++ [httpVersion] => 1.1 ++ [responseCode] => 206 ++ [responseStatus] => ++ [headers] => Array ++ ( ++ [Server] => Funky/1.0 ++ [Content-Range] => bytes 0-0/100 ++ ) ++ ++ [body] => 1 ++ [parentMessage] => stdClass Object ++ ( ++ [type] => 2 ++ [httpVersion] => 1.1 ++ [responseCode] => 206 ++ [responseStatus] => ++ [headers] => Array ++ ( ++ [Server] => Funky/1.0 ++ [Content-Range] => bytes: 0-0/100 ++ ) ++ ++ [body] => 1 ++ [parentMessage] => ++ ) ++ ++) ++Done +--- /dev/null ++++ b/ext/http/tests/parse_message_006.phpt +@@ -0,0 +1,38 @@ ++--TEST-- ++mixed EOL trap ++--SKIPIF-- ++ ++--FILE-- ++ 2 ++ [httpVersion] => 1.1 ++ [responseCode] => 200 ++ [responseStatus] => Ok ++ [headers] => Array ++ ( ++ [Header] => Value ++ [Connection] => close ++ ) ++ ++ [body] => Bug! ++ [parentMessage] => ++) ++Done +--- /dev/null ++++ b/ext/http/tests/parse_params_001.phpt +@@ -0,0 +1,75 @@ ++--TEST-- ++http_parse_params ++--SKIPIF-- ++ ++--FILE-- ++params[0]); ++$p = http_parse_params('a=b'); var_dump($p->params[0]); ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++object(stdClass)%a { ++ ["params"]=> ++ array(2) { ++ [0]=> ++ string(9) "text/html" ++ [1]=> ++ array(1) { ++ ["charset"]=> ++ string(10) "iso-8859-1" ++ } ++ } ++} ++object(stdClass)%a { ++ ["params"]=> ++ array(2) { ++ [0]=> ++ string(9) "text/html" ++ [1]=> ++ array(1) { ++ ["charset"]=> ++ string(10) "iso-8859-1" ++ } ++ } ++} ++object(stdClass)%a { ++ ["params"]=> ++ array(2) { ++ [0]=> ++ string(10) "attachment" ++ [1]=> ++ array(1) { ++ ["filename"]=> ++ string(13) "gol;got,a.ext" ++ } ++ } ++} ++object(stdClass)%a { ++ ["params"]=> ++ array(3) { ++ [0]=> ++ string(6) "public" ++ [1]=> ++ string(15) "must-revalidate" ++ [2]=> ++ array(1) { ++ ["max-age"]=> ++ string(1) "0" ++ } ++ } ++} ++string(1) "a" ++array(1) { ++ ["a"]=> ++ string(1) "b" ++} ++Done +--- /dev/null ++++ b/ext/http/tests/persistent_handles_001.phpt +@@ -0,0 +1,91 @@ ++--TEST-- ++persistent handles ++--SKIPIF-- ++ ++--INI-- ++http.persistent.handles.limit=-1 ++http.persistent.handles.ident=GLOBAL ++--FILE-- ++ $idents) { ++ foreach ((array)$idents as $ident => $counts) { ++ if (!empty($counts["free"])) { ++ printf("%a, %a, %a\n", $provider, $ident, $counts["free"]); ++ } ++ } ++} ++ ++http_get("http://www.google.com/", null, $info[]); ++ ++echo "One free request handle within GLOBAL: "; ++var_dump(http_persistent_handles_count()->http_request["GLOBAL"]["free"]); ++ ++echo "Reusing request handle: "; ++http_get("http://www.google.com/", null, $info[]); ++var_dump($info[0]["pretransfer_time"] > 10 * $info[1]["pretransfer_time"], $info[0]["pretransfer_time"], $info[1]["pretransfer_time"]); ++ ++echo "Handles' been cleaned up:\n"; ++http_persistent_handles_clean(); ++print_r(http_persistent_handles_count()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++No free handles! ++One free request handle within GLOBAL: int(1) ++Reusing request handle: bool(true) ++float(%f) ++float(%f) ++Handles' been cleaned up: ++stdClass Object ++( ++ [http_request] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++ [http_request_datashare] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++ [http_request_datashare_lock] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++ [http_request_pool] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++) ++Done +--- /dev/null ++++ b/ext/http/tests/persistent_handles_002.phpt +@@ -0,0 +1,83 @@ ++--TEST-- ++persistent handles ++--SKIPIF-- ++ ++--INI-- ++http.persistent.handles.limit=-1 ++http.persistent.handles.ident=GLOBAL ++--FILE-- ++ $idents) { ++ foreach ((array)$idents as $ident => $counts) { ++ if (!empty($counts["free"])) { ++ printf("%a, %a, %a\n", $provider, $ident, $counts["free"]); ++ } ++ } ++} ++ ++http_get("http://www.google.com/", null, $info[]); ++ ++echo "One free request handle within GLOBAL: "; ++$h = http_persistent_handles_count(); ++var_dump($h->http_request["GLOBAL"]["free"]); ++ ++echo "Reusing request handle: "; ++http_get("http://www.google.com/", null, $info[]); ++var_dump($info[0]["pretransfer_time"] > 10 * $info[1]["pretransfer_time"], $info[0]["pretransfer_time"], $info[1]["pretransfer_time"]); ++ ++echo "Handles' been cleaned up:\n"; ++http_persistent_handles_clean(); ++print_r(http_persistent_handles_count()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++No free handles! ++One free request handle within GLOBAL: int(1) ++Reusing request handle: bool(true) ++float(%f) ++float(%f) ++Handles' been cleaned up: ++stdClass Object ++( ++ [http_request] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++ [http_request_datashare] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++ [http_request_pool] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++) ++Done +--- /dev/null ++++ b/ext/http/tests/persistent_handles_003.phpt +@@ -0,0 +1,62 @@ ++--TEST-- ++persistent handles ++--SKIPIF-- ++ ++--INI-- ++http.persistent.handles.limit=-1 ++http.persistent.handles.ident=GLOBAL ++--FILE-- ++ $idents) { ++ foreach ((array)$idents as $ident => $counts) { ++ if (!empty($counts["free"])) { ++ printf("%a, %a, %a\n", $provider, $ident, $counts["free"]); ++ } ++ } ++} ++ ++http_get("http://www.google.com/", null, $info[]); ++ ++echo "One free request handle within GLOBAL: "; ++$h = http_persistent_handles_count(); ++var_dump($h->http_request["GLOBAL"]["free"]); ++ ++echo "Reusing request handle: "; ++http_get("http://www.google.com/", null, $info[]); ++var_dump($info[0]["pretransfer_time"] > 10 * $info[1]["pretransfer_time"], $info[0]["pretransfer_time"], $info[1]["pretransfer_time"]); ++ ++echo "Handles' been cleaned up:\n"; ++http_persistent_handles_clean(); ++print_r(http_persistent_handles_count()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++No free handles! ++One free request handle within GLOBAL: int(1) ++Reusing request handle: bool(true) ++float(%f) ++float(%f) ++Handles' been cleaned up: ++stdClass Object ++( ++ [http_request] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++) ++Done +--- /dev/null ++++ b/ext/http/tests/redirect_011.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++http_redirect() with params ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=localhost ++--FILE-- ++ 1, 'b' => 2)); ++?> ++--EXPECTF-- ++Status: 302%s ++X-Powered-By: PHP/%a ++Location: http://localhost/redirect?a=1&b=2 ++Content-type: %a ++ ++Redirecting to http://localhost/redirect?a=1&b=2. ++ +--- /dev/null ++++ b/ext/http/tests/redirect_011_logging.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++logging redirects ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=example.com ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d [302-REDIRECT] Location: http%a <%a> ++Done +--- /dev/null ++++ b/ext/http/tests/redirect_012.phpt +@@ -0,0 +1,27 @@ ++--TEST-- ++http_redirect() with session ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=localhost ++--FILE-- ++ 1), true); ++?> ++--EXPECTF-- ++Status: 302%s ++X-Powered-By: PHP/%a ++Set-Cookie: PHPSESSID=%a; path=/ ++Expires: %a ++Cache-Control: %a ++Pragma: %a ++Location: http://localhost/redirect?a=1&PHPSESSID=%a ++Content-type: %a +--- /dev/null ++++ b/ext/http/tests/redirect_012_logging.phpt +@@ -0,0 +1,22 @@ ++--TEST-- ++logging redirects ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=example.com ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d [302-REDIRECT] Location: http%a <%a> ++Done +--- /dev/null ++++ b/ext/http/tests/redirect_013.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++http_redirect() permanent ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=localhost ++--FILE-- ++ ++--EXPECTF-- ++Status: 301%s ++X-Powered-By: PHP/%a ++Location: http://localhost/redirect ++Content-type: %a ++ ++Redirecting to http://localhost/redirect. ++ +--- /dev/null ++++ b/ext/http/tests/redirect_013_logging.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++logging redirects ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=example.com ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d [301-REDIRECT] Location: http%a <%a> ++Done +--- /dev/null ++++ b/ext/http/tests/request_cookies.phpt +@@ -0,0 +1,52 @@ ++--TEST-- ++urlencoded cookies ++--SKIPIF-- ++ ++--FILE-- ++ "val=ue"); ++ ++$r = new HttpRequest("http://dev.iworks.at/ext-http/.print_request.php", HTTP_METH_GET, array("cookies" => $cookies)); ++$r->recordHistory = true; ++$r->send(); ++$r->setOptions(array('encodecookies' => false)); ++$r->send(); ++echo $r->getHistory()->toString(true); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++GET /ext-http/.print_request.php HTTP/1.1 ++User-Agent: %a ++Host: dev.iworks.at ++Accept: */* ++Cookie: name=val%3Due ++HTTP/1.1 200 OK ++%a ++ ++Array ++( ++ [name] => val=ue ++) ++ ++GET /ext-http/.print_request.php HTTP/1.1 ++User-Agent: %a ++Host: dev.iworks.at ++Accept: */* ++Cookie: name=val=ue; ++HTTP/1.1 200 OK ++%a ++ ++Array ++( ++ [name] => val=ue ++) ++ ++Done +--- /dev/null ++++ b/ext/http/tests/request_etag.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++request etag ++--SKIPIF-- ++ ++--FILE-- ++ '"26ad3a-5-95eb19c0"'))); ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++string(%d) "HTTP/1.1 304 Not Modified ++Date: %a ++Server: %a ++ETag: "26ad3a-5-95eb19c0" ++" ++Done +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/request_gzip.phpt +@@ -0,0 +1,51 @@ ++--TEST-- ++GZIP request ++--SKIPIF-- ++ ++--FILE-- ++ true)))); ++ ++echo "Done\n"; ++--EXPECTF-- ++%aTEST ++object(stdClass)%a { ++ ["type"]=> ++ int(2) ++ ["httpVersion"]=> ++ float(1.1) ++ ["responseCode"]=> ++ int(200) ++ ["responseStatus"]=> ++ string(2) "OK" ++ ["headers"]=> ++ array(%d) { ++ %a ++ ["Vary"]=> ++ string(15) "Accept-Encoding" ++ ["Content-Length"]=> ++ string(2) "26" ++ ["Content-Type"]=> ++ string(9) "text/html" ++ ["X-Original-Content-Encoding"]=> ++ string(4) "gzip" ++ ["X-Original-Content-Length"]=> ++ string(2) "51" ++ } ++ ["body"]=> ++ string(26) "Array ++( ++ [gzip] => 1 ++) ++" ++ ["parentMessage"]=> ++ NULL ++} ++Done ++ +--- /dev/null ++++ b/ext/http/tests/request_methods.phpt +@@ -0,0 +1,144 @@ ++--TEST-- ++request methods ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++int(0) ++UNKNOWN ++int(0) ++int(1) ++GET ++int(1) ++int(2) ++HEAD ++int(2) ++int(3) ++POST ++int(3) ++int(4) ++PUT ++int(4) ++int(5) ++DELETE ++int(5) ++int(6) ++OPTIONS ++int(6) ++int(7) ++TRACE ++int(7) ++int(8) ++CONNECT ++int(8) ++int(9) ++PROPFIND ++int(9) ++int(10) ++PROPPATCH ++int(10) ++int(11) ++MKCOL ++int(11) ++int(12) ++COPY ++int(12) ++int(13) ++MOVE ++int(13) ++int(14) ++LOCK ++int(14) ++int(15) ++UNLOCK ++int(15) ++int(16) ++VERSION-CONTROL ++int(16) ++int(17) ++REPORT ++int(17) ++int(18) ++CHECKOUT ++int(18) ++int(19) ++CHECKIN ++int(19) ++int(20) ++UNCHECKOUT ++int(20) ++int(21) ++MKWORKSPACE ++int(21) ++int(22) ++UPDATE ++int(22) ++int(23) ++LABEL ++int(23) ++int(24) ++MERGE ++int(24) ++int(25) ++BASELINE-CONTROL ++int(25) ++int(26) ++MKACTIVITY ++int(26) ++int(27) ++ACL ++int(27) ++int(0) ++UNKNOWN ++int(0) ++int(28) ++int(28) ++int(29) ++int(29) ++int(30) ++int(30) ++int(31) ++int(31) ++int(32) ++int(32) ++bool(true) ++int(0) ++int(0) ++bool(true) ++int(0) ++int(0) ++bool(true) ++int(0) ++int(0) ++bool(true) ++int(0) ++int(0) ++bool(true) ++int(0) ++int(0) ++Done +--- /dev/null ++++ b/ext/http/tests/request_put_data.phpt +@@ -0,0 +1,22 @@ ++--TEST-- ++http_put_data() ++--SKIPIF-- ++ ++--FILE-- ++ CURLBUF_SIZE */); ++$resp = http_put_data("http://dev.iworks.at/ext-http/.print_put.php5", $data); ++$mess = http_parse_message($resp); ++var_dump($data === $mess->body); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++bool(true) ++Done +--- /dev/null ++++ b/ext/http/tests/send_data_001.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++http_send_data() NIL-NUM range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=-5 ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Content-Type: text/plain ++Accept-Ranges: bytes ++Content-Range: bytes 5995-5999/6000 ++Content-Length: 5 ++ ++23abc +--- /dev/null ++++ b/ext/http/tests/send_data_002.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++http_send_data() NUM-NUM range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=5-6 ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Content-Type: text/plain ++Accept-Ranges: bytes ++Content-Range: bytes 5-6/6000 ++Content-Length: 2 ++ ++c1 +--- /dev/null ++++ b/ext/http/tests/send_data_003.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++http_send_data() NUM-NIL range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=5981- ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Content-Type: text/plain ++Accept-Ranges: bytes ++Content-Range: bytes 5981-5999/6000 ++Content-Length: 19 ++ ++c123abc123abc123abc +--- /dev/null ++++ b/ext/http/tests/send_data_004.phpt +@@ -0,0 +1,22 @@ ++--TEST-- ++http_send_data() syntactically invalid range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=123,-wtf ? ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%s ++Content-Type: text/plain ++Accept-Ranges: bytes ++Content-Length: 6000 ++ ++123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/send_data_005.phpt +@@ -0,0 +1,17 @@ ++--TEST-- ++http_send_data() oversized range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=5990-6000 ++--FILE-- ++ ++--EXPECTF-- ++Status: 416%a +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/send_data_006.phpt +@@ -0,0 +1,38 @@ ++--TEST-- ++http_send_data() multiple ranges ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=0-3, 4-5,9-11 ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Type: multipart/byteranges; boundary=%d.%d ++ ++ ++--%d.%d ++Content-Type: text/plain ++Content-Range: bytes 0-3/6000 ++ ++123a ++--%d.%d ++Content-Type: text/plain ++Content-Range: bytes 4-5/6000 ++ ++bc ++--%d.%d ++Content-Type: text/plain ++Content-Range: bytes 9-11/6000 ++ ++abc ++--%d.%d-- +--- /dev/null ++++ b/ext/http/tests/send_data_010.phpt +@@ -0,0 +1,20 @@ ++--TEST-- ++http_send_data() HTTP_SENDBUF_SIZE long string ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Length: 20 ++Content-type: %s ++ ++00000000000000000000 +--- /dev/null ++++ b/ext/http/tests/send_data_011.phpt +@@ -0,0 +1,22 @@ ++--TEST-- ++http_send_data() last modified caching ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%s ++Cache-Control: private, must-revalidate, max-age=0 ++Last-Modified: %s, %d %s %d %d:%d:%d GMT ++Accept-Ranges: bytes ++Content-Length: 4 ++Content-type: %s ++ ++abc +--- /dev/null ++++ b/ext/http/tests/send_failed_precond_001.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++http_send() failed precondition ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=0-1 ++HTTP_IF_UNMODIFIED_SINCE=Thu, 01 Jan 1970 00:16:40 GMT ++--FILE-- ++ ++--EXPECTF-- ++Status: 412%s ++X-Powered-By: %s ++Cache-Control: private, must-revalidate, max-age=0 ++Last-Modified: %s ++Accept-Ranges: bytes ++Content-type: text/html +--- /dev/null ++++ b/ext/http/tests/send_file_005.phpt +@@ -0,0 +1,38 @@ ++--TEST-- ++http_send_file() multiple ranges ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=0-3, 4-5,9-11 ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Type: multipart/byteranges; boundary=%d.%d ++ ++ ++--%d.%d ++Content-Type: text/plain ++Content-Range: bytes 0-3/1010 ++ ++0123 ++--%d.%d ++Content-Type: text/plain ++Content-Range: bytes 4-5/1010 ++ ++45 ++--%d.%d ++Content-Type: text/plain ++Content-Range: bytes 9-11/1010 ++ ++901 ++--%d.%d-- +--- /dev/null ++++ b/ext/http/tests/send_file_008.phpt +@@ -0,0 +1,28 @@ ++--TEST-- ++http_send_file() ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Length: 1010 ++Content-type: %s ++ ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +--- /dev/null ++++ b/ext/http/tests/send_file_009.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++http_send_file() NUM-NUM range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=5-9 ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Range: bytes 5-9/1010 ++Content-Length: 5 ++Content-type: %s ++ ++56789 +--- /dev/null ++++ b/ext/http/tests/send_file_010.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++http_send_file() NIL-NUM range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=-9 ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Range: bytes 1001-1009/1010 ++Content-Length: 9 ++Content-type: %s ++ ++23456789 +--- /dev/null ++++ b/ext/http/tests/send_file_011.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++http_send_file() NUM-NIL range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=1000- ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Range: bytes 1000-1009/1010 ++Content-Length: 10 ++Content-type: %s ++ ++123456789 +--- /dev/null ++++ b/ext/http/tests/send_file_012.phpt +@@ -0,0 +1,30 @@ ++--TEST-- ++http_send_file() syntactically invalid range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=xxx ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Length: 1010 ++Content-type: %s ++ ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +--- /dev/null ++++ b/ext/http/tests/send_file_013.phpt +@@ -0,0 +1,19 @@ ++--TEST-- ++http_send_file() oversized range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=-1111 ++--FILE-- ++ ++--EXPECTF-- ++Status: 416 ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-type: %s +--- /dev/null ++++ b/ext/http/tests/send_ifrange_001.phpt +@@ -0,0 +1,27 @@ ++--TEST-- ++http_send() If-Range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=0-1 ++HTTP_IF_RANGE="abc" ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: %s ++Cache-Control: private, must-revalidate, max-age=0 ++ETag: "abc" ++Accept-Ranges: bytes ++Content-Range: bytes 0-1/%d ++Content-Length: 2 ++Content-type: text/html ++ ++ ++--ENV-- ++HTTP_RANGE=bytes=0-1 ++HTTP_IF_RANGE="abcd" ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: %s ++Cache-Control: private, must-revalidate, max-age=0 ++ETag: "abc" ++Accept-Ranges: bytes ++Content-Length: %d ++Content-type: text/html ++ ++%a +--- /dev/null ++++ b/ext/http/tests/skip.inc +@@ -0,0 +1,15 @@ ++= v%s",$ver)); } ++function checkmax($ver) { skipif(version_compare(PHP_VERSION, $ver) > 0, sprintf("need PHP <= v%s",$ver)); } ++function checkurl($url) { skipif(!@fsockopen($url, 80), "$url not responsive"); } ++function checkcls($cls) { skipif(!class_exists($cls), "need class $cls"); } ++function checkver($ver) { checkmin($ver); } ++checkext('http'); ++?> +--- /dev/null ++++ b/ext/http/tests/stream_filters_001.phpt +@@ -0,0 +1,45 @@ ++--TEST-- ++stream filters ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++string(30) "5 ++Here ++2 ++we ++5 ++ go! ++ ++0 ++" ++string(12) "Here we go! ++" ++Done +--- /dev/null ++++ b/ext/http/tests/stream_filters_002.phpt +@@ -0,0 +1,50 @@ ++--TEST-- ++gzip stream filters ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++bool(true) ++bool(true) ++bool(true) ++Done +--- /dev/null ++++ b/ext/http/tests/stream_filters_003.phpt +@@ -0,0 +1,42 @@ ++--TEST-- ++stream filter fun ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++This is some stream filter fun; we'll see if it bails out or not. ++The text should come out at the other end of the stream exactly like written to it. ++Go figure! +--- /dev/null ++++ b/ext/http/tests/urls.txt +@@ -0,0 +1,49 @@ ++http://www.microsoft.com ++http://www.opensource.org ++http://www.google.com ++http://www.yahoo.com ++http://www.ibm.com ++http://www.mysql.com ++http://www.oracle.com ++http://www.ripe.net ++http://www.iana.org ++http://www.amazon.com ++http://www.netcraft.com ++http://www.heise.de ++http://www.chip.de ++http://www.ca.com ++http://www.cnet.com ++http://www.news.com ++http://www.cnn.com ++http://www.wikipedia.org ++http://www.dell.com ++http://www.hp.com ++http://www.cert.org ++http://www.mit.edu ++http://www.nist.gov ++http://www.ebay.com ++http://www.playstation.com ++http://www.uefa.com ++http://www.ieee.org ++http://www.apple.com ++http://www.sony.com ++http://www.symantec.com ++http://www.zdnet.com ++http://www.fujitsu.com ++http://www.supermicro.com ++http://www.hotmail.com ++http://www.ecma.com ++http://www.bbc.co.uk ++http://news.google.com ++http://www.foxnews.com ++http://www.msn.com ++http://www.wired.com ++http://www.sky.com ++http://www.usatoday.com ++http://www.cbs.com ++http://www.nbc.com ++http://slashdot.org ++http://www.bloglines.com ++http://www.techweb.com ++http://www.newslink.org ++http://www.un.org +\ No newline at end of file diff --git a/lang/php5/patches/090-restore-sqlite2.patch b/lang/php5/patches/090-restore-sqlite2.patch new file mode 100644 index 0000000..27bcec5 --- /dev/null +++ b/lang/php5/patches/090-restore-sqlite2.patch @@ -0,0 +1,50845 @@ +--- /dev/null ++++ b/ext/sqlite/config.m4 +@@ -0,0 +1,157 @@ ++dnl $Id$ ++dnl config.m4 for extension sqlite ++dnl vim:et:ts=2:sw=2 ++ ++PHP_ARG_WITH(sqlite, for sqlite support, ++[ --without-sqlite=DIR Do not include sqlite support. DIR is the sqlite base ++ install directory [BUNDLED]], yes) ++ ++PHP_ARG_ENABLE(sqlite-utf8, whether to enable UTF-8 support in sqlite (default: ISO-8859-1), ++[ --enable-sqlite-utf8 SQLite: Enable UTF-8 support for SQLite], no, no) ++ ++ ++ ++dnl ++dnl PHP_PROG_LEMON ++dnl ++dnl Search for lemon binary and check its version ++dnl ++AC_DEFUN([PHP_PROG_LEMON],[ ++ # we only support certain lemon versions ++ lemon_version_list="1.0" ++ ++ AC_CHECK_PROG(LEMON, lemon, lemon) ++ if test "$LEMON"; then ++ AC_CACHE_CHECK([for lemon version], php_cv_lemon_version, [ ++ lemon_version=`$LEMON -x 2>/dev/null | $SED -e 's/^.* //'` ++ php_cv_lemon_version=invalid ++ for lemon_check_version in $lemon_version_list; do ++ if test "$lemon_version" = "$lemon_check_version"; then ++ php_cv_lemon_version="$lemon_check_version (ok)" ++ fi ++ done ++ ]) ++ else ++ lemon_version=none ++ fi ++ case $php_cv_lemon_version in ++ ""|invalid[)] ++ lemon_msg="lemon versions supported for regeneration of libsqlite parsers: $lemon_version_list (found: $lemon_version)." ++ AC_MSG_WARN([$lemon_msg]) ++ LEMON="exit 0;" ++ ;; ++ esac ++ PHP_SUBST(LEMON) ++]) ++ ++ ++if test "$PHP_SQLITE" != "no"; then ++ if test "$PHP_PDO" != "no"; then ++ PHP_CHECK_PDO_INCLUDES([], [AC_MSG_WARN([Cannot find php_pdo_driver.h.])]) ++ if test -n "$pdo_inc_path"; then ++ AC_DEFINE([PHP_SQLITE2_HAVE_PDO], [1], [Have PDO]) ++ pdo_inc_path="-I$pdo_inc_path" ++ fi ++ fi ++ ++ if test "$PHP_SQLITE" != "yes"; then ++ SEARCH_PATH="/usr/local /usr" ++ SEARCH_FOR="/include/sqlite.h" ++ if test -r $PHP_SQLITE/; then # path given as parameter ++ SQLITE_DIR=$PHP_SQLITE ++ else # search default path list ++ AC_MSG_CHECKING([for sqlite files in default path]) ++ for i in $SEARCH_PATH ; do ++ if test -r $i/$SEARCH_FOR; then ++ SQLITE_DIR=$i ++ AC_MSG_RESULT(found in $i) ++ fi ++ done ++ fi ++ ++ if test -z "$SQLITE_DIR"; then ++ AC_MSG_RESULT([not found]) ++ AC_MSG_ERROR([Please reinstall the sqlite distribution from http://www.sqlite.org]) ++ fi ++ ++ PHP_CHECK_LIBRARY(sqlite, sqlite_open, [ ++ PHP_ADD_LIBRARY_WITH_PATH(sqlite, $SQLITE_DIR/$PHP_LIBDIR, SQLITE_SHARED_LIBADD) ++ PHP_ADD_INCLUDE($SQLITE_DIR/include) ++ ],[ ++ AC_MSG_ERROR([wrong sqlite lib version or lib not found]) ++ ],[ ++ -L$SQLITE_DIR/$PHP_LIBDIR -lm ++ ]) ++ SQLITE_MODULE_TYPE=external ++ PHP_SQLITE_CFLAGS=$pdo_inc_path ++ sqlite_extra_sources="libsqlite/src/encode.c" ++ else ++ # use bundled library ++ PHP_PROG_LEMON ++ SQLITE_MODULE_TYPE=builtin ++ PHP_SQLITE_CFLAGS="-I@ext_srcdir@/libsqlite/src -I@ext_builddir@/libsqlite/src $pdo_inc_path" ++ sqlite_extra_sources="libsqlite/src/opcodes.c \ ++ libsqlite/src/parse.c libsqlite/src/encode.c \ ++ libsqlite/src/auth.c libsqlite/src/btree.c libsqlite/src/build.c \ ++ libsqlite/src/delete.c libsqlite/src/expr.c libsqlite/src/func.c \ ++ libsqlite/src/hash.c libsqlite/src/insert.c libsqlite/src/main.c \ ++ libsqlite/src/os.c libsqlite/src/pager.c \ ++ libsqlite/src/printf.c libsqlite/src/random.c \ ++ libsqlite/src/select.c libsqlite/src/table.c libsqlite/src/tokenize.c \ ++ libsqlite/src/update.c libsqlite/src/util.c libsqlite/src/vdbe.c \ ++ libsqlite/src/attach.c libsqlite/src/btree_rb.c libsqlite/src/pragma.c \ ++ libsqlite/src/vacuum.c libsqlite/src/copy.c \ ++ libsqlite/src/vdbeaux.c libsqlite/src/date.c \ ++ libsqlite/src/where.c libsqlite/src/trigger.c" ++ fi ++ dnl ++ dnl Common for both bundled/external ++ dnl ++ sqlite_sources="sqlite.c sess_sqlite.c pdo_sqlite2.c $sqlite_extra_sources" ++ PHP_NEW_EXTENSION(sqlite, $sqlite_sources, $ext_shared,,$PHP_SQLITE_CFLAGS) ++ PHP_ADD_EXTENSION_DEP(sqlite, spl, true) ++ PHP_ADD_EXTENSION_DEP(sqlite, pdo, true) ++ ++ PHP_ADD_MAKEFILE_FRAGMENT ++ PHP_SUBST(SQLITE_SHARED_LIBADD) ++ PHP_INSTALL_HEADERS([$ext_builddir/libsqlite/src/sqlite.h]) ++ ++ if test "$SQLITE_MODULE_TYPE" = "builtin"; then ++ PHP_ADD_BUILD_DIR($ext_builddir/libsqlite/src, 1) ++ AC_CHECK_SIZEOF(char *, 4) ++ AC_DEFINE(SQLITE_PTR_SZ, SIZEOF_CHAR_P, [Size of a pointer]) ++ dnl use latin 1 for SQLite older than 2.8.9; the utf-8 handling ++ dnl in funcs.c uses assert(), which is a bit silly and something ++ dnl we want to avoid. This assert() was removed in SQLite 2.8.9. ++ if test "$PHP_SQLITE_UTF8" = "yes"; then ++ SQLITE_ENCODING="UTF8" ++ AC_DEFINE(SQLITE_UTF8, 1, [ ]) ++ else ++ SQLITE_ENCODING="ISO8859" ++ fi ++ PHP_SUBST(SQLITE_ENCODING) ++ ++ SQLITE_VERSION=`cat $ext_srcdir/libsqlite/VERSION` ++ PHP_SUBST(SQLITE_VERSION) ++ ++ sed -e s/--VERS--/$SQLITE_VERSION/ -e s/--ENCODING--/$SQLITE_ENCODING/ $ext_srcdir/libsqlite/src/sqlite.h.in > $ext_builddir/libsqlite/src/sqlite.h ++ ++ if test "$ext_shared" = "no" || test "$ext_srcdir" != "$abs_srcdir"; then ++ echo '#include ' > $ext_builddir/libsqlite/src/config.h ++ else ++ echo "#include \"$abs_builddir/config.h\"" > $ext_builddir/libsqlite/src/config.h ++ fi ++ ++ cat >> $ext_builddir/libsqlite/src/config.h <explain ) return; ++ db = pParse->db; ++ if( db->file_format<4 ){ ++ sqliteErrorMsg(pParse, "cannot attach auxiliary databases to an " ++ "older format master database", 0); ++ pParse->rc = SQLITE_ERROR; ++ return; ++ } ++ if( db->nDb>=MAX_ATTACHED+2 ){ ++ sqliteErrorMsg(pParse, "too many attached databases - max %d", ++ MAX_ATTACHED); ++ pParse->rc = SQLITE_ERROR; ++ return; ++ } ++ ++ zFile = 0; ++ sqliteSetNString(&zFile, pFilename->z, pFilename->n, 0); ++ if( zFile==0 ) return; ++ sqliteDequote(zFile); ++#ifndef SQLITE_OMIT_AUTHORIZATION ++ if( sqliteAuthCheck(pParse, SQLITE_ATTACH, zFile, 0, 0)!=SQLITE_OK ){ ++ sqliteFree(zFile); ++ return; ++ } ++#endif /* SQLITE_OMIT_AUTHORIZATION */ ++ ++ zName = 0; ++ sqliteSetNString(&zName, pDbname->z, pDbname->n, 0); ++ if( zName==0 ) return; ++ sqliteDequote(zName); ++ for(i=0; inDb; i++){ ++ if( db->aDb[i].zName && sqliteStrICmp(db->aDb[i].zName, zName)==0 ){ ++ sqliteErrorMsg(pParse, "database %z is already in use", zName); ++ pParse->rc = SQLITE_ERROR; ++ sqliteFree(zFile); ++ return; ++ } ++ } ++ ++ if( db->aDb==db->aDbStatic ){ ++ aNew = sqliteMalloc( sizeof(db->aDb[0])*3 ); ++ if( aNew==0 ) return; ++ memcpy(aNew, db->aDb, sizeof(db->aDb[0])*2); ++ }else{ ++ aNew = sqliteRealloc(db->aDb, sizeof(db->aDb[0])*(db->nDb+1) ); ++ if( aNew==0 ) return; ++ } ++ db->aDb = aNew; ++ aNew = &db->aDb[db->nDb++]; ++ memset(aNew, 0, sizeof(*aNew)); ++ sqliteHashInit(&aNew->tblHash, SQLITE_HASH_STRING, 0); ++ sqliteHashInit(&aNew->idxHash, SQLITE_HASH_STRING, 0); ++ sqliteHashInit(&aNew->trigHash, SQLITE_HASH_STRING, 0); ++ sqliteHashInit(&aNew->aFKey, SQLITE_HASH_STRING, 1); ++ aNew->zName = zName; ++ rc = sqliteBtreeFactory(db, zFile, 0, MAX_PAGES, &aNew->pBt); ++ if( rc ){ ++ sqliteErrorMsg(pParse, "unable to open database: %s", zFile); ++ } ++#if SQLITE_HAS_CODEC ++ { ++ extern int sqliteCodecAttach(sqlite*, int, void*, int); ++ char *zKey = 0; ++ int nKey; ++ if( pKey && pKey->z && pKey->n ){ ++ sqliteSetNString(&zKey, pKey->z, pKey->n, 0); ++ sqliteDequote(zKey); ++ nKey = strlen(zKey); ++ }else{ ++ zKey = 0; ++ nKey = 0; ++ } ++ sqliteCodecAttach(db, db->nDb-1, zKey, nKey); ++ } ++#endif ++ sqliteFree(zFile); ++ db->flags &= ~SQLITE_Initialized; ++ if( pParse->nErr ) return; ++ if( rc==SQLITE_OK ){ ++ rc = sqliteInit(pParse->db, &pParse->zErrMsg); ++ } ++ if( rc ){ ++ int i = db->nDb - 1; ++ assert( i>=2 ); ++ if( db->aDb[i].pBt ){ ++ sqliteBtreeClose(db->aDb[i].pBt); ++ db->aDb[i].pBt = 0; ++ } ++ sqliteResetInternalSchema(db, 0); ++ pParse->nErr++; ++ pParse->rc = SQLITE_ERROR; ++ } ++} ++ ++/* ++** This routine is called by the parser to process a DETACH statement: ++** ++** DETACH DATABASE dbname ++** ++** The pDbname argument is the name of the database in the DETACH statement. ++*/ ++void sqliteDetach(Parse *pParse, Token *pDbname){ ++ int i; ++ sqlite *db; ++ Vdbe *v; ++ Db *pDb; ++ ++ v = sqliteGetVdbe(pParse); ++ sqliteVdbeAddOp(v, OP_Halt, 0, 0); ++ if( pParse->explain ) return; ++ db = pParse->db; ++ for(i=0; inDb; i++){ ++ pDb = &db->aDb[i]; ++ if( pDb->pBt==0 || pDb->zName==0 ) continue; ++ if( strlen(pDb->zName)!=pDbname->n ) continue; ++ if( sqliteStrNICmp(pDb->zName, pDbname->z, pDbname->n)==0 ) break; ++ } ++ if( i>=db->nDb ){ ++ sqliteErrorMsg(pParse, "no such database: %T", pDbname); ++ return; ++ } ++ if( i<2 ){ ++ sqliteErrorMsg(pParse, "cannot detach database %T", pDbname); ++ return; ++ } ++#ifndef SQLITE_OMIT_AUTHORIZATION ++ if( sqliteAuthCheck(pParse,SQLITE_DETACH,db->aDb[i].zName,0,0)!=SQLITE_OK ){ ++ return; ++ } ++#endif /* SQLITE_OMIT_AUTHORIZATION */ ++ sqliteBtreeClose(pDb->pBt); ++ pDb->pBt = 0; ++ sqliteFree(pDb->zName); ++ sqliteResetInternalSchema(db, i); ++ if( pDb->pAux && pDb->xFreeAux ) pDb->xFreeAux(pDb->pAux); ++ db->nDb--; ++ if( inDb ){ ++ db->aDb[i] = db->aDb[db->nDb]; ++ memset(&db->aDb[db->nDb], 0, sizeof(db->aDb[0])); ++ sqliteResetInternalSchema(db, i); ++ } ++} ++ ++/* ++** Initialize a DbFixer structure. This routine must be called prior ++** to passing the structure to one of the sqliteFixAAAA() routines below. ++** ++** The return value indicates whether or not fixation is required. TRUE ++** means we do need to fix the database references, FALSE means we do not. ++*/ ++int sqliteFixInit( ++ DbFixer *pFix, /* The fixer to be initialized */ ++ Parse *pParse, /* Error messages will be written here */ ++ int iDb, /* This is the database that must must be used */ ++ const char *zType, /* "view", "trigger", or "index" */ ++ const Token *pName /* Name of the view, trigger, or index */ ++){ ++ sqlite *db; ++ ++ if( iDb<0 || iDb==1 ) return 0; ++ db = pParse->db; ++ assert( db->nDb>iDb ); ++ pFix->pParse = pParse; ++ pFix->zDb = db->aDb[iDb].zName; ++ pFix->zType = zType; ++ pFix->pName = pName; ++ return 1; ++} ++ ++/* ++** The following set of routines walk through the parse tree and assign ++** a specific database to all table references where the database name ++** was left unspecified in the original SQL statement. The pFix structure ++** must have been initialized by a prior call to sqliteFixInit(). ++** ++** These routines are used to make sure that an index, trigger, or ++** view in one database does not refer to objects in a different database. ++** (Exception: indices, triggers, and views in the TEMP database are ++** allowed to refer to anything.) If a reference is explicitly made ++** to an object in a different database, an error message is added to ++** pParse->zErrMsg and these routines return non-zero. If everything ++** checks out, these routines return 0. ++*/ ++int sqliteFixSrcList( ++ DbFixer *pFix, /* Context of the fixation */ ++ SrcList *pList /* The Source list to check and modify */ ++){ ++ int i; ++ const char *zDb; ++ ++ if( pList==0 ) return 0; ++ zDb = pFix->zDb; ++ for(i=0; inSrc; i++){ ++ if( pList->a[i].zDatabase==0 ){ ++ pList->a[i].zDatabase = sqliteStrDup(zDb); ++ }else if( sqliteStrICmp(pList->a[i].zDatabase,zDb)!=0 ){ ++ sqliteErrorMsg(pFix->pParse, ++ "%s %z cannot reference objects in database %s", ++ pFix->zType, sqliteStrNDup(pFix->pName->z, pFix->pName->n), ++ pList->a[i].zDatabase); ++ return 1; ++ } ++ if( sqliteFixSelect(pFix, pList->a[i].pSelect) ) return 1; ++ if( sqliteFixExpr(pFix, pList->a[i].pOn) ) return 1; ++ } ++ return 0; ++} ++int sqliteFixSelect( ++ DbFixer *pFix, /* Context of the fixation */ ++ Select *pSelect /* The SELECT statement to be fixed to one database */ ++){ ++ while( pSelect ){ ++ if( sqliteFixExprList(pFix, pSelect->pEList) ){ ++ return 1; ++ } ++ if( sqliteFixSrcList(pFix, pSelect->pSrc) ){ ++ return 1; ++ } ++ if( sqliteFixExpr(pFix, pSelect->pWhere) ){ ++ return 1; ++ } ++ if( sqliteFixExpr(pFix, pSelect->pHaving) ){ ++ return 1; ++ } ++ pSelect = pSelect->pPrior; ++ } ++ return 0; ++} ++int sqliteFixExpr( ++ DbFixer *pFix, /* Context of the fixation */ ++ Expr *pExpr /* The expression to be fixed to one database */ ++){ ++ while( pExpr ){ ++ if( sqliteFixSelect(pFix, pExpr->pSelect) ){ ++ return 1; ++ } ++ if( sqliteFixExprList(pFix, pExpr->pList) ){ ++ return 1; ++ } ++ if( sqliteFixExpr(pFix, pExpr->pRight) ){ ++ return 1; ++ } ++ pExpr = pExpr->pLeft; ++ } ++ return 0; ++} ++int sqliteFixExprList( ++ DbFixer *pFix, /* Context of the fixation */ ++ ExprList *pList /* The expression to be fixed to one database */ ++){ ++ int i; ++ if( pList==0 ) return 0; ++ for(i=0; inExpr; i++){ ++ if( sqliteFixExpr(pFix, pList->a[i].pExpr) ){ ++ return 1; ++ } ++ } ++ return 0; ++} ++int sqliteFixTriggerStep( ++ DbFixer *pFix, /* Context of the fixation */ ++ TriggerStep *pStep /* The trigger step be fixed to one database */ ++){ ++ while( pStep ){ ++ if( sqliteFixSelect(pFix, pStep->pSelect) ){ ++ return 1; ++ } ++ if( sqliteFixExpr(pFix, pStep->pWhere) ){ ++ return 1; ++ } ++ if( sqliteFixExprList(pFix, pStep->pExprList) ){ ++ return 1; ++ } ++ pStep = pStep->pNext; ++ } ++ return 0; ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/auth.c +@@ -0,0 +1,219 @@ ++/* ++** 2003 January 11 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This file contains code used to implement the sqlite_set_authorizer() ++** API. This facility is an optional feature of the library. Embedded ++** systems that do not need this facility may omit it by recompiling ++** the library with -DSQLITE_OMIT_AUTHORIZATION=1 ++** ++** $Id$ ++*/ ++#include "sqliteInt.h" ++ ++/* ++** All of the code in this file may be omitted by defining a single ++** macro. ++*/ ++#ifndef SQLITE_OMIT_AUTHORIZATION ++ ++/* ++** Set or clear the access authorization function. ++** ++** The access authorization function is be called during the compilation ++** phase to verify that the user has read and/or write access permission on ++** various fields of the database. The first argument to the auth function ++** is a copy of the 3rd argument to this routine. The second argument ++** to the auth function is one of these constants: ++** ++** SQLITE_COPY ++** SQLITE_CREATE_INDEX ++** SQLITE_CREATE_TABLE ++** SQLITE_CREATE_TEMP_INDEX ++** SQLITE_CREATE_TEMP_TABLE ++** SQLITE_CREATE_TEMP_TRIGGER ++** SQLITE_CREATE_TEMP_VIEW ++** SQLITE_CREATE_TRIGGER ++** SQLITE_CREATE_VIEW ++** SQLITE_DELETE ++** SQLITE_DROP_INDEX ++** SQLITE_DROP_TABLE ++** SQLITE_DROP_TEMP_INDEX ++** SQLITE_DROP_TEMP_TABLE ++** SQLITE_DROP_TEMP_TRIGGER ++** SQLITE_DROP_TEMP_VIEW ++** SQLITE_DROP_TRIGGER ++** SQLITE_DROP_VIEW ++** SQLITE_INSERT ++** SQLITE_PRAGMA ++** SQLITE_READ ++** SQLITE_SELECT ++** SQLITE_TRANSACTION ++** SQLITE_UPDATE ++** ++** The third and fourth arguments to the auth function are the name of ++** the table and the column that are being accessed. The auth function ++** should return either SQLITE_OK, SQLITE_DENY, or SQLITE_IGNORE. If ++** SQLITE_OK is returned, it means that access is allowed. SQLITE_DENY ++** means that the SQL statement will never-run - the sqlite_exec() call ++** will return with an error. SQLITE_IGNORE means that the SQL statement ++** should run but attempts to read the specified column will return NULL ++** and attempts to write the column will be ignored. ++** ++** Setting the auth function to NULL disables this hook. The default ++** setting of the auth function is NULL. ++*/ ++int sqlite_set_authorizer( ++ sqlite *db, ++ int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), ++ void *pArg ++){ ++ db->xAuth = xAuth; ++ db->pAuthArg = pArg; ++ return SQLITE_OK; ++} ++ ++/* ++** Write an error message into pParse->zErrMsg that explains that the ++** user-supplied authorization function returned an illegal value. ++*/ ++static void sqliteAuthBadReturnCode(Parse *pParse, int rc){ ++ sqliteErrorMsg(pParse, "illegal return value (%d) from the " ++ "authorization function - should be SQLITE_OK, SQLITE_IGNORE, " ++ "or SQLITE_DENY", rc); ++ pParse->rc = SQLITE_MISUSE; ++} ++ ++/* ++** The pExpr should be a TK_COLUMN expression. The table referred to ++** is in pTabList or else it is the NEW or OLD table of a trigger. ++** Check to see if it is OK to read this particular column. ++** ++** If the auth function returns SQLITE_IGNORE, change the TK_COLUMN ++** instruction into a TK_NULL. If the auth function returns SQLITE_DENY, ++** then generate an error. ++*/ ++void sqliteAuthRead( ++ Parse *pParse, /* The parser context */ ++ Expr *pExpr, /* The expression to check authorization on */ ++ SrcList *pTabList /* All table that pExpr might refer to */ ++){ ++ sqlite *db = pParse->db; ++ int rc; ++ Table *pTab; /* The table being read */ ++ const char *zCol; /* Name of the column of the table */ ++ int iSrc; /* Index in pTabList->a[] of table being read */ ++ const char *zDBase; /* Name of database being accessed */ ++ TriggerStack *pStack; /* The stack of current triggers */ ++ ++ if( db->xAuth==0 ) return; ++ assert( pExpr->op==TK_COLUMN ); ++ for(iSrc=0; iSrcnSrc; iSrc++){ ++ if( pExpr->iTable==pTabList->a[iSrc].iCursor ) break; ++ } ++ if( iSrc>=0 && iSrcnSrc ){ ++ pTab = pTabList->a[iSrc].pTab; ++ }else if( (pStack = pParse->trigStack)!=0 ){ ++ /* This must be an attempt to read the NEW or OLD pseudo-tables ++ ** of a trigger. ++ */ ++ assert( pExpr->iTable==pStack->newIdx || pExpr->iTable==pStack->oldIdx ); ++ pTab = pStack->pTab; ++ }else{ ++ return; ++ } ++ if( pTab==0 ) return; ++ if( pExpr->iColumn>=0 ){ ++ assert( pExpr->iColumnnCol ); ++ zCol = pTab->aCol[pExpr->iColumn].zName; ++ }else if( pTab->iPKey>=0 ){ ++ assert( pTab->iPKeynCol ); ++ zCol = pTab->aCol[pTab->iPKey].zName; ++ }else{ ++ zCol = "ROWID"; ++ } ++ assert( pExpr->iDbnDb ); ++ zDBase = db->aDb[pExpr->iDb].zName; ++ rc = db->xAuth(db->pAuthArg, SQLITE_READ, pTab->zName, zCol, zDBase, ++ pParse->zAuthContext); ++ if( rc==SQLITE_IGNORE ){ ++ pExpr->op = TK_NULL; ++ }else if( rc==SQLITE_DENY ){ ++ if( db->nDb>2 || pExpr->iDb!=0 ){ ++ sqliteErrorMsg(pParse, "access to %s.%s.%s is prohibited", ++ zDBase, pTab->zName, zCol); ++ }else{ ++ sqliteErrorMsg(pParse, "access to %s.%s is prohibited", pTab->zName,zCol); ++ } ++ pParse->rc = SQLITE_AUTH; ++ }else if( rc!=SQLITE_OK ){ ++ sqliteAuthBadReturnCode(pParse, rc); ++ } ++} ++ ++/* ++** Do an authorization check using the code and arguments given. Return ++** either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY ++** is returned, then the error count and error message in pParse are ++** modified appropriately. ++*/ ++int sqliteAuthCheck( ++ Parse *pParse, ++ int code, ++ const char *zArg1, ++ const char *zArg2, ++ const char *zArg3 ++){ ++ sqlite *db = pParse->db; ++ int rc; ++ ++ if( db->init.busy || db->xAuth==0 ){ ++ return SQLITE_OK; ++ } ++ rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext); ++ if( rc==SQLITE_DENY ){ ++ sqliteErrorMsg(pParse, "not authorized"); ++ pParse->rc = SQLITE_AUTH; ++ }else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){ ++ rc = SQLITE_DENY; ++ sqliteAuthBadReturnCode(pParse, rc); ++ } ++ return rc; ++} ++ ++/* ++** Push an authorization context. After this routine is called, the ++** zArg3 argument to authorization callbacks will be zContext until ++** popped. Or if pParse==0, this routine is a no-op. ++*/ ++void sqliteAuthContextPush( ++ Parse *pParse, ++ AuthContext *pContext, ++ const char *zContext ++){ ++ pContext->pParse = pParse; ++ if( pParse ){ ++ pContext->zAuthContext = pParse->zAuthContext; ++ pParse->zAuthContext = zContext; ++ } ++} ++ ++/* ++** Pop an authorization context that was previously pushed ++** by sqliteAuthContextPush ++*/ ++void sqliteAuthContextPop(AuthContext *pContext){ ++ if( pContext->pParse ){ ++ pContext->pParse->zAuthContext = pContext->zAuthContext; ++ pContext->pParse = 0; ++ } ++} ++ ++#endif /* SQLITE_OMIT_AUTHORIZATION */ +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/btree.c +@@ -0,0 +1,3584 @@ ++/* ++** 2001 September 15 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** $Id$ ++** ++** This file implements a external (disk-based) database using BTrees. ++** For a detailed discussion of BTrees, refer to ++** ++** Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3: ++** "Sorting And Searching", pages 473-480. Addison-Wesley ++** Publishing Company, Reading, Massachusetts. ++** ++** The basic idea is that each page of the file contains N database ++** entries and N+1 pointers to subpages. ++** ++** ---------------------------------------------------------------- ++** | Ptr(0) | Key(0) | Ptr(1) | Key(1) | ... | Key(N) | Ptr(N+1) | ++** ---------------------------------------------------------------- ++** ++** All of the keys on the page that Ptr(0) points to have values less ++** than Key(0). All of the keys on page Ptr(1) and its subpages have ++** values greater than Key(0) and less than Key(1). All of the keys ++** on Ptr(N+1) and its subpages have values greater than Key(N). And ++** so forth. ++** ++** Finding a particular key requires reading O(log(M)) pages from the ++** disk where M is the number of entries in the tree. ++** ++** In this implementation, a single file can hold one or more separate ++** BTrees. Each BTree is identified by the index of its root page. The ++** key and data for any entry are combined to form the "payload". Up to ++** MX_LOCAL_PAYLOAD bytes of payload can be carried directly on the ++** database page. If the payload is larger than MX_LOCAL_PAYLOAD bytes ++** then surplus bytes are stored on overflow pages. The payload for an ++** entry and the preceding pointer are combined to form a "Cell". Each ++** page has a small header which contains the Ptr(N+1) pointer. ++** ++** The first page of the file contains a magic string used to verify that ++** the file really is a valid BTree database, a pointer to a list of unused ++** pages in the file, and some meta information. The root of the first ++** BTree begins on page 2 of the file. (Pages are numbered beginning with ++** 1, not 0.) Thus a minimum database contains 2 pages. ++*/ ++#include "sqliteInt.h" ++#include "pager.h" ++#include "btree.h" ++#include ++ ++/* Forward declarations */ ++static BtOps sqliteBtreeOps; ++static BtCursorOps sqliteBtreeCursorOps; ++ ++/* ++** Macros used for byteswapping. B is a pointer to the Btree ++** structure. This is needed to access the Btree.needSwab boolean ++** in order to tell if byte swapping is needed or not. ++** X is an unsigned integer. SWAB16 byte swaps a 16-bit integer. ++** SWAB32 byteswaps a 32-bit integer. ++*/ ++#define SWAB16(B,X) ((B)->needSwab? swab16((u16)X) : ((u16)X)) ++#define SWAB32(B,X) ((B)->needSwab? swab32(X) : (X)) ++#define SWAB_ADD(B,X,A) \ ++ if((B)->needSwab){ X=swab32(swab32(X)+A); }else{ X += (A); } ++ ++/* ++** The following global variable - available only if SQLITE_TEST is ++** defined - is used to determine whether new databases are created in ++** native byte order or in non-native byte order. Non-native byte order ++** databases are created for testing purposes only. Under normal operation, ++** only native byte-order databases should be created, but we should be ++** able to read or write existing databases regardless of the byteorder. ++*/ ++#ifdef SQLITE_TEST ++int btree_native_byte_order = 1; ++#else ++# define btree_native_byte_order 1 ++#endif ++ ++/* ++** Forward declarations of structures used only in this file. ++*/ ++typedef struct PageOne PageOne; ++typedef struct MemPage MemPage; ++typedef struct PageHdr PageHdr; ++typedef struct Cell Cell; ++typedef struct CellHdr CellHdr; ++typedef struct FreeBlk FreeBlk; ++typedef struct OverflowPage OverflowPage; ++typedef struct FreelistInfo FreelistInfo; ++ ++/* ++** All structures on a database page are aligned to 4-byte boundries. ++** This routine rounds up a number of bytes to the next multiple of 4. ++** ++** This might need to change for computer architectures that require ++** and 8-byte alignment boundry for structures. ++*/ ++#define ROUNDUP(X) ((X+3) & ~3) ++ ++/* ++** This is a magic string that appears at the beginning of every ++** SQLite database in order to identify the file as a real database. ++*/ ++static const char zMagicHeader[] = ++ "** This file contains an SQLite 2.1 database **"; ++#define MAGIC_SIZE (sizeof(zMagicHeader)) ++ ++/* ++** This is a magic integer also used to test the integrity of the database ++** file. This integer is used in addition to the string above so that ++** if the file is written on a little-endian architecture and read ++** on a big-endian architectures (or vice versa) we can detect the ++** problem. ++** ++** The number used was obtained at random and has no special ++** significance other than the fact that it represents a different ++** integer on little-endian and big-endian machines. ++*/ ++#define MAGIC 0xdae37528 ++ ++/* ++** The first page of the database file contains a magic header string ++** to identify the file as an SQLite database file. It also contains ++** a pointer to the first free page of the file. Page 2 contains the ++** root of the principle BTree. The file might contain other BTrees ++** rooted on pages above 2. ++** ++** The first page also contains SQLITE_N_BTREE_META integers that ++** can be used by higher-level routines. ++** ++** Remember that pages are numbered beginning with 1. (See pager.c ++** for additional information.) Page 0 does not exist and a page ++** number of 0 is used to mean "no such page". ++*/ ++struct PageOne { ++ char zMagic[MAGIC_SIZE]; /* String that identifies the file as a database */ ++ int iMagic; /* Integer to verify correct byte order */ ++ Pgno freeList; /* First free page in a list of all free pages */ ++ int nFree; /* Number of pages on the free list */ ++ int aMeta[SQLITE_N_BTREE_META-1]; /* User defined integers */ ++}; ++ ++/* ++** Each database page has a header that is an instance of this ++** structure. ++** ++** PageHdr.firstFree is 0 if there is no free space on this page. ++** Otherwise, PageHdr.firstFree is the index in MemPage.u.aDisk[] of a ++** FreeBlk structure that describes the first block of free space. ++** All free space is defined by a linked list of FreeBlk structures. ++** ++** Data is stored in a linked list of Cell structures. PageHdr.firstCell ++** is the index into MemPage.u.aDisk[] of the first cell on the page. The ++** Cells are kept in sorted order. ++** ++** A Cell contains all information about a database entry and a pointer ++** to a child page that contains other entries less than itself. In ++** other words, the i-th Cell contains both Ptr(i) and Key(i). The ++** right-most pointer of the page is contained in PageHdr.rightChild. ++*/ ++struct PageHdr { ++ Pgno rightChild; /* Child page that comes after all cells on this page */ ++ u16 firstCell; /* Index in MemPage.u.aDisk[] of the first cell */ ++ u16 firstFree; /* Index in MemPage.u.aDisk[] of the first free block */ ++}; ++ ++/* ++** Entries on a page of the database are called "Cells". Each Cell ++** has a header and data. This structure defines the header. The ++** key and data (collectively the "payload") follow this header on ++** the database page. ++** ++** A definition of the complete Cell structure is given below. The ++** header for the cell must be defined first in order to do some ++** of the sizing #defines that follow. ++*/ ++struct CellHdr { ++ Pgno leftChild; /* Child page that comes before this cell */ ++ u16 nKey; /* Number of bytes in the key */ ++ u16 iNext; /* Index in MemPage.u.aDisk[] of next cell in sorted order */ ++ u8 nKeyHi; /* Upper 8 bits of key size for keys larger than 64K bytes */ ++ u8 nDataHi; /* Upper 8 bits of data size when the size is more than 64K */ ++ u16 nData; /* Number of bytes of data */ ++}; ++ ++/* ++** The key and data size are split into a lower 16-bit segment and an ++** upper 8-bit segment in order to pack them together into a smaller ++** space. The following macros reassembly a key or data size back ++** into an integer. ++*/ ++#define NKEY(b,h) (SWAB16(b,h.nKey) + h.nKeyHi*65536) ++#define NDATA(b,h) (SWAB16(b,h.nData) + h.nDataHi*65536) ++ ++/* ++** The minimum size of a complete Cell. The Cell must contain a header ++** and at least 4 bytes of payload. ++*/ ++#define MIN_CELL_SIZE (sizeof(CellHdr)+4) ++ ++/* ++** The maximum number of database entries that can be held in a single ++** page of the database. ++*/ ++#define MX_CELL ((SQLITE_USABLE_SIZE-sizeof(PageHdr))/MIN_CELL_SIZE) ++ ++/* ++** The amount of usable space on a single page of the BTree. This is the ++** page size minus the overhead of the page header. ++*/ ++#define USABLE_SPACE (SQLITE_USABLE_SIZE - sizeof(PageHdr)) ++ ++/* ++** The maximum amount of payload (in bytes) that can be stored locally for ++** a database entry. If the entry contains more data than this, the ++** extra goes onto overflow pages. ++** ++** This number is chosen so that at least 4 cells will fit on every page. ++*/ ++#define MX_LOCAL_PAYLOAD ((USABLE_SPACE/4-(sizeof(CellHdr)+sizeof(Pgno)))&~3) ++ ++/* ++** Data on a database page is stored as a linked list of Cell structures. ++** Both the key and the data are stored in aPayload[]. The key always comes ++** first. The aPayload[] field grows as necessary to hold the key and data, ++** up to a maximum of MX_LOCAL_PAYLOAD bytes. If the size of the key and ++** data combined exceeds MX_LOCAL_PAYLOAD bytes, then Cell.ovfl is the ++** page number of the first overflow page. ++** ++** Though this structure is fixed in size, the Cell on the database ++** page varies in size. Every cell has a CellHdr and at least 4 bytes ++** of payload space. Additional payload bytes (up to the maximum of ++** MX_LOCAL_PAYLOAD) and the Cell.ovfl value are allocated only as ++** needed. ++*/ ++struct Cell { ++ CellHdr h; /* The cell header */ ++ char aPayload[MX_LOCAL_PAYLOAD]; /* Key and data */ ++ Pgno ovfl; /* The first overflow page */ ++}; ++ ++/* ++** Free space on a page is remembered using a linked list of the FreeBlk ++** structures. Space on a database page is allocated in increments of ++** at least 4 bytes and is always aligned to a 4-byte boundry. The ++** linked list of FreeBlks is always kept in order by address. ++*/ ++struct FreeBlk { ++ u16 iSize; /* Number of bytes in this block of free space */ ++ u16 iNext; /* Index in MemPage.u.aDisk[] of the next free block */ ++}; ++ ++/* ++** The number of bytes of payload that will fit on a single overflow page. ++*/ ++#define OVERFLOW_SIZE (SQLITE_USABLE_SIZE-sizeof(Pgno)) ++ ++/* ++** When the key and data for a single entry in the BTree will not fit in ++** the MX_LOCAL_PAYLOAD bytes of space available on the database page, ++** then all extra bytes are written to a linked list of overflow pages. ++** Each overflow page is an instance of the following structure. ++** ++** Unused pages in the database are also represented by instances of ++** the OverflowPage structure. The PageOne.freeList field is the ++** page number of the first page in a linked list of unused database ++** pages. ++*/ ++struct OverflowPage { ++ Pgno iNext; ++ char aPayload[OVERFLOW_SIZE]; ++}; ++ ++/* ++** The PageOne.freeList field points to a linked list of overflow pages ++** hold information about free pages. The aPayload section of each ++** overflow page contains an instance of the following structure. The ++** aFree[] array holds the page number of nFree unused pages in the disk ++** file. ++*/ ++struct FreelistInfo { ++ int nFree; ++ Pgno aFree[(OVERFLOW_SIZE-sizeof(int))/sizeof(Pgno)]; ++}; ++ ++/* ++** For every page in the database file, an instance of the following structure ++** is stored in memory. The u.aDisk[] array contains the raw bits read from ++** the disk. The rest is auxiliary information held in memory only. The ++** auxiliary info is only valid for regular database pages - it is not ++** used for overflow pages and pages on the freelist. ++** ++** Of particular interest in the auxiliary info is the apCell[] entry. Each ++** apCell[] entry is a pointer to a Cell structure in u.aDisk[]. The cells are ++** put in this array so that they can be accessed in constant time, rather ++** than in linear time which would be needed if we had to walk the linked ++** list on every access. ++** ++** Note that apCell[] contains enough space to hold up to two more Cells ++** than can possibly fit on one page. In the steady state, every apCell[] ++** points to memory inside u.aDisk[]. But in the middle of an insert ++** operation, some apCell[] entries may temporarily point to data space ++** outside of u.aDisk[]. This is a transient situation that is quickly ++** resolved. But while it is happening, it is possible for a database ++** page to hold as many as two more cells than it might otherwise hold. ++** The extra two entries in apCell[] are an allowance for this situation. ++** ++** The pParent field points back to the parent page. This allows us to ++** walk up the BTree from any leaf to the root. Care must be taken to ++** unref() the parent page pointer when this page is no longer referenced. ++** The pageDestructor() routine handles that chore. ++*/ ++struct MemPage { ++ union u_page_data { ++ char aDisk[SQLITE_PAGE_SIZE]; /* Page data stored on disk */ ++ PageHdr hdr; /* Overlay page header */ ++ } u; ++ u8 isInit; /* True if auxiliary data is initialized */ ++ u8 idxShift; /* True if apCell[] indices have changed */ ++ u8 isOverfull; /* Some apCell[] points outside u.aDisk[] */ ++ MemPage *pParent; /* The parent of this page. NULL for root */ ++ int idxParent; /* Index in pParent->apCell[] of this node */ ++ int nFree; /* Number of free bytes in u.aDisk[] */ ++ int nCell; /* Number of entries on this page */ ++ Cell *apCell[MX_CELL+2]; /* All data entires in sorted order */ ++}; ++ ++/* ++** The in-memory image of a disk page has the auxiliary information appended ++** to the end. EXTRA_SIZE is the number of bytes of space needed to hold ++** that extra information. ++*/ ++#define EXTRA_SIZE (sizeof(MemPage)-sizeof(union u_page_data)) ++ ++/* ++** Everything we need to know about an open database ++*/ ++struct Btree { ++ BtOps *pOps; /* Function table */ ++ Pager *pPager; /* The page cache */ ++ BtCursor *pCursor; /* A list of all open cursors */ ++ PageOne *page1; /* First page of the database */ ++ u8 inTrans; /* True if a transaction is in progress */ ++ u8 inCkpt; /* True if there is a checkpoint on the transaction */ ++ u8 readOnly; /* True if the underlying file is readonly */ ++ u8 needSwab; /* Need to byte-swapping */ ++}; ++typedef Btree Bt; ++ ++/* ++** A cursor is a pointer to a particular entry in the BTree. ++** The entry is identified by its MemPage and the index in ++** MemPage.apCell[] of the entry. ++*/ ++struct BtCursor { ++ BtCursorOps *pOps; /* Function table */ ++ Btree *pBt; /* The Btree to which this cursor belongs */ ++ BtCursor *pNext, *pPrev; /* Forms a linked list of all cursors */ ++ BtCursor *pShared; /* Loop of cursors with the same root page */ ++ Pgno pgnoRoot; /* The root page of this tree */ ++ MemPage *pPage; /* Page that contains the entry */ ++ int idx; /* Index of the entry in pPage->apCell[] */ ++ u8 wrFlag; /* True if writable */ ++ u8 eSkip; /* Determines if next step operation is a no-op */ ++ u8 iMatch; /* compare result from last sqliteBtreeMoveto() */ ++}; ++ ++/* ++** Legal values for BtCursor.eSkip. ++*/ ++#define SKIP_NONE 0 /* Always step the cursor */ ++#define SKIP_NEXT 1 /* The next sqliteBtreeNext() is a no-op */ ++#define SKIP_PREV 2 /* The next sqliteBtreePrevious() is a no-op */ ++#define SKIP_INVALID 3 /* Calls to Next() and Previous() are invalid */ ++ ++/* Forward declarations */ ++static int fileBtreeCloseCursor(BtCursor *pCur); ++ ++/* ++** Routines for byte swapping. ++*/ ++u16 swab16(u16 x){ ++ return ((x & 0xff)<<8) | ((x>>8)&0xff); ++} ++u32 swab32(u32 x){ ++ return ((x & 0xff)<<24) | ((x & 0xff00)<<8) | ++ ((x>>8) & 0xff00) | ((x>>24)&0xff); ++} ++ ++/* ++** Compute the total number of bytes that a Cell needs on the main ++** database page. The number returned includes the Cell header, ++** local payload storage, and the pointer to overflow pages (if ++** applicable). Additional space allocated on overflow pages ++** is NOT included in the value returned from this routine. ++*/ ++static int cellSize(Btree *pBt, Cell *pCell){ ++ int n = NKEY(pBt, pCell->h) + NDATA(pBt, pCell->h); ++ if( n>MX_LOCAL_PAYLOAD ){ ++ n = MX_LOCAL_PAYLOAD + sizeof(Pgno); ++ }else{ ++ n = ROUNDUP(n); ++ } ++ n += sizeof(CellHdr); ++ return n; ++} ++ ++/* ++** Defragment the page given. All Cells are moved to the ++** beginning of the page and all free space is collected ++** into one big FreeBlk at the end of the page. ++*/ ++static void defragmentPage(Btree *pBt, MemPage *pPage){ ++ int pc, i, n; ++ FreeBlk *pFBlk; ++ char newPage[SQLITE_USABLE_SIZE]; ++ ++ assert( sqlitepager_iswriteable(pPage) ); ++ assert( pPage->isInit ); ++ pc = sizeof(PageHdr); ++ pPage->u.hdr.firstCell = SWAB16(pBt, pc); ++ memcpy(newPage, pPage->u.aDisk, pc); ++ for(i=0; inCell; i++){ ++ Cell *pCell = pPage->apCell[i]; ++ ++ /* This routine should never be called on an overfull page. The ++ ** following asserts verify that constraint. */ ++ assert( Addr(pCell) > Addr(pPage) ); ++ assert( Addr(pCell) < Addr(pPage) + SQLITE_USABLE_SIZE ); ++ ++ n = cellSize(pBt, pCell); ++ pCell->h.iNext = SWAB16(pBt, pc + n); ++ memcpy(&newPage[pc], pCell, n); ++ pPage->apCell[i] = (Cell*)&pPage->u.aDisk[pc]; ++ pc += n; ++ } ++ assert( pPage->nFree==SQLITE_USABLE_SIZE-pc ); ++ memcpy(pPage->u.aDisk, newPage, pc); ++ if( pPage->nCell>0 ){ ++ pPage->apCell[pPage->nCell-1]->h.iNext = 0; ++ } ++ pFBlk = (FreeBlk*)&pPage->u.aDisk[pc]; ++ pFBlk->iSize = SWAB16(pBt, SQLITE_USABLE_SIZE - pc); ++ pFBlk->iNext = 0; ++ pPage->u.hdr.firstFree = SWAB16(pBt, pc); ++ memset(&pFBlk[1], 0, SQLITE_USABLE_SIZE - pc - sizeof(FreeBlk)); ++} ++ ++/* ++** Allocate nByte bytes of space on a page. nByte must be a ++** multiple of 4. ++** ++** Return the index into pPage->u.aDisk[] of the first byte of ++** the new allocation. Or return 0 if there is not enough free ++** space on the page to satisfy the allocation request. ++** ++** If the page contains nBytes of free space but does not contain ++** nBytes of contiguous free space, then this routine automatically ++** calls defragementPage() to consolidate all free space before ++** allocating the new chunk. ++*/ ++static int allocateSpace(Btree *pBt, MemPage *pPage, int nByte){ ++ FreeBlk *p; ++ u16 *pIdx; ++ int start; ++ int iSize; ++#ifndef NDEBUG ++ int cnt = 0; ++#endif ++ ++ assert( sqlitepager_iswriteable(pPage) ); ++ assert( nByte==ROUNDUP(nByte) ); ++ assert( pPage->isInit ); ++ if( pPage->nFreeisOverfull ) return 0; ++ pIdx = &pPage->u.hdr.firstFree; ++ p = (FreeBlk*)&pPage->u.aDisk[SWAB16(pBt, *pIdx)]; ++ while( (iSize = SWAB16(pBt, p->iSize))iNext==0 ){ ++ defragmentPage(pBt, pPage); ++ pIdx = &pPage->u.hdr.firstFree; ++ }else{ ++ pIdx = &p->iNext; ++ } ++ p = (FreeBlk*)&pPage->u.aDisk[SWAB16(pBt, *pIdx)]; ++ } ++ if( iSize==nByte ){ ++ start = SWAB16(pBt, *pIdx); ++ *pIdx = p->iNext; ++ }else{ ++ FreeBlk *pNew; ++ start = SWAB16(pBt, *pIdx); ++ pNew = (FreeBlk*)&pPage->u.aDisk[start + nByte]; ++ pNew->iNext = p->iNext; ++ pNew->iSize = SWAB16(pBt, iSize - nByte); ++ *pIdx = SWAB16(pBt, start + nByte); ++ } ++ pPage->nFree -= nByte; ++ return start; ++} ++ ++/* ++** Return a section of the MemPage.u.aDisk[] to the freelist. ++** The first byte of the new free block is pPage->u.aDisk[start] ++** and the size of the block is "size" bytes. Size must be ++** a multiple of 4. ++** ++** Most of the effort here is involved in coalesing adjacent ++** free blocks into a single big free block. ++*/ ++static void freeSpace(Btree *pBt, MemPage *pPage, int start, int size){ ++ int end = start + size; ++ u16 *pIdx, idx; ++ FreeBlk *pFBlk; ++ FreeBlk *pNew; ++ FreeBlk *pNext; ++ int iSize; ++ ++ assert( sqlitepager_iswriteable(pPage) ); ++ assert( size == ROUNDUP(size) ); ++ assert( start == ROUNDUP(start) ); ++ assert( pPage->isInit ); ++ pIdx = &pPage->u.hdr.firstFree; ++ idx = SWAB16(pBt, *pIdx); ++ while( idx!=0 && idxu.aDisk[idx]; ++ iSize = SWAB16(pBt, pFBlk->iSize); ++ if( idx + iSize == start ){ ++ pFBlk->iSize = SWAB16(pBt, iSize + size); ++ if( idx + iSize + size == SWAB16(pBt, pFBlk->iNext) ){ ++ pNext = (FreeBlk*)&pPage->u.aDisk[idx + iSize + size]; ++ if( pBt->needSwab ){ ++ pFBlk->iSize = swab16((u16)swab16(pNext->iSize)+iSize+size); ++ }else{ ++ pFBlk->iSize += pNext->iSize; ++ } ++ pFBlk->iNext = pNext->iNext; ++ } ++ pPage->nFree += size; ++ return; ++ } ++ pIdx = &pFBlk->iNext; ++ idx = SWAB16(pBt, *pIdx); ++ } ++ pNew = (FreeBlk*)&pPage->u.aDisk[start]; ++ if( idx != end ){ ++ pNew->iSize = SWAB16(pBt, size); ++ pNew->iNext = SWAB16(pBt, idx); ++ }else{ ++ pNext = (FreeBlk*)&pPage->u.aDisk[idx]; ++ pNew->iSize = SWAB16(pBt, size + SWAB16(pBt, pNext->iSize)); ++ pNew->iNext = pNext->iNext; ++ } ++ *pIdx = SWAB16(pBt, start); ++ pPage->nFree += size; ++} ++ ++/* ++** Initialize the auxiliary information for a disk block. ++** ++** The pParent parameter must be a pointer to the MemPage which ++** is the parent of the page being initialized. The root of the ++** BTree (usually page 2) has no parent and so for that page, ++** pParent==NULL. ++** ++** Return SQLITE_OK on success. If we see that the page does ++** not contain a well-formed database page, then return ++** SQLITE_CORRUPT. Note that a return of SQLITE_OK does not ++** guarantee that the page is well-formed. It only shows that ++** we failed to detect any corruption. ++*/ ++static int initPage(Bt *pBt, MemPage *pPage, Pgno pgnoThis, MemPage *pParent){ ++ int idx; /* An index into pPage->u.aDisk[] */ ++ Cell *pCell; /* A pointer to a Cell in pPage->u.aDisk[] */ ++ FreeBlk *pFBlk; /* A pointer to a free block in pPage->u.aDisk[] */ ++ int sz; /* The size of a Cell in bytes */ ++ int freeSpace; /* Amount of free space on the page */ ++ ++ if( pPage->pParent ){ ++ assert( pPage->pParent==pParent ); ++ return SQLITE_OK; ++ } ++ if( pParent ){ ++ pPage->pParent = pParent; ++ sqlitepager_ref(pParent); ++ } ++ if( pPage->isInit ) return SQLITE_OK; ++ pPage->isInit = 1; ++ pPage->nCell = 0; ++ freeSpace = USABLE_SPACE; ++ idx = SWAB16(pBt, pPage->u.hdr.firstCell); ++ while( idx!=0 ){ ++ if( idx>SQLITE_USABLE_SIZE-MIN_CELL_SIZE ) goto page_format_error; ++ if( idxu.aDisk[idx]; ++ sz = cellSize(pBt, pCell); ++ if( idx+sz > SQLITE_USABLE_SIZE ) goto page_format_error; ++ freeSpace -= sz; ++ pPage->apCell[pPage->nCell++] = pCell; ++ idx = SWAB16(pBt, pCell->h.iNext); ++ } ++ pPage->nFree = 0; ++ idx = SWAB16(pBt, pPage->u.hdr.firstFree); ++ while( idx!=0 ){ ++ int iNext; ++ if( idx>SQLITE_USABLE_SIZE-sizeof(FreeBlk) ) goto page_format_error; ++ if( idxu.aDisk[idx]; ++ pPage->nFree += SWAB16(pBt, pFBlk->iSize); ++ iNext = SWAB16(pBt, pFBlk->iNext); ++ if( iNext>0 && iNext <= idx ) goto page_format_error; ++ idx = iNext; ++ } ++ if( pPage->nCell==0 && pPage->nFree==0 ){ ++ /* As a special case, an uninitialized root page appears to be ++ ** an empty database */ ++ return SQLITE_OK; ++ } ++ if( pPage->nFree!=freeSpace ) goto page_format_error; ++ return SQLITE_OK; ++ ++page_format_error: ++ return SQLITE_CORRUPT; ++} ++ ++/* ++** Set up a raw page so that it looks like a database page holding ++** no entries. ++*/ ++static void zeroPage(Btree *pBt, MemPage *pPage){ ++ PageHdr *pHdr; ++ FreeBlk *pFBlk; ++ assert( sqlitepager_iswriteable(pPage) ); ++ memset(pPage, 0, SQLITE_USABLE_SIZE); ++ pHdr = &pPage->u.hdr; ++ pHdr->firstCell = 0; ++ pHdr->firstFree = SWAB16(pBt, sizeof(*pHdr)); ++ pFBlk = (FreeBlk*)&pHdr[1]; ++ pFBlk->iNext = 0; ++ pPage->nFree = SQLITE_USABLE_SIZE - sizeof(*pHdr); ++ pFBlk->iSize = SWAB16(pBt, pPage->nFree); ++ pPage->nCell = 0; ++ pPage->isOverfull = 0; ++} ++ ++/* ++** This routine is called when the reference count for a page ++** reaches zero. We need to unref the pParent pointer when that ++** happens. ++*/ ++static void pageDestructor(void *pData){ ++ MemPage *pPage = (MemPage*)pData; ++ if( pPage->pParent ){ ++ MemPage *pParent = pPage->pParent; ++ pPage->pParent = 0; ++ sqlitepager_unref(pParent); ++ } ++} ++ ++/* ++** Open a new database. ++** ++** Actually, this routine just sets up the internal data structures ++** for accessing the database. We do not open the database file ++** until the first page is loaded. ++** ++** zFilename is the name of the database file. If zFilename is NULL ++** a new database with a random name is created. This randomly named ++** database file will be deleted when sqliteBtreeClose() is called. ++*/ ++int sqliteBtreeOpen( ++ const char *zFilename, /* Name of the file containing the BTree database */ ++ int omitJournal, /* if TRUE then do not journal this file */ ++ int nCache, /* How many pages in the page cache */ ++ Btree **ppBtree /* Pointer to new Btree object written here */ ++){ ++ Btree *pBt; ++ int rc; ++ ++ /* ++ ** The following asserts make sure that structures used by the btree are ++ ** the right size. This is to guard against size changes that result ++ ** when compiling on a different architecture. ++ */ ++ assert( sizeof(u32)==4 ); ++ assert( sizeof(u16)==2 ); ++ assert( sizeof(Pgno)==4 ); ++ assert( sizeof(PageHdr)==8 ); ++ assert( sizeof(CellHdr)==12 ); ++ assert( sizeof(FreeBlk)==4 ); ++ assert( sizeof(OverflowPage)==SQLITE_USABLE_SIZE ); ++ assert( sizeof(FreelistInfo)==OVERFLOW_SIZE ); ++ assert( sizeof(ptr)==sizeof(char*) ); ++ assert( sizeof(uptr)==sizeof(ptr) ); ++ ++ pBt = sqliteMalloc( sizeof(*pBt) ); ++ if( pBt==0 ){ ++ *ppBtree = 0; ++ return SQLITE_NOMEM; ++ } ++ if( nCache<10 ) nCache = 10; ++ rc = sqlitepager_open(&pBt->pPager, zFilename, nCache, EXTRA_SIZE, ++ !omitJournal); ++ if( rc!=SQLITE_OK ){ ++ if( pBt->pPager ) sqlitepager_close(pBt->pPager); ++ sqliteFree(pBt); ++ *ppBtree = 0; ++ return rc; ++ } ++ sqlitepager_set_destructor(pBt->pPager, pageDestructor); ++ pBt->pCursor = 0; ++ pBt->page1 = 0; ++ pBt->readOnly = sqlitepager_isreadonly(pBt->pPager); ++ pBt->pOps = &sqliteBtreeOps; ++ *ppBtree = pBt; ++ return SQLITE_OK; ++} ++ ++/* ++** Close an open database and invalidate all cursors. ++*/ ++static int fileBtreeClose(Btree *pBt){ ++ while( pBt->pCursor ){ ++ fileBtreeCloseCursor(pBt->pCursor); ++ } ++ sqlitepager_close(pBt->pPager); ++ sqliteFree(pBt); ++ return SQLITE_OK; ++} ++ ++/* ++** Change the limit on the number of pages allowed in the cache. ++** ++** The maximum number of cache pages is set to the absolute ++** value of mxPage. If mxPage is negative, the pager will ++** operate asynchronously - it will not stop to do fsync()s ++** to insure data is written to the disk surface before ++** continuing. Transactions still work if synchronous is off, ++** and the database cannot be corrupted if this program ++** crashes. But if the operating system crashes or there is ++** an abrupt power failure when synchronous is off, the database ++** could be left in an inconsistent and unrecoverable state. ++** Synchronous is on by default so database corruption is not ++** normally a worry. ++*/ ++static int fileBtreeSetCacheSize(Btree *pBt, int mxPage){ ++ sqlitepager_set_cachesize(pBt->pPager, mxPage); ++ return SQLITE_OK; ++} ++ ++/* ++** Change the way data is synced to disk in order to increase or decrease ++** how well the database resists damage due to OS crashes and power ++** failures. Level 1 is the same as asynchronous (no syncs() occur and ++** there is a high probability of damage) Level 2 is the default. There ++** is a very low but non-zero probability of damage. Level 3 reduces the ++** probability of damage to near zero but with a write performance reduction. ++*/ ++static int fileBtreeSetSafetyLevel(Btree *pBt, int level){ ++ sqlitepager_set_safety_level(pBt->pPager, level); ++ return SQLITE_OK; ++} ++ ++/* ++** Get a reference to page1 of the database file. This will ++** also acquire a readlock on that file. ++** ++** SQLITE_OK is returned on success. If the file is not a ++** well-formed database file, then SQLITE_CORRUPT is returned. ++** SQLITE_BUSY is returned if the database is locked. SQLITE_NOMEM ++** is returned if we run out of memory. SQLITE_PROTOCOL is returned ++** if there is a locking protocol violation. ++*/ ++static int lockBtree(Btree *pBt){ ++ int rc; ++ if( pBt->page1 ) return SQLITE_OK; ++ rc = sqlitepager_get(pBt->pPager, 1, (void**)&pBt->page1); ++ if( rc!=SQLITE_OK ) return rc; ++ ++ /* Do some checking to help insure the file we opened really is ++ ** a valid database file. ++ */ ++ if( sqlitepager_pagecount(pBt->pPager)>0 ){ ++ PageOne *pP1 = pBt->page1; ++ if( strcmp(pP1->zMagic,zMagicHeader)!=0 || ++ (pP1->iMagic!=MAGIC && swab32(pP1->iMagic)!=MAGIC) ){ ++ rc = SQLITE_NOTADB; ++ goto page1_init_failed; ++ } ++ pBt->needSwab = pP1->iMagic!=MAGIC; ++ } ++ return rc; ++ ++page1_init_failed: ++ sqlitepager_unref(pBt->page1); ++ pBt->page1 = 0; ++ return rc; ++} ++ ++/* ++** If there are no outstanding cursors and we are not in the middle ++** of a transaction but there is a read lock on the database, then ++** this routine unrefs the first page of the database file which ++** has the effect of releasing the read lock. ++** ++** If there are any outstanding cursors, this routine is a no-op. ++** ++** If there is a transaction in progress, this routine is a no-op. ++*/ ++static void unlockBtreeIfUnused(Btree *pBt){ ++ if( pBt->inTrans==0 && pBt->pCursor==0 && pBt->page1!=0 ){ ++ sqlitepager_unref(pBt->page1); ++ pBt->page1 = 0; ++ pBt->inTrans = 0; ++ pBt->inCkpt = 0; ++ } ++} ++ ++/* ++** Create a new database by initializing the first two pages of the ++** file. ++*/ ++static int newDatabase(Btree *pBt){ ++ MemPage *pRoot; ++ PageOne *pP1; ++ int rc; ++ if( sqlitepager_pagecount(pBt->pPager)>1 ) return SQLITE_OK; ++ pP1 = pBt->page1; ++ rc = sqlitepager_write(pBt->page1); ++ if( rc ) return rc; ++ rc = sqlitepager_get(pBt->pPager, 2, (void**)&pRoot); ++ if( rc ) return rc; ++ rc = sqlitepager_write(pRoot); ++ if( rc ){ ++ sqlitepager_unref(pRoot); ++ return rc; ++ } ++ strcpy(pP1->zMagic, zMagicHeader); ++ if( btree_native_byte_order ){ ++ pP1->iMagic = MAGIC; ++ pBt->needSwab = 0; ++ }else{ ++ pP1->iMagic = swab32(MAGIC); ++ pBt->needSwab = 1; ++ } ++ zeroPage(pBt, pRoot); ++ sqlitepager_unref(pRoot); ++ return SQLITE_OK; ++} ++ ++/* ++** Attempt to start a new transaction. ++** ++** A transaction must be started before attempting any changes ++** to the database. None of the following routines will work ++** unless a transaction is started first: ++** ++** sqliteBtreeCreateTable() ++** sqliteBtreeCreateIndex() ++** sqliteBtreeClearTable() ++** sqliteBtreeDropTable() ++** sqliteBtreeInsert() ++** sqliteBtreeDelete() ++** sqliteBtreeUpdateMeta() ++*/ ++static int fileBtreeBeginTrans(Btree *pBt){ ++ int rc; ++ if( pBt->inTrans ) return SQLITE_ERROR; ++ if( pBt->readOnly ) return SQLITE_READONLY; ++ if( pBt->page1==0 ){ ++ rc = lockBtree(pBt); ++ if( rc!=SQLITE_OK ){ ++ return rc; ++ } ++ } ++ rc = sqlitepager_begin(pBt->page1); ++ if( rc==SQLITE_OK ){ ++ rc = newDatabase(pBt); ++ } ++ if( rc==SQLITE_OK ){ ++ pBt->inTrans = 1; ++ pBt->inCkpt = 0; ++ }else{ ++ unlockBtreeIfUnused(pBt); ++ } ++ return rc; ++} ++ ++/* ++** Commit the transaction currently in progress. ++** ++** This will release the write lock on the database file. If there ++** are no active cursors, it also releases the read lock. ++*/ ++static int fileBtreeCommit(Btree *pBt){ ++ int rc; ++ rc = pBt->readOnly ? SQLITE_OK : sqlitepager_commit(pBt->pPager); ++ pBt->inTrans = 0; ++ pBt->inCkpt = 0; ++ unlockBtreeIfUnused(pBt); ++ return rc; ++} ++ ++/* ++** Rollback the transaction in progress. All cursors will be ++** invalided by this operation. Any attempt to use a cursor ++** that was open at the beginning of this operation will result ++** in an error. ++** ++** This will release the write lock on the database file. If there ++** are no active cursors, it also releases the read lock. ++*/ ++static int fileBtreeRollback(Btree *pBt){ ++ int rc; ++ BtCursor *pCur; ++ if( pBt->inTrans==0 ) return SQLITE_OK; ++ pBt->inTrans = 0; ++ pBt->inCkpt = 0; ++ rc = pBt->readOnly ? SQLITE_OK : sqlitepager_rollback(pBt->pPager); ++ for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){ ++ if( pCur->pPage && pCur->pPage->isInit==0 ){ ++ sqlitepager_unref(pCur->pPage); ++ pCur->pPage = 0; ++ } ++ } ++ unlockBtreeIfUnused(pBt); ++ return rc; ++} ++ ++/* ++** Set the checkpoint for the current transaction. The checkpoint serves ++** as a sub-transaction that can be rolled back independently of the ++** main transaction. You must start a transaction before starting a ++** checkpoint. The checkpoint is ended automatically if the transaction ++** commits or rolls back. ++** ++** Only one checkpoint may be active at a time. It is an error to try ++** to start a new checkpoint if another checkpoint is already active. ++*/ ++static int fileBtreeBeginCkpt(Btree *pBt){ ++ int rc; ++ if( !pBt->inTrans || pBt->inCkpt ){ ++ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; ++ } ++ rc = pBt->readOnly ? SQLITE_OK : sqlitepager_ckpt_begin(pBt->pPager); ++ pBt->inCkpt = 1; ++ return rc; ++} ++ ++ ++/* ++** Commit a checkpoint to transaction currently in progress. If no ++** checkpoint is active, this is a no-op. ++*/ ++static int fileBtreeCommitCkpt(Btree *pBt){ ++ int rc; ++ if( pBt->inCkpt && !pBt->readOnly ){ ++ rc = sqlitepager_ckpt_commit(pBt->pPager); ++ }else{ ++ rc = SQLITE_OK; ++ } ++ pBt->inCkpt = 0; ++ return rc; ++} ++ ++/* ++** Rollback the checkpoint to the current transaction. If there ++** is no active checkpoint or transaction, this routine is a no-op. ++** ++** All cursors will be invalided by this operation. Any attempt ++** to use a cursor that was open at the beginning of this operation ++** will result in an error. ++*/ ++static int fileBtreeRollbackCkpt(Btree *pBt){ ++ int rc; ++ BtCursor *pCur; ++ if( pBt->inCkpt==0 || pBt->readOnly ) return SQLITE_OK; ++ rc = sqlitepager_ckpt_rollback(pBt->pPager); ++ for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){ ++ if( pCur->pPage && pCur->pPage->isInit==0 ){ ++ sqlitepager_unref(pCur->pPage); ++ pCur->pPage = 0; ++ } ++ } ++ pBt->inCkpt = 0; ++ return rc; ++} ++ ++/* ++** Create a new cursor for the BTree whose root is on the page ++** iTable. The act of acquiring a cursor gets a read lock on ++** the database file. ++** ++** If wrFlag==0, then the cursor can only be used for reading. ++** If wrFlag==1, then the cursor can be used for reading or for ++** writing if other conditions for writing are also met. These ++** are the conditions that must be met in order for writing to ++** be allowed: ++** ++** 1: The cursor must have been opened with wrFlag==1 ++** ++** 2: No other cursors may be open with wrFlag==0 on the same table ++** ++** 3: The database must be writable (not on read-only media) ++** ++** 4: There must be an active transaction. ++** ++** Condition 2 warrants further discussion. If any cursor is opened ++** on a table with wrFlag==0, that prevents all other cursors from ++** writing to that table. This is a kind of "read-lock". When a cursor ++** is opened with wrFlag==0 it is guaranteed that the table will not ++** change as long as the cursor is open. This allows the cursor to ++** do a sequential scan of the table without having to worry about ++** entries being inserted or deleted during the scan. Cursors should ++** be opened with wrFlag==0 only if this read-lock property is needed. ++** That is to say, cursors should be opened with wrFlag==0 only if they ++** intend to use the sqliteBtreeNext() system call. All other cursors ++** should be opened with wrFlag==1 even if they never really intend ++** to write. ++** ++** No checking is done to make sure that page iTable really is the ++** root page of a b-tree. If it is not, then the cursor acquired ++** will not work correctly. ++*/ ++static ++int fileBtreeCursor(Btree *pBt, int iTable, int wrFlag, BtCursor **ppCur){ ++ int rc; ++ BtCursor *pCur, *pRing; ++ ++ if( pBt->readOnly && wrFlag ){ ++ *ppCur = 0; ++ return SQLITE_READONLY; ++ } ++ if( pBt->page1==0 ){ ++ rc = lockBtree(pBt); ++ if( rc!=SQLITE_OK ){ ++ *ppCur = 0; ++ return rc; ++ } ++ } ++ pCur = sqliteMalloc( sizeof(*pCur) ); ++ if( pCur==0 ){ ++ rc = SQLITE_NOMEM; ++ goto create_cursor_exception; ++ } ++ pCur->pgnoRoot = (Pgno)iTable; ++ rc = sqlitepager_get(pBt->pPager, pCur->pgnoRoot, (void**)&pCur->pPage); ++ if( rc!=SQLITE_OK ){ ++ goto create_cursor_exception; ++ } ++ rc = initPage(pBt, pCur->pPage, pCur->pgnoRoot, 0); ++ if( rc!=SQLITE_OK ){ ++ goto create_cursor_exception; ++ } ++ pCur->pOps = &sqliteBtreeCursorOps; ++ pCur->pBt = pBt; ++ pCur->wrFlag = wrFlag; ++ pCur->idx = 0; ++ pCur->eSkip = SKIP_INVALID; ++ pCur->pNext = pBt->pCursor; ++ if( pCur->pNext ){ ++ pCur->pNext->pPrev = pCur; ++ } ++ pCur->pPrev = 0; ++ pRing = pBt->pCursor; ++ while( pRing && pRing->pgnoRoot!=pCur->pgnoRoot ){ pRing = pRing->pNext; } ++ if( pRing ){ ++ pCur->pShared = pRing->pShared; ++ pRing->pShared = pCur; ++ }else{ ++ pCur->pShared = pCur; ++ } ++ pBt->pCursor = pCur; ++ *ppCur = pCur; ++ return SQLITE_OK; ++ ++create_cursor_exception: ++ *ppCur = 0; ++ if( pCur ){ ++ if( pCur->pPage ) sqlitepager_unref(pCur->pPage); ++ sqliteFree(pCur); ++ } ++ unlockBtreeIfUnused(pBt); ++ return rc; ++} ++ ++/* ++** Close a cursor. The read lock on the database file is released ++** when the last cursor is closed. ++*/ ++static int fileBtreeCloseCursor(BtCursor *pCur){ ++ Btree *pBt = pCur->pBt; ++ if( pCur->pPrev ){ ++ pCur->pPrev->pNext = pCur->pNext; ++ }else{ ++ pBt->pCursor = pCur->pNext; ++ } ++ if( pCur->pNext ){ ++ pCur->pNext->pPrev = pCur->pPrev; ++ } ++ if( pCur->pPage ){ ++ sqlitepager_unref(pCur->pPage); ++ } ++ if( pCur->pShared!=pCur ){ ++ BtCursor *pRing = pCur->pShared; ++ while( pRing->pShared!=pCur ){ pRing = pRing->pShared; } ++ pRing->pShared = pCur->pShared; ++ } ++ unlockBtreeIfUnused(pBt); ++ sqliteFree(pCur); ++ return SQLITE_OK; ++} ++ ++/* ++** Make a temporary cursor by filling in the fields of pTempCur. ++** The temporary cursor is not on the cursor list for the Btree. ++*/ ++static void getTempCursor(BtCursor *pCur, BtCursor *pTempCur){ ++ memcpy(pTempCur, pCur, sizeof(*pCur)); ++ pTempCur->pNext = 0; ++ pTempCur->pPrev = 0; ++ if( pTempCur->pPage ){ ++ sqlitepager_ref(pTempCur->pPage); ++ } ++} ++ ++/* ++** Delete a temporary cursor such as was made by the CreateTemporaryCursor() ++** function above. ++*/ ++static void releaseTempCursor(BtCursor *pCur){ ++ if( pCur->pPage ){ ++ sqlitepager_unref(pCur->pPage); ++ } ++} ++ ++/* ++** Set *pSize to the number of bytes of key in the entry the ++** cursor currently points to. Always return SQLITE_OK. ++** Failure is not possible. If the cursor is not currently ++** pointing to an entry (which can happen, for example, if ++** the database is empty) then *pSize is set to 0. ++*/ ++static int fileBtreeKeySize(BtCursor *pCur, int *pSize){ ++ Cell *pCell; ++ MemPage *pPage; ++ ++ pPage = pCur->pPage; ++ assert( pPage!=0 ); ++ if( pCur->idx >= pPage->nCell ){ ++ *pSize = 0; ++ }else{ ++ pCell = pPage->apCell[pCur->idx]; ++ *pSize = NKEY(pCur->pBt, pCell->h); ++ } ++ return SQLITE_OK; ++} ++ ++/* ++** Read payload information from the entry that the pCur cursor is ++** pointing to. Begin reading the payload at "offset" and read ++** a total of "amt" bytes. Put the result in zBuf. ++** ++** This routine does not make a distinction between key and data. ++** It just reads bytes from the payload area. ++*/ ++static int getPayload(BtCursor *pCur, int offset, int amt, char *zBuf){ ++ char *aPayload; ++ Pgno nextPage; ++ int rc; ++ Btree *pBt = pCur->pBt; ++ assert( pCur!=0 && pCur->pPage!=0 ); ++ assert( pCur->idx>=0 && pCur->idxpPage->nCell ); ++ aPayload = pCur->pPage->apCell[pCur->idx]->aPayload; ++ if( offsetMX_LOCAL_PAYLOAD ){ ++ a = MX_LOCAL_PAYLOAD - offset; ++ } ++ memcpy(zBuf, &aPayload[offset], a); ++ if( a==amt ){ ++ return SQLITE_OK; ++ } ++ offset = 0; ++ zBuf += a; ++ amt -= a; ++ }else{ ++ offset -= MX_LOCAL_PAYLOAD; ++ } ++ if( amt>0 ){ ++ nextPage = SWAB32(pBt, pCur->pPage->apCell[pCur->idx]->ovfl); ++ } ++ while( amt>0 && nextPage ){ ++ OverflowPage *pOvfl; ++ rc = sqlitepager_get(pBt->pPager, nextPage, (void**)&pOvfl); ++ if( rc!=0 ){ ++ return rc; ++ } ++ nextPage = SWAB32(pBt, pOvfl->iNext); ++ if( offset OVERFLOW_SIZE ){ ++ a = OVERFLOW_SIZE - offset; ++ } ++ memcpy(zBuf, &pOvfl->aPayload[offset], a); ++ offset = 0; ++ amt -= a; ++ zBuf += a; ++ }else{ ++ offset -= OVERFLOW_SIZE; ++ } ++ sqlitepager_unref(pOvfl); ++ } ++ if( amt>0 ){ ++ return SQLITE_CORRUPT; ++ } ++ return SQLITE_OK; ++} ++ ++/* ++** Read part of the key associated with cursor pCur. A maximum ++** of "amt" bytes will be transfered into zBuf[]. The transfer ++** begins at "offset". The number of bytes actually read is ++** returned. ++** ++** Change: It used to be that the amount returned will be smaller ++** than the amount requested if there are not enough bytes in the key ++** to satisfy the request. But now, it must be the case that there ++** is enough data available to satisfy the request. If not, an exception ++** is raised. The change was made in an effort to boost performance ++** by eliminating unneeded tests. ++*/ ++static int fileBtreeKey(BtCursor *pCur, int offset, int amt, char *zBuf){ ++ MemPage *pPage; ++ ++ assert( amt>=0 ); ++ assert( offset>=0 ); ++ assert( pCur->pPage!=0 ); ++ pPage = pCur->pPage; ++ if( pCur->idx >= pPage->nCell ){ ++ return 0; ++ } ++ assert( amt+offset <= NKEY(pCur->pBt, pPage->apCell[pCur->idx]->h) ); ++ getPayload(pCur, offset, amt, zBuf); ++ return amt; ++} ++ ++/* ++** Set *pSize to the number of bytes of data in the entry the ++** cursor currently points to. Always return SQLITE_OK. ++** Failure is not possible. If the cursor is not currently ++** pointing to an entry (which can happen, for example, if ++** the database is empty) then *pSize is set to 0. ++*/ ++static int fileBtreeDataSize(BtCursor *pCur, int *pSize){ ++ Cell *pCell; ++ MemPage *pPage; ++ ++ pPage = pCur->pPage; ++ assert( pPage!=0 ); ++ if( pCur->idx >= pPage->nCell ){ ++ *pSize = 0; ++ }else{ ++ pCell = pPage->apCell[pCur->idx]; ++ *pSize = NDATA(pCur->pBt, pCell->h); ++ } ++ return SQLITE_OK; ++} ++ ++/* ++** Read part of the data associated with cursor pCur. A maximum ++** of "amt" bytes will be transfered into zBuf[]. The transfer ++** begins at "offset". The number of bytes actually read is ++** returned. The amount returned will be smaller than the ++** amount requested if there are not enough bytes in the data ++** to satisfy the request. ++*/ ++static int fileBtreeData(BtCursor *pCur, int offset, int amt, char *zBuf){ ++ Cell *pCell; ++ MemPage *pPage; ++ ++ assert( amt>=0 ); ++ assert( offset>=0 ); ++ assert( pCur->pPage!=0 ); ++ pPage = pCur->pPage; ++ if( pCur->idx >= pPage->nCell ){ ++ return 0; ++ } ++ pCell = pPage->apCell[pCur->idx]; ++ assert( amt+offset <= NDATA(pCur->pBt, pCell->h) ); ++ getPayload(pCur, offset + NKEY(pCur->pBt, pCell->h), amt, zBuf); ++ return amt; ++} ++ ++/* ++** Compare an external key against the key on the entry that pCur points to. ++** ++** The external key is pKey and is nKey bytes long. The last nIgnore bytes ++** of the key associated with pCur are ignored, as if they do not exist. ++** (The normal case is for nIgnore to be zero in which case the entire ++** internal key is used in the comparison.) ++** ++** The comparison result is written to *pRes as follows: ++** ++** *pRes<0 This means pCur0 This means pCur>pKey ++** ++** When one key is an exact prefix of the other, the shorter key is ++** considered less than the longer one. In order to be equal the ++** keys must be exactly the same length. (The length of the pCur key ++** is the actual key length minus nIgnore bytes.) ++*/ ++static int fileBtreeKeyCompare( ++ BtCursor *pCur, /* Pointer to entry to compare against */ ++ const void *pKey, /* Key to compare against entry that pCur points to */ ++ int nKey, /* Number of bytes in pKey */ ++ int nIgnore, /* Ignore this many bytes at the end of pCur */ ++ int *pResult /* Write the result here */ ++){ ++ Pgno nextPage; ++ int n, c, rc, nLocal; ++ Cell *pCell; ++ Btree *pBt = pCur->pBt; ++ const char *zKey = (const char*)pKey; ++ ++ assert( pCur->pPage ); ++ assert( pCur->idx>=0 && pCur->idxpPage->nCell ); ++ pCell = pCur->pPage->apCell[pCur->idx]; ++ nLocal = NKEY(pBt, pCell->h) - nIgnore; ++ if( nLocal<0 ) nLocal = 0; ++ n = nKeyMX_LOCAL_PAYLOAD ){ ++ n = MX_LOCAL_PAYLOAD; ++ } ++ c = memcmp(pCell->aPayload, zKey, n); ++ if( c!=0 ){ ++ *pResult = c; ++ return SQLITE_OK; ++ } ++ zKey += n; ++ nKey -= n; ++ nLocal -= n; ++ nextPage = SWAB32(pBt, pCell->ovfl); ++ while( nKey>0 && nLocal>0 ){ ++ OverflowPage *pOvfl; ++ if( nextPage==0 ){ ++ return SQLITE_CORRUPT; ++ } ++ rc = sqlitepager_get(pBt->pPager, nextPage, (void**)&pOvfl); ++ if( rc ){ ++ return rc; ++ } ++ nextPage = SWAB32(pBt, pOvfl->iNext); ++ n = nKeyOVERFLOW_SIZE ){ ++ n = OVERFLOW_SIZE; ++ } ++ c = memcmp(pOvfl->aPayload, zKey, n); ++ sqlitepager_unref(pOvfl); ++ if( c!=0 ){ ++ *pResult = c; ++ return SQLITE_OK; ++ } ++ nKey -= n; ++ nLocal -= n; ++ zKey += n; ++ } ++ if( c==0 ){ ++ c = nLocal - nKey; ++ } ++ *pResult = c; ++ return SQLITE_OK; ++} ++ ++/* ++** Move the cursor down to a new child page. The newPgno argument is the ++** page number of the child page in the byte order of the disk image. ++*/ ++static int moveToChild(BtCursor *pCur, int newPgno){ ++ int rc; ++ MemPage *pNewPage; ++ Btree *pBt = pCur->pBt; ++ ++ newPgno = SWAB32(pBt, newPgno); ++ rc = sqlitepager_get(pBt->pPager, newPgno, (void**)&pNewPage); ++ if( rc ) return rc; ++ rc = initPage(pBt, pNewPage, newPgno, pCur->pPage); ++ if( rc ) return rc; ++ assert( pCur->idx>=pCur->pPage->nCell ++ || pCur->pPage->apCell[pCur->idx]->h.leftChild==SWAB32(pBt,newPgno) ); ++ assert( pCur->idxpPage->nCell ++ || pCur->pPage->u.hdr.rightChild==SWAB32(pBt,newPgno) ); ++ pNewPage->idxParent = pCur->idx; ++ pCur->pPage->idxShift = 0; ++ sqlitepager_unref(pCur->pPage); ++ pCur->pPage = pNewPage; ++ pCur->idx = 0; ++ if( pNewPage->nCell<1 ){ ++ return SQLITE_CORRUPT; ++ } ++ return SQLITE_OK; ++} ++ ++/* ++** Move the cursor up to the parent page. ++** ++** pCur->idx is set to the cell index that contains the pointer ++** to the page we are coming from. If we are coming from the ++** right-most child page then pCur->idx is set to one more than ++** the largest cell index. ++*/ ++static void moveToParent(BtCursor *pCur){ ++ Pgno oldPgno; ++ MemPage *pParent; ++ MemPage *pPage; ++ int idxParent; ++ pPage = pCur->pPage; ++ assert( pPage!=0 ); ++ pParent = pPage->pParent; ++ assert( pParent!=0 ); ++ idxParent = pPage->idxParent; ++ sqlitepager_ref(pParent); ++ sqlitepager_unref(pPage); ++ pCur->pPage = pParent; ++ assert( pParent->idxShift==0 ); ++ if( pParent->idxShift==0 ){ ++ pCur->idx = idxParent; ++#ifndef NDEBUG ++ /* Verify that pCur->idx is the correct index to point back to the child ++ ** page we just came from ++ */ ++ oldPgno = SWAB32(pCur->pBt, sqlitepager_pagenumber(pPage)); ++ if( pCur->idxnCell ){ ++ assert( pParent->apCell[idxParent]->h.leftChild==oldPgno ); ++ }else{ ++ assert( pParent->u.hdr.rightChild==oldPgno ); ++ } ++#endif ++ }else{ ++ /* The MemPage.idxShift flag indicates that cell indices might have ++ ** changed since idxParent was set and hence idxParent might be out ++ ** of date. So recompute the parent cell index by scanning all cells ++ ** and locating the one that points to the child we just came from. ++ */ ++ int i; ++ pCur->idx = pParent->nCell; ++ oldPgno = SWAB32(pCur->pBt, sqlitepager_pagenumber(pPage)); ++ for(i=0; inCell; i++){ ++ if( pParent->apCell[i]->h.leftChild==oldPgno ){ ++ pCur->idx = i; ++ break; ++ } ++ } ++ } ++} ++ ++/* ++** Move the cursor to the root page ++*/ ++static int moveToRoot(BtCursor *pCur){ ++ MemPage *pNew; ++ int rc; ++ Btree *pBt = pCur->pBt; ++ ++ rc = sqlitepager_get(pBt->pPager, pCur->pgnoRoot, (void**)&pNew); ++ if( rc ) return rc; ++ rc = initPage(pBt, pNew, pCur->pgnoRoot, 0); ++ if( rc ) return rc; ++ sqlitepager_unref(pCur->pPage); ++ pCur->pPage = pNew; ++ pCur->idx = 0; ++ return SQLITE_OK; ++} ++ ++/* ++** Move the cursor down to the left-most leaf entry beneath the ++** entry to which it is currently pointing. ++*/ ++static int moveToLeftmost(BtCursor *pCur){ ++ Pgno pgno; ++ int rc; ++ ++ while( (pgno = pCur->pPage->apCell[pCur->idx]->h.leftChild)!=0 ){ ++ rc = moveToChild(pCur, pgno); ++ if( rc ) return rc; ++ } ++ return SQLITE_OK; ++} ++ ++/* ++** Move the cursor down to the right-most leaf entry beneath the ++** page to which it is currently pointing. Notice the difference ++** between moveToLeftmost() and moveToRightmost(). moveToLeftmost() ++** finds the left-most entry beneath the *entry* whereas moveToRightmost() ++** finds the right-most entry beneath the *page*. ++*/ ++static int moveToRightmost(BtCursor *pCur){ ++ Pgno pgno; ++ int rc; ++ ++ while( (pgno = pCur->pPage->u.hdr.rightChild)!=0 ){ ++ pCur->idx = pCur->pPage->nCell; ++ rc = moveToChild(pCur, pgno); ++ if( rc ) return rc; ++ } ++ pCur->idx = pCur->pPage->nCell - 1; ++ return SQLITE_OK; ++} ++ ++/* Move the cursor to the first entry in the table. Return SQLITE_OK ++** on success. Set *pRes to 0 if the cursor actually points to something ++** or set *pRes to 1 if the table is empty. ++*/ ++static int fileBtreeFirst(BtCursor *pCur, int *pRes){ ++ int rc; ++ if( pCur->pPage==0 ) return SQLITE_ABORT; ++ rc = moveToRoot(pCur); ++ if( rc ) return rc; ++ if( pCur->pPage->nCell==0 ){ ++ *pRes = 1; ++ return SQLITE_OK; ++ } ++ *pRes = 0; ++ rc = moveToLeftmost(pCur); ++ pCur->eSkip = SKIP_NONE; ++ return rc; ++} ++ ++/* Move the cursor to the last entry in the table. Return SQLITE_OK ++** on success. Set *pRes to 0 if the cursor actually points to something ++** or set *pRes to 1 if the table is empty. ++*/ ++static int fileBtreeLast(BtCursor *pCur, int *pRes){ ++ int rc; ++ if( pCur->pPage==0 ) return SQLITE_ABORT; ++ rc = moveToRoot(pCur); ++ if( rc ) return rc; ++ assert( pCur->pPage->isInit ); ++ if( pCur->pPage->nCell==0 ){ ++ *pRes = 1; ++ return SQLITE_OK; ++ } ++ *pRes = 0; ++ rc = moveToRightmost(pCur); ++ pCur->eSkip = SKIP_NONE; ++ return rc; ++} ++ ++/* Move the cursor so that it points to an entry near pKey. ++** Return a success code. ++** ++** If an exact match is not found, then the cursor is always ++** left pointing at a leaf page which would hold the entry if it ++** were present. The cursor might point to an entry that comes ++** before or after the key. ++** ++** The result of comparing the key with the entry to which the ++** cursor is left pointing is stored in pCur->iMatch. The same ++** value is also written to *pRes if pRes!=NULL. The meaning of ++** this value is as follows: ++** ++** *pRes<0 The cursor is left pointing at an entry that ++** is smaller than pKey or if the table is empty ++** and the cursor is therefore left point to nothing. ++** ++** *pRes==0 The cursor is left pointing at an entry that ++** exactly matches pKey. ++** ++** *pRes>0 The cursor is left pointing at an entry that ++** is larger than pKey. ++*/ ++static ++int fileBtreeMoveto(BtCursor *pCur, const void *pKey, int nKey, int *pRes){ ++ int rc; ++ if( pCur->pPage==0 ) return SQLITE_ABORT; ++ pCur->eSkip = SKIP_NONE; ++ rc = moveToRoot(pCur); ++ if( rc ) return rc; ++ for(;;){ ++ int lwr, upr; ++ Pgno chldPg; ++ MemPage *pPage = pCur->pPage; ++ int c = -1; /* pRes return if table is empty must be -1 */ ++ lwr = 0; ++ upr = pPage->nCell-1; ++ while( lwr<=upr ){ ++ pCur->idx = (lwr+upr)/2; ++ rc = fileBtreeKeyCompare(pCur, pKey, nKey, 0, &c); ++ if( rc ) return rc; ++ if( c==0 ){ ++ pCur->iMatch = c; ++ if( pRes ) *pRes = 0; ++ return SQLITE_OK; ++ } ++ if( c<0 ){ ++ lwr = pCur->idx+1; ++ }else{ ++ upr = pCur->idx-1; ++ } ++ } ++ assert( lwr==upr+1 ); ++ assert( pPage->isInit ); ++ if( lwr>=pPage->nCell ){ ++ chldPg = pPage->u.hdr.rightChild; ++ }else{ ++ chldPg = pPage->apCell[lwr]->h.leftChild; ++ } ++ if( chldPg==0 ){ ++ pCur->iMatch = c; ++ if( pRes ) *pRes = c; ++ return SQLITE_OK; ++ } ++ pCur->idx = lwr; ++ rc = moveToChild(pCur, chldPg); ++ if( rc ) return rc; ++ } ++ /* NOT REACHED */ ++} ++ ++/* ++** Advance the cursor to the next entry in the database. If ++** successful then set *pRes=0. If the cursor ++** was already pointing to the last entry in the database before ++** this routine was called, then set *pRes=1. ++*/ ++static int fileBtreeNext(BtCursor *pCur, int *pRes){ ++ int rc; ++ MemPage *pPage = pCur->pPage; ++ assert( pRes!=0 ); ++ if( pPage==0 ){ ++ *pRes = 1; ++ return SQLITE_ABORT; ++ } ++ assert( pPage->isInit ); ++ assert( pCur->eSkip!=SKIP_INVALID ); ++ if( pPage->nCell==0 ){ ++ *pRes = 1; ++ return SQLITE_OK; ++ } ++ assert( pCur->idxnCell ); ++ if( pCur->eSkip==SKIP_NEXT ){ ++ pCur->eSkip = SKIP_NONE; ++ *pRes = 0; ++ return SQLITE_OK; ++ } ++ pCur->eSkip = SKIP_NONE; ++ pCur->idx++; ++ if( pCur->idx>=pPage->nCell ){ ++ if( pPage->u.hdr.rightChild ){ ++ rc = moveToChild(pCur, pPage->u.hdr.rightChild); ++ if( rc ) return rc; ++ rc = moveToLeftmost(pCur); ++ *pRes = 0; ++ return rc; ++ } ++ do{ ++ if( pPage->pParent==0 ){ ++ *pRes = 1; ++ return SQLITE_OK; ++ } ++ moveToParent(pCur); ++ pPage = pCur->pPage; ++ }while( pCur->idx>=pPage->nCell ); ++ *pRes = 0; ++ return SQLITE_OK; ++ } ++ *pRes = 0; ++ if( pPage->u.hdr.rightChild==0 ){ ++ return SQLITE_OK; ++ } ++ rc = moveToLeftmost(pCur); ++ return rc; ++} ++ ++/* ++** Step the cursor to the back to the previous entry in the database. If ++** successful then set *pRes=0. If the cursor ++** was already pointing to the first entry in the database before ++** this routine was called, then set *pRes=1. ++*/ ++static int fileBtreePrevious(BtCursor *pCur, int *pRes){ ++ int rc; ++ Pgno pgno; ++ MemPage *pPage; ++ pPage = pCur->pPage; ++ if( pPage==0 ){ ++ *pRes = 1; ++ return SQLITE_ABORT; ++ } ++ assert( pPage->isInit ); ++ assert( pCur->eSkip!=SKIP_INVALID ); ++ if( pPage->nCell==0 ){ ++ *pRes = 1; ++ return SQLITE_OK; ++ } ++ if( pCur->eSkip==SKIP_PREV ){ ++ pCur->eSkip = SKIP_NONE; ++ *pRes = 0; ++ return SQLITE_OK; ++ } ++ pCur->eSkip = SKIP_NONE; ++ assert( pCur->idx>=0 ); ++ if( (pgno = pPage->apCell[pCur->idx]->h.leftChild)!=0 ){ ++ rc = moveToChild(pCur, pgno); ++ if( rc ) return rc; ++ rc = moveToRightmost(pCur); ++ }else{ ++ while( pCur->idx==0 ){ ++ if( pPage->pParent==0 ){ ++ if( pRes ) *pRes = 1; ++ return SQLITE_OK; ++ } ++ moveToParent(pCur); ++ pPage = pCur->pPage; ++ } ++ pCur->idx--; ++ rc = SQLITE_OK; ++ } ++ *pRes = 0; ++ return rc; ++} ++ ++/* ++** Allocate a new page from the database file. ++** ++** The new page is marked as dirty. (In other words, sqlitepager_write() ++** has already been called on the new page.) The new page has also ++** been referenced and the calling routine is responsible for calling ++** sqlitepager_unref() on the new page when it is done. ++** ++** SQLITE_OK is returned on success. Any other return value indicates ++** an error. *ppPage and *pPgno are undefined in the event of an error. ++** Do not invoke sqlitepager_unref() on *ppPage if an error is returned. ++** ++** If the "nearby" parameter is not 0, then a (feeble) effort is made to ++** locate a page close to the page number "nearby". This can be used in an ++** attempt to keep related pages close to each other in the database file, ++** which in turn can make database access faster. ++*/ ++static int allocatePage(Btree *pBt, MemPage **ppPage, Pgno *pPgno, Pgno nearby){ ++ PageOne *pPage1 = pBt->page1; ++ int rc; ++ if( pPage1->freeList ){ ++ OverflowPage *pOvfl; ++ FreelistInfo *pInfo; ++ ++ rc = sqlitepager_write(pPage1); ++ if( rc ) return rc; ++ SWAB_ADD(pBt, pPage1->nFree, -1); ++ rc = sqlitepager_get(pBt->pPager, SWAB32(pBt, pPage1->freeList), ++ (void**)&pOvfl); ++ if( rc ) return rc; ++ rc = sqlitepager_write(pOvfl); ++ if( rc ){ ++ sqlitepager_unref(pOvfl); ++ return rc; ++ } ++ pInfo = (FreelistInfo*)pOvfl->aPayload; ++ if( pInfo->nFree==0 ){ ++ *pPgno = SWAB32(pBt, pPage1->freeList); ++ pPage1->freeList = pOvfl->iNext; ++ *ppPage = (MemPage*)pOvfl; ++ }else{ ++ int closest, n; ++ n = SWAB32(pBt, pInfo->nFree); ++ if( n>1 && nearby>0 ){ ++ int i, dist; ++ closest = 0; ++ dist = SWAB32(pBt, pInfo->aFree[0]) - nearby; ++ if( dist<0 ) dist = -dist; ++ for(i=1; iaFree[i]) - nearby; ++ if( d2<0 ) d2 = -d2; ++ if( d2nFree, -1); ++ *pPgno = SWAB32(pBt, pInfo->aFree[closest]); ++ pInfo->aFree[closest] = pInfo->aFree[n-1]; ++ rc = sqlitepager_get(pBt->pPager, *pPgno, (void**)ppPage); ++ sqlitepager_unref(pOvfl); ++ if( rc==SQLITE_OK ){ ++ sqlitepager_dont_rollback(*ppPage); ++ rc = sqlitepager_write(*ppPage); ++ } ++ } ++ }else{ ++ *pPgno = sqlitepager_pagecount(pBt->pPager) + 1; ++ rc = sqlitepager_get(pBt->pPager, *pPgno, (void**)ppPage); ++ if( rc ) return rc; ++ rc = sqlitepager_write(*ppPage); ++ } ++ return rc; ++} ++ ++/* ++** Add a page of the database file to the freelist. Either pgno or ++** pPage but not both may be 0. ++** ++** sqlitepager_unref() is NOT called for pPage. ++*/ ++static int freePage(Btree *pBt, void *pPage, Pgno pgno){ ++ PageOne *pPage1 = pBt->page1; ++ OverflowPage *pOvfl = (OverflowPage*)pPage; ++ int rc; ++ int needUnref = 0; ++ MemPage *pMemPage; ++ ++ if( pgno==0 ){ ++ assert( pOvfl!=0 ); ++ pgno = sqlitepager_pagenumber(pOvfl); ++ } ++ assert( pgno>2 ); ++ assert( sqlitepager_pagenumber(pOvfl)==pgno ); ++ pMemPage = (MemPage*)pPage; ++ pMemPage->isInit = 0; ++ if( pMemPage->pParent ){ ++ sqlitepager_unref(pMemPage->pParent); ++ pMemPage->pParent = 0; ++ } ++ rc = sqlitepager_write(pPage1); ++ if( rc ){ ++ return rc; ++ } ++ SWAB_ADD(pBt, pPage1->nFree, 1); ++ if( pPage1->nFree!=0 && pPage1->freeList!=0 ){ ++ OverflowPage *pFreeIdx; ++ rc = sqlitepager_get(pBt->pPager, SWAB32(pBt, pPage1->freeList), ++ (void**)&pFreeIdx); ++ if( rc==SQLITE_OK ){ ++ FreelistInfo *pInfo = (FreelistInfo*)pFreeIdx->aPayload; ++ int n = SWAB32(pBt, pInfo->nFree); ++ if( n<(sizeof(pInfo->aFree)/sizeof(pInfo->aFree[0])) ){ ++ rc = sqlitepager_write(pFreeIdx); ++ if( rc==SQLITE_OK ){ ++ pInfo->aFree[n] = SWAB32(pBt, pgno); ++ SWAB_ADD(pBt, pInfo->nFree, 1); ++ sqlitepager_unref(pFreeIdx); ++ sqlitepager_dont_write(pBt->pPager, pgno); ++ return rc; ++ } ++ } ++ sqlitepager_unref(pFreeIdx); ++ } ++ } ++ if( pOvfl==0 ){ ++ assert( pgno>0 ); ++ rc = sqlitepager_get(pBt->pPager, pgno, (void**)&pOvfl); ++ if( rc ) return rc; ++ needUnref = 1; ++ } ++ rc = sqlitepager_write(pOvfl); ++ if( rc ){ ++ if( needUnref ) sqlitepager_unref(pOvfl); ++ return rc; ++ } ++ pOvfl->iNext = pPage1->freeList; ++ pPage1->freeList = SWAB32(pBt, pgno); ++ memset(pOvfl->aPayload, 0, OVERFLOW_SIZE); ++ if( needUnref ) rc = sqlitepager_unref(pOvfl); ++ return rc; ++} ++ ++/* ++** Erase all the data out of a cell. This involves returning overflow ++** pages back the freelist. ++*/ ++static int clearCell(Btree *pBt, Cell *pCell){ ++ Pager *pPager = pBt->pPager; ++ OverflowPage *pOvfl; ++ Pgno ovfl, nextOvfl; ++ int rc; ++ ++ if( NKEY(pBt, pCell->h) + NDATA(pBt, pCell->h) <= MX_LOCAL_PAYLOAD ){ ++ return SQLITE_OK; ++ } ++ ovfl = SWAB32(pBt, pCell->ovfl); ++ pCell->ovfl = 0; ++ while( ovfl ){ ++ rc = sqlitepager_get(pPager, ovfl, (void**)&pOvfl); ++ if( rc ) return rc; ++ nextOvfl = SWAB32(pBt, pOvfl->iNext); ++ rc = freePage(pBt, pOvfl, ovfl); ++ if( rc ) return rc; ++ sqlitepager_unref(pOvfl); ++ ovfl = nextOvfl; ++ } ++ return SQLITE_OK; ++} ++ ++/* ++** Create a new cell from key and data. Overflow pages are allocated as ++** necessary and linked to this cell. ++*/ ++static int fillInCell( ++ Btree *pBt, /* The whole Btree. Needed to allocate pages */ ++ Cell *pCell, /* Populate this Cell structure */ ++ const void *pKey, int nKey, /* The key */ ++ const void *pData,int nData /* The data */ ++){ ++ OverflowPage *pOvfl, *pPrior; ++ Pgno *pNext; ++ int spaceLeft; ++ int n, rc; ++ int nPayload; ++ const char *pPayload; ++ char *pSpace; ++ Pgno nearby = 0; ++ ++ pCell->h.leftChild = 0; ++ pCell->h.nKey = SWAB16(pBt, nKey & 0xffff); ++ pCell->h.nKeyHi = nKey >> 16; ++ pCell->h.nData = SWAB16(pBt, nData & 0xffff); ++ pCell->h.nDataHi = nData >> 16; ++ pCell->h.iNext = 0; ++ ++ pNext = &pCell->ovfl; ++ pSpace = pCell->aPayload; ++ spaceLeft = MX_LOCAL_PAYLOAD; ++ pPayload = pKey; ++ pKey = 0; ++ nPayload = nKey; ++ pPrior = 0; ++ while( nPayload>0 ){ ++ if( spaceLeft==0 ){ ++ rc = allocatePage(pBt, (MemPage**)&pOvfl, pNext, nearby); ++ if( rc ){ ++ *pNext = 0; ++ }else{ ++ nearby = *pNext; ++ } ++ if( pPrior ) sqlitepager_unref(pPrior); ++ if( rc ){ ++ clearCell(pBt, pCell); ++ return rc; ++ } ++ if( pBt->needSwab ) *pNext = swab32(*pNext); ++ pPrior = pOvfl; ++ spaceLeft = OVERFLOW_SIZE; ++ pSpace = pOvfl->aPayload; ++ pNext = &pOvfl->iNext; ++ } ++ n = nPayload; ++ if( n>spaceLeft ) n = spaceLeft; ++ memcpy(pSpace, pPayload, n); ++ nPayload -= n; ++ if( nPayload==0 && pData ){ ++ pPayload = pData; ++ nPayload = nData; ++ pData = 0; ++ }else{ ++ pPayload += n; ++ } ++ spaceLeft -= n; ++ pSpace += n; ++ } ++ *pNext = 0; ++ if( pPrior ){ ++ sqlitepager_unref(pPrior); ++ } ++ return SQLITE_OK; ++} ++ ++/* ++** Change the MemPage.pParent pointer on the page whose number is ++** given in the second argument so that MemPage.pParent holds the ++** pointer in the third argument. ++*/ ++static void reparentPage(Pager *pPager, Pgno pgno, MemPage *pNewParent,int idx){ ++ MemPage *pThis; ++ ++ if( pgno==0 ) return; ++ assert( pPager!=0 ); ++ pThis = sqlitepager_lookup(pPager, pgno); ++ if( pThis && pThis->isInit ){ ++ if( pThis->pParent!=pNewParent ){ ++ if( pThis->pParent ) sqlitepager_unref(pThis->pParent); ++ pThis->pParent = pNewParent; ++ if( pNewParent ) sqlitepager_ref(pNewParent); ++ } ++ pThis->idxParent = idx; ++ sqlitepager_unref(pThis); ++ } ++} ++ ++/* ++** Reparent all children of the given page to be the given page. ++** In other words, for every child of pPage, invoke reparentPage() ++** to make sure that each child knows that pPage is its parent. ++** ++** This routine gets called after you memcpy() one page into ++** another. ++*/ ++static void reparentChildPages(Btree *pBt, MemPage *pPage){ ++ int i; ++ Pager *pPager = pBt->pPager; ++ for(i=0; inCell; i++){ ++ reparentPage(pPager, SWAB32(pBt, pPage->apCell[i]->h.leftChild), pPage, i); ++ } ++ reparentPage(pPager, SWAB32(pBt, pPage->u.hdr.rightChild), pPage, i); ++ pPage->idxShift = 0; ++} ++ ++/* ++** Remove the i-th cell from pPage. This routine effects pPage only. ++** The cell content is not freed or deallocated. It is assumed that ++** the cell content has been copied someplace else. This routine just ++** removes the reference to the cell from pPage. ++** ++** "sz" must be the number of bytes in the cell. ++** ++** Do not bother maintaining the integrity of the linked list of Cells. ++** Only the pPage->apCell[] array is important. The relinkCellList() ++** routine will be called soon after this routine in order to rebuild ++** the linked list. ++*/ ++static void dropCell(Btree *pBt, MemPage *pPage, int idx, int sz){ ++ int j; ++ assert( idx>=0 && idxnCell ); ++ assert( sz==cellSize(pBt, pPage->apCell[idx]) ); ++ assert( sqlitepager_iswriteable(pPage) ); ++ freeSpace(pBt, pPage, Addr(pPage->apCell[idx]) - Addr(pPage), sz); ++ for(j=idx; jnCell-1; j++){ ++ pPage->apCell[j] = pPage->apCell[j+1]; ++ } ++ pPage->nCell--; ++ pPage->idxShift = 1; ++} ++ ++/* ++** Insert a new cell on pPage at cell index "i". pCell points to the ++** content of the cell. ++** ++** If the cell content will fit on the page, then put it there. If it ++** will not fit, then just make pPage->apCell[i] point to the content ++** and set pPage->isOverfull. ++** ++** Do not bother maintaining the integrity of the linked list of Cells. ++** Only the pPage->apCell[] array is important. The relinkCellList() ++** routine will be called soon after this routine in order to rebuild ++** the linked list. ++*/ ++static void insertCell(Btree *pBt, MemPage *pPage, int i, Cell *pCell, int sz){ ++ int idx, j; ++ assert( i>=0 && i<=pPage->nCell ); ++ assert( sz==cellSize(pBt, pCell) ); ++ assert( sqlitepager_iswriteable(pPage) ); ++ idx = allocateSpace(pBt, pPage, sz); ++ for(j=pPage->nCell; j>i; j--){ ++ pPage->apCell[j] = pPage->apCell[j-1]; ++ } ++ pPage->nCell++; ++ if( idx<=0 ){ ++ pPage->isOverfull = 1; ++ pPage->apCell[i] = pCell; ++ }else{ ++ memcpy(&pPage->u.aDisk[idx], pCell, sz); ++ pPage->apCell[i] = (Cell*)&pPage->u.aDisk[idx]; ++ } ++ pPage->idxShift = 1; ++} ++ ++/* ++** Rebuild the linked list of cells on a page so that the cells ++** occur in the order specified by the pPage->apCell[] array. ++** Invoke this routine once to repair damage after one or more ++** invocations of either insertCell() or dropCell(). ++*/ ++static void relinkCellList(Btree *pBt, MemPage *pPage){ ++ int i; ++ u16 *pIdx; ++ assert( sqlitepager_iswriteable(pPage) ); ++ pIdx = &pPage->u.hdr.firstCell; ++ for(i=0; inCell; i++){ ++ int idx = Addr(pPage->apCell[i]) - Addr(pPage); ++ assert( idx>0 && idxapCell[i]->h.iNext; ++ } ++ *pIdx = 0; ++} ++ ++/* ++** Make a copy of the contents of pFrom into pTo. The pFrom->apCell[] ++** pointers that point into pFrom->u.aDisk[] must be adjusted to point ++** into pTo->u.aDisk[] instead. But some pFrom->apCell[] entries might ++** not point to pFrom->u.aDisk[]. Those are unchanged. ++*/ ++static void copyPage(MemPage *pTo, MemPage *pFrom){ ++ uptr from, to; ++ int i; ++ memcpy(pTo->u.aDisk, pFrom->u.aDisk, SQLITE_USABLE_SIZE); ++ pTo->pParent = 0; ++ pTo->isInit = 1; ++ pTo->nCell = pFrom->nCell; ++ pTo->nFree = pFrom->nFree; ++ pTo->isOverfull = pFrom->isOverfull; ++ to = Addr(pTo); ++ from = Addr(pFrom); ++ for(i=0; inCell; i++){ ++ uptr x = Addr(pFrom->apCell[i]); ++ if( x>from && xapCell[i]) = x + to - from; ++ }else{ ++ pTo->apCell[i] = pFrom->apCell[i]; ++ } ++ } ++} ++ ++/* ++** The following parameters determine how many adjacent pages get involved ++** in a balancing operation. NN is the number of neighbors on either side ++** of the page that participate in the balancing operation. NB is the ++** total number of pages that participate, including the target page and ++** NN neighbors on either side. ++** ++** The minimum value of NN is 1 (of course). Increasing NN above 1 ++** (to 2 or 3) gives a modest improvement in SELECT and DELETE performance ++** in exchange for a larger degradation in INSERT and UPDATE performance. ++** The value of NN appears to give the best results overall. ++*/ ++#define NN 1 /* Number of neighbors on either side of pPage */ ++#define NB (NN*2+1) /* Total pages involved in the balance */ ++ ++/* ++** This routine redistributes Cells on pPage and up to two siblings ++** of pPage so that all pages have about the same amount of free space. ++** Usually one sibling on either side of pPage is used in the balancing, ++** though both siblings might come from one side if pPage is the first ++** or last child of its parent. If pPage has fewer than two siblings ++** (something which can only happen if pPage is the root page or a ++** child of root) then all available siblings participate in the balancing. ++** ++** The number of siblings of pPage might be increased or decreased by ++** one in an effort to keep pages between 66% and 100% full. The root page ++** is special and is allowed to be less than 66% full. If pPage is ++** the root page, then the depth of the tree might be increased ++** or decreased by one, as necessary, to keep the root page from being ++** overfull or empty. ++** ++** This routine calls relinkCellList() on its input page regardless of ++** whether or not it does any real balancing. Client routines will typically ++** invoke insertCell() or dropCell() before calling this routine, so we ++** need to call relinkCellList() to clean up the mess that those other ++** routines left behind. ++** ++** pCur is left pointing to the same cell as when this routine was called ++** even if that cell gets moved to a different page. pCur may be NULL. ++** Set the pCur parameter to NULL if you do not care about keeping track ++** of a cell as that will save this routine the work of keeping track of it. ++** ++** Note that when this routine is called, some of the Cells on pPage ++** might not actually be stored in pPage->u.aDisk[]. This can happen ++** if the page is overfull. Part of the job of this routine is to ++** make sure all Cells for pPage once again fit in pPage->u.aDisk[]. ++** ++** In the course of balancing the siblings of pPage, the parent of pPage ++** might become overfull or underfull. If that happens, then this routine ++** is called recursively on the parent. ++** ++** If this routine fails for any reason, it might leave the database ++** in a corrupted state. So if this routine fails, the database should ++** be rolled back. ++*/ ++static int balance(Btree *pBt, MemPage *pPage, BtCursor *pCur){ ++ MemPage *pParent; /* The parent of pPage */ ++ int nCell; /* Number of cells in apCell[] */ ++ int nOld; /* Number of pages in apOld[] */ ++ int nNew; /* Number of pages in apNew[] */ ++ int nDiv; /* Number of cells in apDiv[] */ ++ int i, j, k; /* Loop counters */ ++ int idx; /* Index of pPage in pParent->apCell[] */ ++ int nxDiv; /* Next divider slot in pParent->apCell[] */ ++ int rc; /* The return code */ ++ int iCur; /* apCell[iCur] is the cell of the cursor */ ++ MemPage *pOldCurPage; /* The cursor originally points to this page */ ++ int subtotal; /* Subtotal of bytes in cells on one page */ ++ MemPage *extraUnref = 0; /* A page that needs to be unref-ed */ ++ MemPage *apOld[NB]; /* pPage and up to two siblings */ ++ Pgno pgnoOld[NB]; /* Page numbers for each page in apOld[] */ ++ MemPage *apNew[NB+1]; /* pPage and up to NB siblings after balancing */ ++ Pgno pgnoNew[NB+1]; /* Page numbers for each page in apNew[] */ ++ int idxDiv[NB]; /* Indices of divider cells in pParent */ ++ Cell *apDiv[NB]; /* Divider cells in pParent */ ++ Cell aTemp[NB]; /* Temporary holding area for apDiv[] */ ++ int cntNew[NB+1]; /* Index in apCell[] of cell after i-th page */ ++ int szNew[NB+1]; /* Combined size of cells place on i-th page */ ++ MemPage aOld[NB]; /* Temporary copies of pPage and its siblings */ ++ Cell *apCell[(MX_CELL+2)*NB]; /* All cells from pages being balanced */ ++ int szCell[(MX_CELL+2)*NB]; /* Local size of all cells */ ++ ++ /* ++ ** Return without doing any work if pPage is neither overfull nor ++ ** underfull. ++ */ ++ assert( sqlitepager_iswriteable(pPage) ); ++ if( !pPage->isOverfull && pPage->nFreenCell>=2){ ++ relinkCellList(pBt, pPage); ++ return SQLITE_OK; ++ } ++ ++ /* ++ ** Find the parent of the page to be balanceed. ++ ** If there is no parent, it means this page is the root page and ++ ** special rules apply. ++ */ ++ pParent = pPage->pParent; ++ if( pParent==0 ){ ++ Pgno pgnoChild; ++ MemPage *pChild; ++ assert( pPage->isInit ); ++ if( pPage->nCell==0 ){ ++ if( pPage->u.hdr.rightChild ){ ++ /* ++ ** The root page is empty. Copy the one child page ++ ** into the root page and return. This reduces the depth ++ ** of the BTree by one. ++ */ ++ pgnoChild = SWAB32(pBt, pPage->u.hdr.rightChild); ++ rc = sqlitepager_get(pBt->pPager, pgnoChild, (void**)&pChild); ++ if( rc ) return rc; ++ memcpy(pPage, pChild, SQLITE_USABLE_SIZE); ++ pPage->isInit = 0; ++ rc = initPage(pBt, pPage, sqlitepager_pagenumber(pPage), 0); ++ assert( rc==SQLITE_OK ); ++ reparentChildPages(pBt, pPage); ++ if( pCur && pCur->pPage==pChild ){ ++ sqlitepager_unref(pChild); ++ pCur->pPage = pPage; ++ sqlitepager_ref(pPage); ++ } ++ freePage(pBt, pChild, pgnoChild); ++ sqlitepager_unref(pChild); ++ }else{ ++ relinkCellList(pBt, pPage); ++ } ++ return SQLITE_OK; ++ } ++ if( !pPage->isOverfull ){ ++ /* It is OK for the root page to be less than half full. ++ */ ++ relinkCellList(pBt, pPage); ++ return SQLITE_OK; ++ } ++ /* ++ ** If we get to here, it means the root page is overfull. ++ ** When this happens, Create a new child page and copy the ++ ** contents of the root into the child. Then make the root ++ ** page an empty page with rightChild pointing to the new ++ ** child. Then fall thru to the code below which will cause ++ ** the overfull child page to be split. ++ */ ++ rc = sqlitepager_write(pPage); ++ if( rc ) return rc; ++ rc = allocatePage(pBt, &pChild, &pgnoChild, sqlitepager_pagenumber(pPage)); ++ if( rc ) return rc; ++ assert( sqlitepager_iswriteable(pChild) ); ++ copyPage(pChild, pPage); ++ pChild->pParent = pPage; ++ pChild->idxParent = 0; ++ sqlitepager_ref(pPage); ++ pChild->isOverfull = 1; ++ if( pCur && pCur->pPage==pPage ){ ++ sqlitepager_unref(pPage); ++ pCur->pPage = pChild; ++ }else{ ++ extraUnref = pChild; ++ } ++ zeroPage(pBt, pPage); ++ pPage->u.hdr.rightChild = SWAB32(pBt, pgnoChild); ++ pParent = pPage; ++ pPage = pChild; ++ } ++ rc = sqlitepager_write(pParent); ++ if( rc ) return rc; ++ assert( pParent->isInit ); ++ ++ /* ++ ** Find the Cell in the parent page whose h.leftChild points back ++ ** to pPage. The "idx" variable is the index of that cell. If pPage ++ ** is the rightmost child of pParent then set idx to pParent->nCell ++ */ ++ if( pParent->idxShift ){ ++ Pgno pgno, swabPgno; ++ pgno = sqlitepager_pagenumber(pPage); ++ swabPgno = SWAB32(pBt, pgno); ++ for(idx=0; idxnCell; idx++){ ++ if( pParent->apCell[idx]->h.leftChild==swabPgno ){ ++ break; ++ } ++ } ++ assert( idxnCell || pParent->u.hdr.rightChild==swabPgno ); ++ }else{ ++ idx = pPage->idxParent; ++ } ++ ++ /* ++ ** Initialize variables so that it will be safe to jump ++ ** directly to balance_cleanup at any moment. ++ */ ++ nOld = nNew = 0; ++ sqlitepager_ref(pParent); ++ ++ /* ++ ** Find sibling pages to pPage and the Cells in pParent that divide ++ ** the siblings. An attempt is made to find NN siblings on either ++ ** side of pPage. More siblings are taken from one side, however, if ++ ** pPage there are fewer than NN siblings on the other side. If pParent ++ ** has NB or fewer children then all children of pParent are taken. ++ */ ++ nxDiv = idx - NN; ++ if( nxDiv + NB > pParent->nCell ){ ++ nxDiv = pParent->nCell - NB + 1; ++ } ++ if( nxDiv<0 ){ ++ nxDiv = 0; ++ } ++ nDiv = 0; ++ for(i=0, k=nxDiv; inCell ){ ++ idxDiv[i] = k; ++ apDiv[i] = pParent->apCell[k]; ++ nDiv++; ++ pgnoOld[i] = SWAB32(pBt, apDiv[i]->h.leftChild); ++ }else if( k==pParent->nCell ){ ++ pgnoOld[i] = SWAB32(pBt, pParent->u.hdr.rightChild); ++ }else{ ++ break; ++ } ++ rc = sqlitepager_get(pBt->pPager, pgnoOld[i], (void**)&apOld[i]); ++ if( rc ) goto balance_cleanup; ++ rc = initPage(pBt, apOld[i], pgnoOld[i], pParent); ++ if( rc ) goto balance_cleanup; ++ apOld[i]->idxParent = k; ++ nOld++; ++ } ++ ++ /* ++ ** Set iCur to be the index in apCell[] of the cell that the cursor ++ ** is pointing to. We will need this later on in order to keep the ++ ** cursor pointing at the same cell. If pCur points to a page that ++ ** has no involvement with this rebalancing, then set iCur to a large ++ ** number so that the iCur==j tests always fail in the main cell ++ ** distribution loop below. ++ */ ++ if( pCur ){ ++ iCur = 0; ++ for(i=0; ipPage==apOld[i] ){ ++ iCur += pCur->idx; ++ break; ++ } ++ iCur += apOld[i]->nCell; ++ if( ipPage==pParent && pCur->idx==idxDiv[i] ){ ++ break; ++ } ++ iCur++; ++ } ++ pOldCurPage = pCur->pPage; ++ } ++ ++ /* ++ ** Make copies of the content of pPage and its siblings into aOld[]. ++ ** The rest of this function will use data from the copies rather ++ ** that the original pages since the original pages will be in the ++ ** process of being overwritten. ++ */ ++ for(i=0; inCell; j++){ ++ apCell[nCell] = pOld->apCell[j]; ++ szCell[nCell] = cellSize(pBt, apCell[nCell]); ++ nCell++; ++ } ++ if( ih.leftChild)==pgnoOld[i] ); ++ apCell[nCell]->h.leftChild = pOld->u.hdr.rightChild; ++ nCell++; ++ } ++ } ++ ++ /* ++ ** Figure out the number of pages needed to hold all nCell cells. ++ ** Store this number in "k". Also compute szNew[] which is the total ++ ** size of all cells on the i-th page and cntNew[] which is the index ++ ** in apCell[] of the cell that divides path i from path i+1. ++ ** cntNew[k] should equal nCell. ++ ** ++ ** This little patch of code is critical for keeping the tree ++ ** balanced. ++ */ ++ for(subtotal=k=i=0; i USABLE_SPACE ){ ++ szNew[k] = subtotal - szCell[i]; ++ cntNew[k] = i; ++ subtotal = 0; ++ k++; ++ } ++ } ++ szNew[k] = subtotal; ++ cntNew[k] = nCell; ++ k++; ++ for(i=k-1; i>0; i--){ ++ while( szNew[i]0 ); ++ szNew[i] += szCell[cntNew[i-1]]; ++ szNew[i-1] -= szCell[cntNew[i-1]-1]; ++ } ++ } ++ assert( cntNew[0]>0 ); ++ ++ /* ++ ** Allocate k new pages. Reuse old pages where possible. ++ */ ++ for(i=0; iisInit = 1; ++ } ++ ++ /* Free any old pages that were not reused as new pages. ++ */ ++ while( ii ){ ++ int t; ++ MemPage *pT; ++ t = pgnoNew[i]; ++ pT = apNew[i]; ++ pgnoNew[i] = pgnoNew[minI]; ++ apNew[i] = apNew[minI]; ++ pgnoNew[minI] = t; ++ apNew[minI] = pT; ++ } ++ } ++ ++ /* ++ ** Evenly distribute the data in apCell[] across the new pages. ++ ** Insert divider cells into pParent as necessary. ++ */ ++ j = 0; ++ for(i=0; inFree>=szCell[j] ); ++ if( pCur && iCur==j ){ pCur->pPage = pNew; pCur->idx = pNew->nCell; } ++ insertCell(pBt, pNew, pNew->nCell, apCell[j], szCell[j]); ++ j++; ++ } ++ assert( pNew->nCell>0 ); ++ assert( !pNew->isOverfull ); ++ relinkCellList(pBt, pNew); ++ if( iu.hdr.rightChild = apCell[j]->h.leftChild; ++ apCell[j]->h.leftChild = SWAB32(pBt, pgnoNew[i]); ++ if( pCur && iCur==j ){ pCur->pPage = pParent; pCur->idx = nxDiv; } ++ insertCell(pBt, pParent, nxDiv, apCell[j], szCell[j]); ++ j++; ++ nxDiv++; ++ } ++ } ++ assert( j==nCell ); ++ apNew[nNew-1]->u.hdr.rightChild = aOld[nOld-1].u.hdr.rightChild; ++ if( nxDiv==pParent->nCell ){ ++ pParent->u.hdr.rightChild = SWAB32(pBt, pgnoNew[nNew-1]); ++ }else{ ++ pParent->apCell[nxDiv]->h.leftChild = SWAB32(pBt, pgnoNew[nNew-1]); ++ } ++ if( pCur ){ ++ if( j<=iCur && pCur->pPage==pParent && pCur->idx>idxDiv[nOld-1] ){ ++ assert( pCur->pPage==pOldCurPage ); ++ pCur->idx += nNew - nOld; ++ }else{ ++ assert( pOldCurPage!=0 ); ++ sqlitepager_ref(pCur->pPage); ++ sqlitepager_unref(pOldCurPage); ++ } ++ } ++ ++ /* ++ ** Reparent children of all cells. ++ */ ++ for(i=0; ipPage==0 ){ ++ pCur->pPage = pParent; ++ pCur->idx = 0; ++ }else{ ++ sqlitepager_unref(pParent); ++ } ++ return rc; ++} ++ ++/* ++** This routine checks all cursors that point to the same table ++** as pCur points to. If any of those cursors were opened with ++** wrFlag==0 then this routine returns SQLITE_LOCKED. If all ++** cursors point to the same table were opened with wrFlag==1 ++** then this routine returns SQLITE_OK. ++** ++** In addition to checking for read-locks (where a read-lock ++** means a cursor opened with wrFlag==0) this routine also moves ++** all cursors other than pCur so that they are pointing to the ++** first Cell on root page. This is necessary because an insert ++** or delete might change the number of cells on a page or delete ++** a page entirely and we do not want to leave any cursors ++** pointing to non-existant pages or cells. ++*/ ++static int checkReadLocks(BtCursor *pCur){ ++ BtCursor *p; ++ assert( pCur->wrFlag ); ++ for(p=pCur->pShared; p!=pCur; p=p->pShared){ ++ assert( p ); ++ assert( p->pgnoRoot==pCur->pgnoRoot ); ++ if( p->wrFlag==0 ) return SQLITE_LOCKED; ++ if( sqlitepager_pagenumber(p->pPage)!=p->pgnoRoot ){ ++ moveToRoot(p); ++ } ++ } ++ return SQLITE_OK; ++} ++ ++/* ++** Insert a new record into the BTree. The key is given by (pKey,nKey) ++** and the data is given by (pData,nData). The cursor is used only to ++** define what database the record should be inserted into. The cursor ++** is left pointing at the new record. ++*/ ++static int fileBtreeInsert( ++ BtCursor *pCur, /* Insert data into the table of this cursor */ ++ const void *pKey, int nKey, /* The key of the new record */ ++ const void *pData, int nData /* The data of the new record */ ++){ ++ Cell newCell; ++ int rc; ++ int loc; ++ int szNew; ++ MemPage *pPage; ++ Btree *pBt = pCur->pBt; ++ ++ if( pCur->pPage==0 ){ ++ return SQLITE_ABORT; /* A rollback destroyed this cursor */ ++ } ++ if( !pBt->inTrans || nKey+nData==0 ){ ++ /* Must start a transaction before doing an insert */ ++ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; ++ } ++ assert( !pBt->readOnly ); ++ if( !pCur->wrFlag ){ ++ return SQLITE_PERM; /* Cursor not open for writing */ ++ } ++ if( checkReadLocks(pCur) ){ ++ return SQLITE_LOCKED; /* The table pCur points to has a read lock */ ++ } ++ rc = fileBtreeMoveto(pCur, pKey, nKey, &loc); ++ if( rc ) return rc; ++ pPage = pCur->pPage; ++ assert( pPage->isInit ); ++ rc = sqlitepager_write(pPage); ++ if( rc ) return rc; ++ rc = fillInCell(pBt, &newCell, pKey, nKey, pData, nData); ++ if( rc ) return rc; ++ szNew = cellSize(pBt, &newCell); ++ if( loc==0 ){ ++ newCell.h.leftChild = pPage->apCell[pCur->idx]->h.leftChild; ++ rc = clearCell(pBt, pPage->apCell[pCur->idx]); ++ if( rc ) return rc; ++ dropCell(pBt, pPage, pCur->idx, cellSize(pBt, pPage->apCell[pCur->idx])); ++ }else if( loc<0 && pPage->nCell>0 ){ ++ assert( pPage->u.hdr.rightChild==0 ); /* Must be a leaf page */ ++ pCur->idx++; ++ }else{ ++ assert( pPage->u.hdr.rightChild==0 ); /* Must be a leaf page */ ++ } ++ insertCell(pBt, pPage, pCur->idx, &newCell, szNew); ++ rc = balance(pCur->pBt, pPage, pCur); ++ /* sqliteBtreePageDump(pCur->pBt, pCur->pgnoRoot, 1); */ ++ /* fflush(stdout); */ ++ pCur->eSkip = SKIP_INVALID; ++ return rc; ++} ++ ++/* ++** Delete the entry that the cursor is pointing to. ++** ++** The cursor is left pointing at either the next or the previous ++** entry. If the cursor is left pointing to the next entry, then ++** the pCur->eSkip flag is set to SKIP_NEXT which forces the next call to ++** sqliteBtreeNext() to be a no-op. That way, you can always call ++** sqliteBtreeNext() after a delete and the cursor will be left ++** pointing to the first entry after the deleted entry. Similarly, ++** pCur->eSkip is set to SKIP_PREV is the cursor is left pointing to ++** the entry prior to the deleted entry so that a subsequent call to ++** sqliteBtreePrevious() will always leave the cursor pointing at the ++** entry immediately before the one that was deleted. ++*/ ++static int fileBtreeDelete(BtCursor *pCur){ ++ MemPage *pPage = pCur->pPage; ++ Cell *pCell; ++ int rc; ++ Pgno pgnoChild; ++ Btree *pBt = pCur->pBt; ++ ++ assert( pPage->isInit ); ++ if( pCur->pPage==0 ){ ++ return SQLITE_ABORT; /* A rollback destroyed this cursor */ ++ } ++ if( !pBt->inTrans ){ ++ /* Must start a transaction before doing a delete */ ++ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; ++ } ++ assert( !pBt->readOnly ); ++ if( pCur->idx >= pPage->nCell ){ ++ return SQLITE_ERROR; /* The cursor is not pointing to anything */ ++ } ++ if( !pCur->wrFlag ){ ++ return SQLITE_PERM; /* Did not open this cursor for writing */ ++ } ++ if( checkReadLocks(pCur) ){ ++ return SQLITE_LOCKED; /* The table pCur points to has a read lock */ ++ } ++ rc = sqlitepager_write(pPage); ++ if( rc ) return rc; ++ pCell = pPage->apCell[pCur->idx]; ++ pgnoChild = SWAB32(pBt, pCell->h.leftChild); ++ clearCell(pBt, pCell); ++ if( pgnoChild ){ ++ /* ++ ** The entry we are about to delete is not a leaf so if we do not ++ ** do something we will leave a hole on an internal page. ++ ** We have to fill the hole by moving in a cell from a leaf. The ++ ** next Cell after the one to be deleted is guaranteed to exist and ++ ** to be a leaf so we can use it. ++ */ ++ BtCursor leafCur; ++ Cell *pNext; ++ int szNext; ++ int notUsed; ++ getTempCursor(pCur, &leafCur); ++ rc = fileBtreeNext(&leafCur, ¬Used); ++ if( rc!=SQLITE_OK ){ ++ if( rc!=SQLITE_NOMEM ) rc = SQLITE_CORRUPT; ++ return rc; ++ } ++ rc = sqlitepager_write(leafCur.pPage); ++ if( rc ) return rc; ++ dropCell(pBt, pPage, pCur->idx, cellSize(pBt, pCell)); ++ pNext = leafCur.pPage->apCell[leafCur.idx]; ++ szNext = cellSize(pBt, pNext); ++ pNext->h.leftChild = SWAB32(pBt, pgnoChild); ++ insertCell(pBt, pPage, pCur->idx, pNext, szNext); ++ rc = balance(pBt, pPage, pCur); ++ if( rc ) return rc; ++ pCur->eSkip = SKIP_NEXT; ++ dropCell(pBt, leafCur.pPage, leafCur.idx, szNext); ++ rc = balance(pBt, leafCur.pPage, pCur); ++ releaseTempCursor(&leafCur); ++ }else{ ++ dropCell(pBt, pPage, pCur->idx, cellSize(pBt, pCell)); ++ if( pCur->idx>=pPage->nCell ){ ++ pCur->idx = pPage->nCell-1; ++ if( pCur->idx<0 ){ ++ pCur->idx = 0; ++ pCur->eSkip = SKIP_NEXT; ++ }else{ ++ pCur->eSkip = SKIP_PREV; ++ } ++ }else{ ++ pCur->eSkip = SKIP_NEXT; ++ } ++ rc = balance(pBt, pPage, pCur); ++ } ++ return rc; ++} ++ ++/* ++** Create a new BTree table. Write into *piTable the page ++** number for the root page of the new table. ++** ++** In the current implementation, BTree tables and BTree indices are the ++** the same. In the future, we may change this so that BTree tables ++** are restricted to having a 4-byte integer key and arbitrary data and ++** BTree indices are restricted to having an arbitrary key and no data. ++** But for now, this routine also serves to create indices. ++*/ ++static int fileBtreeCreateTable(Btree *pBt, int *piTable){ ++ MemPage *pRoot; ++ Pgno pgnoRoot; ++ int rc; ++ if( !pBt->inTrans ){ ++ /* Must start a transaction first */ ++ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; ++ } ++ if( pBt->readOnly ){ ++ return SQLITE_READONLY; ++ } ++ rc = allocatePage(pBt, &pRoot, &pgnoRoot, 0); ++ if( rc ) return rc; ++ assert( sqlitepager_iswriteable(pRoot) ); ++ zeroPage(pBt, pRoot); ++ sqlitepager_unref(pRoot); ++ *piTable = (int)pgnoRoot; ++ return SQLITE_OK; ++} ++ ++/* ++** Erase the given database page and all its children. Return ++** the page to the freelist. ++*/ ++static int clearDatabasePage(Btree *pBt, Pgno pgno, int freePageFlag){ ++ MemPage *pPage; ++ int rc; ++ Cell *pCell; ++ int idx; ++ ++ rc = sqlitepager_get(pBt->pPager, pgno, (void**)&pPage); ++ if( rc ) return rc; ++ rc = sqlitepager_write(pPage); ++ if( rc ) return rc; ++ rc = initPage(pBt, pPage, pgno, 0); ++ if( rc ) return rc; ++ idx = SWAB16(pBt, pPage->u.hdr.firstCell); ++ while( idx>0 ){ ++ pCell = (Cell*)&pPage->u.aDisk[idx]; ++ idx = SWAB16(pBt, pCell->h.iNext); ++ if( pCell->h.leftChild ){ ++ rc = clearDatabasePage(pBt, SWAB32(pBt, pCell->h.leftChild), 1); ++ if( rc ) return rc; ++ } ++ rc = clearCell(pBt, pCell); ++ if( rc ) return rc; ++ } ++ if( pPage->u.hdr.rightChild ){ ++ rc = clearDatabasePage(pBt, SWAB32(pBt, pPage->u.hdr.rightChild), 1); ++ if( rc ) return rc; ++ } ++ if( freePageFlag ){ ++ rc = freePage(pBt, pPage, pgno); ++ }else{ ++ zeroPage(pBt, pPage); ++ } ++ sqlitepager_unref(pPage); ++ return rc; ++} ++ ++/* ++** Delete all information from a single table in the database. ++*/ ++static int fileBtreeClearTable(Btree *pBt, int iTable){ ++ int rc; ++ BtCursor *pCur; ++ if( !pBt->inTrans ){ ++ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; ++ } ++ for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){ ++ if( pCur->pgnoRoot==(Pgno)iTable ){ ++ if( pCur->wrFlag==0 ) return SQLITE_LOCKED; ++ moveToRoot(pCur); ++ } ++ } ++ rc = clearDatabasePage(pBt, (Pgno)iTable, 0); ++ if( rc ){ ++ fileBtreeRollback(pBt); ++ } ++ return rc; ++} ++ ++/* ++** Erase all information in a table and add the root of the table to ++** the freelist. Except, the root of the principle table (the one on ++** page 2) is never added to the freelist. ++*/ ++static int fileBtreeDropTable(Btree *pBt, int iTable){ ++ int rc; ++ MemPage *pPage; ++ BtCursor *pCur; ++ if( !pBt->inTrans ){ ++ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; ++ } ++ for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){ ++ if( pCur->pgnoRoot==(Pgno)iTable ){ ++ return SQLITE_LOCKED; /* Cannot drop a table that has a cursor */ ++ } ++ } ++ rc = sqlitepager_get(pBt->pPager, (Pgno)iTable, (void**)&pPage); ++ if( rc ) return rc; ++ rc = fileBtreeClearTable(pBt, iTable); ++ if( rc ) return rc; ++ if( iTable>2 ){ ++ rc = freePage(pBt, pPage, iTable); ++ }else{ ++ zeroPage(pBt, pPage); ++ } ++ sqlitepager_unref(pPage); ++ return rc; ++} ++ ++#if 0 /* UNTESTED */ ++/* ++** Copy all cell data from one database file into another. ++** pages back the freelist. ++*/ ++static int copyCell(Btree *pBtFrom, BTree *pBtTo, Cell *pCell){ ++ Pager *pFromPager = pBtFrom->pPager; ++ OverflowPage *pOvfl; ++ Pgno ovfl, nextOvfl; ++ Pgno *pPrev; ++ int rc = SQLITE_OK; ++ MemPage *pNew, *pPrevPg; ++ Pgno new; ++ ++ if( NKEY(pBtTo, pCell->h) + NDATA(pBtTo, pCell->h) <= MX_LOCAL_PAYLOAD ){ ++ return SQLITE_OK; ++ } ++ pPrev = &pCell->ovfl; ++ pPrevPg = 0; ++ ovfl = SWAB32(pBtTo, pCell->ovfl); ++ while( ovfl && rc==SQLITE_OK ){ ++ rc = sqlitepager_get(pFromPager, ovfl, (void**)&pOvfl); ++ if( rc ) return rc; ++ nextOvfl = SWAB32(pBtFrom, pOvfl->iNext); ++ rc = allocatePage(pBtTo, &pNew, &new, 0); ++ if( rc==SQLITE_OK ){ ++ rc = sqlitepager_write(pNew); ++ if( rc==SQLITE_OK ){ ++ memcpy(pNew, pOvfl, SQLITE_USABLE_SIZE); ++ *pPrev = SWAB32(pBtTo, new); ++ if( pPrevPg ){ ++ sqlitepager_unref(pPrevPg); ++ } ++ pPrev = &pOvfl->iNext; ++ pPrevPg = pNew; ++ } ++ } ++ sqlitepager_unref(pOvfl); ++ ovfl = nextOvfl; ++ } ++ if( pPrevPg ){ ++ sqlitepager_unref(pPrevPg); ++ } ++ return rc; ++} ++#endif ++ ++ ++#if 0 /* UNTESTED */ ++/* ++** Copy a page of data from one database over to another. ++*/ ++static int copyDatabasePage( ++ Btree *pBtFrom, ++ Pgno pgnoFrom, ++ Btree *pBtTo, ++ Pgno *pTo ++){ ++ MemPage *pPageFrom, *pPage; ++ Pgno to; ++ int rc; ++ Cell *pCell; ++ int idx; ++ ++ rc = sqlitepager_get(pBtFrom->pPager, pgno, (void**)&pPageFrom); ++ if( rc ) return rc; ++ rc = allocatePage(pBt, &pPage, pTo, 0); ++ if( rc==SQLITE_OK ){ ++ rc = sqlitepager_write(pPage); ++ } ++ if( rc==SQLITE_OK ){ ++ memcpy(pPage, pPageFrom, SQLITE_USABLE_SIZE); ++ idx = SWAB16(pBt, pPage->u.hdr.firstCell); ++ while( idx>0 ){ ++ pCell = (Cell*)&pPage->u.aDisk[idx]; ++ idx = SWAB16(pBt, pCell->h.iNext); ++ if( pCell->h.leftChild ){ ++ Pgno newChld; ++ rc = copyDatabasePage(pBtFrom, SWAB32(pBtFrom, pCell->h.leftChild), ++ pBtTo, &newChld); ++ if( rc ) return rc; ++ pCell->h.leftChild = SWAB32(pBtFrom, newChld); ++ } ++ rc = copyCell(pBtFrom, pBtTo, pCell); ++ if( rc ) return rc; ++ } ++ if( pPage->u.hdr.rightChild ){ ++ Pgno newChld; ++ rc = copyDatabasePage(pBtFrom, SWAB32(pBtFrom, pPage->u.hdr.rightChild), ++ pBtTo, &newChld); ++ if( rc ) return rc; ++ pPage->u.hdr.rightChild = SWAB32(pBtTo, newChild); ++ } ++ } ++ sqlitepager_unref(pPage); ++ return rc; ++} ++#endif ++ ++/* ++** Read the meta-information out of a database file. ++*/ ++static int fileBtreeGetMeta(Btree *pBt, int *aMeta){ ++ PageOne *pP1; ++ int rc; ++ int i; ++ ++ rc = sqlitepager_get(pBt->pPager, 1, (void**)&pP1); ++ if( rc ) return rc; ++ aMeta[0] = SWAB32(pBt, pP1->nFree); ++ for(i=0; iaMeta)/sizeof(pP1->aMeta[0]); i++){ ++ aMeta[i+1] = SWAB32(pBt, pP1->aMeta[i]); ++ } ++ sqlitepager_unref(pP1); ++ return SQLITE_OK; ++} ++ ++/* ++** Write meta-information back into the database. ++*/ ++static int fileBtreeUpdateMeta(Btree *pBt, int *aMeta){ ++ PageOne *pP1; ++ int rc, i; ++ if( !pBt->inTrans ){ ++ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; ++ } ++ pP1 = pBt->page1; ++ rc = sqlitepager_write(pP1); ++ if( rc ) return rc; ++ for(i=0; iaMeta)/sizeof(pP1->aMeta[0]); i++){ ++ pP1->aMeta[i] = SWAB32(pBt, aMeta[i+1]); ++ } ++ return SQLITE_OK; ++} ++ ++/****************************************************************************** ++** The complete implementation of the BTree subsystem is above this line. ++** All the code the follows is for testing and troubleshooting the BTree ++** subsystem. None of the code that follows is used during normal operation. ++******************************************************************************/ ++ ++/* ++** Print a disassembly of the given page on standard output. This routine ++** is used for debugging and testing only. ++*/ ++#ifdef SQLITE_TEST ++static int fileBtreePageDump(Btree *pBt, int pgno, int recursive){ ++ int rc; ++ MemPage *pPage; ++ int i, j; ++ int nFree; ++ u16 idx; ++ char range[20]; ++ unsigned char payload[20]; ++ rc = sqlitepager_get(pBt->pPager, (Pgno)pgno, (void**)&pPage); ++ if( rc ){ ++ return rc; ++ } ++ if( recursive ) printf("PAGE %d:\n", pgno); ++ i = 0; ++ idx = SWAB16(pBt, pPage->u.hdr.firstCell); ++ while( idx>0 && idx<=SQLITE_USABLE_SIZE-MIN_CELL_SIZE ){ ++ Cell *pCell = (Cell*)&pPage->u.aDisk[idx]; ++ int sz = cellSize(pBt, pCell); ++ sprintf(range,"%d..%d", idx, idx+sz-1); ++ sz = NKEY(pBt, pCell->h) + NDATA(pBt, pCell->h); ++ if( sz>sizeof(payload)-1 ) sz = sizeof(payload)-1; ++ memcpy(payload, pCell->aPayload, sz); ++ for(j=0; j0x7f ) payload[j] = '.'; ++ } ++ payload[sz] = 0; ++ printf( ++ "cell %2d: i=%-10s chld=%-4d nk=%-4d nd=%-4d payload=%s\n", ++ i, range, (int)pCell->h.leftChild, ++ NKEY(pBt, pCell->h), NDATA(pBt, pCell->h), ++ payload ++ ); ++ if( pPage->isInit && pPage->apCell[i]!=pCell ){ ++ printf("**** apCell[%d] does not match on prior entry ****\n", i); ++ } ++ i++; ++ idx = SWAB16(pBt, pCell->h.iNext); ++ } ++ if( idx!=0 ){ ++ printf("ERROR: next cell index out of range: %d\n", idx); ++ } ++ printf("right_child: %d\n", SWAB32(pBt, pPage->u.hdr.rightChild)); ++ nFree = 0; ++ i = 0; ++ idx = SWAB16(pBt, pPage->u.hdr.firstFree); ++ while( idx>0 && idxu.aDisk[idx]; ++ sprintf(range,"%d..%d", idx, idx+p->iSize-1); ++ nFree += SWAB16(pBt, p->iSize); ++ printf("freeblock %2d: i=%-10s size=%-4d total=%d\n", ++ i, range, SWAB16(pBt, p->iSize), nFree); ++ idx = SWAB16(pBt, p->iNext); ++ i++; ++ } ++ if( idx!=0 ){ ++ printf("ERROR: next freeblock index out of range: %d\n", idx); ++ } ++ if( recursive && pPage->u.hdr.rightChild!=0 ){ ++ idx = SWAB16(pBt, pPage->u.hdr.firstCell); ++ while( idx>0 && idxu.aDisk[idx]; ++ fileBtreePageDump(pBt, SWAB32(pBt, pCell->h.leftChild), 1); ++ idx = SWAB16(pBt, pCell->h.iNext); ++ } ++ fileBtreePageDump(pBt, SWAB32(pBt, pPage->u.hdr.rightChild), 1); ++ } ++ sqlitepager_unref(pPage); ++ return SQLITE_OK; ++} ++#endif ++ ++#ifdef SQLITE_TEST ++/* ++** Fill aResult[] with information about the entry and page that the ++** cursor is pointing to. ++** ++** aResult[0] = The page number ++** aResult[1] = The entry number ++** aResult[2] = Total number of entries on this page ++** aResult[3] = Size of this entry ++** aResult[4] = Number of free bytes on this page ++** aResult[5] = Number of free blocks on the page ++** aResult[6] = Page number of the left child of this entry ++** aResult[7] = Page number of the right child for the whole page ++** ++** This routine is used for testing and debugging only. ++*/ ++static int fileBtreeCursorDump(BtCursor *pCur, int *aResult){ ++ int cnt, idx; ++ MemPage *pPage = pCur->pPage; ++ Btree *pBt = pCur->pBt; ++ aResult[0] = sqlitepager_pagenumber(pPage); ++ aResult[1] = pCur->idx; ++ aResult[2] = pPage->nCell; ++ if( pCur->idx>=0 && pCur->idxnCell ){ ++ aResult[3] = cellSize(pBt, pPage->apCell[pCur->idx]); ++ aResult[6] = SWAB32(pBt, pPage->apCell[pCur->idx]->h.leftChild); ++ }else{ ++ aResult[3] = 0; ++ aResult[6] = 0; ++ } ++ aResult[4] = pPage->nFree; ++ cnt = 0; ++ idx = SWAB16(pBt, pPage->u.hdr.firstFree); ++ while( idx>0 && idxu.aDisk[idx])->iNext); ++ } ++ aResult[5] = cnt; ++ aResult[7] = SWAB32(pBt, pPage->u.hdr.rightChild); ++ return SQLITE_OK; ++} ++#endif ++ ++/* ++** Return the pager associated with a BTree. This routine is used for ++** testing and debugging only. ++*/ ++static Pager *fileBtreePager(Btree *pBt){ ++ return pBt->pPager; ++} ++ ++/* ++** This structure is passed around through all the sanity checking routines ++** in order to keep track of some global state information. ++*/ ++typedef struct IntegrityCk IntegrityCk; ++struct IntegrityCk { ++ Btree *pBt; /* The tree being checked out */ ++ Pager *pPager; /* The associated pager. Also accessible by pBt->pPager */ ++ int nPage; /* Number of pages in the database */ ++ int *anRef; /* Number of times each page is referenced */ ++ char *zErrMsg; /* An error message. NULL of no errors seen. */ ++}; ++ ++/* ++** Append a message to the error message string. ++*/ ++static void checkAppendMsg(IntegrityCk *pCheck, char *zMsg1, char *zMsg2){ ++ if( pCheck->zErrMsg ){ ++ char *zOld = pCheck->zErrMsg; ++ pCheck->zErrMsg = 0; ++ sqliteSetString(&pCheck->zErrMsg, zOld, "\n", zMsg1, zMsg2, (char*)0); ++ sqliteFree(zOld); ++ }else{ ++ sqliteSetString(&pCheck->zErrMsg, zMsg1, zMsg2, (char*)0); ++ } ++} ++ ++/* ++** Add 1 to the reference count for page iPage. If this is the second ++** reference to the page, add an error message to pCheck->zErrMsg. ++** Return 1 if there are 2 ore more references to the page and 0 if ++** if this is the first reference to the page. ++** ++** Also check that the page number is in bounds. ++*/ ++static int checkRef(IntegrityCk *pCheck, int iPage, char *zContext){ ++ if( iPage==0 ) return 1; ++ if( iPage>pCheck->nPage || iPage<0 ){ ++ char zBuf[100]; ++ sprintf(zBuf, "invalid page number %d", iPage); ++ checkAppendMsg(pCheck, zContext, zBuf); ++ return 1; ++ } ++ if( pCheck->anRef[iPage]==1 ){ ++ char zBuf[100]; ++ sprintf(zBuf, "2nd reference to page %d", iPage); ++ checkAppendMsg(pCheck, zContext, zBuf); ++ return 1; ++ } ++ return (pCheck->anRef[iPage]++)>1; ++} ++ ++/* ++** Check the integrity of the freelist or of an overflow page list. ++** Verify that the number of pages on the list is N. ++*/ ++static void checkList( ++ IntegrityCk *pCheck, /* Integrity checking context */ ++ int isFreeList, /* True for a freelist. False for overflow page list */ ++ int iPage, /* Page number for first page in the list */ ++ int N, /* Expected number of pages in the list */ ++ char *zContext /* Context for error messages */ ++){ ++ int i; ++ char zMsg[100]; ++ while( N-- > 0 ){ ++ OverflowPage *pOvfl; ++ if( iPage<1 ){ ++ sprintf(zMsg, "%d pages missing from overflow list", N+1); ++ checkAppendMsg(pCheck, zContext, zMsg); ++ break; ++ } ++ if( checkRef(pCheck, iPage, zContext) ) break; ++ if( sqlitepager_get(pCheck->pPager, (Pgno)iPage, (void**)&pOvfl) ){ ++ sprintf(zMsg, "failed to get page %d", iPage); ++ checkAppendMsg(pCheck, zContext, zMsg); ++ break; ++ } ++ if( isFreeList ){ ++ FreelistInfo *pInfo = (FreelistInfo*)pOvfl->aPayload; ++ int n = SWAB32(pCheck->pBt, pInfo->nFree); ++ for(i=0; ipBt, pInfo->aFree[i]), zContext); ++ } ++ N -= n; ++ } ++ iPage = SWAB32(pCheck->pBt, pOvfl->iNext); ++ sqlitepager_unref(pOvfl); ++ } ++} ++ ++/* ++** Return negative if zKey1zKey2. ++*/ ++static int keyCompare( ++ const char *zKey1, int nKey1, ++ const char *zKey2, int nKey2 ++){ ++ int min = nKey1>nKey2 ? nKey2 : nKey1; ++ int c = memcmp(zKey1, zKey2, min); ++ if( c==0 ){ ++ c = nKey1 - nKey2; ++ } ++ return c; ++} ++ ++/* ++** Do various sanity checks on a single page of a tree. Return ++** the tree depth. Root pages return 0. Parents of root pages ++** return 1, and so forth. ++** ++** These checks are done: ++** ++** 1. Make sure that cells and freeblocks do not overlap ++** but combine to completely cover the page. ++** 2. Make sure cell keys are in order. ++** 3. Make sure no key is less than or equal to zLowerBound. ++** 4. Make sure no key is greater than or equal to zUpperBound. ++** 5. Check the integrity of overflow pages. ++** 6. Recursively call checkTreePage on all children. ++** 7. Verify that the depth of all children is the same. ++** 8. Make sure this page is at least 33% full or else it is ++** the root of the tree. ++*/ ++static int checkTreePage( ++ IntegrityCk *pCheck, /* Context for the sanity check */ ++ int iPage, /* Page number of the page to check */ ++ MemPage *pParent, /* Parent page */ ++ char *zParentContext, /* Parent context */ ++ char *zLowerBound, /* All keys should be greater than this, if not NULL */ ++ int nLower, /* Number of characters in zLowerBound */ ++ char *zUpperBound, /* All keys should be less than this, if not NULL */ ++ int nUpper /* Number of characters in zUpperBound */ ++){ ++ MemPage *pPage; ++ int i, rc, depth, d2, pgno; ++ char *zKey1, *zKey2; ++ int nKey1, nKey2; ++ BtCursor cur; ++ Btree *pBt; ++ char zMsg[100]; ++ char zContext[100]; ++ char hit[SQLITE_USABLE_SIZE]; ++ ++ /* Check that the page exists ++ */ ++ cur.pBt = pBt = pCheck->pBt; ++ if( iPage==0 ) return 0; ++ if( checkRef(pCheck, iPage, zParentContext) ) return 0; ++ sprintf(zContext, "On tree page %d: ", iPage); ++ if( (rc = sqlitepager_get(pCheck->pPager, (Pgno)iPage, (void**)&pPage))!=0 ){ ++ sprintf(zMsg, "unable to get the page. error code=%d", rc); ++ checkAppendMsg(pCheck, zContext, zMsg); ++ return 0; ++ } ++ if( (rc = initPage(pBt, pPage, (Pgno)iPage, pParent))!=0 ){ ++ sprintf(zMsg, "initPage() returns error code %d", rc); ++ checkAppendMsg(pCheck, zContext, zMsg); ++ sqlitepager_unref(pPage); ++ return 0; ++ } ++ ++ /* Check out all the cells. ++ */ ++ depth = 0; ++ if( zLowerBound ){ ++ zKey1 = sqliteMalloc( nLower+1 ); ++ memcpy(zKey1, zLowerBound, nLower); ++ zKey1[nLower] = 0; ++ }else{ ++ zKey1 = 0; ++ } ++ nKey1 = nLower; ++ cur.pPage = pPage; ++ for(i=0; inCell; i++){ ++ Cell *pCell = pPage->apCell[i]; ++ int sz; ++ ++ /* Check payload overflow pages ++ */ ++ nKey2 = NKEY(pBt, pCell->h); ++ sz = nKey2 + NDATA(pBt, pCell->h); ++ sprintf(zContext, "On page %d cell %d: ", iPage, i); ++ if( sz>MX_LOCAL_PAYLOAD ){ ++ int nPage = (sz - MX_LOCAL_PAYLOAD + OVERFLOW_SIZE - 1)/OVERFLOW_SIZE; ++ checkList(pCheck, 0, SWAB32(pBt, pCell->ovfl), nPage, zContext); ++ } ++ ++ /* Check that keys are in the right order ++ */ ++ cur.idx = i; ++ zKey2 = sqliteMallocRaw( nKey2+1 ); ++ getPayload(&cur, 0, nKey2, zKey2); ++ if( zKey1 && keyCompare(zKey1, nKey1, zKey2, nKey2)>=0 ){ ++ checkAppendMsg(pCheck, zContext, "Key is out of order"); ++ } ++ ++ /* Check sanity of left child page. ++ */ ++ pgno = SWAB32(pBt, pCell->h.leftChild); ++ d2 = checkTreePage(pCheck, pgno, pPage, zContext, zKey1,nKey1,zKey2,nKey2); ++ if( i>0 && d2!=depth ){ ++ checkAppendMsg(pCheck, zContext, "Child page depth differs"); ++ } ++ depth = d2; ++ sqliteFree(zKey1); ++ zKey1 = zKey2; ++ nKey1 = nKey2; ++ } ++ pgno = SWAB32(pBt, pPage->u.hdr.rightChild); ++ sprintf(zContext, "On page %d at right child: ", iPage); ++ checkTreePage(pCheck, pgno, pPage, zContext, zKey1,nKey1,zUpperBound,nUpper); ++ sqliteFree(zKey1); ++ ++ /* Check for complete coverage of the page ++ */ ++ memset(hit, 0, sizeof(hit)); ++ memset(hit, 1, sizeof(PageHdr)); ++ for(i=SWAB16(pBt, pPage->u.hdr.firstCell); i>0 && iu.aDisk[i]; ++ int j; ++ for(j=i+cellSize(pBt, pCell)-1; j>=i; j--) hit[j]++; ++ i = SWAB16(pBt, pCell->h.iNext); ++ } ++ for(i=SWAB16(pBt,pPage->u.hdr.firstFree); i>0 && iu.aDisk[i]; ++ int j; ++ for(j=i+SWAB16(pBt,pFBlk->iSize)-1; j>=i; j--) hit[j]++; ++ i = SWAB16(pBt,pFBlk->iNext); ++ } ++ for(i=0; i1 ){ ++ sprintf(zMsg, "Multiple uses for byte %d of page %d", i, iPage); ++ checkAppendMsg(pCheck, zMsg, 0); ++ break; ++ } ++ } ++ ++ /* Check that free space is kept to a minimum ++ */ ++#if 0 ++ if( pParent && pParent->nCell>2 && pPage->nFree>3*SQLITE_USABLE_SIZE/4 ){ ++ sprintf(zMsg, "free space (%d) greater than max (%d)", pPage->nFree, ++ SQLITE_USABLE_SIZE/3); ++ checkAppendMsg(pCheck, zContext, zMsg); ++ } ++#endif ++ ++ sqlitepager_unref(pPage); ++ return depth; ++} ++ ++/* ++** This routine does a complete check of the given BTree file. aRoot[] is ++** an array of pages numbers were each page number is the root page of ++** a table. nRoot is the number of entries in aRoot. ++** ++** If everything checks out, this routine returns NULL. If something is ++** amiss, an error message is written into memory obtained from malloc() ++** and a pointer to that error message is returned. The calling function ++** is responsible for freeing the error message when it is done. ++*/ ++char *fileBtreeIntegrityCheck(Btree *pBt, int *aRoot, int nRoot){ ++ int i; ++ int nRef; ++ IntegrityCk sCheck; ++ ++ nRef = *sqlitepager_stats(pBt->pPager); ++ if( lockBtree(pBt)!=SQLITE_OK ){ ++ return sqliteStrDup("Unable to acquire a read lock on the database"); ++ } ++ sCheck.pBt = pBt; ++ sCheck.pPager = pBt->pPager; ++ sCheck.nPage = sqlitepager_pagecount(sCheck.pPager); ++ if( sCheck.nPage==0 ){ ++ unlockBtreeIfUnused(pBt); ++ return 0; ++ } ++ sCheck.anRef = sqliteMallocRaw( (sCheck.nPage+1)*sizeof(sCheck.anRef[0]) ); ++ sCheck.anRef[1] = 1; ++ for(i=2; i<=sCheck.nPage; i++){ sCheck.anRef[i] = 0; } ++ sCheck.zErrMsg = 0; ++ ++ /* Check the integrity of the freelist ++ */ ++ checkList(&sCheck, 1, SWAB32(pBt, pBt->page1->freeList), ++ SWAB32(pBt, pBt->page1->nFree), "Main freelist: "); ++ ++ /* Check all the tables. ++ */ ++ for(i=0; ipPager) ){ ++ char zBuf[100]; ++ sprintf(zBuf, ++ "Outstanding page count goes from %d to %d during this analysis", ++ nRef, *sqlitepager_stats(pBt->pPager) ++ ); ++ checkAppendMsg(&sCheck, zBuf, 0); ++ } ++ ++ /* Clean up and report errors. ++ */ ++ sqliteFree(sCheck.anRef); ++ return sCheck.zErrMsg; ++} ++ ++/* ++** Return the full pathname of the underlying database file. ++*/ ++static const char *fileBtreeGetFilename(Btree *pBt){ ++ assert( pBt->pPager!=0 ); ++ return sqlitepager_filename(pBt->pPager); ++} ++ ++/* ++** Copy the complete content of pBtFrom into pBtTo. A transaction ++** must be active for both files. ++** ++** The size of file pBtFrom may be reduced by this operation. ++** If anything goes wrong, the transaction on pBtFrom is rolled back. ++*/ ++static int fileBtreeCopyFile(Btree *pBtTo, Btree *pBtFrom){ ++ int rc = SQLITE_OK; ++ Pgno i, nPage, nToPage; ++ ++ if( !pBtTo->inTrans || !pBtFrom->inTrans ) return SQLITE_ERROR; ++ if( pBtTo->needSwab!=pBtFrom->needSwab ) return SQLITE_ERROR; ++ if( pBtTo->pCursor ) return SQLITE_BUSY; ++ memcpy(pBtTo->page1, pBtFrom->page1, SQLITE_USABLE_SIZE); ++ rc = sqlitepager_overwrite(pBtTo->pPager, 1, pBtFrom->page1); ++ nToPage = sqlitepager_pagecount(pBtTo->pPager); ++ nPage = sqlitepager_pagecount(pBtFrom->pPager); ++ for(i=2; rc==SQLITE_OK && i<=nPage; i++){ ++ void *pPage; ++ rc = sqlitepager_get(pBtFrom->pPager, i, &pPage); ++ if( rc ) break; ++ rc = sqlitepager_overwrite(pBtTo->pPager, i, pPage); ++ if( rc ) break; ++ sqlitepager_unref(pPage); ++ } ++ for(i=nPage+1; rc==SQLITE_OK && i<=nToPage; i++){ ++ void *pPage; ++ rc = sqlitepager_get(pBtTo->pPager, i, &pPage); ++ if( rc ) break; ++ rc = sqlitepager_write(pPage); ++ sqlitepager_unref(pPage); ++ sqlitepager_dont_write(pBtTo->pPager, i); ++ } ++ if( !rc && nPagepPager, nPage); ++ } ++ if( rc ){ ++ fileBtreeRollback(pBtTo); ++ } ++ return rc; ++} ++ ++/* ++** The following tables contain pointers to all of the interface ++** routines for this implementation of the B*Tree backend. To ++** substitute a different implemention of the backend, one has merely ++** to provide pointers to alternative functions in similar tables. ++*/ ++static BtOps sqliteBtreeOps = { ++ fileBtreeClose, ++ fileBtreeSetCacheSize, ++ fileBtreeSetSafetyLevel, ++ fileBtreeBeginTrans, ++ fileBtreeCommit, ++ fileBtreeRollback, ++ fileBtreeBeginCkpt, ++ fileBtreeCommitCkpt, ++ fileBtreeRollbackCkpt, ++ fileBtreeCreateTable, ++ fileBtreeCreateTable, /* Really sqliteBtreeCreateIndex() */ ++ fileBtreeDropTable, ++ fileBtreeClearTable, ++ fileBtreeCursor, ++ fileBtreeGetMeta, ++ fileBtreeUpdateMeta, ++ fileBtreeIntegrityCheck, ++ fileBtreeGetFilename, ++ fileBtreeCopyFile, ++ fileBtreePager, ++#ifdef SQLITE_TEST ++ fileBtreePageDump, ++#endif ++}; ++static BtCursorOps sqliteBtreeCursorOps = { ++ fileBtreeMoveto, ++ fileBtreeDelete, ++ fileBtreeInsert, ++ fileBtreeFirst, ++ fileBtreeLast, ++ fileBtreeNext, ++ fileBtreePrevious, ++ fileBtreeKeySize, ++ fileBtreeKey, ++ fileBtreeKeyCompare, ++ fileBtreeDataSize, ++ fileBtreeData, ++ fileBtreeCloseCursor, ++#ifdef SQLITE_TEST ++ fileBtreeCursorDump, ++#endif ++}; +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/btree.h +@@ -0,0 +1,156 @@ ++/* ++** 2001 September 15 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This header file defines the interface that the sqlite B-Tree file ++** subsystem. See comments in the source code for a detailed description ++** of what each interface routine does. ++** ++** @(#) $Id$ ++*/ ++#ifndef _BTREE_H_ ++#define _BTREE_H_ ++ ++/* ++** Forward declarations of structure ++*/ ++typedef struct Btree Btree; ++typedef struct BtCursor BtCursor; ++typedef struct BtOps BtOps; ++typedef struct BtCursorOps BtCursorOps; ++ ++ ++/* ++** An instance of the following structure contains pointers to all ++** methods against an open BTree. Alternative BTree implementations ++** (examples: file based versus in-memory) can be created by substituting ++** different methods. Users of the BTree cannot tell the difference. ++** ++** In C++ we could do this by defining a virtual base class and then ++** creating subclasses for each different implementation. But this is ++** C not C++ so we have to be a little more explicit. ++*/ ++struct BtOps { ++ int (*Close)(Btree*); ++ int (*SetCacheSize)(Btree*, int); ++ int (*SetSafetyLevel)(Btree*, int); ++ int (*BeginTrans)(Btree*); ++ int (*Commit)(Btree*); ++ int (*Rollback)(Btree*); ++ int (*BeginCkpt)(Btree*); ++ int (*CommitCkpt)(Btree*); ++ int (*RollbackCkpt)(Btree*); ++ int (*CreateTable)(Btree*, int*); ++ int (*CreateIndex)(Btree*, int*); ++ int (*DropTable)(Btree*, int); ++ int (*ClearTable)(Btree*, int); ++ int (*Cursor)(Btree*, int iTable, int wrFlag, BtCursor **ppCur); ++ int (*GetMeta)(Btree*, int*); ++ int (*UpdateMeta)(Btree*, int*); ++ char *(*IntegrityCheck)(Btree*, int*, int); ++ const char *(*GetFilename)(Btree*); ++ int (*Copyfile)(Btree*,Btree*); ++ struct Pager *(*Pager)(Btree*); ++#ifdef SQLITE_TEST ++ int (*PageDump)(Btree*, int, int); ++#endif ++}; ++ ++/* ++** An instance of this structure defines all of the methods that can ++** be executed against a cursor. ++*/ ++struct BtCursorOps { ++ int (*Moveto)(BtCursor*, const void *pKey, int nKey, int *pRes); ++ int (*Delete)(BtCursor*); ++ int (*Insert)(BtCursor*, const void *pKey, int nKey, ++ const void *pData, int nData); ++ int (*First)(BtCursor*, int *pRes); ++ int (*Last)(BtCursor*, int *pRes); ++ int (*Next)(BtCursor*, int *pRes); ++ int (*Previous)(BtCursor*, int *pRes); ++ int (*KeySize)(BtCursor*, int *pSize); ++ int (*Key)(BtCursor*, int offset, int amt, char *zBuf); ++ int (*KeyCompare)(BtCursor*, const void *pKey, int nKey, ++ int nIgnore, int *pRes); ++ int (*DataSize)(BtCursor*, int *pSize); ++ int (*Data)(BtCursor*, int offset, int amt, char *zBuf); ++ int (*CloseCursor)(BtCursor*); ++#ifdef SQLITE_TEST ++ int (*CursorDump)(BtCursor*, int*); ++#endif ++}; ++ ++/* ++** The number of 4-byte "meta" values contained on the first page of each ++** database file. ++*/ ++#define SQLITE_N_BTREE_META 10 ++ ++int sqliteBtreeOpen(const char *zFilename, int mode, int nPg, Btree **ppBtree); ++int sqliteRbtreeOpen(const char *zFilename, int mode, int nPg, Btree **ppBtree); ++ ++#define btOps(pBt) (*((BtOps **)(pBt))) ++#define btCOps(pCur) (*((BtCursorOps **)(pCur))) ++ ++#define sqliteBtreeClose(pBt) (btOps(pBt)->Close(pBt)) ++#define sqliteBtreeSetCacheSize(pBt, sz) (btOps(pBt)->SetCacheSize(pBt, sz)) ++#define sqliteBtreeSetSafetyLevel(pBt, sl) (btOps(pBt)->SetSafetyLevel(pBt, sl)) ++#define sqliteBtreeBeginTrans(pBt) (btOps(pBt)->BeginTrans(pBt)) ++#define sqliteBtreeCommit(pBt) (btOps(pBt)->Commit(pBt)) ++#define sqliteBtreeRollback(pBt) (btOps(pBt)->Rollback(pBt)) ++#define sqliteBtreeBeginCkpt(pBt) (btOps(pBt)->BeginCkpt(pBt)) ++#define sqliteBtreeCommitCkpt(pBt) (btOps(pBt)->CommitCkpt(pBt)) ++#define sqliteBtreeRollbackCkpt(pBt) (btOps(pBt)->RollbackCkpt(pBt)) ++#define sqliteBtreeCreateTable(pBt,piTable)\ ++ (btOps(pBt)->CreateTable(pBt,piTable)) ++#define sqliteBtreeCreateIndex(pBt, piIndex)\ ++ (btOps(pBt)->CreateIndex(pBt, piIndex)) ++#define sqliteBtreeDropTable(pBt, iTable) (btOps(pBt)->DropTable(pBt, iTable)) ++#define sqliteBtreeClearTable(pBt, iTable)\ ++ (btOps(pBt)->ClearTable(pBt, iTable)) ++#define sqliteBtreeCursor(pBt, iTable, wrFlag, ppCur)\ ++ (btOps(pBt)->Cursor(pBt, iTable, wrFlag, ppCur)) ++#define sqliteBtreeMoveto(pCur, pKey, nKey, pRes)\ ++ (btCOps(pCur)->Moveto(pCur, pKey, nKey, pRes)) ++#define sqliteBtreeDelete(pCur) (btCOps(pCur)->Delete(pCur)) ++#define sqliteBtreeInsert(pCur, pKey, nKey, pData, nData) \ ++ (btCOps(pCur)->Insert(pCur, pKey, nKey, pData, nData)) ++#define sqliteBtreeFirst(pCur, pRes) (btCOps(pCur)->First(pCur, pRes)) ++#define sqliteBtreeLast(pCur, pRes) (btCOps(pCur)->Last(pCur, pRes)) ++#define sqliteBtreeNext(pCur, pRes) (btCOps(pCur)->Next(pCur, pRes)) ++#define sqliteBtreePrevious(pCur, pRes) (btCOps(pCur)->Previous(pCur, pRes)) ++#define sqliteBtreeKeySize(pCur, pSize) (btCOps(pCur)->KeySize(pCur, pSize) ) ++#define sqliteBtreeKey(pCur, offset, amt, zBuf)\ ++ (btCOps(pCur)->Key(pCur, offset, amt, zBuf)) ++#define sqliteBtreeKeyCompare(pCur, pKey, nKey, nIgnore, pRes)\ ++ (btCOps(pCur)->KeyCompare(pCur, pKey, nKey, nIgnore, pRes)) ++#define sqliteBtreeDataSize(pCur, pSize) (btCOps(pCur)->DataSize(pCur, pSize)) ++#define sqliteBtreeData(pCur, offset, amt, zBuf)\ ++ (btCOps(pCur)->Data(pCur, offset, amt, zBuf)) ++#define sqliteBtreeCloseCursor(pCur) (btCOps(pCur)->CloseCursor(pCur)) ++#define sqliteBtreeGetMeta(pBt, aMeta) (btOps(pBt)->GetMeta(pBt, aMeta)) ++#define sqliteBtreeUpdateMeta(pBt, aMeta) (btOps(pBt)->UpdateMeta(pBt, aMeta)) ++#define sqliteBtreeIntegrityCheck(pBt, aRoot, nRoot)\ ++ (btOps(pBt)->IntegrityCheck(pBt, aRoot, nRoot)) ++#define sqliteBtreeGetFilename(pBt) (btOps(pBt)->GetFilename(pBt)) ++#define sqliteBtreeCopyFile(pBt1, pBt2) (btOps(pBt1)->Copyfile(pBt1, pBt2)) ++#define sqliteBtreePager(pBt) (btOps(pBt)->Pager(pBt)) ++ ++#ifdef SQLITE_TEST ++#define sqliteBtreePageDump(pBt, pgno, recursive)\ ++ (btOps(pBt)->PageDump(pBt, pgno, recursive)) ++#define sqliteBtreeCursorDump(pCur, aResult)\ ++ (btCOps(pCur)->CursorDump(pCur, aResult)) ++int btree_native_byte_order; ++#endif /* SQLITE_TEST */ ++ ++ ++#endif /* _BTREE_H_ */ +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/btree_rb.c +@@ -0,0 +1,1488 @@ ++/* ++** 2003 Feb 4 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** $Id$ ++** ++** This file implements an in-core database using Red-Black balanced ++** binary trees. ++** ++** It was contributed to SQLite by anonymous on 2003-Feb-04 23:24:49 UTC. ++*/ ++#include "btree.h" ++#include "sqliteInt.h" ++#include ++ ++/* ++** Omit this whole file if the SQLITE_OMIT_INMEMORYDB macro is ++** defined. This allows a lot of code to be omitted for installations ++** that do not need it. ++*/ ++#ifndef SQLITE_OMIT_INMEMORYDB ++ ++ ++typedef struct BtRbTree BtRbTree; ++typedef struct BtRbNode BtRbNode; ++typedef struct BtRollbackOp BtRollbackOp; ++typedef struct Rbtree Rbtree; ++typedef struct RbtCursor RbtCursor; ++ ++/* Forward declarations */ ++static BtOps sqliteRbtreeOps; ++static BtCursorOps sqliteRbtreeCursorOps; ++ ++/* ++ * During each transaction (or checkpoint), a linked-list of ++ * "rollback-operations" is accumulated. If the transaction is rolled back, ++ * then the list of operations must be executed (to restore the database to ++ * it's state before the transaction started). If the transaction is to be ++ * committed, just delete the list. ++ * ++ * Each operation is represented as follows, depending on the value of eOp: ++ * ++ * ROLLBACK_INSERT -> Need to insert (pKey, pData) into table iTab. ++ * ROLLBACK_DELETE -> Need to delete the record (pKey) into table iTab. ++ * ROLLBACK_CREATE -> Need to create table iTab. ++ * ROLLBACK_DROP -> Need to drop table iTab. ++ */ ++struct BtRollbackOp { ++ u8 eOp; ++ int iTab; ++ int nKey; ++ void *pKey; ++ int nData; ++ void *pData; ++ BtRollbackOp *pNext; ++}; ++ ++/* ++** Legal values for BtRollbackOp.eOp: ++*/ ++#define ROLLBACK_INSERT 1 /* Insert a record */ ++#define ROLLBACK_DELETE 2 /* Delete a record */ ++#define ROLLBACK_CREATE 3 /* Create a table */ ++#define ROLLBACK_DROP 4 /* Drop a table */ ++ ++struct Rbtree { ++ BtOps *pOps; /* Function table */ ++ int aMetaData[SQLITE_N_BTREE_META]; ++ ++ int next_idx; /* next available table index */ ++ Hash tblHash; /* All created tables, by index */ ++ u8 isAnonymous; /* True if this Rbtree is to be deleted when closed */ ++ u8 eTransState; /* State of this Rbtree wrt transactions */ ++ ++ BtRollbackOp *pTransRollback; ++ BtRollbackOp *pCheckRollback; ++ BtRollbackOp *pCheckRollbackTail; ++}; ++ ++/* ++** Legal values for Rbtree.eTransState. ++*/ ++#define TRANS_NONE 0 /* No transaction is in progress */ ++#define TRANS_INTRANSACTION 1 /* A transaction is in progress */ ++#define TRANS_INCHECKPOINT 2 /* A checkpoint is in progress */ ++#define TRANS_ROLLBACK 3 /* We are currently rolling back a checkpoint or ++ * transaction. */ ++ ++struct RbtCursor { ++ BtCursorOps *pOps; /* Function table */ ++ Rbtree *pRbtree; ++ BtRbTree *pTree; ++ int iTree; /* Index of pTree in pRbtree */ ++ BtRbNode *pNode; ++ RbtCursor *pShared; /* List of all cursors on the same Rbtree */ ++ u8 eSkip; /* Determines if next step operation is a no-op */ ++ u8 wrFlag; /* True if this cursor is open for writing */ ++}; ++ ++/* ++** Legal values for RbtCursor.eSkip. ++*/ ++#define SKIP_NONE 0 /* Always step the cursor */ ++#define SKIP_NEXT 1 /* The next sqliteRbtreeNext() is a no-op */ ++#define SKIP_PREV 2 /* The next sqliteRbtreePrevious() is a no-op */ ++#define SKIP_INVALID 3 /* Calls to Next() and Previous() are invalid */ ++ ++struct BtRbTree { ++ RbtCursor *pCursors; /* All cursors pointing to this tree */ ++ BtRbNode *pHead; /* Head of the tree, or NULL */ ++}; ++ ++struct BtRbNode { ++ int nKey; ++ void *pKey; ++ int nData; ++ void *pData; ++ u8 isBlack; /* true for a black node, 0 for a red node */ ++ BtRbNode *pParent; /* Nodes parent node, NULL for the tree head */ ++ BtRbNode *pLeft; /* Nodes left child, or NULL */ ++ BtRbNode *pRight; /* Nodes right child, or NULL */ ++ ++ int nBlackHeight; /* Only used during the red-black integrity check */ ++}; ++ ++/* Forward declarations */ ++static int memRbtreeMoveto( ++ RbtCursor* pCur, ++ const void *pKey, ++ int nKey, ++ int *pRes ++); ++static int memRbtreeClearTable(Rbtree* tree, int n); ++static int memRbtreeNext(RbtCursor* pCur, int *pRes); ++static int memRbtreeLast(RbtCursor* pCur, int *pRes); ++static int memRbtreePrevious(RbtCursor* pCur, int *pRes); ++ ++ ++/* ++** This routine checks all cursors that point to the same table ++** as pCur points to. If any of those cursors were opened with ++** wrFlag==0 then this routine returns SQLITE_LOCKED. If all ++** cursors point to the same table were opened with wrFlag==1 ++** then this routine returns SQLITE_OK. ++** ++** In addition to checking for read-locks (where a read-lock ++** means a cursor opened with wrFlag==0) this routine also NULLs ++** out the pNode field of all other cursors. ++** This is necessary because an insert ++** or delete might change erase the node out from under ++** another cursor. ++*/ ++static int checkReadLocks(RbtCursor *pCur){ ++ RbtCursor *p; ++ assert( pCur->wrFlag ); ++ for(p=pCur->pTree->pCursors; p; p=p->pShared){ ++ if( p!=pCur ){ ++ if( p->wrFlag==0 ) return SQLITE_LOCKED; ++ p->pNode = 0; ++ } ++ } ++ return SQLITE_OK; ++} ++ ++/* ++ * The key-compare function for the red-black trees. Returns as follows: ++ * ++ * (key1 < key2) -1 ++ * (key1 == key2) 0 ++ * (key1 > key2) 1 ++ * ++ * Keys are compared using memcmp(). If one key is an exact prefix of the ++ * other, then the shorter key is less than the longer key. ++ */ ++static int key_compare(void const*pKey1, int nKey1, void const*pKey2, int nKey2) ++{ ++ int mcmp = memcmp(pKey1, pKey2, (nKey1 <= nKey2)?nKey1:nKey2); ++ if( mcmp == 0){ ++ if( nKey1 == nKey2 ) return 0; ++ return ((nKey1 < nKey2)?-1:1); ++ } ++ return ((mcmp>0)?1:-1); ++} ++ ++/* ++ * Perform the LEFT-rotate transformation on node X of tree pTree. This ++ * transform is part of the red-black balancing code. ++ * ++ * | | ++ * X Y ++ * / \ / \ ++ * a Y X c ++ * / \ / \ ++ * b c a b ++ * ++ * BEFORE AFTER ++ */ ++static void leftRotate(BtRbTree *pTree, BtRbNode *pX) ++{ ++ BtRbNode *pY; ++ BtRbNode *pb; ++ pY = pX->pRight; ++ pb = pY->pLeft; ++ ++ pY->pParent = pX->pParent; ++ if( pX->pParent ){ ++ if( pX->pParent->pLeft == pX ) pX->pParent->pLeft = pY; ++ else pX->pParent->pRight = pY; ++ } ++ pY->pLeft = pX; ++ pX->pParent = pY; ++ pX->pRight = pb; ++ if( pb ) pb->pParent = pX; ++ if( pTree->pHead == pX ) pTree->pHead = pY; ++} ++ ++/* ++ * Perform the RIGHT-rotate transformation on node X of tree pTree. This ++ * transform is part of the red-black balancing code. ++ * ++ * | | ++ * X Y ++ * / \ / \ ++ * Y c a X ++ * / \ / \ ++ * a b b c ++ * ++ * BEFORE AFTER ++ */ ++static void rightRotate(BtRbTree *pTree, BtRbNode *pX) ++{ ++ BtRbNode *pY; ++ BtRbNode *pb; ++ pY = pX->pLeft; ++ pb = pY->pRight; ++ ++ pY->pParent = pX->pParent; ++ if( pX->pParent ){ ++ if( pX->pParent->pLeft == pX ) pX->pParent->pLeft = pY; ++ else pX->pParent->pRight = pY; ++ } ++ pY->pRight = pX; ++ pX->pParent = pY; ++ pX->pLeft = pb; ++ if( pb ) pb->pParent = pX; ++ if( pTree->pHead == pX ) pTree->pHead = pY; ++} ++ ++/* ++ * A string-manipulation helper function for check_redblack_tree(). If (orig == ++ * NULL) a copy of val is returned. If (orig != NULL) then a copy of the * ++ * concatenation of orig and val is returned. The original orig is deleted ++ * (using sqliteFree()). ++ */ ++static char *append_val(char * orig, char const * val){ ++ char *z; ++ if( !orig ){ ++ z = sqliteStrDup( val ); ++ } else{ ++ z = 0; ++ sqliteSetString(&z, orig, val, (char*)0); ++ sqliteFree( orig ); ++ } ++ return z; ++} ++ ++/* ++ * Append a string representation of the entire node to orig and return it. ++ * This is used to produce debugging information if check_redblack_tree() finds ++ * a problem with a red-black binary tree. ++ */ ++static char *append_node(char * orig, BtRbNode *pNode, int indent) ++{ ++ char buf[128]; ++ int i; ++ ++ for( i=0; iisBlack ){ ++ orig = append_val(orig, " B \n"); ++ }else{ ++ orig = append_val(orig, " R \n"); ++ } ++ orig = append_node( orig, pNode->pLeft, indent ); ++ orig = append_node( orig, pNode->pRight, indent ); ++ }else{ ++ orig = append_val(orig, "\n"); ++ } ++ return orig; ++} ++ ++/* ++ * Print a representation of a node to stdout. This function is only included ++ * so you can call it from within a debugger if things get really bad. It ++ * is not called from anyplace in the code. ++ */ ++static void print_node(BtRbNode *pNode) ++{ ++ char * str = append_node(0, pNode, 0); ++ printf("%s", str); ++ ++ /* Suppress a warning message about print_node() being unused */ ++ (void)print_node; ++} ++ ++/* ++ * Check the following properties of the red-black tree: ++ * (1) - If a node is red, both of it's children are black ++ * (2) - Each path from a given node to a leaf (NULL) node passes thru the ++ * same number of black nodes ++ * ++ * If there is a problem, append a description (using append_val() ) to *msg. ++ */ ++static void check_redblack_tree(BtRbTree * tree, char ** msg) ++{ ++ BtRbNode *pNode; ++ ++ /* 0 -> came from parent ++ * 1 -> came from left ++ * 2 -> came from right */ ++ int prev_step = 0; ++ ++ pNode = tree->pHead; ++ while( pNode ){ ++ switch( prev_step ){ ++ case 0: ++ if( pNode->pLeft ){ ++ pNode = pNode->pLeft; ++ }else{ ++ prev_step = 1; ++ } ++ break; ++ case 1: ++ if( pNode->pRight ){ ++ pNode = pNode->pRight; ++ prev_step = 0; ++ }else{ ++ prev_step = 2; ++ } ++ break; ++ case 2: ++ /* Check red-black property (1) */ ++ if( !pNode->isBlack && ++ ( (pNode->pLeft && !pNode->pLeft->isBlack) || ++ (pNode->pRight && !pNode->pRight->isBlack) ) ++ ){ ++ char buf[128]; ++ sprintf(buf, "Red node with red child at %p\n", pNode); ++ *msg = append_val(*msg, buf); ++ *msg = append_node(*msg, tree->pHead, 0); ++ *msg = append_val(*msg, "\n"); ++ } ++ ++ /* Check red-black property (2) */ ++ { ++ int leftHeight = 0; ++ int rightHeight = 0; ++ if( pNode->pLeft ){ ++ leftHeight += pNode->pLeft->nBlackHeight; ++ leftHeight += (pNode->pLeft->isBlack?1:0); ++ } ++ if( pNode->pRight ){ ++ rightHeight += pNode->pRight->nBlackHeight; ++ rightHeight += (pNode->pRight->isBlack?1:0); ++ } ++ if( leftHeight != rightHeight ){ ++ char buf[128]; ++ sprintf(buf, "Different black-heights at %p\n", pNode); ++ *msg = append_val(*msg, buf); ++ *msg = append_node(*msg, tree->pHead, 0); ++ *msg = append_val(*msg, "\n"); ++ } ++ pNode->nBlackHeight = leftHeight; ++ } ++ ++ if( pNode->pParent ){ ++ if( pNode == pNode->pParent->pLeft ) prev_step = 1; ++ else prev_step = 2; ++ } ++ pNode = pNode->pParent; ++ break; ++ default: assert(0); ++ } ++ } ++} ++ ++/* ++ * Node pX has just been inserted into pTree (by code in sqliteRbtreeInsert()). ++ * It is possible that pX is a red node with a red parent, which is a violation ++ * of the red-black tree properties. This function performs rotations and ++ * color changes to rebalance the tree ++ */ ++static void do_insert_balancing(BtRbTree *pTree, BtRbNode *pX) ++{ ++ /* In the first iteration of this loop, pX points to the red node just ++ * inserted in the tree. If the parent of pX exists (pX is not the root ++ * node) and is red, then the properties of the red-black tree are ++ * violated. ++ * ++ * At the start of any subsequent iterations, pX points to a red node ++ * with a red parent. In all other respects the tree is a legal red-black ++ * binary tree. */ ++ while( pX != pTree->pHead && !pX->pParent->isBlack ){ ++ BtRbNode *pUncle; ++ BtRbNode *pGrandparent; ++ ++ /* Grandparent of pX must exist and must be black. */ ++ pGrandparent = pX->pParent->pParent; ++ assert( pGrandparent ); ++ assert( pGrandparent->isBlack ); ++ ++ /* Uncle of pX may or may not exist. */ ++ if( pX->pParent == pGrandparent->pLeft ) ++ pUncle = pGrandparent->pRight; ++ else ++ pUncle = pGrandparent->pLeft; ++ ++ /* If the uncle of pX exists and is red, we do the following: ++ * | | ++ * G(b) G(r) ++ * / \ / \ ++ * U(r) P(r) U(b) P(b) ++ * \ \ ++ * X(r) X(r) ++ * ++ * BEFORE AFTER ++ * pX is then set to G. If the parent of G is red, then the while loop ++ * will run again. */ ++ if( pUncle && !pUncle->isBlack ){ ++ pGrandparent->isBlack = 0; ++ pUncle->isBlack = 1; ++ pX->pParent->isBlack = 1; ++ pX = pGrandparent; ++ }else{ ++ ++ if( pX->pParent == pGrandparent->pLeft ){ ++ if( pX == pX->pParent->pRight ){ ++ /* If pX is a right-child, do the following transform, essentially ++ * to change pX into a left-child: ++ * | | ++ * G(b) G(b) ++ * / \ / \ ++ * P(r) U(b) X(r) U(b) ++ * \ / ++ * X(r) P(r) <-- new X ++ * ++ * BEFORE AFTER ++ */ ++ pX = pX->pParent; ++ leftRotate(pTree, pX); ++ } ++ ++ /* Do the following transform, which balances the tree :) ++ * | | ++ * G(b) P(b) ++ * / \ / \ ++ * P(r) U(b) X(r) G(r) ++ * / \ ++ * X(r) U(b) ++ * ++ * BEFORE AFTER ++ */ ++ assert( pGrandparent == pX->pParent->pParent ); ++ pGrandparent->isBlack = 0; ++ pX->pParent->isBlack = 1; ++ rightRotate( pTree, pGrandparent ); ++ ++ }else{ ++ /* This code is symetric to the illustrated case above. */ ++ if( pX == pX->pParent->pLeft ){ ++ pX = pX->pParent; ++ rightRotate(pTree, pX); ++ } ++ assert( pGrandparent == pX->pParent->pParent ); ++ pGrandparent->isBlack = 0; ++ pX->pParent->isBlack = 1; ++ leftRotate( pTree, pGrandparent ); ++ } ++ } ++ } ++ pTree->pHead->isBlack = 1; ++} ++ ++/* ++ * A child of pParent, which in turn had child pX, has just been removed from ++ * pTree (the figure below depicts the operation, Z is being removed). pParent ++ * or pX, or both may be NULL. ++ * | | ++ * P P ++ * / \ / \ ++ * Z X ++ * / \ ++ * X nil ++ * ++ * This function is only called if Z was black. In this case the red-black tree ++ * properties have been violated, and pX has an "extra black". This function ++ * performs rotations and color-changes to re-balance the tree. ++ */ ++static ++void do_delete_balancing(BtRbTree *pTree, BtRbNode *pX, BtRbNode *pParent) ++{ ++ BtRbNode *pSib; ++ ++ /* TODO: Comment this code! */ ++ while( pX != pTree->pHead && (!pX || pX->isBlack) ){ ++ if( pX == pParent->pLeft ){ ++ pSib = pParent->pRight; ++ if( pSib && !(pSib->isBlack) ){ ++ pSib->isBlack = 1; ++ pParent->isBlack = 0; ++ leftRotate(pTree, pParent); ++ pSib = pParent->pRight; ++ } ++ if( !pSib ){ ++ pX = pParent; ++ }else if( ++ (!pSib->pLeft || pSib->pLeft->isBlack) && ++ (!pSib->pRight || pSib->pRight->isBlack) ) { ++ pSib->isBlack = 0; ++ pX = pParent; ++ }else{ ++ if( (!pSib->pRight || pSib->pRight->isBlack) ){ ++ if( pSib->pLeft ) pSib->pLeft->isBlack = 1; ++ pSib->isBlack = 0; ++ rightRotate( pTree, pSib ); ++ pSib = pParent->pRight; ++ } ++ pSib->isBlack = pParent->isBlack; ++ pParent->isBlack = 1; ++ if( pSib->pRight ) pSib->pRight->isBlack = 1; ++ leftRotate(pTree, pParent); ++ pX = pTree->pHead; ++ } ++ }else{ ++ pSib = pParent->pLeft; ++ if( pSib && !(pSib->isBlack) ){ ++ pSib->isBlack = 1; ++ pParent->isBlack = 0; ++ rightRotate(pTree, pParent); ++ pSib = pParent->pLeft; ++ } ++ if( !pSib ){ ++ pX = pParent; ++ }else if( ++ (!pSib->pLeft || pSib->pLeft->isBlack) && ++ (!pSib->pRight || pSib->pRight->isBlack) ){ ++ pSib->isBlack = 0; ++ pX = pParent; ++ }else{ ++ if( (!pSib->pLeft || pSib->pLeft->isBlack) ){ ++ if( pSib->pRight ) pSib->pRight->isBlack = 1; ++ pSib->isBlack = 0; ++ leftRotate( pTree, pSib ); ++ pSib = pParent->pLeft; ++ } ++ pSib->isBlack = pParent->isBlack; ++ pParent->isBlack = 1; ++ if( pSib->pLeft ) pSib->pLeft->isBlack = 1; ++ rightRotate(pTree, pParent); ++ pX = pTree->pHead; ++ } ++ } ++ pParent = pX->pParent; ++ } ++ if( pX ) pX->isBlack = 1; ++} ++ ++/* ++ * Create table n in tree pRbtree. Table n must not exist. ++ */ ++static void btreeCreateTable(Rbtree* pRbtree, int n) ++{ ++ BtRbTree *pNewTbl = sqliteMalloc(sizeof(BtRbTree)); ++ sqliteHashInsert(&pRbtree->tblHash, 0, n, pNewTbl); ++} ++ ++/* ++ * Log a single "rollback-op" for the given Rbtree. See comments for struct ++ * BtRollbackOp. ++ */ ++static void btreeLogRollbackOp(Rbtree* pRbtree, BtRollbackOp *pRollbackOp) ++{ ++ assert( pRbtree->eTransState == TRANS_INCHECKPOINT || ++ pRbtree->eTransState == TRANS_INTRANSACTION ); ++ if( pRbtree->eTransState == TRANS_INTRANSACTION ){ ++ pRollbackOp->pNext = pRbtree->pTransRollback; ++ pRbtree->pTransRollback = pRollbackOp; ++ } ++ if( pRbtree->eTransState == TRANS_INCHECKPOINT ){ ++ if( !pRbtree->pCheckRollback ){ ++ pRbtree->pCheckRollbackTail = pRollbackOp; ++ } ++ pRollbackOp->pNext = pRbtree->pCheckRollback; ++ pRbtree->pCheckRollback = pRollbackOp; ++ } ++} ++ ++int sqliteRbtreeOpen( ++ const char *zFilename, ++ int mode, ++ int nPg, ++ Btree **ppBtree ++){ ++ Rbtree **ppRbtree = (Rbtree**)ppBtree; ++ *ppRbtree = (Rbtree *)sqliteMalloc(sizeof(Rbtree)); ++ if( sqlite_malloc_failed ) goto open_no_mem; ++ sqliteHashInit(&(*ppRbtree)->tblHash, SQLITE_HASH_INT, 0); ++ ++ /* Create a binary tree for the SQLITE_MASTER table at location 2 */ ++ btreeCreateTable(*ppRbtree, 2); ++ if( sqlite_malloc_failed ) goto open_no_mem; ++ (*ppRbtree)->next_idx = 3; ++ (*ppRbtree)->pOps = &sqliteRbtreeOps; ++ /* Set file type to 4; this is so that "attach ':memory:' as ...." does not ++ ** think that the database in uninitialised and refuse to attach ++ */ ++ (*ppRbtree)->aMetaData[2] = 4; ++ ++ return SQLITE_OK; ++ ++open_no_mem: ++ *ppBtree = 0; ++ return SQLITE_NOMEM; ++} ++ ++/* ++ * Create a new table in the supplied Rbtree. Set *n to the new table number. ++ * Return SQLITE_OK if the operation is a success. ++ */ ++static int memRbtreeCreateTable(Rbtree* tree, int* n) ++{ ++ assert( tree->eTransState != TRANS_NONE ); ++ ++ *n = tree->next_idx++; ++ btreeCreateTable(tree, *n); ++ if( sqlite_malloc_failed ) return SQLITE_NOMEM; ++ ++ /* Set up the rollback structure (if we are not doing this as part of a ++ * rollback) */ ++ if( tree->eTransState != TRANS_ROLLBACK ){ ++ BtRollbackOp *pRollbackOp = sqliteMalloc(sizeof(BtRollbackOp)); ++ if( pRollbackOp==0 ) return SQLITE_NOMEM; ++ pRollbackOp->eOp = ROLLBACK_DROP; ++ pRollbackOp->iTab = *n; ++ btreeLogRollbackOp(tree, pRollbackOp); ++ } ++ ++ return SQLITE_OK; ++} ++ ++/* ++ * Delete table n from the supplied Rbtree. ++ */ ++static int memRbtreeDropTable(Rbtree* tree, int n) ++{ ++ BtRbTree *pTree; ++ assert( tree->eTransState != TRANS_NONE ); ++ ++ memRbtreeClearTable(tree, n); ++ pTree = sqliteHashInsert(&tree->tblHash, 0, n, 0); ++ assert(pTree); ++ assert( pTree->pCursors==0 ); ++ sqliteFree(pTree); ++ ++ if( tree->eTransState != TRANS_ROLLBACK ){ ++ BtRollbackOp *pRollbackOp = sqliteMalloc(sizeof(BtRollbackOp)); ++ if( pRollbackOp==0 ) return SQLITE_NOMEM; ++ pRollbackOp->eOp = ROLLBACK_CREATE; ++ pRollbackOp->iTab = n; ++ btreeLogRollbackOp(tree, pRollbackOp); ++ } ++ ++ return SQLITE_OK; ++} ++ ++static int memRbtreeKeyCompare(RbtCursor* pCur, const void *pKey, int nKey, ++ int nIgnore, int *pRes) ++{ ++ assert(pCur); ++ ++ if( !pCur->pNode ) { ++ *pRes = -1; ++ } else { ++ if( (pCur->pNode->nKey - nIgnore) < 0 ){ ++ *pRes = -1; ++ }else{ ++ *pRes = key_compare(pCur->pNode->pKey, pCur->pNode->nKey-nIgnore, ++ pKey, nKey); ++ } ++ } ++ return SQLITE_OK; ++} ++ ++/* ++ * Get a new cursor for table iTable of the supplied Rbtree. The wrFlag ++ * parameter indicates that the cursor is open for writing. ++ * ++ * Note that RbtCursor.eSkip and RbtCursor.pNode both initialize to 0. ++ */ ++static int memRbtreeCursor( ++ Rbtree* tree, ++ int iTable, ++ int wrFlag, ++ RbtCursor **ppCur ++){ ++ RbtCursor *pCur; ++ assert(tree); ++ pCur = *ppCur = sqliteMalloc(sizeof(RbtCursor)); ++ if( sqlite_malloc_failed ) return SQLITE_NOMEM; ++ pCur->pTree = sqliteHashFind(&tree->tblHash, 0, iTable); ++ assert( pCur->pTree ); ++ pCur->pRbtree = tree; ++ pCur->iTree = iTable; ++ pCur->pOps = &sqliteRbtreeCursorOps; ++ pCur->wrFlag = wrFlag; ++ pCur->pShared = pCur->pTree->pCursors; ++ pCur->pTree->pCursors = pCur; ++ ++ assert( (*ppCur)->pTree ); ++ return SQLITE_OK; ++} ++ ++/* ++ * Insert a new record into the Rbtree. The key is given by (pKey,nKey) ++ * and the data is given by (pData,nData). The cursor is used only to ++ * define what database the record should be inserted into. The cursor ++ * is left pointing at the new record. ++ * ++ * If the key exists already in the tree, just replace the data. ++ */ ++static int memRbtreeInsert( ++ RbtCursor* pCur, ++ const void *pKey, ++ int nKey, ++ const void *pDataInput, ++ int nData ++){ ++ void * pData; ++ int match; ++ ++ /* It is illegal to call sqliteRbtreeInsert() if we are ++ ** not in a transaction */ ++ assert( pCur->pRbtree->eTransState != TRANS_NONE ); ++ ++ /* Make sure some other cursor isn't trying to read this same table */ ++ if( checkReadLocks(pCur) ){ ++ return SQLITE_LOCKED; /* The table pCur points to has a read lock */ ++ } ++ ++ /* Take a copy of the input data now, in case we need it for the ++ * replace case */ ++ pData = sqliteMallocRaw(nData); ++ if( sqlite_malloc_failed ) return SQLITE_NOMEM; ++ memcpy(pData, pDataInput, nData); ++ ++ /* Move the cursor to a node near the key to be inserted. If the key already ++ * exists in the table, then (match == 0). In this case we can just replace ++ * the data associated with the entry, we don't need to manipulate the tree. ++ * ++ * If there is no exact match, then the cursor points at what would be either ++ * the predecessor (match == -1) or successor (match == 1) of the ++ * searched-for key, were it to be inserted. The new node becomes a child of ++ * this node. ++ * ++ * The new node is initially red. ++ */ ++ memRbtreeMoveto( pCur, pKey, nKey, &match); ++ if( match ){ ++ BtRbNode *pNode = sqliteMalloc(sizeof(BtRbNode)); ++ if( pNode==0 ) return SQLITE_NOMEM; ++ pNode->nKey = nKey; ++ pNode->pKey = sqliteMallocRaw(nKey); ++ if( sqlite_malloc_failed ) return SQLITE_NOMEM; ++ memcpy(pNode->pKey, pKey, nKey); ++ pNode->nData = nData; ++ pNode->pData = pData; ++ if( pCur->pNode ){ ++ switch( match ){ ++ case -1: ++ assert( !pCur->pNode->pRight ); ++ pNode->pParent = pCur->pNode; ++ pCur->pNode->pRight = pNode; ++ break; ++ case 1: ++ assert( !pCur->pNode->pLeft ); ++ pNode->pParent = pCur->pNode; ++ pCur->pNode->pLeft = pNode; ++ break; ++ default: ++ assert(0); ++ } ++ }else{ ++ pCur->pTree->pHead = pNode; ++ } ++ ++ /* Point the cursor at the node just inserted, as per SQLite requirements */ ++ pCur->pNode = pNode; ++ ++ /* A new node has just been inserted, so run the balancing code */ ++ do_insert_balancing(pCur->pTree, pNode); ++ ++ /* Set up a rollback-op in case we have to roll this operation back */ ++ if( pCur->pRbtree->eTransState != TRANS_ROLLBACK ){ ++ BtRollbackOp *pOp = sqliteMalloc( sizeof(BtRollbackOp) ); ++ if( pOp==0 ) return SQLITE_NOMEM; ++ pOp->eOp = ROLLBACK_DELETE; ++ pOp->iTab = pCur->iTree; ++ pOp->nKey = pNode->nKey; ++ pOp->pKey = sqliteMallocRaw( pOp->nKey ); ++ if( sqlite_malloc_failed ) return SQLITE_NOMEM; ++ memcpy( pOp->pKey, pNode->pKey, pOp->nKey ); ++ btreeLogRollbackOp(pCur->pRbtree, pOp); ++ } ++ ++ }else{ ++ /* No need to insert a new node in the tree, as the key already exists. ++ * Just clobber the current nodes data. */ ++ ++ /* Set up a rollback-op in case we have to roll this operation back */ ++ if( pCur->pRbtree->eTransState != TRANS_ROLLBACK ){ ++ BtRollbackOp *pOp = sqliteMalloc( sizeof(BtRollbackOp) ); ++ if( pOp==0 ) return SQLITE_NOMEM; ++ pOp->iTab = pCur->iTree; ++ pOp->nKey = pCur->pNode->nKey; ++ pOp->pKey = sqliteMallocRaw( pOp->nKey ); ++ if( sqlite_malloc_failed ) return SQLITE_NOMEM; ++ memcpy( pOp->pKey, pCur->pNode->pKey, pOp->nKey ); ++ pOp->nData = pCur->pNode->nData; ++ pOp->pData = pCur->pNode->pData; ++ pOp->eOp = ROLLBACK_INSERT; ++ btreeLogRollbackOp(pCur->pRbtree, pOp); ++ }else{ ++ sqliteFree( pCur->pNode->pData ); ++ } ++ ++ /* Actually clobber the nodes data */ ++ pCur->pNode->pData = pData; ++ pCur->pNode->nData = nData; ++ } ++ ++ return SQLITE_OK; ++} ++ ++/* Move the cursor so that it points to an entry near pKey. ++** Return a success code. ++** ++** *pRes<0 The cursor is left pointing at an entry that ++** is smaller than pKey or if the table is empty ++** and the cursor is therefore left point to nothing. ++** ++** *pRes==0 The cursor is left pointing at an entry that ++** exactly matches pKey. ++** ++** *pRes>0 The cursor is left pointing at an entry that ++** is larger than pKey. ++*/ ++static int memRbtreeMoveto( ++ RbtCursor* pCur, ++ const void *pKey, ++ int nKey, ++ int *pRes ++){ ++ BtRbNode *pTmp = 0; ++ ++ pCur->pNode = pCur->pTree->pHead; ++ *pRes = -1; ++ while( pCur->pNode && *pRes ) { ++ *pRes = key_compare(pCur->pNode->pKey, pCur->pNode->nKey, pKey, nKey); ++ pTmp = pCur->pNode; ++ switch( *pRes ){ ++ case 1: /* cursor > key */ ++ pCur->pNode = pCur->pNode->pLeft; ++ break; ++ case -1: /* cursor < key */ ++ pCur->pNode = pCur->pNode->pRight; ++ break; ++ } ++ } ++ ++ /* If (pCur->pNode == NULL), then we have failed to find a match. Set ++ * pCur->pNode to pTmp, which is either NULL (if the tree is empty) or the ++ * last node traversed in the search. In either case the relation ship ++ * between pTmp and the searched for key is already stored in *pRes. pTmp is ++ * either the successor or predecessor of the key we tried to move to. */ ++ if( !pCur->pNode ) pCur->pNode = pTmp; ++ pCur->eSkip = SKIP_NONE; ++ ++ return SQLITE_OK; ++} ++ ++ ++/* ++** Delete the entry that the cursor is pointing to. ++** ++** The cursor is left pointing at either the next or the previous ++** entry. If the cursor is left pointing to the next entry, then ++** the pCur->eSkip flag is set to SKIP_NEXT which forces the next call to ++** sqliteRbtreeNext() to be a no-op. That way, you can always call ++** sqliteRbtreeNext() after a delete and the cursor will be left ++** pointing to the first entry after the deleted entry. Similarly, ++** pCur->eSkip is set to SKIP_PREV is the cursor is left pointing to ++** the entry prior to the deleted entry so that a subsequent call to ++** sqliteRbtreePrevious() will always leave the cursor pointing at the ++** entry immediately before the one that was deleted. ++*/ ++static int memRbtreeDelete(RbtCursor* pCur) ++{ ++ BtRbNode *pZ; /* The one being deleted */ ++ BtRbNode *pChild; /* The child of the spliced out node */ ++ ++ /* It is illegal to call sqliteRbtreeDelete() if we are ++ ** not in a transaction */ ++ assert( pCur->pRbtree->eTransState != TRANS_NONE ); ++ ++ /* Make sure some other cursor isn't trying to read this same table */ ++ if( checkReadLocks(pCur) ){ ++ return SQLITE_LOCKED; /* The table pCur points to has a read lock */ ++ } ++ ++ pZ = pCur->pNode; ++ if( !pZ ){ ++ return SQLITE_OK; ++ } ++ ++ /* If we are not currently doing a rollback, set up a rollback op for this ++ * deletion */ ++ if( pCur->pRbtree->eTransState != TRANS_ROLLBACK ){ ++ BtRollbackOp *pOp = sqliteMalloc( sizeof(BtRollbackOp) ); ++ if( pOp==0 ) return SQLITE_NOMEM; ++ pOp->iTab = pCur->iTree; ++ pOp->nKey = pZ->nKey; ++ pOp->pKey = pZ->pKey; ++ pOp->nData = pZ->nData; ++ pOp->pData = pZ->pData; ++ pOp->eOp = ROLLBACK_INSERT; ++ btreeLogRollbackOp(pCur->pRbtree, pOp); ++ } ++ ++ /* First do a standard binary-tree delete (node pZ is to be deleted). How ++ * to do this depends on how many children pZ has: ++ * ++ * If pZ has no children or one child, then splice out pZ. If pZ has two ++ * children, splice out the successor of pZ and replace the key and data of ++ * pZ with the key and data of the spliced out successor. */ ++ if( pZ->pLeft && pZ->pRight ){ ++ BtRbNode *pTmp; ++ int dummy; ++ pCur->eSkip = SKIP_NONE; ++ memRbtreeNext(pCur, &dummy); ++ assert( dummy == 0 ); ++ if( pCur->pRbtree->eTransState == TRANS_ROLLBACK ){ ++ sqliteFree(pZ->pKey); ++ sqliteFree(pZ->pData); ++ } ++ pZ->pData = pCur->pNode->pData; ++ pZ->nData = pCur->pNode->nData; ++ pZ->pKey = pCur->pNode->pKey; ++ pZ->nKey = pCur->pNode->nKey; ++ pTmp = pZ; ++ pZ = pCur->pNode; ++ pCur->pNode = pTmp; ++ pCur->eSkip = SKIP_NEXT; ++ }else{ ++ int res; ++ pCur->eSkip = SKIP_NONE; ++ memRbtreeNext(pCur, &res); ++ pCur->eSkip = SKIP_NEXT; ++ if( res ){ ++ memRbtreeLast(pCur, &res); ++ memRbtreePrevious(pCur, &res); ++ pCur->eSkip = SKIP_PREV; ++ } ++ if( pCur->pRbtree->eTransState == TRANS_ROLLBACK ){ ++ sqliteFree(pZ->pKey); ++ sqliteFree(pZ->pData); ++ } ++ } ++ ++ /* pZ now points at the node to be spliced out. This block does the ++ * splicing. */ ++ { ++ BtRbNode **ppParentSlot = 0; ++ assert( !pZ->pLeft || !pZ->pRight ); /* pZ has at most one child */ ++ pChild = ((pZ->pLeft)?pZ->pLeft:pZ->pRight); ++ if( pZ->pParent ){ ++ assert( pZ == pZ->pParent->pLeft || pZ == pZ->pParent->pRight ); ++ ppParentSlot = ((pZ == pZ->pParent->pLeft) ++ ?&pZ->pParent->pLeft:&pZ->pParent->pRight); ++ *ppParentSlot = pChild; ++ }else{ ++ pCur->pTree->pHead = pChild; ++ } ++ if( pChild ) pChild->pParent = pZ->pParent; ++ } ++ ++ /* pZ now points at the spliced out node. pChild is the only child of pZ, or ++ * NULL if pZ has no children. If pZ is black, and not the tree root, then we ++ * will have violated the "same number of black nodes in every path to a ++ * leaf" property of the red-black tree. The code in do_delete_balancing() ++ * repairs this. */ ++ if( pZ->isBlack ){ ++ do_delete_balancing(pCur->pTree, pChild, pZ->pParent); ++ } ++ ++ sqliteFree(pZ); ++ return SQLITE_OK; ++} ++ ++/* ++ * Empty table n of the Rbtree. ++ */ ++static int memRbtreeClearTable(Rbtree* tree, int n) ++{ ++ BtRbTree *pTree; ++ BtRbNode *pNode; ++ ++ pTree = sqliteHashFind(&tree->tblHash, 0, n); ++ assert(pTree); ++ ++ pNode = pTree->pHead; ++ while( pNode ){ ++ if( pNode->pLeft ){ ++ pNode = pNode->pLeft; ++ } ++ else if( pNode->pRight ){ ++ pNode = pNode->pRight; ++ } ++ else { ++ BtRbNode *pTmp = pNode->pParent; ++ if( tree->eTransState == TRANS_ROLLBACK ){ ++ sqliteFree( pNode->pKey ); ++ sqliteFree( pNode->pData ); ++ }else{ ++ BtRollbackOp *pRollbackOp = sqliteMallocRaw(sizeof(BtRollbackOp)); ++ if( pRollbackOp==0 ) return SQLITE_NOMEM; ++ pRollbackOp->eOp = ROLLBACK_INSERT; ++ pRollbackOp->iTab = n; ++ pRollbackOp->nKey = pNode->nKey; ++ pRollbackOp->pKey = pNode->pKey; ++ pRollbackOp->nData = pNode->nData; ++ pRollbackOp->pData = pNode->pData; ++ btreeLogRollbackOp(tree, pRollbackOp); ++ } ++ sqliteFree( pNode ); ++ if( pTmp ){ ++ if( pTmp->pLeft == pNode ) pTmp->pLeft = 0; ++ else if( pTmp->pRight == pNode ) pTmp->pRight = 0; ++ } ++ pNode = pTmp; ++ } ++ } ++ ++ pTree->pHead = 0; ++ return SQLITE_OK; ++} ++ ++static int memRbtreeFirst(RbtCursor* pCur, int *pRes) ++{ ++ if( pCur->pTree->pHead ){ ++ pCur->pNode = pCur->pTree->pHead; ++ while( pCur->pNode->pLeft ){ ++ pCur->pNode = pCur->pNode->pLeft; ++ } ++ } ++ if( pCur->pNode ){ ++ *pRes = 0; ++ }else{ ++ *pRes = 1; ++ } ++ pCur->eSkip = SKIP_NONE; ++ return SQLITE_OK; ++} ++ ++static int memRbtreeLast(RbtCursor* pCur, int *pRes) ++{ ++ if( pCur->pTree->pHead ){ ++ pCur->pNode = pCur->pTree->pHead; ++ while( pCur->pNode->pRight ){ ++ pCur->pNode = pCur->pNode->pRight; ++ } ++ } ++ if( pCur->pNode ){ ++ *pRes = 0; ++ }else{ ++ *pRes = 1; ++ } ++ pCur->eSkip = SKIP_NONE; ++ return SQLITE_OK; ++} ++ ++/* ++** Advance the cursor to the next entry in the database. If ++** successful then set *pRes=0. If the cursor ++** was already pointing to the last entry in the database before ++** this routine was called, then set *pRes=1. ++*/ ++static int memRbtreeNext(RbtCursor* pCur, int *pRes) ++{ ++ if( pCur->pNode && pCur->eSkip != SKIP_NEXT ){ ++ if( pCur->pNode->pRight ){ ++ pCur->pNode = pCur->pNode->pRight; ++ while( pCur->pNode->pLeft ) ++ pCur->pNode = pCur->pNode->pLeft; ++ }else{ ++ BtRbNode * pX = pCur->pNode; ++ pCur->pNode = pX->pParent; ++ while( pCur->pNode && (pCur->pNode->pRight == pX) ){ ++ pX = pCur->pNode; ++ pCur->pNode = pX->pParent; ++ } ++ } ++ } ++ pCur->eSkip = SKIP_NONE; ++ ++ if( !pCur->pNode ){ ++ *pRes = 1; ++ }else{ ++ *pRes = 0; ++ } ++ ++ return SQLITE_OK; ++} ++ ++static int memRbtreePrevious(RbtCursor* pCur, int *pRes) ++{ ++ if( pCur->pNode && pCur->eSkip != SKIP_PREV ){ ++ if( pCur->pNode->pLeft ){ ++ pCur->pNode = pCur->pNode->pLeft; ++ while( pCur->pNode->pRight ) ++ pCur->pNode = pCur->pNode->pRight; ++ }else{ ++ BtRbNode * pX = pCur->pNode; ++ pCur->pNode = pX->pParent; ++ while( pCur->pNode && (pCur->pNode->pLeft == pX) ){ ++ pX = pCur->pNode; ++ pCur->pNode = pX->pParent; ++ } ++ } ++ } ++ pCur->eSkip = SKIP_NONE; ++ ++ if( !pCur->pNode ){ ++ *pRes = 1; ++ }else{ ++ *pRes = 0; ++ } ++ ++ return SQLITE_OK; ++} ++ ++static int memRbtreeKeySize(RbtCursor* pCur, int *pSize) ++{ ++ if( pCur->pNode ){ ++ *pSize = pCur->pNode->nKey; ++ }else{ ++ *pSize = 0; ++ } ++ return SQLITE_OK; ++} ++ ++static int memRbtreeKey(RbtCursor* pCur, int offset, int amt, char *zBuf) ++{ ++ if( !pCur->pNode ) return 0; ++ if( !pCur->pNode->pKey || ((amt + offset) <= pCur->pNode->nKey) ){ ++ memcpy(zBuf, ((char*)pCur->pNode->pKey)+offset, amt); ++ }else{ ++ memcpy(zBuf, ((char*)pCur->pNode->pKey)+offset, pCur->pNode->nKey-offset); ++ amt = pCur->pNode->nKey-offset; ++ } ++ return amt; ++} ++ ++static int memRbtreeDataSize(RbtCursor* pCur, int *pSize) ++{ ++ if( pCur->pNode ){ ++ *pSize = pCur->pNode->nData; ++ }else{ ++ *pSize = 0; ++ } ++ return SQLITE_OK; ++} ++ ++static int memRbtreeData(RbtCursor *pCur, int offset, int amt, char *zBuf) ++{ ++ if( !pCur->pNode ) return 0; ++ if( (amt + offset) <= pCur->pNode->nData ){ ++ memcpy(zBuf, ((char*)pCur->pNode->pData)+offset, amt); ++ }else{ ++ memcpy(zBuf, ((char*)pCur->pNode->pData)+offset ,pCur->pNode->nData-offset); ++ amt = pCur->pNode->nData-offset; ++ } ++ return amt; ++} ++ ++static int memRbtreeCloseCursor(RbtCursor* pCur) ++{ ++ if( pCur->pTree->pCursors==pCur ){ ++ pCur->pTree->pCursors = pCur->pShared; ++ }else{ ++ RbtCursor *p = pCur->pTree->pCursors; ++ while( p && p->pShared!=pCur ){ p = p->pShared; } ++ assert( p!=0 ); ++ if( p ){ ++ p->pShared = pCur->pShared; ++ } ++ } ++ sqliteFree(pCur); ++ return SQLITE_OK; ++} ++ ++static int memRbtreeGetMeta(Rbtree* tree, int* aMeta) ++{ ++ memcpy( aMeta, tree->aMetaData, sizeof(int) * SQLITE_N_BTREE_META ); ++ return SQLITE_OK; ++} ++ ++static int memRbtreeUpdateMeta(Rbtree* tree, int* aMeta) ++{ ++ memcpy( tree->aMetaData, aMeta, sizeof(int) * SQLITE_N_BTREE_META ); ++ return SQLITE_OK; ++} ++ ++/* ++ * Check that each table in the Rbtree meets the requirements for a red-black ++ * binary tree. If an error is found, return an explanation of the problem in ++ * memory obtained from sqliteMalloc(). Parameters aRoot and nRoot are ignored. ++ */ ++static char *memRbtreeIntegrityCheck(Rbtree* tree, int* aRoot, int nRoot) ++{ ++ char * msg = 0; ++ HashElem *p; ++ ++ for(p=sqliteHashFirst(&tree->tblHash); p; p=sqliteHashNext(p)){ ++ BtRbTree *pTree = sqliteHashData(p); ++ check_redblack_tree(pTree, &msg); ++ } ++ ++ return msg; ++} ++ ++static int memRbtreeSetCacheSize(Rbtree* tree, int sz) ++{ ++ return SQLITE_OK; ++} ++ ++static int memRbtreeSetSafetyLevel(Rbtree *pBt, int level){ ++ return SQLITE_OK; ++} ++ ++static int memRbtreeBeginTrans(Rbtree* tree) ++{ ++ if( tree->eTransState != TRANS_NONE ) ++ return SQLITE_ERROR; ++ ++ assert( tree->pTransRollback == 0 ); ++ tree->eTransState = TRANS_INTRANSACTION; ++ return SQLITE_OK; ++} ++ ++/* ++** Delete a linked list of BtRollbackOp structures. ++*/ ++static void deleteRollbackList(BtRollbackOp *pOp){ ++ while( pOp ){ ++ BtRollbackOp *pTmp = pOp->pNext; ++ sqliteFree(pOp->pData); ++ sqliteFree(pOp->pKey); ++ sqliteFree(pOp); ++ pOp = pTmp; ++ } ++} ++ ++static int memRbtreeCommit(Rbtree* tree){ ++ /* Just delete pTransRollback and pCheckRollback */ ++ deleteRollbackList(tree->pCheckRollback); ++ deleteRollbackList(tree->pTransRollback); ++ tree->pTransRollback = 0; ++ tree->pCheckRollback = 0; ++ tree->pCheckRollbackTail = 0; ++ tree->eTransState = TRANS_NONE; ++ return SQLITE_OK; ++} ++ ++/* ++ * Close the supplied Rbtree. Delete everything associated with it. ++ */ ++static int memRbtreeClose(Rbtree* tree) ++{ ++ HashElem *p; ++ memRbtreeCommit(tree); ++ while( (p=sqliteHashFirst(&tree->tblHash))!=0 ){ ++ tree->eTransState = TRANS_ROLLBACK; ++ memRbtreeDropTable(tree, sqliteHashKeysize(p)); ++ } ++ sqliteHashClear(&tree->tblHash); ++ sqliteFree(tree); ++ return SQLITE_OK; ++} ++ ++/* ++ * Execute and delete the supplied rollback-list on pRbtree. ++ */ ++static void execute_rollback_list(Rbtree *pRbtree, BtRollbackOp *pList) ++{ ++ BtRollbackOp *pTmp; ++ RbtCursor cur; ++ int res; ++ ++ cur.pRbtree = pRbtree; ++ cur.wrFlag = 1; ++ while( pList ){ ++ switch( pList->eOp ){ ++ case ROLLBACK_INSERT: ++ cur.pTree = sqliteHashFind( &pRbtree->tblHash, 0, pList->iTab ); ++ assert(cur.pTree); ++ cur.iTree = pList->iTab; ++ cur.eSkip = SKIP_NONE; ++ memRbtreeInsert( &cur, pList->pKey, ++ pList->nKey, pList->pData, pList->nData ); ++ break; ++ case ROLLBACK_DELETE: ++ cur.pTree = sqliteHashFind( &pRbtree->tblHash, 0, pList->iTab ); ++ assert(cur.pTree); ++ cur.iTree = pList->iTab; ++ cur.eSkip = SKIP_NONE; ++ memRbtreeMoveto(&cur, pList->pKey, pList->nKey, &res); ++ assert(res == 0); ++ memRbtreeDelete( &cur ); ++ break; ++ case ROLLBACK_CREATE: ++ btreeCreateTable(pRbtree, pList->iTab); ++ break; ++ case ROLLBACK_DROP: ++ memRbtreeDropTable(pRbtree, pList->iTab); ++ break; ++ default: ++ assert(0); ++ } ++ sqliteFree(pList->pKey); ++ sqliteFree(pList->pData); ++ pTmp = pList->pNext; ++ sqliteFree(pList); ++ pList = pTmp; ++ } ++} ++ ++static int memRbtreeRollback(Rbtree* tree) ++{ ++ tree->eTransState = TRANS_ROLLBACK; ++ execute_rollback_list(tree, tree->pCheckRollback); ++ execute_rollback_list(tree, tree->pTransRollback); ++ tree->pTransRollback = 0; ++ tree->pCheckRollback = 0; ++ tree->pCheckRollbackTail = 0; ++ tree->eTransState = TRANS_NONE; ++ return SQLITE_OK; ++} ++ ++static int memRbtreeBeginCkpt(Rbtree* tree) ++{ ++ if( tree->eTransState != TRANS_INTRANSACTION ) ++ return SQLITE_ERROR; ++ ++ assert( tree->pCheckRollback == 0 ); ++ assert( tree->pCheckRollbackTail == 0 ); ++ tree->eTransState = TRANS_INCHECKPOINT; ++ return SQLITE_OK; ++} ++ ++static int memRbtreeCommitCkpt(Rbtree* tree) ++{ ++ if( tree->eTransState == TRANS_INCHECKPOINT ){ ++ if( tree->pCheckRollback ){ ++ tree->pCheckRollbackTail->pNext = tree->pTransRollback; ++ tree->pTransRollback = tree->pCheckRollback; ++ tree->pCheckRollback = 0; ++ tree->pCheckRollbackTail = 0; ++ } ++ tree->eTransState = TRANS_INTRANSACTION; ++ } ++ return SQLITE_OK; ++} ++ ++static int memRbtreeRollbackCkpt(Rbtree* tree) ++{ ++ if( tree->eTransState != TRANS_INCHECKPOINT ) return SQLITE_OK; ++ tree->eTransState = TRANS_ROLLBACK; ++ execute_rollback_list(tree, tree->pCheckRollback); ++ tree->pCheckRollback = 0; ++ tree->pCheckRollbackTail = 0; ++ tree->eTransState = TRANS_INTRANSACTION; ++ return SQLITE_OK; ++} ++ ++#ifdef SQLITE_TEST ++static int memRbtreePageDump(Rbtree* tree, int pgno, int rec) ++{ ++ assert(!"Cannot call sqliteRbtreePageDump"); ++ return SQLITE_OK; ++} ++ ++static int memRbtreeCursorDump(RbtCursor* pCur, int* aRes) ++{ ++ assert(!"Cannot call sqliteRbtreeCursorDump"); ++ return SQLITE_OK; ++} ++#endif ++ ++static struct Pager *memRbtreePager(Rbtree* tree) ++{ ++ return 0; ++} ++ ++/* ++** Return the full pathname of the underlying database file. ++*/ ++static const char *memRbtreeGetFilename(Rbtree *pBt){ ++ return 0; /* A NULL return indicates there is no underlying file */ ++} ++ ++/* ++** The copy file function is not implemented for the in-memory database ++*/ ++static int memRbtreeCopyFile(Rbtree *pBt, Rbtree *pBt2){ ++ return SQLITE_INTERNAL; /* Not implemented */ ++} ++ ++static BtOps sqliteRbtreeOps = { ++ (int(*)(Btree*)) memRbtreeClose, ++ (int(*)(Btree*,int)) memRbtreeSetCacheSize, ++ (int(*)(Btree*,int)) memRbtreeSetSafetyLevel, ++ (int(*)(Btree*)) memRbtreeBeginTrans, ++ (int(*)(Btree*)) memRbtreeCommit, ++ (int(*)(Btree*)) memRbtreeRollback, ++ (int(*)(Btree*)) memRbtreeBeginCkpt, ++ (int(*)(Btree*)) memRbtreeCommitCkpt, ++ (int(*)(Btree*)) memRbtreeRollbackCkpt, ++ (int(*)(Btree*,int*)) memRbtreeCreateTable, ++ (int(*)(Btree*,int*)) memRbtreeCreateTable, ++ (int(*)(Btree*,int)) memRbtreeDropTable, ++ (int(*)(Btree*,int)) memRbtreeClearTable, ++ (int(*)(Btree*,int,int,BtCursor**)) memRbtreeCursor, ++ (int(*)(Btree*,int*)) memRbtreeGetMeta, ++ (int(*)(Btree*,int*)) memRbtreeUpdateMeta, ++ (char*(*)(Btree*,int*,int)) memRbtreeIntegrityCheck, ++ (const char*(*)(Btree*)) memRbtreeGetFilename, ++ (int(*)(Btree*,Btree*)) memRbtreeCopyFile, ++ (struct Pager*(*)(Btree*)) memRbtreePager, ++#ifdef SQLITE_TEST ++ (int(*)(Btree*,int,int)) memRbtreePageDump, ++#endif ++}; ++ ++static BtCursorOps sqliteRbtreeCursorOps = { ++ (int(*)(BtCursor*,const void*,int,int*)) memRbtreeMoveto, ++ (int(*)(BtCursor*)) memRbtreeDelete, ++ (int(*)(BtCursor*,const void*,int,const void*,int)) memRbtreeInsert, ++ (int(*)(BtCursor*,int*)) memRbtreeFirst, ++ (int(*)(BtCursor*,int*)) memRbtreeLast, ++ (int(*)(BtCursor*,int*)) memRbtreeNext, ++ (int(*)(BtCursor*,int*)) memRbtreePrevious, ++ (int(*)(BtCursor*,int*)) memRbtreeKeySize, ++ (int(*)(BtCursor*,int,int,char*)) memRbtreeKey, ++ (int(*)(BtCursor*,const void*,int,int,int*)) memRbtreeKeyCompare, ++ (int(*)(BtCursor*,int*)) memRbtreeDataSize, ++ (int(*)(BtCursor*,int,int,char*)) memRbtreeData, ++ (int(*)(BtCursor*)) memRbtreeCloseCursor, ++#ifdef SQLITE_TEST ++ (int(*)(BtCursor*,int*)) memRbtreeCursorDump, ++#endif ++ ++}; ++ ++#endif /* SQLITE_OMIT_INMEMORYDB */ +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/build.c +@@ -0,0 +1,2156 @@ ++/* ++** 2001 September 15 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This file contains C code routines that are called by the SQLite parser ++** when syntax rules are reduced. The routines in this file handle the ++** following kinds of SQL syntax: ++** ++** CREATE TABLE ++** DROP TABLE ++** CREATE INDEX ++** DROP INDEX ++** creating ID lists ++** BEGIN TRANSACTION ++** COMMIT ++** ROLLBACK ++** PRAGMA ++** ++** $Id$ ++*/ ++#include "sqliteInt.h" ++#include ++ ++/* ++** This routine is called when a new SQL statement is beginning to ++** be parsed. Check to see if the schema for the database needs ++** to be read from the SQLITE_MASTER and SQLITE_TEMP_MASTER tables. ++** If it does, then read it. ++*/ ++void sqliteBeginParse(Parse *pParse, int explainFlag){ ++ sqlite *db = pParse->db; ++ int i; ++ pParse->explain = explainFlag; ++ if((db->flags & SQLITE_Initialized)==0 && db->init.busy==0 ){ ++ int rc = sqliteInit(db, &pParse->zErrMsg); ++ if( rc!=SQLITE_OK ){ ++ pParse->rc = rc; ++ pParse->nErr++; ++ } ++ } ++ for(i=0; inDb; i++){ ++ DbClearProperty(db, i, DB_Locked); ++ if( !db->aDb[i].inTrans ){ ++ DbClearProperty(db, i, DB_Cookie); ++ } ++ } ++ pParse->nVar = 0; ++} ++ ++/* ++** This routine is called after a single SQL statement has been ++** parsed and we want to execute the VDBE code to implement ++** that statement. Prior action routines should have already ++** constructed VDBE code to do the work of the SQL statement. ++** This routine just has to execute the VDBE code. ++** ++** Note that if an error occurred, it might be the case that ++** no VDBE code was generated. ++*/ ++void sqliteExec(Parse *pParse){ ++ sqlite *db = pParse->db; ++ Vdbe *v = pParse->pVdbe; ++ ++ if( v==0 && (v = sqliteGetVdbe(pParse))!=0 ){ ++ sqliteVdbeAddOp(v, OP_Halt, 0, 0); ++ } ++ if( sqlite_malloc_failed ) return; ++ if( v && pParse->nErr==0 ){ ++ FILE *trace = (db->flags & SQLITE_VdbeTrace)!=0 ? stdout : 0; ++ sqliteVdbeTrace(v, trace); ++ sqliteVdbeMakeReady(v, pParse->nVar, pParse->explain); ++ pParse->rc = pParse->nErr ? SQLITE_ERROR : SQLITE_DONE; ++ pParse->colNamesSet = 0; ++ }else if( pParse->rc==SQLITE_OK ){ ++ pParse->rc = SQLITE_ERROR; ++ } ++ pParse->nTab = 0; ++ pParse->nMem = 0; ++ pParse->nSet = 0; ++ pParse->nAgg = 0; ++ pParse->nVar = 0; ++} ++ ++/* ++** Locate the in-memory structure that describes ++** a particular database table given the name ++** of that table and (optionally) the name of the database ++** containing the table. Return NULL if not found. ++** ++** If zDatabase is 0, all databases are searched for the ++** table and the first matching table is returned. (No checking ++** for duplicate table names is done.) The search order is ++** TEMP first, then MAIN, then any auxiliary databases added ++** using the ATTACH command. ++** ++** See also sqliteLocateTable(). ++*/ ++Table *sqliteFindTable(sqlite *db, const char *zName, const char *zDatabase){ ++ Table *p = 0; ++ int i; ++ for(i=0; inDb; i++){ ++ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ ++ if( zDatabase!=0 && sqliteStrICmp(zDatabase, db->aDb[j].zName) ) continue; ++ p = sqliteHashFind(&db->aDb[j].tblHash, zName, strlen(zName)+1); ++ if( p ) break; ++ } ++ return p; ++} ++ ++/* ++** Locate the in-memory structure that describes ++** a particular database table given the name ++** of that table and (optionally) the name of the database ++** containing the table. Return NULL if not found. ++** Also leave an error message in pParse->zErrMsg. ++** ++** The difference between this routine and sqliteFindTable() ++** is that this routine leaves an error message in pParse->zErrMsg ++** where sqliteFindTable() does not. ++*/ ++Table *sqliteLocateTable(Parse *pParse, const char *zName, const char *zDbase){ ++ Table *p; ++ ++ p = sqliteFindTable(pParse->db, zName, zDbase); ++ if( p==0 ){ ++ if( zDbase ){ ++ sqliteErrorMsg(pParse, "no such table: %s.%s", zDbase, zName); ++ }else if( sqliteFindTable(pParse->db, zName, 0)!=0 ){ ++ sqliteErrorMsg(pParse, "table \"%s\" is not in database \"%s\"", ++ zName, zDbase); ++ }else{ ++ sqliteErrorMsg(pParse, "no such table: %s", zName); ++ } ++ } ++ return p; ++} ++ ++/* ++** Locate the in-memory structure that describes ++** a particular index given the name of that index ++** and the name of the database that contains the index. ++** Return NULL if not found. ++** ++** If zDatabase is 0, all databases are searched for the ++** table and the first matching index is returned. (No checking ++** for duplicate index names is done.) The search order is ++** TEMP first, then MAIN, then any auxiliary databases added ++** using the ATTACH command. ++*/ ++Index *sqliteFindIndex(sqlite *db, const char *zName, const char *zDb){ ++ Index *p = 0; ++ int i; ++ for(i=0; inDb; i++){ ++ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ ++ if( zDb && sqliteStrICmp(zDb, db->aDb[j].zName) ) continue; ++ p = sqliteHashFind(&db->aDb[j].idxHash, zName, strlen(zName)+1); ++ if( p ) break; ++ } ++ return p; ++} ++ ++/* ++** Remove the given index from the index hash table, and free ++** its memory structures. ++** ++** The index is removed from the database hash tables but ++** it is not unlinked from the Table that it indexes. ++** Unlinking from the Table must be done by the calling function. ++*/ ++static void sqliteDeleteIndex(sqlite *db, Index *p){ ++ Index *pOld; ++ ++ assert( db!=0 && p->zName!=0 ); ++ pOld = sqliteHashInsert(&db->aDb[p->iDb].idxHash, p->zName, ++ strlen(p->zName)+1, 0); ++ if( pOld!=0 && pOld!=p ){ ++ sqliteHashInsert(&db->aDb[p->iDb].idxHash, pOld->zName, ++ strlen(pOld->zName)+1, pOld); ++ } ++ sqliteFree(p); ++} ++ ++/* ++** Unlink the given index from its table, then remove ++** the index from the index hash table and free its memory ++** structures. ++*/ ++void sqliteUnlinkAndDeleteIndex(sqlite *db, Index *pIndex){ ++ if( pIndex->pTable->pIndex==pIndex ){ ++ pIndex->pTable->pIndex = pIndex->pNext; ++ }else{ ++ Index *p; ++ for(p=pIndex->pTable->pIndex; p && p->pNext!=pIndex; p=p->pNext){} ++ if( p && p->pNext==pIndex ){ ++ p->pNext = pIndex->pNext; ++ } ++ } ++ sqliteDeleteIndex(db, pIndex); ++} ++ ++/* ++** Erase all schema information from the in-memory hash tables of ++** database connection. This routine is called to reclaim memory ++** before the connection closes. It is also called during a rollback ++** if there were schema changes during the transaction. ++** ++** If iDb<=0 then reset the internal schema tables for all database ++** files. If iDb>=2 then reset the internal schema for only the ++** single file indicated. ++*/ ++void sqliteResetInternalSchema(sqlite *db, int iDb){ ++ HashElem *pElem; ++ Hash temp1; ++ Hash temp2; ++ int i, j; ++ ++ assert( iDb>=0 && iDbnDb ); ++ db->flags &= ~SQLITE_Initialized; ++ for(i=iDb; inDb; i++){ ++ Db *pDb = &db->aDb[i]; ++ temp1 = pDb->tblHash; ++ temp2 = pDb->trigHash; ++ sqliteHashInit(&pDb->trigHash, SQLITE_HASH_STRING, 0); ++ sqliteHashClear(&pDb->aFKey); ++ sqliteHashClear(&pDb->idxHash); ++ for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){ ++ Trigger *pTrigger = sqliteHashData(pElem); ++ sqliteDeleteTrigger(pTrigger); ++ } ++ sqliteHashClear(&temp2); ++ sqliteHashInit(&pDb->tblHash, SQLITE_HASH_STRING, 0); ++ for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){ ++ Table *pTab = sqliteHashData(pElem); ++ sqliteDeleteTable(db, pTab); ++ } ++ sqliteHashClear(&temp1); ++ DbClearProperty(db, i, DB_SchemaLoaded); ++ if( iDb>0 ) return; ++ } ++ assert( iDb==0 ); ++ db->flags &= ~SQLITE_InternChanges; ++ ++ /* If one or more of the auxiliary database files has been closed, ++ ** then remove then from the auxiliary database list. We take the ++ ** opportunity to do this here since we have just deleted all of the ++ ** schema hash tables and therefore do not have to make any changes ++ ** to any of those tables. ++ */ ++ for(i=0; inDb; i++){ ++ struct Db *pDb = &db->aDb[i]; ++ if( pDb->pBt==0 ){ ++ if( pDb->pAux && pDb->xFreeAux ) pDb->xFreeAux(pDb->pAux); ++ pDb->pAux = 0; ++ } ++ } ++ for(i=j=2; inDb; i++){ ++ struct Db *pDb = &db->aDb[i]; ++ if( pDb->pBt==0 ){ ++ sqliteFree(pDb->zName); ++ pDb->zName = 0; ++ continue; ++ } ++ if( jaDb[j] = db->aDb[i]; ++ } ++ j++; ++ } ++ memset(&db->aDb[j], 0, (db->nDb-j)*sizeof(db->aDb[j])); ++ db->nDb = j; ++ if( db->nDb<=2 && db->aDb!=db->aDbStatic ){ ++ memcpy(db->aDbStatic, db->aDb, 2*sizeof(db->aDb[0])); ++ sqliteFree(db->aDb); ++ db->aDb = db->aDbStatic; ++ } ++} ++ ++/* ++** This routine is called whenever a rollback occurs. If there were ++** schema changes during the transaction, then we have to reset the ++** internal hash tables and reload them from disk. ++*/ ++void sqliteRollbackInternalChanges(sqlite *db){ ++ if( db->flags & SQLITE_InternChanges ){ ++ sqliteResetInternalSchema(db, 0); ++ } ++} ++ ++/* ++** This routine is called when a commit occurs. ++*/ ++void sqliteCommitInternalChanges(sqlite *db){ ++ db->aDb[0].schema_cookie = db->next_cookie; ++ db->flags &= ~SQLITE_InternChanges; ++} ++ ++/* ++** Remove the memory data structures associated with the given ++** Table. No changes are made to disk by this routine. ++** ++** This routine just deletes the data structure. It does not unlink ++** the table data structure from the hash table. Nor does it remove ++** foreign keys from the sqlite.aFKey hash table. But it does destroy ++** memory structures of the indices and foreign keys associated with ++** the table. ++** ++** Indices associated with the table are unlinked from the "db" ++** data structure if db!=NULL. If db==NULL, indices attached to ++** the table are deleted, but it is assumed they have already been ++** unlinked. ++*/ ++void sqliteDeleteTable(sqlite *db, Table *pTable){ ++ int i; ++ Index *pIndex, *pNext; ++ FKey *pFKey, *pNextFKey; ++ ++ if( pTable==0 ) return; ++ ++ /* Delete all indices associated with this table ++ */ ++ for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){ ++ pNext = pIndex->pNext; ++ assert( pIndex->iDb==pTable->iDb || (pTable->iDb==0 && pIndex->iDb==1) ); ++ sqliteDeleteIndex(db, pIndex); ++ } ++ ++ /* Delete all foreign keys associated with this table. The keys ++ ** should have already been unlinked from the db->aFKey hash table ++ */ ++ for(pFKey=pTable->pFKey; pFKey; pFKey=pNextFKey){ ++ pNextFKey = pFKey->pNextFrom; ++ assert( pTable->iDbnDb ); ++ assert( sqliteHashFind(&db->aDb[pTable->iDb].aFKey, ++ pFKey->zTo, strlen(pFKey->zTo)+1)!=pFKey ); ++ sqliteFree(pFKey); ++ } ++ ++ /* Delete the Table structure itself. ++ */ ++ for(i=0; inCol; i++){ ++ sqliteFree(pTable->aCol[i].zName); ++ sqliteFree(pTable->aCol[i].zDflt); ++ sqliteFree(pTable->aCol[i].zType); ++ } ++ sqliteFree(pTable->zName); ++ sqliteFree(pTable->aCol); ++ sqliteSelectDelete(pTable->pSelect); ++ sqliteFree(pTable); ++} ++ ++/* ++** Unlink the given table from the hash tables and the delete the ++** table structure with all its indices and foreign keys. ++*/ ++static void sqliteUnlinkAndDeleteTable(sqlite *db, Table *p){ ++ Table *pOld; ++ FKey *pF1, *pF2; ++ int i = p->iDb; ++ assert( db!=0 ); ++ pOld = sqliteHashInsert(&db->aDb[i].tblHash, p->zName, strlen(p->zName)+1, 0); ++ assert( pOld==0 || pOld==p ); ++ for(pF1=p->pFKey; pF1; pF1=pF1->pNextFrom){ ++ int nTo = strlen(pF1->zTo) + 1; ++ pF2 = sqliteHashFind(&db->aDb[i].aFKey, pF1->zTo, nTo); ++ if( pF2==pF1 ){ ++ sqliteHashInsert(&db->aDb[i].aFKey, pF1->zTo, nTo, pF1->pNextTo); ++ }else{ ++ while( pF2 && pF2->pNextTo!=pF1 ){ pF2=pF2->pNextTo; } ++ if( pF2 ){ ++ pF2->pNextTo = pF1->pNextTo; ++ } ++ } ++ } ++ sqliteDeleteTable(db, p); ++} ++ ++/* ++** Construct the name of a user table or index from a token. ++** ++** Space to hold the name is obtained from sqliteMalloc() and must ++** be freed by the calling function. ++*/ ++char *sqliteTableNameFromToken(Token *pName){ ++ char *zName = sqliteStrNDup(pName->z, pName->n); ++ sqliteDequote(zName); ++ return zName; ++} ++ ++/* ++** Generate code to open the appropriate master table. The table ++** opened will be SQLITE_MASTER for persistent tables and ++** SQLITE_TEMP_MASTER for temporary tables. The table is opened ++** on cursor 0. ++*/ ++void sqliteOpenMasterTable(Vdbe *v, int isTemp){ ++ sqliteVdbeAddOp(v, OP_Integer, isTemp, 0); ++ sqliteVdbeAddOp(v, OP_OpenWrite, 0, 2); ++} ++ ++/* ++** Begin constructing a new table representation in memory. This is ++** the first of several action routines that get called in response ++** to a CREATE TABLE statement. In particular, this routine is called ++** after seeing tokens "CREATE" and "TABLE" and the table name. The ++** pStart token is the CREATE and pName is the table name. The isTemp ++** flag is true if the table should be stored in the auxiliary database ++** file instead of in the main database file. This is normally the case ++** when the "TEMP" or "TEMPORARY" keyword occurs in between ++** CREATE and TABLE. ++** ++** The new table record is initialized and put in pParse->pNewTable. ++** As more of the CREATE TABLE statement is parsed, additional action ++** routines will be called to add more information to this record. ++** At the end of the CREATE TABLE statement, the sqliteEndTable() routine ++** is called to complete the construction of the new table record. ++*/ ++void sqliteStartTable( ++ Parse *pParse, /* Parser context */ ++ Token *pStart, /* The "CREATE" token */ ++ Token *pName, /* Name of table or view to create */ ++ int isTemp, /* True if this is a TEMP table */ ++ int isView /* True if this is a VIEW */ ++){ ++ Table *pTable; ++ Index *pIdx; ++ char *zName; ++ sqlite *db = pParse->db; ++ Vdbe *v; ++ int iDb; ++ ++ pParse->sFirstToken = *pStart; ++ zName = sqliteTableNameFromToken(pName); ++ if( zName==0 ) return; ++ if( db->init.iDb==1 ) isTemp = 1; ++#ifndef SQLITE_OMIT_AUTHORIZATION ++ assert( (isTemp & 1)==isTemp ); ++ { ++ int code; ++ char *zDb = isTemp ? "temp" : "main"; ++ if( sqliteAuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ ++ sqliteFree(zName); ++ return; ++ } ++ if( isView ){ ++ if( isTemp ){ ++ code = SQLITE_CREATE_TEMP_VIEW; ++ }else{ ++ code = SQLITE_CREATE_VIEW; ++ } ++ }else{ ++ if( isTemp ){ ++ code = SQLITE_CREATE_TEMP_TABLE; ++ }else{ ++ code = SQLITE_CREATE_TABLE; ++ } ++ } ++ if( sqliteAuthCheck(pParse, code, zName, 0, zDb) ){ ++ sqliteFree(zName); ++ return; ++ } ++ } ++#endif ++ ++ ++ /* Before trying to create a temporary table, make sure the Btree for ++ ** holding temporary tables is open. ++ */ ++ if( isTemp && db->aDb[1].pBt==0 && !pParse->explain ){ ++ int rc = sqliteBtreeFactory(db, 0, 0, MAX_PAGES, &db->aDb[1].pBt); ++ if( rc!=SQLITE_OK ){ ++ sqliteErrorMsg(pParse, "unable to open a temporary database " ++ "file for storing temporary tables"); ++ pParse->nErr++; ++ return; ++ } ++ if( db->flags & SQLITE_InTrans ){ ++ rc = sqliteBtreeBeginTrans(db->aDb[1].pBt); ++ if( rc!=SQLITE_OK ){ ++ sqliteErrorMsg(pParse, "unable to get a write lock on " ++ "the temporary database file"); ++ return; ++ } ++ } ++ } ++ ++ /* Make sure the new table name does not collide with an existing ++ ** index or table name. Issue an error message if it does. ++ ** ++ ** If we are re-reading the sqlite_master table because of a schema ++ ** change and a new permanent table is found whose name collides with ++ ** an existing temporary table, that is not an error. ++ */ ++ pTable = sqliteFindTable(db, zName, 0); ++ iDb = isTemp ? 1 : db->init.iDb; ++ if( pTable!=0 && (pTable->iDb==iDb || !db->init.busy) ){ ++ sqliteErrorMsg(pParse, "table %T already exists", pName); ++ sqliteFree(zName); ++ return; ++ } ++ if( (pIdx = sqliteFindIndex(db, zName, 0))!=0 && ++ (pIdx->iDb==0 || !db->init.busy) ){ ++ sqliteErrorMsg(pParse, "there is already an index named %s", zName); ++ sqliteFree(zName); ++ return; ++ } ++ pTable = sqliteMalloc( sizeof(Table) ); ++ if( pTable==0 ){ ++ sqliteFree(zName); ++ return; ++ } ++ pTable->zName = zName; ++ pTable->nCol = 0; ++ pTable->aCol = 0; ++ pTable->iPKey = -1; ++ pTable->pIndex = 0; ++ pTable->iDb = iDb; ++ if( pParse->pNewTable ) sqliteDeleteTable(db, pParse->pNewTable); ++ pParse->pNewTable = pTable; ++ ++ /* Begin generating the code that will insert the table record into ++ ** the SQLITE_MASTER table. Note in particular that we must go ahead ++ ** and allocate the record number for the table entry now. Before any ++ ** PRIMARY KEY or UNIQUE keywords are parsed. Those keywords will cause ++ ** indices to be created and the table record must come before the ++ ** indices. Hence, the record number for the table must be allocated ++ ** now. ++ */ ++ if( !db->init.busy && (v = sqliteGetVdbe(pParse))!=0 ){ ++ sqliteBeginWriteOperation(pParse, 0, isTemp); ++ if( !isTemp ){ ++ sqliteVdbeAddOp(v, OP_Integer, db->file_format, 0); ++ sqliteVdbeAddOp(v, OP_SetCookie, 0, 1); ++ } ++ sqliteOpenMasterTable(v, isTemp); ++ sqliteVdbeAddOp(v, OP_NewRecno, 0, 0); ++ sqliteVdbeAddOp(v, OP_Dup, 0, 0); ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ sqliteVdbeAddOp(v, OP_PutIntKey, 0, 0); ++ } ++} ++ ++/* ++** Add a new column to the table currently being constructed. ++** ++** The parser calls this routine once for each column declaration ++** in a CREATE TABLE statement. sqliteStartTable() gets called ++** first to get things going. Then this routine is called for each ++** column. ++*/ ++void sqliteAddColumn(Parse *pParse, Token *pName){ ++ Table *p; ++ int i; ++ char *z = 0; ++ Column *pCol; ++ if( (p = pParse->pNewTable)==0 ) return; ++ sqliteSetNString(&z, pName->z, pName->n, 0); ++ if( z==0 ) return; ++ sqliteDequote(z); ++ for(i=0; inCol; i++){ ++ if( sqliteStrICmp(z, p->aCol[i].zName)==0 ){ ++ sqliteErrorMsg(pParse, "duplicate column name: %s", z); ++ sqliteFree(z); ++ return; ++ } ++ } ++ if( (p->nCol & 0x7)==0 ){ ++ Column *aNew; ++ aNew = sqliteRealloc( p->aCol, (p->nCol+8)*sizeof(p->aCol[0])); ++ if( aNew==0 ) return; ++ p->aCol = aNew; ++ } ++ pCol = &p->aCol[p->nCol]; ++ memset(pCol, 0, sizeof(p->aCol[0])); ++ pCol->zName = z; ++ pCol->sortOrder = SQLITE_SO_NUM; ++ p->nCol++; ++} ++ ++/* ++** This routine is called by the parser while in the middle of ++** parsing a CREATE TABLE statement. A "NOT NULL" constraint has ++** been seen on a column. This routine sets the notNull flag on ++** the column currently under construction. ++*/ ++void sqliteAddNotNull(Parse *pParse, int onError){ ++ Table *p; ++ int i; ++ if( (p = pParse->pNewTable)==0 ) return; ++ i = p->nCol-1; ++ if( i>=0 ) p->aCol[i].notNull = onError; ++} ++ ++/* ++** This routine is called by the parser while in the middle of ++** parsing a CREATE TABLE statement. The pFirst token is the first ++** token in the sequence of tokens that describe the type of the ++** column currently under construction. pLast is the last token ++** in the sequence. Use this information to construct a string ++** that contains the typename of the column and store that string ++** in zType. ++*/ ++void sqliteAddColumnType(Parse *pParse, Token *pFirst, Token *pLast){ ++ Table *p; ++ int i, j; ++ int n; ++ char *z, **pz; ++ Column *pCol; ++ if( (p = pParse->pNewTable)==0 ) return; ++ i = p->nCol-1; ++ if( i<0 ) return; ++ pCol = &p->aCol[i]; ++ pz = &pCol->zType; ++ n = pLast->n + Addr(pLast->z) - Addr(pFirst->z); ++ sqliteSetNString(pz, pFirst->z, n, 0); ++ z = *pz; ++ if( z==0 ) return; ++ for(i=j=0; z[i]; i++){ ++ int c = z[i]; ++ if( isspace(c) ) continue; ++ z[j++] = c; ++ } ++ z[j] = 0; ++ if( pParse->db->file_format>=4 ){ ++ pCol->sortOrder = sqliteCollateType(z, n); ++ }else{ ++ pCol->sortOrder = SQLITE_SO_NUM; ++ } ++} ++ ++/* ++** The given token is the default value for the last column added to ++** the table currently under construction. If "minusFlag" is true, it ++** means the value token was preceded by a minus sign. ++** ++** This routine is called by the parser while in the middle of ++** parsing a CREATE TABLE statement. ++*/ ++void sqliteAddDefaultValue(Parse *pParse, Token *pVal, int minusFlag){ ++ Table *p; ++ int i; ++ char **pz; ++ if( (p = pParse->pNewTable)==0 ) return; ++ i = p->nCol-1; ++ if( i<0 ) return; ++ pz = &p->aCol[i].zDflt; ++ if( minusFlag ){ ++ sqliteSetNString(pz, "-", 1, pVal->z, pVal->n, 0); ++ }else{ ++ sqliteSetNString(pz, pVal->z, pVal->n, 0); ++ } ++ sqliteDequote(*pz); ++} ++ ++/* ++** Designate the PRIMARY KEY for the table. pList is a list of names ++** of columns that form the primary key. If pList is NULL, then the ++** most recently added column of the table is the primary key. ++** ++** A table can have at most one primary key. If the table already has ++** a primary key (and this is the second primary key) then create an ++** error. ++** ++** If the PRIMARY KEY is on a single column whose datatype is INTEGER, ++** then we will try to use that column as the row id. (Exception: ++** For backwards compatibility with older databases, do not do this ++** if the file format version number is less than 1.) Set the Table.iPKey ++** field of the table under construction to be the index of the ++** INTEGER PRIMARY KEY column. Table.iPKey is set to -1 if there is ++** no INTEGER PRIMARY KEY. ++** ++** If the key is not an INTEGER PRIMARY KEY, then create a unique ++** index for the key. No index is created for INTEGER PRIMARY KEYs. ++*/ ++void sqliteAddPrimaryKey(Parse *pParse, IdList *pList, int onError){ ++ Table *pTab = pParse->pNewTable; ++ char *zType = 0; ++ int iCol = -1, i; ++ if( pTab==0 ) goto primary_key_exit; ++ if( pTab->hasPrimKey ){ ++ sqliteErrorMsg(pParse, ++ "table \"%s\" has more than one primary key", pTab->zName); ++ goto primary_key_exit; ++ } ++ pTab->hasPrimKey = 1; ++ if( pList==0 ){ ++ iCol = pTab->nCol - 1; ++ pTab->aCol[iCol].isPrimKey = 1; ++ }else{ ++ for(i=0; inId; i++){ ++ for(iCol=0; iColnCol; iCol++){ ++ if( sqliteStrICmp(pList->a[i].zName, pTab->aCol[iCol].zName)==0 ) break; ++ } ++ if( iColnCol ) pTab->aCol[iCol].isPrimKey = 1; ++ } ++ if( pList->nId>1 ) iCol = -1; ++ } ++ if( iCol>=0 && iColnCol ){ ++ zType = pTab->aCol[iCol].zType; ++ } ++ if( pParse->db->file_format>=1 && ++ zType && sqliteStrICmp(zType, "INTEGER")==0 ){ ++ pTab->iPKey = iCol; ++ pTab->keyConf = onError; ++ }else{ ++ sqliteCreateIndex(pParse, 0, 0, pList, onError, 0, 0); ++ pList = 0; ++ } ++ ++primary_key_exit: ++ sqliteIdListDelete(pList); ++ return; ++} ++ ++/* ++** Return the appropriate collating type given a type name. ++** ++** The collation type is text (SQLITE_SO_TEXT) if the type ++** name contains the character stream "text" or "blob" or ++** "clob". Any other type name is collated as numeric ++** (SQLITE_SO_NUM). ++*/ ++int sqliteCollateType(const char *zType, int nType){ ++ int i; ++ for(i=0; ipNewTable)==0 ) return; ++ i = p->nCol-1; ++ if( i>=0 ) p->aCol[i].sortOrder = collType; ++} ++ ++/* ++** Come up with a new random value for the schema cookie. Make sure ++** the new value is different from the old. ++** ++** The schema cookie is used to determine when the schema for the ++** database changes. After each schema change, the cookie value ++** changes. When a process first reads the schema it records the ++** cookie. Thereafter, whenever it goes to access the database, ++** it checks the cookie to make sure the schema has not changed ++** since it was last read. ++** ++** This plan is not completely bullet-proof. It is possible for ++** the schema to change multiple times and for the cookie to be ++** set back to prior value. But schema changes are infrequent ++** and the probability of hitting the same cookie value is only ++** 1 chance in 2^32. So we're safe enough. ++*/ ++void sqliteChangeCookie(sqlite *db, Vdbe *v){ ++ if( db->next_cookie==db->aDb[0].schema_cookie ){ ++ unsigned char r; ++ sqliteRandomness(1, &r); ++ db->next_cookie = db->aDb[0].schema_cookie + r + 1; ++ db->flags |= SQLITE_InternChanges; ++ sqliteVdbeAddOp(v, OP_Integer, db->next_cookie, 0); ++ sqliteVdbeAddOp(v, OP_SetCookie, 0, 0); ++ } ++} ++ ++/* ++** Measure the number of characters needed to output the given ++** identifier. The number returned includes any quotes used ++** but does not include the null terminator. ++*/ ++static int identLength(const char *z){ ++ int n; ++ int needQuote = 0; ++ for(n=0; *z; n++, z++){ ++ if( *z=='\'' ){ n++; needQuote=1; } ++ } ++ return n + needQuote*2; ++} ++ ++/* ++** Write an identifier onto the end of the given string. Add ++** quote characters as needed. ++*/ ++static void identPut(char *z, int *pIdx, char *zIdent){ ++ int i, j, needQuote; ++ i = *pIdx; ++ for(j=0; zIdent[j]; j++){ ++ if( !isalnum(zIdent[j]) && zIdent[j]!='_' ) break; ++ } ++ needQuote = zIdent[j]!=0 || isdigit(zIdent[0]) ++ || sqliteKeywordCode(zIdent, j)!=TK_ID; ++ if( needQuote ) z[i++] = '\''; ++ for(j=0; zIdent[j]; j++){ ++ z[i++] = zIdent[j]; ++ if( zIdent[j]=='\'' ) z[i++] = '\''; ++ } ++ if( needQuote ) z[i++] = '\''; ++ z[i] = 0; ++ *pIdx = i; ++} ++ ++/* ++** Generate a CREATE TABLE statement appropriate for the given ++** table. Memory to hold the text of the statement is obtained ++** from sqliteMalloc() and must be freed by the calling function. ++*/ ++static char *createTableStmt(Table *p){ ++ int i, k, n; ++ char *zStmt; ++ char *zSep, *zSep2, *zEnd; ++ n = 0; ++ for(i=0; inCol; i++){ ++ n += identLength(p->aCol[i].zName); ++ } ++ n += identLength(p->zName); ++ if( n<40 ){ ++ zSep = ""; ++ zSep2 = ","; ++ zEnd = ")"; ++ }else{ ++ zSep = "\n "; ++ zSep2 = ",\n "; ++ zEnd = "\n)"; ++ } ++ n += 35 + 6*p->nCol; ++ zStmt = sqliteMallocRaw( n ); ++ if( zStmt==0 ) return 0; ++ strcpy(zStmt, p->iDb==1 ? "CREATE TEMP TABLE " : "CREATE TABLE "); ++ k = strlen(zStmt); ++ identPut(zStmt, &k, p->zName); ++ zStmt[k++] = '('; ++ for(i=0; inCol; i++){ ++ strcpy(&zStmt[k], zSep); ++ k += strlen(&zStmt[k]); ++ zSep = zSep2; ++ identPut(zStmt, &k, p->aCol[i].zName); ++ } ++ strcpy(&zStmt[k], zEnd); ++ return zStmt; ++} ++ ++/* ++** This routine is called to report the final ")" that terminates ++** a CREATE TABLE statement. ++** ++** The table structure that other action routines have been building ++** is added to the internal hash tables, assuming no errors have ++** occurred. ++** ++** An entry for the table is made in the master table on disk, unless ++** this is a temporary table or db->init.busy==1. When db->init.busy==1 ++** it means we are reading the sqlite_master table because we just ++** connected to the database or because the sqlite_master table has ++** recently changes, so the entry for this table already exists in ++** the sqlite_master table. We do not want to create it again. ++** ++** If the pSelect argument is not NULL, it means that this routine ++** was called to create a table generated from a ++** "CREATE TABLE ... AS SELECT ..." statement. The column names of ++** the new table will match the result set of the SELECT. ++*/ ++void sqliteEndTable(Parse *pParse, Token *pEnd, Select *pSelect){ ++ Table *p; ++ sqlite *db = pParse->db; ++ ++ if( (pEnd==0 && pSelect==0) || pParse->nErr || sqlite_malloc_failed ) return; ++ p = pParse->pNewTable; ++ if( p==0 ) return; ++ ++ /* If the table is generated from a SELECT, then construct the ++ ** list of columns and the text of the table. ++ */ ++ if( pSelect ){ ++ Table *pSelTab = sqliteResultSetOfSelect(pParse, 0, pSelect); ++ if( pSelTab==0 ) return; ++ assert( p->aCol==0 ); ++ p->nCol = pSelTab->nCol; ++ p->aCol = pSelTab->aCol; ++ pSelTab->nCol = 0; ++ pSelTab->aCol = 0; ++ sqliteDeleteTable(0, pSelTab); ++ } ++ ++ /* If the db->init.busy is 1 it means we are reading the SQL off the ++ ** "sqlite_master" or "sqlite_temp_master" table on the disk. ++ ** So do not write to the disk again. Extract the root page number ++ ** for the table from the db->init.newTnum field. (The page number ++ ** should have been put there by the sqliteOpenCb routine.) ++ */ ++ if( db->init.busy ){ ++ p->tnum = db->init.newTnum; ++ } ++ ++ /* If not initializing, then create a record for the new table ++ ** in the SQLITE_MASTER table of the database. The record number ++ ** for the new table entry should already be on the stack. ++ ** ++ ** If this is a TEMPORARY table, write the entry into the auxiliary ++ ** file instead of into the main database file. ++ */ ++ if( !db->init.busy ){ ++ int n; ++ Vdbe *v; ++ ++ v = sqliteGetVdbe(pParse); ++ if( v==0 ) return; ++ if( p->pSelect==0 ){ ++ /* A regular table */ ++ sqliteVdbeOp3(v, OP_CreateTable, 0, p->iDb, (char*)&p->tnum, P3_POINTER); ++ }else{ ++ /* A view */ ++ sqliteVdbeAddOp(v, OP_Integer, 0, 0); ++ } ++ p->tnum = 0; ++ sqliteVdbeAddOp(v, OP_Pull, 1, 0); ++ sqliteVdbeOp3(v, OP_String, 0, 0, p->pSelect==0?"table":"view", P3_STATIC); ++ sqliteVdbeOp3(v, OP_String, 0, 0, p->zName, 0); ++ sqliteVdbeOp3(v, OP_String, 0, 0, p->zName, 0); ++ sqliteVdbeAddOp(v, OP_Dup, 4, 0); ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ if( pSelect ){ ++ char *z = createTableStmt(p); ++ n = z ? strlen(z) : 0; ++ sqliteVdbeChangeP3(v, -1, z, n); ++ sqliteFree(z); ++ }else{ ++ assert( pEnd!=0 ); ++ n = Addr(pEnd->z) - Addr(pParse->sFirstToken.z) + 1; ++ sqliteVdbeChangeP3(v, -1, pParse->sFirstToken.z, n); ++ } ++ sqliteVdbeAddOp(v, OP_MakeRecord, 5, 0); ++ sqliteVdbeAddOp(v, OP_PutIntKey, 0, 0); ++ if( !p->iDb ){ ++ sqliteChangeCookie(db, v); ++ } ++ sqliteVdbeAddOp(v, OP_Close, 0, 0); ++ if( pSelect ){ ++ sqliteVdbeAddOp(v, OP_Integer, p->iDb, 0); ++ sqliteVdbeAddOp(v, OP_OpenWrite, 1, 0); ++ pParse->nTab = 2; ++ sqliteSelect(pParse, pSelect, SRT_Table, 1, 0, 0, 0); ++ } ++ sqliteEndWriteOperation(pParse); ++ } ++ ++ /* Add the table to the in-memory representation of the database. ++ */ ++ if( pParse->explain==0 && pParse->nErr==0 ){ ++ Table *pOld; ++ FKey *pFKey; ++ pOld = sqliteHashInsert(&db->aDb[p->iDb].tblHash, ++ p->zName, strlen(p->zName)+1, p); ++ if( pOld ){ ++ assert( p==pOld ); /* Malloc must have failed inside HashInsert() */ ++ return; ++ } ++ for(pFKey=p->pFKey; pFKey; pFKey=pFKey->pNextFrom){ ++ int nTo = strlen(pFKey->zTo) + 1; ++ pFKey->pNextTo = sqliteHashFind(&db->aDb[p->iDb].aFKey, pFKey->zTo, nTo); ++ sqliteHashInsert(&db->aDb[p->iDb].aFKey, pFKey->zTo, nTo, pFKey); ++ } ++ pParse->pNewTable = 0; ++ db->nTable++; ++ db->flags |= SQLITE_InternChanges; ++ } ++} ++ ++/* ++** The parser calls this routine in order to create a new VIEW ++*/ ++void sqliteCreateView( ++ Parse *pParse, /* The parsing context */ ++ Token *pBegin, /* The CREATE token that begins the statement */ ++ Token *pName, /* The token that holds the name of the view */ ++ Select *pSelect, /* A SELECT statement that will become the new view */ ++ int isTemp /* TRUE for a TEMPORARY view */ ++){ ++ Table *p; ++ int n; ++ const char *z; ++ Token sEnd; ++ DbFixer sFix; ++ ++ sqliteStartTable(pParse, pBegin, pName, isTemp, 1); ++ p = pParse->pNewTable; ++ if( p==0 || pParse->nErr ){ ++ sqliteSelectDelete(pSelect); ++ return; ++ } ++ if( sqliteFixInit(&sFix, pParse, p->iDb, "view", pName) ++ && sqliteFixSelect(&sFix, pSelect) ++ ){ ++ sqliteSelectDelete(pSelect); ++ return; ++ } ++ ++ /* Make a copy of the entire SELECT statement that defines the view. ++ ** This will force all the Expr.token.z values to be dynamically ++ ** allocated rather than point to the input string - which means that ++ ** they will persist after the current sqlite_exec() call returns. ++ */ ++ p->pSelect = sqliteSelectDup(pSelect); ++ sqliteSelectDelete(pSelect); ++ if( !pParse->db->init.busy ){ ++ sqliteViewGetColumnNames(pParse, p); ++ } ++ ++ /* Locate the end of the CREATE VIEW statement. Make sEnd point to ++ ** the end. ++ */ ++ sEnd = pParse->sLastToken; ++ if( sEnd.z[0]!=0 && sEnd.z[0]!=';' ){ ++ sEnd.z += sEnd.n; ++ } ++ sEnd.n = 0; ++ n = sEnd.z - pBegin->z; ++ z = pBegin->z; ++ while( n>0 && (z[n-1]==';' || isspace(z[n-1])) ){ n--; } ++ sEnd.z = &z[n-1]; ++ sEnd.n = 1; ++ ++ /* Use sqliteEndTable() to add the view to the SQLITE_MASTER table */ ++ sqliteEndTable(pParse, &sEnd, 0); ++ return; ++} ++ ++/* ++** The Table structure pTable is really a VIEW. Fill in the names of ++** the columns of the view in the pTable structure. Return the number ++** of errors. If an error is seen leave an error message in pParse->zErrMsg. ++*/ ++int sqliteViewGetColumnNames(Parse *pParse, Table *pTable){ ++ ExprList *pEList; ++ Select *pSel; ++ Table *pSelTab; ++ int nErr = 0; ++ ++ assert( pTable ); ++ ++ /* A positive nCol means the columns names for this view are ++ ** already known. ++ */ ++ if( pTable->nCol>0 ) return 0; ++ ++ /* A negative nCol is a special marker meaning that we are currently ++ ** trying to compute the column names. If we enter this routine with ++ ** a negative nCol, it means two or more views form a loop, like this: ++ ** ++ ** CREATE VIEW one AS SELECT * FROM two; ++ ** CREATE VIEW two AS SELECT * FROM one; ++ ** ++ ** Actually, this error is caught previously and so the following test ++ ** should always fail. But we will leave it in place just to be safe. ++ */ ++ if( pTable->nCol<0 ){ ++ sqliteErrorMsg(pParse, "view %s is circularly defined", pTable->zName); ++ return 1; ++ } ++ ++ /* If we get this far, it means we need to compute the table names. ++ */ ++ assert( pTable->pSelect ); /* If nCol==0, then pTable must be a VIEW */ ++ pSel = pTable->pSelect; ++ ++ /* Note that the call to sqliteResultSetOfSelect() will expand any ++ ** "*" elements in this list. But we will need to restore the list ++ ** back to its original configuration afterwards, so we save a copy of ++ ** the original in pEList. ++ */ ++ pEList = pSel->pEList; ++ pSel->pEList = sqliteExprListDup(pEList); ++ if( pSel->pEList==0 ){ ++ pSel->pEList = pEList; ++ return 1; /* Malloc failed */ ++ } ++ pTable->nCol = -1; ++ pSelTab = sqliteResultSetOfSelect(pParse, 0, pSel); ++ if( pSelTab ){ ++ assert( pTable->aCol==0 ); ++ pTable->nCol = pSelTab->nCol; ++ pTable->aCol = pSelTab->aCol; ++ pSelTab->nCol = 0; ++ pSelTab->aCol = 0; ++ sqliteDeleteTable(0, pSelTab); ++ DbSetProperty(pParse->db, pTable->iDb, DB_UnresetViews); ++ }else{ ++ pTable->nCol = 0; ++ nErr++; ++ } ++ sqliteSelectUnbind(pSel); ++ sqliteExprListDelete(pSel->pEList); ++ pSel->pEList = pEList; ++ return nErr; ++} ++ ++/* ++** Clear the column names from the VIEW pTable. ++** ++** This routine is called whenever any other table or view is modified. ++** The view passed into this routine might depend directly or indirectly ++** on the modified or deleted table so we need to clear the old column ++** names so that they will be recomputed. ++*/ ++static void sqliteViewResetColumnNames(Table *pTable){ ++ int i; ++ Column *pCol; ++ assert( pTable!=0 && pTable->pSelect!=0 ); ++ for(i=0, pCol=pTable->aCol; inCol; i++, pCol++){ ++ sqliteFree(pCol->zName); ++ sqliteFree(pCol->zDflt); ++ sqliteFree(pCol->zType); ++ } ++ sqliteFree(pTable->aCol); ++ pTable->aCol = 0; ++ pTable->nCol = 0; ++} ++ ++/* ++** Clear the column names from every VIEW in database idx. ++*/ ++static void sqliteViewResetAll(sqlite *db, int idx){ ++ HashElem *i; ++ if( !DbHasProperty(db, idx, DB_UnresetViews) ) return; ++ for(i=sqliteHashFirst(&db->aDb[idx].tblHash); i; i=sqliteHashNext(i)){ ++ Table *pTab = sqliteHashData(i); ++ if( pTab->pSelect ){ ++ sqliteViewResetColumnNames(pTab); ++ } ++ } ++ DbClearProperty(db, idx, DB_UnresetViews); ++} ++ ++/* ++** Given a token, look up a table with that name. If not found, leave ++** an error for the parser to find and return NULL. ++*/ ++Table *sqliteTableFromToken(Parse *pParse, Token *pTok){ ++ char *zName; ++ Table *pTab; ++ zName = sqliteTableNameFromToken(pTok); ++ if( zName==0 ) return 0; ++ pTab = sqliteFindTable(pParse->db, zName, 0); ++ sqliteFree(zName); ++ if( pTab==0 ){ ++ sqliteErrorMsg(pParse, "no such table: %T", pTok); ++ } ++ return pTab; ++} ++ ++/* ++** This routine is called to do the work of a DROP TABLE statement. ++** pName is the name of the table to be dropped. ++*/ ++void sqliteDropTable(Parse *pParse, Token *pName, int isView){ ++ Table *pTable; ++ Vdbe *v; ++ int base; ++ sqlite *db = pParse->db; ++ int iDb; ++ ++ if( pParse->nErr || sqlite_malloc_failed ) return; ++ pTable = sqliteTableFromToken(pParse, pName); ++ if( pTable==0 ) return; ++ iDb = pTable->iDb; ++ assert( iDb>=0 && iDbnDb ); ++#ifndef SQLITE_OMIT_AUTHORIZATION ++ { ++ int code; ++ const char *zTab = SCHEMA_TABLE(pTable->iDb); ++ const char *zDb = db->aDb[pTable->iDb].zName; ++ if( sqliteAuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb)){ ++ return; ++ } ++ if( isView ){ ++ if( iDb==1 ){ ++ code = SQLITE_DROP_TEMP_VIEW; ++ }else{ ++ code = SQLITE_DROP_VIEW; ++ } ++ }else{ ++ if( iDb==1 ){ ++ code = SQLITE_DROP_TEMP_TABLE; ++ }else{ ++ code = SQLITE_DROP_TABLE; ++ } ++ } ++ if( sqliteAuthCheck(pParse, code, pTable->zName, 0, zDb) ){ ++ return; ++ } ++ if( sqliteAuthCheck(pParse, SQLITE_DELETE, pTable->zName, 0, zDb) ){ ++ return; ++ } ++ } ++#endif ++ if( pTable->readOnly ){ ++ sqliteErrorMsg(pParse, "table %s may not be dropped", pTable->zName); ++ pParse->nErr++; ++ return; ++ } ++ if( isView && pTable->pSelect==0 ){ ++ sqliteErrorMsg(pParse, "use DROP TABLE to delete table %s", pTable->zName); ++ return; ++ } ++ if( !isView && pTable->pSelect ){ ++ sqliteErrorMsg(pParse, "use DROP VIEW to delete view %s", pTable->zName); ++ return; ++ } ++ ++ /* Generate code to remove the table from the master table ++ ** on disk. ++ */ ++ v = sqliteGetVdbe(pParse); ++ if( v ){ ++ static VdbeOpList dropTable[] = { ++ { OP_Rewind, 0, ADDR(8), 0}, ++ { OP_String, 0, 0, 0}, /* 1 */ ++ { OP_MemStore, 1, 1, 0}, ++ { OP_MemLoad, 1, 0, 0}, /* 3 */ ++ { OP_Column, 0, 2, 0}, ++ { OP_Ne, 0, ADDR(7), 0}, ++ { OP_Delete, 0, 0, 0}, ++ { OP_Next, 0, ADDR(3), 0}, /* 7 */ ++ }; ++ Index *pIdx; ++ Trigger *pTrigger; ++ sqliteBeginWriteOperation(pParse, 0, pTable->iDb); ++ ++ /* Drop all triggers associated with the table being dropped */ ++ pTrigger = pTable->pTrigger; ++ while( pTrigger ){ ++ assert( pTrigger->iDb==pTable->iDb || pTrigger->iDb==1 ); ++ sqliteDropTriggerPtr(pParse, pTrigger, 1); ++ if( pParse->explain ){ ++ pTrigger = pTrigger->pNext; ++ }else{ ++ pTrigger = pTable->pTrigger; ++ } ++ } ++ ++ /* Drop all SQLITE_MASTER entries that refer to the table */ ++ sqliteOpenMasterTable(v, pTable->iDb); ++ base = sqliteVdbeAddOpList(v, ArraySize(dropTable), dropTable); ++ sqliteVdbeChangeP3(v, base+1, pTable->zName, 0); ++ ++ /* Drop all SQLITE_TEMP_MASTER entries that refer to the table */ ++ if( pTable->iDb!=1 ){ ++ sqliteOpenMasterTable(v, 1); ++ base = sqliteVdbeAddOpList(v, ArraySize(dropTable), dropTable); ++ sqliteVdbeChangeP3(v, base+1, pTable->zName, 0); ++ } ++ ++ if( pTable->iDb==0 ){ ++ sqliteChangeCookie(db, v); ++ } ++ sqliteVdbeAddOp(v, OP_Close, 0, 0); ++ if( !isView ){ ++ sqliteVdbeAddOp(v, OP_Destroy, pTable->tnum, pTable->iDb); ++ for(pIdx=pTable->pIndex; pIdx; pIdx=pIdx->pNext){ ++ sqliteVdbeAddOp(v, OP_Destroy, pIdx->tnum, pIdx->iDb); ++ } ++ } ++ sqliteEndWriteOperation(pParse); ++ } ++ ++ /* Delete the in-memory description of the table. ++ ** ++ ** Exception: if the SQL statement began with the EXPLAIN keyword, ++ ** then no changes should be made. ++ */ ++ if( !pParse->explain ){ ++ sqliteUnlinkAndDeleteTable(db, pTable); ++ db->flags |= SQLITE_InternChanges; ++ } ++ sqliteViewResetAll(db, iDb); ++} ++ ++/* ++** This routine constructs a P3 string suitable for an OP_MakeIdxKey ++** opcode and adds that P3 string to the most recently inserted instruction ++** in the virtual machine. The P3 string consists of a single character ++** for each column in the index pIdx of table pTab. If the column uses ++** a numeric sort order, then the P3 string character corresponding to ++** that column is 'n'. If the column uses a text sort order, then the ++** P3 string is 't'. See the OP_MakeIdxKey opcode documentation for ++** additional information. See also the sqliteAddKeyType() routine. ++*/ ++void sqliteAddIdxKeyType(Vdbe *v, Index *pIdx){ ++ char *zType; ++ Table *pTab; ++ int i, n; ++ assert( pIdx!=0 && pIdx->pTable!=0 ); ++ pTab = pIdx->pTable; ++ n = pIdx->nColumn; ++ zType = sqliteMallocRaw( n+1 ); ++ if( zType==0 ) return; ++ for(i=0; iaiColumn[i]; ++ assert( iCol>=0 && iColnCol ); ++ if( (pTab->aCol[iCol].sortOrder & SQLITE_SO_TYPEMASK)==SQLITE_SO_TEXT ){ ++ zType[i] = 't'; ++ }else{ ++ zType[i] = 'n'; ++ } ++ } ++ zType[n] = 0; ++ sqliteVdbeChangeP3(v, -1, zType, n); ++ sqliteFree(zType); ++} ++ ++/* ++** This routine is called to create a new foreign key on the table ++** currently under construction. pFromCol determines which columns ++** in the current table point to the foreign key. If pFromCol==0 then ++** connect the key to the last column inserted. pTo is the name of ++** the table referred to. pToCol is a list of tables in the other ++** pTo table that the foreign key points to. flags contains all ++** information about the conflict resolution algorithms specified ++** in the ON DELETE, ON UPDATE and ON INSERT clauses. ++** ++** An FKey structure is created and added to the table currently ++** under construction in the pParse->pNewTable field. The new FKey ++** is not linked into db->aFKey at this point - that does not happen ++** until sqliteEndTable(). ++** ++** The foreign key is set for IMMEDIATE processing. A subsequent call ++** to sqliteDeferForeignKey() might change this to DEFERRED. ++*/ ++void sqliteCreateForeignKey( ++ Parse *pParse, /* Parsing context */ ++ IdList *pFromCol, /* Columns in this table that point to other table */ ++ Token *pTo, /* Name of the other table */ ++ IdList *pToCol, /* Columns in the other table */ ++ int flags /* Conflict resolution algorithms. */ ++){ ++ Table *p = pParse->pNewTable; ++ int nByte; ++ int i; ++ int nCol; ++ char *z; ++ FKey *pFKey = 0; ++ ++ assert( pTo!=0 ); ++ if( p==0 || pParse->nErr ) goto fk_end; ++ if( pFromCol==0 ){ ++ int iCol = p->nCol-1; ++ if( iCol<0 ) goto fk_end; ++ if( pToCol && pToCol->nId!=1 ){ ++ sqliteErrorMsg(pParse, "foreign key on %s" ++ " should reference only one column of table %T", ++ p->aCol[iCol].zName, pTo); ++ goto fk_end; ++ } ++ nCol = 1; ++ }else if( pToCol && pToCol->nId!=pFromCol->nId ){ ++ sqliteErrorMsg(pParse, ++ "number of columns in foreign key does not match the number of " ++ "columns in the referenced table"); ++ goto fk_end; ++ }else{ ++ nCol = pFromCol->nId; ++ } ++ nByte = sizeof(*pFKey) + nCol*sizeof(pFKey->aCol[0]) + pTo->n + 1; ++ if( pToCol ){ ++ for(i=0; inId; i++){ ++ nByte += strlen(pToCol->a[i].zName) + 1; ++ } ++ } ++ pFKey = sqliteMalloc( nByte ); ++ if( pFKey==0 ) goto fk_end; ++ pFKey->pFrom = p; ++ pFKey->pNextFrom = p->pFKey; ++ z = (char*)&pFKey[1]; ++ pFKey->aCol = (struct sColMap*)z; ++ z += sizeof(struct sColMap)*nCol; ++ pFKey->zTo = z; ++ memcpy(z, pTo->z, pTo->n); ++ z[pTo->n] = 0; ++ z += pTo->n+1; ++ pFKey->pNextTo = 0; ++ pFKey->nCol = nCol; ++ if( pFromCol==0 ){ ++ pFKey->aCol[0].iFrom = p->nCol-1; ++ }else{ ++ for(i=0; inCol; j++){ ++ if( sqliteStrICmp(p->aCol[j].zName, pFromCol->a[i].zName)==0 ){ ++ pFKey->aCol[i].iFrom = j; ++ break; ++ } ++ } ++ if( j>=p->nCol ){ ++ sqliteErrorMsg(pParse, ++ "unknown column \"%s\" in foreign key definition", ++ pFromCol->a[i].zName); ++ goto fk_end; ++ } ++ } ++ } ++ if( pToCol ){ ++ for(i=0; ia[i].zName); ++ pFKey->aCol[i].zCol = z; ++ memcpy(z, pToCol->a[i].zName, n); ++ z[n] = 0; ++ z += n+1; ++ } ++ } ++ pFKey->isDeferred = 0; ++ pFKey->deleteConf = flags & 0xff; ++ pFKey->updateConf = (flags >> 8 ) & 0xff; ++ pFKey->insertConf = (flags >> 16 ) & 0xff; ++ ++ /* Link the foreign key to the table as the last step. ++ */ ++ p->pFKey = pFKey; ++ pFKey = 0; ++ ++fk_end: ++ sqliteFree(pFKey); ++ sqliteIdListDelete(pFromCol); ++ sqliteIdListDelete(pToCol); ++} ++ ++/* ++** This routine is called when an INITIALLY IMMEDIATE or INITIALLY DEFERRED ++** clause is seen as part of a foreign key definition. The isDeferred ++** parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE. ++** The behavior of the most recently created foreign key is adjusted ++** accordingly. ++*/ ++void sqliteDeferForeignKey(Parse *pParse, int isDeferred){ ++ Table *pTab; ++ FKey *pFKey; ++ if( (pTab = pParse->pNewTable)==0 || (pFKey = pTab->pFKey)==0 ) return; ++ pFKey->isDeferred = isDeferred; ++} ++ ++/* ++** Create a new index for an SQL table. pIndex is the name of the index ++** and pTable is the name of the table that is to be indexed. Both will ++** be NULL for a primary key or an index that is created to satisfy a ++** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable ++** as the table to be indexed. pParse->pNewTable is a table that is ++** currently being constructed by a CREATE TABLE statement. ++** ++** pList is a list of columns to be indexed. pList will be NULL if this ++** is a primary key or unique-constraint on the most recent column added ++** to the table currently under construction. ++*/ ++void sqliteCreateIndex( ++ Parse *pParse, /* All information about this parse */ ++ Token *pName, /* Name of the index. May be NULL */ ++ SrcList *pTable, /* Name of the table to index. Use pParse->pNewTable if 0 */ ++ IdList *pList, /* A list of columns to be indexed */ ++ int onError, /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ ++ Token *pStart, /* The CREATE token that begins a CREATE TABLE statement */ ++ Token *pEnd /* The ")" that closes the CREATE INDEX statement */ ++){ ++ Table *pTab; /* Table to be indexed */ ++ Index *pIndex; /* The index to be created */ ++ char *zName = 0; ++ int i, j; ++ Token nullId; /* Fake token for an empty ID list */ ++ DbFixer sFix; /* For assigning database names to pTable */ ++ int isTemp; /* True for a temporary index */ ++ sqlite *db = pParse->db; ++ ++ if( pParse->nErr || sqlite_malloc_failed ) goto exit_create_index; ++ if( db->init.busy ++ && sqliteFixInit(&sFix, pParse, db->init.iDb, "index", pName) ++ && sqliteFixSrcList(&sFix, pTable) ++ ){ ++ goto exit_create_index; ++ } ++ ++ /* ++ ** Find the table that is to be indexed. Return early if not found. ++ */ ++ if( pTable!=0 ){ ++ assert( pName!=0 ); ++ assert( pTable->nSrc==1 ); ++ pTab = sqliteSrcListLookup(pParse, pTable); ++ }else{ ++ assert( pName==0 ); ++ pTab = pParse->pNewTable; ++ } ++ if( pTab==0 || pParse->nErr ) goto exit_create_index; ++ if( pTab->readOnly ){ ++ sqliteErrorMsg(pParse, "table %s may not be indexed", pTab->zName); ++ goto exit_create_index; ++ } ++ if( pTab->iDb>=2 && db->init.busy==0 ){ ++ sqliteErrorMsg(pParse, "table %s may not have indices added", pTab->zName); ++ goto exit_create_index; ++ } ++ if( pTab->pSelect ){ ++ sqliteErrorMsg(pParse, "views may not be indexed"); ++ goto exit_create_index; ++ } ++ isTemp = pTab->iDb==1; ++ ++ /* ++ ** Find the name of the index. Make sure there is not already another ++ ** index or table with the same name. ++ ** ++ ** Exception: If we are reading the names of permanent indices from the ++ ** sqlite_master table (because some other process changed the schema) and ++ ** one of the index names collides with the name of a temporary table or ++ ** index, then we will continue to process this index. ++ ** ++ ** If pName==0 it means that we are ++ ** dealing with a primary key or UNIQUE constraint. We have to invent our ++ ** own name. ++ */ ++ if( pName && !db->init.busy ){ ++ Index *pISameName; /* Another index with the same name */ ++ Table *pTSameName; /* A table with same name as the index */ ++ zName = sqliteTableNameFromToken(pName); ++ if( zName==0 ) goto exit_create_index; ++ if( (pISameName = sqliteFindIndex(db, zName, 0))!=0 ){ ++ sqliteErrorMsg(pParse, "index %s already exists", zName); ++ goto exit_create_index; ++ } ++ if( (pTSameName = sqliteFindTable(db, zName, 0))!=0 ){ ++ sqliteErrorMsg(pParse, "there is already a table named %s", zName); ++ goto exit_create_index; ++ } ++ }else if( pName==0 ){ ++ char zBuf[30]; ++ int n; ++ Index *pLoop; ++ for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){} ++ sprintf(zBuf,"%d)",n); ++ zName = 0; ++ sqliteSetString(&zName, "(", pTab->zName, " autoindex ", zBuf, (char*)0); ++ if( zName==0 ) goto exit_create_index; ++ }else{ ++ zName = sqliteTableNameFromToken(pName); ++ } ++ ++ /* Check for authorization to create an index. ++ */ ++#ifndef SQLITE_OMIT_AUTHORIZATION ++ { ++ const char *zDb = db->aDb[pTab->iDb].zName; ++ ++ assert( pTab->iDb==db->init.iDb || isTemp ); ++ if( sqliteAuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ ++ goto exit_create_index; ++ } ++ i = SQLITE_CREATE_INDEX; ++ if( isTemp ) i = SQLITE_CREATE_TEMP_INDEX; ++ if( sqliteAuthCheck(pParse, i, zName, pTab->zName, zDb) ){ ++ goto exit_create_index; ++ } ++ } ++#endif ++ ++ /* If pList==0, it means this routine was called to make a primary ++ ** key out of the last column added to the table under construction. ++ ** So create a fake list to simulate this. ++ */ ++ if( pList==0 ){ ++ nullId.z = pTab->aCol[pTab->nCol-1].zName; ++ nullId.n = strlen(nullId.z); ++ pList = sqliteIdListAppend(0, &nullId); ++ if( pList==0 ) goto exit_create_index; ++ } ++ ++ /* ++ ** Allocate the index structure. ++ */ ++ pIndex = sqliteMalloc( sizeof(Index) + strlen(zName) + 1 + ++ sizeof(int)*pList->nId ); ++ if( pIndex==0 ) goto exit_create_index; ++ pIndex->aiColumn = (int*)&pIndex[1]; ++ pIndex->zName = (char*)&pIndex->aiColumn[pList->nId]; ++ strcpy(pIndex->zName, zName); ++ pIndex->pTable = pTab; ++ pIndex->nColumn = pList->nId; ++ pIndex->onError = onError; ++ pIndex->autoIndex = pName==0; ++ pIndex->iDb = isTemp ? 1 : db->init.iDb; ++ ++ /* Scan the names of the columns of the table to be indexed and ++ ** load the column indices into the Index structure. Report an error ++ ** if any column is not found. ++ */ ++ for(i=0; inId; i++){ ++ for(j=0; jnCol; j++){ ++ if( sqliteStrICmp(pList->a[i].zName, pTab->aCol[j].zName)==0 ) break; ++ } ++ if( j>=pTab->nCol ){ ++ sqliteErrorMsg(pParse, "table %s has no column named %s", ++ pTab->zName, pList->a[i].zName); ++ sqliteFree(pIndex); ++ goto exit_create_index; ++ } ++ pIndex->aiColumn[i] = j; ++ } ++ ++ /* Link the new Index structure to its table and to the other ++ ** in-memory database structures. ++ */ ++ if( !pParse->explain ){ ++ Index *p; ++ p = sqliteHashInsert(&db->aDb[pIndex->iDb].idxHash, ++ pIndex->zName, strlen(pIndex->zName)+1, pIndex); ++ if( p ){ ++ assert( p==pIndex ); /* Malloc must have failed */ ++ sqliteFree(pIndex); ++ goto exit_create_index; ++ } ++ db->flags |= SQLITE_InternChanges; ++ } ++ ++ /* When adding an index to the list of indices for a table, make ++ ** sure all indices labeled OE_Replace come after all those labeled ++ ** OE_Ignore. This is necessary for the correct operation of UPDATE ++ ** and INSERT. ++ */ ++ if( onError!=OE_Replace || pTab->pIndex==0 ++ || pTab->pIndex->onError==OE_Replace){ ++ pIndex->pNext = pTab->pIndex; ++ pTab->pIndex = pIndex; ++ }else{ ++ Index *pOther = pTab->pIndex; ++ while( pOther->pNext && pOther->pNext->onError!=OE_Replace ){ ++ pOther = pOther->pNext; ++ } ++ pIndex->pNext = pOther->pNext; ++ pOther->pNext = pIndex; ++ } ++ ++ /* If the db->init.busy is 1 it means we are reading the SQL off the ++ ** "sqlite_master" table on the disk. So do not write to the disk ++ ** again. Extract the table number from the db->init.newTnum field. ++ */ ++ if( db->init.busy && pTable!=0 ){ ++ pIndex->tnum = db->init.newTnum; ++ } ++ ++ /* If the db->init.busy is 0 then create the index on disk. This ++ ** involves writing the index into the master table and filling in the ++ ** index with the current table contents. ++ ** ++ ** The db->init.busy is 0 when the user first enters a CREATE INDEX ++ ** command. db->init.busy is 1 when a database is opened and ++ ** CREATE INDEX statements are read out of the master table. In ++ ** the latter case the index already exists on disk, which is why ++ ** we don't want to recreate it. ++ ** ++ ** If pTable==0 it means this index is generated as a primary key ++ ** or UNIQUE constraint of a CREATE TABLE statement. Since the table ++ ** has just been created, it contains no data and the index initialization ++ ** step can be skipped. ++ */ ++ else if( db->init.busy==0 ){ ++ int n; ++ Vdbe *v; ++ int lbl1, lbl2; ++ int i; ++ int addr; ++ ++ v = sqliteGetVdbe(pParse); ++ if( v==0 ) goto exit_create_index; ++ if( pTable!=0 ){ ++ sqliteBeginWriteOperation(pParse, 0, isTemp); ++ sqliteOpenMasterTable(v, isTemp); ++ } ++ sqliteVdbeAddOp(v, OP_NewRecno, 0, 0); ++ sqliteVdbeOp3(v, OP_String, 0, 0, "index", P3_STATIC); ++ sqliteVdbeOp3(v, OP_String, 0, 0, pIndex->zName, 0); ++ sqliteVdbeOp3(v, OP_String, 0, 0, pTab->zName, 0); ++ sqliteVdbeOp3(v, OP_CreateIndex, 0, isTemp,(char*)&pIndex->tnum,P3_POINTER); ++ pIndex->tnum = 0; ++ if( pTable ){ ++ sqliteVdbeCode(v, ++ OP_Dup, 0, 0, ++ OP_Integer, isTemp, 0, ++ OP_OpenWrite, 1, 0, ++ 0); ++ } ++ addr = sqliteVdbeAddOp(v, OP_String, 0, 0); ++ if( pStart && pEnd ){ ++ n = Addr(pEnd->z) - Addr(pStart->z) + 1; ++ sqliteVdbeChangeP3(v, addr, pStart->z, n); ++ } ++ sqliteVdbeAddOp(v, OP_MakeRecord, 5, 0); ++ sqliteVdbeAddOp(v, OP_PutIntKey, 0, 0); ++ if( pTable ){ ++ sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0); ++ sqliteVdbeOp3(v, OP_OpenRead, 2, pTab->tnum, pTab->zName, 0); ++ lbl2 = sqliteVdbeMakeLabel(v); ++ sqliteVdbeAddOp(v, OP_Rewind, 2, lbl2); ++ lbl1 = sqliteVdbeAddOp(v, OP_Recno, 2, 0); ++ for(i=0; inColumn; i++){ ++ int iCol = pIndex->aiColumn[i]; ++ if( pTab->iPKey==iCol ){ ++ sqliteVdbeAddOp(v, OP_Dup, i, 0); ++ }else{ ++ sqliteVdbeAddOp(v, OP_Column, 2, iCol); ++ } ++ } ++ sqliteVdbeAddOp(v, OP_MakeIdxKey, pIndex->nColumn, 0); ++ if( db->file_format>=4 ) sqliteAddIdxKeyType(v, pIndex); ++ sqliteVdbeOp3(v, OP_IdxPut, 1, pIndex->onError!=OE_None, ++ "indexed columns are not unique", P3_STATIC); ++ sqliteVdbeAddOp(v, OP_Next, 2, lbl1); ++ sqliteVdbeResolveLabel(v, lbl2); ++ sqliteVdbeAddOp(v, OP_Close, 2, 0); ++ sqliteVdbeAddOp(v, OP_Close, 1, 0); ++ } ++ if( pTable!=0 ){ ++ if( !isTemp ){ ++ sqliteChangeCookie(db, v); ++ } ++ sqliteVdbeAddOp(v, OP_Close, 0, 0); ++ sqliteEndWriteOperation(pParse); ++ } ++ } ++ ++ /* Clean up before exiting */ ++exit_create_index: ++ sqliteIdListDelete(pList); ++ sqliteSrcListDelete(pTable); ++ sqliteFree(zName); ++ return; ++} ++ ++/* ++** This routine will drop an existing named index. This routine ++** implements the DROP INDEX statement. ++*/ ++void sqliteDropIndex(Parse *pParse, SrcList *pName){ ++ Index *pIndex; ++ Vdbe *v; ++ sqlite *db = pParse->db; ++ ++ if( pParse->nErr || sqlite_malloc_failed ) return; ++ assert( pName->nSrc==1 ); ++ pIndex = sqliteFindIndex(db, pName->a[0].zName, pName->a[0].zDatabase); ++ if( pIndex==0 ){ ++ sqliteErrorMsg(pParse, "no such index: %S", pName, 0); ++ goto exit_drop_index; ++ } ++ if( pIndex->autoIndex ){ ++ sqliteErrorMsg(pParse, "index associated with UNIQUE " ++ "or PRIMARY KEY constraint cannot be dropped", 0); ++ goto exit_drop_index; ++ } ++ if( pIndex->iDb>1 ){ ++ sqliteErrorMsg(pParse, "cannot alter schema of attached " ++ "databases", 0); ++ goto exit_drop_index; ++ } ++#ifndef SQLITE_OMIT_AUTHORIZATION ++ { ++ int code = SQLITE_DROP_INDEX; ++ Table *pTab = pIndex->pTable; ++ const char *zDb = db->aDb[pIndex->iDb].zName; ++ const char *zTab = SCHEMA_TABLE(pIndex->iDb); ++ if( sqliteAuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){ ++ goto exit_drop_index; ++ } ++ if( pIndex->iDb ) code = SQLITE_DROP_TEMP_INDEX; ++ if( sqliteAuthCheck(pParse, code, pIndex->zName, pTab->zName, zDb) ){ ++ goto exit_drop_index; ++ } ++ } ++#endif ++ ++ /* Generate code to remove the index and from the master table */ ++ v = sqliteGetVdbe(pParse); ++ if( v ){ ++ static VdbeOpList dropIndex[] = { ++ { OP_Rewind, 0, ADDR(9), 0}, ++ { OP_String, 0, 0, 0}, /* 1 */ ++ { OP_MemStore, 1, 1, 0}, ++ { OP_MemLoad, 1, 0, 0}, /* 3 */ ++ { OP_Column, 0, 1, 0}, ++ { OP_Eq, 0, ADDR(8), 0}, ++ { OP_Next, 0, ADDR(3), 0}, ++ { OP_Goto, 0, ADDR(9), 0}, ++ { OP_Delete, 0, 0, 0}, /* 8 */ ++ }; ++ int base; ++ ++ sqliteBeginWriteOperation(pParse, 0, pIndex->iDb); ++ sqliteOpenMasterTable(v, pIndex->iDb); ++ base = sqliteVdbeAddOpList(v, ArraySize(dropIndex), dropIndex); ++ sqliteVdbeChangeP3(v, base+1, pIndex->zName, 0); ++ if( pIndex->iDb==0 ){ ++ sqliteChangeCookie(db, v); ++ } ++ sqliteVdbeAddOp(v, OP_Close, 0, 0); ++ sqliteVdbeAddOp(v, OP_Destroy, pIndex->tnum, pIndex->iDb); ++ sqliteEndWriteOperation(pParse); ++ } ++ ++ /* Delete the in-memory description of this index. ++ */ ++ if( !pParse->explain ){ ++ sqliteUnlinkAndDeleteIndex(db, pIndex); ++ db->flags |= SQLITE_InternChanges; ++ } ++ ++exit_drop_index: ++ sqliteSrcListDelete(pName); ++} ++ ++/* ++** Append a new element to the given IdList. Create a new IdList if ++** need be. ++** ++** A new IdList is returned, or NULL if malloc() fails. ++*/ ++IdList *sqliteIdListAppend(IdList *pList, Token *pToken){ ++ if( pList==0 ){ ++ pList = sqliteMalloc( sizeof(IdList) ); ++ if( pList==0 ) return 0; ++ pList->nAlloc = 0; ++ } ++ if( pList->nId>=pList->nAlloc ){ ++ struct IdList_item *a; ++ pList->nAlloc = pList->nAlloc*2 + 5; ++ a = sqliteRealloc(pList->a, pList->nAlloc*sizeof(pList->a[0]) ); ++ if( a==0 ){ ++ sqliteIdListDelete(pList); ++ return 0; ++ } ++ pList->a = a; ++ } ++ memset(&pList->a[pList->nId], 0, sizeof(pList->a[0])); ++ if( pToken ){ ++ char **pz = &pList->a[pList->nId].zName; ++ sqliteSetNString(pz, pToken->z, pToken->n, 0); ++ if( *pz==0 ){ ++ sqliteIdListDelete(pList); ++ return 0; ++ }else{ ++ sqliteDequote(*pz); ++ } ++ } ++ pList->nId++; ++ return pList; ++} ++ ++/* ++** Append a new table name to the given SrcList. Create a new SrcList if ++** need be. A new entry is created in the SrcList even if pToken is NULL. ++** ++** A new SrcList is returned, or NULL if malloc() fails. ++** ++** If pDatabase is not null, it means that the table has an optional ++** database name prefix. Like this: "database.table". The pDatabase ++** points to the table name and the pTable points to the database name. ++** The SrcList.a[].zName field is filled with the table name which might ++** come from pTable (if pDatabase is NULL) or from pDatabase. ++** SrcList.a[].zDatabase is filled with the database name from pTable, ++** or with NULL if no database is specified. ++** ++** In other words, if call like this: ++** ++** sqliteSrcListAppend(A,B,0); ++** ++** Then B is a table name and the database name is unspecified. If called ++** like this: ++** ++** sqliteSrcListAppend(A,B,C); ++** ++** Then C is the table name and B is the database name. ++*/ ++SrcList *sqliteSrcListAppend(SrcList *pList, Token *pTable, Token *pDatabase){ ++ if( pList==0 ){ ++ pList = sqliteMalloc( sizeof(SrcList) ); ++ if( pList==0 ) return 0; ++ pList->nAlloc = 1; ++ } ++ if( pList->nSrc>=pList->nAlloc ){ ++ SrcList *pNew; ++ pList->nAlloc *= 2; ++ pNew = sqliteRealloc(pList, ++ sizeof(*pList) + (pList->nAlloc-1)*sizeof(pList->a[0]) ); ++ if( pNew==0 ){ ++ sqliteSrcListDelete(pList); ++ return 0; ++ } ++ pList = pNew; ++ } ++ memset(&pList->a[pList->nSrc], 0, sizeof(pList->a[0])); ++ if( pDatabase && pDatabase->z==0 ){ ++ pDatabase = 0; ++ } ++ if( pDatabase && pTable ){ ++ Token *pTemp = pDatabase; ++ pDatabase = pTable; ++ pTable = pTemp; ++ } ++ if( pTable ){ ++ char **pz = &pList->a[pList->nSrc].zName; ++ sqliteSetNString(pz, pTable->z, pTable->n, 0); ++ if( *pz==0 ){ ++ sqliteSrcListDelete(pList); ++ return 0; ++ }else{ ++ sqliteDequote(*pz); ++ } ++ } ++ if( pDatabase ){ ++ char **pz = &pList->a[pList->nSrc].zDatabase; ++ sqliteSetNString(pz, pDatabase->z, pDatabase->n, 0); ++ if( *pz==0 ){ ++ sqliteSrcListDelete(pList); ++ return 0; ++ }else{ ++ sqliteDequote(*pz); ++ } ++ } ++ pList->a[pList->nSrc].iCursor = -1; ++ pList->nSrc++; ++ return pList; ++} ++ ++/* ++** Assign cursors to all tables in a SrcList ++*/ ++void sqliteSrcListAssignCursors(Parse *pParse, SrcList *pList){ ++ int i; ++ for(i=0; inSrc; i++){ ++ if( pList->a[i].iCursor<0 ){ ++ pList->a[i].iCursor = pParse->nTab++; ++ } ++ } ++} ++ ++/* ++** Add an alias to the last identifier on the given identifier list. ++*/ ++void sqliteSrcListAddAlias(SrcList *pList, Token *pToken){ ++ if( pList && pList->nSrc>0 ){ ++ int i = pList->nSrc - 1; ++ sqliteSetNString(&pList->a[i].zAlias, pToken->z, pToken->n, 0); ++ sqliteDequote(pList->a[i].zAlias); ++ } ++} ++ ++/* ++** Delete an IdList. ++*/ ++void sqliteIdListDelete(IdList *pList){ ++ int i; ++ if( pList==0 ) return; ++ for(i=0; inId; i++){ ++ sqliteFree(pList->a[i].zName); ++ } ++ sqliteFree(pList->a); ++ sqliteFree(pList); ++} ++ ++/* ++** Return the index in pList of the identifier named zId. Return -1 ++** if not found. ++*/ ++int sqliteIdListIndex(IdList *pList, const char *zName){ ++ int i; ++ if( pList==0 ) return -1; ++ for(i=0; inId; i++){ ++ if( sqliteStrICmp(pList->a[i].zName, zName)==0 ) return i; ++ } ++ return -1; ++} ++ ++/* ++** Delete an entire SrcList including all its substructure. ++*/ ++void sqliteSrcListDelete(SrcList *pList){ ++ int i; ++ if( pList==0 ) return; ++ for(i=0; inSrc; i++){ ++ sqliteFree(pList->a[i].zDatabase); ++ sqliteFree(pList->a[i].zName); ++ sqliteFree(pList->a[i].zAlias); ++ if( pList->a[i].pTab && pList->a[i].pTab->isTransient ){ ++ sqliteDeleteTable(0, pList->a[i].pTab); ++ } ++ sqliteSelectDelete(pList->a[i].pSelect); ++ sqliteExprDelete(pList->a[i].pOn); ++ sqliteIdListDelete(pList->a[i].pUsing); ++ } ++ sqliteFree(pList); ++} ++ ++/* ++** Begin a transaction ++*/ ++void sqliteBeginTransaction(Parse *pParse, int onError){ ++ sqlite *db; ++ ++ if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; ++ if( pParse->nErr || sqlite_malloc_failed ) return; ++ if( sqliteAuthCheck(pParse, SQLITE_TRANSACTION, "BEGIN", 0, 0) ) return; ++ if( db->flags & SQLITE_InTrans ){ ++ sqliteErrorMsg(pParse, "cannot start a transaction within a transaction"); ++ return; ++ } ++ sqliteBeginWriteOperation(pParse, 0, 0); ++ if( !pParse->explain ){ ++ db->flags |= SQLITE_InTrans; ++ db->onError = onError; ++ } ++} ++ ++/* ++** Commit a transaction ++*/ ++void sqliteCommitTransaction(Parse *pParse){ ++ sqlite *db; ++ ++ if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; ++ if( pParse->nErr || sqlite_malloc_failed ) return; ++ if( sqliteAuthCheck(pParse, SQLITE_TRANSACTION, "COMMIT", 0, 0) ) return; ++ if( (db->flags & SQLITE_InTrans)==0 ){ ++ sqliteErrorMsg(pParse, "cannot commit - no transaction is active"); ++ return; ++ } ++ if( !pParse->explain ){ ++ db->flags &= ~SQLITE_InTrans; ++ } ++ sqliteEndWriteOperation(pParse); ++ if( !pParse->explain ){ ++ db->onError = OE_Default; ++ } ++} ++ ++/* ++** Rollback a transaction ++*/ ++void sqliteRollbackTransaction(Parse *pParse){ ++ sqlite *db; ++ Vdbe *v; ++ ++ if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; ++ if( pParse->nErr || sqlite_malloc_failed ) return; ++ if( sqliteAuthCheck(pParse, SQLITE_TRANSACTION, "ROLLBACK", 0, 0) ) return; ++ if( (db->flags & SQLITE_InTrans)==0 ){ ++ sqliteErrorMsg(pParse, "cannot rollback - no transaction is active"); ++ return; ++ } ++ v = sqliteGetVdbe(pParse); ++ if( v ){ ++ sqliteVdbeAddOp(v, OP_Rollback, 0, 0); ++ } ++ if( !pParse->explain ){ ++ db->flags &= ~SQLITE_InTrans; ++ db->onError = OE_Default; ++ } ++} ++ ++/* ++** Generate VDBE code that will verify the schema cookie for all ++** named database files. ++*/ ++void sqliteCodeVerifySchema(Parse *pParse, int iDb){ ++ sqlite *db = pParse->db; ++ Vdbe *v = sqliteGetVdbe(pParse); ++ assert( iDb>=0 && iDbnDb ); ++ assert( db->aDb[iDb].pBt!=0 ); ++ if( iDb!=1 && !DbHasProperty(db, iDb, DB_Cookie) ){ ++ sqliteVdbeAddOp(v, OP_VerifyCookie, iDb, db->aDb[iDb].schema_cookie); ++ DbSetProperty(db, iDb, DB_Cookie); ++ } ++} ++ ++/* ++** Generate VDBE code that prepares for doing an operation that ++** might change the database. ++** ++** This routine starts a new transaction if we are not already within ++** a transaction. If we are already within a transaction, then a checkpoint ++** is set if the setCheckpoint parameter is true. A checkpoint should ++** be set for operations that might fail (due to a constraint) part of ++** the way through and which will need to undo some writes without having to ++** rollback the whole transaction. For operations where all constraints ++** can be checked before any changes are made to the database, it is never ++** necessary to undo a write and the checkpoint should not be set. ++** ++** Only database iDb and the temp database are made writable by this call. ++** If iDb==0, then the main and temp databases are made writable. If ++** iDb==1 then only the temp database is made writable. If iDb>1 then the ++** specified auxiliary database and the temp database are made writable. ++*/ ++void sqliteBeginWriteOperation(Parse *pParse, int setCheckpoint, int iDb){ ++ Vdbe *v; ++ sqlite *db = pParse->db; ++ if( DbHasProperty(db, iDb, DB_Locked) ) return; ++ v = sqliteGetVdbe(pParse); ++ if( v==0 ) return; ++ if( !db->aDb[iDb].inTrans ){ ++ sqliteVdbeAddOp(v, OP_Transaction, iDb, 0); ++ DbSetProperty(db, iDb, DB_Locked); ++ sqliteCodeVerifySchema(pParse, iDb); ++ if( iDb!=1 ){ ++ sqliteBeginWriteOperation(pParse, setCheckpoint, 1); ++ } ++ }else if( setCheckpoint ){ ++ sqliteVdbeAddOp(v, OP_Checkpoint, iDb, 0); ++ DbSetProperty(db, iDb, DB_Locked); ++ } ++} ++ ++/* ++** Generate code that concludes an operation that may have changed ++** the database. If a statement transaction was started, then emit ++** an OP_Commit that will cause the changes to be committed to disk. ++** ++** Note that checkpoints are automatically committed at the end of ++** a statement. Note also that there can be multiple calls to ++** sqliteBeginWriteOperation() but there should only be a single ++** call to sqliteEndWriteOperation() at the conclusion of the statement. ++*/ ++void sqliteEndWriteOperation(Parse *pParse){ ++ Vdbe *v; ++ sqlite *db = pParse->db; ++ if( pParse->trigStack ) return; /* if this is in a trigger */ ++ v = sqliteGetVdbe(pParse); ++ if( v==0 ) return; ++ if( db->flags & SQLITE_InTrans ){ ++ /* A BEGIN has executed. Do not commit until we see an explicit ++ ** COMMIT statement. */ ++ }else{ ++ sqliteVdbeAddOp(v, OP_Commit, 0, 0); ++ } ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/config_static.w32.h +@@ -0,0 +1 @@ ++#define SQLITE_PTR_SZ 4 +\ No newline at end of file +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/copy.c +@@ -0,0 +1,110 @@ ++/* ++** 2003 April 6 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This file contains code used to implement the COPY command. ++** ++** $Id$ ++*/ ++#include "sqliteInt.h" ++ ++/* ++** The COPY command is for compatibility with PostgreSQL and specificially ++** for the ability to read the output of pg_dump. The format is as ++** follows: ++** ++** COPY table FROM file [USING DELIMITERS string] ++** ++** "table" is an existing table name. We will read lines of code from ++** file to fill this table with data. File might be "stdin". The optional ++** delimiter string identifies the field separators. The default is a tab. ++*/ ++void sqliteCopy( ++ Parse *pParse, /* The parser context */ ++ SrcList *pTableName, /* The name of the table into which we will insert */ ++ Token *pFilename, /* The file from which to obtain information */ ++ Token *pDelimiter, /* Use this as the field delimiter */ ++ int onError /* What to do if a constraint fails */ ++){ ++ Table *pTab; ++ int i; ++ Vdbe *v; ++ int addr, end; ++ char *zFile = 0; ++ const char *zDb; ++ sqlite *db = pParse->db; ++ ++ ++ if( sqlite_malloc_failed ) goto copy_cleanup; ++ assert( pTableName->nSrc==1 ); ++ pTab = sqliteSrcListLookup(pParse, pTableName); ++ if( pTab==0 || sqliteIsReadOnly(pParse, pTab, 0) ) goto copy_cleanup; ++ zFile = sqliteStrNDup(pFilename->z, pFilename->n); ++ sqliteDequote(zFile); ++ assert( pTab->iDbnDb ); ++ zDb = db->aDb[pTab->iDb].zName; ++ if( sqliteAuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, zDb) ++ || sqliteAuthCheck(pParse, SQLITE_COPY, pTab->zName, zFile, zDb) ){ ++ goto copy_cleanup; ++ } ++ v = sqliteGetVdbe(pParse); ++ if( v ){ ++ sqliteBeginWriteOperation(pParse, 1, pTab->iDb); ++ addr = sqliteVdbeOp3(v, OP_FileOpen, 0, 0, pFilename->z, pFilename->n); ++ sqliteVdbeDequoteP3(v, addr); ++ sqliteOpenTableAndIndices(pParse, pTab, 0); ++ if( db->flags & SQLITE_CountRows ){ ++ sqliteVdbeAddOp(v, OP_Integer, 0, 0); /* Initialize the row count */ ++ } ++ end = sqliteVdbeMakeLabel(v); ++ addr = sqliteVdbeAddOp(v, OP_FileRead, pTab->nCol, end); ++ if( pDelimiter ){ ++ sqliteVdbeChangeP3(v, addr, pDelimiter->z, pDelimiter->n); ++ sqliteVdbeDequoteP3(v, addr); ++ }else{ ++ sqliteVdbeChangeP3(v, addr, "\t", 1); ++ } ++ if( pTab->iPKey>=0 ){ ++ sqliteVdbeAddOp(v, OP_FileColumn, pTab->iPKey, 0); ++ sqliteVdbeAddOp(v, OP_MustBeInt, 0, 0); ++ }else{ ++ sqliteVdbeAddOp(v, OP_NewRecno, 0, 0); ++ } ++ for(i=0; inCol; i++){ ++ if( i==pTab->iPKey ){ ++ /* The integer primary key column is filled with NULL since its ++ ** value is always pulled from the record number */ ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ }else{ ++ sqliteVdbeAddOp(v, OP_FileColumn, i, 0); ++ } ++ } ++ sqliteGenerateConstraintChecks(pParse, pTab, 0, 0, pTab->iPKey>=0, ++ 0, onError, addr); ++ sqliteCompleteInsertion(pParse, pTab, 0, 0, 0, 0, -1); ++ if( (db->flags & SQLITE_CountRows)!=0 ){ ++ sqliteVdbeAddOp(v, OP_AddImm, 1, 0); /* Increment row count */ ++ } ++ sqliteVdbeAddOp(v, OP_Goto, 0, addr); ++ sqliteVdbeResolveLabel(v, end); ++ sqliteVdbeAddOp(v, OP_Noop, 0, 0); ++ sqliteEndWriteOperation(pParse); ++ if( db->flags & SQLITE_CountRows ){ ++ sqliteVdbeAddOp(v, OP_ColumnName, 0, 1); ++ sqliteVdbeChangeP3(v, -1, "rows inserted", P3_STATIC); ++ sqliteVdbeAddOp(v, OP_Callback, 1, 0); ++ } ++ } ++ ++copy_cleanup: ++ sqliteSrcListDelete(pTableName); ++ sqliteFree(zFile); ++ return; ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/date.c +@@ -0,0 +1,881 @@ ++/* ++** 2003 October 31 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This file contains the C functions that implement date and time ++** functions for SQLite. ++** ++** There is only one exported symbol in this file - the function ++** sqliteRegisterDateTimeFunctions() found at the bottom of the file. ++** All other code has file scope. ++** ++** $Id$ ++** ++** NOTES: ++** ++** SQLite processes all times and dates as Julian Day numbers. The ++** dates and times are stored as the number of days since noon ++** in Greenwich on November 24, 4714 B.C. according to the Gregorian ++** calendar system. ++** ++** 1970-01-01 00:00:00 is JD 2440587.5 ++** 2000-01-01 00:00:00 is JD 2451544.5 ++** ++** This implemention requires years to be expressed as a 4-digit number ++** which means that only dates between 0000-01-01 and 9999-12-31 can ++** be represented, even though julian day numbers allow a much wider ++** range of dates. ++** ++** The Gregorian calendar system is used for all dates and times, ++** even those that predate the Gregorian calendar. Historians usually ++** use the Julian calendar for dates prior to 1582-10-15 and for some ++** dates afterwards, depending on locale. Beware of this difference. ++** ++** The conversion algorithms are implemented based on descriptions ++** in the following text: ++** ++** Jean Meeus ++** Astronomical Algorithms, 2nd Edition, 1998 ++** ISBM 0-943396-61-1 ++** Willmann-Bell, Inc ++** Richmond, Virginia (USA) ++*/ ++#include "os.h" ++#include "sqliteInt.h" ++#include ++#include ++#include ++#include ++#ifndef PHP_WIN32 ++#include "main/php_reentrancy.h" ++#endif ++ ++#ifndef SQLITE_OMIT_DATETIME_FUNCS ++ ++/* ++** A structure for holding a single date and time. ++*/ ++typedef struct DateTime DateTime; ++struct DateTime { ++ double rJD; /* The julian day number */ ++ int Y, M, D; /* Year, month, and day */ ++ int h, m; /* Hour and minutes */ ++ int tz; /* Timezone offset in minutes */ ++ double s; /* Seconds */ ++ char validYMD; /* True if Y,M,D are valid */ ++ char validHMS; /* True if h,m,s are valid */ ++ char validJD; /* True if rJD is valid */ ++ char validTZ; /* True if tz is valid */ ++}; ++ ++ ++/* ++** Convert zDate into one or more integers. Additional arguments ++** come in groups of 5 as follows: ++** ++** N number of digits in the integer ++** min minimum allowed value of the integer ++** max maximum allowed value of the integer ++** nextC first character after the integer ++** pVal where to write the integers value. ++** ++** Conversions continue until one with nextC==0 is encountered. ++** The function returns the number of successful conversions. ++*/ ++static int getDigits(const char *zDate, ...){ ++ va_list ap; ++ int val; ++ int N; ++ int min; ++ int max; ++ int nextC; ++ int *pVal; ++ int cnt = 0; ++ va_start(ap, zDate); ++ do{ ++ N = va_arg(ap, int); ++ min = va_arg(ap, int); ++ max = va_arg(ap, int); ++ nextC = va_arg(ap, int); ++ pVal = va_arg(ap, int*); ++ val = 0; ++ while( N-- ){ ++ if( !isdigit(*zDate) ){ ++ return cnt; ++ } ++ val = val*10 + *zDate - '0'; ++ zDate++; ++ } ++ if( valmax || (nextC!=0 && nextC!=*zDate) ){ ++ return cnt; ++ } ++ *pVal = val; ++ zDate++; ++ cnt++; ++ }while( nextC ); ++ return cnt; ++} ++ ++/* ++** Read text from z[] and convert into a floating point number. Return ++** the number of digits converted. ++*/ ++static int getValue(const char *z, double *pR){ ++ const char *zEnd; ++ *pR = sqliteAtoF(z, &zEnd); ++ return zEnd - z; ++} ++ ++/* ++** Parse a timezone extension on the end of a date-time. ++** The extension is of the form: ++** ++** (+/-)HH:MM ++** ++** If the parse is successful, write the number of minutes ++** of change in *pnMin and return 0. If a parser error occurs, ++** return 0. ++** ++** A missing specifier is not considered an error. ++*/ ++static int parseTimezone(const char *zDate, DateTime *p){ ++ int sgn = 0; ++ int nHr, nMn; ++ while( isspace(*zDate) ){ zDate++; } ++ p->tz = 0; ++ if( *zDate=='-' ){ ++ sgn = -1; ++ }else if( *zDate=='+' ){ ++ sgn = +1; ++ }else{ ++ return *zDate!=0; ++ } ++ zDate++; ++ if( getDigits(zDate, 2, 0, 14, ':', &nHr, 2, 0, 59, 0, &nMn)!=2 ){ ++ return 1; ++ } ++ zDate += 5; ++ p->tz = sgn*(nMn + nHr*60); ++ while( isspace(*zDate) ){ zDate++; } ++ return *zDate!=0; ++} ++ ++/* ++** Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF. ++** The HH, MM, and SS must each be exactly 2 digits. The ++** fractional seconds FFFF can be one or more digits. ++** ++** Return 1 if there is a parsing error and 0 on success. ++*/ ++static int parseHhMmSs(const char *zDate, DateTime *p){ ++ int h, m, s; ++ double ms = 0.0; ++ if( getDigits(zDate, 2, 0, 24, ':', &h, 2, 0, 59, 0, &m)!=2 ){ ++ return 1; ++ } ++ zDate += 5; ++ if( *zDate==':' ){ ++ zDate++; ++ if( getDigits(zDate, 2, 0, 59, 0, &s)!=1 ){ ++ return 1; ++ } ++ zDate += 2; ++ if( *zDate=='.' && isdigit(zDate[1]) ){ ++ double rScale = 1.0; ++ zDate++; ++ while( isdigit(*zDate) ){ ++ ms = ms*10.0 + *zDate - '0'; ++ rScale *= 10.0; ++ zDate++; ++ } ++ ms /= rScale; ++ } ++ }else{ ++ s = 0; ++ } ++ p->validJD = 0; ++ p->validHMS = 1; ++ p->h = h; ++ p->m = m; ++ p->s = s + ms; ++ if( parseTimezone(zDate, p) ) return 1; ++ p->validTZ = p->tz!=0; ++ return 0; ++} ++ ++/* ++** Convert from YYYY-MM-DD HH:MM:SS to julian day. We always assume ++** that the YYYY-MM-DD is according to the Gregorian calendar. ++** ++** Reference: Meeus page 61 ++*/ ++static void computeJD(DateTime *p){ ++ int Y, M, D, A, B, X1, X2; ++ ++ if( p->validJD ) return; ++ if( p->validYMD ){ ++ Y = p->Y; ++ M = p->M; ++ D = p->D; ++ }else{ ++ Y = 2000; /* If no YMD specified, assume 2000-Jan-01 */ ++ M = 1; ++ D = 1; ++ } ++ if( M<=2 ){ ++ Y--; ++ M += 12; ++ } ++ A = Y/100; ++ B = 2 - A + (A/4); ++ X1 = 365.25*(Y+4716); ++ X2 = 30.6001*(M+1); ++ p->rJD = X1 + X2 + D + B - 1524.5; ++ p->validJD = 1; ++ p->validYMD = 0; ++ if( p->validHMS ){ ++ p->rJD += (p->h*3600.0 + p->m*60.0 + p->s)/86400.0; ++ if( p->validTZ ){ ++ p->rJD += p->tz*60/86400.0; ++ p->validHMS = 0; ++ p->validTZ = 0; ++ } ++ } ++} ++ ++/* ++** Parse dates of the form ++** ++** YYYY-MM-DD HH:MM:SS.FFF ++** YYYY-MM-DD HH:MM:SS ++** YYYY-MM-DD HH:MM ++** YYYY-MM-DD ++** ++** Write the result into the DateTime structure and return 0 ++** on success and 1 if the input string is not a well-formed ++** date. ++*/ ++static int parseYyyyMmDd(const char *zDate, DateTime *p){ ++ int Y, M, D, neg; ++ ++ if( zDate[0]=='-' ){ ++ zDate++; ++ neg = 1; ++ }else{ ++ neg = 0; ++ } ++ if( getDigits(zDate,4,0,9999,'-',&Y,2,1,12,'-',&M,2,1,31,0,&D)!=3 ){ ++ return 1; ++ } ++ zDate += 10; ++ while( isspace(*zDate) ){ zDate++; } ++ if( parseHhMmSs(zDate, p)==0 ){ ++ /* We got the time */ ++ }else if( *zDate==0 ){ ++ p->validHMS = 0; ++ }else{ ++ return 1; ++ } ++ p->validJD = 0; ++ p->validYMD = 1; ++ p->Y = neg ? -Y : Y; ++ p->M = M; ++ p->D = D; ++ if( p->validTZ ){ ++ computeJD(p); ++ } ++ return 0; ++} ++ ++/* ++** Attempt to parse the given string into a Julian Day Number. Return ++** the number of errors. ++** ++** The following are acceptable forms for the input string: ++** ++** YYYY-MM-DD HH:MM:SS.FFF +/-HH:MM ++** DDDD.DD ++** now ++** ++** In the first form, the +/-HH:MM is always optional. The fractional ++** seconds extension (the ".FFF") is optional. The seconds portion ++** (":SS.FFF") is option. The year and date can be omitted as long ++** as there is a time string. The time string can be omitted as long ++** as there is a year and date. ++*/ ++static int parseDateOrTime(const char *zDate, DateTime *p){ ++ memset(p, 0, sizeof(*p)); ++ if( parseYyyyMmDd(zDate,p)==0 ){ ++ return 0; ++ }else if( parseHhMmSs(zDate, p)==0 ){ ++ return 0; ++ }else if( sqliteStrICmp(zDate,"now")==0){ ++ double r; ++ if( sqliteOsCurrentTime(&r)==0 ){ ++ p->rJD = r; ++ p->validJD = 1; ++ return 0; ++ } ++ return 1; ++ }else if( sqliteIsNumber(zDate) ){ ++ p->rJD = sqliteAtoF(zDate, 0); ++ p->validJD = 1; ++ return 0; ++ } ++ return 1; ++} ++ ++/* ++** Compute the Year, Month, and Day from the julian day number. ++*/ ++static void computeYMD(DateTime *p){ ++ int Z, A, B, C, D, E, X1; ++ if( p->validYMD ) return; ++ if( !p->validJD ){ ++ p->Y = 2000; ++ p->M = 1; ++ p->D = 1; ++ }else{ ++ Z = p->rJD + 0.5; ++ A = (Z - 1867216.25)/36524.25; ++ A = Z + 1 + A - (A/4); ++ B = A + 1524; ++ C = (B - 122.1)/365.25; ++ D = 365.25*C; ++ E = (B-D)/30.6001; ++ X1 = 30.6001*E; ++ p->D = B - D - X1; ++ p->M = E<14 ? E-1 : E-13; ++ p->Y = p->M>2 ? C - 4716 : C - 4715; ++ } ++ p->validYMD = 1; ++} ++ ++/* ++** Compute the Hour, Minute, and Seconds from the julian day number. ++*/ ++static void computeHMS(DateTime *p){ ++ int Z, s; ++ if( p->validHMS ) return; ++ Z = p->rJD + 0.5; ++ s = (p->rJD + 0.5 - Z)*86400000.0 + 0.5; ++ p->s = 0.001*s; ++ s = p->s; ++ p->s -= s; ++ p->h = s/3600; ++ s -= p->h*3600; ++ p->m = s/60; ++ p->s += s - p->m*60; ++ p->validHMS = 1; ++} ++ ++/* ++** Compute both YMD and HMS ++*/ ++static void computeYMD_HMS(DateTime *p){ ++ computeYMD(p); ++ computeHMS(p); ++} ++ ++/* ++** Clear the YMD and HMS and the TZ ++*/ ++static void clearYMD_HMS_TZ(DateTime *p){ ++ p->validYMD = 0; ++ p->validHMS = 0; ++ p->validTZ = 0; ++} ++ ++/* ++** Compute the difference (in days) between localtime and UTC (a.k.a. GMT) ++** for the time value p where p is in UTC. ++*/ ++static double localtimeOffset(DateTime *p){ ++ DateTime x, y; ++ time_t t; ++ struct tm *pTm, tmbuf; ++ x = *p; ++ computeYMD_HMS(&x); ++ if( x.Y<1971 || x.Y>=2038 ){ ++ x.Y = 2000; ++ x.M = 1; ++ x.D = 1; ++ x.h = 0; ++ x.m = 0; ++ x.s = 0.0; ++ } else { ++ int s = x.s + 0.5; ++ x.s = s; ++ } ++ x.tz = 0; ++ x.validJD = 0; ++ computeJD(&x); ++ t = (x.rJD-2440587.5)*86400.0 + 0.5; ++ sqliteOsEnterMutex(); ++ pTm = php_localtime_r(&t, &tmbuf); ++ if (!pTm) { ++ return 0; ++ } ++ y.Y = pTm->tm_year + 1900; ++ y.M = pTm->tm_mon + 1; ++ y.D = pTm->tm_mday; ++ y.h = pTm->tm_hour; ++ y.m = pTm->tm_min; ++ y.s = pTm->tm_sec; ++ sqliteOsLeaveMutex(); ++ y.validYMD = 1; ++ y.validHMS = 1; ++ y.validJD = 0; ++ y.validTZ = 0; ++ computeJD(&y); ++ return y.rJD - x.rJD; ++} ++ ++/* ++** Process a modifier to a date-time stamp. The modifiers are ++** as follows: ++** ++** NNN days ++** NNN hours ++** NNN minutes ++** NNN.NNNN seconds ++** NNN months ++** NNN years ++** start of month ++** start of year ++** start of week ++** start of day ++** weekday N ++** unixepoch ++** localtime ++** utc ++** ++** Return 0 on success and 1 if there is any kind of error. ++*/ ++static int parseModifier(const char *zMod, DateTime *p){ ++ int rc = 1; ++ int n; ++ double r; ++ char *z, zBuf[30]; ++ z = zBuf; ++ for(n=0; nrJD += localtimeOffset(p); ++ clearYMD_HMS_TZ(p); ++ rc = 0; ++ } ++ break; ++ } ++ case 'u': { ++ /* ++ ** unixepoch ++ ** ++ ** Treat the current value of p->rJD as the number of ++ ** seconds since 1970. Convert to a real julian day number. ++ */ ++ if( strcmp(z, "unixepoch")==0 && p->validJD ){ ++ p->rJD = p->rJD/86400.0 + 2440587.5; ++ clearYMD_HMS_TZ(p); ++ rc = 0; ++ }else if( strcmp(z, "utc")==0 ){ ++ double c1; ++ computeJD(p); ++ c1 = localtimeOffset(p); ++ p->rJD -= c1; ++ clearYMD_HMS_TZ(p); ++ p->rJD += c1 - localtimeOffset(p); ++ rc = 0; ++ } ++ break; ++ } ++ case 'w': { ++ /* ++ ** weekday N ++ ** ++ ** Move the date to the same time on the next occurrance of ++ ** weekday N where 0==Sunday, 1==Monday, and so forth. If the ++ ** date is already on the appropriate weekday, this is a no-op. ++ */ ++ if( strncmp(z, "weekday ", 8)==0 && getValue(&z[8],&r)>0 ++ && (n=r)==r && n>=0 && r<7 ){ ++ int Z; ++ computeYMD_HMS(p); ++ p->validTZ = 0; ++ p->validJD = 0; ++ computeJD(p); ++ Z = p->rJD + 1.5; ++ Z %= 7; ++ if( Z>n ) Z -= 7; ++ p->rJD += n - Z; ++ clearYMD_HMS_TZ(p); ++ rc = 0; ++ } ++ break; ++ } ++ case 's': { ++ /* ++ ** start of TTTTT ++ ** ++ ** Move the date backwards to the beginning of the current day, ++ ** or month or year. ++ */ ++ if( strncmp(z, "start of ", 9)!=0 ) break; ++ z += 9; ++ computeYMD(p); ++ p->validHMS = 1; ++ p->h = p->m = 0; ++ p->s = 0.0; ++ p->validTZ = 0; ++ p->validJD = 0; ++ if( strcmp(z,"month")==0 ){ ++ p->D = 1; ++ rc = 0; ++ }else if( strcmp(z,"year")==0 ){ ++ computeYMD(p); ++ p->M = 1; ++ p->D = 1; ++ rc = 0; ++ }else if( strcmp(z,"day")==0 ){ ++ rc = 0; ++ } ++ break; ++ } ++ case '+': ++ case '-': ++ case '0': ++ case '1': ++ case '2': ++ case '3': ++ case '4': ++ case '5': ++ case '6': ++ case '7': ++ case '8': ++ case '9': { ++ n = getValue(z, &r); ++ if( n<=0 ) break; ++ if( z[n]==':' ){ ++ /* A modifier of the form (+|-)HH:MM:SS.FFF adds (or subtracts) the ++ ** specified number of hours, minutes, seconds, and fractional seconds ++ ** to the time. The ".FFF" may be omitted. The ":SS.FFF" may be ++ ** omitted. ++ */ ++ const char *z2 = z; ++ DateTime tx; ++ int day; ++ if( !isdigit(*z2) ) z2++; ++ memset(&tx, 0, sizeof(tx)); ++ if( parseHhMmSs(z2, &tx) ) break; ++ computeJD(&tx); ++ tx.rJD -= 0.5; ++ day = (int)tx.rJD; ++ tx.rJD -= day; ++ if( z[0]=='-' ) tx.rJD = -tx.rJD; ++ computeJD(p); ++ clearYMD_HMS_TZ(p); ++ p->rJD += tx.rJD; ++ rc = 0; ++ break; ++ } ++ z += n; ++ while( isspace(z[0]) ) z++; ++ n = strlen(z); ++ if( n>10 || n<3 ) break; ++ if( z[n-1]=='s' ){ z[n-1] = 0; n--; } ++ computeJD(p); ++ rc = 0; ++ if( n==3 && strcmp(z,"day")==0 ){ ++ p->rJD += r; ++ }else if( n==4 && strcmp(z,"hour")==0 ){ ++ p->rJD += r/24.0; ++ }else if( n==6 && strcmp(z,"minute")==0 ){ ++ p->rJD += r/(24.0*60.0); ++ }else if( n==6 && strcmp(z,"second")==0 ){ ++ p->rJD += r/(24.0*60.0*60.0); ++ }else if( n==5 && strcmp(z,"month")==0 ){ ++ int x, y; ++ computeYMD_HMS(p); ++ p->M += r; ++ x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12; ++ p->Y += x; ++ p->M -= x*12; ++ p->validJD = 0; ++ computeJD(p); ++ y = r; ++ if( y!=r ){ ++ p->rJD += (r - y)*30.0; ++ } ++ }else if( n==4 && strcmp(z,"year")==0 ){ ++ computeYMD_HMS(p); ++ p->Y += r; ++ p->validJD = 0; ++ computeJD(p); ++ }else{ ++ rc = 1; ++ } ++ clearYMD_HMS_TZ(p); ++ break; ++ } ++ default: { ++ break; ++ } ++ } ++ return rc; ++} ++ ++/* ++** Process time function arguments. argv[0] is a date-time stamp. ++** argv[1] and following are modifiers. Parse them all and write ++** the resulting time into the DateTime structure p. Return 0 ++** on success and 1 if there are any errors. ++*/ ++static int isDate(int argc, const char **argv, DateTime *p){ ++ int i; ++ if( argc==0 ) return 1; ++ if( argv[0]==0 || parseDateOrTime(argv[0], p) ) return 1; ++ for(i=1; izErrMsg and return NULL. If all tables ++** are found, return a pointer to the last table. ++*/ ++Table *sqliteSrcListLookup(Parse *pParse, SrcList *pSrc){ ++ Table *pTab = 0; ++ int i; ++ for(i=0; inSrc; i++){ ++ const char *zTab = pSrc->a[i].zName; ++ const char *zDb = pSrc->a[i].zDatabase; ++ pTab = sqliteLocateTable(pParse, zTab, zDb); ++ pSrc->a[i].pTab = pTab; ++ } ++ return pTab; ++} ++ ++/* ++** Check to make sure the given table is writable. If it is not ++** writable, generate an error message and return 1. If it is ++** writable return 0; ++*/ ++int sqliteIsReadOnly(Parse *pParse, Table *pTab, int viewOk){ ++ if( pTab->readOnly ){ ++ sqliteErrorMsg(pParse, "table %s may not be modified", pTab->zName); ++ return 1; ++ } ++ if( !viewOk && pTab->pSelect ){ ++ sqliteErrorMsg(pParse, "cannot modify %s because it is a view",pTab->zName); ++ return 1; ++ } ++ return 0; ++} ++ ++/* ++** Process a DELETE FROM statement. ++*/ ++void sqliteDeleteFrom( ++ Parse *pParse, /* The parser context */ ++ SrcList *pTabList, /* The table from which we should delete things */ ++ Expr *pWhere /* The WHERE clause. May be null */ ++){ ++ Vdbe *v; /* The virtual database engine */ ++ Table *pTab; /* The table from which records will be deleted */ ++ const char *zDb; /* Name of database holding pTab */ ++ int end, addr; /* A couple addresses of generated code */ ++ int i; /* Loop counter */ ++ WhereInfo *pWInfo; /* Information about the WHERE clause */ ++ Index *pIdx; /* For looping over indices of the table */ ++ int iCur; /* VDBE Cursor number for pTab */ ++ sqlite *db; /* Main database structure */ ++ int isView; /* True if attempting to delete from a view */ ++ AuthContext sContext; /* Authorization context */ ++ ++ int row_triggers_exist = 0; /* True if any triggers exist */ ++ int before_triggers; /* True if there are BEFORE triggers */ ++ int after_triggers; /* True if there are AFTER triggers */ ++ int oldIdx = -1; /* Cursor for the OLD table of AFTER triggers */ ++ ++ sContext.pParse = 0; ++ if( pParse->nErr || sqlite_malloc_failed ){ ++ pTabList = 0; ++ goto delete_from_cleanup; ++ } ++ db = pParse->db; ++ assert( pTabList->nSrc==1 ); ++ ++ /* Locate the table which we want to delete. This table has to be ++ ** put in an SrcList structure because some of the subroutines we ++ ** will be calling are designed to work with multiple tables and expect ++ ** an SrcList* parameter instead of just a Table* parameter. ++ */ ++ pTab = sqliteSrcListLookup(pParse, pTabList); ++ if( pTab==0 ) goto delete_from_cleanup; ++ before_triggers = sqliteTriggersExist(pParse, pTab->pTrigger, ++ TK_DELETE, TK_BEFORE, TK_ROW, 0); ++ after_triggers = sqliteTriggersExist(pParse, pTab->pTrigger, ++ TK_DELETE, TK_AFTER, TK_ROW, 0); ++ row_triggers_exist = before_triggers || after_triggers; ++ isView = pTab->pSelect!=0; ++ if( sqliteIsReadOnly(pParse, pTab, before_triggers) ){ ++ goto delete_from_cleanup; ++ } ++ assert( pTab->iDbnDb ); ++ zDb = db->aDb[pTab->iDb].zName; ++ if( sqliteAuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){ ++ goto delete_from_cleanup; ++ } ++ ++ /* If pTab is really a view, make sure it has been initialized. ++ */ ++ if( isView && sqliteViewGetColumnNames(pParse, pTab) ){ ++ goto delete_from_cleanup; ++ } ++ ++ /* Allocate a cursor used to store the old.* data for a trigger. ++ */ ++ if( row_triggers_exist ){ ++ oldIdx = pParse->nTab++; ++ } ++ ++ /* Resolve the column names in all the expressions. ++ */ ++ assert( pTabList->nSrc==1 ); ++ iCur = pTabList->a[0].iCursor = pParse->nTab++; ++ if( pWhere ){ ++ if( sqliteExprResolveIds(pParse, pTabList, 0, pWhere) ){ ++ goto delete_from_cleanup; ++ } ++ if( sqliteExprCheck(pParse, pWhere, 0, 0) ){ ++ goto delete_from_cleanup; ++ } ++ } ++ ++ /* Start the view context ++ */ ++ if( isView ){ ++ sqliteAuthContextPush(pParse, &sContext, pTab->zName); ++ } ++ ++ /* Begin generating code. ++ */ ++ v = sqliteGetVdbe(pParse); ++ if( v==0 ){ ++ goto delete_from_cleanup; ++ } ++ sqliteBeginWriteOperation(pParse, row_triggers_exist, pTab->iDb); ++ ++ /* If we are trying to delete from a view, construct that view into ++ ** a temporary table. ++ */ ++ if( isView ){ ++ Select *pView = sqliteSelectDup(pTab->pSelect); ++ sqliteSelect(pParse, pView, SRT_TempTable, iCur, 0, 0, 0); ++ sqliteSelectDelete(pView); ++ } ++ ++ /* Initialize the counter of the number of rows deleted, if ++ ** we are counting rows. ++ */ ++ if( db->flags & SQLITE_CountRows ){ ++ sqliteVdbeAddOp(v, OP_Integer, 0, 0); ++ } ++ ++ /* Special case: A DELETE without a WHERE clause deletes everything. ++ ** It is easier just to erase the whole table. Note, however, that ++ ** this means that the row change count will be incorrect. ++ */ ++ if( pWhere==0 && !row_triggers_exist ){ ++ if( db->flags & SQLITE_CountRows ){ ++ /* If counting rows deleted, just count the total number of ++ ** entries in the table. */ ++ int endOfLoop = sqliteVdbeMakeLabel(v); ++ int addr; ++ if( !isView ){ ++ sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0); ++ sqliteVdbeAddOp(v, OP_OpenRead, iCur, pTab->tnum); ++ } ++ sqliteVdbeAddOp(v, OP_Rewind, iCur, sqliteVdbeCurrentAddr(v)+2); ++ addr = sqliteVdbeAddOp(v, OP_AddImm, 1, 0); ++ sqliteVdbeAddOp(v, OP_Next, iCur, addr); ++ sqliteVdbeResolveLabel(v, endOfLoop); ++ sqliteVdbeAddOp(v, OP_Close, iCur, 0); ++ } ++ if( !isView ){ ++ sqliteVdbeAddOp(v, OP_Clear, pTab->tnum, pTab->iDb); ++ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ ++ sqliteVdbeAddOp(v, OP_Clear, pIdx->tnum, pIdx->iDb); ++ } ++ } ++ } ++ ++ /* The usual case: There is a WHERE clause so we have to scan through ++ ** the table and pick which records to delete. ++ */ ++ else{ ++ /* Begin the database scan ++ */ ++ pWInfo = sqliteWhereBegin(pParse, pTabList, pWhere, 1, 0); ++ if( pWInfo==0 ) goto delete_from_cleanup; ++ ++ /* Remember the key of every item to be deleted. ++ */ ++ sqliteVdbeAddOp(v, OP_ListWrite, 0, 0); ++ if( db->flags & SQLITE_CountRows ){ ++ sqliteVdbeAddOp(v, OP_AddImm, 1, 0); ++ } ++ ++ /* End the database scan loop. ++ */ ++ sqliteWhereEnd(pWInfo); ++ ++ /* Open the pseudo-table used to store OLD if there are triggers. ++ */ ++ if( row_triggers_exist ){ ++ sqliteVdbeAddOp(v, OP_OpenPseudo, oldIdx, 0); ++ } ++ ++ /* Delete every item whose key was written to the list during the ++ ** database scan. We have to delete items after the scan is complete ++ ** because deleting an item can change the scan order. ++ */ ++ sqliteVdbeAddOp(v, OP_ListRewind, 0, 0); ++ end = sqliteVdbeMakeLabel(v); ++ ++ /* This is the beginning of the delete loop when there are ++ ** row triggers. ++ */ ++ if( row_triggers_exist ){ ++ addr = sqliteVdbeAddOp(v, OP_ListRead, 0, end); ++ sqliteVdbeAddOp(v, OP_Dup, 0, 0); ++ if( !isView ){ ++ sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0); ++ sqliteVdbeAddOp(v, OP_OpenRead, iCur, pTab->tnum); ++ } ++ sqliteVdbeAddOp(v, OP_MoveTo, iCur, 0); ++ ++ sqliteVdbeAddOp(v, OP_Recno, iCur, 0); ++ sqliteVdbeAddOp(v, OP_RowData, iCur, 0); ++ sqliteVdbeAddOp(v, OP_PutIntKey, oldIdx, 0); ++ if( !isView ){ ++ sqliteVdbeAddOp(v, OP_Close, iCur, 0); ++ } ++ ++ sqliteCodeRowTrigger(pParse, TK_DELETE, 0, TK_BEFORE, pTab, -1, ++ oldIdx, (pParse->trigStack)?pParse->trigStack->orconf:OE_Default, ++ addr); ++ } ++ ++ if( !isView ){ ++ /* Open cursors for the table we are deleting from and all its ++ ** indices. If there are row triggers, this happens inside the ++ ** OP_ListRead loop because the cursor have to all be closed ++ ** before the trigger fires. If there are no row triggers, the ++ ** cursors are opened only once on the outside the loop. ++ */ ++ pParse->nTab = iCur + 1; ++ sqliteOpenTableAndIndices(pParse, pTab, iCur); ++ ++ /* This is the beginning of the delete loop when there are no ++ ** row triggers */ ++ if( !row_triggers_exist ){ ++ addr = sqliteVdbeAddOp(v, OP_ListRead, 0, end); ++ } ++ ++ /* Delete the row */ ++ sqliteGenerateRowDelete(db, v, pTab, iCur, pParse->trigStack==0); ++ } ++ ++ /* If there are row triggers, close all cursors then invoke ++ ** the AFTER triggers ++ */ ++ if( row_triggers_exist ){ ++ if( !isView ){ ++ for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){ ++ sqliteVdbeAddOp(v, OP_Close, iCur + i, pIdx->tnum); ++ } ++ sqliteVdbeAddOp(v, OP_Close, iCur, 0); ++ } ++ sqliteCodeRowTrigger(pParse, TK_DELETE, 0, TK_AFTER, pTab, -1, ++ oldIdx, (pParse->trigStack)?pParse->trigStack->orconf:OE_Default, ++ addr); ++ } ++ ++ /* End of the delete loop */ ++ sqliteVdbeAddOp(v, OP_Goto, 0, addr); ++ sqliteVdbeResolveLabel(v, end); ++ sqliteVdbeAddOp(v, OP_ListReset, 0, 0); ++ ++ /* Close the cursors after the loop if there are no row triggers */ ++ if( !row_triggers_exist ){ ++ for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){ ++ sqliteVdbeAddOp(v, OP_Close, iCur + i, pIdx->tnum); ++ } ++ sqliteVdbeAddOp(v, OP_Close, iCur, 0); ++ pParse->nTab = iCur; ++ } ++ } ++ sqliteVdbeAddOp(v, OP_SetCounts, 0, 0); ++ sqliteEndWriteOperation(pParse); ++ ++ /* ++ ** Return the number of rows that were deleted. ++ */ ++ if( db->flags & SQLITE_CountRows ){ ++ sqliteVdbeAddOp(v, OP_ColumnName, 0, 1); ++ sqliteVdbeChangeP3(v, -1, "rows deleted", P3_STATIC); ++ sqliteVdbeAddOp(v, OP_Callback, 1, 0); ++ } ++ ++delete_from_cleanup: ++ sqliteAuthContextPop(&sContext); ++ sqliteSrcListDelete(pTabList); ++ sqliteExprDelete(pWhere); ++ return; ++} ++ ++/* ++** This routine generates VDBE code that causes a single row of a ++** single table to be deleted. ++** ++** The VDBE must be in a particular state when this routine is called. ++** These are the requirements: ++** ++** 1. A read/write cursor pointing to pTab, the table containing the row ++** to be deleted, must be opened as cursor number "base". ++** ++** 2. Read/write cursors for all indices of pTab must be open as ++** cursor number base+i for the i-th index. ++** ++** 3. The record number of the row to be deleted must be on the top ++** of the stack. ++** ++** This routine pops the top of the stack to remove the record number ++** and then generates code to remove both the table record and all index ++** entries that point to that record. ++*/ ++void sqliteGenerateRowDelete( ++ sqlite *db, /* The database containing the index */ ++ Vdbe *v, /* Generate code into this VDBE */ ++ Table *pTab, /* Table containing the row to be deleted */ ++ int iCur, /* Cursor number for the table */ ++ int count /* Increment the row change counter */ ++){ ++ int addr; ++ addr = sqliteVdbeAddOp(v, OP_NotExists, iCur, 0); ++ sqliteGenerateRowIndexDelete(db, v, pTab, iCur, 0); ++ sqliteVdbeAddOp(v, OP_Delete, iCur, ++ (count?OPFLAG_NCHANGE:0) | OPFLAG_CSCHANGE); ++ sqliteVdbeChangeP2(v, addr, sqliteVdbeCurrentAddr(v)); ++} ++ ++/* ++** This routine generates VDBE code that causes the deletion of all ++** index entries associated with a single row of a single table. ++** ++** The VDBE must be in a particular state when this routine is called. ++** These are the requirements: ++** ++** 1. A read/write cursor pointing to pTab, the table containing the row ++** to be deleted, must be opened as cursor number "iCur". ++** ++** 2. Read/write cursors for all indices of pTab must be open as ++** cursor number iCur+i for the i-th index. ++** ++** 3. The "iCur" cursor must be pointing to the row that is to be ++** deleted. ++*/ ++void sqliteGenerateRowIndexDelete( ++ sqlite *db, /* The database containing the index */ ++ Vdbe *v, /* Generate code into this VDBE */ ++ Table *pTab, /* Table containing the row to be deleted */ ++ int iCur, /* Cursor number for the table */ ++ char *aIdxUsed /* Only delete if aIdxUsed!=0 && aIdxUsed[i]!=0 */ ++){ ++ int i; ++ Index *pIdx; ++ ++ for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){ ++ int j; ++ if( aIdxUsed!=0 && aIdxUsed[i-1]==0 ) continue; ++ sqliteVdbeAddOp(v, OP_Recno, iCur, 0); ++ for(j=0; jnColumn; j++){ ++ int idx = pIdx->aiColumn[j]; ++ if( idx==pTab->iPKey ){ ++ sqliteVdbeAddOp(v, OP_Dup, j, 0); ++ }else{ ++ sqliteVdbeAddOp(v, OP_Column, iCur, idx); ++ } ++ } ++ sqliteVdbeAddOp(v, OP_MakeIdxKey, pIdx->nColumn, 0); ++ if( db->file_format>=4 ) sqliteAddIdxKeyType(v, pIdx); ++ sqliteVdbeAddOp(v, OP_IdxDelete, iCur+i, 0); ++ } ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/encode.c +@@ -0,0 +1,257 @@ ++/* ++** 2002 April 25 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This file contains helper routines used to translate binary data into ++** a null-terminated string (suitable for use in SQLite) and back again. ++** These are convenience routines for use by people who want to store binary ++** data in an SQLite database. The code in this file is not used by any other ++** part of the SQLite library. ++** ++** $Id$ ++*/ ++#include ++#include ++ ++/* ++** How This Encoder Works ++** ++** The output is allowed to contain any character except 0x27 (') and ++** 0x00. This is accomplished by using an escape character to encode ++** 0x27 and 0x00 as a two-byte sequence. The escape character is always ++** 0x01. An 0x00 is encoded as the two byte sequence 0x01 0x01. The ++** 0x27 character is encoded as the two byte sequence 0x01 0x28. Finally, ++** the escape character itself is encoded as the two-character sequence ++** 0x01 0x02. ++** ++** To summarize, the encoder works by using an escape sequences as follows: ++** ++** 0x00 -> 0x01 0x01 ++** 0x01 -> 0x01 0x02 ++** 0x27 -> 0x01 0x28 ++** ++** If that were all the encoder did, it would work, but in certain cases ++** it could double the size of the encoded string. For example, to ++** encode a string of 100 0x27 characters would require 100 instances of ++** the 0x01 0x03 escape sequence resulting in a 200-character output. ++** We would prefer to keep the size of the encoded string smaller than ++** this. ++** ++** To minimize the encoding size, we first add a fixed offset value to each ++** byte in the sequence. The addition is modulo 256. (That is to say, if ++** the sum of the original character value and the offset exceeds 256, then ++** the higher order bits are truncated.) The offset is chosen to minimize ++** the number of characters in the string that need to be escaped. For ++** example, in the case above where the string was composed of 100 0x27 ++** characters, the offset might be 0x01. Each of the 0x27 characters would ++** then be converted into an 0x28 character which would not need to be ++** escaped at all and so the 100 character input string would be converted ++** into just 100 characters of output. Actually 101 characters of output - ++** we have to record the offset used as the first byte in the sequence so ++** that the string can be decoded. Since the offset value is stored as ++** part of the output string and the output string is not allowed to contain ++** characters 0x00 or 0x27, the offset cannot be 0x00 or 0x27. ++** ++** Here, then, are the encoding steps: ++** ++** (1) Choose an offset value and make it the first character of ++** output. ++** ++** (2) Copy each input character into the output buffer, one by ++** one, adding the offset value as you copy. ++** ++** (3) If the value of an input character plus offset is 0x00, replace ++** that one character by the two-character sequence 0x01 0x01. ++** If the sum is 0x01, replace it with 0x01 0x02. If the sum ++** is 0x27, replace it with 0x01 0x03. ++** ++** (4) Put a 0x00 terminator at the end of the output. ++** ++** Decoding is obvious: ++** ++** (5) Copy encoded characters except the first into the decode ++** buffer. Set the first encoded character aside for use as ++** the offset in step 7 below. ++** ++** (6) Convert each 0x01 0x01 sequence into a single character 0x00. ++** Convert 0x01 0x02 into 0x01. Convert 0x01 0x28 into 0x27. ++** ++** (7) Subtract the offset value that was the first character of ++** the encoded buffer from all characters in the output buffer. ++** ++** The only tricky part is step (1) - how to compute an offset value to ++** minimize the size of the output buffer. This is accomplished by testing ++** all offset values and picking the one that results in the fewest number ++** of escapes. To do that, we first scan the entire input and count the ++** number of occurances of each character value in the input. Suppose ++** the number of 0x00 characters is N(0), the number of occurances of 0x01 ++** is N(1), and so forth up to the number of occurances of 0xff is N(255). ++** An offset of 0 is not allowed so we don't have to test it. The number ++** of escapes required for an offset of 1 is N(1)+N(2)+N(40). The number ++** of escapes required for an offset of 2 is N(2)+N(3)+N(41). And so forth. ++** In this way we find the offset that gives the minimum number of escapes, ++** and thus minimizes the length of the output string. ++*/ ++ ++/* ++** Encode a binary buffer "in" of size n bytes so that it contains ++** no instances of characters '\'' or '\000'. The output is ++** null-terminated and can be used as a string value in an INSERT ++** or UPDATE statement. Use sqlite_decode_binary() to convert the ++** string back into its original binary. ++** ++** The result is written into a preallocated output buffer "out". ++** "out" must be able to hold at least 2 +(257*n)/254 bytes. ++** In other words, the output will be expanded by as much as 3 ++** bytes for every 254 bytes of input plus 2 bytes of fixed overhead. ++** (This is approximately 2 + 1.0118*n or about a 1.2% size increase.) ++** ++** The return value is the number of characters in the encoded ++** string, excluding the "\000" terminator. ++** ++** If out==NULL then no output is generated but the routine still returns ++** the number of characters that would have been generated if out had ++** not been NULL. ++*/ ++int sqlite_encode_binary(const unsigned char *in, int n, unsigned char *out){ ++ int i, j, e, m; ++ unsigned char x; ++ int cnt[256]; ++ if( n<=0 ){ ++ if( out ){ ++ out[0] = 'x'; ++ out[1] = 0; ++ } ++ return 1; ++ } ++ memset(cnt, 0, sizeof(cnt)); ++ for(i=n-1; i>=0; i--){ cnt[in[i]]++; } ++ m = n; ++ for(i=1; i<256; i++){ ++ int sum; ++ if( i=='\'' ) continue; ++ sum = cnt[i] + cnt[(i+1)&0xff] + cnt[(i+'\'')&0xff]; ++ if( sum ++/* ++** The subroutines above are not tested by the usual test suite. To test ++** these routines, compile just this one file with a -DENCODER_TEST=1 option ++** and run the result. ++*/ ++int main(int argc, char **argv){ ++ int i, j, n, m, nOut, nByteIn, nByteOut; ++ unsigned char in[30000]; ++ unsigned char out[33000]; ++ ++ nByteIn = nByteOut = 0; ++ for(i=0; i%d (max %d)", n, strlen(out)+1, m); ++ if( strlen(out)+1>m ){ ++ printf(" ERROR output too big\n"); ++ exit(1); ++ } ++ for(j=0; out[j]; j++){ ++ if( out[j]=='\'' ){ ++ printf(" ERROR contains (')\n"); ++ exit(1); ++ } ++ } ++ j = sqlite_decode_binary(out, out); ++ if( j!=n ){ ++ printf(" ERROR decode size %d\n", j); ++ exit(1); ++ } ++ if( memcmp(in, out, n)!=0 ){ ++ printf(" ERROR decode mismatch\n"); ++ exit(1); ++ } ++ printf(" OK\n"); ++ } ++ fprintf(stderr,"Finished. Total encoding: %d->%d bytes\n", ++ nByteIn, nByteOut); ++ fprintf(stderr,"Avg size increase: %.3f%%\n", ++ (nByteOut-nByteIn)*100.0/(double)nByteIn); ++} ++#endif /* ENCODER_TEST */ +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/expr.c +@@ -0,0 +1,1662 @@ ++/* ++** 2001 September 15 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This file contains routines used for analyzing expressions and ++** for generating VDBE code that evaluates expressions in SQLite. ++** ++** $Id$ ++*/ ++#include "sqliteInt.h" ++#include ++ ++/* ++** Construct a new expression node and return a pointer to it. Memory ++** for this node is obtained from sqliteMalloc(). The calling function ++** is responsible for making sure the node eventually gets freed. ++*/ ++Expr *sqliteExpr(int op, Expr *pLeft, Expr *pRight, Token *pToken){ ++ Expr *pNew; ++ pNew = sqliteMalloc( sizeof(Expr) ); ++ if( pNew==0 ){ ++ /* When malloc fails, we leak memory from pLeft and pRight */ ++ return 0; ++ } ++ pNew->op = op; ++ pNew->pLeft = pLeft; ++ pNew->pRight = pRight; ++ if( pToken ){ ++ assert( pToken->dyn==0 ); ++ pNew->token = *pToken; ++ pNew->span = *pToken; ++ }else{ ++ assert( pNew->token.dyn==0 ); ++ assert( pNew->token.z==0 ); ++ assert( pNew->token.n==0 ); ++ if( pLeft && pRight ){ ++ sqliteExprSpan(pNew, &pLeft->span, &pRight->span); ++ }else{ ++ pNew->span = pNew->token; ++ } ++ } ++ return pNew; ++} ++ ++/* ++** Set the Expr.span field of the given expression to span all ++** text between the two given tokens. ++*/ ++void sqliteExprSpan(Expr *pExpr, Token *pLeft, Token *pRight){ ++ assert( pRight!=0 ); ++ assert( pLeft!=0 ); ++ /* Note: pExpr might be NULL due to a prior malloc failure */ ++ if( pExpr && pRight->z && pLeft->z ){ ++ if( pLeft->dyn==0 && pRight->dyn==0 ){ ++ pExpr->span.z = pLeft->z; ++ pExpr->span.n = pRight->n + Addr(pRight->z) - Addr(pLeft->z); ++ }else{ ++ pExpr->span.z = 0; ++ } ++ } ++} ++ ++/* ++** Construct a new expression node for a function with multiple ++** arguments. ++*/ ++Expr *sqliteExprFunction(ExprList *pList, Token *pToken){ ++ Expr *pNew; ++ pNew = sqliteMalloc( sizeof(Expr) ); ++ if( pNew==0 ){ ++ /* sqliteExprListDelete(pList); // Leak pList when malloc fails */ ++ return 0; ++ } ++ pNew->op = TK_FUNCTION; ++ pNew->pList = pList; ++ if( pToken ){ ++ assert( pToken->dyn==0 ); ++ pNew->token = *pToken; ++ }else{ ++ pNew->token.z = 0; ++ } ++ pNew->span = pNew->token; ++ return pNew; ++} ++ ++/* ++** Recursively delete an expression tree. ++*/ ++void sqliteExprDelete(Expr *p){ ++ if( p==0 ) return; ++ if( p->span.dyn ) sqliteFree((char*)p->span.z); ++ if( p->token.dyn ) sqliteFree((char*)p->token.z); ++ sqliteExprDelete(p->pLeft); ++ sqliteExprDelete(p->pRight); ++ sqliteExprListDelete(p->pList); ++ sqliteSelectDelete(p->pSelect); ++ sqliteFree(p); ++} ++ ++ ++/* ++** The following group of routines make deep copies of expressions, ++** expression lists, ID lists, and select statements. The copies can ++** be deleted (by being passed to their respective ...Delete() routines) ++** without effecting the originals. ++** ++** The expression list, ID, and source lists return by sqliteExprListDup(), ++** sqliteIdListDup(), and sqliteSrcListDup() can not be further expanded ++** by subsequent calls to sqlite*ListAppend() routines. ++** ++** Any tables that the SrcList might point to are not duplicated. ++*/ ++Expr *sqliteExprDup(Expr *p){ ++ Expr *pNew; ++ if( p==0 ) return 0; ++ pNew = sqliteMallocRaw( sizeof(*p) ); ++ if( pNew==0 ) return 0; ++ memcpy(pNew, p, sizeof(*pNew)); ++ if( p->token.z!=0 ){ ++ pNew->token.z = sqliteStrNDup(p->token.z, p->token.n); ++ pNew->token.dyn = 1; ++ }else{ ++ assert( pNew->token.z==0 ); ++ } ++ pNew->span.z = 0; ++ pNew->pLeft = sqliteExprDup(p->pLeft); ++ pNew->pRight = sqliteExprDup(p->pRight); ++ pNew->pList = sqliteExprListDup(p->pList); ++ pNew->pSelect = sqliteSelectDup(p->pSelect); ++ return pNew; ++} ++void sqliteTokenCopy(Token *pTo, Token *pFrom){ ++ if( pTo->dyn ) sqliteFree((char*)pTo->z); ++ if( pFrom->z ){ ++ pTo->n = pFrom->n; ++ pTo->z = sqliteStrNDup(pFrom->z, pFrom->n); ++ pTo->dyn = 1; ++ }else{ ++ pTo->z = 0; ++ } ++} ++ExprList *sqliteExprListDup(ExprList *p){ ++ ExprList *pNew; ++ struct ExprList_item *pItem; ++ int i; ++ if( p==0 ) return 0; ++ pNew = sqliteMalloc( sizeof(*pNew) ); ++ if( pNew==0 ) return 0; ++ pNew->nExpr = pNew->nAlloc = p->nExpr; ++ pNew->a = pItem = sqliteMalloc( p->nExpr*sizeof(p->a[0]) ); ++ if( pItem==0 ){ ++ sqliteFree(pNew); ++ return 0; ++ } ++ for(i=0; inExpr; i++, pItem++){ ++ Expr *pNewExpr, *pOldExpr; ++ pItem->pExpr = pNewExpr = sqliteExprDup(pOldExpr = p->a[i].pExpr); ++ if( pOldExpr->span.z!=0 && pNewExpr ){ ++ /* Always make a copy of the span for top-level expressions in the ++ ** expression list. The logic in SELECT processing that determines ++ ** the names of columns in the result set needs this information */ ++ sqliteTokenCopy(&pNewExpr->span, &pOldExpr->span); ++ } ++ assert( pNewExpr==0 || pNewExpr->span.z!=0 ++ || pOldExpr->span.z==0 || sqlite_malloc_failed ); ++ pItem->zName = sqliteStrDup(p->a[i].zName); ++ pItem->sortOrder = p->a[i].sortOrder; ++ pItem->isAgg = p->a[i].isAgg; ++ pItem->done = 0; ++ } ++ return pNew; ++} ++SrcList *sqliteSrcListDup(SrcList *p){ ++ SrcList *pNew; ++ int i; ++ int nByte; ++ if( p==0 ) return 0; ++ nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0); ++ pNew = sqliteMallocRaw( nByte ); ++ if( pNew==0 ) return 0; ++ pNew->nSrc = pNew->nAlloc = p->nSrc; ++ for(i=0; inSrc; i++){ ++ struct SrcList_item *pNewItem = &pNew->a[i]; ++ struct SrcList_item *pOldItem = &p->a[i]; ++ pNewItem->zDatabase = sqliteStrDup(pOldItem->zDatabase); ++ pNewItem->zName = sqliteStrDup(pOldItem->zName); ++ pNewItem->zAlias = sqliteStrDup(pOldItem->zAlias); ++ pNewItem->jointype = pOldItem->jointype; ++ pNewItem->iCursor = pOldItem->iCursor; ++ pNewItem->pTab = 0; ++ pNewItem->pSelect = sqliteSelectDup(pOldItem->pSelect); ++ pNewItem->pOn = sqliteExprDup(pOldItem->pOn); ++ pNewItem->pUsing = sqliteIdListDup(pOldItem->pUsing); ++ } ++ return pNew; ++} ++IdList *sqliteIdListDup(IdList *p){ ++ IdList *pNew; ++ int i; ++ if( p==0 ) return 0; ++ pNew = sqliteMallocRaw( sizeof(*pNew) ); ++ if( pNew==0 ) return 0; ++ pNew->nId = pNew->nAlloc = p->nId; ++ pNew->a = sqliteMallocRaw( p->nId*sizeof(p->a[0]) ); ++ if( pNew->a==0 ) return 0; ++ for(i=0; inId; i++){ ++ struct IdList_item *pNewItem = &pNew->a[i]; ++ struct IdList_item *pOldItem = &p->a[i]; ++ pNewItem->zName = sqliteStrDup(pOldItem->zName); ++ pNewItem->idx = pOldItem->idx; ++ } ++ return pNew; ++} ++Select *sqliteSelectDup(Select *p){ ++ Select *pNew; ++ if( p==0 ) return 0; ++ pNew = sqliteMallocRaw( sizeof(*p) ); ++ if( pNew==0 ) return 0; ++ pNew->isDistinct = p->isDistinct; ++ pNew->pEList = sqliteExprListDup(p->pEList); ++ pNew->pSrc = sqliteSrcListDup(p->pSrc); ++ pNew->pWhere = sqliteExprDup(p->pWhere); ++ pNew->pGroupBy = sqliteExprListDup(p->pGroupBy); ++ pNew->pHaving = sqliteExprDup(p->pHaving); ++ pNew->pOrderBy = sqliteExprListDup(p->pOrderBy); ++ pNew->op = p->op; ++ pNew->pPrior = sqliteSelectDup(p->pPrior); ++ pNew->nLimit = p->nLimit; ++ pNew->nOffset = p->nOffset; ++ pNew->zSelect = 0; ++ pNew->iLimit = -1; ++ pNew->iOffset = -1; ++ return pNew; ++} ++ ++ ++/* ++** Add a new element to the end of an expression list. If pList is ++** initially NULL, then create a new expression list. ++*/ ++ExprList *sqliteExprListAppend(ExprList *pList, Expr *pExpr, Token *pName){ ++ if( pList==0 ){ ++ pList = sqliteMalloc( sizeof(ExprList) ); ++ if( pList==0 ){ ++ /* sqliteExprDelete(pExpr); // Leak memory if malloc fails */ ++ return 0; ++ } ++ assert( pList->nAlloc==0 ); ++ } ++ if( pList->nAlloc<=pList->nExpr ){ ++ pList->nAlloc = pList->nAlloc*2 + 4; ++ pList->a = sqliteRealloc(pList->a, pList->nAlloc*sizeof(pList->a[0])); ++ if( pList->a==0 ){ ++ /* sqliteExprDelete(pExpr); // Leak memory if malloc fails */ ++ pList->nExpr = pList->nAlloc = 0; ++ return pList; ++ } ++ } ++ assert( pList->a!=0 ); ++ if( pExpr || pName ){ ++ struct ExprList_item *pItem = &pList->a[pList->nExpr++]; ++ memset(pItem, 0, sizeof(*pItem)); ++ pItem->pExpr = pExpr; ++ if( pName ){ ++ sqliteSetNString(&pItem->zName, pName->z, pName->n, 0); ++ sqliteDequote(pItem->zName); ++ } ++ } ++ return pList; ++} ++ ++/* ++** Delete an entire expression list. ++*/ ++void sqliteExprListDelete(ExprList *pList){ ++ int i; ++ if( pList==0 ) return; ++ assert( pList->a!=0 || (pList->nExpr==0 && pList->nAlloc==0) ); ++ assert( pList->nExpr<=pList->nAlloc ); ++ for(i=0; inExpr; i++){ ++ sqliteExprDelete(pList->a[i].pExpr); ++ sqliteFree(pList->a[i].zName); ++ } ++ sqliteFree(pList->a); ++ sqliteFree(pList); ++} ++ ++/* ++** Walk an expression tree. Return 1 if the expression is constant ++** and 0 if it involves variables. ++** ++** For the purposes of this function, a double-quoted string (ex: "abc") ++** is considered a variable but a single-quoted string (ex: 'abc') is ++** a constant. ++*/ ++int sqliteExprIsConstant(Expr *p){ ++ switch( p->op ){ ++ case TK_ID: ++ case TK_COLUMN: ++ case TK_DOT: ++ case TK_FUNCTION: ++ return 0; ++ case TK_NULL: ++ case TK_STRING: ++ case TK_INTEGER: ++ case TK_FLOAT: ++ case TK_VARIABLE: ++ return 1; ++ default: { ++ if( p->pLeft && !sqliteExprIsConstant(p->pLeft) ) return 0; ++ if( p->pRight && !sqliteExprIsConstant(p->pRight) ) return 0; ++ if( p->pList ){ ++ int i; ++ for(i=0; ipList->nExpr; i++){ ++ if( !sqliteExprIsConstant(p->pList->a[i].pExpr) ) return 0; ++ } ++ } ++ return p->pLeft!=0 || p->pRight!=0 || (p->pList && p->pList->nExpr>0); ++ } ++ } ++ return 0; ++} ++ ++/* ++** If the given expression codes a constant integer that is small enough ++** to fit in a 32-bit integer, return 1 and put the value of the integer ++** in *pValue. If the expression is not an integer or if it is too big ++** to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged. ++*/ ++int sqliteExprIsInteger(Expr *p, int *pValue){ ++ switch( p->op ){ ++ case TK_INTEGER: { ++ if( sqliteFitsIn32Bits(p->token.z) ){ ++ *pValue = atoi(p->token.z); ++ return 1; ++ } ++ break; ++ } ++ case TK_STRING: { ++ const char *z = p->token.z; ++ int n = p->token.n; ++ if( n>0 && z[0]=='-' ){ z++; n--; } ++ while( n>0 && *z && isdigit(*z) ){ z++; n--; } ++ if( n==0 && sqliteFitsIn32Bits(p->token.z) ){ ++ *pValue = atoi(p->token.z); ++ return 1; ++ } ++ break; ++ } ++ case TK_UPLUS: { ++ return sqliteExprIsInteger(p->pLeft, pValue); ++ } ++ case TK_UMINUS: { ++ int v; ++ if( sqliteExprIsInteger(p->pLeft, &v) ){ ++ *pValue = -v; ++ return 1; ++ } ++ break; ++ } ++ default: break; ++ } ++ return 0; ++} ++ ++/* ++** Return TRUE if the given string is a row-id column name. ++*/ ++int sqliteIsRowid(const char *z){ ++ if( sqliteStrICmp(z, "_ROWID_")==0 ) return 1; ++ if( sqliteStrICmp(z, "ROWID")==0 ) return 1; ++ if( sqliteStrICmp(z, "OID")==0 ) return 1; ++ return 0; ++} ++ ++/* ++** Given the name of a column of the form X.Y.Z or Y.Z or just Z, look up ++** that name in the set of source tables in pSrcList and make the pExpr ++** expression node refer back to that source column. The following changes ++** are made to pExpr: ++** ++** pExpr->iDb Set the index in db->aDb[] of the database holding ++** the table. ++** pExpr->iTable Set to the cursor number for the table obtained ++** from pSrcList. ++** pExpr->iColumn Set to the column number within the table. ++** pExpr->dataType Set to the appropriate data type for the column. ++** pExpr->op Set to TK_COLUMN. ++** pExpr->pLeft Any expression this points to is deleted ++** pExpr->pRight Any expression this points to is deleted. ++** ++** The pDbToken is the name of the database (the "X"). This value may be ++** NULL meaning that name is of the form Y.Z or Z. Any available database ++** can be used. The pTableToken is the name of the table (the "Y"). This ++** value can be NULL if pDbToken is also NULL. If pTableToken is NULL it ++** means that the form of the name is Z and that columns from any table ++** can be used. ++** ++** If the name cannot be resolved unambiguously, leave an error message ++** in pParse and return non-zero. Return zero on success. ++*/ ++static int lookupName( ++ Parse *pParse, /* The parsing context */ ++ Token *pDbToken, /* Name of the database containing table, or NULL */ ++ Token *pTableToken, /* Name of table containing column, or NULL */ ++ Token *pColumnToken, /* Name of the column. */ ++ SrcList *pSrcList, /* List of tables used to resolve column names */ ++ ExprList *pEList, /* List of expressions used to resolve "AS" */ ++ Expr *pExpr /* Make this EXPR node point to the selected column */ ++){ ++ char *zDb = 0; /* Name of the database. The "X" in X.Y.Z */ ++ char *zTab = 0; /* Name of the table. The "Y" in X.Y.Z or Y.Z */ ++ char *zCol = 0; /* Name of the column. The "Z" */ ++ int i, j; /* Loop counters */ ++ int cnt = 0; /* Number of matching column names */ ++ int cntTab = 0; /* Number of matching table names */ ++ sqlite *db = pParse->db; /* The database */ ++ ++ assert( pColumnToken && pColumnToken->z ); /* The Z in X.Y.Z cannot be NULL */ ++ if( pDbToken && pDbToken->z ){ ++ zDb = sqliteStrNDup(pDbToken->z, pDbToken->n); ++ sqliteDequote(zDb); ++ }else{ ++ zDb = 0; ++ } ++ if( pTableToken && pTableToken->z ){ ++ zTab = sqliteStrNDup(pTableToken->z, pTableToken->n); ++ sqliteDequote(zTab); ++ }else{ ++ assert( zDb==0 ); ++ zTab = 0; ++ } ++ zCol = sqliteStrNDup(pColumnToken->z, pColumnToken->n); ++ sqliteDequote(zCol); ++ if( sqlite_malloc_failed ){ ++ return 1; /* Leak memory (zDb and zTab) if malloc fails */ ++ } ++ assert( zTab==0 || pEList==0 ); ++ ++ pExpr->iTable = -1; ++ for(i=0; inSrc; i++){ ++ struct SrcList_item *pItem = &pSrcList->a[i]; ++ Table *pTab = pItem->pTab; ++ Column *pCol; ++ ++ if( pTab==0 ) continue; ++ assert( pTab->nCol>0 ); ++ if( zTab ){ ++ if( pItem->zAlias ){ ++ char *zTabName = pItem->zAlias; ++ if( sqliteStrICmp(zTabName, zTab)!=0 ) continue; ++ }else{ ++ char *zTabName = pTab->zName; ++ if( zTabName==0 || sqliteStrICmp(zTabName, zTab)!=0 ) continue; ++ if( zDb!=0 && sqliteStrICmp(db->aDb[pTab->iDb].zName, zDb)!=0 ){ ++ continue; ++ } ++ } ++ } ++ if( 0==(cntTab++) ){ ++ pExpr->iTable = pItem->iCursor; ++ pExpr->iDb = pTab->iDb; ++ } ++ for(j=0, pCol=pTab->aCol; jnCol; j++, pCol++){ ++ if( sqliteStrICmp(pCol->zName, zCol)==0 ){ ++ cnt++; ++ pExpr->iTable = pItem->iCursor; ++ pExpr->iDb = pTab->iDb; ++ /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ ++ pExpr->iColumn = j==pTab->iPKey ? -1 : j; ++ pExpr->dataType = pCol->sortOrder & SQLITE_SO_TYPEMASK; ++ break; ++ } ++ } ++ } ++ ++ /* If we have not already resolved the name, then maybe ++ ** it is a new.* or old.* trigger argument reference ++ */ ++ if( zDb==0 && zTab!=0 && cnt==0 && pParse->trigStack!=0 ){ ++ TriggerStack *pTriggerStack = pParse->trigStack; ++ Table *pTab = 0; ++ if( pTriggerStack->newIdx != -1 && sqliteStrICmp("new", zTab) == 0 ){ ++ pExpr->iTable = pTriggerStack->newIdx; ++ assert( pTriggerStack->pTab ); ++ pTab = pTriggerStack->pTab; ++ }else if( pTriggerStack->oldIdx != -1 && sqliteStrICmp("old", zTab) == 0 ){ ++ pExpr->iTable = pTriggerStack->oldIdx; ++ assert( pTriggerStack->pTab ); ++ pTab = pTriggerStack->pTab; ++ } ++ ++ if( pTab ){ ++ int j; ++ Column *pCol = pTab->aCol; ++ ++ pExpr->iDb = pTab->iDb; ++ cntTab++; ++ for(j=0; j < pTab->nCol; j++, pCol++) { ++ if( sqliteStrICmp(pCol->zName, zCol)==0 ){ ++ cnt++; ++ pExpr->iColumn = j==pTab->iPKey ? -1 : j; ++ pExpr->dataType = pCol->sortOrder & SQLITE_SO_TYPEMASK; ++ break; ++ } ++ } ++ } ++ } ++ ++ /* ++ ** Perhaps the name is a reference to the ROWID ++ */ ++ if( cnt==0 && cntTab==1 && sqliteIsRowid(zCol) ){ ++ cnt = 1; ++ pExpr->iColumn = -1; ++ pExpr->dataType = SQLITE_SO_NUM; ++ } ++ ++ /* ++ ** If the input is of the form Z (not Y.Z or X.Y.Z) then the name Z ++ ** might refer to an result-set alias. This happens, for example, when ++ ** we are resolving names in the WHERE clause of the following command: ++ ** ++ ** SELECT a+b AS x FROM table WHERE x<10; ++ ** ++ ** In cases like this, replace pExpr with a copy of the expression that ++ ** forms the result set entry ("a+b" in the example) and return immediately. ++ ** Note that the expression in the result set should have already been ++ ** resolved by the time the WHERE clause is resolved. ++ */ ++ if( cnt==0 && pEList!=0 ){ ++ for(j=0; jnExpr; j++){ ++ char *zAs = pEList->a[j].zName; ++ if( zAs!=0 && sqliteStrICmp(zAs, zCol)==0 ){ ++ assert( pExpr->pLeft==0 && pExpr->pRight==0 ); ++ pExpr->op = TK_AS; ++ pExpr->iColumn = j; ++ pExpr->pLeft = sqliteExprDup(pEList->a[j].pExpr); ++ sqliteFree(zCol); ++ assert( zTab==0 && zDb==0 ); ++ return 0; ++ } ++ } ++ } ++ ++ /* ++ ** If X and Y are NULL (in other words if only the column name Z is ++ ** supplied) and the value of Z is enclosed in double-quotes, then ++ ** Z is a string literal if it doesn't match any column names. In that ++ ** case, we need to return right away and not make any changes to ++ ** pExpr. ++ */ ++ if( cnt==0 && zTab==0 && pColumnToken->z[0]=='"' ){ ++ sqliteFree(zCol); ++ return 0; ++ } ++ ++ /* ++ ** cnt==0 means there was not match. cnt>1 means there were two or ++ ** more matches. Either way, we have an error. ++ */ ++ if( cnt!=1 ){ ++ char *z = 0; ++ char *zErr; ++ zErr = cnt==0 ? "no such column: %s" : "ambiguous column name: %s"; ++ if( zDb ){ ++ sqliteSetString(&z, zDb, ".", zTab, ".", zCol, 0); ++ }else if( zTab ){ ++ sqliteSetString(&z, zTab, ".", zCol, 0); ++ }else{ ++ z = sqliteStrDup(zCol); ++ } ++ sqliteErrorMsg(pParse, zErr, z); ++ sqliteFree(z); ++ } ++ ++ /* Clean up and return ++ */ ++ sqliteFree(zDb); ++ sqliteFree(zTab); ++ sqliteFree(zCol); ++ sqliteExprDelete(pExpr->pLeft); ++ pExpr->pLeft = 0; ++ sqliteExprDelete(pExpr->pRight); ++ pExpr->pRight = 0; ++ pExpr->op = TK_COLUMN; ++ sqliteAuthRead(pParse, pExpr, pSrcList); ++ return cnt!=1; ++} ++ ++/* ++** This routine walks an expression tree and resolves references to ++** table columns. Nodes of the form ID.ID or ID resolve into an ++** index to the table in the table list and a column offset. The ++** Expr.opcode for such nodes is changed to TK_COLUMN. The Expr.iTable ++** value is changed to the index of the referenced table in pTabList ++** plus the "base" value. The base value will ultimately become the ++** VDBE cursor number for a cursor that is pointing into the referenced ++** table. The Expr.iColumn value is changed to the index of the column ++** of the referenced table. The Expr.iColumn value for the special ++** ROWID column is -1. Any INTEGER PRIMARY KEY column is tried as an ++** alias for ROWID. ++** ++** We also check for instances of the IN operator. IN comes in two ++** forms: ++** ++** expr IN (exprlist) ++** and ++** expr IN (SELECT ...) ++** ++** The first form is handled by creating a set holding the list ++** of allowed values. The second form causes the SELECT to generate ++** a temporary table. ++** ++** This routine also looks for scalar SELECTs that are part of an expression. ++** If it finds any, it generates code to write the value of that select ++** into a memory cell. ++** ++** Unknown columns or tables provoke an error. The function returns ++** the number of errors seen and leaves an error message on pParse->zErrMsg. ++*/ ++int sqliteExprResolveIds( ++ Parse *pParse, /* The parser context */ ++ SrcList *pSrcList, /* List of tables used to resolve column names */ ++ ExprList *pEList, /* List of expressions used to resolve "AS" */ ++ Expr *pExpr /* The expression to be analyzed. */ ++){ ++ int i; ++ ++ if( pExpr==0 || pSrcList==0 ) return 0; ++ for(i=0; inSrc; i++){ ++ assert( pSrcList->a[i].iCursor>=0 && pSrcList->a[i].iCursornTab ); ++ } ++ switch( pExpr->op ){ ++ /* Double-quoted strings (ex: "abc") are used as identifiers if ++ ** possible. Otherwise they remain as strings. Single-quoted ++ ** strings (ex: 'abc') are always string literals. ++ */ ++ case TK_STRING: { ++ if( pExpr->token.z[0]=='\'' ) break; ++ /* Fall thru into the TK_ID case if this is a double-quoted string */ ++ } ++ /* A lone identifier is the name of a columnd. ++ */ ++ case TK_ID: { ++ if( lookupName(pParse, 0, 0, &pExpr->token, pSrcList, pEList, pExpr) ){ ++ return 1; ++ } ++ break; ++ } ++ ++ /* A table name and column name: ID.ID ++ ** Or a database, table and column: ID.ID.ID ++ */ ++ case TK_DOT: { ++ Token *pColumn; ++ Token *pTable; ++ Token *pDb; ++ Expr *pRight; ++ ++ pRight = pExpr->pRight; ++ if( pRight->op==TK_ID ){ ++ pDb = 0; ++ pTable = &pExpr->pLeft->token; ++ pColumn = &pRight->token; ++ }else{ ++ assert( pRight->op==TK_DOT ); ++ pDb = &pExpr->pLeft->token; ++ pTable = &pRight->pLeft->token; ++ pColumn = &pRight->pRight->token; ++ } ++ if( lookupName(pParse, pDb, pTable, pColumn, pSrcList, 0, pExpr) ){ ++ return 1; ++ } ++ break; ++ } ++ ++ case TK_IN: { ++ Vdbe *v = sqliteGetVdbe(pParse); ++ if( v==0 ) return 1; ++ if( sqliteExprResolveIds(pParse, pSrcList, pEList, pExpr->pLeft) ){ ++ return 1; ++ } ++ if( pExpr->pSelect ){ ++ /* Case 1: expr IN (SELECT ...) ++ ** ++ ** Generate code to write the results of the select into a temporary ++ ** table. The cursor number of the temporary table has already ++ ** been put in iTable by sqliteExprResolveInSelect(). ++ */ ++ pExpr->iTable = pParse->nTab++; ++ sqliteVdbeAddOp(v, OP_OpenTemp, pExpr->iTable, 1); ++ sqliteSelect(pParse, pExpr->pSelect, SRT_Set, pExpr->iTable, 0,0,0); ++ }else if( pExpr->pList ){ ++ /* Case 2: expr IN (exprlist) ++ ** ++ ** Create a set to put the exprlist values in. The Set id is stored ++ ** in iTable. ++ */ ++ int i, iSet; ++ for(i=0; ipList->nExpr; i++){ ++ Expr *pE2 = pExpr->pList->a[i].pExpr; ++ if( !sqliteExprIsConstant(pE2) ){ ++ sqliteErrorMsg(pParse, ++ "right-hand side of IN operator must be constant"); ++ return 1; ++ } ++ if( sqliteExprCheck(pParse, pE2, 0, 0) ){ ++ return 1; ++ } ++ } ++ iSet = pExpr->iTable = pParse->nSet++; ++ for(i=0; ipList->nExpr; i++){ ++ Expr *pE2 = pExpr->pList->a[i].pExpr; ++ switch( pE2->op ){ ++ case TK_FLOAT: ++ case TK_INTEGER: ++ case TK_STRING: { ++ int addr; ++ assert( pE2->token.z ); ++ addr = sqliteVdbeOp3(v, OP_SetInsert, iSet, 0, ++ pE2->token.z, pE2->token.n); ++ sqliteVdbeDequoteP3(v, addr); ++ break; ++ } ++ default: { ++ sqliteExprCode(pParse, pE2); ++ sqliteVdbeAddOp(v, OP_SetInsert, iSet, 0); ++ break; ++ } ++ } ++ } ++ } ++ break; ++ } ++ ++ case TK_SELECT: { ++ /* This has to be a scalar SELECT. Generate code to put the ++ ** value of this select in a memory cell and record the number ++ ** of the memory cell in iColumn. ++ */ ++ pExpr->iColumn = pParse->nMem++; ++ if( sqliteSelect(pParse, pExpr->pSelect, SRT_Mem, pExpr->iColumn,0,0,0) ){ ++ return 1; ++ } ++ break; ++ } ++ ++ /* For all else, just recursively walk the tree */ ++ default: { ++ if( pExpr->pLeft ++ && sqliteExprResolveIds(pParse, pSrcList, pEList, pExpr->pLeft) ){ ++ return 1; ++ } ++ if( pExpr->pRight ++ && sqliteExprResolveIds(pParse, pSrcList, pEList, pExpr->pRight) ){ ++ return 1; ++ } ++ if( pExpr->pList ){ ++ int i; ++ ExprList *pList = pExpr->pList; ++ for(i=0; inExpr; i++){ ++ Expr *pArg = pList->a[i].pExpr; ++ if( sqliteExprResolveIds(pParse, pSrcList, pEList, pArg) ){ ++ return 1; ++ } ++ } ++ } ++ } ++ } ++ return 0; ++} ++ ++/* ++** pExpr is a node that defines a function of some kind. It might ++** be a syntactic function like "count(x)" or it might be a function ++** that implements an operator, like "a LIKE b". ++** ++** This routine makes *pzName point to the name of the function and ++** *pnName hold the number of characters in the function name. ++*/ ++static void getFunctionName(Expr *pExpr, const char **pzName, int *pnName){ ++ switch( pExpr->op ){ ++ case TK_FUNCTION: { ++ *pzName = pExpr->token.z; ++ *pnName = pExpr->token.n; ++ break; ++ } ++ case TK_LIKE: { ++ *pzName = "like"; ++ *pnName = 4; ++ break; ++ } ++ case TK_GLOB: { ++ *pzName = "glob"; ++ *pnName = 4; ++ break; ++ } ++ default: { ++ *pzName = "can't happen"; ++ *pnName = 12; ++ break; ++ } ++ } ++} ++ ++/* ++** Error check the functions in an expression. Make sure all ++** function names are recognized and all functions have the correct ++** number of arguments. Leave an error message in pParse->zErrMsg ++** if anything is amiss. Return the number of errors. ++** ++** if pIsAgg is not null and this expression is an aggregate function ++** (like count(*) or max(value)) then write a 1 into *pIsAgg. ++*/ ++int sqliteExprCheck(Parse *pParse, Expr *pExpr, int allowAgg, int *pIsAgg){ ++ int nErr = 0; ++ if( pExpr==0 ) return 0; ++ switch( pExpr->op ){ ++ case TK_GLOB: ++ case TK_LIKE: ++ case TK_FUNCTION: { ++ int n = pExpr->pList ? pExpr->pList->nExpr : 0; /* Number of arguments */ ++ int no_such_func = 0; /* True if no such function exists */ ++ int wrong_num_args = 0; /* True if wrong number of arguments */ ++ int is_agg = 0; /* True if is an aggregate function */ ++ int i; ++ int nId; /* Number of characters in function name */ ++ const char *zId; /* The function name. */ ++ FuncDef *pDef; ++ ++ getFunctionName(pExpr, &zId, &nId); ++ pDef = sqliteFindFunction(pParse->db, zId, nId, n, 0); ++ if( pDef==0 ){ ++ pDef = sqliteFindFunction(pParse->db, zId, nId, -1, 0); ++ if( pDef==0 ){ ++ no_such_func = 1; ++ }else{ ++ wrong_num_args = 1; ++ } ++ }else{ ++ is_agg = pDef->xFunc==0; ++ } ++ if( is_agg && !allowAgg ){ ++ sqliteErrorMsg(pParse, "misuse of aggregate function %.*s()", nId, zId); ++ nErr++; ++ is_agg = 0; ++ }else if( no_such_func ){ ++ sqliteErrorMsg(pParse, "no such function: %.*s", nId, zId); ++ nErr++; ++ }else if( wrong_num_args ){ ++ sqliteErrorMsg(pParse,"wrong number of arguments to function %.*s()", ++ nId, zId); ++ nErr++; ++ } ++ if( is_agg ){ ++ pExpr->op = TK_AGG_FUNCTION; ++ if( pIsAgg ) *pIsAgg = 1; ++ } ++ for(i=0; nErr==0 && ipList->a[i].pExpr, ++ allowAgg && !is_agg, pIsAgg); ++ } ++ if( pDef==0 ){ ++ /* Already reported an error */ ++ }else if( pDef->dataType>=0 ){ ++ if( pDef->dataTypedataType = ++ sqliteExprType(pExpr->pList->a[pDef->dataType].pExpr); ++ }else{ ++ pExpr->dataType = SQLITE_SO_NUM; ++ } ++ }else if( pDef->dataType==SQLITE_ARGS ){ ++ pDef->dataType = SQLITE_SO_TEXT; ++ for(i=0; ipList->a[i].pExpr)==SQLITE_SO_NUM ){ ++ pExpr->dataType = SQLITE_SO_NUM; ++ break; ++ } ++ } ++ }else if( pDef->dataType==SQLITE_NUMERIC ){ ++ pExpr->dataType = SQLITE_SO_NUM; ++ }else{ ++ pExpr->dataType = SQLITE_SO_TEXT; ++ } ++ } ++ default: { ++ if( pExpr->pLeft ){ ++ nErr = sqliteExprCheck(pParse, pExpr->pLeft, allowAgg, pIsAgg); ++ } ++ if( nErr==0 && pExpr->pRight ){ ++ nErr = sqliteExprCheck(pParse, pExpr->pRight, allowAgg, pIsAgg); ++ } ++ if( nErr==0 && pExpr->pList ){ ++ int n = pExpr->pList->nExpr; ++ int i; ++ for(i=0; nErr==0 && ipList->a[i].pExpr; ++ nErr = sqliteExprCheck(pParse, pE2, allowAgg, pIsAgg); ++ } ++ } ++ break; ++ } ++ } ++ return nErr; ++} ++ ++/* ++** Return either SQLITE_SO_NUM or SQLITE_SO_TEXT to indicate whether the ++** given expression should sort as numeric values or as text. ++** ++** The sqliteExprResolveIds() and sqliteExprCheck() routines must have ++** both been called on the expression before it is passed to this routine. ++*/ ++int sqliteExprType(Expr *p){ ++ if( p==0 ) return SQLITE_SO_NUM; ++ while( p ) switch( p->op ){ ++ case TK_PLUS: ++ case TK_MINUS: ++ case TK_STAR: ++ case TK_SLASH: ++ case TK_AND: ++ case TK_OR: ++ case TK_ISNULL: ++ case TK_NOTNULL: ++ case TK_NOT: ++ case TK_UMINUS: ++ case TK_UPLUS: ++ case TK_BITAND: ++ case TK_BITOR: ++ case TK_BITNOT: ++ case TK_LSHIFT: ++ case TK_RSHIFT: ++ case TK_REM: ++ case TK_INTEGER: ++ case TK_FLOAT: ++ case TK_IN: ++ case TK_BETWEEN: ++ case TK_GLOB: ++ case TK_LIKE: ++ return SQLITE_SO_NUM; ++ ++ case TK_STRING: ++ case TK_NULL: ++ case TK_CONCAT: ++ case TK_VARIABLE: ++ return SQLITE_SO_TEXT; ++ ++ case TK_LT: ++ case TK_LE: ++ case TK_GT: ++ case TK_GE: ++ case TK_NE: ++ case TK_EQ: ++ if( sqliteExprType(p->pLeft)==SQLITE_SO_NUM ){ ++ return SQLITE_SO_NUM; ++ } ++ p = p->pRight; ++ break; ++ ++ case TK_AS: ++ p = p->pLeft; ++ break; ++ ++ case TK_COLUMN: ++ case TK_FUNCTION: ++ case TK_AGG_FUNCTION: ++ return p->dataType; ++ ++ case TK_SELECT: ++ assert( p->pSelect ); ++ assert( p->pSelect->pEList ); ++ assert( p->pSelect->pEList->nExpr>0 ); ++ p = p->pSelect->pEList->a[0].pExpr; ++ break; ++ ++ case TK_CASE: { ++ if( p->pRight && sqliteExprType(p->pRight)==SQLITE_SO_NUM ){ ++ return SQLITE_SO_NUM; ++ } ++ if( p->pList ){ ++ int i; ++ ExprList *pList = p->pList; ++ for(i=1; inExpr; i+=2){ ++ if( sqliteExprType(pList->a[i].pExpr)==SQLITE_SO_NUM ){ ++ return SQLITE_SO_NUM; ++ } ++ } ++ } ++ return SQLITE_SO_TEXT; ++ } ++ ++ default: ++ assert( p->op==TK_ABORT ); /* Can't Happen */ ++ break; ++ } ++ return SQLITE_SO_NUM; ++} ++ ++/* ++** Generate code into the current Vdbe to evaluate the given ++** expression and leave the result on the top of stack. ++*/ ++void sqliteExprCode(Parse *pParse, Expr *pExpr){ ++ Vdbe *v = pParse->pVdbe; ++ int op; ++ if( v==0 || pExpr==0 ) return; ++ switch( pExpr->op ){ ++ case TK_PLUS: op = OP_Add; break; ++ case TK_MINUS: op = OP_Subtract; break; ++ case TK_STAR: op = OP_Multiply; break; ++ case TK_SLASH: op = OP_Divide; break; ++ case TK_AND: op = OP_And; break; ++ case TK_OR: op = OP_Or; break; ++ case TK_LT: op = OP_Lt; break; ++ case TK_LE: op = OP_Le; break; ++ case TK_GT: op = OP_Gt; break; ++ case TK_GE: op = OP_Ge; break; ++ case TK_NE: op = OP_Ne; break; ++ case TK_EQ: op = OP_Eq; break; ++ case TK_ISNULL: op = OP_IsNull; break; ++ case TK_NOTNULL: op = OP_NotNull; break; ++ case TK_NOT: op = OP_Not; break; ++ case TK_UMINUS: op = OP_Negative; break; ++ case TK_BITAND: op = OP_BitAnd; break; ++ case TK_BITOR: op = OP_BitOr; break; ++ case TK_BITNOT: op = OP_BitNot; break; ++ case TK_LSHIFT: op = OP_ShiftLeft; break; ++ case TK_RSHIFT: op = OP_ShiftRight; break; ++ case TK_REM: op = OP_Remainder; break; ++ default: break; ++ } ++ switch( pExpr->op ){ ++ case TK_COLUMN: { ++ if( pParse->useAgg ){ ++ sqliteVdbeAddOp(v, OP_AggGet, 0, pExpr->iAgg); ++ }else if( pExpr->iColumn>=0 ){ ++ sqliteVdbeAddOp(v, OP_Column, pExpr->iTable, pExpr->iColumn); ++ }else{ ++ sqliteVdbeAddOp(v, OP_Recno, pExpr->iTable, 0); ++ } ++ break; ++ } ++ case TK_STRING: ++ case TK_FLOAT: ++ case TK_INTEGER: { ++ if( pExpr->op==TK_INTEGER && sqliteFitsIn32Bits(pExpr->token.z) ){ ++ sqliteVdbeAddOp(v, OP_Integer, atoi(pExpr->token.z), 0); ++ }else{ ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ } ++ assert( pExpr->token.z ); ++ sqliteVdbeChangeP3(v, -1, pExpr->token.z, pExpr->token.n); ++ sqliteVdbeDequoteP3(v, -1); ++ break; ++ } ++ case TK_NULL: { ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ break; ++ } ++ case TK_VARIABLE: { ++ sqliteVdbeAddOp(v, OP_Variable, pExpr->iTable, 0); ++ break; ++ } ++ case TK_LT: ++ case TK_LE: ++ case TK_GT: ++ case TK_GE: ++ case TK_NE: ++ case TK_EQ: { ++ if( pParse->db->file_format>=4 && sqliteExprType(pExpr)==SQLITE_SO_TEXT ){ ++ op += 6; /* Convert numeric opcodes to text opcodes */ ++ } ++ /* Fall through into the next case */ ++ } ++ case TK_AND: ++ case TK_OR: ++ case TK_PLUS: ++ case TK_STAR: ++ case TK_MINUS: ++ case TK_REM: ++ case TK_BITAND: ++ case TK_BITOR: ++ case TK_SLASH: { ++ sqliteExprCode(pParse, pExpr->pLeft); ++ sqliteExprCode(pParse, pExpr->pRight); ++ sqliteVdbeAddOp(v, op, 0, 0); ++ break; ++ } ++ case TK_LSHIFT: ++ case TK_RSHIFT: { ++ sqliteExprCode(pParse, pExpr->pRight); ++ sqliteExprCode(pParse, pExpr->pLeft); ++ sqliteVdbeAddOp(v, op, 0, 0); ++ break; ++ } ++ case TK_CONCAT: { ++ sqliteExprCode(pParse, pExpr->pLeft); ++ sqliteExprCode(pParse, pExpr->pRight); ++ sqliteVdbeAddOp(v, OP_Concat, 2, 0); ++ break; ++ } ++ case TK_UMINUS: { ++ assert( pExpr->pLeft ); ++ if( pExpr->pLeft->op==TK_FLOAT || pExpr->pLeft->op==TK_INTEGER ){ ++ Token *p = &pExpr->pLeft->token; ++ char *z = sqliteMalloc( p->n + 2 ); ++ sprintf(z, "-%.*s", p->n, p->z); ++ if( pExpr->pLeft->op==TK_INTEGER && sqliteFitsIn32Bits(z) ){ ++ sqliteVdbeAddOp(v, OP_Integer, atoi(z), 0); ++ }else{ ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ } ++ sqliteVdbeChangeP3(v, -1, z, p->n+1); ++ sqliteFree(z); ++ break; ++ } ++ /* Fall through into TK_NOT */ ++ } ++ case TK_BITNOT: ++ case TK_NOT: { ++ sqliteExprCode(pParse, pExpr->pLeft); ++ sqliteVdbeAddOp(v, op, 0, 0); ++ break; ++ } ++ case TK_ISNULL: ++ case TK_NOTNULL: { ++ int dest; ++ sqliteVdbeAddOp(v, OP_Integer, 1, 0); ++ sqliteExprCode(pParse, pExpr->pLeft); ++ dest = sqliteVdbeCurrentAddr(v) + 2; ++ sqliteVdbeAddOp(v, op, 1, dest); ++ sqliteVdbeAddOp(v, OP_AddImm, -1, 0); ++ break; ++ } ++ case TK_AGG_FUNCTION: { ++ sqliteVdbeAddOp(v, OP_AggGet, 0, pExpr->iAgg); ++ break; ++ } ++ case TK_GLOB: ++ case TK_LIKE: ++ case TK_FUNCTION: { ++ ExprList *pList = pExpr->pList; ++ int nExpr = pList ? pList->nExpr : 0; ++ FuncDef *pDef; ++ int nId; ++ const char *zId; ++ getFunctionName(pExpr, &zId, &nId); ++ pDef = sqliteFindFunction(pParse->db, zId, nId, nExpr, 0); ++ assert( pDef!=0 ); ++ nExpr = sqliteExprCodeExprList(pParse, pList, pDef->includeTypes); ++ sqliteVdbeOp3(v, OP_Function, nExpr, 0, (char*)pDef, P3_POINTER); ++ break; ++ } ++ case TK_SELECT: { ++ sqliteVdbeAddOp(v, OP_MemLoad, pExpr->iColumn, 0); ++ break; ++ } ++ case TK_IN: { ++ int addr; ++ sqliteVdbeAddOp(v, OP_Integer, 1, 0); ++ sqliteExprCode(pParse, pExpr->pLeft); ++ addr = sqliteVdbeCurrentAddr(v); ++ sqliteVdbeAddOp(v, OP_NotNull, -1, addr+4); ++ sqliteVdbeAddOp(v, OP_Pop, 2, 0); ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ sqliteVdbeAddOp(v, OP_Goto, 0, addr+6); ++ if( pExpr->pSelect ){ ++ sqliteVdbeAddOp(v, OP_Found, pExpr->iTable, addr+6); ++ }else{ ++ sqliteVdbeAddOp(v, OP_SetFound, pExpr->iTable, addr+6); ++ } ++ sqliteVdbeAddOp(v, OP_AddImm, -1, 0); ++ break; ++ } ++ case TK_BETWEEN: { ++ sqliteExprCode(pParse, pExpr->pLeft); ++ sqliteVdbeAddOp(v, OP_Dup, 0, 0); ++ sqliteExprCode(pParse, pExpr->pList->a[0].pExpr); ++ sqliteVdbeAddOp(v, OP_Ge, 0, 0); ++ sqliteVdbeAddOp(v, OP_Pull, 1, 0); ++ sqliteExprCode(pParse, pExpr->pList->a[1].pExpr); ++ sqliteVdbeAddOp(v, OP_Le, 0, 0); ++ sqliteVdbeAddOp(v, OP_And, 0, 0); ++ break; ++ } ++ case TK_UPLUS: ++ case TK_AS: { ++ sqliteExprCode(pParse, pExpr->pLeft); ++ break; ++ } ++ case TK_CASE: { ++ int expr_end_label; ++ int jumpInst; ++ int addr; ++ int nExpr; ++ int i; ++ ++ assert(pExpr->pList); ++ assert((pExpr->pList->nExpr % 2) == 0); ++ assert(pExpr->pList->nExpr > 0); ++ nExpr = pExpr->pList->nExpr; ++ expr_end_label = sqliteVdbeMakeLabel(v); ++ if( pExpr->pLeft ){ ++ sqliteExprCode(pParse, pExpr->pLeft); ++ } ++ for(i=0; ipList->a[i].pExpr); ++ if( pExpr->pLeft ){ ++ sqliteVdbeAddOp(v, OP_Dup, 1, 1); ++ jumpInst = sqliteVdbeAddOp(v, OP_Ne, 1, 0); ++ sqliteVdbeAddOp(v, OP_Pop, 1, 0); ++ }else{ ++ jumpInst = sqliteVdbeAddOp(v, OP_IfNot, 1, 0); ++ } ++ sqliteExprCode(pParse, pExpr->pList->a[i+1].pExpr); ++ sqliteVdbeAddOp(v, OP_Goto, 0, expr_end_label); ++ addr = sqliteVdbeCurrentAddr(v); ++ sqliteVdbeChangeP2(v, jumpInst, addr); ++ } ++ if( pExpr->pLeft ){ ++ sqliteVdbeAddOp(v, OP_Pop, 1, 0); ++ } ++ if( pExpr->pRight ){ ++ sqliteExprCode(pParse, pExpr->pRight); ++ }else{ ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ } ++ sqliteVdbeResolveLabel(v, expr_end_label); ++ break; ++ } ++ case TK_RAISE: { ++ if( !pParse->trigStack ){ ++ sqliteErrorMsg(pParse, ++ "RAISE() may only be used within a trigger-program"); ++ pParse->nErr++; ++ return; ++ } ++ if( pExpr->iColumn == OE_Rollback || ++ pExpr->iColumn == OE_Abort || ++ pExpr->iColumn == OE_Fail ){ ++ sqliteVdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, pExpr->iColumn, ++ pExpr->token.z, pExpr->token.n); ++ sqliteVdbeDequoteP3(v, -1); ++ } else { ++ assert( pExpr->iColumn == OE_Ignore ); ++ sqliteVdbeOp3(v, OP_Goto, 0, pParse->trigStack->ignoreJump, ++ "(IGNORE jump)", 0); ++ } ++ } ++ break; ++ } ++} ++ ++/* ++** Generate code that pushes the value of every element of the given ++** expression list onto the stack. If the includeTypes flag is true, ++** then also push a string that is the datatype of each element onto ++** the stack after the value. ++** ++** Return the number of elements pushed onto the stack. ++*/ ++int sqliteExprCodeExprList( ++ Parse *pParse, /* Parsing context */ ++ ExprList *pList, /* The expression list to be coded */ ++ int includeTypes /* TRUE to put datatypes on the stack too */ ++){ ++ struct ExprList_item *pItem; ++ int i, n; ++ Vdbe *v; ++ if( pList==0 ) return 0; ++ v = sqliteGetVdbe(pParse); ++ n = pList->nExpr; ++ for(pItem=pList->a, i=0; ipExpr); ++ if( includeTypes ){ ++ sqliteVdbeOp3(v, OP_String, 0, 0, ++ sqliteExprType(pItem->pExpr)==SQLITE_SO_NUM ? "numeric" : "text", ++ P3_STATIC); ++ } ++ } ++ return includeTypes ? n*2 : n; ++} ++ ++/* ++** Generate code for a boolean expression such that a jump is made ++** to the label "dest" if the expression is true but execution ++** continues straight thru if the expression is false. ++** ++** If the expression evaluates to NULL (neither true nor false), then ++** take the jump if the jumpIfNull flag is true. ++*/ ++void sqliteExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){ ++ Vdbe *v = pParse->pVdbe; ++ int op = 0; ++ if( v==0 || pExpr==0 ) return; ++ switch( pExpr->op ){ ++ case TK_LT: op = OP_Lt; break; ++ case TK_LE: op = OP_Le; break; ++ case TK_GT: op = OP_Gt; break; ++ case TK_GE: op = OP_Ge; break; ++ case TK_NE: op = OP_Ne; break; ++ case TK_EQ: op = OP_Eq; break; ++ case TK_ISNULL: op = OP_IsNull; break; ++ case TK_NOTNULL: op = OP_NotNull; break; ++ default: break; ++ } ++ switch( pExpr->op ){ ++ case TK_AND: { ++ int d2 = sqliteVdbeMakeLabel(v); ++ sqliteExprIfFalse(pParse, pExpr->pLeft, d2, !jumpIfNull); ++ sqliteExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull); ++ sqliteVdbeResolveLabel(v, d2); ++ break; ++ } ++ case TK_OR: { ++ sqliteExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull); ++ sqliteExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull); ++ break; ++ } ++ case TK_NOT: { ++ sqliteExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull); ++ break; ++ } ++ case TK_LT: ++ case TK_LE: ++ case TK_GT: ++ case TK_GE: ++ case TK_NE: ++ case TK_EQ: { ++ sqliteExprCode(pParse, pExpr->pLeft); ++ sqliteExprCode(pParse, pExpr->pRight); ++ if( pParse->db->file_format>=4 && sqliteExprType(pExpr)==SQLITE_SO_TEXT ){ ++ op += 6; /* Convert numeric opcodes to text opcodes */ ++ } ++ sqliteVdbeAddOp(v, op, jumpIfNull, dest); ++ break; ++ } ++ case TK_ISNULL: ++ case TK_NOTNULL: { ++ sqliteExprCode(pParse, pExpr->pLeft); ++ sqliteVdbeAddOp(v, op, 1, dest); ++ break; ++ } ++ case TK_IN: { ++ int addr; ++ sqliteExprCode(pParse, pExpr->pLeft); ++ addr = sqliteVdbeCurrentAddr(v); ++ sqliteVdbeAddOp(v, OP_NotNull, -1, addr+3); ++ sqliteVdbeAddOp(v, OP_Pop, 1, 0); ++ sqliteVdbeAddOp(v, OP_Goto, 0, jumpIfNull ? dest : addr+4); ++ if( pExpr->pSelect ){ ++ sqliteVdbeAddOp(v, OP_Found, pExpr->iTable, dest); ++ }else{ ++ sqliteVdbeAddOp(v, OP_SetFound, pExpr->iTable, dest); ++ } ++ break; ++ } ++ case TK_BETWEEN: { ++ int addr; ++ sqliteExprCode(pParse, pExpr->pLeft); ++ sqliteVdbeAddOp(v, OP_Dup, 0, 0); ++ sqliteExprCode(pParse, pExpr->pList->a[0].pExpr); ++ addr = sqliteVdbeAddOp(v, OP_Lt, !jumpIfNull, 0); ++ sqliteExprCode(pParse, pExpr->pList->a[1].pExpr); ++ sqliteVdbeAddOp(v, OP_Le, jumpIfNull, dest); ++ sqliteVdbeAddOp(v, OP_Integer, 0, 0); ++ sqliteVdbeChangeP2(v, addr, sqliteVdbeCurrentAddr(v)); ++ sqliteVdbeAddOp(v, OP_Pop, 1, 0); ++ break; ++ } ++ default: { ++ sqliteExprCode(pParse, pExpr); ++ sqliteVdbeAddOp(v, OP_If, jumpIfNull, dest); ++ break; ++ } ++ } ++} ++ ++/* ++** Generate code for a boolean expression such that a jump is made ++** to the label "dest" if the expression is false but execution ++** continues straight thru if the expression is true. ++** ++** If the expression evaluates to NULL (neither true nor false) then ++** jump if jumpIfNull is true or fall through if jumpIfNull is false. ++*/ ++void sqliteExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){ ++ Vdbe *v = pParse->pVdbe; ++ int op = 0; ++ if( v==0 || pExpr==0 ) return; ++ switch( pExpr->op ){ ++ case TK_LT: op = OP_Ge; break; ++ case TK_LE: op = OP_Gt; break; ++ case TK_GT: op = OP_Le; break; ++ case TK_GE: op = OP_Lt; break; ++ case TK_NE: op = OP_Eq; break; ++ case TK_EQ: op = OP_Ne; break; ++ case TK_ISNULL: op = OP_NotNull; break; ++ case TK_NOTNULL: op = OP_IsNull; break; ++ default: break; ++ } ++ switch( pExpr->op ){ ++ case TK_AND: { ++ sqliteExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull); ++ sqliteExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull); ++ break; ++ } ++ case TK_OR: { ++ int d2 = sqliteVdbeMakeLabel(v); ++ sqliteExprIfTrue(pParse, pExpr->pLeft, d2, !jumpIfNull); ++ sqliteExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull); ++ sqliteVdbeResolveLabel(v, d2); ++ break; ++ } ++ case TK_NOT: { ++ sqliteExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull); ++ break; ++ } ++ case TK_LT: ++ case TK_LE: ++ case TK_GT: ++ case TK_GE: ++ case TK_NE: ++ case TK_EQ: { ++ if( pParse->db->file_format>=4 && sqliteExprType(pExpr)==SQLITE_SO_TEXT ){ ++ /* Convert numeric comparison opcodes into text comparison opcodes. ++ ** This step depends on the fact that the text comparision opcodes are ++ ** always 6 greater than their corresponding numeric comparison ++ ** opcodes. ++ */ ++ assert( OP_Eq+6 == OP_StrEq ); ++ op += 6; ++ } ++ sqliteExprCode(pParse, pExpr->pLeft); ++ sqliteExprCode(pParse, pExpr->pRight); ++ sqliteVdbeAddOp(v, op, jumpIfNull, dest); ++ break; ++ } ++ case TK_ISNULL: ++ case TK_NOTNULL: { ++ sqliteExprCode(pParse, pExpr->pLeft); ++ sqliteVdbeAddOp(v, op, 1, dest); ++ break; ++ } ++ case TK_IN: { ++ int addr; ++ sqliteExprCode(pParse, pExpr->pLeft); ++ addr = sqliteVdbeCurrentAddr(v); ++ sqliteVdbeAddOp(v, OP_NotNull, -1, addr+3); ++ sqliteVdbeAddOp(v, OP_Pop, 1, 0); ++ sqliteVdbeAddOp(v, OP_Goto, 0, jumpIfNull ? dest : addr+4); ++ if( pExpr->pSelect ){ ++ sqliteVdbeAddOp(v, OP_NotFound, pExpr->iTable, dest); ++ }else{ ++ sqliteVdbeAddOp(v, OP_SetNotFound, pExpr->iTable, dest); ++ } ++ break; ++ } ++ case TK_BETWEEN: { ++ int addr; ++ sqliteExprCode(pParse, pExpr->pLeft); ++ sqliteVdbeAddOp(v, OP_Dup, 0, 0); ++ sqliteExprCode(pParse, pExpr->pList->a[0].pExpr); ++ addr = sqliteVdbeCurrentAddr(v); ++ sqliteVdbeAddOp(v, OP_Ge, !jumpIfNull, addr+3); ++ sqliteVdbeAddOp(v, OP_Pop, 1, 0); ++ sqliteVdbeAddOp(v, OP_Goto, 0, dest); ++ sqliteExprCode(pParse, pExpr->pList->a[1].pExpr); ++ sqliteVdbeAddOp(v, OP_Gt, jumpIfNull, dest); ++ break; ++ } ++ default: { ++ sqliteExprCode(pParse, pExpr); ++ sqliteVdbeAddOp(v, OP_IfNot, jumpIfNull, dest); ++ break; ++ } ++ } ++} ++ ++/* ++** Do a deep comparison of two expression trees. Return TRUE (non-zero) ++** if they are identical and return FALSE if they differ in any way. ++*/ ++int sqliteExprCompare(Expr *pA, Expr *pB){ ++ int i; ++ if( pA==0 ){ ++ return pB==0; ++ }else if( pB==0 ){ ++ return 0; ++ } ++ if( pA->op!=pB->op ) return 0; ++ if( !sqliteExprCompare(pA->pLeft, pB->pLeft) ) return 0; ++ if( !sqliteExprCompare(pA->pRight, pB->pRight) ) return 0; ++ if( pA->pList ){ ++ if( pB->pList==0 ) return 0; ++ if( pA->pList->nExpr!=pB->pList->nExpr ) return 0; ++ for(i=0; ipList->nExpr; i++){ ++ if( !sqliteExprCompare(pA->pList->a[i].pExpr, pB->pList->a[i].pExpr) ){ ++ return 0; ++ } ++ } ++ }else if( pB->pList ){ ++ return 0; ++ } ++ if( pA->pSelect || pB->pSelect ) return 0; ++ if( pA->iTable!=pB->iTable || pA->iColumn!=pB->iColumn ) return 0; ++ if( pA->token.z ){ ++ if( pB->token.z==0 ) return 0; ++ if( pB->token.n!=pA->token.n ) return 0; ++ if( sqliteStrNICmp(pA->token.z, pB->token.z, pB->token.n)!=0 ) return 0; ++ } ++ return 1; ++} ++ ++/* ++** Add a new element to the pParse->aAgg[] array and return its index. ++*/ ++static int appendAggInfo(Parse *pParse){ ++ if( (pParse->nAgg & 0x7)==0 ){ ++ int amt = pParse->nAgg + 8; ++ AggExpr *aAgg = sqliteRealloc(pParse->aAgg, amt*sizeof(pParse->aAgg[0])); ++ if( aAgg==0 ){ ++ return -1; ++ } ++ pParse->aAgg = aAgg; ++ } ++ memset(&pParse->aAgg[pParse->nAgg], 0, sizeof(pParse->aAgg[0])); ++ return pParse->nAgg++; ++} ++ ++/* ++** Analyze the given expression looking for aggregate functions and ++** for variables that need to be added to the pParse->aAgg[] array. ++** Make additional entries to the pParse->aAgg[] array as necessary. ++** ++** This routine should only be called after the expression has been ++** analyzed by sqliteExprResolveIds() and sqliteExprCheck(). ++** ++** If errors are seen, leave an error message in zErrMsg and return ++** the number of errors. ++*/ ++int sqliteExprAnalyzeAggregates(Parse *pParse, Expr *pExpr){ ++ int i; ++ AggExpr *aAgg; ++ int nErr = 0; ++ ++ if( pExpr==0 ) return 0; ++ switch( pExpr->op ){ ++ case TK_COLUMN: { ++ aAgg = pParse->aAgg; ++ for(i=0; inAgg; i++){ ++ if( aAgg[i].isAgg ) continue; ++ if( aAgg[i].pExpr->iTable==pExpr->iTable ++ && aAgg[i].pExpr->iColumn==pExpr->iColumn ){ ++ break; ++ } ++ } ++ if( i>=pParse->nAgg ){ ++ i = appendAggInfo(pParse); ++ if( i<0 ) return 1; ++ pParse->aAgg[i].isAgg = 0; ++ pParse->aAgg[i].pExpr = pExpr; ++ } ++ pExpr->iAgg = i; ++ break; ++ } ++ case TK_AGG_FUNCTION: { ++ aAgg = pParse->aAgg; ++ for(i=0; inAgg; i++){ ++ if( !aAgg[i].isAgg ) continue; ++ if( sqliteExprCompare(aAgg[i].pExpr, pExpr) ){ ++ break; ++ } ++ } ++ if( i>=pParse->nAgg ){ ++ i = appendAggInfo(pParse); ++ if( i<0 ) return 1; ++ pParse->aAgg[i].isAgg = 1; ++ pParse->aAgg[i].pExpr = pExpr; ++ pParse->aAgg[i].pFunc = sqliteFindFunction(pParse->db, ++ pExpr->token.z, pExpr->token.n, ++ pExpr->pList ? pExpr->pList->nExpr : 0, 0); ++ } ++ pExpr->iAgg = i; ++ break; ++ } ++ default: { ++ if( pExpr->pLeft ){ ++ nErr = sqliteExprAnalyzeAggregates(pParse, pExpr->pLeft); ++ } ++ if( nErr==0 && pExpr->pRight ){ ++ nErr = sqliteExprAnalyzeAggregates(pParse, pExpr->pRight); ++ } ++ if( nErr==0 && pExpr->pList ){ ++ int n = pExpr->pList->nExpr; ++ int i; ++ for(i=0; nErr==0 && ipList->a[i].pExpr); ++ } ++ } ++ break; ++ } ++ } ++ return nErr; ++} ++ ++/* ++** Locate a user function given a name and a number of arguments. ++** Return a pointer to the FuncDef structure that defines that ++** function, or return NULL if the function does not exist. ++** ++** If the createFlag argument is true, then a new (blank) FuncDef ++** structure is created and liked into the "db" structure if a ++** no matching function previously existed. When createFlag is true ++** and the nArg parameter is -1, then only a function that accepts ++** any number of arguments will be returned. ++** ++** If createFlag is false and nArg is -1, then the first valid ++** function found is returned. A function is valid if either xFunc ++** or xStep is non-zero. ++*/ ++FuncDef *sqliteFindFunction( ++ sqlite *db, /* An open database */ ++ const char *zName, /* Name of the function. Not null-terminated */ ++ int nName, /* Number of characters in the name */ ++ int nArg, /* Number of arguments. -1 means any number */ ++ int createFlag /* Create new entry if true and does not otherwise exist */ ++){ ++ FuncDef *pFirst, *p, *pMaybe; ++ pFirst = p = (FuncDef*)sqliteHashFind(&db->aFunc, zName, nName); ++ if( p && !createFlag && nArg<0 ){ ++ while( p && p->xFunc==0 && p->xStep==0 ){ p = p->pNext; } ++ return p; ++ } ++ pMaybe = 0; ++ while( p && p->nArg!=nArg ){ ++ if( p->nArg<0 && !createFlag && (p->xFunc || p->xStep) ) pMaybe = p; ++ p = p->pNext; ++ } ++ if( p && !createFlag && p->xFunc==0 && p->xStep==0 ){ ++ return 0; ++ } ++ if( p==0 && pMaybe ){ ++ assert( createFlag==0 ); ++ return pMaybe; ++ } ++ if( p==0 && createFlag && (p = sqliteMalloc(sizeof(*p)))!=0 ){ ++ p->nArg = nArg; ++ p->pNext = pFirst; ++ p->dataType = pFirst ? pFirst->dataType : SQLITE_NUMERIC; ++ sqliteHashInsert(&db->aFunc, zName, nName, (void*)p); ++ } ++ return p; ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/func.c +@@ -0,0 +1,658 @@ ++/* ++** 2002 February 23 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This file contains the C functions that implement various SQL ++** functions of SQLite. ++** ++** There is only one exported symbol in this file - the function ++** sqliteRegisterBuildinFunctions() found at the bottom of the file. ++** All other code has file scope. ++** ++** $Id$ ++*/ ++#include ++#include ++#include ++#include ++#include "sqliteInt.h" ++#include "os.h" ++ ++/* ++** Implementation of the non-aggregate min() and max() functions ++*/ ++static void minmaxFunc(sqlite_func *context, int argc, const char **argv){ ++ const char *zBest; ++ int i; ++ int (*xCompare)(const char*, const char*); ++ int mask; /* 0 for min() or 0xffffffff for max() */ ++ ++ if( argc==0 ) return; ++ mask = (int)sqlite_user_data(context); ++ zBest = argv[0]; ++ if( zBest==0 ) return; ++ if( argv[1][0]=='n' ){ ++ xCompare = sqliteCompare; ++ }else{ ++ xCompare = strcmp; ++ } ++ for(i=2; i0 ){ ++ p1--; ++ } ++ if( p1+p2>len ){ ++ p2 = len-p1; ++ } ++#ifdef SQLITE_UTF8 ++ for(i=0; i30 ) n = 30; ++ if( n<0 ) n = 0; ++ r = sqliteAtoF(argv[0], 0); ++ sprintf(zBuf,"%.*f",n,r); ++ sqlite_set_result_string(context, zBuf, -1); ++} ++ ++/* ++** Implementation of the upper() and lower() SQL functions. ++*/ ++static void upperFunc(sqlite_func *context, int argc, const char **argv){ ++ unsigned char *z; ++ int i; ++ if( argc<1 || argv[0]==0 ) return; ++ z = (unsigned char*)sqlite_set_result_string(context, argv[0], -1); ++ if( z==0 ) return; ++ for(i=0; z[i]; i++){ ++ if( islower(z[i]) ) z[i] = toupper(z[i]); ++ } ++} ++static void lowerFunc(sqlite_func *context, int argc, const char **argv){ ++ unsigned char *z; ++ int i; ++ if( argc<1 || argv[0]==0 ) return; ++ z = (unsigned char*)sqlite_set_result_string(context, argv[0], -1); ++ if( z==0 ) return; ++ for(i=0; z[i]; i++){ ++ if( isupper(z[i]) ) z[i] = tolower(z[i]); ++ } ++} ++ ++/* ++** Implementation of the IFNULL(), NVL(), and COALESCE() functions. ++** All three do the same thing. They return the first non-NULL ++** argument. ++*/ ++static void ifnullFunc(sqlite_func *context, int argc, const char **argv){ ++ int i; ++ for(i=0; i0 ){ ++ zResult[j++] = code + '0'; ++ } ++ } ++ while( j<4 ){ ++ zResult[j++] = '0'; ++ } ++ zResult[j] = 0; ++ sqlite_set_result_string(context, zResult, 4); ++ }else{ ++ sqlite_set_result_string(context, "?000", 4); ++ } ++} ++#endif ++ ++#ifdef SQLITE_TEST ++/* ++** This function generates a string of random characters. Used for ++** generating test data. ++*/ ++static void randStr(sqlite_func *context, int argc, const char **argv){ ++ static const unsigned char zSrc[] = ++ "abcdefghijklmnopqrstuvwxyz" ++ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ++ "0123456789" ++ ".-!,:*^+=_|?/<> "; ++ int iMin, iMax, n, r, i; ++ unsigned char zBuf[1000]; ++ if( argc>=1 ){ ++ iMin = atoi(argv[0]); ++ if( iMin<0 ) iMin = 0; ++ if( iMin>=sizeof(zBuf) ) iMin = sizeof(zBuf)-1; ++ }else{ ++ iMin = 1; ++ } ++ if( argc>=2 ){ ++ iMax = atoi(argv[1]); ++ if( iMax=sizeof(zBuf) ) iMax = sizeof(zBuf)-1; ++ }else{ ++ iMax = 50; ++ } ++ n = iMin; ++ if( iMax>iMin ){ ++ sqliteRandomness(sizeof(r), &r); ++ r &= 0x7fffffff; ++ n += r%(iMax + 1 - iMin); ++ } ++ assert( nsum += sqliteAtoF(argv[0], 0); ++ p->cnt++; ++ } ++} ++static void sumFinalize(sqlite_func *context){ ++ SumCtx *p; ++ p = sqlite_aggregate_context(context, sizeof(*p)); ++ sqlite_set_result_double(context, p ? p->sum : 0.0); ++} ++static void avgFinalize(sqlite_func *context){ ++ SumCtx *p; ++ p = sqlite_aggregate_context(context, sizeof(*p)); ++ if( p && p->cnt>0 ){ ++ sqlite_set_result_double(context, p->sum/(double)p->cnt); ++ } ++} ++ ++/* ++** An instance of the following structure holds the context of a ++** variance or standard deviation computation. ++*/ ++typedef struct StdDevCtx StdDevCtx; ++struct StdDevCtx { ++ double sum; /* Sum of terms */ ++ double sum2; /* Sum of the squares of terms */ ++ int cnt; /* Number of terms counted */ ++}; ++ ++#if 0 /* Omit because math library is required */ ++/* ++** Routines used to compute the standard deviation as an aggregate. ++*/ ++static void stdDevStep(sqlite_func *context, int argc, const char **argv){ ++ StdDevCtx *p; ++ double x; ++ if( argc<1 ) return; ++ p = sqlite_aggregate_context(context, sizeof(*p)); ++ if( p && argv[0] ){ ++ x = sqliteAtoF(argv[0], 0); ++ p->sum += x; ++ p->sum2 += x*x; ++ p->cnt++; ++ } ++} ++static void stdDevFinalize(sqlite_func *context){ ++ double rN = sqlite_aggregate_count(context); ++ StdDevCtx *p = sqlite_aggregate_context(context, sizeof(*p)); ++ if( p && p->cnt>1 ){ ++ double rCnt = cnt; ++ sqlite_set_result_double(context, ++ sqrt((p->sum2 - p->sum*p->sum/rCnt)/(rCnt-1.0))); ++ } ++} ++#endif ++ ++/* ++** The following structure keeps track of state information for the ++** count() aggregate function. ++*/ ++typedef struct CountCtx CountCtx; ++struct CountCtx { ++ int n; ++}; ++ ++/* ++** Routines to implement the count() aggregate function. ++*/ ++static void countStep(sqlite_func *context, int argc, const char **argv){ ++ CountCtx *p; ++ p = sqlite_aggregate_context(context, sizeof(*p)); ++ if( (argc==0 || argv[0]) && p ){ ++ p->n++; ++ } ++} ++static void countFinalize(sqlite_func *context){ ++ CountCtx *p; ++ p = sqlite_aggregate_context(context, sizeof(*p)); ++ sqlite_set_result_int(context, p ? p->n : 0); ++} ++ ++/* ++** This function tracks state information for the min() and max() ++** aggregate functions. ++*/ ++typedef struct MinMaxCtx MinMaxCtx; ++struct MinMaxCtx { ++ char *z; /* The best so far */ ++ char zBuf[28]; /* Space that can be used for storage */ ++}; ++ ++/* ++** Routines to implement min() and max() aggregate functions. ++*/ ++static void minmaxStep(sqlite_func *context, int argc, const char **argv){ ++ MinMaxCtx *p; ++ int (*xCompare)(const char*, const char*); ++ int mask; /* 0 for min() or 0xffffffff for max() */ ++ ++ assert( argc==2 ); ++ if( argv[0]==0 ) return; /* Ignore NULL values */ ++ if( argv[1][0]=='n' ){ ++ xCompare = sqliteCompare; ++ }else{ ++ xCompare = strcmp; ++ } ++ mask = (int)sqlite_user_data(context); ++ assert( mask==0 || mask==-1 ); ++ p = sqlite_aggregate_context(context, sizeof(*p)); ++ if( p==0 || argc<1 ) return; ++ if( p->z==0 || (xCompare(argv[0],p->z)^mask)<0 ){ ++ int len; ++ if( p->zBuf[0] ){ ++ sqliteFree(p->z); ++ } ++ len = strlen(argv[0]); ++ if( len < sizeof(p->zBuf)-1 ){ ++ p->z = &p->zBuf[1]; ++ p->zBuf[0] = 0; ++ }else{ ++ p->z = sqliteMalloc( len+1 ); ++ p->zBuf[0] = 1; ++ if( p->z==0 ) return; ++ } ++ strcpy(p->z, argv[0]); ++ } ++} ++static void minMaxFinalize(sqlite_func *context){ ++ MinMaxCtx *p; ++ p = sqlite_aggregate_context(context, sizeof(*p)); ++ if( p && p->z && p->zBuf[0]<2 ){ ++ sqlite_set_result_string(context, p->z, strlen(p->z)); ++ } ++ if( p && p->zBuf[0] ){ ++ sqliteFree(p->z); ++ } ++} ++ ++/* ++** This function registered all of the above C functions as SQL ++** functions. This should be the only routine in this file with ++** external linkage. ++*/ ++void sqliteRegisterBuiltinFunctions(sqlite *db){ ++ static struct { ++ char *zName; ++ signed char nArg; ++ signed char dataType; ++ u8 argType; /* 0: none. 1: db 2: (-1) */ ++ void (*xFunc)(sqlite_func*,int,const char**); ++ } aFuncs[] = { ++ { "min", -1, SQLITE_ARGS, 0, minmaxFunc }, ++ { "min", 0, 0, 0, 0 }, ++ { "max", -1, SQLITE_ARGS, 2, minmaxFunc }, ++ { "max", 0, 0, 2, 0 }, ++ { "typeof", 1, SQLITE_TEXT, 0, typeofFunc }, ++ { "length", 1, SQLITE_NUMERIC, 0, lengthFunc }, ++ { "substr", 3, SQLITE_TEXT, 0, substrFunc }, ++ { "abs", 1, SQLITE_NUMERIC, 0, absFunc }, ++ { "round", 1, SQLITE_NUMERIC, 0, roundFunc }, ++ { "round", 2, SQLITE_NUMERIC, 0, roundFunc }, ++ { "upper", 1, SQLITE_TEXT, 0, upperFunc }, ++ { "lower", 1, SQLITE_TEXT, 0, lowerFunc }, ++ { "coalesce", -1, SQLITE_ARGS, 0, ifnullFunc }, ++ { "coalesce", 0, 0, 0, 0 }, ++ { "coalesce", 1, 0, 0, 0 }, ++ { "ifnull", 2, SQLITE_ARGS, 0, ifnullFunc }, ++ { "random", -1, SQLITE_NUMERIC, 0, randomFunc }, ++ { "like", 2, SQLITE_NUMERIC, 0, likeFunc }, ++ { "glob", 2, SQLITE_NUMERIC, 0, globFunc }, ++ { "nullif", 2, SQLITE_ARGS, 0, nullifFunc }, ++ { "sqlite_version",0,SQLITE_TEXT, 0, versionFunc}, ++ { "quote", 1, SQLITE_ARGS, 0, quoteFunc }, ++ { "last_insert_rowid", 0, SQLITE_NUMERIC, 1, last_insert_rowid }, ++ { "change_count", 0, SQLITE_NUMERIC, 1, change_count }, ++ { "last_statement_change_count", ++ 0, SQLITE_NUMERIC, 1, last_statement_change_count }, ++#ifdef SQLITE_SOUNDEX ++ { "soundex", 1, SQLITE_TEXT, 0, soundexFunc}, ++#endif ++#ifdef SQLITE_TEST ++ { "randstr", 2, SQLITE_TEXT, 0, randStr }, ++#endif ++ }; ++ static struct { ++ char *zName; ++ signed char nArg; ++ signed char dataType; ++ u8 argType; ++ void (*xStep)(sqlite_func*,int,const char**); ++ void (*xFinalize)(sqlite_func*); ++ } aAggs[] = { ++ { "min", 1, 0, 0, minmaxStep, minMaxFinalize }, ++ { "max", 1, 0, 2, minmaxStep, minMaxFinalize }, ++ { "sum", 1, SQLITE_NUMERIC, 0, sumStep, sumFinalize }, ++ { "avg", 1, SQLITE_NUMERIC, 0, sumStep, avgFinalize }, ++ { "count", 0, SQLITE_NUMERIC, 0, countStep, countFinalize }, ++ { "count", 1, SQLITE_NUMERIC, 0, countStep, countFinalize }, ++#if 0 ++ { "stddev", 1, SQLITE_NUMERIC, 0, stdDevStep, stdDevFinalize }, ++#endif ++ }; ++ static const char *azTypeFuncs[] = { "min", "max", "typeof" }; ++ int i; ++ ++ for(i=0; iaFunc, azTypeFuncs[i], n); ++ while( p ){ ++ p->includeTypes = 1; ++ p = p->pNext; ++ } ++ } ++ sqliteRegisterDateTimeFunctions(db); ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/hash.c +@@ -0,0 +1,356 @@ ++/* ++** 2001 September 22 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This is the implementation of generic hash-tables ++** used in SQLite. ++** ++** $Id$ ++*/ ++#include "sqliteInt.h" ++#include ++ ++/* Turn bulk memory into a hash table object by initializing the ++** fields of the Hash structure. ++** ++** "new" is a pointer to the hash table that is to be initialized. ++** keyClass is one of the constants SQLITE_HASH_INT, SQLITE_HASH_POINTER, ++** SQLITE_HASH_BINARY, or SQLITE_HASH_STRING. The value of keyClass ++** determines what kind of key the hash table will use. "copyKey" is ++** true if the hash table should make its own private copy of keys and ++** false if it should just use the supplied pointer. CopyKey only makes ++** sense for SQLITE_HASH_STRING and SQLITE_HASH_BINARY and is ignored ++** for other key classes. ++*/ ++void sqliteHashInit(Hash *new, int keyClass, int copyKey){ ++ assert( new!=0 ); ++ assert( keyClass>=SQLITE_HASH_INT && keyClass<=SQLITE_HASH_BINARY ); ++ new->keyClass = keyClass; ++ new->copyKey = copyKey && ++ (keyClass==SQLITE_HASH_STRING || keyClass==SQLITE_HASH_BINARY); ++ new->first = 0; ++ new->count = 0; ++ new->htsize = 0; ++ new->ht = 0; ++} ++ ++/* Remove all entries from a hash table. Reclaim all memory. ++** Call this routine to delete a hash table or to reset a hash table ++** to the empty state. ++*/ ++void sqliteHashClear(Hash *pH){ ++ HashElem *elem; /* For looping over all elements of the table */ ++ ++ assert( pH!=0 ); ++ elem = pH->first; ++ pH->first = 0; ++ if( pH->ht ) sqliteFree(pH->ht); ++ pH->ht = 0; ++ pH->htsize = 0; ++ while( elem ){ ++ HashElem *next_elem = elem->next; ++ if( pH->copyKey && elem->pKey ){ ++ sqliteFree(elem->pKey); ++ } ++ sqliteFree(elem); ++ elem = next_elem; ++ } ++ pH->count = 0; ++} ++ ++/* ++** Hash and comparison functions when the mode is SQLITE_HASH_INT ++*/ ++static int intHash(const void *pKey, int nKey){ ++ return nKey ^ (nKey<<8) ^ (nKey>>8); ++} ++static int intCompare(const void *pKey1, int n1, const void *pKey2, int n2){ ++ return n2 - n1; ++} ++ ++#if 0 /* NOT USED */ ++/* ++** Hash and comparison functions when the mode is SQLITE_HASH_POINTER ++*/ ++static int ptrHash(const void *pKey, int nKey){ ++ uptr x = Addr(pKey); ++ return x ^ (x<<8) ^ (x>>8); ++} ++static int ptrCompare(const void *pKey1, int n1, const void *pKey2, int n2){ ++ if( pKey1==pKey2 ) return 0; ++ if( pKey1 0 ){ ++ h = (h<<3) ^ h ^ *(z++); ++ } ++ return h & 0x7fffffff; ++} ++static int binCompare(const void *pKey1, int n1, const void *pKey2, int n2){ ++ if( n1!=n2 ) return n2-n1; ++ return memcmp(pKey1,pKey2,n1); ++} ++ ++/* ++** Return a pointer to the appropriate hash function given the key class. ++** ++** The C syntax in this function definition may be unfamilar to some ++** programmers, so we provide the following additional explanation: ++** ++** The name of the function is "hashFunction". The function takes a ++** single parameter "keyClass". The return value of hashFunction() ++** is a pointer to another function. Specifically, the return value ++** of hashFunction() is a pointer to a function that takes two parameters ++** with types "const void*" and "int" and returns an "int". ++*/ ++static int (*hashFunction(int keyClass))(const void*,int){ ++ switch( keyClass ){ ++ case SQLITE_HASH_INT: return &intHash; ++ /* case SQLITE_HASH_POINTER: return &ptrHash; // NOT USED */ ++ case SQLITE_HASH_STRING: return &strHash; ++ case SQLITE_HASH_BINARY: return &binHash;; ++ default: break; ++ } ++ return 0; ++} ++ ++/* ++** Return a pointer to the appropriate hash function given the key class. ++** ++** For help in interpreted the obscure C code in the function definition, ++** see the header comment on the previous function. ++*/ ++static int (*compareFunction(int keyClass))(const void*,int,const void*,int){ ++ switch( keyClass ){ ++ case SQLITE_HASH_INT: return &intCompare; ++ /* case SQLITE_HASH_POINTER: return &ptrCompare; // NOT USED */ ++ case SQLITE_HASH_STRING: return &strCompare; ++ case SQLITE_HASH_BINARY: return &binCompare; ++ default: break; ++ } ++ return 0; ++} ++ ++ ++/* Resize the hash table so that it cantains "new_size" buckets. ++** "new_size" must be a power of 2. The hash table might fail ++** to resize if sqliteMalloc() fails. ++*/ ++static void rehash(Hash *pH, int new_size){ ++ struct _ht *new_ht; /* The new hash table */ ++ HashElem *elem, *next_elem; /* For looping over existing elements */ ++ HashElem *x; /* Element being copied to new hash table */ ++ int (*xHash)(const void*,int); /* The hash function */ ++ ++ assert( (new_size & (new_size-1))==0 ); ++ new_ht = (struct _ht *)sqliteMalloc( new_size*sizeof(struct _ht) ); ++ if( new_ht==0 ) return; ++ if( pH->ht ) sqliteFree(pH->ht); ++ pH->ht = new_ht; ++ pH->htsize = new_size; ++ xHash = hashFunction(pH->keyClass); ++ for(elem=pH->first, pH->first=0; elem; elem = next_elem){ ++ int h = (*xHash)(elem->pKey, elem->nKey) & (new_size-1); ++ next_elem = elem->next; ++ x = new_ht[h].chain; ++ if( x ){ ++ elem->next = x; ++ elem->prev = x->prev; ++ if( x->prev ) x->prev->next = elem; ++ else pH->first = elem; ++ x->prev = elem; ++ }else{ ++ elem->next = pH->first; ++ if( pH->first ) pH->first->prev = elem; ++ elem->prev = 0; ++ pH->first = elem; ++ } ++ new_ht[h].chain = elem; ++ new_ht[h].count++; ++ } ++} ++ ++/* This function (for internal use only) locates an element in an ++** hash table that matches the given key. The hash for this key has ++** already been computed and is passed as the 4th parameter. ++*/ ++static HashElem *findElementGivenHash( ++ const Hash *pH, /* The pH to be searched */ ++ const void *pKey, /* The key we are searching for */ ++ int nKey, ++ int h /* The hash for this key. */ ++){ ++ HashElem *elem; /* Used to loop thru the element list */ ++ int count; /* Number of elements left to test */ ++ int (*xCompare)(const void*,int,const void*,int); /* comparison function */ ++ ++ if( pH->ht ){ ++ elem = pH->ht[h].chain; ++ count = pH->ht[h].count; ++ xCompare = compareFunction(pH->keyClass); ++ while( count-- && elem ){ ++ if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ ++ return elem; ++ } ++ elem = elem->next; ++ } ++ } ++ return 0; ++} ++ ++/* Remove a single entry from the hash table given a pointer to that ++** element and a hash on the element's key. ++*/ ++static void removeElementGivenHash( ++ Hash *pH, /* The pH containing "elem" */ ++ HashElem* elem, /* The element to be removed from the pH */ ++ int h /* Hash value for the element */ ++){ ++ if( elem->prev ){ ++ elem->prev->next = elem->next; ++ }else{ ++ pH->first = elem->next; ++ } ++ if( elem->next ){ ++ elem->next->prev = elem->prev; ++ } ++ if( pH->ht[h].chain==elem ){ ++ pH->ht[h].chain = elem->next; ++ } ++ pH->ht[h].count--; ++ if( pH->ht[h].count<=0 ){ ++ pH->ht[h].chain = 0; ++ } ++ if( pH->copyKey && elem->pKey ){ ++ sqliteFree(elem->pKey); ++ } ++ sqliteFree( elem ); ++ pH->count--; ++} ++ ++/* Attempt to locate an element of the hash table pH with a key ++** that matches pKey,nKey. Return the data for this element if it is ++** found, or NULL if there is no match. ++*/ ++void *sqliteHashFind(const Hash *pH, const void *pKey, int nKey){ ++ int h; /* A hash on key */ ++ HashElem *elem; /* The element that matches key */ ++ int (*xHash)(const void*,int); /* The hash function */ ++ ++ if( pH==0 || pH->ht==0 ) return 0; ++ xHash = hashFunction(pH->keyClass); ++ assert( xHash!=0 ); ++ h = (*xHash)(pKey,nKey); ++ assert( (pH->htsize & (pH->htsize-1))==0 ); ++ elem = findElementGivenHash(pH,pKey,nKey, h & (pH->htsize-1)); ++ return elem ? elem->data : 0; ++} ++ ++/* Insert an element into the hash table pH. The key is pKey,nKey ++** and the data is "data". ++** ++** If no element exists with a matching key, then a new ++** element is created. A copy of the key is made if the copyKey ++** flag is set. NULL is returned. ++** ++** If another element already exists with the same key, then the ++** new data replaces the old data and the old data is returned. ++** The key is not copied in this instance. If a malloc fails, then ++** the new data is returned and the hash table is unchanged. ++** ++** If the "data" parameter to this function is NULL, then the ++** element corresponding to "key" is removed from the hash table. ++*/ ++void *sqliteHashInsert(Hash *pH, const void *pKey, int nKey, void *data){ ++ int hraw; /* Raw hash value of the key */ ++ int h; /* the hash of the key modulo hash table size */ ++ HashElem *elem; /* Used to loop thru the element list */ ++ HashElem *new_elem; /* New element added to the pH */ ++ int (*xHash)(const void*,int); /* The hash function */ ++ ++ assert( pH!=0 ); ++ xHash = hashFunction(pH->keyClass); ++ assert( xHash!=0 ); ++ hraw = (*xHash)(pKey, nKey); ++ assert( (pH->htsize & (pH->htsize-1))==0 ); ++ h = hraw & (pH->htsize-1); ++ elem = findElementGivenHash(pH,pKey,nKey,h); ++ if( elem ){ ++ void *old_data = elem->data; ++ if( data==0 ){ ++ removeElementGivenHash(pH,elem,h); ++ }else{ ++ elem->data = data; ++ } ++ return old_data; ++ } ++ if( data==0 ) return 0; ++ new_elem = (HashElem*)sqliteMalloc( sizeof(HashElem) ); ++ if( new_elem==0 ) return data; ++ if( pH->copyKey && pKey!=0 ){ ++ new_elem->pKey = sqliteMallocRaw( nKey ); ++ if( new_elem->pKey==0 ){ ++ sqliteFree(new_elem); ++ return data; ++ } ++ memcpy((void*)new_elem->pKey, pKey, nKey); ++ }else{ ++ new_elem->pKey = (void*)pKey; ++ } ++ new_elem->nKey = nKey; ++ pH->count++; ++ if( pH->htsize==0 ) rehash(pH,8); ++ if( pH->htsize==0 ){ ++ pH->count = 0; ++ sqliteFree(new_elem); ++ return data; ++ } ++ if( pH->count > pH->htsize ){ ++ rehash(pH,pH->htsize*2); ++ } ++ assert( (pH->htsize & (pH->htsize-1))==0 ); ++ h = hraw & (pH->htsize-1); ++ elem = pH->ht[h].chain; ++ if( elem ){ ++ new_elem->next = elem; ++ new_elem->prev = elem->prev; ++ if( elem->prev ){ elem->prev->next = new_elem; } ++ else { pH->first = new_elem; } ++ elem->prev = new_elem; ++ }else{ ++ new_elem->next = pH->first; ++ new_elem->prev = 0; ++ if( pH->first ){ pH->first->prev = new_elem; } ++ pH->first = new_elem; ++ } ++ pH->ht[h].count++; ++ pH->ht[h].chain = new_elem; ++ new_elem->data = data; ++ return 0; ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/hash.h +@@ -0,0 +1,109 @@ ++/* ++** 2001 September 22 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This is the header file for the generic hash-table implemenation ++** used in SQLite. ++** ++** $Id$ ++*/ ++#ifndef _SQLITE_HASH_H_ ++#define _SQLITE_HASH_H_ ++ ++/* Forward declarations of structures. */ ++typedef struct Hash Hash; ++typedef struct HashElem HashElem; ++ ++/* A complete hash table is an instance of the following structure. ++** The internals of this structure are intended to be opaque -- client ++** code should not attempt to access or modify the fields of this structure ++** directly. Change this structure only by using the routines below. ++** However, many of the "procedures" and "functions" for modifying and ++** accessing this structure are really macros, so we can't really make ++** this structure opaque. ++*/ ++struct Hash { ++ char keyClass; /* SQLITE_HASH_INT, _POINTER, _STRING, _BINARY */ ++ char copyKey; /* True if copy of key made on insert */ ++ int count; /* Number of entries in this table */ ++ HashElem *first; /* The first element of the array */ ++ int htsize; /* Number of buckets in the hash table */ ++ struct _ht { /* the hash table */ ++ int count; /* Number of entries with this hash */ ++ HashElem *chain; /* Pointer to first entry with this hash */ ++ } *ht; ++}; ++ ++/* Each element in the hash table is an instance of the following ++** structure. All elements are stored on a single doubly-linked list. ++** ++** Again, this structure is intended to be opaque, but it can't really ++** be opaque because it is used by macros. ++*/ ++struct HashElem { ++ HashElem *next, *prev; /* Next and previous elements in the table */ ++ void *data; /* Data associated with this element */ ++ void *pKey; int nKey; /* Key associated with this element */ ++}; ++ ++/* ++** There are 4 different modes of operation for a hash table: ++** ++** SQLITE_HASH_INT nKey is used as the key and pKey is ignored. ++** ++** SQLITE_HASH_POINTER pKey is used as the key and nKey is ignored. ++** ++** SQLITE_HASH_STRING pKey points to a string that is nKey bytes long ++** (including the null-terminator, if any). Case ++** is ignored in comparisons. ++** ++** SQLITE_HASH_BINARY pKey points to binary data nKey bytes long. ++** memcmp() is used to compare keys. ++** ++** A copy of the key is made for SQLITE_HASH_STRING and SQLITE_HASH_BINARY ++** if the copyKey parameter to HashInit is 1. ++*/ ++#define SQLITE_HASH_INT 1 ++/* #define SQLITE_HASH_POINTER 2 // NOT USED */ ++#define SQLITE_HASH_STRING 3 ++#define SQLITE_HASH_BINARY 4 ++ ++/* ++** Access routines. To delete, insert a NULL pointer. ++*/ ++void sqliteHashInit(Hash*, int keytype, int copyKey); ++void *sqliteHashInsert(Hash*, const void *pKey, int nKey, void *pData); ++void *sqliteHashFind(const Hash*, const void *pKey, int nKey); ++void sqliteHashClear(Hash*); ++ ++/* ++** Macros for looping over all elements of a hash table. The idiom is ++** like this: ++** ++** Hash h; ++** HashElem *p; ++** ... ++** for(p=sqliteHashFirst(&h); p; p=sqliteHashNext(p)){ ++** SomeStructure *pData = sqliteHashData(p); ++** // do something with pData ++** } ++*/ ++#define sqliteHashFirst(H) ((H)->first) ++#define sqliteHashNext(E) ((E)->next) ++#define sqliteHashData(E) ((E)->data) ++#define sqliteHashKey(E) ((E)->pKey) ++#define sqliteHashKeysize(E) ((E)->nKey) ++ ++/* ++** Number of entries in a hash table ++*/ ++#define sqliteHashCount(H) ((H)->count) ++ ++#endif /* _SQLITE_HASH_H_ */ +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/insert.c +@@ -0,0 +1,919 @@ ++/* ++** 2001 September 15 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This file contains C code routines that are called by the parser ++** to handle INSERT statements in SQLite. ++** ++** $Id$ ++*/ ++#include "sqliteInt.h" ++ ++/* ++** This routine is call to handle SQL of the following forms: ++** ++** insert into TABLE (IDLIST) values(EXPRLIST) ++** insert into TABLE (IDLIST) select ++** ++** The IDLIST following the table name is always optional. If omitted, ++** then a list of all columns for the table is substituted. The IDLIST ++** appears in the pColumn parameter. pColumn is NULL if IDLIST is omitted. ++** ++** The pList parameter holds EXPRLIST in the first form of the INSERT ++** statement above, and pSelect is NULL. For the second form, pList is ++** NULL and pSelect is a pointer to the select statement used to generate ++** data for the insert. ++** ++** The code generated follows one of three templates. For a simple ++** select with data coming from a VALUES clause, the code executes ++** once straight down through. The template looks like this: ++** ++** open write cursor to and its indices ++** puts VALUES clause expressions onto the stack ++** write the resulting record into
    ++** cleanup ++** ++** If the statement is of the form ++** ++** INSERT INTO
    SELECT ... ++** ++** And the SELECT clause does not read from
    at any time, then ++** the generated code follows this template: ++** ++** goto B ++** A: setup for the SELECT ++** loop over the tables in the SELECT ++** gosub C ++** end loop ++** cleanup after the SELECT ++** goto D ++** B: open write cursor to
    and its indices ++** goto A ++** C: insert the select result into
    ++** return ++** D: cleanup ++** ++** The third template is used if the insert statement takes its ++** values from a SELECT but the data is being inserted into a table ++** that is also read as part of the SELECT. In the third form, ++** we have to use a intermediate table to store the results of ++** the select. The template is like this: ++** ++** goto B ++** A: setup for the SELECT ++** loop over the tables in the SELECT ++** gosub C ++** end loop ++** cleanup after the SELECT ++** goto D ++** C: insert the select result into the intermediate table ++** return ++** B: open a cursor to an intermediate table ++** goto A ++** D: open write cursor to
    and its indices ++** loop over the intermediate table ++** transfer values form intermediate table into
    ++** end the loop ++** cleanup ++*/ ++void sqliteInsert( ++ Parse *pParse, /* Parser context */ ++ SrcList *pTabList, /* Name of table into which we are inserting */ ++ ExprList *pList, /* List of values to be inserted */ ++ Select *pSelect, /* A SELECT statement to use as the data source */ ++ IdList *pColumn, /* Column names corresponding to IDLIST. */ ++ int onError /* How to handle constraint errors */ ++){ ++ Table *pTab; /* The table to insert into */ ++ char *zTab; /* Name of the table into which we are inserting */ ++ const char *zDb; /* Name of the database holding this table */ ++ int i, j, idx; /* Loop counters */ ++ Vdbe *v; /* Generate code into this virtual machine */ ++ Index *pIdx; /* For looping over indices of the table */ ++ int nColumn; /* Number of columns in the data */ ++ int base; /* VDBE Cursor number for pTab */ ++ int iCont, iBreak; /* Beginning and end of the loop over srcTab */ ++ sqlite *db; /* The main database structure */ ++ int keyColumn = -1; /* Column that is the INTEGER PRIMARY KEY */ ++ int endOfLoop; /* Label for the end of the insertion loop */ ++ int useTempTable; /* Store SELECT results in intermediate table */ ++ int srcTab; /* Data comes from this temporary cursor if >=0 */ ++ int iSelectLoop; /* Address of code that implements the SELECT */ ++ int iCleanup; /* Address of the cleanup code */ ++ int iInsertBlock; /* Address of the subroutine used to insert data */ ++ int iCntMem; /* Memory cell used for the row counter */ ++ int isView; /* True if attempting to insert into a view */ ++ ++ int row_triggers_exist = 0; /* True if there are FOR EACH ROW triggers */ ++ int before_triggers; /* True if there are BEFORE triggers */ ++ int after_triggers; /* True if there are AFTER triggers */ ++ int newIdx = -1; /* Cursor for the NEW table */ ++ ++ if( pParse->nErr || sqlite_malloc_failed ) goto insert_cleanup; ++ db = pParse->db; ++ ++ /* Locate the table into which we will be inserting new information. ++ */ ++ assert( pTabList->nSrc==1 ); ++ zTab = pTabList->a[0].zName; ++ if( zTab==0 ) goto insert_cleanup; ++ pTab = sqliteSrcListLookup(pParse, pTabList); ++ if( pTab==0 ){ ++ goto insert_cleanup; ++ } ++ assert( pTab->iDbnDb ); ++ zDb = db->aDb[pTab->iDb].zName; ++ if( sqliteAuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, zDb) ){ ++ goto insert_cleanup; ++ } ++ ++ /* Ensure that: ++ * (a) the table is not read-only, ++ * (b) that if it is a view then ON INSERT triggers exist ++ */ ++ before_triggers = sqliteTriggersExist(pParse, pTab->pTrigger, TK_INSERT, ++ TK_BEFORE, TK_ROW, 0); ++ after_triggers = sqliteTriggersExist(pParse, pTab->pTrigger, TK_INSERT, ++ TK_AFTER, TK_ROW, 0); ++ row_triggers_exist = before_triggers || after_triggers; ++ isView = pTab->pSelect!=0; ++ if( sqliteIsReadOnly(pParse, pTab, before_triggers) ){ ++ goto insert_cleanup; ++ } ++ if( pTab==0 ) goto insert_cleanup; ++ ++ /* If pTab is really a view, make sure it has been initialized. ++ */ ++ if( isView && sqliteViewGetColumnNames(pParse, pTab) ){ ++ goto insert_cleanup; ++ } ++ ++ /* Allocate a VDBE ++ */ ++ v = sqliteGetVdbe(pParse); ++ if( v==0 ) goto insert_cleanup; ++ sqliteBeginWriteOperation(pParse, pSelect || row_triggers_exist, pTab->iDb); ++ ++ /* if there are row triggers, allocate a temp table for new.* references. */ ++ if( row_triggers_exist ){ ++ newIdx = pParse->nTab++; ++ } ++ ++ /* Figure out how many columns of data are supplied. If the data ++ ** is coming from a SELECT statement, then this step also generates ++ ** all the code to implement the SELECT statement and invoke a subroutine ++ ** to process each row of the result. (Template 2.) If the SELECT ++ ** statement uses the the table that is being inserted into, then the ++ ** subroutine is also coded here. That subroutine stores the SELECT ++ ** results in a temporary table. (Template 3.) ++ */ ++ if( pSelect ){ ++ /* Data is coming from a SELECT. Generate code to implement that SELECT ++ */ ++ int rc, iInitCode; ++ iInitCode = sqliteVdbeAddOp(v, OP_Goto, 0, 0); ++ iSelectLoop = sqliteVdbeCurrentAddr(v); ++ iInsertBlock = sqliteVdbeMakeLabel(v); ++ rc = sqliteSelect(pParse, pSelect, SRT_Subroutine, iInsertBlock, 0,0,0); ++ if( rc || pParse->nErr || sqlite_malloc_failed ) goto insert_cleanup; ++ iCleanup = sqliteVdbeMakeLabel(v); ++ sqliteVdbeAddOp(v, OP_Goto, 0, iCleanup); ++ assert( pSelect->pEList ); ++ nColumn = pSelect->pEList->nExpr; ++ ++ /* Set useTempTable to TRUE if the result of the SELECT statement ++ ** should be written into a temporary table. Set to FALSE if each ++ ** row of the SELECT can be written directly into the result table. ++ ** ++ ** A temp table must be used if the table being updated is also one ++ ** of the tables being read by the SELECT statement. Also use a ++ ** temp table in the case of row triggers. ++ */ ++ if( row_triggers_exist ){ ++ useTempTable = 1; ++ }else{ ++ int addr = sqliteVdbeFindOp(v, OP_OpenRead, pTab->tnum); ++ useTempTable = 0; ++ if( addr>0 ){ ++ VdbeOp *pOp = sqliteVdbeGetOp(v, addr-2); ++ if( pOp->opcode==OP_Integer && pOp->p1==pTab->iDb ){ ++ useTempTable = 1; ++ } ++ } ++ } ++ ++ if( useTempTable ){ ++ /* Generate the subroutine that SELECT calls to process each row of ++ ** the result. Store the result in a temporary table ++ */ ++ srcTab = pParse->nTab++; ++ sqliteVdbeResolveLabel(v, iInsertBlock); ++ sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, 0); ++ sqliteVdbeAddOp(v, OP_NewRecno, srcTab, 0); ++ sqliteVdbeAddOp(v, OP_Pull, 1, 0); ++ sqliteVdbeAddOp(v, OP_PutIntKey, srcTab, 0); ++ sqliteVdbeAddOp(v, OP_Return, 0, 0); ++ ++ /* The following code runs first because the GOTO at the very top ++ ** of the program jumps to it. Create the temporary table, then jump ++ ** back up and execute the SELECT code above. ++ */ ++ sqliteVdbeChangeP2(v, iInitCode, sqliteVdbeCurrentAddr(v)); ++ sqliteVdbeAddOp(v, OP_OpenTemp, srcTab, 0); ++ sqliteVdbeAddOp(v, OP_Goto, 0, iSelectLoop); ++ sqliteVdbeResolveLabel(v, iCleanup); ++ }else{ ++ sqliteVdbeChangeP2(v, iInitCode, sqliteVdbeCurrentAddr(v)); ++ } ++ }else{ ++ /* This is the case if the data for the INSERT is coming from a VALUES ++ ** clause ++ */ ++ SrcList dummy; ++ assert( pList!=0 ); ++ srcTab = -1; ++ useTempTable = 0; ++ assert( pList ); ++ nColumn = pList->nExpr; ++ dummy.nSrc = 0; ++ for(i=0; ia[i].pExpr) ){ ++ goto insert_cleanup; ++ } ++ if( sqliteExprCheck(pParse, pList->a[i].pExpr, 0, 0) ){ ++ goto insert_cleanup; ++ } ++ } ++ } ++ ++ /* Make sure the number of columns in the source data matches the number ++ ** of columns to be inserted into the table. ++ */ ++ if( pColumn==0 && nColumn!=pTab->nCol ){ ++ sqliteErrorMsg(pParse, ++ "table %S has %d columns but %d values were supplied", ++ pTabList, 0, pTab->nCol, nColumn); ++ goto insert_cleanup; ++ } ++ if( pColumn!=0 && nColumn!=pColumn->nId ){ ++ sqliteErrorMsg(pParse, "%d values for %d columns", nColumn, pColumn->nId); ++ goto insert_cleanup; ++ } ++ ++ /* If the INSERT statement included an IDLIST term, then make sure ++ ** all elements of the IDLIST really are columns of the table and ++ ** remember the column indices. ++ ** ++ ** If the table has an INTEGER PRIMARY KEY column and that column ++ ** is named in the IDLIST, then record in the keyColumn variable ++ ** the index into IDLIST of the primary key column. keyColumn is ++ ** the index of the primary key as it appears in IDLIST, not as ++ ** is appears in the original table. (The index of the primary ++ ** key in the original table is pTab->iPKey.) ++ */ ++ if( pColumn ){ ++ for(i=0; inId; i++){ ++ pColumn->a[i].idx = -1; ++ } ++ for(i=0; inId; i++){ ++ for(j=0; jnCol; j++){ ++ if( sqliteStrICmp(pColumn->a[i].zName, pTab->aCol[j].zName)==0 ){ ++ pColumn->a[i].idx = j; ++ if( j==pTab->iPKey ){ ++ keyColumn = i; ++ } ++ break; ++ } ++ } ++ if( j>=pTab->nCol ){ ++ if( sqliteIsRowid(pColumn->a[i].zName) ){ ++ keyColumn = i; ++ }else{ ++ sqliteErrorMsg(pParse, "table %S has no column named %s", ++ pTabList, 0, pColumn->a[i].zName); ++ pParse->nErr++; ++ goto insert_cleanup; ++ } ++ } ++ } ++ } ++ ++ /* If there is no IDLIST term but the table has an integer primary ++ ** key, the set the keyColumn variable to the primary key column index ++ ** in the original table definition. ++ */ ++ if( pColumn==0 ){ ++ keyColumn = pTab->iPKey; ++ } ++ ++ /* Open the temp table for FOR EACH ROW triggers ++ */ ++ if( row_triggers_exist ){ ++ sqliteVdbeAddOp(v, OP_OpenPseudo, newIdx, 0); ++ } ++ ++ /* Initialize the count of rows to be inserted ++ */ ++ if( db->flags & SQLITE_CountRows ){ ++ iCntMem = pParse->nMem++; ++ sqliteVdbeAddOp(v, OP_Integer, 0, 0); ++ sqliteVdbeAddOp(v, OP_MemStore, iCntMem, 1); ++ } ++ ++ /* Open tables and indices if there are no row triggers */ ++ if( !row_triggers_exist ){ ++ base = pParse->nTab; ++ idx = sqliteOpenTableAndIndices(pParse, pTab, base); ++ pParse->nTab += idx; ++ } ++ ++ /* If the data source is a temporary table, then we have to create ++ ** a loop because there might be multiple rows of data. If the data ++ ** source is a subroutine call from the SELECT statement, then we need ++ ** to launch the SELECT statement processing. ++ */ ++ if( useTempTable ){ ++ iBreak = sqliteVdbeMakeLabel(v); ++ sqliteVdbeAddOp(v, OP_Rewind, srcTab, iBreak); ++ iCont = sqliteVdbeCurrentAddr(v); ++ }else if( pSelect ){ ++ sqliteVdbeAddOp(v, OP_Goto, 0, iSelectLoop); ++ sqliteVdbeResolveLabel(v, iInsertBlock); ++ } ++ ++ /* Run the BEFORE and INSTEAD OF triggers, if there are any ++ */ ++ endOfLoop = sqliteVdbeMakeLabel(v); ++ if( before_triggers ){ ++ ++ /* build the NEW.* reference row. Note that if there is an INTEGER ++ ** PRIMARY KEY into which a NULL is being inserted, that NULL will be ++ ** translated into a unique ID for the row. But on a BEFORE trigger, ++ ** we do not know what the unique ID will be (because the insert has ++ ** not happened yet) so we substitute a rowid of -1 ++ */ ++ if( keyColumn<0 ){ ++ sqliteVdbeAddOp(v, OP_Integer, -1, 0); ++ }else if( useTempTable ){ ++ sqliteVdbeAddOp(v, OP_Column, srcTab, keyColumn); ++ }else if( pSelect ){ ++ sqliteVdbeAddOp(v, OP_Dup, nColumn - keyColumn - 1, 1); ++ }else{ ++ sqliteExprCode(pParse, pList->a[keyColumn].pExpr); ++ sqliteVdbeAddOp(v, OP_NotNull, -1, sqliteVdbeCurrentAddr(v)+3); ++ sqliteVdbeAddOp(v, OP_Pop, 1, 0); ++ sqliteVdbeAddOp(v, OP_Integer, -1, 0); ++ sqliteVdbeAddOp(v, OP_MustBeInt, 0, 0); ++ } ++ ++ /* Create the new column data ++ */ ++ for(i=0; inCol; i++){ ++ if( pColumn==0 ){ ++ j = i; ++ }else{ ++ for(j=0; jnId; j++){ ++ if( pColumn->a[j].idx==i ) break; ++ } ++ } ++ if( pColumn && j>=pColumn->nId ){ ++ sqliteVdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); ++ }else if( useTempTable ){ ++ sqliteVdbeAddOp(v, OP_Column, srcTab, j); ++ }else if( pSelect ){ ++ sqliteVdbeAddOp(v, OP_Dup, nColumn-j-1, 1); ++ }else{ ++ sqliteExprCode(pParse, pList->a[j].pExpr); ++ } ++ } ++ sqliteVdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0); ++ sqliteVdbeAddOp(v, OP_PutIntKey, newIdx, 0); ++ ++ /* Fire BEFORE or INSTEAD OF triggers */ ++ if( sqliteCodeRowTrigger(pParse, TK_INSERT, 0, TK_BEFORE, pTab, ++ newIdx, -1, onError, endOfLoop) ){ ++ goto insert_cleanup; ++ } ++ } ++ ++ /* If any triggers exists, the opening of tables and indices is deferred ++ ** until now. ++ */ ++ if( row_triggers_exist && !isView ){ ++ base = pParse->nTab; ++ idx = sqliteOpenTableAndIndices(pParse, pTab, base); ++ pParse->nTab += idx; ++ } ++ ++ /* Push the record number for the new entry onto the stack. The ++ ** record number is a randomly generate integer created by NewRecno ++ ** except when the table has an INTEGER PRIMARY KEY column, in which ++ ** case the record number is the same as that column. ++ */ ++ if( !isView ){ ++ if( keyColumn>=0 ){ ++ if( useTempTable ){ ++ sqliteVdbeAddOp(v, OP_Column, srcTab, keyColumn); ++ }else if( pSelect ){ ++ sqliteVdbeAddOp(v, OP_Dup, nColumn - keyColumn - 1, 1); ++ }else{ ++ sqliteExprCode(pParse, pList->a[keyColumn].pExpr); ++ } ++ /* If the PRIMARY KEY expression is NULL, then use OP_NewRecno ++ ** to generate a unique primary key value. ++ */ ++ sqliteVdbeAddOp(v, OP_NotNull, -1, sqliteVdbeCurrentAddr(v)+3); ++ sqliteVdbeAddOp(v, OP_Pop, 1, 0); ++ sqliteVdbeAddOp(v, OP_NewRecno, base, 0); ++ sqliteVdbeAddOp(v, OP_MustBeInt, 0, 0); ++ }else{ ++ sqliteVdbeAddOp(v, OP_NewRecno, base, 0); ++ } ++ ++ /* Push onto the stack, data for all columns of the new entry, beginning ++ ** with the first column. ++ */ ++ for(i=0; inCol; i++){ ++ if( i==pTab->iPKey ){ ++ /* The value of the INTEGER PRIMARY KEY column is always a NULL. ++ ** Whenever this column is read, the record number will be substituted ++ ** in its place. So will fill this column with a NULL to avoid ++ ** taking up data space with information that will never be used. */ ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ continue; ++ } ++ if( pColumn==0 ){ ++ j = i; ++ }else{ ++ for(j=0; jnId; j++){ ++ if( pColumn->a[j].idx==i ) break; ++ } ++ } ++ if( pColumn && j>=pColumn->nId ){ ++ sqliteVdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); ++ }else if( useTempTable ){ ++ sqliteVdbeAddOp(v, OP_Column, srcTab, j); ++ }else if( pSelect ){ ++ sqliteVdbeAddOp(v, OP_Dup, i+nColumn-j, 1); ++ }else{ ++ sqliteExprCode(pParse, pList->a[j].pExpr); ++ } ++ } ++ ++ /* Generate code to check constraints and generate index keys and ++ ** do the insertion. ++ */ ++ sqliteGenerateConstraintChecks(pParse, pTab, base, 0, keyColumn>=0, ++ 0, onError, endOfLoop); ++ sqliteCompleteInsertion(pParse, pTab, base, 0,0,0, ++ after_triggers ? newIdx : -1); ++ } ++ ++ /* Update the count of rows that are inserted ++ */ ++ if( (db->flags & SQLITE_CountRows)!=0 ){ ++ sqliteVdbeAddOp(v, OP_MemIncr, iCntMem, 0); ++ } ++ ++ if( row_triggers_exist ){ ++ /* Close all tables opened */ ++ if( !isView ){ ++ sqliteVdbeAddOp(v, OP_Close, base, 0); ++ for(idx=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, idx++){ ++ sqliteVdbeAddOp(v, OP_Close, idx+base, 0); ++ } ++ } ++ ++ /* Code AFTER triggers */ ++ if( sqliteCodeRowTrigger(pParse, TK_INSERT, 0, TK_AFTER, pTab, newIdx, -1, ++ onError, endOfLoop) ){ ++ goto insert_cleanup; ++ } ++ } ++ ++ /* The bottom of the loop, if the data source is a SELECT statement ++ */ ++ sqliteVdbeResolveLabel(v, endOfLoop); ++ if( useTempTable ){ ++ sqliteVdbeAddOp(v, OP_Next, srcTab, iCont); ++ sqliteVdbeResolveLabel(v, iBreak); ++ sqliteVdbeAddOp(v, OP_Close, srcTab, 0); ++ }else if( pSelect ){ ++ sqliteVdbeAddOp(v, OP_Pop, nColumn, 0); ++ sqliteVdbeAddOp(v, OP_Return, 0, 0); ++ sqliteVdbeResolveLabel(v, iCleanup); ++ } ++ ++ if( !row_triggers_exist ){ ++ /* Close all tables opened */ ++ sqliteVdbeAddOp(v, OP_Close, base, 0); ++ for(idx=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, idx++){ ++ sqliteVdbeAddOp(v, OP_Close, idx+base, 0); ++ } ++ } ++ ++ sqliteVdbeAddOp(v, OP_SetCounts, 0, 0); ++ sqliteEndWriteOperation(pParse); ++ ++ /* ++ ** Return the number of rows inserted. ++ */ ++ if( db->flags & SQLITE_CountRows ){ ++ sqliteVdbeOp3(v, OP_ColumnName, 0, 1, "rows inserted", P3_STATIC); ++ sqliteVdbeAddOp(v, OP_MemLoad, iCntMem, 0); ++ sqliteVdbeAddOp(v, OP_Callback, 1, 0); ++ } ++ ++insert_cleanup: ++ sqliteSrcListDelete(pTabList); ++ if( pList ) sqliteExprListDelete(pList); ++ if( pSelect ) sqliteSelectDelete(pSelect); ++ sqliteIdListDelete(pColumn); ++} ++ ++/* ++** Generate code to do a constraint check prior to an INSERT or an UPDATE. ++** ++** When this routine is called, the stack contains (from bottom to top) ++** the following values: ++** ++** 1. The recno of the row to be updated before the update. This ++** value is omitted unless we are doing an UPDATE that involves a ++** change to the record number. ++** ++** 2. The recno of the row after the update. ++** ++** 3. The data in the first column of the entry after the update. ++** ++** i. Data from middle columns... ++** ++** N. The data in the last column of the entry after the update. ++** ++** The old recno shown as entry (1) above is omitted unless both isUpdate ++** and recnoChng are 1. isUpdate is true for UPDATEs and false for ++** INSERTs and recnoChng is true if the record number is being changed. ++** ++** The code generated by this routine pushes additional entries onto ++** the stack which are the keys for new index entries for the new record. ++** The order of index keys is the same as the order of the indices on ++** the pTable->pIndex list. A key is only created for index i if ++** aIdxUsed!=0 and aIdxUsed[i]!=0. ++** ++** This routine also generates code to check constraints. NOT NULL, ++** CHECK, and UNIQUE constraints are all checked. If a constraint fails, ++** then the appropriate action is performed. There are five possible ++** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE. ++** ++** Constraint type Action What Happens ++** --------------- ---------- ---------------------------------------- ++** any ROLLBACK The current transaction is rolled back and ++** sqlite_exec() returns immediately with a ++** return code of SQLITE_CONSTRAINT. ++** ++** any ABORT Back out changes from the current command ++** only (do not do a complete rollback) then ++** cause sqlite_exec() to return immediately ++** with SQLITE_CONSTRAINT. ++** ++** any FAIL Sqlite_exec() returns immediately with a ++** return code of SQLITE_CONSTRAINT. The ++** transaction is not rolled back and any ++** prior changes are retained. ++** ++** any IGNORE The record number and data is popped from ++** the stack and there is an immediate jump ++** to label ignoreDest. ++** ++** NOT NULL REPLACE The NULL value is replace by the default ++** value for that column. If the default value ++** is NULL, the action is the same as ABORT. ++** ++** UNIQUE REPLACE The other row that conflicts with the row ++** being inserted is removed. ++** ++** CHECK REPLACE Illegal. The results in an exception. ++** ++** Which action to take is determined by the overrideError parameter. ++** Or if overrideError==OE_Default, then the pParse->onError parameter ++** is used. Or if pParse->onError==OE_Default then the onError value ++** for the constraint is used. ++** ++** The calling routine must open a read/write cursor for pTab with ++** cursor number "base". All indices of pTab must also have open ++** read/write cursors with cursor number base+i for the i-th cursor. ++** Except, if there is no possibility of a REPLACE action then ++** cursors do not need to be open for indices where aIdxUsed[i]==0. ++** ++** If the isUpdate flag is true, it means that the "base" cursor is ++** initially pointing to an entry that is being updated. The isUpdate ++** flag causes extra code to be generated so that the "base" cursor ++** is still pointing at the same entry after the routine returns. ++** Without the isUpdate flag, the "base" cursor might be moved. ++*/ ++void sqliteGenerateConstraintChecks( ++ Parse *pParse, /* The parser context */ ++ Table *pTab, /* the table into which we are inserting */ ++ int base, /* Index of a read/write cursor pointing at pTab */ ++ char *aIdxUsed, /* Which indices are used. NULL means all are used */ ++ int recnoChng, /* True if the record number will change */ ++ int isUpdate, /* True for UPDATE, False for INSERT */ ++ int overrideError, /* Override onError to this if not OE_Default */ ++ int ignoreDest /* Jump to this label on an OE_Ignore resolution */ ++){ ++ int i; ++ Vdbe *v; ++ int nCol; ++ int onError; ++ int addr; ++ int extra; ++ int iCur; ++ Index *pIdx; ++ int seenReplace = 0; ++ int jumpInst1, jumpInst2; ++ int contAddr; ++ int hasTwoRecnos = (isUpdate && recnoChng); ++ ++ v = sqliteGetVdbe(pParse); ++ assert( v!=0 ); ++ assert( pTab->pSelect==0 ); /* This table is not a VIEW */ ++ nCol = pTab->nCol; ++ ++ /* Test all NOT NULL constraints. ++ */ ++ for(i=0; iiPKey ){ ++ continue; ++ } ++ onError = pTab->aCol[i].notNull; ++ if( onError==OE_None ) continue; ++ if( overrideError!=OE_Default ){ ++ onError = overrideError; ++ }else if( pParse->db->onError!=OE_Default ){ ++ onError = pParse->db->onError; ++ }else if( onError==OE_Default ){ ++ onError = OE_Abort; ++ } ++ if( onError==OE_Replace && pTab->aCol[i].zDflt==0 ){ ++ onError = OE_Abort; ++ } ++ sqliteVdbeAddOp(v, OP_Dup, nCol-1-i, 1); ++ addr = sqliteVdbeAddOp(v, OP_NotNull, 1, 0); ++ switch( onError ){ ++ case OE_Rollback: ++ case OE_Abort: ++ case OE_Fail: { ++ char *zMsg = 0; ++ sqliteVdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, onError); ++ sqliteSetString(&zMsg, pTab->zName, ".", pTab->aCol[i].zName, ++ " may not be NULL", (char*)0); ++ sqliteVdbeChangeP3(v, -1, zMsg, P3_DYNAMIC); ++ break; ++ } ++ case OE_Ignore: { ++ sqliteVdbeAddOp(v, OP_Pop, nCol+1+hasTwoRecnos, 0); ++ sqliteVdbeAddOp(v, OP_Goto, 0, ignoreDest); ++ break; ++ } ++ case OE_Replace: { ++ sqliteVdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); ++ sqliteVdbeAddOp(v, OP_Push, nCol-i, 0); ++ break; ++ } ++ default: assert(0); ++ } ++ sqliteVdbeChangeP2(v, addr, sqliteVdbeCurrentAddr(v)); ++ } ++ ++ /* Test all CHECK constraints ++ */ ++ /**** TBD ****/ ++ ++ /* If we have an INTEGER PRIMARY KEY, make sure the primary key ++ ** of the new record does not previously exist. Except, if this ++ ** is an UPDATE and the primary key is not changing, that is OK. ++ */ ++ if( recnoChng ){ ++ onError = pTab->keyConf; ++ if( overrideError!=OE_Default ){ ++ onError = overrideError; ++ }else if( pParse->db->onError!=OE_Default ){ ++ onError = pParse->db->onError; ++ }else if( onError==OE_Default ){ ++ onError = OE_Abort; ++ } ++ ++ if( isUpdate ){ ++ sqliteVdbeAddOp(v, OP_Dup, nCol+1, 1); ++ sqliteVdbeAddOp(v, OP_Dup, nCol+1, 1); ++ jumpInst1 = sqliteVdbeAddOp(v, OP_Eq, 0, 0); ++ } ++ sqliteVdbeAddOp(v, OP_Dup, nCol, 1); ++ jumpInst2 = sqliteVdbeAddOp(v, OP_NotExists, base, 0); ++ switch( onError ){ ++ default: { ++ onError = OE_Abort; ++ /* Fall thru into the next case */ ++ } ++ case OE_Rollback: ++ case OE_Abort: ++ case OE_Fail: { ++ sqliteVdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, onError, ++ "PRIMARY KEY must be unique", P3_STATIC); ++ break; ++ } ++ case OE_Replace: { ++ sqliteGenerateRowIndexDelete(pParse->db, v, pTab, base, 0); ++ if( isUpdate ){ ++ sqliteVdbeAddOp(v, OP_Dup, nCol+hasTwoRecnos, 1); ++ sqliteVdbeAddOp(v, OP_MoveTo, base, 0); ++ } ++ seenReplace = 1; ++ break; ++ } ++ case OE_Ignore: { ++ assert( seenReplace==0 ); ++ sqliteVdbeAddOp(v, OP_Pop, nCol+1+hasTwoRecnos, 0); ++ sqliteVdbeAddOp(v, OP_Goto, 0, ignoreDest); ++ break; ++ } ++ } ++ contAddr = sqliteVdbeCurrentAddr(v); ++ sqliteVdbeChangeP2(v, jumpInst2, contAddr); ++ if( isUpdate ){ ++ sqliteVdbeChangeP2(v, jumpInst1, contAddr); ++ sqliteVdbeAddOp(v, OP_Dup, nCol+1, 1); ++ sqliteVdbeAddOp(v, OP_MoveTo, base, 0); ++ } ++ } ++ ++ /* Test all UNIQUE constraints by creating entries for each UNIQUE ++ ** index and making sure that duplicate entries do not already exist. ++ ** Add the new records to the indices as we go. ++ */ ++ extra = -1; ++ for(iCur=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, iCur++){ ++ if( aIdxUsed && aIdxUsed[iCur]==0 ) continue; /* Skip unused indices */ ++ extra++; ++ ++ /* Create a key for accessing the index entry */ ++ sqliteVdbeAddOp(v, OP_Dup, nCol+extra, 1); ++ for(i=0; inColumn; i++){ ++ int idx = pIdx->aiColumn[i]; ++ if( idx==pTab->iPKey ){ ++ sqliteVdbeAddOp(v, OP_Dup, i+extra+nCol+1, 1); ++ }else{ ++ sqliteVdbeAddOp(v, OP_Dup, i+extra+nCol-idx, 1); ++ } ++ } ++ jumpInst1 = sqliteVdbeAddOp(v, OP_MakeIdxKey, pIdx->nColumn, 0); ++ if( pParse->db->file_format>=4 ) sqliteAddIdxKeyType(v, pIdx); ++ ++ /* Find out what action to take in case there is an indexing conflict */ ++ onError = pIdx->onError; ++ if( onError==OE_None ) continue; /* pIdx is not a UNIQUE index */ ++ if( overrideError!=OE_Default ){ ++ onError = overrideError; ++ }else if( pParse->db->onError!=OE_Default ){ ++ onError = pParse->db->onError; ++ }else if( onError==OE_Default ){ ++ onError = OE_Abort; ++ } ++ if( seenReplace ){ ++ if( onError==OE_Ignore ) onError = OE_Replace; ++ else if( onError==OE_Fail ) onError = OE_Abort; ++ } ++ ++ ++ /* Check to see if the new index entry will be unique */ ++ sqliteVdbeAddOp(v, OP_Dup, extra+nCol+1+hasTwoRecnos, 1); ++ jumpInst2 = sqliteVdbeAddOp(v, OP_IsUnique, base+iCur+1, 0); ++ ++ /* Generate code that executes if the new index entry is not unique */ ++ switch( onError ){ ++ case OE_Rollback: ++ case OE_Abort: ++ case OE_Fail: { ++ int j, n1, n2; ++ char zErrMsg[200]; ++ strcpy(zErrMsg, pIdx->nColumn>1 ? "columns " : "column "); ++ n1 = strlen(zErrMsg); ++ for(j=0; jnColumn && n1aCol[pIdx->aiColumn[j]].zName; ++ n2 = strlen(zCol); ++ if( j>0 ){ ++ strcpy(&zErrMsg[n1], ", "); ++ n1 += 2; ++ } ++ if( n1+n2>sizeof(zErrMsg)-30 ){ ++ strcpy(&zErrMsg[n1], "..."); ++ n1 += 3; ++ break; ++ }else{ ++ strcpy(&zErrMsg[n1], zCol); ++ n1 += n2; ++ } ++ } ++ strcpy(&zErrMsg[n1], ++ pIdx->nColumn>1 ? " are not unique" : " is not unique"); ++ sqliteVdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, onError, zErrMsg, 0); ++ break; ++ } ++ case OE_Ignore: { ++ assert( seenReplace==0 ); ++ sqliteVdbeAddOp(v, OP_Pop, nCol+extra+3+hasTwoRecnos, 0); ++ sqliteVdbeAddOp(v, OP_Goto, 0, ignoreDest); ++ break; ++ } ++ case OE_Replace: { ++ sqliteGenerateRowDelete(pParse->db, v, pTab, base, 0); ++ if( isUpdate ){ ++ sqliteVdbeAddOp(v, OP_Dup, nCol+extra+1+hasTwoRecnos, 1); ++ sqliteVdbeAddOp(v, OP_MoveTo, base, 0); ++ } ++ seenReplace = 1; ++ break; ++ } ++ default: assert(0); ++ } ++ contAddr = sqliteVdbeCurrentAddr(v); ++#if NULL_DISTINCT_FOR_UNIQUE ++ sqliteVdbeChangeP2(v, jumpInst1, contAddr); ++#endif ++ sqliteVdbeChangeP2(v, jumpInst2, contAddr); ++ } ++} ++ ++/* ++** This routine generates code to finish the INSERT or UPDATE operation ++** that was started by a prior call to sqliteGenerateConstraintChecks. ++** The stack must contain keys for all active indices followed by data ++** and the recno for the new entry. This routine creates the new ++** entries in all indices and in the main table. ++** ++** The arguments to this routine should be the same as the first six ++** arguments to sqliteGenerateConstraintChecks. ++*/ ++void sqliteCompleteInsertion( ++ Parse *pParse, /* The parser context */ ++ Table *pTab, /* the table into which we are inserting */ ++ int base, /* Index of a read/write cursor pointing at pTab */ ++ char *aIdxUsed, /* Which indices are used. NULL means all are used */ ++ int recnoChng, /* True if the record number will change */ ++ int isUpdate, /* True for UPDATE, False for INSERT */ ++ int newIdx /* Index of NEW table for triggers. -1 if none */ ++){ ++ int i; ++ Vdbe *v; ++ int nIdx; ++ Index *pIdx; ++ ++ v = sqliteGetVdbe(pParse); ++ assert( v!=0 ); ++ assert( pTab->pSelect==0 ); /* This table is not a VIEW */ ++ for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){} ++ for(i=nIdx-1; i>=0; i--){ ++ if( aIdxUsed && aIdxUsed[i]==0 ) continue; ++ sqliteVdbeAddOp(v, OP_IdxPut, base+i+1, 0); ++ } ++ sqliteVdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0); ++ if( newIdx>=0 ){ ++ sqliteVdbeAddOp(v, OP_Dup, 1, 0); ++ sqliteVdbeAddOp(v, OP_Dup, 1, 0); ++ sqliteVdbeAddOp(v, OP_PutIntKey, newIdx, 0); ++ } ++ sqliteVdbeAddOp(v, OP_PutIntKey, base, ++ (pParse->trigStack?0:OPFLAG_NCHANGE) | ++ (isUpdate?0:OPFLAG_LASTROWID) | OPFLAG_CSCHANGE); ++ if( isUpdate && recnoChng ){ ++ sqliteVdbeAddOp(v, OP_Pop, 1, 0); ++ } ++} ++ ++/* ++** Generate code that will open write cursors for a table and for all ++** indices of that table. The "base" parameter is the cursor number used ++** for the table. Indices are opened on subsequent cursors. ++** ++** Return the total number of cursors opened. This is always at least ++** 1 (for the main table) plus more for each cursor. ++*/ ++int sqliteOpenTableAndIndices(Parse *pParse, Table *pTab, int base){ ++ int i; ++ Index *pIdx; ++ Vdbe *v = sqliteGetVdbe(pParse); ++ assert( v!=0 ); ++ sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0); ++ sqliteVdbeOp3(v, OP_OpenWrite, base, pTab->tnum, pTab->zName, P3_STATIC); ++ for(i=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ ++ sqliteVdbeAddOp(v, OP_Integer, pIdx->iDb, 0); ++ sqliteVdbeOp3(v, OP_OpenWrite, i+base, pIdx->tnum, pIdx->zName, P3_STATIC); ++ } ++ return i; ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/libsqlite.dsp +@@ -0,0 +1,353 @@ ++# Microsoft Developer Studio Project File - Name="libsqlite" - Package Owner=<4> ++# Microsoft Developer Studio Generated Build File, Format Version 6.00 ++# ** DO NOT EDIT ** ++ ++# TARGTYPE "Win32 (x86) Static Library" 0x0104 ++ ++CFG=libsqlite - Win32 Debug_TS ++!MESSAGE This is not a valid makefile. To build this project using NMAKE, ++!MESSAGE use the Export Makefile command and run ++!MESSAGE ++!MESSAGE NMAKE /f "libsqlite.mak". ++!MESSAGE ++!MESSAGE You can specify a configuration when running NMAKE ++!MESSAGE by defining the macro CFG on the command line. For example: ++!MESSAGE ++!MESSAGE NMAKE /f "libsqlite.mak" CFG="libsqlite - Win32 Debug_TS" ++!MESSAGE ++!MESSAGE Possible choices for configuration are: ++!MESSAGE ++!MESSAGE "libsqlite - Win32 Debug_TS" (based on "Win32 (x86) Static Library") ++!MESSAGE "libsqlite - Win32 Release_TS" (based on "Win32 (x86) Static Library") ++!MESSAGE "libsqlite - Win32 Release_TSDbg" (based on "Win32 (x86) Static Library") ++!MESSAGE ++ ++# Begin Project ++# PROP AllowPerConfigDependencies 0 ++# PROP Scc_ProjName "" ++# PROP Scc_LocalPath "" ++CPP=cl.exe ++RSC=rc.exe ++ ++!IF "$(CFG)" == "libsqlite - Win32 Debug_TS" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 1 ++# PROP BASE Output_Dir "Debug_TS" ++# PROP BASE Intermediate_Dir "Debug_TS" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 1 ++# PROP Output_Dir "..\..\Debug_TS" ++# PROP Intermediate_Dir "..\..\Debug_TS" ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c ++# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D THREADSAFE=1 /YX /FD /GZ /c ++# ADD BASE RSC /l 0x406 /d "_DEBUG" ++# ADD RSC /l 0x406 /d "_DEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LIB32=link.exe -lib ++# ADD BASE LIB32 /nologo ++# ADD LIB32 /nologo ++ ++!ELSEIF "$(CFG)" == "libsqlite - Win32 Release_TS" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "Release_TS" ++# PROP BASE Intermediate_Dir "Release_TS" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "..\..\Release_TS" ++# PROP Intermediate_Dir "..\..\Release_TS" ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c ++# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D THREADSAFE=1 /YX /FD /c ++# ADD BASE RSC /l 0x406 /d "NDEBUG" ++# ADD RSC /l 0x406 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LIB32=link.exe -lib ++# ADD BASE LIB32 /nologo ++# ADD LIB32 /nologo ++ ++!ELSEIF "$(CFG)" == "libsqlite - Win32 Release_TSDbg" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "libsqlite___Win32_Release_TSDbg" ++# PROP BASE Intermediate_Dir "libsqlite___Win32_Release_TSDbg" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "..\..\Release_TSDbg" ++# PROP Intermediate_Dir "..\..\Release_TSDbg" ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D THREADSAFE=1 /YX /FD /c ++# ADD CPP /nologo /MD /W3 /GX /Zi /Od /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D THREADSAFE=1 /YX /FD /c ++# ADD BASE RSC /l 0x406 /d "NDEBUG" ++# ADD RSC /l 0x406 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LIB32=link.exe -lib ++# ADD BASE LIB32 /nologo /out:"Release_TS\libsqlite.lib" ++# ADD LIB32 /nologo ++ ++!ENDIF ++ ++# Begin Target ++ ++# Name "libsqlite - Win32 Debug_TS" ++# Name "libsqlite - Win32 Release_TS" ++# Name "libsqlite - Win32 Release_TSDbg" ++# Begin Group "Source Files" ++ ++# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" ++# Begin Source File ++ ++SOURCE=attach.c ++# End Source File ++# Begin Source File ++ ++SOURCE=auth.c ++# End Source File ++# Begin Source File ++ ++SOURCE=btree.c ++# End Source File ++# Begin Source File ++ ++SOURCE=btree_rb.c ++# End Source File ++# Begin Source File ++ ++SOURCE=build.c ++# End Source File ++# Begin Source File ++ ++SOURCE=copy.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\date.c ++# End Source File ++# Begin Source File ++ ++SOURCE=delete.c ++# End Source File ++# Begin Source File ++ ++SOURCE=encode.c ++# End Source File ++# Begin Source File ++ ++SOURCE=expr.c ++# End Source File ++# Begin Source File ++ ++SOURCE=func.c ++# End Source File ++# Begin Source File ++ ++SOURCE=hash.c ++# End Source File ++# Begin Source File ++ ++SOURCE=insert.c ++# End Source File ++# Begin Source File ++ ++SOURCE=main.c ++# End Source File ++# Begin Source File ++ ++SOURCE=opcodes.c ++# End Source File ++# Begin Source File ++ ++SOURCE=os.c ++# End Source File ++# Begin Source File ++ ++SOURCE=pager.c ++# End Source File ++# Begin Source File ++ ++SOURCE=parse.c ++# End Source File ++# Begin Source File ++ ++SOURCE=pragma.c ++# End Source File ++# Begin Source File ++ ++SOURCE=printf.c ++# End Source File ++# Begin Source File ++ ++SOURCE=random.c ++# End Source File ++# Begin Source File ++ ++SOURCE=select.c ++# End Source File ++# Begin Source File ++ ++SOURCE=table.c ++# End Source File ++# Begin Source File ++ ++SOURCE=tokenize.c ++# End Source File ++# Begin Source File ++ ++SOURCE=trigger.c ++# End Source File ++# Begin Source File ++ ++SOURCE=update.c ++# End Source File ++# Begin Source File ++ ++SOURCE=util.c ++# End Source File ++# Begin Source File ++ ++SOURCE=vacuum.c ++# End Source File ++# Begin Source File ++ ++SOURCE=vdbe.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\vdbeaux.c ++# End Source File ++# Begin Source File ++ ++SOURCE=where.c ++# End Source File ++# End Group ++# Begin Group "Header Files" ++ ++# PROP Default_Filter "h;hpp;hxx;hm;inl" ++# Begin Source File ++ ++SOURCE=btree.h ++# End Source File ++# Begin Source File ++ ++SOURCE=config_static.w32.h ++ ++!IF "$(CFG)" == "libsqlite - Win32 Debug_TS" ++ ++# Begin Custom Build ++InputDir=. ++InputPath=config_static.w32.h ++ ++"$(InputDir)\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" ++ copy $(InputPath) $(InputDir)\config.h ++ ++# End Custom Build ++ ++!ELSEIF "$(CFG)" == "libsqlite - Win32 Release_TS" ++ ++# Begin Custom Build ++InputDir=. ++InputPath=config_static.w32.h ++ ++"$(InputDir)\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" ++ copy $(InputPath) $(InputDir)\config.h ++ ++# End Custom Build ++ ++!ELSEIF "$(CFG)" == "libsqlite - Win32 Release_TSDbg" ++ ++# Begin Custom Build ++InputDir=. ++InputPath=config_static.w32.h ++ ++"$(InputDir)\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" ++ copy $(InputPath) $(InputDir)\config.h ++ ++# End Custom Build ++ ++!ENDIF ++ ++# End Source File ++# Begin Source File ++ ++SOURCE=hash.h ++# End Source File ++# Begin Source File ++ ++SOURCE=opcodes.h ++# End Source File ++# Begin Source File ++ ++SOURCE=os.h ++# End Source File ++# Begin Source File ++ ++SOURCE=pager.h ++# End Source File ++# Begin Source File ++ ++SOURCE=parse.h ++# End Source File ++# Begin Source File ++ ++SOURCE=sqlite.w32.h ++ ++!IF "$(CFG)" == "libsqlite - Win32 Debug_TS" ++ ++# Begin Custom Build ++InputDir=. ++InputPath=sqlite.w32.h ++ ++"$(InputDir)\sqlite.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" ++ copy $(InputPath) $(InputDir)\sqlite.h ++ ++# End Custom Build ++ ++!ELSEIF "$(CFG)" == "libsqlite - Win32 Release_TS" ++ ++# Begin Custom Build ++InputDir=. ++InputPath=sqlite.w32.h ++ ++"$(InputDir)\sqlite.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" ++ copy $(InputPath) $(InputDir)\sqlite.h ++ ++# End Custom Build ++ ++!ELSEIF "$(CFG)" == "libsqlite - Win32 Release_TSDbg" ++ ++# Begin Custom Build ++InputDir=. ++InputPath=sqlite.w32.h ++ ++"$(InputDir)\sqlite.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" ++ copy $(InputPath) $(InputDir)\sqlite.h ++ ++# End Custom Build ++ ++!ENDIF ++ ++# End Source File ++# Begin Source File ++ ++SOURCE=sqliteInt.h ++# End Source File ++# Begin Source File ++ ++SOURCE=vdbe.h ++# End Source File ++# End Group ++# End Target ++# End Project +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/main.c +@@ -0,0 +1,1143 @@ ++/* ++** 2001 September 15 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** Main file for the SQLite library. The routines in this file ++** implement the programmer interface to the library. Routines in ++** other files are for internal use by SQLite and should not be ++** accessed by users of the library. ++** ++** $Id$ ++*/ ++#include "sqliteInt.h" ++#include "os.h" ++#include ++ ++/* ++** A pointer to this structure is used to communicate information ++** from sqliteInit into the sqliteInitCallback. ++*/ ++typedef struct { ++ sqlite *db; /* The database being initialized */ ++ char **pzErrMsg; /* Error message stored here */ ++} InitData; ++ ++/* ++** Fill the InitData structure with an error message that indicates ++** that the database is corrupt. ++*/ ++static void corruptSchema(InitData *pData, const char *zExtra){ ++ sqliteSetString(pData->pzErrMsg, "malformed database schema", ++ zExtra!=0 && zExtra[0]!=0 ? " - " : (char*)0, zExtra, (char*)0); ++} ++ ++/* ++** This is the callback routine for the code that initializes the ++** database. See sqliteInit() below for additional information. ++** ++** Each callback contains the following information: ++** ++** argv[0] = "file-format" or "schema-cookie" or "table" or "index" ++** argv[1] = table or index name or meta statement type. ++** argv[2] = root page number for table or index. NULL for meta. ++** argv[3] = SQL text for a CREATE TABLE or CREATE INDEX statement. ++** argv[4] = "1" for temporary files, "0" for main database, "2" or more ++** for auxiliary database files. ++** ++*/ ++static ++int sqliteInitCallback(void *pInit, int argc, char **argv, char **azColName){ ++ InitData *pData = (InitData*)pInit; ++ int nErr = 0; ++ ++ assert( argc==5 ); ++ if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */ ++ if( argv[0]==0 ){ ++ corruptSchema(pData, 0); ++ return 1; ++ } ++ switch( argv[0][0] ){ ++ case 'v': ++ case 'i': ++ case 't': { /* CREATE TABLE, CREATE INDEX, or CREATE VIEW statements */ ++ sqlite *db = pData->db; ++ if( argv[2]==0 || argv[4]==0 ){ ++ corruptSchema(pData, 0); ++ return 1; ++ } ++ if( argv[3] && argv[3][0] ){ ++ /* Call the parser to process a CREATE TABLE, INDEX or VIEW. ++ ** But because db->init.busy is set to 1, no VDBE code is generated ++ ** or executed. All the parser does is build the internal data ++ ** structures that describe the table, index, or view. ++ */ ++ char *zErr; ++ assert( db->init.busy ); ++ db->init.iDb = atoi(argv[4]); ++ assert( db->init.iDb>=0 && db->init.iDbnDb ); ++ db->init.newTnum = atoi(argv[2]); ++ if( sqlite_exec(db, argv[3], 0, 0, &zErr) ){ ++ corruptSchema(pData, zErr); ++ sqlite_freemem(zErr); ++ } ++ db->init.iDb = 0; ++ }else{ ++ /* If the SQL column is blank it means this is an index that ++ ** was created to be the PRIMARY KEY or to fulfill a UNIQUE ++ ** constraint for a CREATE TABLE. The index should have already ++ ** been created when we processed the CREATE TABLE. All we have ++ ** to do here is record the root page number for that index. ++ */ ++ int iDb; ++ Index *pIndex; ++ ++ iDb = atoi(argv[4]); ++ assert( iDb>=0 && iDbnDb ); ++ pIndex = sqliteFindIndex(db, argv[1], db->aDb[iDb].zName); ++ if( pIndex==0 || pIndex->tnum!=0 ){ ++ /* This can occur if there exists an index on a TEMP table which ++ ** has the same name as another index on a permanent index. Since ++ ** the permanent table is hidden by the TEMP table, we can also ++ ** safely ignore the index on the permanent table. ++ */ ++ /* Do Nothing */; ++ }else{ ++ pIndex->tnum = atoi(argv[2]); ++ } ++ } ++ break; ++ } ++ default: { ++ /* This can not happen! */ ++ nErr = 1; ++ assert( nErr==0 ); ++ } ++ } ++ return nErr; ++} ++ ++/* ++** This is a callback procedure used to reconstruct a table. The ++** name of the table to be reconstructed is passed in as argv[0]. ++** ++** This routine is used to automatically upgrade a database from ++** format version 1 or 2 to version 3. The correct operation of ++** this routine relys on the fact that no indices are used when ++** copying a table out to a temporary file. ++** ++** The change from version 2 to version 3 occurred between SQLite ++** version 2.5.6 and 2.6.0 on 2002-July-18. ++*/ ++static ++int upgrade_3_callback(void *pInit, int argc, char **argv, char **NotUsed){ ++ InitData *pData = (InitData*)pInit; ++ int rc; ++ Table *pTab; ++ Trigger *pTrig; ++ char *zErr = 0; ++ ++ pTab = sqliteFindTable(pData->db, argv[0], 0); ++ assert( pTab!=0 ); ++ assert( sqliteStrICmp(pTab->zName, argv[0])==0 ); ++ if( pTab ){ ++ pTrig = pTab->pTrigger; ++ pTab->pTrigger = 0; /* Disable all triggers before rebuilding the table */ ++ } ++ rc = sqlite_exec_printf(pData->db, ++ "CREATE TEMP TABLE sqlite_x AS SELECT * FROM '%q'; " ++ "DELETE FROM '%q'; " ++ "INSERT INTO '%q' SELECT * FROM sqlite_x; " ++ "DROP TABLE sqlite_x;", ++ 0, 0, &zErr, argv[0], argv[0], argv[0]); ++ if( zErr ){ ++ if( *pData->pzErrMsg ) sqlite_freemem(*pData->pzErrMsg); ++ *pData->pzErrMsg = zErr; ++ } ++ ++ /* If an error occurred in the SQL above, then the transaction will ++ ** rollback which will delete the internal symbol tables. This will ++ ** cause the structure that pTab points to be deleted. In case that ++ ** happened, we need to refetch pTab. ++ */ ++ pTab = sqliteFindTable(pData->db, argv[0], 0); ++ if( pTab ){ ++ assert( sqliteStrICmp(pTab->zName, argv[0])==0 ); ++ pTab->pTrigger = pTrig; /* Re-enable triggers */ ++ } ++ return rc!=SQLITE_OK; ++} ++ ++ ++ ++/* ++** Attempt to read the database schema and initialize internal ++** data structures for a single database file. The index of the ++** database file is given by iDb. iDb==0 is used for the main ++** database. iDb==1 should never be used. iDb>=2 is used for ++** auxiliary databases. Return one of the SQLITE_ error codes to ++** indicate success or failure. ++*/ ++static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){ ++ int rc; ++ BtCursor *curMain; ++ int size; ++ Table *pTab; ++ char const *azArg[6]; ++ char zDbNum[30]; ++ int meta[SQLITE_N_BTREE_META]; ++ InitData initData; ++ char const *zMasterSchema; ++ char const *zMasterName; ++ char *zSql = 0; ++ ++ /* ++ ** The master database table has a structure like this ++ */ ++ static char master_schema[] = ++ "CREATE TABLE sqlite_master(\n" ++ " type text,\n" ++ " name text,\n" ++ " tbl_name text,\n" ++ " rootpage integer,\n" ++ " sql text\n" ++ ")" ++ ; ++ static char temp_master_schema[] = ++ "CREATE TEMP TABLE sqlite_temp_master(\n" ++ " type text,\n" ++ " name text,\n" ++ " tbl_name text,\n" ++ " rootpage integer,\n" ++ " sql text\n" ++ ")" ++ ; ++ ++ assert( iDb>=0 && iDbnDb ); ++ ++ /* zMasterSchema and zInitScript are set to point at the master schema ++ ** and initialisation script appropriate for the database being ++ ** initialised. zMasterName is the name of the master table. ++ */ ++ if( iDb==1 ){ ++ zMasterSchema = temp_master_schema; ++ zMasterName = TEMP_MASTER_NAME; ++ }else{ ++ zMasterSchema = master_schema; ++ zMasterName = MASTER_NAME; ++ } ++ ++ /* Construct the schema table. ++ */ ++ sqliteSafetyOff(db); ++ azArg[0] = "table"; ++ azArg[1] = zMasterName; ++ azArg[2] = "2"; ++ azArg[3] = zMasterSchema; ++ sprintf(zDbNum, "%d", iDb); ++ azArg[4] = zDbNum; ++ azArg[5] = 0; ++ initData.db = db; ++ initData.pzErrMsg = pzErrMsg; ++ sqliteInitCallback(&initData, 5, (char **)azArg, 0); ++ pTab = sqliteFindTable(db, zMasterName, db->aDb[iDb].zName); ++ if( pTab ){ ++ pTab->readOnly = 1; ++ }else{ ++ return SQLITE_NOMEM; ++ } ++ sqliteSafetyOn(db); ++ ++ /* Create a cursor to hold the database open ++ */ ++ if( db->aDb[iDb].pBt==0 ) return SQLITE_OK; ++ rc = sqliteBtreeCursor(db->aDb[iDb].pBt, 2, 0, &curMain); ++ if( rc ){ ++ sqliteSetString(pzErrMsg, sqlite_error_string(rc), (char*)0); ++ return rc; ++ } ++ ++ /* Get the database meta information ++ */ ++ rc = sqliteBtreeGetMeta(db->aDb[iDb].pBt, meta); ++ if( rc ){ ++ sqliteSetString(pzErrMsg, sqlite_error_string(rc), (char*)0); ++ sqliteBtreeCloseCursor(curMain); ++ return rc; ++ } ++ db->aDb[iDb].schema_cookie = meta[1]; ++ if( iDb==0 ){ ++ db->next_cookie = meta[1]; ++ db->file_format = meta[2]; ++ size = meta[3]; ++ if( size==0 ){ size = MAX_PAGES; } ++ db->cache_size = size; ++ db->safety_level = meta[4]; ++ if( meta[6]>0 && meta[6]<=2 && db->temp_store==0 ){ ++ db->temp_store = meta[6]; ++ } ++ if( db->safety_level==0 ) db->safety_level = 2; ++ ++ /* ++ ** file_format==1 Version 2.1.0. ++ ** file_format==2 Version 2.2.0. Add support for INTEGER PRIMARY KEY. ++ ** file_format==3 Version 2.6.0. Fix empty-string index bug. ++ ** file_format==4 Version 2.7.0. Add support for separate numeric and ++ ** text datatypes. ++ */ ++ if( db->file_format==0 ){ ++ /* This happens if the database was initially empty */ ++ db->file_format = 4; ++ }else if( db->file_format>4 ){ ++ sqliteBtreeCloseCursor(curMain); ++ sqliteSetString(pzErrMsg, "unsupported file format", (char*)0); ++ return SQLITE_ERROR; ++ } ++ }else if( iDb!=1 && (db->file_format!=meta[2] || db->file_format<4) ){ ++ assert( db->file_format>=4 ); ++ if( meta[2]==0 ){ ++ sqliteSetString(pzErrMsg, "cannot attach empty database: ", ++ db->aDb[iDb].zName, (char*)0); ++ }else{ ++ sqliteSetString(pzErrMsg, "incompatible file format in auxiliary " ++ "database: ", db->aDb[iDb].zName, (char*)0); ++ } ++ sqliteBtreeClose(db->aDb[iDb].pBt); ++ db->aDb[iDb].pBt = 0; ++ return SQLITE_FORMAT; ++ } ++ sqliteBtreeSetCacheSize(db->aDb[iDb].pBt, db->cache_size); ++ sqliteBtreeSetSafetyLevel(db->aDb[iDb].pBt, meta[4]==0 ? 2 : meta[4]); ++ ++ /* Read the schema information out of the schema tables ++ */ ++ assert( db->init.busy ); ++ sqliteSafetyOff(db); ++ ++ /* The following SQL will read the schema from the master tables. ++ ** The first version works with SQLite file formats 2 or greater. ++ ** The second version is for format 1 files. ++ ** ++ ** Beginning with file format 2, the rowid for new table entries ++ ** (including entries in sqlite_master) is an increasing integer. ++ ** So for file format 2 and later, we can play back sqlite_master ++ ** and all the CREATE statements will appear in the right order. ++ ** But with file format 1, table entries were random and so we ++ ** have to make sure the CREATE TABLEs occur before their corresponding ++ ** CREATE INDEXs. (We don't have to deal with CREATE VIEW or ++ ** CREATE TRIGGER in file format 1 because those constructs did ++ ** not exist then.) ++ */ ++ if( db->file_format>=2 ){ ++ sqliteSetString(&zSql, ++ "SELECT type, name, rootpage, sql, ", zDbNum, " FROM \"", ++ db->aDb[iDb].zName, "\".", zMasterName, (char*)0); ++ }else{ ++ sqliteSetString(&zSql, ++ "SELECT type, name, rootpage, sql, ", zDbNum, " FROM \"", ++ db->aDb[iDb].zName, "\".", zMasterName, ++ " WHERE type IN ('table', 'index')" ++ " ORDER BY CASE type WHEN 'table' THEN 0 ELSE 1 END", (char*)0); ++ } ++ rc = sqlite_exec(db, zSql, sqliteInitCallback, &initData, 0); ++ ++ sqliteFree(zSql); ++ sqliteSafetyOn(db); ++ sqliteBtreeCloseCursor(curMain); ++ if( sqlite_malloc_failed ){ ++ sqliteSetString(pzErrMsg, "out of memory", (char*)0); ++ rc = SQLITE_NOMEM; ++ sqliteResetInternalSchema(db, 0); ++ } ++ if( rc==SQLITE_OK ){ ++ DbSetProperty(db, iDb, DB_SchemaLoaded); ++ }else{ ++ sqliteResetInternalSchema(db, iDb); ++ } ++ return rc; ++} ++ ++/* ++** Initialize all database files - the main database file, the file ++** used to store temporary tables, and any additional database files ++** created using ATTACH statements. Return a success code. If an ++** error occurs, write an error message into *pzErrMsg. ++** ++** After the database is initialized, the SQLITE_Initialized ++** bit is set in the flags field of the sqlite structure. An ++** attempt is made to initialize the database as soon as it ++** is opened. If that fails (perhaps because another process ++** has the sqlite_master table locked) than another attempt ++** is made the first time the database is accessed. ++*/ ++int sqliteInit(sqlite *db, char **pzErrMsg){ ++ int i, rc; ++ ++ if( db->init.busy ) return SQLITE_OK; ++ assert( (db->flags & SQLITE_Initialized)==0 ); ++ rc = SQLITE_OK; ++ db->init.busy = 1; ++ for(i=0; rc==SQLITE_OK && inDb; i++){ ++ if( DbHasProperty(db, i, DB_SchemaLoaded) || i==1 ) continue; ++ rc = sqliteInitOne(db, i, pzErrMsg); ++ if( rc ){ ++ sqliteResetInternalSchema(db, i); ++ } ++ } ++ ++ /* Once all the other databases have been initialised, load the schema ++ ** for the TEMP database. This is loaded last, as the TEMP database ++ ** schema may contain references to objects in other databases. ++ */ ++ if( rc==SQLITE_OK && db->nDb>1 && !DbHasProperty(db, 1, DB_SchemaLoaded) ){ ++ rc = sqliteInitOne(db, 1, pzErrMsg); ++ if( rc ){ ++ sqliteResetInternalSchema(db, 1); ++ } ++ } ++ ++ db->init.busy = 0; ++ if( rc==SQLITE_OK ){ ++ db->flags |= SQLITE_Initialized; ++ sqliteCommitInternalChanges(db); ++ } ++ ++ /* If the database is in formats 1 or 2, then upgrade it to ++ ** version 3. This will reconstruct all indices. If the ++ ** upgrade fails for any reason (ex: out of disk space, database ++ ** is read only, interrupt received, etc.) then fail the init. ++ */ ++ if( rc==SQLITE_OK && db->file_format<3 ){ ++ char *zErr = 0; ++ InitData initData; ++ int meta[SQLITE_N_BTREE_META]; ++ ++ db->magic = SQLITE_MAGIC_OPEN; ++ initData.db = db; ++ initData.pzErrMsg = &zErr; ++ db->file_format = 3; ++ rc = sqlite_exec(db, ++ "BEGIN; SELECT name FROM sqlite_master WHERE type='table';", ++ upgrade_3_callback, ++ &initData, ++ &zErr); ++ if( rc==SQLITE_OK ){ ++ sqliteBtreeGetMeta(db->aDb[0].pBt, meta); ++ meta[2] = 4; ++ sqliteBtreeUpdateMeta(db->aDb[0].pBt, meta); ++ sqlite_exec(db, "COMMIT", 0, 0, 0); ++ } ++ if( rc!=SQLITE_OK ){ ++ sqliteSetString(pzErrMsg, ++ "unable to upgrade database to the version 2.6 format", ++ zErr ? ": " : 0, zErr, (char*)0); ++ } ++ sqlite_freemem(zErr); ++ } ++ ++ if( rc!=SQLITE_OK ){ ++ db->flags &= ~SQLITE_Initialized; ++ } ++ return rc; ++} ++ ++/* ++** The version of the library ++*/ ++const char rcsid[] = "@(#) \044Id: SQLite version " SQLITE_VERSION " $"; ++const char sqlite_version[] = SQLITE_VERSION; ++ ++/* ++** Does the library expect data to be encoded as UTF-8 or iso8859? The ++** following global constant always lets us know. ++*/ ++#ifdef SQLITE_UTF8 ++const char sqlite_encoding[] = "UTF-8"; ++#else ++const char sqlite_encoding[] = "iso8859"; ++#endif ++ ++/* ++** Open a new SQLite database. Construct an "sqlite" structure to define ++** the state of this database and return a pointer to that structure. ++** ++** An attempt is made to initialize the in-memory data structures that ++** hold the database schema. But if this fails (because the schema file ++** is locked) then that step is deferred until the first call to ++** sqlite_exec(). ++*/ ++sqlite *sqlite_open(const char *zFilename, int mode, char **pzErrMsg){ ++ sqlite *db; ++ int rc, i; ++ ++ /* Allocate the sqlite data structure */ ++ db = sqliteMalloc( sizeof(sqlite) ); ++ if( pzErrMsg ) *pzErrMsg = 0; ++ if( db==0 ) goto no_mem_on_open; ++ db->onError = OE_Default; ++ db->priorNewRowid = 0; ++ db->magic = SQLITE_MAGIC_BUSY; ++ db->nDb = 2; ++ db->aDb = db->aDbStatic; ++ /* db->flags |= SQLITE_ShortColNames; */ ++ sqliteHashInit(&db->aFunc, SQLITE_HASH_STRING, 1); ++ for(i=0; inDb; i++){ ++ sqliteHashInit(&db->aDb[i].tblHash, SQLITE_HASH_STRING, 0); ++ sqliteHashInit(&db->aDb[i].idxHash, SQLITE_HASH_STRING, 0); ++ sqliteHashInit(&db->aDb[i].trigHash, SQLITE_HASH_STRING, 0); ++ sqliteHashInit(&db->aDb[i].aFKey, SQLITE_HASH_STRING, 1); ++ } ++ ++ /* Open the backend database driver */ ++ if( zFilename[0]==':' && strcmp(zFilename,":memory:")==0 ){ ++ db->temp_store = 2; ++ } ++ rc = sqliteBtreeFactory(db, zFilename, 0, MAX_PAGES, &db->aDb[0].pBt); ++ if( rc!=SQLITE_OK ){ ++ switch( rc ){ ++ default: { ++ sqliteSetString(pzErrMsg, "unable to open database: ", ++ zFilename, (char*)0); ++ } ++ } ++ sqliteFree(db); ++ sqliteStrRealloc(pzErrMsg); ++ return 0; ++ } ++ db->aDb[0].zName = "main"; ++ db->aDb[1].zName = "temp"; ++ ++ /* Attempt to read the schema */ ++ sqliteRegisterBuiltinFunctions(db); ++ rc = sqliteInit(db, pzErrMsg); ++ db->magic = SQLITE_MAGIC_OPEN; ++ if( sqlite_malloc_failed ){ ++ sqlite_close(db); ++ goto no_mem_on_open; ++ }else if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ ++ sqlite_close(db); ++ sqliteStrRealloc(pzErrMsg); ++ return 0; ++ }else if( pzErrMsg ){ ++ sqliteFree(*pzErrMsg); ++ *pzErrMsg = 0; ++ } ++ ++ /* Return a pointer to the newly opened database structure */ ++ return db; ++ ++no_mem_on_open: ++ sqliteSetString(pzErrMsg, "out of memory", (char*)0); ++ sqliteStrRealloc(pzErrMsg); ++ return 0; ++} ++ ++/* ++** Return the ROWID of the most recent insert ++*/ ++int sqlite_last_insert_rowid(sqlite *db){ ++ return db->lastRowid; ++} ++ ++/* ++** Return the number of changes in the most recent call to sqlite_exec(). ++*/ ++int sqlite_changes(sqlite *db){ ++ return db->nChange; ++} ++ ++/* ++** Return the number of changes produced by the last INSERT, UPDATE, or ++** DELETE statement to complete execution. The count does not include ++** changes due to SQL statements executed in trigger programs that were ++** triggered by that statement ++*/ ++int sqlite_last_statement_changes(sqlite *db){ ++ return db->lsChange; ++} ++ ++/* ++** Close an existing SQLite database ++*/ ++void sqlite_close(sqlite *db){ ++ HashElem *i; ++ int j; ++ db->want_to_close = 1; ++ if( sqliteSafetyCheck(db) || sqliteSafetyOn(db) ){ ++ /* printf("DID NOT CLOSE\n"); fflush(stdout); */ ++ return; ++ } ++ db->magic = SQLITE_MAGIC_CLOSED; ++ for(j=0; jnDb; j++){ ++ struct Db *pDb = &db->aDb[j]; ++ if( pDb->pBt ){ ++ sqliteBtreeClose(pDb->pBt); ++ pDb->pBt = 0; ++ } ++ } ++ sqliteResetInternalSchema(db, 0); ++ assert( db->nDb<=2 ); ++ assert( db->aDb==db->aDbStatic ); ++ for(i=sqliteHashFirst(&db->aFunc); i; i=sqliteHashNext(i)){ ++ FuncDef *pFunc, *pNext; ++ for(pFunc = (FuncDef*)sqliteHashData(i); pFunc; pFunc=pNext){ ++ pNext = pFunc->pNext; ++ sqliteFree(pFunc); ++ } ++ } ++ sqliteHashClear(&db->aFunc); ++ sqliteFree(db); ++} ++ ++/* ++** Rollback all database files. ++*/ ++void sqliteRollbackAll(sqlite *db){ ++ int i; ++ for(i=0; inDb; i++){ ++ if( db->aDb[i].pBt ){ ++ sqliteBtreeRollback(db->aDb[i].pBt); ++ db->aDb[i].inTrans = 0; ++ } ++ } ++ sqliteResetInternalSchema(db, 0); ++ /* sqliteRollbackInternalChanges(db); */ ++} ++ ++/* ++** Execute SQL code. Return one of the SQLITE_ success/failure ++** codes. Also write an error message into memory obtained from ++** malloc() and make *pzErrMsg point to that message. ++** ++** If the SQL is a query, then for each row in the query result ++** the xCallback() function is called. pArg becomes the first ++** argument to xCallback(). If xCallback=NULL then no callback ++** is invoked, even for queries. ++*/ ++int sqlite_exec( ++ sqlite *db, /* The database on which the SQL executes */ ++ const char *zSql, /* The SQL to be executed */ ++ sqlite_callback xCallback, /* Invoke this callback routine */ ++ void *pArg, /* First argument to xCallback() */ ++ char **pzErrMsg /* Write error messages here */ ++){ ++ int rc = SQLITE_OK; ++ const char *zLeftover; ++ sqlite_vm *pVm; ++ int nRetry = 0; ++ int nChange = 0; ++ int nCallback; ++ ++ if( zSql==0 ) return SQLITE_OK; ++ while( rc==SQLITE_OK && zSql[0] ){ ++ pVm = 0; ++ rc = sqlite_compile(db, zSql, &zLeftover, &pVm, pzErrMsg); ++ if( rc!=SQLITE_OK ){ ++ assert( pVm==0 || sqlite_malloc_failed ); ++ return rc; ++ } ++ if( pVm==0 ){ ++ /* This happens if the zSql input contained only whitespace */ ++ break; ++ } ++ db->nChange += nChange; ++ nCallback = 0; ++ while(1){ ++ int nArg; ++ char **azArg, **azCol; ++ rc = sqlite_step(pVm, &nArg, (const char***)&azArg,(const char***)&azCol); ++ if( rc==SQLITE_ROW ){ ++ if( xCallback!=0 && xCallback(pArg, nArg, azArg, azCol) ){ ++ sqlite_finalize(pVm, 0); ++ return SQLITE_ABORT; ++ } ++ nCallback++; ++ }else{ ++ if( rc==SQLITE_DONE && nCallback==0 ++ && (db->flags & SQLITE_NullCallback)!=0 && xCallback!=0 ){ ++ xCallback(pArg, nArg, azArg, azCol); ++ } ++ rc = sqlite_finalize(pVm, pzErrMsg); ++ if( rc==SQLITE_SCHEMA && nRetry<2 ){ ++ nRetry++; ++ rc = SQLITE_OK; ++ break; ++ } ++ if( db->pVdbe==0 ){ ++ nChange = db->nChange; ++ } ++ nRetry = 0; ++ zSql = zLeftover; ++ while( isspace(zSql[0]) ) zSql++; ++ break; ++ } ++ } ++ } ++ return rc; ++} ++ ++ ++/* ++** Compile a single statement of SQL into a virtual machine. Return one ++** of the SQLITE_ success/failure codes. Also write an error message into ++** memory obtained from malloc() and make *pzErrMsg point to that message. ++*/ ++int sqlite_compile( ++ sqlite *db, /* The database on which the SQL executes */ ++ const char *zSql, /* The SQL to be executed */ ++ const char **pzTail, /* OUT: Next statement after the first */ ++ sqlite_vm **ppVm, /* OUT: The virtual machine */ ++ char **pzErrMsg /* OUT: Write error messages here */ ++){ ++ Parse sParse; ++ ++ if( pzErrMsg ) *pzErrMsg = 0; ++ if( sqliteSafetyOn(db) ) goto exec_misuse; ++ if( !db->init.busy ){ ++ if( (db->flags & SQLITE_Initialized)==0 ){ ++ int rc, cnt = 1; ++ while( (rc = sqliteInit(db, pzErrMsg))==SQLITE_BUSY ++ && db->xBusyCallback ++ && db->xBusyCallback(db->pBusyArg, "", cnt++)!=0 ){} ++ if( rc!=SQLITE_OK ){ ++ sqliteStrRealloc(pzErrMsg); ++ sqliteSafetyOff(db); ++ return rc; ++ } ++ if( pzErrMsg ){ ++ sqliteFree(*pzErrMsg); ++ *pzErrMsg = 0; ++ } ++ } ++ if( db->file_format<3 ){ ++ sqliteSafetyOff(db); ++ sqliteSetString(pzErrMsg, "obsolete database file format", (char*)0); ++ return SQLITE_ERROR; ++ } ++ } ++ assert( (db->flags & SQLITE_Initialized)!=0 || db->init.busy ); ++ if( db->pVdbe==0 ){ db->nChange = 0; } ++ memset(&sParse, 0, sizeof(sParse)); ++ sParse.db = db; ++ sqliteRunParser(&sParse, zSql, pzErrMsg); ++ if( db->xTrace && !db->init.busy ){ ++ /* Trace only the statment that was compiled. ++ ** Make a copy of that part of the SQL string since zSQL is const ++ ** and we must pass a zero terminated string to the trace function ++ ** The copy is unnecessary if the tail pointer is pointing at the ++ ** beginnig or end of the SQL string. ++ */ ++ if( sParse.zTail && sParse.zTail!=zSql && *sParse.zTail ){ ++ char *tmpSql = sqliteStrNDup(zSql, sParse.zTail - zSql); ++ if( tmpSql ){ ++ db->xTrace(db->pTraceArg, tmpSql); ++ free(tmpSql); ++ }else{ ++ /* If a memory error occurred during the copy, ++ ** trace entire SQL string and fall through to the ++ ** sqlite_malloc_failed test to report the error. ++ */ ++ db->xTrace(db->pTraceArg, zSql); ++ } ++ }else{ ++ db->xTrace(db->pTraceArg, zSql); ++ } ++ } ++ if( sqlite_malloc_failed ){ ++ sqliteSetString(pzErrMsg, "out of memory", (char*)0); ++ sParse.rc = SQLITE_NOMEM; ++ sqliteRollbackAll(db); ++ sqliteResetInternalSchema(db, 0); ++ db->flags &= ~SQLITE_InTrans; ++ } ++ if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK; ++ if( sParse.rc!=SQLITE_OK && pzErrMsg && *pzErrMsg==0 ){ ++ sqliteSetString(pzErrMsg, sqlite_error_string(sParse.rc), (char*)0); ++ } ++ sqliteStrRealloc(pzErrMsg); ++ if( sParse.rc==SQLITE_SCHEMA ){ ++ sqliteResetInternalSchema(db, 0); ++ } ++ assert( ppVm ); ++ *ppVm = (sqlite_vm*)sParse.pVdbe; ++ if( pzTail ) *pzTail = sParse.zTail; ++ if( sqliteSafetyOff(db) ) goto exec_misuse; ++ return sParse.rc; ++ ++exec_misuse: ++ if( pzErrMsg ){ ++ *pzErrMsg = 0; ++ sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0); ++ sqliteStrRealloc(pzErrMsg); ++ } ++ return SQLITE_MISUSE; ++} ++ ++ ++/* ++** The following routine destroys a virtual machine that is created by ++** the sqlite_compile() routine. ++** ++** The integer returned is an SQLITE_ success/failure code that describes ++** the result of executing the virtual machine. An error message is ++** written into memory obtained from malloc and *pzErrMsg is made to ++** point to that error if pzErrMsg is not NULL. The calling routine ++** should use sqlite_freemem() to delete the message when it has finished ++** with it. ++*/ ++int sqlite_finalize( ++ sqlite_vm *pVm, /* The virtual machine to be destroyed */ ++ char **pzErrMsg /* OUT: Write error messages here */ ++){ ++ int rc = sqliteVdbeFinalize((Vdbe*)pVm, pzErrMsg); ++ sqliteStrRealloc(pzErrMsg); ++ return rc; ++} ++ ++/* ++** Terminate the current execution of a virtual machine then ++** reset the virtual machine back to its starting state so that it ++** can be reused. Any error message resulting from the prior execution ++** is written into *pzErrMsg. A success code from the prior execution ++** is returned. ++*/ ++int sqlite_reset( ++ sqlite_vm *pVm, /* The virtual machine to be destroyed */ ++ char **pzErrMsg /* OUT: Write error messages here */ ++){ ++ int rc = sqliteVdbeReset((Vdbe*)pVm, pzErrMsg); ++ sqliteVdbeMakeReady((Vdbe*)pVm, -1, 0); ++ sqliteStrRealloc(pzErrMsg); ++ return rc; ++} ++ ++/* ++** Return a static string that describes the kind of error specified in the ++** argument. ++*/ ++const char *sqlite_error_string(int rc){ ++ const char *z; ++ switch( rc ){ ++ case SQLITE_OK: z = "not an error"; break; ++ case SQLITE_ERROR: z = "SQL logic error or missing database"; break; ++ case SQLITE_INTERNAL: z = "internal SQLite implementation flaw"; break; ++ case SQLITE_PERM: z = "access permission denied"; break; ++ case SQLITE_ABORT: z = "callback requested query abort"; break; ++ case SQLITE_BUSY: z = "database is locked"; break; ++ case SQLITE_LOCKED: z = "database table is locked"; break; ++ case SQLITE_NOMEM: z = "out of memory"; break; ++ case SQLITE_READONLY: z = "attempt to write a readonly database"; break; ++ case SQLITE_INTERRUPT: z = "interrupted"; break; ++ case SQLITE_IOERR: z = "disk I/O error"; break; ++ case SQLITE_CORRUPT: z = "database disk image is malformed"; break; ++ case SQLITE_NOTFOUND: z = "table or record not found"; break; ++ case SQLITE_FULL: z = "database is full"; break; ++ case SQLITE_CANTOPEN: z = "unable to open database file"; break; ++ case SQLITE_PROTOCOL: z = "database locking protocol failure"; break; ++ case SQLITE_EMPTY: z = "table contains no data"; break; ++ case SQLITE_SCHEMA: z = "database schema has changed"; break; ++ case SQLITE_TOOBIG: z = "too much data for one table row"; break; ++ case SQLITE_CONSTRAINT: z = "constraint failed"; break; ++ case SQLITE_MISMATCH: z = "datatype mismatch"; break; ++ case SQLITE_MISUSE: z = "library routine called out of sequence";break; ++ case SQLITE_NOLFS: z = "kernel lacks large file support"; break; ++ case SQLITE_AUTH: z = "authorization denied"; break; ++ case SQLITE_FORMAT: z = "auxiliary database format error"; break; ++ case SQLITE_RANGE: z = "bind index out of range"; break; ++ case SQLITE_NOTADB: z = "file is encrypted or is not a database";break; ++ default: z = "unknown error"; break; ++ } ++ return z; ++} ++ ++/* ++** This routine implements a busy callback that sleeps and tries ++** again until a timeout value is reached. The timeout value is ++** an integer number of milliseconds passed in as the first ++** argument. ++*/ ++static int sqliteDefaultBusyCallback( ++ void *Timeout, /* Maximum amount of time to wait */ ++ const char *NotUsed, /* The name of the table that is busy */ ++ int count /* Number of times table has been busy */ ++){ ++#if SQLITE_MIN_SLEEP_MS==1 ++ static const char delays[] = ++ { 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 50, 100}; ++ static const short int totals[] = ++ { 0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228, 287}; ++# define NDELAY (sizeof(delays)/sizeof(delays[0])) ++ int timeout = (int)(long)Timeout; ++ int delay, prior; ++ ++ if( count <= NDELAY ){ ++ delay = delays[count-1]; ++ prior = totals[count-1]; ++ }else{ ++ delay = delays[NDELAY-1]; ++ prior = totals[NDELAY-1] + delay*(count-NDELAY-1); ++ } ++ if( prior + delay > timeout ){ ++ delay = timeout - prior; ++ if( delay<=0 ) return 0; ++ } ++ sqliteOsSleep(delay); ++ return 1; ++#else ++ int timeout = (int)(long)Timeout; ++ if( (count+1)*1000 > timeout ){ ++ return 0; ++ } ++ sqliteOsSleep(1000); ++ return 1; ++#endif ++} ++ ++/* ++** This routine sets the busy callback for an Sqlite database to the ++** given callback function with the given argument. ++*/ ++void sqlite_busy_handler( ++ sqlite *db, ++ int (*xBusy)(void*,const char*,int), ++ void *pArg ++){ ++ db->xBusyCallback = xBusy; ++ db->pBusyArg = pArg; ++} ++ ++#ifndef SQLITE_OMIT_PROGRESS_CALLBACK ++/* ++** This routine sets the progress callback for an Sqlite database to the ++** given callback function with the given argument. The progress callback will ++** be invoked every nOps opcodes. ++*/ ++void sqlite_progress_handler( ++ sqlite *db, ++ int nOps, ++ int (*xProgress)(void*), ++ void *pArg ++){ ++ if( nOps>0 ){ ++ db->xProgress = xProgress; ++ db->nProgressOps = nOps; ++ db->pProgressArg = pArg; ++ }else{ ++ db->xProgress = 0; ++ db->nProgressOps = 0; ++ db->pProgressArg = 0; ++ } ++} ++#endif ++ ++ ++/* ++** This routine installs a default busy handler that waits for the ++** specified number of milliseconds before returning 0. ++*/ ++void sqlite_busy_timeout(sqlite *db, int ms){ ++ if( ms>0 ){ ++ sqlite_busy_handler(db, sqliteDefaultBusyCallback, (void*)(long)ms); ++ }else{ ++ sqlite_busy_handler(db, 0, 0); ++ } ++} ++ ++/* ++** Cause any pending operation to stop at its earliest opportunity. ++*/ ++void sqlite_interrupt(sqlite *db){ ++ db->flags |= SQLITE_Interrupt; ++} ++ ++/* ++** Windows systems should call this routine to free memory that ++** is returned in the in the errmsg parameter of sqlite_open() when ++** SQLite is a DLL. For some reason, it does not work to call free() ++** directly. ++** ++** Note that we need to call free() not sqliteFree() here, since every ++** string that is exported from SQLite should have already passed through ++** sqliteStrRealloc(). ++*/ ++void sqlite_freemem(void *p){ free(p); } ++ ++/* ++** Windows systems need functions to call to return the sqlite_version ++** and sqlite_encoding strings since they are unable to access constants ++** within DLLs. ++*/ ++const char *sqlite_libversion(void){ return sqlite_version; } ++const char *sqlite_libencoding(void){ return sqlite_encoding; } ++ ++/* ++** Create new user-defined functions. The sqlite_create_function() ++** routine creates a regular function and sqlite_create_aggregate() ++** creates an aggregate function. ++** ++** Passing a NULL xFunc argument or NULL xStep and xFinalize arguments ++** disables the function. Calling sqlite_create_function() with the ++** same name and number of arguments as a prior call to ++** sqlite_create_aggregate() disables the prior call to ++** sqlite_create_aggregate(), and vice versa. ++** ++** If nArg is -1 it means that this function will accept any number ++** of arguments, including 0. The maximum allowed value of nArg is 127. ++*/ ++int sqlite_create_function( ++ sqlite *db, /* Add the function to this database connection */ ++ const char *zName, /* Name of the function to add */ ++ int nArg, /* Number of arguments */ ++ void (*xFunc)(sqlite_func*,int,const char**), /* The implementation */ ++ void *pUserData /* User data */ ++){ ++ FuncDef *p; ++ int nName; ++ if( db==0 || zName==0 || sqliteSafetyCheck(db) ) return 1; ++ if( nArg<-1 || nArg>127 ) return 1; ++ nName = strlen(zName); ++ if( nName>255 ) return 1; ++ p = sqliteFindFunction(db, zName, nName, nArg, 1); ++ if( p==0 ) return 1; ++ p->xFunc = xFunc; ++ p->xStep = 0; ++ p->xFinalize = 0; ++ p->pUserData = pUserData; ++ return 0; ++} ++int sqlite_create_aggregate( ++ sqlite *db, /* Add the function to this database connection */ ++ const char *zName, /* Name of the function to add */ ++ int nArg, /* Number of arguments */ ++ void (*xStep)(sqlite_func*,int,const char**), /* The step function */ ++ void (*xFinalize)(sqlite_func*), /* The finalizer */ ++ void *pUserData /* User data */ ++){ ++ FuncDef *p; ++ int nName; ++ if( db==0 || zName==0 || sqliteSafetyCheck(db) ) return 1; ++ if( nArg<-1 || nArg>127 ) return 1; ++ nName = strlen(zName); ++ if( nName>255 ) return 1; ++ p = sqliteFindFunction(db, zName, nName, nArg, 1); ++ if( p==0 ) return 1; ++ p->xFunc = 0; ++ p->xStep = xStep; ++ p->xFinalize = xFinalize; ++ p->pUserData = pUserData; ++ return 0; ++} ++ ++/* ++** Change the datatype for all functions with a given name. See the ++** header comment for the prototype of this function in sqlite.h for ++** additional information. ++*/ ++int sqlite_function_type(sqlite *db, const char *zName, int dataType){ ++ FuncDef *p = (FuncDef*)sqliteHashFind(&db->aFunc, zName, strlen(zName)); ++ while( p ){ ++ p->dataType = dataType; ++ p = p->pNext; ++ } ++ return SQLITE_OK; ++} ++ ++/* ++** Register a trace function. The pArg from the previously registered trace ++** is returned. ++** ++** A NULL trace function means that no tracing is executes. A non-NULL ++** trace is a pointer to a function that is invoked at the start of each ++** sqlite_exec(). ++*/ ++void *sqlite_trace(sqlite *db, void (*xTrace)(void*,const char*), void *pArg){ ++ void *pOld = db->pTraceArg; ++ db->xTrace = xTrace; ++ db->pTraceArg = pArg; ++ return pOld; ++} ++ ++/*** EXPERIMENTAL *** ++** ++** Register a function to be invoked when a transaction comments. ++** If either function returns non-zero, then the commit becomes a ++** rollback. ++*/ ++void *sqlite_commit_hook( ++ sqlite *db, /* Attach the hook to this database */ ++ int (*xCallback)(void*), /* Function to invoke on each commit */ ++ void *pArg /* Argument to the function */ ++){ ++ void *pOld = db->pCommitArg; ++ db->xCommitCallback = xCallback; ++ db->pCommitArg = pArg; ++ return pOld; ++} ++ ++ ++/* ++** This routine is called to create a connection to a database BTree ++** driver. If zFilename is the name of a file, then that file is ++** opened and used. If zFilename is the magic name ":memory:" then ++** the database is stored in memory (and is thus forgotten as soon as ++** the connection is closed.) If zFilename is NULL then the database ++** is for temporary use only and is deleted as soon as the connection ++** is closed. ++** ++** A temporary database can be either a disk file (that is automatically ++** deleted when the file is closed) or a set of red-black trees held in memory, ++** depending on the values of the TEMP_STORE compile-time macro and the ++** db->temp_store variable, according to the following chart: ++** ++** TEMP_STORE db->temp_store Location of temporary database ++** ---------- -------------- ------------------------------ ++** 0 any file ++** 1 1 file ++** 1 2 memory ++** 1 0 file ++** 2 1 file ++** 2 2 memory ++** 2 0 memory ++** 3 any memory ++*/ ++int sqliteBtreeFactory( ++ const sqlite *db, /* Main database when opening aux otherwise 0 */ ++ const char *zFilename, /* Name of the file containing the BTree database */ ++ int omitJournal, /* if TRUE then do not journal this file */ ++ int nCache, /* How many pages in the page cache */ ++ Btree **ppBtree){ /* Pointer to new Btree object written here */ ++ ++ assert( ppBtree != 0); ++ ++#ifndef SQLITE_OMIT_INMEMORYDB ++ if( zFilename==0 ){ ++ if (TEMP_STORE == 0) { ++ /* Always use file based temporary DB */ ++ return sqliteBtreeOpen(0, omitJournal, nCache, ppBtree); ++ } else if (TEMP_STORE == 1 || TEMP_STORE == 2) { ++ /* Switch depending on compile-time and/or runtime settings. */ ++ int location = db->temp_store==0 ? TEMP_STORE : db->temp_store; ++ ++ if (location == 1) { ++ return sqliteBtreeOpen(zFilename, omitJournal, nCache, ppBtree); ++ } else { ++ return sqliteRbtreeOpen(0, 0, 0, ppBtree); ++ } ++ } else { ++ /* Always use in-core DB */ ++ return sqliteRbtreeOpen(0, 0, 0, ppBtree); ++ } ++ }else if( zFilename[0]==':' && strcmp(zFilename,":memory:")==0 ){ ++ return sqliteRbtreeOpen(0, 0, 0, ppBtree); ++ }else ++#endif ++ { ++ return sqliteBtreeOpen(zFilename, omitJournal, nCache, ppBtree); ++ } ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/opcodes.c +@@ -0,0 +1,140 @@ ++/* Automatically generated file. Do not edit */ ++char *sqliteOpcodeNames[] = { "???", ++ "Goto", ++ "Gosub", ++ "Return", ++ "Halt", ++ "Integer", ++ "String", ++ "Variable", ++ "Pop", ++ "Dup", ++ "Pull", ++ "Push", ++ "ColumnName", ++ "Callback", ++ "Concat", ++ "Add", ++ "Subtract", ++ "Multiply", ++ "Divide", ++ "Remainder", ++ "Function", ++ "BitAnd", ++ "BitOr", ++ "ShiftLeft", ++ "ShiftRight", ++ "AddImm", ++ "ForceInt", ++ "MustBeInt", ++ "Eq", ++ "Ne", ++ "Lt", ++ "Le", ++ "Gt", ++ "Ge", ++ "StrEq", ++ "StrNe", ++ "StrLt", ++ "StrLe", ++ "StrGt", ++ "StrGe", ++ "And", ++ "Or", ++ "Negative", ++ "AbsValue", ++ "Not", ++ "BitNot", ++ "Noop", ++ "If", ++ "IfNot", ++ "IsNull", ++ "NotNull", ++ "MakeRecord", ++ "MakeIdxKey", ++ "MakeKey", ++ "IncrKey", ++ "Checkpoint", ++ "Transaction", ++ "Commit", ++ "Rollback", ++ "ReadCookie", ++ "SetCookie", ++ "VerifyCookie", ++ "OpenRead", ++ "OpenWrite", ++ "OpenTemp", ++ "OpenPseudo", ++ "Close", ++ "MoveLt", ++ "MoveTo", ++ "Distinct", ++ "NotFound", ++ "Found", ++ "IsUnique", ++ "NotExists", ++ "NewRecno", ++ "PutIntKey", ++ "PutStrKey", ++ "Delete", ++ "SetCounts", ++ "KeyAsData", ++ "RowKey", ++ "RowData", ++ "Column", ++ "Recno", ++ "FullKey", ++ "NullRow", ++ "Last", ++ "Rewind", ++ "Prev", ++ "Next", ++ "IdxPut", ++ "IdxDelete", ++ "IdxRecno", ++ "IdxLT", ++ "IdxGT", ++ "IdxGE", ++ "IdxIsNull", ++ "Destroy", ++ "Clear", ++ "CreateIndex", ++ "CreateTable", ++ "IntegrityCk", ++ "ListWrite", ++ "ListRewind", ++ "ListRead", ++ "ListReset", ++ "ListPush", ++ "ListPop", ++ "ContextPush", ++ "ContextPop", ++ "SortPut", ++ "SortMakeRec", ++ "SortMakeKey", ++ "Sort", ++ "SortNext", ++ "SortCallback", ++ "SortReset", ++ "FileOpen", ++ "FileRead", ++ "FileColumn", ++ "MemStore", ++ "MemLoad", ++ "MemIncr", ++ "AggReset", ++ "AggInit", ++ "AggFunc", ++ "AggFocus", ++ "AggSet", ++ "AggGet", ++ "AggNext", ++ "SetInsert", ++ "SetFound", ++ "SetNotFound", ++ "SetFirst", ++ "SetNext", ++ "Vacuum", ++ "StackDepth", ++ "StackReset", ++}; +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/opcodes.h +@@ -0,0 +1,138 @@ ++/* Automatically generated file. Do not edit */ ++#define OP_Goto 1 ++#define OP_Gosub 2 ++#define OP_Return 3 ++#define OP_Halt 4 ++#define OP_Integer 5 ++#define OP_String 6 ++#define OP_Variable 7 ++#define OP_Pop 8 ++#define OP_Dup 9 ++#define OP_Pull 10 ++#define OP_Push 11 ++#define OP_ColumnName 12 ++#define OP_Callback 13 ++#define OP_Concat 14 ++#define OP_Add 15 ++#define OP_Subtract 16 ++#define OP_Multiply 17 ++#define OP_Divide 18 ++#define OP_Remainder 19 ++#define OP_Function 20 ++#define OP_BitAnd 21 ++#define OP_BitOr 22 ++#define OP_ShiftLeft 23 ++#define OP_ShiftRight 24 ++#define OP_AddImm 25 ++#define OP_ForceInt 26 ++#define OP_MustBeInt 27 ++#define OP_Eq 28 ++#define OP_Ne 29 ++#define OP_Lt 30 ++#define OP_Le 31 ++#define OP_Gt 32 ++#define OP_Ge 33 ++#define OP_StrEq 34 ++#define OP_StrNe 35 ++#define OP_StrLt 36 ++#define OP_StrLe 37 ++#define OP_StrGt 38 ++#define OP_StrGe 39 ++#define OP_And 40 ++#define OP_Or 41 ++#define OP_Negative 42 ++#define OP_AbsValue 43 ++#define OP_Not 44 ++#define OP_BitNot 45 ++#define OP_Noop 46 ++#define OP_If 47 ++#define OP_IfNot 48 ++#define OP_IsNull 49 ++#define OP_NotNull 50 ++#define OP_MakeRecord 51 ++#define OP_MakeIdxKey 52 ++#define OP_MakeKey 53 ++#define OP_IncrKey 54 ++#define OP_Checkpoint 55 ++#define OP_Transaction 56 ++#define OP_Commit 57 ++#define OP_Rollback 58 ++#define OP_ReadCookie 59 ++#define OP_SetCookie 60 ++#define OP_VerifyCookie 61 ++#define OP_OpenRead 62 ++#define OP_OpenWrite 63 ++#define OP_OpenTemp 64 ++#define OP_OpenPseudo 65 ++#define OP_Close 66 ++#define OP_MoveLt 67 ++#define OP_MoveTo 68 ++#define OP_Distinct 69 ++#define OP_NotFound 70 ++#define OP_Found 71 ++#define OP_IsUnique 72 ++#define OP_NotExists 73 ++#define OP_NewRecno 74 ++#define OP_PutIntKey 75 ++#define OP_PutStrKey 76 ++#define OP_Delete 77 ++#define OP_SetCounts 78 ++#define OP_KeyAsData 79 ++#define OP_RowKey 80 ++#define OP_RowData 81 ++#define OP_Column 82 ++#define OP_Recno 83 ++#define OP_FullKey 84 ++#define OP_NullRow 85 ++#define OP_Last 86 ++#define OP_Rewind 87 ++#define OP_Prev 88 ++#define OP_Next 89 ++#define OP_IdxPut 90 ++#define OP_IdxDelete 91 ++#define OP_IdxRecno 92 ++#define OP_IdxLT 93 ++#define OP_IdxGT 94 ++#define OP_IdxGE 95 ++#define OP_IdxIsNull 96 ++#define OP_Destroy 97 ++#define OP_Clear 98 ++#define OP_CreateIndex 99 ++#define OP_CreateTable 100 ++#define OP_IntegrityCk 101 ++#define OP_ListWrite 102 ++#define OP_ListRewind 103 ++#define OP_ListRead 104 ++#define OP_ListReset 105 ++#define OP_ListPush 106 ++#define OP_ListPop 107 ++#define OP_ContextPush 108 ++#define OP_ContextPop 109 ++#define OP_SortPut 110 ++#define OP_SortMakeRec 111 ++#define OP_SortMakeKey 112 ++#define OP_Sort 113 ++#define OP_SortNext 114 ++#define OP_SortCallback 115 ++#define OP_SortReset 116 ++#define OP_FileOpen 117 ++#define OP_FileRead 118 ++#define OP_FileColumn 119 ++#define OP_MemStore 120 ++#define OP_MemLoad 121 ++#define OP_MemIncr 122 ++#define OP_AggReset 123 ++#define OP_AggInit 124 ++#define OP_AggFunc 125 ++#define OP_AggFocus 126 ++#define OP_AggSet 127 ++#define OP_AggGet 128 ++#define OP_AggNext 129 ++#define OP_SetInsert 130 ++#define OP_SetFound 131 ++#define OP_SetNotFound 132 ++#define OP_SetFirst 133 ++#define OP_SetNext 134 ++#define OP_Vacuum 135 ++#define OP_StackDepth 136 ++#define OP_StackReset 137 +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/os.c +@@ -0,0 +1,1850 @@ ++/* ++** 2001 September 16 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++****************************************************************************** ++** ++** This file contains code that is specific to particular operating ++** systems. The purpose of this file is to provide a uniform abstraction ++** on which the rest of SQLite can operate. ++*/ ++#include "os.h" /* Must be first to enable large file support */ ++#include "sqliteInt.h" ++ ++#if OS_UNIX ++# include ++# include ++# include ++# ifndef O_LARGEFILE ++# define O_LARGEFILE 0 ++# endif ++# ifdef SQLITE_DISABLE_LFS ++# undef O_LARGEFILE ++# define O_LARGEFILE 0 ++# endif ++# ifndef O_NOFOLLOW ++# define O_NOFOLLOW 0 ++# endif ++# ifndef O_BINARY ++# define O_BINARY 0 ++# endif ++#endif ++ ++ ++#if OS_WIN ++# include ++#endif ++ ++#if OS_MAC ++# include ++# include ++# include ++# include ++# include ++# include ++# include ++#endif ++ ++/* ++** The DJGPP compiler environment looks mostly like Unix, but it ++** lacks the fcntl() system call. So redefine fcntl() to be something ++** that always succeeds. This means that locking does not occur under ++** DJGPP. But its DOS - what did you expect? ++*/ ++#ifdef __DJGPP__ ++# define fcntl(A,B,C) 0 ++#endif ++ ++/* ++** Macros used to determine whether or not to use threads. The ++** SQLITE_UNIX_THREADS macro is defined if we are synchronizing for ++** Posix threads and SQLITE_W32_THREADS is defined if we are ++** synchronizing using Win32 threads. ++*/ ++#if OS_UNIX && defined(THREADSAFE) && THREADSAFE ++# include ++# define SQLITE_UNIX_THREADS 1 ++#endif ++#if OS_WIN && defined(THREADSAFE) && THREADSAFE ++# define SQLITE_W32_THREADS 1 ++#endif ++#if OS_MAC && defined(THREADSAFE) && THREADSAFE ++# include ++# define SQLITE_MACOS_MULTITASKING 1 ++#endif ++ ++/* ++** Macros for performance tracing. Normally turned off ++*/ ++#if 0 ++static int last_page = 0; ++__inline__ unsigned long long int hwtime(void){ ++ unsigned long long int x; ++ __asm__("rdtsc\n\t" ++ "mov %%edx, %%ecx\n\t" ++ :"=A" (x)); ++ return x; ++} ++static unsigned long long int g_start; ++static unsigned int elapse; ++#define TIMER_START g_start=hwtime() ++#define TIMER_END elapse=hwtime()-g_start ++#define SEEK(X) last_page=(X) ++#define TRACE1(X) fprintf(stderr,X) ++#define TRACE2(X,Y) fprintf(stderr,X,Y) ++#define TRACE3(X,Y,Z) fprintf(stderr,X,Y,Z) ++#define TRACE4(X,Y,Z,A) fprintf(stderr,X,Y,Z,A) ++#define TRACE5(X,Y,Z,A,B) fprintf(stderr,X,Y,Z,A,B) ++#else ++#define TIMER_START ++#define TIMER_END ++#define SEEK(X) ++#define TRACE1(X) ++#define TRACE2(X,Y) ++#define TRACE3(X,Y,Z) ++#define TRACE4(X,Y,Z,A) ++#define TRACE5(X,Y,Z,A,B) ++#endif ++ ++ ++#if OS_UNIX ++/* ++** Here is the dirt on POSIX advisory locks: ANSI STD 1003.1 (1996) ++** section 6.5.2.2 lines 483 through 490 specify that when a process ++** sets or clears a lock, that operation overrides any prior locks set ++** by the same process. It does not explicitly say so, but this implies ++** that it overrides locks set by the same process using a different ++** file descriptor. Consider this test case: ++** ++** int fd1 = open("./file1", O_RDWR|O_CREAT, 0644); ++** int fd2 = open("./file2", O_RDWR|O_CREAT, 0644); ++** ++** Suppose ./file1 and ./file2 are really the same file (because ++** one is a hard or symbolic link to the other) then if you set ++** an exclusive lock on fd1, then try to get an exclusive lock ++** on fd2, it works. I would have expected the second lock to ++** fail since there was already a lock on the file due to fd1. ++** But not so. Since both locks came from the same process, the ++** second overrides the first, even though they were on different ++** file descriptors opened on different file names. ++** ++** Bummer. If you ask me, this is broken. Badly broken. It means ++** that we cannot use POSIX locks to synchronize file access among ++** competing threads of the same process. POSIX locks will work fine ++** to synchronize access for threads in separate processes, but not ++** threads within the same process. ++** ++** To work around the problem, SQLite has to manage file locks internally ++** on its own. Whenever a new database is opened, we have to find the ++** specific inode of the database file (the inode is determined by the ++** st_dev and st_ino fields of the stat structure that fstat() fills in) ++** and check for locks already existing on that inode. When locks are ++** created or removed, we have to look at our own internal record of the ++** locks to see if another thread has previously set a lock on that same ++** inode. ++** ++** The OsFile structure for POSIX is no longer just an integer file ++** descriptor. It is now a structure that holds the integer file ++** descriptor and a pointer to a structure that describes the internal ++** locks on the corresponding inode. There is one locking structure ++** per inode, so if the same inode is opened twice, both OsFile structures ++** point to the same locking structure. The locking structure keeps ++** a reference count (so we will know when to delete it) and a "cnt" ++** field that tells us its internal lock status. cnt==0 means the ++** file is unlocked. cnt==-1 means the file has an exclusive lock. ++** cnt>0 means there are cnt shared locks on the file. ++** ++** Any attempt to lock or unlock a file first checks the locking ++** structure. The fcntl() system call is only invoked to set a ++** POSIX lock if the internal lock structure transitions between ++** a locked and an unlocked state. ++** ++** 2004-Jan-11: ++** More recent discoveries about POSIX advisory locks. (The more ++** I discover, the more I realize the a POSIX advisory locks are ++** an abomination.) ++** ++** If you close a file descriptor that points to a file that has locks, ++** all locks on that file that are owned by the current process are ++** released. To work around this problem, each OsFile structure contains ++** a pointer to an openCnt structure. There is one openCnt structure ++** per open inode, which means that multiple OsFiles can point to a single ++** openCnt. When an attempt is made to close an OsFile, if there are ++** other OsFiles open on the same inode that are holding locks, the call ++** to close() the file descriptor is deferred until all of the locks clear. ++** The openCnt structure keeps a list of file descriptors that need to ++** be closed and that list is walked (and cleared) when the last lock ++** clears. ++** ++** First, under Linux threads, because each thread has a separate ++** process ID, lock operations in one thread do not override locks ++** to the same file in other threads. Linux threads behave like ++** separate processes in this respect. But, if you close a file ++** descriptor in linux threads, all locks are cleared, even locks ++** on other threads and even though the other threads have different ++** process IDs. Linux threads is inconsistent in this respect. ++** (I'm beginning to think that linux threads is an abomination too.) ++** The consequence of this all is that the hash table for the lockInfo ++** structure has to include the process id as part of its key because ++** locks in different threads are treated as distinct. But the ++** openCnt structure should not include the process id in its ++** key because close() clears lock on all threads, not just the current ++** thread. Were it not for this goofiness in linux threads, we could ++** combine the lockInfo and openCnt structures into a single structure. ++*/ ++ ++/* ++** An instance of the following structure serves as the key used ++** to locate a particular lockInfo structure given its inode. Note ++** that we have to include the process ID as part of the key. On some ++** threading implementations (ex: linux), each thread has a separate ++** process ID. ++*/ ++struct lockKey { ++ dev_t dev; /* Device number */ ++ ino_t ino; /* Inode number */ ++ pid_t pid; /* Process ID */ ++}; ++ ++/* ++** An instance of the following structure is allocated for each open ++** inode on each thread with a different process ID. (Threads have ++** different process IDs on linux, but not on most other unixes.) ++** ++** A single inode can have multiple file descriptors, so each OsFile ++** structure contains a pointer to an instance of this object and this ++** object keeps a count of the number of OsFiles pointing to it. ++*/ ++struct lockInfo { ++ struct lockKey key; /* The lookup key */ ++ int cnt; /* 0: unlocked. -1: write lock. 1...: read lock. */ ++ int nRef; /* Number of pointers to this structure */ ++}; ++ ++/* ++** An instance of the following structure serves as the key used ++** to locate a particular openCnt structure given its inode. This ++** is the same as the lockKey except that the process ID is omitted. ++*/ ++struct openKey { ++ dev_t dev; /* Device number */ ++ ino_t ino; /* Inode number */ ++}; ++ ++/* ++** An instance of the following structure is allocated for each open ++** inode. This structure keeps track of the number of locks on that ++** inode. If a close is attempted against an inode that is holding ++** locks, the close is deferred until all locks clear by adding the ++** file descriptor to be closed to the pending list. ++*/ ++struct openCnt { ++ struct openKey key; /* The lookup key */ ++ int nRef; /* Number of pointers to this structure */ ++ int nLock; /* Number of outstanding locks */ ++ int nPending; /* Number of pending close() operations */ ++ int *aPending; /* Malloced space holding fd's awaiting a close() */ ++}; ++ ++/* ++** These hash table maps inodes and process IDs into lockInfo and openCnt ++** structures. Access to these hash tables must be protected by a mutex. ++*/ ++static Hash lockHash = { SQLITE_HASH_BINARY, 0, 0, 0, 0, 0 }; ++static Hash openHash = { SQLITE_HASH_BINARY, 0, 0, 0, 0, 0 }; ++ ++/* ++** Release a lockInfo structure previously allocated by findLockInfo(). ++*/ ++static void releaseLockInfo(struct lockInfo *pLock){ ++ pLock->nRef--; ++ if( pLock->nRef==0 ){ ++ sqliteHashInsert(&lockHash, &pLock->key, sizeof(pLock->key), 0); ++ sqliteFree(pLock); ++ } ++} ++ ++/* ++** Release a openCnt structure previously allocated by findLockInfo(). ++*/ ++static void releaseOpenCnt(struct openCnt *pOpen){ ++ pOpen->nRef--; ++ if( pOpen->nRef==0 ){ ++ sqliteHashInsert(&openHash, &pOpen->key, sizeof(pOpen->key), 0); ++ sqliteFree(pOpen->aPending); ++ sqliteFree(pOpen); ++ } ++} ++ ++/* ++** Given a file descriptor, locate lockInfo and openCnt structures that ++** describes that file descriptor. Create a new ones if necessary. The ++** return values might be unset if an error occurs. ++** ++** Return the number of errors. ++*/ ++int findLockInfo( ++ int fd, /* The file descriptor used in the key */ ++ struct lockInfo **ppLock, /* Return the lockInfo structure here */ ++ struct openCnt **ppOpen /* Return the openCnt structure here */ ++){ ++ int rc; ++ struct lockKey key1; ++ struct openKey key2; ++ struct stat statbuf; ++ struct lockInfo *pLock; ++ struct openCnt *pOpen; ++ rc = fstat(fd, &statbuf); ++ if( rc!=0 ) return 1; ++ memset(&key1, 0, sizeof(key1)); ++ key1.dev = statbuf.st_dev; ++ key1.ino = statbuf.st_ino; ++ key1.pid = getpid(); ++ memset(&key2, 0, sizeof(key2)); ++ key2.dev = statbuf.st_dev; ++ key2.ino = statbuf.st_ino; ++ pLock = (struct lockInfo*)sqliteHashFind(&lockHash, &key1, sizeof(key1)); ++ if( pLock==0 ){ ++ struct lockInfo *pOld; ++ pLock = sqliteMallocRaw( sizeof(*pLock) ); ++ if( pLock==0 ) return 1; ++ pLock->key = key1; ++ pLock->nRef = 1; ++ pLock->cnt = 0; ++ pOld = sqliteHashInsert(&lockHash, &pLock->key, sizeof(key1), pLock); ++ if( pOld!=0 ){ ++ assert( pOld==pLock ); ++ sqliteFree(pLock); ++ return 1; ++ } ++ }else{ ++ pLock->nRef++; ++ } ++ *ppLock = pLock; ++ pOpen = (struct openCnt*)sqliteHashFind(&openHash, &key2, sizeof(key2)); ++ if( pOpen==0 ){ ++ struct openCnt *pOld; ++ pOpen = sqliteMallocRaw( sizeof(*pOpen) ); ++ if( pOpen==0 ){ ++ releaseLockInfo(pLock); ++ return 1; ++ } ++ pOpen->key = key2; ++ pOpen->nRef = 1; ++ pOpen->nLock = 0; ++ pOpen->nPending = 0; ++ pOpen->aPending = 0; ++ pOld = sqliteHashInsert(&openHash, &pOpen->key, sizeof(key2), pOpen); ++ if( pOld!=0 ){ ++ assert( pOld==pOpen ); ++ sqliteFree(pOpen); ++ releaseLockInfo(pLock); ++ return 1; ++ } ++ }else{ ++ pOpen->nRef++; ++ } ++ *ppOpen = pOpen; ++ return 0; ++} ++ ++#endif /** POSIX advisory lock work-around **/ ++ ++/* ++** If we compile with the SQLITE_TEST macro set, then the following block ++** of code will give us the ability to simulate a disk I/O error. This ++** is used for testing the I/O recovery logic. ++*/ ++#ifdef SQLITE_TEST ++int sqlite_io_error_pending = 0; ++#define SimulateIOError(A) \ ++ if( sqlite_io_error_pending ) \ ++ if( sqlite_io_error_pending-- == 1 ){ local_ioerr(); return A; } ++static void local_ioerr(){ ++ sqlite_io_error_pending = 0; /* Really just a place to set a breakpoint */ ++} ++#else ++#define SimulateIOError(A) ++#endif ++ ++/* ++** When testing, keep a count of the number of open files. ++*/ ++#ifdef SQLITE_TEST ++int sqlite_open_file_count = 0; ++#define OpenCounter(X) sqlite_open_file_count+=(X) ++#else ++#define OpenCounter(X) ++#endif ++ ++ ++/* ++** Delete the named file ++*/ ++int sqliteOsDelete(const char *zFilename){ ++#if OS_UNIX ++ unlink(zFilename); ++#endif ++#if OS_WIN ++ DeleteFile(zFilename); ++#endif ++#if OS_MAC ++ unlink(zFilename); ++#endif ++ return SQLITE_OK; ++} ++ ++/* ++** Return TRUE if the named file exists. ++*/ ++int sqliteOsFileExists(const char *zFilename){ ++#if OS_UNIX ++ return access(zFilename, 0)==0; ++#endif ++#if OS_WIN ++ return GetFileAttributes(zFilename) != 0xffffffff; ++#endif ++#if OS_MAC ++ return access(zFilename, 0)==0; ++#endif ++} ++ ++ ++#if 0 /* NOT USED */ ++/* ++** Change the name of an existing file. ++*/ ++int sqliteOsFileRename(const char *zOldName, const char *zNewName){ ++#if OS_UNIX ++ if( link(zOldName, zNewName) ){ ++ return SQLITE_ERROR; ++ } ++ unlink(zOldName); ++ return SQLITE_OK; ++#endif ++#if OS_WIN ++ if( !MoveFile(zOldName, zNewName) ){ ++ return SQLITE_ERROR; ++ } ++ return SQLITE_OK; ++#endif ++#if OS_MAC ++ /**** FIX ME ***/ ++ return SQLITE_ERROR; ++#endif ++} ++#endif /* NOT USED */ ++ ++/* ++** Attempt to open a file for both reading and writing. If that ++** fails, try opening it read-only. If the file does not exist, ++** try to create it. ++** ++** On success, a handle for the open file is written to *id ++** and *pReadonly is set to 0 if the file was opened for reading and ++** writing or 1 if the file was opened read-only. The function returns ++** SQLITE_OK. ++** ++** On failure, the function returns SQLITE_CANTOPEN and leaves ++** *id and *pReadonly unchanged. ++*/ ++int sqliteOsOpenReadWrite( ++ const char *zFilename, ++ OsFile *id, ++ int *pReadonly ++){ ++#if OS_UNIX ++ int rc; ++ id->dirfd = -1; ++ id->fd = open(zFilename, O_RDWR|O_CREAT|O_LARGEFILE|O_BINARY, 0644); ++ if( id->fd<0 ){ ++#ifdef EISDIR ++ if( errno==EISDIR ){ ++ return SQLITE_CANTOPEN; ++ } ++#endif ++ id->fd = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY); ++ if( id->fd<0 ){ ++ return SQLITE_CANTOPEN; ++ } ++ *pReadonly = 1; ++ }else{ ++ *pReadonly = 0; ++ } ++ sqliteOsEnterMutex(); ++ rc = findLockInfo(id->fd, &id->pLock, &id->pOpen); ++ sqliteOsLeaveMutex(); ++ if( rc ){ ++ close(id->fd); ++ return SQLITE_NOMEM; ++ } ++ id->locked = 0; ++ TRACE3("OPEN %-3d %s\n", id->fd, zFilename); ++ OpenCounter(+1); ++ return SQLITE_OK; ++#endif ++#if OS_WIN ++ HANDLE h = CreateFile(zFilename, ++ GENERIC_READ | GENERIC_WRITE, ++ FILE_SHARE_READ | FILE_SHARE_WRITE, ++ NULL, ++ OPEN_ALWAYS, ++ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, ++ NULL ++ ); ++ if( h==INVALID_HANDLE_VALUE ){ ++ h = CreateFile(zFilename, ++ GENERIC_READ, ++ FILE_SHARE_READ, ++ NULL, ++ OPEN_ALWAYS, ++ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, ++ NULL ++ ); ++ if( h==INVALID_HANDLE_VALUE ){ ++ return SQLITE_CANTOPEN; ++ } ++ *pReadonly = 1; ++ }else{ ++ *pReadonly = 0; ++ } ++ id->h = h; ++ id->locked = 0; ++ OpenCounter(+1); ++ return SQLITE_OK; ++#endif ++#if OS_MAC ++ FSSpec fsSpec; ++# ifdef _LARGE_FILE ++ HFSUniStr255 dfName; ++ FSRef fsRef; ++ if( __path2fss(zFilename, &fsSpec) != noErr ){ ++ if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr ) ++ return SQLITE_CANTOPEN; ++ } ++ if( FSpMakeFSRef(&fsSpec, &fsRef) != noErr ) ++ return SQLITE_CANTOPEN; ++ FSGetDataForkName(&dfName); ++ if( FSOpenFork(&fsRef, dfName.length, dfName.unicode, ++ fsRdWrShPerm, &(id->refNum)) != noErr ){ ++ if( FSOpenFork(&fsRef, dfName.length, dfName.unicode, ++ fsRdWrPerm, &(id->refNum)) != noErr ){ ++ if (FSOpenFork(&fsRef, dfName.length, dfName.unicode, ++ fsRdPerm, &(id->refNum)) != noErr ) ++ return SQLITE_CANTOPEN; ++ else ++ *pReadonly = 1; ++ } else ++ *pReadonly = 0; ++ } else ++ *pReadonly = 0; ++# else ++ __path2fss(zFilename, &fsSpec); ++ if( !sqliteOsFileExists(zFilename) ){ ++ if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr ) ++ return SQLITE_CANTOPEN; ++ } ++ if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrShPerm, &(id->refNum)) != noErr ){ ++ if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrPerm, &(id->refNum)) != noErr ){ ++ if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdPerm, &(id->refNum)) != noErr ) ++ return SQLITE_CANTOPEN; ++ else ++ *pReadonly = 1; ++ } else ++ *pReadonly = 0; ++ } else ++ *pReadonly = 0; ++# endif ++ if( HOpenRF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrShPerm, &(id->refNumRF)) != noErr){ ++ id->refNumRF = -1; ++ } ++ id->locked = 0; ++ id->delOnClose = 0; ++ OpenCounter(+1); ++ return SQLITE_OK; ++#endif ++} ++ ++ ++/* ++** Attempt to open a new file for exclusive access by this process. ++** The file will be opened for both reading and writing. To avoid ++** a potential security problem, we do not allow the file to have ++** previously existed. Nor do we allow the file to be a symbolic ++** link. ++** ++** If delFlag is true, then make arrangements to automatically delete ++** the file when it is closed. ++** ++** On success, write the file handle into *id and return SQLITE_OK. ++** ++** On failure, return SQLITE_CANTOPEN. ++*/ ++int sqliteOsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){ ++#if OS_UNIX ++ int rc; ++ if( access(zFilename, 0)==0 ){ ++ return SQLITE_CANTOPEN; ++ } ++ id->dirfd = -1; ++ id->fd = open(zFilename, ++ O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_LARGEFILE|O_BINARY, 0600); ++ if( id->fd<0 ){ ++ return SQLITE_CANTOPEN; ++ } ++ sqliteOsEnterMutex(); ++ rc = findLockInfo(id->fd, &id->pLock, &id->pOpen); ++ sqliteOsLeaveMutex(); ++ if( rc ){ ++ close(id->fd); ++ unlink(zFilename); ++ return SQLITE_NOMEM; ++ } ++ id->locked = 0; ++ if( delFlag ){ ++ unlink(zFilename); ++ } ++ TRACE3("OPEN-EX %-3d %s\n", id->fd, zFilename); ++ OpenCounter(+1); ++ return SQLITE_OK; ++#endif ++#if OS_WIN ++ HANDLE h; ++ int fileflags; ++ if( delFlag ){ ++ fileflags = FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_RANDOM_ACCESS ++ | FILE_FLAG_DELETE_ON_CLOSE; ++ }else{ ++ fileflags = FILE_FLAG_RANDOM_ACCESS; ++ } ++ h = CreateFile(zFilename, ++ GENERIC_READ | GENERIC_WRITE, ++ 0, ++ NULL, ++ CREATE_ALWAYS, ++ fileflags, ++ NULL ++ ); ++ if( h==INVALID_HANDLE_VALUE ){ ++ return SQLITE_CANTOPEN; ++ } ++ id->h = h; ++ id->locked = 0; ++ OpenCounter(+1); ++ return SQLITE_OK; ++#endif ++#if OS_MAC ++ FSSpec fsSpec; ++# ifdef _LARGE_FILE ++ HFSUniStr255 dfName; ++ FSRef fsRef; ++ __path2fss(zFilename, &fsSpec); ++ if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr ) ++ return SQLITE_CANTOPEN; ++ if( FSpMakeFSRef(&fsSpec, &fsRef) != noErr ) ++ return SQLITE_CANTOPEN; ++ FSGetDataForkName(&dfName); ++ if( FSOpenFork(&fsRef, dfName.length, dfName.unicode, ++ fsRdWrPerm, &(id->refNum)) != noErr ) ++ return SQLITE_CANTOPEN; ++# else ++ __path2fss(zFilename, &fsSpec); ++ if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr ) ++ return SQLITE_CANTOPEN; ++ if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrPerm, &(id->refNum)) != noErr ) ++ return SQLITE_CANTOPEN; ++# endif ++ id->refNumRF = -1; ++ id->locked = 0; ++ id->delOnClose = delFlag; ++ if (delFlag) ++ id->pathToDel = sqliteOsFullPathname(zFilename); ++ OpenCounter(+1); ++ return SQLITE_OK; ++#endif ++} ++ ++/* ++** Attempt to open a new file for read-only access. ++** ++** On success, write the file handle into *id and return SQLITE_OK. ++** ++** On failure, return SQLITE_CANTOPEN. ++*/ ++int sqliteOsOpenReadOnly(const char *zFilename, OsFile *id){ ++#if OS_UNIX ++ int rc; ++ id->dirfd = -1; ++ id->fd = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY); ++ if( id->fd<0 ){ ++ return SQLITE_CANTOPEN; ++ } ++ sqliteOsEnterMutex(); ++ rc = findLockInfo(id->fd, &id->pLock, &id->pOpen); ++ sqliteOsLeaveMutex(); ++ if( rc ){ ++ close(id->fd); ++ return SQLITE_NOMEM; ++ } ++ id->locked = 0; ++ TRACE3("OPEN-RO %-3d %s\n", id->fd, zFilename); ++ OpenCounter(+1); ++ return SQLITE_OK; ++#endif ++#if OS_WIN ++ HANDLE h = CreateFile(zFilename, ++ GENERIC_READ, ++ 0, ++ NULL, ++ OPEN_EXISTING, ++ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, ++ NULL ++ ); ++ if( h==INVALID_HANDLE_VALUE ){ ++ return SQLITE_CANTOPEN; ++ } ++ id->h = h; ++ id->locked = 0; ++ OpenCounter(+1); ++ return SQLITE_OK; ++#endif ++#if OS_MAC ++ FSSpec fsSpec; ++# ifdef _LARGE_FILE ++ HFSUniStr255 dfName; ++ FSRef fsRef; ++ if( __path2fss(zFilename, &fsSpec) != noErr ) ++ return SQLITE_CANTOPEN; ++ if( FSpMakeFSRef(&fsSpec, &fsRef) != noErr ) ++ return SQLITE_CANTOPEN; ++ FSGetDataForkName(&dfName); ++ if( FSOpenFork(&fsRef, dfName.length, dfName.unicode, ++ fsRdPerm, &(id->refNum)) != noErr ) ++ return SQLITE_CANTOPEN; ++# else ++ __path2fss(zFilename, &fsSpec); ++ if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdPerm, &(id->refNum)) != noErr ) ++ return SQLITE_CANTOPEN; ++# endif ++ if( HOpenRF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrShPerm, &(id->refNumRF)) != noErr){ ++ id->refNumRF = -1; ++ } ++ id->locked = 0; ++ id->delOnClose = 0; ++ OpenCounter(+1); ++ return SQLITE_OK; ++#endif ++} ++ ++/* ++** Attempt to open a file descriptor for the directory that contains a ++** file. This file descriptor can be used to fsync() the directory ++** in order to make sure the creation of a new file is actually written ++** to disk. ++** ++** This routine is only meaningful for Unix. It is a no-op under ++** windows since windows does not support hard links. ++** ++** On success, a handle for a previously open file is at *id is ++** updated with the new directory file descriptor and SQLITE_OK is ++** returned. ++** ++** On failure, the function returns SQLITE_CANTOPEN and leaves ++** *id unchanged. ++*/ ++int sqliteOsOpenDirectory( ++ const char *zDirname, ++ OsFile *id ++){ ++#if OS_UNIX ++ if( id->fd<0 ){ ++ /* Do not open the directory if the corresponding file is not already ++ ** open. */ ++ return SQLITE_CANTOPEN; ++ } ++ assert( id->dirfd<0 ); ++ id->dirfd = open(zDirname, O_RDONLY|O_BINARY, 0644); ++ if( id->dirfd<0 ){ ++ return SQLITE_CANTOPEN; ++ } ++ TRACE3("OPENDIR %-3d %s\n", id->dirfd, zDirname); ++#endif ++ return SQLITE_OK; ++} ++ ++/* ++** If the following global variable points to a string which is the ++** name of a directory, then that directory will be used to store ++** temporary files. ++*/ ++const char *sqlite_temp_directory = 0; ++ ++/* ++** Create a temporary file name in zBuf. zBuf must be big enough to ++** hold at least SQLITE_TEMPNAME_SIZE characters. ++*/ ++int sqliteOsTempFileName(char *zBuf){ ++#if OS_UNIX ++ static const char *azDirs[] = { ++ 0, ++ "/var/tmp", ++ "/usr/tmp", ++ "/tmp", ++ ".", ++ }; ++ static unsigned char zChars[] = ++ "abcdefghijklmnopqrstuvwxyz" ++ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ++ "0123456789"; ++ int i, j; ++ struct stat buf; ++ const char *zDir = "."; ++ azDirs[0] = sqlite_temp_directory; ++ for(i=0; i0 && zTempPath[i-1]=='\\'; i--){} ++ zTempPath[i] = 0; ++ zDir = zTempPath; ++ }else{ ++ zDir = sqlite_temp_directory; ++ } ++ for(;;){ ++ sprintf(zBuf, "%s\\"TEMP_FILE_PREFIX, zDir); ++ j = strlen(zBuf); ++ sqliteRandomness(15, &zBuf[j]); ++ for(i=0; i<15; i++, j++){ ++ zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ]; ++ } ++ zBuf[j] = 0; ++ if( !sqliteOsFileExists(zBuf) ) break; ++ } ++#endif ++#if OS_MAC ++ static char zChars[] = ++ "abcdefghijklmnopqrstuvwxyz" ++ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ++ "0123456789"; ++ int i, j; ++ char *zDir; ++ char zTempPath[SQLITE_TEMPNAME_SIZE]; ++ char zdirName[32]; ++ CInfoPBRec infoRec; ++ Str31 dirName; ++ memset(&infoRec, 0, sizeof(infoRec)); ++ memset(zTempPath, 0, SQLITE_TEMPNAME_SIZE); ++ if( sqlite_temp_directory!=0 ){ ++ zDir = sqlite_temp_directory; ++ }else if( FindFolder(kOnSystemDisk, kTemporaryFolderType, kCreateFolder, ++ &(infoRec.dirInfo.ioVRefNum), &(infoRec.dirInfo.ioDrParID)) == noErr ){ ++ infoRec.dirInfo.ioNamePtr = dirName; ++ do{ ++ infoRec.dirInfo.ioFDirIndex = -1; ++ infoRec.dirInfo.ioDrDirID = infoRec.dirInfo.ioDrParID; ++ if( PBGetCatInfoSync(&infoRec) == noErr ){ ++ CopyPascalStringToC(dirName, zdirName); ++ i = strlen(zdirName); ++ memmove(&(zTempPath[i+1]), zTempPath, strlen(zTempPath)); ++ strcpy(zTempPath, zdirName); ++ zTempPath[i] = ':'; ++ }else{ ++ *zTempPath = 0; ++ break; ++ } ++ } while( infoRec.dirInfo.ioDrDirID != fsRtDirID ); ++ zDir = zTempPath; ++ } ++ if( zDir[0]==0 ){ ++ getcwd(zTempPath, SQLITE_TEMPNAME_SIZE-24); ++ zDir = zTempPath; ++ } ++ for(;;){ ++ sprintf(zBuf, "%s"TEMP_FILE_PREFIX, zDir); ++ j = strlen(zBuf); ++ sqliteRandomness(15, &zBuf[j]); ++ for(i=0; i<15; i++, j++){ ++ zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ]; ++ } ++ zBuf[j] = 0; ++ if( !sqliteOsFileExists(zBuf) ) break; ++ } ++#endif ++ return SQLITE_OK; ++} ++ ++/* ++** Close a file. ++*/ ++int sqliteOsClose(OsFile *id){ ++#if OS_UNIX ++ sqliteOsUnlock(id); ++ if( id->dirfd>=0 ) close(id->dirfd); ++ id->dirfd = -1; ++ sqliteOsEnterMutex(); ++ if( id->pOpen->nLock ){ ++ /* If there are outstanding locks, do not actually close the file just ++ ** yet because that would clear those locks. Instead, add the file ++ ** descriptor to pOpen->aPending. It will be automatically closed when ++ ** the last lock is cleared. ++ */ ++ int *aNew; ++ struct openCnt *pOpen = id->pOpen; ++ pOpen->nPending++; ++ aNew = sqliteRealloc( pOpen->aPending, pOpen->nPending*sizeof(int) ); ++ if( aNew==0 ){ ++ /* If a malloc fails, just leak the file descriptor */ ++ }else{ ++ pOpen->aPending = aNew; ++ pOpen->aPending[pOpen->nPending-1] = id->fd; ++ } ++ }else{ ++ /* There are no outstanding locks so we can close the file immediately */ ++ close(id->fd); ++ } ++ releaseLockInfo(id->pLock); ++ releaseOpenCnt(id->pOpen); ++ sqliteOsLeaveMutex(); ++ TRACE2("CLOSE %-3d\n", id->fd); ++ OpenCounter(-1); ++ return SQLITE_OK; ++#endif ++#if OS_WIN ++ CloseHandle(id->h); ++ OpenCounter(-1); ++ return SQLITE_OK; ++#endif ++#if OS_MAC ++ if( id->refNumRF!=-1 ) ++ FSClose(id->refNumRF); ++# ifdef _LARGE_FILE ++ FSCloseFork(id->refNum); ++# else ++ FSClose(id->refNum); ++# endif ++ if( id->delOnClose ){ ++ unlink(id->pathToDel); ++ sqliteFree(id->pathToDel); ++ } ++ OpenCounter(-1); ++ return SQLITE_OK; ++#endif ++} ++ ++/* ++** Read data from a file into a buffer. Return SQLITE_OK if all ++** bytes were read successfully and SQLITE_IOERR if anything goes ++** wrong. ++*/ ++int sqliteOsRead(OsFile *id, void *pBuf, int amt){ ++#if OS_UNIX ++ int got; ++ SimulateIOError(SQLITE_IOERR); ++ TIMER_START; ++ got = read(id->fd, pBuf, amt); ++ TIMER_END; ++ TRACE4("READ %-3d %7d %d\n", id->fd, last_page, elapse); ++ SEEK(0); ++ /* if( got<0 ) got = 0; */ ++ if( got==amt ){ ++ return SQLITE_OK; ++ }else{ ++ return SQLITE_IOERR; ++ } ++#endif ++#if OS_WIN ++ DWORD got; ++ SimulateIOError(SQLITE_IOERR); ++ TRACE2("READ %d\n", last_page); ++ if( !ReadFile(id->h, pBuf, amt, &got, 0) ){ ++ got = 0; ++ } ++ if( got==(DWORD)amt ){ ++ return SQLITE_OK; ++ }else{ ++ return SQLITE_IOERR; ++ } ++#endif ++#if OS_MAC ++ int got; ++ SimulateIOError(SQLITE_IOERR); ++ TRACE2("READ %d\n", last_page); ++# ifdef _LARGE_FILE ++ FSReadFork(id->refNum, fsAtMark, 0, (ByteCount)amt, pBuf, (ByteCount*)&got); ++# else ++ got = amt; ++ FSRead(id->refNum, &got, pBuf); ++# endif ++ if( got==amt ){ ++ return SQLITE_OK; ++ }else{ ++ return SQLITE_IOERR; ++ } ++#endif ++} ++ ++/* ++** Write data from a buffer into a file. Return SQLITE_OK on success ++** or some other error code on failure. ++*/ ++int sqliteOsWrite(OsFile *id, const void *pBuf, int amt){ ++#if OS_UNIX ++ int wrote = 0; ++ SimulateIOError(SQLITE_IOERR); ++ TIMER_START; ++ while( amt>0 && (wrote = write(id->fd, pBuf, amt))>0 ){ ++ amt -= wrote; ++ pBuf = &((char*)pBuf)[wrote]; ++ } ++ TIMER_END; ++ TRACE4("WRITE %-3d %7d %d\n", id->fd, last_page, elapse); ++ SEEK(0); ++ if( amt>0 ){ ++ return SQLITE_FULL; ++ } ++ return SQLITE_OK; ++#endif ++#if OS_WIN ++ int rc; ++ DWORD wrote; ++ SimulateIOError(SQLITE_IOERR); ++ TRACE2("WRITE %d\n", last_page); ++ while( amt>0 && (rc = WriteFile(id->h, pBuf, amt, &wrote, 0))!=0 && wrote>0 ){ ++ amt -= wrote; ++ pBuf = &((char*)pBuf)[wrote]; ++ } ++ if( !rc || amt>(int)wrote ){ ++ return SQLITE_FULL; ++ } ++ return SQLITE_OK; ++#endif ++#if OS_MAC ++ OSErr oserr; ++ int wrote = 0; ++ SimulateIOError(SQLITE_IOERR); ++ TRACE2("WRITE %d\n", last_page); ++ while( amt>0 ){ ++# ifdef _LARGE_FILE ++ oserr = FSWriteFork(id->refNum, fsAtMark, 0, ++ (ByteCount)amt, pBuf, (ByteCount*)&wrote); ++# else ++ wrote = amt; ++ oserr = FSWrite(id->refNum, &wrote, pBuf); ++# endif ++ if( wrote == 0 || oserr != noErr) ++ break; ++ amt -= wrote; ++ pBuf = &((char*)pBuf)[wrote]; ++ } ++ if( oserr != noErr || amt>wrote ){ ++ return SQLITE_FULL; ++ } ++ return SQLITE_OK; ++#endif ++} ++ ++/* ++** Move the read/write pointer in a file. ++*/ ++int sqliteOsSeek(OsFile *id, off_t offset){ ++ SEEK(offset/1024 + 1); ++#if OS_UNIX ++ lseek(id->fd, offset, SEEK_SET); ++ return SQLITE_OK; ++#endif ++#if OS_WIN ++ { ++ LONG upperBits = offset>>32; ++ LONG lowerBits = offset & 0xffffffff; ++ DWORD rc; ++ rc = SetFilePointer(id->h, lowerBits, &upperBits, FILE_BEGIN); ++ /* TRACE3("SEEK rc=0x%x upper=0x%x\n", rc, upperBits); */ ++ } ++ return SQLITE_OK; ++#endif ++#if OS_MAC ++ { ++ off_t curSize; ++ if( sqliteOsFileSize(id, &curSize) != SQLITE_OK ){ ++ return SQLITE_IOERR; ++ } ++ if( offset >= curSize ){ ++ if( sqliteOsTruncate(id, offset+1) != SQLITE_OK ){ ++ return SQLITE_IOERR; ++ } ++ } ++# ifdef _LARGE_FILE ++ if( FSSetForkPosition(id->refNum, fsFromStart, offset) != noErr ){ ++# else ++ if( SetFPos(id->refNum, fsFromStart, offset) != noErr ){ ++# endif ++ return SQLITE_IOERR; ++ }else{ ++ return SQLITE_OK; ++ } ++ } ++#endif ++} ++ ++#ifdef SQLITE_NOSYNC ++# define fsync(X) 0 ++#endif ++ ++/* ++** Make sure all writes to a particular file are committed to disk. ++** ++** Under Unix, also make sure that the directory entry for the file ++** has been created by fsync-ing the directory that contains the file. ++** If we do not do this and we encounter a power failure, the directory ++** entry for the journal might not exist after we reboot. The next ++** SQLite to access the file will not know that the journal exists (because ++** the directory entry for the journal was never created) and the transaction ++** will not roll back - possibly leading to database corruption. ++*/ ++int sqliteOsSync(OsFile *id){ ++#if OS_UNIX ++ SimulateIOError(SQLITE_IOERR); ++ TRACE2("SYNC %-3d\n", id->fd); ++ if( fsync(id->fd) ){ ++ return SQLITE_IOERR; ++ }else{ ++ if( id->dirfd>=0 ){ ++ TRACE2("DIRSYNC %-3d\n", id->dirfd); ++ fsync(id->dirfd); ++ close(id->dirfd); /* Only need to sync once, so close the directory */ ++ id->dirfd = -1; /* when we are done. */ ++ } ++ return SQLITE_OK; ++ } ++#endif ++#if OS_WIN ++ if( FlushFileBuffers(id->h) ){ ++ return SQLITE_OK; ++ }else{ ++ return SQLITE_IOERR; ++ } ++#endif ++#if OS_MAC ++# ifdef _LARGE_FILE ++ if( FSFlushFork(id->refNum) != noErr ){ ++# else ++ ParamBlockRec params; ++ memset(¶ms, 0, sizeof(ParamBlockRec)); ++ params.ioParam.ioRefNum = id->refNum; ++ if( PBFlushFileSync(¶ms) != noErr ){ ++# endif ++ return SQLITE_IOERR; ++ }else{ ++ return SQLITE_OK; ++ } ++#endif ++} ++ ++/* ++** Truncate an open file to a specified size ++*/ ++int sqliteOsTruncate(OsFile *id, off_t nByte){ ++ SimulateIOError(SQLITE_IOERR); ++#if OS_UNIX ++ return ftruncate(id->fd, nByte)==0 ? SQLITE_OK : SQLITE_IOERR; ++#endif ++#if OS_WIN ++ { ++ LONG upperBits = nByte>>32; ++ SetFilePointer(id->h, nByte, &upperBits, FILE_BEGIN); ++ SetEndOfFile(id->h); ++ } ++ return SQLITE_OK; ++#endif ++#if OS_MAC ++# ifdef _LARGE_FILE ++ if( FSSetForkSize(id->refNum, fsFromStart, nByte) != noErr){ ++# else ++ if( SetEOF(id->refNum, nByte) != noErr ){ ++# endif ++ return SQLITE_IOERR; ++ }else{ ++ return SQLITE_OK; ++ } ++#endif ++} ++ ++/* ++** Determine the current size of a file in bytes ++*/ ++int sqliteOsFileSize(OsFile *id, off_t *pSize){ ++#if OS_UNIX ++ struct stat buf; ++ SimulateIOError(SQLITE_IOERR); ++ if( fstat(id->fd, &buf)!=0 ){ ++ return SQLITE_IOERR; ++ } ++ *pSize = buf.st_size; ++ return SQLITE_OK; ++#endif ++#if OS_WIN ++ DWORD upperBits, lowerBits; ++ SimulateIOError(SQLITE_IOERR); ++ lowerBits = GetFileSize(id->h, &upperBits); ++ *pSize = (((off_t)upperBits)<<32) + lowerBits; ++ return SQLITE_OK; ++#endif ++#if OS_MAC ++# ifdef _LARGE_FILE ++ if( FSGetForkSize(id->refNum, pSize) != noErr){ ++# else ++ if( GetEOF(id->refNum, pSize) != noErr ){ ++# endif ++ return SQLITE_IOERR; ++ }else{ ++ return SQLITE_OK; ++ } ++#endif ++} ++ ++#if OS_WIN ++/* ++** Return true (non-zero) if we are running under WinNT, Win2K or WinXP. ++** Return false (zero) for Win95, Win98, or WinME. ++** ++** Here is an interesting observation: Win95, Win98, and WinME lack ++** the LockFileEx() API. But we can still statically link against that ++** API as long as we don't call it win running Win95/98/ME. A call to ++** this routine is used to determine if the host is Win95/98/ME or ++** WinNT/2K/XP so that we will know whether or not we can safely call ++** the LockFileEx() API. ++*/ ++int isNT(void){ ++ static int osType = 0; /* 0=unknown 1=win95 2=winNT */ ++ if( osType==0 ){ ++ OSVERSIONINFO sInfo; ++ sInfo.dwOSVersionInfoSize = sizeof(sInfo); ++ GetVersionEx(&sInfo); ++ osType = sInfo.dwPlatformId==VER_PLATFORM_WIN32_NT ? 2 : 1; ++ } ++ return osType==2; ++} ++#endif ++ ++/* ++** Windows file locking notes: [similar issues apply to MacOS] ++** ++** We cannot use LockFileEx() or UnlockFileEx() on Win95/98/ME because ++** those functions are not available. So we use only LockFile() and ++** UnlockFile(). ++** ++** LockFile() prevents not just writing but also reading by other processes. ++** (This is a design error on the part of Windows, but there is nothing ++** we can do about that.) So the region used for locking is at the ++** end of the file where it is unlikely to ever interfere with an ++** actual read attempt. ++** ++** A database read lock is obtained by locking a single randomly-chosen ++** byte out of a specific range of bytes. The lock byte is obtained at ++** random so two separate readers can probably access the file at the ++** same time, unless they are unlucky and choose the same lock byte. ++** A database write lock is obtained by locking all bytes in the range. ++** There can only be one writer. ++** ++** A lock is obtained on the first byte of the lock range before acquiring ++** either a read lock or a write lock. This prevents two processes from ++** attempting to get a lock at a same time. The semantics of ++** sqliteOsReadLock() require that if there is already a write lock, that ++** lock is converted into a read lock atomically. The lock on the first ++** byte allows us to drop the old write lock and get the read lock without ++** another process jumping into the middle and messing us up. The same ++** argument applies to sqliteOsWriteLock(). ++** ++** On WinNT/2K/XP systems, LockFileEx() and UnlockFileEx() are available, ++** which means we can use reader/writer locks. When reader writer locks ++** are used, the lock is placed on the same range of bytes that is used ++** for probabilistic locking in Win95/98/ME. Hence, the locking scheme ++** will support two or more Win95 readers or two or more WinNT readers. ++** But a single Win95 reader will lock out all WinNT readers and a single ++** WinNT reader will lock out all other Win95 readers. ++** ++** Note: On MacOS we use the resource fork for locking. ++** ++** The following #defines specify the range of bytes used for locking. ++** N_LOCKBYTE is the number of bytes available for doing the locking. ++** The first byte used to hold the lock while the lock is changing does ++** not count toward this number. FIRST_LOCKBYTE is the address of ++** the first byte in the range of bytes used for locking. ++*/ ++#define N_LOCKBYTE 10239 ++#if OS_MAC ++# define FIRST_LOCKBYTE (0x000fffff - N_LOCKBYTE) ++#else ++# define FIRST_LOCKBYTE (0xffffffff - N_LOCKBYTE) ++#endif ++ ++/* ++** Change the status of the lock on the file "id" to be a readlock. ++** If the file was write locked, then this reduces the lock to a read. ++** If the file was read locked, then this acquires a new read lock. ++** ++** Return SQLITE_OK on success and SQLITE_BUSY on failure. If this ++** library was compiled with large file support (LFS) but LFS is not ++** available on the host, then an SQLITE_NOLFS is returned. ++*/ ++int sqliteOsReadLock(OsFile *id){ ++#if OS_UNIX ++ int rc; ++ sqliteOsEnterMutex(); ++ if( id->pLock->cnt>0 ){ ++ if( !id->locked ){ ++ id->pLock->cnt++; ++ id->locked = 1; ++ id->pOpen->nLock++; ++ } ++ rc = SQLITE_OK; ++ }else if( id->locked || id->pLock->cnt==0 ){ ++ struct flock lock; ++ int s; ++ lock.l_type = F_RDLCK; ++ lock.l_whence = SEEK_SET; ++ lock.l_start = lock.l_len = 0L; ++ s = fcntl(id->fd, F_SETLK, &lock); ++ if( s!=0 ){ ++ rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY; ++ }else{ ++ rc = SQLITE_OK; ++ if( !id->locked ){ ++ id->pOpen->nLock++; ++ id->locked = 1; ++ } ++ id->pLock->cnt = 1; ++ } ++ }else{ ++ rc = SQLITE_BUSY; ++ } ++ sqliteOsLeaveMutex(); ++ return rc; ++#endif ++#if OS_WIN ++ int rc; ++ if( id->locked>0 ){ ++ rc = SQLITE_OK; ++ }else{ ++ int lk; ++ int res; ++ int cnt = 100; ++ sqliteRandomness(sizeof(lk), &lk); ++ lk = (lk & 0x7fffffff)%N_LOCKBYTE + 1; ++ while( cnt-->0 && (res = LockFile(id->h, FIRST_LOCKBYTE, 0, 1, 0))==0 ){ ++ Sleep(1); ++ } ++ if( res ){ ++ UnlockFile(id->h, FIRST_LOCKBYTE+1, 0, N_LOCKBYTE, 0); ++ if( isNT() ){ ++ OVERLAPPED ovlp; ++ ovlp.Offset = FIRST_LOCKBYTE+1; ++ ovlp.OffsetHigh = 0; ++ ovlp.hEvent = 0; ++ res = LockFileEx(id->h, LOCKFILE_FAIL_IMMEDIATELY, ++ 0, N_LOCKBYTE, 0, &ovlp); ++ }else{ ++ res = LockFile(id->h, FIRST_LOCKBYTE+lk, 0, 1, 0); ++ } ++ UnlockFile(id->h, FIRST_LOCKBYTE, 0, 1, 0); ++ } ++ if( res ){ ++ id->locked = lk; ++ rc = SQLITE_OK; ++ }else{ ++ rc = SQLITE_BUSY; ++ } ++ } ++ return rc; ++#endif ++#if OS_MAC ++ int rc; ++ if( id->locked>0 || id->refNumRF == -1 ){ ++ rc = SQLITE_OK; ++ }else{ ++ int lk; ++ OSErr res; ++ int cnt = 5; ++ ParamBlockRec params; ++ sqliteRandomness(sizeof(lk), &lk); ++ lk = (lk & 0x7fffffff)%N_LOCKBYTE + 1; ++ memset(¶ms, 0, sizeof(params)); ++ params.ioParam.ioRefNum = id->refNumRF; ++ params.ioParam.ioPosMode = fsFromStart; ++ params.ioParam.ioPosOffset = FIRST_LOCKBYTE; ++ params.ioParam.ioReqCount = 1; ++ while( cnt-->0 && (res = PBLockRangeSync(¶ms))!=noErr ){ ++ UInt32 finalTicks; ++ Delay(1, &finalTicks); /* 1/60 sec */ ++ } ++ if( res == noErr ){ ++ params.ioParam.ioPosOffset = FIRST_LOCKBYTE+1; ++ params.ioParam.ioReqCount = N_LOCKBYTE; ++ PBUnlockRangeSync(¶ms); ++ params.ioParam.ioPosOffset = FIRST_LOCKBYTE+lk; ++ params.ioParam.ioReqCount = 1; ++ res = PBLockRangeSync(¶ms); ++ params.ioParam.ioPosOffset = FIRST_LOCKBYTE; ++ params.ioParam.ioReqCount = 1; ++ PBUnlockRangeSync(¶ms); ++ } ++ if( res == noErr ){ ++ id->locked = lk; ++ rc = SQLITE_OK; ++ }else{ ++ rc = SQLITE_BUSY; ++ } ++ } ++ return rc; ++#endif ++} ++ ++/* ++** Change the lock status to be an exclusive or write lock. Return ++** SQLITE_OK on success and SQLITE_BUSY on a failure. If this ++** library was compiled with large file support (LFS) but LFS is not ++** available on the host, then an SQLITE_NOLFS is returned. ++*/ ++int sqliteOsWriteLock(OsFile *id){ ++#if OS_UNIX ++ int rc; ++ sqliteOsEnterMutex(); ++ if( id->pLock->cnt==0 || (id->pLock->cnt==1 && id->locked==1) ){ ++ struct flock lock; ++ int s; ++ lock.l_type = F_WRLCK; ++ lock.l_whence = SEEK_SET; ++ lock.l_start = lock.l_len = 0L; ++ s = fcntl(id->fd, F_SETLK, &lock); ++ if( s!=0 ){ ++ rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY; ++ }else{ ++ rc = SQLITE_OK; ++ if( !id->locked ){ ++ id->pOpen->nLock++; ++ id->locked = 1; ++ } ++ id->pLock->cnt = -1; ++ } ++ }else{ ++ rc = SQLITE_BUSY; ++ } ++ sqliteOsLeaveMutex(); ++ return rc; ++#endif ++#if OS_WIN ++ int rc; ++ if( id->locked<0 ){ ++ rc = SQLITE_OK; ++ }else{ ++ int res; ++ int cnt = 100; ++ while( cnt-->0 && (res = LockFile(id->h, FIRST_LOCKBYTE, 0, 1, 0))==0 ){ ++ Sleep(1); ++ } ++ if( res ){ ++ if( id->locked>0 ){ ++ if( isNT() ){ ++ UnlockFile(id->h, FIRST_LOCKBYTE+1, 0, N_LOCKBYTE, 0); ++ }else{ ++ res = UnlockFile(id->h, FIRST_LOCKBYTE + id->locked, 0, 1, 0); ++ } ++ } ++ if( res ){ ++ res = LockFile(id->h, FIRST_LOCKBYTE+1, 0, N_LOCKBYTE, 0); ++ }else{ ++ res = 0; ++ } ++ UnlockFile(id->h, FIRST_LOCKBYTE, 0, 1, 0); ++ } ++ if( res ){ ++ id->locked = -1; ++ rc = SQLITE_OK; ++ }else{ ++ rc = SQLITE_BUSY; ++ } ++ } ++ return rc; ++#endif ++#if OS_MAC ++ int rc; ++ if( id->locked<0 || id->refNumRF == -1 ){ ++ rc = SQLITE_OK; ++ }else{ ++ OSErr res; ++ int cnt = 5; ++ ParamBlockRec params; ++ memset(¶ms, 0, sizeof(params)); ++ params.ioParam.ioRefNum = id->refNumRF; ++ params.ioParam.ioPosMode = fsFromStart; ++ params.ioParam.ioPosOffset = FIRST_LOCKBYTE; ++ params.ioParam.ioReqCount = 1; ++ while( cnt-->0 && (res = PBLockRangeSync(¶ms))!=noErr ){ ++ UInt32 finalTicks; ++ Delay(1, &finalTicks); /* 1/60 sec */ ++ } ++ if( res == noErr ){ ++ params.ioParam.ioPosOffset = FIRST_LOCKBYTE + id->locked; ++ params.ioParam.ioReqCount = 1; ++ if( id->locked==0 ++ || PBUnlockRangeSync(¶ms)==noErr ){ ++ params.ioParam.ioPosOffset = FIRST_LOCKBYTE+1; ++ params.ioParam.ioReqCount = N_LOCKBYTE; ++ res = PBLockRangeSync(¶ms); ++ }else{ ++ res = afpRangeNotLocked; ++ } ++ params.ioParam.ioPosOffset = FIRST_LOCKBYTE; ++ params.ioParam.ioReqCount = 1; ++ PBUnlockRangeSync(¶ms); ++ } ++ if( res == noErr ){ ++ id->locked = -1; ++ rc = SQLITE_OK; ++ }else{ ++ rc = SQLITE_BUSY; ++ } ++ } ++ return rc; ++#endif ++} ++ ++/* ++** Unlock the given file descriptor. If the file descriptor was ++** not previously locked, then this routine is a no-op. If this ++** library was compiled with large file support (LFS) but LFS is not ++** available on the host, then an SQLITE_NOLFS is returned. ++*/ ++int sqliteOsUnlock(OsFile *id){ ++#if OS_UNIX ++ int rc; ++ if( !id->locked ) return SQLITE_OK; ++ sqliteOsEnterMutex(); ++ assert( id->pLock->cnt!=0 ); ++ if( id->pLock->cnt>1 ){ ++ id->pLock->cnt--; ++ rc = SQLITE_OK; ++ }else{ ++ struct flock lock; ++ int s; ++ lock.l_type = F_UNLCK; ++ lock.l_whence = SEEK_SET; ++ lock.l_start = lock.l_len = 0L; ++ s = fcntl(id->fd, F_SETLK, &lock); ++ if( s!=0 ){ ++ rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY; ++ }else{ ++ rc = SQLITE_OK; ++ id->pLock->cnt = 0; ++ } ++ } ++ if( rc==SQLITE_OK ){ ++ /* Decrement the count of locks against this same file. When the ++ ** count reaches zero, close any other file descriptors whose close ++ ** was deferred because of outstanding locks. ++ */ ++ struct openCnt *pOpen = id->pOpen; ++ pOpen->nLock--; ++ assert( pOpen->nLock>=0 ); ++ if( pOpen->nLock==0 && pOpen->nPending>0 ){ ++ int i; ++ for(i=0; inPending; i++){ ++ close(pOpen->aPending[i]); ++ } ++ sqliteFree(pOpen->aPending); ++ pOpen->nPending = 0; ++ pOpen->aPending = 0; ++ } ++ } ++ sqliteOsLeaveMutex(); ++ id->locked = 0; ++ return rc; ++#endif ++#if OS_WIN ++ int rc; ++ if( id->locked==0 ){ ++ rc = SQLITE_OK; ++ }else if( isNT() || id->locked<0 ){ ++ UnlockFile(id->h, FIRST_LOCKBYTE+1, 0, N_LOCKBYTE, 0); ++ rc = SQLITE_OK; ++ id->locked = 0; ++ }else{ ++ UnlockFile(id->h, FIRST_LOCKBYTE+id->locked, 0, 1, 0); ++ rc = SQLITE_OK; ++ id->locked = 0; ++ } ++ return rc; ++#endif ++#if OS_MAC ++ int rc; ++ ParamBlockRec params; ++ memset(¶ms, 0, sizeof(params)); ++ params.ioParam.ioRefNum = id->refNumRF; ++ params.ioParam.ioPosMode = fsFromStart; ++ if( id->locked==0 || id->refNumRF == -1 ){ ++ rc = SQLITE_OK; ++ }else if( id->locked<0 ){ ++ params.ioParam.ioPosOffset = FIRST_LOCKBYTE+1; ++ params.ioParam.ioReqCount = N_LOCKBYTE; ++ PBUnlockRangeSync(¶ms); ++ rc = SQLITE_OK; ++ id->locked = 0; ++ }else{ ++ params.ioParam.ioPosOffset = FIRST_LOCKBYTE+id->locked; ++ params.ioParam.ioReqCount = 1; ++ PBUnlockRangeSync(¶ms); ++ rc = SQLITE_OK; ++ id->locked = 0; ++ } ++ return rc; ++#endif ++} ++ ++/* ++** Get information to seed the random number generator. The seed ++** is written into the buffer zBuf[256]. The calling function must ++** supply a sufficiently large buffer. ++*/ ++int sqliteOsRandomSeed(char *zBuf){ ++ /* We have to initialize zBuf to prevent valgrind from reporting ++ ** errors. The reports issued by valgrind are incorrect - we would ++ ** prefer that the randomness be increased by making use of the ++ ** uninitialized space in zBuf - but valgrind errors tend to worry ++ ** some users. Rather than argue, it seems easier just to initialize ++ ** the whole array and silence valgrind, even if that means less randomness ++ ** in the random seed. ++ ** ++ ** When testing, initializing zBuf[] to zero is all we do. That means ++ ** that we always use the same random number sequence.* This makes the ++ ** tests repeatable. ++ */ ++ memset(zBuf, 0, 256); ++#if OS_UNIX && !defined(SQLITE_TEST) ++ { ++ int pid; ++ time((time_t*)zBuf); ++ pid = getpid(); ++ memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid)); ++ } ++#endif ++#if OS_WIN && !defined(SQLITE_TEST) ++ GetSystemTime((LPSYSTEMTIME)zBuf); ++#endif ++#if OS_MAC ++ { ++ int pid; ++ Microseconds((UnsignedWide*)zBuf); ++ pid = getpid(); ++ memcpy(&zBuf[sizeof(UnsignedWide)], &pid, sizeof(pid)); ++ } ++#endif ++ return SQLITE_OK; ++} ++ ++/* ++** Sleep for a little while. Return the amount of time slept. ++*/ ++int sqliteOsSleep(int ms){ ++#if OS_UNIX ++#if defined(HAVE_USLEEP) && HAVE_USLEEP ++ usleep(ms*1000); ++ return ms; ++#else ++ sleep((ms+999)/1000); ++ return 1000*((ms+999)/1000); ++#endif ++#endif ++#if OS_WIN ++ Sleep(ms); ++ return ms; ++#endif ++#if OS_MAC ++ UInt32 finalTicks; ++ UInt32 ticks = (((UInt32)ms+16)*3)/50; /* 1/60 sec per tick */ ++ Delay(ticks, &finalTicks); ++ return (int)((ticks*50)/3); ++#endif ++} ++ ++/* ++** Static variables used for thread synchronization ++*/ ++static int inMutex = 0; ++#ifdef SQLITE_UNIX_THREADS ++ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; ++#endif ++#ifdef SQLITE_W32_THREADS ++ static CRITICAL_SECTION cs; ++#endif ++#ifdef SQLITE_MACOS_MULTITASKING ++ static MPCriticalRegionID criticalRegion; ++#endif ++ ++/* ++** The following pair of routine implement mutual exclusion for ++** multi-threaded processes. Only a single thread is allowed to ++** executed code that is surrounded by EnterMutex() and LeaveMutex(). ++** ++** SQLite uses only a single Mutex. There is not much critical ++** code and what little there is executes quickly and without blocking. ++*/ ++void sqliteOsEnterMutex(){ ++#ifdef SQLITE_UNIX_THREADS ++ pthread_mutex_lock(&mutex); ++#endif ++#ifdef SQLITE_W32_THREADS ++ static int isInit = 0; ++ while( !isInit ){ ++ static long lock = 0; ++ if( InterlockedIncrement(&lock)==1 ){ ++ InitializeCriticalSection(&cs); ++ isInit = 1; ++ }else{ ++ Sleep(1); ++ } ++ } ++ EnterCriticalSection(&cs); ++#endif ++#ifdef SQLITE_MACOS_MULTITASKING ++ static volatile int notInit = 1; ++ if( notInit ){ ++ if( notInit == 2 ) /* as close as you can get to thread safe init */ ++ MPYield(); ++ else{ ++ notInit = 2; ++ MPCreateCriticalRegion(&criticalRegion); ++ notInit = 0; ++ } ++ } ++ MPEnterCriticalRegion(criticalRegion, kDurationForever); ++#endif ++ assert( !inMutex ); ++ inMutex = 1; ++} ++void sqliteOsLeaveMutex(){ ++ assert( inMutex ); ++ inMutex = 0; ++#ifdef SQLITE_UNIX_THREADS ++ pthread_mutex_unlock(&mutex); ++#endif ++#ifdef SQLITE_W32_THREADS ++ LeaveCriticalSection(&cs); ++#endif ++#ifdef SQLITE_MACOS_MULTITASKING ++ MPExitCriticalRegion(criticalRegion); ++#endif ++} ++ ++/* ++** Turn a relative pathname into a full pathname. Return a pointer ++** to the full pathname stored in space obtained from sqliteMalloc(). ++** The calling function is responsible for freeing this space once it ++** is no longer needed. ++*/ ++char *sqliteOsFullPathname(const char *zRelative){ ++#if OS_UNIX ++ char *zFull = 0; ++ if( zRelative[0]=='/' ){ ++ sqliteSetString(&zFull, zRelative, (char*)0); ++ }else{ ++ char zBuf[5000]; ++ zBuf[0] = 0; ++ sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), "/", zRelative, ++ (char*)0); ++ } ++ return zFull; ++#endif ++#if OS_WIN ++ char *zNotUsed; ++ char *zFull; ++ int nByte; ++ nByte = GetFullPathName(zRelative, 0, 0, &zNotUsed) + 1; ++ zFull = sqliteMalloc( nByte ); ++ if( zFull==0 ) return 0; ++ GetFullPathName(zRelative, nByte, zFull, &zNotUsed); ++ return zFull; ++#endif ++#if OS_MAC ++ char *zFull = 0; ++ if( zRelative[0]==':' ){ ++ char zBuf[_MAX_PATH+1]; ++ sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), &(zRelative[1]), ++ (char*)0); ++ }else{ ++ if( strchr(zRelative, ':') ){ ++ sqliteSetString(&zFull, zRelative, (char*)0); ++ }else{ ++ char zBuf[_MAX_PATH+1]; ++ sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), zRelative, (char*)0); ++ } ++ } ++ return zFull; ++#endif ++} ++ ++/* ++** The following variable, if set to a non-zero value, becomes the result ++** returned from sqliteOsCurrentTime(). This is used for testing. ++*/ ++#ifdef SQLITE_TEST ++int sqlite_current_time = 0; ++#endif ++ ++/* ++** Find the current time (in Universal Coordinated Time). Write the ++** current time and date as a Julian Day number into *prNow and ++** return 0. Return 1 if the time and date cannot be found. ++*/ ++int sqliteOsCurrentTime(double *prNow){ ++#if OS_UNIX ++ time_t t; ++ time(&t); ++ *prNow = t/86400.0 + 2440587.5; ++#endif ++#if OS_WIN ++ FILETIME ft; ++ /* FILETIME structure is a 64-bit value representing the number of ++ 100-nanosecond intervals since January 1, 1601 (= JD 2305813.5). ++ */ ++ double now; ++ GetSystemTimeAsFileTime( &ft ); ++ now = ((double)ft.dwHighDateTime) * 4294967296.0; ++ *prNow = (now + ft.dwLowDateTime)/864000000000.0 + 2305813.5; ++#endif ++#ifdef SQLITE_TEST ++ if( sqlite_current_time ){ ++ *prNow = sqlite_current_time/86400.0 + 2440587.5; ++ } ++#endif ++ return 0; ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/os.h +@@ -0,0 +1,191 @@ ++/* ++** 2001 September 16 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++****************************************************************************** ++** ++** This header file (together with is companion C source-code file ++** "os.c") attempt to abstract the underlying operating system so that ++** the SQLite library will work on both POSIX and windows systems. ++*/ ++#ifndef _SQLITE_OS_H_ ++#define _SQLITE_OS_H_ ++ ++/* ++** Helpful hint: To get this to compile on HP/UX, add -D_INCLUDE_POSIX_SOURCE ++** to the compiler command line. ++*/ ++ ++/* ++** These #defines should enable >2GB file support on Posix if the ++** underlying operating system supports it. If the OS lacks ++** large file support, or if the OS is windows, these should be no-ops. ++** ++** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch ++** on the compiler command line. This is necessary if you are compiling ++** on a recent machine (ex: RedHat 7.2) but you want your code to work ++** on an older machine (ex: RedHat 6.0). If you compile on RedHat 7.2 ++** without this option, LFS is enable. But LFS does not exist in the kernel ++** in RedHat 6.0, so the code won't work. Hence, for maximum binary ++** portability you should omit LFS. ++** ++** Similar is true for MacOS. LFS is only supported on MacOS 9 and later. ++*/ ++#ifndef SQLITE_DISABLE_LFS ++# define _LARGE_FILE 1 ++# ifndef _FILE_OFFSET_BITS ++# define _FILE_OFFSET_BITS 64 ++# endif ++# define _LARGEFILE_SOURCE 1 ++#endif ++ ++/* ++** Temporary files are named starting with this prefix followed by 16 random ++** alphanumeric characters, and no file extension. They are stored in the ++** OS's standard temporary file directory, and are deleted prior to exit. ++** If sqlite is being embedded in another program, you may wish to change the ++** prefix to reflect your program's name, so that if your program exits ++** prematurely, old temporary files can be easily identified. This can be done ++** using -DTEMP_FILE_PREFIX=myprefix_ on the compiler command line. ++*/ ++#ifndef TEMP_FILE_PREFIX ++# define TEMP_FILE_PREFIX "sqlite_" ++#endif ++ ++/* ++** Figure out if we are dealing with Unix, Windows or MacOS. ++** ++** N.B. MacOS means Mac Classic (or Carbon). Treat Darwin (OS X) as Unix. ++** The MacOS build is designed to use CodeWarrior (tested with v8) ++*/ ++#ifndef OS_UNIX ++# ifndef OS_WIN ++# ifndef OS_MAC ++# if defined(__MACOS__) ++# define OS_MAC 1 ++# define OS_WIN 0 ++# define OS_UNIX 0 ++# elif defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__) ++# define OS_MAC 0 ++# define OS_WIN 1 ++# define OS_UNIX 0 ++# else ++# define OS_MAC 0 ++# define OS_WIN 0 ++# define OS_UNIX 1 ++# endif ++# else ++# define OS_WIN 0 ++# define OS_UNIX 0 ++# endif ++# else ++# define OS_MAC 0 ++# define OS_UNIX 0 ++# endif ++#else ++# define OS_MAC 0 ++# ifndef OS_WIN ++# define OS_WIN 0 ++# endif ++#endif ++ ++/* ++** A handle for an open file is stored in an OsFile object. ++*/ ++#if OS_UNIX ++# include ++# include ++# include ++# include ++ typedef struct OsFile OsFile; ++ struct OsFile { ++ struct openCnt *pOpen; /* Info about all open fd's on this inode */ ++ struct lockInfo *pLock; /* Info about locks on this inode */ ++ int fd; /* The file descriptor */ ++ int locked; /* True if this instance holds the lock */ ++ int dirfd; /* File descriptor for the directory */ ++ }; ++# define SQLITE_TEMPNAME_SIZE 200 ++# if defined(HAVE_USLEEP) && HAVE_USLEEP ++# define SQLITE_MIN_SLEEP_MS 1 ++# else ++# define SQLITE_MIN_SLEEP_MS 1000 ++# endif ++#endif ++ ++#if OS_WIN ++#include ++#include ++ typedef struct OsFile OsFile; ++ struct OsFile { ++ HANDLE h; /* Handle for accessing the file */ ++ int locked; /* 0: unlocked, <0: write lock, >0: read lock */ ++ }; ++# if defined(_MSC_VER) || defined(__BORLANDC__) ++ typedef __int64 off_t; ++# else ++# if !defined(_CYGWIN_TYPES_H) ++ typedef long long off_t; ++# if defined(__MINGW32__) ++# define _OFF_T_ ++# endif ++# endif ++# endif ++# define SQLITE_TEMPNAME_SIZE (MAX_PATH+50) ++# define SQLITE_MIN_SLEEP_MS 1 ++#endif ++ ++#if OS_MAC ++# include ++# include ++ typedef struct OsFile OsFile; ++ struct OsFile { ++ SInt16 refNum; /* Data fork/file reference number */ ++ SInt16 refNumRF; /* Resource fork reference number (for locking) */ ++ int locked; /* 0: unlocked, <0: write lock, >0: read lock */ ++ int delOnClose; /* True if file is to be deleted on close */ ++ char *pathToDel; /* Name of file to delete on close */ ++ }; ++# ifdef _LARGE_FILE ++ typedef SInt64 off_t; ++# else ++ typedef SInt32 off_t; ++# endif ++# define SQLITE_TEMPNAME_SIZE _MAX_PATH ++# define SQLITE_MIN_SLEEP_MS 17 ++#endif ++ ++int sqliteOsDelete(const char*); ++int sqliteOsFileExists(const char*); ++int sqliteOsFileRename(const char*, const char*); ++int sqliteOsOpenReadWrite(const char*, OsFile*, int*); ++int sqliteOsOpenExclusive(const char*, OsFile*, int); ++int sqliteOsOpenReadOnly(const char*, OsFile*); ++int sqliteOsOpenDirectory(const char*, OsFile*); ++int sqliteOsTempFileName(char*); ++int sqliteOsClose(OsFile*); ++int sqliteOsRead(OsFile*, void*, int amt); ++int sqliteOsWrite(OsFile*, const void*, int amt); ++int sqliteOsSeek(OsFile*, off_t offset); ++int sqliteOsSync(OsFile*); ++int sqliteOsTruncate(OsFile*, off_t size); ++int sqliteOsFileSize(OsFile*, off_t *pSize); ++int sqliteOsReadLock(OsFile*); ++int sqliteOsWriteLock(OsFile*); ++int sqliteOsUnlock(OsFile*); ++int sqliteOsRandomSeed(char*); ++int sqliteOsSleep(int ms); ++int sqliteOsCurrentTime(double*); ++void sqliteOsEnterMutex(void); ++void sqliteOsLeaveMutex(void); ++char *sqliteOsFullPathname(const char*); ++ ++ ++ ++#endif /* _SQLITE_OS_H_ */ +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/pager.c +@@ -0,0 +1,2220 @@ ++/* ++** 2001 September 15 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This is the implementation of the page cache subsystem or "pager". ++** ++** The pager is used to access a database disk file. It implements ++** atomic commit and rollback through the use of a journal file that ++** is separate from the database file. The pager also implements file ++** locking to prevent two processes from writing the same database ++** file simultaneously, or one process from reading the database while ++** another is writing. ++** ++** @(#) $Id$ ++*/ ++#include "os.h" /* Must be first to enable large file support */ ++#include "sqliteInt.h" ++#include "pager.h" ++#include ++#include ++ ++/* ++** Macros for troubleshooting. Normally turned off ++*/ ++#if 0 ++static Pager *mainPager = 0; ++#define SET_PAGER(X) if( mainPager==0 ) mainPager = (X) ++#define CLR_PAGER(X) if( mainPager==(X) ) mainPager = 0 ++#define TRACE1(X) if( pPager==mainPager ) fprintf(stderr,X) ++#define TRACE2(X,Y) if( pPager==mainPager ) fprintf(stderr,X,Y) ++#define TRACE3(X,Y,Z) if( pPager==mainPager ) fprintf(stderr,X,Y,Z) ++#else ++#define SET_PAGER(X) ++#define CLR_PAGER(X) ++#define TRACE1(X) ++#define TRACE2(X,Y) ++#define TRACE3(X,Y,Z) ++#endif ++ ++ ++/* ++** The page cache as a whole is always in one of the following ++** states: ++** ++** SQLITE_UNLOCK The page cache is not currently reading or ++** writing the database file. There is no ++** data held in memory. This is the initial ++** state. ++** ++** SQLITE_READLOCK The page cache is reading the database. ++** Writing is not permitted. There can be ++** multiple readers accessing the same database ++** file at the same time. ++** ++** SQLITE_WRITELOCK The page cache is writing the database. ++** Access is exclusive. No other processes or ++** threads can be reading or writing while one ++** process is writing. ++** ++** The page cache comes up in SQLITE_UNLOCK. The first time a ++** sqlite_page_get() occurs, the state transitions to SQLITE_READLOCK. ++** After all pages have been released using sqlite_page_unref(), ++** the state transitions back to SQLITE_UNLOCK. The first time ++** that sqlite_page_write() is called, the state transitions to ++** SQLITE_WRITELOCK. (Note that sqlite_page_write() can only be ++** called on an outstanding page which means that the pager must ++** be in SQLITE_READLOCK before it transitions to SQLITE_WRITELOCK.) ++** The sqlite_page_rollback() and sqlite_page_commit() functions ++** transition the state from SQLITE_WRITELOCK back to SQLITE_READLOCK. ++*/ ++#define SQLITE_UNLOCK 0 ++#define SQLITE_READLOCK 1 ++#define SQLITE_WRITELOCK 2 ++ ++ ++/* ++** Each in-memory image of a page begins with the following header. ++** This header is only visible to this pager module. The client ++** code that calls pager sees only the data that follows the header. ++** ++** Client code should call sqlitepager_write() on a page prior to making ++** any modifications to that page. The first time sqlitepager_write() ++** is called, the original page contents are written into the rollback ++** journal and PgHdr.inJournal and PgHdr.needSync are set. Later, once ++** the journal page has made it onto the disk surface, PgHdr.needSync ++** is cleared. The modified page cannot be written back into the original ++** database file until the journal pages has been synced to disk and the ++** PgHdr.needSync has been cleared. ++** ++** The PgHdr.dirty flag is set when sqlitepager_write() is called and ++** is cleared again when the page content is written back to the original ++** database file. ++*/ ++typedef struct PgHdr PgHdr; ++struct PgHdr { ++ Pager *pPager; /* The pager to which this page belongs */ ++ Pgno pgno; /* The page number for this page */ ++ PgHdr *pNextHash, *pPrevHash; /* Hash collision chain for PgHdr.pgno */ ++ int nRef; /* Number of users of this page */ ++ PgHdr *pNextFree, *pPrevFree; /* Freelist of pages where nRef==0 */ ++ PgHdr *pNextAll, *pPrevAll; /* A list of all pages */ ++ PgHdr *pNextCkpt, *pPrevCkpt; /* List of pages in the checkpoint journal */ ++ u8 inJournal; /* TRUE if has been written to journal */ ++ u8 inCkpt; /* TRUE if written to the checkpoint journal */ ++ u8 dirty; /* TRUE if we need to write back changes */ ++ u8 needSync; /* Sync journal before writing this page */ ++ u8 alwaysRollback; /* Disable dont_rollback() for this page */ ++ PgHdr *pDirty; /* Dirty pages sorted by PgHdr.pgno */ ++ /* SQLITE_PAGE_SIZE bytes of page data follow this header */ ++ /* Pager.nExtra bytes of local data follow the page data */ ++}; ++ ++ ++/* ++** A macro used for invoking the codec if there is one ++*/ ++#ifdef SQLITE_HAS_CODEC ++# define CODEC(P,D,N,X) if( P->xCodec ){ P->xCodec(P->pCodecArg,D,N,X); } ++#else ++# define CODEC(P,D,N,X) ++#endif ++ ++/* ++** Convert a pointer to a PgHdr into a pointer to its data ++** and back again. ++*/ ++#define PGHDR_TO_DATA(P) ((void*)(&(P)[1])) ++#define DATA_TO_PGHDR(D) (&((PgHdr*)(D))[-1]) ++#define PGHDR_TO_EXTRA(P) ((void*)&((char*)(&(P)[1]))[SQLITE_PAGE_SIZE]) ++ ++/* ++** How big to make the hash table used for locating in-memory pages ++** by page number. ++*/ ++#define N_PG_HASH 2048 ++ ++/* ++** Hash a page number ++*/ ++#define pager_hash(PN) ((PN)&(N_PG_HASH-1)) ++ ++/* ++** A open page cache is an instance of the following structure. ++*/ ++struct Pager { ++ char *zFilename; /* Name of the database file */ ++ char *zJournal; /* Name of the journal file */ ++ char *zDirectory; /* Directory hold database and journal files */ ++ OsFile fd, jfd; /* File descriptors for database and journal */ ++ OsFile cpfd; /* File descriptor for the checkpoint journal */ ++ int dbSize; /* Number of pages in the file */ ++ int origDbSize; /* dbSize before the current change */ ++ int ckptSize; /* Size of database (in pages) at ckpt_begin() */ ++ off_t ckptJSize; /* Size of journal at ckpt_begin() */ ++ int nRec; /* Number of pages written to the journal */ ++ u32 cksumInit; /* Quasi-random value added to every checksum */ ++ int ckptNRec; /* Number of records in the checkpoint journal */ ++ int nExtra; /* Add this many bytes to each in-memory page */ ++ void (*xDestructor)(void*); /* Call this routine when freeing pages */ ++ int nPage; /* Total number of in-memory pages */ ++ int nRef; /* Number of in-memory pages with PgHdr.nRef>0 */ ++ int mxPage; /* Maximum number of pages to hold in cache */ ++ int nHit, nMiss, nOvfl; /* Cache hits, missing, and LRU overflows */ ++ void (*xCodec)(void*,void*,Pgno,int); /* Routine for en/decoding data */ ++ void *pCodecArg; /* First argument to xCodec() */ ++ u8 journalOpen; /* True if journal file descriptors is valid */ ++ u8 journalStarted; /* True if header of journal is synced */ ++ u8 useJournal; /* Use a rollback journal on this file */ ++ u8 ckptOpen; /* True if the checkpoint journal is open */ ++ u8 ckptInUse; /* True we are in a checkpoint */ ++ u8 ckptAutoopen; /* Open ckpt journal when main journal is opened*/ ++ u8 noSync; /* Do not sync the journal if true */ ++ u8 fullSync; /* Do extra syncs of the journal for robustness */ ++ u8 state; /* SQLITE_UNLOCK, _READLOCK or _WRITELOCK */ ++ u8 errMask; /* One of several kinds of errors */ ++ u8 tempFile; /* zFilename is a temporary file */ ++ u8 readOnly; /* True for a read-only database */ ++ u8 needSync; /* True if an fsync() is needed on the journal */ ++ u8 dirtyFile; /* True if database file has changed in any way */ ++ u8 alwaysRollback; /* Disable dont_rollback() for all pages */ ++ u8 *aInJournal; /* One bit for each page in the database file */ ++ u8 *aInCkpt; /* One bit for each page in the database */ ++ PgHdr *pFirst, *pLast; /* List of free pages */ ++ PgHdr *pFirstSynced; /* First free page with PgHdr.needSync==0 */ ++ PgHdr *pAll; /* List of all pages */ ++ PgHdr *pCkpt; /* List of pages in the checkpoint journal */ ++ PgHdr *aHash[N_PG_HASH]; /* Hash table to map page number of PgHdr */ ++}; ++ ++/* ++** These are bits that can be set in Pager.errMask. ++*/ ++#define PAGER_ERR_FULL 0x01 /* a write() failed */ ++#define PAGER_ERR_MEM 0x02 /* malloc() failed */ ++#define PAGER_ERR_LOCK 0x04 /* error in the locking protocol */ ++#define PAGER_ERR_CORRUPT 0x08 /* database or journal corruption */ ++#define PAGER_ERR_DISK 0x10 /* general disk I/O error - bad hard drive? */ ++ ++/* ++** The journal file contains page records in the following ++** format. ++** ++** Actually, this structure is the complete page record for pager ++** formats less than 3. Beginning with format 3, this record is surrounded ++** by two checksums. ++*/ ++typedef struct PageRecord PageRecord; ++struct PageRecord { ++ Pgno pgno; /* The page number */ ++ char aData[SQLITE_PAGE_SIZE]; /* Original data for page pgno */ ++}; ++ ++/* ++** Journal files begin with the following magic string. The data ++** was obtained from /dev/random. It is used only as a sanity check. ++** ++** There are three journal formats (so far). The 1st journal format writes ++** 32-bit integers in the byte-order of the host machine. New ++** formats writes integers as big-endian. All new journals use the ++** new format, but we have to be able to read an older journal in order ++** to rollback journals created by older versions of the library. ++** ++** The 3rd journal format (added for 2.8.0) adds additional sanity ++** checking information to the journal. If the power fails while the ++** journal is being written, semi-random garbage data might appear in ++** the journal file after power is restored. If an attempt is then made ++** to roll the journal back, the database could be corrupted. The additional ++** sanity checking data is an attempt to discover the garbage in the ++** journal and ignore it. ++** ++** The sanity checking information for the 3rd journal format consists ++** of a 32-bit checksum on each page of data. The checksum covers both ++** the page number and the SQLITE_PAGE_SIZE bytes of data for the page. ++** This cksum is initialized to a 32-bit random value that appears in the ++** journal file right after the header. The random initializer is important, ++** because garbage data that appears at the end of a journal is likely ++** data that was once in other files that have now been deleted. If the ++** garbage data came from an obsolete journal file, the checksums might ++** be correct. But by initializing the checksum to random value which ++** is different for every journal, we minimize that risk. ++*/ ++static const unsigned char aJournalMagic1[] = { ++ 0xd9, 0xd5, 0x05, 0xf9, 0x20, 0xa1, 0x63, 0xd4, ++}; ++static const unsigned char aJournalMagic2[] = { ++ 0xd9, 0xd5, 0x05, 0xf9, 0x20, 0xa1, 0x63, 0xd5, ++}; ++static const unsigned char aJournalMagic3[] = { ++ 0xd9, 0xd5, 0x05, 0xf9, 0x20, 0xa1, 0x63, 0xd6, ++}; ++#define JOURNAL_FORMAT_1 1 ++#define JOURNAL_FORMAT_2 2 ++#define JOURNAL_FORMAT_3 3 ++ ++/* ++** The following integer determines what format to use when creating ++** new primary journal files. By default we always use format 3. ++** When testing, we can set this value to older journal formats in order to ++** make sure that newer versions of the library are able to rollback older ++** journal files. ++** ++** Note that checkpoint journals always use format 2 and omit the header. ++*/ ++#ifdef SQLITE_TEST ++int journal_format = 3; ++#else ++# define journal_format 3 ++#endif ++ ++/* ++** The size of the header and of each page in the journal varies according ++** to which journal format is being used. The following macros figure out ++** the sizes based on format numbers. ++*/ ++#define JOURNAL_HDR_SZ(X) \ ++ (sizeof(aJournalMagic1) + sizeof(Pgno) + ((X)>=3)*2*sizeof(u32)) ++#define JOURNAL_PG_SZ(X) \ ++ (SQLITE_PAGE_SIZE + sizeof(Pgno) + ((X)>=3)*sizeof(u32)) ++ ++/* ++** Enable reference count tracking here: ++*/ ++#ifdef SQLITE_TEST ++ int pager_refinfo_enable = 0; ++ static void pager_refinfo(PgHdr *p){ ++ static int cnt = 0; ++ if( !pager_refinfo_enable ) return; ++ printf( ++ "REFCNT: %4d addr=0x%08x nRef=%d\n", ++ p->pgno, (int)PGHDR_TO_DATA(p), p->nRef ++ ); ++ cnt++; /* Something to set a breakpoint on */ ++ } ++# define REFINFO(X) pager_refinfo(X) ++#else ++# define REFINFO(X) ++#endif ++ ++/* ++** Read a 32-bit integer from the given file descriptor. Store the integer ++** that is read in *pRes. Return SQLITE_OK if everything worked, or an ++** error code is something goes wrong. ++** ++** If the journal format is 2 or 3, read a big-endian integer. If the ++** journal format is 1, read an integer in the native byte-order of the ++** host machine. ++*/ ++static int read32bits(int format, OsFile *fd, u32 *pRes){ ++ u32 res; ++ int rc; ++ rc = sqliteOsRead(fd, &res, sizeof(res)); ++ if( rc==SQLITE_OK && format>JOURNAL_FORMAT_1 ){ ++ unsigned char ac[4]; ++ memcpy(ac, &res, 4); ++ res = (ac[0]<<24) | (ac[1]<<16) | (ac[2]<<8) | ac[3]; ++ } ++ *pRes = res; ++ return rc; ++} ++ ++/* ++** Write a 32-bit integer into the given file descriptor. Return SQLITE_OK ++** on success or an error code is something goes wrong. ++** ++** If the journal format is 2 or 3, write the integer as 4 big-endian ++** bytes. If the journal format is 1, write the integer in the native ++** byte order. In normal operation, only formats 2 and 3 are used. ++** Journal format 1 is only used for testing. ++*/ ++static int write32bits(OsFile *fd, u32 val){ ++ unsigned char ac[4]; ++ if( journal_format<=1 ){ ++ return sqliteOsWrite(fd, &val, 4); ++ } ++ ac[0] = (val>>24) & 0xff; ++ ac[1] = (val>>16) & 0xff; ++ ac[2] = (val>>8) & 0xff; ++ ac[3] = val & 0xff; ++ return sqliteOsWrite(fd, ac, 4); ++} ++ ++/* ++** Write a 32-bit integer into a page header right before the ++** page data. This will overwrite the PgHdr.pDirty pointer. ++** ++** The integer is big-endian for formats 2 and 3 and native byte order ++** for journal format 1. ++*/ ++static void store32bits(u32 val, PgHdr *p, int offset){ ++ unsigned char *ac; ++ ac = &((unsigned char*)PGHDR_TO_DATA(p))[offset]; ++ if( journal_format<=1 ){ ++ memcpy(ac, &val, 4); ++ }else{ ++ ac[0] = (val>>24) & 0xff; ++ ac[1] = (val>>16) & 0xff; ++ ac[2] = (val>>8) & 0xff; ++ ac[3] = val & 0xff; ++ } ++} ++ ++ ++/* ++** Convert the bits in the pPager->errMask into an approprate ++** return code. ++*/ ++static int pager_errcode(Pager *pPager){ ++ int rc = SQLITE_OK; ++ if( pPager->errMask & PAGER_ERR_LOCK ) rc = SQLITE_PROTOCOL; ++ if( pPager->errMask & PAGER_ERR_DISK ) rc = SQLITE_IOERR; ++ if( pPager->errMask & PAGER_ERR_FULL ) rc = SQLITE_FULL; ++ if( pPager->errMask & PAGER_ERR_MEM ) rc = SQLITE_NOMEM; ++ if( pPager->errMask & PAGER_ERR_CORRUPT ) rc = SQLITE_CORRUPT; ++ return rc; ++} ++ ++/* ++** Add or remove a page from the list of all pages that are in the ++** checkpoint journal. ++** ++** The Pager keeps a separate list of pages that are currently in ++** the checkpoint journal. This helps the sqlitepager_ckpt_commit() ++** routine run MUCH faster for the common case where there are many ++** pages in memory but only a few are in the checkpoint journal. ++*/ ++static void page_add_to_ckpt_list(PgHdr *pPg){ ++ Pager *pPager = pPg->pPager; ++ if( pPg->inCkpt ) return; ++ assert( pPg->pPrevCkpt==0 && pPg->pNextCkpt==0 ); ++ pPg->pPrevCkpt = 0; ++ if( pPager->pCkpt ){ ++ pPager->pCkpt->pPrevCkpt = pPg; ++ } ++ pPg->pNextCkpt = pPager->pCkpt; ++ pPager->pCkpt = pPg; ++ pPg->inCkpt = 1; ++} ++static void page_remove_from_ckpt_list(PgHdr *pPg){ ++ if( !pPg->inCkpt ) return; ++ if( pPg->pPrevCkpt ){ ++ assert( pPg->pPrevCkpt->pNextCkpt==pPg ); ++ pPg->pPrevCkpt->pNextCkpt = pPg->pNextCkpt; ++ }else{ ++ assert( pPg->pPager->pCkpt==pPg ); ++ pPg->pPager->pCkpt = pPg->pNextCkpt; ++ } ++ if( pPg->pNextCkpt ){ ++ assert( pPg->pNextCkpt->pPrevCkpt==pPg ); ++ pPg->pNextCkpt->pPrevCkpt = pPg->pPrevCkpt; ++ } ++ pPg->pNextCkpt = 0; ++ pPg->pPrevCkpt = 0; ++ pPg->inCkpt = 0; ++} ++ ++/* ++** Find a page in the hash table given its page number. Return ++** a pointer to the page or NULL if not found. ++*/ ++static PgHdr *pager_lookup(Pager *pPager, Pgno pgno){ ++ PgHdr *p = pPager->aHash[pager_hash(pgno)]; ++ while( p && p->pgno!=pgno ){ ++ p = p->pNextHash; ++ } ++ return p; ++} ++ ++/* ++** Unlock the database and clear the in-memory cache. This routine ++** sets the state of the pager back to what it was when it was first ++** opened. Any outstanding pages are invalidated and subsequent attempts ++** to access those pages will likely result in a coredump. ++*/ ++static void pager_reset(Pager *pPager){ ++ PgHdr *pPg, *pNext; ++ for(pPg=pPager->pAll; pPg; pPg=pNext){ ++ pNext = pPg->pNextAll; ++ sqliteFree(pPg); ++ } ++ pPager->pFirst = 0; ++ pPager->pFirstSynced = 0; ++ pPager->pLast = 0; ++ pPager->pAll = 0; ++ memset(pPager->aHash, 0, sizeof(pPager->aHash)); ++ pPager->nPage = 0; ++ if( pPager->state>=SQLITE_WRITELOCK ){ ++ sqlitepager_rollback(pPager); ++ } ++ sqliteOsUnlock(&pPager->fd); ++ pPager->state = SQLITE_UNLOCK; ++ pPager->dbSize = -1; ++ pPager->nRef = 0; ++ assert( pPager->journalOpen==0 ); ++} ++ ++/* ++** When this routine is called, the pager has the journal file open and ++** a write lock on the database. This routine releases the database ++** write lock and acquires a read lock in its place. The journal file ++** is deleted and closed. ++** ++** TODO: Consider keeping the journal file open for temporary databases. ++** This might give a performance improvement on windows where opening ++** a file is an expensive operation. ++*/ ++static int pager_unwritelock(Pager *pPager){ ++ int rc; ++ PgHdr *pPg; ++ if( pPager->stateckptOpen ){ ++ sqliteOsClose(&pPager->cpfd); ++ pPager->ckptOpen = 0; ++ } ++ if( pPager->journalOpen ){ ++ sqliteOsClose(&pPager->jfd); ++ pPager->journalOpen = 0; ++ sqliteOsDelete(pPager->zJournal); ++ sqliteFree( pPager->aInJournal ); ++ pPager->aInJournal = 0; ++ for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ ++ pPg->inJournal = 0; ++ pPg->dirty = 0; ++ pPg->needSync = 0; ++ } ++ }else{ ++ assert( pPager->dirtyFile==0 || pPager->useJournal==0 ); ++ } ++ rc = sqliteOsReadLock(&pPager->fd); ++ if( rc==SQLITE_OK ){ ++ pPager->state = SQLITE_READLOCK; ++ }else{ ++ /* This can only happen if a process does a BEGIN, then forks and the ++ ** child process does the COMMIT. Because of the semantics of unix ++ ** file locking, the unlock will fail. ++ */ ++ pPager->state = SQLITE_UNLOCK; ++ } ++ return rc; ++} ++ ++/* ++** Compute and return a checksum for the page of data. ++** ++** This is not a real checksum. It is really just the sum of the ++** random initial value and the page number. We considered do a checksum ++** of the database, but that was found to be too slow. ++*/ ++static u32 pager_cksum(Pager *pPager, Pgno pgno, const char *aData){ ++ u32 cksum = pPager->cksumInit + pgno; ++ return cksum; ++} ++ ++/* ++** Read a single page from the journal file opened on file descriptor ++** jfd. Playback this one page. ++** ++** There are three different journal formats. The format parameter determines ++** which format is used by the journal that is played back. ++*/ ++static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int format){ ++ int rc; ++ PgHdr *pPg; /* An existing page in the cache */ ++ PageRecord pgRec; ++ u32 cksum; ++ ++ rc = read32bits(format, jfd, &pgRec.pgno); ++ if( rc!=SQLITE_OK ) return rc; ++ rc = sqliteOsRead(jfd, &pgRec.aData, sizeof(pgRec.aData)); ++ if( rc!=SQLITE_OK ) return rc; ++ ++ /* Sanity checking on the page. This is more important that I originally ++ ** thought. If a power failure occurs while the journal is being written, ++ ** it could cause invalid data to be written into the journal. We need to ++ ** detect this invalid data (with high probability) and ignore it. ++ */ ++ if( pgRec.pgno==0 ){ ++ return SQLITE_DONE; ++ } ++ if( pgRec.pgno>(unsigned)pPager->dbSize ){ ++ return SQLITE_OK; ++ } ++ if( format>=JOURNAL_FORMAT_3 ){ ++ rc = read32bits(format, jfd, &cksum); ++ if( rc ) return rc; ++ if( pager_cksum(pPager, pgRec.pgno, pgRec.aData)!=cksum ){ ++ return SQLITE_DONE; ++ } ++ } ++ ++ /* Playback the page. Update the in-memory copy of the page ++ ** at the same time, if there is one. ++ */ ++ pPg = pager_lookup(pPager, pgRec.pgno); ++ TRACE2("PLAYBACK %d\n", pgRec.pgno); ++ sqliteOsSeek(&pPager->fd, (pgRec.pgno-1)*(off_t)SQLITE_PAGE_SIZE); ++ rc = sqliteOsWrite(&pPager->fd, pgRec.aData, SQLITE_PAGE_SIZE); ++ if( pPg ){ ++ /* No page should ever be rolled back that is in use, except for page ++ ** 1 which is held in use in order to keep the lock on the database ++ ** active. ++ */ ++ assert( pPg->nRef==0 || pPg->pgno==1 ); ++ memcpy(PGHDR_TO_DATA(pPg), pgRec.aData, SQLITE_PAGE_SIZE); ++ memset(PGHDR_TO_EXTRA(pPg), 0, pPager->nExtra); ++ pPg->dirty = 0; ++ pPg->needSync = 0; ++ CODEC(pPager, PGHDR_TO_DATA(pPg), pPg->pgno, 3); ++ } ++ return rc; ++} ++ ++/* ++** Playback the journal and thus restore the database file to ++** the state it was in before we started making changes. ++** ++** The journal file format is as follows: ++** ++** * 8 byte prefix. One of the aJournalMagic123 vectors defined ++** above. The format of the journal file is determined by which ++** of the three prefix vectors is seen. ++** * 4 byte big-endian integer which is the number of valid page records ++** in the journal. If this value is 0xffffffff, then compute the ++** number of page records from the journal size. This field appears ++** in format 3 only. ++** * 4 byte big-endian integer which is the initial value for the ++** sanity checksum. This field appears in format 3 only. ++** * 4 byte integer which is the number of pages to truncate the ++** database to during a rollback. ++** * Zero or more pages instances, each as follows: ++** + 4 byte page number. ++** + SQLITE_PAGE_SIZE bytes of data. ++** + 4 byte checksum (format 3 only) ++** ++** When we speak of the journal header, we mean the first 4 bullets above. ++** Each entry in the journal is an instance of the 5th bullet. Note that ++** bullets 2 and 3 only appear in format-3 journals. ++** ++** Call the value from the second bullet "nRec". nRec is the number of ++** valid page entries in the journal. In most cases, you can compute the ++** value of nRec from the size of the journal file. But if a power ++** failure occurred while the journal was being written, it could be the ++** case that the size of the journal file had already been increased but ++** the extra entries had not yet made it safely to disk. In such a case, ++** the value of nRec computed from the file size would be too large. For ++** that reason, we always use the nRec value in the header. ++** ++** If the nRec value is 0xffffffff it means that nRec should be computed ++** from the file size. This value is used when the user selects the ++** no-sync option for the journal. A power failure could lead to corruption ++** in this case. But for things like temporary table (which will be ++** deleted when the power is restored) we don't care. ++** ++** Journal formats 1 and 2 do not have an nRec value in the header so we ++** have to compute nRec from the file size. This has risks (as described ++** above) which is why all persistent tables have been changed to use ++** format 3. ++** ++** If the file opened as the journal file is not a well-formed ++** journal file then the database will likely already be ++** corrupted, so the PAGER_ERR_CORRUPT bit is set in pPager->errMask ++** and SQLITE_CORRUPT is returned. If it all works, then this routine ++** returns SQLITE_OK. ++*/ ++static int pager_playback(Pager *pPager, int useJournalSize){ ++ off_t szJ; /* Size of the journal file in bytes */ ++ int nRec; /* Number of Records in the journal */ ++ int i; /* Loop counter */ ++ Pgno mxPg = 0; /* Size of the original file in pages */ ++ int format; /* Format of the journal file. */ ++ unsigned char aMagic[sizeof(aJournalMagic1)]; ++ int rc; ++ ++ /* Figure out how many records are in the journal. Abort early if ++ ** the journal is empty. ++ */ ++ assert( pPager->journalOpen ); ++ sqliteOsSeek(&pPager->jfd, 0); ++ rc = sqliteOsFileSize(&pPager->jfd, &szJ); ++ if( rc!=SQLITE_OK ){ ++ goto end_playback; ++ } ++ ++ /* If the journal file is too small to contain a complete header, ++ ** it must mean that the process that created the journal was just ++ ** beginning to write the journal file when it died. In that case, ++ ** the database file should have still been completely unchanged. ++ ** Nothing needs to be rolled back. We can safely ignore this journal. ++ */ ++ if( szJ < sizeof(aMagic)+sizeof(Pgno) ){ ++ goto end_playback; ++ } ++ ++ /* Read the beginning of the journal and truncate the ++ ** database file back to its original size. ++ */ ++ rc = sqliteOsRead(&pPager->jfd, aMagic, sizeof(aMagic)); ++ if( rc!=SQLITE_OK ){ ++ rc = SQLITE_PROTOCOL; ++ goto end_playback; ++ } ++ if( memcmp(aMagic, aJournalMagic3, sizeof(aMagic))==0 ){ ++ format = JOURNAL_FORMAT_3; ++ }else if( memcmp(aMagic, aJournalMagic2, sizeof(aMagic))==0 ){ ++ format = JOURNAL_FORMAT_2; ++ }else if( memcmp(aMagic, aJournalMagic1, sizeof(aMagic))==0 ){ ++ format = JOURNAL_FORMAT_1; ++ }else{ ++ rc = SQLITE_PROTOCOL; ++ goto end_playback; ++ } ++ if( format>=JOURNAL_FORMAT_3 ){ ++ if( szJ < sizeof(aMagic) + 3*sizeof(u32) ){ ++ /* Ignore the journal if it is too small to contain a complete ++ ** header. We already did this test once above, but at the prior ++ ** test, we did not know the journal format and so we had to assume ++ ** the smallest possible header. Now we know the header is bigger ++ ** than the minimum so we test again. ++ */ ++ goto end_playback; ++ } ++ rc = read32bits(format, &pPager->jfd, (u32*)&nRec); ++ if( rc ) goto end_playback; ++ rc = read32bits(format, &pPager->jfd, &pPager->cksumInit); ++ if( rc ) goto end_playback; ++ if( nRec==0xffffffff || useJournalSize ){ ++ nRec = (szJ - JOURNAL_HDR_SZ(3))/JOURNAL_PG_SZ(3); ++ } ++ }else{ ++ nRec = (szJ - JOURNAL_HDR_SZ(2))/JOURNAL_PG_SZ(2); ++ assert( nRec*JOURNAL_PG_SZ(2)+JOURNAL_HDR_SZ(2)==szJ ); ++ } ++ rc = read32bits(format, &pPager->jfd, &mxPg); ++ if( rc!=SQLITE_OK ){ ++ goto end_playback; ++ } ++ assert( pPager->origDbSize==0 || pPager->origDbSize==mxPg ); ++ rc = sqliteOsTruncate(&pPager->fd, SQLITE_PAGE_SIZE*(off_t)mxPg); ++ if( rc!=SQLITE_OK ){ ++ goto end_playback; ++ } ++ pPager->dbSize = mxPg; ++ ++ /* Copy original pages out of the journal and back into the database file. ++ */ ++ for(i=0; ijfd, format); ++ if( rc!=SQLITE_OK ){ ++ if( rc==SQLITE_DONE ){ ++ rc = SQLITE_OK; ++ } ++ break; ++ } ++ } ++ ++ /* Pages that have been written to the journal but never synced ++ ** where not restored by the loop above. We have to restore those ++ ** pages by reading them back from the original database. ++ */ ++ if( rc==SQLITE_OK ){ ++ PgHdr *pPg; ++ for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ ++ char zBuf[SQLITE_PAGE_SIZE]; ++ if( !pPg->dirty ) continue; ++ if( (int)pPg->pgno <= pPager->origDbSize ){ ++ sqliteOsSeek(&pPager->fd, SQLITE_PAGE_SIZE*(off_t)(pPg->pgno-1)); ++ rc = sqliteOsRead(&pPager->fd, zBuf, SQLITE_PAGE_SIZE); ++ TRACE2("REFETCH %d\n", pPg->pgno); ++ CODEC(pPager, zBuf, pPg->pgno, 2); ++ if( rc ) break; ++ }else{ ++ memset(zBuf, 0, SQLITE_PAGE_SIZE); ++ } ++ if( pPg->nRef==0 || memcmp(zBuf, PGHDR_TO_DATA(pPg), SQLITE_PAGE_SIZE) ){ ++ memcpy(PGHDR_TO_DATA(pPg), zBuf, SQLITE_PAGE_SIZE); ++ memset(PGHDR_TO_EXTRA(pPg), 0, pPager->nExtra); ++ } ++ pPg->needSync = 0; ++ pPg->dirty = 0; ++ } ++ } ++ ++end_playback: ++ if( rc!=SQLITE_OK ){ ++ pager_unwritelock(pPager); ++ pPager->errMask |= PAGER_ERR_CORRUPT; ++ rc = SQLITE_CORRUPT; ++ }else{ ++ rc = pager_unwritelock(pPager); ++ } ++ return rc; ++} ++ ++/* ++** Playback the checkpoint journal. ++** ++** This is similar to playing back the transaction journal but with ++** a few extra twists. ++** ++** (1) The number of pages in the database file at the start of ++** the checkpoint is stored in pPager->ckptSize, not in the ++** journal file itself. ++** ++** (2) In addition to playing back the checkpoint journal, also ++** playback all pages of the transaction journal beginning ++** at offset pPager->ckptJSize. ++*/ ++static int pager_ckpt_playback(Pager *pPager){ ++ off_t szJ; /* Size of the full journal */ ++ int nRec; /* Number of Records */ ++ int i; /* Loop counter */ ++ int rc; ++ ++ /* Truncate the database back to its original size. ++ */ ++ rc = sqliteOsTruncate(&pPager->fd, SQLITE_PAGE_SIZE*(off_t)pPager->ckptSize); ++ pPager->dbSize = pPager->ckptSize; ++ ++ /* Figure out how many records are in the checkpoint journal. ++ */ ++ assert( pPager->ckptInUse && pPager->journalOpen ); ++ sqliteOsSeek(&pPager->cpfd, 0); ++ nRec = pPager->ckptNRec; ++ ++ /* Copy original pages out of the checkpoint journal and back into the ++ ** database file. Note that the checkpoint journal always uses format ++ ** 2 instead of format 3 since it does not need to be concerned with ++ ** power failures corrupting the journal and can thus omit the checksums. ++ */ ++ for(i=nRec-1; i>=0; i--){ ++ rc = pager_playback_one_page(pPager, &pPager->cpfd, 2); ++ assert( rc!=SQLITE_DONE ); ++ if( rc!=SQLITE_OK ) goto end_ckpt_playback; ++ } ++ ++ /* Figure out how many pages need to be copied out of the transaction ++ ** journal. ++ */ ++ rc = sqliteOsSeek(&pPager->jfd, pPager->ckptJSize); ++ if( rc!=SQLITE_OK ){ ++ goto end_ckpt_playback; ++ } ++ rc = sqliteOsFileSize(&pPager->jfd, &szJ); ++ if( rc!=SQLITE_OK ){ ++ goto end_ckpt_playback; ++ } ++ nRec = (szJ - pPager->ckptJSize)/JOURNAL_PG_SZ(journal_format); ++ for(i=nRec-1; i>=0; i--){ ++ rc = pager_playback_one_page(pPager, &pPager->jfd, journal_format); ++ if( rc!=SQLITE_OK ){ ++ assert( rc!=SQLITE_DONE ); ++ goto end_ckpt_playback; ++ } ++ } ++ ++end_ckpt_playback: ++ if( rc!=SQLITE_OK ){ ++ pPager->errMask |= PAGER_ERR_CORRUPT; ++ rc = SQLITE_CORRUPT; ++ } ++ return rc; ++} ++ ++/* ++** Change the maximum number of in-memory pages that are allowed. ++** ++** The maximum number is the absolute value of the mxPage parameter. ++** If mxPage is negative, the noSync flag is also set. noSync bypasses ++** calls to sqliteOsSync(). The pager runs much faster with noSync on, ++** but if the operating system crashes or there is an abrupt power ++** failure, the database file might be left in an inconsistent and ++** unrepairable state. ++*/ ++void sqlitepager_set_cachesize(Pager *pPager, int mxPage){ ++ if( mxPage>=0 ){ ++ pPager->noSync = pPager->tempFile; ++ if( pPager->noSync==0 ) pPager->needSync = 0; ++ }else{ ++ pPager->noSync = 1; ++ mxPage = -mxPage; ++ } ++ if( mxPage>10 ){ ++ pPager->mxPage = mxPage; ++ } ++} ++ ++/* ++** Adjust the robustness of the database to damage due to OS crashes ++** or power failures by changing the number of syncs()s when writing ++** the rollback journal. There are three levels: ++** ++** OFF sqliteOsSync() is never called. This is the default ++** for temporary and transient files. ++** ++** NORMAL The journal is synced once before writes begin on the ++** database. This is normally adequate protection, but ++** it is theoretically possible, though very unlikely, ++** that an inopertune power failure could leave the journal ++** in a state which would cause damage to the database ++** when it is rolled back. ++** ++** FULL The journal is synced twice before writes begin on the ++** database (with some additional information - the nRec field ++** of the journal header - being written in between the two ++** syncs). If we assume that writing a ++** single disk sector is atomic, then this mode provides ++** assurance that the journal will not be corrupted to the ++** point of causing damage to the database during rollback. ++** ++** Numeric values associated with these states are OFF==1, NORMAL=2, ++** and FULL=3. ++*/ ++void sqlitepager_set_safety_level(Pager *pPager, int level){ ++ pPager->noSync = level==1 || pPager->tempFile; ++ pPager->fullSync = level==3 && !pPager->tempFile; ++ if( pPager->noSync==0 ) pPager->needSync = 0; ++} ++ ++/* ++** Open a temporary file. Write the name of the file into zName ++** (zName must be at least SQLITE_TEMPNAME_SIZE bytes long.) Write ++** the file descriptor into *fd. Return SQLITE_OK on success or some ++** other error code if we fail. ++** ++** The OS will automatically delete the temporary file when it is ++** closed. ++*/ ++static int sqlitepager_opentemp(char *zFile, OsFile *fd){ ++ int cnt = 8; ++ int rc; ++ do{ ++ cnt--; ++ sqliteOsTempFileName(zFile); ++ rc = sqliteOsOpenExclusive(zFile, fd, 1); ++ }while( cnt>0 && rc!=SQLITE_OK ); ++ return rc; ++} ++ ++/* ++** Create a new page cache and put a pointer to the page cache in *ppPager. ++** The file to be cached need not exist. The file is not locked until ++** the first call to sqlitepager_get() and is only held open until the ++** last page is released using sqlitepager_unref(). ++** ++** If zFilename is NULL then a randomly-named temporary file is created ++** and used as the file to be cached. The file will be deleted ++** automatically when it is closed. ++*/ ++int sqlitepager_open( ++ Pager **ppPager, /* Return the Pager structure here */ ++ const char *zFilename, /* Name of the database file to open */ ++ int mxPage, /* Max number of in-memory cache pages */ ++ int nExtra, /* Extra bytes append to each in-memory page */ ++ int useJournal /* TRUE to use a rollback journal on this file */ ++){ ++ Pager *pPager; ++ char *zFullPathname; ++ int nameLen; ++ OsFile fd; ++ int rc, i; ++ int tempFile; ++ int readOnly = 0; ++ char zTemp[SQLITE_TEMPNAME_SIZE]; ++ ++ *ppPager = 0; ++ if( sqlite_malloc_failed ){ ++ return SQLITE_NOMEM; ++ } ++ if( zFilename && zFilename[0] ){ ++ zFullPathname = sqliteOsFullPathname(zFilename); ++ rc = sqliteOsOpenReadWrite(zFullPathname, &fd, &readOnly); ++ tempFile = 0; ++ }else{ ++ rc = sqlitepager_opentemp(zTemp, &fd); ++ zFilename = zTemp; ++ zFullPathname = sqliteOsFullPathname(zFilename); ++ tempFile = 1; ++ } ++ if( sqlite_malloc_failed ){ ++ return SQLITE_NOMEM; ++ } ++ if( rc!=SQLITE_OK ){ ++ sqliteFree(zFullPathname); ++ return SQLITE_CANTOPEN; ++ } ++ nameLen = strlen(zFullPathname); ++ pPager = sqliteMalloc( sizeof(*pPager) + nameLen*3 + 30 ); ++ if( pPager==0 ){ ++ sqliteOsClose(&fd); ++ sqliteFree(zFullPathname); ++ return SQLITE_NOMEM; ++ } ++ SET_PAGER(pPager); ++ pPager->zFilename = (char*)&pPager[1]; ++ pPager->zDirectory = &pPager->zFilename[nameLen+1]; ++ pPager->zJournal = &pPager->zDirectory[nameLen+1]; ++ strcpy(pPager->zFilename, zFullPathname); ++ strcpy(pPager->zDirectory, zFullPathname); ++ for(i=nameLen; i>0 && pPager->zDirectory[i-1]!='/'; i--){} ++ if( i>0 ) pPager->zDirectory[i-1] = 0; ++ strcpy(pPager->zJournal, zFullPathname); ++ sqliteFree(zFullPathname); ++ strcpy(&pPager->zJournal[nameLen], "-journal"); ++ pPager->fd = fd; ++ pPager->journalOpen = 0; ++ pPager->useJournal = useJournal; ++ pPager->ckptOpen = 0; ++ pPager->ckptInUse = 0; ++ pPager->nRef = 0; ++ pPager->dbSize = -1; ++ pPager->ckptSize = 0; ++ pPager->ckptJSize = 0; ++ pPager->nPage = 0; ++ pPager->mxPage = mxPage>5 ? mxPage : 10; ++ pPager->state = SQLITE_UNLOCK; ++ pPager->errMask = 0; ++ pPager->tempFile = tempFile; ++ pPager->readOnly = readOnly; ++ pPager->needSync = 0; ++ pPager->noSync = pPager->tempFile || !useJournal; ++ pPager->pFirst = 0; ++ pPager->pFirstSynced = 0; ++ pPager->pLast = 0; ++ pPager->nExtra = nExtra; ++ memset(pPager->aHash, 0, sizeof(pPager->aHash)); ++ *ppPager = pPager; ++ return SQLITE_OK; ++} ++ ++/* ++** Set the destructor for this pager. If not NULL, the destructor is called ++** when the reference count on each page reaches zero. The destructor can ++** be used to clean up information in the extra segment appended to each page. ++** ++** The destructor is not called as a result sqlitepager_close(). ++** Destructors are only called by sqlitepager_unref(). ++*/ ++void sqlitepager_set_destructor(Pager *pPager, void (*xDesc)(void*)){ ++ pPager->xDestructor = xDesc; ++} ++ ++/* ++** Return the total number of pages in the disk file associated with ++** pPager. ++*/ ++int sqlitepager_pagecount(Pager *pPager){ ++ off_t n; ++ assert( pPager!=0 ); ++ if( pPager->dbSize>=0 ){ ++ return pPager->dbSize; ++ } ++ if( sqliteOsFileSize(&pPager->fd, &n)!=SQLITE_OK ){ ++ pPager->errMask |= PAGER_ERR_DISK; ++ return 0; ++ } ++ n /= SQLITE_PAGE_SIZE; ++ if( pPager->state!=SQLITE_UNLOCK ){ ++ pPager->dbSize = n; ++ } ++ return n; ++} ++ ++/* ++** Forward declaration ++*/ ++static int syncJournal(Pager*); ++ ++/* ++** Truncate the file to the number of pages specified. ++*/ ++int sqlitepager_truncate(Pager *pPager, Pgno nPage){ ++ int rc; ++ if( pPager->dbSize<0 ){ ++ sqlitepager_pagecount(pPager); ++ } ++ if( pPager->errMask!=0 ){ ++ rc = pager_errcode(pPager); ++ return rc; ++ } ++ if( nPage>=(unsigned)pPager->dbSize ){ ++ return SQLITE_OK; ++ } ++ syncJournal(pPager); ++ rc = sqliteOsTruncate(&pPager->fd, SQLITE_PAGE_SIZE*(off_t)nPage); ++ if( rc==SQLITE_OK ){ ++ pPager->dbSize = nPage; ++ } ++ return rc; ++} ++ ++/* ++** Shutdown the page cache. Free all memory and close all files. ++** ++** If a transaction was in progress when this routine is called, that ++** transaction is rolled back. All outstanding pages are invalidated ++** and their memory is freed. Any attempt to use a page associated ++** with this page cache after this function returns will likely ++** result in a coredump. ++*/ ++int sqlitepager_close(Pager *pPager){ ++ PgHdr *pPg, *pNext; ++ switch( pPager->state ){ ++ case SQLITE_WRITELOCK: { ++ sqlitepager_rollback(pPager); ++ sqliteOsUnlock(&pPager->fd); ++ assert( pPager->journalOpen==0 ); ++ break; ++ } ++ case SQLITE_READLOCK: { ++ sqliteOsUnlock(&pPager->fd); ++ break; ++ } ++ default: { ++ /* Do nothing */ ++ break; ++ } ++ } ++ for(pPg=pPager->pAll; pPg; pPg=pNext){ ++ pNext = pPg->pNextAll; ++ sqliteFree(pPg); ++ } ++ sqliteOsClose(&pPager->fd); ++ assert( pPager->journalOpen==0 ); ++ /* Temp files are automatically deleted by the OS ++ ** if( pPager->tempFile ){ ++ ** sqliteOsDelete(pPager->zFilename); ++ ** } ++ */ ++ CLR_PAGER(pPager); ++ if( pPager->zFilename!=(char*)&pPager[1] ){ ++ assert( 0 ); /* Cannot happen */ ++ sqliteFree(pPager->zFilename); ++ sqliteFree(pPager->zJournal); ++ sqliteFree(pPager->zDirectory); ++ } ++ sqliteFree(pPager); ++ return SQLITE_OK; ++} ++ ++/* ++** Return the page number for the given page data. ++*/ ++Pgno sqlitepager_pagenumber(void *pData){ ++ PgHdr *p = DATA_TO_PGHDR(pData); ++ return p->pgno; ++} ++ ++/* ++** Increment the reference count for a page. If the page is ++** currently on the freelist (the reference count is zero) then ++** remove it from the freelist. ++*/ ++#define page_ref(P) ((P)->nRef==0?_page_ref(P):(void)(P)->nRef++) ++static void _page_ref(PgHdr *pPg){ ++ if( pPg->nRef==0 ){ ++ /* The page is currently on the freelist. Remove it. */ ++ if( pPg==pPg->pPager->pFirstSynced ){ ++ PgHdr *p = pPg->pNextFree; ++ while( p && p->needSync ){ p = p->pNextFree; } ++ pPg->pPager->pFirstSynced = p; ++ } ++ if( pPg->pPrevFree ){ ++ pPg->pPrevFree->pNextFree = pPg->pNextFree; ++ }else{ ++ pPg->pPager->pFirst = pPg->pNextFree; ++ } ++ if( pPg->pNextFree ){ ++ pPg->pNextFree->pPrevFree = pPg->pPrevFree; ++ }else{ ++ pPg->pPager->pLast = pPg->pPrevFree; ++ } ++ pPg->pPager->nRef++; ++ } ++ pPg->nRef++; ++ REFINFO(pPg); ++} ++ ++/* ++** Increment the reference count for a page. The input pointer is ++** a reference to the page data. ++*/ ++int sqlitepager_ref(void *pData){ ++ PgHdr *pPg = DATA_TO_PGHDR(pData); ++ page_ref(pPg); ++ return SQLITE_OK; ++} ++ ++/* ++** Sync the journal. In other words, make sure all the pages that have ++** been written to the journal have actually reached the surface of the ++** disk. It is not safe to modify the original database file until after ++** the journal has been synced. If the original database is modified before ++** the journal is synced and a power failure occurs, the unsynced journal ++** data would be lost and we would be unable to completely rollback the ++** database changes. Database corruption would occur. ++** ++** This routine also updates the nRec field in the header of the journal. ++** (See comments on the pager_playback() routine for additional information.) ++** If the sync mode is FULL, two syncs will occur. First the whole journal ++** is synced, then the nRec field is updated, then a second sync occurs. ++** ++** For temporary databases, we do not care if we are able to rollback ++** after a power failure, so sync occurs. ++** ++** This routine clears the needSync field of every page current held in ++** memory. ++*/ ++static int syncJournal(Pager *pPager){ ++ PgHdr *pPg; ++ int rc = SQLITE_OK; ++ ++ /* Sync the journal before modifying the main database ++ ** (assuming there is a journal and it needs to be synced.) ++ */ ++ if( pPager->needSync ){ ++ if( !pPager->tempFile ){ ++ assert( pPager->journalOpen ); ++ /* assert( !pPager->noSync ); // noSync might be set if synchronous ++ ** was turned off after the transaction was started. Ticket #615 */ ++#ifndef NDEBUG ++ { ++ /* Make sure the pPager->nRec counter we are keeping agrees ++ ** with the nRec computed from the size of the journal file. ++ */ ++ off_t hdrSz, pgSz, jSz; ++ hdrSz = JOURNAL_HDR_SZ(journal_format); ++ pgSz = JOURNAL_PG_SZ(journal_format); ++ rc = sqliteOsFileSize(&pPager->jfd, &jSz); ++ if( rc!=0 ) return rc; ++ assert( pPager->nRec*pgSz+hdrSz==jSz ); ++ } ++#endif ++ if( journal_format>=3 ){ ++ /* Write the nRec value into the journal file header */ ++ off_t szJ; ++ if( pPager->fullSync ){ ++ TRACE1("SYNC\n"); ++ rc = sqliteOsSync(&pPager->jfd); ++ if( rc!=0 ) return rc; ++ } ++ sqliteOsSeek(&pPager->jfd, sizeof(aJournalMagic1)); ++ rc = write32bits(&pPager->jfd, pPager->nRec); ++ if( rc ) return rc; ++ szJ = JOURNAL_HDR_SZ(journal_format) + ++ pPager->nRec*JOURNAL_PG_SZ(journal_format); ++ sqliteOsSeek(&pPager->jfd, szJ); ++ } ++ TRACE1("SYNC\n"); ++ rc = sqliteOsSync(&pPager->jfd); ++ if( rc!=0 ) return rc; ++ pPager->journalStarted = 1; ++ } ++ pPager->needSync = 0; ++ ++ /* Erase the needSync flag from every page. ++ */ ++ for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ ++ pPg->needSync = 0; ++ } ++ pPager->pFirstSynced = pPager->pFirst; ++ } ++ ++#ifndef NDEBUG ++ /* If the Pager.needSync flag is clear then the PgHdr.needSync ++ ** flag must also be clear for all pages. Verify that this ++ ** invariant is true. ++ */ ++ else{ ++ for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ ++ assert( pPg->needSync==0 ); ++ } ++ assert( pPager->pFirstSynced==pPager->pFirst ); ++ } ++#endif ++ ++ return rc; ++} ++ ++/* ++** Given a list of pages (connected by the PgHdr.pDirty pointer) write ++** every one of those pages out to the database file and mark them all ++** as clean. ++*/ ++static int pager_write_pagelist(PgHdr *pList){ ++ Pager *pPager; ++ int rc; ++ ++ if( pList==0 ) return SQLITE_OK; ++ pPager = pList->pPager; ++ while( pList ){ ++ assert( pList->dirty ); ++ sqliteOsSeek(&pPager->fd, (pList->pgno-1)*(off_t)SQLITE_PAGE_SIZE); ++ CODEC(pPager, PGHDR_TO_DATA(pList), pList->pgno, 6); ++ TRACE2("STORE %d\n", pList->pgno); ++ rc = sqliteOsWrite(&pPager->fd, PGHDR_TO_DATA(pList), SQLITE_PAGE_SIZE); ++ CODEC(pPager, PGHDR_TO_DATA(pList), pList->pgno, 0); ++ if( rc ) return rc; ++ pList->dirty = 0; ++ pList = pList->pDirty; ++ } ++ return SQLITE_OK; ++} ++ ++/* ++** Collect every dirty page into a dirty list and ++** return a pointer to the head of that list. All pages are ++** collected even if they are still in use. ++*/ ++static PgHdr *pager_get_all_dirty_pages(Pager *pPager){ ++ PgHdr *p, *pList; ++ pList = 0; ++ for(p=pPager->pAll; p; p=p->pNextAll){ ++ if( p->dirty ){ ++ p->pDirty = pList; ++ pList = p; ++ } ++ } ++ return pList; ++} ++ ++/* ++** Acquire a page. ++** ++** A read lock on the disk file is obtained when the first page is acquired. ++** This read lock is dropped when the last page is released. ++** ++** A _get works for any page number greater than 0. If the database ++** file is smaller than the requested page, then no actual disk ++** read occurs and the memory image of the page is initialized to ++** all zeros. The extra data appended to a page is always initialized ++** to zeros the first time a page is loaded into memory. ++** ++** The acquisition might fail for several reasons. In all cases, ++** an appropriate error code is returned and *ppPage is set to NULL. ++** ++** See also sqlitepager_lookup(). Both this routine and _lookup() attempt ++** to find a page in the in-memory cache first. If the page is not already ++** in memory, this routine goes to disk to read it in whereas _lookup() ++** just returns 0. This routine acquires a read-lock the first time it ++** has to go to disk, and could also playback an old journal if necessary. ++** Since _lookup() never goes to disk, it never has to deal with locks ++** or journal files. ++*/ ++int sqlitepager_get(Pager *pPager, Pgno pgno, void **ppPage){ ++ PgHdr *pPg; ++ int rc; ++ ++ /* Make sure we have not hit any critical errors. ++ */ ++ assert( pPager!=0 ); ++ assert( pgno!=0 ); ++ *ppPage = 0; ++ if( pPager->errMask & ~(PAGER_ERR_FULL) ){ ++ return pager_errcode(pPager); ++ } ++ ++ /* If this is the first page accessed, then get a read lock ++ ** on the database file. ++ */ ++ if( pPager->nRef==0 ){ ++ rc = sqliteOsReadLock(&pPager->fd); ++ if( rc!=SQLITE_OK ){ ++ return rc; ++ } ++ pPager->state = SQLITE_READLOCK; ++ ++ /* If a journal file exists, try to play it back. ++ */ ++ if( pPager->useJournal && sqliteOsFileExists(pPager->zJournal) ){ ++ int rc; ++ ++ /* Get a write lock on the database ++ */ ++ rc = sqliteOsWriteLock(&pPager->fd); ++ if( rc!=SQLITE_OK ){ ++ if( sqliteOsUnlock(&pPager->fd)!=SQLITE_OK ){ ++ /* This should never happen! */ ++ rc = SQLITE_INTERNAL; ++ } ++ return rc; ++ } ++ pPager->state = SQLITE_WRITELOCK; ++ ++ /* Open the journal for reading only. Return SQLITE_BUSY if ++ ** we are unable to open the journal file. ++ ** ++ ** The journal file does not need to be locked itself. The ++ ** journal file is never open unless the main database file holds ++ ** a write lock, so there is never any chance of two or more ++ ** processes opening the journal at the same time. ++ */ ++ rc = sqliteOsOpenReadOnly(pPager->zJournal, &pPager->jfd); ++ if( rc!=SQLITE_OK ){ ++ rc = sqliteOsUnlock(&pPager->fd); ++ assert( rc==SQLITE_OK ); ++ return SQLITE_BUSY; ++ } ++ pPager->journalOpen = 1; ++ pPager->journalStarted = 0; ++ ++ /* Playback and delete the journal. Drop the database write ++ ** lock and reacquire the read lock. ++ */ ++ rc = pager_playback(pPager, 0); ++ if( rc!=SQLITE_OK ){ ++ return rc; ++ } ++ } ++ pPg = 0; ++ }else{ ++ /* Search for page in cache */ ++ pPg = pager_lookup(pPager, pgno); ++ } ++ if( pPg==0 ){ ++ /* The requested page is not in the page cache. */ ++ int h; ++ pPager->nMiss++; ++ if( pPager->nPagemxPage || pPager->pFirst==0 ){ ++ /* Create a new page */ ++ pPg = sqliteMallocRaw( sizeof(*pPg) + SQLITE_PAGE_SIZE ++ + sizeof(u32) + pPager->nExtra ); ++ if( pPg==0 ){ ++ pager_unwritelock(pPager); ++ pPager->errMask |= PAGER_ERR_MEM; ++ return SQLITE_NOMEM; ++ } ++ memset(pPg, 0, sizeof(*pPg)); ++ pPg->pPager = pPager; ++ pPg->pNextAll = pPager->pAll; ++ if( pPager->pAll ){ ++ pPager->pAll->pPrevAll = pPg; ++ } ++ pPg->pPrevAll = 0; ++ pPager->pAll = pPg; ++ pPager->nPage++; ++ }else{ ++ /* Find a page to recycle. Try to locate a page that does not ++ ** require us to do an fsync() on the journal. ++ */ ++ pPg = pPager->pFirstSynced; ++ ++ /* If we could not find a page that does not require an fsync() ++ ** on the journal file then fsync the journal file. This is a ++ ** very slow operation, so we work hard to avoid it. But sometimes ++ ** it can't be helped. ++ */ ++ if( pPg==0 ){ ++ int rc = syncJournal(pPager); ++ if( rc!=0 ){ ++ sqlitepager_rollback(pPager); ++ return SQLITE_IOERR; ++ } ++ pPg = pPager->pFirst; ++ } ++ assert( pPg->nRef==0 ); ++ ++ /* Write the page to the database file if it is dirty. ++ */ ++ if( pPg->dirty ){ ++ assert( pPg->needSync==0 ); ++ pPg->pDirty = 0; ++ rc = pager_write_pagelist( pPg ); ++ if( rc!=SQLITE_OK ){ ++ sqlitepager_rollback(pPager); ++ return SQLITE_IOERR; ++ } ++ } ++ assert( pPg->dirty==0 ); ++ ++ /* If the page we are recycling is marked as alwaysRollback, then ++ ** set the global alwaysRollback flag, thus disabling the ++ ** sqlite_dont_rollback() optimization for the rest of this transaction. ++ ** It is necessary to do this because the page marked alwaysRollback ++ ** might be reloaded at a later time but at that point we won't remember ++ ** that is was marked alwaysRollback. This means that all pages must ++ ** be marked as alwaysRollback from here on out. ++ */ ++ if( pPg->alwaysRollback ){ ++ pPager->alwaysRollback = 1; ++ } ++ ++ /* Unlink the old page from the free list and the hash table ++ */ ++ if( pPg==pPager->pFirstSynced ){ ++ PgHdr *p = pPg->pNextFree; ++ while( p && p->needSync ){ p = p->pNextFree; } ++ pPager->pFirstSynced = p; ++ } ++ if( pPg->pPrevFree ){ ++ pPg->pPrevFree->pNextFree = pPg->pNextFree; ++ }else{ ++ assert( pPager->pFirst==pPg ); ++ pPager->pFirst = pPg->pNextFree; ++ } ++ if( pPg->pNextFree ){ ++ pPg->pNextFree->pPrevFree = pPg->pPrevFree; ++ }else{ ++ assert( pPager->pLast==pPg ); ++ pPager->pLast = pPg->pPrevFree; ++ } ++ pPg->pNextFree = pPg->pPrevFree = 0; ++ if( pPg->pNextHash ){ ++ pPg->pNextHash->pPrevHash = pPg->pPrevHash; ++ } ++ if( pPg->pPrevHash ){ ++ pPg->pPrevHash->pNextHash = pPg->pNextHash; ++ }else{ ++ h = pager_hash(pPg->pgno); ++ assert( pPager->aHash[h]==pPg ); ++ pPager->aHash[h] = pPg->pNextHash; ++ } ++ pPg->pNextHash = pPg->pPrevHash = 0; ++ pPager->nOvfl++; ++ } ++ pPg->pgno = pgno; ++ if( pPager->aInJournal && (int)pgno<=pPager->origDbSize ){ ++ sqliteCheckMemory(pPager->aInJournal, pgno/8); ++ assert( pPager->journalOpen ); ++ pPg->inJournal = (pPager->aInJournal[pgno/8] & (1<<(pgno&7)))!=0; ++ pPg->needSync = 0; ++ }else{ ++ pPg->inJournal = 0; ++ pPg->needSync = 0; ++ } ++ if( pPager->aInCkpt && (int)pgno<=pPager->ckptSize ++ && (pPager->aInCkpt[pgno/8] & (1<<(pgno&7)))!=0 ){ ++ page_add_to_ckpt_list(pPg); ++ }else{ ++ page_remove_from_ckpt_list(pPg); ++ } ++ pPg->dirty = 0; ++ pPg->nRef = 1; ++ REFINFO(pPg); ++ pPager->nRef++; ++ h = pager_hash(pgno); ++ pPg->pNextHash = pPager->aHash[h]; ++ pPager->aHash[h] = pPg; ++ if( pPg->pNextHash ){ ++ assert( pPg->pNextHash->pPrevHash==0 ); ++ pPg->pNextHash->pPrevHash = pPg; ++ } ++ if( pPager->nExtra>0 ){ ++ memset(PGHDR_TO_EXTRA(pPg), 0, pPager->nExtra); ++ } ++ if( pPager->dbSize<0 ) sqlitepager_pagecount(pPager); ++ if( pPager->errMask!=0 ){ ++ sqlitepager_unref(PGHDR_TO_DATA(pPg)); ++ rc = pager_errcode(pPager); ++ return rc; ++ } ++ if( pPager->dbSize<(int)pgno ){ ++ memset(PGHDR_TO_DATA(pPg), 0, SQLITE_PAGE_SIZE); ++ }else{ ++ int rc; ++ sqliteOsSeek(&pPager->fd, (pgno-1)*(off_t)SQLITE_PAGE_SIZE); ++ rc = sqliteOsRead(&pPager->fd, PGHDR_TO_DATA(pPg), SQLITE_PAGE_SIZE); ++ TRACE2("FETCH %d\n", pPg->pgno); ++ CODEC(pPager, PGHDR_TO_DATA(pPg), pPg->pgno, 3); ++ if( rc!=SQLITE_OK ){ ++ off_t fileSize; ++ if( sqliteOsFileSize(&pPager->fd,&fileSize)!=SQLITE_OK ++ || fileSize>=pgno*SQLITE_PAGE_SIZE ){ ++ sqlitepager_unref(PGHDR_TO_DATA(pPg)); ++ return rc; ++ }else{ ++ memset(PGHDR_TO_DATA(pPg), 0, SQLITE_PAGE_SIZE); ++ } ++ } ++ } ++ }else{ ++ /* The requested page is in the page cache. */ ++ pPager->nHit++; ++ page_ref(pPg); ++ } ++ *ppPage = PGHDR_TO_DATA(pPg); ++ return SQLITE_OK; ++} ++ ++/* ++** Acquire a page if it is already in the in-memory cache. Do ++** not read the page from disk. Return a pointer to the page, ++** or 0 if the page is not in cache. ++** ++** See also sqlitepager_get(). The difference between this routine ++** and sqlitepager_get() is that _get() will go to the disk and read ++** in the page if the page is not already in cache. This routine ++** returns NULL if the page is not in cache or if a disk I/O error ++** has ever happened. ++*/ ++void *sqlitepager_lookup(Pager *pPager, Pgno pgno){ ++ PgHdr *pPg; ++ ++ assert( pPager!=0 ); ++ assert( pgno!=0 ); ++ if( pPager->errMask & ~(PAGER_ERR_FULL) ){ ++ return 0; ++ } ++ /* if( pPager->nRef==0 ){ ++ ** return 0; ++ ** } ++ */ ++ pPg = pager_lookup(pPager, pgno); ++ if( pPg==0 ) return 0; ++ page_ref(pPg); ++ return PGHDR_TO_DATA(pPg); ++} ++ ++/* ++** Release a page. ++** ++** If the number of references to the page drop to zero, then the ++** page is added to the LRU list. When all references to all pages ++** are released, a rollback occurs and the lock on the database is ++** removed. ++*/ ++int sqlitepager_unref(void *pData){ ++ PgHdr *pPg; ++ ++ /* Decrement the reference count for this page ++ */ ++ pPg = DATA_TO_PGHDR(pData); ++ assert( pPg->nRef>0 ); ++ pPg->nRef--; ++ REFINFO(pPg); ++ ++ /* When the number of references to a page reach 0, call the ++ ** destructor and add the page to the freelist. ++ */ ++ if( pPg->nRef==0 ){ ++ Pager *pPager; ++ pPager = pPg->pPager; ++ pPg->pNextFree = 0; ++ pPg->pPrevFree = pPager->pLast; ++ pPager->pLast = pPg; ++ if( pPg->pPrevFree ){ ++ pPg->pPrevFree->pNextFree = pPg; ++ }else{ ++ pPager->pFirst = pPg; ++ } ++ if( pPg->needSync==0 && pPager->pFirstSynced==0 ){ ++ pPager->pFirstSynced = pPg; ++ } ++ if( pPager->xDestructor ){ ++ pPager->xDestructor(pData); ++ } ++ ++ /* When all pages reach the freelist, drop the read lock from ++ ** the database file. ++ */ ++ pPager->nRef--; ++ assert( pPager->nRef>=0 ); ++ if( pPager->nRef==0 ){ ++ pager_reset(pPager); ++ } ++ } ++ return SQLITE_OK; ++} ++ ++/* ++** Create a journal file for pPager. There should already be a write ++** lock on the database file when this routine is called. ++** ++** Return SQLITE_OK if everything. Return an error code and release the ++** write lock if anything goes wrong. ++*/ ++static int pager_open_journal(Pager *pPager){ ++ int rc; ++ assert( pPager->state==SQLITE_WRITELOCK ); ++ assert( pPager->journalOpen==0 ); ++ assert( pPager->useJournal ); ++ sqlitepager_pagecount(pPager); ++ pPager->aInJournal = sqliteMalloc( pPager->dbSize/8 + 1 ); ++ if( pPager->aInJournal==0 ){ ++ sqliteOsReadLock(&pPager->fd); ++ pPager->state = SQLITE_READLOCK; ++ return SQLITE_NOMEM; ++ } ++ rc = sqliteOsOpenExclusive(pPager->zJournal, &pPager->jfd,pPager->tempFile); ++ if( rc!=SQLITE_OK ){ ++ sqliteFree(pPager->aInJournal); ++ pPager->aInJournal = 0; ++ sqliteOsReadLock(&pPager->fd); ++ pPager->state = SQLITE_READLOCK; ++ return SQLITE_CANTOPEN; ++ } ++ sqliteOsOpenDirectory(pPager->zDirectory, &pPager->jfd); ++ pPager->journalOpen = 1; ++ pPager->journalStarted = 0; ++ pPager->needSync = 0; ++ pPager->alwaysRollback = 0; ++ pPager->nRec = 0; ++ if( pPager->errMask!=0 ){ ++ rc = pager_errcode(pPager); ++ return rc; ++ } ++ pPager->origDbSize = pPager->dbSize; ++ if( journal_format==JOURNAL_FORMAT_3 ){ ++ rc = sqliteOsWrite(&pPager->jfd, aJournalMagic3, sizeof(aJournalMagic3)); ++ if( rc==SQLITE_OK ){ ++ rc = write32bits(&pPager->jfd, pPager->noSync ? 0xffffffff : 0); ++ } ++ if( rc==SQLITE_OK ){ ++ sqliteRandomness(sizeof(pPager->cksumInit), &pPager->cksumInit); ++ rc = write32bits(&pPager->jfd, pPager->cksumInit); ++ } ++ }else if( journal_format==JOURNAL_FORMAT_2 ){ ++ rc = sqliteOsWrite(&pPager->jfd, aJournalMagic2, sizeof(aJournalMagic2)); ++ }else{ ++ assert( journal_format==JOURNAL_FORMAT_1 ); ++ rc = sqliteOsWrite(&pPager->jfd, aJournalMagic1, sizeof(aJournalMagic1)); ++ } ++ if( rc==SQLITE_OK ){ ++ rc = write32bits(&pPager->jfd, pPager->dbSize); ++ } ++ if( pPager->ckptAutoopen && rc==SQLITE_OK ){ ++ rc = sqlitepager_ckpt_begin(pPager); ++ } ++ if( rc!=SQLITE_OK ){ ++ rc = pager_unwritelock(pPager); ++ if( rc==SQLITE_OK ){ ++ rc = SQLITE_FULL; ++ } ++ } ++ return rc; ++} ++ ++/* ++** Acquire a write-lock on the database. The lock is removed when ++** the any of the following happen: ++** ++** * sqlitepager_commit() is called. ++** * sqlitepager_rollback() is called. ++** * sqlitepager_close() is called. ++** * sqlitepager_unref() is called to on every outstanding page. ++** ++** The parameter to this routine is a pointer to any open page of the ++** database file. Nothing changes about the page - it is used merely ++** to acquire a pointer to the Pager structure and as proof that there ++** is already a read-lock on the database. ++** ++** A journal file is opened if this is not a temporary file. For ++** temporary files, the opening of the journal file is deferred until ++** there is an actual need to write to the journal. ++** ++** If the database is already write-locked, this routine is a no-op. ++*/ ++int sqlitepager_begin(void *pData){ ++ PgHdr *pPg = DATA_TO_PGHDR(pData); ++ Pager *pPager = pPg->pPager; ++ int rc = SQLITE_OK; ++ assert( pPg->nRef>0 ); ++ assert( pPager->state!=SQLITE_UNLOCK ); ++ if( pPager->state==SQLITE_READLOCK ){ ++ assert( pPager->aInJournal==0 ); ++ rc = sqliteOsWriteLock(&pPager->fd); ++ if( rc!=SQLITE_OK ){ ++ return rc; ++ } ++ pPager->state = SQLITE_WRITELOCK; ++ pPager->dirtyFile = 0; ++ TRACE1("TRANSACTION\n"); ++ if( pPager->useJournal && !pPager->tempFile ){ ++ rc = pager_open_journal(pPager); ++ } ++ } ++ return rc; ++} ++ ++/* ++** Mark a data page as writeable. The page is written into the journal ++** if it is not there already. This routine must be called before making ++** changes to a page. ++** ++** The first time this routine is called, the pager creates a new ++** journal and acquires a write lock on the database. If the write ++** lock could not be acquired, this routine returns SQLITE_BUSY. The ++** calling routine must check for that return value and be careful not to ++** change any page data until this routine returns SQLITE_OK. ++** ++** If the journal file could not be written because the disk is full, ++** then this routine returns SQLITE_FULL and does an immediate rollback. ++** All subsequent write attempts also return SQLITE_FULL until there ++** is a call to sqlitepager_commit() or sqlitepager_rollback() to ++** reset. ++*/ ++int sqlitepager_write(void *pData){ ++ PgHdr *pPg = DATA_TO_PGHDR(pData); ++ Pager *pPager = pPg->pPager; ++ int rc = SQLITE_OK; ++ ++ /* Check for errors ++ */ ++ if( pPager->errMask ){ ++ return pager_errcode(pPager); ++ } ++ if( pPager->readOnly ){ ++ return SQLITE_PERM; ++ } ++ ++ /* Mark the page as dirty. If the page has already been written ++ ** to the journal then we can return right away. ++ */ ++ pPg->dirty = 1; ++ if( pPg->inJournal && (pPg->inCkpt || pPager->ckptInUse==0) ){ ++ pPager->dirtyFile = 1; ++ return SQLITE_OK; ++ } ++ ++ /* If we get this far, it means that the page needs to be ++ ** written to the transaction journal or the ckeckpoint journal ++ ** or both. ++ ** ++ ** First check to see that the transaction journal exists and ++ ** create it if it does not. ++ */ ++ assert( pPager->state!=SQLITE_UNLOCK ); ++ rc = sqlitepager_begin(pData); ++ if( rc!=SQLITE_OK ){ ++ return rc; ++ } ++ assert( pPager->state==SQLITE_WRITELOCK ); ++ if( !pPager->journalOpen && pPager->useJournal ){ ++ rc = pager_open_journal(pPager); ++ if( rc!=SQLITE_OK ) return rc; ++ } ++ assert( pPager->journalOpen || !pPager->useJournal ); ++ pPager->dirtyFile = 1; ++ ++ /* The transaction journal now exists and we have a write lock on the ++ ** main database file. Write the current page to the transaction ++ ** journal if it is not there already. ++ */ ++ if( !pPg->inJournal && pPager->useJournal ){ ++ if( (int)pPg->pgno <= pPager->origDbSize ){ ++ int szPg; ++ u32 saved; ++ if( journal_format>=JOURNAL_FORMAT_3 ){ ++ u32 cksum = pager_cksum(pPager, pPg->pgno, pData); ++ saved = *(u32*)PGHDR_TO_EXTRA(pPg); ++ store32bits(cksum, pPg, SQLITE_PAGE_SIZE); ++ szPg = SQLITE_PAGE_SIZE+8; ++ }else{ ++ szPg = SQLITE_PAGE_SIZE+4; ++ } ++ store32bits(pPg->pgno, pPg, -4); ++ CODEC(pPager, pData, pPg->pgno, 7); ++ rc = sqliteOsWrite(&pPager->jfd, &((char*)pData)[-4], szPg); ++ TRACE3("JOURNAL %d %d\n", pPg->pgno, pPg->needSync); ++ CODEC(pPager, pData, pPg->pgno, 0); ++ if( journal_format>=JOURNAL_FORMAT_3 ){ ++ *(u32*)PGHDR_TO_EXTRA(pPg) = saved; ++ } ++ if( rc!=SQLITE_OK ){ ++ sqlitepager_rollback(pPager); ++ pPager->errMask |= PAGER_ERR_FULL; ++ return rc; ++ } ++ pPager->nRec++; ++ assert( pPager->aInJournal!=0 ); ++ pPager->aInJournal[pPg->pgno/8] |= 1<<(pPg->pgno&7); ++ pPg->needSync = !pPager->noSync; ++ pPg->inJournal = 1; ++ if( pPager->ckptInUse ){ ++ pPager->aInCkpt[pPg->pgno/8] |= 1<<(pPg->pgno&7); ++ page_add_to_ckpt_list(pPg); ++ } ++ }else{ ++ pPg->needSync = !pPager->journalStarted && !pPager->noSync; ++ TRACE3("APPEND %d %d\n", pPg->pgno, pPg->needSync); ++ } ++ if( pPg->needSync ){ ++ pPager->needSync = 1; ++ } ++ } ++ ++ /* If the checkpoint journal is open and the page is not in it, ++ ** then write the current page to the checkpoint journal. Note that ++ ** the checkpoint journal always uses the simplier format 2 that lacks ++ ** checksums. The header is also omitted from the checkpoint journal. ++ */ ++ if( pPager->ckptInUse && !pPg->inCkpt && (int)pPg->pgno<=pPager->ckptSize ){ ++ assert( pPg->inJournal || (int)pPg->pgno>pPager->origDbSize ); ++ store32bits(pPg->pgno, pPg, -4); ++ CODEC(pPager, pData, pPg->pgno, 7); ++ rc = sqliteOsWrite(&pPager->cpfd, &((char*)pData)[-4], SQLITE_PAGE_SIZE+4); ++ TRACE2("CKPT-JOURNAL %d\n", pPg->pgno); ++ CODEC(pPager, pData, pPg->pgno, 0); ++ if( rc!=SQLITE_OK ){ ++ sqlitepager_rollback(pPager); ++ pPager->errMask |= PAGER_ERR_FULL; ++ return rc; ++ } ++ pPager->ckptNRec++; ++ assert( pPager->aInCkpt!=0 ); ++ pPager->aInCkpt[pPg->pgno/8] |= 1<<(pPg->pgno&7); ++ page_add_to_ckpt_list(pPg); ++ } ++ ++ /* Update the database size and return. ++ */ ++ if( pPager->dbSize<(int)pPg->pgno ){ ++ pPager->dbSize = pPg->pgno; ++ } ++ return rc; ++} ++ ++/* ++** Return TRUE if the page given in the argument was previously passed ++** to sqlitepager_write(). In other words, return TRUE if it is ok ++** to change the content of the page. ++*/ ++int sqlitepager_iswriteable(void *pData){ ++ PgHdr *pPg = DATA_TO_PGHDR(pData); ++ return pPg->dirty; ++} ++ ++/* ++** Replace the content of a single page with the information in the third ++** argument. ++*/ ++int sqlitepager_overwrite(Pager *pPager, Pgno pgno, void *pData){ ++ void *pPage; ++ int rc; ++ ++ rc = sqlitepager_get(pPager, pgno, &pPage); ++ if( rc==SQLITE_OK ){ ++ rc = sqlitepager_write(pPage); ++ if( rc==SQLITE_OK ){ ++ memcpy(pPage, pData, SQLITE_PAGE_SIZE); ++ } ++ sqlitepager_unref(pPage); ++ } ++ return rc; ++} ++ ++/* ++** A call to this routine tells the pager that it is not necessary to ++** write the information on page "pgno" back to the disk, even though ++** that page might be marked as dirty. ++** ++** The overlying software layer calls this routine when all of the data ++** on the given page is unused. The pager marks the page as clean so ++** that it does not get written to disk. ++** ++** Tests show that this optimization, together with the ++** sqlitepager_dont_rollback() below, more than double the speed ++** of large INSERT operations and quadruple the speed of large DELETEs. ++** ++** When this routine is called, set the alwaysRollback flag to true. ++** Subsequent calls to sqlitepager_dont_rollback() for the same page ++** will thereafter be ignored. This is necessary to avoid a problem ++** where a page with data is added to the freelist during one part of ++** a transaction then removed from the freelist during a later part ++** of the same transaction and reused for some other purpose. When it ++** is first added to the freelist, this routine is called. When reused, ++** the dont_rollback() routine is called. But because the page contains ++** critical data, we still need to be sure it gets rolled back in spite ++** of the dont_rollback() call. ++*/ ++void sqlitepager_dont_write(Pager *pPager, Pgno pgno){ ++ PgHdr *pPg; ++ ++ pPg = pager_lookup(pPager, pgno); ++ pPg->alwaysRollback = 1; ++ if( pPg && pPg->dirty && !pPager->ckptInUse ){ ++ if( pPager->dbSize==(int)pPg->pgno && pPager->origDbSizedbSize ){ ++ /* If this pages is the last page in the file and the file has grown ++ ** during the current transaction, then do NOT mark the page as clean. ++ ** When the database file grows, we must make sure that the last page ++ ** gets written at least once so that the disk file will be the correct ++ ** size. If you do not write this page and the size of the file ++ ** on the disk ends up being too small, that can lead to database ++ ** corruption during the next transaction. ++ */ ++ }else{ ++ TRACE2("DONT_WRITE %d\n", pgno); ++ pPg->dirty = 0; ++ } ++ } ++} ++ ++/* ++** A call to this routine tells the pager that if a rollback occurs, ++** it is not necessary to restore the data on the given page. This ++** means that the pager does not have to record the given page in the ++** rollback journal. ++*/ ++void sqlitepager_dont_rollback(void *pData){ ++ PgHdr *pPg = DATA_TO_PGHDR(pData); ++ Pager *pPager = pPg->pPager; ++ ++ if( pPager->state!=SQLITE_WRITELOCK || pPager->journalOpen==0 ) return; ++ if( pPg->alwaysRollback || pPager->alwaysRollback ) return; ++ if( !pPg->inJournal && (int)pPg->pgno <= pPager->origDbSize ){ ++ assert( pPager->aInJournal!=0 ); ++ pPager->aInJournal[pPg->pgno/8] |= 1<<(pPg->pgno&7); ++ pPg->inJournal = 1; ++ if( pPager->ckptInUse ){ ++ pPager->aInCkpt[pPg->pgno/8] |= 1<<(pPg->pgno&7); ++ page_add_to_ckpt_list(pPg); ++ } ++ TRACE2("DONT_ROLLBACK %d\n", pPg->pgno); ++ } ++ if( pPager->ckptInUse && !pPg->inCkpt && (int)pPg->pgno<=pPager->ckptSize ){ ++ assert( pPg->inJournal || (int)pPg->pgno>pPager->origDbSize ); ++ assert( pPager->aInCkpt!=0 ); ++ pPager->aInCkpt[pPg->pgno/8] |= 1<<(pPg->pgno&7); ++ page_add_to_ckpt_list(pPg); ++ } ++} ++ ++/* ++** Commit all changes to the database and release the write lock. ++** ++** If the commit fails for any reason, a rollback attempt is made ++** and an error code is returned. If the commit worked, SQLITE_OK ++** is returned. ++*/ ++int sqlitepager_commit(Pager *pPager){ ++ int rc; ++ PgHdr *pPg; ++ ++ if( pPager->errMask==PAGER_ERR_FULL ){ ++ rc = sqlitepager_rollback(pPager); ++ if( rc==SQLITE_OK ){ ++ rc = SQLITE_FULL; ++ } ++ return rc; ++ } ++ if( pPager->errMask!=0 ){ ++ rc = pager_errcode(pPager); ++ return rc; ++ } ++ if( pPager->state!=SQLITE_WRITELOCK ){ ++ return SQLITE_ERROR; ++ } ++ TRACE1("COMMIT\n"); ++ if( pPager->dirtyFile==0 ){ ++ /* Exit early (without doing the time-consuming sqliteOsSync() calls) ++ ** if there have been no changes to the database file. */ ++ assert( pPager->needSync==0 ); ++ rc = pager_unwritelock(pPager); ++ pPager->dbSize = -1; ++ return rc; ++ } ++ assert( pPager->journalOpen ); ++ rc = syncJournal(pPager); ++ if( rc!=SQLITE_OK ){ ++ goto commit_abort; ++ } ++ pPg = pager_get_all_dirty_pages(pPager); ++ if( pPg ){ ++ rc = pager_write_pagelist(pPg); ++ if( rc || (!pPager->noSync && sqliteOsSync(&pPager->fd)!=SQLITE_OK) ){ ++ goto commit_abort; ++ } ++ } ++ rc = pager_unwritelock(pPager); ++ pPager->dbSize = -1; ++ return rc; ++ ++ /* Jump here if anything goes wrong during the commit process. ++ */ ++commit_abort: ++ rc = sqlitepager_rollback(pPager); ++ if( rc==SQLITE_OK ){ ++ rc = SQLITE_FULL; ++ } ++ return rc; ++} ++ ++/* ++** Rollback all changes. The database falls back to read-only mode. ++** All in-memory cache pages revert to their original data contents. ++** The journal is deleted. ++** ++** This routine cannot fail unless some other process is not following ++** the correct locking protocol (SQLITE_PROTOCOL) or unless some other ++** process is writing trash into the journal file (SQLITE_CORRUPT) or ++** unless a prior malloc() failed (SQLITE_NOMEM). Appropriate error ++** codes are returned for all these occasions. Otherwise, ++** SQLITE_OK is returned. ++*/ ++int sqlitepager_rollback(Pager *pPager){ ++ int rc; ++ TRACE1("ROLLBACK\n"); ++ if( !pPager->dirtyFile || !pPager->journalOpen ){ ++ rc = pager_unwritelock(pPager); ++ pPager->dbSize = -1; ++ return rc; ++ } ++ ++ if( pPager->errMask!=0 && pPager->errMask!=PAGER_ERR_FULL ){ ++ if( pPager->state>=SQLITE_WRITELOCK ){ ++ pager_playback(pPager, 1); ++ } ++ return pager_errcode(pPager); ++ } ++ if( pPager->state!=SQLITE_WRITELOCK ){ ++ return SQLITE_OK; ++ } ++ rc = pager_playback(pPager, 1); ++ if( rc!=SQLITE_OK ){ ++ rc = SQLITE_CORRUPT; ++ pPager->errMask |= PAGER_ERR_CORRUPT; ++ } ++ pPager->dbSize = -1; ++ return rc; ++} ++ ++/* ++** Return TRUE if the database file is opened read-only. Return FALSE ++** if the database is (in theory) writable. ++*/ ++int sqlitepager_isreadonly(Pager *pPager){ ++ return pPager->readOnly; ++} ++ ++/* ++** This routine is used for testing and analysis only. ++*/ ++int *sqlitepager_stats(Pager *pPager){ ++ static int a[9]; ++ a[0] = pPager->nRef; ++ a[1] = pPager->nPage; ++ a[2] = pPager->mxPage; ++ a[3] = pPager->dbSize; ++ a[4] = pPager->state; ++ a[5] = pPager->errMask; ++ a[6] = pPager->nHit; ++ a[7] = pPager->nMiss; ++ a[8] = pPager->nOvfl; ++ return a; ++} ++ ++/* ++** Set the checkpoint. ++** ++** This routine should be called with the transaction journal already ++** open. A new checkpoint journal is created that can be used to rollback ++** changes of a single SQL command within a larger transaction. ++*/ ++int sqlitepager_ckpt_begin(Pager *pPager){ ++ int rc; ++ char zTemp[SQLITE_TEMPNAME_SIZE]; ++ if( !pPager->journalOpen ){ ++ pPager->ckptAutoopen = 1; ++ return SQLITE_OK; ++ } ++ assert( pPager->journalOpen ); ++ assert( !pPager->ckptInUse ); ++ pPager->aInCkpt = sqliteMalloc( pPager->dbSize/8 + 1 ); ++ if( pPager->aInCkpt==0 ){ ++ sqliteOsReadLock(&pPager->fd); ++ return SQLITE_NOMEM; ++ } ++#ifndef NDEBUG ++ rc = sqliteOsFileSize(&pPager->jfd, &pPager->ckptJSize); ++ if( rc ) goto ckpt_begin_failed; ++ assert( pPager->ckptJSize == ++ pPager->nRec*JOURNAL_PG_SZ(journal_format)+JOURNAL_HDR_SZ(journal_format) ); ++#endif ++ pPager->ckptJSize = pPager->nRec*JOURNAL_PG_SZ(journal_format) ++ + JOURNAL_HDR_SZ(journal_format); ++ pPager->ckptSize = pPager->dbSize; ++ if( !pPager->ckptOpen ){ ++ rc = sqlitepager_opentemp(zTemp, &pPager->cpfd); ++ if( rc ) goto ckpt_begin_failed; ++ pPager->ckptOpen = 1; ++ pPager->ckptNRec = 0; ++ } ++ pPager->ckptInUse = 1; ++ return SQLITE_OK; ++ ++ckpt_begin_failed: ++ if( pPager->aInCkpt ){ ++ sqliteFree(pPager->aInCkpt); ++ pPager->aInCkpt = 0; ++ } ++ return rc; ++} ++ ++/* ++** Commit a checkpoint. ++*/ ++int sqlitepager_ckpt_commit(Pager *pPager){ ++ if( pPager->ckptInUse ){ ++ PgHdr *pPg, *pNext; ++ sqliteOsSeek(&pPager->cpfd, 0); ++ /* sqliteOsTruncate(&pPager->cpfd, 0); */ ++ pPager->ckptNRec = 0; ++ pPager->ckptInUse = 0; ++ sqliteFree( pPager->aInCkpt ); ++ pPager->aInCkpt = 0; ++ for(pPg=pPager->pCkpt; pPg; pPg=pNext){ ++ pNext = pPg->pNextCkpt; ++ assert( pPg->inCkpt ); ++ pPg->inCkpt = 0; ++ pPg->pPrevCkpt = pPg->pNextCkpt = 0; ++ } ++ pPager->pCkpt = 0; ++ } ++ pPager->ckptAutoopen = 0; ++ return SQLITE_OK; ++} ++ ++/* ++** Rollback a checkpoint. ++*/ ++int sqlitepager_ckpt_rollback(Pager *pPager){ ++ int rc; ++ if( pPager->ckptInUse ){ ++ rc = pager_ckpt_playback(pPager); ++ sqlitepager_ckpt_commit(pPager); ++ }else{ ++ rc = SQLITE_OK; ++ } ++ pPager->ckptAutoopen = 0; ++ return rc; ++} ++ ++/* ++** Return the full pathname of the database file. ++*/ ++const char *sqlitepager_filename(Pager *pPager){ ++ return pPager->zFilename; ++} ++ ++/* ++** Set the codec for this pager ++*/ ++void sqlitepager_set_codec( ++ Pager *pPager, ++ void (*xCodec)(void*,void*,Pgno,int), ++ void *pCodecArg ++){ ++ pPager->xCodec = xCodec; ++ pPager->pCodecArg = pCodecArg; ++} ++ ++#ifdef SQLITE_TEST ++/* ++** Print a listing of all referenced pages and their ref count. ++*/ ++void sqlitepager_refdump(Pager *pPager){ ++ PgHdr *pPg; ++ for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ ++ if( pPg->nRef<=0 ) continue; ++ printf("PAGE %3d addr=0x%08x nRef=%d\n", ++ pPg->pgno, (int)PGHDR_TO_DATA(pPg), pPg->nRef); ++ } ++} ++#endif +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/pager.h +@@ -0,0 +1,107 @@ ++/* ++** 2001 September 15 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This header file defines the interface that the sqlite page cache ++** subsystem. The page cache subsystem reads and writes a file a page ++** at a time and provides a journal for rollback. ++** ++** @(#) $Id$ ++*/ ++ ++/* ++** The size of one page ++** ++** You can change this value to another (reasonable) value you want. ++** It need not be a power of two, though the interface to the disk ++** will likely be faster if it is. ++** ++** Experiments show that a page size of 1024 gives the best speed ++** for common usages. The speed differences for different sizes ++** such as 512, 2048, 4096, an so forth, is minimal. Note, however, ++** that changing the page size results in a completely imcompatible ++** file format. ++*/ ++#ifndef SQLITE_PAGE_SIZE ++#define SQLITE_PAGE_SIZE 1024 ++#endif ++ ++/* ++** Number of extra bytes of data allocated at the end of each page and ++** stored on disk but not used by the higher level btree layer. Changing ++** this value results in a completely incompatible file format. ++*/ ++#ifndef SQLITE_PAGE_RESERVE ++#define SQLITE_PAGE_RESERVE 0 ++#endif ++ ++/* ++** The total number of usable bytes stored on disk for each page. ++** The usable bytes come at the beginning of the page and the reserve ++** bytes come at the end. ++*/ ++#define SQLITE_USABLE_SIZE (SQLITE_PAGE_SIZE-SQLITE_PAGE_RESERVE) ++ ++/* ++** Maximum number of pages in one database. (This is a limitation of ++** imposed by 4GB files size limits.) ++*/ ++#define SQLITE_MAX_PAGE 1073741823 ++ ++/* ++** The type used to represent a page number. The first page in a file ++** is called page 1. 0 is used to represent "not a page". ++*/ ++typedef unsigned int Pgno; ++ ++/* ++** Each open file is managed by a separate instance of the "Pager" structure. ++*/ ++typedef struct Pager Pager; ++ ++/* ++** See source code comments for a detailed description of the following ++** routines: ++*/ ++int sqlitepager_open(Pager **ppPager, const char *zFilename, ++ int nPage, int nExtra, int useJournal); ++void sqlitepager_set_destructor(Pager*, void(*)(void*)); ++void sqlitepager_set_cachesize(Pager*, int); ++int sqlitepager_close(Pager *pPager); ++int sqlitepager_get(Pager *pPager, Pgno pgno, void **ppPage); ++void *sqlitepager_lookup(Pager *pPager, Pgno pgno); ++int sqlitepager_ref(void*); ++int sqlitepager_unref(void*); ++Pgno sqlitepager_pagenumber(void*); ++int sqlitepager_write(void*); ++int sqlitepager_iswriteable(void*); ++int sqlitepager_overwrite(Pager *pPager, Pgno pgno, void*); ++int sqlitepager_pagecount(Pager*); ++int sqlitepager_truncate(Pager*,Pgno); ++int sqlitepager_begin(void*); ++int sqlitepager_commit(Pager*); ++int sqlitepager_rollback(Pager*); ++int sqlitepager_isreadonly(Pager*); ++int sqlitepager_ckpt_begin(Pager*); ++int sqlitepager_ckpt_commit(Pager*); ++int sqlitepager_ckpt_rollback(Pager*); ++void sqlitepager_dont_rollback(void*); ++void sqlitepager_dont_write(Pager*, Pgno); ++int *sqlitepager_stats(Pager*); ++void sqlitepager_set_safety_level(Pager*,int); ++const char *sqlitepager_filename(Pager*); ++int sqlitepager_rename(Pager*, const char *zNewName); ++void sqlitepager_set_codec(Pager*,void(*)(void*,void*,Pgno,int),void*); ++ ++#ifdef SQLITE_TEST ++void sqlitepager_refdump(Pager*); ++int pager_refinfo_enable; ++int journal_format; ++#endif +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/parse.c +@@ -0,0 +1,3355 @@ ++/* Driver template for the LEMON parser generator. ++** The author disclaims copyright to this source code. ++*/ ++/* First off, code is included that follows the "include" declaration ++** in the input grammar file. */ ++#include ++#line 33 "ext/sqlite/libsqlite/src/parse.y" ++ ++#include "sqliteInt.h" ++#include "parse.h" ++ ++/* ++** An instance of this structure holds information about the ++** LIMIT clause of a SELECT statement. ++*/ ++struct LimitVal { ++ int limit; /* The LIMIT value. -1 if there is no limit */ ++ int offset; /* The OFFSET. 0 if there is none */ ++}; ++ ++/* ++** An instance of the following structure describes the event of a ++** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT, ++** TK_DELETE, or TK_INSTEAD. If the event is of the form ++** ++** UPDATE ON (a,b,c) ++** ++** Then the "b" IdList records the list "a,b,c". ++*/ ++struct TrigEvent { int a; IdList * b; }; ++ ++#line 33 "ext/sqlite/libsqlite/src/parse.c" ++/* Next is all token values, in a form suitable for use by makeheaders. ++** This section will be null unless lemon is run with the -m switch. ++*/ ++/* ++** These constants (all generated automatically by the parser generator) ++** specify the various kinds of tokens (terminals) that the parser ++** understands. ++** ++** Each symbol here is a terminal symbol in the grammar. ++*/ ++/* Make sure the INTERFACE macro is defined. ++*/ ++#ifndef INTERFACE ++# define INTERFACE 1 ++#endif ++/* The next thing included is series of defines which control ++** various aspects of the generated parser. ++** YYCODETYPE is the data type used for storing terminal ++** and nonterminal numbers. "unsigned char" is ++** used if there are fewer than 250 terminals ++** and nonterminals. "int" is used otherwise. ++** YYNOCODE is a number of type YYCODETYPE which corresponds ++** to no legal terminal or nonterminal number. This ++** number is used to fill in empty slots of the hash ++** table. ++** YYFALLBACK If defined, this indicates that one or more tokens ++** have fall-back values which should be used if the ++** original value of the token will not parse. ++** YYACTIONTYPE is the data type used for storing terminal ++** and nonterminal numbers. "unsigned char" is ++** used if there are fewer than 250 rules and ++** states combined. "int" is used otherwise. ++** sqliteParserTOKENTYPE is the data type used for minor tokens given ++** directly to the parser from the tokenizer. ++** YYMINORTYPE is the data type used for all minor tokens. ++** This is typically a union of many types, one of ++** which is sqliteParserTOKENTYPE. The entry in the union ++** for base tokens is called "yy0". ++** YYSTACKDEPTH is the maximum depth of the parser's stack. If ++** zero the stack is dynamically sized using realloc() ++** sqliteParserARG_SDECL A static variable declaration for the %extra_argument ++** sqliteParserARG_PDECL A parameter declaration for the %extra_argument ++** sqliteParserARG_STORE Code to store %extra_argument into yypParser ++** sqliteParserARG_FETCH Code to extract %extra_argument from yypParser ++** YYNSTATE the combined number of states. ++** YYNRULE the number of rules in the grammar ++** YYERRORSYMBOL is the code number of the error symbol. If not ++** defined, then do no error processing. ++*/ ++#define YYCODETYPE unsigned char ++#define YYNOCODE 221 ++#define YYACTIONTYPE unsigned short int ++#define sqliteParserTOKENTYPE Token ++typedef union { ++ int yyinit; ++ sqliteParserTOKENTYPE yy0; ++ TriggerStep * yy19; ++ struct LimitVal yy124; ++ Select* yy179; ++ Expr * yy182; ++ Expr* yy242; ++ struct TrigEvent yy290; ++ SrcList* yy307; ++ IdList* yy320; ++ ExprList* yy322; ++ int yy372; ++ struct {int value; int mask;} yy407; ++} YYMINORTYPE; ++#ifndef YYSTACKDEPTH ++#define YYSTACKDEPTH 100 ++#endif ++#define sqliteParserARG_SDECL Parse *pParse; ++#define sqliteParserARG_PDECL ,Parse *pParse ++#define sqliteParserARG_FETCH Parse *pParse = yypParser->pParse ++#define sqliteParserARG_STORE yypParser->pParse = pParse ++#define YYNSTATE 563 ++#define YYNRULE 293 ++#define YYFALLBACK 1 ++#define YY_NO_ACTION (YYNSTATE+YYNRULE+2) ++#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) ++#define YY_ERROR_ACTION (YYNSTATE+YYNRULE) ++ ++/* The yyzerominor constant is used to initialize instances of ++** YYMINORTYPE objects to zero. */ ++static const YYMINORTYPE yyzerominor = { 0 }; ++ ++/* Define the yytestcase() macro to be a no-op if is not already defined ++** otherwise. ++** ++** Applications can choose to define yytestcase() in the %include section ++** to a macro that can assist in verifying code coverage. For production ++** code the yytestcase() macro should be turned off. But it is useful ++** for testing. ++*/ ++#ifndef yytestcase ++# define yytestcase(X) ++#endif ++ ++ ++/* Next are the tables used to determine what action to take based on the ++** current state and lookahead token. These tables are used to implement ++** functions that take a state number and lookahead value and return an ++** action integer. ++** ++** Suppose the action integer is N. Then the action is determined as ++** follows ++** ++** 0 <= N < YYNSTATE Shift N. That is, push the lookahead ++** token onto the stack and goto state N. ++** ++** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE. ++** ++** N == YYNSTATE+YYNRULE A syntax error has occurred. ++** ++** N == YYNSTATE+YYNRULE+1 The parser accepts its input. ++** ++** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused ++** slots in the yy_action[] table. ++** ++** The action table is constructed as a single large table named yy_action[]. ++** Given state S and lookahead X, the action is computed as ++** ++** yy_action[ yy_shift_ofst[S] + X ] ++** ++** If the index value yy_shift_ofst[S]+X is out of range or if the value ++** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S] ++** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table ++** and that yy_default[S] should be used instead. ++** ++** The formula above is for computing the action when the lookahead is ++** a terminal symbol. If the lookahead is a non-terminal (as occurs after ++** a reduce action) then the yy_reduce_ofst[] array is used in place of ++** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of ++** YY_SHIFT_USE_DFLT. ++** ++** The following are the tables generated in this section: ++** ++** yy_action[] A single table containing all actions. ++** yy_lookahead[] A table containing the lookahead for each entry in ++** yy_action. Used to detect hash collisions. ++** yy_shift_ofst[] For each state, the offset into yy_action for ++** shifting terminals. ++** yy_reduce_ofst[] For each state, the offset into yy_action for ++** shifting non-terminals after a reduce. ++** yy_default[] Default action for each state. ++*/ ++#define YY_ACTTAB_COUNT (1090) ++static const YYACTIONTYPE yy_action[] = { ++ /* 0 */ 186, 561, 483, 69, 67, 70, 68, 64, 63, 62, ++ /* 10 */ 61, 58, 57, 56, 55, 54, 53, 181, 180, 179, ++ /* 20 */ 514, 421, 334, 420, 468, 515, 64, 63, 62, 61, ++ /* 30 */ 58, 57, 56, 55, 54, 53, 9, 423, 422, 71, ++ /* 40 */ 72, 129, 65, 66, 513, 510, 305, 52, 138, 69, ++ /* 50 */ 67, 70, 68, 64, 63, 62, 61, 58, 57, 56, ++ /* 60 */ 55, 54, 53, 448, 469, 175, 482, 514, 470, 344, ++ /* 70 */ 342, 36, 515, 58, 57, 56, 55, 54, 53, 8, ++ /* 80 */ 341, 281, 285, 307, 437, 178, 71, 72, 129, 65, ++ /* 90 */ 66, 513, 510, 305, 52, 138, 69, 67, 70, 68, ++ /* 100 */ 64, 63, 62, 61, 58, 57, 56, 55, 54, 53, ++ /* 110 */ 130, 362, 360, 508, 507, 267, 551, 436, 298, 297, ++ /* 120 */ 369, 368, 50, 128, 543, 29, 266, 449, 537, 447, ++ /* 130 */ 591, 528, 442, 441, 187, 132, 514, 536, 47, 48, ++ /* 140 */ 472, 515, 122, 427, 331, 409, 49, 371, 370, 518, ++ /* 150 */ 328, 363, 517, 520, 45, 71, 72, 129, 65, 66, ++ /* 160 */ 513, 510, 305, 52, 138, 69, 67, 70, 68, 64, ++ /* 170 */ 63, 62, 61, 58, 57, 56, 55, 54, 53, 185, ++ /* 180 */ 550, 549, 512, 175, 467, 516, 18, 344, 342, 36, ++ /* 190 */ 544, 175, 320, 230, 231, 344, 342, 36, 341, 56, ++ /* 200 */ 55, 54, 53, 212, 531, 514, 341, 551, 3, 213, ++ /* 210 */ 515, 2, 551, 73, 7, 551, 184, 132, 551, 172, ++ /* 220 */ 551, 309, 348, 42, 71, 72, 129, 65, 66, 513, ++ /* 230 */ 510, 305, 52, 138, 69, 67, 70, 68, 64, 63, ++ /* 240 */ 62, 61, 58, 57, 56, 55, 54, 53, 243, 197, ++ /* 250 */ 282, 358, 268, 373, 264, 372, 183, 241, 436, 169, ++ /* 260 */ 356, 171, 269, 240, 471, 426, 29, 446, 506, 514, ++ /* 270 */ 445, 550, 549, 494, 515, 354, 550, 549, 359, 550, ++ /* 280 */ 549, 144, 550, 549, 550, 549, 592, 309, 71, 72, ++ /* 290 */ 129, 65, 66, 513, 510, 305, 52, 138, 69, 67, ++ /* 300 */ 70, 68, 64, 63, 62, 61, 58, 57, 56, 55, ++ /* 310 */ 54, 53, 514, 857, 82, 377, 1, 515, 268, 373, ++ /* 320 */ 264, 372, 183, 241, 362, 12, 508, 507, 500, 240, ++ /* 330 */ 17, 71, 72, 129, 65, 66, 513, 510, 305, 52, ++ /* 340 */ 138, 69, 67, 70, 68, 64, 63, 62, 61, 58, ++ /* 350 */ 57, 56, 55, 54, 53, 362, 182, 508, 507, 514, ++ /* 360 */ 362, 527, 508, 507, 515, 563, 429, 463, 182, 444, ++ /* 370 */ 375, 338, 443, 430, 379, 378, 593, 156, 71, 72, ++ /* 380 */ 129, 65, 66, 513, 510, 305, 52, 138, 69, 67, ++ /* 390 */ 70, 68, 64, 63, 62, 61, 58, 57, 56, 55, ++ /* 400 */ 54, 53, 514, 526, 542, 450, 534, 515, 286, 493, ++ /* 410 */ 453, 17, 478, 240, 80, 11, 533, 153, 194, 155, ++ /* 420 */ 286, 71, 51, 129, 65, 66, 513, 510, 305, 52, ++ /* 430 */ 138, 69, 67, 70, 68, 64, 63, 62, 61, 58, ++ /* 440 */ 57, 56, 55, 54, 53, 514, 195, 466, 160, 17, ++ /* 450 */ 515, 454, 490, 80, 459, 440, 460, 176, 239, 238, ++ /* 460 */ 80, 80, 562, 1, 71, 40, 129, 65, 66, 513, ++ /* 470 */ 510, 305, 52, 138, 69, 67, 70, 68, 64, 63, ++ /* 480 */ 62, 61, 58, 57, 56, 55, 54, 53, 514, 365, ++ /* 490 */ 154, 19, 339, 515, 80, 232, 405, 80, 165, 404, ++ /* 500 */ 193, 32, 396, 13, 32, 86, 414, 108, 72, 129, ++ /* 510 */ 65, 66, 513, 510, 305, 52, 138, 69, 67, 70, ++ /* 520 */ 68, 64, 63, 62, 61, 58, 57, 56, 55, 54, ++ /* 530 */ 53, 514, 551, 365, 483, 192, 515, 488, 323, 207, ++ /* 540 */ 366, 249, 177, 186, 87, 483, 483, 46, 38, 44, ++ /* 550 */ 458, 108, 129, 65, 66, 513, 510, 305, 52, 138, ++ /* 560 */ 69, 67, 70, 68, 64, 63, 62, 61, 58, 57, ++ /* 570 */ 56, 55, 54, 53, 274, 457, 272, 271, 270, 23, ++ /* 580 */ 8, 551, 211, 412, 307, 257, 365, 385, 201, 31, ++ /* 590 */ 217, 388, 141, 205, 387, 219, 550, 549, 482, 511, ++ /* 600 */ 215, 376, 560, 134, 90, 477, 214, 514, 392, 482, ++ /* 610 */ 482, 152, 515, 360, 203, 212, 409, 531, 800, 284, ++ /* 620 */ 365, 145, 505, 50, 300, 365, 365, 173, 321, 212, ++ /* 630 */ 487, 137, 135, 8, 41, 136, 531, 307, 93, 47, ++ /* 640 */ 48, 346, 316, 106, 106, 550, 549, 49, 371, 370, ++ /* 650 */ 518, 509, 531, 517, 520, 504, 531, 531, 162, 495, ++ /* 660 */ 170, 317, 503, 319, 223, 231, 360, 551, 502, 283, ++ /* 670 */ 162, 207, 557, 486, 212, 191, 50, 10, 289, 304, ++ /* 680 */ 303, 556, 207, 531, 8, 531, 516, 18, 307, 498, ++ /* 690 */ 498, 189, 47, 48, 393, 531, 555, 28, 302, 554, ++ /* 700 */ 49, 371, 370, 518, 484, 480, 517, 520, 322, 299, ++ /* 710 */ 553, 418, 365, 323, 17, 365, 365, 360, 416, 207, ++ /* 720 */ 322, 417, 207, 418, 327, 212, 480, 50, 207, 326, ++ /* 730 */ 106, 550, 549, 106, 105, 247, 407, 475, 332, 516, ++ /* 740 */ 18, 326, 365, 47, 48, 207, 295, 365, 475, 294, ++ /* 750 */ 158, 49, 371, 370, 518, 293, 473, 517, 520, 485, ++ /* 760 */ 106, 391, 390, 202, 148, 93, 351, 480, 204, 301, ++ /* 770 */ 333, 190, 291, 541, 60, 531, 498, 252, 453, 498, ++ /* 780 */ 365, 365, 290, 365, 501, 475, 365, 79, 475, 531, ++ /* 790 */ 516, 18, 379, 378, 475, 365, 465, 245, 89, 112, ++ /* 800 */ 365, 109, 365, 131, 121, 288, 499, 365, 365, 439, ++ /* 810 */ 365, 475, 365, 120, 365, 365, 343, 365, 119, 365, ++ /* 820 */ 118, 365, 365, 365, 365, 117, 116, 365, 126, 365, ++ /* 830 */ 125, 365, 124, 123, 365, 115, 365, 114, 431, 140, ++ /* 840 */ 139, 255, 254, 365, 365, 253, 365, 280, 365, 107, ++ /* 850 */ 365, 365, 113, 365, 111, 26, 365, 365, 365, 365, ++ /* 860 */ 365, 279, 278, 365, 277, 365, 92, 365, 104, 103, ++ /* 870 */ 365, 91, 365, 365, 102, 101, 110, 100, 99, 347, ++ /* 880 */ 25, 98, 340, 30, 24, 97, 266, 174, 96, 85, ++ /* 890 */ 95, 94, 166, 292, 78, 165, 415, 14, 163, 60, ++ /* 900 */ 164, 22, 6, 408, 5, 77, 34, 33, 159, 16, ++ /* 910 */ 157, 151, 75, 149, 15, 146, 313, 312, 395, 384, ++ /* 920 */ 143, 20, 60, 206, 21, 273, 198, 559, 375, 548, ++ /* 930 */ 547, 546, 374, 4, 540, 539, 538, 308, 535, 532, ++ /* 940 */ 530, 212, 261, 38, 260, 352, 259, 39, 258, 367, ++ /* 950 */ 529, 196, 210, 256, 521, 522, 53, 53, 209, 43, ++ /* 960 */ 496, 188, 492, 208, 256, 81, 246, 37, 479, 349, ++ /* 970 */ 244, 37, 474, 464, 276, 27, 452, 451, 433, 432, ++ /* 980 */ 275, 235, 234, 335, 424, 35, 329, 413, 410, 127, ++ /* 990 */ 161, 84, 76, 403, 38, 400, 188, 399, 224, 398, ++ /* 1000 */ 38, 150, 318, 220, 83, 147, 315, 200, 381, 383, ++ /* 1010 */ 199, 142, 545, 265, 88, 262, 523, 361, 491, 476, ++ /* 1020 */ 463, 406, 397, 287, 389, 386, 310, 382, 552, 74, ++ /* 1030 */ 306, 525, 524, 364, 519, 357, 355, 353, 497, 489, ++ /* 1040 */ 481, 263, 242, 462, 461, 456, 455, 438, 296, 345, ++ /* 1050 */ 434, 237, 425, 337, 168, 167, 336, 236, 419, 330, ++ /* 1060 */ 233, 325, 324, 229, 228, 402, 401, 227, 226, 225, ++ /* 1070 */ 222, 221, 218, 314, 394, 311, 216, 380, 251, 250, ++ /* 1080 */ 133, 350, 248, 364, 558, 59, 435, 411, 428, 212, ++}; ++static const YYCODETYPE yy_lookahead[] = { ++ /* 0 */ 21, 9, 23, 70, 71, 72, 73, 74, 75, 76, ++ /* 10 */ 77, 78, 79, 80, 81, 82, 83, 100, 101, 102, ++ /* 20 */ 41, 100, 101, 102, 20, 46, 74, 75, 76, 77, ++ /* 30 */ 78, 79, 80, 81, 82, 83, 19, 55, 56, 60, ++ /* 40 */ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, ++ /* 50 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, ++ /* 60 */ 81, 82, 83, 23, 108, 90, 87, 41, 112, 94, ++ /* 70 */ 95, 96, 46, 78, 79, 80, 81, 82, 83, 19, ++ /* 80 */ 105, 149, 143, 23, 152, 153, 60, 61, 62, 63, ++ /* 90 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, ++ /* 100 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, ++ /* 110 */ 31, 107, 52, 109, 110, 93, 23, 140, 78, 79, ++ /* 120 */ 78, 79, 62, 22, 147, 148, 104, 87, 34, 89, ++ /* 130 */ 113, 89, 92, 93, 183, 184, 41, 43, 78, 79, ++ /* 140 */ 80, 46, 165, 166, 205, 53, 86, 87, 88, 89, ++ /* 150 */ 211, 62, 92, 93, 128, 60, 61, 62, 63, 64, ++ /* 160 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ++ /* 170 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 146, ++ /* 180 */ 87, 88, 93, 90, 20, 125, 126, 94, 95, 96, ++ /* 190 */ 20, 90, 100, 101, 102, 94, 95, 96, 105, 80, ++ /* 200 */ 81, 82, 83, 111, 171, 41, 105, 23, 19, 48, ++ /* 210 */ 46, 19, 23, 19, 19, 23, 183, 184, 23, 17, ++ /* 220 */ 23, 62, 189, 128, 60, 61, 62, 63, 64, 65, ++ /* 230 */ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ++ /* 240 */ 76, 77, 78, 79, 80, 81, 82, 83, 20, 90, ++ /* 250 */ 91, 15, 93, 94, 95, 96, 97, 98, 140, 57, ++ /* 260 */ 24, 59, 144, 104, 80, 147, 148, 89, 20, 41, ++ /* 270 */ 92, 87, 88, 20, 46, 39, 87, 88, 42, 87, ++ /* 280 */ 88, 19, 87, 88, 87, 88, 113, 62, 60, 61, ++ /* 290 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, ++ /* 300 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, ++ /* 310 */ 82, 83, 41, 132, 133, 134, 135, 46, 93, 94, ++ /* 320 */ 95, 96, 97, 98, 107, 63, 109, 110, 20, 104, ++ /* 330 */ 22, 60, 61, 62, 63, 64, 65, 66, 67, 68, ++ /* 340 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ++ /* 350 */ 79, 80, 81, 82, 83, 107, 47, 109, 110, 41, ++ /* 360 */ 107, 89, 109, 110, 46, 0, 161, 162, 47, 89, ++ /* 370 */ 99, 62, 92, 168, 9, 10, 113, 17, 60, 61, ++ /* 380 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, ++ /* 390 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, ++ /* 400 */ 82, 83, 41, 89, 155, 156, 26, 46, 99, 20, ++ /* 410 */ 161, 22, 20, 104, 22, 118, 36, 57, 22, 59, ++ /* 420 */ 99, 60, 61, 62, 63, 64, 65, 66, 67, 68, ++ /* 430 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ++ /* 440 */ 79, 80, 81, 82, 83, 41, 50, 20, 22, 22, ++ /* 450 */ 46, 20, 22, 22, 91, 20, 93, 22, 20, 20, ++ /* 460 */ 22, 22, 134, 135, 60, 61, 62, 63, 64, 65, ++ /* 470 */ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ++ /* 480 */ 76, 77, 78, 79, 80, 81, 82, 83, 41, 140, ++ /* 490 */ 130, 22, 20, 46, 22, 20, 20, 22, 22, 20, ++ /* 500 */ 113, 22, 20, 19, 22, 21, 18, 158, 61, 62, ++ /* 510 */ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, ++ /* 520 */ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, ++ /* 530 */ 83, 41, 23, 140, 23, 113, 46, 22, 140, 140, ++ /* 540 */ 191, 192, 19, 21, 114, 23, 23, 127, 122, 129, ++ /* 550 */ 29, 158, 62, 63, 64, 65, 66, 67, 68, 69, ++ /* 560 */ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, ++ /* 570 */ 80, 81, 82, 83, 11, 54, 13, 14, 15, 16, ++ /* 580 */ 19, 23, 174, 95, 23, 192, 140, 78, 79, 181, ++ /* 590 */ 27, 89, 146, 195, 92, 32, 87, 88, 87, 93, ++ /* 600 */ 37, 136, 137, 88, 158, 206, 141, 41, 99, 87, ++ /* 610 */ 87, 146, 46, 52, 51, 111, 53, 171, 130, 19, ++ /* 620 */ 140, 58, 14, 62, 103, 140, 140, 146, 124, 111, ++ /* 630 */ 115, 146, 146, 19, 68, 69, 171, 23, 158, 78, ++ /* 640 */ 79, 80, 124, 158, 158, 87, 88, 86, 87, 88, ++ /* 650 */ 89, 108, 171, 92, 93, 20, 171, 171, 146, 93, ++ /* 660 */ 146, 196, 20, 100, 101, 102, 52, 23, 20, 106, ++ /* 670 */ 146, 140, 15, 115, 111, 22, 62, 118, 198, 194, ++ /* 680 */ 194, 24, 140, 171, 19, 171, 125, 126, 23, 204, ++ /* 690 */ 204, 22, 78, 79, 140, 171, 39, 19, 167, 42, ++ /* 700 */ 86, 87, 88, 89, 115, 152, 92, 93, 196, 167, ++ /* 710 */ 53, 140, 140, 140, 22, 140, 140, 52, 25, 140, ++ /* 720 */ 196, 28, 140, 140, 212, 111, 152, 62, 140, 217, ++ /* 730 */ 158, 87, 88, 158, 158, 182, 212, 206, 45, 125, ++ /* 740 */ 126, 217, 140, 78, 79, 140, 167, 140, 206, 167, ++ /* 750 */ 146, 86, 87, 88, 89, 167, 182, 92, 93, 115, ++ /* 760 */ 158, 207, 208, 209, 146, 158, 194, 152, 195, 194, ++ /* 770 */ 199, 22, 167, 156, 200, 171, 204, 201, 161, 204, ++ /* 780 */ 140, 140, 199, 140, 20, 206, 140, 20, 206, 171, ++ /* 790 */ 125, 126, 9, 10, 206, 140, 20, 182, 158, 158, ++ /* 800 */ 140, 158, 140, 113, 158, 198, 204, 140, 140, 20, ++ /* 810 */ 140, 206, 140, 158, 140, 140, 48, 140, 158, 140, ++ /* 820 */ 158, 140, 140, 140, 140, 158, 158, 140, 158, 140, ++ /* 830 */ 158, 140, 158, 158, 140, 158, 140, 158, 139, 158, ++ /* 840 */ 158, 158, 158, 140, 140, 158, 140, 158, 140, 158, ++ /* 850 */ 140, 140, 158, 140, 158, 19, 140, 140, 140, 140, ++ /* 860 */ 140, 158, 158, 140, 158, 140, 158, 140, 158, 158, ++ /* 870 */ 140, 158, 140, 140, 158, 158, 158, 158, 158, 140, ++ /* 880 */ 19, 158, 48, 158, 19, 158, 104, 97, 158, 21, ++ /* 890 */ 158, 158, 99, 38, 49, 22, 49, 158, 99, 200, ++ /* 900 */ 130, 19, 11, 14, 9, 103, 63, 63, 123, 19, ++ /* 910 */ 114, 114, 103, 123, 19, 114, 116, 35, 87, 20, ++ /* 920 */ 21, 150, 200, 160, 160, 138, 12, 139, 99, 138, ++ /* 930 */ 138, 138, 145, 22, 139, 139, 164, 44, 139, 139, ++ /* 940 */ 171, 111, 176, 122, 177, 119, 178, 120, 179, 117, ++ /* 950 */ 180, 121, 193, 98, 151, 23, 83, 83, 202, 127, ++ /* 960 */ 186, 113, 186, 193, 98, 186, 187, 99, 188, 116, ++ /* 970 */ 187, 99, 188, 139, 159, 19, 151, 164, 139, 139, ++ /* 980 */ 159, 186, 215, 40, 216, 127, 186, 139, 169, 60, ++ /* 990 */ 169, 197, 19, 176, 122, 186, 113, 186, 186, 176, ++ /* 1000 */ 122, 169, 186, 186, 197, 169, 186, 218, 33, 219, ++ /* 1010 */ 116, 218, 142, 157, 173, 175, 157, 203, 157, 157, ++ /* 1020 */ 162, 176, 176, 152, 210, 210, 152, 152, 140, 140, ++ /* 1030 */ 154, 154, 154, 140, 140, 140, 140, 140, 140, 185, ++ /* 1040 */ 140, 172, 140, 140, 163, 163, 163, 152, 154, 154, ++ /* 1050 */ 140, 140, 140, 140, 140, 213, 214, 140, 140, 140, ++ /* 1060 */ 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, ++ /* 1070 */ 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, ++ /* 1080 */ 140, 140, 140, 140, 170, 200, 166, 170, 166, 111, ++}; ++#define YY_SHIFT_USE_DFLT (-84) ++#define YY_SHIFT_COUNT (376) ++#define YY_SHIFT_MIN (-83) ++#define YY_SHIFT_MAX (978) ++static const short yy_shift_ofst[] = { ++ /* 0 */ 783, 563, 614, 614, 93, 92, 92, 978, 614, 561, ++ /* 10 */ 665, 665, 509, 197, -21, 665, 665, 665, 665, 665, ++ /* 20 */ 159, 309, 197, 488, 197, 197, 197, 197, 197, 511, ++ /* 30 */ 271, 60, 665, 665, 665, 665, 665, 665, 665, 665, ++ /* 40 */ 665, 665, 665, 665, 665, 665, 665, 665, 665, 665, ++ /* 50 */ 665, 665, 665, 665, 665, 665, 665, 665, 665, 665, ++ /* 60 */ 665, 665, 665, 665, 665, 665, 665, 665, 665, 665, ++ /* 70 */ 665, 665, 665, 665, 225, 197, 197, 197, 197, 522, ++ /* 80 */ 197, 522, 365, 518, 504, 978, 978, -84, -84, 228, ++ /* 90 */ 164, 95, 26, 318, 318, 318, 318, 318, 318, 318, ++ /* 100 */ 318, 404, 318, 318, 318, 318, 318, 361, 318, 447, ++ /* 110 */ 490, 490, 490, -67, -67, -67, -67, -67, -48, -48, ++ /* 120 */ -48, -48, 101, -5, -5, -5, -5, 657, -25, 566, ++ /* 130 */ 657, 184, 195, 644, 558, 253, 192, 248, 189, 119, ++ /* 140 */ 119, 4, 197, 197, 197, 197, 197, 197, 217, 197, ++ /* 150 */ 197, 197, 217, 197, 197, 197, 197, 197, 217, 197, ++ /* 160 */ 197, 197, 217, 197, 197, 197, 197, -79, 693, 197, ++ /* 170 */ 217, 197, 197, 217, 197, 197, 42, 42, 523, 521, ++ /* 180 */ 521, 521, 197, 197, 515, 217, 197, 515, 197, 197, ++ /* 190 */ 197, 197, 197, 197, 42, 42, 42, 197, 197, 511, ++ /* 200 */ 511, 502, 502, 511, 426, 426, 321, 380, 380, 420, ++ /* 210 */ 380, 430, -44, 380, 484, 975, 894, 975, 883, 929, ++ /* 220 */ 973, 883, 883, 929, 878, 883, 883, 883, 872, 973, ++ /* 230 */ 929, 929, 829, 848, 858, 943, 848, 956, 829, 829, ++ /* 240 */ 893, 932, 956, 829, 853, 872, 853, 868, 848, 866, ++ /* 250 */ 848, 848, 832, 874, 874, 873, 932, 855, 830, 832, ++ /* 260 */ 827, 826, 821, 830, 829, 829, 893, 829, 829, 911, ++ /* 270 */ 914, 914, 914, 829, 914, -84, -84, -84, -84, -84, ++ /* 280 */ -84, -84, 40, 360, 236, 202, -83, 262, 482, 479, ++ /* 290 */ 476, 475, -18, 472, 439, 438, 435, 280, 178, 431, ++ /* 300 */ 363, 427, 392, 389, 308, 89, 396, 17, 94, 22, ++ /* 310 */ 899, 899, 831, 882, 800, 801, 895, 790, 809, 797, ++ /* 320 */ 796, 890, 785, 844, 843, 802, 895, 889, 891, 882, ++ /* 330 */ 799, 770, 847, 873, 845, 855, 793, 868, 782, 790, ++ /* 340 */ 865, 834, 861, 836, 768, 789, 776, 690, 767, 678, ++ /* 350 */ 589, 692, 559, 764, 669, 648, 749, 642, 653, 635, ++ /* 360 */ 600, 608, 543, 506, 422, 387, 469, 297, 314, 272, ++ /* 370 */ 263, 173, 194, 161, 170, 79, -8, ++}; ++#define YY_REDUCE_USE_DFLT (-69) ++#define YY_REDUCE_COUNT (281) ++#define YY_REDUCE_MIN (-68) ++#define YY_REDUCE_MAX (943) ++static const short yy_reduce_ofst[] = { ++ /* 0 */ 181, 465, 486, 485, -23, 524, 512, 33, 446, 575, ++ /* 10 */ 572, 349, 554, 118, 574, 607, 480, 602, 576, 393, ++ /* 20 */ 249, 205, 605, -61, 588, 582, 579, 542, 531, -68, ++ /* 30 */ 699, 739, 733, 732, 730, 727, 725, 723, 720, 719, ++ /* 40 */ 718, 717, 716, 713, 711, 710, 708, 706, 704, 703, ++ /* 50 */ 696, 694, 691, 689, 687, 684, 683, 682, 681, 679, ++ /* 60 */ 677, 675, 674, 672, 670, 668, 667, 662, 660, 655, ++ /* 70 */ 646, 643, 641, 640, 617, 573, 583, 398, 571, 615, ++ /* 80 */ 399, 553, 328, 618, 604, 514, 481, -49, 408, 722, ++ /* 90 */ 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, ++ /* 100 */ 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, ++ /* 110 */ 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, ++ /* 120 */ 722, 722, 922, 722, 722, 722, 722, 917, 920, 885, ++ /* 130 */ 914, 943, 942, 941, 940, 869, 939, 869, 938, 722, ++ /* 140 */ 722, 869, 937, 936, 935, 934, 933, 932, 869, 931, ++ /* 150 */ 930, 929, 869, 928, 927, 926, 925, 924, 869, 923, ++ /* 160 */ 922, 921, 869, 920, 919, 918, 917, 842, 842, 914, ++ /* 170 */ 869, 913, 912, 869, 911, 910, 895, 894, 895, 883, ++ /* 180 */ 882, 881, 903, 902, 854, 869, 900, 854, 898, 897, ++ /* 190 */ 896, 895, 894, 893, 878, 877, 876, 889, 888, 875, ++ /* 200 */ 874, 815, 814, 871, 846, 845, 858, 862, 861, 814, ++ /* 210 */ 859, 840, 841, 856, 870, 793, 790, 789, 820, 836, ++ /* 220 */ 807, 817, 816, 832, 823, 812, 811, 809, 817, 794, ++ /* 230 */ 821, 819, 848, 800, 768, 767, 795, 821, 840, 839, ++ /* 240 */ 813, 825, 815, 834, 784, 783, 780, 779, 779, 770, ++ /* 250 */ 776, 774, 756, 722, 722, 722, 803, 759, 770, 769, ++ /* 260 */ 768, 767, 766, 769, 800, 799, 772, 796, 795, 787, ++ /* 270 */ 793, 792, 791, 788, 787, 764, 763, 722, 722, 722, ++ /* 280 */ 722, 771, ++}; ++static const YYACTIONTYPE yy_default[] = { ++ /* 0 */ 570, 856, 797, 797, 856, 839, 839, 685, 856, 797, ++ /* 10 */ 797, 856, 822, 856, 681, 856, 856, 797, 793, 856, ++ /* 20 */ 586, 649, 856, 581, 856, 856, 856, 856, 856, 594, ++ /* 30 */ 651, 856, 856, 856, 856, 856, 856, 856, 856, 856, ++ /* 40 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, ++ /* 50 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, ++ /* 60 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, ++ /* 70 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 681, ++ /* 80 */ 856, 681, 570, 856, 856, 856, 856, 685, 675, 856, ++ /* 90 */ 856, 856, 856, 730, 729, 724, 723, 837, 697, 721, ++ /* 100 */ 714, 856, 789, 790, 788, 792, 796, 856, 705, 748, ++ /* 110 */ 780, 774, 747, 779, 760, 759, 754, 753, 752, 751, ++ /* 120 */ 750, 749, 640, 758, 757, 756, 755, 856, 856, 856, ++ /* 130 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 764, ++ /* 140 */ 763, 856, 856, 856, 856, 809, 856, 856, 726, 856, ++ /* 150 */ 856, 856, 663, 856, 856, 856, 856, 856, 842, 856, ++ /* 160 */ 856, 856, 844, 856, 856, 856, 856, 856, 828, 856, ++ /* 170 */ 661, 856, 856, 583, 856, 856, 856, 856, 595, 856, ++ /* 180 */ 856, 856, 856, 856, 689, 688, 856, 683, 856, 856, ++ /* 190 */ 856, 856, 856, 856, 856, 856, 856, 856, 573, 856, ++ /* 200 */ 856, 856, 856, 856, 720, 720, 621, 708, 708, 791, ++ /* 210 */ 708, 682, 673, 708, 856, 854, 852, 854, 690, 653, ++ /* 220 */ 731, 690, 690, 653, 720, 690, 690, 690, 720, 731, ++ /* 230 */ 653, 653, 651, 690, 836, 833, 690, 801, 651, 651, ++ /* 240 */ 636, 856, 801, 651, 700, 698, 700, 698, 690, 709, ++ /* 250 */ 690, 690, 856, 767, 766, 765, 856, 709, 715, 701, ++ /* 260 */ 713, 711, 720, 856, 651, 651, 636, 651, 651, 639, ++ /* 270 */ 572, 572, 572, 651, 572, 624, 624, 777, 776, 775, ++ /* 280 */ 768, 604, 856, 856, 856, 856, 856, 816, 856, 856, ++ /* 290 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, ++ /* 300 */ 856, 856, 856, 856, 856, 856, 716, 737, 856, 856, ++ /* 310 */ 856, 856, 856, 856, 808, 856, 856, 856, 856, 856, ++ /* 320 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, ++ /* 330 */ 856, 856, 856, 832, 831, 856, 856, 856, 856, 856, ++ /* 340 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, ++ /* 350 */ 856, 712, 856, 856, 856, 856, 856, 856, 856, 856, ++ /* 360 */ 856, 856, 666, 856, 739, 856, 702, 856, 856, 856, ++ /* 370 */ 738, 743, 856, 856, 856, 856, 856, 565, 569, 567, ++ /* 380 */ 855, 853, 851, 850, 815, 821, 818, 820, 819, 817, ++ /* 390 */ 814, 813, 812, 811, 810, 807, 725, 722, 719, 849, ++ /* 400 */ 806, 662, 660, 843, 841, 732, 840, 838, 823, 728, ++ /* 410 */ 727, 654, 799, 798, 580, 827, 826, 825, 734, 733, ++ /* 420 */ 830, 829, 835, 834, 824, 579, 585, 643, 642, 650, ++ /* 430 */ 648, 647, 646, 645, 644, 641, 587, 598, 599, 597, ++ /* 440 */ 596, 615, 612, 614, 611, 613, 610, 609, 608, 607, ++ /* 450 */ 606, 635, 623, 622, 802, 629, 628, 633, 632, 631, ++ /* 460 */ 630, 627, 626, 625, 620, 746, 745, 735, 778, 672, ++ /* 470 */ 671, 678, 677, 676, 687, 804, 805, 803, 699, 686, ++ /* 480 */ 680, 679, 590, 589, 696, 695, 694, 693, 692, 684, ++ /* 490 */ 674, 704, 786, 783, 784, 772, 785, 691, 795, 794, ++ /* 500 */ 781, 848, 847, 846, 845, 787, 782, 669, 668, 667, ++ /* 510 */ 771, 773, 770, 769, 762, 761, 744, 742, 741, 740, ++ /* 520 */ 736, 710, 588, 703, 718, 717, 602, 601, 600, 670, ++ /* 530 */ 665, 664, 619, 707, 706, 618, 638, 637, 634, 617, ++ /* 540 */ 616, 605, 603, 584, 582, 578, 577, 576, 575, 593, ++ /* 550 */ 592, 591, 574, 659, 658, 657, 656, 655, 652, 571, ++ /* 560 */ 568, 566, 564, ++}; ++ ++/* The next table maps tokens into fallback tokens. If a construct ++** like the following: ++** ++** %fallback ID X Y Z. ++** ++** appears in the grammar, then ID becomes a fallback token for X, Y, ++** and Z. Whenever one of the tokens X, Y, or Z is input to the parser ++** but it does not parse, the type of the token is changed to ID and ++** the parse is retried before an error is thrown. ++*/ ++#ifdef YYFALLBACK ++static const YYCODETYPE yyFallback[] = { ++ 0, /* $ => nothing */ ++ 0, /* END_OF_FILE => nothing */ ++ 0, /* ILLEGAL => nothing */ ++ 0, /* SPACE => nothing */ ++ 0, /* UNCLOSED_STRING => nothing */ ++ 0, /* COMMENT => nothing */ ++ 0, /* FUNCTION => nothing */ ++ 0, /* COLUMN => nothing */ ++ 0, /* AGG_FUNCTION => nothing */ ++ 0, /* SEMI => nothing */ ++ 23, /* EXPLAIN => ID */ ++ 23, /* BEGIN => ID */ ++ 0, /* TRANSACTION => nothing */ ++ 0, /* COMMIT => nothing */ ++ 23, /* END => ID */ ++ 0, /* ROLLBACK => nothing */ ++ 0, /* CREATE => nothing */ ++ 0, /* TABLE => nothing */ ++ 23, /* TEMP => ID */ ++ 0, /* LP => nothing */ ++ 0, /* RP => nothing */ ++ 0, /* AS => nothing */ ++ 0, /* COMMA => nothing */ ++ 0, /* ID => nothing */ ++ 23, /* ABORT => ID */ ++ 23, /* AFTER => ID */ ++ 23, /* ASC => ID */ ++ 23, /* ATTACH => ID */ ++ 23, /* BEFORE => ID */ ++ 23, /* CASCADE => ID */ ++ 23, /* CLUSTER => ID */ ++ 23, /* CONFLICT => ID */ ++ 23, /* COPY => ID */ ++ 23, /* DATABASE => ID */ ++ 23, /* DEFERRED => ID */ ++ 23, /* DELIMITERS => ID */ ++ 23, /* DESC => ID */ ++ 23, /* DETACH => ID */ ++ 23, /* EACH => ID */ ++ 23, /* FAIL => ID */ ++ 23, /* FOR => ID */ ++ 23, /* GLOB => ID */ ++ 23, /* IGNORE => ID */ ++ 23, /* IMMEDIATE => ID */ ++ 23, /* INITIALLY => ID */ ++ 23, /* INSTEAD => ID */ ++ 23, /* LIKE => ID */ ++ 23, /* MATCH => ID */ ++ 23, /* KEY => ID */ ++ 23, /* OF => ID */ ++ 23, /* OFFSET => ID */ ++ 23, /* PRAGMA => ID */ ++ 23, /* RAISE => ID */ ++ 23, /* REPLACE => ID */ ++ 23, /* RESTRICT => ID */ ++ 23, /* ROW => ID */ ++ 23, /* STATEMENT => ID */ ++ 23, /* TRIGGER => ID */ ++ 23, /* VACUUM => ID */ ++ 23, /* VIEW => ID */ ++}; ++#endif /* YYFALLBACK */ ++ ++/* The following structure represents a single element of the ++** parser's stack. Information stored includes: ++** ++** + The state number for the parser at this level of the stack. ++** ++** + The value of the token stored at this level of the stack. ++** (In other words, the "major" token.) ++** ++** + The semantic value stored at this level of the stack. This is ++** the information used by the action routines in the grammar. ++** It is sometimes called the "minor" token. ++*/ ++struct yyStackEntry { ++ YYACTIONTYPE stateno; /* The state-number */ ++ YYCODETYPE major; /* The major token value. This is the code ++ ** number for the token at this stack level */ ++ YYMINORTYPE minor; /* The user-supplied minor token value. This ++ ** is the value of the token */ ++}; ++typedef struct yyStackEntry yyStackEntry; ++ ++/* The state of the parser is completely contained in an instance of ++** the following structure */ ++struct yyParser { ++ int yyidx; /* Index of top element in stack */ ++#ifdef YYTRACKMAXSTACKDEPTH ++ int yyidxMax; /* Maximum value of yyidx */ ++#endif ++ int yyerrcnt; /* Shifts left before out of the error */ ++ sqliteParserARG_SDECL /* A place to hold %extra_argument */ ++#if YYSTACKDEPTH<=0 ++ int yystksz; /* Current side of the stack */ ++ yyStackEntry *yystack; /* The parser's stack */ ++#else ++ yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ ++#endif ++}; ++typedef struct yyParser yyParser; ++ ++#ifndef NDEBUG ++#include ++static FILE *yyTraceFILE = 0; ++static char *yyTracePrompt = 0; ++#endif /* NDEBUG */ ++ ++#ifndef NDEBUG ++/* ++** Turn parser tracing on by giving a stream to which to write the trace ++** and a prompt to preface each trace message. Tracing is turned off ++** by making either argument NULL ++** ++** Inputs: ++**
      ++**
    • A FILE* to which trace output should be written. ++** If NULL, then tracing is turned off. ++**
    • A prefix string written at the beginning of every ++** line of trace output. If NULL, then tracing is ++** turned off. ++**
    ++** ++** Outputs: ++** None. ++*/ ++void sqliteParserTrace(FILE *TraceFILE, char *zTracePrompt){ ++ yyTraceFILE = TraceFILE; ++ yyTracePrompt = zTracePrompt; ++ if( yyTraceFILE==0 ) yyTracePrompt = 0; ++ else if( yyTracePrompt==0 ) yyTraceFILE = 0; ++} ++#endif /* NDEBUG */ ++ ++#ifndef NDEBUG ++/* For tracing shifts, the names of all terminals and nonterminals ++** are required. The following table supplies these names */ ++static const char *const yyTokenName[] = { ++ "$", "END_OF_FILE", "ILLEGAL", "SPACE", ++ "UNCLOSED_STRING", "COMMENT", "FUNCTION", "COLUMN", ++ "AGG_FUNCTION", "SEMI", "EXPLAIN", "BEGIN", ++ "TRANSACTION", "COMMIT", "END", "ROLLBACK", ++ "CREATE", "TABLE", "TEMP", "LP", ++ "RP", "AS", "COMMA", "ID", ++ "ABORT", "AFTER", "ASC", "ATTACH", ++ "BEFORE", "CASCADE", "CLUSTER", "CONFLICT", ++ "COPY", "DATABASE", "DEFERRED", "DELIMITERS", ++ "DESC", "DETACH", "EACH", "FAIL", ++ "FOR", "GLOB", "IGNORE", "IMMEDIATE", ++ "INITIALLY", "INSTEAD", "LIKE", "MATCH", ++ "KEY", "OF", "OFFSET", "PRAGMA", ++ "RAISE", "REPLACE", "RESTRICT", "ROW", ++ "STATEMENT", "TRIGGER", "VACUUM", "VIEW", ++ "OR", "AND", "NOT", "EQ", ++ "NE", "ISNULL", "NOTNULL", "IS", ++ "BETWEEN", "IN", "GT", "GE", ++ "LT", "LE", "BITAND", "BITOR", ++ "LSHIFT", "RSHIFT", "PLUS", "MINUS", ++ "STAR", "SLASH", "REM", "CONCAT", ++ "UMINUS", "UPLUS", "BITNOT", "STRING", ++ "JOIN_KW", "INTEGER", "CONSTRAINT", "DEFAULT", ++ "FLOAT", "NULL", "PRIMARY", "UNIQUE", ++ "CHECK", "REFERENCES", "COLLATE", "ON", ++ "DELETE", "UPDATE", "INSERT", "SET", ++ "DEFERRABLE", "FOREIGN", "DROP", "UNION", ++ "ALL", "INTERSECT", "EXCEPT", "SELECT", ++ "DISTINCT", "DOT", "FROM", "JOIN", ++ "USING", "ORDER", "BY", "GROUP", ++ "HAVING", "LIMIT", "WHERE", "INTO", ++ "VALUES", "VARIABLE", "CASE", "WHEN", ++ "THEN", "ELSE", "INDEX", "error", ++ "input", "cmdlist", "ecmd", "explain", ++ "cmdx", "cmd", "trans_opt", "onconf", ++ "nm", "create_table", "create_table_args", "temp", ++ "columnlist", "conslist_opt", "select", "column", ++ "columnid", "type", "carglist", "id", ++ "ids", "typename", "signed", "carg", ++ "ccons", "sortorder", "expr", "idxlist_opt", ++ "refargs", "defer_subclause", "refarg", "refact", ++ "init_deferred_pred_opt", "conslist", "tcons", "idxlist", ++ "defer_subclause_opt", "orconf", "resolvetype", "oneselect", ++ "multiselect_op", "distinct", "selcollist", "from", ++ "where_opt", "groupby_opt", "having_opt", "orderby_opt", ++ "limit_opt", "sclp", "as", "seltablist", ++ "stl_prefix", "joinop", "dbnm", "on_opt", ++ "using_opt", "seltablist_paren", "joinop2", "sortlist", ++ "sortitem", "collate", "exprlist", "setlist", ++ "insert_cmd", "inscollist_opt", "itemlist", "inscollist", ++ "likeop", "case_operand", "case_exprlist", "case_else", ++ "expritem", "uniqueflag", "idxitem", "plus_num", ++ "minus_num", "plus_opt", "number", "trigger_decl", ++ "trigger_cmd_list", "trigger_time", "trigger_event", "foreach_clause", ++ "when_clause", "trigger_cmd", "database_kw_opt", "key_opt", ++}; ++#endif /* NDEBUG */ ++ ++#ifndef NDEBUG ++/* For tracing reduce actions, the names of all rules are required. ++*/ ++static const char *const yyRuleName[] = { ++ /* 0 */ "input ::= cmdlist", ++ /* 1 */ "cmdlist ::= cmdlist ecmd", ++ /* 2 */ "cmdlist ::= ecmd", ++ /* 3 */ "ecmd ::= explain cmdx SEMI", ++ /* 4 */ "ecmd ::= SEMI", ++ /* 5 */ "cmdx ::= cmd", ++ /* 6 */ "explain ::= EXPLAIN", ++ /* 7 */ "explain ::=", ++ /* 8 */ "cmd ::= BEGIN trans_opt onconf", ++ /* 9 */ "trans_opt ::=", ++ /* 10 */ "trans_opt ::= TRANSACTION", ++ /* 11 */ "trans_opt ::= TRANSACTION nm", ++ /* 12 */ "cmd ::= COMMIT trans_opt", ++ /* 13 */ "cmd ::= END trans_opt", ++ /* 14 */ "cmd ::= ROLLBACK trans_opt", ++ /* 15 */ "cmd ::= create_table create_table_args", ++ /* 16 */ "create_table ::= CREATE temp TABLE nm", ++ /* 17 */ "temp ::= TEMP", ++ /* 18 */ "temp ::=", ++ /* 19 */ "create_table_args ::= LP columnlist conslist_opt RP", ++ /* 20 */ "create_table_args ::= AS select", ++ /* 21 */ "columnlist ::= columnlist COMMA column", ++ /* 22 */ "columnlist ::= column", ++ /* 23 */ "column ::= columnid type carglist", ++ /* 24 */ "columnid ::= nm", ++ /* 25 */ "id ::= ID", ++ /* 26 */ "ids ::= ID", ++ /* 27 */ "ids ::= STRING", ++ /* 28 */ "nm ::= ID", ++ /* 29 */ "nm ::= STRING", ++ /* 30 */ "nm ::= JOIN_KW", ++ /* 31 */ "type ::=", ++ /* 32 */ "type ::= typename", ++ /* 33 */ "type ::= typename LP signed RP", ++ /* 34 */ "type ::= typename LP signed COMMA signed RP", ++ /* 35 */ "typename ::= ids", ++ /* 36 */ "typename ::= typename ids", ++ /* 37 */ "signed ::= INTEGER", ++ /* 38 */ "signed ::= PLUS INTEGER", ++ /* 39 */ "signed ::= MINUS INTEGER", ++ /* 40 */ "carglist ::= carglist carg", ++ /* 41 */ "carglist ::=", ++ /* 42 */ "carg ::= CONSTRAINT nm ccons", ++ /* 43 */ "carg ::= ccons", ++ /* 44 */ "carg ::= DEFAULT STRING", ++ /* 45 */ "carg ::= DEFAULT ID", ++ /* 46 */ "carg ::= DEFAULT INTEGER", ++ /* 47 */ "carg ::= DEFAULT PLUS INTEGER", ++ /* 48 */ "carg ::= DEFAULT MINUS INTEGER", ++ /* 49 */ "carg ::= DEFAULT FLOAT", ++ /* 50 */ "carg ::= DEFAULT PLUS FLOAT", ++ /* 51 */ "carg ::= DEFAULT MINUS FLOAT", ++ /* 52 */ "carg ::= DEFAULT NULL", ++ /* 53 */ "ccons ::= NULL onconf", ++ /* 54 */ "ccons ::= NOT NULL onconf", ++ /* 55 */ "ccons ::= PRIMARY KEY sortorder onconf", ++ /* 56 */ "ccons ::= UNIQUE onconf", ++ /* 57 */ "ccons ::= CHECK LP expr RP onconf", ++ /* 58 */ "ccons ::= REFERENCES nm idxlist_opt refargs", ++ /* 59 */ "ccons ::= defer_subclause", ++ /* 60 */ "ccons ::= COLLATE id", ++ /* 61 */ "refargs ::=", ++ /* 62 */ "refargs ::= refargs refarg", ++ /* 63 */ "refarg ::= MATCH nm", ++ /* 64 */ "refarg ::= ON DELETE refact", ++ /* 65 */ "refarg ::= ON UPDATE refact", ++ /* 66 */ "refarg ::= ON INSERT refact", ++ /* 67 */ "refact ::= SET NULL", ++ /* 68 */ "refact ::= SET DEFAULT", ++ /* 69 */ "refact ::= CASCADE", ++ /* 70 */ "refact ::= RESTRICT", ++ /* 71 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt", ++ /* 72 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt", ++ /* 73 */ "init_deferred_pred_opt ::=", ++ /* 74 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED", ++ /* 75 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE", ++ /* 76 */ "conslist_opt ::=", ++ /* 77 */ "conslist_opt ::= COMMA conslist", ++ /* 78 */ "conslist ::= conslist COMMA tcons", ++ /* 79 */ "conslist ::= conslist tcons", ++ /* 80 */ "conslist ::= tcons", ++ /* 81 */ "tcons ::= CONSTRAINT nm", ++ /* 82 */ "tcons ::= PRIMARY KEY LP idxlist RP onconf", ++ /* 83 */ "tcons ::= UNIQUE LP idxlist RP onconf", ++ /* 84 */ "tcons ::= CHECK expr onconf", ++ /* 85 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt", ++ /* 86 */ "defer_subclause_opt ::=", ++ /* 87 */ "defer_subclause_opt ::= defer_subclause", ++ /* 88 */ "onconf ::=", ++ /* 89 */ "onconf ::= ON CONFLICT resolvetype", ++ /* 90 */ "orconf ::=", ++ /* 91 */ "orconf ::= OR resolvetype", ++ /* 92 */ "resolvetype ::= ROLLBACK", ++ /* 93 */ "resolvetype ::= ABORT", ++ /* 94 */ "resolvetype ::= FAIL", ++ /* 95 */ "resolvetype ::= IGNORE", ++ /* 96 */ "resolvetype ::= REPLACE", ++ /* 97 */ "cmd ::= DROP TABLE nm", ++ /* 98 */ "cmd ::= CREATE temp VIEW nm AS select", ++ /* 99 */ "cmd ::= DROP VIEW nm", ++ /* 100 */ "cmd ::= select", ++ /* 101 */ "select ::= oneselect", ++ /* 102 */ "select ::= select multiselect_op oneselect", ++ /* 103 */ "multiselect_op ::= UNION", ++ /* 104 */ "multiselect_op ::= UNION ALL", ++ /* 105 */ "multiselect_op ::= INTERSECT", ++ /* 106 */ "multiselect_op ::= EXCEPT", ++ /* 107 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt", ++ /* 108 */ "distinct ::= DISTINCT", ++ /* 109 */ "distinct ::= ALL", ++ /* 110 */ "distinct ::=", ++ /* 111 */ "sclp ::= selcollist COMMA", ++ /* 112 */ "sclp ::=", ++ /* 113 */ "selcollist ::= sclp expr as", ++ /* 114 */ "selcollist ::= sclp STAR", ++ /* 115 */ "selcollist ::= sclp nm DOT STAR", ++ /* 116 */ "as ::= AS nm", ++ /* 117 */ "as ::= ids", ++ /* 118 */ "as ::=", ++ /* 119 */ "from ::=", ++ /* 120 */ "from ::= FROM seltablist", ++ /* 121 */ "stl_prefix ::= seltablist joinop", ++ /* 122 */ "stl_prefix ::=", ++ /* 123 */ "seltablist ::= stl_prefix nm dbnm as on_opt using_opt", ++ /* 124 */ "seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt", ++ /* 125 */ "seltablist_paren ::= select", ++ /* 126 */ "seltablist_paren ::= seltablist", ++ /* 127 */ "dbnm ::=", ++ /* 128 */ "dbnm ::= DOT nm", ++ /* 129 */ "joinop ::= COMMA", ++ /* 130 */ "joinop ::= JOIN", ++ /* 131 */ "joinop ::= JOIN_KW JOIN", ++ /* 132 */ "joinop ::= JOIN_KW nm JOIN", ++ /* 133 */ "joinop ::= JOIN_KW nm nm JOIN", ++ /* 134 */ "on_opt ::= ON expr", ++ /* 135 */ "on_opt ::=", ++ /* 136 */ "using_opt ::= USING LP idxlist RP", ++ /* 137 */ "using_opt ::=", ++ /* 138 */ "orderby_opt ::=", ++ /* 139 */ "orderby_opt ::= ORDER BY sortlist", ++ /* 140 */ "sortlist ::= sortlist COMMA sortitem collate sortorder", ++ /* 141 */ "sortlist ::= sortitem collate sortorder", ++ /* 142 */ "sortitem ::= expr", ++ /* 143 */ "sortorder ::= ASC", ++ /* 144 */ "sortorder ::= DESC", ++ /* 145 */ "sortorder ::=", ++ /* 146 */ "collate ::=", ++ /* 147 */ "collate ::= COLLATE id", ++ /* 148 */ "groupby_opt ::=", ++ /* 149 */ "groupby_opt ::= GROUP BY exprlist", ++ /* 150 */ "having_opt ::=", ++ /* 151 */ "having_opt ::= HAVING expr", ++ /* 152 */ "limit_opt ::=", ++ /* 153 */ "limit_opt ::= LIMIT signed", ++ /* 154 */ "limit_opt ::= LIMIT signed OFFSET signed", ++ /* 155 */ "limit_opt ::= LIMIT signed COMMA signed", ++ /* 156 */ "cmd ::= DELETE FROM nm dbnm where_opt", ++ /* 157 */ "where_opt ::=", ++ /* 158 */ "where_opt ::= WHERE expr", ++ /* 159 */ "cmd ::= UPDATE orconf nm dbnm SET setlist where_opt", ++ /* 160 */ "setlist ::= setlist COMMA nm EQ expr", ++ /* 161 */ "setlist ::= nm EQ expr", ++ /* 162 */ "cmd ::= insert_cmd INTO nm dbnm inscollist_opt VALUES LP itemlist RP", ++ /* 163 */ "cmd ::= insert_cmd INTO nm dbnm inscollist_opt select", ++ /* 164 */ "insert_cmd ::= INSERT orconf", ++ /* 165 */ "insert_cmd ::= REPLACE", ++ /* 166 */ "itemlist ::= itemlist COMMA expr", ++ /* 167 */ "itemlist ::= expr", ++ /* 168 */ "inscollist_opt ::=", ++ /* 169 */ "inscollist_opt ::= LP inscollist RP", ++ /* 170 */ "inscollist ::= inscollist COMMA nm", ++ /* 171 */ "inscollist ::= nm", ++ /* 172 */ "expr ::= LP expr RP", ++ /* 173 */ "expr ::= NULL", ++ /* 174 */ "expr ::= ID", ++ /* 175 */ "expr ::= JOIN_KW", ++ /* 176 */ "expr ::= nm DOT nm", ++ /* 177 */ "expr ::= nm DOT nm DOT nm", ++ /* 178 */ "expr ::= INTEGER", ++ /* 179 */ "expr ::= FLOAT", ++ /* 180 */ "expr ::= STRING", ++ /* 181 */ "expr ::= VARIABLE", ++ /* 182 */ "expr ::= ID LP exprlist RP", ++ /* 183 */ "expr ::= ID LP STAR RP", ++ /* 184 */ "expr ::= expr AND expr", ++ /* 185 */ "expr ::= expr OR expr", ++ /* 186 */ "expr ::= expr LT expr", ++ /* 187 */ "expr ::= expr GT expr", ++ /* 188 */ "expr ::= expr LE expr", ++ /* 189 */ "expr ::= expr GE expr", ++ /* 190 */ "expr ::= expr NE expr", ++ /* 191 */ "expr ::= expr EQ expr", ++ /* 192 */ "expr ::= expr BITAND expr", ++ /* 193 */ "expr ::= expr BITOR expr", ++ /* 194 */ "expr ::= expr LSHIFT expr", ++ /* 195 */ "expr ::= expr RSHIFT expr", ++ /* 196 */ "expr ::= expr likeop expr", ++ /* 197 */ "expr ::= expr NOT likeop expr", ++ /* 198 */ "likeop ::= LIKE", ++ /* 199 */ "likeop ::= GLOB", ++ /* 200 */ "expr ::= expr PLUS expr", ++ /* 201 */ "expr ::= expr MINUS expr", ++ /* 202 */ "expr ::= expr STAR expr", ++ /* 203 */ "expr ::= expr SLASH expr", ++ /* 204 */ "expr ::= expr REM expr", ++ /* 205 */ "expr ::= expr CONCAT expr", ++ /* 206 */ "expr ::= expr ISNULL", ++ /* 207 */ "expr ::= expr IS NULL", ++ /* 208 */ "expr ::= expr NOTNULL", ++ /* 209 */ "expr ::= expr NOT NULL", ++ /* 210 */ "expr ::= expr IS NOT NULL", ++ /* 211 */ "expr ::= NOT expr", ++ /* 212 */ "expr ::= BITNOT expr", ++ /* 213 */ "expr ::= MINUS expr", ++ /* 214 */ "expr ::= PLUS expr", ++ /* 215 */ "expr ::= LP select RP", ++ /* 216 */ "expr ::= expr BETWEEN expr AND expr", ++ /* 217 */ "expr ::= expr NOT BETWEEN expr AND expr", ++ /* 218 */ "expr ::= expr IN LP exprlist RP", ++ /* 219 */ "expr ::= expr IN LP select RP", ++ /* 220 */ "expr ::= expr NOT IN LP exprlist RP", ++ /* 221 */ "expr ::= expr NOT IN LP select RP", ++ /* 222 */ "expr ::= expr IN nm dbnm", ++ /* 223 */ "expr ::= expr NOT IN nm dbnm", ++ /* 224 */ "expr ::= CASE case_operand case_exprlist case_else END", ++ /* 225 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", ++ /* 226 */ "case_exprlist ::= WHEN expr THEN expr", ++ /* 227 */ "case_else ::= ELSE expr", ++ /* 228 */ "case_else ::=", ++ /* 229 */ "case_operand ::= expr", ++ /* 230 */ "case_operand ::=", ++ /* 231 */ "exprlist ::= exprlist COMMA expritem", ++ /* 232 */ "exprlist ::= expritem", ++ /* 233 */ "expritem ::= expr", ++ /* 234 */ "expritem ::=", ++ /* 235 */ "cmd ::= CREATE uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf", ++ /* 236 */ "uniqueflag ::= UNIQUE", ++ /* 237 */ "uniqueflag ::=", ++ /* 238 */ "idxlist_opt ::=", ++ /* 239 */ "idxlist_opt ::= LP idxlist RP", ++ /* 240 */ "idxlist ::= idxlist COMMA idxitem", ++ /* 241 */ "idxlist ::= idxitem", ++ /* 242 */ "idxitem ::= nm sortorder", ++ /* 243 */ "cmd ::= DROP INDEX nm dbnm", ++ /* 244 */ "cmd ::= COPY orconf nm dbnm FROM nm USING DELIMITERS STRING", ++ /* 245 */ "cmd ::= COPY orconf nm dbnm FROM nm", ++ /* 246 */ "cmd ::= VACUUM", ++ /* 247 */ "cmd ::= VACUUM nm", ++ /* 248 */ "cmd ::= PRAGMA ids EQ nm", ++ /* 249 */ "cmd ::= PRAGMA ids EQ ON", ++ /* 250 */ "cmd ::= PRAGMA ids EQ plus_num", ++ /* 251 */ "cmd ::= PRAGMA ids EQ minus_num", ++ /* 252 */ "cmd ::= PRAGMA ids LP nm RP", ++ /* 253 */ "cmd ::= PRAGMA ids", ++ /* 254 */ "plus_num ::= plus_opt number", ++ /* 255 */ "minus_num ::= MINUS number", ++ /* 256 */ "number ::= INTEGER", ++ /* 257 */ "number ::= FLOAT", ++ /* 258 */ "plus_opt ::= PLUS", ++ /* 259 */ "plus_opt ::=", ++ /* 260 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END", ++ /* 261 */ "trigger_decl ::= temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause", ++ /* 262 */ "trigger_time ::= BEFORE", ++ /* 263 */ "trigger_time ::= AFTER", ++ /* 264 */ "trigger_time ::= INSTEAD OF", ++ /* 265 */ "trigger_time ::=", ++ /* 266 */ "trigger_event ::= DELETE", ++ /* 267 */ "trigger_event ::= INSERT", ++ /* 268 */ "trigger_event ::= UPDATE", ++ /* 269 */ "trigger_event ::= UPDATE OF inscollist", ++ /* 270 */ "foreach_clause ::=", ++ /* 271 */ "foreach_clause ::= FOR EACH ROW", ++ /* 272 */ "foreach_clause ::= FOR EACH STATEMENT", ++ /* 273 */ "when_clause ::=", ++ /* 274 */ "when_clause ::= WHEN expr", ++ /* 275 */ "trigger_cmd_list ::= trigger_cmd SEMI trigger_cmd_list", ++ /* 276 */ "trigger_cmd_list ::=", ++ /* 277 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt", ++ /* 278 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP", ++ /* 279 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select", ++ /* 280 */ "trigger_cmd ::= DELETE FROM nm where_opt", ++ /* 281 */ "trigger_cmd ::= select", ++ /* 282 */ "expr ::= RAISE LP IGNORE RP", ++ /* 283 */ "expr ::= RAISE LP ROLLBACK COMMA nm RP", ++ /* 284 */ "expr ::= RAISE LP ABORT COMMA nm RP", ++ /* 285 */ "expr ::= RAISE LP FAIL COMMA nm RP", ++ /* 286 */ "cmd ::= DROP TRIGGER nm dbnm", ++ /* 287 */ "cmd ::= ATTACH database_kw_opt ids AS nm key_opt", ++ /* 288 */ "key_opt ::= USING ids", ++ /* 289 */ "key_opt ::=", ++ /* 290 */ "database_kw_opt ::= DATABASE", ++ /* 291 */ "database_kw_opt ::=", ++ /* 292 */ "cmd ::= DETACH database_kw_opt nm", ++}; ++#endif /* NDEBUG */ ++ ++ ++#if YYSTACKDEPTH<=0 ++/* ++** Try to increase the size of the parser stack. ++*/ ++static void yyGrowStack(yyParser *p){ ++ int newSize; ++ yyStackEntry *pNew; ++ ++ newSize = p->yystksz*2 + 100; ++ pNew = realloc(p->yystack, newSize*sizeof(pNew[0])); ++ if( pNew ){ ++ p->yystack = pNew; ++ p->yystksz = newSize; ++#ifndef NDEBUG ++ if( yyTraceFILE ){ ++ fprintf(yyTraceFILE,"%sStack grows to %d entries!\n", ++ yyTracePrompt, p->yystksz); ++ } ++#endif ++ } ++} ++#endif ++ ++/* ++** This function allocates a new parser. ++** The only argument is a pointer to a function which works like ++** malloc. ++** ++** Inputs: ++** A pointer to the function used to allocate memory. ++** ++** Outputs: ++** A pointer to a parser. This pointer is used in subsequent calls ++** to sqliteParser and sqliteParserFree. ++*/ ++void *sqliteParserAlloc(void *(*mallocProc)(size_t)){ ++ yyParser *pParser; ++ pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) ); ++ if( pParser ){ ++ pParser->yyidx = -1; ++#ifdef YYTRACKMAXSTACKDEPTH ++ pParser->yyidxMax = 0; ++#endif ++#if YYSTACKDEPTH<=0 ++ pParser->yystack = NULL; ++ pParser->yystksz = 0; ++ yyGrowStack(pParser); ++#endif ++ } ++ return pParser; ++} ++ ++/* The following function deletes the value associated with a ++** symbol. The symbol can be either a terminal or nonterminal. ++** "yymajor" is the symbol code, and "yypminor" is a pointer to ++** the value. ++*/ ++static void yy_destructor( ++ yyParser *yypParser, /* The parser */ ++ YYCODETYPE yymajor, /* Type code for object to destroy */ ++ YYMINORTYPE *yypminor /* The object to be destroyed */ ++){ ++ sqliteParserARG_FETCH; ++ switch( yymajor ){ ++ /* Here is inserted the actions which take place when a ++ ** terminal or non-terminal is destroyed. This can happen ++ ** when the symbol is popped from the stack during a ++ ** reduce or during error processing or when a parser is ++ ** being destroyed before it is finished parsing. ++ ** ++ ** Note: during a reduce, the only symbols destroyed are those ++ ** which appear on the RHS of the rule, but which are not used ++ ** inside the C code. ++ */ ++ case 146: /* select */ ++ case 171: /* oneselect */ ++ case 189: /* seltablist_paren */ ++{ ++#line 286 "ext/sqlite/libsqlite/src/parse.y" ++sqliteSelectDelete((yypminor->yy179)); ++#line 1131 "ext/sqlite/libsqlite/src/parse.c" ++} ++ break; ++ case 158: /* expr */ ++ case 176: /* where_opt */ ++ case 178: /* having_opt */ ++ case 187: /* on_opt */ ++ case 192: /* sortitem */ ++ case 204: /* expritem */ ++{ ++#line 533 "ext/sqlite/libsqlite/src/parse.y" ++sqliteExprDelete((yypminor->yy242)); ++#line 1143 "ext/sqlite/libsqlite/src/parse.c" ++} ++ break; ++ case 159: /* idxlist_opt */ ++ case 167: /* idxlist */ ++ case 188: /* using_opt */ ++ case 197: /* inscollist_opt */ ++ case 199: /* inscollist */ ++{ ++#line 746 "ext/sqlite/libsqlite/src/parse.y" ++sqliteIdListDelete((yypminor->yy320)); ++#line 1154 "ext/sqlite/libsqlite/src/parse.c" ++} ++ break; ++ case 174: /* selcollist */ ++ case 177: /* groupby_opt */ ++ case 179: /* orderby_opt */ ++ case 181: /* sclp */ ++ case 191: /* sortlist */ ++ case 194: /* exprlist */ ++ case 195: /* setlist */ ++ case 198: /* itemlist */ ++ case 202: /* case_exprlist */ ++{ ++#line 322 "ext/sqlite/libsqlite/src/parse.y" ++sqliteExprListDelete((yypminor->yy322)); ++#line 1169 "ext/sqlite/libsqlite/src/parse.c" ++} ++ break; ++ case 175: /* from */ ++ case 183: /* seltablist */ ++ case 184: /* stl_prefix */ ++{ ++#line 353 "ext/sqlite/libsqlite/src/parse.y" ++sqliteSrcListDelete((yypminor->yy307)); ++#line 1178 "ext/sqlite/libsqlite/src/parse.c" ++} ++ break; ++ case 212: /* trigger_cmd_list */ ++ case 217: /* trigger_cmd */ ++{ ++#line 828 "ext/sqlite/libsqlite/src/parse.y" ++sqliteDeleteTriggerStep((yypminor->yy19)); ++#line 1186 "ext/sqlite/libsqlite/src/parse.c" ++} ++ break; ++ case 214: /* trigger_event */ ++{ ++#line 812 "ext/sqlite/libsqlite/src/parse.y" ++sqliteIdListDelete((yypminor->yy290).b); ++#line 1193 "ext/sqlite/libsqlite/src/parse.c" ++} ++ break; ++ default: break; /* If no destructor action specified: do nothing */ ++ } ++} ++ ++/* ++** Pop the parser's stack once. ++** ++** If there is a destructor routine associated with the token which ++** is popped from the stack, then call it. ++** ++** Return the major token number for the symbol popped. ++*/ ++static int yy_pop_parser_stack(yyParser *pParser){ ++ YYCODETYPE yymajor; ++ yyStackEntry *yytos = &pParser->yystack[pParser->yyidx]; ++ ++ if( pParser->yyidx<0 ) return 0; ++#ifndef NDEBUG ++ if( yyTraceFILE && pParser->yyidx>=0 ){ ++ fprintf(yyTraceFILE,"%sPopping %s\n", ++ yyTracePrompt, ++ yyTokenName[yytos->major]); ++ } ++#endif ++ yymajor = yytos->major; ++ yy_destructor(pParser, yymajor, &yytos->minor); ++ pParser->yyidx--; ++ return yymajor; ++} ++ ++/* ++** Deallocate and destroy a parser. Destructors are all called for ++** all stack elements before shutting the parser down. ++** ++** Inputs: ++**
      ++**
    • A pointer to the parser. This should be a pointer ++** obtained from sqliteParserAlloc. ++**
    • A pointer to a function used to reclaim memory obtained ++** from malloc. ++**
    ++*/ ++void sqliteParserFree( ++ void *p, /* The parser to be deleted */ ++ void (*freeProc)(void*) /* Function used to reclaim memory */ ++){ ++ yyParser *pParser = (yyParser*)p; ++ if( pParser==0 ) return; ++ while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser); ++#if YYSTACKDEPTH<=0 ++ free(pParser->yystack); ++#endif ++ (*freeProc)((void*)pParser); ++} ++ ++/* ++** Return the peak depth of the stack for a parser. ++*/ ++#ifdef YYTRACKMAXSTACKDEPTH ++int sqliteParserStackPeak(void *p){ ++ yyParser *pParser = (yyParser*)p; ++ return pParser->yyidxMax; ++} ++#endif ++ ++/* ++** Find the appropriate action for a parser given the terminal ++** look-ahead token iLookAhead. ++** ++** If the look-ahead token is YYNOCODE, then check to see if the action is ++** independent of the look-ahead. If it is, return the action, otherwise ++** return YY_NO_ACTION. ++*/ ++static int yy_find_shift_action( ++ yyParser *pParser, /* The parser */ ++ YYCODETYPE iLookAhead /* The look-ahead token */ ++){ ++ int i; ++ int stateno = pParser->yystack[pParser->yyidx].stateno; ++ ++ if( stateno>YY_SHIFT_COUNT ++ || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){ ++ return yy_default[stateno]; ++ } ++ assert( iLookAhead!=YYNOCODE ); ++ i += iLookAhead; ++ if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ ++ if( iLookAhead>0 ){ ++#ifdef YYFALLBACK ++ YYCODETYPE iFallback; /* Fallback token */ ++ if( iLookAhead %s\n", ++ yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); ++ } ++#endif ++ return yy_find_shift_action(pParser, iFallback); ++ } ++#endif ++#ifdef YYWILDCARD ++ { ++ int j = i - iLookAhead + YYWILDCARD; ++ if( ++#if YY_SHIFT_MIN+YYWILDCARD<0 ++ j>=0 && ++#endif ++#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT ++ j %s\n", ++ yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]); ++ } ++#endif /* NDEBUG */ ++ return yy_action[j]; ++ } ++ } ++#endif /* YYWILDCARD */ ++ } ++ return yy_default[stateno]; ++ }else{ ++ return yy_action[i]; ++ } ++} ++ ++/* ++** Find the appropriate action for a parser given the non-terminal ++** look-ahead token iLookAhead. ++** ++** If the look-ahead token is YYNOCODE, then check to see if the action is ++** independent of the look-ahead. If it is, return the action, otherwise ++** return YY_NO_ACTION. ++*/ ++static int yy_find_reduce_action( ++ int stateno, /* Current state number */ ++ YYCODETYPE iLookAhead /* The look-ahead token */ ++){ ++ int i; ++#ifdef YYERRORSYMBOL ++ if( stateno>YY_REDUCE_COUNT ){ ++ return yy_default[stateno]; ++ } ++#else ++ assert( stateno<=YY_REDUCE_COUNT ); ++#endif ++ i = yy_reduce_ofst[stateno]; ++ assert( i!=YY_REDUCE_USE_DFLT ); ++ assert( iLookAhead!=YYNOCODE ); ++ i += iLookAhead; ++#ifdef YYERRORSYMBOL ++ if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ ++ return yy_default[stateno]; ++ } ++#else ++ assert( i>=0 && iyyidx--; ++#ifndef NDEBUG ++ if( yyTraceFILE ){ ++ fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); ++ } ++#endif ++ while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); ++ /* Here code is inserted which will execute if the parser ++ ** stack every overflows */ ++ sqliteParserARG_STORE; /* Suppress warning about unused %extra_argument var */ ++} ++ ++/* ++** Perform a shift action. ++*/ ++static void yy_shift( ++ yyParser *yypParser, /* The parser to be shifted */ ++ int yyNewState, /* The new state to shift in */ ++ int yyMajor, /* The major token to shift in */ ++ YYMINORTYPE *yypMinor /* Pointer to the minor token to shift in */ ++){ ++ yyStackEntry *yytos; ++ yypParser->yyidx++; ++#ifdef YYTRACKMAXSTACKDEPTH ++ if( yypParser->yyidx>yypParser->yyidxMax ){ ++ yypParser->yyidxMax = yypParser->yyidx; ++ } ++#endif ++#if YYSTACKDEPTH>0 ++ if( yypParser->yyidx>=YYSTACKDEPTH ){ ++ yyStackOverflow(yypParser, yypMinor); ++ return; ++ } ++#else ++ if( yypParser->yyidx>=yypParser->yystksz ){ ++ yyGrowStack(yypParser); ++ if( yypParser->yyidx>=yypParser->yystksz ){ ++ yyStackOverflow(yypParser, yypMinor); ++ return; ++ } ++ } ++#endif ++ yytos = &yypParser->yystack[yypParser->yyidx]; ++ yytos->stateno = (YYACTIONTYPE)yyNewState; ++ yytos->major = (YYCODETYPE)yyMajor; ++ yytos->minor = *yypMinor; ++#ifndef NDEBUG ++ if( yyTraceFILE && yypParser->yyidx>0 ){ ++ int i; ++ fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState); ++ fprintf(yyTraceFILE,"%sStack:",yyTracePrompt); ++ for(i=1; i<=yypParser->yyidx; i++) ++ fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]); ++ fprintf(yyTraceFILE,"\n"); ++ } ++#endif ++} ++ ++/* The following table contains information about every rule that ++** is used during the reduce. ++*/ ++static const struct { ++ YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ ++ unsigned char nrhs; /* Number of right-hand side symbols in the rule */ ++} yyRuleInfo[] = { ++ { 132, 1 }, ++ { 133, 2 }, ++ { 133, 1 }, ++ { 134, 3 }, ++ { 134, 1 }, ++ { 136, 1 }, ++ { 135, 1 }, ++ { 135, 0 }, ++ { 137, 3 }, ++ { 138, 0 }, ++ { 138, 1 }, ++ { 138, 2 }, ++ { 137, 2 }, ++ { 137, 2 }, ++ { 137, 2 }, ++ { 137, 2 }, ++ { 141, 4 }, ++ { 143, 1 }, ++ { 143, 0 }, ++ { 142, 4 }, ++ { 142, 2 }, ++ { 144, 3 }, ++ { 144, 1 }, ++ { 147, 3 }, ++ { 148, 1 }, ++ { 151, 1 }, ++ { 152, 1 }, ++ { 152, 1 }, ++ { 140, 1 }, ++ { 140, 1 }, ++ { 140, 1 }, ++ { 149, 0 }, ++ { 149, 1 }, ++ { 149, 4 }, ++ { 149, 6 }, ++ { 153, 1 }, ++ { 153, 2 }, ++ { 154, 1 }, ++ { 154, 2 }, ++ { 154, 2 }, ++ { 150, 2 }, ++ { 150, 0 }, ++ { 155, 3 }, ++ { 155, 1 }, ++ { 155, 2 }, ++ { 155, 2 }, ++ { 155, 2 }, ++ { 155, 3 }, ++ { 155, 3 }, ++ { 155, 2 }, ++ { 155, 3 }, ++ { 155, 3 }, ++ { 155, 2 }, ++ { 156, 2 }, ++ { 156, 3 }, ++ { 156, 4 }, ++ { 156, 2 }, ++ { 156, 5 }, ++ { 156, 4 }, ++ { 156, 1 }, ++ { 156, 2 }, ++ { 160, 0 }, ++ { 160, 2 }, ++ { 162, 2 }, ++ { 162, 3 }, ++ { 162, 3 }, ++ { 162, 3 }, ++ { 163, 2 }, ++ { 163, 2 }, ++ { 163, 1 }, ++ { 163, 1 }, ++ { 161, 3 }, ++ { 161, 2 }, ++ { 164, 0 }, ++ { 164, 2 }, ++ { 164, 2 }, ++ { 145, 0 }, ++ { 145, 2 }, ++ { 165, 3 }, ++ { 165, 2 }, ++ { 165, 1 }, ++ { 166, 2 }, ++ { 166, 6 }, ++ { 166, 5 }, ++ { 166, 3 }, ++ { 166, 10 }, ++ { 168, 0 }, ++ { 168, 1 }, ++ { 139, 0 }, ++ { 139, 3 }, ++ { 169, 0 }, ++ { 169, 2 }, ++ { 170, 1 }, ++ { 170, 1 }, ++ { 170, 1 }, ++ { 170, 1 }, ++ { 170, 1 }, ++ { 137, 3 }, ++ { 137, 6 }, ++ { 137, 3 }, ++ { 137, 1 }, ++ { 146, 1 }, ++ { 146, 3 }, ++ { 172, 1 }, ++ { 172, 2 }, ++ { 172, 1 }, ++ { 172, 1 }, ++ { 171, 9 }, ++ { 173, 1 }, ++ { 173, 1 }, ++ { 173, 0 }, ++ { 181, 2 }, ++ { 181, 0 }, ++ { 174, 3 }, ++ { 174, 2 }, ++ { 174, 4 }, ++ { 182, 2 }, ++ { 182, 1 }, ++ { 182, 0 }, ++ { 175, 0 }, ++ { 175, 2 }, ++ { 184, 2 }, ++ { 184, 0 }, ++ { 183, 6 }, ++ { 183, 7 }, ++ { 189, 1 }, ++ { 189, 1 }, ++ { 186, 0 }, ++ { 186, 2 }, ++ { 185, 1 }, ++ { 185, 1 }, ++ { 185, 2 }, ++ { 185, 3 }, ++ { 185, 4 }, ++ { 187, 2 }, ++ { 187, 0 }, ++ { 188, 4 }, ++ { 188, 0 }, ++ { 179, 0 }, ++ { 179, 3 }, ++ { 191, 5 }, ++ { 191, 3 }, ++ { 192, 1 }, ++ { 157, 1 }, ++ { 157, 1 }, ++ { 157, 0 }, ++ { 193, 0 }, ++ { 193, 2 }, ++ { 177, 0 }, ++ { 177, 3 }, ++ { 178, 0 }, ++ { 178, 2 }, ++ { 180, 0 }, ++ { 180, 2 }, ++ { 180, 4 }, ++ { 180, 4 }, ++ { 137, 5 }, ++ { 176, 0 }, ++ { 176, 2 }, ++ { 137, 7 }, ++ { 195, 5 }, ++ { 195, 3 }, ++ { 137, 9 }, ++ { 137, 6 }, ++ { 196, 2 }, ++ { 196, 1 }, ++ { 198, 3 }, ++ { 198, 1 }, ++ { 197, 0 }, ++ { 197, 3 }, ++ { 199, 3 }, ++ { 199, 1 }, ++ { 158, 3 }, ++ { 158, 1 }, ++ { 158, 1 }, ++ { 158, 1 }, ++ { 158, 3 }, ++ { 158, 5 }, ++ { 158, 1 }, ++ { 158, 1 }, ++ { 158, 1 }, ++ { 158, 1 }, ++ { 158, 4 }, ++ { 158, 4 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 4 }, ++ { 200, 1 }, ++ { 200, 1 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 3 }, ++ { 158, 2 }, ++ { 158, 3 }, ++ { 158, 2 }, ++ { 158, 3 }, ++ { 158, 4 }, ++ { 158, 2 }, ++ { 158, 2 }, ++ { 158, 2 }, ++ { 158, 2 }, ++ { 158, 3 }, ++ { 158, 5 }, ++ { 158, 6 }, ++ { 158, 5 }, ++ { 158, 5 }, ++ { 158, 6 }, ++ { 158, 6 }, ++ { 158, 4 }, ++ { 158, 5 }, ++ { 158, 5 }, ++ { 202, 5 }, ++ { 202, 4 }, ++ { 203, 2 }, ++ { 203, 0 }, ++ { 201, 1 }, ++ { 201, 0 }, ++ { 194, 3 }, ++ { 194, 1 }, ++ { 204, 1 }, ++ { 204, 0 }, ++ { 137, 11 }, ++ { 205, 1 }, ++ { 205, 0 }, ++ { 159, 0 }, ++ { 159, 3 }, ++ { 167, 3 }, ++ { 167, 1 }, ++ { 206, 2 }, ++ { 137, 4 }, ++ { 137, 9 }, ++ { 137, 6 }, ++ { 137, 1 }, ++ { 137, 2 }, ++ { 137, 4 }, ++ { 137, 4 }, ++ { 137, 4 }, ++ { 137, 4 }, ++ { 137, 5 }, ++ { 137, 2 }, ++ { 207, 2 }, ++ { 208, 2 }, ++ { 210, 1 }, ++ { 210, 1 }, ++ { 209, 1 }, ++ { 209, 0 }, ++ { 137, 5 }, ++ { 211, 10 }, ++ { 213, 1 }, ++ { 213, 1 }, ++ { 213, 2 }, ++ { 213, 0 }, ++ { 214, 1 }, ++ { 214, 1 }, ++ { 214, 1 }, ++ { 214, 3 }, ++ { 215, 0 }, ++ { 215, 3 }, ++ { 215, 3 }, ++ { 216, 0 }, ++ { 216, 2 }, ++ { 212, 3 }, ++ { 212, 0 }, ++ { 217, 6 }, ++ { 217, 8 }, ++ { 217, 5 }, ++ { 217, 4 }, ++ { 217, 1 }, ++ { 158, 4 }, ++ { 158, 6 }, ++ { 158, 6 }, ++ { 158, 6 }, ++ { 137, 4 }, ++ { 137, 6 }, ++ { 219, 2 }, ++ { 219, 0 }, ++ { 218, 1 }, ++ { 218, 0 }, ++ { 137, 3 }, ++}; ++ ++static void yy_accept(yyParser*); /* Forward Declaration */ ++ ++/* ++** Perform a reduce action and the shift that must immediately ++** follow the reduce. ++*/ ++static void yy_reduce( ++ yyParser *yypParser, /* The parser */ ++ int yyruleno /* Number of the rule by which to reduce */ ++){ ++ int yygoto; /* The next state */ ++ int yyact; /* The next action */ ++ YYMINORTYPE yygotominor; /* The LHS of the rule reduced */ ++ yyStackEntry *yymsp; /* The top of the parser's stack */ ++ int yysize; /* Amount to pop the stack */ ++ sqliteParserARG_FETCH; ++ yymsp = &yypParser->yystack[yypParser->yyidx]; ++#ifndef NDEBUG ++ if( yyTraceFILE && yyruleno>=0 ++ && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ ++ fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt, ++ yyRuleName[yyruleno]); ++ } ++#endif /* NDEBUG */ ++ ++ /* Silence complaints from purify about yygotominor being uninitialized ++ ** in some cases when it is copied into the stack after the following ++ ** switch. yygotominor is uninitialized when a rule reduces that does ++ ** not set the value of its left-hand side nonterminal. Leaving the ++ ** value of the nonterminal uninitialized is utterly harmless as long ++ ** as the value is never used. So really the only thing this code ++ ** accomplishes is to quieten purify. ++ ** ++ ** 2007-01-16: The wireshark project (www.wireshark.org) reports that ++ ** without this code, their parser segfaults. I'm not sure what there ++ ** parser is doing to make this happen. This is the second bug report ++ ** from wireshark this week. Clearly they are stressing Lemon in ways ++ ** that it has not been previously stressed... (SQLite ticket #2172) ++ */ ++ /*memset(&yygotominor, 0, sizeof(yygotominor));*/ ++ yygotominor = yyzerominor; ++ ++ ++ switch( yyruleno ){ ++ /* Beginning here are the reduction cases. A typical example ++ ** follows: ++ ** case 0: ++ ** #line ++ ** { ... } // User supplied code ++ ** #line ++ ** break; ++ */ ++ case 5: /* cmdx ::= cmd */ ++#line 72 "ext/sqlite/libsqlite/src/parse.y" ++{ sqliteExec(pParse); } ++#line 1781 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 6: /* explain ::= EXPLAIN */ ++#line 73 "ext/sqlite/libsqlite/src/parse.y" ++{ sqliteBeginParse(pParse, 1); } ++#line 1786 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 7: /* explain ::= */ ++#line 74 "ext/sqlite/libsqlite/src/parse.y" ++{ sqliteBeginParse(pParse, 0); } ++#line 1791 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 8: /* cmd ::= BEGIN trans_opt onconf */ ++#line 79 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteBeginTransaction(pParse,yymsp[0].minor.yy372);} ++#line 1796 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 12: /* cmd ::= COMMIT trans_opt */ ++ case 13: /* cmd ::= END trans_opt */ yytestcase(yyruleno==13); ++#line 83 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteCommitTransaction(pParse);} ++#line 1802 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 14: /* cmd ::= ROLLBACK trans_opt */ ++#line 85 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteRollbackTransaction(pParse);} ++#line 1807 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 16: /* create_table ::= CREATE temp TABLE nm */ ++#line 90 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ sqliteStartTable(pParse,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0,yymsp[-2].minor.yy372,0); ++} ++#line 1814 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 17: /* temp ::= TEMP */ ++ case 74: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==74); ++ case 108: /* distinct ::= DISTINCT */ yytestcase(yyruleno==108); ++#line 94 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy372 = 1;} ++#line 1821 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 18: /* temp ::= */ ++ case 73: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==73); ++ case 75: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(yyruleno==75); ++ case 86: /* defer_subclause_opt ::= */ yytestcase(yyruleno==86); ++ case 109: /* distinct ::= ALL */ yytestcase(yyruleno==109); ++ case 110: /* distinct ::= */ yytestcase(yyruleno==110); ++#line 95 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy372 = 0;} ++#line 1831 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 19: /* create_table_args ::= LP columnlist conslist_opt RP */ ++#line 96 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ sqliteEndTable(pParse,&yymsp[0].minor.yy0,0); ++} ++#line 1838 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 20: /* create_table_args ::= AS select */ ++#line 99 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ sqliteEndTable(pParse,0,yymsp[0].minor.yy179); ++ sqliteSelectDelete(yymsp[0].minor.yy179); ++} ++#line 1846 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 24: /* columnid ::= nm */ ++#line 111 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteAddColumn(pParse,&yymsp[0].minor.yy0);} ++#line 1851 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 25: /* id ::= ID */ ++ case 26: /* ids ::= ID */ yytestcase(yyruleno==26); ++ case 27: /* ids ::= STRING */ yytestcase(yyruleno==27); ++ case 28: /* nm ::= ID */ yytestcase(yyruleno==28); ++ case 29: /* nm ::= STRING */ yytestcase(yyruleno==29); ++ case 30: /* nm ::= JOIN_KW */ yytestcase(yyruleno==30); ++ case 35: /* typename ::= ids */ yytestcase(yyruleno==35); ++ case 128: /* dbnm ::= DOT nm */ yytestcase(yyruleno==128); ++ case 254: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==254); ++ case 255: /* minus_num ::= MINUS number */ yytestcase(yyruleno==255); ++ case 256: /* number ::= INTEGER */ yytestcase(yyruleno==256); ++ case 257: /* number ::= FLOAT */ yytestcase(yyruleno==257); ++#line 117 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy0 = yymsp[0].minor.yy0;} ++#line 1867 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 32: /* type ::= typename */ ++#line 160 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteAddColumnType(pParse,&yymsp[0].minor.yy0,&yymsp[0].minor.yy0);} ++#line 1872 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 33: /* type ::= typename LP signed RP */ ++#line 161 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteAddColumnType(pParse,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);} ++#line 1877 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 34: /* type ::= typename LP signed COMMA signed RP */ ++#line 163 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteAddColumnType(pParse,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);} ++#line 1882 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 36: /* typename ::= typename ids */ ++ case 242: /* idxitem ::= nm sortorder */ yytestcase(yyruleno==242); ++#line 166 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy0 = yymsp[-1].minor.yy0;} ++#line 1888 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 37: /* signed ::= INTEGER */ ++ case 38: /* signed ::= PLUS INTEGER */ yytestcase(yyruleno==38); ++#line 168 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = atoi(yymsp[0].minor.yy0.z); } ++#line 1894 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 39: /* signed ::= MINUS INTEGER */ ++#line 170 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = -atoi(yymsp[0].minor.yy0.z); } ++#line 1899 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 44: /* carg ::= DEFAULT STRING */ ++ case 45: /* carg ::= DEFAULT ID */ yytestcase(yyruleno==45); ++ case 46: /* carg ::= DEFAULT INTEGER */ yytestcase(yyruleno==46); ++ case 47: /* carg ::= DEFAULT PLUS INTEGER */ yytestcase(yyruleno==47); ++ case 49: /* carg ::= DEFAULT FLOAT */ yytestcase(yyruleno==49); ++ case 50: /* carg ::= DEFAULT PLUS FLOAT */ yytestcase(yyruleno==50); ++#line 175 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,0);} ++#line 1909 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 48: /* carg ::= DEFAULT MINUS INTEGER */ ++ case 51: /* carg ::= DEFAULT MINUS FLOAT */ yytestcase(yyruleno==51); ++#line 179 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,1);} ++#line 1915 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 54: /* ccons ::= NOT NULL onconf */ ++#line 189 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteAddNotNull(pParse, yymsp[0].minor.yy372);} ++#line 1920 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 55: /* ccons ::= PRIMARY KEY sortorder onconf */ ++#line 190 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteAddPrimaryKey(pParse,0,yymsp[0].minor.yy372);} ++#line 1925 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 56: /* ccons ::= UNIQUE onconf */ ++#line 191 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteCreateIndex(pParse,0,0,0,yymsp[0].minor.yy372,0,0);} ++#line 1930 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 57: /* ccons ::= CHECK LP expr RP onconf */ ++#line 192 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yy_destructor(yypParser,158,&yymsp[-2].minor); ++} ++#line 1937 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 58: /* ccons ::= REFERENCES nm idxlist_opt refargs */ ++#line 194 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteCreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy320,yymsp[0].minor.yy372);} ++#line 1942 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 59: /* ccons ::= defer_subclause */ ++#line 195 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteDeferForeignKey(pParse,yymsp[0].minor.yy372);} ++#line 1947 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 60: /* ccons ::= COLLATE id */ ++#line 196 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ sqliteAddCollateType(pParse, sqliteCollateType(yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n)); ++} ++#line 1954 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 61: /* refargs ::= */ ++#line 206 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = OE_Restrict * 0x010101; } ++#line 1959 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 62: /* refargs ::= refargs refarg */ ++#line 207 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = (yymsp[-1].minor.yy372 & yymsp[0].minor.yy407.mask) | yymsp[0].minor.yy407.value; } ++#line 1964 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 63: /* refarg ::= MATCH nm */ ++#line 209 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy407.value = 0; yygotominor.yy407.mask = 0x000000; } ++#line 1969 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 64: /* refarg ::= ON DELETE refact */ ++#line 210 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy407.value = yymsp[0].minor.yy372; yygotominor.yy407.mask = 0x0000ff; } ++#line 1974 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 65: /* refarg ::= ON UPDATE refact */ ++#line 211 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy407.value = yymsp[0].minor.yy372<<8; yygotominor.yy407.mask = 0x00ff00; } ++#line 1979 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 66: /* refarg ::= ON INSERT refact */ ++#line 212 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy407.value = yymsp[0].minor.yy372<<16; yygotominor.yy407.mask = 0xff0000; } ++#line 1984 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 67: /* refact ::= SET NULL */ ++#line 214 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = OE_SetNull; } ++#line 1989 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 68: /* refact ::= SET DEFAULT */ ++#line 215 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = OE_SetDflt; } ++#line 1994 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 69: /* refact ::= CASCADE */ ++#line 216 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = OE_Cascade; } ++#line 1999 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 70: /* refact ::= RESTRICT */ ++#line 217 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = OE_Restrict; } ++#line 2004 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 71: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ ++ case 72: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==72); ++ case 87: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==87); ++ case 164: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==164); ++#line 219 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy372 = yymsp[0].minor.yy372;} ++#line 2012 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 82: /* tcons ::= PRIMARY KEY LP idxlist RP onconf */ ++#line 236 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteAddPrimaryKey(pParse,yymsp[-2].minor.yy320,yymsp[0].minor.yy372);} ++#line 2017 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 83: /* tcons ::= UNIQUE LP idxlist RP onconf */ ++#line 238 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteCreateIndex(pParse,0,0,yymsp[-2].minor.yy320,yymsp[0].minor.yy372,0,0);} ++#line 2022 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 84: /* tcons ::= CHECK expr onconf */ ++#line 239 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yy_destructor(yypParser,158,&yymsp[-1].minor); ++} ++#line 2029 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 85: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */ ++#line 241 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ sqliteCreateForeignKey(pParse, yymsp[-6].minor.yy320, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy320, yymsp[-1].minor.yy372); ++ sqliteDeferForeignKey(pParse, yymsp[0].minor.yy372); ++} ++#line 2037 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 88: /* onconf ::= */ ++ case 90: /* orconf ::= */ yytestcase(yyruleno==90); ++#line 255 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = OE_Default; } ++#line 2043 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 89: /* onconf ::= ON CONFLICT resolvetype */ ++ case 91: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==91); ++#line 256 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = yymsp[0].minor.yy372; } ++#line 2049 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 92: /* resolvetype ::= ROLLBACK */ ++#line 259 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = OE_Rollback; } ++#line 2054 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 93: /* resolvetype ::= ABORT */ ++ case 236: /* uniqueflag ::= UNIQUE */ yytestcase(yyruleno==236); ++#line 260 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = OE_Abort; } ++#line 2060 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 94: /* resolvetype ::= FAIL */ ++#line 261 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = OE_Fail; } ++#line 2065 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 95: /* resolvetype ::= IGNORE */ ++#line 262 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = OE_Ignore; } ++#line 2070 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 96: /* resolvetype ::= REPLACE */ ++#line 263 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = OE_Replace; } ++#line 2075 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 97: /* cmd ::= DROP TABLE nm */ ++#line 267 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteDropTable(pParse,&yymsp[0].minor.yy0,0);} ++#line 2080 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 98: /* cmd ::= CREATE temp VIEW nm AS select */ ++#line 271 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ sqliteCreateView(pParse, &yymsp[-5].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy179, yymsp[-4].minor.yy372); ++} ++#line 2087 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 99: /* cmd ::= DROP VIEW nm */ ++#line 274 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ sqliteDropTable(pParse, &yymsp[0].minor.yy0, 1); ++} ++#line 2094 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 100: /* cmd ::= select */ ++#line 280 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ sqliteSelect(pParse, yymsp[0].minor.yy179, SRT_Callback, 0, 0, 0, 0); ++ sqliteSelectDelete(yymsp[0].minor.yy179); ++} ++#line 2102 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 101: /* select ::= oneselect */ ++ case 125: /* seltablist_paren ::= select */ yytestcase(yyruleno==125); ++#line 290 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy179 = yymsp[0].minor.yy179;} ++#line 2108 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 102: /* select ::= select multiselect_op oneselect */ ++#line 291 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ if( yymsp[0].minor.yy179 ){ ++ yymsp[0].minor.yy179->op = yymsp[-1].minor.yy372; ++ yymsp[0].minor.yy179->pPrior = yymsp[-2].minor.yy179; ++ } ++ yygotominor.yy179 = yymsp[0].minor.yy179; ++} ++#line 2119 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 103: /* multiselect_op ::= UNION */ ++#line 299 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy372 = TK_UNION;} ++#line 2124 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 104: /* multiselect_op ::= UNION ALL */ ++#line 300 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy372 = TK_ALL;} ++#line 2129 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 105: /* multiselect_op ::= INTERSECT */ ++#line 301 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy372 = TK_INTERSECT;} ++#line 2134 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 106: /* multiselect_op ::= EXCEPT */ ++#line 302 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy372 = TK_EXCEPT;} ++#line 2139 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 107: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ ++#line 304 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy179 = sqliteSelectNew(yymsp[-6].minor.yy322,yymsp[-5].minor.yy307,yymsp[-4].minor.yy242,yymsp[-3].minor.yy322,yymsp[-2].minor.yy242,yymsp[-1].minor.yy322,yymsp[-7].minor.yy372,yymsp[0].minor.yy124.limit,yymsp[0].minor.yy124.offset); ++} ++#line 2146 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 111: /* sclp ::= selcollist COMMA */ ++#line 325 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy322 = yymsp[-1].minor.yy322;} ++#line 2151 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 112: /* sclp ::= */ ++ case 138: /* orderby_opt ::= */ yytestcase(yyruleno==138); ++ case 148: /* groupby_opt ::= */ yytestcase(yyruleno==148); ++#line 326 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy322 = 0;} ++#line 2158 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 113: /* selcollist ::= sclp expr as */ ++#line 327 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy322 = sqliteExprListAppend(yymsp[-2].minor.yy322,yymsp[-1].minor.yy242,yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); ++} ++#line 2165 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 114: /* selcollist ::= sclp STAR */ ++#line 330 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy322 = sqliteExprListAppend(yymsp[-1].minor.yy322, sqliteExpr(TK_ALL, 0, 0, 0), 0); ++} ++#line 2172 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 115: /* selcollist ::= sclp nm DOT STAR */ ++#line 333 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ Expr *pRight = sqliteExpr(TK_ALL, 0, 0, 0); ++ Expr *pLeft = sqliteExpr(TK_ID, 0, 0, &yymsp[-2].minor.yy0); ++ yygotominor.yy322 = sqliteExprListAppend(yymsp[-3].minor.yy322, sqliteExpr(TK_DOT, pLeft, pRight, 0), 0); ++} ++#line 2181 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 116: /* as ::= AS nm */ ++ case 117: /* as ::= ids */ yytestcase(yyruleno==117); ++ case 288: /* key_opt ::= USING ids */ yytestcase(yyruleno==288); ++#line 343 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy0 = yymsp[0].minor.yy0; } ++#line 2188 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 118: /* as ::= */ ++#line 345 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy0.n = 0; } ++#line 2193 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 119: /* from ::= */ ++#line 357 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy307 = sqliteMalloc(sizeof(*yygotominor.yy307));} ++#line 2198 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 120: /* from ::= FROM seltablist */ ++#line 358 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy307 = yymsp[0].minor.yy307;} ++#line 2203 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 121: /* stl_prefix ::= seltablist joinop */ ++#line 363 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy307 = yymsp[-1].minor.yy307; ++ if( yygotominor.yy307 && yygotominor.yy307->nSrc>0 ) yygotominor.yy307->a[yygotominor.yy307->nSrc-1].jointype = yymsp[0].minor.yy372; ++} ++#line 2211 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 122: /* stl_prefix ::= */ ++#line 367 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy307 = 0;} ++#line 2216 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 123: /* seltablist ::= stl_prefix nm dbnm as on_opt using_opt */ ++#line 368 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy307 = sqliteSrcListAppend(yymsp[-5].minor.yy307,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0); ++ if( yymsp[-2].minor.yy0.n ) sqliteSrcListAddAlias(yygotominor.yy307,&yymsp[-2].minor.yy0); ++ if( yymsp[-1].minor.yy242 ){ ++ if( yygotominor.yy307 && yygotominor.yy307->nSrc>1 ){ yygotominor.yy307->a[yygotominor.yy307->nSrc-2].pOn = yymsp[-1].minor.yy242; } ++ else { sqliteExprDelete(yymsp[-1].minor.yy242); } ++ } ++ if( yymsp[0].minor.yy320 ){ ++ if( yygotominor.yy307 && yygotominor.yy307->nSrc>1 ){ yygotominor.yy307->a[yygotominor.yy307->nSrc-2].pUsing = yymsp[0].minor.yy320; } ++ else { sqliteIdListDelete(yymsp[0].minor.yy320); } ++ } ++} ++#line 2232 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 124: /* seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt */ ++#line 381 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy307 = sqliteSrcListAppend(yymsp[-6].minor.yy307,0,0); ++ yygotominor.yy307->a[yygotominor.yy307->nSrc-1].pSelect = yymsp[-4].minor.yy179; ++ if( yymsp[-2].minor.yy0.n ) sqliteSrcListAddAlias(yygotominor.yy307,&yymsp[-2].minor.yy0); ++ if( yymsp[-1].minor.yy242 ){ ++ if( yygotominor.yy307 && yygotominor.yy307->nSrc>1 ){ yygotominor.yy307->a[yygotominor.yy307->nSrc-2].pOn = yymsp[-1].minor.yy242; } ++ else { sqliteExprDelete(yymsp[-1].minor.yy242); } ++ } ++ if( yymsp[0].minor.yy320 ){ ++ if( yygotominor.yy307 && yygotominor.yy307->nSrc>1 ){ yygotominor.yy307->a[yygotominor.yy307->nSrc-2].pUsing = yymsp[0].minor.yy320; } ++ else { sqliteIdListDelete(yymsp[0].minor.yy320); } ++ } ++} ++#line 2249 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 126: /* seltablist_paren ::= seltablist */ ++#line 402 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy179 = sqliteSelectNew(0,yymsp[0].minor.yy307,0,0,0,0,0,-1,0); ++} ++#line 2256 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 127: /* dbnm ::= */ ++#line 407 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy0.z=0; yygotominor.yy0.n=0;} ++#line 2261 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 129: /* joinop ::= COMMA */ ++ case 130: /* joinop ::= JOIN */ yytestcase(yyruleno==130); ++#line 412 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = JT_INNER; } ++#line 2267 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 131: /* joinop ::= JOIN_KW JOIN */ ++#line 414 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = sqliteJoinType(pParse,&yymsp[-1].minor.yy0,0,0); } ++#line 2272 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 132: /* joinop ::= JOIN_KW nm JOIN */ ++#line 415 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = sqliteJoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); } ++#line 2277 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 133: /* joinop ::= JOIN_KW nm nm JOIN */ ++#line 417 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = sqliteJoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); } ++#line 2282 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 134: /* on_opt ::= ON expr */ ++ case 142: /* sortitem ::= expr */ yytestcase(yyruleno==142); ++ case 151: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==151); ++ case 158: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==158); ++ case 227: /* case_else ::= ELSE expr */ yytestcase(yyruleno==227); ++ case 229: /* case_operand ::= expr */ yytestcase(yyruleno==229); ++ case 233: /* expritem ::= expr */ yytestcase(yyruleno==233); ++#line 421 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = yymsp[0].minor.yy242;} ++#line 2293 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 135: /* on_opt ::= */ ++ case 150: /* having_opt ::= */ yytestcase(yyruleno==150); ++ case 157: /* where_opt ::= */ yytestcase(yyruleno==157); ++ case 228: /* case_else ::= */ yytestcase(yyruleno==228); ++ case 230: /* case_operand ::= */ yytestcase(yyruleno==230); ++ case 234: /* expritem ::= */ yytestcase(yyruleno==234); ++#line 422 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = 0;} ++#line 2303 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 136: /* using_opt ::= USING LP idxlist RP */ ++ case 169: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==169); ++ case 239: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==239); ++#line 426 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy320 = yymsp[-1].minor.yy320;} ++#line 2310 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 137: /* using_opt ::= */ ++ case 168: /* inscollist_opt ::= */ yytestcase(yyruleno==168); ++ case 238: /* idxlist_opt ::= */ yytestcase(yyruleno==238); ++#line 427 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy320 = 0;} ++#line 2317 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 139: /* orderby_opt ::= ORDER BY sortlist */ ++ case 149: /* groupby_opt ::= GROUP BY exprlist */ yytestcase(yyruleno==149); ++#line 438 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy322 = yymsp[0].minor.yy322;} ++#line 2323 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 140: /* sortlist ::= sortlist COMMA sortitem collate sortorder */ ++#line 439 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy322 = sqliteExprListAppend(yymsp[-4].minor.yy322,yymsp[-2].minor.yy242,0); ++ if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = yymsp[-1].minor.yy372+yymsp[0].minor.yy372; ++} ++#line 2331 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 141: /* sortlist ::= sortitem collate sortorder */ ++#line 443 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy322 = sqliteExprListAppend(0,yymsp[-2].minor.yy242,0); ++ if( yygotominor.yy322 ) yygotominor.yy322->a[0].sortOrder = yymsp[-1].minor.yy372+yymsp[0].minor.yy372; ++} ++#line 2339 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 143: /* sortorder ::= ASC */ ++ case 145: /* sortorder ::= */ yytestcase(yyruleno==145); ++#line 452 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy372 = SQLITE_SO_ASC;} ++#line 2345 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 144: /* sortorder ::= DESC */ ++#line 453 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy372 = SQLITE_SO_DESC;} ++#line 2350 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 146: /* collate ::= */ ++#line 455 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy372 = SQLITE_SO_UNK;} ++#line 2355 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 147: /* collate ::= COLLATE id */ ++#line 456 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy372 = sqliteCollateType(yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);} ++#line 2360 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 152: /* limit_opt ::= */ ++#line 469 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy124.limit = -1; yygotominor.yy124.offset = 0;} ++#line 2365 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 153: /* limit_opt ::= LIMIT signed */ ++#line 470 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy124.limit = yymsp[0].minor.yy372; yygotominor.yy124.offset = 0;} ++#line 2370 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 154: /* limit_opt ::= LIMIT signed OFFSET signed */ ++#line 472 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy124.limit = yymsp[-2].minor.yy372; yygotominor.yy124.offset = yymsp[0].minor.yy372;} ++#line 2375 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 155: /* limit_opt ::= LIMIT signed COMMA signed */ ++#line 474 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy124.limit = yymsp[0].minor.yy372; yygotominor.yy124.offset = yymsp[-2].minor.yy372;} ++#line 2380 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 156: /* cmd ::= DELETE FROM nm dbnm where_opt */ ++#line 478 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ sqliteDeleteFrom(pParse, sqliteSrcListAppend(0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0), yymsp[0].minor.yy242); ++} ++#line 2387 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 159: /* cmd ::= UPDATE orconf nm dbnm SET setlist where_opt */ ++#line 494 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteUpdate(pParse,sqliteSrcListAppend(0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0),yymsp[-1].minor.yy322,yymsp[0].minor.yy242,yymsp[-5].minor.yy372);} ++#line 2392 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 160: /* setlist ::= setlist COMMA nm EQ expr */ ++#line 497 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy322 = sqliteExprListAppend(yymsp[-4].minor.yy322,yymsp[0].minor.yy242,&yymsp[-2].minor.yy0);} ++#line 2397 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 161: /* setlist ::= nm EQ expr */ ++#line 498 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy322 = sqliteExprListAppend(0,yymsp[0].minor.yy242,&yymsp[-2].minor.yy0);} ++#line 2402 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 162: /* cmd ::= insert_cmd INTO nm dbnm inscollist_opt VALUES LP itemlist RP */ ++#line 504 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteInsert(pParse, sqliteSrcListAppend(0,&yymsp[-6].minor.yy0,&yymsp[-5].minor.yy0), yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy320, yymsp[-8].minor.yy372);} ++#line 2407 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 163: /* cmd ::= insert_cmd INTO nm dbnm inscollist_opt select */ ++#line 506 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteInsert(pParse, sqliteSrcListAppend(0,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0), 0, yymsp[0].minor.yy179, yymsp[-1].minor.yy320, yymsp[-5].minor.yy372);} ++#line 2412 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 165: /* insert_cmd ::= REPLACE */ ++#line 510 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy372 = OE_Replace;} ++#line 2417 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 166: /* itemlist ::= itemlist COMMA expr */ ++ case 231: /* exprlist ::= exprlist COMMA expritem */ yytestcase(yyruleno==231); ++#line 516 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy322 = sqliteExprListAppend(yymsp[-2].minor.yy322,yymsp[0].minor.yy242,0);} ++#line 2423 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 167: /* itemlist ::= expr */ ++ case 232: /* exprlist ::= expritem */ yytestcase(yyruleno==232); ++#line 517 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy322 = sqliteExprListAppend(0,yymsp[0].minor.yy242,0);} ++#line 2429 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 170: /* inscollist ::= inscollist COMMA nm */ ++ case 240: /* idxlist ::= idxlist COMMA idxitem */ yytestcase(yyruleno==240); ++#line 526 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy320 = sqliteIdListAppend(yymsp[-2].minor.yy320,&yymsp[0].minor.yy0);} ++#line 2435 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 171: /* inscollist ::= nm */ ++ case 241: /* idxlist ::= idxitem */ yytestcase(yyruleno==241); ++#line 527 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy320 = sqliteIdListAppend(0,&yymsp[0].minor.yy0);} ++#line 2441 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 172: /* expr ::= LP expr RP */ ++#line 535 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = yymsp[-1].minor.yy242; sqliteExprSpan(yygotominor.yy242,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); } ++#line 2446 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 173: /* expr ::= NULL */ ++#line 536 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_NULL, 0, 0, &yymsp[0].minor.yy0);} ++#line 2451 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 174: /* expr ::= ID */ ++ case 175: /* expr ::= JOIN_KW */ yytestcase(yyruleno==175); ++#line 537 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_ID, 0, 0, &yymsp[0].minor.yy0);} ++#line 2457 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 176: /* expr ::= nm DOT nm */ ++#line 539 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ Expr *temp1 = sqliteExpr(TK_ID, 0, 0, &yymsp[-2].minor.yy0); ++ Expr *temp2 = sqliteExpr(TK_ID, 0, 0, &yymsp[0].minor.yy0); ++ yygotominor.yy242 = sqliteExpr(TK_DOT, temp1, temp2, 0); ++} ++#line 2466 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 177: /* expr ::= nm DOT nm DOT nm */ ++#line 544 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ Expr *temp1 = sqliteExpr(TK_ID, 0, 0, &yymsp[-4].minor.yy0); ++ Expr *temp2 = sqliteExpr(TK_ID, 0, 0, &yymsp[-2].minor.yy0); ++ Expr *temp3 = sqliteExpr(TK_ID, 0, 0, &yymsp[0].minor.yy0); ++ Expr *temp4 = sqliteExpr(TK_DOT, temp2, temp3, 0); ++ yygotominor.yy242 = sqliteExpr(TK_DOT, temp1, temp4, 0); ++} ++#line 2477 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 178: /* expr ::= INTEGER */ ++#line 551 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_INTEGER, 0, 0, &yymsp[0].minor.yy0);} ++#line 2482 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 179: /* expr ::= FLOAT */ ++#line 552 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_FLOAT, 0, 0, &yymsp[0].minor.yy0);} ++#line 2487 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 180: /* expr ::= STRING */ ++#line 553 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_STRING, 0, 0, &yymsp[0].minor.yy0);} ++#line 2492 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 181: /* expr ::= VARIABLE */ ++#line 554 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_VARIABLE, 0, 0, &yymsp[0].minor.yy0); ++ if( yygotominor.yy242 ) yygotominor.yy242->iTable = ++pParse->nVar; ++} ++#line 2500 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 182: /* expr ::= ID LP exprlist RP */ ++#line 558 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExprFunction(yymsp[-1].minor.yy322, &yymsp[-3].minor.yy0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); ++} ++#line 2508 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 183: /* expr ::= ID LP STAR RP */ ++#line 562 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExprFunction(0, &yymsp[-3].minor.yy0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); ++} ++#line 2516 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 184: /* expr ::= expr AND expr */ ++#line 566 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_AND, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2521 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 185: /* expr ::= expr OR expr */ ++#line 567 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_OR, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2526 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 186: /* expr ::= expr LT expr */ ++#line 568 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_LT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2531 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 187: /* expr ::= expr GT expr */ ++#line 569 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_GT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2536 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 188: /* expr ::= expr LE expr */ ++#line 570 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_LE, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2541 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 189: /* expr ::= expr GE expr */ ++#line 571 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_GE, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2546 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 190: /* expr ::= expr NE expr */ ++#line 572 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_NE, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2551 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 191: /* expr ::= expr EQ expr */ ++#line 573 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_EQ, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2556 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 192: /* expr ::= expr BITAND expr */ ++#line 574 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_BITAND, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2561 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 193: /* expr ::= expr BITOR expr */ ++#line 575 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_BITOR, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2566 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 194: /* expr ::= expr LSHIFT expr */ ++#line 576 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_LSHIFT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2571 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 195: /* expr ::= expr RSHIFT expr */ ++#line 577 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_RSHIFT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2576 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 196: /* expr ::= expr likeop expr */ ++#line 578 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ ExprList *pList = sqliteExprListAppend(0, yymsp[0].minor.yy242, 0); ++ pList = sqliteExprListAppend(pList, yymsp[-2].minor.yy242, 0); ++ yygotominor.yy242 = sqliteExprFunction(pList, 0); ++ if( yygotominor.yy242 ) yygotominor.yy242->op = yymsp[-1].minor.yy372; ++ sqliteExprSpan(yygotominor.yy242, &yymsp[-2].minor.yy242->span, &yymsp[0].minor.yy242->span); ++} ++#line 2587 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 197: /* expr ::= expr NOT likeop expr */ ++#line 585 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ ExprList *pList = sqliteExprListAppend(0, yymsp[0].minor.yy242, 0); ++ pList = sqliteExprListAppend(pList, yymsp[-3].minor.yy242, 0); ++ yygotominor.yy242 = sqliteExprFunction(pList, 0); ++ if( yygotominor.yy242 ) yygotominor.yy242->op = yymsp[-1].minor.yy372; ++ yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy242->span,&yymsp[0].minor.yy242->span); ++} ++#line 2599 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 198: /* likeop ::= LIKE */ ++#line 594 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy372 = TK_LIKE;} ++#line 2604 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 199: /* likeop ::= GLOB */ ++#line 595 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy372 = TK_GLOB;} ++#line 2609 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 200: /* expr ::= expr PLUS expr */ ++#line 596 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_PLUS, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2614 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 201: /* expr ::= expr MINUS expr */ ++#line 597 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_MINUS, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2619 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 202: /* expr ::= expr STAR expr */ ++#line 598 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_STAR, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2624 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 203: /* expr ::= expr SLASH expr */ ++#line 599 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_SLASH, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2629 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 204: /* expr ::= expr REM expr */ ++#line 600 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_REM, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2634 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 205: /* expr ::= expr CONCAT expr */ ++#line 601 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy242 = sqliteExpr(TK_CONCAT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} ++#line 2639 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 206: /* expr ::= expr ISNULL */ ++#line 602 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_ISNULL, yymsp[-1].minor.yy242, 0, 0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy242->span,&yymsp[0].minor.yy0); ++} ++#line 2647 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 207: /* expr ::= expr IS NULL */ ++#line 606 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_ISNULL, yymsp[-2].minor.yy242, 0, 0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-2].minor.yy242->span,&yymsp[0].minor.yy0); ++} ++#line 2655 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 208: /* expr ::= expr NOTNULL */ ++#line 610 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_NOTNULL, yymsp[-1].minor.yy242, 0, 0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy242->span,&yymsp[0].minor.yy0); ++} ++#line 2663 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 209: /* expr ::= expr NOT NULL */ ++#line 614 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_NOTNULL, yymsp[-2].minor.yy242, 0, 0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-2].minor.yy242->span,&yymsp[0].minor.yy0); ++} ++#line 2671 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 210: /* expr ::= expr IS NOT NULL */ ++#line 618 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_NOTNULL, yymsp[-3].minor.yy242, 0, 0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy242->span,&yymsp[0].minor.yy0); ++} ++#line 2679 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 211: /* expr ::= NOT expr */ ++#line 622 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_NOT, yymsp[0].minor.yy242, 0, 0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy242->span); ++} ++#line 2687 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 212: /* expr ::= BITNOT expr */ ++#line 626 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_BITNOT, yymsp[0].minor.yy242, 0, 0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy242->span); ++} ++#line 2695 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 213: /* expr ::= MINUS expr */ ++#line 630 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_UMINUS, yymsp[0].minor.yy242, 0, 0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy242->span); ++} ++#line 2703 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 214: /* expr ::= PLUS expr */ ++#line 634 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_UPLUS, yymsp[0].minor.yy242, 0, 0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy242->span); ++} ++#line 2711 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 215: /* expr ::= LP select RP */ ++#line 638 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_SELECT, 0, 0, 0); ++ if( yygotominor.yy242 ) yygotominor.yy242->pSelect = yymsp[-1].minor.yy179; ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); ++} ++#line 2720 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 216: /* expr ::= expr BETWEEN expr AND expr */ ++#line 643 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ ExprList *pList = sqliteExprListAppend(0, yymsp[-2].minor.yy242, 0); ++ pList = sqliteExprListAppend(pList, yymsp[0].minor.yy242, 0); ++ yygotominor.yy242 = sqliteExpr(TK_BETWEEN, yymsp[-4].minor.yy242, 0, 0); ++ if( yygotominor.yy242 ) yygotominor.yy242->pList = pList; ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-4].minor.yy242->span,&yymsp[0].minor.yy242->span); ++} ++#line 2731 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 217: /* expr ::= expr NOT BETWEEN expr AND expr */ ++#line 650 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ ExprList *pList = sqliteExprListAppend(0, yymsp[-2].minor.yy242, 0); ++ pList = sqliteExprListAppend(pList, yymsp[0].minor.yy242, 0); ++ yygotominor.yy242 = sqliteExpr(TK_BETWEEN, yymsp[-5].minor.yy242, 0, 0); ++ if( yygotominor.yy242 ) yygotominor.yy242->pList = pList; ++ yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-5].minor.yy242->span,&yymsp[0].minor.yy242->span); ++} ++#line 2743 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 218: /* expr ::= expr IN LP exprlist RP */ ++#line 658 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-4].minor.yy242, 0, 0); ++ if( yygotominor.yy242 ) yygotominor.yy242->pList = yymsp[-1].minor.yy322; ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-4].minor.yy242->span,&yymsp[0].minor.yy0); ++} ++#line 2752 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 219: /* expr ::= expr IN LP select RP */ ++#line 663 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-4].minor.yy242, 0, 0); ++ if( yygotominor.yy242 ) yygotominor.yy242->pSelect = yymsp[-1].minor.yy179; ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-4].minor.yy242->span,&yymsp[0].minor.yy0); ++} ++#line 2761 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 220: /* expr ::= expr NOT IN LP exprlist RP */ ++#line 668 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-5].minor.yy242, 0, 0); ++ if( yygotominor.yy242 ) yygotominor.yy242->pList = yymsp[-1].minor.yy322; ++ yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-5].minor.yy242->span,&yymsp[0].minor.yy0); ++} ++#line 2771 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 221: /* expr ::= expr NOT IN LP select RP */ ++#line 674 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-5].minor.yy242, 0, 0); ++ if( yygotominor.yy242 ) yygotominor.yy242->pSelect = yymsp[-1].minor.yy179; ++ yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-5].minor.yy242->span,&yymsp[0].minor.yy0); ++} ++#line 2781 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 222: /* expr ::= expr IN nm dbnm */ ++#line 680 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ SrcList *pSrc = sqliteSrcListAppend(0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); ++ yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-3].minor.yy242, 0, 0); ++ if( yygotominor.yy242 ) yygotominor.yy242->pSelect = sqliteSelectNew(0,pSrc,0,0,0,0,0,-1,0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy242->span,yymsp[0].minor.yy0.z?&yymsp[0].minor.yy0:&yymsp[-1].minor.yy0); ++} ++#line 2791 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 223: /* expr ::= expr NOT IN nm dbnm */ ++#line 686 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ SrcList *pSrc = sqliteSrcListAppend(0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); ++ yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-4].minor.yy242, 0, 0); ++ if( yygotominor.yy242 ) yygotominor.yy242->pSelect = sqliteSelectNew(0,pSrc,0,0,0,0,0,-1,0); ++ yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0); ++ sqliteExprSpan(yygotominor.yy242,&yymsp[-4].minor.yy242->span,yymsp[0].minor.yy0.z?&yymsp[0].minor.yy0:&yymsp[-1].minor.yy0); ++} ++#line 2802 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 224: /* expr ::= CASE case_operand case_exprlist case_else END */ ++#line 696 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_CASE, yymsp[-3].minor.yy242, yymsp[-1].minor.yy242, 0); ++ if( yygotominor.yy242 ) yygotominor.yy242->pList = yymsp[-2].minor.yy322; ++ sqliteExprSpan(yygotominor.yy242, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0); ++} ++#line 2811 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 225: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ ++#line 703 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy322 = sqliteExprListAppend(yymsp[-4].minor.yy322, yymsp[-2].minor.yy242, 0); ++ yygotominor.yy322 = sqliteExprListAppend(yygotominor.yy322, yymsp[0].minor.yy242, 0); ++} ++#line 2819 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 226: /* case_exprlist ::= WHEN expr THEN expr */ ++#line 707 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy322 = sqliteExprListAppend(0, yymsp[-2].minor.yy242, 0); ++ yygotominor.yy322 = sqliteExprListAppend(yygotominor.yy322, yymsp[0].minor.yy242, 0); ++} ++#line 2827 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 235: /* cmd ::= CREATE uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf */ ++#line 732 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ SrcList *pSrc = sqliteSrcListAppend(0, &yymsp[-5].minor.yy0, &yymsp[-4].minor.yy0); ++ if( yymsp[-9].minor.yy372!=OE_None ) yymsp[-9].minor.yy372 = yymsp[0].minor.yy372; ++ if( yymsp[-9].minor.yy372==OE_Default) yymsp[-9].minor.yy372 = OE_Abort; ++ sqliteCreateIndex(pParse, &yymsp[-7].minor.yy0, pSrc, yymsp[-2].minor.yy320, yymsp[-9].minor.yy372, &yymsp[-10].minor.yy0, &yymsp[-1].minor.yy0); ++} ++#line 2837 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 237: /* uniqueflag ::= */ ++#line 741 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = OE_None; } ++#line 2842 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 243: /* cmd ::= DROP INDEX nm dbnm */ ++#line 758 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ sqliteDropIndex(pParse, sqliteSrcListAppend(0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0)); ++} ++#line 2849 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 244: /* cmd ::= COPY orconf nm dbnm FROM nm USING DELIMITERS STRING */ ++#line 766 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteCopy(pParse,sqliteSrcListAppend(0,&yymsp[-6].minor.yy0,&yymsp[-5].minor.yy0),&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0,yymsp[-7].minor.yy372);} ++#line 2854 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 245: /* cmd ::= COPY orconf nm dbnm FROM nm */ ++#line 768 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteCopy(pParse,sqliteSrcListAppend(0,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0),&yymsp[0].minor.yy0,0,yymsp[-4].minor.yy372);} ++#line 2859 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 246: /* cmd ::= VACUUM */ ++#line 772 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteVacuum(pParse,0);} ++#line 2864 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 247: /* cmd ::= VACUUM nm */ ++#line 773 "ext/sqlite/libsqlite/src/parse.y" ++{sqliteVacuum(pParse,&yymsp[0].minor.yy0);} ++#line 2869 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 248: /* cmd ::= PRAGMA ids EQ nm */ ++ case 249: /* cmd ::= PRAGMA ids EQ ON */ yytestcase(yyruleno==249); ++ case 250: /* cmd ::= PRAGMA ids EQ plus_num */ yytestcase(yyruleno==250); ++#line 777 "ext/sqlite/libsqlite/src/parse.y" ++{sqlitePragma(pParse,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);} ++#line 2876 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 251: /* cmd ::= PRAGMA ids EQ minus_num */ ++#line 780 "ext/sqlite/libsqlite/src/parse.y" ++{sqlitePragma(pParse,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);} ++#line 2881 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 252: /* cmd ::= PRAGMA ids LP nm RP */ ++#line 781 "ext/sqlite/libsqlite/src/parse.y" ++{sqlitePragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);} ++#line 2886 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 253: /* cmd ::= PRAGMA ids */ ++#line 782 "ext/sqlite/libsqlite/src/parse.y" ++{sqlitePragma(pParse,&yymsp[0].minor.yy0,&yymsp[0].minor.yy0,0);} ++#line 2891 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 260: /* cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END */ ++#line 792 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ Token all; ++ all.z = yymsp[-4].minor.yy0.z; ++ all.n = (yymsp[0].minor.yy0.z - yymsp[-4].minor.yy0.z) + yymsp[0].minor.yy0.n; ++ sqliteFinishTrigger(pParse, yymsp[-1].minor.yy19, &all); ++} ++#line 2901 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 261: /* trigger_decl ::= temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause */ ++#line 800 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ SrcList *pTab = sqliteSrcListAppend(0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0); ++ sqliteBeginTrigger(pParse, &yymsp[-7].minor.yy0, yymsp[-6].minor.yy372, yymsp[-5].minor.yy290.a, yymsp[-5].minor.yy290.b, pTab, yymsp[-1].minor.yy372, yymsp[0].minor.yy182, yymsp[-9].minor.yy372); ++} ++#line 2909 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 262: /* trigger_time ::= BEFORE */ ++ case 265: /* trigger_time ::= */ yytestcase(yyruleno==265); ++#line 806 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = TK_BEFORE; } ++#line 2915 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 263: /* trigger_time ::= AFTER */ ++#line 807 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = TK_AFTER; } ++#line 2920 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 264: /* trigger_time ::= INSTEAD OF */ ++#line 808 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = TK_INSTEAD;} ++#line 2925 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 266: /* trigger_event ::= DELETE */ ++#line 813 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy290.a = TK_DELETE; yygotominor.yy290.b = 0; } ++#line 2930 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 267: /* trigger_event ::= INSERT */ ++#line 814 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy290.a = TK_INSERT; yygotominor.yy290.b = 0; } ++#line 2935 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 268: /* trigger_event ::= UPDATE */ ++#line 815 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy290.a = TK_UPDATE; yygotominor.yy290.b = 0;} ++#line 2940 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 269: /* trigger_event ::= UPDATE OF inscollist */ ++#line 816 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy290.a = TK_UPDATE; yygotominor.yy290.b = yymsp[0].minor.yy320; } ++#line 2945 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 270: /* foreach_clause ::= */ ++ case 271: /* foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==271); ++#line 819 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = TK_ROW; } ++#line 2951 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 272: /* foreach_clause ::= FOR EACH STATEMENT */ ++#line 821 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy372 = TK_STATEMENT; } ++#line 2956 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 273: /* when_clause ::= */ ++#line 824 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy182 = 0; } ++#line 2961 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 274: /* when_clause ::= WHEN expr */ ++#line 825 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy182 = yymsp[0].minor.yy242; } ++#line 2966 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 275: /* trigger_cmd_list ::= trigger_cmd SEMI trigger_cmd_list */ ++#line 829 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yymsp[-2].minor.yy19->pNext = yymsp[0].minor.yy19; ++ yygotominor.yy19 = yymsp[-2].minor.yy19; ++} ++#line 2974 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 276: /* trigger_cmd_list ::= */ ++#line 833 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy19 = 0; } ++#line 2979 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 277: /* trigger_cmd ::= UPDATE orconf nm SET setlist where_opt */ ++#line 839 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy19 = sqliteTriggerUpdateStep(&yymsp[-3].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy242, yymsp[-4].minor.yy372); } ++#line 2984 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 278: /* trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP */ ++#line 844 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy19 = sqliteTriggerInsertStep(&yymsp[-5].minor.yy0, yymsp[-4].minor.yy320, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy372);} ++#line 2989 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 279: /* trigger_cmd ::= insert_cmd INTO nm inscollist_opt select */ ++#line 847 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy19 = sqliteTriggerInsertStep(&yymsp[-2].minor.yy0, yymsp[-1].minor.yy320, 0, yymsp[0].minor.yy179, yymsp[-4].minor.yy372);} ++#line 2994 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 280: /* trigger_cmd ::= DELETE FROM nm where_opt */ ++#line 851 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy19 = sqliteTriggerDeleteStep(&yymsp[-1].minor.yy0, yymsp[0].minor.yy242);} ++#line 2999 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 281: /* trigger_cmd ::= select */ ++#line 854 "ext/sqlite/libsqlite/src/parse.y" ++{yygotominor.yy19 = sqliteTriggerSelectStep(yymsp[0].minor.yy179); } ++#line 3004 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 282: /* expr ::= RAISE LP IGNORE RP */ ++#line 857 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_RAISE, 0, 0, 0); ++ yygotominor.yy242->iColumn = OE_Ignore; ++ sqliteExprSpan(yygotominor.yy242, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0); ++} ++#line 3013 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 283: /* expr ::= RAISE LP ROLLBACK COMMA nm RP */ ++#line 862 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); ++ yygotominor.yy242->iColumn = OE_Rollback; ++ sqliteExprSpan(yygotominor.yy242, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0); ++} ++#line 3022 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 284: /* expr ::= RAISE LP ABORT COMMA nm RP */ ++#line 867 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); ++ yygotominor.yy242->iColumn = OE_Abort; ++ sqliteExprSpan(yygotominor.yy242, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0); ++} ++#line 3031 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 285: /* expr ::= RAISE LP FAIL COMMA nm RP */ ++#line 872 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ yygotominor.yy242 = sqliteExpr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); ++ yygotominor.yy242->iColumn = OE_Fail; ++ sqliteExprSpan(yygotominor.yy242, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0); ++} ++#line 3040 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 286: /* cmd ::= DROP TRIGGER nm dbnm */ ++#line 879 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ sqliteDropTrigger(pParse,sqliteSrcListAppend(0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0)); ++} ++#line 3047 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 287: /* cmd ::= ATTACH database_kw_opt ids AS nm key_opt */ ++#line 884 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ sqliteAttach(pParse, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); ++} ++#line 3054 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 289: /* key_opt ::= */ ++#line 889 "ext/sqlite/libsqlite/src/parse.y" ++{ yygotominor.yy0.z = 0; yygotominor.yy0.n = 0; } ++#line 3059 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ case 292: /* cmd ::= DETACH database_kw_opt nm */ ++#line 895 "ext/sqlite/libsqlite/src/parse.y" ++{ ++ sqliteDetach(pParse, &yymsp[0].minor.yy0); ++} ++#line 3066 "ext/sqlite/libsqlite/src/parse.c" ++ break; ++ default: ++ /* (0) input ::= cmdlist */ yytestcase(yyruleno==0); ++ /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1); ++ /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2); ++ /* (3) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==3); ++ /* (4) ecmd ::= SEMI */ yytestcase(yyruleno==4); ++ /* (9) trans_opt ::= */ yytestcase(yyruleno==9); ++ /* (10) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==10); ++ /* (11) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==11); ++ /* (15) cmd ::= create_table create_table_args */ yytestcase(yyruleno==15); ++ /* (21) columnlist ::= columnlist COMMA column */ yytestcase(yyruleno==21); ++ /* (22) columnlist ::= column */ yytestcase(yyruleno==22); ++ /* (23) column ::= columnid type carglist */ yytestcase(yyruleno==23); ++ /* (31) type ::= */ yytestcase(yyruleno==31); ++ /* (40) carglist ::= carglist carg */ yytestcase(yyruleno==40); ++ /* (41) carglist ::= */ yytestcase(yyruleno==41); ++ /* (42) carg ::= CONSTRAINT nm ccons */ yytestcase(yyruleno==42); ++ /* (43) carg ::= ccons */ yytestcase(yyruleno==43); ++ /* (52) carg ::= DEFAULT NULL */ yytestcase(yyruleno==52); ++ /* (53) ccons ::= NULL onconf */ yytestcase(yyruleno==53); ++ /* (76) conslist_opt ::= */ yytestcase(yyruleno==76); ++ /* (77) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==77); ++ /* (78) conslist ::= conslist COMMA tcons */ yytestcase(yyruleno==78); ++ /* (79) conslist ::= conslist tcons */ yytestcase(yyruleno==79); ++ /* (80) conslist ::= tcons */ yytestcase(yyruleno==80); ++ /* (81) tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==81); ++ /* (258) plus_opt ::= PLUS */ yytestcase(yyruleno==258); ++ /* (259) plus_opt ::= */ yytestcase(yyruleno==259); ++ /* (290) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==290); ++ /* (291) database_kw_opt ::= */ yytestcase(yyruleno==291); ++ break; ++ }; ++ yygoto = yyRuleInfo[yyruleno].lhs; ++ yysize = yyRuleInfo[yyruleno].nrhs; ++ yypParser->yyidx -= yysize; ++ yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto); ++ if( yyact < YYNSTATE ){ ++#ifdef NDEBUG ++ /* If we are not debugging and the reduce action popped at least ++ ** one element off the stack, then we can push the new element back ++ ** onto the stack here, and skip the stack overflow test in yy_shift(). ++ ** That gives a significant speed improvement. */ ++ if( yysize ){ ++ yypParser->yyidx++; ++ yymsp -= yysize-1; ++ yymsp->stateno = (YYACTIONTYPE)yyact; ++ yymsp->major = (YYCODETYPE)yygoto; ++ yymsp->minor = yygotominor; ++ }else ++#endif ++ { ++ yy_shift(yypParser,yyact,yygoto,&yygotominor); ++ } ++ }else{ ++ assert( yyact == YYNSTATE + YYNRULE + 1 ); ++ yy_accept(yypParser); ++ } ++} ++ ++/* ++** The following code executes when the parse fails ++*/ ++#ifndef YYNOERRORRECOVERY ++static void yy_parse_failed( ++ yyParser *yypParser /* The parser */ ++){ ++ sqliteParserARG_FETCH; ++#ifndef NDEBUG ++ if( yyTraceFILE ){ ++ fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); ++ } ++#endif ++ while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); ++ /* Here code is inserted which will be executed whenever the ++ ** parser fails */ ++ sqliteParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ ++} ++#endif /* YYNOERRORRECOVERY */ ++ ++/* ++** The following code executes when a syntax error first occurs. ++*/ ++static void yy_syntax_error( ++ yyParser *yypParser, /* The parser */ ++ int yymajor, /* The major type of the error token */ ++ YYMINORTYPE yyminor /* The minor type of the error token */ ++){ ++ sqliteParserARG_FETCH; ++#define TOKEN (yyminor.yy0) ++#line 23 "ext/sqlite/libsqlite/src/parse.y" ++ ++ if( pParse->zErrMsg==0 ){ ++ if( TOKEN.z[0] ){ ++ sqliteErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN); ++ }else{ ++ sqliteErrorMsg(pParse, "incomplete SQL statement"); ++ } ++ } ++#line 3166 "ext/sqlite/libsqlite/src/parse.c" ++ sqliteParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ ++} ++ ++/* ++** The following is executed when the parser accepts ++*/ ++static void yy_accept( ++ yyParser *yypParser /* The parser */ ++){ ++ sqliteParserARG_FETCH; ++#ifndef NDEBUG ++ if( yyTraceFILE ){ ++ fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); ++ } ++#endif ++ while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); ++ /* Here code is inserted which will be executed whenever the ++ ** parser accepts */ ++ sqliteParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ ++} ++ ++/* The main parser program. ++** The first argument is a pointer to a structure obtained from ++** "sqliteParserAlloc" which describes the current state of the parser. ++** The second argument is the major token number. The third is ++** the minor token. The fourth optional argument is whatever the ++** user wants (and specified in the grammar) and is available for ++** use by the action routines. ++** ++** Inputs: ++**
      ++**
    • A pointer to the parser (an opaque structure.) ++**
    • The major token number. ++**
    • The minor token number. ++**
    • An option argument of a grammar-specified type. ++**
    ++** ++** Outputs: ++** None. ++*/ ++void sqliteParser( ++ void *yyp, /* The parser */ ++ int yymajor, /* The major token code number */ ++ sqliteParserTOKENTYPE yyminor /* The value for the token */ ++ sqliteParserARG_PDECL /* Optional %extra_argument parameter */ ++){ ++ YYMINORTYPE yyminorunion; ++ int yyact; /* The parser action. */ ++ int yyendofinput; /* True if we are at the end of input */ ++#ifdef YYERRORSYMBOL ++ int yyerrorhit = 0; /* True if yymajor has invoked an error */ ++#endif ++ yyParser *yypParser; /* The parser */ ++ ++ /* (re)initialize the parser, if necessary */ ++ yypParser = (yyParser*)yyp; ++ if( yypParser->yyidx<0 ){ ++#if YYSTACKDEPTH<=0 ++ if( yypParser->yystksz <=0 ){ ++ /*memset(&yyminorunion, 0, sizeof(yyminorunion));*/ ++ yyminorunion = yyzerominor; ++ yyStackOverflow(yypParser, &yyminorunion); ++ return; ++ } ++#endif ++ yypParser->yyidx = 0; ++ yypParser->yyerrcnt = -1; ++ yypParser->yystack[0].stateno = 0; ++ yypParser->yystack[0].major = 0; ++ } ++ yyminorunion.yy0 = yyminor; ++ yyendofinput = (yymajor==0); ++ sqliteParserARG_STORE; ++ ++#ifndef NDEBUG ++ if( yyTraceFILE ){ ++ fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]); ++ } ++#endif ++ ++ do{ ++ yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor); ++ if( yyactyyerrcnt--; ++ yymajor = YYNOCODE; ++ }else if( yyact < YYNSTATE + YYNRULE ){ ++ yy_reduce(yypParser,yyact-YYNSTATE); ++ }else{ ++ assert( yyact == YY_ERROR_ACTION ); ++#ifdef YYERRORSYMBOL ++ int yymx; ++#endif ++#ifndef NDEBUG ++ if( yyTraceFILE ){ ++ fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); ++ } ++#endif ++#ifdef YYERRORSYMBOL ++ /* A syntax error has occurred. ++ ** The response to an error depends upon whether or not the ++ ** grammar defines an error token "ERROR". ++ ** ++ ** This is what we do if the grammar does define ERROR: ++ ** ++ ** * Call the %syntax_error function. ++ ** ++ ** * Begin popping the stack until we enter a state where ++ ** it is legal to shift the error symbol, then shift ++ ** the error symbol. ++ ** ++ ** * Set the error count to three. ++ ** ++ ** * Begin accepting and shifting new tokens. No new error ++ ** processing will occur until three tokens have been ++ ** shifted successfully. ++ ** ++ */ ++ if( yypParser->yyerrcnt<0 ){ ++ yy_syntax_error(yypParser,yymajor,yyminorunion); ++ } ++ yymx = yypParser->yystack[yypParser->yyidx].major; ++ if( yymx==YYERRORSYMBOL || yyerrorhit ){ ++#ifndef NDEBUG ++ if( yyTraceFILE ){ ++ fprintf(yyTraceFILE,"%sDiscard input token %s\n", ++ yyTracePrompt,yyTokenName[yymajor]); ++ } ++#endif ++ yy_destructor(yypParser, (YYCODETYPE)yymajor,&yyminorunion); ++ yymajor = YYNOCODE; ++ }else{ ++ while( ++ yypParser->yyidx >= 0 && ++ yymx != YYERRORSYMBOL && ++ (yyact = yy_find_reduce_action( ++ yypParser->yystack[yypParser->yyidx].stateno, ++ YYERRORSYMBOL)) >= YYNSTATE ++ ){ ++ yy_pop_parser_stack(yypParser); ++ } ++ if( yypParser->yyidx < 0 || yymajor==0 ){ ++ yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); ++ yy_parse_failed(yypParser); ++ yymajor = YYNOCODE; ++ }else if( yymx!=YYERRORSYMBOL ){ ++ YYMINORTYPE u2; ++ u2.YYERRSYMDT = 0; ++ yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2); ++ } ++ } ++ yypParser->yyerrcnt = 3; ++ yyerrorhit = 1; ++#elif defined(YYNOERRORRECOVERY) ++ /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to ++ ** do any kind of error recovery. Instead, simply invoke the syntax ++ ** error routine and continue going as if nothing had happened. ++ ** ++ ** Applications can set this macro (for example inside %include) if ++ ** they intend to abandon the parse upon the first syntax error seen. ++ */ ++ yy_syntax_error(yypParser,yymajor,yyminorunion); ++ yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); ++ yymajor = YYNOCODE; ++ ++#else /* YYERRORSYMBOL is not defined */ ++ /* This is what we do if the grammar does not define ERROR: ++ ** ++ ** * Report an error message, and throw away the input token. ++ ** ++ ** * If the input token is $, then fail the parse. ++ ** ++ ** As before, subsequent error messages are suppressed until ++ ** three input tokens have been successfully shifted. ++ */ ++ if( yypParser->yyerrcnt<=0 ){ ++ yy_syntax_error(yypParser,yymajor,yyminorunion); ++ } ++ yypParser->yyerrcnt = 3; ++ yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); ++ if( yyendofinput ){ ++ yy_parse_failed(yypParser); ++ } ++ yymajor = YYNOCODE; ++#endif ++ } ++ }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 ); ++ return; ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/parse.h +@@ -0,0 +1,130 @@ ++#define TK_END_OF_FILE 1 ++#define TK_ILLEGAL 2 ++#define TK_SPACE 3 ++#define TK_UNCLOSED_STRING 4 ++#define TK_COMMENT 5 ++#define TK_FUNCTION 6 ++#define TK_COLUMN 7 ++#define TK_AGG_FUNCTION 8 ++#define TK_SEMI 9 ++#define TK_EXPLAIN 10 ++#define TK_BEGIN 11 ++#define TK_TRANSACTION 12 ++#define TK_COMMIT 13 ++#define TK_END 14 ++#define TK_ROLLBACK 15 ++#define TK_CREATE 16 ++#define TK_TABLE 17 ++#define TK_TEMP 18 ++#define TK_LP 19 ++#define TK_RP 20 ++#define TK_AS 21 ++#define TK_COMMA 22 ++#define TK_ID 23 ++#define TK_ABORT 24 ++#define TK_AFTER 25 ++#define TK_ASC 26 ++#define TK_ATTACH 27 ++#define TK_BEFORE 28 ++#define TK_CASCADE 29 ++#define TK_CLUSTER 30 ++#define TK_CONFLICT 31 ++#define TK_COPY 32 ++#define TK_DATABASE 33 ++#define TK_DEFERRED 34 ++#define TK_DELIMITERS 35 ++#define TK_DESC 36 ++#define TK_DETACH 37 ++#define TK_EACH 38 ++#define TK_FAIL 39 ++#define TK_FOR 40 ++#define TK_GLOB 41 ++#define TK_IGNORE 42 ++#define TK_IMMEDIATE 43 ++#define TK_INITIALLY 44 ++#define TK_INSTEAD 45 ++#define TK_LIKE 46 ++#define TK_MATCH 47 ++#define TK_KEY 48 ++#define TK_OF 49 ++#define TK_OFFSET 50 ++#define TK_PRAGMA 51 ++#define TK_RAISE 52 ++#define TK_REPLACE 53 ++#define TK_RESTRICT 54 ++#define TK_ROW 55 ++#define TK_STATEMENT 56 ++#define TK_TRIGGER 57 ++#define TK_VACUUM 58 ++#define TK_VIEW 59 ++#define TK_OR 60 ++#define TK_AND 61 ++#define TK_NOT 62 ++#define TK_EQ 63 ++#define TK_NE 64 ++#define TK_ISNULL 65 ++#define TK_NOTNULL 66 ++#define TK_IS 67 ++#define TK_BETWEEN 68 ++#define TK_IN 69 ++#define TK_GT 70 ++#define TK_GE 71 ++#define TK_LT 72 ++#define TK_LE 73 ++#define TK_BITAND 74 ++#define TK_BITOR 75 ++#define TK_LSHIFT 76 ++#define TK_RSHIFT 77 ++#define TK_PLUS 78 ++#define TK_MINUS 79 ++#define TK_STAR 80 ++#define TK_SLASH 81 ++#define TK_REM 82 ++#define TK_CONCAT 83 ++#define TK_UMINUS 84 ++#define TK_UPLUS 85 ++#define TK_BITNOT 86 ++#define TK_STRING 87 ++#define TK_JOIN_KW 88 ++#define TK_INTEGER 89 ++#define TK_CONSTRAINT 90 ++#define TK_DEFAULT 91 ++#define TK_FLOAT 92 ++#define TK_NULL 93 ++#define TK_PRIMARY 94 ++#define TK_UNIQUE 95 ++#define TK_CHECK 96 ++#define TK_REFERENCES 97 ++#define TK_COLLATE 98 ++#define TK_ON 99 ++#define TK_DELETE 100 ++#define TK_UPDATE 101 ++#define TK_INSERT 102 ++#define TK_SET 103 ++#define TK_DEFERRABLE 104 ++#define TK_FOREIGN 105 ++#define TK_DROP 106 ++#define TK_UNION 107 ++#define TK_ALL 108 ++#define TK_INTERSECT 109 ++#define TK_EXCEPT 110 ++#define TK_SELECT 111 ++#define TK_DISTINCT 112 ++#define TK_DOT 113 ++#define TK_FROM 114 ++#define TK_JOIN 115 ++#define TK_USING 116 ++#define TK_ORDER 117 ++#define TK_BY 118 ++#define TK_GROUP 119 ++#define TK_HAVING 120 ++#define TK_LIMIT 121 ++#define TK_WHERE 122 ++#define TK_INTO 123 ++#define TK_VALUES 124 ++#define TK_VARIABLE 125 ++#define TK_CASE 126 ++#define TK_WHEN 127 ++#define TK_THEN 128 ++#define TK_ELSE 129 ++#define TK_INDEX 130 +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/parse.y +@@ -0,0 +1,897 @@ ++/* ++** 2001 September 15 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This file contains SQLite's grammar for SQL. Process this file ++** using the lemon parser generator to generate C code that runs ++** the parser. Lemon will also generate a header file containing ++** numeric codes for all of the tokens. ++** ++** @(#) $Id$ ++*/ ++%token_prefix TK_ ++%token_type {Token} ++%default_type {Token} ++%extra_argument {Parse *pParse} ++%syntax_error { ++ if( pParse->zErrMsg==0 ){ ++ if( TOKEN.z[0] ){ ++ sqliteErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN); ++ }else{ ++ sqliteErrorMsg(pParse, "incomplete SQL statement"); ++ } ++ } ++} ++%name sqliteParser ++%include { ++#include "sqliteInt.h" ++#include "parse.h" ++ ++/* ++** An instance of this structure holds information about the ++** LIMIT clause of a SELECT statement. ++*/ ++struct LimitVal { ++ int limit; /* The LIMIT value. -1 if there is no limit */ ++ int offset; /* The OFFSET. 0 if there is none */ ++}; ++ ++/* ++** An instance of the following structure describes the event of a ++** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT, ++** TK_DELETE, or TK_INSTEAD. If the event is of the form ++** ++** UPDATE ON (a,b,c) ++** ++** Then the "b" IdList records the list "a,b,c". ++*/ ++struct TrigEvent { int a; IdList * b; }; ++ ++} // end %include ++ ++// These are extra tokens used by the lexer but never seen by the ++// parser. We put them in a rule so that the parser generator will ++// add them to the parse.h output file. ++// ++%nonassoc END_OF_FILE ILLEGAL SPACE UNCLOSED_STRING COMMENT FUNCTION ++ COLUMN AGG_FUNCTION. ++ ++// Input is a single SQL command ++input ::= cmdlist. ++cmdlist ::= cmdlist ecmd. ++cmdlist ::= ecmd. ++ecmd ::= explain cmdx SEMI. ++ecmd ::= SEMI. ++cmdx ::= cmd. { sqliteExec(pParse); } ++explain ::= EXPLAIN. { sqliteBeginParse(pParse, 1); } ++explain ::= . { sqliteBeginParse(pParse, 0); } ++ ++///////////////////// Begin and end transactions. //////////////////////////// ++// ++ ++cmd ::= BEGIN trans_opt onconf(R). {sqliteBeginTransaction(pParse,R);} ++trans_opt ::= . ++trans_opt ::= TRANSACTION. ++trans_opt ::= TRANSACTION nm. ++cmd ::= COMMIT trans_opt. {sqliteCommitTransaction(pParse);} ++cmd ::= END trans_opt. {sqliteCommitTransaction(pParse);} ++cmd ::= ROLLBACK trans_opt. {sqliteRollbackTransaction(pParse);} ++ ++///////////////////// The CREATE TABLE statement //////////////////////////// ++// ++cmd ::= create_table create_table_args. ++create_table ::= CREATE(X) temp(T) TABLE nm(Y). { ++ sqliteStartTable(pParse,&X,&Y,T,0); ++} ++%type temp {int} ++temp(A) ::= TEMP. {A = 1;} ++temp(A) ::= . {A = 0;} ++create_table_args ::= LP columnlist conslist_opt RP(X). { ++ sqliteEndTable(pParse,&X,0); ++} ++create_table_args ::= AS select(S). { ++ sqliteEndTable(pParse,0,S); ++ sqliteSelectDelete(S); ++} ++columnlist ::= columnlist COMMA column. ++columnlist ::= column. ++ ++// About the only information used for a column is the name of the ++// column. The type is always just "text". But the code will accept ++// an elaborate typename. Perhaps someday we'll do something with it. ++// ++column ::= columnid type carglist. ++columnid ::= nm(X). {sqliteAddColumn(pParse,&X);} ++ ++// An IDENTIFIER can be a generic identifier, or one of several ++// keywords. Any non-standard keyword can also be an identifier. ++// ++%type id {Token} ++id(A) ::= ID(X). {A = X;} ++ ++// The following directive causes tokens ABORT, AFTER, ASC, etc. to ++// fallback to ID if they will not parse as their original value. ++// This obviates the need for the "id" nonterminal. ++// ++%fallback ID ++ ABORT AFTER ASC ATTACH BEFORE BEGIN CASCADE CLUSTER CONFLICT ++ COPY DATABASE DEFERRED DELIMITERS DESC DETACH EACH END EXPLAIN FAIL FOR ++ GLOB IGNORE IMMEDIATE INITIALLY INSTEAD LIKE MATCH KEY ++ OF OFFSET PRAGMA RAISE REPLACE RESTRICT ROW STATEMENT ++ TEMP TRIGGER VACUUM VIEW. ++ ++// Define operator precedence early so that this is the first occurance ++// of the operator tokens in the grammer. Keeping the operators together ++// causes them to be assigned integer values that are close together, ++// which keeps parser tables smaller. ++// ++%left OR. ++%left AND. ++%right NOT. ++%left EQ NE ISNULL NOTNULL IS LIKE GLOB BETWEEN IN. ++%left GT GE LT LE. ++%left BITAND BITOR LSHIFT RSHIFT. ++%left PLUS MINUS. ++%left STAR SLASH REM. ++%left CONCAT. ++%right UMINUS UPLUS BITNOT. ++ ++// And "ids" is an identifer-or-string. ++// ++%type ids {Token} ++ids(A) ::= ID(X). {A = X;} ++ids(A) ::= STRING(X). {A = X;} ++ ++// The name of a column or table can be any of the following: ++// ++%type nm {Token} ++nm(A) ::= ID(X). {A = X;} ++nm(A) ::= STRING(X). {A = X;} ++nm(A) ::= JOIN_KW(X). {A = X;} ++ ++type ::= . ++type ::= typename(X). {sqliteAddColumnType(pParse,&X,&X);} ++type ::= typename(X) LP signed RP(Y). {sqliteAddColumnType(pParse,&X,&Y);} ++type ::= typename(X) LP signed COMMA signed RP(Y). ++ {sqliteAddColumnType(pParse,&X,&Y);} ++%type typename {Token} ++typename(A) ::= ids(X). {A = X;} ++typename(A) ::= typename(X) ids. {A = X;} ++%type signed {int} ++signed(A) ::= INTEGER(X). { A = atoi(X.z); } ++signed(A) ::= PLUS INTEGER(X). { A = atoi(X.z); } ++signed(A) ::= MINUS INTEGER(X). { A = -atoi(X.z); } ++carglist ::= carglist carg. ++carglist ::= . ++carg ::= CONSTRAINT nm ccons. ++carg ::= ccons. ++carg ::= DEFAULT STRING(X). {sqliteAddDefaultValue(pParse,&X,0);} ++carg ::= DEFAULT ID(X). {sqliteAddDefaultValue(pParse,&X,0);} ++carg ::= DEFAULT INTEGER(X). {sqliteAddDefaultValue(pParse,&X,0);} ++carg ::= DEFAULT PLUS INTEGER(X). {sqliteAddDefaultValue(pParse,&X,0);} ++carg ::= DEFAULT MINUS INTEGER(X). {sqliteAddDefaultValue(pParse,&X,1);} ++carg ::= DEFAULT FLOAT(X). {sqliteAddDefaultValue(pParse,&X,0);} ++carg ::= DEFAULT PLUS FLOAT(X). {sqliteAddDefaultValue(pParse,&X,0);} ++carg ::= DEFAULT MINUS FLOAT(X). {sqliteAddDefaultValue(pParse,&X,1);} ++carg ::= DEFAULT NULL. ++ ++// In addition to the type name, we also care about the primary key and ++// UNIQUE constraints. ++// ++ccons ::= NULL onconf. ++ccons ::= NOT NULL onconf(R). {sqliteAddNotNull(pParse, R);} ++ccons ::= PRIMARY KEY sortorder onconf(R). {sqliteAddPrimaryKey(pParse,0,R);} ++ccons ::= UNIQUE onconf(R). {sqliteCreateIndex(pParse,0,0,0,R,0,0);} ++ccons ::= CHECK LP expr RP onconf. ++ccons ::= REFERENCES nm(T) idxlist_opt(TA) refargs(R). ++ {sqliteCreateForeignKey(pParse,0,&T,TA,R);} ++ccons ::= defer_subclause(D). {sqliteDeferForeignKey(pParse,D);} ++ccons ::= COLLATE id(C). { ++ sqliteAddCollateType(pParse, sqliteCollateType(C.z, C.n)); ++} ++ ++// The next group of rules parses the arguments to a REFERENCES clause ++// that determine if the referential integrity checking is deferred or ++// or immediate and which determine what action to take if a ref-integ ++// check fails. ++// ++%type refargs {int} ++refargs(A) ::= . { A = OE_Restrict * 0x010101; } ++refargs(A) ::= refargs(X) refarg(Y). { A = (X & Y.mask) | Y.value; } ++%type refarg {struct {int value; int mask;}} ++refarg(A) ::= MATCH nm. { A.value = 0; A.mask = 0x000000; } ++refarg(A) ::= ON DELETE refact(X). { A.value = X; A.mask = 0x0000ff; } ++refarg(A) ::= ON UPDATE refact(X). { A.value = X<<8; A.mask = 0x00ff00; } ++refarg(A) ::= ON INSERT refact(X). { A.value = X<<16; A.mask = 0xff0000; } ++%type refact {int} ++refact(A) ::= SET NULL. { A = OE_SetNull; } ++refact(A) ::= SET DEFAULT. { A = OE_SetDflt; } ++refact(A) ::= CASCADE. { A = OE_Cascade; } ++refact(A) ::= RESTRICT. { A = OE_Restrict; } ++%type defer_subclause {int} ++defer_subclause(A) ::= NOT DEFERRABLE init_deferred_pred_opt(X). {A = X;} ++defer_subclause(A) ::= DEFERRABLE init_deferred_pred_opt(X). {A = X;} ++%type init_deferred_pred_opt {int} ++init_deferred_pred_opt(A) ::= . {A = 0;} ++init_deferred_pred_opt(A) ::= INITIALLY DEFERRED. {A = 1;} ++init_deferred_pred_opt(A) ::= INITIALLY IMMEDIATE. {A = 0;} ++ ++// For the time being, the only constraint we care about is the primary ++// key and UNIQUE. Both create indices. ++// ++conslist_opt ::= . ++conslist_opt ::= COMMA conslist. ++conslist ::= conslist COMMA tcons. ++conslist ::= conslist tcons. ++conslist ::= tcons. ++tcons ::= CONSTRAINT nm. ++tcons ::= PRIMARY KEY LP idxlist(X) RP onconf(R). ++ {sqliteAddPrimaryKey(pParse,X,R);} ++tcons ::= UNIQUE LP idxlist(X) RP onconf(R). ++ {sqliteCreateIndex(pParse,0,0,X,R,0,0);} ++tcons ::= CHECK expr onconf. ++tcons ::= FOREIGN KEY LP idxlist(FA) RP ++ REFERENCES nm(T) idxlist_opt(TA) refargs(R) defer_subclause_opt(D). { ++ sqliteCreateForeignKey(pParse, FA, &T, TA, R); ++ sqliteDeferForeignKey(pParse, D); ++} ++%type defer_subclause_opt {int} ++defer_subclause_opt(A) ::= . {A = 0;} ++defer_subclause_opt(A) ::= defer_subclause(X). {A = X;} ++ ++// The following is a non-standard extension that allows us to declare the ++// default behavior when there is a constraint conflict. ++// ++%type onconf {int} ++%type orconf {int} ++%type resolvetype {int} ++onconf(A) ::= . { A = OE_Default; } ++onconf(A) ::= ON CONFLICT resolvetype(X). { A = X; } ++orconf(A) ::= . { A = OE_Default; } ++orconf(A) ::= OR resolvetype(X). { A = X; } ++resolvetype(A) ::= ROLLBACK. { A = OE_Rollback; } ++resolvetype(A) ::= ABORT. { A = OE_Abort; } ++resolvetype(A) ::= FAIL. { A = OE_Fail; } ++resolvetype(A) ::= IGNORE. { A = OE_Ignore; } ++resolvetype(A) ::= REPLACE. { A = OE_Replace; } ++ ++////////////////////////// The DROP TABLE ///////////////////////////////////// ++// ++cmd ::= DROP TABLE nm(X). {sqliteDropTable(pParse,&X,0);} ++ ++///////////////////// The CREATE VIEW statement ///////////////////////////// ++// ++cmd ::= CREATE(X) temp(T) VIEW nm(Y) AS select(S). { ++ sqliteCreateView(pParse, &X, &Y, S, T); ++} ++cmd ::= DROP VIEW nm(X). { ++ sqliteDropTable(pParse, &X, 1); ++} ++ ++//////////////////////// The SELECT statement ///////////////////////////////// ++// ++cmd ::= select(X). { ++ sqliteSelect(pParse, X, SRT_Callback, 0, 0, 0, 0); ++ sqliteSelectDelete(X); ++} ++ ++%type select {Select*} ++%destructor select {sqliteSelectDelete($$);} ++%type oneselect {Select*} ++%destructor oneselect {sqliteSelectDelete($$);} ++ ++select(A) ::= oneselect(X). {A = X;} ++select(A) ::= select(X) multiselect_op(Y) oneselect(Z). { ++ if( Z ){ ++ Z->op = Y; ++ Z->pPrior = X; ++ } ++ A = Z; ++} ++%type multiselect_op {int} ++multiselect_op(A) ::= UNION. {A = TK_UNION;} ++multiselect_op(A) ::= UNION ALL. {A = TK_ALL;} ++multiselect_op(A) ::= INTERSECT. {A = TK_INTERSECT;} ++multiselect_op(A) ::= EXCEPT. {A = TK_EXCEPT;} ++oneselect(A) ::= SELECT distinct(D) selcollist(W) from(X) where_opt(Y) ++ groupby_opt(P) having_opt(Q) orderby_opt(Z) limit_opt(L). { ++ A = sqliteSelectNew(W,X,Y,P,Q,Z,D,L.limit,L.offset); ++} ++ ++// The "distinct" nonterminal is true (1) if the DISTINCT keyword is ++// present and false (0) if it is not. ++// ++%type distinct {int} ++distinct(A) ::= DISTINCT. {A = 1;} ++distinct(A) ::= ALL. {A = 0;} ++distinct(A) ::= . {A = 0;} ++ ++// selcollist is a list of expressions that are to become the return ++// values of the SELECT statement. The "*" in statements like ++// "SELECT * FROM ..." is encoded as a special expression with an ++// opcode of TK_ALL. ++// ++%type selcollist {ExprList*} ++%destructor selcollist {sqliteExprListDelete($$);} ++%type sclp {ExprList*} ++%destructor sclp {sqliteExprListDelete($$);} ++sclp(A) ::= selcollist(X) COMMA. {A = X;} ++sclp(A) ::= . {A = 0;} ++selcollist(A) ::= sclp(P) expr(X) as(Y). { ++ A = sqliteExprListAppend(P,X,Y.n?&Y:0); ++} ++selcollist(A) ::= sclp(P) STAR. { ++ A = sqliteExprListAppend(P, sqliteExpr(TK_ALL, 0, 0, 0), 0); ++} ++selcollist(A) ::= sclp(P) nm(X) DOT STAR. { ++ Expr *pRight = sqliteExpr(TK_ALL, 0, 0, 0); ++ Expr *pLeft = sqliteExpr(TK_ID, 0, 0, &X); ++ A = sqliteExprListAppend(P, sqliteExpr(TK_DOT, pLeft, pRight, 0), 0); ++} ++ ++// An option "AS " phrase that can follow one of the expressions that ++// define the result set, or one of the tables in the FROM clause. ++// ++%type as {Token} ++as(X) ::= AS nm(Y). { X = Y; } ++as(X) ::= ids(Y). { X = Y; } ++as(X) ::= . { X.n = 0; } ++ ++ ++%type seltablist {SrcList*} ++%destructor seltablist {sqliteSrcListDelete($$);} ++%type stl_prefix {SrcList*} ++%destructor stl_prefix {sqliteSrcListDelete($$);} ++%type from {SrcList*} ++%destructor from {sqliteSrcListDelete($$);} ++ ++// A complete FROM clause. ++// ++from(A) ::= . {A = sqliteMalloc(sizeof(*A));} ++from(A) ::= FROM seltablist(X). {A = X;} ++ ++// "seltablist" is a "Select Table List" - the content of the FROM clause ++// in a SELECT statement. "stl_prefix" is a prefix of this list. ++// ++stl_prefix(A) ::= seltablist(X) joinop(Y). { ++ A = X; ++ if( A && A->nSrc>0 ) A->a[A->nSrc-1].jointype = Y; ++} ++stl_prefix(A) ::= . {A = 0;} ++seltablist(A) ::= stl_prefix(X) nm(Y) dbnm(D) as(Z) on_opt(N) using_opt(U). { ++ A = sqliteSrcListAppend(X,&Y,&D); ++ if( Z.n ) sqliteSrcListAddAlias(A,&Z); ++ if( N ){ ++ if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pOn = N; } ++ else { sqliteExprDelete(N); } ++ } ++ if( U ){ ++ if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pUsing = U; } ++ else { sqliteIdListDelete(U); } ++ } ++} ++seltablist(A) ::= stl_prefix(X) LP seltablist_paren(S) RP ++ as(Z) on_opt(N) using_opt(U). { ++ A = sqliteSrcListAppend(X,0,0); ++ A->a[A->nSrc-1].pSelect = S; ++ if( Z.n ) sqliteSrcListAddAlias(A,&Z); ++ if( N ){ ++ if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pOn = N; } ++ else { sqliteExprDelete(N); } ++ } ++ if( U ){ ++ if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pUsing = U; } ++ else { sqliteIdListDelete(U); } ++ } ++} ++ ++// A seltablist_paren nonterminal represents anything in a FROM that ++// is contained inside parentheses. This can be either a subquery or ++// a grouping of table and subqueries. ++// ++%type seltablist_paren {Select*} ++%destructor seltablist_paren {sqliteSelectDelete($$);} ++seltablist_paren(A) ::= select(S). {A = S;} ++seltablist_paren(A) ::= seltablist(F). { ++ A = sqliteSelectNew(0,F,0,0,0,0,0,-1,0); ++} ++ ++%type dbnm {Token} ++dbnm(A) ::= . {A.z=0; A.n=0;} ++dbnm(A) ::= DOT nm(X). {A = X;} ++ ++%type joinop {int} ++%type joinop2 {int} ++joinop(X) ::= COMMA. { X = JT_INNER; } ++joinop(X) ::= JOIN. { X = JT_INNER; } ++joinop(X) ::= JOIN_KW(A) JOIN. { X = sqliteJoinType(pParse,&A,0,0); } ++joinop(X) ::= JOIN_KW(A) nm(B) JOIN. { X = sqliteJoinType(pParse,&A,&B,0); } ++joinop(X) ::= JOIN_KW(A) nm(B) nm(C) JOIN. ++ { X = sqliteJoinType(pParse,&A,&B,&C); } ++ ++%type on_opt {Expr*} ++%destructor on_opt {sqliteExprDelete($$);} ++on_opt(N) ::= ON expr(E). {N = E;} ++on_opt(N) ::= . {N = 0;} ++ ++%type using_opt {IdList*} ++%destructor using_opt {sqliteIdListDelete($$);} ++using_opt(U) ::= USING LP idxlist(L) RP. {U = L;} ++using_opt(U) ::= . {U = 0;} ++ ++ ++%type orderby_opt {ExprList*} ++%destructor orderby_opt {sqliteExprListDelete($$);} ++%type sortlist {ExprList*} ++%destructor sortlist {sqliteExprListDelete($$);} ++%type sortitem {Expr*} ++%destructor sortitem {sqliteExprDelete($$);} ++ ++orderby_opt(A) ::= . {A = 0;} ++orderby_opt(A) ::= ORDER BY sortlist(X). {A = X;} ++sortlist(A) ::= sortlist(X) COMMA sortitem(Y) collate(C) sortorder(Z). { ++ A = sqliteExprListAppend(X,Y,0); ++ if( A ) A->a[A->nExpr-1].sortOrder = C+Z; ++} ++sortlist(A) ::= sortitem(Y) collate(C) sortorder(Z). { ++ A = sqliteExprListAppend(0,Y,0); ++ if( A ) A->a[0].sortOrder = C+Z; ++} ++sortitem(A) ::= expr(X). {A = X;} ++ ++%type sortorder {int} ++%type collate {int} ++ ++sortorder(A) ::= ASC. {A = SQLITE_SO_ASC;} ++sortorder(A) ::= DESC. {A = SQLITE_SO_DESC;} ++sortorder(A) ::= . {A = SQLITE_SO_ASC;} ++collate(C) ::= . {C = SQLITE_SO_UNK;} ++collate(C) ::= COLLATE id(X). {C = sqliteCollateType(X.z, X.n);} ++ ++%type groupby_opt {ExprList*} ++%destructor groupby_opt {sqliteExprListDelete($$);} ++groupby_opt(A) ::= . {A = 0;} ++groupby_opt(A) ::= GROUP BY exprlist(X). {A = X;} ++ ++%type having_opt {Expr*} ++%destructor having_opt {sqliteExprDelete($$);} ++having_opt(A) ::= . {A = 0;} ++having_opt(A) ::= HAVING expr(X). {A = X;} ++ ++%type limit_opt {struct LimitVal} ++limit_opt(A) ::= . {A.limit = -1; A.offset = 0;} ++limit_opt(A) ::= LIMIT signed(X). {A.limit = X; A.offset = 0;} ++limit_opt(A) ::= LIMIT signed(X) OFFSET signed(Y). ++ {A.limit = X; A.offset = Y;} ++limit_opt(A) ::= LIMIT signed(X) COMMA signed(Y). ++ {A.limit = Y; A.offset = X;} ++ ++/////////////////////////// The DELETE statement ///////////////////////////// ++// ++cmd ::= DELETE FROM nm(X) dbnm(D) where_opt(Y). { ++ sqliteDeleteFrom(pParse, sqliteSrcListAppend(0,&X,&D), Y); ++} ++ ++%type where_opt {Expr*} ++%destructor where_opt {sqliteExprDelete($$);} ++ ++where_opt(A) ::= . {A = 0;} ++where_opt(A) ::= WHERE expr(X). {A = X;} ++ ++%type setlist {ExprList*} ++%destructor setlist {sqliteExprListDelete($$);} ++ ++////////////////////////// The UPDATE command //////////////////////////////// ++// ++cmd ::= UPDATE orconf(R) nm(X) dbnm(D) SET setlist(Y) where_opt(Z). ++ {sqliteUpdate(pParse,sqliteSrcListAppend(0,&X,&D),Y,Z,R);} ++ ++setlist(A) ::= setlist(Z) COMMA nm(X) EQ expr(Y). ++ {A = sqliteExprListAppend(Z,Y,&X);} ++setlist(A) ::= nm(X) EQ expr(Y). {A = sqliteExprListAppend(0,Y,&X);} ++ ++////////////////////////// The INSERT command ///////////////////////////////// ++// ++cmd ::= insert_cmd(R) INTO nm(X) dbnm(D) inscollist_opt(F) ++ VALUES LP itemlist(Y) RP. ++ {sqliteInsert(pParse, sqliteSrcListAppend(0,&X,&D), Y, 0, F, R);} ++cmd ::= insert_cmd(R) INTO nm(X) dbnm(D) inscollist_opt(F) select(S). ++ {sqliteInsert(pParse, sqliteSrcListAppend(0,&X,&D), 0, S, F, R);} ++ ++%type insert_cmd {int} ++insert_cmd(A) ::= INSERT orconf(R). {A = R;} ++insert_cmd(A) ::= REPLACE. {A = OE_Replace;} ++ ++ ++%type itemlist {ExprList*} ++%destructor itemlist {sqliteExprListDelete($$);} ++ ++itemlist(A) ::= itemlist(X) COMMA expr(Y). {A = sqliteExprListAppend(X,Y,0);} ++itemlist(A) ::= expr(X). {A = sqliteExprListAppend(0,X,0);} ++ ++%type inscollist_opt {IdList*} ++%destructor inscollist_opt {sqliteIdListDelete($$);} ++%type inscollist {IdList*} ++%destructor inscollist {sqliteIdListDelete($$);} ++ ++inscollist_opt(A) ::= . {A = 0;} ++inscollist_opt(A) ::= LP inscollist(X) RP. {A = X;} ++inscollist(A) ::= inscollist(X) COMMA nm(Y). {A = sqliteIdListAppend(X,&Y);} ++inscollist(A) ::= nm(Y). {A = sqliteIdListAppend(0,&Y);} ++ ++/////////////////////////// Expression Processing ///////////////////////////// ++// ++ ++%type expr {Expr*} ++%destructor expr {sqliteExprDelete($$);} ++ ++expr(A) ::= LP(B) expr(X) RP(E). {A = X; sqliteExprSpan(A,&B,&E); } ++expr(A) ::= NULL(X). {A = sqliteExpr(TK_NULL, 0, 0, &X);} ++expr(A) ::= ID(X). {A = sqliteExpr(TK_ID, 0, 0, &X);} ++expr(A) ::= JOIN_KW(X). {A = sqliteExpr(TK_ID, 0, 0, &X);} ++expr(A) ::= nm(X) DOT nm(Y). { ++ Expr *temp1 = sqliteExpr(TK_ID, 0, 0, &X); ++ Expr *temp2 = sqliteExpr(TK_ID, 0, 0, &Y); ++ A = sqliteExpr(TK_DOT, temp1, temp2, 0); ++} ++expr(A) ::= nm(X) DOT nm(Y) DOT nm(Z). { ++ Expr *temp1 = sqliteExpr(TK_ID, 0, 0, &X); ++ Expr *temp2 = sqliteExpr(TK_ID, 0, 0, &Y); ++ Expr *temp3 = sqliteExpr(TK_ID, 0, 0, &Z); ++ Expr *temp4 = sqliteExpr(TK_DOT, temp2, temp3, 0); ++ A = sqliteExpr(TK_DOT, temp1, temp4, 0); ++} ++expr(A) ::= INTEGER(X). {A = sqliteExpr(TK_INTEGER, 0, 0, &X);} ++expr(A) ::= FLOAT(X). {A = sqliteExpr(TK_FLOAT, 0, 0, &X);} ++expr(A) ::= STRING(X). {A = sqliteExpr(TK_STRING, 0, 0, &X);} ++expr(A) ::= VARIABLE(X). { ++ A = sqliteExpr(TK_VARIABLE, 0, 0, &X); ++ if( A ) A->iTable = ++pParse->nVar; ++} ++expr(A) ::= ID(X) LP exprlist(Y) RP(E). { ++ A = sqliteExprFunction(Y, &X); ++ sqliteExprSpan(A,&X,&E); ++} ++expr(A) ::= ID(X) LP STAR RP(E). { ++ A = sqliteExprFunction(0, &X); ++ sqliteExprSpan(A,&X,&E); ++} ++expr(A) ::= expr(X) AND expr(Y). {A = sqliteExpr(TK_AND, X, Y, 0);} ++expr(A) ::= expr(X) OR expr(Y). {A = sqliteExpr(TK_OR, X, Y, 0);} ++expr(A) ::= expr(X) LT expr(Y). {A = sqliteExpr(TK_LT, X, Y, 0);} ++expr(A) ::= expr(X) GT expr(Y). {A = sqliteExpr(TK_GT, X, Y, 0);} ++expr(A) ::= expr(X) LE expr(Y). {A = sqliteExpr(TK_LE, X, Y, 0);} ++expr(A) ::= expr(X) GE expr(Y). {A = sqliteExpr(TK_GE, X, Y, 0);} ++expr(A) ::= expr(X) NE expr(Y). {A = sqliteExpr(TK_NE, X, Y, 0);} ++expr(A) ::= expr(X) EQ expr(Y). {A = sqliteExpr(TK_EQ, X, Y, 0);} ++expr(A) ::= expr(X) BITAND expr(Y). {A = sqliteExpr(TK_BITAND, X, Y, 0);} ++expr(A) ::= expr(X) BITOR expr(Y). {A = sqliteExpr(TK_BITOR, X, Y, 0);} ++expr(A) ::= expr(X) LSHIFT expr(Y). {A = sqliteExpr(TK_LSHIFT, X, Y, 0);} ++expr(A) ::= expr(X) RSHIFT expr(Y). {A = sqliteExpr(TK_RSHIFT, X, Y, 0);} ++expr(A) ::= expr(X) likeop(OP) expr(Y). [LIKE] { ++ ExprList *pList = sqliteExprListAppend(0, Y, 0); ++ pList = sqliteExprListAppend(pList, X, 0); ++ A = sqliteExprFunction(pList, 0); ++ if( A ) A->op = OP; ++ sqliteExprSpan(A, &X->span, &Y->span); ++} ++expr(A) ::= expr(X) NOT likeop(OP) expr(Y). [LIKE] { ++ ExprList *pList = sqliteExprListAppend(0, Y, 0); ++ pList = sqliteExprListAppend(pList, X, 0); ++ A = sqliteExprFunction(pList, 0); ++ if( A ) A->op = OP; ++ A = sqliteExpr(TK_NOT, A, 0, 0); ++ sqliteExprSpan(A,&X->span,&Y->span); ++} ++%type likeop {int} ++likeop(A) ::= LIKE. {A = TK_LIKE;} ++likeop(A) ::= GLOB. {A = TK_GLOB;} ++expr(A) ::= expr(X) PLUS expr(Y). {A = sqliteExpr(TK_PLUS, X, Y, 0);} ++expr(A) ::= expr(X) MINUS expr(Y). {A = sqliteExpr(TK_MINUS, X, Y, 0);} ++expr(A) ::= expr(X) STAR expr(Y). {A = sqliteExpr(TK_STAR, X, Y, 0);} ++expr(A) ::= expr(X) SLASH expr(Y). {A = sqliteExpr(TK_SLASH, X, Y, 0);} ++expr(A) ::= expr(X) REM expr(Y). {A = sqliteExpr(TK_REM, X, Y, 0);} ++expr(A) ::= expr(X) CONCAT expr(Y). {A = sqliteExpr(TK_CONCAT, X, Y, 0);} ++expr(A) ::= expr(X) ISNULL(E). { ++ A = sqliteExpr(TK_ISNULL, X, 0, 0); ++ sqliteExprSpan(A,&X->span,&E); ++} ++expr(A) ::= expr(X) IS NULL(E). { ++ A = sqliteExpr(TK_ISNULL, X, 0, 0); ++ sqliteExprSpan(A,&X->span,&E); ++} ++expr(A) ::= expr(X) NOTNULL(E). { ++ A = sqliteExpr(TK_NOTNULL, X, 0, 0); ++ sqliteExprSpan(A,&X->span,&E); ++} ++expr(A) ::= expr(X) NOT NULL(E). { ++ A = sqliteExpr(TK_NOTNULL, X, 0, 0); ++ sqliteExprSpan(A,&X->span,&E); ++} ++expr(A) ::= expr(X) IS NOT NULL(E). { ++ A = sqliteExpr(TK_NOTNULL, X, 0, 0); ++ sqliteExprSpan(A,&X->span,&E); ++} ++expr(A) ::= NOT(B) expr(X). { ++ A = sqliteExpr(TK_NOT, X, 0, 0); ++ sqliteExprSpan(A,&B,&X->span); ++} ++expr(A) ::= BITNOT(B) expr(X). { ++ A = sqliteExpr(TK_BITNOT, X, 0, 0); ++ sqliteExprSpan(A,&B,&X->span); ++} ++expr(A) ::= MINUS(B) expr(X). [UMINUS] { ++ A = sqliteExpr(TK_UMINUS, X, 0, 0); ++ sqliteExprSpan(A,&B,&X->span); ++} ++expr(A) ::= PLUS(B) expr(X). [UPLUS] { ++ A = sqliteExpr(TK_UPLUS, X, 0, 0); ++ sqliteExprSpan(A,&B,&X->span); ++} ++expr(A) ::= LP(B) select(X) RP(E). { ++ A = sqliteExpr(TK_SELECT, 0, 0, 0); ++ if( A ) A->pSelect = X; ++ sqliteExprSpan(A,&B,&E); ++} ++expr(A) ::= expr(W) BETWEEN expr(X) AND expr(Y). { ++ ExprList *pList = sqliteExprListAppend(0, X, 0); ++ pList = sqliteExprListAppend(pList, Y, 0); ++ A = sqliteExpr(TK_BETWEEN, W, 0, 0); ++ if( A ) A->pList = pList; ++ sqliteExprSpan(A,&W->span,&Y->span); ++} ++expr(A) ::= expr(W) NOT BETWEEN expr(X) AND expr(Y). { ++ ExprList *pList = sqliteExprListAppend(0, X, 0); ++ pList = sqliteExprListAppend(pList, Y, 0); ++ A = sqliteExpr(TK_BETWEEN, W, 0, 0); ++ if( A ) A->pList = pList; ++ A = sqliteExpr(TK_NOT, A, 0, 0); ++ sqliteExprSpan(A,&W->span,&Y->span); ++} ++expr(A) ::= expr(X) IN LP exprlist(Y) RP(E). { ++ A = sqliteExpr(TK_IN, X, 0, 0); ++ if( A ) A->pList = Y; ++ sqliteExprSpan(A,&X->span,&E); ++} ++expr(A) ::= expr(X) IN LP select(Y) RP(E). { ++ A = sqliteExpr(TK_IN, X, 0, 0); ++ if( A ) A->pSelect = Y; ++ sqliteExprSpan(A,&X->span,&E); ++} ++expr(A) ::= expr(X) NOT IN LP exprlist(Y) RP(E). { ++ A = sqliteExpr(TK_IN, X, 0, 0); ++ if( A ) A->pList = Y; ++ A = sqliteExpr(TK_NOT, A, 0, 0); ++ sqliteExprSpan(A,&X->span,&E); ++} ++expr(A) ::= expr(X) NOT IN LP select(Y) RP(E). { ++ A = sqliteExpr(TK_IN, X, 0, 0); ++ if( A ) A->pSelect = Y; ++ A = sqliteExpr(TK_NOT, A, 0, 0); ++ sqliteExprSpan(A,&X->span,&E); ++} ++expr(A) ::= expr(X) IN nm(Y) dbnm(D). { ++ SrcList *pSrc = sqliteSrcListAppend(0, &Y, &D); ++ A = sqliteExpr(TK_IN, X, 0, 0); ++ if( A ) A->pSelect = sqliteSelectNew(0,pSrc,0,0,0,0,0,-1,0); ++ sqliteExprSpan(A,&X->span,D.z?&D:&Y); ++} ++expr(A) ::= expr(X) NOT IN nm(Y) dbnm(D). { ++ SrcList *pSrc = sqliteSrcListAppend(0, &Y, &D); ++ A = sqliteExpr(TK_IN, X, 0, 0); ++ if( A ) A->pSelect = sqliteSelectNew(0,pSrc,0,0,0,0,0,-1,0); ++ A = sqliteExpr(TK_NOT, A, 0, 0); ++ sqliteExprSpan(A,&X->span,D.z?&D:&Y); ++} ++ ++ ++/* CASE expressions */ ++expr(A) ::= CASE(C) case_operand(X) case_exprlist(Y) case_else(Z) END(E). { ++ A = sqliteExpr(TK_CASE, X, Z, 0); ++ if( A ) A->pList = Y; ++ sqliteExprSpan(A, &C, &E); ++} ++%type case_exprlist {ExprList*} ++%destructor case_exprlist {sqliteExprListDelete($$);} ++case_exprlist(A) ::= case_exprlist(X) WHEN expr(Y) THEN expr(Z). { ++ A = sqliteExprListAppend(X, Y, 0); ++ A = sqliteExprListAppend(A, Z, 0); ++} ++case_exprlist(A) ::= WHEN expr(Y) THEN expr(Z). { ++ A = sqliteExprListAppend(0, Y, 0); ++ A = sqliteExprListAppend(A, Z, 0); ++} ++%type case_else {Expr*} ++case_else(A) ::= ELSE expr(X). {A = X;} ++case_else(A) ::= . {A = 0;} ++%type case_operand {Expr*} ++case_operand(A) ::= expr(X). {A = X;} ++case_operand(A) ::= . {A = 0;} ++ ++%type exprlist {ExprList*} ++%destructor exprlist {sqliteExprListDelete($$);} ++%type expritem {Expr*} ++%destructor expritem {sqliteExprDelete($$);} ++ ++exprlist(A) ::= exprlist(X) COMMA expritem(Y). ++ {A = sqliteExprListAppend(X,Y,0);} ++exprlist(A) ::= expritem(X). {A = sqliteExprListAppend(0,X,0);} ++expritem(A) ::= expr(X). {A = X;} ++expritem(A) ::= . {A = 0;} ++ ++///////////////////////////// The CREATE INDEX command /////////////////////// ++// ++cmd ::= CREATE(S) uniqueflag(U) INDEX nm(X) ++ ON nm(Y) dbnm(D) LP idxlist(Z) RP(E) onconf(R). { ++ SrcList *pSrc = sqliteSrcListAppend(0, &Y, &D); ++ if( U!=OE_None ) U = R; ++ if( U==OE_Default) U = OE_Abort; ++ sqliteCreateIndex(pParse, &X, pSrc, Z, U, &S, &E); ++} ++ ++%type uniqueflag {int} ++uniqueflag(A) ::= UNIQUE. { A = OE_Abort; } ++uniqueflag(A) ::= . { A = OE_None; } ++ ++%type idxlist {IdList*} ++%destructor idxlist {sqliteIdListDelete($$);} ++%type idxlist_opt {IdList*} ++%destructor idxlist_opt {sqliteIdListDelete($$);} ++%type idxitem {Token} ++ ++idxlist_opt(A) ::= . {A = 0;} ++idxlist_opt(A) ::= LP idxlist(X) RP. {A = X;} ++idxlist(A) ::= idxlist(X) COMMA idxitem(Y). {A = sqliteIdListAppend(X,&Y);} ++idxlist(A) ::= idxitem(Y). {A = sqliteIdListAppend(0,&Y);} ++idxitem(A) ::= nm(X) sortorder. {A = X;} ++ ++///////////////////////////// The DROP INDEX command ///////////////////////// ++// ++ ++cmd ::= DROP INDEX nm(X) dbnm(Y). { ++ sqliteDropIndex(pParse, sqliteSrcListAppend(0,&X,&Y)); ++} ++ ++ ++///////////////////////////// The COPY command /////////////////////////////// ++// ++cmd ::= COPY orconf(R) nm(X) dbnm(D) FROM nm(Y) USING DELIMITERS STRING(Z). ++ {sqliteCopy(pParse,sqliteSrcListAppend(0,&X,&D),&Y,&Z,R);} ++cmd ::= COPY orconf(R) nm(X) dbnm(D) FROM nm(Y). ++ {sqliteCopy(pParse,sqliteSrcListAppend(0,&X,&D),&Y,0,R);} ++ ++///////////////////////////// The VACUUM command ///////////////////////////// ++// ++cmd ::= VACUUM. {sqliteVacuum(pParse,0);} ++cmd ::= VACUUM nm(X). {sqliteVacuum(pParse,&X);} ++ ++///////////////////////////// The PRAGMA command ///////////////////////////// ++// ++cmd ::= PRAGMA ids(X) EQ nm(Y). {sqlitePragma(pParse,&X,&Y,0);} ++cmd ::= PRAGMA ids(X) EQ ON(Y). {sqlitePragma(pParse,&X,&Y,0);} ++cmd ::= PRAGMA ids(X) EQ plus_num(Y). {sqlitePragma(pParse,&X,&Y,0);} ++cmd ::= PRAGMA ids(X) EQ minus_num(Y). {sqlitePragma(pParse,&X,&Y,1);} ++cmd ::= PRAGMA ids(X) LP nm(Y) RP. {sqlitePragma(pParse,&X,&Y,0);} ++cmd ::= PRAGMA ids(X). {sqlitePragma(pParse,&X,&X,0);} ++plus_num(A) ::= plus_opt number(X). {A = X;} ++minus_num(A) ::= MINUS number(X). {A = X;} ++number(A) ::= INTEGER(X). {A = X;} ++number(A) ::= FLOAT(X). {A = X;} ++plus_opt ::= PLUS. ++plus_opt ::= . ++ ++//////////////////////////// The CREATE TRIGGER command ///////////////////// ++ ++cmd ::= CREATE(A) trigger_decl BEGIN trigger_cmd_list(S) END(Z). { ++ Token all; ++ all.z = A.z; ++ all.n = (Z.z - A.z) + Z.n; ++ sqliteFinishTrigger(pParse, S, &all); ++} ++ ++trigger_decl ::= temp(T) TRIGGER nm(B) trigger_time(C) trigger_event(D) ++ ON nm(E) dbnm(DB) foreach_clause(F) when_clause(G). { ++ SrcList *pTab = sqliteSrcListAppend(0, &E, &DB); ++ sqliteBeginTrigger(pParse, &B, C, D.a, D.b, pTab, F, G, T); ++} ++ ++%type trigger_time {int} ++trigger_time(A) ::= BEFORE. { A = TK_BEFORE; } ++trigger_time(A) ::= AFTER. { A = TK_AFTER; } ++trigger_time(A) ::= INSTEAD OF. { A = TK_INSTEAD;} ++trigger_time(A) ::= . { A = TK_BEFORE; } ++ ++%type trigger_event {struct TrigEvent} ++%destructor trigger_event {sqliteIdListDelete($$.b);} ++trigger_event(A) ::= DELETE. { A.a = TK_DELETE; A.b = 0; } ++trigger_event(A) ::= INSERT. { A.a = TK_INSERT; A.b = 0; } ++trigger_event(A) ::= UPDATE. { A.a = TK_UPDATE; A.b = 0;} ++trigger_event(A) ::= UPDATE OF inscollist(X). {A.a = TK_UPDATE; A.b = X; } ++ ++%type foreach_clause {int} ++foreach_clause(A) ::= . { A = TK_ROW; } ++foreach_clause(A) ::= FOR EACH ROW. { A = TK_ROW; } ++foreach_clause(A) ::= FOR EACH STATEMENT. { A = TK_STATEMENT; } ++ ++%type when_clause {Expr *} ++when_clause(A) ::= . { A = 0; } ++when_clause(A) ::= WHEN expr(X). { A = X; } ++ ++%type trigger_cmd_list {TriggerStep *} ++%destructor trigger_cmd_list {sqliteDeleteTriggerStep($$);} ++trigger_cmd_list(A) ::= trigger_cmd(X) SEMI trigger_cmd_list(Y). { ++ X->pNext = Y; ++ A = X; ++} ++trigger_cmd_list(A) ::= . { A = 0; } ++ ++%type trigger_cmd {TriggerStep *} ++%destructor trigger_cmd {sqliteDeleteTriggerStep($$);} ++// UPDATE ++trigger_cmd(A) ::= UPDATE orconf(R) nm(X) SET setlist(Y) where_opt(Z). ++ { A = sqliteTriggerUpdateStep(&X, Y, Z, R); } ++ ++// INSERT ++trigger_cmd(A) ::= insert_cmd(R) INTO nm(X) inscollist_opt(F) ++ VALUES LP itemlist(Y) RP. ++{A = sqliteTriggerInsertStep(&X, F, Y, 0, R);} ++ ++trigger_cmd(A) ::= insert_cmd(R) INTO nm(X) inscollist_opt(F) select(S). ++ {A = sqliteTriggerInsertStep(&X, F, 0, S, R);} ++ ++// DELETE ++trigger_cmd(A) ::= DELETE FROM nm(X) where_opt(Y). ++ {A = sqliteTriggerDeleteStep(&X, Y);} ++ ++// SELECT ++trigger_cmd(A) ::= select(X). {A = sqliteTriggerSelectStep(X); } ++ ++// The special RAISE expression that may occur in trigger programs ++expr(A) ::= RAISE(X) LP IGNORE RP(Y). { ++ A = sqliteExpr(TK_RAISE, 0, 0, 0); ++ A->iColumn = OE_Ignore; ++ sqliteExprSpan(A, &X, &Y); ++} ++expr(A) ::= RAISE(X) LP ROLLBACK COMMA nm(Z) RP(Y). { ++ A = sqliteExpr(TK_RAISE, 0, 0, &Z); ++ A->iColumn = OE_Rollback; ++ sqliteExprSpan(A, &X, &Y); ++} ++expr(A) ::= RAISE(X) LP ABORT COMMA nm(Z) RP(Y). { ++ A = sqliteExpr(TK_RAISE, 0, 0, &Z); ++ A->iColumn = OE_Abort; ++ sqliteExprSpan(A, &X, &Y); ++} ++expr(A) ::= RAISE(X) LP FAIL COMMA nm(Z) RP(Y). { ++ A = sqliteExpr(TK_RAISE, 0, 0, &Z); ++ A->iColumn = OE_Fail; ++ sqliteExprSpan(A, &X, &Y); ++} ++ ++//////////////////////// DROP TRIGGER statement ////////////////////////////// ++cmd ::= DROP TRIGGER nm(X) dbnm(D). { ++ sqliteDropTrigger(pParse,sqliteSrcListAppend(0,&X,&D)); ++} ++ ++//////////////////////// ATTACH DATABASE file AS name ///////////////////////// ++cmd ::= ATTACH database_kw_opt ids(F) AS nm(D) key_opt(K). { ++ sqliteAttach(pParse, &F, &D, &K); ++} ++%type key_opt {Token} ++key_opt(A) ::= USING ids(X). { A = X; } ++key_opt(A) ::= . { A.z = 0; A.n = 0; } ++ ++database_kw_opt ::= DATABASE. ++database_kw_opt ::= . ++ ++//////////////////////// DETACH DATABASE name ///////////////////////////////// ++cmd ::= DETACH database_kw_opt nm(D). { ++ sqliteDetach(pParse, &D); ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/pragma.c +@@ -0,0 +1,712 @@ ++/* ++** 2003 April 6 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This file contains code used to implement the PRAGMA command. ++** ++** $Id$ ++*/ ++#include "sqliteInt.h" ++#include ++ ++/* ++** Interpret the given string as a boolean value. ++*/ ++static int getBoolean(const char *z){ ++ static char *azTrue[] = { "yes", "on", "true" }; ++ int i; ++ if( z[0]==0 ) return 0; ++ if( isdigit(z[0]) || (z[0]=='-' && isdigit(z[1])) ){ ++ return atoi(z); ++ } ++ for(i=0; i='0' && z[0]<='2' ){ ++ return z[0] - '0'; ++ }else if( sqliteStrICmp(z, "file")==0 ){ ++ return 1; ++ }else if( sqliteStrICmp(z, "memory")==0 ){ ++ return 2; ++ }else{ ++ return 0; ++ } ++} ++ ++/* ++** If the TEMP database is open, close it and mark the database schema ++** as needing reloading. This must be done when using the TEMP_STORE ++** or DEFAULT_TEMP_STORE pragmas. ++*/ ++static int changeTempStorage(Parse *pParse, const char *zStorageType){ ++ int ts = getTempStore(zStorageType); ++ sqlite *db = pParse->db; ++ if( db->temp_store==ts ) return SQLITE_OK; ++ if( db->aDb[1].pBt!=0 ){ ++ if( db->flags & SQLITE_InTrans ){ ++ sqliteErrorMsg(pParse, "temporary storage cannot be changed " ++ "from within a transaction"); ++ return SQLITE_ERROR; ++ } ++ sqliteBtreeClose(db->aDb[1].pBt); ++ db->aDb[1].pBt = 0; ++ sqliteResetInternalSchema(db, 0); ++ } ++ db->temp_store = ts; ++ return SQLITE_OK; ++} ++ ++/* ++** Check to see if zRight and zLeft refer to a pragma that queries ++** or changes one of the flags in db->flags. Return 1 if so and 0 if not. ++** Also, implement the pragma. ++*/ ++static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){ ++ static const struct { ++ const char *zName; /* Name of the pragma */ ++ int mask; /* Mask for the db->flags value */ ++ } aPragma[] = { ++ { "vdbe_trace", SQLITE_VdbeTrace }, ++ { "full_column_names", SQLITE_FullColNames }, ++ { "short_column_names", SQLITE_ShortColNames }, ++ { "show_datatypes", SQLITE_ReportTypes }, ++ { "count_changes", SQLITE_CountRows }, ++ { "empty_result_callbacks", SQLITE_NullCallback }, ++ }; ++ int i; ++ for(i=0; idb; ++ Vdbe *v; ++ if( strcmp(zLeft,zRight)==0 && (v = sqliteGetVdbe(pParse))!=0 ){ ++ sqliteVdbeOp3(v, OP_ColumnName, 0, 1, aPragma[i].zName, P3_STATIC); ++ sqliteVdbeOp3(v, OP_ColumnName, 1, 0, "boolean", P3_STATIC); ++ sqliteVdbeCode(v, OP_Integer, (db->flags & aPragma[i].mask)!=0, 0, ++ OP_Callback, 1, 0, ++ 0); ++ }else if( getBoolean(zRight) ){ ++ db->flags |= aPragma[i].mask; ++ }else{ ++ db->flags &= ~aPragma[i].mask; ++ } ++ return 1; ++ } ++ } ++ return 0; ++} ++ ++/* ++** Process a pragma statement. ++** ++** Pragmas are of this form: ++** ++** PRAGMA id = value ++** ++** The identifier might also be a string. The value is a string, and ++** identifier, or a number. If minusFlag is true, then the value is ++** a number that was preceded by a minus sign. ++*/ ++void sqlitePragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ ++ char *zLeft = 0; ++ char *zRight = 0; ++ sqlite *db = pParse->db; ++ Vdbe *v = sqliteGetVdbe(pParse); ++ if( v==0 ) return; ++ ++ zLeft = sqliteStrNDup(pLeft->z, pLeft->n); ++ sqliteDequote(zLeft); ++ if( minusFlag ){ ++ zRight = 0; ++ sqliteSetNString(&zRight, "-", 1, pRight->z, pRight->n, 0); ++ }else{ ++ zRight = sqliteStrNDup(pRight->z, pRight->n); ++ sqliteDequote(zRight); ++ } ++ if( sqliteAuthCheck(pParse, SQLITE_PRAGMA, zLeft, zRight, 0) ){ ++ sqliteFree(zLeft); ++ sqliteFree(zRight); ++ return; ++ } ++ ++ /* ++ ** PRAGMA default_cache_size ++ ** PRAGMA default_cache_size=N ++ ** ++ ** The first form reports the current persistent setting for the ++ ** page cache size. The value returned is the maximum number of ++ ** pages in the page cache. The second form sets both the current ++ ** page cache size value and the persistent page cache size value ++ ** stored in the database file. ++ ** ++ ** The default cache size is stored in meta-value 2 of page 1 of the ++ ** database file. The cache size is actually the absolute value of ++ ** this memory location. The sign of meta-value 2 determines the ++ ** synchronous setting. A negative value means synchronous is off ++ ** and a positive value means synchronous is on. ++ */ ++ if( sqliteStrICmp(zLeft,"default_cache_size")==0 ){ ++ static VdbeOpList getCacheSize[] = { ++ { OP_ReadCookie, 0, 2, 0}, ++ { OP_AbsValue, 0, 0, 0}, ++ { OP_Dup, 0, 0, 0}, ++ { OP_Integer, 0, 0, 0}, ++ { OP_Ne, 0, 6, 0}, ++ { OP_Integer, 0, 0, 0}, /* 5 */ ++ { OP_ColumnName, 0, 1, "cache_size"}, ++ { OP_Callback, 1, 0, 0}, ++ }; ++ int addr; ++ if( pRight->z==pLeft->z ){ ++ addr = sqliteVdbeAddOpList(v, ArraySize(getCacheSize), getCacheSize); ++ sqliteVdbeChangeP1(v, addr+5, MAX_PAGES); ++ }else{ ++ int size = atoi(zRight); ++ if( size<0 ) size = -size; ++ sqliteBeginWriteOperation(pParse, 0, 0); ++ sqliteVdbeAddOp(v, OP_Integer, size, 0); ++ sqliteVdbeAddOp(v, OP_ReadCookie, 0, 2); ++ addr = sqliteVdbeAddOp(v, OP_Integer, 0, 0); ++ sqliteVdbeAddOp(v, OP_Ge, 0, addr+3); ++ sqliteVdbeAddOp(v, OP_Negative, 0, 0); ++ sqliteVdbeAddOp(v, OP_SetCookie, 0, 2); ++ sqliteEndWriteOperation(pParse); ++ db->cache_size = db->cache_size<0 ? -size : size; ++ sqliteBtreeSetCacheSize(db->aDb[0].pBt, db->cache_size); ++ } ++ }else ++ ++ /* ++ ** PRAGMA cache_size ++ ** PRAGMA cache_size=N ++ ** ++ ** The first form reports the current local setting for the ++ ** page cache size. The local setting can be different from ++ ** the persistent cache size value that is stored in the database ++ ** file itself. The value returned is the maximum number of ++ ** pages in the page cache. The second form sets the local ++ ** page cache size value. It does not change the persistent ++ ** cache size stored on the disk so the cache size will revert ++ ** to its default value when the database is closed and reopened. ++ ** N should be a positive integer. ++ */ ++ if( sqliteStrICmp(zLeft,"cache_size")==0 ){ ++ static VdbeOpList getCacheSize[] = { ++ { OP_ColumnName, 0, 1, "cache_size"}, ++ { OP_Callback, 1, 0, 0}, ++ }; ++ if( pRight->z==pLeft->z ){ ++ int size = db->cache_size;; ++ if( size<0 ) size = -size; ++ sqliteVdbeAddOp(v, OP_Integer, size, 0); ++ sqliteVdbeAddOpList(v, ArraySize(getCacheSize), getCacheSize); ++ }else{ ++ int size = atoi(zRight); ++ if( size<0 ) size = -size; ++ if( db->cache_size<0 ) size = -size; ++ db->cache_size = size; ++ sqliteBtreeSetCacheSize(db->aDb[0].pBt, db->cache_size); ++ } ++ }else ++ ++ /* ++ ** PRAGMA default_synchronous ++ ** PRAGMA default_synchronous=ON|OFF|NORMAL|FULL ++ ** ++ ** The first form returns the persistent value of the "synchronous" setting ++ ** that is stored in the database. This is the synchronous setting that ++ ** is used whenever the database is opened unless overridden by a separate ++ ** "synchronous" pragma. The second form changes the persistent and the ++ ** local synchronous setting to the value given. ++ ** ++ ** If synchronous is OFF, SQLite does not attempt any fsync() systems calls ++ ** to make sure data is committed to disk. Write operations are very fast, ++ ** but a power failure can leave the database in an inconsistent state. ++ ** If synchronous is ON or NORMAL, SQLite will do an fsync() system call to ++ ** make sure data is being written to disk. The risk of corruption due to ++ ** a power loss in this mode is negligible but non-zero. If synchronous ++ ** is FULL, extra fsync()s occur to reduce the risk of corruption to near ++ ** zero, but with a write performance penalty. The default mode is NORMAL. ++ */ ++ if( sqliteStrICmp(zLeft,"default_synchronous")==0 ){ ++ static VdbeOpList getSync[] = { ++ { OP_ColumnName, 0, 1, "synchronous"}, ++ { OP_ReadCookie, 0, 3, 0}, ++ { OP_Dup, 0, 0, 0}, ++ { OP_If, 0, 0, 0}, /* 3 */ ++ { OP_ReadCookie, 0, 2, 0}, ++ { OP_Integer, 0, 0, 0}, ++ { OP_Lt, 0, 5, 0}, ++ { OP_AddImm, 1, 0, 0}, ++ { OP_Callback, 1, 0, 0}, ++ { OP_Halt, 0, 0, 0}, ++ { OP_AddImm, -1, 0, 0}, /* 10 */ ++ { OP_Callback, 1, 0, 0} ++ }; ++ if( pRight->z==pLeft->z ){ ++ int addr = sqliteVdbeAddOpList(v, ArraySize(getSync), getSync); ++ sqliteVdbeChangeP2(v, addr+3, addr+10); ++ }else{ ++ int addr; ++ int size = db->cache_size; ++ if( size<0 ) size = -size; ++ sqliteBeginWriteOperation(pParse, 0, 0); ++ sqliteVdbeAddOp(v, OP_ReadCookie, 0, 2); ++ sqliteVdbeAddOp(v, OP_Dup, 0, 0); ++ addr = sqliteVdbeAddOp(v, OP_Integer, 0, 0); ++ sqliteVdbeAddOp(v, OP_Ne, 0, addr+3); ++ sqliteVdbeAddOp(v, OP_AddImm, MAX_PAGES, 0); ++ sqliteVdbeAddOp(v, OP_AbsValue, 0, 0); ++ db->safety_level = getSafetyLevel(zRight)+1; ++ if( db->safety_level==1 ){ ++ sqliteVdbeAddOp(v, OP_Negative, 0, 0); ++ size = -size; ++ } ++ sqliteVdbeAddOp(v, OP_SetCookie, 0, 2); ++ sqliteVdbeAddOp(v, OP_Integer, db->safety_level, 0); ++ sqliteVdbeAddOp(v, OP_SetCookie, 0, 3); ++ sqliteEndWriteOperation(pParse); ++ db->cache_size = size; ++ sqliteBtreeSetCacheSize(db->aDb[0].pBt, db->cache_size); ++ sqliteBtreeSetSafetyLevel(db->aDb[0].pBt, db->safety_level); ++ } ++ }else ++ ++ /* ++ ** PRAGMA synchronous ++ ** PRAGMA synchronous=OFF|ON|NORMAL|FULL ++ ** ++ ** Return or set the local value of the synchronous flag. Changing ++ ** the local value does not make changes to the disk file and the ++ ** default value will be restored the next time the database is ++ ** opened. ++ */ ++ if( sqliteStrICmp(zLeft,"synchronous")==0 ){ ++ static VdbeOpList getSync[] = { ++ { OP_ColumnName, 0, 1, "synchronous"}, ++ { OP_Callback, 1, 0, 0}, ++ }; ++ if( pRight->z==pLeft->z ){ ++ sqliteVdbeAddOp(v, OP_Integer, db->safety_level-1, 0); ++ sqliteVdbeAddOpList(v, ArraySize(getSync), getSync); ++ }else{ ++ int size = db->cache_size; ++ if( size<0 ) size = -size; ++ db->safety_level = getSafetyLevel(zRight)+1; ++ if( db->safety_level==1 ) size = -size; ++ db->cache_size = size; ++ sqliteBtreeSetCacheSize(db->aDb[0].pBt, db->cache_size); ++ sqliteBtreeSetSafetyLevel(db->aDb[0].pBt, db->safety_level); ++ } ++ }else ++ ++#ifndef NDEBUG ++ if( sqliteStrICmp(zLeft, "trigger_overhead_test")==0 ){ ++ if( getBoolean(zRight) ){ ++ always_code_trigger_setup = 1; ++ }else{ ++ always_code_trigger_setup = 0; ++ } ++ }else ++#endif ++ ++ if( flagPragma(pParse, zLeft, zRight) ){ ++ /* The flagPragma() call also generates any necessary code */ ++ }else ++ ++ if( sqliteStrICmp(zLeft, "table_info")==0 ){ ++ Table *pTab; ++ pTab = sqliteFindTable(db, zRight, 0); ++ if( pTab ){ ++ static VdbeOpList tableInfoPreface[] = { ++ { OP_ColumnName, 0, 0, "cid"}, ++ { OP_ColumnName, 1, 0, "name"}, ++ { OP_ColumnName, 2, 0, "type"}, ++ { OP_ColumnName, 3, 0, "notnull"}, ++ { OP_ColumnName, 4, 0, "dflt_value"}, ++ { OP_ColumnName, 5, 1, "pk"}, ++ }; ++ int i; ++ sqliteVdbeAddOpList(v, ArraySize(tableInfoPreface), tableInfoPreface); ++ sqliteViewGetColumnNames(pParse, pTab); ++ for(i=0; inCol; i++){ ++ sqliteVdbeAddOp(v, OP_Integer, i, 0); ++ sqliteVdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zName, 0); ++ sqliteVdbeOp3(v, OP_String, 0, 0, ++ pTab->aCol[i].zType ? pTab->aCol[i].zType : "numeric", 0); ++ sqliteVdbeAddOp(v, OP_Integer, pTab->aCol[i].notNull, 0); ++ sqliteVdbeOp3(v, OP_String, 0, 0, ++ pTab->aCol[i].zDflt, P3_STATIC); ++ sqliteVdbeAddOp(v, OP_Integer, pTab->aCol[i].isPrimKey, 0); ++ sqliteVdbeAddOp(v, OP_Callback, 6, 0); ++ } ++ } ++ }else ++ ++ if( sqliteStrICmp(zLeft, "index_info")==0 ){ ++ Index *pIdx; ++ Table *pTab; ++ pIdx = sqliteFindIndex(db, zRight, 0); ++ if( pIdx ){ ++ static VdbeOpList tableInfoPreface[] = { ++ { OP_ColumnName, 0, 0, "seqno"}, ++ { OP_ColumnName, 1, 0, "cid"}, ++ { OP_ColumnName, 2, 1, "name"}, ++ }; ++ int i; ++ pTab = pIdx->pTable; ++ sqliteVdbeAddOpList(v, ArraySize(tableInfoPreface), tableInfoPreface); ++ for(i=0; inColumn; i++){ ++ int cnum = pIdx->aiColumn[i]; ++ sqliteVdbeAddOp(v, OP_Integer, i, 0); ++ sqliteVdbeAddOp(v, OP_Integer, cnum, 0); ++ assert( pTab->nCol>cnum ); ++ sqliteVdbeOp3(v, OP_String, 0, 0, pTab->aCol[cnum].zName, 0); ++ sqliteVdbeAddOp(v, OP_Callback, 3, 0); ++ } ++ } ++ }else ++ ++ if( sqliteStrICmp(zLeft, "index_list")==0 ){ ++ Index *pIdx; ++ Table *pTab; ++ pTab = sqliteFindTable(db, zRight, 0); ++ if( pTab ){ ++ v = sqliteGetVdbe(pParse); ++ pIdx = pTab->pIndex; ++ } ++ if( pTab && pIdx ){ ++ int i = 0; ++ static VdbeOpList indexListPreface[] = { ++ { OP_ColumnName, 0, 0, "seq"}, ++ { OP_ColumnName, 1, 0, "name"}, ++ { OP_ColumnName, 2, 1, "unique"}, ++ }; ++ ++ sqliteVdbeAddOpList(v, ArraySize(indexListPreface), indexListPreface); ++ while(pIdx){ ++ sqliteVdbeAddOp(v, OP_Integer, i, 0); ++ sqliteVdbeOp3(v, OP_String, 0, 0, pIdx->zName, 0); ++ sqliteVdbeAddOp(v, OP_Integer, pIdx->onError!=OE_None, 0); ++ sqliteVdbeAddOp(v, OP_Callback, 3, 0); ++ ++i; ++ pIdx = pIdx->pNext; ++ } ++ } ++ }else ++ ++ if( sqliteStrICmp(zLeft, "foreign_key_list")==0 ){ ++ FKey *pFK; ++ Table *pTab; ++ pTab = sqliteFindTable(db, zRight, 0); ++ if( pTab ){ ++ v = sqliteGetVdbe(pParse); ++ pFK = pTab->pFKey; ++ } ++ if( pTab && pFK ){ ++ int i = 0; ++ static VdbeOpList indexListPreface[] = { ++ { OP_ColumnName, 0, 0, "id"}, ++ { OP_ColumnName, 1, 0, "seq"}, ++ { OP_ColumnName, 2, 0, "table"}, ++ { OP_ColumnName, 3, 0, "from"}, ++ { OP_ColumnName, 4, 1, "to"}, ++ }; ++ ++ sqliteVdbeAddOpList(v, ArraySize(indexListPreface), indexListPreface); ++ while(pFK){ ++ int j; ++ for(j=0; jnCol; j++){ ++ sqliteVdbeAddOp(v, OP_Integer, i, 0); ++ sqliteVdbeAddOp(v, OP_Integer, j, 0); ++ sqliteVdbeOp3(v, OP_String, 0, 0, pFK->zTo, 0); ++ sqliteVdbeOp3(v, OP_String, 0, 0, ++ pTab->aCol[pFK->aCol[j].iFrom].zName, 0); ++ sqliteVdbeOp3(v, OP_String, 0, 0, pFK->aCol[j].zCol, 0); ++ sqliteVdbeAddOp(v, OP_Callback, 5, 0); ++ } ++ ++i; ++ pFK = pFK->pNextFrom; ++ } ++ } ++ }else ++ ++ if( sqliteStrICmp(zLeft, "database_list")==0 ){ ++ int i; ++ static VdbeOpList indexListPreface[] = { ++ { OP_ColumnName, 0, 0, "seq"}, ++ { OP_ColumnName, 1, 0, "name"}, ++ { OP_ColumnName, 2, 1, "file"}, ++ }; ++ ++ sqliteVdbeAddOpList(v, ArraySize(indexListPreface), indexListPreface); ++ for(i=0; inDb; i++){ ++ if( db->aDb[i].pBt==0 ) continue; ++ assert( db->aDb[i].zName!=0 ); ++ sqliteVdbeAddOp(v, OP_Integer, i, 0); ++ sqliteVdbeOp3(v, OP_String, 0, 0, db->aDb[i].zName, 0); ++ sqliteVdbeOp3(v, OP_String, 0, 0, ++ sqliteBtreeGetFilename(db->aDb[i].pBt), 0); ++ sqliteVdbeAddOp(v, OP_Callback, 3, 0); ++ } ++ }else ++ ++ ++ /* ++ ** PRAGMA temp_store ++ ** PRAGMA temp_store = "default"|"memory"|"file" ++ ** ++ ** Return or set the local value of the temp_store flag. Changing ++ ** the local value does not make changes to the disk file and the default ++ ** value will be restored the next time the database is opened. ++ ** ++ ** Note that it is possible for the library compile-time options to ++ ** override this setting ++ */ ++ if( sqliteStrICmp(zLeft, "temp_store")==0 ){ ++ static VdbeOpList getTmpDbLoc[] = { ++ { OP_ColumnName, 0, 1, "temp_store"}, ++ { OP_Callback, 1, 0, 0}, ++ }; ++ if( pRight->z==pLeft->z ){ ++ sqliteVdbeAddOp(v, OP_Integer, db->temp_store, 0); ++ sqliteVdbeAddOpList(v, ArraySize(getTmpDbLoc), getTmpDbLoc); ++ }else{ ++ changeTempStorage(pParse, zRight); ++ } ++ }else ++ ++ /* ++ ** PRAGMA default_temp_store ++ ** PRAGMA default_temp_store = "default"|"memory"|"file" ++ ** ++ ** Return or set the value of the persistent temp_store flag. Any ++ ** change does not take effect until the next time the database is ++ ** opened. ++ ** ++ ** Note that it is possible for the library compile-time options to ++ ** override this setting ++ */ ++ if( sqliteStrICmp(zLeft, "default_temp_store")==0 ){ ++ static VdbeOpList getTmpDbLoc[] = { ++ { OP_ColumnName, 0, 1, "temp_store"}, ++ { OP_ReadCookie, 0, 5, 0}, ++ { OP_Callback, 1, 0, 0}}; ++ if( pRight->z==pLeft->z ){ ++ sqliteVdbeAddOpList(v, ArraySize(getTmpDbLoc), getTmpDbLoc); ++ }else{ ++ sqliteBeginWriteOperation(pParse, 0, 0); ++ sqliteVdbeAddOp(v, OP_Integer, getTempStore(zRight), 0); ++ sqliteVdbeAddOp(v, OP_SetCookie, 0, 5); ++ sqliteEndWriteOperation(pParse); ++ } ++ }else ++ ++#ifndef NDEBUG ++ if( sqliteStrICmp(zLeft, "parser_trace")==0 ){ ++ extern void sqliteParserTrace(FILE*, char *); ++ if( getBoolean(zRight) ){ ++ sqliteParserTrace(stdout, "parser: "); ++ }else{ ++ sqliteParserTrace(0, 0); ++ } ++ }else ++#endif ++ ++ if( sqliteStrICmp(zLeft, "integrity_check")==0 ){ ++ int i, j, addr; ++ ++ /* Code that initializes the integrity check program. Set the ++ ** error count 0 ++ */ ++ static VdbeOpList initCode[] = { ++ { OP_Integer, 0, 0, 0}, ++ { OP_MemStore, 0, 1, 0}, ++ { OP_ColumnName, 0, 1, "integrity_check"}, ++ }; ++ ++ /* Code to do an BTree integrity check on a single database file. ++ */ ++ static VdbeOpList checkDb[] = { ++ { OP_SetInsert, 0, 0, "2"}, ++ { OP_Integer, 0, 0, 0}, /* 1 */ ++ { OP_OpenRead, 0, 2, 0}, ++ { OP_Rewind, 0, 7, 0}, /* 3 */ ++ { OP_Column, 0, 3, 0}, /* 4 */ ++ { OP_SetInsert, 0, 0, 0}, ++ { OP_Next, 0, 4, 0}, /* 6 */ ++ { OP_IntegrityCk, 0, 0, 0}, /* 7 */ ++ { OP_Dup, 0, 1, 0}, ++ { OP_String, 0, 0, "ok"}, ++ { OP_StrEq, 0, 12, 0}, /* 10 */ ++ { OP_MemIncr, 0, 0, 0}, ++ { OP_String, 0, 0, "*** in database "}, ++ { OP_String, 0, 0, 0}, /* 13 */ ++ { OP_String, 0, 0, " ***\n"}, ++ { OP_Pull, 3, 0, 0}, ++ { OP_Concat, 4, 1, 0}, ++ { OP_Callback, 1, 0, 0}, ++ }; ++ ++ /* Code that appears at the end of the integrity check. If no error ++ ** messages have been generated, output OK. Otherwise output the ++ ** error message ++ */ ++ static VdbeOpList endCode[] = { ++ { OP_MemLoad, 0, 0, 0}, ++ { OP_Integer, 0, 0, 0}, ++ { OP_Ne, 0, 0, 0}, /* 2 */ ++ { OP_String, 0, 0, "ok"}, ++ { OP_Callback, 1, 0, 0}, ++ }; ++ ++ /* Initialize the VDBE program */ ++ sqliteVdbeAddOpList(v, ArraySize(initCode), initCode); ++ ++ /* Do an integrity check on each database file */ ++ for(i=0; inDb; i++){ ++ HashElem *x; ++ ++ /* Do an integrity check of the B-Tree ++ */ ++ addr = sqliteVdbeAddOpList(v, ArraySize(checkDb), checkDb); ++ sqliteVdbeChangeP1(v, addr+1, i); ++ sqliteVdbeChangeP2(v, addr+3, addr+7); ++ sqliteVdbeChangeP2(v, addr+6, addr+4); ++ sqliteVdbeChangeP2(v, addr+7, i); ++ sqliteVdbeChangeP2(v, addr+10, addr+ArraySize(checkDb)); ++ sqliteVdbeChangeP3(v, addr+13, db->aDb[i].zName, P3_STATIC); ++ ++ /* Make sure all the indices are constructed correctly. ++ */ ++ sqliteCodeVerifySchema(pParse, i); ++ for(x=sqliteHashFirst(&db->aDb[i].tblHash); x; x=sqliteHashNext(x)){ ++ Table *pTab = sqliteHashData(x); ++ Index *pIdx; ++ int loopTop; ++ ++ if( pTab->pIndex==0 ) continue; ++ sqliteVdbeAddOp(v, OP_Integer, i, 0); ++ sqliteVdbeOp3(v, OP_OpenRead, 1, pTab->tnum, pTab->zName, 0); ++ for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ ++ if( pIdx->tnum==0 ) continue; ++ sqliteVdbeAddOp(v, OP_Integer, pIdx->iDb, 0); ++ sqliteVdbeOp3(v, OP_OpenRead, j+2, pIdx->tnum, pIdx->zName, 0); ++ } ++ sqliteVdbeAddOp(v, OP_Integer, 0, 0); ++ sqliteVdbeAddOp(v, OP_MemStore, 1, 1); ++ loopTop = sqliteVdbeAddOp(v, OP_Rewind, 1, 0); ++ sqliteVdbeAddOp(v, OP_MemIncr, 1, 0); ++ for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ ++ int k, jmp2; ++ static VdbeOpList idxErr[] = { ++ { OP_MemIncr, 0, 0, 0}, ++ { OP_String, 0, 0, "rowid "}, ++ { OP_Recno, 1, 0, 0}, ++ { OP_String, 0, 0, " missing from index "}, ++ { OP_String, 0, 0, 0}, /* 4 */ ++ { OP_Concat, 4, 0, 0}, ++ { OP_Callback, 1, 0, 0}, ++ }; ++ sqliteVdbeAddOp(v, OP_Recno, 1, 0); ++ for(k=0; knColumn; k++){ ++ int idx = pIdx->aiColumn[k]; ++ if( idx==pTab->iPKey ){ ++ sqliteVdbeAddOp(v, OP_Recno, 1, 0); ++ }else{ ++ sqliteVdbeAddOp(v, OP_Column, 1, idx); ++ } ++ } ++ sqliteVdbeAddOp(v, OP_MakeIdxKey, pIdx->nColumn, 0); ++ if( db->file_format>=4 ) sqliteAddIdxKeyType(v, pIdx); ++ jmp2 = sqliteVdbeAddOp(v, OP_Found, j+2, 0); ++ addr = sqliteVdbeAddOpList(v, ArraySize(idxErr), idxErr); ++ sqliteVdbeChangeP3(v, addr+4, pIdx->zName, P3_STATIC); ++ sqliteVdbeChangeP2(v, jmp2, sqliteVdbeCurrentAddr(v)); ++ } ++ sqliteVdbeAddOp(v, OP_Next, 1, loopTop+1); ++ sqliteVdbeChangeP2(v, loopTop, sqliteVdbeCurrentAddr(v)); ++ for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ ++ static VdbeOpList cntIdx[] = { ++ { OP_Integer, 0, 0, 0}, ++ { OP_MemStore, 2, 1, 0}, ++ { OP_Rewind, 0, 0, 0}, /* 2 */ ++ { OP_MemIncr, 2, 0, 0}, ++ { OP_Next, 0, 0, 0}, /* 4 */ ++ { OP_MemLoad, 1, 0, 0}, ++ { OP_MemLoad, 2, 0, 0}, ++ { OP_Eq, 0, 0, 0}, /* 7 */ ++ { OP_MemIncr, 0, 0, 0}, ++ { OP_String, 0, 0, "wrong # of entries in index "}, ++ { OP_String, 0, 0, 0}, /* 10 */ ++ { OP_Concat, 2, 0, 0}, ++ { OP_Callback, 1, 0, 0}, ++ }; ++ if( pIdx->tnum==0 ) continue; ++ addr = sqliteVdbeAddOpList(v, ArraySize(cntIdx), cntIdx); ++ sqliteVdbeChangeP1(v, addr+2, j+2); ++ sqliteVdbeChangeP2(v, addr+2, addr+5); ++ sqliteVdbeChangeP1(v, addr+4, j+2); ++ sqliteVdbeChangeP2(v, addr+4, addr+3); ++ sqliteVdbeChangeP2(v, addr+7, addr+ArraySize(cntIdx)); ++ sqliteVdbeChangeP3(v, addr+10, pIdx->zName, P3_STATIC); ++ } ++ } ++ } ++ addr = sqliteVdbeAddOpList(v, ArraySize(endCode), endCode); ++ sqliteVdbeChangeP2(v, addr+2, addr+ArraySize(endCode)); ++ }else ++ ++ {} ++ sqliteFree(zLeft); ++ sqliteFree(zRight); ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/printf.c +@@ -0,0 +1,858 @@ ++/* ++** The "printf" code that follows dates from the 1980's. It is in ++** the public domain. The original comments are included here for ++** completeness. They are very out-of-date but might be useful as ++** an historical reference. Most of the "enhancements" have been backed ++** out so that the functionality is now the same as standard printf(). ++** ++************************************************************************** ++** ++** The following modules is an enhanced replacement for the "printf" subroutines ++** found in the standard C library. The following enhancements are ++** supported: ++** ++** + Additional functions. The standard set of "printf" functions ++** includes printf, fprintf, sprintf, vprintf, vfprintf, and ++** vsprintf. This module adds the following: ++** ++** * snprintf -- Works like sprintf, but has an extra argument ++** which is the size of the buffer written to. ++** ++** * mprintf -- Similar to sprintf. Writes output to memory ++** obtained from malloc. ++** ++** * xprintf -- Calls a function to dispose of output. ++** ++** * nprintf -- No output, but returns the number of characters ++** that would have been output by printf. ++** ++** * A v- version (ex: vsnprintf) of every function is also ++** supplied. ++** ++** + A few extensions to the formatting notation are supported: ++** ++** * The "=" flag (similar to "-") causes the output to be ++** be centered in the appropriately sized field. ++** ++** * The %b field outputs an integer in binary notation. ++** ++** * The %c field now accepts a precision. The character output ++** is repeated by the number of times the precision specifies. ++** ++** * The %' field works like %c, but takes as its character the ++** next character of the format string, instead of the next ++** argument. For example, printf("%.78'-") prints 78 minus ++** signs, the same as printf("%.78c",'-'). ++** ++** + When compiled using GCC on a SPARC, this version of printf is ++** faster than the library printf for SUN OS 4.1. ++** ++** + All functions are fully reentrant. ++** ++*/ ++#include "sqliteInt.h" ++ ++/* ++** Conversion types fall into various categories as defined by the ++** following enumeration. ++*/ ++#define etRADIX 1 /* Integer types. %d, %x, %o, and so forth */ ++#define etFLOAT 2 /* Floating point. %f */ ++#define etEXP 3 /* Exponentional notation. %e and %E */ ++#define etGENERIC 4 /* Floating or exponential, depending on exponent. %g */ ++#define etSIZE 5 /* Return number of characters processed so far. %n */ ++#define etSTRING 6 /* Strings. %s */ ++#define etDYNSTRING 7 /* Dynamically allocated strings. %z */ ++#define etPERCENT 8 /* Percent symbol. %% */ ++#define etCHARX 9 /* Characters. %c */ ++#define etERROR 10 /* Used to indicate no such conversion type */ ++/* The rest are extensions, not normally found in printf() */ ++#define etCHARLIT 11 /* Literal characters. %' */ ++#define etSQLESCAPE 12 /* Strings with '\'' doubled. %q */ ++#define etSQLESCAPE2 13 /* Strings with '\'' doubled and enclosed in '', ++ NULL pointers replaced by SQL NULL. %Q */ ++#define etTOKEN 14 /* a pointer to a Token structure */ ++#define etSRCLIST 15 /* a pointer to a SrcList */ ++ ++ ++/* ++** An "etByte" is an 8-bit unsigned value. ++*/ ++typedef unsigned char etByte; ++ ++/* ++** Each builtin conversion character (ex: the 'd' in "%d") is described ++** by an instance of the following structure ++*/ ++typedef struct et_info { /* Information about each format field */ ++ char fmttype; /* The format field code letter */ ++ etByte base; /* The base for radix conversion */ ++ etByte flags; /* One or more of FLAG_ constants below */ ++ etByte type; /* Conversion paradigm */ ++ char *charset; /* The character set for conversion */ ++ char *prefix; /* Prefix on non-zero values in alt format */ ++} et_info; ++ ++/* ++** Allowed values for et_info.flags ++*/ ++#define FLAG_SIGNED 1 /* True if the value to convert is signed */ ++#define FLAG_INTERN 2 /* True if for internal use only */ ++ ++ ++/* ++** The following table is searched linearly, so it is good to put the ++** most frequently used conversion types first. ++*/ ++static et_info fmtinfo[] = { ++ { 'd', 10, 1, etRADIX, "0123456789", 0 }, ++ { 's', 0, 0, etSTRING, 0, 0 }, ++ { 'z', 0, 2, etDYNSTRING, 0, 0 }, ++ { 'q', 0, 0, etSQLESCAPE, 0, 0 }, ++ { 'Q', 0, 0, etSQLESCAPE2, 0, 0 }, ++ { 'c', 0, 0, etCHARX, 0, 0 }, ++ { 'o', 8, 0, etRADIX, "01234567", "0" }, ++ { 'u', 10, 0, etRADIX, "0123456789", 0 }, ++ { 'x', 16, 0, etRADIX, "0123456789abcdef", "x0" }, ++ { 'X', 16, 0, etRADIX, "0123456789ABCDEF", "X0" }, ++ { 'f', 0, 1, etFLOAT, 0, 0 }, ++ { 'e', 0, 1, etEXP, "e", 0 }, ++ { 'E', 0, 1, etEXP, "E", 0 }, ++ { 'g', 0, 1, etGENERIC, "e", 0 }, ++ { 'G', 0, 1, etGENERIC, "E", 0 }, ++ { 'i', 10, 1, etRADIX, "0123456789", 0 }, ++ { 'n', 0, 0, etSIZE, 0, 0 }, ++ { '%', 0, 0, etPERCENT, 0, 0 }, ++ { 'p', 10, 0, etRADIX, "0123456789", 0 }, ++ { 'T', 0, 2, etTOKEN, 0, 0 }, ++ { 'S', 0, 2, etSRCLIST, 0, 0 }, ++}; ++#define etNINFO (sizeof(fmtinfo)/sizeof(fmtinfo[0])) ++ ++/* ++** If NOFLOATINGPOINT is defined, then none of the floating point ++** conversions will work. ++*/ ++#ifndef etNOFLOATINGPOINT ++/* ++** "*val" is a double such that 0.1 <= *val < 10.0 ++** Return the ascii code for the leading digit of *val, then ++** multiply "*val" by 10.0 to renormalize. ++** ++** Example: ++** input: *val = 3.14159 ++** output: *val = 1.4159 function return = '3' ++** ++** The counter *cnt is incremented each time. After counter exceeds ++** 16 (the number of significant digits in a 64-bit float) '0' is ++** always returned. ++*/ ++static int et_getdigit(LONGDOUBLE_TYPE *val, int *cnt){ ++ int digit; ++ LONGDOUBLE_TYPE d; ++ if( (*cnt)++ >= 16 ) return '0'; ++ digit = (int)*val; ++ d = digit; ++ digit += '0'; ++ *val = (*val - d)*10.0; ++ return digit; ++} ++#endif ++ ++#define etBUFSIZE 1000 /* Size of the output buffer */ ++ ++/* ++** The root program. All variations call this core. ++** ++** INPUTS: ++** func This is a pointer to a function taking three arguments ++** 1. A pointer to anything. Same as the "arg" parameter. ++** 2. A pointer to the list of characters to be output ++** (Note, this list is NOT null terminated.) ++** 3. An integer number of characters to be output. ++** (Note: This number might be zero.) ++** ++** arg This is the pointer to anything which will be passed as the ++** first argument to "func". Use it for whatever you like. ++** ++** fmt This is the format string, as in the usual print. ++** ++** ap This is a pointer to a list of arguments. Same as in ++** vfprint. ++** ++** OUTPUTS: ++** The return value is the total number of characters sent to ++** the function "func". Returns -1 on a error. ++** ++** Note that the order in which automatic variables are declared below ++** seems to make a big difference in determining how fast this beast ++** will run. ++*/ ++static int vxprintf( ++ void (*func)(void*,const char*,int), /* Consumer of text */ ++ void *arg, /* First argument to the consumer */ ++ int useExtended, /* Allow extended %-conversions */ ++ const char *fmt, /* Format string */ ++ va_list ap /* arguments */ ++){ ++ int c; /* Next character in the format string */ ++ char *bufpt; /* Pointer to the conversion buffer */ ++ int precision; /* Precision of the current field */ ++ int length; /* Length of the field */ ++ int idx; /* A general purpose loop counter */ ++ int count; /* Total number of characters output */ ++ int width; /* Width of the current field */ ++ etByte flag_leftjustify; /* True if "-" flag is present */ ++ etByte flag_plussign; /* True if "+" flag is present */ ++ etByte flag_blanksign; /* True if " " flag is present */ ++ etByte flag_alternateform; /* True if "#" flag is present */ ++ etByte flag_zeropad; /* True if field width constant starts with zero */ ++ etByte flag_long; /* True if "l" flag is present */ ++ unsigned long longvalue; /* Value for integer types */ ++ LONGDOUBLE_TYPE realvalue; /* Value for real types */ ++ et_info *infop; /* Pointer to the appropriate info structure */ ++ char buf[etBUFSIZE]; /* Conversion buffer */ ++ char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */ ++ etByte errorflag = 0; /* True if an error is encountered */ ++ etByte xtype; /* Conversion paradigm */ ++ char *zExtra; /* Extra memory used for etTCLESCAPE conversions */ ++ static char spaces[] = " "; ++#define etSPACESIZE (sizeof(spaces)-1) ++#ifndef etNOFLOATINGPOINT ++ int exp; /* exponent of real numbers */ ++ double rounder; /* Used for rounding floating point values */ ++ etByte flag_dp; /* True if decimal point should be shown */ ++ etByte flag_rtz; /* True if trailing zeros should be removed */ ++ etByte flag_exp; /* True to force display of the exponent */ ++ int nsd; /* Number of significant digits returned */ ++#endif ++ ++ func(arg,"",0); ++ count = length = 0; ++ bufpt = 0; ++ for(; (c=(*fmt))!=0; ++fmt){ ++ if( c!='%' ){ ++ int amt; ++ bufpt = (char *)fmt; ++ amt = 1; ++ while( (c=(*++fmt))!='%' && c!=0 ) amt++; ++ (*func)(arg,bufpt,amt); ++ count += amt; ++ if( c==0 ) break; ++ } ++ if( (c=(*++fmt))==0 ){ ++ errorflag = 1; ++ (*func)(arg,"%",1); ++ count++; ++ break; ++ } ++ /* Find out what flags are present */ ++ flag_leftjustify = flag_plussign = flag_blanksign = ++ flag_alternateform = flag_zeropad = 0; ++ do{ ++ switch( c ){ ++ case '-': flag_leftjustify = 1; c = 0; break; ++ case '+': flag_plussign = 1; c = 0; break; ++ case ' ': flag_blanksign = 1; c = 0; break; ++ case '#': flag_alternateform = 1; c = 0; break; ++ case '0': flag_zeropad = 1; c = 0; break; ++ default: break; ++ } ++ }while( c==0 && (c=(*++fmt))!=0 ); ++ /* Get the field width */ ++ width = 0; ++ if( c=='*' ){ ++ width = va_arg(ap,int); ++ if( width<0 ){ ++ flag_leftjustify = 1; ++ width = -width; ++ } ++ c = *++fmt; ++ }else{ ++ while( c>='0' && c<='9' ){ ++ width = width*10 + c - '0'; ++ c = *++fmt; ++ } ++ } ++ if( width > etBUFSIZE-10 ){ ++ width = etBUFSIZE-10; ++ } ++ /* Get the precision */ ++ if( c=='.' ){ ++ precision = 0; ++ c = *++fmt; ++ if( c=='*' ){ ++ precision = va_arg(ap,int); ++ if( precision<0 ) precision = -precision; ++ c = *++fmt; ++ }else{ ++ while( c>='0' && c<='9' ){ ++ precision = precision*10 + c - '0'; ++ c = *++fmt; ++ } ++ } ++ /* Limit the precision to prevent overflowing buf[] during conversion */ ++ if( precision>etBUFSIZE-40 ) precision = etBUFSIZE-40; ++ }else{ ++ precision = -1; ++ } ++ /* Get the conversion type modifier */ ++ if( c=='l' ){ ++ flag_long = 1; ++ c = *++fmt; ++ }else{ ++ flag_long = 0; ++ } ++ /* Fetch the info entry for the field */ ++ infop = 0; ++ xtype = etERROR; ++ for(idx=0; idxflags & FLAG_INTERN)==0 ){ ++ xtype = infop->type; ++ } ++ break; ++ } ++ } ++ zExtra = 0; ++ ++ /* ++ ** At this point, variables are initialized as follows: ++ ** ++ ** flag_alternateform TRUE if a '#' is present. ++ ** flag_plussign TRUE if a '+' is present. ++ ** flag_leftjustify TRUE if a '-' is present or if the ++ ** field width was negative. ++ ** flag_zeropad TRUE if the width began with 0. ++ ** flag_long TRUE if the letter 'l' (ell) prefixed ++ ** the conversion character. ++ ** flag_blanksign TRUE if a ' ' is present. ++ ** width The specified field width. This is ++ ** always non-negative. Zero is the default. ++ ** precision The specified precision. The default ++ ** is -1. ++ ** xtype The class of the conversion. ++ ** infop Pointer to the appropriate info struct. ++ */ ++ switch( xtype ){ ++ case etRADIX: ++ if( flag_long ) longvalue = va_arg(ap,long); ++ else longvalue = va_arg(ap,int); ++#if 1 ++ /* For the format %#x, the value zero is printed "0" not "0x0". ++ ** I think this is stupid. */ ++ if( longvalue==0 ) flag_alternateform = 0; ++#else ++ /* More sensible: turn off the prefix for octal (to prevent "00"), ++ ** but leave the prefix for hex. */ ++ if( longvalue==0 && infop->base==8 ) flag_alternateform = 0; ++#endif ++ if( infop->flags & FLAG_SIGNED ){ ++ if( *(long*)&longvalue<0 ){ ++ longvalue = -*(long*)&longvalue; ++ prefix = '-'; ++ }else if( flag_plussign ) prefix = '+'; ++ else if( flag_blanksign ) prefix = ' '; ++ else prefix = 0; ++ }else prefix = 0; ++ if( flag_zeropad && precisioncharset; ++ base = infop->base; ++ do{ /* Convert to ascii */ ++ *(--bufpt) = cset[longvalue%base]; ++ longvalue = longvalue/base; ++ }while( longvalue>0 ); ++ } ++ length = &buf[etBUFSIZE-1]-bufpt; ++ for(idx=precision-length; idx>0; idx--){ ++ *(--bufpt) = '0'; /* Zero pad */ ++ } ++ if( prefix ) *(--bufpt) = prefix; /* Add sign */ ++ if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */ ++ char *pre, x; ++ pre = infop->prefix; ++ if( *bufpt!=pre[0] ){ ++ for(pre=infop->prefix; (x=(*pre))!=0; pre++) *(--bufpt) = x; ++ } ++ } ++ length = &buf[etBUFSIZE-1]-bufpt; ++ break; ++ case etFLOAT: ++ case etEXP: ++ case etGENERIC: ++ realvalue = va_arg(ap,double); ++#ifndef etNOFLOATINGPOINT ++ if( precision<0 ) precision = 6; /* Set default precision */ ++ if( precision>etBUFSIZE-10 ) precision = etBUFSIZE-10; ++ if( realvalue<0.0 ){ ++ realvalue = -realvalue; ++ prefix = '-'; ++ }else{ ++ if( flag_plussign ) prefix = '+'; ++ else if( flag_blanksign ) prefix = ' '; ++ else prefix = 0; ++ } ++ if( infop->type==etGENERIC && precision>0 ) precision--; ++ rounder = 0.0; ++#if 0 ++ /* Rounding works like BSD when the constant 0.4999 is used. Wierd! */ ++ for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1); ++#else ++ /* It makes more sense to use 0.5 */ ++ for(idx=precision, rounder=0.5; idx>0; idx--, rounder*=0.1); ++#endif ++ if( infop->type==etFLOAT ) realvalue += rounder; ++ /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */ ++ exp = 0; ++ if( realvalue>0.0 ){ ++ while( realvalue>=1e8 && exp<=350 ){ realvalue *= 1e-8; exp+=8; } ++ while( realvalue>=10.0 && exp<=350 ){ realvalue *= 0.1; exp++; } ++ while( realvalue<1e-8 && exp>=-350 ){ realvalue *= 1e8; exp-=8; } ++ while( realvalue<1.0 && exp>=-350 ){ realvalue *= 10.0; exp--; } ++ if( exp>350 || exp<-350 ){ ++ bufpt = "NaN"; ++ length = 3; ++ break; ++ } ++ } ++ bufpt = buf; ++ /* ++ ** If the field type is etGENERIC, then convert to either etEXP ++ ** or etFLOAT, as appropriate. ++ */ ++ flag_exp = xtype==etEXP; ++ if( xtype!=etFLOAT ){ ++ realvalue += rounder; ++ if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; } ++ } ++ if( xtype==etGENERIC ){ ++ flag_rtz = !flag_alternateform; ++ if( exp<-4 || exp>precision ){ ++ xtype = etEXP; ++ }else{ ++ precision = precision - exp; ++ xtype = etFLOAT; ++ } ++ }else{ ++ flag_rtz = 0; ++ } ++ /* ++ ** The "exp+precision" test causes output to be of type etEXP if ++ ** the precision is too large to fit in buf[]. ++ */ ++ nsd = 0; ++ if( xtype==etFLOAT && exp+precision0 || flag_alternateform); ++ if( prefix ) *(bufpt++) = prefix; /* Sign */ ++ if( exp<0 ) *(bufpt++) = '0'; /* Digits before "." */ ++ else for(; exp>=0; exp--) *(bufpt++) = et_getdigit(&realvalue,&nsd); ++ if( flag_dp ) *(bufpt++) = '.'; /* The decimal point */ ++ for(exp++; exp<0 && precision>0; precision--, exp++){ ++ *(bufpt++) = '0'; ++ } ++ while( (precision--)>0 ) *(bufpt++) = et_getdigit(&realvalue,&nsd); ++ *(bufpt--) = 0; /* Null terminate */ ++ if( flag_rtz && flag_dp ){ /* Remove trailing zeros and "." */ ++ while( bufpt>=buf && *bufpt=='0' ) *(bufpt--) = 0; ++ if( bufpt>=buf && *bufpt=='.' ) *(bufpt--) = 0; ++ } ++ bufpt++; /* point to next free slot */ ++ }else{ /* etEXP or etGENERIC */ ++ flag_dp = (precision>0 || flag_alternateform); ++ if( prefix ) *(bufpt++) = prefix; /* Sign */ ++ *(bufpt++) = et_getdigit(&realvalue,&nsd); /* First digit */ ++ if( flag_dp ) *(bufpt++) = '.'; /* Decimal point */ ++ while( (precision--)>0 ) *(bufpt++) = et_getdigit(&realvalue,&nsd); ++ bufpt--; /* point to last digit */ ++ if( flag_rtz && flag_dp ){ /* Remove tail zeros */ ++ while( bufpt>=buf && *bufpt=='0' ) *(bufpt--) = 0; ++ if( bufpt>=buf && *bufpt=='.' ) *(bufpt--) = 0; ++ } ++ bufpt++; /* point to next free slot */ ++ if( exp || flag_exp ){ ++ *(bufpt++) = infop->charset[0]; ++ if( exp<0 ){ *(bufpt++) = '-'; exp = -exp; } /* sign of exp */ ++ else { *(bufpt++) = '+'; } ++ if( exp>=100 ){ ++ *(bufpt++) = (exp/100)+'0'; /* 100's digit */ ++ exp %= 100; ++ } ++ *(bufpt++) = exp/10+'0'; /* 10's digit */ ++ *(bufpt++) = exp%10+'0'; /* 1's digit */ ++ } ++ } ++ /* The converted number is in buf[] and zero terminated. Output it. ++ ** Note that the number is in the usual order, not reversed as with ++ ** integer conversions. */ ++ length = bufpt-buf; ++ bufpt = buf; ++ ++ /* Special case: Add leading zeros if the flag_zeropad flag is ++ ** set and we are not left justified */ ++ if( flag_zeropad && !flag_leftjustify && length < width){ ++ int i; ++ int nPad = width - length; ++ for(i=width; i>=nPad; i--){ ++ bufpt[i] = bufpt[i-nPad]; ++ } ++ i = prefix!=0; ++ while( nPad-- ) bufpt[i++] = '0'; ++ length = width; ++ } ++#endif ++ break; ++ case etSIZE: ++ *(va_arg(ap,int*)) = count; ++ length = width = 0; ++ break; ++ case etPERCENT: ++ buf[0] = '%'; ++ bufpt = buf; ++ length = 1; ++ break; ++ case etCHARLIT: ++ case etCHARX: ++ c = buf[0] = (xtype==etCHARX ? va_arg(ap,int) : *++fmt); ++ if( precision>=0 ){ ++ for(idx=1; idx=0 && precisionetBUFSIZE ){ ++ bufpt = zExtra = sqliteMalloc( n ); ++ if( bufpt==0 ) return -1; ++ }else{ ++ bufpt = buf; ++ } ++ j = 0; ++ if( !isnull && xtype==etSQLESCAPE2 ) bufpt[j++] = '\''; ++ for(i=0; (c=arg[i])!=0; i++){ ++ bufpt[j++] = c; ++ if( c=='\'' ) bufpt[j++] = c; ++ } ++ if( !isnull && xtype==etSQLESCAPE2 ) bufpt[j++] = '\''; ++ bufpt[j] = 0; ++ length = j; ++ if( precision>=0 && precisionz, pToken->n); ++ length = width = 0; ++ break; ++ } ++ case etSRCLIST: { ++ SrcList *pSrc = va_arg(ap, SrcList*); ++ int k = va_arg(ap, int); ++ struct SrcList_item *pItem = &pSrc->a[k]; ++ assert( k>=0 && knSrc ); ++ if( pItem->zDatabase && pItem->zDatabase[0] ){ ++ (*func)(arg, pItem->zDatabase, strlen(pItem->zDatabase)); ++ (*func)(arg, ".", 1); ++ } ++ (*func)(arg, pItem->zName, strlen(pItem->zName)); ++ length = width = 0; ++ break; ++ } ++ case etERROR: ++ buf[0] = '%'; ++ buf[1] = c; ++ errorflag = 0; ++ idx = 1+(c!=0); ++ (*func)(arg,"%",idx); ++ count += idx; ++ if( c==0 ) fmt--; ++ break; ++ }/* End switch over the format type */ ++ /* ++ ** The text of the conversion is pointed to by "bufpt" and is ++ ** "length" characters long. The field width is "width". Do ++ ** the output. ++ */ ++ if( !flag_leftjustify ){ ++ register int nspace; ++ nspace = width-length; ++ if( nspace>0 ){ ++ count += nspace; ++ while( nspace>=etSPACESIZE ){ ++ (*func)(arg,spaces,etSPACESIZE); ++ nspace -= etSPACESIZE; ++ } ++ if( nspace>0 ) (*func)(arg,spaces,nspace); ++ } ++ } ++ if( length>0 ){ ++ (*func)(arg,bufpt,length); ++ count += length; ++ } ++ if( flag_leftjustify ){ ++ register int nspace; ++ nspace = width-length; ++ if( nspace>0 ){ ++ count += nspace; ++ while( nspace>=etSPACESIZE ){ ++ (*func)(arg,spaces,etSPACESIZE); ++ nspace -= etSPACESIZE; ++ } ++ if( nspace>0 ) (*func)(arg,spaces,nspace); ++ } ++ } ++ if( zExtra ){ ++ sqliteFree(zExtra); ++ } ++ }/* End for loop over the format string */ ++ return errorflag ? -1 : count; ++} /* End of function */ ++ ++ ++/* This structure is used to store state information about the ++** write to memory that is currently in progress. ++*/ ++struct sgMprintf { ++ char *zBase; /* A base allocation */ ++ char *zText; /* The string collected so far */ ++ int nChar; /* Length of the string so far */ ++ int nTotal; /* Output size if unconstrained */ ++ int nAlloc; /* Amount of space allocated in zText */ ++ void *(*xRealloc)(void*,int); /* Function used to realloc memory */ ++}; ++ ++/* ++** This function implements the callback from vxprintf. ++** ++** This routine add nNewChar characters of text in zNewText to ++** the sgMprintf structure pointed to by "arg". ++*/ ++static void mout(void *arg, const char *zNewText, int nNewChar){ ++ struct sgMprintf *pM = (struct sgMprintf*)arg; ++ pM->nTotal += nNewChar; ++ if( pM->nChar + nNewChar + 1 > pM->nAlloc ){ ++ if( pM->xRealloc==0 ){ ++ nNewChar = pM->nAlloc - pM->nChar - 1; ++ }else{ ++ pM->nAlloc = pM->nChar + nNewChar*2 + 1; ++ if( pM->zText==pM->zBase ){ ++ pM->zText = pM->xRealloc(0, pM->nAlloc); ++ if( pM->zText && pM->nChar ){ ++ memcpy(pM->zText, pM->zBase, pM->nChar); ++ } ++ }else{ ++ pM->zText = pM->xRealloc(pM->zText, pM->nAlloc); ++ } ++ } ++ } ++ if( pM->zText ){ ++ if( nNewChar>0 ){ ++ memcpy(&pM->zText[pM->nChar], zNewText, nNewChar); ++ pM->nChar += nNewChar; ++ } ++ pM->zText[pM->nChar] = 0; ++ } ++} ++ ++/* ++** This routine is a wrapper around xprintf() that invokes mout() as ++** the consumer. ++*/ ++static char *base_vprintf( ++ void *(*xRealloc)(void*,int), /* Routine to realloc memory. May be NULL */ ++ int useInternal, /* Use internal %-conversions if true */ ++ char *zInitBuf, /* Initially write here, before mallocing */ ++ int nInitBuf, /* Size of zInitBuf[] */ ++ const char *zFormat, /* format string */ ++ va_list ap /* arguments */ ++){ ++ struct sgMprintf sM; ++ sM.zBase = sM.zText = zInitBuf; ++ sM.nChar = sM.nTotal = 0; ++ sM.nAlloc = nInitBuf; ++ sM.xRealloc = xRealloc; ++ vxprintf(mout, &sM, useInternal, zFormat, ap); ++ if( xRealloc ){ ++ if( sM.zText==sM.zBase ){ ++ sM.zText = xRealloc(0, sM.nChar+1); ++ memcpy(sM.zText, sM.zBase, sM.nChar+1); ++ }else if( sM.nAlloc>sM.nChar+10 ){ ++ sM.zText = xRealloc(sM.zText, sM.nChar+1); ++ } ++ } ++ return sM.zText; ++} ++ ++/* ++** Realloc that is a real function, not a macro. ++*/ ++static void *printf_realloc(void *old, int size){ ++ return sqliteRealloc(old,size); ++} ++ ++/* ++** Print into memory obtained from sqliteMalloc(). Use the internal ++** %-conversion extensions. ++*/ ++char *sqliteVMPrintf(const char *zFormat, va_list ap){ ++ char zBase[1000]; ++ return base_vprintf(printf_realloc, 1, zBase, sizeof(zBase), zFormat, ap); ++} ++ ++/* ++** Print into memory obtained from sqliteMalloc(). Use the internal ++** %-conversion extensions. ++*/ ++char *sqliteMPrintf(const char *zFormat, ...){ ++ va_list ap; ++ char *z; ++ char zBase[1000]; ++ va_start(ap, zFormat); ++ z = base_vprintf(printf_realloc, 1, zBase, sizeof(zBase), zFormat, ap); ++ va_end(ap); ++ return z; ++} ++ ++/* ++** Print into memory obtained from malloc(). Do not use the internal ++** %-conversion extensions. This routine is for use by external users. ++*/ ++char *sqlite_mprintf(const char *zFormat, ...){ ++ va_list ap; ++ char *z; ++ char zBuf[200]; ++ ++ va_start(ap,zFormat); ++ z = base_vprintf((void*(*)(void*,int))realloc, 0, ++ zBuf, sizeof(zBuf), zFormat, ap); ++ va_end(ap); ++ return z; ++} ++ ++/* This is the varargs version of sqlite_mprintf. ++*/ ++char *sqlite_vmprintf(const char *zFormat, va_list ap){ ++ char zBuf[200]; ++ return base_vprintf((void*(*)(void*,int))realloc, 0, ++ zBuf, sizeof(zBuf), zFormat, ap); ++} ++ ++/* ++** sqlite_snprintf() works like snprintf() except that it ignores the ++** current locale settings. This is important for SQLite because we ++** are not able to use a "," as the decimal point in place of "." as ++** specified by some locales. ++*/ ++char *sqlite_snprintf(int n, char *zBuf, const char *zFormat, ...){ ++ char *z; ++ va_list ap; ++ ++ va_start(ap,zFormat); ++ z = base_vprintf(0, 0, zBuf, n, zFormat, ap); ++ va_end(ap); ++ return z; ++} ++ ++/* ++** The following four routines implement the varargs versions of the ++** sqlite_exec() and sqlite_get_table() interfaces. See the sqlite.h ++** header files for a more detailed description of how these interfaces ++** work. ++** ++** These routines are all just simple wrappers. ++*/ ++int sqlite_exec_printf( ++ sqlite *db, /* An open database */ ++ const char *sqlFormat, /* printf-style format string for the SQL */ ++ sqlite_callback xCallback, /* Callback function */ ++ void *pArg, /* 1st argument to callback function */ ++ char **errmsg, /* Error msg written here */ ++ ... /* Arguments to the format string. */ ++){ ++ va_list ap; ++ int rc; ++ ++ va_start(ap, errmsg); ++ rc = sqlite_exec_vprintf(db, sqlFormat, xCallback, pArg, errmsg, ap); ++ va_end(ap); ++ return rc; ++} ++int sqlite_exec_vprintf( ++ sqlite *db, /* An open database */ ++ const char *sqlFormat, /* printf-style format string for the SQL */ ++ sqlite_callback xCallback, /* Callback function */ ++ void *pArg, /* 1st argument to callback function */ ++ char **errmsg, /* Error msg written here */ ++ va_list ap /* Arguments to the format string. */ ++){ ++ char *zSql; ++ int rc; ++ ++ zSql = sqlite_vmprintf(sqlFormat, ap); ++ rc = sqlite_exec(db, zSql, xCallback, pArg, errmsg); ++ free(zSql); ++ return rc; ++} ++int sqlite_get_table_printf( ++ sqlite *db, /* An open database */ ++ const char *sqlFormat, /* printf-style format string for the SQL */ ++ char ***resultp, /* Result written to a char *[] that this points to */ ++ int *nrow, /* Number of result rows written here */ ++ int *ncol, /* Number of result columns written here */ ++ char **errmsg, /* Error msg written here */ ++ ... /* Arguments to the format string */ ++){ ++ va_list ap; ++ int rc; ++ ++ va_start(ap, errmsg); ++ rc = sqlite_get_table_vprintf(db, sqlFormat, resultp, nrow, ncol, errmsg, ap); ++ va_end(ap); ++ return rc; ++} ++int sqlite_get_table_vprintf( ++ sqlite *db, /* An open database */ ++ const char *sqlFormat, /* printf-style format string for the SQL */ ++ char ***resultp, /* Result written to a char *[] that this points to */ ++ int *nrow, /* Number of result rows written here */ ++ int *ncolumn, /* Number of result columns written here */ ++ char **errmsg, /* Error msg written here */ ++ va_list ap /* Arguments to the format string */ ++){ ++ char *zSql; ++ int rc; ++ ++ zSql = sqlite_vmprintf(sqlFormat, ap); ++ rc = sqlite_get_table(db, zSql, resultp, nrow, ncolumn, errmsg); ++ free(zSql); ++ return rc; ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/random.c +@@ -0,0 +1,97 @@ ++/* ++** 2001 September 15 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This file contains code to implement a pseudo-random number ++** generator (PRNG) for SQLite. ++** ++** Random numbers are used by some of the database backends in order ++** to generate random integer keys for tables or random filenames. ++** ++** $Id$ ++*/ ++#include "sqliteInt.h" ++#include "os.h" ++ ++ ++/* ++** Get a single 8-bit random value from the RC4 PRNG. The Mutex ++** must be held while executing this routine. ++** ++** Why not just use a library random generator like lrand48() for this? ++** Because the OP_NewRecno opcode in the VDBE depends on having a very ++** good source of random numbers. The lrand48() library function may ++** well be good enough. But maybe not. Or maybe lrand48() has some ++** subtle problems on some systems that could cause problems. It is hard ++** to know. To minimize the risk of problems due to bad lrand48() ++** implementations, SQLite uses this random number generator based ++** on RC4, which we know works very well. ++*/ ++static int randomByte(){ ++ unsigned char t; ++ ++ /* All threads share a single random number generator. ++ ** This structure is the current state of the generator. ++ */ ++ static struct { ++ unsigned char isInit; /* True if initialized */ ++ unsigned char i, j; /* State variables */ ++ unsigned char s[256]; /* State variables */ ++ } prng; ++ ++ /* Initialize the state of the random number generator once, ++ ** the first time this routine is called. The seed value does ++ ** not need to contain a lot of randomness since we are not ++ ** trying to do secure encryption or anything like that... ++ ** ++ ** Nothing in this file or anywhere else in SQLite does any kind of ++ ** encryption. The RC4 algorithm is being used as a PRNG (pseudo-random ++ ** number generator) not as an encryption device. ++ */ ++ if( !prng.isInit ){ ++ int i; ++ char k[256]; ++ prng.j = 0; ++ prng.i = 0; ++ sqliteOsRandomSeed(k); ++ for(i=0; i<256; i++){ ++ prng.s[i] = i; ++ } ++ for(i=0; i<256; i++){ ++ prng.j += prng.s[i] + k[i]; ++ t = prng.s[prng.j]; ++ prng.s[prng.j] = prng.s[i]; ++ prng.s[i] = t; ++ } ++ prng.isInit = 1; ++ } ++ ++ /* Generate and return single random byte ++ */ ++ prng.i++; ++ t = prng.s[prng.i]; ++ prng.j += t; ++ prng.s[prng.i] = prng.s[prng.j]; ++ prng.s[prng.j] = t; ++ t += prng.s[prng.i]; ++ return prng.s[t]; ++} ++ ++/* ++** Return N random bytes. ++*/ ++void sqliteRandomness(int N, void *pBuf){ ++ unsigned char *zBuf = pBuf; ++ sqliteOsEnterMutex(); ++ while( N-- ){ ++ *(zBuf++) = randomByte(); ++ } ++ sqliteOsLeaveMutex(); ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/select.c +@@ -0,0 +1,2434 @@ ++/* ++** 2001 September 15 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This file contains C code routines that are called by the parser ++** to handle SELECT statements in SQLite. ++** ++** $Id$ ++*/ ++#include "sqliteInt.h" ++ ++ ++/* ++** Allocate a new Select structure and return a pointer to that ++** structure. ++*/ ++Select *sqliteSelectNew( ++ ExprList *pEList, /* which columns to include in the result */ ++ SrcList *pSrc, /* the FROM clause -- which tables to scan */ ++ Expr *pWhere, /* the WHERE clause */ ++ ExprList *pGroupBy, /* the GROUP BY clause */ ++ Expr *pHaving, /* the HAVING clause */ ++ ExprList *pOrderBy, /* the ORDER BY clause */ ++ int isDistinct, /* true if the DISTINCT keyword is present */ ++ int nLimit, /* LIMIT value. -1 means not used */ ++ int nOffset /* OFFSET value. 0 means no offset */ ++){ ++ Select *pNew; ++ pNew = sqliteMalloc( sizeof(*pNew) ); ++ if( pNew==0 ){ ++ sqliteExprListDelete(pEList); ++ sqliteSrcListDelete(pSrc); ++ sqliteExprDelete(pWhere); ++ sqliteExprListDelete(pGroupBy); ++ sqliteExprDelete(pHaving); ++ sqliteExprListDelete(pOrderBy); ++ }else{ ++ if( pEList==0 ){ ++ pEList = sqliteExprListAppend(0, sqliteExpr(TK_ALL,0,0,0), 0); ++ } ++ pNew->pEList = pEList; ++ pNew->pSrc = pSrc; ++ pNew->pWhere = pWhere; ++ pNew->pGroupBy = pGroupBy; ++ pNew->pHaving = pHaving; ++ pNew->pOrderBy = pOrderBy; ++ pNew->isDistinct = isDistinct; ++ pNew->op = TK_SELECT; ++ pNew->nLimit = nLimit; ++ pNew->nOffset = nOffset; ++ pNew->iLimit = -1; ++ pNew->iOffset = -1; ++ } ++ return pNew; ++} ++ ++/* ++** Given 1 to 3 identifiers preceeding the JOIN keyword, determine the ++** type of join. Return an integer constant that expresses that type ++** in terms of the following bit values: ++** ++** JT_INNER ++** JT_OUTER ++** JT_NATURAL ++** JT_LEFT ++** JT_RIGHT ++** ++** A full outer join is the combination of JT_LEFT and JT_RIGHT. ++** ++** If an illegal or unsupported join type is seen, then still return ++** a join type, but put an error in the pParse structure. ++*/ ++int sqliteJoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){ ++ int jointype = 0; ++ Token *apAll[3]; ++ Token *p; ++ static struct { ++ const char *zKeyword; ++ int nChar; ++ int code; ++ } keywords[] = { ++ { "natural", 7, JT_NATURAL }, ++ { "left", 4, JT_LEFT|JT_OUTER }, ++ { "right", 5, JT_RIGHT|JT_OUTER }, ++ { "full", 4, JT_LEFT|JT_RIGHT|JT_OUTER }, ++ { "outer", 5, JT_OUTER }, ++ { "inner", 5, JT_INNER }, ++ { "cross", 5, JT_INNER }, ++ }; ++ int i, j; ++ apAll[0] = pA; ++ apAll[1] = pB; ++ apAll[2] = pC; ++ for(i=0; i<3 && apAll[i]; i++){ ++ p = apAll[i]; ++ for(j=0; jn==keywords[j].nChar ++ && sqliteStrNICmp(p->z, keywords[j].zKeyword, p->n)==0 ){ ++ jointype |= keywords[j].code; ++ break; ++ } ++ } ++ if( j>=sizeof(keywords)/sizeof(keywords[0]) ){ ++ jointype |= JT_ERROR; ++ break; ++ } ++ } ++ if( ++ (jointype & (JT_INNER|JT_OUTER))==(JT_INNER|JT_OUTER) || ++ (jointype & JT_ERROR)!=0 ++ ){ ++ static Token dummy = { 0, 0 }; ++ char *zSp1 = " ", *zSp2 = " "; ++ if( pB==0 ){ pB = &dummy; zSp1 = 0; } ++ if( pC==0 ){ pC = &dummy; zSp2 = 0; } ++ sqliteSetNString(&pParse->zErrMsg, "unknown or unsupported join type: ", 0, ++ pA->z, pA->n, zSp1, 1, pB->z, pB->n, zSp2, 1, pC->z, pC->n, 0); ++ pParse->nErr++; ++ jointype = JT_INNER; ++ }else if( jointype & JT_RIGHT ){ ++ sqliteErrorMsg(pParse, ++ "RIGHT and FULL OUTER JOINs are not currently supported"); ++ jointype = JT_INNER; ++ } ++ return jointype; ++} ++ ++/* ++** Return the index of a column in a table. Return -1 if the column ++** is not contained in the table. ++*/ ++static int columnIndex(Table *pTab, const char *zCol){ ++ int i; ++ for(i=0; inCol; i++){ ++ if( sqliteStrICmp(pTab->aCol[i].zName, zCol)==0 ) return i; ++ } ++ return -1; ++} ++ ++/* ++** Add a term to the WHERE expression in *ppExpr that requires the ++** zCol column to be equal in the two tables pTab1 and pTab2. ++*/ ++static void addWhereTerm( ++ const char *zCol, /* Name of the column */ ++ const Table *pTab1, /* First table */ ++ const Table *pTab2, /* Second table */ ++ Expr **ppExpr /* Add the equality term to this expression */ ++){ ++ Token dummy; ++ Expr *pE1a, *pE1b, *pE1c; ++ Expr *pE2a, *pE2b, *pE2c; ++ Expr *pE; ++ ++ dummy.z = zCol; ++ dummy.n = strlen(zCol); ++ dummy.dyn = 0; ++ pE1a = sqliteExpr(TK_ID, 0, 0, &dummy); ++ pE2a = sqliteExpr(TK_ID, 0, 0, &dummy); ++ dummy.z = pTab1->zName; ++ dummy.n = strlen(dummy.z); ++ pE1b = sqliteExpr(TK_ID, 0, 0, &dummy); ++ dummy.z = pTab2->zName; ++ dummy.n = strlen(dummy.z); ++ pE2b = sqliteExpr(TK_ID, 0, 0, &dummy); ++ pE1c = sqliteExpr(TK_DOT, pE1b, pE1a, 0); ++ pE2c = sqliteExpr(TK_DOT, pE2b, pE2a, 0); ++ pE = sqliteExpr(TK_EQ, pE1c, pE2c, 0); ++ ExprSetProperty(pE, EP_FromJoin); ++ if( *ppExpr ){ ++ *ppExpr = sqliteExpr(TK_AND, *ppExpr, pE, 0); ++ }else{ ++ *ppExpr = pE; ++ } ++} ++ ++/* ++** Set the EP_FromJoin property on all terms of the given expression. ++** ++** The EP_FromJoin property is used on terms of an expression to tell ++** the LEFT OUTER JOIN processing logic that this term is part of the ++** join restriction specified in the ON or USING clause and not a part ++** of the more general WHERE clause. These terms are moved over to the ++** WHERE clause during join processing but we need to remember that they ++** originated in the ON or USING clause. ++*/ ++static void setJoinExpr(Expr *p){ ++ while( p ){ ++ ExprSetProperty(p, EP_FromJoin); ++ setJoinExpr(p->pLeft); ++ p = p->pRight; ++ } ++} ++ ++/* ++** This routine processes the join information for a SELECT statement. ++** ON and USING clauses are converted into extra terms of the WHERE clause. ++** NATURAL joins also create extra WHERE clause terms. ++** ++** This routine returns the number of errors encountered. ++*/ ++static int sqliteProcessJoin(Parse *pParse, Select *p){ ++ SrcList *pSrc; ++ int i, j; ++ pSrc = p->pSrc; ++ for(i=0; inSrc-1; i++){ ++ struct SrcList_item *pTerm = &pSrc->a[i]; ++ struct SrcList_item *pOther = &pSrc->a[i+1]; ++ ++ if( pTerm->pTab==0 || pOther->pTab==0 ) continue; ++ ++ /* When the NATURAL keyword is present, add WHERE clause terms for ++ ** every column that the two tables have in common. ++ */ ++ if( pTerm->jointype & JT_NATURAL ){ ++ Table *pTab; ++ if( pTerm->pOn || pTerm->pUsing ){ ++ sqliteErrorMsg(pParse, "a NATURAL join may not have " ++ "an ON or USING clause", 0); ++ return 1; ++ } ++ pTab = pTerm->pTab; ++ for(j=0; jnCol; j++){ ++ if( columnIndex(pOther->pTab, pTab->aCol[j].zName)>=0 ){ ++ addWhereTerm(pTab->aCol[j].zName, pTab, pOther->pTab, &p->pWhere); ++ } ++ } ++ } ++ ++ /* Disallow both ON and USING clauses in the same join ++ */ ++ if( pTerm->pOn && pTerm->pUsing ){ ++ sqliteErrorMsg(pParse, "cannot have both ON and USING " ++ "clauses in the same join"); ++ return 1; ++ } ++ ++ /* Add the ON clause to the end of the WHERE clause, connected by ++ ** and AND operator. ++ */ ++ if( pTerm->pOn ){ ++ setJoinExpr(pTerm->pOn); ++ if( p->pWhere==0 ){ ++ p->pWhere = pTerm->pOn; ++ }else{ ++ p->pWhere = sqliteExpr(TK_AND, p->pWhere, pTerm->pOn, 0); ++ } ++ pTerm->pOn = 0; ++ } ++ ++ /* Create extra terms on the WHERE clause for each column named ++ ** in the USING clause. Example: If the two tables to be joined are ++ ** A and B and the USING clause names X, Y, and Z, then add this ++ ** to the WHERE clause: A.X=B.X AND A.Y=B.Y AND A.Z=B.Z ++ ** Report an error if any column mentioned in the USING clause is ++ ** not contained in both tables to be joined. ++ */ ++ if( pTerm->pUsing ){ ++ IdList *pList; ++ int j; ++ assert( inSrc-1 ); ++ pList = pTerm->pUsing; ++ for(j=0; jnId; j++){ ++ if( columnIndex(pTerm->pTab, pList->a[j].zName)<0 || ++ columnIndex(pOther->pTab, pList->a[j].zName)<0 ){ ++ sqliteErrorMsg(pParse, "cannot join using column %s - column " ++ "not present in both tables", pList->a[j].zName); ++ return 1; ++ } ++ addWhereTerm(pList->a[j].zName, pTerm->pTab, pOther->pTab, &p->pWhere); ++ } ++ } ++ } ++ return 0; ++} ++ ++/* ++** Delete the given Select structure and all of its substructures. ++*/ ++void sqliteSelectDelete(Select *p){ ++ if( p==0 ) return; ++ sqliteExprListDelete(p->pEList); ++ sqliteSrcListDelete(p->pSrc); ++ sqliteExprDelete(p->pWhere); ++ sqliteExprListDelete(p->pGroupBy); ++ sqliteExprDelete(p->pHaving); ++ sqliteExprListDelete(p->pOrderBy); ++ sqliteSelectDelete(p->pPrior); ++ sqliteFree(p->zSelect); ++ sqliteFree(p); ++} ++ ++/* ++** Delete the aggregate information from the parse structure. ++*/ ++static void sqliteAggregateInfoReset(Parse *pParse){ ++ sqliteFree(pParse->aAgg); ++ pParse->aAgg = 0; ++ pParse->nAgg = 0; ++ pParse->useAgg = 0; ++} ++ ++/* ++** Insert code into "v" that will push the record on the top of the ++** stack into the sorter. ++*/ ++static void pushOntoSorter(Parse *pParse, Vdbe *v, ExprList *pOrderBy){ ++ char *zSortOrder; ++ int i; ++ zSortOrder = sqliteMalloc( pOrderBy->nExpr + 1 ); ++ if( zSortOrder==0 ) return; ++ for(i=0; inExpr; i++){ ++ int order = pOrderBy->a[i].sortOrder; ++ int type; ++ int c; ++ if( (order & SQLITE_SO_TYPEMASK)==SQLITE_SO_TEXT ){ ++ type = SQLITE_SO_TEXT; ++ }else if( (order & SQLITE_SO_TYPEMASK)==SQLITE_SO_NUM ){ ++ type = SQLITE_SO_NUM; ++ }else if( pParse->db->file_format>=4 ){ ++ type = sqliteExprType(pOrderBy->a[i].pExpr); ++ }else{ ++ type = SQLITE_SO_NUM; ++ } ++ if( (order & SQLITE_SO_DIRMASK)==SQLITE_SO_ASC ){ ++ c = type==SQLITE_SO_TEXT ? 'A' : '+'; ++ }else{ ++ c = type==SQLITE_SO_TEXT ? 'D' : '-'; ++ } ++ zSortOrder[i] = c; ++ sqliteExprCode(pParse, pOrderBy->a[i].pExpr); ++ } ++ zSortOrder[pOrderBy->nExpr] = 0; ++ sqliteVdbeOp3(v, OP_SortMakeKey, pOrderBy->nExpr, 0, zSortOrder, P3_DYNAMIC); ++ sqliteVdbeAddOp(v, OP_SortPut, 0, 0); ++} ++ ++/* ++** This routine adds a P3 argument to the last VDBE opcode that was ++** inserted. The P3 argument added is a string suitable for the ++** OP_MakeKey or OP_MakeIdxKey opcodes. The string consists of ++** characters 't' or 'n' depending on whether or not the various ++** fields of the key to be generated should be treated as numeric ++** or as text. See the OP_MakeKey and OP_MakeIdxKey opcode ++** documentation for additional information about the P3 string. ++** See also the sqliteAddIdxKeyType() routine. ++*/ ++void sqliteAddKeyType(Vdbe *v, ExprList *pEList){ ++ int nColumn = pEList->nExpr; ++ char *zType = sqliteMalloc( nColumn+1 ); ++ int i; ++ if( zType==0 ) return; ++ for(i=0; ia[i].pExpr)==SQLITE_SO_NUM ? 'n' : 't'; ++ } ++ zType[i] = 0; ++ sqliteVdbeChangeP3(v, -1, zType, P3_DYNAMIC); ++} ++ ++/* ++** Add code to implement the OFFSET and LIMIT ++*/ ++static void codeLimiter( ++ Vdbe *v, /* Generate code into this VM */ ++ Select *p, /* The SELECT statement being coded */ ++ int iContinue, /* Jump here to skip the current record */ ++ int iBreak, /* Jump here to end the loop */ ++ int nPop /* Number of times to pop stack when jumping */ ++){ ++ if( p->iOffset>=0 ){ ++ int addr = sqliteVdbeCurrentAddr(v) + 2; ++ if( nPop>0 ) addr++; ++ sqliteVdbeAddOp(v, OP_MemIncr, p->iOffset, addr); ++ if( nPop>0 ){ ++ sqliteVdbeAddOp(v, OP_Pop, nPop, 0); ++ } ++ sqliteVdbeAddOp(v, OP_Goto, 0, iContinue); ++ } ++ if( p->iLimit>=0 ){ ++ sqliteVdbeAddOp(v, OP_MemIncr, p->iLimit, iBreak); ++ } ++} ++ ++/* ++** This routine generates the code for the inside of the inner loop ++** of a SELECT. ++** ++** If srcTab and nColumn are both zero, then the pEList expressions ++** are evaluated in order to get the data for this row. If nColumn>0 ++** then data is pulled from srcTab and pEList is used only to get the ++** datatypes for each column. ++*/ ++static int selectInnerLoop( ++ Parse *pParse, /* The parser context */ ++ Select *p, /* The complete select statement being coded */ ++ ExprList *pEList, /* List of values being extracted */ ++ int srcTab, /* Pull data from this table */ ++ int nColumn, /* Number of columns in the source table */ ++ ExprList *pOrderBy, /* If not NULL, sort results using this key */ ++ int distinct, /* If >=0, make sure results are distinct */ ++ int eDest, /* How to dispose of the results */ ++ int iParm, /* An argument to the disposal method */ ++ int iContinue, /* Jump here to continue with next row */ ++ int iBreak /* Jump here to break out of the inner loop */ ++){ ++ Vdbe *v = pParse->pVdbe; ++ int i; ++ int hasDistinct; /* True if the DISTINCT keyword is present */ ++ ++ if( v==0 ) return 0; ++ assert( pEList!=0 ); ++ ++ /* If there was a LIMIT clause on the SELECT statement, then do the check ++ ** to see if this row should be output. ++ */ ++ hasDistinct = distinct>=0 && pEList && pEList->nExpr>0; ++ if( pOrderBy==0 && !hasDistinct ){ ++ codeLimiter(v, p, iContinue, iBreak, 0); ++ } ++ ++ /* Pull the requested columns. ++ */ ++ if( nColumn>0 ){ ++ for(i=0; inExpr; ++ for(i=0; inExpr; i++){ ++ sqliteExprCode(pParse, pEList->a[i].pExpr); ++ } ++ } ++ ++ /* If the DISTINCT keyword was present on the SELECT statement ++ ** and this row has been seen before, then do not make this row ++ ** part of the result. ++ */ ++ if( hasDistinct ){ ++#if NULL_ALWAYS_DISTINCT ++ sqliteVdbeAddOp(v, OP_IsNull, -pEList->nExpr, sqliteVdbeCurrentAddr(v)+7); ++#endif ++ sqliteVdbeAddOp(v, OP_MakeKey, pEList->nExpr, 1); ++ if( pParse->db->file_format>=4 ) sqliteAddKeyType(v, pEList); ++ sqliteVdbeAddOp(v, OP_Distinct, distinct, sqliteVdbeCurrentAddr(v)+3); ++ sqliteVdbeAddOp(v, OP_Pop, pEList->nExpr+1, 0); ++ sqliteVdbeAddOp(v, OP_Goto, 0, iContinue); ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ sqliteVdbeAddOp(v, OP_PutStrKey, distinct, 0); ++ if( pOrderBy==0 ){ ++ codeLimiter(v, p, iContinue, iBreak, nColumn); ++ } ++ } ++ ++ switch( eDest ){ ++ /* In this mode, write each query result to the key of the temporary ++ ** table iParm. ++ */ ++ case SRT_Union: { ++ sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT); ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ sqliteVdbeAddOp(v, OP_PutStrKey, iParm, 0); ++ break; ++ } ++ ++ /* Store the result as data using a unique key. ++ */ ++ case SRT_Table: ++ case SRT_TempTable: { ++ sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, 0); ++ if( pOrderBy ){ ++ pushOntoSorter(pParse, v, pOrderBy); ++ }else{ ++ sqliteVdbeAddOp(v, OP_NewRecno, iParm, 0); ++ sqliteVdbeAddOp(v, OP_Pull, 1, 0); ++ sqliteVdbeAddOp(v, OP_PutIntKey, iParm, 0); ++ } ++ break; ++ } ++ ++ /* Construct a record from the query result, but instead of ++ ** saving that record, use it as a key to delete elements from ++ ** the temporary table iParm. ++ */ ++ case SRT_Except: { ++ int addr; ++ addr = sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT); ++ sqliteVdbeAddOp(v, OP_NotFound, iParm, addr+3); ++ sqliteVdbeAddOp(v, OP_Delete, iParm, 0); ++ break; ++ } ++ ++ /* If we are creating a set for an "expr IN (SELECT ...)" construct, ++ ** then there should be a single item on the stack. Write this ++ ** item into the set table with bogus data. ++ */ ++ case SRT_Set: { ++ int addr1 = sqliteVdbeCurrentAddr(v); ++ int addr2; ++ assert( nColumn==1 ); ++ sqliteVdbeAddOp(v, OP_NotNull, -1, addr1+3); ++ sqliteVdbeAddOp(v, OP_Pop, 1, 0); ++ addr2 = sqliteVdbeAddOp(v, OP_Goto, 0, 0); ++ if( pOrderBy ){ ++ pushOntoSorter(pParse, v, pOrderBy); ++ }else{ ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ sqliteVdbeAddOp(v, OP_PutStrKey, iParm, 0); ++ } ++ sqliteVdbeChangeP2(v, addr2, sqliteVdbeCurrentAddr(v)); ++ break; ++ } ++ ++ /* If this is a scalar select that is part of an expression, then ++ ** store the results in the appropriate memory cell and break out ++ ** of the scan loop. ++ */ ++ case SRT_Mem: { ++ assert( nColumn==1 ); ++ if( pOrderBy ){ ++ pushOntoSorter(pParse, v, pOrderBy); ++ }else{ ++ sqliteVdbeAddOp(v, OP_MemStore, iParm, 1); ++ sqliteVdbeAddOp(v, OP_Goto, 0, iBreak); ++ } ++ break; ++ } ++ ++ /* Send the data to the callback function. ++ */ ++ case SRT_Callback: ++ case SRT_Sorter: { ++ if( pOrderBy ){ ++ sqliteVdbeAddOp(v, OP_SortMakeRec, nColumn, 0); ++ pushOntoSorter(pParse, v, pOrderBy); ++ }else{ ++ assert( eDest==SRT_Callback ); ++ sqliteVdbeAddOp(v, OP_Callback, nColumn, 0); ++ } ++ break; ++ } ++ ++ /* Invoke a subroutine to handle the results. The subroutine itself ++ ** is responsible for popping the results off of the stack. ++ */ ++ case SRT_Subroutine: { ++ if( pOrderBy ){ ++ sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, 0); ++ pushOntoSorter(pParse, v, pOrderBy); ++ }else{ ++ sqliteVdbeAddOp(v, OP_Gosub, 0, iParm); ++ } ++ break; ++ } ++ ++ /* Discard the results. This is used for SELECT statements inside ++ ** the body of a TRIGGER. The purpose of such selects is to call ++ ** user-defined functions that have side effects. We do not care ++ ** about the actual results of the select. ++ */ ++ default: { ++ assert( eDest==SRT_Discard ); ++ sqliteVdbeAddOp(v, OP_Pop, nColumn, 0); ++ break; ++ } ++ } ++ return 0; ++} ++ ++/* ++** If the inner loop was generated using a non-null pOrderBy argument, ++** then the results were placed in a sorter. After the loop is terminated ++** we need to run the sorter and output the results. The following ++** routine generates the code needed to do that. ++*/ ++static void generateSortTail( ++ Select *p, /* The SELECT statement */ ++ Vdbe *v, /* Generate code into this VDBE */ ++ int nColumn, /* Number of columns of data */ ++ int eDest, /* Write the sorted results here */ ++ int iParm /* Optional parameter associated with eDest */ ++){ ++ int end1 = sqliteVdbeMakeLabel(v); ++ int end2 = sqliteVdbeMakeLabel(v); ++ int addr; ++ if( eDest==SRT_Sorter ) return; ++ sqliteVdbeAddOp(v, OP_Sort, 0, 0); ++ addr = sqliteVdbeAddOp(v, OP_SortNext, 0, end1); ++ codeLimiter(v, p, addr, end2, 1); ++ switch( eDest ){ ++ case SRT_Callback: { ++ sqliteVdbeAddOp(v, OP_SortCallback, nColumn, 0); ++ break; ++ } ++ case SRT_Table: ++ case SRT_TempTable: { ++ sqliteVdbeAddOp(v, OP_NewRecno, iParm, 0); ++ sqliteVdbeAddOp(v, OP_Pull, 1, 0); ++ sqliteVdbeAddOp(v, OP_PutIntKey, iParm, 0); ++ break; ++ } ++ case SRT_Set: { ++ assert( nColumn==1 ); ++ sqliteVdbeAddOp(v, OP_NotNull, -1, sqliteVdbeCurrentAddr(v)+3); ++ sqliteVdbeAddOp(v, OP_Pop, 1, 0); ++ sqliteVdbeAddOp(v, OP_Goto, 0, sqliteVdbeCurrentAddr(v)+3); ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ sqliteVdbeAddOp(v, OP_PutStrKey, iParm, 0); ++ break; ++ } ++ case SRT_Mem: { ++ assert( nColumn==1 ); ++ sqliteVdbeAddOp(v, OP_MemStore, iParm, 1); ++ sqliteVdbeAddOp(v, OP_Goto, 0, end1); ++ break; ++ } ++ case SRT_Subroutine: { ++ int i; ++ for(i=0; ipVdbe; ++ int i, j; ++ for(i=0; inExpr; i++){ ++ Expr *p = pEList->a[i].pExpr; ++ char *zType = 0; ++ if( p==0 ) continue; ++ if( p->op==TK_COLUMN && pTabList ){ ++ Table *pTab; ++ int iCol = p->iColumn; ++ for(j=0; jnSrc && pTabList->a[j].iCursor!=p->iTable; j++){} ++ assert( jnSrc ); ++ pTab = pTabList->a[j].pTab; ++ if( iCol<0 ) iCol = pTab->iPKey; ++ assert( iCol==-1 || (iCol>=0 && iColnCol) ); ++ if( iCol<0 ){ ++ zType = "INTEGER"; ++ }else{ ++ zType = pTab->aCol[iCol].zType; ++ } ++ }else{ ++ if( sqliteExprType(p)==SQLITE_SO_TEXT ){ ++ zType = "TEXT"; ++ }else{ ++ zType = "NUMERIC"; ++ } ++ } ++ sqliteVdbeOp3(v, OP_ColumnName, i + pEList->nExpr, 0, zType, 0); ++ } ++} ++ ++/* ++** Generate code that will tell the VDBE the names of columns ++** in the result set. This information is used to provide the ++** azCol[] values in the callback. ++*/ ++static void generateColumnNames( ++ Parse *pParse, /* Parser context */ ++ SrcList *pTabList, /* List of tables */ ++ ExprList *pEList /* Expressions defining the result set */ ++){ ++ Vdbe *v = pParse->pVdbe; ++ int i, j; ++ sqlite *db = pParse->db; ++ int fullNames, shortNames; ++ ++ assert( v!=0 ); ++ if( pParse->colNamesSet || v==0 || sqlite_malloc_failed ) return; ++ pParse->colNamesSet = 1; ++ fullNames = (db->flags & SQLITE_FullColNames)!=0; ++ shortNames = (db->flags & SQLITE_ShortColNames)!=0; ++ for(i=0; inExpr; i++){ ++ Expr *p; ++ int p2 = i==pEList->nExpr-1; ++ p = pEList->a[i].pExpr; ++ if( p==0 ) continue; ++ if( pEList->a[i].zName ){ ++ char *zName = pEList->a[i].zName; ++ sqliteVdbeOp3(v, OP_ColumnName, i, p2, zName, 0); ++ continue; ++ } ++ if( p->op==TK_COLUMN && pTabList ){ ++ Table *pTab; ++ char *zCol; ++ int iCol = p->iColumn; ++ for(j=0; jnSrc && pTabList->a[j].iCursor!=p->iTable; j++){} ++ assert( jnSrc ); ++ pTab = pTabList->a[j].pTab; ++ if( iCol<0 ) iCol = pTab->iPKey; ++ assert( iCol==-1 || (iCol>=0 && iColnCol) ); ++ if( iCol<0 ){ ++ zCol = "_ROWID_"; ++ }else{ ++ zCol = pTab->aCol[iCol].zName; ++ } ++ if( !shortNames && !fullNames && p->span.z && p->span.z[0] ){ ++ int addr = sqliteVdbeOp3(v,OP_ColumnName, i, p2, p->span.z, p->span.n); ++ sqliteVdbeCompressSpace(v, addr); ++ }else if( fullNames || (!shortNames && pTabList->nSrc>1) ){ ++ char *zName = 0; ++ char *zTab; ++ ++ zTab = pTabList->a[j].zAlias; ++ if( fullNames || zTab==0 ) zTab = pTab->zName; ++ sqliteSetString(&zName, zTab, ".", zCol, 0); ++ sqliteVdbeOp3(v, OP_ColumnName, i, p2, zName, P3_DYNAMIC); ++ }else{ ++ sqliteVdbeOp3(v, OP_ColumnName, i, p2, zCol, 0); ++ } ++ }else if( p->span.z && p->span.z[0] ){ ++ int addr = sqliteVdbeOp3(v,OP_ColumnName, i, p2, p->span.z, p->span.n); ++ sqliteVdbeCompressSpace(v, addr); ++ }else{ ++ char zName[30]; ++ assert( p->op!=TK_COLUMN || pTabList==0 ); ++ sprintf(zName, "column%d", i+1); ++ sqliteVdbeOp3(v, OP_ColumnName, i, p2, zName, 0); ++ } ++ } ++} ++ ++/* ++** Name of the connection operator, used for error messages. ++*/ ++static const char *selectOpName(int id){ ++ char *z; ++ switch( id ){ ++ case TK_ALL: z = "UNION ALL"; break; ++ case TK_INTERSECT: z = "INTERSECT"; break; ++ case TK_EXCEPT: z = "EXCEPT"; break; ++ default: z = "UNION"; break; ++ } ++ return z; ++} ++ ++/* ++** Forward declaration ++*/ ++static int fillInColumnList(Parse*, Select*); ++ ++/* ++** Given a SELECT statement, generate a Table structure that describes ++** the result set of that SELECT. ++*/ ++Table *sqliteResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){ ++ Table *pTab; ++ int i, j; ++ ExprList *pEList; ++ Column *aCol; ++ ++ if( fillInColumnList(pParse, pSelect) ){ ++ return 0; ++ } ++ pTab = sqliteMalloc( sizeof(Table) ); ++ if( pTab==0 ){ ++ return 0; ++ } ++ pTab->zName = zTabName ? sqliteStrDup(zTabName) : 0; ++ pEList = pSelect->pEList; ++ pTab->nCol = pEList->nExpr; ++ assert( pTab->nCol>0 ); ++ pTab->aCol = aCol = sqliteMalloc( sizeof(pTab->aCol[0])*pTab->nCol ); ++ for(i=0; inCol; i++){ ++ Expr *p, *pR; ++ if( pEList->a[i].zName ){ ++ aCol[i].zName = sqliteStrDup(pEList->a[i].zName); ++ }else if( (p=pEList->a[i].pExpr)->op==TK_DOT ++ && (pR=p->pRight)!=0 && pR->token.z && pR->token.z[0] ){ ++ int cnt; ++ sqliteSetNString(&aCol[i].zName, pR->token.z, pR->token.n, 0); ++ for(j=cnt=0; jtoken.z, pR->token.n, zBuf, n,0); ++ j = -1; ++ } ++ } ++ }else if( p->span.z && p->span.z[0] ){ ++ sqliteSetNString(&pTab->aCol[i].zName, p->span.z, p->span.n, 0); ++ }else{ ++ char zBuf[30]; ++ sprintf(zBuf, "column%d", i+1); ++ aCol[i].zName = sqliteStrDup(zBuf); ++ } ++ sqliteDequote(aCol[i].zName); ++ } ++ pTab->iPKey = -1; ++ return pTab; ++} ++ ++/* ++** For the given SELECT statement, do three things. ++** ++** (1) Fill in the pTabList->a[].pTab fields in the SrcList that ++** defines the set of tables that should be scanned. For views, ++** fill pTabList->a[].pSelect with a copy of the SELECT statement ++** that implements the view. A copy is made of the view's SELECT ++** statement so that we can freely modify or delete that statement ++** without worrying about messing up the presistent representation ++** of the view. ++** ++** (2) Add terms to the WHERE clause to accomodate the NATURAL keyword ++** on joins and the ON and USING clause of joins. ++** ++** (3) Scan the list of columns in the result set (pEList) looking ++** for instances of the "*" operator or the TABLE.* operator. ++** If found, expand each "*" to be every column in every table ++** and TABLE.* to be every column in TABLE. ++** ++** Return 0 on success. If there are problems, leave an error message ++** in pParse and return non-zero. ++*/ ++static int fillInColumnList(Parse *pParse, Select *p){ ++ int i, j, k, rc; ++ SrcList *pTabList; ++ ExprList *pEList; ++ Table *pTab; ++ ++ if( p==0 || p->pSrc==0 ) return 1; ++ pTabList = p->pSrc; ++ pEList = p->pEList; ++ ++ /* Look up every table in the table list. ++ */ ++ for(i=0; inSrc; i++){ ++ if( pTabList->a[i].pTab ){ ++ /* This routine has run before! No need to continue */ ++ return 0; ++ } ++ if( pTabList->a[i].zName==0 ){ ++ /* A sub-query in the FROM clause of a SELECT */ ++ assert( pTabList->a[i].pSelect!=0 ); ++ if( pTabList->a[i].zAlias==0 ){ ++ char zFakeName[60]; ++ sprintf(zFakeName, "sqlite_subquery_%p_", ++ (void*)pTabList->a[i].pSelect); ++ sqliteSetString(&pTabList->a[i].zAlias, zFakeName, 0); ++ } ++ pTabList->a[i].pTab = pTab = ++ sqliteResultSetOfSelect(pParse, pTabList->a[i].zAlias, ++ pTabList->a[i].pSelect); ++ if( pTab==0 ){ ++ return 1; ++ } ++ /* The isTransient flag indicates that the Table structure has been ++ ** dynamically allocated and may be freed at any time. In other words, ++ ** pTab is not pointing to a persistent table structure that defines ++ ** part of the schema. */ ++ pTab->isTransient = 1; ++ }else{ ++ /* An ordinary table or view name in the FROM clause */ ++ pTabList->a[i].pTab = pTab = ++ sqliteLocateTable(pParse,pTabList->a[i].zName,pTabList->a[i].zDatabase); ++ if( pTab==0 ){ ++ return 1; ++ } ++ if( pTab->pSelect ){ ++ /* We reach here if the named table is a really a view */ ++ if( sqliteViewGetColumnNames(pParse, pTab) ){ ++ return 1; ++ } ++ /* If pTabList->a[i].pSelect!=0 it means we are dealing with a ++ ** view within a view. The SELECT structure has already been ++ ** copied by the outer view so we can skip the copy step here ++ ** in the inner view. ++ */ ++ if( pTabList->a[i].pSelect==0 ){ ++ pTabList->a[i].pSelect = sqliteSelectDup(pTab->pSelect); ++ } ++ } ++ } ++ } ++ ++ /* Process NATURAL keywords, and ON and USING clauses of joins. ++ */ ++ if( sqliteProcessJoin(pParse, p) ) return 1; ++ ++ /* For every "*" that occurs in the column list, insert the names of ++ ** all columns in all tables. And for every TABLE.* insert the names ++ ** of all columns in TABLE. The parser inserted a special expression ++ ** with the TK_ALL operator for each "*" that it found in the column list. ++ ** The following code just has to locate the TK_ALL expressions and expand ++ ** each one to the list of all columns in all tables. ++ ** ++ ** The first loop just checks to see if there are any "*" operators ++ ** that need expanding. ++ */ ++ for(k=0; knExpr; k++){ ++ Expr *pE = pEList->a[k].pExpr; ++ if( pE->op==TK_ALL ) break; ++ if( pE->op==TK_DOT && pE->pRight && pE->pRight->op==TK_ALL ++ && pE->pLeft && pE->pLeft->op==TK_ID ) break; ++ } ++ rc = 0; ++ if( knExpr ){ ++ /* ++ ** If we get here it means the result set contains one or more "*" ++ ** operators that need to be expanded. Loop through each expression ++ ** in the result set and expand them one by one. ++ */ ++ struct ExprList_item *a = pEList->a; ++ ExprList *pNew = 0; ++ for(k=0; knExpr; k++){ ++ Expr *pE = a[k].pExpr; ++ if( pE->op!=TK_ALL && ++ (pE->op!=TK_DOT || pE->pRight==0 || pE->pRight->op!=TK_ALL) ){ ++ /* This particular expression does not need to be expanded. ++ */ ++ pNew = sqliteExprListAppend(pNew, a[k].pExpr, 0); ++ pNew->a[pNew->nExpr-1].zName = a[k].zName; ++ a[k].pExpr = 0; ++ a[k].zName = 0; ++ }else{ ++ /* This expression is a "*" or a "TABLE.*" and needs to be ++ ** expanded. */ ++ int tableSeen = 0; /* Set to 1 when TABLE matches */ ++ char *zTName; /* text of name of TABLE */ ++ if( pE->op==TK_DOT && pE->pLeft ){ ++ zTName = sqliteTableNameFromToken(&pE->pLeft->token); ++ }else{ ++ zTName = 0; ++ } ++ for(i=0; inSrc; i++){ ++ Table *pTab = pTabList->a[i].pTab; ++ char *zTabName = pTabList->a[i].zAlias; ++ if( zTabName==0 || zTabName[0]==0 ){ ++ zTabName = pTab->zName; ++ } ++ if( zTName && (zTabName==0 || zTabName[0]==0 || ++ sqliteStrICmp(zTName, zTabName)!=0) ){ ++ continue; ++ } ++ tableSeen = 1; ++ for(j=0; jnCol; j++){ ++ Expr *pExpr, *pLeft, *pRight; ++ char *zName = pTab->aCol[j].zName; ++ ++ if( i>0 && (pTabList->a[i-1].jointype & JT_NATURAL)!=0 && ++ columnIndex(pTabList->a[i-1].pTab, zName)>=0 ){ ++ /* In a NATURAL join, omit the join columns from the ++ ** table on the right */ ++ continue; ++ } ++ if( i>0 && sqliteIdListIndex(pTabList->a[i-1].pUsing, zName)>=0 ){ ++ /* In a join with a USING clause, omit columns in the ++ ** using clause from the table on the right. */ ++ continue; ++ } ++ pRight = sqliteExpr(TK_ID, 0, 0, 0); ++ if( pRight==0 ) break; ++ pRight->token.z = zName; ++ pRight->token.n = strlen(zName); ++ pRight->token.dyn = 0; ++ if( zTabName && pTabList->nSrc>1 ){ ++ pLeft = sqliteExpr(TK_ID, 0, 0, 0); ++ pExpr = sqliteExpr(TK_DOT, pLeft, pRight, 0); ++ if( pExpr==0 ) break; ++ pLeft->token.z = zTabName; ++ pLeft->token.n = strlen(zTabName); ++ pLeft->token.dyn = 0; ++ sqliteSetString((char**)&pExpr->span.z, zTabName, ".", zName, 0); ++ pExpr->span.n = strlen(pExpr->span.z); ++ pExpr->span.dyn = 1; ++ pExpr->token.z = 0; ++ pExpr->token.n = 0; ++ pExpr->token.dyn = 0; ++ }else{ ++ pExpr = pRight; ++ pExpr->span = pExpr->token; ++ } ++ pNew = sqliteExprListAppend(pNew, pExpr, 0); ++ } ++ } ++ if( !tableSeen ){ ++ if( zTName ){ ++ sqliteErrorMsg(pParse, "no such table: %s", zTName); ++ }else{ ++ sqliteErrorMsg(pParse, "no tables specified"); ++ } ++ rc = 1; ++ } ++ sqliteFree(zTName); ++ } ++ } ++ sqliteExprListDelete(pEList); ++ p->pEList = pNew; ++ } ++ return rc; ++} ++ ++/* ++** This routine recursively unlinks the Select.pSrc.a[].pTab pointers ++** in a select structure. It just sets the pointers to NULL. This ++** routine is recursive in the sense that if the Select.pSrc.a[].pSelect ++** pointer is not NULL, this routine is called recursively on that pointer. ++** ++** This routine is called on the Select structure that defines a ++** VIEW in order to undo any bindings to tables. This is necessary ++** because those tables might be DROPed by a subsequent SQL command. ++** If the bindings are not removed, then the Select.pSrc->a[].pTab field ++** will be left pointing to a deallocated Table structure after the ++** DROP and a coredump will occur the next time the VIEW is used. ++*/ ++void sqliteSelectUnbind(Select *p){ ++ int i; ++ SrcList *pSrc = p->pSrc; ++ Table *pTab; ++ if( p==0 ) return; ++ for(i=0; inSrc; i++){ ++ if( (pTab = pSrc->a[i].pTab)!=0 ){ ++ if( pTab->isTransient ){ ++ sqliteDeleteTable(0, pTab); ++ } ++ pSrc->a[i].pTab = 0; ++ if( pSrc->a[i].pSelect ){ ++ sqliteSelectUnbind(pSrc->a[i].pSelect); ++ } ++ } ++ } ++} ++ ++/* ++** This routine associates entries in an ORDER BY expression list with ++** columns in a result. For each ORDER BY expression, the opcode of ++** the top-level node is changed to TK_COLUMN and the iColumn value of ++** the top-level node is filled in with column number and the iTable ++** value of the top-level node is filled with iTable parameter. ++** ++** If there are prior SELECT clauses, they are processed first. A match ++** in an earlier SELECT takes precedence over a later SELECT. ++** ++** Any entry that does not match is flagged as an error. The number ++** of errors is returned. ++** ++** This routine does NOT correctly initialize the Expr.dataType field ++** of the ORDER BY expressions. The multiSelectSortOrder() routine ++** must be called to do that after the individual select statements ++** have all been analyzed. This routine is unable to compute Expr.dataType ++** because it must be called before the individual select statements ++** have been analyzed. ++*/ ++static int matchOrderbyToColumn( ++ Parse *pParse, /* A place to leave error messages */ ++ Select *pSelect, /* Match to result columns of this SELECT */ ++ ExprList *pOrderBy, /* The ORDER BY values to match against columns */ ++ int iTable, /* Insert this value in iTable */ ++ int mustComplete /* If TRUE all ORDER BYs must match */ ++){ ++ int nErr = 0; ++ int i, j; ++ ExprList *pEList; ++ ++ if( pSelect==0 || pOrderBy==0 ) return 1; ++ if( mustComplete ){ ++ for(i=0; inExpr; i++){ pOrderBy->a[i].done = 0; } ++ } ++ if( fillInColumnList(pParse, pSelect) ){ ++ return 1; ++ } ++ if( pSelect->pPrior ){ ++ if( matchOrderbyToColumn(pParse, pSelect->pPrior, pOrderBy, iTable, 0) ){ ++ return 1; ++ } ++ } ++ pEList = pSelect->pEList; ++ for(i=0; inExpr; i++){ ++ Expr *pE = pOrderBy->a[i].pExpr; ++ int iCol = -1; ++ if( pOrderBy->a[i].done ) continue; ++ if( sqliteExprIsInteger(pE, &iCol) ){ ++ if( iCol<=0 || iCol>pEList->nExpr ){ ++ sqliteErrorMsg(pParse, ++ "ORDER BY position %d should be between 1 and %d", ++ iCol, pEList->nExpr); ++ nErr++; ++ break; ++ } ++ if( !mustComplete ) continue; ++ iCol--; ++ } ++ for(j=0; iCol<0 && jnExpr; j++){ ++ if( pEList->a[j].zName && (pE->op==TK_ID || pE->op==TK_STRING) ){ ++ char *zName, *zLabel; ++ zName = pEList->a[j].zName; ++ assert( pE->token.z ); ++ zLabel = sqliteStrNDup(pE->token.z, pE->token.n); ++ sqliteDequote(zLabel); ++ if( sqliteStrICmp(zName, zLabel)==0 ){ ++ iCol = j; ++ } ++ sqliteFree(zLabel); ++ } ++ if( iCol<0 && sqliteExprCompare(pE, pEList->a[j].pExpr) ){ ++ iCol = j; ++ } ++ } ++ if( iCol>=0 ){ ++ pE->op = TK_COLUMN; ++ pE->iColumn = iCol; ++ pE->iTable = iTable; ++ pOrderBy->a[i].done = 1; ++ } ++ if( iCol<0 && mustComplete ){ ++ sqliteErrorMsg(pParse, ++ "ORDER BY term number %d does not match any result column", i+1); ++ nErr++; ++ break; ++ } ++ } ++ return nErr; ++} ++ ++/* ++** Get a VDBE for the given parser context. Create a new one if necessary. ++** If an error occurs, return NULL and leave a message in pParse. ++*/ ++Vdbe *sqliteGetVdbe(Parse *pParse){ ++ Vdbe *v = pParse->pVdbe; ++ if( v==0 ){ ++ v = pParse->pVdbe = sqliteVdbeCreate(pParse->db); ++ } ++ return v; ++} ++ ++/* ++** This routine sets the Expr.dataType field on all elements of ++** the pOrderBy expression list. The pOrderBy list will have been ++** set up by matchOrderbyToColumn(). Hence each expression has ++** a TK_COLUMN as its root node. The Expr.iColumn refers to a ++** column in the result set. The datatype is set to SQLITE_SO_TEXT ++** if the corresponding column in p and every SELECT to the left of ++** p has a datatype of SQLITE_SO_TEXT. If the cooressponding column ++** in p or any of the left SELECTs is SQLITE_SO_NUM, then the datatype ++** of the order-by expression is set to SQLITE_SO_NUM. ++** ++** Examples: ++** ++** CREATE TABLE one(a INTEGER, b TEXT); ++** CREATE TABLE two(c VARCHAR(5), d FLOAT); ++** ++** SELECT b, b FROM one UNION SELECT d, c FROM two ORDER BY 1, 2; ++** ++** The primary sort key will use SQLITE_SO_NUM because the "d" in ++** the second SELECT is numeric. The 1st column of the first SELECT ++** is text but that does not matter because a numeric always overrides ++** a text. ++** ++** The secondary key will use the SQLITE_SO_TEXT sort order because ++** both the (second) "b" in the first SELECT and the "c" in the second ++** SELECT have a datatype of text. ++*/ ++static void multiSelectSortOrder(Select *p, ExprList *pOrderBy){ ++ int i; ++ ExprList *pEList; ++ if( pOrderBy==0 ) return; ++ if( p==0 ){ ++ for(i=0; inExpr; i++){ ++ pOrderBy->a[i].pExpr->dataType = SQLITE_SO_TEXT; ++ } ++ return; ++ } ++ multiSelectSortOrder(p->pPrior, pOrderBy); ++ pEList = p->pEList; ++ for(i=0; inExpr; i++){ ++ Expr *pE = pOrderBy->a[i].pExpr; ++ if( pE->dataType==SQLITE_SO_NUM ) continue; ++ assert( pE->iColumn>=0 ); ++ if( pEList->nExpr>pE->iColumn ){ ++ pE->dataType = sqliteExprType(pEList->a[pE->iColumn].pExpr); ++ } ++ } ++} ++ ++/* ++** Compute the iLimit and iOffset fields of the SELECT based on the ++** nLimit and nOffset fields. nLimit and nOffset hold the integers ++** that appear in the original SQL statement after the LIMIT and OFFSET ++** keywords. Or that hold -1 and 0 if those keywords are omitted. ++** iLimit and iOffset are the integer memory register numbers for ++** counters used to compute the limit and offset. If there is no ++** limit and/or offset, then iLimit and iOffset are negative. ++** ++** This routine changes the values if iLimit and iOffset only if ++** a limit or offset is defined by nLimit and nOffset. iLimit and ++** iOffset should have been preset to appropriate default values ++** (usually but not always -1) prior to calling this routine. ++** Only if nLimit>=0 or nOffset>0 do the limit registers get ++** redefined. The UNION ALL operator uses this property to force ++** the reuse of the same limit and offset registers across multiple ++** SELECT statements. ++*/ ++static void computeLimitRegisters(Parse *pParse, Select *p){ ++ /* ++ ** If the comparison is p->nLimit>0 then "LIMIT 0" shows ++ ** all rows. It is the same as no limit. If the comparision is ++ ** p->nLimit>=0 then "LIMIT 0" show no rows at all. ++ ** "LIMIT -1" always shows all rows. There is some ++ ** contraversy about what the correct behavior should be. ++ ** The current implementation interprets "LIMIT 0" to mean ++ ** no rows. ++ */ ++ if( p->nLimit>=0 ){ ++ int iMem = pParse->nMem++; ++ Vdbe *v = sqliteGetVdbe(pParse); ++ if( v==0 ) return; ++ sqliteVdbeAddOp(v, OP_Integer, -p->nLimit, 0); ++ sqliteVdbeAddOp(v, OP_MemStore, iMem, 1); ++ p->iLimit = iMem; ++ } ++ if( p->nOffset>0 ){ ++ int iMem = pParse->nMem++; ++ Vdbe *v = sqliteGetVdbe(pParse); ++ if( v==0 ) return; ++ sqliteVdbeAddOp(v, OP_Integer, -p->nOffset, 0); ++ sqliteVdbeAddOp(v, OP_MemStore, iMem, 1); ++ p->iOffset = iMem; ++ } ++} ++ ++/* ++** This routine is called to process a query that is really the union ++** or intersection of two or more separate queries. ++** ++** "p" points to the right-most of the two queries. the query on the ++** left is p->pPrior. The left query could also be a compound query ++** in which case this routine will be called recursively. ++** ++** The results of the total query are to be written into a destination ++** of type eDest with parameter iParm. ++** ++** Example 1: Consider a three-way compound SQL statement. ++** ++** SELECT a FROM t1 UNION SELECT b FROM t2 UNION SELECT c FROM t3 ++** ++** This statement is parsed up as follows: ++** ++** SELECT c FROM t3 ++** | ++** `-----> SELECT b FROM t2 ++** | ++** `------> SELECT a FROM t1 ++** ++** The arrows in the diagram above represent the Select.pPrior pointer. ++** So if this routine is called with p equal to the t3 query, then ++** pPrior will be the t2 query. p->op will be TK_UNION in this case. ++** ++** Notice that because of the way SQLite parses compound SELECTs, the ++** individual selects always group from left to right. ++*/ ++static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){ ++ int rc; /* Success code from a subroutine */ ++ Select *pPrior; /* Another SELECT immediately to our left */ ++ Vdbe *v; /* Generate code to this VDBE */ ++ ++ /* Make sure there is no ORDER BY or LIMIT clause on prior SELECTs. Only ++ ** the last SELECT in the series may have an ORDER BY or LIMIT. ++ */ ++ if( p==0 || p->pPrior==0 ) return 1; ++ pPrior = p->pPrior; ++ if( pPrior->pOrderBy ){ ++ sqliteErrorMsg(pParse,"ORDER BY clause should come after %s not before", ++ selectOpName(p->op)); ++ return 1; ++ } ++ if( pPrior->nLimit>=0 || pPrior->nOffset>0 ){ ++ sqliteErrorMsg(pParse,"LIMIT clause should come after %s not before", ++ selectOpName(p->op)); ++ return 1; ++ } ++ ++ /* Make sure we have a valid query engine. If not, create a new one. ++ */ ++ v = sqliteGetVdbe(pParse); ++ if( v==0 ) return 1; ++ ++ /* Create the destination temporary table if necessary ++ */ ++ if( eDest==SRT_TempTable ){ ++ sqliteVdbeAddOp(v, OP_OpenTemp, iParm, 0); ++ eDest = SRT_Table; ++ } ++ ++ /* Generate code for the left and right SELECT statements. ++ */ ++ switch( p->op ){ ++ case TK_ALL: { ++ if( p->pOrderBy==0 ){ ++ pPrior->nLimit = p->nLimit; ++ pPrior->nOffset = p->nOffset; ++ rc = sqliteSelect(pParse, pPrior, eDest, iParm, 0, 0, 0); ++ if( rc ) return rc; ++ p->pPrior = 0; ++ p->iLimit = pPrior->iLimit; ++ p->iOffset = pPrior->iOffset; ++ p->nLimit = -1; ++ p->nOffset = 0; ++ rc = sqliteSelect(pParse, p, eDest, iParm, 0, 0, 0); ++ p->pPrior = pPrior; ++ if( rc ) return rc; ++ break; ++ } ++ /* For UNION ALL ... ORDER BY fall through to the next case */ ++ } ++ case TK_EXCEPT: ++ case TK_UNION: { ++ int unionTab; /* Cursor number of the temporary table holding result */ ++ int op; /* One of the SRT_ operations to apply to self */ ++ int priorOp; /* The SRT_ operation to apply to prior selects */ ++ int nLimit, nOffset; /* Saved values of p->nLimit and p->nOffset */ ++ ExprList *pOrderBy; /* The ORDER BY clause for the right SELECT */ ++ ++ priorOp = p->op==TK_ALL ? SRT_Table : SRT_Union; ++ if( eDest==priorOp && p->pOrderBy==0 && p->nLimit<0 && p->nOffset==0 ){ ++ /* We can reuse a temporary table generated by a SELECT to our ++ ** right. ++ */ ++ unionTab = iParm; ++ }else{ ++ /* We will need to create our own temporary table to hold the ++ ** intermediate results. ++ */ ++ unionTab = pParse->nTab++; ++ if( p->pOrderBy ++ && matchOrderbyToColumn(pParse, p, p->pOrderBy, unionTab, 1) ){ ++ return 1; ++ } ++ if( p->op!=TK_ALL ){ ++ sqliteVdbeAddOp(v, OP_OpenTemp, unionTab, 1); ++ sqliteVdbeAddOp(v, OP_KeyAsData, unionTab, 1); ++ }else{ ++ sqliteVdbeAddOp(v, OP_OpenTemp, unionTab, 0); ++ } ++ } ++ ++ /* Code the SELECT statements to our left ++ */ ++ rc = sqliteSelect(pParse, pPrior, priorOp, unionTab, 0, 0, 0); ++ if( rc ) return rc; ++ ++ /* Code the current SELECT statement ++ */ ++ switch( p->op ){ ++ case TK_EXCEPT: op = SRT_Except; break; ++ case TK_UNION: op = SRT_Union; break; ++ case TK_ALL: op = SRT_Table; break; ++ } ++ p->pPrior = 0; ++ pOrderBy = p->pOrderBy; ++ p->pOrderBy = 0; ++ nLimit = p->nLimit; ++ p->nLimit = -1; ++ nOffset = p->nOffset; ++ p->nOffset = 0; ++ rc = sqliteSelect(pParse, p, op, unionTab, 0, 0, 0); ++ p->pPrior = pPrior; ++ p->pOrderBy = pOrderBy; ++ p->nLimit = nLimit; ++ p->nOffset = nOffset; ++ if( rc ) return rc; ++ ++ /* Convert the data in the temporary table into whatever form ++ ** it is that we currently need. ++ */ ++ if( eDest!=priorOp || unionTab!=iParm ){ ++ int iCont, iBreak, iStart; ++ assert( p->pEList ); ++ if( eDest==SRT_Callback ){ ++ generateColumnNames(pParse, 0, p->pEList); ++ generateColumnTypes(pParse, p->pSrc, p->pEList); ++ } ++ iBreak = sqliteVdbeMakeLabel(v); ++ iCont = sqliteVdbeMakeLabel(v); ++ sqliteVdbeAddOp(v, OP_Rewind, unionTab, iBreak); ++ computeLimitRegisters(pParse, p); ++ iStart = sqliteVdbeCurrentAddr(v); ++ multiSelectSortOrder(p, p->pOrderBy); ++ rc = selectInnerLoop(pParse, p, p->pEList, unionTab, p->pEList->nExpr, ++ p->pOrderBy, -1, eDest, iParm, ++ iCont, iBreak); ++ if( rc ) return 1; ++ sqliteVdbeResolveLabel(v, iCont); ++ sqliteVdbeAddOp(v, OP_Next, unionTab, iStart); ++ sqliteVdbeResolveLabel(v, iBreak); ++ sqliteVdbeAddOp(v, OP_Close, unionTab, 0); ++ if( p->pOrderBy ){ ++ generateSortTail(p, v, p->pEList->nExpr, eDest, iParm); ++ } ++ } ++ break; ++ } ++ case TK_INTERSECT: { ++ int tab1, tab2; ++ int iCont, iBreak, iStart; ++ int nLimit, nOffset; ++ ++ /* INTERSECT is different from the others since it requires ++ ** two temporary tables. Hence it has its own case. Begin ++ ** by allocating the tables we will need. ++ */ ++ tab1 = pParse->nTab++; ++ tab2 = pParse->nTab++; ++ if( p->pOrderBy && matchOrderbyToColumn(pParse,p,p->pOrderBy,tab1,1) ){ ++ return 1; ++ } ++ sqliteVdbeAddOp(v, OP_OpenTemp, tab1, 1); ++ sqliteVdbeAddOp(v, OP_KeyAsData, tab1, 1); ++ ++ /* Code the SELECTs to our left into temporary table "tab1". ++ */ ++ rc = sqliteSelect(pParse, pPrior, SRT_Union, tab1, 0, 0, 0); ++ if( rc ) return rc; ++ ++ /* Code the current SELECT into temporary table "tab2" ++ */ ++ sqliteVdbeAddOp(v, OP_OpenTemp, tab2, 1); ++ sqliteVdbeAddOp(v, OP_KeyAsData, tab2, 1); ++ p->pPrior = 0; ++ nLimit = p->nLimit; ++ p->nLimit = -1; ++ nOffset = p->nOffset; ++ p->nOffset = 0; ++ rc = sqliteSelect(pParse, p, SRT_Union, tab2, 0, 0, 0); ++ p->pPrior = pPrior; ++ p->nLimit = nLimit; ++ p->nOffset = nOffset; ++ if( rc ) return rc; ++ ++ /* Generate code to take the intersection of the two temporary ++ ** tables. ++ */ ++ assert( p->pEList ); ++ if( eDest==SRT_Callback ){ ++ generateColumnNames(pParse, 0, p->pEList); ++ generateColumnTypes(pParse, p->pSrc, p->pEList); ++ } ++ iBreak = sqliteVdbeMakeLabel(v); ++ iCont = sqliteVdbeMakeLabel(v); ++ sqliteVdbeAddOp(v, OP_Rewind, tab1, iBreak); ++ computeLimitRegisters(pParse, p); ++ iStart = sqliteVdbeAddOp(v, OP_FullKey, tab1, 0); ++ sqliteVdbeAddOp(v, OP_NotFound, tab2, iCont); ++ multiSelectSortOrder(p, p->pOrderBy); ++ rc = selectInnerLoop(pParse, p, p->pEList, tab1, p->pEList->nExpr, ++ p->pOrderBy, -1, eDest, iParm, ++ iCont, iBreak); ++ if( rc ) return 1; ++ sqliteVdbeResolveLabel(v, iCont); ++ sqliteVdbeAddOp(v, OP_Next, tab1, iStart); ++ sqliteVdbeResolveLabel(v, iBreak); ++ sqliteVdbeAddOp(v, OP_Close, tab2, 0); ++ sqliteVdbeAddOp(v, OP_Close, tab1, 0); ++ if( p->pOrderBy ){ ++ generateSortTail(p, v, p->pEList->nExpr, eDest, iParm); ++ } ++ break; ++ } ++ } ++ assert( p->pEList && pPrior->pEList ); ++ if( p->pEList->nExpr!=pPrior->pEList->nExpr ){ ++ sqliteErrorMsg(pParse, "SELECTs to the left and right of %s" ++ " do not have the same number of result columns", selectOpName(p->op)); ++ return 1; ++ } ++ return 0; ++} ++ ++/* ++** Scan through the expression pExpr. Replace every reference to ++** a column in table number iTable with a copy of the iColumn-th ++** entry in pEList. (But leave references to the ROWID column ++** unchanged.) ++** ++** This routine is part of the flattening procedure. A subquery ++** whose result set is defined by pEList appears as entry in the ++** FROM clause of a SELECT such that the VDBE cursor assigned to that ++** FORM clause entry is iTable. This routine make the necessary ++** changes to pExpr so that it refers directly to the source table ++** of the subquery rather the result set of the subquery. ++*/ ++static void substExprList(ExprList*,int,ExprList*); /* Forward Decl */ ++static void substExpr(Expr *pExpr, int iTable, ExprList *pEList){ ++ if( pExpr==0 ) return; ++ if( pExpr->op==TK_COLUMN && pExpr->iTable==iTable ){ ++ if( pExpr->iColumn<0 ){ ++ pExpr->op = TK_NULL; ++ }else{ ++ Expr *pNew; ++ assert( pEList!=0 && pExpr->iColumnnExpr ); ++ assert( pExpr->pLeft==0 && pExpr->pRight==0 && pExpr->pList==0 ); ++ pNew = pEList->a[pExpr->iColumn].pExpr; ++ assert( pNew!=0 ); ++ pExpr->op = pNew->op; ++ pExpr->dataType = pNew->dataType; ++ assert( pExpr->pLeft==0 ); ++ pExpr->pLeft = sqliteExprDup(pNew->pLeft); ++ assert( pExpr->pRight==0 ); ++ pExpr->pRight = sqliteExprDup(pNew->pRight); ++ assert( pExpr->pList==0 ); ++ pExpr->pList = sqliteExprListDup(pNew->pList); ++ pExpr->iTable = pNew->iTable; ++ pExpr->iColumn = pNew->iColumn; ++ pExpr->iAgg = pNew->iAgg; ++ sqliteTokenCopy(&pExpr->token, &pNew->token); ++ sqliteTokenCopy(&pExpr->span, &pNew->span); ++ } ++ }else{ ++ substExpr(pExpr->pLeft, iTable, pEList); ++ substExpr(pExpr->pRight, iTable, pEList); ++ substExprList(pExpr->pList, iTable, pEList); ++ } ++} ++static void ++substExprList(ExprList *pList, int iTable, ExprList *pEList){ ++ int i; ++ if( pList==0 ) return; ++ for(i=0; inExpr; i++){ ++ substExpr(pList->a[i].pExpr, iTable, pEList); ++ } ++} ++ ++/* ++** This routine attempts to flatten subqueries in order to speed ++** execution. It returns 1 if it makes changes and 0 if no flattening ++** occurs. ++** ++** To understand the concept of flattening, consider the following ++** query: ++** ++** SELECT a FROM (SELECT x+y AS a FROM t1 WHERE z<100) WHERE a>5 ++** ++** The default way of implementing this query is to execute the ++** subquery first and store the results in a temporary table, then ++** run the outer query on that temporary table. This requires two ++** passes over the data. Furthermore, because the temporary table ++** has no indices, the WHERE clause on the outer query cannot be ++** optimized. ++** ++** This routine attempts to rewrite queries such as the above into ++** a single flat select, like this: ++** ++** SELECT x+y AS a FROM t1 WHERE z<100 AND a>5 ++** ++** The code generated for this simpification gives the same result ++** but only has to scan the data once. And because indices might ++** exist on the table t1, a complete scan of the data might be ++** avoided. ++** ++** Flattening is only attempted if all of the following are true: ++** ++** (1) The subquery and the outer query do not both use aggregates. ++** ++** (2) The subquery is not an aggregate or the outer query is not a join. ++** ++** (3) The subquery is not the right operand of a left outer join, or ++** the subquery is not itself a join. (Ticket #306) ++** ++** (4) The subquery is not DISTINCT or the outer query is not a join. ++** ++** (5) The subquery is not DISTINCT or the outer query does not use ++** aggregates. ++** ++** (6) The subquery does not use aggregates or the outer query is not ++** DISTINCT. ++** ++** (7) The subquery has a FROM clause. ++** ++** (8) The subquery does not use LIMIT or the outer query is not a join. ++** ++** (9) The subquery does not use LIMIT or the outer query does not use ++** aggregates. ++** ++** (10) The subquery does not use aggregates or the outer query does not ++** use LIMIT. ++** ++** (11) The subquery and the outer query do not both have ORDER BY clauses. ++** ++** (12) The subquery is not the right term of a LEFT OUTER JOIN or the ++** subquery has no WHERE clause. (added by ticket #350) ++** ++** In this routine, the "p" parameter is a pointer to the outer query. ++** The subquery is p->pSrc->a[iFrom]. isAgg is true if the outer query ++** uses aggregates and subqueryIsAgg is true if the subquery uses aggregates. ++** ++** If flattening is not attempted, this routine is a no-op and returns 0. ++** If flattening is attempted this routine returns 1. ++** ++** All of the expression analysis must occur on both the outer query and ++** the subquery before this routine runs. ++*/ ++static int flattenSubquery( ++ Parse *pParse, /* The parsing context */ ++ Select *p, /* The parent or outer SELECT statement */ ++ int iFrom, /* Index in p->pSrc->a[] of the inner subquery */ ++ int isAgg, /* True if outer SELECT uses aggregate functions */ ++ int subqueryIsAgg /* True if the subquery uses aggregate functions */ ++){ ++ Select *pSub; /* The inner query or "subquery" */ ++ SrcList *pSrc; /* The FROM clause of the outer query */ ++ SrcList *pSubSrc; /* The FROM clause of the subquery */ ++ ExprList *pList; /* The result set of the outer query */ ++ int iParent; /* VDBE cursor number of the pSub result set temp table */ ++ int i; ++ Expr *pWhere; ++ ++ /* Check to see if flattening is permitted. Return 0 if not. ++ */ ++ if( p==0 ) return 0; ++ pSrc = p->pSrc; ++ assert( pSrc && iFrom>=0 && iFromnSrc ); ++ pSub = pSrc->a[iFrom].pSelect; ++ assert( pSub!=0 ); ++ if( isAgg && subqueryIsAgg ) return 0; ++ if( subqueryIsAgg && pSrc->nSrc>1 ) return 0; ++ pSubSrc = pSub->pSrc; ++ assert( pSubSrc ); ++ if( pSubSrc->nSrc==0 ) return 0; ++ if( (pSub->isDistinct || pSub->nLimit>=0) && (pSrc->nSrc>1 || isAgg) ){ ++ return 0; ++ } ++ if( (p->isDistinct || p->nLimit>=0) && subqueryIsAgg ) return 0; ++ if( p->pOrderBy && pSub->pOrderBy ) return 0; ++ ++ /* Restriction 3: If the subquery is a join, make sure the subquery is ++ ** not used as the right operand of an outer join. Examples of why this ++ ** is not allowed: ++ ** ++ ** t1 LEFT OUTER JOIN (t2 JOIN t3) ++ ** ++ ** If we flatten the above, we would get ++ ** ++ ** (t1 LEFT OUTER JOIN t2) JOIN t3 ++ ** ++ ** which is not at all the same thing. ++ */ ++ if( pSubSrc->nSrc>1 && iFrom>0 && (pSrc->a[iFrom-1].jointype & JT_OUTER)!=0 ){ ++ return 0; ++ } ++ ++ /* Restriction 12: If the subquery is the right operand of a left outer ++ ** join, make sure the subquery has no WHERE clause. ++ ** An examples of why this is not allowed: ++ ** ++ ** t1 LEFT OUTER JOIN (SELECT * FROM t2 WHERE t2.x>0) ++ ** ++ ** If we flatten the above, we would get ++ ** ++ ** (t1 LEFT OUTER JOIN t2) WHERE t2.x>0 ++ ** ++ ** But the t2.x>0 test will always fail on a NULL row of t2, which ++ ** effectively converts the OUTER JOIN into an INNER JOIN. ++ */ ++ if( iFrom>0 && (pSrc->a[iFrom-1].jointype & JT_OUTER)!=0 ++ && pSub->pWhere!=0 ){ ++ return 0; ++ } ++ ++ /* If we reach this point, it means flattening is permitted for the ++ ** iFrom-th entry of the FROM clause in the outer query. ++ */ ++ ++ /* Move all of the FROM elements of the subquery into the ++ ** the FROM clause of the outer query. Before doing this, remember ++ ** the cursor number for the original outer query FROM element in ++ ** iParent. The iParent cursor will never be used. Subsequent code ++ ** will scan expressions looking for iParent references and replace ++ ** those references with expressions that resolve to the subquery FROM ++ ** elements we are now copying in. ++ */ ++ iParent = pSrc->a[iFrom].iCursor; ++ { ++ int nSubSrc = pSubSrc->nSrc; ++ int jointype = pSrc->a[iFrom].jointype; ++ ++ if( pSrc->a[iFrom].pTab && pSrc->a[iFrom].pTab->isTransient ){ ++ sqliteDeleteTable(0, pSrc->a[iFrom].pTab); ++ } ++ sqliteFree(pSrc->a[iFrom].zDatabase); ++ sqliteFree(pSrc->a[iFrom].zName); ++ sqliteFree(pSrc->a[iFrom].zAlias); ++ if( nSubSrc>1 ){ ++ int extra = nSubSrc - 1; ++ for(i=1; ipSrc = pSrc; ++ for(i=pSrc->nSrc-1; i-extra>=iFrom; i--){ ++ pSrc->a[i] = pSrc->a[i-extra]; ++ } ++ } ++ for(i=0; ia[i+iFrom] = pSubSrc->a[i]; ++ memset(&pSubSrc->a[i], 0, sizeof(pSubSrc->a[i])); ++ } ++ pSrc->a[iFrom+nSubSrc-1].jointype = jointype; ++ } ++ ++ /* Now begin substituting subquery result set expressions for ++ ** references to the iParent in the outer query. ++ ** ++ ** Example: ++ ** ++ ** SELECT a+5, b*10 FROM (SELECT x*3 AS a, y+10 AS b FROM t1) WHERE a>b; ++ ** \ \_____________ subquery __________/ / ++ ** \_____________________ outer query ______________________________/ ++ ** ++ ** We look at every expression in the outer query and every place we see ++ ** "a" we substitute "x*3" and every place we see "b" we substitute "y+10". ++ */ ++ substExprList(p->pEList, iParent, pSub->pEList); ++ pList = p->pEList; ++ for(i=0; inExpr; i++){ ++ Expr *pExpr; ++ if( pList->a[i].zName==0 && (pExpr = pList->a[i].pExpr)->span.z!=0 ){ ++ pList->a[i].zName = sqliteStrNDup(pExpr->span.z, pExpr->span.n); ++ } ++ } ++ if( isAgg ){ ++ substExprList(p->pGroupBy, iParent, pSub->pEList); ++ substExpr(p->pHaving, iParent, pSub->pEList); ++ } ++ if( pSub->pOrderBy ){ ++ assert( p->pOrderBy==0 ); ++ p->pOrderBy = pSub->pOrderBy; ++ pSub->pOrderBy = 0; ++ }else if( p->pOrderBy ){ ++ substExprList(p->pOrderBy, iParent, pSub->pEList); ++ } ++ if( pSub->pWhere ){ ++ pWhere = sqliteExprDup(pSub->pWhere); ++ }else{ ++ pWhere = 0; ++ } ++ if( subqueryIsAgg ){ ++ assert( p->pHaving==0 ); ++ p->pHaving = p->pWhere; ++ p->pWhere = pWhere; ++ substExpr(p->pHaving, iParent, pSub->pEList); ++ if( pSub->pHaving ){ ++ Expr *pHaving = sqliteExprDup(pSub->pHaving); ++ if( p->pHaving ){ ++ p->pHaving = sqliteExpr(TK_AND, p->pHaving, pHaving, 0); ++ }else{ ++ p->pHaving = pHaving; ++ } ++ } ++ assert( p->pGroupBy==0 ); ++ p->pGroupBy = sqliteExprListDup(pSub->pGroupBy); ++ }else if( p->pWhere==0 ){ ++ p->pWhere = pWhere; ++ }else{ ++ substExpr(p->pWhere, iParent, pSub->pEList); ++ if( pWhere ){ ++ p->pWhere = sqliteExpr(TK_AND, p->pWhere, pWhere, 0); ++ } ++ } ++ ++ /* The flattened query is distinct if either the inner or the ++ ** outer query is distinct. ++ */ ++ p->isDistinct = p->isDistinct || pSub->isDistinct; ++ ++ /* Transfer the limit expression from the subquery to the outer ++ ** query. ++ */ ++ if( pSub->nLimit>=0 ){ ++ if( p->nLimit<0 ){ ++ p->nLimit = pSub->nLimit; ++ }else if( p->nLimit+p->nOffset > pSub->nLimit+pSub->nOffset ){ ++ p->nLimit = pSub->nLimit + pSub->nOffset - p->nOffset; ++ } ++ } ++ p->nOffset += pSub->nOffset; ++ ++ /* Finially, delete what is left of the subquery and return ++ ** success. ++ */ ++ sqliteSelectDelete(pSub); ++ return 1; ++} ++ ++/* ++** Analyze the SELECT statement passed in as an argument to see if it ++** is a simple min() or max() query. If it is and this query can be ++** satisfied using a single seek to the beginning or end of an index, ++** then generate the code for this SELECT and return 1. If this is not a ++** simple min() or max() query, then return 0; ++** ++** A simply min() or max() query looks like this: ++** ++** SELECT min(a) FROM table; ++** SELECT max(a) FROM table; ++** ++** The query may have only a single table in its FROM argument. There ++** can be no GROUP BY or HAVING or WHERE clauses. The result set must ++** be the min() or max() of a single column of the table. The column ++** in the min() or max() function must be indexed. ++** ++** The parameters to this routine are the same as for sqliteSelect(). ++** See the header comment on that routine for additional information. ++*/ ++static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){ ++ Expr *pExpr; ++ int iCol; ++ Table *pTab; ++ Index *pIdx; ++ int base; ++ Vdbe *v; ++ int seekOp; ++ int cont; ++ ExprList *pEList, *pList, eList; ++ struct ExprList_item eListItem; ++ SrcList *pSrc; ++ ++ ++ /* Check to see if this query is a simple min() or max() query. Return ++ ** zero if it is not. ++ */ ++ if( p->pGroupBy || p->pHaving || p->pWhere ) return 0; ++ pSrc = p->pSrc; ++ if( pSrc->nSrc!=1 ) return 0; ++ pEList = p->pEList; ++ if( pEList->nExpr!=1 ) return 0; ++ pExpr = pEList->a[0].pExpr; ++ if( pExpr->op!=TK_AGG_FUNCTION ) return 0; ++ pList = pExpr->pList; ++ if( pList==0 || pList->nExpr!=1 ) return 0; ++ if( pExpr->token.n!=3 ) return 0; ++ if( sqliteStrNICmp(pExpr->token.z,"min",3)==0 ){ ++ seekOp = OP_Rewind; ++ }else if( sqliteStrNICmp(pExpr->token.z,"max",3)==0 ){ ++ seekOp = OP_Last; ++ }else{ ++ return 0; ++ } ++ pExpr = pList->a[0].pExpr; ++ if( pExpr->op!=TK_COLUMN ) return 0; ++ iCol = pExpr->iColumn; ++ pTab = pSrc->a[0].pTab; ++ ++ /* If we get to here, it means the query is of the correct form. ++ ** Check to make sure we have an index and make pIdx point to the ++ ** appropriate index. If the min() or max() is on an INTEGER PRIMARY ++ ** key column, no index is necessary so set pIdx to NULL. If no ++ ** usable index is found, return 0. ++ */ ++ if( iCol<0 ){ ++ pIdx = 0; ++ }else{ ++ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ ++ assert( pIdx->nColumn>=1 ); ++ if( pIdx->aiColumn[0]==iCol ) break; ++ } ++ if( pIdx==0 ) return 0; ++ } ++ ++ /* Identify column types if we will be using the callback. This ++ ** step is skipped if the output is going to a table or a memory cell. ++ ** The column names have already been generated in the calling function. ++ */ ++ v = sqliteGetVdbe(pParse); ++ if( v==0 ) return 0; ++ if( eDest==SRT_Callback ){ ++ generateColumnTypes(pParse, p->pSrc, p->pEList); ++ } ++ ++ /* If the output is destined for a temporary table, open that table. ++ */ ++ if( eDest==SRT_TempTable ){ ++ sqliteVdbeAddOp(v, OP_OpenTemp, iParm, 0); ++ } ++ ++ /* Generating code to find the min or the max. Basically all we have ++ ** to do is find the first or the last entry in the chosen index. If ++ ** the min() or max() is on the INTEGER PRIMARY KEY, then find the first ++ ** or last entry in the main table. ++ */ ++ sqliteCodeVerifySchema(pParse, pTab->iDb); ++ base = pSrc->a[0].iCursor; ++ computeLimitRegisters(pParse, p); ++ if( pSrc->a[0].pSelect==0 ){ ++ sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0); ++ sqliteVdbeOp3(v, OP_OpenRead, base, pTab->tnum, pTab->zName, 0); ++ } ++ cont = sqliteVdbeMakeLabel(v); ++ if( pIdx==0 ){ ++ sqliteVdbeAddOp(v, seekOp, base, 0); ++ }else{ ++ sqliteVdbeAddOp(v, OP_Integer, pIdx->iDb, 0); ++ sqliteVdbeOp3(v, OP_OpenRead, base+1, pIdx->tnum, pIdx->zName, P3_STATIC); ++ if( seekOp==OP_Rewind ){ ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ sqliteVdbeAddOp(v, OP_MakeKey, 1, 0); ++ sqliteVdbeAddOp(v, OP_IncrKey, 0, 0); ++ seekOp = OP_MoveTo; ++ } ++ sqliteVdbeAddOp(v, seekOp, base+1, 0); ++ sqliteVdbeAddOp(v, OP_IdxRecno, base+1, 0); ++ sqliteVdbeAddOp(v, OP_Close, base+1, 0); ++ sqliteVdbeAddOp(v, OP_MoveTo, base, 0); ++ } ++ eList.nExpr = 1; ++ memset(&eListItem, 0, sizeof(eListItem)); ++ eList.a = &eListItem; ++ eList.a[0].pExpr = pExpr; ++ selectInnerLoop(pParse, p, &eList, 0, 0, 0, -1, eDest, iParm, cont, cont); ++ sqliteVdbeResolveLabel(v, cont); ++ sqliteVdbeAddOp(v, OP_Close, base, 0); ++ ++ return 1; ++} ++ ++/* ++** Generate code for the given SELECT statement. ++** ++** The results are distributed in various ways depending on the ++** value of eDest and iParm. ++** ++** eDest Value Result ++** ------------ ------------------------------------------- ++** SRT_Callback Invoke the callback for each row of the result. ++** ++** SRT_Mem Store first result in memory cell iParm ++** ++** SRT_Set Store results as keys of a table with cursor iParm ++** ++** SRT_Union Store results as a key in a temporary table iParm ++** ++** SRT_Except Remove results from the temporary table iParm. ++** ++** SRT_Table Store results in temporary table iParm ++** ++** The table above is incomplete. Additional eDist value have be added ++** since this comment was written. See the selectInnerLoop() function for ++** a complete listing of the allowed values of eDest and their meanings. ++** ++** This routine returns the number of errors. If any errors are ++** encountered, then an appropriate error message is left in ++** pParse->zErrMsg. ++** ++** This routine does NOT free the Select structure passed in. The ++** calling function needs to do that. ++** ++** The pParent, parentTab, and *pParentAgg fields are filled in if this ++** SELECT is a subquery. This routine may try to combine this SELECT ++** with its parent to form a single flat query. In so doing, it might ++** change the parent query from a non-aggregate to an aggregate query. ++** For that reason, the pParentAgg flag is passed as a pointer, so it ++** can be changed. ++** ++** Example 1: The meaning of the pParent parameter. ++** ++** SELECT * FROM t1 JOIN (SELECT x, count(*) FROM t2) JOIN t3; ++** \ \_______ subquery _______/ / ++** \ / ++** \____________________ outer query ___________________/ ++** ++** This routine is called for the outer query first. For that call, ++** pParent will be NULL. During the processing of the outer query, this ++** routine is called recursively to handle the subquery. For the recursive ++** call, pParent will point to the outer query. Because the subquery is ++** the second element in a three-way join, the parentTab parameter will ++** be 1 (the 2nd value of a 0-indexed array.) ++*/ ++int sqliteSelect( ++ Parse *pParse, /* The parser context */ ++ Select *p, /* The SELECT statement being coded. */ ++ int eDest, /* How to dispose of the results */ ++ int iParm, /* A parameter used by the eDest disposal method */ ++ Select *pParent, /* Another SELECT for which this is a sub-query */ ++ int parentTab, /* Index in pParent->pSrc of this query */ ++ int *pParentAgg /* True if pParent uses aggregate functions */ ++){ ++ int i; ++ WhereInfo *pWInfo; ++ Vdbe *v; ++ int isAgg = 0; /* True for select lists like "count(*)" */ ++ ExprList *pEList; /* List of columns to extract. */ ++ SrcList *pTabList; /* List of tables to select from */ ++ Expr *pWhere; /* The WHERE clause. May be NULL */ ++ ExprList *pOrderBy; /* The ORDER BY clause. May be NULL */ ++ ExprList *pGroupBy; /* The GROUP BY clause. May be NULL */ ++ Expr *pHaving; /* The HAVING clause. May be NULL */ ++ int isDistinct; /* True if the DISTINCT keyword is present */ ++ int distinct; /* Table to use for the distinct set */ ++ int rc = 1; /* Value to return from this function */ ++ ++ if( sqlite_malloc_failed || pParse->nErr || p==0 ) return 1; ++ if( sqliteAuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1; ++ ++ /* If there is are a sequence of queries, do the earlier ones first. ++ */ ++ if( p->pPrior ){ ++ return multiSelect(pParse, p, eDest, iParm); ++ } ++ ++ /* Make local copies of the parameters for this query. ++ */ ++ pTabList = p->pSrc; ++ pWhere = p->pWhere; ++ pOrderBy = p->pOrderBy; ++ pGroupBy = p->pGroupBy; ++ pHaving = p->pHaving; ++ isDistinct = p->isDistinct; ++ ++ /* Allocate VDBE cursors for each table in the FROM clause ++ */ ++ sqliteSrcListAssignCursors(pParse, pTabList); ++ ++ /* ++ ** Do not even attempt to generate any code if we have already seen ++ ** errors before this routine starts. ++ */ ++ if( pParse->nErr>0 ) goto select_end; ++ ++ /* Expand any "*" terms in the result set. (For example the "*" in ++ ** "SELECT * FROM t1") The fillInColumnlist() routine also does some ++ ** other housekeeping - see the header comment for details. ++ */ ++ if( fillInColumnList(pParse, p) ){ ++ goto select_end; ++ } ++ pWhere = p->pWhere; ++ pEList = p->pEList; ++ if( pEList==0 ) goto select_end; ++ ++ /* If writing to memory or generating a set ++ ** only a single column may be output. ++ */ ++ if( (eDest==SRT_Mem || eDest==SRT_Set) && pEList->nExpr>1 ){ ++ sqliteErrorMsg(pParse, "only a single result allowed for " ++ "a SELECT that is part of an expression"); ++ goto select_end; ++ } ++ ++ /* ORDER BY is ignored for some destinations. ++ */ ++ switch( eDest ){ ++ case SRT_Union: ++ case SRT_Except: ++ case SRT_Discard: ++ pOrderBy = 0; ++ break; ++ default: ++ break; ++ } ++ ++ /* At this point, we should have allocated all the cursors that we ++ ** need to handle subquerys and temporary tables. ++ ** ++ ** Resolve the column names and do a semantics check on all the expressions. ++ */ ++ for(i=0; inExpr; i++){ ++ if( sqliteExprResolveIds(pParse, pTabList, 0, pEList->a[i].pExpr) ){ ++ goto select_end; ++ } ++ if( sqliteExprCheck(pParse, pEList->a[i].pExpr, 1, &isAgg) ){ ++ goto select_end; ++ } ++ } ++ if( pWhere ){ ++ if( sqliteExprResolveIds(pParse, pTabList, pEList, pWhere) ){ ++ goto select_end; ++ } ++ if( sqliteExprCheck(pParse, pWhere, 0, 0) ){ ++ goto select_end; ++ } ++ } ++ if( pHaving ){ ++ if( pGroupBy==0 ){ ++ sqliteErrorMsg(pParse, "a GROUP BY clause is required before HAVING"); ++ goto select_end; ++ } ++ if( sqliteExprResolveIds(pParse, pTabList, pEList, pHaving) ){ ++ goto select_end; ++ } ++ if( sqliteExprCheck(pParse, pHaving, 1, &isAgg) ){ ++ goto select_end; ++ } ++ } ++ if( pOrderBy ){ ++ for(i=0; inExpr; i++){ ++ int iCol; ++ Expr *pE = pOrderBy->a[i].pExpr; ++ if( sqliteExprIsInteger(pE, &iCol) && iCol>0 && iCol<=pEList->nExpr ){ ++ sqliteExprDelete(pE); ++ pE = pOrderBy->a[i].pExpr = sqliteExprDup(pEList->a[iCol-1].pExpr); ++ } ++ if( sqliteExprResolveIds(pParse, pTabList, pEList, pE) ){ ++ goto select_end; ++ } ++ if( sqliteExprCheck(pParse, pE, isAgg, 0) ){ ++ goto select_end; ++ } ++ if( sqliteExprIsConstant(pE) ){ ++ if( sqliteExprIsInteger(pE, &iCol)==0 ){ ++ sqliteErrorMsg(pParse, ++ "ORDER BY terms must not be non-integer constants"); ++ goto select_end; ++ }else if( iCol<=0 || iCol>pEList->nExpr ){ ++ sqliteErrorMsg(pParse, ++ "ORDER BY column number %d out of range - should be " ++ "between 1 and %d", iCol, pEList->nExpr); ++ goto select_end; ++ } ++ } ++ } ++ } ++ if( pGroupBy ){ ++ for(i=0; inExpr; i++){ ++ int iCol; ++ Expr *pE = pGroupBy->a[i].pExpr; ++ if( sqliteExprIsInteger(pE, &iCol) && iCol>0 && iCol<=pEList->nExpr ){ ++ sqliteExprDelete(pE); ++ pE = pGroupBy->a[i].pExpr = sqliteExprDup(pEList->a[iCol-1].pExpr); ++ } ++ if( sqliteExprResolveIds(pParse, pTabList, pEList, pE) ){ ++ goto select_end; ++ } ++ if( sqliteExprCheck(pParse, pE, isAgg, 0) ){ ++ goto select_end; ++ } ++ if( sqliteExprIsConstant(pE) ){ ++ if( sqliteExprIsInteger(pE, &iCol)==0 ){ ++ sqliteErrorMsg(pParse, ++ "GROUP BY terms must not be non-integer constants"); ++ goto select_end; ++ }else if( iCol<=0 || iCol>pEList->nExpr ){ ++ sqliteErrorMsg(pParse, ++ "GROUP BY column number %d out of range - should be " ++ "between 1 and %d", iCol, pEList->nExpr); ++ goto select_end; ++ } ++ } ++ } ++ } ++ ++ /* Begin generating code. ++ */ ++ v = sqliteGetVdbe(pParse); ++ if( v==0 ) goto select_end; ++ ++ /* Identify column names if we will be using them in a callback. This ++ ** step is skipped if the output is going to some other destination. ++ */ ++ if( eDest==SRT_Callback ){ ++ generateColumnNames(pParse, pTabList, pEList); ++ } ++ ++ /* Generate code for all sub-queries in the FROM clause ++ */ ++ for(i=0; inSrc; i++){ ++ const char *zSavedAuthContext; ++ int needRestoreContext; ++ ++ if( pTabList->a[i].pSelect==0 ) continue; ++ if( pTabList->a[i].zName!=0 ){ ++ zSavedAuthContext = pParse->zAuthContext; ++ pParse->zAuthContext = pTabList->a[i].zName; ++ needRestoreContext = 1; ++ }else{ ++ needRestoreContext = 0; ++ } ++ sqliteSelect(pParse, pTabList->a[i].pSelect, SRT_TempTable, ++ pTabList->a[i].iCursor, p, i, &isAgg); ++ if( needRestoreContext ){ ++ pParse->zAuthContext = zSavedAuthContext; ++ } ++ pTabList = p->pSrc; ++ pWhere = p->pWhere; ++ if( eDest!=SRT_Union && eDest!=SRT_Except && eDest!=SRT_Discard ){ ++ pOrderBy = p->pOrderBy; ++ } ++ pGroupBy = p->pGroupBy; ++ pHaving = p->pHaving; ++ isDistinct = p->isDistinct; ++ } ++ ++ /* Check for the special case of a min() or max() function by itself ++ ** in the result set. ++ */ ++ if( simpleMinMaxQuery(pParse, p, eDest, iParm) ){ ++ rc = 0; ++ goto select_end; ++ } ++ ++ /* Check to see if this is a subquery that can be "flattened" into its parent. ++ ** If flattening is a possiblity, do so and return immediately. ++ */ ++ if( pParent && pParentAgg && ++ flattenSubquery(pParse, pParent, parentTab, *pParentAgg, isAgg) ){ ++ if( isAgg ) *pParentAgg = 1; ++ return rc; ++ } ++ ++ /* Set the limiter. ++ */ ++ computeLimitRegisters(pParse, p); ++ ++ /* Identify column types if we will be using a callback. This ++ ** step is skipped if the output is going to a destination other ++ ** than a callback. ++ ** ++ ** We have to do this separately from the creation of column names ++ ** above because if the pTabList contains views then they will not ++ ** have been resolved and we will not know the column types until ++ ** now. ++ */ ++ if( eDest==SRT_Callback ){ ++ generateColumnTypes(pParse, pTabList, pEList); ++ } ++ ++ /* If the output is destined for a temporary table, open that table. ++ */ ++ if( eDest==SRT_TempTable ){ ++ sqliteVdbeAddOp(v, OP_OpenTemp, iParm, 0); ++ } ++ ++ /* Do an analysis of aggregate expressions. ++ */ ++ sqliteAggregateInfoReset(pParse); ++ if( isAgg || pGroupBy ){ ++ assert( pParse->nAgg==0 ); ++ isAgg = 1; ++ for(i=0; inExpr; i++){ ++ if( sqliteExprAnalyzeAggregates(pParse, pEList->a[i].pExpr) ){ ++ goto select_end; ++ } ++ } ++ if( pGroupBy ){ ++ for(i=0; inExpr; i++){ ++ if( sqliteExprAnalyzeAggregates(pParse, pGroupBy->a[i].pExpr) ){ ++ goto select_end; ++ } ++ } ++ } ++ if( pHaving && sqliteExprAnalyzeAggregates(pParse, pHaving) ){ ++ goto select_end; ++ } ++ if( pOrderBy ){ ++ for(i=0; inExpr; i++){ ++ if( sqliteExprAnalyzeAggregates(pParse, pOrderBy->a[i].pExpr) ){ ++ goto select_end; ++ } ++ } ++ } ++ } ++ ++ /* Reset the aggregator ++ */ ++ if( isAgg ){ ++ sqliteVdbeAddOp(v, OP_AggReset, 0, pParse->nAgg); ++ for(i=0; inAgg; i++){ ++ FuncDef *pFunc; ++ if( (pFunc = pParse->aAgg[i].pFunc)!=0 && pFunc->xFinalize!=0 ){ ++ sqliteVdbeOp3(v, OP_AggInit, 0, i, (char*)pFunc, P3_POINTER); ++ } ++ } ++ if( pGroupBy==0 ){ ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ sqliteVdbeAddOp(v, OP_AggFocus, 0, 0); ++ } ++ } ++ ++ /* Initialize the memory cell to NULL ++ */ ++ if( eDest==SRT_Mem ){ ++ sqliteVdbeAddOp(v, OP_String, 0, 0); ++ sqliteVdbeAddOp(v, OP_MemStore, iParm, 1); ++ } ++ ++ /* Open a temporary table to use for the distinct set. ++ */ ++ if( isDistinct ){ ++ distinct = pParse->nTab++; ++ sqliteVdbeAddOp(v, OP_OpenTemp, distinct, 1); ++ }else{ ++ distinct = -1; ++ } ++ ++ /* Begin the database scan ++ */ ++ pWInfo = sqliteWhereBegin(pParse, pTabList, pWhere, 0, ++ pGroupBy ? 0 : &pOrderBy); ++ if( pWInfo==0 ) goto select_end; ++ ++ /* Use the standard inner loop if we are not dealing with ++ ** aggregates ++ */ ++ if( !isAgg ){ ++ if( selectInnerLoop(pParse, p, pEList, 0, 0, pOrderBy, distinct, eDest, ++ iParm, pWInfo->iContinue, pWInfo->iBreak) ){ ++ goto select_end; ++ } ++ } ++ ++ /* If we are dealing with aggregates, then do the special aggregate ++ ** processing. ++ */ ++ else{ ++ AggExpr *pAgg; ++ if( pGroupBy ){ ++ int lbl1; ++ for(i=0; inExpr; i++){ ++ sqliteExprCode(pParse, pGroupBy->a[i].pExpr); ++ } ++ sqliteVdbeAddOp(v, OP_MakeKey, pGroupBy->nExpr, 0); ++ if( pParse->db->file_format>=4 ) sqliteAddKeyType(v, pGroupBy); ++ lbl1 = sqliteVdbeMakeLabel(v); ++ sqliteVdbeAddOp(v, OP_AggFocus, 0, lbl1); ++ for(i=0, pAgg=pParse->aAgg; inAgg; i++, pAgg++){ ++ if( pAgg->isAgg ) continue; ++ sqliteExprCode(pParse, pAgg->pExpr); ++ sqliteVdbeAddOp(v, OP_AggSet, 0, i); ++ } ++ sqliteVdbeResolveLabel(v, lbl1); ++ } ++ for(i=0, pAgg=pParse->aAgg; inAgg; i++, pAgg++){ ++ Expr *pE; ++ int nExpr; ++ FuncDef *pDef; ++ if( !pAgg->isAgg ) continue; ++ assert( pAgg->pFunc!=0 ); ++ assert( pAgg->pFunc->xStep!=0 ); ++ pDef = pAgg->pFunc; ++ pE = pAgg->pExpr; ++ assert( pE!=0 ); ++ assert( pE->op==TK_AGG_FUNCTION ); ++ nExpr = sqliteExprCodeExprList(pParse, pE->pList, pDef->includeTypes); ++ sqliteVdbeAddOp(v, OP_Integer, i, 0); ++ sqliteVdbeOp3(v, OP_AggFunc, 0, nExpr, (char*)pDef, P3_POINTER); ++ } ++ } ++ ++ /* End the database scan loop. ++ */ ++ sqliteWhereEnd(pWInfo); ++ ++ /* If we are processing aggregates, we need to set up a second loop ++ ** over all of the aggregate values and process them. ++ */ ++ if( isAgg ){ ++ int endagg = sqliteVdbeMakeLabel(v); ++ int startagg; ++ startagg = sqliteVdbeAddOp(v, OP_AggNext, 0, endagg); ++ pParse->useAgg = 1; ++ if( pHaving ){ ++ sqliteExprIfFalse(pParse, pHaving, startagg, 1); ++ } ++ if( selectInnerLoop(pParse, p, pEList, 0, 0, pOrderBy, distinct, eDest, ++ iParm, startagg, endagg) ){ ++ goto select_end; ++ } ++ sqliteVdbeAddOp(v, OP_Goto, 0, startagg); ++ sqliteVdbeResolveLabel(v, endagg); ++ sqliteVdbeAddOp(v, OP_Noop, 0, 0); ++ pParse->useAgg = 0; ++ } ++ ++ /* If there is an ORDER BY clause, then we need to sort the results ++ ** and send them to the callback one by one. ++ */ ++ if( pOrderBy ){ ++ generateSortTail(p, v, pEList->nExpr, eDest, iParm); ++ } ++ ++ /* If this was a subquery, we have now converted the subquery into a ++ ** temporary table. So delete the subquery structure from the parent ++ ** to prevent this subquery from being evaluated again and to force the ++ ** the use of the temporary table. ++ */ ++ if( pParent ){ ++ assert( pParent->pSrc->nSrc>parentTab ); ++ assert( pParent->pSrc->a[parentTab].pSelect==p ); ++ sqliteSelectDelete(p); ++ pParent->pSrc->a[parentTab].pSelect = 0; ++ } ++ ++ /* The SELECT was successfully coded. Set the return code to 0 ++ ** to indicate no errors. ++ */ ++ rc = 0; ++ ++ /* Control jumps to here if an error is encountered above, or upon ++ ** successful coding of the SELECT. ++ */ ++select_end: ++ sqliteAggregateInfoReset(pParse); ++ return rc; ++} +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/sqlite_config.w32.h +@@ -0,0 +1,8 @@ ++#include "config.w32.h" ++#if ZTS ++# define THREADSAFE 1 ++#endif ++#if !ZEND_DEBUG && !defined(NDEBUG) ++# define NDEBUG ++#endif ++#define SQLITE_PTR_SZ 4 +\ No newline at end of file +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/sqlite.h.in +@@ -0,0 +1,886 @@ ++/* ++** 2001 September 15 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** This header file defines the interface that the SQLite library ++** presents to client programs. ++** ++** @(#) $Id$ ++*/ ++#ifndef _SQLITE_H_ ++#define _SQLITE_H_ ++#include /* Needed for the definition of va_list */ ++ ++/* ++** Make sure we can call this stuff from C++. ++*/ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/* ++** The version of the SQLite library. ++*/ ++#ifdef SQLITE_VERSION ++# undef SQLITE_VERSION ++#else ++# define SQLITE_VERSION "--VERS--" ++#endif ++ ++/* ++** The version string is also compiled into the library so that a program ++** can check to make sure that the lib*.a file and the *.h file are from ++** the same version. ++*/ ++extern const char sqlite_version[]; ++ ++/* ++** The SQLITE_UTF8 macro is defined if the library expects to see ++** UTF-8 encoded data. The SQLITE_ISO8859 macro is defined if the ++** iso8859 encoded should be used. ++*/ ++#define SQLITE_--ENCODING-- 1 ++ ++/* ++** The following constant holds one of two strings, "UTF-8" or "iso8859", ++** depending on which character encoding the SQLite library expects to ++** see. The character encoding makes a difference for the LIKE and GLOB ++** operators and for the LENGTH() and SUBSTR() functions. ++*/ ++extern const char sqlite_encoding[]; ++ ++/* ++** Each open sqlite database is represented by an instance of the ++** following opaque structure. ++*/ ++typedef struct sqlite sqlite; ++ ++/* ++** A function to open a new sqlite database. ++** ++** If the database does not exist and mode indicates write ++** permission, then a new database is created. If the database ++** does not exist and mode does not indicate write permission, ++** then the open fails, an error message generated (if errmsg!=0) ++** and the function returns 0. ++** ++** If mode does not indicates user write permission, then the ++** database is opened read-only. ++** ++** The Truth: As currently implemented, all databases are opened ++** for writing all the time. Maybe someday we will provide the ++** ability to open a database readonly. The mode parameters is ++** provided in anticipation of that enhancement. ++*/ ++sqlite *sqlite_open(const char *filename, int mode, char **errmsg); ++ ++/* ++** A function to close the database. ++** ++** Call this function with a pointer to a structure that was previously ++** returned from sqlite_open() and the corresponding database will by closed. ++*/ ++void sqlite_close(sqlite *); ++ ++/* ++** The type for a callback function. ++*/ ++typedef int (*sqlite_callback)(void*,int,char**, char**); ++ ++/* ++** A function to executes one or more statements of SQL. ++** ++** If one or more of the SQL statements are queries, then ++** the callback function specified by the 3rd parameter is ++** invoked once for each row of the query result. This callback ++** should normally return 0. If the callback returns a non-zero ++** value then the query is aborted, all subsequent SQL statements ++** are skipped and the sqlite_exec() function returns the SQLITE_ABORT. ++** ++** The 4th parameter is an arbitrary pointer that is passed ++** to the callback function as its first parameter. ++** ++** The 2nd parameter to the callback function is the number of ++** columns in the query result. The 3rd parameter to the callback ++** is an array of strings holding the values for each column. ++** The 4th parameter to the callback is an array of strings holding ++** the names of each column. ++** ++** The callback function may be NULL, even for queries. A NULL ++** callback is not an error. It just means that no callback ++** will be invoked. ++** ++** If an error occurs while parsing or evaluating the SQL (but ++** not while executing the callback) then an appropriate error ++** message is written into memory obtained from malloc() and ++** *errmsg is made to point to that message. The calling function ++** is responsible for freeing the memory that holds the error ++** message. Use sqlite_freemem() for this. If errmsg==NULL, ++** then no error message is ever written. ++** ++** The return value is is SQLITE_OK if there are no errors and ++** some other return code if there is an error. The particular ++** return value depends on the type of error. ++** ++** If the query could not be executed because a database file is ++** locked or busy, then this function returns SQLITE_BUSY. (This ++** behavior can be modified somewhat using the sqlite_busy_handler() ++** and sqlite_busy_timeout() functions below.) ++*/ ++int sqlite_exec( ++ sqlite*, /* An open database */ ++ const char *sql, /* SQL to be executed */ ++ sqlite_callback, /* Callback function */ ++ void *, /* 1st argument to callback function */ ++ char **errmsg /* Error msg written here */ ++); ++ ++/* ++** Return values for sqlite_exec() and sqlite_step() ++*/ ++#define SQLITE_OK 0 /* Successful result */ ++#define SQLITE_ERROR 1 /* SQL error or missing database */ ++#define SQLITE_INTERNAL 2 /* An internal logic error in SQLite */ ++#define SQLITE_PERM 3 /* Access permission denied */ ++#define SQLITE_ABORT 4 /* Callback routine requested an abort */ ++#define SQLITE_BUSY 5 /* The database file is locked */ ++#define SQLITE_LOCKED 6 /* A table in the database is locked */ ++#define SQLITE_NOMEM 7 /* A malloc() failed */ ++#define SQLITE_READONLY 8 /* Attempt to write a readonly database */ ++#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite_interrupt() */ ++#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */ ++#define SQLITE_CORRUPT 11 /* The database disk image is malformed */ ++#define SQLITE_NOTFOUND 12 /* (Internal Only) Table or record not found */ ++#define SQLITE_FULL 13 /* Insertion failed because database is full */ ++#define SQLITE_CANTOPEN 14 /* Unable to open the database file */ ++#define SQLITE_PROTOCOL 15 /* Database lock protocol error */ ++#define SQLITE_EMPTY 16 /* (Internal Only) Database table is empty */ ++#define SQLITE_SCHEMA 17 /* The database schema changed */ ++#define SQLITE_TOOBIG 18 /* Too much data for one row of a table */ ++#define SQLITE_CONSTRAINT 19 /* Abort due to contraint violation */ ++#define SQLITE_MISMATCH 20 /* Data type mismatch */ ++#define SQLITE_MISUSE 21 /* Library used incorrectly */ ++#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */ ++#define SQLITE_AUTH 23 /* Authorization denied */ ++#define SQLITE_FORMAT 24 /* Auxiliary database format error */ ++#define SQLITE_RANGE 25 /* 2nd parameter to sqlite_bind out of range */ ++#define SQLITE_NOTADB 26 /* File opened that is not a database file */ ++#define SQLITE_ROW 100 /* sqlite_step() has another row ready */ ++#define SQLITE_DONE 101 /* sqlite_step() has finished executing */ ++ ++/* ++** Each entry in an SQLite table has a unique integer key. (The key is ++** the value of the INTEGER PRIMARY KEY column if there is such a column, ++** otherwise the key is generated at random. The unique key is always ++** available as the ROWID, OID, or _ROWID_ column.) The following routine ++** returns the integer key of the most recent insert in the database. ++** ++** This function is similar to the mysql_insert_id() function from MySQL. ++*/ ++int sqlite_last_insert_rowid(sqlite*); ++ ++/* ++** This function returns the number of database rows that were changed ++** (or inserted or deleted) by the most recent called sqlite_exec(). ++** ++** All changes are counted, even if they were later undone by a ++** ROLLBACK or ABORT. Except, changes associated with creating and ++** dropping tables are not counted. ++** ++** If a callback invokes sqlite_exec() recursively, then the changes ++** in the inner, recursive call are counted together with the changes ++** in the outer call. ++** ++** SQLite implements the command "DELETE FROM table" without a WHERE clause ++** by dropping and recreating the table. (This is much faster than going ++** through and deleting individual elements form the table.) Because of ++** this optimization, the change count for "DELETE FROM table" will be ++** zero regardless of the number of elements that were originally in the ++** table. To get an accurate count of the number of rows deleted, use ++** "DELETE FROM table WHERE 1" instead. ++*/ ++int sqlite_changes(sqlite*); ++ ++/* ++** This function returns the number of database rows that were changed ++** by the last INSERT, UPDATE, or DELETE statment executed by sqlite_exec(), ++** or by the last VM to run to completion. The change count is not updated ++** by SQL statements other than INSERT, UPDATE or DELETE. ++** ++** Changes are counted, even if they are later undone by a ROLLBACK or ++** ABORT. Changes associated with trigger programs that execute as a ++** result of the INSERT, UPDATE, or DELETE statement are not counted. ++** ++** If a callback invokes sqlite_exec() recursively, then the changes ++** in the inner, recursive call are counted together with the changes ++** in the outer call. ++** ++** SQLite implements the command "DELETE FROM table" without a WHERE clause ++** by dropping and recreating the table. (This is much faster than going ++** through and deleting individual elements form the table.) Because of ++** this optimization, the change count for "DELETE FROM table" will be ++** zero regardless of the number of elements that were originally in the ++** table. To get an accurate count of the number of rows deleted, use ++** "DELETE FROM table WHERE 1" instead. ++** ++******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** ++*/ ++int sqlite_last_statement_changes(sqlite*); ++ ++/* If the parameter to this routine is one of the return value constants ++** defined above, then this routine returns a constant text string which ++** descripts (in English) the meaning of the return value. ++*/ ++const char *sqlite_error_string(int); ++#define sqliteErrStr sqlite_error_string /* Legacy. Do not use in new code. */ ++ ++/* This function causes any pending database operation to abort and ++** return at its earliest opportunity. This routine is typically ++** called in response to a user action such as pressing "Cancel" ++** or Ctrl-C where the user wants a long query operation to halt ++** immediately. ++*/ ++void sqlite_interrupt(sqlite*); ++ ++ ++/* This function returns true if the given input string comprises ++** one or more complete SQL statements. ++** ++** The algorithm is simple. If the last token other than spaces ++** and comments is a semicolon, then return true. otherwise return ++** false. ++*/ ++int sqlite_complete(const char *sql); ++ ++/* ++** This routine identifies a callback function that is invoked ++** whenever an attempt is made to open a database table that is ++** currently locked by another process or thread. If the busy callback ++** is NULL, then sqlite_exec() returns SQLITE_BUSY immediately if ++** it finds a locked table. If the busy callback is not NULL, then ++** sqlite_exec() invokes the callback with three arguments. The ++** second argument is the name of the locked table and the third ++** argument is the number of times the table has been busy. If the ++** busy callback returns 0, then sqlite_exec() immediately returns ++** SQLITE_BUSY. If the callback returns non-zero, then sqlite_exec() ++** tries to open the table again and the cycle repeats. ++** ++** The default busy callback is NULL. ++** ++** Sqlite is re-entrant, so the busy handler may start a new query. ++** (It is not clear why anyone would every want to do this, but it ++** is allowed, in theory.) But the busy handler may not close the ++** database. Closing the database from a busy handler will delete ++** data structures out from under the executing query and will ++** probably result in a coredump. ++*/ ++void sqlite_busy_handler(sqlite*, int(*)(void*,const char*,int), void*); ++ ++/* ++** This routine sets a busy handler that sleeps for a while when a ++** table is locked. The handler will sleep multiple times until ++** at least "ms" milleseconds of sleeping have been done. After ++** "ms" milleseconds of sleeping, the handler returns 0 which ++** causes sqlite_exec() to return SQLITE_BUSY. ++** ++** Calling this routine with an argument less than or equal to zero ++** turns off all busy handlers. ++*/ ++void sqlite_busy_timeout(sqlite*, int ms); ++ ++/* ++** This next routine is really just a wrapper around sqlite_exec(). ++** Instead of invoking a user-supplied callback for each row of the ++** result, this routine remembers each row of the result in memory ++** obtained from malloc(), then returns all of the result after the ++** query has finished. ++** ++** As an example, suppose the query result where this table: ++** ++** Name | Age ++** ----------------------- ++** Alice | 43 ++** Bob | 28 ++** Cindy | 21 ++** ++** If the 3rd argument were &azResult then after the function returns ++** azResult will contain the following data: ++** ++** azResult[0] = "Name"; ++** azResult[1] = "Age"; ++** azResult[2] = "Alice"; ++** azResult[3] = "43"; ++** azResult[4] = "Bob"; ++** azResult[5] = "28"; ++** azResult[6] = "Cindy"; ++** azResult[7] = "21"; ++** ++** Notice that there is an extra row of data containing the column ++** headers. But the *nrow return value is still 3. *ncolumn is ++** set to 2. In general, the number of values inserted into azResult ++** will be ((*nrow) + 1)*(*ncolumn). ++** ++** After the calling function has finished using the result, it should ++** pass the result data pointer to sqlite_free_table() in order to ++** release the memory that was malloc-ed. Because of the way the ++** malloc() happens, the calling function must not try to call ++** malloc() directly. Only sqlite_free_table() is able to release ++** the memory properly and safely. ++** ++** The return value of this routine is the same as from sqlite_exec(). ++*/ ++int sqlite_get_table( ++ sqlite*, /* An open database */ ++ const char *sql, /* SQL to be executed */ ++ char ***resultp, /* Result written to a char *[] that this points to */ ++ int *nrow, /* Number of result rows written here */ ++ int *ncolumn, /* Number of result columns written here */ ++ char **errmsg /* Error msg written here */ ++); ++ ++/* ++** Call this routine to free the memory that sqlite_get_table() allocated. ++*/ ++void sqlite_free_table(char **result); ++ ++/* ++** The following routines are wrappers around sqlite_exec() and ++** sqlite_get_table(). The only difference between the routines that ++** follow and the originals is that the second argument to the ++** routines that follow is really a printf()-style format ++** string describing the SQL to be executed. Arguments to the format ++** string appear at the end of the argument list. ++** ++** All of the usual printf formatting options apply. In addition, there ++** is a "%q" option. %q works like %s in that it substitutes a null-terminated ++** string from the argument list. But %q also doubles every '\'' character. ++** %q is designed for use inside a string literal. By doubling each '\'' ++** character it escapes that character and allows it to be inserted into ++** the string. ++** ++** For example, so some string variable contains text as follows: ++** ++** char *zText = "It's a happy day!"; ++** ++** We can use this text in an SQL statement as follows: ++** ++** sqlite_exec_printf(db, "INSERT INTO table VALUES('%q')", ++** callback1, 0, 0, zText); ++** ++** Because the %q format string is used, the '\'' character in zText ++** is escaped and the SQL generated is as follows: ++** ++** INSERT INTO table1 VALUES('It''s a happy day!') ++** ++** This is correct. Had we used %s instead of %q, the generated SQL ++** would have looked like this: ++** ++** INSERT INTO table1 VALUES('It's a happy day!'); ++** ++** This second example is an SQL syntax error. As a general rule you ++** should always use %q instead of %s when inserting text into a string ++** literal. ++*/ ++int sqlite_exec_printf( ++ sqlite*, /* An open database */ ++ const char *sqlFormat, /* printf-style format string for the SQL */ ++ sqlite_callback, /* Callback function */ ++ void *, /* 1st argument to callback function */ ++ char **errmsg, /* Error msg written here */ ++ ... /* Arguments to the format string. */ ++); ++int sqlite_exec_vprintf( ++ sqlite*, /* An open database */ ++ const char *sqlFormat, /* printf-style format string for the SQL */ ++ sqlite_callback, /* Callback function */ ++ void *, /* 1st argument to callback function */ ++ char **errmsg, /* Error msg written here */ ++ va_list ap /* Arguments to the format string. */ ++); ++int sqlite_get_table_printf( ++ sqlite*, /* An open database */ ++ const char *sqlFormat, /* printf-style format string for the SQL */ ++ char ***resultp, /* Result written to a char *[] that this points to */ ++ int *nrow, /* Number of result rows written here */ ++ int *ncolumn, /* Number of result columns written here */ ++ char **errmsg, /* Error msg written here */ ++ ... /* Arguments to the format string */ ++); ++int sqlite_get_table_vprintf( ++ sqlite*, /* An open database */ ++ const char *sqlFormat, /* printf-style format string for the SQL */ ++ char ***resultp, /* Result written to a char *[] that this points to */ ++ int *nrow, /* Number of result rows written here */ ++ int *ncolumn, /* Number of result columns written here */ ++ char **errmsg, /* Error msg written here */ ++ va_list ap /* Arguments to the format string */ ++); ++char *sqlite_mprintf(const char*,...); ++char *sqlite_vmprintf(const char*, va_list); ++ ++/* ++** Windows systems should call this routine to free memory that ++** is returned in the in the errmsg parameter of sqlite_open() when ++** SQLite is a DLL. For some reason, it does not work to call free() ++** directly. ++*/ ++void sqlite_freemem(void *p); ++ ++/* ++** Windows systems need functions to call to return the sqlite_version ++** and sqlite_encoding strings. ++*/ ++const char *sqlite_libversion(void); ++const char *sqlite_libencoding(void); ++ ++/* ++** A pointer to the following structure is used to communicate with ++** the implementations of user-defined functions. ++*/ ++typedef struct sqlite_func sqlite_func; ++ ++/* ++** Use the following routines to create new user-defined functions. See ++** the documentation for details. ++*/ ++int sqlite_create_function( ++ sqlite*, /* Database where the new function is registered */ ++ const char *zName, /* Name of the new function */ ++ int nArg, /* Number of arguments. -1 means any number */ ++ void (*xFunc)(sqlite_func*,int,const char**), /* C code to implement */ ++ void *pUserData /* Available via the sqlite_user_data() call */ ++); ++int sqlite_create_aggregate( ++ sqlite*, /* Database where the new function is registered */ ++ const char *zName, /* Name of the function */ ++ int nArg, /* Number of arguments */ ++ void (*xStep)(sqlite_func*,int,const char**), /* Called for each row */ ++ void (*xFinalize)(sqlite_func*), /* Called once to get final result */ ++ void *pUserData /* Available via the sqlite_user_data() call */ ++); ++ ++/* ++** Use the following routine to define the datatype returned by a ++** user-defined function. The second argument can be one of the ++** constants SQLITE_NUMERIC, SQLITE_TEXT, or SQLITE_ARGS or it ++** can be an integer greater than or equal to zero. When the datatype ++** parameter is non-negative, the type of the result will be the ++** same as the datatype-th argument. If datatype==SQLITE_NUMERIC ++** then the result is always numeric. If datatype==SQLITE_TEXT then ++** the result is always text. If datatype==SQLITE_ARGS then the result ++** is numeric if any argument is numeric and is text otherwise. ++*/ ++int sqlite_function_type( ++ sqlite *db, /* The database there the function is registered */ ++ const char *zName, /* Name of the function */ ++ int datatype /* The datatype for this function */ ++); ++#define SQLITE_NUMERIC (-1) ++/* #define SQLITE_TEXT (-2) // See below */ ++#define SQLITE_ARGS (-3) ++ ++/* ++** SQLite version 3 defines SQLITE_TEXT differently. To allow both ++** version 2 and version 3 to be included, undefine them both if a ++** conflict is seen. Define SQLITE2_TEXT to be the version 2 value. ++*/ ++#ifdef SQLITE_TEXT ++# undef SQLITE_TEXT ++#else ++# define SQLITE_TEXT (-2) ++#endif ++#define SQLITE2_TEXT (-2) ++ ++ ++ ++/* ++** The user function implementations call one of the following four routines ++** in order to return their results. The first parameter to each of these ++** routines is a copy of the first argument to xFunc() or xFinialize(). ++** The second parameter to these routines is the result to be returned. ++** A NULL can be passed as the second parameter to sqlite_set_result_string() ++** in order to return a NULL result. ++** ++** The 3rd argument to _string and _error is the number of characters to ++** take from the string. If this argument is negative, then all characters ++** up to and including the first '\000' are used. ++** ++** The sqlite_set_result_string() function allocates a buffer to hold the ++** result and returns a pointer to this buffer. The calling routine ++** (that is, the implmentation of a user function) can alter the content ++** of this buffer if desired. ++*/ ++char *sqlite_set_result_string(sqlite_func*,const char*,int); ++void sqlite_set_result_int(sqlite_func*,int); ++void sqlite_set_result_double(sqlite_func*,double); ++void sqlite_set_result_error(sqlite_func*,const char*,int); ++ ++/* ++** The pUserData parameter to the sqlite_create_function() and ++** sqlite_create_aggregate() routines used to register user functions ++** is available to the implementation of the function using this ++** call. ++*/ ++void *sqlite_user_data(sqlite_func*); ++ ++/* ++** Aggregate functions use the following routine to allocate ++** a structure for storing their state. The first time this routine ++** is called for a particular aggregate, a new structure of size nBytes ++** is allocated, zeroed, and returned. On subsequent calls (for the ++** same aggregate instance) the same buffer is returned. The implementation ++** of the aggregate can use the returned buffer to accumulate data. ++** ++** The buffer allocated is freed automatically be SQLite. ++*/ ++void *sqlite_aggregate_context(sqlite_func*, int nBytes); ++ ++/* ++** The next routine returns the number of calls to xStep for a particular ++** aggregate function instance. The current call to xStep counts so this ++** routine always returns at least 1. ++*/ ++int sqlite_aggregate_count(sqlite_func*); ++ ++/* ++** This routine registers a callback with the SQLite library. The ++** callback is invoked (at compile-time, not at run-time) for each ++** attempt to access a column of a table in the database. The callback ++** returns SQLITE_OK if access is allowed, SQLITE_DENY if the entire ++** SQL statement should be aborted with an error and SQLITE_IGNORE ++** if the column should be treated as a NULL value. ++*/ ++int sqlite_set_authorizer( ++ sqlite*, ++ int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), ++ void *pUserData ++); ++ ++/* ++** The second parameter to the access authorization function above will ++** be one of the values below. These values signify what kind of operation ++** is to be authorized. The 3rd and 4th parameters to the authorization ++** function will be parameters or NULL depending on which of the following ++** codes is used as the second parameter. The 5th parameter is the name ++** of the database ("main", "temp", etc.) if applicable. The 6th parameter ++** is the name of the inner-most trigger or view that is responsible for ++** the access attempt or NULL if this access attempt is directly from ++** input SQL code. ++** ++** Arg-3 Arg-4 ++*/ ++#define SQLITE_COPY 0 /* Table Name File Name */ ++#define SQLITE_CREATE_INDEX 1 /* Index Name Table Name */ ++#define SQLITE_CREATE_TABLE 2 /* Table Name NULL */ ++#define SQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */ ++#define SQLITE_CREATE_TEMP_TABLE 4 /* Table Name NULL */ ++#define SQLITE_CREATE_TEMP_TRIGGER 5 /* Trigger Name Table Name */ ++#define SQLITE_CREATE_TEMP_VIEW 6 /* View Name NULL */ ++#define SQLITE_CREATE_TRIGGER 7 /* Trigger Name Table Name */ ++#define SQLITE_CREATE_VIEW 8 /* View Name NULL */ ++#define SQLITE_DELETE 9 /* Table Name NULL */ ++#define SQLITE_DROP_INDEX 10 /* Index Name Table Name */ ++#define SQLITE_DROP_TABLE 11 /* Table Name NULL */ ++#define SQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */ ++#define SQLITE_DROP_TEMP_TABLE 13 /* Table Name NULL */ ++#define SQLITE_DROP_TEMP_TRIGGER 14 /* Trigger Name Table Name */ ++#define SQLITE_DROP_TEMP_VIEW 15 /* View Name NULL */ ++#define SQLITE_DROP_TRIGGER 16 /* Trigger Name Table Name */ ++#define SQLITE_DROP_VIEW 17 /* View Name NULL */ ++#define SQLITE_INSERT 18 /* Table Name NULL */ ++#define SQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */ ++#define SQLITE_READ 20 /* Table Name Column Name */ ++#define SQLITE_SELECT 21 /* NULL NULL */ ++#define SQLITE_TRANSACTION 22 /* NULL NULL */ ++#define SQLITE_UPDATE 23 /* Table Name Column Name */ ++#define SQLITE_ATTACH 24 /* Filename NULL */ ++#define SQLITE_DETACH 25 /* Database Name NULL */ ++ ++ ++/* ++** The return value of the authorization function should be one of the ++** following constants: ++*/ ++/* #define SQLITE_OK 0 // Allow access (This is actually defined above) */ ++#define SQLITE_DENY 1 /* Abort the SQL statement with an error */ ++#define SQLITE_IGNORE 2 /* Don't allow access, but don't generate an error */ ++ ++/* ++** Register a function that is called at every invocation of sqlite_exec() ++** or sqlite_compile(). This function can be used (for example) to generate ++** a log file of all SQL executed against a database. ++*/ ++void *sqlite_trace(sqlite*, void(*xTrace)(void*,const char*), void*); ++ ++/*** The Callback-Free API ++** ++** The following routines implement a new way to access SQLite that does not ++** involve the use of callbacks. ++** ++** An sqlite_vm is an opaque object that represents a single SQL statement ++** that is ready to be executed. ++*/ ++typedef struct sqlite_vm sqlite_vm; ++ ++/* ++** To execute an SQLite query without the use of callbacks, you first have ++** to compile the SQL using this routine. The 1st parameter "db" is a pointer ++** to an sqlite object obtained from sqlite_open(). The 2nd parameter ++** "zSql" is the text of the SQL to be compiled. The remaining parameters ++** are all outputs. ++** ++** *pzTail is made to point to the first character past the end of the first ++** SQL statement in zSql. This routine only compiles the first statement ++** in zSql, so *pzTail is left pointing to what remains uncompiled. ++** ++** *ppVm is left pointing to a "virtual machine" that can be used to execute ++** the compiled statement. Or if there is an error, *ppVm may be set to NULL. ++** If the input text contained no SQL (if the input is and empty string or ++** a comment) then *ppVm is set to NULL. ++** ++** If any errors are detected during compilation, an error message is written ++** into space obtained from malloc() and *pzErrMsg is made to point to that ++** error message. The calling routine is responsible for freeing the text ++** of this message when it has finished with it. Use sqlite_freemem() to ++** free the message. pzErrMsg may be NULL in which case no error message ++** will be generated. ++** ++** On success, SQLITE_OK is returned. Otherwise and error code is returned. ++*/ ++int sqlite_compile( ++ sqlite *db, /* The open database */ ++ const char *zSql, /* SQL statement to be compiled */ ++ const char **pzTail, /* OUT: uncompiled tail of zSql */ ++ sqlite_vm **ppVm, /* OUT: the virtual machine to execute zSql */ ++ char **pzErrmsg /* OUT: Error message. */ ++); ++ ++/* ++** After an SQL statement has been compiled, it is handed to this routine ++** to be executed. This routine executes the statement as far as it can ++** go then returns. The return value will be one of SQLITE_DONE, ++** SQLITE_ERROR, SQLITE_BUSY, SQLITE_ROW, or SQLITE_MISUSE. ++** ++** SQLITE_DONE means that the execute of the SQL statement is complete ++** an no errors have occurred. sqlite_step() should not be called again ++** for the same virtual machine. *pN is set to the number of columns in ++** the result set and *pazColName is set to an array of strings that ++** describe the column names and datatypes. The name of the i-th column ++** is (*pazColName)[i] and the datatype of the i-th column is ++** (*pazColName)[i+*pN]. *pazValue is set to NULL. ++** ++** SQLITE_ERROR means that the virtual machine encountered a run-time ++** error. sqlite_step() should not be called again for the same ++** virtual machine. *pN is set to 0 and *pazColName and *pazValue are set ++** to NULL. Use sqlite_finalize() to obtain the specific error code ++** and the error message text for the error. ++** ++** SQLITE_BUSY means that an attempt to open the database failed because ++** another thread or process is holding a lock. The calling routine ++** can try again to open the database by calling sqlite_step() again. ++** The return code will only be SQLITE_BUSY if no busy handler is registered ++** using the sqlite_busy_handler() or sqlite_busy_timeout() routines. If ++** a busy handler callback has been registered but returns 0, then this ++** routine will return SQLITE_ERROR and sqltie_finalize() will return ++** SQLITE_BUSY when it is called. ++** ++** SQLITE_ROW means that a single row of the result is now available. ++** The data is contained in *pazValue. The value of the i-th column is ++** (*azValue)[i]. *pN and *pazColName are set as described in SQLITE_DONE. ++** Invoke sqlite_step() again to advance to the next row. ++** ++** SQLITE_MISUSE is returned if sqlite_step() is called incorrectly. ++** For example, if you call sqlite_step() after the virtual machine ++** has halted (after a prior call to sqlite_step() has returned SQLITE_DONE) ++** or if you call sqlite_step() with an incorrectly initialized virtual ++** machine or a virtual machine that has been deleted or that is associated ++** with an sqlite structure that has been closed. ++*/ ++int sqlite_step( ++ sqlite_vm *pVm, /* The virtual machine to execute */ ++ int *pN, /* OUT: Number of columns in result */ ++ const char ***pazValue, /* OUT: Column data */ ++ const char ***pazColName /* OUT: Column names and datatypes */ ++); ++ ++/* ++** This routine is called to delete a virtual machine after it has finished ++** executing. The return value is the result code. SQLITE_OK is returned ++** if the statement executed successfully and some other value is returned if ++** there was any kind of error. If an error occurred and pzErrMsg is not ++** NULL, then an error message is written into memory obtained from malloc() ++** and *pzErrMsg is made to point to that error message. The calling routine ++** should use sqlite_freemem() to delete this message when it has finished ++** with it. ++** ++** This routine can be called at any point during the execution of the ++** virtual machine. If the virtual machine has not completed execution ++** when this routine is called, that is like encountering an error or ++** an interrupt. (See sqlite_interrupt().) Incomplete updates may be ++** rolled back and transactions cancelled, depending on the circumstances, ++** and the result code returned will be SQLITE_ABORT. ++*/ ++int sqlite_finalize(sqlite_vm*, char **pzErrMsg); ++ ++/* ++** This routine deletes the virtual machine, writes any error message to ++** *pzErrMsg and returns an SQLite return code in the same way as the ++** sqlite_finalize() function. ++** ++** Additionally, if ppVm is not NULL, *ppVm is left pointing to a new virtual ++** machine loaded with the compiled version of the original query ready for ++** execution. ++** ++** If sqlite_reset() returns SQLITE_SCHEMA, then *ppVm is set to NULL. ++** ++******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** ++*/ ++int sqlite_reset(sqlite_vm*, char **pzErrMsg); ++ ++/* ++** If the SQL that was handed to sqlite_compile contains variables that ++** are represeted in the SQL text by a question mark ('?'). This routine ++** is used to assign values to those variables. ++** ++** The first parameter is a virtual machine obtained from sqlite_compile(). ++** The 2nd "idx" parameter determines which variable in the SQL statement ++** to bind the value to. The left most '?' is 1. The 3rd parameter is ++** the value to assign to that variable. The 4th parameter is the number ++** of bytes in the value, including the terminating \000 for strings. ++** Finally, the 5th "copy" parameter is TRUE if SQLite should make its ++** own private copy of this value, or false if the space that the 3rd ++** parameter points to will be unchanging and can be used directly by ++** SQLite. ++** ++** Unbound variables are treated as having a value of NULL. To explicitly ++** set a variable to NULL, call this routine with the 3rd parameter as a ++** NULL pointer. ++** ++** If the 4th "len" parameter is -1, then strlen() is used to find the ++** length. ++** ++** This routine can only be called immediately after sqlite_compile() ++** or sqlite_reset() and before any calls to sqlite_step(). ++** ++******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** ++*/ ++int sqlite_bind(sqlite_vm*, int idx, const char *value, int len, int copy); ++ ++/* ++** This routine configures a callback function - the progress callback - that ++** is invoked periodically during long running calls to sqlite_exec(), ++** sqlite_step() and sqlite_get_table(). An example use for this API is to keep ++** a GUI updated during a large query. ++** ++** The progress callback is invoked once for every N virtual machine opcodes, ++** where N is the second argument to this function. The progress callback ++** itself is identified by the third argument to this function. The fourth ++** argument to this function is a void pointer passed to the progress callback ++** function each time it is invoked. ++** ++** If a call to sqlite_exec(), sqlite_step() or sqlite_get_table() results ++** in less than N opcodes being executed, then the progress callback is not ++** invoked. ++** ++** Calling this routine overwrites any previously installed progress callback. ++** To remove the progress callback altogether, pass NULL as the third ++** argument to this function. ++** ++** If the progress callback returns a result other than 0, then the current ++** query is immediately terminated and any database changes rolled back. If the ++** query was part of a larger transaction, then the transaction is not rolled ++** back and remains active. The sqlite_exec() call returns SQLITE_ABORT. ++** ++******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** ++*/ ++void sqlite_progress_handler(sqlite*, int, int(*)(void*), void*); ++ ++/* ++** Register a callback function to be invoked whenever a new transaction ++** is committed. The pArg argument is passed through to the callback. ++** callback. If the callback function returns non-zero, then the commit ++** is converted into a rollback. ++** ++** If another function was previously registered, its pArg value is returned. ++** Otherwise NULL is returned. ++** ++** Registering a NULL function disables the callback. ++** ++******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** ++*/ ++void *sqlite_commit_hook(sqlite*, int(*)(void*), void*); ++ ++/* ++** Open an encrypted SQLite database. If pKey==0 or nKey==0, this routine ++** is the same as sqlite_open(). ++** ++** The code to implement this API is not available in the public release ++** of SQLite. ++*/ ++sqlite *sqlite_open_encrypted( ++ const char *zFilename, /* Name of the encrypted database */ ++ const void *pKey, /* Pointer to the key */ ++ int nKey, /* Number of bytes in the key */ ++ int *pErrcode, /* Write error code here */ ++ char **pzErrmsg /* Write error message here */ ++); ++ ++/* ++** Change the key on an open database. If the current database is not ++** encrypted, this routine will encrypt it. If pNew==0 or nNew==0, the ++** database is decrypted. ++** ++** The code to implement this API is not available in the public release ++** of SQLite. ++*/ ++int sqlite_rekey( ++ sqlite *db, /* Database to be rekeyed */ ++ const void *pKey, int nKey /* The new key */ ++); ++ ++/* ++** Encode a binary buffer "in" of size n bytes so that it contains ++** no instances of characters '\'' or '\000'. The output is ++** null-terminated and can be used as a string value in an INSERT ++** or UPDATE statement. Use sqlite_decode_binary() to convert the ++** string back into its original binary. ++** ++** The result is written into a preallocated output buffer "out". ++** "out" must be able to hold at least 2 +(257*n)/254 bytes. ++** In other words, the output will be expanded by as much as 3 ++** bytes for every 254 bytes of input plus 2 bytes of fixed overhead. ++** (This is approximately 2 + 1.0118*n or about a 1.2% size increase.) ++** ++** The return value is the number of characters in the encoded ++** string, excluding the "\000" terminator. ++** ++** If out==NULL then no output is generated but the routine still returns ++** the number of characters that would have been generated if out had ++** not been NULL. ++*/ ++int sqlite_encode_binary(const unsigned char *in, int n, unsigned char *out); ++ ++/* ++** Decode the string "in" into binary data and write it into "out". ++** This routine reverses the encoding created by sqlite_encode_binary(). ++** The output will always be a few bytes less than the input. The number ++** of bytes of output is returned. If the input is not a well-formed ++** encoding, -1 is returned. ++** ++** The "in" and "out" parameters may point to the same buffer in order ++** to decode a string in place. ++*/ ++int sqlite_decode_binary(const unsigned char *in, unsigned char *out); ++ ++#ifdef __cplusplus ++} /* End of the 'extern "C"' block */ ++#endif ++ ++#endif /* _SQLITE_H_ */ +--- /dev/null ++++ b/ext/sqlite/libsqlite/src/sqliteInt.h +@@ -0,0 +1,1270 @@ ++/* ++** 2001 September 15 ++** ++** The author disclaims copyright to this source code. In place of ++** a legal notice, here is a blessing: ++** ++** May you do good and not evil. ++** May you find forgiveness for yourself and forgive others. ++** May you share freely, never taking more than you give. ++** ++************************************************************************* ++** Internal interface definitions for SQLite. ++** ++** @(#) $Id$ ++*/ ++#include "config.h" ++#include "sqlite.h" ++#include "hash.h" ++#include "parse.h" ++#include "btree.h" ++#include ++#include ++#include ++#include ++ ++/* ++** The maximum number of in-memory pages to use for the main database ++** table and for temporary tables. ++*/ ++#define MAX_PAGES 2000 ++#define TEMP_PAGES 500 ++ ++/* ++** If the following macro is set to 1, then NULL values are considered ++** distinct for the SELECT DISTINCT statement and for UNION or EXCEPT ++** compound queries. No other SQL database engine (among those tested) ++** works this way except for OCELOT. But the SQL92 spec implies that ++** this is how things should work. ++** ++** If the following macro is set to 0, then NULLs are indistinct for ++** SELECT DISTINCT and for UNION. ++*/ ++#define NULL_ALWAYS_DISTINCT 0 ++ ++/* ++** If the following macro is set to 1, then NULL values are considered ++** distinct when determining whether or not two entries are the same ++** in a UNIQUE index. This is the way PostgreSQL, Oracle, DB2, MySQL, ++** OCELOT, and Firebird all work. The SQL92 spec explicitly says this ++** is the way things are suppose to work. ++** ++** If the following macro is set to 0, the NULLs are indistinct for ++** a UNIQUE index. In this mode, you can only have a single NULL entry ++** for a column declared UNIQUE. This is the way Informix and SQL Server ++** work. ++*/ ++#define NULL_DISTINCT_FOR_UNIQUE 1 ++ ++/* ++** The maximum number of attached databases. This must be at least 2 ++** in order to support the main database file (0) and the file used to ++** hold temporary tables (1). And it must be less than 256 because ++** an unsigned character is used to stored the database index. ++*/ ++#define MAX_ATTACHED 10 ++ ++/* ++** The next macro is used to determine where TEMP tables and indices ++** are stored. Possible values: ++** ++** 0 Always use a temporary files ++** 1 Use a file unless overridden by "PRAGMA temp_store" ++** 2 Use memory unless overridden by "PRAGMA temp_store" ++** 3 Always use memory ++*/ ++#ifndef TEMP_STORE ++# define TEMP_STORE 1 ++#endif ++ ++/* ++** When building SQLite for embedded systems where memory is scarce, ++** you can define one or more of the following macros to omit extra ++** features of the library and thus keep the size of the library to ++** a minimum. ++*/ ++/* #define SQLITE_OMIT_AUTHORIZATION 1 */ ++/* #define SQLITE_OMIT_INMEMORYDB 1 */ ++/* #define SQLITE_OMIT_VACUUM 1 */ ++/* #define SQLITE_OMIT_DATETIME_FUNCS 1 */ ++/* #define SQLITE_OMIT_PROGRESS_CALLBACK 1 */ ++ ++/* ++** Integers of known sizes. These typedefs might change for architectures ++** where the sizes very. Preprocessor macros are available so that the ++** types can be conveniently redefined at compile-type. Like this: ++** ++** cc '-DUINTPTR_TYPE=long long int' ... ++*/ ++#ifndef UINT32_TYPE ++# define UINT32_TYPE unsigned int ++#endif ++#ifndef UINT16_TYPE ++# define UINT16_TYPE unsigned short int ++#endif ++#ifndef INT16_TYPE ++# define INT16_TYPE short int ++#endif ++#ifndef UINT8_TYPE ++# define UINT8_TYPE unsigned char ++#endif ++#ifndef INT8_TYPE ++# define INT8_TYPE signed char ++#endif ++#ifndef INTPTR_TYPE ++# if SQLITE_PTR_SZ==4 ++# define INTPTR_TYPE int ++# else ++# define INTPTR_TYPE long long ++# endif ++#endif ++typedef UINT32_TYPE u32; /* 4-byte unsigned integer */ ++typedef UINT16_TYPE u16; /* 2-byte unsigned integer */ ++typedef INT16_TYPE i16; /* 2-byte signed integer */ ++typedef UINT8_TYPE u8; /* 1-byte unsigned integer */ ++typedef UINT8_TYPE i8; /* 1-byte signed integer */ ++typedef INTPTR_TYPE ptr; /* Big enough to hold a pointer */ ++typedef unsigned INTPTR_TYPE uptr; /* Big enough to hold a pointer */ ++ ++/* ++** Defer sourcing vdbe.h until after the "u8" typedef is defined. ++*/ ++#include "vdbe.h" ++ ++/* ++** Most C compilers these days recognize "long double", don't they? ++** Just in case we encounter one that does not, we will create a macro ++** for long double so that it can be easily changed to just "double". ++*/ ++#ifndef LONGDOUBLE_TYPE ++# define LONGDOUBLE_TYPE long double ++#endif ++ ++/* ++** This macro casts a pointer to an integer. Useful for doing ++** pointer arithmetic. ++*/ ++#define Addr(X) ((uptr)X) ++ ++/* ++** The maximum number of bytes of data that can be put into a single ++** row of a single table. The upper bound on this limit is 16777215 ++** bytes (or 16MB-1). We have arbitrarily set the limit to just 1MB ++** here because the overflow page chain is inefficient for really big ++** records and we want to discourage people from thinking that ++** multi-megabyte records are OK. If your needs are different, you can ++** change this define and recompile to increase or decrease the record ++** size. ++** ++** The 16777198 is computed as follows: 238 bytes of payload on the ++** original pages plus 16448 overflow pages each holding 1020 bytes of ++** data. ++*/ ++#define MAX_BYTES_PER_ROW 1048576 ++/* #define MAX_BYTES_PER_ROW 16777198 */ ++ ++/* ++** If memory allocation problems are found, recompile with ++** ++** -DMEMORY_DEBUG=1 ++** ++** to enable some sanity checking on malloc() and free(). To ++** check for memory leaks, recompile with ++** ++** -DMEMORY_DEBUG=2 ++** ++** and a line of text will be written to standard error for ++** each malloc() and free(). This output can be analyzed ++** by an AWK script to determine if there are any leaks. ++*/ ++#ifdef MEMORY_DEBUG ++# define sqliteMalloc(X) sqliteMalloc_(X,1,__FILE__,__LINE__) ++# define sqliteMallocRaw(X) sqliteMalloc_(X,0,__FILE__,__LINE__) ++# define sqliteFree(X) sqliteFree_(X,__FILE__,__LINE__) ++# define sqliteRealloc(X,Y) sqliteRealloc_(X,Y,__FILE__,__LINE__) ++# define sqliteStrDup(X) sqliteStrDup_(X,__FILE__,__LINE__) ++# define sqliteStrNDup(X,Y) sqliteStrNDup_(X,Y,__FILE__,__LINE__) ++ void sqliteStrRealloc(char**); ++#else ++# define sqliteRealloc_(X,Y) sqliteRealloc(X,Y) ++# define sqliteStrRealloc(X) ++#endif ++ ++/* ++** This variable gets set if malloc() ever fails. After it gets set, ++** the SQLite library shuts down permanently. ++*/ ++extern int sqlite_malloc_failed; ++ ++/* ++** The following global variables are used for testing and debugging ++** only. They only work if MEMORY_DEBUG is defined. ++*/ ++#ifdef MEMORY_DEBUG ++extern int sqlite_nMalloc; /* Number of sqliteMalloc() calls */ ++extern int sqlite_nFree; /* Number of sqliteFree() calls */ ++extern int sqlite_iMallocFail; /* Fail sqliteMalloc() after this many calls */ ++#endif ++ ++/* ++** Name of the master database table. The master database table ++** is a special table that holds the names and attributes of all ++** user tables and indices. ++*/ ++#define MASTER_NAME "sqlite_master" ++#define TEMP_MASTER_NAME "sqlite_temp_master" ++ ++/* ++** The name of the schema table. ++*/ ++#define SCHEMA_TABLE(x) (x?TEMP_MASTER_NAME:MASTER_NAME) ++ ++/* ++** A convenience macro that returns the number of elements in ++** an array. ++*/ ++#define ArraySize(X) (sizeof(X)/sizeof(X[0])) ++ ++/* ++** Forward references to structures ++*/ ++typedef struct Column Column; ++typedef struct Table Table; ++typedef struct Index Index; ++typedef struct Instruction Instruction; ++typedef struct Expr Expr; ++typedef struct ExprList ExprList; ++typedef struct Parse Parse; ++typedef struct Token Token; ++typedef struct IdList IdList; ++typedef struct SrcList SrcList; ++typedef struct WhereInfo WhereInfo; ++typedef struct WhereLevel WhereLevel; ++typedef struct Select Select; ++typedef struct AggExpr AggExpr; ++typedef struct FuncDef FuncDef; ++typedef struct Trigger Trigger; ++typedef struct TriggerStep TriggerStep; ++typedef struct TriggerStack TriggerStack; ++typedef struct FKey FKey; ++typedef struct Db Db; ++typedef struct AuthContext AuthContext; ++ ++/* ++** Each database file to be accessed by the system is an instance ++** of the following structure. There are normally two of these structures ++** in the sqlite.aDb[] array. aDb[0] is the main database file and ++** aDb[1] is the database file used to hold temporary tables. Additional ++** databases may be attached. ++*/ ++struct Db { ++ char *zName; /* Name of this database */ ++ Btree *pBt; /* The B*Tree structure for this database file */ ++ int schema_cookie; /* Database schema version number for this file */ ++ Hash tblHash; /* All tables indexed by name */ ++ Hash idxHash; /* All (named) indices indexed by name */ ++ Hash trigHash; /* All triggers indexed by name */ ++ Hash aFKey; /* Foreign keys indexed by to-table */ ++ u8 inTrans; /* 0: not writable. 1: Transaction. 2: Checkpoint */ ++ u16 flags; /* Flags associated with this database */ ++ void *pAux; /* Auxiliary data. Usually NULL */ ++ void (*xFreeAux)(void*); /* Routine to free pAux */ ++}; ++ ++/* ++** These macros can be used to test, set, or clear bits in the ++** Db.flags field. ++*/ ++#define DbHasProperty(D,I,P) (((D)->aDb[I].flags&(P))==(P)) ++#define DbHasAnyProperty(D,I,P) (((D)->aDb[I].flags&(P))!=0) ++#define DbSetProperty(D,I,P) (D)->aDb[I].flags|=(P) ++#define DbClearProperty(D,I,P) (D)->aDb[I].flags&=~(P) ++ ++/* ++** Allowed values for the DB.flags field. ++** ++** The DB_Locked flag is set when the first OP_Transaction or OP_Checkpoint ++** opcode is emitted for a database. This prevents multiple occurances ++** of those opcodes for the same database in the same program. Similarly, ++** the DB_Cookie flag is set when the OP_VerifyCookie opcode is emitted, ++** and prevents duplicate OP_VerifyCookies from taking up space and slowing ++** down execution. ++** ++** The DB_SchemaLoaded flag is set after the database schema has been ++** read into internal hash tables. ++** ++** DB_UnresetViews means that one or more views have column names that ++** have been filled out. If the schema changes, these column names might ++** changes and so the view will need to be reset. ++*/ ++#define DB_Locked 0x0001 /* OP_Transaction opcode has been emitted */ ++#define DB_Cookie 0x0002 /* OP_VerifyCookie opcode has been emiited */ ++#define DB_SchemaLoaded 0x0004 /* The schema has been loaded */ ++#define DB_UnresetViews 0x0008 /* Some views have defined column names */ ++ ++ ++/* ++** Each database is an instance of the following structure. ++** ++** The sqlite.file_format is initialized by the database file ++** and helps determines how the data in the database file is ++** represented. This field allows newer versions of the library ++** to read and write older databases. The various file formats ++** are as follows: ++** ++** file_format==1 Version 2.1.0. ++** file_format==2 Version 2.2.0. Add support for INTEGER PRIMARY KEY. ++** file_format==3 Version 2.6.0. Fix empty-string index bug. ++** file_format==4 Version 2.7.0. Add support for separate numeric and ++** text datatypes. ++** ++** The sqlite.temp_store determines where temporary database files ++** are stored. If 1, then a file is created to hold those tables. If ++** 2, then they are held in memory. 0 means use the default value in ++** the TEMP_STORE macro. ++** ++** The sqlite.lastRowid records the last insert rowid generated by an ++** insert statement. Inserts on views do not affect its value. Each ++** trigger has its own context, so that lastRowid can be updated inside ++** triggers as usual. The previous value will be restored once the trigger ++** exits. Upon entering a before or instead of trigger, lastRowid is no ++** longer (since after version 2.8.12) reset to -1. ++** ++** The sqlite.nChange does not count changes within triggers and keeps no ++** context. It is reset at start of sqlite_exec. ++** The sqlite.lsChange represents the number of changes made by the last ++** insert, update, or delete statement. It remains constant throughout the ++** length of a statement and is then updated by OP_SetCounts. It keeps a ++** context stack just like lastRowid so that the count of changes ++** within a trigger is not seen outside the trigger. Changes to views do not ++** affect the value of lsChange. ++** The sqlite.csChange keeps track of the number of current changes (since ++** the last statement) and is used to update sqlite_lsChange. ++*/ ++struct sqlite { ++ int nDb; /* Number of backends currently in use */ ++ Db *aDb; /* All backends */ ++ Db aDbStatic[2]; /* Static space for the 2 default backends */ ++ int flags; /* Miscellanous flags. See below */ ++ u8 file_format; /* What file format version is this database? */ ++ u8 safety_level; /* How aggressive at synching data to disk */ ++ u8 want_to_close; /* Close after all VDBEs are deallocated */ ++ u8 temp_store; /* 1=file, 2=memory, 0=compile-time default */ ++ u8 onError; /* Default conflict algorithm */ ++ int next_cookie; /* Next value of aDb[0].schema_cookie */ ++ int cache_size; /* Number of pages to use in the cache */ ++ int nTable; /* Number of tables in the database */ ++ void *pBusyArg; /* 1st Argument to the busy callback */ ++ int (*xBusyCallback)(void *,const char*,int); /* The busy callback */ ++ void *pCommitArg; /* Argument to xCommitCallback() */ ++ int (*xCommitCallback)(void*);/* Invoked at every commit. */ ++ Hash aFunc; /* All functions that can be in SQL exprs */ ++ int lastRowid; /* ROWID of most recent insert (see above) */ ++ int priorNewRowid; /* Last randomly generated ROWID */ ++ int magic; /* Magic number for detect library misuse */ ++ int nChange; /* Number of rows changed (see above) */ ++ int lsChange; /* Last statement change count (see above) */ ++ int csChange; /* Current statement change count (see above) */ ++ struct sqliteInitInfo { /* Information used during initialization */ ++ int iDb; /* When back is being initialized */ ++ int newTnum; /* Rootpage of table being initialized */ ++ u8 busy; /* TRUE if currently initializing */ ++ } init; ++ struct Vdbe *pVdbe; /* List of active virtual machines */ ++ void (*xTrace)(void*,const char*); /* Trace function */ ++ void *pTraceArg; /* Argument to the trace function */ ++#ifndef SQLITE_OMIT_AUTHORIZATION ++ int (*xAuth)(void*,int,const char*,const char*,const char*,const char*); ++ /* Access authorization function */ ++ void *pAuthArg; /* 1st argument to the access auth function */ ++#endif ++#ifndef SQLITE_OMIT_PROGRESS_CALLBACK ++ int (*xProgress)(void *); /* The progress callback */ ++ void *pProgressArg; /* Argument to the progress callback */ ++ int nProgressOps; /* Number of opcodes for progress callback */ ++#endif ++}; ++ ++/* ++** Possible values for the sqlite.flags and or Db.flags fields. ++** ++** On sqlite.flags, the SQLITE_InTrans value means that we have ++** executed a BEGIN. On Db.flags, SQLITE_InTrans means a statement ++** transaction is active on that particular database file. ++*/ ++#define SQLITE_VdbeTrace 0x00000001 /* True to trace VDBE execution */ ++#define SQLITE_Initialized 0x00000002 /* True after initialization */ ++#define SQLITE_Interrupt 0x00000004 /* Cancel current operation */ ++#define SQLITE_InTrans 0x00000008 /* True if in a transaction */ ++#define SQLITE_InternChanges 0x00000010 /* Uncommitted Hash table changes */ ++#define SQLITE_FullColNames 0x00000020 /* Show full column names on SELECT */ ++#define SQLITE_ShortColNames 0x00000040 /* Show short columns names */ ++#define SQLITE_CountRows 0x00000080 /* Count rows changed by INSERT, */ ++ /* DELETE, or UPDATE and return */ ++ /* the count using a callback. */ ++#define SQLITE_NullCallback 0x00000100 /* Invoke the callback once if the */ ++ /* result set is empty */ ++#define SQLITE_ReportTypes 0x00000200 /* Include information on datatypes */ ++ /* in 4th argument of callback */ ++ ++/* ++** Possible values for the sqlite.magic field. ++** The numbers are obtained at random and have no special meaning, other ++** than being distinct from one another. ++*/ ++#define SQLITE_MAGIC_OPEN 0xa029a697 /* Database is open */ ++#define SQLITE_MAGIC_CLOSED 0x9f3c2d33 /* Database is closed */ ++#define SQLITE_MAGIC_BUSY 0xf03b7906 /* Database currently in use */ ++#define SQLITE_MAGIC_ERROR 0xb5357930 /* An SQLITE_MISUSE error occurred */ ++ ++/* ++** Each SQL function is defined by an instance of the following ++** structure. A pointer to this structure is stored in the sqlite.aFunc ++** hash table. When multiple functions have the same name, the hash table ++** points to a linked list of these structures. ++*/ ++struct FuncDef { ++ void (*xFunc)(sqlite_func*,int,const char**); /* Regular function */ ++ void (*xStep)(sqlite_func*,int,const char**); /* Aggregate function step */ ++ void (*xFinalize)(sqlite_func*); /* Aggregate function finializer */ ++ signed char nArg; /* Number of arguments. -1 means unlimited */ ++ signed char dataType; /* Arg that determines datatype. -1=NUMERIC, */ ++ /* -2=TEXT. -3=SQLITE_ARGS */ ++ u8 includeTypes; /* Add datatypes to args of xFunc and xStep */ ++ void *pUserData; /* User data parameter */ ++ FuncDef *pNext; /* Next function with same name */ ++}; ++ ++/* ++** information about each column of an SQL table is held in an instance ++** of this structure. ++*/ ++struct Column { ++ char *zName; /* Name of this column */ ++ char *zDflt; /* Default value of this column */ ++ char *zType; /* Data type for this column */ ++ u8 notNull; /* True if there is a NOT NULL constraint */ ++ u8 isPrimKey; /* True if this column is part of the PRIMARY KEY */ ++ u8 sortOrder; /* Some combination of SQLITE_SO_... values */ ++ u8 dottedName; /* True if zName contains a "." character */ ++}; ++ ++/* ++** The allowed sort orders. ++** ++** The TEXT and NUM values use bits that do not overlap with DESC and ASC. ++** That way the two can be combined into a single number. ++*/ ++#define SQLITE_SO_UNK 0 /* Use the default collating type. (SCT_NUM) */ ++#define SQLITE_SO_TEXT 2 /* Sort using memcmp() */ ++#define SQLITE_SO_NUM 4 /* Sort using sqliteCompare() */ ++#define SQLITE_SO_TYPEMASK 6 /* Mask to extract the collating sequence */ ++#define SQLITE_SO_ASC 0 /* Sort in ascending order */ ++#define SQLITE_SO_DESC 1 /* Sort in descending order */ ++#define SQLITE_SO_DIRMASK 1 /* Mask to extract the sort direction */ ++ ++/* ++** Each SQL table is represented in memory by an instance of the ++** following structure. ++** ++** Table.zName is the name of the table. The case of the original ++** CREATE TABLE statement is stored, but case is not significant for ++** comparisons. ++** ++** Table.nCol is the number of columns in this table. Table.aCol is a ++** pointer to an array of Column structures, one for each column. ++** ++** If the table has an INTEGER PRIMARY KEY, then Table.iPKey is the index of ++** the column that is that key. Otherwise Table.iPKey is negative. Note ++** that the datatype of the PRIMARY KEY must be INTEGER for this field to ++** be set. An INTEGER PRIMARY KEY is used as the rowid for each row of ++** the table. If a table has no INTEGER PRIMARY KEY, then a random rowid ++** is generated for each row of the table. Table.hasPrimKey is true if ++** the table has any PRIMARY KEY, INTEGER or otherwise. ++** ++** Table.tnum is the page number for the root BTree page of the table in the ++** database file. If Table.iDb is the index of the database table backend ++** in sqlite.aDb[]. 0 is for the main database and 1 is for the file that ++** holds temporary tables and indices. If Table.isTransient ++** is true, then the table is stored in a file that is automatically deleted ++** when the VDBE cursor to the table is closed. In this case Table.tnum ++** refers VDBE cursor number that holds the table open, not to the root ++** page number. Transient tables are used to hold the results of a ++** sub-query that appears instead of a real table name in the FROM clause ++** of a SELECT statement. ++*/ ++struct Table { ++ char *zName; /* Name of the table */ ++ int nCol; /* Number of columns in this table */ ++ Column *aCol; /* Information about each column */ ++ int iPKey; /* If not less then 0, use aCol[iPKey] as the primary key */ ++ Index *pIndex; /* List of SQL indexes on this table. */ ++ int tnum; /* Root BTree node for this table (see note above) */ ++ Select *pSelect; /* NULL for tables. Points to definition if a view. */ ++ u8 readOnly; /* True if this table should not be written by the user */ ++ u8 iDb; /* Index into sqlite.aDb[] of the backend for this table */ ++ u8 isTransient; /* True if automatically deleted when VDBE finishes */ ++ u8 hasPrimKey; /* True if there exists a primary key */ ++ u8 keyConf; /* What to do in case of uniqueness conflict on iPKey */ ++ Trigger *pTrigger; /* List of SQL triggers on this table */ ++ FKey *pFKey; /* Linked list of all foreign keys in this table */ ++}; ++ ++/* ++** Each foreign key constraint is an instance of the following structure. ++** ++** A foreign key is associated with two tables. The "from" table is ++** the table that contains the REFERENCES clause that creates the foreign ++** key. The "to" table is the table that is named in the REFERENCES clause. ++** Consider this example: ++** ++** CREATE TABLE ex1( ++** a INTEGER PRIMARY KEY, ++** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) ++** ); ++** ++** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". ++** ++** Each REFERENCES clause generates an instance of the following structure ++** which is attached to the from-table. The to-table need not exist when ++** the from-table is created. The existance of the to-table is not checked ++** until an attempt is made to insert data into the from-table. ++** ++** The sqlite.aFKey hash table stores pointers to this structure ++** given the name of a to-table. For each to-table, all foreign keys ++** associated with that table are on a linked list using the FKey.pNextTo ++** field. ++*/ ++struct FKey { ++ Table *pFrom; /* The table that constains the REFERENCES clause */ ++ FKey *pNextFrom; /* Next foreign key in pFrom */ ++ char *zTo; /* Name of table that the key points to */ ++ FKey *pNextTo; /* Next foreign key that points to zTo */ ++ int nCol; /* Number of columns in this key */ ++ struct sColMap { /* Mapping of columns in pFrom to columns in zTo */ ++ int iFrom; /* Index of column in pFrom */ ++ char *zCol; /* Name of column in zTo. If 0 use PRIMARY KEY */ ++ } *aCol; /* One entry for each of nCol column s */ ++ u8 isDeferred; /* True if constraint checking is deferred till COMMIT */ ++ u8 updateConf; /* How to resolve conflicts that occur on UPDATE */ ++ u8 deleteConf; /* How to resolve conflicts that occur on DELETE */ ++ u8 insertConf; /* How to resolve conflicts that occur on INSERT */ ++}; ++ ++/* ++** SQLite supports many different ways to resolve a contraint ++** error. ROLLBACK processing means that a constraint violation ++** causes the operation in process to fail and for the current transaction ++** to be rolled back. ABORT processing means the operation in process ++** fails and any prior changes from that one operation are backed out, ++** but the transaction is not rolled back. FAIL processing means that ++** the operation in progress stops and returns an error code. But prior ++** changes due to the same operation are not backed out and no rollback ++** occurs. IGNORE means that the particular row that caused the constraint ++** error is not inserted or updated. Processing continues and no error ++** is returned. REPLACE means that preexisting database rows that caused ++** a UNIQUE constraint violation are removed so that the new insert or ++** update can proceed. Processing continues and no error is reported. ++** ++** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys. ++** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the ++** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign ++** key is set to NULL. CASCADE means that a DELETE or UPDATE of the ++** referenced table row is propagated into the row that holds the ++** foreign key. ++** ++** The following symbolic values are used to record which type ++** of action to take. ++*/ ++#define OE_None 0 /* There is no constraint to check */ ++#define OE_Rollback 1 /* Fail the operation and rollback the transaction */ ++#define OE_Abort 2 /* Back out changes but do no rollback transaction */ ++#define OE_Fail 3 /* Stop the operation but leave all prior changes */ ++#define OE_Ignore 4 /* Ignore the error. Do not do the INSERT or UPDATE */ ++#define OE_Replace 5 /* Delete existing record, then do INSERT or UPDATE */ ++ ++#define OE_Restrict 6 /* OE_Abort for IMMEDIATE, OE_Rollback for DEFERRED */ ++#define OE_SetNull 7 /* Set the foreign key value to NULL */ ++#define OE_SetDflt 8 /* Set the foreign key value to its default */ ++#define OE_Cascade 9 /* Cascade the changes */ ++ ++#define OE_Default 99 /* Do whatever the default action is */ ++ ++/* ++** Each SQL index is represented in memory by an ++** instance of the following structure. ++** ++** The columns of the table that are to be indexed are described ++** by the aiColumn[] field of this structure. For example, suppose ++** we have the following table and index: ++** ++** CREATE TABLE Ex1(c1 int, c2 int, c3 text); ++** CREATE INDEX Ex2 ON Ex1(c3,c1); ++** ++** In the Table structure describing Ex1, nCol==3 because there are ++** three columns in the table. In the Index structure describing ++** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. ++** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the ++** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. ++** The second column to be indexed (c1) has an index of 0 in ++** Ex1.aCol[], hence Ex2.aiColumn[1]==0. ++** ++** The Index.onError field determines whether or not the indexed columns ++** must be unique and what to do if they are not. When Index.onError=OE_None, ++** it means this is not a unique index. Otherwise it is a unique index ++** and the value of Index.onError indicate the which conflict resolution ++** algorithm to employ whenever an attempt is made to insert a non-unique ++** element. ++*/ ++struct Index { ++ char *zName; /* Name of this index */ ++ int nColumn; /* Number of columns in the table used by this index */ ++ int *aiColumn; /* Which columns are used by this index. 1st is 0 */ ++ Table *pTable; /* The SQL table being indexed */ ++ int tnum; /* Page containing root of this index in database file */ ++ u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ ++ u8 autoIndex; /* True if is automatically created (ex: by UNIQUE) */ ++ u8 iDb; /* Index in sqlite.aDb[] of where this index is stored */ ++ Index *pNext; /* The next index associated with the same table */ ++}; ++ ++/* ++** Each token coming out of the lexer is an instance of ++** this structure. Tokens are also used as part of an expression. ++** ++** Note if Token.z==0 then Token.dyn and Token.n are undefined and ++** may contain random values. Do not make any assuptions about Token.dyn ++** and Token.n when Token.z==0. ++*/ ++struct Token { ++ const char *z; /* Text of the token. Not NULL-terminated! */ ++ unsigned dyn : 1; /* True for malloced memory, false for static */ ++ unsigned n : 31; /* Number of characters in this token */ ++}; ++ ++/* ++** Each node of an expression in the parse tree is an instance ++** of this structure. ++** ++** Expr.op is the opcode. The integer parser token codes are reused ++** as opcodes here. For example, the parser defines TK_GE to be an integer ++** code representing the ">=" operator. This same integer code is reused ++** to represent the greater-than-or-equal-to operator in the expression ++** tree. ++** ++** Expr.pRight and Expr.pLeft are subexpressions. Expr.pList is a list ++** of argument if the expression is a function. ++** ++** Expr.token is the operator token for this node. For some expressions ++** that have subexpressions, Expr.token can be the complete text that gave ++** rise to the Expr. In the latter case, the token is marked as being ++** a compound token. ++** ++** An expression of the form ID or ID.ID refers to a column in a table. ++** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is ++** the integer cursor number of a VDBE cursor pointing to that table and ++** Expr.iColumn is the column number for the specific column. If the ++** expression is used as a result in an aggregate SELECT, then the ++** value is also stored in the Expr.iAgg column in the aggregate so that ++** it can be accessed after all aggregates are computed. ++** ++** If the expression is a function, the Expr.iTable is an integer code ++** representing which function. If the expression is an unbound variable ++** marker (a question mark character '?' in the original SQL) then the ++** Expr.iTable holds the index number for that variable. ++** ++** The Expr.pSelect field points to a SELECT statement. The SELECT might ++** be the right operand of an IN operator. Or, if a scalar SELECT appears ++** in an expression the opcode is TK_SELECT and Expr.pSelect is the only ++** operand. ++*/ ++struct Expr { ++ u8 op; /* Operation performed by this node */ ++ u8 dataType; /* Either SQLITE_SO_TEXT or SQLITE_SO_NUM */ ++ u8 iDb; /* Database referenced by this expression */ ++ u8 flags; /* Various flags. See below */ ++ Expr *pLeft, *pRight; /* Left and right subnodes */ ++ ExprList *pList; /* A list of expressions used as function arguments ++ ** or in " IN (useAgg==TRUE, pull ++ ** result from the iAgg-th element of the aggregator */ ++ Select *pSelect; /* When the expression is a sub-select. Also the ++ ** right side of " IN (
    "; +- BenchMarkCrypto > >("TestData/rsa1024.dat", "RSA 1024", t); +- BenchMarkCrypto > >("TestData/luc1024.dat", "LUC 1024", t); +- BenchMarkCrypto >("TestData/dlie1024.dat", "DLIES 1024", t); +- BenchMarkCrypto >("TestData/lucc512.dat", "LUCELG 512", t); ++ BenchMarkCrypto > >(PACKAGE_DATA_DIR "TestData/rsa1024.dat", "RSA 1024", t); ++ BenchMarkCrypto > >(PACKAGE_DATA_DIR "TestData/luc1024.dat", "LUC 1024", t); ++ BenchMarkCrypto >(PACKAGE_DATA_DIR "TestData/dlie1024.dat", "DLIES 1024", t); ++ BenchMarkCrypto >(PACKAGE_DATA_DIR "TestData/lucc512.dat", "LUCELG 512", t); + + cout << "\n"; +- BenchMarkCrypto > >("TestData/rsa2048.dat", "RSA 2048", t); +- BenchMarkCrypto > >("TestData/luc2048.dat", "LUC 2048", t); +- BenchMarkCrypto >("TestData/dlie2048.dat", "DLIES 2048", t); +- BenchMarkCrypto >("TestData/lucc1024.dat", "LUCELG 1024", t); ++ BenchMarkCrypto > >(PACKAGE_DATA_DIR "TestData/rsa2048.dat", "RSA 2048", t); ++ BenchMarkCrypto > >(PACKAGE_DATA_DIR "TestData/luc2048.dat", "LUC 2048", t); ++ BenchMarkCrypto >(PACKAGE_DATA_DIR "TestData/dlie2048.dat", "DLIES 2048", t); ++ BenchMarkCrypto >(PACKAGE_DATA_DIR "TestData/lucc1024.dat", "LUCELG 1024", t); + + cout << "\n"; +- BenchMarkSignature >("TestData/rsa1024.dat", "RSA 1024", t); +- BenchMarkSignature >("TestData/rw1024.dat", "RW 1024", t); +- BenchMarkSignature >("TestData/luc1024.dat", "LUC 1024", t); +- BenchMarkSignature >("TestData/nr1024.dat", "NR 1024", t); +- BenchMarkSignature("TestData/dsa1024.dat", "DSA 1024", t); +- BenchMarkSignature >("TestData/lucs512.dat", "LUC-HMP 512", t); +- BenchMarkSignature >("TestData/esig1023.dat", "ESIGN 1023", t); +- BenchMarkSignature >("TestData/esig1536.dat", "ESIGN 1536", t); ++ BenchMarkSignature >(PACKAGE_DATA_DIR "TestData/rsa1024.dat", "RSA 1024", t); ++ BenchMarkSignature >(PACKAGE_DATA_DIR "TestData/rw1024.dat", "RW 1024", t); ++ BenchMarkSignature >(PACKAGE_DATA_DIR "TestData/luc1024.dat", "LUC 1024", t); ++ BenchMarkSignature >(PACKAGE_DATA_DIR "TestData/nr1024.dat", "NR 1024", t); ++ BenchMarkSignature(PACKAGE_DATA_DIR "TestData/dsa1024.dat", "DSA 1024", t); ++ BenchMarkSignature >(PACKAGE_DATA_DIR "TestData/lucs512.dat", "LUC-HMP 512", t); ++ BenchMarkSignature >(PACKAGE_DATA_DIR "TestData/esig1023.dat", "ESIGN 1023", t); ++ BenchMarkSignature >(PACKAGE_DATA_DIR "TestData/esig1536.dat", "ESIGN 1536", t); + + cout << "\n"; +- BenchMarkSignature >("TestData/rsa2048.dat", "RSA 2048", t); +- BenchMarkSignature >("TestData/rw2048.dat", "RW 2048", t); +- BenchMarkSignature >("TestData/luc2048.dat", "LUC 2048", t); +- BenchMarkSignature >("TestData/nr2048.dat", "NR 2048", t); +- BenchMarkSignature >("TestData/lucs1024.dat", "LUC-HMP 1024", t); +- BenchMarkSignature >("TestData/esig2046.dat", "ESIGN 2046", t); ++ BenchMarkSignature >(PACKAGE_DATA_DIR "TestData/rsa2048.dat", "RSA 2048", t); ++ BenchMarkSignature >(PACKAGE_DATA_DIR "TestData/rw2048.dat", "RW 2048", t); ++ BenchMarkSignature >(PACKAGE_DATA_DIR "TestData/luc2048.dat", "LUC 2048", t); ++ BenchMarkSignature >(PACKAGE_DATA_DIR "TestData/nr2048.dat", "NR 2048", t); ++ BenchMarkSignature >(PACKAGE_DATA_DIR "TestData/lucs1024.dat", "LUC-HMP 1024", t); ++ BenchMarkSignature >(PACKAGE_DATA_DIR "TestData/esig2046.dat", "ESIGN 2046", t); + + cout << "\n"; +- BenchMarkKeyAgreement("TestData/xtrdh171.dat", "XTR-DH 171", t); +- BenchMarkKeyAgreement("TestData/xtrdh342.dat", "XTR-DH 342", t); +- BenchMarkKeyAgreement("TestData/dh1024.dat", "DH 1024", t); +- BenchMarkKeyAgreement("TestData/dh2048.dat", "DH 2048", t); +- BenchMarkKeyAgreement("TestData/lucd512.dat", "LUCDIF 512", t); +- BenchMarkKeyAgreement("TestData/lucd1024.dat", "LUCDIF 1024", t); +- BenchMarkKeyAgreement("TestData/mqv1024.dat", "MQV 1024", t); +- BenchMarkKeyAgreement("TestData/mqv2048.dat", "MQV 2048", t); ++ BenchMarkKeyAgreement(PACKAGE_DATA_DIR "TestData/xtrdh171.dat", "XTR-DH 171", t); ++ BenchMarkKeyAgreement(PACKAGE_DATA_DIR "TestData/xtrdh342.dat", "XTR-DH 342", t); ++ BenchMarkKeyAgreement(PACKAGE_DATA_DIR "TestData/dh1024.dat", "DH 1024", t); ++ BenchMarkKeyAgreement(PACKAGE_DATA_DIR "TestData/dh2048.dat", "DH 2048", t); ++ BenchMarkKeyAgreement(PACKAGE_DATA_DIR "TestData/lucd512.dat", "LUCDIF 512", t); ++ BenchMarkKeyAgreement(PACKAGE_DATA_DIR "TestData/lucd1024.dat", "LUCDIF 1024", t); ++ BenchMarkKeyAgreement(PACKAGE_DATA_DIR "TestData/mqv1024.dat", "MQV 1024", t); ++ BenchMarkKeyAgreement(PACKAGE_DATA_DIR "TestData/mqv2048.dat", "MQV 2048", t); + + cout << "\n"; + { +Index: libcrypto++/test.cpp +=================================================================== +--- libcrypto++.orig/test.cpp 2009-04-07 03:08:36.000000000 +0200 ++++ libcrypto++/test.cpp 2009-04-07 03:24:04.000000000 +0200 +@@ -337,7 +337,7 @@ + AES_CTR_Encrypt(argv[2], argv[3], argv[4], argv[5]); + else if (command == "h") + { +- FileSource usage("TestData/usage.dat", true, new FileSink(cout)); ++ FileSource usage(PACKAGE_DATA_DIR "TestData/usage.dat", true, new FileSink(cout)); + return 1; + } + else if (command == "V") +Index: libcrypto++/validat1.cpp +=================================================================== +--- libcrypto++.orig/validat1.cpp 2009-04-07 03:08:36.000000000 +0200 ++++ libcrypto++/validat1.cpp 2009-04-07 03:25:57.000000000 +0200 +@@ -508,12 +508,12 @@ + { + cout << "\nDES validation suite running...\n\n"; + +- FileSource valdata("TestData/descert.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/descert.dat", true, new HexDecoder); + bool pass = BlockTransformationTest(FixedRoundsCipherFactory(), valdata); + + cout << "\nTesting EDE2, EDE3, and XEX3 variants...\n\n"; + +- FileSource valdata1("TestData/3desval.dat", true, new HexDecoder); ++ FileSource valdata1(PACKAGE_DATA_DIR "TestData/3desval.dat", true, new HexDecoder); + pass = BlockTransformationTest(FixedRoundsCipherFactory(), valdata1, 1) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(), valdata1, 1) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(), valdata1, 1) && pass; +@@ -855,7 +855,7 @@ + { + cout << "\nIDEA validation suite running...\n\n"; + +- FileSource valdata("TestData/ideaval.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/ideaval.dat", true, new HexDecoder); + return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); + } + +@@ -863,7 +863,7 @@ + { + cout << "\nSAFER validation suite running...\n\n"; + +- FileSource valdata("TestData/saferval.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/saferval.dat", true, new HexDecoder); + bool pass = true; + pass = BlockTransformationTest(VariableRoundsCipherFactory(8,6), valdata, 4) && pass; + pass = BlockTransformationTest(VariableRoundsCipherFactory(16,12), valdata, 4) && pass; +@@ -876,7 +876,7 @@ + { + cout << "\nRC2 validation suite running...\n\n"; + +- FileSource valdata("TestData/rc2val.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/rc2val.dat", true, new HexDecoder); + HexEncoder output(new FileSink(cout)); + SecByteBlock plain(RC2Encryption::BLOCKSIZE), cipher(RC2Encryption::BLOCKSIZE), out(RC2Encryption::BLOCKSIZE), outplain(RC2Encryption::BLOCKSIZE); + SecByteBlock key(128); +@@ -1086,7 +1086,7 @@ + { + cout << "\nRC5 validation suite running...\n\n"; + +- FileSource valdata("TestData/rc5val.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/rc5val.dat", true, new HexDecoder); + return BlockTransformationTest(VariableRoundsCipherFactory(16, 12), valdata); + } + +@@ -1094,7 +1094,7 @@ + { + cout << "\nRC6 validation suite running...\n\n"; + +- FileSource valdata("TestData/rc6val.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/rc6val.dat", true, new HexDecoder); + bool pass = true; + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 2) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 2) && pass; +@@ -1106,7 +1106,7 @@ + { + cout << "\nMARS validation suite running...\n\n"; + +- FileSource valdata("TestData/marsval.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/marsval.dat", true, new HexDecoder); + bool pass = true; + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 4) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 3) && pass; +@@ -1118,7 +1118,7 @@ + { + cout << "\nRijndael (AES) validation suite running...\n\n"; + +- FileSource valdata("TestData/rijndael.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/rijndael.dat", true, new HexDecoder); + bool pass = true; + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 4) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 3) && pass; +@@ -1131,7 +1131,7 @@ + { + cout << "\nTwofish validation suite running...\n\n"; + +- FileSource valdata("TestData/twofishv.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/twofishv.dat", true, new HexDecoder); + bool pass = true; + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 4) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 3) && pass; +@@ -1143,7 +1143,7 @@ + { + cout << "\nSerpent validation suite running...\n\n"; + +- FileSource valdata("TestData/serpentv.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/serpentv.dat", true, new HexDecoder); + bool pass = true; + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 4) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 3) && pass; +@@ -1189,7 +1189,7 @@ + { + cout << "\n3-WAY validation suite running...\n\n"; + +- FileSource valdata("TestData/3wayval.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/3wayval.dat", true, new HexDecoder); + return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); + } + +@@ -1197,7 +1197,7 @@ + { + cout << "\nGOST validation suite running...\n\n"; + +- FileSource valdata("TestData/gostval.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/gostval.dat", true, new HexDecoder); + return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); + } + +@@ -1205,7 +1205,7 @@ + { + cout << "\nSHARK validation suite running...\n\n"; + +- FileSource valdata("TestData/sharkval.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/sharkval.dat", true, new HexDecoder); + return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); + } + +@@ -1215,14 +1215,14 @@ + + cout << "\nCAST-128 validation suite running...\n\n"; + +- FileSource val128("TestData/cast128v.dat", true, new HexDecoder); ++ FileSource val128(PACKAGE_DATA_DIR "TestData/cast128v.dat", true, new HexDecoder); + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), val128, 1) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(10), val128, 1) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(5), val128, 1) && pass; + + cout << "\nCAST-256 validation suite running...\n\n"; + +- FileSource val256("TestData/cast256v.dat", true, new HexDecoder); ++ FileSource val256(PACKAGE_DATA_DIR "TestData/cast256v.dat", true, new HexDecoder); + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), val256, 1) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(24), val256, 1) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(32), val256, 1) && pass; +@@ -1234,7 +1234,7 @@ + { + cout << "\nSquare validation suite running...\n\n"; + +- FileSource valdata("TestData/squareva.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/squareva.dat", true, new HexDecoder); + return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); + } + +@@ -1242,7 +1242,7 @@ + { + cout << "\nSKIPJACK validation suite running...\n\n"; + +- FileSource valdata("TestData/skipjack.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/skipjack.dat", true, new HexDecoder); + return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); + } + +@@ -1346,7 +1346,7 @@ + cout << "\nSHACAL-2 validation suite running...\n\n"; + + bool pass = true; +- FileSource valdata("TestData/shacal2v.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/shacal2v.dat", true, new HexDecoder); + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 4) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(64), valdata, 10) && pass; + return pass; +@@ -1357,7 +1357,7 @@ + cout << "\nCamellia validation suite running...\n\n"; + + bool pass = true; +- FileSource valdata("TestData/camellia.dat", true, new HexDecoder); ++ FileSource valdata(PACKAGE_DATA_DIR "TestData/camellia.dat", true, new HexDecoder); + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 15) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 15) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 15) && pass; +@@ -1368,19 +1368,19 @@ + { + cout << "\nSalsa validation suite running...\n"; + +- return RunTestDataFile("TestVectors/salsa.txt"); ++ return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/salsa.txt"); + } + + bool ValidateSosemanuk() + { + cout << "\nSosemanuk validation suite running...\n"; +- return RunTestDataFile("TestVectors/sosemanuk.txt"); ++ return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/sosemanuk.txt"); + } + + bool ValidateVMAC() + { + cout << "\nVMAC validation suite running...\n"; +- return RunTestDataFile("TestVectors/vmac.txt"); ++ return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/vmac.txt"); + } + + bool ValidateCCM() +Index: libcrypto++/validat2.cpp +=================================================================== +--- libcrypto++.orig/validat2.cpp 2009-04-07 03:08:36.000000000 +0200 ++++ libcrypto++/validat2.cpp 2009-04-07 03:28:02.000000000 +0200 +@@ -268,7 +268,7 @@ + "\x69\x94\xac\x04\xf3\x41\xb5\x7d\x05\x20\x2d\x42\x8f\xb2\xa2\x7b" + "\x5c\x77\xdf\xd9\xb1\x5b\xfc\x3d\x55\x93\x53\x50\x34\x10\xc1\xe1"; + +- FileSource keys("TestData/rsa512a.dat", true, new HexDecoder); ++ FileSource keys(PACKAGE_DATA_DIR "TestData/rsa512a.dat", true, new HexDecoder); + Weak::RSASSA_PKCS1v15_MD2_Signer rsaPriv(keys); + Weak::RSASSA_PKCS1v15_MD2_Verifier rsaPub(rsaPriv); + +@@ -293,7 +293,7 @@ + cout << "invalid signature verification\n"; + } + { +- FileSource keys("TestData/rsa1024.dat", true, new HexDecoder); ++ FileSource keys(PACKAGE_DATA_DIR "TestData/rsa1024.dat", true, new HexDecoder); + RSAES_PKCS1v15_Decryptor rsaPriv(keys); + RSAES_PKCS1v15_Encryptor rsaPub(rsaPriv); + +@@ -320,8 +320,8 @@ + bq.Put(oaepSeed, 20); + FixedRNG rng(bq); + +- FileSource privFile("TestData/rsa400pv.dat", true, new HexDecoder); +- FileSource pubFile("TestData/rsa400pb.dat", true, new HexDecoder); ++ FileSource privFile(PACKAGE_DATA_DIR "TestData/rsa400pv.dat", true, new HexDecoder); ++ FileSource pubFile(PACKAGE_DATA_DIR "TestData/rsa400pb.dat", true, new HexDecoder); + RSAES_OAEP_SHA_Decryptor rsaPriv; + rsaPriv.AccessKey().BERDecodePrivateKey(privFile, false, 0); + RSAES_OAEP_SHA_Encryptor rsaPub(pubFile); +@@ -344,7 +344,7 @@ + { + cout << "\nDH validation suite running...\n\n"; + +- FileSource f("TestData/dh1024.dat", true, new HexDecoder()); ++ FileSource f(PACKAGE_DATA_DIR "TestData/dh1024.dat", true, new HexDecoder()); + DH dh(f); + return SimpleKeyAgreementValidate(dh); + } +@@ -353,7 +353,7 @@ + { + cout << "\nMQV validation suite running...\n\n"; + +- FileSource f("TestData/mqv1024.dat", true, new HexDecoder()); ++ FileSource f(PACKAGE_DATA_DIR "TestData/mqv1024.dat", true, new HexDecoder()); + MQV mqv(f); + return AuthenticatedKeyAgreementValidate(mqv); + } +@@ -362,7 +362,7 @@ + { + cout << "\nLUC-DH validation suite running...\n\n"; + +- FileSource f("TestData/lucd512.dat", true, new HexDecoder()); ++ FileSource f(PACKAGE_DATA_DIR "TestData/lucd512.dat", true, new HexDecoder()); + LUC_DH dh(f); + return SimpleKeyAgreementValidate(dh); + } +@@ -371,7 +371,7 @@ + { + cout << "\nXTR-DH validation suite running...\n\n"; + +- FileSource f("TestData/xtrdh171.dat", true, new HexDecoder()); ++ FileSource f(PACKAGE_DATA_DIR "TestData/xtrdh171.dat", true, new HexDecoder()); + XTR_DH dh(f); + return SimpleKeyAgreementValidate(dh); + } +@@ -381,7 +381,7 @@ + cout << "\nElGamal validation suite running...\n\n"; + bool pass = true; + { +- FileSource fc("TestData/elgc1024.dat", true, new HexDecoder); ++ FileSource fc(PACKAGE_DATA_DIR "TestData/elgc1024.dat", true, new HexDecoder); + ElGamalDecryptor privC(fc); + ElGamalEncryptor pubC(privC); + privC.AccessKey().Precompute(); +@@ -399,7 +399,7 @@ + cout << "\nDLIES validation suite running...\n\n"; + bool pass = true; + { +- FileSource fc("TestData/dlie1024.dat", true, new HexDecoder); ++ FileSource fc(PACKAGE_DATA_DIR "TestData/dlie1024.dat", true, new HexDecoder); + DLIES<>::Decryptor privC(fc); + DLIES<>::Encryptor pubC(privC); + pass = CryptoSystemValidate(privC, pubC) && pass; +@@ -422,7 +422,7 @@ + cout << "\nNR validation suite running...\n\n"; + bool pass = true; + { +- FileSource f("TestData/nr2048.dat", true, new HexDecoder); ++ FileSource f(PACKAGE_DATA_DIR "TestData/nr2048.dat", true, new HexDecoder); + NR::Signer privS(f); + privS.AccessKey().Precompute(); + NR::Verifier pubS(privS); +@@ -445,7 +445,7 @@ + + bool pass = true, fail; + { +- FileSource fs("TestData/dsa512.dat", true, new HexDecoder()); ++ FileSource fs(PACKAGE_DATA_DIR "TestData/dsa512.dat", true, new HexDecoder()); + GDSA::Signer priv(fs); + priv.AccessKey().Precompute(16); + GDSA::Verifier pub(priv); +@@ -487,10 +487,10 @@ + fail = pub.VerifyMessage((byte *)"xyz", 3, sig, sizeof(sig)); + pass = pass && !fail; + } +- FileSource fs1("TestData/dsa1024.dat", true, new HexDecoder()); ++ FileSource fs1(PACKAGE_DATA_DIR "TestData/dsa1024.dat", true, new HexDecoder()); + DSA::Signer priv(fs1); + DSA::Verifier pub(priv); +- FileSource fs2("TestData/dsa1024b.dat", true, new HexDecoder()); ++ FileSource fs2(PACKAGE_DATA_DIR "TestData/dsa1024b.dat", true, new HexDecoder()); + DSA::Verifier pub1(fs2); + assert(pub.GetKey() == pub1.GetKey()); + pass = SignatureValidate(priv, pub, thorough) && pass; +@@ -503,7 +503,7 @@ + bool pass=true; + + { +- FileSource f("TestData/luc1024.dat", true, new HexDecoder); ++ FileSource f(PACKAGE_DATA_DIR "TestData/luc1024.dat", true, new HexDecoder); + LUCSSA_PKCS1v15_SHA_Signer priv(f); + LUCSSA_PKCS1v15_SHA_Verifier pub(priv); + pass = SignatureValidate(priv, pub) && pass; +@@ -520,14 +520,14 @@ + { + cout << "\nLUC-HMP validation suite running...\n\n"; + +- FileSource f("TestData/lucs512.dat", true, new HexDecoder); ++ FileSource f(PACKAGE_DATA_DIR "TestData/lucs512.dat", true, new HexDecoder); + LUC_HMP::Signer privS(f); + LUC_HMP::Verifier pubS(privS); + bool pass = SignatureValidate(privS, pubS); + + cout << "\nLUC-IES validation suite running...\n\n"; + +- FileSource fc("TestData/lucc512.dat", true, new HexDecoder); ++ FileSource fc(PACKAGE_DATA_DIR "TestData/lucc512.dat", true, new HexDecoder); + LUC_IES<>::Decryptor privC(fc); + LUC_IES<>::Encryptor pubC(privC); + pass = CryptoSystemValidate(privC, pubC) && pass; +@@ -541,7 +541,7 @@ + bool pass=true; + + { +- FileSource f("TestData/rabi1024.dat", true, new HexDecoder); ++ FileSource f(PACKAGE_DATA_DIR "TestData/rabi1024.dat", true, new HexDecoder); + RabinSS::Signer priv(f); + RabinSS::Verifier pub(priv); + pass = SignatureValidate(priv, pub) && pass; +@@ -558,7 +558,7 @@ + { + cout << "\nRW validation suite running...\n\n"; + +- FileSource f("TestData/rw1024.dat", true, new HexDecoder); ++ FileSource f(PACKAGE_DATA_DIR "TestData/rw1024.dat", true, new HexDecoder); + RWSS::Signer priv(f); + RWSS::Verifier pub(priv); + +@@ -570,7 +570,7 @@ + { + cout << "\nBlumGoldwasser validation suite running...\n\n"; + +- FileSource f("TestData/blum512.dat", true, new HexDecoder); ++ FileSource f(PACKAGE_DATA_DIR "TestData/blum512.dat", true, new HexDecoder); + BlumGoldwasserPrivateKey priv(f); + BlumGoldwasserPublicKey pub(priv); + +@@ -740,7 +740,7 @@ + "\x74\x02\x37\x0E\xED\x0A\x06\xAD\xF4\x15\x65\xB8\xE1\xD1\x45\xAE\x39\x19\xB4\xFF\x5D\xF1\x45\x7B\xE0\xFE\x72\xED\x11\x92\x8F\x61\x41\x4F\x02\x00\xF2\x76\x6F\x7C" + "\x79\xA2\xE5\x52\x20\x5D\x97\x5E\xFE\x39\xAE\x21\x10\xFB\x35\xF4\x80\x81\x41\x13\xDD\xE8\x5F\xCA\x1E\x4F\xF8\x9B\xB2\x68\xFB\x28"; + +- FileSource keys("TestData/esig1536.dat", true, new HexDecoder); ++ FileSource keys(PACKAGE_DATA_DIR "TestData/esig1536.dat", true, new HexDecoder); + ESIGN::Signer signer(keys); + ESIGN::Verifier verifier(signer); + +Index: libcrypto++/validat3.cpp +=================================================================== +--- libcrypto++.orig/validat3.cpp 2009-04-07 03:08:36.000000000 +0200 ++++ libcrypto++/validat3.cpp 2009-04-07 03:29:42.000000000 +0200 +@@ -365,14 +365,14 @@ + { + cout << "\nPanama validation suite running...\n"; + +- return RunTestDataFile("TestVectors/panama.txt"); ++ return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/panama.txt"); + } + + bool ValidateWhirlpool() + { + cout << "\nWhirlpool Hash Function validation suite running...\n"; + +- return RunTestDataFile("TestVectors/whrlpool.txt"); ++ return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/whrlpool.txt"); + } + + #ifdef CRYPTOPP_REMOVED diff --git a/libs/libcrypto++/patches/003-autoconf_files.patch b/libs/libcrypto++/patches/003-autoconf_files.patch new file mode 100644 index 0000000..16ea3ff --- /dev/null +++ b/libs/libcrypto++/patches/003-autoconf_files.patch @@ -0,0 +1,822 @@ +--- /dev/null 2009-09-20 12:09:29.503935207 +0200 ++++ debian/configure.ac 2009-09-20 18:51:50.000000000 +0200 +@@ -0,0 +1,43 @@ ++# -*- autoconf -*- ++# Process this file with autoconf to produce a configure script. ++# Written by Jens Peter Secher . ++ ++AC_INIT([Crypto++], [5.6.0], [libcrypto++@bugs.debian.org]) ++AC_CONFIG_SRCDIR([cryptlib.h]) ++AC_CONFIG_HEADERS([cryptopp_config.h]) ++AC_CONFIG_HEADERS([config.h]) ++AM_INIT_AUTOMAKE([foreign]) ++AM_MAINTAINER_MODE ++ ++# Checks for programs. ++AC_PROG_CXX ++AC_PROG_CC ++AC_PROG_LN_S ++AC_PROG_LIBTOOL ++ ++# Checks for header files. ++AC_HEADER_STDC ++AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h malloc.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h]) ++ ++# Checks for typedefs, structures, and compiler characteristics. ++AC_HEADER_STDBOOL ++AC_C_CONST ++AC_C_INLINE ++AC_TYPE_SIZE_T ++AC_HEADER_TIME ++AC_CHECK_TYPES([ptrdiff_t]) ++AC_C_BIGENDIAN( ++ AC_DEFINE(IS_BIG_ENDIAN, [], [Big-endian architecture]), ++ AC_DEFINE(IS_LITTLE_ENDIAN, [], [Little-endian architecture]), ++ AC_MSG_ERROR([Can't tell endianess of platform])) ++ ++# Checks for library functions. ++AC_PROG_GCC_TRADITIONAL ++AC_FUNC_MALLOC ++AC_FUNC_MEMCMP ++AC_FUNC_SELECT_ARGTYPES ++AC_TYPE_SIGNAL ++AC_CHECK_FUNCS([gethostbyname gettimeofday memmove memset pow select socket]) ++ ++AC_CONFIG_FILES([Makefile libcrypto++.pc]) ++AC_OUTPUT +--- /dev/null 2009-09-20 12:09:29.503935207 +0200 ++++ debian/Makefile.am 2009-09-20 18:51:50.000000000 +0200 +@@ -0,0 +1,303 @@ ++## Process this file with automake to produce Makefile.in ++# Written by Jens Peter Secher . ++ ++# Build two versions of cryptest, one that uses data files from the ++# current working directory, and one that uses data files from ++# /usr/share/crypto++. The former is for running the test suite at ++# build time, the latter is included in the package. ++ ++# To test against newest GCC, uncomment the following two lines. ++#CXX = /usr/lib/gcc-snapshot/bin/g++ ++#CXXCPP = /usr/lib/gcc-snapshot/bin/g++ ++ ++bin_PROGRAMS = cryptest cryptestcwd ++cryptest_CXXFLAGS = -DPACKAGE_DATA_DIR='"/usr/share/crypto++/"' ++cryptest_SOURCES = \ ++ bench.cpp \ ++ bench2.cpp \ ++ datatest.cpp \ ++ dlltest.cpp \ ++ fipsalgt.cpp \ ++ regtest.cpp \ ++ test.cpp \ ++ validat1.cpp \ ++ validat2.cpp \ ++ validat3.cpp ++cryptest_LDADD = libcrypto++.la ++cryptestcwd_CXXFLAGS = -DPACKAGE_DATA_DIR='""' ++cryptestcwd_SOURCES = \ ++ bench.cpp \ ++ bench2.cpp \ ++ datatest.cpp \ ++ dlltest.cpp \ ++ fipsalgt.cpp \ ++ regtest.cpp \ ++ test.cpp \ ++ validat1.cpp \ ++ validat2.cpp \ ++ validat3.cpp ++cryptestcwd_LDADD = libcrypto++.la ++ ++lib_LTLIBRARIES = libcrypto++.la ++libcrypto___la_LDFLAGS = -version-info 8:0:0 ++libcrypto___la_SOURCES = \ ++ 3way.cpp \ ++ adler32.cpp \ ++ algebra.cpp \ ++ algparam.cpp \ ++ arc4.cpp \ ++ asn.cpp \ ++ authenc.cpp \ ++ base32.cpp \ ++ base64.cpp \ ++ basecode.cpp \ ++ bfinit.cpp \ ++ blowfish.cpp \ ++ blumshub.cpp \ ++ camellia.cpp \ ++ cast.cpp \ ++ casts.cpp \ ++ cbcmac.cpp \ ++ ccm.cpp \ ++ channels.cpp \ ++ cmac.cpp \ ++ cpu.cpp \ ++ crc.cpp \ ++ cryptlib.cpp \ ++ default.cpp \ ++ des.cpp \ ++ dessp.cpp \ ++ dh2.cpp \ ++ dh.cpp \ ++ dll.cpp \ ++ dsa.cpp \ ++ eax.cpp \ ++ ec2n.cpp \ ++ eccrypto.cpp \ ++ ecp.cpp \ ++ elgamal.cpp \ ++ emsa2.cpp \ ++ eprecomp.cpp \ ++ esign.cpp \ ++ files.cpp \ ++ filters.cpp \ ++ fips140.cpp \ ++ fipstest.cpp \ ++ gcm.cpp \ ++ gf2_32.cpp \ ++ gf256.cpp \ ++ gf2n.cpp \ ++ gfpcrypt.cpp \ ++ gost.cpp \ ++ gzip.cpp \ ++ hex.cpp \ ++ hmac.cpp \ ++ hrtimer.cpp \ ++ ida.cpp \ ++ idea.cpp \ ++ integer.cpp \ ++ iterhash.cpp \ ++ luc.cpp \ ++ mars.cpp \ ++ marss.cpp \ ++ md2.cpp \ ++ md4.cpp \ ++ md5.cpp \ ++ misc.cpp \ ++ modes.cpp \ ++ mqueue.cpp \ ++ mqv.cpp \ ++ nbtheory.cpp \ ++ network.cpp \ ++ oaep.cpp \ ++ osrng.cpp \ ++ panama.cpp \ ++ pch.cpp \ ++ pkcspad.cpp \ ++ polynomi.cpp \ ++ pssr.cpp \ ++ pubkey.cpp \ ++ queue.cpp \ ++ rabin.cpp \ ++ randpool.cpp \ ++ rc2.cpp \ ++ rc5.cpp \ ++ rc6.cpp \ ++ rdtables.cpp \ ++ rijndael.cpp \ ++ ripemd.cpp \ ++ rng.cpp \ ++ rsa.cpp \ ++ rw.cpp \ ++ safer.cpp \ ++ salsa.cpp \ ++ seal.cpp \ ++ seed.cpp \ ++ serpent.cpp \ ++ shacal2.cpp \ ++ sha.cpp \ ++ sharkbox.cpp \ ++ shark.cpp \ ++ simple.cpp \ ++ skipjack.cpp \ ++ socketft.cpp \ ++ sosemanuk.cpp \ ++ square.cpp \ ++ squaretb.cpp \ ++ strciphr.cpp \ ++ tea.cpp \ ++ tftables.cpp \ ++ tiger.cpp \ ++ tigertab.cpp \ ++ trdlocal.cpp \ ++ ttmac.cpp \ ++ twofish.cpp \ ++ vmac.cpp \ ++ wait.cpp \ ++ wake.cpp \ ++ whrlpool.cpp \ ++ winpipes.cpp \ ++ xtr.cpp \ ++ xtrcrypt.cpp \ ++ zdeflate.cpp \ ++ zinflate.cpp \ ++ zlib.cpp ++ ++pkginclude_HEADERS = \ ++ 3way.h \ ++ adler32.h \ ++ aes.h \ ++ algebra.h \ ++ algparam.h \ ++ arc4.h \ ++ argnames.h \ ++ asn.h \ ++ authenc.h \ ++ base32.h \ ++ base64.h \ ++ basecode.h \ ++ bench.h \ ++ blowfish.h \ ++ blumshub.h \ ++ camellia.h \ ++ cast.h \ ++ cbcmac.h \ ++ ccm.h \ ++ channels.h \ ++ cmac.h \ ++ config.h \ ++ cpu.h \ ++ crc.h \ ++ cryptlib.h \ ++ default.h \ ++ des.h \ ++ dh2.h \ ++ dh.h \ ++ dll.h \ ++ dmac.h \ ++ dsa.h \ ++ eax.h \ ++ ec2n.h \ ++ eccrypto.h \ ++ ecp.h \ ++ elgamal.h \ ++ emsa2.h \ ++ eprecomp.h \ ++ esign.h \ ++ factory.h \ ++ files.h \ ++ filters.h \ ++ fips140.h \ ++ fltrimpl.h \ ++ gcm.h \ ++ gf2_32.h \ ++ gf256.h \ ++ gf2n.h \ ++ gfpcrypt.h \ ++ gost.h \ ++ gzip.h \ ++ hex.h \ ++ hmac.h \ ++ hrtimer.h \ ++ ida.h \ ++ idea.h \ ++ integer.h \ ++ iterhash.h \ ++ lubyrack.h \ ++ luc.h \ ++ mars.h \ ++ md2.h \ ++ md4.h \ ++ md5.h \ ++ mdc.h \ ++ misc.h \ ++ modarith.h \ ++ modes.h \ ++ modexppc.h \ ++ mqueue.h \ ++ mqv.h \ ++ nbtheory.h \ ++ network.h \ ++ nr.h \ ++ oaep.h \ ++ oids.h \ ++ osrng.h \ ++ panama.h \ ++ pch.h \ ++ pkcspad.h \ ++ polynomi.h \ ++ pssr.h \ ++ pubkey.h \ ++ pwdbased.h \ ++ queue.h \ ++ rabin.h \ ++ randpool.h \ ++ rc2.h \ ++ rc5.h \ ++ rc6.h \ ++ rijndael.h \ ++ ripemd.h \ ++ rng.h \ ++ rsa.h \ ++ rw.h \ ++ safer.h \ ++ salsa.h \ ++ seal.h \ ++ secblock.h \ ++ seckey.h \ ++ seed.h \ ++ serpent.h \ ++ serpentp.h \ ++ shacal2.h \ ++ sha.h \ ++ shark.h \ ++ simple.h \ ++ skipjack.h \ ++ smartptr.h \ ++ socketft.h \ ++ sosemanuk.h \ ++ square.h \ ++ stdcpp.h \ ++ strciphr.h \ ++ tea.h \ ++ tiger.h \ ++ trdlocal.h \ ++ trunhash.h \ ++ ttmac.h \ ++ twofish.h \ ++ vmac.h \ ++ wait.h \ ++ wake.h \ ++ whrlpool.h \ ++ winpipes.h \ ++ words.h \ ++ xtr.h \ ++ xtrcrypt.h \ ++ zdeflate.h \ ++ zinflate.h \ ++ zlib.h ++ ++htmldir = $(datadir)/html ++ ++html: $(libcrypto___la_SOURCES) ++ doxygen +--- /dev/null 2009-09-20 12:09:29.503935207 +0200 ++++ debian/config.h.in 2009-09-20 18:51:50.000000000 +0200 +@@ -0,0 +1,452 @@ ++// Debian note: This is a copy of the original config.h file except for the two ++// endianness undefs below; they are substituted by the autoconf process ++// according to the build architecture. ++ ++#ifndef CRYPTOPP_CONFIG_H ++#define CRYPTOPP_CONFIG_H ++ ++// ***************** Important Settings ******************** ++ ++// Endianness ++#undef IS_BIG_ENDIAN ++#undef IS_LITTLE_ENDIAN ++ ++// define this if you want to disable all OS-dependent features, ++// such as sockets and OS-provided random number generators ++// #define NO_OS_DEPENDENCE ++ ++// Define this to use features provided by Microsoft's CryptoAPI. ++// Currently the only feature used is random number generation. ++// This macro will be ignored if NO_OS_DEPENDENCE is defined. ++#define USE_MS_CRYPTOAPI ++ ++// Define this to 1 to enforce the requirement in FIPS 186-2 Change Notice 1 that only 1024 bit moduli be used ++#ifndef DSA_1024_BIT_MODULUS_ONLY ++# define DSA_1024_BIT_MODULUS_ONLY 1 ++#endif ++ ++// ***************** Less Important Settings *************** ++ ++// define this to retain (as much as possible) old deprecated function and class names ++// #define CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY ++ ++#define GZIP_OS_CODE 0 ++ ++// Try this if your CPU has 256K internal cache or a slow multiply instruction ++// and you want a (possibly) faster IDEA implementation using log tables ++// #define IDEA_LARGECACHE ++ ++// Define this if, for the linear congruential RNG, you want to use ++// the original constants as specified in S.K. Park and K.W. Miller's ++// CACM paper. ++// #define LCRNG_ORIGINAL_NUMBERS ++ ++// choose which style of sockets to wrap (mostly useful for cygwin which has both) ++#define PREFER_BERKELEY_STYLE_SOCKETS ++// #define PREFER_WINDOWS_STYLE_SOCKETS ++ ++// set the name of Rijndael cipher, was "Rijndael" before version 5.3 ++#define CRYPTOPP_RIJNDAEL_NAME "AES" ++ ++// ***************** Important Settings Again ******************** ++// But the defaults should be ok. ++ ++// namespace support is now required ++#ifdef NO_NAMESPACE ++# error namespace support is now required ++#endif ++ ++// Define this to workaround a Microsoft CryptoAPI bug where ++// each call to CryptAcquireContext causes a 100 KB memory leak. ++// Defining this will cause Crypto++ to make only one call to CryptAcquireContext. ++#define WORKAROUND_MS_BUG_Q258000 ++ ++#ifdef CRYPTOPP_DOXYGEN_PROCESSING ++// Avoid putting "CryptoPP::" in front of everything in Doxygen output ++# define CryptoPP ++# define NAMESPACE_BEGIN(x) ++# define NAMESPACE_END ++// Get Doxygen to generate better documentation for these typedefs ++# define DOCUMENTED_TYPEDEF(x, y) class y : public x {}; ++#else ++# define NAMESPACE_BEGIN(x) namespace x { ++# define NAMESPACE_END } ++# define DOCUMENTED_TYPEDEF(x, y) typedef x y; ++#endif ++#define ANONYMOUS_NAMESPACE_BEGIN namespace { ++#define USING_NAMESPACE(x) using namespace x; ++#define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x { ++#define DOCUMENTED_NAMESPACE_END } ++ ++// What is the type of the third parameter to bind? ++// For Unix, the new standard is ::socklen_t (typically unsigned int), and the old standard is int. ++// Unfortunately there is no way to tell whether or not socklen_t is defined. ++// To work around this, TYPE_OF_SOCKLEN_T is a macro so that you can change it from the makefile. ++#ifndef TYPE_OF_SOCKLEN_T ++# if defined(_WIN32) || defined(__CYGWIN__) ++# define TYPE_OF_SOCKLEN_T int ++# else ++# define TYPE_OF_SOCKLEN_T ::socklen_t ++# endif ++#endif ++ ++#if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS) ++# define __USE_W32_SOCKETS ++#endif ++ ++typedef unsigned char byte; // put in global namespace to avoid ambiguity with other byte typedefs ++ ++NAMESPACE_BEGIN(CryptoPP) ++ ++typedef unsigned short word16; ++typedef unsigned int word32; ++ ++#if defined(_MSC_VER) || defined(__BORLANDC__) ++ typedef unsigned __int64 word64; ++ #define W64LIT(x) x##ui64 ++#else ++ typedef unsigned long long word64; ++ #define W64LIT(x) x##ULL ++#endif ++ ++// define large word type, used for file offsets and such ++typedef word64 lword; ++const lword LWORD_MAX = W64LIT(0xffffffffffffffff); ++ ++#ifdef __GNUC__ ++ #define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) ++#endif ++ ++// define hword, word, and dword. these are used for multiprecision integer arithmetic ++// Intel compiler won't have _umul128 until version 10.0. See http://softwarecommunity.intel.com/isn/Community/en-US/forums/thread/30231625.aspx ++#if (defined(_MSC_VER) && (!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1000) && (defined(_M_X64) || defined(_M_IA64))) || (defined(__DECCXX) && defined(__alpha__)) || (defined(__INTEL_COMPILER) && defined(__x86_64__)) || (defined(__SUNPRO_CC) && defined(__x86_64__)) ++ typedef word32 hword; ++ typedef word64 word; ++#else ++ #define CRYPTOPP_NATIVE_DWORD_AVAILABLE ++ #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64) || defined(__sparc64__) ++ #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !(CRYPTOPP_GCC_VERSION == 40001 && defined(__APPLE__)) && CRYPTOPP_GCC_VERSION >= 30400 ++ // GCC 4.0.1 on MacOS X is missing __umodti3 and __udivti3 ++ // mode(TI) division broken on amd64 with GCC earlier than GCC 3.4 ++ typedef word32 hword; ++ typedef word64 word; ++ typedef __uint128_t dword; ++ typedef __uint128_t word128; ++ #define CRYPTOPP_WORD128_AVAILABLE ++ #else ++ // if we're here, it means we're on a 64-bit CPU but we don't have a way to obtain 128-bit multiplication results ++ typedef word16 hword; ++ typedef word32 word; ++ typedef word64 dword; ++ #endif ++ #else ++ // being here means the native register size is probably 32 bits or less ++ #define CRYPTOPP_BOOL_SLOW_WORD64 1 ++ typedef word16 hword; ++ typedef word32 word; ++ typedef word64 dword; ++ #endif ++#endif ++#ifndef CRYPTOPP_BOOL_SLOW_WORD64 ++ #define CRYPTOPP_BOOL_SLOW_WORD64 0 ++#endif ++ ++const unsigned int WORD_SIZE = sizeof(word); ++const unsigned int WORD_BITS = WORD_SIZE * 8; ++ ++NAMESPACE_END ++ ++#ifndef CRYPTOPP_L1_CACHE_LINE_SIZE ++ // This should be a lower bound on the L1 cache line size. It's used for defense against timing attacks. ++ #if defined(_M_X64) || defined(__x86_64__) ++ #define CRYPTOPP_L1_CACHE_LINE_SIZE 64 ++ #else ++ // L1 cache line size is 32 on Pentium III and earlier ++ #define CRYPTOPP_L1_CACHE_LINE_SIZE 32 ++ #endif ++#endif ++ ++#if defined(_MSC_VER) ++ #if _MSC_VER == 1200 ++ #include ++ #endif ++ #if _MSC_VER > 1200 || defined(_mm_free) ++ #define CRYPTOPP_MSVC6PP_OR_LATER // VC 6 processor pack or later ++ #else ++ #define CRYPTOPP_MSVC6_NO_PP // VC 6 without processor pack ++ #endif ++#endif ++ ++#ifndef CRYPTOPP_ALIGN_DATA ++ #if defined(CRYPTOPP_MSVC6PP_OR_LATER) ++ #define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x)) ++ #elif defined(__GNUC__) ++ #define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x))) ++ #else ++ #define CRYPTOPP_ALIGN_DATA(x) ++ #endif ++#endif ++ ++#ifndef CRYPTOPP_SECTION_ALIGN16 ++ #if defined(__GNUC__) && !defined(__APPLE__) ++ // the alignment attribute doesn't seem to work without this section attribute when -fdata-sections is turned on ++ #define CRYPTOPP_SECTION_ALIGN16 __attribute__((section ("CryptoPP_Align16"))) ++ #else ++ #define CRYPTOPP_SECTION_ALIGN16 ++ #endif ++#endif ++ ++#if defined(_MSC_VER) || defined(__fastcall) ++ #define CRYPTOPP_FASTCALL __fastcall ++#else ++ #define CRYPTOPP_FASTCALL ++#endif ++ ++// VC60 workaround: it doesn't allow typename in some places ++#if defined(_MSC_VER) && (_MSC_VER < 1300) ++#define CPP_TYPENAME ++#else ++#define CPP_TYPENAME typename ++#endif ++ ++// VC60 workaround: can't cast unsigned __int64 to float or double ++#if defined(_MSC_VER) && !defined(CRYPTOPP_MSVC6PP_OR_LATER) ++#define CRYPTOPP_VC6_INT64 (__int64) ++#else ++#define CRYPTOPP_VC6_INT64 ++#endif ++ ++#ifdef _MSC_VER ++#define CRYPTOPP_NO_VTABLE __declspec(novtable) ++#else ++#define CRYPTOPP_NO_VTABLE ++#endif ++ ++#ifdef _MSC_VER ++ // 4231: nonstandard extension used : 'extern' before template explicit instantiation ++ // 4250: dominance ++ // 4251: member needs to have dll-interface ++ // 4275: base needs to have dll-interface ++ // 4660: explicitly instantiating a class that's already implicitly instantiated ++ // 4661: no suitable definition provided for explicit template instantiation request ++ // 4786: identifer was truncated in debug information ++ // 4355: 'this' : used in base member initializer list ++ // 4910: '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation ++# pragma warning(disable: 4231 4250 4251 4275 4660 4661 4786 4355 4910) ++#endif ++ ++#ifdef __BORLANDC__ ++// 8037: non-const function called for const object. needed to work around BCB2006 bug ++# pragma warn -8037 ++#endif ++ ++#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || defined(_STLPORT_VERSION) ++#define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION ++#endif ++ ++#ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION ++#define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE ++#endif ++ ++#ifdef CRYPTOPP_DISABLE_X86ASM // for backwards compatibility: this macro had both meanings ++#define CRYPTOPP_DISABLE_ASM ++#define CRYPTOPP_DISABLE_SSE2 ++#endif ++ ++#if !defined(CRYPTOPP_DISABLE_ASM) && ((defined(_MSC_VER) && defined(_M_IX86)) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))) ++ #define CRYPTOPP_X86_ASM_AVAILABLE ++ ++ #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || CRYPTOPP_GCC_VERSION >= 30300) ++ #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 1 ++ #else ++ #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0 ++ #endif ++ ++ // SSSE3 was actually introduced in GNU as 2.17, which was released 6/23/2006, but we can't tell what version of binutils is installed. ++ // GCC 4.1.2 was released on 2/13/2007, so we'll use that as a proxy for the binutils version. ++ #if !defined(CRYPTOPP_DISABLE_SSSE3) && (_MSC_VER >= 1400 || CRYPTOPP_GCC_VERSION >= 40102) ++ #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 1 ++ #else ++ #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0 ++ #endif ++#endif ++ ++#if !defined(CRYPTOPP_DISABLE_ASM) && defined(_MSC_VER) && defined(_M_X64) ++ #define CRYPTOPP_X64_MASM_AVAILABLE ++#endif ++ ++#if !defined(CRYPTOPP_DISABLE_ASM) && defined(__GNUC__) && defined(__x86_64__) ++ #define CRYPTOPP_X64_ASM_AVAILABLE ++#endif ++ ++#if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || defined(__SSE2__)) ++ #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 1 ++#else ++ #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 0 ++#endif ++ ++#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) ++ #define CRYPTOPP_BOOL_ALIGN16_ENABLED 1 ++#else ++ #define CRYPTOPP_BOOL_ALIGN16_ENABLED 0 ++#endif ++ ++// how to allocate 16-byte aligned memory (for SSE2) ++#if defined(CRYPTOPP_MSVC6PP_OR_LATER) ++ #define CRYPTOPP_MM_MALLOC_AVAILABLE ++#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) ++ #define CRYPTOPP_MALLOC_ALIGNMENT_IS_16 ++#elif defined(__linux__) || defined(__sun__) || defined(__CYGWIN__) ++ #define CRYPTOPP_MEMALIGN_AVAILABLE ++#else ++ #define CRYPTOPP_NO_ALIGNED_ALLOC ++#endif ++ ++// how to disable inlining ++#if defined(_MSC_VER) && _MSC_VER >= 1300 ++# define CRYPTOPP_NOINLINE_DOTDOTDOT ++# define CRYPTOPP_NOINLINE __declspec(noinline) ++#elif defined(__GNUC__) ++# define CRYPTOPP_NOINLINE_DOTDOTDOT ++# define CRYPTOPP_NOINLINE __attribute__((noinline)) ++#else ++# define CRYPTOPP_NOINLINE_DOTDOTDOT ... ++# define CRYPTOPP_NOINLINE ++#endif ++ ++// how to declare class constants ++#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__INTEL_COMPILER) ++# define CRYPTOPP_CONSTANT(x) enum {x}; ++#else ++# define CRYPTOPP_CONSTANT(x) static const int x; ++#endif ++ ++#if defined(_M_X64) || defined(__x86_64__) ++ #define CRYPTOPP_BOOL_X64 1 ++#else ++ #define CRYPTOPP_BOOL_X64 0 ++#endif ++ ++// see http://predef.sourceforge.net/prearch.html ++#if defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_X86_) || defined(__I86__) || defined(__INTEL__) ++ #define CRYPTOPP_BOOL_X86 1 ++#else ++ #define CRYPTOPP_BOOL_X86 0 ++#endif ++ ++#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86 || defined(__powerpc__) ++ #define CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS ++#endif ++ ++#define CRYPTOPP_VERSION 560 ++ ++// ***************** determine availability of OS features ******************** ++ ++#ifndef NO_OS_DEPENDENCE ++ ++#if defined(_WIN32) || defined(__CYGWIN__) ++#define CRYPTOPP_WIN32_AVAILABLE ++#endif ++ ++#if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined(__sun) ++#define CRYPTOPP_UNIX_AVAILABLE ++#endif ++ ++#if defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE) ++# define HIGHRES_TIMER_AVAILABLE ++#endif ++ ++#ifdef CRYPTOPP_UNIX_AVAILABLE ++# define HAS_BERKELEY_STYLE_SOCKETS ++#endif ++ ++#ifdef CRYPTOPP_WIN32_AVAILABLE ++# define HAS_WINDOWS_STYLE_SOCKETS ++#endif ++ ++#if defined(HIGHRES_TIMER_AVAILABLE) && (defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(HAS_WINDOWS_STYLE_SOCKETS)) ++# define SOCKETS_AVAILABLE ++#endif ++ ++#if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS)) ++# define USE_WINDOWS_STYLE_SOCKETS ++#else ++# define USE_BERKELEY_STYLE_SOCKETS ++#endif ++ ++#if defined(HIGHRES_TIMER_AVAILABLE) && defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS) ++# define WINDOWS_PIPES_AVAILABLE ++#endif ++ ++#if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(USE_MS_CRYPTOAPI) ++# define NONBLOCKING_RNG_AVAILABLE ++# define OS_RNG_AVAILABLE ++#endif ++ ++#if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) ++# define NONBLOCKING_RNG_AVAILABLE ++# define BLOCKING_RNG_AVAILABLE ++# define OS_RNG_AVAILABLE ++# define HAS_PTHREADS ++# define THREADS_AVAILABLE ++#endif ++ ++#ifdef CRYPTOPP_WIN32_AVAILABLE ++# define HAS_WINTHREADS ++# define THREADS_AVAILABLE ++#endif ++ ++#endif // NO_OS_DEPENDENCE ++ ++// ***************** DLL related ******************** ++ ++#ifdef CRYPTOPP_WIN32_AVAILABLE ++ ++#ifdef CRYPTOPP_EXPORTS ++#define CRYPTOPP_IS_DLL ++#define CRYPTOPP_DLL __declspec(dllexport) ++#elif defined(CRYPTOPP_IMPORTS) ++#define CRYPTOPP_IS_DLL ++#define CRYPTOPP_DLL __declspec(dllimport) ++#else ++#define CRYPTOPP_DLL ++#endif ++ ++#define CRYPTOPP_API __cdecl ++ ++#else // CRYPTOPP_WIN32_AVAILABLE ++ ++#define CRYPTOPP_DLL ++#define CRYPTOPP_API ++ ++#endif // CRYPTOPP_WIN32_AVAILABLE ++ ++#if defined(__MWERKS__) ++#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL ++#elif defined(__BORLANDC__) || defined(__SUNPRO_CC) ++#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL ++#else ++#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL ++#endif ++ ++#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS) ++#define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL ++#else ++#define CRYPTOPP_DLL_TEMPLATE_CLASS CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS ++#endif ++ ++#if defined(__MWERKS__) ++#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern class ++#elif defined(__BORLANDC__) || defined(__SUNPRO_CC) ++#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS template class ++#else ++#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern template class ++#endif ++ ++#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS) ++#define CRYPTOPP_STATIC_TEMPLATE_CLASS template class ++#else ++#define CRYPTOPP_STATIC_TEMPLATE_CLASS CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS ++#endif ++ ++#endif +--- /dev/null 2009-09-20 12:09:29.503935207 +0200 ++++ debian/libcrypto++.pc.in 2009-09-20 18:51:50.000000000 +0200 +@@ -0,0 +1,12 @@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++libdir=@libdir@ ++includedir=@includedir@ ++ ++Name: libcrypto++ ++Description: General purpose cryptographic shared library ++URL: http://www.cryptopp.com ++Version: @VERSION@ ++Requires: ++Libs: -lcrypto++ ++Cflags: diff --git a/libs/libcunit/Makefile b/libs/libcunit/Makefile new file mode 100644 index 0000000..7cec339 --- /dev/null +++ b/libs/libcunit/Makefile @@ -0,0 +1,71 @@ +# +# Copyright (C) 2011 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:=libcunit +PKG_VERSION:=2.1-0 +PKG_RELEASE:=1 + +PKG_SOURCE:=CUnit-$(PKG_VERSION)-src.tar.gz +PKG_SOURCE_URL:=http://downloads.sourceforge.net/project/cunit/CUnit/$(PKG_VERSION) +PKG_MD5SUM:=f4f53d2c41e9315a91b4f14a1706fe4f +PKG_BUILD_DIR:=$(BUILD_DIR)/CUnit-$(PKG_VERSION) + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/libcunit + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Unit testing framework for C + URL:=http://cunit.sourceforge.net/ +endef + +define Package/libcunit/description + CUnit, lightweight unit testing for C + CUnit is a lightweight system for writing, administering, and running unit + tests in C. It provides C programmers a basic testing functionality with a + flexible variety of user interfaces. +endef + + +define Build/Configure + $(call Build/Configure/Default, \ + , \ + BUILD_CC="$(TARGET_CC)" \ + HOSTCC="$(HOSTCC)" \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CCOPT="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install +endef + + +define Build/InstallDev + mkdir -p $(1)/usr/include/CUnit + $(CP) $(PKG_INSTALL_DIR)/usr/include/CUnit/* \ + $(1)/usr/include/CUnit + + mkdir -p $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcunit.* \ + $(1)/usr/lib +endef + + +define Package/libcunit/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcunit.* $(1)/usr/lib +endef + + +$(eval $(call BuildPackage,libcunit)) diff --git a/libs/libdaemon/Makefile b/libs/libdaemon/Makefile new file mode 100644 index 0000000..68e3e36 --- /dev/null +++ b/libs/libdaemon/Makefile @@ -0,0 +1,70 @@ +# +# 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:=libdaemon +PKG_VERSION:=0.14 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://0pointer.de/lennart/projects/libdaemon/ +PKG_MD5SUM:=509dc27107c21bcd9fbf2f95f5669563 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libdaemon + SECTION:=libs + CATEGORY:=Libraries + TITLE:=A lightweight C library that eases the writing of UNIX daemons + URL:=http://0pointer.de/lennart/projects/libdaemon/ +endef + +define Package/libdaemon/description + libdaemon is a lightweight C library that eases the writing of UNIX daemons. + It consists of the following parts: + - A wrapper around fork() which does the correct daemonization procedure of a process + - A wrapper around syslog() for simpler and compatible log output to Syslog or STDERR + - An API for writing PID files + - An API for serializing UNIX signals into a pipe for usage with select() or poll() + - An API for running subprocesses with STDOUT and STDERR redirected to syslog + + APIs like these are used in most daemon software available. It is not that + simple to get it done right and code duplication is not a goal. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + --disable-lynx \ + , \ + ac_cv_func_setpgrp_void=yes \ + ) +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libdaemon $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.a $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libdaemon.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libdaemon/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libdaemon)) diff --git a/libs/libdaq/Makefile b/libs/libdaq/Makefile new file mode 100644 index 0000000..f3e69cb --- /dev/null +++ b/libs/libdaq/Makefile @@ -0,0 +1,70 @@ +# +# Copyright (C) 2012 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:=libdaq +PKG_VERSION:=1.1.1 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=http://www.snort.org/dl/snort-current/ +PKG_SOURCE:=daq-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=bc204ea09165b4ecbb1bb49c7c1a2ad4 +PKG_BUILD_DIR:=$(BUILD_DIR)/daq-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/libdaq + SECTION:=libs + CATEGORY:=Libraries + TITLE:=DAQ library + URL:=$(PKG_SOURCE_URL) + DEPENDS:=+libdnet +libipq +libpcap +endef + +define Package/libdaq/description + Data Acquisition library for packet I/O. +endef + +CONFIGURE_ARGS+= \ + --disable-static \ + --disable-nfq-module \ + --with-dnet-includes="$(STAGING_DIR)/usr/include" \ + --with-dnet-libraries="$(STAGING_DIR)/usr/lib" \ + --with-libpcap-includes="$(STAGING_DIR)/usr/include" \ + --with-libpcap-libraries="$(STAGING_DIR)/usr/lib" \ + +define Build/Compile + $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR) +endef + +define Build/Install + $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR) install DESTDIR=$(PKG_INSTALL_DIR) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(STAGING_DIR)/usr/include/ + $(INSTALL_DIR) $(STAGING_DIR)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib* $(STAGING_DIR)/usr/lib/ + $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/daq + $(CP) $(PKG_INSTALL_DIR)/usr/lib/daq/* $(STAGING_DIR)/usr/lib/daq/ + $(INSTALL_DIR) $(STAGING_DIR)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/daq-modules-config $(STAGING_DIR)/usr/bin/ +endef + +define Package/libdaq/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/daq + $(CP) $(PKG_INSTALL_DIR)/usr/lib/daq/*.so* $(1)/usr/lib/daq/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/daq-modules-config $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libdaq)) diff --git a/libs/libdaq/patches/001-cross-compile-test.patch b/libs/libdaq/patches/001-cross-compile-test.patch new file mode 100644 index 0000000..6eadb9e --- /dev/null +++ b/libs/libdaq/patches/001-cross-compile-test.patch @@ -0,0 +1,18 @@ +--- daq-1.1.1/configure 2012-07-10 21:32:51.000000000 +0200 ++++ daq-new/configure 2012-08-03 15:47:07.654945651 +0200 +@@ -12717,10 +12717,11 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpcap version >= \"1.0.0\"" >&5 + $as_echo_n "checking for libpcap version >= \"1.0.0\"... " >&6; } + if test "$cross_compiling" = yes; then : +- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error $? "cannot run test program while cross compiling +-See \`config.log' for more details" "$LINENO" 5; } ++# { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++#$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++#as_fn_error $? "cannot run test program while cross compiling ++#See \`config.log' for more details" "$LINENO" 5; } ++ echo " No cross compiling test." + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ diff --git a/libs/libdbi/Makefile b/libs/libdbi/Makefile new file mode 100644 index 0000000..398df7e --- /dev/null +++ b/libs/libdbi/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2009-2011 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:=libdbi +PKG_VERSION:=0.8.3 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/libdbi +PKG_MD5SUM:=ca66db78d479cbfa727cf3245b5864ae + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libdbi + NAME:=libdbi + SECTION:=libs + CATEGORY:=Libraries + TITLE+= (library) + URL:=http://libdbi.sourceforge.net/ +endef + +define Package/libdbi/description + libdbi implements a database-independent abstraction layer in C. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/dbi $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdbi.{a,so*} $(1)/usr/lib/ +endef + +define Package/libdbi/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdbi.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libdbi)) diff --git a/libs/libdbi/patches/001-no_docs.patch b/libs/libdbi/patches/001-no_docs.patch new file mode 100644 index 0000000..f290db1 --- /dev/null +++ b/libs/libdbi/patches/001-no_docs.patch @@ -0,0 +1,24 @@ +diff -urN libdbi-0.8.3/Makefile.am libdbi-0.8.3.new/Makefile.am +--- libdbi-0.8.3/Makefile.am 2006-05-18 22:27:50.000000000 +0200 ++++ libdbi-0.8.3.new/Makefile.am 2009-01-09 00:06:34.000000000 +0100 +@@ -2,7 +2,7 @@ + + AUTOMAKE_OPTIONS = foreign dist-zip + +-SUBDIRS = src include @docs_subdirs@ ++SUBDIRS = src include + + EXTRA_DIST = AUTHORS COPYING ChangeLog INSTALL README README.win32 README.osx TODO NEWS libdbi.spec.in config.h.in Makefile.w32 autogen.sh drivers/example/AUTHORS drivers/example/Makefile.am drivers/example/README drivers/example/TODO drivers/example/.cvsignore drivers/example/dbd_example.c drivers/example/dbd_example.h drivers/example/dbd_example.sgml + +diff -urN libdbi-0.8.3/Makefile.in libdbi-0.8.3.new/Makefile.in +--- libdbi-0.8.3/Makefile.in 2008-02-06 20:40:10.000000000 +0100 ++++ libdbi-0.8.3.new/Makefile.in 2009-01-09 00:06:28.000000000 +0100 +@@ -180,7 +180,7 @@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ + AUTOMAKE_OPTIONS = foreign dist-zip +-SUBDIRS = src include @docs_subdirs@ ++SUBDIRS = src include + EXTRA_DIST = AUTHORS COPYING ChangeLog INSTALL README README.win32 README.osx TODO NEWS libdbi.spec.in config.h.in Makefile.w32 autogen.sh drivers/example/AUTHORS drivers/example/Makefile.am drivers/example/README drivers/example/TODO drivers/example/.cvsignore drivers/example/dbd_example.c drivers/example/dbd_example.h drivers/example/dbd_example.sgml + all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive diff --git a/libs/libdirectfb/Makefile b/libs/libdirectfb/Makefile new file mode 100644 index 0000000..de6bcbe --- /dev/null +++ b/libs/libdirectfb/Makefile @@ -0,0 +1,118 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=DirectFB +PKG_VERSION:=1.4.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.directfb.org/downloads/Core/DirectFB-1.4 +PKG_MD5SUM:=e4376c6c5b8e27d735edb7f62a7a8e86 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/directfb + TITLE:=DirectFB + SECTION:=libs + CATEGORY:=Libraries + URL:=http://directfb.org + DEPENDS:=+libpng +libjpeg +libpthread +libfreetype +libsysfs +endef + +define Package/directfb/description + DirectFB is a thin library that provides hardware graphics acceleration, input device handling and abstraction, integrated windowing system with support for translucent windows and multiple display layers, not only on top of the Linux Framebuffer Device. It is a complete hardware abstraction layer with software fallbacks for every graphics operation that is not supported by the underlying hardware. +endef + +TARGET_LDFLAGS+="-Wl,-rpath-link=$(STAGING_DIR)/usr/lib" +CONFIGURE_CMD=./autogen.sh + +define Feature/DirectFB + TARGET_NAME:=drawing-backend + TARGET_TITLE:=Drawing Backend + NAME:=DirectFB +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-osx \ + --disable-x11 \ + --enable-debug-support \ + --disable-network \ + --disable-mmx \ + --disable-sse \ + --enable-fbdev \ + --disable-sdl \ + --disable-vnc \ + --enable-sysfs \ + --with-inputdrivers=linuxinput \ + --with-gfxdrivers=none \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) \ + $(1)/usr/include \ + $(1)/usr/lib \ + $(1)/usr/lib/pkgconfig + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/* \ + $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/* \ + $(1)/usr/include/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig \ + $(1)/usr/lib/ +endef + +define Package/directfb/install + $(INSTALL_DIR) \ + $(1)/usr/bin \ + $(1)/usr/lib \ + $(1)/usr/share/directfb-1.4.2 \ + $(1)/usr/lib/directfb-1.4-0/interfaces/IDirectFBFont \ + $(1)/usr/lib/directfb-1.4-0/interfaces/IDirectFBImageProvider \ + $(1)/usr/lib/directfb-1.4-0/interfaces/IDirectFBVideoProvider \ + $(1)/usr/lib/directfb-1.4-0/wm \ + $(1)/usr/lib/directfb-1.4-0/systems \ + $(1)/usr/lib/directfb-1.4-0/inputdrivers + $(CP) \ + $(PKG_INSTALL_DIR)/usr/bin/* \ + $(1)/usr/bin/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/share/directfb-1.4.2/* \ + $(1)/usr/share/directfb-1.4.2/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/lib{direct,fusion}*.so* \ + $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/directfb-1.4-0/interfaces/IDirectFBFont/*.so* \ + $(1)/usr/lib/directfb-1.4-0/interfaces/IDirectFBFont/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/directfb-1.4-0/interfaces/IDirectFBImageProvider/*.so* \ + $(1)/usr/lib/directfb-1.4-0/interfaces/IDirectFBImageProvider/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/directfb-1.4-0/interfaces/IDirectFBVideoProvider/*.so* \ + $(1)/usr/lib/directfb-1.4-0/interfaces/IDirectFBVideoProvider/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/directfb-1.4-0/wm/*.so* \ + $(1)/usr/lib/directfb-1.4-0/wm/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/directfb-1.4-0/systems/*.so* \ + $(1)/usr/lib/directfb-1.4-0/systems/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/directfb-1.4-0/inputdrivers/*.so* \ + $(1)/usr/lib/directfb-1.4-0/inputdrivers/ +endef + +$(eval $(call Feature,DirectFB)) +$(eval $(call BuildPackage,directfb)) diff --git a/libs/libdirectfb/patches/disable-asm.patch b/libs/libdirectfb/patches/disable-asm.patch new file mode 100644 index 0000000..c38498a --- /dev/null +++ b/libs/libdirectfb/patches/disable-asm.patch @@ -0,0 +1,13 @@ +--- DirectFB-1.4.2/configure.in.orig 2009-10-14 17:19:38.000000000 +0200 ++++ DirectFB-1.4.2/configure.in 2009-10-14 17:19:55.000000000 +0200 +@@ -221,8 +221,8 @@ + have_kos=no + need_libc_r=no + need_libdl=yes ++want_ppcasm=no ++want_armasm=no +-want_ppcasm=yes +-want_armasm=yes + + case "$target_or_host" in + *-linux*) diff --git a/libs/libdlna/Makefile b/libs/libdlna/Makefile new file mode 100644 index 0000000..cad68f8 --- /dev/null +++ b/libs/libdlna/Makefile @@ -0,0 +1,78 @@ +# +# Copyright (C) 2006-2009 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:=libdlna +PKG_VERSION:=0.2.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://libdlna.geexbox.org/releases/ +PKG_MD5SUM:=2c974f95b711e5fd07f78fc4ebfcca66 + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libdlna + SECTION:=libs + CATEGORY:=Libraries + TITLE:= Reference DLNA implementation + URL:=http://libdlna.geexbox.org/ + DEPENDS:=+libffmpeg +endef + +define Package/libdlna/description + libdlna aims at being the reference open-source implementation of DLNA + (Digital Living Network Alliance) standards. Its primary goal is to + provide DLNA support to uShare, an embedded DLNA & UPnP A/V Media Server, + but it will be used to build both DLNA servers and players in the long + term. +endef + +define Build/Configure + # this is *NOT* GNU configure + ( cd $(PKG_BUILD_DIR); \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -lpthread" \ + HOST_CC="$(HOSTCC)" \ + ./configure \ + --cross-compile \ + --cross-prefix=$(TARGET_CROSS) \ + --prefix=/usr \ + --enable-shared \ + --enable-static \ + --disable-debug \ + --disable-optimize \ + --disable-strip \ + ) +endef + +# XXX: fix build on systems where install is not at its usual location +# INSTALL defaults to /usr/bin/install +MAKE_INSTALL_FLAGS += \ + INSTALL="install" \ + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/dlna.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdlna.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libdlna.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libdlna/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdlna.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libdlna)) diff --git a/libs/libdlna/patches/100-configure_fix.patch b/libs/libdlna/patches/100-configure_fix.patch new file mode 100644 index 0000000..f11fd38 --- /dev/null +++ b/libs/libdlna/patches/100-configure_fix.patch @@ -0,0 +1,120 @@ +diff -ruN libdlna-0.2.3.orig/configure libdlna-0.2.3/configure +--- libdlna-0.2.3.orig/configure 2007-11-26 21:47:43.000000000 +0100 ++++ libdlna-0.2.3/configure 2008-04-19 21:59:15.000000000 +0200 +@@ -177,6 +177,19 @@ + check_cmd $cc $LDFLAGS "$@" -o $TMPE $TMPO $extralibs + } + ++check_host_cc(){ ++ log check_host_cc "$@" ++ cat >$TMPC ++ log_file $TMPC ++ check_cmd $host_cc $host_cflags "$@" -c -o $TMPO $TMPC ++} ++ ++check_host_ld(){ ++ log check_host_ld "$@" ++ check_host_cc || return ++ check_cmd $host_cc $host_cflags $host_ldflags "$@" -o $TMPE $TMPO ++} ++ + check_exec(){ + check_ld "$@" && { enabled cross_compile || $TMPE >>$logfile 2>&1; } + } +@@ -311,6 +324,7 @@ + static="yes" + shared="yes" + cc="gcc" ++host_cc="gcc" + ar="ar" + ranlib="ranlib" + make="make" +@@ -454,6 +468,11 @@ + fi + [ -n "$MAKE" ] && make="$MAKE" + ++[ -n "$HOST_CC" ] && host_cc="$HOST_CC" ++[ -n "$HOST_CFLAGS" ] && host_cflags="$HOST_CFLAGS" ++[ -n "$HOST_LDFLAGS" ] && host_ldflags="$HOST_LDFLAGS" ++host_cflags="-Isrc $host_cflags" ++ + ################################################# + # create logging file + ################################################# +@@ -610,15 +629,14 @@ + fi + + echolog "Checking for libavformat ..." +-check_lib ffmpeg/avformat.h av_register_all -lavformat || die "Error, can't find libavformat !" ++check_lib libavformat/avformat.h av_register_all -lavformat -lavcodec -lavutil || die "Error, can't find libavformat !" + echolog "Checking for libavcodec ..." +-check_lib ffmpeg/avcodec.h avcodec_register_all -lavcodec || die "Error, can't find libavcodec !" ++check_lib libavcodec/avcodec.h avcodec_register_all -lavcodec || die "Error, can't find libavcodec !" + + ################################################# + # version + ################################################# +-temp_cflags "-Isrc" +-check_ld < + #include + int main(){ +@@ -628,7 +646,6 @@ + } + EOF + VERSION=`$TMPE` +-restore_flags + + + ################################################# +diff -ruN libdlna-0.2.3.orig/src/av_mpeg4_part10.c libdlna-0.2.3/src/av_mpeg4_part10.c +--- libdlna-0.2.3.orig/src/av_mpeg4_part10.c 2007-11-26 21:47:43.000000000 +0100 ++++ libdlna-0.2.3/src/av_mpeg4_part10.c 2008-04-19 21:48:45.000000000 +0200 +@@ -26,7 +26,7 @@ + #include + #include + +-#include ++#include + + #include "dlna_internals.h" + #include "profiles.h" +diff -ruN libdlna-0.2.3.orig/src/av_mpeg4_part2.c libdlna-0.2.3/src/av_mpeg4_part2.c +--- libdlna-0.2.3.orig/src/av_mpeg4_part2.c 2007-11-26 21:47:43.000000000 +0100 ++++ libdlna-0.2.3/src/av_mpeg4_part2.c 2008-04-19 21:48:45.000000000 +0200 +@@ -26,7 +26,7 @@ + #include + #include + +-#include ++#include + + #include "dlna_internals.h" + #include "profiles.h" +diff -ruN libdlna-0.2.3.orig/src/containers.c libdlna-0.2.3/src/containers.c +--- libdlna-0.2.3.orig/src/containers.c 2007-11-26 21:47:43.000000000 +0100 ++++ libdlna-0.2.3/src/containers.c 2008-04-19 21:48:45.000000000 +0200 +@@ -4,7 +4,7 @@ + #include + #include + +-#include ++#include + + #include "containers.h" + #include "profiles.h" +diff -ruN libdlna-0.2.3.orig/src/profiles.h libdlna-0.2.3/src/profiles.h +--- libdlna-0.2.3.orig/src/profiles.h 2007-11-26 21:47:43.000000000 +0100 ++++ libdlna-0.2.3/src/profiles.h 2008-04-19 21:48:45.000000000 +0200 +@@ -22,8 +22,8 @@ + #ifndef _PROFILES_H_ + #define _PROFILES_H_ + +-#include +-#include ++#include ++#include + + #include "dlna_internals.h" + #include "containers.h" diff --git a/libs/libdlna/patches/200-parallel-build.patch b/libs/libdlna/patches/200-parallel-build.patch new file mode 100644 index 0000000..7f9934b --- /dev/null +++ b/libs/libdlna/patches/200-parallel-build.patch @@ -0,0 +1,17 @@ +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- libdlna-0.2.3.orig/Makefile ++++ libdlna-0.2.3/Makefile +@@ -32,8 +32,8 @@ lib: + + test: $(LIBTEST) + +-$(LIBTEST): $(SRCS) +- $(CC) $? $(OPTFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ ++$(LIBTEST): lib $(SRCS) ++ $(CC) $(SRCS) $(OPTFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ + + clean: + $(MAKE) -C src clean diff --git a/libs/libdlna/patches/300-ffmpeg_compat.patch b/libs/libdlna/patches/300-ffmpeg_compat.patch new file mode 100644 index 0000000..04011eb --- /dev/null +++ b/libs/libdlna/patches/300-ffmpeg_compat.patch @@ -0,0 +1,39 @@ +Index: libdlna-0.2.3/src/profiles.c +=================================================================== +--- libdlna-0.2.3.orig/src/profiles.c 2011-10-10 13:00:12.000000000 +0200 ++++ libdlna-0.2.3/src/profiles.c 2011-10-10 13:05:52.000000000 +0200 +@@ -205,13 +205,13 @@ + for (i = 0; i < ctx->nb_streams; i++) + { + if (audio_stream == -1 && +- ctx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) ++ ctx->streams[i]->codec->codec_type == LIBDLNA_CODEC_TYPE_AUDIO) + { + audio_stream = i; + continue; + } + else if (video_stream == -1 && +- ctx->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO) ++ ctx->streams[i]->codec->codec_type == LIBDLNA_CODEC_TYPE_VIDEO) + { + video_stream = i; + continue; +Index: libdlna-0.2.3/src/profiles.h +=================================================================== +--- libdlna-0.2.3.orig/src/profiles.h 2011-10-10 13:00:26.000000000 +0200 ++++ libdlna-0.2.3/src/profiles.h 2011-10-10 13:05:27.000000000 +0200 +@@ -25,6 +25,14 @@ + #include + #include + ++#if (LIBAVCODEC_VERSION_MAJOR > 52) ++# define LIBDLNA_CODEC_TYPE_AUDIO (AVMEDIA_TYPE_AUDIO) ++# define LIBDLNA_CODEC_TYPE_VIDEO (AVMEDIA_TYPE_VIDEO) ++#else ++# define LIBDLNA_CODEC_TYPE_AUDIO (CODEC_TYPE_AUDIO) ++# define LIBDLNA_CODEC_TYPE_VIDEO (CODEC_TYPE_VIDEO) ++#endif ++ + #include "dlna_internals.h" + #include "containers.h" + diff --git a/libs/libdmapsharing/Makefile b/libs/libdmapsharing/Makefile new file mode 100644 index 0000000..55cadfd --- /dev/null +++ b/libs/libdmapsharing/Makefile @@ -0,0 +1,66 @@ +# +# Copyright (C) 2009-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# This Makefile is a skeleton +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libdmapsharing +PKG_VERSION:=2.9.15 +PKG_RELEASE:=1 + +PKG_SOURCE:=libdmapsharing-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.flyn.org/projects/libdmapsharing/ +PKG_MD5SUM:=52c9e4d3de931d9013eeaccf7371bb2d + +PKG_BUILD_DIR:=$(BUILD_DIR)/libdmapsharing-$(PKG_VERSION) + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +TARGET_LDFLAGS+= \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +define Package/libdmapsharing + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libsoup +mdnsresponder +gstreamer +gst-plugins-base +libgstapp + TITLE:=libdmapsharing + URL:=http://www.flyn.org/projects/libdmapsharing/ + MAINTAINER:=W. Michael Petullo +endef + +define Package/libdmapsharing/decription + Libdmapsharing is a DMAP library implementation in C +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/libdmapsharing-3.0/ \ + $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.so* \ + $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/ + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/libdmapsharing/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.so* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libdmapsharing)) diff --git a/libs/libdmapsharing/patches/001-diable_pixbuf.patch b/libs/libdmapsharing/patches/001-diable_pixbuf.patch new file mode 100644 index 0000000..663dd49 --- /dev/null +++ b/libs/libdmapsharing/patches/001-diable_pixbuf.patch @@ -0,0 +1,24 @@ +Index: libdmapsharing-2.9.15/configure.ac +=================================================================== +--- libdmapsharing-2.9.15.orig/configure.ac 2012-08-14 21:02:31.861158482 +0200 ++++ libdmapsharing-2.9.15/configure.ac 2012-08-14 21:03:42.448658906 +0200 +@@ -112,18 +112,7 @@ + AC_SUBST(GOBJECT_CFLAGS) + AC_SUBST(GOBJECT_LIBS) + +-dnl Check for gdk-pixbuf, needed for DACP Now Playing Artwork +-PKG_CHECK_MODULES(GDKPIXBUF, gdk-pixbuf-2.0, +- HAVE_GDKPIXBUF=yes, +- HAVE_GDKPIXBUF=no) +- +-if test x"$HAVE_GDKPIXBUF" = "xyes"; then +- AC_DEFINE(HAVE_GDKPIXBUF, 1, [Define if gdk-pixbuf support is enabled]) +-else +- AC_WARN(Gdk-pixbuf library not present, Now Playing artwork might be affected.) +-fi +- +-AM_CONDITIONAL(USE_GDKPIXBUF, test x"$HAVE_GDKPIXBUF" = "xyes") ++HAVE_GDKPIXBUF=no + + AC_SUBST(GDKPIXBUF_CFLAGS) + AC_SUBST(GDKPIXBUF_LIBS) diff --git a/libs/libdnet/Makefile b/libs/libdnet/Makefile new file mode 100644 index 0000000..d1e7f63 --- /dev/null +++ b/libs/libdnet/Makefile @@ -0,0 +1,144 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libdnet +PKG_VERSION:=1.11 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=04c394ed8e1e7fc455456e79e908916d + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +PKG_CONFIG_DEPENDS:=\ + CONFIG_PACKAGE_libdnet \ + CONFIG_PACKAGE_pydnet + +PKG_BUILD_DEPENDS:=PACKAGE_pydnet:python + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/libdnet/Default + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Low-level network library + URL:=http://sourceforge.net/projects/libdnet/ +endef + +define Package/libdnet/Default/description + libdnet is a library of simplified, portable interface to several + low-level networking routines. +endef + +define Package/libdnet + $(call Package/libdnet/Default) +endef + +define Package/libdnet/description + $(call Package/libdnet/Default/description) +endef + +define Package/pydnet + $(call Package/libdnet/Default) + DEPENDS:=libdnet +python-mini +endef + +define Package/pydnet/description + $(call Package/libdnet/Default/description) + This package contains the python dnet library. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --without-check \ + --without-python + +CONFIGURE_VARS += \ + ac_cv_dnet_bsd_bpf=no + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE" + +define Build/Configure + (cd $(PKG_BUILD_DIR); \ + ln -sf config/acinclude.m4 . ; \ + autoreconf -v --install || exit 1 \ + ); + $(call Build/Configure/Default) +endef + +define Build/Compile + $(call Build/Compile/Default) + $(if $(CONFIG_PACKAGE_pydnet), \ + $(call Build/Compile/PyMod, \ + python/, \ + build \ + ) \ + ) +endef + +define Build/Install + $(call Build/Install/Default) + $(if $(CONFIG_PACKAGE_pydnet), \ + $(call Build/Compile/PyMod, \ + python/, \ + install --no-compile --prefix $(PKG_INSTALL_DIR)/usr \ + ) \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(2)/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/dnet-config \ + $(2)/bin/ + $(SED) \ + 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ + $(2)/bin/dnet-config + + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DATA)\ + $(PKG_INSTALL_DIR)/usr/include/dnet.h \ + $(1)/usr/include/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/dnet \ + $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libdnet.{la,a,so*} \ + $(1)/usr/lib/ +endef + +define Package/libdnet/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libdnet.so.* \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/sbin/dnet \ + $(1)/usr/sbin/ +endef + +define Package/pydnet/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/python* $(1)/usr/lib/ +endef + + +$(eval $(call BuildPackage,libdnet)) +$(eval $(call BuildPackage,pydnet)) diff --git a/libs/libdnet/patches/001-dnet_config.patch b/libs/libdnet/patches/001-dnet_config.patch new file mode 100644 index 0000000..cde376a --- /dev/null +++ b/libs/libdnet/patches/001-dnet_config.patch @@ -0,0 +1,23 @@ +--- a/dnet-config.in ++++ b/dnet-config.in +@@ -45,10 +45,18 @@ while test $# -gt 0; do + done + + if test "$echo_cflags" = "yes"; then +- echo -I@includedir@ ++ includes= ++ if test "@includedir@" != "/usr/include" ; then ++ includes=-I@includedir@ ++ fi ++ echo $includes + fi + + if test "$echo_libs" = "yes"; then +- echo -L@libdir@ -ldnet @LIBS@ ++ libs= ++ if test "@libdir@" != "/usr/lib" ; then ++ libs=-I@libdir@ ++ fi ++ echo $libs -ldnet @LIBS@ + fi + diff --git a/libs/libdnet/patches/002-fix_avr32_compile.patch b/libs/libdnet/patches/002-fix_avr32_compile.patch new file mode 100644 index 0000000..54223c9 --- /dev/null +++ b/libs/libdnet/patches/002-fix_avr32_compile.patch @@ -0,0 +1,20 @@ +--- a/config/config.sub ++++ b/config/config.sub +@@ -228,7 +228,7 @@ case $basic_machine in + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ +- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ ++ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ +@@ -290,7 +290,7 @@ case $basic_machine in + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ +- | avr-* \ ++ | avr-* | avr32-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cydra-* \ diff --git a/libs/libdnet/patches/010-gcc4.patch b/libs/libdnet/patches/010-gcc4.patch new file mode 100644 index 0000000..bfbf822 --- /dev/null +++ b/libs/libdnet/patches/010-gcc4.patch @@ -0,0 +1,20 @@ +--- a/python/dnet.c ++++ b/python/dnet.c +@@ -2726,7 +2726,7 @@ static PyObject *__pyx_f_4dnet_15__addr_ + PyObject *__pyx_3 = 0; + unsigned short __pyx_4; + Py_INCREF(__pyx_v_self); +- ((PyObject*)__pyx_v_next) = Py_None; Py_INCREF(((PyObject*)__pyx_v_next)); ++ __pyx_v_next = Py_None; Py_INCREF(((PyObject*)__pyx_v_next)); + + /* "/Users/dugsong/projects/libdnet/python/./dnet.pyx":634 */ + __pyx_1 = (((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->cur <= ((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->max); +@@ -2738,7 +2738,7 @@ static PyObject *__pyx_f_4dnet_15__addr_ + Py_DECREF(__pyx_2); __pyx_2 = 0; + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4dnet_addr)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_next)); +- ((PyObject *)__pyx_v_next) = __pyx_3; ++ __pyx_v_next = __pyx_3; + __pyx_3 = 0; + + /* "/Users/dugsong/projects/libdnet/python/./dnet.pyx":636 */ diff --git a/libs/libdvbpsi/Makefile b/libs/libdvbpsi/Makefile new file mode 100644 index 0000000..2dd1d23 --- /dev/null +++ b/libs/libdvbpsi/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2007-2008 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:=libdvbpsi5 +PKG_VERSION:=0.1.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://download.videolan.org/pub/libdvbpsi/$(PKG_VERSION)/ +PKG_MD5SUM:=bd2d9861be3311e1e03c91cd9345f542 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +PKG_INSTALL=1 + +define Package/libdvbpsi + SECTION:=libs + CATEGORY:=Libraries + TITLE:=MPEG TS and DVB PSI tables decoding and generating + URL:=http://www.videolan.org/developers/libdvbpsi.html +endef + +define Package/libdvbpsi/description + libdvbpsi is a simple library designed for MPEG TS and DVB PSI tables + decoding and generating. +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/dvbpsi + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/dvbpsi/*.h \ + $(1)/usr/include/dvbpsi/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libdvbpsi.{so*,a,la} \ + $(1)/usr/lib/ +endef + +define Package/libdvbpsi/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libdvbpsi.so* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libdvbpsi)) diff --git a/libs/libdvbpsi/patches/001-no_doc_examples.patch b/libs/libdvbpsi/patches/001-no_doc_examples.patch new file mode 100644 index 0000000..a32f5da --- /dev/null +++ b/libs/libdvbpsi/patches/001-no_doc_examples.patch @@ -0,0 +1,25 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,7 +1,7 @@ + ## Process this file with automake to produce Makefile.in + +-SUBDIRS = src examples misc +-DIST_SUBDIRS = $(SUBDIRS) doc debian wince ++SUBDIRS = src ++DIST_SUBDIRS = $(SUBDIRS) debian wince + + EXTRA_DIST = libdvbpsi.spec bootstrap + +--- a/Makefile.in ++++ b/Makefile.in +@@ -179,8 +179,8 @@ target_alias = @target_alias@ + target_cpu = @target_cpu@ + target_os = @target_os@ + target_vendor = @target_vendor@ +-SUBDIRS = src examples misc +-DIST_SUBDIRS = $(SUBDIRS) doc debian wince ++SUBDIRS = src ++DIST_SUBDIRS = $(SUBDIRS) debian wince + EXTRA_DIST = libdvbpsi.spec bootstrap + AUTOMAKE_OPTIONS = foreign dist-bzip2 subdir-objects + all: config.h diff --git a/libs/libdvdread/Makefile b/libs/libdvdread/Makefile new file mode 100644 index 0000000..70f29e1 --- /dev/null +++ b/libs/libdvdread/Makefile @@ -0,0 +1,65 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libdvdread +PKG_VERSION:=0.9.7 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.dtek.chalmers.se/~dvd/dist +PKG_MD5SUM:=078788c9241ae16763529e1235502337 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/libdvdread + SECTION:=libs + CATEGORY:=Libraries + TITLE:=simple foundation for reading DVD video disks. + URL:=http://www.dtek.chalmers.se/~dvd/downloads.shtml +endef + +define Package/libdvdread/description + libdvdread provides a simple foundation for reading DVD video disks. + It provides the functionality that is required to access many DVDs. + It parses IFO files, reads NAV-blocks, and performs CSS + authentication and descrambling. +endef + +TARGET_CFLAGS += \ + -ffunction-sections -fdata-sections + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static +# --with-build-cc="$(HOSTCC)" + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/dvdread + $(CP) $(PKG_INSTALL_DIR)/usr/include/dvdread/*.h \ + $(1)/usr/include/dvdread + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdvdread.{a,so*} \ + $(1)/usr/lib/ +endef + +define Package/libdvdread/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdvdread.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libdvdread)) diff --git a/libs/libelf/Makefile b/libs/libelf/Makefile new file mode 100644 index 0000000..8c33188 --- /dev/null +++ b/libs/libelf/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libelf +PKG_VERSION:=0.8.13 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.mr511.de/software/ +PKG_MD5SUM:=4136d7b4c04df68b686570afa26988ac + +include $(INCLUDE_DIR)/package.mk + +define Package/libelf + SECTION:=libs + CATEGORY:=Libraries + TITLE:=ELF object file access library + URL:=http://www.mr511.de/software/ +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --enable-elf64=yes \ + +CONFIGURE_VARS += \ + mr_cv_target_elf=yes \ + libelf_64bit=yes \ + libelf_cv_struct_elf64_ehdr=yes \ + libelf_cv_type_elf64_addr=no \ + libelf_cv_struct_elf64_rel=yes \ + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + instroot="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libelf* $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libelf.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libelf/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libelf)) diff --git a/libs/libevent/Makefile b/libs/libevent/Makefile new file mode 100644 index 0000000..781b87c --- /dev/null +++ b/libs/libevent/Makefile @@ -0,0 +1,66 @@ +# +# Copyright (C) 2006-2011 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:=libevent +PKG_VERSION:=1.4.14b +PKG_RELEASE:=2 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-stable +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-stable.tar.gz +PKG_SOURCE_URL:=http://www.monkey.org/~provos/ +PKG_MD5SUM:=a00e037e4d3f9e4fe9893e8a2d27918c + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libevent + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Event notification library + DEPENDS:=+librt + URL:=http://www.monkey.org/~provos/libevent/ +endef + +define Package/libevent/description + The libevent API provides a mechanism to execute a callback function + when a specific event occurs on a file descriptor or after a timeout + has been reached. Furthermore, libevent also support callbacks due + to signals or regular timeouts. + + libevent is meant to replace the event loop found in event driven + network servers. An application just needs to call event_dispatch() + and then add or remove events dynamically without having to change + the event loop. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS)" \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/libevent + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/libevent/ + $(INSTALL_DIR) $(1)/usr/lib/libevent + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so} $(1)/usr/lib/libevent/ +endef + +define Package/libevent/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libevent)) diff --git a/libs/libevent2/Makefile b/libs/libevent2/Makefile new file mode 100644 index 0000000..8e628b8 --- /dev/null +++ b/libs/libevent2/Makefile @@ -0,0 +1,156 @@ +# +# Copyright (C) 2011-2012 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:=libevent2 +PKG_VERSION:=2.0.19 +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/libevent-$(PKG_VERSION)-stable +PKG_SOURCE:=libevent-$(PKG_VERSION)-stable.tar.gz +PKG_SOURCE_URL:=http://www.monkey.org/~provos/ \ + @SF/levent +PKG_MD5SUM:=91111579769f46055b0a438f5cc59572 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libevent2/Default + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Event notification + URL:=http://www.monkey.org/~provos/libevent/ + DEPENDS:=+USE_EGLIBC:librt +endef + +define Package/libevent2/Default/description + The libevent API provides a mechanism to execute a callback function + when a specific event occurs on a file descriptor or after a timeout + has been reached. Furthermore, libevent also support callbacks due + to signals or regular timeouts. + + libevent is meant to replace the event loop found in event driven + network servers. An application just needs to call event_dispatch() + and then add or remove events dynamically without having to change + the event loop. +endef + +define Package/libevent2 + $(call Package/libevent2/Default) + TITLE+= library (version 2.0) +endef + +define Package/libevent2/description + $(call Package/libevent2/Default/description) + + This package contains the libevent shared library historically + containing both the core & extra libraries. +endef + +define Package/libevent2-core + $(call Package/libevent2/Default) + TITLE+= core library (version 2.0) +endef + +define Package/libevent2-core/description + $(call Package/libevent2/Default/description) + + This package contains the libevent core shared library for the event, + buffer & utility functions. +endef + +define Package/libevent2-extra + $(call Package/libevent2/Default) + TITLE+= extra library (version 2.0) +endef + +define Package/libevent2-extra/description + $(call Package/libevent2/Default/description) + + This package contains the libevent extra shared library for specific + protocols including HTTP, DNS & RPC. +endef + +define Package/libevent2-openssl + $(call Package/libevent2/Default) + TITLE+= OpenSSL library (version 2.0) + DEPENDS+=+libopenssl +endef + +define Package/libevent2-openssl/description + $(call Package/libevent2/Default/description) + + This package contains the libevent OpenSSL shared library for encrypted + bufferevents. +endef + +define Package/libevent2-pthreads + $(call Package/libevent2/Default) + TITLE+= Pthreads library (version 2.0) + DEPENDS+=+libpthread +endef + +define Package/libevent2-pthreads/description + $(call Package/libevent2/Default/description) + + This package contains the libevent Pthreads shared library for + threading & locking. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS)" + +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/libevent*.{la,a,so} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent*-2.0.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libevent*.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libevent2/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent-2.0.so.* $(1)/usr/lib/ +endef + +define Package/libevent2-core/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_core-2.0.so.* $(1)/usr/lib/ +endef + +define Package/libevent2-extra/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_extra-2.0.so.* $(1)/usr/lib/ +endef + +define Package/libevent2-openssl/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_openssl-2.0.so.* $(1)/usr/lib/ +endef + +define Package/libevent2-pthreads/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_pthreads-2.0.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libevent2)) +$(eval $(call BuildPackage,libevent2-core)) +$(eval $(call BuildPackage,libevent2-extra)) +$(eval $(call BuildPackage,libevent2-openssl)) +$(eval $(call BuildPackage,libevent2-pthreads)) diff --git a/libs/libexif/Makefile b/libs/libexif/Makefile new file mode 100644 index 0000000..a040f70 --- /dev/null +++ b/libs/libexif/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libexif +PKG_VERSION:=0.6.19 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/libexif +PKG_MD5SUM:=56144a030a4c875c600b1ccf713f69f7 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libexif + SECTION:=libs + CATEGORY:=Libraries + TITLE:=library for jpeg files with exif tags + URL:=http://libexif.sourceforge.net/ +endef + +define Package/libexif/description + libexif is a library for parsing, editing, and saving EXIF data. It is + intended to replace lots of redundant implementations in command-line + utilities and programs with GUIs. +endef + +CONFIGURE_ARGS+= \ + --enable-shared \ + --enable-static \ + --disable-rpath \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libexif $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libexif*.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libexif.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libexif/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libexif*.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libexif)) diff --git a/libs/libexif/patches/100-no_doc.patch b/libs/libexif/patches/100-no_doc.patch new file mode 100644 index 0000000..5ca00ce --- /dev/null +++ b/libs/libexif/patches/100-no_doc.patch @@ -0,0 +1,11 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -280,7 +280,7 @@ target_alias = @target_alias@ + top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ +-SUBDIRS = m4m po libexif test doc binary contrib ++SUBDIRS = m4m po libexif test binary contrib + @SHIP_BINARIES_TRUE@README_W32_XDIST = README-Win32.txt + EXTRA_DIST = @PACKAGE_TARNAME@.spec $(README_W32_XDIST) libexif.pc.in \ + libexif-uninstalled.pc.in diff --git a/libs/libffi/Makefile b/libs/libffi/Makefile new file mode 100644 index 0000000..e6bd7a6 --- /dev/null +++ b/libs/libffi/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (C) 2009-2012 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:=libffi +PKG_VERSION:=3.0.10 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://sourceware.org/pub/libffi/ +PKG_MD5SUM:=79390673f5d07a8fb342bc09b5055b6f + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libffi + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Foreign Function Interface (FFI) library + URL:=http://sourceware.org/libffi/ +endef + +define Package/libffi/description +The libffi library provides a portable, high level programming interface to +various calling conventions. This allows a programmer to call any function +specified by a call interface description at run-time. + +FFI stands for Foreign Function Interface. A foreign function interface is the +popular name for the interface that allows code written in one language to call +code written in another language. The libffi library really only provides the +lowest, machine dependent layer of a fully featured foreign function interface. +A layer must exist above libffi that handles type conversions for values passed +between the two languages. +endef + +CONFIGURE_PATH = build +CONFIGURE_CMD = ../configure +MAKE_PATH = build + +define Build/Configure + mkdir -p $(PKG_BUILD_DIR)/build + $(Build/Configure/Default) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libffi.{so*,a,la} \ + $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \ + $(1)/usr/lib/pkgconfig/ + + $(INSTALL_DIR) $(1)/usr/include + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libffi-$(PKG_VERSION)/include/*.h \ + $(1)/usr/include/ +endef + +define Package/libffi/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libffi.so.* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libffi)) diff --git a/libs/libfreecwmp/Makefile b/libs/libfreecwmp/Makefile new file mode 100644 index 0000000..205b732 --- /dev/null +++ b/libs/libfreecwmp/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2012 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:=libfreecwmp +PKG_VERSION:=2012-09-25 +PKG_RELEASE=$(PKG_SOURCE_VERSION) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://dev.libfreecwmp.org/libfreecwmp +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=54e86aecbbb32c2032f78fc4781b346ed8573e56 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz + +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/libfreecwmp + SECTION:=libs + CATEGORY:=Libraries + TITLE:=CWMP library + URL:=http://libfreecwmp.org/ +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libfreecwmp.h $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfreecwmp.{a,so*} $(1)/usr/lib +endef + +define Package/libfreecwmp/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfreecwmp.so.* $(1)/usr/lib +endef + +$(eval $(call BuildPackage,libfreecwmp)) diff --git a/libs/libfreefare/Makefile b/libs/libfreefare/Makefile new file mode 100644 index 0000000..d5bcf2a --- /dev/null +++ b/libs/libfreefare/Makefile @@ -0,0 +1,79 @@ +# +# Copyright (C) 2010-2012 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:=libfreefare +PKG_VERSION:=0.2.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://nfc-tools.googlecode.com/files +PKG_MD5SUM:=10af7796c16ec738c1b01501a7f68fae + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libfreefare/Default + TITLE:=Library for high level manipulation of MIFARE cards + URL:=http://code.google.com/p/nfc-tools/wiki/libfreefare +endef + +define Package/libfreefare +$(call Package/libfreefare/Default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libnfc +libopenssl +endef + +define Package/libfreefare/description + The libfreefare project aims to provide a convenient API for MIFARE card + manipulations. +endef + +define Package/libfreefare-examples +$(call Package/libfreefare/Default) + TITLE+= (examples) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libfreefare +endef + +define Package/libfreefare-examples/description + libfreefare is provided with some examples: + * mifare-classic-format, mifare-desfire-format: attempt to format Mifare + cards; + * mifare-classic-write-ndef, mifare-desfire-write-ndef: write NDEF file to + Mifare cards; + * some mifare-desfire-* examples to made various access to Mifare DESFire. +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/freefare.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfreefare.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libfreefare.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libfreefare/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfreefare.so.* $(1)/usr/lib/ +endef + +define Package/libfreefare-examples/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/mifare-* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libfreefare)) +$(eval $(call BuildPackage,libfreefare-examples)) diff --git a/libs/libfreenect/Makefile b/libs/libfreenect/Makefile new file mode 100644 index 0000000..0f5b6bc --- /dev/null +++ b/libs/libfreenect/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2012 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:=libfreenect +PKG_VERSION:=2012-01-29 +PKG_RELEASE:=$(PKG_SOURCE_VERSION) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_URL:=git://github.com/OpenKinect/libfreenect.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=bbc109a589a1dd2c229f8bc98536dbc184dd73f9 +PKG_MIRROR_MD5SUM:=08f8cb77dd8b9bce21fc7440f62110e7 +CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/libfreenect + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Xbox Kinect library + DEPENDS:=+libusb-1.0 +endef + +CMAKE_OPTIONS += -DBUILD_EXAMPLES="OFF" +TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include + +define Package/libfreenect/description + Drivers and libraries for the Xbox Kinect device +endef + +define Package/libfreenect/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfreenect.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libfreenect)) diff --git a/libs/libftdi/Makefile b/libs/libftdi/Makefile new file mode 100644 index 0000000..4e817fa --- /dev/null +++ b/libs/libftdi/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2011 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:=libftdi +PKG_VERSION:=0.19 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.intra2net.com/en/developer/libftdi/download/ +PKG_MD5SUM:=e6e25f33b4327b1b7aa1156947da45f3 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libftdi + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libusb + TITLE:=library to talk to FTDI chips + URL:=http://www.intra2net.com/en/developer/libftdi/ +endef + +define Package/libftdi/description + libFTDI - FTDI USB driver with bitbang mode + libFTDI is an open source library to talk to FTDI chips: FT232BM, FT245BM, FT2232C, FT2232H, FT4232H, FT2232D and FT245R, including the popular bitbang mode. + The library is linked with your program in userspace, no kernel driver required. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/ftdi.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libftdi.{a,so} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libftdi.so* $(1)/usr/lib/ +endef + +define Package/libftdi/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libftdi.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libftdi)) diff --git a/libs/libgcrypt/Makefile b/libs/libgcrypt/Makefile new file mode 100644 index 0000000..181cb92 --- /dev/null +++ b/libs/libgcrypt/Makefile @@ -0,0 +1,70 @@ +# +# Copyright (C) 2005-2011 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:=libgcrypt +PKG_VERSION:=1.5.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.gnupg.org/gcrypt/libgcrypt +PKG_MD5SUM:=693f9c64d50c908bc4d6e01da3ff76d8 + +PKG_FIXUP:=patch-libtool +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libgcrypt + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libgpg-error + TITLE:=GNU crypto library + URL:=http://directory.fsf.org/security/libgcrypt.html +endef + +define Package/libgcrypt/description + This is a general purpose cryptographic library based on the code from + GnuPG. It provides functions for all cryptograhic building blocks: + symmetric ciphers (AES, DES, Arcfour, CAST5), hash algorithms (MD5, SHA-1, + RIPE-MD160, SHA-224/256, SHA-384/512), MACs (HMAC for all hash + algorithms), public key algorithms (RSA, DSA), large integer functions, + random numbers and a lot of supporting functions. Some algorithms have + been disabled to reduce size (Blowfish, Twofish, Serpent, + RC2, SEED, Camellia, CRC, MD4, TIGER-192, Whirlpool, ElGamal, ECC). +endef + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-asm \ + --with-gpg-error-prefix="$(STAGING_DIR)/usr" \ + --enable-digests="md5 rmd160 sha1 sha256 sha512" \ + --enable-ciphers="arcfour des aes cast5" \ + --enable-pubkey-ciphers="rsa dsa" + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/bin $(2)/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/share/aclocal + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libgcrypt-config $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/gcrypt*.h $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgcrypt.{la,a,so*} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/share/aclocal/libgcrypt.m4 $(1)/usr/share/aclocal/ + $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' $(1)/usr/bin/libgcrypt-config + $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g' $(1)/usr/bin/libgcrypt-config + ln -sf $(STAGING_DIR)/usr/bin/libgcrypt-config $(2)/bin/ +endef + +define Package/libgcrypt/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgcrypt.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libgcrypt)) diff --git a/libs/libgcrypt/patches/001-no_docs_tests.patch b/libs/libgcrypt/patches/001-no_docs_tests.patch new file mode 100644 index 0000000..cc184e4 --- /dev/null +++ b/libs/libgcrypt/patches/001-no_docs_tests.patch @@ -0,0 +1,26 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -22,8 +22,8 @@ AUTOMAKE_OPTIONS = dist-bzip2 + DISTCHECK_CONFIGURE_FLAGS = --enable-random-daemon \ + --enable-ciphers=arcfour:blowfish:cast5:des:aes:twofish:serpent:rfc2268:seed:camellia + +-DIST_SUBDIRS = m4 compat mpi cipher random src doc tests +-SUBDIRS = compat mpi cipher random src doc tests ++DIST_SUBDIRS = m4 compat mpi cipher random src ++SUBDIRS = compat mpi cipher random src + EXTRA_DIST = autogen.sh README.SVN + DISTCLEANFILES = + +--- a/Makefile.in ++++ b/Makefile.in +@@ -281,8 +281,8 @@ AUTOMAKE_OPTIONS = dist-bzip2 + DISTCHECK_CONFIGURE_FLAGS = --enable-random-daemon \ + --enable-ciphers=arcfour:blowfish:cast5:des:aes:twofish:serpent:rfc2268:seed:camellia + +-DIST_SUBDIRS = m4 compat mpi cipher random src doc tests +-SUBDIRS = compat mpi cipher random src doc tests ++DIST_SUBDIRS = m4 compat mpi cipher random src ++SUBDIRS = compat mpi cipher random src + EXTRA_DIST = autogen.sh README.SVN + DISTCLEANFILES = + all: config.h diff --git a/libs/libgpg-error/Makefile b/libs/libgpg-error/Makefile new file mode 100644 index 0000000..1d10430 --- /dev/null +++ b/libs/libgpg-error/Makefile @@ -0,0 +1,79 @@ +# +# Copyright (C) 2005-2011 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:=libgpg-error +PKG_VERSION:=1.9 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.gnupg.org/gcrypt/libgpg-error +PKG_MD5SUM:=521b98aa9395e7eaf0ef2236233a0796 + +PKG_BUILD_PARALLEL:=1 +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libgpg-error + SECTION:=libs + CATEGORY:=Libraries + TITLE:=GnuPG error handling helper library + URL:=http://www.gnupg.org/related_software/libgpg-error/ +endef + +define Package/libgpg-error/description + An helper library for common error codes and descriptions. + This is a library that defines common error values for all GnuPG + components. Among these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt, + Libksba, DirMngr, Pinentry, SmartCard Daemon and possibly more in the + future. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-rpath + +define Build/InstallDev + $(INSTALL_DIR) $(2)/bin $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/gpg-error-config \ + $(2)/bin/ + $(SED) \ + 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ + $(2)/bin/gpg-error-config + ln -sf $(STAGING_DIR)/host/bin/gpg-error-config $(1)/usr/bin/gpg-error-config + + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/gpg-error.h \ + $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libgpg-error.{la,a,so*} \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/share/aclocal + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/aclocal/gpg-error.m4 \ + $(1)/usr/share/aclocal/ +endef + +define Package/libgpg-error/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libgpg-error.so.* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libgpg-error)) diff --git a/libs/libgphoto2/Makefile b/libs/libgphoto2/Makefile new file mode 100644 index 0000000..cc45ece --- /dev/null +++ b/libs/libgphoto2/Makefile @@ -0,0 +1,103 @@ +# +# Copyright (C) 2006-2012 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:=libgphoto2 +PKG_VERSION:=2.4.12 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/gphoto +PKG_MD5SUM:=735c50ebb15cb8be61bac400ee4afb1e + +PKG_FIXUP:=autoreconf +PKG_LIBTOOL_PATHS:=. libgphoto2_port +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/libgphoto2/Default + SECTION:=libs + CATEGORY:=Libraries + URL:=http://www.gphoto.org/ +endef + +define Package/libgphoto2 + $(call Package/libgphoto2/Default) + DEPENDS:=+libexif +libjpeg +libpthread +libltdl $(ICONV_DEPENDS) + TITLE:=The basic library of the gphoto2 program. + MENU:=1 +endef + +define Package/libgphoto2-drivers + $(call Package/libgphoto2/Default) + DEPENDS:=libgphoto2 +libusb-1.0 +libgd + TITLE:=Gphoto2 drivers for various cameras +endef + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-rpath \ + --with-drivers=all \ + --without-included-ltdl \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + +CONFIGURE_VARS += \ + CPPFLAGS="$$$$CPPFLAGS $(ICONV_CFLAGS)" \ + LDFLAGS="$$$$LDFLAGS $(ICONV_LDFLAGS)" \ + LIBEXIF_CFLAGS="$$$$CPPFLAGS" \ + LIBEXIF_LIBS="$$$$LDFLAGS -lexif" \ + LIBUSB_CFLAGS="$$$$CPPFLAGS" \ + LIBUSB_LIBS="$$$$LDFLAGS -lusb" \ + LIBS="-lltdl" \ + +# If OpenWrt is using the iconv stub, we disable iconv support +# in libgphoto2 entirely since the stub lacks some essential +# conversions like UCS-2 to UTF-8 which will let certain drivers +# fail with "Failed to create iconv converter" . +ifneq ($(ICONV_FULL),1) + CONFIGURE_VARS += am_cv_func_iconv=no am_cv_lib_iconv=no +endif + +MAKE_FLAGS += \ + LIBLTDL="" \ + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gphoto2{,-port}-config $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/gphoto2 $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgphoto2.pc $(1)/usr/lib/pkgconfig/ + $(SED) 's,-I$$$${prefix}/include/gphoto2,,g' $(1)/usr/bin/gphoto2{,-port}-config + $(SED) 's,-I$$$${prefix}/include,,g' $(1)/usr/bin/gphoto2{,-port}-config + # remove annoying recursive symlink + rm -f $(1)/usr/include/gphoto2/gphoto2 +endef + +define Package/libgphoto2/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.so.* $(1)/usr/lib/ +endef + +define Package/libgphoto2-drivers/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port} $(1)/usr/lib/ + rm -rf $(1)/usr/lib/libgphoto2{,_port}/*/*.{,l}a + rm -f $(1)/usr/lib/libgphoto2_port/*/usb.so +endef + +$(eval $(call BuildPackage,libgphoto2)) +$(eval $(call BuildPackage,libgphoto2-drivers)) diff --git a/libs/libgphoto2/patches/001-automake-compat.patch b/libs/libgphoto2/patches/001-automake-compat.patch new file mode 100644 index 0000000..60e47c8 --- /dev/null +++ b/libs/libgphoto2/patches/001-automake-compat.patch @@ -0,0 +1,53 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -227,7 +227,6 @@ ALL_LINGUAS="da de es eu fr hu it ja nl + GP_GETTEXT_HACK([${PACKAGE}-${LIBGPHOTO2_CURRENT_MIN}],[The gPhoto Team],[${MAIL_GPHOTO_TRANSLATION}]) + AM_GNU_GETTEXT_VERSION([0.14.1]) + AM_GNU_GETTEXT([external]) +-AM_PO_SUBDIRS() + AM_ICONV() + GP_GETTEXT_FLAGS() + +--- a/libgphoto2_port/configure.ac ++++ b/libgphoto2_port/configure.ac +@@ -116,7 +116,6 @@ GP_GETTEXT_HACK([${PACKAGE}-${LIBGPHOTO2 + ALL_LINGUAS="cs da de fr es eu it ja nl pl pt_BR ru sk sv uk vi zh_CN zh_TW" + AM_GNU_GETTEXT_VERSION([0.14.1]) + AM_GNU_GETTEXT([external]) +-AM_PO_SUBDIRS() + AM_ICONV() + GP_GETTEXT_FLAGS() + +--- a/libgphoto2_port/libgphoto2_port/Makefile.in ++++ b/libgphoto2_port/libgphoto2_port/Makefile.in +@@ -15,6 +15,8 @@ + + @SET_MAKE@ + ++SHELL = @SHELL@ ++ + VPATH = @srcdir@ + pkgdatadir = $(datadir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ +--- a/libgphoto2_port/Makefile.in ++++ b/libgphoto2_port/Makefile.in +@@ -15,7 +15,7 @@ + + @SET_MAKE@ + +- ++SHELL = @SHELL@ + + VPATH = @srcdir@ + pkgdatadir = $(datadir)/@PACKAGE@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -20,7 +20,7 @@ + ######################################################################## + # put file lists and special compile rules here + +- ++SHELL = @SHELL@ + + VPATH = @srcdir@ + pkgdatadir = $(datadir)/@PACKAGE@ diff --git a/libs/libgphoto2/patches/002-no-tests-docs-examples-translations.patch b/libs/libgphoto2/patches/002-no-tests-docs-examples-translations.patch new file mode 100644 index 0000000..702e4cf --- /dev/null +++ b/libs/libgphoto2/patches/002-no-tests-docs-examples-translations.patch @@ -0,0 +1,86 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -637,20 +637,11 @@ camlibs/konica/localization/Makefile + libgphoto2/Makefile + libgphoto2.pc + libgphoto2-uninstalled.pc +-examples/Makefile +-tests/Makefile +-tests/check-camera-list.sh +-tests/ddb/Makefile +-tests/ddb/check-ddb.sh + packaging/Makefile + packaging/linux-hotplug/Makefile + packaging/generic/Makefile + packaging/rpm/Makefile + packaging/rpm/package.spec +-po/Makefile.in +-doc/Makefile +-doc/Doxyfile +-doc/api/Makefile + ],[ + dnl This relies on this code being called for each of the above files + dnl with ac_file set to the filename. +--- a/libgphoto2_port/configure.ac ++++ b/libgphoto2_port/configure.ac +@@ -485,7 +485,6 @@ AC_SUBST([AM_LDFLAGS]) + # --------------------------------------------------------------------------- + AC_CONFIG_FILES([ + Makefile +-po/Makefile.in + libgphoto2_port/Makefile + libgphoto2_port.pc + libgphoto2_port-uninstalled.pc +@@ -497,8 +496,6 @@ usbscsi/Makefile + disk/Makefile + ptpip/Makefile + gphoto2-port-config +-test/Makefile +-doc/Makefile + m4/Makefile + ]) + AC_OUTPUT +--- a/libgphoto2_port/Makefile.am ++++ b/libgphoto2_port/Makefile.am +@@ -10,7 +10,7 @@ VERSION_FLAGS = -DLIBGPPORT_VERSION=\"@L + bin_SCRIPTS = gphoto2-port-config + + # Note: @subdirs@ lists all the directories from AC_CONFIG_SUBDIRS() +-SUBDIRS = po libgphoto2_port test @IOLIB_SUBDIRS@ doc m4 ++SUBDIRS = libgphoto2_port @IOLIB_SUBDIRS@ m4 + + EXTRA_DIST = \ + AUTHORS \ +--- a/libgphoto2_port/Makefile.in ++++ b/libgphoto2_port/Makefile.in +@@ -325,7 +325,7 @@ VERSION_FLAGS = -DLIBGPPORT_VERSION=\"@L + bin_SCRIPTS = gphoto2-port-config + + # Note: @subdirs@ lists all the directories from AC_CONFIG_SUBDIRS() +-SUBDIRS = po libgphoto2_port test @IOLIB_SUBDIRS@ doc m4 ++SUBDIRS = libgphoto2_port @IOLIB_SUBDIRS@ m4 + EXTRA_DIST = AUTHORS ChangeLog COPYING.LIB NEWS README iolib.sym \ + gphoto2-port-config.in libgphoto2_port.pc.in \ + libgphoto2_port-uninstalled.pc.in \ +--- a/Makefile.am ++++ b/Makefile.am +@@ -8,7 +8,7 @@ bin_SCRIPTS = gphoto2-config + EXTRA_DIST = HACKING MAINTAINERS TESTERS installcheck.mk README.packaging + + # Note: @subdirs@ lists all the directories from AC_CONFIG_SUBDIRS() +-SUBDIRS = @subdirs@ libgphoto2 camlibs tests examples po packaging doc ++SUBDIRS = @subdirs@ libgphoto2 camlibs packaging + + EXTRA_DIST += libgphoto2.pc.in + pkgconfig_DATA = libgphoto2.pc +--- a/Makefile.in ++++ b/Makefile.in +@@ -357,7 +357,7 @@ EXTRA_DIST = HACKING MAINTAINERS TESTERS + ChangeLog INSTALL README.in README README.packaging + + # Note: @subdirs@ lists all the directories from AC_CONFIG_SUBDIRS() +-SUBDIRS = @subdirs@ libgphoto2 camlibs tests examples po packaging doc ++SUBDIRS = @subdirs@ libgphoto2 camlibs packaging + pkgconfig_DATA = libgphoto2.pc + noinst_DATA = libgphoto2-uninstalled.pc + doc_DATA = AUTHORS COPYING NEWS ABOUT-NLS ChangeLog README \ diff --git a/libs/libgssapi/Makefile b/libs/libgssapi/Makefile new file mode 100644 index 0000000..01de32d --- /dev/null +++ b/libs/libgssapi/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libgssapi +PKG_VERSION:=0.11 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.citi.umich.edu/projects/nfsv4/linux/libgssapi/ +PKG_MD5SUM:=0e5b4c7267724f8ddf64bc35514c272e + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/libgssapi + SECTION:=libs + CATEGORY:=Libraries + TITLE:=required libraries for the nfs-utils + URL:=http://www.citi.umich.edu/projects/nfsv4/linux +endef + +define Package/libgssapi/description + Support libraries - for newer nfs mount command (nfs4) +endef + +TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/lib $(FPIC) + +MAKE_FLAGS += \ + OPT="$(TARGET_CFLAGS)" \ + INSTALLSUID="install -m 4755" \ + DESTDIR="$(PKG_INSTALL_DIR)" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/gssglue/gssapi + $(CP) $(PKG_INSTALL_DIR)/usr/include/gssglue/gssapi/gssapi.h $(1)/usr/include/gssglue/gssapi + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgssapi.{a,so*} $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgssapi.pc $(1)/usr/lib/pkgconfig +endef + +$(eval $(call BuildPackage,libgssapi)) diff --git a/libs/libiconv-full/Makefile b/libs/libiconv-full/Makefile new file mode 100644 index 0000000..ebacb3e --- /dev/null +++ b/libs/libiconv-full/Makefile @@ -0,0 +1,86 @@ +# +# Copyright (C) 2006-2009 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:=libiconv-full +PKG_VERSION:=1.11.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=libiconv-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/libiconv +PKG_MD5SUM:=d42b97f6ef5dd0ba4469d520ed732fed +PKG_BUILD_DIR:=$(BUILD_DIR)/libiconv-$(PKG_VERSION) + +PKG_FIXUP:=patch-libtool + +include $(INCLUDE_DIR)/package.mk + +define Package/libiconv-full/Default + URL:=http://www.gnu.org/software/libiconv/ + TITLE:=Character set conversion +endef + +define Package/libiconv-full + $(call Package/libiconv-full/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= library +endef + +define Package/libcharset + $(call Package/libiconv-full/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= library +endef + +define Package/iconv + $(call Package/libiconv-full/Default) + DEPENDS:=+libiconv-full +libcharset + SECTION:=utils + CATEGORY:=Utilities + TITLE+= utility +endef + +TARGET_CFLAGS += $(FPIC) -DUSE_DOS + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-rpath \ + --enable-relocatable + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib/libiconv-full/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/iconv.h $(1)/usr/lib/libiconv-full/include/ + + $(INSTALL_DIR) $(1)/usr/lib/libiconv-full/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcharset.{a,so*} $(1)/usr/lib/libiconv-full/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiconv.{a,so*} $(1)/usr/lib/libiconv-full/lib/ +endef + +define Package/libcharset/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcharset.so* $(1)/usr/lib/ +endef + +define Package/libiconv-full/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiconv.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libcharset)) +$(eval $(call BuildPackage,libiconv-full)) +$(eval $(call BuildPackage,iconv)) diff --git a/libs/libiconv-full/patches/100-strip_charsets.patch b/libs/libiconv-full/patches/100-strip_charsets.patch new file mode 100644 index 0000000..e4f49ae --- /dev/null +++ b/libs/libiconv-full/patches/100-strip_charsets.patch @@ -0,0 +1,3438 @@ +--- a/lib/aliases_dos.h ++++ b/lib/aliases_dos.h +@@ -2,47 +2,3 @@ + S(dos_1, "IBM437", ei_cp437 ) + S(dos_2, "437", ei_cp437 ) + S(dos_3, "CSPC8CODEPAGE437", ei_cp437 ) +- S(dos_4, "CP737", ei_cp737 ) +- S(dos_5, "CP775", ei_cp775 ) +- S(dos_6, "IBM775", ei_cp775 ) +- S(dos_7, "CSPC775BALTIC", ei_cp775 ) +- S(dos_8, "CP852", ei_cp852 ) +- S(dos_9, "IBM852", ei_cp852 ) +- S(dos_10, "852", ei_cp852 ) +- S(dos_11, "CSPCP852", ei_cp852 ) +- S(dos_12, "CP853", ei_cp853 ) +- S(dos_13, "CP855", ei_cp855 ) +- S(dos_14, "IBM855", ei_cp855 ) +- S(dos_15, "855", ei_cp855 ) +- S(dos_16, "CSIBM855", ei_cp855 ) +- S(dos_17, "CP857", ei_cp857 ) +- S(dos_18, "IBM857", ei_cp857 ) +- S(dos_19, "857", ei_cp857 ) +- S(dos_20, "CSIBM857", ei_cp857 ) +- S(dos_21, "CP858", ei_cp858 ) +- S(dos_22, "CP860", ei_cp860 ) +- S(dos_23, "IBM860", ei_cp860 ) +- S(dos_24, "860", ei_cp860 ) +- S(dos_25, "CSIBM860", ei_cp860 ) +- S(dos_26, "CP861", ei_cp861 ) +- S(dos_27, "IBM861", ei_cp861 ) +- S(dos_28, "861", ei_cp861 ) +- S(dos_29, "CP-IS", ei_cp861 ) +- S(dos_30, "CSIBM861", ei_cp861 ) +- S(dos_31, "CP863", ei_cp863 ) +- S(dos_32, "IBM863", ei_cp863 ) +- S(dos_33, "863", ei_cp863 ) +- S(dos_34, "CSIBM863", ei_cp863 ) +- S(dos_35, "CP864", ei_cp864 ) +- S(dos_36, "IBM864", ei_cp864 ) +- S(dos_37, "CSIBM864", ei_cp864 ) +- S(dos_38, "CP865", ei_cp865 ) +- S(dos_39, "IBM865", ei_cp865 ) +- S(dos_40, "865", ei_cp865 ) +- S(dos_41, "CSIBM865", ei_cp865 ) +- S(dos_42, "CP869", ei_cp869 ) +- S(dos_43, "IBM869", ei_cp869 ) +- S(dos_44, "869", ei_cp869 ) +- S(dos_45, "CP-GR", ei_cp869 ) +- S(dos_46, "CSIBM869", ei_cp869 ) +- S(dos_47, "CP1125", ei_cp1125 ) +--- a/lib/aliases.gperf ++++ b/lib/aliases.gperf +@@ -48,8 +48,6 @@ UCS-2-INTERNAL, ei_ucs2internal + UCS-2-SWAPPED, ei_ucs2swapped + UCS-4-INTERNAL, ei_ucs4internal + UCS-4-SWAPPED, ei_ucs4swapped +-C99, ei_c99 +-JAVA, ei_java + ISO-8859-1, ei_iso8859_1 + ISO_8859-1, ei_iso8859_1 + ISO_8859-1:1987, ei_iso8859_1 +@@ -68,285 +66,16 @@ LATIN2, ei_iso8859_2 + L2, ei_iso8859_2 + CSISOLATIN2, ei_iso8859_2 + ISO8859-2, ei_iso8859_2 +-ISO-8859-3, ei_iso8859_3 +-ISO_8859-3, ei_iso8859_3 +-ISO_8859-3:1988, ei_iso8859_3 +-ISO-IR-109, ei_iso8859_3 +-LATIN3, ei_iso8859_3 +-L3, ei_iso8859_3 +-CSISOLATIN3, ei_iso8859_3 +-ISO8859-3, ei_iso8859_3 +-ISO-8859-4, ei_iso8859_4 +-ISO_8859-4, ei_iso8859_4 +-ISO_8859-4:1988, ei_iso8859_4 +-ISO-IR-110, ei_iso8859_4 +-LATIN4, ei_iso8859_4 +-L4, ei_iso8859_4 +-CSISOLATIN4, ei_iso8859_4 +-ISO8859-4, ei_iso8859_4 +-ISO-8859-5, ei_iso8859_5 +-ISO_8859-5, ei_iso8859_5 +-ISO_8859-5:1988, ei_iso8859_5 +-ISO-IR-144, ei_iso8859_5 +-CYRILLIC, ei_iso8859_5 +-CSISOLATINCYRILLIC, ei_iso8859_5 +-ISO8859-5, ei_iso8859_5 +-ISO-8859-6, ei_iso8859_6 +-ISO_8859-6, ei_iso8859_6 +-ISO_8859-6:1987, ei_iso8859_6 +-ISO-IR-127, ei_iso8859_6 +-ECMA-114, ei_iso8859_6 +-ASMO-708, ei_iso8859_6 +-ARABIC, ei_iso8859_6 +-CSISOLATINARABIC, ei_iso8859_6 +-ISO8859-6, ei_iso8859_6 +-ISO-8859-7, ei_iso8859_7 +-ISO_8859-7, ei_iso8859_7 +-ISO_8859-7:1987, ei_iso8859_7 +-ISO_8859-7:2003, ei_iso8859_7 +-ISO-IR-126, ei_iso8859_7 +-ECMA-118, ei_iso8859_7 +-ELOT_928, ei_iso8859_7 +-GREEK8, ei_iso8859_7 +-GREEK, ei_iso8859_7 +-CSISOLATINGREEK, ei_iso8859_7 +-ISO8859-7, ei_iso8859_7 +-ISO-8859-8, ei_iso8859_8 +-ISO_8859-8, ei_iso8859_8 +-ISO_8859-8:1988, ei_iso8859_8 +-ISO-IR-138, ei_iso8859_8 +-HEBREW, ei_iso8859_8 +-CSISOLATINHEBREW, ei_iso8859_8 +-ISO8859-8, ei_iso8859_8 +-ISO-8859-9, ei_iso8859_9 +-ISO_8859-9, ei_iso8859_9 +-ISO_8859-9:1989, ei_iso8859_9 +-ISO-IR-148, ei_iso8859_9 +-LATIN5, ei_iso8859_9 +-L5, ei_iso8859_9 +-CSISOLATIN5, ei_iso8859_9 +-ISO8859-9, ei_iso8859_9 +-ISO-8859-10, ei_iso8859_10 +-ISO_8859-10, ei_iso8859_10 +-ISO_8859-10:1992, ei_iso8859_10 +-ISO-IR-157, ei_iso8859_10 +-LATIN6, ei_iso8859_10 +-L6, ei_iso8859_10 +-CSISOLATIN6, ei_iso8859_10 +-ISO8859-10, ei_iso8859_10 +-ISO-8859-11, ei_iso8859_11 +-ISO_8859-11, ei_iso8859_11 +-ISO8859-11, ei_iso8859_11 +-ISO-8859-13, ei_iso8859_13 +-ISO_8859-13, ei_iso8859_13 +-ISO-IR-179, ei_iso8859_13 +-LATIN7, ei_iso8859_13 +-L7, ei_iso8859_13 +-ISO8859-13, ei_iso8859_13 +-ISO-8859-14, ei_iso8859_14 +-ISO_8859-14, ei_iso8859_14 +-ISO_8859-14:1998, ei_iso8859_14 +-ISO-IR-199, ei_iso8859_14 +-LATIN8, ei_iso8859_14 +-L8, ei_iso8859_14 +-ISO-CELTIC, ei_iso8859_14 +-ISO8859-14, ei_iso8859_14 + ISO-8859-15, ei_iso8859_15 + ISO_8859-15, ei_iso8859_15 + ISO_8859-15:1998, ei_iso8859_15 + ISO-IR-203, ei_iso8859_15 + LATIN-9, ei_iso8859_15 + ISO8859-15, ei_iso8859_15 +-ISO-8859-16, ei_iso8859_16 +-ISO_8859-16, ei_iso8859_16 +-ISO_8859-16:2001, ei_iso8859_16 +-ISO-IR-226, ei_iso8859_16 +-LATIN10, ei_iso8859_16 +-L10, ei_iso8859_16 +-ISO8859-16, ei_iso8859_16 + KOI8-R, ei_koi8_r + CSKOI8R, ei_koi8_r +-KOI8-U, ei_koi8_u +-KOI8-RU, ei_koi8_ru + CP1250, ei_cp1250 + WINDOWS-1250, ei_cp1250 + MS-EE, ei_cp1250 +-CP1251, ei_cp1251 +-WINDOWS-1251, ei_cp1251 +-MS-CYRL, ei_cp1251 +-CP1252, ei_cp1252 +-WINDOWS-1252, ei_cp1252 +-MS-ANSI, ei_cp1252 +-CP1253, ei_cp1253 +-WINDOWS-1253, ei_cp1253 +-MS-GREEK, ei_cp1253 +-CP1254, ei_cp1254 +-WINDOWS-1254, ei_cp1254 +-MS-TURK, ei_cp1254 +-CP1255, ei_cp1255 +-WINDOWS-1255, ei_cp1255 +-MS-HEBR, ei_cp1255 +-CP1256, ei_cp1256 +-WINDOWS-1256, ei_cp1256 +-MS-ARAB, ei_cp1256 +-CP1257, ei_cp1257 +-WINDOWS-1257, ei_cp1257 +-WINBALTRIM, ei_cp1257 +-CP1258, ei_cp1258 +-WINDOWS-1258, ei_cp1258 +-CP850, ei_cp850 +-IBM850, ei_cp850 +-850, ei_cp850 +-CSPC850MULTILINGUAL, ei_cp850 +-CP862, ei_cp862 +-IBM862, ei_cp862 +-862, ei_cp862 +-CSPC862LATINHEBREW, ei_cp862 +-CP866, ei_cp866 +-IBM866, ei_cp866 +-866, ei_cp866 +-CSIBM866, ei_cp866 +-MACROMAN, ei_mac_roman +-MACINTOSH, ei_mac_roman +-MAC, ei_mac_roman +-CSMACINTOSH, ei_mac_roman +-MACCENTRALEUROPE, ei_mac_centraleurope +-MACICELAND, ei_mac_iceland +-MACCROATIAN, ei_mac_croatian +-MACROMANIA, ei_mac_romania +-MACCYRILLIC, ei_mac_cyrillic +-MACUKRAINE, ei_mac_ukraine +-MACGREEK, ei_mac_greek +-MACTURKISH, ei_mac_turkish +-MACHEBREW, ei_mac_hebrew +-MACARABIC, ei_mac_arabic +-MACTHAI, ei_mac_thai +-HP-ROMAN8, ei_hp_roman8 +-ROMAN8, ei_hp_roman8 +-R8, ei_hp_roman8 +-CSHPROMAN8, ei_hp_roman8 +-NEXTSTEP, ei_nextstep +-ARMSCII-8, ei_armscii_8 +-GEORGIAN-ACADEMY, ei_georgian_academy +-GEORGIAN-PS, ei_georgian_ps +-KOI8-T, ei_koi8_t +-PT154, ei_pt154 +-PTCP154, ei_pt154 +-CP154, ei_pt154 +-CYRILLIC-ASIAN, ei_pt154 +-CSPTCP154, ei_pt154 +-MULELAO-1, ei_mulelao +-CP1133, ei_cp1133 +-IBM-CP1133, ei_cp1133 +-TIS-620, ei_tis620 +-TIS620, ei_tis620 +-TIS620-0, ei_tis620 +-TIS620.2529-1, ei_tis620 +-TIS620.2533-0, ei_tis620 +-TIS620.2533-1, ei_tis620 +-ISO-IR-166, ei_tis620 +-CP874, ei_cp874 +-WINDOWS-874, ei_cp874 +-VISCII, ei_viscii +-VISCII1.1-1, ei_viscii +-CSVISCII, ei_viscii +-TCVN, ei_tcvn +-TCVN-5712, ei_tcvn +-TCVN5712-1, ei_tcvn +-TCVN5712-1:1993, ei_tcvn +-JIS_C6220-1969-RO, ei_iso646_jp +-ISO646-JP, ei_iso646_jp +-ISO-IR-14, ei_iso646_jp +-JP, ei_iso646_jp +-CSISO14JISC6220RO, ei_iso646_jp +-JIS_X0201, ei_jisx0201 +-JISX0201-1976, ei_jisx0201 +-X0201, ei_jisx0201 +-CSHALFWIDTHKATAKANA, ei_jisx0201 +-JIS_X0208, ei_jisx0208 +-JIS_X0208-1983, ei_jisx0208 +-JIS_X0208-1990, ei_jisx0208 +-JIS0208, ei_jisx0208 +-X0208, ei_jisx0208 +-ISO-IR-87, ei_jisx0208 +-JIS_C6226-1983, ei_jisx0208 +-CSISO87JISX0208, ei_jisx0208 +-JIS_X0212, ei_jisx0212 +-JIS_X0212.1990-0, ei_jisx0212 +-JIS_X0212-1990, ei_jisx0212 +-X0212, ei_jisx0212 +-ISO-IR-159, ei_jisx0212 +-CSISO159JISX02121990, ei_jisx0212 +-GB_1988-80, ei_iso646_cn +-ISO646-CN, ei_iso646_cn +-ISO-IR-57, ei_iso646_cn +-CN, ei_iso646_cn +-CSISO57GB1988, ei_iso646_cn +-GB_2312-80, ei_gb2312 +-ISO-IR-58, ei_gb2312 +-CSISO58GB231280, ei_gb2312 +-CHINESE, ei_gb2312 +-ISO-IR-165, ei_isoir165 +-CN-GB-ISOIR165, ei_isoir165 +-KSC_5601, ei_ksc5601 +-KS_C_5601-1987, ei_ksc5601 +-KS_C_5601-1989, ei_ksc5601 +-ISO-IR-149, ei_ksc5601 +-CSKSC56011987, ei_ksc5601 +-KOREAN, ei_ksc5601 +-EUC-JP, ei_euc_jp +-EUCJP, ei_euc_jp +-EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE, ei_euc_jp +-CSEUCPKDFMTJAPANESE, ei_euc_jp +-SHIFT_JIS, ei_sjis +-SHIFT-JIS, ei_sjis +-SJIS, ei_sjis +-MS_KANJI, ei_sjis +-CSSHIFTJIS, ei_sjis +-CP932, ei_cp932 +-ISO-2022-JP, ei_iso2022_jp +-CSISO2022JP, ei_iso2022_jp +-ISO-2022-JP-1, ei_iso2022_jp1 +-ISO-2022-JP-2, ei_iso2022_jp2 +-CSISO2022JP2, ei_iso2022_jp2 +-EUC-CN, ei_euc_cn +-EUCCN, ei_euc_cn +-GB2312, ei_euc_cn +-CN-GB, ei_euc_cn +-CSGB2312, ei_euc_cn +-GBK, ei_ces_gbk +-CP936, ei_cp936 +-MS936, ei_cp936 +-WINDOWS-936, ei_cp936 +-GB18030, ei_gb18030 +-ISO-2022-CN, ei_iso2022_cn +-CSISO2022CN, ei_iso2022_cn +-ISO-2022-CN-EXT, ei_iso2022_cn_ext +-HZ, ei_hz +-HZ-GB-2312, ei_hz +-EUC-TW, ei_euc_tw +-EUCTW, ei_euc_tw +-CSEUCTW, ei_euc_tw +-BIG5, ei_ces_big5 +-BIG-5, ei_ces_big5 +-BIG-FIVE, ei_ces_big5 +-BIGFIVE, ei_ces_big5 +-CN-BIG5, ei_ces_big5 +-CSBIG5, ei_ces_big5 +-CP950, ei_cp950 +-BIG5-HKSCS:1999, ei_big5hkscs1999 +-BIG5-HKSCS:2001, ei_big5hkscs2001 +-BIG5-HKSCS, ei_big5hkscs2004 +-BIG5HKSCS, ei_big5hkscs2004 +-BIG5-HKSCS:2004, ei_big5hkscs2004 +-EUC-KR, ei_euc_kr +-EUCKR, ei_euc_kr +-CSEUCKR, ei_euc_kr +-CP949, ei_cp949 +-UHC, ei_cp949 +-JOHAB, ei_johab +-CP1361, ei_johab +-ISO-2022-KR, ei_iso2022_kr +-CSISO2022KR, ei_iso2022_kr + CHAR, ei_local_char + WCHAR_T, ei_local_wchar_t +--- a/lib/aliases.h ++++ b/lib/aliases.h +@@ -1,6 +1,6 @@ + /* ANSI-C code produced by gperf version 3.0.2 */ + /* Command-line: gperf -m 10 lib/aliases.gperf */ +-/* Computed positions: -k'1,3-11,$' */ ++/* Computed positions: -k'4-7,10,$' */ + + #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ +@@ -32,12 +32,12 @@ + #line 1 "lib/aliases.gperf" + struct alias { int name; unsigned int encoding_index; }; + +-#define TOTAL_KEYWORDS 341 ++#define TOTAL_KEYWORDS 70 + #define MIN_WORD_LENGTH 2 +-#define MAX_WORD_LENGTH 45 +-#define MIN_HASH_VALUE 13 +-#define MAX_HASH_VALUE 997 +-/* maximum key range = 985, duplicates = 0 */ ++#define MAX_WORD_LENGTH 17 ++#define MIN_HASH_VALUE 4 ++#define MAX_HASH_VALUE 98 ++/* maximum key range = 95, duplicates = 0 */ + + #ifdef __GNUC__ + __inline +@@ -49,38 +49,31 @@ inline + static unsigned int + aliases_hash (register const char *str, register unsigned int len) + { +- static const unsigned short asso_values[] = ++ static const unsigned char asso_values[] = + { +- 998, 998, 998, 998, 998, 998, 998, 998, 998, 998, +- 998, 998, 998, 998, 998, 998, 998, 998, 998, 998, +- 998, 998, 998, 998, 998, 998, 998, 998, 998, 998, +- 998, 998, 998, 998, 998, 998, 998, 998, 998, 998, +- 998, 998, 998, 998, 998, 4, 199, 998, 79, 6, +- 29, 65, 13, 15, 4, 88, 20, 22, 386, 998, +- 998, 998, 998, 998, 998, 47, 188, 110, 6, 26, +- 63, 19, 12, 5, 281, 202, 7, 166, 11, 5, +- 64, 998, 4, 11, 20, 185, 110, 152, 163, 4, +- 4, 998, 998, 998, 998, 5, 998, 998, 998, 998, +- 998, 998, 998, 998, 998, 998, 998, 998, 998, 998, +- 998, 998, 998, 998, 998, 998, 998, 998, 998, 998, +- 998, 998, 998, 998, 998, 998, 998, 998 ++ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, ++ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, ++ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, ++ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, ++ 99, 99, 99, 99, 99, 6, 99, 99, 22, 3, ++ 2, 2, 17, 3, 2, 7, 3, 2, 99, 99, ++ 99, 99, 99, 99, 99, 4, 53, 2, 21, 2, ++ 99, 7, 99, 15, 99, 99, 19, 99, 33, 2, ++ 4, 99, 11, 26, 17, 99, 99, 3, 26, 99, ++ 99, 99, 99, 99, 99, 10, 99, 99, 99, 99, ++ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, ++ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, ++ 99, 99, 99, 99, 99, 99, 99, 99 + }; + register int hval = len; + + switch (hval) + { + default: +- hval += asso_values[(unsigned char)str[10]]; +- /*FALLTHROUGH*/ +- case 10: + hval += asso_values[(unsigned char)str[9]]; + /*FALLTHROUGH*/ + case 9: +- hval += asso_values[(unsigned char)str[8]]; +- /*FALLTHROUGH*/ + case 8: +- hval += asso_values[(unsigned char)str[7]]; +- /*FALLTHROUGH*/ + case 7: + hval += asso_values[(unsigned char)str[6]]; + /*FALLTHROUGH*/ +@@ -94,11 +87,7 @@ aliases_hash (register const char *str, + hval += asso_values[(unsigned char)str[3]]; + /*FALLTHROUGH*/ + case 3: +- hval += asso_values[(unsigned char)str[2]]; +- /*FALLTHROUGH*/ + case 2: +- case 1: +- hval += asso_values[(unsigned char)str[0]]; + break; + } + return hval + asso_values[(unsigned char)str[len - 1]]; +@@ -106,1576 +95,306 @@ aliases_hash (register const char *str, + + struct stringpool_t + { +- char stringpool_str13[sizeof("L6")]; +- char stringpool_str15[sizeof("L1")]; +- char stringpool_str18[sizeof("HZ")]; +- char stringpool_str22[sizeof("L4")]; +- char stringpool_str24[sizeof("L5")]; +- char stringpool_str26[sizeof("R8")]; +- char stringpool_str29[sizeof("L8")]; +- char stringpool_str31[sizeof("866")]; +- char stringpool_str38[sizeof("L2")]; +- char stringpool_str42[sizeof("SJIS")]; +- char stringpool_str43[sizeof("ISO-IR-6")]; +- char stringpool_str55[sizeof("ISO-IR-166")]; +- char stringpool_str57[sizeof("LATIN6")]; +- char stringpool_str61[sizeof("LATIN1")]; +- char stringpool_str68[sizeof("ISO-IR-14")]; +- char stringpool_str74[sizeof("L3")]; +- char stringpool_str75[sizeof("LATIN4")]; +- char stringpool_str77[sizeof("ISO-IR-165")]; +- char stringpool_str79[sizeof("LATIN5")]; +- char stringpool_str80[sizeof("ISO-IR-126")]; +- char stringpool_str81[sizeof("862")]; +- char stringpool_str82[sizeof("ISO-IR-144")]; +- char stringpool_str89[sizeof("LATIN8")]; +- char stringpool_str91[sizeof("ISO-IR-58")]; +- char stringpool_str96[sizeof("ISO-IR-148")]; +- char stringpool_str97[sizeof("L7")]; +- char stringpool_str98[sizeof("LATIN-9")]; +- char stringpool_str100[sizeof("ISO-IR-149")]; +- char stringpool_str102[sizeof("ISO-IR-159")]; +- char stringpool_str103[sizeof("ISO-IR-226")]; +- char stringpool_str107[sizeof("LATIN2")]; +- char stringpool_str108[sizeof("ISO8859-6")]; +- char stringpool_str109[sizeof("ISO-IR-199")]; +- char stringpool_str112[sizeof("ISO8859-1")]; +- char stringpool_str113[sizeof("ISO-8859-6")]; +- char stringpool_str114[sizeof("ISO_8859-6")]; +- char stringpool_str115[sizeof("ISO8859-16")]; +- char stringpool_str116[sizeof("PT154")]; +- char stringpool_str117[sizeof("ISO-8859-1")]; +- char stringpool_str118[sizeof("ISO_8859-1")]; +- char stringpool_str119[sizeof("ISO8859-11")]; +- char stringpool_str120[sizeof("ISO-8859-16")]; +- char stringpool_str121[sizeof("ISO_8859-16")]; +- char stringpool_str123[sizeof("CN")]; +- char stringpool_str124[sizeof("ISO-8859-11")]; +- char stringpool_str125[sizeof("ISO_8859-11")]; +- char stringpool_str126[sizeof("ISO8859-4")]; +- char stringpool_str128[sizeof("ISO_8859-16:2001")]; +- char stringpool_str130[sizeof("ISO8859-5")]; +- char stringpool_str131[sizeof("ISO-8859-4")]; +- char stringpool_str132[sizeof("ISO_8859-4")]; +- char stringpool_str133[sizeof("ISO8859-14")]; +- char stringpool_str134[sizeof("ISO-IR-101")]; +- char stringpool_str135[sizeof("ISO-8859-5")]; +- char stringpool_str136[sizeof("ISO_8859-5")]; +- char stringpool_str137[sizeof("ISO8859-15")]; +- char stringpool_str138[sizeof("ISO-8859-14")]; +- char stringpool_str139[sizeof("ISO_8859-14")]; +- char stringpool_str140[sizeof("ISO8859-8")]; +- char stringpool_str142[sizeof("ISO-8859-15")]; +- char stringpool_str143[sizeof("ISO_8859-15")]; +- char stringpool_str144[sizeof("ISO8859-9")]; +- char stringpool_str145[sizeof("ISO-8859-8")]; +- char stringpool_str146[sizeof("ISO_8859-8")]; +- char stringpool_str147[sizeof("CP866")]; +- char stringpool_str148[sizeof("ISO-IR-138")]; +- char stringpool_str149[sizeof("ISO-8859-9")]; +- char stringpool_str150[sizeof("ISO_8859-9")]; +- char stringpool_str151[sizeof("ISO_8859-14:1998")]; +- char stringpool_str153[sizeof("ISO_8859-15:1998")]; +- char stringpool_str155[sizeof("ELOT_928")]; +- char stringpool_str156[sizeof("TCVN")]; +- char stringpool_str157[sizeof("C99")]; +- char stringpool_str158[sizeof("ISO8859-2")]; +- char stringpool_str162[sizeof("CP154")]; +- char stringpool_str163[sizeof("ISO-8859-2")]; +- char stringpool_str164[sizeof("ISO_8859-2")]; +- char stringpool_str166[sizeof("ISO-IR-109")]; +- char stringpool_str168[sizeof("L10")]; +- char stringpool_str169[sizeof("CHAR")]; +- char stringpool_str174[sizeof("CP1256")]; +- char stringpool_str175[sizeof("ISO-IR-179")]; +- char stringpool_str176[sizeof("ISO646-CN")]; +- char stringpool_str177[sizeof("ASCII")]; +- char stringpool_str178[sizeof("CP1251")]; +- char stringpool_str179[sizeof("LATIN3")]; +- char stringpool_str181[sizeof("850")]; +- char stringpool_str183[sizeof("GB2312")]; +- char stringpool_str185[sizeof("CP819")]; +- char stringpool_str192[sizeof("CP1254")]; +- char stringpool_str194[sizeof("CP949")]; +- char stringpool_str196[sizeof("CP1255")]; +- char stringpool_str197[sizeof("CP862")]; +- char stringpool_str198[sizeof("US")]; +- char stringpool_str203[sizeof("CP1361")]; +- char stringpool_str206[sizeof("CP1258")]; +- char stringpool_str207[sizeof("ISO-IR-110")]; +- char stringpool_str209[sizeof("IBM866")]; +- char stringpool_str210[sizeof("CP936")]; +- char stringpool_str211[sizeof("GEORGIAN-PS")]; +- char stringpool_str214[sizeof("LATIN10")]; +- char stringpool_str222[sizeof("CHINESE")]; +- char stringpool_str224[sizeof("CP1252")]; +- char stringpool_str225[sizeof("LATIN7")]; +- char stringpool_str226[sizeof("ISO_8859-10:1992")]; +- char stringpool_str227[sizeof("ISO-IR-57")]; +- char stringpool_str228[sizeof("TIS620")]; +- char stringpool_str230[sizeof("ISO8859-3")]; +- char stringpool_str231[sizeof("UCS-4")]; +- char stringpool_str232[sizeof("ISO-IR-87")]; +- char stringpool_str233[sizeof("TIS-620")]; +- char stringpool_str234[sizeof("ISO-IR-157")]; +- char stringpool_str235[sizeof("ISO-8859-3")]; +- char stringpool_str236[sizeof("ISO_8859-3")]; +- char stringpool_str237[sizeof("ISO8859-13")]; +- char stringpool_str240[sizeof("CSISOLATIN6")]; +- char stringpool_str241[sizeof("BIG5")]; +- char stringpool_str242[sizeof("ISO-8859-13")]; +- char stringpool_str243[sizeof("ISO_8859-13")]; +- char stringpool_str244[sizeof("CSISOLATIN1")]; +- char stringpool_str245[sizeof("KOI8-R")]; +- char stringpool_str246[sizeof("BIG-5")]; +- char stringpool_str247[sizeof("IBM819")]; +- char stringpool_str248[sizeof("ISO-IR-127")]; +- char stringpool_str249[sizeof("CP874")]; +- char stringpool_str251[sizeof("ISO646-US")]; +- char stringpool_str252[sizeof("VISCII")]; +- char stringpool_str253[sizeof("MS-EE")]; +- char stringpool_str256[sizeof("MS-ANSI")]; +- char stringpool_str258[sizeof("CSISOLATIN4")]; +- char stringpool_str259[sizeof("IBM862")]; +- char stringpool_str260[sizeof("CP932")]; +- char stringpool_str261[sizeof("X0212")]; +- char stringpool_str262[sizeof("CSISOLATIN5")]; +- char stringpool_str263[sizeof("UCS-2")]; +- char stringpool_str265[sizeof("ISO8859-10")]; +- char stringpool_str266[sizeof("MS936")]; +- char stringpool_str267[sizeof("WCHAR_T")]; +- char stringpool_str270[sizeof("ISO-8859-10")]; +- char stringpool_str271[sizeof("ISO_8859-10")]; +- char stringpool_str272[sizeof("UTF-16")]; +- char stringpool_str273[sizeof("EUCCN")]; +- char stringpool_str274[sizeof("ROMAN8")]; +- char stringpool_str275[sizeof("ISO-IR-203")]; +- char stringpool_str276[sizeof("ISO8859-7")]; +- char stringpool_str277[sizeof("KOI8-T")]; +- char stringpool_str278[sizeof("EUC-CN")]; +- char stringpool_str279[sizeof("UCS-4LE")]; +- char stringpool_str280[sizeof("ISO-IR-100")]; +- char stringpool_str281[sizeof("ISO-8859-7")]; +- char stringpool_str282[sizeof("ISO_8859-7")]; +- char stringpool_str283[sizeof("MULELAO-1")]; +- char stringpool_str284[sizeof("GB_1988-80")]; +- char stringpool_str288[sizeof("X0201")]; +- char stringpool_str289[sizeof("ECMA-114")]; +- char stringpool_str290[sizeof("CSISOLATIN2")]; +- char stringpool_str291[sizeof("GEORGIAN-ACADEMY")]; +- char stringpool_str292[sizeof("PTCP154")]; +- char stringpool_str295[sizeof("UCS-2LE")]; +- char stringpool_str296[sizeof("CP1253")]; +- char stringpool_str297[sizeof("UTF-8")]; +- char stringpool_str298[sizeof("HP-ROMAN8")]; +- char stringpool_str300[sizeof("CSASCII")]; +- char stringpool_str303[sizeof("ECMA-118")]; +- char stringpool_str304[sizeof("UCS-4-INTERNAL")]; +- char stringpool_str305[sizeof("TCVN5712-1")]; +- char stringpool_str307[sizeof("KOREAN")]; +- char stringpool_str308[sizeof("CP850")]; +- char stringpool_str309[sizeof("MS-CYRL")]; +- char stringpool_str310[sizeof("CP950")]; +- char stringpool_str313[sizeof("TIS620-0")]; +- char stringpool_str316[sizeof("X0208")]; +- char stringpool_str319[sizeof("GREEK8")]; +- char stringpool_str320[sizeof("UCS-2-INTERNAL")]; +- char stringpool_str321[sizeof("TCVN-5712")]; +- char stringpool_str323[sizeof("CP1133")]; +- char stringpool_str324[sizeof("CP1250")]; +- char stringpool_str327[sizeof("ISO-2022-CN")]; +- char stringpool_str329[sizeof("UTF-16LE")]; +- char stringpool_str335[sizeof("CYRILLIC-ASIAN")]; +- char stringpool_str337[sizeof("ISO-10646-UCS-4")]; +- char stringpool_str340[sizeof("ISO-2022-CN-EXT")]; +- char stringpool_str342[sizeof("CP1257")]; +- char stringpool_str345[sizeof("GB_2312-80")]; +- char stringpool_str347[sizeof("JP")]; +- char stringpool_str351[sizeof("EUCKR")]; +- char stringpool_str353[sizeof("ISO-10646-UCS-2")]; +- char stringpool_str354[sizeof("GB18030")]; +- char stringpool_str356[sizeof("EUC-KR")]; +- char stringpool_str357[sizeof("CSKOI8R")]; +- char stringpool_str358[sizeof("CSBIG5")]; +- char stringpool_str360[sizeof("CP367")]; +- char stringpool_str361[sizeof("MACINTOSH")]; +- char stringpool_str362[sizeof("CSISOLATIN3")]; +- char stringpool_str363[sizeof("CN-BIG5")]; +- char stringpool_str366[sizeof("CYRILLIC")]; +- char stringpool_str369[sizeof("CSVISCII")]; +- char stringpool_str370[sizeof("IBM850")]; +- char stringpool_str372[sizeof("MACTHAI")]; +- char stringpool_str374[sizeof("UNICODE-1-1")]; +- char stringpool_str376[sizeof("ISO_646.IRV:1991")]; +- char stringpool_str380[sizeof("US-ASCII")]; +- char stringpool_str381[sizeof("UTF-32")]; +- char stringpool_str384[sizeof("CN-GB-ISOIR165")]; +- char stringpool_str387[sizeof("NEXTSTEP")]; +- char stringpool_str389[sizeof("MAC")]; +- char stringpool_str393[sizeof("EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE")]; +- char stringpool_str394[sizeof("CSISOLATINARABIC")]; +- char stringpool_str395[sizeof("HZ-GB-2312")]; +- char stringpool_str397[sizeof("ARMSCII-8")]; +- char stringpool_str401[sizeof("CSISOLATINHEBREW")]; +- char stringpool_str405[sizeof("ISO-2022-KR")]; +- char stringpool_str407[sizeof("WINDOWS-1256")]; +- char stringpool_str408[sizeof("UHC")]; +- char stringpool_str409[sizeof("WINDOWS-1251")]; +- char stringpool_str411[sizeof("MS-HEBR")]; +- char stringpool_str412[sizeof("ISO-CELTIC")]; +- char stringpool_str413[sizeof("UTF-32LE")]; +- char stringpool_str416[sizeof("WINDOWS-1254")]; +- char stringpool_str418[sizeof("WINDOWS-1255")]; +- char stringpool_str420[sizeof("SHIFT-JIS")]; +- char stringpool_str421[sizeof("SHIFT_JIS")]; +- char stringpool_str422[sizeof("IBM367")]; +- char stringpool_str423[sizeof("WINDOWS-1258")]; +- char stringpool_str424[sizeof("CSPTCP154")]; +- char stringpool_str426[sizeof("GBK")]; +- char stringpool_str428[sizeof("UNICODELITTLE")]; +- char stringpool_str432[sizeof("WINDOWS-1252")]; +- char stringpool_str433[sizeof("UTF-7")]; +- char stringpool_str435[sizeof("KSC_5601")]; +- char stringpool_str437[sizeof("ASMO-708")]; +- char stringpool_str440[sizeof("CSISO2022CN")]; +- char stringpool_str444[sizeof("BIGFIVE")]; +- char stringpool_str447[sizeof("WINDOWS-936")]; +- char stringpool_str448[sizeof("CSUCS4")]; +- char stringpool_str449[sizeof("BIG-FIVE")]; +- char stringpool_str453[sizeof("ISO646-JP")]; +- char stringpool_str456[sizeof("TIS620.2529-1")]; +- char stringpool_str457[sizeof("CSISOLATINGREEK")]; +- char stringpool_str459[sizeof("CSISOLATINCYRILLIC")]; +- char stringpool_str460[sizeof("UCS-4BE")]; +- char stringpool_str462[sizeof("UNICODE-1-1-UTF-7")]; +- char stringpool_str465[sizeof("EUCTW")]; +- char stringpool_str468[sizeof("WINDOWS-1253")]; +- char stringpool_str469[sizeof("CSHPROMAN8")]; +- char stringpool_str470[sizeof("EUC-TW")]; +- char stringpool_str472[sizeof("KS_C_5601-1989")]; +- char stringpool_str476[sizeof("UCS-2BE")]; +- char stringpool_str479[sizeof("VISCII1.1-1")]; +- char stringpool_str480[sizeof("GREEK")]; +- char stringpool_str482[sizeof("WINDOWS-1250")]; +- char stringpool_str483[sizeof("CSGB2312")]; +- char stringpool_str486[sizeof("WINDOWS-874")]; +- char stringpool_str487[sizeof("CSUNICODE11")]; +- char stringpool_str489[sizeof("JAVA")]; +- char stringpool_str491[sizeof("WINDOWS-1257")]; +- char stringpool_str493[sizeof("CSUNICODE")]; +- char stringpool_str500[sizeof("CSHALFWIDTHKATAKANA")]; +- char stringpool_str502[sizeof("CSISO57GB1988")]; +- char stringpool_str504[sizeof("MACICELAND")]; +- char stringpool_str509[sizeof("CSIBM866")]; +- char stringpool_str510[sizeof("UTF-16BE")]; +- char stringpool_str513[sizeof("ARABIC")]; +- char stringpool_str514[sizeof("CN-GB")]; +- char stringpool_str518[sizeof("CSISO2022KR")]; +- char stringpool_str520[sizeof("CSMACINTOSH")]; +- char stringpool_str526[sizeof("JIS0208")]; +- char stringpool_str528[sizeof("MACROMAN")]; +- char stringpool_str530[sizeof("ISO_8859-4:1988")]; +- char stringpool_str532[sizeof("ISO_8859-5:1988")]; +- char stringpool_str535[sizeof("TIS620.2533-1")]; +- char stringpool_str536[sizeof("ANSI_X3.4-1986")]; +- char stringpool_str537[sizeof("ISO_8859-8:1988")]; +- char stringpool_str538[sizeof("KS_C_5601-1987")]; +- char stringpool_str539[sizeof("CSSHIFTJIS")]; +- char stringpool_str540[sizeof("HEBREW")]; +- char stringpool_str541[sizeof("ISO_8859-9:1989")]; +- char stringpool_str547[sizeof("MACCROATIAN")]; +- char stringpool_str548[sizeof("ISO-2022-JP-1")]; +- char stringpool_str550[sizeof("EUCJP")]; +- char stringpool_str552[sizeof("ANSI_X3.4-1968")]; +- char stringpool_str555[sizeof("EUC-JP")]; +- char stringpool_str561[sizeof("CSISO58GB231280")]; +- char stringpool_str562[sizeof("JIS_C6226-1983")]; +- char stringpool_str566[sizeof("IBM-CP1133")]; +- char stringpool_str569[sizeof("MACCENTRALEUROPE")]; +- char stringpool_str570[sizeof("CSISO159JISX02121990")]; +- char stringpool_str571[sizeof("ISO-2022-JP-2")]; +- char stringpool_str573[sizeof("CSUNICODE11UTF7")]; +- char stringpool_str574[sizeof("UCS-4-SWAPPED")]; +- char stringpool_str578[sizeof("UNICODEBIG")]; +- char stringpool_str579[sizeof("CSISO14JISC6220RO")]; +- char stringpool_str580[sizeof("JIS_C6220-1969-RO")]; +- char stringpool_str582[sizeof("ISO_8859-3:1988")]; +- char stringpool_str586[sizeof("CSPC862LATINHEBREW")]; +- char stringpool_str588[sizeof("BIG5HKSCS")]; +- char stringpool_str589[sizeof("ISO_8859-6:1987")]; +- char stringpool_str590[sizeof("UCS-2-SWAPPED")]; +- char stringpool_str591[sizeof("ISO_8859-1:1987")]; +- char stringpool_str593[sizeof("BIG5-HKSCS")]; +- char stringpool_str594[sizeof("UTF-32BE")]; +- char stringpool_str604[sizeof("ISO-2022-JP")]; +- char stringpool_str607[sizeof("KOI8-U")]; +- char stringpool_str608[sizeof("TIS620.2533-0")]; +- char stringpool_str612[sizeof("KOI8-RU")]; +- char stringpool_str614[sizeof("ISO_8859-2:1987")]; +- char stringpool_str618[sizeof("MACROMANIA")]; +- char stringpool_str641[sizeof("JIS_X0212")]; +- char stringpool_str648[sizeof("CSEUCKR")]; +- char stringpool_str649[sizeof("MACCYRILLIC")]; +- char stringpool_str650[sizeof("ISO_8859-7:2003")]; +- char stringpool_str651[sizeof("MS-ARAB")]; +- char stringpool_str657[sizeof("MS-GREEK")]; +- char stringpool_str666[sizeof("CSKSC56011987")]; +- char stringpool_str668[sizeof("JIS_X0201")]; +- char stringpool_str673[sizeof("ISO_8859-7:1987")]; +- char stringpool_str683[sizeof("CSISO2022JP2")]; +- char stringpool_str696[sizeof("JIS_X0208")]; +- char stringpool_str697[sizeof("JISX0201-1976")]; +- char stringpool_str706[sizeof("JIS_X0212-1990")]; +- char stringpool_str717[sizeof("CSISO2022JP")]; +- char stringpool_str721[sizeof("JOHAB")]; +- char stringpool_str730[sizeof("MS_KANJI")]; +- char stringpool_str734[sizeof("CSISO87JISX0208")]; +- char stringpool_str737[sizeof("MACTURKISH")]; +- char stringpool_str755[sizeof("TCVN5712-1:1993")]; +- char stringpool_str756[sizeof("JIS_X0208-1983")]; +- char stringpool_str762[sizeof("CSEUCTW")]; +- char stringpool_str763[sizeof("MACGREEK")]; +- char stringpool_str770[sizeof("JIS_X0208-1990")]; +- char stringpool_str776[sizeof("WINBALTRIM")]; +- char stringpool_str790[sizeof("MS-TURK")]; +- char stringpool_str792[sizeof("MACUKRAINE")]; +- char stringpool_str796[sizeof("MACARABIC")]; +- char stringpool_str802[sizeof("CSPC850MULTILINGUAL")]; +- char stringpool_str845[sizeof("MACHEBREW")]; +- char stringpool_str903[sizeof("JIS_X0212.1990-0")]; +- char stringpool_str979[sizeof("BIG5-HKSCS:2001")]; +- char stringpool_str986[sizeof("BIG5-HKSCS:2004")]; +- char stringpool_str995[sizeof("BIG5-HKSCS:1999")]; +- char stringpool_str997[sizeof("CSEUCPKDFMTJAPANESE")]; ++ char stringpool_str4[sizeof("L2")]; ++ char stringpool_str5[sizeof("L1")]; ++ char stringpool_str11[sizeof("MS-EE")]; ++ char stringpool_str12[sizeof("CP819")]; ++ char stringpool_str15[sizeof("UCS-2")]; ++ char stringpool_str16[sizeof("IBM819")]; ++ char stringpool_str17[sizeof("UTF-8")]; ++ char stringpool_str18[sizeof("UTF-32")]; ++ char stringpool_str19[sizeof("UTF-16")]; ++ char stringpool_str21[sizeof("CP367")]; ++ char stringpool_str22[sizeof("ISO8859-2")]; ++ char stringpool_str23[sizeof("ISO8859-1")]; ++ char stringpool_str24[sizeof("IBM367")]; ++ char stringpool_str25[sizeof("UTF-7")]; ++ char stringpool_str26[sizeof("CHAR")]; ++ char stringpool_str27[sizeof("ISO8859-15")]; ++ char stringpool_str28[sizeof("US")]; ++ char stringpool_str29[sizeof("ISO-8859-2")]; ++ char stringpool_str31[sizeof("ISO-8859-1")]; ++ char stringpool_str32[sizeof("ISO-8859-15")]; ++ char stringpool_str33[sizeof("ISO_8859-2")]; ++ char stringpool_str35[sizeof("ISO_8859-1")]; ++ char stringpool_str36[sizeof("ISO_8859-15")]; ++ char stringpool_str37[sizeof("KOI8-R")]; ++ char stringpool_str38[sizeof("UCS-2LE")]; ++ char stringpool_str39[sizeof("UTF-32LE")]; ++ char stringpool_str40[sizeof("UTF-16LE")]; ++ char stringpool_str41[sizeof("ISO_8859-15:1998")]; ++ char stringpool_str43[sizeof("ISO_8859-2:1987")]; ++ char stringpool_str44[sizeof("ISO_8859-1:1987")]; ++ char stringpool_str45[sizeof("UCS-4")]; ++ char stringpool_str47[sizeof("UNICODE-1-1")]; ++ char stringpool_str48[sizeof("ISO-IR-6")]; ++ char stringpool_str49[sizeof("CSKOI8R")]; ++ char stringpool_str50[sizeof("ASCII")]; ++ char stringpool_str51[sizeof("UNICODEBIG")]; ++ char stringpool_str52[sizeof("ISO-IR-203")]; ++ char stringpool_str53[sizeof("UCS-4LE")]; ++ char stringpool_str54[sizeof("ISO-IR-101")]; ++ char stringpool_str55[sizeof("CP1250")]; ++ char stringpool_str56[sizeof("ISO-10646-UCS-2")]; ++ char stringpool_str57[sizeof("UNICODE-1-1-UTF-7")]; ++ char stringpool_str58[sizeof("LATIN2")]; ++ char stringpool_str59[sizeof("UNICODELITTLE")]; ++ char stringpool_str60[sizeof("LATIN1")]; ++ char stringpool_str61[sizeof("ISO_646.IRV:1991")]; ++ char stringpool_str62[sizeof("ISO646-US")]; ++ char stringpool_str63[sizeof("CSUNICODE")]; ++ char stringpool_str64[sizeof("UCS-2-INTERNAL")]; ++ char stringpool_str65[sizeof("LATIN-9")]; ++ char stringpool_str66[sizeof("WCHAR_T")]; ++ char stringpool_str68[sizeof("CSUCS4")]; ++ char stringpool_str69[sizeof("CSUNICODE11")]; ++ char stringpool_str70[sizeof("US-ASCII")]; ++ char stringpool_str71[sizeof("ISO-10646-UCS-4")]; ++ char stringpool_str72[sizeof("UCS-2BE")]; ++ char stringpool_str73[sizeof("UTF-32BE")]; ++ char stringpool_str74[sizeof("UTF-16BE")]; ++ char stringpool_str75[sizeof("ANSI_X3.4-1986")]; ++ char stringpool_str76[sizeof("ANSI_X3.4-1968")]; ++ char stringpool_str77[sizeof("CSUNICODE11UTF7")]; ++ char stringpool_str78[sizeof("UCS-2-SWAPPED")]; ++ char stringpool_str79[sizeof("UCS-4-INTERNAL")]; ++ char stringpool_str80[sizeof("CSASCII")]; ++ char stringpool_str87[sizeof("UCS-4BE")]; ++ char stringpool_str88[sizeof("WINDOWS-1250")]; ++ char stringpool_str92[sizeof("ISO-IR-100")]; ++ char stringpool_str93[sizeof("UCS-4-SWAPPED")]; ++ char stringpool_str97[sizeof("CSISOLATIN2")]; ++ char stringpool_str98[sizeof("CSISOLATIN1")]; + }; + static const struct stringpool_t stringpool_contents = + { +- "L6", +- "L1", +- "HZ", +- "L4", +- "L5", +- "R8", +- "L8", +- "866", + "L2", +- "SJIS", +- "ISO-IR-6", +- "ISO-IR-166", +- "LATIN6", +- "LATIN1", +- "ISO-IR-14", +- "L3", +- "LATIN4", +- "ISO-IR-165", +- "LATIN5", +- "ISO-IR-126", +- "862", +- "ISO-IR-144", +- "LATIN8", +- "ISO-IR-58", +- "ISO-IR-148", +- "L7", +- "LATIN-9", +- "ISO-IR-149", +- "ISO-IR-159", +- "ISO-IR-226", +- "LATIN2", +- "ISO8859-6", +- "ISO-IR-199", ++ "L1", ++ "MS-EE", ++ "CP819", ++ "UCS-2", ++ "IBM819", ++ "UTF-8", ++ "UTF-32", ++ "UTF-16", ++ "CP367", ++ "ISO8859-2", + "ISO8859-1", +- "ISO-8859-6", +- "ISO_8859-6", +- "ISO8859-16", +- "PT154", +- "ISO-8859-1", +- "ISO_8859-1", +- "ISO8859-11", +- "ISO-8859-16", +- "ISO_8859-16", +- "CN", +- "ISO-8859-11", +- "ISO_8859-11", +- "ISO8859-4", +- "ISO_8859-16:2001", +- "ISO8859-5", +- "ISO-8859-4", +- "ISO_8859-4", +- "ISO8859-14", +- "ISO-IR-101", +- "ISO-8859-5", +- "ISO_8859-5", ++ "IBM367", ++ "UTF-7", ++ "CHAR", + "ISO8859-15", +- "ISO-8859-14", +- "ISO_8859-14", +- "ISO8859-8", ++ "US", ++ "ISO-8859-2", ++ "ISO-8859-1", + "ISO-8859-15", ++ "ISO_8859-2", ++ "ISO_8859-1", + "ISO_8859-15", +- "ISO8859-9", +- "ISO-8859-8", +- "ISO_8859-8", +- "CP866", +- "ISO-IR-138", +- "ISO-8859-9", +- "ISO_8859-9", +- "ISO_8859-14:1998", ++ "KOI8-R", ++ "UCS-2LE", ++ "UTF-32LE", ++ "UTF-16LE", + "ISO_8859-15:1998", +- "ELOT_928", +- "TCVN", +- "C99", +- "ISO8859-2", +- "CP154", +- "ISO-8859-2", +- "ISO_8859-2", +- "ISO-IR-109", +- "L10", +- "CHAR", +- "CP1256", +- "ISO-IR-179", +- "ISO646-CN", +- "ASCII", +- "CP1251", +- "LATIN3", +- "850", +- "GB2312", +- "CP819", +- "CP1254", +- "CP949", +- "CP1255", +- "CP862", +- "US", +- "CP1361", +- "CP1258", +- "ISO-IR-110", +- "IBM866", +- "CP936", +- "GEORGIAN-PS", +- "LATIN10", +- "CHINESE", +- "CP1252", +- "LATIN7", +- "ISO_8859-10:1992", +- "ISO-IR-57", +- "TIS620", +- "ISO8859-3", ++ "ISO_8859-2:1987", ++ "ISO_8859-1:1987", + "UCS-4", +- "ISO-IR-87", +- "TIS-620", +- "ISO-IR-157", +- "ISO-8859-3", +- "ISO_8859-3", +- "ISO8859-13", +- "CSISOLATIN6", +- "BIG5", +- "ISO-8859-13", +- "ISO_8859-13", +- "CSISOLATIN1", +- "KOI8-R", +- "BIG-5", +- "IBM819", +- "ISO-IR-127", +- "CP874", +- "ISO646-US", +- "VISCII", +- "MS-EE", +- "MS-ANSI", +- "CSISOLATIN4", +- "IBM862", +- "CP932", +- "X0212", +- "CSISOLATIN5", +- "UCS-2", +- "ISO8859-10", +- "MS936", +- "WCHAR_T", +- "ISO-8859-10", +- "ISO_8859-10", +- "UTF-16", +- "EUCCN", +- "ROMAN8", ++ "UNICODE-1-1", ++ "ISO-IR-6", ++ "CSKOI8R", ++ "ASCII", ++ "UNICODEBIG", + "ISO-IR-203", +- "ISO8859-7", +- "KOI8-T", +- "EUC-CN", + "UCS-4LE", +- "ISO-IR-100", +- "ISO-8859-7", +- "ISO_8859-7", +- "MULELAO-1", +- "GB_1988-80", +- "X0201", +- "ECMA-114", +- "CSISOLATIN2", +- "GEORGIAN-ACADEMY", +- "PTCP154", +- "UCS-2LE", +- "CP1253", +- "UTF-8", +- "HP-ROMAN8", +- "CSASCII", +- "ECMA-118", +- "UCS-4-INTERNAL", +- "TCVN5712-1", +- "KOREAN", +- "CP850", +- "MS-CYRL", +- "CP950", +- "TIS620-0", +- "X0208", +- "GREEK8", +- "UCS-2-INTERNAL", +- "TCVN-5712", +- "CP1133", ++ "ISO-IR-101", + "CP1250", +- "ISO-2022-CN", +- "UTF-16LE", +- "CYRILLIC-ASIAN", +- "ISO-10646-UCS-4", +- "ISO-2022-CN-EXT", +- "CP1257", +- "GB_2312-80", +- "JP", +- "EUCKR", + "ISO-10646-UCS-2", +- "GB18030", +- "EUC-KR", +- "CSKOI8R", +- "CSBIG5", +- "CP367", +- "MACINTOSH", +- "CSISOLATIN3", +- "CN-BIG5", +- "CYRILLIC", +- "CSVISCII", +- "IBM850", +- "MACTHAI", +- "UNICODE-1-1", +- "ISO_646.IRV:1991", +- "US-ASCII", +- "UTF-32", +- "CN-GB-ISOIR165", +- "NEXTSTEP", +- "MAC", +- "EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE", +- "CSISOLATINARABIC", +- "HZ-GB-2312", +- "ARMSCII-8", +- "CSISOLATINHEBREW", +- "ISO-2022-KR", +- "WINDOWS-1256", +- "UHC", +- "WINDOWS-1251", +- "MS-HEBR", +- "ISO-CELTIC", +- "UTF-32LE", +- "WINDOWS-1254", +- "WINDOWS-1255", +- "SHIFT-JIS", +- "SHIFT_JIS", +- "IBM367", +- "WINDOWS-1258", +- "CSPTCP154", +- "GBK", ++ "UNICODE-1-1-UTF-7", ++ "LATIN2", + "UNICODELITTLE", +- "WINDOWS-1252", +- "UTF-7", +- "KSC_5601", +- "ASMO-708", +- "CSISO2022CN", +- "BIGFIVE", +- "WINDOWS-936", ++ "LATIN1", ++ "ISO_646.IRV:1991", ++ "ISO646-US", ++ "CSUNICODE", ++ "UCS-2-INTERNAL", ++ "LATIN-9", ++ "WCHAR_T", + "CSUCS4", +- "BIG-FIVE", +- "ISO646-JP", +- "TIS620.2529-1", +- "CSISOLATINGREEK", +- "CSISOLATINCYRILLIC", +- "UCS-4BE", +- "UNICODE-1-1-UTF-7", +- "EUCTW", +- "WINDOWS-1253", +- "CSHPROMAN8", +- "EUC-TW", +- "KS_C_5601-1989", +- "UCS-2BE", +- "VISCII1.1-1", +- "GREEK", +- "WINDOWS-1250", +- "CSGB2312", +- "WINDOWS-874", + "CSUNICODE11", +- "JAVA", +- "WINDOWS-1257", +- "CSUNICODE", +- "CSHALFWIDTHKATAKANA", +- "CSISO57GB1988", +- "MACICELAND", +- "CSIBM866", ++ "US-ASCII", ++ "ISO-10646-UCS-4", ++ "UCS-2BE", ++ "UTF-32BE", + "UTF-16BE", +- "ARABIC", +- "CN-GB", +- "CSISO2022KR", +- "CSMACINTOSH", +- "JIS0208", +- "MACROMAN", +- "ISO_8859-4:1988", +- "ISO_8859-5:1988", +- "TIS620.2533-1", + "ANSI_X3.4-1986", +- "ISO_8859-8:1988", +- "KS_C_5601-1987", +- "CSSHIFTJIS", +- "HEBREW", +- "ISO_8859-9:1989", +- "MACCROATIAN", +- "ISO-2022-JP-1", +- "EUCJP", + "ANSI_X3.4-1968", +- "EUC-JP", +- "CSISO58GB231280", +- "JIS_C6226-1983", +- "IBM-CP1133", +- "MACCENTRALEUROPE", +- "CSISO159JISX02121990", +- "ISO-2022-JP-2", + "CSUNICODE11UTF7", +- "UCS-4-SWAPPED", +- "UNICODEBIG", +- "CSISO14JISC6220RO", +- "JIS_C6220-1969-RO", +- "ISO_8859-3:1988", +- "CSPC862LATINHEBREW", +- "BIG5HKSCS", +- "ISO_8859-6:1987", + "UCS-2-SWAPPED", +- "ISO_8859-1:1987", +- "BIG5-HKSCS", +- "UTF-32BE", +- "ISO-2022-JP", +- "KOI8-U", +- "TIS620.2533-0", +- "KOI8-RU", +- "ISO_8859-2:1987", +- "MACROMANIA", +- "JIS_X0212", +- "CSEUCKR", +- "MACCYRILLIC", +- "ISO_8859-7:2003", +- "MS-ARAB", +- "MS-GREEK", +- "CSKSC56011987", +- "JIS_X0201", +- "ISO_8859-7:1987", +- "CSISO2022JP2", +- "JIS_X0208", +- "JISX0201-1976", +- "JIS_X0212-1990", +- "CSISO2022JP", +- "JOHAB", +- "MS_KANJI", +- "CSISO87JISX0208", +- "MACTURKISH", +- "TCVN5712-1:1993", +- "JIS_X0208-1983", +- "CSEUCTW", +- "MACGREEK", +- "JIS_X0208-1990", +- "WINBALTRIM", +- "MS-TURK", +- "MACUKRAINE", +- "MACARABIC", +- "CSPC850MULTILINGUAL", +- "MACHEBREW", +- "JIS_X0212.1990-0", +- "BIG5-HKSCS:2001", +- "BIG5-HKSCS:2004", +- "BIG5-HKSCS:1999", +- "CSEUCPKDFMTJAPANESE" ++ "UCS-4-INTERNAL", ++ "CSASCII", ++ "UCS-4BE", ++ "WINDOWS-1250", ++ "ISO-IR-100", ++ "UCS-4-SWAPPED", ++ "CSISOLATIN2", ++ "CSISOLATIN1" + }; + #define stringpool ((const char *) &stringpool_contents) + + static const struct alias aliases[] = + { +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, + {-1}, {-1}, {-1}, {-1}, +-#line 134 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, ei_iso8859_10}, +- {-1}, +-#line 60 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, ei_iso8859_1}, +- {-1}, {-1}, +-#line 325 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, ei_hz}, +- {-1}, {-1}, {-1}, +-#line 84 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, ei_iso8859_4}, +- {-1}, +-#line 126 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str24, ei_iso8859_9}, +- {-1}, +-#line 226 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str26, ei_hp_roman8}, +- {-1}, {-1}, +-#line 151 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str29, ei_iso8859_14}, +- {-1}, +-#line 207 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str31, ei_cp866}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 68 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str38, ei_iso8859_2}, +- {-1}, {-1}, {-1}, +-#line 303 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str42, ei_sjis}, +-#line 16 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str43, ei_ascii}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, +-#line 247 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str55, ei_tis620}, +- {-1}, +-#line 133 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str57, ei_iso8859_10}, +- {-1}, {-1}, {-1}, +-#line 59 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str61, ei_iso8859_1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 259 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str68, ei_iso646_jp}, ++#line 66 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str4, ei_iso8859_2}, ++#line 58 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str5, ei_iso8859_1}, + {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 76 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str74, ei_iso8859_3}, +-#line 83 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str75, ei_iso8859_4}, +- {-1}, +-#line 289 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str77, ei_isoir165}, +- {-1}, +-#line 125 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str79, ei_iso8859_9}, +-#line 107 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str80, ei_iso8859_7}, +-#line 203 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str81, ei_cp862}, +-#line 90 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str82, ei_iso8859_5}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 150 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str89, ei_iso8859_14}, +- {-1}, +-#line 286 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str91, ei_gb2312}, +- {-1}, {-1}, {-1}, {-1}, +-#line 124 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str96, ei_iso8859_9}, +-#line 144 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str97, ei_iso8859_13}, +-#line 158 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str98, ei_iso8859_15}, +- {-1}, +-#line 294 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str100, ei_ksc5601}, +- {-1}, +-#line 278 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str102, ei_jisx0212}, +-#line 163 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str103, ei_iso8859_16}, +- {-1}, {-1}, {-1}, +-#line 67 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str107, ei_iso8859_2}, +-#line 102 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str108, ei_iso8859_6}, +-#line 149 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str109, ei_iso8859_14}, ++#line 79 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, ei_cp1250}, ++#line 55 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, ei_iso8859_1}, + {-1}, {-1}, +-#line 62 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str112, ei_iso8859_1}, +-#line 94 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str113, ei_iso8859_6}, +-#line 95 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str114, ei_iso8859_6}, +-#line 166 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str115, ei_iso8859_16}, +-#line 233 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str116, ei_pt154}, +-#line 53 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str117, ei_iso8859_1}, +-#line 54 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str118, ei_iso8859_1}, +-#line 139 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str119, ei_iso8859_11}, +-#line 160 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str120, ei_iso8859_16}, +-#line 161 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str121, ei_iso8859_16}, +- {-1}, +-#line 283 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str123, ei_iso646_cn}, +-#line 137 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str124, ei_iso8859_11}, +-#line 138 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str125, ei_iso8859_11}, +-#line 86 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str126, ei_iso8859_4}, +- {-1}, +-#line 162 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str128, ei_iso8859_16}, ++#line 24 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, ei_ucs2}, ++#line 56 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, ei_iso8859_1}, ++#line 23 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, ei_utf8}, ++#line 41 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, ei_utf32}, ++#line 38 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, ei_utf16}, + {-1}, +-#line 93 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str130, ei_iso8859_5}, +-#line 79 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str131, ei_iso8859_4}, ++#line 19 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, ei_ascii}, ++#line 68 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, ei_iso8859_2}, ++#line 60 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str23, ei_iso8859_1}, ++#line 20 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str24, ei_ascii}, ++#line 44 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str25, ei_utf7}, + #line 80 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str132, ei_iso8859_4}, +-#line 153 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str133, ei_iso8859_14}, +-#line 66 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str134, ei_iso8859_2}, +-#line 87 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str135, ei_iso8859_5}, +-#line 88 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str136, ei_iso8859_5}, +-#line 159 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str137, ei_iso8859_15}, +-#line 146 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str138, ei_iso8859_14}, +-#line 147 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str139, ei_iso8859_14}, +-#line 120 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str140, ei_iso8859_8}, +- {-1}, +-#line 154 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str142, ei_iso8859_15}, +-#line 155 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str143, ei_iso8859_15}, +-#line 128 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str144, ei_iso8859_9}, +-#line 114 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str145, ei_iso8859_8}, +-#line 115 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str146, ei_iso8859_8}, +-#line 205 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str147, ei_cp866}, +-#line 117 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str148, ei_iso8859_8}, +-#line 121 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str149, ei_iso8859_9}, +-#line 122 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str150, ei_iso8859_9}, +-#line 148 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str151, ei_iso8859_14}, +- {-1}, +-#line 156 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str153, ei_iso8859_15}, +- {-1}, +-#line 109 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str155, ei_iso8859_7}, +-#line 253 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str156, ei_tcvn}, +-#line 51 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str157, ei_c99}, +-#line 70 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str158, ei_iso8859_2}, +- {-1}, {-1}, {-1}, +-#line 235 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str162, ei_pt154}, +-#line 63 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str163, ei_iso8859_2}, +-#line 64 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str164, ei_iso8859_2}, +- {-1}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str26, ei_local_char}, + #line 74 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str166, ei_iso8859_3}, +- {-1}, +-#line 165 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str168, ei_iso8859_16}, +-#line 351 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str169, ei_local_char}, +- {-1}, {-1}, {-1}, {-1}, +-#line 189 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str174, ei_cp1256}, +-#line 142 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str175, ei_iso8859_13}, +-#line 281 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str176, ei_iso646_cn}, +-#line 13 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str177, ei_ascii}, +-#line 174 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str178, ei_cp1251}, +-#line 75 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str179, ei_iso8859_3}, +- {-1}, +-#line 199 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str181, ei_cp850}, +- {-1}, +-#line 314 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str183, ei_euc_cn}, +- {-1}, +-#line 57 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str185, ei_iso8859_1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 183 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str192, ei_cp1254}, +- {-1}, +-#line 345 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str194, ei_cp949}, +- {-1}, +-#line 186 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str196, ei_cp1255}, +-#line 201 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str197, ei_cp862}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str27, ei_iso8859_15}, + #line 21 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str198, ei_ascii}, +- {-1}, {-1}, {-1}, {-1}, +-#line 348 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str203, ei_johab}, +- {-1}, {-1}, +-#line 195 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str206, ei_cp1258}, +-#line 82 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str207, ei_iso8859_4}, +- {-1}, +-#line 206 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str209, ei_cp866}, +-#line 318 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str210, ei_cp936}, +-#line 231 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str211, ei_georgian_ps}, +- {-1}, {-1}, +-#line 164 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str214, ei_iso8859_16}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 288 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str222, ei_gb2312}, +- {-1}, +-#line 177 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str224, ei_cp1252}, +-#line 143 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str225, ei_iso8859_13}, +-#line 131 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str226, ei_iso8859_10}, +-#line 282 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str227, ei_iso646_cn}, +-#line 242 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str228, ei_tis620}, +- {-1}, +-#line 78 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str230, ei_iso8859_3}, +-#line 33 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str231, ei_ucs4}, +-#line 271 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str232, ei_jisx0208}, +-#line 241 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str233, ei_tis620}, +-#line 132 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str234, ei_iso8859_10}, +-#line 71 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str235, ei_iso8859_3}, +-#line 72 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str236, ei_iso8859_3}, +-#line 145 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str237, ei_iso8859_13}, +- {-1}, {-1}, +-#line 135 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str240, ei_iso8859_10}, +-#line 330 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str241, ei_ces_big5}, +-#line 140 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str242, ei_iso8859_13}, +-#line 141 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str243, ei_iso8859_13}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str28, ei_ascii}, + #line 61 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str244, ei_iso8859_1}, +-#line 167 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str245, ei_koi8_r}, +-#line 331 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str246, ei_ces_big5}, +-#line 58 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str247, ei_iso8859_1}, +-#line 97 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str248, ei_iso8859_6}, +-#line 248 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str249, ei_cp874}, +- {-1}, +-#line 14 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str251, ei_ascii}, +-#line 250 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str252, ei_viscii}, +-#line 173 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str253, ei_cp1250}, +- {-1}, {-1}, +-#line 179 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str256, ei_cp1252}, +- {-1}, +-#line 85 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str258, ei_iso8859_4}, +-#line 202 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str259, ei_cp862}, +-#line 306 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str260, ei_cp932}, +-#line 277 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str261, ei_jisx0212}, +-#line 127 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str262, ei_iso8859_9}, +-#line 24 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str263, ei_ucs2}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str29, ei_iso8859_2}, + {-1}, +-#line 136 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str265, ei_iso8859_10}, +-#line 319 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str266, ei_cp936}, +-#line 352 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str267, ei_local_wchar_t}, +- {-1}, {-1}, +-#line 129 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str270, ei_iso8859_10}, +-#line 130 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str271, ei_iso8859_10}, +-#line 38 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str272, ei_utf16}, +-#line 313 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str273, ei_euc_cn}, +-#line 225 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str274, ei_hp_roman8}, +-#line 157 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str275, ei_iso8859_15}, +-#line 113 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str276, ei_iso8859_7}, +-#line 232 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str277, ei_koi8_t}, +-#line 312 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str278, ei_euc_cn}, +-#line 37 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str279, ei_ucs4le}, +-#line 56 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str280, ei_iso8859_1}, +-#line 103 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str281, ei_iso8859_7}, +-#line 104 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str282, ei_iso8859_7}, +-#line 238 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str283, ei_mulelao}, +-#line 280 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str284, ei_iso646_cn}, +- {-1}, {-1}, {-1}, +-#line 264 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str288, ei_jisx0201}, +-#line 98 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str289, ei_iso8859_6}, ++#line 51 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str31, ei_iso8859_1}, + #line 69 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str290, ei_iso8859_2}, +-#line 230 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str291, ei_georgian_academy}, +-#line 234 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str292, ei_pt154}, +- {-1}, {-1}, +-#line 31 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str295, ei_ucs2le}, +-#line 180 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str296, ei_cp1253}, +-#line 23 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str297, ei_utf8}, +-#line 224 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str298, ei_hp_roman8}, +- {-1}, +-#line 22 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str300, ei_ascii}, +- {-1}, {-1}, +-#line 108 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str303, ei_iso8859_7}, +-#line 49 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str304, ei_ucs4internal}, +-#line 255 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str305, ei_tcvn}, +- {-1}, +-#line 296 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str307, ei_ksc5601}, +-#line 197 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str308, ei_cp850}, +-#line 176 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str309, ei_cp1251}, +-#line 336 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str310, ei_cp950}, +- {-1}, {-1}, +-#line 243 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str313, ei_tis620}, +- {-1}, {-1}, +-#line 270 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str316, ei_jisx0208}, +- {-1}, {-1}, +-#line 110 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str319, ei_iso8859_7}, +-#line 47 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str320, ei_ucs2internal}, +-#line 254 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str321, ei_tcvn}, +- {-1}, +-#line 239 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str323, ei_cp1133}, +-#line 171 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str324, ei_cp1250}, +- {-1}, {-1}, +-#line 322 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str327, ei_iso2022_cn}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str32, ei_iso8859_15}, ++#line 62 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str33, ei_iso8859_2}, + {-1}, ++#line 52 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str35, ei_iso8859_1}, ++#line 70 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str36, ei_iso8859_15}, ++#line 75 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str37, ei_koi8_r}, ++#line 31 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str38, ei_ucs2le}, ++#line 43 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str39, ei_utf32le}, + #line 40 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str329, ei_utf16le}, +- {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 236 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str335, ei_pt154}, +- {-1}, +-#line 34 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str337, ei_ucs4}, +- {-1}, {-1}, +-#line 324 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str340, ei_iso2022_cn_ext}, +- {-1}, +-#line 192 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str342, ei_cp1257}, +- {-1}, {-1}, +-#line 285 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str345, ei_gb2312}, +- {-1}, +-#line 260 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str347, ei_iso646_jp}, +- {-1}, {-1}, {-1}, +-#line 343 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str351, ei_euc_kr}, +- {-1}, +-#line 25 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str353, ei_ucs2}, +-#line 321 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str354, ei_gb18030}, +- {-1}, +-#line 342 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str356, ei_euc_kr}, +-#line 168 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str357, ei_koi8_r}, +-#line 335 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str358, ei_ces_big5}, +- {-1}, +-#line 19 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str360, ei_ascii}, +-#line 210 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str361, ei_mac_roman}, +-#line 77 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str362, ei_iso8859_3}, +-#line 334 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str363, ei_ces_big5}, +- {-1}, {-1}, +-#line 91 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str366, ei_iso8859_5}, +- {-1}, {-1}, +-#line 252 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str369, ei_viscii}, +-#line 198 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str370, ei_cp850}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str40, ei_utf16le}, ++#line 71 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str41, ei_iso8859_15}, + {-1}, +-#line 223 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str372, ei_mac_thai}, ++#line 63 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str43, ei_iso8859_2}, ++#line 53 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str44, ei_iso8859_1}, ++#line 33 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str45, ei_ucs4}, + {-1}, + #line 29 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str374, ei_ucs2be}, +- {-1}, +-#line 15 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str376, ei_ascii}, +- {-1}, {-1}, {-1}, +-#line 12 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str380, ei_ascii}, +-#line 41 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str381, ei_utf32}, +- {-1}, {-1}, +-#line 290 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str384, ei_isoir165}, +- {-1}, {-1}, +-#line 228 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str387, ei_nextstep}, +- {-1}, +-#line 211 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str389, ei_mac_roman}, +- {-1}, {-1}, {-1}, +-#line 299 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str393, ei_euc_jp}, +-#line 101 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str394, ei_iso8859_6}, +-#line 326 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str395, ei_hz}, +- {-1}, +-#line 229 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str397, ei_armscii_8}, +- {-1}, {-1}, {-1}, +-#line 119 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str401, ei_iso8859_8}, +- {-1}, {-1}, {-1}, +-#line 349 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str405, ei_iso2022_kr}, +- {-1}, +-#line 190 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str407, ei_cp1256}, +-#line 346 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str408, ei_cp949}, +-#line 175 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str409, ei_cp1251}, +- {-1}, +-#line 188 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str411, ei_cp1255}, +-#line 152 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str412, ei_iso8859_14}, +-#line 43 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str413, ei_utf32le}, +- {-1}, {-1}, +-#line 184 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str416, ei_cp1254}, +- {-1}, +-#line 187 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str418, ei_cp1255}, +- {-1}, +-#line 302 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str420, ei_sjis}, +-#line 301 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str421, ei_sjis}, +-#line 20 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str422, ei_ascii}, +-#line 196 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str423, ei_cp1258}, +-#line 237 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str424, ei_pt154}, +- {-1}, +-#line 317 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str426, ei_ces_gbk}, +- {-1}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str47, ei_ucs2be}, ++#line 16 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str48, ei_ascii}, ++#line 76 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str49, ei_koi8_r}, ++#line 13 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str50, ei_ascii}, ++#line 28 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str51, ei_ucs2be}, ++#line 72 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str52, ei_iso8859_15}, ++#line 37 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str53, ei_ucs4le}, ++#line 64 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str54, ei_iso8859_2}, ++#line 77 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str55, ei_cp1250}, ++#line 25 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str56, ei_ucs2}, ++#line 45 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str57, ei_utf7}, ++#line 65 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str58, ei_iso8859_2}, + #line 32 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str428, ei_ucs2le}, +- {-1}, {-1}, {-1}, +-#line 178 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str432, ei_cp1252}, +-#line 44 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str433, ei_utf7}, +- {-1}, +-#line 291 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str435, ei_ksc5601}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str59, ei_ucs2le}, ++#line 57 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str60, ei_iso8859_1}, ++#line 15 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str61, ei_ascii}, ++#line 14 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str62, ei_ascii}, ++#line 26 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str63, ei_ucs2}, ++#line 47 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str64, ei_ucs2internal}, ++#line 73 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str65, ei_iso8859_15}, ++#line 81 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str66, ei_local_wchar_t}, + {-1}, +-#line 99 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str437, ei_iso8859_6}, +- {-1}, {-1}, +-#line 323 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str440, ei_iso2022_cn}, +- {-1}, {-1}, {-1}, +-#line 333 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str444, ei_ces_big5}, +- {-1}, {-1}, +-#line 320 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str447, ei_cp936}, + #line 35 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str448, ei_ucs4}, +-#line 332 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str449, ei_ces_big5}, +- {-1}, {-1}, {-1}, +-#line 258 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str453, ei_iso646_jp}, +- {-1}, {-1}, +-#line 244 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str456, ei_tis620}, +-#line 112 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str457, ei_iso8859_7}, +- {-1}, +-#line 92 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str459, ei_iso8859_5}, +-#line 36 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str460, ei_ucs4be}, +- {-1}, +-#line 45 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str462, ei_utf7}, +- {-1}, {-1}, +-#line 328 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str465, ei_euc_tw}, +- {-1}, {-1}, +-#line 181 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str468, ei_cp1253}, +-#line 227 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str469, ei_hp_roman8}, +-#line 327 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str470, ei_euc_tw}, +- {-1}, +-#line 293 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str472, ei_ksc5601}, +- {-1}, {-1}, {-1}, +-#line 27 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str476, ei_ucs2be}, +- {-1}, {-1}, +-#line 251 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str479, ei_viscii}, +-#line 111 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str480, ei_iso8859_7}, +- {-1}, +-#line 172 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str482, ei_cp1250}, +-#line 316 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str483, ei_euc_cn}, +- {-1}, {-1}, +-#line 249 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str486, ei_cp874}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str68, ei_ucs4}, + #line 30 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str487, ei_ucs2be}, +- {-1}, +-#line 52 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str489, ei_java}, +- {-1}, +-#line 193 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str491, ei_cp1257}, +- {-1}, +-#line 26 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str493, ei_ucs2}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 265 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str500, ei_jisx0201}, +- {-1}, +-#line 284 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str502, ei_iso646_cn}, +- {-1}, +-#line 214 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str504, ei_mac_iceland}, +- {-1}, {-1}, {-1}, {-1}, +-#line 208 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str509, ei_cp866}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str69, ei_ucs2be}, ++#line 12 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str70, ei_ascii}, ++#line 34 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str71, ei_ucs4}, ++#line 27 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str72, ei_ucs2be}, ++#line 42 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str73, ei_utf32be}, + #line 39 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str510, ei_utf16be}, +- {-1}, {-1}, +-#line 100 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str513, ei_iso8859_6}, +-#line 315 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str514, ei_euc_cn}, +- {-1}, {-1}, {-1}, +-#line 350 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str518, ei_iso2022_kr}, +- {-1}, +-#line 212 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str520, ei_mac_roman}, +- {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 269 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str526, ei_jisx0208}, +- {-1}, +-#line 209 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str528, ei_mac_roman}, +- {-1}, +-#line 81 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str530, ei_iso8859_4}, +- {-1}, +-#line 89 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str532, ei_iso8859_5}, +- {-1}, {-1}, +-#line 246 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str535, ei_tis620}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str74, ei_utf16be}, + #line 18 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str536, ei_ascii}, +-#line 116 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str537, ei_iso8859_8}, +-#line 292 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str538, ei_ksc5601}, +-#line 305 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str539, ei_sjis}, +-#line 118 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str540, ei_iso8859_8}, +-#line 123 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str541, ei_iso8859_9}, +- {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 215 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str547, ei_mac_croatian}, +-#line 309 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str548, ei_iso2022_jp1}, +- {-1}, +-#line 298 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str550, ei_euc_jp}, +- {-1}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str75, ei_ascii}, + #line 17 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str552, ei_ascii}, +- {-1}, {-1}, +-#line 297 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str555, ei_euc_jp}, +- {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 287 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str561, ei_gb2312}, +-#line 272 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str562, ei_jisx0208}, +- {-1}, {-1}, {-1}, +-#line 240 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str566, ei_cp1133}, +- {-1}, {-1}, +-#line 213 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str569, ei_mac_centraleurope}, +-#line 279 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str570, ei_jisx0212}, +-#line 310 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str571, ei_iso2022_jp2}, +- {-1}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str76, ei_ascii}, + #line 46 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str573, ei_utf7}, +-#line 50 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str574, ei_ucs4swapped}, +- {-1}, {-1}, {-1}, +-#line 28 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str578, ei_ucs2be}, +-#line 261 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str579, ei_iso646_jp}, +-#line 257 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str580, ei_iso646_jp}, +- {-1}, +-#line 73 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str582, ei_iso8859_3}, +- {-1}, {-1}, {-1}, +-#line 204 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str586, ei_cp862}, +- {-1}, +-#line 340 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str588, ei_big5hkscs2004}, +-#line 96 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str589, ei_iso8859_6}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str77, ei_utf7}, + #line 48 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str590, ei_ucs2swapped}, +-#line 55 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str591, ei_iso8859_1}, +- {-1}, +-#line 339 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str593, ei_big5hkscs2004}, +-#line 42 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str594, ei_utf32be}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 307 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str604, ei_iso2022_jp}, +- {-1}, {-1}, +-#line 169 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str607, ei_koi8_u}, +-#line 245 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str608, ei_tis620}, +- {-1}, {-1}, {-1}, +-#line 170 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str612, ei_koi8_ru}, +- {-1}, +-#line 65 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str614, ei_iso8859_2}, +- {-1}, {-1}, {-1}, +-#line 216 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str618, ei_mac_romania}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, +-#line 274 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str641, ei_jisx0212}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 344 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str648, ei_euc_kr}, +-#line 217 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str649, ei_mac_cyrillic}, +-#line 106 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str650, ei_iso8859_7}, +-#line 191 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str651, ei_cp1256}, +- {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 182 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str657, ei_cp1253}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 295 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str666, ei_ksc5601}, +- {-1}, +-#line 262 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str668, ei_jisx0201}, +- {-1}, {-1}, {-1}, {-1}, +-#line 105 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str673, ei_iso8859_7}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 311 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str683, ei_iso2022_jp2}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, +-#line 266 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str696, ei_jisx0208}, +-#line 263 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str697, ei_jisx0201}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 276 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str706, ei_jisx0212}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, +-#line 308 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str717, ei_iso2022_jp}, +- {-1}, {-1}, {-1}, +-#line 347 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str721, ei_johab}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 304 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str730, ei_sjis}, +- {-1}, {-1}, {-1}, +-#line 273 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str734, ei_jisx0208}, +- {-1}, {-1}, +-#line 220 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str737, ei_mac_turkish}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 256 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str755, ei_tcvn}, +-#line 267 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str756, ei_jisx0208}, +- {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 329 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str762, ei_euc_tw}, +-#line 219 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str763, ei_mac_greek}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 268 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str770, ei_jisx0208}, +- {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 194 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str776, ei_cp1257}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, +-#line 185 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str790, ei_cp1254}, +- {-1}, +-#line 218 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str792, ei_mac_ukraine}, +- {-1}, {-1}, {-1}, +-#line 222 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str796, ei_mac_arabic}, +- {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 200 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str802, ei_cp850}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str78, ei_ucs2swapped}, ++#line 49 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str79, ei_ucs4internal}, ++#line 22 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str80, ei_ascii}, + {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 221 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str845, ei_mac_hebrew}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, ++#line 36 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str87, ei_ucs4be}, ++#line 78 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str88, ei_cp1250}, + {-1}, {-1}, {-1}, +-#line 275 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str903, ei_jisx0212}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, ++#line 54 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str92, ei_iso8859_1}, ++#line 50 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str93, ei_ucs4swapped}, + {-1}, {-1}, {-1}, +-#line 338 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str979, ei_big5hkscs2001}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 341 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str986, ei_big5hkscs2004}, +- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +-#line 337 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str995, ei_big5hkscs1999}, +- {-1}, +-#line 300 "lib/aliases.gperf" +- {(int)(long)&((struct stringpool_t *)0)->stringpool_str997, ei_euc_jp} ++#line 67 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str97, ei_iso8859_2}, ++#line 59 "lib/aliases.gperf" ++ {(int)(long)&((struct stringpool_t *)0)->stringpool_str98, ei_iso8859_1} + }; + + #ifdef __GNUC__ +--- a/lib/canonical_dos.h ++++ b/lib/canonical_dos.h +@@ -1,15 +1 @@ + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_0, +- (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_4, +- (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_5, +- (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_8, +- (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_12, +- (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_13, +- (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_17, +- (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_21, +- (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_22, +- (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_26, +- (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_31, +- (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_35, +- (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_38, +- (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_42, +- (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_47, +--- a/lib/canonical.h ++++ b/lib/canonical.h +@@ -1,107 +1 @@ +- (int)(long)&((struct stringpool_t *)0)->stringpool_str380, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str297, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str263, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str476, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str295, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str231, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str460, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str279, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str272, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str510, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str329, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str381, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str594, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str413, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str433, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str320, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str590, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str304, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str574, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str157, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str489, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str117, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str163, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str235, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str131, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str135, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str113, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str281, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str145, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str149, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str270, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str124, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str242, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str138, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str142, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str120, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str245, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str607, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str612, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str324, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str178, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str224, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str296, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str192, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str196, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str174, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str342, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str206, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str308, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str197, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str147, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str528, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str569, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str504, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str547, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str618, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str649, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str792, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str763, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str737, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str845, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str796, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str372, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str298, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str387, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str397, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str291, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str211, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str277, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str116, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str283, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str323, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str233, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str249, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str252, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str156, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str580, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str668, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str696, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str641, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str284, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str345, + (int)(long)&((struct stringpool_t *)0)->stringpool_str77, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str435, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str555, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str421, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str260, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str604, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str548, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str571, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str278, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str426, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str210, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str354, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str327, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str340, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str18, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str470, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str241, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str310, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str995, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str979, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str593, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str356, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str194, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str721, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str405, +--- a/lib/canonical_local.h ++++ b/lib/canonical_local.h +@@ -1,2 +1 @@ +- (int)(long)&((struct stringpool_t *)0)->stringpool_str169, +- (int)(long)&((struct stringpool_t *)0)->stringpool_str267, ++ +--- a/lib/converters.h ++++ b/lib/converters.h +@@ -129,161 +129,15 @@ struct conv_struct { + #include "ucs2swapped.h" + #include "ucs4internal.h" + #include "ucs4swapped.h" +-#include "c99.h" +-#include "java.h" + + /* 8-bit encodings */ + #include "iso8859_1.h" + #include "iso8859_2.h" +-#include "iso8859_3.h" +-#include "iso8859_4.h" +-#include "iso8859_5.h" +-#include "iso8859_6.h" +-#include "iso8859_7.h" +-#include "iso8859_8.h" +-#include "iso8859_9.h" +-#include "iso8859_10.h" +-#include "iso8859_11.h" +-#include "iso8859_13.h" +-#include "iso8859_14.h" + #include "iso8859_15.h" +-#include "iso8859_16.h" + #include "koi8_r.h" +-#include "koi8_u.h" +-#include "koi8_ru.h" + #include "cp1250.h" +-#include "cp1251.h" +-#include "cp1252.h" +-#include "cp1253.h" +-#include "cp1254.h" +-#include "cp1255.h" +-#include "cp1256.h" +-#include "cp1257.h" +-#include "cp1258.h" + #include "cp850.h" +-#include "cp862.h" +-#include "cp866.h" +-#include "mac_roman.h" +-#include "mac_centraleurope.h" +-#include "mac_iceland.h" +-#include "mac_croatian.h" +-#include "mac_romania.h" +-#include "mac_cyrillic.h" +-#include "mac_ukraine.h" +-#include "mac_greek.h" +-#include "mac_turkish.h" +-#include "mac_hebrew.h" +-#include "mac_arabic.h" +-#include "mac_thai.h" +-#include "hp_roman8.h" +-#include "nextstep.h" +-#include "armscii_8.h" +-#include "georgian_academy.h" +-#include "georgian_ps.h" +-#include "koi8_t.h" +-#include "pt154.h" +-#include "mulelao.h" +-#include "cp1133.h" +-#include "tis620.h" +-#include "cp874.h" +-#include "viscii.h" +-#include "tcvn.h" +- +-/* CJK character sets [CCS = coded character set] [CJKV.INF chapter 3] */ +- +-typedef struct { +- unsigned short indx; /* index into big table */ +- unsigned short used; /* bitmask of used entries */ +-} Summary16; +- +-#include "iso646_jp.h" +-#include "jisx0201.h" +-#include "jisx0208.h" +-#include "jisx0212.h" +- +-#include "iso646_cn.h" +-#include "gb2312.h" +-#include "isoir165.h" +-/*#include "gb12345.h"*/ +-#include "gbk.h" +-#include "cns11643.h" +-#include "big5.h" +- +-#include "ksc5601.h" +-#include "johab_hangul.h" +- +-/* CJK encodings [CES = character encoding scheme] [CJKV.INF chapter 4] */ +- +-#include "euc_jp.h" +-#include "sjis.h" +-#include "cp932.h" +-#include "iso2022_jp.h" +-#include "iso2022_jp1.h" +-#include "iso2022_jp2.h" +- +-#include "euc_cn.h" +-#include "ces_gbk.h" +-#include "cp936.h" +-#include "gb18030.h" +-#include "iso2022_cn.h" +-#include "iso2022_cnext.h" +-#include "hz.h" +-#include "euc_tw.h" +-#include "ces_big5.h" +-#include "cp950.h" +-#include "big5hkscs1999.h" +-#include "big5hkscs2001.h" +-#include "big5hkscs2004.h" +- +-#include "euc_kr.h" +-#include "cp949.h" +-#include "johab.h" +-#include "iso2022_kr.h" +- +-/* Encodings used by system dependent locales. */ +- +-#ifdef USE_AIX +-#include "cp856.h" +-#include "cp922.h" +-#include "cp943.h" +-#include "cp1046.h" +-#include "cp1124.h" +-#include "cp1129.h" +-#include "cp1161.h" +-#include "cp1162.h" +-#include "cp1163.h" +-#endif +- +-#ifdef USE_OSF1 +-#include "dec_kanji.h" +-#include "dec_hanyu.h" +-#endif + + #ifdef USE_DOS + #include "cp437.h" +-#include "cp737.h" +-#include "cp775.h" +-#include "cp852.h" +-#include "cp853.h" +-#include "cp855.h" +-#include "cp857.h" +-#include "cp858.h" +-#include "cp860.h" +-#include "cp861.h" +-#include "cp863.h" +-#include "cp864.h" +-#include "cp865.h" +-#include "cp869.h" +-#include "cp1125.h" +-#endif +- +-#ifdef USE_EXTRA +-#include "euc_jisx0213.h" +-#include "shift_jisx0213.h" +-#include "iso2022_jp3.h" +-#include "big5_2003.h" +-#include "tds565.h" +-#include "atarist.h" +-#include "riscos1.h" + #endif +- +--- a/lib/encodings.def ++++ b/lib/encodings.def +@@ -161,16 +161,6 @@ DEFENCODING(( "UCS-4-SWAPPED", + ucs4swapped, + { ucs4swapped_mbtowc, NULL }, { ucs4swapped_wctomb, NULL }) + +-DEFENCODING(( "C99", +- ), +- c99, +- { c99_mbtowc, NULL }, { c99_wctomb, NULL }) +- +-DEFENCODING(( "JAVA", +- ), +- java, +- { java_mbtowc, NULL }, { java_wctomb, NULL }) +- + /* Standard 8-bit encodings */ + + DEFENCODING(( "ISO-8859-1", /* IANA */ +@@ -203,148 +193,6 @@ DEFENCODING(( "ISO-8859-2", + iso8859_2, + { iso8859_2_mbtowc, NULL }, { iso8859_2_wctomb, NULL }) + +-DEFENCODING(( "ISO-8859-3", /* IANA */ +- "ISO_8859-3", /* IANA */ +- "ISO_8859-3:1988", /* IANA */ +- "ISO-IR-109", /* IANA */ +- "LATIN3", /* IANA */ +- "L3", /* IANA */ +- "csISOLatin3", /* IANA */ +- "ISO8859-3", /* X11R6.4, glibc, FreeBSD */ +- /*"ISO8859_3", JDK 1.1 */ +- /*"CP28593", Windows */ +- ), +- iso8859_3, +- { iso8859_3_mbtowc, NULL }, { iso8859_3_wctomb, NULL }) +- +-DEFENCODING(( "ISO-8859-4", /* IANA */ +- "ISO_8859-4", /* IANA */ +- "ISO_8859-4:1988", /* IANA */ +- "ISO-IR-110", /* IANA */ +- "LATIN4", /* IANA */ +- "L4", /* IANA */ +- "csISOLatin4", /* IANA */ +- "ISO8859-4", /* X11R6.4, glibc, FreeBSD */ +- /*"ISO8859_4", JDK 1.1 */ +- /*"CP28594", Windows */ +- ), +- iso8859_4, +- { iso8859_4_mbtowc, NULL }, { iso8859_4_wctomb, NULL }) +- +-DEFENCODING(( "ISO-8859-5", /* IANA */ +- "ISO_8859-5", /* IANA */ +- "ISO_8859-5:1988", /* IANA */ +- "ISO-IR-144", /* IANA */ +- "CYRILLIC", /* IANA */ +- "csISOLatinCyrillic", /* IANA */ +- "ISO8859-5", /* X11R6.4, glibc, FreeBSD */ +- /*"ISO8859_5", JDK 1.1 */ +- /*"CP28595", Windows */ +- ), +- iso8859_5, +- { iso8859_5_mbtowc, NULL }, { iso8859_5_wctomb, NULL }) +- +-DEFENCODING(( "ISO-8859-6", /* IANA */ +- "ISO_8859-6", /* IANA */ +- "ISO_8859-6:1987", /* IANA */ +- "ISO-IR-127", /* IANA */ +- "ECMA-114", /* IANA */ +- "ASMO-708", /* IANA */ +- "ARABIC", /* IANA */ +- "csISOLatinArabic", /* IANA */ +- "ISO8859-6", /* X11R6.4, glibc, FreeBSD */ +- /*"ISO8859_6", JDK 1.1 */ +- /*"CP28596", Windows */ +- ), +- iso8859_6, +- { iso8859_6_mbtowc, NULL }, { iso8859_6_wctomb, NULL }) +- +-DEFENCODING(( "ISO-8859-7", /* IANA, RFC 1947 */ +- "ISO_8859-7", /* IANA */ +- "ISO_8859-7:1987", /* IANA */ +- "ISO_8859-7:2003", +- "ISO-IR-126", /* IANA */ +- "ECMA-118", /* IANA */ +- "ELOT_928", /* IANA */ +- "GREEK8", /* IANA */ +- "GREEK", /* IANA */ +- "csISOLatinGreek", /* IANA */ +- "ISO8859-7", /* X11R6.4, glibc, FreeBSD */ +- /*"ISO8859_7", JDK 1.1 */ +- /*"CP28597", Windows */ +- ), +- iso8859_7, +- { iso8859_7_mbtowc, NULL }, { iso8859_7_wctomb, NULL }) +- +-DEFENCODING(( "ISO-8859-8", /* IANA */ +- "ISO_8859-8", /* IANA */ +- "ISO_8859-8:1988", /* IANA */ +- "ISO-IR-138", /* IANA */ +- "HEBREW", /* IANA */ +- "csISOLatinHebrew", /* IANA */ +- "ISO8859-8", /* X11R6.4, glibc, FreeBSD */ +- /*"ISO8859_8", JDK 1.1 */ +- /*"CP28598", Windows */ +- /*"CP38598", Windows */ +- ), +- iso8859_8, +- { iso8859_8_mbtowc, NULL }, { iso8859_8_wctomb, NULL }) +- +-DEFENCODING(( "ISO-8859-9", /* IANA */ +- "ISO_8859-9", /* IANA */ +- "ISO_8859-9:1989", /* IANA */ +- "ISO-IR-148", /* IANA */ +- "LATIN5", /* IANA */ +- "L5", /* IANA */ +- "csISOLatin5", /* IANA */ +- "ISO8859-9", /* X11R6.4, glibc, FreeBSD */ +- /*"ISO8859_9", JDK 1.1 */ +- /*"CP28599", Windows */ +- ), +- iso8859_9, +- { iso8859_9_mbtowc, NULL }, { iso8859_9_wctomb, NULL }) +- +-DEFENCODING(( "ISO-8859-10", /* IANA */ +- "ISO_8859-10", +- "ISO_8859-10:1992", /* IANA */ +- "ISO-IR-157", /* IANA */ +- "LATIN6", /* IANA */ +- "L6", /* IANA */ +- "csISOLatin6", /* IANA */ +- "ISO8859-10", /* X11R6.4, glibc, FreeBSD */ +- ), +- iso8859_10, +- { iso8859_10_mbtowc, NULL }, { iso8859_10_wctomb, NULL }) +- +-DEFENCODING(( "ISO-8859-11", /* glibc */ +- "ISO_8859-11", +- "ISO8859-11", /* X11R6.7, glibc */ +- ), +- iso8859_11, +- { iso8859_11_mbtowc, NULL }, { iso8859_11_wctomb, NULL }) +- +-DEFENCODING(( "ISO-8859-13", /* IANA, glibc */ +- "ISO_8859-13", +- "ISO-IR-179", /* glibc */ +- "LATIN7", /* glibc */ +- "L7", /* glibc */ +- "ISO8859-13", /* glibc, FreeBSD */ +- ), +- iso8859_13, +- { iso8859_13_mbtowc, NULL }, { iso8859_13_wctomb, NULL }) +- +-DEFENCODING(( "ISO-8859-14", /* IANA, glibc */ +- "ISO_8859-14", /* IANA */ +- "ISO_8859-14:1998", /* IANA, glibc */ +- "ISO-IR-199", /* IANA */ +- "LATIN8", /* IANA, glibc */ +- "L8", /* IANA, glibc */ +- "ISO-CELTIC", /* IANA */ +- "ISO8859-14", /* glibc, FreeBSD */ +- ), +- iso8859_14, +- { iso8859_14_mbtowc, NULL }, { iso8859_14_wctomb, NULL }) +- + DEFENCODING(( "ISO-8859-15", /* IANA, glibc */ + "ISO_8859-15", /* IANA */ + "ISO_8859-15:1998", /* glibc */ +@@ -356,17 +204,6 @@ DEFENCODING(( "ISO-8859-15", + iso8859_15, + { iso8859_15_mbtowc, NULL }, { iso8859_15_wctomb, NULL }) + +-DEFENCODING(( "ISO-8859-16", /* IANA */ +- "ISO_8859-16", /* IANA */ +- "ISO_8859-16:2001", /* IANA */ +- "ISO-IR-226", /* IANA */ +- "LATIN10", /* IANA */ +- "L10", /* IANA */ +- "ISO8859-16", /* glibc, FreeBSD */ +- ), +- iso8859_16, +- { iso8859_16_mbtowc, NULL }, { iso8859_16_wctomb, NULL }) +- + DEFENCODING(( "KOI8-R", /* IANA, RFC 1489, X11R6.4, JDK 1.1 */ + "csKOI8R", /* IANA */ + /*"CP20866", Windows */ +@@ -374,16 +211,6 @@ DEFENCODING(( "KOI8-R", + koi8_r, + { koi8_r_mbtowc, NULL }, { koi8_r_wctomb, NULL }) + +-DEFENCODING(( "KOI8-U", /* IANA, RFC 2319 */ +- ), +- koi8_u, +- { koi8_u_mbtowc, NULL }, { koi8_u_wctomb, NULL }) +- +-DEFENCODING(( "KOI8-RU", +- ), +- koi8_ru, +- { koi8_ru_mbtowc, NULL }, { koi8_ru_wctomb, NULL }) +- + /* Windows 8-bit encodings */ + + DEFENCODING(( "CP1250", /* JDK 1.1 */ +@@ -393,61 +220,6 @@ DEFENCODING(( "CP1250", + cp1250, + { cp1250_mbtowc, NULL }, { cp1250_wctomb, NULL }) + +-DEFENCODING(( "CP1251", /* JDK 1.1 */ +- "WINDOWS-1251", /* IANA */ +- "MS-CYRL", +- ), +- cp1251, +- { cp1251_mbtowc, NULL }, { cp1251_wctomb, NULL }) +- +-DEFENCODING(( "CP1252", /* JDK 1.1 */ +- "WINDOWS-1252", /* IANA */ +- "MS-ANSI", +- ), +- cp1252, +- { cp1252_mbtowc, NULL }, { cp1252_wctomb, NULL }) +- +-DEFENCODING(( "CP1253", /* JDK 1.1 */ +- "WINDOWS-1253", /* IANA */ +- "MS-GREEK", +- ), +- cp1253, +- { cp1253_mbtowc, NULL }, { cp1253_wctomb, NULL }) +- +-DEFENCODING(( "CP1254", /* JDK 1.1 */ +- "WINDOWS-1254", /* IANA */ +- "MS-TURK", +- ), +- cp1254, +- { cp1254_mbtowc, NULL }, { cp1254_wctomb, NULL }) +- +-DEFENCODING(( "CP1255", /* JDK 1.1 */ +- "WINDOWS-1255", /* IANA */ +- "MS-HEBR", +- ), +- cp1255, +- { cp1255_mbtowc, cp1255_flushwc }, { cp1255_wctomb, NULL }) +- +-DEFENCODING(( "CP1256", /* JDK 1.1 */ +- "WINDOWS-1256", /* IANA */ +- "MS-ARAB", +- ), +- cp1256, +- { cp1256_mbtowc, NULL }, { cp1256_wctomb, NULL }) +- +-DEFENCODING(( "CP1257", /* JDK 1.1 */ +- "WINDOWS-1257", /* IANA */ +- "WINBALTRIM", +- ), +- cp1257, +- { cp1257_mbtowc, NULL }, { cp1257_wctomb, NULL }) +- +-DEFENCODING(( "CP1258", /* JDK 1.1 */ +- "WINDOWS-1258", /* IANA */ +- ), +- cp1258, +- { cp1258_mbtowc, cp1258_flushwc }, { cp1258_wctomb, NULL }) +- + /* DOS 8-bit encodings */ + + DEFENCODING(( "CP850", /* IANA, JDK 1.1 */ +@@ -458,431 +230,3 @@ DEFENCODING(( "CP850", + cp850, + { cp850_mbtowc, NULL }, { cp850_wctomb, NULL }) + +-DEFENCODING(( "CP862", /* IANA, JDK 1.1 */ +- "IBM862", /* IANA */ +- "862", /* IANA */ +- "csPC862LatinHebrew", /* IANA */ +- ), +- cp862, +- { cp862_mbtowc, NULL }, { cp862_wctomb, NULL }) +- +-DEFENCODING(( "CP866", /* IANA, JDK 1.1 */ +- "IBM866", /* IANA */ +- "866", /* IANA */ +- "csIBM866", /* IANA */ +- ), +- cp866, +- { cp866_mbtowc, NULL }, { cp866_wctomb, NULL }) +- +-/* Macintosh 8-bit encodings */ +- +-DEFENCODING(( "MacRoman", /* JDK 1.1 */ +- /* This is the best table for MACINTOSH. The ones */ +- /* in glibc and FreeBSD-iconv are bad quality. */ +- "MACINTOSH", /* IANA */ +- "MAC", /* IANA */ +- "csMacintosh", /* IANA */ +- /*"CP10000", Windows */ +- ), +- mac_roman, +- { mac_roman_mbtowc, NULL }, { mac_roman_wctomb, NULL }) +- +-DEFENCODING(( "MacCentralEurope", /* JDK 1.1 */ +- /*"CP10029", Windows */ +- ), +- mac_centraleurope, +- { mac_centraleurope_mbtowc, NULL }, { mac_centraleurope_wctomb, NULL }) +- +-DEFENCODING(( "MacIceland", /* JDK 1.1 */ +- /*"CP10079", Windows */ +- ), +- mac_iceland, +- { mac_iceland_mbtowc, NULL }, { mac_iceland_wctomb, NULL }) +- +-DEFENCODING(( "MacCroatian", /* JDK 1.1 */ +- /*"CP10082", Windows */ +- ), +- mac_croatian, +- { mac_croatian_mbtowc, NULL }, { mac_croatian_wctomb, NULL }) +- +-DEFENCODING(( "MacRomania", /* JDK 1.1 */ +- /*"CP10010", Windows */ +- ), +- mac_romania, +- { mac_romania_mbtowc, NULL }, { mac_romania_wctomb, NULL }) +- +-DEFENCODING(( "MacCyrillic", /* JDK 1.1 */ +- /*"CP10007", Windows */ +- ), +- mac_cyrillic, +- { mac_cyrillic_mbtowc, NULL }, { mac_cyrillic_wctomb, NULL }) +- +-DEFENCODING(( "MacUkraine", /* JDK 1.1 */ +- /*"CP10017", Windows */ +- ), +- mac_ukraine, +- { mac_ukraine_mbtowc, NULL }, { mac_ukraine_wctomb, NULL }) +- +-DEFENCODING(( "MacGreek", /* JDK 1.1 */ +- /*"CP10006", Windows */ +- ), +- mac_greek, +- { mac_greek_mbtowc, NULL }, { mac_greek_wctomb, NULL }) +- +-DEFENCODING(( "MacTurkish", /* JDK 1.1 */ +- /*"CP10081", Windows */ +- ), +- mac_turkish, +- { mac_turkish_mbtowc, NULL }, { mac_turkish_wctomb, NULL }) +- +-DEFENCODING(( "MacHebrew", /* JDK 1.1 */ +- /*"CP10005", Windows */ +- ), +- mac_hebrew, +- { mac_hebrew_mbtowc, NULL }, { mac_hebrew_wctomb, NULL }) +- +-DEFENCODING(( "MacArabic", /* JDK 1.1 */ +- /*"CP10004", Windows */ +- ), +- mac_arabic, +- { mac_arabic_mbtowc, NULL }, { mac_arabic_wctomb, NULL }) +- +-DEFENCODING(( "MacThai", /* JDK 1.1 */ +- /*"CP10021", Windows */ +- ), +- mac_thai, +- { mac_thai_mbtowc, NULL }, { mac_thai_wctomb, NULL }) +- +-/* Other platform specific 8-bit encodings */ +- +-DEFENCODING(( "HP-ROMAN8", /* IANA, X11R6.4 */ +- "ROMAN8", /* IANA */ +- "R8", /* IANA */ +- "csHPRoman8", /* IANA */ +- ), +- hp_roman8, +- { hp_roman8_mbtowc, NULL }, { hp_roman8_wctomb, NULL }) +- +-DEFENCODING(( "NEXTSTEP", +- ), +- nextstep, +- { nextstep_mbtowc, NULL }, { nextstep_wctomb, NULL }) +- +-/* Regional 8-bit encodings used for a single language */ +- +-DEFENCODING(( "ARMSCII-8", +- ), +- armscii_8, +- { armscii_8_mbtowc, NULL }, { armscii_8_wctomb, NULL }) +- +-DEFENCODING(( "GEORGIAN-ACADEMY", +- ), +- georgian_academy, +- { georgian_academy_mbtowc, NULL }, { georgian_academy_wctomb, NULL }) +- +-DEFENCODING(( "GEORGIAN-PS", +- ), +- georgian_ps, +- { georgian_ps_mbtowc, NULL }, { georgian_ps_wctomb, NULL }) +- +-DEFENCODING(( "KOI8-T", +- ), +- koi8_t, +- { koi8_t_mbtowc, NULL }, { koi8_t_wctomb, NULL }) +- +-DEFENCODING(( "PT154", /* IANA, glibc */ +- "PTCP154", /* IANA */ +- "CP154", /* IANA */ +- "CYRILLIC-ASIAN", /* IANA */ +- "csPTCP154", /* IANA */ +- ), +- pt154, +- { pt154_mbtowc, NULL }, { pt154_wctomb, NULL }) +- +-DEFENCODING(( "MULELAO-1", +- ), +- mulelao, +- { mulelao_mbtowc, NULL }, { mulelao_wctomb, NULL }) +- +-DEFENCODING(( "CP1133", +- "IBM-CP1133", +- ), +- cp1133, +- { cp1133_mbtowc, NULL }, { cp1133_wctomb, NULL }) +- +-DEFENCODING(( "TIS-620", /* IANA */ +- "TIS620", /* glibc */ +- "TIS620-0", /* glibc */ +- "TIS620.2529-1", /* glibc */ +- "TIS620.2533-0", /* glibc */ +- "TIS620.2533-1", +- "ISO-IR-166", /* glibc */ +- ), +- tis620, +- { tis620_mbtowc, NULL }, { tis620_wctomb, NULL }) +- +-DEFENCODING(( "CP874", /* JDK 1.1 */ +- "WINDOWS-874", +- ), +- cp874, +- { cp874_mbtowc, NULL }, { cp874_wctomb, NULL }) +- +-DEFENCODING(( "VISCII", /* IANA, RFC 1456 */ +- "VISCII1.1-1", +- "csVISCII", /* IANA */ +- ), +- viscii, +- { viscii_mbtowc, NULL }, { viscii_wctomb, NULL }) +- +-DEFENCODING(( "TCVN", +- "TCVN-5712", +- "TCVN5712-1", +- "TCVN5712-1:1993", +- ), +- tcvn, +- { tcvn_mbtowc, tcvn_flushwc }, { tcvn_wctomb, NULL }) +- +-/* CJK character sets (not documented) */ +- +-DEFENCODING(( "JIS_C6220-1969-RO", /* IANA */ +- "ISO646-JP", /* IANA */ +- "ISO-IR-14", /* IANA */ +- "JP", /* IANA */ +- "csISO14JISC6220ro", /* IANA */ +- ), +- iso646_jp, +- { iso646_jp_mbtowc, NULL }, { iso646_jp_wctomb, NULL }) +- +-DEFENCODING(( "JIS_X0201", /* IANA */ +- "JISX0201-1976", +- "X0201", /* IANA */ +- "csHalfWidthKatakana", /* IANA */ +- /*"JISX0201.1976-0", X11R6.4 */ +- /*"JIS0201", JDK 1.1 */ +- ), +- jisx0201, +- { jisx0201_mbtowc, NULL }, { jisx0201_wctomb, NULL }) +- +-DEFENCODING(( "JIS_X0208", +- "JIS_X0208-1983", /* IANA */ +- "JIS_X0208-1990", +- "JIS0208", +- "X0208", /* IANA */ +- "ISO-IR-87", /* IANA */ +- "JIS_C6226-1983", /* IANA */ +- "csISO87JISX0208", /* IANA */ +- /*"JISX0208.1983-0", X11R6.4 */ +- /*"JISX0208.1990-0", X11R6.4 */ +- /*"JIS0208", JDK 1.1 */ +- ), +- jisx0208, +- { jisx0208_mbtowc, NULL }, { jisx0208_wctomb, NULL }) +- +-DEFENCODING(( "JIS_X0212", +- "JIS_X0212.1990-0", +- "JIS_X0212-1990", /* IANA */ +- "X0212", /* IANA */ +- "ISO-IR-159", /* IANA */ +- "csISO159JISX02121990", /* IANA */ +- /*"JISX0212.1990-0", X11R6.4 */ +- /*"JIS0212", JDK 1.1 */ +- ), +- jisx0212, +- { jisx0212_mbtowc, NULL }, { jisx0212_wctomb, NULL }) +- +-DEFENCODING(( "GB_1988-80", /* IANA */ +- "ISO646-CN", /* IANA */ +- "ISO-IR-57", /* IANA */ +- "CN", /* IANA */ +- "csISO57GB1988", /* IANA */ +- ), +- iso646_cn, +- { iso646_cn_mbtowc, NULL }, { iso646_cn_wctomb, NULL }) +- +-DEFENCODING(( "GB_2312-80", /* IANA */ +- "ISO-IR-58", /* IANA */ +- "csISO58GB231280", /* IANA */ +- "CHINESE", /* IANA */ +- /*"GB2312.1980-0", X11R6.4 */ +- ), +- gb2312, +- { gb2312_mbtowc, NULL }, { gb2312_wctomb, NULL }) +- +-DEFENCODING(( "ISO-IR-165", +- "CN-GB-ISOIR165", /* RFC 1922 */ +- ), +- isoir165, +- { isoir165_mbtowc, NULL }, { isoir165_wctomb, NULL }) +- +-DEFENCODING(( "KSC_5601", /* IANA */ +- "KS_C_5601-1987", /* IANA */ +- "KS_C_5601-1989", /* IANA */ +- "ISO-IR-149", /* IANA */ +- "csKSC56011987", /* IANA */ +- "KOREAN", /* IANA */ +- /*"KSC5601.1987-0", X11R6.4 */ +- /*"KSX1001:1992", Ken Lunde */ +- ), +- ksc5601, +- { ksc5601_mbtowc, NULL }, { ksc5601_wctomb, NULL }) +- +-/* CJK encodings */ +- +-DEFENCODING(( "EUC-JP", /* IANA */ +- "EUCJP", /* glibc */ +- "Extended_UNIX_Code_Packed_Format_for_Japanese", /* IANA */ +- "csEUCPkdFmtJapanese", /* IANA */ +- /*"EUC_JP", JDK 1.1 */ +- /*"CP51932", Windows */ +- ), +- euc_jp, +- { euc_jp_mbtowc, NULL }, { euc_jp_wctomb, NULL }) +- +-DEFENCODING(( "SHIFT_JIS", /* IANA */ +- "SHIFT-JIS", /* glibc */ +- "SJIS", /* JDK 1.1 */ +- "MS_KANJI", /* IANA */ +- "csShiftJIS", /* IANA */ +- ), +- sjis, +- { sjis_mbtowc, NULL }, { sjis_wctomb, NULL }) +- +-DEFENCODING(( "CP932", /* glibc */ +- ), +- cp932, +- { cp932_mbtowc, NULL }, { cp932_wctomb, NULL }) +- +-DEFENCODING(( "ISO-2022-JP", /* IANA, RFC 1468 */ +- "csISO2022JP", /* IANA */ +- /*"ISO2022JP", JDK 1.1 */ +- ), +- iso2022_jp, +- { iso2022_jp_mbtowc, NULL }, { iso2022_jp_wctomb, iso2022_jp_reset }) +- +-DEFENCODING(( "ISO-2022-JP-1", /* RFC 2237 */ +- ), +- iso2022_jp1, +- { iso2022_jp1_mbtowc, NULL }, { iso2022_jp1_wctomb, iso2022_jp1_reset }) +- +-DEFENCODING(( "ISO-2022-JP-2", /* IANA, RFC 1554 */ +- "csISO2022JP2", /* IANA */ +- ), +- iso2022_jp2, +- { iso2022_jp2_mbtowc, NULL }, { iso2022_jp2_wctomb, iso2022_jp2_reset }) +- +-DEFENCODING(( "EUC-CN", /* glibc */ +- "EUCCN", /* glibc */ +- "GB2312", /* IANA */ +- "CN-GB", /* RFC 1922 */ +- "csGB2312", /* IANA */ +- /*"EUC_CN", JDK 1.1 */ +- /*"CP51936", Windows */ +- ), +- euc_cn, +- { euc_cn_mbtowc, NULL }, { euc_cn_wctomb, NULL }) +- +-DEFENCODING(( "GBK", /* IANA, JDK 1.1 */ +- ), +- ces_gbk, +- { ces_gbk_mbtowc, NULL }, { ces_gbk_wctomb, NULL }) +- +-DEFENCODING(( "CP936", /* IANA */ +- "MS936", /* IANA */ +- "WINDOWS-936", /* IANA */ +- ), +- cp936, +- { cp936_mbtowc, NULL }, { cp936_wctomb, NULL }) +- +-DEFENCODING(( "GB18030", /* IANA, glibc */ +- /*"CP54936", Windows */ +- ), +- gb18030, +- { gb18030_mbtowc, NULL }, { gb18030_wctomb, NULL }) +- +-DEFENCODING(( "ISO-2022-CN", /* IANA, RFC 1922 */ +- "csISO2022CN", +- /*"ISO2022CN", JDK 1.1 */ +- ), +- iso2022_cn, +- { iso2022_cn_mbtowc, NULL }, { iso2022_cn_wctomb, iso2022_cn_reset }) +- +-DEFENCODING(( "ISO-2022-CN-EXT", /* IANA, RFC 1922 */ +- ), +- iso2022_cn_ext, +- { iso2022_cn_ext_mbtowc, NULL }, { iso2022_cn_ext_wctomb, iso2022_cn_ext_reset }) +- +-DEFENCODING(( "HZ", /* RFC 1843 */ +- "HZ-GB-2312", /* IANA, RFC 1842 */ +- ), +- hz, +- { hz_mbtowc, NULL }, { hz_wctomb, hz_reset }) +- +-DEFENCODING(( "EUC-TW", /* glibc */ +- "EUCTW", /* glibc */ +- "csEUCTW", +- /*"EUC_TW", JDK 1.1 */ +- /*"CP51950", Windows */ +- ), +- euc_tw, +- { euc_tw_mbtowc, NULL }, { euc_tw_wctomb, NULL }) +- +-DEFENCODING(( "BIG5", /* IANA, JDK 1.1 */ +- "BIG-5", /* glibc */ +- "BIG-FIVE", /* glibc */ +- "BIGFIVE", /* glibc */ +- "CN-BIG5", /* RFC 1922 */ +- "csBig5", /* IANA */ +- ), +- ces_big5, +- { ces_big5_mbtowc, NULL }, { ces_big5_wctomb, NULL }) +- +-DEFENCODING(( "CP950", /* JDK 1.1 */ +- ), +- cp950, +- { cp950_mbtowc, NULL }, { cp950_wctomb, NULL }) +- +-DEFENCODING(( "BIG5-HKSCS:1999", +- ), +- big5hkscs1999, +- { big5hkscs1999_mbtowc, big5hkscs1999_flushwc }, { big5hkscs1999_wctomb, big5hkscs1999_reset }) +- +-DEFENCODING(( "BIG5-HKSCS:2001", +- ), +- big5hkscs2001, +- { big5hkscs2001_mbtowc, big5hkscs2001_flushwc }, { big5hkscs2001_wctomb, big5hkscs2001_reset }) +- +-DEFENCODING(( "BIG5-HKSCS", /* IANA */ +- "BIG5HKSCS", /* glibc */ +- "BIG5-HKSCS:2004", +- ), +- big5hkscs2004, +- { big5hkscs2004_mbtowc, big5hkscs2004_flushwc }, { big5hkscs2004_wctomb, big5hkscs2004_reset }) +- +-DEFENCODING(( "EUC-KR", /* IANA, RFC 1557 */ +- "EUCKR", /* glibc */ +- "csEUCKR", /* IANA */ +- /*"EUC_KR", JDK 1.1 */ +- /*"CP51949", Windows */ +- ), +- euc_kr, +- { euc_kr_mbtowc, NULL }, { euc_kr_wctomb, NULL }) +- +-DEFENCODING(( "CP949", /* JDK 1.1 */ +- "UHC", /* glibc */ +- ), +- cp949, +- { cp949_mbtowc, NULL }, { cp949_wctomb, NULL }) +- +-DEFENCODING(( "JOHAB", /* glibc */ +- "CP1361", /* glibc */ +- ), +- johab, +- { johab_mbtowc, NULL }, { johab_wctomb, NULL }) +- +-DEFENCODING(( "ISO-2022-KR", /* IANA, RFC 1557 */ +- "csISO2022KR", /* IANA */ +- /*"ISO2022KR", JDK 1.1 */ +- ), +- iso2022_kr, +- { iso2022_kr_mbtowc, NULL }, { iso2022_kr_wctomb, iso2022_kr_reset }) +- +--- a/lib/encodings_dos.def ++++ b/lib/encodings_dos.def +@@ -26,102 +26,3 @@ DEFENCODING(( "CP437", + cp437, + { cp437_mbtowc, NULL }, { cp437_wctomb, NULL }) + +-DEFENCODING(( "CP737", /* JDK 1.1 */ +- ), +- cp737, +- { cp737_mbtowc, NULL }, { cp737_wctomb, NULL }) +- +-DEFENCODING(( "CP775", /* IANA, JDK 1.1 */ +- "IBM775", /* IANA */ +- "csPC775Baltic", /* IANA */ +- ), +- cp775, +- { cp775_mbtowc, NULL }, { cp775_wctomb, NULL }) +- +-DEFENCODING(( "CP852", /* IANA, JDK 1.1 */ +- "IBM852", /* IANA */ +- "852", /* IANA */ +- "csPCp852", /* IANA */ +- ), +- cp852, +- { cp852_mbtowc, NULL }, { cp852_wctomb, NULL }) +- +-DEFENCODING(( "CP853", +- ), +- cp853, +- { cp853_mbtowc, NULL }, { cp853_wctomb, NULL }) +- +-DEFENCODING(( "CP855", /* IANA, JDK 1.1 */ +- "IBM855", /* IANA */ +- "855", /* IANA */ +- "csIBM855", /* IANA */ +- ), +- cp855, +- { cp855_mbtowc, NULL }, { cp855_wctomb, NULL }) +- +-DEFENCODING(( "CP857", /* IANA, JDK 1.1 */ +- "IBM857", /* IANA */ +- "857", /* IANA */ +- "csIBM857", /* IANA */ +- ), +- cp857, +- { cp857_mbtowc, NULL }, { cp857_wctomb, NULL }) +- +-DEFENCODING(( "CP858", /* JDK 1.1.7 */ +- ), +- cp858, +- { cp858_mbtowc, NULL }, { cp858_wctomb, NULL }) +- +-DEFENCODING(( "CP860", /* IANA, JDK 1.1 */ +- "IBM860", /* IANA */ +- "860", /* IANA */ +- "csIBM860", /* IANA */ +- ), +- cp860, +- { cp860_mbtowc, NULL }, { cp860_wctomb, NULL }) +- +-DEFENCODING(( "CP861", /* IANA, JDK 1.1 */ +- "IBM861", /* IANA */ +- "861", /* IANA */ +- "CP-IS", /* IANA */ +- "csIBM861", /* IANA */ +- ), +- cp861, +- { cp861_mbtowc, NULL }, { cp861_wctomb, NULL }) +- +-DEFENCODING(( "CP863", /* IANA, JDK 1.1 */ +- "IBM863", /* IANA */ +- "863", /* IANA */ +- "csIBM863", /* IANA */ +- ), +- cp863, +- { cp863_mbtowc, NULL }, { cp863_wctomb, NULL }) +- +-DEFENCODING(( "CP864", /* IANA, JDK 1.1 */ +- "IBM864", /* IANA */ +- "csIBM864", /* IANA */ +- ), +- cp864, +- { cp864_mbtowc, NULL }, { cp864_wctomb, NULL }) +- +-DEFENCODING(( "CP865", /* IANA, JDK 1.1 */ +- "IBM865", /* IANA */ +- "865", /* IANA */ +- "csIBM865", /* IANA */ +- ), +- cp865, +- { cp865_mbtowc, NULL }, { cp865_wctomb, NULL }) +- +-DEFENCODING(( "CP869", /* IANA, JDK 1.1 */ +- "IBM869", /* IANA */ +- "869", /* IANA */ +- "CP-GR", /* IANA */ +- "csIBM869", /* IANA */ +- ), +- cp869, +- { cp869_mbtowc, NULL }, { cp869_wctomb, NULL }) +- +-DEFENCODING(( "CP1125", /* ICU */ +- ), +- cp1125, +- { cp1125_mbtowc, NULL }, { cp1125_wctomb, NULL }) +--- a/lib/loop_unicode.h ++++ b/lib/loop_unicode.h +@@ -24,14 +24,15 @@ + static int unicode_transliterate (conv_t cd, ucs4_t wc, + unsigned char* outptr, size_t outleft) + { ++/* + if (cd->oflags & HAVE_HANGUL_JAMO) { +- /* Decompose Hangul into Jamo. Use double-width Jamo (contained ++ /-* Decompose Hangul into Jamo. Use double-width Jamo (contained + in all Korean encodings and ISO-2022-JP-2), not half-width Jamo +- (contained in Unicode only). */ ++ (contained in Unicode only). *-/ + ucs4_t buf[3]; + int ret = johab_hangul_decompose(cd,buf,wc); + if (ret != RET_ILUNI) { +- /* we know 1 <= ret <= 3 */ ++ /-* we know 1 <= ret <= 3 *-/ + state_t backup_state = cd->ostate; + unsigned char* backup_outptr = outptr; + size_t backup_outleft = outleft; +@@ -57,9 +58,9 @@ static int unicode_transliterate (conv_t + } + } + { +- /* Try to use a variant, but postfix it with ++ /-* Try to use a variant, but postfix it with + U+303E IDEOGRAPHIC VARIATION INDICATOR +- (cf. Ken Lunde's "CJKV information processing", p. 188). */ ++ (cf. Ken Lunde's "CJKV information processing", p. 188). *-/ + int indx = -1; + if (wc == 0x3006) + indx = 0; +@@ -105,20 +106,20 @@ static int unicode_transliterate (conv_t + } + } + if (wc >= 0x2018 && wc <= 0x201a) { +- /* Special case for quotation marks 0x2018, 0x2019, 0x201a */ ++ /-* Special case for quotation marks 0x2018, 0x2019, 0x201a *-/ + ucs4_t substitute = + (cd->oflags & HAVE_QUOTATION_MARKS + ? (wc == 0x201a ? 0x2018 : wc) + : (cd->oflags & HAVE_ACCENTS +- ? (wc==0x2019 ? 0x00b4 : 0x0060) /* use accents */ +- : 0x0027 /* use apostrophe */ ++ ? (wc==0x2019 ? 0x00b4 : 0x0060) /-* use accents *-/ ++ : 0x0027 /-* use apostrophe *-/ + ) ); + int outcount = cd->ofuncs.xxx_wctomb(cd,outptr,substitute,outleft); + if (outcount != RET_ILUNI) + return outcount; + } + { +- /* Use the transliteration table. */ ++ /-* Use the transliteration table. *-/ + int indx = translit_index(wc); + if (indx >= 0) { + const unsigned int * cp = &translit_data[indx]; +@@ -135,7 +136,7 @@ static int unicode_transliterate (conv_t + } + sub_outcount = cd->ofuncs.xxx_wctomb(cd,outptr,cp[i],outleft); + if (sub_outcount == RET_ILUNI) +- /* Recursive transliteration. */ ++ /-* Recursive transliteration. *-/ + sub_outcount = unicode_transliterate(cd,cp[i],outptr,outleft); + if (sub_outcount <= RET_ILUNI) + goto translit_failed; +@@ -151,6 +152,7 @@ static int unicode_transliterate (conv_t + return RET_TOOSMALL; + } + } ++*/ + return RET_ILUNI; + } + diff --git a/libs/libiconv-full/patches/101-autotools.patch b/libs/libiconv-full/patches/101-autotools.patch new file mode 100644 index 0000000..f8fdce5 --- /dev/null +++ b/libs/libiconv-full/patches/101-autotools.patch @@ -0,0 +1,26014 @@ +--- a/libcharset/configure.ac ++++ b/libcharset/configure.ac +@@ -16,17 +16,17 @@ dnl along with the GNU CHARSET Library; + dnl write to the Free Software Foundation, Inc., 51 Franklin Street, + dnl Fifth Floor, Boston, MA 02110-1301, USA. + +-AC_PREREQ(2.13) ++AC_PREREQ(2.61) ++AC_INIT([libcharset],[1.4] ) ++AC_CONFIG_SRCDIR([lib/localcharset.c]) + +-PACKAGE=libcharset +-VERSION=1.4 +- +-AC_INIT(lib/localcharset.c) + AC_CONFIG_AUX_DIR(build-aux) + AC_CONFIG_HEADER(config.h) + AC_PROG_MAKE_SET +-AC_SUBST(PACKAGE) +-AC_SUBST(VERSION) ++dnl AC_SUBST(PACKAGE) ++dnl AC_SUBST(VERSION) ++ ++AC_CONFIG_MACRO_DIR([m4]) + + dnl checks for basic programs + +--- a/configure.ac ++++ b/configure.ac +@@ -24,6 +24,8 @@ AM_INIT_AUTOMAKE(libiconv, 1.11) + AC_CONFIG_HEADERS(config.h lib/config.h) + AC_PROG_MAKE_SET + ++AC_CONFIG_MACRO_DIR([m4]) ++ + dnl checks for basic programs + + AC_PROG_CC +--- a/libcharset/m4/libtool.m4 ++++ b/libcharset/m4/libtool.m4 +@@ -1,107 +1,186 @@ + # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +-## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 +-## Free Software Foundation, Inc. +-## Originally by Gordon Matzigkeit , 1996 +-## +-## This file is free software; the Free Software Foundation gives +-## unlimited permission to copy and/or distribute it, with or without +-## modifications, as long as this notice is preserved. +- +-# serial 48 AC_PROG_LIBTOOL +- +- +-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +-# ----------------------------------------------------------- +-# If this macro is not defined by Autoconf, define it here. +-m4_ifdef([AC_PROVIDE_IFELSE], +- [], +- [m4_define([AC_PROVIDE_IFELSE], +- [m4_ifdef([AC_PROVIDE_$1], +- [$2], [$3])])]) ++# ++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, ++# 2006, 2007, 2008 Free Software Foundation, Inc. ++# Written by Gordon Matzigkeit, 1996 ++# ++# This file is free software; the Free Software Foundation gives ++# unlimited permission to copy and/or distribute it, with or without ++# modifications, as long as this notice is preserved. ++ ++m4_define([_LT_COPYING], [dnl ++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, ++# 2006, 2007, 2008 Free Software Foundation, Inc. ++# Written by Gordon Matzigkeit, 1996 ++# ++# This file is part of GNU Libtool. ++# ++# GNU Libtool is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License as ++# published by the Free Software Foundation; either version 2 of ++# the License, or (at your option) any later version. ++# ++# As a special exception to the GNU General Public License, ++# if you distribute this file as part of a program or library that ++# is built using GNU Libtool, you may include this file under the ++# same distribution terms that you use for the rest of that program. ++# ++# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy ++# can be downloaded from http://www.gnu.org/licenses/gpl.html, or ++# obtained by writing to the Free Software Foundation, Inc., ++# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++]) + ++# serial 56 LT_INIT + +-# AC_PROG_LIBTOOL +-# --------------- +-AC_DEFUN([AC_PROG_LIBTOOL], +-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. +- AC_PROVIDE_IFELSE([AC_PROG_CXX], +- [AC_LIBTOOL_CXX], +- [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX +- ])]) +-dnl And a similar setup for Fortran 77 support +- AC_PROVIDE_IFELSE([AC_PROG_F77], +- [AC_LIBTOOL_F77], +- [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +-])]) +- +-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. +- AC_PROVIDE_IFELSE([AC_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [ifdef([AC_PROG_GCJ], +- [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) +- ifdef([A][M_PROG_GCJ], +- [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) +- ifdef([LT_AC_PROG_GCJ], +- [define([LT_AC_PROG_GCJ], +- defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +-])])# AC_PROG_LIBTOOL + ++# LT_PREREQ(VERSION) ++# ------------------ ++# Complain and exit if this libtool version is less that VERSION. ++m4_defun([LT_PREREQ], ++[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, ++ [m4_default([$3], ++ [m4_fatal([Libtool version $1 or higher is required], ++ 63)])], ++ [$2])]) + +-# _AC_PROG_LIBTOOL +-# ---------------- +-AC_DEFUN([_AC_PROG_LIBTOOL], +-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl ++ ++# _LT_CHECK_BUILDDIR ++# ------------------ ++# Complain if the absolute build directory name contains unusual characters ++m4_defun([_LT_CHECK_BUILDDIR], ++[case `pwd` in ++ *\ * | *\ *) ++ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; ++esac ++]) ++ ++ ++# LT_INIT([OPTIONS]) ++# ------------------ ++AC_DEFUN([LT_INIT], ++[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT ++AC_BEFORE([$0], [LT_LANG])dnl ++AC_BEFORE([$0], [LT_OUTPUT])dnl ++AC_BEFORE([$0], [LTDL_INIT])dnl ++m4_require([_LT_CHECK_BUILDDIR])dnl ++ ++dnl Autoconf doesn't catch unexpanded LT_ macros by default: ++m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl ++m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl ++dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 ++dnl unless we require an AC_DEFUNed macro: ++AC_REQUIRE([LTOPTIONS_VERSION])dnl ++AC_REQUIRE([LTSUGAR_VERSION])dnl ++AC_REQUIRE([LTVERSION_VERSION])dnl ++AC_REQUIRE([LTOBSOLETE_VERSION])dnl ++m4_require([_LT_PROG_LTMAIN])dnl ++ ++dnl Parse OPTIONS ++_LT_SET_OPTIONS([$0], [$1]) + + # This can be used to rebuild libtool when needed +-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" ++LIBTOOL_DEPS="$ltmain" + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)' ++LIBTOOL="$LIBTOOL/$host_alias-libtool" + AC_SUBST(LIBTOOL)dnl + +-# Prevent multiple expansion +-define([AC_PROG_LIBTOOL], []) +-])# _AC_PROG_LIBTOOL ++_LT_SETUP + ++# Only expand once: ++m4_define([LT_INIT]) ++])# LT_INIT ++ ++# Old names: ++AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) ++AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_PROG_LIBTOOL], []) ++dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + +-# AC_LIBTOOL_SETUP +-# ---------------- +-AC_DEFUN([AC_LIBTOOL_SETUP], +-[AC_PREREQ(2.50)dnl +-AC_REQUIRE([AC_ENABLE_SHARED])dnl +-AC_REQUIRE([AC_ENABLE_STATIC])dnl +-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +-AC_REQUIRE([AC_CANONICAL_HOST])dnl ++ ++# _LT_CC_BASENAME(CC) ++# ------------------- ++# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. ++m4_defun([_LT_CC_BASENAME], ++[for cc_temp in $1""; do ++ case $cc_temp in ++ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; ++ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; ++ \-*) ;; ++ *) break;; ++ esac ++done ++cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ++]) ++ ++ ++# _LT_FILEUTILS_DEFAULTS ++# ---------------------- ++# It is okay to use these file commands and assume they have been set ++# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. ++m4_defun([_LT_FILEUTILS_DEFAULTS], ++[: ${CP="cp -f"} ++: ${MV="mv -f"} ++: ${RM="rm -f"} ++])# _LT_FILEUTILS_DEFAULTS ++ ++ ++# _LT_SETUP ++# --------- ++m4_defun([_LT_SETUP], ++[AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_CANONICAL_BUILD])dnl ++_LT_DECL([], [host_alias], [0], [The host system])dnl ++_LT_DECL([], [host], [0])dnl ++_LT_DECL([], [host_os], [0])dnl ++dnl ++_LT_DECL([], [build_alias], [0], [The build system])dnl ++_LT_DECL([], [build], [0])dnl ++_LT_DECL([], [build_os], [0])dnl ++dnl + AC_REQUIRE([AC_PROG_CC])dnl +-AC_REQUIRE([AC_PROG_LD])dnl +-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +-AC_REQUIRE([AC_PROG_NM])dnl +- ++AC_REQUIRE([LT_PATH_LD])dnl ++AC_REQUIRE([LT_PATH_NM])dnl ++dnl + AC_REQUIRE([AC_PROG_LN_S])dnl +-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +-AC_REQUIRE([AC_OBJEXT])dnl +-AC_REQUIRE([AC_EXEEXT])dnl ++test -z "$LN_S" && LN_S="ln -s" ++_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl + dnl ++AC_REQUIRE([LT_CMD_MAX_LEN])dnl ++_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl ++_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl ++dnl ++m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++m4_require([_LT_CHECK_SHELL_FEATURES])dnl ++m4_require([_LT_CMD_RELOAD])dnl ++m4_require([_LT_CHECK_MAGIC_METHOD])dnl ++m4_require([_LT_CMD_OLD_ARCHIVE])dnl ++m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl ++ ++_LT_CONFIG_LIBTOOL_INIT([ ++# See if we are running on zsh, and set the options which allow our ++# commands through without removal of \ escapes INIT. ++if test -n "\${ZSH_VERSION+set}" ; then ++ setopt NO_GLOB_SUBST ++fi ++]) ++if test -n "${ZSH_VERSION+set}" ; then ++ setopt NO_GLOB_SUBST ++fi + +-AC_LIBTOOL_SYS_MAX_CMD_LEN +-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +-AC_LIBTOOL_OBJDIR ++_LT_CHECK_OBJDIR + +-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +-_LT_AC_PROG_ECHO_BACKSLASH ++m4_require([_LT_TAG_COMPILER])dnl ++_LT_PROG_ECHO_BACKSLASH + + case $host_os in + aix3*) +@@ -117,6307 +196,6803 @@ esac + + # Sed substitution that helps us do robust quoting. It backslashifies + # metacharacters that are still active within double-quoted strings. +-Xsed='sed -e 1s/^X//' +-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] ++sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + + # Same as above, but do not quote variable references. +-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] ++double_quote_subst='s/\([["`\\]]\)/\\\1/g' + + # Sed substitution to delay expansion of an escaped shell variable in a + # double_quote_subst'ed string. + delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + ++# Sed substitution to delay expansion of an escaped single quote. ++delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' ++ + # Sed substitution to avoid accidental globbing in evaled expressions + no_glob_subst='s/\*/\\\*/g' + +-# Constants: +-rm="rm -f" +- + # Global variables: +-default_ofile=libtool ++ofile=${host_alias}-libtool + can_build_shared=yes + + # All known linkers require a `.a' archive for static linking (except MSVC, + # which needs '.lib'). + libext=a +-ltmain="$ac_aux_dir/ltmain.sh" +-ofile="$default_ofile" +-with_gnu_ld="$lt_cv_prog_gnu_ld" + +-AC_CHECK_TOOL(AR, ar, false) +-AC_CHECK_TOOL(RANLIB, ranlib, :) +-AC_CHECK_TOOL(STRIP, strip, :) ++with_gnu_ld="$lt_cv_prog_gnu_ld" + + old_CC="$CC" + old_CFLAGS="$CFLAGS" + + # Set sane defaults for various variables +-test -z "$AR" && AR=ar +-test -z "$AR_FLAGS" && AR_FLAGS=cru +-test -z "$AS" && AS=as + test -z "$CC" && CC=cc + test -z "$LTCC" && LTCC=$CC + test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +-test -z "$DLLTOOL" && DLLTOOL=dlltool + test -z "$LD" && LD=ld +-test -z "$LN_S" && LN_S="ln -s" +-test -z "$MAGIC_CMD" && MAGIC_CMD=file +-test -z "$NM" && NM=nm +-test -z "$SED" && SED=sed +-test -z "$OBJDUMP" && OBJDUMP=objdump +-test -z "$RANLIB" && RANLIB=: +-test -z "$STRIP" && STRIP=: + test -z "$ac_objext" && ac_objext=o + +-# Determine commands to create old-style static archives. +-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +-old_postinstall_cmds='chmod 644 $oldlib' +-old_postuninstall_cmds= +- +-if test -n "$RANLIB"; then +- case $host_os in +- openbsd*) +- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" +- ;; +- *) +- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" +- ;; +- esac +- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +-fi +- + _LT_CC_BASENAME([$compiler]) + + # Only perform the check for file, if the check method requires it ++test -z "$MAGIC_CMD" && MAGIC_CMD=file + case $deplibs_check_method in + file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then +- AC_PATH_MAGIC ++ _LT_PATH_MAGIC + fi + ;; + esac + +-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +-enable_win32_dll=yes, enable_win32_dll=no) +- +-AC_ARG_ENABLE([libtool-lock], +- [AC_HELP_STRING([--disable-libtool-lock], +- [avoid locking (might break parallel builds)])]) +-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes ++# Use C for the default configuration in the libtool script ++LT_SUPPORTED_TAG([CC]) ++_LT_LANG_C_CONFIG ++_LT_LANG_DEFAULT_CONFIG ++_LT_CONFIG_COMMANDS ++])# _LT_SETUP + +-AC_ARG_WITH([pic], +- [AC_HELP_STRING([--with-pic], +- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], +- [pic_mode="$withval"], +- [pic_mode=default]) +-test -z "$pic_mode" && pic_mode=default + +-# Use C for the default configuration in the libtool script +-tagname= +-AC_LIBTOOL_LANG_C_CONFIG +-_LT_AC_TAGCONFIG +-])# AC_LIBTOOL_SETUP ++# _LT_PROG_LTMAIN ++# --------------- ++# Note that this code is called both from `configure', and `config.status' ++# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, ++# `config.status' has no value for ac_aux_dir unless we are using Automake, ++# so we pass a copy along to make sure it has a sensible value anyway. ++m4_defun([_LT_PROG_LTMAIN], ++[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl ++_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ++ltmain="$ac_aux_dir/ltmain.sh" ++])# _LT_PROG_LTMAIN + + +-# _LT_AC_SYS_COMPILER +-# ------------------- +-AC_DEFUN([_LT_AC_SYS_COMPILER], +-[AC_REQUIRE([AC_PROG_CC])dnl ++## ------------------------------------- ## ++## Accumulate code for creating libtool. ## ++## ------------------------------------- ## ++ ++# So that we can recreate a full libtool script including additional ++# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS ++# in macros and then make a single call at the end using the `libtool' ++# label. ++ ++ ++# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) ++# ---------------------------------------- ++# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. ++m4_define([_LT_CONFIG_LIBTOOL_INIT], ++[m4_ifval([$1], ++ [m4_append([_LT_OUTPUT_LIBTOOL_INIT], ++ [$1 ++])])]) ++ ++# Initialize. ++m4_define([_LT_OUTPUT_LIBTOOL_INIT]) ++ ++ ++# _LT_CONFIG_LIBTOOL([COMMANDS]) ++# ------------------------------ ++# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. ++m4_define([_LT_CONFIG_LIBTOOL], ++[m4_ifval([$1], ++ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], ++ [$1 ++])])]) ++ ++# Initialize. ++m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) ++ ++ ++# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) ++# ----------------------------------------------------- ++m4_defun([_LT_CONFIG_SAVE_COMMANDS], ++[_LT_CONFIG_LIBTOOL([$1]) ++_LT_CONFIG_LIBTOOL_INIT([$2]) ++]) + +-# If no C compiler was specified, use CC. +-LTCC=${LTCC-"$CC"} + +-# If no C compiler flags were specified, use CFLAGS. +-LTCFLAGS=${LTCFLAGS-"$CFLAGS"} ++# _LT_FORMAT_COMMENT([COMMENT]) ++# ----------------------------- ++# Add leading comment marks to the start of each line, and a trailing ++# full-stop to the whole comment if one is not present already. ++m4_define([_LT_FORMAT_COMMENT], ++[m4_ifval([$1], [ ++m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], ++ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) ++)]) + +-# Allow CC to be a program name with arguments. +-compiler=$CC +-])# _LT_AC_SYS_COMPILER + + +-# _LT_CC_BASENAME(CC) +-# ------------------- +-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +-AC_DEFUN([_LT_CC_BASENAME], +-[for cc_temp in $1""; do +- case $cc_temp in +- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; +- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; +- \-*) ;; +- *) break;; +- esac +-done +-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ++## ------------------------ ## ++## FIXME: Eliminate VARNAME ## ++## ------------------------ ## ++ ++ ++# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) ++# ------------------------------------------------------------------- ++# CONFIGNAME is the name given to the value in the libtool script. ++# VARNAME is the (base) name used in the configure script. ++# VALUE may be 0, 1 or 2 for a computed quote escaped value based on ++# VARNAME. Any other value will be used directly. ++m4_define([_LT_DECL], ++[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], ++ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], ++ [m4_ifval([$1], [$1], [$2])]) ++ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) ++ m4_ifval([$4], ++ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) ++ lt_dict_add_subkey([lt_decl_dict], [$2], ++ [tagged?], [m4_ifval([$5], [yes], [no])])]) + ]) + + +-# _LT_COMPILER_BOILERPLATE +-# ------------------------ +-# Check for compiler boilerplate output or warnings with +-# the simple compiler test code. +-AC_DEFUN([_LT_COMPILER_BOILERPLATE], +-[ac_outfile=conftest.$ac_objext +-printf "$lt_simple_compile_test_code" >conftest.$ac_ext +-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +-_lt_compiler_boilerplate=`cat conftest.err` +-$rm conftest* +-])# _LT_COMPILER_BOILERPLATE +- ++# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) ++# -------------------------------------------------------- ++m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) ++ ++ ++# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) ++# ------------------------------------------------ ++m4_define([lt_decl_tag_varnames], ++[_lt_decl_filter([tagged?], [yes], $@)]) ++ ++ ++# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) ++# --------------------------------------------------------- ++m4_define([_lt_decl_filter], ++[m4_case([$#], ++ [0], [m4_fatal([$0: too few arguments: $#])], ++ [1], [m4_fatal([$0: too few arguments: $#: $1])], ++ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], ++ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], ++ [lt_dict_filter([lt_decl_dict], $@)])[]dnl ++]) + +-# _LT_LINKER_BOILERPLATE +-# ---------------------- +-# Check for linker boilerplate output or warnings with +-# the simple link test code. +-AC_DEFUN([_LT_LINKER_BOILERPLATE], +-[ac_outfile=conftest.$ac_objext +-printf "$lt_simple_link_test_code" >conftest.$ac_ext +-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +-_lt_linker_boilerplate=`cat conftest.err` +-$rm conftest* +-])# _LT_LINKER_BOILERPLATE + ++# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) ++# -------------------------------------------------- ++m4_define([lt_decl_quote_varnames], ++[_lt_decl_filter([value], [1], $@)]) ++ ++ ++# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) ++# --------------------------------------------------- ++m4_define([lt_decl_dquote_varnames], ++[_lt_decl_filter([value], [2], $@)]) ++ ++ ++# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) ++# --------------------------------------------------- ++m4_define([lt_decl_varnames_tagged], ++[_$0(m4_quote(m4_default([$1], [[, ]])), ++ m4_quote(m4_if([$2], [], ++ m4_quote(lt_decl_tag_varnames), ++ m4_quote(m4_shift($@)))), ++ m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) ++m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) ++ ++ ++# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) ++# ------------------------------------------------ ++m4_define([lt_decl_all_varnames], ++[_$0(m4_quote(m4_default([$1], [[, ]])), ++ m4_if([$2], [], ++ m4_quote(lt_decl_varnames), ++ m4_quote(m4_shift($@))))[]dnl ++]) ++m4_define([_lt_decl_all_varnames], ++[lt_join($@, lt_decl_varnames_tagged([$1], ++ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ++]) + +-# _LT_AC_SYS_LIBPATH_AIX +-# ---------------------- +-# Links a minimal program and checks the executable +-# for the system default hardcoded library path. In most cases, +-# this is /usr/lib:/lib, but when the MPI compilers are used +-# the location of the communication and MPI libs are included too. +-# If we don't find anything, use the default library path according +-# to the aix ld manual. +-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +-}'` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +-}'`; fi],[]) +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +-])# _LT_AC_SYS_LIBPATH_AIX + ++# _LT_CONFIG_STATUS_DECLARE([VARNAME]) ++# ------------------------------------ ++# Quote a variable value, and forward it to `config.status' so that its ++# declaration there will have the same value as in `configure'. VARNAME ++# must have a single quote delimited value for this to work. ++m4_define([_LT_CONFIG_STATUS_DECLARE], ++[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) + +-# _LT_AC_SHELL_INIT(ARG) +-# ---------------------- +-AC_DEFUN([_LT_AC_SHELL_INIT], +-[ifdef([AC_DIVERSION_NOTICE], +- [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], +- [AC_DIVERT_PUSH(NOTICE)]) +-$1 +-AC_DIVERT_POP +-])# _LT_AC_SHELL_INIT + ++# _LT_CONFIG_STATUS_DECLARATIONS ++# ------------------------------ ++# We delimit libtool config variables with single quotes, so when ++# we write them to config.status, we have to be sure to quote all ++# embedded single quotes properly. In configure, this macro expands ++# each variable declared with _LT_DECL (and _LT_TAGDECL) into: ++# ++# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' ++m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], ++[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), ++ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + +-# _LT_AC_PROG_ECHO_BACKSLASH +-# -------------------------- +-# Add some code to the start of the generated configure script which +-# will find an echo command which doesn't interpret backslashes. +-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +-[_LT_AC_SHELL_INIT([ +-# Check that we are running under the correct shell. +-SHELL=${CONFIG_SHELL-/bin/sh} + +-case X$ECHO in +-X*--fallback-echo) +- # Remove one level of quotation (which was required for Make). +- ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` +- ;; +-esac ++# _LT_LIBTOOL_TAGS ++# ---------------- ++# Output comment and list of tags supported by the script ++m4_defun([_LT_LIBTOOL_TAGS], ++[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl ++available_tags="_LT_TAGS"dnl ++]) + +-echo=${ECHO-echo} +-if test "X[$]1" = X--no-reexec; then +- # Discard the --no-reexec flag, and continue. +- shift +-elif test "X[$]1" = X--fallback-echo; then +- # Avoid inline document here, it may be left over +- : +-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then +- # Yippee, $echo works! +- : +-else +- # Restart under the correct shell. +- exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +-fi + +-if test "X[$]1" = X--fallback-echo; then +- # used as fallback echo +- shift +- cat </dev/null 2>&1 && unset CDPATH + +-if test -z "$ECHO"; then +-if test "X${echo_test_string+set}" != Xset; then +-# find a string as large as possible, as long as the shell can cope with it +- for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do +- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... +- if (echo_test_string=`eval $cmd`) 2>/dev/null && +- echo_test_string=`eval $cmd` && +- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null +- then +- break +- fi +- done +-fi ++# _LT_LIBTOOL_CONFIG_VARS ++# ----------------------- ++# Produce commented declarations of non-tagged libtool config variables ++# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' ++# script. Tagged libtool config variables (even for the LIBTOOL CONFIG ++# section) are produced by _LT_LIBTOOL_TAG_VARS. ++m4_defun([_LT_LIBTOOL_CONFIG_VARS], ++[m4_foreach([_lt_var], ++ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), ++ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + +-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- : +-else +- # The Solaris, AIX, and Digital Unix default echo programs unquote +- # backslashes. This makes it impossible to quote backslashes using +- # echo "$something" | sed 's/\\/\\\\/g' +- # +- # So, first we look for a working echo in the user's PATH. + +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for dir in $PATH /usr/ucb; do +- IFS="$lt_save_ifs" +- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && +- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- echo="$dir/echo" +- break +- fi +- done +- IFS="$lt_save_ifs" ++# _LT_LIBTOOL_TAG_VARS(TAG) ++# ------------------------- ++m4_define([_LT_LIBTOOL_TAG_VARS], ++[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), ++ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + +- if test "X$echo" = Xecho; then +- # We didn't find a better echo, so look for alternatives. +- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- # This shell has a builtin print -r that does the trick. +- echo='print -r' +- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && +- test "X$CONFIG_SHELL" != X/bin/ksh; then +- # If we have ksh, try running configure again with it. +- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} +- export ORIGINAL_CONFIG_SHELL +- CONFIG_SHELL=/bin/ksh +- export CONFIG_SHELL +- exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} +- else +- # Try using printf. +- echo='printf %s\n' +- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- # Cool, printf works +- : +- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && +- test "X$echo_testing_string" = 'X\t' && +- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL +- export CONFIG_SHELL +- SHELL="$CONFIG_SHELL" +- export SHELL +- echo="$CONFIG_SHELL [$]0 --fallback-echo" +- elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && +- test "X$echo_testing_string" = 'X\t' && +- echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- echo="$CONFIG_SHELL [$]0 --fallback-echo" +- else +- # maybe with a smaller string... +- prev=: + +- for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do +- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null +- then +- break +- fi +- prev="$cmd" +- done ++# _LT_TAGVAR(VARNAME, [TAGNAME]) ++# ------------------------------ ++m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + +- if test "$prev" != 'sed 50q "[$]0"'; then +- echo_test_string=`eval $prev` +- export echo_test_string +- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} +- else +- # Oops. We lost completely, so just stick with echo. +- echo=echo +- fi +- fi +- fi +- fi +-fi +-fi + +-# Copy echo and quote the copy suitably for passing to libtool from +-# the Makefile, instead of quoting the original, which is used later. +-ECHO=$echo +-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then +- ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +-fi ++# _LT_CONFIG_COMMANDS ++# ------------------- ++# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of ++# variables for single and double quote escaping we saved from calls ++# to _LT_DECL, we can put quote escaped variables declarations ++# into `config.status', and then the shell code to quote escape them in ++# for loops in `config.status'. Finally, any additional code accumulated ++# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. ++m4_defun([_LT_CONFIG_COMMANDS], ++[AC_PROVIDE_IFELSE([LT_OUTPUT], ++ dnl If the libtool generation code has been placed in $CONFIG_LT, ++ dnl instead of duplicating it all over again into config.status, ++ dnl then we will have config.status run $CONFIG_LT later, so it ++ dnl needs to know what name is stored there: ++ [AC_CONFIG_COMMANDS([libtool], ++ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], ++ dnl If the libtool generation code is destined for config.status, ++ dnl expand the accumulated commands and init code now: ++ [AC_CONFIG_COMMANDS([libtool], ++ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ++])#_LT_CONFIG_COMMANDS + +-AC_SUBST(ECHO) +-])])# _LT_AC_PROG_ECHO_BACKSLASH + ++# Initialize. ++m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], ++[ + +-# _LT_AC_LOCK +-# ----------- +-AC_DEFUN([_LT_AC_LOCK], +-[AC_ARG_ENABLE([libtool-lock], +- [AC_HELP_STRING([--disable-libtool-lock], +- [avoid locking (might break parallel builds)])]) +-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes ++# The HP-UX ksh and POSIX shell print the target directory to stdout ++# if CDPATH is set. ++(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +-# Some flags need to be propagated to the compiler or linker for good +-# libtool support. +-case $host in +-ia64-*-hpux*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.$ac_objext` in +- *ELF-32*) +- HPUX_IA64_MODE="32" +- ;; +- *ELF-64*) +- HPUX_IA64_MODE="64" +- ;; +- esac +- fi +- rm -rf conftest* +- ;; +-*-*-irix6*) +- # Find out which ABI we are using. +- echo '[#]line __oline__ "configure"' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- if test "$lt_cv_prog_gnu_ld" = yes; then +- case `/usr/bin/file conftest.$ac_objext` in +- *32-bit*) +- LD="${LD-ld} -melf32bsmip" +- ;; +- *N32*) +- LD="${LD-ld} -melf32bmipn32" ++sed_quote_subst='$sed_quote_subst' ++double_quote_subst='$double_quote_subst' ++delay_variable_subst='$delay_variable_subst' ++_LT_CONFIG_STATUS_DECLARATIONS ++LTCC='$LTCC' ++LTCFLAGS='$LTCFLAGS' ++compiler='$compiler_DEFAULT' ++ ++# Quote evaled strings. ++for var in lt_decl_all_varnames([[ \ ++]], lt_decl_quote_varnames); do ++ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in ++ *[[\\\\\\\`\\"\\\$]]*) ++ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; +- *64-bit*) +- LD="${LD-ld} -melf64bmip" ++ *) ++ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +- else +- case `/usr/bin/file conftest.$ac_objext` in +- *32-bit*) +- LD="${LD-ld} -32" +- ;; +- *N32*) +- LD="${LD-ld} -n32" ++done ++ ++# Double-quote double-evaled strings. ++for var in lt_decl_all_varnames([[ \ ++]], lt_decl_dquote_varnames); do ++ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in ++ *[[\\\\\\\`\\"\\\$]]*) ++ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; +- *64-bit*) +- LD="${LD-ld} -64" ++ *) ++ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +- fi +- fi +- rm -rf conftest* ++done ++ ++# Fix-up fallback echo if it was mangled by the above quoting rules. ++case \$lt_ECHO in ++*'\\\[$]0 --fallback-echo"')dnl " ++ lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; ++esac + +-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.o` in +- *32-bit*) +- case $host in +- x86_64-*linux*) +- LD="${LD-ld} -m elf_i386" +- ;; +- ppc64-*linux*|powerpc64-*linux*) +- LD="${LD-ld} -m elf32ppclinux" +- ;; +- s390x-*linux*) +- LD="${LD-ld} -m elf_s390" +- ;; +- sparc64-*linux*) +- LD="${LD-ld} -m elf32_sparc" +- ;; +- esac +- ;; +- *64-bit*) +- case $host in +- x86_64-*linux*) +- LD="${LD-ld} -m elf_x86_64" +- ;; +- ppc*-*linux*|powerpc*-*linux*) +- LD="${LD-ld} -m elf64ppc" +- ;; +- s390*-*linux*) +- LD="${LD-ld} -m elf64_s390" +- ;; +- sparc*-*linux*) +- LD="${LD-ld} -m elf64_sparc" +- ;; +- esac +- ;; +- esac +- fi +- rm -rf conftest* +- ;; ++_LT_OUTPUT_LIBTOOL_INIT ++]) + +-*-*-sco3.2v5*) +- # On SCO OpenServer 5, we need -belf to get full-featured binaries. +- SAVE_CFLAGS="$CFLAGS" +- CFLAGS="$CFLAGS -belf" +- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, +- [AC_LANG_PUSH(C) +- AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) +- AC_LANG_POP]) +- if test x"$lt_cv_cc_needs_belf" != x"yes"; then +- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf +- CFLAGS="$SAVE_CFLAGS" +- fi +- ;; +-sparc*-*solaris*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.o` in +- *64-bit*) +- case $lt_cv_prog_gnu_ld in +- yes*) LD="${LD-ld} -m elf64_sparc" ;; +- *) LD="${LD-ld} -64" ;; +- esac +- ;; +- esac +- fi +- rm -rf conftest* +- ;; + +-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +-[*-*-cygwin* | *-*-mingw* | *-*-pw32*) +- AC_CHECK_TOOL(DLLTOOL, dlltool, false) +- AC_CHECK_TOOL(AS, as, false) +- AC_CHECK_TOOL(OBJDUMP, objdump, false) +- ;; +- ]) +-esac ++# LT_OUTPUT ++# --------- ++# This macro allows early generation of the libtool script (before ++# AC_OUTPUT is called), incase it is used in configure for compilation ++# tests. ++AC_DEFUN([LT_OUTPUT], ++[: ${CONFIG_LT=./config.lt} ++AC_MSG_NOTICE([creating $CONFIG_LT]) ++cat >"$CONFIG_LT" <<_LTEOF ++#! $SHELL ++# Generated by $as_me. ++# Run this file to recreate a libtool stub with the current configuration. ++ ++lt_cl_silent=false ++SHELL=\${CONFIG_SHELL-$SHELL} ++_LTEOF ++ ++cat >>"$CONFIG_LT" <<\_LTEOF ++AS_SHELL_SANITIZE ++_AS_PREPARE + +-need_locks="$enable_libtool_lock" ++exec AS_MESSAGE_FD>&1 ++exec AS_MESSAGE_LOG_FD>>config.log ++{ ++ echo ++ AS_BOX([Running $as_me.]) ++} >&AS_MESSAGE_LOG_FD ++ ++lt_cl_help="\ ++\`$as_me' creates a local libtool stub from the current configuration, ++for use in further configure time tests before the real libtool is ++generated. ++ ++Usage: $[0] [[OPTIONS]] ++ ++ -h, --help print this help, then exit ++ -V, --version print version number, then exit ++ -q, --quiet do not print progress messages ++ -d, --debug don't remove temporary files ++ ++Report bugs to ." ++ ++lt_cl_version="\ ++m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl ++m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) ++configured by $[0], generated by m4_PACKAGE_STRING. ++ ++Copyright (C) 2008 Free Software Foundation, Inc. ++This config.lt script is free software; the Free Software Foundation ++gives unlimited permision to copy, distribute and modify it." + +-])# _LT_AC_LOCK ++while test $[#] != 0 ++do ++ case $[1] in ++ --version | --v* | -V ) ++ echo "$lt_cl_version"; exit 0 ;; ++ --help | --h* | -h ) ++ echo "$lt_cl_help"; exit 0 ;; ++ --debug | --d* | -d ) ++ debug=: ;; ++ --quiet | --q* | --silent | --s* | -q ) ++ lt_cl_silent=: ;; + ++ -*) AC_MSG_ERROR([unrecognized option: $[1] ++Try \`$[0] --help' for more information.]) ;; + +-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +-# ---------------------------------------------------------------- +-# Check whether the given compiler option works +-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +-[AC_REQUIRE([LT_AC_PROG_SED]) +-AC_CACHE_CHECK([$1], [$2], +- [$2=no +- ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) +- printf "$lt_simple_compile_test_code" > conftest.$ac_ext +- lt_compiler_flag="$3" +- # Insert the option either (1) after the last *FLAGS variable, or +- # (2) before a word containing "conftest.", or (3) at the end. +- # Note that $ac_compile itself does not contain backslashes and begins +- # with a dollar sign (not a hyphen), so the echo should work correctly. +- # The option is referenced via a variable to avoid confusing sed. +- lt_compile=`echo "$ac_compile" | $SED \ +- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ +- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ +- -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) +- (eval "$lt_compile" 2>conftest.err) +- ac_status=$? +- cat conftest.err >&AS_MESSAGE_LOG_FD +- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD +- if (exit $ac_status) && test -s "$ac_outfile"; then +- # The compiler can only warn and ignore the option if not recognized +- # So say no if there are warnings other than the usual output. +- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp +- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 +- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then +- $2=yes +- fi +- fi +- $rm conftest* +-]) ++ *) AC_MSG_ERROR([unrecognized argument: $[1] ++Try \`$[0] --help' for more information.]) ;; ++ esac ++ shift ++done + +-if test x"[$]$2" = xyes; then +- ifelse([$5], , :, [$5]) +-else +- ifelse([$6], , :, [$6]) ++if $lt_cl_silent; then ++ exec AS_MESSAGE_FD>/dev/null + fi +-])# AC_LIBTOOL_COMPILER_OPTION +- +- +-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +-# [ACTION-SUCCESS], [ACTION-FAILURE]) +-# ------------------------------------------------------------ +-# Check whether the given compiler option works +-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +-[AC_CACHE_CHECK([$1], [$2], +- [$2=no +- save_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS $3" +- printf "$lt_simple_link_test_code" > conftest.$ac_ext +- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then +- # The linker can only warn and ignore the option if not recognized +- # So say no if there are warnings +- if test -s conftest.err; then +- # Append any errors to the config.log. +- cat conftest.err 1>&AS_MESSAGE_LOG_FD +- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp +- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 +- if diff conftest.exp conftest.er2 >/dev/null; then +- $2=yes +- fi +- else +- $2=yes +- fi +- fi +- $rm conftest* +- LDFLAGS="$save_LDFLAGS" +-]) ++_LTEOF + +-if test x"[$]$2" = xyes; then +- ifelse([$4], , :, [$4]) +-else +- ifelse([$5], , :, [$5]) ++cat >>"$CONFIG_LT" <<_LTEOF ++_LT_OUTPUT_LIBTOOL_COMMANDS_INIT ++_LTEOF ++ ++cat >>"$CONFIG_LT" <<\_LTEOF ++AC_MSG_NOTICE([creating $ofile]) ++_LT_OUTPUT_LIBTOOL_COMMANDS ++AS_EXIT(0) ++_LTEOF ++chmod +x "$CONFIG_LT" ++ ++# configure is writing to config.log, but config.lt does its own redirection, ++# appending to config.log, which fails on DOS, as config.log is still kept ++# open by configure. Here we exec the FD to /dev/null, effectively closing ++# config.log, so it can be properly (re)opened and appended to by config.lt. ++if test "$no_create" != yes; then ++ lt_cl_success=: ++ test "$silent" = yes && ++ lt_config_lt_args="$lt_config_lt_args --quiet" ++ exec AS_MESSAGE_LOG_FD>/dev/null ++ $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false ++ exec AS_MESSAGE_LOG_FD>>config.log ++ $lt_cl_success || AS_EXIT(1) + fi +-])# AC_LIBTOOL_LINKER_OPTION +- ++])# LT_OUTPUT + +-# AC_LIBTOOL_SYS_MAX_CMD_LEN +-# -------------------------- +-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +-[# find the maximum length of command line arguments +-AC_MSG_CHECKING([the maximum length of command line arguments]) +-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl +- i=0 +- teststring="ABCD" + +- case $build_os in +- msdosdjgpp*) +- # On DJGPP, this test can blow up pretty badly due to problems in libc +- # (any single argument exceeding 2000 bytes causes a buffer overrun +- # during glob expansion). Even if it were fixed, the result of this +- # check would be larger than it should be. +- lt_cv_sys_max_cmd_len=12288; # 12K is about right +- ;; ++# _LT_CONFIG(TAG) ++# --------------- ++# If TAG is the built-in tag, create an initial libtool script with a ++# default configuration from the untagged config vars. Otherwise add code ++# to config.status for appending the configuration named by TAG from the ++# matching tagged config vars. ++m4_defun([_LT_CONFIG], ++[m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++_LT_CONFIG_SAVE_COMMANDS([ ++ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl ++ m4_if(_LT_TAG, [C], [ ++ # See if we are running on zsh, and set the options which allow our ++ # commands through without removal of \ escapes. ++ if test -n "${ZSH_VERSION+set}" ; then ++ setopt NO_GLOB_SUBST ++ fi + +- gnu*) +- # Under GNU Hurd, this test is not required because there is +- # no limit to the length of command line arguments. +- # Libtool will interpret -1 as no limit whatsoever +- lt_cv_sys_max_cmd_len=-1; +- ;; ++ cfgfile="${ofile}T" ++ trap "$RM \"$cfgfile\"; exit 1" 1 2 15 ++ $RM "$cfgfile" + +- cygwin* | mingw*) +- # On Win9x/ME, this test blows up -- it succeeds, but takes +- # about 5 minutes as the teststring grows exponentially. +- # Worse, since 9x/ME are not pre-emptively multitasking, +- # you end up with a "frozen" computer, even though with patience +- # the test eventually succeeds (with a max line length of 256k). +- # Instead, let's just punt: use the minimum linelength reported by +- # all of the supported platforms: 8192 (on NT/2K/XP). +- lt_cv_sys_max_cmd_len=8192; +- ;; ++ cat <<_LT_EOF >> "$cfgfile" ++#! $SHELL + +- amigaos*) +- # On AmigaOS with pdksh, this test takes hours, literally. +- # So we just punt and use a minimum line length of 8192. +- lt_cv_sys_max_cmd_len=8192; +- ;; ++# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. ++# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION ++# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: ++# NOTE: Changes made to this file will be lost: look at ltmain.sh. ++# ++_LT_COPYING ++_LT_LIBTOOL_TAGS + +- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) +- # This has been around since 386BSD, at least. Likely further. +- if test -x /sbin/sysctl; then +- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` +- elif test -x /usr/sbin/sysctl; then +- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` +- else +- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs +- fi +- # And add a safety zone +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` +- ;; ++# ### BEGIN LIBTOOL CONFIG ++_LT_LIBTOOL_CONFIG_VARS ++_LT_LIBTOOL_TAG_VARS ++# ### END LIBTOOL CONFIG + +- interix*) +- # We know the value 262144 and hardcode it with a safety zone (like BSD) +- lt_cv_sys_max_cmd_len=196608 +- ;; ++_LT_EOF + +- osf*) +- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure +- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not +- # nice to cause kernel panics so lets avoid the loop below. +- # First set a reasonable default. +- lt_cv_sys_max_cmd_len=16384 +- # +- if test -x /sbin/sysconfig; then +- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in +- *1*) lt_cv_sys_max_cmd_len=-1 ;; +- esac +- fi +- ;; +- sco3.2v5*) +- lt_cv_sys_max_cmd_len=102400 +- ;; +- sysv5* | sco5v6* | sysv4.2uw2*) +- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` +- if test -n "$kargmax"; then +- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` +- else +- lt_cv_sys_max_cmd_len=32768 +- fi +- ;; +- *) +- # If test is not a shell built-in, we'll probably end up computing a +- # maximum length that is only half of the actual maximum length, but +- # we can't tell. +- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} +- while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ +- = "XX$teststring") >/dev/null 2>&1 && +- new_result=`expr "X$teststring" : ".*" 2>&1` && +- lt_cv_sys_max_cmd_len=$new_result && +- test $i != 17 # 1/2 MB should be enough +- do +- i=`expr $i + 1` +- teststring=$teststring$teststring +- done +- teststring= +- # Add a significant safety factor because C++ compilers can tack on massive +- # amounts of additional arguments before passing them to the linker. +- # It appears as though 1/2 is a usable value. +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ++ case $host_os in ++ aix3*) ++ cat <<\_LT_EOF >> "$cfgfile" ++# AIX sometimes has problems with the GCC collect2 program. For some ++# reason, if we set the COLLECT_NAMES environment variable, the problems ++# vanish in a puff of smoke. ++if test "X${COLLECT_NAMES+set}" != Xset; then ++ COLLECT_NAMES= ++ export COLLECT_NAMES ++fi ++_LT_EOF + ;; + esac +-]) +-if test -n $lt_cv_sys_max_cmd_len ; then +- AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +-else +- AC_MSG_RESULT(none) +-fi +-])# AC_LIBTOOL_SYS_MAX_CMD_LEN + ++ _LT_PROG_LTMAIN + +-# _LT_AC_CHECK_DLFCN +-# ------------------ +-AC_DEFUN([_LT_AC_CHECK_DLFCN], +-[AC_CHECK_HEADERS(dlfcn.h)dnl +-])# _LT_AC_CHECK_DLFCN ++ # We use sed instead of cat because bash on DJGPP gets confused if ++ # if finds mixed CR/LF and LF-only lines. Since sed operates in ++ # text mode, it properly converts lines to CR/LF. This bash problem ++ # is reportedly fixed, but why not run on old versions too? ++ sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ ++ || (rm -f "$cfgfile"; exit 1) + ++ _LT_PROG_XSI_SHELLFNS + +-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +-# --------------------------------------------------------------------- +-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +-if test "$cross_compiling" = yes; then : +- [$4] +-else +- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 +- lt_status=$lt_dlunknown +- cat > conftest.$ac_ext <> "$cfgfile" \ ++ || (rm -f "$cfgfile"; exit 1) + +-#if HAVE_DLFCN_H +-#include +-#endif ++ mv -f "$cfgfile" "$ofile" || ++ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") ++ chmod +x "$ofile" ++], ++[cat <<_LT_EOF >> "$ofile" + +-#include ++dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded ++dnl in a comment (ie after a #). ++# ### BEGIN LIBTOOL TAG CONFIG: $1 ++_LT_LIBTOOL_TAG_VARS(_LT_TAG) ++# ### END LIBTOOL TAG CONFIG: $1 ++_LT_EOF ++])dnl /m4_if ++], ++[m4_if([$1], [], [ ++ PACKAGE='$PACKAGE' ++ VERSION='$VERSION' ++ TIMESTAMP='$TIMESTAMP' ++ RM='$RM' ++ ofile='$ofile'], []) ++])dnl /_LT_CONFIG_SAVE_COMMANDS ++])# _LT_CONFIG ++ ++ ++# LT_SUPPORTED_TAG(TAG) ++# --------------------- ++# Trace this macro to discover what tags are supported by the libtool ++# --tag option, using: ++# autoconf --trace 'LT_SUPPORTED_TAG:$1' ++AC_DEFUN([LT_SUPPORTED_TAG], []) ++ ++ ++# C support is built-in for now ++m4_define([_LT_LANG_C_enabled], []) ++m4_define([_LT_TAGS], []) + +-#ifdef RTLD_GLOBAL +-# define LT_DLGLOBAL RTLD_GLOBAL +-#else +-# ifdef DL_GLOBAL +-# define LT_DLGLOBAL DL_GLOBAL +-# else +-# define LT_DLGLOBAL 0 +-# endif +-#endif + +-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we +- find out it does not work in some platform. */ +-#ifndef LT_DLLAZY_OR_NOW +-# ifdef RTLD_LAZY +-# define LT_DLLAZY_OR_NOW RTLD_LAZY +-# else +-# ifdef DL_LAZY +-# define LT_DLLAZY_OR_NOW DL_LAZY +-# else +-# ifdef RTLD_NOW +-# define LT_DLLAZY_OR_NOW RTLD_NOW +-# else +-# ifdef DL_NOW +-# define LT_DLLAZY_OR_NOW DL_NOW +-# else +-# define LT_DLLAZY_OR_NOW 0 +-# endif +-# endif +-# endif +-# endif +-#endif ++# LT_LANG(LANG) ++# ------------- ++# Enable libtool support for the given language if not already enabled. ++AC_DEFUN([LT_LANG], ++[AC_BEFORE([$0], [LT_OUTPUT])dnl ++m4_case([$1], ++ [C], [_LT_LANG(C)], ++ [C++], [_LT_LANG(CXX)], ++ [Java], [_LT_LANG(GCJ)], ++ [Fortran 77], [_LT_LANG(F77)], ++ [Fortran], [_LT_LANG(FC)], ++ [Windows Resource], [_LT_LANG(RC)], ++ [m4_ifdef([_LT_LANG_]$1[_CONFIG], ++ [_LT_LANG($1)], ++ [m4_fatal([$0: unsupported language: "$1"])])])dnl ++])# LT_LANG + +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif + +-void fnord() { int i=42;} +-int main () +-{ +- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +- int status = $lt_dlunknown; +- +- if (self) +- { +- if (dlsym (self,"fnord")) status = $lt_dlno_uscore; +- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; +- /* dlclose (self); */ +- } +- else +- puts (dlerror ()); ++# _LT_LANG(LANGNAME) ++# ------------------ ++m4_defun([_LT_LANG], ++[m4_ifdef([_LT_LANG_]$1[_enabled], [], ++ [LT_SUPPORTED_TAG([$1])dnl ++ m4_append([_LT_TAGS], [$1 ])dnl ++ m4_define([_LT_LANG_]$1[_enabled], [])dnl ++ _LT_LANG_$1_CONFIG($1)])dnl ++])# _LT_LANG + +- exit (status); +-}] +-EOF +- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then +- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null +- lt_status=$? +- case x$lt_status in +- x$lt_dlno_uscore) $1 ;; +- x$lt_dlneed_uscore) $2 ;; +- x$lt_dlunknown|x*) $3 ;; +- esac +- else : +- # compilation failed +- $3 +- fi +-fi +-rm -fr conftest* +-])# _LT_AC_TRY_DLOPEN_SELF + ++# _LT_LANG_DEFAULT_CONFIG ++# ----------------------- ++m4_defun([_LT_LANG_DEFAULT_CONFIG], ++[AC_PROVIDE_IFELSE([AC_PROG_CXX], ++ [LT_LANG(CXX)], ++ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) ++ ++AC_PROVIDE_IFELSE([AC_PROG_F77], ++ [LT_LANG(F77)], ++ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) ++ ++AC_PROVIDE_IFELSE([AC_PROG_FC], ++ [LT_LANG(FC)], ++ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) ++ ++dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal ++dnl pulling things in needlessly. ++AC_PROVIDE_IFELSE([AC_PROG_GCJ], ++ [LT_LANG(GCJ)], ++ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], ++ [LT_LANG(GCJ)], ++ [AC_PROVIDE_IFELSE([LT_PROG_GCJ], ++ [LT_LANG(GCJ)], ++ [m4_ifdef([AC_PROG_GCJ], ++ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) ++ m4_ifdef([A][M_PROG_GCJ], ++ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) ++ m4_ifdef([LT_PROG_GCJ], ++ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) ++ ++AC_PROVIDE_IFELSE([LT_PROG_RC], ++ [LT_LANG(RC)], ++ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ++])# _LT_LANG_DEFAULT_CONFIG ++ ++# Obsolete macros: ++AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) ++AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) ++AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) ++AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_LIBTOOL_CXX], []) ++dnl AC_DEFUN([AC_LIBTOOL_F77], []) ++dnl AC_DEFUN([AC_LIBTOOL_FC], []) ++dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) + +-# AC_LIBTOOL_DLOPEN_SELF +-# ---------------------- +-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +-if test "x$enable_dlopen" != xyes; then +- enable_dlopen=unknown +- enable_dlopen_self=unknown +- enable_dlopen_self_static=unknown +-else +- lt_cv_dlopen=no +- lt_cv_dlopen_libs= + +- case $host_os in +- beos*) +- lt_cv_dlopen="load_add_on" +- lt_cv_dlopen_libs= +- lt_cv_dlopen_self=yes +- ;; ++# _LT_TAG_COMPILER ++# ---------------- ++m4_defun([_LT_TAG_COMPILER], ++[AC_REQUIRE([AC_PROG_CC])dnl + +- mingw* | pw32*) +- lt_cv_dlopen="LoadLibrary" +- lt_cv_dlopen_libs= +- ;; ++_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl ++_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl ++_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl ++_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +- cygwin*) +- lt_cv_dlopen="dlopen" +- lt_cv_dlopen_libs= +- ;; ++# If no C compiler was specified, use CC. ++LTCC=${LTCC-"$CC"} + +- darwin*) +- # if libdl is installed we need to link against it +- AC_CHECK_LIB([dl], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ +- lt_cv_dlopen="dyld" +- lt_cv_dlopen_libs= +- lt_cv_dlopen_self=yes +- ]) +- ;; ++# If no C compiler flags were specified, use CFLAGS. ++LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +- *) +- AC_CHECK_FUNC([shl_load], +- [lt_cv_dlopen="shl_load"], +- [AC_CHECK_LIB([dld], [shl_load], +- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], +- [AC_CHECK_FUNC([dlopen], +- [lt_cv_dlopen="dlopen"], +- [AC_CHECK_LIB([dl], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], +- [AC_CHECK_LIB([svld], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], +- [AC_CHECK_LIB([dld], [dld_link], +- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) +- ]) +- ]) +- ]) +- ]) +- ]) +- ;; +- esac ++# Allow CC to be a program name with arguments. ++compiler=$CC ++])# _LT_TAG_COMPILER + +- if test "x$lt_cv_dlopen" != xno; then +- enable_dlopen=yes +- else +- enable_dlopen=no +- fi + +- case $lt_cv_dlopen in +- dlopen) +- save_CPPFLAGS="$CPPFLAGS" +- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" ++# _LT_COMPILER_BOILERPLATE ++# ------------------------ ++# Check for compiler boilerplate output or warnings with ++# the simple compiler test code. ++m4_defun([_LT_COMPILER_BOILERPLATE], ++[m4_require([_LT_DECL_SED])dnl ++ac_outfile=conftest.$ac_objext ++echo "$lt_simple_compile_test_code" >conftest.$ac_ext ++eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err ++_lt_compiler_boilerplate=`cat conftest.err` ++$RM conftest* ++])# _LT_COMPILER_BOILERPLATE + +- save_LDFLAGS="$LDFLAGS" +- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + +- save_LIBS="$LIBS" +- LIBS="$lt_cv_dlopen_libs $LIBS" ++# _LT_LINKER_BOILERPLATE ++# ---------------------- ++# Check for linker boilerplate output or warnings with ++# the simple link test code. ++m4_defun([_LT_LINKER_BOILERPLATE], ++[m4_require([_LT_DECL_SED])dnl ++ac_outfile=conftest.$ac_objext ++echo "$lt_simple_link_test_code" >conftest.$ac_ext ++eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err ++_lt_linker_boilerplate=`cat conftest.err` ++$RM -r conftest* ++])# _LT_LINKER_BOILERPLATE + +- AC_CACHE_CHECK([whether a program can dlopen itself], +- lt_cv_dlopen_self, [dnl +- _LT_AC_TRY_DLOPEN_SELF( +- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, +- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ++# _LT_REQUIRED_DARWIN_CHECKS ++# ------------------------- ++m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ ++ case $host_os in ++ rhapsody* | darwin*) ++ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) ++ AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) ++ AC_CHECK_TOOL([LIPO], [lipo], [:]) ++ AC_CHECK_TOOL([OTOOL], [otool], [:]) ++ AC_CHECK_TOOL([OTOOL64], [otool64], [:]) ++ _LT_DECL([], [DSYMUTIL], [1], ++ [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) ++ _LT_DECL([], [NMEDIT], [1], ++ [Tool to change global to local symbols on Mac OS X]) ++ _LT_DECL([], [LIPO], [1], ++ [Tool to manipulate fat objects and archives on Mac OS X]) ++ _LT_DECL([], [OTOOL], [1], ++ [ldd/readelf like tool for Mach-O binaries on Mac OS X]) ++ _LT_DECL([], [OTOOL64], [1], ++ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) ++ ++ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], ++ [lt_cv_apple_cc_single_mod=no ++ if test -z "${LT_MULTI_MODULE}"; then ++ # By default we will add the -single_module flag. You can override ++ # by either setting the environment variable LT_MULTI_MODULE ++ # non-empty at configure time, or by adding -multi_module to the ++ # link flags. ++ rm -rf libconftest.dylib* ++ echo "int foo(void){return 1;}" > conftest.c ++ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ ++-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD ++ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ ++ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err ++ _lt_result=$? ++ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then ++ lt_cv_apple_cc_single_mod=yes ++ else ++ cat conftest.err >&AS_MESSAGE_LOG_FD ++ fi ++ rm -rf libconftest.dylib* ++ rm -f conftest.* ++ fi]) ++ AC_CACHE_CHECK([for -exported_symbols_list linker flag], ++ [lt_cv_ld_exported_symbols_list], ++ [lt_cv_ld_exported_symbols_list=no ++ save_LDFLAGS=$LDFLAGS ++ echo "_main" > conftest.sym ++ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], ++ [lt_cv_ld_exported_symbols_list=yes], ++ [lt_cv_ld_exported_symbols_list=no]) ++ LDFLAGS="$save_LDFLAGS" + ]) +- +- if test "x$lt_cv_dlopen_self" = xyes; then +- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" +- AC_CACHE_CHECK([whether a statically linked program can dlopen itself], +- lt_cv_dlopen_self_static, [dnl +- _LT_AC_TRY_DLOPEN_SELF( +- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, +- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) +- ]) ++ case $host_os in ++ rhapsody* | darwin1.[[012]]) ++ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; ++ darwin1.*) ++ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; ++ darwin*) # darwin 5.x on ++ # if running on 10.5 or later, the deployment target defaults ++ # to the OS version, if on x86, and 10.4, the deployment ++ # target defaults to 10.4. Don't you love it? ++ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in ++ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) ++ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; ++ 10.[[012]]*) ++ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; ++ 10.*) ++ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; ++ esac ++ ;; ++ esac ++ if test "$lt_cv_apple_cc_single_mod" = "yes"; then ++ _lt_dar_single_mod='$single_module' ++ fi ++ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then ++ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' ++ else ++ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' ++ fi ++ if test "$DSYMUTIL" != ":"; then ++ _lt_dsymutil='~$DSYMUTIL $lib || :' ++ else ++ _lt_dsymutil= + fi +- +- CPPFLAGS="$save_CPPFLAGS" +- LDFLAGS="$save_LDFLAGS" +- LIBS="$save_LIBS" + ;; + esac ++]) + +- case $lt_cv_dlopen_self in +- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; +- *) enable_dlopen_self=unknown ;; +- esac + +- case $lt_cv_dlopen_self_static in +- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; +- *) enable_dlopen_self_static=unknown ;; +- esac +-fi +-])# AC_LIBTOOL_DLOPEN_SELF ++# _LT_DARWIN_LINKER_FEATURES ++# -------------------------- ++# Checks for linker and compiler features on darwin ++m4_defun([_LT_DARWIN_LINKER_FEATURES], ++[ ++ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ _LT_TAGVAR(hardcode_direct, $1)=no ++ _LT_TAGVAR(hardcode_automatic, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='' ++ _LT_TAGVAR(link_all_deplibs, $1)=yes ++ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" ++ if test "$GCC" = "yes"; then ++ output_verbose_link_cmd=echo ++ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" ++ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" ++ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" ++ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" ++ m4_if([$1], [CXX], ++[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then ++ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" ++ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" ++ fi ++],[]) ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++]) + ++# _LT_SYS_MODULE_PATH_AIX ++# ----------------------- ++# Links a minimal program and checks the executable ++# for the system default hardcoded library path. In most cases, ++# this is /usr/lib:/lib, but when the MPI compilers are used ++# the location of the communication and MPI libs are included too. ++# If we don't find anything, use the default library path according ++# to the aix ld manual. ++m4_defun([_LT_SYS_MODULE_PATH_AIX], ++[m4_require([_LT_DECL_SED])dnl ++AC_LINK_IFELSE(AC_LANG_PROGRAM,[ ++lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\(.*\)$/\1/ ++ p ++ } ++ }' ++aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++# Check for a 64-bit object if we didn't find anything. ++if test -z "$aix_libpath"; then ++ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++fi],[]) ++if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++])# _LT_SYS_MODULE_PATH_AIX + +-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +-# --------------------------------- +-# Check to see if options -c and -o are simultaneously supported by compiler +-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], +- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], +- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no +- $rm -r conftest 2>/dev/null +- mkdir conftest +- cd conftest +- mkdir out +- printf "$lt_simple_compile_test_code" > conftest.$ac_ext + +- lt_compiler_flag="-o out/conftest2.$ac_objext" +- # Insert the option either (1) after the last *FLAGS variable, or +- # (2) before a word containing "conftest.", or (3) at the end. +- # Note that $ac_compile itself does not contain backslashes and begins +- # with a dollar sign (not a hyphen), so the echo should work correctly. +- lt_compile=`echo "$ac_compile" | $SED \ +- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ +- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ +- -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) +- (eval "$lt_compile" 2>out/conftest.err) +- ac_status=$? +- cat out/conftest.err >&AS_MESSAGE_LOG_FD +- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD +- if (exit $ac_status) && test -s out/conftest2.$ac_objext +- then +- # The compiler can only warn and ignore the option if not recognized +- # So say no if there are warnings +- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp +- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 +- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then +- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes +- fi +- fi +- chmod u+w . 2>&AS_MESSAGE_LOG_FD +- $rm conftest* +- # SGI C++ compiler will create directory out/ii_files/ for +- # template instantiation +- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files +- $rm out/* && rmdir out +- cd .. +- rmdir conftest +- $rm conftest* +-]) +-])# AC_LIBTOOL_PROG_CC_C_O ++# _LT_SHELL_INIT(ARG) ++# ------------------- ++m4_define([_LT_SHELL_INIT], ++[ifdef([AC_DIVERSION_NOTICE], ++ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], ++ [AC_DIVERT_PUSH(NOTICE)]) ++$1 ++AC_DIVERT_POP ++])# _LT_SHELL_INIT + + +-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +-# ----------------------------------------- +-# Check to see if we can do hard links to lock some files if needed +-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +-[AC_REQUIRE([_LT_AC_LOCK])dnl ++# _LT_PROG_ECHO_BACKSLASH ++# ----------------------- ++# Add some code to the start of the generated configure script which ++# will find an echo command which doesn't interpret backslashes. ++m4_defun([_LT_PROG_ECHO_BACKSLASH], ++[_LT_SHELL_INIT([ ++# Check that we are running under the correct shell. ++SHELL=${CONFIG_SHELL-/bin/sh} + +-hard_links="nottested" +-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then +- # do not overwrite the value of need_locks provided by the user +- AC_MSG_CHECKING([if we can lock with hard links]) +- hard_links=yes +- $rm conftest* +- ln conftest.a conftest.b 2>/dev/null && hard_links=no +- touch conftest.a +- ln conftest.a conftest.b 2>&5 || hard_links=no +- ln conftest.a conftest.b 2>/dev/null && hard_links=no +- AC_MSG_RESULT([$hard_links]) +- if test "$hard_links" = no; then +- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) +- need_locks=warn +- fi ++case X$lt_ECHO in ++X*--fallback-echo) ++ # Remove one level of quotation (which was required for Make). ++ ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ++ ;; ++esac ++ ++ECHO=${lt_ECHO-echo} ++if test "X[$]1" = X--no-reexec; then ++ # Discard the --no-reexec flag, and continue. ++ shift ++elif test "X[$]1" = X--fallback-echo; then ++ # Avoid inline document here, it may be left over ++ : ++elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then ++ # Yippee, $ECHO works! ++ : + else +- need_locks=no ++ # Restart under the correct shell. ++ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} + fi +-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + +- +-# AC_LIBTOOL_OBJDIR +-# ----------------- +-AC_DEFUN([AC_LIBTOOL_OBJDIR], +-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +-[rm -f .libs 2>/dev/null +-mkdir .libs 2>/dev/null +-if test -d .libs; then +- lt_cv_objdir=.libs +-else +- # MS-DOS does not allow filenames that begin with a dot. +- lt_cv_objdir=_libs ++if test "X[$]1" = X--fallback-echo; then ++ # used as fallback echo ++ shift ++ cat <<_LT_EOF ++[$]* ++_LT_EOF ++ exit 0 + fi +-rmdir .libs 2>/dev/null]) +-objdir=$lt_cv_objdir +-])# AC_LIBTOOL_OBJDIR + ++# The HP-UX ksh and POSIX shell print the target directory to stdout ++# if CDPATH is set. ++(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +-# ---------------------------------------------- +-# Check hardcoding attributes. +-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +-[AC_MSG_CHECKING([how to hardcode library paths into programs]) +-_LT_AC_TAGVAR(hardcode_action, $1)= +-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ +- test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ +- test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then +- +- # We can hardcode non-existant directories. +- if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && +- # If the only mechanism to avoid hardcoding is shlibpath_var, we +- # have to relink, otherwise we might link with an installed library +- # when we should be linking with a yet-to-be-installed one +- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && +- test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then +- # Linking always hardcodes the temporary library directory. +- _LT_AC_TAGVAR(hardcode_action, $1)=relink +- else +- # We can link without hardcoding, and we can hardcode nonexisting dirs. +- _LT_AC_TAGVAR(hardcode_action, $1)=immediate ++if test -z "$lt_ECHO"; then ++ if test "X${echo_test_string+set}" != Xset; then ++ # find a string as large as possible, as long as the shell can cope with it ++ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do ++ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... ++ if { echo_test_string=`eval $cmd`; } 2>/dev/null && ++ { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null ++ then ++ break ++ fi ++ done + fi +-else +- # We cannot hardcode anything, or else we can only hardcode existing +- # directories. +- _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +-fi +-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then +- # Fast installation is not supported +- enable_fast_install=no +-elif test "$shlibpath_overrides_runpath" = yes || +- test "$enable_shared" = no; then +- # Fast installation is not necessary +- enable_fast_install=needless +-fi +-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH ++ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && ++ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && ++ test "X$echo_testing_string" = "X$echo_test_string"; then ++ : ++ else ++ # The Solaris, AIX, and Digital Unix default echo programs unquote ++ # backslashes. This makes it impossible to quote backslashes using ++ # echo "$something" | sed 's/\\/\\\\/g' ++ # ++ # So, first we look for a working echo in the user's PATH. + ++ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ++ for dir in $PATH /usr/ucb; do ++ IFS="$lt_save_ifs" ++ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && ++ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && ++ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && ++ test "X$echo_testing_string" = "X$echo_test_string"; then ++ ECHO="$dir/echo" ++ break ++ fi ++ done ++ IFS="$lt_save_ifs" + +-# AC_LIBTOOL_SYS_LIB_STRIP +-# ------------------------ +-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +-[striplib= +-old_striplib= +-AC_MSG_CHECKING([whether stripping libraries is possible]) +-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then +- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" +- test -z "$striplib" && striplib="$STRIP --strip-unneeded" +- AC_MSG_RESULT([yes]) +-else +-# FIXME - insert some real tests, host_os isn't really good enough +- case $host_os in +- darwin*) +- if test -n "$STRIP" ; then +- striplib="$STRIP -x" +- AC_MSG_RESULT([yes]) +- else +- AC_MSG_RESULT([no]) +-fi +- ;; +- *) +- AC_MSG_RESULT([no]) +- ;; +- esac +-fi +-])# AC_LIBTOOL_SYS_LIB_STRIP ++ if test "X$ECHO" = Xecho; then ++ # We didn't find a better echo, so look for alternatives. ++ if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && ++ echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && ++ test "X$echo_testing_string" = "X$echo_test_string"; then ++ # This shell has a builtin print -r that does the trick. ++ ECHO='print -r' ++ elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && ++ test "X$CONFIG_SHELL" != X/bin/ksh; then ++ # If we have ksh, try running configure again with it. ++ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} ++ export ORIGINAL_CONFIG_SHELL ++ CONFIG_SHELL=/bin/ksh ++ export CONFIG_SHELL ++ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} ++ else ++ # Try using printf. ++ ECHO='printf %s\n' ++ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && ++ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && ++ test "X$echo_testing_string" = "X$echo_test_string"; then ++ # Cool, printf works ++ : ++ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && ++ test "X$echo_testing_string" = 'X\t' && ++ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && ++ test "X$echo_testing_string" = "X$echo_test_string"; then ++ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL ++ export CONFIG_SHELL ++ SHELL="$CONFIG_SHELL" ++ export SHELL ++ ECHO="$CONFIG_SHELL [$]0 --fallback-echo" ++ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && ++ test "X$echo_testing_string" = 'X\t' && ++ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && ++ test "X$echo_testing_string" = "X$echo_test_string"; then ++ ECHO="$CONFIG_SHELL [$]0 --fallback-echo" ++ else ++ # maybe with a smaller string... ++ prev=: + ++ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do ++ if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null ++ then ++ break ++ fi ++ prev="$cmd" ++ done + +-# AC_LIBTOOL_SYS_DYNAMIC_LINKER +-# ----------------------------- +-# PORTME Fill in your ld.so characteristics +-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +-[AC_MSG_CHECKING([dynamic linker characteristics]) +-library_names_spec= +-libname_spec='lib$name' +-soname_spec= +-shrext_cmds=".so" +-postinstall_cmds= +-postuninstall_cmds= +-finish_cmds= +-finish_eval= +-shlibpath_var= +-shlibpath_overrides_runpath=unknown +-version_type=none +-dynamic_linker="$host_os ld.so" +-sys_lib_dlsearch_path_spec="/lib /usr/lib" +-if test "$GCC" = yes; then +- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` +- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then +- # if the path contains ";" then we assume it to be the separator +- # otherwise default to the standard path separator (i.e. ":") - it is +- # assumed that no part of a normal pathname contains ";" but that should +- # okay in the real world where ";" in dirpaths is itself problematic. +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` +- else +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ if test "$prev" != 'sed 50q "[$]0"'; then ++ echo_test_string=`eval $prev` ++ export echo_test_string ++ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} ++ else ++ # Oops. We lost completely, so just stick with echo. ++ ECHO=echo ++ fi ++ fi ++ fi ++ fi + fi +-else +- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + fi +-need_lib_prefix=unknown +-hardcode_into_libs=no + +-# when you set need_version to no, make sure it does not cause -set_version +-# flags to be left without arguments +-need_version=unknown ++# Copy echo and quote the copy suitably for passing to libtool from ++# the Makefile, instead of quoting the original, which is used later. ++lt_ECHO=$ECHO ++if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ++ lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" ++fi + +-case $host_os in +-aix3*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' +- shlibpath_var=LIBPATH ++AC_SUBST(lt_ECHO) ++]) ++_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) ++_LT_DECL([], [ECHO], [1], ++ [An echo program that does not interpret backslashes]) ++])# _LT_PROG_ECHO_BACKSLASH + +- # AIX 3 has no versioning support, so we append a major version to the name. +- soname_spec='${libname}${release}${shared_ext}$major' +- ;; + +-aix4* | aix5*) +- version_type=linux +- need_lib_prefix=no +- need_version=no +- hardcode_into_libs=yes +- if test "$host_cpu" = ia64; then +- # AIX 5 supports IA64 +- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- else +- # With GCC up to 2.95.x, collect2 would create an import file +- # for dependence libraries. The import file would start with +- # the line `#! .'. This would cause the generated library to +- # depend on `.', always an invalid library. This was fixed in +- # development snapshots of GCC prior to 3.0. +- case $host_os in +- aix4 | aix4.[[01]] | aix4.[[01]].*) +- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' +- echo ' yes ' +- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then +- : +- else +- can_build_shared=no +- fi +- ;; ++# _LT_ENABLE_LOCK ++# --------------- ++m4_defun([_LT_ENABLE_LOCK], ++[AC_ARG_ENABLE([libtool-lock], ++ [AS_HELP_STRING([--disable-libtool-lock], ++ [avoid locking (might break parallel builds)])]) ++test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes ++ ++# Some flags need to be propagated to the compiler or linker for good ++# libtool support. ++case $host in ++ia64-*-hpux*) ++ # Find out which ABI we are using. ++ echo 'int i;' > conftest.$ac_ext ++ if AC_TRY_EVAL(ac_compile); then ++ case `/usr/bin/file conftest.$ac_objext` in ++ *ELF-32*) ++ HPUX_IA64_MODE="32" ++ ;; ++ *ELF-64*) ++ HPUX_IA64_MODE="64" ++ ;; + esac +- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct +- # soname into executable. Probably we can add versioning support to +- # collect2, so additional links can be useful in future. +- if test "$aix_use_runtimelinking" = yes; then +- # If using run time linking (on AIX 4.2 or later) use lib.so +- # instead of lib.a to let people know that these are not +- # typical AIX shared libraries. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ fi ++ rm -rf conftest* ++ ;; ++*-*-irix6*) ++ # Find out which ABI we are using. ++ echo '[#]line __oline__ "configure"' > conftest.$ac_ext ++ if AC_TRY_EVAL(ac_compile); then ++ if test "$lt_cv_prog_gnu_ld" = yes; then ++ case `/usr/bin/file conftest.$ac_objext` in ++ *32-bit*) ++ LD="${LD-ld} -melf32bsmip" ++ ;; ++ *N32*) ++ LD="${LD-ld} -melf32bmipn32" ++ ;; ++ *64-bit*) ++ LD="${LD-ld} -melf64bmip" ++ ;; ++ esac + else +- # We preserve .a as extension for shared libraries through AIX4.2 +- # and later when we are not doing run time linking. +- library_names_spec='${libname}${release}.a $libname.a' +- soname_spec='${libname}${release}${shared_ext}$major' ++ case `/usr/bin/file conftest.$ac_objext` in ++ *32-bit*) ++ LD="${LD-ld} -32" ++ ;; ++ *N32*) ++ LD="${LD-ld} -n32" ++ ;; ++ *64-bit*) ++ LD="${LD-ld} -64" ++ ;; ++ esac + fi +- shlibpath_var=LIBPATH + fi ++ rm -rf conftest* + ;; + +-amigaos*) +- library_names_spec='$libname.ixlibrary $libname.a' +- # Create ${libname}_ixlibrary.a entries in /sys/libs. +- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ++x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ ++s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ++ # Find out which ABI we are using. ++ echo 'int i;' > conftest.$ac_ext ++ if AC_TRY_EVAL(ac_compile); then ++ case `/usr/bin/file conftest.o` in ++ *32-bit*) ++ case $host in ++ x86_64-*kfreebsd*-gnu) ++ LD="${LD-ld} -m elf_i386_fbsd" ++ ;; ++ x86_64-*linux*) ++ LD="${LD-ld} -m elf_i386" ++ ;; ++ ppc64-*linux*|powerpc64-*linux*) ++ LD="${LD-ld} -m elf32ppclinux" ++ ;; ++ s390x-*linux*) ++ LD="${LD-ld} -m elf_s390" ++ ;; ++ sparc64-*linux*) ++ LD="${LD-ld} -m elf32_sparc" ++ ;; ++ esac ++ ;; ++ *64-bit*) ++ case $host in ++ x86_64-*kfreebsd*-gnu) ++ LD="${LD-ld} -m elf_x86_64_fbsd" ++ ;; ++ x86_64-*linux*) ++ LD="${LD-ld} -m elf_x86_64" ++ ;; ++ ppc*-*linux*|powerpc*-*linux*) ++ LD="${LD-ld} -m elf64ppc" ++ ;; ++ s390*-*linux*|s390*-*tpf*) ++ LD="${LD-ld} -m elf64_s390" ++ ;; ++ sparc*-*linux*) ++ LD="${LD-ld} -m elf64_sparc" ++ ;; ++ esac ++ ;; ++ esac ++ fi ++ rm -rf conftest* + ;; + +-beos*) +- library_names_spec='${libname}${shared_ext}' +- dynamic_linker="$host_os ld.so" +- shlibpath_var=LIBRARY_PATH ++*-*-sco3.2v5*) ++ # On SCO OpenServer 5, we need -belf to get full-featured binaries. ++ SAVE_CFLAGS="$CFLAGS" ++ CFLAGS="$CFLAGS -belf" ++ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, ++ [AC_LANG_PUSH(C) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) ++ AC_LANG_POP]) ++ if test x"$lt_cv_cc_needs_belf" != x"yes"; then ++ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf ++ CFLAGS="$SAVE_CFLAGS" ++ fi + ;; +- +-bsdi[[45]]*) +- version_type=linux +- 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' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" +- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" +- # the default ld.so.conf also contains /usr/contrib/lib and +- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow +- # libtool to hard-code these into programs ++sparc*-*solaris*) ++ # Find out which ABI we are using. ++ echo 'int i;' > conftest.$ac_ext ++ if AC_TRY_EVAL(ac_compile); then ++ case `/usr/bin/file conftest.o` in ++ *64-bit*) ++ case $lt_cv_prog_gnu_ld in ++ yes*) LD="${LD-ld} -m elf64_sparc" ;; ++ *) ++ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then ++ LD="${LD-ld} -64" ++ fi ++ ;; ++ esac ++ ;; ++ esac ++ fi ++ rm -rf conftest* + ;; ++esac + +-cygwin* | mingw* | pw32*) +- version_type=windows +- shrext_cmds=".dll" +- need_version=no +- need_lib_prefix=no ++need_locks="$enable_libtool_lock" ++])# _LT_ENABLE_LOCK + +- case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32*) +- library_names_spec='$libname.dll.a' +- # DLL is installed to $(libdir)/../bin by postinstall_cmds +- postinstall_cmds='base_file=`basename \${file}`~ +- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ +- dldir=$destdir/`dirname \$dlpath`~ +- test -d \$dldir || mkdir -p \$dldir~ +- $install_prog $dir/$dlname \$dldir/$dlname~ +- chmod a+x \$dldir/$dlname' +- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ +- dlpath=$dir/\$dldll~ +- $rm \$dlpath' +- shlibpath_overrides_runpath=yes + +- case $host_os in +- cygwin*) +- # Cygwin DLLs use 'cyg' prefix rather than 'lib' +- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +- ;; +- mingw*) +- # MinGW DLLs use traditional 'lib' prefix +- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` +- if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then +- # It is most probably a Windows format PATH printed by +- # mingw gcc, but we are running on Cygwin. Gcc prints its search +- # path with ; separators, and with drive letters. We can handle the +- # drive letters (cygwin fileutils understands them), so leave them, +- # especially as we might pass files found there to a mingw objdump, +- # which wouldn't understand a cygwinified path. Ahh. +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` +- else +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` +- fi +- ;; +- pw32*) +- # pw32 DLLs use 'pw' prefix rather than 'lib' +- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- ;; +- esac +- ;; ++# _LT_CMD_OLD_ARCHIVE ++# ------------------- ++m4_defun([_LT_CMD_OLD_ARCHIVE], ++[AC_CHECK_TOOL(AR, ar, false) ++test -z "$AR" && AR=ar ++test -z "$AR_FLAGS" && AR_FLAGS=cru ++_LT_DECL([], [AR], [1], [The archiver]) ++_LT_DECL([], [AR_FLAGS], [1]) ++ ++AC_CHECK_TOOL(STRIP, strip, :) ++test -z "$STRIP" && STRIP=: ++_LT_DECL([], [STRIP], [1], [A symbol stripping program]) ++ ++AC_CHECK_TOOL(RANLIB, ranlib, :) ++test -z "$RANLIB" && RANLIB=: ++_LT_DECL([], [RANLIB], [1], ++ [Commands used to install an old-style archive]) ++ ++# Determine commands to create old-style static archives. ++old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' ++old_postinstall_cmds='chmod 644 $oldlib' ++old_postuninstall_cmds= + ++if test -n "$RANLIB"; then ++ case $host_os in ++ openbsd*) ++ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ++ ;; + *) +- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ++ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac +- dynamic_linker='Win32 ld.exe' +- # FIXME: first we should search . and the directory the executable is in +- shlibpath_var=PATH +- ;; ++ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" ++fi ++_LT_DECL([], [old_postinstall_cmds], [2]) ++_LT_DECL([], [old_postuninstall_cmds], [2]) ++_LT_TAGDECL([], [old_archive_cmds], [2], ++ [Commands used to build an old-style archive]) ++])# _LT_CMD_OLD_ARCHIVE + +-darwin* | rhapsody*) +- dynamic_linker="$host_os dyld" +- version_type=darwin +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' +- soname_spec='${libname}${release}${major}$shared_ext' +- shlibpath_overrides_runpath=yes +- shlibpath_var=DYLD_LIBRARY_PATH +- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. +- if test "$GCC" = yes; then +- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` +- else +- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' +- fi +- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' +- ;; + +-dgux*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- ;; ++# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, ++# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) ++# ---------------------------------------------------------------- ++# Check whether the given compiler option works ++AC_DEFUN([_LT_COMPILER_OPTION], ++[m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++m4_require([_LT_DECL_SED])dnl ++AC_CACHE_CHECK([$1], [$2], ++ [$2=no ++ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) ++ echo "$lt_simple_compile_test_code" > conftest.$ac_ext ++ lt_compiler_flag="$3" ++ # Insert the option either (1) after the last *FLAGS variable, or ++ # (2) before a word containing "conftest.", or (3) at the end. ++ # Note that $ac_compile itself does not contain backslashes and begins ++ # with a dollar sign (not a hyphen), so the echo should work correctly. ++ # The option is referenced via a variable to avoid confusing sed. ++ lt_compile=`echo "$ac_compile" | $SED \ ++ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ ++ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ ++ -e 's:$: $lt_compiler_flag:'` ++ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) ++ (eval "$lt_compile" 2>conftest.err) ++ ac_status=$? ++ cat conftest.err >&AS_MESSAGE_LOG_FD ++ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD ++ if (exit $ac_status) && test -s "$ac_outfile"; then ++ # The compiler can only warn and ignore the option if not recognized ++ # So say no if there are warnings other than the usual output. ++ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp ++ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 ++ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then ++ $2=yes ++ fi ++ fi ++ $RM conftest* ++]) + +-freebsd1*) +- dynamic_linker=no +- ;; ++if test x"[$]$2" = xyes; then ++ m4_if([$5], , :, [$5]) ++else ++ m4_if([$6], , :, [$6]) ++fi ++])# _LT_COMPILER_OPTION + +-kfreebsd*-gnu) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- dynamic_linker='GNU ld.so' +- ;; ++# Old name: ++AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + +-freebsd* | dragonfly*) +- # DragonFly does not have aout. When/if they implement a new +- # versioning mechanism, adjust this. +- if test -x /usr/bin/objformat; then +- objformat=`/usr/bin/objformat` +- else +- case $host_os in +- freebsd[[123]]*) objformat=aout ;; +- *) objformat=elf ;; +- esac +- fi +- version_type=freebsd-$objformat +- case $version_type in +- freebsd-elf*) +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' +- need_version=no +- need_lib_prefix=no +- ;; +- freebsd-*) +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' +- need_version=yes +- ;; +- esac +- shlibpath_var=LD_LIBRARY_PATH +- case $host_os in +- freebsd2*) +- shlibpath_overrides_runpath=yes +- ;; +- freebsd3.[[01]]* | freebsdelf3.[[01]]*) +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes ++ ++# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, ++# [ACTION-SUCCESS], [ACTION-FAILURE]) ++# ---------------------------------------------------- ++# Check whether the given linker option works ++AC_DEFUN([_LT_LINKER_OPTION], ++[m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++m4_require([_LT_DECL_SED])dnl ++AC_CACHE_CHECK([$1], [$2], ++ [$2=no ++ save_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS $3" ++ echo "$lt_simple_link_test_code" > conftest.$ac_ext ++ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then ++ # The linker can only warn and ignore the option if not recognized ++ # So say no if there are warnings ++ if test -s conftest.err; then ++ # Append any errors to the config.log. ++ cat conftest.err 1>&AS_MESSAGE_LOG_FD ++ $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp ++ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 ++ if diff conftest.exp conftest.er2 >/dev/null; then ++ $2=yes ++ fi ++ else ++ $2=yes ++ fi ++ fi ++ $RM -r conftest* ++ LDFLAGS="$save_LDFLAGS" ++]) ++ ++if test x"[$]$2" = xyes; then ++ m4_if([$4], , :, [$4]) ++else ++ m4_if([$5], , :, [$5]) ++fi ++])# _LT_LINKER_OPTION ++ ++# Old name: ++AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) ++ ++ ++# LT_CMD_MAX_LEN ++#--------------- ++AC_DEFUN([LT_CMD_MAX_LEN], ++[AC_REQUIRE([AC_CANONICAL_HOST])dnl ++# find the maximum length of command line arguments ++AC_MSG_CHECKING([the maximum length of command line arguments]) ++AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl ++ i=0 ++ teststring="ABCD" ++ ++ case $build_os in ++ msdosdjgpp*) ++ # On DJGPP, this test can blow up pretty badly due to problems in libc ++ # (any single argument exceeding 2000 bytes causes a buffer overrun ++ # during glob expansion). Even if it were fixed, the result of this ++ # check would be larger than it should be. ++ lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; +- freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ +- freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes ++ ++ gnu*) ++ # Under GNU Hurd, this test is not required because there is ++ # no limit to the length of command line arguments. ++ # Libtool will interpret -1 as no limit whatsoever ++ lt_cv_sys_max_cmd_len=-1; + ;; +- freebsd*) # from 4.6 on +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes ++ ++ cygwin* | mingw*) ++ # On Win9x/ME, this test blows up -- it succeeds, but takes ++ # about 5 minutes as the teststring grows exponentially. ++ # Worse, since 9x/ME are not pre-emptively multitasking, ++ # you end up with a "frozen" computer, even though with patience ++ # the test eventually succeeds (with a max line length of 256k). ++ # Instead, let's just punt: use the minimum linelength reported by ++ # all of the supported platforms: 8192 (on NT/2K/XP). ++ lt_cv_sys_max_cmd_len=8192; + ;; +- esac +- ;; + +-gnu*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- hardcode_into_libs=yes +- ;; ++ amigaos*) ++ # On AmigaOS with pdksh, this test takes hours, literally. ++ # So we just punt and use a minimum line length of 8192. ++ lt_cv_sys_max_cmd_len=8192; ++ ;; + +-hpux9* | hpux10* | hpux11*) +- # Give a soname corresponding to the major version so that dld.sl refuses to +- # link against other versions. +- version_type=sunos +- need_lib_prefix=no +- need_version=no +- case $host_cpu in +- ia64*) +- shrext_cmds='.so' +- hardcode_into_libs=yes +- dynamic_linker="$host_os dld.so" +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- if test "X$HPUX_IA64_MODE" = X32; then +- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" ++ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) ++ # This has been around since 386BSD, at least. Likely further. ++ if test -x /sbin/sysctl; then ++ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` ++ elif test -x /usr/sbin/sysctl; then ++ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else +- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" ++ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi +- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec +- ;; +- hppa*64*) +- shrext_cmds='.sl' +- hardcode_into_libs=yes +- dynamic_linker="$host_os dld.sl" +- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH +- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" +- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec +- ;; +- *) +- shrext_cmds='.sl' +- dynamic_linker="$host_os dld.sl" +- shlibpath_var=SHLIB_PATH +- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ # And add a safety zone ++ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` ++ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; +- esac +- # HP-UX runs *really* slowly unless shared libraries are mode 555. +- postinstall_cmds='chmod 555 $lib' +- ;; + +-interix3*) +- version_type=linux +- need_lib_prefix=no +- 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' +- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- ;; ++ interix*) ++ # We know the value 262144 and hardcode it with a safety zone (like BSD) ++ lt_cv_sys_max_cmd_len=196608 ++ ;; + +-irix5* | irix6* | nonstopux*) +- case $host_os in +- nonstopux*) version_type=nonstopux ;; +- *) +- if test "$lt_cv_prog_gnu_ld" = yes; then +- version_type=linux +- else +- version_type=irix +- fi ;; +- esac +- need_lib_prefix=no +- need_version=no +- soname_spec='${libname}${release}${shared_ext}$major' +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' +- case $host_os in +- irix5* | nonstopux*) +- libsuff= shlibsuff= ++ osf*) ++ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure ++ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not ++ # nice to cause kernel panics so lets avoid the loop below. ++ # First set a reasonable default. ++ lt_cv_sys_max_cmd_len=16384 ++ # ++ if test -x /sbin/sysconfig; then ++ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in ++ *1*) lt_cv_sys_max_cmd_len=-1 ;; ++ esac ++ fi ++ ;; ++ sco3.2v5*) ++ lt_cv_sys_max_cmd_len=102400 ++ ;; ++ sysv5* | sco5v6* | sysv4.2uw2*) ++ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` ++ if test -n "$kargmax"; then ++ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` ++ else ++ lt_cv_sys_max_cmd_len=32768 ++ fi + ;; + *) +- case $LD in # libtool.m4 will add one of these switches to LD +- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") +- libsuff= shlibsuff= libmagic=32-bit;; +- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") +- libsuff=32 shlibsuff=N32 libmagic=N32;; +- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") +- libsuff=64 shlibsuff=64 libmagic=64-bit;; +- *) libsuff= shlibsuff= libmagic=never-match;; +- esac ++ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` ++ if test -n "$lt_cv_sys_max_cmd_len"; then ++ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` ++ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ++ else ++ # Make teststring a little bigger before we do anything with it. ++ # a 1K string should be a reasonable start. ++ for i in 1 2 3 4 5 6 7 8 ; do ++ teststring=$teststring$teststring ++ done ++ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} ++ # If test is not a shell built-in, we'll probably end up computing a ++ # maximum length that is only half of the actual maximum length, but ++ # we can't tell. ++ while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ ++ = "XX$teststring$teststring"; } >/dev/null 2>&1 && ++ test $i != 17 # 1/2 MB should be enough ++ do ++ i=`expr $i + 1` ++ teststring=$teststring$teststring ++ done ++ # Only check the string length outside the loop. ++ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` ++ teststring= ++ # Add a significant safety factor because C++ compilers can tack on ++ # massive amounts of additional arguments before passing them to the ++ # linker. It appears as though 1/2 is a usable value. ++ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ++ fi + ;; + esac +- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH +- shlibpath_overrides_runpath=no +- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" +- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" +- hardcode_into_libs=yes +- ;; ++]) ++if test -n $lt_cv_sys_max_cmd_len ; then ++ AC_MSG_RESULT($lt_cv_sys_max_cmd_len) ++else ++ AC_MSG_RESULT(none) ++fi ++max_cmd_len=$lt_cv_sys_max_cmd_len ++_LT_DECL([], [max_cmd_len], [0], ++ [What is the maximum length of a command?]) ++])# LT_CMD_MAX_LEN + +-# No shared lib support for Linux oldld, aout, or coff. +-linux*oldld* | linux*aout* | linux*coff*) +- dynamic_linker=no +- ;; ++# Old name: ++AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + +-# This must be Linux ELF. +-linux*) +- version_type=linux +- need_lib_prefix=no +- 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' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- # This implies no fast_install, which is unacceptable. +- # Some rework will be needed to allow for fast_install +- # before this can be enabled. +- hardcode_into_libs=yes + +- # Append ld.so.conf contents to the search path +- if test -f /etc/ld.so.conf; then +- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" +- fi ++# _LT_HEADER_DLFCN ++# ---------------- ++m4_defun([_LT_HEADER_DLFCN], ++[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ++])# _LT_HEADER_DLFCN + +- # We used to test for /lib/ld.so.1 and disable shared libraries on +- # powerpc, because MkLinux only supported shared libraries with the +- # GNU dynamic linker. Since this was broken with cross compilers, +- # most powerpc-linux boxes support dynamic linking these days and +- # people can always --disable-shared, the test was removed, and we +- # assume the GNU/Linux dynamic linker is in use. +- dynamic_linker='GNU/Linux ld.so' +- ;; + +-knetbsd*-gnu) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- dynamic_linker='GNU ld.so' +- ;; ++# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, ++# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) ++# ---------------------------------------------------------------- ++m4_defun([_LT_TRY_DLOPEN_SELF], ++[m4_require([_LT_HEADER_DLFCN])dnl ++if test "$cross_compiling" = yes; then : ++ [$4] ++else ++ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 ++ lt_status=$lt_dlunknown ++ cat > conftest.$ac_ext <<_LT_EOF ++[#line __oline__ "configure" ++#include "confdefs.h" + +-netbsd*) +- version_type=sunos +- need_lib_prefix=no +- need_version=no +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' +- dynamic_linker='NetBSD (a.out) ld.so' +- else +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- dynamic_linker='NetBSD ld.elf_so' +- fi +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- ;; ++#if HAVE_DLFCN_H ++#include ++#endif + +-newsos6) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- ;; ++#include + +-nto-qnx*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- ;; ++#ifdef RTLD_GLOBAL ++# define LT_DLGLOBAL RTLD_GLOBAL ++#else ++# ifdef DL_GLOBAL ++# define LT_DLGLOBAL DL_GLOBAL ++# else ++# define LT_DLGLOBAL 0 ++# endif ++#endif + +-openbsd*) +- version_type=sunos +- sys_lib_dlsearch_path_spec="/usr/lib" +- need_lib_prefix=no +- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. +- case $host_os in +- openbsd3.3 | openbsd3.3.*) need_version=yes ;; +- *) need_version=no ;; +- esac +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- case $host_os in +- openbsd2.[[89]] | openbsd2.[[89]].*) +- shlibpath_overrides_runpath=no +- ;; +- *) +- shlibpath_overrides_runpath=yes +- ;; +- esac ++/* We may have to define LT_DLLAZY_OR_NOW in the command line if we ++ find out it does not work in some platform. */ ++#ifndef LT_DLLAZY_OR_NOW ++# ifdef RTLD_LAZY ++# define LT_DLLAZY_OR_NOW RTLD_LAZY ++# else ++# ifdef DL_LAZY ++# define LT_DLLAZY_OR_NOW DL_LAZY ++# else ++# ifdef RTLD_NOW ++# define LT_DLLAZY_OR_NOW RTLD_NOW ++# else ++# ifdef DL_NOW ++# define LT_DLLAZY_OR_NOW DL_NOW ++# else ++# define LT_DLLAZY_OR_NOW 0 ++# endif ++# endif ++# endif ++# endif ++#endif ++ ++#ifdef __cplusplus ++extern "C" void exit (int); ++#endif ++ ++void fnord() { int i=42;} ++int main () ++{ ++ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); ++ int status = $lt_dlunknown; ++ ++ if (self) ++ { ++ if (dlsym (self,"fnord")) status = $lt_dlno_uscore; ++ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; ++ /* dlclose (self); */ ++ } + else +- shlibpath_overrides_runpath=yes ++ puts (dlerror ()); ++ ++ exit (status); ++}] ++_LT_EOF ++ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then ++ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null ++ lt_status=$? ++ case x$lt_status in ++ x$lt_dlno_uscore) $1 ;; ++ x$lt_dlneed_uscore) $2 ;; ++ x$lt_dlunknown|x*) $3 ;; ++ esac ++ else : ++ # compilation failed ++ $3 + fi +- ;; ++fi ++rm -fr conftest* ++])# _LT_TRY_DLOPEN_SELF + +-os2*) +- libname_spec='$name' +- shrext_cmds=".dll" +- need_lib_prefix=no +- library_names_spec='$libname${shared_ext} $libname.a' +- dynamic_linker='OS/2 ld.exe' +- shlibpath_var=LIBPATH +- ;; + +-osf3* | osf4* | osf5*) +- version_type=osf +- need_lib_prefix=no +- need_version=no +- soname_spec='${libname}${release}${shared_ext}$major' +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" +- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" +- ;; ++# LT_SYS_DLOPEN_SELF ++# ------------------ ++AC_DEFUN([LT_SYS_DLOPEN_SELF], ++[m4_require([_LT_HEADER_DLFCN])dnl ++if test "x$enable_dlopen" != xyes; then ++ enable_dlopen=unknown ++ enable_dlopen_self=unknown ++ enable_dlopen_self_static=unknown ++else ++ lt_cv_dlopen=no ++ lt_cv_dlopen_libs= + +-solaris*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- # ldd complains unless libraries are executable +- postinstall_cmds='chmod +x $lib' +- ;; ++ case $host_os in ++ beos*) ++ lt_cv_dlopen="load_add_on" ++ lt_cv_dlopen_libs= ++ lt_cv_dlopen_self=yes ++ ;; + +-sunos4*) +- version_type=sunos +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- if test "$with_gnu_ld" = yes; then +- need_lib_prefix=no +- fi +- need_version=yes +- ;; ++ mingw* | pw32*) ++ lt_cv_dlopen="LoadLibrary" ++ lt_cv_dlopen_libs= ++ ;; + +-sysv4 | sysv4.3*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- case $host_vendor in +- sni) +- shlibpath_overrides_runpath=no +- need_lib_prefix=no +- export_dynamic_flag_spec='${wl}-Blargedynsym' +- runpath_var=LD_RUN_PATH +- ;; +- siemens) +- need_lib_prefix=no +- ;; +- motorola) +- need_lib_prefix=no +- need_version=no +- shlibpath_overrides_runpath=no +- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' +- ;; +- esac +- ;; ++ cygwin*) ++ lt_cv_dlopen="dlopen" ++ lt_cv_dlopen_libs= ++ ;; + +-sysv4*MP*) +- if test -d /usr/nec ;then +- version_type=linux +- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' +- soname_spec='$libname${shared_ext}.$major' +- shlibpath_var=LD_LIBRARY_PATH +- fi +- ;; ++ darwin*) ++ # if libdl is installed we need to link against it ++ AC_CHECK_LIB([dl], [dlopen], ++ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ ++ lt_cv_dlopen="dyld" ++ lt_cv_dlopen_libs= ++ lt_cv_dlopen_self=yes ++ ]) ++ ;; + +-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) +- version_type=freebsd-elf +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- hardcode_into_libs=yes +- if test "$with_gnu_ld" = yes; then +- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' +- shlibpath_overrides_runpath=no ++ *) ++ AC_CHECK_FUNC([shl_load], ++ [lt_cv_dlopen="shl_load"], ++ [AC_CHECK_LIB([dld], [shl_load], ++ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], ++ [AC_CHECK_FUNC([dlopen], ++ [lt_cv_dlopen="dlopen"], ++ [AC_CHECK_LIB([dl], [dlopen], ++ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], ++ [AC_CHECK_LIB([svld], [dlopen], ++ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], ++ [AC_CHECK_LIB([dld], [dld_link], ++ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ++ ]) ++ ]) ++ ]) ++ ]) ++ ]) ++ ;; ++ esac ++ ++ if test "x$lt_cv_dlopen" != xno; then ++ enable_dlopen=yes + else +- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' +- shlibpath_overrides_runpath=yes +- case $host_os in +- sco3.2v5*) +- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" +- ;; +- esac ++ enable_dlopen=no + fi +- sys_lib_dlsearch_path_spec='/usr/lib' +- ;; +- +-uts4*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- ;; +- +-*) +- dynamic_linker=no +- ;; +-esac +-AC_MSG_RESULT([$dynamic_linker]) +-test "$dynamic_linker" = no && can_build_shared=no +- +-variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +-if test "$GCC" = yes; then +- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +-fi +-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER +- + +-# _LT_AC_TAGCONFIG +-# ---------------- +-AC_DEFUN([_LT_AC_TAGCONFIG], +-[AC_ARG_WITH([tags], +- [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], +- [include additional configurations @<:@automatic@:>@])], +- [tagnames="$withval"]) +- +-if test -f "$ltmain" && test -n "$tagnames"; then +- if test ! -f "${ofile}"; then +- AC_MSG_WARN([output file `$ofile' does not exist]) +- fi ++ case $lt_cv_dlopen in ++ dlopen) ++ save_CPPFLAGS="$CPPFLAGS" ++ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + +- if test -z "$LTCC"; then +- eval "`$SHELL ${ofile} --config | grep '^LTCC='`" +- if test -z "$LTCC"; then +- AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) +- else +- AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) +- fi +- fi +- if test -z "$LTCFLAGS"; then +- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" +- fi ++ save_LDFLAGS="$LDFLAGS" ++ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + +- # Extract list of available tagged configurations in $ofile. +- # Note that this assumes the entire list is on one line. +- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` ++ save_LIBS="$LIBS" ++ LIBS="$lt_cv_dlopen_libs $LIBS" + +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for tagname in $tagnames; do +- IFS="$lt_save_ifs" +- # Check whether tagname contains only valid characters +- case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in +- "") ;; +- *) AC_MSG_ERROR([invalid tag name: $tagname]) +- ;; +- esac ++ AC_CACHE_CHECK([whether a program can dlopen itself], ++ lt_cv_dlopen_self, [dnl ++ _LT_TRY_DLOPEN_SELF( ++ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, ++ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ++ ]) + +- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null +- then +- AC_MSG_ERROR([tag name \"$tagname\" already exists]) ++ if test "x$lt_cv_dlopen_self" = xyes; then ++ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" ++ AC_CACHE_CHECK([whether a statically linked program can dlopen itself], ++ lt_cv_dlopen_self_static, [dnl ++ _LT_TRY_DLOPEN_SELF( ++ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, ++ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ++ ]) + fi + +- # Update the list of available tags. +- if test -n "$tagname"; then +- echo appending configuration tag \"$tagname\" to $ofile +- +- case $tagname in +- CXX) +- if test -n "$CXX" && ( test "X$CXX" != "Xno" && +- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || +- (test "X$CXX" != "Xg++"))) ; then +- AC_LIBTOOL_LANG_CXX_CONFIG +- else +- tagname="" +- fi +- ;; +- +- F77) +- if test -n "$F77" && test "X$F77" != "Xno"; then +- AC_LIBTOOL_LANG_F77_CONFIG +- else +- tagname="" +- fi +- ;; +- +- GCJ) +- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then +- AC_LIBTOOL_LANG_GCJ_CONFIG +- else +- tagname="" +- fi +- ;; +- +- RC) +- AC_LIBTOOL_LANG_RC_CONFIG +- ;; +- +- *) +- AC_MSG_ERROR([Unsupported tag name: $tagname]) +- ;; +- esac ++ CPPFLAGS="$save_CPPFLAGS" ++ LDFLAGS="$save_LDFLAGS" ++ LIBS="$save_LIBS" ++ ;; ++ esac + +- # Append the new tag name to the list of available tags. +- if test -n "$tagname" ; then +- available_tags="$available_tags $tagname" +- fi +- fi +- done +- IFS="$lt_save_ifs" ++ case $lt_cv_dlopen_self in ++ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; ++ *) enable_dlopen_self=unknown ;; ++ esac + +- # Now substitute the updated list of available tags. +- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then +- mv "${ofile}T" "$ofile" +- chmod +x "$ofile" +- else +- rm -f "${ofile}T" +- AC_MSG_ERROR([unable to update list of available tagged configurations.]) +- fi ++ case $lt_cv_dlopen_self_static in ++ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; ++ *) enable_dlopen_self_static=unknown ;; ++ esac + fi +-])# _LT_AC_TAGCONFIG ++_LT_DECL([dlopen_support], [enable_dlopen], [0], ++ [Whether dlopen is supported]) ++_LT_DECL([dlopen_self], [enable_dlopen_self], [0], ++ [Whether dlopen of programs is supported]) ++_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], ++ [Whether dlopen of statically linked programs is supported]) ++])# LT_SYS_DLOPEN_SELF ++ ++# Old name: ++AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +-# AC_LIBTOOL_DLOPEN +-# ----------------- +-# enable checks for dlopen support +-AC_DEFUN([AC_LIBTOOL_DLOPEN], +- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +-])# AC_LIBTOOL_DLOPEN ++# _LT_COMPILER_C_O([TAGNAME]) ++# --------------------------- ++# Check to see if options -c and -o are simultaneously supported by compiler. ++# This macro does not hard code the compiler like AC_PROG_CC_C_O. ++m4_defun([_LT_COMPILER_C_O], ++[m4_require([_LT_DECL_SED])dnl ++m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++m4_require([_LT_TAG_COMPILER])dnl ++AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], ++ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], ++ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no ++ $RM -r conftest 2>/dev/null ++ mkdir conftest ++ cd conftest ++ mkdir out ++ echo "$lt_simple_compile_test_code" > conftest.$ac_ext + ++ lt_compiler_flag="-o out/conftest2.$ac_objext" ++ # Insert the option either (1) after the last *FLAGS variable, or ++ # (2) before a word containing "conftest.", or (3) at the end. ++ # Note that $ac_compile itself does not contain backslashes and begins ++ # with a dollar sign (not a hyphen), so the echo should work correctly. ++ lt_compile=`echo "$ac_compile" | $SED \ ++ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ ++ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ ++ -e 's:$: $lt_compiler_flag:'` ++ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) ++ (eval "$lt_compile" 2>out/conftest.err) ++ ac_status=$? ++ cat out/conftest.err >&AS_MESSAGE_LOG_FD ++ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD ++ if (exit $ac_status) && test -s out/conftest2.$ac_objext ++ then ++ # The compiler can only warn and ignore the option if not recognized ++ # So say no if there are warnings ++ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp ++ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 ++ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then ++ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes ++ fi ++ fi ++ chmod u+w . 2>&AS_MESSAGE_LOG_FD ++ $RM conftest* ++ # SGI C++ compiler will create directory out/ii_files/ for ++ # template instantiation ++ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files ++ $RM out/* && rmdir out ++ cd .. ++ $RM -r conftest ++ $RM conftest* ++]) ++_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], ++ [Does compiler simultaneously support -c and -o options?]) ++])# _LT_COMPILER_C_O + +-# AC_LIBTOOL_WIN32_DLL +-# -------------------- +-# declare package support for building win32 DLLs +-AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +-])# AC_LIBTOOL_WIN32_DLL + ++# _LT_COMPILER_FILE_LOCKS([TAGNAME]) ++# ---------------------------------- ++# Check to see if we can do hard links to lock some files if needed ++m4_defun([_LT_COMPILER_FILE_LOCKS], ++[m4_require([_LT_ENABLE_LOCK])dnl ++m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++_LT_COMPILER_C_O([$1]) + +-# AC_ENABLE_SHARED([DEFAULT]) +-# --------------------------- +-# implement the --enable-shared flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_SHARED], +-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([shared], +- [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], +- [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_shared=yes ;; +- no) enable_shared=no ;; +- *) +- enable_shared=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_shared=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +-])# AC_ENABLE_SHARED +- +- +-# AC_DISABLE_SHARED +-# ----------------- +-# set the default shared flag to --disable-shared +-AC_DEFUN([AC_DISABLE_SHARED], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_SHARED(no) +-])# AC_DISABLE_SHARED +- +- +-# AC_ENABLE_STATIC([DEFAULT]) +-# --------------------------- +-# implement the --enable-static flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_STATIC], +-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([static], +- [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], +- [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_static=yes ;; +- no) enable_static=no ;; +- *) +- enable_static=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_static=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_static=]AC_ENABLE_STATIC_DEFAULT) +-])# AC_ENABLE_STATIC +- +- +-# AC_DISABLE_STATIC +-# ----------------- +-# set the default static flag to --disable-static +-AC_DEFUN([AC_DISABLE_STATIC], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_STATIC(no) +-])# AC_DISABLE_STATIC +- +- +-# AC_ENABLE_FAST_INSTALL([DEFAULT]) +-# --------------------------------- +-# implement the --enable-fast-install flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_FAST_INSTALL], +-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([fast-install], +- [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], +- [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_fast_install=yes ;; +- no) enable_fast_install=no ;; +- *) +- enable_fast_install=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_fast_install=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +-])# AC_ENABLE_FAST_INSTALL +- +- +-# AC_DISABLE_FAST_INSTALL +-# ----------------------- +-# set the default to --disable-fast-install +-AC_DEFUN([AC_DISABLE_FAST_INSTALL], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_FAST_INSTALL(no) +-])# AC_DISABLE_FAST_INSTALL +- +- +-# AC_LIBTOOL_PICMODE([MODE]) +-# -------------------------- +-# implement the --with-pic flag +-# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +-AC_DEFUN([AC_LIBTOOL_PICMODE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-pic_mode=ifelse($#,1,$1,default) +-])# AC_LIBTOOL_PICMODE +- +- +-# AC_PROG_EGREP +-# ------------- +-# This is predefined starting with Autoconf 2.54, so this conditional +-# definition can be removed once we require Autoconf 2.54 or later. +-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], +- [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 +- then ac_cv_prog_egrep='grep -E' +- else ac_cv_prog_egrep='egrep' +- fi]) +- EGREP=$ac_cv_prog_egrep +- AC_SUBST([EGREP]) +-])]) +- +- +-# AC_PATH_TOOL_PREFIX +-# ------------------- +-# find a file program which can recognise shared library +-AC_DEFUN([AC_PATH_TOOL_PREFIX], +-[AC_REQUIRE([AC_PROG_EGREP])dnl +-AC_MSG_CHECKING([for $1]) +-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +-[case $MAGIC_CMD in +-[[\\/*] | ?:[\\/]*]) +- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. +- ;; +-*) +- lt_save_MAGIC_CMD="$MAGIC_CMD" +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +-dnl $ac_dummy forces splitting on constant user-supplied paths. +-dnl POSIX.2 word splitting is done only on the output of word expansions, +-dnl not every word. This closes a longstanding sh security hole. +- ac_dummy="ifelse([$2], , $PATH, [$2])" +- for ac_dir in $ac_dummy; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$1; then +- lt_cv_path_MAGIC_CMD="$ac_dir/$1" +- if test -n "$file_magic_test_file"; then +- case $deplibs_check_method in +- "file_magic "*) +- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` +- MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | +- $EGREP "$file_magic_regex" > /dev/null; then +- : +- else +- cat <&2 ++hard_links="nottested" ++if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then ++ # do not overwrite the value of need_locks provided by the user ++ AC_MSG_CHECKING([if we can lock with hard links]) ++ hard_links=yes ++ $RM conftest* ++ ln conftest.a conftest.b 2>/dev/null && hard_links=no ++ touch conftest.a ++ ln conftest.a conftest.b 2>&5 || hard_links=no ++ ln conftest.a conftest.b 2>/dev/null && hard_links=no ++ AC_MSG_RESULT([$hard_links]) ++ if test "$hard_links" = no; then ++ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) ++ need_locks=warn ++ fi ++else ++ need_locks=no ++fi ++_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ++])# _LT_COMPILER_FILE_LOCKS + +-*** Warning: the command libtool uses to detect shared libraries, +-*** $file_magic_cmd, produces output that libtool cannot recognize. +-*** The result is that libtool may fail to recognize shared libraries +-*** as such. This will affect the creation of libtool libraries that +-*** depend on shared libraries, but programs linked with such libtool +-*** libraries will work regardless of this problem. Nevertheless, you +-*** may want to report the problem to your system manager and/or to +-*** bug-libtool@gnu.org + +-EOF +- fi ;; +- esac +- fi +- break +- fi +- done +- IFS="$lt_save_ifs" +- MAGIC_CMD="$lt_save_MAGIC_CMD" +- ;; +-esac]) +-MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +-if test -n "$MAGIC_CMD"; then +- AC_MSG_RESULT($MAGIC_CMD) ++# _LT_CHECK_OBJDIR ++# ---------------- ++m4_defun([_LT_CHECK_OBJDIR], ++[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], ++[rm -f .libs 2>/dev/null ++mkdir .libs 2>/dev/null ++if test -d .libs; then ++ lt_cv_objdir=.libs + else +- AC_MSG_RESULT(no) ++ # MS-DOS does not allow filenames that begin with a dot. ++ lt_cv_objdir=_libs + fi +-])# AC_PATH_TOOL_PREFIX ++rmdir .libs 2>/dev/null]) ++objdir=$lt_cv_objdir ++_LT_DECL([], [objdir], [0], ++ [The name of the directory that contains temporary libtool files])dnl ++m4_pattern_allow([LT_OBJDIR])dnl ++AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", ++ [Define to the sub-directory in which libtool stores uninstalled libraries.]) ++])# _LT_CHECK_OBJDIR + + +-# AC_PATH_MAGIC +-# ------------- +-# find a file program which can recognise a shared library +-AC_DEFUN([AC_PATH_MAGIC], +-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +-if test -z "$lt_cv_path_MAGIC_CMD"; then +- if test -n "$ac_tool_prefix"; then +- AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) ++# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) ++# -------------------------------------- ++# Check hardcoding attributes. ++m4_defun([_LT_LINKER_HARDCODE_LIBPATH], ++[AC_MSG_CHECKING([how to hardcode library paths into programs]) ++_LT_TAGVAR(hardcode_action, $1)= ++if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || ++ test -n "$_LT_TAGVAR(runpath_var, $1)" || ++ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then ++ ++ # We can hardcode non-existent directories. ++ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && ++ # If the only mechanism to avoid hardcoding is shlibpath_var, we ++ # have to relink, otherwise we might link with an installed library ++ # when we should be linking with a yet-to-be-installed one ++ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && ++ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then ++ # Linking always hardcodes the temporary library directory. ++ _LT_TAGVAR(hardcode_action, $1)=relink + else +- MAGIC_CMD=: ++ # We can link without hardcoding, and we can hardcode nonexisting dirs. ++ _LT_TAGVAR(hardcode_action, $1)=immediate + fi ++else ++ # We cannot hardcode anything, or else we can only hardcode existing ++ # directories. ++ _LT_TAGVAR(hardcode_action, $1)=unsupported ++fi ++AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) ++ ++if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || ++ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then ++ # Fast installation is not supported ++ enable_fast_install=no ++elif test "$shlibpath_overrides_runpath" = yes || ++ test "$enable_shared" = no; then ++ # Fast installation is not necessary ++ enable_fast_install=needless + fi +-])# AC_PATH_MAGIC ++_LT_TAGDECL([], [hardcode_action], [0], ++ [How to hardcode a shared library path into an executable]) ++])# _LT_LINKER_HARDCODE_LIBPATH + + +-# AC_PROG_LD +-# ---------- +-# find the pathname to the GNU or non-GNU linker +-AC_DEFUN([AC_PROG_LD], +-[AC_ARG_WITH([gnu-ld], +- [AC_HELP_STRING([--with-gnu-ld], +- [assume the C compiler uses GNU ld @<:@default=no@:>@])], +- [test "$withval" = no || with_gnu_ld=yes], +- [with_gnu_ld=no]) +-AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_REQUIRE([AC_PROG_CC])dnl +-AC_REQUIRE([AC_CANONICAL_HOST])dnl +-AC_REQUIRE([AC_CANONICAL_BUILD])dnl +-ac_prog=ld +-if test "$GCC" = yes; then +- # Check if gcc -print-prog-name=ld gives a path. +- AC_MSG_CHECKING([for ld used by $CC]) +- case $host in +- *-*-mingw*) +- # gcc leaves a trailing carriage return which upsets mingw +- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; +- *) +- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; +- esac +- case $ac_prog in +- # Accept absolute paths. +- [[\\/]]* | ?:[[\\/]]*) +- re_direlt='/[[^/]][[^/]]*/\.\./' +- # Canonicalize the pathname of ld +- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` +- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do +- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` +- done +- test -z "$LD" && LD="$ac_prog" +- ;; +- "") +- # If it fails, then pretend we aren't using GCC. +- ac_prog=ld ++# _LT_CMD_STRIPLIB ++# ---------------- ++m4_defun([_LT_CMD_STRIPLIB], ++[m4_require([_LT_DECL_EGREP]) ++striplib= ++old_striplib= ++AC_MSG_CHECKING([whether stripping libraries is possible]) ++if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then ++ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" ++ test -z "$striplib" && striplib="$STRIP --strip-unneeded" ++ AC_MSG_RESULT([yes]) ++else ++# FIXME - insert some real tests, host_os isn't really good enough ++ case $host_os in ++ darwin*) ++ if test -n "$STRIP" ; then ++ striplib="$STRIP -x" ++ old_striplib="$STRIP -S" ++ AC_MSG_RESULT([yes]) ++ else ++ AC_MSG_RESULT([no]) ++ fi + ;; + *) +- # If it is relative, then search for the first ld in PATH. +- with_gnu_ld=unknown ++ AC_MSG_RESULT([no]) + ;; + esac +-elif test "$with_gnu_ld" = yes; then +- AC_MSG_CHECKING([for GNU ld]) +-else +- AC_MSG_CHECKING([for non-GNU ld]) + fi +-AC_CACHE_VAL(lt_cv_path_LD, +-[if test -z "$LD"; then +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for ac_dir in $PATH; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then +- lt_cv_path_LD="$ac_dir/$ac_prog" +- # Check to see if the program is GNU ld. I'd rather use --version, +- # but apparently some variants of GNU ld only accept -v. +- # Break only if it was the GNU/non-GNU ld that we prefer. +- case `"$lt_cv_path_LD" -v 2>&1 /dev/null ; then ++ # if the path contains ";" then we assume it to be the separator ++ # otherwise default to the standard path separator (i.e. ":") - it is ++ # assumed that no part of a normal pathname contains ";" but that should ++ # okay in the real world where ";" in dirpaths is itself problematic. ++ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` ++ else ++ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ fi ++ # Ok, now we have the path, separated by spaces, we can step through it ++ # and add multilib dir if necessary. ++ lt_tmp_lt_search_path_spec= ++ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` ++ for lt_sys_path in $lt_search_path_spec; do ++ if test -d "$lt_sys_path/$lt_multi_os_dir"; then ++ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" ++ else ++ test -d "$lt_sys_path" && \ ++ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done +- IFS="$lt_save_ifs" ++ lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' ++BEGIN {RS=" "; FS="/|\n";} { ++ lt_foo=""; ++ lt_count=0; ++ for (lt_i = NF; lt_i > 0; lt_i--) { ++ if ($lt_i != "" && $lt_i != ".") { ++ if ($lt_i == "..") { ++ lt_count++; ++ } else { ++ if (lt_count == 0) { ++ lt_foo="/" $lt_i lt_foo; ++ } else { ++ lt_count--; ++ } ++ } ++ } ++ } ++ if (lt_foo != "") { lt_freq[[lt_foo]]++; } ++ if (lt_freq[[lt_foo]] == 1) { print lt_foo; } ++}'` ++ sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + else +- lt_cv_path_LD="$LD" # Let the user override the test with a path. ++ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + fi]) +-LD="$lt_cv_path_LD" +-if test -n "$LD"; then +- AC_MSG_RESULT($LD) +-else +- AC_MSG_RESULT(no) +-fi +-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +-AC_PROG_LD_GNU +-])# AC_PROG_LD ++library_names_spec= ++libname_spec='lib$name' ++soname_spec= ++shrext_cmds=".so" ++postinstall_cmds= ++postuninstall_cmds= ++finish_cmds= ++finish_eval= ++shlibpath_var= ++shlibpath_overrides_runpath=unknown ++version_type=none ++dynamic_linker="$host_os ld.so" ++sys_lib_dlsearch_path_spec="/lib /usr/lib" ++need_lib_prefix=unknown ++hardcode_into_libs=no ++ ++# when you set need_version to no, make sure it does not cause -set_version ++# flags to be left without arguments ++need_version=unknown + ++case $host_os in ++aix3*) ++ version_type=linux ++ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' ++ shlibpath_var=LIBPATH + +-# AC_PROG_LD_GNU +-# -------------- +-AC_DEFUN([AC_PROG_LD_GNU], +-[AC_REQUIRE([AC_PROG_EGREP])dnl +-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, +-[# I'd rather use --version here, but apparently some GNU lds only accept -v. +-case `$LD -v 2>&1 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' ++ echo ' yes ' ++ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then ++ : ++ else ++ can_build_shared=no ++ fi ++ ;; ++ esac ++ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct ++ # soname into executable. Probably we can add versioning support to ++ # collect2, so additional links can be useful in future. ++ if test "$aix_use_runtimelinking" = yes; then ++ # If using run time linking (on AIX 4.2 or later) use lib.so ++ # instead of lib.a to let people know that these are not ++ # typical AIX shared libraries. ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else +- reload_cmds='$LD$reload_flag -o $output$reload_objs' ++ # We preserve .a as extension for shared libraries through AIX4.2 ++ # and later when we are not doing run time linking. ++ library_names_spec='${libname}${release}.a $libname.a' ++ soname_spec='${libname}${release}${shared_ext}$major' + fi +- ;; +-esac +-])# AC_PROG_LD_RELOAD_FLAG +- +- +-# AC_DEPLIBS_CHECK_METHOD +-# ----------------------- +-# how to check for library dependencies +-# -- PORTME fill in with the dynamic library characteristics +-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], +-[AC_CACHE_CHECK([how to recognise dependent libraries], +-lt_cv_deplibs_check_method, +-[lt_cv_file_magic_cmd='$MAGIC_CMD' +-lt_cv_file_magic_test_file= +-lt_cv_deplibs_check_method='unknown' +-# Need to set the preceding variable on all platforms that support +-# interlibrary dependencies. +-# 'none' -- dependencies not supported. +-# `unknown' -- same as none, but documents that we really don't know. +-# 'pass_all' -- all dependencies passed with no checks. +-# 'test_compile' -- check by making test program. +-# 'file_magic [[regex]]' -- check by looking for files in library path +-# which responds to the $file_magic_cmd with a given extended regex. +-# If you have `file' or equivalent on your system and you're not sure +-# whether `pass_all' will *always* work, you probably want this one. ++ shlibpath_var=LIBPATH ++ fi ++ ;; + +-case $host_os in +-aix4* | aix5*) +- lt_cv_deplibs_check_method=pass_all ++amigaos*) ++ case $host_cpu in ++ powerpc) ++ # Since July 2007 AmigaOS4 officially supports .so libraries. ++ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ ;; ++ m68k) ++ library_names_spec='$libname.ixlibrary $libname.a' ++ # Create ${libname}_ixlibrary.a entries in /sys/libs. ++ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ++ ;; ++ esac + ;; + + beos*) +- lt_cv_deplibs_check_method=pass_all ++ library_names_spec='${libname}${shared_ext}' ++ dynamic_linker="$host_os ld.so" ++ shlibpath_var=LIBRARY_PATH + ;; + + bsdi[[45]]*) +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' +- lt_cv_file_magic_cmd='/usr/bin/file -L' +- lt_cv_file_magic_test_file=/shlib/libc.so +- ;; +- +-cygwin*) +- # func_win32_libid is a shell function defined in ltmain.sh +- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' +- lt_cv_file_magic_cmd='func_win32_libid' ++ version_type=linux ++ 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' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" ++ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" ++ # the default ld.so.conf also contains /usr/contrib/lib and ++ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow ++ # libtool to hard-code these into programs + ;; + +-mingw* | pw32*) +- # Base MSYS/MinGW do not provide the 'file' command needed by +- # func_win32_libid shell function, so use a weaker test based on 'objdump'. +- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' +- lt_cv_file_magic_cmd='$OBJDUMP -f' +- ;; ++cygwin* | mingw* | pw32*) ++ version_type=windows ++ shrext_cmds=".dll" ++ need_version=no ++ need_lib_prefix=no + +-darwin* | rhapsody*) +- lt_cv_deplibs_check_method=pass_all +- ;; ++ case $GCC,$host_os in ++ yes,cygwin* | yes,mingw* | yes,pw32*) ++ library_names_spec='$libname.dll.a' ++ # DLL is installed to $(libdir)/../bin by postinstall_cmds ++ postinstall_cmds='base_file=`basename \${file}`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ ++ dldir=$destdir/`dirname \$dlpath`~ ++ test -d \$dldir || mkdir -p \$dldir~ ++ $install_prog $dir/$dlname \$dldir/$dlname~ ++ chmod a+x \$dldir/$dlname~ ++ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then ++ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; ++ fi' ++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ ++ dlpath=$dir/\$dldll~ ++ $RM \$dlpath' ++ shlibpath_overrides_runpath=yes + +-freebsd* | kfreebsd*-gnu | dragonfly*) +- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then +- case $host_cpu in +- i*86 ) +- # Not sure whether the presence of OpenBSD here was a mistake. +- # Let's accept both of them until this is cleared up. +- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' +- lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ++ case $host_os in ++ cygwin*) ++ # Cygwin DLLs use 'cyg' prefix rather than 'lib' ++ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ++ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ++ ;; ++ mingw*) ++ # MinGW DLLs use traditional 'lib' prefix ++ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ++ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` ++ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then ++ # It is most probably a Windows format PATH printed by ++ # mingw gcc, but we are running on Cygwin. Gcc prints its search ++ # path with ; separators, and with drive letters. We can handle the ++ # drive letters (cygwin fileutils understands them), so leave them, ++ # especially as we might pass files found there to a mingw objdump, ++ # which wouldn't understand a cygwinified path. Ahh. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` ++ else ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ fi ++ ;; ++ pw32*) ++ # pw32 DLLs use 'pw' prefix rather than 'lib' ++ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac +- else +- lt_cv_deplibs_check_method=pass_all +- fi +- ;; +- +-gnu*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-hpux10.20* | hpux11*) +- lt_cv_file_magic_cmd=/usr/bin/file +- case $host_cpu in +- ia64*) +- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' +- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so +- ;; +- hppa*64*) +- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] +- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; ++ + *) +- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' +- lt_cv_file_magic_test_file=/usr/lib/libc.sl ++ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac ++ dynamic_linker='Win32 ld.exe' ++ # FIXME: first we should search . and the directory the executable is in ++ shlibpath_var=PATH + ;; + +-interix3*) +- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' +- ;; +- +-irix5* | irix6* | nonstopux*) +- case $LD in +- *-32|*"-32 ") libmagic=32-bit;; +- *-n32|*"-n32 ") libmagic=N32;; +- *-64|*"-64 ") libmagic=64-bit;; +- *) libmagic=never-match;; +- esac +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-# This must be Linux ELF. +-linux*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-netbsd*) +- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' +- else +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' +- fi ++darwin* | rhapsody*) ++ dynamic_linker="$host_os dyld" ++ version_type=darwin ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' ++ soname_spec='${libname}${release}${major}$shared_ext' ++ shlibpath_overrides_runpath=yes ++ shlibpath_var=DYLD_LIBRARY_PATH ++ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' ++m4_if([$1], [],[ ++ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) ++ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +-newos6*) +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' +- lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=/usr/lib/libnls.so ++dgux*) ++ version_type=linux ++ need_lib_prefix=no ++ 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' ++ shlibpath_var=LD_LIBRARY_PATH + ;; + +-nto-qnx*) +- lt_cv_deplibs_check_method=unknown ++freebsd1*) ++ dynamic_linker=no + ;; + +-openbsd*) +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' ++freebsd* | dragonfly*) ++ # DragonFly does not have aout. When/if they implement a new ++ # versioning mechanism, adjust this. ++ if test -x /usr/bin/objformat; then ++ objformat=`/usr/bin/objformat` + else +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' ++ case $host_os in ++ freebsd[[123]]*) objformat=aout ;; ++ *) objformat=elf ;; ++ esac + fi +- ;; +- +-osf3* | osf4* | osf5*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-solaris*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-sysv4 | sysv4.3*) +- case $host_vendor in +- motorola) +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' +- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` +- ;; +- ncr) +- lt_cv_deplibs_check_method=pass_all +- ;; +- sequent) +- lt_cv_file_magic_cmd='/bin/file' +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ++ version_type=freebsd-$objformat ++ case $version_type in ++ freebsd-elf*) ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' ++ need_version=no ++ need_lib_prefix=no ++ ;; ++ freebsd-*) ++ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' ++ need_version=yes ++ ;; ++ esac ++ shlibpath_var=LD_LIBRARY_PATH ++ case $host_os in ++ freebsd2*) ++ shlibpath_overrides_runpath=yes + ;; +- sni) +- lt_cv_file_magic_cmd='/bin/file' +- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" +- lt_cv_file_magic_test_file=/lib/libc.so ++ freebsd3.[[01]]* | freebsdelf3.[[01]]*) ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes + ;; +- siemens) +- lt_cv_deplibs_check_method=pass_all ++ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ ++ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) ++ shlibpath_overrides_runpath=no ++ hardcode_into_libs=yes + ;; +- pc) +- lt_cv_deplibs_check_method=pass_all ++ *) # from 4.6 on, and DragonFly ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes + ;; + esac + ;; + +-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) +- lt_cv_deplibs_check_method=pass_all ++gnu*) ++ version_type=linux ++ need_lib_prefix=no ++ 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' ++ shlibpath_var=LD_LIBRARY_PATH ++ hardcode_into_libs=yes + ;; +-esac +-]) +-file_magic_cmd=$lt_cv_file_magic_cmd +-deplibs_check_method=$lt_cv_deplibs_check_method +-test -z "$deplibs_check_method" && deplibs_check_method=unknown +-])# AC_DEPLIBS_CHECK_METHOD + +- +-# AC_PROG_NM +-# ---------- +-# find the pathname to a BSD-compatible name lister +-AC_DEFUN([AC_PROG_NM], +-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +-[if test -n "$NM"; then +- # Let the user override the test. +- lt_cv_path_NM="$NM" +-else +- lt_nm_to_check="${ac_tool_prefix}nm" +- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then +- lt_nm_to_check="$lt_nm_to_check nm" +- fi +- for lt_tmp_nm in $lt_nm_to_check; do +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- tmp_nm="$ac_dir/$lt_tmp_nm" +- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then +- # Check to see if the nm accepts a BSD-compat flag. +- # Adding the `sed 1q' prevents false positives on HP-UX, which says: +- # nm: unknown option "B" ignored +- # Tru64's nm complains that /dev/null is an invalid object file +- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in +- */dev/null* | *'Invalid file or object type'*) +- lt_cv_path_NM="$tmp_nm -B" +- break +- ;; +- *) +- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in +- */dev/null*) +- lt_cv_path_NM="$tmp_nm -p" +- break +- ;; +- *) +- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but +- continue # so that we can try to find one that supports BSD flags +- ;; +- esac +- ;; +- esac +- fi +- done +- IFS="$lt_save_ifs" +- done +- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +-fi]) +-NM="$lt_cv_path_NM" +-])# AC_PROG_NM +- +- +-# AC_CHECK_LIBM +-# ------------- +-# check for math library +-AC_DEFUN([AC_CHECK_LIBM], +-[AC_REQUIRE([AC_CANONICAL_HOST])dnl +-LIBM= +-case $host in +-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) +- # These system don't have libm, or don't need it +- ;; +-*-ncr-sysv4.3*) +- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") +- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") +- ;; +-*) +- AC_CHECK_LIB(m, cos, LIBM="-lm") ++hpux9* | hpux10* | hpux11*) ++ # Give a soname corresponding to the major version so that dld.sl refuses to ++ # link against other versions. ++ version_type=sunos ++ need_lib_prefix=no ++ need_version=no ++ case $host_cpu in ++ ia64*) ++ shrext_cmds='.so' ++ hardcode_into_libs=yes ++ dynamic_linker="$host_os dld.so" ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}$major' ++ if test "X$HPUX_IA64_MODE" = X32; then ++ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" ++ else ++ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" ++ fi ++ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ++ ;; ++ hppa*64*) ++ shrext_cmds='.sl' ++ hardcode_into_libs=yes ++ dynamic_linker="$host_os dld.sl" ++ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH ++ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}$major' ++ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" ++ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ++ ;; ++ *) ++ shrext_cmds='.sl' ++ dynamic_linker="$host_os dld.sl" ++ shlibpath_var=SHLIB_PATH ++ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}$major' ++ ;; ++ esac ++ # HP-UX runs *really* slowly unless shared libraries are mode 555. ++ postinstall_cmds='chmod 555 $lib' + ;; +-esac +-])# AC_CHECK_LIBM + ++interix[[3-9]]*) ++ version_type=linux ++ need_lib_prefix=no ++ 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' ++ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ hardcode_into_libs=yes ++ ;; + +-# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +-# ----------------------------------- +-# sets LIBLTDL to the link flags for the libltdl convenience library and +-# LTDLINCL to the include flags for the libltdl header and adds +-# --enable-ltdl-convenience to the configure arguments. Note that +-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +-# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +-# (note the single quotes!). If your package is not flat and you're not +-# using automake, define top_builddir and top_srcdir appropriately in +-# the Makefiles. +-AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +- case $enable_ltdl_convenience in +- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; +- "") enable_ltdl_convenience=yes +- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; ++irix5* | irix6* | nonstopux*) ++ case $host_os in ++ nonstopux*) version_type=nonstopux ;; ++ *) ++ if test "$lt_cv_prog_gnu_ld" = yes; then ++ version_type=linux ++ else ++ version_type=irix ++ fi ;; + esac +- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la +- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +- # For backwards non-gettext consistent compatibility... +- INCLTDL="$LTDLINCL" +-])# AC_LIBLTDL_CONVENIENCE +- +- +-# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +-# ----------------------------------- +-# sets LIBLTDL to the link flags for the libltdl installable library and +-# LTDLINCL to the include flags for the libltdl header and adds +-# --enable-ltdl-install to the configure arguments. Note that +-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +-# and an installed libltdl is not found, it is assumed to be `libltdl'. +-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +-# '${top_srcdir}/' (note the single quotes!). If your package is not +-# flat and you're not using automake, define top_builddir and top_srcdir +-# appropriately in the Makefiles. +-# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +-AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +- AC_CHECK_LIB(ltdl, lt_dlinit, +- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], +- [if test x"$enable_ltdl_install" = xno; then +- AC_MSG_WARN([libltdl not installed, but installation disabled]) +- else +- enable_ltdl_install=yes +- fi +- ]) +- if test x"$enable_ltdl_install" = x"yes"; then +- ac_configure_args="$ac_configure_args --enable-ltdl-install" +- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la +- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +- else +- ac_configure_args="$ac_configure_args --enable-ltdl-install=no" +- LIBLTDL="-lltdl" +- LTDLINCL= +- fi +- # For backwards non-gettext consistent compatibility... +- INCLTDL="$LTDLINCL" +-])# AC_LIBLTDL_INSTALLABLE ++ need_lib_prefix=no ++ need_version=no ++ soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' ++ case $host_os in ++ irix5* | nonstopux*) ++ libsuff= shlibsuff= ++ ;; ++ *) ++ case $LD in # libtool.m4 will add one of these switches to LD ++ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") ++ libsuff= shlibsuff= libmagic=32-bit;; ++ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") ++ libsuff=32 shlibsuff=N32 libmagic=N32;; ++ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") ++ libsuff=64 shlibsuff=64 libmagic=64-bit;; ++ *) libsuff= shlibsuff= libmagic=never-match;; ++ esac ++ ;; ++ esac ++ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH ++ shlibpath_overrides_runpath=no ++ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" ++ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ++ hardcode_into_libs=yes ++ ;; + ++# No shared lib support for Linux oldld, aout, or coff. ++linux*oldld* | linux*aout* | linux*coff*) ++ dynamic_linker=no ++ ;; + +-# AC_LIBTOOL_CXX +-# -------------- +-# enable support for C++ libraries +-AC_DEFUN([AC_LIBTOOL_CXX], +-[AC_REQUIRE([_LT_AC_LANG_CXX]) +-])# AC_LIBTOOL_CXX ++# This must be Linux ELF. ++linux* | k*bsd*-gnu) ++ version_type=linux ++ need_lib_prefix=no ++ 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' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ # Some binutils ld are patched to set DT_RUNPATH ++ save_LDFLAGS=$LDFLAGS ++ save_libdir=$libdir ++ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ ++ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], ++ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], ++ [shlibpath_overrides_runpath=yes])]) ++ LDFLAGS=$save_LDFLAGS ++ libdir=$save_libdir + ++ # This implies no fast_install, which is unacceptable. ++ # Some rework will be needed to allow for fast_install ++ # before this can be enabled. ++ hardcode_into_libs=yes + +-# _LT_AC_LANG_CXX +-# --------------- +-AC_DEFUN([_LT_AC_LANG_CXX], +-[AC_REQUIRE([AC_PROG_CXX]) +-AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +-])# _LT_AC_LANG_CXX ++ # Append ld.so.conf contents to the search path ++ if test -f /etc/ld.so.conf; then ++ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` ++ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" ++ fi + +-# _LT_AC_PROG_CXXCPP +-# ------------------ +-AC_DEFUN([_LT_AC_PROG_CXXCPP], +-[ +-AC_REQUIRE([AC_PROG_CXX]) +-if test -n "$CXX" && ( test "X$CXX" != "Xno" && +- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || +- (test "X$CXX" != "Xg++"))) ; then +- AC_PROG_CXXCPP +-fi +-])# _LT_AC_PROG_CXXCPP +- +-# AC_LIBTOOL_F77 +-# -------------- +-# enable support for Fortran 77 libraries +-AC_DEFUN([AC_LIBTOOL_F77], +-[AC_REQUIRE([_LT_AC_LANG_F77]) +-])# AC_LIBTOOL_F77 +- +- +-# _LT_AC_LANG_F77 +-# --------------- +-AC_DEFUN([_LT_AC_LANG_F77], +-[AC_REQUIRE([AC_PROG_F77]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +-])# _LT_AC_LANG_F77 +- +- +-# AC_LIBTOOL_GCJ +-# -------------- +-# enable support for GCJ libraries +-AC_DEFUN([AC_LIBTOOL_GCJ], +-[AC_REQUIRE([_LT_AC_LANG_GCJ]) +-])# AC_LIBTOOL_GCJ +- +- +-# _LT_AC_LANG_GCJ +-# --------------- +-AC_DEFUN([_LT_AC_LANG_GCJ], +-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], +- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], +- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], +- [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], +- [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], +- [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +-])# _LT_AC_LANG_GCJ +- +- +-# AC_LIBTOOL_RC +-# ------------- +-# enable support for Windows resource files +-AC_DEFUN([AC_LIBTOOL_RC], +-[AC_REQUIRE([LT_AC_PROG_RC]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +-])# AC_LIBTOOL_RC ++ # We used to test for /lib/ld.so.1 and disable shared libraries on ++ # powerpc, because MkLinux only supported shared libraries with the ++ # GNU dynamic linker. Since this was broken with cross compilers, ++ # most powerpc-linux boxes support dynamic linking these days and ++ # people can always --disable-shared, the test was removed, and we ++ # assume the GNU/Linux dynamic linker is in use. ++ dynamic_linker='GNU/Linux ld.so' ++ ;; + ++netbsd*) ++ version_type=sunos ++ need_lib_prefix=no ++ need_version=no ++ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' ++ dynamic_linker='NetBSD (a.out) ld.so' ++ else ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}$major' ++ dynamic_linker='NetBSD ld.elf_so' ++ fi ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes ++ ;; + +-# AC_LIBTOOL_LANG_C_CONFIG +-# ------------------------ +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +-AC_DEFUN([_LT_AC_LANG_C_CONFIG], +-[lt_save_CC="$CC" +-AC_LANG_PUSH(C) ++newsos6) ++ version_type=linux ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ ;; + +-# Source file extension for C test sources. +-ac_ext=c ++*nto* | *qnx*) ++ version_type=qnx ++ need_lib_prefix=no ++ 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' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ hardcode_into_libs=yes ++ dynamic_linker='ldqnx.so' ++ ;; + +-# Object file extension for compiled C test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext ++openbsd*) ++ version_type=sunos ++ sys_lib_dlsearch_path_spec="/usr/lib" ++ need_lib_prefix=no ++ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. ++ case $host_os in ++ openbsd3.3 | openbsd3.3.*) need_version=yes ;; ++ *) need_version=no ;; ++ esac ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then ++ case $host_os in ++ openbsd2.[[89]] | openbsd2.[[89]].*) ++ shlibpath_overrides_runpath=no ++ ;; ++ *) ++ shlibpath_overrides_runpath=yes ++ ;; ++ esac ++ else ++ shlibpath_overrides_runpath=yes ++ fi ++ ;; + +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="int some_variable = 0;\n" ++os2*) ++ libname_spec='$name' ++ shrext_cmds=".dll" ++ need_lib_prefix=no ++ library_names_spec='$libname${shared_ext} $libname.a' ++ dynamic_linker='OS/2 ld.exe' ++ shlibpath_var=LIBPATH ++ ;; + +-# Code to be used in simple link tests +-lt_simple_link_test_code='int main(){return(0);}\n' ++osf3* | osf4* | osf5*) ++ version_type=osf ++ need_lib_prefix=no ++ need_version=no ++ soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ shlibpath_var=LD_LIBRARY_PATH ++ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" ++ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ++ ;; + +-_LT_AC_SYS_COMPILER ++rdos*) ++ dynamic_linker=no ++ ;; + +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE ++solaris*) ++ version_type=linux ++ need_lib_prefix=no ++ 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' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes ++ # ldd complains unless libraries are executable ++ postinstall_cmds='chmod +x $lib' ++ ;; + +-## CAVEAT EMPTOR: +-## There is no encapsulation within the following macros, do not change +-## the running order or otherwise move them around unless you know exactly +-## what you are doing... +-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +-AC_LIBTOOL_SYS_LIB_STRIP +-AC_LIBTOOL_DLOPEN_SELF +- +-# Report which library types will actually be built +-AC_MSG_CHECKING([if libtool supports shared libraries]) +-AC_MSG_RESULT([$can_build_shared]) ++sunos4*) ++ version_type=sunos ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' ++ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ if test "$with_gnu_ld" = yes; then ++ need_lib_prefix=no ++ fi ++ need_version=yes ++ ;; + +-AC_MSG_CHECKING([whether to build shared libraries]) +-test "$can_build_shared" = "no" && enable_shared=no ++sysv4 | sysv4.3*) ++ version_type=linux ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}$major' ++ shlibpath_var=LD_LIBRARY_PATH ++ case $host_vendor in ++ sni) ++ shlibpath_overrides_runpath=no ++ need_lib_prefix=no ++ runpath_var=LD_RUN_PATH ++ ;; ++ siemens) ++ need_lib_prefix=no ++ ;; ++ motorola) ++ need_lib_prefix=no ++ need_version=no ++ shlibpath_overrides_runpath=no ++ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ++ ;; ++ esac ++ ;; + +-# On AIX, shared libraries and static libraries use the same namespace, and +-# are all built from PIC. +-case $host_os in +-aix3*) +- test "$enable_shared" = yes && enable_static=no +- if test -n "$RANLIB"; then +- archive_cmds="$archive_cmds~\$RANLIB \$lib" +- postinstall_cmds='$RANLIB $lib' ++sysv4*MP*) ++ if test -d /usr/nec ;then ++ version_type=linux ++ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' ++ soname_spec='$libname${shared_ext}.$major' ++ shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +-aix4* | aix5*) +- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then +- test "$enable_shared" = yes && enable_static=no ++sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) ++ version_type=freebsd-elf ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}$major' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes ++ if test "$with_gnu_ld" = yes; then ++ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' ++ else ++ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' ++ case $host_os in ++ sco3.2v5*) ++ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ++ ;; ++ esac + fi +- ;; +-esac +-AC_MSG_RESULT([$enable_shared]) +- +-AC_MSG_CHECKING([whether to build static libraries]) +-# Make sure either enable_shared or enable_static is yes. +-test "$enable_shared" = yes || enable_static=yes +-AC_MSG_RESULT([$enable_static]) +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_POP +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_C_CONFIG +- +- +-# AC_LIBTOOL_LANG_CXX_CONFIG +-# -------------------------- +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +-[AC_LANG_PUSH(C++) +-AC_REQUIRE([AC_PROG_CXX]) +-AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +- +-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +-_LT_AC_TAGVAR(allow_undefined_flag, $1)= +-_LT_AC_TAGVAR(always_export_symbols, $1)=no +-_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_direct, $1)=no +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +-_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +-_LT_AC_TAGVAR(hardcode_automatic, $1)=no +-_LT_AC_TAGVAR(module_cmds, $1)= +-_LT_AC_TAGVAR(module_expsym_cmds, $1)= +-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +-_LT_AC_TAGVAR(no_undefined_flag, $1)= +-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +- +-# Dependencies to place before and after the object being linked: +-_LT_AC_TAGVAR(predep_objects, $1)= +-_LT_AC_TAGVAR(postdep_objects, $1)= +-_LT_AC_TAGVAR(predeps, $1)= +-_LT_AC_TAGVAR(postdeps, $1)= +-_LT_AC_TAGVAR(compiler_lib_search_path, $1)= +- +-# Source file extension for C++ test sources. +-ac_ext=cpp +- +-# Object file extension for compiled C++ test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="int some_variable = 0;\n" ++ sys_lib_dlsearch_path_spec='/usr/lib' ++ ;; + +-# Code to be used in simple link tests +-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' ++tpf*) ++ # TPF is a cross-target only. Preferred cross-host = GNU/Linux. ++ version_type=linux ++ need_lib_prefix=no ++ need_version=no ++ library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ hardcode_into_libs=yes ++ ;; + +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER ++uts4*) ++ version_type=linux ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}$major' ++ shlibpath_var=LD_LIBRARY_PATH ++ ;; + +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE ++*) ++ dynamic_linker=no ++ ;; ++esac ++AC_MSG_RESULT([$dynamic_linker]) ++test "$dynamic_linker" = no && can_build_shared=no + +-# Allow CC to be a program name with arguments. +-lt_save_CC=$CC +-lt_save_LD=$LD +-lt_save_GCC=$GCC +-GCC=$GXX +-lt_save_with_gnu_ld=$with_gnu_ld +-lt_save_path_LD=$lt_cv_path_LD +-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then +- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +-else +- $as_unset lt_cv_prog_gnu_ld ++variables_saved_for_relink="PATH $shlibpath_var $runpath_var" ++if test "$GCC" = yes; then ++ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" + fi +-if test -n "${lt_cv_path_LDCXX+set}"; then +- lt_cv_path_LD=$lt_cv_path_LDCXX +-else +- $as_unset lt_cv_path_LD ++ ++if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then ++ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" + fi +-test -z "${LDCXX+set}" || LD=$LDCXX +-CC=${CXX-"c++"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +- +-# We don't want -fno-exception wen compiling C++ code, so set the +-# no_builtin_flag separately +-if test "$GXX" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +-else +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= ++if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then ++ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + fi + +-if test "$GXX" = yes; then +- # Set up default GNU C++ configuration +- +- AC_PROG_LD +- +- # Check if GNU C++ uses GNU ld as the underlying linker, since the +- # archiving commands below assume that GNU ld is being used. +- if test "$with_gnu_ld" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- +- # If archive_cmds runs LD, not CC, wlarc should be empty +- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to +- # investigate it a little bit more. (MM) +- wlarc='${wl}' +- +- # ancient GNU ld didn't support --whole-archive et. al. +- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ +- grep 'no-whole-archive' > /dev/null; then +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' +- else +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- else +- with_gnu_ld=no +- wlarc= +- +- # A generic and very simple default shared library creation +- # command for GNU C++ for the case where it uses the native +- # linker, instead of GNU ld. If possible, this setting should +- # overridden to take advantage of the native linker features on +- # the platform it is being used on. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' +- fi +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +- +-else +- GXX=no +- with_gnu_ld=no +- wlarc= +-fi ++_LT_DECL([], [variables_saved_for_relink], [1], ++ [Variables whose values should be saved in libtool wrapper scripts and ++ restored at link time]) ++_LT_DECL([], [need_lib_prefix], [0], ++ [Do we need the "lib" prefix for modules?]) ++_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) ++_LT_DECL([], [version_type], [0], [Library versioning type]) ++_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) ++_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) ++_LT_DECL([], [shlibpath_overrides_runpath], [0], ++ [Is shlibpath searched before the hard-coded library search path?]) ++_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) ++_LT_DECL([], [library_names_spec], [1], ++ [[List of archive names. First name is the real one, the rest are links. ++ The last name is the one that the linker finds with -lNAME]]) ++_LT_DECL([], [soname_spec], [1], ++ [[The coded name of the library, if different from the real name]]) ++_LT_DECL([], [postinstall_cmds], [2], ++ [Command to use after installation of a shared archive]) ++_LT_DECL([], [postuninstall_cmds], [2], ++ [Command to use after uninstallation of a shared archive]) ++_LT_DECL([], [finish_cmds], [2], ++ [Commands used to finish a libtool library installation in a directory]) ++_LT_DECL([], [finish_eval], [1], ++ [[As "finish_cmds", except a single script fragment to be evaled but ++ not shown]]) ++_LT_DECL([], [hardcode_into_libs], [0], ++ [Whether we should hardcode library paths into libraries]) ++_LT_DECL([], [sys_lib_search_path_spec], [2], ++ [Compile-time system search path for libraries]) ++_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], ++ [Run-time system search path for libraries]) ++])# _LT_SYS_DYNAMIC_LINKER + +-# PORTME: fill in a description of your system's C++ link characteristics +-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +-_LT_AC_TAGVAR(ld_shlibs, $1)=yes +-case $host_os in +- aix3*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aix4* | aix5*) +- if test "$host_cpu" = ia64; then +- # On IA64, the linker does run time linking by default, so we don't +- # have to do anything special. +- aix_use_runtimelinking=no +- exp_sym_flag='-Bexport' +- no_entry_flag="" +- else +- aix_use_runtimelinking=no + +- # Test if we are trying to use run time linking or normal +- # AIX style linking. If -brtl is somewhere in LDFLAGS, we +- # need to do runtime linking. +- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) +- for ld_flag in $LDFLAGS; do +- case $ld_flag in +- *-brtl*) +- aix_use_runtimelinking=yes +- break +- ;; +- esac +- done +- ;; +- esac +- +- exp_sym_flag='-bexport' +- no_entry_flag='-bnoentry' +- fi ++# _LT_PATH_TOOL_PREFIX(TOOL) ++# -------------------------- ++# find a file program which can recognize shared library ++AC_DEFUN([_LT_PATH_TOOL_PREFIX], ++[m4_require([_LT_DECL_EGREP])dnl ++AC_MSG_CHECKING([for $1]) ++AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, ++[case $MAGIC_CMD in ++[[\\/*] | ?:[\\/]*]) ++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ++ ;; ++*) ++ lt_save_MAGIC_CMD="$MAGIC_CMD" ++ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ++dnl $ac_dummy forces splitting on constant user-supplied paths. ++dnl POSIX.2 word splitting is done only on the output of word expansions, ++dnl not every word. This closes a longstanding sh security hole. ++ ac_dummy="m4_if([$2], , $PATH, [$2])" ++ for ac_dir in $ac_dummy; do ++ IFS="$lt_save_ifs" ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$1; then ++ lt_cv_path_MAGIC_CMD="$ac_dir/$1" ++ if test -n "$file_magic_test_file"; then ++ case $deplibs_check_method in ++ "file_magic "*) ++ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` ++ MAGIC_CMD="$lt_cv_path_MAGIC_CMD" ++ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | ++ $EGREP "$file_magic_regex" > /dev/null; then ++ : ++ else ++ cat <<_LT_EOF 1>&2 + +- # When large executables or shared objects are built, AIX ld can +- # have problems creating the table of contents. If linking a library +- # or program results in "error TOC overflow" add -mminimal-toc to +- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not +- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. +- +- _LT_AC_TAGVAR(archive_cmds, $1)='' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ++*** Warning: the command libtool uses to detect shared libraries, ++*** $file_magic_cmd, produces output that libtool cannot recognize. ++*** The result is that libtool may fail to recognize shared libraries ++*** as such. This will affect the creation of libtool libraries that ++*** depend on shared libraries, but programs linked with such libtool ++*** libraries will work regardless of this problem. Nevertheless, you ++*** may want to report the problem to your system manager and/or to ++*** bug-libtool@gnu.org + +- if test "$GXX" = yes; then +- case $host_os in aix4.[[012]]|aix4.[[012]].*) +- # We only want to do this on AIX 4.2 and lower, the check +- # below for broken collect2 doesn't work under 4.3+ +- collect2name=`${CC} -print-prog-name=collect2` +- if test -f "$collect2name" && \ +- strings "$collect2name" | grep resolve_lib_name >/dev/null +- then +- # We have reworked collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- else +- # We have old collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- # It fails to find uninstalled libraries when the uninstalled +- # path is not listed in the libpath. Setting hardcode_minus_L +- # to unsupported forces relinking +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- fi +- ;; +- esac +- shared_flag='-shared' +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag="$shared_flag "'${wl}-G' +- fi +- else +- # not using gcc +- if test "$host_cpu" = ia64; then +- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release +- # chokes on -Wl,-G. The following line is correct: +- shared_flag='-G' +- else +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag='${wl}-G' +- else +- shared_flag='${wl}-bM:SRE' +- fi ++_LT_EOF ++ fi ;; ++ esac + fi ++ break + fi ++ done ++ IFS="$lt_save_ifs" ++ MAGIC_CMD="$lt_save_MAGIC_CMD" ++ ;; ++esac]) ++MAGIC_CMD="$lt_cv_path_MAGIC_CMD" ++if test -n "$MAGIC_CMD"; then ++ AC_MSG_RESULT($MAGIC_CMD) ++else ++ AC_MSG_RESULT(no) ++fi ++_LT_DECL([], [MAGIC_CMD], [0], ++ [Used to examine libraries when file_magic_cmd begins with "file"])dnl ++])# _LT_PATH_TOOL_PREFIX + +- # It seems that -bexpall does not export symbols beginning with +- # underscore (_), so it is better to generate a list of symbols to export. +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- if test "$aix_use_runtimelinking" = yes; then +- # Warning - without using the other runtime loading flags (-brtl), +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" ++# Old name: ++AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +- else +- if test "$host_cpu" = ia64; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" +- else +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- # Warning - without using the other run time loading flags, +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' +- # Exported symbols can be pulled into shared objects from archives +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- # This is similar to how AIX traditionally builds its shared libraries. +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' +- fi +- fi +- ;; + +- beos*) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Joseph Beckenbach says some releases of gcc +- # support --undefined. This deserves some investigation. FIXME +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; ++# _LT_PATH_MAGIC ++# -------------- ++# find a file program which can recognize a shared library ++m4_defun([_LT_PATH_MAGIC], ++[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) ++if test -z "$lt_cv_path_MAGIC_CMD"; then ++ if test -n "$ac_tool_prefix"; then ++ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) ++ else ++ MAGIC_CMD=: ++ fi ++fi ++])# _LT_PATH_MAGIC + +- chorus*) +- case $cc_basename in +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; + +- cygwin* | mingw* | pw32*) +- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, +- # as there is no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- +- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- darwin* | rhapsody*) +- case $host_os in +- rhapsody* | darwin1.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' +- ;; +- *) # Darwin 1.3 on +- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- else +- case ${MACOSX_DEPLOYMENT_TARGET} in +- 10.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- ;; +- 10.*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' +- ;; +- esac +- fi +- ;; +- esac +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- +- if test "$GXX" = yes ; then +- lt_int_apple_cc_single_mod=no +- output_verbose_link_cmd='echo' +- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then +- lt_int_apple_cc_single_mod=yes +- fi +- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' +- fi +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- else +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- fi +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- else +- case $cc_basename in +- xlc*) +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- ;; +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +- ;; ++# LT_PATH_LD ++# ---------- ++# find the pathname to the GNU or non-GNU linker ++AC_DEFUN([LT_PATH_LD], ++[AC_REQUIRE([AC_PROG_CC])dnl ++AC_REQUIRE([AC_CANONICAL_HOST])dnl ++AC_REQUIRE([AC_CANONICAL_BUILD])dnl ++m4_require([_LT_DECL_SED])dnl ++m4_require([_LT_DECL_EGREP])dnl + +- dgux*) +- case $cc_basename in +- ec++*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- ghcx*) +- # Green Hills C++ Compiler +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- freebsd[[12]]*) +- # C++ shared libraries reported to be fairly broken before switch to ELF +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- freebsd-elf*) +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- ;; +- freebsd* | kfreebsd*-gnu | dragonfly*) +- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF +- # conventions +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- ;; +- gnu*) +- ;; +- hpux9*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, +- # but as the default +- # location of the library. +- +- case $cc_basename in +- CC*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aCC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- hpux10*|hpux11*) +- if test $with_gnu_ld = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ++AC_ARG_WITH([gnu-ld], ++ [AS_HELP_STRING([--with-gnu-ld], ++ [assume the C compiler uses GNU ld @<:@default=no@:>@])], ++ [test "$withval" = no || with_gnu_ld=yes], ++ [with_gnu_ld=no])dnl + +- case $host_cpu in +- hppa*64*|ia64*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' +- ;; +- *) +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- ;; +- esac +- fi +- case $host_cpu in +- hppa*64*|ia64*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- *) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, +- # but as the default +- # location of the library. ++ac_prog=ld ++if test "$GCC" = yes; then ++ # Check if gcc -print-prog-name=ld gives a path. ++ AC_MSG_CHECKING([for ld used by $CC]) ++ case $host in ++ *-*-mingw*) ++ # gcc leaves a trailing carriage return which upsets mingw ++ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; ++ *) ++ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; ++ esac ++ case $ac_prog in ++ # Accept absolute paths. ++ [[\\/]]* | ?:[[\\/]]*) ++ re_direlt='/[[^/]][[^/]]*/\.\./' ++ # Canonicalize the pathname of ld ++ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` ++ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ++ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` ++ done ++ test -z "$LD" && LD="$ac_prog" + ;; +- esac +- +- case $cc_basename in +- CC*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aCC*) +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- esac +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes; then +- if test $with_gnu_ld = no; then +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- esac +- fi +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- interix3*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. +- # Instead, shared libraries are loaded at an image base (0x10000000 by +- # default) and relocated if they conflict, which is a slow very memory +- # consuming and fragmenting process. To avoid this, we pick a random, +- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link +- # time. Moving up from 0x10000000 also allows more sbrk(2) space. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- ;; +- irix5* | irix6*) +- case $cc_basename in +- CC*) +- # SGI C++ +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- +- # Archives containing C++ object files must be created using +- # "CC -ar", where "CC" is the IRIX C++ compiler. This is +- # necessary to make sure instantiated templates are included +- # in the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' +- ;; +- *) +- if test "$GXX" = yes; then +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' +- fi +- fi +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; +- esac +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ++ "") ++ # If it fails, then pretend we aren't using GCC. ++ ac_prog=ld + ;; +- linux*) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- +- # Archives containing C++ object files must be created using +- # "CC -Bstatic", where "CC" is the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' +- ;; +- icpc*) +- # Intel C++ +- with_gnu_ld=yes +- # version 8.0 and above of icpc choke on multiply defined symbols +- # if we add $predep_objects and $postdep_objects, however 7.1 and +- # earlier do not add the objects themselves. +- case `$CC -V 2>&1` in +- *"Version 7."*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- ;; +- *) # Version 8.0 or newer +- tmp_idyn= +- case $host_cpu in +- ia64*) tmp_idyn=' -i_dynamic';; +- esac +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- ;; +- esac +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' +- ;; +- pgCC*) +- # Portland Group C++ compiler +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- ;; +- cxx*) +- # Compaq C++ +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' +- +- runpath_var=LD_RUN_PATH +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) +- # Sun C++ 5.9 +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- +- # Not sure whether something based on +- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 +- # would be better. +- output_verbose_link_cmd='echo' +- +- # Archives containing C++ object files must be created using +- # "CC -xar", where "CC" is the Sun C++ compiler. This is +- # necessary to make sure instantiated templates are included +- # in the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' +- ;; +- esac +- ;; +- esac ++ *) ++ # If it is relative, then search for the first ld in PATH. ++ with_gnu_ld=unknown + ;; +- lynxos*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- m88k*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- mvs*) +- case $cc_basename in +- cxx*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no ++ esac ++elif test "$with_gnu_ld" = yes; then ++ AC_MSG_CHECKING([for GNU ld]) ++else ++ AC_MSG_CHECKING([for non-GNU ld]) ++fi ++AC_CACHE_VAL(lt_cv_path_LD, ++[if test -z "$LD"; then ++ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ++ for ac_dir in $PATH; do ++ IFS="$lt_save_ifs" ++ test -z "$ac_dir" && ac_dir=. ++ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then ++ lt_cv_path_LD="$ac_dir/$ac_prog" ++ # Check to see if the program is GNU ld. I'd rather use --version, ++ # but apparently some variants of GNU ld only accept -v. ++ # Break only if it was the GNU/non-GNU ld that we prefer. ++ case `"$lt_cv_path_LD" -v 2>&1 /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' +- wlarc= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- fi +- # Workaround some broken pre-1.5 toolchains +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' +- ;; +- openbsd2*) +- # C++ shared libraries are fairly broken +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- openbsd*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' ++ esac + fi +- output_verbose_link_cmd='echo' +- ;; +- osf3*) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Archives containing C++ object files must be created using +- # "CC -Bstatic", where "CC" is the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' +- +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- cxx*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' ++ done ++ IFS="$lt_save_ifs" ++else ++ lt_cv_path_LD="$LD" # Let the user override the test with a path. ++fi]) ++LD="$lt_cv_path_LD" ++if test -n "$LD"; then ++ AC_MSG_RESULT($LD) ++else ++ AC_MSG_RESULT(no) ++fi ++test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) ++_LT_PATH_LD_GNU ++AC_SUBST([LD]) + +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- osf4* | osf5*) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Archives containing C++ object files must be created using +- # the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- cxx*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ +- echo "-hidden">> $lib.exp~ +- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ +- $rm $lib.exp' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' ++_LT_TAGDECL([], [LD], [1], [The linker used to build libraries]) ++])# LT_PATH_LD + +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- psos*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- sunos4*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.x +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- lcc*) +- # Lucid +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac ++# Old names: ++AU_ALIAS([AM_PROG_LD], [LT_PATH_LD]) ++AU_ALIAS([AC_PROG_LD], [LT_PATH_LD]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AM_PROG_LD], []) ++dnl AC_DEFUN([AC_PROG_LD], []) ++ ++ ++# _LT_PATH_LD_GNU ++#- -------------- ++m4_defun([_LT_PATH_LD_GNU], ++[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, ++[# I'd rather use --version here, but apparently some GNU lds only accept -v. ++case `$LD -v 2>&1 /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' ++case $host_os in ++aix[[4-9]]*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; + +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" +- else +- # g++ 2.7 appears to require `-G' NOT `-shared' on this +- # platform. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' ++beos*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; + +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" +- fi ++bsdi[[45]]*) ++ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' ++ lt_cv_file_magic_cmd='/usr/bin/file -L' ++ lt_cv_file_magic_test_file=/shlib/libc.so ++ ;; + +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' +- fi +- ;; +- esac +- ;; +- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var='LD_RUN_PATH' +- +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- ;; +- sysv5* | sco3.2v5* | sco5v6*) +- # Note: We can NOT use -z defs as we might desire, because we do not +- # link with -lc, and that would cause any symbols used from libc to +- # always be unresolved, which means just about no library would +- # ever link correctly. If we're not using GNU ld we use -z text +- # though, which does catch some bad symbols but isn't as heavy-handed +- # as -z defs. +- # For security reasons, it is highly recommended that you always +- # use absolute paths for naming shared libraries, and exclude the +- # DT_RUNPATH tag from executables and libraries. But doing so +- # requires that you compile everything twice, which is a pain. +- # So that behaviour is only enabled if SCOABSPATH is set to a +- # non-empty value in the environment. Most likely only useful for +- # creating official distributions of packages. +- # This is a hack until libtool officially supports absolute path +- # names for shared libraries. +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' +- runpath_var='LD_RUN_PATH' +- +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- ;; +- tandem*) +- case $cc_basename in +- NCC*) +- # NonStop-UX NCC 3.20 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; ++cygwin*) ++ # func_win32_libid is a shell function defined in ltmain.sh ++ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' ++ lt_cv_file_magic_cmd='func_win32_libid' ++ ;; ++ ++mingw* | pw32*) ++ # Base MSYS/MinGW do not provide the 'file' command needed by ++ # func_win32_libid shell function, so use a weaker test based on 'objdump', ++ # unless we find 'file', for example because we are cross-compiling. ++ if ( file / ) >/dev/null 2>&1; then ++ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' ++ lt_cv_file_magic_cmd='func_win32_libid' ++ else ++ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' ++ lt_cv_file_magic_cmd='$OBJDUMP -f' ++ fi ++ ;; ++ ++darwin* | rhapsody*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; ++ ++freebsd* | dragonfly*) ++ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then ++ case $host_cpu in ++ i*86 ) ++ # Not sure whether the presence of OpenBSD here was a mistake. ++ # Let's accept both of them until this is cleared up. ++ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' ++ lt_cv_file_magic_cmd=/usr/bin/file ++ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ++ ;; + esac ++ else ++ lt_cv_deplibs_check_method=pass_all ++ fi ++ ;; ++ ++gnu*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; ++ ++hpux10.20* | hpux11*) ++ lt_cv_file_magic_cmd=/usr/bin/file ++ case $host_cpu in ++ ia64*) ++ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' ++ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; +- vxworks*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no ++ hppa*64*) ++ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] ++ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no ++ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' ++ lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; +-esac +-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no ++ esac ++ ;; + +-_LT_AC_TAGVAR(GCC, $1)="$GXX" +-_LT_AC_TAGVAR(LD, $1)="$LD" ++interix[[3-9]]*) ++ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here ++ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ++ ;; + +-## CAVEAT EMPTOR: +-## There is no encapsulation within the following macros, do not change +-## the running order or otherwise move them around unless you know exactly +-## what you are doing... +-AC_LIBTOOL_POSTDEP_PREDEP($1) +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) ++irix5* | irix6* | nonstopux*) ++ case $LD in ++ *-32|*"-32 ") libmagic=32-bit;; ++ *-n32|*"-n32 ") libmagic=N32;; ++ *-64|*"-64 ") libmagic=64-bit;; ++ *) libmagic=never-match;; ++ esac ++ lt_cv_deplibs_check_method=pass_all ++ ;; + +-AC_LIBTOOL_CONFIG($1) ++# This must be Linux ELF. ++linux* | k*bsd*-gnu) ++ lt_cv_deplibs_check_method=pass_all ++ ;; + +-AC_LANG_POP +-CC=$lt_save_CC +-LDCXX=$LD +-LD=$lt_save_LD +-GCC=$lt_save_GCC +-with_gnu_ldcxx=$with_gnu_ld +-with_gnu_ld=$lt_save_with_gnu_ld +-lt_cv_path_LDCXX=$lt_cv_path_LD +-lt_cv_path_LD=$lt_save_path_LD +-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +-])# AC_LIBTOOL_LANG_CXX_CONFIG ++netbsd*) ++ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then ++ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' ++ else ++ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' ++ fi ++ ;; + +-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +-# ------------------------------------ +-# Figure out "hidden" library dependencies from verbose +-# compiler output when linking a shared library. +-# Parse the compiler output and extract the necessary +-# objects, libraries and library flags. +-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +-dnl we can't use the lt_simple_compile_test_code here, +-dnl because it contains code intended for an executable, +-dnl not a library. It's possible we should let each +-dnl tag define a new lt_????_link_test_code variable, +-dnl but it's only used here... +-ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&1 | sed '1q'` in ++ */dev/null* | *'Invalid file or object type'*) ++ lt_cv_path_NM="$tmp_nm -B" ++ break ++ ;; ++ *) ++ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in ++ */dev/null*) ++ lt_cv_path_NM="$tmp_nm -p" ++ break ++ ;; ++ *) ++ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but ++ continue # so that we can try to find one that supports BSD flags ++ ;; ++ esac ++ ;; ++ esac ++ fi ++ done ++ IFS="$lt_save_ifs" ++ done ++ : ${lt_cv_path_NM=no} ++fi]) ++if test "$lt_cv_path_NM" != "no"; then ++ NM="$lt_cv_path_NM" ++else ++ # Didn't find any BSD compatible name lister, look for dumpbin. ++ AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) ++ AC_SUBST([DUMPBIN]) ++ if test "$DUMPBIN" != ":"; then ++ NM="$DUMPBIN" ++ fi ++fi ++test -z "$NM" && NM=nm ++AC_SUBST([NM]) ++_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl ++ ++AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], ++ [lt_cv_nm_interface="BSD nm" ++ echo "int some_variable = 0;" > conftest.$ac_ext ++ (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) ++ (eval "$ac_compile" 2>conftest.err) ++ cat conftest.err >&AS_MESSAGE_LOG_FD ++ (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) ++ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) ++ cat conftest.err >&AS_MESSAGE_LOG_FD ++ (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) ++ cat conftest.out >&AS_MESSAGE_LOG_FD ++ if $GREP 'External.*some_variable' conftest.out > /dev/null; then ++ lt_cv_nm_interface="MS dumpbin" ++ fi ++ rm -f conftest*]) ++])# LT_PATH_NM ++ ++# Old names: ++AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) ++AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AM_PROG_NM], []) ++dnl AC_DEFUN([AC_PROG_NM], []) ++ ++ ++# LT_LIB_M ++# -------- ++# check for math library ++AC_DEFUN([LT_LIB_M], ++[AC_REQUIRE([AC_CANONICAL_HOST])dnl ++LIBM= ++case $host in ++*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) ++ # These system don't have libm, or don't need it ++ ;; ++*-ncr-sysv4.3*) ++ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") ++ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ++ ;; ++*) ++ AC_CHECK_LIB(m, cos, LIBM="-lm") ++ ;; ++esac ++AC_SUBST([LIBM]) ++])# LT_LIB_M ++ ++# Old name: ++AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_CHECK_LIBM], []) ++ ++ ++# _LT_COMPILER_NO_RTTI([TAGNAME]) ++# ------------------------------- ++m4_defun([_LT_COMPILER_NO_RTTI], ++[m4_require([_LT_TAG_COMPILER])dnl ++ ++_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= ++ ++if test "$GCC" = yes; then ++ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ++ ++ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], ++ lt_cv_prog_compiler_rtti_exceptions, ++ [-fno-rtti -fno-exceptions], [], ++ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) ++fi ++_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], ++ [Compiler flag to turn off builtin functions]) ++])# _LT_COMPILER_NO_RTTI ++ ++ ++# _LT_CMD_GLOBAL_SYMBOLS ++# ---------------------- ++m4_defun([_LT_CMD_GLOBAL_SYMBOLS], ++[AC_REQUIRE([AC_CANONICAL_HOST])dnl ++AC_REQUIRE([AC_PROG_CC])dnl ++AC_REQUIRE([LT_PATH_NM])dnl ++AC_REQUIRE([LT_PATH_LD])dnl ++m4_require([_LT_DECL_SED])dnl ++m4_require([_LT_DECL_EGREP])dnl ++m4_require([_LT_TAG_COMPILER])dnl ++ ++# Check for command to grab the raw symbol name followed by C symbol from nm. ++AC_MSG_CHECKING([command to parse $NM output from $compiler object]) ++AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], ++[ ++# These are sane defaults that work on at least a few old systems. ++# [They come from Ultrix. What could be older than Ultrix?!! ;)] ++ ++# Character class describing NM global symbol codes. ++symcode='[[BCDEGRST]]' ++ ++# Regexp to match symbols that can be accessed directly from C. ++sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' ++ ++# Define system-specific variables. ++case $host_os in ++aix*) ++ symcode='[[BCDT]]' ++ ;; ++cygwin* | mingw* | pw32*) ++ symcode='[[ABCDGISTW]]' ++ ;; ++hpux*) ++ if test "$host_cpu" = ia64; then ++ symcode='[[ABCDEGRST]]' ++ fi ++ ;; ++irix* | nonstopux*) ++ symcode='[[BCDEGRST]]' ++ ;; ++osf*) ++ symcode='[[BCDEGQRST]]' ++ ;; ++solaris*) ++ symcode='[[BDRT]]' ++ ;; ++sco3.2v5*) ++ symcode='[[DT]]' ++ ;; ++sysv4.2uw2*) ++ symcode='[[DT]]' ++ ;; ++sysv5* | sco5v6* | unixware* | OpenUNIX*) ++ symcode='[[ABDT]]' ++ ;; ++sysv4) ++ symcode='[[DFNSTU]]' ++ ;; ++esac ++ ++# If we're using GNU nm, then use its standard symbol codes. ++case `$NM -V 2>&1` in ++*GNU* | *'with BFD'*) ++ symcode='[[ABCDGIRSTW]]' ;; ++esac ++ ++# Transform an extracted symbol line into a proper C declaration. ++# Some systems (esp. on ia64) link data and code symbols differently, ++# so use this general approach. ++lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" ++ ++# Transform an extracted symbol line into symbol name and symbol address ++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" ++ ++# Handle CRLF in mingw tool chain ++opt_cr= ++case $build_os in ++mingw*) ++ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ++ ;; ++esac ++ ++# Try without a prefix underscore, then with it. ++for ac_symprfx in "" "_"; do ++ ++ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. ++ symxfrm="\\1 $ac_symprfx\\2 \\2" ++ ++ # Write the raw and C identifiers. ++ if test "$lt_cv_nm_interface" = "MS dumpbin"; then ++ # Fake it for dumpbin and say T for any non-static function ++ # and D for any global variable. ++ # Also find C++ and __fastcall symbols from MSVC++, ++ # which start with @ or ?. ++ lt_cv_sys_global_symbol_pipe="$AWK ['"\ ++" {last_section=section; section=\$ 3};"\ ++" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ ++" \$ 0!~/External *\|/{next};"\ ++" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ ++" {if(hide[section]) next};"\ ++" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ ++" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ ++" s[1]~/^[@?]/{print s[1], s[1]; next};"\ ++" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ ++" ' prfx=^$ac_symprfx]" ++ else ++ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" ++ fi ++ ++ # Check to see that the pipe works correctly. ++ pipe_works=no ++ ++ rm -f conftest* ++ cat > conftest.$ac_ext <<_LT_EOF ++#ifdef __cplusplus ++extern "C" { ++#endif ++char nm_test_var; ++void nm_test_func(void); ++void nm_test_func(void){} ++#ifdef __cplusplus ++} ++#endif ++int main(){nm_test_var='a';nm_test_func();return(0);} ++_LT_EOF ++ ++ if AC_TRY_EVAL(ac_compile); then ++ # Now try to grab the symbols. ++ nlist=conftest.nm ++ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then ++ # Try sorting and uniquifying the output. ++ if sort "$nlist" | uniq > "$nlist"T; then ++ mv -f "$nlist"T "$nlist" ++ else ++ rm -f "$nlist"T ++ fi ++ ++ # Make sure that we snagged all the symbols we need. ++ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then ++ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then ++ cat <<_LT_EOF > conftest.$ac_ext ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++_LT_EOF ++ # Now generate the symbol file. ++ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' ++ ++ cat <<_LT_EOF >> conftest.$ac_ext ++ ++/* The mapping between symbol names and symbols. */ ++const struct { ++ const char *name; ++ void *address; ++} ++lt__PROGRAM__LTX_preloaded_symbols[[]] = ++{ ++ { "@PROGRAM@", (void *) 0 }, ++_LT_EOF ++ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext ++ cat <<\_LT_EOF >> conftest.$ac_ext ++ {0, (void *) 0} ++}; ++ ++/* This works around a problem in FreeBSD linker */ ++#ifdef FREEBSD_WORKAROUND ++static const void *lt_preloaded_setup() { ++ return lt__PROGRAM__LTX_preloaded_symbols; ++} ++#endif ++ ++#ifdef __cplusplus ++} ++#endif ++_LT_EOF ++ # Now try linking the two files. ++ mv conftest.$ac_objext conftstm.$ac_objext ++ lt_save_LIBS="$LIBS" ++ lt_save_CFLAGS="$CFLAGS" ++ LIBS="conftstm.$ac_objext" ++ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" ++ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then ++ pipe_works=yes ++ fi ++ LIBS="$lt_save_LIBS" ++ CFLAGS="$lt_save_CFLAGS" ++ else ++ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD ++ fi ++ else ++ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD ++ fi ++ else ++ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD ++ fi ++ else ++ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD ++ cat conftest.$ac_ext >&5 ++ fi ++ rm -rf conftest* conftst* + +- if test "$pre_test_object_deps_done" = no; then +- case $p in +- -L* | -R*) +- # Internal compiler library paths should come after those +- # provided the user. The postdeps already come after the +- # user supplied libs so there is no need to process them. +- if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then +- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" +- else +- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" +- fi +- ;; +- # The "-l" case would never come before the object being +- # linked, so don't bother handling this case. +- esac +- else +- if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then +- _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}" +- else +- _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}" +- fi +- fi +- ;; ++ # Do not use the global_symbol_pipe unless it works. ++ if test "$pipe_works" = yes; then ++ break ++ else ++ lt_cv_sys_global_symbol_pipe= ++ fi ++done ++]) ++if test -z "$lt_cv_sys_global_symbol_pipe"; then ++ lt_cv_sys_global_symbol_to_cdecl= ++fi ++if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then ++ AC_MSG_RESULT(failed) ++else ++ AC_MSG_RESULT(ok) ++fi + +- *.$objext) +- # This assumes that the test object file only shows up +- # once in the compiler output. +- if test "$p" = "conftest.$objext"; then +- pre_test_object_deps_done=yes +- continue +- fi ++_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], ++ [Take the output of nm and produce a listing of raw symbols and C names]) ++_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], ++ [Transform the output of nm in a proper C declaration]) ++_LT_DECL([global_symbol_to_c_name_address], ++ [lt_cv_sys_global_symbol_to_c_name_address], [1], ++ [Transform the output of nm in a C name address pair]) ++_LT_DECL([global_symbol_to_c_name_address_lib_prefix], ++ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], ++ [Transform the output of nm in a C name address pair when lib prefix is needed]) ++]) # _LT_CMD_GLOBAL_SYMBOLS + +- if test "$pre_test_object_deps_done" = no; then +- if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then +- _LT_AC_TAGVAR(predep_objects, $1)="$p" +- else +- _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p" +- fi +- else +- if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then +- _LT_AC_TAGVAR(postdep_objects, $1)="$p" +- else +- _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p" +- fi +- fi +- ;; + +- *) ;; # Ignore the rest. ++# _LT_COMPILER_PIC([TAGNAME]) ++# --------------------------- ++m4_defun([_LT_COMPILER_PIC], ++[m4_require([_LT_TAG_COMPILER])dnl ++_LT_TAGVAR(lt_prog_compiler_wl, $1)= ++_LT_TAGVAR(lt_prog_compiler_pic, $1)= ++_LT_TAGVAR(lt_prog_compiler_static, $1)= ++ ++AC_MSG_CHECKING([for $compiler option to produce PIC]) ++m4_if([$1], [CXX], [ ++ # C++ specific cases for pic, static, wl, etc. ++ if test "$GXX" = yes; then ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ++ case $host_os in ++ aix*) ++ # All AIX code is PIC. ++ if test "$host_cpu" = ia64; then ++ # AIX 5 now supports IA64 processor ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ fi ++ ;; ++ ++ amigaos*) ++ case $host_cpu in ++ powerpc) ++ # see comment about AmigaOS4 .so support ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ ;; ++ m68k) ++ # FIXME: we need at least 68020 code to build shared libraries, but ++ # adding the `-m68020' flag to GCC prevents building anything better, ++ # like `-m68040'. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ++ ;; ++ esac ++ ;; ++ ++ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) ++ # PIC is the default for these OSes. ++ ;; ++ mingw* | cygwin* | os2* | pw32*) ++ # This hack is so that the source file can tell whether it is being ++ # built for inclusion in a dll (and should export symbols for example). ++ # Although the cygwin gcc ignores -fPIC, still need this for old-style ++ # (--disable-auto-import) libraries ++ m4_if([$1], [GCJ], [], ++ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ++ ;; ++ darwin* | rhapsody*) ++ # PIC is the default on this platform ++ # Common symbols not allowed in MH_DYLIB files ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ++ ;; ++ *djgpp*) ++ # DJGPP does not support shared libraries at all ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)= ++ ;; ++ interix[[3-9]]*) ++ # Interix 3.x gcc -fpic/-fPIC options generate broken code. ++ # Instead, we relocate shared libraries at runtime. ++ ;; ++ sysv4*MP*) ++ if test -d /usr/nec; then ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic ++ fi ++ ;; ++ hpux*) ++ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but ++ # not for PA HP-UX. ++ case $host_cpu in ++ hppa*64*|ia64*) ++ ;; ++ *) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ ;; ++ esac ++ ;; ++ *qnx* | *nto*) ++ # QNX uses GNU C++, but need to define -shared option too, otherwise ++ # it will coredump. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ++ ;; ++ *) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ ;; ++ esac ++ else ++ case $host_os in ++ aix[[4-9]]*) ++ # All AIX code is PIC. ++ if test "$host_cpu" = ia64; then ++ # AIX 5 now supports IA64 processor ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ else ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' ++ fi ++ ;; ++ chorus*) ++ case $cc_basename in ++ cxch68*) ++ # Green Hills C++ Compiler ++ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ++ ;; ++ esac ++ ;; ++ dgux*) ++ case $cc_basename in ++ ec++*) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ ;; ++ ghcx*) ++ # Green Hills C++ Compiler ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ freebsd* | dragonfly*) ++ # FreeBSD uses GNU C++ ++ ;; ++ hpux9* | hpux10* | hpux11*) ++ case $cc_basename in ++ CC*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ++ if test "$host_cpu" != ia64; then ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ++ fi ++ ;; ++ aCC*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ++ case $host_cpu in ++ hppa*64*|ia64*) ++ # +Z the default ++ ;; ++ *) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ++ ;; ++ esac ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ interix*) ++ # This is c89, which is MS Visual C++ (no shared libs) ++ # Anyone wants to do a port? ++ ;; ++ irix5* | irix6* | nonstopux*) ++ case $cc_basename in ++ CC*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ # CC pic flag -KPIC is the default. ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ linux* | k*bsd*-gnu) ++ case $cc_basename in ++ KCC*) ++ # KAI C++ Compiler ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ ;; ++ icpc* | ecpc* ) ++ # Intel C++ ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ++ ;; ++ pgCC* | pgcpp*) ++ # Portland Group C++ compiler ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; ++ cxx*) ++ # Compaq C++ ++ # Make sure the PIC flag is empty. It appears that all Alpha ++ # Linux and Compaq Tru64 Unix objects are PIC. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)= ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ ;; ++ xlc* | xlC*) ++ # IBM XL 8.0 on PPC ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ++ ;; ++ *) ++ case `$CC -V 2>&1 | sed 5q` in ++ *Sun\ C*) ++ # Sun C++ 5.9 ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ++ ;; ++ esac ++ ;; ++ esac ++ ;; ++ lynxos*) ++ ;; ++ m88k*) ++ ;; ++ mvs*) ++ case $cc_basename in ++ cxx*) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ netbsd*) ++ ;; ++ *qnx* | *nto*) ++ # QNX uses GNU C++, but need to define -shared option too, otherwise ++ # it will coredump. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ++ ;; ++ osf3* | osf4* | osf5*) ++ case $cc_basename in ++ KCC*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ++ ;; ++ RCC*) ++ # Rational C++ 2.4.1 ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ++ ;; ++ cxx*) ++ # Digital/Compaq C++ ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ # Make sure the PIC flag is empty. It appears that all Alpha ++ # Linux and Compaq Tru64 Unix objects are PIC. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)= ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ psos*) ++ ;; ++ solaris*) ++ case $cc_basename in ++ CC*) ++ # Sun C++ 4.2, 5.x and Centerline C++ ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ++ ;; ++ gcx*) ++ # Green Hills C++ Compiler ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ sunos4*) ++ case $cc_basename in ++ CC*) ++ # Sun C++ 4.x ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; ++ lcc*) ++ # Lucid ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) ++ case $cc_basename in ++ CC*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; ++ esac ++ ;; ++ tandem*) ++ case $cc_basename in ++ NCC*) ++ # NonStop-UX NCC 3.20 ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ vxworks*) ++ ;; ++ *) ++ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ++ ;; + esac +- done +- +- # Clean up. +- rm -f a.out a.exe +-else +- echo "libtool.m4: error: problem compiling $1 test program" +-fi +- +-$rm -f confest.$objext +- +-# PORTME: override above test on systems where it is broken +-ifelse([$1],[CXX], +-[case $host_os in +-interix3*) +- # Interix 3.5 installs completely hosed .la files for C++, so rather than +- # hack all around it, let's just trust "g++" to DTRT. +- _LT_AC_TAGVAR(predep_objects,$1)= +- _LT_AC_TAGVAR(postdep_objects,$1)= +- _LT_AC_TAGVAR(postdeps,$1)= +- ;; +- +-linux*) +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) +- # Sun C++ 5.9 +- _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun' +- ;; +- esac +- ;; +- +-solaris*) +- case $cc_basename in +- CC*) +- # Adding this requires a known-good setup of shared libraries for +- # Sun compiler versions before 5.6, else PIC objects from an old +- # archive will be linked into the output, leading to subtle bugs. +- _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun' +- ;; +- esac +- ;; +-esac +-]) +- +-case " $_LT_AC_TAGVAR(postdeps, $1) " in +-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; +-esac +-])# AC_LIBTOOL_POSTDEP_PREDEP +- +-# AC_LIBTOOL_LANG_F77_CONFIG +-# -------------------------- +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) +-AC_DEFUN([_LT_AC_LANG_F77_CONFIG], +-[AC_REQUIRE([AC_PROG_F77]) +-AC_LANG_PUSH(Fortran 77) +- +-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +-_LT_AC_TAGVAR(allow_undefined_flag, $1)= +-_LT_AC_TAGVAR(always_export_symbols, $1)=no +-_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_direct, $1)=no +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +-_LT_AC_TAGVAR(hardcode_automatic, $1)=no +-_LT_AC_TAGVAR(module_cmds, $1)= +-_LT_AC_TAGVAR(module_expsym_cmds, $1)= +-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +-_LT_AC_TAGVAR(no_undefined_flag, $1)= +-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +- +-# Source file extension for f77 test sources. +-ac_ext=f +- +-# Object file extension for compiled f77 test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code=" subroutine t\n return\n end\n" +- +-# Code to be used in simple link tests +-lt_simple_link_test_code=" program t\n end\n" +- +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER +- +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE +- +-# Allow CC to be a program name with arguments. +-lt_save_CC="$CC" +-CC=${F77-"f77"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +- +-AC_MSG_CHECKING([if libtool supports shared libraries]) +-AC_MSG_RESULT([$can_build_shared]) +- +-AC_MSG_CHECKING([whether to build shared libraries]) +-test "$can_build_shared" = "no" && enable_shared=no +- +-# On AIX, shared libraries and static libraries use the same namespace, and +-# are all built from PIC. +-case $host_os in +-aix3*) +- test "$enable_shared" = yes && enable_static=no +- if test -n "$RANLIB"; then +- archive_cmds="$archive_cmds~\$RANLIB \$lib" +- postinstall_cmds='$RANLIB $lib' + fi +- ;; +-aix4* | aix5*) +- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then +- test "$enable_shared" = yes && enable_static=no +- fi +- ;; +-esac +-AC_MSG_RESULT([$enable_shared]) +- +-AC_MSG_CHECKING([whether to build static libraries]) +-# Make sure either enable_shared or enable_static is yes. +-test "$enable_shared" = yes || enable_static=yes +-AC_MSG_RESULT([$enable_static]) +- +-_LT_AC_TAGVAR(GCC, $1)="$G77" +-_LT_AC_TAGVAR(LD, $1)="$LD" +- +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_POP +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_F77_CONFIG +- +- +-# AC_LIBTOOL_LANG_GCJ_CONFIG +-# -------------------------- +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) +-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], +-[AC_LANG_SAVE +- +-# Source file extension for Java test sources. +-ac_ext=java ++], ++[ ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + +-# Object file extension for compiled Java test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext ++ case $host_os in ++ aix*) ++ # All AIX code is PIC. ++ if test "$host_cpu" = ia64; then ++ # AIX 5 now supports IA64 processor ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ fi ++ ;; + +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="class foo {}\n" ++ amigaos*) ++ case $host_cpu in ++ powerpc) ++ # see comment about AmigaOS4 .so support ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ ;; ++ m68k) ++ # FIXME: we need at least 68020 code to build shared libraries, but ++ # adding the `-m68020' flag to GCC prevents building anything better, ++ # like `-m68040'. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ++ ;; ++ esac ++ ;; + +-# Code to be used in simple link tests +-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n' ++ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) ++ # PIC is the default for these OSes. ++ ;; + +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER ++ mingw* | cygwin* | pw32* | os2*) ++ # This hack is so that the source file can tell whether it is being ++ # built for inclusion in a dll (and should export symbols for example). ++ # Although the cygwin gcc ignores -fPIC, still need this for old-style ++ # (--disable-auto-import) libraries ++ m4_if([$1], [GCJ], [], ++ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ++ ;; + +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE ++ darwin* | rhapsody*) ++ # PIC is the default on this platform ++ # Common symbols not allowed in MH_DYLIB files ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ++ ;; + +-# Allow CC to be a program name with arguments. +-lt_save_CC="$CC" +-CC=${GCJ-"gcj"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) ++ hpux*) ++ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but ++ # not for PA HP-UX. ++ case $host_cpu in ++ hppa*64*|ia64*) ++ # +Z the default ++ ;; ++ *) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ ;; ++ esac ++ ;; + +-# GCJ did not exist at the time GCC didn't implicitly link libc in. +-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ++ interix[[3-9]]*) ++ # Interix 3.x gcc -fpic/-fPIC options generate broken code. ++ # Instead, we relocate shared libraries at runtime. ++ ;; + +-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ++ msdosdjgpp*) ++ # Just because we use GCC doesn't mean we suddenly get shared libraries ++ # on systems that don't support them. ++ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ++ enable_shared=no ++ ;; + +-## CAVEAT EMPTOR: +-## There is no encapsulation within the following macros, do not change +-## the running order or otherwise move them around unless you know exactly +-## what you are doing... +-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) ++ *nto* | *qnx*) ++ # QNX uses GNU C++, but need to define -shared option too, otherwise ++ # it will coredump. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ++ ;; + +-AC_LIBTOOL_CONFIG($1) ++ sysv4*MP*) ++ if test -d /usr/nec; then ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic ++ fi ++ ;; + +-AC_LANG_RESTORE +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_GCJ_CONFIG ++ *) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ ;; ++ esac ++ else ++ # PORTME Check for flag to pass linker flags through the system compiler. ++ case $host_os in ++ aix*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ if test "$host_cpu" = ia64; then ++ # AIX 5 now supports IA64 processor ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ else ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' ++ fi ++ ;; + ++ mingw* | cygwin* | pw32* | os2*) ++ # This hack is so that the source file can tell whether it is being ++ # built for inclusion in a dll (and should export symbols for example). ++ m4_if([$1], [GCJ], [], ++ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ++ ;; + +-# AC_LIBTOOL_LANG_RC_CONFIG +-# ------------------------- +-# Ensure that the configuration vars for the Windows resource compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) +-AC_DEFUN([_LT_AC_LANG_RC_CONFIG], +-[AC_LANG_SAVE ++ hpux9* | hpux10* | hpux11*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but ++ # not for PA HP-UX. ++ case $host_cpu in ++ hppa*64*|ia64*) ++ # +Z the default ++ ;; ++ *) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ++ ;; ++ esac ++ # Is there a better lt_prog_compiler_static that works with the bundled CC? ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ++ ;; + +-# Source file extension for RC test sources. +-ac_ext=rc ++ irix5* | irix6* | nonstopux*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ # PIC (with -KPIC) is the default. ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ ;; + +-# Object file extension for compiled RC test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext ++ linux* | k*bsd*-gnu) ++ case $cc_basename in ++ icc* | ecc* | ifort*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ++ ;; ++ pgcc* | pgf77* | pgf90* | pgf95*) ++ # Portland Group compilers (*not* the Pentium gcc compiler, ++ # which looks to be a dead project) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; ++ ccc*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ # All Alpha code is PIC. ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ ;; ++ xl*) ++ # IBM XL C 8.0/Fortran 10.1 on PPC ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ++ ;; ++ *) ++ case `$CC -V 2>&1 | sed 5q` in ++ *Sun\ C*) ++ # Sun C 5.9 ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ ;; ++ *Sun\ F*) ++ # Sun Fortran 8.3 passes all unrecognized flags to the linker ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ++ ;; ++ esac ++ ;; ++ esac ++ ;; + +-# Code to be used in simple compile tests +-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' ++ newsos6) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; + +-# Code to be used in simple link tests +-lt_simple_link_test_code="$lt_simple_compile_test_code" ++ *nto* | *qnx*) ++ # QNX uses GNU C++, but need to define -shared option too, otherwise ++ # it will coredump. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ++ ;; + +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER ++ osf3* | osf4* | osf5*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ # All OSF/1 code is PIC. ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ ;; + +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE ++ rdos*) ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ ;; + +-# Allow CC to be a program name with arguments. +-lt_save_CC="$CC" +-CC=${RC-"windres"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes ++ solaris*) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ case $cc_basename in ++ f77* | f90* | f95*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; ++ *) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; ++ esac ++ ;; + +-AC_LIBTOOL_CONFIG($1) ++ sunos4*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; + +-AC_LANG_RESTORE +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_RC_CONFIG ++ sysv4 | sysv4.2uw2* | sysv4.3*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; ++ ++ sysv4*MP*) ++ if test -d /usr/nec ;then ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ fi ++ ;; + ++ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; + +-# AC_LIBTOOL_CONFIG([TAGNAME]) +-# ---------------------------- +-# If TAGNAME is not passed, then create an initial libtool script +-# with a default configuration from the untagged config vars. Otherwise +-# add code to config.status for appending the configuration named by +-# TAGNAME from the matching tagged config vars. +-AC_DEFUN([AC_LIBTOOL_CONFIG], +-[# The else clause should only fire when bootstrapping the +-# libtool distribution, otherwise you forgot to ship ltmain.sh +-# with your package, and you will get complaints that there are +-# no rules to generate ltmain.sh. +-if test -f "$ltmain"; then +- # See if we are running on zsh, and set the options which allow our commands through +- # without removal of \ escapes. +- if test -n "${ZSH_VERSION+set}" ; then +- setopt NO_GLOB_SUBST +- fi +- # Now quote all the things that may contain metacharacters while being +- # careful not to overquote the AC_SUBSTed values. We take copies of the +- # variables and quote the copies for generation of the libtool script. +- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ +- SED SHELL STRIP \ +- libname_spec library_names_spec soname_spec extract_expsyms_cmds \ +- old_striplib striplib file_magic_cmd finish_cmds finish_eval \ +- deplibs_check_method reload_flag reload_cmds need_locks \ +- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ +- lt_cv_sys_global_symbol_to_c_name_address \ +- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ +- old_postinstall_cmds old_postuninstall_cmds \ +- _LT_AC_TAGVAR(compiler, $1) \ +- _LT_AC_TAGVAR(CC, $1) \ +- _LT_AC_TAGVAR(LD, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ +- _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ +- _LT_AC_TAGVAR(old_archive_cmds, $1) \ +- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ +- _LT_AC_TAGVAR(predep_objects, $1) \ +- _LT_AC_TAGVAR(postdep_objects, $1) \ +- _LT_AC_TAGVAR(predeps, $1) \ +- _LT_AC_TAGVAR(postdeps, $1) \ +- _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ +- _LT_AC_TAGVAR(archive_cmds, $1) \ +- _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ +- _LT_AC_TAGVAR(postinstall_cmds, $1) \ +- _LT_AC_TAGVAR(postuninstall_cmds, $1) \ +- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ +- _LT_AC_TAGVAR(allow_undefined_flag, $1) \ +- _LT_AC_TAGVAR(no_undefined_flag, $1) \ +- _LT_AC_TAGVAR(export_symbols_cmds, $1) \ +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ +- _LT_AC_TAGVAR(hardcode_automatic, $1) \ +- _LT_AC_TAGVAR(module_cmds, $1) \ +- _LT_AC_TAGVAR(module_expsym_cmds, $1) \ +- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ +- _LT_AC_TAGVAR(exclude_expsyms, $1) \ +- _LT_AC_TAGVAR(include_expsyms, $1); do +- +- case $var in +- _LT_AC_TAGVAR(old_archive_cmds, $1) | \ +- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ +- _LT_AC_TAGVAR(archive_cmds, $1) | \ +- _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ +- _LT_AC_TAGVAR(module_cmds, $1) | \ +- _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ +- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ +- _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ +- extract_expsyms_cmds | reload_cmds | finish_cmds | \ +- postinstall_cmds | postuninstall_cmds | \ +- old_postinstall_cmds | old_postuninstall_cmds | \ +- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) +- # Double-quote double-evaled strings. +- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ++ unicos*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ++ ;; ++ ++ uts4*) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; ++ + *) +- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ++ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac +- done +- +- case $lt_echo in +- *'\[$]0 --fallback-echo"') +- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` ++ fi ++]) ++case $host_os in ++ # For platforms which do not support PIC, -DPIC is meaningless: ++ *djgpp*) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; +- esac +- +-ifelse([$1], [], +- [cfgfile="${ofile}T" +- trap "$rm \"$cfgfile\"; exit 1" 1 2 15 +- $rm -f "$cfgfile" +- AC_MSG_NOTICE([creating $ofile])], +- [cfgfile="$ofile"]) +- +- cat <<__EOF__ >> "$cfgfile" +-ifelse([$1], [], +-[#! $SHELL ++ *) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ++ ;; ++esac ++AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) ++_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], ++ [How to pass a linker flag through the compiler]) + +-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +-# NOTE: Changes made to this file will be lost: look at ltmain.sh. + # +-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +-# Free Software Foundation, Inc. +-# +-# This file is part of GNU Libtool: +-# Originally by Gordon Matzigkeit , 1996 +-# +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2 of the License, or +-# (at your option) any later version. ++# Check to make sure the PIC flag actually works. + # +-# 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. ++if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then ++ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], ++ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], ++ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], ++ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in ++ "" | " "*) ;; ++ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; ++ esac], ++ [_LT_TAGVAR(lt_prog_compiler_pic, $1)= ++ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) ++fi ++_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], ++ [Additional compiler flags for building library objects]) ++ + # +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++# Check to make sure the static flag actually works. + # +-# As a special exception to the GNU General Public License, if you +-# distribute this file as part of a program that contains a +-# configuration script generated by Autoconf, you may include it under +-# the same distribution terms that you use for the rest of that program. +- +-# A sed program that does not truncate output. +-SED=$lt_SED +- +-# Sed that helps us avoid accidentally triggering echo(1) options like -n. +-Xsed="$SED -e 1s/^X//" +- +-# The HP-UX ksh and POSIX shell print the target directory to stdout +-# if CDPATH is set. +-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +- +-# The names of the tagged configurations supported by this script. +-available_tags= +- +-# ### BEGIN LIBTOOL CONFIG], +-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) +- +-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +- +-# Shell to use when invoking shell scripts. +-SHELL=$lt_SHELL +- +-# Whether or not to build shared libraries. +-build_libtool_libs=$enable_shared +- +-# Whether or not to build static libraries. +-build_old_libs=$enable_static +- +-# Whether or not to add -lc for building shared libraries. +-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) +- +-# Whether or not to disallow shared libs when runtime libs are static +-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) +- +-# Whether or not to optimize for fast installation. +-fast_install=$enable_fast_install +- +-# The host system. +-host_alias=$host_alias +-host=$host +-host_os=$host_os ++wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" ++_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], ++ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), ++ $lt_tmp_static_flag, ++ [], ++ [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) ++_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], ++ [Compiler flag to prevent dynamic linking]) ++])# _LT_COMPILER_PIC + +-# The build system. +-build_alias=$build_alias +-build=$build +-build_os=$build_os + +-# An echo program that does not interpret backslashes. +-echo=$lt_echo ++# _LT_LINKER_SHLIBS([TAGNAME]) ++# ---------------------------- ++# See if the linker supports building shared libraries. ++m4_defun([_LT_LINKER_SHLIBS], ++[AC_REQUIRE([LT_PATH_LD])dnl ++AC_REQUIRE([LT_PATH_NM])dnl ++m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++m4_require([_LT_DECL_EGREP])dnl ++m4_require([_LT_DECL_SED])dnl ++m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl ++m4_require([_LT_TAG_COMPILER])dnl ++AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ++m4_if([$1], [CXX], [ ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ++ case $host_os in ++ aix[[4-9]]*) ++ # If we're using GNU nm, then we don't want the "-C" option. ++ # -C means demangle to AIX nm, but means don't demangle with GNU nm ++ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' ++ else ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' ++ fi ++ ;; ++ pw32*) ++ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ++ ;; ++ cygwin* | mingw*) ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ++ ;; ++ *) ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ++ ;; ++ esac ++ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ++], [ ++ runpath_var= ++ _LT_TAGVAR(allow_undefined_flag, $1)= ++ _LT_TAGVAR(always_export_symbols, $1)=no ++ _LT_TAGVAR(archive_cmds, $1)= ++ _LT_TAGVAR(archive_expsym_cmds, $1)= ++ _LT_TAGVAR(compiler_needs_object, $1)=no ++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)= ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ++ _LT_TAGVAR(hardcode_automatic, $1)=no ++ _LT_TAGVAR(hardcode_direct, $1)=no ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=no ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= ++ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= ++ _LT_TAGVAR(hardcode_libdir_separator, $1)= ++ _LT_TAGVAR(hardcode_minus_L, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported ++ _LT_TAGVAR(inherit_rpath, $1)=no ++ _LT_TAGVAR(link_all_deplibs, $1)=unknown ++ _LT_TAGVAR(module_cmds, $1)= ++ _LT_TAGVAR(module_expsym_cmds, $1)= ++ _LT_TAGVAR(old_archive_from_new_cmds, $1)= ++ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= ++ _LT_TAGVAR(thread_safe_flag_spec, $1)= ++ _LT_TAGVAR(whole_archive_flag_spec, $1)= ++ # include_expsyms should be a list of space-separated symbols to be *always* ++ # included in the symbol list ++ _LT_TAGVAR(include_expsyms, $1)= ++ # exclude_expsyms can be an extended regexp of symbols to exclude ++ # it will be wrapped by ` (' and `)$', so one must not match beginning or ++ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', ++ # as well as any symbol that contains `d'. ++ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ++ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out ++ # platforms (ab)use it in PIC code, but their linkers get confused if ++ # the symbol is explicitly referenced. Since portable code cannot ++ # rely on this symbol name, it's probably fine to never include it in ++ # preloaded symbol tables. ++ # Exclude shared library initialization/finalization symbols. ++dnl Note also adjust exclude_expsyms for C++ above. ++ extract_expsyms_cmds= + +-# The archiver. +-AR=$lt_AR +-AR_FLAGS=$lt_AR_FLAGS ++ case $host_os in ++ cygwin* | mingw* | pw32*) ++ # FIXME: the MSVC++ port hasn't been tested in a loooong time ++ # When not using gcc, we currently assume that we are using ++ # Microsoft Visual C++. ++ if test "$GCC" != yes; then ++ with_gnu_ld=no ++ fi ++ ;; ++ interix*) ++ # we just hope/assume this is gcc and not c89 (= MSVC++) ++ with_gnu_ld=yes ++ ;; ++ openbsd*) ++ with_gnu_ld=no ++ ;; ++ esac + +-# A C compiler. +-LTCC=$lt_LTCC ++ _LT_TAGVAR(ld_shlibs, $1)=yes ++ if test "$with_gnu_ld" = yes; then ++ # If archive_cmds runs LD, not CC, wlarc should be empty ++ wlarc='${wl}' + +-# LTCC compiler flags. +-LTCFLAGS=$lt_LTCFLAGS ++ # Set some defaults for GNU ld with shared library support. These ++ # are reset later if shared libraries are not supported. Putting them ++ # here allows them to be overridden if necessary. ++ runpath_var=LD_RUN_PATH ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ # ancient GNU ld didn't support --whole-archive et. al. ++ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then ++ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' ++ else ++ _LT_TAGVAR(whole_archive_flag_spec, $1)= ++ fi ++ supports_anon_versioning=no ++ case `$LD -v 2>&1` in ++ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 ++ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... ++ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... ++ *\ 2.11.*) ;; # other 2.11 versions ++ *) supports_anon_versioning=yes ;; ++ esac + +-# A language-specific compiler. +-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) ++ # See if GNU ld supports shared libraries. ++ case $host_os in ++ aix[[3-9]]*) ++ # On AIX/PPC, the GNU linker is very broken ++ if test "$host_cpu" != ia64; then ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ cat <<_LT_EOF 1>&2 + +-# Is the compiler the GNU C compiler? +-with_gcc=$_LT_AC_TAGVAR(GCC, $1) ++*** Warning: the GNU linker, at least up to release 2.9.1, is reported ++*** to be unable to reliably create shared libraries on AIX. ++*** Therefore, libtool is disabling shared libraries support. If you ++*** really care for shared libraries, you may want to modify your PATH ++*** so that a non-GNU linker is found, and then restart. + +-# An ERE matcher. +-EGREP=$lt_EGREP ++_LT_EOF ++ fi ++ ;; + +-# The linker used to build libraries. +-LD=$lt_[]_LT_AC_TAGVAR(LD, $1) ++ amigaos*) ++ case $host_cpu in ++ powerpc) ++ # see comment about AmigaOS4 .so support ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='' ++ ;; ++ m68k) ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ ;; ++ esac ++ ;; + +-# Whether we need hard or soft links. +-LN_S=$lt_LN_S ++ beos*) ++ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ # Joseph Beckenbach says some releases of gcc ++ # support --undefined. This deserves some investigation. FIXME ++ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; + +-# A BSD-compatible nm program. +-NM=$lt_NM ++ cygwin* | mingw* | pw32*) ++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, ++ # as there is no search path for DLLs. ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ _LT_TAGVAR(always_export_symbols, $1)=no ++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + +-# A symbol stripping program +-STRIP=$lt_STRIP ++ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ # If the export-symbols file already is a .def file (1st line ++ # is EXPORTS), use it as is; otherwise, prepend... ++ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ cp $export_symbols $output_objdir/$soname.def; ++ else ++ echo EXPORTS > $output_objdir/$soname.def; ++ cat $export_symbols >> $output_objdir/$soname.def; ++ fi~ ++ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; + +-# Used to examine libraries when file_magic_cmd begins "file" +-MAGIC_CMD=$MAGIC_CMD ++ interix[[3-9]]*) ++ _LT_TAGVAR(hardcode_direct, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. ++ # Instead, shared libraries are loaded at an image base (0x10000000 by ++ # default) and relocated if they conflict, which is a slow very memory ++ # consuming and fragmenting process. To avoid this, we pick a random, ++ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link ++ # time. Moving up from 0x10000000 also allows more sbrk(2) space. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ ;; + +-# Used on cygwin: DLL creation program. +-DLLTOOL="$DLLTOOL" ++ gnu* | linux* | tpf* | k*bsd*-gnu) ++ tmp_diet=no ++ if test "$host_os" = linux-dietlibc; then ++ case $cc_basename in ++ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) ++ esac ++ fi ++ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ ++ && test "$tmp_diet" = no ++ then ++ tmp_addflag= ++ tmp_sharedflag='-shared' ++ case $cc_basename,$host_cpu in ++ pgcc*) # Portland Group C compiler ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ++ tmp_addflag=' $pic_flag' ++ ;; ++ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ++ tmp_addflag=' $pic_flag -Mnomain' ;; ++ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 ++ tmp_addflag=' -i_dynamic' ;; ++ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 ++ tmp_addflag=' -i_dynamic -nofor_main' ;; ++ ifc* | ifort*) # Intel Fortran compiler ++ tmp_addflag=' -nofor_main' ;; ++ xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) ++ tmp_sharedflag='-qmkshrobj' ++ tmp_addflag= ;; ++ esac ++ case `$CC -V 2>&1 | sed 5q` in ++ *Sun\ C*) # Sun C 5.9 ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ++ _LT_TAGVAR(compiler_needs_object, $1)=yes ++ tmp_sharedflag='-G' ;; ++ *Sun\ F*) # Sun Fortran 8.3 ++ tmp_sharedflag='-G' ;; ++ esac ++ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + +-# Used on cygwin: object dumper. +-OBJDUMP="$OBJDUMP" ++ if test "x$supports_anon_versioning" = xyes; then ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ ++ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ ++ echo "local: *; };" >> $output_objdir/$libname.ver~ ++ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' ++ fi + +-# Used on cygwin: assembler. +-AS="$AS" ++ case $cc_basename in ++ xlf*) ++ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= ++ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' ++ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' ++ if test "x$supports_anon_versioning" = xyes; then ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ ++ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ ++ echo "local: *; };" >> $output_objdir/$libname.ver~ ++ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' ++ fi ++ ;; ++ esac ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; + +-# The name of the directory that contains temporary libtool files. +-objdir=$objdir ++ netbsd*) ++ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' ++ wlarc= ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ fi ++ ;; + +-# How to create reloadable object files. +-reload_flag=$lt_reload_flag +-reload_cmds=$lt_reload_cmds ++ solaris*) ++ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ cat <<_LT_EOF 1>&2 + +-# How to pass a linker flag through the compiler. +-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) ++*** Warning: The releases 2.8.* of the GNU linker cannot reliably ++*** create shared libraries on Solaris systems. Therefore, libtool ++*** is disabling shared libraries support. We urge you to upgrade GNU ++*** binutils to release 2.9.1 or newer. Another option is to modify ++*** your PATH or compiler configuration so that the native linker is ++*** used, and then restart. + +-# Object file suffix (normally "o"). +-objext="$ac_objext" ++_LT_EOF ++ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; + +-# Old archive suffix (normally "a"). +-libext="$libext" ++ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) ++ case `$LD -v 2>&1` in ++ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ cat <<_LT_EOF 1>&2 + +-# Shared library suffix (normally ".so"). +-shrext_cmds='$shrext_cmds' ++*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not ++*** reliably create shared libraries on SCO systems. Therefore, libtool ++*** is disabling shared libraries support. We urge you to upgrade GNU ++*** binutils to release 2.16.91.0.3 or newer. Another option is to modify ++*** your PATH or compiler configuration so that the native linker is ++*** used, and then restart. + +-# Executable file suffix (normally ""). +-exeext="$exeext" ++_LT_EOF ++ ;; ++ *) ++ # For security reasons, it is highly recommended that you always ++ # use absolute paths for naming shared libraries, and exclude the ++ # DT_RUNPATH tag from executables and libraries. But doing so ++ # requires that you compile everything twice, which is a pain. ++ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; ++ esac ++ ;; + +-# Additional compiler flags for building library objects. +-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +-pic_mode=$pic_mode ++ sunos4*) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' ++ wlarc= ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# What is the maximum length of a command? +-max_cmd_len=$lt_cv_sys_max_cmd_len ++ *) ++ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; ++ esac + +-# Does compiler simultaneously support -c and -o options? +-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) ++ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then ++ runpath_var= ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)= ++ _LT_TAGVAR(whole_archive_flag_spec, $1)= ++ fi ++ else ++ # PORTME fill in a description of your system's linker (not GNU ld) ++ case $host_os in ++ aix3*) ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ _LT_TAGVAR(always_export_symbols, $1)=yes ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' ++ # Note: this linker hardcodes the directories in LIBPATH if there ++ # are no directories specified by -L. ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then ++ # Neither direct hardcoding nor static linking is supported with a ++ # broken collect2. ++ _LT_TAGVAR(hardcode_direct, $1)=unsupported ++ fi ++ ;; + +-# Must we lock files when doing compilation? +-need_locks=$lt_need_locks ++ aix[[4-9]]*) ++ if test "$host_cpu" = ia64; then ++ # On IA64, the linker does run time linking by default, so we don't ++ # have to do anything special. ++ aix_use_runtimelinking=no ++ exp_sym_flag='-Bexport' ++ no_entry_flag="" ++ else ++ # If we're using GNU nm, then we don't want the "-C" option. ++ # -C means demangle to AIX nm, but means don't demangle with GNU nm ++ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' ++ else ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' ++ fi ++ aix_use_runtimelinking=no + +-# Do we need the lib prefix for modules? +-need_lib_prefix=$need_lib_prefix ++ # Test if we are trying to use run time linking or normal ++ # AIX style linking. If -brtl is somewhere in LDFLAGS, we ++ # need to do runtime linking. ++ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) ++ for ld_flag in $LDFLAGS; do ++ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then ++ aix_use_runtimelinking=yes ++ break ++ fi ++ done ++ ;; ++ esac + +-# Do we need a version for libraries? +-need_version=$need_version ++ exp_sym_flag='-bexport' ++ no_entry_flag='-bnoentry' ++ fi + +-# Whether dlopen is supported. +-dlopen_support=$enable_dlopen ++ # When large executables or shared objects are built, AIX ld can ++ # have problems creating the table of contents. If linking a library ++ # or program results in "error TOC overflow" add -mminimal-toc to ++ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not ++ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + +-# Whether dlopen of programs is supported. +-dlopen_self=$enable_dlopen_self ++ _LT_TAGVAR(archive_cmds, $1)='' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=':' ++ _LT_TAGVAR(link_all_deplibs, $1)=yes ++ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + +-# Whether dlopen of statically linked programs is supported. +-dlopen_self_static=$enable_dlopen_self_static ++ if test "$GCC" = yes; then ++ case $host_os in aix4.[[012]]|aix4.[[012]].*) ++ # We only want to do this on AIX 4.2 and lower, the check ++ # below for broken collect2 doesn't work under 4.3+ ++ collect2name=`${CC} -print-prog-name=collect2` ++ if test -f "$collect2name" && ++ strings "$collect2name" | $GREP resolve_lib_name >/dev/null ++ then ++ # We have reworked collect2 ++ : ++ else ++ # We have old collect2 ++ _LT_TAGVAR(hardcode_direct, $1)=unsupported ++ # It fails to find uninstalled libraries when the uninstalled ++ # path is not listed in the libpath. Setting hardcode_minus_L ++ # to unsupported forces relinking ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)= ++ fi ++ ;; ++ esac ++ shared_flag='-shared' ++ if test "$aix_use_runtimelinking" = yes; then ++ shared_flag="$shared_flag "'${wl}-G' ++ fi ++ else ++ # not using gcc ++ if test "$host_cpu" = ia64; then ++ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release ++ # chokes on -Wl,-G. The following line is correct: ++ shared_flag='-G' ++ else ++ if test "$aix_use_runtimelinking" = yes; then ++ shared_flag='${wl}-G' ++ else ++ shared_flag='${wl}-bM:SRE' ++ fi ++ fi ++ fi + +-# Compiler flag to prevent dynamic linking. +-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) ++ # It seems that -bexpall does not export symbols beginning with ++ # underscore (_), so it is better to generate a list of symbols to export. ++ _LT_TAGVAR(always_export_symbols, $1)=yes ++ if test "$aix_use_runtimelinking" = yes; then ++ # Warning - without using the other runtime loading flags (-brtl), ++ # -berok will link without error, but may produce a broken library. ++ _LT_TAGVAR(allow_undefined_flag, $1)='-berok' ++ # Determine the default libpath from the value encoded in an ++ # empty executable. ++ _LT_SYS_MODULE_PATH_AIX ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" ++ else ++ if test "$host_cpu" = ia64; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' ++ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" ++ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" ++ else ++ # Determine the default libpath from the value encoded in an ++ # empty executable. ++ _LT_SYS_MODULE_PATH_AIX ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" ++ # Warning - without using the other run time loading flags, ++ # -berok will link without error, but may produce a broken library. ++ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' ++ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' ++ # Exported symbols can be pulled into shared objects from archives ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes ++ # This is similar to how AIX traditionally builds its shared libraries. ++ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' ++ fi ++ fi ++ ;; + +-# Compiler flag to turn off builtin functions. +-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) ++ amigaos*) ++ case $host_cpu in ++ powerpc) ++ # see comment about AmigaOS4 .so support ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='' ++ ;; ++ m68k) ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ ;; ++ esac ++ ;; + +-# Compiler flag to allow reflexive dlopens. +-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) ++ bsdi[[45]]*) ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ++ ;; + +-# Compiler flag to generate shared objects directly from archives. +-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) ++ cygwin* | mingw* | pw32*) ++ # When not using gcc, we currently assume that we are using ++ # Microsoft Visual C++. ++ # hardcode_libdir_flag_spec is actually meaningless, as there is ++ # no search path for DLLs. ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' ++ # The linker will automatically build a .lib file if we build a DLL. ++ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' ++ # FIXME: Should let the user specify the lib program. ++ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' ++ _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' ++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ++ ;; + +-# Compiler flag to generate thread-safe objects. +-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) ++ darwin* | rhapsody*) ++ _LT_DARWIN_LINKER_FEATURES($1) ++ ;; + +-# Library versioning type. +-version_type=$version_type ++ dgux*) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# Format of library name prefix. +-libname_spec=$lt_libname_spec ++ freebsd1*) ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; + +-# List of archive names. First name is the real one, the rest are links. +-# The last name is the one that the linker finds with -lNAME. +-library_names_spec=$lt_library_names_spec ++ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor ++ # support. Future versions do this automatically, but an explicit c++rt0.o ++ # does not break anything, and helps significantly (at the cost of a little ++ # extra space). ++ freebsd2.2*) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# The coded name of the library, if different from the real name. +-soname_spec=$lt_soname_spec ++ # Unfortunately, older versions of FreeBSD 2 do not have this feature. ++ freebsd2*) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# Commands used to build and install an old-style archive. +-RANLIB=$lt_RANLIB +-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +-old_postinstall_cmds=$lt_old_postinstall_cmds +-old_postuninstall_cmds=$lt_old_postuninstall_cmds ++ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. ++ freebsd* | dragonfly*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# Create an old-style archive from a shared archive. +-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) ++ hpux9*) ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ fi ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ _LT_TAGVAR(hardcode_direct, $1)=yes + +-# Create a temporary old-style archive to link instead of a shared archive. +-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) ++ # hardcode_minus_L: Not really in the search PATH, ++ # but as the default location of the library. ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ ;; + +-# Commands used to build and install a shared archive. +-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +-postinstall_cmds=$lt_postinstall_cmds +-postuninstall_cmds=$lt_postuninstall_cmds ++ hpux10*) ++ if test "$GCC" = yes -a "$with_gnu_ld" = no; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ++ fi ++ if test "$with_gnu_ld" = no; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ # hardcode_minus_L: Not really in the search PATH, ++ # but as the default location of the library. ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ fi ++ ;; + +-# Commands used to build a loadable module (assumed same as above if empty) +-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) ++ hpux11*) ++ if test "$GCC" = yes -a "$with_gnu_ld" = no; then ++ case $host_cpu in ++ hppa*64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ ia64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ esac ++ else ++ case $host_cpu in ++ hppa*64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ ia64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ esac ++ fi ++ if test "$with_gnu_ld" = no; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: + +-# Commands to strip libraries. +-old_striplib=$lt_old_striplib +-striplib=$lt_striplib ++ case $host_cpu in ++ hppa*64*|ia64*) ++ _LT_TAGVAR(hardcode_direct, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; ++ *) ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + +-# Dependencies to place before the objects being linked to create a +-# shared library. +-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) ++ # hardcode_minus_L: Not really in the search PATH, ++ # but as the default location of the library. ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ ;; ++ esac ++ fi ++ ;; + +-# Dependencies to place after the objects being linked to create a +-# shared library. +-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) ++ irix5* | irix6* | nonstopux*) ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ # Try to use the -exported_symbol ld option, if it does not ++ # work, assume that -exports_file does not work either and ++ # implicitly export all symbols. ++ save_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" ++ AC_LINK_IFELSE(int foo(void) {}, ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ++ ) ++ LDFLAGS="$save_LDFLAGS" ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' ++ fi ++ _LT_TAGVAR(archive_cmds_need_lc, $1)='no' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ _LT_TAGVAR(inherit_rpath, $1)=yes ++ _LT_TAGVAR(link_all_deplibs, $1)=yes ++ ;; + +-# Dependencies to place before the objects being linked to create a +-# shared library. +-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) ++ netbsd*) ++ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF ++ fi ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# Dependencies to place after the objects being linked to create a +-# shared library. +-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) ++ newsos6) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# The library search path used internally by the compiler when linking +-# a shared library. +-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) ++ *nto* | *qnx*) ++ ;; + +-# Method to check whether dependent libraries are shared objects. +-deplibs_check_method=$lt_deplibs_check_method ++ openbsd*) ++ if test -f /usr/libexec/ld.so; then ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes ++ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ else ++ case $host_os in ++ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ ;; ++ esac ++ fi ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; + +-# Command to use when deplibs_check_method == file_magic. +-file_magic_cmd=$lt_file_magic_cmd ++ os2*) ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' ++ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ++ ;; + +-# Flag that allows shared libraries with undefined symbols to be built. +-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) ++ osf3*) ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ else ++ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' ++ fi ++ _LT_TAGVAR(archive_cmds_need_lc, $1)='no' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ ;; + +-# Flag that forces no undefined symbols. +-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) ++ osf4* | osf5*) # as osf3* with the addition of -msym flag ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ else ++ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ ++ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + +-# Commands used to finish a libtool library installation in a directory. +-finish_cmds=$lt_finish_cmds ++ # Both c and cxx compiler support -rpath directly ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ++ fi ++ _LT_TAGVAR(archive_cmds_need_lc, $1)='no' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ ;; + +-# Same as above, but a single script fragment to be evaled but not shown. +-finish_eval=$lt_finish_eval ++ solaris*) ++ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' ++ if test "$GCC" = yes; then ++ wlarc='${wl}' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ else ++ case `$CC -V 2>&1` in ++ *"Compilers 5.0"*) ++ wlarc='' ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ++ ;; ++ *) ++ wlarc='${wl}' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ ;; ++ esac ++ fi ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ case $host_os in ++ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; ++ *) ++ # The compiler driver will combine and reorder linker options, ++ # but understands `-z linker_flag'. GCC discards it without `$wl', ++ # but is careful enough not to reorder. ++ # Supported since Solaris 2.6 (maybe 2.5.1?) ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ++ else ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ++ fi ++ ;; ++ esac ++ _LT_TAGVAR(link_all_deplibs, $1)=yes ++ ;; + +-# Take the output of nm and produce a listing of raw symbols and C names. +-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe ++ sunos4*) ++ if test "x$host_vendor" = xsequent; then ++ # Use $CC to link under sequent, because it throws in some extra .o ++ # files that make .init and .fini sections work. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' ++ fi ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# Transform the output of nm in a proper C declaration +-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl ++ sysv4) ++ case $host_vendor in ++ sni) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ++ ;; ++ siemens) ++ ## LD is ld it makes a PLAMLIB ++ ## CC just makes a GrossModule. ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' ++ _LT_TAGVAR(hardcode_direct, $1)=no ++ ;; ++ motorola) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ++ ;; ++ esac ++ runpath_var='LD_RUN_PATH' ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# Transform the output of nm in a C name address pair +-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address ++ sysv4.3*) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ++ ;; + +-# This is the shared library runtime path variable. +-runpath_var=$runpath_var ++ sysv4*MP*) ++ if test -d /usr/nec; then ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ runpath_var=LD_RUN_PATH ++ hardcode_runpath_var=yes ++ _LT_TAGVAR(ld_shlibs, $1)=yes ++ fi ++ ;; + +-# This is the shared library path variable. +-shlibpath_var=$shlibpath_var ++ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) ++ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ runpath_var='LD_RUN_PATH' + +-# Is shlibpath searched before the hard-coded library search path? +-shlibpath_overrides_runpath=$shlibpath_overrides_runpath ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ fi ++ ;; + +-# How to hardcode a shared library path into an executable. +-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) ++ sysv5* | sco3.2v5* | sco5v6*) ++ # Note: We can NOT use -z defs as we might desire, because we do not ++ # link with -lc, and that would cause any symbols used from libc to ++ # always be unresolved, which means just about no library would ++ # ever link correctly. If we're not using GNU ld we use -z text ++ # though, which does catch some bad symbols but isn't as heavy-handed ++ # as -z defs. ++ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' ++ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=':' ++ _LT_TAGVAR(link_all_deplibs, $1)=yes ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' ++ runpath_var='LD_RUN_PATH' + +-# Whether we should hardcode library paths into libraries. +-hardcode_into_libs=$hardcode_into_libs ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ fi ++ ;; + +-# Flag to hardcode \$libdir into a binary during linking. +-# This must work even if \$libdir does not exist. +-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) ++ uts4*) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# If ld is used when linking, flag to hardcode \$libdir into +-# a binary during linking. This must work even if \$libdir does +-# not exist. +-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) ++ *) ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ esac + +-# Whether we need a single -rpath flag with a separated argument. +-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) ++ if test x$host_vendor = xsni; then ++ case $host in ++ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ++ ;; ++ esac ++ fi ++ fi ++]) ++AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) ++test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +-# resulting binary. +-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) ++_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +-# resulting binary. +-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) ++_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl ++_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl ++_LT_DECL([], [extract_expsyms_cmds], [2], ++ [The commands to extract the exported symbol list from a shared archive]) + +-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +-# the resulting binary. +-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) ++# ++# Do we need to explicitly link libc? ++# ++case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in ++x|xyes) ++ # Assume -lc should be added ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + +-# Set to yes if building a shared library automatically hardcodes DIR into the library +-# and all subsequent libraries and executables linked against it. +-hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) ++ if test "$enable_shared" = yes && test "$GCC" = yes; then ++ case $_LT_TAGVAR(archive_cmds, $1) in ++ *'~'*) ++ # FIXME: we may have to deal with multi-command sequences. ++ ;; ++ '$CC '*) ++ # Test whether the compiler implicitly links with -lc since on some ++ # systems, -lgcc has to come before -lc. If gcc already passes -lc ++ # to ld, don't add -lc before -lgcc. ++ AC_MSG_CHECKING([whether -lc should be explicitly linked in]) ++ $RM conftest* ++ echo "$lt_simple_compile_test_code" > conftest.$ac_ext + +-# Variables whose values should be saved in libtool wrapper scripts and +-# restored at relink time. +-variables_saved_for_relink="$variables_saved_for_relink" ++ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then ++ soname=conftest ++ lib=conftest ++ libobjs=conftest.$ac_objext ++ deplibs= ++ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) ++ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) ++ compiler_flags=-v ++ linker_flags=-v ++ verstring= ++ output_objdir=. ++ libname=conftest ++ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) ++ _LT_TAGVAR(allow_undefined_flag, $1)= ++ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) ++ then ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ else ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes ++ fi ++ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag ++ else ++ cat conftest.err 1>&5 ++ fi ++ $RM conftest* ++ AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ++ ;; ++ esac ++ fi ++ ;; ++esac + +-# Whether libtool must link a program against all its dependency libraries. +-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) ++_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], ++ [Whether or not to add -lc for building shared libraries]) ++_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], ++ [enable_shared_with_static_runtimes], [0], ++ [Whether or not to disallow shared libs when runtime libs are static]) ++_LT_TAGDECL([], [export_dynamic_flag_spec], [1], ++ [Compiler flag to allow reflexive dlopens]) ++_LT_TAGDECL([], [whole_archive_flag_spec], [1], ++ [Compiler flag to generate shared objects directly from archives]) ++_LT_TAGDECL([], [compiler_needs_object], [1], ++ [Whether the compiler copes with passing no objects directly]) ++_LT_TAGDECL([], [old_archive_from_new_cmds], [2], ++ [Create an old-style archive from a shared archive]) ++_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], ++ [Create a temporary old-style archive to link instead of a shared archive]) ++_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) ++_LT_TAGDECL([], [archive_expsym_cmds], [2]) ++_LT_TAGDECL([], [module_cmds], [2], ++ [Commands used to build a loadable module if different from building ++ a shared archive.]) ++_LT_TAGDECL([], [module_expsym_cmds], [2]) ++_LT_TAGDECL([], [with_gnu_ld], [1], ++ [Whether we are building with GNU ld or not]) ++_LT_TAGDECL([], [allow_undefined_flag], [1], ++ [Flag that allows shared libraries with undefined symbols to be built]) ++_LT_TAGDECL([], [no_undefined_flag], [1], ++ [Flag that enforces no undefined symbols]) ++_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], ++ [Flag to hardcode $libdir into a binary during linking. ++ This must work even if $libdir does not exist]) ++_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], ++ [[If ld is used when linking, flag to hardcode $libdir into a binary ++ during linking. This must work even if $libdir does not exist]]) ++_LT_TAGDECL([], [hardcode_libdir_separator], [1], ++ [Whether we need a single "-rpath" flag with a separated argument]) ++_LT_TAGDECL([], [hardcode_direct], [0], ++ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes ++ DIR into the resulting binary]) ++_LT_TAGDECL([], [hardcode_direct_absolute], [0], ++ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes ++ DIR into the resulting binary and the resulting library dependency is ++ "absolute", i.e impossible to change by setting ${shlibpath_var} if the ++ library is relocated]) ++_LT_TAGDECL([], [hardcode_minus_L], [0], ++ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR ++ into the resulting binary]) ++_LT_TAGDECL([], [hardcode_shlibpath_var], [0], ++ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR ++ into the resulting binary]) ++_LT_TAGDECL([], [hardcode_automatic], [0], ++ [Set to "yes" if building a shared library automatically hardcodes DIR ++ into the library and all subsequent libraries and executables linked ++ against it]) ++_LT_TAGDECL([], [inherit_rpath], [0], ++ [Set to yes if linker adds runtime paths of dependent libraries ++ to runtime path list]) ++_LT_TAGDECL([], [link_all_deplibs], [0], ++ [Whether libtool must link a program against all its dependency libraries]) ++_LT_TAGDECL([], [fix_srcfile_path], [1], ++ [Fix the shell variable $srcfile for the compiler]) ++_LT_TAGDECL([], [always_export_symbols], [0], ++ [Set to "yes" if exported symbols are required]) ++_LT_TAGDECL([], [export_symbols_cmds], [2], ++ [The commands to list exported symbols]) ++_LT_TAGDECL([], [exclude_expsyms], [1], ++ [Symbols that should not be listed in the preloaded symbols]) ++_LT_TAGDECL([], [include_expsyms], [1], ++ [Symbols that must always be exported]) ++_LT_TAGDECL([], [prelink_cmds], [2], ++ [Commands necessary for linking programs (against libraries) with templates]) ++_LT_TAGDECL([], [file_list_spec], [1], ++ [Specify filename containing input files]) ++dnl FIXME: Not yet implemented ++dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], ++dnl [Compiler flag to generate thread safe objects]) ++])# _LT_LINKER_SHLIBS + +-# Compile-time system search path for libraries +-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +-# Run-time system search path for libraries +-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec ++# _LT_LANG_C_CONFIG([TAG]) ++# ------------------------ ++# Ensure that the configuration variables for a C compiler are suitably ++# defined. These variables are subsequently used by _LT_CONFIG to write ++# the compiler configuration to `libtool'. ++m4_defun([_LT_LANG_C_CONFIG], ++[m4_require([_LT_DECL_EGREP])dnl ++lt_save_CC="$CC" ++AC_LANG_PUSH(C) + +-# Fix the shell variable \$srcfile for the compiler. +-fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" ++# Source file extension for C test sources. ++ac_ext=c + +-# Set to yes if exported symbols are required. +-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) ++# Object file extension for compiled C test sources. ++objext=o ++_LT_TAGVAR(objext, $1)=$objext + +-# The commands to list exported symbols. +-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) ++# Code to be used in simple compile tests ++lt_simple_compile_test_code="int some_variable = 0;" + +-# The commands to extract the exported symbol list from a shared archive. +-extract_expsyms_cmds=$lt_extract_expsyms_cmds ++# Code to be used in simple link tests ++lt_simple_link_test_code='int main(){return(0);}' + +-# Symbols that should not be listed in the preloaded symbols. +-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) ++_LT_TAG_COMPILER ++# Save the default compiler, since it gets overwritten when the other ++# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. ++compiler_DEFAULT=$CC + +-# Symbols that must always be exported. +-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ++# save warnings/boilerplate of simple test code ++_LT_COMPILER_BOILERPLATE ++_LT_LINKER_BOILERPLATE + +-ifelse([$1],[], +-[# ### END LIBTOOL CONFIG], +-[# ### END LIBTOOL TAG CONFIG: $tagname]) ++## CAVEAT EMPTOR: ++## There is no encapsulation within the following macros, do not change ++## the running order or otherwise move them around unless you know exactly ++## what you are doing... ++if test -n "$compiler"; then ++ _LT_COMPILER_NO_RTTI($1) ++ _LT_COMPILER_PIC($1) ++ _LT_COMPILER_C_O($1) ++ _LT_COMPILER_FILE_LOCKS($1) ++ _LT_LINKER_SHLIBS($1) ++ _LT_SYS_DYNAMIC_LINKER($1) ++ _LT_LINKER_HARDCODE_LIBPATH($1) ++ LT_SYS_DLOPEN_SELF ++ _LT_CMD_STRIPLIB ++ ++ # Report which library types will actually be built ++ AC_MSG_CHECKING([if libtool supports shared libraries]) ++ AC_MSG_RESULT([$can_build_shared]) + +-__EOF__ ++ AC_MSG_CHECKING([whether to build shared libraries]) ++ test "$can_build_shared" = "no" && enable_shared=no + +-ifelse([$1],[], [ ++ # On AIX, shared libraries and static libraries use the same namespace, and ++ # are all built from PIC. + case $host_os in + aix3*) +- cat <<\EOF >> "$cfgfile" ++ test "$enable_shared" = yes && enable_static=no ++ if test -n "$RANLIB"; then ++ archive_cmds="$archive_cmds~\$RANLIB \$lib" ++ postinstall_cmds='$RANLIB $lib' ++ fi ++ ;; + +-# AIX sometimes has problems with the GCC collect2 program. For some +-# reason, if we set the COLLECT_NAMES environment variable, the problems +-# vanish in a puff of smoke. +-if test "X${COLLECT_NAMES+set}" != Xset; then +- COLLECT_NAMES= +- export COLLECT_NAMES +-fi +-EOF ++ aix[[4-9]]*) ++ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then ++ test "$enable_shared" = yes && enable_static=no ++ fi + ;; + esac ++ AC_MSG_RESULT([$enable_shared]) + +- # We use sed instead of cat because bash on DJGPP gets confused if +- # if finds mixed CR/LF and LF-only lines. Since sed operates in +- # text mode, it properly converts lines to CR/LF. This bash problem +- # is reportedly fixed, but why not run on old versions too? +- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) ++ AC_MSG_CHECKING([whether to build static libraries]) ++ # Make sure either enable_shared or enable_static is yes. ++ test "$enable_shared" = yes || enable_static=yes ++ AC_MSG_RESULT([$enable_static]) + +- mv -f "$cfgfile" "$ofile" || \ +- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") +- chmod +x "$ofile" +-]) +-else +- # If there is no Makefile yet, we rely on a make rule to execute +- # `config.status --recheck' to rerun these tests and create the +- # libtool script then. +- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` +- if test -f "$ltmain_in"; then +- test -f Makefile && make "$ltmain" +- fi ++ _LT_CONFIG($1) + fi +-])# AC_LIBTOOL_CONFIG +- +- +-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +-# ------------------------------------------- +-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +- +-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= ++AC_LANG_POP ++CC="$lt_save_CC" ++])# _LT_LANG_C_CONFIG + +-if test "$GCC" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + +- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], +- lt_cv_prog_compiler_rtti_exceptions, +- [-fno-rtti -fno-exceptions], [], +- [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) ++# _LT_PROG_CXX ++# ------------ ++# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ ++# compiler, we have our own version here. ++m4_defun([_LT_PROG_CXX], ++[ ++pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) ++AC_PROG_CXX ++if test -n "$CXX" && ( test "X$CXX" != "Xno" && ++ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || ++ (test "X$CXX" != "Xg++"))) ; then ++ AC_PROG_CXXCPP ++else ++ _lt_caught_CXX_error=yes + fi +-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI ++popdef([AC_MSG_ERROR]) ++])# _LT_PROG_CXX + ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([_LT_PROG_CXX], []) + +-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +-# --------------------------------- +-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +-[AC_REQUIRE([AC_CANONICAL_HOST]) +-AC_REQUIRE([AC_PROG_NM]) +-AC_REQUIRE([AC_OBJEXT]) +-# Check for command to grab the raw symbol name followed by C symbol from nm. +-AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +-[ +-# These are sane defaults that work on at least a few old systems. +-# [They come from Ultrix. What could be older than Ultrix?!! ;)] +- +-# Character class describing NM global symbol codes. +-symcode='[[BCDEGRST]]' + +-# Regexp to match symbols that can be accessed directly from C. +-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' ++# _LT_LANG_CXX_CONFIG([TAG]) ++# -------------------------- ++# Ensure that the configuration variables for a C++ compiler are suitably ++# defined. These variables are subsequently used by _LT_CONFIG to write ++# the compiler configuration to `libtool'. ++m4_defun([_LT_LANG_CXX_CONFIG], ++[AC_REQUIRE([_LT_PROG_CXX])dnl ++m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++m4_require([_LT_DECL_EGREP])dnl ++ ++AC_LANG_PUSH(C++) ++_LT_TAGVAR(archive_cmds_need_lc, $1)=no ++_LT_TAGVAR(allow_undefined_flag, $1)= ++_LT_TAGVAR(always_export_symbols, $1)=no ++_LT_TAGVAR(archive_expsym_cmds, $1)= ++_LT_TAGVAR(compiler_needs_object, $1)=no ++_LT_TAGVAR(export_dynamic_flag_spec, $1)= ++_LT_TAGVAR(hardcode_direct, $1)=no ++_LT_TAGVAR(hardcode_direct_absolute, $1)=no ++_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= ++_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= ++_LT_TAGVAR(hardcode_libdir_separator, $1)= ++_LT_TAGVAR(hardcode_minus_L, $1)=no ++_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported ++_LT_TAGVAR(hardcode_automatic, $1)=no ++_LT_TAGVAR(inherit_rpath, $1)=no ++_LT_TAGVAR(module_cmds, $1)= ++_LT_TAGVAR(module_expsym_cmds, $1)= ++_LT_TAGVAR(link_all_deplibs, $1)=unknown ++_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ++_LT_TAGVAR(no_undefined_flag, $1)= ++_LT_TAGVAR(whole_archive_flag_spec, $1)= ++_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +-# Transform an extracted symbol line into a proper C declaration +-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" ++# Source file extension for C++ test sources. ++ac_ext=cpp + +-# Transform an extracted symbol line into symbol name and symbol address +-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ++# Object file extension for compiled C++ test sources. ++objext=o ++_LT_TAGVAR(objext, $1)=$objext + +-# Define system-specific variables. +-case $host_os in +-aix*) +- symcode='[[BCDT]]' +- ;; +-cygwin* | mingw* | pw32*) +- symcode='[[ABCDGISTW]]' +- ;; +-hpux*) # Its linker distinguishes data from code symbols +- if test "$host_cpu" = ia64; then +- symcode='[[ABCDEGRST]]' ++# No sense in running all these tests if we already determined that ++# the CXX compiler isn't working. Some variables (like enable_shared) ++# are currently assumed to apply to all compilers on this platform, ++# and will be corrupted by setting them based on a non-working compiler. ++if test "$_lt_caught_CXX_error" != yes; then ++ # Code to be used in simple compile tests ++ lt_simple_compile_test_code="int some_variable = 0;" ++ ++ # Code to be used in simple link tests ++ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' ++ ++ # ltmain only uses $CC for tagged configurations so make sure $CC is set. ++ _LT_TAG_COMPILER ++ ++ # save warnings/boilerplate of simple test code ++ _LT_COMPILER_BOILERPLATE ++ _LT_LINKER_BOILERPLATE ++ ++ # Allow CC to be a program name with arguments. ++ lt_save_CC=$CC ++ lt_save_LD=$LD ++ lt_save_GCC=$GCC ++ GCC=$GXX ++ lt_save_with_gnu_ld=$with_gnu_ld ++ lt_save_path_LD=$lt_cv_path_LD ++ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then ++ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx ++ else ++ $as_unset lt_cv_prog_gnu_ld + fi +- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" +- ;; +-linux*) +- if test "$host_cpu" = ia64; then +- symcode='[[ABCDGIRSTW]]' +- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ++ if test -n "${lt_cv_path_LDCXX+set}"; then ++ lt_cv_path_LD=$lt_cv_path_LDCXX ++ else ++ $as_unset lt_cv_path_LD + fi +- ;; +-irix* | nonstopux*) +- symcode='[[BCDEGRST]]' +- ;; +-osf*) +- symcode='[[BCDEGQRST]]' +- ;; +-solaris*) +- symcode='[[BDRT]]' +- ;; +-sco3.2v5*) +- symcode='[[DT]]' +- ;; +-sysv4.2uw2*) +- symcode='[[DT]]' +- ;; +-sysv5* | sco5v6* | unixware* | OpenUNIX*) +- symcode='[[ABDT]]' +- ;; +-sysv4) +- symcode='[[DFNSTU]]' +- ;; +-esac +- +-# Handle CRLF in mingw tool chain +-opt_cr= +-case $build_os in +-mingw*) +- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp +- ;; +-esac +- +-# If we're using GNU nm, then use its standard symbol codes. +-case `$NM -V 2>&1` in +-*GNU* | *'with BFD'*) +- symcode='[[ABCDGIRSTW]]' ;; +-esac +- +-# Try without a prefix undercore, then with it. +-for ac_symprfx in "" "_"; do +- +- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. +- symxfrm="\\1 $ac_symprfx\\2 \\2" +- +- # Write the raw and C identifiers. +- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" +- +- # Check to see that the pipe works correctly. +- pipe_works=no +- +- rm -f conftest* +- cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then +- # Try sorting and uniquifying the output. +- if sort "$nlist" | uniq > "$nlist"T; then +- mv -f "$nlist"T "$nlist" +- else +- rm -f "$nlist"T +- fi +- +- # Make sure that we snagged all the symbols we need. +- if grep ' nm_test_var$' "$nlist" >/dev/null; then +- if grep ' nm_test_func$' "$nlist" >/dev/null; then +- cat < conftest.$ac_ext +-#ifdef __cplusplus +-extern "C" { +-#endif +- +-EOF +- # Now generate the symbol file. +- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' +- +- cat <> conftest.$ac_ext +-#if defined (__STDC__) && __STDC__ +-# define lt_ptr_t void * +-#else +-# define lt_ptr_t char * +-# define const +-#endif +- +-/* The mapping between symbol names and symbols. */ +-const struct { +- const char *name; +- lt_ptr_t address; +-} +-lt_preloaded_symbols[[]] = +-{ +-EOF +- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext +- cat <<\EOF >> conftest.$ac_ext +- {0, (lt_ptr_t) 0} +-}; ++ test -z "${LDCXX+set}" || LD=$LDCXX ++ CC=${CXX-"c++"} ++ compiler=$CC ++ _LT_TAGVAR(compiler, $1)=$CC ++ _LT_CC_BASENAME([$compiler]) + +-#ifdef __cplusplus +-} +-#endif +-EOF +- # Now try linking the two files. +- mv conftest.$ac_objext conftstm.$ac_objext +- lt_save_LIBS="$LIBS" +- lt_save_CFLAGS="$CFLAGS" +- LIBS="conftstm.$ac_objext" +- CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" +- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then +- pipe_works=yes +- fi +- LIBS="$lt_save_LIBS" +- CFLAGS="$lt_save_CFLAGS" +- else +- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD +- fi +- else +- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD +- fi ++ if test -n "$compiler"; then ++ # We don't want -fno-exception when compiling C++ code, so set the ++ # no_builtin_flag separately ++ if test "$GXX" = yes; then ++ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else +- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD ++ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi +- else +- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD +- cat conftest.$ac_ext >&5 +- fi +- rm -f conftest* conftst* +- +- # Do not use the global_symbol_pipe unless it works. +- if test "$pipe_works" = yes; then +- break +- else +- lt_cv_sys_global_symbol_pipe= +- fi +-done +-]) +-if test -z "$lt_cv_sys_global_symbol_pipe"; then +- lt_cv_sys_global_symbol_to_cdecl= +-fi +-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then +- AC_MSG_RESULT(failed) +-else +- AC_MSG_RESULT(ok) +-fi +-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + ++ if test "$GXX" = yes; then ++ # Set up default GNU C++ configuration + +-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +-# --------------------------------------- +-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= ++ LT_PATH_LD + +-AC_MSG_CHECKING([for $compiler option to produce PIC]) +- ifelse([$1],[CXX],[ +- # C++ specific cases for pic, static, wl, etc. +- if test "$GXX" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ++ # Check if GNU C++ uses GNU ld as the underlying linker, since the ++ # archiving commands below assume that GNU ld is being used. ++ if test "$with_gnu_ld" = yes; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ ++ # If archive_cmds runs LD, not CC, wlarc should be empty ++ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to ++ # investigate it a little bit more. (MM) ++ wlarc='${wl}' ++ ++ # ancient GNU ld didn't support --whole-archive et. al. ++ if eval "`$CC -print-prog-name=ld` --help 2>&1" | ++ $GREP 'no-whole-archive' > /dev/null; then ++ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' ++ else ++ _LT_TAGVAR(whole_archive_flag_spec, $1)= ++ fi ++ else ++ with_gnu_ld=no ++ wlarc= + +- case $host_os in +- aix*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; +- amigaos*) +- # FIXME: we need at least 68020 code to build shared libraries, but +- # adding the `-m68020' flag to GCC prevents building anything better, +- # like `-m68040'. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' +- ;; +- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) +- # PIC is the default for these OSes. +- ;; +- mingw* | cygwin* | os2* | pw32*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- # Although the cygwin gcc ignores -fPIC, still need this for old-style +- # (--disable-auto-import) libraries +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' +- ;; +- darwin* | rhapsody*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' +- ;; +- *djgpp*) +- # DJGPP does not support shared libraries at all +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- ;; +- interix3*) +- # Interix 3.x gcc -fpic/-fPIC options generate broken code. +- # Instead, we relocate shared libraries at runtime. +- ;; +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic ++ # A generic and very simple default shared library creation ++ # command for GNU C++ for the case where it uses the native ++ # linker, instead of GNU ld. If possible, this setting should ++ # overridden to take advantage of the native linker features on ++ # the platform it is being used on. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi +- ;; +- hpux*) +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- else ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' ++ ++ else ++ GXX=no ++ with_gnu_ld=no ++ wlarc= ++ fi ++ ++ # PORTME: fill in a description of your system's C++ link characteristics ++ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ++ _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in +- aix4* | aix5*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ aix3*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ aix[[4-9]]*) ++ if test "$host_cpu" = ia64; then ++ # On IA64, the linker does run time linking by default, so we don't ++ # have to do anything special. ++ aix_use_runtimelinking=no ++ exp_sym_flag='-Bexport' ++ no_entry_flag="" ++ else ++ aix_use_runtimelinking=no ++ ++ # Test if we are trying to use run time linking or normal ++ # AIX style linking. If -brtl is somewhere in LDFLAGS, we ++ # need to do runtime linking. ++ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) ++ for ld_flag in $LDFLAGS; do ++ case $ld_flag in ++ *-brtl*) ++ aix_use_runtimelinking=yes ++ break ++ ;; ++ esac ++ done ++ ;; ++ esac ++ ++ exp_sym_flag='-bexport' ++ no_entry_flag='-bnoentry' ++ fi ++ ++ # When large executables or shared objects are built, AIX ld can ++ # have problems creating the table of contents. If linking a library ++ # or program results in "error TOC overflow" add -mminimal-toc to ++ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not ++ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. ++ ++ _LT_TAGVAR(archive_cmds, $1)='' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=':' ++ _LT_TAGVAR(link_all_deplibs, $1)=yes ++ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' ++ ++ if test "$GXX" = yes; then ++ case $host_os in aix4.[[012]]|aix4.[[012]].*) ++ # We only want to do this on AIX 4.2 and lower, the check ++ # below for broken collect2 doesn't work under 4.3+ ++ collect2name=`${CC} -print-prog-name=collect2` ++ if test -f "$collect2name" && ++ strings "$collect2name" | $GREP resolve_lib_name >/dev/null ++ then ++ # We have reworked collect2 ++ : ++ else ++ # We have old collect2 ++ _LT_TAGVAR(hardcode_direct, $1)=unsupported ++ # It fails to find uninstalled libraries when the uninstalled ++ # path is not listed in the libpath. Setting hardcode_minus_L ++ # to unsupported forces relinking ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)= ++ fi ++ esac ++ shared_flag='-shared' ++ if test "$aix_use_runtimelinking" = yes; then ++ shared_flag="$shared_flag "'${wl}-G' ++ fi ++ else ++ # not using gcc ++ if test "$host_cpu" = ia64; then ++ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release ++ # chokes on -Wl,-G. The following line is correct: ++ shared_flag='-G' ++ else ++ if test "$aix_use_runtimelinking" = yes; then ++ shared_flag='${wl}-G' ++ else ++ shared_flag='${wl}-bM:SRE' ++ fi ++ fi ++ fi ++ ++ # It seems that -bexpall does not export symbols beginning with ++ # underscore (_), so it is better to generate a list of symbols to ++ # export. ++ _LT_TAGVAR(always_export_symbols, $1)=yes ++ if test "$aix_use_runtimelinking" = yes; then ++ # Warning - without using the other runtime loading flags (-brtl), ++ # -berok will link without error, but may produce a broken library. ++ _LT_TAGVAR(allow_undefined_flag, $1)='-berok' ++ # Determine the default libpath from the value encoded in an empty ++ # executable. ++ _LT_SYS_MODULE_PATH_AIX ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" ++ ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" ++ else ++ if test "$host_cpu" = ia64; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' ++ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" ++ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" ++ else ++ # Determine the default libpath from the value encoded in an ++ # empty executable. ++ _LT_SYS_MODULE_PATH_AIX ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" ++ # Warning - without using the other run time loading flags, ++ # -berok will link without error, but may produce a broken library. ++ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' ++ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' ++ # Exported symbols can be pulled into shared objects from archives ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes ++ # This is similar to how AIX traditionally builds its shared ++ # libraries. ++ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' ++ fi ++ fi ++ ;; ++ ++ beos*) ++ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ # Joseph Beckenbach says some releases of gcc ++ # support --undefined. This deserves some investigation. FIXME ++ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' ++ _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; ++ + chorus*) +- case $cc_basename in +- cxch68*) +- # Green Hills C++ Compiler +- # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ++ case $cc_basename in ++ *) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no + ;; +- esac ++ esac ++ ;; ++ ++ cygwin* | mingw* | pw32*) ++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, ++ # as there is no search path for DLLs. ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ _LT_TAGVAR(always_export_symbols, $1)=no ++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ++ ++ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ # If the export-symbols file already is a .def file (1st line ++ # is EXPORTS), use it as is; otherwise, prepend... ++ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ cp $export_symbols $output_objdir/$soname.def; ++ else ++ echo EXPORTS > $output_objdir/$soname.def; ++ cat $export_symbols >> $output_objdir/$soname.def; ++ fi~ ++ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; ++ darwin* | rhapsody*) ++ _LT_DARWIN_LINKER_FEATURES($1) + ;; +- darwin*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- case $cc_basename in +- xlc*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- ;; +- esac +- ;; ++ + dgux*) +- case $cc_basename in +- ec++*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ case $cc_basename in ++ ec++*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no + ;; +- ghcx*) ++ ghcx*) + # Green Hills C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no + ;; +- *) ++ *) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no + ;; +- esac +- ;; +- freebsd* | kfreebsd*-gnu | dragonfly*) +- # FreeBSD uses GNU C++ +- ;; +- hpux9* | hpux10* | hpux11*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' +- if test "$host_cpu" != ia64; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- fi ++ esac ++ ;; ++ ++ freebsd[[12]]*) ++ # C++ shared libraries reported to be fairly broken before ++ # switch to ELF ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ ++ freebsd-elf*) ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ ;; ++ ++ freebsd* | dragonfly*) ++ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF ++ # conventions ++ _LT_TAGVAR(ld_shlibs, $1)=yes ++ ;; ++ ++ gnu*) ++ ;; ++ ++ hpux9*) ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, ++ # but as the default ++ # location of the library. ++ ++ case $cc_basename in ++ CC*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ aCC*) ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ++ ;; ++ *) ++ if test "$GXX" = yes; then ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ else ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; ++ esac ++ ;; ++ ++ hpux10*|hpux11*) ++ if test $with_gnu_ld = no; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ ++ case $host_cpu in ++ hppa*64*|ia64*) ++ ;; ++ *) ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ ;; ++ esac ++ fi ++ case $host_cpu in ++ hppa*64*|ia64*) ++ _LT_TAGVAR(hardcode_direct, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; ++ *) ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, ++ # but as the default ++ # location of the library. ++ ;; ++ esac ++ ++ case $cc_basename in ++ CC*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no + ;; +- aCC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ++ aCC*) + case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- ;; ++ hppa*64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ ia64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; + esac ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; +- *) ++ *) ++ if test "$GXX" = yes; then ++ if test $with_gnu_ld = no; then ++ case $host_cpu in ++ hppa*64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ ia64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ esac ++ fi ++ else ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi + ;; +- esac +- ;; +- interix*) +- # This is c89, which is MS Visual C++ (no shared libs) +- # Anyone wants to do a port? +- ;; +- irix5* | irix6* | nonstopux*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- # CC pic flag -KPIC is the default. ++ esac ++ ;; ++ ++ interix[[3-9]]*) ++ _LT_TAGVAR(hardcode_direct, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. ++ # Instead, shared libraries are loaded at an image base (0x10000000 by ++ # default) and relocated if they conflict, which is a slow very memory ++ # consuming and fragmenting process. To avoid this, we pick a random, ++ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link ++ # time. Moving up from 0x10000000 also allows more sbrk(2) space. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ ;; ++ irix5* | irix6*) ++ case $cc_basename in ++ CC*) ++ # SGI C++ ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' ++ ++ # Archives containing C++ object files must be created using ++ # "CC -ar", where "CC" is the IRIX C++ compiler. This is ++ # necessary to make sure instantiated templates are included ++ # in the archive. ++ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; +- *) ++ *) ++ if test "$GXX" = yes; then ++ if test "$with_gnu_ld" = no; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' ++ fi ++ fi ++ _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; +- esac +- ;; +- linux*) +- case $cc_basename in +- KCC*) +- # KAI C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ esac ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ _LT_TAGVAR(inherit_rpath, $1)=yes ++ ;; ++ ++ linux* | k*bsd*-gnu) ++ case $cc_basename in ++ KCC*) ++ # Kuck and Associates, Inc. (KAI) C++ Compiler ++ ++ # KCC will only create a shared library if the output file ++ # ends with ".so" (or ".sl" for HP-UX), so rename the library ++ # to its proper name (with version) after linking. ++ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ ++ # Archives containing C++ object files must be created using ++ # "CC -Bstatic", where "CC" is the KAI C++ compiler. ++ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; +- icpc* | ecpc*) ++ icpc* | ecpc* ) + # Intel C++ +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- ;; +- pgCC*) +- # Portland Group C++ compiler. +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- cxx*) +- # Compaq C++ +- # Make sure the PIC flag is empty. It appears that all Alpha +- # Linux and Compaq Tru64 Unix objects are PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ with_gnu_ld=yes ++ # version 8.0 and above of icpc choke on multiply defined symbols ++ # if we add $predep_objects and $postdep_objects, however 7.1 and ++ # earlier do not add the objects themselves. ++ case `$CC -V 2>&1` in ++ *"Version 7."*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ ;; ++ *) # Version 8.0 or newer ++ tmp_idyn= ++ case $host_cpu in ++ ia64*) tmp_idyn=' -i_dynamic';; ++ esac ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ ;; ++ esac ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; +- *) +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) +- # Sun C++ 5.9 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ++ pgCC* | pgcpp*) ++ # Portland Group C++ compiler ++ case `$CC -V` in ++ *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) ++ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ ++ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' ++ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ ++ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ ++ $RANLIB $oldlib' ++ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ ++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ ++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ++ ;; ++ *) # Version 6 will use weak symbols ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac +- ;; +- esac +- ;; +- lynxos*) +- ;; +- m88k*) +- ;; +- mvs*) +- case $cc_basename in +- cxx*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' +- ;; +- *) +- ;; +- esac +- ;; +- netbsd*) +- ;; +- osf3* | osf4* | osf5*) +- case $cc_basename in +- KCC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- ;; ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ++ ;; + cxx*) +- # Digital/Compaq C++ +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # Make sure the PIC flag is empty. It appears that all Alpha +- # Linux and Compaq Tru64 Unix objects are PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- *) +- ;; +- esac +- ;; +- psos*) +- ;; +- solaris*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.2, 5.x and Centerline C++ +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' +- ;; +- gcx*) +- # Green Hills C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' +- ;; +- *) +- ;; +- esac +- ;; +- sunos4*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.x +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- lcc*) +- # Lucid +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- ;; +- *) ++ # Compaq C++ ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' ++ ++ runpath_var=LD_RUN_PATH ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; +- esac +- ;; +- tandem*) +- case $cc_basename in +- NCC*) +- # NonStop-UX NCC 3.20 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ xl*) ++ # IBM XL 8.0 on PPC, with GNU ld ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ if test "x$supports_anon_versioning" = xyes; then ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ ++ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ ++ echo "local: *; };" >> $output_objdir/$libname.ver~ ++ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' ++ fi + ;; + *) ++ case `$CC -V 2>&1 | sed 5q` in ++ *Sun\ C*) ++ # Sun C++ 5.9 ++ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ++ _LT_TAGVAR(compiler_needs_object, $1)=yes ++ ++ # Not sure whether something based on ++ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 ++ # would be better. ++ output_verbose_link_cmd='echo' ++ ++ # Archives containing C++ object files must be created using ++ # "CC -xar", where "CC" is the Sun C++ compiler. This is ++ # necessary to make sure instantiated templates are included ++ # in the archive. ++ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ++ ;; ++ esac + ;; + esac + ;; +- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ++ lynxos*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ ++ m88k*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ ++ mvs*) ++ case $cc_basename in ++ cxx*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ *) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; +- vxworks*) ++ ++ netbsd*) ++ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' ++ wlarc= ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ fi ++ # Workaround some broken pre-1.5 toolchains ++ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ++ ++ *nto* | *qnx*) ++ _LT_TAGVAR(ld_shlibs, $1)=yes + ;; +- esac +- fi +-], +-[ +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + +- case $host_os in +- aix*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; ++ openbsd2*) ++ # C++ shared libraries are fairly broken ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ ++ openbsd*) ++ if test -f /usr/libexec/ld.so; then ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' ++ fi ++ output_verbose_link_cmd=echo ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; + +- amigaos*) +- # FIXME: we need at least 68020 code to build shared libraries, but +- # adding the `-m68020' flag to GCC prevents building anything better, +- # like `-m68040'. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' +- ;; ++ osf3* | osf4* | osf5*) ++ case $cc_basename in ++ KCC*) ++ # Kuck and Associates, Inc. (KAI) C++ Compiler ++ ++ # KCC will only create a shared library if the output file ++ # ends with ".so" (or ".sl" for HP-UX), so rename the library ++ # to its proper name (with version) after linking. ++ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ ++ # Archives containing C++ object files must be created using ++ # the KAI C++ compiler. ++ case $host in ++ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; ++ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; ++ esac ++ ;; ++ RCC*) ++ # Rational C++ 2.4.1 ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ cxx*) ++ case $host in ++ osf3*) ++ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ ;; ++ *) ++ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ ++ echo "-hidden">> $lib.exp~ ++ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ ++ $RM $lib.exp' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ++ ;; ++ esac + +- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) +- # PIC is the default for these OSes. +- ;; ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: + +- mingw* | cygwin* | pw32* | os2*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- # Although the cygwin gcc ignores -fPIC, still need this for old-style +- # (--disable-auto-import) libraries +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' +- ;; ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ++ ;; ++ *) ++ if test "$GXX" = yes && test "$with_gnu_ld" = no; then ++ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' ++ case $host in ++ osf3*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ ;; ++ esac ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' ++ ++ else ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; ++ esac ++ ;; + +- darwin* | rhapsody*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' +- ;; ++ psos*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; + +- interix3*) +- # Interix 3.x gcc -fpic/-fPIC options generate broken code. +- # Instead, we relocate shared libraries at runtime. +- ;; ++ sunos4*) ++ case $cc_basename in ++ CC*) ++ # Sun C++ 4.x ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ lcc*) ++ # Lucid ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ *) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ esac ++ ;; + +- msdosdjgpp*) +- # Just because we use GCC doesn't mean we suddenly get shared libraries +- # on systems that don't support them. +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- enable_shared=no +- ;; ++ solaris*) ++ case $cc_basename in ++ CC*) ++ # Sun C++ 4.2, 5.x and Centerline C++ ++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes ++ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ case $host_os in ++ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; ++ *) ++ # The compiler driver will combine and reorder linker options, ++ # but understands `-z linker_flag'. ++ # Supported since Solaris 2.6 (maybe 2.5.1?) ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ++ ;; ++ esac ++ _LT_TAGVAR(link_all_deplibs, $1)=yes + +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic +- fi +- ;; ++ output_verbose_link_cmd='echo' + +- hpux*) +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- ;; ++ # Archives containing C++ object files must be created using ++ # "CC -xar", where "CC" is the Sun C++ compiler. This is ++ # necessary to make sure instantiated templates are included ++ # in the archive. ++ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ++ ;; ++ gcx*) ++ # Green Hills C++ Compiler ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- else +- # PORTME Check for flag to pass linker flags through the system compiler. +- case $host_os in +- aix*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- else +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' +- fi +- ;; +- darwin*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- case $cc_basename in +- xlc*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- ;; +- esac +- ;; ++ # The C++ compiler must be used to create the archive. ++ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ++ ;; ++ *) ++ # GNU C++ compiler with Solaris linker ++ if test "$GXX" = yes && test "$with_gnu_ld" = no; then ++ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' ++ if $CC --version | $GREP -v '^2\.7' > /dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' ++ else ++ # g++ 2.7 appears to require `-G' NOT `-shared' on this ++ # platform. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' ++ fi ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' ++ case $host_os in ++ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; ++ *) ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ++ ;; ++ esac ++ fi ++ ;; ++ esac ++ ;; + +- mingw* | cygwin* | pw32* | os2*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- # Although the cygwin gcc ignores -fPIC, still need this for old-style +- # (--disable-auto-import) libraries +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' +- ;; ++ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) ++ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ runpath_var='LD_RUN_PATH' + +- hpux9* | hpux10* | hpux11*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- ;; ++ case $cc_basename in ++ CC*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; + esac +- # Is there a better lt_prog_compiler_static that works with the bundled CC? +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + +- irix5* | irix6* | nonstopux*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # PIC (with -KPIC) is the default. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; ++ sysv5* | sco3.2v5* | sco5v6*) ++ # Note: We can NOT use -z defs as we might desire, because we do not ++ # link with -lc, and that would cause any symbols used from libc to ++ # always be unresolved, which means just about no library would ++ # ever link correctly. If we're not using GNU ld we use -z text ++ # though, which does catch some bad symbols but isn't as heavy-handed ++ # as -z defs. ++ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' ++ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=':' ++ _LT_TAGVAR(link_all_deplibs, $1)=yes ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' ++ runpath_var='LD_RUN_PATH' + +- newsos6) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ case $cc_basename in ++ CC*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ esac + ;; + +- linux*) +- case $cc_basename in +- icc* | ecc*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- ;; +- pgcc* | pgf77* | pgf90* | pgf95*) +- # Portland Group compilers (*not* the Pentium gcc compiler, +- # which looks to be a dead project) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- ccc*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # All Alpha code is PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ tandem*) ++ case $cc_basename in ++ NCC*) ++ # NonStop-UX NCC 3.20 ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ *) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ esac + ;; +- como) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-lopt=' ++ ++ vxworks*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no + ;; ++ + *) +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) +- # Sun C 5.9 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- ;; +- *Sun\ F*) +- # Sun Fortran 8.3 passes all unrecognized flags to the linker +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' +- ;; +- esac +- ;; +- esac +- ;; ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ esac + +- osf3* | osf4* | osf5*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # All OSF/1 code is PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; ++ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) ++ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +- solaris*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- case $cc_basename in +- f77* | f90* | f95*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; +- esac +- ;; ++ _LT_TAGVAR(GCC, $1)="$GXX" ++ _LT_TAGVAR(LD, $1)="$LD" ++ ++ ## CAVEAT EMPTOR: ++ ## There is no encapsulation within the following macros, do not change ++ ## the running order or otherwise move them around unless you know exactly ++ ## what you are doing... ++ _LT_SYS_HIDDEN_LIBDEPS($1) ++ _LT_COMPILER_PIC($1) ++ _LT_COMPILER_C_O($1) ++ _LT_COMPILER_FILE_LOCKS($1) ++ _LT_LINKER_SHLIBS($1) ++ _LT_SYS_DYNAMIC_LINKER($1) ++ _LT_LINKER_HARDCODE_LIBPATH($1) ++ ++ _LT_CONFIG($1) ++ fi # test -n "$compiler" ++ ++ CC=$lt_save_CC ++ LDCXX=$LD ++ LD=$lt_save_LD ++ GCC=$lt_save_GCC ++ with_gnu_ld=$lt_save_with_gnu_ld ++ lt_cv_path_LDCXX=$lt_cv_path_LD ++ lt_cv_path_LD=$lt_save_path_LD ++ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld ++ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ++fi # test "$_lt_caught_CXX_error" != yes ++ ++AC_LANG_POP ++])# _LT_LANG_CXX_CONFIG ++ ++ ++# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) ++# --------------------------------- ++# Figure out "hidden" library dependencies from verbose ++# compiler output when linking a shared library. ++# Parse the compiler output and extract the necessary ++# objects, libraries and library flags. ++m4_defun([_LT_SYS_HIDDEN_LIBDEPS], ++[m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++# Dependencies to place before and after the object being linked: ++_LT_TAGVAR(predep_objects, $1)= ++_LT_TAGVAR(postdep_objects, $1)= ++_LT_TAGVAR(predeps, $1)= ++_LT_TAGVAR(postdeps, $1)= ++_LT_TAGVAR(compiler_lib_search_path, $1)= ++ ++dnl we can't use the lt_simple_compile_test_code here, ++dnl because it contains code intended for an executable, ++dnl not a library. It's possible we should let each ++dnl tag define a new lt_????_link_test_code variable, ++dnl but it's only used here... ++m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF ++int a; ++void foo (void) { a = 0; } ++_LT_EOF ++], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF ++class Foo ++{ ++public: ++ Foo (void) { a = 0; } ++private: ++ int a; ++}; ++_LT_EOF ++], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF ++ subroutine foo ++ implicit none ++ integer*4 a ++ a=0 ++ return ++ end ++_LT_EOF ++], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF ++ subroutine foo ++ implicit none ++ integer a ++ a=0 ++ return ++ end ++_LT_EOF ++], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF ++public class foo { ++ private int a; ++ public void bar (void) { ++ a = 0; ++ } ++}; ++_LT_EOF ++]) ++dnl Parse the compiler output and extract the necessary ++dnl objects, libraries and library flags. ++if AC_TRY_EVAL(ac_compile); then ++ # Parse the compiler output and extract the necessary ++ # objects, libraries and library flags. ++ ++ # Sentinel used to keep track of whether or not we are before ++ # the conftest object file. ++ pre_test_object_deps_done=no + +- sunos4*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; ++ for p in `eval "$output_verbose_link_cmd"`; do ++ case $p in + +- sysv4 | sysv4.2uw2* | sysv4.3*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; ++ -L* | -R* | -l*) ++ # Some compilers place space between "-{L,R}" and the path. ++ # Remove the space. ++ if test $p = "-L" || ++ test $p = "-R"; then ++ prev=$p ++ continue ++ else ++ prev= ++ fi + +- sysv4*MP*) +- if test -d /usr/nec ;then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; ++ if test "$pre_test_object_deps_done" = no; then ++ case $p in ++ -L* | -R*) ++ # Internal compiler library paths should come after those ++ # provided the user. The postdeps already come after the ++ # user supplied libs so there is no need to process them. ++ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then ++ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" ++ else ++ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" ++ fi ++ ;; ++ # The "-l" case would never come before the object being ++ # linked, so don't bother handling this case. ++ esac ++ else ++ if test -z "$_LT_TAGVAR(postdeps, $1)"; then ++ _LT_TAGVAR(postdeps, $1)="${prev}${p}" ++ else ++ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" ++ fi ++ fi ++ ;; + +- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; ++ *.$objext) ++ # This assumes that the test object file only shows up ++ # once in the compiler output. ++ if test "$p" = "conftest.$objext"; then ++ pre_test_object_deps_done=yes ++ continue ++ fi + +- unicos*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- ;; ++ if test "$pre_test_object_deps_done" = no; then ++ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then ++ _LT_TAGVAR(predep_objects, $1)="$p" ++ else ++ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" ++ fi ++ else ++ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then ++ _LT_TAGVAR(postdep_objects, $1)="$p" ++ else ++ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" ++ fi ++ fi ++ ;; + +- uts4*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; ++ *) ;; # Ignore the rest. + +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- ;; + esac +- fi +-]) +-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) ++ done + +-# +-# Check to make sure the PIC flag actually works. +-# +-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then +- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], +- _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), +- [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], +- [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in +- "" | " "*) ;; +- *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; +- esac], +- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) ++ # Clean up. ++ rm -f a.out a.exe ++else ++ echo "libtool.m4: error: problem compiling $1 test program" + fi +-case $host_os in +- # For platforms which do not support PIC, -DPIC is meaningless: +- *djgpp*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" +- ;; +-esac +- +-# +-# Check to make sure the static flag actually works. +-# +-wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], +- _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), +- $lt_tmp_static_flag, +- [], +- [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +-]) + ++$RM -f confest.$objext + +-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +-# ------------------------------------ +-# See if the linker supports building shared libraries. +-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +-ifelse([$1],[CXX],[ +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- case $host_os in +- aix4* | aix5*) +- # If we're using GNU nm, then we don't want the "-C" option. +- # -C means demangle to AIX nm, but means don't demangle with GNU nm +- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- else +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- fi +- ;; +- pw32*) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" +- ;; +- cygwin* | mingw*) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' +- ;; +- *) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ++# PORTME: override above test on systems where it is broken ++m4_if([$1], [CXX], ++[case $host_os in ++interix[[3-9]]*) ++ # Interix 3.5 installs completely hosed .la files for C++, so rather than ++ # hack all around it, let's just trust "g++" to DTRT. ++ _LT_TAGVAR(predep_objects,$1)= ++ _LT_TAGVAR(postdep_objects,$1)= ++ _LT_TAGVAR(postdeps,$1)= + ;; +- esac +-],[ +- runpath_var= +- _LT_AC_TAGVAR(allow_undefined_flag, $1)= +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +- _LT_AC_TAGVAR(archive_cmds, $1)= +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)= +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= +- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +- _LT_AC_TAGVAR(hardcode_automatic, $1)=no +- _LT_AC_TAGVAR(module_cmds, $1)= +- _LT_AC_TAGVAR(module_expsym_cmds, $1)= +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- # include_expsyms should be a list of space-separated symbols to be *always* +- # included in the symbol list +- _LT_AC_TAGVAR(include_expsyms, $1)= +- # exclude_expsyms can be an extended regexp of symbols to exclude +- # it will be wrapped by ` (' and `)$', so one must not match beginning or +- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', +- # as well as any symbol that contains `d'. +- _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" +- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out +- # platforms (ab)use it in PIC code, but their linkers get confused if +- # the symbol is explicitly referenced. Since portable code cannot +- # rely on this symbol name, it's probably fine to never include it in +- # preloaded symbol tables. +- extract_expsyms_cmds= +- # Just being paranoid about ensuring that cc_basename is set. +- _LT_CC_BASENAME([$compiler]) +- case $host_os in +- cygwin* | mingw* | pw32*) +- # FIXME: the MSVC++ port hasn't been tested in a loooong time +- # When not using gcc, we currently assume that we are using +- # Microsoft Visual C++. +- if test "$GCC" != yes; then +- with_gnu_ld=no +- fi +- ;; +- interix*) +- # we just hope/assume this is gcc and not c89 (= MSVC++) +- with_gnu_ld=yes +- ;; +- openbsd*) +- with_gnu_ld=no +- ;; +- esac +- +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- if test "$with_gnu_ld" = yes; then +- # If archive_cmds runs LD, not CC, wlarc should be empty +- wlarc='${wl}' +- +- # Set some defaults for GNU ld with shared library support. These +- # are reset later if shared libraries are not supported. Putting them +- # here allows them to be overridden if necessary. +- runpath_var=LD_RUN_PATH +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- # ancient GNU ld didn't support --whole-archive et. al. +- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' +- else +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- supports_anon_versioning=no +- case `$LD -v 2>/dev/null` in +- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 +- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... +- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... +- *\ 2.11.*) ;; # other 2.11 versions +- *) supports_anon_versioning=yes ;; +- esac +- +- # See if GNU ld supports shared libraries. +- case $host_os in +- aix3* | aix4* | aix5*) +- # On AIX/PPC, the GNU linker is very broken +- if test "$host_cpu" != ia64; then +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <&2 +- +-*** Warning: the GNU linker, at least up to release 2.9.1, is reported +-*** to be unable to reliably create shared libraries on AIX. +-*** Therefore, libtool is disabling shared libraries support. If you +-*** really care for shared libraries, you may want to modify your PATH +-*** so that a non-GNU linker is found, and then restart. +- +-EOF +- fi +- ;; + +- amigaos*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- +- # Samuel A. Falvo II reports +- # that the semantics of dynamic libraries on AmigaOS, at least up +- # to version 4, is to share data among multiple programs linked +- # with the same dynamic library. Since this doesn't match the +- # behavior of shared libraries on other platforms, we can't use +- # them. +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; ++linux*) ++ case `$CC -V 2>&1 | sed 5q` in ++ *Sun\ C*) ++ # Sun C++ 5.9 + +- beos*) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Joseph Beckenbach says some releases of gcc +- # support --undefined. This deserves some investigation. FIXME +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi ++ # The more standards-conforming stlport4 library is ++ # incompatible with the Cstd library. Avoid specifying ++ # it if it's in CXXFLAGS. Ignore libCrun as ++ # -library=stlport4 depends on it. ++ case " $CXX $CXXFLAGS " in ++ *" -library=stlport4 "*) ++ solaris_use_stlport4=yes + ;; ++ esac + +- cygwin* | mingw* | pw32*) +- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, +- # as there is no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' +- +- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; ++ if test "$solaris_use_stlport4" != yes; then ++ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' ++ fi ++ ;; ++ esac ++ ;; + +- interix3*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. +- # Instead, shared libraries are loaded at an image base (0x10000000 by +- # default) and relocated if they conflict, which is a slow very memory +- # consuming and fragmenting process. To avoid this, we pick a random, +- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link +- # time. Moving up from 0x10000000 also allows more sbrk(2) space. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++solaris*) ++ case $cc_basename in ++ CC*) ++ # The more standards-conforming stlport4 library is ++ # incompatible with the Cstd library. Avoid specifying ++ # it if it's in CXXFLAGS. Ignore libCrun as ++ # -library=stlport4 depends on it. ++ case " $CXX $CXXFLAGS " in ++ *" -library=stlport4 "*) ++ solaris_use_stlport4=yes + ;; ++ esac + +- linux*) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- tmp_addflag= +- case $cc_basename,$host_cpu in +- pgcc*) # Portland Group C compiler +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- tmp_addflag=' $pic_flag' +- ;; +- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- tmp_addflag=' $pic_flag -Mnomain' ;; +- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 +- tmp_addflag=' -i_dynamic' ;; +- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 +- tmp_addflag=' -i_dynamic -nofor_main' ;; +- ifc* | ifort*) # Intel Fortran compiler +- tmp_addflag=' -nofor_main' ;; +- esac +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) # Sun C 5.9 +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive /dev/null' +- tmp_sharedflag='-G' ;; +- *Sun\ F*) # Sun Fortran 8.3 +- tmp_sharedflag='-G' ;; +- *) +- tmp_sharedflag='-shared' ;; +- esac +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ # Adding this requires a known-good setup of shared libraries for ++ # Sun compiler versions before 5.6, else PIC objects from an old ++ # archive will be linked into the output, leading to subtle bugs. ++ if test "$solaris_use_stlport4" != yes; then ++ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' ++ fi ++ ;; ++ esac ++ ;; ++esac ++]) + +- if test $supports_anon_versioning = yes; then +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ +- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +- $echo "local: *; };" >> $output_objdir/$libname.ver~ +- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' +- fi +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; ++case " $_LT_TAGVAR(postdeps, $1) " in ++*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; ++esac ++ _LT_TAGVAR(compiler_lib_search_dirs, $1)= ++if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then ++ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` ++fi ++_LT_TAGDECL([], [compiler_lib_search_dirs], [1], ++ [The directories searched by this compiler when creating a shared library]) ++_LT_TAGDECL([], [predep_objects], [1], ++ [Dependencies to place before and after the objects being linked to ++ create a shared library]) ++_LT_TAGDECL([], [postdep_objects], [1]) ++_LT_TAGDECL([], [predeps], [1]) ++_LT_TAGDECL([], [postdeps], [1]) ++_LT_TAGDECL([], [compiler_lib_search_path], [1], ++ [The library search path used internally by the compiler when linking ++ a shared library]) ++])# _LT_SYS_HIDDEN_LIBDEPS ++ ++ ++# _LT_PROG_F77 ++# ------------ ++# Since AC_PROG_F77 is broken, in that it returns the empty string ++# if there is no fortran compiler, we have our own version here. ++m4_defun([_LT_PROG_F77], ++[ ++pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) ++AC_PROG_F77 ++if test -z "$F77" || test "X$F77" = "Xno"; then ++ _lt_disable_F77=yes ++fi ++popdef([AC_MSG_ERROR]) ++])# _LT_PROG_F77 + +- netbsd*) +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' +- wlarc= +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- fi +- ;; ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([_LT_PROG_F77], []) + +- solaris*) +- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <&2 + +-*** Warning: The releases 2.8.* of the GNU linker cannot reliably +-*** create shared libraries on Solaris systems. Therefore, libtool +-*** is disabling shared libraries support. We urge you to upgrade GNU +-*** binutils to release 2.9.1 or newer. Another option is to modify +-*** your PATH or compiler configuration so that the native linker is +-*** used, and then restart. ++# _LT_LANG_F77_CONFIG([TAG]) ++# -------------------------- ++# Ensure that the configuration variables for a Fortran 77 compiler are ++# suitably defined. These variables are subsequently used by _LT_CONFIG ++# to write the compiler configuration to `libtool'. ++m4_defun([_LT_LANG_F77_CONFIG], ++[AC_REQUIRE([_LT_PROG_F77])dnl ++AC_LANG_PUSH(Fortran 77) + +-EOF +- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; ++_LT_TAGVAR(archive_cmds_need_lc, $1)=no ++_LT_TAGVAR(allow_undefined_flag, $1)= ++_LT_TAGVAR(always_export_symbols, $1)=no ++_LT_TAGVAR(archive_expsym_cmds, $1)= ++_LT_TAGVAR(export_dynamic_flag_spec, $1)= ++_LT_TAGVAR(hardcode_direct, $1)=no ++_LT_TAGVAR(hardcode_direct_absolute, $1)=no ++_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= ++_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= ++_LT_TAGVAR(hardcode_libdir_separator, $1)= ++_LT_TAGVAR(hardcode_minus_L, $1)=no ++_LT_TAGVAR(hardcode_automatic, $1)=no ++_LT_TAGVAR(inherit_rpath, $1)=no ++_LT_TAGVAR(module_cmds, $1)= ++_LT_TAGVAR(module_expsym_cmds, $1)= ++_LT_TAGVAR(link_all_deplibs, $1)=unknown ++_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ++_LT_TAGVAR(no_undefined_flag, $1)= ++_LT_TAGVAR(whole_archive_flag_spec, $1)= ++_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) +- case `$LD -v 2>&1` in +- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <<_LT_EOF 1>&2 ++# Source file extension for f77 test sources. ++ac_ext=f + +-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +-*** reliably create shared libraries on SCO systems. Therefore, libtool +-*** is disabling shared libraries support. We urge you to upgrade GNU +-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +-*** your PATH or compiler configuration so that the native linker is +-*** used, and then restart. ++# Object file extension for compiled f77 test sources. ++objext=o ++_LT_TAGVAR(objext, $1)=$objext + +-_LT_EOF +- ;; +- *) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; ++# No sense in running all these tests if we already determined that ++# the F77 compiler isn't working. Some variables (like enable_shared) ++# are currently assumed to apply to all compilers on this platform, ++# and will be corrupted by setting them based on a non-working compiler. ++if test "$_lt_disable_F77" != yes; then ++ # Code to be used in simple compile tests ++ lt_simple_compile_test_code="\ ++ subroutine t ++ return ++ end ++" + +- sunos4*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- wlarc= +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++ # Code to be used in simple link tests ++ lt_simple_link_test_code="\ ++ program t ++ end ++" + +- *) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac ++ # ltmain only uses $CC for tagged configurations so make sure $CC is set. ++ _LT_TAG_COMPILER + +- if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then +- runpath_var= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- else +- # PORTME fill in a description of your system's linker (not GNU ld) +- case $host_os in +- aix3*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' +- # Note: this linker hardcodes the directories in LIBPATH if there +- # are no directories specified by -L. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then +- # Neither direct hardcoding nor static linking is supported with a +- # broken collect2. +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- fi +- ;; ++ # save warnings/boilerplate of simple test code ++ _LT_COMPILER_BOILERPLATE ++ _LT_LINKER_BOILERPLATE ++ ++ # Allow CC to be a program name with arguments. ++ lt_save_CC="$CC" ++ lt_save_GCC=$GCC ++ CC=${F77-"f77"} ++ compiler=$CC ++ _LT_TAGVAR(compiler, $1)=$CC ++ _LT_CC_BASENAME([$compiler]) ++ GCC=$G77 ++ if test -n "$compiler"; then ++ AC_MSG_CHECKING([if libtool supports shared libraries]) ++ AC_MSG_RESULT([$can_build_shared]) + +- aix4* | aix5*) +- if test "$host_cpu" = ia64; then +- # On IA64, the linker does run time linking by default, so we don't +- # have to do anything special. +- aix_use_runtimelinking=no +- exp_sym_flag='-Bexport' +- no_entry_flag="" +- else +- # If we're using GNU nm, then we don't want the "-C" option. +- # -C means demangle to AIX nm, but means don't demangle with GNU nm +- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- else +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' ++ AC_MSG_CHECKING([whether to build shared libraries]) ++ test "$can_build_shared" = "no" && enable_shared=no ++ ++ # On AIX, shared libraries and static libraries use the same namespace, and ++ # are all built from PIC. ++ case $host_os in ++ aix3*) ++ test "$enable_shared" = yes && enable_static=no ++ if test -n "$RANLIB"; then ++ archive_cmds="$archive_cmds~\$RANLIB \$lib" ++ postinstall_cmds='$RANLIB $lib' ++ fi ++ ;; ++ aix[[4-9]]*) ++ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then ++ test "$enable_shared" = yes && enable_static=no + fi +- aix_use_runtimelinking=no ++ ;; ++ esac ++ AC_MSG_RESULT([$enable_shared]) + +- # Test if we are trying to use run time linking or normal +- # AIX style linking. If -brtl is somewhere in LDFLAGS, we +- # need to do runtime linking. +- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) +- for ld_flag in $LDFLAGS; do +- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then +- aix_use_runtimelinking=yes +- break +- fi +- done +- ;; +- esac ++ AC_MSG_CHECKING([whether to build static libraries]) ++ # Make sure either enable_shared or enable_static is yes. ++ test "$enable_shared" = yes || enable_static=yes ++ AC_MSG_RESULT([$enable_static]) ++ ++ _LT_TAGVAR(GCC, $1)="$G77" ++ _LT_TAGVAR(LD, $1)="$LD" ++ ++ ## CAVEAT EMPTOR: ++ ## There is no encapsulation within the following macros, do not change ++ ## the running order or otherwise move them around unless you know exactly ++ ## what you are doing... ++ _LT_COMPILER_PIC($1) ++ _LT_COMPILER_C_O($1) ++ _LT_COMPILER_FILE_LOCKS($1) ++ _LT_LINKER_SHLIBS($1) ++ _LT_SYS_DYNAMIC_LINKER($1) ++ _LT_LINKER_HARDCODE_LIBPATH($1) ++ ++ _LT_CONFIG($1) ++ fi # test -n "$compiler" ++ ++ GCC=$lt_save_GCC ++ CC="$lt_save_CC" ++fi # test "$_lt_disable_F77" != yes + +- exp_sym_flag='-bexport' +- no_entry_flag='-bnoentry' +- fi ++AC_LANG_POP ++])# _LT_LANG_F77_CONFIG + +- # When large executables or shared objects are built, AIX ld can +- # have problems creating the table of contents. If linking a library +- # or program results in "error TOC overflow" add -mminimal-toc to +- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not +- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + +- _LT_AC_TAGVAR(archive_cmds, $1)='' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ++# _LT_PROG_FC ++# ----------- ++# Since AC_PROG_FC is broken, in that it returns the empty string ++# if there is no fortran compiler, we have our own version here. ++m4_defun([_LT_PROG_FC], ++[ ++pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) ++AC_PROG_FC ++if test -z "$FC" || test "X$FC" = "Xno"; then ++ _lt_disable_FC=yes ++fi ++popdef([AC_MSG_ERROR]) ++])# _LT_PROG_FC + +- if test "$GCC" = yes; then +- case $host_os in aix4.[[012]]|aix4.[[012]].*) +- # We only want to do this on AIX 4.2 and lower, the check +- # below for broken collect2 doesn't work under 4.3+ +- collect2name=`${CC} -print-prog-name=collect2` +- if test -f "$collect2name" && \ +- strings "$collect2name" | grep resolve_lib_name >/dev/null +- then +- # We have reworked collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- else +- # We have old collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- # It fails to find uninstalled libraries when the uninstalled +- # path is not listed in the libpath. Setting hardcode_minus_L +- # to unsupported forces relinking +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- fi +- ;; +- esac +- shared_flag='-shared' +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag="$shared_flag "'${wl}-G' +- fi +- else +- # not using gcc +- if test "$host_cpu" = ia64; then +- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release +- # chokes on -Wl,-G. The following line is correct: +- shared_flag='-G' +- else +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag='${wl}-G' +- else +- shared_flag='${wl}-bM:SRE' +- fi +- fi +- fi ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([_LT_PROG_FC], []) + +- # It seems that -bexpall does not export symbols beginning with +- # underscore (_), so it is better to generate a list of symbols to export. +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- if test "$aix_use_runtimelinking" = yes; then +- # Warning - without using the other runtime loading flags (-brtl), +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +- else +- if test "$host_cpu" = ia64; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" +- else +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- # Warning - without using the other run time loading flags, +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' +- # Exported symbols can be pulled into shared objects from archives +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- # This is similar to how AIX traditionally builds its shared libraries. +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' +- fi +- fi +- ;; + +- amigaos*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- # see comment about different semantics on the GNU ld section +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; ++# _LT_LANG_FC_CONFIG([TAG]) ++# ------------------------- ++# Ensure that the configuration variables for a Fortran compiler are ++# suitably defined. These variables are subsequently used by _LT_CONFIG ++# to write the compiler configuration to `libtool'. ++m4_defun([_LT_LANG_FC_CONFIG], ++[AC_REQUIRE([_LT_PROG_FC])dnl ++AC_LANG_PUSH(Fortran) ++ ++_LT_TAGVAR(archive_cmds_need_lc, $1)=no ++_LT_TAGVAR(allow_undefined_flag, $1)= ++_LT_TAGVAR(always_export_symbols, $1)=no ++_LT_TAGVAR(archive_expsym_cmds, $1)= ++_LT_TAGVAR(export_dynamic_flag_spec, $1)= ++_LT_TAGVAR(hardcode_direct, $1)=no ++_LT_TAGVAR(hardcode_direct_absolute, $1)=no ++_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= ++_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= ++_LT_TAGVAR(hardcode_libdir_separator, $1)= ++_LT_TAGVAR(hardcode_minus_L, $1)=no ++_LT_TAGVAR(hardcode_automatic, $1)=no ++_LT_TAGVAR(inherit_rpath, $1)=no ++_LT_TAGVAR(module_cmds, $1)= ++_LT_TAGVAR(module_expsym_cmds, $1)= ++_LT_TAGVAR(link_all_deplibs, $1)=unknown ++_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ++_LT_TAGVAR(no_undefined_flag, $1)= ++_LT_TAGVAR(whole_archive_flag_spec, $1)= ++_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +- bsdi[[45]]*) +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic +- ;; ++# Source file extension for fc test sources. ++ac_ext=${ac_fc_srcext-f} + +- cygwin* | mingw* | pw32*) +- # When not using gcc, we currently assume that we are using +- # Microsoft Visual C++. +- # hardcode_libdir_flag_spec is actually meaningless, as there is +- # no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Tell ltmain to make .lib files, not .a files. +- libext=lib +- # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" +- # FIXME: Setting linknames here is a bad hack. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' +- # The linker will automatically build a .lib file if we build a DLL. +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' +- # FIXME: Should let the user specify the lib program. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' +- _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- ;; ++# Object file extension for compiled fc test sources. ++objext=o ++_LT_TAGVAR(objext, $1)=$objext + +- darwin* | rhapsody*) +- case $host_os in +- rhapsody* | darwin1.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' +- ;; +- *) # Darwin 1.3 on +- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- else +- case ${MACOSX_DEPLOYMENT_TARGET} in +- 10.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- ;; +- 10.*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' +- ;; +- esac +- fi +- ;; +- esac +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- if test "$GCC" = yes ; then +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- else +- case $cc_basename in +- xlc*) +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- ;; +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +- ;; ++# No sense in running all these tests if we already determined that ++# the FC compiler isn't working. Some variables (like enable_shared) ++# are currently assumed to apply to all compilers on this platform, ++# and will be corrupted by setting them based on a non-working compiler. ++if test "$_lt_disable_FC" != yes; then ++ # Code to be used in simple compile tests ++ lt_simple_compile_test_code="\ ++ subroutine t ++ return ++ end ++" + +- dgux*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++ # Code to be used in simple link tests ++ lt_simple_link_test_code="\ ++ program t ++ end ++" + +- freebsd1*) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; ++ # ltmain only uses $CC for tagged configurations so make sure $CC is set. ++ _LT_TAG_COMPILER + +- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor +- # support. Future versions do this automatically, but an explicit c++rt0.o +- # does not break anything, and helps significantly (at the cost of a little +- # extra space). +- freebsd2.2*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++ # save warnings/boilerplate of simple test code ++ _LT_COMPILER_BOILERPLATE ++ _LT_LINKER_BOILERPLATE ++ ++ # Allow CC to be a program name with arguments. ++ lt_save_CC="$CC" ++ lt_save_GCC=$GCC ++ CC=${FC-"f95"} ++ compiler=$CC ++ GCC=$ac_cv_fc_compiler_gnu + +- # Unfortunately, older versions of FreeBSD 2 do not have this feature. +- freebsd2*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++ _LT_TAGVAR(compiler, $1)=$CC ++ _LT_CC_BASENAME([$compiler]) + +- # FreeBSD 3 and greater uses gcc -shared to do shared libraries. +- freebsd* | kfreebsd*-gnu | dragonfly*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++ if test -n "$compiler"; then ++ AC_MSG_CHECKING([if libtool supports shared libraries]) ++ AC_MSG_RESULT([$can_build_shared]) + +- hpux9*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes ++ AC_MSG_CHECKING([whether to build shared libraries]) ++ test "$can_build_shared" = "no" && enable_shared=no + +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- ;; ++ # On AIX, shared libraries and static libraries use the same namespace, and ++ # are all built from PIC. ++ case $host_os in ++ aix3*) ++ test "$enable_shared" = yes && enable_static=no ++ if test -n "$RANLIB"; then ++ archive_cmds="$archive_cmds~\$RANLIB \$lib" ++ postinstall_cmds='$RANLIB $lib' ++ fi ++ ;; ++ aix[[4-9]]*) ++ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then ++ test "$enable_shared" = yes && enable_static=no ++ fi ++ ;; ++ esac ++ AC_MSG_RESULT([$enable_shared]) + +- hpux10*) +- if test "$GCC" = yes -a "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +- fi +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ++ AC_MSG_CHECKING([whether to build static libraries]) ++ # Make sure either enable_shared or enable_static is yes. ++ test "$enable_shared" = yes || enable_static=yes ++ AC_MSG_RESULT([$enable_static]) ++ ++ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" ++ _LT_TAGVAR(LD, $1)="$LD" ++ ++ ## CAVEAT EMPTOR: ++ ## There is no encapsulation within the following macros, do not change ++ ## the running order or otherwise move them around unless you know exactly ++ ## what you are doing... ++ _LT_SYS_HIDDEN_LIBDEPS($1) ++ _LT_COMPILER_PIC($1) ++ _LT_COMPILER_C_O($1) ++ _LT_COMPILER_FILE_LOCKS($1) ++ _LT_LINKER_SHLIBS($1) ++ _LT_SYS_DYNAMIC_LINKER($1) ++ _LT_LINKER_HARDCODE_LIBPATH($1) ++ ++ _LT_CONFIG($1) ++ fi # test -n "$compiler" ++ ++ GCC=$lt_save_GCC ++ CC="$lt_save_CC" ++fi # test "$_lt_disable_FC" != yes + +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++AC_LANG_POP ++])# _LT_LANG_FC_CONFIG + +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- fi +- ;; + +- hpux11*) +- if test "$GCC" = yes -a "$with_gnu_ld" = no; then +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- else +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- fi +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ++# _LT_LANG_GCJ_CONFIG([TAG]) ++# -------------------------- ++# Ensure that the configuration variables for the GNU Java Compiler compiler ++# are suitably defined. These variables are subsequently used by _LT_CONFIG ++# to write the compiler configuration to `libtool'. ++m4_defun([_LT_LANG_GCJ_CONFIG], ++[AC_REQUIRE([LT_PROG_GCJ])dnl ++AC_LANG_SAVE + +- case $host_cpu in +- hppa*64*|ia64*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- *) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++# Source file extension for Java test sources. ++ac_ext=java + +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- ;; +- esac +- fi +- ;; ++# Object file extension for compiled Java test sources. ++objext=o ++_LT_TAGVAR(objext, $1)=$objext + +- irix5* | irix6* | nonstopux*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; ++# Code to be used in simple compile tests ++lt_simple_compile_test_code="class foo {}" + +- netbsd*) +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++# Code to be used in simple link tests ++lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +- newsos6) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++# ltmain only uses $CC for tagged configurations so make sure $CC is set. ++_LT_TAG_COMPILER ++ ++# save warnings/boilerplate of simple test code ++_LT_COMPILER_BOILERPLATE ++_LT_LINKER_BOILERPLATE ++ ++# Allow CC to be a program name with arguments. ++lt_save_CC="$CC" ++lt_save_GCC=$GCC ++GCC=yes ++CC=${GCJ-"gcj"} ++compiler=$CC ++_LT_TAGVAR(compiler, $1)=$CC ++_LT_TAGVAR(LD, $1)="$LD" ++_LT_CC_BASENAME([$compiler]) + +- openbsd*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- else +- case $host_os in +- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- ;; +- esac +- fi +- ;; ++# GCJ did not exist at the time GCC didn't implicitly link libc in. ++_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +- os2*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' +- ;; ++_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + +- osf3*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- ;; ++## CAVEAT EMPTOR: ++## There is no encapsulation within the following macros, do not change ++## the running order or otherwise move them around unless you know exactly ++## what you are doing... ++if test -n "$compiler"; then ++ _LT_COMPILER_NO_RTTI($1) ++ _LT_COMPILER_PIC($1) ++ _LT_COMPILER_C_O($1) ++ _LT_COMPILER_FILE_LOCKS($1) ++ _LT_LINKER_SHLIBS($1) ++ _LT_LINKER_HARDCODE_LIBPATH($1) + +- osf4* | osf5*) # as osf3* with the addition of -msym flag +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- else +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ +- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' ++ _LT_CONFIG($1) ++fi + +- # Both c and cxx compiler support -rpath directly +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- ;; ++AC_LANG_RESTORE + +- solaris*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' +- if test "$GCC" = yes; then +- wlarc='${wl}' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' +- else +- wlarc='' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- case $host_os in +- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; +- *) +- # The compiler driver will combine linker options so we +- # cannot just pass the convience library names through +- # without $wl, iff we do not link with $LD. +- # Luckily, gcc supports the same syntax we need for Sun Studio. +- # Supported since Solaris 2.6 (maybe 2.5.1?) +- case $wlarc in +- '') +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; +- *) +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; +- esac ;; +- esac +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; ++GCC=$lt_save_GCC ++CC="$lt_save_CC" ++])# _LT_LANG_GCJ_CONFIG + +- sunos4*) +- if test "x$host_vendor" = xsequent; then +- # Use $CC to link under sequent, because it throws in some extra .o +- # files that make .init and .fini sections work. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; + +- sysv4) +- case $host_vendor in +- sni) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? +- ;; +- siemens) +- ## LD is ld it makes a PLAMLIB +- ## CC just makes a GrossModule. +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- ;; +- motorola) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie +- ;; +- esac +- runpath_var='LD_RUN_PATH' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++# _LT_LANG_RC_CONFIG([TAG]) ++# ------------------------- ++# Ensure that the configuration variables for the Windows resource compiler ++# are suitably defined. These variables are subsequently used by _LT_CONFIG ++# to write the compiler configuration to `libtool'. ++m4_defun([_LT_LANG_RC_CONFIG], ++[AC_REQUIRE([LT_PROG_RC])dnl ++AC_LANG_SAVE + +- sysv4.3*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' +- ;; ++# Source file extension for RC test sources. ++ac_ext=rc + +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var=LD_RUN_PATH +- hardcode_runpath_var=yes +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- fi +- ;; ++# Object file extension for compiled RC test sources. ++objext=o ++_LT_TAGVAR(objext, $1)=$objext + +- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var='LD_RUN_PATH' ++# Code to be used in simple compile tests ++lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- fi +- ;; ++# Code to be used in simple link tests ++lt_simple_link_test_code="$lt_simple_compile_test_code" + +- sysv5* | sco3.2v5* | sco5v6*) +- # Note: We can NOT use -z defs as we might desire, because we do not +- # link with -lc, and that would cause any symbols used from libc to +- # always be unresolved, which means just about no library would +- # ever link correctly. If we're not using GNU ld we use -z text +- # though, which does catch some bad symbols but isn't as heavy-handed +- # as -z defs. +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' +- runpath_var='LD_RUN_PATH' ++# ltmain only uses $CC for tagged configurations so make sure $CC is set. ++_LT_TAG_COMPILER + +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- fi +- ;; ++# save warnings/boilerplate of simple test code ++_LT_COMPILER_BOILERPLATE ++_LT_LINKER_BOILERPLATE + +- uts4*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++# Allow CC to be a program name with arguments. ++lt_save_CC="$CC" ++lt_save_GCC=$GCC ++GCC= ++CC=${RC-"windres"} ++compiler=$CC ++_LT_TAGVAR(compiler, $1)=$CC ++_LT_CC_BASENAME([$compiler]) ++_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +-]) +-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no ++if test -n "$compiler"; then ++ : ++ _LT_CONFIG($1) ++fi + +-# +-# Do we need to explicitly link libc? +-# +-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +-x|xyes) +- # Assume -lc should be added +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes ++GCC=$lt_save_GCC ++AC_LANG_RESTORE ++CC="$lt_save_CC" ++])# _LT_LANG_RC_CONFIG + +- if test "$enable_shared" = yes && test "$GCC" = yes; then +- case $_LT_AC_TAGVAR(archive_cmds, $1) in +- *'~'*) +- # FIXME: we may have to deal with multi-command sequences. +- ;; +- '$CC '*) +- # Test whether the compiler implicitly links with -lc since on some +- # systems, -lgcc has to come before -lc. If gcc already passes -lc +- # to ld, don't add -lc before -lgcc. +- AC_MSG_CHECKING([whether -lc should be explicitly linked in]) +- $rm conftest* +- printf "$lt_simple_compile_test_code" > conftest.$ac_ext + +- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then +- soname=conftest +- lib=conftest +- libobjs=conftest.$ac_objext +- deplibs= +- wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) +- pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +- compiler_flags=-v +- linker_flags=-v +- verstring= +- output_objdir=. +- libname=conftest +- lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)= +- if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) +- then +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- else +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- fi +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag +- else +- cat conftest.err 1>&5 +- fi +- $rm conftest* +- AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) +- ;; +- esac +- fi +- ;; +-esac +-])# AC_LIBTOOL_PROG_LD_SHLIBS ++# LT_PROG_GCJ ++# ----------- ++AC_DEFUN([LT_PROG_GCJ], ++[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], ++ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], ++ [AC_CHECK_TOOL(GCJ, gcj,) ++ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" ++ AC_SUBST(GCJFLAGS)])])[]dnl ++]) + ++# Old name: ++AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + +-# _LT_AC_FILE_LTDLL_C +-# ------------------- +-# Be careful that the start marker always follows a newline. +-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +-# /* ltdll.c starts here */ +-# #define WIN32_LEAN_AND_MEAN +-# #include +-# #undef WIN32_LEAN_AND_MEAN +-# #include +-# +-# #ifndef __CYGWIN__ +-# # ifdef __CYGWIN32__ +-# # define __CYGWIN__ __CYGWIN32__ +-# # endif +-# #endif +-# +-# #ifdef __cplusplus +-# extern "C" { +-# #endif +-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +-# #ifdef __cplusplus +-# } +-# #endif +-# +-# #ifdef __CYGWIN__ +-# #include +-# DECLARE_CYGWIN_DLL( DllMain ); +-# #endif +-# HINSTANCE __hDllInstance_base; +-# +-# BOOL APIENTRY +-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +-# { +-# __hDllInstance_base = hInst; +-# return TRUE; +-# } +-# /* ltdll.c ends here */ +-])# _LT_AC_FILE_LTDLL_C + ++# LT_PROG_RC ++# ---------- ++AC_DEFUN([LT_PROG_RC], ++[AC_CHECK_TOOL(RC, windres,) ++]) + +-# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +-# --------------------------------- +-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) ++# Old name: ++AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +-# old names +-AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +-AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +-AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +-AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +-AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) +- +-# This is just to silence aclocal about the macro not being used +-ifelse([AC_DISABLE_FAST_INSTALL]) +- +-AC_DEFUN([LT_AC_PROG_GCJ], +-[AC_CHECK_TOOL(GCJ, gcj, no) +- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" +- AC_SUBST(GCJFLAGS) ++# _LT_DECL_EGREP ++# -------------- ++# If we don't have a new enough Autoconf to choose the best grep ++# available, choose the one first in the user's PATH. ++m4_defun([_LT_DECL_EGREP], ++[AC_REQUIRE([AC_PROG_EGREP])dnl ++AC_REQUIRE([AC_PROG_FGREP])dnl ++test -z "$GREP" && GREP=grep ++_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) ++_LT_DECL([], [EGREP], [1], [An ERE matcher]) ++_LT_DECL([], [FGREP], [1], [A literal string matcher]) ++dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too ++AC_SUBST([GREP]) + ]) + +-AC_DEFUN([LT_AC_PROG_RC], +-[AC_CHECK_TOOL(RC, windres, no) +-]) + ++# _LT_DECL_SED ++# ------------ ++# Check for a fully-functional sed program, that truncates ++# as few characters as possible. Prefer GNU sed if found. ++m4_defun([_LT_DECL_SED], ++[AC_PROG_SED ++test -z "$SED" && SED=sed ++Xsed="$SED -e 1s/^X//" ++_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) ++_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], ++ [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ++])# _LT_DECL_SED ++ ++m4_ifndef([AC_PROG_SED], [ + ############################################################ + # NOTE: This macro has been submitted for inclusion into # + # GNU Autoconf as AC_PROG_SED. When it is available in # + # a released version of Autoconf we should remove this # + # macro and use it instead. # + ############################################################ +-# LT_AC_PROG_SED +-# -------------- +-# Check for a fully-functional sed program, that truncates +-# as few characters as possible. Prefer GNU sed if found. +-AC_DEFUN([LT_AC_PROG_SED], ++ ++m4_defun([AC_PROG_SED], + [AC_MSG_CHECKING([for a sed that does not truncate output]) + AC_CACHE_VAL(lt_cv_path_SED, + [# Loop through the user's path and test for sed and gsed. +@@ -6435,6 +7010,7 @@ do + done + done + done ++IFS=$as_save_IFS + lt_ac_max=0 + lt_ac_count=0 + # Add /usr/xpg4/bin/sed as it is typically found on Solaris +@@ -6467,5 +7043,268 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xp + done + ]) + SED=$lt_cv_path_SED ++AC_SUBST([SED]) + AC_MSG_RESULT([$SED]) ++])#AC_PROG_SED ++])#m4_ifndef ++ ++# Old name: ++AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([LT_AC_PROG_SED], []) ++ ++ ++# _LT_CHECK_SHELL_FEATURES ++# ------------------------ ++# Find out whether the shell is Bourne or XSI compatible, ++# or has some other useful features. ++m4_defun([_LT_CHECK_SHELL_FEATURES], ++[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) ++# Try some XSI features ++xsi_shell=no ++( _lt_dummy="a/b/c" ++ test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ ++ = c,a/b,, \ ++ && eval 'test $(( 1 + 1 )) -eq 2 \ ++ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ ++ && xsi_shell=yes ++AC_MSG_RESULT([$xsi_shell]) ++_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) ++ ++AC_MSG_CHECKING([whether the shell understands "+="]) ++lt_shell_append=no ++( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ ++ >/dev/null 2>&1 \ ++ && lt_shell_append=yes ++AC_MSG_RESULT([$lt_shell_append]) ++_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) ++ ++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then ++ lt_unset=unset ++else ++ lt_unset=false ++fi ++_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl ++ ++# test EBCDIC or ASCII ++case `echo X|tr X '\101'` in ++ A) # ASCII based system ++ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr ++ lt_SP2NL='tr \040 \012' ++ lt_NL2SP='tr \015\012 \040\040' ++ ;; ++ *) # EBCDIC based system ++ lt_SP2NL='tr \100 \n' ++ lt_NL2SP='tr \r\n \100\100' ++ ;; ++esac ++_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl ++_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ++])# _LT_CHECK_SHELL_FEATURES ++ ++ ++# _LT_PROG_XSI_SHELLFNS ++# --------------------- ++# Bourne and XSI compatible variants of some useful shell functions. ++m4_defun([_LT_PROG_XSI_SHELLFNS], ++[case $xsi_shell in ++ yes) ++ cat << \_LT_EOF >> "$cfgfile" ++ ++# func_dirname file append nondir_replacement ++# Compute the dirname of FILE. If nonempty, add APPEND to the result, ++# otherwise set result to NONDIR_REPLACEMENT. ++func_dirname () ++{ ++ case ${1} in ++ */*) func_dirname_result="${1%/*}${2}" ;; ++ * ) func_dirname_result="${3}" ;; ++ esac ++} ++ ++# func_basename file ++func_basename () ++{ ++ func_basename_result="${1##*/}" ++} ++ ++# func_dirname_and_basename file append nondir_replacement ++# perform func_basename and func_dirname in a single function ++# call: ++# dirname: Compute the dirname of FILE. If nonempty, ++# add APPEND to the result, otherwise set result ++# to NONDIR_REPLACEMENT. ++# value returned in "$func_dirname_result" ++# basename: Compute filename of FILE. ++# value retuned in "$func_basename_result" ++# Implementation must be kept synchronized with func_dirname ++# and func_basename. For efficiency, we do not delegate to ++# those functions but instead duplicate the functionality here. ++func_dirname_and_basename () ++{ ++ case ${1} in ++ */*) func_dirname_result="${1%/*}${2}" ;; ++ * ) func_dirname_result="${3}" ;; ++ esac ++ func_basename_result="${1##*/}" ++} ++ ++# func_stripname prefix suffix name ++# strip PREFIX and SUFFIX off of NAME. ++# PREFIX and SUFFIX must not contain globbing or regex special ++# characters, hashes, percent signs, but SUFFIX may contain a leading ++# dot (in which case that matches only a dot). ++func_stripname () ++{ ++ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are ++ # positional parameters, so assign one to ordinary parameter first. ++ func_stripname_result=${3} ++ func_stripname_result=${func_stripname_result#"${1}"} ++ func_stripname_result=${func_stripname_result%"${2}"} ++} ++ ++# func_opt_split ++func_opt_split () ++{ ++ func_opt_split_opt=${1%%=*} ++ func_opt_split_arg=${1#*=} ++} ++ ++# func_lo2o object ++func_lo2o () ++{ ++ case ${1} in ++ *.lo) func_lo2o_result=${1%.lo}.${objext} ;; ++ *) func_lo2o_result=${1} ;; ++ esac ++} ++ ++# func_xform libobj-or-source ++func_xform () ++{ ++ func_xform_result=${1%.*}.lo ++} ++ ++# func_arith arithmetic-term... ++func_arith () ++{ ++ func_arith_result=$(( $[*] )) ++} ++ ++# func_len string ++# STRING may not start with a hyphen. ++func_len () ++{ ++ func_len_result=${#1} ++} ++ ++_LT_EOF ++ ;; ++ *) # Bourne compatible functions. ++ cat << \_LT_EOF >> "$cfgfile" ++ ++# func_dirname file append nondir_replacement ++# Compute the dirname of FILE. If nonempty, add APPEND to the result, ++# otherwise set result to NONDIR_REPLACEMENT. ++func_dirname () ++{ ++ # Extract subdirectory from the argument. ++ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` ++ if test "X$func_dirname_result" = "X${1}"; then ++ func_dirname_result="${3}" ++ else ++ func_dirname_result="$func_dirname_result${2}" ++ fi ++} ++ ++# func_basename file ++func_basename () ++{ ++ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` ++} ++ ++dnl func_dirname_and_basename ++dnl A portable version of this function is already defined in general.m4sh ++dnl so there is no need for it here. ++ ++# func_stripname prefix suffix name ++# strip PREFIX and SUFFIX off of NAME. ++# PREFIX and SUFFIX must not contain globbing or regex special ++# characters, hashes, percent signs, but SUFFIX may contain a leading ++# dot (in which case that matches only a dot). ++# func_strip_suffix prefix name ++func_stripname () ++{ ++ case ${2} in ++ .*) func_stripname_result=`$ECHO "X${3}" \ ++ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; ++ *) func_stripname_result=`$ECHO "X${3}" \ ++ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; ++ esac ++} ++ ++# sed scripts: ++my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' ++my_sed_long_arg='1s/^-[[^=]]*=//' ++ ++# func_opt_split ++func_opt_split () ++{ ++ func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` ++ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` ++} ++ ++# func_lo2o object ++func_lo2o () ++{ ++ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` ++} ++ ++# func_xform libobj-or-source ++func_xform () ++{ ++ func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` ++} ++ ++# func_arith arithmetic-term... ++func_arith () ++{ ++ func_arith_result=`expr "$[@]"` ++} ++ ++# func_len string ++# STRING may not start with a hyphen. ++func_len () ++{ ++ func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` ++} ++ ++_LT_EOF ++esac ++ ++case $lt_shell_append in ++ yes) ++ cat << \_LT_EOF >> "$cfgfile" ++ ++# func_append var value ++# Append VALUE to the end of shell variable VAR. ++func_append () ++{ ++ eval "$[1]+=\$[2]" ++} ++_LT_EOF ++ ;; ++ *) ++ cat << \_LT_EOF >> "$cfgfile" ++ ++# func_append var value ++# Append VALUE to the end of shell variable VAR. ++func_append () ++{ ++ eval "$[1]=\$$[1]\$[2]" ++} ++ ++_LT_EOF ++ ;; ++ esac + ]) +--- a/m4/libtool.m4 ++++ b/m4/libtool.m4 +@@ -1,107 +1,186 @@ + # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +-## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 +-## Free Software Foundation, Inc. +-## Originally by Gordon Matzigkeit , 1996 +-## +-## This file is free software; the Free Software Foundation gives +-## unlimited permission to copy and/or distribute it, with or without +-## modifications, as long as this notice is preserved. +- +-# serial 48 AC_PROG_LIBTOOL +- +- +-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +-# ----------------------------------------------------------- +-# If this macro is not defined by Autoconf, define it here. +-m4_ifdef([AC_PROVIDE_IFELSE], +- [], +- [m4_define([AC_PROVIDE_IFELSE], +- [m4_ifdef([AC_PROVIDE_$1], +- [$2], [$3])])]) ++# ++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, ++# 2006, 2007, 2008 Free Software Foundation, Inc. ++# Written by Gordon Matzigkeit, 1996 ++# ++# This file is free software; the Free Software Foundation gives ++# unlimited permission to copy and/or distribute it, with or without ++# modifications, as long as this notice is preserved. ++ ++m4_define([_LT_COPYING], [dnl ++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, ++# 2006, 2007, 2008 Free Software Foundation, Inc. ++# Written by Gordon Matzigkeit, 1996 ++# ++# This file is part of GNU Libtool. ++# ++# GNU Libtool is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License as ++# published by the Free Software Foundation; either version 2 of ++# the License, or (at your option) any later version. ++# ++# As a special exception to the GNU General Public License, ++# if you distribute this file as part of a program or library that ++# is built using GNU Libtool, you may include this file under the ++# same distribution terms that you use for the rest of that program. ++# ++# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy ++# can be downloaded from http://www.gnu.org/licenses/gpl.html, or ++# obtained by writing to the Free Software Foundation, Inc., ++# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++]) + ++# serial 56 LT_INIT + +-# AC_PROG_LIBTOOL +-# --------------- +-AC_DEFUN([AC_PROG_LIBTOOL], +-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. +- AC_PROVIDE_IFELSE([AC_PROG_CXX], +- [AC_LIBTOOL_CXX], +- [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX +- ])]) +-dnl And a similar setup for Fortran 77 support +- AC_PROVIDE_IFELSE([AC_PROG_F77], +- [AC_LIBTOOL_F77], +- [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +-])]) +- +-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. +- AC_PROVIDE_IFELSE([AC_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [ifdef([AC_PROG_GCJ], +- [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) +- ifdef([A][M_PROG_GCJ], +- [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) +- ifdef([LT_AC_PROG_GCJ], +- [define([LT_AC_PROG_GCJ], +- defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +-])])# AC_PROG_LIBTOOL + ++# LT_PREREQ(VERSION) ++# ------------------ ++# Complain and exit if this libtool version is less that VERSION. ++m4_defun([LT_PREREQ], ++[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, ++ [m4_default([$3], ++ [m4_fatal([Libtool version $1 or higher is required], ++ 63)])], ++ [$2])]) + +-# _AC_PROG_LIBTOOL +-# ---------------- +-AC_DEFUN([_AC_PROG_LIBTOOL], +-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl ++ ++# _LT_CHECK_BUILDDIR ++# ------------------ ++# Complain if the absolute build directory name contains unusual characters ++m4_defun([_LT_CHECK_BUILDDIR], ++[case `pwd` in ++ *\ * | *\ *) ++ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; ++esac ++]) ++ ++ ++# LT_INIT([OPTIONS]) ++# ------------------ ++AC_DEFUN([LT_INIT], ++[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT ++AC_BEFORE([$0], [LT_LANG])dnl ++AC_BEFORE([$0], [LT_OUTPUT])dnl ++AC_BEFORE([$0], [LTDL_INIT])dnl ++m4_require([_LT_CHECK_BUILDDIR])dnl ++ ++dnl Autoconf doesn't catch unexpanded LT_ macros by default: ++m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl ++m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl ++dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 ++dnl unless we require an AC_DEFUNed macro: ++AC_REQUIRE([LTOPTIONS_VERSION])dnl ++AC_REQUIRE([LTSUGAR_VERSION])dnl ++AC_REQUIRE([LTVERSION_VERSION])dnl ++AC_REQUIRE([LTOBSOLETE_VERSION])dnl ++m4_require([_LT_PROG_LTMAIN])dnl ++ ++dnl Parse OPTIONS ++_LT_SET_OPTIONS([$0], [$1]) + + # This can be used to rebuild libtool when needed +-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" ++LIBTOOL_DEPS="$ltmain" + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)' ++LIBTOOL="$LIBTOOL/$host_alias-libtool" + AC_SUBST(LIBTOOL)dnl + +-# Prevent multiple expansion +-define([AC_PROG_LIBTOOL], []) +-])# _AC_PROG_LIBTOOL ++_LT_SETUP + ++# Only expand once: ++m4_define([LT_INIT]) ++])# LT_INIT ++ ++# Old names: ++AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) ++AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_PROG_LIBTOOL], []) ++dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + +-# AC_LIBTOOL_SETUP +-# ---------------- +-AC_DEFUN([AC_LIBTOOL_SETUP], +-[AC_PREREQ(2.50)dnl +-AC_REQUIRE([AC_ENABLE_SHARED])dnl +-AC_REQUIRE([AC_ENABLE_STATIC])dnl +-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +-AC_REQUIRE([AC_CANONICAL_HOST])dnl ++ ++# _LT_CC_BASENAME(CC) ++# ------------------- ++# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. ++m4_defun([_LT_CC_BASENAME], ++[for cc_temp in $1""; do ++ case $cc_temp in ++ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; ++ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; ++ \-*) ;; ++ *) break;; ++ esac ++done ++cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ++]) ++ ++ ++# _LT_FILEUTILS_DEFAULTS ++# ---------------------- ++# It is okay to use these file commands and assume they have been set ++# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. ++m4_defun([_LT_FILEUTILS_DEFAULTS], ++[: ${CP="cp -f"} ++: ${MV="mv -f"} ++: ${RM="rm -f"} ++])# _LT_FILEUTILS_DEFAULTS ++ ++ ++# _LT_SETUP ++# --------- ++m4_defun([_LT_SETUP], ++[AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_CANONICAL_BUILD])dnl ++_LT_DECL([], [host_alias], [0], [The host system])dnl ++_LT_DECL([], [host], [0])dnl ++_LT_DECL([], [host_os], [0])dnl ++dnl ++_LT_DECL([], [build_alias], [0], [The build system])dnl ++_LT_DECL([], [build], [0])dnl ++_LT_DECL([], [build_os], [0])dnl ++dnl + AC_REQUIRE([AC_PROG_CC])dnl +-AC_REQUIRE([AC_PROG_LD])dnl +-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +-AC_REQUIRE([AC_PROG_NM])dnl +- ++AC_REQUIRE([LT_PATH_LD])dnl ++AC_REQUIRE([LT_PATH_NM])dnl ++dnl + AC_REQUIRE([AC_PROG_LN_S])dnl +-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +-AC_REQUIRE([AC_OBJEXT])dnl +-AC_REQUIRE([AC_EXEEXT])dnl ++test -z "$LN_S" && LN_S="ln -s" ++_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl + dnl ++AC_REQUIRE([LT_CMD_MAX_LEN])dnl ++_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl ++_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl ++dnl ++m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++m4_require([_LT_CHECK_SHELL_FEATURES])dnl ++m4_require([_LT_CMD_RELOAD])dnl ++m4_require([_LT_CHECK_MAGIC_METHOD])dnl ++m4_require([_LT_CMD_OLD_ARCHIVE])dnl ++m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl ++ ++_LT_CONFIG_LIBTOOL_INIT([ ++# See if we are running on zsh, and set the options which allow our ++# commands through without removal of \ escapes INIT. ++if test -n "\${ZSH_VERSION+set}" ; then ++ setopt NO_GLOB_SUBST ++fi ++]) ++if test -n "${ZSH_VERSION+set}" ; then ++ setopt NO_GLOB_SUBST ++fi + +-AC_LIBTOOL_SYS_MAX_CMD_LEN +-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +-AC_LIBTOOL_OBJDIR ++_LT_CHECK_OBJDIR + +-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +-_LT_AC_PROG_ECHO_BACKSLASH ++m4_require([_LT_TAG_COMPILER])dnl ++_LT_PROG_ECHO_BACKSLASH + + case $host_os in + aix3*) +@@ -117,6307 +196,6803 @@ esac + + # Sed substitution that helps us do robust quoting. It backslashifies + # metacharacters that are still active within double-quoted strings. +-Xsed='sed -e 1s/^X//' +-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] ++sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + + # Same as above, but do not quote variable references. +-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] ++double_quote_subst='s/\([["`\\]]\)/\\\1/g' + + # Sed substitution to delay expansion of an escaped shell variable in a + # double_quote_subst'ed string. + delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + ++# Sed substitution to delay expansion of an escaped single quote. ++delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' ++ + # Sed substitution to avoid accidental globbing in evaled expressions + no_glob_subst='s/\*/\\\*/g' + +-# Constants: +-rm="rm -f" +- + # Global variables: +-default_ofile=libtool ++ofile=${host_alias}-libtool + can_build_shared=yes + + # All known linkers require a `.a' archive for static linking (except MSVC, + # which needs '.lib'). + libext=a +-ltmain="$ac_aux_dir/ltmain.sh" +-ofile="$default_ofile" +-with_gnu_ld="$lt_cv_prog_gnu_ld" + +-AC_CHECK_TOOL(AR, ar, false) +-AC_CHECK_TOOL(RANLIB, ranlib, :) +-AC_CHECK_TOOL(STRIP, strip, :) ++with_gnu_ld="$lt_cv_prog_gnu_ld" + + old_CC="$CC" + old_CFLAGS="$CFLAGS" + + # Set sane defaults for various variables +-test -z "$AR" && AR=ar +-test -z "$AR_FLAGS" && AR_FLAGS=cru +-test -z "$AS" && AS=as + test -z "$CC" && CC=cc + test -z "$LTCC" && LTCC=$CC + test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +-test -z "$DLLTOOL" && DLLTOOL=dlltool + test -z "$LD" && LD=ld +-test -z "$LN_S" && LN_S="ln -s" +-test -z "$MAGIC_CMD" && MAGIC_CMD=file +-test -z "$NM" && NM=nm +-test -z "$SED" && SED=sed +-test -z "$OBJDUMP" && OBJDUMP=objdump +-test -z "$RANLIB" && RANLIB=: +-test -z "$STRIP" && STRIP=: + test -z "$ac_objext" && ac_objext=o + +-# Determine commands to create old-style static archives. +-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +-old_postinstall_cmds='chmod 644 $oldlib' +-old_postuninstall_cmds= +- +-if test -n "$RANLIB"; then +- case $host_os in +- openbsd*) +- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" +- ;; +- *) +- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" +- ;; +- esac +- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +-fi +- + _LT_CC_BASENAME([$compiler]) + + # Only perform the check for file, if the check method requires it ++test -z "$MAGIC_CMD" && MAGIC_CMD=file + case $deplibs_check_method in + file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then +- AC_PATH_MAGIC ++ _LT_PATH_MAGIC + fi + ;; + esac + +-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +-enable_win32_dll=yes, enable_win32_dll=no) +- +-AC_ARG_ENABLE([libtool-lock], +- [AC_HELP_STRING([--disable-libtool-lock], +- [avoid locking (might break parallel builds)])]) +-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes ++# Use C for the default configuration in the libtool script ++LT_SUPPORTED_TAG([CC]) ++_LT_LANG_C_CONFIG ++_LT_LANG_DEFAULT_CONFIG ++_LT_CONFIG_COMMANDS ++])# _LT_SETUP + +-AC_ARG_WITH([pic], +- [AC_HELP_STRING([--with-pic], +- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], +- [pic_mode="$withval"], +- [pic_mode=default]) +-test -z "$pic_mode" && pic_mode=default + +-# Use C for the default configuration in the libtool script +-tagname= +-AC_LIBTOOL_LANG_C_CONFIG +-_LT_AC_TAGCONFIG +-])# AC_LIBTOOL_SETUP ++# _LT_PROG_LTMAIN ++# --------------- ++# Note that this code is called both from `configure', and `config.status' ++# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, ++# `config.status' has no value for ac_aux_dir unless we are using Automake, ++# so we pass a copy along to make sure it has a sensible value anyway. ++m4_defun([_LT_PROG_LTMAIN], ++[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl ++_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ++ltmain="$ac_aux_dir/ltmain.sh" ++])# _LT_PROG_LTMAIN + + +-# _LT_AC_SYS_COMPILER +-# ------------------- +-AC_DEFUN([_LT_AC_SYS_COMPILER], +-[AC_REQUIRE([AC_PROG_CC])dnl ++## ------------------------------------- ## ++## Accumulate code for creating libtool. ## ++## ------------------------------------- ## ++ ++# So that we can recreate a full libtool script including additional ++# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS ++# in macros and then make a single call at the end using the `libtool' ++# label. ++ ++ ++# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) ++# ---------------------------------------- ++# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. ++m4_define([_LT_CONFIG_LIBTOOL_INIT], ++[m4_ifval([$1], ++ [m4_append([_LT_OUTPUT_LIBTOOL_INIT], ++ [$1 ++])])]) ++ ++# Initialize. ++m4_define([_LT_OUTPUT_LIBTOOL_INIT]) ++ ++ ++# _LT_CONFIG_LIBTOOL([COMMANDS]) ++# ------------------------------ ++# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. ++m4_define([_LT_CONFIG_LIBTOOL], ++[m4_ifval([$1], ++ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], ++ [$1 ++])])]) ++ ++# Initialize. ++m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) ++ ++ ++# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) ++# ----------------------------------------------------- ++m4_defun([_LT_CONFIG_SAVE_COMMANDS], ++[_LT_CONFIG_LIBTOOL([$1]) ++_LT_CONFIG_LIBTOOL_INIT([$2]) ++]) + +-# If no C compiler was specified, use CC. +-LTCC=${LTCC-"$CC"} + +-# If no C compiler flags were specified, use CFLAGS. +-LTCFLAGS=${LTCFLAGS-"$CFLAGS"} ++# _LT_FORMAT_COMMENT([COMMENT]) ++# ----------------------------- ++# Add leading comment marks to the start of each line, and a trailing ++# full-stop to the whole comment if one is not present already. ++m4_define([_LT_FORMAT_COMMENT], ++[m4_ifval([$1], [ ++m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], ++ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) ++)]) + +-# Allow CC to be a program name with arguments. +-compiler=$CC +-])# _LT_AC_SYS_COMPILER + + +-# _LT_CC_BASENAME(CC) +-# ------------------- +-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +-AC_DEFUN([_LT_CC_BASENAME], +-[for cc_temp in $1""; do +- case $cc_temp in +- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; +- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; +- \-*) ;; +- *) break;; +- esac +-done +-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ++## ------------------------ ## ++## FIXME: Eliminate VARNAME ## ++## ------------------------ ## ++ ++ ++# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) ++# ------------------------------------------------------------------- ++# CONFIGNAME is the name given to the value in the libtool script. ++# VARNAME is the (base) name used in the configure script. ++# VALUE may be 0, 1 or 2 for a computed quote escaped value based on ++# VARNAME. Any other value will be used directly. ++m4_define([_LT_DECL], ++[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], ++ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], ++ [m4_ifval([$1], [$1], [$2])]) ++ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) ++ m4_ifval([$4], ++ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) ++ lt_dict_add_subkey([lt_decl_dict], [$2], ++ [tagged?], [m4_ifval([$5], [yes], [no])])]) + ]) + + +-# _LT_COMPILER_BOILERPLATE +-# ------------------------ +-# Check for compiler boilerplate output or warnings with +-# the simple compiler test code. +-AC_DEFUN([_LT_COMPILER_BOILERPLATE], +-[ac_outfile=conftest.$ac_objext +-printf "$lt_simple_compile_test_code" >conftest.$ac_ext +-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +-_lt_compiler_boilerplate=`cat conftest.err` +-$rm conftest* +-])# _LT_COMPILER_BOILERPLATE +- ++# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) ++# -------------------------------------------------------- ++m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) ++ ++ ++# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) ++# ------------------------------------------------ ++m4_define([lt_decl_tag_varnames], ++[_lt_decl_filter([tagged?], [yes], $@)]) ++ ++ ++# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) ++# --------------------------------------------------------- ++m4_define([_lt_decl_filter], ++[m4_case([$#], ++ [0], [m4_fatal([$0: too few arguments: $#])], ++ [1], [m4_fatal([$0: too few arguments: $#: $1])], ++ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], ++ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], ++ [lt_dict_filter([lt_decl_dict], $@)])[]dnl ++]) + +-# _LT_LINKER_BOILERPLATE +-# ---------------------- +-# Check for linker boilerplate output or warnings with +-# the simple link test code. +-AC_DEFUN([_LT_LINKER_BOILERPLATE], +-[ac_outfile=conftest.$ac_objext +-printf "$lt_simple_link_test_code" >conftest.$ac_ext +-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +-_lt_linker_boilerplate=`cat conftest.err` +-$rm conftest* +-])# _LT_LINKER_BOILERPLATE + ++# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) ++# -------------------------------------------------- ++m4_define([lt_decl_quote_varnames], ++[_lt_decl_filter([value], [1], $@)]) ++ ++ ++# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) ++# --------------------------------------------------- ++m4_define([lt_decl_dquote_varnames], ++[_lt_decl_filter([value], [2], $@)]) ++ ++ ++# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) ++# --------------------------------------------------- ++m4_define([lt_decl_varnames_tagged], ++[_$0(m4_quote(m4_default([$1], [[, ]])), ++ m4_quote(m4_if([$2], [], ++ m4_quote(lt_decl_tag_varnames), ++ m4_quote(m4_shift($@)))), ++ m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) ++m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) ++ ++ ++# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) ++# ------------------------------------------------ ++m4_define([lt_decl_all_varnames], ++[_$0(m4_quote(m4_default([$1], [[, ]])), ++ m4_if([$2], [], ++ m4_quote(lt_decl_varnames), ++ m4_quote(m4_shift($@))))[]dnl ++]) ++m4_define([_lt_decl_all_varnames], ++[lt_join($@, lt_decl_varnames_tagged([$1], ++ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ++]) + +-# _LT_AC_SYS_LIBPATH_AIX +-# ---------------------- +-# Links a minimal program and checks the executable +-# for the system default hardcoded library path. In most cases, +-# this is /usr/lib:/lib, but when the MPI compilers are used +-# the location of the communication and MPI libs are included too. +-# If we don't find anything, use the default library path according +-# to the aix ld manual. +-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +-}'` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +-}'`; fi],[]) +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +-])# _LT_AC_SYS_LIBPATH_AIX + ++# _LT_CONFIG_STATUS_DECLARE([VARNAME]) ++# ------------------------------------ ++# Quote a variable value, and forward it to `config.status' so that its ++# declaration there will have the same value as in `configure'. VARNAME ++# must have a single quote delimited value for this to work. ++m4_define([_LT_CONFIG_STATUS_DECLARE], ++[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) + +-# _LT_AC_SHELL_INIT(ARG) +-# ---------------------- +-AC_DEFUN([_LT_AC_SHELL_INIT], +-[ifdef([AC_DIVERSION_NOTICE], +- [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], +- [AC_DIVERT_PUSH(NOTICE)]) +-$1 +-AC_DIVERT_POP +-])# _LT_AC_SHELL_INIT + ++# _LT_CONFIG_STATUS_DECLARATIONS ++# ------------------------------ ++# We delimit libtool config variables with single quotes, so when ++# we write them to config.status, we have to be sure to quote all ++# embedded single quotes properly. In configure, this macro expands ++# each variable declared with _LT_DECL (and _LT_TAGDECL) into: ++# ++# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' ++m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], ++[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), ++ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + +-# _LT_AC_PROG_ECHO_BACKSLASH +-# -------------------------- +-# Add some code to the start of the generated configure script which +-# will find an echo command which doesn't interpret backslashes. +-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +-[_LT_AC_SHELL_INIT([ +-# Check that we are running under the correct shell. +-SHELL=${CONFIG_SHELL-/bin/sh} + +-case X$ECHO in +-X*--fallback-echo) +- # Remove one level of quotation (which was required for Make). +- ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` +- ;; +-esac ++# _LT_LIBTOOL_TAGS ++# ---------------- ++# Output comment and list of tags supported by the script ++m4_defun([_LT_LIBTOOL_TAGS], ++[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl ++available_tags="_LT_TAGS"dnl ++]) + +-echo=${ECHO-echo} +-if test "X[$]1" = X--no-reexec; then +- # Discard the --no-reexec flag, and continue. +- shift +-elif test "X[$]1" = X--fallback-echo; then +- # Avoid inline document here, it may be left over +- : +-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then +- # Yippee, $echo works! +- : +-else +- # Restart under the correct shell. +- exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +-fi + +-if test "X[$]1" = X--fallback-echo; then +- # used as fallback echo +- shift +- cat </dev/null 2>&1 && unset CDPATH + +-if test -z "$ECHO"; then +-if test "X${echo_test_string+set}" != Xset; then +-# find a string as large as possible, as long as the shell can cope with it +- for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do +- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... +- if (echo_test_string=`eval $cmd`) 2>/dev/null && +- echo_test_string=`eval $cmd` && +- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null +- then +- break +- fi +- done +-fi ++# _LT_LIBTOOL_CONFIG_VARS ++# ----------------------- ++# Produce commented declarations of non-tagged libtool config variables ++# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' ++# script. Tagged libtool config variables (even for the LIBTOOL CONFIG ++# section) are produced by _LT_LIBTOOL_TAG_VARS. ++m4_defun([_LT_LIBTOOL_CONFIG_VARS], ++[m4_foreach([_lt_var], ++ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), ++ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + +-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- : +-else +- # The Solaris, AIX, and Digital Unix default echo programs unquote +- # backslashes. This makes it impossible to quote backslashes using +- # echo "$something" | sed 's/\\/\\\\/g' +- # +- # So, first we look for a working echo in the user's PATH. + +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for dir in $PATH /usr/ucb; do +- IFS="$lt_save_ifs" +- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && +- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- echo="$dir/echo" +- break +- fi +- done +- IFS="$lt_save_ifs" ++# _LT_LIBTOOL_TAG_VARS(TAG) ++# ------------------------- ++m4_define([_LT_LIBTOOL_TAG_VARS], ++[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), ++ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + +- if test "X$echo" = Xecho; then +- # We didn't find a better echo, so look for alternatives. +- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- # This shell has a builtin print -r that does the trick. +- echo='print -r' +- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && +- test "X$CONFIG_SHELL" != X/bin/ksh; then +- # If we have ksh, try running configure again with it. +- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} +- export ORIGINAL_CONFIG_SHELL +- CONFIG_SHELL=/bin/ksh +- export CONFIG_SHELL +- exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} +- else +- # Try using printf. +- echo='printf %s\n' +- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- # Cool, printf works +- : +- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && +- test "X$echo_testing_string" = 'X\t' && +- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL +- export CONFIG_SHELL +- SHELL="$CONFIG_SHELL" +- export SHELL +- echo="$CONFIG_SHELL [$]0 --fallback-echo" +- elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && +- test "X$echo_testing_string" = 'X\t' && +- echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- echo="$CONFIG_SHELL [$]0 --fallback-echo" +- else +- # maybe with a smaller string... +- prev=: + +- for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do +- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null +- then +- break +- fi +- prev="$cmd" +- done ++# _LT_TAGVAR(VARNAME, [TAGNAME]) ++# ------------------------------ ++m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + +- if test "$prev" != 'sed 50q "[$]0"'; then +- echo_test_string=`eval $prev` +- export echo_test_string +- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} +- else +- # Oops. We lost completely, so just stick with echo. +- echo=echo +- fi +- fi +- fi +- fi +-fi +-fi + +-# Copy echo and quote the copy suitably for passing to libtool from +-# the Makefile, instead of quoting the original, which is used later. +-ECHO=$echo +-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then +- ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +-fi ++# _LT_CONFIG_COMMANDS ++# ------------------- ++# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of ++# variables for single and double quote escaping we saved from calls ++# to _LT_DECL, we can put quote escaped variables declarations ++# into `config.status', and then the shell code to quote escape them in ++# for loops in `config.status'. Finally, any additional code accumulated ++# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. ++m4_defun([_LT_CONFIG_COMMANDS], ++[AC_PROVIDE_IFELSE([LT_OUTPUT], ++ dnl If the libtool generation code has been placed in $CONFIG_LT, ++ dnl instead of duplicating it all over again into config.status, ++ dnl then we will have config.status run $CONFIG_LT later, so it ++ dnl needs to know what name is stored there: ++ [AC_CONFIG_COMMANDS([libtool], ++ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], ++ dnl If the libtool generation code is destined for config.status, ++ dnl expand the accumulated commands and init code now: ++ [AC_CONFIG_COMMANDS([libtool], ++ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ++])#_LT_CONFIG_COMMANDS + +-AC_SUBST(ECHO) +-])])# _LT_AC_PROG_ECHO_BACKSLASH + ++# Initialize. ++m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], ++[ + +-# _LT_AC_LOCK +-# ----------- +-AC_DEFUN([_LT_AC_LOCK], +-[AC_ARG_ENABLE([libtool-lock], +- [AC_HELP_STRING([--disable-libtool-lock], +- [avoid locking (might break parallel builds)])]) +-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes ++# The HP-UX ksh and POSIX shell print the target directory to stdout ++# if CDPATH is set. ++(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +-# Some flags need to be propagated to the compiler or linker for good +-# libtool support. +-case $host in +-ia64-*-hpux*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.$ac_objext` in +- *ELF-32*) +- HPUX_IA64_MODE="32" +- ;; +- *ELF-64*) +- HPUX_IA64_MODE="64" +- ;; +- esac +- fi +- rm -rf conftest* +- ;; +-*-*-irix6*) +- # Find out which ABI we are using. +- echo '[#]line __oline__ "configure"' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- if test "$lt_cv_prog_gnu_ld" = yes; then +- case `/usr/bin/file conftest.$ac_objext` in +- *32-bit*) +- LD="${LD-ld} -melf32bsmip" +- ;; +- *N32*) +- LD="${LD-ld} -melf32bmipn32" ++sed_quote_subst='$sed_quote_subst' ++double_quote_subst='$double_quote_subst' ++delay_variable_subst='$delay_variable_subst' ++_LT_CONFIG_STATUS_DECLARATIONS ++LTCC='$LTCC' ++LTCFLAGS='$LTCFLAGS' ++compiler='$compiler_DEFAULT' ++ ++# Quote evaled strings. ++for var in lt_decl_all_varnames([[ \ ++]], lt_decl_quote_varnames); do ++ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in ++ *[[\\\\\\\`\\"\\\$]]*) ++ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; +- *64-bit*) +- LD="${LD-ld} -melf64bmip" ++ *) ++ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +- else +- case `/usr/bin/file conftest.$ac_objext` in +- *32-bit*) +- LD="${LD-ld} -32" +- ;; +- *N32*) +- LD="${LD-ld} -n32" ++done ++ ++# Double-quote double-evaled strings. ++for var in lt_decl_all_varnames([[ \ ++]], lt_decl_dquote_varnames); do ++ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in ++ *[[\\\\\\\`\\"\\\$]]*) ++ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; +- *64-bit*) +- LD="${LD-ld} -64" ++ *) ++ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +- fi +- fi +- rm -rf conftest* ++done ++ ++# Fix-up fallback echo if it was mangled by the above quoting rules. ++case \$lt_ECHO in ++*'\\\[$]0 --fallback-echo"')dnl " ++ lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; ++esac + +-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.o` in +- *32-bit*) +- case $host in +- x86_64-*linux*) +- LD="${LD-ld} -m elf_i386" +- ;; +- ppc64-*linux*|powerpc64-*linux*) +- LD="${LD-ld} -m elf32ppclinux" +- ;; +- s390x-*linux*) +- LD="${LD-ld} -m elf_s390" +- ;; +- sparc64-*linux*) +- LD="${LD-ld} -m elf32_sparc" +- ;; +- esac +- ;; +- *64-bit*) +- case $host in +- x86_64-*linux*) +- LD="${LD-ld} -m elf_x86_64" +- ;; +- ppc*-*linux*|powerpc*-*linux*) +- LD="${LD-ld} -m elf64ppc" +- ;; +- s390*-*linux*) +- LD="${LD-ld} -m elf64_s390" +- ;; +- sparc*-*linux*) +- LD="${LD-ld} -m elf64_sparc" +- ;; +- esac +- ;; +- esac +- fi +- rm -rf conftest* +- ;; ++_LT_OUTPUT_LIBTOOL_INIT ++]) + +-*-*-sco3.2v5*) +- # On SCO OpenServer 5, we need -belf to get full-featured binaries. +- SAVE_CFLAGS="$CFLAGS" +- CFLAGS="$CFLAGS -belf" +- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, +- [AC_LANG_PUSH(C) +- AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) +- AC_LANG_POP]) +- if test x"$lt_cv_cc_needs_belf" != x"yes"; then +- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf +- CFLAGS="$SAVE_CFLAGS" +- fi +- ;; +-sparc*-*solaris*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.o` in +- *64-bit*) +- case $lt_cv_prog_gnu_ld in +- yes*) LD="${LD-ld} -m elf64_sparc" ;; +- *) LD="${LD-ld} -64" ;; +- esac +- ;; +- esac +- fi +- rm -rf conftest* +- ;; + +-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +-[*-*-cygwin* | *-*-mingw* | *-*-pw32*) +- AC_CHECK_TOOL(DLLTOOL, dlltool, false) +- AC_CHECK_TOOL(AS, as, false) +- AC_CHECK_TOOL(OBJDUMP, objdump, false) +- ;; +- ]) +-esac ++# LT_OUTPUT ++# --------- ++# This macro allows early generation of the libtool script (before ++# AC_OUTPUT is called), incase it is used in configure for compilation ++# tests. ++AC_DEFUN([LT_OUTPUT], ++[: ${CONFIG_LT=./config.lt} ++AC_MSG_NOTICE([creating $CONFIG_LT]) ++cat >"$CONFIG_LT" <<_LTEOF ++#! $SHELL ++# Generated by $as_me. ++# Run this file to recreate a libtool stub with the current configuration. ++ ++lt_cl_silent=false ++SHELL=\${CONFIG_SHELL-$SHELL} ++_LTEOF ++ ++cat >>"$CONFIG_LT" <<\_LTEOF ++AS_SHELL_SANITIZE ++_AS_PREPARE + +-need_locks="$enable_libtool_lock" ++exec AS_MESSAGE_FD>&1 ++exec AS_MESSAGE_LOG_FD>>config.log ++{ ++ echo ++ AS_BOX([Running $as_me.]) ++} >&AS_MESSAGE_LOG_FD ++ ++lt_cl_help="\ ++\`$as_me' creates a local libtool stub from the current configuration, ++for use in further configure time tests before the real libtool is ++generated. ++ ++Usage: $[0] [[OPTIONS]] ++ ++ -h, --help print this help, then exit ++ -V, --version print version number, then exit ++ -q, --quiet do not print progress messages ++ -d, --debug don't remove temporary files ++ ++Report bugs to ." ++ ++lt_cl_version="\ ++m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl ++m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) ++configured by $[0], generated by m4_PACKAGE_STRING. ++ ++Copyright (C) 2008 Free Software Foundation, Inc. ++This config.lt script is free software; the Free Software Foundation ++gives unlimited permision to copy, distribute and modify it." + +-])# _LT_AC_LOCK ++while test $[#] != 0 ++do ++ case $[1] in ++ --version | --v* | -V ) ++ echo "$lt_cl_version"; exit 0 ;; ++ --help | --h* | -h ) ++ echo "$lt_cl_help"; exit 0 ;; ++ --debug | --d* | -d ) ++ debug=: ;; ++ --quiet | --q* | --silent | --s* | -q ) ++ lt_cl_silent=: ;; + ++ -*) AC_MSG_ERROR([unrecognized option: $[1] ++Try \`$[0] --help' for more information.]) ;; + +-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +-# ---------------------------------------------------------------- +-# Check whether the given compiler option works +-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +-[AC_REQUIRE([LT_AC_PROG_SED]) +-AC_CACHE_CHECK([$1], [$2], +- [$2=no +- ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) +- printf "$lt_simple_compile_test_code" > conftest.$ac_ext +- lt_compiler_flag="$3" +- # Insert the option either (1) after the last *FLAGS variable, or +- # (2) before a word containing "conftest.", or (3) at the end. +- # Note that $ac_compile itself does not contain backslashes and begins +- # with a dollar sign (not a hyphen), so the echo should work correctly. +- # The option is referenced via a variable to avoid confusing sed. +- lt_compile=`echo "$ac_compile" | $SED \ +- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ +- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ +- -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) +- (eval "$lt_compile" 2>conftest.err) +- ac_status=$? +- cat conftest.err >&AS_MESSAGE_LOG_FD +- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD +- if (exit $ac_status) && test -s "$ac_outfile"; then +- # The compiler can only warn and ignore the option if not recognized +- # So say no if there are warnings other than the usual output. +- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp +- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 +- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then +- $2=yes +- fi +- fi +- $rm conftest* +-]) ++ *) AC_MSG_ERROR([unrecognized argument: $[1] ++Try \`$[0] --help' for more information.]) ;; ++ esac ++ shift ++done + +-if test x"[$]$2" = xyes; then +- ifelse([$5], , :, [$5]) +-else +- ifelse([$6], , :, [$6]) ++if $lt_cl_silent; then ++ exec AS_MESSAGE_FD>/dev/null + fi +-])# AC_LIBTOOL_COMPILER_OPTION +- +- +-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +-# [ACTION-SUCCESS], [ACTION-FAILURE]) +-# ------------------------------------------------------------ +-# Check whether the given compiler option works +-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +-[AC_CACHE_CHECK([$1], [$2], +- [$2=no +- save_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS $3" +- printf "$lt_simple_link_test_code" > conftest.$ac_ext +- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then +- # The linker can only warn and ignore the option if not recognized +- # So say no if there are warnings +- if test -s conftest.err; then +- # Append any errors to the config.log. +- cat conftest.err 1>&AS_MESSAGE_LOG_FD +- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp +- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 +- if diff conftest.exp conftest.er2 >/dev/null; then +- $2=yes +- fi +- else +- $2=yes +- fi +- fi +- $rm conftest* +- LDFLAGS="$save_LDFLAGS" +-]) ++_LTEOF + +-if test x"[$]$2" = xyes; then +- ifelse([$4], , :, [$4]) +-else +- ifelse([$5], , :, [$5]) ++cat >>"$CONFIG_LT" <<_LTEOF ++_LT_OUTPUT_LIBTOOL_COMMANDS_INIT ++_LTEOF ++ ++cat >>"$CONFIG_LT" <<\_LTEOF ++AC_MSG_NOTICE([creating $ofile]) ++_LT_OUTPUT_LIBTOOL_COMMANDS ++AS_EXIT(0) ++_LTEOF ++chmod +x "$CONFIG_LT" ++ ++# configure is writing to config.log, but config.lt does its own redirection, ++# appending to config.log, which fails on DOS, as config.log is still kept ++# open by configure. Here we exec the FD to /dev/null, effectively closing ++# config.log, so it can be properly (re)opened and appended to by config.lt. ++if test "$no_create" != yes; then ++ lt_cl_success=: ++ test "$silent" = yes && ++ lt_config_lt_args="$lt_config_lt_args --quiet" ++ exec AS_MESSAGE_LOG_FD>/dev/null ++ $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false ++ exec AS_MESSAGE_LOG_FD>>config.log ++ $lt_cl_success || AS_EXIT(1) + fi +-])# AC_LIBTOOL_LINKER_OPTION +- ++])# LT_OUTPUT + +-# AC_LIBTOOL_SYS_MAX_CMD_LEN +-# -------------------------- +-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +-[# find the maximum length of command line arguments +-AC_MSG_CHECKING([the maximum length of command line arguments]) +-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl +- i=0 +- teststring="ABCD" + +- case $build_os in +- msdosdjgpp*) +- # On DJGPP, this test can blow up pretty badly due to problems in libc +- # (any single argument exceeding 2000 bytes causes a buffer overrun +- # during glob expansion). Even if it were fixed, the result of this +- # check would be larger than it should be. +- lt_cv_sys_max_cmd_len=12288; # 12K is about right +- ;; ++# _LT_CONFIG(TAG) ++# --------------- ++# If TAG is the built-in tag, create an initial libtool script with a ++# default configuration from the untagged config vars. Otherwise add code ++# to config.status for appending the configuration named by TAG from the ++# matching tagged config vars. ++m4_defun([_LT_CONFIG], ++[m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++_LT_CONFIG_SAVE_COMMANDS([ ++ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl ++ m4_if(_LT_TAG, [C], [ ++ # See if we are running on zsh, and set the options which allow our ++ # commands through without removal of \ escapes. ++ if test -n "${ZSH_VERSION+set}" ; then ++ setopt NO_GLOB_SUBST ++ fi + +- gnu*) +- # Under GNU Hurd, this test is not required because there is +- # no limit to the length of command line arguments. +- # Libtool will interpret -1 as no limit whatsoever +- lt_cv_sys_max_cmd_len=-1; +- ;; ++ cfgfile="${ofile}T" ++ trap "$RM \"$cfgfile\"; exit 1" 1 2 15 ++ $RM "$cfgfile" + +- cygwin* | mingw*) +- # On Win9x/ME, this test blows up -- it succeeds, but takes +- # about 5 minutes as the teststring grows exponentially. +- # Worse, since 9x/ME are not pre-emptively multitasking, +- # you end up with a "frozen" computer, even though with patience +- # the test eventually succeeds (with a max line length of 256k). +- # Instead, let's just punt: use the minimum linelength reported by +- # all of the supported platforms: 8192 (on NT/2K/XP). +- lt_cv_sys_max_cmd_len=8192; +- ;; ++ cat <<_LT_EOF >> "$cfgfile" ++#! $SHELL + +- amigaos*) +- # On AmigaOS with pdksh, this test takes hours, literally. +- # So we just punt and use a minimum line length of 8192. +- lt_cv_sys_max_cmd_len=8192; +- ;; ++# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. ++# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION ++# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: ++# NOTE: Changes made to this file will be lost: look at ltmain.sh. ++# ++_LT_COPYING ++_LT_LIBTOOL_TAGS + +- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) +- # This has been around since 386BSD, at least. Likely further. +- if test -x /sbin/sysctl; then +- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` +- elif test -x /usr/sbin/sysctl; then +- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` +- else +- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs +- fi +- # And add a safety zone +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` +- ;; ++# ### BEGIN LIBTOOL CONFIG ++_LT_LIBTOOL_CONFIG_VARS ++_LT_LIBTOOL_TAG_VARS ++# ### END LIBTOOL CONFIG + +- interix*) +- # We know the value 262144 and hardcode it with a safety zone (like BSD) +- lt_cv_sys_max_cmd_len=196608 +- ;; ++_LT_EOF + +- osf*) +- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure +- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not +- # nice to cause kernel panics so lets avoid the loop below. +- # First set a reasonable default. +- lt_cv_sys_max_cmd_len=16384 +- # +- if test -x /sbin/sysconfig; then +- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in +- *1*) lt_cv_sys_max_cmd_len=-1 ;; +- esac +- fi +- ;; +- sco3.2v5*) +- lt_cv_sys_max_cmd_len=102400 +- ;; +- sysv5* | sco5v6* | sysv4.2uw2*) +- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` +- if test -n "$kargmax"; then +- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` +- else +- lt_cv_sys_max_cmd_len=32768 +- fi +- ;; +- *) +- # If test is not a shell built-in, we'll probably end up computing a +- # maximum length that is only half of the actual maximum length, but +- # we can't tell. +- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} +- while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ +- = "XX$teststring") >/dev/null 2>&1 && +- new_result=`expr "X$teststring" : ".*" 2>&1` && +- lt_cv_sys_max_cmd_len=$new_result && +- test $i != 17 # 1/2 MB should be enough +- do +- i=`expr $i + 1` +- teststring=$teststring$teststring +- done +- teststring= +- # Add a significant safety factor because C++ compilers can tack on massive +- # amounts of additional arguments before passing them to the linker. +- # It appears as though 1/2 is a usable value. +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ++ case $host_os in ++ aix3*) ++ cat <<\_LT_EOF >> "$cfgfile" ++# AIX sometimes has problems with the GCC collect2 program. For some ++# reason, if we set the COLLECT_NAMES environment variable, the problems ++# vanish in a puff of smoke. ++if test "X${COLLECT_NAMES+set}" != Xset; then ++ COLLECT_NAMES= ++ export COLLECT_NAMES ++fi ++_LT_EOF + ;; + esac +-]) +-if test -n $lt_cv_sys_max_cmd_len ; then +- AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +-else +- AC_MSG_RESULT(none) +-fi +-])# AC_LIBTOOL_SYS_MAX_CMD_LEN + ++ _LT_PROG_LTMAIN + +-# _LT_AC_CHECK_DLFCN +-# ------------------ +-AC_DEFUN([_LT_AC_CHECK_DLFCN], +-[AC_CHECK_HEADERS(dlfcn.h)dnl +-])# _LT_AC_CHECK_DLFCN ++ # We use sed instead of cat because bash on DJGPP gets confused if ++ # if finds mixed CR/LF and LF-only lines. Since sed operates in ++ # text mode, it properly converts lines to CR/LF. This bash problem ++ # is reportedly fixed, but why not run on old versions too? ++ sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ ++ || (rm -f "$cfgfile"; exit 1) + ++ _LT_PROG_XSI_SHELLFNS + +-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +-# --------------------------------------------------------------------- +-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +-if test "$cross_compiling" = yes; then : +- [$4] +-else +- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 +- lt_status=$lt_dlunknown +- cat > conftest.$ac_ext <> "$cfgfile" \ ++ || (rm -f "$cfgfile"; exit 1) + +-#if HAVE_DLFCN_H +-#include +-#endif ++ mv -f "$cfgfile" "$ofile" || ++ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") ++ chmod +x "$ofile" ++], ++[cat <<_LT_EOF >> "$ofile" + +-#include ++dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded ++dnl in a comment (ie after a #). ++# ### BEGIN LIBTOOL TAG CONFIG: $1 ++_LT_LIBTOOL_TAG_VARS(_LT_TAG) ++# ### END LIBTOOL TAG CONFIG: $1 ++_LT_EOF ++])dnl /m4_if ++], ++[m4_if([$1], [], [ ++ PACKAGE='$PACKAGE' ++ VERSION='$VERSION' ++ TIMESTAMP='$TIMESTAMP' ++ RM='$RM' ++ ofile='$ofile'], []) ++])dnl /_LT_CONFIG_SAVE_COMMANDS ++])# _LT_CONFIG ++ ++ ++# LT_SUPPORTED_TAG(TAG) ++# --------------------- ++# Trace this macro to discover what tags are supported by the libtool ++# --tag option, using: ++# autoconf --trace 'LT_SUPPORTED_TAG:$1' ++AC_DEFUN([LT_SUPPORTED_TAG], []) ++ ++ ++# C support is built-in for now ++m4_define([_LT_LANG_C_enabled], []) ++m4_define([_LT_TAGS], []) + +-#ifdef RTLD_GLOBAL +-# define LT_DLGLOBAL RTLD_GLOBAL +-#else +-# ifdef DL_GLOBAL +-# define LT_DLGLOBAL DL_GLOBAL +-# else +-# define LT_DLGLOBAL 0 +-# endif +-#endif + +-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we +- find out it does not work in some platform. */ +-#ifndef LT_DLLAZY_OR_NOW +-# ifdef RTLD_LAZY +-# define LT_DLLAZY_OR_NOW RTLD_LAZY +-# else +-# ifdef DL_LAZY +-# define LT_DLLAZY_OR_NOW DL_LAZY +-# else +-# ifdef RTLD_NOW +-# define LT_DLLAZY_OR_NOW RTLD_NOW +-# else +-# ifdef DL_NOW +-# define LT_DLLAZY_OR_NOW DL_NOW +-# else +-# define LT_DLLAZY_OR_NOW 0 +-# endif +-# endif +-# endif +-# endif +-#endif ++# LT_LANG(LANG) ++# ------------- ++# Enable libtool support for the given language if not already enabled. ++AC_DEFUN([LT_LANG], ++[AC_BEFORE([$0], [LT_OUTPUT])dnl ++m4_case([$1], ++ [C], [_LT_LANG(C)], ++ [C++], [_LT_LANG(CXX)], ++ [Java], [_LT_LANG(GCJ)], ++ [Fortran 77], [_LT_LANG(F77)], ++ [Fortran], [_LT_LANG(FC)], ++ [Windows Resource], [_LT_LANG(RC)], ++ [m4_ifdef([_LT_LANG_]$1[_CONFIG], ++ [_LT_LANG($1)], ++ [m4_fatal([$0: unsupported language: "$1"])])])dnl ++])# LT_LANG + +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif + +-void fnord() { int i=42;} +-int main () +-{ +- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +- int status = $lt_dlunknown; +- +- if (self) +- { +- if (dlsym (self,"fnord")) status = $lt_dlno_uscore; +- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; +- /* dlclose (self); */ +- } +- else +- puts (dlerror ()); ++# _LT_LANG(LANGNAME) ++# ------------------ ++m4_defun([_LT_LANG], ++[m4_ifdef([_LT_LANG_]$1[_enabled], [], ++ [LT_SUPPORTED_TAG([$1])dnl ++ m4_append([_LT_TAGS], [$1 ])dnl ++ m4_define([_LT_LANG_]$1[_enabled], [])dnl ++ _LT_LANG_$1_CONFIG($1)])dnl ++])# _LT_LANG + +- exit (status); +-}] +-EOF +- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then +- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null +- lt_status=$? +- case x$lt_status in +- x$lt_dlno_uscore) $1 ;; +- x$lt_dlneed_uscore) $2 ;; +- x$lt_dlunknown|x*) $3 ;; +- esac +- else : +- # compilation failed +- $3 +- fi +-fi +-rm -fr conftest* +-])# _LT_AC_TRY_DLOPEN_SELF + ++# _LT_LANG_DEFAULT_CONFIG ++# ----------------------- ++m4_defun([_LT_LANG_DEFAULT_CONFIG], ++[AC_PROVIDE_IFELSE([AC_PROG_CXX], ++ [LT_LANG(CXX)], ++ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) ++ ++AC_PROVIDE_IFELSE([AC_PROG_F77], ++ [LT_LANG(F77)], ++ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) ++ ++AC_PROVIDE_IFELSE([AC_PROG_FC], ++ [LT_LANG(FC)], ++ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) ++ ++dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal ++dnl pulling things in needlessly. ++AC_PROVIDE_IFELSE([AC_PROG_GCJ], ++ [LT_LANG(GCJ)], ++ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], ++ [LT_LANG(GCJ)], ++ [AC_PROVIDE_IFELSE([LT_PROG_GCJ], ++ [LT_LANG(GCJ)], ++ [m4_ifdef([AC_PROG_GCJ], ++ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) ++ m4_ifdef([A][M_PROG_GCJ], ++ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) ++ m4_ifdef([LT_PROG_GCJ], ++ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) ++ ++AC_PROVIDE_IFELSE([LT_PROG_RC], ++ [LT_LANG(RC)], ++ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ++])# _LT_LANG_DEFAULT_CONFIG ++ ++# Obsolete macros: ++AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) ++AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) ++AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) ++AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_LIBTOOL_CXX], []) ++dnl AC_DEFUN([AC_LIBTOOL_F77], []) ++dnl AC_DEFUN([AC_LIBTOOL_FC], []) ++dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) + +-# AC_LIBTOOL_DLOPEN_SELF +-# ---------------------- +-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +-if test "x$enable_dlopen" != xyes; then +- enable_dlopen=unknown +- enable_dlopen_self=unknown +- enable_dlopen_self_static=unknown +-else +- lt_cv_dlopen=no +- lt_cv_dlopen_libs= + +- case $host_os in +- beos*) +- lt_cv_dlopen="load_add_on" +- lt_cv_dlopen_libs= +- lt_cv_dlopen_self=yes +- ;; ++# _LT_TAG_COMPILER ++# ---------------- ++m4_defun([_LT_TAG_COMPILER], ++[AC_REQUIRE([AC_PROG_CC])dnl + +- mingw* | pw32*) +- lt_cv_dlopen="LoadLibrary" +- lt_cv_dlopen_libs= +- ;; ++_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl ++_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl ++_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl ++_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +- cygwin*) +- lt_cv_dlopen="dlopen" +- lt_cv_dlopen_libs= +- ;; ++# If no C compiler was specified, use CC. ++LTCC=${LTCC-"$CC"} + +- darwin*) +- # if libdl is installed we need to link against it +- AC_CHECK_LIB([dl], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ +- lt_cv_dlopen="dyld" +- lt_cv_dlopen_libs= +- lt_cv_dlopen_self=yes +- ]) +- ;; ++# If no C compiler flags were specified, use CFLAGS. ++LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +- *) +- AC_CHECK_FUNC([shl_load], +- [lt_cv_dlopen="shl_load"], +- [AC_CHECK_LIB([dld], [shl_load], +- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], +- [AC_CHECK_FUNC([dlopen], +- [lt_cv_dlopen="dlopen"], +- [AC_CHECK_LIB([dl], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], +- [AC_CHECK_LIB([svld], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], +- [AC_CHECK_LIB([dld], [dld_link], +- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) +- ]) +- ]) +- ]) +- ]) +- ]) +- ;; +- esac ++# Allow CC to be a program name with arguments. ++compiler=$CC ++])# _LT_TAG_COMPILER + +- if test "x$lt_cv_dlopen" != xno; then +- enable_dlopen=yes +- else +- enable_dlopen=no +- fi + +- case $lt_cv_dlopen in +- dlopen) +- save_CPPFLAGS="$CPPFLAGS" +- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" ++# _LT_COMPILER_BOILERPLATE ++# ------------------------ ++# Check for compiler boilerplate output or warnings with ++# the simple compiler test code. ++m4_defun([_LT_COMPILER_BOILERPLATE], ++[m4_require([_LT_DECL_SED])dnl ++ac_outfile=conftest.$ac_objext ++echo "$lt_simple_compile_test_code" >conftest.$ac_ext ++eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err ++_lt_compiler_boilerplate=`cat conftest.err` ++$RM conftest* ++])# _LT_COMPILER_BOILERPLATE + +- save_LDFLAGS="$LDFLAGS" +- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + +- save_LIBS="$LIBS" +- LIBS="$lt_cv_dlopen_libs $LIBS" ++# _LT_LINKER_BOILERPLATE ++# ---------------------- ++# Check for linker boilerplate output or warnings with ++# the simple link test code. ++m4_defun([_LT_LINKER_BOILERPLATE], ++[m4_require([_LT_DECL_SED])dnl ++ac_outfile=conftest.$ac_objext ++echo "$lt_simple_link_test_code" >conftest.$ac_ext ++eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err ++_lt_linker_boilerplate=`cat conftest.err` ++$RM -r conftest* ++])# _LT_LINKER_BOILERPLATE + +- AC_CACHE_CHECK([whether a program can dlopen itself], +- lt_cv_dlopen_self, [dnl +- _LT_AC_TRY_DLOPEN_SELF( +- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, +- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ++# _LT_REQUIRED_DARWIN_CHECKS ++# ------------------------- ++m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ ++ case $host_os in ++ rhapsody* | darwin*) ++ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) ++ AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) ++ AC_CHECK_TOOL([LIPO], [lipo], [:]) ++ AC_CHECK_TOOL([OTOOL], [otool], [:]) ++ AC_CHECK_TOOL([OTOOL64], [otool64], [:]) ++ _LT_DECL([], [DSYMUTIL], [1], ++ [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) ++ _LT_DECL([], [NMEDIT], [1], ++ [Tool to change global to local symbols on Mac OS X]) ++ _LT_DECL([], [LIPO], [1], ++ [Tool to manipulate fat objects and archives on Mac OS X]) ++ _LT_DECL([], [OTOOL], [1], ++ [ldd/readelf like tool for Mach-O binaries on Mac OS X]) ++ _LT_DECL([], [OTOOL64], [1], ++ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) ++ ++ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], ++ [lt_cv_apple_cc_single_mod=no ++ if test -z "${LT_MULTI_MODULE}"; then ++ # By default we will add the -single_module flag. You can override ++ # by either setting the environment variable LT_MULTI_MODULE ++ # non-empty at configure time, or by adding -multi_module to the ++ # link flags. ++ rm -rf libconftest.dylib* ++ echo "int foo(void){return 1;}" > conftest.c ++ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ ++-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD ++ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ ++ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err ++ _lt_result=$? ++ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then ++ lt_cv_apple_cc_single_mod=yes ++ else ++ cat conftest.err >&AS_MESSAGE_LOG_FD ++ fi ++ rm -rf libconftest.dylib* ++ rm -f conftest.* ++ fi]) ++ AC_CACHE_CHECK([for -exported_symbols_list linker flag], ++ [lt_cv_ld_exported_symbols_list], ++ [lt_cv_ld_exported_symbols_list=no ++ save_LDFLAGS=$LDFLAGS ++ echo "_main" > conftest.sym ++ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], ++ [lt_cv_ld_exported_symbols_list=yes], ++ [lt_cv_ld_exported_symbols_list=no]) ++ LDFLAGS="$save_LDFLAGS" + ]) +- +- if test "x$lt_cv_dlopen_self" = xyes; then +- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" +- AC_CACHE_CHECK([whether a statically linked program can dlopen itself], +- lt_cv_dlopen_self_static, [dnl +- _LT_AC_TRY_DLOPEN_SELF( +- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, +- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) +- ]) ++ case $host_os in ++ rhapsody* | darwin1.[[012]]) ++ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; ++ darwin1.*) ++ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; ++ darwin*) # darwin 5.x on ++ # if running on 10.5 or later, the deployment target defaults ++ # to the OS version, if on x86, and 10.4, the deployment ++ # target defaults to 10.4. Don't you love it? ++ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in ++ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) ++ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; ++ 10.[[012]]*) ++ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; ++ 10.*) ++ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; ++ esac ++ ;; ++ esac ++ if test "$lt_cv_apple_cc_single_mod" = "yes"; then ++ _lt_dar_single_mod='$single_module' ++ fi ++ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then ++ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' ++ else ++ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' ++ fi ++ if test "$DSYMUTIL" != ":"; then ++ _lt_dsymutil='~$DSYMUTIL $lib || :' ++ else ++ _lt_dsymutil= + fi +- +- CPPFLAGS="$save_CPPFLAGS" +- LDFLAGS="$save_LDFLAGS" +- LIBS="$save_LIBS" + ;; + esac ++]) + +- case $lt_cv_dlopen_self in +- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; +- *) enable_dlopen_self=unknown ;; +- esac + +- case $lt_cv_dlopen_self_static in +- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; +- *) enable_dlopen_self_static=unknown ;; +- esac +-fi +-])# AC_LIBTOOL_DLOPEN_SELF ++# _LT_DARWIN_LINKER_FEATURES ++# -------------------------- ++# Checks for linker and compiler features on darwin ++m4_defun([_LT_DARWIN_LINKER_FEATURES], ++[ ++ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ _LT_TAGVAR(hardcode_direct, $1)=no ++ _LT_TAGVAR(hardcode_automatic, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='' ++ _LT_TAGVAR(link_all_deplibs, $1)=yes ++ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" ++ if test "$GCC" = "yes"; then ++ output_verbose_link_cmd=echo ++ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" ++ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" ++ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" ++ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" ++ m4_if([$1], [CXX], ++[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then ++ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" ++ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" ++ fi ++],[]) ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++]) + ++# _LT_SYS_MODULE_PATH_AIX ++# ----------------------- ++# Links a minimal program and checks the executable ++# for the system default hardcoded library path. In most cases, ++# this is /usr/lib:/lib, but when the MPI compilers are used ++# the location of the communication and MPI libs are included too. ++# If we don't find anything, use the default library path according ++# to the aix ld manual. ++m4_defun([_LT_SYS_MODULE_PATH_AIX], ++[m4_require([_LT_DECL_SED])dnl ++AC_LINK_IFELSE(AC_LANG_PROGRAM,[ ++lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\(.*\)$/\1/ ++ p ++ } ++ }' ++aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++# Check for a 64-bit object if we didn't find anything. ++if test -z "$aix_libpath"; then ++ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++fi],[]) ++if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++])# _LT_SYS_MODULE_PATH_AIX + +-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +-# --------------------------------- +-# Check to see if options -c and -o are simultaneously supported by compiler +-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], +- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], +- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no +- $rm -r conftest 2>/dev/null +- mkdir conftest +- cd conftest +- mkdir out +- printf "$lt_simple_compile_test_code" > conftest.$ac_ext + +- lt_compiler_flag="-o out/conftest2.$ac_objext" +- # Insert the option either (1) after the last *FLAGS variable, or +- # (2) before a word containing "conftest.", or (3) at the end. +- # Note that $ac_compile itself does not contain backslashes and begins +- # with a dollar sign (not a hyphen), so the echo should work correctly. +- lt_compile=`echo "$ac_compile" | $SED \ +- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ +- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ +- -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) +- (eval "$lt_compile" 2>out/conftest.err) +- ac_status=$? +- cat out/conftest.err >&AS_MESSAGE_LOG_FD +- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD +- if (exit $ac_status) && test -s out/conftest2.$ac_objext +- then +- # The compiler can only warn and ignore the option if not recognized +- # So say no if there are warnings +- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp +- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 +- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then +- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes +- fi +- fi +- chmod u+w . 2>&AS_MESSAGE_LOG_FD +- $rm conftest* +- # SGI C++ compiler will create directory out/ii_files/ for +- # template instantiation +- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files +- $rm out/* && rmdir out +- cd .. +- rmdir conftest +- $rm conftest* +-]) +-])# AC_LIBTOOL_PROG_CC_C_O ++# _LT_SHELL_INIT(ARG) ++# ------------------- ++m4_define([_LT_SHELL_INIT], ++[ifdef([AC_DIVERSION_NOTICE], ++ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], ++ [AC_DIVERT_PUSH(NOTICE)]) ++$1 ++AC_DIVERT_POP ++])# _LT_SHELL_INIT + + +-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +-# ----------------------------------------- +-# Check to see if we can do hard links to lock some files if needed +-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +-[AC_REQUIRE([_LT_AC_LOCK])dnl ++# _LT_PROG_ECHO_BACKSLASH ++# ----------------------- ++# Add some code to the start of the generated configure script which ++# will find an echo command which doesn't interpret backslashes. ++m4_defun([_LT_PROG_ECHO_BACKSLASH], ++[_LT_SHELL_INIT([ ++# Check that we are running under the correct shell. ++SHELL=${CONFIG_SHELL-/bin/sh} + +-hard_links="nottested" +-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then +- # do not overwrite the value of need_locks provided by the user +- AC_MSG_CHECKING([if we can lock with hard links]) +- hard_links=yes +- $rm conftest* +- ln conftest.a conftest.b 2>/dev/null && hard_links=no +- touch conftest.a +- ln conftest.a conftest.b 2>&5 || hard_links=no +- ln conftest.a conftest.b 2>/dev/null && hard_links=no +- AC_MSG_RESULT([$hard_links]) +- if test "$hard_links" = no; then +- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) +- need_locks=warn +- fi ++case X$lt_ECHO in ++X*--fallback-echo) ++ # Remove one level of quotation (which was required for Make). ++ ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ++ ;; ++esac ++ ++ECHO=${lt_ECHO-echo} ++if test "X[$]1" = X--no-reexec; then ++ # Discard the --no-reexec flag, and continue. ++ shift ++elif test "X[$]1" = X--fallback-echo; then ++ # Avoid inline document here, it may be left over ++ : ++elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then ++ # Yippee, $ECHO works! ++ : + else +- need_locks=no ++ # Restart under the correct shell. ++ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} + fi +-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + +- +-# AC_LIBTOOL_OBJDIR +-# ----------------- +-AC_DEFUN([AC_LIBTOOL_OBJDIR], +-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +-[rm -f .libs 2>/dev/null +-mkdir .libs 2>/dev/null +-if test -d .libs; then +- lt_cv_objdir=.libs +-else +- # MS-DOS does not allow filenames that begin with a dot. +- lt_cv_objdir=_libs ++if test "X[$]1" = X--fallback-echo; then ++ # used as fallback echo ++ shift ++ cat <<_LT_EOF ++[$]* ++_LT_EOF ++ exit 0 + fi +-rmdir .libs 2>/dev/null]) +-objdir=$lt_cv_objdir +-])# AC_LIBTOOL_OBJDIR + ++# The HP-UX ksh and POSIX shell print the target directory to stdout ++# if CDPATH is set. ++(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +-# ---------------------------------------------- +-# Check hardcoding attributes. +-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +-[AC_MSG_CHECKING([how to hardcode library paths into programs]) +-_LT_AC_TAGVAR(hardcode_action, $1)= +-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ +- test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ +- test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then +- +- # We can hardcode non-existant directories. +- if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && +- # If the only mechanism to avoid hardcoding is shlibpath_var, we +- # have to relink, otherwise we might link with an installed library +- # when we should be linking with a yet-to-be-installed one +- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && +- test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then +- # Linking always hardcodes the temporary library directory. +- _LT_AC_TAGVAR(hardcode_action, $1)=relink +- else +- # We can link without hardcoding, and we can hardcode nonexisting dirs. +- _LT_AC_TAGVAR(hardcode_action, $1)=immediate ++if test -z "$lt_ECHO"; then ++ if test "X${echo_test_string+set}" != Xset; then ++ # find a string as large as possible, as long as the shell can cope with it ++ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do ++ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... ++ if { echo_test_string=`eval $cmd`; } 2>/dev/null && ++ { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null ++ then ++ break ++ fi ++ done + fi +-else +- # We cannot hardcode anything, or else we can only hardcode existing +- # directories. +- _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +-fi +-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then +- # Fast installation is not supported +- enable_fast_install=no +-elif test "$shlibpath_overrides_runpath" = yes || +- test "$enable_shared" = no; then +- # Fast installation is not necessary +- enable_fast_install=needless +-fi +-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH ++ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && ++ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && ++ test "X$echo_testing_string" = "X$echo_test_string"; then ++ : ++ else ++ # The Solaris, AIX, and Digital Unix default echo programs unquote ++ # backslashes. This makes it impossible to quote backslashes using ++ # echo "$something" | sed 's/\\/\\\\/g' ++ # ++ # So, first we look for a working echo in the user's PATH. + ++ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ++ for dir in $PATH /usr/ucb; do ++ IFS="$lt_save_ifs" ++ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && ++ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && ++ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && ++ test "X$echo_testing_string" = "X$echo_test_string"; then ++ ECHO="$dir/echo" ++ break ++ fi ++ done ++ IFS="$lt_save_ifs" + +-# AC_LIBTOOL_SYS_LIB_STRIP +-# ------------------------ +-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +-[striplib= +-old_striplib= +-AC_MSG_CHECKING([whether stripping libraries is possible]) +-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then +- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" +- test -z "$striplib" && striplib="$STRIP --strip-unneeded" +- AC_MSG_RESULT([yes]) +-else +-# FIXME - insert some real tests, host_os isn't really good enough +- case $host_os in +- darwin*) +- if test -n "$STRIP" ; then +- striplib="$STRIP -x" +- AC_MSG_RESULT([yes]) +- else +- AC_MSG_RESULT([no]) +-fi +- ;; +- *) +- AC_MSG_RESULT([no]) +- ;; +- esac +-fi +-])# AC_LIBTOOL_SYS_LIB_STRIP ++ if test "X$ECHO" = Xecho; then ++ # We didn't find a better echo, so look for alternatives. ++ if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && ++ echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && ++ test "X$echo_testing_string" = "X$echo_test_string"; then ++ # This shell has a builtin print -r that does the trick. ++ ECHO='print -r' ++ elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && ++ test "X$CONFIG_SHELL" != X/bin/ksh; then ++ # If we have ksh, try running configure again with it. ++ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} ++ export ORIGINAL_CONFIG_SHELL ++ CONFIG_SHELL=/bin/ksh ++ export CONFIG_SHELL ++ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} ++ else ++ # Try using printf. ++ ECHO='printf %s\n' ++ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && ++ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && ++ test "X$echo_testing_string" = "X$echo_test_string"; then ++ # Cool, printf works ++ : ++ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && ++ test "X$echo_testing_string" = 'X\t' && ++ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && ++ test "X$echo_testing_string" = "X$echo_test_string"; then ++ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL ++ export CONFIG_SHELL ++ SHELL="$CONFIG_SHELL" ++ export SHELL ++ ECHO="$CONFIG_SHELL [$]0 --fallback-echo" ++ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && ++ test "X$echo_testing_string" = 'X\t' && ++ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && ++ test "X$echo_testing_string" = "X$echo_test_string"; then ++ ECHO="$CONFIG_SHELL [$]0 --fallback-echo" ++ else ++ # maybe with a smaller string... ++ prev=: + ++ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do ++ if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null ++ then ++ break ++ fi ++ prev="$cmd" ++ done + +-# AC_LIBTOOL_SYS_DYNAMIC_LINKER +-# ----------------------------- +-# PORTME Fill in your ld.so characteristics +-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +-[AC_MSG_CHECKING([dynamic linker characteristics]) +-library_names_spec= +-libname_spec='lib$name' +-soname_spec= +-shrext_cmds=".so" +-postinstall_cmds= +-postuninstall_cmds= +-finish_cmds= +-finish_eval= +-shlibpath_var= +-shlibpath_overrides_runpath=unknown +-version_type=none +-dynamic_linker="$host_os ld.so" +-sys_lib_dlsearch_path_spec="/lib /usr/lib" +-if test "$GCC" = yes; then +- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` +- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then +- # if the path contains ";" then we assume it to be the separator +- # otherwise default to the standard path separator (i.e. ":") - it is +- # assumed that no part of a normal pathname contains ";" but that should +- # okay in the real world where ";" in dirpaths is itself problematic. +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` +- else +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ if test "$prev" != 'sed 50q "[$]0"'; then ++ echo_test_string=`eval $prev` ++ export echo_test_string ++ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} ++ else ++ # Oops. We lost completely, so just stick with echo. ++ ECHO=echo ++ fi ++ fi ++ fi ++ fi + fi +-else +- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + fi +-need_lib_prefix=unknown +-hardcode_into_libs=no + +-# when you set need_version to no, make sure it does not cause -set_version +-# flags to be left without arguments +-need_version=unknown ++# Copy echo and quote the copy suitably for passing to libtool from ++# the Makefile, instead of quoting the original, which is used later. ++lt_ECHO=$ECHO ++if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ++ lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" ++fi + +-case $host_os in +-aix3*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' +- shlibpath_var=LIBPATH ++AC_SUBST(lt_ECHO) ++]) ++_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) ++_LT_DECL([], [ECHO], [1], ++ [An echo program that does not interpret backslashes]) ++])# _LT_PROG_ECHO_BACKSLASH + +- # AIX 3 has no versioning support, so we append a major version to the name. +- soname_spec='${libname}${release}${shared_ext}$major' +- ;; + +-aix4* | aix5*) +- version_type=linux +- need_lib_prefix=no +- need_version=no +- hardcode_into_libs=yes +- if test "$host_cpu" = ia64; then +- # AIX 5 supports IA64 +- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- else +- # With GCC up to 2.95.x, collect2 would create an import file +- # for dependence libraries. The import file would start with +- # the line `#! .'. This would cause the generated library to +- # depend on `.', always an invalid library. This was fixed in +- # development snapshots of GCC prior to 3.0. +- case $host_os in +- aix4 | aix4.[[01]] | aix4.[[01]].*) +- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' +- echo ' yes ' +- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then +- : +- else +- can_build_shared=no +- fi +- ;; ++# _LT_ENABLE_LOCK ++# --------------- ++m4_defun([_LT_ENABLE_LOCK], ++[AC_ARG_ENABLE([libtool-lock], ++ [AS_HELP_STRING([--disable-libtool-lock], ++ [avoid locking (might break parallel builds)])]) ++test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes ++ ++# Some flags need to be propagated to the compiler or linker for good ++# libtool support. ++case $host in ++ia64-*-hpux*) ++ # Find out which ABI we are using. ++ echo 'int i;' > conftest.$ac_ext ++ if AC_TRY_EVAL(ac_compile); then ++ case `/usr/bin/file conftest.$ac_objext` in ++ *ELF-32*) ++ HPUX_IA64_MODE="32" ++ ;; ++ *ELF-64*) ++ HPUX_IA64_MODE="64" ++ ;; + esac +- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct +- # soname into executable. Probably we can add versioning support to +- # collect2, so additional links can be useful in future. +- if test "$aix_use_runtimelinking" = yes; then +- # If using run time linking (on AIX 4.2 or later) use lib.so +- # instead of lib.a to let people know that these are not +- # typical AIX shared libraries. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ fi ++ rm -rf conftest* ++ ;; ++*-*-irix6*) ++ # Find out which ABI we are using. ++ echo '[#]line __oline__ "configure"' > conftest.$ac_ext ++ if AC_TRY_EVAL(ac_compile); then ++ if test "$lt_cv_prog_gnu_ld" = yes; then ++ case `/usr/bin/file conftest.$ac_objext` in ++ *32-bit*) ++ LD="${LD-ld} -melf32bsmip" ++ ;; ++ *N32*) ++ LD="${LD-ld} -melf32bmipn32" ++ ;; ++ *64-bit*) ++ LD="${LD-ld} -melf64bmip" ++ ;; ++ esac + else +- # We preserve .a as extension for shared libraries through AIX4.2 +- # and later when we are not doing run time linking. +- library_names_spec='${libname}${release}.a $libname.a' +- soname_spec='${libname}${release}${shared_ext}$major' ++ case `/usr/bin/file conftest.$ac_objext` in ++ *32-bit*) ++ LD="${LD-ld} -32" ++ ;; ++ *N32*) ++ LD="${LD-ld} -n32" ++ ;; ++ *64-bit*) ++ LD="${LD-ld} -64" ++ ;; ++ esac + fi +- shlibpath_var=LIBPATH + fi ++ rm -rf conftest* + ;; + +-amigaos*) +- library_names_spec='$libname.ixlibrary $libname.a' +- # Create ${libname}_ixlibrary.a entries in /sys/libs. +- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ++x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ ++s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ++ # Find out which ABI we are using. ++ echo 'int i;' > conftest.$ac_ext ++ if AC_TRY_EVAL(ac_compile); then ++ case `/usr/bin/file conftest.o` in ++ *32-bit*) ++ case $host in ++ x86_64-*kfreebsd*-gnu) ++ LD="${LD-ld} -m elf_i386_fbsd" ++ ;; ++ x86_64-*linux*) ++ LD="${LD-ld} -m elf_i386" ++ ;; ++ ppc64-*linux*|powerpc64-*linux*) ++ LD="${LD-ld} -m elf32ppclinux" ++ ;; ++ s390x-*linux*) ++ LD="${LD-ld} -m elf_s390" ++ ;; ++ sparc64-*linux*) ++ LD="${LD-ld} -m elf32_sparc" ++ ;; ++ esac ++ ;; ++ *64-bit*) ++ case $host in ++ x86_64-*kfreebsd*-gnu) ++ LD="${LD-ld} -m elf_x86_64_fbsd" ++ ;; ++ x86_64-*linux*) ++ LD="${LD-ld} -m elf_x86_64" ++ ;; ++ ppc*-*linux*|powerpc*-*linux*) ++ LD="${LD-ld} -m elf64ppc" ++ ;; ++ s390*-*linux*|s390*-*tpf*) ++ LD="${LD-ld} -m elf64_s390" ++ ;; ++ sparc*-*linux*) ++ LD="${LD-ld} -m elf64_sparc" ++ ;; ++ esac ++ ;; ++ esac ++ fi ++ rm -rf conftest* + ;; + +-beos*) +- library_names_spec='${libname}${shared_ext}' +- dynamic_linker="$host_os ld.so" +- shlibpath_var=LIBRARY_PATH ++*-*-sco3.2v5*) ++ # On SCO OpenServer 5, we need -belf to get full-featured binaries. ++ SAVE_CFLAGS="$CFLAGS" ++ CFLAGS="$CFLAGS -belf" ++ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, ++ [AC_LANG_PUSH(C) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) ++ AC_LANG_POP]) ++ if test x"$lt_cv_cc_needs_belf" != x"yes"; then ++ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf ++ CFLAGS="$SAVE_CFLAGS" ++ fi + ;; +- +-bsdi[[45]]*) +- version_type=linux +- 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' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" +- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" +- # the default ld.so.conf also contains /usr/contrib/lib and +- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow +- # libtool to hard-code these into programs ++sparc*-*solaris*) ++ # Find out which ABI we are using. ++ echo 'int i;' > conftest.$ac_ext ++ if AC_TRY_EVAL(ac_compile); then ++ case `/usr/bin/file conftest.o` in ++ *64-bit*) ++ case $lt_cv_prog_gnu_ld in ++ yes*) LD="${LD-ld} -m elf64_sparc" ;; ++ *) ++ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then ++ LD="${LD-ld} -64" ++ fi ++ ;; ++ esac ++ ;; ++ esac ++ fi ++ rm -rf conftest* + ;; ++esac + +-cygwin* | mingw* | pw32*) +- version_type=windows +- shrext_cmds=".dll" +- need_version=no +- need_lib_prefix=no ++need_locks="$enable_libtool_lock" ++])# _LT_ENABLE_LOCK + +- case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32*) +- library_names_spec='$libname.dll.a' +- # DLL is installed to $(libdir)/../bin by postinstall_cmds +- postinstall_cmds='base_file=`basename \${file}`~ +- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ +- dldir=$destdir/`dirname \$dlpath`~ +- test -d \$dldir || mkdir -p \$dldir~ +- $install_prog $dir/$dlname \$dldir/$dlname~ +- chmod a+x \$dldir/$dlname' +- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ +- dlpath=$dir/\$dldll~ +- $rm \$dlpath' +- shlibpath_overrides_runpath=yes + +- case $host_os in +- cygwin*) +- # Cygwin DLLs use 'cyg' prefix rather than 'lib' +- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +- ;; +- mingw*) +- # MinGW DLLs use traditional 'lib' prefix +- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` +- if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then +- # It is most probably a Windows format PATH printed by +- # mingw gcc, but we are running on Cygwin. Gcc prints its search +- # path with ; separators, and with drive letters. We can handle the +- # drive letters (cygwin fileutils understands them), so leave them, +- # especially as we might pass files found there to a mingw objdump, +- # which wouldn't understand a cygwinified path. Ahh. +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` +- else +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` +- fi +- ;; +- pw32*) +- # pw32 DLLs use 'pw' prefix rather than 'lib' +- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- ;; +- esac +- ;; ++# _LT_CMD_OLD_ARCHIVE ++# ------------------- ++m4_defun([_LT_CMD_OLD_ARCHIVE], ++[AC_CHECK_TOOL(AR, ar, false) ++test -z "$AR" && AR=ar ++test -z "$AR_FLAGS" && AR_FLAGS=cru ++_LT_DECL([], [AR], [1], [The archiver]) ++_LT_DECL([], [AR_FLAGS], [1]) ++ ++AC_CHECK_TOOL(STRIP, strip, :) ++test -z "$STRIP" && STRIP=: ++_LT_DECL([], [STRIP], [1], [A symbol stripping program]) ++ ++AC_CHECK_TOOL(RANLIB, ranlib, :) ++test -z "$RANLIB" && RANLIB=: ++_LT_DECL([], [RANLIB], [1], ++ [Commands used to install an old-style archive]) ++ ++# Determine commands to create old-style static archives. ++old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' ++old_postinstall_cmds='chmod 644 $oldlib' ++old_postuninstall_cmds= + ++if test -n "$RANLIB"; then ++ case $host_os in ++ openbsd*) ++ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ++ ;; + *) +- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ++ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac +- dynamic_linker='Win32 ld.exe' +- # FIXME: first we should search . and the directory the executable is in +- shlibpath_var=PATH +- ;; ++ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" ++fi ++_LT_DECL([], [old_postinstall_cmds], [2]) ++_LT_DECL([], [old_postuninstall_cmds], [2]) ++_LT_TAGDECL([], [old_archive_cmds], [2], ++ [Commands used to build an old-style archive]) ++])# _LT_CMD_OLD_ARCHIVE + +-darwin* | rhapsody*) +- dynamic_linker="$host_os dyld" +- version_type=darwin +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' +- soname_spec='${libname}${release}${major}$shared_ext' +- shlibpath_overrides_runpath=yes +- shlibpath_var=DYLD_LIBRARY_PATH +- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. +- if test "$GCC" = yes; then +- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` +- else +- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' +- fi +- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' +- ;; + +-dgux*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- ;; ++# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, ++# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) ++# ---------------------------------------------------------------- ++# Check whether the given compiler option works ++AC_DEFUN([_LT_COMPILER_OPTION], ++[m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++m4_require([_LT_DECL_SED])dnl ++AC_CACHE_CHECK([$1], [$2], ++ [$2=no ++ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) ++ echo "$lt_simple_compile_test_code" > conftest.$ac_ext ++ lt_compiler_flag="$3" ++ # Insert the option either (1) after the last *FLAGS variable, or ++ # (2) before a word containing "conftest.", or (3) at the end. ++ # Note that $ac_compile itself does not contain backslashes and begins ++ # with a dollar sign (not a hyphen), so the echo should work correctly. ++ # The option is referenced via a variable to avoid confusing sed. ++ lt_compile=`echo "$ac_compile" | $SED \ ++ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ ++ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ ++ -e 's:$: $lt_compiler_flag:'` ++ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) ++ (eval "$lt_compile" 2>conftest.err) ++ ac_status=$? ++ cat conftest.err >&AS_MESSAGE_LOG_FD ++ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD ++ if (exit $ac_status) && test -s "$ac_outfile"; then ++ # The compiler can only warn and ignore the option if not recognized ++ # So say no if there are warnings other than the usual output. ++ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp ++ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 ++ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then ++ $2=yes ++ fi ++ fi ++ $RM conftest* ++]) + +-freebsd1*) +- dynamic_linker=no +- ;; ++if test x"[$]$2" = xyes; then ++ m4_if([$5], , :, [$5]) ++else ++ m4_if([$6], , :, [$6]) ++fi ++])# _LT_COMPILER_OPTION + +-kfreebsd*-gnu) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- dynamic_linker='GNU ld.so' +- ;; ++# Old name: ++AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + +-freebsd* | dragonfly*) +- # DragonFly does not have aout. When/if they implement a new +- # versioning mechanism, adjust this. +- if test -x /usr/bin/objformat; then +- objformat=`/usr/bin/objformat` +- else +- case $host_os in +- freebsd[[123]]*) objformat=aout ;; +- *) objformat=elf ;; +- esac +- fi +- version_type=freebsd-$objformat +- case $version_type in +- freebsd-elf*) +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' +- need_version=no +- need_lib_prefix=no +- ;; +- freebsd-*) +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' +- need_version=yes +- ;; +- esac +- shlibpath_var=LD_LIBRARY_PATH +- case $host_os in +- freebsd2*) +- shlibpath_overrides_runpath=yes +- ;; +- freebsd3.[[01]]* | freebsdelf3.[[01]]*) +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes ++ ++# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, ++# [ACTION-SUCCESS], [ACTION-FAILURE]) ++# ---------------------------------------------------- ++# Check whether the given linker option works ++AC_DEFUN([_LT_LINKER_OPTION], ++[m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++m4_require([_LT_DECL_SED])dnl ++AC_CACHE_CHECK([$1], [$2], ++ [$2=no ++ save_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS $3" ++ echo "$lt_simple_link_test_code" > conftest.$ac_ext ++ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then ++ # The linker can only warn and ignore the option if not recognized ++ # So say no if there are warnings ++ if test -s conftest.err; then ++ # Append any errors to the config.log. ++ cat conftest.err 1>&AS_MESSAGE_LOG_FD ++ $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp ++ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 ++ if diff conftest.exp conftest.er2 >/dev/null; then ++ $2=yes ++ fi ++ else ++ $2=yes ++ fi ++ fi ++ $RM -r conftest* ++ LDFLAGS="$save_LDFLAGS" ++]) ++ ++if test x"[$]$2" = xyes; then ++ m4_if([$4], , :, [$4]) ++else ++ m4_if([$5], , :, [$5]) ++fi ++])# _LT_LINKER_OPTION ++ ++# Old name: ++AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) ++ ++ ++# LT_CMD_MAX_LEN ++#--------------- ++AC_DEFUN([LT_CMD_MAX_LEN], ++[AC_REQUIRE([AC_CANONICAL_HOST])dnl ++# find the maximum length of command line arguments ++AC_MSG_CHECKING([the maximum length of command line arguments]) ++AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl ++ i=0 ++ teststring="ABCD" ++ ++ case $build_os in ++ msdosdjgpp*) ++ # On DJGPP, this test can blow up pretty badly due to problems in libc ++ # (any single argument exceeding 2000 bytes causes a buffer overrun ++ # during glob expansion). Even if it were fixed, the result of this ++ # check would be larger than it should be. ++ lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; +- freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ +- freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes ++ ++ gnu*) ++ # Under GNU Hurd, this test is not required because there is ++ # no limit to the length of command line arguments. ++ # Libtool will interpret -1 as no limit whatsoever ++ lt_cv_sys_max_cmd_len=-1; + ;; +- freebsd*) # from 4.6 on +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes ++ ++ cygwin* | mingw*) ++ # On Win9x/ME, this test blows up -- it succeeds, but takes ++ # about 5 minutes as the teststring grows exponentially. ++ # Worse, since 9x/ME are not pre-emptively multitasking, ++ # you end up with a "frozen" computer, even though with patience ++ # the test eventually succeeds (with a max line length of 256k). ++ # Instead, let's just punt: use the minimum linelength reported by ++ # all of the supported platforms: 8192 (on NT/2K/XP). ++ lt_cv_sys_max_cmd_len=8192; + ;; +- esac +- ;; + +-gnu*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- hardcode_into_libs=yes +- ;; ++ amigaos*) ++ # On AmigaOS with pdksh, this test takes hours, literally. ++ # So we just punt and use a minimum line length of 8192. ++ lt_cv_sys_max_cmd_len=8192; ++ ;; + +-hpux9* | hpux10* | hpux11*) +- # Give a soname corresponding to the major version so that dld.sl refuses to +- # link against other versions. +- version_type=sunos +- need_lib_prefix=no +- need_version=no +- case $host_cpu in +- ia64*) +- shrext_cmds='.so' +- hardcode_into_libs=yes +- dynamic_linker="$host_os dld.so" +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- if test "X$HPUX_IA64_MODE" = X32; then +- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" ++ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) ++ # This has been around since 386BSD, at least. Likely further. ++ if test -x /sbin/sysctl; then ++ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` ++ elif test -x /usr/sbin/sysctl; then ++ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else +- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" ++ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi +- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec +- ;; +- hppa*64*) +- shrext_cmds='.sl' +- hardcode_into_libs=yes +- dynamic_linker="$host_os dld.sl" +- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH +- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" +- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec +- ;; +- *) +- shrext_cmds='.sl' +- dynamic_linker="$host_os dld.sl" +- shlibpath_var=SHLIB_PATH +- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ # And add a safety zone ++ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` ++ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; +- esac +- # HP-UX runs *really* slowly unless shared libraries are mode 555. +- postinstall_cmds='chmod 555 $lib' +- ;; + +-interix3*) +- version_type=linux +- need_lib_prefix=no +- 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' +- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- ;; ++ interix*) ++ # We know the value 262144 and hardcode it with a safety zone (like BSD) ++ lt_cv_sys_max_cmd_len=196608 ++ ;; + +-irix5* | irix6* | nonstopux*) +- case $host_os in +- nonstopux*) version_type=nonstopux ;; +- *) +- if test "$lt_cv_prog_gnu_ld" = yes; then +- version_type=linux +- else +- version_type=irix +- fi ;; +- esac +- need_lib_prefix=no +- need_version=no +- soname_spec='${libname}${release}${shared_ext}$major' +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' +- case $host_os in +- irix5* | nonstopux*) +- libsuff= shlibsuff= ++ osf*) ++ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure ++ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not ++ # nice to cause kernel panics so lets avoid the loop below. ++ # First set a reasonable default. ++ lt_cv_sys_max_cmd_len=16384 ++ # ++ if test -x /sbin/sysconfig; then ++ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in ++ *1*) lt_cv_sys_max_cmd_len=-1 ;; ++ esac ++ fi ++ ;; ++ sco3.2v5*) ++ lt_cv_sys_max_cmd_len=102400 ++ ;; ++ sysv5* | sco5v6* | sysv4.2uw2*) ++ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` ++ if test -n "$kargmax"; then ++ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` ++ else ++ lt_cv_sys_max_cmd_len=32768 ++ fi + ;; + *) +- case $LD in # libtool.m4 will add one of these switches to LD +- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") +- libsuff= shlibsuff= libmagic=32-bit;; +- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") +- libsuff=32 shlibsuff=N32 libmagic=N32;; +- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") +- libsuff=64 shlibsuff=64 libmagic=64-bit;; +- *) libsuff= shlibsuff= libmagic=never-match;; +- esac ++ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` ++ if test -n "$lt_cv_sys_max_cmd_len"; then ++ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` ++ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ++ else ++ # Make teststring a little bigger before we do anything with it. ++ # a 1K string should be a reasonable start. ++ for i in 1 2 3 4 5 6 7 8 ; do ++ teststring=$teststring$teststring ++ done ++ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} ++ # If test is not a shell built-in, we'll probably end up computing a ++ # maximum length that is only half of the actual maximum length, but ++ # we can't tell. ++ while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ ++ = "XX$teststring$teststring"; } >/dev/null 2>&1 && ++ test $i != 17 # 1/2 MB should be enough ++ do ++ i=`expr $i + 1` ++ teststring=$teststring$teststring ++ done ++ # Only check the string length outside the loop. ++ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` ++ teststring= ++ # Add a significant safety factor because C++ compilers can tack on ++ # massive amounts of additional arguments before passing them to the ++ # linker. It appears as though 1/2 is a usable value. ++ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ++ fi + ;; + esac +- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH +- shlibpath_overrides_runpath=no +- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" +- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" +- hardcode_into_libs=yes +- ;; ++]) ++if test -n $lt_cv_sys_max_cmd_len ; then ++ AC_MSG_RESULT($lt_cv_sys_max_cmd_len) ++else ++ AC_MSG_RESULT(none) ++fi ++max_cmd_len=$lt_cv_sys_max_cmd_len ++_LT_DECL([], [max_cmd_len], [0], ++ [What is the maximum length of a command?]) ++])# LT_CMD_MAX_LEN + +-# No shared lib support for Linux oldld, aout, or coff. +-linux*oldld* | linux*aout* | linux*coff*) +- dynamic_linker=no +- ;; ++# Old name: ++AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + +-# This must be Linux ELF. +-linux*) +- version_type=linux +- need_lib_prefix=no +- 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' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- # This implies no fast_install, which is unacceptable. +- # Some rework will be needed to allow for fast_install +- # before this can be enabled. +- hardcode_into_libs=yes + +- # Append ld.so.conf contents to the search path +- if test -f /etc/ld.so.conf; then +- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" +- fi ++# _LT_HEADER_DLFCN ++# ---------------- ++m4_defun([_LT_HEADER_DLFCN], ++[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ++])# _LT_HEADER_DLFCN + +- # We used to test for /lib/ld.so.1 and disable shared libraries on +- # powerpc, because MkLinux only supported shared libraries with the +- # GNU dynamic linker. Since this was broken with cross compilers, +- # most powerpc-linux boxes support dynamic linking these days and +- # people can always --disable-shared, the test was removed, and we +- # assume the GNU/Linux dynamic linker is in use. +- dynamic_linker='GNU/Linux ld.so' +- ;; + +-knetbsd*-gnu) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- dynamic_linker='GNU ld.so' +- ;; ++# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, ++# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) ++# ---------------------------------------------------------------- ++m4_defun([_LT_TRY_DLOPEN_SELF], ++[m4_require([_LT_HEADER_DLFCN])dnl ++if test "$cross_compiling" = yes; then : ++ [$4] ++else ++ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 ++ lt_status=$lt_dlunknown ++ cat > conftest.$ac_ext <<_LT_EOF ++[#line __oline__ "configure" ++#include "confdefs.h" + +-netbsd*) +- version_type=sunos +- need_lib_prefix=no +- need_version=no +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' +- dynamic_linker='NetBSD (a.out) ld.so' +- else +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- dynamic_linker='NetBSD ld.elf_so' +- fi +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- ;; ++#if HAVE_DLFCN_H ++#include ++#endif + +-newsos6) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- ;; ++#include + +-nto-qnx*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- ;; ++#ifdef RTLD_GLOBAL ++# define LT_DLGLOBAL RTLD_GLOBAL ++#else ++# ifdef DL_GLOBAL ++# define LT_DLGLOBAL DL_GLOBAL ++# else ++# define LT_DLGLOBAL 0 ++# endif ++#endif + +-openbsd*) +- version_type=sunos +- sys_lib_dlsearch_path_spec="/usr/lib" +- need_lib_prefix=no +- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. +- case $host_os in +- openbsd3.3 | openbsd3.3.*) need_version=yes ;; +- *) need_version=no ;; +- esac +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- case $host_os in +- openbsd2.[[89]] | openbsd2.[[89]].*) +- shlibpath_overrides_runpath=no +- ;; +- *) +- shlibpath_overrides_runpath=yes +- ;; +- esac ++/* We may have to define LT_DLLAZY_OR_NOW in the command line if we ++ find out it does not work in some platform. */ ++#ifndef LT_DLLAZY_OR_NOW ++# ifdef RTLD_LAZY ++# define LT_DLLAZY_OR_NOW RTLD_LAZY ++# else ++# ifdef DL_LAZY ++# define LT_DLLAZY_OR_NOW DL_LAZY ++# else ++# ifdef RTLD_NOW ++# define LT_DLLAZY_OR_NOW RTLD_NOW ++# else ++# ifdef DL_NOW ++# define LT_DLLAZY_OR_NOW DL_NOW ++# else ++# define LT_DLLAZY_OR_NOW 0 ++# endif ++# endif ++# endif ++# endif ++#endif ++ ++#ifdef __cplusplus ++extern "C" void exit (int); ++#endif ++ ++void fnord() { int i=42;} ++int main () ++{ ++ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); ++ int status = $lt_dlunknown; ++ ++ if (self) ++ { ++ if (dlsym (self,"fnord")) status = $lt_dlno_uscore; ++ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; ++ /* dlclose (self); */ ++ } + else +- shlibpath_overrides_runpath=yes ++ puts (dlerror ()); ++ ++ exit (status); ++}] ++_LT_EOF ++ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then ++ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null ++ lt_status=$? ++ case x$lt_status in ++ x$lt_dlno_uscore) $1 ;; ++ x$lt_dlneed_uscore) $2 ;; ++ x$lt_dlunknown|x*) $3 ;; ++ esac ++ else : ++ # compilation failed ++ $3 + fi +- ;; ++fi ++rm -fr conftest* ++])# _LT_TRY_DLOPEN_SELF + +-os2*) +- libname_spec='$name' +- shrext_cmds=".dll" +- need_lib_prefix=no +- library_names_spec='$libname${shared_ext} $libname.a' +- dynamic_linker='OS/2 ld.exe' +- shlibpath_var=LIBPATH +- ;; + +-osf3* | osf4* | osf5*) +- version_type=osf +- need_lib_prefix=no +- need_version=no +- soname_spec='${libname}${release}${shared_ext}$major' +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" +- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" +- ;; ++# LT_SYS_DLOPEN_SELF ++# ------------------ ++AC_DEFUN([LT_SYS_DLOPEN_SELF], ++[m4_require([_LT_HEADER_DLFCN])dnl ++if test "x$enable_dlopen" != xyes; then ++ enable_dlopen=unknown ++ enable_dlopen_self=unknown ++ enable_dlopen_self_static=unknown ++else ++ lt_cv_dlopen=no ++ lt_cv_dlopen_libs= + +-solaris*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- # ldd complains unless libraries are executable +- postinstall_cmds='chmod +x $lib' +- ;; ++ case $host_os in ++ beos*) ++ lt_cv_dlopen="load_add_on" ++ lt_cv_dlopen_libs= ++ lt_cv_dlopen_self=yes ++ ;; + +-sunos4*) +- version_type=sunos +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- if test "$with_gnu_ld" = yes; then +- need_lib_prefix=no +- fi +- need_version=yes +- ;; ++ mingw* | pw32*) ++ lt_cv_dlopen="LoadLibrary" ++ lt_cv_dlopen_libs= ++ ;; + +-sysv4 | sysv4.3*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- case $host_vendor in +- sni) +- shlibpath_overrides_runpath=no +- need_lib_prefix=no +- export_dynamic_flag_spec='${wl}-Blargedynsym' +- runpath_var=LD_RUN_PATH +- ;; +- siemens) +- need_lib_prefix=no +- ;; +- motorola) +- need_lib_prefix=no +- need_version=no +- shlibpath_overrides_runpath=no +- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' +- ;; +- esac +- ;; ++ cygwin*) ++ lt_cv_dlopen="dlopen" ++ lt_cv_dlopen_libs= ++ ;; + +-sysv4*MP*) +- if test -d /usr/nec ;then +- version_type=linux +- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' +- soname_spec='$libname${shared_ext}.$major' +- shlibpath_var=LD_LIBRARY_PATH +- fi +- ;; ++ darwin*) ++ # if libdl is installed we need to link against it ++ AC_CHECK_LIB([dl], [dlopen], ++ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ ++ lt_cv_dlopen="dyld" ++ lt_cv_dlopen_libs= ++ lt_cv_dlopen_self=yes ++ ]) ++ ;; + +-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) +- version_type=freebsd-elf +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- hardcode_into_libs=yes +- if test "$with_gnu_ld" = yes; then +- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' +- shlibpath_overrides_runpath=no ++ *) ++ AC_CHECK_FUNC([shl_load], ++ [lt_cv_dlopen="shl_load"], ++ [AC_CHECK_LIB([dld], [shl_load], ++ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], ++ [AC_CHECK_FUNC([dlopen], ++ [lt_cv_dlopen="dlopen"], ++ [AC_CHECK_LIB([dl], [dlopen], ++ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], ++ [AC_CHECK_LIB([svld], [dlopen], ++ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], ++ [AC_CHECK_LIB([dld], [dld_link], ++ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ++ ]) ++ ]) ++ ]) ++ ]) ++ ]) ++ ;; ++ esac ++ ++ if test "x$lt_cv_dlopen" != xno; then ++ enable_dlopen=yes + else +- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' +- shlibpath_overrides_runpath=yes +- case $host_os in +- sco3.2v5*) +- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" +- ;; +- esac ++ enable_dlopen=no + fi +- sys_lib_dlsearch_path_spec='/usr/lib' +- ;; +- +-uts4*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- ;; +- +-*) +- dynamic_linker=no +- ;; +-esac +-AC_MSG_RESULT([$dynamic_linker]) +-test "$dynamic_linker" = no && can_build_shared=no +- +-variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +-if test "$GCC" = yes; then +- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +-fi +-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER +- + +-# _LT_AC_TAGCONFIG +-# ---------------- +-AC_DEFUN([_LT_AC_TAGCONFIG], +-[AC_ARG_WITH([tags], +- [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], +- [include additional configurations @<:@automatic@:>@])], +- [tagnames="$withval"]) +- +-if test -f "$ltmain" && test -n "$tagnames"; then +- if test ! -f "${ofile}"; then +- AC_MSG_WARN([output file `$ofile' does not exist]) +- fi ++ case $lt_cv_dlopen in ++ dlopen) ++ save_CPPFLAGS="$CPPFLAGS" ++ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + +- if test -z "$LTCC"; then +- eval "`$SHELL ${ofile} --config | grep '^LTCC='`" +- if test -z "$LTCC"; then +- AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) +- else +- AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) +- fi +- fi +- if test -z "$LTCFLAGS"; then +- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" +- fi ++ save_LDFLAGS="$LDFLAGS" ++ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + +- # Extract list of available tagged configurations in $ofile. +- # Note that this assumes the entire list is on one line. +- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` ++ save_LIBS="$LIBS" ++ LIBS="$lt_cv_dlopen_libs $LIBS" + +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for tagname in $tagnames; do +- IFS="$lt_save_ifs" +- # Check whether tagname contains only valid characters +- case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in +- "") ;; +- *) AC_MSG_ERROR([invalid tag name: $tagname]) +- ;; +- esac ++ AC_CACHE_CHECK([whether a program can dlopen itself], ++ lt_cv_dlopen_self, [dnl ++ _LT_TRY_DLOPEN_SELF( ++ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, ++ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ++ ]) + +- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null +- then +- AC_MSG_ERROR([tag name \"$tagname\" already exists]) ++ if test "x$lt_cv_dlopen_self" = xyes; then ++ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" ++ AC_CACHE_CHECK([whether a statically linked program can dlopen itself], ++ lt_cv_dlopen_self_static, [dnl ++ _LT_TRY_DLOPEN_SELF( ++ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, ++ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ++ ]) + fi + +- # Update the list of available tags. +- if test -n "$tagname"; then +- echo appending configuration tag \"$tagname\" to $ofile +- +- case $tagname in +- CXX) +- if test -n "$CXX" && ( test "X$CXX" != "Xno" && +- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || +- (test "X$CXX" != "Xg++"))) ; then +- AC_LIBTOOL_LANG_CXX_CONFIG +- else +- tagname="" +- fi +- ;; +- +- F77) +- if test -n "$F77" && test "X$F77" != "Xno"; then +- AC_LIBTOOL_LANG_F77_CONFIG +- else +- tagname="" +- fi +- ;; +- +- GCJ) +- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then +- AC_LIBTOOL_LANG_GCJ_CONFIG +- else +- tagname="" +- fi +- ;; +- +- RC) +- AC_LIBTOOL_LANG_RC_CONFIG +- ;; +- +- *) +- AC_MSG_ERROR([Unsupported tag name: $tagname]) +- ;; +- esac ++ CPPFLAGS="$save_CPPFLAGS" ++ LDFLAGS="$save_LDFLAGS" ++ LIBS="$save_LIBS" ++ ;; ++ esac + +- # Append the new tag name to the list of available tags. +- if test -n "$tagname" ; then +- available_tags="$available_tags $tagname" +- fi +- fi +- done +- IFS="$lt_save_ifs" ++ case $lt_cv_dlopen_self in ++ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; ++ *) enable_dlopen_self=unknown ;; ++ esac + +- # Now substitute the updated list of available tags. +- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then +- mv "${ofile}T" "$ofile" +- chmod +x "$ofile" +- else +- rm -f "${ofile}T" +- AC_MSG_ERROR([unable to update list of available tagged configurations.]) +- fi ++ case $lt_cv_dlopen_self_static in ++ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; ++ *) enable_dlopen_self_static=unknown ;; ++ esac + fi +-])# _LT_AC_TAGCONFIG ++_LT_DECL([dlopen_support], [enable_dlopen], [0], ++ [Whether dlopen is supported]) ++_LT_DECL([dlopen_self], [enable_dlopen_self], [0], ++ [Whether dlopen of programs is supported]) ++_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], ++ [Whether dlopen of statically linked programs is supported]) ++])# LT_SYS_DLOPEN_SELF ++ ++# Old name: ++AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +-# AC_LIBTOOL_DLOPEN +-# ----------------- +-# enable checks for dlopen support +-AC_DEFUN([AC_LIBTOOL_DLOPEN], +- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +-])# AC_LIBTOOL_DLOPEN ++# _LT_COMPILER_C_O([TAGNAME]) ++# --------------------------- ++# Check to see if options -c and -o are simultaneously supported by compiler. ++# This macro does not hard code the compiler like AC_PROG_CC_C_O. ++m4_defun([_LT_COMPILER_C_O], ++[m4_require([_LT_DECL_SED])dnl ++m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++m4_require([_LT_TAG_COMPILER])dnl ++AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], ++ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], ++ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no ++ $RM -r conftest 2>/dev/null ++ mkdir conftest ++ cd conftest ++ mkdir out ++ echo "$lt_simple_compile_test_code" > conftest.$ac_ext + ++ lt_compiler_flag="-o out/conftest2.$ac_objext" ++ # Insert the option either (1) after the last *FLAGS variable, or ++ # (2) before a word containing "conftest.", or (3) at the end. ++ # Note that $ac_compile itself does not contain backslashes and begins ++ # with a dollar sign (not a hyphen), so the echo should work correctly. ++ lt_compile=`echo "$ac_compile" | $SED \ ++ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ ++ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ ++ -e 's:$: $lt_compiler_flag:'` ++ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) ++ (eval "$lt_compile" 2>out/conftest.err) ++ ac_status=$? ++ cat out/conftest.err >&AS_MESSAGE_LOG_FD ++ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD ++ if (exit $ac_status) && test -s out/conftest2.$ac_objext ++ then ++ # The compiler can only warn and ignore the option if not recognized ++ # So say no if there are warnings ++ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp ++ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 ++ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then ++ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes ++ fi ++ fi ++ chmod u+w . 2>&AS_MESSAGE_LOG_FD ++ $RM conftest* ++ # SGI C++ compiler will create directory out/ii_files/ for ++ # template instantiation ++ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files ++ $RM out/* && rmdir out ++ cd .. ++ $RM -r conftest ++ $RM conftest* ++]) ++_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], ++ [Does compiler simultaneously support -c and -o options?]) ++])# _LT_COMPILER_C_O + +-# AC_LIBTOOL_WIN32_DLL +-# -------------------- +-# declare package support for building win32 DLLs +-AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +-])# AC_LIBTOOL_WIN32_DLL + ++# _LT_COMPILER_FILE_LOCKS([TAGNAME]) ++# ---------------------------------- ++# Check to see if we can do hard links to lock some files if needed ++m4_defun([_LT_COMPILER_FILE_LOCKS], ++[m4_require([_LT_ENABLE_LOCK])dnl ++m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++_LT_COMPILER_C_O([$1]) + +-# AC_ENABLE_SHARED([DEFAULT]) +-# --------------------------- +-# implement the --enable-shared flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_SHARED], +-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([shared], +- [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], +- [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_shared=yes ;; +- no) enable_shared=no ;; +- *) +- enable_shared=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_shared=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +-])# AC_ENABLE_SHARED +- +- +-# AC_DISABLE_SHARED +-# ----------------- +-# set the default shared flag to --disable-shared +-AC_DEFUN([AC_DISABLE_SHARED], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_SHARED(no) +-])# AC_DISABLE_SHARED +- +- +-# AC_ENABLE_STATIC([DEFAULT]) +-# --------------------------- +-# implement the --enable-static flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_STATIC], +-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([static], +- [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], +- [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_static=yes ;; +- no) enable_static=no ;; +- *) +- enable_static=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_static=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_static=]AC_ENABLE_STATIC_DEFAULT) +-])# AC_ENABLE_STATIC +- +- +-# AC_DISABLE_STATIC +-# ----------------- +-# set the default static flag to --disable-static +-AC_DEFUN([AC_DISABLE_STATIC], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_STATIC(no) +-])# AC_DISABLE_STATIC +- +- +-# AC_ENABLE_FAST_INSTALL([DEFAULT]) +-# --------------------------------- +-# implement the --enable-fast-install flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_FAST_INSTALL], +-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([fast-install], +- [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], +- [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_fast_install=yes ;; +- no) enable_fast_install=no ;; +- *) +- enable_fast_install=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_fast_install=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +-])# AC_ENABLE_FAST_INSTALL +- +- +-# AC_DISABLE_FAST_INSTALL +-# ----------------------- +-# set the default to --disable-fast-install +-AC_DEFUN([AC_DISABLE_FAST_INSTALL], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_FAST_INSTALL(no) +-])# AC_DISABLE_FAST_INSTALL +- +- +-# AC_LIBTOOL_PICMODE([MODE]) +-# -------------------------- +-# implement the --with-pic flag +-# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +-AC_DEFUN([AC_LIBTOOL_PICMODE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-pic_mode=ifelse($#,1,$1,default) +-])# AC_LIBTOOL_PICMODE +- +- +-# AC_PROG_EGREP +-# ------------- +-# This is predefined starting with Autoconf 2.54, so this conditional +-# definition can be removed once we require Autoconf 2.54 or later. +-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], +- [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 +- then ac_cv_prog_egrep='grep -E' +- else ac_cv_prog_egrep='egrep' +- fi]) +- EGREP=$ac_cv_prog_egrep +- AC_SUBST([EGREP]) +-])]) +- +- +-# AC_PATH_TOOL_PREFIX +-# ------------------- +-# find a file program which can recognise shared library +-AC_DEFUN([AC_PATH_TOOL_PREFIX], +-[AC_REQUIRE([AC_PROG_EGREP])dnl +-AC_MSG_CHECKING([for $1]) +-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +-[case $MAGIC_CMD in +-[[\\/*] | ?:[\\/]*]) +- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. +- ;; +-*) +- lt_save_MAGIC_CMD="$MAGIC_CMD" +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +-dnl $ac_dummy forces splitting on constant user-supplied paths. +-dnl POSIX.2 word splitting is done only on the output of word expansions, +-dnl not every word. This closes a longstanding sh security hole. +- ac_dummy="ifelse([$2], , $PATH, [$2])" +- for ac_dir in $ac_dummy; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$1; then +- lt_cv_path_MAGIC_CMD="$ac_dir/$1" +- if test -n "$file_magic_test_file"; then +- case $deplibs_check_method in +- "file_magic "*) +- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` +- MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | +- $EGREP "$file_magic_regex" > /dev/null; then +- : +- else +- cat <&2 ++hard_links="nottested" ++if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then ++ # do not overwrite the value of need_locks provided by the user ++ AC_MSG_CHECKING([if we can lock with hard links]) ++ hard_links=yes ++ $RM conftest* ++ ln conftest.a conftest.b 2>/dev/null && hard_links=no ++ touch conftest.a ++ ln conftest.a conftest.b 2>&5 || hard_links=no ++ ln conftest.a conftest.b 2>/dev/null && hard_links=no ++ AC_MSG_RESULT([$hard_links]) ++ if test "$hard_links" = no; then ++ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) ++ need_locks=warn ++ fi ++else ++ need_locks=no ++fi ++_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ++])# _LT_COMPILER_FILE_LOCKS + +-*** Warning: the command libtool uses to detect shared libraries, +-*** $file_magic_cmd, produces output that libtool cannot recognize. +-*** The result is that libtool may fail to recognize shared libraries +-*** as such. This will affect the creation of libtool libraries that +-*** depend on shared libraries, but programs linked with such libtool +-*** libraries will work regardless of this problem. Nevertheless, you +-*** may want to report the problem to your system manager and/or to +-*** bug-libtool@gnu.org + +-EOF +- fi ;; +- esac +- fi +- break +- fi +- done +- IFS="$lt_save_ifs" +- MAGIC_CMD="$lt_save_MAGIC_CMD" +- ;; +-esac]) +-MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +-if test -n "$MAGIC_CMD"; then +- AC_MSG_RESULT($MAGIC_CMD) ++# _LT_CHECK_OBJDIR ++# ---------------- ++m4_defun([_LT_CHECK_OBJDIR], ++[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], ++[rm -f .libs 2>/dev/null ++mkdir .libs 2>/dev/null ++if test -d .libs; then ++ lt_cv_objdir=.libs + else +- AC_MSG_RESULT(no) ++ # MS-DOS does not allow filenames that begin with a dot. ++ lt_cv_objdir=_libs + fi +-])# AC_PATH_TOOL_PREFIX ++rmdir .libs 2>/dev/null]) ++objdir=$lt_cv_objdir ++_LT_DECL([], [objdir], [0], ++ [The name of the directory that contains temporary libtool files])dnl ++m4_pattern_allow([LT_OBJDIR])dnl ++AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", ++ [Define to the sub-directory in which libtool stores uninstalled libraries.]) ++])# _LT_CHECK_OBJDIR + + +-# AC_PATH_MAGIC +-# ------------- +-# find a file program which can recognise a shared library +-AC_DEFUN([AC_PATH_MAGIC], +-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +-if test -z "$lt_cv_path_MAGIC_CMD"; then +- if test -n "$ac_tool_prefix"; then +- AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) ++# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) ++# -------------------------------------- ++# Check hardcoding attributes. ++m4_defun([_LT_LINKER_HARDCODE_LIBPATH], ++[AC_MSG_CHECKING([how to hardcode library paths into programs]) ++_LT_TAGVAR(hardcode_action, $1)= ++if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || ++ test -n "$_LT_TAGVAR(runpath_var, $1)" || ++ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then ++ ++ # We can hardcode non-existent directories. ++ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && ++ # If the only mechanism to avoid hardcoding is shlibpath_var, we ++ # have to relink, otherwise we might link with an installed library ++ # when we should be linking with a yet-to-be-installed one ++ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && ++ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then ++ # Linking always hardcodes the temporary library directory. ++ _LT_TAGVAR(hardcode_action, $1)=relink + else +- MAGIC_CMD=: ++ # We can link without hardcoding, and we can hardcode nonexisting dirs. ++ _LT_TAGVAR(hardcode_action, $1)=immediate + fi ++else ++ # We cannot hardcode anything, or else we can only hardcode existing ++ # directories. ++ _LT_TAGVAR(hardcode_action, $1)=unsupported ++fi ++AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) ++ ++if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || ++ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then ++ # Fast installation is not supported ++ enable_fast_install=no ++elif test "$shlibpath_overrides_runpath" = yes || ++ test "$enable_shared" = no; then ++ # Fast installation is not necessary ++ enable_fast_install=needless + fi +-])# AC_PATH_MAGIC ++_LT_TAGDECL([], [hardcode_action], [0], ++ [How to hardcode a shared library path into an executable]) ++])# _LT_LINKER_HARDCODE_LIBPATH + + +-# AC_PROG_LD +-# ---------- +-# find the pathname to the GNU or non-GNU linker +-AC_DEFUN([AC_PROG_LD], +-[AC_ARG_WITH([gnu-ld], +- [AC_HELP_STRING([--with-gnu-ld], +- [assume the C compiler uses GNU ld @<:@default=no@:>@])], +- [test "$withval" = no || with_gnu_ld=yes], +- [with_gnu_ld=no]) +-AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_REQUIRE([AC_PROG_CC])dnl +-AC_REQUIRE([AC_CANONICAL_HOST])dnl +-AC_REQUIRE([AC_CANONICAL_BUILD])dnl +-ac_prog=ld +-if test "$GCC" = yes; then +- # Check if gcc -print-prog-name=ld gives a path. +- AC_MSG_CHECKING([for ld used by $CC]) +- case $host in +- *-*-mingw*) +- # gcc leaves a trailing carriage return which upsets mingw +- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; +- *) +- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; +- esac +- case $ac_prog in +- # Accept absolute paths. +- [[\\/]]* | ?:[[\\/]]*) +- re_direlt='/[[^/]][[^/]]*/\.\./' +- # Canonicalize the pathname of ld +- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` +- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do +- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` +- done +- test -z "$LD" && LD="$ac_prog" +- ;; +- "") +- # If it fails, then pretend we aren't using GCC. +- ac_prog=ld ++# _LT_CMD_STRIPLIB ++# ---------------- ++m4_defun([_LT_CMD_STRIPLIB], ++[m4_require([_LT_DECL_EGREP]) ++striplib= ++old_striplib= ++AC_MSG_CHECKING([whether stripping libraries is possible]) ++if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then ++ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" ++ test -z "$striplib" && striplib="$STRIP --strip-unneeded" ++ AC_MSG_RESULT([yes]) ++else ++# FIXME - insert some real tests, host_os isn't really good enough ++ case $host_os in ++ darwin*) ++ if test -n "$STRIP" ; then ++ striplib="$STRIP -x" ++ old_striplib="$STRIP -S" ++ AC_MSG_RESULT([yes]) ++ else ++ AC_MSG_RESULT([no]) ++ fi + ;; + *) +- # If it is relative, then search for the first ld in PATH. +- with_gnu_ld=unknown ++ AC_MSG_RESULT([no]) + ;; + esac +-elif test "$with_gnu_ld" = yes; then +- AC_MSG_CHECKING([for GNU ld]) +-else +- AC_MSG_CHECKING([for non-GNU ld]) + fi +-AC_CACHE_VAL(lt_cv_path_LD, +-[if test -z "$LD"; then +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for ac_dir in $PATH; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then +- lt_cv_path_LD="$ac_dir/$ac_prog" +- # Check to see if the program is GNU ld. I'd rather use --version, +- # but apparently some variants of GNU ld only accept -v. +- # Break only if it was the GNU/non-GNU ld that we prefer. +- case `"$lt_cv_path_LD" -v 2>&1 /dev/null ; then ++ # if the path contains ";" then we assume it to be the separator ++ # otherwise default to the standard path separator (i.e. ":") - it is ++ # assumed that no part of a normal pathname contains ";" but that should ++ # okay in the real world where ";" in dirpaths is itself problematic. ++ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` ++ else ++ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ fi ++ # Ok, now we have the path, separated by spaces, we can step through it ++ # and add multilib dir if necessary. ++ lt_tmp_lt_search_path_spec= ++ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` ++ for lt_sys_path in $lt_search_path_spec; do ++ if test -d "$lt_sys_path/$lt_multi_os_dir"; then ++ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" ++ else ++ test -d "$lt_sys_path" && \ ++ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done +- IFS="$lt_save_ifs" ++ lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' ++BEGIN {RS=" "; FS="/|\n";} { ++ lt_foo=""; ++ lt_count=0; ++ for (lt_i = NF; lt_i > 0; lt_i--) { ++ if ($lt_i != "" && $lt_i != ".") { ++ if ($lt_i == "..") { ++ lt_count++; ++ } else { ++ if (lt_count == 0) { ++ lt_foo="/" $lt_i lt_foo; ++ } else { ++ lt_count--; ++ } ++ } ++ } ++ } ++ if (lt_foo != "") { lt_freq[[lt_foo]]++; } ++ if (lt_freq[[lt_foo]] == 1) { print lt_foo; } ++}'` ++ sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + else +- lt_cv_path_LD="$LD" # Let the user override the test with a path. ++ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + fi]) +-LD="$lt_cv_path_LD" +-if test -n "$LD"; then +- AC_MSG_RESULT($LD) +-else +- AC_MSG_RESULT(no) +-fi +-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +-AC_PROG_LD_GNU +-])# AC_PROG_LD ++library_names_spec= ++libname_spec='lib$name' ++soname_spec= ++shrext_cmds=".so" ++postinstall_cmds= ++postuninstall_cmds= ++finish_cmds= ++finish_eval= ++shlibpath_var= ++shlibpath_overrides_runpath=unknown ++version_type=none ++dynamic_linker="$host_os ld.so" ++sys_lib_dlsearch_path_spec="/lib /usr/lib" ++need_lib_prefix=unknown ++hardcode_into_libs=no ++ ++# when you set need_version to no, make sure it does not cause -set_version ++# flags to be left without arguments ++need_version=unknown + ++case $host_os in ++aix3*) ++ version_type=linux ++ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' ++ shlibpath_var=LIBPATH + +-# AC_PROG_LD_GNU +-# -------------- +-AC_DEFUN([AC_PROG_LD_GNU], +-[AC_REQUIRE([AC_PROG_EGREP])dnl +-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, +-[# I'd rather use --version here, but apparently some GNU lds only accept -v. +-case `$LD -v 2>&1 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' ++ echo ' yes ' ++ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then ++ : ++ else ++ can_build_shared=no ++ fi ++ ;; ++ esac ++ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct ++ # soname into executable. Probably we can add versioning support to ++ # collect2, so additional links can be useful in future. ++ if test "$aix_use_runtimelinking" = yes; then ++ # If using run time linking (on AIX 4.2 or later) use lib.so ++ # instead of lib.a to let people know that these are not ++ # typical AIX shared libraries. ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else +- reload_cmds='$LD$reload_flag -o $output$reload_objs' ++ # We preserve .a as extension for shared libraries through AIX4.2 ++ # and later when we are not doing run time linking. ++ library_names_spec='${libname}${release}.a $libname.a' ++ soname_spec='${libname}${release}${shared_ext}$major' + fi +- ;; +-esac +-])# AC_PROG_LD_RELOAD_FLAG +- +- +-# AC_DEPLIBS_CHECK_METHOD +-# ----------------------- +-# how to check for library dependencies +-# -- PORTME fill in with the dynamic library characteristics +-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], +-[AC_CACHE_CHECK([how to recognise dependent libraries], +-lt_cv_deplibs_check_method, +-[lt_cv_file_magic_cmd='$MAGIC_CMD' +-lt_cv_file_magic_test_file= +-lt_cv_deplibs_check_method='unknown' +-# Need to set the preceding variable on all platforms that support +-# interlibrary dependencies. +-# 'none' -- dependencies not supported. +-# `unknown' -- same as none, but documents that we really don't know. +-# 'pass_all' -- all dependencies passed with no checks. +-# 'test_compile' -- check by making test program. +-# 'file_magic [[regex]]' -- check by looking for files in library path +-# which responds to the $file_magic_cmd with a given extended regex. +-# If you have `file' or equivalent on your system and you're not sure +-# whether `pass_all' will *always* work, you probably want this one. ++ shlibpath_var=LIBPATH ++ fi ++ ;; + +-case $host_os in +-aix4* | aix5*) +- lt_cv_deplibs_check_method=pass_all ++amigaos*) ++ case $host_cpu in ++ powerpc) ++ # Since July 2007 AmigaOS4 officially supports .so libraries. ++ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ ;; ++ m68k) ++ library_names_spec='$libname.ixlibrary $libname.a' ++ # Create ${libname}_ixlibrary.a entries in /sys/libs. ++ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ++ ;; ++ esac + ;; + + beos*) +- lt_cv_deplibs_check_method=pass_all ++ library_names_spec='${libname}${shared_ext}' ++ dynamic_linker="$host_os ld.so" ++ shlibpath_var=LIBRARY_PATH + ;; + + bsdi[[45]]*) +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' +- lt_cv_file_magic_cmd='/usr/bin/file -L' +- lt_cv_file_magic_test_file=/shlib/libc.so +- ;; +- +-cygwin*) +- # func_win32_libid is a shell function defined in ltmain.sh +- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' +- lt_cv_file_magic_cmd='func_win32_libid' ++ version_type=linux ++ 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' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" ++ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" ++ # the default ld.so.conf also contains /usr/contrib/lib and ++ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow ++ # libtool to hard-code these into programs + ;; + +-mingw* | pw32*) +- # Base MSYS/MinGW do not provide the 'file' command needed by +- # func_win32_libid shell function, so use a weaker test based on 'objdump'. +- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' +- lt_cv_file_magic_cmd='$OBJDUMP -f' +- ;; ++cygwin* | mingw* | pw32*) ++ version_type=windows ++ shrext_cmds=".dll" ++ need_version=no ++ need_lib_prefix=no + +-darwin* | rhapsody*) +- lt_cv_deplibs_check_method=pass_all +- ;; ++ case $GCC,$host_os in ++ yes,cygwin* | yes,mingw* | yes,pw32*) ++ library_names_spec='$libname.dll.a' ++ # DLL is installed to $(libdir)/../bin by postinstall_cmds ++ postinstall_cmds='base_file=`basename \${file}`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ ++ dldir=$destdir/`dirname \$dlpath`~ ++ test -d \$dldir || mkdir -p \$dldir~ ++ $install_prog $dir/$dlname \$dldir/$dlname~ ++ chmod a+x \$dldir/$dlname~ ++ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then ++ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; ++ fi' ++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ ++ dlpath=$dir/\$dldll~ ++ $RM \$dlpath' ++ shlibpath_overrides_runpath=yes + +-freebsd* | kfreebsd*-gnu | dragonfly*) +- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then +- case $host_cpu in +- i*86 ) +- # Not sure whether the presence of OpenBSD here was a mistake. +- # Let's accept both of them until this is cleared up. +- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' +- lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ++ case $host_os in ++ cygwin*) ++ # Cygwin DLLs use 'cyg' prefix rather than 'lib' ++ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ++ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ++ ;; ++ mingw*) ++ # MinGW DLLs use traditional 'lib' prefix ++ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ++ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` ++ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then ++ # It is most probably a Windows format PATH printed by ++ # mingw gcc, but we are running on Cygwin. Gcc prints its search ++ # path with ; separators, and with drive letters. We can handle the ++ # drive letters (cygwin fileutils understands them), so leave them, ++ # especially as we might pass files found there to a mingw objdump, ++ # which wouldn't understand a cygwinified path. Ahh. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` ++ else ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ fi ++ ;; ++ pw32*) ++ # pw32 DLLs use 'pw' prefix rather than 'lib' ++ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac +- else +- lt_cv_deplibs_check_method=pass_all +- fi +- ;; +- +-gnu*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-hpux10.20* | hpux11*) +- lt_cv_file_magic_cmd=/usr/bin/file +- case $host_cpu in +- ia64*) +- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' +- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so +- ;; +- hppa*64*) +- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] +- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; ++ + *) +- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' +- lt_cv_file_magic_test_file=/usr/lib/libc.sl ++ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac ++ dynamic_linker='Win32 ld.exe' ++ # FIXME: first we should search . and the directory the executable is in ++ shlibpath_var=PATH + ;; + +-interix3*) +- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' +- ;; +- +-irix5* | irix6* | nonstopux*) +- case $LD in +- *-32|*"-32 ") libmagic=32-bit;; +- *-n32|*"-n32 ") libmagic=N32;; +- *-64|*"-64 ") libmagic=64-bit;; +- *) libmagic=never-match;; +- esac +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-# This must be Linux ELF. +-linux*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-netbsd*) +- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' +- else +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' +- fi ++darwin* | rhapsody*) ++ dynamic_linker="$host_os dyld" ++ version_type=darwin ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' ++ soname_spec='${libname}${release}${major}$shared_ext' ++ shlibpath_overrides_runpath=yes ++ shlibpath_var=DYLD_LIBRARY_PATH ++ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' ++m4_if([$1], [],[ ++ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) ++ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +-newos6*) +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' +- lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=/usr/lib/libnls.so ++dgux*) ++ version_type=linux ++ need_lib_prefix=no ++ 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' ++ shlibpath_var=LD_LIBRARY_PATH + ;; + +-nto-qnx*) +- lt_cv_deplibs_check_method=unknown ++freebsd1*) ++ dynamic_linker=no + ;; + +-openbsd*) +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' ++freebsd* | dragonfly*) ++ # DragonFly does not have aout. When/if they implement a new ++ # versioning mechanism, adjust this. ++ if test -x /usr/bin/objformat; then ++ objformat=`/usr/bin/objformat` + else +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' ++ case $host_os in ++ freebsd[[123]]*) objformat=aout ;; ++ *) objformat=elf ;; ++ esac + fi +- ;; +- +-osf3* | osf4* | osf5*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-solaris*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-sysv4 | sysv4.3*) +- case $host_vendor in +- motorola) +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' +- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` +- ;; +- ncr) +- lt_cv_deplibs_check_method=pass_all +- ;; +- sequent) +- lt_cv_file_magic_cmd='/bin/file' +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ++ version_type=freebsd-$objformat ++ case $version_type in ++ freebsd-elf*) ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' ++ need_version=no ++ need_lib_prefix=no ++ ;; ++ freebsd-*) ++ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' ++ need_version=yes ++ ;; ++ esac ++ shlibpath_var=LD_LIBRARY_PATH ++ case $host_os in ++ freebsd2*) ++ shlibpath_overrides_runpath=yes + ;; +- sni) +- lt_cv_file_magic_cmd='/bin/file' +- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" +- lt_cv_file_magic_test_file=/lib/libc.so ++ freebsd3.[[01]]* | freebsdelf3.[[01]]*) ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes + ;; +- siemens) +- lt_cv_deplibs_check_method=pass_all ++ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ ++ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) ++ shlibpath_overrides_runpath=no ++ hardcode_into_libs=yes + ;; +- pc) +- lt_cv_deplibs_check_method=pass_all ++ *) # from 4.6 on, and DragonFly ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes + ;; + esac + ;; + +-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) +- lt_cv_deplibs_check_method=pass_all ++gnu*) ++ version_type=linux ++ need_lib_prefix=no ++ 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' ++ shlibpath_var=LD_LIBRARY_PATH ++ hardcode_into_libs=yes + ;; +-esac +-]) +-file_magic_cmd=$lt_cv_file_magic_cmd +-deplibs_check_method=$lt_cv_deplibs_check_method +-test -z "$deplibs_check_method" && deplibs_check_method=unknown +-])# AC_DEPLIBS_CHECK_METHOD + +- +-# AC_PROG_NM +-# ---------- +-# find the pathname to a BSD-compatible name lister +-AC_DEFUN([AC_PROG_NM], +-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +-[if test -n "$NM"; then +- # Let the user override the test. +- lt_cv_path_NM="$NM" +-else +- lt_nm_to_check="${ac_tool_prefix}nm" +- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then +- lt_nm_to_check="$lt_nm_to_check nm" +- fi +- for lt_tmp_nm in $lt_nm_to_check; do +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- tmp_nm="$ac_dir/$lt_tmp_nm" +- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then +- # Check to see if the nm accepts a BSD-compat flag. +- # Adding the `sed 1q' prevents false positives on HP-UX, which says: +- # nm: unknown option "B" ignored +- # Tru64's nm complains that /dev/null is an invalid object file +- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in +- */dev/null* | *'Invalid file or object type'*) +- lt_cv_path_NM="$tmp_nm -B" +- break +- ;; +- *) +- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in +- */dev/null*) +- lt_cv_path_NM="$tmp_nm -p" +- break +- ;; +- *) +- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but +- continue # so that we can try to find one that supports BSD flags +- ;; +- esac +- ;; +- esac +- fi +- done +- IFS="$lt_save_ifs" +- done +- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +-fi]) +-NM="$lt_cv_path_NM" +-])# AC_PROG_NM +- +- +-# AC_CHECK_LIBM +-# ------------- +-# check for math library +-AC_DEFUN([AC_CHECK_LIBM], +-[AC_REQUIRE([AC_CANONICAL_HOST])dnl +-LIBM= +-case $host in +-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) +- # These system don't have libm, or don't need it +- ;; +-*-ncr-sysv4.3*) +- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") +- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") +- ;; +-*) +- AC_CHECK_LIB(m, cos, LIBM="-lm") ++hpux9* | hpux10* | hpux11*) ++ # Give a soname corresponding to the major version so that dld.sl refuses to ++ # link against other versions. ++ version_type=sunos ++ need_lib_prefix=no ++ need_version=no ++ case $host_cpu in ++ ia64*) ++ shrext_cmds='.so' ++ hardcode_into_libs=yes ++ dynamic_linker="$host_os dld.so" ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}$major' ++ if test "X$HPUX_IA64_MODE" = X32; then ++ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" ++ else ++ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" ++ fi ++ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ++ ;; ++ hppa*64*) ++ shrext_cmds='.sl' ++ hardcode_into_libs=yes ++ dynamic_linker="$host_os dld.sl" ++ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH ++ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}$major' ++ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" ++ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ++ ;; ++ *) ++ shrext_cmds='.sl' ++ dynamic_linker="$host_os dld.sl" ++ shlibpath_var=SHLIB_PATH ++ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}$major' ++ ;; ++ esac ++ # HP-UX runs *really* slowly unless shared libraries are mode 555. ++ postinstall_cmds='chmod 555 $lib' + ;; +-esac +-])# AC_CHECK_LIBM + ++interix[[3-9]]*) ++ version_type=linux ++ need_lib_prefix=no ++ 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' ++ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ hardcode_into_libs=yes ++ ;; + +-# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +-# ----------------------------------- +-# sets LIBLTDL to the link flags for the libltdl convenience library and +-# LTDLINCL to the include flags for the libltdl header and adds +-# --enable-ltdl-convenience to the configure arguments. Note that +-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +-# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +-# (note the single quotes!). If your package is not flat and you're not +-# using automake, define top_builddir and top_srcdir appropriately in +-# the Makefiles. +-AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +- case $enable_ltdl_convenience in +- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; +- "") enable_ltdl_convenience=yes +- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; ++irix5* | irix6* | nonstopux*) ++ case $host_os in ++ nonstopux*) version_type=nonstopux ;; ++ *) ++ if test "$lt_cv_prog_gnu_ld" = yes; then ++ version_type=linux ++ else ++ version_type=irix ++ fi ;; + esac +- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la +- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +- # For backwards non-gettext consistent compatibility... +- INCLTDL="$LTDLINCL" +-])# AC_LIBLTDL_CONVENIENCE +- +- +-# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +-# ----------------------------------- +-# sets LIBLTDL to the link flags for the libltdl installable library and +-# LTDLINCL to the include flags for the libltdl header and adds +-# --enable-ltdl-install to the configure arguments. Note that +-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +-# and an installed libltdl is not found, it is assumed to be `libltdl'. +-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +-# '${top_srcdir}/' (note the single quotes!). If your package is not +-# flat and you're not using automake, define top_builddir and top_srcdir +-# appropriately in the Makefiles. +-# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +-AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +- AC_CHECK_LIB(ltdl, lt_dlinit, +- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], +- [if test x"$enable_ltdl_install" = xno; then +- AC_MSG_WARN([libltdl not installed, but installation disabled]) +- else +- enable_ltdl_install=yes +- fi +- ]) +- if test x"$enable_ltdl_install" = x"yes"; then +- ac_configure_args="$ac_configure_args --enable-ltdl-install" +- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la +- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +- else +- ac_configure_args="$ac_configure_args --enable-ltdl-install=no" +- LIBLTDL="-lltdl" +- LTDLINCL= +- fi +- # For backwards non-gettext consistent compatibility... +- INCLTDL="$LTDLINCL" +-])# AC_LIBLTDL_INSTALLABLE ++ need_lib_prefix=no ++ need_version=no ++ soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' ++ case $host_os in ++ irix5* | nonstopux*) ++ libsuff= shlibsuff= ++ ;; ++ *) ++ case $LD in # libtool.m4 will add one of these switches to LD ++ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") ++ libsuff= shlibsuff= libmagic=32-bit;; ++ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") ++ libsuff=32 shlibsuff=N32 libmagic=N32;; ++ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") ++ libsuff=64 shlibsuff=64 libmagic=64-bit;; ++ *) libsuff= shlibsuff= libmagic=never-match;; ++ esac ++ ;; ++ esac ++ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH ++ shlibpath_overrides_runpath=no ++ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" ++ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ++ hardcode_into_libs=yes ++ ;; + ++# No shared lib support for Linux oldld, aout, or coff. ++linux*oldld* | linux*aout* | linux*coff*) ++ dynamic_linker=no ++ ;; + +-# AC_LIBTOOL_CXX +-# -------------- +-# enable support for C++ libraries +-AC_DEFUN([AC_LIBTOOL_CXX], +-[AC_REQUIRE([_LT_AC_LANG_CXX]) +-])# AC_LIBTOOL_CXX ++# This must be Linux ELF. ++linux* | k*bsd*-gnu) ++ version_type=linux ++ need_lib_prefix=no ++ 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' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ # Some binutils ld are patched to set DT_RUNPATH ++ save_LDFLAGS=$LDFLAGS ++ save_libdir=$libdir ++ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ ++ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], ++ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], ++ [shlibpath_overrides_runpath=yes])]) ++ LDFLAGS=$save_LDFLAGS ++ libdir=$save_libdir + ++ # This implies no fast_install, which is unacceptable. ++ # Some rework will be needed to allow for fast_install ++ # before this can be enabled. ++ hardcode_into_libs=yes + +-# _LT_AC_LANG_CXX +-# --------------- +-AC_DEFUN([_LT_AC_LANG_CXX], +-[AC_REQUIRE([AC_PROG_CXX]) +-AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +-])# _LT_AC_LANG_CXX ++ # Append ld.so.conf contents to the search path ++ if test -f /etc/ld.so.conf; then ++ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` ++ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" ++ fi + +-# _LT_AC_PROG_CXXCPP +-# ------------------ +-AC_DEFUN([_LT_AC_PROG_CXXCPP], +-[ +-AC_REQUIRE([AC_PROG_CXX]) +-if test -n "$CXX" && ( test "X$CXX" != "Xno" && +- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || +- (test "X$CXX" != "Xg++"))) ; then +- AC_PROG_CXXCPP +-fi +-])# _LT_AC_PROG_CXXCPP +- +-# AC_LIBTOOL_F77 +-# -------------- +-# enable support for Fortran 77 libraries +-AC_DEFUN([AC_LIBTOOL_F77], +-[AC_REQUIRE([_LT_AC_LANG_F77]) +-])# AC_LIBTOOL_F77 +- +- +-# _LT_AC_LANG_F77 +-# --------------- +-AC_DEFUN([_LT_AC_LANG_F77], +-[AC_REQUIRE([AC_PROG_F77]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +-])# _LT_AC_LANG_F77 +- +- +-# AC_LIBTOOL_GCJ +-# -------------- +-# enable support for GCJ libraries +-AC_DEFUN([AC_LIBTOOL_GCJ], +-[AC_REQUIRE([_LT_AC_LANG_GCJ]) +-])# AC_LIBTOOL_GCJ +- +- +-# _LT_AC_LANG_GCJ +-# --------------- +-AC_DEFUN([_LT_AC_LANG_GCJ], +-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], +- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], +- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], +- [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], +- [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], +- [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +-])# _LT_AC_LANG_GCJ +- +- +-# AC_LIBTOOL_RC +-# ------------- +-# enable support for Windows resource files +-AC_DEFUN([AC_LIBTOOL_RC], +-[AC_REQUIRE([LT_AC_PROG_RC]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +-])# AC_LIBTOOL_RC ++ # We used to test for /lib/ld.so.1 and disable shared libraries on ++ # powerpc, because MkLinux only supported shared libraries with the ++ # GNU dynamic linker. Since this was broken with cross compilers, ++ # most powerpc-linux boxes support dynamic linking these days and ++ # people can always --disable-shared, the test was removed, and we ++ # assume the GNU/Linux dynamic linker is in use. ++ dynamic_linker='GNU/Linux ld.so' ++ ;; + ++netbsd*) ++ version_type=sunos ++ need_lib_prefix=no ++ need_version=no ++ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' ++ dynamic_linker='NetBSD (a.out) ld.so' ++ else ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}$major' ++ dynamic_linker='NetBSD ld.elf_so' ++ fi ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes ++ ;; + +-# AC_LIBTOOL_LANG_C_CONFIG +-# ------------------------ +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +-AC_DEFUN([_LT_AC_LANG_C_CONFIG], +-[lt_save_CC="$CC" +-AC_LANG_PUSH(C) ++newsos6) ++ version_type=linux ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ ;; + +-# Source file extension for C test sources. +-ac_ext=c ++*nto* | *qnx*) ++ version_type=qnx ++ need_lib_prefix=no ++ 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' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ hardcode_into_libs=yes ++ dynamic_linker='ldqnx.so' ++ ;; + +-# Object file extension for compiled C test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext ++openbsd*) ++ version_type=sunos ++ sys_lib_dlsearch_path_spec="/usr/lib" ++ need_lib_prefix=no ++ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. ++ case $host_os in ++ openbsd3.3 | openbsd3.3.*) need_version=yes ;; ++ *) need_version=no ;; ++ esac ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then ++ case $host_os in ++ openbsd2.[[89]] | openbsd2.[[89]].*) ++ shlibpath_overrides_runpath=no ++ ;; ++ *) ++ shlibpath_overrides_runpath=yes ++ ;; ++ esac ++ else ++ shlibpath_overrides_runpath=yes ++ fi ++ ;; + +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="int some_variable = 0;\n" ++os2*) ++ libname_spec='$name' ++ shrext_cmds=".dll" ++ need_lib_prefix=no ++ library_names_spec='$libname${shared_ext} $libname.a' ++ dynamic_linker='OS/2 ld.exe' ++ shlibpath_var=LIBPATH ++ ;; + +-# Code to be used in simple link tests +-lt_simple_link_test_code='int main(){return(0);}\n' ++osf3* | osf4* | osf5*) ++ version_type=osf ++ need_lib_prefix=no ++ need_version=no ++ soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ shlibpath_var=LD_LIBRARY_PATH ++ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" ++ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ++ ;; + +-_LT_AC_SYS_COMPILER ++rdos*) ++ dynamic_linker=no ++ ;; + +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE ++solaris*) ++ version_type=linux ++ need_lib_prefix=no ++ 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' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes ++ # ldd complains unless libraries are executable ++ postinstall_cmds='chmod +x $lib' ++ ;; + +-## CAVEAT EMPTOR: +-## There is no encapsulation within the following macros, do not change +-## the running order or otherwise move them around unless you know exactly +-## what you are doing... +-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +-AC_LIBTOOL_SYS_LIB_STRIP +-AC_LIBTOOL_DLOPEN_SELF +- +-# Report which library types will actually be built +-AC_MSG_CHECKING([if libtool supports shared libraries]) +-AC_MSG_RESULT([$can_build_shared]) ++sunos4*) ++ version_type=sunos ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' ++ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ if test "$with_gnu_ld" = yes; then ++ need_lib_prefix=no ++ fi ++ need_version=yes ++ ;; + +-AC_MSG_CHECKING([whether to build shared libraries]) +-test "$can_build_shared" = "no" && enable_shared=no ++sysv4 | sysv4.3*) ++ version_type=linux ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}$major' ++ shlibpath_var=LD_LIBRARY_PATH ++ case $host_vendor in ++ sni) ++ shlibpath_overrides_runpath=no ++ need_lib_prefix=no ++ runpath_var=LD_RUN_PATH ++ ;; ++ siemens) ++ need_lib_prefix=no ++ ;; ++ motorola) ++ need_lib_prefix=no ++ need_version=no ++ shlibpath_overrides_runpath=no ++ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ++ ;; ++ esac ++ ;; + +-# On AIX, shared libraries and static libraries use the same namespace, and +-# are all built from PIC. +-case $host_os in +-aix3*) +- test "$enable_shared" = yes && enable_static=no +- if test -n "$RANLIB"; then +- archive_cmds="$archive_cmds~\$RANLIB \$lib" +- postinstall_cmds='$RANLIB $lib' ++sysv4*MP*) ++ if test -d /usr/nec ;then ++ version_type=linux ++ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' ++ soname_spec='$libname${shared_ext}.$major' ++ shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +-aix4* | aix5*) +- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then +- test "$enable_shared" = yes && enable_static=no ++sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) ++ version_type=freebsd-elf ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}$major' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes ++ if test "$with_gnu_ld" = yes; then ++ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' ++ else ++ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' ++ case $host_os in ++ sco3.2v5*) ++ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ++ ;; ++ esac + fi +- ;; +-esac +-AC_MSG_RESULT([$enable_shared]) +- +-AC_MSG_CHECKING([whether to build static libraries]) +-# Make sure either enable_shared or enable_static is yes. +-test "$enable_shared" = yes || enable_static=yes +-AC_MSG_RESULT([$enable_static]) +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_POP +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_C_CONFIG +- +- +-# AC_LIBTOOL_LANG_CXX_CONFIG +-# -------------------------- +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +-[AC_LANG_PUSH(C++) +-AC_REQUIRE([AC_PROG_CXX]) +-AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +- +-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +-_LT_AC_TAGVAR(allow_undefined_flag, $1)= +-_LT_AC_TAGVAR(always_export_symbols, $1)=no +-_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_direct, $1)=no +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +-_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +-_LT_AC_TAGVAR(hardcode_automatic, $1)=no +-_LT_AC_TAGVAR(module_cmds, $1)= +-_LT_AC_TAGVAR(module_expsym_cmds, $1)= +-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +-_LT_AC_TAGVAR(no_undefined_flag, $1)= +-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +- +-# Dependencies to place before and after the object being linked: +-_LT_AC_TAGVAR(predep_objects, $1)= +-_LT_AC_TAGVAR(postdep_objects, $1)= +-_LT_AC_TAGVAR(predeps, $1)= +-_LT_AC_TAGVAR(postdeps, $1)= +-_LT_AC_TAGVAR(compiler_lib_search_path, $1)= +- +-# Source file extension for C++ test sources. +-ac_ext=cpp +- +-# Object file extension for compiled C++ test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="int some_variable = 0;\n" ++ sys_lib_dlsearch_path_spec='/usr/lib' ++ ;; + +-# Code to be used in simple link tests +-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' ++tpf*) ++ # TPF is a cross-target only. Preferred cross-host = GNU/Linux. ++ version_type=linux ++ need_lib_prefix=no ++ need_version=no ++ library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ hardcode_into_libs=yes ++ ;; + +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER ++uts4*) ++ version_type=linux ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}$major' ++ shlibpath_var=LD_LIBRARY_PATH ++ ;; + +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE ++*) ++ dynamic_linker=no ++ ;; ++esac ++AC_MSG_RESULT([$dynamic_linker]) ++test "$dynamic_linker" = no && can_build_shared=no + +-# Allow CC to be a program name with arguments. +-lt_save_CC=$CC +-lt_save_LD=$LD +-lt_save_GCC=$GCC +-GCC=$GXX +-lt_save_with_gnu_ld=$with_gnu_ld +-lt_save_path_LD=$lt_cv_path_LD +-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then +- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +-else +- $as_unset lt_cv_prog_gnu_ld ++variables_saved_for_relink="PATH $shlibpath_var $runpath_var" ++if test "$GCC" = yes; then ++ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" + fi +-if test -n "${lt_cv_path_LDCXX+set}"; then +- lt_cv_path_LD=$lt_cv_path_LDCXX +-else +- $as_unset lt_cv_path_LD ++ ++if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then ++ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" + fi +-test -z "${LDCXX+set}" || LD=$LDCXX +-CC=${CXX-"c++"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +- +-# We don't want -fno-exception wen compiling C++ code, so set the +-# no_builtin_flag separately +-if test "$GXX" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +-else +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= ++if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then ++ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + fi + +-if test "$GXX" = yes; then +- # Set up default GNU C++ configuration +- +- AC_PROG_LD +- +- # Check if GNU C++ uses GNU ld as the underlying linker, since the +- # archiving commands below assume that GNU ld is being used. +- if test "$with_gnu_ld" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- +- # If archive_cmds runs LD, not CC, wlarc should be empty +- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to +- # investigate it a little bit more. (MM) +- wlarc='${wl}' +- +- # ancient GNU ld didn't support --whole-archive et. al. +- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ +- grep 'no-whole-archive' > /dev/null; then +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' +- else +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- else +- with_gnu_ld=no +- wlarc= +- +- # A generic and very simple default shared library creation +- # command for GNU C++ for the case where it uses the native +- # linker, instead of GNU ld. If possible, this setting should +- # overridden to take advantage of the native linker features on +- # the platform it is being used on. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' +- fi +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +- +-else +- GXX=no +- with_gnu_ld=no +- wlarc= +-fi ++_LT_DECL([], [variables_saved_for_relink], [1], ++ [Variables whose values should be saved in libtool wrapper scripts and ++ restored at link time]) ++_LT_DECL([], [need_lib_prefix], [0], ++ [Do we need the "lib" prefix for modules?]) ++_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) ++_LT_DECL([], [version_type], [0], [Library versioning type]) ++_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) ++_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) ++_LT_DECL([], [shlibpath_overrides_runpath], [0], ++ [Is shlibpath searched before the hard-coded library search path?]) ++_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) ++_LT_DECL([], [library_names_spec], [1], ++ [[List of archive names. First name is the real one, the rest are links. ++ The last name is the one that the linker finds with -lNAME]]) ++_LT_DECL([], [soname_spec], [1], ++ [[The coded name of the library, if different from the real name]]) ++_LT_DECL([], [postinstall_cmds], [2], ++ [Command to use after installation of a shared archive]) ++_LT_DECL([], [postuninstall_cmds], [2], ++ [Command to use after uninstallation of a shared archive]) ++_LT_DECL([], [finish_cmds], [2], ++ [Commands used to finish a libtool library installation in a directory]) ++_LT_DECL([], [finish_eval], [1], ++ [[As "finish_cmds", except a single script fragment to be evaled but ++ not shown]]) ++_LT_DECL([], [hardcode_into_libs], [0], ++ [Whether we should hardcode library paths into libraries]) ++_LT_DECL([], [sys_lib_search_path_spec], [2], ++ [Compile-time system search path for libraries]) ++_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], ++ [Run-time system search path for libraries]) ++])# _LT_SYS_DYNAMIC_LINKER + +-# PORTME: fill in a description of your system's C++ link characteristics +-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +-_LT_AC_TAGVAR(ld_shlibs, $1)=yes +-case $host_os in +- aix3*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aix4* | aix5*) +- if test "$host_cpu" = ia64; then +- # On IA64, the linker does run time linking by default, so we don't +- # have to do anything special. +- aix_use_runtimelinking=no +- exp_sym_flag='-Bexport' +- no_entry_flag="" +- else +- aix_use_runtimelinking=no + +- # Test if we are trying to use run time linking or normal +- # AIX style linking. If -brtl is somewhere in LDFLAGS, we +- # need to do runtime linking. +- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) +- for ld_flag in $LDFLAGS; do +- case $ld_flag in +- *-brtl*) +- aix_use_runtimelinking=yes +- break +- ;; +- esac +- done +- ;; +- esac +- +- exp_sym_flag='-bexport' +- no_entry_flag='-bnoentry' +- fi ++# _LT_PATH_TOOL_PREFIX(TOOL) ++# -------------------------- ++# find a file program which can recognize shared library ++AC_DEFUN([_LT_PATH_TOOL_PREFIX], ++[m4_require([_LT_DECL_EGREP])dnl ++AC_MSG_CHECKING([for $1]) ++AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, ++[case $MAGIC_CMD in ++[[\\/*] | ?:[\\/]*]) ++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ++ ;; ++*) ++ lt_save_MAGIC_CMD="$MAGIC_CMD" ++ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ++dnl $ac_dummy forces splitting on constant user-supplied paths. ++dnl POSIX.2 word splitting is done only on the output of word expansions, ++dnl not every word. This closes a longstanding sh security hole. ++ ac_dummy="m4_if([$2], , $PATH, [$2])" ++ for ac_dir in $ac_dummy; do ++ IFS="$lt_save_ifs" ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$1; then ++ lt_cv_path_MAGIC_CMD="$ac_dir/$1" ++ if test -n "$file_magic_test_file"; then ++ case $deplibs_check_method in ++ "file_magic "*) ++ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` ++ MAGIC_CMD="$lt_cv_path_MAGIC_CMD" ++ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | ++ $EGREP "$file_magic_regex" > /dev/null; then ++ : ++ else ++ cat <<_LT_EOF 1>&2 + +- # When large executables or shared objects are built, AIX ld can +- # have problems creating the table of contents. If linking a library +- # or program results in "error TOC overflow" add -mminimal-toc to +- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not +- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. +- +- _LT_AC_TAGVAR(archive_cmds, $1)='' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ++*** Warning: the command libtool uses to detect shared libraries, ++*** $file_magic_cmd, produces output that libtool cannot recognize. ++*** The result is that libtool may fail to recognize shared libraries ++*** as such. This will affect the creation of libtool libraries that ++*** depend on shared libraries, but programs linked with such libtool ++*** libraries will work regardless of this problem. Nevertheless, you ++*** may want to report the problem to your system manager and/or to ++*** bug-libtool@gnu.org + +- if test "$GXX" = yes; then +- case $host_os in aix4.[[012]]|aix4.[[012]].*) +- # We only want to do this on AIX 4.2 and lower, the check +- # below for broken collect2 doesn't work under 4.3+ +- collect2name=`${CC} -print-prog-name=collect2` +- if test -f "$collect2name" && \ +- strings "$collect2name" | grep resolve_lib_name >/dev/null +- then +- # We have reworked collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- else +- # We have old collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- # It fails to find uninstalled libraries when the uninstalled +- # path is not listed in the libpath. Setting hardcode_minus_L +- # to unsupported forces relinking +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- fi +- ;; +- esac +- shared_flag='-shared' +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag="$shared_flag "'${wl}-G' +- fi +- else +- # not using gcc +- if test "$host_cpu" = ia64; then +- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release +- # chokes on -Wl,-G. The following line is correct: +- shared_flag='-G' +- else +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag='${wl}-G' +- else +- shared_flag='${wl}-bM:SRE' +- fi ++_LT_EOF ++ fi ;; ++ esac + fi ++ break + fi ++ done ++ IFS="$lt_save_ifs" ++ MAGIC_CMD="$lt_save_MAGIC_CMD" ++ ;; ++esac]) ++MAGIC_CMD="$lt_cv_path_MAGIC_CMD" ++if test -n "$MAGIC_CMD"; then ++ AC_MSG_RESULT($MAGIC_CMD) ++else ++ AC_MSG_RESULT(no) ++fi ++_LT_DECL([], [MAGIC_CMD], [0], ++ [Used to examine libraries when file_magic_cmd begins with "file"])dnl ++])# _LT_PATH_TOOL_PREFIX + +- # It seems that -bexpall does not export symbols beginning with +- # underscore (_), so it is better to generate a list of symbols to export. +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- if test "$aix_use_runtimelinking" = yes; then +- # Warning - without using the other runtime loading flags (-brtl), +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" ++# Old name: ++AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +- else +- if test "$host_cpu" = ia64; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" +- else +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- # Warning - without using the other run time loading flags, +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' +- # Exported symbols can be pulled into shared objects from archives +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- # This is similar to how AIX traditionally builds its shared libraries. +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' +- fi +- fi +- ;; + +- beos*) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Joseph Beckenbach says some releases of gcc +- # support --undefined. This deserves some investigation. FIXME +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; ++# _LT_PATH_MAGIC ++# -------------- ++# find a file program which can recognize a shared library ++m4_defun([_LT_PATH_MAGIC], ++[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) ++if test -z "$lt_cv_path_MAGIC_CMD"; then ++ if test -n "$ac_tool_prefix"; then ++ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) ++ else ++ MAGIC_CMD=: ++ fi ++fi ++])# _LT_PATH_MAGIC + +- chorus*) +- case $cc_basename in +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; + +- cygwin* | mingw* | pw32*) +- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, +- # as there is no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- +- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- darwin* | rhapsody*) +- case $host_os in +- rhapsody* | darwin1.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' +- ;; +- *) # Darwin 1.3 on +- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- else +- case ${MACOSX_DEPLOYMENT_TARGET} in +- 10.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- ;; +- 10.*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' +- ;; +- esac +- fi +- ;; +- esac +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- +- if test "$GXX" = yes ; then +- lt_int_apple_cc_single_mod=no +- output_verbose_link_cmd='echo' +- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then +- lt_int_apple_cc_single_mod=yes +- fi +- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' +- fi +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- else +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- fi +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- else +- case $cc_basename in +- xlc*) +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- ;; +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +- ;; ++# LT_PATH_LD ++# ---------- ++# find the pathname to the GNU or non-GNU linker ++AC_DEFUN([LT_PATH_LD], ++[AC_REQUIRE([AC_PROG_CC])dnl ++AC_REQUIRE([AC_CANONICAL_HOST])dnl ++AC_REQUIRE([AC_CANONICAL_BUILD])dnl ++m4_require([_LT_DECL_SED])dnl ++m4_require([_LT_DECL_EGREP])dnl + +- dgux*) +- case $cc_basename in +- ec++*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- ghcx*) +- # Green Hills C++ Compiler +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- freebsd[[12]]*) +- # C++ shared libraries reported to be fairly broken before switch to ELF +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- freebsd-elf*) +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- ;; +- freebsd* | kfreebsd*-gnu | dragonfly*) +- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF +- # conventions +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- ;; +- gnu*) +- ;; +- hpux9*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, +- # but as the default +- # location of the library. +- +- case $cc_basename in +- CC*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aCC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- hpux10*|hpux11*) +- if test $with_gnu_ld = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ++AC_ARG_WITH([gnu-ld], ++ [AS_HELP_STRING([--with-gnu-ld], ++ [assume the C compiler uses GNU ld @<:@default=no@:>@])], ++ [test "$withval" = no || with_gnu_ld=yes], ++ [with_gnu_ld=no])dnl + +- case $host_cpu in +- hppa*64*|ia64*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' +- ;; +- *) +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- ;; +- esac +- fi +- case $host_cpu in +- hppa*64*|ia64*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- *) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, +- # but as the default +- # location of the library. ++ac_prog=ld ++if test "$GCC" = yes; then ++ # Check if gcc -print-prog-name=ld gives a path. ++ AC_MSG_CHECKING([for ld used by $CC]) ++ case $host in ++ *-*-mingw*) ++ # gcc leaves a trailing carriage return which upsets mingw ++ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; ++ *) ++ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; ++ esac ++ case $ac_prog in ++ # Accept absolute paths. ++ [[\\/]]* | ?:[[\\/]]*) ++ re_direlt='/[[^/]][[^/]]*/\.\./' ++ # Canonicalize the pathname of ld ++ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` ++ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ++ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` ++ done ++ test -z "$LD" && LD="$ac_prog" + ;; +- esac +- +- case $cc_basename in +- CC*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aCC*) +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- esac +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes; then +- if test $with_gnu_ld = no; then +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- esac +- fi +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- interix3*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. +- # Instead, shared libraries are loaded at an image base (0x10000000 by +- # default) and relocated if they conflict, which is a slow very memory +- # consuming and fragmenting process. To avoid this, we pick a random, +- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link +- # time. Moving up from 0x10000000 also allows more sbrk(2) space. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- ;; +- irix5* | irix6*) +- case $cc_basename in +- CC*) +- # SGI C++ +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- +- # Archives containing C++ object files must be created using +- # "CC -ar", where "CC" is the IRIX C++ compiler. This is +- # necessary to make sure instantiated templates are included +- # in the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' +- ;; +- *) +- if test "$GXX" = yes; then +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' +- fi +- fi +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; +- esac +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ++ "") ++ # If it fails, then pretend we aren't using GCC. ++ ac_prog=ld + ;; +- linux*) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- +- # Archives containing C++ object files must be created using +- # "CC -Bstatic", where "CC" is the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' +- ;; +- icpc*) +- # Intel C++ +- with_gnu_ld=yes +- # version 8.0 and above of icpc choke on multiply defined symbols +- # if we add $predep_objects and $postdep_objects, however 7.1 and +- # earlier do not add the objects themselves. +- case `$CC -V 2>&1` in +- *"Version 7."*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- ;; +- *) # Version 8.0 or newer +- tmp_idyn= +- case $host_cpu in +- ia64*) tmp_idyn=' -i_dynamic';; +- esac +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- ;; +- esac +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' +- ;; +- pgCC*) +- # Portland Group C++ compiler +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- ;; +- cxx*) +- # Compaq C++ +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' +- +- runpath_var=LD_RUN_PATH +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) +- # Sun C++ 5.9 +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- +- # Not sure whether something based on +- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 +- # would be better. +- output_verbose_link_cmd='echo' +- +- # Archives containing C++ object files must be created using +- # "CC -xar", where "CC" is the Sun C++ compiler. This is +- # necessary to make sure instantiated templates are included +- # in the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' +- ;; +- esac +- ;; +- esac ++ *) ++ # If it is relative, then search for the first ld in PATH. ++ with_gnu_ld=unknown + ;; +- lynxos*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- m88k*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- mvs*) +- case $cc_basename in +- cxx*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no ++ esac ++elif test "$with_gnu_ld" = yes; then ++ AC_MSG_CHECKING([for GNU ld]) ++else ++ AC_MSG_CHECKING([for non-GNU ld]) ++fi ++AC_CACHE_VAL(lt_cv_path_LD, ++[if test -z "$LD"; then ++ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ++ for ac_dir in $PATH; do ++ IFS="$lt_save_ifs" ++ test -z "$ac_dir" && ac_dir=. ++ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then ++ lt_cv_path_LD="$ac_dir/$ac_prog" ++ # Check to see if the program is GNU ld. I'd rather use --version, ++ # but apparently some variants of GNU ld only accept -v. ++ # Break only if it was the GNU/non-GNU ld that we prefer. ++ case `"$lt_cv_path_LD" -v 2>&1 /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' +- wlarc= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- fi +- # Workaround some broken pre-1.5 toolchains +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' +- ;; +- openbsd2*) +- # C++ shared libraries are fairly broken +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- openbsd*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' ++ esac + fi +- output_verbose_link_cmd='echo' +- ;; +- osf3*) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Archives containing C++ object files must be created using +- # "CC -Bstatic", where "CC" is the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' +- +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- cxx*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' ++ done ++ IFS="$lt_save_ifs" ++else ++ lt_cv_path_LD="$LD" # Let the user override the test with a path. ++fi]) ++LD="$lt_cv_path_LD" ++if test -n "$LD"; then ++ AC_MSG_RESULT($LD) ++else ++ AC_MSG_RESULT(no) ++fi ++test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) ++_LT_PATH_LD_GNU ++AC_SUBST([LD]) + +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- osf4* | osf5*) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Archives containing C++ object files must be created using +- # the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- cxx*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ +- echo "-hidden">> $lib.exp~ +- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ +- $rm $lib.exp' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' ++_LT_TAGDECL([], [LD], [1], [The linker used to build libraries]) ++])# LT_PATH_LD + +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- psos*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- sunos4*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.x +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- lcc*) +- # Lucid +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac ++# Old names: ++AU_ALIAS([AM_PROG_LD], [LT_PATH_LD]) ++AU_ALIAS([AC_PROG_LD], [LT_PATH_LD]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AM_PROG_LD], []) ++dnl AC_DEFUN([AC_PROG_LD], []) ++ ++ ++# _LT_PATH_LD_GNU ++#- -------------- ++m4_defun([_LT_PATH_LD_GNU], ++[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, ++[# I'd rather use --version here, but apparently some GNU lds only accept -v. ++case `$LD -v 2>&1 /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' ++case $host_os in ++aix[[4-9]]*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; + +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" +- else +- # g++ 2.7 appears to require `-G' NOT `-shared' on this +- # platform. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' ++beos*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; + +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" +- fi ++bsdi[[45]]*) ++ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' ++ lt_cv_file_magic_cmd='/usr/bin/file -L' ++ lt_cv_file_magic_test_file=/shlib/libc.so ++ ;; + +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' +- fi +- ;; +- esac +- ;; +- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var='LD_RUN_PATH' +- +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- ;; +- sysv5* | sco3.2v5* | sco5v6*) +- # Note: We can NOT use -z defs as we might desire, because we do not +- # link with -lc, and that would cause any symbols used from libc to +- # always be unresolved, which means just about no library would +- # ever link correctly. If we're not using GNU ld we use -z text +- # though, which does catch some bad symbols but isn't as heavy-handed +- # as -z defs. +- # For security reasons, it is highly recommended that you always +- # use absolute paths for naming shared libraries, and exclude the +- # DT_RUNPATH tag from executables and libraries. But doing so +- # requires that you compile everything twice, which is a pain. +- # So that behaviour is only enabled if SCOABSPATH is set to a +- # non-empty value in the environment. Most likely only useful for +- # creating official distributions of packages. +- # This is a hack until libtool officially supports absolute path +- # names for shared libraries. +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' +- runpath_var='LD_RUN_PATH' +- +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- ;; +- tandem*) +- case $cc_basename in +- NCC*) +- # NonStop-UX NCC 3.20 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; ++cygwin*) ++ # func_win32_libid is a shell function defined in ltmain.sh ++ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' ++ lt_cv_file_magic_cmd='func_win32_libid' ++ ;; ++ ++mingw* | pw32*) ++ # Base MSYS/MinGW do not provide the 'file' command needed by ++ # func_win32_libid shell function, so use a weaker test based on 'objdump', ++ # unless we find 'file', for example because we are cross-compiling. ++ if ( file / ) >/dev/null 2>&1; then ++ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' ++ lt_cv_file_magic_cmd='func_win32_libid' ++ else ++ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' ++ lt_cv_file_magic_cmd='$OBJDUMP -f' ++ fi ++ ;; ++ ++darwin* | rhapsody*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; ++ ++freebsd* | dragonfly*) ++ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then ++ case $host_cpu in ++ i*86 ) ++ # Not sure whether the presence of OpenBSD here was a mistake. ++ # Let's accept both of them until this is cleared up. ++ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' ++ lt_cv_file_magic_cmd=/usr/bin/file ++ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ++ ;; + esac ++ else ++ lt_cv_deplibs_check_method=pass_all ++ fi ++ ;; ++ ++gnu*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; ++ ++hpux10.20* | hpux11*) ++ lt_cv_file_magic_cmd=/usr/bin/file ++ case $host_cpu in ++ ia64*) ++ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' ++ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; +- vxworks*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no ++ hppa*64*) ++ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] ++ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no ++ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' ++ lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; +-esac +-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no ++ esac ++ ;; + +-_LT_AC_TAGVAR(GCC, $1)="$GXX" +-_LT_AC_TAGVAR(LD, $1)="$LD" ++interix[[3-9]]*) ++ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here ++ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ++ ;; + +-## CAVEAT EMPTOR: +-## There is no encapsulation within the following macros, do not change +-## the running order or otherwise move them around unless you know exactly +-## what you are doing... +-AC_LIBTOOL_POSTDEP_PREDEP($1) +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) ++irix5* | irix6* | nonstopux*) ++ case $LD in ++ *-32|*"-32 ") libmagic=32-bit;; ++ *-n32|*"-n32 ") libmagic=N32;; ++ *-64|*"-64 ") libmagic=64-bit;; ++ *) libmagic=never-match;; ++ esac ++ lt_cv_deplibs_check_method=pass_all ++ ;; + +-AC_LIBTOOL_CONFIG($1) ++# This must be Linux ELF. ++linux* | k*bsd*-gnu) ++ lt_cv_deplibs_check_method=pass_all ++ ;; + +-AC_LANG_POP +-CC=$lt_save_CC +-LDCXX=$LD +-LD=$lt_save_LD +-GCC=$lt_save_GCC +-with_gnu_ldcxx=$with_gnu_ld +-with_gnu_ld=$lt_save_with_gnu_ld +-lt_cv_path_LDCXX=$lt_cv_path_LD +-lt_cv_path_LD=$lt_save_path_LD +-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +-])# AC_LIBTOOL_LANG_CXX_CONFIG ++netbsd*) ++ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then ++ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' ++ else ++ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' ++ fi ++ ;; + +-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +-# ------------------------------------ +-# Figure out "hidden" library dependencies from verbose +-# compiler output when linking a shared library. +-# Parse the compiler output and extract the necessary +-# objects, libraries and library flags. +-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +-dnl we can't use the lt_simple_compile_test_code here, +-dnl because it contains code intended for an executable, +-dnl not a library. It's possible we should let each +-dnl tag define a new lt_????_link_test_code variable, +-dnl but it's only used here... +-ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&1 | sed '1q'` in ++ */dev/null* | *'Invalid file or object type'*) ++ lt_cv_path_NM="$tmp_nm -B" ++ break ++ ;; ++ *) ++ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in ++ */dev/null*) ++ lt_cv_path_NM="$tmp_nm -p" ++ break ++ ;; ++ *) ++ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but ++ continue # so that we can try to find one that supports BSD flags ++ ;; ++ esac ++ ;; ++ esac ++ fi ++ done ++ IFS="$lt_save_ifs" ++ done ++ : ${lt_cv_path_NM=no} ++fi]) ++if test "$lt_cv_path_NM" != "no"; then ++ NM="$lt_cv_path_NM" ++else ++ # Didn't find any BSD compatible name lister, look for dumpbin. ++ AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) ++ AC_SUBST([DUMPBIN]) ++ if test "$DUMPBIN" != ":"; then ++ NM="$DUMPBIN" ++ fi ++fi ++test -z "$NM" && NM=nm ++AC_SUBST([NM]) ++_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl ++ ++AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], ++ [lt_cv_nm_interface="BSD nm" ++ echo "int some_variable = 0;" > conftest.$ac_ext ++ (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) ++ (eval "$ac_compile" 2>conftest.err) ++ cat conftest.err >&AS_MESSAGE_LOG_FD ++ (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) ++ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) ++ cat conftest.err >&AS_MESSAGE_LOG_FD ++ (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) ++ cat conftest.out >&AS_MESSAGE_LOG_FD ++ if $GREP 'External.*some_variable' conftest.out > /dev/null; then ++ lt_cv_nm_interface="MS dumpbin" ++ fi ++ rm -f conftest*]) ++])# LT_PATH_NM ++ ++# Old names: ++AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) ++AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AM_PROG_NM], []) ++dnl AC_DEFUN([AC_PROG_NM], []) ++ ++ ++# LT_LIB_M ++# -------- ++# check for math library ++AC_DEFUN([LT_LIB_M], ++[AC_REQUIRE([AC_CANONICAL_HOST])dnl ++LIBM= ++case $host in ++*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) ++ # These system don't have libm, or don't need it ++ ;; ++*-ncr-sysv4.3*) ++ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") ++ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ++ ;; ++*) ++ AC_CHECK_LIB(m, cos, LIBM="-lm") ++ ;; ++esac ++AC_SUBST([LIBM]) ++])# LT_LIB_M ++ ++# Old name: ++AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([AC_CHECK_LIBM], []) ++ ++ ++# _LT_COMPILER_NO_RTTI([TAGNAME]) ++# ------------------------------- ++m4_defun([_LT_COMPILER_NO_RTTI], ++[m4_require([_LT_TAG_COMPILER])dnl ++ ++_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= ++ ++if test "$GCC" = yes; then ++ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ++ ++ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], ++ lt_cv_prog_compiler_rtti_exceptions, ++ [-fno-rtti -fno-exceptions], [], ++ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) ++fi ++_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], ++ [Compiler flag to turn off builtin functions]) ++])# _LT_COMPILER_NO_RTTI ++ ++ ++# _LT_CMD_GLOBAL_SYMBOLS ++# ---------------------- ++m4_defun([_LT_CMD_GLOBAL_SYMBOLS], ++[AC_REQUIRE([AC_CANONICAL_HOST])dnl ++AC_REQUIRE([AC_PROG_CC])dnl ++AC_REQUIRE([LT_PATH_NM])dnl ++AC_REQUIRE([LT_PATH_LD])dnl ++m4_require([_LT_DECL_SED])dnl ++m4_require([_LT_DECL_EGREP])dnl ++m4_require([_LT_TAG_COMPILER])dnl ++ ++# Check for command to grab the raw symbol name followed by C symbol from nm. ++AC_MSG_CHECKING([command to parse $NM output from $compiler object]) ++AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], ++[ ++# These are sane defaults that work on at least a few old systems. ++# [They come from Ultrix. What could be older than Ultrix?!! ;)] ++ ++# Character class describing NM global symbol codes. ++symcode='[[BCDEGRST]]' ++ ++# Regexp to match symbols that can be accessed directly from C. ++sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' ++ ++# Define system-specific variables. ++case $host_os in ++aix*) ++ symcode='[[BCDT]]' ++ ;; ++cygwin* | mingw* | pw32*) ++ symcode='[[ABCDGISTW]]' ++ ;; ++hpux*) ++ if test "$host_cpu" = ia64; then ++ symcode='[[ABCDEGRST]]' ++ fi ++ ;; ++irix* | nonstopux*) ++ symcode='[[BCDEGRST]]' ++ ;; ++osf*) ++ symcode='[[BCDEGQRST]]' ++ ;; ++solaris*) ++ symcode='[[BDRT]]' ++ ;; ++sco3.2v5*) ++ symcode='[[DT]]' ++ ;; ++sysv4.2uw2*) ++ symcode='[[DT]]' ++ ;; ++sysv5* | sco5v6* | unixware* | OpenUNIX*) ++ symcode='[[ABDT]]' ++ ;; ++sysv4) ++ symcode='[[DFNSTU]]' ++ ;; ++esac ++ ++# If we're using GNU nm, then use its standard symbol codes. ++case `$NM -V 2>&1` in ++*GNU* | *'with BFD'*) ++ symcode='[[ABCDGIRSTW]]' ;; ++esac ++ ++# Transform an extracted symbol line into a proper C declaration. ++# Some systems (esp. on ia64) link data and code symbols differently, ++# so use this general approach. ++lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" ++ ++# Transform an extracted symbol line into symbol name and symbol address ++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" ++ ++# Handle CRLF in mingw tool chain ++opt_cr= ++case $build_os in ++mingw*) ++ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ++ ;; ++esac ++ ++# Try without a prefix underscore, then with it. ++for ac_symprfx in "" "_"; do ++ ++ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. ++ symxfrm="\\1 $ac_symprfx\\2 \\2" ++ ++ # Write the raw and C identifiers. ++ if test "$lt_cv_nm_interface" = "MS dumpbin"; then ++ # Fake it for dumpbin and say T for any non-static function ++ # and D for any global variable. ++ # Also find C++ and __fastcall symbols from MSVC++, ++ # which start with @ or ?. ++ lt_cv_sys_global_symbol_pipe="$AWK ['"\ ++" {last_section=section; section=\$ 3};"\ ++" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ ++" \$ 0!~/External *\|/{next};"\ ++" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ ++" {if(hide[section]) next};"\ ++" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ ++" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ ++" s[1]~/^[@?]/{print s[1], s[1]; next};"\ ++" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ ++" ' prfx=^$ac_symprfx]" ++ else ++ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" ++ fi ++ ++ # Check to see that the pipe works correctly. ++ pipe_works=no ++ ++ rm -f conftest* ++ cat > conftest.$ac_ext <<_LT_EOF ++#ifdef __cplusplus ++extern "C" { ++#endif ++char nm_test_var; ++void nm_test_func(void); ++void nm_test_func(void){} ++#ifdef __cplusplus ++} ++#endif ++int main(){nm_test_var='a';nm_test_func();return(0);} ++_LT_EOF ++ ++ if AC_TRY_EVAL(ac_compile); then ++ # Now try to grab the symbols. ++ nlist=conftest.nm ++ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then ++ # Try sorting and uniquifying the output. ++ if sort "$nlist" | uniq > "$nlist"T; then ++ mv -f "$nlist"T "$nlist" ++ else ++ rm -f "$nlist"T ++ fi ++ ++ # Make sure that we snagged all the symbols we need. ++ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then ++ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then ++ cat <<_LT_EOF > conftest.$ac_ext ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++_LT_EOF ++ # Now generate the symbol file. ++ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' ++ ++ cat <<_LT_EOF >> conftest.$ac_ext ++ ++/* The mapping between symbol names and symbols. */ ++const struct { ++ const char *name; ++ void *address; ++} ++lt__PROGRAM__LTX_preloaded_symbols[[]] = ++{ ++ { "@PROGRAM@", (void *) 0 }, ++_LT_EOF ++ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext ++ cat <<\_LT_EOF >> conftest.$ac_ext ++ {0, (void *) 0} ++}; ++ ++/* This works around a problem in FreeBSD linker */ ++#ifdef FREEBSD_WORKAROUND ++static const void *lt_preloaded_setup() { ++ return lt__PROGRAM__LTX_preloaded_symbols; ++} ++#endif ++ ++#ifdef __cplusplus ++} ++#endif ++_LT_EOF ++ # Now try linking the two files. ++ mv conftest.$ac_objext conftstm.$ac_objext ++ lt_save_LIBS="$LIBS" ++ lt_save_CFLAGS="$CFLAGS" ++ LIBS="conftstm.$ac_objext" ++ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" ++ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then ++ pipe_works=yes ++ fi ++ LIBS="$lt_save_LIBS" ++ CFLAGS="$lt_save_CFLAGS" ++ else ++ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD ++ fi ++ else ++ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD ++ fi ++ else ++ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD ++ fi ++ else ++ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD ++ cat conftest.$ac_ext >&5 ++ fi ++ rm -rf conftest* conftst* + +- if test "$pre_test_object_deps_done" = no; then +- case $p in +- -L* | -R*) +- # Internal compiler library paths should come after those +- # provided the user. The postdeps already come after the +- # user supplied libs so there is no need to process them. +- if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then +- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" +- else +- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" +- fi +- ;; +- # The "-l" case would never come before the object being +- # linked, so don't bother handling this case. +- esac +- else +- if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then +- _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}" +- else +- _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}" +- fi +- fi +- ;; ++ # Do not use the global_symbol_pipe unless it works. ++ if test "$pipe_works" = yes; then ++ break ++ else ++ lt_cv_sys_global_symbol_pipe= ++ fi ++done ++]) ++if test -z "$lt_cv_sys_global_symbol_pipe"; then ++ lt_cv_sys_global_symbol_to_cdecl= ++fi ++if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then ++ AC_MSG_RESULT(failed) ++else ++ AC_MSG_RESULT(ok) ++fi + +- *.$objext) +- # This assumes that the test object file only shows up +- # once in the compiler output. +- if test "$p" = "conftest.$objext"; then +- pre_test_object_deps_done=yes +- continue +- fi ++_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], ++ [Take the output of nm and produce a listing of raw symbols and C names]) ++_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], ++ [Transform the output of nm in a proper C declaration]) ++_LT_DECL([global_symbol_to_c_name_address], ++ [lt_cv_sys_global_symbol_to_c_name_address], [1], ++ [Transform the output of nm in a C name address pair]) ++_LT_DECL([global_symbol_to_c_name_address_lib_prefix], ++ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], ++ [Transform the output of nm in a C name address pair when lib prefix is needed]) ++]) # _LT_CMD_GLOBAL_SYMBOLS + +- if test "$pre_test_object_deps_done" = no; then +- if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then +- _LT_AC_TAGVAR(predep_objects, $1)="$p" +- else +- _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p" +- fi +- else +- if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then +- _LT_AC_TAGVAR(postdep_objects, $1)="$p" +- else +- _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p" +- fi +- fi +- ;; + +- *) ;; # Ignore the rest. ++# _LT_COMPILER_PIC([TAGNAME]) ++# --------------------------- ++m4_defun([_LT_COMPILER_PIC], ++[m4_require([_LT_TAG_COMPILER])dnl ++_LT_TAGVAR(lt_prog_compiler_wl, $1)= ++_LT_TAGVAR(lt_prog_compiler_pic, $1)= ++_LT_TAGVAR(lt_prog_compiler_static, $1)= ++ ++AC_MSG_CHECKING([for $compiler option to produce PIC]) ++m4_if([$1], [CXX], [ ++ # C++ specific cases for pic, static, wl, etc. ++ if test "$GXX" = yes; then ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ++ case $host_os in ++ aix*) ++ # All AIX code is PIC. ++ if test "$host_cpu" = ia64; then ++ # AIX 5 now supports IA64 processor ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ fi ++ ;; ++ ++ amigaos*) ++ case $host_cpu in ++ powerpc) ++ # see comment about AmigaOS4 .so support ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ ;; ++ m68k) ++ # FIXME: we need at least 68020 code to build shared libraries, but ++ # adding the `-m68020' flag to GCC prevents building anything better, ++ # like `-m68040'. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ++ ;; ++ esac ++ ;; ++ ++ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) ++ # PIC is the default for these OSes. ++ ;; ++ mingw* | cygwin* | os2* | pw32*) ++ # This hack is so that the source file can tell whether it is being ++ # built for inclusion in a dll (and should export symbols for example). ++ # Although the cygwin gcc ignores -fPIC, still need this for old-style ++ # (--disable-auto-import) libraries ++ m4_if([$1], [GCJ], [], ++ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ++ ;; ++ darwin* | rhapsody*) ++ # PIC is the default on this platform ++ # Common symbols not allowed in MH_DYLIB files ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ++ ;; ++ *djgpp*) ++ # DJGPP does not support shared libraries at all ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)= ++ ;; ++ interix[[3-9]]*) ++ # Interix 3.x gcc -fpic/-fPIC options generate broken code. ++ # Instead, we relocate shared libraries at runtime. ++ ;; ++ sysv4*MP*) ++ if test -d /usr/nec; then ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic ++ fi ++ ;; ++ hpux*) ++ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but ++ # not for PA HP-UX. ++ case $host_cpu in ++ hppa*64*|ia64*) ++ ;; ++ *) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ ;; ++ esac ++ ;; ++ *qnx* | *nto*) ++ # QNX uses GNU C++, but need to define -shared option too, otherwise ++ # it will coredump. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ++ ;; ++ *) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ ;; ++ esac ++ else ++ case $host_os in ++ aix[[4-9]]*) ++ # All AIX code is PIC. ++ if test "$host_cpu" = ia64; then ++ # AIX 5 now supports IA64 processor ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ else ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' ++ fi ++ ;; ++ chorus*) ++ case $cc_basename in ++ cxch68*) ++ # Green Hills C++ Compiler ++ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ++ ;; ++ esac ++ ;; ++ dgux*) ++ case $cc_basename in ++ ec++*) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ ;; ++ ghcx*) ++ # Green Hills C++ Compiler ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ freebsd* | dragonfly*) ++ # FreeBSD uses GNU C++ ++ ;; ++ hpux9* | hpux10* | hpux11*) ++ case $cc_basename in ++ CC*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ++ if test "$host_cpu" != ia64; then ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ++ fi ++ ;; ++ aCC*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ++ case $host_cpu in ++ hppa*64*|ia64*) ++ # +Z the default ++ ;; ++ *) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ++ ;; ++ esac ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ interix*) ++ # This is c89, which is MS Visual C++ (no shared libs) ++ # Anyone wants to do a port? ++ ;; ++ irix5* | irix6* | nonstopux*) ++ case $cc_basename in ++ CC*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ # CC pic flag -KPIC is the default. ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ linux* | k*bsd*-gnu) ++ case $cc_basename in ++ KCC*) ++ # KAI C++ Compiler ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ ;; ++ icpc* | ecpc* ) ++ # Intel C++ ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ++ ;; ++ pgCC* | pgcpp*) ++ # Portland Group C++ compiler ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; ++ cxx*) ++ # Compaq C++ ++ # Make sure the PIC flag is empty. It appears that all Alpha ++ # Linux and Compaq Tru64 Unix objects are PIC. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)= ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ ;; ++ xlc* | xlC*) ++ # IBM XL 8.0 on PPC ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ++ ;; ++ *) ++ case `$CC -V 2>&1 | sed 5q` in ++ *Sun\ C*) ++ # Sun C++ 5.9 ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ++ ;; ++ esac ++ ;; ++ esac ++ ;; ++ lynxos*) ++ ;; ++ m88k*) ++ ;; ++ mvs*) ++ case $cc_basename in ++ cxx*) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ netbsd*) ++ ;; ++ *qnx* | *nto*) ++ # QNX uses GNU C++, but need to define -shared option too, otherwise ++ # it will coredump. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ++ ;; ++ osf3* | osf4* | osf5*) ++ case $cc_basename in ++ KCC*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ++ ;; ++ RCC*) ++ # Rational C++ 2.4.1 ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ++ ;; ++ cxx*) ++ # Digital/Compaq C++ ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ # Make sure the PIC flag is empty. It appears that all Alpha ++ # Linux and Compaq Tru64 Unix objects are PIC. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)= ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ psos*) ++ ;; ++ solaris*) ++ case $cc_basename in ++ CC*) ++ # Sun C++ 4.2, 5.x and Centerline C++ ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ++ ;; ++ gcx*) ++ # Green Hills C++ Compiler ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ sunos4*) ++ case $cc_basename in ++ CC*) ++ # Sun C++ 4.x ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; ++ lcc*) ++ # Lucid ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) ++ case $cc_basename in ++ CC*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; ++ esac ++ ;; ++ tandem*) ++ case $cc_basename in ++ NCC*) ++ # NonStop-UX NCC 3.20 ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ vxworks*) ++ ;; ++ *) ++ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ++ ;; + esac +- done +- +- # Clean up. +- rm -f a.out a.exe +-else +- echo "libtool.m4: error: problem compiling $1 test program" +-fi +- +-$rm -f confest.$objext +- +-# PORTME: override above test on systems where it is broken +-ifelse([$1],[CXX], +-[case $host_os in +-interix3*) +- # Interix 3.5 installs completely hosed .la files for C++, so rather than +- # hack all around it, let's just trust "g++" to DTRT. +- _LT_AC_TAGVAR(predep_objects,$1)= +- _LT_AC_TAGVAR(postdep_objects,$1)= +- _LT_AC_TAGVAR(postdeps,$1)= +- ;; +- +-linux*) +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) +- # Sun C++ 5.9 +- _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun' +- ;; +- esac +- ;; +- +-solaris*) +- case $cc_basename in +- CC*) +- # Adding this requires a known-good setup of shared libraries for +- # Sun compiler versions before 5.6, else PIC objects from an old +- # archive will be linked into the output, leading to subtle bugs. +- _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun' +- ;; +- esac +- ;; +-esac +-]) +- +-case " $_LT_AC_TAGVAR(postdeps, $1) " in +-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; +-esac +-])# AC_LIBTOOL_POSTDEP_PREDEP +- +-# AC_LIBTOOL_LANG_F77_CONFIG +-# -------------------------- +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) +-AC_DEFUN([_LT_AC_LANG_F77_CONFIG], +-[AC_REQUIRE([AC_PROG_F77]) +-AC_LANG_PUSH(Fortran 77) +- +-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +-_LT_AC_TAGVAR(allow_undefined_flag, $1)= +-_LT_AC_TAGVAR(always_export_symbols, $1)=no +-_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_direct, $1)=no +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +-_LT_AC_TAGVAR(hardcode_automatic, $1)=no +-_LT_AC_TAGVAR(module_cmds, $1)= +-_LT_AC_TAGVAR(module_expsym_cmds, $1)= +-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +-_LT_AC_TAGVAR(no_undefined_flag, $1)= +-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +- +-# Source file extension for f77 test sources. +-ac_ext=f +- +-# Object file extension for compiled f77 test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code=" subroutine t\n return\n end\n" +- +-# Code to be used in simple link tests +-lt_simple_link_test_code=" program t\n end\n" +- +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER +- +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE +- +-# Allow CC to be a program name with arguments. +-lt_save_CC="$CC" +-CC=${F77-"f77"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +- +-AC_MSG_CHECKING([if libtool supports shared libraries]) +-AC_MSG_RESULT([$can_build_shared]) +- +-AC_MSG_CHECKING([whether to build shared libraries]) +-test "$can_build_shared" = "no" && enable_shared=no +- +-# On AIX, shared libraries and static libraries use the same namespace, and +-# are all built from PIC. +-case $host_os in +-aix3*) +- test "$enable_shared" = yes && enable_static=no +- if test -n "$RANLIB"; then +- archive_cmds="$archive_cmds~\$RANLIB \$lib" +- postinstall_cmds='$RANLIB $lib' + fi +- ;; +-aix4* | aix5*) +- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then +- test "$enable_shared" = yes && enable_static=no +- fi +- ;; +-esac +-AC_MSG_RESULT([$enable_shared]) +- +-AC_MSG_CHECKING([whether to build static libraries]) +-# Make sure either enable_shared or enable_static is yes. +-test "$enable_shared" = yes || enable_static=yes +-AC_MSG_RESULT([$enable_static]) +- +-_LT_AC_TAGVAR(GCC, $1)="$G77" +-_LT_AC_TAGVAR(LD, $1)="$LD" +- +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_POP +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_F77_CONFIG +- +- +-# AC_LIBTOOL_LANG_GCJ_CONFIG +-# -------------------------- +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) +-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], +-[AC_LANG_SAVE +- +-# Source file extension for Java test sources. +-ac_ext=java ++], ++[ ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + +-# Object file extension for compiled Java test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext ++ case $host_os in ++ aix*) ++ # All AIX code is PIC. ++ if test "$host_cpu" = ia64; then ++ # AIX 5 now supports IA64 processor ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ fi ++ ;; + +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="class foo {}\n" ++ amigaos*) ++ case $host_cpu in ++ powerpc) ++ # see comment about AmigaOS4 .so support ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ ;; ++ m68k) ++ # FIXME: we need at least 68020 code to build shared libraries, but ++ # adding the `-m68020' flag to GCC prevents building anything better, ++ # like `-m68040'. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ++ ;; ++ esac ++ ;; + +-# Code to be used in simple link tests +-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n' ++ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) ++ # PIC is the default for these OSes. ++ ;; + +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER ++ mingw* | cygwin* | pw32* | os2*) ++ # This hack is so that the source file can tell whether it is being ++ # built for inclusion in a dll (and should export symbols for example). ++ # Although the cygwin gcc ignores -fPIC, still need this for old-style ++ # (--disable-auto-import) libraries ++ m4_if([$1], [GCJ], [], ++ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ++ ;; + +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE ++ darwin* | rhapsody*) ++ # PIC is the default on this platform ++ # Common symbols not allowed in MH_DYLIB files ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ++ ;; + +-# Allow CC to be a program name with arguments. +-lt_save_CC="$CC" +-CC=${GCJ-"gcj"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) ++ hpux*) ++ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but ++ # not for PA HP-UX. ++ case $host_cpu in ++ hppa*64*|ia64*) ++ # +Z the default ++ ;; ++ *) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ ;; ++ esac ++ ;; + +-# GCJ did not exist at the time GCC didn't implicitly link libc in. +-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ++ interix[[3-9]]*) ++ # Interix 3.x gcc -fpic/-fPIC options generate broken code. ++ # Instead, we relocate shared libraries at runtime. ++ ;; + +-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ++ msdosdjgpp*) ++ # Just because we use GCC doesn't mean we suddenly get shared libraries ++ # on systems that don't support them. ++ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ++ enable_shared=no ++ ;; + +-## CAVEAT EMPTOR: +-## There is no encapsulation within the following macros, do not change +-## the running order or otherwise move them around unless you know exactly +-## what you are doing... +-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) ++ *nto* | *qnx*) ++ # QNX uses GNU C++, but need to define -shared option too, otherwise ++ # it will coredump. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ++ ;; + +-AC_LIBTOOL_CONFIG($1) ++ sysv4*MP*) ++ if test -d /usr/nec; then ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic ++ fi ++ ;; + +-AC_LANG_RESTORE +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_GCJ_CONFIG ++ *) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ ;; ++ esac ++ else ++ # PORTME Check for flag to pass linker flags through the system compiler. ++ case $host_os in ++ aix*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ if test "$host_cpu" = ia64; then ++ # AIX 5 now supports IA64 processor ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ else ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' ++ fi ++ ;; + ++ mingw* | cygwin* | pw32* | os2*) ++ # This hack is so that the source file can tell whether it is being ++ # built for inclusion in a dll (and should export symbols for example). ++ m4_if([$1], [GCJ], [], ++ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ++ ;; + +-# AC_LIBTOOL_LANG_RC_CONFIG +-# ------------------------- +-# Ensure that the configuration vars for the Windows resource compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) +-AC_DEFUN([_LT_AC_LANG_RC_CONFIG], +-[AC_LANG_SAVE ++ hpux9* | hpux10* | hpux11*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but ++ # not for PA HP-UX. ++ case $host_cpu in ++ hppa*64*|ia64*) ++ # +Z the default ++ ;; ++ *) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ++ ;; ++ esac ++ # Is there a better lt_prog_compiler_static that works with the bundled CC? ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ++ ;; + +-# Source file extension for RC test sources. +-ac_ext=rc ++ irix5* | irix6* | nonstopux*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ # PIC (with -KPIC) is the default. ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ ;; + +-# Object file extension for compiled RC test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext ++ linux* | k*bsd*-gnu) ++ case $cc_basename in ++ icc* | ecc* | ifort*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ++ ;; ++ pgcc* | pgf77* | pgf90* | pgf95*) ++ # Portland Group compilers (*not* the Pentium gcc compiler, ++ # which looks to be a dead project) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; ++ ccc*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ # All Alpha code is PIC. ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ ;; ++ xl*) ++ # IBM XL C 8.0/Fortran 10.1 on PPC ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ++ ;; ++ *) ++ case `$CC -V 2>&1 | sed 5q` in ++ *Sun\ C*) ++ # Sun C 5.9 ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ ;; ++ *Sun\ F*) ++ # Sun Fortran 8.3 passes all unrecognized flags to the linker ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ++ ;; ++ esac ++ ;; ++ esac ++ ;; + +-# Code to be used in simple compile tests +-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' ++ newsos6) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; + +-# Code to be used in simple link tests +-lt_simple_link_test_code="$lt_simple_compile_test_code" ++ *nto* | *qnx*) ++ # QNX uses GNU C++, but need to define -shared option too, otherwise ++ # it will coredump. ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ++ ;; + +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER ++ osf3* | osf4* | osf5*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ # All OSF/1 code is PIC. ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ ;; + +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE ++ rdos*) ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ ;; + +-# Allow CC to be a program name with arguments. +-lt_save_CC="$CC" +-CC=${RC-"windres"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes ++ solaris*) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ case $cc_basename in ++ f77* | f90* | f95*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; ++ *) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; ++ esac ++ ;; + +-AC_LIBTOOL_CONFIG($1) ++ sunos4*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; + +-AC_LANG_RESTORE +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_RC_CONFIG ++ sysv4 | sysv4.2uw2* | sysv4.3*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; ++ ++ sysv4*MP*) ++ if test -d /usr/nec ;then ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ fi ++ ;; + ++ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; + +-# AC_LIBTOOL_CONFIG([TAGNAME]) +-# ---------------------------- +-# If TAGNAME is not passed, then create an initial libtool script +-# with a default configuration from the untagged config vars. Otherwise +-# add code to config.status for appending the configuration named by +-# TAGNAME from the matching tagged config vars. +-AC_DEFUN([AC_LIBTOOL_CONFIG], +-[# The else clause should only fire when bootstrapping the +-# libtool distribution, otherwise you forgot to ship ltmain.sh +-# with your package, and you will get complaints that there are +-# no rules to generate ltmain.sh. +-if test -f "$ltmain"; then +- # See if we are running on zsh, and set the options which allow our commands through +- # without removal of \ escapes. +- if test -n "${ZSH_VERSION+set}" ; then +- setopt NO_GLOB_SUBST +- fi +- # Now quote all the things that may contain metacharacters while being +- # careful not to overquote the AC_SUBSTed values. We take copies of the +- # variables and quote the copies for generation of the libtool script. +- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ +- SED SHELL STRIP \ +- libname_spec library_names_spec soname_spec extract_expsyms_cmds \ +- old_striplib striplib file_magic_cmd finish_cmds finish_eval \ +- deplibs_check_method reload_flag reload_cmds need_locks \ +- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ +- lt_cv_sys_global_symbol_to_c_name_address \ +- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ +- old_postinstall_cmds old_postuninstall_cmds \ +- _LT_AC_TAGVAR(compiler, $1) \ +- _LT_AC_TAGVAR(CC, $1) \ +- _LT_AC_TAGVAR(LD, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ +- _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ +- _LT_AC_TAGVAR(old_archive_cmds, $1) \ +- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ +- _LT_AC_TAGVAR(predep_objects, $1) \ +- _LT_AC_TAGVAR(postdep_objects, $1) \ +- _LT_AC_TAGVAR(predeps, $1) \ +- _LT_AC_TAGVAR(postdeps, $1) \ +- _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ +- _LT_AC_TAGVAR(archive_cmds, $1) \ +- _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ +- _LT_AC_TAGVAR(postinstall_cmds, $1) \ +- _LT_AC_TAGVAR(postuninstall_cmds, $1) \ +- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ +- _LT_AC_TAGVAR(allow_undefined_flag, $1) \ +- _LT_AC_TAGVAR(no_undefined_flag, $1) \ +- _LT_AC_TAGVAR(export_symbols_cmds, $1) \ +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ +- _LT_AC_TAGVAR(hardcode_automatic, $1) \ +- _LT_AC_TAGVAR(module_cmds, $1) \ +- _LT_AC_TAGVAR(module_expsym_cmds, $1) \ +- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ +- _LT_AC_TAGVAR(exclude_expsyms, $1) \ +- _LT_AC_TAGVAR(include_expsyms, $1); do +- +- case $var in +- _LT_AC_TAGVAR(old_archive_cmds, $1) | \ +- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ +- _LT_AC_TAGVAR(archive_cmds, $1) | \ +- _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ +- _LT_AC_TAGVAR(module_cmds, $1) | \ +- _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ +- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ +- _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ +- extract_expsyms_cmds | reload_cmds | finish_cmds | \ +- postinstall_cmds | postuninstall_cmds | \ +- old_postinstall_cmds | old_postuninstall_cmds | \ +- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) +- # Double-quote double-evaled strings. +- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ++ unicos*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ++ ;; ++ ++ uts4*) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; ++ + *) +- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ++ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac +- done +- +- case $lt_echo in +- *'\[$]0 --fallback-echo"') +- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` ++ fi ++]) ++case $host_os in ++ # For platforms which do not support PIC, -DPIC is meaningless: ++ *djgpp*) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; +- esac +- +-ifelse([$1], [], +- [cfgfile="${ofile}T" +- trap "$rm \"$cfgfile\"; exit 1" 1 2 15 +- $rm -f "$cfgfile" +- AC_MSG_NOTICE([creating $ofile])], +- [cfgfile="$ofile"]) +- +- cat <<__EOF__ >> "$cfgfile" +-ifelse([$1], [], +-[#! $SHELL ++ *) ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ++ ;; ++esac ++AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) ++_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], ++ [How to pass a linker flag through the compiler]) + +-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +-# NOTE: Changes made to this file will be lost: look at ltmain.sh. + # +-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +-# Free Software Foundation, Inc. +-# +-# This file is part of GNU Libtool: +-# Originally by Gordon Matzigkeit , 1996 +-# +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2 of the License, or +-# (at your option) any later version. ++# Check to make sure the PIC flag actually works. + # +-# 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. ++if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then ++ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], ++ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], ++ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], ++ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in ++ "" | " "*) ;; ++ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; ++ esac], ++ [_LT_TAGVAR(lt_prog_compiler_pic, $1)= ++ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) ++fi ++_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], ++ [Additional compiler flags for building library objects]) ++ + # +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++# Check to make sure the static flag actually works. + # +-# As a special exception to the GNU General Public License, if you +-# distribute this file as part of a program that contains a +-# configuration script generated by Autoconf, you may include it under +-# the same distribution terms that you use for the rest of that program. +- +-# A sed program that does not truncate output. +-SED=$lt_SED +- +-# Sed that helps us avoid accidentally triggering echo(1) options like -n. +-Xsed="$SED -e 1s/^X//" +- +-# The HP-UX ksh and POSIX shell print the target directory to stdout +-# if CDPATH is set. +-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +- +-# The names of the tagged configurations supported by this script. +-available_tags= +- +-# ### BEGIN LIBTOOL CONFIG], +-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) +- +-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +- +-# Shell to use when invoking shell scripts. +-SHELL=$lt_SHELL +- +-# Whether or not to build shared libraries. +-build_libtool_libs=$enable_shared +- +-# Whether or not to build static libraries. +-build_old_libs=$enable_static +- +-# Whether or not to add -lc for building shared libraries. +-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) +- +-# Whether or not to disallow shared libs when runtime libs are static +-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) +- +-# Whether or not to optimize for fast installation. +-fast_install=$enable_fast_install +- +-# The host system. +-host_alias=$host_alias +-host=$host +-host_os=$host_os ++wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" ++_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], ++ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), ++ $lt_tmp_static_flag, ++ [], ++ [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) ++_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], ++ [Compiler flag to prevent dynamic linking]) ++])# _LT_COMPILER_PIC + +-# The build system. +-build_alias=$build_alias +-build=$build +-build_os=$build_os + +-# An echo program that does not interpret backslashes. +-echo=$lt_echo ++# _LT_LINKER_SHLIBS([TAGNAME]) ++# ---------------------------- ++# See if the linker supports building shared libraries. ++m4_defun([_LT_LINKER_SHLIBS], ++[AC_REQUIRE([LT_PATH_LD])dnl ++AC_REQUIRE([LT_PATH_NM])dnl ++m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++m4_require([_LT_DECL_EGREP])dnl ++m4_require([_LT_DECL_SED])dnl ++m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl ++m4_require([_LT_TAG_COMPILER])dnl ++AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ++m4_if([$1], [CXX], [ ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ++ case $host_os in ++ aix[[4-9]]*) ++ # If we're using GNU nm, then we don't want the "-C" option. ++ # -C means demangle to AIX nm, but means don't demangle with GNU nm ++ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' ++ else ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' ++ fi ++ ;; ++ pw32*) ++ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ++ ;; ++ cygwin* | mingw*) ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ++ ;; ++ *) ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ++ ;; ++ esac ++ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ++], [ ++ runpath_var= ++ _LT_TAGVAR(allow_undefined_flag, $1)= ++ _LT_TAGVAR(always_export_symbols, $1)=no ++ _LT_TAGVAR(archive_cmds, $1)= ++ _LT_TAGVAR(archive_expsym_cmds, $1)= ++ _LT_TAGVAR(compiler_needs_object, $1)=no ++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)= ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ++ _LT_TAGVAR(hardcode_automatic, $1)=no ++ _LT_TAGVAR(hardcode_direct, $1)=no ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=no ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= ++ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= ++ _LT_TAGVAR(hardcode_libdir_separator, $1)= ++ _LT_TAGVAR(hardcode_minus_L, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported ++ _LT_TAGVAR(inherit_rpath, $1)=no ++ _LT_TAGVAR(link_all_deplibs, $1)=unknown ++ _LT_TAGVAR(module_cmds, $1)= ++ _LT_TAGVAR(module_expsym_cmds, $1)= ++ _LT_TAGVAR(old_archive_from_new_cmds, $1)= ++ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= ++ _LT_TAGVAR(thread_safe_flag_spec, $1)= ++ _LT_TAGVAR(whole_archive_flag_spec, $1)= ++ # include_expsyms should be a list of space-separated symbols to be *always* ++ # included in the symbol list ++ _LT_TAGVAR(include_expsyms, $1)= ++ # exclude_expsyms can be an extended regexp of symbols to exclude ++ # it will be wrapped by ` (' and `)$', so one must not match beginning or ++ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', ++ # as well as any symbol that contains `d'. ++ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ++ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out ++ # platforms (ab)use it in PIC code, but their linkers get confused if ++ # the symbol is explicitly referenced. Since portable code cannot ++ # rely on this symbol name, it's probably fine to never include it in ++ # preloaded symbol tables. ++ # Exclude shared library initialization/finalization symbols. ++dnl Note also adjust exclude_expsyms for C++ above. ++ extract_expsyms_cmds= + +-# The archiver. +-AR=$lt_AR +-AR_FLAGS=$lt_AR_FLAGS ++ case $host_os in ++ cygwin* | mingw* | pw32*) ++ # FIXME: the MSVC++ port hasn't been tested in a loooong time ++ # When not using gcc, we currently assume that we are using ++ # Microsoft Visual C++. ++ if test "$GCC" != yes; then ++ with_gnu_ld=no ++ fi ++ ;; ++ interix*) ++ # we just hope/assume this is gcc and not c89 (= MSVC++) ++ with_gnu_ld=yes ++ ;; ++ openbsd*) ++ with_gnu_ld=no ++ ;; ++ esac + +-# A C compiler. +-LTCC=$lt_LTCC ++ _LT_TAGVAR(ld_shlibs, $1)=yes ++ if test "$with_gnu_ld" = yes; then ++ # If archive_cmds runs LD, not CC, wlarc should be empty ++ wlarc='${wl}' + +-# LTCC compiler flags. +-LTCFLAGS=$lt_LTCFLAGS ++ # Set some defaults for GNU ld with shared library support. These ++ # are reset later if shared libraries are not supported. Putting them ++ # here allows them to be overridden if necessary. ++ runpath_var=LD_RUN_PATH ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ # ancient GNU ld didn't support --whole-archive et. al. ++ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then ++ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' ++ else ++ _LT_TAGVAR(whole_archive_flag_spec, $1)= ++ fi ++ supports_anon_versioning=no ++ case `$LD -v 2>&1` in ++ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 ++ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... ++ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... ++ *\ 2.11.*) ;; # other 2.11 versions ++ *) supports_anon_versioning=yes ;; ++ esac + +-# A language-specific compiler. +-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) ++ # See if GNU ld supports shared libraries. ++ case $host_os in ++ aix[[3-9]]*) ++ # On AIX/PPC, the GNU linker is very broken ++ if test "$host_cpu" != ia64; then ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ cat <<_LT_EOF 1>&2 + +-# Is the compiler the GNU C compiler? +-with_gcc=$_LT_AC_TAGVAR(GCC, $1) ++*** Warning: the GNU linker, at least up to release 2.9.1, is reported ++*** to be unable to reliably create shared libraries on AIX. ++*** Therefore, libtool is disabling shared libraries support. If you ++*** really care for shared libraries, you may want to modify your PATH ++*** so that a non-GNU linker is found, and then restart. + +-# An ERE matcher. +-EGREP=$lt_EGREP ++_LT_EOF ++ fi ++ ;; + +-# The linker used to build libraries. +-LD=$lt_[]_LT_AC_TAGVAR(LD, $1) ++ amigaos*) ++ case $host_cpu in ++ powerpc) ++ # see comment about AmigaOS4 .so support ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='' ++ ;; ++ m68k) ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ ;; ++ esac ++ ;; + +-# Whether we need hard or soft links. +-LN_S=$lt_LN_S ++ beos*) ++ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ # Joseph Beckenbach says some releases of gcc ++ # support --undefined. This deserves some investigation. FIXME ++ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; + +-# A BSD-compatible nm program. +-NM=$lt_NM ++ cygwin* | mingw* | pw32*) ++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, ++ # as there is no search path for DLLs. ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ _LT_TAGVAR(always_export_symbols, $1)=no ++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + +-# A symbol stripping program +-STRIP=$lt_STRIP ++ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ # If the export-symbols file already is a .def file (1st line ++ # is EXPORTS), use it as is; otherwise, prepend... ++ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ cp $export_symbols $output_objdir/$soname.def; ++ else ++ echo EXPORTS > $output_objdir/$soname.def; ++ cat $export_symbols >> $output_objdir/$soname.def; ++ fi~ ++ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; + +-# Used to examine libraries when file_magic_cmd begins "file" +-MAGIC_CMD=$MAGIC_CMD ++ interix[[3-9]]*) ++ _LT_TAGVAR(hardcode_direct, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. ++ # Instead, shared libraries are loaded at an image base (0x10000000 by ++ # default) and relocated if they conflict, which is a slow very memory ++ # consuming and fragmenting process. To avoid this, we pick a random, ++ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link ++ # time. Moving up from 0x10000000 also allows more sbrk(2) space. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ ;; + +-# Used on cygwin: DLL creation program. +-DLLTOOL="$DLLTOOL" ++ gnu* | linux* | tpf* | k*bsd*-gnu) ++ tmp_diet=no ++ if test "$host_os" = linux-dietlibc; then ++ case $cc_basename in ++ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) ++ esac ++ fi ++ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ ++ && test "$tmp_diet" = no ++ then ++ tmp_addflag= ++ tmp_sharedflag='-shared' ++ case $cc_basename,$host_cpu in ++ pgcc*) # Portland Group C compiler ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ++ tmp_addflag=' $pic_flag' ++ ;; ++ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ++ tmp_addflag=' $pic_flag -Mnomain' ;; ++ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 ++ tmp_addflag=' -i_dynamic' ;; ++ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 ++ tmp_addflag=' -i_dynamic -nofor_main' ;; ++ ifc* | ifort*) # Intel Fortran compiler ++ tmp_addflag=' -nofor_main' ;; ++ xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) ++ tmp_sharedflag='-qmkshrobj' ++ tmp_addflag= ;; ++ esac ++ case `$CC -V 2>&1 | sed 5q` in ++ *Sun\ C*) # Sun C 5.9 ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ++ _LT_TAGVAR(compiler_needs_object, $1)=yes ++ tmp_sharedflag='-G' ;; ++ *Sun\ F*) # Sun Fortran 8.3 ++ tmp_sharedflag='-G' ;; ++ esac ++ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + +-# Used on cygwin: object dumper. +-OBJDUMP="$OBJDUMP" ++ if test "x$supports_anon_versioning" = xyes; then ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ ++ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ ++ echo "local: *; };" >> $output_objdir/$libname.ver~ ++ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' ++ fi + +-# Used on cygwin: assembler. +-AS="$AS" ++ case $cc_basename in ++ xlf*) ++ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= ++ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' ++ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' ++ if test "x$supports_anon_versioning" = xyes; then ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ ++ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ ++ echo "local: *; };" >> $output_objdir/$libname.ver~ ++ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' ++ fi ++ ;; ++ esac ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; + +-# The name of the directory that contains temporary libtool files. +-objdir=$objdir ++ netbsd*) ++ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' ++ wlarc= ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ fi ++ ;; + +-# How to create reloadable object files. +-reload_flag=$lt_reload_flag +-reload_cmds=$lt_reload_cmds ++ solaris*) ++ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ cat <<_LT_EOF 1>&2 + +-# How to pass a linker flag through the compiler. +-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) ++*** Warning: The releases 2.8.* of the GNU linker cannot reliably ++*** create shared libraries on Solaris systems. Therefore, libtool ++*** is disabling shared libraries support. We urge you to upgrade GNU ++*** binutils to release 2.9.1 or newer. Another option is to modify ++*** your PATH or compiler configuration so that the native linker is ++*** used, and then restart. + +-# Object file suffix (normally "o"). +-objext="$ac_objext" ++_LT_EOF ++ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; + +-# Old archive suffix (normally "a"). +-libext="$libext" ++ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) ++ case `$LD -v 2>&1` in ++ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ cat <<_LT_EOF 1>&2 + +-# Shared library suffix (normally ".so"). +-shrext_cmds='$shrext_cmds' ++*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not ++*** reliably create shared libraries on SCO systems. Therefore, libtool ++*** is disabling shared libraries support. We urge you to upgrade GNU ++*** binutils to release 2.16.91.0.3 or newer. Another option is to modify ++*** your PATH or compiler configuration so that the native linker is ++*** used, and then restart. + +-# Executable file suffix (normally ""). +-exeext="$exeext" ++_LT_EOF ++ ;; ++ *) ++ # For security reasons, it is highly recommended that you always ++ # use absolute paths for naming shared libraries, and exclude the ++ # DT_RUNPATH tag from executables and libraries. But doing so ++ # requires that you compile everything twice, which is a pain. ++ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; ++ esac ++ ;; + +-# Additional compiler flags for building library objects. +-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +-pic_mode=$pic_mode ++ sunos4*) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' ++ wlarc= ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# What is the maximum length of a command? +-max_cmd_len=$lt_cv_sys_max_cmd_len ++ *) ++ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; ++ esac + +-# Does compiler simultaneously support -c and -o options? +-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) ++ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then ++ runpath_var= ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)= ++ _LT_TAGVAR(whole_archive_flag_spec, $1)= ++ fi ++ else ++ # PORTME fill in a description of your system's linker (not GNU ld) ++ case $host_os in ++ aix3*) ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ _LT_TAGVAR(always_export_symbols, $1)=yes ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' ++ # Note: this linker hardcodes the directories in LIBPATH if there ++ # are no directories specified by -L. ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then ++ # Neither direct hardcoding nor static linking is supported with a ++ # broken collect2. ++ _LT_TAGVAR(hardcode_direct, $1)=unsupported ++ fi ++ ;; + +-# Must we lock files when doing compilation? +-need_locks=$lt_need_locks ++ aix[[4-9]]*) ++ if test "$host_cpu" = ia64; then ++ # On IA64, the linker does run time linking by default, so we don't ++ # have to do anything special. ++ aix_use_runtimelinking=no ++ exp_sym_flag='-Bexport' ++ no_entry_flag="" ++ else ++ # If we're using GNU nm, then we don't want the "-C" option. ++ # -C means demangle to AIX nm, but means don't demangle with GNU nm ++ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' ++ else ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' ++ fi ++ aix_use_runtimelinking=no + +-# Do we need the lib prefix for modules? +-need_lib_prefix=$need_lib_prefix ++ # Test if we are trying to use run time linking or normal ++ # AIX style linking. If -brtl is somewhere in LDFLAGS, we ++ # need to do runtime linking. ++ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) ++ for ld_flag in $LDFLAGS; do ++ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then ++ aix_use_runtimelinking=yes ++ break ++ fi ++ done ++ ;; ++ esac + +-# Do we need a version for libraries? +-need_version=$need_version ++ exp_sym_flag='-bexport' ++ no_entry_flag='-bnoentry' ++ fi + +-# Whether dlopen is supported. +-dlopen_support=$enable_dlopen ++ # When large executables or shared objects are built, AIX ld can ++ # have problems creating the table of contents. If linking a library ++ # or program results in "error TOC overflow" add -mminimal-toc to ++ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not ++ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + +-# Whether dlopen of programs is supported. +-dlopen_self=$enable_dlopen_self ++ _LT_TAGVAR(archive_cmds, $1)='' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=':' ++ _LT_TAGVAR(link_all_deplibs, $1)=yes ++ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + +-# Whether dlopen of statically linked programs is supported. +-dlopen_self_static=$enable_dlopen_self_static ++ if test "$GCC" = yes; then ++ case $host_os in aix4.[[012]]|aix4.[[012]].*) ++ # We only want to do this on AIX 4.2 and lower, the check ++ # below for broken collect2 doesn't work under 4.3+ ++ collect2name=`${CC} -print-prog-name=collect2` ++ if test -f "$collect2name" && ++ strings "$collect2name" | $GREP resolve_lib_name >/dev/null ++ then ++ # We have reworked collect2 ++ : ++ else ++ # We have old collect2 ++ _LT_TAGVAR(hardcode_direct, $1)=unsupported ++ # It fails to find uninstalled libraries when the uninstalled ++ # path is not listed in the libpath. Setting hardcode_minus_L ++ # to unsupported forces relinking ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)= ++ fi ++ ;; ++ esac ++ shared_flag='-shared' ++ if test "$aix_use_runtimelinking" = yes; then ++ shared_flag="$shared_flag "'${wl}-G' ++ fi ++ else ++ # not using gcc ++ if test "$host_cpu" = ia64; then ++ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release ++ # chokes on -Wl,-G. The following line is correct: ++ shared_flag='-G' ++ else ++ if test "$aix_use_runtimelinking" = yes; then ++ shared_flag='${wl}-G' ++ else ++ shared_flag='${wl}-bM:SRE' ++ fi ++ fi ++ fi + +-# Compiler flag to prevent dynamic linking. +-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) ++ # It seems that -bexpall does not export symbols beginning with ++ # underscore (_), so it is better to generate a list of symbols to export. ++ _LT_TAGVAR(always_export_symbols, $1)=yes ++ if test "$aix_use_runtimelinking" = yes; then ++ # Warning - without using the other runtime loading flags (-brtl), ++ # -berok will link without error, but may produce a broken library. ++ _LT_TAGVAR(allow_undefined_flag, $1)='-berok' ++ # Determine the default libpath from the value encoded in an ++ # empty executable. ++ _LT_SYS_MODULE_PATH_AIX ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" ++ else ++ if test "$host_cpu" = ia64; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' ++ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" ++ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" ++ else ++ # Determine the default libpath from the value encoded in an ++ # empty executable. ++ _LT_SYS_MODULE_PATH_AIX ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" ++ # Warning - without using the other run time loading flags, ++ # -berok will link without error, but may produce a broken library. ++ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' ++ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' ++ # Exported symbols can be pulled into shared objects from archives ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes ++ # This is similar to how AIX traditionally builds its shared libraries. ++ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' ++ fi ++ fi ++ ;; + +-# Compiler flag to turn off builtin functions. +-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) ++ amigaos*) ++ case $host_cpu in ++ powerpc) ++ # see comment about AmigaOS4 .so support ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='' ++ ;; ++ m68k) ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ ;; ++ esac ++ ;; + +-# Compiler flag to allow reflexive dlopens. +-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) ++ bsdi[[45]]*) ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ++ ;; + +-# Compiler flag to generate shared objects directly from archives. +-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) ++ cygwin* | mingw* | pw32*) ++ # When not using gcc, we currently assume that we are using ++ # Microsoft Visual C++. ++ # hardcode_libdir_flag_spec is actually meaningless, as there is ++ # no search path for DLLs. ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' ++ # The linker will automatically build a .lib file if we build a DLL. ++ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' ++ # FIXME: Should let the user specify the lib program. ++ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' ++ _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' ++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ++ ;; + +-# Compiler flag to generate thread-safe objects. +-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) ++ darwin* | rhapsody*) ++ _LT_DARWIN_LINKER_FEATURES($1) ++ ;; + +-# Library versioning type. +-version_type=$version_type ++ dgux*) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# Format of library name prefix. +-libname_spec=$lt_libname_spec ++ freebsd1*) ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; + +-# List of archive names. First name is the real one, the rest are links. +-# The last name is the one that the linker finds with -lNAME. +-library_names_spec=$lt_library_names_spec ++ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor ++ # support. Future versions do this automatically, but an explicit c++rt0.o ++ # does not break anything, and helps significantly (at the cost of a little ++ # extra space). ++ freebsd2.2*) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# The coded name of the library, if different from the real name. +-soname_spec=$lt_soname_spec ++ # Unfortunately, older versions of FreeBSD 2 do not have this feature. ++ freebsd2*) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# Commands used to build and install an old-style archive. +-RANLIB=$lt_RANLIB +-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +-old_postinstall_cmds=$lt_old_postinstall_cmds +-old_postuninstall_cmds=$lt_old_postuninstall_cmds ++ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. ++ freebsd* | dragonfly*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# Create an old-style archive from a shared archive. +-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) ++ hpux9*) ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ fi ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ _LT_TAGVAR(hardcode_direct, $1)=yes + +-# Create a temporary old-style archive to link instead of a shared archive. +-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) ++ # hardcode_minus_L: Not really in the search PATH, ++ # but as the default location of the library. ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ ;; + +-# Commands used to build and install a shared archive. +-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +-postinstall_cmds=$lt_postinstall_cmds +-postuninstall_cmds=$lt_postuninstall_cmds ++ hpux10*) ++ if test "$GCC" = yes -a "$with_gnu_ld" = no; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ++ fi ++ if test "$with_gnu_ld" = no; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ # hardcode_minus_L: Not really in the search PATH, ++ # but as the default location of the library. ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ fi ++ ;; + +-# Commands used to build a loadable module (assumed same as above if empty) +-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) ++ hpux11*) ++ if test "$GCC" = yes -a "$with_gnu_ld" = no; then ++ case $host_cpu in ++ hppa*64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ ia64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ esac ++ else ++ case $host_cpu in ++ hppa*64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ ia64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ esac ++ fi ++ if test "$with_gnu_ld" = no; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: + +-# Commands to strip libraries. +-old_striplib=$lt_old_striplib +-striplib=$lt_striplib ++ case $host_cpu in ++ hppa*64*|ia64*) ++ _LT_TAGVAR(hardcode_direct, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; ++ *) ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + +-# Dependencies to place before the objects being linked to create a +-# shared library. +-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) ++ # hardcode_minus_L: Not really in the search PATH, ++ # but as the default location of the library. ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ ;; ++ esac ++ fi ++ ;; + +-# Dependencies to place after the objects being linked to create a +-# shared library. +-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) ++ irix5* | irix6* | nonstopux*) ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ # Try to use the -exported_symbol ld option, if it does not ++ # work, assume that -exports_file does not work either and ++ # implicitly export all symbols. ++ save_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" ++ AC_LINK_IFELSE(int foo(void) {}, ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ++ ) ++ LDFLAGS="$save_LDFLAGS" ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' ++ fi ++ _LT_TAGVAR(archive_cmds_need_lc, $1)='no' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ _LT_TAGVAR(inherit_rpath, $1)=yes ++ _LT_TAGVAR(link_all_deplibs, $1)=yes ++ ;; + +-# Dependencies to place before the objects being linked to create a +-# shared library. +-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) ++ netbsd*) ++ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF ++ fi ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# Dependencies to place after the objects being linked to create a +-# shared library. +-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) ++ newsos6) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# The library search path used internally by the compiler when linking +-# a shared library. +-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) ++ *nto* | *qnx*) ++ ;; + +-# Method to check whether dependent libraries are shared objects. +-deplibs_check_method=$lt_deplibs_check_method ++ openbsd*) ++ if test -f /usr/libexec/ld.so; then ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes ++ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ else ++ case $host_os in ++ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ ;; ++ esac ++ fi ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; + +-# Command to use when deplibs_check_method == file_magic. +-file_magic_cmd=$lt_file_magic_cmd ++ os2*) ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' ++ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ++ ;; + +-# Flag that allows shared libraries with undefined symbols to be built. +-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) ++ osf3*) ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ else ++ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' ++ fi ++ _LT_TAGVAR(archive_cmds_need_lc, $1)='no' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ ;; + +-# Flag that forces no undefined symbols. +-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) ++ osf4* | osf5*) # as osf3* with the addition of -msym flag ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ else ++ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ ++ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + +-# Commands used to finish a libtool library installation in a directory. +-finish_cmds=$lt_finish_cmds ++ # Both c and cxx compiler support -rpath directly ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ++ fi ++ _LT_TAGVAR(archive_cmds_need_lc, $1)='no' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ ;; + +-# Same as above, but a single script fragment to be evaled but not shown. +-finish_eval=$lt_finish_eval ++ solaris*) ++ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' ++ if test "$GCC" = yes; then ++ wlarc='${wl}' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ else ++ case `$CC -V 2>&1` in ++ *"Compilers 5.0"*) ++ wlarc='' ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ++ ;; ++ *) ++ wlarc='${wl}' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ ;; ++ esac ++ fi ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ case $host_os in ++ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; ++ *) ++ # The compiler driver will combine and reorder linker options, ++ # but understands `-z linker_flag'. GCC discards it without `$wl', ++ # but is careful enough not to reorder. ++ # Supported since Solaris 2.6 (maybe 2.5.1?) ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ++ else ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ++ fi ++ ;; ++ esac ++ _LT_TAGVAR(link_all_deplibs, $1)=yes ++ ;; + +-# Take the output of nm and produce a listing of raw symbols and C names. +-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe ++ sunos4*) ++ if test "x$host_vendor" = xsequent; then ++ # Use $CC to link under sequent, because it throws in some extra .o ++ # files that make .init and .fini sections work. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' ++ fi ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# Transform the output of nm in a proper C declaration +-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl ++ sysv4) ++ case $host_vendor in ++ sni) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ++ ;; ++ siemens) ++ ## LD is ld it makes a PLAMLIB ++ ## CC just makes a GrossModule. ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' ++ _LT_TAGVAR(hardcode_direct, $1)=no ++ ;; ++ motorola) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ++ ;; ++ esac ++ runpath_var='LD_RUN_PATH' ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# Transform the output of nm in a C name address pair +-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address ++ sysv4.3*) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ++ ;; + +-# This is the shared library runtime path variable. +-runpath_var=$runpath_var ++ sysv4*MP*) ++ if test -d /usr/nec; then ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ runpath_var=LD_RUN_PATH ++ hardcode_runpath_var=yes ++ _LT_TAGVAR(ld_shlibs, $1)=yes ++ fi ++ ;; + +-# This is the shared library path variable. +-shlibpath_var=$shlibpath_var ++ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) ++ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ runpath_var='LD_RUN_PATH' + +-# Is shlibpath searched before the hard-coded library search path? +-shlibpath_overrides_runpath=$shlibpath_overrides_runpath ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ fi ++ ;; + +-# How to hardcode a shared library path into an executable. +-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) ++ sysv5* | sco3.2v5* | sco5v6*) ++ # Note: We can NOT use -z defs as we might desire, because we do not ++ # link with -lc, and that would cause any symbols used from libc to ++ # always be unresolved, which means just about no library would ++ # ever link correctly. If we're not using GNU ld we use -z text ++ # though, which does catch some bad symbols but isn't as heavy-handed ++ # as -z defs. ++ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' ++ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=':' ++ _LT_TAGVAR(link_all_deplibs, $1)=yes ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' ++ runpath_var='LD_RUN_PATH' + +-# Whether we should hardcode library paths into libraries. +-hardcode_into_libs=$hardcode_into_libs ++ if test "$GCC" = yes; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ fi ++ ;; + +-# Flag to hardcode \$libdir into a binary during linking. +-# This must work even if \$libdir does not exist. +-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) ++ uts4*) ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; + +-# If ld is used when linking, flag to hardcode \$libdir into +-# a binary during linking. This must work even if \$libdir does +-# not exist. +-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) ++ *) ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ esac + +-# Whether we need a single -rpath flag with a separated argument. +-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) ++ if test x$host_vendor = xsni; then ++ case $host in ++ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ++ ;; ++ esac ++ fi ++ fi ++]) ++AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) ++test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +-# resulting binary. +-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) ++_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +-# resulting binary. +-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) ++_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl ++_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl ++_LT_DECL([], [extract_expsyms_cmds], [2], ++ [The commands to extract the exported symbol list from a shared archive]) + +-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +-# the resulting binary. +-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) ++# ++# Do we need to explicitly link libc? ++# ++case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in ++x|xyes) ++ # Assume -lc should be added ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + +-# Set to yes if building a shared library automatically hardcodes DIR into the library +-# and all subsequent libraries and executables linked against it. +-hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) ++ if test "$enable_shared" = yes && test "$GCC" = yes; then ++ case $_LT_TAGVAR(archive_cmds, $1) in ++ *'~'*) ++ # FIXME: we may have to deal with multi-command sequences. ++ ;; ++ '$CC '*) ++ # Test whether the compiler implicitly links with -lc since on some ++ # systems, -lgcc has to come before -lc. If gcc already passes -lc ++ # to ld, don't add -lc before -lgcc. ++ AC_MSG_CHECKING([whether -lc should be explicitly linked in]) ++ $RM conftest* ++ echo "$lt_simple_compile_test_code" > conftest.$ac_ext + +-# Variables whose values should be saved in libtool wrapper scripts and +-# restored at relink time. +-variables_saved_for_relink="$variables_saved_for_relink" ++ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then ++ soname=conftest ++ lib=conftest ++ libobjs=conftest.$ac_objext ++ deplibs= ++ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) ++ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) ++ compiler_flags=-v ++ linker_flags=-v ++ verstring= ++ output_objdir=. ++ libname=conftest ++ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) ++ _LT_TAGVAR(allow_undefined_flag, $1)= ++ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) ++ then ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ else ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes ++ fi ++ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag ++ else ++ cat conftest.err 1>&5 ++ fi ++ $RM conftest* ++ AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ++ ;; ++ esac ++ fi ++ ;; ++esac + +-# Whether libtool must link a program against all its dependency libraries. +-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) ++_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], ++ [Whether or not to add -lc for building shared libraries]) ++_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], ++ [enable_shared_with_static_runtimes], [0], ++ [Whether or not to disallow shared libs when runtime libs are static]) ++_LT_TAGDECL([], [export_dynamic_flag_spec], [1], ++ [Compiler flag to allow reflexive dlopens]) ++_LT_TAGDECL([], [whole_archive_flag_spec], [1], ++ [Compiler flag to generate shared objects directly from archives]) ++_LT_TAGDECL([], [compiler_needs_object], [1], ++ [Whether the compiler copes with passing no objects directly]) ++_LT_TAGDECL([], [old_archive_from_new_cmds], [2], ++ [Create an old-style archive from a shared archive]) ++_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], ++ [Create a temporary old-style archive to link instead of a shared archive]) ++_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) ++_LT_TAGDECL([], [archive_expsym_cmds], [2]) ++_LT_TAGDECL([], [module_cmds], [2], ++ [Commands used to build a loadable module if different from building ++ a shared archive.]) ++_LT_TAGDECL([], [module_expsym_cmds], [2]) ++_LT_TAGDECL([], [with_gnu_ld], [1], ++ [Whether we are building with GNU ld or not]) ++_LT_TAGDECL([], [allow_undefined_flag], [1], ++ [Flag that allows shared libraries with undefined symbols to be built]) ++_LT_TAGDECL([], [no_undefined_flag], [1], ++ [Flag that enforces no undefined symbols]) ++_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], ++ [Flag to hardcode $libdir into a binary during linking. ++ This must work even if $libdir does not exist]) ++_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], ++ [[If ld is used when linking, flag to hardcode $libdir into a binary ++ during linking. This must work even if $libdir does not exist]]) ++_LT_TAGDECL([], [hardcode_libdir_separator], [1], ++ [Whether we need a single "-rpath" flag with a separated argument]) ++_LT_TAGDECL([], [hardcode_direct], [0], ++ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes ++ DIR into the resulting binary]) ++_LT_TAGDECL([], [hardcode_direct_absolute], [0], ++ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes ++ DIR into the resulting binary and the resulting library dependency is ++ "absolute", i.e impossible to change by setting ${shlibpath_var} if the ++ library is relocated]) ++_LT_TAGDECL([], [hardcode_minus_L], [0], ++ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR ++ into the resulting binary]) ++_LT_TAGDECL([], [hardcode_shlibpath_var], [0], ++ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR ++ into the resulting binary]) ++_LT_TAGDECL([], [hardcode_automatic], [0], ++ [Set to "yes" if building a shared library automatically hardcodes DIR ++ into the library and all subsequent libraries and executables linked ++ against it]) ++_LT_TAGDECL([], [inherit_rpath], [0], ++ [Set to yes if linker adds runtime paths of dependent libraries ++ to runtime path list]) ++_LT_TAGDECL([], [link_all_deplibs], [0], ++ [Whether libtool must link a program against all its dependency libraries]) ++_LT_TAGDECL([], [fix_srcfile_path], [1], ++ [Fix the shell variable $srcfile for the compiler]) ++_LT_TAGDECL([], [always_export_symbols], [0], ++ [Set to "yes" if exported symbols are required]) ++_LT_TAGDECL([], [export_symbols_cmds], [2], ++ [The commands to list exported symbols]) ++_LT_TAGDECL([], [exclude_expsyms], [1], ++ [Symbols that should not be listed in the preloaded symbols]) ++_LT_TAGDECL([], [include_expsyms], [1], ++ [Symbols that must always be exported]) ++_LT_TAGDECL([], [prelink_cmds], [2], ++ [Commands necessary for linking programs (against libraries) with templates]) ++_LT_TAGDECL([], [file_list_spec], [1], ++ [Specify filename containing input files]) ++dnl FIXME: Not yet implemented ++dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], ++dnl [Compiler flag to generate thread safe objects]) ++])# _LT_LINKER_SHLIBS + +-# Compile-time system search path for libraries +-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +-# Run-time system search path for libraries +-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec ++# _LT_LANG_C_CONFIG([TAG]) ++# ------------------------ ++# Ensure that the configuration variables for a C compiler are suitably ++# defined. These variables are subsequently used by _LT_CONFIG to write ++# the compiler configuration to `libtool'. ++m4_defun([_LT_LANG_C_CONFIG], ++[m4_require([_LT_DECL_EGREP])dnl ++lt_save_CC="$CC" ++AC_LANG_PUSH(C) + +-# Fix the shell variable \$srcfile for the compiler. +-fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" ++# Source file extension for C test sources. ++ac_ext=c + +-# Set to yes if exported symbols are required. +-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) ++# Object file extension for compiled C test sources. ++objext=o ++_LT_TAGVAR(objext, $1)=$objext + +-# The commands to list exported symbols. +-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) ++# Code to be used in simple compile tests ++lt_simple_compile_test_code="int some_variable = 0;" + +-# The commands to extract the exported symbol list from a shared archive. +-extract_expsyms_cmds=$lt_extract_expsyms_cmds ++# Code to be used in simple link tests ++lt_simple_link_test_code='int main(){return(0);}' + +-# Symbols that should not be listed in the preloaded symbols. +-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) ++_LT_TAG_COMPILER ++# Save the default compiler, since it gets overwritten when the other ++# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. ++compiler_DEFAULT=$CC + +-# Symbols that must always be exported. +-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ++# save warnings/boilerplate of simple test code ++_LT_COMPILER_BOILERPLATE ++_LT_LINKER_BOILERPLATE + +-ifelse([$1],[], +-[# ### END LIBTOOL CONFIG], +-[# ### END LIBTOOL TAG CONFIG: $tagname]) ++## CAVEAT EMPTOR: ++## There is no encapsulation within the following macros, do not change ++## the running order or otherwise move them around unless you know exactly ++## what you are doing... ++if test -n "$compiler"; then ++ _LT_COMPILER_NO_RTTI($1) ++ _LT_COMPILER_PIC($1) ++ _LT_COMPILER_C_O($1) ++ _LT_COMPILER_FILE_LOCKS($1) ++ _LT_LINKER_SHLIBS($1) ++ _LT_SYS_DYNAMIC_LINKER($1) ++ _LT_LINKER_HARDCODE_LIBPATH($1) ++ LT_SYS_DLOPEN_SELF ++ _LT_CMD_STRIPLIB ++ ++ # Report which library types will actually be built ++ AC_MSG_CHECKING([if libtool supports shared libraries]) ++ AC_MSG_RESULT([$can_build_shared]) + +-__EOF__ ++ AC_MSG_CHECKING([whether to build shared libraries]) ++ test "$can_build_shared" = "no" && enable_shared=no + +-ifelse([$1],[], [ ++ # On AIX, shared libraries and static libraries use the same namespace, and ++ # are all built from PIC. + case $host_os in + aix3*) +- cat <<\EOF >> "$cfgfile" ++ test "$enable_shared" = yes && enable_static=no ++ if test -n "$RANLIB"; then ++ archive_cmds="$archive_cmds~\$RANLIB \$lib" ++ postinstall_cmds='$RANLIB $lib' ++ fi ++ ;; + +-# AIX sometimes has problems with the GCC collect2 program. For some +-# reason, if we set the COLLECT_NAMES environment variable, the problems +-# vanish in a puff of smoke. +-if test "X${COLLECT_NAMES+set}" != Xset; then +- COLLECT_NAMES= +- export COLLECT_NAMES +-fi +-EOF ++ aix[[4-9]]*) ++ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then ++ test "$enable_shared" = yes && enable_static=no ++ fi + ;; + esac ++ AC_MSG_RESULT([$enable_shared]) + +- # We use sed instead of cat because bash on DJGPP gets confused if +- # if finds mixed CR/LF and LF-only lines. Since sed operates in +- # text mode, it properly converts lines to CR/LF. This bash problem +- # is reportedly fixed, but why not run on old versions too? +- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) ++ AC_MSG_CHECKING([whether to build static libraries]) ++ # Make sure either enable_shared or enable_static is yes. ++ test "$enable_shared" = yes || enable_static=yes ++ AC_MSG_RESULT([$enable_static]) + +- mv -f "$cfgfile" "$ofile" || \ +- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") +- chmod +x "$ofile" +-]) +-else +- # If there is no Makefile yet, we rely on a make rule to execute +- # `config.status --recheck' to rerun these tests and create the +- # libtool script then. +- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` +- if test -f "$ltmain_in"; then +- test -f Makefile && make "$ltmain" +- fi ++ _LT_CONFIG($1) + fi +-])# AC_LIBTOOL_CONFIG +- +- +-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +-# ------------------------------------------- +-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +- +-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= ++AC_LANG_POP ++CC="$lt_save_CC" ++])# _LT_LANG_C_CONFIG + +-if test "$GCC" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + +- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], +- lt_cv_prog_compiler_rtti_exceptions, +- [-fno-rtti -fno-exceptions], [], +- [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) ++# _LT_PROG_CXX ++# ------------ ++# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ ++# compiler, we have our own version here. ++m4_defun([_LT_PROG_CXX], ++[ ++pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) ++AC_PROG_CXX ++if test -n "$CXX" && ( test "X$CXX" != "Xno" && ++ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || ++ (test "X$CXX" != "Xg++"))) ; then ++ AC_PROG_CXXCPP ++else ++ _lt_caught_CXX_error=yes + fi +-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI ++popdef([AC_MSG_ERROR]) ++])# _LT_PROG_CXX + ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([_LT_PROG_CXX], []) + +-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +-# --------------------------------- +-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +-[AC_REQUIRE([AC_CANONICAL_HOST]) +-AC_REQUIRE([AC_PROG_NM]) +-AC_REQUIRE([AC_OBJEXT]) +-# Check for command to grab the raw symbol name followed by C symbol from nm. +-AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +-[ +-# These are sane defaults that work on at least a few old systems. +-# [They come from Ultrix. What could be older than Ultrix?!! ;)] +- +-# Character class describing NM global symbol codes. +-symcode='[[BCDEGRST]]' + +-# Regexp to match symbols that can be accessed directly from C. +-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' ++# _LT_LANG_CXX_CONFIG([TAG]) ++# -------------------------- ++# Ensure that the configuration variables for a C++ compiler are suitably ++# defined. These variables are subsequently used by _LT_CONFIG to write ++# the compiler configuration to `libtool'. ++m4_defun([_LT_LANG_CXX_CONFIG], ++[AC_REQUIRE([_LT_PROG_CXX])dnl ++m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++m4_require([_LT_DECL_EGREP])dnl ++ ++AC_LANG_PUSH(C++) ++_LT_TAGVAR(archive_cmds_need_lc, $1)=no ++_LT_TAGVAR(allow_undefined_flag, $1)= ++_LT_TAGVAR(always_export_symbols, $1)=no ++_LT_TAGVAR(archive_expsym_cmds, $1)= ++_LT_TAGVAR(compiler_needs_object, $1)=no ++_LT_TAGVAR(export_dynamic_flag_spec, $1)= ++_LT_TAGVAR(hardcode_direct, $1)=no ++_LT_TAGVAR(hardcode_direct_absolute, $1)=no ++_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= ++_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= ++_LT_TAGVAR(hardcode_libdir_separator, $1)= ++_LT_TAGVAR(hardcode_minus_L, $1)=no ++_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported ++_LT_TAGVAR(hardcode_automatic, $1)=no ++_LT_TAGVAR(inherit_rpath, $1)=no ++_LT_TAGVAR(module_cmds, $1)= ++_LT_TAGVAR(module_expsym_cmds, $1)= ++_LT_TAGVAR(link_all_deplibs, $1)=unknown ++_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ++_LT_TAGVAR(no_undefined_flag, $1)= ++_LT_TAGVAR(whole_archive_flag_spec, $1)= ++_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +-# Transform an extracted symbol line into a proper C declaration +-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" ++# Source file extension for C++ test sources. ++ac_ext=cpp + +-# Transform an extracted symbol line into symbol name and symbol address +-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ++# Object file extension for compiled C++ test sources. ++objext=o ++_LT_TAGVAR(objext, $1)=$objext + +-# Define system-specific variables. +-case $host_os in +-aix*) +- symcode='[[BCDT]]' +- ;; +-cygwin* | mingw* | pw32*) +- symcode='[[ABCDGISTW]]' +- ;; +-hpux*) # Its linker distinguishes data from code symbols +- if test "$host_cpu" = ia64; then +- symcode='[[ABCDEGRST]]' ++# No sense in running all these tests if we already determined that ++# the CXX compiler isn't working. Some variables (like enable_shared) ++# are currently assumed to apply to all compilers on this platform, ++# and will be corrupted by setting them based on a non-working compiler. ++if test "$_lt_caught_CXX_error" != yes; then ++ # Code to be used in simple compile tests ++ lt_simple_compile_test_code="int some_variable = 0;" ++ ++ # Code to be used in simple link tests ++ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' ++ ++ # ltmain only uses $CC for tagged configurations so make sure $CC is set. ++ _LT_TAG_COMPILER ++ ++ # save warnings/boilerplate of simple test code ++ _LT_COMPILER_BOILERPLATE ++ _LT_LINKER_BOILERPLATE ++ ++ # Allow CC to be a program name with arguments. ++ lt_save_CC=$CC ++ lt_save_LD=$LD ++ lt_save_GCC=$GCC ++ GCC=$GXX ++ lt_save_with_gnu_ld=$with_gnu_ld ++ lt_save_path_LD=$lt_cv_path_LD ++ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then ++ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx ++ else ++ $as_unset lt_cv_prog_gnu_ld + fi +- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" +- ;; +-linux*) +- if test "$host_cpu" = ia64; then +- symcode='[[ABCDGIRSTW]]' +- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ++ if test -n "${lt_cv_path_LDCXX+set}"; then ++ lt_cv_path_LD=$lt_cv_path_LDCXX ++ else ++ $as_unset lt_cv_path_LD + fi +- ;; +-irix* | nonstopux*) +- symcode='[[BCDEGRST]]' +- ;; +-osf*) +- symcode='[[BCDEGQRST]]' +- ;; +-solaris*) +- symcode='[[BDRT]]' +- ;; +-sco3.2v5*) +- symcode='[[DT]]' +- ;; +-sysv4.2uw2*) +- symcode='[[DT]]' +- ;; +-sysv5* | sco5v6* | unixware* | OpenUNIX*) +- symcode='[[ABDT]]' +- ;; +-sysv4) +- symcode='[[DFNSTU]]' +- ;; +-esac +- +-# Handle CRLF in mingw tool chain +-opt_cr= +-case $build_os in +-mingw*) +- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp +- ;; +-esac +- +-# If we're using GNU nm, then use its standard symbol codes. +-case `$NM -V 2>&1` in +-*GNU* | *'with BFD'*) +- symcode='[[ABCDGIRSTW]]' ;; +-esac +- +-# Try without a prefix undercore, then with it. +-for ac_symprfx in "" "_"; do +- +- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. +- symxfrm="\\1 $ac_symprfx\\2 \\2" +- +- # Write the raw and C identifiers. +- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" +- +- # Check to see that the pipe works correctly. +- pipe_works=no +- +- rm -f conftest* +- cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then +- # Try sorting and uniquifying the output. +- if sort "$nlist" | uniq > "$nlist"T; then +- mv -f "$nlist"T "$nlist" +- else +- rm -f "$nlist"T +- fi +- +- # Make sure that we snagged all the symbols we need. +- if grep ' nm_test_var$' "$nlist" >/dev/null; then +- if grep ' nm_test_func$' "$nlist" >/dev/null; then +- cat < conftest.$ac_ext +-#ifdef __cplusplus +-extern "C" { +-#endif +- +-EOF +- # Now generate the symbol file. +- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' +- +- cat <> conftest.$ac_ext +-#if defined (__STDC__) && __STDC__ +-# define lt_ptr_t void * +-#else +-# define lt_ptr_t char * +-# define const +-#endif +- +-/* The mapping between symbol names and symbols. */ +-const struct { +- const char *name; +- lt_ptr_t address; +-} +-lt_preloaded_symbols[[]] = +-{ +-EOF +- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext +- cat <<\EOF >> conftest.$ac_ext +- {0, (lt_ptr_t) 0} +-}; ++ test -z "${LDCXX+set}" || LD=$LDCXX ++ CC=${CXX-"c++"} ++ compiler=$CC ++ _LT_TAGVAR(compiler, $1)=$CC ++ _LT_CC_BASENAME([$compiler]) + +-#ifdef __cplusplus +-} +-#endif +-EOF +- # Now try linking the two files. +- mv conftest.$ac_objext conftstm.$ac_objext +- lt_save_LIBS="$LIBS" +- lt_save_CFLAGS="$CFLAGS" +- LIBS="conftstm.$ac_objext" +- CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" +- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then +- pipe_works=yes +- fi +- LIBS="$lt_save_LIBS" +- CFLAGS="$lt_save_CFLAGS" +- else +- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD +- fi +- else +- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD +- fi ++ if test -n "$compiler"; then ++ # We don't want -fno-exception when compiling C++ code, so set the ++ # no_builtin_flag separately ++ if test "$GXX" = yes; then ++ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else +- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD ++ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi +- else +- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD +- cat conftest.$ac_ext >&5 +- fi +- rm -f conftest* conftst* +- +- # Do not use the global_symbol_pipe unless it works. +- if test "$pipe_works" = yes; then +- break +- else +- lt_cv_sys_global_symbol_pipe= +- fi +-done +-]) +-if test -z "$lt_cv_sys_global_symbol_pipe"; then +- lt_cv_sys_global_symbol_to_cdecl= +-fi +-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then +- AC_MSG_RESULT(failed) +-else +- AC_MSG_RESULT(ok) +-fi +-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + ++ if test "$GXX" = yes; then ++ # Set up default GNU C++ configuration + +-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +-# --------------------------------------- +-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= ++ LT_PATH_LD + +-AC_MSG_CHECKING([for $compiler option to produce PIC]) +- ifelse([$1],[CXX],[ +- # C++ specific cases for pic, static, wl, etc. +- if test "$GXX" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ++ # Check if GNU C++ uses GNU ld as the underlying linker, since the ++ # archiving commands below assume that GNU ld is being used. ++ if test "$with_gnu_ld" = yes; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ ++ # If archive_cmds runs LD, not CC, wlarc should be empty ++ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to ++ # investigate it a little bit more. (MM) ++ wlarc='${wl}' ++ ++ # ancient GNU ld didn't support --whole-archive et. al. ++ if eval "`$CC -print-prog-name=ld` --help 2>&1" | ++ $GREP 'no-whole-archive' > /dev/null; then ++ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' ++ else ++ _LT_TAGVAR(whole_archive_flag_spec, $1)= ++ fi ++ else ++ with_gnu_ld=no ++ wlarc= + +- case $host_os in +- aix*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; +- amigaos*) +- # FIXME: we need at least 68020 code to build shared libraries, but +- # adding the `-m68020' flag to GCC prevents building anything better, +- # like `-m68040'. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' +- ;; +- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) +- # PIC is the default for these OSes. +- ;; +- mingw* | cygwin* | os2* | pw32*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- # Although the cygwin gcc ignores -fPIC, still need this for old-style +- # (--disable-auto-import) libraries +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' +- ;; +- darwin* | rhapsody*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' +- ;; +- *djgpp*) +- # DJGPP does not support shared libraries at all +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- ;; +- interix3*) +- # Interix 3.x gcc -fpic/-fPIC options generate broken code. +- # Instead, we relocate shared libraries at runtime. +- ;; +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic ++ # A generic and very simple default shared library creation ++ # command for GNU C++ for the case where it uses the native ++ # linker, instead of GNU ld. If possible, this setting should ++ # overridden to take advantage of the native linker features on ++ # the platform it is being used on. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi +- ;; +- hpux*) +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- else ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' ++ ++ else ++ GXX=no ++ with_gnu_ld=no ++ wlarc= ++ fi ++ ++ # PORTME: fill in a description of your system's C++ link characteristics ++ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ++ _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in +- aix4* | aix5*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ aix3*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ aix[[4-9]]*) ++ if test "$host_cpu" = ia64; then ++ # On IA64, the linker does run time linking by default, so we don't ++ # have to do anything special. ++ aix_use_runtimelinking=no ++ exp_sym_flag='-Bexport' ++ no_entry_flag="" ++ else ++ aix_use_runtimelinking=no ++ ++ # Test if we are trying to use run time linking or normal ++ # AIX style linking. If -brtl is somewhere in LDFLAGS, we ++ # need to do runtime linking. ++ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) ++ for ld_flag in $LDFLAGS; do ++ case $ld_flag in ++ *-brtl*) ++ aix_use_runtimelinking=yes ++ break ++ ;; ++ esac ++ done ++ ;; ++ esac ++ ++ exp_sym_flag='-bexport' ++ no_entry_flag='-bnoentry' ++ fi ++ ++ # When large executables or shared objects are built, AIX ld can ++ # have problems creating the table of contents. If linking a library ++ # or program results in "error TOC overflow" add -mminimal-toc to ++ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not ++ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. ++ ++ _LT_TAGVAR(archive_cmds, $1)='' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=':' ++ _LT_TAGVAR(link_all_deplibs, $1)=yes ++ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' ++ ++ if test "$GXX" = yes; then ++ case $host_os in aix4.[[012]]|aix4.[[012]].*) ++ # We only want to do this on AIX 4.2 and lower, the check ++ # below for broken collect2 doesn't work under 4.3+ ++ collect2name=`${CC} -print-prog-name=collect2` ++ if test -f "$collect2name" && ++ strings "$collect2name" | $GREP resolve_lib_name >/dev/null ++ then ++ # We have reworked collect2 ++ : ++ else ++ # We have old collect2 ++ _LT_TAGVAR(hardcode_direct, $1)=unsupported ++ # It fails to find uninstalled libraries when the uninstalled ++ # path is not listed in the libpath. Setting hardcode_minus_L ++ # to unsupported forces relinking ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)= ++ fi ++ esac ++ shared_flag='-shared' ++ if test "$aix_use_runtimelinking" = yes; then ++ shared_flag="$shared_flag "'${wl}-G' ++ fi ++ else ++ # not using gcc ++ if test "$host_cpu" = ia64; then ++ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release ++ # chokes on -Wl,-G. The following line is correct: ++ shared_flag='-G' ++ else ++ if test "$aix_use_runtimelinking" = yes; then ++ shared_flag='${wl}-G' ++ else ++ shared_flag='${wl}-bM:SRE' ++ fi ++ fi ++ fi ++ ++ # It seems that -bexpall does not export symbols beginning with ++ # underscore (_), so it is better to generate a list of symbols to ++ # export. ++ _LT_TAGVAR(always_export_symbols, $1)=yes ++ if test "$aix_use_runtimelinking" = yes; then ++ # Warning - without using the other runtime loading flags (-brtl), ++ # -berok will link without error, but may produce a broken library. ++ _LT_TAGVAR(allow_undefined_flag, $1)='-berok' ++ # Determine the default libpath from the value encoded in an empty ++ # executable. ++ _LT_SYS_MODULE_PATH_AIX ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" ++ ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" ++ else ++ if test "$host_cpu" = ia64; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' ++ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" ++ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" ++ else ++ # Determine the default libpath from the value encoded in an ++ # empty executable. ++ _LT_SYS_MODULE_PATH_AIX ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" ++ # Warning - without using the other run time loading flags, ++ # -berok will link without error, but may produce a broken library. ++ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' ++ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' ++ # Exported symbols can be pulled into shared objects from archives ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes ++ # This is similar to how AIX traditionally builds its shared ++ # libraries. ++ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' ++ fi ++ fi ++ ;; ++ ++ beos*) ++ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ # Joseph Beckenbach says some releases of gcc ++ # support --undefined. This deserves some investigation. FIXME ++ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' ++ _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; ++ + chorus*) +- case $cc_basename in +- cxch68*) +- # Green Hills C++ Compiler +- # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ++ case $cc_basename in ++ *) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no + ;; +- esac ++ esac ++ ;; ++ ++ cygwin* | mingw* | pw32*) ++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, ++ # as there is no search path for DLLs. ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ _LT_TAGVAR(always_export_symbols, $1)=no ++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ++ ++ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ # If the export-symbols file already is a .def file (1st line ++ # is EXPORTS), use it as is; otherwise, prepend... ++ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ cp $export_symbols $output_objdir/$soname.def; ++ else ++ echo EXPORTS > $output_objdir/$soname.def; ++ cat $export_symbols >> $output_objdir/$soname.def; ++ fi~ ++ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; ++ darwin* | rhapsody*) ++ _LT_DARWIN_LINKER_FEATURES($1) + ;; +- darwin*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- case $cc_basename in +- xlc*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- ;; +- esac +- ;; ++ + dgux*) +- case $cc_basename in +- ec++*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ case $cc_basename in ++ ec++*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no + ;; +- ghcx*) ++ ghcx*) + # Green Hills C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no + ;; +- *) ++ *) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no + ;; +- esac +- ;; +- freebsd* | kfreebsd*-gnu | dragonfly*) +- # FreeBSD uses GNU C++ +- ;; +- hpux9* | hpux10* | hpux11*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' +- if test "$host_cpu" != ia64; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- fi ++ esac ++ ;; ++ ++ freebsd[[12]]*) ++ # C++ shared libraries reported to be fairly broken before ++ # switch to ELF ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ ++ freebsd-elf*) ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ ;; ++ ++ freebsd* | dragonfly*) ++ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF ++ # conventions ++ _LT_TAGVAR(ld_shlibs, $1)=yes ++ ;; ++ ++ gnu*) ++ ;; ++ ++ hpux9*) ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, ++ # but as the default ++ # location of the library. ++ ++ case $cc_basename in ++ CC*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ aCC*) ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ++ ;; ++ *) ++ if test "$GXX" = yes; then ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ else ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; ++ esac ++ ;; ++ ++ hpux10*|hpux11*) ++ if test $with_gnu_ld = no; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ ++ case $host_cpu in ++ hppa*64*|ia64*) ++ ;; ++ *) ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ ;; ++ esac ++ fi ++ case $host_cpu in ++ hppa*64*|ia64*) ++ _LT_TAGVAR(hardcode_direct, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ ;; ++ *) ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes ++ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, ++ # but as the default ++ # location of the library. ++ ;; ++ esac ++ ++ case $cc_basename in ++ CC*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no + ;; +- aCC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ++ aCC*) + case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- ;; ++ hppa*64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ ia64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; + esac ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; +- *) ++ *) ++ if test "$GXX" = yes; then ++ if test $with_gnu_ld = no; then ++ case $host_cpu in ++ hppa*64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ ia64*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ esac ++ fi ++ else ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi + ;; +- esac +- ;; +- interix*) +- # This is c89, which is MS Visual C++ (no shared libs) +- # Anyone wants to do a port? +- ;; +- irix5* | irix6* | nonstopux*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- # CC pic flag -KPIC is the default. ++ esac ++ ;; ++ ++ interix[[3-9]]*) ++ _LT_TAGVAR(hardcode_direct, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. ++ # Instead, shared libraries are loaded at an image base (0x10000000 by ++ # default) and relocated if they conflict, which is a slow very memory ++ # consuming and fragmenting process. To avoid this, we pick a random, ++ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link ++ # time. Moving up from 0x10000000 also allows more sbrk(2) space. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ ;; ++ irix5* | irix6*) ++ case $cc_basename in ++ CC*) ++ # SGI C++ ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' ++ ++ # Archives containing C++ object files must be created using ++ # "CC -ar", where "CC" is the IRIX C++ compiler. This is ++ # necessary to make sure instantiated templates are included ++ # in the archive. ++ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; +- *) ++ *) ++ if test "$GXX" = yes; then ++ if test "$with_gnu_ld" = no; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ else ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' ++ fi ++ fi ++ _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; +- esac +- ;; +- linux*) +- case $cc_basename in +- KCC*) +- # KAI C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ esac ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ _LT_TAGVAR(inherit_rpath, $1)=yes ++ ;; ++ ++ linux* | k*bsd*-gnu) ++ case $cc_basename in ++ KCC*) ++ # Kuck and Associates, Inc. (KAI) C++ Compiler ++ ++ # KCC will only create a shared library if the output file ++ # ends with ".so" (or ".sl" for HP-UX), so rename the library ++ # to its proper name (with version) after linking. ++ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ ++ # Archives containing C++ object files must be created using ++ # "CC -Bstatic", where "CC" is the KAI C++ compiler. ++ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; +- icpc* | ecpc*) ++ icpc* | ecpc* ) + # Intel C++ +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- ;; +- pgCC*) +- # Portland Group C++ compiler. +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- cxx*) +- # Compaq C++ +- # Make sure the PIC flag is empty. It appears that all Alpha +- # Linux and Compaq Tru64 Unix objects are PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ with_gnu_ld=yes ++ # version 8.0 and above of icpc choke on multiply defined symbols ++ # if we add $predep_objects and $postdep_objects, however 7.1 and ++ # earlier do not add the objects themselves. ++ case `$CC -V 2>&1` in ++ *"Version 7."*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ ;; ++ *) # Version 8.0 or newer ++ tmp_idyn= ++ case $host_cpu in ++ ia64*) tmp_idyn=' -i_dynamic';; ++ esac ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ ;; ++ esac ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; +- *) +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) +- # Sun C++ 5.9 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ++ pgCC* | pgcpp*) ++ # Portland Group C++ compiler ++ case `$CC -V` in ++ *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) ++ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ ++ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' ++ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ ++ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ ++ $RANLIB $oldlib' ++ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ ++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ ++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ++ ;; ++ *) # Version 6 will use weak symbols ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac +- ;; +- esac +- ;; +- lynxos*) +- ;; +- m88k*) +- ;; +- mvs*) +- case $cc_basename in +- cxx*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' +- ;; +- *) +- ;; +- esac +- ;; +- netbsd*) +- ;; +- osf3* | osf4* | osf5*) +- case $cc_basename in +- KCC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- ;; ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ++ ;; + cxx*) +- # Digital/Compaq C++ +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # Make sure the PIC flag is empty. It appears that all Alpha +- # Linux and Compaq Tru64 Unix objects are PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- *) +- ;; +- esac +- ;; +- psos*) +- ;; +- solaris*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.2, 5.x and Centerline C++ +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' +- ;; +- gcx*) +- # Green Hills C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' +- ;; +- *) +- ;; +- esac +- ;; +- sunos4*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.x +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- lcc*) +- # Lucid +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- ;; +- *) ++ # Compaq C++ ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' ++ ++ runpath_var=LD_RUN_PATH ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; +- esac +- ;; +- tandem*) +- case $cc_basename in +- NCC*) +- # NonStop-UX NCC 3.20 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ++ xl*) ++ # IBM XL 8.0 on PPC, with GNU ld ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ if test "x$supports_anon_versioning" = xyes; then ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ ++ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ ++ echo "local: *; };" >> $output_objdir/$libname.ver~ ++ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' ++ fi + ;; + *) ++ case `$CC -V 2>&1 | sed 5q` in ++ *Sun\ C*) ++ # Sun C++ 5.9 ++ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ++ _LT_TAGVAR(compiler_needs_object, $1)=yes ++ ++ # Not sure whether something based on ++ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 ++ # would be better. ++ output_verbose_link_cmd='echo' ++ ++ # Archives containing C++ object files must be created using ++ # "CC -xar", where "CC" is the Sun C++ compiler. This is ++ # necessary to make sure instantiated templates are included ++ # in the archive. ++ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ++ ;; ++ esac + ;; + esac + ;; +- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ++ lynxos*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ ++ m88k*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ ++ mvs*) ++ case $cc_basename in ++ cxx*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ *) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; +- vxworks*) ++ ++ netbsd*) ++ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' ++ wlarc= ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ fi ++ # Workaround some broken pre-1.5 toolchains ++ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ++ ++ *nto* | *qnx*) ++ _LT_TAGVAR(ld_shlibs, $1)=yes + ;; +- esac +- fi +-], +-[ +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + +- case $host_os in +- aix*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; ++ openbsd2*) ++ # C++ shared libraries are fairly broken ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ ++ openbsd*) ++ if test -f /usr/libexec/ld.so; then ++ _LT_TAGVAR(hardcode_direct, $1)=yes ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' ++ fi ++ output_verbose_link_cmd=echo ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; + +- amigaos*) +- # FIXME: we need at least 68020 code to build shared libraries, but +- # adding the `-m68020' flag to GCC prevents building anything better, +- # like `-m68040'. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' +- ;; ++ osf3* | osf4* | osf5*) ++ case $cc_basename in ++ KCC*) ++ # Kuck and Associates, Inc. (KAI) C++ Compiler ++ ++ # KCC will only create a shared library if the output file ++ # ends with ".so" (or ".sl" for HP-UX), so rename the library ++ # to its proper name (with version) after linking. ++ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ ++ # Archives containing C++ object files must be created using ++ # the KAI C++ compiler. ++ case $host in ++ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; ++ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; ++ esac ++ ;; ++ RCC*) ++ # Rational C++ 2.4.1 ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ cxx*) ++ case $host in ++ osf3*) ++ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ ;; ++ *) ++ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ ++ echo "-hidden">> $lib.exp~ ++ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ ++ $RM $lib.exp' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ++ ;; ++ esac + +- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) +- # PIC is the default for these OSes. +- ;; ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: + +- mingw* | cygwin* | pw32* | os2*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- # Although the cygwin gcc ignores -fPIC, still need this for old-style +- # (--disable-auto-import) libraries +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' +- ;; ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ++ ;; ++ *) ++ if test "$GXX" = yes && test "$with_gnu_ld" = no; then ++ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' ++ case $host in ++ osf3*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ ;; ++ esac ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=: ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' ++ ++ else ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; ++ esac ++ ;; + +- darwin* | rhapsody*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' +- ;; ++ psos*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; + +- interix3*) +- # Interix 3.x gcc -fpic/-fPIC options generate broken code. +- # Instead, we relocate shared libraries at runtime. +- ;; ++ sunos4*) ++ case $cc_basename in ++ CC*) ++ # Sun C++ 4.x ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ lcc*) ++ # Lucid ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ *) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ esac ++ ;; + +- msdosdjgpp*) +- # Just because we use GCC doesn't mean we suddenly get shared libraries +- # on systems that don't support them. +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- enable_shared=no +- ;; ++ solaris*) ++ case $cc_basename in ++ CC*) ++ # Sun C++ 4.2, 5.x and Centerline C++ ++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes ++ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ case $host_os in ++ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; ++ *) ++ # The compiler driver will combine and reorder linker options, ++ # but understands `-z linker_flag'. ++ # Supported since Solaris 2.6 (maybe 2.5.1?) ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ++ ;; ++ esac ++ _LT_TAGVAR(link_all_deplibs, $1)=yes + +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic +- fi +- ;; ++ output_verbose_link_cmd='echo' + +- hpux*) +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- ;; ++ # Archives containing C++ object files must be created using ++ # "CC -xar", where "CC" is the Sun C++ compiler. This is ++ # necessary to make sure instantiated templates are included ++ # in the archive. ++ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ++ ;; ++ gcx*) ++ # Green Hills C++ Compiler ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- else +- # PORTME Check for flag to pass linker flags through the system compiler. +- case $host_os in +- aix*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- else +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' +- fi +- ;; +- darwin*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- case $cc_basename in +- xlc*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- ;; +- esac +- ;; ++ # The C++ compiler must be used to create the archive. ++ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ++ ;; ++ *) ++ # GNU C++ compiler with Solaris linker ++ if test "$GXX" = yes && test "$with_gnu_ld" = no; then ++ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' ++ if $CC --version | $GREP -v '^2\.7' > /dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' ++ else ++ # g++ 2.7 appears to require `-G' NOT `-shared' on this ++ # platform. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' ++ fi ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' ++ case $host_os in ++ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; ++ *) ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ++ ;; ++ esac ++ fi ++ ;; ++ esac ++ ;; + +- mingw* | cygwin* | pw32* | os2*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- # Although the cygwin gcc ignores -fPIC, still need this for old-style +- # (--disable-auto-import) libraries +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' +- ;; ++ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) ++ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ runpath_var='LD_RUN_PATH' + +- hpux9* | hpux10* | hpux11*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- ;; ++ case $cc_basename in ++ CC*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; + esac +- # Is there a better lt_prog_compiler_static that works with the bundled CC? +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + +- irix5* | irix6* | nonstopux*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # PIC (with -KPIC) is the default. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; ++ sysv5* | sco3.2v5* | sco5v6*) ++ # Note: We can NOT use -z defs as we might desire, because we do not ++ # link with -lc, and that would cause any symbols used from libc to ++ # always be unresolved, which means just about no library would ++ # ever link correctly. If we're not using GNU ld we use -z text ++ # though, which does catch some bad symbols but isn't as heavy-handed ++ # as -z defs. ++ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' ++ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' ++ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ++ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' ++ _LT_TAGVAR(hardcode_libdir_separator, $1)=':' ++ _LT_TAGVAR(link_all_deplibs, $1)=yes ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' ++ runpath_var='LD_RUN_PATH' + +- newsos6) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ case $cc_basename in ++ CC*) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ *) ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ esac + ;; + +- linux*) +- case $cc_basename in +- icc* | ecc*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- ;; +- pgcc* | pgf77* | pgf90* | pgf95*) +- # Portland Group compilers (*not* the Pentium gcc compiler, +- # which looks to be a dead project) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- ccc*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # All Alpha code is PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ++ tandem*) ++ case $cc_basename in ++ NCC*) ++ # NonStop-UX NCC 3.20 ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ *) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ esac + ;; +- como) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-lopt=' ++ ++ vxworks*) ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no + ;; ++ + *) +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) +- # Sun C 5.9 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- ;; +- *Sun\ F*) +- # Sun Fortran 8.3 passes all unrecognized flags to the linker +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' +- ;; +- esac +- ;; +- esac +- ;; ++ # FIXME: insert proper C++ library support ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ ;; ++ esac + +- osf3* | osf4* | osf5*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # All OSF/1 code is PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; ++ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) ++ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +- solaris*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- case $cc_basename in +- f77* | f90* | f95*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; +- esac +- ;; ++ _LT_TAGVAR(GCC, $1)="$GXX" ++ _LT_TAGVAR(LD, $1)="$LD" ++ ++ ## CAVEAT EMPTOR: ++ ## There is no encapsulation within the following macros, do not change ++ ## the running order or otherwise move them around unless you know exactly ++ ## what you are doing... ++ _LT_SYS_HIDDEN_LIBDEPS($1) ++ _LT_COMPILER_PIC($1) ++ _LT_COMPILER_C_O($1) ++ _LT_COMPILER_FILE_LOCKS($1) ++ _LT_LINKER_SHLIBS($1) ++ _LT_SYS_DYNAMIC_LINKER($1) ++ _LT_LINKER_HARDCODE_LIBPATH($1) ++ ++ _LT_CONFIG($1) ++ fi # test -n "$compiler" ++ ++ CC=$lt_save_CC ++ LDCXX=$LD ++ LD=$lt_save_LD ++ GCC=$lt_save_GCC ++ with_gnu_ld=$lt_save_with_gnu_ld ++ lt_cv_path_LDCXX=$lt_cv_path_LD ++ lt_cv_path_LD=$lt_save_path_LD ++ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld ++ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ++fi # test "$_lt_caught_CXX_error" != yes ++ ++AC_LANG_POP ++])# _LT_LANG_CXX_CONFIG ++ ++ ++# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) ++# --------------------------------- ++# Figure out "hidden" library dependencies from verbose ++# compiler output when linking a shared library. ++# Parse the compiler output and extract the necessary ++# objects, libraries and library flags. ++m4_defun([_LT_SYS_HIDDEN_LIBDEPS], ++[m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++# Dependencies to place before and after the object being linked: ++_LT_TAGVAR(predep_objects, $1)= ++_LT_TAGVAR(postdep_objects, $1)= ++_LT_TAGVAR(predeps, $1)= ++_LT_TAGVAR(postdeps, $1)= ++_LT_TAGVAR(compiler_lib_search_path, $1)= ++ ++dnl we can't use the lt_simple_compile_test_code here, ++dnl because it contains code intended for an executable, ++dnl not a library. It's possible we should let each ++dnl tag define a new lt_????_link_test_code variable, ++dnl but it's only used here... ++m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF ++int a; ++void foo (void) { a = 0; } ++_LT_EOF ++], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF ++class Foo ++{ ++public: ++ Foo (void) { a = 0; } ++private: ++ int a; ++}; ++_LT_EOF ++], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF ++ subroutine foo ++ implicit none ++ integer*4 a ++ a=0 ++ return ++ end ++_LT_EOF ++], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF ++ subroutine foo ++ implicit none ++ integer a ++ a=0 ++ return ++ end ++_LT_EOF ++], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF ++public class foo { ++ private int a; ++ public void bar (void) { ++ a = 0; ++ } ++}; ++_LT_EOF ++]) ++dnl Parse the compiler output and extract the necessary ++dnl objects, libraries and library flags. ++if AC_TRY_EVAL(ac_compile); then ++ # Parse the compiler output and extract the necessary ++ # objects, libraries and library flags. ++ ++ # Sentinel used to keep track of whether or not we are before ++ # the conftest object file. ++ pre_test_object_deps_done=no + +- sunos4*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; ++ for p in `eval "$output_verbose_link_cmd"`; do ++ case $p in + +- sysv4 | sysv4.2uw2* | sysv4.3*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; ++ -L* | -R* | -l*) ++ # Some compilers place space between "-{L,R}" and the path. ++ # Remove the space. ++ if test $p = "-L" || ++ test $p = "-R"; then ++ prev=$p ++ continue ++ else ++ prev= ++ fi + +- sysv4*MP*) +- if test -d /usr/nec ;then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; ++ if test "$pre_test_object_deps_done" = no; then ++ case $p in ++ -L* | -R*) ++ # Internal compiler library paths should come after those ++ # provided the user. The postdeps already come after the ++ # user supplied libs so there is no need to process them. ++ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then ++ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" ++ else ++ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" ++ fi ++ ;; ++ # The "-l" case would never come before the object being ++ # linked, so don't bother handling this case. ++ esac ++ else ++ if test -z "$_LT_TAGVAR(postdeps, $1)"; then ++ _LT_TAGVAR(postdeps, $1)="${prev}${p}" ++ else ++ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" ++ fi ++ fi ++ ;; + +- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; ++ *.$objext) ++ # This assumes that the test object file only shows up ++ # once in the compiler output. ++ if test "$p" = "conftest.$objext"; then ++ pre_test_object_deps_done=yes ++ continue ++ fi + +- unicos*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- ;; ++ if test "$pre_test_object_deps_done" = no; then ++ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then ++ _LT_TAGVAR(predep_objects, $1)="$p" ++ else ++ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" ++ fi ++ else ++ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then ++ _LT_TAGVAR(postdep_objects, $1)="$p" ++ else ++ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" ++ fi ++ fi ++ ;; + +- uts4*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; ++ *) ;; # Ignore the rest. + +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- ;; + esac +- fi +-]) +-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) ++ done + +-# +-# Check to make sure the PIC flag actually works. +-# +-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then +- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], +- _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), +- [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], +- [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in +- "" | " "*) ;; +- *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; +- esac], +- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) ++ # Clean up. ++ rm -f a.out a.exe ++else ++ echo "libtool.m4: error: problem compiling $1 test program" + fi +-case $host_os in +- # For platforms which do not support PIC, -DPIC is meaningless: +- *djgpp*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" +- ;; +-esac +- +-# +-# Check to make sure the static flag actually works. +-# +-wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], +- _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), +- $lt_tmp_static_flag, +- [], +- [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +-]) + ++$RM -f confest.$objext + +-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +-# ------------------------------------ +-# See if the linker supports building shared libraries. +-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +-ifelse([$1],[CXX],[ +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- case $host_os in +- aix4* | aix5*) +- # If we're using GNU nm, then we don't want the "-C" option. +- # -C means demangle to AIX nm, but means don't demangle with GNU nm +- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- else +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- fi +- ;; +- pw32*) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" +- ;; +- cygwin* | mingw*) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' +- ;; +- *) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ++# PORTME: override above test on systems where it is broken ++m4_if([$1], [CXX], ++[case $host_os in ++interix[[3-9]]*) ++ # Interix 3.5 installs completely hosed .la files for C++, so rather than ++ # hack all around it, let's just trust "g++" to DTRT. ++ _LT_TAGVAR(predep_objects,$1)= ++ _LT_TAGVAR(postdep_objects,$1)= ++ _LT_TAGVAR(postdeps,$1)= + ;; +- esac +-],[ +- runpath_var= +- _LT_AC_TAGVAR(allow_undefined_flag, $1)= +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +- _LT_AC_TAGVAR(archive_cmds, $1)= +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)= +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= +- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +- _LT_AC_TAGVAR(hardcode_automatic, $1)=no +- _LT_AC_TAGVAR(module_cmds, $1)= +- _LT_AC_TAGVAR(module_expsym_cmds, $1)= +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- # include_expsyms should be a list of space-separated symbols to be *always* +- # included in the symbol list +- _LT_AC_TAGVAR(include_expsyms, $1)= +- # exclude_expsyms can be an extended regexp of symbols to exclude +- # it will be wrapped by ` (' and `)$', so one must not match beginning or +- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', +- # as well as any symbol that contains `d'. +- _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" +- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out +- # platforms (ab)use it in PIC code, but their linkers get confused if +- # the symbol is explicitly referenced. Since portable code cannot +- # rely on this symbol name, it's probably fine to never include it in +- # preloaded symbol tables. +- extract_expsyms_cmds= +- # Just being paranoid about ensuring that cc_basename is set. +- _LT_CC_BASENAME([$compiler]) +- case $host_os in +- cygwin* | mingw* | pw32*) +- # FIXME: the MSVC++ port hasn't been tested in a loooong time +- # When not using gcc, we currently assume that we are using +- # Microsoft Visual C++. +- if test "$GCC" != yes; then +- with_gnu_ld=no +- fi +- ;; +- interix*) +- # we just hope/assume this is gcc and not c89 (= MSVC++) +- with_gnu_ld=yes +- ;; +- openbsd*) +- with_gnu_ld=no +- ;; +- esac +- +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- if test "$with_gnu_ld" = yes; then +- # If archive_cmds runs LD, not CC, wlarc should be empty +- wlarc='${wl}' +- +- # Set some defaults for GNU ld with shared library support. These +- # are reset later if shared libraries are not supported. Putting them +- # here allows them to be overridden if necessary. +- runpath_var=LD_RUN_PATH +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- # ancient GNU ld didn't support --whole-archive et. al. +- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' +- else +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- supports_anon_versioning=no +- case `$LD -v 2>/dev/null` in +- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 +- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... +- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... +- *\ 2.11.*) ;; # other 2.11 versions +- *) supports_anon_versioning=yes ;; +- esac +- +- # See if GNU ld supports shared libraries. +- case $host_os in +- aix3* | aix4* | aix5*) +- # On AIX/PPC, the GNU linker is very broken +- if test "$host_cpu" != ia64; then +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <&2 +- +-*** Warning: the GNU linker, at least up to release 2.9.1, is reported +-*** to be unable to reliably create shared libraries on AIX. +-*** Therefore, libtool is disabling shared libraries support. If you +-*** really care for shared libraries, you may want to modify your PATH +-*** so that a non-GNU linker is found, and then restart. +- +-EOF +- fi +- ;; + +- amigaos*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- +- # Samuel A. Falvo II reports +- # that the semantics of dynamic libraries on AmigaOS, at least up +- # to version 4, is to share data among multiple programs linked +- # with the same dynamic library. Since this doesn't match the +- # behavior of shared libraries on other platforms, we can't use +- # them. +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; ++linux*) ++ case `$CC -V 2>&1 | sed 5q` in ++ *Sun\ C*) ++ # Sun C++ 5.9 + +- beos*) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Joseph Beckenbach says some releases of gcc +- # support --undefined. This deserves some investigation. FIXME +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi ++ # The more standards-conforming stlport4 library is ++ # incompatible with the Cstd library. Avoid specifying ++ # it if it's in CXXFLAGS. Ignore libCrun as ++ # -library=stlport4 depends on it. ++ case " $CXX $CXXFLAGS " in ++ *" -library=stlport4 "*) ++ solaris_use_stlport4=yes + ;; ++ esac + +- cygwin* | mingw* | pw32*) +- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, +- # as there is no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' +- +- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; ++ if test "$solaris_use_stlport4" != yes; then ++ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' ++ fi ++ ;; ++ esac ++ ;; + +- interix3*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. +- # Instead, shared libraries are loaded at an image base (0x10000000 by +- # default) and relocated if they conflict, which is a slow very memory +- # consuming and fragmenting process. To avoid this, we pick a random, +- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link +- # time. Moving up from 0x10000000 also allows more sbrk(2) space. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++solaris*) ++ case $cc_basename in ++ CC*) ++ # The more standards-conforming stlport4 library is ++ # incompatible with the Cstd library. Avoid specifying ++ # it if it's in CXXFLAGS. Ignore libCrun as ++ # -library=stlport4 depends on it. ++ case " $CXX $CXXFLAGS " in ++ *" -library=stlport4 "*) ++ solaris_use_stlport4=yes + ;; ++ esac + +- linux*) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- tmp_addflag= +- case $cc_basename,$host_cpu in +- pgcc*) # Portland Group C compiler +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- tmp_addflag=' $pic_flag' +- ;; +- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- tmp_addflag=' $pic_flag -Mnomain' ;; +- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 +- tmp_addflag=' -i_dynamic' ;; +- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 +- tmp_addflag=' -i_dynamic -nofor_main' ;; +- ifc* | ifort*) # Intel Fortran compiler +- tmp_addflag=' -nofor_main' ;; +- esac +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) # Sun C 5.9 +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive /dev/null' +- tmp_sharedflag='-G' ;; +- *Sun\ F*) # Sun Fortran 8.3 +- tmp_sharedflag='-G' ;; +- *) +- tmp_sharedflag='-shared' ;; +- esac +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ # Adding this requires a known-good setup of shared libraries for ++ # Sun compiler versions before 5.6, else PIC objects from an old ++ # archive will be linked into the output, leading to subtle bugs. ++ if test "$solaris_use_stlport4" != yes; then ++ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' ++ fi ++ ;; ++ esac ++ ;; ++esac ++]) + +- if test $supports_anon_versioning = yes; then +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ +- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +- $echo "local: *; };" >> $output_objdir/$libname.ver~ +- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' +- fi +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; ++case " $_LT_TAGVAR(postdeps, $1) " in ++*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; ++esac ++ _LT_TAGVAR(compiler_lib_search_dirs, $1)= ++if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then ++ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` ++fi ++_LT_TAGDECL([], [compiler_lib_search_dirs], [1], ++ [The directories searched by this compiler when creating a shared library]) ++_LT_TAGDECL([], [predep_objects], [1], ++ [Dependencies to place before and after the objects being linked to ++ create a shared library]) ++_LT_TAGDECL([], [postdep_objects], [1]) ++_LT_TAGDECL([], [predeps], [1]) ++_LT_TAGDECL([], [postdeps], [1]) ++_LT_TAGDECL([], [compiler_lib_search_path], [1], ++ [The library search path used internally by the compiler when linking ++ a shared library]) ++])# _LT_SYS_HIDDEN_LIBDEPS ++ ++ ++# _LT_PROG_F77 ++# ------------ ++# Since AC_PROG_F77 is broken, in that it returns the empty string ++# if there is no fortran compiler, we have our own version here. ++m4_defun([_LT_PROG_F77], ++[ ++pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) ++AC_PROG_F77 ++if test -z "$F77" || test "X$F77" = "Xno"; then ++ _lt_disable_F77=yes ++fi ++popdef([AC_MSG_ERROR]) ++])# _LT_PROG_F77 + +- netbsd*) +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' +- wlarc= +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- fi +- ;; ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([_LT_PROG_F77], []) + +- solaris*) +- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <&2 + +-*** Warning: The releases 2.8.* of the GNU linker cannot reliably +-*** create shared libraries on Solaris systems. Therefore, libtool +-*** is disabling shared libraries support. We urge you to upgrade GNU +-*** binutils to release 2.9.1 or newer. Another option is to modify +-*** your PATH or compiler configuration so that the native linker is +-*** used, and then restart. ++# _LT_LANG_F77_CONFIG([TAG]) ++# -------------------------- ++# Ensure that the configuration variables for a Fortran 77 compiler are ++# suitably defined. These variables are subsequently used by _LT_CONFIG ++# to write the compiler configuration to `libtool'. ++m4_defun([_LT_LANG_F77_CONFIG], ++[AC_REQUIRE([_LT_PROG_F77])dnl ++AC_LANG_PUSH(Fortran 77) + +-EOF +- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; ++_LT_TAGVAR(archive_cmds_need_lc, $1)=no ++_LT_TAGVAR(allow_undefined_flag, $1)= ++_LT_TAGVAR(always_export_symbols, $1)=no ++_LT_TAGVAR(archive_expsym_cmds, $1)= ++_LT_TAGVAR(export_dynamic_flag_spec, $1)= ++_LT_TAGVAR(hardcode_direct, $1)=no ++_LT_TAGVAR(hardcode_direct_absolute, $1)=no ++_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= ++_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= ++_LT_TAGVAR(hardcode_libdir_separator, $1)= ++_LT_TAGVAR(hardcode_minus_L, $1)=no ++_LT_TAGVAR(hardcode_automatic, $1)=no ++_LT_TAGVAR(inherit_rpath, $1)=no ++_LT_TAGVAR(module_cmds, $1)= ++_LT_TAGVAR(module_expsym_cmds, $1)= ++_LT_TAGVAR(link_all_deplibs, $1)=unknown ++_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ++_LT_TAGVAR(no_undefined_flag, $1)= ++_LT_TAGVAR(whole_archive_flag_spec, $1)= ++_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) +- case `$LD -v 2>&1` in +- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <<_LT_EOF 1>&2 ++# Source file extension for f77 test sources. ++ac_ext=f + +-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +-*** reliably create shared libraries on SCO systems. Therefore, libtool +-*** is disabling shared libraries support. We urge you to upgrade GNU +-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +-*** your PATH or compiler configuration so that the native linker is +-*** used, and then restart. ++# Object file extension for compiled f77 test sources. ++objext=o ++_LT_TAGVAR(objext, $1)=$objext + +-_LT_EOF +- ;; +- *) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; ++# No sense in running all these tests if we already determined that ++# the F77 compiler isn't working. Some variables (like enable_shared) ++# are currently assumed to apply to all compilers on this platform, ++# and will be corrupted by setting them based on a non-working compiler. ++if test "$_lt_disable_F77" != yes; then ++ # Code to be used in simple compile tests ++ lt_simple_compile_test_code="\ ++ subroutine t ++ return ++ end ++" + +- sunos4*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- wlarc= +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++ # Code to be used in simple link tests ++ lt_simple_link_test_code="\ ++ program t ++ end ++" + +- *) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac ++ # ltmain only uses $CC for tagged configurations so make sure $CC is set. ++ _LT_TAG_COMPILER + +- if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then +- runpath_var= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- else +- # PORTME fill in a description of your system's linker (not GNU ld) +- case $host_os in +- aix3*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' +- # Note: this linker hardcodes the directories in LIBPATH if there +- # are no directories specified by -L. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then +- # Neither direct hardcoding nor static linking is supported with a +- # broken collect2. +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- fi +- ;; ++ # save warnings/boilerplate of simple test code ++ _LT_COMPILER_BOILERPLATE ++ _LT_LINKER_BOILERPLATE ++ ++ # Allow CC to be a program name with arguments. ++ lt_save_CC="$CC" ++ lt_save_GCC=$GCC ++ CC=${F77-"f77"} ++ compiler=$CC ++ _LT_TAGVAR(compiler, $1)=$CC ++ _LT_CC_BASENAME([$compiler]) ++ GCC=$G77 ++ if test -n "$compiler"; then ++ AC_MSG_CHECKING([if libtool supports shared libraries]) ++ AC_MSG_RESULT([$can_build_shared]) + +- aix4* | aix5*) +- if test "$host_cpu" = ia64; then +- # On IA64, the linker does run time linking by default, so we don't +- # have to do anything special. +- aix_use_runtimelinking=no +- exp_sym_flag='-Bexport' +- no_entry_flag="" +- else +- # If we're using GNU nm, then we don't want the "-C" option. +- # -C means demangle to AIX nm, but means don't demangle with GNU nm +- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- else +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' ++ AC_MSG_CHECKING([whether to build shared libraries]) ++ test "$can_build_shared" = "no" && enable_shared=no ++ ++ # On AIX, shared libraries and static libraries use the same namespace, and ++ # are all built from PIC. ++ case $host_os in ++ aix3*) ++ test "$enable_shared" = yes && enable_static=no ++ if test -n "$RANLIB"; then ++ archive_cmds="$archive_cmds~\$RANLIB \$lib" ++ postinstall_cmds='$RANLIB $lib' ++ fi ++ ;; ++ aix[[4-9]]*) ++ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then ++ test "$enable_shared" = yes && enable_static=no + fi +- aix_use_runtimelinking=no ++ ;; ++ esac ++ AC_MSG_RESULT([$enable_shared]) + +- # Test if we are trying to use run time linking or normal +- # AIX style linking. If -brtl is somewhere in LDFLAGS, we +- # need to do runtime linking. +- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) +- for ld_flag in $LDFLAGS; do +- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then +- aix_use_runtimelinking=yes +- break +- fi +- done +- ;; +- esac ++ AC_MSG_CHECKING([whether to build static libraries]) ++ # Make sure either enable_shared or enable_static is yes. ++ test "$enable_shared" = yes || enable_static=yes ++ AC_MSG_RESULT([$enable_static]) ++ ++ _LT_TAGVAR(GCC, $1)="$G77" ++ _LT_TAGVAR(LD, $1)="$LD" ++ ++ ## CAVEAT EMPTOR: ++ ## There is no encapsulation within the following macros, do not change ++ ## the running order or otherwise move them around unless you know exactly ++ ## what you are doing... ++ _LT_COMPILER_PIC($1) ++ _LT_COMPILER_C_O($1) ++ _LT_COMPILER_FILE_LOCKS($1) ++ _LT_LINKER_SHLIBS($1) ++ _LT_SYS_DYNAMIC_LINKER($1) ++ _LT_LINKER_HARDCODE_LIBPATH($1) ++ ++ _LT_CONFIG($1) ++ fi # test -n "$compiler" ++ ++ GCC=$lt_save_GCC ++ CC="$lt_save_CC" ++fi # test "$_lt_disable_F77" != yes + +- exp_sym_flag='-bexport' +- no_entry_flag='-bnoentry' +- fi ++AC_LANG_POP ++])# _LT_LANG_F77_CONFIG + +- # When large executables or shared objects are built, AIX ld can +- # have problems creating the table of contents. If linking a library +- # or program results in "error TOC overflow" add -mminimal-toc to +- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not +- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + +- _LT_AC_TAGVAR(archive_cmds, $1)='' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ++# _LT_PROG_FC ++# ----------- ++# Since AC_PROG_FC is broken, in that it returns the empty string ++# if there is no fortran compiler, we have our own version here. ++m4_defun([_LT_PROG_FC], ++[ ++pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) ++AC_PROG_FC ++if test -z "$FC" || test "X$FC" = "Xno"; then ++ _lt_disable_FC=yes ++fi ++popdef([AC_MSG_ERROR]) ++])# _LT_PROG_FC + +- if test "$GCC" = yes; then +- case $host_os in aix4.[[012]]|aix4.[[012]].*) +- # We only want to do this on AIX 4.2 and lower, the check +- # below for broken collect2 doesn't work under 4.3+ +- collect2name=`${CC} -print-prog-name=collect2` +- if test -f "$collect2name" && \ +- strings "$collect2name" | grep resolve_lib_name >/dev/null +- then +- # We have reworked collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- else +- # We have old collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- # It fails to find uninstalled libraries when the uninstalled +- # path is not listed in the libpath. Setting hardcode_minus_L +- # to unsupported forces relinking +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- fi +- ;; +- esac +- shared_flag='-shared' +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag="$shared_flag "'${wl}-G' +- fi +- else +- # not using gcc +- if test "$host_cpu" = ia64; then +- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release +- # chokes on -Wl,-G. The following line is correct: +- shared_flag='-G' +- else +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag='${wl}-G' +- else +- shared_flag='${wl}-bM:SRE' +- fi +- fi +- fi ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([_LT_PROG_FC], []) + +- # It seems that -bexpall does not export symbols beginning with +- # underscore (_), so it is better to generate a list of symbols to export. +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- if test "$aix_use_runtimelinking" = yes; then +- # Warning - without using the other runtime loading flags (-brtl), +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +- else +- if test "$host_cpu" = ia64; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" +- else +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- # Warning - without using the other run time loading flags, +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' +- # Exported symbols can be pulled into shared objects from archives +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- # This is similar to how AIX traditionally builds its shared libraries. +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' +- fi +- fi +- ;; + +- amigaos*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- # see comment about different semantics on the GNU ld section +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; ++# _LT_LANG_FC_CONFIG([TAG]) ++# ------------------------- ++# Ensure that the configuration variables for a Fortran compiler are ++# suitably defined. These variables are subsequently used by _LT_CONFIG ++# to write the compiler configuration to `libtool'. ++m4_defun([_LT_LANG_FC_CONFIG], ++[AC_REQUIRE([_LT_PROG_FC])dnl ++AC_LANG_PUSH(Fortran) ++ ++_LT_TAGVAR(archive_cmds_need_lc, $1)=no ++_LT_TAGVAR(allow_undefined_flag, $1)= ++_LT_TAGVAR(always_export_symbols, $1)=no ++_LT_TAGVAR(archive_expsym_cmds, $1)= ++_LT_TAGVAR(export_dynamic_flag_spec, $1)= ++_LT_TAGVAR(hardcode_direct, $1)=no ++_LT_TAGVAR(hardcode_direct_absolute, $1)=no ++_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= ++_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= ++_LT_TAGVAR(hardcode_libdir_separator, $1)= ++_LT_TAGVAR(hardcode_minus_L, $1)=no ++_LT_TAGVAR(hardcode_automatic, $1)=no ++_LT_TAGVAR(inherit_rpath, $1)=no ++_LT_TAGVAR(module_cmds, $1)= ++_LT_TAGVAR(module_expsym_cmds, $1)= ++_LT_TAGVAR(link_all_deplibs, $1)=unknown ++_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ++_LT_TAGVAR(no_undefined_flag, $1)= ++_LT_TAGVAR(whole_archive_flag_spec, $1)= ++_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +- bsdi[[45]]*) +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic +- ;; ++# Source file extension for fc test sources. ++ac_ext=${ac_fc_srcext-f} + +- cygwin* | mingw* | pw32*) +- # When not using gcc, we currently assume that we are using +- # Microsoft Visual C++. +- # hardcode_libdir_flag_spec is actually meaningless, as there is +- # no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Tell ltmain to make .lib files, not .a files. +- libext=lib +- # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" +- # FIXME: Setting linknames here is a bad hack. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' +- # The linker will automatically build a .lib file if we build a DLL. +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' +- # FIXME: Should let the user specify the lib program. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' +- _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- ;; ++# Object file extension for compiled fc test sources. ++objext=o ++_LT_TAGVAR(objext, $1)=$objext + +- darwin* | rhapsody*) +- case $host_os in +- rhapsody* | darwin1.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' +- ;; +- *) # Darwin 1.3 on +- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- else +- case ${MACOSX_DEPLOYMENT_TARGET} in +- 10.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- ;; +- 10.*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' +- ;; +- esac +- fi +- ;; +- esac +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- if test "$GCC" = yes ; then +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- else +- case $cc_basename in +- xlc*) +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- ;; +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +- ;; ++# No sense in running all these tests if we already determined that ++# the FC compiler isn't working. Some variables (like enable_shared) ++# are currently assumed to apply to all compilers on this platform, ++# and will be corrupted by setting them based on a non-working compiler. ++if test "$_lt_disable_FC" != yes; then ++ # Code to be used in simple compile tests ++ lt_simple_compile_test_code="\ ++ subroutine t ++ return ++ end ++" + +- dgux*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++ # Code to be used in simple link tests ++ lt_simple_link_test_code="\ ++ program t ++ end ++" + +- freebsd1*) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; ++ # ltmain only uses $CC for tagged configurations so make sure $CC is set. ++ _LT_TAG_COMPILER + +- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor +- # support. Future versions do this automatically, but an explicit c++rt0.o +- # does not break anything, and helps significantly (at the cost of a little +- # extra space). +- freebsd2.2*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++ # save warnings/boilerplate of simple test code ++ _LT_COMPILER_BOILERPLATE ++ _LT_LINKER_BOILERPLATE ++ ++ # Allow CC to be a program name with arguments. ++ lt_save_CC="$CC" ++ lt_save_GCC=$GCC ++ CC=${FC-"f95"} ++ compiler=$CC ++ GCC=$ac_cv_fc_compiler_gnu + +- # Unfortunately, older versions of FreeBSD 2 do not have this feature. +- freebsd2*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++ _LT_TAGVAR(compiler, $1)=$CC ++ _LT_CC_BASENAME([$compiler]) + +- # FreeBSD 3 and greater uses gcc -shared to do shared libraries. +- freebsd* | kfreebsd*-gnu | dragonfly*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++ if test -n "$compiler"; then ++ AC_MSG_CHECKING([if libtool supports shared libraries]) ++ AC_MSG_RESULT([$can_build_shared]) + +- hpux9*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes ++ AC_MSG_CHECKING([whether to build shared libraries]) ++ test "$can_build_shared" = "no" && enable_shared=no + +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- ;; ++ # On AIX, shared libraries and static libraries use the same namespace, and ++ # are all built from PIC. ++ case $host_os in ++ aix3*) ++ test "$enable_shared" = yes && enable_static=no ++ if test -n "$RANLIB"; then ++ archive_cmds="$archive_cmds~\$RANLIB \$lib" ++ postinstall_cmds='$RANLIB $lib' ++ fi ++ ;; ++ aix[[4-9]]*) ++ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then ++ test "$enable_shared" = yes && enable_static=no ++ fi ++ ;; ++ esac ++ AC_MSG_RESULT([$enable_shared]) + +- hpux10*) +- if test "$GCC" = yes -a "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +- fi +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ++ AC_MSG_CHECKING([whether to build static libraries]) ++ # Make sure either enable_shared or enable_static is yes. ++ test "$enable_shared" = yes || enable_static=yes ++ AC_MSG_RESULT([$enable_static]) ++ ++ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" ++ _LT_TAGVAR(LD, $1)="$LD" ++ ++ ## CAVEAT EMPTOR: ++ ## There is no encapsulation within the following macros, do not change ++ ## the running order or otherwise move them around unless you know exactly ++ ## what you are doing... ++ _LT_SYS_HIDDEN_LIBDEPS($1) ++ _LT_COMPILER_PIC($1) ++ _LT_COMPILER_C_O($1) ++ _LT_COMPILER_FILE_LOCKS($1) ++ _LT_LINKER_SHLIBS($1) ++ _LT_SYS_DYNAMIC_LINKER($1) ++ _LT_LINKER_HARDCODE_LIBPATH($1) ++ ++ _LT_CONFIG($1) ++ fi # test -n "$compiler" ++ ++ GCC=$lt_save_GCC ++ CC="$lt_save_CC" ++fi # test "$_lt_disable_FC" != yes + +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++AC_LANG_POP ++])# _LT_LANG_FC_CONFIG + +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- fi +- ;; + +- hpux11*) +- if test "$GCC" = yes -a "$with_gnu_ld" = no; then +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- else +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- fi +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ++# _LT_LANG_GCJ_CONFIG([TAG]) ++# -------------------------- ++# Ensure that the configuration variables for the GNU Java Compiler compiler ++# are suitably defined. These variables are subsequently used by _LT_CONFIG ++# to write the compiler configuration to `libtool'. ++m4_defun([_LT_LANG_GCJ_CONFIG], ++[AC_REQUIRE([LT_PROG_GCJ])dnl ++AC_LANG_SAVE + +- case $host_cpu in +- hppa*64*|ia64*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- *) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++# Source file extension for Java test sources. ++ac_ext=java + +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- ;; +- esac +- fi +- ;; ++# Object file extension for compiled Java test sources. ++objext=o ++_LT_TAGVAR(objext, $1)=$objext + +- irix5* | irix6* | nonstopux*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; ++# Code to be used in simple compile tests ++lt_simple_compile_test_code="class foo {}" + +- netbsd*) +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++# Code to be used in simple link tests ++lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +- newsos6) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++# ltmain only uses $CC for tagged configurations so make sure $CC is set. ++_LT_TAG_COMPILER ++ ++# save warnings/boilerplate of simple test code ++_LT_COMPILER_BOILERPLATE ++_LT_LINKER_BOILERPLATE ++ ++# Allow CC to be a program name with arguments. ++lt_save_CC="$CC" ++lt_save_GCC=$GCC ++GCC=yes ++CC=${GCJ-"gcj"} ++compiler=$CC ++_LT_TAGVAR(compiler, $1)=$CC ++_LT_TAGVAR(LD, $1)="$LD" ++_LT_CC_BASENAME([$compiler]) + +- openbsd*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- else +- case $host_os in +- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- ;; +- esac +- fi +- ;; ++# GCJ did not exist at the time GCC didn't implicitly link libc in. ++_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +- os2*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' +- ;; ++_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + +- osf3*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- ;; ++## CAVEAT EMPTOR: ++## There is no encapsulation within the following macros, do not change ++## the running order or otherwise move them around unless you know exactly ++## what you are doing... ++if test -n "$compiler"; then ++ _LT_COMPILER_NO_RTTI($1) ++ _LT_COMPILER_PIC($1) ++ _LT_COMPILER_C_O($1) ++ _LT_COMPILER_FILE_LOCKS($1) ++ _LT_LINKER_SHLIBS($1) ++ _LT_LINKER_HARDCODE_LIBPATH($1) + +- osf4* | osf5*) # as osf3* with the addition of -msym flag +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- else +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ +- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' ++ _LT_CONFIG($1) ++fi + +- # Both c and cxx compiler support -rpath directly +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- ;; ++AC_LANG_RESTORE + +- solaris*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' +- if test "$GCC" = yes; then +- wlarc='${wl}' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' +- else +- wlarc='' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- case $host_os in +- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; +- *) +- # The compiler driver will combine linker options so we +- # cannot just pass the convience library names through +- # without $wl, iff we do not link with $LD. +- # Luckily, gcc supports the same syntax we need for Sun Studio. +- # Supported since Solaris 2.6 (maybe 2.5.1?) +- case $wlarc in +- '') +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; +- *) +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; +- esac ;; +- esac +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; ++GCC=$lt_save_GCC ++CC="$lt_save_CC" ++])# _LT_LANG_GCJ_CONFIG + +- sunos4*) +- if test "x$host_vendor" = xsequent; then +- # Use $CC to link under sequent, because it throws in some extra .o +- # files that make .init and .fini sections work. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; + +- sysv4) +- case $host_vendor in +- sni) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? +- ;; +- siemens) +- ## LD is ld it makes a PLAMLIB +- ## CC just makes a GrossModule. +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- ;; +- motorola) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie +- ;; +- esac +- runpath_var='LD_RUN_PATH' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++# _LT_LANG_RC_CONFIG([TAG]) ++# ------------------------- ++# Ensure that the configuration variables for the Windows resource compiler ++# are suitably defined. These variables are subsequently used by _LT_CONFIG ++# to write the compiler configuration to `libtool'. ++m4_defun([_LT_LANG_RC_CONFIG], ++[AC_REQUIRE([LT_PROG_RC])dnl ++AC_LANG_SAVE + +- sysv4.3*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' +- ;; ++# Source file extension for RC test sources. ++ac_ext=rc + +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var=LD_RUN_PATH +- hardcode_runpath_var=yes +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- fi +- ;; ++# Object file extension for compiled RC test sources. ++objext=o ++_LT_TAGVAR(objext, $1)=$objext + +- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var='LD_RUN_PATH' ++# Code to be used in simple compile tests ++lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- fi +- ;; ++# Code to be used in simple link tests ++lt_simple_link_test_code="$lt_simple_compile_test_code" + +- sysv5* | sco3.2v5* | sco5v6*) +- # Note: We can NOT use -z defs as we might desire, because we do not +- # link with -lc, and that would cause any symbols used from libc to +- # always be unresolved, which means just about no library would +- # ever link correctly. If we're not using GNU ld we use -z text +- # though, which does catch some bad symbols but isn't as heavy-handed +- # as -z defs. +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' +- runpath_var='LD_RUN_PATH' ++# ltmain only uses $CC for tagged configurations so make sure $CC is set. ++_LT_TAG_COMPILER + +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- fi +- ;; ++# save warnings/boilerplate of simple test code ++_LT_COMPILER_BOILERPLATE ++_LT_LINKER_BOILERPLATE + +- uts4*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; ++# Allow CC to be a program name with arguments. ++lt_save_CC="$CC" ++lt_save_GCC=$GCC ++GCC= ++CC=${RC-"windres"} ++compiler=$CC ++_LT_TAGVAR(compiler, $1)=$CC ++_LT_CC_BASENAME([$compiler]) ++_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +-]) +-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no ++if test -n "$compiler"; then ++ : ++ _LT_CONFIG($1) ++fi + +-# +-# Do we need to explicitly link libc? +-# +-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +-x|xyes) +- # Assume -lc should be added +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes ++GCC=$lt_save_GCC ++AC_LANG_RESTORE ++CC="$lt_save_CC" ++])# _LT_LANG_RC_CONFIG + +- if test "$enable_shared" = yes && test "$GCC" = yes; then +- case $_LT_AC_TAGVAR(archive_cmds, $1) in +- *'~'*) +- # FIXME: we may have to deal with multi-command sequences. +- ;; +- '$CC '*) +- # Test whether the compiler implicitly links with -lc since on some +- # systems, -lgcc has to come before -lc. If gcc already passes -lc +- # to ld, don't add -lc before -lgcc. +- AC_MSG_CHECKING([whether -lc should be explicitly linked in]) +- $rm conftest* +- printf "$lt_simple_compile_test_code" > conftest.$ac_ext + +- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then +- soname=conftest +- lib=conftest +- libobjs=conftest.$ac_objext +- deplibs= +- wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) +- pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +- compiler_flags=-v +- linker_flags=-v +- verstring= +- output_objdir=. +- libname=conftest +- lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)= +- if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) +- then +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- else +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- fi +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag +- else +- cat conftest.err 1>&5 +- fi +- $rm conftest* +- AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) +- ;; +- esac +- fi +- ;; +-esac +-])# AC_LIBTOOL_PROG_LD_SHLIBS ++# LT_PROG_GCJ ++# ----------- ++AC_DEFUN([LT_PROG_GCJ], ++[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], ++ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], ++ [AC_CHECK_TOOL(GCJ, gcj,) ++ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" ++ AC_SUBST(GCJFLAGS)])])[]dnl ++]) + ++# Old name: ++AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + +-# _LT_AC_FILE_LTDLL_C +-# ------------------- +-# Be careful that the start marker always follows a newline. +-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +-# /* ltdll.c starts here */ +-# #define WIN32_LEAN_AND_MEAN +-# #include +-# #undef WIN32_LEAN_AND_MEAN +-# #include +-# +-# #ifndef __CYGWIN__ +-# # ifdef __CYGWIN32__ +-# # define __CYGWIN__ __CYGWIN32__ +-# # endif +-# #endif +-# +-# #ifdef __cplusplus +-# extern "C" { +-# #endif +-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +-# #ifdef __cplusplus +-# } +-# #endif +-# +-# #ifdef __CYGWIN__ +-# #include +-# DECLARE_CYGWIN_DLL( DllMain ); +-# #endif +-# HINSTANCE __hDllInstance_base; +-# +-# BOOL APIENTRY +-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +-# { +-# __hDllInstance_base = hInst; +-# return TRUE; +-# } +-# /* ltdll.c ends here */ +-])# _LT_AC_FILE_LTDLL_C + ++# LT_PROG_RC ++# ---------- ++AC_DEFUN([LT_PROG_RC], ++[AC_CHECK_TOOL(RC, windres,) ++]) + +-# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +-# --------------------------------- +-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) ++# Old name: ++AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +-# old names +-AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +-AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +-AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +-AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +-AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) +- +-# This is just to silence aclocal about the macro not being used +-ifelse([AC_DISABLE_FAST_INSTALL]) +- +-AC_DEFUN([LT_AC_PROG_GCJ], +-[AC_CHECK_TOOL(GCJ, gcj, no) +- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" +- AC_SUBST(GCJFLAGS) ++# _LT_DECL_EGREP ++# -------------- ++# If we don't have a new enough Autoconf to choose the best grep ++# available, choose the one first in the user's PATH. ++m4_defun([_LT_DECL_EGREP], ++[AC_REQUIRE([AC_PROG_EGREP])dnl ++AC_REQUIRE([AC_PROG_FGREP])dnl ++test -z "$GREP" && GREP=grep ++_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) ++_LT_DECL([], [EGREP], [1], [An ERE matcher]) ++_LT_DECL([], [FGREP], [1], [A literal string matcher]) ++dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too ++AC_SUBST([GREP]) + ]) + +-AC_DEFUN([LT_AC_PROG_RC], +-[AC_CHECK_TOOL(RC, windres, no) +-]) + ++# _LT_DECL_SED ++# ------------ ++# Check for a fully-functional sed program, that truncates ++# as few characters as possible. Prefer GNU sed if found. ++m4_defun([_LT_DECL_SED], ++[AC_PROG_SED ++test -z "$SED" && SED=sed ++Xsed="$SED -e 1s/^X//" ++_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) ++_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], ++ [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ++])# _LT_DECL_SED ++ ++m4_ifndef([AC_PROG_SED], [ + ############################################################ + # NOTE: This macro has been submitted for inclusion into # + # GNU Autoconf as AC_PROG_SED. When it is available in # + # a released version of Autoconf we should remove this # + # macro and use it instead. # + ############################################################ +-# LT_AC_PROG_SED +-# -------------- +-# Check for a fully-functional sed program, that truncates +-# as few characters as possible. Prefer GNU sed if found. +-AC_DEFUN([LT_AC_PROG_SED], ++ ++m4_defun([AC_PROG_SED], + [AC_MSG_CHECKING([for a sed that does not truncate output]) + AC_CACHE_VAL(lt_cv_path_SED, + [# Loop through the user's path and test for sed and gsed. +@@ -6435,6 +7010,7 @@ do + done + done + done ++IFS=$as_save_IFS + lt_ac_max=0 + lt_ac_count=0 + # Add /usr/xpg4/bin/sed as it is typically found on Solaris +@@ -6467,5 +7043,268 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xp + done + ]) + SED=$lt_cv_path_SED ++AC_SUBST([SED]) + AC_MSG_RESULT([$SED]) ++])#AC_PROG_SED ++])#m4_ifndef ++ ++# Old name: ++AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) ++dnl aclocal-1.4 backwards compatibility: ++dnl AC_DEFUN([LT_AC_PROG_SED], []) ++ ++ ++# _LT_CHECK_SHELL_FEATURES ++# ------------------------ ++# Find out whether the shell is Bourne or XSI compatible, ++# or has some other useful features. ++m4_defun([_LT_CHECK_SHELL_FEATURES], ++[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) ++# Try some XSI features ++xsi_shell=no ++( _lt_dummy="a/b/c" ++ test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ ++ = c,a/b,, \ ++ && eval 'test $(( 1 + 1 )) -eq 2 \ ++ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ ++ && xsi_shell=yes ++AC_MSG_RESULT([$xsi_shell]) ++_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) ++ ++AC_MSG_CHECKING([whether the shell understands "+="]) ++lt_shell_append=no ++( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ ++ >/dev/null 2>&1 \ ++ && lt_shell_append=yes ++AC_MSG_RESULT([$lt_shell_append]) ++_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) ++ ++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then ++ lt_unset=unset ++else ++ lt_unset=false ++fi ++_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl ++ ++# test EBCDIC or ASCII ++case `echo X|tr X '\101'` in ++ A) # ASCII based system ++ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr ++ lt_SP2NL='tr \040 \012' ++ lt_NL2SP='tr \015\012 \040\040' ++ ;; ++ *) # EBCDIC based system ++ lt_SP2NL='tr \100 \n' ++ lt_NL2SP='tr \r\n \100\100' ++ ;; ++esac ++_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl ++_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ++])# _LT_CHECK_SHELL_FEATURES ++ ++ ++# _LT_PROG_XSI_SHELLFNS ++# --------------------- ++# Bourne and XSI compatible variants of some useful shell functions. ++m4_defun([_LT_PROG_XSI_SHELLFNS], ++[case $xsi_shell in ++ yes) ++ cat << \_LT_EOF >> "$cfgfile" ++ ++# func_dirname file append nondir_replacement ++# Compute the dirname of FILE. If nonempty, add APPEND to the result, ++# otherwise set result to NONDIR_REPLACEMENT. ++func_dirname () ++{ ++ case ${1} in ++ */*) func_dirname_result="${1%/*}${2}" ;; ++ * ) func_dirname_result="${3}" ;; ++ esac ++} ++ ++# func_basename file ++func_basename () ++{ ++ func_basename_result="${1##*/}" ++} ++ ++# func_dirname_and_basename file append nondir_replacement ++# perform func_basename and func_dirname in a single function ++# call: ++# dirname: Compute the dirname of FILE. If nonempty, ++# add APPEND to the result, otherwise set result ++# to NONDIR_REPLACEMENT. ++# value returned in "$func_dirname_result" ++# basename: Compute filename of FILE. ++# value retuned in "$func_basename_result" ++# Implementation must be kept synchronized with func_dirname ++# and func_basename. For efficiency, we do not delegate to ++# those functions but instead duplicate the functionality here. ++func_dirname_and_basename () ++{ ++ case ${1} in ++ */*) func_dirname_result="${1%/*}${2}" ;; ++ * ) func_dirname_result="${3}" ;; ++ esac ++ func_basename_result="${1##*/}" ++} ++ ++# func_stripname prefix suffix name ++# strip PREFIX and SUFFIX off of NAME. ++# PREFIX and SUFFIX must not contain globbing or regex special ++# characters, hashes, percent signs, but SUFFIX may contain a leading ++# dot (in which case that matches only a dot). ++func_stripname () ++{ ++ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are ++ # positional parameters, so assign one to ordinary parameter first. ++ func_stripname_result=${3} ++ func_stripname_result=${func_stripname_result#"${1}"} ++ func_stripname_result=${func_stripname_result%"${2}"} ++} ++ ++# func_opt_split ++func_opt_split () ++{ ++ func_opt_split_opt=${1%%=*} ++ func_opt_split_arg=${1#*=} ++} ++ ++# func_lo2o object ++func_lo2o () ++{ ++ case ${1} in ++ *.lo) func_lo2o_result=${1%.lo}.${objext} ;; ++ *) func_lo2o_result=${1} ;; ++ esac ++} ++ ++# func_xform libobj-or-source ++func_xform () ++{ ++ func_xform_result=${1%.*}.lo ++} ++ ++# func_arith arithmetic-term... ++func_arith () ++{ ++ func_arith_result=$(( $[*] )) ++} ++ ++# func_len string ++# STRING may not start with a hyphen. ++func_len () ++{ ++ func_len_result=${#1} ++} ++ ++_LT_EOF ++ ;; ++ *) # Bourne compatible functions. ++ cat << \_LT_EOF >> "$cfgfile" ++ ++# func_dirname file append nondir_replacement ++# Compute the dirname of FILE. If nonempty, add APPEND to the result, ++# otherwise set result to NONDIR_REPLACEMENT. ++func_dirname () ++{ ++ # Extract subdirectory from the argument. ++ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` ++ if test "X$func_dirname_result" = "X${1}"; then ++ func_dirname_result="${3}" ++ else ++ func_dirname_result="$func_dirname_result${2}" ++ fi ++} ++ ++# func_basename file ++func_basename () ++{ ++ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` ++} ++ ++dnl func_dirname_and_basename ++dnl A portable version of this function is already defined in general.m4sh ++dnl so there is no need for it here. ++ ++# func_stripname prefix suffix name ++# strip PREFIX and SUFFIX off of NAME. ++# PREFIX and SUFFIX must not contain globbing or regex special ++# characters, hashes, percent signs, but SUFFIX may contain a leading ++# dot (in which case that matches only a dot). ++# func_strip_suffix prefix name ++func_stripname () ++{ ++ case ${2} in ++ .*) func_stripname_result=`$ECHO "X${3}" \ ++ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; ++ *) func_stripname_result=`$ECHO "X${3}" \ ++ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; ++ esac ++} ++ ++# sed scripts: ++my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' ++my_sed_long_arg='1s/^-[[^=]]*=//' ++ ++# func_opt_split ++func_opt_split () ++{ ++ func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` ++ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` ++} ++ ++# func_lo2o object ++func_lo2o () ++{ ++ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` ++} ++ ++# func_xform libobj-or-source ++func_xform () ++{ ++ func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` ++} ++ ++# func_arith arithmetic-term... ++func_arith () ++{ ++ func_arith_result=`expr "$[@]"` ++} ++ ++# func_len string ++# STRING may not start with a hyphen. ++func_len () ++{ ++ func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` ++} ++ ++_LT_EOF ++esac ++ ++case $lt_shell_append in ++ yes) ++ cat << \_LT_EOF >> "$cfgfile" ++ ++# func_append var value ++# Append VALUE to the end of shell variable VAR. ++func_append () ++{ ++ eval "$[1]+=\$[2]" ++} ++_LT_EOF ++ ;; ++ *) ++ cat << \_LT_EOF >> "$cfgfile" ++ ++# func_append var value ++# Append VALUE to the end of shell variable VAR. ++func_append () ++{ ++ eval "$[1]=\$$[1]\$[2]" ++} ++ ++_LT_EOF ++ ;; ++ esac + ]) diff --git a/libs/libiconv-full/patches/103-configure_ac_fix.patch b/libs/libiconv-full/patches/103-configure_ac_fix.patch new file mode 100644 index 0000000..d57ae84 --- /dev/null +++ b/libs/libiconv-full/patches/103-configure_ac_fix.patch @@ -0,0 +1,31 @@ +--- /dev/null ++++ b/Makefile.am +@@ -0,0 +1,2 @@ ++ACLOCAL_AMFLAGS = -I m4 ++SUBDIRS = . +--- /dev/null ++++ b/libcharset/Makefile.am +@@ -0,0 +1 @@ ++ACLOCAL_AMFLAGS = -I m4 +--- a/configure.ac ++++ b/configure.ac +@@ -54,7 +54,7 @@ AC_ISC_POSIX + + dnl checks for installer options + +-AC_RELOCATABLE ++gl_RELOCATABLE + + AC_ARG_ENABLE([extra-encodings], + [AC_HELP_STRING([--enable-extra-encodings], +--- a/libcharset/configure.ac ++++ b/libcharset/configure.ac +@@ -41,7 +41,7 @@ AC_CANONICAL_HOST + + dnl checks for installer options + +-AC_RELOCATABLE_LIBRARY ++gl_RELOCATABLE_LIBRARY + + dnl checks for programs + diff --git a/libs/libiconv-full/patches/200-work-with-libtool2.patch b/libs/libiconv-full/patches/200-work-with-libtool2.patch new file mode 100644 index 0000000..6e31967 --- /dev/null +++ b/libs/libiconv-full/patches/200-work-with-libtool2.patch @@ -0,0 +1,17 @@ +Make iconv 1.11.x link correctly with libtool2 - argument "-Xcompiler" ensures "-shared" is passed to $(CC) when used as linker. Otherwise $(CC) tries to create an executable and fails while looking for a main()-function + +diff -ruN libiconv-1.11.1/lib/Makefile.in libiconv-1.11.1.mod/lib/Makefile.in +--- libiconv-1.11.1/lib/Makefile.in 2006-07-14 15:18:42.000000000 +0200 ++++ libiconv-1.11.1.mod/lib/Makefile.in 2010-12-01 20:47:57.000000000 +0100 +@@ -70,9 +70,9 @@ + + preloadable_libiconv_linux.so : $(SOURCES) + if test -n "@GCC@"; then \ +- $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -fPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -shared -o preloadable_libiconv_linux.so; \ ++ $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -fPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -Xcompiler -shared -o preloadable_libiconv_linux.so; \ + else \ +- $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -KPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -shared -o preloadable_libiconv_linux.so; \ ++ $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -KPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -Xcompiler -shared -o preloadable_libiconv_linux.so; \ + fi + + preloadable_libiconv_solaris.so : $(SOURCES) diff --git a/libs/libiconv/COPYING b/libs/libiconv/COPYING new file mode 100644 index 0000000..223ede7 --- /dev/null +++ b/libs/libiconv/COPYING @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/libs/libiconv/COPYRIGHT b/libs/libiconv/COPYRIGHT new file mode 100644 index 0000000..d228af3 --- /dev/null +++ b/libs/libiconv/COPYRIGHT @@ -0,0 +1,20 @@ +Copyright status on all included code: + +All files which have no copyright comments are original works +Copyright (C) 2005-2006 Rich Felker. The decision to exclude such +comments is intentional, as it should be possible to carry around the +complete source code on tiny storage media. All public header files +(include/*) should be treated as Public Domain as they intentionally +contain no content which can be covered by copyright. Some source +modules may fall in this category as well. If you believe that a file +is so trivial that it should be in the Public Domain, please contact +me and, if I agree, I will explicitly release it from copyright. + +Some code has been modified by the OpenWrt project, this includes +the conversion from char map files to C arrays and the iconv.h header +file in particular. + +The library as a whole is licensed under the GNU LGPL version 2.1. +See the file COPYING for the text of this license. + +The original source can be accessed at svn://svn.mplayerhq.hu/libc/trunk diff --git a/libs/libiconv/Makefile b/libs/libiconv/Makefile new file mode 100644 index 0000000..be8bc25 --- /dev/null +++ b/libs/libiconv/Makefile @@ -0,0 +1,79 @@ +# +# Copyright (C) 2010-2012 OpenWrt.org +# +# This Makefile and the code shipped in src/ is free software, licensed +# under the GNU Lesser General Public License, version 2.1 and later. +# See src/COPYING for more information. +# +# Refer to src/COPYRIGHT for copyright statements on the source files. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libiconv +PKG_RELEASE:=7 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk + +define Package/libiconv + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Tiny drop-in replacement for the GNU Character set conversion library +endef + +define Build/Prepare + $(INSTALL_DIR) $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Build/Configure +endef + +define Build/Compile + $(TARGET_CC) -c $(PKG_BUILD_DIR)/iconv.c -o $(PKG_BUILD_DIR)/iconv.o -I$(PKG_BUILD_DIR)/include $(FPIC) + $(TARGET_CROSS)ar rcs $(PKG_BUILD_DIR)/libiconv.a $(PKG_BUILD_DIR)/iconv.o +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib/libiconv-stub/lib + $(INSTALL_DATA) $(PKG_BUILD_DIR)/libiconv.a $(1)/usr/lib/libiconv-stub/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/libiconv-stub/include + $(INSTALL_DATA) $(PKG_BUILD_DIR)/include/iconv.h $(1)/usr/lib/libiconv-stub/include/ + + $(INSTALL_DIR) $(1)/usr/share/aclocal + $(INSTALL_DATA) $(PKG_BUILD_DIR)/m4/* $(1)/usr/share/aclocal/ +endef + +define Package/libiconv/install + $(INSTALL_DIR) $(1)/tmp + touch $(1)/tmp/.libiconv-placeholder +endef + +define Host/Prepare + mkdir -p $(HOST_BUILD_DIR) +endef + +define Host/Configure + +endef + +define Host/Compile + $(HOSTCC) -c src/iconv.c -o $(HOST_BUILD_DIR)/iconv.o -Isrc/include -fPIC + ar rcs $(HOST_BUILD_DIR)/libiconv.a $(HOST_BUILD_DIR)/iconv.o +endef + +define Host/Install + $(INSTALL_DIR) $(STAGING_DIR_HOST)/lib + $(INSTALL_DATA) $(HOST_BUILD_DIR)/libiconv.a $(STAGING_DIR_HOST)/lib/ + + $(INSTALL_DIR) $(STAGING_DIR_HOST)/include + $(INSTALL_DATA) ./src/include/iconv.h $(STAGING_DIR_HOST)/include/ + + $(INSTALL_DIR) $(STAGING_DIR_HOST)/share/aclocal + $(INSTALL_DATA) ./src/m4/* $(STAGING_DIR_HOST)/share/aclocal/ +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,libiconv)) diff --git a/libs/libiconv/src/iconv.c b/libs/libiconv/src/iconv.c new file mode 100644 index 0000000..cb4e947 --- /dev/null +++ b/libs/libiconv/src/iconv.c @@ -0,0 +1,440 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +/* builtin charmaps */ +#include "charmaps.h" + +/* only 0-7 are valid as dest charset */ +#define UTF_16BE 000 +#define UTF_16LE 001 +#define UTF_32BE 002 +#define UTF_32LE 003 +#define WCHAR_T 004 +#define UTF_8 005 +#define US_ASCII 006 +#define LATIN_1 007 + +/* additional charsets with algorithmic conversion */ +#define LATIN_9 010 +#define TIS_620 011 +#define JIS_0201 012 + +/* some programs like php need this */ +int _libiconv_version = _LIBICONV_VERSION; + +/* these must match the constants above */ +static const unsigned char charsets[] = + "\005" "UTF-8" "\0" + "\004" "WCHAR_T" "\0" + "\000" "UTF-16BE" "\0" + "\001" "UTF-16LE" "\0" + "\002" "UTF-32BE" "\0" + "\003" "UTF-32LE" "\0" + "\006" "ASCII" "\0" + "\006" "US-ASCII" "\0" + "\007" "ISO-8859-1" "\0" + "\007" "LATIN1" "\0" + "\010" "ISO-8859-15""\0" + "\010" "LATIN9" "\0" + "\011" "ISO-8859-11""\0" + "\011" "TIS-620" "\0" + "\012" "JIS-0201" "\0" + "\377"; + +/* separate identifiers for sbcs/dbcs/etc map type */ +#define UCS2_8BIT 000 +#define UCS3_8BIT 001 +#define EUC 002 +#define EUC_TW 003 +#define SHIFT_JIS 004 +#define BIG5 005 +#define GBK 006 + +/* FIXME: these are not implemented yet +// EUC: A1-FE A1-FE +// GBK: 81-FE 40-7E,80-FE +// Big5: A1-FE 40-7E,A1-FE +*/ + +static const unsigned short maplen[] = { + [UCS2_8BIT] = 4+ 2* 128, + [UCS3_8BIT] = 4+ 3* 128, + [EUC] = 4+ 2* 94*94, + [SHIFT_JIS] = 4+ 2* 94*94, + [BIG5] = 4+ 2* 94*157, + [GBK] = 4+ 2* 126*190, + [EUC_TW] = 4+ 2* 2*94*94, +}; + +static int find_charmap(const char *name) +{ + int i; + for (i = 0; i < (sizeof(charmaps) / sizeof(charmaps[0])); i++) + if (!strcasecmp(charmaps[i].name, name)) + return i; + return -1; +} + +static int find_charset(const char *name) +{ + const unsigned char *s; + for (s=charsets; *s<0xff && strcasecmp(s+1, name); s+=strlen(s)+1); + return *s; +} + +iconv_t iconv_open(const char *to, const char *from) +{ + unsigned f, t; + int m; + + if ((t = find_charset(to)) > 8) + return -1; + + if ((f = find_charset(from)) < 255) + return 0 | (t<<1) | (f<<8); + + if ((m = find_charmap(from)) > -1) + return 1 | (t<<1) | (m<<8); + + return -1; +} + +int iconv_close(iconv_t cd) +{ + return 0; +} + +static inline wchar_t get_16(const unsigned char *s, int endian) +{ + endian &= 1; + return s[endian]<<8 | s[endian^1]; +} + +static inline void put_16(unsigned char *s, wchar_t c, int endian) +{ + endian &= 1; + s[endian] = c>>8; + s[endian^1] = c; +} + +static inline int utf8enc_wchar(char *outb, wchar_t c) +{ + if (c <= 0x7F) { + *outb = c; + return 1; + } + else if (c <= 0x7FF) { + *outb++ = ((c >> 6) & 0x1F) | 0xC0; + *outb++ = ( c & 0x3F) | 0x80; + return 2; + } + else if (c <= 0xFFFF) { + *outb++ = ((c >> 12) & 0x0F) | 0xE0; + *outb++ = ((c >> 6) & 0x3F) | 0x80; + *outb++ = ( c & 0x3F) | 0x80; + return 3; + } + else if (c <= 0x10FFFF) { + *outb++ = ((c >> 18) & 0x07) | 0xF0; + *outb++ = ((c >> 12) & 0x3F) | 0x80; + *outb++ = ((c >> 6) & 0x3F) | 0x80; + *outb++ = ( c & 0x3F) | 0x80; + return 4; + } + else { + *outb++ = '?'; + return 1; + } +} + +static inline int utf8seq_is_overlong(char *s, int n) +{ + switch (n) + { + case 2: + /* 1100000x (10xxxxxx) */ + return (((*s >> 1) == 0x60) && + ((*(s+1) >> 6) == 0x02)); + + case 3: + /* 11100000 100xxxxx (10xxxxxx) */ + return ((*s == 0xE0) && + ((*(s+1) >> 5) == 0x04) && + ((*(s+2) >> 6) == 0x02)); + + case 4: + /* 11110000 1000xxxx (10xxxxxx 10xxxxxx) */ + return ((*s == 0xF0) && + ((*(s+1) >> 4) == 0x08) && + ((*(s+2) >> 6) == 0x02) && + ((*(s+3) >> 6) == 0x02)); + } + + return 0; +} + +static inline int utf8seq_is_surrogate(char *s, int n) +{ + return ((n == 3) && (*s == 0xED) && (*(s+1) >= 0xA0) && (*(s+1) <= 0xBF)); +} + +static inline int utf8seq_is_illegal(char *s, int n) +{ + return ((n == 3) && (*s == 0xEF) && (*(s+1) == 0xBF) && + (*(s+2) >= 0xBE) && (*(s+2) <= 0xBF)); +} + +static inline int utf8dec_wchar(wchar_t *c, unsigned char *in, size_t inb) +{ + int i; + int n = -1; + + /* trivial char */ + if (*in <= 0x7F) { + *c = *in; + return 1; + } + + /* find utf8 sequence length */ + if ((*in & 0xE0) == 0xC0) n = 2; + else if ((*in & 0xF0) == 0xE0) n = 3; + else if ((*in & 0xF8) == 0xF0) n = 4; + else if ((*in & 0xFC) == 0xF8) n = 5; + else if ((*in & 0xFE) == 0xFC) n = 6; + + /* starved? */ + if (n > inb) + return -2; + + /* decode ... */ + if (n > 1 && n < 5) { + /* reject invalid sequences */ + if (utf8seq_is_overlong(in, n) || + utf8seq_is_surrogate(in, n) || + utf8seq_is_illegal(in, n)) + return -1; + + /* decode ... */ + *c = (char)(*in++ & (0x7F >> n)); + + for (i = 1; i < n; i++) { + /* illegal continuation byte */ + if (*in < 0x80 || *in > 0xBF) + return -1; + + *c = (*c << 6) | (*in++ & 0x3F); + } + + return n; + } + + /* unmapped sequence (> 4) */ + return -1; +} + +static inline char latin9_translit(wchar_t c) +{ + /* a number of trivial iso-8859-15 <> utf-8 transliterations */ + switch (c) { + case 0x20AC: return 0xA4; /* Euro */ + case 0x0160: return 0xA6; /* S caron */ + case 0x0161: return 0xA8; /* s caron */ + case 0x017D: return 0xB4; /* Z caron */ + case 0x017E: return 0xB8; /* z caron */ + case 0x0152: return 0xBC; /* OE */ + case 0x0153: return 0xBD; /* oe */ + case 0x0178: return 0xBE; /* Y diaeresis */ + default: return '?'; + } +} + +size_t iconv(iconv_t cd, char **in, size_t *inb, char **out, size_t *outb) +{ + size_t x=0; + unsigned char to = (cd>>1)&127; + unsigned char from = 255; + const unsigned char *map = 0; + char tmp[MB_LEN_MAX]; + wchar_t c, d; + size_t k, l; + int err; + + if (!in || !*in || !*inb) return 0; + + if (cd & 1) + map = charmaps[cd>>8].map; + else + from = cd>>8; + + for (; *inb; *in+=l, *inb-=l) { + c = *(unsigned char *)*in; + l = 1; + if (from >= UTF_8 && c < 0x80) goto charok; + switch (from) { + case WCHAR_T: + l = sizeof(wchar_t); + if (*inb < l) goto starved; + c = *(wchar_t *)*in; + break; + case UTF_8: + l = utf8dec_wchar(&c, *in, *inb); + if (!l) l++; + else if (l == (size_t)-1) goto ilseq; + else if (l == (size_t)-2) goto starved; + break; + case US_ASCII: + goto ilseq; + case LATIN_9: + if ((unsigned)c - 0xa4 <= 0xbe - 0xa4) { + static const unsigned char map[] = { + 0, 0x60, 0, 0x61, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0x7d, 0, 0, 0, 0x7e, 0, 0, 0, + 0x52, 0x53, 0x78 + }; + if (c == 0xa4) c = 0x20ac; + else if (map[c-0xa5]) c = 0x100 | map[c-0xa5]; + } + case LATIN_1: + goto charok; + case TIS_620: + if (c >= 0xa1) c += 0x0e01-0xa1; + goto charok; + case JIS_0201: + if (c >= 0xa1) { + if (c <= 0xdf) c += 0xff61-0xa1; + else goto ilseq; + } + goto charok; + case UTF_16BE: + case UTF_16LE: + l = 2; + if (*inb < 2) goto starved; + c = get_16(*in, from); + if ((unsigned)(c-0xdc00) < 0x400) goto ilseq; + if ((unsigned)(c-0xd800) < 0x400) { + l = 4; + if (*inb < 4) goto starved; + d = get_16(*in + 2, from); + if ((unsigned)(c-0xdc00) >= 0x400) goto ilseq; + c = ((c-0xd800)<<10) | (d-0xdc00); + } + break; + case UTF_32BE: + case UTF_32LE: + l = 4; + if (*inb < 4) goto starved; + // FIXME + // c = get_32(*in, from); + break; + default: + /* only support ascii supersets */ + if (c < 0x80) break; + switch (map[0]) { + case UCS2_8BIT: + c -= 0x80; + break; + case EUC: + if ((unsigned)c - 0xa1 >= 94) goto ilseq; + if ((unsigned)in[0][1] - 0xa1 >= 94) goto ilseq; + c = (c-0xa1)*94 + (in[0][1]-0xa1); + l = 2; + break; + case SHIFT_JIS: + if ((unsigned)c - 0xa1 <= 0xdf-0xa1) { + c += 0xff61-0xa1; + goto charok; + } + // FIXME... + l = 2; + break; + default: + goto badf; + } + c = get_16(map + 4 + 2*c, 0); + if (c == 0xffff) goto ilseq; + goto charok; + } + + if ((unsigned)c - 0xd800 < 0x800 || (unsigned)c >= 0x110000) + goto ilseq; +charok: + switch (to) { + case WCHAR_T: + if (*outb < sizeof(wchar_t)) goto toobig; + *(wchar_t *)*out = c; + *out += sizeof(wchar_t); + *outb -= sizeof(wchar_t); + break; + case UTF_8: + if (*outb < 4) { + k = utf8enc_wchar(tmp, c); + if (*outb < k) goto toobig; + memcpy(*out, tmp, k); + } else k = utf8enc_wchar(*out, c); + *out += k; + *outb -= k; + break; + case US_ASCII: + if (c > 0x7f) c = 0xfffd; + /* fall thru and count replacement in latin1 case */ + case LATIN_9: + if (c >= 0x100 && c != 0xfffd) + c = latin9_translit(c); + /* fall through */ + case LATIN_1: + if (!*outb) goto toobig; + if (c < 0x100) **out = c; + else x++, **out = '*'; //FIXME: translit? + ++*out; + --*outb; + break; + case UTF_16BE: + case UTF_16LE: + if (c < 0x10000) { + if (*outb < 2) goto toobig; + put_16(*out, c, to); + *out += 2; + *outb -= 2; + break; + } + if (*outb < 4) goto toobig; + put_16(*out, (c>>10)|0xd800, to); + put_16(*out + 2, (c&0x3ff)|0xdc00, to); + *out += 4; + *outb -= 4; + break; + default: + goto badf; + } + } + return x; +ilseq: + err = EILSEQ; + x = -1; + goto end; +badf: + err = EBADF; + x = -1; + goto end; +toobig: + err = E2BIG; + x = -1; + goto end; +starved: + err = EINVAL; +end: + errno = err; + return x; +} diff --git a/libs/libiconv/src/include/charmaps.h b/libs/libiconv/src/include/charmaps.h new file mode 100644 index 0000000..083cd69 --- /dev/null +++ b/libs/libiconv/src/include/charmaps.h @@ -0,0 +1,80 @@ +#include "charmaps/iso-8859-2.h" +#include "charmaps/iso-8859-10.h" +#include "charmaps/windows-874.h" +#include "charmaps/windows-1250.h" +#include "charmaps/koi8-r.h" + +#ifdef ALL_CHARSETS +#include "charmaps/iso-8859-3.h" +#include "charmaps/iso-8859-4.h" +#include "charmaps/iso-8859-5.h" +#include "charmaps/iso-8859-6.h" +#include "charmaps/iso-8859-7.h" +#include "charmaps/iso-8859-8.h" +#include "charmaps/iso-8859-9.h" +#include "charmaps/iso-8859-13.h" +#include "charmaps/iso-8859-14.h" +#include "charmaps/iso-8859-16.h" +#include "charmaps/windows-1251.h" +#include "charmaps/windows-1252.h" +#include "charmaps/windows-1253.h" +#include "charmaps/windows-1254.h" +#include "charmaps/windows-1255.h" +#include "charmaps/windows-1256.h" +#include "charmaps/windows-1257.h" +#include "charmaps/windows-1258.h" +#endif + + +struct charmap { + const char name[13]; + const unsigned char *map; +}; + +static struct charmap charmaps[] = { + { "ISO-8859-2", map_iso_8859_2 }, + { "ISO-8859-10", map_iso_8859_10 }, + +#ifdef ALL_CHARSETS + { "ISO-8859-3", map_iso_8859_3 }, + { "ISO-8859-4", map_iso_8859_4 }, + { "ISO-8859-5", map_iso_8859_5 }, + { "ISO-8859-6", map_iso_8859_6 }, + { "ISO-8859-7", map_iso_8859_7 }, + { "ISO-8859-8", map_iso_8859_8 }, + { "ISO-8859-9", map_iso_8859_9 }, + { "ISO-8859-13", map_iso_8859_13 }, + { "ISO-8859-14", map_iso_8859_14 }, + { "ISO-8859-16", map_iso_8859_16 }, +#endif + + { "WINDOWS-874", map_windows_874 }, + { "WINDOWS-1250", map_windows_1250 }, + +#ifdef ALL_CHARSETS + { "WINDOWS-1251", map_windows_1251 }, + { "WINDOWS-1252", map_windows_1252 }, + { "WINDOWS-1253", map_windows_1253 }, + { "WINDOWS-1254", map_windows_1254 }, + { "WINDOWS-1255", map_windows_1255 }, + { "WINDOWS-1256", map_windows_1256 }, + { "WINDOWS-1257", map_windows_1257 }, + { "WINDOWS-1258", map_windows_1258 }, +#endif + + { "KOI8-R", map_koi8_r }, + + /* Aliases */ + { "LATIN2", map_iso_8859_2 }, + { "LATIN6", map_iso_8859_10 }, + +#ifdef ALL_CHARSETS + { "ARABIC", map_iso_8859_6 }, + { "CYRILLIC", map_iso_8859_5 }, + { "GREEK", map_iso_8859_7 }, + { "HEBREW", map_iso_8859_8 }, + { "LATIN3", map_iso_8859_3 }, + { "LATIN4", map_iso_8859_4 }, + { "LATIN5", map_iso_8859_9 }, +#endif +}; diff --git a/libs/libiconv/src/include/charmaps/iso-8859-10.h b/libs/libiconv/src/include/charmaps/iso-8859-10.h new file mode 100644 index 0000000..cb93d02 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/iso-8859-10.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_10[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x01, 0x04, + 0x01, 0x12, 0x01, 0x22, 0x01, 0x2a, 0x01, 0x28, 0x01, 0x36, 0x00, 0xa7, + 0x01, 0x3b, 0x01, 0x10, 0x01, 0x60, 0x01, 0x66, 0x01, 0x7d, 0x00, 0xad, + 0x01, 0x6a, 0x01, 0x4a, 0x00, 0xb0, 0x01, 0x05, 0x01, 0x13, 0x01, 0x23, + 0x01, 0x2b, 0x01, 0x29, 0x01, 0x37, 0x00, 0xb7, 0x01, 0x3c, 0x01, 0x11, + 0x01, 0x61, 0x01, 0x67, 0x01, 0x7e, 0x20, 0x15, 0x01, 0x6b, 0x01, 0x4b, + 0x01, 0x00, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xc3, 0x00, 0xc4, 0x00, 0xc5, + 0x00, 0xc6, 0x01, 0x2e, 0x01, 0x0c, 0x00, 0xc9, 0x01, 0x18, 0x00, 0xcb, + 0x01, 0x16, 0x00, 0xcd, 0x00, 0xce, 0x00, 0xcf, 0x00, 0xd0, 0x01, 0x45, + 0x01, 0x4c, 0x00, 0xd3, 0x00, 0xd4, 0x00, 0xd5, 0x00, 0xd6, 0x01, 0x68, + 0x00, 0xd8, 0x01, 0x72, 0x00, 0xda, 0x00, 0xdb, 0x00, 0xdc, 0x00, 0xdd, + 0x00, 0xde, 0x00, 0xdf, 0x01, 0x01, 0x00, 0xe1, 0x00, 0xe2, 0x00, 0xe3, + 0x00, 0xe4, 0x00, 0xe5, 0x00, 0xe6, 0x01, 0x2f, 0x01, 0x0d, 0x00, 0xe9, + 0x01, 0x19, 0x00, 0xeb, 0x01, 0x17, 0x00, 0xed, 0x00, 0xee, 0x00, 0xef, + 0x00, 0xf0, 0x01, 0x46, 0x01, 0x4d, 0x00, 0xf3, 0x00, 0xf4, 0x00, 0xf5, + 0x00, 0xf6, 0x01, 0x69, 0x00, 0xf8, 0x01, 0x73, 0x00, 0xfa, 0x00, 0xfb, + 0x00, 0xfc, 0x00, 0xfd, 0x00, 0xfe, 0x01, 0x38 +}; diff --git a/libs/libiconv/src/include/charmaps/iso-8859-13.h b/libs/libiconv/src/include/charmaps/iso-8859-13.h new file mode 100644 index 0000000..b44d1b4 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/iso-8859-13.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_13[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x20, 0x1d, + 0x00, 0xa2, 0x00, 0xa3, 0x00, 0xa4, 0x20, 0x1e, 0x00, 0xa6, 0x00, 0xa7, + 0x00, 0xd8, 0x00, 0xa9, 0x01, 0x56, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, + 0x00, 0xae, 0x00, 0xc6, 0x00, 0xb0, 0x00, 0xb1, 0x00, 0xb2, 0x00, 0xb3, + 0x20, 0x1c, 0x00, 0xb5, 0x00, 0xb6, 0x00, 0xb7, 0x00, 0xf8, 0x00, 0xb9, + 0x01, 0x57, 0x00, 0xbb, 0x00, 0xbc, 0x00, 0xbd, 0x00, 0xbe, 0x00, 0xe6, + 0x01, 0x04, 0x01, 0x2e, 0x01, 0x00, 0x01, 0x06, 0x00, 0xc4, 0x00, 0xc5, + 0x01, 0x18, 0x01, 0x12, 0x01, 0x0c, 0x00, 0xc9, 0x01, 0x79, 0x01, 0x16, + 0x01, 0x22, 0x01, 0x36, 0x01, 0x2a, 0x01, 0x3b, 0x01, 0x60, 0x01, 0x43, + 0x01, 0x45, 0x00, 0xd3, 0x01, 0x4c, 0x00, 0xd5, 0x00, 0xd6, 0x00, 0xd7, + 0x01, 0x72, 0x01, 0x41, 0x01, 0x5a, 0x01, 0x6a, 0x00, 0xdc, 0x01, 0x7b, + 0x01, 0x7d, 0x00, 0xdf, 0x01, 0x05, 0x01, 0x2f, 0x01, 0x01, 0x01, 0x07, + 0x00, 0xe4, 0x00, 0xe5, 0x01, 0x19, 0x01, 0x13, 0x01, 0x0d, 0x00, 0xe9, + 0x01, 0x7a, 0x01, 0x17, 0x01, 0x23, 0x01, 0x37, 0x01, 0x2b, 0x01, 0x3c, + 0x01, 0x61, 0x01, 0x44, 0x01, 0x46, 0x00, 0xf3, 0x01, 0x4d, 0x00, 0xf5, + 0x00, 0xf6, 0x00, 0xf7, 0x01, 0x73, 0x01, 0x42, 0x01, 0x5b, 0x01, 0x6b, + 0x00, 0xfc, 0x01, 0x7c, 0x01, 0x7e, 0x20, 0x19 +}; diff --git a/libs/libiconv/src/include/charmaps/iso-8859-14.h b/libs/libiconv/src/include/charmaps/iso-8859-14.h new file mode 100644 index 0000000..76cead9 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/iso-8859-14.h @@ -0,0 +1,25 @@ +static const unsigned char map_iso_8859_14[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x1e, 0x02, + 0x1e, 0x03, 0x00, 0xa3, 0x01, 0x0a, 0x01, 0x0b, 0x1e, 0x0a, 0x00, 0xa7, + 0x1e, 0x80, 0x00, 0xa9, 0x1e, 0x82, 0x1e, 0x0b, 0x1e, 0xf2, 0x00, 0xad, + 0x00, 0xae, 0x01, 0x78, 0x1e, 0x1e, 0x1e, 0x1f, 0x01, 0x20, 0x01, 0x21, + 0x1e, 0x40, 0x1e, 0x41, 0x00, 0xb6, 0x1e, 0x56, 0x1e, 0x81, 0x1e, 0x57, + 0x1e, 0x83, 0x1e, 0x60, 0x1e, 0xf3, 0x1e, 0x84, 0x1e, 0x85, 0x1e, 0x61, + 0x00, 0xc0, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xc3, 0x00, 0xc4, 0x00, 0xc5, + 0x00, 0xc6, 0x00, 0xc7, 0x00, 0xc8, 0x00, 0xc9, 0x00, 0xca, 0x00, 0xcb, + 0x00, 0xcc, 0x00, 0xcd, 0x00, 0xce, 0x00, 0xcf, 0x01, 0x74, 0x00, 0xd1, + 0x00, 0xd2, 0x00, 0xd3, 0x00, 0xd4, 0x00, 0xd5, 0x00, 0xd6, 0x1e, 0x6a, + 0x00, 0xd8, 0x00, 0xd9, 0x00, 0xda, 0x00, 0xdb, 0x00, 0xdc, 0x00, 0xdd, + 0x01, 0x76, 0x00, 0xdf, 0x00, 0xe0, 0x00, 0xe1, 0x00, 0xe2, 0x00, 0xe3, + 0x00, 0xe4, 0x00, 0xe5, 0x00, 0xe6, 0x00, 0xe7, 0x00, 0xe8, 0x00, 0xe9, + 0x00, 0xea, 0x00, 0xeb, 0x00, 0xec, 0x00, 0xed, 0x00, 0xee, 0x00, 0xef, + 0x01, 0x75, 0x00, 0xf1, 0x00, 0xf2, 0x00, 0xf3, 0x00, 0xf4, 0x00, 0xf5, + 0x00, 0xf6, 0x1e, 0x6b, 0x00, 0xf8, 0x00, 0xf9, 0x00, 0xfa, 0x00, 0xfb, + 0x00, 0xfc, 0x00, 0xfd, 0x01, 0x77, 0x00, 0xff +}; + diff --git a/libs/libiconv/src/include/charmaps/iso-8859-16.h b/libs/libiconv/src/include/charmaps/iso-8859-16.h new file mode 100644 index 0000000..4437a41 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/iso-8859-16.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_16[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x01, 0x04, + 0x01, 0x05, 0x01, 0x41, 0x20, 0xac, 0x20, 0x1e, 0x01, 0x60, 0x00, 0xa7, + 0x01, 0x61, 0x00, 0xa9, 0x02, 0x18, 0x00, 0xab, 0x01, 0x79, 0x00, 0xad, + 0x01, 0x7a, 0x01, 0x7b, 0x00, 0xb0, 0x00, 0xb1, 0x01, 0x0c, 0x01, 0x42, + 0x01, 0x7d, 0x20, 0x1d, 0x00, 0xb6, 0x00, 0xb7, 0x01, 0x7e, 0x01, 0x0d, + 0x02, 0x19, 0x00, 0xbb, 0x01, 0x52, 0x01, 0x53, 0x01, 0x78, 0x01, 0x7c, + 0x00, 0xc0, 0x00, 0xc1, 0x00, 0xc2, 0x01, 0x02, 0x00, 0xc4, 0x01, 0x06, + 0x00, 0xc6, 0x00, 0xc7, 0x00, 0xc8, 0x00, 0xc9, 0x00, 0xca, 0x00, 0xcb, + 0x00, 0xcc, 0x00, 0xcd, 0x00, 0xce, 0x00, 0xcf, 0x01, 0x10, 0x01, 0x43, + 0x00, 0xd2, 0x00, 0xd3, 0x00, 0xd4, 0x01, 0x50, 0x00, 0xd6, 0x01, 0x5a, + 0x01, 0x70, 0x00, 0xd9, 0x00, 0xda, 0x00, 0xdb, 0x00, 0xdc, 0x01, 0x18, + 0x02, 0x1a, 0x00, 0xdf, 0x00, 0xe0, 0x00, 0xe1, 0x00, 0xe2, 0x01, 0x03, + 0x00, 0xe4, 0x01, 0x07, 0x00, 0xe6, 0x00, 0xe7, 0x00, 0xe8, 0x00, 0xe9, + 0x00, 0xea, 0x00, 0xeb, 0x00, 0xec, 0x00, 0xed, 0x00, 0xee, 0x00, 0xef, + 0x01, 0x11, 0x01, 0x44, 0x00, 0xf2, 0x00, 0xf3, 0x00, 0xf4, 0x01, 0x51, + 0x00, 0xf6, 0x01, 0x5b, 0x01, 0x71, 0x00, 0xf9, 0x00, 0xfa, 0x00, 0xfb, + 0x00, 0xfc, 0x01, 0x19, 0x02, 0x1b, 0x00, 0xff +}; diff --git a/libs/libiconv/src/include/charmaps/iso-8859-2.h b/libs/libiconv/src/include/charmaps/iso-8859-2.h new file mode 100644 index 0000000..631610e --- /dev/null +++ b/libs/libiconv/src/include/charmaps/iso-8859-2.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_2[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x01, 0x04, + 0x02, 0xd8, 0x01, 0x41, 0x00, 0xa4, 0x01, 0x3d, 0x01, 0x5a, 0x00, 0xa7, + 0x00, 0xa8, 0x01, 0x60, 0x01, 0x5e, 0x01, 0x64, 0x01, 0x79, 0x00, 0xad, + 0x01, 0x7d, 0x01, 0x7b, 0x00, 0xb0, 0x01, 0x05, 0x02, 0xdb, 0x01, 0x42, + 0x00, 0xb4, 0x01, 0x3e, 0x01, 0x5b, 0x02, 0xc7, 0x00, 0xb8, 0x01, 0x61, + 0x01, 0x5f, 0x01, 0x65, 0x01, 0x7a, 0x02, 0xdd, 0x01, 0x7e, 0x01, 0x7c, + 0x01, 0x54, 0x00, 0xc1, 0x00, 0xc2, 0x01, 0x02, 0x00, 0xc4, 0x01, 0x39, + 0x01, 0x06, 0x00, 0xc7, 0x01, 0x0c, 0x00, 0xc9, 0x01, 0x18, 0x00, 0xcb, + 0x01, 0x1a, 0x00, 0xcd, 0x00, 0xce, 0x01, 0x0e, 0x01, 0x10, 0x01, 0x43, + 0x01, 0x47, 0x00, 0xd3, 0x00, 0xd4, 0x01, 0x50, 0x00, 0xd6, 0x00, 0xd7, + 0x01, 0x58, 0x01, 0x6e, 0x00, 0xda, 0x01, 0x70, 0x00, 0xdc, 0x00, 0xdd, + 0x01, 0x62, 0x00, 0xdf, 0x01, 0x55, 0x00, 0xe1, 0x00, 0xe2, 0x01, 0x03, + 0x00, 0xe4, 0x01, 0x3a, 0x01, 0x07, 0x00, 0xe7, 0x01, 0x0d, 0x00, 0xe9, + 0x01, 0x19, 0x00, 0xeb, 0x01, 0x1b, 0x00, 0xed, 0x00, 0xee, 0x01, 0x0f, + 0x01, 0x11, 0x01, 0x44, 0x01, 0x48, 0x00, 0xf3, 0x00, 0xf4, 0x01, 0x51, + 0x00, 0xf6, 0x00, 0xf7, 0x01, 0x59, 0x01, 0x6f, 0x00, 0xfa, 0x01, 0x71, + 0x00, 0xfc, 0x00, 0xfd, 0x01, 0x63, 0x02, 0xd9 +}; diff --git a/libs/libiconv/src/include/charmaps/iso-8859-3.h b/libs/libiconv/src/include/charmaps/iso-8859-3.h new file mode 100644 index 0000000..cd76d59 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/iso-8859-3.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_3[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x01, 0x26, + 0x02, 0xd8, 0x00, 0xa3, 0x00, 0xa4, 0xff, 0xff, 0x01, 0x24, 0x00, 0xa7, + 0x00, 0xa8, 0x01, 0x30, 0x01, 0x5e, 0x01, 0x1e, 0x01, 0x34, 0x00, 0xad, + 0xff, 0xff, 0x01, 0x7b, 0x00, 0xb0, 0x01, 0x27, 0x00, 0xb2, 0x00, 0xb3, + 0x00, 0xb4, 0x00, 0xb5, 0x01, 0x25, 0x00, 0xb7, 0x00, 0xb8, 0x01, 0x31, + 0x01, 0x5f, 0x01, 0x1f, 0x01, 0x35, 0x00, 0xbd, 0xff, 0xff, 0x01, 0x7c, + 0x00, 0xc0, 0x00, 0xc1, 0x00, 0xc2, 0xff, 0xff, 0x00, 0xc4, 0x01, 0x0a, + 0x01, 0x08, 0x00, 0xc7, 0x00, 0xc8, 0x00, 0xc9, 0x00, 0xca, 0x00, 0xcb, + 0x00, 0xcc, 0x00, 0xcd, 0x00, 0xce, 0x00, 0xcf, 0xff, 0xff, 0x00, 0xd1, + 0x00, 0xd2, 0x00, 0xd3, 0x00, 0xd4, 0x01, 0x20, 0x00, 0xd6, 0x00, 0xd7, + 0x01, 0x1c, 0x00, 0xd9, 0x00, 0xda, 0x00, 0xdb, 0x00, 0xdc, 0x01, 0x6c, + 0x01, 0x5c, 0x00, 0xdf, 0x00, 0xe0, 0x00, 0xe1, 0x00, 0xe2, 0xff, 0xff, + 0x00, 0xe4, 0x01, 0x0b, 0x01, 0x09, 0x00, 0xe7, 0x00, 0xe8, 0x00, 0xe9, + 0x00, 0xea, 0x00, 0xeb, 0x00, 0xec, 0x00, 0xed, 0x00, 0xee, 0x00, 0xef, + 0xff, 0xff, 0x00, 0xf1, 0x00, 0xf2, 0x00, 0xf3, 0x00, 0xf4, 0x01, 0x21, + 0x00, 0xf6, 0x00, 0xf7, 0x01, 0x1d, 0x00, 0xf9, 0x00, 0xfa, 0x00, 0xfb, + 0x00, 0xfc, 0x01, 0x6d, 0x01, 0x5d, 0x02, 0xd9 +}; diff --git a/libs/libiconv/src/include/charmaps/iso-8859-4.h b/libs/libiconv/src/include/charmaps/iso-8859-4.h new file mode 100644 index 0000000..5db2f77 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/iso-8859-4.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_4[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x01, 0x04, + 0x01, 0x38, 0x01, 0x56, 0x00, 0xa4, 0x01, 0x28, 0x01, 0x3b, 0x00, 0xa7, + 0x00, 0xa8, 0x01, 0x60, 0x01, 0x12, 0x01, 0x22, 0x01, 0x66, 0x00, 0xad, + 0x01, 0x7d, 0x00, 0xaf, 0x00, 0xb0, 0x01, 0x05, 0x02, 0xdb, 0x01, 0x57, + 0x00, 0xb4, 0x01, 0x29, 0x01, 0x3c, 0x02, 0xc7, 0x00, 0xb8, 0x01, 0x61, + 0x01, 0x13, 0x01, 0x23, 0x01, 0x67, 0x01, 0x4a, 0x01, 0x7e, 0x01, 0x4b, + 0x01, 0x00, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xc3, 0x00, 0xc4, 0x00, 0xc5, + 0x00, 0xc6, 0x01, 0x2e, 0x01, 0x0c, 0x00, 0xc9, 0x01, 0x18, 0x00, 0xcb, + 0x01, 0x16, 0x00, 0xcd, 0x00, 0xce, 0x01, 0x2a, 0x01, 0x10, 0x01, 0x45, + 0x01, 0x4c, 0x01, 0x36, 0x00, 0xd4, 0x00, 0xd5, 0x00, 0xd6, 0x00, 0xd7, + 0x00, 0xd8, 0x01, 0x72, 0x00, 0xda, 0x00, 0xdb, 0x00, 0xdc, 0x01, 0x68, + 0x01, 0x6a, 0x00, 0xdf, 0x01, 0x01, 0x00, 0xe1, 0x00, 0xe2, 0x00, 0xe3, + 0x00, 0xe4, 0x00, 0xe5, 0x00, 0xe6, 0x01, 0x2f, 0x01, 0x0d, 0x00, 0xe9, + 0x01, 0x19, 0x00, 0xeb, 0x01, 0x17, 0x00, 0xed, 0x00, 0xee, 0x01, 0x2b, + 0x01, 0x11, 0x01, 0x46, 0x01, 0x4d, 0x01, 0x37, 0x00, 0xf4, 0x00, 0xf5, + 0x00, 0xf6, 0x00, 0xf7, 0x00, 0xf8, 0x01, 0x73, 0x00, 0xfa, 0x00, 0xfb, + 0x00, 0xfc, 0x01, 0x69, 0x01, 0x6b, 0x02, 0xd9 +}; diff --git a/libs/libiconv/src/include/charmaps/iso-8859-5.h b/libs/libiconv/src/include/charmaps/iso-8859-5.h new file mode 100644 index 0000000..d9fe684 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/iso-8859-5.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_5[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x04, 0x01, + 0x04, 0x02, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x04, 0x06, 0x04, 0x07, + 0x04, 0x08, 0x04, 0x09, 0x04, 0x0a, 0x04, 0x0b, 0x04, 0x0c, 0x00, 0xad, + 0x04, 0x0e, 0x04, 0x0f, 0x04, 0x10, 0x04, 0x11, 0x04, 0x12, 0x04, 0x13, + 0x04, 0x14, 0x04, 0x15, 0x04, 0x16, 0x04, 0x17, 0x04, 0x18, 0x04, 0x19, + 0x04, 0x1a, 0x04, 0x1b, 0x04, 0x1c, 0x04, 0x1d, 0x04, 0x1e, 0x04, 0x1f, + 0x04, 0x20, 0x04, 0x21, 0x04, 0x22, 0x04, 0x23, 0x04, 0x24, 0x04, 0x25, + 0x04, 0x26, 0x04, 0x27, 0x04, 0x28, 0x04, 0x29, 0x04, 0x2a, 0x04, 0x2b, + 0x04, 0x2c, 0x04, 0x2d, 0x04, 0x2e, 0x04, 0x2f, 0x04, 0x30, 0x04, 0x31, + 0x04, 0x32, 0x04, 0x33, 0x04, 0x34, 0x04, 0x35, 0x04, 0x36, 0x04, 0x37, + 0x04, 0x38, 0x04, 0x39, 0x04, 0x3a, 0x04, 0x3b, 0x04, 0x3c, 0x04, 0x3d, + 0x04, 0x3e, 0x04, 0x3f, 0x04, 0x40, 0x04, 0x41, 0x04, 0x42, 0x04, 0x43, + 0x04, 0x44, 0x04, 0x45, 0x04, 0x46, 0x04, 0x47, 0x04, 0x48, 0x04, 0x49, + 0x04, 0x4a, 0x04, 0x4b, 0x04, 0x4c, 0x04, 0x4d, 0x04, 0x4e, 0x04, 0x4f, + 0x21, 0x16, 0x04, 0x51, 0x04, 0x52, 0x04, 0x53, 0x04, 0x54, 0x04, 0x55, + 0x04, 0x56, 0x04, 0x57, 0x04, 0x58, 0x04, 0x59, 0x04, 0x5a, 0x04, 0x5b, + 0x04, 0x5c, 0x00, 0xa7, 0x04, 0x5e, 0x04, 0x5f +}; diff --git a/libs/libiconv/src/include/charmaps/iso-8859-6.h b/libs/libiconv/src/include/charmaps/iso-8859-6.h new file mode 100644 index 0000000..820020f --- /dev/null +++ b/libs/libiconv/src/include/charmaps/iso-8859-6.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_6[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0xa4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x06, 0x0c, 0x00, 0xad, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x06, 0x1b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x06, 0x1f, + 0xff, 0xff, 0x06, 0x21, 0x06, 0x22, 0x06, 0x23, 0x06, 0x24, 0x06, 0x25, + 0x06, 0x26, 0x06, 0x27, 0x06, 0x28, 0x06, 0x29, 0x06, 0x2a, 0x06, 0x2b, + 0x06, 0x2c, 0x06, 0x2d, 0x06, 0x2e, 0x06, 0x2f, 0x06, 0x30, 0x06, 0x31, + 0x06, 0x32, 0x06, 0x33, 0x06, 0x34, 0x06, 0x35, 0x06, 0x36, 0x06, 0x37, + 0x06, 0x38, 0x06, 0x39, 0x06, 0x3a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x06, 0x40, 0x06, 0x41, 0x06, 0x42, 0x06, 0x43, + 0x06, 0x44, 0x06, 0x45, 0x06, 0x46, 0x06, 0x47, 0x06, 0x48, 0x06, 0x49, + 0x06, 0x4a, 0x06, 0x4b, 0x06, 0x4c, 0x06, 0x4d, 0x06, 0x4e, 0x06, 0x4f, + 0x06, 0x50, 0x06, 0x51, 0x06, 0x52, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +}; diff --git a/libs/libiconv/src/include/charmaps/iso-8859-7.h b/libs/libiconv/src/include/charmaps/iso-8859-7.h new file mode 100644 index 0000000..174f9d3 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/iso-8859-7.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_7[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x20, 0x18, + 0x20, 0x19, 0x00, 0xa3, 0x20, 0xac, 0x20, 0xaf, 0x00, 0xa6, 0x00, 0xa7, + 0x00, 0xa8, 0x00, 0xa9, 0x03, 0x7a, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, + 0xff, 0xff, 0x20, 0x15, 0x00, 0xb0, 0x00, 0xb1, 0x00, 0xb2, 0x00, 0xb3, + 0x03, 0x84, 0x03, 0x85, 0x03, 0x86, 0x00, 0xb7, 0x03, 0x88, 0x03, 0x89, + 0x03, 0x8a, 0x00, 0xbb, 0x03, 0x8c, 0x00, 0xbd, 0x03, 0x8e, 0x03, 0x8f, + 0x03, 0x90, 0x03, 0x91, 0x03, 0x92, 0x03, 0x93, 0x03, 0x94, 0x03, 0x95, + 0x03, 0x96, 0x03, 0x97, 0x03, 0x98, 0x03, 0x99, 0x03, 0x9a, 0x03, 0x9b, + 0x03, 0x9c, 0x03, 0x9d, 0x03, 0x9e, 0x03, 0x9f, 0x03, 0xa0, 0x03, 0xa1, + 0xff, 0xff, 0x03, 0xa3, 0x03, 0xa4, 0x03, 0xa5, 0x03, 0xa6, 0x03, 0xa7, + 0x03, 0xa8, 0x03, 0xa9, 0x03, 0xaa, 0x03, 0xab, 0x03, 0xac, 0x03, 0xad, + 0x03, 0xae, 0x03, 0xaf, 0x03, 0xb0, 0x03, 0xb1, 0x03, 0xb2, 0x03, 0xb3, + 0x03, 0xb4, 0x03, 0xb5, 0x03, 0xb6, 0x03, 0xb7, 0x03, 0xb8, 0x03, 0xb9, + 0x03, 0xba, 0x03, 0xbb, 0x03, 0xbc, 0x03, 0xbd, 0x03, 0xbe, 0x03, 0xbf, + 0x03, 0xc0, 0x03, 0xc1, 0x03, 0xc2, 0x03, 0xc3, 0x03, 0xc4, 0x03, 0xc5, + 0x03, 0xc6, 0x03, 0xc7, 0x03, 0xc8, 0x03, 0xc9, 0x03, 0xca, 0x03, 0xcb, + 0x03, 0xcc, 0x03, 0xcd, 0x03, 0xce, 0xff, 0xff +}; diff --git a/libs/libiconv/src/include/charmaps/iso-8859-8.h b/libs/libiconv/src/include/charmaps/iso-8859-8.h new file mode 100644 index 0000000..66d4a5e --- /dev/null +++ b/libs/libiconv/src/include/charmaps/iso-8859-8.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_8[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0xff, 0xff, + 0x00, 0xa2, 0x00, 0xa3, 0x00, 0xa4, 0x00, 0xa5, 0x00, 0xa6, 0x00, 0xa7, + 0x00, 0xa8, 0x00, 0xa9, 0x00, 0xd7, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, + 0x00, 0xae, 0x00, 0xaf, 0x00, 0xb0, 0x00, 0xb1, 0x00, 0xb2, 0x00, 0xb3, + 0x00, 0xb4, 0x00, 0xb5, 0x00, 0xb6, 0x00, 0xb7, 0x00, 0xb8, 0x00, 0xb9, + 0x00, 0xf7, 0x00, 0xbb, 0x00, 0xbc, 0x00, 0xbd, 0x00, 0xbe, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x20, 0x17, 0x05, 0xd0, 0x05, 0xd1, 0x05, 0xd2, 0x05, 0xd3, + 0x05, 0xd4, 0x05, 0xd5, 0x05, 0xd6, 0x05, 0xd7, 0x05, 0xd8, 0x05, 0xd9, + 0x05, 0xda, 0x05, 0xdb, 0x05, 0xdc, 0x05, 0xdd, 0x05, 0xde, 0x05, 0xdf, + 0x05, 0xe0, 0x05, 0xe1, 0x05, 0xe2, 0x05, 0xe3, 0x05, 0xe4, 0x05, 0xe5, + 0x05, 0xe6, 0x05, 0xe7, 0x05, 0xe8, 0x05, 0xe9, 0x05, 0xea, 0xff, 0xff, + 0xff, 0xff, 0x20, 0x0e, 0x20, 0x0f, 0xff, 0xff +}; diff --git a/libs/libiconv/src/include/charmaps/iso-8859-9.h b/libs/libiconv/src/include/charmaps/iso-8859-9.h new file mode 100644 index 0000000..f1a8646 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/iso-8859-9.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_9[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x00, 0xa1, + 0x00, 0xa2, 0x00, 0xa3, 0x00, 0xa4, 0x00, 0xa5, 0x00, 0xa6, 0x00, 0xa7, + 0x00, 0xa8, 0x00, 0xa9, 0x00, 0xaa, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, + 0x00, 0xae, 0x00, 0xaf, 0x00, 0xb0, 0x00, 0xb1, 0x00, 0xb2, 0x00, 0xb3, + 0x00, 0xb4, 0x00, 0xb5, 0x00, 0xb6, 0x00, 0xb7, 0x00, 0xb8, 0x00, 0xb9, + 0x00, 0xba, 0x00, 0xbb, 0x00, 0xbc, 0x00, 0xbd, 0x00, 0xbe, 0x00, 0xbf, + 0x00, 0xc0, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xc3, 0x00, 0xc4, 0x00, 0xc5, + 0x00, 0xc6, 0x00, 0xc7, 0x00, 0xc8, 0x00, 0xc9, 0x00, 0xca, 0x00, 0xcb, + 0x00, 0xcc, 0x00, 0xcd, 0x00, 0xce, 0x00, 0xcf, 0x01, 0x1e, 0x00, 0xd1, + 0x00, 0xd2, 0x00, 0xd3, 0x00, 0xd4, 0x00, 0xd5, 0x00, 0xd6, 0x00, 0xd7, + 0x00, 0xd8, 0x00, 0xd9, 0x00, 0xda, 0x00, 0xdb, 0x00, 0xdc, 0x01, 0x30, + 0x01, 0x5e, 0x00, 0xdf, 0x00, 0xe0, 0x00, 0xe1, 0x00, 0xe2, 0x00, 0xe3, + 0x00, 0xe4, 0x00, 0xe5, 0x00, 0xe6, 0x00, 0xe7, 0x00, 0xe8, 0x00, 0xe9, + 0x00, 0xea, 0x00, 0xeb, 0x00, 0xec, 0x00, 0xed, 0x00, 0xee, 0x00, 0xef, + 0x01, 0x1f, 0x00, 0xf1, 0x00, 0xf2, 0x00, 0xf3, 0x00, 0xf4, 0x00, 0xf5, + 0x00, 0xf6, 0x00, 0xf7, 0x00, 0xf8, 0x00, 0xf9, 0x00, 0xfa, 0x00, 0xfb, + 0x00, 0xfc, 0x01, 0x31, 0x01, 0x5f, 0x00, 0xff +}; diff --git a/libs/libiconv/src/include/charmaps/koi8-r.h b/libs/libiconv/src/include/charmaps/koi8-r.h new file mode 100644 index 0000000..c2453a5 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/koi8-r.h @@ -0,0 +1,24 @@ +static const unsigned char map_koi8_r[] = { + 0x00, 0x00, 0x00, 0x00, 0x25, 0x00, 0x25, 0x02, 0x25, 0x0c, 0x25, 0x10, + 0x25, 0x14, 0x25, 0x18, 0x25, 0x1c, 0x25, 0x24, 0x25, 0x2c, 0x25, 0x34, + 0x25, 0x3c, 0x25, 0x80, 0x25, 0x84, 0x25, 0x88, 0x25, 0x8c, 0x25, 0x90, + 0x25, 0x91, 0x25, 0x92, 0x25, 0x93, 0x23, 0x20, 0x25, 0xa0, 0x22, 0x19, + 0x22, 0x1a, 0x22, 0x48, 0x22, 0x64, 0x22, 0x65, 0x00, 0xa0, 0x23, 0x21, + 0x00, 0xb0, 0x00, 0xb2, 0x00, 0xb7, 0x00, 0xf7, 0x25, 0x50, 0x25, 0x51, + 0x25, 0x52, 0x04, 0x51, 0x25, 0x53, 0x25, 0x54, 0x25, 0x55, 0x25, 0x56, + 0x25, 0x57, 0x25, 0x58, 0x25, 0x59, 0x25, 0x5a, 0x25, 0x5b, 0x25, 0x5c, + 0x25, 0x5d, 0x25, 0x5e, 0x25, 0x5f, 0x25, 0x60, 0x25, 0x61, 0x04, 0x01, + 0x25, 0x62, 0x25, 0x63, 0x25, 0x64, 0x25, 0x65, 0x25, 0x66, 0x25, 0x67, + 0x25, 0x68, 0x25, 0x69, 0x25, 0x6a, 0x25, 0x6b, 0x25, 0x6c, 0x00, 0xa9, + 0x04, 0x4e, 0x04, 0x30, 0x04, 0x31, 0x04, 0x46, 0x04, 0x34, 0x04, 0x35, + 0x04, 0x44, 0x04, 0x33, 0x04, 0x45, 0x04, 0x38, 0x04, 0x39, 0x04, 0x3a, + 0x04, 0x3b, 0x04, 0x3c, 0x04, 0x3d, 0x04, 0x3e, 0x04, 0x3f, 0x04, 0x4f, + 0x04, 0x40, 0x04, 0x41, 0x04, 0x42, 0x04, 0x43, 0x04, 0x36, 0x04, 0x32, + 0x04, 0x4c, 0x04, 0x4b, 0x04, 0x37, 0x04, 0x48, 0x04, 0x4d, 0x04, 0x49, + 0x04, 0x47, 0x04, 0x4a, 0x04, 0x2e, 0x04, 0x10, 0x04, 0x11, 0x04, 0x26, + 0x04, 0x14, 0x04, 0x15, 0x04, 0x24, 0x04, 0x13, 0x04, 0x25, 0x04, 0x18, + 0x04, 0x19, 0x04, 0x1a, 0x04, 0x1b, 0x04, 0x1c, 0x04, 0x1d, 0x04, 0x1e, + 0x04, 0x1f, 0x04, 0x2f, 0x04, 0x20, 0x04, 0x21, 0x04, 0x22, 0x04, 0x23, + 0x04, 0x16, 0x04, 0x12, 0x04, 0x2c, 0x04, 0x2b, 0x04, 0x17, 0x04, 0x28, + 0x04, 0x2d, 0x04, 0x29, 0x04, 0x27, 0x04, 0x2a +}; diff --git a/libs/libiconv/src/include/charmaps/windows-1250.h b/libs/libiconv/src/include/charmaps/windows-1250.h new file mode 100644 index 0000000..8e4723e --- /dev/null +++ b/libs/libiconv/src/include/charmaps/windows-1250.h @@ -0,0 +1,24 @@ +static const unsigned char map_windows_1250[] = { + 0x00, 0x00, 0x00, 0x00, 0x20, 0xac, 0xff, 0xff, 0x20, 0x1a, 0xff, 0xff, + 0x20, 0x1e, 0x20, 0x26, 0x20, 0x20, 0x20, 0x21, 0xff, 0xff, 0x20, 0x30, + 0x01, 0x60, 0x20, 0x39, 0x01, 0x5a, 0x01, 0x64, 0x01, 0x7d, 0x01, 0x79, + 0xff, 0xff, 0x20, 0x18, 0x20, 0x19, 0x20, 0x1c, 0x20, 0x1d, 0x20, 0x22, + 0x20, 0x13, 0x20, 0x14, 0xff, 0xff, 0x21, 0x22, 0x01, 0x61, 0x20, 0x3a, + 0x01, 0x5b, 0x01, 0x65, 0x01, 0x7e, 0x01, 0x7a, 0x00, 0xa0, 0x02, 0xc7, + 0x02, 0xd8, 0x01, 0x41, 0x00, 0xa4, 0x01, 0x04, 0x00, 0xa6, 0x00, 0xa7, + 0x00, 0xa8, 0x00, 0xa9, 0x01, 0x5e, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, + 0x00, 0xae, 0x01, 0x7b, 0x00, 0xb0, 0x00, 0xb1, 0x02, 0xdb, 0x01, 0x42, + 0x00, 0xb4, 0x00, 0xb5, 0x00, 0xb6, 0x00, 0xb7, 0x00, 0xb8, 0x01, 0x05, + 0x01, 0x5f, 0x00, 0xbb, 0x01, 0x3d, 0x02, 0xdd, 0x01, 0x3e, 0x01, 0x7c, + 0x01, 0x54, 0x00, 0xc1, 0x00, 0xc2, 0x01, 0x02, 0x00, 0xc4, 0x01, 0x39, + 0x01, 0x06, 0x00, 0xc7, 0x01, 0x0c, 0x00, 0xc9, 0x01, 0x18, 0x00, 0xcb, + 0x01, 0x1a, 0x00, 0xcd, 0x00, 0xce, 0x01, 0x0e, 0x01, 0x10, 0x01, 0x43, + 0x01, 0x47, 0x00, 0xd3, 0x00, 0xd4, 0x01, 0x50, 0x00, 0xd6, 0x00, 0xd7, + 0x01, 0x58, 0x01, 0x6e, 0x00, 0xda, 0x01, 0x70, 0x00, 0xdc, 0x00, 0xdd, + 0x01, 0x62, 0x00, 0xdf, 0x01, 0x55, 0x00, 0xe1, 0x00, 0xe2, 0x01, 0x03, + 0x00, 0xe4, 0x01, 0x3a, 0x01, 0x07, 0x00, 0xe7, 0x01, 0x0d, 0x00, 0xe9, + 0x01, 0x19, 0x00, 0xeb, 0x01, 0x1b, 0x00, 0xed, 0x00, 0xee, 0x01, 0x0f, + 0x01, 0x11, 0x01, 0x44, 0x01, 0x48, 0x00, 0xf3, 0x00, 0xf4, 0x01, 0x51, + 0x00, 0xf6, 0x00, 0xf7, 0x01, 0x59, 0x01, 0x6f, 0x00, 0xfa, 0x01, 0x71, + 0x00, 0xfc, 0x00, 0xfd, 0x01, 0x63, 0x02, 0xd9 +}; diff --git a/libs/libiconv/src/include/charmaps/windows-1251.h b/libs/libiconv/src/include/charmaps/windows-1251.h new file mode 100644 index 0000000..e278850 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/windows-1251.h @@ -0,0 +1,24 @@ +static const unsigned char map_windows_1251[] = { + 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x04, 0x03, 0x20, 0x1a, 0x04, 0x53, + 0x20, 0x1e, 0x20, 0x26, 0x20, 0x20, 0x20, 0x21, 0x20, 0xac, 0x20, 0x30, + 0x04, 0x09, 0x20, 0x39, 0x04, 0x0a, 0x04, 0x0c, 0x04, 0x0b, 0x04, 0x0f, + 0x04, 0x52, 0x20, 0x18, 0x20, 0x19, 0x20, 0x1c, 0x20, 0x1d, 0x20, 0x22, + 0x20, 0x13, 0x20, 0x14, 0xff, 0xff, 0x21, 0x22, 0x04, 0x59, 0x20, 0x3a, + 0x04, 0x5a, 0x04, 0x5c, 0x04, 0x5b, 0x04, 0x5f, 0x00, 0xa0, 0x04, 0x0e, + 0x04, 0x5e, 0x04, 0x08, 0x00, 0xa4, 0x04, 0x90, 0x00, 0xa6, 0x00, 0xa7, + 0x04, 0x01, 0x00, 0xa9, 0x04, 0x04, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, + 0x00, 0xae, 0x04, 0x07, 0x00, 0xb0, 0x00, 0xb1, 0x04, 0x06, 0x04, 0x56, + 0x04, 0x91, 0x00, 0xb5, 0x00, 0xb6, 0x00, 0xb7, 0x04, 0x51, 0x21, 0x16, + 0x04, 0x54, 0x00, 0xbb, 0x04, 0x58, 0x04, 0x05, 0x04, 0x55, 0x04, 0x57, + 0x04, 0x10, 0x04, 0x11, 0x04, 0x12, 0x04, 0x13, 0x04, 0x14, 0x04, 0x15, + 0x04, 0x16, 0x04, 0x17, 0x04, 0x18, 0x04, 0x19, 0x04, 0x1a, 0x04, 0x1b, + 0x04, 0x1c, 0x04, 0x1d, 0x04, 0x1e, 0x04, 0x1f, 0x04, 0x20, 0x04, 0x21, + 0x04, 0x22, 0x04, 0x23, 0x04, 0x24, 0x04, 0x25, 0x04, 0x26, 0x04, 0x27, + 0x04, 0x28, 0x04, 0x29, 0x04, 0x2a, 0x04, 0x2b, 0x04, 0x2c, 0x04, 0x2d, + 0x04, 0x2e, 0x04, 0x2f, 0x04, 0x30, 0x04, 0x31, 0x04, 0x32, 0x04, 0x33, + 0x04, 0x34, 0x04, 0x35, 0x04, 0x36, 0x04, 0x37, 0x04, 0x38, 0x04, 0x39, + 0x04, 0x3a, 0x04, 0x3b, 0x04, 0x3c, 0x04, 0x3d, 0x04, 0x3e, 0x04, 0x3f, + 0x04, 0x40, 0x04, 0x41, 0x04, 0x42, 0x04, 0x43, 0x04, 0x44, 0x04, 0x45, + 0x04, 0x46, 0x04, 0x47, 0x04, 0x48, 0x04, 0x49, 0x04, 0x4a, 0x04, 0x4b, + 0x04, 0x4c, 0x04, 0x4d, 0x04, 0x4e, 0x04, 0x4f +}; diff --git a/libs/libiconv/src/include/charmaps/windows-1252.h b/libs/libiconv/src/include/charmaps/windows-1252.h new file mode 100644 index 0000000..a6dad8a --- /dev/null +++ b/libs/libiconv/src/include/charmaps/windows-1252.h @@ -0,0 +1,25 @@ +static const unsigned char map_windows_1252[] = { + 0x00, 0x00, 0x00, 0x00, 0x20, 0xac, 0xff, 0xff, 0x20, 0x1a, 0x01, 0x92, + 0x20, 0x1e, 0x20, 0x26, 0x20, 0x20, 0x20, 0x21, 0x02, 0xc6, 0x20, 0x30, + 0x01, 0x60, 0x20, 0x39, 0x01, 0x52, 0xff, 0xff, 0x01, 0x7d, 0xff, 0xff, + 0xff, 0xff, 0x20, 0x18, 0x20, 0x19, 0x20, 0x1c, 0x20, 0x1d, 0x20, 0x22, + 0x20, 0x13, 0x20, 0x14, 0x02, 0xdc, 0x21, 0x22, 0x01, 0x61, 0x20, 0x3a, + 0x01, 0x53, 0xff, 0xff, 0x01, 0x7e, 0x01, 0x78, 0x00, 0xa0, 0x00, 0xa1, + 0x00, 0xa2, 0x00, 0xa3, 0x00, 0xa4, 0x00, 0xa5, 0x00, 0xa6, 0x00, 0xa7, + 0x00, 0xa8, 0x00, 0xa9, 0x00, 0xaa, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, + 0x00, 0xae, 0x00, 0xaf, 0x00, 0xb0, 0x00, 0xb1, 0x00, 0xb2, 0x00, 0xb3, + 0x00, 0xb4, 0x00, 0xb5, 0x00, 0xb6, 0x00, 0xb7, 0x00, 0xb8, 0x00, 0xb9, + 0x00, 0xba, 0x00, 0xbb, 0x00, 0xbc, 0x00, 0xbd, 0x00, 0xbe, 0x00, 0xbf, + 0x00, 0xc0, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xc3, 0x00, 0xc4, 0x00, 0xc5, + 0x00, 0xc6, 0x00, 0xc7, 0x00, 0xc8, 0x00, 0xc9, 0x00, 0xca, 0x00, 0xcb, + 0x00, 0xcc, 0x00, 0xcd, 0x00, 0xce, 0x00, 0xcf, 0x00, 0xd0, 0x00, 0xd1, + 0x00, 0xd2, 0x00, 0xd3, 0x00, 0xd4, 0x00, 0xd5, 0x00, 0xd6, 0x00, 0xd7, + 0x00, 0xd8, 0x00, 0xd9, 0x00, 0xda, 0x00, 0xdb, 0x00, 0xdc, 0x00, 0xdd, + 0x00, 0xde, 0x00, 0xdf, 0x00, 0xe0, 0x00, 0xe1, 0x00, 0xe2, 0x00, 0xe3, + 0x00, 0xe4, 0x00, 0xe5, 0x00, 0xe6, 0x00, 0xe7, 0x00, 0xe8, 0x00, 0xe9, + 0x00, 0xea, 0x00, 0xeb, 0x00, 0xec, 0x00, 0xed, 0x00, 0xee, 0x00, 0xef, + 0x00, 0xf0, 0x00, 0xf1, 0x00, 0xf2, 0x00, 0xf3, 0x00, 0xf4, 0x00, 0xf5, + 0x00, 0xf6, 0x00, 0xf7, 0x00, 0xf8, 0x00, 0xf9, 0x00, 0xfa, 0x00, 0xfb, + 0x00, 0xfc, 0x00, 0xfd, 0x00, 0xfe, 0x00, 0xff +}; + diff --git a/libs/libiconv/src/include/charmaps/windows-1253.h b/libs/libiconv/src/include/charmaps/windows-1253.h new file mode 100644 index 0000000..b0bdf1e --- /dev/null +++ b/libs/libiconv/src/include/charmaps/windows-1253.h @@ -0,0 +1,24 @@ +static const unsigned char map_windows_1253[] = { + 0x00, 0x00, 0x00, 0x00, 0x20, 0xac, 0xff, 0xff, 0x20, 0x1a, 0x01, 0x92, + 0x20, 0x1e, 0x20, 0x26, 0x20, 0x20, 0x20, 0x21, 0xff, 0xff, 0x20, 0x30, + 0xff, 0xff, 0x20, 0x39, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x20, 0x18, 0x20, 0x19, 0x20, 0x1c, 0x20, 0x1d, 0x20, 0x22, + 0x20, 0x13, 0x20, 0x14, 0xff, 0xff, 0x21, 0x22, 0xff, 0xff, 0x20, 0x3a, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xa0, 0x03, 0x85, + 0x03, 0x86, 0x00, 0xa3, 0x00, 0xa4, 0x00, 0xa5, 0x00, 0xa6, 0x00, 0xa7, + 0x00, 0xa8, 0x00, 0xa9, 0xff, 0xff, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, + 0x00, 0xae, 0x20, 0x15, 0x00, 0xb0, 0x00, 0xb1, 0x00, 0xb2, 0x00, 0xb3, + 0x03, 0x84, 0x00, 0xb5, 0x00, 0xb6, 0x00, 0xb7, 0x03, 0x88, 0x03, 0x89, + 0x03, 0x8a, 0x00, 0xbb, 0x03, 0x8c, 0x00, 0xbd, 0x03, 0x8e, 0x03, 0x8f, + 0x03, 0x90, 0x03, 0x91, 0x03, 0x92, 0x03, 0x93, 0x03, 0x94, 0x03, 0x95, + 0x03, 0x96, 0x03, 0x97, 0x03, 0x98, 0x03, 0x99, 0x03, 0x9a, 0x03, 0x9b, + 0x03, 0x9c, 0x03, 0x9d, 0x03, 0x9e, 0x03, 0x9f, 0x03, 0xa0, 0x03, 0xa1, + 0xff, 0xff, 0x03, 0xa3, 0x03, 0xa4, 0x03, 0xa5, 0x03, 0xa6, 0x03, 0xa7, + 0x03, 0xa8, 0x03, 0xa9, 0x03, 0xaa, 0x03, 0xab, 0x03, 0xac, 0x03, 0xad, + 0x03, 0xae, 0x03, 0xaf, 0x03, 0xb0, 0x03, 0xb1, 0x03, 0xb2, 0x03, 0xb3, + 0x03, 0xb4, 0x03, 0xb5, 0x03, 0xb6, 0x03, 0xb7, 0x03, 0xb8, 0x03, 0xb9, + 0x03, 0xba, 0x03, 0xbb, 0x03, 0xbc, 0x03, 0xbd, 0x03, 0xbe, 0x03, 0xbf, + 0x03, 0xc0, 0x03, 0xc1, 0x03, 0xc2, 0x03, 0xc3, 0x03, 0xc4, 0x03, 0xc5, + 0x03, 0xc6, 0x03, 0xc7, 0x03, 0xc8, 0x03, 0xc9, 0x03, 0xca, 0x03, 0xcb, + 0x03, 0xcc, 0x03, 0xcd, 0x03, 0xce, 0xff, 0xff +}; diff --git a/libs/libiconv/src/include/charmaps/windows-1254.h b/libs/libiconv/src/include/charmaps/windows-1254.h new file mode 100644 index 0000000..be22600 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/windows-1254.h @@ -0,0 +1,24 @@ +static const unsigned char map_windows_1254[] = { + 0x00, 0x00, 0x00, 0x00, 0x20, 0xac, 0xff, 0xff, 0x20, 0x1a, 0x01, 0x92, + 0x20, 0x1e, 0x20, 0x26, 0x20, 0x20, 0x20, 0x21, 0x02, 0xc6, 0x20, 0x30, + 0x01, 0x60, 0x20, 0x39, 0x01, 0x52, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x20, 0x18, 0x20, 0x19, 0x20, 0x1c, 0x20, 0x1d, 0x20, 0x22, + 0x20, 0x13, 0x20, 0x14, 0x02, 0xdc, 0x21, 0x22, 0x01, 0x61, 0x20, 0x3a, + 0x01, 0x53, 0xff, 0xff, 0xff, 0xff, 0x01, 0x78, 0x00, 0xa0, 0x00, 0xa1, + 0x00, 0xa2, 0x00, 0xa3, 0x00, 0xa4, 0x00, 0xa5, 0x00, 0xa6, 0x00, 0xa7, + 0x00, 0xa8, 0x00, 0xa9, 0x00, 0xaa, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, + 0x00, 0xae, 0x00, 0xaf, 0x00, 0xb0, 0x00, 0xb1, 0x00, 0xb2, 0x00, 0xb3, + 0x00, 0xb4, 0x00, 0xb5, 0x00, 0xb6, 0x00, 0xb7, 0x00, 0xb8, 0x00, 0xb9, + 0x00, 0xba, 0x00, 0xbb, 0x00, 0xbc, 0x00, 0xbd, 0x00, 0xbe, 0x00, 0xbf, + 0x00, 0xc0, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xc3, 0x00, 0xc4, 0x00, 0xc5, + 0x00, 0xc6, 0x00, 0xc7, 0x00, 0xc8, 0x00, 0xc9, 0x00, 0xca, 0x00, 0xcb, + 0x00, 0xcc, 0x00, 0xcd, 0x00, 0xce, 0x00, 0xcf, 0x01, 0x1e, 0x00, 0xd1, + 0x00, 0xd2, 0x00, 0xd3, 0x00, 0xd4, 0x00, 0xd5, 0x00, 0xd6, 0x00, 0xd7, + 0x00, 0xd8, 0x00, 0xd9, 0x00, 0xda, 0x00, 0xdb, 0x00, 0xdc, 0x01, 0x30, + 0x01, 0x5e, 0x00, 0xdf, 0x00, 0xe0, 0x00, 0xe1, 0x00, 0xe2, 0x00, 0xe3, + 0x00, 0xe4, 0x00, 0xe5, 0x00, 0xe6, 0x00, 0xe7, 0x00, 0xe8, 0x00, 0xe9, + 0x00, 0xea, 0x00, 0xeb, 0x00, 0xec, 0x00, 0xed, 0x00, 0xee, 0x00, 0xef, + 0x01, 0x1f, 0x00, 0xf1, 0x00, 0xf2, 0x00, 0xf3, 0x00, 0xf4, 0x00, 0xf5, + 0x00, 0xf6, 0x00, 0xf7, 0x00, 0xf8, 0x00, 0xf9, 0x00, 0xfa, 0x00, 0xfb, + 0x00, 0xfc, 0x01, 0x31, 0x01, 0x5f, 0x00, 0xff +}; diff --git a/libs/libiconv/src/include/charmaps/windows-1255.h b/libs/libiconv/src/include/charmaps/windows-1255.h new file mode 100644 index 0000000..28bf513 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/windows-1255.h @@ -0,0 +1,24 @@ +static const unsigned char map_windows_1255[] = { + 0x00, 0x00, 0x00, 0x00, 0x20, 0xac, 0xff, 0xff, 0x20, 0x1a, 0x01, 0x92, + 0x20, 0x1e, 0x20, 0x26, 0x20, 0x20, 0x20, 0x21, 0x02, 0xc6, 0x20, 0x30, + 0xff, 0xff, 0x20, 0x39, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x20, 0x18, 0x20, 0x19, 0x20, 0x1c, 0x20, 0x1d, 0x20, 0x22, + 0x20, 0x13, 0x20, 0x14, 0x02, 0xdc, 0x21, 0x22, 0xff, 0xff, 0x20, 0x3a, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xa0, 0x00, 0xa1, + 0x00, 0xa2, 0x00, 0xa3, 0x20, 0xaa, 0x00, 0xa5, 0x00, 0xa6, 0x00, 0xa7, + 0x00, 0xa8, 0x00, 0xa9, 0x00, 0xd7, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, + 0x00, 0xae, 0x00, 0xaf, 0x00, 0xb0, 0x00, 0xb1, 0x00, 0xb2, 0x00, 0xb3, + 0x00, 0xb4, 0x00, 0xb5, 0x00, 0xb6, 0x00, 0xb7, 0x00, 0xb8, 0x00, 0xb9, + 0x00, 0xf7, 0x00, 0xbb, 0x00, 0xbc, 0x00, 0xbd, 0x00, 0xbe, 0x00, 0xbf, + 0x05, 0xb0, 0x05, 0xb1, 0x05, 0xb2, 0x05, 0xb3, 0x05, 0xb4, 0x05, 0xb5, + 0x05, 0xb6, 0x05, 0xb7, 0x05, 0xb8, 0x05, 0xb9, 0xff, 0xff, 0x05, 0xbb, + 0x05, 0xbc, 0x05, 0xbd, 0x05, 0xbe, 0x05, 0xbf, 0x05, 0xc0, 0x05, 0xc1, + 0x05, 0xc2, 0x05, 0xc3, 0x05, 0xf0, 0x05, 0xf1, 0x05, 0xf2, 0x05, 0xf3, + 0x05, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x05, 0xd0, 0x05, 0xd1, 0x05, 0xd2, 0x05, 0xd3, + 0x05, 0xd4, 0x05, 0xd5, 0x05, 0xd6, 0x05, 0xd7, 0x05, 0xd8, 0x05, 0xd9, + 0x05, 0xda, 0x05, 0xdb, 0x05, 0xdc, 0x05, 0xdd, 0x05, 0xde, 0x05, 0xdf, + 0x05, 0xe0, 0x05, 0xe1, 0x05, 0xe2, 0x05, 0xe3, 0x05, 0xe4, 0x05, 0xe5, + 0x05, 0xe6, 0x05, 0xe7, 0x05, 0xe8, 0x05, 0xe9, 0x05, 0xea, 0xff, 0xff, + 0xff, 0xff, 0x20, 0x0e, 0x20, 0x0f, 0xff, 0xff +}; diff --git a/libs/libiconv/src/include/charmaps/windows-1256.h b/libs/libiconv/src/include/charmaps/windows-1256.h new file mode 100644 index 0000000..fbca315 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/windows-1256.h @@ -0,0 +1,24 @@ +static const unsigned char map_windows_1256[] = { + 0x00, 0x00, 0x00, 0x00, 0x20, 0xac, 0x06, 0x7e, 0x20, 0x1a, 0x01, 0x92, + 0x20, 0x1e, 0x20, 0x26, 0x20, 0x20, 0x20, 0x21, 0x02, 0xc6, 0x20, 0x30, + 0x06, 0x79, 0x20, 0x39, 0x01, 0x52, 0x06, 0x86, 0x06, 0x98, 0x06, 0x88, + 0x06, 0xaf, 0x20, 0x18, 0x20, 0x19, 0x20, 0x1c, 0x20, 0x1d, 0x20, 0x22, + 0x20, 0x13, 0x20, 0x14, 0x06, 0xa9, 0x21, 0x22, 0x06, 0x91, 0x20, 0x3a, + 0x01, 0x53, 0x20, 0x0c, 0x20, 0x0d, 0x06, 0xba, 0x00, 0xa0, 0x06, 0x0c, + 0x00, 0xa2, 0x00, 0xa3, 0x00, 0xa4, 0x00, 0xa5, 0x00, 0xa6, 0x00, 0xa7, + 0x00, 0xa8, 0x00, 0xa9, 0x06, 0xbe, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, + 0x00, 0xae, 0x00, 0xaf, 0x00, 0xb0, 0x00, 0xb1, 0x00, 0xb2, 0x00, 0xb3, + 0x00, 0xb4, 0x00, 0xb5, 0x00, 0xb6, 0x00, 0xb7, 0x00, 0xb8, 0x00, 0xb9, + 0x06, 0x1b, 0x00, 0xbb, 0x00, 0xbc, 0x00, 0xbd, 0x00, 0xbe, 0x06, 0x1f, + 0x06, 0xc1, 0x06, 0x21, 0x06, 0x22, 0x06, 0x23, 0x06, 0x24, 0x06, 0x25, + 0x06, 0x26, 0x06, 0x27, 0x06, 0x28, 0x06, 0x29, 0x06, 0x2a, 0x06, 0x2b, + 0x06, 0x2c, 0x06, 0x2d, 0x06, 0x2e, 0x06, 0x2f, 0x06, 0x30, 0x06, 0x31, + 0x06, 0x32, 0x06, 0x33, 0x06, 0x34, 0x06, 0x35, 0x06, 0x36, 0x00, 0xd7, + 0x06, 0x37, 0x06, 0x38, 0x06, 0x39, 0x06, 0x3a, 0x06, 0x40, 0x06, 0x41, + 0x06, 0x42, 0x06, 0x43, 0x00, 0xe0, 0x06, 0x44, 0x00, 0xe2, 0x06, 0x45, + 0x06, 0x46, 0x06, 0x47, 0x06, 0x48, 0x00, 0xe7, 0x00, 0xe8, 0x00, 0xe9, + 0x00, 0xea, 0x00, 0xeb, 0x06, 0x49, 0x06, 0x4a, 0x00, 0xee, 0x00, 0xef, + 0x06, 0x4b, 0x06, 0x4c, 0x06, 0x4d, 0x06, 0x4e, 0x00, 0xf4, 0x06, 0x4f, + 0x06, 0x50, 0x00, 0xf7, 0x06, 0x51, 0x00, 0xf9, 0x06, 0x52, 0x00, 0xfb, + 0x00, 0xfc, 0x20, 0x0e, 0x20, 0x0f, 0x06, 0xd2 +}; diff --git a/libs/libiconv/src/include/charmaps/windows-1257.h b/libs/libiconv/src/include/charmaps/windows-1257.h new file mode 100644 index 0000000..69d4474 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/windows-1257.h @@ -0,0 +1,24 @@ +static const unsigned char map_windows_1257[] = { + 0x00, 0x00, 0x00, 0x00, 0x20, 0xac, 0xff, 0xff, 0x20, 0x1a, 0xff, 0xff, + 0x20, 0x1e, 0x20, 0x26, 0x20, 0x20, 0x20, 0x21, 0xff, 0xff, 0x20, 0x30, + 0xff, 0xff, 0x20, 0x39, 0xff, 0xff, 0x00, 0xa8, 0x02, 0xc7, 0x00, 0xb8, + 0xff, 0xff, 0x20, 0x18, 0x20, 0x19, 0x20, 0x1c, 0x20, 0x1d, 0x20, 0x22, + 0x20, 0x13, 0x20, 0x14, 0xff, 0xff, 0x21, 0x22, 0xff, 0xff, 0x20, 0x3a, + 0xff, 0xff, 0x00, 0xaf, 0x02, 0xdb, 0xff, 0xff, 0x00, 0xa0, 0xff, 0xff, + 0x00, 0xa2, 0x00, 0xa3, 0x00, 0xa4, 0xff, 0xff, 0x00, 0xa6, 0x00, 0xa7, + 0x00, 0xd8, 0x00, 0xa9, 0x01, 0x56, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, + 0x00, 0xae, 0x00, 0xc6, 0x00, 0xb0, 0x00, 0xb1, 0x00, 0xb2, 0x00, 0xb3, + 0x00, 0xb4, 0x00, 0xb5, 0x00, 0xb6, 0x00, 0xb7, 0x00, 0xf8, 0x00, 0xb9, + 0x01, 0x57, 0x00, 0xbb, 0x00, 0xbc, 0x00, 0xbd, 0x00, 0xbe, 0x00, 0xe6, + 0x01, 0x04, 0x01, 0x2e, 0x01, 0x00, 0x01, 0x06, 0x00, 0xc4, 0x00, 0xc5, + 0x01, 0x18, 0x01, 0x12, 0x01, 0x0c, 0x00, 0xc9, 0x01, 0x79, 0x01, 0x16, + 0x01, 0x22, 0x01, 0x36, 0x01, 0x2a, 0x01, 0x3b, 0x01, 0x60, 0x01, 0x43, + 0x01, 0x45, 0x00, 0xd3, 0x01, 0x4c, 0x00, 0xd5, 0x00, 0xd6, 0x00, 0xd7, + 0x01, 0x72, 0x01, 0x41, 0x01, 0x5a, 0x01, 0x6a, 0x00, 0xdc, 0x01, 0x7b, + 0x01, 0x7d, 0x00, 0xdf, 0x01, 0x05, 0x01, 0x2f, 0x01, 0x01, 0x01, 0x07, + 0x00, 0xe4, 0x00, 0xe5, 0x01, 0x19, 0x01, 0x13, 0x01, 0x0d, 0x00, 0xe9, + 0x01, 0x7a, 0x01, 0x17, 0x01, 0x23, 0x01, 0x37, 0x01, 0x2b, 0x01, 0x3c, + 0x01, 0x61, 0x01, 0x44, 0x01, 0x46, 0x00, 0xf3, 0x01, 0x4d, 0x00, 0xf5, + 0x00, 0xf6, 0x00, 0xf7, 0x01, 0x73, 0x01, 0x42, 0x01, 0x5b, 0x01, 0x6b, + 0x00, 0xfc, 0x01, 0x7c, 0x01, 0x7e, 0x02, 0xd9 +}; diff --git a/libs/libiconv/src/include/charmaps/windows-1258.h b/libs/libiconv/src/include/charmaps/windows-1258.h new file mode 100644 index 0000000..5bbd737 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/windows-1258.h @@ -0,0 +1,24 @@ +static const unsigned char map_windows_1258[] = { + 0x00, 0x00, 0x00, 0x00, 0x20, 0xac, 0xff, 0xff, 0x20, 0x1a, 0x01, 0x92, + 0x20, 0x1e, 0x20, 0x26, 0x20, 0x20, 0x20, 0x21, 0x02, 0xc6, 0x20, 0x30, + 0xff, 0xff, 0x20, 0x39, 0x01, 0x52, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x20, 0x18, 0x20, 0x19, 0x20, 0x1c, 0x20, 0x1d, 0x20, 0x22, + 0x20, 0x13, 0x20, 0x14, 0x02, 0xdc, 0x21, 0x22, 0xff, 0xff, 0x20, 0x3a, + 0x01, 0x53, 0xff, 0xff, 0xff, 0xff, 0x01, 0x78, 0x00, 0xa0, 0x00, 0xa1, + 0x00, 0xa2, 0x00, 0xa3, 0x00, 0xa4, 0x00, 0xa5, 0x00, 0xa6, 0x00, 0xa7, + 0x00, 0xa8, 0x00, 0xa9, 0x00, 0xaa, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, + 0x00, 0xae, 0x00, 0xaf, 0x00, 0xb0, 0x00, 0xb1, 0x00, 0xb2, 0x00, 0xb3, + 0x00, 0xb4, 0x00, 0xb5, 0x00, 0xb6, 0x00, 0xb7, 0x00, 0xb8, 0x00, 0xb9, + 0x00, 0xba, 0x00, 0xbb, 0x00, 0xbc, 0x00, 0xbd, 0x00, 0xbe, 0x00, 0xbf, + 0x00, 0xc0, 0x00, 0xc1, 0x00, 0xc2, 0x01, 0x02, 0x00, 0xc4, 0x00, 0xc5, + 0x00, 0xc6, 0x00, 0xc7, 0x00, 0xc8, 0x00, 0xc9, 0x00, 0xca, 0x00, 0xcb, + 0x03, 0x00, 0x00, 0xcd, 0x00, 0xce, 0x00, 0xcf, 0x01, 0x10, 0x00, 0xd1, + 0x03, 0x09, 0x00, 0xd3, 0x00, 0xd4, 0x01, 0xa0, 0x00, 0xd6, 0x00, 0xd7, + 0x00, 0xd8, 0x00, 0xd9, 0x00, 0xda, 0x00, 0xdb, 0x00, 0xdc, 0x01, 0xaf, + 0x03, 0x03, 0x00, 0xdf, 0x00, 0xe0, 0x00, 0xe1, 0x00, 0xe2, 0x01, 0x03, + 0x00, 0xe4, 0x00, 0xe5, 0x00, 0xe6, 0x00, 0xe7, 0x00, 0xe8, 0x00, 0xe9, + 0x00, 0xea, 0x00, 0xeb, 0x03, 0x01, 0x00, 0xed, 0x00, 0xee, 0x00, 0xef, + 0x01, 0x11, 0x00, 0xf1, 0x03, 0x23, 0x00, 0xf3, 0x00, 0xf4, 0x01, 0xa1, + 0x00, 0xf6, 0x00, 0xf7, 0x00, 0xf8, 0x00, 0xf9, 0x00, 0xfa, 0x00, 0xfb, + 0x00, 0xfc, 0x01, 0xb0, 0x20, 0xab, 0x00, 0xff +}; diff --git a/libs/libiconv/src/include/charmaps/windows-874.h b/libs/libiconv/src/include/charmaps/windows-874.h new file mode 100644 index 0000000..5749280 --- /dev/null +++ b/libs/libiconv/src/include/charmaps/windows-874.h @@ -0,0 +1,24 @@ +static const unsigned char map_windows_874[] = { + 0x00, 0x00, 0x00, 0x00, 0x20, 0xac, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x20, 0x26, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x20, 0x18, 0x20, 0x19, 0x20, 0x1c, 0x20, 0x1d, 0x20, 0x22, + 0x20, 0x13, 0x20, 0x14, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xa0, 0x0e, 0x01, + 0x0e, 0x02, 0x0e, 0x03, 0x0e, 0x04, 0x0e, 0x05, 0x0e, 0x06, 0x0e, 0x07, + 0x0e, 0x08, 0x0e, 0x09, 0x0e, 0x0a, 0x0e, 0x0b, 0x0e, 0x0c, 0x0e, 0x0d, + 0x0e, 0x0e, 0x0e, 0x0f, 0x0e, 0x10, 0x0e, 0x11, 0x0e, 0x12, 0x0e, 0x13, + 0x0e, 0x14, 0x0e, 0x15, 0x0e, 0x16, 0x0e, 0x17, 0x0e, 0x18, 0x0e, 0x19, + 0x0e, 0x1a, 0x0e, 0x1b, 0x0e, 0x1c, 0x0e, 0x1d, 0x0e, 0x1e, 0x0e, 0x1f, + 0x0e, 0x20, 0x0e, 0x21, 0x0e, 0x22, 0x0e, 0x23, 0x0e, 0x24, 0x0e, 0x25, + 0x0e, 0x26, 0x0e, 0x27, 0x0e, 0x28, 0x0e, 0x29, 0x0e, 0x2a, 0x0e, 0x2b, + 0x0e, 0x2c, 0x0e, 0x2d, 0x0e, 0x2e, 0x0e, 0x2f, 0x0e, 0x30, 0x0e, 0x31, + 0x0e, 0x32, 0x0e, 0x33, 0x0e, 0x34, 0x0e, 0x35, 0x0e, 0x36, 0x0e, 0x37, + 0x0e, 0x38, 0x0e, 0x39, 0x0e, 0x3a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x0e, 0x3f, 0x0e, 0x40, 0x0e, 0x41, 0x0e, 0x42, 0x0e, 0x43, + 0x0e, 0x44, 0x0e, 0x45, 0x0e, 0x46, 0x0e, 0x47, 0x0e, 0x48, 0x0e, 0x49, + 0x0e, 0x4a, 0x0e, 0x4b, 0x0e, 0x4c, 0x0e, 0x4d, 0x0e, 0x4e, 0x0e, 0x4f, + 0x0e, 0x50, 0x0e, 0x51, 0x0e, 0x52, 0x0e, 0x53, 0x0e, 0x54, 0x0e, 0x55, + 0x0e, 0x56, 0x0e, 0x57, 0x0e, 0x58, 0x0e, 0x59, 0x0e, 0x5a, 0x0e, 0x5b, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +}; diff --git a/libs/libiconv/src/include/iconv.h b/libs/libiconv/src/include/iconv.h new file mode 100644 index 0000000..dfab27f --- /dev/null +++ b/libs/libiconv/src/include/iconv.h @@ -0,0 +1,32 @@ +#ifndef _ICONV_H +#define _ICONV_H 1 + +#define _LIBICONV_VERSION 0x010B /* version number: (major<<8) + minor */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +extern int _libiconv_version; /* Likewise */ + +typedef long iconv_t; + +extern iconv_t +iconv_open(const char *tocode, const char *fromcode); + +extern size_t +iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft); + +extern int +iconv_close(iconv_t cd); + +#define libiconv_set_relocation_prefix(...) do {} while(0) + +#ifdef __cplusplus +} +#endif + +#endif /* _ICONV_H */ diff --git a/libs/libiconv/src/m4/iconv.m4 b/libs/libiconv/src/m4/iconv.m4 new file mode 100644 index 0000000..e2041b9 --- /dev/null +++ b/libs/libiconv/src/m4/iconv.m4 @@ -0,0 +1,214 @@ +# iconv.m4 serial 11 (gettext-0.18.1) +dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], +[ + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([iconv]) +]) + +AC_DEFUN([AM_ICONV_LINK], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + + dnl Add $INCICONV to CPPFLAGS before performing the following checks, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. The first + dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + am_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) + + AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + [am_cv_func_iconv=yes]) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + [am_cv_lib_iconv=yes] + [am_cv_func_iconv=yes]) + LIBS="$am_save_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ + dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10. + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + AC_TRY_RUN([ +#include +#include +int main () +{ + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + return 1; + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\263"; + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + return 1; + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + return 1; + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + return 1; + return 0; +}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], + [case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac]) + LIBS="$am_save_LIBS" + ]) + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + AC_DEFINE([HAVE_ICONV], [1], + [Define if you have the iconv() function and it works.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + AC_MSG_RESULT([$LIBICONV]) + else + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV + dnl either. + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + AC_SUBST([LIBICONV]) + AC_SUBST([LTLIBICONV]) +]) + +dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to +dnl avoid warnings like +dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". +dnl This is tricky because of the way 'aclocal' is implemented: +dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. +dnl Otherwise aclocal's initial scan pass would miss the macro definition. +dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. +dnl Otherwise aclocal would emit many "Use of uninitialized value $1" +dnl warnings. +m4_define([gl_iconv_AC_DEFUN], + m4_version_prereq([2.64], + [[AC_DEFUN_ONCE( + [$1], [$2])]], + [[AC_DEFUN( + [$1], [$2])]])) +gl_iconv_AC_DEFUN([AM_ICONV], +[ + AM_ICONV_LINK + if test "$am_cv_func_iconv" = yes; then + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL([am_cv_proto_iconv], [ + AC_TRY_COMPILE([ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif +], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([ + $am_cv_proto_iconv]) + AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], + [Define as const if the declaration of iconv() needs const.]) + fi +]) diff --git a/libs/libid3tag/Makefile b/libs/libid3tag/Makefile new file mode 100644 index 0000000..00da827 --- /dev/null +++ b/libs/libid3tag/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libid3tag +PKG_VERSION:=0.15.1b +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/mad +PKG_MD5SUM:=e5808ad997ba32c498803822078748c3 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libid3tag + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+zlib + TITLE:=An ID3 tag manipulation library + URL:=http://mad.sourceforge.net/ +endef + +define Package/libid3tag/description + libid3tag is a library for reading and (eventually) writing ID3 tags, both + ID3v1 and the various versions of ID3v2. +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + --disable-debugging \ + --disable-profiling \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/id3tag.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libid3tag.so* $(1)/usr/lib/ +endef + +define Package/libid3tag/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libid3tag.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libid3tag)) diff --git a/libs/libidn/Makefile b/libs/libidn/Makefile new file mode 100644 index 0000000..c23ce70 --- /dev/null +++ b/libs/libidn/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libidn +PKG_VERSION:=1.18 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/libidn +PKG_MD5SUM:=66f115347439f56386f37a3ad92c1da2 + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=GNUmakefile aclocal.m4 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libidn + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Stringprep, Punycode and IDNA implementation + URL:=http://www.gnu.org/software/libidn/ +endef + +define Package/libidn/description + GNU Libidn is a fully documented implementation of the Stringprep, + Punycode and IDNA specifications. Libidn's purpose is to encode and + decode internationalized domain names. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + +MAKE_FLAGS += \ + CC="$(TARGET_CC)" \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libidn.{a,so*} $(1)/usr/lib/ +endef + +define Package/libidn/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libidn.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libidn)) diff --git a/libs/libidn/patches/001-remove-libtool.patch b/libs/libidn/patches/001-remove-libtool.patch new file mode 100644 index 0000000..942094d --- /dev/null +++ b/libs/libidn/patches/001-remove-libtool.patch @@ -0,0 +1,10 @@ +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -1080,7 +1080,6 @@ m4_include([m4/intlmacosx.m4]) + m4_include([m4/lib-ld.m4]) + m4_include([m4/lib-link.m4]) + m4_include([m4/lib-prefix.m4]) +-m4_include([m4/libtool.m4]) + m4_include([m4/longlong.m4]) + m4_include([m4/ltoptions.m4]) + m4_include([m4/ltsugar.m4]) diff --git a/libs/libidn/patches/002-disable-po-docs-examples.patch b/libs/libidn/patches/002-disable-po-docs-examples.patch new file mode 100644 index 0000000..817749e --- /dev/null +++ b/libs/libidn/patches/002-disable-po-docs-examples.patch @@ -0,0 +1,22 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -16,7 +16,7 @@ + # You should have received a copy of the GNU General Public License + # along with this program. If not, see . + +-SUBDIRS = gl lib/gl lib po src doc gltests lib/gltests tests examples \ ++SUBDIRS = gl lib/gl lib src \ + java csharp + + EXTRA_DIST = cfg.mk maint.mk .clcopying +--- a/configure.ac ++++ b/configure.ac +@@ -46,8 +46,6 @@ gl_EARLY + AC_PROG_LIBTOOL + AM_MISSING_PROG(PERL, perl, $missing_dir) + AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir) +-AM_GNU_GETTEXT(external) +-AM_GNU_GETTEXT_VERSION(0.17) + AM_ICONV + AM_PATH_LISPDIR + diff --git a/libs/libimobiledevice/Makefile b/libs/libimobiledevice/Makefile new file mode 100644 index 0000000..9c2e536 --- /dev/null +++ b/libs/libimobiledevice/Makefile @@ -0,0 +1,91 @@ +# +# Copyright (C) 2012 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:=libimobiledevice +PKG_REV:=c182599c8c18ed729726ea7cbbd0a3b89790d2db +PKG_VERSION:=20120112 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=git://git.sukimashita.com/libimobiledevice.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk +$(call include_mk, python-package.mk) + +define Package/libimobiledevice/Default + TITLE:=A library that talks to Apple devices. + URL:=http://www.libimobiledevice.org/ +endef + +define Package/libimobiledevice/Default/description + libimobiledevice is a software library that talks the protocols to support + iPhone®, iPod Touch®, iPad® and Apple TV® devices. +endef + +define Package/libimobiledevice + $(call Package/libimobiledevice/Default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+glib2 +libgcrypt +libgnutls $(ICONV_DEPENDS) +libplist +libtasn1 +libusbmuxd +endef + +define Package/libimobiledevice/description + $(call Package/libimobiledevice/Default/description) +endef + +define Package/libimobiledevice-utils + $(call Package/libimobiledevice/Default) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libimobiledevice +endef + +define Package/libimobiledevice-utils/description + $(call Package/libimobiledevice/Default/description) + This package contains the libimobiledevice utilities. +endef + +CONFIGURE_VARS += \ + libusbmuxd_CFLAGS="-I$(STAGING_DIR)/usr/include" \ + libusbmuxd_LIBS="-L$(STAGING_DIR)/usr/lib -lusbmuxd" + +CONFIGURE_ARGS += \ + --without-swig \ + --disable-largefile + +TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libimobiledevice $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libimobiledevice.{a,la,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libimobiledevice-*.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libimobiledevice/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libimobiledevice.so.* $(1)/usr/lib/ +endef + +define Package/libimobiledevice-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/idevice* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libimobiledevice)) +$(eval $(call BuildPackage,libimobiledevice-utils)) diff --git a/libs/libinklevel/Makefile b/libs/libinklevel/Makefile new file mode 100644 index 0000000..c3012a9 --- /dev/null +++ b/libs/libinklevel/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libinklevel +PKG_VERSION:=0.8.0 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/libinklevel +PKG_MD5SUM:=83464cb23fe46a1d1adbe10f08b247be + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libinklevel + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=$(if $(WITH_PARPORT), +libieee1284) + TITLE:=Printers Ink Level Library + URL:=http://libinklevel.sourceforge.net/ +endef + +define Package/libinklevel/description + Libinklevel is a library for checking the ink level of your printer on a system which runs Linux. +endef + +TARGET_CFLAGS += $(FPIC) +TARGET_LIBS += $(if $(WITH_PARPORT), -lieee1284) +MAKE_ARGS += LIBS="$(TARGET_LIBS)" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/inklevel.h \ + $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libinklevel.so* \ + $(1)/usr/lib/ +endef + +define Package/libinklevel/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libinklevel.so* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libinklevel)) diff --git a/libs/libinklevel/patches/001-configure.patch b/libs/libinklevel/patches/001-configure.patch new file mode 100644 index 0000000..8fda561 --- /dev/null +++ b/libs/libinklevel/patches/001-configure.patch @@ -0,0 +1,275 @@ +--- a/configure ++++ b/configure +@@ -12070,7 +12070,7 @@ fi + ## Check for optional header files + + +-for ac_header in ifaddrs.h ieee1284.h ++for ac_header in ifaddrs.h + do + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` + if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +@@ -13690,235 +13690,6 @@ case $host in + cat >>confdefs.h <<_ACEOF + #define HOST_OS LINUX + _ACEOF +- +- +-for ac_header in ieee1284.h +-do +-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +- { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +-$as_echo_n "checking for $ac_header... " >&6; } +-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +- $as_echo_n "(cached) " >&6 +-fi +-ac_res=`eval 'as_val=${'$as_ac_Header'} +- $as_echo "$as_val"'` +- { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +-$as_echo "$ac_res" >&6; } +-else +- # Is the header compilable? +-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +-$as_echo_n "checking $ac_header usability... " >&6; } +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-$ac_includes_default +-#include <$ac_header> +-_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 +- ac_header_compiler=yes +-else +- $as_echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_header_compiler=no +-fi +- +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +-$as_echo "$ac_header_compiler" >&6; } +- +-# Is the header present? +-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +-$as_echo_n "checking $ac_header presence... " >&6; } +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include <$ac_header> +-_ACEOF +-if { (ac_try="$ac_cpp conftest.$ac_ext" +-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_cpp conftest.$ac_ext") 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); } >/dev/null && { +- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || +- test ! -s conftest.err +- }; then +- ac_header_preproc=yes +-else +- $as_echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_header_preproc=no +-fi +- +-rm -f conftest.err conftest.$ac_ext +-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +-$as_echo "$ac_header_preproc" >&6; } +- +-# So? What about this header? +-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in +- yes:no: ) +- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} +- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} +- ac_header_preproc=yes +- ;; +- no:yes:* ) +- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} +- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +-$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} +- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} +- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +-$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} +- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} +- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +- +- ;; +-esac +-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +-$as_echo_n "checking for $ac_header... " >&6; } +-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +- $as_echo_n "(cached) " >&6 +-else +- eval "$as_ac_Header=\$ac_header_preproc" +-fi +-ac_res=`eval 'as_val=${'$as_ac_Header'} +- $as_echo "$as_val"'` +- { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +-$as_echo "$ac_res" >&6; } +- +-fi +-as_val=`eval 'as_val=${'$as_ac_Header'} +- $as_echo "$as_val"'` +- if test "x$as_val" = x""yes; then +- cat >>confdefs.h <<_ACEOF +-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +-_ACEOF +- +-else +- { { $as_echo "$as_me:$LINENO: error: ( required header file ieee1284.h missing)" >&5 +-$as_echo "$as_me: error: ( required header file ieee1284.h missing)" >&2;} +- { (exit 1); exit 1; }; } +-fi +- +-done +- +- +-{ $as_echo "$as_me:$LINENO: checking for ieee1284_open in -lieee1284" >&5 +-$as_echo_n "checking for ieee1284_open in -lieee1284... " >&6; } +-if test "${ac_cv_lib_ieee1284_ieee1284_open+set}" = set; then +- $as_echo_n "(cached) " >&6 +-else +- ac_check_lib_save_LIBS=$LIBS +-LIBS="-lieee1284 $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-/* Override any GCC internal prototype to avoid an error. +- Use char because int might match the return type of a GCC +- builtin and then its argument prototype would still apply. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-char ieee1284_open (); +-int +-main () +-{ +-return ieee1284_open (); +- ; +- 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 +- ac_cv_lib_ieee1284_ieee1284_open=yes +-else +- $as_echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_ieee1284_ieee1284_open=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 +-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ieee1284_ieee1284_open" >&5 +-$as_echo "$ac_cv_lib_ieee1284_ieee1284_open" >&6; } +-if test "x$ac_cv_lib_ieee1284_ieee1284_open" = x""yes; then +- cat >>confdefs.h <<_ACEOF +-#define HAVE_LIBIEEE1284 1 +-_ACEOF +- +- LIBS="-lieee1284 $LIBS" +- +-else +- { { $as_echo "$as_me:$LINENO: error: Library not found" >&5 +-$as_echo "$as_me: error: Library not found" >&2;} +- { (exit 1); exit 1; }; } +-fi + ;; + + *-*-solaris2.*) +--- a/configure.in ++++ b/configure.in +@@ -60,7 +60,7 @@ fi + + + ## Check for optional header files +-AC_CHECK_HEADERS([ifaddrs.h ieee1284.h]) ++AC_CHECK_HEADERS([ifaddrs.h]) + + ## Check for mandatory header files + +@@ -95,15 +95,7 @@ AC_TYPE_UINT32_T + AC_TYPE_UINT8_T + AC_DEFINE_UNQUOTED(LINUX,1,[Define value for Linux OS]) + AC_DEFINE_UNQUOTED(OPENSOLARIS,2,[Define value for OpenSolaris OS]) +-case $host in +- *-*-linux*) AC_DEFINE_UNQUOTED(HOST_OS,LINUX,[Host OS]) +- AC_CHECK_HEADERS([ieee1284.h],, +- AC_MSG_ERROR(( required header file ieee1284.h missing))) +- AC_CHECK_LIB([ieee1284],ieee1284_open,, AC_MSG_ERROR(Library not found),);; +- +- *-*-solaris2.*) AC_DEFINE(HOST_OS,OPENSOLARIS,[HOST OS]);; +- *-*-*) AC_MSG_ERROR( Host OS not (yet) supported) ;; +-esac ++AC_DEFINE_UNQUOTED(HOST_OS,LINUX,[Host OS]) + + ## Variables to be exported + diff --git a/libs/libinklevel/patches/002-disable_parport.patch b/libs/libinklevel/patches/002-disable_parport.patch new file mode 100644 index 0000000..72d0338 --- /dev/null +++ b/libs/libinklevel/patches/002-disable_parport.patch @@ -0,0 +1,55 @@ +--- a/linux.c ++++ b/linux.c +@@ -16,10 +16,11 @@ + #include + #include + ++#ifdef WITH_PARPORT + /* ieee1284.h uses HAVE_IEEE1284_H, so we undefine it */ + #undef HAVE_IEEE1284_H + #include +- ++#endif + #include "internal.h" + #include "inklevel.h" + #include "platform_specific.h" +@@ -32,7 +33,9 @@ + + int get_device_id(const int port, const char *device_file, + const int portnumber, char *device_id) { ++#ifdef WITH_PARPORT + struct parport_list parports; ++#endif + char tmp[BUFLEN]; + char device_file1[256]; + char device_file2[256]; +@@ -41,6 +44,7 @@ int get_device_id(const int port, const + char *c; + int realsize; + ++#ifdef WITH_PARPORT + if (port == PARPORT ) { + /* check if we have appropiate permissions */ + +@@ -73,7 +77,9 @@ int get_device_id(const int port, const + + return COULD_NOT_GET_DEVICE_ID; + +- } else if (port == USB || port == CUSTOM_USB) { ++ } else ++#endif ++ if (port == USB || port == CUSTOM_USB) { + + if (port == USB) { + sprintf(device_file1, "/dev/usb/lp%d", portnumber); +@@ -138,8 +144,10 @@ int open_printer_device(const int port, + if (port == USB) { + sprintf(device_file1, "/dev/usb/lp%d", portnumber); + sprintf(device_file2, "/dev/usblp%d", portnumber); ++#ifdef WITH_PARPORT + } else if (port == PARPORT) { + sprintf(device_file1, "/dev/lp%d", portnumber); ++#endif + } else if (port == CUSTOM_USB) { + strncpy(device_file1, device_file, 255); + device_file1[255] = '\0'; diff --git a/libs/libinklevel/patches/003-fix_usb_device_location.patch b/libs/libinklevel/patches/003-fix_usb_device_location.patch new file mode 100644 index 0000000..7bf78c3 --- /dev/null +++ b/libs/libinklevel/patches/003-fix_usb_device_location.patch @@ -0,0 +1,20 @@ +--- a/linux.c ++++ b/linux.c +@@ -82,7 +82,7 @@ int get_device_id(const int port, const + if (port == USB || port == CUSTOM_USB) { + + if (port == USB) { +- sprintf(device_file1, "/dev/usb/lp%d", portnumber); ++ sprintf(device_file1, "/dev/lp%d", portnumber); + sprintf(device_file2, "/dev/usblp%d", portnumber); + fd = open(device_file1, O_RDONLY); + if (fd == -1) { +@@ -142,7 +142,7 @@ int open_printer_device(const int port, + int fd; + + if (port == USB) { +- sprintf(device_file1, "/dev/usb/lp%d", portnumber); ++ sprintf(device_file1, "/dev/lp%d", portnumber); + sprintf(device_file2, "/dev/usblp%d", portnumber); + #ifdef WITH_PARPORT + } else if (port == PARPORT) { diff --git a/libs/liblo/Makefile b/libs/liblo/Makefile new file mode 100644 index 0000000..8cd04bb --- /dev/null +++ b/libs/liblo/Makefile @@ -0,0 +1,83 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=liblo +PKG_VERSION:=0.26 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/liblo +PKG_MD5SUM:=5351de14262560e15e7f23865293b16f + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=autogen.sh aclocal.m4 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/liblo/Default + SUBMENU:=Sound + TITLE:=Lightweight Open Sound Control (OSC) + URL:=http://liblo.sourceforge.net/ +endef + +define Package/liblo +$(call Package/liblo/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= library + DEPENDS:= +libpthread +endef + +define Package/liblo-utils +$(call Package/liblo/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= utilities + DEPENDS:= +liblo +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/include/lo \ + $(1)/usr/include/ \ + ) + $(INSTALL_DIR) $(1)/usr/lib + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/liblo.so* \ + $(1)/usr/lib/ \ + ) + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/pkgconfig/liblo.pc \ + $(1)/usr/lib/pkgconfig/ \ + ) +endef + +define Package/liblo/install + $(INSTALL_DIR) $(1)/usr/lib + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/liblo.so.* \ + $(1)/usr/lib/ \ + ) +endef + +define Package/liblo-utils/install + $(INSTALL_DIR) $(1)/usr/bin + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/bin/oscdump \ + ./usr/bin/oscsend \ + $(1)/usr/bin/ \ + ) +endef + +$(eval $(call BuildPackage,liblo)) +$(eval $(call BuildPackage,liblo-utils)) diff --git a/libs/libmad/Makefile b/libs/libmad/Makefile new file mode 100644 index 0000000..aaafb90 --- /dev/null +++ b/libs/libmad/Makefile @@ -0,0 +1,82 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libmad +PKG_VERSION:=0.15.1b +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/mad \ + ftp://ftp.mars.org/pub/mpeg/ +PKG_MD5SUM:=1be543bc30c56fb6bea1d7bf6a64e66c + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +FPM:=default +ifeq ($(ARCH),armeb) + FPM:=arm +endif +ifeq ($(ARCH),i386) + FPM:=intel +endif +ifeq ($(ARCH),mipsel) + FPM:=mips +endif + +define Package/libmad + SECTION:=libs + CATEGORY:=Libraries + TITLE:=An high-quality MPEG audio decoding library + URL:=http://www.underbit.com/products/mad/ + DEPENDS:=@BUILD_PATENTED +endef + +define Package/libmad/description + MAD is a high-quality MPEG audio decoder. It currently supports + MPEG-1 and the MPEG-2 extension to lower sampling frequencies, + as well as the de facto MPEG 2.5 format. All three audio layers - + Layer I, Layer II, and Layer III (i.e. MP3) - are fully implemented. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS+= \ + --enable-shared \ + --enable-static \ + --enable-fpm="$(FPM)" \ + --disable-debugging \ + --enable-speed \ + +# XXX: configure is parsing and "optimizing" CFLAGS, adding unsupported +# XXX: compiler args to it (like -fforce-mem) +# XXX: so pass an empty one to configure +CONFIGURE_VARS+= \ + CFLAGS="" \ + +# XXX: and pass our own to make +MAKE_FLAGS+= \ + CFLAGS="$(TARGET_CFLAGS)" \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/mad.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.{a,so*} $(1)/usr/lib/ +endef + +define Package/libmad/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libmad)) diff --git a/libs/libmad/patches/001-mips_removal_h_constraint.patch b/libs/libmad/patches/001-mips_removal_h_constraint.patch new file mode 100644 index 0000000..b65555e --- /dev/null +++ b/libs/libmad/patches/001-mips_removal_h_constraint.patch @@ -0,0 +1,70 @@ +diff -ur libmad-0.15.1b-orig/fixed.h libmad-0.15.1b/fixed.h +--- libmad-0.15.1b-orig/fixed.h 2004-02-17 12:32:03.000000000 +1030 ++++ libmad-0.15.1b/fixed.h 2009-08-05 10:46:30.000000000 +0930 +@@ -299,6 +299,23 @@ + + # elif defined(FPM_MIPS) + ++/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */ ++#if defined (__GNUC__) && defined (__GNUC_MINOR__) ++#define __GNUC_PREREQ(maj, min) \ ++ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) ++#else ++#define __GNUC_PREREQ(maj, min) 0 ++#endif ++ ++#if __GNUC_PREREQ(4,4) ++ typedef unsigned int u64_di_t __attribute__ ((mode (DI))); ++# define MAD_F_MLX(hi, lo, x, y) \ ++ do { \ ++ u64_di_t __ll = (u64_di_t) (x) * (y); \ ++ hi = __ll >> 32; \ ++ lo = __ll; \ ++ } while (0) ++#else + /* + * This MIPS version is fast and accurate; the disposition of the least + * significant bit depends on OPT_ACCURACY via mad_f_scale64(). +@@ -328,6 +345,7 @@ + : "%r" ((x) >> 12), "r" ((y) >> 16)) + # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo)) + # endif ++#endif /* __GNU_PREREQ(4,4) */ + + # if defined(OPT_SPEED) + # define mad_f_scale64(hi, lo) \ +diff -ur libmad-0.15.1b-orig/mad.h libmad-0.15.1b/mad.h +--- libmad-0.15.1b-orig/mad.h 2004-02-17 13:25:44.000000000 +1030 ++++ libmad-0.15.1b/mad.h 2009-08-05 10:42:40.000000000 +0930 +@@ -344,6 +344,23 @@ + + # elif defined(FPM_MIPS) + ++/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */ ++#if defined (__GNUC__) && defined (__GNUC_MINOR__) ++#define __GNUC_PREREQ(maj, min) \ ++ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) ++#else ++#define __GNUC_PREREQ(maj, min) 0 ++#endif ++ ++#if __GNUC_PREREQ(4,4) ++ typedef unsigned int u64_di_t __attribute__ ((mode (DI))); ++# define MAD_F_MLX(hi, lo, x, y) \ ++ do { \ ++ u64_di_t __ll = (u64_di_t) (x) * (y); \ ++ hi = __ll >> 32; \ ++ lo = __ll; \ ++ } while (0) ++#else + /* + * This MIPS version is fast and accurate; the disposition of the least + * significant bit depends on OPT_ACCURACY via mad_f_scale64(). +@@ -373,6 +390,7 @@ + : "%r" ((x) >> 12), "r" ((y) >> 16)) + # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo)) + # endif ++#endif /* __GNU_PREREQ(4,4) */ + + # if defined(OPT_SPEED) + # define mad_f_scale64(hi, lo) \ diff --git a/libs/libmbus/Makefile b/libs/libmbus/Makefile new file mode 100644 index 0000000..08468e8 --- /dev/null +++ b/libs/libmbus/Makefile @@ -0,0 +1,105 @@ +# +# Copyright (C) 2011-2012 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:=libmbus +PKG_VERSION:=0.7.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.freescada.com/public-dist/ +PKG_MD5SUM:=2f1a7ba0ccd683e6708364a13310a6d1 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libmbus/Default + SECTION:=utils + CATEGORY:=Utilities + URL:=http://www.freescada.com/libmbus/ + TITLE:=mbus-tools +endef + +define Package/libmbus/Default/description + libmbus is an open source M-bus (Meter-Bus) library. + The Meter-Bus is a standard for reading out meter data from + electricity meters, heat meters, gas meters, etc. +endef + +define Package/libmbus + $(call Package/libmbus/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE:=libmbus +endef + +define Package/libmbus/description + $(call Package/libmbus/Default/description) + + This package contains the M-bus shared library, used by other programs. +endef + +define Package/mbus-serial + $(call Package/libmbus/Default) + DEPENDS+=+libmbus + TITLE+= (serial) +endef + +define Package/mbus-serial/description + $(call Package/libmbus/Default/description) + + This package contains command line tools for scanning the M-bus + and retrieving data from meters which are connected through a + serial (e.g. RS232) interface. +endef + +define Package/mbus-tcp + $(call Package/libmbus/Default) + DEPENDS+=+libmbus + TITLE+= (tcp) +endef + +define Package/mbus-tcp/description + $(call Package/libmbus/Default/description) + + This package contains command line tools for scanning the M-bus + and retrieving data from meters which are accessible through + M-bus gateways via TCP. +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/mbus $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmbus.{so*,la} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmbus.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libmbus/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmbus.so* $(1)/usr/lib/ +endef + +define Package/mbus-serial/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mbus-serial-* $(1)/usr/bin/ +endef + +define Package/mbus-tcp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mbus-tcp-* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libmbus)) +$(eval $(call BuildPackage,mbus-serial)) +$(eval $(call BuildPackage,mbus-tcp)) diff --git a/libs/libmcrypt/Makefile b/libs/libmcrypt/Makefile new file mode 100644 index 0000000..e676daf --- /dev/null +++ b/libs/libmcrypt/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libmcrypt +PKG_VERSION:=2.5.8 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/mcrypt +PKG_MD5SUM:=c4f491dd411a09e9de3b8702ea6f73eb + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(FPIC) + +define Package/libmcrypt + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Cryptographic library + URL:=http://mcrypt.sourceforge.net/ +endef + +define Package/libmcrypt/description + libmcrypt is a cryptographic library that conveniently brings + together a variety of ciphers for convenient use. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + ) +endef + +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/libmcrypt.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libmcrypt-config $(1)/usr/bin/ + $(SED) 's,-I$$$${prefix}/include,,g' $(1)/usr/bin/libmcrypt-config + $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(1)/usr/bin/libmcrypt-config +endef + +define Package/libmcrypt/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmcrypt.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libmcrypt)) diff --git a/libs/libmicrohttpd/Makefile b/libs/libmicrohttpd/Makefile new file mode 100644 index 0000000..ee1f546 --- /dev/null +++ b/libs/libmicrohttpd/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2011-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libmicrohttpd +PKG_VERSION:=0.9.19 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/libmicrohttpd +PKG_MD5SUM:=0f4c55ba224ce75b3b993b558e072a6b + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libmicrohttpd + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Microhttpd + URL:=http://www.gnu.org/software/libmicrohttpd + DEPENDS:=+libpthread +endef + +define Package/libmicrohttpd/description + GNU libmicrohttpd is a small C library that is supposed to make it easy to run an HTTP server as part of another application. +endef + +CONFIGURE_ARGS+= \ + --disable-curl \ + --disable-https \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/microhttpd.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmicrohttpd.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmicrohttpd.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libmicrohttpd/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmicrohttpd.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libmicrohttpd)) diff --git a/libs/libmicroxml/Makefile b/libs/libmicroxml/Makefile new file mode 100644 index 0000000..559cc75 --- /dev/null +++ b/libs/libmicroxml/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2012 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:=libmicroxml +PKG_VERSION:=2012-06-11 +PKG_RELEASE=$(PKG_SOURCE_VERSION) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://dev.freecwmp.org/microxml +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=72965423184f24cc0b963d91c2d1863cdb01b6aa +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/libmicroxml + SECTION:=libs + CATEGORY:=Libraries + TITLE:=XML library +endef + +define Package/libmicroxml/description + A micro sized XML library +endef + +CONFIGURE_ARGS += \ + --disable-threads \ + --enable-static \ + --enable-shared + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/microxml.h $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libmicroxml.so* $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_BUILD_DIR)/microxml.pc $(1)/usr/lib/pkgconfig +endef + +define Package/libmicroxml/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libmicroxml.so* $(1)/usr/lib +endef + +$(eval $(call BuildPackage,libmicroxml)) diff --git a/libs/libmikmod/Makefile b/libs/libmikmod/Makefile new file mode 100644 index 0000000..50d7a3c --- /dev/null +++ b/libs/libmikmod/Makefile @@ -0,0 +1,77 @@ +# +# Copyright (C) 2010-2011 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:=libmikmod +PKG_VERSION:=3.1.12 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://prdownloads.sourceforge.net/mikmod +PKG_MD5SUM:=9f3c740298260d5f88981fc0d51f6f16 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libmikmod + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Mikmod sound library + URL:=http://mikmod.raphnet.net/ + DEPENDS:=+alsa-lib +libpthread +endef + +define Package/libmikmod/description + Mikmod is a library supporting many formats, including mod, s3m, it, and xm. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-af \ + --enable-alsa \ + --disable-oss \ + --disable-esd \ + --disable-sam9407 \ + --disable-ultra \ + --enable-dl \ + --disable-debug \ + --enable-threads \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/mikmod.h \ + $(1)/usr/include/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libmikmod.{a,la,so*} \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(2)/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/libmikmod-config \ + $(2)/bin + + $(SED) 's,^\(exec_prefix\|prefix\)=.*,\1=\"$(STAGING_DIR)/usr/\",g' \ + $(2)/bin/libmikmod-config + + $(INSTALL_DIR) $(1)/usr/share/aclocal + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/aclocal/* \ + $(1)/usr/share/aclocal/ +endef + +define Package/libmikmod/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmikmod.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libmikmod)) diff --git a/libs/libmikmod/patches/001-disable-doc.patch b/libs/libmikmod/patches/001-disable-doc.patch new file mode 100644 index 0000000..723102b --- /dev/null +++ b/libs/libmikmod/patches/001-disable-doc.patch @@ -0,0 +1,21 @@ +--- libmikmod-3.1.12/Makefile.am 2004-01-21 17:43:53.000000000 +0000 ++++ libmikmod-3.1.12/Makefile.am.new 2010-07-03 12:12:51.946725127 +0000 +@@ -1,6 +1,6 @@ + AUTOMAKE_OPTIONS = foreign + SUBDIRS = drivers include libmikmod loaders mmio playercode \ +- docs dlapi macintosh posix os2 win32 ++ dlapi macintosh posix os2 win32 + + bin_SCRIPTS = libmikmod-config + +--- libmikmod-3.1.12/Makefile.in 2004-01-21 17:43:53.000000000 +0000 ++++ libmikmod-3.1.12/Makefile.in.new 2010-07-03 12:12:39.626725146 +0000 +@@ -86,7 +86,7 @@ + VERSION = @VERSION@ + + AUTOMAKE_OPTIONS = foreign +-SUBDIRS = drivers include libmikmod loaders mmio playercode docs dlapi macintosh posix os2 win32 ++SUBDIRS = drivers include libmikmod loaders mmio playercode dlapi macintosh posix os2 win32 + + + bin_SCRIPTS = libmikmod-config diff --git a/libs/libmikmod/patches/003-automake-compat.patch b/libs/libmikmod/patches/003-automake-compat.patch new file mode 100644 index 0000000..bf94fca --- /dev/null +++ b/libs/libmikmod/patches/003-automake-compat.patch @@ -0,0 +1,16 @@ +--- a/libmikmod-config.in ++++ b/libmikmod-config.in +@@ -1,4 +1,4 @@ +-#! /bin/sh ++#! @SHELL@ + + prefix=@prefix@ + exec_prefix=@exec_prefix@ +--- a/libmikmod/Makefile.in ++++ b/libmikmod/Makefile.in +@@ -1,3 +1,5 @@ ++SHELL = @SHELL@ ++ + exec_prefix=@exec_prefix@ + prefix=@prefix@ + diff --git a/libs/libmms/Makefile b/libs/libmms/Makefile new file mode 100644 index 0000000..4c822ec --- /dev/null +++ b/libs/libmms/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2010-2011 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:=libmms +PKG_VERSION:=0.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/libmms +PKG_MD5SUM:=650ad04a4c8bd79246390b81b29680b6 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/libmms + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+glib2 + TITLE:=MMS stream protocol library + URL:=http://libmms.sourceforge.net +endef + +define Package/libmms/description + LibMMS is a common library for parsing mms:// and mmsh:// type network streams. + These are commonly used to stream Windows Media Video content over the web. + LibMMS itself is only for receiving MMS stream, + it doesn't handle sending at all. +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Configure + (cd $(PKG_BUILD_DIR); ./autogen.sh ); + $(call Build/Configure/Default) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libmms $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmms.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \ + $(1)/usr/lib/pkgconfig +endef + +define Package/libmms/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmms.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libmms)) diff --git a/libs/libmnl/Makefile b/libs/libmnl/Makefile new file mode 100644 index 0000000..865ac9f --- /dev/null +++ b/libs/libmnl/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (C) 2011 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:=libmnl +PKG_VERSION:=1.0.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://www.netfilter.org/projects/libmnl/files \ + ftp://ftp.netfilter.org/pub/libmnl +PKG_MD5SUM:=e936236bb57a2375afa4e70e75dc3ba9 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libmnl + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Minimalistic user-space library for Netlink + URL:=http://www.netfilter.org/projects/libmnl/ +endef + +define Package/libmnl/description + libmnl is a minimalistic user-space library oriented to Netlink developers. + There are a lot of common tasks in parsing, validating, constructing of + both the Netlink header and TLVs that are repetitive and easy to get wrong. + This library aims to provide simple helpers that allows you to re-use code + and to avoid re-inventing the wheel. The main features of this library are: + . + * Small: the shared library requires around 30KB for an x86-based computer. + . + * Simple: this library avoids complexity and elaborated abstractions that + tend to hide Netlink details. + . + * Easy to use: the library simplifies the work for Netlink-wise developers. + It provides functions to make socket handling, message building, validating, + parsing and sequence tracking, easier. + . + * Easy to re-use: you can use the library to build your own abstraction layer + on top of this library. + . + * Decoupling: the interdependency of the main bricks that compose the library + is reduced, i.e. the library provides many helpers, but the programmer is not + forced to use them. +endef + +CONFIGURE_ARGS+= \ + --enable-shared \ + --enable-static \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libmnl $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmnl.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmnl.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libmnl/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmnl.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libmnl)) diff --git a/libs/libmodbus/Makefile b/libs/libmodbus/Makefile new file mode 100644 index 0000000..f9a9896 --- /dev/null +++ b/libs/libmodbus/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2006-2012 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:=libmodbus +PKG_VERSION:=3.0.2 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://github.com/downloads/stephane/libmodbus/ +PKG_MD5SUM:=1aaacce9d9779d3a84f7d1a75774c943 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libmodbus + SECTION:=libs + CATEGORY:=Libraries + URL:=http://www.libmodbus.org + TITLE:=libmodbus +endef + +define Package/libmodbus/description +A Modbus library for Linux, Mac OS X, FreeBSD, QNX and Win32 +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/modbus $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmodbus.{so*,la} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmodbus.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libmodbus/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmodbus.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libmodbus)) diff --git a/libs/libmpcdec/Makefile b/libs/libmpcdec/Makefile new file mode 100644 index 0000000..b63b0f0 --- /dev/null +++ b/libs/libmpcdec/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2007-2009 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:=libmpcdec +PKG_VERSION:=1.2.6 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://files.musepack.net/source/ +PKG_MD5SUM:=7f7a060e83b4278acf4b77d7a7b9d2c0 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +PKG_INSTALL=1 + +define Package/libmpcdec + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Musepack decoder library + URL:=http://www.musepack.net +endef + +define Package/libmpcdec/description + Musepack decoder library +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/mpcdec/ + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/mpcdec/*.h \ + $(1)/usr/include/mpcdec/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} \ + $(1)/usr/lib/ +endef + +define Package/libmpcdec/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libmpcdec.so* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libmpcdec)) diff --git a/libs/libmpcdec/patches/001-automake-compat.patch b/libs/libmpcdec/patches/001-automake-compat.patch new file mode 100644 index 0000000..4cb4c5a --- /dev/null +++ b/libs/libmpcdec/patches/001-automake-compat.patch @@ -0,0 +1,10 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -4,6 +4,7 @@ AC_CONFIG_AUX_DIR(config) + AM_INIT_AUTOMAKE(libmpcdec,1.2.6) + AM_CONFIG_HEADER(include/config.h) + ++AC_PROG_CXX + AM_PROG_LIBTOOL + + CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -fPIC" diff --git a/libs/libmpcdec/patches/100-fixed_point.patch b/libs/libmpcdec/patches/100-fixed_point.patch new file mode 100644 index 0000000..0f7752f --- /dev/null +++ b/libs/libmpcdec/patches/100-fixed_point.patch @@ -0,0 +1,11 @@ +--- a/include/mpcdec/math.h ++++ b/include/mpcdec/math.h +@@ -38,7 +38,7 @@ + #ifndef _mpcdec_math_h_ + #define _mpcdec_math_h_ + +-//#define MPC_FIXED_POINT ++#define MPC_FIXED_POINT + + #define MPC_FIXED_POINT_SHIFT 16 + diff --git a/libs/libmpd/Makefile b/libs/libmpd/Makefile new file mode 100644 index 0000000..627db34 --- /dev/null +++ b/libs/libmpd/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libmpd +PKG_VERSION:=0.20.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.sarine.nl/Programs/gmpc/$(PKG_VERSION)/ +PKG_MD5SUM:=2f1c99e12c69f7d95cfd1e27368056ed + +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +TARGET_CFLAGS += $(FPIC) + +define Package/libmpd + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+glib2 + TITLE:=Libmpd is an a library to easily connect to a mpd server + URL:=http://gmpc.wikia.com/wiki/LIBMPD_RELEASES +endef + +define Package/libmpd/description +It's wraps around libmpdclient and provides a higher level api. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libmpd-1.0 $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmpd.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmpd.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libmpd/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmpd.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libmpd)) diff --git a/libs/libmpdclient/Makefile b/libs/libmpdclient/Makefile new file mode 100644 index 0000000..2e6ec93 --- /dev/null +++ b/libs/libmpdclient/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (C) 2011 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:=libmpdclient +PKG_VERSION:=2.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=https://sourceforge.net/projects/musicpd/files/libmpdclient/$(PKG_VERSION)/ +#PKG_SOURCE_URL:=@SF/musicpd/files/libmpdclient/$(PKG_VERSION) +PKG_MD5SUM:=8c166c5212dd95d538d3a35bb9ad4634 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libmpdclient + TITLE:=libmpdclient + SECTION:=libs + CATEGORY:=Libraries + URL:=http://mpd.wikia.com/wiki/ClientLib:libmpdclient + DEPENDS:= +endef + +define Package/libmpdclient/description + A stable, documented, asynchronous API library for interfacing MPD in the C, C++ & Objective C languages. +endef + +TARGET_CFLAGS+="-std=gnu99" + +#TARGET_LDFLAGS+=-lpthread + +define Build/Configure + $(call Build/Configure/Default) +endef + +define Build/InstallDev + $(INSTALL_DIR) \ + $(1)/usr/include \ + $(1)/usr/lib \ + $(1)/usr/lib/pkgconfig + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/* \ + $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/* \ + $(1)/usr/include/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig \ + $(1)/usr/lib/ +endef + +define Package/libmpdclient/install + $(INSTALL_DIR) \ + $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libmpdclient.so* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libmpdclient)) diff --git a/libs/libmpeg2/Makefile b/libs/libmpeg2/Makefile new file mode 100644 index 0000000..9d3c052 --- /dev/null +++ b/libs/libmpeg2/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2011 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:=libmpeg2 +PKG_VERSION:=0.5.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=libmpeg2-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://libmpeg2.sourceforge.net/files/ +PKG_MD5SUM:=0f92c7454e58379b4a5a378485bbd8ef + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libmpeg2 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=MPEG-1 & -2 decoding library + URL:=http://libmpeg2.sourceforge.net/ + MAINTAINER:=W. Michael Petullo +endef + +define Package/libmpeg2/decription + Libmpeg2 is a library for decoding MPEG-1 and MPEG-2 video streams +endef + +CONFIGURE_ARGS += \ + --disable-sdl \ + --without-x \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/mpeg2dec \ + $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libmpeg2{,convert}.{a,so*} \ + $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmpeg2{,convert}.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/libmpeg2/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libmpeg2{,convert}.so.* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libmpeg2)) diff --git a/libs/libmpeg2/patches/101-ppc_no_altivec.patch b/libs/libmpeg2/patches/101-ppc_no_altivec.patch new file mode 100644 index 0000000..49251a0 --- /dev/null +++ b/libs/libmpeg2/patches/101-ppc_no_altivec.patch @@ -0,0 +1,66 @@ +--- a/libmpeg2/motion_comp_altivec.c ++++ b/libmpeg2/motion_comp_altivec.c +@@ -25,6 +25,8 @@ + + #ifdef ARCH_PPC + ++#ifdef __I_WANT_ALTIVEC__ ++ + #ifdef HAVE_ALTIVEC_H + #include + #endif +@@ -1007,4 +1009,6 @@ static void MC_avg_xy_8_altivec (uint8_t + + MPEG2_MC_EXTERN (altivec) + ++#endif /* __I_WANT_ALTIVEC__ */ ++ + #endif +--- a/libmpeg2/idct_altivec.c ++++ b/libmpeg2/idct_altivec.c +@@ -25,6 +25,8 @@ + + #ifdef ARCH_PPC + ++#ifdef __I_WANT_ALTIVEC__ ++ + #ifdef HAVE_ALTIVEC_H + #include + #endif +@@ -283,4 +285,6 @@ void mpeg2_idct_altivec_init (void) + } + } + ++#endif /* __I_WANT_ALTIVEC__ */ ++ + #endif +--- a/libmpeg2/idct.c ++++ b/libmpeg2/idct.c +@@ -251,11 +251,13 @@ void mpeg2_idct_init (uint32_t accel) + } else + #endif + #ifdef ARCH_PPC ++#ifdef __I_WANT_ALTIVEC__ + if (accel & MPEG2_ACCEL_PPC_ALTIVEC) { + mpeg2_idct_copy = mpeg2_idct_copy_altivec; + mpeg2_idct_add = mpeg2_idct_add_altivec; + mpeg2_idct_altivec_init (); + } else ++#endif /* __I_WANT_ALTIVEC__ */ + #endif + #ifdef ARCH_ALPHA + if (accel & MPEG2_ACCEL_ALPHA_MVI) { +--- a/libmpeg2/motion_comp.c ++++ b/libmpeg2/motion_comp.c +@@ -43,9 +43,11 @@ void mpeg2_mc_init (uint32_t accel) + else + #endif + #ifdef ARCH_PPC ++#ifdef __I_WANT_ALTIVEC__ + if (accel & MPEG2_ACCEL_PPC_ALTIVEC) + mpeg2_mc = mpeg2_mc_altivec; + else ++#endif /* __I_WANT_ALTIVEC__ */ + #endif + #ifdef ARCH_ALPHA + if (accel & MPEG2_ACCEL_ALPHA) diff --git a/libs/libmpeg2/patches/102-arm_data_preload_check.patch b/libs/libmpeg2/patches/102-arm_data_preload_check.patch new file mode 100644 index 0000000..86793fc --- /dev/null +++ b/libs/libmpeg2/patches/102-arm_data_preload_check.patch @@ -0,0 +1,19 @@ +diff -urN libmpeg2-0.5.1/libmpeg2/motion_comp_arm_s.S libmpeg2-0.5.1.new/libmpeg2/motion_comp_arm_s.S +--- libmpeg2-0.5.1/libmpeg2/motion_comp_arm_s.S 2008-07-09 21:16:05.000000000 +0200 ++++ libmpeg2-0.5.1.new/libmpeg2/motion_comp_arm_s.S 2012-07-30 15:22:58.664964215 +0200 +@@ -19,6 +19,15 @@ + @ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + ++@ Data preload is supported only by ARM V5TE and above ++ ++#if (defined (__ARM_ARCH_2__) || defined (__ARM_ARCH_3__) \ ++ || defined (__ARM_ARCH_3M__) || defined (__ARM_ARCH_4__) \ ++ || defined (__ARM_ARCH_4T__) || defined (__ARM_ARCH_5__) \ ++ || defined (__ARM_ARCH_5T__)) ++.macro pld reg ++.endm ++#endif + .text + + @ ---------------------------------------------------------------- diff --git a/libs/libnatpmp/Makefile b/libs/libnatpmp/Makefile new file mode 100644 index 0000000..40d7b75 --- /dev/null +++ b/libs/libnatpmp/Makefile @@ -0,0 +1,83 @@ +# +# Copyright (C) 2011-2012 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:=libnatpmp +PKG_VERSION:=20110808 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://miniupnp.free.fr/files +PKG_MD5SUM:=22a1225b890471a7750a9bf26eb863f7 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libnatpmp/Default + TITLE:=NAT Port Mapping Protocol (NAT-PMP) + URL:=http://miniupnp.free.fr/libnatpmp.html +endef + +define Package/libnatpmp/Default/description + libnatpmp is an attempt to make a portable and fully compliant implementation + of the protocol for the client side. It is based on non blocking sockets and + all calls of the API are asynchronous. It is therefore very easy to integrate + the NAT-PMP code to any event driven code. +endef + +define Package/libnatpmp + $(call Package/libnatpmp/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= library +endef + +define Package/libnatpmp/description + $(call Package/libnatpmp/Default/description) + This package contains the shared library. +endef + +define Package/natpmpc + $(call Package/libnatpmp/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=Firewall + TITLE+= client + DEPENDS:=+libnatpmp +endef + +define Package/natpmpc/description + $(call Package/libnatpmp/Default/description) + This package contains the natpmp client. +endef + +MAKE_FLAGS += \ + COPTS="$(TARGET_CFLAGS)" \ + PREFIX="$(PKG_INSTALL_DIR)" \ + OS="Linux" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/natpmp.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnatpmp*.{so*,a} $(1)/usr/lib/ +endef + +define Package/libnatpmp/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libnatpmp.so.* $(1)/usr/lib/ +endef + +define Package/natpmpc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/natpmpc $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libnatpmp)) +$(eval $(call BuildPackage,natpmpc)) diff --git a/libs/libnatpmp/patches/001-cross_compile.patch b/libs/libnatpmp/patches/001-cross_compile.patch new file mode 100644 index 0000000..1136f93 --- /dev/null +++ b/libs/libnatpmp/patches/001-cross_compile.patch @@ -0,0 +1,12 @@ +--- a/Makefile ++++ b/Makefile +@@ -11,7 +11,8 @@ INSTALL = install + # APIVERSION is used in soname + APIVERSION = 1 + #LDFLAGS = -Wl,--no-undefined +-CFLAGS = -O -fPIC -Wall -DENABLE_STRNATPMPERR ++COPTS = -O ++CFLAGS = $(COPTS) -fPIC -Wall -DENABLE_STRNATPMPERR + + LIBOBJS = natpmp.o getgateway.o + diff --git a/libs/libnet-1.0.x/Makefile b/libs/libnet-1.0.x/Makefile new file mode 100644 index 0000000..e21b796 --- /dev/null +++ b/libs/libnet-1.0.x/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libnet0 +PKG_VERSION:=1.0.2a +PKG_RELEASE:=8 + +PKG_SOURCE:=libnet-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.packetfactory.net/libnet/dist/deprecated/ +PKG_MD5SUM:=ddf53f0f484184390e8c2a1bd0853667 + +PKG_BUILD_DIR:=$(BUILD_DIR)/Libnet-$(PKG_VERSION) +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libnet0 + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libpcap + TITLE:=Low-level packet creation library (v1.0.x) + URL:=http://www.packetfactory.net/libnet/ +endef + +ENDIANESS:=lil +ifeq ($(CONFIG_BIG_ENDIAN),y) + ENDIANESS:=big +endif + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --with-pf_packet=yes + +CONFIGURE_VARS += \ + ac_cv_libnet_endianess=$(ENDIANESS) \ + ac_libnet_have_pf_packet=yes \ + LL_INT_TYPE=sockpacket + +define Build/Configure + (cd $(PKG_BUILD_DIR); touch \ + configure.in \ + include.m4 \ + aclocal.m4 \ + Makefile.in \ + configure \ + ); + $(call Build/Configure/Default) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib/libnet-1.0.x/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libnet-config $(1)/usr/lib/libnet-1.0.x/bin/ + $(INSTALL_DIR) $(1)/usr/lib/libnet-1.0.x/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libnet* $(1)/usr/lib/libnet-1.0.x/include/ + $(INSTALL_DIR) $(1)/usr/lib/libnet-1.0.x/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.{a,so*} $(1)/usr/lib/libnet-1.0.x/lib/ +endef + +define Package/libnet0/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libnet0)) diff --git a/libs/libnet-1.0.x/patches/100-debian_subset.patch.gz b/libs/libnet-1.0.x/patches/100-debian_subset.patch.gz new file mode 100644 index 0000000000000000000000000000000000000000..0c1d676ca4b443b9be68ba77cd310f115ec80a91 GIT binary patch literal 208420 zcmV(vKzB?ue-h07nzP8EpP9IA%d#F| z-#UEp?7%uWgn#VduyJqz|7r*Fk5vy24-U4g)#`oCY#kjOJhcv%sSYI+Ts4;0c*9kt3l|_SDw$xyJ@tvli2lwxMIq!xzS<~h1=Eb>gf9AX>T}U zO$KyKa3Z4n(|FjnPkW;=;EH)~g3umyhP|sX@{4}BQ8)>vh`#mXB#6S=tigWl4oAH~ zf4jPs_#U%-wv*Ird-bn9kQ(|D%}U>t>O1T^R{oBC&&sWB?~y|#bh^)!QtgKaPEh_G z<0nOZ<}f~?QEXq22bb+1y7u5|48}ndPomflrXdR>%k!6h==q@=_z4;t2dZiJACotIkQmKA!C=pJD;7_*vOrMi5E`DzFPpO6@-&0^gpZ;9Qf}!^SytZq{Y|F zD)#LlT&_~+6-RVK=VtCh$KdaDwOA(1^KVwuX%J2sw#A&#W3bF_qQqx@97i#M}%`Pwokh+ug^i>WekS- zz_o9p?i>Ir`yYJQ7HGm406=p$WH537U|#n6_SFy?{YhZJuOOzrZT0${EJ`>ifxhUy z%%Wk23DjjfCsYH-yujM;j)W8W;y}Zi>Rca2knIZ5Z z*C2R8-MP3v?J5G%8-r-3h^$weh;+%C`Hlx()?_<-1lwd4x;R5JjH5>|CTYBKQ<$h3 z&dWz|E*v+GGF?#msXAvD?eme@2m!G9t1E@$7y$s>;N?HNo$*L(eubz246JJ?@);TQDmW);l6LQOdal-Yz@c^gqqyb1LbP%RBZriMZsU8~DT+S+Qx z3uaA7+s8!Jij{}f&>D7!_I}yRE!U$yo>2UQB&#%-8zfA)9!`o#O)BitC?pj~O)aq6 z!e9^O8u_q{##k)x@(7~Bo;`hfADNB?9wgOKMMZ52pTYAGsg5)rB-NphCN&*@MNgf= zo&tlI1;u!(@OXwI6da2Uq$k)^zk(#@fb1(ndU*sSC zMgGgb$lv~p{DUv#hk3ej;ubRSh-%{u#&wPVxpUtM(eVZo?lLX@t0k7A(kgsR7koyES-M$sgF?|{9}qE+b8VS1nSLYIs-o&`z9>`yj)NOaRs<<2`#wl# z3^4c|tx~p#ykHWzBsPQvCrR>fs^*m(sa+b??;z406D_*riZ z@!E);4Th|Z0*3X4)TJJ_M%}TE3A7g0MEaqr^A1&=97V9M0qV!A z_V`tXc=>J$aDAG=ZE%rmy_`P15xl|oh)7p6gs2OJ%$yFo<1B0& z7DSVEPEoaHsa*c^=g})$#B|l#r}8c$>`@oY(H;+ml@cx+*W0cNH;&yAMamIV0A?pM za_>SL38QG(TCi`Ak29oK!@>EmeOW-AA>&EmLMpkZyy~`3yF(($Y%|b#82kj2ScDW4 z)K*YCbQV64^#{YtHlE;Q=Nj8p*obm~!DyU?2)66~8e<-WtT~uC-NEr^4iPTclK^1N zS(KzE9P2oaPCWH92o7oSe68IXTwX#z-eg0t#$^|}OXIAZvga?8igEHcZzsS3ZWUl) zJOjmxA$V#%hVLCm*=IO!-!Wxv2ms}jUro}r! z0`e1BnX4N$&D))eK?jEC@|XtS)WdP-k?YKBi(|eTMBQE-lbH(W#o_{vf_|%RVUD}H zZg!Ga(2kCSAfC5RyI0-*X}90$;R%wrqWe(cf;qXZGW51g(MzMHPP$SibR8Fbp{UHG zDN1Ep+c})ZMg}JDk~MjwP{lc&*bC<)>{tLD z4X%eB)KRQFqdx3*uEB}^*tN&);dz(j9>a%oVGGG!u zQ{^iHH;o*lL}9MHfFmc!p`vm`l@!Ajo!Q>oel&`@)Qk(vY#kXaBCU4q}V&)OHGE)nReLXL;m1`cb4f)&c4V@$kPMQtcmLa6`Uj{OS5pAfH9&Pb2*R8`6hX<$!D*L6L(D|@Sic$dqKXqZ<5rj%D4COk8adfSvqdXB>w#>SL*5PC;2Qr9MFxkpN zOp-AGilk)_z;JP@>@A82q#TLdruCQ=!Pm&;9nu=TK&&yyWw8$Bq=T3Llz1$1poEC( zcrdsS5G-<_F&4UpD1FUAIOEnMgS4+ZIXpm+geD7KX+hEEn!qS_2Kje*4lCL3IO-6QqA`5^#t? z0tgBhnWAwVLo9Gm*Cu_}+R2sDne6wVP03kbkDP5><6;Z^IR zb#PqUO>OS9WLbfA>t~yp{F95F*OZUDGZOO2aKVcFyqAHNE zO?hyTu)Qdi1O`YD{l1D)#ZQ$M1)AcxFWwl4Go5*s6PI!Gz)2LCR~6D-t~3fN3K1DB zk*2@(LobRoiq`?HQwl9n1Yq_dMfMp5oivRTCLKJLuDT{sLQ`3m;7F54idJiBRP}Q* zp{MZz15uMm!Ks)@EpWK30ZQdZ@JOQNS&qUKjJb7J2!dy$18$;SkbOcJeXDua;8 z9EhZX8g#R+(PH3rO`{@{Ei!oY1jqnB^DSD@OSDbT3?F=Cc<&QKxmY5k4Tmjq-?OM31)BoC8ko#|2Sb@L`NvbTqp6_ zP9fV46Db-z80?kH0Nkr60As#8i`WjMJ3OHho*&A)a(LhvV##sYIWagN$3hHSfc8HG zDLXI)5ajSgg8amBdD)9XpO;MS45QuCoHVCUwTP29_W(bPIRp}&-r#!FFo3euC>q-! zTuX9f(lI!MVyOOMjLTkz$QT{bdzEgfWyKkzv57<(cU`Koj8c|cwO9}C{t<>TC~U4qikA@l4=|D!qrU&R^9lTbXwcRi?n!Ipe_{@ zXJqn}kbF9@SPEyX=%U@ern z+mq}vEOA3+6O|S457f>M`t-H#*URO}PRU&R1rkbJLaESzC_xFJ&Np;_(fQ)c*NHh} zTr&fyE;1@#G$3DMHeob=fBmp=INbv#kR4t?fI9z3`6_&cl}6DV`)kR|@_B?*#rSx_ zY5+@^jh{%Ta$g0q1jMv4Wk#Jv!?;ETHGMaY;*UECnZgqDLE3}SC4rjyr;e;M_vA5ZMZJ&hX zp(qCbcHhqecgC-dU1ybW?NoDkO?>0C*w-%?-s5UT+h`k9PDrbx3XAZ$#QPxe_u0}( z5)$V530T`xUFLVmqT3jxp+WI>q=qhiE!kh8b%K4Hgi#C*wTxi~`RWtqEGErz`AE*a z)J}XqY=#jB@E}>N4A>$0vPkMW9Ie;IYLE*~X1~Q^6IWkFD~_)ouoR9@xh&2BM9H~I zd6!pG7`$kym2#d>ssGVWv_s;XndnJLwga;}>vQfWSG3v>@8aGh^x>NlkKSNIytI{t zE7)&CqzZgsW1-*+nt(AVVZZm95ErR1bnhM1CQdM??wl|aR}`EYMv{ggGlfysPMh@1 zmm(N&X(^g3bw7T^@n80g| zf?eg@HLr5usA7hzYtx&VfgzP*|F*gF@U(wmGB-}L^AV*gQjiAqwaKU_fuM#jRx5q> z8qRADV*V@F>;L|hiLI|M8@xBn&h^iCp6m9lq2iD2I;v1H0}l6pfKu+7R@>FyDMs)7 zMvJaSjT_U8-sp;MPJx?W&{s^gHKD;?z$4C#5dHkV@|$n5k3nJg@=<#rCp2GLem7Wl#5Y)3nri(S$X3RP(zN7orb&~l0o8Om(IE9X|w!zcO3;Bs!EOmNmaCc`+12Qf-ziEO~ zF58uI87*GV@ZYmr+_zNzZ>$xiB%S(cV%iWjk1E{4asd@@&YUyE?g=s+D`A^*Sxuu8 z)d4Z{MM3>Q2i#y5U?`#w)^f~w11OaJr3c^Hr^YUK5gqO$I^0FL{|!Fk|0ks}BRd;s zq>xPcsg9gho&2=Q0y+iLDnGAqe>kVnS7Re`i=KR8m&wK9zzJdW7&n*TR+uTZVg-Od zH`L%BE1ROAnW*y<(lUhjgBMKBYZ%Y;rMKz`#B!PKN65-{zJ8Za1DoP?*qlpn zQg2|AbBHG(DqC7p=~C6r%u)^FVh!n+g!}bheyjg$uUy{W*Ev1&7>)b&S53_;qj?jz zo`rxmOLb0RTF*=(%bAs>%0vSwW@jhAcN^A0TX^-1J=VOOm+@j`OW6ltM*R)5WkkSq zS~6=nTo;hjKA$O|6m+1=QjF5|VFBw=5&is6Ek_|oQs8+F8!2w1fI8b+Hq-oX3G!fE zN*N6$pP?joP7jjhO`kt&>G9lj>N0jHX1pYAmTI*+U$RnzQie85caN3^vDw-~17SV* z{`A?iXPNh>PBni20bij0dV)W4=2E{}=Q}<=W)}WHK4FJ>0gqwNJ$rp57dA><#(VYk zpQ8w2TpkL;*-gz@LqeL{6_%{&AHlLA4NO}Yy&Z+)^emb%%e3Gf!^gDXD&?En3PWye z`ul>Hx0^Oj(eMqh9zD8cqGr~MqQ-9iIC`)(p!@mJjp0lA7=N@;(AdupHifTO%%-sZ z1!hFH$JjA9ewO^Xvl0XZ0H+q>-*bq3_;OD})CT|2|G#&(h#Mr4FkFRD5EmP$6?td8 z!ASXK663#2lULdN|L2E+2%mmf2p(g)a`4x4KHje2FZZM<`e`5j!jP_V<`cY0rc^Ke zC~v_Nmrh7mEGP=}5SL37d*UTKH_f)lBg>Sqe4wtMuk49#tA`Bhrdox>>HQ?*|Seph&cRY z0?OZh`K|Hmul0X5e!eRw1O&1@U+kIX@}J{Ne9&&y)5Y>r-C0AHVsZd87n~8SzV4o3G--zuxs18zL8#P`9AnWSTESuOCJazoBy7616EpvnK$7$Pm0;|N z&7NFqO?0hvDck1nfjyn1&4gQZL$jw37QSZ|oehCfK$54+Y+#HF(*)JVFJ+}_(8swy zY~7Gk{xI;{_axNVhvvG_a;S41YR*0ugp!&yqdG&ry`mLkiYP9BzS)TDwfbiLdSkG0 zxA9P-$3Ou2SC%&yUH@w0mtJI^DJ98XW){=#UD%~t;H|rt@P7atzg&J=d7h=+lar&9 zbymoUZqOMCzcUJk26NX7V#7f|En)Xg(^m$u12!u1N22s*7eu=K^oKZM4WwldO^2y6nKBoKH~`%b|GKCuU`-(#b6zbBupCmo2%a-GWQ*#xmy z+h1CayX)CryiOT5MVn)iMM{`VL(Jq&G+(+CfliunT6#BDH|S_x8UDYv2eT>Q`ZJqS z=;dNcxen2mjorG)^ffkc>`6v5$B8Tt_XeY!*zICf4Nxvrwkx%1mXx*YbhKo*m~dl6 zJJn2IM6E7L2iKTX$9;}%ZhEnVbg7mV^>g?h2$pp_%G)E+Ka^HBsW3j+G&KvCI)IyF z#zcmCVQbx(SK3d^Eroe%MD}#Z06dI6>q5tM9bp4w9pB7-NA^`oYbC4IUwFJETPrI- z_zD%!0JBY}wW&{*h+|+ZO-2E zXleyHH|t4TFEeY1zfPZpV}L5`IcG$*!ZKx8jM?*?A9JE&iWxTv1I=^__DX6kttYCN zL?N7;DeCE`aNUiOAfGCuS&WvjF5H+2ycavsdLnp&damjwwy^U|ZgWFlj5V}fOf{1g z=fE!4!zgA65}}$*qTYJibna`{hIn5mk_krgS{ns?9%n6Ks%@MEdtKALlZ%=#Q(PCB zHj7DPMg*Th6-0(vHdY<9JL|#;Iw7B`*&M(@H;5CjWA)Y?1=wzut$Q+T1@9R5;d*Xt z3vwDeetUHI8(xm4Erj{nU*52yq{dwlmUEdUtSdC(oiuTiXIOpCkx@a)w7}6&3Zq~a zTFI^VA}MHv)(Q)yMHO0&XD}nNf%7+dj*V(!^CvlA6;&fc(pMS~rV2z0m>|$8-HC); zM=fL<6kyYoG!EF5A$ig}oPYx$$r{MU9b^&~MQ|z;JK!o-62!vh-|VWAaZByX+>J_= z^J$E|^)k06RZnlv?EQ|LRq+0VeJN-w@|8WVasoGv2E*Q{%IIXay-I=bcaL6wkE9W( zQ4gRu5>hPAR%=gRR#$7!Rx9ZA@aFIxoA|(q-H$M!FA6HOv9*^3xl|k}ZvznA;`?|M zU`mi4@C9XL9vb)YuL3v%n7MdVA;#be1KzcQpiMFMYKKR=A21rh`s73mR!FU6f&}v_ zFAak!ff*E*yyX@6Pb|M&UtL~beK}JW1{cJvNf@3|zLDpYf}!2-a{dJa>M`jTpgO~l z2^jFab1pb6xPr4XU}-D(VR zdmpiAFpS#c7NUvMO$leQzVHpRvnUqu|JmmT3xD&}Adt+NQQi5rc>xG@*z;n347_+p z$WSP+8o(00Z5}l;UNm3*cDmbayx%(3FL(Bj_nJGqzsevYuw$J{ueTbf%?~f0HA#!F z-@e^~lf7}Yzjd-_+M$OC3SqiW8%NuJ+1lATX*RZ+`@4sUDp(vh#L8+FHpI$PPTiu) zG@%o}9-UzSQ$qpvfwpM?q{2r0IJ$o?b-9T}0IdW#j5Q@bQFBZ)UWM!hnvtT&vC!aw%n3=>w-Dp2q z`aZ79%nI&{PT7`f zdxu9S_;fkZF`m{s|4H||u5%A?Pp~W4jr|qe-$;!>_{Hr!kET5KRCdGu_|BTltXFyo ztVaE~S4RVpIPqLp%IsJ zaDoF>XP}{PDL30>& zO_!1Fd|>wOj2d0@WEyQgoP$4zuRu53I}w*zIYya{}S9KvUA4L@Y?+bI`XH_^wS zU8roBSEOw%?|#@r;=Z^4?qpZJeLzx)UwT0=hW`9H_N!v4D&p|(LDVV7ex+gt+Zx=L zVe~clp8~g31&>b^!TyC&Yt)5a!g%(Mw%_c%-aFjc{ZJKuhDsISHJ2(}_B(W(dga&R zZnxR-dtvt;rgclr=Z5n>M5C_&!_=t$%O`Fzh3il*xdt1_iRulli4x`BP|s9vSnCa~ zCfz4A6DYS>^5)DQ?v3kc;RZTc&n+LlGuYj?CyLVj0 zJ0V2B3ii^>CXLkU?<~u4-p2*eQ5Ug0M7t3ScaL{Z4l3s5XDd1*(~vQ6Kc!f_+uK2- z&?O?ab`jMUO#Bsy5BE-6xd@<3JeaQvQa>uF?UGwxSO^52y!Y>GLfnER2<#Uc0+GgZ zByOYO$G`tTWY2ElK8OiNiE1+hy^D#2rMsi(R$jRtn<;RzkeBqJ=XRhOTM z#TP5pm1TXjtDCK&-)gE%FaD>XsgHNSBVIDT-ZFEr1xHxpP4i^80hm=LAS!q{SE$u$ z!jI!|4-J|6kt8iaca|o}Cz{&xtoAsBUzu1v`;^G;62PdK?q&u9+$7FxV*C6*2-aC^Vj?>W<_0?LCPTXb*nWA-*7w^#1o@TNixUtmsQwb zE6-M{FKB-~kucsJmf?#;G!`XT2&(e1&g4wev%SMN<(?1HAn-T1z5PCjb+Sz;x4i|W zn!j%CmofI=Cp9WvvT6o!<}&Q+me;WALZw4Y^VB2?tghgAR+pbwpF5&}T1vB=<_6g; zqiljg&dX+5ST?I0khT2t}Jd>vH#t21^`?eCGZ!?T9*4Ou$~ z$hYV1ATZySxr6m376^%`nI3V6a!tuQBc%Qwpo6lmR#!<%K}8{I z`NE`zWV~?`;9Xg37!F2A)ye4rRvm38)}CQ!(fFh(gIVLto!|=2SW!F)KCO%8r4`hJ zW59XI-JB(=T)?8^vyDbUcevUp`B%2XE!M@=&kOpe;*@M5sil;y6x*3(_qNN#!kp#JU(UF5)HKR z?p5QoEGwDb9}f{LfnLDUVNMymyz=`oQ6yGUWlWAZLnf9PS!WL2Ig*oje6kDkSYD|u zuX4MIiQPTidbPjXY`on%+1Arc;B zP$30}gfcW$lAA!WTNNcsoK2L-Kh-J`63xH<3 z3p@q|%S%2&t;S?n@AnQ@R{$a%OtSKA*oSBBZr1^6o)T0V#n#CiNgm7cNbrEU`$&@Z znGhZ(XvE5%{T4RDrzmV=7%*ZL%01%Lu7-jCQ4IVc2wXvz?V#fd9tFHecSYF|39E_q z$#ws(AK~p$#%mk^pGJ+S7l=+5Z9?$0l+hf4bsPBCB=1RX3w`VW8HUIup=U9CLj=5z zqPE3WD3kG;!a3q25XTmPYY2zo-7`ipVC>QP8Tn=oF9}Q-Dn5}#A7h3wykM50lh5Wa zF!rNpHY5DoY>I+*3oDdtH3gpRz!pjz-ok7IzcqK2=7UF2v9Xpqd08LF!}?X&uagwv zK#Q*a3IH!@2t;pISG=omw4gPJ`#Zo;eBR&jy6p$yt*#W*iw&tAUI0AGE8fp4|7>ki z3(wY4HF$ri9Vg8XwR%PELSBNn6|L4*K0Q^daMTx#?IUpno1%d{{7^it;yMs6cvnHU zg9w0Lt-zOeJ$a)Eymr|4(VLZ)se$|^=T?EP@)zo5;u!;^H~Ms;{a!u;b`7Z^q1v`V zHta^s)nHq9N2tSTwVL#}iBF~Oia4RILpYhCD{_9+qiypW(P4k@5Zb$_;(r+cacAVb z=|>lp1niUD#_7???uA1(?+V3?>bxUKXK!QRJWC8LE|F4ET(??crS_r*a&d6oia{1! z!d=%7ZiC?loQS+Qxcg{g7>=H5YcUEg9exbOJ40k?-CqN7!c`+#VYN%M zp*sGp3ZREb5UQf%!_k;ga;t$da{hbZe|Fv-0R4w8h)Lv4Nygk^&_XVn`$!ih)Ilk< z#6*c;GJQBd##dse+dTkAUlJR{GQ1FCNaW-Ls6PzbaG0Xp3F3d$MFSWG40Z&vCM4%E zT=J<%<8jzAq!5JAZd;XC9q5evEz}TbbjHQR(*xxY3!80JRU7^cMc!ebZi|~ue|g z=GTkc+mdKnm{bSU21M#d>cJO-SQWJ&VCEA`sf_gt9<*A(MZgmXmKLzBic8u>+sR>| za01pQR?tk{9#-bZxdbbNWLedci+vN_>drt{Vw*&@(I4bC9JOxDv?i8S(Ek}VHmOmY z3fb@QRYg&v%xy1EhV<yO!{tw~m@+b^KFQW)GWDXFs3!RoY}|ZHd1%5IF23VTFiR z6Yh)mVINWKm*r=IWpIjKEY5CuYf0d)P<8cHvEF&-rsC*7vzPO3G9SjXkPcnO>|%U z!M--tS1!yIVgGf+O0i-hRvK=I`gOLva&b{xsEC{a0O`=I3X5#&TV4h1uw6qfJbw5% zOR_%~QaBKbCC&kj({bmFSRXnv1Yenp*KR5(7a>1E1g5Mm3g8-?wrIQR|7GGk&j}h%VKB{I}!;QFy zOocKv2jbWXZt0|x)R%5D&H%_gjyd4|zw5#Ye^(RYJpySFI|0HOvnBwzFH8LV!w+Jk za={(hz5z+Gg}$+^E>iM#fLhxt6ewYwJPI{St*A{bJp9D3o29d}SKB+gZ%$zGE=mmV zB)AUl1~^+iAE>mfDhDQ&uzm{-i38=H3+xW{f15!M{LyCVynJ@n-17d%_x^ryp}#J9 zFE1_@&MUI5Q=K*(7uvsyC_e z8GsH(!-`mXs6vlbt)fH^r?T~(;S^xzZ5Zc&K3^d)a^O2`f64gn>1!(6UBjGknBRu(=q@*vUtL;c&EoV%Qw3+7{G%v)4F%Z`HjSi~&AyF?*v}X*KYw3IL767rsFw95q0=Lj9;8k0P4=^y(V= z!r__BtS&mXy+r{G$53Do2&TORNwO8#w8H+aI=*R3F$SJo>y}DFiumAh;d| z15qjilrMC<{p$5j1r=WLOO*}i1{u3O@z8qTlh*rQhV?!hME;Ad_h(jb&x=D;QNT{L8EAQk zNlCmUtgoW9_n$-sw?HbJ&BU;+xxRvGPC+q ziu})IRKiU(r54jLB3PNXHdATXqOxB9!&Btn(o=+}CayCR9%VFY;h%CI#gJK_KoC_| zCE0v*0e!*^Mx}A4WZ9(u8#t%Tjsr6}dpQ0ZU*YVL*l{^qj+L`ODay@e<8%iNA=u}T ze;_X>nE~eO=_UbPh}q~N^_u6@dfq~2-<;ry`7xd+i{xgF&VD_AFhH7r6^w3!pl=Jq zu_X=1HFD!2`05ZP&mVrm9l=T)QeMLDNx_I5U65Y{&a@lB3bZBi#b;+17XrBW&+G?7 z{Vjgp-u7Cp2XqW@O-zKkC`ehJBvSn7n1KaLpt1$48p~9*Y2s92%AT;6{XBQw0sfLB z?g5jvp*GXJIEn^;7i+au@v5-{40sUtOCxy$b`!$1iw3Z-z`8pAAU_E2PSom&`ANEf zRHctd9X)lpT$l-cqgQu zrf-Yp$Uz7mWkBQCi8{r8M5cnk-ZatTf(xZNIUJ9}E~z2#>IDGbI#M0sfy_GQSWB+^ zSJcBwbjunTzL6}D3NzO7`*_(yLF(;8p2A})^!qdP{q;_BdmE$Ig$ZUV9}aLBd0-5~ zr6Ennoy#QJUFz!trxO^)aU#Q-?hB8KM`Yj?(YP5&%R1%BL(_3-?R@LU>uD%0f0P#8 ze){uM*KWi0iXp68P!i=1M>$87wJ?)U6NM7`fw|C`zkt zb7(RY#4mctZdYQ@Zh`#Sol@4UoJS4!6HmtBl#FEy?SwWSl7$b%$ zQ!h1(Qp(2*M>y2_$p4UX)!7j-dTqd9$y)&sRGLT7Pme4fe_?7WuekCo^KyKuaDsYF*KansIcwBxP_{4 zoF%IWS-`S^3#QZv`(ui51QQr`Mo2F+TX1H`Ze@!^q_9uddF`k*?x9%{=7Fo?@hszv zQDkE@Ji|)sZY!7NB3}@kk4hDXmXHzl2Y75Z_**y_1OS{X(JB9fhRU=a7ms&YKAxap zhWUF4K|}#ppx{hX@$>Q`KK`ZfpfvrDn;CM~0sK$}XzN-tZ3(PT7K;m#-IoI6l6AWP zy?=Y`z55_O#y7NX$48C54?Gf?aggKzPRU}zMx#o8)RyjH(D&^fIyNYw$|yno`JJTt zHqn>0HZk`VN1o#c8^WCvI@bx!)g0L1ap=qrqltU}I{SE;msC!0A@VE4LE)D{6vyEe zx&S!dhJl<0yq#~Mo1MI7A+8OrDthFFSHiV;y7V`>&?SDbl6KKG*%cryX>*~;)$EdGwG_!Jl+8QivC}4lu@%^wi&i{6v&YGOGQ-|hz0^H`*41!S z^}>|?T`C}{Q5s-*12tRLp&+>H8hp!I6v){hujwLpo@+Fs zDlE(}rjxT9MQmead@~82bWfG>VsKa2SOnX9jWY9R{3GTbV2Vh54m-&7!$Ww0uZqbt zTL>$vJG~X;Z!m6MnJt6puJZt*Um|ryXN9yL8XZ8zMrDIqy7mm{CGt^BgP9r4#J8fF z>J7}NYQ5lYEs@+>YE{%y6lRZ6GFym}Sz^?%M)Ui}sL@5fLmV3G+@X2J4F`j z6t|IWmS@gYFhWZ*ELjDn-P$x=yp{pB?^6&PlC80j4`6TjZAhr0{A+PgIvDdA%HG>j zZ6|b(i2p_zgSm`h*!oy=aJZz3mZaLKYwvO5y^(XVwzzth+~IS2L^k`*e1fWz8~~Yx zu)-GJR!L2&!~`Q#`PbwUp=~g@_R-1So4rGj_3h^Jg$FriW`i>8sxl5d)$;^^ta{9O z+Ha<^raa?Hm8Gth*+z!%NU~O|BmNYh_e<8z=p#?;x$kgb&wUF5&tcdN^tzGbAxQup zuN%!QUfpJQGIR0FR69I<##G4OPu+m_bmbmDkLt^;6Z=iHVb0wSIha0|iN|wXso?Hl zQ(9N%)6W?*4mmmE!Ys@AZ?KC0K8yDiGfP((^C+xesmRD8?x7RzP|9K?t;`LE!KY11 zaxiBLS4J{QOHJ8gRq}x)nlYz1XEBPoQcJFk#A$=fwULxo%xw`3q<}RGI%^QydZ;S| zC_v{oNlst2Dc{xYWgTgH51TeQ*beoBi#(QM?@m@IU z4KOK8_nvr~zmDnl7*23rW$ai@k7bh;6xQXIx|-rA_^o<$p}A*IWAy2h8@# zQKR8)9~~U;?e87Fsmyef@ikW+iJ?igv)XkSy(yOFeR7v;F+$M6epXz&a4vPUV@-ya z5eF2ZYlL=p-2d2*Zu^@{8~nQ;HODd9=WZ^mC+O@cpRLGxoJNkW6EukF7OH3S`Cj~1 z5NLYZ4mxp7#^ecgpmykf^Q|2(S~^GlWUK?SqkU_mf|Jwz9eI^SXdx|BV3v0F`SIMG zTSnQq2nMjTZ&%L-;Fi$x|7q8DRFs8KiYs`BOzueN`H8nM1E3e^k5W_d$2pLFq8V!nXnycj#;B|saw2s> zYaaAeT2LmyaSK{-oF1u8P6n1L>VUJl=7P%ym@1k8m|t_rt|Zq#{mXn$;m8zoNxFkz zLo1L4(7wu4rFWfvG;EhE;xidAhns6FX!xw`rA4`dHc)^>Z108n#)0&302Oi@xA6E& za&+uyj<96T$xY#qiw)MPvDsd?Bb`@2TcTIF-Hq>i{JL78z7{IVbuaYF}6-j4x>KD z@o?;C+}J|af#|$wA`(r0OKTLiOd)lq^ToXmUX*-<`bM;G(PjpY^AWK6L8KkT9Z&@{ zeMG~NX4EgF-z&JO=dp~G!ml>uZl36hmuz_-THX(@hW_w=a?1+30;BmESi$Y`S$u;b zjr_I=UxA-9w=q?yaN$H_U^svQ<+FCTjraN4(DLDBbQ+^na6@xviN10%dX))QVwfzD z>LEECCqd)^$?RFT-7V<43Hb3Ro`Q@P9@ho}D%gX}oN4$&6fx0IMpImF!ct+QUQoH^vuWUxoB*zL))iomjFR<`=}6RZy5?0L4|PJ@86p8wXKeG}#$ley#H zN9H_`YiDg{hmI&b-*Mi$8#rw&E+nnw3r-nk#ipBSibf-pWDTb1OFyb)aX}e%WXz(> z;*uXq(e0e})K6&!(Hoo1i;D^&sYtA4XTG@sz5>nh<-IZ6tb9#|WnvjQo}gB_gAJP;`?K8eYOv zOdE>&Qjiqe(HLV{lCrZcb>ny|{2>n7nH7C3P&2Ax(d;yC`2#FXH^sUS7>lw5N1==vifH}#k%^dI=79U zO@1F^euJE}Ss*eYBW%3k*e*Jv#yZ85Mr)jAgqq|{oz58uDhI7@VxnPKBpnVEqq;Lb zb2yCHisyA%^GkpOts7i=)L_d^qWo{lm^gJX5(mX!w>d&S>7_Y_W2pwMm(U6n{(_*p z>7(}*g^tvt5wC zQcgaM5Tis;9~?YRa|Am|Pq&Q6N;ZF6CunFUwoW$vq5HfkL$uLb{sAY!*eN7mH#U6- zC`R)_hHZPZ)v}+=L11fNMu!&CO=DCdINH690O&QeDF2(_YsT6<3OEvSFq5;!e`sThgj#pSf z|Jsaf%e%V*iN!JyXOT95b;AL*2tPPf#b)s{$crh#)-hJ@n@wouCQF@!JkV9#RtlNSUVs3|u!J`f z=dvUJC}x!{*h2Y?Kpz27sUlNTT_`3W{UZgxVD|SGhM5EED??-(p^w~s*g#--O{V@7 zQw`0|$GzS?27*K0 zj2C((+x*t7B17Gzr?x@wK?D7d%*~KbV?@HvzShL{T?N<5Ow5O(Y$+xoHW?zTZF9Pn z5Yf3NiJLlBIwpE44?t=Iz8AxzV`Cot7S2ZoGNI%g7!&_^Z@b=)`X2nn{s8%jLF(f} zdJ{`sMWdSwWTpXBvxnh|IR51)zgwsZ{ZLk^*e8m5Ne4=@BqPN8fbBp7^6W5CegOKI z86=A}X|ou{u+`J}1~4b%`E56=Fw0))7skap<7JBNEhe8N)PYt6Rr|C^b+CkyYfD)# zWk*XMe<>+JJ&UXYZ=u57;b&gF3UD`$2)jZwLxp`a!W&@@Ed}cXtI!9I10y=Ryg2Pv zRQFmIkmeXgXjehY$2|hG-tG#ioU^qr1Oj)Epk&p6l?E0(*%oEw4YoN|9jfsw$`U2I z`h=`8fHGcqbSF=iQCvDymj?_EX8VdFpVw4&AM6_?Rj1e#I(iL_OAeOO7S!w!hB40$ z(Xm);8xI5~+V;>23Jht*rDLc9g43xu!X}PVfzl0TuCybM=*Ob?If*n6UUxec z${*I?+K*xz3107gIM`j+G5K`}(PuA~R+h96B_}^(BsMdg7?j^`E90R{uSWn%G>HfS znYaO`CW;vxM`5}r*9vI~UbWZkqXM(GRLYr@0pUJ3CA?t}Q@FO(72yHSVx}d0Hj0LU z=dYELlR>vuz|>;Uz^CfVGdFx7{D|Vts{Feq|30-R5Ko7Y?X;D1ip+8a7<=_=kIab`M`I)BU8WE%9R6N%(P{#)MsVk&0bXSy&g_6B+uZ$dd~|Y}8Zkv~TsSyR$Gis4hn#Er z#_Mw~1HAVal)PY}@Rx#-jx259XD$gKLaJ-_y|=pc#xWf1T2YM=gE-}iO1H*QQFY#n z+LS|r@E!iH$-htYdYU+!NT7oSLc&dy0~QuKQ%g=G3(C#bV2r0<=s#Pt49v0eQ^4d~ z6Wx4o>)9I8M~niD-sE#Rhu|xH3UYhWMl+}MRUdHFyV_gFv}$#jB0Qer8emi@d(HSe z26cUj6N6utm-M$~dn@e4@?6zEE}3LoM{l;I-K#Oi0d0dM@biq5o^w!S90`8bK_MlS z!USYo{GU>KA|}zzS@9)jX#kMqm@Ldfv@Y`j{TKLNNl?jJx`+R_NEd(a2e)w)KbuHe z{$i7s8TXQDVcLO+6yT`wy1txA1HKzVm=3u~hjIr!utt;9OuL^~f~1EMCB(_he5$sPDU?fC+Q}VT@&J0 zS$C=Sf&z*lt!LkD1(mNPTO*F~^AYGO2Ycz`Z<(_ji>UG#7t4=pkIlO)f5@ON6O-@C z^v6#8=bjaqH6TS230%70CRA5S|AO(kwfaTzj3T`v4C6xQ(8^cFaQrW28bRA3JGLFZ zN@haJXxQ6+o&radk<|s)W#rmkSIsyb$#3&S4Ney`G4<$B8 z(M5 zlaq|rSO)^xs7mr7DIn(lOl}Rir7PmxQP+J)qo|2^_rbN}%T`IwNQjeB@@z1LjE$la z@xj!zZv6grKsEv8AAhWhpME0C4P^#*c7|azJ7jo$v)O>Mqp`&TqV9u)I z!T^y|YHQrHU@6U9aEHOU^QtB(y1Zn8pPz!5rs0;O8r?@@#Ww3ahU9w^j&y(oJCb8F zL02~~rP)aK$iE1RHeGNJmcn^DIq(8^N@(aW7jM}AqrKC=lDcyhB3_}!+0fs2(WE5T?3Y>)@s}+8ejy296 z2YQz}{rB7LNqweE>21unDf<%iKN-^=Ja>kHzP4B7a3-Q*yhJCT^pc_~IS^$yXaaYExCh@_@Rh5Vj{&hUlpfyy{cRk?7<1-vOzhrqbGz~GU?TTQ z70K?qaeDG@`&3mDWsWSfBU@cmOl<0|gHJk1gLqG=v=me!PT!8)@E!YYH}&ck1Fj~` zh;y!2(BjLDt(+=o-WM|L-;$-11qu_n8aYu8OXF^EmH1;o;RSs-M%5BuRCE=GeKtph zO2yJ_zH00=8%OU>ws$k$X1+AOu=jBt1NT!-l#KT}-F<&*0gN9y>P;(#S?@2bp!#R- zNogh|9BjC+psJi3*pW-tO9!008G(A(;rA0Um0WzTOn}pm6d08{)Jfz6TbGq9F$RLi z!@z6t^?KNY-Q@QJzV_7O0A6Y;!akMmD{VT!^f-#S6;V8o+^gzMD2OEX$zqW*fNRks z%XUP)gPqW}e(-@zPMc9L(59)h428^$9SlxJQ`~B`qG4NxG&luXbqWM4xUY&mzc2Rv zek%~C{(Tq78=UMsJyHihw3B|vY{`I%cQlre5*um{B4TFfu1vc#9ZI1;?YS-sb+o;5**_o$1cR%b_*%}<{ zp)D!?MfOWw%u1P2N0B1|5w#waZxZ8&kfAn_7c%%Gb1m;ypwUpaIG##M9N~zxL+FYd zdEQ0|I@AHpK8rFr=*UR9l7Cs(&iL!%oUABi-Sa|4EdTW9ryH`G^$NXC?Z#QOeX#vn z^ZI570zGA)bw+*4z^z4j%7by;kEG5-sxx5_6u}+1uj_vJcXl1cn0~;q++$XBExjW; zDZ$;A4--AJWpcyBr6w;e?KwrH2N*JT#;j^fne8wUDImvmZD7_}(Ty@xfXP!LYIfx@ zk-{u|Wy=6rTEP?{qUJUFb~%0$RhJgn1&1^V%Qjn&Go?1nK7kxn)%PMGGm;R8h~yEF zNi*t(qsuC%y{Y-4fY;K@mfYmlOit3lA#HJ>CwC}5%+ffxh+^FfqzA?NEQcx1*jbX- zI!ofSv&o&^Z5U#M#_Yt}z3Mh~r6wK47AHsAC4MAV0j{dyNUoc6U^Km#zEXU3RnM+`lR9d#EWNDnFh|rDz^@kMTjYTEYJuqfUjYx+q#F4MXf)q3* z-Yfvmi(Nz=rU?U?l2lmnEngb%S#p-^I~hEr-!2mBPaSqG+c zA$gLG93u^hEC|g|nVYpnBpGE#uqAP(Z_wU1U#}8*B5Y91n~$P#>&B`(1=ydTV$|*w zl&@|+$%2~#`ld`7oxQC?-c~bc#<o<=%9b}LYlakrx;En=(C|s zFcNklB&Zl`$k-a%(O&r?!-GnyJSCMP{}bsIhl$AW*hOwp`!K^`Y;S4vGq@YX_dWI0 z_Mt{qY_lKS=Dy>qv3j2u84Oef>h-YNM~Z^yD{- z%uaDlIWN-lfLd`MsaOGr2N-JW3PS_n!Poy3^h1n(Bff}?e4;8q#CfR{*J}%+UdONa z6q$oBaQ=sXgY&NFwpC&eWl|!k1yr_Psw# zt+*8B5}kvWl_K*;nB=gBk&;}sf6qr2=JvMw(DFITNE zwS{(Vp~P*;=B>fTP)as<)hbcA96ts=7=tUtY|F)yLN}q>YT&Ysu9k`E*es}sP)Dy{ zH-LJbZoS&yZ5B9c0dDK-8tvSyoX0WMWqk*U94;eT88d-!&Znc=sIpw8^!t%Q5bQMcp36i z;RMbIV;Der<#B0chR4*3rPwh)q$`zv@F^H-Ehu%HMx^q->xrf)J~X={411LzRx(s! zBE~tYbA_YN%}}>yy@Fj!?=0&?8F<;&q9!z6utAd=hzy+=>`ioA%24!>YPWTEhH3et zPMHc;QVOOAXvfiNbJH~pm%Mbhw7j&EwAjEX&ID3Om|}BNtW>7<6e|MYmN+|GLTxiL z4j>}QN6Y*u2`2{@ev~@w)p@^=rRd7g(q*eJa^R=?yOQqj^5eDOs^9xL{m$uo;!)yf zdSn?rP%ZzQ(Q*RbFc^(NRw$!VwApw^w>x%~qz3V^n!`t^2){x#I9Vn56{wG9e1etmjLJP`w>K}H)bUX2GPU`5X1P3yA+IuRnJ0AmD!fkOP6pWh$AayK-DxQK zn3=>+Crs8(e$qD9G?_D~2=k2Ki`gBlIK(@l2uzfP>4Q0*rUpz3Qs0mQFa@h%W90PS z!qUywTO-nadv6V_LV6X+=p^MpG%@734xT~zbQ-@>6c0QbZ+xN`S3%GhtQ=(z;BEvT zG~EhS)Ux*|b0GuBx#O-|ttu%i+3XCs4BH_{=Hs?empH(PJPHH%1vN z%6>@2n6YCV8vAkf|8wGRr3>1j$;g70WDHW9nr5wP8G5?Cj6v+Su?K<=~L==I;0Anb9g3|#RMCm7O z=2dB`blz$-;99|vFDxvG_pB3JPjs$o%mv2-JaT{;4RGKqwU@Q!D)wF3NHQFjp~e)+ zQkD;i%a!Jl$*Ghhs&Va8)X~9d7F2brDQKY`#?p*2Ra-6*28ZpS%7MW^Q|PkTLL{fN zF%@nGwG*gJzV-WL^Vo~pVdown4=I%{!%_bGKKbFfOV)|T{kDpM1$z(U!}!Ay<=~Z> zHH-&sB3w=)kRH(dA{%}-Ip$d1UkUG|PfV@tkNkhg#Ei;_8e{yCK#lSQs(v3?AL!W0 z*2!x`7El#et_35FJY-#?XOoAMUjPOaiXrZCL>Ubrg)N z0NC9SBL;RdcYj2xP%XDt)g9Z|1g3!!yx_L!YJ1g}^2cZBC*JZa*|wWC&P-MXe> z8?1P}wjeMbgU!ji`u|LIsiQgLa`WQ9qBt1bh*vl6!{3R@vK7A`Ks_$fSge8pgvyP;ot@8GU)`^+22>;vmUY8XIu4bU8qGDGW9eizI5s& zNnY3+Tn8wpfBC{*!}yV*$qV)0=f!#bd_i!jb0|jZ8FOUE^M&(zy_zTlWde-zYD$RD z8036j)ax7cccBR1#9%`_6tESva4MEcOX*`p0sM#R*W@t-cL9zfn-uG@S!o>J9yNgJ zW;U~MSCEXoP|p$f7_=GMh5*d_jZfD1Y};^b?C zk_vbY+t`mci(4Q;cz3-Ju`0Mt{f zBQ%-gGt@Dn(5-_YRjwE-Eh|vz(+sjzd)A$Hc%= za#&k?&nj36E8U=X-LVgG0EYHp-tIUI zR1B!v&erJ`aJkofb$*4hS#Mz{$gB&B0%YCUqNlN%!GaDBWgTf|X6Oge4^Q10mWmlv zrDP7XDTiLEs28-9d2g&~r$YVZYMmq5HR^3b*+N_wzu^6c_wwRmp{kt{;7@@~|i8cXt zA3U*qshU}^n#t@iw>o3DkIBMOL7(`H&R0NrZ5(%D}kaDO+j$r$b3{p0MJD-`bO=aWt zgya>Y3DFc179_7Ay!yx2PIx}ZKi1+a*J84WCY7``K5<$tbEyZTcypGJW-W zN35LJUQAGsrj>tFZ<^4~TWdg9YAq zUM#%_`Eqz2(3KG;bs1a_{WkTH;ar9N@hD{LJ?C}|gKZGI4M4W~tmal0>#@0XVkr9N z32PbacNqYKBcj>ir29T4Hq`e~3^U)foY(|^0Ml{09f zAIAZRcZ2aT@J1*b+f-7vJdIk)p4l`qX(Fs$_;XBxlUFPMyla&|5N9glWaj@a>N*)| ze{3V}{hj8?yTc~mX*)}vzW(6hctg51p&#ybNUjyUswpL6S)epY89U`Fh#dH&n5%9U z@g8P~Nk!Y3cni($J(c7$07C6|b!hl}n|yws&YLk0M6(s5a4l^=+F={pG#7Cb8=SN; z`jJ~Vb34rCb-7Taja(=tdf*t*m#k8$<`TmAw7E%V7qKFETcLwwvXBm1jdNClfOA7i zn|3wI)_E#JdbPWr+TW*7msf=Mmj1mu zSZ|!{W|}KxwpdbXA2R#VaTjsU)P|KgDr97^kVA{@@4X_XLHV~SFsK^pM^0%9ci0Kp zi@@7Y-iA8%3=*ePE|MmA7DaDQ=1zBsI}9cWiRZh~v+VQYu5Il#wP284^=|3#O~5 zI63V6jCchAW$ZjuT&6~jTrZ`1GXN+zD9JXtuKEK;{Yn zWfbGdl0DUsjIiO75?bln+1bkK#l;uvdu`#1TKhRleaKV=YbXnErA<_6+jR+gxIq1; z`V(f5Bbj4?D`4L~(s!xMV|q%OHNB43&0lI&uO_Z4rXPw}7m&W^AgjQAem5mbDmE1I|v{;z(*Vng)gsM85E(u>MZXi3pL}al%qJ*MkiKlSESGGd>B66s+ zkxDO3ocIC-pA)A?+jMo;0is{PByhs(0a*$Gm%LHb0t8TCwm*EJm8wfCeO$=v#l<@1 zI~fkb0V)af-~C)Eu;P+@UyU^W4lPOc^C@$I&^%>bdlXX@ep!PPQcb?3j1$%`IMd zT5dL{0hS%!B>7YWCY!=0cF0_!+Xkw^nv4R>rCsO zjeKI&nBy(esaLV`YQiJ{Q^szi*rou9`o2}0gEmv+v7As^a2!}@vZuGT{R3@&hnEjxAoPek6t&t)!f0YnH=jbjq@x!h%O zyFPJ^s2ex4FWIEI|CZSqW|H)fmeXaPC1)064fP0R7YqesuSzg5LYPt9lIvNW~N`t zt0lamNYmk!0wN8ql@x(A8h4wt)MRq%w<*(XEpuD59em=#D9N-)CPb3Fg3zX<9C}4~ z-ByutG>Tuy^jC#mPK5ONgxQF=tyXEzv`GzP5byjSv=QaEHZz;Lll{pj84I%al)ANU8SixNG_snNQXyJkFW z;Ru?DMVqBd*c*gT-Yra|d{?+km{a5@YL~&FrBGkc_anL-)ZyC8O1RgT7CDTwen9$E z3^S9;{=HCvDcm8jV!5^|qW%<^@MlEwJjKotv$SDy_vzI-3A&^@1R^wu;_&WX6w4Jm zi-lG)bs}xhEk8&fV$Vtt#w^4bQ=E>*eUPcTyyS$_$j-(x1Y`oxJ=zEcBUDKLJ-(sh zC6v5-5hjoTf$SW*-tsY~wGdlfkmax#&`%^S5*8`;#3h{Hl-Vwp=se)iGCkA=;6BB) zj&a1A-yd>!=}>qdgJ94c48u<_42-WA3^DE=I%^?9(nkIaUmm=kAH&O9WcIYQlP;Et zgRd2Pz_3wVy_(e5(|mZG3>%1)qO5!{&mr7+qwgwo)Ss!J9Y+YKT*& zg88%-7l)%ISU`A&5sxs)KnwG%V}c{zZu6Ge%j@w71GGsWQrb&&E9DS&-h&w3N=8W1 ztuQzp+l`dq`l5qPRPe481%T^**a2|FCzPdmODkgK2&zd&qprMjBu6?9-^H2DcxRKgs`O#e>j9Ia7hc7>)p2D+C-8CkoJsnw zQ#A7^Q=IC|<5$C5C2YASo39}!paTX|n{V*7P-ch*Ir5x=+eUi%gU&RQ{1@WE#GJ#L zgGkv|aJ9;GVNcTFe-IvAiA9(MMXGrmUw=*h502fEU3Zgb91f)3r%CWjHq(-Uy3pkt zZ6lo1`&sZggKwFpxWU%aRxohZ--NacG4)MMe@D9H`!!Lb2HX^{V^bLC6-PQNA^r9J;KQ2vXSj|Ed zG|wUHnRueIvMzcli;M?tWW0vKbr_>-tkeuTNcm8YF{2DmY}zDws**3?sw&@r8Sy)R zmRySzH9a%Uj5{gTd}K_;cbWw?0nXT!rfTY*Nkt;no92JVVtr<+g0?sun{xKGo*g)| z$}o`0)A>(4oShCY99=Hk(tZFb^3dDu>5tFNC$JJI*$YzTWDfSE(B~Hy8IRap;(PJMlP-Lc+fU&Xe>3)||Ex9o>Q%D4X*i_hO+yr~q_)JjXtigw z|8%E{m74OBLElq|y~DlJy~D=o*5USU#-)XE)CxN4x?pFwv3;_4e2O;(=LJ>bypZW+ znXXU%yEBz6h{oRGoBdsJcy!o!yLGa=Gh-9lt9EkXpm#?;Yzj}N!A5NRAM``_{--q@ z(U)0KZ4%(pR2?sLH0%wsL=FWeeG8Uuz@TGi^${#;rs`9&h%kLX*x{`-aBB1O^M#aU zL2AS1T^#-=Fuo2$lRbYKQ)e!`6ZgS3XSk0r}7;8g^8+u{&acX!5XRXa^FX0uGxz5k~x3ACGKD_X6s z7`Ntsl2n>4(#__4XP464?leirb?-0tj0ySFnCJ>SR`E>bP4>DFTdh_!Y)hA!)37Ig_50#2UFRq`KaRp) z?UUcH-O%G-2C%21pf2PvVF*eF0{c}MCG@IH?AaYg8SUFdSv z`be{b5zpu@PAY}diJwZSl|cK<$N48*(iyMO&q^wIX^H7)XO^47r%_Kb`c&>xX0Bzv_0eSmcc`YlTEqR=Qa*nksffMKDJ zrfWa}ySggl*|GJEiswt`h6+8v)-v38hGee01Yp!HVz7yAO}-6maitP+kqHkWt*)tu zhkj@_-X!cw-(WO#grOYQdVZe`uYkW~Am^7%df3H;XNBCM$`tYDR;+mppD+u8Wh!r{+#O|w4q?*pxXnAu z9a5hD_PZN_V05Cjw4DQ^fW=P4{V-p3{*C;8&Imb(BN^MsbQ5Tw`t#2}XKBpiFz5yS z*y`i_ynue8mp{>HL@u=HJ>K6s*x!5Qlmqmk=)S7V8?=NxATzt#v_U_5q?~LnVV7?+es#}k3CFhXNuHNr_99Uflizyhm4PJpD%C@<-1#;&(9~2b!J)r z&aA6N-@nP+PqD%FZOwP&g%iy7x3r@0lTG;*gMn?jSsl+ztT%N1$%_95OwOPG zjQX!8DL7uYhdiXwx zLYpReA6-o3lB|NsaAQhaQ>|^5un75sV6+9@E6m6i+=UnqZe+)~N@OieY(sLwr|FXD zqocV~#Qh!|uzo*`d!%?Gmcp7gR1VrpY{e)t@tin>N0rsUw;{+Zw}I$|*Eb{MXpNe- zWXO?w4T-dMw}F+kP=(WxO5ginSK>d(8r^^Ke-lIoeJGdHiR0;#ZshwMM+{eqHpiPw%(+Ecrj!>;{ z;%z^|mmJ~66?yk}l#r`U>@sCv(^q+jG+Rh!n?0EPs7?LOdZDug6J?e`6kp3AiWD=k z+pfhCWk84Z4~B?ZtvF+uO*TFbl~>LF^u;+w>;;FI5lU+#Hm|5gclV#UmuX_0FF=IDM9Z1#z)DLIu#x~c6x zd8%OXfv=%}Q|&H0NRV%?jGu{aT-u+@Dm$g5{DP8}teBP6*TkxHx(yv2-{I4Y6)2HE zB|dm4ewLvf9$*-BK|k(bEHY#3MjVDajWXh+IuXI~DUsz)qVtegZB>$THV@h%iY?woaaq~p~Tr`KJny?k1` ztLl(u;+A*-r7EF}c4%6GIuQi|uXFWKhqF26ELqg*eka)5x5b{dwsE+IRK!xB|gF!0XV`#ttZiMcnrX zzyXc)z3*U%Nkn0eR%=VOluFpT9^oLLG7EE!Ey3MieD4hC^qDPXO7rl&*@W|L8$CkA z3gx8I4>mX93D9%-;9&3Y=mg7cikHtTB^l;XLZT?CiD&beu)I^+5D#e9&tdp1!+xxh z6%ts8bvt@lCVNj|%jVKLO5OxzSdC-!09dF@ArdB12XiaDlDfiC^JQ$BND|nh${;1fEljfl1uDo0G@_WS4?LDF#7=>2>jJ)3N*G zK!)eFqQL^KM2~8Yl$zzr`dIR15va)oE=9iF5P$Dwim4$;H!v(fA`DN^r}HB#wKiR; zVO&iZ2~42@giJe4rj~EyB#3sDwGfXVwVymVi5NfbOfy1%&Z(;klYUb=aq8S6wNls+Ur~$VVcdlyvCMXz7GGo1Nl!*VwQ;60 zsTnBca0Rm2xE-!d<)d7V>0dz?9=VTfv7m$_#CUA@cfB58Ve-swn{%5uww_ZtrwPnE z)lIPPAC{NR548RohFAO`lfyUgGX;sP7ToH&_iElyKI46Dxok6f)NnF@XTp=1jnv|F zr-6cUbv3q=XY{V@g%{q7%=fam*%V45%wj)TFl0qf?$wC`Zj_&~suW zFb83wSUb9nb5J&08eo17EzJ^49bVSTrj-_T5=o_8TZ$XE5%*GB|10#h0$#=S-@6#_ zV&9ay#YD&T1DIb+3M1x-5Ry`{@B&m2IYk=Tf^%QtsuIAK$Q2#cL4}t;w|0 zpOHU*2sfzV^J1HFpAiAo2IcK8l-w+W)I7o}m+%kqVOScWUnbIWx9JVWK)@giA1N5Z zKs_^N>Z+r-*c6}($TK&u%BtVi=n{GW7$1y2dw4i7X)m8QE}9#f2Wqj~)$i!sPy@8C z1Q{iqjLws(;5V*lF5zKwSGIWMmmaDgwa)B!%^9s1oJ(Hog-K4jQ5W@V`J=j7uhy&A zh0Elq?a+H!gPxA$gWIV%UYk50+?#*y)SEM?tKB~AtCG~2TY4Y%S67gtf>a_|C>eQ- z0z+9!bs0#brgCK&O|?wzs-zmEsZ4|1!^u6h^WwYZG6n7XE^93vn#o`ur7ijT*lOP? zvf9_gReKE6;$X#;C}(hdssLv&!4%po6C&{`-vsT^b!TIuzPf7(_9?AjmBNXO#5=!b z@K}t|ZUC|b9y983!H+7)l6T!7e-{Pdzacw2oiUv-_0!avNhc+LVr9cg*wwgI(9}5N9%;D)jNA@#r$OXtEivs4E!u%r2;PZmL4i?U*12 z-*q7~G!>cHqaUYG&72>mzu(+h(<$>byL*;RihGJpMXoG0XELbU40}I$YEQ@6Nm!d4 z1>@(xCk>EPRivf%?@b4$sfDIQbDI}$FuR|Wxiq@Zmi6G zg*%w>$jO>OJ?p8Uc)0ta^-V@{`kFfU)?1UFfNiqvk&*nMBk^w2xyDv*uu?!UI%`Zr_;{>2(@um4CT_f!;BNmY7-Zb$)^MaKu4B+m)u zNem@GdT*icH{H*2%?3KUand!WFjpLCTZY;ue`CZX8zR@dBFAQSc|s#NsK{q=+qH8` zus&S*J>B3^8zie>6BJ>Y_20{+h+#kJ%*5^tMTWC8K70osCB~yco=K;c0-%E7NG9v> zop8;kFku_{MUIqhg3NbA6-h&)<6Fd4hSI|r)v`w(;k3Al?o94@rwN&w2fEy5y9lYv zmlwo1pVDN)^W-#0i|MMgtwjBmFBK{(%loYykWQ~be$92BlZ1g7DY9@8viQD|sg@Ku z?ZBGf$O(RHRL*ZD16fkqBldAG5tt-7hljxkW%e=!{H$0LX|B}&rQAzO+WCs>@SHKC zjSY#1L{`%FnRFg$4^FciX8^#c{rw5gSCgHoxF-=yMdIu__P)y4HxI2c2dc2& zxs&m;tR6~7jkH}qE4BL4rlHgarspsoKrf##oke9r?_XcG(F zCF>Tc0CP28=Gt|V>TB^Xsrj-4hGZY2|55^udoLKZzS_uX`aBz}SCmhhAZ9na?F>`b zY<%Q1E$ebZPAB@q;w`=Li`BnY)z^u}{{KIscYb^kJG#hhyh{EB)YKS%Kx3{0cpcyO z^gYrP7ih)cB%_Q>zXnT%T(r3|MVdA^n0&bs$ZCLF+j4gyM35*<9? z|KJg0(H|X?AR{7y*f1n6dzPkfvT;<)zQnENn#H?AP1Tsy_lIdOk8_HCl`%f)9qJah zJi^@`=1H$sVvrYp&mFBGRD? zTMjk}l0?;h#KCV#DVZGY5xI3#Gp^kFZ7Zyde5gF0V!VYV6vCu)Ro2_h6SLx@?i9K( z;YTF&B&Lo9;^w8xL!;bvzL_cuT8~)>5d4s3DyZ+)qC1BlZJ&hH_ot#>&hDi72#22gfn2@aD>c0^k!=3#cPZlD%aRo zu`$up#>tx@+p+chG|vD|H#gyQH-nPrbl%AA5CRkW24o!s0vQJ(vu|+3q0FG%wt>K6 zoL407{wEAs5)GR?7n=p7wxZ||W8uV>u;(-@hRG!0#r&7(sMy^7u)EznKG}V}_d#qQ z9USlN@179-7xrOLP~(90hv%n9NBhm4{iEaE!)AjLI@w*!+a(i5!0fC|4?1` zeunJhM{RiBmW)anaUezoNQdI}x)@m&T^Px05NNWzjDo5)bmqg?es>u7ZH!YAqXi7S zQgF~2uU+LlymX_EEoulDyO&GmQVZ#%OAoyt*=3#-b?3?R0*06_ECt^M*@7wF_C zC*5?D`M1_ZmCK)@fjdfxxReW0QAu8-in3sMlX0(izflrD>5{dg-@-(}DjGYW3bcF* zxV4K7!%I2m71#5TxtL7_Mm>golJyKj9c(&HVo0_-T|`CjRKIV#n?)WnIukTot>$f4 zy>lb%YM2R@E|VsF%rUws+Uc`A_G6 zUKZz4!+u^Mtbsr0<}ynb(&Co%^vy>TTXJMa;0a|dowxF0%o$HHcXA{KI=Qw+2JPSw zz$o2M`DG`x(B2JMl#loon{=3jAC`5Xv^Zh(#7QybGCU?3zidN&b!FcLKohwF&El;fLlAiATTANFhU4b~^B zMZr3NEBxqRGh;~A=t>>aD=SskDAta@L-Kh=0Kf|k$6Yq!QBL)yiJBFdrGv4a=!M1h zt=n;HIDXME;DeMn7xMML4=|=U-t~7WO1aMwY_VOT9k(TnOV(4>kmii>3VIk&(2^2I zG$P+zy1ZuVf6Dm4zNz|7T}uY7VK|`S_Sw##IuED#rt|~h2aXfSISjg3uZ8`3>C$0( z&FGuX1PJ|J4;M~D8lRpn#WC_JJ9$D8K`{DM57T^oj>s45^c)JXb7(;cK8cc(uNkK#_MjWAm=jJfF(-4i_9U19MY@NV=O@0i8_ICt1=^h@4 z#@pTfeZc{KWMMlHj}@f{&KXrgr^2JC(tKp{gMLH;BCH1g&QrW8NTVC%9)P3kSi!FI zf?zwhY6?PH<6tWdR4FNJ**VZ?Ou0$X=uJ{;Q_$2q*B{T33bO)~rldeUpJ`Y!l((!N z=k(TjYjsY=Zqh-VC=f}LjQp^$aO0pl^|Rt9Wu9m0*o6v&rKPvs;$>J?*=lnT4uZs^ zQPga;gO*0L^jlizCUBEOyvUHna--elXRi^eZl02K!gZahs+lX`(993aq{OI>uOmj@o^Wjq{u*<)Iu{JU&W*If_ewVvR|}=u7BTD zM~He0?Ln)BV|(e!H_&sDA^%yFl^G`Js9T*~rxMJ&I3`OI5cT3Qn5 zdL|lCXN1vV#p?(NtMm%p>$hkmM^FtF#@zWg(GaE^7_rgc!|RU$@Jl~l!=qoW`{SA) z)_NfTia>S0NDb}rPgQC{woT@%GP(frt?11Jhb6bUL5wt7L=FSZp;NjB;8W^AFnduu z?A#-qa3qsEu!-cbr#Kuk@#GorietcUkfirvDf$?E2b#tw@eQoS6~Vz8dE?$tDnOmm zNVOpWqKP#EDZ?z2P{0XkDi}UehP;tgYdOO=qojOT2>T`)1k4_WBfX*=1Bu*o5zPC& z)3-Ukp~}{)z5Tt@ z-%zLddhhgbx6u%cXE8x*hMSZK%1Ewq)tt7hgNBbQ7(Y3 z?Z#^0zrn&vIgM0JAZ7$1CM`5Mxh5|jDc`%1iiJ9|CUOJC2H=Z9=oyBiKzU0!%Zk;L z7+n=lUy9QJbA^fHu8(On(;Q|PS#b{a)cv9nZ4Q{BjZAJfM0OdL&cT$ZDJG8kk~tMg)h zeqOxVeY1Bcq;6PjA058ld&6({r4WYp;A-(H2C%@Z8F5+0Kjc981p|HK7Z2!>73WEw zZOebVT$dA1BbWKHNOKbQKSgA=&XdAug*%x}OkOr~cD|RIQp}mfvT61m9@OW1J1I!A zk&vt4o&qs(VWS~N4Ap{0CG(&uJuo7(Ik~5GSF5Symptf*kUiiIv@eBo=>cG!yNzPT zg@?gZT2$7BLq)oM1J1*Tftv69oS(=YD8+GyaOk}V7#<7>IZ=K**mgMCF{$VPq5J%fuB!TMN+f;gco6GIR?hSz=nWoOqPZrt8 zsRgtCM%6o&dE}sq@+)EVu$OM1smuP3yGpn0@j@aQE*UZ&d>?^z4x2n4{Gw>ttHurm z$biK||CD~uqIQP|RQ&Kj6FyESYr-$fvaoYdxxqUJzj1|kviq2?5<_sBOK94L332%< zxJJ5PAP)7(;=$INz3t}q0Sr`swZH;J;IK*SVrPF}s;4kQi0(Z+M)CrbQhqCBSC_e1 z+T-4UmhtG-f9IcEv5z<>syLB7N(ck+ z4c86k~O%6*KpfX7=QDpYuMAhzP2zPfgi6L$nyF85hg zB5UrNur@hOQ{~_;;L7|(R^Br4IrVPkM8ysTmBNsmZ=7nSqoWy6Klm}aI&T)$H*RMK zNtDSY9O4b6-w&d3Y+SrBycC|=UZhTbpc1wcgzurO2Qm|aPmw2?K~#B(Imu+L8wnc- zDoMroL2Oul`@Fo-EQ_2 z*+fYyg^lNBlO(E`{cc**tg-h{V{cKLOg%m|llew7)I_wbFvVz3SWASXcVgdg&DR`G zhok=z3_8ms=# zKT(TQJ@XZ$KC8lhTU%coZXN8_GSdaf4ksR)^BWb~ZRZr1rAfAJhn-G9xpxU0^a#ju z(oHyk4OzeS(xcT$oZ#?~@Jk*UNt=pi*O{H5_`BJTr*0c1(R+?w` z#V#@X(x#hEt)IJgS(*6kQr7c~1Q*1eq!u`5adQ_|jf)foLo^()GL zyFouDj)O11kh7&^PRcMz#r+>8JZW6AjOSohE)r}f>xDBGM=6kbCAYb0Nhv7WIwA|T z;y#k3llf&|W;xG@hC}qp%9Jj1B_g^6d~708WE!~OvS*sNxGe)~)Zz#Vsb=^T&VZYG znuF4O55)N`Np4XmglqnYmKk=QB-^owr%wNtsv0D>KCJUq^eNz2jXv7XT_Z=&%D>Lg zzosk-JXP|(2uqR~=uLFnuesS;td{V%B=KlDKt~8E?2sUU=!-Z3>{ff+;^dv2bP3)K z{ad|8SZG@wWlt8<*R9lG`mtz>bgWAFWdm&AzDesy#)YvTBia`0&<-dTyt5i zozYKa%v8i96$m6SVWUkeGPEjI`FV2ApGoG$j+|{0a%B#QVpYRgYUQFxr=?4pPN!5t z`d%VG?VU}_Gh7{u>1Q^*vBq&O9Rg+7#Z}m+bZO%ui_l8GumkK+#1^{L0oF8;+9$aRjlLicQKwpoM+GMn@tsF92*Kd{bp9mJ(His%d z$IjjfI)f358b^s4vhvSCIi5^u;s-knEtjDT&#m1znUOP@8!*2Ui0R%wHbE2cT{@w% zf2Q*8<#&TZ-r+q#^VhADO>AsxPt>)}q@EUR+BqBpQ7gh#G(==FLzG!n z?xcHXgOeDK+?}#=E+(Hi0;)%}nzi&c4Rp0H6Y`G{)0gv7I&6*mk8LHx!{2Tv{aO;N z@J=2ec=e-Z9jHz`Y?0c{X5aRwP4)JMg*DJXtQw9!WNxejz7KF~7*R z$_psA8oj8e(bclAv+ z$6#B7?l{K(@hN8N8umqDyC6P0Rm3aYi(AKgyN9PIzloi0_W+I0%WwA%8>d@`+q>ds z4^GIc*m-|+vZMFK{_(Fzd-#*mfwe0e`At9MchQ*;J%5agb^g=DMdbP4+1=jXI@wjV zcJ}wny1%jmdQ_(S&E^dh!ZG;$R?xfxIhw?5*g0unf3%Mp-SwjH#7 z9rQEz9lRB3Tf>(#+8WaAoob7y&{#yFk$~j#+=Ac1tnj{q2O(leb~&+!S2G@Ad9t5xuVWGU2+V3$f#`> z#oNGgr7D2)4?f}-ycEl**=hAhUAy8@^JM4faR0X|e0#NbxCIACvJM-h+m+x+dpuC! zB|Xsf!<2VPSp;<998eM=#`6F7mf-_o`_}0$J&X8wg z*&klFs;CwF%H#F!iqQoJ30@~hglCj2{`Hb4N`0HKPmwJ`TM1VX0`YmM`qL7?5(4DVl+!=+qZQ1u6#7JEDwr zeiX~JGIMg#mlHsnvPlKh=@AgAa=5v)q2Hc`7jQN#E;2}L!+L|4W2Jft4RMoC&(BLD z>-l<#A?0)ikT4XBPM4ENfrzd5e;Xr$FWs%S%sd#B;gW9UMX?6|uPo`}7FMMpTd)?z zOD0|ReA|_A-thqFM-uU3Nz5}B!rH}f!- z0h}BV^kYdZNHUTr{0T3y(i5y;K=tq(ZSxI z#oJu>abl&>UT0&|{r$fvm*`WY4FxlJg*N-;F2>QWYgszU=Q( zj0BK&M=^sy`HP^}q|i&flS)|G7tEHxI%|pva))UXP`JIlxhLH@#u@G8|L=XO$| zaaBaN_!MqDPOwELK1y*!hPTqLmO@tT?7n_? zSUyYDzo-g)_-Yr#{N3_dap|IJ7XsSw?)aj@Va=T8SBjr!S$=whR zm9Hg6?=+2Jrp{O@PQPr*9$es+2L_ZW7vZ$*NBlp)u2kCnE`i@Vc_ZtVWmb|Wi!Jg% zCb#VJk3UvndvNg|e-z0XI@>({%bUi9$Z-l2XL4wpKmC;7Nw>wbs<`0x&IX&s&(dew zlYky%C`M`Pjb7(SU2sf^_>g!DiNvrUCEsAc!VMLrGaXbCDa^ift{#z#6k9>y-O+V4 z;@B%lHdV|Q)R{(oz8KV&5A40a_ZnSeKI0!aqk)L{ExO@uh8>LR2+!e}DfF;jEvU#V zgOAs!*fRs=FbgUM z-=PQ8bRIpRmtRQ_Xv{Oy11g=Q2g&fO+4LaM$?r`MbWF|^Jy1bNGw6XGpY%V99#|1d zzl9z!n7l>Irw3}IrRag#VF`L5J$SO|fkFPq(*vq&=z&WSUT-x{n{;tVoJ$T}K)+s3 z8MfzA2OHM^3XQNkkV7f#B40-@?75hgYS?u&?U?LholQfsyZ@ajiR0RxK~EAPchgiQ z6_fWri?$@^=bI>u18nj_=Te)*CQi~EhtAljm_uz++vw3W$A*yLL{!D&z3qdeo!tzY zgEyDnAd?MAR6Z-?zb=I#px;1VuA%mnf5QEVsn* zmp#%(2%pUd)V(;{K(Hx5E4uE7ane>k(f=e|H2^nSFm93JvW$Rlq5#W?xM*Riee|(D zlM($$sz2&7ZC6Gm*bw@A0V#sSQ`q=Jp)BaFY>{lIjWB9z^9b?t`gd=k9mUC3xCym= zv*9O+kq{H9(K=KBj1Wi^C?K+O-iZfYKuGdI=~E7akq>(TyX>Ljfb0{D-CJK#Y0tyTe^{=rvGPDS4 zq{qW>bT821wI*kX#J!moWQ7jL(_{=)54-;hhEOyj)v2ubdYy3k1&|Ox75=6q+OBiC%R5)x>$`2*t`z z!iuOv5a5ub@XyYi&8Q&Qnu*oG_yDtCq=M_p7valfD`$P0hUe^aa zs#TSt`#5HmXge5TWQnAPrOF@@tjO`mGzaX*k z29SXQh-P8K3MzxKoerTRCjL>9xyrRqS{(x!cGg4CaL)Gj6PKQ>0>|TDwJn0b*@-`mCqQk2vL%4rE#9Ji$~a z{K@WrzuQ9|1&?$*=^Zve^KD56pb+jTp3wma!3M{k<@J8H%WwbA{=3U)^^u=*a`XJW8{4IPk^1`41vX)&$pgYJ^U!?xBCNc5 zD1ua-2ZV5m#iwp>Z<{4|Fk|cR=x}d)YrpySsBt>2%&T{MF#dEQbxotV;NKd&j*Z>p zt&^?OqZ3&NmL73@v)i7Q#$;Y>le>7x88SS&Z}hOTM>!KC)jrXNGc_NHixCsBmQ+1{roi3nM%V|0<5UXh5u3 zOMH8Fc79&JxIhnzv$HMle|+!n7Z>a5sg8m>WS2w0(o+5G?00y_|1Q+eYv;AP&U{A! zi=sY8y1{c)?>0OV+p3Tr9*5VLKXvTdbNKwJ{-tdAcKD({q5X`u^6-8F|@!3kPs zR&#DrdxiK<1_HEN(2c4?$mLY`cZf^fmxm7mO2qUn6f`b@=m`=hvKMic!zg0>Iz0Su zDX{|DlCq;DplHoqdo^7yW+<3+QH*M%Pl1FiUF(#aTZclibjgGox1@w_(~NQdV?Vm> zr*GHod`gqDb!P56rfL`IqtPv<2`&{ys+}i+?vv>0oI3mV88fqXsOXZW3=xGRT7I2) zVk8cQ7CKRR)?3boL&3^&#hHCuj!7b$B9s`mBM7J`H-T+O&$EjPkWyO=ebSAf!p-xf zKR{4lzWI zms%ck7zo^2-Y43);zwIdkpfByV@-b{Zur&fok}TFI>|!YA5>yNi_z55OHKuuuF9#Q zIM(S*szUwbV(vd)3&I&|_7m*ueu{71pTMy0&%mjsNSrLUdvbDgQa*zTWE3Dv3s}?+ z`V8Q%;T*zJha_30CIwrzbb!`#;bpT|_)f7{ObCc#P!dNg4it^X;P*vUO)}Ujc9$qsf!1E+ys#UvTZpb921mIWuNGtFo{b3sY#2(uaK zu+tK#9r02xY`1NPxx8ECwebOb&+cVxl;T^V-cKbCk`?#)7u7hD~T1m^Hte#{} zy6l?~EHeTzVMU&@ERB_!`b4;-l97l@3P6_jX>$_v&64CtN;pA>0s9K7i;V#~Mv+od zyY^#(C=7iKToA^>QGVvi;%lA*24}4Rc`23PfC@^u5cVrK=_D1rRQ+c%U2tLkEySI4tE1gLn|h_yM>UNmZjf zuTU)OOJYb(QdjmUU_3jwU3O>$=ri@VaflI~(2b|>=$B+xveGb+OTjK`Dtg$ZnMKli zEwHoy0;#_^Ry-=M06~;e3w2#TB||2LsB-_%5XE0p zEpCTvQ|sBQxV!%vR&vREiGmmXS@5oa<2pM#*uS`Fyb@(6e%cp{h*V0Zo#e(<+Lbz~ zp}hU&hV%u%E*S>_g$H_StRrqyj17{4I4zKaHjDzo3I0#P3ReEMDP+> zDge}*3}JvTCiIqX4aQn25-z-WCaj!AhmzJfNni))IZsJmJK_jv^{d7XTc)F&;{&S4 zn5fPYh=8#N=27yEc&#k`cY6W@qji}W(REuuSTi2z$}=Kj8J%~bA75mDD)sQ}Y!&GN zjHgTi-+_Uu{M-)cu4Uj~XX9w*x*?uAXqsCxg>Kd|BW0*9Xf;YQ(UH;K&PX!t+}^vNfYqR`>$ ziYoDJ4GTP5bKXB&vw&F7`*`u>0bOt1xEuaat7u1-yTXVA{qY^1iyZiBeCK@~a`c1I z_oFtGP>RNn(mRDX!IeZ6>Ur(rV(}cd%(=p#Mf0s#nt8`e1J9uBz0?QlA3yufT!;y1 zI3o-4wY#9-jU5gI-97X=esfC`shX{dyqpbRE{!r!pZ1Z8oqq1*5itK=iLw_4TPuuL(6ko@z%bpJgu^ zMMD@)#NojvK`?sf?|ga2TfNna5v}>hxOFA)*Q4&$M!i9^-`mueUrE!HelK;6)H5ozc;Qt+gxCFue8yDC)8Y8p8pxQ?N$gga^G%`R(cDO2 z3^q!J=XXO#r*2)mmDO~4uM&6WDu*nLM|uV?Rjf-6UHHqMY=HC`7^aCE!bBr@H5VQMgt zQ35CyM_N&ghF&91(MWVkr#+Dh=orzDGgdwR3Q}ZSX~FKt?dFaHw-etr(V*PonvlsG z!!w{DSk$@>;mZdgh)8nH?MDx3ZnoK)sgY^6mSvoTg*R;-E-^-E!9!YDKmh!1G?Dnr zC?P2nZma_lvvQua(kP~?a|%S?*3eUoSw&u#>duyXw^h;X-4f!{IJ;Fr{VI6f-fbbH zLX{#csZvFrqi&Cj8aJ9rm7L<{BsJa@`=>km&F!PZUw04pb`Q6A&&ohFD;Mk+5(`;E zsqZPav`&MDP-GSyjO@rE3;H3cz0`F81w#M`dxzT^ii)6?3y34cP+h;>j*Vv&zV+;8 zO!RS`8C1IqVcdnoXe9TA8i~^(pRWq!bTr<*YMi302gZd2N{AE7Aq3#f&fZBwp!zmw zvttMa9gkJ@0cXl)KM|y&WV_dvDJd@H$k3-mbwtG?1AZR_^og0~OewT)yHTDm((ZJ5f;w%urxiM#;Mrwlv~Y-XDXi zir#AXQw2LWUBEl?VKf+q{wP2@5B4%R001g4VbX0TiH(nOol)YC^pwKsZrZ5Aq7XW! zxz-76=`3dfudHJVpy;470=uXfBQ25Bi1F_tV=Rr6O~A>R$*lV6pI>m!_j@M#%_4fB=#PtnCw6ylM+cUFmwz17D}XCBgx+6pGS$5kE?{HmlmNs zo(g4yD~ zI7Ct61(~YdNn5py_h?hjK$N7E2M56PBS$=v6!!hr2@F!99w%a!ILQVOjtjH&Ic>{} zN~2rM?46>t%*|dX9sIP87NDM^9Q_(HtpGBFZ=}qUFn=3qHk0)Yy0EKo>v z&?syFSw{i}siJgR&TctycG5)^`gE4qUQ#7uY9s;#aSb>4N%5CTZZ#Q7!L7zI60)i# zL$Zi;oR-P;RD0=o4w?0|dx?-A+vg;+Fe;@|g;^@o_hj(jU-7C8l^Ym`6H}kHx)G2y zOv5&2wGmT3PRfA<7d*pVGO^BlxwGlxf~yX*2&j^JP#i>rXbZe6j*HHm?AK*yXp z4tfI!M<#G+Y`Fyl9Xc`)hRQ$M_nEavIto~Dd#V4Ng!6(~V2=?Ku>2~iul`9wKKQ`Ha ztISf2hVT|6$`RKATug9l?EYek(;me!Y7C)=$7DuL^T%=Qm=kagCAW|H&fh+Ppg!ol zT&gqD!*Y^>5@55j?S2%Y^21~jM}=gGovdk|iKbJ0ZOPnR$I`y;6jvITLHcEKYFT(& zqJc*;a-IetyT>8qeaxq$t{j_#&4SeZ73dYILr8lG|K#W~X%=Efi}_@cRh3lU0^=%G zxDqQbW23y3T2bkOL&L?P8uh0vfZfLAIasJv5>iR2MuLej*l*iZq_eS@7_sh1(zAeo zCwvQpXvUO+JH}k;`n#A2BB^>(N+~4>!a^Ni2&MvAimlpFUZ9NF<&ulkB(RoNSt5K*64Ww@C{F49&Pd;_swT=Np5&!SxzlixH`a$;|+1pET+~z>O9Mm^O;0 zPWg+eLqZagf*eM{@{E}5dXw#O!^FWo6E-Dm^)}_;tz7zGZ33IX;UqevO#HH@fN`Iz z^*#yrMb_*K4pEv7yx-NOXkC8#Df69LdM^;Axb7G0AoTv|g0cGu2uFq=&dov#NkA+T zrCb=vI`d*}3A4{2Pe7+)*vHrhaexWKdYsx6(~0)+{8g0*V~dP*!n=k|xRi2fk|@cM zDpc7;v8>JalsIO?DdHARoh-PmWhwJCi5Jb-+-7ATC_<5SMcytdP6jdnLsDcb?7W!U^g&vnz2onjVk_ZuVoRLQ;Yq(#LMd;g; z2z_%7p~s~V!W!QtfzUVR5Blo#K~i;m(A;`=dUUY$7mzP@Pa1nihh_P;DRy(nmf`2p$xo7?YBPIeDZQ}w3}T*;ZJy3S}GubBbMafe?8 zJSj@rLRuhYQF%couU;uu0{q-N+%x@2j&o9=~!i>hhl5rx3?pBr-`s15fvRafA z!lC0ZpQ<7(U2?IY)+JsrLfZF`Ac4D}=zf?y!t~uM9JUgPd4tkzuP2wCyQ=)f#_?RGi8Bk<-!iD=i#tod%14l)0R^sp;feM)1E_%IcobV zSm)IP?n)NeES(q2rsYb##PV#x0)o*N3yO@@7dX};2K$+3^)${8^orY%x6Q?ay+&j2 z@C}d=Zc_f|64d&yB2^yzFiDi9(%ap124DsS;^)Ya6cs+Jc)jr*|c zN8>)hAa?I5Nz> z&*3iT?T%4SU796Ba{0zyUa}Mjy$j9?N*vnibL)g*ba+x59FQX<$|RGwQ{2*a@>uh! zGa5rFt`Q#(?V*2*H<)@mN&^BX5?=Gn9rR9cT`Unt&MQm za?Ahu&th=fzO>AA4v?kT**gWMd~5$(6&q=mefj0f=ftuvRsUe$|6t$$@38N200gxw zo@H&b^5NFOZdK5U;pyj7bsLVLzr#loSv9spzDQ2W=2nyH##a&+perlV)<{QfUPcuK zrgvAC5wEvSp|5AfrFHE*pc`AKFySQN%bKsZ_8Ys>$YF+>+9igpvqQsry<<*J>Zjn;jx9TkTVF<=f=P@pxP%1~P6~FPGCCBA za?j`JGb43=nWD~86;1!H(eC(zSpPw+|AUFO6ze2E?31w#FiRNZ-pBlbS3#F!W%-no zyBlz{{Yw*4w*+O#3U-KAPJLp#F{DS80(sqV5NAYGZNEzL*H8*NMh{(OTUttig2vDx z-RYt6`U0TNLRHBolF#Onu%9UcH@bR_N+gx6?qNdQtndXuegOxHsOFBQc>gInlZ z40{x_&IVHW-rg3$s8vf^&Q@ip^H^Fm^@W)VL~$|(R5RN|OSs+R-NT*T!|lD@1|5DA z&N`AUgMeeFahQ0Hk*t%1#3oYKJ$o0ik;uG2(6}87+uMaI{QKbp{&}8{Xt($)Mw=qt%Gy!8v0cO&DWxd>jxeT4j|7!7a;^LQLu*;Zhf?Ln)xStw%AY0@4jOk;bf3mpzs z$Z8)xRPAbjT(eX|oU58@go5d6rR!E}6=O}8QUCyb?RF8HGuq7rV1G0KWJR(%UXjAA z6D82vY4Pa3OQDa71Sz8#yx?kmY65Fyhq5#6peyJ_DtPbK0k7A)U5m$}2)R9kgS8zO z=l20=Q?*`?(7YXKC+C<6B+$Df{Bn!24W)A>Mp_;Z7>taScNJZaV|lr!{4hK%p>ml0iod}egU7cwnOC>_z;;&O-L z^eOG$rFQ@im~3ATq}49lF{$o|of28~uss*Df8_d2dPg!4!h>2)ERi^#Mb$!NPueZb z1UaL!>CkOZ8U_qUYE+D})Trpmackf%VX7ysc1Gvk%R^0SA+PxQgI3s%jz~&eN3E;% zV>AgPaT9b0b~=%;?_(mJ7Ae~;tj5GlF|VgyN(MsOS><01D~Fxf+cqaFtOUZBX-Ayy z`J`<}AThe%2b>cGb5YY)kjx8mfC!KVtkyCyOol?o$#_WdR?U#vWQuy|!04&-nx~IJ zxQoNM0TalknltR%&Azn8F`>YdB!t4&xE7`x0sT_)*mA5_K+(YXYTm4hFbroI@x9-`I{J6EPYO5KUNvPW)yM8G3t= zTCvIje-*G;0U>25tnw||jKUFn?H~^}8FS92?zq<%FP21^+BvUO*&T_Y80&M=@ZLlb zCGt?4kcPu-VrV5Kzhbdan&{0dVDH(ZQ3h{iOUx1ZGBXv!ISPPNp=GKH8G>80Q9b`& zLBjYD%xlx&Rct!qO|f#Q*!1WsM$1<#WlulQ{bFJ02DTS4_?X@g&G1Jie(l!Y2P@Tu zthFwFLiDR^3eYmf&>=1@+TpH>HSttDvkd~t7_T(1eEbSjKOU8eVX1agC}D#0EU?(k zcSNr)otEQKF|6H`q(Q5cwyn3zwHtXqq@YL}Q}F_b!e=xOtv;}A=#7pAF^VuZPofRi zv`rh;eny)RIhqH-Kgmh%!5PMJWWU112KcJi;q9xuWX;atr~L@Y4^tm2wjsN)5w|z; zud8sHVD88;23cEqEduIcRgdddIY>cpUs4fW2zzj@Sf*_=&HzIR6gI^0*+Y!QgV%{k zyTQVpa^o`lsEPI{cmR?&mz7dL$4Su3&rujMqp+LMf=H?=Y}c3yHz;=y2PGgJz4Th_ z;CSgpC7mxJMixVgvxT-F-}K^98!a;x5S(eer~{Ha9`?zY*s$4+asPN2iS5Njv+=Y) zg;Mn^NNA+jrK4Ry514JgHJe->U=}HWxs*%2sn`5mb7M^JHr;I?&jR;p@iTCvyB|)y z=)tNF5Ge>y0s+yKJoD8lyfd|nq}4RUTXKuSga0Ct+kB$82A;6Oc8HaqbeUi{lm_wi zA**C-%RQ^zh~xm0*+BB^Pwd?kNX5@6pm@llKA>H%*O7ZQBO8eud?tixLL@IfnhrhI_yb23*&f<;YTU0T5Ro2;#B?N$5@m}jYOF4y@y$ghUk6Ex3@g%Q5z?d zC3#?of*6x+8dw~G1TW!y9g7ATT^Wmpvn9DfvQ<@b+F}XRJ2~ z>ab5QYD-hv=Gk1gT0Abf!?p-rnQi0~-7EP5o+e1!jMUJSFxMM zYu$3POqgr}Mkkdr85WyTACsf4+27sT**kpG+&MZ;-P5R=;!H9x(psb0jz$mA*SK(D zCn=WW*BY7R@RKgHT61INR+Cw`%|v)=sZ^>pmDxC>2%LulvT_1h0Fcfbg*|CagR84u zrZa0QYx-e8k*s1=16#`x++k77O6|BL%z|5n^cx9z(>700$0xBHq#=0)v(nh#YP{Vn zotNYtRs!Lv94^i59dWmx+mP-1pqvh1&$k21dcm3w1sZ*3zt82H>v~YX*o+B8Ldb}TpDXXO^(@S=r)&@P} zMDD?(f|rEn%lZ>IAb48_#mbU_)}#}R}IwiL1x zk(CP$o!wo4lqhy#VyK>MdBnmICR>!Hjl#F}x)h?^YitOQNPvq%adr@f6T^-w zw}Rn_by}#CgKoVVj}(7{sy&$w&KFnVHLM_+ZDvYG&#KaV8vcDzohUE;VW#(ou=F1< zEGYxm9+1JkLoy-GsB(66jM|gN#q8GC$#aH7 zL-It)9uNbsJg;@oP{meZ96U0nA+HmxTOJGp?Hl5u(?_LhE`&K0+u(+Rn*qjQ$S-b3 zc`IorZ*|FhOYu25g(NJHbmFG6Y{9|~MrsSTWWdwp^e9s~W%58K5mcD^AM4vPIFb4> z@#1J^*ck;n=xQHBT4|9^#%Qw~R*~G$E4nJ?ezJd@nl)6y`zB^$X|rfvWBhQh8~J_w7QJuiexNYJc2NPZ#dEvUNR;% z#<-o3Y&ynp0t0;*-C}4)*byFE_OX%Mt^7qU*^G=~2c$U=6;^0NSPxcF*W8qt$AlCU zgL~}Wpq)H~>AR#`SP#8GlCP~;8PFQJmn7gf%9#}{xFy7E{@Fa;A`z%Gu_e2Ld|c9f zf3k?}@4e0#UR9C@K3|&e4*&bz(dq7vIfV*E`L%!tkyMt+6(LD0qq07^3Pt%9E2}(9 z{c-OK^SW4IbU)`gS2z04$A;jNhj%SaDz<>o{l-R~*`xt4UXVPTY#pcq2Tkd!N-xS= z+xth`Tl-aIzV7jTkQLzMp^{Mx2onk$Rej#&6hi7%)w-$Kfxq3|+SxtfnjGmnqaXs` zJA8dqrL!mOccLt42Y^3SG4dq@n_4y-Z!?~qp6nf`=9-E~fm;(t^1!4v;EjqcqvQANDyH2jLB<@@9bJmx8g(n1TuKe>PeHEC!Bg~Dc z-WSlquX{VYP;_^{VKutFoo%6{R5v;5L>yZ_DoH zVdeqkLCqNf6wew0HdwJPV9g~g=_H*4SL@f&y@Yp470*M8*fAcoeHFTWNjnX8m zkU=5o&CyCMR+u^|;_2@TPR+A#-9hcrl^oq&vB znYof;fMF#uiU`KJ<%>~NXfQQszCAknizt)QM*7}WWTz1V>IIP_7zT+MQd$}k6siAl zRbGZ5`>6(iFeqiYH2}6jcW-2JI(ES!bGM`3fZ{AHmvBbg!5v-AaF3d@d4SjiLP#yi zSbfVJvlbuA%m(RdXePoMN46An3NzXjF^y7jd40j8L3S?yjOCCFKfQc;FRZ<5VsTJ`dWpZXs< zmH#6;m2@b1vyZZ@gA(B__@FV{X|wp*{O}5PEEM_Ni*E`KmNa9ESH3aK=8Sw>V%H_;j^iheL0Ug?j&FarcmtzU+03?=X4HQUE{pQ)8hRqe`;h20GHA9INu~m`nR~N*3*R zt$-=#z@i)wQYXueY_l+5;0NR_w#gDBi0b3+NE+V5;*zNvhCo0ZqUq#zB#@dC(^R8! zf^63_(qfTa7Y^fcw-5W5P6(v|kZx7`f&a;Uj&-Gv`g}@MI^L+Z0&`YfAw><{!(I>C;;=p2jRRp#26cZ1DIAg69*h;U)2uvW8Urr zTLRS_uS`Uil7%h8@&TM-9hbAaen;YI6t)I!*cBfOG;`#^~BQir%z#D z!4@o8SztKXr3sWz96nwAk(5PTyh>_Z;t+uxllnFqQa(|?jV9hzUgWT&mPDmR9_rXA z>K+qColmHM!wXbEHj)elC*vyzwd)$D%A_Hdp%`iE ztayAfO`+dv1%naod>uT{R}Mpr7A0POjO%^f5C0BRaS4RCrp;;GdNGU;&B9?ltT-?g z9X4fjgV^B3ekWK*OrW^pAgm%9bd}N~E3Z{bV6J0`!b-JJK^PRN}7{mmdZ4lWIjzW@QcnE1?x(&m{ATHP} zpc9)^@=^;*^3nao1JUwznO&X`rb!_v119iZiaV;~Au`-g8A>#B*7-+R*6a?*` z{{yLp>$<2NG43xxFi<_atd&fd2r{pXMX^jxH3t=m@f^~|_8L=FC^bVnz~lH<<~+cA zY!wA;IL5nw+(2AS*szPVJupl^zhsL8^Hc_ZG7)~QIKf!He5rDOmQ1A*&Ol}(#6I{$ z`lXxU9a16OrzYM$r_+QZ0+VEsClYGeWI~8|eC5GG-0jw=$FhyhlC?0RW<^|{7e{?@ z7~G8-qhLVzbp$Qqk1Ef-+;S?6l!}NW9rM&4qz%h>!vS^(H$zk}VU87Y0g>TQC=-Jn z-b`*T#&XMG*uNtCWfesak$}xe)zoNTD~h>*CqE$5z`-bXXR`gVfFEt+{PUGUv27fl z5GbyS#ih~uDz+XoYpIipP~B$dtlsE*kB*bQqV801G$eYJlFcVfO|5d)B`l1olx=n@ z%bUxPw?TJ+c~4~SFg6C4+g*7hWjf`2)#b<^tm_}F>wh@wnhpkVuyy!me^*&rP6?cx za{qT~)1k^y0qA%0qPNz(8u%k1^6{u#gxz*__PY+o*t{UyZnN7HX5Q2KVoA3RAlZ^E zU@cBqA2VMeW2AQPWk^%@>87xvovwc^O=Hpfav<}qxI;8OQnu;RurfV+WKdQW%Q+)z zl;z(U9f7cvtik7OJb*>_;sDt_+<+=^y(aVW$eJ()?TrZ=XLoD+t&HM8^`yys+Th+4 zskp0UOmz7V;OT1*Dgp@ja(Hy=k>&4f!*#~JOZnyl2@f|6w;&V9Q9}~GqndEXt@~%( z3ZQcS%8>(tK(7NeOy_E_XSq?!cnusxHt2r}hf$vxKJ1|1m!Z2eb?@5g@(&5j-fcILOx>kx=wmyTNJ{2jXDbzF?#5(t^j{R(uuu1_PZr}Yh;L}iM7NB_Z1^V= ze-7=Hq)y=yXh=!NhbHMoT5R(*ajP3$UCE85LMl@!PMo0K4gp0D#`22X+n1qTWS`tD zklJ;er2Y852aNB>4Zc%m!>SnFG*E~Rhi!3b4(xdv6XJ}lOC2c(*R=;cMJ7as8-+{~#{AF^p-H@WUHR^LIU??tQF#gIhdX zxS$)_4~1kHOPH;8*v7d=AAKDS(rS8Y%a{6+R&cPvPI9f&eW4Wa(*PGt><$yy&#LZ@ zKLt#W)r@uzHmjtg6od#h1Ik5Jre~mxi+$0Jb?^tjFLi z=TCeid>M(o4-Hbd6$3#x1C%B7V-p9*+GnZ`LXuPkbz$edIYu9cmgB-4yqBUJJafqp@9~0^YyBa!nGG)rk|b1Jq)0C}iN9r$|QfrNd*aR}HvuYBgWl!an%4c?+# zsPKm4L(vVd`oYLst}WG8d@q6}R52#5$CxAAegE8f`2+--X#nO>Dc~(V^;Vt&`C4Cj zvA*`Qwxm8{aS7f(SzKJ4*boAF>MgB$OE1LI>iW~w^_6E1kYxb!%P+!Pu09uw%hly2 z@yjny#QYCJCYpfnVrw+QID&{PJTxCkVAKy=K<6bNg7&DjCm!BHrPLg7&c0lQ|JUIE zr=;?DHjTOP=J^6R3l{vlO8>6WzY=0b{3-_VjX{6447gds8s5@#Z~0{j-U!<{`72o; z48VxljlP-n5szhkR2vc?azca$E6Y_lRu@;+s;es!7qkS*6iAvRIZ-{;4NH}VjTiRH zJXbMxs)y2TTh0i=<00$Abu76MB8vg5HR+`$OajsDz07_HjUU6fUPYrD=#TjEiog8Q zy1(v^;~J2fp9n2aQJnQ-i=|`0)&fdJ-s{F|B)#<;kg4m}?K;4z!xp2X^9XP;eLu}y?uy-RCvw`+d zxK^Fk1E;Eo@q5~0o6-#IN60sfF!hp{*ElNI%;$|9Pu@Qzd( z1-4ok?xSkirjJYr2@coW7o5k0^Aqva=Sb=!mh7Bq1jTx}Y&C;FQI8Y!9fDp1+$ zudMJqa-=cxlz>gR@~nzcteS5!$EdzyFnv)*PN~k(FsSzxB0?TAiCvYuQE6C+2fo6H zHh#O!>>l-tvqBAIEU0#y71A+6DI?#H`W-0y5p_&7S)<_?1Y=YjU=*Q>qI>yWW@VPu zaiUSZK*vE|a>5{2YYX*i6{8?OSsbGW1e}qW2N=Gsi{g@y5y>v_{SjLgjBbL&hPOj6 z%a+eCi@kvE{E_RC;?dC{kTodJ86~;!ZmPobFh82UktJl|`NHQ?gMo`r6-HPAiLS?* zH&uZ`L_jaPXo1ApD_fFOy8u2_EgKH2#ZOLL8>iNj#gl+zj*YK50o*K`w15>QRGL?$ z*A5F%F6z^RFyI!VVBGHw*{Vo@3K!Ampg$ zMpfBhJknaYWch`3&w7DL%r2WRE*Eh`1@Y6LS4?s2`EphS5T_A4xQ7ufU>QM_STd4? z)i?!MMU9Tux4W%#!zyMQ#k(!>vl3;7TYf4PWpr2CeD!W`e+MU4C)=_U=*a`9CJuG# zV<{ve@$%WmPS(RL&mk#}Bw1ziI-DWaEwx~~`ItJ0EvIBaU^Z-ngFG7g!+RA1hHS}{ zIuTHv%&im?iu;!`OIKyYZR!XHWuYv?l=#b+VI}E01F0d&haDdfL+iiZ!T|?@3Ld=o zRdH$0NJ(oxu5>!lw?~ar%vfEcxQ-(kXPAtl)GN*}Ms`YUL&*JW2ZJHVl$_y-wz2Ba z2)3aK`@=z_al-oXfPy7UJ%P6Q83iQFK0)7rW~v{$;4|?Vr)KlA%%;6d&!1zDdLI!{(0I)I8*B%zRBv5>piiMZyW zI*>TvL_nz|X$~~f(8jl0v}lDi=9Px4zO~H^&SAtO?w^9BNSC0Mpb+Jo*tQDm>=%samZVN{dX+-3B_%>NWt*939rA zOlnb5;MR+mqV@8nJn-f?$YfC^%}e&GmC6MsbizcU&2|rAbghCuL#RY2q%TOX>5C%R zcLir`t{tK;w(!dyqnbY#%l5SP6(MuvGrz1?spT;!)1pkn;77|M&2he$=WB z$D?Zusui@y;zfOBt^RVYMwbmaWsu$TmR@)(Yn3OoM#?s`UIRG}wKLSI-1QN27`bz^ zi2tsuI)tpm>f+-kc)bO~euuVF&4aD&w|j@XNJ40|UN1o&zI;iPl=%V`fRo+*-K~ZN zV3-F$l~e#ce%$!2ak_h8>c@HYWkFSaaklEY_2p9;1k(Wcl-Is0sR2Ckm~UVzueP7s zOY~Qf3C&b^h;PUytjm!5$UTJDeUfZoFMBMDAsx5^Mw;XiW&9u9wYp<8uSRtUmnjrK zJFD}st{(7c&2KsT=7Ai}LqT)B3+so$2(Wp5VSNFR6qrE%Ez13?xLuK9BV%RI!P|1&&b#}s?PeClEsY=!x`E8~5@EVFsKr@KSv|yJg}TK7 z_W2XVA|wY1cn6{m*FiD`htE~m#lX0%tD!sW81wj;?6)McaGTOuAg@V$&I>@8B9}p> z?li#(@G@BkcIGP;y3V4yxZ}0Ti`g@d7A>!G@PZ{I1#dy3G+wmN0bAM{bvFzA7mxaz z+gcA;Mqt;P{;+ieGS-}fbj>Xg?qCDeVTS<%`=xQEW=*?}32Cl;i0O?C(qip*sq zI<+Zrm*D!tUT}pNNFCjzpPtHXy0KwOEjWeJMdF*)pliy+H{I+qS9Y0n5v!TZuDdl@ zz?oy+m(-~MiZob6V7)3O`jogrXi}BFx@c>mu$_P~#_R1sH{R04fl#3{M*UOmF>|}{ zC0u>+>`U+2i;rLW@#@OQFE9rSUt++;)|XHI9ny?$e}o? zB#;bjXsAf@^k^rz3Vphtu1m5Y(JWThKqiPO-coj1EbL3nxEaS)85o!}@_<^Xq6~pD z1ErI9mR0tIlgTNuG*$i>4Ew;ZDvgGvccFV?a`vMchc&~y`L>Mg#pHM#N?8swf~$D0 zD)LM>?2qp})Uu_J(mkhW)_4wR66fUHY?iQgDLu=&04qzA$Ke-~VCl?jUep%q=QYY8 zmt2ZQhzPcQ{H}TW+wrb#3V1zseJDe9Ui>m=O}(CewO2ZK(d`s z6#2dOv$b_}p|VbWf^+xcS@YSNqETK1MF2sQla~cCy!JC8BIWoBc*9mUv~U0i>Eq$G z{85|<&^iichjueqU0V8%qwN9<`r^gM1Vnrzp}zPUsDKd9Qb50@n*eYy$X=HL5Rl=Z z^%XEb^@8u*OMsZ3%x{`VfcV`9KIr*(-xbB<>o6bQ)mOk9_gBB;vfN$|!}$Ad>V-^b zNy+GI;07N*Ml-|3!jIWM2jMUqi!3zig~J)UngK1hr!zn$&cyEyZh)FMUN0-Ste|r0 z@v*$HR$HRuHlY!QiU~B*Q?N(E<6!tW#k<&!VRGG{T{mvot2?fM?xwdd# zQ8!4@5cBMwFJsQiFQz+|tmZaoac+g(U)Mx=WqIk@TBTs&i&8EXsJ(&_qp(8l>Eo*G zZ*R#)p4IW+7c)0S4J}V>DERa=QK$Ay*4mm}?O9&EKhJ9~Wv$6=Jy&fRY9@~RwZ4(V(4vP8723vhT~NVaQw60skSckaU$PSh zT^SrKQRzdn5+)qh^)MX7Fr?TfU34yi=bwTu*Illy2nq~SfNuqou$BI}_QaDsIZl8F zBD)vGoow;VN&o%(*{`P`E;s>r&I$M!V8;>~JRS{2Y3tSY&hG0sZ}-!JC{ZC1h{HsGtma@7x*pwBEvjox`F1KJ2%n z+qijns#UHaf}`LKWF60H5UNYD*rULwcVg&|Zj`485_&Sn3tQs&sIm8fywT`z`I!Y) z*3x1o5i$~U)%dg?l-Q26pKJyMXU5o$F-mZh5fB+BL1WZ;vi9lztfePfDd1Z|?kOyB zf|VfpZH;&R>C*aY<%vkH^ljMhk5+3>(-5{$v|Lz!cewYV$$GKouj{~d;KX?rN7}mT zVYu;6Yngm1zfr&ewr9jvTl?)X|KWmVHBE|dQe}02Etn2xnh7+I9Zf-%jNaLne}SOS zj-rdRMtm_F%SXM5;w;Yb?4WlM4F@-m1K7hV*#M6k_0^Y44w!KD`H~mP(FSZglwEag zX~~j%^>iuuieSWRXa$|(R)@XylfB0F!uoRUY-xGr0>FI1hbVA_ch*ybcOdoqz#8^F zE|Xe>B%;WBKEDfm1*hMe1#$?3U|%CCQhc?!_72 z?)syVxtWwA4)@w3Et z#dmTs@Zo~}ROEEz({RlJNws%Q8b3e7Rf9p^5xIG0){L~@UfAk-{kvyrbk=p5W+Am& zSy+E=1Sw|3^{uY(2A76aCg2s3YUsH(I$1J&fi11CyoxSn9Ud)lj zR;Fu2f3ICEsPoj_Y}n3%-433TetQsgg9W#FVK)!ezNUG5S;%o==|y$r86eAxmFgNJ zi&9mn*6p^5)>6~seiY|!a(faHUtqb2bmJ5zFT1gq%YPH~VAQJjqER~`hf>UwVYvvn zTwSd^l-#WW@OT5I2o8BX-;qs?+v2Jgt}Y2-@FMQg60C6Od-wj8jE?ah!ADc{rCvOPoMp%K7H#eWc zp^P1I9Q;Q6*nU# zk;EaguF}=KfFmoA>zXK_Su_1sP^1fK7a0ZGDM~IW^k7F8L>W7WCeHK|+j`Ar*&0Bi z>B8wzqafM=jFd7M%6EDObXW#!DzHZY`4uqJY8imx?W3uHHWOe6JOEDm8@3;%2~t4N zmNLR=f}%ZXbt`A}ECBWlAw#xFZkm7p+a0 z>i)tET~F=R%s!hDCiu#Z--S)!wrw6-t(%A6dD`+x56#=eO^#kUiO#D>cGuOjNj;}B zkDI(3za7MG>*|r+x_UOLbt?17rE}NJZF6#KM%(>}_ORwU639`|&%ixeEctrk+7oOk zw7BrZoFmXo21(4$8ZpLet1qg{FEp?7>(&PlhWAfT_C72)fIs_VO$N@hdK==I6seAsCR9noyI23=rQ;D3B3of>~cZ-}UN^OF$u1v+Sn)$5c= zFFuM$>%LHjR!o0YAFHyD*u}Gp3U+c{nv2XfIIg(C75nY5gVLO_qGwOGCQdCGN9)Hp z=ew^e$9tNlQs_4sR)FPEA@+EAO@x zi>z-dU@6bbXG`A8i-q$Fnr`5g#HE2W?73E%Msk7@8CILH90{`|WfEq9efY${UIlLb9`(DU!oBCCdl($DJp@%{@h z4F@n1`ZfW|A-b|P--19y8{O&`YC-P%Ktb-O_I6S$BGC%LYND8(Nn>qLD95Me$>%St z%TED=U#{9TcI($LJUU!&Uytu3T=kh3J8$amKIp(%T#~2)+MuCy7UF#zg{0QCcqNZd zj<$CjjiZyz4EbNF{m4T9OkK6=Dj**AS}$HKFD(&n=Db~A5*JGE;>|Ij&!<}_Z+1_c zul5eNPJV0d9iHxk3+p>kcK{Nd+u1X=7q#W}l?rVccqCS8E45{m6Zyw7`~dmqJGJGMhl02cF)}$ZF^@6=QD4d^VX&BOzBej z3|y895@-qgRpJQ@e}3@{$6;}p;e!20DCIURh3spZJcs_XH46&w6Yoywy&uJNFJ|wh zxxH5hu$sSG6hfA|H29+nB`qau8OXj z@;D@uRF^zb(mh4fBEx}Y@_G|(h_kC|?hQ7g#jD-Nb(Ys#oonFP&|zY34*9Hdh0%9q zt@;A6_vupgxl}gOpoyu$ADUyCz_M7($~0~xhuxUYZx~L)W)f$c5F+RZVUi~w~a1uS_37#hGpx+9NY5Wv@TZ$5hyMT zwkpc*Fre#a)8>QfcZqvm%AaYhM6MG&d$e?XqUbl0gW4^` zHt3l`Ygx485rjsqIujZ-j4T?HWWiRR^5~wc(Gl&u>J3N0iLR0AlLc~)G- zZ77?@ItH_l3B)}kq@@<0N7BBYZ0ElLjDnHT+mr9u@ z>$)N80032_{MAuI9!50p&z>X8yZ97X-xp8y%(H2;nt4(TyaXJrpRKN4!08U)p!@49 z&J_>qcm}!4pa497fgs)hjORS;V);yaQP^O()@;-A(ADRlzDvF$+9X_Bj-kllS81v*l;cUtT~(RY6|+ChENS zIj1*Ve90IRad&XeNW!Fl=sG7w8?J*9`Nm%uE&~C?t!8U5ZmN(bm#OlNZK7;)&nND& zvM>-JvZqKBlRafaWRD5p%TF6KKvYZU_SN!SOn;uPteQzK$Z11ED#5-L$6HO*KP@+x z@*%uPL0Ha$u$&8Fb)}O1#(}Vs-v?*t)}&4xI)1Qar|&DZrG7#4q}iWmYw1e2()bLK zrBq74FEBNl7qnl+@=|SO!f2eU>a3Sfw67H5FAQ8Z$Ty>fB=+WWi}+S?jBY#Gy1!(f z=2=-LnnZgVNAFIycT;6--5`bw14c8q$haRuDJqgIWORU)0UZopK%)PhJIV;(rzgu;Lm1ka)o2rsKH`zVSsR8MtvE;Udl-0ogo7lSd3 zq^vh|MFt*7jUc1;a-#O~BWlAQUH_Jqn6t-^tC22|F$3HU5FhQ1)27VtIoDZTN!IC4 zssqFD$K6q~&ZH_2Id4d>O)Byq@+OD0MM5vR#HE7Bp&tGYL{F9|*rjnaOdXjQA!_M;181Z(cACN> zfi+Y=p^TdcIVlP;quLlnC8WD!o#`-(0GknEtQa@!2YPwu5pJw!yoL9VpRJL*aNcz9 z3a=uxo3JeI_z6=-;*yK>%Jx{!C`|8UxF_(4J3B2Eef7R)R636Ni=@6d1e5T}Bd(+Ky zSM&(Q%U53WWUF25*aVKH=54T&zW!D0zmk?LF$yFBkOS-&a&DGatIMlm@%hrz>hd!! zjVYnPs-UGVN#>;BmBzk>mp}i!uzqm7TMyM0?*hnnOZKyb6)FMi4T3P^*5zh^BT_zL zXbdorgVE0tU0X(IQQS#S5LW%!@-It|C|S+uWi78XdbZ#^OXx<}W$ZpyCP9{dgm(XA zf5Eu3-214MCA3OwATzJLgk@S=(IIp3v%R*kz8&>H1$V4hhv{k2PxBOun4z}TJTAa% z=bS-iz}qKVzb$<54#;BIG9bAF0lzi$@1d(dhJ8KlwNV_$=R0oKNoBuZcRmM{wFng4z=uN5pHeayevVVSMZj#WUjKX*nK_U zg`=MDz){yXO5Xs(x|f=Lo=zKy^%}ignq|GF6q|9qH0F6LiEbe5m1&4ak6y28>u2S$ zVLL)Vfp`A}9N{}OMA%ffF#~qEp`{dOzW4VFx5srp2+cID?y3&j?kK^hr*kAuhVKK+)AmuL-W#}vHvqo>$r;JuTiSsoIa^x3NUsV2dHpP@U}@SH9XJAmF^XZ%-?=f+;~ zvo(kZ^9$fT6cYAn1@jtb^kGIIdFKPH>GGs)Mr}f8mvuYiyTK*yEm)5FD*RQJm-ySUy(9+AEu|l6W@ur3D{g`GelB)sZ)Dx}(DK22p zLe?mp!D$1>nCO`8exTU7OlTS8I0H~Fi#QdgV3;!B-sBN0plGWOfMmG< z``5RtD;c}N8LDSlfau|^uIRRor#3XeR#ND92Rlc4{VuHIZIk6n`IOs|uC^0Ke_kWB zNJ9sJPcNVa<&OLEDecbG;}@Ba(Hh(ICUf#WX847M33q3Jd>r&g;kftD^@H9U0Y4Z= zJBSwI$^xLity=PXBx=-oe_|jQ2Fbc)aU0K0vJaIcM22=jYuFJ7}ET zKSWvvSy(BJ2fBgYHwHf^m&j;f7!0x<`_eGJ(ZNsB$~TAa9Aa>pIVA>KwO(5&V%`hg zkL&(;S{HPsCmbD*^Y1YFs7adI@R?V?_{O$Vrw_*W)3U}q=M>SgV+ethEX2*Dol2h-6Ag3IqOwW6!^Xe_g8@GdgoTHN&XA_&1MDf43dxChZ)c0BY+AmZ<;2gwm+k(SJ_Ry z%4q6Ux~W%oQ&vOxh<@_DmHxulNi?gMse6sA`y+MJ@jF7)Zp3#WPQrr+%B**1g5&ek z^imfrowf|7E|)un(%*Z*pRFZ-{|gpfHS#Z6b{^sXPYaK+=+YD;8PIS7p#T7xv`~Vu z;)qTF!m;KYARHq>dC}B=N3#QpJ5vYD10F<%C6kfJeiU`I>#Rd53~8n#DeV6G6s>UF z;7UqEs0^u~(6dTjp=YYp@%9!L%P2)ry6j@lrx)A(^;vGm>_X4;I`-_jRqDk;W{Vi< z%CWeSRyNVqUjfYq!t(~h@RL6ZJdERpMvF2Bq{6svyB0^aW%o|iB=`Io?Q)jnb&A;E zd$qk;K(1t&QW~Kt06)W@6Kv2^2vYov^|In+`V>D>BMRL>4HB3$FZQG8Be~a}wlu9mq+i8P;ArD`53YY)pdLx(b$m48}~W?i;apZbARW%HM!lW+>|mrbVGd1?a&CL`gy%$3bV@m9(fP#G6)2-1>b^ zgv+T9uE!xTI#Zvk#BK;`H|83`1U4{s!l_$bt*xOK|`~I=_$G$s@#GJQN~;#n2{kBxxHD@1)g|1 zyucIBi7)WP`~1YyQ4lEU2A-`tIKZD`r~7VH0I10enqL8@FPj9~RmuC@^d&%xBA9DP{^(vfO2)}+b2(lJh*s>mrrD7!EmVkMQMV&IQ% zC?St%1S7G(-Q3#W-`vJVf_{vN<^We%2^@=F5MxSCOqeNl``4JN8><3k(3`#~GZt-L zLjUU<2B3Rx$^Qm}q2#%>;tqo48~%9H~^+ z3X2E5hI7qyXx4);4X422dB1{4akX4Zm7q~G_L7N4vYR?O@K+L#Z&CJW!_Q9OQ^*7I za+pgH66~CM@&=_l`3yI=ejxlMrl-3O+7KirD3ZO`KGP5>}i>~W*oiKEMJAl zvVHZW1-S==adaovYD?-7O}t|c0<4-b$f>3 zFcBFNK){yqfD>xVq-6c59mvZu&Yl+E$L!k(h1AQMWo@9_Twk*_k&o1s(IPm?GSVre zwPksmO;@nhW*V5La2XKocUd|&64uhA{Dw7QR8K6+Bi4lKXRnJL<{%FKHim;W5l7jz z6u;QW~9HTR-Wv4SQ-u1&f%302V#ep`*H+axT9ntvpWKCxd zzM(|PaFpNbSmZVsPW=wYC>`+e2$SbwAVZwTm0GQ4m)#S7j|lW2io+2SX`g;)e?i z82N~iPVJP1rvHz$XYFbmN%nL26}p63z*t5P+ZfMeW(Xk(cfw;a$z~2=64@3;gDrU^ z+2B3d|GxF;R<|BDu)|5LR;#P}T~*y(U6r9I-ppRIJ#g0Bb<`f&@eLlY-;)zZVU>{l zp0ZlhW}Wx+j!r&PSLEFsGBqa$7<~X<(787WPb&)?C64J&Do?+mc%LtOrc3spdzWYD zk8h|XX*6Ae3N-|x1z|}RV=@i!=vk#qxNKWy5u)z5Bd3KH=b}~W>vB90 z0Xj1anl5WkZBEy!=Cm@9yIP%+6y#3MH^iyG zv{Z2#%~7n+S*k#>s%WS}bCNABiY)6}n7w0~AXOF(o&)qB%}&C~nfUaK$^goALM1_U z8%~~d*1E0k)n4aXHzutalKL!};QAjYZ0&VjGc8?fcG|UV)<@5u83gb}T`sQ)1)b`o zty0q3_u8Qk!etZ|&mw}hOe{C9S5NGU)-32OJdxsMO{dJ3o5G4mG^MSV-9f*BjixMS zXhT_E812L^t(^peZjsr zG=+>t?G@g5-o}mC7nLwU$HHDO+)^x$i=_xQds^wM~_u*#3T2lGXwxX6)NlU(-TArnQ@lAHY-YlqNCYw(nWHAh$2vCJ zv61F|q=T&K*jpHhcjFuVh2bU147EFnr8aW>wZI6oBh$QU8fqbqyVxmRw`2wkQNS0s zWZ$OQ*+VO?wzcP?sX@B;_>yc>2RAXaz`ABd#j-8F78Z}BtX<{|C#dOD>t48@u3GKA zYb9Dw$lx#;Lu6Xn0vgz|CwWu0Mf_z`kWh|atnM2V5w#j_(H8D7@cQPkQbj9Yw2pMS z!PGZ4@Fw1;b|+geZL(=%X`K>_vzd2tKoxd{?U@?6VQ?F0Axgy6Yq{8Fr)8-K(JU_M zu~x$$JOQbQ-7RFr{z{hRjrJ~oJ7^YS-t?S&#QS%Jh`p9&*YqkFFV1>IJvTS?mPGdh zjTkt|kjND@nn>2rSl87b#&yl$Utx)qev~y*RGv_%zR`efSytU?;)vaM>W;F>l<$UG zMSJOnGIQ1~t5)eb3XYXfe{y^v5jVp@%*&mMk-|%3q&nN?-tjeui2z^CW_*7U_l}^?kUsqA{_D-%|A6@sd{fk^*qv_t^(63$* zl&W-b0(254ofoEv&CK5~BxFe#D2G=0f*^G7Sc5Yv;flPd@)luVDB2k z&i}mxCJjh_x(M)8YS=hwy!K*Xw!aPrCtfga9O8*f(s+0FNwc$~wCiV72H93ixOd5e zSgrf^^0UyFc#Cc(-ubaN9vbicdmqYji;rLN!pX#o@BFj@lFZNS!w#<~kN~1wt_L1% zF3BUsB#pgvmgMaL|6-WKKPTJ~F8i^uZ5MBpx20G> zlnb;&(5=b7s0r1Yi>A89_q&{4RG-klPio!Mqkr{Gs8_o@RibcVVxlOi@W*t4eCnw= zVr)%!-juT|AWnZne~?+EGG63HB$WrgFQo%4YL{VFt%1daEDvo{pO=T{(plC2G&!?N zu77ie<}b^ZXK2Nxaq6bm{_E(W``TBgi7}ix%!L&=W=%W86K_Z|{cFE&oSz?(C)`Gn zy7ztfSLLbhwGTr4%8cMUo{!;UFpk1ix$v-GmJzU^Rr%18!T{9DM~qsTh>JtjsC%Ey zX1Dk8{OCe6FT-s9p~>TKHud9**;s|DwG373*{IsfP_>_jia0p%$XjokM8id;jxx7> zERsCsa%UyF(t`K-c;9&OeULd0;eELZ-)^-|rbeu+!K*zoOd{%5P9{Dq-%ZPs$_fmr zP){j7uAIX(l4P;g{pacDE_zLbr4uaV_OElBy_z9=Wxrlm4lX2P=VnTOFWVK;+Q8+F zko-Qz6zf>l9@Z*a>N==}`B(Ua@x^rnQKqoh4#NuI%jr*h7v?YB)3Z}Nq7Y`ya-%3r zVl(x^p+7Ohq-1oWssN`^*h`~najFnEAcF9h8Ac%*5#JZx^N_hcQX_885X9rWivx3^MmP( zT&jo*l?{W32Aw+b<^^f9aCeD4CV^$J&~<$t1RTh4F^gy75U-INtRg=eq^>?lu?~fO zH7<%~$3OpFA*&p>rS0x1wog^V!4T`2cHWihbU3xu(g_AdVq2B4N2f=hS3&xrUoo71 z>p^~$uVV=^@Y{z{6nc+o>T!ik&;bz^&8aBb=ifeT1?Fe6!{Atk>VFP>upk71fXO>+-WyJiv1oe!)hnavN-9}Z z_-4Z`7Kh-uPcWpRviJ8btNjSN*bk#hlv+POtsw=JY#TjTF=QS=l)s#8R&uM2Zz4%Mm`3Aq zlw?Y5!X>Ma6Di6M=Rq8WAn~RRIrTan+U{&xPQ9tTdoicL{S+Mi%q>2KQWI)4^OHo+ zKr#lV%>QsC0pGB?$WWGnp(*T3^6^S{1nR~ZJ>pIx=)?f}Xd?|KAb)z3X`K|=ZoFX3 zVr|Bg)^^CwNI`lv7SW8<`-ErThesZ?K2&v7V5?BTYmvMD;ShnI`e#@$Vf7Tcg|5 z=mR{o4m1v)xdZB-xJ>4hwdj5oMgAGbNE8oIC7S%}&V!-P%8xuE_Yp=6zfYx?OF6#)s6kC)U^Lj4$M__tv5oB#A6F2gI2q`};$tS=u=;uLlpGt7D0=QLg zn0Go{;ZtRn^sQ9N?9w%+1*;THy)()U+E`!|}{025KlsL^A6azV2zC)=bk}4gA8fEZejk z)7mpEt7|vAj@7W_pRr@v7A$Iac2;D9C|aiFnpVfK+-}S5I_(k)@_|V_GFuJ&pELx3 zs{MzAZWc3Tg#HMI9E1#FSV!S)6UpBs^|u>#17Qt-o-Sgd)LVz!D8SiuW8Z=QF8pu8 z|5hDi+XkA)GkVcYN}Ky{qglw=)Q#hC(7={|dO;d2u9fn3C@+_OoAfJkr{6vL?a=Rj zol)Q>S{;9F`gQ2nrQhbGMF!@rMjk?#R@-!%oAAZJ``N%2>E1Oww}3mLI5-G^DQ?qx zmD$k2hYxI)N@UYuP*imCfo~3cuT7K9|;WHuT>_6bV_y|a^}94f>#@IuMy zD3QR^Fi@t*t}F$U>3C5p3IaET|1KOq&c5&q_fiNGva7gL*ixH^8+Uy`HcKN+RVR)< z@fO(%0|)}zh>6#PMpuFy0`F|bL4U^F*^ehlCg#wNA#MTEZ9v@5BZL7W4?C*EgFRZkUwa^i0 zeNQZF(eBMx+|n~o4o*M5J)o8Hg~^-c=Gpnt#lhwA={vzIs7zF#`xw2;;LS?fJp!?h zcW|jD(4(TJ1F9c(sY$1?4;!{{=V}T)S%S~EI0+e(AYo~lBzci;{UcVjYiw9(EW|u{ zdjUm+qOIpsL95^&q&oO;d{Fp$Pl}H8fh1jRN2#g@GgxMQChieW{8!SKw3T^}COdHr zGRXFg)+xqYx)VF~Q1rZoF*LfRh8h#&lq7(+fpEhKchYU#nloS2C=F>Ai7iH(g7Ur? zUQU8k_#OAtX4opP*1rHJ&)Vne?EDgV_jSIZvK>%81+@jzzr$7InJ*YYsxw~RKonZ| zNk~J~ysgVCvGR|HDUmmf7gtoU3IvcMfMVJi08K6!K-$`CAjotc!5k4t4yNTOqxdpW z4r*=Zf*kG{{n;qtD^^dSEb9m;H`cI`k*aD^!tHOUehMPlcS5n z_Xnq!2d|Gm9AEy9+q7?wFHetpJ>%`!g>hhAAbCBaABN(yf{DW9dRS#ICur2 z%XndY`L=;e2^uq-gmw~P&T3i5Fu(~sTp!3i;W11aDA_G?OgawQcxjj;+F1q;h$BOr zNi^DX!|c0w#ghy(HPn%Sn9o^PDvJ%-M!Xts-*GWkf)!sYA!%x0=C_pdZ5f&-@p=WQ za4!gqB#ov9-(!%9)6jnzp5!*TNreL?1#X}c1KnXuhahg?1-x*I77`>_A$_e}vI$TW z!GL7;8}hO?w$wR{0 z)+;9XOvZP)UIuL+sfrO&dz+EhatP8Wg2F>RB!*-u3U%UP^nBcvO?_qJ2kn9yBfO3X zR4gL0jrW}oPJbs#b=JdqCi!v?L{JoL7TY8zyvIokqQL~OG-mva{M*wm4|Sb_g}DR^ z1~z8`@Br07D!(Ak_5H6=BCmtl>H^pwY`4w)vUT-`d0jK<_sjOi?iYt{g>l151jM`y zWr~A)U!3pbxL04Y7kTqKie|gK;{!Gs9@^Nv&vT5;LnDNAVZ7CbTK z5GFyht@ykPXXz~$%v+$|-V11VeB|32h=3u?PnbzSSq%cngQ{{D;N#vO&?5-@z|+VQ z1ftrhK(&*h8h~)Wt={kBL;{-ghx;fd1KBGOzzB$E2@IwTOvbE&GbCUW1*`TtmGu zr`-J_3w%=*n4nCG69S%m;95}~b?ZQO6DF56P+a4UPpdf~=RkM){?)*bQ}o!T^NRv~ zXCj@;kzFdkG%hk;fqa6JkQqke!nA%wooUi+0uCo_3;_Fz(DVQ>od}lPxRfTbvF{H& zT;2n&1>dZvWgv2Q-$Mn;1d@!Sdo<6Kdbbgh0X+EPyB>G^z^yI_bm*Ow+~MiP6QUz8 zDCl2}`{-#1L8wApU~fSTtbT~)8b(_tSn?_$WaXfqVIjq zH%#m{K7sE{VcCNS-93a$ZY79R^82pLt3%k{YgveBm`v^V!vofcEY6C6KhD61Q`^oy z6G`P@6tkqMy(uWV7$Qv@j{P(X2C1(s9^y!o1;OUPyN9BEL{L;$*dM)Wnw@L)+G?wC z8*ebnSG0|K)!w_-u~5}SsDKG06fS(rVQV*w_$IFV6%GE2SE?zF0Q$Y^kFR|rHx3{; zze2^w>;=Q}<2)9K2F(YpD>-gxTXXCtmmlK?thSnhPLcF&BmY{FCf>8}jABGCUHahe8!D*2g|_8z zGeF2y116b5n~4`m&X}xn9O}%VDO!|;V`wIhCEYqhk*DdO^doaC5j|?3EKEaFCx_GN zpf3lQqT2XI=8KbC6j+-i#7rImGQsSo-MJmeknLnKjrgU;A3Ty1$6*U6uq|JdEc=9PisLLsV6u zBKhNAv|cv8O$VDf7c<{P88#`Elt;E;<&H-To64dt2s60PG#=x+-LK;kn?SalZ4!k* z@E@Y~GhtgdpxuYGONje^h_dgG0=^T1>vpoP8z9$dU$YH6v}j>`7dC;n>Gsgdwwn$p z4GF9-jWag$3rl?36r-x4X*yjHqayOQzP)GF9T$&u?0TmyFA4I7wUpSOBI^|dJ@W-> zI^j}~1~-MWO7a_CY!g>??_>ZK*=vFoK|ne76my6^^6f0 z;zvO{xKJ>o7!U*+3dB%+4)CSbnxsO7V&KT6k1dfkyU8RA+{oOyZu_Ec4+80eo;n_~ z`Yr8tqZ?cmwz*`aRf{2-;GEZD7<-}(fEpK2PPt0qlo33j%D5;a%PkZpc4}s}t&wUK z@gUvi6t}7!rUN}Z_7#eDllzQVXcqLxX1ODf{b`9+S#qqN`xYG;(t?LuS_z=)C2JyG z2-PE6ZT*cz$2_zsa9;S#N9i~+0W^jp3DU(hh%!9V?%i%lDLVjO{<~0R0 zkF&72@F8E-hRwj`?!FrQnO^UUu5a=*9JI1PO9a{v3Wqj8gey{gyeWB?qEX`Iz*wR1 z#}7%6z1^_?QSQk-F$_^07J<1we>K@yOr(}pzrsw(&`KNoS{Nne?47z+NW--v(aC0L z@L%@6w6TdJY524G6&;~n`H206K$K@xU7o5P30EPFN=aOr+FV%u}_ zA)lVg$*jAV7ddv5i`jRZ-i_=+WUk%3nhi_u3wrCY8>uk!GQkcL&lKNm2mRmVhcQm} z8@o$7+`YS3$dEc5e$GxpT)u^3_G*65?#`NNmwk%4di{c@0R2qo0C{n0!1I7t*1Y1G zKpv&#d?v6(4JYDmfBIx#U*K%uyy$(_K)8HlQ!gL8&(d6dO5nFk*^;k+G+-=iMJEUQ zJ<>Y?oh0o=MItHI|a*GNh^Qj5r{k}U(#!F=ha2jxmX#n(RDK*bK_*>3mK`o*kQSVFp>Ki|8z;3&dOn-L`K2s2!O*2l$%_ zPJ`Ac$ty?+ZtuCKc6=JH%lRwYexNUu!?|7<8Nv08m^uiTkkd0_9we7^jt(@BACi=P z_0e*5RXlLz^^=a6%FdG+o^G3^pQ%EE&}5|Sd)>#ke2eaV1Aq)J zIys$19+(r&B?)_O(dD9Z62{_hjg^0Lt_fPF-Q1~opE~Q;7+^b2#zEpsqMFW1BLa_c zq8mcx$Je*uz%W-I(jP>A26g>K9nzzX>WexAg)|MYx2R?pT@#MqqnsxE^4f<=-Ep9zt%4sQlrAt$@)_YNl zuN|qSeDzyvE$6hiwJbNo?((7LuC1X9v4yp@mFn6`ZhKp+k8%oYtiuK=qWn1%j{5<% zxaPIE=9FE@DaPk>>8e!lTkeqjriVm%73jvjZ4G~WCt339(WPst0p;^l-W2dbD?1Bl zSfVFyu)N;NEeqe%s|X$ZYZRB8`cV(pU_Q!W7KOeANHR(WDbmZU zjJ$b;Ei)RJmn?ynNk;-+;UTA!#tdF}(HQEd;H+pkE7QYSS+b)Qc7{mbSLH@SJ5fx( zbG~EaafnM8r;F4C$YDMd4ZKe0W&L;ssnCO^2ZjoTJ-Q?U{NhpXc7r_1#?*;3o3Ra( zS6e$wG2?ya?*+#)biyeYWeDNb$Knf z;;BykA`w z5JfyXH_1R)eY;|-9oGrkbg;z3RGsPf$L}A}%R_pT=Q-;2S%0rSX#@W>Xvub%I`dAYrz1|i+5XvrQIp9=IN6tynP0GLPkzVvowjcarsG5^Cy z?;cBj^9bJ`uky#ot9REl8u8`T^@q}T@5?w6;A76C)Korlr;--Q+7j_!4<4->{)?oi z=-|NU7-^3QtIq1^1M{7CBJ{h&6!*;OU4IZyRSNRCn?GtVV9ZbwwZcyx(UvTlo$6ki z)4_eUQ{ng>6qt*yctN^_WJ7SuQ8-rXD?hq-ZI?{FQ8-MG(<*kQ zl+6sGS~08ER>A(JsEW0`Zr-knwVWCZ{4a){1)jtmGerFSB~<`F0knO^pdId$2&QNY z#TSi0`q>n$T_(g4;m?%P7|d!>kojHwS!)-ugvmK=o~#7NI?A-pV0|q=RtxKE533KB z$DGSX!|;7B=YXEcucl!hB%^7zaU@>6-&j3hQ{8-4lMvqKUq*XJ`u8*S3ukbgR_AkB z_%Y%SMiVN#$Z~yGLzH3O0mQ5dL)?pivn}f8AjTivPmB|1aIPB<`WLzKjFfv}GfG^* z0!Z@3A?XQE+HRrC{31dd7c6bm^U-S!(A{btMHTrxc!>itAv}(rDIE$DfCEG{C1v=IL>6e`v3&?}GV9LMCaa1Xjfr`5Wo>mGg9kiZ zU9GO=x0(^LjOGQ{KRJzk-eGg? z!D{sZoV*@BTCP48d3yi!vy1GjpJ@!_~$+SvrYu%8umuy9HOALnzvLQ7=ldWE|37B5Ez13XEnQEc+p|4ae8Rx z;T3v&%>fqS<&HeB*vH8Ip4&D7ml_e>w!A@E&kjo7^+xnC7cz^|9>}bvzR|ey4`2H6 z*zye_j&APE()dn)HInTr*T3$y$^9%dL=QYQ`R!Q$taiL-)FVB@HiZYY)(U4)OG)Tl zx?$XW`K*$tzduknA-g=KxPcgbSdq5@iS$!|%6Jo}rQ0yFVQ>11_ZZ1Pt6H8!7gu>? z1zX*h$WL3%C9Ss{=hRBczhEP5z3toq-O3aG_IutA1(=2;eJ+(t6c3op=jLEN2+Uxr z>$h?VgZbFSy@`lK$YD{W(O1Fam=B_>q z^0pmXz*OR*{ zTv)fid+sNB=X>J)EmA|H3eK$$vS)<8J-IH-@Y(9tCoeTK=)Ogry4)iGG4bs9+MxSj zNX7;DlZ$zzOXT(_S$#}O7psq#a)*@?gugQduBF6vVUcUUOtA8JC71OZqjfQpoGuse z<3`0SjWncXHla}1$rcNvBF-O@%xMR`9h;evYv&@Yac-sM%H_e*Lp+u}diW59`FRJN zw;K)zH&dWr zRw-h*nn#Sa)_8HXP%>9{U^q^l0t%7#onkfYJc1$WdE-u?thT3EgS!aEgNZQ6b_xD1 zfUrIR!1e0m0y;qos_9k8imGEuTO7!`x%rY>p ztDkr6;gN5usc-iqpwB?DbATH{t}G#^C9_U(xX>Y9fiQ{{(r!kUgmkUPg3CwCEC_4i zQ=UW$KD#0*$9PJi8BX5KfcPQygwxd4hZ4VXY1NqIk1cs=$g@80U-tX+A1|-r|D=ef z{68NU8F`$Iev5|5D3g_Y??KD--2-6y%#@oXVfi97B=gEA^XxBug^1ho(()rzA}pM% zobvkgaGk5Xbe*rfv@mnE{vfYk@VR!?_NO!@R=FnATvo0{2v?6DzaJ|d6W_4*lfv|a-*~PKQ6BwbMyQ|bm z&*T_-X}!9FZn2lv)~ajl7u)rGW4t1U=u{%Ej3&RZ;-PY3KgnD*qYEKwUz)A*!<`-R-% z56Q^{2NUbvaG0-zWFybEw{(1(K%xhS!=lZ{->MWcm~ovW zZWnbCk_$FVb_|+56J|1Y$URyDFP&kEZ_7Zd@dnMgtSnkbSnkfyD>5d-%H<(blC90~ zUsz3M;K(dR+}p3Nle?Iu$2Pb!B`+^M$b%!TXT47l!BoY}mRW|DEhPz2^D`ZF@!yb%S|)vZX`*j`&ye zeJ&oKl$Vby8>TqCdo4Y#q++5-{1RjROC!Gih}ePURp9zXqeNfi8-E_UY5itkpoSSRlk0#$o~#!PaOk%)>IL-BK9?*q6a0MB_3dwsqCR&i z(NBEwDOKPu&CQF?93PC%b!(75Cpc6^&@(|(9hb5oUSqhivtcb zYQ@R5z+x>ddTCutWkEb*?`^=DrN%0+LGPUwb)&(!c6zYF_wQo^!)<}xH|J23B=@Nqz;_PlSM%&4eEty%+pbp zgpj?DhJpZ^toC&WjD|r9LdplDXx#H7#=0{fS>+yMyQSNZa1ECNp&xX*noO{hNNxbU zgrm$Dvs#akZi;Ry^U-~89@rD4pm94&(m;qw=muP}t-Id4Ugw{O1UzJXHi6(Ic=bWp z4cR+!7$DowfvG`%ZI_{X`TFokZSOr(J9}!r>aZ3m$HsNL?V@u{+HngUy+I0{HMRXb z8PZb$2EcJn`2!ughH;tCd6F)nOQkyP&vVZEWcK|0-5hd!l!70fI~eWBk?je*J>i zz+j~tUXm2$+8GD{GGQPf$49El8wTGOs$rk}&z6UphJPB%J3U-tr;RI1mJ4U*Wqkrz z&h$~Zl+}-}vqqs7ruqC%zNK|n^+AFaY@Do~z70-i%V8tw)pj44r$L;AmJgK=ZU>jw zIfmQH%EPLT)?N!*k>jW_aQ!r*6Cu}$C%-$0deiA(pc9w3+z=rPq?fFyIp^NiRRv!$awhkK08ZXpxbR{QX7|-A3`{Y&483qrOk&87 zKXT0v>VzKrIM3&}hbxa6gC0E4LPpL}a5^v(KkT2`wzx9c8t~#nU<|$TtL~hxv0QWI z;kpjXHzR>L$nkNDoKl_vEmc%@u*U6%M`L%6Sek?`-Z}FpR46AAzz~CJ+D2~{X1;Q6 zO>5`YQrfvG4O~ROfroqp7xmr;ZW_Kh7@-Ae`anqo^^mN*7M53+A6Hl8WHb-h9}jw_ z2h18S*R3u$I$&ZAPoDsp+9*R3b|YsAjf~Jk&#?HKnBzHjd>5=;o39#q`CdYQp;lyO z^fWwUCs?7HM{$e^)-fagEi5*lz@9a?c6z=A$}j_Ct}?fed{&Z+LqzuKU(H6tE+$n z4_!aTu8ICU8mnv1%C6D8eRmAt0maTub$Gt#ihzotfzR^V%A@M)W4$=Xn)jHsHP32J zbJSCL%r?}?ZscZM#CcVAld=tFGtZnv2V`;{F)(_NoG3oY$;xUSl3l;#Y!6tsb{TFd z)No|PQSKcPg44dKDN&J`nadEE+Cf94=9(LyVeXarb)APja7dMqg(OZs z7`8;SQ24OugJEkg2TYU&V^up$R~|0`P9wMVU};_7&R}ttwE5*(%SWaan{lc8!eStM z>hzl?H@UX`nu9DFDrx~rC;TjqN`Y-eR!}8PGTcgWJMx8G`q1cCE_aT$eL-e?jS~r5 z10IP|^JHyv-3is_mR1Hoj40b?za`INL1{Z8X9zO&Il3ykv+TzF7Un>uWKksUi)9A8 zSTY)s+9`TYaXP$8tfc?IP=$EokRL=4QpN`=gbWg=aJjbpP^~O)Jb1jZx_XN^g#uy9 zFoml~6RK;E9%KR);)UxAipmP}FcM$(>}CNNGg$v^3=nIkjKi%BLX4P#_bxb13B@dY zVZzh}qhXAZgIZ+dJL0G=61UErY*y;atBT_!W}`H@Q4XhyarnZGk%wWSbeue>=fPtP z&BBoo-KsF0(i&I7e7TlfK%3!=k2hT$w@K;5;*vNlPeb)I9u2fx+hIg! z>FA8ZI@NlrRQ~XPhd=2kqzg$n{8Yj))3afB)Im&0F6NXI19#gdDrLaF?>(x)mrAY%YL zIY8uq#fEXju)`F<2|E8QN;t$cMRo*~9bp_uC`EqERP9_<49p4;4*0DAz3TWqf4Z65 zb$G&%-2FI#!)S5m-E8+3FlODe*PFXrn}^$tWehPzMh5zmVpnP}|9(h=g>!Q#b_k;$ zLb}2bY5*(2DXP;P&8pd#n>)LW^`$40318n_4=2cJ@r1hfL4_?1hu{QGc||)d9``;)4hdPhs%vh zSyk|9rBV5TpVk_c1$@F<_I3|dZv=DKYf%6y@-CM&fdpZF6l!R9bMFQH^Lq2ew%Xll zZa#ZE zdUyz63E0d1z3rpTga5^6jKoX7uU~E->}=uVtIb#22L{g3_U`tppP&T2?7ZB@xL25l z(}csZaQ#Fu>mRCgGK)K(Ds$HwTLv5C%N$MD3C6V7Gp5w|BDC6M7L~Ho;3VT@>R?Inxf3P;SPd%>W$z`faGn@oaEBR~d^+n7M)fc!)$_Jv_p((AB8L40__) zq9H21IkDMfC{zPJFP6M|b*6@X@ai|I8C>2&z!JkfybfEVVZdt&N?};ZvQt{ZOMYb3 zreT3*;5QhX`urlsm|A>?|IHuIEzXxK>i8qewBP7lZ;odd7mw$PlDw2U9olHv>p1Lw zcyZ_-a$3@Wk3838iLm%Q%rUfP@qYq=NHj$?>pUI-2Z)$3`dt&*Ej#D=)Akz zM@K-p8^0PMn3Ia1viNz&ZKTPUf6qZh?49)U6q&*F9EXr;HS4PfX@Khq`a@VPO2PVpq|zU2t1b$m%2613z5I)Zvw zXE?;b3IeQ4)J$a6&_R3(H2wyM_6ijk2O|o@c>*lx*8aJQSq`;=yXqX>>eJ9rurm=otwq@w6(wYeCI{;@TYBH ztQfT_l{wR$+v5+CsZ^H5Q8LK+{NyhacqPfqdyrNq_UUBcg96d&6+1`U@de8hQ$F zK1>gs56MN%MtY8PCMoIWwMk(MDt41f% z>pbohS)Pvi$a&gzUWLtU=iC1T7YCAl2!R4lC=QP^@TZBF6Ns z03%od6b8;>2z45~OA6R&igcyKYK(u4gzDHMW3mr#easv!e)835NA$m~JzTc8fqPr(2~GXfzPodbV~A{pYM8x?NN zt6SgO?a1nEuZp@ab7aMxGyrEIJ};fML0zz6&~YsPfyTcU6V4t4M|kTyBE21Qstc z6P*w}aS~3Exl1(Y$)OU|`l2^N40s#+jlOzE30ukpLw)Y;1bnrR@!Sanj?uk^Pt0x8 z`r%uF5|U^bg5ws(MaM78)s^b%NtKgpJtY~uRN)rpTl3Xg54g?kt)KRrdky~GY5;~; z`1z<&nW+drhq>pKGPwb^_6e0jmJoEGMkgm)7Py#@C+Np!Y84 zs@EAxn4rgejCq0!!STF80qC&;!&!EEO*mq=`l{AX9UV;~jbBA`tR%UGPt%U42Gi+z zGwj!kfTx;an$YfhWFc#PSd2wgQkG^P54^fk9=6EbuuElPHPwbf3i^_mJmzxY9kiw z?33B^-js3spsv4}uhn4DbxwoU`x?^lIVPP4VK+wM3viaC#e+NQ@1s~e>d&(D;0l7a@43#9x^PW z)ZtC7){AR{5GjPagFK6pRxn_Ebh4tK0q z)FZ~b9k)hZyh29ihs<@m!3|1LI^h{CvdfUJB{uvzPG-wAHkIR{e@>-4fXW;A>{j@{ zXqpJXxe#r7-x;V$sHcpS1;${990Y#I=J4DWz&|GCqJtiZZT)+pNf%qh6gmKvo z)%V|T?>|S-^uzoZ>P~QdEH(b=Rqgc~l3>s&#j?FXz)+6_dj=gvMMKy$pnoy5x5=;_ zGf9DVGlfE00|X*POE^tvh)Y7GRAa*&$N9q(<&OsmWC*GC2)N*}<4t^PGV#wRR`;1b zHai3iT?adb5BdVMN?&76r4uX-1DqM~j2-gHAR1~pP^(KqJ3O_i2TQ-x1XuWV#eZE+ zrJ6UwFKl~-MMuotz+k{IjjqyNse7uO8#^N~(u(`xxTotJh?2jG1V&FJ!NFQ-Y5j>G%<5g58(N}U>+*&Gs zz#ld935JN|uF+WnU*Th^K-9}i&Alm5B-|afPVJIGbk|3QGRo|zDOwWfek=zqWO7j@ z*F|NETBh_A=%tEL%z&91&D58onr;n@r>?y;VQJ}E(Nj_4sdA_*K|!MJ??3i>1kYPS zSx6WJe~X9)10ijnxb)n?DkQVFXvwsL`b9Kh#$N^n7(SDKg~WwY*GD$DDav4H0 z-QUtQ6ZtQnzdy^g-Fi&vI`BRoJx@b@V~}(qGi-nioOtn>{vf5XNH_b1@Ju?MMF{`LDc963GF(-w|An` zArNPEHi)}qR&Zf;<59Ah48x$UB}7yPy_(5=k0>+aQJiE1s49(ON0Jbgx%m!*$FibE znq$breur-$V5#*&LZ;kBBQiG9&VR-SoMhu(4Okc8n);2j_T&Z33hD9T1K)u4*oPaN z5hQB%@aKco`bt&pq800$8id2qphvt{d_GE8%)wVwRRjdn%CgDxaF~#q4va5~Vxa|6 z2T&tZ-N%oTz1H)O$$UOq{+%=v2{G4y`0FywG|7fNZFyvM@845UhaBpffbeJ0b%V|? z9kg7*0olZm)@`<>PiV?5(^Zdp8`Mhv(gehaPk+C5N4n=cOWVe{|X`gx+f5}jXNN8M4^u@pzKTS9m7qajkSKy$lz`>4fnbrvT@i50ge zA32%FnGxjpr8+l zixx>-0MQ8tY|lgbZ%9HCUPV!_)fu(JM0cxEItC!}Rehff+fiJ<_yND2sh>7~hLQZ= z!zQZHA2xp?5u(X@lPt0iN6L;Gyl1Imhew-7Ii+yDX9^u2J=<#jw7vO^lx^J-!#2ze z=l8xs4+IMB7$n`~s*j%S?mXp+3*hLAGp#1Hkv5;H@7z}5{TyX_x&3ng;D6KbyRbS2 zH!1jT^~7uBj}_IL8DJ_=FuXf^M|qP1M+A3HvI7Id3r4+dSG-TmSol=J*#qKT1#E z=GN~1*5wc>^_PpqbHk+W>}{vN=49NWtzT_zDS6s` zCSP8?;s+iB$gurpd;86i+JE{#`15T0)w7)g>Z)Fu_{=Qq=1WL!9v!^imdEFtyNB}p z6ej9$ck}Qks1#mb?my!J!~Lfn_P4gUod1c-@9s4jRi#lfAgE2SjjIy-cC^30i@(rJ z=**EkRU86ACZvr@h5ZN{rYvM0(psM4&H5=Y2z|}1(MA>xHCL)%#llpSB}9&I!I0pL zZi|oR@aog|~;qyVUR1Xt_1^_V>2$)mj1U)67TI#YDGG z-|$k|B-w+UORfY2E=_(^y|~FbZ;gBCtpFNk69!>x#67&H-13InxgR-_EjgiCd-O=V zH%Oo@yGCuYP{+N9t`AZoM8I3;TR<88hP6RjH&*@OdPLQz67_Ik9Njr zE)u@2r~BVg56+Spdx3P`@D?JW`@0fek?8gB4b|dV923Vw8l#Xn^k$c2w+NmTmlB?| zQ?_hF#U>XPLIH%*3=`==p^ItK#o#%oHor#8xIxguI~#kL>q9L)42O&Afq3^=MdMXC z&xONQ9a;wc30keNPdBpN`aRio8kO<~rwyNwn+McS3Q`kJwp&ytha^=bNCtUgeXzVF zzMy0S!cw{begcrZCAkUkrNXDa^dcl@+jf)z_07ShCI=VgoLg$+&n>ktIJMNWXNct$ zv|7@Sirc(0s9=RFdfJMv<( z2bOyD>6+zBC?7FNjpMSZzQhi4A6FkdhFMuz!e5*g{L_jS_gEUC&|eGbpOl>PsD%RG zYx4~>*P+kQOrtvDWHgt7Z)?q<_K(fl|B=gx28Jb4>XtLjtd*LB+*{L0^d-T z>$kr)030h6qq8|4)J=oqbelOC2EC!$x;gKST&sCQSramQ!X@60g7Y4%P;>!Levk_L zuXU2_XL1ye_1A=j`v|9|^rLyw5Ar+5!>?ycilHkD1FtdfKy+W6XZvWL8ahOS6x1Do zQ7swmC`q$PR5e#lydA;vp7ewKN+qTPlvjiIz6wjJ`$pTb)_aX`q+GeQ}=c zqj}N~W}qELA$PQ$bbqkv8n{;D^=8LsYc5mH0=KzC;Mz4&69qR-_&qx5Hi;C zD&5U{b6=ci`{)jOJ1_&LVdajNPRzs0HoJzXNd@}Nt}JmEp}pc5%Jb2N$F9xmavb?B zQ!<~7+G3WJ@>S+R_#3LDF-vL~8MGl_#aP}DJ@r`Jirp(s+@frgr76zNU^a&4yT!%x z%8A~_#8sHK!Z3u}7-Bf!Hh}tagX9CXq(mO?9Wx7t2^(ASkfz<Wn&ZxCC#iVUM(% zNp>jNKQ(%>on>c~B^`&kRG)wQYt2^-E~#7%sshWCygquvFr6jk_@1jw*B7!~cK}Go z8HYJtP*}g*5`(1}Ah3LD)aP%B%>n`~iyH6#Xnb}!oj*H17qNEuN8H_iGDhd{ZwpS> zix^v?=f($FWwCNBf0fGOdFh1r7lPu#xCu4OBkb)YdQ!2~RUFDvv`i@W!l zuc=)AtM}%`r_K#+La46MRYx*?AW-#wVvFHVIN1DT=6pFV5 z8XD`2LQ-%Zk_lfNv)VI@HjIw6=yGl@zJ8-t>&ptAF$w8G)pCVO<+axcWy3j|y_MFy zQ*TiK_3mD6pFeDJK%W9N3rhObogUTw<_m$N}5<+9YzcXqdBsWR(H z)O`>p8aig+QZ%laKdswtM}l+r;+hzTx_|9hIcB5rXox}uk~4Ct-$xM!^RCrc5ayTS zs*X?S-i9H8^}ww$@&e8+XWRAJk+Ah+(EnzyH@nq;u3 z((hI)Cu9_7JAdRY#~Qp*6`19%)Pv$B0g&WEU~L2yw7XGnETF_fa^!9fFcGwl1tKK{ zjy{X{Ey4g*HNHPDnnyZpG3>Deshf_MReBW69hO_ItrKYsFmBq_r&E&w7Y=m?{97;$ zkQ@{;_jXr3XvJMU_U=ua>4H<`6deHO(#~WKQpKmlqPF5Tx$Eat@a_i08n=R)Xfwt_?&kax z>1o{bLm~bwd3*YLXZM*?jUB@?edjAKGCAj4`f2>Me|RKgOE*jS?lsqkL&Mg>Y zaU}%~!*jAtdEehQpds&62GCphjI5k=jhH>Tq}D}flQB2fIR$`|&}IBqyXBk~yOr4X zUf0ZRnzL-)m=-e)z_YR?n^?+Tx!GcGglyg9lrkumzQ8~hD|J%lW0xLFnl)~|VODKy z!wmz&KNGXHqVVTq8D$DDG-pne_7<1eS_eR5FmGTu&-PKCE(Y^?;N+_GGW1|34ov%O zALZ#H$%UC*pzfrP)A}*!HI&WawNAqOPNR*y?II>`K z&qj`l%13Wo^IyF;_r)IL_=9~kPx>Jx8+NLa{yN*?e5y6+52<(m)jeGDCpX=BwvT2Y zohoyO(@D=CPFC~zXg6i&**=;l{g4?PE^9`H_xE`hu=nP^IM4Rc=^>Xc=pHBL^-WZq zJ{lg%KANXgHzc3*LO8E^2Za0LJe$T!uH3dtT0v8_BG*TcdG}wvH}}Qj4}Y+a<|*4# zU4`wfJ~7OvT9N*cdiP&lZ01jHy7TM~ny#p5;BfA!wn z7ZG1!gs|nuYGHkK34cX==DmwNYKvmo4b=h;4*Cp$@A%k$^S z%aS)$qD}bG@bC7~Jn0Ad<)0MxN@2lVISR}>aNQT@**=;l{a`vO0CIaMX?b1ioiVRq zf5(dJkRdzky8^qjJ}_DiJR=_>Xt{6hi}Q?ONtJy!Ps9{tKjTAB8f(?JjOrcfCd)tYQ?sh4lyPI+`BF@beCpJQb6^Wk0zHZa=5|jftaf9uPV7xk0 zNtvE_>4hnpsy=#*G3VAFuT=H5Sx$*mulZ}*6Jz{$1Xi`{F#i zAN@SuoBQHCr=XY=JLvuuLjKtMd2**9(xc@(r066iX)KED5O|NaVfZ<} zIhc~$h=Dm)rXS6devsdE69?|8QKabe4n+6GdA5({$#!H=eEO5L+|F2ICjwaT>bhZo2bqAI*~;R$F)e(AxC8;T20O z1e$&{Px?WA`6nell)`BNqGvoN!zXh4d8bnM#d)@m=1D)8{tJNIzPq*O_Wlxqi6sfa z%|6>l^CSqOEl@lS41KvSc~j5!(L8B|5?>XJec|euak=s7N_leaTUU<{Kc^(g+D2)^ z4iw!L@X+(4GyQyjGG3LB3Kc8zSr|o%d<5W+P~(%P+?5)ifU^p2@?nA+Us~5rO5Lrl zo!b@)aQUpLx#24`u2Wia`lm)+<)RGR#IMtch+>O|aaoeKod;6+-k}$h z9IBz&T=v`x@8gWfYva&?f`p@wbFofG3R+@>9PH$LCs}lx2cGaPwR@AauQOgeyEJnHLgvKZ!mLS|4 zn6iYf-Fj_|IuP~xqal7+nQ3SPP>blYz{kWd$^}12&rz*u50dqc3?4>On*evLCnHGdt z(01bUdo}A;k;UKWnePTiNKdOcowIH~YUGW{rl31IO-4~5FmYxvdjVC?!<0Ol4fa5IBU88|czR4sYqm;aUGs zIPLlS9)2nnWslhy4W(ehOyB@F zN~iUkLKj=uhgwaVv!Rl0P1vsxPCQ^+qEP{-kC~ZnI1E}kgmc1vJIt&$u}lL<63-93ea3Wti4(759Rc!- z+#;C_!^og;{6Ucl_b_6EJ@tkDnZWfBeJokMEdy%i;u$qW?`*WMo;kW89cb zQPNC_EQY&T=6{Bzon|j!S?=u~s@^C{f?kV6M)%b|S^0!yl9tfA+Ct(QbkGKfQaGF^ zq;=7YE-v)bkV=et7~ztfoT4`*gr*%GQIJiHgedzldBma}UWN7Zy4u~`d(qfZvyhKm zh8}M1&()bjxJLT0yVZQTeR#O}V*8L>@xVrv=r9`?pqE^#(zP`@l7a%b-eFuuY(;Vc z&8vJz9gcgoEd;kkp4%h~c|>NPy~z0So?myj>JQjLi8_Okacz7XZu%2@?7$CCgokzk zY&AD`cTI#G2LL4?2n~QfJjnr|#~>eyPW3_QuX*rj5KOPq@Fq_X)-+2PRdEs)B4*|O&M7UX)W>~iH2d2I}A=b&bR@nOw6 zPIfXmjmSjxPJ8wxH{)Z^N;_wCT)GN+Lmnzwrux)GhnA|uM-=G^yIDq{P&(jBEu#vH zryUNN=FqHr>1Z|=vWGM6lGo4~C-7FPn;c}?8J=;S2ENzvs7)kEpDOAXD!`aviP}HZ z@kTi;FEGvLLyQ&NjfNr`A^(?n1`e-VA-WE(;b~=XmUCLEUl2dC^G3D$ee@0v>mN`Q z%Xa%iHi;pZQ)FdL%moH_HEb&yTw@5-00RMHd+NgH{@_-Djs?-bx7H2=j57y07j-c7 zxS!KWt|3O|ofWWH=9ECAw@K}%or1j->u|4HVqFEa?ogN(PH{IF97;U}%t>Qt!JhUu zE&pt@9} zyyP$?c$@DY#p3gid=UG~;@e*r-{F7r<-h!eZ!%2KbyKz^A=kO6Mh*?QE{8r-(QI3S z2cskWloRuh99oiOC2z=4{su;Cm_;$k;=ALy#l?BkqQ&`gMIC=+2G`BJxOhB=If_$@ z3SyXColsXSHK{=D_&wcD8ZR#GhO%D#)oJeW;<3|UcrGt~PzkhPdGU$*T_lUZol_yq z%nh&4Ps}y}&|DFSWD!#8_>J%B990>apnHyF?>h_;B>1^l_E&}L6i}el`Ictw;ac^< z^151h^yp#r;nE6S(;%I^9ay{P=d6c}^kI^e5mz8Bd&f%G={1|@=86@y6yvjMkhPr$ z7x^0ePXD?=!yyPdK--%k$kQm?&?}{X|KxxBh z7~@4iOJZqDa?CzmJu0OASMD5bJF+@wyJSM2FXMFzH%gL|4fM5Wh1Aq^3NS?OcM;Bx zkBjaN?Q9Bb<_e~Bn!67>zkV-*w5N!?4rMcarM_uInx;p%)(E>;h=9#thkyvk>EshR z)Ehh)$YRq4yt@PLKqn^O(xfgZJB{+oaPE2ptOrp{uW_$w791C>%>Y zeqt6Z&?&eudN?ulRXE-mjyr~yn&$c^wM6w?cncH{%s{^B+^m=B0$=4c9Zs{EAph=4 z;^`oho0X1vsWSoM_~mVY=HxDbi`gs}Cot^?znxA-0q34mY`s$f%;wF9iJ9D^kAQSP z`K|Oa3rzp)WNV)qa9;i**qCu^OTcYy`K^NlDYv!dLe4E<)BG~@k(?3hLiCcVi8JVu z^yWbw2f)vhg@K9Ux?Ld1o8JbVMF7aFTf+n(sa!d5sF~tCUUx=bQ{$mC>E6h@*WXEi z()sdWNd^le(+;Ot3Tj>Bd1oKjpyGi#H3rOz|S5inREp%nJceo6QzHVluMCrmhA( zqr)S3j%jhsG7d}dz2g?(6@6K*u2fg&U@Jc#gniX=uHNm+!MmhjKpvic26P$(>hR}- zH7?P?5XP#8vX|f{QRf%IKcc_2f~a2~jE3iU9~8Dnb>XtO5w)I@W~AGI>_oCy>n&dQ z7Il-Zd%10*Gj*>)7}0<+s*pgYQJJauXBNs;W6WuA9?gmAOfI0~Rz+vR1uP!)%1i3) z{woam@ec2j-~POL(D-?C_w_cuqTbL^to_IXb&3XYk0hWrRKYBY%d2W@t137R<>sm) z5+Qj;SK*Fn0K@6~Fbo0FJMk5VS$2Hz(UOU6R5n-&XQPhmvmctIqq(un$40#1hzVL2 z<9hp}<@fXULE{7$w*+%J(bvITKDg)Py#v!f3bwRVsWFV5$%l z)-ZAF&N;+mBoc&_lLQO9!W*vo-*`llA0cDFpcyABPY0x^!!EYvCd9&zPm`@Pvk-W%5);wR2&foNIA3b=!+ehbbY7dYe zxO@+g>Q;^(VFV6&jZ;WQO+-?T9VfbUG=3Qu^87gxw_nqDy?9uoOJr#Y9saP%0FJ#p z5>SDa_VHNI6syYTI(=ksj|Ktg;&&mf>S_*K*1GW%Ikh8ZLfu>_t*nScZl-S|F z`a7HwWvcm;LzHx6*PAd^7FTe~FH4`MD2ws`YJ%tj0e93c#tB2L!1UDinTDjtQDSBz zv3{>uI{dl7g zwRuy~ea95gCC+=J8cdc$(~<-zGO;XMRu5!^N)RvhUaL;qjD9b6;Phdty}uz|o>TBW zHamE=v$cr33;fE4XE6dZodWAdWQ}D`XPps-Zid;&J?7HXY;D=@w@ zCpf1;&_WUXL(z&(tFqErZTEXL)q<_-2b3wGZVl;>dOn>4eX`Jh&`YD5ZdC^iBx;uy z%V4_}w-y#?YvMC)oNB|)_nL^L+mWtV$7ZHDcLl9*VM$AzF?3sjlku84+{BB8=pYm+ z#9hP@o|(E(IcjIS@;TN4p$OCqtXNM+EjxbX$5-zsD7*4o(=7RHJ+ z%}LvnYjU){K`7B2Dcm4xylBBGYW3=qJRjM$Rz*MV)6G=>s!fWWa^=Sgyowbq1z4yp63% zYoKQVE~fI~Xqi!4Fbd{w!BpS8g+w<6?w3#XR8MnqWcuubOjSQ|2&QR}J0N3gTPy@{ z`;l^xl^@eXV-hkW;uO8rSmajecD?}cV!FiV;YDhB7WUdE=HkNV_I_*=(kL))B+@0l z(NLmYY&Kbbzpu8CQKsDv&%$01ohK|!yowU^>SMysCc_)HQsZ3dedEkQkwu#eiu$_; z?gjd}OreYm3uZ45^j0&W*3YW(vumqkwA7Dm12r~Z)Em>Vz_GWHmSi{90{!=1to&;t z_XZ?N91g~@*40jX05{l#miRnUCSwIE7C#io9$3*DJvk9qW)kHN#&$F#!P<)ZHv>A7 z&Th@Am8GRs^?VS9>M%YVULnu&JRSiXjBT%~ogUgX&_%i(9nlFx!$~ZdNI|Nz5Z1kg zbC^;zup#w$lq`h?7zO%<<_hJ)yIBxZah=e(iF)rJ9Arr$V%V&CalcP?O$ zfB5SI=Vs(fj64^<+{hDVac4+M;yPd!)Wb+*G}!TK)N|p5hu%$Xt-ex!@EDlNo!+HZ zIrr=iuryJcGT!5s|K{8iEqves!NE9uy|?*t8<>^*fZ+0{?%$^muYmVLoUQ8*eh#)& zA)W4qI+-;uaAX+KL#>z6<0IyB`FCI|B}11=>X)?EA1|#@?|m=6>e)gAx6ok9LWx@_ znX=HOTj+99p?eD?sKyxZQlwAiGhZhGax=4xm%zAReGvGU+a4@}mka*c+(5&mEF|-n z(=y!^0$O|T0!$_4!7Ts?=zJMoFT%c-+$1E#Hvlt9lg19QkU(U+tdqv{xM(u;O-jxf zN>UNfF=H4fo$xa3xByd0Q;s1cMucQO%xR%cDrjN`AQ1|o3#^$GjINt>?5+8N27PSO zO8xb^^9cXXXd0jCJ#SHDsI}xGrQD+H(!7!WE(My&1s_!;p94tMTB3zaa#dD{DXzMH zS5?<@tHzB8HA;iau(|X6uu+D8o+x^HwR!YY^Kkps=E3IC{()G1CuUGFS=;SXeg_PG zb7TSu^ABixLyvs$XO0BHY$%;a>}YFgnS%6XDnA{bxq~zA`pTMzVhX${@ZDk9ttQ9iLb;EQ`E20UTdn| zuqj}olo6bmr(LAWlkj#lK!Y_(tV+!R+k663*wd_-#RIBtt*(y5O%Sx6uX_Y?s$mbN zXxMNJC^k=3dbmkJNZh7S`?d3{kaZ=JQNQ0I$iy_NvNZ|@2&A5ZRl%Z)duXYH9={-o z&$yTu_$<*Z$0yxxSfgl$1E1#cKVYixSAUXM{fYe-jCE>uXTF%IDn9OiLS7s9kqp~S zqxaI-s)~^&-rU-S%O*@JuHzI0 z4eR&e=2Ix`BnI=s>B|rS8mPqHftO0CFG&zZ1+bQG!h^>THdHYH#SUN`mfN!BTj;R} ziFlG_%sCgd)Aj6x&w^OKJ+DTlIpgEQMKh&L8g1bY$df5%hnDDxoeP9A<$O?4>)PrG z-7=8_2Ti*GBMY5@SsxniAV|kJ4bjxWSBsoPe5dIh;+`{>Co(nxuYgROb%dppu2cH9E#R7?w&jGMX06e`{Dz9<40Q-e9+z$WOm)9Nq z&jCRz0Nr_cp2+ykAhVk|B|4}4dHcZ$8EyO=V-UwQZ+et*VV{`ZIcQ@XsNVu{1d5M3 zw*$1|0~qL6Wd81|2e}78t8O@WAa68mU9~YQ{efvc-dtM7(vjZAld#VZ z$R0G`!}vFQX#R5+kceL771%^Pm@caoeX@2vv!Qfd1n=geYH)5mWaYRvBiF;^hb-4G z8PEZ(HDO$7eO?qID*ExZafsw>E4!gKwh2$m#COdBE=P z&KYS<*h!~s8a3y$C`X@6s1v7bCaQ=2m=l?R9d^%&Z$hidke=a^9uoY^o4yiYvYA1^ zX_Z=VGZy9OQNGpWvNtt*IJum~VyV51o6?J4nW<40uK+7xTnFeZoOgsyD9#l6R{4k3 zT7a0r3e{iIONXxj`CpXl0SU(wd3N|del&j5vZ>-h?K|?HhFL%4Ej;6tEt^KZ5ysTN zJhuMjY3g4dQ$HQ`NI&Nn@^pkI!Glqs9Gnd3G+1d@6?yX=^`RYI0Ar%Zvy2Px^U!n{ zf!JF@*3c3^YPf5Y-#)#q!sd7-=5e%JCSoEyAShQPKjfUS_rcohCfFQuKQ%h<+|ZV3 zE{C-vP~6rOp-;oed)3;;JlGq7(N? z3%!L^sKMwG85+Qzk#U5Ys1Q8@2K7hQv^zu@7K~)<42QP3wzt;gyo@!M$u=5Yt7I%c_X9!JEn?Acjs4J%$(uTRW@X47zH7&LnblGQn%E|aL4q<$M zyP`FVLYQD6Mw)G-4Kl&Ess_y475VzdQ5Kh{^jy*)dlWPUs9Scuq%BLhJw&@wDxVX^ zDm6|7A%BcA4`;qfLca=l)ZjCU$H4&r&u^IW9E;o_}o zNqdLCueRCZMC?Ha3Hbw}y}5MWYL&>FVnlLzb_n4bJF!|g?n3o@HC*uRQMY@epxhJe zI09;vR|XpRR)x0Q%E_@f zVNH7nk%rC^ZEVk_nkDW6JjC4Ea$tCMH7F4%@vgZ0q`MGLNuNAESipG235){%sF_bC z8c4eCjLwkHg6}21H!W?Hq&gaPNW&{m_AupNOY1E9{#p5Vp61T9C3mKNlnr}RtOwkW zYmw?NB8^Vs+h2bnCyuAhTdZKcRBhoRY5$nDOQ*8MU(1VtGmfj$oYkddb=8E;G!x^@ zhAbldk0#n1h>~-+oIw#^yn_hhBbS$sA)+{0bKs6c!05b(4y1v5Tq+Eb0c;rZD4bV0 z#VomX+=$`zLD^x7C>P&g!2`vS;E)j#D}rk+^w`Qz5rbg*Sh4k07^EPTb zi!9Xgs#<>VMD`-);!GY6DZ|geh2(lOt2l$84-gi>lIKY1AL+RpOEEu_V15;P`S=^X zETETE7aL%PZM2p9Gmz1=-O!?)F4)aU6>8KvU2L^dp^S2RgtnKp8Dpm;8Fg5o%!p?Q zwi88Y9Px7nL|y~ZUP!!EnktD$w`2xHbW9qQ;*>a$sLeuIqza0Xy0}NWqgYpAS-eGdUpT%jbhU zJUZCfd*MLj51$Y4>FXB<+pqQyjvScgTMDct`s7xXke{9PQcR5w`MMiwnFYIYJwt54 zn;pDxsS6r>kw4%Cf9ucs174WMA26{nci<1$T2_1=x4g>nllzDBvQv5HU6{f%FAY%2 zA#Qnh2QMu*)MQ`1%-s5X@KmMNpNP;#U+pe_REw2#BQ@`w=MH#*ayUGgsh`img1wpUW~oSTOx2-7tEiX1yP4|e>q--)t8(ljXFFQGS@~b#I4~7cZxY$ zE5N|9^OAPVLiB)xv^WD=(4xsCD(g~q9BInUZAcQ|sMKD!Le53YM&aa*8GO^LUqW61!JAclj0b**8d zLE2jr@;CB6><`VE0722EiKuc=O&Cyx?&DHQ7$QMF@$XgSl2_k2;HDC=m*nHww;brb zxm0_MN<-usxjv8DOa01;-Ym7$IqtM6!?CP31VQ(YQ12&9aWeyNZ8ML}iC|HnUCM_` zy)UIf+X6+o&HcYLyIQubGMJ0s&6P|M(unRXyBLI8Dr8ki(UxNQDt)M!Q|KVPr0E`v zdbyZ&2QXLkx@3x)!i)`b8B|4V_`E)n0zVDcm-K1^l&SkMm%T-E*k(IoI_Q)|6+<#- zrtd$V%v%>h?;L#xN9Zgv-S~|u$6!iGG!BIgq&>PDN*KEhrMwR3v}00%N!4j%5h?DD zW`1?!3vhLL6Ku6X+<2q7S-wK`r5ws>Z_!!2>+O~$XPtX7@lv``(l&c_d`FsF`u@$) z;4;H7g%+2%KyU!LjV;jiD*2Z59J#XO?9VA>9<*9Pw=&FijQUAkDfIpX9F3?)guR3u ztp_cb)}VD$ced|LRa1oARHoI2xAP7q$W9iUE%ah+2<(gGe6!UO(H{_$W9DHqmI@++ z7bE=?&RKkzKn{4-YGo16IT@aAP}nz!yO9XkM5(rzCVVD1A&?&?wHA$R#7Qq&^wZ5q z1=VpD$(Qk<>oPEufNuK+LpoiIYxfre)+Byx)aWAHpR0>d{QP=O>Sh6Ltm}L6?KVfD zXOd}7hYue)r^C;wL)71KIox?*0V($%9avz&>k16?biJS&7HlW5pwoWS{Lg5;0j&|B zdEOi8#`|9pTS;h{h4uaSN*m&lwEN+s#}4Ab+4R14%U7}j&l2YE22pQz?!zD)jt0Hi zr8!tNH3WsHSzJ1}0}viNX#98$cnzYzI3CBPIhunfl3RbL)4&6?Av8gulH57Zl}fbe z6#qWqYanr~$CiZ^w(UcW{OA%LIEt{RN~hWZ>*`SqU-reFjyY-~IB=|ZYz~tK&z3%A zMxI6`xp4D>Gi35e+uZ;Sne7G-@s9UhU|xmCtFbOY9x@h<6}Aa0qxP z(%zc~Q|y0_R+c_{|I4e9m%_ODp#r)&x0>*x@evZklm%V)Y)#ei2RR+j0d*@O@p-Ft zCsN|np3;Kdgm!@Y5pEQ!*@U)jHJg|fFT^1s?6spacb~w)AKbXBb=v_b8Z0?m$)i=X zl|cEtodiCcjRg0Sk18Z>Tns^+YayPZjW9?|hMfpGZki^U4l|gCOQ;WKOxN-jI{LIv zDGa>W+VZQ$54t9-0$@laHWa2iq1sB6PI70H&JU0xUnbzGnF&6`BtX@tLDUDUIf$AE z>sFWwtLywuP?f>c5%LVUmQNKAaealS6N`-JxcN8;P72)lw;|ZnLWH42Z)s>oGyjMdTYNY8{7%e}cD{oicJ>fyoU)1#z z0(Us-?H{VO`f`1_02~&Ovh(_<)qf%h^YeWMw70!QQP%29^_6k0ONN6{YpD7$Htz%e zb6r(8Pd+`lC+`21mxF8kM>s&&Vjq^OOP{zpRMUC03p~YgeQ5>iT=MH81l$?g$gv&h zGWw!OMyGtojJoO!{LMVqrIo9K9>@QQNcSfgbO{)S)9S%us9~&gwt@xPiE3K#t&c(p z;k5$>izd8IRvJk&0cswXZ;2xomT)Xv=yC3^=W0RCo~s|#IjqtR1t&G?>`$*=zfljN zkKT}mNmwVi3ky6U2x1n&&!ZJ9&r!>KOwHk(!t@UcabRm-t=3mA*9xXgNt=gH%(DPN zmUju7%M}33C1|x*8+>|#{1!kOE-YYnc>Sa+j=LdwsJVb+0PCwAV)T+xzYhc3?%dQi z_YQX~+ejCp5{|-aAED9PcZeb@52|YU;U{h?wE+|7(FHUN@b%lJca*fS0AJjuK)r`s zfK1A-(j5*}t5I-bvi(9oLZ|ViOo38*)j4%W{o#Nr!w1!u&STwur{?jPj8O^!N8}>A z^uCU2yF^7+>MIX7)bfL+_1e@oz{N%4f^rGY5(ipql29{wbd2%GltuoJqRz=<2iMi!X=GK zrWT%&WyS}fZBG=-Clr|}PLfYNUR%;krOZ_xV<|}vbEzqMS_{xJ0kRwT{K1`_=qJ}( z#CnWjJfvvB8C6nKr&HF9bCoK;|NfXaDN&5$QalsNY~Rzf#u!>-|JBi9qXMh}^kvi= z#2t*P62s(f`ATwu(eFRYezH`kLP{#;#!h@emK-nPc|IXaZV_|}Ii>*mck?}pjLD6>^)zlGi;0RK z2+5}`skCwA#m_nwjq!`Pgl00`-rae+w|&%nzIk}md;=i1e%jvpyIN*KzA%LozlE|l zA-SIV$VdD1IG*RHZz9s>7n+QPDX3OSYl6!uE>_;&`f0zpH_pcuolGekN%Pj-P&yxY zQ=~FEQ@x-Mle!jrob&)X;cPTC&l48EXovDbgZ!K&v0KZ6I4P$V>B&@prk!kd0?4B_ z&I{l~1ehMsWTbF<<@KK&bY;4HGA({jge08exZd6d#x&SZp7e7Y%>k7+yej;beIP76 z`jpNAD9K~zCdfC}mzk4#E01Oic^=I^1K5fK%=$I^3_#@FY+(vwQs4o!fR?0lPeDqs z$emG=w0F@WI^w!)bIFKXK7*%vm5DFTT(ovPZ+_Vtb6og+?h?xdai=Scop6p>U^>G( zJHT%^pZQC6aoyTI=|YZs(%XYtv7pim>(;JHr&(7;o<)mRRyO|>Yl{or+3L!3dFrh& z)*emeB(vFTf1UY|(&(xen(<+pi{75c(l1+VE~w95ZUsQ@birw-rDK+y%>wf$Bj_dR zui2&d87^KIa$UTB4!9K;TzUz9hPzjm>5x&u7kWisDE5l(L_Eqk{am;Mr=N5@&pQ2F znC$dZkp!mOYzF;E2U=>Bmg|p7_u$m{JR%eD^Efu=W(|?OjrG}hGoW~gwu}T3CMYc&YkuY5k%4+uyJZ-{z17KH5)8!!c#&VCRimOwdEE^A%;!i|#ix zfbK@;0Ycf*Uv*d`c?FIhZdg>)3} zZG`C#g!4f>>f_Z+aCSy!=lh3?E0sj=D=AQ@f*%;Kbe$W=Vm}GHL2nqfusQW~6U2rQ z$z?B$M+tiIx6!0XBbM%>>W(C=KIZB)P)`q^DF{8M6_0xCRJb3;fVy~-snFRNkXX{2Qb{LBE?A`;i$h~V@~T*O?R&NC z)mry1eyrpF7e5mHng2*jkf@G4%V+nKUE}frm+btU_}(U~9AhE8fB1Zv^uY1Xa{t+p zTCFd!b=#1lF2`3r*|*Ld5vMKxjQlH;zYar|c%=bkF`|ivmeM6d*n*H`4}j!ZFtA3& zT;0Id{)%BQz(G6Ln?}-#qn-^tZ|A`^GfJ7ZA`mAG^S>q*(U;rr^vKg0wf6q3M| z8>CZnCWJ9_7N3oA3wMEU3t4PixGk>vz5r2kl&&M8ScRQSS!Gg82z$h5aM2kub4lDR zeS^#K=7XTa79$#52+h?cE{i}Xwlzd*B7o^R?ch*d(d5Z_c zbdC~cCw_V*)zxZkjgNJKvOyi-t!Bniad);b6JXj-2?b4?F*jrAn|(~-;vVu1n*(T- znuE8aGx!hxX=8o-)0+ZEVkk1?#~snS?BpjK)0n^E0f6hc?FP8bH>o#$>t27O?3Uh__`391r)Yyg1Ers&Xp86si+MMy+Siay=UsNqvO^Z%#M2; zImHkX93}X}WiY4#7y7AAN3fx*=*0d_$kj6!QDLvmN!lP)k-OGtI1);e;dYy^4)$Lh zY`&zuJM|6qwB^&MiiySHl|I}$*m-s273NP)Sq%9j`7Omj_*Nm;QsK}tWdcvfhCU;WRB zm|8k@-djjI7^`PlsvwLT2Hn1^cFitRDD>wEt{26dAdpkuNMjpo2Pp9AsaPm!PXm;z zk{|>f{RVYSUy=_**z0P$+Djt0$%()iStmTOFQd!^N?gHd&-% zZ`28#JZif`qw!G$R zzsh8$(=9C%j0n5C!4N60geJWb2Rwlm@OBWJ zNG}QHfEPi(?~Yh>R<&nII3QM)8)XbJjJ!kPnUs!>P$9az3@ijwjgq?-?K9L_Z@L9^ z&Jm2Y5V%cY8*&{|%nB|4Y!TH)<&0C-5RKa5fP7Ej(l^sP@tTPz9%~5(B#XuSAY5Zc zISB_cv`Y2dr+W+BBUpGh7(~PA(75}kuT$IPiz`7}dJqI#!F7^F-#K8f^t!pP_GO`L z*bBzVLyBHUtr(ddX(cM|w28U_qM?t4L3BFO$;o&37Fh3%dZ%X?1^eR$^RDZePOWe} zJ5PII9w#pe>-zpRb=5?x9j}g3mqz|oQ=^nrf32p9R-Y7IOd+{_&Hj7i5%Te6<25!q z@5Si;1ib~PTg10r)3@ljTuqf7-=t^U7>pHnjAyfQU3dfz3_~i|(6u4OzY@6~-R(U! z@+VSrJfUm0N>vBkiO5^<2%VEAEcX-V_~ft79t zwFdD?%g+xxM*pf!nhZ3J*T@;~93JlMy)Y7kYYCGi-_ftw2cqE^A<}?egtH@_t_|7{ zvk2|ct)wEfXEPgF7I>;wLk&p`f#vMF09XJvA+?dtU2;?w{G8+5)|l`|$0t&x;@oTw z;~1Ae;*{=79{KnjAVeFOghKzj?{VmBedvo^h^l%F(#)fY`x*WV&Wd(;Ar zlX}H)c^n5ZQRP{xs@b2zi8u{elqOe|3_=${X<@G&(!IEQ28ua)3x{^^MDIf`rd-(N zS*j!*zVETy=O76JY2i9YaDY@rH{KyD=!Hn8u;18EFk7|MGu zvE3b#GEmeijyH)y42~2Ti`O0Eplie&*Qv!)N2B6QjH*{Gios6SQ+wg{@NkI1l>nRf zp+Ypj=FEhC=Z*YCmvzrnYM zm~!FIcX7cT`w(7UdbD;YPJ|CO_jY%le$oB)6xaEF+s0kr>zq^Q-ckEEfBE|zT#-?HlwK*+2{CMUicT?Z-3T}D2>zj zD^VP=yerX#)Zj6?n2}@mi@8gYof3|%!#Zv^7jmw#n!fSU7bot-`IDJ;ah+LA{+)|n zModYtOJ%={j-gz3@l3d)p{102JtHaWlUz4XtOIlA)xh7^^_G_z4@4$o6zF%)CJEMO z3&WW}&%ob^eb3oegTcMpSJ*FWf5`5(y!`l1cDK!guer00yX%?7Pjl1BvWv@ScfrrN zHmYvmy-~G^7e`f80ZtFzvA3h1dlbP! zVxu*d(U(?m+dyW@gfF{&EHoRZEiXQs#Hm3S8Hp8E^}?{t0qZumcK5e7cY!F#Qw`7h zo|O4hfY&}jr$z~`>CLCoCvN8E>!W?V@I)~3mPM%3Dy6!z4>hW zKtSO{l(VjM z;7L=KFO=kx7-0Aj}s^JaYA4w`y{+jY8kEIm3P2DJ2YU8cD`~q3wO%6s);fcUB ztbEN+r$M<~^KIyX#ep&W z^4Fma=%&0;wms3n^TNNUI4&Jz^y^9r?~2d(Q&F97Y{s9Cy5zDM-?)r_HJ9<3%l}Wc z+Q0D_|29;>4%#;s<6p>PWN3-k)&F>c@n>calvdMia(tt(jf!XgRrJCMY&dTDH&n^^ zRs*c`T?1rC5%nE)B04XKdLvP^(Z>JjiTlGyRNAkXX|xygh*st=q0}3w)A&3_7h=W- zQq>p&>-ZZzQk)=l2-b=9^|M_z2+}U1v!RRG<@>0ru;dObHK0X-=>o?asR?Lid;vh? zM(DpaG|uWojiZW`1Kk3UI|(Ehr$G`T<)G$ESqy)NdKjlto2gzrV^AP(?9A2{Dq;La zzB4W?tS839)fsAGkr_FDm)4lBW*2LEIzKEgR8-|t`EMmx1M5GLpZtuYX3DCd)xnS2 zW^tlzfdljQrUnZ>D(ArZw&8r^L?@g_3y|>JnRIH_Q~3?`ESI>WChheCWPsFC86Q5TI8_@%XYKOxh>Lg>MC*FBQ)5JQtuU-w}OI*RE1%s;M zgDxwX1g97(0T;GzNxgs$TIXgyopbsin(xy8!0JpiPS`tJ*?xN>ByHv7-hvmAH#0?E zOx}UxspWfXasd?{mr8Sb8D--278m14zCsn*My65zu^6F`%Rd5bE}P6HTPKdXO_-y> zzg^cZZ`r4G{y$Y`e!gXA()qt~XT*FZqYPwiSQh7dAIb2QpanL65!=}fZW+Yc(J zQ`D3?Y)a}BpUHpJ(cs2}TR1s;??#9H4k`WF}=HsRS zl4bD%R#0n731fsU-%B>E5)R(HMv}L`s(15?i(-;J&2n>V$zNb@j<33;T#*$8JHlOs zhpNi{o@hw5w5W^0p3sd|=SF*uOkm(~eFO+#OHql`3EoMmac- zF#%Ak-2#M5)ND|npHp!U{iJH==VWF?{?F^Y5k5tK<8bmDk;56fIr+#-bN2 z#GbkiyT(}EK+v@G$WNCI-xEDvU$X0@Zd@a=t3-g<#KndSmzS?0I{XO%>QC@GZ`0?w zI?auHexTT+>BoTZ=3$@w@*3!@PA*@!|AE~ zoYQa2|DOJazAI-qY=+8eYht1VVU9$k$Y!K6qNe2A;Pf5!ol6)oDi+a8*;2ErIvov# zyfiB0*{n-36QO7;9H8S{z$~&m!%B!D)iuq-Kw>4{WS)fA{ee4_8>;g5*ZRBp_bpI#GB@LR=_{&cs}JM2vQ$QxslQsUWsD8j808a-Pbja1@%G zkmwB3D+xLDgEjUHeW3-to6{J5k^unRVX$8s?2o`D1@9v?Wt+)qL8jN#XXld}3?cVe zATj#P3H>TaHiV|=D07P+)nX-A?-v*FL`L4B))Mkpb}l>7$rm&6cUnoBfq(c=bMOxz z`lic)R&LhEK0Pgy&vT4`MaMavy3RC`J*&EB0-Uh+2>tgtJ#>P7qYu3^q}Wx({))*m z(*=OK__WoIZzkq$J7b^ zE`cd%VmC#BAH(?&+d~85L4f8|xl4+JWY}ow0qi&!@@;BsQtyt4m<1GU4sIHi`l6mw zGA^Hni-2a!q5OIIDog$9f$vX3$k@{eiZ?pVvGb^1x0E?9|#yb6_!Ik8~~p?8`Z-) zI^@QXw0MZ|z|ZNBy~KV}D251~r`%U3gKi~zKJm^Y<|JZIAzDKJr#XKpkF!^w!Pl!i z9-h9Zd1y6(gPwM$!X=5G#&eg8mn$Nt?QMk!e^(pRSFU|p_ddR(u3PiTCi9rP4>!wt zwoWSm`~Ms%Yigcj=kfHnsrMgQ z0%N7&f6y+JqS7a`&c=}H-V^1f&Cj_`u1+-h{#wM@A;+2)GkWIIVj#hFj!R!TG1`BB zE-6JJ&2$%OnrMDKN_{7_ejbIcm)-fyA)=EH6dr`JblYYD`n3P_e;n$}Nkp9mwaT2~ zwhX+DYl+@Nt-#?{oO}_GDd@IusQ%wYzwbw9J;eD$U`1!Q zCG};47I#kOEo(ej&LjBb2DWyoD!;1v1&8E7cI6fxP-pyR3rIZ+I;U>W9qc6%gV+k6 zd{d?76_K9iStmFz&CJXoH%~dfQ?fEVK~wD|e$laeN;WId&KFx-jT58Z?`B}_e$+`KaPWLW z9l*>@c3ILWf8Ylq-jqt(aXOWM?=8rCsdhenj7{{H!um&vs!b_f^2(~>>{eRzf$t=+q^A?FL=^A<`dx-0iAqfuV4I-`WVIO zZ#T)}@TMOoIp2|Z&}XRcC8~spJM*&`11Hik7~01UrjudZ345$UcCdA*9@HOJ5_FwU zKJM#@ZelVVj9No=I>LPw_GxvEgz4VG^PSyoHLqsp2dyOThrKy9>tvlrEj4<>0JlI$ zzc%436rFp5;DTY)0(1-pYCcr6eMp&;vn79=?~8njYKxu_KVTSv{@dss^8y|u^dnCX z(4g}<{UX&?4dki<6rB@@{4t^0E`w$#f&shKZyZx`_OjZaqfZH-={YqQ5@Dt=31QFa z0yw|3mvb)Dl5j(5I`$8rtF`))+5*-h_+7PH6j7amj^o7!OjOW86{#Anq*D{ql_M%% zaNI<7HtMysKf_^6Xh7osWH>rIW2Gw;H&u?WfBLDSF2ZZ-WY8LhM6B@wO9B;&P6kI= z2WXdgs7H-dWC+vuC4Qob`|a?*|4sA;t|8bt9Zff}J(OG}mS8c-FC z)>Uvr7qlGBlk~DUGIzjKGZ+kl8)z;Ds2r+J7$iKHfaSdqok0eyje9kShM~Z2G?t__ z9H!=i!n321)xwG?g zlNT)gYt}BcVQ}7pM*#+JmrruocUb_iDlw=hWU8vAIn=bl=eJAm6mptg^0G~)F&fMM zW3*(%TVTP^U7M-}y(D_VdO(;TFyf429;0fiwOzucLRz6Hzt*ddoSY`OSTI(ATFtJ>=~YI&)?vc#8ius#Me zwaw5bavW~4o=6}qP_<{xpI*Iw(>&aNeXzAnaU6a=Si`E{v@o%`{pM(U551`#q7+W< z8IT0Qc$Z4bZ=tL$s8p4*&`a@_-qZZ)dJ=XRiO^GZ*oevL5a& zhzZ@-Ie|@o+R|5V`M2izCB)cImbf+bqYKB9C!D zmP=(=mrKd{si5aJaf%b8&bTgTCpPuZ2Z!z9%S{tmrys_sR5~Kx9a{?vR&Nb81VtHR z3)q1}vUj-RtS5+Ol`293dX2@d!~r*yYKN^3GF1@=D(6dI+?Q~8ptR%VLsy1?a1S7b zC!;y0wrIymfv0Fpq^s+;7AlR}p;o@*Ca?h`DVjt>Yq3#Dta(X0Bq!BSmlMjRKKX2A zFOpjQ&M3kEnEOs&BYhL@ecNdMD>oV)_|aL3XuC{Qs#4Jp$j1UJT-qwB%Q(U_UwdPN zKqG%Y2haxb6)@mWC?Szl!Q@d@c6bsyKhqwZ*>?Df&irzEPcTRA(xx^CvmD=g^zHll*+v z|B$or(_V-waMVhjv?^XqS$n;fVmIk8H)n-UXBFlC`8ip9@FyJ6;6FWZ(zESX&vp(P z9F*1#n*FIA_Bq~{oiu`pddCO^kMi1WiT@GK`F*yBVE<1T?lyQIda=Z1@1i~c7YtjL zs%-B)t59yJKN`a3KJzz11xD-otDpAw{&z#^^m_}CUo3mC^feUO+LN0SW~@1sb#xh4 z*+D5b5xu2aFH7wyi~`AWV|ddcUlJNLd7?N)-*w!*DU3fRfyi-O0-crIjne%RfB1bA z55orR!0^HXtwxWA2pxT(Q$D=ZKuu+KL`$^_5Yt!P1R4L5Ohxxh;=9pailcP0-GieT zcEN-N7qhtCFu3%;W7#fVi=Cs@=0()HAj8eL)fx>@L*e8KgZKi1jQV&yMQk8UX1_E& z)kmi!tr5@^JENUAevh|rC%A@Dn|OxWNgb>7K!c zq^t*}kCr|02knI1C?k%${_Wg}mtXT;&p*66C;;QZ#O}V@gVQwPz|+HL`8ePxyx4lE z9rxWvF!`=)Tq$W}sW{l;nt@L-4*9)Jb-3>K*z0r&_J94=={t0kFSniO>=OjQwse8u z*Uzx-ZX!sqbpNd(vsTco)xsW{+0}py0=9>})=drFW)dBUF})ong&AOfQ|CaidfqgB zV318)qNz(1sK8Ku;E#Yp7nd#Z2KmIP>UvyuykNa{182h+K|b74cqh<7%H<=?)#gjs zWS(wr{rzxv^YEue<+x%e=`*V(kj3RXgs|c_|)L?0AwN zM@~3nGNPwE%mE^{qfj3>N6OCf#bvu&DlGe zcG$t2#QPplJocT4HL%Zh_6EYH*9^zlU!$EgtTQ0U@c?}~5j0?8`Gy@^hdKe&J@S>7 z)0jY9*BY;5up>UJz~VL=)Jg3nd_V^fi8|>E!@&-?baT|R3aQd`-{asIehywZ$5z}& zH69vRyp54j)HTHJpj}x8C=&PVl|jgGSSTAnhdTjsLw5V2>RWw(3NtNfwR0NxODGQF zM^UFOMr*7~`dTGH#VBmV4zSe8s82@UFcS!09L0IfL*HZ!Btegy;n^8BAwHAKE;`(>S`-4L z4(qv0b(5hGS2-GxPk!5FHqWOPdN8^=cmNL{gYYMZaRUaBdGRS$y>NqG6o(W!qg~kF zfio2E1i4c^sHzNQ}3H zeVj6KGMt9~#PLyo7!H9U47A@c(u;zF#Emz=RfF}!)fw+=8VI_sV_mGEuR0in*hL+z z5@R7ixz4EDQ;(L^EY)*7S7n_ZhJqmt*qspBTwcTyW)O zdEIywyGib`ilMPhwp|(gwHG7tVcIiiyAYfW$x{~k)eFw6u$Qzhf?kw#S^pMM^z?@4 zR*lQ*_#HQuPRD|wu{xFGCgDtYjr27_9n3-a`v@8?T9__3Kb|E6j?7UppK1BwT(ny! zx;&8)!W0eWBg4jP7;pj=NB}dO%Trq*i6J#(%OS#kzl8bIKY_q#m z1|mwJJ4UgONN>P2{BYEJHHcH%4d|E;2Uoja(U4&9+a2226|{i;qk5_sw0$|G0LD_L zx?$#AyKPoN?;8Fxke$H)TK>S+&$alIQ(nX@jT8c^VYi=~bOdR(beZD3TjDJ&Ck1+s zRbln1)>?Qp4!^KJ{u(OPM$c6UAupyx!JG9l4;3-Oy5o{g70Hez%&e|kCH5j~4P@En1 zL@W3gx(t{@O`sT2jC(z7<6yFa@{N|XSXhMA3FGP#@NpX>D`@;#E+Odc&4fn0Et}(#?jWySc$N)3KLZQ>neI zJRzs+gYyvy;*k6RyVJG+QU6uAc~0V2Jh))mnWSseS=eGTq?v^ZKX7 zHdmej7J%E^-Xdd!`ci#md{f1Cq#t8j$t>l%s&2>@MJch=^73%a{|JG7Yp4%P)um6m zQas4K*@d&ra(!t9YF_ed6zT~Kq2cs8Fa+qX6Zi*?aD>{kT)~@pu1|;73wnH`5SfE> z54N)|*PK~6JBLHs(wy!*+G^0=?F}@XI_m;`VL?w80wO!N`T03zX0T;Gr{;K0 zagGm!CtLe!wZ3w>Ryd&=8HP`sHvxsVaA?saR(5mnvfhA7)EZ4o0@JZq1)Sch)63Bs%rV+C+qGUxi?6jKZ_C3 z{(Aj(>767lEWo#Pqo4(cTYz}VuiPCXk`juc9kx0+B|)Wbj9#=(-BEuykV^59W^T!} zqMvHRc>G5eQ5&V`y2!>-Krh&H zqcd{MuR7#n-!@$vfQg~!Z%^D#1pT+G@7VOy%R7JiM4i@t_zn8>Ak~xCyGI8*Z)&S6 z>gQD;NV5mwrFuN4E>k#XG0xP+v$bq+=9{OXZ`w@Xw3&)bl!PJs`c5HqMSq-22&r+R z*C5H`u&aI|1q{*S=5mI@K7RlGv9VWyPmyLIENyZ5^PD=;UWq*S4O{!Kjt(1@+WrcR z*Qhs$JDpl5j{7LKh`Z6Sb_SCY)-5IG7{DvLq&!H)#!kzaYE%grVX67<0S;=qX;XlHCPG zdgg#p@qjJU5QBkBN47v)CvTAD+fDMbS`3G+MQK@8QPA)NrSbBK^3lnIlAO$>8U#Fm z%H&5bXEFV)8=VITWy@A3_ci>QsM9zeo_1o4903gXStst}9cz@d5)E{X8{vRHP1+ic zmiv)^ZXIzeP{4%aUPmCFOD}@67--|*6Ge=8i53=EY%!D5&%<(BMM3u3nPeE+1Wch+T7hW zH=$W)GXbn)fpr(oX8tu1S^+6rt$5Vqs6}Fh3Wrm^h8_fL0Gf1ycuy^%FUZe@;}>^VxauEaeTZOCoAx;3_m@-KAXP+; zuwSFtzAgYZ*xi3;>NfYUP^$K2ZI(^7mh{6G9FAMc&Li!pT2J7oS5jTA*4FrxZaCeX zl4L1Ef*NBRscNl~6y-bBReD2qZ^mA}+N*8*WNp>;B?5Dat`5o66cOf(7p94a>=YrA zY3@N_vUO}g2@F^@8(Y$euM`j@GlmCgK}uYFLyQ&8vELfMj5r38@}T z7q!Q1T=}OOCsl%oy-q^2P3Qq2hHDLm*kwpg2SJPXfbxgSU{C{g_LGhq>Im96`g^Ox zfkUAPD|Qbl>LN#NL}6+&jD{mwoS9v>`RZW*#lhxF+OAUH8kO<~`Shvc2a(n}54R3> zULARb`O_3-pKTs(dL{9LTTa!wYJF|3GQ~}bam?!8C&PkB;8Z?~pXR1?>{?hp%fz6_ zp7jsiQcsX#kg0_ZaJphbo8DA6>Wd4tYO~qwH>(oTltd0C8lL0QvFBh9!8GX$fo>*p zqC1x5p0*tNybBv*7M-&XtOINJQIX1lbw%}J8Ow_6#K~GYps%e6w{FqiFX896%kMUn zHei5JENK>&gEWc)7p!q)PjM_xe5C+KGC{RCQ5Lj9KQ-Zgb#rqm&vXmNxacNVGMfmxz|-6=G}jue|U z2zs69RP)sL)%G=C`&iNj=R30YDCv#1M9NjsP#=E+bC4zj5z^bh6I|U}ol=-qCW35~ zSElo?Dfy>xrYSk6^_+RIxwpIX^e#2S5#t$ZDJ@rYYHXNHFy6Z%k2S2m0ckf5BDoJG z?A4Y0i;hd5#bDEbjOVa%nsPa8huQN6Orsv>$VVFvqC2)4EezId;fiK7nAy`TpJqLz z`f{d4DJqwl^9ekQp8i~x#U`%b8EN39ud+?X2^U2g?tC`K$B#-+!{5+nV=0G<1cU!d z3bJ`{*VJS4AfIwQ15Wsw)BtNJrUsY_)BuOsQiCyuz{y1*`q$R>SH6um_vK7eTljKzn(;mygI;ZJ z{eAPrc1;A%pR^d?lq5kuoX+Ny2LKPDBoXYz>6Bhf2`o}iCo$>U6@z_JY|?7psKOqL z0FS(1!U0-qKgK;W&w}3d(V0j*U=2N7c`y?Aqh>yph~m*IjLy*Q1bi<&aWZ|{sFw8F z>%S+0Y&&YD=VpxGlpzBC2<^tabaGMp5-vkZN!<3yiL9i?M}u9er%! zZxgVEGEI*yl>JMvg#hGY3#a5_i%$BF!xl3dcY!Squ<_V}m-sb(+2G-fmogr6NKs+@ zEoT;g+(KV~MJ|{;T=LTMFe;VdKMk+a<8uetl?5p{MrtHHA_KhM;Co;*BrtNX#e)iI zUBdrQHY#KtO&<0C=f$g6>~r|!Nrf$PpY0#I821J-#AUt&+rDe4Hy*yd-rIbMqCEPo zos5Vlc7xo0Vqr4O;+ryMvH@;uQ0biN43P^-ZW6wJGM#8tplwb7Tl_1|yP@-HvqZo7 zjdD@ZiCR|Yy-}^x_SKQ(+c-5O$kOZ-ummafBhFefoDF}53?nonfQ0`1aSuclh7@;&J`BzF5(D00Dwt+>2U4 z2g9eBt57%rcZ>y|>6Gy(hp%#BmHg!x{{FJ~mvb98n%yXPx%E9vscf26$}!+16^L>5 zm6E?$2vBRuRBCU@-J{>`GddycKFb`nw0U!>WH4yw3=jIKL7Pd&|yuCy`>!*s5e1#%JwgVu#Hk7nsZr>(Vm1iHJv#d6iHMsFK-mAe!rz1pW( zxp-06nL_%&`LZi@{7KIP0ccm7wmO?PTcuo{Y3j>_o{0SJv%7Yz1K4E2OwDs-1R2&5 zxFgE2Y=@_#Zv+=DE4Xl4b!KuIRg;p@;?GO9J_}QPj5lzNEL4YN(4K*QZo<$gP>4_r z5M3q;2B^|ju*u?Pifml1Ci|E{AF@t`}8X%Y) zooO#YLyr5sXmQ1OA7ZUq10cd-@w!_=3l1_o|K9Tj7qS`gEWrCnlD? z^48yXw0~Oxg)oe)IaE+U;@nQOAI|3{HP)sl6T3J`94E3&z0+GKZ3Mv|ue7-6*)7CH z&x*uF&+cAal-USA!2j~$k|oRrS-lg=vEfu(gm37kpO&d#sTf_{qU_2OVu{K01Z_T+ z=bo^4{AD)zm?$Qe1&0nvVHRhhV{>-ZjVGmJi;fi}%j~19a2#iQE6RGmkU%K(HdehQ zaX_)`?lZfPr&!0!Fj%(nnLhfgb~ah-bWEWKmML7Y26FSkn7MpFHq+FWlil)8d zK$hIXCFLbgIkhRh`d)YPRA!1yLjrIE*n4@`cS(CMJ%@x7?~S}2ZtrD-AXwOU%$l*f zdaFgc??!i>tXgixwGF%dX0O{YtQFqR4db}eL@QNkrt((=uRePHDC?v;K=#T8T zOLNY~U^0K)kqXFRB%p#+gvQ>;`DGcuG$NW7l+up1=$vMo*uPB^ZPr^fp`X(P;ywKW zskLnYls>`Kybn=((wtDc!LW59qD13OOx_92mYd%XTuzpYrH=VUChiOfHg_N3g!O41xX{G1KDu^gF&vC~Ep#==-Y%yx zotg+_TKavseHSNVlHMb34C2xGg`wB5j7fxq20TYn?}F@vYs;lq^GQ+p1OT+l!P>v{?)1kTE_&ti(R$5!)NLm2wnS3iy$R`O=t=` z3oVt+vlSv%GvgoE%!M-2wz@Zsns1!Y)-@1Jy&QOkUG)D4pNYU$xaY+(02 z4h)KnYrn(1aiK++g*Wt9n)B{U#PglyjE3mw*En%*%NJ<3as~=&bpV&kHPnxMw*L|n z)2%_AM;LPm!+_9-Vm!?P0VlVrV-vBNKBZ(cEssU{foBIn)T5rPA-BJp!ty?{SHmUO`=m-s%PXsE57r+(dMrs> zl+;4cq&Xlpho>d6nz|-oha58xMJyI2JZx5ISdwm(oWu5bxmUipDt*WA8G@lWtH;0YrScQ>dO2BEMgkYkcgFhq}$ ziFbNqCnCdez+>ine<#+yg03zo#DeE}Kkd`@zBGEao4N>#x?oC1Q}sH>pIuKDnsRyQH#Nk5|*bC87~x?V%=1o(Zxx8Y+jRM(B! zo{+Dc(=bjxr&!XC)+Uy7XK{P?xq6Gi66l}#+9~i&Z(r`dJA4X90Z|Ah5zxo>O)uy| z34k|ODPFS1DGf=GYPp{MV`{vF%Fh=KLz^;SjQ(3q16%R#$G-Icfr~ zVOT%?Fq*GLtB=-a>+`635TO@zK!Od0ALo7?)1~tM)Bkz)`sFL&gDbXy?O-4c99#tb zByQi_s%*;vp@g#a(XI;&XK5MVqvw)X(&n#h=Bm(&D_NL8TWMmaL{(EUhJi{z|AdYPr6u z;@-r@aGwQXq~i7sJXf-MA$p?D24M&bgJ%crjIlq>CSZQE2`wW{rEOKyDmpr)fbDmd zdaFM&%1Y7vqjlv3Mc5M>V+f3FHc5yMSmHBuSlL5CAl~)S1%8134TczB&qCP^hbR!@ zYd#7eql0Py!x?pqeq*Z>63&eJrtp+#IQtw%2ioyb+B3HpydMH|$GlOi-BqLR*&l}b}9e=?(>6nsGG6T+-ao!t!29dq!kFJ-O z>MKk0AL()VR_lH?vE-Ki`S@zHcCd4}MK5*wcW!DLkQv``l-3_rr$^BMcPUr^_^^%- zJ@g3}L+`k6jP$$DjP~K`%E$QgzSl`S zE+Yo2XJ+n;YZ^av*~y=L|vI_^pbR_c#x{rD;z^joEAacR=r?7qag z@tD9{Ad~}LwwC&Q9$9m-Do)N;k@~>zn*4qa^PIF|^!fc+MOnJ~IVEqB%Lk*Yw+|nY zRx-Y>&5y1oGpzZb)-;Uz3IZ{2tNQVQOPL8J;FQ#kwa52vJd6j>nYk~=gNdgB_0lP$ zg!^MSm1)__)S8+17{y*|Fu5P@IO>84hK=eCi{HAgrrglqY0-ppu{$YOj=9CWhW^QCz2k1P1CX zyi#$eEm9vAbiD;2H`qn-_{t$k(7^73T+gGEEno(r7@gCCp5*xPyYJMKxp#UR1N4;u zIa-~7Zf?=t-zg3r3>EiY&sU2=fFdF9;$x%o_UYEM?H31!NAD^O?EvLi6fBh(FDWS9 z(ykWZ*hjKEzIMb*Ky3XM0|r*DQ8}J{+Z6K`{UCuarJkcf&`VGPqD%w_6ko;|Wz}L{ zKyH~ex-tCgvq2XsSXRd?$E)giH3JZ@Uf6#Go(UNcMQ0HB9F`8CwnG@P0VywNIjxT@ z!?@YPOpTJn^5mPQU+W53hU3{fbf>(C$^pQcQt*xAGCsnz0Ejooq1{rwsnP@l1MVk;9=#_J0sE>D{-@hHlfsuox`JF zY{?5cD56F)tV~g_ZbuaGa}<%Y-gYny7=5Ydg6@_xnhqh3iV z0V%f*fG>%9j9m&9KXEP)HRC?a!Jv_cwT_Xa{cpDr}N?Z7dS+YgNk@ zDL2uLK|kB59SJ?HE!y^8!wxIPY2-Z_gIx`w<-wqxrt7GZ1Vq2~vsPT3-cY7+CGjmF zlCvAfVLNNas!zjv&0GpSl@m13&rHs+y>IV zEfwL#A5e{uEXc=g;~AF$35k(i!pUy_T*6iGePx&yNs6H6+2V<>4W(QoO5>%e}u%58B?(EVWn#)KS z1rj0LWo)0X7`nwuAW#&3r4?cg+bbJ@NUM9KoM$G=(F32@U08;BkywsDs`5CbR>wc6 zGF6*1N?#1~s}8Q!hC_WCs;`vRfJY*NZmN;8;d&qSqTff+*^Sn1ca*|ppfR@r2NVrU zkU|%KIWo%D-AlHsl<($A!x9y1UXCW4PSrk)xS21>C+=tvnk(+47o6iAgZ6o$`C^G* z?6z2FuDdYH72AazJ@K4ExZEa`Vmd-ZBZr#YhK|Tep3#fqJnV%73Ab*JdayR@>|veU z;g-koM{W9MkX z)5#n$&-pG7fy-7SdlI# z34P!jjPYBHk6}o5kssIVes~od72X+AAuJ4Il?=OHTsa&ZR0-eRd5UHU_*1f9ZS*F3 z;1tf91C5hYWy-y{c{++ZK(w^w*UZ#g9(FQ+zr&P2j2`RJw8lwZ00xI?A=^qF^*|3* z*^F>%gq$(P6cc=bn=cB>WNqRSHq!Iec!(Wv!Yc@fVgNu+Gv$31MmJ8h2WK$qjo&F9 za16|Xk_kbjBV5hn0=n^Sd^YNuPG!(3zEC6gyyiQf#iS3U!#U(^>!PY34Mi!@z084@ znmNrloN#o2(|0BXthR2p>#y+MLLN^(etc8$gU05y?JYQj=O_8cW2?wlbdn#xkxf%a zF$gbT$@hst1CZ@@IkzD>Uwzm>f~Qj~WwgzgP204o)l1{|`Jni_Q6l99&}eZS!+yU} zDQ~@crSKmj9u-dDBLF6Dsai`30k+w4mlT&paw-Mm9CDWftGxTH04QxD7PK2%P`l^! zzfP?s3j_!kGe(gMfpVZ6H6Bc-9-CVuKU2GY5jJT zMqrMJ`iXbiCH8U}_T6AAQif1UTs~bVfpD?_=;g#(nCX%4`cF3J0 zj7c=JXBq1m;^34!F18cX3TFEK3>7Sp(&Xg)4+zJcJzhI{F@D75wA1K*zX@M?U&vB` z{Cxb(MVwI2K11dd((IRsgJ_e)|740L+YAnA-uPOviP`rPMl)qt0C5?xH0V4h52#U4>^F54k0SBq8N1=%V5 znTdp1^}y`eFr~Emzb)`@3p}&H?J7)0bVrYCMtkPSuEeiL3|`?rm9Szs=0V25XPtl+ z$r}MVW^HznD?u9;`0g#Udbg2kS{DyALpm{D^xYvt?z%y1;vyu@kkG4veP@tHf@MI z%6vDTNhyDzKB`%!+1siz8+<&StIRo6l9V5rOp#Jzx+#r{6t39&;+#zMQ?a+fQyjz6 zKnl)edD$?W#`X&!0*y@a)RVWlcen$K$T^=);W#*_&=eEP*9X5i$hEm*%xGf@@Z7blM^)RI4@knolDSc`g_ zeGb{{{9$#Rv_Qp}$5)0Tmrjr4Rl>g^w@wfeQvl*9Uw zWecTHb;Is_6>A!jx1wQ8RQuoL1n3Y%@9Z}#ilhYxw~`L*guN`&)~HG_5UqPz(%rT2#HyrHD=-+124miNW;h6C}Zm^HFoZjlD!&LFz3 zt-%aFQ0EwQ3?(qc47JdyxatNdpVmrtY>ZP2dP$Vhvm+_C?4pn-qinbF@5JU%*M)b1 znVzkviu$Wsx?Xzzd`>kQ__VS#=V(vw9PaM_vVAbynp3ltprXESD183wU+D+lD*vds z`H%Krzj`J4ow7fw%4S6^K#lNHQvhjBZ6JubtRlBl>{vv|vjufW6`KeB@X8wt^SKurY%QRU(EL6-;9+i6q{>)2?1y? zj0_`N&)qUyvnthS^iDRJ>ceh2U#Fk*ZrnpRz3TLoesW|f)A4EgP(Ss--f7?1lYJ`R z`t)0rOT>lJfB*flURs)N(9PRV+ndj}4-VC`U3%77b04<1gPk|(L4CD~X0wY(*V$|Z zs0O_NXk<~arcTrvva9#(|Kx&L!~^I3&@)aVK58b&aIwIvp^~Zog87BUI!%CL z5ncemYTTYUZV-by{UH|^O%SJG#@C`{*++VOAkY*MhS#1lIyGyn^XRY2H>}FrI#ry~Cg8yQ?b7Eq$3Yg3=Z!_rA=EsQ~ zhaEdLN`lj<6Af?1k9b~*?707XF$Uk*f^TfWH@3jLe#(cpqPg0)`P3v=7x?#~xD#mWH$A&=dUiQd?w|@o@f&LeONy&N_g$|1_O2_?8g{qq5y9a2MkISqSyS)~ zPv8Ej!I{<;tOHCE-_G#{PTBltO_*#{6fa4fkDQtowQtj}NpL=I_{l|y@&DV661v`m z+6EY?C_%S;qJ#e9^o_kG(9df*d*KV!=4cory)faZ$dBvvjhzhV^G7y;6@!i*k4vv) z{+`18ZSnj)4b_&+AMCET8r<8#y}O0!uK7D!oP{7iuhkJ-ZJmuUa#Gb>{v0+7_ot>)(8)BQKF>)cnhssGgd`&8l}#29V7KS^LR)EnR2`upaK z?dIO*%WaC+jOHa$;+A#j)?tI^Sbu}Dj$Mx}X2uEs7Hyna$C2rOiulQ}ML9y%;~ci) zUoNon*}y-mxKz8K-|uy9R6iUTN8on*Kt<##vESx1JF-`_n+!01-%#^sc@FQ1?Xq6; zO$;1S+wuMBBYL<&9bNu@8eB%LXmlLhWWTtd5c(8oomXtyVDYB0ccOodqi7%s$GYf- z2=VJ|lx*%2#{)Bg=2d(N%zV`5{gqlSX1@r7w5OQE`f=mVYiP$wx)!biPkQL9E+0PT z!1(eo!uSJ|{s}0BE)$)hk1t3lan$^K0%N2=!zDlhbgp`SAo7T$~-_oIY!Kt2Tx zMDl*!C~>Ic<5DglAlfLKZ~(EB%j41syCHP@m)C9MsgWfYsVJVuxjj@XKe!>c#X%yw zXZ6N}dQi%9rA;L^*bkz1i0HaHU8W85-opI+y!r)Bi9ilEG-E-*E?^|c3;75Q(O|1* z(@#H0Q4}Us29fGl75T09sAWQ|vyHxnsa+v*wB3K8tvLcgkEgsrQFwQ^L^rr0L4Xsa z_a9-VF$@N+)J83oOHnv8VvvHfGi*I|5JT4^2OFOm@CE|a%3wH9ELqK_`%Fh65lAFD zG9{}oLB$#>gR!8gArzGZrY#t>NvD%S7D6jAerhM|qFFA+a)X9qGR0P9I5+|vTNOt@ zxUf){!>?{YSD3=!9EcRmfbi?Z=3qJP5nQ7Q+F@QY+pC@ zMVZcIBYEm5JJap(_tiE>?P3XFG)TzPb{lc5lsQNZf*uAhB=1*|jg@9D&nUhZ?^lC! z3c?0k8|@BRIRL|=tq3b@lvkz}sbT)<1ZtRbS`+?*&Ar{7r*~t+Z%3Y?`j?Y_jSZ7& zA}>(amB0wm+Q3zW+c)ptv`04&w_j}@Y#!|&h{|4KwrWh)j?O5*0|vi28+T$i?!<1~ zvh`!cV7dZj_i193AVGvNA?#5Mdd(7$myX2E(>HZ2>S-!FfJ^DS=k$OTAm%up^(-C% zWgc6rzBw1NrB?LHVxr|bhR6S;HRVhLQ;RQy0u$(s#)e#CV-xS1(&XN)d;Lmb@lel4 zS$BH^J^2Fi@u#B}?f~31&2VAoQx0$VQw6?JkqK19AG|-5bg2C0<QL^;M zUxNijvW!3;YE5ApX4_Y273OBSdp^kRsO_Du#9IqK)yl|6?vNuwyRZJ;Fhm6EPekDk zj}CV3BBFse>;yEQrcqKuXZc3OCQvawT=^LJ$8tj4mU6mvsU?@5`w2ux@F17kn6y8V z3ChFWq0B>BIy`}Xd_KAOvrz}9^IwPk8AB=Df%mh2qZ(83J~DKFB&it7`N-tuF+S4N zEZ>u*InMW7uIHBY$7|Xcp69F4BBh)@nvUrzT=e${lr9cgdxR?OPTUWBq?9aQuA<)R z3ViR-N7Pc;@*MTnYMfEa{c4>UQe#YLM@cpXJ$If*mtn8&kqfC!vNkbm0j;2nmjQ+< z%PCZ1%8c>92=aAqCUoa<-HQ>6a*|o~m6f4^$fDA6Lcx?ImJ$qLKR6GD{J~R!gMLd~ zbzHsYaok2QS`3_w`Y2efy8*Q6CSkrdU&Dyu>wHafUp>bVf2e+abrH2L)aKJ246PdI zFxYj2IFPWk)b{clhC}uNkW@n>Lr*;+wsGQkW zFj{moK-hAK8fw|_pPBHU46sx@kA@Y{6kteU*vt~(sACLeEGsd&{1lhKtyYr?G%^1d za~CG)aqyq-|5oV>yFa4|*B!bA{kp!F{>^Q?zM0SFhXek%=#M3FIkfO=+Og$TcT4-( zW4%F6a#tmc%YO$=p2GE3&e#_mISO*FyNBrOQhqk%k4xy5#bw0qvnqjT69C(MgYk{j zO8rrNsj9;BR-%^cOUMKFLZBQ^;PApc3i86Vp)(xAaX36l$-kMVBZ=Hj0~-!7lF?~0 zjD{mptsvcvi?Gv2Pn2-(RnQ)cFN8r*kv)bJ_fVY%t@lYMNG_r?(%ra^8uI~0pbuKZ za3C5W$WsGg)Zu6i;aoy874%p_VO47sR<&(>cHLWe152b)!F5uDf{VYtSzN5px@l6@ zCbbhXEFRCkJw7fSAD@(u;qTq?+#>ueFP>MVPbj~EvrupvUxuvl(dH1>1V>#0>xL&2 zMWLV2lm=_(Ruxv2UsGoEP}`;x+;C9XM08bx9x$n`ppUs>XgjtAFd6~5dCXK^F++oG zLzqon%4wbbD=+F_-MFo|hq0%I$p(^+Mv2HriPK(CkZ02l%p(3XnlYXN8b%SO74#@3 zeY?rJH1-6y2_1Rgi?4ceE=#n%gbLJ2J*dF^w=Qtn5l4}_MlH&T3@VUaGy_#H%Rg^b z5f~rFm_e=7q4vrg^c#MWE(J&zkzwJ3b}+goK?r}VCl}BuZZ#@`IlX}Ih;m2*nw_>) zO~F$-e}f!YC!I}`F~{B*`oFb>ocvZv-ZK0?BgBxy??^im>O2l}46Dfuw;Z8~8`wM` zk;~>mBN+JKn+%y#`K8esjJ!;eeAoy)pwLYG4oz;g-0#nJcaQe>cPUYx8|_Yqr`l%Q zeMULp=+$X^-}jnaAwD!pogQrQB{zekgaf&(rVP%8n{V$WW!QV!=yl!i`%nMp+3S}q zgp%h5Y-{aNx9?_i?&##kX~Rvnf-Dx#c!_4C)RHcKYsBv56cBHeAPBWC(*p3NppLM= zQT~9Ln?WZEl20|yZr;siohBX)fH;sT5-f<(^*quIJf6~94N!Bwil0QNp#a~M5kRP< zHHi8YEXImDnsGvBbPHgPh&_X!Qqr7MSw=9&D~pvA zyI*8045I5*eVE?ddE-O^zX*(KTw<*;Uu@xdw9^S&!xhaX!JhIQNdy#SK!Y$y;vU&# z!C5>JQS#RQ?(X*15!oLe!rA6B8pJ)cqc!WQ>gv@=OsmVF7bO=&XjOl7c82sg>BjFv z-?{Re@&^yToOfaR-*_ipx=GqM~L3?9}FgGITr3IltP*3Y0}o>oZMEFjs=#g0rx5m`DZyVuLyr!#p{Vc zZvjz@k}^YGDyKjFGXuY5*Eej9@fA>Ck!luPEs+s;>N5$@)0#CY)R14ryjr$?-1%OTrM5E*cU6pFJDI zVt9)M=b%(OY5~d9dfWFY5tFn~RzgP{)M`gFIj_9~&T znRU^1SFd)qrnsCP4`3R*8atSGa9x|7p@x-M=ItdX4WSDn1fwCUs|^kO;$0Oia{ z%p4KQ=`So|w8QZN`O}m|cuoT=wO=~bN?xKgv{K`Tik7sZQs)+;OEn<(7TS@c$`8;^CF&lGdb^|AH$d6| z&pUvquCW2d{KH_yxLzzQ__C#Dk&oJ1SP=Vzo4Kl-j^fixJVpR0B%!^^P)EE)n;F-X z!h(a*J|$5?oh>T3ZKIxqF;>Y<_cZPZeRSE{BPq@!jsTyo{W1+;J0Bs2y4Mw zB|R9YA&dkZ0Pt4yfqq!WhaO4{;yxZoKB_o5Tb18609Qb$zxjRO4j@oGw)HWGT_Te3 z4j8t77}^Qd6}N-IRn$XRgNvY_#O<32@JJkmGBMa(@U&zzZvpF!<~@SGhMVA}@bahT zv;RfbjAG1<8^W_*jA6k6R%V!5H|Nq?VAjvC@S%UTy23-T;M2uTTF zs|L^+l>KNThnpd9{CVl<9GDlU%ONzkFr;=J0rQN!$xt)=Di4zV>%KrNTtvn}%VnkjxeD z+}J4rM94HvGv?L`2M`AO@N!%DGaLZKAl4`lMARl#df%>3*dz$w;df1b9~8ATwKvh> z7bXY^H&G6lSY!y&!^lE~W~)EK-7gB(*UV`0>G=U*@|8aJCu(PNeN7qXMUbmt6MSlR zL9S2C1`BeZ_5ep~r#l;qK+qOph;VyK>VQ#|{5j+23!n>+abWOadC5F2yGwzcXp#t! zDO)Zz=M}>7s*Pme6m})NI@#L#amqn2*eG(ggdlIDkkedg3^FeKUnM&bU~pbLaPLH^D*o12Mpv}j_-$1`PMWE&IZ&hFq+yx@Pl^}ERJ?l_M`H7o(5o62Qa7owPz@P(!A+^yw=#aI1Aqt#r_lHEbw3c;c~+9 zX@)eBe|lAW{ie#Y!L2Qlq@(mGM%R_-|n27&L0&pyD$Dk$VBRHkRAz8X?yNZ}l@dECy3t+H+@&W1FH}q-8RL z`|ph2nt5N(@(x}Jn_1tuel36Vxoniv$1jX|;q4vH{!+4hiMPeQ$!;u7*<>5)O)oAM zwCj6=DY+%P?`6T1@;DRAPTiiZX=eC@am9Pft$YZPJ?V$72<7^&NcToZSt15s zi@&|g?wn(h!}v|~AbosN-rA~IhqCaV1F=#pavtwS`cA-$FKP65#kH`~lPX(vCxza3 z*_l->RHe6S=3QPz_`Q?~a-lXn^qDwjLAyP!Bcu|tg}1QMwy<|;73+|AqPHn+wKI13 z?z$%9m3yiMWgQ6JhPig`YSQaQl5WdlPYLlB*PLAJ4ms^&@G_P}C`EC&QPL{JM1nG3 z^E+A6?B0Jk7yiw5;~Pu<-(kCvOD?{m3CCA7)vz?oC3GH3Na_tkH4od;yn@}m#XcbM zenNF`)Nl}^Nqz#o>~wGoXvbGQtsk3VBHbYqJ`y#G3Y11}#oYOzr{M3>1xSjeMO7L7 z0A@Ue+vB}liwvkhlGP}&}zPA2IJm9LPr=|<#MY4#7RER&znrk8T`>(jZ@8A`rl z8qRGP;!e);=>!dIkSD3NSa&Mw!te*ZkTpllArAFI^wxh%&O={MLJd$CxfFJ_s;6f- z#sZqgLRH)NK$$x*P%V?~uvvI{dXPE|=B@3#@bJOjOiIkgPy<@C^rVz)FV5iN5ox|{ zwp#Ikbx2}$6nE9p0KnW-)lSe;yFsrNs-xhh0}Lp;4@K*EzGWS__Pq&f(c#r9D(ZJ6x3?6bw8$ySfX^jR0)SZTAgsou=$)0Odt&k@^U`;M^%{oe|C^E(dZ~gKN)wSC- zmQql?q+`UvV`y~llU5Z_)hfFLz;b9=fxmbx)2cTjh_HS`Q0jmdHL>ak1E5!72Z7OI zAoX`rUanm!RH4n6z-BD4W9-qQo{tq5ajoJl;uA5HX@1CX`5O<`A1!6%lym5t_ra5V zDWzL4i%M|kHBywKX1Ol0j$D5Tcq?l~L%8Cj^Ij|>e7UQF_IuuX+YILrXhv{@He^N` zgqWlSL9SdO)v|O%!t6RMkP>)VB>tHjVh|QVpPcsMA)VN(#Cm|hL9cgW_RWBNU%E*& z?smt|vR{Pe6LVs=xx;_Lsb0mf8=&w+x8xa~zy9-;5VU$|3r;;F8DOqb(k=Povh z42~gO_w+fHBZ!u328&~1iiXQ1FGTZ(IM3Cv}vw_ zg#?ml&8x|p(!Gefug&t&KcH|J#sVqk7I0C-jmxNQV*}&yU^*^Dddv>eP>IrZd?Euf zrfeSX;f$2vy~j@y@6fX-7}&>Cmu1Akb3pM@8^#!(!j_!??5_`y(r2K2cJ&hw*yb<5 zUOz*MQ*#r244M9B%@`GGo9W{dVzMga<@5N2G@NR`RVWz8DVo3}!P$gsp)Uq)?tvU1 z14w|=haV@|F5dChQe(tFXwxtl4kLbIM+=lf;-Gx_&*$>`;4;&L1I zyl@C%;?s~z9tFlyOg&o^%U8@K+ATmQzb{{h_k1WM$y?1h>C9r*SF-h6s)JJsn) zjCW4<^|WDgaps1~IQ>fB6IFP-k#EJjP{kLpjt5iG%!WP^95TCrSSkK=%?@nLQ`71} zlMU=$kD~&1w!Hgn&H^8&(KOzJ>2&b2T*AEtvI%V(b7vkOx}eK`BOWX|)y{fGJ@RcO z32;C`gC_eGJywN14BSTE3EWJ`ll9`Nqf{RaEfdMNBQ+?b^CK`eTNGpJ@QlMvqJ^|^ z69S!a9g^7B@VcMeboE!)O$oYOX!gRZ!Za?L=yW#BYKqM|4NMbnP$B8+BJPB?u#+;p z!0VqTvb^4RWa`llstF85OpZH<0-4WfA0G|!i%41$;ZXi~7_6}eZ|{?K$FuiRl>q{J-$63d zy9|2~x|hR{_2=YqO-eNTQ9sl^n2swzD(mxVaSZH3<5BKAD`T*$VBUCv#;!XT`lxbew8JgdTS`qqGF^&=2s5KrT3L_5Eae#~)ISeSm7=(~t8|n)% zZgMoNIPNTw*b-&L7?~R7xY^VrfD;F8gQtorqm75-c%+F{o-?u{yI1Y`on1a)uU{Vi zOui>@rCkK%OXD;Qdy1u7Y`5Bp;SaB)Bkh;$7bN+Jf8;41-D;4taJfo{PP&@&u2Xp~ z{xWI};v@#@{&SR!fNg~)_+H5PsQ+EYGm7iQ&?=3x)tcvFE1S`EK1MnuMB<3Qv(-Aq zawH8qXUg4s6p+tE?LMp0P;70%7{Fq0IYcPz_J=pr983Vh_~EMasiLjUgaLW6_Zn>} zi}!Ori)F1T#u@699mVF(8}V#-Uv|y_&fATbP1d<;-^^m+HuuP_7u^2ZG}~<0x{}ykXU>R)k^(weYuKl*Loie zhe`N|d{s*Rh!&Zse58j`dQ>;DdSQLT$)swcCqNAxQ6i7|GqDvEVuFck3ss?MU<;9) zJbY%Hq#$$T#=h;w?da@=gWYln7lfm&&I2-7@u!RepJ<;_u=dcaNkCB^B=W6m_nC6? zl5&*?2aPf-vozVw*J7{|U5oyIy&VjLf0miYz0aJXLN9)_pCdU#nbIxG@9sQ3*gW{( z=FT&<48?C<{^#w3!=3#-Rqh7A#e>g*aIpRJ4ucqkml5v6(?Rjw3PPG;YyPR7-rOyeng}}&+dcKd;SaKa5)H%pIS9Leol%RzISc2TS~!SS`-k2lHDF?; znf^6erznoab)aw{0V8q$K>fQ2IFWSNX${19z(~+Jpx=fYv;Wfms{KAO{{v+-jMMNU zxQx)h-&yYJkLfUF*oLaU+89}PDv+aFNYC^dBi})DMjQbrGF7Xgw`i2SEF0sH%7!Co zh7}9EN3sDdE_xBj3wh4ch}_ef$GB_3%m2i{*IuZnK)7M^3t%k1|7~!(`nOXQ5de+; z0i`JkUuX$2r3pT7wJZ=V&ac%>l{)ZvJ4`Sdh(L&dkxzzz1$g>KXQjwTm`3|#1|6LD zVxm&cSwKz}j_iRCe6%svl9=2=majTxd91}$xRP_pnwc7H0I#QLEE9zNE?kJjerl8N zZW!QR#i7gt?banSE2xJT57>EyM=9C?p6%{xr%$(7?9OWDRN?1!D(Xl!mUQv2EA;2+pK?Y8%(O#Fz*9)(BEo#)~6-HbMEiv?PgI;tl zVOpazIynsi9fq*~_2UTrzLEDEpn=XY*x5ql{8-nYv}-!zipWo%_`<|Rh9?(skOb8> zshUQ!$!%(yPk&opaWcsPRWF-ooz6=*ze1jBUP1E_7_yw?e`*#t&(N7^j^h=FM~FM1 zzd8+e%waLuW;aPW77^k^iXr_aC&4?c>hLPoXIPx_`q!F<>H2TGItW{cml@<`A8E|x;}I5!-RM*a zaPd6ps$9?tz`G6!>d3MN;~b3p?xB=Jy6<&-9eWx-W;ac5>l-J zoSvDg-A?BVw+J1}#jj%SpLx888TFizbgzpTN!$RevLM9u7l|mzAu!<4Nv+18YrqLq z(5o5gAXOc{6c2u|d4z*NRD^UUWxNV!E2!#|r2|M`c(utX8Qs=#iKGCCp~+7}I_aK` zI@&6M!gf-zXPZZxz~!E^34((K643(=377Fkxx zIaH-$H?s+wUZrd%w2~{fHndZt{&IDZ{jVJ^wh3iR$)ft3db?D6{BC}6(R`YJQb%^D zga}<+f1YSt5BCn!Qt7^N6^BzEbnwFAhGnI7g9)?C$&f_98U&;NHPhEJZuPfm{AP-Om$Jy_d!rj~T6g zI^USVvtBOPkp`Xn1>#t?3JT6NfzZM!dDvLSHxyN+EB=Udp916rS|H0YaA%bDRexNT z6#Puwz;XFLF#srkp@=XcMHwOKpPxJ6#UQ`U#b?gN_#>GJW$VbR1m3j$sivahOJ;iE&s-AA1cxD0YFG4|nU=e0U#MwcpIS_MnG%sc zef~_X9M>O>5r}4meG_k%P$kVsJTZLWygrvYH!FO5Yp#tL#F)FIL++YB+mVzseTT$A zroBk|1c=R z!ctaIPmFlk+mq|`xED~ELUaGbQ1HTh(j63x4bdLp%$+R8nf5L@lLdE{#lUBpH>-0u7|}Rm#`9M)`&~6A{Oi16nl*Qzj=k zjjJ=Z`>c8JdaucM*xr<9uRFLqwE^9d(2IZlQK)pMOUfBoGE~M1UngAskj0f8Z1qhd z-n$GiOlTW}S)rC+O^59aflvn>)6(?7wy43M|(%58UV7Pv!tq%kVX>o>1YV12daXs7&T^I6Oy=DqMNbbqd+HBSJ#`=rGey<@}21ojIpr&B;37%nTvs-SWx=L zp&i=@OX35{^bQ)?1eUG|&=I)6b~tQ6LBu~%rmsC^lr&4e7xO7md^?qLPE5r$*rp!g z;ING;;uQcC|34_I%=8?&UJ6KN0Z_D63Kc4u>L}2xoeqW_4(8DfulUZsr~QVphhGhV z;$HD!NlOhRd)V+v3C(o1X?f1TsjVn{S6zq z&@`3Ej!YfxZ_zc~84&yuc{#0hfh0wMN3~(xg2~rlw%)v=;_Z2z#X2jJ}?tYYrs9U957|C}%l6jn27djgxf~U#N(m_W9WYZ8B>s zP}!&y)7q4+R6cqyEw5<&#>YCLrlyj(u{2J~AGWqWsak&!^@cT^fEs<*nNC~}*=J-I zWJ{MsGXpS}1H31h3?cx68I3!a)W;@mp{`${8RKc2f_V~74MKE}7q$&er}W&BwJx}A zagH-RrlhwMP|=+snSmud?Z8EvsKMUJpNwVX##|>01Y(TE#W-HMSvv$dJ)sI*IHVPl z-dF_$Qcc@34&a!Oc!O4r-xY69o|#%zDJQ3EpE6@vJfHS3UC^Y(i{<0)8TWm?a)$?= zu#3)k74VtiMVddgVDhPJYIV${nr)$4tjWp1{8_~t4E^L1(H#m7+m(R7M2-XU8%K^Q zU`+(Qb5eLDr}VJV>v&TXP|Ol7b0zE;y|^|eBx{B5P%tD>lCch03<@rDi)|pt;5X*nt9V|qK5a#W9};q-eASV z6FCdzBtW)n}>1qGh4 z>e>b>shz;#?wE6Xd%u#8F2AsGoVk^CP(O$Jn_|gM9RCAVH1IRI6I_C$1Bt{jocT=Q zwD?UQJ4e)vi|MCq+}MA~XqQryY%=QhVnJRtB`(iQxsX+MC0D8R9W37bY1Lhl#XBSM z`bhKP6a#BBspJ|W(p8Jl?hdHmMSMk!C*){HC_W&iUUr>HkXX4bYjbla*fRyX+&!jL z6p03EtwAT-GPyA<%Vk167%wyMH!l4BW@Yl$%IC_1#k!MQNr*m=Ga(C1q4b*}_}Z zI;}F>c%Q&C?h~kv@lVs5hLKkuSwR?WD#2(NcTuiqi8wi8m0=JulKu`8A-yPe22dFe zMpizm$A=9#JK@l}U}gd5jXsZQVM9&@3>Wh(?!P|Tz^F0sfiE!o5`Ss zJ!m2pH7X~tHVB_;S1^#0Rys+kQ51&}r}KPCALvWwUc}^sGF*C@kM`!OqJV8SA4rOd zw(Ob6)bn#NfX@i1TCT6ExHkbN{0!+dPX_vGnmY7lfiqVJVTS~UK!W;l5?$Y@^6Z@J zf7^(c&SImsEq_QIlA06ph#80xhTj~HdT^rZ@PrdaBQu+br@j=R8`K31hbV^rM{+^g zD|qhi#^{s>j$_Br^j6RhQHr(Mfs-6&1L}Eh!m{5dk)Aq%-TU`ZJY?5{fXsciU+nAW4oe7 z8@fD8{CmCJ1$K@6U)4oQPvcSJK-H*G&F^wE2TpaLXI>qT96!>P0t^A@|glQ{>`o5Qe8o+k`1E-kD)>LEfi_&(unNg$V>N z;sj_R4w?2^&{|j+43}U6;TyVDKvx1Si~&9v;l&WcvdS*cM?>@iBbK7Hmgp|ZBkQ~d z(S?S%VKB8YIO9Nu#NXz6gB4Toh7{TV^ImiY;D}3@6{VI|%%Tw#k_?9(xoISGIrb64 zQMYB7pyy*$DQ>Sgq4a5MQFmtwM(v=0QTt3yi~H)eOWLYpsbb~>2FFaic1g-NNjOVq zVSv-;4bq(s(bT=n@TpVxUw3bnu;rXIy#~0!C&*qJr47Ce%5}sbJum3EtD0Bb>0IT= zKM)VbhTt^(Lq@BDi_J|w>In`0C*i@VT7W^&q?-Hj`IqDWq%EPKY=cJ}Hl*(5IQSKp zX~{udX!3>83@&K>H29puw@eb-U~O65m|}tZ#%HVqc$9oS6g@msjf_7i&UoYu#T|`;9ssZJT23`_&1Br2nML!j(NmwAs-OlAJHVQL zuBQjitTJ?D{BVB7?FkO&Nt~<~vlcH@&C=()W-e~M*rq4WW^yu_$nOqTcxRqv5rl5YnEu*S*iLHGW~YsxqvN@nV5-z zbI`jwZdGP1-Y(T1zRP@IHHo|8h{s*@q!*sXCVsN|r(bJ!K6`%LW?J4TeZvqZE1AXc zCDQCE^*#NeVqvCSE|~iXwX?T#w6k}3w7IvnopV`X4YR^CeNFIe`*7=E=hYG35FD3u zj^k3UQDwF~S?Ercv!o7p_Fn96tG)fb!=E+}wx3N|g|V9*pE>Malg*mOlS!}<+x`#j z%xnMG8Vu=ST2vbcxH3_;3k{9B{k+4529v%0%2r^}@oe=L%xSLBQBToaQULh7p9-4Dmw!M$8&CLU z94=b*FX4#gm~r51ZU^NgXBoaB&Ne6>D=NOWRY9ziVD92Og|A%bq6#@1qL_7B>?G33 z1A^pME<3GO*e^H*tV#Fu<*s!4_*kT?CKfxr8Gqu!PgwE)NAf}$W63cDcpd@VHrWN$ z^|iH9HAYel*~|@fZ~k=gfHA9VMvtm%){Oa2;zzTYx!H{E+){?xoyG(C<{U}mZKH%i zV)2UJ`0v%D>WWe8GRDbbN3AWV!){x<2Db_fDI;iYbzO$9-^ZOHYb2bbrhUNX&V+;5 z^&|#j=5|OGjf@M-tDV+=C534!P8#}ErS?p3q$J{a`4nSVdJoL%wb2OqY?n!?BV;G) z)THQAOFJ;r!411xmsZfxzY59AvN!1)dL|nKnDs|tC_On%#TeO4&xszdW9_e0-muqI zB1Cqlr+y6j>J>fY=ytvzb$ZqJLBD!Q$9*9Ad(mwKa zLksdc8Vv9yj?VF-GT}GS#H#s@RtG(r(JP#YgVS*(N+^#&z0BL$B%IM5Z@|xq&UWT7 z=)YLwgvm|;jvN=L(60)EVYfrUHDD2SCkWva9RqmaJ&T`!vOY258=yZT1xU7I0qg*~ z5cZqoJzfJ*rfUJus{pr!7MZ@{1f1!zc&lTb8SSl?ZVl~dfOTYe?A(%l=28GpR|vn> zb2V8su%4BU_Cbm}1hS^4nI2l5xlohPCVh#%(yq9(U>b1Iu9& zMmh-QJ*9I`={U|~ZXqejI87P?$D@fZvOdRIxy3~{`DnK;tTxn_K2}0QORo=;)K;a% zim&~!IaL?tlTh}QaZVAXO%tZM+R|P~*fc6$8(&RQi@oh-Iy+IMr#fXNCQo$YDtTyp zeD%!|2WPy#0{r~V1hmd1>%W=zmAi)%y_?E{?iA`S-#o)cZ-tDz%MT(;0l= z=<;5g=oU(>0&37( zlY(x(LP?cYcs^#o9kvCpc5cmaAD_*_)(k=BZ^E4GMKYdR7@gcuKgw>0)1T_F?!Me% zZ(BPHNVwmB{*RT;8#&xLNEoSivfU-v}ugQzQH8p z+Da#)h%>%S{0iR(UHIh_JMM2CS1Hz%s$Fh*ziEta24THVmxC5U@Vx6rk(ajsAQgyK z@*mdfvc(ITT8kT0w97LFdQRCXCFKLzXsMVLjM=&z^@a@t9baQ=#txLoKo%1|7XJ`W z9UoyDq<1lHqgy$v!bs$!zl`FzQxg~H|Ku`2t4Tcs@&~CO3)zDth8!o^2>HJ-Ph|4W zMqN=y4g};5lbWD$G1Z#(i)`{`#5}J8T>80e26`BT3v320%xS%!B@5 zh_PQ`jUH83swsKD^X|pIS|xZknmGUJezP(GfYKj)E0yNqyU~D)cni&Y)Eb2mGYR!N zq`(~^39one500>0U48e>VoAJpN=xMEHjy?Di_&SAHq=M7(O{2?j+F-1$nxr})Vk}4 zE|Uu*4|H>B;WHnA1=xv0H0M}aoPr>%(-o!>bt@i0*^GwdidXn#)`KzLL96O;7@bpi zZodt*#ZPyOyQm?YhM+Z119mPIyG@*vmkta{1~+eeZ0wZp?9mR`Ce~F*d7xd8sOXQY zYe+YD(Smr9Q~>~ZzsHIH0LR?6gm)oEk75lWDL|@5=wDzp?==&CAr8gEvg6Pf z@FbeYv$NYQyX4!VE(bYHMs6w8<$G)VN#cSHfj@+40T7|Di9X#OS<%qxtrXp(!c1TZ zZ9~ZR&|(@6Q5He9qO6U${j7uJrAdhRcK4Z;=H%SCxSywj z@U}=i10b)ruB)Gizg3rNrwhOQR{M47bn(=-SbTW8`j8v|ZSd*D_W(1-TK0T4(C-=? zlLGp|GKGn6+S_kv&smvO7YiHe4zR#{Qkp=fOU@5$h&kIhu_Gy|YKdO*63 zTb;*KDJY*-`YW))El-il5R`C+=vWW`uGivojCR^>ac~+>d3P$!G=XfVx(UMl?dq!i zfeL-Y&N(M!()PCfOco-m2fupmb7^HLX?&_3>w5-|DlP_4OLz~n-eH^`G~iFJuIG02 zl+qXUZ}#s+VkfwKY^g!5{){3s; z9FWcC1DKLS<-r6whi~xGwHA&~LZ}ohP1E5n;GT&&hX!BAb6H&bt&6@}ZZ2x2GhI#t zw^#0$>aVp*?V@y6{KK54kJzX5m|~hstuAr5XXinD$&#N+lMrZCqJ;l}bos~526cN{ zY*FYsLZ8Mypw)$v^&)V~Bdl@;{}2s^rLpz1L=^QF<)AYQ^p^3Cyjl!&nzcI61I4W- zKWl)TxqDq!|8{1V;QwKMF#GK3;l#xJA#Yx^Hna}ZW4CMa=+@8^bl!OxAiMzFlX2iD z?Po61Vclg`VCBpTif)Zq?>9petrxs^dnd!jlHI7O+J*cm*K6fk`J!-^oU`jcF>A`x z0eo;Z4Zf=rSA)m$XD++Fd%DJc$9?%q-L<8kI{im$h)IDL5yDBF$B}O@=P^Qjp;UE{ zGb`bjD7>1NL0rnX$G?>P+d9udUoJ7wy6Lh|)x(wC%&p`jcXyBXnVjR@#Wmh-h!qbi zrZ}pDYg7BEg9Rq;VId?4QbIfJ%hi1vNRCE%Dr zj|;xjezGbT{qbiJ`F(+8>~w;3!qQI@WG1oL%l$Vs?Y@kt!cuBmc%7s3f3-10&ZsUH zeb-Fv0byM;c?dHZsTzEOXgoSgZJKmbDVhqFEOQGQDVwekcH7n)#b@2f4EaPR^qAxn zsM-6&j`x!XYX@ahvxn!X82Pu@RN%@IY$pBk&2aXUclLCcodmVXSulKlnK(eOs!DU~ zpBoQM69!Fj$TzQEVpzaH3sy05mHHLkn%lvj`hnMbD zc0Onh}c80B~uJ*DYNSs3cPMZwZFv$Gp6~!JC_+WPMxZM%_Q>cR(ubiv}G^?KS zYlx>GdapB((`ObM=0?%Bqi;nq)!t(<>THotlsIFAk{raHPPp3JmVK!_TKlk6fPYnC zF{@up>jf8`X8qAx<-9X88(Qge&Awk1e%Z?V$W!V1@WWPq`WWjzee70+U$!dzFg2e( z_IjQ&&OVx@R)FwmUZ&r)X1hO&f0%|p-hxn@AX^lXAAt)stCBxGS)k3BE>xV>bitl; zbn59~4)ctL^8G!$X;B-fivhfWwkvZW@OHb3${vu3WIE*|%$gJ|>Lp;6skFaDXX&A_ z(RnDH@9e#B`}zXOfxlR?UFqLaxIGm_byS?*pxYrI*{U4?PLg{<8-+s&;NF{P#80oX zT=N+17CCAjW0-UHl`h`W$#fhc$!(Eqo|BC_Td<+>AXMbLxaI2yCP*Ky{1d&~QXj;t zU>D>ho8{iCB#2>?_b|)So?8)*gw`bU^*e!hRAjXA@KOzEuSP;-?Y~K=PhrG8GIJei zZ3GEeL={OwVjPvkWp1U1ZpLLq6@qDX9$kkf{;b!9#8!eKw^$QGWcczdjO!^%5|xT9 zgDAk4MJE;ISAhsrFqO4OxfK&1g-q0Iye0_+F%o3qCS=ilC0i}Ya=N}zKamprRL82H ziUzW{v|F6xUc$pnat-&x5%TN{X(h-H>+qA^ejN zn{Y|f_$Sw6>}OT7yWLgs8D`4!@m#@v`sw=X{lVrrQ?;H_zx~eloC?3IR_rp15W)>T zGfTacq{Y&T_9V{G0E6}CM>=;#IaA?IfJ(bl?Rwh1TD3P1q%tR}A>VtC39>XDN(aX^ z@9`y9Z$^(2-3@+7xFSrQ14zz+_v~4G3GC#p(Zytz!%;YBHe*jQxz+?4a2P{+o$FmoXns-)gn!e6f&lP!-2C&$TZYx8%H5(rJPRn|jkmW?v zW_+KwCeG&9BmFs1wg2x3-ubR#Tt_jp(JJ|mPg5N=0*<)|Av?b5nKz^<*6fOlI zZCDhSy-HIk**L0ZKj2n#72*ABG2}=Q%~T$`C)rqSmjSV^EteWG(!Yc~i~& zk3u%sxD4?Q47wBpklds-XEF5ew2i8%vBye^>LwdK&eB5K^l{2MCa0UTl3B&bHhD%1 zJ#8|Tc}S|Pec8@dW{|zV~ji+cBr;Da&ms)t{95MZwPNqT4&Uh^46K?AfNZZ;;24X$xu0L52G=GcIwK^{>X`@@Bb?wRp258k7QPy z6?aXu+z(A^yqKSfW~hyww>w*n!=s%SyKmLj!Ry1_y`3Yv@0EM`7xX+F*Q7G-Ru?6s zge0!LQF-~+AU=`NKp)kUb2ZqSLRtpe1^o10cOZ15lf*1Mzu#pkK3K!3L{kNFxDd2j z4FKA7zHT>_PE$$wcAaQxlI(d8dfsE=Z*tE`A4^k^8QV8<^VfWBIbNeV~y6g>t0fPx3?rdotf(6j6J-#0e5$QN~O z2}!m#`e(0RR$>0N2g^DS>)K59L#iDvl1}&AN4xJ-ACSIHp2E!HDE1xR>Gz}NI2y-% z4AI?gr_b>AeYex=jG&DlR4Z%(Zyd&UX=&SDSbzOx(Y9J$?PONG2uFC;M(tK`BV(Fx zB}Qb%Vs-?91crW0-rdz@7_|6Gl9~-TTjO)p3-E!M!%_pBwa4h(wH;oe%Ka!p=7gV& zl|0PjV=t~yx6>TS12bSyJC23L4LDuh=t?YK4}sf*ew}H-5WZ*sz4(hv){jrN(Lx;^ z$FobeGCOYOCY-wD1(;!?6_>bhSY)~^AvkiNyLeU^B>O*(4*CUh0 z*f1nSNggE@(C#|tYB?=naik+o3x!3#Qk2xtIg4t|;@WVyiX|Wm@AGk7FOuVEdd;o8 zSEb+7(sD_;#g$u`Onwq`kR~~unIxeFj6SU&qrXy>*c%hET(hhw^pd@xkb&#T$;nmx3{%aYZJYri ze~bB88YF{Q5jH5xr59lzIN)M7jA~2k(if_Lp#@^?gQ}HOijbf(z)xp%hXg7T(J2@n zW**8@EkRDNeX84;+}CA{DTlAiDd~`ZSw)guiBH&?hNgK@%OpgRq^h9K=j^nrsWJl* z%g@QJ&q>E(!{mRBUJiisLSgE0y@>xlSf=j+4G#mR!LNeQre7fG`{$E5Upjr0x_|xb z`)l|9+P%Ma^RL|`dj0cn-c*l&>gCIrJsacS;%ZI~dgASzRXBY?CrizEM`s9~3YAv( zmY27d3{JbTx!kO>CNBMdLej)jy_=j#7WFeqnPfCp#>5GKsf0 z^Zy0e63;eAvLu<)Xvmg?=RQ;%k}tz^xHRbZw zZRP7_uzA+3f0LdG@XImna=T&6E+b6GI_6TuM&dGCgei^Nx zqPT(WJ-2#x1AZCPKz893E+oncW)@6a_5uv!{yuaxhp6)2=KucOI5=wTAN+)j15%g( z2R(|wh=pLu*o7#%b7(0HP~X8Yj3L|Ul9Sj@pY%4=pc{-Z7DQFkzNBiC?8aFFS|7~H zn3YpQ7Sa@S*1;^L)5?T){DMw9-iY)dCpVTV>NV#K&2KKh!Bo*igZVXA+)A?l>0kCc z1tXLB6h*8Jkvt2)5iD-FRVlCCkA|&bVd zVfSsuIs$(mFf2m40{ZF5a4pK$Df&Ke!f6TdZ>F1SN)vd7lDE|Rk|jH*5ZkGSbLi~M za!)m!=1{RxFzKU!sIVl#hb~h3@5Ji>^Rni!%}R=KWl|p`-$boXC(drseJ+YF?T_vA z5_XflicKp1lt*lZn2vPMlNo9W+qReMOY}tiW`uKvY`JJ!Vo9U20lh!;qs1(zRvC44 z;H(Kgux9PwxPY5748588Ele0x!u6InHZ4)M6knc~KgrH=UB;7h{Ta%HmP-Gxq?`7tJP&jzXI?k!q2MLr}G>H?G0@SqH>VK&Bh1EmOm8R6Zph{6vmEX&H`o*K=U_T8 zw7P?o%nFsv0RftF-0R(Jlrji@hi{zaA`}?Oz6&MuPkzR8c~|!9Ti27)$=%L*R$6ra zuehG^tfq^!!hz%3PN}P|#u~_JHk!@GRo6bi@nIqUIIdUT+kVg$Zz>rb7LSGiSEh9! z_Xpz<4x!Z<)~n7qGv`ETnxcC($VL+Fs=>!G`_0=I%u?cVp!&8zDf3 zX2YsX%u*?nP-KE4$r|`Xnk28n(=_3LL(yw73IA1Kp+4$Jgdt!-m|jaYyQE(uSeHV> zwL5SNT%qXXJc>qel!C!PLb73H?Nhqd!BciVMk24w;c~A!(9}&dMlGxhV5>(Md$BVB zvJd&EYJ7?H>4t+sL%5fk?}7_Kn=VL zsb7k#O942fjWd?oRE3DIRE8nlY$Yr?42R>sM6<&|v0-`>F6L2agX|eU-OXWVK+|P= zdLDeE)30-oDwz$2mVoQ95~4Q5DNMRpt9JUe(wXpC$=Nr&1yCm6Ocy98nx9!Nml~h8 zpa>w44tFEqus2`vx~&EfkMxH{#K$|^S{Y^Y2>!pp$xvu-TkY*Pj@ABab^K~)Z%-Yc9PJ+J z!T`GHTNcrq{-)dDs;f&3MCPoLLTFf_hUn1o?>xN&-O}h1Da}S4v_mKJ>M{ZvUE?B~ z-gQE4=@!yq2;4{lx|BE;$JOy}I5z>Ebe&U>CP9FN$F{8<@7T6&bH}!g9qib)ZQHhO zd;T$R?k?iu9_}J4`k}ijqMy2=vogOd0iEus=afV|YG=)2zxHa=n|On)6!2a+XzYAq zS_g@T>{Bcs;VgJ`%<3Z!6y=gkL*&7N|MwR0_pw{x2vB;lf(avy7C)OJusGg{;n09e zRq~e4oagnxu84`bb;@%pRTCv>hD07OrdSZ}%jYb7rn7GL;Keg|DyB5aad%89fG|kv zv~LeI;tggdzA_b&$wVBIQf+xEO{8=cQ#uz#8YZ#m9m*{!zqi=C zvOrD^!bM8oxvGxywU3gwxe^pDRV#nvXvA(&!K3@-RKmlL; zY7YI)#RD1m4}7Y?_7%GYIiv#oK;P}IzL>CvEzzLZ_q9$ZY=GX|7f5`z?!(AZuJV0%?gC;#{yIL<=ON zYNKDUwc~?mBA}Hm5@Ha#s}9Od>C8Ud6Un}B!aedb1g>JH;sH~@`!$uhq-=nN>#>R; zb_z?UZ?ngRV`K#k3Vu5zr@)w?!#L=S{nkBNZ~zX(Co%)*!_$N3iTMS(%9?j~M~l}z zbI62yomYL2lXs;a9#B#-0(*>{Ys>Z}@R;k%@#*cZJEZP+F!^;O`1vAAi$#h7wzj~G zYkOVx%S>%ue@UDM%4#H1EIl4{A(vgT9RVAP^RFvO^Fx|Lhn|6Y&h&~5t%?Nfy{$xgjrgVWS}~L@QqA952u6M z84NHXwtBI*z#@Z+#+@5u_hu2#-@wk41^Rq+x;3KFT_Tc3>btDFQDWR@0^m6-sb_$d0x=R0Vt$!eigqcQsO9dB6<$XxSp%!wAVi)IsMFO6c7H}5 zsH<(K6h{b>0jW{$3kq2g$FJpO`9!XXYkk_-(5f;hg1lV6()E_SMD%~Y*7l#OjVKnN z1Sd-jM1C`Xzz0$xTC$bEV+e#zm?pH|S!NUc_Q#JHh#P1*(0zh5!^ykS{?(LZ`S=K* zXG3Zzylr{B^n*(D>;^cx5$@>9As{?0F86&!Y^7v&P{?3Ggt5P2P`)W(H3(8)BCEtZF^;J+En!9R890ROd5K&_K^>|A(#UKvOtheBS}BQdmoKNLHoSxRW_eeCpTu4o|=Q@gZ4&->Ot^EcgK(P>Z2t?%Og(()Rkk zV@KV0It$bGh4VcB&l?^tkXOD*>)r$#BUAE-huLV}+PB!o)J<$R_eiS~JBSX(?U0-=R1v>SKU>^JKFQ!sDw4kx}YFv z*0G`+BF&qBprw##;l6N9m(VBC+GH`rqF)nL-T$gjdE<%_CL8zX=22%|@aIr$!T=k_ zN|YQFsD55uyA`B5Qy`(FZdkeq1$RS5kc+cfJP5jDWqh?kiYRH00lLILIJq#G2p(<& z?F;btds0|8AO*S;#sWuyB*U^+CO?TOd{k%78mscjb`pg&{=$3HiY39_Jcd|Dt+TE1 zk=*q&(i(QUrsTOfm{Y<`xI}La`g8hgGhD^QGve!AE0Z$EmCYm< zkBNxu{0{>VFb1WZ@5=HkyT9UUs1cs2MVw)Gpk>QTB#herc`Wkmw^^+#8tEr3+xNA z;{%BAm44xOt4acibD4H8rnz#Yr7lpXX^LMpGd{8*sOIejKco|n$WK@#9~St(tZ&`o zFoMm*S3h;SFFJ3X7#~0UA*gb$6y>{ml2QDS?^9a!h$hOa`{TOZSgrX-UogBY$cE|Y zWl`2Nnz$6&VvI4jq(4ItYRZE#G~$}R`V~Zxf>99XZZ2!sEFQTIo_uoF5Y_o)Qq&?- z?gp~gvgZ_zSh!=@#1}T!ZV_^N&R(CgVzw|sK~yjwLxn*;_PF}|L0e4O%n$I0fXIq1 zrU{WL(frH~)2O{oOIH-$V&k%YWgkWnn%g(&-%rJ_;W|K*0AZM@kxIL)@DCM@fW$X1 zZcY?5_A|-dd4W}gnq?}6W|7*j-z7a(L)nxmE~2Qv?>v7DPJ1&2+zb7KCJj4*LbD(x zp#U*COS#&cmlc(MxvFd3EF zt%>te3$J1I2I?0ET1+~q^WWHB1Z0rfZYWd%+os{ESaQsSVbDYPpx+JR8s^f~^^g;1 zCu-*mSu~#rLB5eszt5&E+H&1?h4Or&2L)i$E=BlvO`QuHOfMqM@*ae5hy>J}#+~ft zO7yUOB3%FYD081xJ$oy}S|rG++L^w}+LbL^ILRfAQW5L|v0Oalh>`zTj&pQ`N1mF*d8)nmcVy`Zdd%_{~ z9!fzAlPr3n9w-q)xvL8yK>CbrZJUE9caz3r)zZ!F`^RGkVBnku8??(Kx1*AUO>fB6 zVZWgb^9Xok93piquC@wr63J0mqfvevW3UW6cBbaaE>^8vVubjmk3}-XLNRAN>-~G-tzRSwJJ2+Ov=g#0l`K)BNAcba$&6+NFn=6e3 zo`GNiu1MpAxj|#azbozrR4Y899C3Vj`#%R(!dY|oPfO%){vLE$8mrr(2sWdC0jlgM zNf4gez--(FIr=B!606QCE6i%w2`XpJqvWPF*O4l7hqVZ^XPG?T!7-cC4J0%<2Wgm3 zPm$ooh4XB;A+6OkctMdx3svDniwVW|d8!IoiHev(%DG7IA03AJvK3;i>{P2eRw#sF z-Ei1Pd=u-7AJP-Er_dbMJ;1;MuMZ8iw8|W>JH3dqFOgr^UI&7#UNf5XxAkldK0*t* zN+jRsnk6P>VqQGHdI7uMJpDzqUKIgv-$&)azq<0c*S}~fJk2v*Z$2p{c@7qzARNTm z)+}r$^V8WYoaH^bt)VCD?jIF3XY~?Bm#OIbk3CR_fBv6v<&YB$>mnjQsf*po5;@=2 zpITxLJjOJ%K21pft065}A{F|UTgkEwaFHIUb-m^vjv?0B` zxV0(ZI|HLtSN(Rd#e7JrAKNG=+MQBX=imJ${K(ZtuGq$CyyiM)y-4W3_L^uBhxFU% zhd6v{kTi`>#f{j5(6fdVSZC;F^bLIrG?fU^ba*kc&LG)q+^DJ?eIXMB7t_fr7pBHC=1AGLs(97O)aZ;})p^}XwKG7eH8mOt{T9O&2QVRl=&uLy|fxxLWh(Ku;GtAaO}hWvm{!D^`s9AEZ=YT~Nx z@VT&ajVMYL6eQ{y`WNg)82${sy%R;6&cCL6CFK}OxRexcEL;8Z%5;So>z4I27TvO_I3c)<7ab$^t#SyX>6r>jbtFGDXqks$3(q5oaD=!1**J47#@(|Rq?69Ua4X0 zn*@Mp8!uL^9!YjI?R_3I;ZD;UtQ)uN^i+OQvznJ}B~P5Yo1NrD9b_elI`JF0JJUGm zsaZvQRXKc3jMrFd(q?|wzx|v=`gNGw#+IRaHYRiC4SJhq{G?LkPVN%VZl7_yYxt4~ zV|GW@4>T!o203Q>%+1{*w>AWnz9N&S_oA1{_+0Fnu%7Br;po#%6908QtKt2`KLALz zlk`39Mu++K${F#di^0hT?fYHoHN2b9DYPHhDXM;(R=rJ;U_iBuoU%|}+}?zVQ5Lc% zJN6quAjaUqOzF%0^9tR%`NqPeQz53cMwF>^LkYn&0->{OC`fXGf530GMqG(7$z?$t zWy|Vl;mror=CrE5&X0xQM~Na$H|E^WgN8vOFlNWx6x4s}B`nO2jTh8Wqu2_iw@TSb z1e9R$ohyo+{LVgL+y?HM*u#A|IA1u_%99k3+0#5dwUji^F34=D%ou=z@tZE;Iib;@ zR*ye~QB9g0KT9oE`U2rn9)8nTjNJA#p(}3&lsiwzX-}MUi|Jl_b|g7$-GQ8ngSgib z0Vbnr?YXK}N?a`w1mw$_+Ux&RV9&BA-O}YstzGQkI#mRsA#HY}o{2$dh&w#FEbFLVb zaYS4afOeW=A-yc8+)r4=WDQi_6jcVsc%uy^HfT{^cJlIYaB=coVPZ5Ou0A`Dm}FL7 zO3z*3`qF18(z+!Z*E$tHFU$>S@G2t)IIZ~;Cnl*ERjL7>Z8)@LoD5pk{Q)0{d3XG4 z{hI5k&=(FN>!>3f!~O}Gr1p>-h%=zpzeVoTSYa-aE?AfniEdEq5L`)GzkHGhm=$V4 z@4-NrlW7WEjmm_j()9rC7$UzIYJx;}MFOV!6yYe$Pozd0^+NGPq|W6|C{Y^m#Mjl= z^||Lj_8VIycOyghb|PX{K^e%#Sfv*&)1dxT+<$>O>@~CN5kXm-Un^_XnMe3Vy?%lc zv*@XFKl~Sgi#nPfmQr(b!)^Wctz5Y{UEPbs6(YpD^r4}3l=wDag{AWyWa;d?m*2h` zwlV$?zjz^<7<8UE3Z@FPkXy@Zbbwt%D#7O@#Tq@n4dX!>- z`sNNTeGj1|TiZlzs+_~BBl@8NSM@KREXX^u@y+J%lcPOit^mUen)pRx(0^6Evl`F! zD{Uc%RR!zYu(*APR5Fi=F@sKV=$H6|;f%q~i>__rxH( zO#j-T6Xg{yRFPrkP7mXRhEYJDcG>ao(?CK0xa3z%;CgBc_0S`qQCf1Mvf;)tlQBin zed*O-tDw|?O03frW)_*JP)B^w%z5REx>f#&kzE#|jzC};L6=goN$2s~jOi)029~eu zXg>Y|5T!GqXqEH^qrE35{jo^f*-;?}wY^^-ctyBdjN@epy^l$>RWvcIQD)+%L&*x-&645D5aJ|2BVVyF|TAo4f%T7fP<55G8>xJ zXw9?o!QkPY8*ur{t5Z|$`#cJ;*B!gF#~*|*jX6i-c@P>do$CR5+r)v#y*tv()}Mu* zV4?EOrAs^8*wo%w*e4Wa*3lY0WZGUH+D*X$Mw)NYNeU{LG2QdSVBUk$KcUXSQmDHh3qY~p%fX_mi_c`=;bg9g zub&uf0_tftbjzFyZQCFl*yx$#;9J|aWI1&RIodRNN*tHvaFHycH;v;+cYq&2(#O(X z9)+VbLEWC`sdap(NlKJuw&AOtzF~G%;YJO$QuKloSKp7FuGxhkUCJSp1;jw=8wkj{ z9h|9TV>y{r(T#iIMBqZQd@Y;mf+!1o?pA1y-js;E#;;-M0!}T`f#GYv?`B3Mpz^JB zHlVtRLB!d}57-ZDwKgHTl62zXJA7-4T!H3|$Nx?7MA;x&L#0In!0rTxcsgkq)EGI; zktK7CO$SW*{jXM<4$_5hY`G$;=_wLJB^gB8=z;o#V*%zR{Uk*{z-qfv3<)gq@Tn!|fW<&ILky;L^INW4`;GWfq2rt+KmZgjq5Bo3S z`0h}8P+yuBYnbejQvpIT?O8}F*x}g!_g4oF4129xxEIBCQE<}Qoh>)tBOGlSW6=->y-ZL; z_Oi3N{GwIpwYO>5!C13MNmd@N-IEczwC;FhSioq`Ggy>P=iECS(VQTU%sttEC7*po zdd**RJSbu28m+QrcW@mCnFv8j+aoLX1kdzKZl$aj6q>t#K%HyR&V<}>YCRz-Etplm zyfY9hl0Ru=e(@1=FznqRbW)hCFH$XD)OH4!NB0x)4gwnPK4%{xeqi(j@vyetti_)@ z@Gr$q#H#Dq*`X`D(Q=hbIUzki?C+f3xWVFLj=V~tXX{yBT;~}GlR80EDkucU`;%Ic z1nyx88b2Jb!A2=IcxL6!mT;pP=vtRHIm0G+5B^pLy>ZqhMw(aa#5_xmDoVF~Lgtvvy&Z-m%9*lXfARXQHV z$SFM>x`#C{VWWDYHA=woww{sOccH^QU{4O8Dedcixg$yp3g*5NW}s1kUoMHJ6i^>t z?H0-z9m+~vWA$mTg4;O9Jz;WPN&)xwWR%Twn2DV5TSvg$<5wgxvs+}U$A+R~)`!FS zN4OR4&R}D=f@}ZzPlgmsE3VEaO2P_u( z>4Lgh7L=eyUU8{RP}{~hwso7kh2(vu7nffS@y&@k zhT@IiJ)4lWH}2W^#zOpFx5O$hevm<$D>M>F{H6hXJ^=TXV62khYA|n35ne1aS7yin zD1Io*rz9J`{Y&EIW+ws!h7Yt3Ig?#BeqPWta#SL}bl)PMQ=Lf2uQZd*%iz`B7*^7k zNog`H;`wKZJoEPu3MHU5+P!9h+y&a(K-Zi_59F+I$()8<%B9sf=p#kKqbE*`0q^#= zPx4ZmBxrkcj!ckaZF0ECf(5@O&TSUoyq*|0SUce~0W}3BOmWqxzm5Pv)@XE{@OgS5 z4?~cO+3ZnRwq0c38v_}qtcqNBUORjlHnP)CRl zI5-v7VmGRq8+Zrw&RjHx?%ll9YD44OxchkSTw!7)1t*FVH&wtaaqH$cCVX((hRfy`?65~E~ zX=ksk%<$x8@BBcZ<_KL;5Qx!N`uKzMHm5A~2azovb_tgYwg|&hxIwAQu!-Hd{b6Jm zog~db_bwK(2~o&8TA|gc)#<@=&h*QW9~?M;NPtSs&b39+!RYU7jkd`1 zU#{IgkLTfw-2LZG19(nDSXl1jjK2z*tWxlvPc=@ijU) zHD~=hZzh@0{Xl)~h3)du#22uWL%=ZSJZ#7Se`*rEX}*+U&d{4MEk`CuL{Y z_KqI|=v{=n`wBt$t>pZ~J`29jz?zDpe&T4YSO5~#NM#fJ5BcroM4R|%r|_9Xq6F_b znSJYvsZ@38r5|A5DE)&JN7lU_5{5H%9Fr&p4I% z5l${KB|m`}vVCJ)orJA$3C-~KO6Z0Q1^qlX zI1u}~5LQ{Xt`j#+$i$UXng6)@fys zD)j1^f3U7(J(;IxXtpz^SR-@x7>pMO6!Lg|M~BB6ms~XnZ|CkZ1P+mYbNkDC#9qzM zywC5ZBMPMk=%HHif5Nd}RM|aQ)b{#lSqk#FR9UVV5ex&)))t0`EjN=aEDE#AG{&4k_H#hq)xaGRp|60wy>3xcashg?V+hfM5&%CDGmDwwti5KC$B zf`op|3ATpKTbp;XerP%s_)HZh)#A>A8ha)TqqEMndEEFeIp#cpa`z9L1b%=;WhBXp zHta{F`HX?;kbyVN>}Dj-uXh9IaG0Jo!Fs06(*uh-`(z+<+eP5fM;drwntXk(FBR5S zQi-y0bF9-|S9FcH{!0d+=g|~I&>i0P(10<9*_ie@(Zab28SQW5qq~%zM|m~%?$Ij9 zV-;_>Fh(cHPm)$UF2rQ*IJSI0Q4?=&&$|>=7Fkl8GeFd4TU)s6^@7cfQ{)phfYE8|(UBwVhSV!HOdfaO!P${TvE5D&;>vnWeURtCC>{`|UGVG4=#?o(eI~ ztsWH{KN_l45?hHw<7cY5>FZGJ#VE67T8w*2Z7&t38`jA036@BFfmdyrQDsJq!?N!+5Uwl|@Ft%Cf z0j9B5oU1Gahkn48O@(E=#UWr1btUh^eXv4k6bA;#JuC_WzYWnF#_!x`wPQ%_&#jN~9p#MZxrOrsa@4PTy~*bU9tK<6IJU*( z34E9ci8{u)fvm+=6GBgCj$P45!5DnW5fGG;GMD~uOBTZj4o;{8zi{(c{xNac{OVC? zwSLqT9{fyGB<@K(vb2it!pTf=mbH=)nfyXCA9g!sf$E<+DPm9)j(l%7)k`^}mSXvNhFGzfNG;AgI^I=EH(bCQ0eajB7=I@#+ zoQqJNS?Dn3Z|7UdikxflU#)cecR)4Hi!#;DJC7QfsEGMtvky?9Ee(#l9oYzxo-pn@ z;z(d5{;*bzv6hI6idL>s%ko&m_izKF?L=P>bfWLw8|q1|vcSI;gXnvNZ|sGYzo*RJ z8}QhHpQ$)95H=T<>?UHCZ+m?JjUT6Voc8tWr>RFbZJT}&t{FDE-wz$vPDH<*6o7R< zDQXiJzVCCQvQ4ihMx-Hu-dcL4?WMT<28{0i{wbn}8L!x>E4#ly+Ez z56OA~(6;7AbWIg(bq+ldy3JDcy|!*eXwBw6jRxZVDvvNZPn0ds`x3Sjme1jPb=(fQ zX1)CXMz_r38~Z|ShUCKOSrz>07mRE{$qvu!%{+_aBQSJ@Z~giX=G*nNrd^R2S=IkJ zda|7787`jB75wCXDzA}Wx=H_*9nruSZ=Rs+Pu$Xq@vKkZ+ulz}F<}^#qfZIVJPgMw zd-ZF|ElZ4C^?t|eZPfOQK!!laW`4D@eLA?en@yVZRAB3!H@o>x!XgNOGSLMqp>|ej zFQnl~?)z0u*Xl7u=twx{yvjkURt^-W_1ZovqI|yFXyj%f-!fguw+nUNuL+z0>qS%) z?xRlvxqI}U^lh8{?ZLy62_zCC2q5Y)5>8+k5+Wxp&U1hW`-oI1^NDKaR<0#_Cp}rs z{NP0us3zNqVO}@Xl!}cE8E-2RlPvc}c2F?OZ@WL{INL3}n8f-_gq_IwcHdM^8@?jR z@dcQZGf&e$ZS8&=A1XsD#iHM-m~C;*pRvaf?uc`_gx(#AaxGaysZ?K#deU`cu;@Z7 z+I~*h2_EfaBz^0ad9S=QEtl#hD&!#H_I+e%@zp3zn5kH{94Hy&hQNF{uj;!R@KZol zWOxvIKk7Lg@V%TL?p6>016G1{A3Huez;qtPvcADm)Va7v%hfLt>M?yFbE&&d7ILsM z!89pV^2R;0T{yGG3D16~Oh0n9uO$zUR&j7y*VH=!;G?ta+xznLzedq* zF@(Q~1$x>~Bf%gK2IEFeYUujsOweMc?Pe93oq#`Exltn?W#dm~EPjVh1=8%+eQ@~^ zs#(qJP}FI!J(?P~{M+z8ThFq zz}5ABgFj7(Z?EZSh^2X%US?x=m<^LN8&S<4*BFk@Z++>e)-R5hFqx*Y)~7Y7%*h+f zKE*uWw=#FK^C4P=(E31h)2vO36w~Osi$zZk4iC3VnHg#AjNe8cQ1AK4m&ah*0j7B; z04zEMp&c9RiH&uSmSz_@BX)Z1**zX<0F9{cvsz#Ia{1)$T;e*`>z0_6AGeUw#18M< zv4e+;3#~hS@<+D zE*-2x$c+B5sx!;<-habnxhxFp#P_g<70e`o-6aR#nL7feJx5B0dZ0nJVFqZwYCv>^ zGn_{}v)uL?%dg+ws6RDl7 zG#6TyJ+JhZA56y6ne5Ox;23f2CLII3Th4Qpb&*%ZIhtok5T!`gt-}>e%e>NNyJSxF z$XP_m6UjxsNXit%M*MKw6g)2%$b{Ei9F2v~`X$e1(ax7eN7{lb(WK@pPwN&^kv;-L zTV$Q{N_ke?jh6&I)0M8CY%?agswgAhi;%~y_Z5{cHq1Ig_ul1LqK{yJ{y^tqSBKf2 z_+X(SIo`$uUQQ+}2A(=Q1pb?7kQoWx-aX-WDU5`C-hlYtx|~Z zN|(YJj_JaGa3%M$uXF#jzOKjCTdFTqpL;IzRywk(^_TfKl`Ui5Z{Frq_Y0f2%g)2U zy(w3KQa|Ks*=||k&T`7-7Eow$THM;}N30(Ij+WY~k>;$d9&&T3zLfn&mDgX;^8hLa zOp6v*EjUYd)3R!&*XUYZcUxax+TGY5do&Gw+g{M{ExGoIMlF~j+P|($`r5hO$Y*rf zbnFJSiZy7iq9&VeBDQBm@Wu9?f|Ew?;fP6jkh8p1MTk)}7J(yzg)fMdoot0zlmsk& z>)3Qz3``H4ygr(WUY3RXmSd@&i4W{kV(9@zvO^mAvXV}AHQ%3h+#ig{1H16+{`_Y7 z+;6oI+?)3K2vMS;`x)>z^o7HhB zfhlzWVV@1xceQ;&^;!^io5zC^MHp6FlLk0-Hykkc$d7a1UjkK=tP(Xs6o{Zp!@*nm zxTzK%46HS3*a!U)dtsRUj&d+{QsV|9oT0FHe*)-NZgyxv1;Zt`jmmM+M5=S6EJSm7 zs)t)))abCoDuG*F4wP`Nl(++W#;Q#PLY*s~hic3dInFQRM6urRz9Ynx-VO%5L@IpR zfe=G_PeN*eRO5mrY}L5FF+%yYQlbQiXL}YRkOGq5dU<38YQ=~;viNMx%z)7)p6WpW zE*U+XiP^1@_d>NLrI`klyV)ybpdj`IdnhrI^9voHkRswo1WpJGq7tKuAf{BK0{@p8 z7Od@!=!wti4P~?TUQ?;T#3N>h7q@4X0iC%UN-U#R7(~!C78}+*7bBaK3)Kggd?1A5 zkkp4l(MD93OqWG3H;F{lOjE+HT-XNrtb~DiiEJ&P9zbw%5w#*^ua$*G*z~6y=xE%z zr@0?+Hw3Q6{42NFI6yNPf_uA5F=!V;z=9>vWBl?{bwqVow@B4kSkSsmDPRxP&L9OI zE68Ez%Hh@NA*|{)WNP*o2)2>6%dnf_k3+>=Tv4(MF$7<)9GnObiDhpvxInb{4G2=i z`Up&g@QS2)E((OiNgM|~=_ry$af@sV+9h`b+Fzc;2408Syb#}|V-B4P6>`e~3d?Y< ziwJ4%uUy`54nF_k>X0mCx2hEgEQZGMLF|Wt--#F`9Fhel)=+KZ6$*K8IBatcuT9oi4-slDeCtYUmFp5{m_1D=veZ03n1!Hd{BCy~)*O47w2WsC<9 zy@8%&5w8E41X0>c(A+gd(4v)tG_Vpi(kO$$3<@HQ;VNJRskKFvwfo}&^PN|x4W@6R z8InAfkU2!HPD04;b2Sz6u?8fnU!GK(q*UgrC~^Gh>e+r9ae!b3-M1{w!K+&-oJZ}u zC?~HTK=1|nEs$YV6w?&YY7LnUq)uLk!=%{&6V@fGa|gh6akuY$PfjjIpDSNOzb_fg z_VUf((!lzSfG*aq73$D$zG4tb<`y~HW_}+}6gqlrYUghUDk?>sKa5ekc-O9wX3kNR z2q`-;`MrgcU8)C?A1v}tnpz*#+Up`+>ZlN^L($8wE*AzSgQ+V%--~;`ZhueS7K=P`#CY zUcptEN{lhf;p*u&fxXq%MWwEqnehuolb!SWpelr2U+v;w&ik#O+Mix4n^v~*TKZp4 zpKGe%`byHOZ=#o&K#DnS^jE_}^}dLc>u@2xhPuBlb#4eRZ+1QHQMzi>YF0S@+#$9{`KY}Ii= z#7B9Cz>z@J)!mIM9A8Z%aZ%vF7qteTr7L3EuiI~;TWY?*nu6Fzycw>-Xs53U;mEFv zRa1ct5@G2k$C>x;r(4Z=qa&iUVK(y+!k5`4I}9tv;2Yb2tLG62IRJAQ5*cDltcu+s zem%z7Uon5($uxy3%CCpsIZ`9kD9{Qx39!PWT{6X`17|yFgc;7BF##hU#8d^;I!83L zwMT{(U89aoPUVEkVp&x7ZyPuV!S~^_;v`t1Vlg}4^O1u3Odgll!aPtjdehqg)A1mN zGH$}CrMz`xw^q>Vi@O#H_#kXolb&h|XLA!9D%)R#PbA4m2<>a4j^vSJO-t4}9pAFv1+{8llghK)-kM(GHQs9p5kL zKjZo&wD3u(f~vV_6@Hh1tKb8X!r(RhnWMb^$Vf$o_hJjw{*BQhG-W7)4z=O-c2nSH zIAPP`#XL8*rq3Q&mc1}vPT~jFC02k>6vMr`KCb84Gg@LBu(Iyw{QK))++;HuVzQY? zG6Jh;^VK6*coGdMiG4;a$Ev^0JsUlwjWOL#aJ{?(FjPsQ!atAf7b)}@{j1BXy}x#G zFuBOKIfcyP2i-|Vb+?h8=pF~|qxo`u+z*y=hiKt@vJ%YeOhK7iqnUN5)Z}+Gv0A59 z$Qni;1JjHAly|hN;M&acsjw4{kR_u z*@Is_SbIk`FSJj45Acn>yDNc=>xOIOn^GKap4>#lV9!LfFX44iV*z;;@!` zkH^<~pJ(GCX#F`6?xV<5@>n=TB;^Vvepk|+l9))Q*3m()R5;zrB%L7x0w+iuN#j3k zVb7oFRktUmzS^9psFnivJO8}>DPdtbAq^ox4T#@Ako19rCeJg-FHaqM+5^m|`W`np zJj6@g9!U^Vu29DIfBj#he&gH6U(#i; z68pWzoXj|LTo*JbCJk~59r;d*ozKefmybRQ@63*+W|>M{tju1RS*eirB?4zkMYP;5d&VP5p!yGo-a zmj<46+Ow(JeXM|8dJJ9Z8Iv{a^s(l!gzbqEs`F>0S9Ex6$XCWCvIBoPM~nor&@{kG zg|JfAEze^qeER)`s4toPkIdyQ0Brxfith2rIZusScXHz1v7AIS#H41w-Ya+$lGw}y z=w3|d()X(6e7=l7RT)e63K4xpg0H|Ab7a+ta?LlwWY2H)wUH@;VPcZR0p77ZHDn)5 zPYb0!cadIATb!offNP6X2?ygBjD3QRCWukc7p}rRxBo$h3pQNPG1P3I;%rauMIa$k z`<{6)HBXUuR%tw4M~jmq$g@{hVhyp$gj9!UO-BAoEZxSrj;(ayBAPTo@EIoOEcDc);oQS~h|Ci22G5qjCL0eAI_h3EnK>XZ z$rVjwqC}&TNmuN(yw|+~sP{f7XQ%U0l(tuPTzbgq-_{Cj6Q3sp1PWf*P84+}pRz3o zbbccLlcz<&VL^$=SNpJBwL?OrSdJFgJSF>;c+^rmgP-rcmg{{1SFScsi)aaW6C7T( zSGxp}>7YwMaqoFP=ATj-MSPat4i%EjES?hm1WA15z3O)iE5u_wF3s?AEo?`bEZ z;)I2^EzFTel8=VG(}^7%;gUEa{8AV4XMdnT)6&j`NKMq{t2`+YHGo-{B`ln50L~vK zx`I#(CWcSE(@3|cZKdNV1wAMaNne-%7uz~NU!6Y&Sh-ctFaKtR`LI`4oqF#`Gkah( zqhLMGnGIB$5%hYtH+SfuPv*?{g4GjS!q@*=-SZgVd|&&j>Kbuudt^g~d+|DPnEj&Z zy(m9iuijO0tB_04siWhb%DS)%n@8v>2V+be%1O&FY`WPsEa z&F5rx8xy*ThVk`@>yLI}= z?J(%mU#BjWN+4|gZg#IebSd0(lY0fDa@ZafvV`@XiV{wDn?PP?8M+ABU7`Zh7+Xe# zH)}a#J!v@%H05m*Z;xGco>-^ZErB5j#!L-n5rU>$zqXF84;?mqAgrKgt~OGk-F{Yl z`RnQV3DGmMbd)tawz>tm3^3QV(9uJSOyO#4nu_WW=kqJ-LGoSzrUk|cWGsSXx!9&i4JNHS=L?8vA&u$j6Mr zNN}<1F;^R2Wgwu~1v~Q9msA>Y)3yxrzl)p7K+zF};K=(+F<_jB@QspiH926u&`WSC8itMn2tPd%b#;(iM8{Vr%qX(gx1klz0^)f7VEkAbw zxY$D%3~B>M^eT*hkiJvbBQpkbq1u;{iqeMysb7eyAur6Wm=T7J_PQY2o*2Z6lx7OV z2Etb#WEWBx5N62_6gsSgx(;(RYXC-|!pw0(L7iCC;QB{Z)oL5ZVSt;%PLWQWnTscu zMBog9kO#VYD6U(W>Gif7;)_XB+C z4E8rqXK9j73NiMM;Y7)_$NTc(Xvtyc>>2&0ib_xb%f~M&uZ{Lx@3V)klf?f3k3ew02!ABSQ73~8 z=a=N0tVAlgF=)WV`!QZr4Fpjtm6aj2fc8ekp@&8Okkr^D$6h*I-Z&i2vOgrZ6^sJT zk}uubO-y=y+@SfPbII5U0VtFbUV`p9Y6e}WkoVh;&Wy~a3W>ov_J`y~-IiCt`)yii zN4h$FNjjb-O6Cu}pL;;$oiy;>qw!`7ch*Ztm-35Ps1U!}3>)%8a(DN)Y_9zwxxgpe zT>C?EpYJ-k_J`yiZSF&Fki#F6x_JaCn@4(V`#7e3owvQci%&Y6dkq2QM2ekJ+L0E_9(=kvK;XBcq0Z!AZhmAM zjdY9bGZd2f!%H>eaDVzGcr5mZpKHeB{r1a5P6uXG6hi=!0{(T=%#fU4UOo@Ve0zCj zIPOocL}Z&bW7)zpw6$d*pSUIf+Jl!zo39D{y_7_`qz zI0ndhz4=c(r25m|6?{#=Z@5JH4iaBku`!Otiwf@2(<=U*7G zs$3AAZEYNgcV8`&-zq5Zv9+PthgHAz@%KW4baP3$qO22{Dw((n)ZFbGVE@~W%r?#_ z=nmUo6b3`eNVsvz8D`R3mR`?9lnQU9$tWkQY5gMZ1efqCx*g~M?-Sb5zQ{Eko{8|0 zf1=>=%oIQvEb?NTGz2$W2mSXgt0efHx&E$-Mg1@Y)S>=l>lH$AKX^&7bltw*AW7BD zWQZx{6`@H1!2UHxp2oQ3+5VrGhld*^ykRdQxFx|NNlIdMzKARl?lNm7bmUEf>@dab zbr@2Ju=jASwE#B&A4hHKFsLXs=wV#0SS@hIT6N{|qW897pT%JI?&E;wK=BbDX3Q@| z8^|KEY3U`~B9IxvyVywCyZuI7FEt0MGDy76nM_*0lGxj@3RSm1^LpxLx_u8H`~CVJ z%_i(HZD{Wuiqk6tU{mwDq#}(0zA5TXdHGtv*+R{)zlNiSt>CXj9Zyk!t`4mm0GS2Z zg@UMXg)O?B!Z;Qq>0U5E6ixAKV2?3Qqii@_*N@C|naFuO zA4VTpl17Bt*H5tC*0JcaT0bGEn@n~pEm!+l6gV;W!Lp~H^>Y7>l|rpmpL~ZtFZ%C+ z(IyG6rlW|kpxQV^Z=n^wHx=C^r^u_F&22a&ZV^dx3hnLg|1;4JB{@apA^6xSqLZ*x zk<{Uykyim(6sE*s3b)e3cBPf{W%Y%TO6!IqVDo)C;G*|}7Li`ngd%UkdrZpRz2|J^ zG*zDbo+Y%D9i6SLe#CK3UQgQB&S^%SJM>03S6*L~>GwoQcj!kTF}Ew7@AsxtCv`YY z5nSt;i+cO%gXPmRK2{~R`s$B50orS`aReDUj>6ucONl|V3HX%USVSxh&apFCMne(S zoL^DD92}xB<@i_i3m&Oo0dMfpt6Y|~iX{Ix7-CRf@$lIll-Wd*1-(%G$FhUSOmUsS z3{A4m?^x&eaR(zk^V25@y16O|7SZoS5B`DS64g>^VHHx?H?O5Y-e^NjSd57D#l^ma z%UA_m_>b(1^&0>preUbphg{w8qAsR{`JA~96jgT?GZP3 z&XP02#ERSwpMg8IBwo0=tq03nscvGRd5Z42P8X9S=oFNcbWsh}PFbCVg~h8LDU1Wq zeGeZMt%v*UqCc)i!;2rPg&B+?bOAm90yS_1;0$;eQ2!i@gM#8pSxvrX=%tDtck~r} zs$IA_=U3}Bo470Vd{8Kyo}CuW148Kxl6a8@H~em~um$*iW#y52F$_a>9JNPRs4MgW zHH2sh%W%mxt8#Jr$Xs4j@j}JQu~g;<+PwDQR;93t<35QRP(Be3$z3SZeE8s8Mo&dR z^_`=B4qmFgsMTrTpzSpbKcPIZoS`#t8{-u;0q;i);y6@#Txxgh^EGNY%E5Px!Qphj z$2T7v0)y!#d|SQotj5v74xnnrd8D_M*+rFr2Wx2qe3U;dv%G=D3iGG{vZ57#SUYD` zq+ylHQeFGUFv|SGnij5$tE8!WZQVbx@vJTjppz=g*3bMV>y(Z!JM9r`J8Cx-$Zm9W^x%}07@ zDz)6iIyovU%XXPfby@Ct^-2g~{e&o|v+4&0m;`#C(a1uttYi7Lt~V!Tys(5{KWf*; z4kj^(%d-*?l&>udgk48G3rjvSZt&!;#p9}Ph#6nYgWfqHFbu%TYY6u`Y|#naf8J!X#T0~PJ27IYvY??TxKq9+WdklGbw@E_5 z`oJIZm;dMrMSZgPr^{#53m)5{!5I!o!GKQgQP8_7Q$*@rf9a3OLl8d34np%fw;RUq z*c%gD9}L;0zx0Rv9Zm=O zaUbcni$00yKQG*WhNh>1zF7j)!8SYuzmxf%KqXD#t)eSwbwLIdRuxP|Z^)1myMkUo zuA1R61Q4k;5E)b#{;25goWl>X$i=X=Btpw+DM4h}90N?^_?Lt0O;)y>ay2+HU9>%x zpz|azr%mZtYXcdfLY9@=Y3|?)lg#RLgh*N^+r_Oq$ZuXhVR;zJn(xu?%Kr%k&%(zk z8k+QmsLj2_S*}7a*zQ`9lNMKdziHiGU01aOp4oYrd7_H|qfy-bkSqj~-5=oBsp z@ugI7JsVG}?3a}WlHQP~HIgo$Xei-DdDiw))udS;UZ*scC@f91!U0S4Y;6r#wgCfb zwsc}*Rtb7>DrJ$bV_1x-H*=@YZwwkl*3&RI>Gqwm`fS7{-;~zgmEDyw8>DT8$o&}l zK-M5lZd8fIWbU$q9-1-H5zUmvQ!Y!3!v1@pX-A%08}$a{NgKVFjXFK@HjUkBJz;_xF*wMa z7I%AzCWSb`4*FzA@o3Q1j(m-`7JN|?2I_-6F0ri$o+KNcZbJveD&pYCBO%6za|)Hz zimjY^B*moS5n5F&f0SoEJ&T1HX`66SVf+66UvbXeK!8d+#Et*L74-GnAq*{`K?_kclK&Q6dVzGiMjN1pVF)uk5 zd|AdO7Rhm`Zb4&BazW(jqh~`WQYtn+Namu-O3qA~2yNousy=Blul6G&d()Ct7Kv-G z>e}TaqcN|wDw{Ur69E}`u-X*kP1aj?ya9dVF%UyZ_QD$qDI# z&)>W}+BrNpI&sRHG+W$NS1-Hj>b8iadp`9d@UHuf|?ZsIfbv@HE-Wz9zdjSTj&B!%xd?CJp9B8~!e*-@aj1w7s6vZvc@3z7Lmnan3_ zBI~I_GJhm8_I1X7BI877I5119-RYY%W{H=47_$HkUo!=47GBu3D5> zGFhy|I&!D_Gm&Y!bbcj@L}nAB)DD=nPi+nNYJa2(n4Z1gsbZ0{zi$6Y9qw{chdW(V z)VRwDHSTml(&R3Cn%uU~*3T~qFaHE3%y$a!S!`#sEP73$)y=KFgRM=x6XeUudUJAs zmn7!Nr=Llh<(!G1ekRl4lFdJC0W7|||Kb3$^`}$&HQW7y=uGEV#y(+k#>RT-4x(X|KEyQq<;>xyf8q>&`lmBIt&3kay79{MiWeeCJ?oRI80``Y3;27+b z9fKWPKx}r(Vzc9{ApwB{0ec9+doJ)MjCaaO;~j6N8TLEnZ2O(OY8LM%67wpE6;HAX zCp#w_w{gqaI#VxMQk&tGwHcmMM_d1ujrCvh5Kuq*)46Bf?(Dp!dxk!2#=-Od;SBz8 zFSx_)-6Oi<@WY2=xvm9<<(FTCLOe(T`gTvh7FQAq&_9v|$nmZzLBA43o&y#<-rGEW zrAwIvci|!Z^}+TIt-pNxL-pMO%b5Mdyb5}Z8L2K%H)uQIkAL&ay`S7eb6nh?9uzPD zIE^9Ai>={b4^mGK4)z#0@yp9X7uB4FUryGElX>E2YbMaLgE|o3q(}Bow3MM1KFwB! zUzfB=09#Q!{#KGPsXYuXCYr!38v}%?Mlj39E}@w0bap$K<)qQax-(jOea$0mgf)y`&>wP^Elg@8>>h0}9uA^7 zv^M7FAse+z!Z|Q+6o<_!>XBV~WSfZxD9IQP#OFmzN!(nlw2%~JoINXv;Y67;Y&$IF z(_)eHVRRL`Hb?I5{tMd{C6hQwN-pVgJdsZnrX9f3DcQWnWczG_%uqeM>6T*i# z)UTawT{J^u8qWM9Z!L#(5?dVEqOQ%6O`T?SM8J9GLO4Gm%&=O{5bZlVx6w1#ux7kFeY?>%go#f2-B%ufG<``W=GxV@V5E z*Qj>-g{pOgYde&nZtJYzfN4N!xPdCD*aw!sJ*4m@>klPVt==ZFD9f(0UR}cS)(@-G z4P!C<^$`c?#3(~|NI3J&7MXVi){h>mL!zC?prOAJ*$9upx0)A9vZ@=C$Q^Vc#9ed* zMjmc3zBNAgh|hLZzf@{J8nOEi4*bc6S>o`cDoPso{A=R?<23Z7YsR%_Q7@MD7Rfc) zhnL+5<4@Jiuezp#5)@H_zp{;~o#;)~zT+c$Z#gX)X}3u-hJDCy#p5={EGpFOWFT43 z<+syn4JT31qu5l1YPD9Nl_sx3o-DlRHCnYDMWeXxbs$B&HCuWJO+UQgC9}ql{yb=NiDg)JP4_ zUkU8oHlHyUek?Vbnu1wK7YnfT(z^V+j;LT*4L~g_sqMvR4s$W(4%qr6b|%Aqg{w;l{HKex+LFN>N&m!&D(Iyc%S|gYxe+we zznwc{cO&>36`#h=G|*YGoycV0#^Tu+OXm45c8X1DXh!$P_)OOkXKyTVa>)W?xN5QG za>C@+oKKyrQ<-7VEQ5!O*+Zq}8*CMwseMq!1;2z3U);_V@Dg{Jw}39MMmBJzicDY(xCP(?wfr>!<7&E=~Qi-gv_CZ@ z-0>Yl{H?k!u``I6<>WnHb5J{PyTJe0U98t3kY$bsR&QE>a!zP+zG?I;$zearlY3O=?B#*~n*H)v_j<{O}le zO{};>DEO?q9--fW%eN;=SVG2a)mfUN-UlUQ4Sb5v>JRE4>&AUG?vv|pI5nAK7TL35 zN;zZF3(3x-$zQN)q4wUec*H95_Iovcdj=7Yw>o-|*WZm^apM{$PDsu@byt(cgbcUFntbW=W7 z6En>yk(#sLWTN}2OEAlT+y$A~TP?SN+pm-Zto)f=8k3P)5vS^{)*`b@ck($6*OE2v z1{aCrnLBHnnF$Mbo&CfiBtc-(N+fIgtKr)BX(nl5N$M_wTxZ6^v_A(9`i)Uq#_$KGuGG;8HS40OGa7m<`W zYhV5YRkR!cs6vu^d2ve%6GU)YC0&~u^)NDUVYPF5N^t-a!zy?JH7T8%yB!u(iR;;e zt-xsFhrc~cUV*iT1<6}~sM47i1rpNe7K&yVNtnqDSZ$YA_7Z zj|wRs$8bmM36;c|is$=bp;Ha3W%hf(O^svi&S0^u24OTn?=0lP>KtDthJ#@z=7$Rm zAS}`O6bg`x?j;b8UMNdnQ4*k`<_f>B9U!Z#>xxSzCZXJCaZ_i&$WoLlXgPVhSPDq( zV6zVk#Xz2$V|V;QZNkAJsZQeHh}cHn1hv*Q>HV{ui*&P73gKlH;TzFaha*5(cj3b( z#(QGg@t%ST0IcB-EG{vl&v-U|b3=;SkFUz?qd$Lso4c z99QDeO&7J&V+wk)PKC8wu|lz3xDBgFKBw&ptt+fQTR@R?t?6F2=k%c31v_bvddD)3 zn=~rvM4y;f&mCocOfd~o>s_y|;G$F;$I*D$4AYI+^4ypX6EUx>Ji=D`V%M1CQHWI9 z#H2txcE+%gse_(}8oo;6hUvk3P2GuMd!15GWmf4MSCGk!7Nh$0JJ3$Pm#vfUnIGox zp?1=h%^TS2{+DG84{bEUOl*~6eMRaLh*1>q5?5`HnxdmINEx7h5M>7 z&kb^))L?;KeEGP z*&88`WNZe0y2zvDwsEA(dL1ZC$ehwG;+L!gd`gBChvqP$x>PL7+?QqUNFG1C4v#3KDOHxey$;tm*iXTScpSTZWU$N zA%_BA%QAdgaAjRPRNxm${vhh}yV;FeSGBdx#sF1$#(*A2?BSbqS=$RkfLE*@SuFa-Z@X-88 zJ}DZ>~WqM%2^Xb=vyKV53Y2rfE(@g~_Ti;f2`vBVk%m=U_`~e(D1Fs^r#O~-G5+Z4Bemq^}ujl4# z>*MJfe{Fw!crn0s@dy4hw!g>tPe{Lca0t?UZ$dbBXYYSVPBk%qD1I-9`CABL=s}U7 z94eLh^o8#c%3*5!ddRm7p9`2_31foYOK`qi367)0N^0tw7$#Tlo}oOE;l*05l)iuH zIN&MqeOc$<1gH&f?}E6@l5fHWjLG5>@{QPt%^~_aE|pW4Mb1q@E;puL7B;9R`Dcf^ zXM#f~qY>L{^w`r5#!j{np#7F2@s806sv^rc z3;P)8lzr;p4hHX|PKzPH*$axU;fOTU0{Zqx{cCc^zfwW}8W@Iw1QhWi#vtu>IJ!=s zGFfs#i_y{ENHMSi9}DAFSg(S3U4{$ftl15NVW}$O8G-aQbO9tj9`upmYrL$l@nxWL z=^8I%D*OhT2%CDayskem1Sg)l`AiOe;g{d$)WWa)FU0_blts9JP8X#BUiigw){U=k zdbsl+={vs+cRCD$>?LOCnK~xP$+XVWl27rgj zEe_l6a0E zsFEL(P_m(mB~<%gQkz>9Hcpio@t09Qf&&2%G46MMcX6MXy%=iA1(Y9>ClWS+5ic$o z{xhy!l+x$+ht$Ef2i$32%l=>m+;buUhhrt85t3o)GfLP|dngE?zcXi*Pi7Ky{8V8kOFX|3Iv z)ZltnX5#K10kNk2oYQow8Ti3*)!LG9zCR5+BeQK`i)?rkxBN($9BBqo2uJso;aT~S zQvv`I0V!+bY)s51nd=g|0mh2-4|95b45OkcFD=+N9oEwOM8=QV9sLvy-@!JZ=X`1# zP}W5_s*KQ+YK$M3VWr&-F3?||(+OU{!|XQ295cTF&Yo^JG$h2OWJ|)2zh~@7Zu{i(%DN5@#79+W{zP>jxdOBa>Ro6UG>z7l{B;c?L{gPG*e^)DFCwGoJ zw;|yLXT?>XjJ9gzx*Aa>WVjYhCEho*_Suw^OqYMU@@;V|Z_@HKFt^8I{+f0{KT>2#~&A~A$Ik$CxFvb6w3gWJmslTu=sQmcI6V8 z>W7>)?O|`qqsOH=S_L2<9TmPjjaEOCM4JJ@et2K@{4H;@&V_0l&Q{>%p7@+#;X%uF%*#{WLu@OxI%@0pFi6I6?X zx&AXmi^dJpXco;hPdZe(OeV#mGiM1}^WUrcYfwT)d(O$HowZ(HU8ShWNM)wRM1wdO zS(r-~N)oHgauJPK<4@*8t_c0p{WxWyPmNYt$t|^|zDEAiRe>*$hdn@vL zEAo3Q^4#h(Tai0DwT=d^tDS35w<$o`I;ef3az&~-6y_AwUiZrJE*+C0y%}?%W$Qph zw_QTQtQB69jzZH5n1I3Zf*$(d?+qGFV9ZAKRaT|LWC=T#uBO)YIcMbtuP~3*Ts9xf zC+cnK1tj*|XgxR?$>E5Xtwb_;>GFK1@Z=dR=miH0lbFF#FS3Y6Cr-jMW(u>SnM8#Q zER#`UQUkZgF?QMio+ze9`&PM3Zul*g*wqYLte%>CcA%wPol;$VMx|0#AZkIm>Dq@< zI3_id8Fd@;s5R_yI<-cnZbz-TRr08{WSPm0+>u)2HvXo-j!E~F+C8OqPpRGe`?>e` z^X2>dS)xr)y;Glz zRrnlEeR9c%>##XCRzFC+8~fpGdSP;TkzAXlqXJq4p#z!15@^x98!8v2^97=UC<-^5 za3mdJ^PPV@8g>Ti^$Qh8sE38mE#rY$>f+Nl62#)jo!%ViA*gL``d(XK@0Ac$F@e)V z4R|3awlKUjYAd4N7qnplns3q*=)2HF(QBFTw+cqg0YK?pJv55VyIP0$YiVDFY)~Wm()yir6!!HPUZQdh?$gL< z!c%Ai(Z~+_(fHzW-Ro=+#iNS&)8|Hro^poCuc9sZpX!HK+#p5C9N=3e>NOkFnj5JWLE~BoqFB4;*3S_}c3bsuBpz@z%0QLvLaOCkru*;Kq zAq0cj`5;?5lLzv%bF1Ek_aSio`|>@WvmhgX;a5G`c#0@P!7G>Q3TC6`VR65glj`m} zAP2XRd9{N+J(?pOTvycm5gKiqWV?g~%xM)Pac)9Kjz1$%Baq}EJM}Zs>jo6@8z-r{ zs?`Q&Y&1VheRG*YQq%+p0X3k;Yvm zSsLdXZ!~Z62ZAC6ISw^5BEwpy^9;)B^xsGC*oDOCs?!XOP948wv-TV+hohVQ0pJNd z?jym-^m<9x!UDIuNb!|NfH<3@anQ9MA1J&s&MaoJo*3+jNY6}?A*SYl2JnkZ7@o6O zQ-5fFCH4!{YC2;b(Bl9OSzO~PkTHk9(QHhT)Vbn9TthxSW_4UkcVyRI(Qy|3$zCd_ zW+iGR0~#e%_SgAuFyjrSomuJ6JjX1K#}Z=1va>|U$5lsyK!$NmN5O;IW=mxzpS^H6g*Abt;Zh+~4Ei~R{C>nL8cHZgN;>(Xo!4;I` zwIshaPUH1NXN@>OBX3sCw}xFnEL;scwAR+KLpQoGwzhq;|BDlfX({tqSZ}oX1sWo{ z>Z36#0R&JDWks>bTd5wXjW>NDC`RKx%)NV4rZ{v5$IQpIgHAUlGkseJhs&CK@4~@I zMT3wGbzRl8GO}L&(5@n}{ztP`9K;nVh!f4Tfnz2k1JS6wl`1Aku;0D7|i zCcw_PiHxQRq$e5;JgP=8yx{9fnu`J6`Xdd?Uw>`nwHejK!)!8LRVu%aJK=~Q?Qq?n zxK>n3agg@pX~<~|4v9Yx6ZuY>{=x1PlgMv?l>YFcOzij9Uze@fGafcvd&8%6#A37f z518+&SX*)W<)>=-+w$sT_3Rl=baSh* zyT5y~5D%L*?tmq1jn1IjT!a$Kt$vsOQQP4t9QIJ~fpM}&H-nI{S{yPDI*cM-cGM7W zS+#3!0Q%Y5+&|dg-P+u19RGZLvh$h}IYKW6!`*zdcd}3$$HPU$s++HATn!!Yd4UI4 zRy=(yqkh~0Minm{i8Osi(|LXTvT?L?jIBKnfiWWvHxPSwTrW0t7ikZ%V6w6pvASBV z;;eD0)}EACVX+=P(yIlHAHR8ie6o-Z%Db4G%TaZ)%?d6=z@<``*>mV2rjN62A>*^!^Kqg-hNqi`!-wP z>VS3zgUx0PM0S0Mo)X&Qep5Uom;tS>u9Uw~%d4y3!XF$G{s+ynUHrnU%^!Cf+k1z* z(4FI~WvFoZYT5%`7dX-DS{yasg{WZXF1HgQyN(400TyDlJRgSJWTSL^fYaUF`sdDx z=%;0sq7Gpz(NYTy-4?ks6MYp?Yh%!EaBs@JoRs+w8rBfZi~K@5HVTEbK##wn1$y$t zS)j}S*Y!eWyYc*ZTP)}m{7U|OvH9b{5hfPQLUZ5ZFmC})XN`o?eO$>ha4%-KIelga z+lJm~>o8~MK9X?bd~>p3 zM1=@5HUHPi)?p%LM|Q;~pV}CUwKvvLf8s+YH1+YGWUqs+`}3-sA%TiaXEdU|bF zzN6Kh_ujKIpPPWX`nLLn$#Hktv2x1WH#5Im(cp$%KP_x6s@3nldtAnUpU}Tg>ECbY z-*4&P@5%~>ze4}6(!XoO@WIC;`uSL?7sD_FCb2!bLUo`Qc(n!0{OavH)W*b;o)7qezHK#D9z$viWGgBzsDYCtCd>pB{C&QbNGGorx~ivl^? z<1V0*PP@~jwwcN9Mo4tV%$ES$gO3XAGbRp)@5w&e%mXOViy@q5__STM^n<}AFtlun z2`maZjyb0{*7le=WhktE+C6y%NK0+*|Ezx6JUZIkKlz!sEPipow^5$oNcOuMTy5B= zAYixOhuj-7>m4Wq3pNb;BMJ)sdgo~C6*Rf|e0Oj6}?*Y!#78V2gf@!!)M2Ezasfgz#^IibrVnY!Lp-ZQ1^n1K3M+oaP#DqS9tL5 z0`@Q9!o>yoUaUPs`egIv4i|wFq)YH;vVa^ZUC93Q3VLc^byY?G&b>yX*@7Qi+c-A3 zo{N9{@A0dKupi6SkHrPdXdLgrdTgE?94+#rMC-w_4*XNM0aFoQ5slx7FB{vNCz~=H zowkS$3o1SJ^zmb_D3Z2Eo3ArUd&Q2oj&=`EGE2z_v`2L;qLXkOa0`x%r#s9P2yK|u z21>o5*#5!M>&?A}o!t6^WuRRW2?xg~eu`9kv!AM%Ov0*(G-gjx4WdglEW7fD)kI#( zO~>E3kpY_ayBVAUS=+nEC!|1su!**)PrK6CSQ*A4 zqd-z*?*N&+*Nqy;zrC}+wYvjr$GzA&0J!wt2_&L?o!TV1(_&(P@|pOFL)N-Cjb3mAs1s6|^PsW>0nYEEovk-;n1Mw&**to=bAmJk z45R`)_;?tjqGc2LN9T9zeaHEQlfE4F+zOq3JMwjY`(<2a1>l1z{t-g|KvS3>!Z||PKtpKo(0wT)vldupefxXz=JKmuJ_NU224KbUCzbFg9 zlT+aX6ZjW>zBxI-gFy-MEy?BxJ+r?g3omJ%As6=MPyeKppZ*CyELVzY_7`MrZDG>Z z7Jb4XUmtAmaEkoE43dITDt%$n;UWD#Jmep?gnVQ2&oAjh{fW}`55(L%FQ_d3rJtgr z@{GSAX=m%z0Vd#I`Ptag35_kCv~QC3b<&ARI>DruM>{l7`oM&@JFxqdLSN7DKHYK_ z$NqX|uUfg^pSi!CY8avc z#F8p68L0~TSfo?A=)v><(fRnvi8@7oqIgeI@RJjry|BM9%L?5n&;Il?8*jD}`H+G| z2w3*^>9fHjfxr0k#2xR69WfpyL>ic`zbV;0P4*XLK}7*C{(>YSN-@pSr}EW!{s!Ul z;ONB3wuw$b3jE=e!QW0c0?7VLw*aR&MF7<#8<8ZZkPyReAxWY_E_KXh+!QDR%nK|Z zX7Lv!X(j>_9fpG6tS}8fFacql67U0A2s;)#27Cw_H5h5>ZP@d}b>e+ARJJ*_N?;CZCXqgiwP; zpqSzO6ms7o^NIR5W3|6@mW)(?>*UB5k4#xRO6RAQPsup#FUo31CY?S#{*Kf2FUT@n z>NEc0B%Gm5mS32KL^r;{>b|`MD8Q0v%;7IgVr42y<4;J8(6Y*%gqMK)u~}`i(AnG{ z7s<+jDzOEx*uYnO84SagI}1Mri`>Md-yzxNmto^P_DwiDv+3?{n=Kn}f7z_atrj_T zEC6^34z1KUI7Cto5k5>j>|FF!KdQj#MRkLIvl9y8NxX?BF_->dmfUiJ)N&c%W!+(T zfT6<9kpkU(O?Z%B7gd4|f3RFVe)9q@l$~SXm@|3Rb(O>2PUBRC6Z9EG4Eyj5AJyOo zSugy9?9oZfjBO%Hnbk^4_+yleFBOZBxU^^zplVCTqeU@`C{W2=g4Lesmf2KTK&U{O^ndhb&hnTul1}=Bte9?Xf;pq1@}t!4K0{i<1Ogb3nw!qk1Xb zB_J!jEcvP|Vkzgk^kV-M2cm1ETJ;T5d54dJ1&sm%um<#Yy&!h$#er+)_u;qdQtiWs z(pkY=dZZX^7b78rTZF5j*n(C{cyDLUuU0I!O9gwx@){~|LxtRh!iEa=0>({u_tV=w zZ>!9^z~Y^k`qm4^fH&Kk=rGPRPg~vtjm8%`*0df>(Xbt#G5LIvA1x*}VL~_2n3Q3g zEsl}HPk%iQOfl|@ftPu&yolI5a)_3Y{6=Yr2O37iR!yOeSR3O@pfvM77ZRtepV4ZrydIy2|#gf z?S3=_tXnjf+Xh^2?Rv4ernh|5h{Ld7??;@#e1>*A@l1d*u34(SRy*UO8q&2GTOeHC zkFvm=ffrVai~x$lN>NF!Wnk87{OKH&;a3aZEsN#=GJH}X)2V#>%S;NoA3(?U6e0ea zT-=nkXl(&6Fd5Gz@&V@UG-*gqw47vL4#fbC)?nUCb)ZNMAF%WeexW8YO=m;7d0E_n zvq*X&XqozvzfO7M^p?ij9B|_}ZF}<+aae`qwd%Y^C4SrM(tEAJa8e`qUpTBJa_apquqb1Q&?9GyY8C|Fo7Mu46tQtwKf^h8GN+d$ zf;$?Zg;?vz(dD0p7^Vyhodg#jti0u?e=cG;3bdUgis6@HaphN7IyC%n&oBpoK^O@O_hM&>K05n&^>S6V~wieKWNki z5x)^SotWB|KAj&eSatP!@ zUrvY|{RC$qW?E+ZxdRQQg3#C17N7YoKJv}~?3up@G6%>U2;0hqFlm{DJ6jq|wvu4t zCv0VaNfJ)*7I;Z8VYW#Gcr7io^8|$CrH&gT)zO6L&g5KBFO?4DzjTJd$jFzR5qw&) z8R0j$v#6SSdBlH?e|`=BlFluwO>qm*>AL7bnS0-neiav_&|(cWWamU#7qyrN#_5#a zcOmK}5zb-p>>20D@AgiJFG?O}uZFT@{y zD;Ay6);@eFoEi2-CB(2ZwB=8}_8}=~cAK{(uXplfHaZSjr6nmwa9A~xLo-e906MNf zy%CZutX$)GJ>>8*gYRgWa6Q%yODZodK|qVa8kcZa&y}lc(DF-p*Ecp(DkU#lXLWEb zS~YJyQn;(-;U-#3JqM_a<9C+LYXZP&pelo-bOVXeC%JsKq;sCEq!}~T=?$dG7z71- z9;F>!0(q?gIa0~$Bcrt6n@h+1MN}F2XK_cU>p6qeuAQb7OD=tqPqO=&$1yqg4my2n zNPl(oz{^KgkD%a{^~+5drBm4LZOTTlo^Q}wCk=q0Cn@VmHD%HypmN3>ErTL3uO^6& z*0Ys{y)yjNLedP`_uS`@B=gFAIxRu+LB%=lJWJ`(j3{F?q%>^{_$t)46zUe)Qoath z^X{;&GS!=HJMN0(lSDSqc%wlJAGcquY8sSX%huku-O?Sg{vcluB%wTtFGZOepax3Q zb|sVQ`03bZy%I}HXL?%^Enxm)$>pN>eo2h4v9teUoeE<@-PSCe>5=)8Pm=9-n(Oun z(M_==k4@E7k9mA|tObymsW{Z3udu^UeY$ock3_Ob0jJaJGoCL!=;((73QIR)ewOu6%0@K6347Jz#nk_DBN-Y9_vYLpxa79 z*?L;AK5-jTrExm$-lW@;jY&K^tgFm7h~(o0HlJ~1Rfb*wRvon3>&i1ikyJhZ0o+7` zIFTLeT#Ki%-@J$8q$vx7w4b=1Ywtq(bce4F_J2lJDE;cktiSM6=(B@|!*{UKo5_zR zIQ@wyFZIGhd>++Jh!o5oe)5sZdOxCWg&^Su-ggwAE;>_uu;@~2M@m-JcrCG;!eSoh zI3;gE@0LtmnQraGp1PZ*65H$5gVUwF8`QgJRpQXORguQ=$e@hV!jj;eBQ)Wxay@$} zW<4~?dam_WtF8Ftz==_GNQjwF3ZO;0BYWi@q5Ko%)p1YJygCV?6%ixH>X%2=C*PGH zRi8duM74mI`)|Z^RwO?82hotj$QnHYQaU)$@9`M8l>*F4{PG37E01sDAJOMC%s3t` z8vn7^%`j|{IdygaVCOBGJgm=V>+edz@{I1CGSh7RouX);zfxIwQdxVVR@T@NzPvXL36z|c4L;q^F1E$APpkxc+$ zY9v;US-%YDP~1zg^F8f(*_i^a-(VQE#!UoxZ-~@N4LyU%x`~C<^J5@FUo{SnGcp>_ ze?Hl19RIX=Xfn}1QDb}ON3kt}Gv-x#v3Y#bc>C>B_8nt#$v@8V!QST4uI-2Y9YIsr zrk{$Qi8i;lj~d6DjlG?Hv)2>aNwwj)81ibL9KG2(X#l6Ob^PWvyT1Vlf25YzzA1l8 zfSz0kpzn9~w|6)9lR104dnU()VgO!L5TZ!d^bc&fv&$GFShm@uMn9|YY;9Ibe$DXZF6`31P#}YXKMDWA9qW} zAJ#&p3%?iBZQ@cM?@eC6?|oNIiBalPJ8>}VFv}YcCuI)_0T3W(hQ;fJJ@lhCZRuX` zygoSkdA9wSI9oi!Zo|IUsVVD-KAg_S?OxQn(<*+Cgj+vzO#Vqf*+wJBnI;QO!k*01 zB${2$1bF(mm7MdIZciV#S%x_5^e?6#54LTb?Q}?^GqyQnlli-wgqq`@j~mb5ym)=E zJrm5dx`R$5yuRDno7_Uy$mo*Uc{>|CYoBCy9a&EOtZ^Y$*gcpwD!_ATw3ov7g7;<{ z;wYHm(BS}2Hm5EcqrFT-m^Da^31=DSY_|vwboOiHd*BZMM@((?&HgUn2-D=g#H>ND zguzAV78eWRRNvTJ&}t2l!n(o-Pjx=N04fYw3wG&AbeC>1z9iqV=NRGvaAHOe)?zxd zuQn>h*w{L@>CCp!B6>PPZH*SAM>yK?ZSuwR-8M zSf8w3vW^w*CH8{mFiNCF@u2OeusdjACgWMX0VY>!f}kK>^tLu?Y$;ibbqto#_m|^_EmtIz=ZVdqXwn(mgyypSv89{Kb;*|A*ay?SvfXy^ zKZj$sNlTRBn{Db6+&f75(;TGatm|Lr6XE~HcKp|R+qj3Hdq*1oMUFJ?eQDhL(zy4f z@qfgZ#uOJ0m@vV2gYUB8LB21B1ZVVF-7(-8C-`A-vojnpV0NbG1|4F5>@tBD=TZ2m2cF_ z%KGYe>uXQ$UF84UtCVFmQu;d8 zT4FCgsLZoTb>aMG6sl;5wm+8v+u@vtzyi?i+U|s{GMWpOfDozlVMlPY^>D%tZfx3` z8+FW6T~?Jk4$0!^L8TQn$Gs3v1vvv4h8MxG#nCT9y@veQqv9qUz!Bc)w;nIlDSW08 zV^en+vziB5r_-k0p)aLsORCY3o?fAK(-epnG?WF)Ix8QFbqNcrYnKAAdU| z{JKrd1i6nNm%mZV^e;lL(a<;#;t-WI>V<-n+6aahl!84qd-#0Q9H4eb;X$Q&*^63| zhM$U23&PKd#Btj<5Qmub8;#b68TOt;QDfF?VA zazJx_qh124h3$VGjQ-uZcnA1XeSZN-&o27oYS5{|EnW><;~&^wOvaV8i%Qsb>A*1#-&2Ro+es>AVl7bvAYSm{2J7|=DQ#Fu0& zh3!l-Cfm?=f(G<8-G?+-hP#2n69I_=BOfaEFu#cVq`JY#R;}ht|CVN9XcLCbWSNB- zv#*IZUt}ye#q2A~=F8l7xW3p(&Jq*v9t|-x6A-rDSWo^ChOv1*bF=G(XA0% z|jEqUNx2*)<35YJMC*J`X3yT!0!*0+F;Se8> zv4uyE;8;8d`WlPA-c&1VtE;P()kiCEe%>5!>Pc6S@G+1R9aMPHZaE- z_FZ}l$!>=~cLswH8s|#5H1SuaRfKdbbOcQ!2v{uFjD{Fl4kihl7f+r9@@(=XjUm1u zM_$+pEme_q(hJ3vg13alKUSA99Ms1L%N$bkHfuJ^)akDe~7?eM%4^ovK~`*pSY_=zggAb`CH#@$f^2U&lx z44XHo7fyyZ>h#Qv7B&XcOBQ{0$lU>*Yvgcx!9}N8FFbts@b%`)-7UjJLqb8+s_O;% zgFoNH_j^@o!}qXPFObAc7UUQsT#e7;QD-EF91kjX9>b>MBf~H{9|IJiQa*aoQEC^s zDA?k-8{p=W7V*650eWv<2E(8^A`vaNg109$j54R@2>li!riNRs6#@1OE2QS%QrhLu zgXOmXM6hMFp@kB@xUI&u-`>`0r3cH9#dZM=8g0E4*G?CHIXyi)JuMVZ;lE!`7i;im zwRS-P2MKa_o^Nf#;=mei9&hdLs=NLNOa#7^^1I;Xhp440*C=%Vga*~pFI&xDSCKhtL+cOKso2S!{4) zWLGmZg6%MO3eHC%a2Yq+wycE?pruHnk+6KajyruJ{w@Sm`T_>BHp8zlZ^ z?^yN6ojB-gj^>~bECPlp+}qrLNmte0Rs$_&fi~Jg>L=(9!=OcF#P350C$5K>hs8Ej zd)$ZX9pjWn!gPcjNR(J2z%#t@F<+91=qa9RSOv6&9oM(i0u%*Ad83ZE4i>4WpODlM z|29$A#15r5A|UvXbR8pxqT3V6GDO@i$x{4-=K?rt^bs#g_-pS*Y`eh)0Jrf+VMC^0 z-`dckP)^{R&}|xqJ*i=w6*LQfuu+<$ZE_P`4(Y2EUq}Ge!+dsM9FsgOKzB-U2Sd8b zrSxEV9WGSJhx={r!7|bU?r7K^N-jrIH71RQ8(1!@=pgn~T+kG-JMM9*;ZZzBOs=Is+VMc4u4YArinnx#W@$MZI&MT?V`Qx zM(2Sqqo#Yi=-%QFmitj3SiL%#CcT$GoB+&t9nFfOE7&F+bb)_0=-y}ZF#xJYt4lAJ zb+n^ei|Pfq-cGCC=(Jd?7XOIO{}o=3KGvXawAR(RCLIfPqnh04hrtj|1ahBlz*}KO zF(z&kNKIf2DR^-A24-}1i981Dc+9KH1yN)zBHu{n2IQYZ$}usAibIg8I<%)13i}9M zV0lfSy~P4VqP;Z=G__wUjiB=H&C36-RKELlsSbDh8K5+5!!{rZh?=;&d9};zAg*gC z0=k4}qfllGaNNgn5}A%JSz@#>>5PctHF_j*>cLvrrt}zb?$z&9qK(MwU8aukrLlZ{9p+K+ejS$|_mIrQsQU!#!tkGCpKXoMdB+|Ui zNU|&Fk!0^@yVLKW_Z!001^!iV@-cnUoT~yS6!^^Hr<_PmN5sYr6&XFbEom=LmDYGr zVV^1R)kOzUY?kI&l6m8d*&o|^2>6Cx6SRy8C3l2>kN_bQb9|}tRt=T1 z4DvSXCbwt5Eixm393hj0igm8Yf6MA-T#>w+=8{}$HUWf}mY3n*i)Ispg)dd)<6?Ok z|6F&Q_U@ze14#6pPCzOQ_DBCjT4T|qRz1Amopj^`9uOi zpO%vLBdSM2ex<35t59pR@%uGvHAhM2gqySHDS;tKG1;H69m4-0(}i3W0*uhPS%BkS z1!>@!^UgB^kj>0G&sV_^R_J0KAAFD}=n&NU9rFQ!BhL*QG&RRp$lcr3ZzbppsDc&* zre%HC*jpz_vbmHPF}m(%Ao_qkkFJ=tp`8^JPEzYQO{ZpUmRz`eQvpjQW!$4WD}I;W zZ;9gV6zN@(p#zJnUKq#d&lP4D(3C3zpH1{_OVbk-B_=GT7fknrpL*Ovkm~!F((@&u zJSGtrK*^ZIj(~|-?*q^^FBQ(cjrT*?ZvrxnSVRevxIxNH!M)LZN8FIcdAxZd-!=+x zjE5AneMsR9tI07vIgJw5^{(v?`uimkKk?G!0 z?GC=c0U-j!1JDToaaS61-{3n^91a3}mLs5>Tl(enm(%}uI)D1x>DQ-ArwgZxr+=J& zJpFLGar*t~52yb)EuE^)&c+uQ$nA9H6Qu z?F-#Z7jb)#SSZR~6vry#n!t^HB#K%-3z~rn{T&YIY2T;q~ z;(wKB(V1JJ=)gN0628&+!z*Z@(jHL7G95Jre=K1 z%eRt8)Z{_vC1OqEbVkgV8`Ce(ZD9&0+M=Acig^;5Hq#LXNY zyh*1yuKk8(Yc)K^a~7M;k&v^~MtRHbi(}X(luee(B{7uYjiwEcH<*l6R0QyY)TAq7 zj^2*%jta2)ryv8Ye=Bs5gk<&~a~B+ui6sP2=yNt_ZxC~!wLD8l3{I_T2A0-GJGr-t zH`YT)8V|*PCq%@X;+$s(&EU!AJC7c*;TO5~@5HRE00aluK%A053YkZiTfHIK&>THe zTtrMc@ck{(u)Kz1^el@Wl%n&08Q%L=7?voLF+gsAWUq=K&Y?-uPxG=!nDidKvoen4a<-n5(gP1|3kDMuxnsL>tY9e?Q-J^_W<+0Tx}+%u!GiajrP zz-9*6PR(&=j5YzRZ$bZXof&XXF6NOjF#4Gh`EVW0TWV?8WNZVgZ)65~?)}ISBWNbW z>e7TJ3=O^-HAfaU8CzJ;)CbvrxpCBM{C=(UBAareH(U)OfyRQQv`18w%WnEI#q6gM zRD}|z7S`cCsnelSaY#6e)aBxFyWP1CHRzk?BV0-&Jc$t}6E2HLud9P$00*e{*W%Gp zURQXZYh*g>rC*v`FOJ*2IQq5Z?h&t{m5)_}R+>GmMlW~3RWVF9q(HZdRW<*1i0c2R#Hl@Id6Oy#S zX|+i0$P?z75BsTg?M91gdb34*LoJ-m1fqffTOn#UB1@rsb%O5?TnU!Y~ZF z1$DT)MdCTR;%Ea{E#W-EkRS{c6otzLSnaP>Lu`}UM}auN*2NWm46Yun;om4;vv6sc zFr$c(1xo(%>pHmbFmNj*YyldB4QY_wVFRdv%cw=1?jVTc22eBp9?jExF;2M2BCpi@ zpW@Ia+E^iMO&+!jS6e~1IY!lY4xoi^Ue1*yl&q{~r>%u$Lkjey+i>aR;hy#1`!g}FbY<~t#DZ5LHcEo6eW{h^!+a4@7D zQ|mS$ojgpa7}3BMV<)X-6(frv)a3EWxHznq<-0D7v7ytEf*bwhuskg(Q+^HxT-UGfMaIxQTYYWqb?;_J;JB@M(-A)M0qQ z(Fmnc1Z-$80hliAGS-gO0zqZvUyE#4gKx0VK9U}2wWE+G4NMby9{j*CmwoNb`M17( z9bzwEf?CuME)*nBp7-tpG;2d@H3q@xGC>-U29f5fPt(OuQ?1K$l&I6uon}$(6*Ixc z5>0Ql!TLG({Z!o(zzy=4M$60!S*)Dp@jw^IVxrr*4hP=mRXmSdjZ0vvfmcIEE9c{j zx<@Zr<}T|d{L01qC~X3ESnqR8U|-pWWhjdsI+9bs8Oj+U6NWhKog)M{`I&Q0=&KY1 zr?;0nCrW`@PBMYWw)ab#cF>pX^mbE>;mm~BTsLYM36Pb!^6zNv{6~c)0GUiR6!gYS;;-)dOE0f z;x5(5sorz3)FE35Rg_WcIyRLO+2wJ)_>Tv!U#+5eR;~c^uwuxtugI4c)N}?YYC=B2Vu^`qqaAaSJK`x-j92CbV>IC8RTw0<+)$cnhNN zjqNF=9y-RC9`9*{FNj94*CZ+0U|Hsc%+1V%w&?a;L`ny$E6 zHYo3Xf&nquL!Y*sBKFi-JW5*k8Z+jsg+_l=Hih==y7)R!`hJ!5AnRavz51{=B(@{S zVQo)Wn7d%*F1o3L@ei4x9fXZtbdUD5>lWpa#M9!SfbU~Tk(j#i#fRI+_m1nS(yXL& z5z(S?QFj?Rg;&YjKM{}>vo_Aj`r*S1sJRrH` zGx2G$;zJ@C_%S&thm`sWi6PomQ2BYa535TC@)u%vkE=+CP7_v$(W0J3kNPQ2c4h&c z)#8}x%Aqh^x>vm`i|%gGrB<4yR>@hfdG)5>Wwt%c_X02nKB?qXQueNdd-Lnn(iA3X5XEF) zX5!?Ge4dHRp`q9`Mrop8G>3Wd5z8mC4u%E!&v8K$>Ddf2Gl!&P?3O`;X2H*~fPkem zM9e5muUHzkI+`cWf}_+xiV4Un{FMalJ>7awxBgw|)|qJ1nF!Kp)aYM8if*CA8YxRy zSvaX33pLKPBSpwm>l9z1*AN5{+f2}GcJL}8g%^~HlSsW!8q?OpMe^w8o7*Orjt=Cg z(?cI2y@C3{CFUJ8lPY#AQIjF4ryZbM zN2l1fL=20@&XKvg>@+X6CkK&LGwRasI7Y`G89*Re@RR~yJPd3jM3G=w)DyWes|{y4 zdgtHw^K7KiK+gf_{;@^xW;XZ5?%UTp>i|U1+GyM-6{j-48`IF>6vILRbtT@YAoU#2 z%@sm6Urx3${YECsNi#)*eA7A1yLTRS<1$W?^J#-Uq(W}J0^daP1~(4z#t1H-7clXD zbXCUX)7~vbiNLmk9)N7WQD3VHS+FEUYnlhNgSubm@FyJN_Bm6cdzoA?(8yVb4n`KU zof2Kx#1J{UXXER~}f3frf1jY&xxIbj?jw_?N6eO`7Oz1(&Fotf`9 zFvO>rdZLz_s0+rIFrKW!$qb;2V5d7F5CxKgoJBfSp8cINeu|;H$?Qm5j=&Blk^m;- zFc>y3oiRW&4Njz|CJw73Sh63FB;suY*>$}jM5;8zWZb+$TR#WPaaoBB}((K5h z(YgVA*J&n`1=Q+UiH%`+5nfA{@qlJ$1J{mOf|0XGfLzDj(Dc-g8e+6(lAM~XOy6KY zW|e(i3bMLU&~ksf2L0Ap2g-$TwDm7%&9B`bgK*gMzz7LjKj9MjnnoP7?eO2Du~gmO zfj?P9@D4D8Ha#Fl@Iq7u*-NCOV~lr==5Z(51trWb*eN!h@ei(%gCh+h4OkQgIfY%B z&e-CQ%+VeQ#*nNn6#Cz49JS4Wo zYY@~IogY%ewrVINPm|0_G|e)6#y(lzmRfnX6v?zz$v6?5p>1}Pnz{@}R_Aq|{IwISBt$!%_psG0lEF(#c1h<{^_ej5J{Sd@GaE>;9JLpLNj-8wqZe==mS|INkIPMtz zU9PM6U1tEOB1UC)@%%>F-VQD;D(Z~}owc#4E7$$0ioYif1MceOg|4AoPcL%`t3{C` zv3X4T-cO{cX9sUi4&R(S(-P1WA&^W;)bK6xl4Ftk@PoYx7ZaFIZW3RmZH^aAYq#^I z=RJvN{VUu#8JL(d%{1xbpI>9}mS@^tXr_55E9py+QGh{@DbuEe$Mp&H{iKBCtHI7V{(5)@{^_MoTr73=q5`V<;N4kyPHWA7?fhDiE;X0qCB z)J(%p!kdCSV5W4lhAlL(Gx$l(Idr_Bpafw*V>?37avPeuEmUT#j07#Z51|ik!;-Cd z1)RrG7kw*WevYN&FQ=!qUs1I2%Vy<&gUY{uUFVd=6pUs#mBF_l)5&n$uV6>a&Walc zhu-tHEDcxbBS6#g;DttCDDuP$j(psob?-Ve zujWjX^J=8$C!p_nqbr=cw!srojzikDJ8IsLT-1^!R6b^g)k{^M zeHpW=W?2clvxu&&B#n)BMQX@WYi1qAsH7L79A5kQZ;wYDt6?sUkxtK&ZI>ugKnRQ6 zWVi0(1(ntG9j`qGQ{@gCWi*akzd2uMGuf4ZaZkqn0F3jo2^FAVqK>}9CsgB0ts+#( zBHw&zI%P_AEtmX|OsSarGvS2Cy-KadP(~)-vy**DxUM2XJ%q4TvEouOOBGWaeb+oN z&m6{`M5g@2pOZTl@eoI}!UIQ+;HL8orhzyT1QjL-Dj0-RXK+&vxnMF}Zgz7>4yc<+r>1)bQgFO}hA_xNOeiJn<2d;16LOSYXjD$C=39BPJvQ7?+B z;p%RWIcy5@MMHjwrNCnNYPx6Uw}XMj zeqrgO(51}5#1@XPBTuZ3`}w~yfK!ZK$JsbDUYrbI!8!g z?mc-W&Iy$z5_e5z0f|-FqqQg`CagvCwh9+42;t$2+evcbrZ}4FsZls^c>5ld3<`<5tf!yJbIGuCAhWxaD=+Rg9VJdLqc{Cv`b*-j!g(0Q z=7efr5!$PGi`21#=4eds_!7#5;tTX}PxKSqLJ*@u$E7{#nT&FBH|!3~-gRD=*$W0| zDt|0^F#~Yx(O@7Z{AowD&7m80ycp=ZsaoTZb#8D-Vnx)%KxECvuzI(#XbACwwzzd0 z!-+e5*SR!?f*SB)mvrO?{G>uxNp<30x@b0ivUB{f7%=aRKEVH|ulPgd9e;hO{8N7n z5+AX1HQk{%df~#QkhiYM`QcOXmDn4LM0FIajm_^H!xMOU#jU=#;*^db~eYE6VbJDx`jh6FXqo~t=T zoq0V18r@En$n(xcKN?ExYWC!8ZX1^AT!Gq81FK8Yiya=JfsJJ}vcshMSETNV z&Y1x}ybsU`H)(!d4I>@iNQ&T-B@RLd9H#2qor?|zop{slToW_0x%;*{VZ|6_SMXUL zm(6{ppNx2g38x^;2E6G(e?p~M9qy&x01eoa8$JU3*?l9k4 z;WF3Z-}yD>)iK%`v9`NWKo@#c8pYdYd5KZ-n?9=b^d0Alu=V7yCM7Ij4->w?0dF~K zhaF=CX+M2d*f>JZ$%yMwl#I?|FuZAX`if@xxJ$b2{S%zwddrFr&Gg<}WM3}4c$?PY z(NK~22_sD!Z)tP0JZMTpR}R*TJel^?E?#R`X3F&BZIqkrn=jiOB<*I16`1&tn)@8; zJQa}!hOgkxB*?gLT>pp}rlV3Sul!ZFBTumFXcOfuW5)CNygKA|*~p*^SLo=b8#?=u z{~kP1`-OdjJ#e2o%o1d2CIDTl^#!#pZS22^EiEd^PUpFtp$~%CmW92()@8z(j@m|ZG=3yC~;>bm&k8SyX&0TB8qIs^77(=SjeZdn!wiSv|DIHX}Bx^t5w;MPJ5QvVq)rH|WB6(OpufrmBAwGk^W=2kg13pw*1>2<%=M!7aaP0xFs>$#522(=|l zXB69a1yK_xF^Cti_^nv4P4=uRS4;z`RD0tTG9km53N&ET6KgteG`jW3(32mUPBCNd zSN3*-a=ZtK)3Z~a#A)H}Y4H!g?#I)DI{lzd&74kwRavj8+65eanU(9DF5SFcc{_%i zxRDwK%s8FwL5Ekj)y=8xWtjTz#x>ZuZR*~6jt;!z@wVu-q@5mcD|xO76V8;9E0-$h z{;v7;^lBO-M#oswz-q#Dot+kWttRk}?=H!op(*70PV$Nv2(XTne1ts7mr~}i=6sJz zKBn~@oa&cATnBXAiAR~+$4Yy!at zX-<&@ALEof|Cd`VaI(A>oOCoqMeSRpMsLu-^MYVcn`a}5kuX+u9o&kibl>F2`J7iT zNVeYXvIlkRUO^LB7~_mir8e+04i6>cS3ki z`g0ZYT~}vb{60Rl9K+93Cnv-ldqP(30p+ZTwE(>1CFrt+ETt+(b6yw@Ti!L7pf7K+ z`{9*d)aFgY&&Wo&WY)@NruBYAMweu`4%}U7Xw}E@J;Ver3#|!sVt>$+1nPk3QL*RN z%FOj>U{HxA-?Z1_5@5D=w99A)XLEv~6bW3=sRgVk+RbUhS(cD>*s#ZPCN9$<0y7bg zaZ$|~2D2!Xnn9B3q>aACBLCD>*14BibxcLBrH?Zn&qardwE$wtRVNLWQ~#o;9fTlb zpU1x(`#gUMDGGqZF*EFzSy%_ZD7TuMXW<^Vfh>4&8@PDZ>9l)WrAkd2*b5VH@I|0ea##;9dM1(NJ^Mu0}FVcBF~JssGhd#E7{{7Enj1G-)v`kZ3PdI zwYT!SQxCUy4)=DSA3r1{;2!RY*du}REWSg3NCXb(1UsY0l6*St$`b{{A>TXv zM5>DE%Sfe_n=+_;;aA)wgPqxI5YrRZ>m(tPA_({>&yc~Ol1lLpoX|(WInKJ*$0$(C-D_uO$d#fpJYSSGjlR>x@vJOyT z`jOl-N79fGnpp6z*gSMG(_SWKZT2GBI?@ieZ~aeN4G&=dnloY+W;*%k-Vb|sydNBr zkzCF&tY=+ycs%y-cpN3~JJ~s`>|Z0Ej3jTpkDT?!FjVg_Mvp|`5*-xnHH_(EU^jjr zdy*@ofH%pU$y0Qp#EHr-wEYQlrYV4!VNoO8^|`51&>7AX&!2T8PsLx3Y3!_FK?JaI zQ@tOsv`b6sCk>G&#^oBhiJ_Ml>(fQUrk+K$kkQsItMQPGJ{Sb&oo;7zA6k8KOOw?wN@l1Gy#UyUs;W}Y$0O*sNkRi?sU-zEZE?1SYDHO1iZcRH z%Si;)DhuC%O|bJXg$jwmP{(}EYSDR|Q4;)N6!x+8SZUbdemahU2rf;mdLbG^cf#zJ zY30})=wB$G3K9+zxWKL!?ci`p9}C?XRWon$X~3{2vI5fOa>K{m7?E0Vf#;h<(wXb) z`!O;M3ERWqn?P{h4ZpHgr=FK=T409z@2d<%H$#8_$(tl!FFA?w3CkPY#0V^<4UtAy zmdCfglao3LOx`*LvK1RrZVcG(!!YE{)=~xSUNK6_qZm>U50p(4`T7XH7=tJV_X*gD z*8X~K)DgGHurkJ!%aa<(fIO&LS&n8;vh6qNS<7<#5A1tCb1BN-!~`egd+E!yyCFSl z2R};Wv{GJ-twP$*=sE)@?qxBj{La;LDE^bS1RBxN$jR!{k^A!TqA=GqNX;W#FH z(ALsvs%S%TkQoIxRuF%ltu8U?543=bzvS#vaP`hPyXl&fy=jnxCrl8JIG9+c9oh9G zN202Q6~oenkJl*NAfnJMar1B$%G3aQRm3=|xJ+;-kXkUT*02+>J0)q0_EG=P{&>i< zy6FF)gAj4DZ6X7T=)FcZ0;i`y>Qy;it2tLywPq8H3zmu8GZbg$84ds+(~KgbXDc$xYP}c#vv2+A+4+gOv7G z4iziTw28zd4#ja(mm?!3?2@=kJ%c|6SYMjq6>z{dDf5_&plql|a&yQ)j-yUvE4trZ zIlQ@fwYyAtw-T-+)ZrRAF zH_%T;JiXMLnJb`hByW@HBIW&et7kS{NfH~hQ z=<2tGq3RNtIDkc{*j_INVst$?*N$R#;=ogp$p-azJjZFO;}&|1X_^>wGW-?h;;r0y zNH5u&yPk=V(!1<+&xAnXuOQd4qw)-tyJ^9p;3rV-xfhc;ce4=F6DVo#DDcouHS8+VsnWzcSrcz4Pmm%SiyqH99lOo1?cAJ`xs zcG?mGfQ~)3@2U8|EgEtZkHB01)h6Ksj1PLv;4P~H*>*RrmW9|R?p}ga)kU(<+!h;+#aK^WP@(9@0ipXh8yuOYcPI3()rdw4vX^Xw6U5pmGP8B z(D}0csr;$%p|)%aAvs7-!cZXS(Gyjl0;5r^)k<1&4YOs@^{iKgqj#PwLHS%4h8DE_5>xkN2MMAnX(eHKS#w=EVrADtBSl}O*eWmLg?8;pQ7;lxwgI;o3r79GAiX#o zsn)pHOG| zjjHg!QjFnm+T@xIlA{*N8k0m-E(fP%di8?GsHM0+F6CRN8kBI}4KLwxwqC>xiu0Tc z67CY0W{3*sdcnV45^TE}hmKwLqrg>-YfM=?yBTE{(|4H8PnEl-0DlT@==wRfB>voy4Ox z237;Qhs}z~{#8d3XR}D8>H5)C5}Z(UmoTs7!Bl`)aFroai>_lb^6HTpop}4zp#X3Y z97*x?Oj<43i!9rt&;Kj=P=K4k=F;g+I<<|_8*Gmaelbh$CW<2z56W2*Z}?bBJFbM~cg^$MH^cyk|`n5eTXzAIJvq}5M0lv=)dRE9_$zB5+^UA=OJM!^Exq#h|2dUkwoAXhmSC9l`ua702uNF-y8Yco&X@i`3s#( zCt7v*r#Z94bB5kvH#eUI7pYbIGXZ01QF(=v9AM(AVTamWIwyou#>sz+^GPf>poMx?zgg@FE?;EB$bwIWt#MCM)umD ztA6iJzY1u`%~zN9TFP%Fw*`-q$R1Y4aAp`rqWe^h2}tWJ<3s1vGO}4nXZD{g~#=9h8)VWnt9YBWw@j2c8Hd4oSJ0~ycr(W;=v7d6sXWsDc{eJt~ebOP! zUf7KL=}ve(qv&Wu*be;sajFxp&}B4}#m{tt^w`B3TSQxZdZnkQ1| z6)GBDiCb?m3qg@h)K&@1i|U3+^eK&q=Bz`jRTXRV!2h%H2KxDi1!Rwm+FGvPk_P1I z%eW)2CU!6DB6oW8mM~ithAcUZZfu5zc8=nN)Va0NgsC@GVItMB;0hhuX7-+w6|=ie zoSq5r>%CX*lWKJGjndnt+gZROs3T4vv7IYFl_%fT&9lEUPV4RKp>|2HUm3NB2T_lu z>&F!SAEYz}!%iO?6BR&GQVd$YDHS@+_aEF{p?o1pUdXgOx!{shg``fwrsaJ*dV5cN4(*5 z1OP6$z8!%a3f3ElNBFOZwX;lY4Ulp(WnO790=|ld@37Zygm5Qu1W9X-0CB*28yN3C zqh(ra0x(j9#JXCeojl6J6oz3Ob>Hh))iFj@7>@h++FnhwMx>o^(T&c7u0+{u3_1hn zWoJ&nbk2_9Rdf};N9AMMS&rdAn@uz8SkKm|xk>hCqe#DT$fyc_izug$Sx|3W-<3sC z^7O3VE8&%6!$@!pimtH&f&nBNG!_dOtI2Vvr_^yICb!G)f7J_S)o*UoSxtLuG3aR+3xGq_yzeb}acsA2X|-x_UxcdS5OvxFJ7mKyi)!Lw>`^{R!Zo+ILXAyBdsEwJO zJTT{=-*}v*azs45fq2wr9*E=r%Zvzxo3XeEBy%u#5W3sM;?kmWUh*x7g)_NwSAA7# zM3F*i{xxYDPHM2nTrv-xnOn|~PHFVy5>}R8(uUh9?QG-vH04M(*CNZYp~>{_3QOKb zr_&ta!$o|FZe8!O2IEas>bGv4T}Q4d$3zL6V?UFe^0JgNaoc6za;er+?i{S%YLaZ2 z&0$-T08t3jAZ=V4IP6ILsXs?ZpHGv{`j2HHdfI4Ic6JX_O3G8#sXr+oHQw3u8*(X6JXJg?=hXNfrMwhIX+VzM_=?FT={rKukx z!;U>MuA#3eGr3DD{HZ-&->S=_PwkE(zRud48#DHkSC(CR&Ahf;{8M|C=uaXfwlJ2F z*%*cw;q|QJym6&@>DDO(T)c$6UHhU_S6|9?{B`|0j9cS#_UGJVXF*-hM+jz zEt$csZsk>BPBVAfqM_?qhdgit!BLl4FDahbA~OJo>p~qFDIRHwWA~hg7x*%7CWT?rwgq#kYB8fM= z1jCy}luUD6KaniS^bl!~ZC39o%4Ayqd9=y&t_8Od4j}Q+VK5XYGg>JCCpGM`5}*_5 zH779pI+_?cM}bySt>FJbM#`usIrVQRPa3vX^)Ou5AQ(cz2!@DEe{u_MdBedUFc{Y=biKB%N-mjwEM-( z)Ld^kS-jvh5KcVEiHTg0P7hk;2CQ~$4+`FudwWyfzfm1Cs+}*Z7*XZj9QIUKu@> z;C;~PinnR0Yx}1a_4p|6bhi5VH z0^TIAa0_t%($ zM6{6b8D)euN6p;DrWK0j$f|K+_2Q>?r3^JvQ}mo~lGMqD{hTvk0LGbb;7D{M|K*j0 zYqL0yv`o{6p4TgNclUC+qTL!r_a2fM7mdE01W3z+?D8J%I(sS7vs+=fF}y@1@*(DT-~)r&dUqG@c(+=XWC zfTeC{qBEmNUWQev&%=-b)6yd&?LdZ;urm@0EbXk2B^s2vb;7*1G}A?WF^I>>BC!qq zTOggW@zf8b#V{Sf}*6p zPv!2aJEk4q1JSW}o8NzG85icQi%lg=RqU#vNKq=YjKoOtI7QDA*xgj7C$YFSIYTIx zu(!0V1C-c8@`W-9+0^Fm2Hg&+TpfEIeCG~RJZ|TiM6k}zYyxn`v)^=CVpcZ_GVdoR zg-M^2sAw#itnLrF*BiWVnnHQSQ(@62+UaBYBDbX}Dwf=!Sn|RSQjUf~(JDO6sH}iAzwa@Za$Ba zP@X(pq1U4GZOZReIQDS1Zde53FwDW4ucIXv)gQdS%F3V{^5 z`&=oncIaxX1gy`K0aZCXcyfAt9*6HH3_+JLpv2`knP@>M-!HKz&B$!&I1JZI$u zBR5gu-MtAGHpzg|a*p}_t;A?VVvtF|Fmc4Y!IgJi4;Cc_iuGvV4~7SJ3zt0ag4&7a zY(67sW;|f#^8CRvgCjXezH(pp5$BjFa8NL*SMw%_aVqQHVru|PK(xOmkEp?+Y)g_@ zi2Pr8mYdE^PBWJt%Q2ndFYc~UgDa<|tfw)E^-^W=4_PW%D7#AVZzMaHHGy&y5c&A) zL&Ee}3=DtD(F`gvo1x;lYY}hy?(C;ddP)kHSyR8umD)6;pjf0vjF}~Y8ZmtwJONF; zdan<|_fMbb??GmMUZfag%ka>wtrPhQ2aoJWdpsdmRrV=OoJ$UYKZ)}GrQY_gqt>Tpy>x56)EB6v_e$eGnYUS;)Yo>_Q3E6rW zKtCN{WF2R&%v{+_ztB=ULH|uwAGGQiOtjajgEY}a+tm-L$>ZZRi@Orrm1&CN&+CSG zM-X&-lTOOLhy*jq5T@*kebHXUznY`458INMzP80*nr1Fe{%pOi>jtRPPupphIZn`q zB>I@g1|H}USGrBJFg{ZR(!F*rGM`U^Z5k@WZD?guN3*xGydg5@`*XwEGh2-#XA2L& zyUnr$bTwul^irM{@dA%{IC(Emi;j+7zL@7lQRK^eRiwcITDhSWBLW3r!{;$xSExON zriN?}Mk5O03L^bJ-37j-2K2kgV#Fj*hKkg+Ub581f39wZ-&RFd<()?QkMV#Sq11XD zl;wT5onjXXF7EcPcG4_&Ig(^aC&xe8R9-D`JEOsHn0CDe&vX@bs4{87NbJxJa6PGor{ z6zK=@W`+^Ka*0R$SVCY7^lD^~T|Q0z1ONGk)E~OKl7kf&8GZCHR)N%@I7xWtO%tGV z7~QLTPy^@`4&WliZ41H>&&&a@LeXkzaMLx#5WeaHf^!-GVr5yH84D^gW}{G+>`Dy> z1Kxdix>pqcr#sg4G{`iA90sT9Er2rxIU%`#F}|g2Fa%EN)^+vPjKf`>t!u@jyAr31 zRX*IB$hkceci;>eN7mI8t@bDa01n>m7 z&GD@&uQ3Q86Cx!1ATD?Y8WH(`ZQdLe4?Uwt$C~4*)tf)Iwa7)yo7NasKZ{ne0e9Sr zj*W=lM%e0RnLNLA9tn6WBWkzP;h5YkU7NXXy%aX}U?D@iRv#c@h}Yg+0YmnIB=)*Mg51y{ z*kG=?i?rRs!04^SC5#~HcgTSU9dyg0HEf5bd-j8NEI3gl6g{S6krnk8EW_{XcpoKusQFI@?e=8EWRXmjDeRhn0M_Rq z#lY|qA0=z`-sydmaOO$Y1x_5V1vZi$L)xG{H)g8nZkyL=DQ=-HCyiKE}LkVgy7FCdUJNu=Ec zgxoPQ=@QBZC6&Jyv3z)P`EU`IA`N~S$)qs@O^P&3Y+i(J`XmzpFq>?uoA&*W)USX5 z8WbQKF2;+CTW?{=Hfo<(a)KU5J<1&kj2GRpu0OQ?3&5PNolF=a4frP}(^wqEnZZr| z+|u3&Hr=s+i{$SM$9zMJY1S)@S#+Cg>~hklnCz_{ignz%SZqmS;=|4&lw9aBho6qe z>F9xvDmOzdYO{b~Ty@)`dB{;FUqqA!v=X~8Z7NBMJ466+DnCj1bdiK9Wa8fRV{8Ox zly^dzveAR;i_WRLpHd9hJDe3(G1*m@e&3T@^HupTuX|Cya%yfk7^BGAlAFf!9xl4M z33^?xy;)A4d~c#wXxJdWPocU^1-;*t+X)339?*4UHn`-?#Yvsa0pCL%(E$eku&tKd zo;kepLh?x>Y$Ubs;V=8$9#0ESm`xXV%}~xH%po*Y>2^d4Cq1xKc%)-jrj+n!prw5YyYn|c#%SGzaB zyE8U5dXIi<1Xk*D#jS+&4wXbec>ZeN18{p3SJQ#A{puJn)vkFd!e!89UEpt&kLjEi zuaii5FG)>(85c?ePKnOQ))oKqDM4f05lbbBF1294+UrIgvgfX~!hvsAR$!|~+EEvE z27-_`i<<0z?a(UBY=U6{xTQt`nhFfo*M76_QpVkKNcc+e$S}opS?L%p-hw`{+HPTi z^f}3s82)>yQ@jU1{JysDuzit}IUjrQC!4aHcnTsxhIJ$E2UTc9`t^#14{z-rOLv6JzuWGJD^qe$M58~z z*+b_*ATdbz2-j)S@6?l}dcBTaQip`S)J-*vQ&iA6s!{tAv6xrW^n$8lGAdKFxIxYo z+RpJnnw;B?p`IMHvN69PaHX9MB{3ntV}1tl((#Ikr33FE)WNTP1*A# zQH_T^x)dz7wb+rxAj%(G`d*K&2=*16UUTmrDjA$%_{uxR_z3&=@%8WH>r0O>!r4SH z_>VimykY#WJ;VqcpN!G_CpA29d*sGpRh3J(;ogF<3TP)l@i7`^=;q7ogOfL}e@)&j zudZHc0FBql!W()tVS9;6)njrYLCl79cVn7H4^51SiL(ojod~fYmyw!oW1|w&8(Fpr z(A-#EiMF6A6l_#@cRBCZ3oil(M6?+ma+Vji@oievcCW?v3sXDblrBO>O{00T>MMps zxUyCTW#6=7QB4lY)~sUDnkbZA1C2#v$FXS-d4A6?oi~e*bNK=1v@d#;9QCb%5#Un~ z-AZx4d&WkEmPQWhpIeN#Z(~TGtmci85)EMz_oD@7&w_rMeS2}J{plGFdT#u7Mq)Ue zvddc`1u?A2XAbbt2E9oN;*(y@>Ud{1JFRj_GJNki&gndE$3a}F;nG5k|LHSHSvFg=hhzpwde z(AGT}jAHF{*~|-sWS}Em%*&2Jt6-W6x>|owGee3F#Upw|0wi;ZA#@IF&JYb`o>}=S z?t=RN;N%v@Wo>~B1cm!0MuSgFv=KIDa`q67+sbc?53e9cO&l58j{D7$ALxiu9Hw#$ zP&Mu%J@?9e)3qd*FPqkKoLCQc6lb_5WFWVKS`eaNxJ_Y)plcnWmPus;2!u`+=)w6V z=H4-vg?y}~A2kc0YY$1$?5TihgJC0qR{`QpvQss1 z9P#}|0`Wc=CpoH-wkJG$r`8e+n1LI6+&kMtaCkAwbFeBo4lIr=Dfz5g?e^rx1_%*9 z1*t1{ML`1YaG1IA6c;sFJeH?STgE#DE;f;}=JT*`BJ-brd~@Yo_Q?vVvdBxZF$DoA zqThnWSkj29?~nR329(HVSYw}wN#EoGjVHAjrlXtCBMJY+y^`olHL;a8y%s``BpOjJ zxkbmix1UZfvT=7j5lm80bQGCv^p=t4XqbB=IGJ<`iwD;JJ&hNaE2iMZg|jO%bM?%e z3s=SWEw`}r2S&H9YD+I(m`*FI9C0X{ACKL(>lwW15;6g!Osy&jTXiJO*&Fm`g=;j* z?%T?G03=WV2YXm}XDUitRPxtyMH{w}8aUwF^Ko z&j1+jn*$m@KkuUBEAm3u6?L*GI?&MR&<^yNxZD~F)H&G;tm_uN&~#o2(oMAZ(3c=^ z*>(4F{4Ak=@{#JYfw_#x!GpiyD4bG$R8lE|F%-C01;BzmsF(*~wBV6RdlI?jBG37G zt*xw9M`dM03cS%}-y*~N7XrvV4bLs;Vy;GaU_^HlG# z!^%=xzp5v#?uV+eq>!5<*bx+)pjLxA$h_5<9hMP87kZb24#sAae(+P_z_;mna6DDu z2b&BBD|!UwgUyNK32gkHtGYY)0_FmZOdrdy_2pGF5cZ;WDo7JvC2@}ShyGPkyG&>Z zl&1~q_#q3}<9?~#;X;Th<&Ou4&C}0`c9KZNs?sxZohLM{%vZ63-mw&Jr2JP42nSg( zo(rsDzXJz=K@pDdaLc|cw7QP+zuT5@43rd>qrJ}QTOM&Dr$HQ#@VHYJ7Q;nQ|X59lZKRg}7xp=IdIKSeaf&$*Ya|fm5AS`al!uQ|D zM;IHC6FVce(W%V)>jCgW8eOPB{8V;>h!)z5^)yIzLG?!NXaNE+9t`vQ_@fP7^7%u_ zCmI^;gzNg-oIjPqZ(Q-_E#;z))Z;HM1JtpF&ia6B$1E ziQghv;HBq{axvQ{$p?4@a95*e1eR_D#T!!IJ336|UM{M9>6|VP7$7PaA1cpcdSs5)3mKD-Dy)2dMepDc zGV+V}HRM3eBz6a0{B4aU214x(aHC%6u-T`Q(rrFwhzrWCgK|ufvVnN#q{nk|C@rc= z6e-yhk~WU#6ef?Ksm6US=jxP}oQ#wu%5KcDpRw0X*z4BK?^!=%Z@xZP@iSe8pmVrP z+lC7^BM?tvK?~W>7=xH&JEyapGW=M`dW?XUjR&K&aMz&H0-O4M_RHDS{bIg4%7s_9 zXkMP9-)rv1+Toijaz98^?U-6MOWjc~Nb;P-Y81>W*r}U=XmU_48WoSGfWY*JFHl@{ zA)p@%CEYJ+bEXiyf0@+evK#=T>6p}?4lff;_^lPAxMa0XJ;V}g*Wu(K6XGQ;#!_w^ zar76q7P1Dq5(kEYd}XYI>2}aUwcYA5lhjeY7ps?a=hoJ7b@-*}+wRue!)0%~BUm3MdE3lR-7H~F zhA?CZ-E>_h4V0J2>`v*O=-A-#%#+=zFk2Thw{Etzg+N;=KH+iQV~~$bT9ZcHMvF3I z0aun{cwH97dL2g`bC`Idyrg909^Cpzs$|BgM^o64by*i9(`1ty8xigiy4qd!Qbn}F z%0H=P3Dqs}(b>0Vx@6g3)XJ8Qa+_jgut3E*F~>q;vcuok0lP1xGZX$2=QR$Ux` zn?C>^4uF5haWzR8(GQ{#unlNQjBpG91D5PyS0Z5cZYicQ02xDuku!D|z|ubg-q3iOwofBYe9;2AcY!`d#S>F z?T3)aDT=Up)gND={K)OWlD7jNKo26qQcK38w;|6CijayT&_s$ zVSEkm3PTZ>l5z;8Qu650BU;*Q(jCK*oxSZ2lRg^(O1OFP%QBW^96N@FUoz*TEB-ok zy{1_6!DQ0pfErOuko!D?pFJV!qfr8@Oz{WA1mY1cvX7 zF^VLiaN<-SiCdfM?gZH+E+gAn8qN%WtZq;Xg=yRKpH2591cjL* zF+sFe#q30C7hlvH%wI29zT3PCY%0u>Pcf^A8&!mR+q0@LJX~N=K__6|nj$_5hdsEf zIYsn79is)ZXPBqW7oBuYf`jr;r2>SvG+7zItvUrORaSM|8! zfb=Tm`a$Sd>gk8Hyt48vTPf4;mCAV%%6^fVKAd8}20r~qY6j--6-XOXjUpRv)IOmm zsVRO3oP>n6bk-wY%aEGNEx zS@z>8bC#E0>%VU`Nbd>-1mlptJC7eH?4pJ`j%+-dU}6jwEp*~?k~&77@&@+z``+i; z1@QdM*0@QiEAppI%vKFw71ni~LW@*GbBrupHH&O>3@x`X({!>Am@6aZnVOETu#lb`6=RPB2D`c^1MZoV5kDIyL*P*)hi?? zp-i`kpWz$gFlGwE`8-5C3i@D9B0_>6z)!?8fWa3J<{~oHHNthBoZm;p;$*3ua}SYx zTJyMtOmPV*+=BDEf;gEGqQ2~RNZV1hgWUk$pvOUNu-6Sc+zlDPhCf`dIAt$!tLvb{ z9CrmNO%&zt?!^+J&odoa=5b<~>cGO9X>nZ1Z#xgCEOGQtF%Qk0qvn1j@!vG?-!$-_ zlLi{hyc02u)Y^=i&B^zFBg&+Z!Sg~9;Ocr(hE9_uFb{M@;$4q_XYwn^y#QO z5|{GfRtpn+ncI6~A;;U>Hp5SIH)=s@9lFtYd@~Bd``C_n4II7B3clXI(Q7}|m7xZc+b(~ke?Om^UuUig9txJY zBswx^S?BkeHvK3$ZjCY~D0I_B&5KSw8%##+R4+E{K-!uFDjdJSPTICdD-4RTgclZF z7vdF@Qe*M)>aqcMO}&ID=K6$!+EChW^%%17sxWFLDV?@xd5|oxQe!X7Me@aMQa(O8 zdU3M-5}L*+Ehh1F`R{utr~5~T<+J^ld#7jHFORAE;^Rl%%T9WkG@I>VZ<67Ei;poM z_o$yVN;^Q{K0=wa-|1drY3S}4W6}5J<{4G{Z}El^kbuL9aAY3D5ZGBT}wM^w@V?}o0Q{BUP-5WG$OMP+`clCx=6^>2>Ssz>oU2@I@Q62ah2wB z-x9+eds$tC0F{koOV(j4sSrLevYMJ4`;D^fzVDkDE=r>1lyioloD`PioP?f_qHmlu zH+fcOwKck82WoBIGdtGnCb4+|*a%J9@u?C(2pTe;ZT>~b;mZWSV)uChirzjI29c?5 z>@RZ!Ed5aEW90X$o>}jJsaXoERm&wyL+lEjRbmaX$*q(yzg&;0_(13IQ@fKN*+UO^ zZr{qBFj4GZNi6LQuSR}!of>DlHTviz*BE`i|Nqt5Z)yfm$yR@@FG~pB@@iv!by!JC zmG68g7Wlw)~hrg~StNObP|ErWL$#)Sig~&H1mssSot9}8kkf^}S6~TvGzU07!$lWzmX+vTem)LR8 zpT!r@A%_Zi=#TV1h+ScG-KtkT28vBFNGRqFpa{#B)6m1?(ykP+r5mxc;x5GRJ`~Sl zMHCleRO1ZfiEKdeU&+dw#QyH(ttQSCT(lD~!-B2qp(lm`MTQ$&OKNYEr^$CV%&`;k z_{sPGvF--*G36J%*gf?6F$EyL>~iBcHfOr00mL?9TfT6(PCHYG|7Brsf`vZnjR(y( zGBiRYq$Xo>oR5ssDP}!@SvovA+yfSL zc6XZ1D)L790A&(~2ON(QO5m}Kd?w8&{M-f+n?CD%x)=-C(lfex84eKzFVgXQ46r8* z6vx6qJe6@WBTB6#e8YxZZo=(KcUXxoyJQfpP6so1!mH1Vk7JX6{U!ks^rORgPFZe> zOwyD#eGHqnW_MbuB>A|uk}UD~tH~OS`|~pcEec^ddW(T#G1xL&7=h$*gT(#$C{2Gj z-PIV-#J01X@cd+N556>iIy(8=_Q}z!!`;Ql67!Cs$7|^WC>>9Rn7|XqBsn}|5M45~PO{?$nl4w5?X+bHLpo$1zl&S?|0cx8btfYaK0n^3g zDv<=o6U^~yQfgst+fggKW>?Ev55qJ{Z3)&WX`t{Xl2bcd11O0Nj`8R;V&Wvzm{N9N z*s>;j<@kjrKQHbHT~*1UYo@Pbe^P%^{}XKv&3)}6z|;CVQ*kHd^^@gK&ePNSn)eI> z7QWJC)}m<)Z-bpET+1aLu^)pAuU(=mT1t!+T2k9Zc-40EXj$@%m7P4^*Tcz&f9UW^ zd9!H~8d$GmHP;&{QpB-LP%@{TC~$bge2MLHf6zn~A)L%Kf^u|>7(Ie1MWa*=jn;}B z>h99M(J}=#R5IfoV2k>gDI2G2?cg2#k*g7klDNAlii&9Dyc#5{Q*|f>(FmiEmQ>w| z`uycBBBpCojg+2!y>YjiBL2&En)!Ff@v#qZy z#$&DW^%V(*IO<{pB;PVcoxOh&Q4OXV^YwP4Hu=TC}YAsx}hG&AWsLO z9_1dRYi@`OeV(ii_JXwTX=07EriF_%SD>bWlN5FF@3?^tvK(uX8zBxO?T>9vX0O#o zS<0-&+V||Y7VJ!&+rk;p&WC=C1d_BDKsnnzKjdR$z6Qf^ka#y5Zsz=js5kCuql}md z=7u@npmOvwYW6B4$Ch)Kx9-c?*X_RlL^Ss4T#-+mxTiCto)#go3Ebh%&kuXrD8=HQ z0^p2ce|*gzerA!T?=nSix$Zc};tf_p7FbS-{Pp`!;?83-4jUJa_an^0G)l7es5>Op zSiyM(1DSbt-Q}qDx^aCmobzb@LpJXNZu_n;x~?evfvOx(<}31>PTLa}5u7k8cRoJv z>bd0Daj@5RBvcDX#4TbeX=P1*5ib+a7cLt27_)Q6>LFRmhihM)>ha*ED6$z5D0HjK z+eq>-<1}yh@O;}&uma6<&2xbIoe5>zb>ZbZR0!j4*WeQ1Yj@69K@N#&pa~%x3uIr^ zPyVhqScW|7IeRgS_Dh4VQ1M`IP{vr=TOE8LbBNVGRc!eEWG=c?xF76=w)En2FueRd?>gMz}lf?O^ z`)%uSojX*#E<-aG&+YgBn+&88k@r;hg(q-!-6c(W+{Dhu9G9Cv9;G0Lzhix-&EP@0 zQB11Qy1Ya!i5hAEK>_KjI~WOf4>joEH#I3USch~=O0I4EDFT~b$zkY;k67_B?559+ z(zG34`dC;E!9MBZhQycn^pSpT+Sums^ep*I{|_M{TV2NnC1Ef1Cg~>d8C1<)AewK} zM;hz9pjSg+Y`1nh+3tLs5cttVe|KP+(fHD&UX6~U;S3ugJbP45B(2=(hiXO&FOjQT zjU1MCDnUOp=My7QjQrf>RD6g2u#ot|p8mLZaFCSOl3MK&Xg5Y!tkLJdm~M?l(BhyQ zzhNzaYH@?CR|^UfxK@jbi`>XnEWCc>3Css3L8GvZyENfLnw-CZ>6(!GjFX%8ugC`+ zt)GzmDd8b*t6#(G-guY+@6!Dduq6GbPna>mMw!E8N{DT>Fhv>p7-9~lxuQ1-{laqrqsVz6KxYsH;b7ls2)aKs1l12HMB zZr+jlF-zXB4tRKIf!9aJ*=#ZINdm(#e!fr`%5G96YoaZ0z3zRcd<-Xtr!aaZT3BG> zk|)Xfw+_4cy@3K=D?a)vVRWP`I`gTPpr&HLfknMziDq2RAD~$Kp0FmoSNm5R zIt{*+nvhB&b);yfFz)tT!)VlHVnc=*=A#PWz?#2|Qeb27I%S{hrfa-F_2(&KF2|pO z0o)AW@IqWs6IqT3#^V~0ZiqY+F~~zkKA?omID8KAXYLhxw{?d0DKhYCCQsI)lu|D3 z4Ks`w1^a6>xIopo1Tm>6$^Mu^!DhV{rn~53Osz-BO*(GjJvZ!3O!Ppl;5?yW7y$}N z@Aw83u(UInU@8aN>>b)Fuz_JbNDDT_B&tN#PV3p~uRpJ@Ru&%z)B)3m_-`saA6&s7 zk87`fPTpqMBoiJVo$mh(piE&L9F7JdH*SqE8kPZFLN@F$GBg9g9lo=BynXhgaMLh2 zB^-3X^G7}6H?auQ5vjJhVGc8X@l2>#a0oR*-ltL0X;|QgnrFnNrE@9BuxHEYlF~{v>t3GP4~jGm8i>=goPZA^T?zEi?@0h$@o?l!qRYe ziqejm;#cuGvQZ1dolYe6sK8z+*w~uBam}x2Aaq|Z$A}%k&yDgr0rck@X89YXI1aZv zHFZbV2!y3mj9he9XtJ2Nu-l*5XgHEchEGtpyYnRhOr*BEuM`xQ7NK)$=Zo!rjM6c}R63M6?H#2h9{{M4~3&1YmKq zw1l|)$g0C&qQOiW#EZxpd@#y(*-0Nv1L)Qv9n{SbY4gZEUbiiAa{1tRpHfIZH)yWZ zuQLP?E6?E=uK|@u7@2`ud(}#|T3@bxpRBG9Wt{J?>Ed6cD_f049RzR(zTFK94F!Yl z4)%XX+eFMw>%bpHG2qWJuPmVl918ub)SH*PfdF_i8r`%X?08)yCY}W+V~gAH5x@q= zSYu(1&7ym?-RPBG5xq)@7q(Z)mM@isnhi{`I&GYL^_&H^eb2SjYE7yplz>TBq7!fF zRg_&Cu_Z|G8!vy`>yYGLda9I}{nR4i zLJ2F_5Osu?5DCj!6`FLwVtJz>Yx>b$i1p66u#)?}UiUsZgxIdx`fm*oMomA7b85)) z62|`=?Tr)y46xvkYLshEIsNQRyW@^D+(>1PUg(v`p8&|n`(WS^>rm8~rHD35TvC*x z934HzD@)sHmH|`mk6Q37W8QAT5rqF zu~*%z{{k#>44@0AforSQ7kkWeBV+8{(n^FlvdjRIS@$TFEs6e!qb^YWrd;Ah({T8v z2SJJsbGe?6=$r#w=(XiWO+iv#4lEaFwQ_gVw#)q8wB3uRgPT;NyQ@gs2H}A%Jllib zpkHIbf+NUAx@O@jOMzMKa1GXqAiF0vzvRwA)~mqU|BxP?CMVwrF^mu2J2P`P>;CDv zy0HO#2uOpL4~eFS^f2oYnxKkdU#c8fE_OOsQ}HUnCb1(?97m??CD`qX8ilK_ms4d4kd?%0Z=w9!XVbif4Lf zJrR>SY>**BxAMIn)#(iem{(@Za>-&WunEO7sZIyKh#C&TiRIK7z844}~}f`Q(CxVh$-4 z{IZb+WJfX5MFu`~tVT0fJko|eb=OQ_`)TdFL$il1AGMZYd8DT4)BxU9qs;`FsLR~_ zj)Be(MjKINF&EubyW!qJn>NlI`4WDS?WncLAhT3$ukN)V^-ojY5Jn@}8MJ9zhF*dHliZWqr;h76p>tI#g{K{KoQSt??opUlFLyvop7ymiHFl|b*PI?KL$N~ z$Tz;(9~9aV#D~JURUE=!JdPwO=+LrGw(=a&s=47gLRMGGbB3%|ODhX89Dxrtiz?Ae zTB&M}!nrdO&K0@T4VzySXTKoIz8iY|o)Pwgpz8#yIb!Sckq_8@lipmQ-aD6vLbeFm z+1ea|WH za$$r*8tN*2yx7@=Z92!j`f1F_FWx2Ytev{K!#gR)J?~I;Jj(46=3A@XvL2h7#0&7W zPgh%}JZCX{l!(6;k!uWA0)rV$uC8-=$w?bJY-O-zzLE_uF`(r{9Jp!9{mk8woZVp_ zb1E?_m3d(@bFLlu4|^HS1OMM#R&ys4MI^I%baa8A{XD_A2TytfV>dE2ZFw#pH`SPx zvwTWOZr{RW8q)f>YWb^w*7OXvKu+)GoNl42(52%}Dc`s)_!{cKayDi{Bm(X+nmr3B zUCYEKml$QZZH=+~v>;}<=x&{o$$egC_Nf%ibEdk_P(qCkVz_Hnl5<2181$9xMf#5YBQZnQbA(N&gg(H%R*O8L+P;P-@+4lLG#lypW($o%2t1s4}QcWX_cynIeWY% zh&u41w=UJMs4qk-@iW`VsbHK4TyI{M%N8QQES2*wHCpIuSre7|u~}n_5^qNV84tkf zXE>hOT**NRj&SIrg297cK5kmDyt4!}8sR?2#B$|B{e5P!c%m^BnLms_K|r#qA};g4j;aK2Bvz#H6?>YjNWSEivgt&|tmdyP%e_{21x}om{$ORf-s$zK zrki?w^`hHf)w-ejBx>23IHyWd;|yrdxxw+fzT9l}nDWvjyGP04(HRgSaZ922E4}n9 zvI-?dwYhvxG$Xf$tLd3!-D*WiV^*OXBW`krm!+pwC?qhclm$9seR)WMk;pg|db4fH zFA7qGhJxO6CFoOZTScO_Qi99NSIW+lG;rYC+|m#LEsf>vWJq2@A&sttXRb8&cS#KE z=-}D#Sfz-?$L+}obBt}4<;UXV))n9*{DqdD@48rjv#h_k+5L=1*6JI(#$1>H5b4aj zO^d(Wz;oJ#W6ij;YGU`|s^GskBPM$ld?jD$t?opb;%>xhPBBx=KL==c>~d`zw3B9^Xsim;Y%i)Rw&MMP6V`wKLHosiPZ zwsWwHX^~F0Pkw2VnXp7%a<1GcNt9#c%{6DIt#=59NhAiOC*mij`Rk?Sxf0mlvGrKO zGXKtqemQqanpfXi;hA3xWP(H-L5cea7@4a4H zubPYLMAq>lz3TSSi`Aq$Hpb0Ox`bXz$$5}`NMK+8#235C;aN4XP(<(SKJ-RPG?vfY zc;EIT9S+&GvD%?Nx5@TXqRAj(LwcTFBU~y5JycvYNRk*vLz`D#;}ZuGYtgNi!tjF6ml-K7g0Q&V;>8cgNu)mVabNW2sSX zd~AGfd}=&veAoEC@z+MBku(uBdE*vjiF1~0lS(HgcM7HQx_S02 zrmY>D*MwhJrk&SUovAVIWp{)ZyNX=mj&b1x|CY1LbMp4@+-IzXzY-d$bmlVT7vYXe z-~hr|hoT)GEQI?=W45sS$zB?_+U;~Wc7m3Qn+%45Q`Dz4Spo{Qw%xR*jv9X-)<}QC z@%3)gAJO=BnCdICO4WN_^1!;$ZxUx#^`Oyv4(#6z55gR*Fun8Vy}vQ{j=IE~47hK+XzlS~LOtu^I6GrL60zA67PVR;a)1R8MFG_s^t)8_*?Nt{8_ z*g<4bAKf1^A0Zo4x@5JrSB@nutKQS&xww=g9(R(WRLn=&N$3F zRH&IBib0z|Kd~T4Ltvy6xoz-JplC?Aa3IlQ*@_~Y#7WCsbbFw2{dXceJ#TSr3-|;g zmUDyS5|BnO8>1;D4%?&$jE1wAXEogB@<~STH}yx!Dfy`4b;fwq;=rY32FFGWWXEW` zb!oJ#Va&$4`$)Np)NXdJQ@&Bn($sR=E`Yk82Z{8=VDBi{kzF;EGi1@|L!c|>xvQs3 zNeQ@pO?xty(gBayo9uz>Fqj z87I|1N!X2=;Rq#oCDfVR+}tL-2SVg8KZ1j3oIII=`lQ#*#*X&Mj4l@r#>LPn7W9_j z3g`^cEw+A9T535QJoqKDrp!(hd)%~qTEx^ey+L(G_(_>1%DTKmSr{pBwQ=H6MyEbK zOrJEm|f|awiiOm(?~H94sckT-JMD=3sUQu3E`n++eCX z3LEB(zf`sl+^(L~wsF35iPN`krtv+Aw&icUktteo5)wT5ts>+9Bq8@pzXn>t`m!nl zOVxNFdkQ^2B_|Z1FLp7vig-5OibcAw-diM-P3NjU487qnluV#7eRQD%A;v%ypN-s} zT_pqYMgz8fT|Q`_i+WODb>5f&$<|7rF_2=a`8X*79why)e+ars?R`q0zk<|Q&_V07 z6XJz?B;Q6sB0RJBbVj7^G|5eqcci?kyMy%i>O4vN{LP(fVM?k#6r;QomNr=N3A?(8 zQ7Z-J2Hsd{m5REoEN|sL;ojWQ|}zPL6Lg4(OY&OHdS>jI(ZsbP+h7 z^aC95#tuhY=?yqcR&uf0W&$)fguWR_G#&2q5TN@N{;x`j497g!T z1`+gO(kn~}J;<%&+UfGThmyu7j>Lz8m2xfRqWfJkv^b`Yg}5en6b8qPkw@!dVC`mA z`!6U-C^vQn>@j+z#4yfj>Il-e7iVc;qDriZ<-8D;hMiy8N#_BHm z-KvN7pMI2S)|drOp7a)N0Ad;c%-6!P`lFpzJZ78f4N@etwIFj;5SUP*EU`w|maCt> zCj+IrX9dxJYp&80*8sv2axFuygwE&{El4E;@)q_TB;+g8#v(zI?F^mLd7*Mp^#H%rt*3Q# z)V{4ca-^j5kr6+q9KRG6%+;!q?1PhB5qai)D`QSlqA59gpoQE;h`*;G;Nx!EnY8oQZ|=0wLoplQ_SA>Urp_?Bq(JGz+mV(jqTb96UVQ7^ zbS3pN`|9MHDtXgzChAl!QZ`v9{oCBqBeN^Ys2q267gbYklLy^Uz>VJ~&`klF(9|M% zBmCV*01rS>yjO$LKHZ9vCW^jmMhx(~==tNFmFAoe%_wda;*&14@6s{_U8VrYw4^`v zx^W7e8cwZ-TP+VT6VZGjaRZ!m*P&S879M_alrc&THPA*KB1e=>`;ICNmYqwGDW!`&4zBbEK1iH& z!m;rF|2#X@8WnDOn=l_J&M_378XVpiOBF)7h)vPt%1JW58Irzu6@FM5(e`@w@_2Xu zgjZdP>bqPUW&W`$M4?tL+cKz-Vh8pbhDYX-)GWv9_|LU9``Xh_(H@XI#Iuy4>Yrr- zCfjueoZ{9kPPv9Zfov>M=I(I#;vZ*m4KT`<)nl46cYYbJa35E;XetLkcY|)zDLO=5 zwmJ2PbFI@uC=wS;-~>UJxt7ucgC0j-Hu_?UCD;`V-lI*@otKWpWz8jIy741m_t*{` zS)*Pz9U1M@46G||<4sH^fl z#j8b{g$axM1HKlA7SLLv)xUk;y0!7rUG96u;ReG-msd8!)`EuZHLc?Jpo-tN<*u1SHN%;QOLdN9FW6H=qEW?ZO!O-fXd0%HM1gJ; z$$*aL#iBO5_~$lA%(~7sn)3_~tghynVsbxjedxpFl1OCTu@*+EXA=v0?z>yGCA1$f23$nt&N(NRnJT;XT|TEJKnoiAk&bl(_>=mHt>0 zPnfM-BKVSp#|9y*ZZX+>M4xI8@~7lBY5hN~(#P{$R9BxVs4X;s+CvzL@b402E#P(y zQZ`y`Q=XPL`o%xiRQ?q2NxZNSd>8EG#3M`&Zh^^Jt{2_`KT3WANz~pZ=YnxEr|XF} z78tDHnR>e-s@0a}siw5jq-h1FhC{p6I=4`-+pa{NOBe5Gn7&wKmu}3`>%I*-?$VCU zg0UKblCff6wPx(oFjkg=Ldc>?2!~^l+a&T-!f52@Zi|&7L@h8z`acxjyc1^HLf`>U zs}W={D6QH?JUkThmJ5ZrfUC`DN&C2a)gK^|AyLJ2puJq^HatBfnyi6L)HgcxIDQf4 zT2cnvx*Bt)B}}wbD(lS;2K&n^Ke(uwvw0C_YtAnO5>}Tft~=)g%Y<%7$S})>MLxAi z4Kj>0aNtgO071rSr8gqoxMv8RACA7^?#^t{{3Ptxb_a(xFFQugp-m4i03-2mm!3O$ zCfQG78M84?W8m4Qlb(8Hs`I^r=J&T+i5ZK0>G}El-YVNO$X+SC?>x(ovr(&`AuEi~ zCUKiq!Z3mh<^oJ}JZMUW(qcg@0o`UC&eJaR61v-H{8!E->gPMH)-86=xX3DwEw7;{-WdB+4cf&Q|1JPwdV46qm{$ zNl|vN)7(Bdpa`{IB2^d$e^QMaKiL?q{2UUMNC(@8FXGL^2h%wGcAAE#_&kyR0wN62 z35p_|NE&KNVB!cP_9{Y^(?A#DA6i@$n!J3QyWMQqYuzUA>7rEQ%yf9~%)hX_bWX05 zfIP>@vYw=~7o30T!5hqHUR8R#m!i*fzheWc8qtuyeX?Js35oPmIv?HS1NztyGNT)y z6K&(|55sIq3W2rzpFqF2J9R9ge1Z@C$iaB&DZGNQm3rsyBP0@Micxeb)>a?&H>_ig}^ zac45@q3up2YJ`k{_OyWxyBnhiPu|a1I`{pIWlc+3LqU~~m=InZQwAtBzmaWTFpvTj}05iTzF`3{IABI>1(RXsQtiWWrjD>0&cKe!Dn_79rUNZ=flM7Gk5 z79@tF=3>If&n8=IxHk=Th(}n@D`9e$!c*)sEa~y@dI?iQ4>?oVz4paFQ?GuN%15q$ zBQ_eLkw(r+W6_CeUj8dOINCfy&W`%Z-%<-cOJM_*%Q<61BNtsr8=LS*<{ia`c_FX% zE^|XaSK(iE1;qO9`Tox@_cqjjV3fM9fEPFpI2c9k6;odtOT?%$ZGML&PN(BW>12P! z0!Oq6MNoo*8Fr#$nyp?a(kn!%5<~F!Q8~nn+eKlZ=I?hSiKjNfRv5N8lDT|-i}d1Q z^u{$OWV(+gvMn8E#uzByB-)a1=;wY>>oR8pSiCp#4QmR;HWsm&AOJ)AoGJ0>I9X5M zlY)nmY2hK-Vd=nf)@nb&d|B*Ts-{ZM&|Z+LsPz%k0Q)M$f@yj~HmP%_?hBozlE{y9 zUGKd-+TC-d46Q_&jk@h-D22E(2rr`54|`IPDgiv%sMxni?urL}5_?g1kN;NgH#ANU znmlrbgKN-~>&nH)-hmStDG_JVZD{4kNl2vk|MS|`Os*Y*$l zog%w?G00R;h$$T@i(IY0f^}d_i0=AFVWnp@U00zk08AaQl8tO`-K|%vU8XHG(agd& zE?QZ)9Sqv_&_^Z#m(8@phIn?~2x*Xl8t0OIhznG-JgukmNBgD2f=06_n6op<@P0EkL7evJtjwS#iRDLOFiA0f$1%1!W1j*?!vb$ zP?*a4+yYT+0?d(WJSZHJ@6PQiCGoaO|FkCK0nUU2=b~;)Z+lS-D4Kl4+Lp2bmL~fs zgo7~>mlqTpz>$-{%y}Ukmj2OaE2<$8F&WcMJ+iBF{)iV;%M2eiXnm)qR z0TM|HM*$o)S29$WG^~8Y5hl?YHz)Cwz8M2gUM8 zdsI)3Pz(INo24rpag{q8XKC*e`&2e+f+oH=rjoOcyov9#lCu4Gj$R%^e>JgD!V;%P zuTFOM7^aJlcjloJX5-iZBcv8563y}4GoP&C4PRFXs4R$3y4oONU%VOtBH=i*q4ytW znemEJWegyej%t7ivPZ|vzM2F5cz?&FfJJb-weXssYlgM(OSGm0d9i<5J#_vuX=5Ab z^+81(7AIYzCY;_+gTs*RCIQ-C2}U;+(it~V&qx`LG~pz+4=wdOtx>1q2ATi{OSc}| z1lvWG)ro+UkWHc(l8{C8P3<%ym$kIN7a!ZUHHbT2P_(OYE{pd8f)Cv~s4Jt0yyM};w!+Jfz6vnTKI}pmXedpus3lUwc`4r8Q>9#Ud%tZgQ z1M|lK!_IO=q87zC+`)*jn=Dk-_61N!k}DADb1WF>AYrJU`4f^JMlYIWe*QJu_*QfpR;A8U`kd{{mfo6 zyLqk%X9N%#<;f8+qu`T{C}t?|ukV0Hpeb;YyuwQ;vG-T0#01*!vO5FacB&HtYKHvF zX@$EBU-#PfZU9z}Z2$1|Z2REAImifs<*UO5ChW%Hz$U1wT#2_XdO@E!7R8nhnhY;M zoVsF5gdmb8#Fnl-tOS$;^TnY5!=)MlaC@0VO9fgCClen2E?zQ*(~|Syu*9d)52w2| zYyt*+(X*k*l-SNeUx;oF7)vfx(Dcqk3QHx{96F@1AOlsMn1@4_*W^zXppcS z4m(hLZYARZa5uu2yR5heK(}xIykusHj~j{H4UJnygVu`{B3GJ9GwQeTr@|K=s7j)OyTNBwwzH_ouFqDK+u% zXc;k6&RE!yL%wB8<3|qBeM$9J5!SQ7R2K&UyM5ff(YB0;|HmSex46G?z|0%EfA7COaml zBL|BHwz-D7@0t;gJKcj!GVm%*{xq~A#|i9sdYPuo4( zXE-oBPQ0v7I0VHd6Pok`5K~J0=HOgT(h!Q{zBPQb30$T^05t))OgS`9_73*8PoWXj z3lCfEx2V(70-oLnD-vVoEIyq8LN0V36lQ|LZL_^tkW(?Sj#{;o*U1|XmGXXOvU!;$ z1Zt(`MeO_IVN_16nNFUHv@}YlYB>93=hex{-r?Enjg!5O{ zW*BNno0HLDLV{*1&@NIaU+@CBvB<@}RW*B}!GGq>0fdCYXe*CtHkm}Nz(%9&ZSS#j zM@|Ly6wtVvVo()(?@9A0m_tjrraC&-nAsTUlDdF|RMGcjAnUGXa++^DP98BUK4d3SsS#Hqlj1lD{XxZ#lqnJ4w3S%V zq7L|vl7j&(Q}TDc%-X z`%3e-;w(X`zd_b}Jh@;i+~hKSpXkgmg{wJn-(PpFhz4KlTz_~Ale!)!OFPwM{V#v{ z(+d9mpY-=%RuUNG8vXr*{(hP~AAxXvI=CFaM}&Qj*@nfxcfa4JCXb*!jBtm%10XJt z!Jq!nq}yjCQ6WzV zc@B(WWMhuj+r$EasCnF|m$Y~ImJjwctGWBH)lPWu_%&JFPm zpc(2Uu^p^YH1%g1;Xs*(Cq(;~Sn^Zepo+~PBSS{2TDD-ic2>q%>KgVf^PK3Ch)f!5 zXD=tc6>I_uCqM0<{Rn4DvVHhV^3(Ro$@bydFVD<9Ei!e?k>7Au7?=mF&iIxx4?jv? z?w#!X2vxR!*gx1m`vvFleE;ll@ANczesq#-C&$|-XZt&^4z^E{<5wrgN2hpmBxxZi zGkh^f4GG|jqfF-g3#_9X{S@ea+C|x_#lfU!t`z~bH&7;P?7;CEN|nGst|aeA-EpcM zske%hq&&dkmE_yMBxfmV%aUUX16WH=F&1a?^eOCx9|qYNi@w~(%4<*7*Vk+7PuF0_ zygJ>MX>F6kD9hi%ogiMw2#RO3BI+z`!$EAC73s_oGg~9l-dNp%uZwG8W&dVfBEDX^ z#!RSr#!?ceqlKy6+r3FAHCsl}o-VA-XlNd^kBn+#BI`T$bW5$Vr#EraK%~FfG!WwC zkEe_|K-Q+793}TOVw(<-GB!6D^!tqBXtSYqL9BIbjmM-bJ{RIh4wq~xjtX|(WptQ~ z+GyG%!K3Sr*~z7WYg%u$?F`J@W~;sF7J=hTJZB1upgjpsL2_HIvz2)bb)0mLTVtq6 z-v&5$F8+Y$B;_YTg!L%Eu(Z=uqKqMI@L!X3x>VlsLf!ZWIyuaB$5xyr<8vZtm$-3t zC`&_QN!`b5oem+EP_-&iBvnk@OpxTUQMEr!lGm<3)%d@Z{_64HLotV9&H~s_zzUb| zJU%&kakBlAu2WvU1QAd5+!D8-aULzfC`FQjen;eBl%QFT((z=37AOD{vdCv^EiueD zeuQuPgZF(PTF@Dy5Vk4}(kPD1wF}O0#WP9C8>6^JD7AMho0^Iv|jol$u$En>$kV{_KZfzND|lh$&J|2@VJA!Wh~`( zbH9ENHl(TE)lUXD2P+g$b$PCJkcHD#t zT+y6)0i6ZD@o@j}#fCt@Qb$x~IKhX2^>es45>m;klE{haF=6%s`Elepkw^%ifn-AB zJ$!Ue$IlgM`G&+2ywh`91Cr(%xi`+YWqDQma-5EO71e~|?cs}2>jKN(h~#Y`ATkr|`P&;kj<#XC`7c#nh?1XSmo+ACElCA#wI(f6a{d(u+o952Z;q(0$ z%^&x+clS<~FsybJ!)jOS%d3s`RiL}UjKs0jE--r|;1Y|kgF?i`ou=!6O`f=MH(bp> zTXJ0sH&Bbqjn&nPyx4&0tya!Gf9K*Z z%9p_Ql!|?y?G|yX<#!2E(SN}M$?%S?o65?Z2b9y=RPs0bd~#Zf)4qZ&18vol+W2+| z+!$;d6w#fDpmiY{fPZ37A4D}ks|I{2uL80FqRAK538J8zTq33mq9D3HbI`{_lW$Bs zynk*i!Nu2`BV2R2PR!DjZVjYU65(zYm7L}9kcwBBsu1>p)8nQa2)dAA-qUO9Dl(l3yfy-vHXZUC*}N> zFD1>Zc&jNVPEU65p3R`MDfmfA=xuqmy=qcT&@c#jrDn;FWx>q2J#-7md_rH|xw^i7 zh_0{wu7l7NPITJW9II1mInC1$zxNiTs9HO$RzZK{rE2m~^=xa;lFt=wtsUPoz4XH; z)WZBh8>TmH!#sy^{l5E!dzf>(sJiI)*eAXD_et-I_lcdzov>A_&5L(Fyh6lN#ohl3 ze&=3jzYyX(JBX$I_AOsBIboS28vq+W19&TC=$3e_51$dSNI!7%=CYSeKcp73!v(*w_h!H}oF?b8_fsMUAZznP7&xVsx zcQDDEX4+)3O43HFmyx9ro9Xv6y!%5_HfV{>ep&#?t1DDQvw*p@z5nxy)7I{*m1O^9 z|L5u~EgiIQrZd$YJaAPZTz#z)K_=F;>$@Gj-?#T%wpZJWt*85_01$GDab zVfELoEFG(<$uI||CtTxHprZu|S#Jg(K z4J};|AFixLl}{R&taqjnqXaZX8AG$x!Ro4VNjxN5Bpja2ZYSC73i`jkOaIsR?|&{b zy^kk)#cEwHFamWiwQ0QwpG}HMzNWVBaG|2Db(^DKNNjNEXsv{%J;Tjp|;-}j<`mVvF|vF z8#}G3BZ_npAD@COTr7;paM>S>I*G7Q8z!tV%ME;iyU|!(eYE-vf34y_@R+P#;qxQ> z{Y(TISzP>yZcOOMOP9_Rq7HxPRkQh8D(la(=F8(%)z?8n22-)VYKtg_yD34ObWDhc zS~i;bjDcy(*yvFF#i@?Eie3xYn9*o6ma(_Ey9G<@%hG}wg=~cdrOE=@>a@0p@$4Dh{^HnACzdCmfBGaHm9rk4|er(a*_fX+;l(TLcYOON=M| z)Y1ZpET|pL@SRC!IL{>3dnU&VkdGP~!A@t6vQc~0y^Riemf(94gA^3IH;WXub4MoW zTlTwA^Z4=-9A-^660f@L*4yNZ!@&(Mng?eG`#+p)pX~3QCYv&*daos);i1`UH93q8 z7Qmp}@?IRw>uvXCHfXTKe@B(I2Ocj&)`K~NaFWjQOMD)gM;S&;aT(Sm*c&yV1zB4OYCrjr$8z&pvmE|Ja;)Twd0feO)BD#`0V|hBqSORFUt6E!~{#VRc0;p`i z*mFAiW_m|5+dFlI^MX!vN)C?gK0nxgfke*t%?AR$v4)we3VrlVke(Vqv{kzv4Blc= z#9kjSRB9@B*IPi8clS=ucK1)J<)t2FiLI`}zeM8dtp(4!*)+p9rqiq5;h^jGr=L8) zsm*iHb^8x<&_O$QJ?Pe+ur?rZ=j3^f84ry0`k(9HO2|{^2*k=;)>y9FA5O+XPja57 z-;l%Sw=1F7>7R4Hr|aT@ip`)CDm{La%;AelewFTQ@~))QJUg)oR7qk$g?_xBH7QMW`4 zR|0f`<~Nr0?zP?<|50pYnhWVn|4~x$Huv0M>tNuO7$VhQol zgJX+-ZJ{H+a%K41KEbEIA8()i=oKEmy+Vq@h09CwySln10p7U?lLH+_q=4{*TF5?n z1#v8Ns&hGXQ)}Hco9zxf?Cj#$fWa?+{QpmXZ2o=k1PS2d`seZzerTTV0mQb?j!vqi zi*I*K=rEj*{M<5hvYA~scel^BWjOk-n$+4T4gcwzZ@i-F-jy%y6+7KI**`vumXZ;O zg*Fw@S2&I;MkUeQclc3oxM|)}vJNPAcy#h|8#zXu98l=vlfB@@(dn80MykC!%vB6u zVb$QBaF)QD_2BFRc+v}i=Jg;OyYKNC7qT_FO1%&K20rcXL-QDg3(j<$XGA`Ty~TJR z7*>9!Op#3l6`|1Lq*>as>I zU_vGwMr8}ayS<$=D@ht5u{Y2+A|dt$Q4!IWWBJfNt8nO7G}56h=!k~7mn0YZEwEr{ zOGczZzk(wc+FC{?3}2x@=-0OrVOSQ$!B|-%59azqVK7#Mq`|N>ih|)gk^^Hcj3RR( zDKLCVBB0*_$$++;5dfX#5a};~tP%fu0~h@)R?#NTeE?kD-Fv?M>Hw+k&cUl)!qVD) z9sV=ajDANq-r{2*1*C$MO$Lv2ec8Ne-2!*AX(ABQ2zGX=#Em~cm4CgCtF+1N@9me( zo#SJYER>|!XZ~y+I}OJjicq`gaCUYMc6I6;S~5B= z3RH)M4t9&CX1ft-3%{A4wLwzen$1_yAvUYf-Wkhs>6n~=cjU3nkJyCJRRo|t6|4HF zEy45I-p~7o&yVQ$-p^+z+f6J{HRl^rMEMD$-`?HbNB4g?GXOwDE`wKC=p~TU=JV}? z(>*F+AI-MNc4=Ph{@h^OJd`!>B$NXSR z$Zvf8%M0Qwf1>yLutocv%HqHDc#Ki}=mq|QS9?1@9^ni8S00-?`l7j`uMW+tLw$8- zUY+5q7bkl(Q2K!{e%^!Cr#JL#3)#vY2RQa=%W|B;=5D#q&S%ToZUwKLLWZ&3^53{c z&frC?HSYsduv(5S`H3(0e>mJbQ#VGtX0i9V;;=S;nhdF(7&UWu(^VLr99o}FOLY9L=`q|`>z`t9<`1tBFON>noX_^9Q;;H{I%V+L`HTp1 z_`)r~Z=51PYQje3l~YJ$Lbs5-qC&2a$YtC&Pz0oW03UwhUw9CRw2dzv$(wj?dWS#o z1>!ipz#k|{+p*X&wA#(~xXDCIf1B5~clX(RHa$3x%=h*F~KXL^7S7i0lUQY8J_68X}VD}@{Fbz7Nv z&5!0|dpNP5;K6(tI8_F={JXT@8I0^FeumFhzp*7hw>XUf21CX;&G5l_6sgydc1Z{} zW3^BENk*!__4U9OADFUsl+L5QRFiSqC;D_bFz@N7r{>`I`m{w{trX{9{0e7iU&|AI zLSYr}OSNzB1r$JgApXL?@D<*6H;43&f5OWFChKq~;k`gLk%6`WbX*C-MPgr|N@me3 zGx)_h9o<>@Z?MR1hSINoHcv*I;b}2M!C@BNeYT%v;q8 z05!~*xA?ez`sz8b&wHmE?(YOp9aT$p{Qt#&Ek2H_v^SDM1^9F|x2TeR4Kq43Y>|ar zI;5~Hf2BYb4YKzlW4KDRS|t(XIznx^T!xp+Rr3O>c0zqIUa*vx@GKH73;q-hO6#Up zgX0^{i)(6Q!8k@dbJ`T^S$%~Dcl;YowfGl%quSn8iAH_vS%{h+Jp>c?R=2{9#APc6EalKQCqhcOJY>^SgOrz>5?u;DsX;Q@BY*m}zP$SB zQ{}w$%-6pGe;-aaH+cC|)f7EualBg2 z&CZPWS=6X9MzF=q%^(~1Zh2+po{N^0r?*@$FR^x%3Zr>ZaZ!oX0(?ZfKG@)!H@;OP zJCpKv`t9Ps@?X#4QLi14ihPHz5mdY_8<%Dv9}Ubgg&E)9#YN`p9s<2{sdcb_dQ6vFuvBbfP$l7zvEM1^ zRFBjV<^%fwZIW)DlTT#vDPR4Tu%!8s;#(37|0+!E^^SJjvf9Im^*a{+zqGdE14Zd%3?0L*hxHZs-bl z8=N#Hxr2Y{;E%yofs?l+S@6K7z{Il}THoZ((Pd%teE7a2gPFD({~F8TMO0X#JKZK` zBdwOp2sd3L9sGuj+M%)(vp|a>i51wC%jwN@WiD{2PD%f%xMf&rTuoNXx_^?{pBV6 zO~$8e9lSzLKi)I6;tIoRoMmA#ynMvA*olP@MZvz6q866=puPe&DuB<53ZSOw& zY65NMzST>CJV?y)DwlAf=gOvvT7D^qwsSKTqx-N^avYbT_NoVu9PR3Ow25G;bAZY? zeg|w`6BG!pHay8U5R9JVVzIlr5sAC@w>D$OI=cZ64h9wMew22!1k|Ta;(bI)`@Q+{ zDcvw3gK4y|^kyT`52T}|0;-n7qsEi693xgFPNX&MQk0*lTEf}FmYy?$g-Q(vU3j?C z)rLm;paJS{yl1sv@X7m(_tEwhpC@Q-pG=zi8+rbt70Z0cF32;OHVHey*RE8Mlee0 zOu=X(G#=QiG%Q9j{jF~`$W~0dl6ZnB3rx-`aDxWg8;J!x?F0e2Rpz_j?WmHRT%Y7t zkhgd!8Ye#IL!)`ug>k&=>fq=XVa4_M2DUK%Z8qEGU?UL$T3=}CU~~G)I7byXYqJ{< zLAOz%0G8PJV0Vk^AU$c{EdVIB5t0s_M2MLiNe)-z3l%BmuWr5}S*SoE0zKvs#((3N zPy~o<_8j^dZOG!|Vdruqfxn~&{zV`df+#l3^nIqUT}tlKbpdcvq?ElY8u;#=q*6Nm z@#ydukq?D4M^z|~MM8t=D)Jsl@^F}Aw~`!c7cJO9#XBv(%lw+ASvuLZleMZ&|-J1pG>a;K;CC9j{> zzx~U~)B2yDR?!wk1ApR~$0-5P$b~kOCP&XW^{dT0Ez#@}a+^(-@c2Ew&Hj#NCTP(x zHaWgAJthW`g9hq{M|(e`k?oAcy?C1)SYX9mq5UG$oUi?o=r_GyTYFMl`!;#9w(;ai z%x}8L|2p5)TrSv8*H-?NJchsjj4s$ovW)+&!e0PZHCX))C;>EIzy2Q9I(dX)FMr(r z`<_XXQ^l83wp6d@+}}#@9W%#YPKPe?XRCW+zBM(DOJT_(SQl2fx66BRi+6Q?zjKh6 z{s1?da@J^b(;5wvF-U}H-`2coWp5L*p6ql+7-Vh;<>_FuMmn%a@PCUoXtFqaZT5Fw z9?xEvu+-Ew2@8MOdgNOB1J;7pfH-^lHR+Ei1w1{ByEjaA>?2Ukn_-f5dq4xngZ|Yd zO@?UnJ-BRk($@I;LDp@aRlCEQJ>-gg$$H&wwPwRzzzH+BnFF3!Z8lKDQd1!t7XC8u=34s$=mlB_ zH!(8WfPeO~7XOf(%MU>Sc*SNfMZVnB#mE=`vgL@h_XjKpaZng*p~XpwzZCeelV(Fc zC^Qx9LD?^ZdDz$=0PyU#U%TuL1|8yI;6HL9GCv-7hl8QF4IbZjDS)8OUW%a5)TIc@ ze%Vrljr{>jG3gBPKZ5%g;=cN$T<0chz7&Dh6u37$Z439{C?0hHR{b&5 + echo $ECHO_N "checking low-level packet interface type... $ECHO_C" >&6 + +-if test -r /dev/bpf0 ; then ++if [ -n "$LL_INT_TYPE" ]; then ++ echo "$as_me:$LINENO: result: found $LL_INT_TYPE (cached)" >&5 ++elif test -r /dev/bpf0 ; then + LL_INT_TYPE=bpf + echo "$as_me:$LINENO: result: found bpf" >&5 + echo "${ECHO_T}found bpf" >&6 +diff -ur libnet.old/configure.in libnet.dev/configure.in +--- libnet.old/configure.in 2007-04-01 17:36:55.000000000 +0200 ++++ libnet.dev/configure.in 2007-04-01 17:41:08.000000000 +0200 +@@ -97,7 +97,9 @@ + dnl + AC_MSG_CHECKING(low-level packet interface type) + +-if test -r /dev/bpf0 ; then ++if [ -n "$LL_INT_TYPE" ]; then ++ AC_MSG_RESULT(found $LL_INT_TYPE (cached)) ++elif test -r /dev/bpf0 ; then + LL_INT_TYPE=bpf + AC_MSG_RESULT(found bpf) + elif test -r /usr/include/net/pfilt.h ; then diff --git a/libs/libnet-1.1.x/Makefile b/libs/libnet-1.1.x/Makefile new file mode 100644 index 0000000..d2895c6 --- /dev/null +++ b/libs/libnet-1.1.x/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libnet +PKG_VERSION:=1.1.2.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME).tar.gz +PKG_SOURCE_URL:=http://www.packetfactory.net/libnet/dist/ +PKG_MD5SUM:=be845c41170d72c7db524f3411b50256 + +PKG_BUILD_DIR:=$(BUILD_DIR)/libnet + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libnet1 + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libpcap + TITLE:=Low-level packet creation library (v1.1.x) + URL:=http://www.packetfactory.net/libnet/ +endef + +ENDIANESS:=lil +ifeq ($(CONFIG_BIG_ENDIAN),y) + ENDIANESS:=big +endif + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --with-pf_packet=yes + +CONFIGURE_VARS += \ + ac_cv_libnet_endianess=$(ENDIANESS) \ + ac_libnet_have_pf_packet=yes \ + LL_INT_TYPE=libnet_link_linux + +define Build/Configure + (cd $(PKG_BUILD_DIR); touch \ + configure.in \ + include.m4 \ + aclocal.m4 \ + Makefile.in \ + configure \ + ); + $(call Build/Configure/Default) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib/libnet-1.1.x/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libnet-config $(1)/usr/lib/libnet-1.1.x/bin/ + $(INSTALL_DIR) $(1)/usr/lib/libnet-1.1.x/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libnet* $(1)/usr/lib/libnet-1.1.x/include/ + $(INSTALL_DIR) $(1)/usr/lib/libnet-1.1.x/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.{a,so*} $(1)/usr/lib/libnet-1.1.x/lib/ +endef + +define Package/libnet1/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libnet1)) diff --git a/libs/libnet-1.1.x/patches/100-debian-subset.patch b/libs/libnet-1.1.x/patches/100-debian-subset.patch new file mode 100644 index 0000000..ec3b932 --- /dev/null +++ b/libs/libnet-1.1.x/patches/100-debian-subset.patch @@ -0,0 +1,107 @@ +--- a/configure.in ++++ b/configure.in +@@ -21,7 +21,7 @@ + dnl + AC_PROG_CC + AC_PROG_INSTALL +-AC_PROG_RANLIB ++AC_PROG_LIBTOOL + + AC_CHECK_HEADERS(sys/sockio.h) + +--- a/include/libnet/libnet-functions.h ++++ b/include/libnet/libnet-functions.h +@@ -1429,7 +1429,7 @@ + * @param ptag protocol tag to modify an existing header, 0 to build a new one + * @return protocol tag value on success, -1 on error + */ +-inline u_int32_t ++u_int32_t + libnet_getgre_length(u_int16_t fv); + + /** +--- a/Makefile.am ++++ b/Makefile.am +@@ -12,4 +12,4 @@ + + EXTRA_DIST = Makefile.am.common + +-bin_scripts = libnet-config ++bin_SCRIPTS = libnet-config +--- a/sample/Makefile.am ++++ b/sample/Makefile.am +@@ -60,4 +60,4 @@ + ip_link_SOURCES = ip_link.c + sebek_SOURCES = sebek.c + +-LDADD = $(top_srcdir)/src/libnet.a ++LDADD = $(top_srcdir)/src/libnet.la +--- a/src/libnet_checksum.c ++++ b/src/libnet_checksum.c +@@ -42,8 +42,10 @@ + libnet_in_cksum(u_int16_t *addr, int len) + { + int sum; ++ u_int16_t last_byte; + + sum = 0; ++ last_byte = 0; + + while (len > 1) + { +@@ -52,7 +54,8 @@ + } + if (len == 1) + { +- sum += *(u_int16_t *)addr; ++ *(u_int8_t*)&last_byte = *(u_int8_t*)addr; ++ sum += last_byte; + } + + return (sum); +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -8,9 +8,9 @@ + + include $(top_srcdir)/Makefile.am.common + +-lib_LIBRARIES = libnet.a ++lib_LTLIBRARIES = libnet.la + +-libnet_a_SOURCES = libnet_asn1.c \ ++libnet_la_SOURCES = libnet_asn1.c \ + libnet_build_802.1q.c \ + libnet_build_802.1x.c \ + libnet_build_802.2.c \ +@@ -57,15 +57,20 @@ + libnet_version.c \ + libnet_write.c + +-EXTRA_libnet_a_SOURCES = libnet_link_bpf.c \ +- libnet_link_dlpi.c \ +- libnet_link_linux.c \ +- libnet_link_nit.c \ +- libnet_link_none.c \ +- libnet_link_pf.c \ +- libnet_link_snit.c \ +- libnet_link_snoop.c \ +- libnet_link_win32.c +- +-libnet_a_LIBADD = @LIBOBJS@ ++libnet_la_LIBADD = @LTLIBOBJS@ + ++# Here are a set of rules to help you update your library version ++# information: ++# ++# 1. If the library source code has changed at all since the last ++# update, then increment REVISION (`C:R:A' becomes `C:r+1:A'). ++# ++# 2. If any interfaces have been added, removed, or changed since the ++# last update, increment CURRENT, and set REVISION to 0. ++# ++# 3. If any interfaces have been added since the last public release, ++# then increment AGE. ++# ++# 4. If any interfaces have been removed since the last public release, ++# then set AGE to 0. ++libnet_la_LDFLAGS = -version-info 4:0:3 # CURRENT[:REVISION[:AGE]] diff --git a/libs/libnet-1.1.x/patches/150-portability.patch b/libs/libnet-1.1.x/patches/150-portability.patch new file mode 100644 index 0000000..d96b395 --- /dev/null +++ b/libs/libnet-1.1.x/patches/150-portability.patch @@ -0,0 +1,14 @@ +--- a/configure.in ++++ b/configure.in +@@ -67,7 +67,10 @@ + dnl + AC_MSG_CHECKING(link-layer packet interface type) + +-if test -r /dev/bpf0 ; then ++if test -n "$LL_INT_TYPE"; then ++ AC_LIBOBJ($LL_INT_TYPE) ++ AC_MSG_RESULT(found $LL_INT_TYPE (cached)) ++elif test -r /dev/bpf0 ; then + AC_LIBOBJ([libnet_link_bpf]) + AC_MSG_RESULT(found bpf) + elif test -r /usr/include/net/pfilt.h ; then diff --git a/libs/libnet-1.1.x/patches/160-endian_cache.patch b/libs/libnet-1.1.x/patches/160-endian_cache.patch new file mode 100644 index 0000000..766d2fe --- /dev/null +++ b/libs/libnet-1.1.x/patches/160-endian_cache.patch @@ -0,0 +1,18 @@ +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -281,6 +281,7 @@ + AC_DEFUN(AC_LIBNET_ENDIAN_CHECK, + [AC_MSG_CHECKING(machine endianess) + ++ if \! test x${ac_cv_libnet_endianess+set} = xset ; then + cat > conftest.c << EOF + # include + # include +@@ -332,6 +333,7 @@ + fi + fi + rm -f conftest* core core.conftest ++ fi + + AC_MSG_RESULT($ac_cv_libnet_endianess) + diff --git a/libs/libnetfilter-conntrack/Makefile b/libs/libnetfilter-conntrack/Makefile new file mode 100644 index 0000000..08608d1 --- /dev/null +++ b/libs/libnetfilter-conntrack/Makefile @@ -0,0 +1,72 @@ +# +# Copyright (C) 2009-2011 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:=libnetfilter_conntrack +PKG_VERSION:=0.9.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://www.netfilter.org/projects/libnetfilter_conntrack/files/ \ + ftp://ftp.netfilter.org/pub/libnetfilter_conntrack/ +PKG_MD5SUM:=b7506cbb7580433859809d8eac53a199 + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libnetfilter-conntrack + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libnfnetlink +kmod-nf-conntrack-netlink + TITLE:=API to the in-kernel connection tracking state table + URL:=http://www.netfilter.org/projects/libnetfilter_conntrack/ +endef + +define Package/libnetfilter-conntrack/description + libnetfilter_conntrack is a userspace library providing a programming + interface (API) to the in-kernel connection tracking state table. The + library libnetfilter_conntrack has been previously known as + libnfnetlink_conntrack and libctnetlink. This library is currently + used by conntrack-tools among many other applications. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/libnetfilter_conntrack + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/libnetfilter_conntrack/*.h \ + $(1)/usr/include/libnetfilter_conntrack/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libnetfilter_conntrack.{so*,a,la} \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnetfilter_conntrack.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/libnetfilter-conntrack/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libnetfilter_conntrack.so.* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libnetfilter-conntrack)) diff --git a/libs/libnetfilter-log/Makefile b/libs/libnetfilter-log/Makefile new file mode 100644 index 0000000..2eca7ff --- /dev/null +++ b/libs/libnetfilter-log/Makefile @@ -0,0 +1,72 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libnetfilter_log +PKG_VERSION:=1.0.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://www.netfilter.org/projects/libnetfilter_log/files/ \ + ftp://ftp.netfilter.org/pub/libnetfilter_log/ \ + http://mirrors.evolva.ro/netfilter.org/libnetfilter_log/ +PKG_MD5SUM:=acdb188a1e7504e95636d0770ade393c + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libnetfilter-log + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libnfnetlink +kmod-nfnetlink-log + TITLE:=API to packets logged by the kernel packet filter + URL:=http://www.netfilter.org/projects/libnetfilter_log/ +endef + +define Package/libnetfilter-log/description + libnetfilter_log is a userspace library providing interface to + packets that have been logged by the kernel packet filter. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared \ + +CONFIGURE_VARS += \ + LIBNFNETLINK_CFLAGS="$(TARGET_CPPFLAGS)" \ + LIBNFNETLINK_LIBS="$(TARGET_LDFLAGS)" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/libnetfilter_log + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/libnetfilter_log/*.h \ + $(1)/usr/include/libnetfilter_log/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libnetfilter_log*.{so*,a,la} \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnetfilter_log.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/libnetfilter-log/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetfilter_log*.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libnetfilter-log)) diff --git a/libs/libnetfilter-queue/Makefile b/libs/libnetfilter-queue/Makefile new file mode 100644 index 0000000..c1d5fd5 --- /dev/null +++ b/libs/libnetfilter-queue/Makefile @@ -0,0 +1,72 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libnetfilter_queue +PKG_VERSION:=1.0.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://www.netfilter.org/projects/libnetfilter_queue/files/ \ + ftp://ftp.netfilter.org/pub/libnetfilter_queue/ \ + http://mirrors.evolva.ro/netfilter.org/libnetfilter_queue/ +PKG_MD5SUM:=af6a9ea350f63a13609bc3b47b5c395c + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libnetfilter-queue + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libnfnetlink +kmod-nfnetlink-queue + TITLE:=API to packets queued by the kernel packet filter + URL:=http://www.netfilter.org/projects/libnetfilter_queue/ +endef + +define Package/libnetfilter-queue/description + libnetfilter_queue is a userspace library providing an API to packets + that have been queued by the kernel packet filter. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared \ + +CONFIGURE_VARS += \ + LIBNFNETLINK_CFLAGS="$(TARGET_CPPFLAGS)" \ + LIBNFNETLINK_LIBS="$(TARGET_LDFLAGS)" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/libnetfilter_queue + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/libnetfilter_queue/*.h \ + $(1)/usr/include/libnetfilter_queue/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libnetfilter_queue*.{so*,a,la} \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnetfilter_queue.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/libnetfilter-queue/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetfilter_queue*.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libnetfilter-queue)) diff --git a/libs/libnfc/Makefile b/libs/libnfc/Makefile new file mode 100644 index 0000000..548ab84 --- /dev/null +++ b/libs/libnfc/Makefile @@ -0,0 +1,118 @@ +# +# Copyright (C) 2010-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libnfc +PKG_VERSION:=1.4.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://libnfc.googlecode.com/files +PKG_MD5SUM:=c99b2b9212b1a1b064055a199779bdd8 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libnfc/Default + TITLE:=Near Field Communication (NFC) library + URL:=http://www.libnfc.org +endef + +define Package/libnfc +$(call Package/libnfc/Default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libusb +pcscd +ccid +endef + +define Package/libnfc/description + libnfc is a free software library used to handle NFC capable devices. + It supports the four main NFC modulations: + * ISO14443-A (NXP MIFARE), + * ISO14443-B, + * JIS X 6319-4 (Sony Felica) and + * Jewel Topaz (Innovision Research & Development). + And depending on hardware, it supports: + * Read (RFID @13.56Mhz), + * Emulation and + * Peer2Peer mode. +endef + +define Package/libnfc-bin +$(call Package/libnfc/Default) + TITLE+= (binaries) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libnfc +endef + +define Package/libnfc-bin/description + libnfc is provided with some useful tools: + * nfc-list: target listing; + * nfc-mfclassic: Mifare Classic operations; + * nfc-mfultralight: Mifare Ultralight operations. +endef + +define Package/libnfc-examples +$(call Package/libnfc/Default) + TITLE+= (examples) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libnfc +endef + +define Package/libnfc-examples/description + libnfc is provided with some examples like: + * various targets emulation; + * NFC frames relay (ie. over network); + * manually done anticollision; + * etc. +endef + +TARGET_CFLAGS += $(FPIC) +CONFIGURE_ARGS += --without-readline + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/nfc $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfc.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnfc.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libnfc/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfc.so.* $(1)/usr/lib/ +endef + +define Package/libnfc-bin/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-list $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-mfclassic $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-mfultralight $(1)/usr/bin/ +endef + +define Package/libnfc-examples/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-anticol $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-dep-initiator $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-dep-target $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-emulate-forum-tag4 $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-emulate-tag $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-emulate-uid $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-poll $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-relay $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-relay-picc $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libnfc)) +$(eval $(call BuildPackage,libnfc-bin)) +$(eval $(call BuildPackage,libnfc-examples)) diff --git a/libs/libnfnetlink/Makefile b/libs/libnfnetlink/Makefile new file mode 100644 index 0000000..44409fa --- /dev/null +++ b/libs/libnfnetlink/Makefile @@ -0,0 +1,69 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libnfnetlink +PKG_VERSION:=1.0.0 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://www.netfilter.org/projects/libnfnetlink/files/ \ + ftp://ftp.netfilter.org/pub/libnfnetlink/ \ + http://mirrors.evolva.ro/netfilter.org/libnfnetlink/ +PKG_MD5SUM:=016fdec8389242615024c529acc1adb8 + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libnfnetlink + SECTION:=libs + CATEGORY:=Libraries + TITLE:=A low-level library for netfilter related kernel/userspace communication + URL:=http://netfilter.org/projects/libnfnetlink/ +endef + +define Package/libnfnetlink/description + libnfnetlink is is the low-level library for netfilter related kernel/userspace communication. + It provides a generic messaging infrastructure for in-kernel netfilter subsystems + (such as nfnetlink_log, nfnetlink_queue, nfnetlink_conntrack) and their respective users + and/or management tools in userspace. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/libnfnetlink + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/libnfnetlink/{libnfnetlink,linux_nfnetlink,linux_nfnetlink_compat}.h \ + $(1)/usr/include/libnfnetlink/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libnfnetlink.{a,so*} \ + $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnfnetlink.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/libnfnetlink/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libnfnetlink.so.* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libnfnetlink)) diff --git a/libs/libnfsidmap/Makefile b/libs/libnfsidmap/Makefile new file mode 100644 index 0000000..65415c3 --- /dev/null +++ b/libs/libnfsidmap/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libnfsidmap +PKG_VERSION:=0.20 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/ +PKG_MD5SUM:=9233cb77876eb642374a0d2bcaba1170 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/libnfsidmap + SECTION:=libs + CATEGORY:=Libraries + SUBMENU:=Filesystem + TITLE:=libnfsidmap, for compiling mount.nfs4 + URL:=http://www.citi.umich.edu/projects/nfsv4 +endef + +define Package/libnfsidmap/description + needed for nfs-utils +endef + +TARGET_CFLAGS += $(FPIC) + +TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/lib + +MAKE_FLAGS += \ + OPT="$(TARGET_CFLAGS)" \ + INSTALLSUID="install -m 4755" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/nfsidmap.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfsidmap.{a,so*} $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnfsidmap.pc $(1)/usr/lib/pkgconfig +endef + +$(eval $(call BuildPackage,libnfsidmap)) diff --git a/libs/libnfsidmap/patches/000-no-getgrouplist.patch b/libs/libnfsidmap/patches/000-no-getgrouplist.patch new file mode 100644 index 0000000..ea48245 --- /dev/null +++ b/libs/libnfsidmap/patches/000-no-getgrouplist.patch @@ -0,0 +1,17 @@ +Index: libnfsidmap-0.20/nss.c +=================================================================== +--- libnfsidmap-0.20.orig/nss.c 2007-07-12 11:42:09.000000000 +0200 ++++ libnfsidmap-0.20/nss.c 2007-07-12 11:42:09.000000000 +0200 +@@ -295,9 +295,9 @@ + ret = -ENOENT; + goto out; + } +- if (getgrouplist(pw->pw_name, pw->pw_gid, groups, ngroups) < 0) +- ret = -ERANGE; +- free(pw); ++ // if (getgrouplist(pw->pw_name, pw->pw_gid, groups, ngroups) < 0) ++ // ret = -ERANGE; ++ // free(pw); + out: + return ret; + } diff --git a/libs/libnids/Makefile b/libs/libnids/Makefile new file mode 100644 index 0000000..21c0de1 --- /dev/null +++ b/libs/libnids/Makefile @@ -0,0 +1,66 @@ +# +# Copyright (C) 2006-2009 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:=libnids +PKG_VERSION:=1.18 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.packetfactory.net/projects/libnids/dist/ +PKG_MD5SUM:=9ee6dcdfac97bae6fe611aa27d2594a5 + +include $(INCLUDE_DIR)/package.mk + +define Package/libnids + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libnet0 + TITLE:=A network intrusion detection library + URL:=http://www.packetfactory.net/projects/libnids/ +endef + +define Package/libnids/description + An implementation of an E-component of Network Intrusion Detection + System. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + --with-libnet="$(STAGING_DIR)/usr/lib/libnet-1.0.x" \ + --with-libpcap="$(STAGING_DIR)/usr" \ + , \ + CFLAGS="$$$$CFLAGS $$$$CPPFLAGS" \ + ) +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + LNETLIB="-L$(STAGING_DIR)/usr/lib/libnet-1.0.x/lib -lnet" \ + PCAPLIB="$(TARGET_LDFLAGS) -lpcap" \ + install_prefix="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/nids.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnids.{a,so*} $(1)/usr/lib/ +endef + +define Package/libnids/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnids.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libnids)) diff --git a/libs/libnids/patches/001-no_asm_for_i386.patch b/libs/libnids/patches/001-no_asm_for_i386.patch new file mode 100644 index 0000000..ff6fde7 --- /dev/null +++ b/libs/libnids/patches/001-no_asm_for_i386.patch @@ -0,0 +1,12 @@ +diff -ruN libnids-1.18-orig/src/checksum.c libnids-1.18/src/checksum.c +--- libnids-1.18-orig/src/checksum.c 2003-09-20 22:40:44.000000000 +0200 ++++ libnids-1.18/src/checksum.c 2005-08-09 23:55:00.000000000 +0200 +@@ -4,7 +4,7 @@ + #include + #include + +-#if ( __i386__ || __i386 ) ++#if 0 + // all asm procedures are copied from Linux 2.0.36 and 2.2.10 kernels + + /* diff --git a/libs/libnids/patches/002-configure.patch b/libs/libnids/patches/002-configure.patch new file mode 100644 index 0000000..3b56aba --- /dev/null +++ b/libs/libnids/patches/002-configure.patch @@ -0,0 +1,62 @@ +diff -Nur libnids-1.18/configure libnids-1.18.patched/configure +--- libnids-1.18/configure 2003-10-15 01:40:09.000000000 +0200 ++++ libnids-1.18.patched/configure 2005-06-09 12:37:42.000000000 +0200 +@@ -3253,7 +3253,7 @@ + esac + + +-CFLAGS="$CFLAGS -D_BSD_SOURCE" ++CFLAGS="$CFLAGS" + + for ac_func in gettimeofday + do +@@ -3489,17 +3489,21 @@ + echo "${ECHO_T}no" >&6 + ;; + *) +- echo "$as_me:$LINENO: result: $withval" >&5 +-echo "${ECHO_T}$withval" >&6 ++ echo "$ac_t""$withval" 1>&6 + if test -f $withval/pcap.h -a -f $withval/libpcap.a; then + owd=`pwd` + if cd $withval; then withval=`pwd`; cd $owd; fi +- PCAP_CFLAGS="-I$withval -I$withval/bpf" ++ PCAPINC="-I$withval -I$withval/bpf" + PCAPLIB="-L$withval -lpcap" ++ elif test -f $withval/include/pcap.h -a \ ++ -f $withval/include/pcap-bpf.h -a \ ++ -f $withval/lib/libpcap.a; then ++ owd=`pwd` ++ if cd $withval; then withval=`pwd`; cd $owd; fi ++ PCAPINC="-I$withval/include" ++ PCAPLIB="-L$withval/lib -lpcap" + else +- { { echo "$as_me:$LINENO: error: pcap.h or libpcap.a not found in $withval" >&5 +-echo "$as_me: error: pcap.h or libpcap.a not found in $withval" >&2;} +- { (exit 1); exit 1; }; } ++ { echo "configure: error: pcap.h" 1>&2; exit 1; } + fi + ;; + esac +@@ -3605,10 +3609,10 @@ + *) + echo "$as_me:$LINENO: result: $withval" >&5 + echo "${ECHO_T}$withval" >&6 +- if test -f $withval/include/libnet.h -a -f $withval/lib/libnet.a -a -f $withval/libnet-config ; then ++ if test -f $withval/include/libnet.h -a -f $withval/lib/libnet.a -a -f $withval/bin/libnet-config ; then + owd=`pwd` + if cd $withval; then withval=`pwd`; cd $owd; fi +- LNET_CFLAGS="-I$withval/include `$withval/libnet-config --defines`" ++ LNET_CFLAGS="-I$withval/include `$withval/bin/libnet-config --defines`" + LNETLIB="-L$withval/lib -lnet" + elif test -f $withval/include/libnet.h -a -f $withval/src/libnet.a; then + owd=`pwd` +@@ -3861,7 +3865,7 @@ + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 +-HAVE_BSD_UDPHDR=0 ++HAVE_BSD_UDPHDR=1 + fi + rm -f conftest.$ac_objext conftest.$ac_ext + diff --git a/libs/libnids/patches/003-missing_else.patch b/libs/libnids/patches/003-missing_else.patch new file mode 100644 index 0000000..215fe92 --- /dev/null +++ b/libs/libnids/patches/003-missing_else.patch @@ -0,0 +1,11 @@ +diff -urN libnids-1.18/src/killtcp.c libnids-1.18.new/src/killtcp.c +--- libnids-1.18/src/killtcp.c 2002-08-21 18:19:40.000000000 +0200 ++++ libnids-1.18.new/src/killtcp.c 2010-03-27 13:44:59.000000000 +0100 +@@ -100,6 +100,6 @@ + if (initialized) + abort(); + } +-#elif ++#else + #error Something wrong with LIBNET_VER + #endif diff --git a/libs/libogg/Makefile b/libs/libogg/Makefile new file mode 100644 index 0000000..5028ca8 --- /dev/null +++ b/libs/libogg/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2008 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:=libogg +PKG_VERSION:=1.1.4 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.xiph.org/releases/ogg/ +PKG_MD5SUM:=10200ec22543841d9d1c23e0aed4e5e9 + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libogg + SECTION:=libs + CATEGORY:=Libraries + TITLE:=libogg + URL:=http://xiph.org/ogg/ +endef + +define Package/libogg/description +Ogg project codecs use the Ogg bitstream format to arrange the raw, +compressed bitstream into a more robust, useful form. For example, +the Ogg bitstream makes seeking, time stamping and error recovery +possible, as well as mixing several sepearate, concurrent media +streams into a single physical bitstream. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/ogg/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/ogg/* $(1)/usr/include/ogg/ + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/ + $(INSTALL_DIR) $(1)/usr/share/aclocal/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(1)/usr/share/aclocal/ +endef + +define Package/libogg/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libogg)) diff --git a/libs/liboil/Makefile b/libs/liboil/Makefile new file mode 100644 index 0000000..ad77779 --- /dev/null +++ b/libs/liboil/Makefile @@ -0,0 +1,65 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=liboil +PKG_VERSION:=0.3.17 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://liboil.freedesktop.org/download/ +PKG_MD5SUM:=47dc734f82faeb2964d97771cfd2e701 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/liboil + SECTION:=libs + CATEGORY:=Libraries + TITLE:=simple functions optimized for various CPUs + URL:=http://liboil.freedesktop.org/wiki/ + DEPENDS:=+librt +endef + +define Package/liboil/description + Liboil is a library of simple functions that are optimized for various CPUs. + These functions are generally loops implementing simple algorithms, such as + converting an array of N integers to floating-point numbers or multiplying + and summing an array of N numbers. Such functions are candidates for significant + optimization using various techniques, especially by using extended instructions + provided by modern CPUs (Altivec, MMX, SSE, etc.). +endef + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + +TARGET_CFLAGS += $(FPIC) + +# XXX: VFP_CFLAGS is set to '-mfpu=vfp' on arm by configure, but that breaks +# final linking stages, so override it until we find why +MAKE_FLAGS += \ + VFP_CFLAGS="" \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/liboil-0.3/* $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/liboil-0.3.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liboil-0.3.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/liboil/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/liboil-0.3.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,liboil)) diff --git a/libs/liboil/patches/001-no-tools-docs-examples.patch b/libs/liboil/patches/001-no-tools-docs-examples.patch new file mode 100644 index 0000000..1cebc70 --- /dev/null +++ b/libs/liboil/patches/001-no-tools-docs-examples.patch @@ -0,0 +1,22 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,7 +1,7 @@ + + AUTOMAKE_OPTIONS = foreign + +-SUBDIRS = liboil testsuite examples doc ++SUBDIRS = liboil + + EXTRA_DIST = COPYING autogen.sh gtk-doc.make HACKING BUG-REPORTING + +--- a/Makefile.in ++++ b/Makefile.in +@@ -278,7 +278,7 @@ top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AUTOMAKE_OPTIONS = foreign +-SUBDIRS = liboil testsuite examples doc ++SUBDIRS = liboil + EXTRA_DIST = COPYING autogen.sh gtk-doc.make HACKING BUG-REPORTING + DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc + pkgconfig_DATA = liboil-$(LIBOIL_MAJORMINOR).pc diff --git a/libs/liboil/patches/002-pkgconfig.patch b/libs/liboil/patches/002-pkgconfig.patch new file mode 100644 index 0000000..993f8e6 --- /dev/null +++ b/libs/liboil/patches/002-pkgconfig.patch @@ -0,0 +1,19 @@ +--- a/liboil.pc.in ++++ b/liboil.pc.in +@@ -1,7 +1,7 @@ + prefix=@prefix@ + exec_prefix=@exec_prefix@ + libdir=@libdir@ +-includedir=@includedir@/liboil-@LIBOIL_MAJORMINOR@ ++includedir=@includedir@ + toolsdir=${exec_prefix}/bin + + +@@ -9,6 +9,6 @@ Name: liboil-@LIBOIL_MAJORMINOR@ + Description: Library of Optimized Inner Loops + Version: @VERSION@ + Libs: -L${libdir} -loil-@LIBOIL_MAJORMINOR@ @LIBM@ @LIBRT@ +-Cflags: -I${includedir} ++Cflags: -I${includedir}/liboil-@LIBOIL_MAJORMINOR@ + + diff --git a/libs/libol/Makefile b/libs/libol/Makefile new file mode 100644 index 0000000..7c4b1cd --- /dev/null +++ b/libs/libol/Makefile @@ -0,0 +1,69 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libol +PKG_VERSION:=0.3.18 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.balabit.com/downloads/files/libol/0.3 +PKG_MD5SUM:=cbadf4b7ea276dfa85acc38a1cc5ff17 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libol + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Support library for syslog-ng + URL:=http://www.balabit.com/products/syslog_ng/ +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + ) +endef + +TARGET_CFLAGS += $(FPIC) + +# pass CFLAGS again to override -O2 set by configure +MAKE_ARGS += CFLAGS="$(TARGET_CFLAGS)" + +define Build/InstallDev + $(INSTALL_DIR) $(2)/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/libol-config \ + $(2)/bin/ + $(SED) \ + 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ + $(2)/bin/libol-config + + $(INSTALL_DIR) $(1)/usr/include/libol + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/libol/*.h \ + $(1)/usr/include/libol/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libol.{a,la,so*} \ + $(1)/usr/lib/ +endef + +define Package/libol/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libol.so* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libol)) diff --git a/libs/liboping/Makefile b/libs/liboping/Makefile new file mode 100644 index 0000000..531a64e --- /dev/null +++ b/libs/liboping/Makefile @@ -0,0 +1,82 @@ +# +# Copyright (C) 2009-2012 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:=liboping +PKG_VERSION:=1.6.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://verplant.org/liboping/files +PKG_MD5SUM:=64a6f31310093d2517cfe7f05aa011e0 + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/liboping/Default + URL:=http://verplant.org/liboping/ +endef + +define Package/liboping +$(call Package/liboping/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE:=C library to generate ICMP echo requests. +endef + +define Package/oping +$(call Package/liboping/Default) + SECTION:=net + CATEGORY:=Network + TITLE:=Send ICMP echo request to network hosts + DEPENDS+= +liboping +endef + +define Package/noping +$(call Package/liboping/Default) + SECTION:=net + CATEGORY:=Network + TITLE:=Ncurses application to send ICMP echo request to network hosts + DEPENDS+= +liboping +libncurses +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --without-perl-bindings \ + --enable-shared \ + --enable-static + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/oping.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/liboping.{a,so*} $(1)/usr/lib/ +endef + +define Package/liboping/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/liboping.so.* $(1)/usr/lib/ +endef + +define Package/oping/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/oping $(1)/usr/bin/ +endef + +define Package/noping/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/noping $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,liboping)) +$(eval $(call BuildPackage,oping)) +$(eval $(call BuildPackage,noping)) diff --git a/libs/liboping/patches/01-no-werror.patch b/libs/liboping/patches/01-no-werror.patch new file mode 100644 index 0000000..8589284 --- /dev/null +++ b/libs/liboping/patches/01-no-werror.patch @@ -0,0 +1,11 @@ +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS = foreign no-dependenci + SUBDIRS = mans + + if COMPILER_IS_GCC +-AM_CFLAGS = -Wall -Werror ++AM_CFLAGS = -Wall + endif + + include_HEADERS = oping.h diff --git a/libs/libosip2/Makefile b/libs/libosip2/Makefile new file mode 100644 index 0000000..19d61f7 --- /dev/null +++ b/libs/libosip2/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2006-2011 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:=libosip2 +PKG_VERSION:=3.5.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/osip +PKG_MD5SUM:=7691546f6b3349d10007fc1aaff0f4e0 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libosip2 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=GNU oSIP library + URL:=http://www.gnu.org/software/osip/ + DEPENDS:=+libpthread +endef + +define Package/libosip2description + GNU oSIP library, a Session Initiation Protocol (SIP) implementation. +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + --disable-debug \ + --disable-trace \ + --enable-pthread \ + --enable-semaphore \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/osip{,parser}2 $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libosip{,parser}2.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libosip2.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libosip2/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libosip{,parser}2.so $(PKG_INSTALL_DIR)/usr/lib/libosip{,parser}2.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libosip2)) diff --git a/libs/libosip2/patches/001-automake-compat.patch b/libs/libosip2/patches/001-automake-compat.patch new file mode 100644 index 0000000..9c0bc11 --- /dev/null +++ b/libs/libosip2/patches/001-automake-compat.patch @@ -0,0 +1,8 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,3 +1,5 @@ ++ACLOCAL_AMFLAGS = -I scripts ++ + EXTRA_DIST = README BUGS FEATURES HISTORY autogen.sh libosip2.pc.in + + SUBDIRS = include src scripts help platform diff --git a/libs/libowfat/Makefile b/libs/libowfat/Makefile new file mode 100644 index 0000000..23a8869 --- /dev/null +++ b/libs/libowfat/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +LOWFAT_VERSION=0.28 + +PKG_NAME:=libowfat +PKG_VERSION:=$(LOWFAT_VERSION) +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://dl.fefe.de +PKG_MD5SUM:=6bbee9a86506419657d87123b7a6f2c1 + +include $(INCLUDE_DIR)/package.mk + +# set to 1 to enable debugging +DEBUG= + +define Package/libowfat + SECTION:=libs + CATEGORY:=Libraries + TITLE:=reimplemented libdjb under GPL + URL:=http://www.fefe.de/libowfat/ +endef + +define Build/Configure +endef + +TARGET_CFLAGS += $(FPIC) +LOWFAT_MAKEOPTS = $(TARGET_CONFIGURE_OPTS) \ + COPTS="$(TARGET_CFLAGS)" \ + DEBUG="$(DEBUG)" \ + VERSION="$(LOWFAT_VERSION)" \ + CPPFLAGS="-I$(PKG_BUILD_DIR) -I$(STAGING_DIR)/usr/include" \ + OS="Linux" + +# work around a nasty gcc bug +ifneq ($(CONFIG_GCC_VERSION_4_2_4),) + LOWFAT_MAKEOPTS += WOPTS="" +endif + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) $(LOWFAT_MAKEOPTS) +endef + +define Build/InstallDev + mkdir -p $(1)/usr/include/libowfat + $(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libowfat + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/*.a $(1)/usr/lib +endef + +$(eval $(call BuildPackage,libowfat)) diff --git a/libs/libpam/Makefile b/libs/libpam/Makefile new file mode 100644 index 0000000..24e989c --- /dev/null +++ b/libs/libpam/Makefile @@ -0,0 +1,71 @@ +# +# Copyright (C) 2006-2009 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:=libpam +PKG_VERSION:=1.1.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=Linux-PAM-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://pkgs.fedoraproject.org/repo/pkgs/pam/Linux-PAM-1.1.4.tar.bz2/e9af5fb27bb22edb55d077e2888b3ebc/ +PKG_MD5SUM:=e9af5fb27bb22edb55d077e2888b3ebc +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + +PKG_BUILD_DIR:=$(BUILD_DIR)/Linux-PAM-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/libpam + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=@BROKEN + TITLE:=free implementation of the following DCE-RFC from Sunsoft. + URL:=http://www.kernel.org/pub/linux/libs/pam +endef + +define Package/libpam/description + Linux-PAM is a free implementation of the following DCE-RFC from Sunsoft. + +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Configure + (cd $(PKG_BUILD_DIR); autoreconf -v -f --install || exit 1) + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + --enable-pamlocking \ + --disable-prelude \ + --disable-lckpwdf \ + --disable-selinux \ + --disable-nls \ + --disable-rpath \ + ) +endef + + + +define Build/InstallDev + $(INSTALL_DIR) $(1)/lib + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/lib/* $(1)/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include +endef + +define Package/libpam/install + $(INSTALL_DIR) $(1)/lib + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/lib/* $(1)/lib/ + $(CP) $(PKG_INSTALL_DIR)/etc/* $(1)/etc/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,libpam)) diff --git a/libs/libpam/patches/000-OE-libpam-xtests.patch b/libs/libpam/patches/000-OE-libpam-xtests.patch new file mode 100644 index 0000000..aac30ab --- /dev/null +++ b/libs/libpam/patches/000-OE-libpam-xtests.patch @@ -0,0 +1,35 @@ +This patch is used to create a new sub package libpam-xtests to do more checks. + +Upstream-Status: Pending + +Signed-off-by: Kang Kai +--- a/xtests/Makefile.am ++++ b/xtests/Makefile.am +@@ -7,7 +7,7 @@ + AM_LDFLAGS = -L$(top_builddir)/libpam -lpam \ + -L$(top_builddir)/libpam_misc -lpam_misc + +-CLEANFILES = *~ $(XTESTS) ++CLEANFILES = *~ + + EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \ + tst-pam_dispatch3.pamd tst-pam_dispatch4.pamd \ +@@ -51,3 +51,18 @@ + + xtests: $(XTESTS) run-xtests.sh + "$(srcdir)"/run-xtests.sh "$(srcdir)" ${XTESTS} ${NOSRCTESTS} ++ ++all: $(XTESTS) ++ ++install: install_xtests ++ ++install_xtests: ++ $(INSTALL) -d $(DESTDIR)$(pkgdatadir)/xtests ++ for file in $(EXTRA_DIST) ; do \ ++ $(INSTALL) $$file $(DESTDIR)$(pkgdatadir)/xtests ; \ ++ done ++ for file in $(XTESTS); do \ ++ $(INSTALL) .libs/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \ ++ done ++ ++.PHONY: all install_xtests diff --git a/libs/libpam/patches/000-OE-pam-no-innetgr.patch b/libs/libpam/patches/000-OE-pam-no-innetgr.patch new file mode 100644 index 0000000..45babfc --- /dev/null +++ b/libs/libpam/patches/000-OE-pam-no-innetgr.patch @@ -0,0 +1,85 @@ +innetgr may not be there so make sure that when innetgr is not present +then we inform about it and not use it. + +-Khem +--- a/modules/pam_group/pam_group.c ++++ b/modules/pam_group/pam_group.c +@@ -659,7 +659,11 @@ static int check_account(pam_handle_t *p + } + /* If buffer starts with @, we are using netgroups */ + if (buffer[0] == '@') ++#ifdef HAVE_INNETGR + good &= innetgr (&buffer[1], NULL, user, NULL); ++#else ++ pam_syslog (pamh, LOG_ERR, "pam_group does not have netgroup support"); ++#endif + /* otherwise, if the buffer starts with %, it's a UNIX group */ + else if (buffer[0] == '%') + good &= pam_modutil_user_in_group_nam_nam(pamh, user, &buffer[1]); +--- a/modules/pam_time/pam_time.c ++++ b/modules/pam_time/pam_time.c +@@ -555,9 +555,13 @@ check_account(pam_handle_t *pamh, const + } + /* If buffer starts with @, we are using netgroups */ + if (buffer[0] == '@') +- good &= innetgr (&buffer[1], NULL, user, NULL); ++#ifdef HAVE_INNETGR ++ good &= innetgr (&buffer[1], NULL, user, NULL); ++#else ++ pam_syslog (pamh, LOG_ERR, "pam_time does not have netgroup support"); ++#endif + else +- good &= logic_field(pamh, user, buffer, count, is_same); ++ good &= logic_field(pamh, user, buffer, count, is_same); + D(("with user: %s", good ? "passes":"fails" )); + + /* here we get the time field */ +--- a/modules/pam_succeed_if/pam_succeed_if.c ++++ b/modules/pam_succeed_if/pam_succeed_if.c +@@ -231,18 +231,27 @@ evaluate_notingroup(pam_handle_t *pamh, + } + /* Return PAM_SUCCESS if the (host,user) is in the netgroup. */ + static int +-evaluate_innetgr(const char *host, const char *user, const char *group) ++evaluate_innetgr(const pam_handle_t* pamh, const char *host, const char *user, const char *group) + { ++#ifdef HAVE_INNETGR + if (innetgr(group, host, user, NULL) == 1) + return PAM_SUCCESS; ++#else ++ pam_syslog (pamh, LOG_ERR, "pam_succeed_if does not have netgroup support"); ++#endif ++ + return PAM_AUTH_ERR; + } + /* Return PAM_SUCCESS if the (host,user) is NOT in the netgroup. */ + static int +-evaluate_notinnetgr(const char *host, const char *user, const char *group) ++evaluate_notinnetgr(const pam_handle_t* pamh, const char *host, const char *user, const char *group) + { ++#ifdef HAVE_INNETGR + if (innetgr(group, host, user, NULL) == 0) + return PAM_SUCCESS; ++#else ++ pam_syslog (pamh, LOG_ERR, "pam_succeed_if does not have netgroup support"); ++#endif + return PAM_AUTH_ERR; + } + +@@ -361,14 +370,14 @@ evaluate(pam_handle_t *pamh, int debug, + const void *rhost; + if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS) + rhost = NULL; +- return evaluate_innetgr(rhost, user, right); ++ return evaluate_innetgr(pamh, rhost, user, right); + } + /* (Rhost, user) is not in this group. */ + if (strcasecmp(qual, "notinnetgr") == 0) { + const void *rhost; + if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS) + rhost = NULL; +- return evaluate_notinnetgr(rhost, user, right); ++ return evaluate_notinnetgr(pamh, rhost, user, right); + } + /* Fail closed. */ + return PAM_SERVICE_ERR; diff --git a/libs/libpam/patches/001-no_nis.patch b/libs/libpam/patches/001-no_nis.patch new file mode 100644 index 0000000..27d17a0 --- /dev/null +++ b/libs/libpam/patches/001-no_nis.patch @@ -0,0 +1,68 @@ +--- a/modules/pam_access/pam_access.c ++++ b/modules/pam_access/pam_access.c +@@ -44,7 +44,7 @@ + #include + #include + #include +-#ifdef HAVE_RPCSVC_YPCLNT_H ++#ifdef HAVE_RPCSVC_YPCLNT_H && USE_NIS + #include + #endif + #ifdef HAVE_LIBAUDIT +--- a/modules/pam_unix/pam_unix_passwd.c ++++ b/modules/pam_unix/pam_unix_passwd.c +@@ -74,18 +74,18 @@ + #include "passverify.h" + #include "bigcrypt.h" + +-#if (HAVE_YP_GET_DEFAULT_DOMAIN || HAVE_GETDOMAINNAME) && HAVE_YP_MASTER ++#if (HAVE_YP_GET_DEFAULT_DOMAIN || HAVE_GETDOMAINNAME) && HAVE_YP_MASTER && USE_NIS + # define HAVE_NIS + #endif + + #ifdef HAVE_NIS + # include + +-# if HAVE_RPCSVC_YP_PROT_H ++# if HAVE_RPCSVC_YP_PROT_H && USE_NIS + # include + # endif + +-# if HAVE_RPCSVC_YPCLNT_H ++# if HAVE_RPCSVC_YPCLNT_H && USE_NIS + # include + # endif + +--- a/modules/pam_unix/support.c ++++ b/modules/pam_unix/support.c +@@ -19,7 +19,7 @@ + #include + #include + #include +-#ifdef HAVE_RPCSVC_YPCLNT_H ++#ifdef HAVE_RPCSVC_YPCLNT_H && USE_NIS + #include + #endif + +@@ -285,7 +285,7 @@ int _unix_getpwnam(pam_handle_t *pamh, c + } + } + +-#if defined(HAVE_YP_GET_DEFAULT_DOMAIN) && defined (HAVE_YP_BIND) && defined (HAVE_YP_MATCH) && defined (HAVE_YP_UNBIND) ++#if defined(HAVE_YP_GET_DEFAULT_DOMAIN) && defined (HAVE_YP_BIND) && defined (HAVE_YP_MATCH) && defined (HAVE_YP_UNBIND) && (USE_NIS) + if (!matched && nis) { + char *userinfo = NULL, *domain = NULL; + int len = 0, i; +--- a/modules/pam_unix/yppasswd_xdr.c ++++ b/modules/pam_unix/yppasswd_xdr.c +@@ -13,6 +13,10 @@ + #include "config.h" + + #include ++#ifdef USE_NIS ++#include ++#include ++#endif + #include "yppasswd.h" + + bool_t diff --git a/libs/libpam/patches/002-no_yywrap.patch b/libs/libpam/patches/002-no_yywrap.patch new file mode 100644 index 0000000..0d73e4b --- /dev/null +++ b/libs/libpam/patches/002-no_yywrap.patch @@ -0,0 +1,26 @@ +--- a/conf/pam_conv1/pam_conv_l.c ++++ b/conf/pam_conv1/pam_conv_l.c +@@ -534,7 +534,9 @@ void yyset_lineno (int line_number ); + #ifdef __cplusplus + extern "C" int yywrap (void ); + #else +-extern int yywrap (void ); ++int yywrap (void ) { ++ return 1; ++} + #endif + #endif + +--- a/doc/specs/parse_l.c ++++ b/doc/specs/parse_l.c +@@ -520,7 +520,9 @@ void yyset_lineno (int line_number ); + #ifdef __cplusplus + extern "C" int yywrap (void ); + #else +-extern int yywrap (void ); ++int yywrap (void ) { ++ return 1; ++} + #endif + #endif + diff --git a/libs/libpam/patches/003-no_doc.patch b/libs/libpam/patches/003-no_doc.patch new file mode 100644 index 0000000..020f74d --- /dev/null +++ b/libs/libpam/patches/003-no_doc.patch @@ -0,0 +1,36 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -5,9 +5,9 @@ + AUTOMAKE_OPTIONS = 1.9 gnu dist-bzip2 check-news + + if STATIC_MODULES +-SUBDIRS = modules libpam libpamc libpam_misc tests po conf doc examples xtests ++SUBDIRS = modules libpam libpamc libpam_misc tests po conf examples xtests + else +-SUBDIRS = libpam tests libpamc libpam_misc modules po conf doc examples xtests ++SUBDIRS = libpam tests libpamc libpam_misc modules po conf examples xtests + endif + + CLEANFILES = *~ +--- a/Makefile.in ++++ b/Makefile.in +@@ -74,7 +74,7 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-re + distclean-recursive maintainer-clean-recursive + ETAGS = etags + CTAGS = ctags +-DIST_SUBDIRS = libpam tests libpamc libpam_misc modules po conf doc \ ++DIST_SUBDIRS = libpam tests libpamc libpam_misc modules po conf \ + examples xtests + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + distdir = $(PACKAGE)-$(VERSION) +@@ -253,8 +253,8 @@ top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AUTOMAKE_OPTIONS = 1.9 gnu dist-bzip2 check-news +-@STATIC_MODULES_FALSE@SUBDIRS = libpam tests libpamc libpam_misc modules po conf doc examples xtests +-@STATIC_MODULES_TRUE@SUBDIRS = modules libpam libpamc libpam_misc tests po conf doc examples xtests ++@STATIC_MODULES_FALSE@SUBDIRS = libpam tests libpamc libpam_misc modules po conf examples xtests ++@STATIC_MODULES_TRUE@SUBDIRS = modules libpam libpamc libpam_misc tests po conf examples xtests + CLEANFILES = *~ + M4_FILES = m4/gettext.m4 m4/iconv.m4 m4/intlmacosx.m4 \ + m4/japhar_grep_cflags.m4 m4/jh_path_xml_catalog.m4 \ diff --git a/libs/libpam/patches/004-fix_lib64.patch b/libs/libpam/patches/004-fix_lib64.patch new file mode 100644 index 0000000..6c83d08 --- /dev/null +++ b/libs/libpam/patches/004-fix_lib64.patch @@ -0,0 +1,16 @@ +--- a/configure.in ++++ b/configure.in +@@ -26,12 +26,7 @@ dnl If we use /usr as prefix, use /etc f + fi + if test ${libdir} = '${exec_prefix}/lib' + then +- case "`uname -m`" in +- x86_64|ppc64|s390x|sparc64) +- libdir="/lib64" ;; +- *) +- libdir="/lib" ;; +- esac ++ libdir="/lib" + fi + if test ${sbindir} = '${exec_prefix}/sbin' + then diff --git a/libs/libpam/patches/005-fix_ruserok.patch b/libs/libpam/patches/005-fix_ruserok.patch new file mode 100644 index 0000000..1f0f463 --- /dev/null +++ b/libs/libpam/patches/005-fix_ruserok.patch @@ -0,0 +1,364 @@ +--- a/modules/pam_rhosts/pam_rhosts.c ++++ b/modules/pam_rhosts/pam_rhosts.c +@@ -43,6 +43,361 @@ + #include + #include + ++#ifdef __UCLIBC__ ++ ++#include ++#include ++ ++ ++int __check_rhosts_file = 1; ++ ++/* Extremely paranoid file open function. */ ++static FILE * ++iruserfopen (const char *file, uid_t okuser) ++{ ++ struct stat st; ++ char *cp = NULL; ++ FILE *res = NULL; ++ ++ /* If not a regular file, if owned by someone other than user or ++ root, if writeable by anyone but the owner, or if hardlinked ++ anywhere, quit. */ ++ if (lstat (file, &st)) ++ cp = "lstat failed"; ++ else if (!S_ISREG (st.st_mode)) ++ cp = "not regular file"; ++ else ++ { ++ res = fopen (file, "r"); ++ if (!res) ++ cp = "cannot open"; ++ else if (fstat (fileno (res), &st) < 0) ++ cp = "fstat failed"; ++ else if (st.st_uid && st.st_uid != okuser) ++ cp = "bad owner"; ++ else if (st.st_mode & (S_IWGRP|S_IWOTH)) ++ cp = "writeable by other than owner"; ++ else if (st.st_nlink > 1) ++ cp = "hard linked somewhere"; ++ } ++ ++ /* If there were any problems, quit. */ ++ if (cp != NULL) ++ { ++ if (res) ++ fclose (res); ++ return NULL; ++ } ++ ++ return res; ++} ++ ++/* ++ * Returns 1 for blank lines (or only comment lines) and 0 otherwise ++ */ ++static int ++__isempty(char *p) ++{ ++ while (*p && isspace (*p)) { ++ ++p; ++ } ++ ++ return (*p == '\0' || *p == '#') ? 1 : 0 ; ++} ++ ++/* Returns 1 on positive match, 0 on no match, -1 on negative match. */ ++static int ++__icheckhost (u_int32_t raddr, char *lhost, const char *rhost) ++{ ++ struct hostent *hp; ++ u_int32_t laddr; ++ int negate=1; /* Multiply return with this to get -1 instead of 1 */ ++ char **pp; ++ ++#ifdef __UCLIBC_HAS_REENTRANT_RPC__ ++ int save_errno; ++ size_t buflen; ++ char *buffer; ++ struct hostent hostbuf; ++ int herr; ++#endif ++ ++#ifdef HAVE_NETGROUP ++ /* Check nis netgroup. */ ++ if (strncmp ("+@", lhost, 2) == 0) ++ return innetgr (&lhost[2], rhost, NULL, NULL); ++ ++ if (strncmp ("-@", lhost, 2) == 0) ++ return -innetgr (&lhost[2], rhost, NULL, NULL); ++#endif /* HAVE_NETGROUP */ ++ ++ /* -host */ ++ if (strncmp ("-", lhost,1) == 0) { ++ negate = -1; ++ lhost++; ++ } else if (strcmp ("+",lhost) == 0) { ++ return 1; /* asking for trouble, but ok.. */ ++ } ++ ++ /* Try for raw ip address first. */ ++ if (isdigit (*lhost) && (laddr = inet_addr (lhost)) != INADDR_NONE) ++ return negate * (! (raddr ^ laddr)); ++ ++ /* Better be a hostname. */ ++#ifdef __UCLIBC_HAS_REENTRANT_RPC__ ++ buflen = 1024; ++ buffer = malloc(buflen); ++ save_errno = errno; ++ ++ while (gethostbyname_r (lhost, &hostbuf, buffer, buflen, &hp, &herr) ++ != 0) { ++ free(buffer); ++ return (0); ++ } ++ free(buffer); ++ __set_errno (save_errno); ++#else ++ hp = gethostbyname(lhost); ++#endif /* __UCLIBC_HAS_REENTRANT_RPC__ */ ++ ++ if (hp == NULL) ++ return 0; ++ ++ /* Spin through ip addresses. */ ++ for (pp = hp->h_addr_list; *pp; ++pp) ++ if (!memcmp (&raddr, *pp, sizeof (u_int32_t))) ++ return negate; ++ ++ /* No match. */ ++ return (0); ++} ++ ++/* Returns 1 on positive match, 0 on no match, -1 on negative match. */ ++static int ++__icheckuser (const char *luser, const char *ruser) ++{ ++ ++ /* ++ luser is user entry from .rhosts/hosts.equiv file ++ ruser is user id on remote host ++ */ ++ ++#ifdef HAVE_NETGROUP ++ /* [-+]@netgroup */ ++ if (strncmp ("+@", luser, 2) == 0) ++ return innetgr (&luser[2], NULL, ruser, NULL); ++ ++ if (strncmp ("-@", luser,2) == 0) ++ return -innetgr (&luser[2], NULL, ruser, NULL); ++#endif /* HAVE_NETGROUP */ ++ ++ /* -user */ ++ if (strncmp ("-", luser, 1) == 0) ++ return -(strcmp (&luser[1], ruser) == 0); ++ ++ /* + */ ++ if (strcmp ("+", luser) == 0) ++ return 1; ++ ++ /* simple string match */ ++ return strcmp (ruser, luser) == 0; ++} ++ ++/* ++ * Returns 0 if positive match, -1 if _not_ ok. ++ */ ++static int ++__ivaliduser2(FILE *hostf, u_int32_t raddr, const char *luser, ++ const char *ruser, const char *rhost) ++{ ++ register const char *user; ++ register char *p; ++ int hcheck, ucheck; ++ char *buf = NULL; ++ size_t bufsize = 0; ++ int retval = -1; ++ ++ while (getline (&buf, &bufsize, hostf) > 0) { ++ buf[bufsize - 1] = '\0'; /* Make sure it's terminated. */ ++ p = buf; ++ ++ /* Skip empty or comment lines */ ++ if (__isempty (p)) { ++ continue; ++ } ++ ++ /* Skip lines that are too long. */ ++ if (strchr (p, '\n') == NULL) { ++ int ch = getc_unlocked (hostf); ++ ++ while (ch != '\n' && ch != EOF) ++ ch = getc_unlocked (hostf); ++ continue; ++ } ++ ++ for (;*p && !isspace(*p); ++p) { ++ *p = tolower (*p); ++ } ++ ++ /* Next we want to find the permitted name for the remote user. */ ++ if (*p == ' ' || *p == '\t') { ++ /* terminate hostname and skip spaces */ ++ for (*p++='\0'; *p && isspace (*p); ++p); ++ ++ user = p; /* this is the user's name */ ++ while (*p && !isspace (*p)) ++ ++p; /* find end of user's name */ ++ } else ++ user = p; ++ ++ *p = '\0'; /* terminate username (+host?) */ ++ ++ /* buf -> host(?) ; user -> username(?) */ ++ ++ /* First check host part */ ++ hcheck = __icheckhost (raddr, buf, rhost); ++ ++ if (hcheck < 0) ++ break; ++ ++ if (hcheck) { ++ /* Then check user part */ ++ if (! (*user)) ++ user = luser; ++ ++ ucheck = __icheckuser (user, ruser); ++ ++ /* Positive 'host user' match? */ ++ if (ucheck > 0) { ++ retval = 0; ++ break; ++ } ++ ++ /* Negative 'host -user' match? */ ++ if (ucheck < 0) ++ break; ++ ++ /* Neither, go on looking for match */ ++ } ++ } ++ ++ free (buf); ++ ++ return retval; ++} ++ ++static int ++iruserok2 (u_int32_t raddr, int superuser, const char *ruser, const char *luser, ++ const char *rhost) ++{ ++ FILE *hostf = NULL; ++ int isbad = -1; ++ ++ if (!superuser) ++ hostf = iruserfopen (_PATH_HEQUIV, 0); ++ ++ if (hostf) { ++ isbad = __ivaliduser2 (hostf, raddr, luser, ruser, rhost); ++ fclose (hostf); ++ ++ if (!isbad) ++ return 0; ++ } ++ ++ if (__check_rhosts_file || superuser) { ++ char *pbuf; ++ struct passwd *pwd; ++ size_t dirlen; ++ uid_t uid; ++ ++#ifdef __UCLIBC_HAS_REENTRANT_RPC__ ++ size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX); ++ struct passwd pwdbuf; ++ char *buffer = stack_heap_alloc(buflen); ++ ++ if (getpwnam_r (luser, &pwdbuf, buffer, ++ buflen, &pwd) != 0 || pwd == NULL) ++ { ++ stack_heap_free(buffer); ++ return -1; ++ } ++ stack_heap_free(buffer); ++#else ++ if ((pwd = getpwnam(luser)) == NULL) ++ return -1; ++#endif ++ ++ dirlen = strlen (pwd->pw_dir); ++ pbuf = malloc (dirlen + sizeof "/.rhosts"); ++ strcpy (pbuf, pwd->pw_dir); ++ strcat (pbuf, "/.rhosts"); ++ ++ /* Change effective uid while reading .rhosts. If root and ++ reading an NFS mounted file system, can't read files that ++ are protected read/write owner only. */ ++ uid = geteuid (); ++ seteuid (pwd->pw_uid); ++ hostf = iruserfopen (pbuf, pwd->pw_uid); ++ free(pbuf); ++ ++ if (hostf != NULL) { ++ isbad = __ivaliduser2 (hostf, raddr, luser, ruser, rhost); ++ fclose (hostf); ++ } ++ ++ seteuid (uid); ++ return isbad; ++ } ++ return -1; ++} ++ ++int ruserok(const char *rhost, int superuser, const char *ruser, ++ const char *luser) ++{ ++ struct hostent *hp; ++ u_int32_t addr; ++ char **ap; ++#ifdef __UCLIBC_HAS_REENTRANT_RPC__ ++ size_t buflen; ++ char *buffer; ++ int herr; ++ struct hostent hostbuf; ++#endif ++ ++#ifdef __UCLIBC_HAS_REENTRANT_RPC__ ++ buflen = 1024; ++ buffer = stack_heap_alloc(buflen); ++ ++ while (gethostbyname_r (rhost, &hostbuf, buffer, ++ buflen, &hp, &herr) != 0 || hp == NULL) ++ { ++ if (herr != NETDB_INTERNAL || errno != ERANGE) { ++ stack_heap_free(buffer); ++ return -1; ++ } else ++ { ++ /* Enlarge the buffer. */ ++ buflen *= 2; ++ stack_heap_free(buffer); ++ buffer = stack_heap_alloc(buflen); ++ } ++ } ++ stack_heap_free(buffer); ++#else ++ if ((hp = gethostbyname(rhost)) == NULL) { ++ return -1; ++ } ++#endif ++ for (ap = hp->h_addr_list; *ap; ++ap) { ++ memmove(&addr, *ap, sizeof(addr)); ++ if (iruserok2(addr, superuser, ruser, luser, rhost) == 0) ++ return 0; ++ } ++ return -1; ++} ++ ++#endif /* __UCLIBC__ */ ++ + PAM_EXTERN + int pam_sm_authenticate (pam_handle_t *pamh, int flags, int argc, + const char **argv) diff --git a/libs/libpam/patches/006-fix_xdr.patch b/libs/libpam/patches/006-fix_xdr.patch new file mode 100644 index 0000000..eec6772 --- /dev/null +++ b/libs/libpam/patches/006-fix_xdr.patch @@ -0,0 +1,272 @@ +--- a/modules/pam_unix/yppasswd_xdr.c ++++ b/modules/pam_unix/yppasswd_xdr.c +2011-10-01 13:46:21.599443197 +0300 +@@ -21,6 +21,268 @@ + #endif + #include "yppasswd.h" + ++#ifdef __UCLIBC__ ++ ++static const char xdr_zero[BYTES_PER_XDR_UNIT] = {0, 0, 0, 0}; ++ ++/* ++ * XDR integers ++ */ ++bool_t ++xdr_int (XDR *xdrs, int *ip) ++{ ++ ++#if INT_MAX < LONG_MAX ++ long l; ++ ++ switch (xdrs->x_op) ++ { ++ case XDR_ENCODE: ++ l = (long) *ip; ++ return XDR_PUTLONG (xdrs, &l); ++ ++ case XDR_DECODE: ++ if (!XDR_GETLONG (xdrs, &l)) ++ { ++ return FALSE; ++ } ++ *ip = (int) l; ++ case XDR_FREE: ++ return TRUE; ++ } ++ return FALSE; ++#elif INT_MAX == LONG_MAX ++ return xdr_long (xdrs, (long *) ip); ++#elif INT_MAX == SHRT_MAX ++ return xdr_short (xdrs, (short *) ip); ++#else ++#error unexpected integer sizes in xdr_int() ++#endif ++} ++ ++/* ++ * XDR null terminated ASCII strings ++ * xdr_string deals with "C strings" - arrays of bytes that are ++ * terminated by a NULL character. The parameter cpp references a ++ * pointer to storage; If the pointer is null, then the necessary ++ * storage is allocated. The last parameter is the max allowed length ++ * of the string as specified by a protocol. ++ */ ++bool_t ++xdr_string (XDR *xdrs, char **cpp, u_int maxsize) ++{ ++ char *sp = *cpp; /* sp is the actual string pointer */ ++ u_int size; ++ u_int nodesize; ++ ++ /* ++ * first deal with the length since xdr strings are counted-strings ++ */ ++ switch (xdrs->x_op) ++ { ++ case XDR_FREE: ++ if (sp == NULL) ++ { ++ return TRUE; /* already free */ ++ } ++ /* fall through... */ ++ case XDR_ENCODE: ++ if (sp == NULL) ++ return FALSE; ++ size = strlen (sp); ++ break; ++ case XDR_DECODE: ++ break; ++ } ++ if (!xdr_u_int (xdrs, &size)) ++ { ++ return FALSE; ++ } ++ if (size > maxsize) ++ { ++ return FALSE; ++ } ++ nodesize = size + 1; ++ ++ /* ++ * now deal with the actual bytes ++ */ ++ switch (xdrs->x_op) ++ { ++ case XDR_DECODE: ++ if (nodesize == 0) ++ { ++ return TRUE; ++ } ++ if (sp == NULL) ++ *cpp = sp = (char *) mem_alloc (nodesize); ++ if (sp == NULL) ++ { ++#ifdef USE_IN_LIBIO ++ if (_IO_fwide (stderr, 0) > 0) ++ (void) fwprintf (stderr, L"%s", ++ _("xdr_string: out of memory\n")); ++ else ++#endif ++ (void) fputs (_("xdr_string: out of memory\n"), stderr); ++ return FALSE; ++ } ++ sp[size] = 0; ++ /* fall into ... */ ++ ++ case XDR_ENCODE: ++ return xdr_opaque (xdrs, sp, size); ++ ++ case XDR_FREE: ++ mem_free (sp, nodesize); ++ *cpp = NULL; ++ return TRUE; ++ } ++ return FALSE; ++} ++ ++/* ++ * XDR long integers ++ * The definition of xdr_long() is kept for backward ++ * compatibility. Instead xdr_int() should be used. ++ */ ++bool_t ++xdr_long (XDR *xdrs, long *lp) ++{ ++ if (xdrs->x_op == XDR_ENCODE ++ && (sizeof (int32_t) == sizeof (long) ++ || (int32_t) *lp == *lp)) ++ return XDR_PUTLONG (xdrs, lp); ++ ++ if (xdrs->x_op == XDR_DECODE) ++ return XDR_GETLONG (xdrs, lp); ++ ++ if (xdrs->x_op == XDR_FREE) ++ return TRUE; ++ ++ return FALSE; ++} ++ ++/* ++ * XDR unsigned integers ++ */ ++bool_t ++xdr_u_int (XDR *xdrs, u_int *up) ++{ ++#if UINT_MAX < ULONG_MAX ++ u_long l; ++ ++ switch (xdrs->x_op) ++ { ++ case XDR_ENCODE: ++ l = (u_long) * up; ++ return XDR_PUTLONG (xdrs, (long *) &l); ++ ++ case XDR_DECODE: ++ if (!XDR_GETLONG (xdrs, (long *) &l)) ++ { ++ return FALSE; ++ } ++ *up = (u_int) l; ++ case XDR_FREE: ++ return TRUE; ++ } ++ return FALSE; ++#elif UINT_MAX == ULONG_MAX ++ return xdr_u_long (xdrs, (u_long *) up); ++#elif UINT_MAX == USHRT_MAX ++ return xdr_short (xdrs, (short *) up); ++#else ++#error unexpected integer sizes in xdr_u_int() ++#endif ++} ++ ++/* ++ * XDR opaque data ++ * Allows the specification of a fixed size sequence of opaque bytes. ++ * cp points to the opaque object and cnt gives the byte length. ++ */ ++bool_t ++xdr_opaque (XDR *xdrs, caddr_t cp, u_int cnt) ++{ ++ u_int rndup; ++ static char crud[BYTES_PER_XDR_UNIT]; ++ ++ /* ++ * if no data we are done ++ */ ++ if (cnt == 0) ++ return TRUE; ++ ++ /* ++ * round byte count to full xdr units ++ */ ++ rndup = cnt % BYTES_PER_XDR_UNIT; ++ if (rndup > 0) ++ rndup = BYTES_PER_XDR_UNIT - rndup; ++ ++ switch (xdrs->x_op) ++ { ++ case XDR_DECODE: ++ if (!XDR_GETBYTES (xdrs, cp, cnt)) ++ { ++ return FALSE; ++ } ++ if (rndup == 0) ++ return TRUE; ++ return XDR_GETBYTES (xdrs, (caddr_t)crud, rndup); ++ ++ case XDR_ENCODE: ++ if (!XDR_PUTBYTES (xdrs, cp, cnt)) ++ { ++ return FALSE; ++ } ++ if (rndup == 0) ++ return TRUE; ++ return XDR_PUTBYTES (xdrs, xdr_zero, rndup); ++ ++ case XDR_FREE: ++ return TRUE; ++ } ++ return FALSE; ++} ++ ++/* ++ * XDR unsigned long integers ++ * The definition of xdr_u_long() is kept for backward ++ * compatibility. Instead xdr_u_int() should be used. ++ */ ++bool_t ++xdr_u_long (XDR *xdrs, u_long *ulp) ++{ ++ switch (xdrs->x_op) ++ { ++ case XDR_DECODE: ++ { ++ long int tmp; ++ ++ if (XDR_GETLONG (xdrs, &tmp) == FALSE) ++ return FALSE; ++ ++ *ulp = (uint32_t) tmp; ++ return TRUE; ++ } ++ ++ case XDR_ENCODE: ++ if (sizeof (uint32_t) != sizeof (u_long) ++ && (uint32_t) *ulp != *ulp) ++ return FALSE; ++ ++ return XDR_PUTLONG (xdrs, (long *) ulp); ++ ++ case XDR_FREE: ++ return TRUE; ++ } ++ return FALSE; ++} ++ ++#endif /* UCLIBC */ ++ + bool_t + xdr_xpasswd(XDR * xdrs, xpasswd * objp) + { diff --git a/libs/libpar2/Makefile b/libs/libpar2/Makefile new file mode 100644 index 0000000..1f8be5b --- /dev/null +++ b/libs/libpar2/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2009-2012 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:=libpar2 +PKG_VERSION:=0.2 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/parchive +PKG_MD5SUM:=94c6df4e38efe08056ecde2a04e0be91 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libpar2 + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libsigcxx + TITLE:=A library for performing common tasks related to PAR recovery sets + URL:=http://parchive.sourceforge.net/ +endef + +define Package/libpar2/description +A library for performing common tasks related to PAR recovery sets +endef + +CONFIGURE_ARGS += \ + --disable-static \ + --disable-nls \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/libpar2 + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/libpar2/*.h \ + $(1)/usr/include/libpar2/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libpar2.{la,so*} \ + $(1)/usr/lib/ +endef + +define Package/libpar2/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libpar2.so* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libpar2)) diff --git a/libs/libpar2/patches/100-par2cmdline-0.4-packed.patch b/libs/libpar2/patches/100-par2cmdline-0.4-packed.patch new file mode 100644 index 0000000..23f6d1f --- /dev/null +++ b/libs/libpar2/patches/100-par2cmdline-0.4-packed.patch @@ -0,0 +1,217 @@ +--- a/letype.h ++++ b/letype.h +@@ -28,44 +28,15 @@ typedef u64 leu64; + + #else + +-class leu16 ++struct leu16 + { +-public: +- leu16(void); +- +- leu16(const leu16 &other); +- leu16& operator=(const leu16 &other); +- +- leu16(const u16 &other); + leu16& operator=(const u16 &other); + + operator u16(void) const; + +-protected: + u16 value; + }; + +-inline leu16::leu16(void) +-{ +-} +- +-inline leu16::leu16(const leu16 &other) +-: value(other.value) +-{ +-} +- +-inline leu16& leu16::operator =(const leu16 &other) +-{ +- value = other.value; +- return *this; +-} +- +-inline leu16::leu16(const u16 &other) +-{ +- ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff); +- ((unsigned char*)&value)[1] = (unsigned char)((other >> 8) & 0xff); +-} +- + inline leu16& leu16::operator=(const u16 &other) + { + ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff); +@@ -81,46 +52,15 @@ inline leu16::operator u16(void) const + } + + +-class leu32 ++struct leu32 + { +-public: +- leu32(void); +- +- leu32(const leu32 &other); +- leu32& operator=(const leu32 &other); +- +- leu32(const u32 &other); + leu32& operator=(const u32 &other); + + operator u32(void) const; + +-protected: + u32 value; + }; + +-inline leu32::leu32(void) +-{ +-} +- +-inline leu32::leu32(const leu32 &other) +-: value(other.value) +-{ +-} +- +-inline leu32& leu32::operator =(const leu32 &other) +-{ +- value = other.value; +- return *this; +-} +- +-inline leu32::leu32(const u32 &other) +-{ +- ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff); +- ((unsigned char*)&value)[1] = (unsigned char)((other >> 8) & 0xff); +- ((unsigned char*)&value)[2] = (unsigned char)((other >> 16) & 0xff); +- ((unsigned char*)&value)[3] = (unsigned char)((other >> 24) & 0xff); +-} +- + inline leu32& leu32::operator=(const u32 &other) + { + ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff); +@@ -140,50 +80,15 @@ inline leu32::operator u32(void) const + } + + +-class leu64 ++struct leu64 + { +-public: +- leu64(void); +- +- leu64(const leu64 &other); +- leu64& operator=(const leu64 &other); +- +- leu64(const u64 &other); + leu64& operator=(const u64 &other); + + operator u64(void) const; + +-protected: + u64 value; + }; + +-inline leu64::leu64(void) +-{ +-} +- +-inline leu64::leu64(const leu64 &other) +-: value(other.value) +-{ +-} +- +-inline leu64& leu64::operator =(const leu64 &other) +-{ +- value = other.value; +- return *this; +-} +- +-inline leu64::leu64(const u64 &other) +-{ +- ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff); +- ((unsigned char*)&value)[1] = (unsigned char)((other >> 8) & 0xff); +- ((unsigned char*)&value)[2] = (unsigned char)((other >> 16) & 0xff); +- ((unsigned char*)&value)[3] = (unsigned char)((other >> 24) & 0xff); +- ((unsigned char*)&value)[4] = (unsigned char)((other >> 32) & 0xff); +- ((unsigned char*)&value)[5] = (unsigned char)((other >> 40) & 0xff); +- ((unsigned char*)&value)[6] = (unsigned char)((other >> 48) & 0xff); +- ((unsigned char*)&value)[7] = (unsigned char)((other >> 56) & 0xff); +-} +- + inline leu64& leu64::operator=(const u64 &other) + { + ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff); +--- a/md5.h ++++ b/md5.h +@@ -20,6 +20,13 @@ + #ifndef __MD5_H__ + #define __MD5_H__ + ++#ifdef WIN32 ++#pragma pack(push, 1) ++#define PACKED ++#else ++#define PACKED __attribute__ ((packed)) ++#endif ++ + // This file defines the MD5Hash and MD5Context objects which are used + // to compute and manipulate the MD5 Hash values for a block of data. + +@@ -35,12 +42,11 @@ + + // MD5 Hash value + +-class MD5Hash +-{ +-public: +- // Constructor does not initialise the value +- MD5Hash(void) {}; ++struct MD5Hash; ++ostream& operator<<(ostream &s, const MD5Hash &hash); + ++struct MD5Hash ++{ + // Comparison operators + bool operator==(const MD5Hash &other) const; + bool operator!=(const MD5Hash &other) const; +@@ -54,13 +60,8 @@ public: + friend ostream& operator<<(ostream &s, const MD5Hash &hash); + string print(void) const; + +- // Copy and assignment +- MD5Hash(const MD5Hash &other); +- MD5Hash& operator=(const MD5Hash &other); +- +-public: + u8 hash[16]; // 16 byte MD5 Hash value +-}; ++} PACKED; + + // Intermediate computation state + +@@ -144,16 +145,9 @@ inline bool MD5Hash::operator<=(const MD + return !other.operator<(*this); + } + +-inline MD5Hash::MD5Hash(const MD5Hash &other) +-{ +- memcpy(&hash, &other.hash, sizeof(hash)); +-} +- +-inline MD5Hash& MD5Hash::operator=(const MD5Hash &other) +-{ +- memcpy(&hash, &other.hash, sizeof(hash)); +- +- return *this; +-} ++#ifdef WIN32 ++#pragma pack(pop) ++#endif ++#undef PACKED + + #endif // __MD5_H__ diff --git a/libs/libpfm/Makefile b/libs/libpfm/Makefile new file mode 100644 index 0000000..f9e25ee --- /dev/null +++ b/libs/libpfm/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2006-2008 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:=libpfm +PKG_VERSION:=3.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/perfmon2 +PKG_MD5SUM:=5075fa45ddce4aa647b70e9f9446eacc + +include $(INCLUDE_DIR)/package.mk + +define Package/libpfm + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Perfmon2 Kernel performance monitoring interface + URL:=http://perfmon2.sourceforge.net/ + DEPENDS:=@BROKEN +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + ARCH=cell \ + CC=$(TARGET_CROSS)gcc \ + AR=$(TARGET_CROSS)ar \ + lib +endef + +define Build/InstallDev + echo "Build/InstallDev" + $(MAKE) -C $(PKG_BUILD_DIR)/include \ + ARCH=cell \ + DESTDIR=$(1) \ + INCDIR=/usr/include \ + CONFIG_PFMLIB_ARCH_POWERPC=y \ + install +# $(MAKE) -C $(PKG_BUILD_DIR)/lib \ +# ARCH=cell \ +# CC=$(TARGET_CROSS)gcc \ +# DESTDIR=$(1) \ +# LIBDIR=/usr/lib \ +# CONFIG_PFMLIB_ARCH_POWERPC=y \ +# CONFIG_PFMLIB_CELL=y \ +# CONFIG_PFMLIB_SHARED=y \ +# install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/lib/libpfm* $(1)/usr/lib/ +endef + +define Package/libpfm/install + echo "Package/libpfm/install" + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/lib/libpfm* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libpfm)) diff --git a/libs/libplist/Makefile b/libs/libplist/Makefile new file mode 100644 index 0000000..9aede13 --- /dev/null +++ b/libs/libplist/Makefile @@ -0,0 +1,96 @@ +# +# Copyright (C) 2012 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:=libplist +PKG_VERSION:=1.8 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.libimobiledevice.org/downloads +PKG_MD5SUM:=2a9e0258847d50f9760dc3ece25f4dc6 + +CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/libplist/Default + TITLE:=Apple property list + URL:=http://www.libimobiledevice.org/ +endef + +define Package/libplist/Default/description + A library to handle Apple Property List format whereas it's binary or XML +endef + +define Package/libplist + $(call Package/libplist/Default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libxml2 + TITLE+= library +endef + +define Package/libplist/description + $(call Package/libplist/Default/description) +endef + +define Package/libplistcxx + $(call Package/libplist/Default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libplist +libstdcpp + TITLE+= C++ library +endef + +define Package/libplistcxx/description + $(call Package/libplist/Default/description) + This package contains the libplist C++ shared library. +endef + +define Package/libplist-utils + $(call Package/libplist/Default) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libplist + TITLE+= converter +endef + +define Package/libplist-utils/description + $(call Package/libplist/Default/description) + This package contains the libplist utilities. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/plist $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libplist*.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libplist*.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libplist/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libplist.so.* $(1)/usr/lib/ +endef + +define Package/libplistcxx/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libplist++.so.* $(1)/usr/lib/ +endef + +define Package/libplist-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/plutil* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libplist)) +$(eval $(call BuildPackage,libplistcxx)) +$(eval $(call BuildPackage,libplist-utils)) diff --git a/libs/libpng/Makefile b/libs/libpng/Makefile new file mode 100644 index 0000000..a7d5192 --- /dev/null +++ b/libs/libpng/Makefile @@ -0,0 +1,64 @@ +# +# Copyright (C) 2006-2012 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:=libpng +PKG_VERSION:=1.2.46 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/libpng +PKG_MD5SUM:=e8b43dc78ef95b3949af7f961d76874b + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk + +define Package/libpng + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+zlib + TITLE:=A PNG format files handling library + URL:=http://www.libpng.org/pub/png/libpng.html +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/libpng{,12}-config $(1)/usr/bin/ + $(SED) \ + 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ + $(1)/usr/bin/libpng{,12}-config + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/png{,conf}.h $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/libpng12 $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng{,12}.{a,la,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpng{,12}.pc $(1)/usr/lib/pkgconfig/ + $(INSTALL_DIR) $(2)/bin + for f in libpng{,12}-config; do \ + $(LN) ../../usr/bin/$$$$f $(2)/bin/ ; \ + done +endef + +define Package/libpng/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng{,12}.so.* $(1)/usr/lib/ +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,libpng)) diff --git a/libs/libpng/patches/100-config_fix.patch b/libs/libpng/patches/100-config_fix.patch new file mode 100644 index 0000000..3cb6d8a --- /dev/null +++ b/libs/libpng/patches/100-config_fix.patch @@ -0,0 +1,10 @@ +--- a/scripts/libpng-config-body.in ++++ b/scripts/libpng-config-body.in +@@ -83,6 +83,7 @@ while test $# -gt 0; do + + --static) + R_opts="" ++ libs=${all_libs} + ;; + + *) diff --git a/libs/libpng/patches/200-CVE-2011-3026.patch b/libs/libpng/patches/200-CVE-2011-3026.patch new file mode 100644 index 0000000..beb0d60 --- /dev/null +++ b/libs/libpng/patches/200-CVE-2011-3026.patch @@ -0,0 +1,40 @@ +--- a/pngrutil.c ++++ b/pngrutil.c +@@ -339,15 +339,18 @@ png_decompress_chunk(png_structp png_ptr + /* Now check the limits on this chunk - if the limit fails the + * compressed data will be removed, the prefix will remain. + */ ++ if (prefix_size >= (~(png_size_t)0) - 1 || ++ expanded_size >= (~(png_size_t)0) - 1 - prefix_size + #ifdef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED +- if (png_ptr->user_chunk_malloc_max && ++ || (png_ptr->user_chunk_malloc_max && + (prefix_size + expanded_size >= png_ptr->user_chunk_malloc_max - 1)) + #else + # ifdef PNG_USER_CHUNK_MALLOC_MAX +- if ((PNG_USER_CHUNK_MALLOC_MAX > 0) && ++ || ((PNG_USER_CHUNK_MALLOC_MAX > 0) && + prefix_size + expanded_size >= PNG_USER_CHUNK_MALLOC_MAX - 1) + # endif + #endif ++ ) + png_warning(png_ptr, "Exceeded size limit while expanding chunk"); + + /* If the size is zero either there was an error and a message +@@ -355,14 +358,11 @@ png_decompress_chunk(png_structp png_ptr + * and we have nothing to do - the code will exit through the + * error case below. + */ +-#if defined(PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED) || \ +- defined(PNG_USER_CHUNK_MALLOC_MAX) +- else +-#endif +- if (expanded_size > 0) ++ else if (expanded_size > 0) + { + /* Success (maybe) - really uncompress the chunk. */ + png_size_t new_size = 0; ++ + png_charp text = png_malloc_warn(png_ptr, + prefix_size + expanded_size + 1); + diff --git a/libs/libpthread-stubs/Makefile b/libs/libpthread-stubs/Makefile new file mode 100644 index 0000000..16d5fcc --- /dev/null +++ b/libs/libpthread-stubs/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2008 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:=libpthread-stubs +PKG_VERSION:=0.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://xcb.freedesktop.org/dist/ +PKG_MD5SUM:=774eabaf33440d534efe108ef9130a7d +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libpthread-stubs + SECTION:=libs + CATEGORY:=Libraries + TITLE:=libpthread-stubs + URL:=http://xcb.freedesktop.org/ + BUILDONLY:=1 +endef + +define Package/libpthread-stubs/description +This library provides weak aliases for pthread functions not provided in libc +or otherwise available by default. Libraries like libxcb rely on pthread +stubs to use pthreads optionally, becoming thread-safe when linked to +libpthread, while avoiding any performance hit when running single-threaded. +libpthread-stubs supports this behavior even on platforms which do not supply +all the necessary pthread stubs. On platforms which already supply all the +necessary pthread stubs, this package ships only the pkg-config file +pthread-stubs.pc, to allow libraries to unconditionally express a dependency +on pthread-stubs and still obtain correct behavior. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \ + $(1)/usr/lib/pkgconfig/ +endef + +$(eval $(call BuildPackage,libpthread-stubs)) diff --git a/libs/libptmalloc3/Makefile b/libs/libptmalloc3/Makefile new file mode 100644 index 0000000..a591c7e --- /dev/null +++ b/libs/libptmalloc3/Makefile @@ -0,0 +1,44 @@ +# Copyright (C) 2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# +# Sample usage: +# env LD_PRELOAD="/usr/lib/libptmalloc3.so" + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libptmalloc3 +PKG_VERSION:=20060531 +PKG_RELEASE:=1 +PKG_BUILD_DIR:=$(BUILD_DIR)/ptmalloc3 + +PKG_SOURCE:=ptmalloc3-current.tar.gz +PKG_SOURCE_URL:=http://www.malloc.de/malloc/ +PKG_MD5SUM:=c0b9dd5f16f8eae979166dc74b60015c + +include $(INCLUDE_DIR)/package.mk + +define Package/libptmalloc3 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Efficient malloc implementation + URL:=http://www.malloc.de/en/ +endef + +# flags: taken from ptmalloc3/Makefile by combining +# 'linux-shared' and 'linux-nothreads' targets +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + SYS_FLAGS="$(TARGET_CFLAGS)" \ + linux-shared-nothreads +endef + +define Package/libptmalloc3/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libptmalloc3.so $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libptmalloc3)) diff --git a/libs/libptmalloc3/patches/100-nothreads.patch b/libs/libptmalloc3/patches/100-nothreads.patch new file mode 100644 index 0000000..d8682de --- /dev/null +++ b/libs/libptmalloc3/patches/100-nothreads.patch @@ -0,0 +1,20 @@ +This patch adds an additional target to build a shared library without pthreads +(should this be the default? or is the ulibc malloc threadsafe? or should we +build two separate packages?) + +--- ptmalloc3/Makefile.orig 2007-11-08 09:10:46.000000000 +0000 ++++ ptmalloc3/Makefile 2007-11-08 09:17:09.000000000 +0000 +@@ -150,6 +150,13 @@ + INC_FLAGS='-Isysdeps/pthread -Isysdeps/generic -I.' M_FLAGS='$(M_FLAGS)' \ + LIB_MALLOC=libptmalloc3.so + ++linux-shared-nothreads: ++ $(MAKE) SYS_FLAGS='-D_GNU_SOURCE=1 -fpic' \ ++ WARN_FLAGS='-Wall -Wstrict-prototypes' \ ++ OPT_FLAGS='$(OPT_FLAGS)' THR_FLAGS='' THR_LIBS='' \ ++ INC_FLAGS='-Isysdeps/generic -I.' M_FLAGS='$(M_FLAGS)' \ ++ LIB_MALLOC=libptmalloc3.so ++ + sproc: + $(MAKE) THR_FLAGS='' THR_LIBS='' OPT_FLAGS='$(OPT_FLAGS)' CC='$(CC)' \ + INC_FLAGS='-Isysdeps/sproc -Isysdeps/generic -I.' \ diff --git a/libs/librpcsecgss/Makefile b/libs/librpcsecgss/Makefile new file mode 100644 index 0000000..5d3d0cd --- /dev/null +++ b/libs/librpcsecgss/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=librpcsecgss +PKG_VERSION:=0.14 +PKG_RELEASE:=2 + +PKG_SOURCE:=librpcsecgss-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.citi.umich.edu/projects/nfsv4/linux/librpcsecgss/ +PKG_MD5SUM:=0d4cdee46a98731b1b71e30504589281 + +PKG_BUILD_DEPENDS:=libgssapi +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/librpcsecgss + SECTION:=libs + CATEGORY:=Libraries + TITLE:=required libraries for the nfs-utils + URL:=http://www.citi.umich.edu/projects/nfsv4/linux +endef + +define Package/librpcsecgss/description + Support libraries - for newer nfs mount command (nfs4) +endef + +TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/lib -I$(STAGING_DIR)/usr/include/gssglue/ $(FPIC) + +MAKE_FLAGS += \ + OPT="$(TARGET_CFLAGS)" \ + INSTALLSUID="install -m 4755" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + GSSAPI_LIBS="usr/lib/libgssapi.a" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/rpcsecgss/rpc + $(CP) $(PKG_INSTALL_DIR)/usr/include/rpcsecgss/rpc/*.h $(1)/usr/include/rpcsecgss/rpc/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/librpcsecgss.{a,so*} $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/librpcsecgss.pc $(1)/usr/lib/pkgconfig +endef + +$(eval $(call BuildPackage,librpcsecgss)) diff --git a/libs/librsync/Makefile b/libs/librsync/Makefile new file mode 100644 index 0000000..653be54 --- /dev/null +++ b/libs/librsync/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=librsync +PKG_VERSION:=0.9.7 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/librsync +PKG_MD5SUM:=24cdb6b78f45e0e83766903fd4f6bc84 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(FPIC) + +define Package/librsync + SECTION:=libs + CATEGORY:=Libraries + TITLE:=implementation of the rolling-checksum algorithm + DEPENDS:=+libbz2 +libpopt +zlib + URL:=http://librsync.sourceforge.net/ +endef + +define Package/librsync/description + librsync implements the rolling-checksum algorithm of remote file + synchronization that was popularized by the rsync utility and is + used in rproxy. This algorithm transfers the differences between 2 + files without needing both files on the same system. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + ); +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/librsync{,-config}.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/librsync.{a,so*} $(1)/usr/lib/ +endef + +define Package/librsync/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/librsync.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,librsync)) diff --git a/libs/librsync/patches/001-4gb_files.patch b/libs/librsync/patches/001-4gb_files.patch new file mode 100644 index 0000000..3c0128e --- /dev/null +++ b/libs/librsync/patches/001-4gb_files.patch @@ -0,0 +1,31 @@ +diff -urN librsync-0.9.7/mdfour.h librsync-0.9.7.new/mdfour.h +--- librsync-0.9.7/mdfour.h 2004-02-08 00:17:57.000000000 +0100 ++++ librsync-0.9.7.new/mdfour.h 2009-08-08 16:08:57.000000000 +0200 +@@ -24,7 +24,7 @@ + #include "types.h" + + struct rs_mdfour { +- int A, B, C, D; ++ unsigned int A, B, C, D; + #if HAVE_UINT64 + uint64_t totalN; + #else +diff -urN librsync-0.9.7/patch.c librsync-0.9.7.new/patch.c +--- librsync-0.9.7/patch.c 2004-09-17 23:35:50.000000000 +0200 ++++ librsync-0.9.7.new/patch.c 2009-08-08 16:10:40.000000000 +0200 +@@ -214,12 +214,12 @@ + void *buf, *ptr; + rs_buffers_t *buffs = job->stream; + +- len = job->basis_len; +- + /* copy only as much as will fit in the output buffer, so that we + * don't have to block or store the input. */ +- if (len > buffs->avail_out) ++ if (job->basis_len > buffs->avail_out) + len = buffs->avail_out; ++ else ++ len = job->basis_len; + + if (!len) + return RS_BLOCKED; diff --git a/libs/libsamplerate/Makefile b/libs/libsamplerate/Makefile new file mode 100644 index 0000000..b31a649 --- /dev/null +++ b/libs/libsamplerate/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2007-2009 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:=libsamplerate +PKG_VERSION:=0.1.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.mega-nerd.com/SRC/ +PKG_MD5SUM:=ad093e60ec44f0a60de8e29983ddbc0f + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=autogen.sh + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libsamplerate + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libsndfile + TITLE:=Sample Rate Converter + URL:=http://www.mega-nerd.com/SRC/index.html +endef + +define Package/libsamplerate/description + Secret Rabbit Code (aka libsamplerate) is a Sample Rate + Converter for audio. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --disable-fftw \ + +define Build/InstallDev + $(INSTALL_DIR) $(1) + $(CP) $(PKG_INSTALL_DIR)/* $(1)/ +endef + +define Package/libsamplerate/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsamplerate.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libsamplerate)) diff --git a/libs/libsamplerate/patches/001-fix-m4-loop.patch b/libs/libsamplerate/patches/001-fix-m4-loop.patch new file mode 100644 index 0000000..e91499c --- /dev/null +++ b/libs/libsamplerate/patches/001-fix-m4-loop.patch @@ -0,0 +1,18 @@ +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -135,7 +135,6 @@ if test $ac_cv_c_byte_order = unknown ; + fi + + ) +-] + + if test $ac_cv_c_byte_order = big ; then + ac_cv_c_big_endian=1 +@@ -154,6 +153,7 @@ else + AC_MSG_WARN([[*****************************************************************]]) + fi + ++] + )# AC_C_FIND_ENDIAN + + diff --git a/libs/libsdl/Makefile b/libs/libsdl/Makefile new file mode 100644 index 0000000..3356e94 --- /dev/null +++ b/libs/libsdl/Makefile @@ -0,0 +1,161 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=SDL +PKG_VERSION:=1.2.14 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.libsdl.org/release/ +PKG_MD5SUM:=e52086d1b508fa0b76c52ee30b55bec4 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +PKG_CONFIG_DEPENDS:=CONFIG_AUDIO_SUPPORT + +include $(INCLUDE_DIR)/package.mk + +define Package/libsdl + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Simple DirectMedia Layer + URL:=http://www.libsdl.org + DEPENDS:=+directfb +zlib +libpthread +AUDIO_SUPPORT:alsa-lib +endef + +define Package/libsdl/description + SDL is a library that allows programs portable low level access to a video + framebuffer, audio output, mouse, and keyboard. +endef + +CONFIGURE_ARGS+= \ + --enable-libc \ + --enable-video \ + --enable-events \ + --enable-joystick \ + --enable-cdrom \ + --enable-threads \ + --enable-timers \ + --enable-file \ + --enable-loadso \ + --enable-cpuinfo \ + --enable-assembly \ + --disable-oss \ + --disable-alsatest \ + --enable-alsa-shared \ + --disable-esd \ + --disable-esdtest \ + --enable-esd-shared \ + --disable-pulseaudio \ + --enable-pulseaudio-shared \ + --disable-arts \ + --enable-arts-shared \ + --disable-nas \ + --enable-nas-shared \ + --disable-diskaudio \ + --disable-dummyaudio \ + --disable-mintaudio \ + --disable-nasm \ + --disable-altivec \ + --disable-ipod \ + --disable-nanox \ + --disable-video-x11 \ + --enable-x11-shared \ + --enable-dga \ + --enable-video-dga \ + --enable-video-x11-dgamouse \ + --enable-video-x11-vm \ + --enable-video-x11-xv \ + --disable-video-x11-xinerama \ + --disable-video-x11-xme \ + --disable-video-x11-xrandr \ + --disable-video-photon \ + --disable-video-carbon \ + --disable-video-cocoa \ + --enable-video-fbcon \ + --enable-video-directfb \ + --disable-video-ps2gs \ + --disable-video-ps3 \ + --disable-video-ggi \ + --disable-video-svga \ + --disable-video-vgl \ + --disable-video-wscons \ + --disable-video-aalib \ + --disable-video-caca \ + --disable-video-qtopia \ + --disable-video-picogui \ + --disable-video-xbios \ + --disable-video-gem \ + --disable-video-dummy \ + --disable-video-opengl \ + --disable-osmesa-shared \ + --disable-screensaver \ + --enable-input-events \ + --disable-input-tslib \ + --enable-pth \ + --enable-pthreads \ + --enable-pthread-sem \ + --disable-stdio-redirect \ + --disable-directx \ + --enable-sdl-dlopen \ + --disable-atari-ldg \ + --disable-clock_gettime \ + --without-x \ + --disable-rpath \ + +ifneq ($(CONFIG_AUDIO_SUPPORT),) + CONFIGURE_ARGS+= \ + --enable-audio \ + --enable-alsa +else + CONFIGURE_ARGS+= \ + --disable-audio \ + --disable-alsa +endif + +CONFIGURE_VARS+= \ + ac_cv_path_DIRECTFBCONFIG=no \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/SDL* \ + $(1)/usr/include/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libSDL*.{a,so*} \ + $(1)/usr/lib/ + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \ + $(1)/usr/lib/pkgconfig + + + $(INSTALL_DIR) $(1)/usr/share/aclocal + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/aclocal/* \ + $(1)/usr/share/aclocal/ + + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/sdl-config \ + $(1)/usr/bin/ + + $(SED) 's,^\(exec_prefix\|prefix\)=.*,\1=\"$(STAGING_DIR)/usr/\",g' \ + $(1)/usr/bin/sdl-config + + $(INSTALL_DIR) $(1)/host/bin + ln -sf ../../usr/bin/sdl-config $(1)/host/bin/ +endef + +define Package/libsdl/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libSDL*.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libsdl)) diff --git a/libs/libsdl/patches/001-automake-compat.patch b/libs/libsdl/patches/001-automake-compat.patch new file mode 100644 index 0000000..0e8ac79 --- /dev/null +++ b/libs/libsdl/patches/001-automake-compat.patch @@ -0,0 +1,5 @@ +--- /dev/null ++++ b/Makefile.am +@@ -0,0 +1,2 @@ ++SUBDIRS = . ++ACLOCAL_AMFLAGS = -I . -I acinclude diff --git a/libs/libsdl_mixer/Makefile b/libs/libsdl_mixer/Makefile new file mode 100644 index 0000000..232080c --- /dev/null +++ b/libs/libsdl_mixer/Makefile @@ -0,0 +1,77 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=SDL_mixer +PKG_VERSION:=1.2.11 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.libsdl.org/projects/SDL_mixer/release/ +PKG_MD5SUM:=65ada3d997fe85109191a5fb083f248c + +PKG_FIXUP:=autoreconf +PKG_MACRO_PATHS:=acinclude +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_LDFLAGS += -Wl,-rpath-link,$(STAGING_DIR)/usr/lib + +define Package/libsdl-mixer + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Simple DirectMedia Layer Sound Mixer + URL:=http://www.libsdl.org/projects/SDL_mixer/ + DEPENDS:=+libsdl +libmikmod +libvorbisidec +endef + +define Package/libsdl-mixer/description + SDL_mixer is a sample multi-channel audio mixer library. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-sdltest \ + --enable-music-cmd \ + --enable-music-wave \ + --enable-music-mod \ + --enable-music-mod-shared \ + --enable-music-midi \ + --disable-music-ogg \ + --enable-music-ogg-tremor \ + --enable-music-ogg-shared \ + --disable-music-flac \ + --enable-music-flag-shared \ + --disable-music-mp3 \ + --enable-music-mp3-shared \ + --disable-smpegtest \ + --disable-music-mp3-mad-gpl \ + --with-sdl-exec-prefix="$(STAGING_DIR)/usr" \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/SDL $(1)/usr/lib/pkgconfig + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/SDL/SDL_mixer.h \ + $(1)/usr/include/SDL/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libSDL_mixer*.{a,la,so*} \ + $(1)/usr/lib/ + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/libsdl-mixer/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libSDL_mixer*.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libsdl-mixer)) diff --git a/libs/libsdl_mixer/files/sdl-config b/libs/libsdl_mixer/files/sdl-config new file mode 100755 index 0000000..e496baf --- /dev/null +++ b/libs/libsdl_mixer/files/sdl-config @@ -0,0 +1,3 @@ +#!/bin/sh +# Fake sdl-config +echo "-lSDL -ldirect -ldirectfb -lfusion" diff --git a/libs/libsdl_mixer/patches/001-automake-compat.patch b/libs/libsdl_mixer/patches/001-automake-compat.patch new file mode 100644 index 0000000..8e879c3 --- /dev/null +++ b/libs/libsdl_mixer/patches/001-automake-compat.patch @@ -0,0 +1,10 @@ +--- a/configure.in ++++ b/configure.in +@@ -1,6 +1,6 @@ + dnl Process this file with autoconf to produce a configure script. + AC_INIT(README) +-AC_CONFIG_AUX_DIRS($srcdir/build-scripts) ++AC_CONFIG_AUX_DIR([build-scripts]) + + dnl Set various version strings - taken gratefully from the GTk sources + diff --git a/libs/libsdl_mixer/patches/002-fix-linking.patch b/libs/libsdl_mixer/patches/002-fix-linking.patch new file mode 100644 index 0000000..a7b1fb1 --- /dev/null +++ b/libs/libsdl_mixer/patches/002-fix-linking.patch @@ -0,0 +1,17 @@ +diff --git a/Makefile.in b/Makefile.in +index 76fdd3c..3ab4939 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -75,10 +75,10 @@ $(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS) + $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) + + $(objects)/playwave$(EXE): $(objects)/playwave.lo $(objects)/$(TARGET) +- $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET) ++ $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) + + $(objects)/playmus$(EXE): $(objects)/playmus.lo $(objects)/$(TARGET) +- $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playmus.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET) ++ $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playmus.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) + + install: all install-hdrs install-lib #install-bin + install-hdrs: diff --git a/libs/libsdl_sound/Makefile b/libs/libsdl_sound/Makefile new file mode 100644 index 0000000..836b4fc --- /dev/null +++ b/libs/libsdl_sound/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libsdl-sound +PKG_VERSION:=1.0.3 +PKG_RELEASE:=2 + +PKG_SOURCE:=SDL_sound-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://icculus.org/SDL_sound/downloads/ +PKG_MD5SUM:=aa09cd52df85d29bee87a664424c94b5 + +PKG_BUILD_DIR:=$(BUILD_DIR)/SDL_sound-$(PKG_VERSION) +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_LDFLAGS += -Wl,-rpath-link,$(STAGING_DIR)/usr/lib + +define Package/libsdl-sound + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Simple DirectMedia Layer Sound Decoder + URL:=http://icculus.org/SDL_sound/ + DEPENDS:=+libsdl +endef + +define Package/libsdl-sound/description + SDL_sound is a library that handles the decoding + of several popular sound file formats, such as .WAV and .MP3. +endef + +CONFIGURE_ARGS += \ + --with-sdl-prefix="$(STAGING_DIR)/usr" \ + --disable-flac \ + --disable-mikmod \ + --disable-modplug \ + --disable-ogg \ + --disable-smpeg \ + --disable-speex \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/SDL $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/SDL/SDL_sound.h \ + $(1)/usr/include/SDL/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libSDL_sound*.{a,so*} \ + $(1)/usr/lib/ +endef + +define Package/libsdl-sound/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libSDL_sound*.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libsdl-sound)) diff --git a/libs/libshout/Makefile b/libs/libshout/Makefile new file mode 100644 index 0000000..5a11d25 --- /dev/null +++ b/libs/libshout/Makefile @@ -0,0 +1,66 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libshout +PKG_VERSION:=2.2.2 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.us.xiph.org/releases/libshout/ +PKG_MD5SUM:=4f75fc9901c724b712c371c9a1e782d3 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(FPIC) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +define Package/libshout + SECTION:=libs + DEPENDS:= +libspeex +libtheora +libvorbis +libvorbisidec +libpthread + CATEGORY:=Libraries + TITLE:=Library which can be used to write a source client like ices + URL:=http://www.icecast.org/download.php +endef + +define Package/libshout/description + 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, + and lets developers focus on feature sets instead of implementation + details. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + VORBIS_CFLAGS="-I$(STAGING_DIR)/usr/include/tremor/" \ + VORBIS_LIBS="$(TARGET_LDFLAGS) -lvorbis -lvorbisidec" \ + --enable-shared \ + --enable-static \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/shout + $(CP) $(PKG_INSTALL_DIR)/usr/include/shout/shout.h $(1)/usr/include/shout + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libshout.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(SED) 's|/usr/include|$(STAGING_DIR)/usr/include|' \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/shout.pc + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/shout.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libshout/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libshout.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libshout)) diff --git a/libs/libshout/patches/100-ogg-c.patch b/libs/libshout/patches/100-ogg-c.patch new file mode 100644 index 0000000..4313986 --- /dev/null +++ b/libs/libshout/patches/100-ogg-c.patch @@ -0,0 +1,13 @@ +Index: libshout-2.2.2/src/ogg.c +=================================================================== +--- libshout-2.2.2.orig/src/ogg.c 2008-02-12 12:30:14.000000000 +0100 ++++ libshout-2.2.2/src/ogg.c 2008-02-12 12:30:14.000000000 +0100 +@@ -30,7 +30,7 @@ + #include + #endif + +-#include ++#include + + #include + #include "shout_private.h" diff --git a/libs/libshout/patches/110-shout-ogg-c.patch b/libs/libshout/patches/110-shout-ogg-c.patch new file mode 100644 index 0000000..d495570 --- /dev/null +++ b/libs/libshout/patches/110-shout-ogg-c.patch @@ -0,0 +1,13 @@ +Index: libshout-2.2.2/src/shout_ogg.h +=================================================================== +--- libshout-2.2.2.orig/src/shout_ogg.h 2008-02-12 12:30:14.000000000 +0100 ++++ libshout-2.2.2/src/shout_ogg.h 2008-02-12 12:30:14.000000000 +0100 +@@ -28,7 +28,7 @@ + + #include + +-#include ++#include + + typedef struct _ogg_codec_tag { + ogg_stream_state os; diff --git a/libs/libshout/patches/120-vorbis-c.patch b/libs/libshout/patches/120-vorbis-c.patch new file mode 100644 index 0000000..ab5bcee --- /dev/null +++ b/libs/libshout/patches/120-vorbis-c.patch @@ -0,0 +1,13 @@ +Index: libshout-2.2.2/src/vorbis.c +=================================================================== +--- libshout-2.2.2.orig/src/vorbis.c 2008-02-12 12:30:14.000000000 +0100 ++++ libshout-2.2.2/src/vorbis.c 2008-02-12 12:30:14.000000000 +0100 +@@ -27,7 +27,7 @@ + #include + #endif + +-#include ++#include + + #include "shout_private.h" + #include "shout_ogg.h" diff --git a/libs/libshout/patches/140-no_example_doc_win32.patch b/libs/libshout/patches/140-no_example_doc_win32.patch new file mode 100644 index 0000000..329a1b3 --- /dev/null +++ b/libs/libshout/patches/140-no_example_doc_win32.patch @@ -0,0 +1,21 @@ +Index: libshout-2.2.2/Makefile.in +=================================================================== +--- libshout-2.2.2.orig/Makefile.in 2008-02-12 12:30:14.000000000 +0100 ++++ libshout-2.2.2/Makefile.in 2008-02-12 12:30:15.000000000 +0100 +@@ -246,14 +246,14 @@ + target_alias = @target_alias@ + AUTOMAKE_OPTIONS = 1.6 foreign + ACLOCAL_AMFLAGS = -I m4 +-SUBDIRS = include src examples debian doc win32 ++SUBDIRS = include src debian + EXTRA_DIST = INSTALL m4/shout.m4 m4/ac_config_libconfig_in.m4 m4/acx_pthread.m4 \ + m4/ogg.m4 m4/vorbis.m4 m4/xiph_compiler.m4 m4/xiph_net.m4 \ + m4/xiph_types.m4 + + DISTCLEANFILES = shout-config.in + docdir = $(datadir)/doc/$(PACKAGE) +-doc_DATA = COPYING NEWS README examples/example.c examples/nonblocking.c ++doc_DATA = COPYING NEWS README + m4datadir = $(datadir)/aclocal + m4data_DATA = m4/shout.m4 + @HAVE_PKGCONFIG_TRUE@pkgconfigdir = $(libdir)/pkgconfig diff --git a/libs/libsigc++/Makefile b/libs/libsigc++/Makefile new file mode 100644 index 0000000..c8a87dd --- /dev/null +++ b/libs/libsigc++/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2006-2012 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:=libsigc++ +PKG_VERSION:=2.2.10 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@GNOME/libsigc++/2.2 +PKG_MD5SUM:=73419b477f3bb9ddb9905c88a92f4b4c + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libsigcxx + SECTION:=libs + CATEGORY:=Libraries + TITLE:=typesafe callback system for standard C++ + URL:=http://libsigc.sourceforge.net/ + DEPENDS:=+libstdcpp +endef + +define Package/libsigcxx/description + It allows you to define signals and to connect those signals to any + callback function, either global or a member function, regardless of + whether it is static or virtual. +endef + +TARGET_CFLAGS += $(FPIC) + +TARGET_CPPFLAGS += \ + -fno-strict-aliasing -fno-inline \ + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/sigc++-2.0 $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsigc-2.0.{a,so*} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/sigc++-2.0 $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sigc++-2.0.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libsigcxx/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsigc-2.0.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libsigcxx)) diff --git a/libs/libsigc++/patches/001-no_doc_tests_examples.patch b/libs/libsigc++/patches/001-no_doc_tests_examples.patch new file mode 100644 index 0000000..c69285f --- /dev/null +++ b/libs/libsigc++/patches/001-no_doc_tests_examples.patch @@ -0,0 +1,22 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -22,7 +22,7 @@ doc_subdirs = docs + else + doc_subdirs = + endif +-SUBDIRS = sigc++ tests examples $(doc_subdirs) ++SUBDIRS = sigc++ + + sigc_configdir = $(libdir)/$(SIGCXX_MODULE_NAME)/include + nodist_sigc_config_HEADERS = sigc++config.h +--- a/Makefile.in ++++ b/Makefile.in +@@ -116,7 +116,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGE + distdir dist dist-all distcheck + ETAGS = etags + CTAGS = ctags +-DIST_SUBDIRS = sigc++ tests examples docs ++DIST_SUBDIRS = sigc++ + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + distdir = $(PACKAGE)-$(VERSION) + top_distdir = $(distdir) diff --git a/libs/libsml/Makefile b/libs/libsml/Makefile new file mode 100644 index 0000000..32ff60f --- /dev/null +++ b/libs/libsml/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2012 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:=libsml +PKG_VERSION:=0.1 +PKG_RELEASE:=1 +PKG_REV:=4e546fb0db0bd4c0a2c3c2f3d29ac0a0ba6651a3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=git://github.com/dailab/libsml.git +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_PROTO:=git + +include $(INCLUDE_DIR)/package.mk + +define Package/libsml + SECTION:=libs + CATEGORY:=Libraries + URL:=https://github.com/dailab/libsml + TITLE:=Library which implements the Smart Messaging Language (SML) protocol + DEPENDS:=+libuuid +endef + +define Package/libsml/description + libSML is a library which implements the Smart Messaging Language (SML) protocol specified by + VDE's Forum Netztechnik/Netzbetrieb (FNN). It can be utilized to communicate to FNN specified + Smart Meters or Smart Meter components (EDL/MUC). +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/sml/include/sml $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/sml/lib/libsml.{so*,a} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_BUILD_DIR)/sml.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libsml/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/sml/lib/libsml.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libsml)) diff --git a/libs/libsml/patches/010-no-examples-tests.patch b/libs/libsml/patches/010-no-examples-tests.patch new file mode 100644 index 0000000..bf2220c --- /dev/null +++ b/libs/libsml/patches/010-no-examples-tests.patch @@ -0,0 +1,13 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,8 +1,8 @@ + + all: + @$(MAKE) -C sml +- @$(MAKE) -C examples +- @$(MAKE) -C test ++# @$(MAKE) -C examples ++# @$(MAKE) -C test + + .PHONY: clean + clean : diff --git a/libs/libsml/patches/020-ldflags.patch b/libs/libsml/patches/020-ldflags.patch new file mode 100644 index 0000000..d6fa2e4 --- /dev/null +++ b/libs/libsml/patches/020-ldflags.patch @@ -0,0 +1,11 @@ +--- a/sml/Makefile ++++ b/sml/Makefile +@@ -54,7 +54,7 @@ libsml: $(ST_LIB) $(OBJ_LIB) + endif + + $(DYN_LIB): $(OBJS) +- $(LD) $(LIBS) -shared -soname $(SONAME) -o $@ $^ ++ $(LD) $(LDFLAGS) $(LIBS) -shared -soname $(SONAME) -o $@ $^ + + $(OBJ_LIB): $(OBJS) + $(LD) -r -o $@ $^ diff --git a/libs/libsml/patches/030-cross-compile.patch b/libs/libsml/patches/030-cross-compile.patch new file mode 100644 index 0000000..c7dcc22 --- /dev/null +++ b/libs/libsml/patches/030-cross-compile.patch @@ -0,0 +1,8 @@ +--- a/sml/Makefile ++++ b/sml/Makefile +@@ -1,4 +1,4 @@ +-UNAME := $(shell uname) ++UNAME := Linux + CFLAGS += -I./include/ -fPIC -g -Wall + + # Available Flags: diff --git a/libs/libsndfile/Makefile b/libs/libsndfile/Makefile new file mode 100644 index 0000000..f824d16 --- /dev/null +++ b/libs/libsndfile/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libsndfile +PKG_VERSION:=1.0.25 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.mega-nerd.com/libsndfile/files/ +PKG_MD5SUM:=e2b7bb637e01022c7d20f95f9c3990a2 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libsndfile + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Library for reading/writing audio files + URL:=http://www.mega-nerd.com/libsndfile/ + DEPENDS:=@!avr32 +endef + +define Package/libsndfile/description + libsndfile is a library of C routines for reading and writing files + containing sampled audio data. +endef + +CONFIGURE_ARGS+= \ + --disable-alsa \ + --disable-external-libs \ + --disable-sqlite + +CONFIGURE_VARS += \ + ac_cv_sys_file_offset_bits=64 \ + ac_cv_sys_large_files=yes \ + ac_cv_sys_largefile_CFLAGS=-D_LARGFILE_SOURCE \ + ac_cv_sys_largefile_LDFLAGS= \ + ac_cv_sys_largefile_LIBS= \ + ac_cv_sys_largefile_source=yes + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1) + $(CP) $(PKG_INSTALL_DIR)/* $(1)/ +endef + +define Package/libsndfile/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsndfile.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libsndfile)) diff --git a/libs/libsndfile/patches/001-automake-compat.patch b/libs/libsndfile/patches/001-automake-compat.patch new file mode 100644 index 0000000..2df32ae --- /dev/null +++ b/libs/libsndfile/patches/001-automake-compat.patch @@ -0,0 +1,10 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,5 +1,7 @@ + ## Process this file with automake to produce Makefile.in + ++ACLOCAL_AMFLAGS = -I M4 ++ + DISTCHECK_CONFIGURE_FLAGS = --enable-gcc-werror + + if BUILD_OCTAVE_MOD diff --git a/libs/libsoup/Makefile b/libs/libsoup/Makefile new file mode 100644 index 0000000..775e920 --- /dev/null +++ b/libs/libsoup/Makefile @@ -0,0 +1,64 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=libsoup +PKG_VERSION:=2.28.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@GNOME/$(PKG_NAME)/2.28 +PKG_MD5SUM:=31d7ad416005eed4b78f07ac01b6b9f0 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +TARGET_LDFLAGS+=\ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +define Package/libsoup + SECTION:=libs + CATEGORY:=Libraries + TITLE:=libsoup + URL:=http://live.gnome.org/LibSoup + DEPENDS:=+glib2 +libxml2 +libgnutls +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-ssl \ + --disable-glibtest \ + --without-apache-httpd \ + --without-gnome \ + ) +endef + +define package/libsoup/decription +Libsoup is an HTTP library implementation in C +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/{lib/pkgconfig,include/libsoup-2.4/libsoup} + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libsoup-2.4.{so*,la,a} \ + $(1)/usr/lib/ + + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \ + $(1)/usr/lib/pkgconfig/ + + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/libsoup-2.4/libsoup/*.h \ + $(1)/usr/include/libsoup-2.4/libsoup/ +endef + +define Package/libsoup/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libsoup-2.4.so* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libsoup)) diff --git a/libs/libspe2/Makefile b/libs/libspe2/Makefile new file mode 100644 index 0000000..2fc4aa4 --- /dev/null +++ b/libs/libspe2/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2006-2008 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:=libspe2 +PKG_VERSION:=2.3.0 +PKG_MINOR_VERSION:=135 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).$(PKG_MINOR_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/libspe +PKG_MD5SUM:=c77dc69d3585d45f980e661232ae2b0b + +include $(INCLUDE_DIR)/package.mk + +define Package/libspe2 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=SPE Runtime Management Library for the Cell Broadband Engine + DEPENDS:=@TARGET_ps3||TARGET_ps3chk + URL:=http://sourceforge.net/projects/libspe/ +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" SYSROOT="" CROSS=$(TARGET_CROSS) all install +endef + +define Build/InstallDev + echo "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/libspe2* $(1)/usr/lib/ +endef + +define Package/libspe2/install + echo "Package/libspe2/install" + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspe2* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libspe2)) diff --git a/libs/libspe2/patches/001-remove_tls_requirement.patch b/libs/libspe2/patches/001-remove_tls_requirement.patch new file mode 100644 index 0000000..ae4d118 --- /dev/null +++ b/libs/libspe2/patches/001-remove_tls_requirement.patch @@ -0,0 +1,93 @@ +--- libspe2-2.3.0.old/spebase/run.c 2008-10-28 14:43:09.000000000 +0100 ++++ libspe2-2.3.0/spebase/run.c 2008-10-28 14:44:07.000000000 +0100 +@@ -37,6 +37,7 @@ + #include "spebase.h" + #include "regs.h" + ++#if 0 + /*Thread-local variable for use by the debugger*/ + __thread struct spe_context_info { + int spe_id; +@@ -44,13 +45,15 @@ + unsigned int status; + struct spe_context_info *prev; + }*__spe_current_active_context; ++#endif + +- ++#if 0 + static void cleanupspeinfo(struct spe_context_info *ctxinfo) + { + struct spe_context_info *tmp = ctxinfo->prev; + __spe_current_active_context = tmp; + } ++#endif + + static int issue_isolated_exit(struct spe_context *spe) + { +@@ -69,12 +72,14 @@ + return 0; + } + ++#if 0 + static inline void freespeinfo() + { + /*Clean up the debug variable*/ + struct spe_context_info *tmp = __spe_current_active_context->prev; + __spe_current_active_context = tmp; + } ++#endif + + int _base_spe_context_run(spe_context_ptr_t spe, unsigned int *entry, + unsigned int runflags, void *argp, void *envp, +@@ -83,7 +88,9 @@ + int retval = 0, run_rc; + unsigned int run_status, tmp_entry; + spe_stop_info_t stopinfo_buf; ++#if 0 + struct spe_context_info this_context_info __attribute__((cleanup(cleanupspeinfo))); ++#endif + + /* If the caller hasn't set a stopinfo buffer, provide a buffer on the + * stack instead. */ +@@ -146,6 +153,7 @@ + return -1; + } + ++#if 0 + /*Leave a trail of breadcrumbs for the debugger to follow */ + if (!__spe_current_active_context) { + __spe_current_active_context = &this_context_info; +@@ -162,18 +170,23 @@ + } + /*remember the ls-addr*/ + __spe_current_active_context->spe_id = spe->base_private->fd_spe_dir; ++#endif + + do_run: ++#if 0 + /*Remember the npc value*/ + __spe_current_active_context->npc = tmp_entry; ++#endif + + /* run SPE context */ + run_rc = spu_run(spe->base_private->fd_spe_dir, + &tmp_entry, &run_status); + ++#if 0 + /*Remember the npc value*/ + __spe_current_active_context->npc = tmp_entry; + __spe_current_active_context->status = run_status; ++#endif + + DEBUG_PRINTF("spu_run returned run_rc=0x%08x, entry=0x%04x, " + "ext_status=0x%04x.\n", run_rc, tmp_entry, run_status); +@@ -341,6 +354,8 @@ + + } + ++#if 0 + freespeinfo(); ++#endif + return retval; + } diff --git a/libs/libsrtp/Makefile b/libs/libsrtp/Makefile new file mode 100644 index 0000000..443d17f --- /dev/null +++ b/libs/libsrtp/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2011-2012 OpenWrt.org +# Copyright (C) 2011 Victor Seva +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=libsrtp +PKG_VERSION:=1.4.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=srtp-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/srtp +PKG_MD5SUM:=9b449edb011c934ca97009e7e0566d22 + +PKG_BUILD_DIR:=$(BUILD_DIR)/srtp +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(FPIC) +CONFIGURE_ARGS += --disable-stdout --enable-syslog + +define Package/libsrtp + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Secure Real-time Transport Protocol (SRTP) library + URL:=http://sourceforge.net/projects/srtp + MAINTAINER:=Victor Seva +endef + +define Package/libsrtp/description + Open-source implementation of the Secure Real-time Transport + Protocol (SRTP) originally authored by Cisco Systems, Inc. + It is available under a BSD-style license. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/srtp $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsrtp.{a,so*} $(1)/usr/lib/ +endef + + +define Package/libsrtp/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsrtp.so.* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libsrtp)) diff --git a/libs/libsrtp/patches/1003_fix_mips_namespace_collision.patch b/libs/libsrtp/patches/1003_fix_mips_namespace_collision.patch new file mode 100644 index 0000000..534ea4b --- /dev/null +++ b/libs/libsrtp/patches/1003_fix_mips_namespace_collision.patch @@ -0,0 +1,59 @@ +Description: Fix MIPS namespace collision +Author: Thiemo Seufer +Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=24;bug=439976 +Bug-Debian: http://bugs.debian.org/439976 +Last-Update: 2010-02-28 +--- a/test/srtp_driver.c ++++ b/test/srtp_driver.c +@@ -314,7 +314,7 @@ main (int argc, char *argv[]) { + if (do_codec_timing) { + srtp_policy_t policy; + int ignore; +- double mips = mips_estimate(1000000000, &ignore); ++ double mips_est = mips_estimate(1000000000, &ignore); + + crypto_policy_set_rtp_default(&policy.rtp); + crypto_policy_set_rtcp_default(&policy.rtcp); +@@ -323,33 +323,33 @@ main (int argc, char *argv[]) { + policy.key = test_key; + policy.next = NULL; + +- printf("mips estimate: %e\n", mips); ++ printf("mips estimate: %e\n", mips_est); + + printf("testing srtp processing time for voice codecs:\n"); + printf("codec\t\tlength (octets)\t\tsrtp instructions/second\n"); + printf("G.711\t\t%d\t\t\t%e\n", 80, +- (double) mips * (80 * 8) / ++ (double) mips_est * (80 * 8) / + srtp_bits_per_second(80, &policy) / .01 ); + printf("G.711\t\t%d\t\t\t%e\n", 160, +- (double) mips * (160 * 8) / ++ (double) mips_est * (160 * 8) / + srtp_bits_per_second(160, &policy) / .02); + printf("G.726-32\t%d\t\t\t%e\n", 40, +- (double) mips * (40 * 8) / ++ (double) mips_est * (40 * 8) / + srtp_bits_per_second(40, &policy) / .01 ); + printf("G.726-32\t%d\t\t\t%e\n", 80, +- (double) mips * (80 * 8) / ++ (double) mips_est * (80 * 8) / + srtp_bits_per_second(80, &policy) / .02); + printf("G.729\t\t%d\t\t\t%e\n", 10, +- (double) mips * (10 * 8) / ++ (double) mips_est * (10 * 8) / + srtp_bits_per_second(10, &policy) / .01 ); + printf("G.729\t\t%d\t\t\t%e\n", 20, +- (double) mips * (20 * 8) / ++ (double) mips_est * (20 * 8) / + srtp_bits_per_second(20, &policy) / .02 ); + printf("Wideband\t%d\t\t\t%e\n", 320, +- (double) mips * (320 * 8) / ++ (double) mips_est * (320 * 8) / + srtp_bits_per_second(320, &policy) / .01 ); + printf("Wideband\t%d\t\t\t%e\n", 640, +- (double) mips * (640 * 8) / ++ (double) mips_est * (640 * 8) / + srtp_bits_per_second(640, &policy) / .02 ); + } + diff --git a/libs/libsrtp/patches/1005_fix_data_alignment.patch b/libs/libsrtp/patches/1005_fix_data_alignment.patch new file mode 100644 index 0000000..4cb8889 --- /dev/null +++ b/libs/libsrtp/patches/1005_fix_data_alignment.patch @@ -0,0 +1,33 @@ +Description: Fix data alignment +Author: "Martin Guy" +Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;bug=470505 +Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1912057&group_id=38894&atid=423799 +Bug-Debian: http://bugs.debian.org/470505 +Last-Update: 2011-05-30 +--- a/test/srtp_driver.c ++++ b/test/srtp_driver.c +@@ -1129,7 +1129,6 @@ mips_estimate(int num_trials, int *ignor + * These packets were made with the default SRTP policy. + */ + +- + err_status_t + srtp_validate() { + unsigned char test_key[30] = { +@@ -1144,14 +1143,14 @@ srtp_validate() { + 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, + 0xab, 0xab, 0xab, 0xab + }; +- uint8_t srtp_plaintext[38] = { ++ uint8_t srtp_plaintext[38] __attribute__((aligned(4))) = { + 0x80, 0x0f, 0x12, 0x34, 0xde, 0xca, 0xfb, 0xad, + 0xca, 0xfe, 0xba, 0xbe, 0xab, 0xab, 0xab, 0xab, + 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, + 0xab, 0xab, 0xab, 0xab, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; +- uint8_t srtp_ciphertext[38] = { ++ uint8_t srtp_ciphertext[38] __attribute__((aligned(4))) = { + 0x80, 0x0f, 0x12, 0x34, 0xde, 0xca, 0xfb, 0xad, + 0xca, 0xfe, 0xba, 0xbe, 0x4e, 0x55, 0xdc, 0x4c, + 0xe7, 0x99, 0x78, 0xd8, 0x8c, 0xa4, 0xd2, 0x15, diff --git a/libs/libsrtp/patches/1007_update_Doxyfile.patch b/libs/libsrtp/patches/1007_update_Doxyfile.patch new file mode 100644 index 0000000..8108d7d --- /dev/null +++ b/libs/libsrtp/patches/1007_update_Doxyfile.patch @@ -0,0 +1,94 @@ +Description: Update Doxyfile and header template +Author: Jonas Smedegaard +Last-Update: 2010-02-28 +--- a/doc/Makefile.in ++++ b/doc/Makefile.in +@@ -25,6 +25,7 @@ libsrtpdoc: + echo "*** Sorry, can't build doc outside source dir"; exit 1; \ + fi + sed 's/LIBSRTPVERSION/$(version)/' header.template > header.tex ++ doxygen -u + doxygen + sed 's/\subsection/\section/' latex/index.tex > latex/index.tmp + mv latex/index.tmp latex/index.tex +@@ -38,7 +39,7 @@ cryptodoc: clean + cp latex/refman.pdf crypto.pdf + + clean: +- rm -rf latex/ header.tex ++ rm -rf latex/ header.tex Doxyfile.bak + for a in * ; do \ + if [ -f "$$a~" ] ; then rm -f $$a~; fi; \ + done; +--- a/doc/header.template ++++ b/doc/header.template +@@ -6,28 +6,40 @@ + % + \documentclass[letterpaper]{book} + \usepackage{makeidx} +-\usepackage{fancyhdr} + \usepackage{graphicx} + \usepackage{multicol} + \usepackage{float} ++\usepackage{listings} ++\usepackage{color} ++\usepackage{ifthen} ++\usepackage[table]{xcolor} + \usepackage{textcomp} + \usepackage{alltt} +-\usepackage{times} +-\usepackage{graphicx} +-\ifx\pdfoutput\undefined +-\usepackage[ps2pdf, ++\usepackage{ifpdf} ++\ifpdf ++\usepackage[pdftex, + pagebackref=true, + colorlinks=true, +- linkcolor=blue ++ linkcolor=blue, ++ unicode + ]{hyperref} + \else +-\usepackage[pdftex, ++\usepackage[ps2pdf, + pagebackref=true, + colorlinks=true, +- linkcolor=blue ++ linkcolor=blue, ++ unicode + ]{hyperref} ++\usepackage{pspicture} + \fi ++\usepackage[utf8]{inputenc} ++\usepackage{mathptmx} ++\usepackage[scaled=.90]{helvet} ++\usepackage{courier} ++\usepackage{sectsty} ++\usepackage[titles]{tocloft} + \usepackage{doxygen} ++\lstset{language=C++,inputencoding=utf8,basicstyle=\footnotesize,breaklines=true,breakatwhitespace=true,tabsize=3,numbers=left } + \makeindex + \setcounter{tocdepth}{1} + \renewcommand{\footrulewidth}{0.4pt} +@@ -59,7 +71,9 @@ + \selectfont + + ++\renewcommand{\familydefault}{\sfdefault} + \begin{document} ++\hypersetup{pageanchor=false} + \begin{titlepage} + \vspace*{4cm} + %\begin{center} +@@ -107,9 +121,6 @@ This reference material in this documena + \clearemptydoublepage + \pagenumbering{roman} + \tableofcontents +-%\clearemptydoublepage +- + \clearemptydoublepage + \pagenumbering{arabic} +- +- ++\hypersetup{pageanchor=true} diff --git a/libs/libsrtp/patches/1008_shared-lib.patch b/libs/libsrtp/patches/1008_shared-lib.patch new file mode 100644 index 0000000..96a13ca --- /dev/null +++ b/libs/libsrtp/patches/1008_shared-lib.patch @@ -0,0 +1,55 @@ +Description: Hack build routines to compile shared library +Author: loki_val and solar +Origin: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-libs/libsrtp/files/libsrtp-1.4.4-shared.patch +Last-Update: 2010-03-19 +--- a/Makefile.in ++++ b/Makefile.in +@@ -15,7 +15,7 @@ + + .PHONY: all test build_table_apps + +-all: test ++all: libsrtp.so test + + runtest: build_table_apps test + @echo "running libsrtp test applications..." +@@ -67,7 +67,7 @@ libdir = @libdir@ + # implicit rules for object files and test apps + + %.o: %.c +- $(COMPILE) -c $< -o $@ ++ $(COMPILE) -fPIC -c $< -o $@ + + %$(EXE): %.c + $(COMPILE) $(LDFLAGS) $< -o $@ $(SRTPLIB) $(LIBS) +@@ -105,6 +105,9 @@ libsrtp.a: $(srtpobj) $(cryptobj) $(gdoi + ar cr libsrtp.a $^ + $(RANLIB) libsrtp.a + ++libsrtp.so: $(srtpobj) $(cryptobj) $(gdoi) ++ $(CC) $(LDFLAGS) -shared -Wl,-soname,libsrtp.so.0 -o libsrtp.so.0.0 $^ ++ + # libcryptomath.a contains general-purpose routines that are used to + # generate tables and verify cryptoalgorithm implementations - this + # library is not meant to be included in production code +@@ -197,6 +200,11 @@ install: + cp include/*.h $(DESTDIR)$(includedir)/srtp + cp crypto/include/*.h $(DESTDIR)$(includedir)/srtp + if [ -f libsrtp.a ]; then cp libsrtp.a $(DESTDIR)$(libdir)/; fi ++ if [ -f libsrtp.so.0.0 ]; then \ ++ cp libsrtp.so.0.0 $(DESTDIR)$(libdir)/; \ ++ ln -s libsrtp.so.0.0 $(DESTDIR)$(libdir)/libsrtp.so.0; \ ++ ln -s libsrtp.so.0.0 $(DESTDIR)$(libdir)/libsrtp.so; \ ++ fi + + uninstall: + rm -rf $(DESTDIR)$(includedir)/srtp +@@ -204,7 +212,7 @@ uninstall: + + clean: + rm -rf $(cryptobj) $(srtpobj) $(cryptomath) TAGS \ +- libcryptomath.a libsrtp.a core *.core test/core ++ libcryptomath.a libsrtp.a libsrtp.so.0.0 core *.core test/core + for a in * */* */*/*; do \ + if [ -f "$$a~" ] ; then rm -f $$a~; fi; \ + done; diff --git a/libs/libssh2/Makefile b/libs/libssh2/Makefile new file mode 100644 index 0000000..01f538f --- /dev/null +++ b/libs/libssh2/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2012 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:=libssh2 +PKG_VERSION:=1.4.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.libssh2.org/download +PKG_MD5SUM:=42e2b3796ac07fc1dbafc7abcc002cd3 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libssh2 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=SSH2 library + URL:=http://www.libssh2.org/ + DEPENDS:=+libopenssl +zlib +endef + +define Package/libssh2/description + libssh2 is a client-side C library implementing the SSH2 protocol +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --disable-examples-build \ + --with-libssl-prefix=$(STAGING_DIR)/usr + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libssh2.so* $(1)/usr/lib/ +endef + +define Package/libssh2/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libssh2.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libssh2)) diff --git a/libs/libsynce/Makefile b/libs/libsynce/Makefile new file mode 100644 index 0000000..48d5a12 --- /dev/null +++ b/libs/libsynce/Makefile @@ -0,0 +1,65 @@ +# +# Copyright (C) 2008 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:=libsynce +PKG_VERSION:=0.12 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/synce +PKG_MD5SUM:=fd473d3deceda7912af4427dede1736f + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + +define Package/libsynce + DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS) + SECTION:=libs + CATEGORY:=Libraries + TITLE:=SynCE library + URL:=http://synce.sourceforge.net/ +endef + +define Package/libsynce/description +The purpose of the SynCE project is to provide a means of communication with a +Windows CE or Pocket PC device from a computer running Linux, *BSD or other unices. +endef + +MAKE_FLAGS += \ + OPTIM="$(TARGET_CFLAGS)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" + +CONFIGURE_ARGS += \ + --enable-hal-support=no \ + --enable-odccm-support=no + +CONFIGURE_VARS+= \ + CPPFLAGS="$$$$CPPFLAGS -I$(ICONV_PREFIX)/include" \ + CPPFLAGS="$$$$CPPFLAGS -I$(INTL_PREFIX)/include" \ + LDFLAGS="$$$$LDFLAGS -L$(ICONV_PREFIX)/lib" \ + LDFLAGS="$$$$LDFLAGS -L$(INTL_PREFIX)/lib" \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsynce.so* $(1)/usr/lib/ +endef + +define Package/libsynce/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsynce.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libsynce)) diff --git a/libs/libtasn1/Makefile b/libs/libtasn1/Makefile new file mode 100644 index 0000000..548f6ff --- /dev/null +++ b/libs/libtasn1/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2005-2008 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:=libtasn1 +PKG_VERSION:=1.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.gnutls.org/pub/gnutls/libtasn1/ \ + ftp://ftp.gnupg.org/gcrypt/alpha/gnutls/libtasn1/ \ + http://www.mirrors.wiretapped.net/security/network-security/gnutls/libtasn1/ \ + ftp://ftp.mirrors.wiretapped.net/pub/security/network-security/gnutls/libtasn1/ \ + http://josefsson.org/gnutls/releases/libtasn1/ +PKG_MD5SUM:=a733ecdfed3517910e627d24e050979f + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libtasn1 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=An ASN.1 and DER structures manipulation library + URL:=ftp://ftp.gnutls.org/pub/gnutls/libtasn1/ +endef + +define Package/libtasn1/description + This is a library for Abstract Syntax Notation One (ASN.1) and + Distinguish Encoding Rules (DER) manipulation. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libtasn1-config $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libtasn1.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtasn1.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libtasn1*.pc $(1)/usr/lib/pkgconfig/ + $(SED) 's,-I$$$${prefix}/include,,g' $(1)/usr/bin/libtasn1-config + $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(1)/usr/bin/libtasn1-config +endef + +define Package/libtasn1/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtasn1.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libtasn1)) diff --git a/libs/libtheora/Makefile b/libs/libtheora/Makefile new file mode 100644 index 0000000..3fefbcb --- /dev/null +++ b/libs/libtheora/Makefile @@ -0,0 +1,64 @@ +# +# Copyright (C) 2008 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:=libtheora +PKG_VERSION:=1.0 +PKG_RELEASE:=3 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://downloads.xiph.org/releases/theora/ +PKG_MD5SUM:=c963937053f45a7878954bed37ceb182 +PKG_FIXUP:=autoreconf + +PKG_BUILD_DEPENDS:=libvorbis + +include $(INCLUDE_DIR)/package.mk + +PKG_INSTALL=1 + +define Package/libtheora + SECTION:=libs + CATEGORY:=Libraries + TITLE:=libtheora + URL:=http://xiph.org/theora/ + DEPENDS:=+libogg +endef + +define Package/libtheora/description +Theora is Xiph.Org's first publicly released video codec, intended +for use within the Foundation's Ogg multimedia streaming system. +Theora is derived directly from On2's VP3 codec; Currently the +encoders are nearly identical, but Theora will make use of new +features supported by the decoder to improve over what is +is possible with VP3. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-examples \ + --disable-oggtest \ + --disable-vorbistest \ + --disable-sdltest \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/theora/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/theora/* $(1)/usr/include/theora/ + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/ +endef + +define Package/libtheora/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libtheora)) diff --git a/libs/libtheora/patches/001-no_docs_tests.patch b/libs/libtheora/patches/001-no_docs_tests.patch new file mode 100644 index 0000000..0de12cf --- /dev/null +++ b/libs/libtheora/patches/001-no_docs_tests.patch @@ -0,0 +1,45 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -8,7 +8,7 @@ else + EXAMPLES_DIR = + endif + +-SUBDIRS = lib include doc tests m4 $(EXAMPLES_DIR) ++SUBDIRS = lib include m4 $(EXAMPLES_DIR) + + + # we include the whole debian/ dir in EXTRA_DIST because there's a problem +--- a/Makefile.in ++++ b/Makefile.in +@@ -80,7 +80,7 @@ pkgconfigDATA_INSTALL = $(INSTALL_DATA) + DATA = $(pkgconfig_DATA) + ETAGS = etags + CTAGS = ctags +-DIST_SUBDIRS = lib include doc tests m4 examples ++DIST_SUBDIRS = lib include m4 + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + distdir = $(PACKAGE)-$(VERSION) + top_distdir = $(distdir) +@@ -262,7 +262,7 @@ target_vendor = @target_vendor@ + AUTOMAKE_OPTIONS = foreign 1.6 dist-zip dist-bzip2 + @THEORA_ENABLE_EXAMPLES_FALSE@EXAMPLES_DIR = + @THEORA_ENABLE_EXAMPLES_TRUE@EXAMPLES_DIR = examples +-SUBDIRS = lib include doc tests m4 $(EXAMPLES_DIR) ++SUBDIRS = lib include m4 $(EXAMPLES_DIR) + + # we include the whole debian/ dir in EXTRA_DIST because there's a problem + # with autotools and HFS+ MacOSX file systems that caused debian/Makefile.am +--- a/configure.ac ++++ b/configure.ac +@@ -310,11 +310,6 @@ fi + dnl check for SDL + HAVE_SDL=no + +-AM_PATH_SDL(,[ +- HAVE_SDL=yes +- SDL_LIBS=`$SDL_CONFIG --libs` +-],AC_MSG_WARN([*** Unable to find SDL -- Not compiling example players ***])) +- + dnl check for OSS + HAVE_OSS=no + diff --git a/libs/libtorrent/Makefile b/libs/libtorrent/Makefile new file mode 100644 index 0000000..42c0ee1 --- /dev/null +++ b/libs/libtorrent/Makefile @@ -0,0 +1,70 @@ +# +# Copyright (C) 2007-2011 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:=libtorrent +PKG_VERSION:=0.12.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://libtorrent.rakshasa.no/downloads +PKG_MD5SUM:=037499ed708aaf72988cee60e5a8d96b + +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libtorrent + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Rakshasa's BitTorrent library + URL:=http://libtorrent.rakshasa.no/ + DEPENDS:=+libopenssl +libsigcxx + MAINTAINER:=Luka Perkov +endef + +define Package/libtorrent/description + LibTorrent is a BitTorrent library written in C++ for *nix, with a focus on + high performance and good code. The library differentiates itself from other + implementations by transfering directly from file pages to the network stack. + On high-bandwidth connections it is able to seed at 3 times the speed of the + official client. +endef + +TARGET_CPPFLAGS += -fno-strict-aliasing -fno-inline +TARGET_LDFLAGS += $(LIBGCC_S) + +CONFIGURE_ARGS+= \ + --enable-shared \ + --enable-static \ + --enable-aligned \ + --disable-debug \ + --enable-openssl \ + +define Build/Configure + ( cd $(PKG_BUILD_DIR); ./autogen.sh ); + $(call Build/Configure/Default) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/torrent $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtorrent.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libtorrent.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libtorrent/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtorrent.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libtorrent)) diff --git a/libs/libtorrent/patches/000-upstream-gcc46-fixes.patch b/libs/libtorrent/patches/000-upstream-gcc46-fixes.patch new file mode 100644 index 0000000..d8bea4f --- /dev/null +++ b/libs/libtorrent/patches/000-upstream-gcc46-fixes.patch @@ -0,0 +1,31 @@ +--- a/src/data/memory_chunk.cc ++++ b/src/data/memory_chunk.cc +@@ -71,7 +71,7 @@ MemoryChunk::MemoryChunk(char* ptr, char + if (page_align() >= m_pagesize) + throw internal_error("MemoryChunk::MemoryChunk(...) received an page alignment >= page size"); + +- if ((ptrdiff_t)ptr % m_pagesize) ++ if ((std::ptrdiff_t)ptr % m_pagesize) + throw internal_error("MemoryChunk::MemoryChunk(...) is not aligned to a page"); + } + +--- a/src/torrent/data/block.h ++++ b/src/torrent/data/block.h +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + + namespace torrent { + +--- a/src/torrent/data/block_transfer.h ++++ b/src/torrent/data/block_transfer.h +@@ -39,6 +39,7 @@ + + #include + #include ++#include + + namespace torrent { + diff --git a/libs/libtorrent/patches/100-fix_cross_compile.patch b/libs/libtorrent/patches/100-fix_cross_compile.patch new file mode 100644 index 0000000..7030718 --- /dev/null +++ b/libs/libtorrent/patches/100-fix_cross_compile.patch @@ -0,0 +1,31 @@ +--- a/scripts/checks.m4 ++++ b/scripts/checks.m4 +@@ -96,7 +96,7 @@ AC_DEFUN([TORRENT_CHECK_KQUEUE], [ + AC_DEFUN([TORRENT_CHECK_KQUEUE_SOCKET_ONLY], [ + AC_MSG_CHECKING(whether kqueue supports pipes and ptys) + +- AC_RUN_IFELSE( ++ AC_LINK_IFELSE( + [[#include + #include + #include +--- a/scripts/common.m4 ++++ b/scripts/common.m4 +@@ -184,7 +184,7 @@ AC_DEFUN([TORRENT_CHECK_MADVISE], [ + AC_DEFUN([TORRENT_CHECK_EXECINFO], [ + AC_MSG_CHECKING(for execinfo.h) + +- AC_RUN_IFELSE( ++ AC_LINK_IFELSE( + [[#include + int main() { backtrace((void**)0, 0); backtrace_symbols((char**)0, 0); return 0;} + ]], +@@ -199,7 +199,7 @@ AC_DEFUN([TORRENT_CHECK_EXECINFO], [ + AC_DEFUN([TORRENT_CHECK_ALIGNED], [ + AC_MSG_CHECKING(the byte alignment) + +- AC_RUN_IFELSE( ++ AC_LINK_IFELSE( + [[#include + int main() { + char buf[8] = { 0, 0, 0, 0, 1, 0, 0, 0 }; diff --git a/libs/libtorrent/patches/120-fix-ipv6_socket_datagram.patch b/libs/libtorrent/patches/120-fix-ipv6_socket_datagram.patch new file mode 100644 index 0000000..1a46627 --- /dev/null +++ b/libs/libtorrent/patches/120-fix-ipv6_socket_datagram.patch @@ -0,0 +1,26 @@ +--- a/src/net/socket_datagram.cc ++++ b/src/net/socket_datagram.cc +@@ -73,6 +73,23 @@ SocketDatagram::write_datagram(const voi + int r; + + if (sa != NULL) { ++#ifdef RAK_USE_INET6 ++ if (m_ipv6_socket && sa->family() == rak::socket_address::pf_inet) { ++ uint32_t addr32[4]; ++ sockaddr_in6 mapped_addr; ++ memset(&mapped_addr, 0, sizeof(mapped_addr)); ++ mapped_addr.sin6_family = AF_INET6; ++ addr32[0] = 0; ++ addr32[1] = 0; ++ addr32[2] = htonl(0xffff); ++ addr32[3] = sa->sa_inet()->address_n(); ++ memcpy(mapped_addr.sin6_addr.s6_addr, addr32, sizeof(uint32_t) * 4); ++ mapped_addr.sin6_port = sa->sa_inet()->port_n(); ++ r = ::sendto(m_fileDesc, buffer, length, 0, (sockaddr*)&mapped_addr, sizeof(mapped_addr)); ++ } else if (m_ipv6_socket && sa->family() == rak::socket_address::pf_inet6) { ++ r = ::sendto(m_fileDesc, buffer, length, 0, sa->sa_inet6()->c_sockaddr(), sizeof(rak::socket_address_inet6)); ++ } else ++#endif + r = ::sendto(m_fileDesc, buffer, length, 0, sa->sa_inet()->c_sockaddr(), sizeof(rak::socket_address_inet)); + } else { + r = ::send(m_fileDesc, buffer, length, 0); diff --git a/libs/libtwin/Makefile b/libs/libtwin/Makefile new file mode 100644 index 0000000..9e6d1c9 --- /dev/null +++ b/libs/libtwin/Makefile @@ -0,0 +1,69 @@ +# +# 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:=libtwin +PKG_VERSION:=0.0.3 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://ozlabs.org/~jk/projects/petitboot/downloads/ +PKG_MD5SUM:=ebd7c5cca3c9e108208a7bf17b256a6c +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +PKG_INSTALL=1 + +define Package/libtwin + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+zlib +libpng +libjpeg +libfreetype + TITLE:=The tiny windowing system library + URL:=http://ozlabs.org/~jk/projects/petitboot/ + MAINTAINER:=Geoff Levand +endef + +define Package/libtwin/description + Keith Packard's Tiny Windowing System Library +endef + +CONFIGURE_ARGS += --enable-shared --enable-static --disable-x11 + +ifdef CONFIG_powerpc + EXTRA_CFLAGS += -flax-vector-conversions +endif + +TARGET_LDFLAGS += \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/libtwin + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/libtwin/*.h \ + $(1)/usr/include/libtwin + + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/lib/libtwin.{la,a,so*} \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libtwin.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/libtwin/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/lib/libtwin.so* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libtwin)) diff --git a/libs/libtwin/patches/100-compile_fix.patch b/libs/libtwin/patches/100-compile_fix.patch new file mode 100644 index 0000000..dd9f9f8 --- /dev/null +++ b/libs/libtwin/patches/100-compile_fix.patch @@ -0,0 +1,11 @@ +--- a/libtwin/twin_feature.c ++++ b/libtwin/twin_feature.c +@@ -55,7 +55,7 @@ + } + + #else +-#define _twin_have_altivec() ++#define _twin_have_altivec() 0 + #endif /* HAVE_ALTIVEC */ + + int twin_has_feature(unsigned int feature) diff --git a/libs/libupnp/Makefile b/libs/libupnp/Makefile new file mode 100644 index 0000000..ac56258 --- /dev/null +++ b/libs/libupnp/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2006-2011 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:=libupnp +PKG_VERSION:=1.6.14 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/pupnp +PKG_MD5SUM:=a0497cf15b3e15f7e7ede88b3d04861b + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libupnp/Default + SECTION:=libs + CATEGORY:=Libraries + URL:=http://pupnp.sourceforge.net/ +endef + +define Package/libupnp + $(call Package/libupnp/Default) + DEPENDS:=+libpthread + TITLE:=UPnP SDK library + MENU:=1 +endef + +define Package/libupnp/description +The portable SDK for UPnP Devices (libupnp) provides developers with an API and +open source code for building control points, devices, and bridges that are +compliant with Version 1.0 of the Universal Plug and Play Device Architecture +Specification. +endef + +define Package/libupnp-sample + $(call Package/libupnp/Default) + DEPENDS:=libupnp + TITLE:=UPnP sample applications +endef + +define Package/libupnp-sample/description +TVcontrolpoint & tvdevice sample applications run inside /etc/upnp-tvdevice/ +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/upnp $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ixml,threadutil,upnp}.{a,so*,la} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libupnp.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libupnp/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ixml,threadutil,upnp}.so.* $(1)/usr/lib/ +endef + +define Package/libupnp-sample/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/upnp/sample/.libs/* $(1)/usr/bin + $(INSTALL_DIR) $(1)/etc/upnp-tvdevice/web + $(INSTALL_DATA) $(PKG_BUILD_DIR)/upnp/sample/web/* $(1)/etc/upnp-tvdevice +endef + +$(eval $(call BuildPackage,libupnp)) +$(eval $(call BuildPackage,libupnp-sample)) diff --git a/libs/libusb-1.0/Makefile b/libs/libusb-1.0/Makefile new file mode 100644 index 0000000..9458738 --- /dev/null +++ b/libs/libusb-1.0/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2010-2012 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:=libusb-1.0 +PKG_VERSION:=1.0.9 +PKG_RELEASE:=1 + +PKG_SOURCE:=libusb-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/libusb +PKG_MD5SUM:=7f5a02375ad960d4e33a6dae7d63cfcb + +PKG_BUILD_DIR:=$(BUILD_DIR)/libusb-$(PKG_VERSION) +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libusb-1.0 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=A library for accessing Linux USB devices (non-legacy) + DEPENDS:=+libpthread +librt + URL:=http://libusb.wiki.sourceforge.net/ +endef + +define Package/libusb-1.0/description + libusb is a C library that gives applications easy access to USB devices on + many different operating systems. +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/libusb-1.0 + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/libusb-1.0/libusb.h \ + $(1)/usr/include/libusb-1.0/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb*.{a,la,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libusb*.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/libusb-1.0/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb*.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libusb-1.0)) diff --git a/libs/libusb-1.0/patches/001-timerfd.patch b/libs/libusb-1.0/patches/001-timerfd.patch new file mode 100644 index 0000000..de48a7f --- /dev/null +++ b/libs/libusb-1.0/patches/001-timerfd.patch @@ -0,0 +1,33 @@ +commit cadb77d99e314e42c3eb02d016e9d90136ec6959 +Author: Alexander Gordeev +Date: Thu Jan 27 06:39:16 2011 +0300 + + fix timerfd initialization + + sys/timerfd.h defines TFD_NONBLOCK as 0x800 but in kernel TFD_NONBLOCK + is an alias for O_NONBLOCK which is defined in arch-specific fcntl.h. + While it's still 0x800 for most of archs but for mips it's 0x80. So + timerfd_create(..., TFD_NONBLOCK) returns -EINVAL because of that. Fix + this by using O_NONBLOCK instead. + + Signed-off-by: Alexander Gordeev + +--- a/libusb/io.c ++++ b/libusb/io.c +@@ -20,6 +20,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -1072,7 +1073,7 @@ int usbi_io_init(struct libusb_context * + + #ifdef USBI_TIMERFD_AVAILABLE + ctx->timerfd = timerfd_create(usbi_backend->get_timerfd_clockid(), +- TFD_NONBLOCK); ++ O_NONBLOCK); + if (ctx->timerfd >= 0) { + usbi_dbg("using timerfd for timeouts"); + r = usbi_add_pollfd(ctx, ctx->timerfd, POLLIN); diff --git a/libs/libusb/Makefile b/libs/libusb/Makefile new file mode 100644 index 0000000..c4a01b3 --- /dev/null +++ b/libs/libusb/Makefile @@ -0,0 +1,90 @@ +# +# Copyright (C) 2006-2008 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:=libusb +PKG_VERSION:=0.1.12 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/libusb +PKG_MD5SUM:=caf182cbc7565dac0fd72155919672e6 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +PKG_INSTALL=1 + +define Package/libusb + SECTION:=libs + CATEGORY:=Libraries + TITLE:=A library for accessing Linux USB devices + URL:=http://libusb.sourceforge.net/ +endef + +define Package/libusbpp + SECTION:=libs + CATEGORY:=Libraries + TITLE:=A C++ library for accessing Linux USB devices + URL:=http://libusb.sourceforge.net/ + DEPENDS:=$(CXX_DEPENDS) +libusb +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + ) +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(2)/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/libusb-config \ + $(2)/bin/ + $(SED) \ + 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ + $(2)/bin/libusb-config + + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/usb.h \ + $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libusb*.{la,so*,a} \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libusb.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/libusb/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libusb.so* \ + $(PKG_INSTALL_DIR)/usr/lib/libusb-*.so* \ + $(1)/usr/lib/ +endef + +define Package/libusbpp/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libusbpp.so* \ + $(PKG_INSTALL_DIR)/usr/lib/libusbpp-*.so* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libusb)) +$(eval $(call BuildPackage,libusbpp)) diff --git a/libs/libusb/patches/000-debian_packed.patch b/libs/libusb/patches/000-debian_packed.patch new file mode 100644 index 0000000..169de31 --- /dev/null +++ b/libs/libusb/patches/000-debian_packed.patch @@ -0,0 +1,52 @@ + +--- + usb.h.in | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/usb.h.in ++++ b/usb.h.in +@@ -66,14 +66,14 @@ + struct usb_descriptor_header { + u_int8_t bLength; + u_int8_t bDescriptorType; +-}; ++} __attribute__ ((packed)); + + /* String descriptor */ + struct usb_string_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + u_int16_t wData[1]; +-}; ++} __attribute__ ((packed)); + + /* HID descriptor */ + struct usb_hid_descriptor { +@@ -85,7 +85,7 @@ + /* u_int8_t bReportDescriptorType; */ + /* u_int16_t wDescriptorLength; */ + /* ... */ +-}; ++} __attribute__ ((packed)); + + /* Endpoint descriptor */ + #define USB_MAXENDPOINTS 32 +@@ -172,7 +172,7 @@ + u_int8_t iProduct; + u_int8_t iSerialNumber; + u_int8_t bNumConfigurations; +-}; ++} __attribute__ ((packed)); + + struct usb_ctrl_setup { + u_int8_t bRequestType; +@@ -180,7 +180,7 @@ + u_int16_t wValue; + u_int16_t wIndex; + u_int16_t wLength; +-}; ++} __attribute__ ((packed)); + + /* + * Standard requests + diff --git a/libs/libusb/patches/001-debian_ansi_types.patch b/libs/libusb/patches/001-debian_ansi_types.patch new file mode 100644 index 0000000..629ad9a --- /dev/null +++ b/libs/libusb/patches/001-debian_ansi_types.patch @@ -0,0 +1,194 @@ + +--- + usb.h.in | 118 ++++++++++++++++++++++++++++++++------------------------------- + 1 file changed, 60 insertions(+), 58 deletions(-) + +--- a/usb.h.in ++++ b/usb.h.in +@@ -13,8 +13,10 @@ + + #include + #include ++#include + #include + ++#include + #include + + /* +@@ -64,40 +66,40 @@ + + /* All standard descriptors have these 2 fields in common */ + struct usb_descriptor_header { +- u_int8_t bLength; +- u_int8_t bDescriptorType; ++ uint8_t bLength; ++ uint8_t bDescriptorType; + } __attribute__ ((packed)); + + /* String descriptor */ + struct usb_string_descriptor { +- u_int8_t bLength; +- u_int8_t bDescriptorType; +- u_int16_t wData[1]; ++ uint8_t bLength; ++ uint8_t bDescriptorType; ++ uint16_t wData[1]; + } __attribute__ ((packed)); + + /* HID descriptor */ + struct usb_hid_descriptor { +- u_int8_t bLength; +- u_int8_t bDescriptorType; +- u_int16_t bcdHID; +- u_int8_t bCountryCode; +- u_int8_t bNumDescriptors; +- /* u_int8_t bReportDescriptorType; */ +- /* u_int16_t wDescriptorLength; */ ++ uint8_t bLength; ++ uint8_t bDescriptorType; ++ uint16_t bcdHID; ++ uint8_t bCountryCode; ++ uint8_t bNumDescriptors; ++ /* uint8_t bReportDescriptorType; */ ++ /* uint16_t wDescriptorLength; */ + /* ... */ + } __attribute__ ((packed)); + + /* Endpoint descriptor */ + #define USB_MAXENDPOINTS 32 + struct usb_endpoint_descriptor { +- u_int8_t bLength; +- u_int8_t bDescriptorType; +- u_int8_t bEndpointAddress; +- u_int8_t bmAttributes; +- u_int16_t wMaxPacketSize; +- u_int8_t bInterval; +- u_int8_t bRefresh; +- u_int8_t bSynchAddress; ++ uint8_t bLength; ++ uint8_t bDescriptorType; ++ uint8_t bEndpointAddress; ++ uint8_t bmAttributes; ++ uint16_t wMaxPacketSize; ++ uint8_t bInterval; ++ uint8_t bRefresh; ++ uint8_t bSynchAddress; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +@@ -115,15 +117,15 @@ + /* Interface descriptor */ + #define USB_MAXINTERFACES 32 + struct usb_interface_descriptor { +- u_int8_t bLength; +- u_int8_t bDescriptorType; +- u_int8_t bInterfaceNumber; +- u_int8_t bAlternateSetting; +- u_int8_t bNumEndpoints; +- u_int8_t bInterfaceClass; +- u_int8_t bInterfaceSubClass; +- u_int8_t bInterfaceProtocol; +- u_int8_t iInterface; ++ uint8_t bLength; ++ uint8_t bDescriptorType; ++ uint8_t bInterfaceNumber; ++ uint8_t bAlternateSetting; ++ uint8_t bNumEndpoints; ++ uint8_t bInterfaceClass; ++ uint8_t bInterfaceSubClass; ++ uint8_t bInterfaceProtocol; ++ uint8_t iInterface; + + struct usb_endpoint_descriptor *endpoint; + +@@ -141,14 +143,14 @@ + /* Configuration descriptor information.. */ + #define USB_MAXCONFIG 8 + struct usb_config_descriptor { +- u_int8_t bLength; +- u_int8_t bDescriptorType; +- u_int16_t wTotalLength; +- u_int8_t bNumInterfaces; +- u_int8_t bConfigurationValue; +- u_int8_t iConfiguration; +- u_int8_t bmAttributes; +- u_int8_t MaxPower; ++ uint8_t bLength; ++ uint8_t bDescriptorType; ++ uint16_t wTotalLength; ++ uint8_t bNumInterfaces; ++ uint8_t bConfigurationValue; ++ uint8_t iConfiguration; ++ uint8_t bmAttributes; ++ uint8_t MaxPower; + + struct usb_interface *interface; + +@@ -158,28 +160,28 @@ + + /* Device descriptor */ + struct usb_device_descriptor { +- u_int8_t bLength; +- u_int8_t bDescriptorType; +- u_int16_t bcdUSB; +- u_int8_t bDeviceClass; +- u_int8_t bDeviceSubClass; +- u_int8_t bDeviceProtocol; +- u_int8_t bMaxPacketSize0; +- u_int16_t idVendor; +- u_int16_t idProduct; +- u_int16_t bcdDevice; +- u_int8_t iManufacturer; +- u_int8_t iProduct; +- u_int8_t iSerialNumber; +- u_int8_t bNumConfigurations; ++ uint8_t bLength; ++ uint8_t bDescriptorType; ++ uint16_t bcdUSB; ++ uint8_t bDeviceClass; ++ uint8_t bDeviceSubClass; ++ uint8_t bDeviceProtocol; ++ uint8_t bMaxPacketSize0; ++ uint16_t idVendor; ++ uint16_t idProduct; ++ uint16_t bcdDevice; ++ uint8_t iManufacturer; ++ uint8_t iProduct; ++ uint8_t iSerialNumber; ++ uint8_t bNumConfigurations; + } __attribute__ ((packed)); + + struct usb_ctrl_setup { +- u_int8_t bRequestType; +- u_int8_t bRequest; +- u_int16_t wValue; +- u_int16_t wIndex; +- u_int16_t wLength; ++ uint8_t bRequestType; ++ uint8_t bRequest; ++ uint16_t wValue; ++ uint16_t wIndex; ++ uint16_t wLength; + } __attribute__ ((packed)); + + /* +@@ -250,7 +252,7 @@ + + void *dev; /* Darwin support */ + +- u_int8_t devnum; ++ uint8_t devnum; + + unsigned char num_children; + struct usb_device **children; +@@ -262,7 +264,7 @@ + char dirname[PATH_MAX + 1]; + + struct usb_device *devices; +- u_int32_t location; ++ uint32_t location; + + struct usb_device *root_dev; + }; + diff --git a/libs/libusb/patches/002-no_libusbpp.patch b/libs/libusb/patches/002-no_libusbpp.patch new file mode 100644 index 0000000..82116b7 --- /dev/null +++ b/libs/libusb/patches/002-no_libusbpp.patch @@ -0,0 +1,106 @@ +--- libusb-0.1.12/Makefile.in.old 2007-01-04 16:36:50.000000000 -0700 ++++ libusb-0.1.12/Makefile.in 2007-01-04 16:42:55.000000000 -0700 +@@ -17,7 +17,7 @@ + + + +-SOURCES = $(libusb_la_SOURCES) $(libusbpp_la_SOURCES) ++SOURCES = $(libusb_la_SOURCES) + + srcdir = @srcdir@ + top_srcdir = @top_srcdir@ +@@ -73,8 +73,8 @@ + am_libusb_la_OBJECTS = usb.lo error.lo descriptors.lo $(am__objects_1) + libusb_la_OBJECTS = $(am_libusb_la_OBJECTS) + libusbpp_la_LIBADD = +-am_libusbpp_la_OBJECTS = usbpp.lo +-libusbpp_la_OBJECTS = $(am_libusbpp_la_OBJECTS) ++am_libusbpp_la_OBJECTS = ++libusbpp_la_OBJECTS = + binSCRIPT_INSTALL = $(INSTALL_SCRIPT) + SCRIPTS = $(bin_SCRIPTS) + DEFAULT_INCLUDES = +@@ -82,8 +82,7 @@ + am__depfiles_maybe = depfiles + @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/bsd.Plo ./$(DEPDIR)/darwin.Plo \ + @AMDEP_TRUE@ ./$(DEPDIR)/descriptors.Plo ./$(DEPDIR)/error.Plo \ +-@AMDEP_TRUE@ ./$(DEPDIR)/linux.Plo ./$(DEPDIR)/usb.Plo \ +-@AMDEP_TRUE@ ./$(DEPDIR)/usbpp.Plo ++@AMDEP_TRUE@ ./$(DEPDIR)/linux.Plo ./$(DEPDIR)/usb.Plo + COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ +@@ -100,8 +99,8 @@ + CXXLD = $(CXX) + CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +-SOURCES = $(libusb_la_SOURCES) $(libusbpp_la_SOURCES) +-DIST_SOURCES = $(am__libusb_la_SOURCES_DIST) $(libusbpp_la_SOURCES) ++SOURCES = $(libusb_la_SOURCES) ++DIST_SOURCES = $(am__libusb_la_SOURCES_DIST) + RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ +@@ -256,7 +255,7 @@ + # require automake 1.4 + # gnu strictness chokes on README being autogenerated + AUTOMAKE_OPTIONS = 1.4 foreign +-SUBDIRS = . tests doc ++SUBDIRS = . + AM_CFLAGS = -Werror $(AM_CFLAGS_EXT) + configincludedir = $(pkglibdir)/include + bin_SCRIPTS = libusb-config +@@ -265,7 +264,7 @@ + apidocs/footer.html apidocs/doxygen.css apidocs/doxygen.png libusb.pc.in + + EXTRA_libusb_la_SOURCE = linux.c linux.h bsd.c darwin.c +-lib_LTLIBRARIES = libusb.la libusbpp.la ++lib_LTLIBRARIES = libusb.la + pkgconfig_DATA = libusb.pc + @BSD_API_FALSE@@DARWIN_API_FALSE@@LINUX_API_FALSE@OS_SUPPORT = + @BSD_API_FALSE@@DARWIN_API_TRUE@@LINUX_API_FALSE@OS_SUPPORT = darwin.c +@@ -278,25 +277,19 @@ + AM_CPPFLAGS = -I. + AM_CXXFLAGS = + libusb_la_SOURCES = usb.c usbi.h error.c error.h descriptors.c $(OS_SUPPORT) +-libusbpp_la_SOURCES = usbpp.cpp usbpp.h ++libusbpp_la_SOURCES = + libusbpp_la_DEPENDENCIES = libusb.la + + # Do not add usb.h to *_SOURCES, regardless of dependencies. + # It would be added to the dist tarball, which it shouldn't be. + nodist_include_HEADERS = usb.h +-include_HEADERS = usbpp.h ++include_HEADERS = + libusb_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -release $(LT_RELEASE) \ + -export-dynamic \ + $(LDADDS) $(PREBIND_FLAGS) + +-libusbpp_la_LDFLAGS = \ +- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ +- -release $(LT_RELEASE) \ +- -export-dynamic \ +- $(LDADDS) -lusb $(PREBIND_FLAGSPP) +- + all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +@@ -395,8 +388,6 @@ + done + libusb.la: $(libusb_la_OBJECTS) $(libusb_la_DEPENDENCIES) + $(LINK) -rpath $(libdir) $(libusb_la_LDFLAGS) $(libusb_la_OBJECTS) $(libusb_la_LIBADD) $(LIBS) +-libusbpp.la: $(libusbpp_la_OBJECTS) $(libusbpp_la_DEPENDENCIES) +- $(CXXLINK) -rpath $(libdir) $(libusbpp_la_LDFLAGS) $(libusbpp_la_OBJECTS) $(libusbpp_la_LIBADD) $(LIBS) + install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" +@@ -429,7 +420,6 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usb.Plo@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usbpp.Plo@am__quote@ + + .c.o: + @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ diff --git a/libs/libusb/patches/003-automake-compat.patch b/libs/libusb/patches/003-automake-compat.patch new file mode 100644 index 0000000..eaae25a --- /dev/null +++ b/libs/libusb/patches/003-automake-compat.patch @@ -0,0 +1,10 @@ +--- a/configure.in ++++ b/configure.in +@@ -149,6 +149,7 @@ if test "x$enable_debug" = "xyes"; then + fi + + # Checks for programs. ++AC_PROG_CXX + AC_LANG_CPLUSPLUS + AC_PROG_CC + AM_PROG_CC_C_O diff --git a/libs/libusb/patches/004-no_unused.patch b/libs/libusb/patches/004-no_unused.patch new file mode 100644 index 0000000..8452d5b --- /dev/null +++ b/libs/libusb/patches/004-no_unused.patch @@ -0,0 +1,11 @@ +--- a/Makefile.am 2006-03-04 03:52:46.000000000 +0100 ++++ b/Makefile.am 2011-02-03 12:59:22.261341559 +0100 +@@ -4,7 +4,7 @@ + # gnu strictness chokes on README being autogenerated + AUTOMAKE_OPTIONS = 1.4 foreign + +-SUBDIRS = . tests doc ++SUBDIRS = . + + AM_CFLAGS = -Werror + diff --git a/libs/libv4l/Makefile b/libs/libv4l/Makefile new file mode 100644 index 0000000..8ec4f7d --- /dev/null +++ b/libs/libv4l/Makefile @@ -0,0 +1,113 @@ +# +# Copyright (C) 2009-2012 OpenWrt.org +# Copyright (C) 2009 David Cooper +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=v4l-utils +PKG_VERSION:=0.8.6 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.linuxtv.org/downloads/v4l-utils +PKG_MD5SUM:=80062780ae90e5955473b09b31e9828a + +PKG_BUILD_DEPENDS:=argp-standalone + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/libv4l/Default + TITLE:=Video 4 Linux + URL:=http://www.linuxtv.org/ +endef + +define Package/libv4l/Default/description + libv4l is a collection of libraries which adds a thin abstraction layer on + top of video4linux2 devices. The purpose of this (thin) layer is to make it + easy for application writers to support a wide variety of devices without + having to write separate code for different devices in the same class. libv4l + consists of 3 different libraries: libv4lconvert, libv4l1 and libv4l2. + + libv4l1 offers the (deprecated) v4l1 API on top of v4l2 devices, independent + of the drivers for those devices supporting v4l1 compatibility (which many + v4l2 drivers do not). + + libv4l2 offers the v4l2 API on top of v4l2 devices, while adding for the + application transparent libv4lconvert conversion where necessary. +endef + +define Package/libv4l + $(call Package/libv4l/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= wrapper libraries + DEPENDS := +libpthread +librt +endef + +define Package/libv4l/description + $(call Package/libv4l/Default/description) +endef + +define Package/v4l-utils + $(call Package/libv4l/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= utilities + DEPENDS := +libv4l $(CXX_DEPENDS) +endef + +define Package/v4l-utils/description + $(call Package/libv4l/Default/description) + This package contains the video4linux utilities. +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" PREFIX="/usr" \ + DISABLE_LIBJPEG="1" \ + $(CONFIGURE_VARS) \ + all install + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" PREFIX="/usr" \ + DISABLE_LIBJPEG="1" \ + $(CONFIGURE_VARS) \ + LINKTYPE="static" \ + all install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert}.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libv4l{1,2,convert}.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libv4l/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert}.so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/libv4l + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l/v4l{1compat,2convert}.so $(1)/usr/lib/libv4l/ +endef + +define Package/v4l-utils/install + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/rc_maps.cfg $(1)/etc/ + $(CP) $(PKG_INSTALL_DIR)/etc/rc_keymaps $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/{cx18,ivtv}-ctl $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/decode_tm6000 $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/ir-keytable $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/v4l2-{compliance,ctl,sysfs-path} $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libv4l)) +$(eval $(call BuildPackage,v4l-utils)) diff --git a/libs/libv4l/patches/001-no-shm_open-fix.patch b/libs/libv4l/patches/001-no-shm_open-fix.patch new file mode 100644 index 0000000..89d8791 --- /dev/null +++ b/libs/libv4l/patches/001-no-shm_open-fix.patch @@ -0,0 +1,57 @@ +--- a/lib/libv4lconvert/control/libv4lcontrol.c ++++ b/lib/libv4lconvert/control/libv4lcontrol.c +@@ -525,7 +525,7 @@ static void v4lcontrol_get_flags_from_db + + struct v4lcontrol_data *v4lcontrol_create(int fd, int always_needs_conversion) + { +- int shm_fd; ++ int shm_fd, fdflags; + int i, rc, got_usb_info, speed, init = 0; + char *s, shm_name[256], pwd_buf[1024]; + struct v4l2_capability cap; +@@ -638,33 +638,38 @@ struct v4lcontrol_data *v4lcontrol_creat + + if (getpwuid_r(geteuid(), &pwd, pwd_buf, sizeof(pwd_buf), &pwd_p) == 0) { + if (got_usb_info) +- snprintf(shm_name, 256, "/libv4l-%s:%s:%04x:%04x:%s", pwd.pw_name, ++ snprintf(shm_name, 256, "/dev/shm/libv4l-%s:%s:%04x:%04x:%s", pwd.pw_name, + cap.bus_info, (int)vendor_id, (int)product_id, cap.card); + else +- snprintf(shm_name, 256, "/libv4l-%s:%s:%s", pwd.pw_name, ++ snprintf(shm_name, 256, "/dev/shm/libv4l-%s:%s:%s", pwd.pw_name, + cap.bus_info, cap.card); + } else { + perror("libv4lcontrol: error getting username using uid instead"); + if (got_usb_info) +- snprintf(shm_name, 256, "/libv4l-%lu:%s:%04x:%04x:%s", ++ snprintf(shm_name, 256, "/dev/shm/libv4l-%lu:%s:%04x:%04x:%s", + (unsigned long)geteuid(), cap.bus_info, + (int)vendor_id, (int)product_id, cap.card); + else +- snprintf(shm_name, 256, "/libv4l-%lu:%s:%s", (unsigned long)geteuid(), ++ snprintf(shm_name, 256, "/dev/shm/libv4l-%lu:%s:%s", (unsigned long)geteuid(), + cap.bus_info, cap.card); + } + + /* / is not allowed inside shm names */ +- for (i = 1; shm_name[i]; i++) ++ for (i = 9; shm_name[i]; i++) /* start after "/dev/shm", i = 9 */ + if (shm_name[i] == '/') + shm_name[i] = '-'; + + /* Open the shared memory object identified by shm_name */ +- shm_fd = shm_open(shm_name, (O_CREAT | O_EXCL | O_RDWR), (S_IREAD | S_IWRITE)); ++ shm_fd = open(shm_name, (O_CREAT | O_EXCL | O_RDWR), (S_IREAD | S_IWRITE)); + if (shm_fd >= 0) + init = 1; + else +- shm_fd = shm_open(shm_name, O_RDWR, (S_IREAD | S_IWRITE)); ++ shm_fd = open(shm_name, O_RDWR, (S_IREAD | S_IWRITE)); ++ ++ /* This is all uClibc > 0.9.30 seems to do for shm_open() in librt/shm.c */ ++ fdflags = fcntl(shm_fd, F_GETFD, 0); ++ if (fdflags >= 0) ++ fdflags = fcntl(fd, F_SETFD, fdflags | FD_CLOEXEC); + + if (shm_fd >= 0) { + /* Set the shared memory size */ diff --git a/libs/libv4l/patches/002-allow-disabling-libjpeg.patch b/libs/libv4l/patches/002-allow-disabling-libjpeg.patch new file mode 100644 index 0000000..ad306d4 --- /dev/null +++ b/libs/libv4l/patches/002-allow-disabling-libjpeg.patch @@ -0,0 +1,160 @@ +--- a/lib/libv4lconvert/Makefile ++++ b/lib/libv4lconvert/Makefile +@@ -1,6 +1,6 @@ + override CPPFLAGS += -I../include -fvisibility=hidden + +-LIBS_libv4lconvert = -lrt -lm -ljpeg ++LIBS_libv4lconvert = -lrt -lm + + ifeq ($(LINKTYPE),static) + CONVERT_LIB = libv4lconvert.a +@@ -10,16 +10,22 @@ override CPPFLAGS += -fPIC + endif + + CONVERT_OBJS = libv4lconvert.o tinyjpeg.o sn9c10x.o sn9c20x.o pac207.o \ +- jl2005bcd.o \ + mr97310a.o flip.o crop.o jidctflt.o spca561-decompress.o \ + rgbyuv.o sn9c2028-decomp.o spca501.o sq905c.o bayer.o hm12.o \ +- stv0680.o cpia1.o se401.o jpgl.o jpeg.o jpeg_memsrcdest.o \ ++ stv0680.o cpia1.o se401.o jpgl.o jpeg.o \ + control/libv4lcontrol.o processing/libv4lprocessing.o \ + processing/whitebalance.o processing/autogain.o \ + processing/gamma.o helper.o + TARGETS = $(CONVERT_LIB) libv4lconvert.pc ov511-decomp ov518-decomp + INCLUDES = ../include/libv4lconvert.h + ++ifeq ($(DISABLE_LIBJPEG),1) ++override CFLAGS += -DDISABLE_LIBJPEG ++else ++LIBS_libv4lconvert += -ljpeg ++CONVERT_OBJS += jl2005bcd.o jpeg_memsrcdest.o ++endif ++ + override CPPFLAGS += -DLIBDIR=\"$(LIBDIR)\" -DLIBSUBDIR=\"$(LIBSUBDIR)\" + + all: $(TARGETS) +--- a/lib/libv4lconvert/jpeg.c ++++ b/lib/libv4lconvert/jpeg.c +@@ -19,7 +19,9 @@ + #include + #include + #include "libv4lconvert-priv.h" ++#ifndef DISABLE_LIBJPEG + #include "jpeg_memsrcdest.h" ++#endif + + int v4lconvert_decode_jpeg_tinyjpeg(struct v4lconvert_data *data, + unsigned char *src, int src_size, unsigned char *dest, +@@ -107,6 +109,8 @@ int v4lconvert_decode_jpeg_tinyjpeg(stru + return 0; + } + ++#ifndef DISABLE_LIBJPEG ++ + static void jerr_error_exit(j_common_ptr cinfo) + { + struct v4lconvert_data *data = cinfo->client_data; +@@ -405,3 +409,6 @@ int v4lconvert_decode_jpeg_libjpeg(struc + + return result; + } ++ ++#endif ++ +--- a/lib/libv4lconvert/libv4lconvert-priv.h ++++ b/lib/libv4lconvert/libv4lconvert-priv.h +@@ -22,7 +22,9 @@ + #include + #include + #include ++#ifndef DISABLE_LIBJPEG + #include ++#endif + #include + #include "libv4lconvert.h" + #include "control/libv4lcontrol.h" +@@ -50,11 +52,13 @@ struct v4lconvert_data { + int64_t supported_src_formats; /* bitfield */ + char error_msg[V4LCONVERT_ERROR_MSG_SIZE]; + struct jdec_private *tinyjpeg; ++#ifndef DISABLE_LIBJPEG + struct jpeg_error_mgr jerr; + int jerr_errno; + jmp_buf jerr_jmp_state; + struct jpeg_decompress_struct cinfo; + int cinfo_initialized; ++#endif + struct v4l2_frmsizeenum framesizes[V4LCONVERT_MAX_FRAMESIZES]; + unsigned int no_framesizes; + int bandwidth; +--- a/lib/libv4lconvert/libv4lconvert.c ++++ b/lib/libv4lconvert/libv4lconvert.c +@@ -78,7 +78,9 @@ static const struct v4lconvert_pixfmt su + { V4L2_PIX_FMT_SN9C2028, 0, 9, 9, 1 }, + { V4L2_PIX_FMT_PAC207, 0, 9, 9, 1 }, + { V4L2_PIX_FMT_MR97310A, 0, 9, 9, 1 }, ++#ifndef DISABLE_LIBJPEG + { V4L2_PIX_FMT_JL2005BCD, 0, 9, 9, 1 }, ++#endif + { V4L2_PIX_FMT_SQ905C, 0, 9, 9, 1 }, + /* special */ + { V4L2_PIX_FMT_SE401, 0, 8, 9, 1 }, +@@ -186,8 +188,10 @@ void v4lconvert_destroy(struct v4lconver + tinyjpeg_set_components(data->tinyjpeg, comps, 3); + tinyjpeg_free(data->tinyjpeg); + } ++#ifndef DISABLE_LIBJPEG + if (data->cinfo_initialized) + jpeg_destroy_decompress(&data->cinfo); ++#endif + v4lconvert_helper_cleanup(data); + free(data->convert1_buf); + free(data->convert2_buf); +@@ -634,10 +638,13 @@ static int v4lconvert_convert_pixfmt(str + /* JPG and variants */ + case V4L2_PIX_FMT_MJPEG: + case V4L2_PIX_FMT_JPEG: ++#ifndef DISABLE_LIBJPEG + if (data->flags & V4LCONVERT_USE_TINYJPEG) { ++#endif + result = v4lconvert_decode_jpeg_tinyjpeg(data, + src, src_size, dest, + fmt, dest_pix_fmt, 0); ++#ifndef DISABLE_LIBJPEG + } else { + result = v4lconvert_decode_jpeg_libjpeg(data, + src, src_size, dest, +@@ -652,6 +659,7 @@ static int v4lconvert_convert_pixfmt(str + fmt, dest_pix_fmt, 0); + } + } ++#endif + break; + case V4L2_PIX_FMT_PJPG: + result = v4lconvert_decode_jpeg_tinyjpeg(data, src, src_size, +@@ -777,7 +785,9 @@ static int v4lconvert_convert_pixfmt(str + case V4L2_PIX_FMT_SN9C10X: + case V4L2_PIX_FMT_PAC207: + case V4L2_PIX_FMT_MR97310A: ++#ifndef DISABLE_LIBJPEG + case V4L2_PIX_FMT_JL2005BCD: ++#endif + case V4L2_PIX_FMT_SN9C2028: + case V4L2_PIX_FMT_SQ905C: + case V4L2_PIX_FMT_STV0680: { /* Not compressed but needs some shuffling */ +@@ -816,6 +826,7 @@ static int v4lconvert_convert_pixfmt(str + } + tmpfmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SBGGR8; + break; ++#ifndef DISABLE_LIBJPEG + case V4L2_PIX_FMT_JL2005BCD: + if (v4lconvert_decode_jl2005bcd(data, src, src_size, + tmpbuf, +@@ -826,6 +837,7 @@ static int v4lconvert_convert_pixfmt(str + } + tmpfmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SRGGB8; + break; ++#endif + case V4L2_PIX_FMT_SN9C2028: + v4lconvert_decode_sn9c2028(src, tmpbuf, width, height); + tmpfmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SBGGR8; diff --git a/libs/libv4l/patches/003-add-missing-libs.patch b/libs/libv4l/patches/003-add-missing-libs.patch new file mode 100644 index 0000000..e55bc53 --- /dev/null +++ b/libs/libv4l/patches/003-add-missing-libs.patch @@ -0,0 +1,66 @@ +--- a/contrib/test/Makefile ++++ b/contrib/test/Makefile +@@ -28,7 +28,7 @@ pixfmt-test: pixfmt-test.o + $(CC) $(LDFLAGS) -o $@ $^ -lX11 + + v4l2grab: v4l2grab.o ../../lib/libv4l2/libv4l2.so +- $(CC) $(LDFLAGS) -o $@ $^ -L../../lib/libv4l2 -L../../lib/libv4lconvert -lv4l2 -lv4lconvert ++ $(CC) $(LDFLAGS) -o $@ $^ -L../../lib/libv4l2 -L../../lib/libv4lconvert -lv4l2 -lv4lconvert -largp + + ioctl-test: ioctl-test.o + $(CC) $(LDFLAGS) -o $@ $^ +--- a/utils/decode_tm6000/Makefile ++++ b/utils/decode_tm6000/Makefile +@@ -5,7 +5,7 @@ all: $(TARGETS) + -include *.d + + decode_tm6000: decode_tm6000.o ../libv4l2util/libv4l2util.a +- $(CC) $(LDFLAGS) -o $@ $^ ++ $(CC) $(LDFLAGS) -o $@ $^ -largp + + install: $(TARGETS) + mkdir -p $(DESTDIR)$(PREFIX)/bin +--- a/utils/keytable/Makefile ++++ b/utils/keytable/Makefile +@@ -5,7 +5,7 @@ all: $(TARGETS) + -include *.d + + ir-keytable: keytable.o +- $(CC) $(LDFLAGS) -o $@ $^ ++ $(CC) $(LDFLAGS) -o $@ $^ -largp + + keytable.o: keytable.c parse.h + +--- a/utils/v4l2-compliance/Makefile ++++ b/utils/v4l2-compliance/Makefile +@@ -6,7 +6,7 @@ all: $(TARGETS) + + v4l2-compliance: v4l2-compliance.o v4l2-test-debug.o v4l2-test-input-output.o \ + v4l2-test-controls.o v4l2-test-io-config.o v4l2-test-formats.o +- $(CXX) $(LDFLAGS) -o $@ $^ -lv4l2 -lv4lconvert -lrt ++ $(CXX) $(LDFLAGS) -o $@ $^ -lv4l2 -lv4lconvert -lrt -lpthread + + install: $(TARGETS) + mkdir -p $(DESTDIR)$(PREFIX)/bin +--- a/utils/v4l2-ctl/Makefile ++++ b/utils/v4l2-ctl/Makefile +@@ -13,7 +13,7 @@ ivtv-ctl: ivtv-ctl.o + $(CC) $(LDFLAGS) -o $@ $^ -lm + + v4l2-ctl: v4l2-ctl.o +- $(CXX) $(LDFLAGS) -o $@ $^ -lv4l2 -lv4lconvert -lrt ++ $(CXX) $(LDFLAGS) -o $@ $^ -lv4l2 -lv4lconvert -lrt -lpthread + + install: $(TARGETS) + mkdir -p $(DESTDIR)$(PREFIX)/bin +--- a/utils/v4l2-sysfs-path/Makefile ++++ b/utils/v4l2-sysfs-path/Makefile +@@ -5,7 +5,7 @@ all: $(TARGETS) + -include *.d + + v4l2-sysfs-path: v4l2-sysfs-path.o ../libmedia_dev/libmedia_dev.a +- $(CC) $(LDFLAGS) -o $@ $^ ++ $(CC) $(LDFLAGS) -o $@ $^ -largp + + install: $(TARGETS) + mkdir -p $(DESTDIR)$(PREFIX)/bin diff --git a/libs/libv4l/patches/004-disable-qv4l2.patch b/libs/libv4l/patches/004-disable-qv4l2.patch new file mode 100644 index 0000000..f494643 --- /dev/null +++ b/libs/libv4l/patches/004-disable-qv4l2.patch @@ -0,0 +1,24 @@ +--- a/utils/Makefile ++++ b/utils/Makefile +@@ -5,21 +5,6 @@ all install: + $(MAKE) -C $$i $@ || exit 1; \ + done + +- # Test whether qmake is installed, and whether it is for qt4. +- @if which qmake-qt4 >/dev/null 2>&1; then \ +- QMAKE=qmake-qt4; \ +- else \ +- QMAKE=qmake; \ +- fi; \ +- if which $$QMAKE >/dev/null 2>&1; then \ +- if $$QMAKE --version 2>&1 | grep '4\.[0-9][0-9]*\.[0-9][0-9]*' >/dev/null; then \ +- if [ ! -f qv4l2/Makefile ]; then \ +- (cd qv4l2 && $$QMAKE) || exit 1; \ +- fi; \ +- $(MAKE) -C qv4l2 -f Makefile.install $@; \ +- fi \ +- fi +- + sync-with-kernel: + $(MAKE) -C keytable $@ + $(MAKE) -C v4l2-dbg $@ diff --git a/libs/libvncserver/Makefile b/libs/libvncserver/Makefile new file mode 100644 index 0000000..fedd59f --- /dev/null +++ b/libs/libvncserver/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2009 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:=LibVNCServer +PKG_VERSION:=0.9.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/libvncserver +PKG_MD5SUM:=14af5bdae461df4666c18e5f83c150c4 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +PKG_INSTALL=1 + +define Package/libvncserver + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+zlib +libjpeg +libpthread $(ICONV_DEPENDS) + TITLE:=VNC Server Library + URL:=http://libvncserver.sourceforge.net/ +endef + +CONFIGURE_ARGS += \ + --without-xkeyboard \ + --without-xinerama \ + --without-xrandr \ + --without-xfixes \ + --without-xdamage \ + --without-xtrap \ + --without-xrecord \ + --without-fbpm \ + --without-dpms \ + --without-filetransfer \ + --without-macosx-native \ + --without-ssl \ + --without-avahi + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/{lib,include,bin} + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib* $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ +endef + +define Package/libvncserver/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libvncserver)) diff --git a/libs/libvncserver/patches/001-automake-compat.patch b/libs/libvncserver/patches/001-automake-compat.patch new file mode 100644 index 0000000..eb8de73 --- /dev/null +++ b/libs/libvncserver/patches/001-automake-compat.patch @@ -0,0 +1,6426 @@ +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -601,6401 +601,3 @@ AS_VAR_POPDEF([_PKG])dnl + AS_VAR_POPDEF([_DEF])dnl + AS_VAR_POPDEF([_OUT])dnl + ],[PACKAGE="$PACKAGE"])]) +- +-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +-## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 +-## Free Software Foundation, Inc. +-## Originally by Gordon Matzigkeit , 1996 +-## +-## This file is free software; the Free Software Foundation gives +-## unlimited permission to copy and/or distribute it, with or without +-## modifications, as long as this notice is preserved. +- +-# serial 48 AC_PROG_LIBTOOL +- +- +-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +-# ----------------------------------------------------------- +-# If this macro is not defined by Autoconf, define it here. +-m4_ifdef([AC_PROVIDE_IFELSE], +- [], +- [m4_define([AC_PROVIDE_IFELSE], +- [m4_ifdef([AC_PROVIDE_$1], +- [$2], [$3])])]) +- +- +-# AC_PROG_LIBTOOL +-# --------------- +-AC_DEFUN([AC_PROG_LIBTOOL], +-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. +- AC_PROVIDE_IFELSE([AC_PROG_CXX], +- [AC_LIBTOOL_CXX], +- [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX +- ])]) +-dnl And a similar setup for Fortran 77 support +- AC_PROVIDE_IFELSE([AC_PROG_F77], +- [AC_LIBTOOL_F77], +- [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +-])]) +- +-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. +- AC_PROVIDE_IFELSE([AC_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [ifdef([AC_PROG_GCJ], +- [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) +- ifdef([A][M_PROG_GCJ], +- [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) +- ifdef([LT_AC_PROG_GCJ], +- [define([LT_AC_PROG_GCJ], +- defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +-])])# AC_PROG_LIBTOOL +- +- +-# _AC_PROG_LIBTOOL +-# ---------------- +-AC_DEFUN([_AC_PROG_LIBTOOL], +-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl +- +-# This can be used to rebuild libtool when needed +-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" +- +-# Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' +-AC_SUBST(LIBTOOL)dnl +- +-# Prevent multiple expansion +-define([AC_PROG_LIBTOOL], []) +-])# _AC_PROG_LIBTOOL +- +- +-# AC_LIBTOOL_SETUP +-# ---------------- +-AC_DEFUN([AC_LIBTOOL_SETUP], +-[AC_PREREQ(2.50)dnl +-AC_REQUIRE([AC_ENABLE_SHARED])dnl +-AC_REQUIRE([AC_ENABLE_STATIC])dnl +-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +-AC_REQUIRE([AC_CANONICAL_HOST])dnl +-AC_REQUIRE([AC_CANONICAL_BUILD])dnl +-AC_REQUIRE([AC_PROG_CC])dnl +-AC_REQUIRE([AC_PROG_LD])dnl +-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +-AC_REQUIRE([AC_PROG_NM])dnl +- +-AC_REQUIRE([AC_PROG_LN_S])dnl +-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +-AC_REQUIRE([AC_OBJEXT])dnl +-AC_REQUIRE([AC_EXEEXT])dnl +-dnl +- +-AC_LIBTOOL_SYS_MAX_CMD_LEN +-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +-AC_LIBTOOL_OBJDIR +- +-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +-_LT_AC_PROG_ECHO_BACKSLASH +- +-case $host_os in +-aix3*) +- # AIX sometimes has problems with the GCC collect2 program. For some +- # reason, if we set the COLLECT_NAMES environment variable, the problems +- # vanish in a puff of smoke. +- if test "X${COLLECT_NAMES+set}" != Xset; then +- COLLECT_NAMES= +- export COLLECT_NAMES +- fi +- ;; +-esac +- +-# Sed substitution that helps us do robust quoting. It backslashifies +-# metacharacters that are still active within double-quoted strings. +-Xsed='sed -e 1s/^X//' +-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] +- +-# Same as above, but do not quote variable references. +-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] +- +-# Sed substitution to delay expansion of an escaped shell variable in a +-# double_quote_subst'ed string. +-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' +- +-# Sed substitution to avoid accidental globbing in evaled expressions +-no_glob_subst='s/\*/\\\*/g' +- +-# Constants: +-rm="rm -f" +- +-# Global variables: +-default_ofile=libtool +-can_build_shared=yes +- +-# All known linkers require a `.a' archive for static linking (except MSVC, +-# which needs '.lib'). +-libext=a +-ltmain="$ac_aux_dir/ltmain.sh" +-ofile="$default_ofile" +-with_gnu_ld="$lt_cv_prog_gnu_ld" +- +-AC_CHECK_TOOL(AR, ar, false) +-AC_CHECK_TOOL(RANLIB, ranlib, :) +-AC_CHECK_TOOL(STRIP, strip, :) +- +-old_CC="$CC" +-old_CFLAGS="$CFLAGS" +- +-# Set sane defaults for various variables +-test -z "$AR" && AR=ar +-test -z "$AR_FLAGS" && AR_FLAGS=cru +-test -z "$AS" && AS=as +-test -z "$CC" && CC=cc +-test -z "$LTCC" && LTCC=$CC +-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +-test -z "$DLLTOOL" && DLLTOOL=dlltool +-test -z "$LD" && LD=ld +-test -z "$LN_S" && LN_S="ln -s" +-test -z "$MAGIC_CMD" && MAGIC_CMD=file +-test -z "$NM" && NM=nm +-test -z "$SED" && SED=sed +-test -z "$OBJDUMP" && OBJDUMP=objdump +-test -z "$RANLIB" && RANLIB=: +-test -z "$STRIP" && STRIP=: +-test -z "$ac_objext" && ac_objext=o +- +-# Determine commands to create old-style static archives. +-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +-old_postinstall_cmds='chmod 644 $oldlib' +-old_postuninstall_cmds= +- +-if test -n "$RANLIB"; then +- case $host_os in +- openbsd*) +- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" +- ;; +- *) +- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" +- ;; +- esac +- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +-fi +- +-_LT_CC_BASENAME([$compiler]) +- +-# Only perform the check for file, if the check method requires it +-case $deplibs_check_method in +-file_magic*) +- if test "$file_magic_cmd" = '$MAGIC_CMD'; then +- AC_PATH_MAGIC +- fi +- ;; +-esac +- +-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +-enable_win32_dll=yes, enable_win32_dll=no) +- +-AC_ARG_ENABLE([libtool-lock], +- [AC_HELP_STRING([--disable-libtool-lock], +- [avoid locking (might break parallel builds)])]) +-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +- +-AC_ARG_WITH([pic], +- [AC_HELP_STRING([--with-pic], +- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], +- [pic_mode="$withval"], +- [pic_mode=default]) +-test -z "$pic_mode" && pic_mode=default +- +-# Use C for the default configuration in the libtool script +-tagname= +-AC_LIBTOOL_LANG_C_CONFIG +-_LT_AC_TAGCONFIG +-])# AC_LIBTOOL_SETUP +- +- +-# _LT_AC_SYS_COMPILER +-# ------------------- +-AC_DEFUN([_LT_AC_SYS_COMPILER], +-[AC_REQUIRE([AC_PROG_CC])dnl +- +-# If no C compiler was specified, use CC. +-LTCC=${LTCC-"$CC"} +- +-# If no C compiler flags were specified, use CFLAGS. +-LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +- +-# Allow CC to be a program name with arguments. +-compiler=$CC +-])# _LT_AC_SYS_COMPILER +- +- +-# _LT_CC_BASENAME(CC) +-# ------------------- +-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +-AC_DEFUN([_LT_CC_BASENAME], +-[for cc_temp in $1""; do +- case $cc_temp in +- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; +- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; +- \-*) ;; +- *) break;; +- esac +-done +-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +-]) +- +- +-# _LT_COMPILER_BOILERPLATE +-# ------------------------ +-# Check for compiler boilerplate output or warnings with +-# the simple compiler test code. +-AC_DEFUN([_LT_COMPILER_BOILERPLATE], +-[ac_outfile=conftest.$ac_objext +-printf "$lt_simple_compile_test_code" >conftest.$ac_ext +-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +-_lt_compiler_boilerplate=`cat conftest.err` +-$rm conftest* +-])# _LT_COMPILER_BOILERPLATE +- +- +-# _LT_LINKER_BOILERPLATE +-# ---------------------- +-# Check for linker boilerplate output or warnings with +-# the simple link test code. +-AC_DEFUN([_LT_LINKER_BOILERPLATE], +-[ac_outfile=conftest.$ac_objext +-printf "$lt_simple_link_test_code" >conftest.$ac_ext +-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +-_lt_linker_boilerplate=`cat conftest.err` +-$rm conftest* +-])# _LT_LINKER_BOILERPLATE +- +- +-# _LT_AC_SYS_LIBPATH_AIX +-# ---------------------- +-# Links a minimal program and checks the executable +-# for the system default hardcoded library path. In most cases, +-# this is /usr/lib:/lib, but when the MPI compilers are used +-# the location of the communication and MPI libs are included too. +-# If we don't find anything, use the default library path according +-# to the aix ld manual. +-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +-}'` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +-}'`; fi],[]) +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +-])# _LT_AC_SYS_LIBPATH_AIX +- +- +-# _LT_AC_SHELL_INIT(ARG) +-# ---------------------- +-AC_DEFUN([_LT_AC_SHELL_INIT], +-[ifdef([AC_DIVERSION_NOTICE], +- [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], +- [AC_DIVERT_PUSH(NOTICE)]) +-$1 +-AC_DIVERT_POP +-])# _LT_AC_SHELL_INIT +- +- +-# _LT_AC_PROG_ECHO_BACKSLASH +-# -------------------------- +-# Add some code to the start of the generated configure script which +-# will find an echo command which doesn't interpret backslashes. +-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +-[_LT_AC_SHELL_INIT([ +-# Check that we are running under the correct shell. +-SHELL=${CONFIG_SHELL-/bin/sh} +- +-case X$ECHO in +-X*--fallback-echo) +- # Remove one level of quotation (which was required for Make). +- ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` +- ;; +-esac +- +-echo=${ECHO-echo} +-if test "X[$]1" = X--no-reexec; then +- # Discard the --no-reexec flag, and continue. +- shift +-elif test "X[$]1" = X--fallback-echo; then +- # Avoid inline document here, it may be left over +- : +-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then +- # Yippee, $echo works! +- : +-else +- # Restart under the correct shell. +- exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +-fi +- +-if test "X[$]1" = X--fallback-echo; then +- # used as fallback echo +- shift +- cat </dev/null 2>&1 && unset CDPATH +- +-if test -z "$ECHO"; then +-if test "X${echo_test_string+set}" != Xset; then +-# find a string as large as possible, as long as the shell can cope with it +- for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do +- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... +- if (echo_test_string=`eval $cmd`) 2>/dev/null && +- echo_test_string=`eval $cmd` && +- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null +- then +- break +- fi +- done +-fi +- +-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- : +-else +- # The Solaris, AIX, and Digital Unix default echo programs unquote +- # backslashes. This makes it impossible to quote backslashes using +- # echo "$something" | sed 's/\\/\\\\/g' +- # +- # So, first we look for a working echo in the user's PATH. +- +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for dir in $PATH /usr/ucb; do +- IFS="$lt_save_ifs" +- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && +- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- echo="$dir/echo" +- break +- fi +- done +- IFS="$lt_save_ifs" +- +- if test "X$echo" = Xecho; then +- # We didn't find a better echo, so look for alternatives. +- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- # This shell has a builtin print -r that does the trick. +- echo='print -r' +- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && +- test "X$CONFIG_SHELL" != X/bin/ksh; then +- # If we have ksh, try running configure again with it. +- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} +- export ORIGINAL_CONFIG_SHELL +- CONFIG_SHELL=/bin/ksh +- export CONFIG_SHELL +- exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} +- else +- # Try using printf. +- echo='printf %s\n' +- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- # Cool, printf works +- : +- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && +- test "X$echo_testing_string" = 'X\t' && +- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL +- export CONFIG_SHELL +- SHELL="$CONFIG_SHELL" +- export SHELL +- echo="$CONFIG_SHELL [$]0 --fallback-echo" +- elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && +- test "X$echo_testing_string" = 'X\t' && +- echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- echo="$CONFIG_SHELL [$]0 --fallback-echo" +- else +- # maybe with a smaller string... +- prev=: +- +- for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do +- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null +- then +- break +- fi +- prev="$cmd" +- done +- +- if test "$prev" != 'sed 50q "[$]0"'; then +- echo_test_string=`eval $prev` +- export echo_test_string +- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} +- else +- # Oops. We lost completely, so just stick with echo. +- echo=echo +- fi +- fi +- fi +- fi +-fi +-fi +- +-# Copy echo and quote the copy suitably for passing to libtool from +-# the Makefile, instead of quoting the original, which is used later. +-ECHO=$echo +-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then +- ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +-fi +- +-AC_SUBST(ECHO) +-])])# _LT_AC_PROG_ECHO_BACKSLASH +- +- +-# _LT_AC_LOCK +-# ----------- +-AC_DEFUN([_LT_AC_LOCK], +-[AC_ARG_ENABLE([libtool-lock], +- [AC_HELP_STRING([--disable-libtool-lock], +- [avoid locking (might break parallel builds)])]) +-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +- +-# Some flags need to be propagated to the compiler or linker for good +-# libtool support. +-case $host in +-ia64-*-hpux*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.$ac_objext` in +- *ELF-32*) +- HPUX_IA64_MODE="32" +- ;; +- *ELF-64*) +- HPUX_IA64_MODE="64" +- ;; +- esac +- fi +- rm -rf conftest* +- ;; +-*-*-irix6*) +- # Find out which ABI we are using. +- echo '[#]line __oline__ "configure"' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- if test "$lt_cv_prog_gnu_ld" = yes; then +- case `/usr/bin/file conftest.$ac_objext` in +- *32-bit*) +- LD="${LD-ld} -melf32bsmip" +- ;; +- *N32*) +- LD="${LD-ld} -melf32bmipn32" +- ;; +- *64-bit*) +- LD="${LD-ld} -melf64bmip" +- ;; +- esac +- else +- case `/usr/bin/file conftest.$ac_objext` in +- *32-bit*) +- LD="${LD-ld} -32" +- ;; +- *N32*) +- LD="${LD-ld} -n32" +- ;; +- *64-bit*) +- LD="${LD-ld} -64" +- ;; +- esac +- fi +- fi +- rm -rf conftest* +- ;; +- +-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.o` in +- *32-bit*) +- case $host in +- x86_64-*linux*) +- LD="${LD-ld} -m elf_i386" +- ;; +- ppc64-*linux*|powerpc64-*linux*) +- LD="${LD-ld} -m elf32ppclinux" +- ;; +- s390x-*linux*) +- LD="${LD-ld} -m elf_s390" +- ;; +- sparc64-*linux*) +- LD="${LD-ld} -m elf32_sparc" +- ;; +- esac +- ;; +- *64-bit*) +- case $host in +- x86_64-*linux*) +- LD="${LD-ld} -m elf_x86_64" +- ;; +- ppc*-*linux*|powerpc*-*linux*) +- LD="${LD-ld} -m elf64ppc" +- ;; +- s390*-*linux*) +- LD="${LD-ld} -m elf64_s390" +- ;; +- sparc*-*linux*) +- LD="${LD-ld} -m elf64_sparc" +- ;; +- esac +- ;; +- esac +- fi +- rm -rf conftest* +- ;; +- +-*-*-sco3.2v5*) +- # On SCO OpenServer 5, we need -belf to get full-featured binaries. +- SAVE_CFLAGS="$CFLAGS" +- CFLAGS="$CFLAGS -belf" +- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, +- [AC_LANG_PUSH(C) +- AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) +- AC_LANG_POP]) +- if test x"$lt_cv_cc_needs_belf" != x"yes"; then +- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf +- CFLAGS="$SAVE_CFLAGS" +- fi +- ;; +-sparc*-*solaris*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.o` in +- *64-bit*) +- case $lt_cv_prog_gnu_ld in +- yes*) LD="${LD-ld} -m elf64_sparc" ;; +- *) LD="${LD-ld} -64" ;; +- esac +- ;; +- esac +- fi +- rm -rf conftest* +- ;; +- +-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +-[*-*-cygwin* | *-*-mingw* | *-*-pw32*) +- AC_CHECK_TOOL(DLLTOOL, dlltool, false) +- AC_CHECK_TOOL(AS, as, false) +- AC_CHECK_TOOL(OBJDUMP, objdump, false) +- ;; +- ]) +-esac +- +-need_locks="$enable_libtool_lock" +- +-])# _LT_AC_LOCK +- +- +-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +-# ---------------------------------------------------------------- +-# Check whether the given compiler option works +-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +-[AC_REQUIRE([LT_AC_PROG_SED]) +-AC_CACHE_CHECK([$1], [$2], +- [$2=no +- ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) +- printf "$lt_simple_compile_test_code" > conftest.$ac_ext +- lt_compiler_flag="$3" +- # Insert the option either (1) after the last *FLAGS variable, or +- # (2) before a word containing "conftest.", or (3) at the end. +- # Note that $ac_compile itself does not contain backslashes and begins +- # with a dollar sign (not a hyphen), so the echo should work correctly. +- # The option is referenced via a variable to avoid confusing sed. +- lt_compile=`echo "$ac_compile" | $SED \ +- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ +- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ +- -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) +- (eval "$lt_compile" 2>conftest.err) +- ac_status=$? +- cat conftest.err >&AS_MESSAGE_LOG_FD +- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD +- if (exit $ac_status) && test -s "$ac_outfile"; then +- # The compiler can only warn and ignore the option if not recognized +- # So say no if there are warnings other than the usual output. +- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp +- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 +- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then +- $2=yes +- fi +- fi +- $rm conftest* +-]) +- +-if test x"[$]$2" = xyes; then +- ifelse([$5], , :, [$5]) +-else +- ifelse([$6], , :, [$6]) +-fi +-])# AC_LIBTOOL_COMPILER_OPTION +- +- +-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +-# [ACTION-SUCCESS], [ACTION-FAILURE]) +-# ------------------------------------------------------------ +-# Check whether the given compiler option works +-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +-[AC_CACHE_CHECK([$1], [$2], +- [$2=no +- save_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS $3" +- printf "$lt_simple_link_test_code" > conftest.$ac_ext +- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then +- # The linker can only warn and ignore the option if not recognized +- # So say no if there are warnings +- if test -s conftest.err; then +- # Append any errors to the config.log. +- cat conftest.err 1>&AS_MESSAGE_LOG_FD +- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp +- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 +- if diff conftest.exp conftest.er2 >/dev/null; then +- $2=yes +- fi +- else +- $2=yes +- fi +- fi +- $rm conftest* +- LDFLAGS="$save_LDFLAGS" +-]) +- +-if test x"[$]$2" = xyes; then +- ifelse([$4], , :, [$4]) +-else +- ifelse([$5], , :, [$5]) +-fi +-])# AC_LIBTOOL_LINKER_OPTION +- +- +-# AC_LIBTOOL_SYS_MAX_CMD_LEN +-# -------------------------- +-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +-[# find the maximum length of command line arguments +-AC_MSG_CHECKING([the maximum length of command line arguments]) +-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl +- i=0 +- teststring="ABCD" +- +- case $build_os in +- msdosdjgpp*) +- # On DJGPP, this test can blow up pretty badly due to problems in libc +- # (any single argument exceeding 2000 bytes causes a buffer overrun +- # during glob expansion). Even if it were fixed, the result of this +- # check would be larger than it should be. +- lt_cv_sys_max_cmd_len=12288; # 12K is about right +- ;; +- +- gnu*) +- # Under GNU Hurd, this test is not required because there is +- # no limit to the length of command line arguments. +- # Libtool will interpret -1 as no limit whatsoever +- lt_cv_sys_max_cmd_len=-1; +- ;; +- +- cygwin* | mingw*) +- # On Win9x/ME, this test blows up -- it succeeds, but takes +- # about 5 minutes as the teststring grows exponentially. +- # Worse, since 9x/ME are not pre-emptively multitasking, +- # you end up with a "frozen" computer, even though with patience +- # the test eventually succeeds (with a max line length of 256k). +- # Instead, let's just punt: use the minimum linelength reported by +- # all of the supported platforms: 8192 (on NT/2K/XP). +- lt_cv_sys_max_cmd_len=8192; +- ;; +- +- amigaos*) +- # On AmigaOS with pdksh, this test takes hours, literally. +- # So we just punt and use a minimum line length of 8192. +- lt_cv_sys_max_cmd_len=8192; +- ;; +- +- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) +- # This has been around since 386BSD, at least. Likely further. +- if test -x /sbin/sysctl; then +- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` +- elif test -x /usr/sbin/sysctl; then +- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` +- else +- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs +- fi +- # And add a safety zone +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` +- ;; +- +- interix*) +- # We know the value 262144 and hardcode it with a safety zone (like BSD) +- lt_cv_sys_max_cmd_len=196608 +- ;; +- +- osf*) +- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure +- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not +- # nice to cause kernel panics so lets avoid the loop below. +- # First set a reasonable default. +- lt_cv_sys_max_cmd_len=16384 +- # +- if test -x /sbin/sysconfig; then +- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in +- *1*) lt_cv_sys_max_cmd_len=-1 ;; +- esac +- fi +- ;; +- sco3.2v5*) +- lt_cv_sys_max_cmd_len=102400 +- ;; +- sysv5* | sco5v6* | sysv4.2uw2*) +- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` +- if test -n "$kargmax"; then +- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` +- else +- lt_cv_sys_max_cmd_len=32768 +- fi +- ;; +- *) +- # If test is not a shell built-in, we'll probably end up computing a +- # maximum length that is only half of the actual maximum length, but +- # we can't tell. +- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} +- while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ +- = "XX$teststring") >/dev/null 2>&1 && +- new_result=`expr "X$teststring" : ".*" 2>&1` && +- lt_cv_sys_max_cmd_len=$new_result && +- test $i != 17 # 1/2 MB should be enough +- do +- i=`expr $i + 1` +- teststring=$teststring$teststring +- done +- teststring= +- # Add a significant safety factor because C++ compilers can tack on massive +- # amounts of additional arguments before passing them to the linker. +- # It appears as though 1/2 is a usable value. +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` +- ;; +- esac +-]) +-if test -n $lt_cv_sys_max_cmd_len ; then +- AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +-else +- AC_MSG_RESULT(none) +-fi +-])# AC_LIBTOOL_SYS_MAX_CMD_LEN +- +- +-# _LT_AC_CHECK_DLFCN +-# ------------------ +-AC_DEFUN([_LT_AC_CHECK_DLFCN], +-[AC_CHECK_HEADERS(dlfcn.h)dnl +-])# _LT_AC_CHECK_DLFCN +- +- +-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +-# --------------------------------------------------------------------- +-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +-if test "$cross_compiling" = yes; then : +- [$4] +-else +- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 +- lt_status=$lt_dlunknown +- cat > conftest.$ac_ext < +-#endif +- +-#include +- +-#ifdef RTLD_GLOBAL +-# define LT_DLGLOBAL RTLD_GLOBAL +-#else +-# ifdef DL_GLOBAL +-# define LT_DLGLOBAL DL_GLOBAL +-# else +-# define LT_DLGLOBAL 0 +-# endif +-#endif +- +-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we +- find out it does not work in some platform. */ +-#ifndef LT_DLLAZY_OR_NOW +-# ifdef RTLD_LAZY +-# define LT_DLLAZY_OR_NOW RTLD_LAZY +-# else +-# ifdef DL_LAZY +-# define LT_DLLAZY_OR_NOW DL_LAZY +-# else +-# ifdef RTLD_NOW +-# define LT_DLLAZY_OR_NOW RTLD_NOW +-# else +-# ifdef DL_NOW +-# define LT_DLLAZY_OR_NOW DL_NOW +-# else +-# define LT_DLLAZY_OR_NOW 0 +-# endif +-# endif +-# endif +-# endif +-#endif +- +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif +- +-void fnord() { int i=42;} +-int main () +-{ +- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +- int status = $lt_dlunknown; +- +- if (self) +- { +- if (dlsym (self,"fnord")) status = $lt_dlno_uscore; +- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; +- /* dlclose (self); */ +- } +- else +- puts (dlerror ()); +- +- exit (status); +-}] +-EOF +- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then +- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null +- lt_status=$? +- case x$lt_status in +- x$lt_dlno_uscore) $1 ;; +- x$lt_dlneed_uscore) $2 ;; +- x$lt_dlunknown|x*) $3 ;; +- esac +- else : +- # compilation failed +- $3 +- fi +-fi +-rm -fr conftest* +-])# _LT_AC_TRY_DLOPEN_SELF +- +- +-# AC_LIBTOOL_DLOPEN_SELF +-# ---------------------- +-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +-if test "x$enable_dlopen" != xyes; then +- enable_dlopen=unknown +- enable_dlopen_self=unknown +- enable_dlopen_self_static=unknown +-else +- lt_cv_dlopen=no +- lt_cv_dlopen_libs= +- +- case $host_os in +- beos*) +- lt_cv_dlopen="load_add_on" +- lt_cv_dlopen_libs= +- lt_cv_dlopen_self=yes +- ;; +- +- mingw* | pw32*) +- lt_cv_dlopen="LoadLibrary" +- lt_cv_dlopen_libs= +- ;; +- +- cygwin*) +- lt_cv_dlopen="dlopen" +- lt_cv_dlopen_libs= +- ;; +- +- darwin*) +- # if libdl is installed we need to link against it +- AC_CHECK_LIB([dl], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ +- lt_cv_dlopen="dyld" +- lt_cv_dlopen_libs= +- lt_cv_dlopen_self=yes +- ]) +- ;; +- +- *) +- AC_CHECK_FUNC([shl_load], +- [lt_cv_dlopen="shl_load"], +- [AC_CHECK_LIB([dld], [shl_load], +- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], +- [AC_CHECK_FUNC([dlopen], +- [lt_cv_dlopen="dlopen"], +- [AC_CHECK_LIB([dl], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], +- [AC_CHECK_LIB([svld], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], +- [AC_CHECK_LIB([dld], [dld_link], +- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) +- ]) +- ]) +- ]) +- ]) +- ]) +- ;; +- esac +- +- if test "x$lt_cv_dlopen" != xno; then +- enable_dlopen=yes +- else +- enable_dlopen=no +- fi +- +- case $lt_cv_dlopen in +- dlopen) +- save_CPPFLAGS="$CPPFLAGS" +- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" +- +- save_LDFLAGS="$LDFLAGS" +- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" +- +- save_LIBS="$LIBS" +- LIBS="$lt_cv_dlopen_libs $LIBS" +- +- AC_CACHE_CHECK([whether a program can dlopen itself], +- lt_cv_dlopen_self, [dnl +- _LT_AC_TRY_DLOPEN_SELF( +- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, +- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) +- ]) +- +- if test "x$lt_cv_dlopen_self" = xyes; then +- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" +- AC_CACHE_CHECK([whether a statically linked program can dlopen itself], +- lt_cv_dlopen_self_static, [dnl +- _LT_AC_TRY_DLOPEN_SELF( +- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, +- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) +- ]) +- fi +- +- CPPFLAGS="$save_CPPFLAGS" +- LDFLAGS="$save_LDFLAGS" +- LIBS="$save_LIBS" +- ;; +- esac +- +- case $lt_cv_dlopen_self in +- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; +- *) enable_dlopen_self=unknown ;; +- esac +- +- case $lt_cv_dlopen_self_static in +- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; +- *) enable_dlopen_self_static=unknown ;; +- esac +-fi +-])# AC_LIBTOOL_DLOPEN_SELF +- +- +-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +-# --------------------------------- +-# Check to see if options -c and -o are simultaneously supported by compiler +-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], +- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], +- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no +- $rm -r conftest 2>/dev/null +- mkdir conftest +- cd conftest +- mkdir out +- printf "$lt_simple_compile_test_code" > conftest.$ac_ext +- +- lt_compiler_flag="-o out/conftest2.$ac_objext" +- # Insert the option either (1) after the last *FLAGS variable, or +- # (2) before a word containing "conftest.", or (3) at the end. +- # Note that $ac_compile itself does not contain backslashes and begins +- # with a dollar sign (not a hyphen), so the echo should work correctly. +- lt_compile=`echo "$ac_compile" | $SED \ +- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ +- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ +- -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) +- (eval "$lt_compile" 2>out/conftest.err) +- ac_status=$? +- cat out/conftest.err >&AS_MESSAGE_LOG_FD +- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD +- if (exit $ac_status) && test -s out/conftest2.$ac_objext +- then +- # The compiler can only warn and ignore the option if not recognized +- # So say no if there are warnings +- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp +- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 +- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then +- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes +- fi +- fi +- chmod u+w . 2>&AS_MESSAGE_LOG_FD +- $rm conftest* +- # SGI C++ compiler will create directory out/ii_files/ for +- # template instantiation +- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files +- $rm out/* && rmdir out +- cd .. +- rmdir conftest +- $rm conftest* +-]) +-])# AC_LIBTOOL_PROG_CC_C_O +- +- +-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +-# ----------------------------------------- +-# Check to see if we can do hard links to lock some files if needed +-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +-[AC_REQUIRE([_LT_AC_LOCK])dnl +- +-hard_links="nottested" +-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then +- # do not overwrite the value of need_locks provided by the user +- AC_MSG_CHECKING([if we can lock with hard links]) +- hard_links=yes +- $rm conftest* +- ln conftest.a conftest.b 2>/dev/null && hard_links=no +- touch conftest.a +- ln conftest.a conftest.b 2>&5 || hard_links=no +- ln conftest.a conftest.b 2>/dev/null && hard_links=no +- AC_MSG_RESULT([$hard_links]) +- if test "$hard_links" = no; then +- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) +- need_locks=warn +- fi +-else +- need_locks=no +-fi +-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS +- +- +-# AC_LIBTOOL_OBJDIR +-# ----------------- +-AC_DEFUN([AC_LIBTOOL_OBJDIR], +-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +-[rm -f .libs 2>/dev/null +-mkdir .libs 2>/dev/null +-if test -d .libs; then +- lt_cv_objdir=.libs +-else +- # MS-DOS does not allow filenames that begin with a dot. +- lt_cv_objdir=_libs +-fi +-rmdir .libs 2>/dev/null]) +-objdir=$lt_cv_objdir +-])# AC_LIBTOOL_OBJDIR +- +- +-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +-# ---------------------------------------------- +-# Check hardcoding attributes. +-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +-[AC_MSG_CHECKING([how to hardcode library paths into programs]) +-_LT_AC_TAGVAR(hardcode_action, $1)= +-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ +- test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ +- test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then +- +- # We can hardcode non-existant directories. +- if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && +- # If the only mechanism to avoid hardcoding is shlibpath_var, we +- # have to relink, otherwise we might link with an installed library +- # when we should be linking with a yet-to-be-installed one +- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && +- test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then +- # Linking always hardcodes the temporary library directory. +- _LT_AC_TAGVAR(hardcode_action, $1)=relink +- else +- # We can link without hardcoding, and we can hardcode nonexisting dirs. +- _LT_AC_TAGVAR(hardcode_action, $1)=immediate +- fi +-else +- # We cannot hardcode anything, or else we can only hardcode existing +- # directories. +- _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +-fi +-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) +- +-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then +- # Fast installation is not supported +- enable_fast_install=no +-elif test "$shlibpath_overrides_runpath" = yes || +- test "$enable_shared" = no; then +- # Fast installation is not necessary +- enable_fast_install=needless +-fi +-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH +- +- +-# AC_LIBTOOL_SYS_LIB_STRIP +-# ------------------------ +-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +-[striplib= +-old_striplib= +-AC_MSG_CHECKING([whether stripping libraries is possible]) +-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then +- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" +- test -z "$striplib" && striplib="$STRIP --strip-unneeded" +- AC_MSG_RESULT([yes]) +-else +-# FIXME - insert some real tests, host_os isn't really good enough +- case $host_os in +- darwin*) +- if test -n "$STRIP" ; then +- striplib="$STRIP -x" +- AC_MSG_RESULT([yes]) +- else +- AC_MSG_RESULT([no]) +-fi +- ;; +- *) +- AC_MSG_RESULT([no]) +- ;; +- esac +-fi +-])# AC_LIBTOOL_SYS_LIB_STRIP +- +- +-# AC_LIBTOOL_SYS_DYNAMIC_LINKER +-# ----------------------------- +-# PORTME Fill in your ld.so characteristics +-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +-[AC_MSG_CHECKING([dynamic linker characteristics]) +-library_names_spec= +-libname_spec='lib$name' +-soname_spec= +-shrext_cmds=".so" +-postinstall_cmds= +-postuninstall_cmds= +-finish_cmds= +-finish_eval= +-shlibpath_var= +-shlibpath_overrides_runpath=unknown +-version_type=none +-dynamic_linker="$host_os ld.so" +-sys_lib_dlsearch_path_spec="/lib /usr/lib" +-if test "$GCC" = yes; then +- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` +- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then +- # if the path contains ";" then we assume it to be the separator +- # otherwise default to the standard path separator (i.e. ":") - it is +- # assumed that no part of a normal pathname contains ";" but that should +- # okay in the real world where ";" in dirpaths is itself problematic. +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` +- else +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` +- fi +-else +- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +-fi +-need_lib_prefix=unknown +-hardcode_into_libs=no +- +-# when you set need_version to no, make sure it does not cause -set_version +-# flags to be left without arguments +-need_version=unknown +- +-case $host_os in +-aix3*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' +- shlibpath_var=LIBPATH +- +- # AIX 3 has no versioning support, so we append a major version to the name. +- soname_spec='${libname}${release}${shared_ext}$major' +- ;; +- +-aix4* | aix5*) +- version_type=linux +- need_lib_prefix=no +- need_version=no +- hardcode_into_libs=yes +- if test "$host_cpu" = ia64; then +- # AIX 5 supports IA64 +- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- else +- # With GCC up to 2.95.x, collect2 would create an import file +- # for dependence libraries. The import file would start with +- # the line `#! .'. This would cause the generated library to +- # depend on `.', always an invalid library. This was fixed in +- # development snapshots of GCC prior to 3.0. +- case $host_os in +- aix4 | aix4.[[01]] | aix4.[[01]].*) +- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' +- echo ' yes ' +- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then +- : +- else +- can_build_shared=no +- fi +- ;; +- esac +- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct +- # soname into executable. Probably we can add versioning support to +- # collect2, so additional links can be useful in future. +- if test "$aix_use_runtimelinking" = yes; then +- # If using run time linking (on AIX 4.2 or later) use lib.so +- # instead of lib.a to let people know that these are not +- # typical AIX shared libraries. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- else +- # We preserve .a as extension for shared libraries through AIX4.2 +- # and later when we are not doing run time linking. +- library_names_spec='${libname}${release}.a $libname.a' +- soname_spec='${libname}${release}${shared_ext}$major' +- fi +- shlibpath_var=LIBPATH +- fi +- ;; +- +-amigaos*) +- library_names_spec='$libname.ixlibrary $libname.a' +- # Create ${libname}_ixlibrary.a entries in /sys/libs. +- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' +- ;; +- +-beos*) +- library_names_spec='${libname}${shared_ext}' +- dynamic_linker="$host_os ld.so" +- shlibpath_var=LIBRARY_PATH +- ;; +- +-bsdi[[45]]*) +- version_type=linux +- 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' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" +- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" +- # the default ld.so.conf also contains /usr/contrib/lib and +- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow +- # libtool to hard-code these into programs +- ;; +- +-cygwin* | mingw* | pw32*) +- version_type=windows +- shrext_cmds=".dll" +- need_version=no +- need_lib_prefix=no +- +- case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32*) +- library_names_spec='$libname.dll.a' +- # DLL is installed to $(libdir)/../bin by postinstall_cmds +- postinstall_cmds='base_file=`basename \${file}`~ +- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ +- dldir=$destdir/`dirname \$dlpath`~ +- test -d \$dldir || mkdir -p \$dldir~ +- $install_prog $dir/$dlname \$dldir/$dlname~ +- chmod a+x \$dldir/$dlname' +- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ +- dlpath=$dir/\$dldll~ +- $rm \$dlpath' +- shlibpath_overrides_runpath=yes +- +- case $host_os in +- cygwin*) +- # Cygwin DLLs use 'cyg' prefix rather than 'lib' +- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +- ;; +- mingw*) +- # MinGW DLLs use traditional 'lib' prefix +- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` +- if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then +- # It is most probably a Windows format PATH printed by +- # mingw gcc, but we are running on Cygwin. Gcc prints its search +- # path with ; separators, and with drive letters. We can handle the +- # drive letters (cygwin fileutils understands them), so leave them, +- # especially as we might pass files found there to a mingw objdump, +- # which wouldn't understand a cygwinified path. Ahh. +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` +- else +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` +- fi +- ;; +- pw32*) +- # pw32 DLLs use 'pw' prefix rather than 'lib' +- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- ;; +- esac +- ;; +- +- *) +- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' +- ;; +- esac +- dynamic_linker='Win32 ld.exe' +- # FIXME: first we should search . and the directory the executable is in +- shlibpath_var=PATH +- ;; +- +-darwin* | rhapsody*) +- dynamic_linker="$host_os dyld" +- version_type=darwin +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' +- soname_spec='${libname}${release}${major}$shared_ext' +- shlibpath_overrides_runpath=yes +- shlibpath_var=DYLD_LIBRARY_PATH +- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. +- if test "$GCC" = yes; then +- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` +- else +- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' +- fi +- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' +- ;; +- +-dgux*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- ;; +- +-freebsd1*) +- dynamic_linker=no +- ;; +- +-kfreebsd*-gnu) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- dynamic_linker='GNU ld.so' +- ;; +- +-freebsd* | dragonfly*) +- # DragonFly does not have aout. When/if they implement a new +- # versioning mechanism, adjust this. +- if test -x /usr/bin/objformat; then +- objformat=`/usr/bin/objformat` +- else +- case $host_os in +- freebsd[[123]]*) objformat=aout ;; +- *) objformat=elf ;; +- esac +- fi +- version_type=freebsd-$objformat +- case $version_type in +- freebsd-elf*) +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' +- need_version=no +- need_lib_prefix=no +- ;; +- freebsd-*) +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' +- need_version=yes +- ;; +- esac +- shlibpath_var=LD_LIBRARY_PATH +- case $host_os in +- freebsd2*) +- shlibpath_overrides_runpath=yes +- ;; +- freebsd3.[[01]]* | freebsdelf3.[[01]]*) +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- ;; +- freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ +- freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- ;; +- freebsd*) # from 4.6 on +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- ;; +- esac +- ;; +- +-gnu*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- hardcode_into_libs=yes +- ;; +- +-hpux9* | hpux10* | hpux11*) +- # Give a soname corresponding to the major version so that dld.sl refuses to +- # link against other versions. +- version_type=sunos +- need_lib_prefix=no +- need_version=no +- case $host_cpu in +- ia64*) +- shrext_cmds='.so' +- hardcode_into_libs=yes +- dynamic_linker="$host_os dld.so" +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- if test "X$HPUX_IA64_MODE" = X32; then +- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" +- else +- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" +- fi +- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec +- ;; +- hppa*64*) +- shrext_cmds='.sl' +- hardcode_into_libs=yes +- dynamic_linker="$host_os dld.sl" +- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH +- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" +- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec +- ;; +- *) +- shrext_cmds='.sl' +- dynamic_linker="$host_os dld.sl" +- shlibpath_var=SHLIB_PATH +- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- ;; +- esac +- # HP-UX runs *really* slowly unless shared libraries are mode 555. +- postinstall_cmds='chmod 555 $lib' +- ;; +- +-interix3*) +- version_type=linux +- need_lib_prefix=no +- 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' +- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- ;; +- +-irix5* | irix6* | nonstopux*) +- case $host_os in +- nonstopux*) version_type=nonstopux ;; +- *) +- if test "$lt_cv_prog_gnu_ld" = yes; then +- version_type=linux +- else +- version_type=irix +- fi ;; +- esac +- need_lib_prefix=no +- need_version=no +- soname_spec='${libname}${release}${shared_ext}$major' +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' +- case $host_os in +- irix5* | nonstopux*) +- libsuff= shlibsuff= +- ;; +- *) +- case $LD in # libtool.m4 will add one of these switches to LD +- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") +- libsuff= shlibsuff= libmagic=32-bit;; +- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") +- libsuff=32 shlibsuff=N32 libmagic=N32;; +- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") +- libsuff=64 shlibsuff=64 libmagic=64-bit;; +- *) libsuff= shlibsuff= libmagic=never-match;; +- esac +- ;; +- esac +- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH +- shlibpath_overrides_runpath=no +- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" +- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" +- hardcode_into_libs=yes +- ;; +- +-# No shared lib support for Linux oldld, aout, or coff. +-linux*oldld* | linux*aout* | linux*coff*) +- dynamic_linker=no +- ;; +- +-# This must be Linux ELF. +-linux*) +- version_type=linux +- need_lib_prefix=no +- 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' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- # This implies no fast_install, which is unacceptable. +- # Some rework will be needed to allow for fast_install +- # before this can be enabled. +- hardcode_into_libs=yes +- +- # Append ld.so.conf contents to the search path +- if test -f /etc/ld.so.conf; then +- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" +- fi +- +- # We used to test for /lib/ld.so.1 and disable shared libraries on +- # powerpc, because MkLinux only supported shared libraries with the +- # GNU dynamic linker. Since this was broken with cross compilers, +- # most powerpc-linux boxes support dynamic linking these days and +- # people can always --disable-shared, the test was removed, and we +- # assume the GNU/Linux dynamic linker is in use. +- dynamic_linker='GNU/Linux ld.so' +- ;; +- +-knetbsd*-gnu) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- dynamic_linker='GNU ld.so' +- ;; +- +-netbsd*) +- version_type=sunos +- need_lib_prefix=no +- need_version=no +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' +- dynamic_linker='NetBSD (a.out) ld.so' +- else +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- dynamic_linker='NetBSD ld.elf_so' +- fi +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- ;; +- +-newsos6) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- ;; +- +-nto-qnx*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- ;; +- +-openbsd*) +- version_type=sunos +- sys_lib_dlsearch_path_spec="/usr/lib" +- need_lib_prefix=no +- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. +- case $host_os in +- openbsd3.3 | openbsd3.3.*) need_version=yes ;; +- *) need_version=no ;; +- esac +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- case $host_os in +- openbsd2.[[89]] | openbsd2.[[89]].*) +- shlibpath_overrides_runpath=no +- ;; +- *) +- shlibpath_overrides_runpath=yes +- ;; +- esac +- else +- shlibpath_overrides_runpath=yes +- fi +- ;; +- +-os2*) +- libname_spec='$name' +- shrext_cmds=".dll" +- need_lib_prefix=no +- library_names_spec='$libname${shared_ext} $libname.a' +- dynamic_linker='OS/2 ld.exe' +- shlibpath_var=LIBPATH +- ;; +- +-osf3* | osf4* | osf5*) +- version_type=osf +- need_lib_prefix=no +- need_version=no +- soname_spec='${libname}${release}${shared_ext}$major' +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" +- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" +- ;; +- +-solaris*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- # ldd complains unless libraries are executable +- postinstall_cmds='chmod +x $lib' +- ;; +- +-sunos4*) +- version_type=sunos +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- if test "$with_gnu_ld" = yes; then +- need_lib_prefix=no +- fi +- need_version=yes +- ;; +- +-sysv4 | sysv4.3*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- case $host_vendor in +- sni) +- shlibpath_overrides_runpath=no +- need_lib_prefix=no +- export_dynamic_flag_spec='${wl}-Blargedynsym' +- runpath_var=LD_RUN_PATH +- ;; +- siemens) +- need_lib_prefix=no +- ;; +- motorola) +- need_lib_prefix=no +- need_version=no +- shlibpath_overrides_runpath=no +- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' +- ;; +- esac +- ;; +- +-sysv4*MP*) +- if test -d /usr/nec ;then +- version_type=linux +- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' +- soname_spec='$libname${shared_ext}.$major' +- shlibpath_var=LD_LIBRARY_PATH +- fi +- ;; +- +-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) +- version_type=freebsd-elf +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- hardcode_into_libs=yes +- if test "$with_gnu_ld" = yes; then +- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' +- shlibpath_overrides_runpath=no +- else +- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' +- shlibpath_overrides_runpath=yes +- case $host_os in +- sco3.2v5*) +- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" +- ;; +- esac +- fi +- sys_lib_dlsearch_path_spec='/usr/lib' +- ;; +- +-uts4*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- ;; +- +-*) +- dynamic_linker=no +- ;; +-esac +-AC_MSG_RESULT([$dynamic_linker]) +-test "$dynamic_linker" = no && can_build_shared=no +- +-variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +-if test "$GCC" = yes; then +- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +-fi +-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER +- +- +-# _LT_AC_TAGCONFIG +-# ---------------- +-AC_DEFUN([_LT_AC_TAGCONFIG], +-[AC_ARG_WITH([tags], +- [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], +- [include additional configurations @<:@automatic@:>@])], +- [tagnames="$withval"]) +- +-if test -f "$ltmain" && test -n "$tagnames"; then +- if test ! -f "${ofile}"; then +- AC_MSG_WARN([output file `$ofile' does not exist]) +- fi +- +- if test -z "$LTCC"; then +- eval "`$SHELL ${ofile} --config | grep '^LTCC='`" +- if test -z "$LTCC"; then +- AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) +- else +- AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) +- fi +- fi +- if test -z "$LTCFLAGS"; then +- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" +- fi +- +- # Extract list of available tagged configurations in $ofile. +- # Note that this assumes the entire list is on one line. +- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` +- +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for tagname in $tagnames; do +- IFS="$lt_save_ifs" +- # Check whether tagname contains only valid characters +- case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in +- "") ;; +- *) AC_MSG_ERROR([invalid tag name: $tagname]) +- ;; +- esac +- +- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null +- then +- AC_MSG_ERROR([tag name \"$tagname\" already exists]) +- fi +- +- # Update the list of available tags. +- if test -n "$tagname"; then +- echo appending configuration tag \"$tagname\" to $ofile +- +- case $tagname in +- CXX) +- if test -n "$CXX" && ( test "X$CXX" != "Xno" && +- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || +- (test "X$CXX" != "Xg++"))) ; then +- AC_LIBTOOL_LANG_CXX_CONFIG +- else +- tagname="" +- fi +- ;; +- +- F77) +- if test -n "$F77" && test "X$F77" != "Xno"; then +- AC_LIBTOOL_LANG_F77_CONFIG +- else +- tagname="" +- fi +- ;; +- +- GCJ) +- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then +- AC_LIBTOOL_LANG_GCJ_CONFIG +- else +- tagname="" +- fi +- ;; +- +- RC) +- AC_LIBTOOL_LANG_RC_CONFIG +- ;; +- +- *) +- AC_MSG_ERROR([Unsupported tag name: $tagname]) +- ;; +- esac +- +- # Append the new tag name to the list of available tags. +- if test -n "$tagname" ; then +- available_tags="$available_tags $tagname" +- fi +- fi +- done +- IFS="$lt_save_ifs" +- +- # Now substitute the updated list of available tags. +- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then +- mv "${ofile}T" "$ofile" +- chmod +x "$ofile" +- else +- rm -f "${ofile}T" +- AC_MSG_ERROR([unable to update list of available tagged configurations.]) +- fi +-fi +-])# _LT_AC_TAGCONFIG +- +- +-# AC_LIBTOOL_DLOPEN +-# ----------------- +-# enable checks for dlopen support +-AC_DEFUN([AC_LIBTOOL_DLOPEN], +- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +-])# AC_LIBTOOL_DLOPEN +- +- +-# AC_LIBTOOL_WIN32_DLL +-# -------------------- +-# declare package support for building win32 DLLs +-AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +-])# AC_LIBTOOL_WIN32_DLL +- +- +-# AC_ENABLE_SHARED([DEFAULT]) +-# --------------------------- +-# implement the --enable-shared flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_SHARED], +-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([shared], +- [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], +- [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_shared=yes ;; +- no) enable_shared=no ;; +- *) +- enable_shared=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_shared=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +-])# AC_ENABLE_SHARED +- +- +-# AC_DISABLE_SHARED +-# ----------------- +-# set the default shared flag to --disable-shared +-AC_DEFUN([AC_DISABLE_SHARED], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_SHARED(no) +-])# AC_DISABLE_SHARED +- +- +-# AC_ENABLE_STATIC([DEFAULT]) +-# --------------------------- +-# implement the --enable-static flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_STATIC], +-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([static], +- [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], +- [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_static=yes ;; +- no) enable_static=no ;; +- *) +- enable_static=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_static=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_static=]AC_ENABLE_STATIC_DEFAULT) +-])# AC_ENABLE_STATIC +- +- +-# AC_DISABLE_STATIC +-# ----------------- +-# set the default static flag to --disable-static +-AC_DEFUN([AC_DISABLE_STATIC], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_STATIC(no) +-])# AC_DISABLE_STATIC +- +- +-# AC_ENABLE_FAST_INSTALL([DEFAULT]) +-# --------------------------------- +-# implement the --enable-fast-install flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_FAST_INSTALL], +-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([fast-install], +- [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], +- [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_fast_install=yes ;; +- no) enable_fast_install=no ;; +- *) +- enable_fast_install=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_fast_install=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +-])# AC_ENABLE_FAST_INSTALL +- +- +-# AC_DISABLE_FAST_INSTALL +-# ----------------------- +-# set the default to --disable-fast-install +-AC_DEFUN([AC_DISABLE_FAST_INSTALL], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_FAST_INSTALL(no) +-])# AC_DISABLE_FAST_INSTALL +- +- +-# AC_LIBTOOL_PICMODE([MODE]) +-# -------------------------- +-# implement the --with-pic flag +-# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +-AC_DEFUN([AC_LIBTOOL_PICMODE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-pic_mode=ifelse($#,1,$1,default) +-])# AC_LIBTOOL_PICMODE +- +- +-# AC_PROG_EGREP +-# ------------- +-# This is predefined starting with Autoconf 2.54, so this conditional +-# definition can be removed once we require Autoconf 2.54 or later. +-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], +- [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 +- then ac_cv_prog_egrep='grep -E' +- else ac_cv_prog_egrep='egrep' +- fi]) +- EGREP=$ac_cv_prog_egrep +- AC_SUBST([EGREP]) +-])]) +- +- +-# AC_PATH_TOOL_PREFIX +-# ------------------- +-# find a file program which can recognise shared library +-AC_DEFUN([AC_PATH_TOOL_PREFIX], +-[AC_REQUIRE([AC_PROG_EGREP])dnl +-AC_MSG_CHECKING([for $1]) +-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +-[case $MAGIC_CMD in +-[[\\/*] | ?:[\\/]*]) +- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. +- ;; +-*) +- lt_save_MAGIC_CMD="$MAGIC_CMD" +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +-dnl $ac_dummy forces splitting on constant user-supplied paths. +-dnl POSIX.2 word splitting is done only on the output of word expansions, +-dnl not every word. This closes a longstanding sh security hole. +- ac_dummy="ifelse([$2], , $PATH, [$2])" +- for ac_dir in $ac_dummy; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$1; then +- lt_cv_path_MAGIC_CMD="$ac_dir/$1" +- if test -n "$file_magic_test_file"; then +- case $deplibs_check_method in +- "file_magic "*) +- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` +- MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | +- $EGREP "$file_magic_regex" > /dev/null; then +- : +- else +- cat <&2 +- +-*** Warning: the command libtool uses to detect shared libraries, +-*** $file_magic_cmd, produces output that libtool cannot recognize. +-*** The result is that libtool may fail to recognize shared libraries +-*** as such. This will affect the creation of libtool libraries that +-*** depend on shared libraries, but programs linked with such libtool +-*** libraries will work regardless of this problem. Nevertheless, you +-*** may want to report the problem to your system manager and/or to +-*** bug-libtool@gnu.org +- +-EOF +- fi ;; +- esac +- fi +- break +- fi +- done +- IFS="$lt_save_ifs" +- MAGIC_CMD="$lt_save_MAGIC_CMD" +- ;; +-esac]) +-MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +-if test -n "$MAGIC_CMD"; then +- AC_MSG_RESULT($MAGIC_CMD) +-else +- AC_MSG_RESULT(no) +-fi +-])# AC_PATH_TOOL_PREFIX +- +- +-# AC_PATH_MAGIC +-# ------------- +-# find a file program which can recognise a shared library +-AC_DEFUN([AC_PATH_MAGIC], +-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +-if test -z "$lt_cv_path_MAGIC_CMD"; then +- if test -n "$ac_tool_prefix"; then +- AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) +- else +- MAGIC_CMD=: +- fi +-fi +-])# AC_PATH_MAGIC +- +- +-# AC_PROG_LD +-# ---------- +-# find the pathname to the GNU or non-GNU linker +-AC_DEFUN([AC_PROG_LD], +-[AC_ARG_WITH([gnu-ld], +- [AC_HELP_STRING([--with-gnu-ld], +- [assume the C compiler uses GNU ld @<:@default=no@:>@])], +- [test "$withval" = no || with_gnu_ld=yes], +- [with_gnu_ld=no]) +-AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_REQUIRE([AC_PROG_CC])dnl +-AC_REQUIRE([AC_CANONICAL_HOST])dnl +-AC_REQUIRE([AC_CANONICAL_BUILD])dnl +-ac_prog=ld +-if test "$GCC" = yes; then +- # Check if gcc -print-prog-name=ld gives a path. +- AC_MSG_CHECKING([for ld used by $CC]) +- case $host in +- *-*-mingw*) +- # gcc leaves a trailing carriage return which upsets mingw +- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; +- *) +- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; +- esac +- case $ac_prog in +- # Accept absolute paths. +- [[\\/]]* | ?:[[\\/]]*) +- re_direlt='/[[^/]][[^/]]*/\.\./' +- # Canonicalize the pathname of ld +- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` +- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do +- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` +- done +- test -z "$LD" && LD="$ac_prog" +- ;; +- "") +- # If it fails, then pretend we aren't using GCC. +- ac_prog=ld +- ;; +- *) +- # If it is relative, then search for the first ld in PATH. +- with_gnu_ld=unknown +- ;; +- esac +-elif test "$with_gnu_ld" = yes; then +- AC_MSG_CHECKING([for GNU ld]) +-else +- AC_MSG_CHECKING([for non-GNU ld]) +-fi +-AC_CACHE_VAL(lt_cv_path_LD, +-[if test -z "$LD"; then +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for ac_dir in $PATH; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then +- lt_cv_path_LD="$ac_dir/$ac_prog" +- # Check to see if the program is GNU ld. I'd rather use --version, +- # but apparently some variants of GNU ld only accept -v. +- # Break only if it was the GNU/non-GNU ld that we prefer. +- case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then +- case $host_cpu in +- i*86 ) +- # Not sure whether the presence of OpenBSD here was a mistake. +- # Let's accept both of them until this is cleared up. +- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' +- lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` +- ;; +- esac +- else +- lt_cv_deplibs_check_method=pass_all +- fi +- ;; +- +-gnu*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-hpux10.20* | hpux11*) +- lt_cv_file_magic_cmd=/usr/bin/file +- case $host_cpu in +- ia64*) +- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' +- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so +- ;; +- hppa*64*) +- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] +- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl +- ;; +- *) +- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' +- lt_cv_file_magic_test_file=/usr/lib/libc.sl +- ;; +- esac +- ;; +- +-interix3*) +- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' +- ;; +- +-irix5* | irix6* | nonstopux*) +- case $LD in +- *-32|*"-32 ") libmagic=32-bit;; +- *-n32|*"-n32 ") libmagic=N32;; +- *-64|*"-64 ") libmagic=64-bit;; +- *) libmagic=never-match;; +- esac +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-# This must be Linux ELF. +-linux*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-netbsd*) +- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' +- else +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' +- fi +- ;; +- +-newos6*) +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' +- lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=/usr/lib/libnls.so +- ;; +- +-nto-qnx*) +- lt_cv_deplibs_check_method=unknown +- ;; +- +-openbsd*) +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' +- else +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' +- fi +- ;; +- +-osf3* | osf4* | osf5*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-solaris*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-sysv4 | sysv4.3*) +- case $host_vendor in +- motorola) +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' +- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` +- ;; +- ncr) +- lt_cv_deplibs_check_method=pass_all +- ;; +- sequent) +- lt_cv_file_magic_cmd='/bin/file' +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' +- ;; +- sni) +- lt_cv_file_magic_cmd='/bin/file' +- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" +- lt_cv_file_magic_test_file=/lib/libc.so +- ;; +- siemens) +- lt_cv_deplibs_check_method=pass_all +- ;; +- pc) +- lt_cv_deplibs_check_method=pass_all +- ;; +- esac +- ;; +- +-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) +- lt_cv_deplibs_check_method=pass_all +- ;; +-esac +-]) +-file_magic_cmd=$lt_cv_file_magic_cmd +-deplibs_check_method=$lt_cv_deplibs_check_method +-test -z "$deplibs_check_method" && deplibs_check_method=unknown +-])# AC_DEPLIBS_CHECK_METHOD +- +- +-# AC_PROG_NM +-# ---------- +-# find the pathname to a BSD-compatible name lister +-AC_DEFUN([AC_PROG_NM], +-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +-[if test -n "$NM"; then +- # Let the user override the test. +- lt_cv_path_NM="$NM" +-else +- lt_nm_to_check="${ac_tool_prefix}nm" +- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then +- lt_nm_to_check="$lt_nm_to_check nm" +- fi +- for lt_tmp_nm in $lt_nm_to_check; do +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- tmp_nm="$ac_dir/$lt_tmp_nm" +- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then +- # Check to see if the nm accepts a BSD-compat flag. +- # Adding the `sed 1q' prevents false positives on HP-UX, which says: +- # nm: unknown option "B" ignored +- # Tru64's nm complains that /dev/null is an invalid object file +- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in +- */dev/null* | *'Invalid file or object type'*) +- lt_cv_path_NM="$tmp_nm -B" +- break +- ;; +- *) +- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in +- */dev/null*) +- lt_cv_path_NM="$tmp_nm -p" +- break +- ;; +- *) +- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but +- continue # so that we can try to find one that supports BSD flags +- ;; +- esac +- ;; +- esac +- fi +- done +- IFS="$lt_save_ifs" +- done +- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +-fi]) +-NM="$lt_cv_path_NM" +-])# AC_PROG_NM +- +- +-# AC_CHECK_LIBM +-# ------------- +-# check for math library +-AC_DEFUN([AC_CHECK_LIBM], +-[AC_REQUIRE([AC_CANONICAL_HOST])dnl +-LIBM= +-case $host in +-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) +- # These system don't have libm, or don't need it +- ;; +-*-ncr-sysv4.3*) +- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") +- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") +- ;; +-*) +- AC_CHECK_LIB(m, cos, LIBM="-lm") +- ;; +-esac +-])# AC_CHECK_LIBM +- +- +-# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +-# ----------------------------------- +-# sets LIBLTDL to the link flags for the libltdl convenience library and +-# LTDLINCL to the include flags for the libltdl header and adds +-# --enable-ltdl-convenience to the configure arguments. Note that +-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +-# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +-# (note the single quotes!). If your package is not flat and you're not +-# using automake, define top_builddir and top_srcdir appropriately in +-# the Makefiles. +-AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +- case $enable_ltdl_convenience in +- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; +- "") enable_ltdl_convenience=yes +- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; +- esac +- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la +- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +- # For backwards non-gettext consistent compatibility... +- INCLTDL="$LTDLINCL" +-])# AC_LIBLTDL_CONVENIENCE +- +- +-# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +-# ----------------------------------- +-# sets LIBLTDL to the link flags for the libltdl installable library and +-# LTDLINCL to the include flags for the libltdl header and adds +-# --enable-ltdl-install to the configure arguments. Note that +-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +-# and an installed libltdl is not found, it is assumed to be `libltdl'. +-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +-# '${top_srcdir}/' (note the single quotes!). If your package is not +-# flat and you're not using automake, define top_builddir and top_srcdir +-# appropriately in the Makefiles. +-# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +-AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +- AC_CHECK_LIB(ltdl, lt_dlinit, +- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], +- [if test x"$enable_ltdl_install" = xno; then +- AC_MSG_WARN([libltdl not installed, but installation disabled]) +- else +- enable_ltdl_install=yes +- fi +- ]) +- if test x"$enable_ltdl_install" = x"yes"; then +- ac_configure_args="$ac_configure_args --enable-ltdl-install" +- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la +- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +- else +- ac_configure_args="$ac_configure_args --enable-ltdl-install=no" +- LIBLTDL="-lltdl" +- LTDLINCL= +- fi +- # For backwards non-gettext consistent compatibility... +- INCLTDL="$LTDLINCL" +-])# AC_LIBLTDL_INSTALLABLE +- +- +-# AC_LIBTOOL_CXX +-# -------------- +-# enable support for C++ libraries +-AC_DEFUN([AC_LIBTOOL_CXX], +-[AC_REQUIRE([_LT_AC_LANG_CXX]) +-])# AC_LIBTOOL_CXX +- +- +-# _LT_AC_LANG_CXX +-# --------------- +-AC_DEFUN([_LT_AC_LANG_CXX], +-[AC_REQUIRE([AC_PROG_CXX]) +-AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +-])# _LT_AC_LANG_CXX +- +-# _LT_AC_PROG_CXXCPP +-# ------------------ +-AC_DEFUN([_LT_AC_PROG_CXXCPP], +-[ +-AC_REQUIRE([AC_PROG_CXX]) +-if test -n "$CXX" && ( test "X$CXX" != "Xno" && +- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || +- (test "X$CXX" != "Xg++"))) ; then +- AC_PROG_CXXCPP +-fi +-])# _LT_AC_PROG_CXXCPP +- +-# AC_LIBTOOL_F77 +-# -------------- +-# enable support for Fortran 77 libraries +-AC_DEFUN([AC_LIBTOOL_F77], +-[AC_REQUIRE([_LT_AC_LANG_F77]) +-])# AC_LIBTOOL_F77 +- +- +-# _LT_AC_LANG_F77 +-# --------------- +-AC_DEFUN([_LT_AC_LANG_F77], +-[AC_REQUIRE([AC_PROG_F77]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +-])# _LT_AC_LANG_F77 +- +- +-# AC_LIBTOOL_GCJ +-# -------------- +-# enable support for GCJ libraries +-AC_DEFUN([AC_LIBTOOL_GCJ], +-[AC_REQUIRE([_LT_AC_LANG_GCJ]) +-])# AC_LIBTOOL_GCJ +- +- +-# _LT_AC_LANG_GCJ +-# --------------- +-AC_DEFUN([_LT_AC_LANG_GCJ], +-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], +- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], +- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], +- [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], +- [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], +- [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +-])# _LT_AC_LANG_GCJ +- +- +-# AC_LIBTOOL_RC +-# ------------- +-# enable support for Windows resource files +-AC_DEFUN([AC_LIBTOOL_RC], +-[AC_REQUIRE([LT_AC_PROG_RC]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +-])# AC_LIBTOOL_RC +- +- +-# AC_LIBTOOL_LANG_C_CONFIG +-# ------------------------ +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +-AC_DEFUN([_LT_AC_LANG_C_CONFIG], +-[lt_save_CC="$CC" +-AC_LANG_PUSH(C) +- +-# Source file extension for C test sources. +-ac_ext=c +- +-# Object file extension for compiled C test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="int some_variable = 0;\n" +- +-# Code to be used in simple link tests +-lt_simple_link_test_code='int main(){return(0);}\n' +- +-_LT_AC_SYS_COMPILER +- +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE +- +-## CAVEAT EMPTOR: +-## There is no encapsulation within the following macros, do not change +-## the running order or otherwise move them around unless you know exactly +-## what you are doing... +-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +-AC_LIBTOOL_SYS_LIB_STRIP +-AC_LIBTOOL_DLOPEN_SELF +- +-# Report which library types will actually be built +-AC_MSG_CHECKING([if libtool supports shared libraries]) +-AC_MSG_RESULT([$can_build_shared]) +- +-AC_MSG_CHECKING([whether to build shared libraries]) +-test "$can_build_shared" = "no" && enable_shared=no +- +-# On AIX, shared libraries and static libraries use the same namespace, and +-# are all built from PIC. +-case $host_os in +-aix3*) +- test "$enable_shared" = yes && enable_static=no +- if test -n "$RANLIB"; then +- archive_cmds="$archive_cmds~\$RANLIB \$lib" +- postinstall_cmds='$RANLIB $lib' +- fi +- ;; +- +-aix4* | aix5*) +- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then +- test "$enable_shared" = yes && enable_static=no +- fi +- ;; +-esac +-AC_MSG_RESULT([$enable_shared]) +- +-AC_MSG_CHECKING([whether to build static libraries]) +-# Make sure either enable_shared or enable_static is yes. +-test "$enable_shared" = yes || enable_static=yes +-AC_MSG_RESULT([$enable_static]) +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_POP +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_C_CONFIG +- +- +-# AC_LIBTOOL_LANG_CXX_CONFIG +-# -------------------------- +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +-[AC_LANG_PUSH(C++) +-AC_REQUIRE([AC_PROG_CXX]) +-AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +- +-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +-_LT_AC_TAGVAR(allow_undefined_flag, $1)= +-_LT_AC_TAGVAR(always_export_symbols, $1)=no +-_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_direct, $1)=no +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +-_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +-_LT_AC_TAGVAR(hardcode_automatic, $1)=no +-_LT_AC_TAGVAR(module_cmds, $1)= +-_LT_AC_TAGVAR(module_expsym_cmds, $1)= +-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +-_LT_AC_TAGVAR(no_undefined_flag, $1)= +-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +- +-# Dependencies to place before and after the object being linked: +-_LT_AC_TAGVAR(predep_objects, $1)= +-_LT_AC_TAGVAR(postdep_objects, $1)= +-_LT_AC_TAGVAR(predeps, $1)= +-_LT_AC_TAGVAR(postdeps, $1)= +-_LT_AC_TAGVAR(compiler_lib_search_path, $1)= +- +-# Source file extension for C++ test sources. +-ac_ext=cpp +- +-# Object file extension for compiled C++ test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="int some_variable = 0;\n" +- +-# Code to be used in simple link tests +-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' +- +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER +- +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE +- +-# Allow CC to be a program name with arguments. +-lt_save_CC=$CC +-lt_save_LD=$LD +-lt_save_GCC=$GCC +-GCC=$GXX +-lt_save_with_gnu_ld=$with_gnu_ld +-lt_save_path_LD=$lt_cv_path_LD +-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then +- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +-else +- $as_unset lt_cv_prog_gnu_ld +-fi +-if test -n "${lt_cv_path_LDCXX+set}"; then +- lt_cv_path_LD=$lt_cv_path_LDCXX +-else +- $as_unset lt_cv_path_LD +-fi +-test -z "${LDCXX+set}" || LD=$LDCXX +-CC=${CXX-"c++"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +- +-# We don't want -fno-exception wen compiling C++ code, so set the +-# no_builtin_flag separately +-if test "$GXX" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +-else +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +-fi +- +-if test "$GXX" = yes; then +- # Set up default GNU C++ configuration +- +- AC_PROG_LD +- +- # Check if GNU C++ uses GNU ld as the underlying linker, since the +- # archiving commands below assume that GNU ld is being used. +- if test "$with_gnu_ld" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- +- # If archive_cmds runs LD, not CC, wlarc should be empty +- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to +- # investigate it a little bit more. (MM) +- wlarc='${wl}' +- +- # ancient GNU ld didn't support --whole-archive et. al. +- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ +- grep 'no-whole-archive' > /dev/null; then +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' +- else +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- else +- with_gnu_ld=no +- wlarc= +- +- # A generic and very simple default shared library creation +- # command for GNU C++ for the case where it uses the native +- # linker, instead of GNU ld. If possible, this setting should +- # overridden to take advantage of the native linker features on +- # the platform it is being used on. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' +- fi +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +- +-else +- GXX=no +- with_gnu_ld=no +- wlarc= +-fi +- +-# PORTME: fill in a description of your system's C++ link characteristics +-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +-_LT_AC_TAGVAR(ld_shlibs, $1)=yes +-case $host_os in +- aix3*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aix4* | aix5*) +- if test "$host_cpu" = ia64; then +- # On IA64, the linker does run time linking by default, so we don't +- # have to do anything special. +- aix_use_runtimelinking=no +- exp_sym_flag='-Bexport' +- no_entry_flag="" +- else +- aix_use_runtimelinking=no +- +- # Test if we are trying to use run time linking or normal +- # AIX style linking. If -brtl is somewhere in LDFLAGS, we +- # need to do runtime linking. +- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) +- for ld_flag in $LDFLAGS; do +- case $ld_flag in +- *-brtl*) +- aix_use_runtimelinking=yes +- break +- ;; +- esac +- done +- ;; +- esac +- +- exp_sym_flag='-bexport' +- no_entry_flag='-bnoentry' +- fi +- +- # When large executables or shared objects are built, AIX ld can +- # have problems creating the table of contents. If linking a library +- # or program results in "error TOC overflow" add -mminimal-toc to +- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not +- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. +- +- _LT_AC_TAGVAR(archive_cmds, $1)='' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- +- if test "$GXX" = yes; then +- case $host_os in aix4.[[012]]|aix4.[[012]].*) +- # We only want to do this on AIX 4.2 and lower, the check +- # below for broken collect2 doesn't work under 4.3+ +- collect2name=`${CC} -print-prog-name=collect2` +- if test -f "$collect2name" && \ +- strings "$collect2name" | grep resolve_lib_name >/dev/null +- then +- # We have reworked collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- else +- # We have old collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- # It fails to find uninstalled libraries when the uninstalled +- # path is not listed in the libpath. Setting hardcode_minus_L +- # to unsupported forces relinking +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- fi +- ;; +- esac +- shared_flag='-shared' +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag="$shared_flag "'${wl}-G' +- fi +- else +- # not using gcc +- if test "$host_cpu" = ia64; then +- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release +- # chokes on -Wl,-G. The following line is correct: +- shared_flag='-G' +- else +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag='${wl}-G' +- else +- shared_flag='${wl}-bM:SRE' +- fi +- fi +- fi +- +- # It seems that -bexpall does not export symbols beginning with +- # underscore (_), so it is better to generate a list of symbols to export. +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- if test "$aix_use_runtimelinking" = yes; then +- # Warning - without using the other runtime loading flags (-brtl), +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +- else +- if test "$host_cpu" = ia64; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" +- else +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- # Warning - without using the other run time loading flags, +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' +- # Exported symbols can be pulled into shared objects from archives +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- # This is similar to how AIX traditionally builds its shared libraries. +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' +- fi +- fi +- ;; +- +- beos*) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Joseph Beckenbach says some releases of gcc +- # support --undefined. This deserves some investigation. FIXME +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- chorus*) +- case $cc_basename in +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- +- cygwin* | mingw* | pw32*) +- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, +- # as there is no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- +- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- darwin* | rhapsody*) +- case $host_os in +- rhapsody* | darwin1.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' +- ;; +- *) # Darwin 1.3 on +- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- else +- case ${MACOSX_DEPLOYMENT_TARGET} in +- 10.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- ;; +- 10.*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' +- ;; +- esac +- fi +- ;; +- esac +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- +- if test "$GXX" = yes ; then +- lt_int_apple_cc_single_mod=no +- output_verbose_link_cmd='echo' +- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then +- lt_int_apple_cc_single_mod=yes +- fi +- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' +- fi +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- else +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- fi +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- else +- case $cc_basename in +- xlc*) +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- ;; +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +- ;; +- +- dgux*) +- case $cc_basename in +- ec++*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- ghcx*) +- # Green Hills C++ Compiler +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- freebsd[[12]]*) +- # C++ shared libraries reported to be fairly broken before switch to ELF +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- freebsd-elf*) +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- ;; +- freebsd* | kfreebsd*-gnu | dragonfly*) +- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF +- # conventions +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- ;; +- gnu*) +- ;; +- hpux9*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, +- # but as the default +- # location of the library. +- +- case $cc_basename in +- CC*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aCC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- hpux10*|hpux11*) +- if test $with_gnu_ld = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- case $host_cpu in +- hppa*64*|ia64*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' +- ;; +- *) +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- ;; +- esac +- fi +- case $host_cpu in +- hppa*64*|ia64*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- *) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, +- # but as the default +- # location of the library. +- ;; +- esac +- +- case $cc_basename in +- CC*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aCC*) +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- esac +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes; then +- if test $with_gnu_ld = no; then +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- esac +- fi +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- interix3*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. +- # Instead, shared libraries are loaded at an image base (0x10000000 by +- # default) and relocated if they conflict, which is a slow very memory +- # consuming and fragmenting process. To avoid this, we pick a random, +- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link +- # time. Moving up from 0x10000000 also allows more sbrk(2) space. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- ;; +- irix5* | irix6*) +- case $cc_basename in +- CC*) +- # SGI C++ +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- +- # Archives containing C++ object files must be created using +- # "CC -ar", where "CC" is the IRIX C++ compiler. This is +- # necessary to make sure instantiated templates are included +- # in the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' +- ;; +- *) +- if test "$GXX" = yes; then +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' +- fi +- fi +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; +- esac +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- ;; +- linux*) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- +- # Archives containing C++ object files must be created using +- # "CC -Bstatic", where "CC" is the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' +- ;; +- icpc*) +- # Intel C++ +- with_gnu_ld=yes +- # version 8.0 and above of icpc choke on multiply defined symbols +- # if we add $predep_objects and $postdep_objects, however 7.1 and +- # earlier do not add the objects themselves. +- case `$CC -V 2>&1` in +- *"Version 7."*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- ;; +- *) # Version 8.0 or newer +- tmp_idyn= +- case $host_cpu in +- ia64*) tmp_idyn=' -i_dynamic';; +- esac +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- ;; +- esac +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' +- ;; +- pgCC*) +- # Portland Group C++ compiler +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- ;; +- cxx*) +- # Compaq C++ +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' +- +- runpath_var=LD_RUN_PATH +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- esac +- ;; +- lynxos*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- m88k*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- mvs*) +- case $cc_basename in +- cxx*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- netbsd*) +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' +- wlarc= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- fi +- # Workaround some broken pre-1.5 toolchains +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' +- ;; +- openbsd2*) +- # C++ shared libraries are fairly broken +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- openbsd*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' +- fi +- output_verbose_link_cmd='echo' +- ;; +- osf3*) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Archives containing C++ object files must be created using +- # "CC -Bstatic", where "CC" is the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' +- +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- cxx*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +- +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- osf4* | osf5*) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Archives containing C++ object files must be created using +- # the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- cxx*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ +- echo "-hidden">> $lib.exp~ +- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ +- $rm $lib.exp' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +- +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- psos*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- sunos4*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.x +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- lcc*) +- # Lucid +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- solaris*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.2, 5.x and Centerline C++ +- _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- case $host_os in +- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; +- *) +- # The C++ compiler is used as linker so we must use $wl +- # flag to pass the commands to the underlying system +- # linker. We must also pass each convience library through +- # to the system linker between allextract/defaultextract. +- # The C++ compiler will combine linker options so we +- # cannot just pass the convience library names through +- # without $wl. +- # Supported since Solaris 2.6 (maybe 2.5.1?) +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' +- ;; +- esac +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- +- output_verbose_link_cmd='echo' +- +- # Archives containing C++ object files must be created using +- # "CC -xar", where "CC" is the Sun C++ compiler. This is +- # necessary to make sure instantiated templates are included +- # in the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' +- ;; +- gcx*) +- # Green Hills C++ Compiler +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +- +- # The C++ compiler must be used to create the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' +- ;; +- *) +- # GNU C++ compiler with Solaris linker +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' +- if $CC --version | grep -v '^2\.7' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" +- else +- # g++ 2.7 appears to require `-G' NOT `-shared' on this +- # platform. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" +- fi +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' +- fi +- ;; +- esac +- ;; +- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var='LD_RUN_PATH' +- +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- ;; +- sysv5* | sco3.2v5* | sco5v6*) +- # Note: We can NOT use -z defs as we might desire, because we do not +- # link with -lc, and that would cause any symbols used from libc to +- # always be unresolved, which means just about no library would +- # ever link correctly. If we're not using GNU ld we use -z text +- # though, which does catch some bad symbols but isn't as heavy-handed +- # as -z defs. +- # For security reasons, it is highly recommended that you always +- # use absolute paths for naming shared libraries, and exclude the +- # DT_RUNPATH tag from executables and libraries. But doing so +- # requires that you compile everything twice, which is a pain. +- # So that behaviour is only enabled if SCOABSPATH is set to a +- # non-empty value in the environment. Most likely only useful for +- # creating official distributions of packages. +- # This is a hack until libtool officially supports absolute path +- # names for shared libraries. +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' +- runpath_var='LD_RUN_PATH' +- +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- ;; +- tandem*) +- case $cc_basename in +- NCC*) +- # NonStop-UX NCC 3.20 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- vxworks*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +-esac +-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no +- +-_LT_AC_TAGVAR(GCC, $1)="$GXX" +-_LT_AC_TAGVAR(LD, $1)="$LD" +- +-## CAVEAT EMPTOR: +-## There is no encapsulation within the following macros, do not change +-## the running order or otherwise move them around unless you know exactly +-## what you are doing... +-AC_LIBTOOL_POSTDEP_PREDEP($1) +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_POP +-CC=$lt_save_CC +-LDCXX=$LD +-LD=$lt_save_LD +-GCC=$lt_save_GCC +-with_gnu_ldcxx=$with_gnu_ld +-with_gnu_ld=$lt_save_with_gnu_ld +-lt_cv_path_LDCXX=$lt_cv_path_LD +-lt_cv_path_LD=$lt_save_path_LD +-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +-])# AC_LIBTOOL_LANG_CXX_CONFIG +- +-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +-# ------------------------------------ +-# Figure out "hidden" library dependencies from verbose +-# compiler output when linking a shared library. +-# Parse the compiler output and extract the necessary +-# objects, libraries and library flags. +-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +-dnl we can't use the lt_simple_compile_test_code here, +-dnl because it contains code intended for an executable, +-dnl not a library. It's possible we should let each +-dnl tag define a new lt_????_link_test_code variable, +-dnl but it's only used here... +-ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" +-ifelse([$1], [], +-[#! $SHELL +- +-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +-# NOTE: Changes made to this file will be lost: look at ltmain.sh. +-# +-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +-# Free Software Foundation, Inc. +-# +-# This file is part of GNU Libtool: +-# Originally by Gordon Matzigkeit , 1996 +-# +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2 of the License, or +-# (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, but +-# WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-# General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-# As a special exception to the GNU General Public License, if you +-# distribute this file as part of a program that contains a +-# configuration script generated by Autoconf, you may include it under +-# the same distribution terms that you use for the rest of that program. +- +-# A sed program that does not truncate output. +-SED=$lt_SED +- +-# Sed that helps us avoid accidentally triggering echo(1) options like -n. +-Xsed="$SED -e 1s/^X//" +- +-# The HP-UX ksh and POSIX shell print the target directory to stdout +-# if CDPATH is set. +-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +- +-# The names of the tagged configurations supported by this script. +-available_tags= +- +-# ### BEGIN LIBTOOL CONFIG], +-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) +- +-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +- +-# Shell to use when invoking shell scripts. +-SHELL=$lt_SHELL +- +-# Whether or not to build shared libraries. +-build_libtool_libs=$enable_shared +- +-# Whether or not to build static libraries. +-build_old_libs=$enable_static +- +-# Whether or not to add -lc for building shared libraries. +-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) +- +-# Whether or not to disallow shared libs when runtime libs are static +-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) +- +-# Whether or not to optimize for fast installation. +-fast_install=$enable_fast_install +- +-# The host system. +-host_alias=$host_alias +-host=$host +-host_os=$host_os +- +-# The build system. +-build_alias=$build_alias +-build=$build +-build_os=$build_os +- +-# An echo program that does not interpret backslashes. +-echo=$lt_echo +- +-# The archiver. +-AR=$lt_AR +-AR_FLAGS=$lt_AR_FLAGS +- +-# A C compiler. +-LTCC=$lt_LTCC +- +-# LTCC compiler flags. +-LTCFLAGS=$lt_LTCFLAGS +- +-# A language-specific compiler. +-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) +- +-# Is the compiler the GNU C compiler? +-with_gcc=$_LT_AC_TAGVAR(GCC, $1) +- +-# An ERE matcher. +-EGREP=$lt_EGREP +- +-# The linker used to build libraries. +-LD=$lt_[]_LT_AC_TAGVAR(LD, $1) +- +-# Whether we need hard or soft links. +-LN_S=$lt_LN_S +- +-# A BSD-compatible nm program. +-NM=$lt_NM +- +-# A symbol stripping program +-STRIP=$lt_STRIP +- +-# Used to examine libraries when file_magic_cmd begins "file" +-MAGIC_CMD=$MAGIC_CMD +- +-# Used on cygwin: DLL creation program. +-DLLTOOL="$DLLTOOL" +- +-# Used on cygwin: object dumper. +-OBJDUMP="$OBJDUMP" +- +-# Used on cygwin: assembler. +-AS="$AS" +- +-# The name of the directory that contains temporary libtool files. +-objdir=$objdir +- +-# How to create reloadable object files. +-reload_flag=$lt_reload_flag +-reload_cmds=$lt_reload_cmds +- +-# How to pass a linker flag through the compiler. +-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) +- +-# Object file suffix (normally "o"). +-objext="$ac_objext" +- +-# Old archive suffix (normally "a"). +-libext="$libext" +- +-# Shared library suffix (normally ".so"). +-shrext_cmds='$shrext_cmds' +- +-# Executable file suffix (normally ""). +-exeext="$exeext" +- +-# Additional compiler flags for building library objects. +-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +-pic_mode=$pic_mode +- +-# What is the maximum length of a command? +-max_cmd_len=$lt_cv_sys_max_cmd_len +- +-# Does compiler simultaneously support -c and -o options? +-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) +- +-# Must we lock files when doing compilation? +-need_locks=$lt_need_locks +- +-# Do we need the lib prefix for modules? +-need_lib_prefix=$need_lib_prefix +- +-# Do we need a version for libraries? +-need_version=$need_version +- +-# Whether dlopen is supported. +-dlopen_support=$enable_dlopen +- +-# Whether dlopen of programs is supported. +-dlopen_self=$enable_dlopen_self +- +-# Whether dlopen of statically linked programs is supported. +-dlopen_self_static=$enable_dlopen_self_static +- +-# Compiler flag to prevent dynamic linking. +-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) +- +-# Compiler flag to turn off builtin functions. +-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) +- +-# Compiler flag to allow reflexive dlopens. +-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) +- +-# Compiler flag to generate shared objects directly from archives. +-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) +- +-# Compiler flag to generate thread-safe objects. +-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) +- +-# Library versioning type. +-version_type=$version_type +- +-# Format of library name prefix. +-libname_spec=$lt_libname_spec +- +-# List of archive names. First name is the real one, the rest are links. +-# The last name is the one that the linker finds with -lNAME. +-library_names_spec=$lt_library_names_spec +- +-# The coded name of the library, if different from the real name. +-soname_spec=$lt_soname_spec +- +-# Commands used to build and install an old-style archive. +-RANLIB=$lt_RANLIB +-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +-old_postinstall_cmds=$lt_old_postinstall_cmds +-old_postuninstall_cmds=$lt_old_postuninstall_cmds +- +-# Create an old-style archive from a shared archive. +-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) +- +-# Create a temporary old-style archive to link instead of a shared archive. +-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) +- +-# Commands used to build and install a shared archive. +-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +-postinstall_cmds=$lt_postinstall_cmds +-postuninstall_cmds=$lt_postuninstall_cmds +- +-# Commands used to build a loadable module (assumed same as above if empty) +-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) +- +-# Commands to strip libraries. +-old_striplib=$lt_old_striplib +-striplib=$lt_striplib +- +-# Dependencies to place before the objects being linked to create a +-# shared library. +-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) +- +-# Dependencies to place after the objects being linked to create a +-# shared library. +-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) +- +-# Dependencies to place before the objects being linked to create a +-# shared library. +-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) +- +-# Dependencies to place after the objects being linked to create a +-# shared library. +-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) +- +-# The library search path used internally by the compiler when linking +-# a shared library. +-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) +- +-# Method to check whether dependent libraries are shared objects. +-deplibs_check_method=$lt_deplibs_check_method +- +-# Command to use when deplibs_check_method == file_magic. +-file_magic_cmd=$lt_file_magic_cmd +- +-# Flag that allows shared libraries with undefined symbols to be built. +-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) +- +-# Flag that forces no undefined symbols. +-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) +- +-# Commands used to finish a libtool library installation in a directory. +-finish_cmds=$lt_finish_cmds +- +-# Same as above, but a single script fragment to be evaled but not shown. +-finish_eval=$lt_finish_eval +- +-# Take the output of nm and produce a listing of raw symbols and C names. +-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe +- +-# Transform the output of nm in a proper C declaration +-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +- +-# Transform the output of nm in a C name address pair +-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address +- +-# This is the shared library runtime path variable. +-runpath_var=$runpath_var +- +-# This is the shared library path variable. +-shlibpath_var=$shlibpath_var +- +-# Is shlibpath searched before the hard-coded library search path? +-shlibpath_overrides_runpath=$shlibpath_overrides_runpath +- +-# How to hardcode a shared library path into an executable. +-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) +- +-# Whether we should hardcode library paths into libraries. +-hardcode_into_libs=$hardcode_into_libs +- +-# Flag to hardcode \$libdir into a binary during linking. +-# This must work even if \$libdir does not exist. +-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) +- +-# If ld is used when linking, flag to hardcode \$libdir into +-# a binary during linking. This must work even if \$libdir does +-# not exist. +-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) +- +-# Whether we need a single -rpath flag with a separated argument. +-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) +- +-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +-# resulting binary. +-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) +- +-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +-# resulting binary. +-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) +- +-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +-# the resulting binary. +-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) +- +-# Set to yes if building a shared library automatically hardcodes DIR into the library +-# and all subsequent libraries and executables linked against it. +-hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) +- +-# Variables whose values should be saved in libtool wrapper scripts and +-# restored at relink time. +-variables_saved_for_relink="$variables_saved_for_relink" +- +-# Whether libtool must link a program against all its dependency libraries. +-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) +- +-# Compile-time system search path for libraries +-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +- +-# Run-time system search path for libraries +-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +- +-# Fix the shell variable \$srcfile for the compiler. +-fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" +- +-# Set to yes if exported symbols are required. +-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) +- +-# The commands to list exported symbols. +-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) +- +-# The commands to extract the exported symbol list from a shared archive. +-extract_expsyms_cmds=$lt_extract_expsyms_cmds +- +-# Symbols that should not be listed in the preloaded symbols. +-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) +- +-# Symbols that must always be exported. +-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) +- +-ifelse([$1],[], +-[# ### END LIBTOOL CONFIG], +-[# ### END LIBTOOL TAG CONFIG: $tagname]) +- +-__EOF__ +- +-ifelse([$1],[], [ +- case $host_os in +- aix3*) +- cat <<\EOF >> "$cfgfile" +- +-# AIX sometimes has problems with the GCC collect2 program. For some +-# reason, if we set the COLLECT_NAMES environment variable, the problems +-# vanish in a puff of smoke. +-if test "X${COLLECT_NAMES+set}" != Xset; then +- COLLECT_NAMES= +- export COLLECT_NAMES +-fi +-EOF +- ;; +- esac +- +- # We use sed instead of cat because bash on DJGPP gets confused if +- # if finds mixed CR/LF and LF-only lines. Since sed operates in +- # text mode, it properly converts lines to CR/LF. This bash problem +- # is reportedly fixed, but why not run on old versions too? +- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) +- +- mv -f "$cfgfile" "$ofile" || \ +- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") +- chmod +x "$ofile" +-]) +-else +- # If there is no Makefile yet, we rely on a make rule to execute +- # `config.status --recheck' to rerun these tests and create the +- # libtool script then. +- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` +- if test -f "$ltmain_in"; then +- test -f Makefile && make "$ltmain" +- fi +-fi +-])# AC_LIBTOOL_CONFIG +- +- +-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +-# ------------------------------------------- +-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +- +-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +- +-if test "$GCC" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +- +- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], +- lt_cv_prog_compiler_rtti_exceptions, +- [-fno-rtti -fno-exceptions], [], +- [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +-fi +-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI +- +- +-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +-# --------------------------------- +-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +-[AC_REQUIRE([AC_CANONICAL_HOST]) +-AC_REQUIRE([AC_PROG_NM]) +-AC_REQUIRE([AC_OBJEXT]) +-# Check for command to grab the raw symbol name followed by C symbol from nm. +-AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +-[ +-# These are sane defaults that work on at least a few old systems. +-# [They come from Ultrix. What could be older than Ultrix?!! ;)] +- +-# Character class describing NM global symbol codes. +-symcode='[[BCDEGRST]]' +- +-# Regexp to match symbols that can be accessed directly from C. +-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' +- +-# Transform an extracted symbol line into a proper C declaration +-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" +- +-# Transform an extracted symbol line into symbol name and symbol address +-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" +- +-# Define system-specific variables. +-case $host_os in +-aix*) +- symcode='[[BCDT]]' +- ;; +-cygwin* | mingw* | pw32*) +- symcode='[[ABCDGISTW]]' +- ;; +-hpux*) # Its linker distinguishes data from code symbols +- if test "$host_cpu" = ia64; then +- symcode='[[ABCDEGRST]]' +- fi +- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" +- ;; +-linux*) +- if test "$host_cpu" = ia64; then +- symcode='[[ABCDGIRSTW]]' +- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" +- fi +- ;; +-irix* | nonstopux*) +- symcode='[[BCDEGRST]]' +- ;; +-osf*) +- symcode='[[BCDEGQRST]]' +- ;; +-solaris*) +- symcode='[[BDRT]]' +- ;; +-sco3.2v5*) +- symcode='[[DT]]' +- ;; +-sysv4.2uw2*) +- symcode='[[DT]]' +- ;; +-sysv5* | sco5v6* | unixware* | OpenUNIX*) +- symcode='[[ABDT]]' +- ;; +-sysv4) +- symcode='[[DFNSTU]]' +- ;; +-esac +- +-# Handle CRLF in mingw tool chain +-opt_cr= +-case $build_os in +-mingw*) +- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp +- ;; +-esac +- +-# If we're using GNU nm, then use its standard symbol codes. +-case `$NM -V 2>&1` in +-*GNU* | *'with BFD'*) +- symcode='[[ABCDGIRSTW]]' ;; +-esac +- +-# Try without a prefix undercore, then with it. +-for ac_symprfx in "" "_"; do +- +- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. +- symxfrm="\\1 $ac_symprfx\\2 \\2" +- +- # Write the raw and C identifiers. +- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" +- +- # Check to see that the pipe works correctly. +- pipe_works=no +- +- rm -f conftest* +- cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then +- # Try sorting and uniquifying the output. +- if sort "$nlist" | uniq > "$nlist"T; then +- mv -f "$nlist"T "$nlist" +- else +- rm -f "$nlist"T +- fi +- +- # Make sure that we snagged all the symbols we need. +- if grep ' nm_test_var$' "$nlist" >/dev/null; then +- if grep ' nm_test_func$' "$nlist" >/dev/null; then +- cat < conftest.$ac_ext +-#ifdef __cplusplus +-extern "C" { +-#endif +- +-EOF +- # Now generate the symbol file. +- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' +- +- cat <> conftest.$ac_ext +-#if defined (__STDC__) && __STDC__ +-# define lt_ptr_t void * +-#else +-# define lt_ptr_t char * +-# define const +-#endif +- +-/* The mapping between symbol names and symbols. */ +-const struct { +- const char *name; +- lt_ptr_t address; +-} +-lt_preloaded_symbols[[]] = +-{ +-EOF +- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext +- cat <<\EOF >> conftest.$ac_ext +- {0, (lt_ptr_t) 0} +-}; +- +-#ifdef __cplusplus +-} +-#endif +-EOF +- # Now try linking the two files. +- mv conftest.$ac_objext conftstm.$ac_objext +- lt_save_LIBS="$LIBS" +- lt_save_CFLAGS="$CFLAGS" +- LIBS="conftstm.$ac_objext" +- CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" +- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then +- pipe_works=yes +- fi +- LIBS="$lt_save_LIBS" +- CFLAGS="$lt_save_CFLAGS" +- else +- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD +- fi +- else +- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD +- fi +- else +- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD +- fi +- else +- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD +- cat conftest.$ac_ext >&5 +- fi +- rm -f conftest* conftst* +- +- # Do not use the global_symbol_pipe unless it works. +- if test "$pipe_works" = yes; then +- break +- else +- lt_cv_sys_global_symbol_pipe= +- fi +-done +-]) +-if test -z "$lt_cv_sys_global_symbol_pipe"; then +- lt_cv_sys_global_symbol_to_cdecl= +-fi +-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then +- AC_MSG_RESULT(failed) +-else +- AC_MSG_RESULT(ok) +-fi +-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +- +- +-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +-# --------------------------------------- +-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= +- +-AC_MSG_CHECKING([for $compiler option to produce PIC]) +- ifelse([$1],[CXX],[ +- # C++ specific cases for pic, static, wl, etc. +- if test "$GXX" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- +- case $host_os in +- aix*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; +- amigaos*) +- # FIXME: we need at least 68020 code to build shared libraries, but +- # adding the `-m68020' flag to GCC prevents building anything better, +- # like `-m68040'. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' +- ;; +- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) +- # PIC is the default for these OSes. +- ;; +- mingw* | os2* | pw32*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' +- ;; +- darwin* | rhapsody*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' +- ;; +- *djgpp*) +- # DJGPP does not support shared libraries at all +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- ;; +- interix3*) +- # Interix 3.x gcc -fpic/-fPIC options generate broken code. +- # Instead, we relocate shared libraries at runtime. +- ;; +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic +- fi +- ;; +- hpux*) +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- else +- case $host_os in +- aix4* | aix5*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- else +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' +- fi +- ;; +- chorus*) +- case $cc_basename in +- cxch68*) +- # Green Hills C++ Compiler +- # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" +- ;; +- esac +- ;; +- darwin*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- case $cc_basename in +- xlc*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- ;; +- esac +- ;; +- dgux*) +- case $cc_basename in +- ec++*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- ;; +- ghcx*) +- # Green Hills C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- ;; +- *) +- ;; +- esac +- ;; +- freebsd* | kfreebsd*-gnu | dragonfly*) +- # FreeBSD uses GNU C++ +- ;; +- hpux9* | hpux10* | hpux11*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' +- if test "$host_cpu" != ia64; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- fi +- ;; +- aCC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' +- case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- ;; +- esac +- ;; +- *) +- ;; +- esac +- ;; +- interix*) +- # This is c89, which is MS Visual C++ (no shared libs) +- # Anyone wants to do a port? +- ;; +- irix5* | irix6* | nonstopux*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- # CC pic flag -KPIC is the default. +- ;; +- *) +- ;; +- esac +- ;; +- linux*) +- case $cc_basename in +- KCC*) +- # KAI C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- icpc* | ecpc*) +- # Intel C++ +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- ;; +- pgCC*) +- # Portland Group C++ compiler. +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- cxx*) +- # Compaq C++ +- # Make sure the PIC flag is empty. It appears that all Alpha +- # Linux and Compaq Tru64 Unix objects are PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- *) +- ;; +- esac +- ;; +- lynxos*) +- ;; +- m88k*) +- ;; +- mvs*) +- case $cc_basename in +- cxx*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' +- ;; +- *) +- ;; +- esac +- ;; +- netbsd*) +- ;; +- osf3* | osf4* | osf5*) +- case $cc_basename in +- KCC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- ;; +- cxx*) +- # Digital/Compaq C++ +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # Make sure the PIC flag is empty. It appears that all Alpha +- # Linux and Compaq Tru64 Unix objects are PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- *) +- ;; +- esac +- ;; +- psos*) +- ;; +- solaris*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.2, 5.x and Centerline C++ +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' +- ;; +- gcx*) +- # Green Hills C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' +- ;; +- *) +- ;; +- esac +- ;; +- sunos4*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.x +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- lcc*) +- # Lucid +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- ;; +- *) +- ;; +- esac +- ;; +- tandem*) +- case $cc_basename in +- NCC*) +- # NonStop-UX NCC 3.20 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- ;; +- *) +- ;; +- esac +- ;; +- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- esac +- ;; +- vxworks*) +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- ;; +- esac +- fi +-], +-[ +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- +- case $host_os in +- aix*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; +- +- amigaos*) +- # FIXME: we need at least 68020 code to build shared libraries, but +- # adding the `-m68020' flag to GCC prevents building anything better, +- # like `-m68040'. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' +- ;; +- +- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) +- # PIC is the default for these OSes. +- ;; +- +- mingw* | pw32* | os2*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' +- ;; +- +- darwin* | rhapsody*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' +- ;; +- +- interix3*) +- # Interix 3.x gcc -fpic/-fPIC options generate broken code. +- # Instead, we relocate shared libraries at runtime. +- ;; +- +- msdosdjgpp*) +- # Just because we use GCC doesn't mean we suddenly get shared libraries +- # on systems that don't support them. +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- enable_shared=no +- ;; +- +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic +- fi +- ;; +- +- hpux*) +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- ;; +- +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- else +- # PORTME Check for flag to pass linker flags through the system compiler. +- case $host_os in +- aix*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- else +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' +- fi +- ;; +- darwin*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- case $cc_basename in +- xlc*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- ;; +- esac +- ;; +- +- mingw* | pw32* | os2*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' +- ;; +- +- hpux9* | hpux10* | hpux11*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- ;; +- esac +- # Is there a better lt_prog_compiler_static that works with the bundled CC? +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' +- ;; +- +- irix5* | irix6* | nonstopux*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # PIC (with -KPIC) is the default. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- +- newsos6) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- linux*) +- case $cc_basename in +- icc* | ecc*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- ;; +- pgcc* | pgf77* | pgf90* | pgf95*) +- # Portland Group compilers (*not* the Pentium gcc compiler, +- # which looks to be a dead project) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- ccc*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # All Alpha code is PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- esac +- ;; +- +- osf3* | osf4* | osf5*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # All OSF/1 code is PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- +- solaris*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- case $cc_basename in +- f77* | f90* | f95*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; +- esac +- ;; +- +- sunos4*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- sysv4 | sysv4.2uw2* | sysv4.3*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- sysv4*MP*) +- if test -d /usr/nec ;then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; +- +- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- unicos*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- ;; +- +- uts4*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- ;; +- esac +- fi +-]) +-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) +- +-# +-# Check to make sure the PIC flag actually works. +-# +-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then +- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], +- _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), +- [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], +- [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in +- "" | " "*) ;; +- *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; +- esac], +- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +-fi +-case $host_os in +- # For platforms which do not support PIC, -DPIC is meaningless: +- *djgpp*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" +- ;; +-esac +- +-# +-# Check to make sure the static flag actually works. +-# +-wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], +- _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), +- $lt_tmp_static_flag, +- [], +- [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +-]) +- +- +-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +-# ------------------------------------ +-# See if the linker supports building shared libraries. +-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +-ifelse([$1],[CXX],[ +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- case $host_os in +- aix4* | aix5*) +- # If we're using GNU nm, then we don't want the "-C" option. +- # -C means demangle to AIX nm, but means don't demangle with GNU nm +- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- else +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- fi +- ;; +- pw32*) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" +- ;; +- cygwin* | mingw*) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' +- ;; +- *) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- ;; +- esac +-],[ +- runpath_var= +- _LT_AC_TAGVAR(allow_undefined_flag, $1)= +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +- _LT_AC_TAGVAR(archive_cmds, $1)= +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)= +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= +- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +- _LT_AC_TAGVAR(hardcode_automatic, $1)=no +- _LT_AC_TAGVAR(module_cmds, $1)= +- _LT_AC_TAGVAR(module_expsym_cmds, $1)= +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- # include_expsyms should be a list of space-separated symbols to be *always* +- # included in the symbol list +- _LT_AC_TAGVAR(include_expsyms, $1)= +- # exclude_expsyms can be an extended regexp of symbols to exclude +- # it will be wrapped by ` (' and `)$', so one must not match beginning or +- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', +- # as well as any symbol that contains `d'. +- _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" +- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out +- # platforms (ab)use it in PIC code, but their linkers get confused if +- # the symbol is explicitly referenced. Since portable code cannot +- # rely on this symbol name, it's probably fine to never include it in +- # preloaded symbol tables. +- extract_expsyms_cmds= +- # Just being paranoid about ensuring that cc_basename is set. +- _LT_CC_BASENAME([$compiler]) +- case $host_os in +- cygwin* | mingw* | pw32*) +- # FIXME: the MSVC++ port hasn't been tested in a loooong time +- # When not using gcc, we currently assume that we are using +- # Microsoft Visual C++. +- if test "$GCC" != yes; then +- with_gnu_ld=no +- fi +- ;; +- interix*) +- # we just hope/assume this is gcc and not c89 (= MSVC++) +- with_gnu_ld=yes +- ;; +- openbsd*) +- with_gnu_ld=no +- ;; +- esac +- +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- if test "$with_gnu_ld" = yes; then +- # If archive_cmds runs LD, not CC, wlarc should be empty +- wlarc='${wl}' +- +- # Set some defaults for GNU ld with shared library support. These +- # are reset later if shared libraries are not supported. Putting them +- # here allows them to be overridden if necessary. +- runpath_var=LD_RUN_PATH +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- # ancient GNU ld didn't support --whole-archive et. al. +- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' +- else +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- supports_anon_versioning=no +- case `$LD -v 2>/dev/null` in +- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 +- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... +- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... +- *\ 2.11.*) ;; # other 2.11 versions +- *) supports_anon_versioning=yes ;; +- esac +- +- # See if GNU ld supports shared libraries. +- case $host_os in +- aix3* | aix4* | aix5*) +- # On AIX/PPC, the GNU linker is very broken +- if test "$host_cpu" != ia64; then +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <&2 +- +-*** Warning: the GNU linker, at least up to release 2.9.1, is reported +-*** to be unable to reliably create shared libraries on AIX. +-*** Therefore, libtool is disabling shared libraries support. If you +-*** really care for shared libraries, you may want to modify your PATH +-*** so that a non-GNU linker is found, and then restart. +- +-EOF +- fi +- ;; +- +- amigaos*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- +- # Samuel A. Falvo II reports +- # that the semantics of dynamic libraries on AmigaOS, at least up +- # to version 4, is to share data among multiple programs linked +- # with the same dynamic library. Since this doesn't match the +- # behavior of shared libraries on other platforms, we can't use +- # them. +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- +- beos*) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Joseph Beckenbach says some releases of gcc +- # support --undefined. This deserves some investigation. FIXME +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- cygwin* | mingw* | pw32*) +- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, +- # as there is no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' +- +- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- interix3*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. +- # Instead, shared libraries are loaded at an image base (0x10000000 by +- # default) and relocated if they conflict, which is a slow very memory +- # consuming and fragmenting process. To avoid this, we pick a random, +- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link +- # time. Moving up from 0x10000000 also allows more sbrk(2) space. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- ;; +- +- linux*) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- tmp_addflag= +- case $cc_basename,$host_cpu in +- pgcc*) # Portland Group C compiler +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- tmp_addflag=' $pic_flag' +- ;; +- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- tmp_addflag=' $pic_flag -Mnomain' ;; +- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 +- tmp_addflag=' -i_dynamic' ;; +- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 +- tmp_addflag=' -i_dynamic -nofor_main' ;; +- ifc* | ifort*) # Intel Fortran compiler +- tmp_addflag=' -nofor_main' ;; +- esac +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- +- if test $supports_anon_versioning = yes; then +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ +- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +- $echo "local: *; };" >> $output_objdir/$libname.ver~ +- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' +- fi +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- netbsd*) +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' +- wlarc= +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- fi +- ;; +- +- solaris*) +- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <&2 +- +-*** Warning: The releases 2.8.* of the GNU linker cannot reliably +-*** create shared libraries on Solaris systems. Therefore, libtool +-*** is disabling shared libraries support. We urge you to upgrade GNU +-*** binutils to release 2.9.1 or newer. Another option is to modify +-*** your PATH or compiler configuration so that the native linker is +-*** used, and then restart. +- +-EOF +- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) +- case `$LD -v 2>&1` in +- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <<_LT_EOF 1>&2 +- +-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +-*** reliably create shared libraries on SCO systems. Therefore, libtool +-*** is disabling shared libraries support. We urge you to upgrade GNU +-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +-*** your PATH or compiler configuration so that the native linker is +-*** used, and then restart. +- +-_LT_EOF +- ;; +- *) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- +- sunos4*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- wlarc= +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- *) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- +- if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then +- runpath_var= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- else +- # PORTME fill in a description of your system's linker (not GNU ld) +- case $host_os in +- aix3*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' +- # Note: this linker hardcodes the directories in LIBPATH if there +- # are no directories specified by -L. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then +- # Neither direct hardcoding nor static linking is supported with a +- # broken collect2. +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- fi +- ;; +- +- aix4* | aix5*) +- if test "$host_cpu" = ia64; then +- # On IA64, the linker does run time linking by default, so we don't +- # have to do anything special. +- aix_use_runtimelinking=no +- exp_sym_flag='-Bexport' +- no_entry_flag="" +- else +- # If we're using GNU nm, then we don't want the "-C" option. +- # -C means demangle to AIX nm, but means don't demangle with GNU nm +- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- else +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- fi +- aix_use_runtimelinking=no +- +- # Test if we are trying to use run time linking or normal +- # AIX style linking. If -brtl is somewhere in LDFLAGS, we +- # need to do runtime linking. +- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) +- for ld_flag in $LDFLAGS; do +- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then +- aix_use_runtimelinking=yes +- break +- fi +- done +- ;; +- esac +- +- exp_sym_flag='-bexport' +- no_entry_flag='-bnoentry' +- fi +- +- # When large executables or shared objects are built, AIX ld can +- # have problems creating the table of contents. If linking a library +- # or program results in "error TOC overflow" add -mminimal-toc to +- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not +- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. +- +- _LT_AC_TAGVAR(archive_cmds, $1)='' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- +- if test "$GCC" = yes; then +- case $host_os in aix4.[[012]]|aix4.[[012]].*) +- # We only want to do this on AIX 4.2 and lower, the check +- # below for broken collect2 doesn't work under 4.3+ +- collect2name=`${CC} -print-prog-name=collect2` +- if test -f "$collect2name" && \ +- strings "$collect2name" | grep resolve_lib_name >/dev/null +- then +- # We have reworked collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- else +- # We have old collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- # It fails to find uninstalled libraries when the uninstalled +- # path is not listed in the libpath. Setting hardcode_minus_L +- # to unsupported forces relinking +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- fi +- ;; +- esac +- shared_flag='-shared' +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag="$shared_flag "'${wl}-G' +- fi +- else +- # not using gcc +- if test "$host_cpu" = ia64; then +- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release +- # chokes on -Wl,-G. The following line is correct: +- shared_flag='-G' +- else +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag='${wl}-G' +- else +- shared_flag='${wl}-bM:SRE' +- fi +- fi +- fi +- +- # It seems that -bexpall does not export symbols beginning with +- # underscore (_), so it is better to generate a list of symbols to export. +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- if test "$aix_use_runtimelinking" = yes; then +- # Warning - without using the other runtime loading flags (-brtl), +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +- else +- if test "$host_cpu" = ia64; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" +- else +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- # Warning - without using the other run time loading flags, +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' +- # Exported symbols can be pulled into shared objects from archives +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- # This is similar to how AIX traditionally builds its shared libraries. +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' +- fi +- fi +- ;; +- +- amigaos*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- # see comment about different semantics on the GNU ld section +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- +- bsdi[[45]]*) +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic +- ;; +- +- cygwin* | mingw* | pw32*) +- # When not using gcc, we currently assume that we are using +- # Microsoft Visual C++. +- # hardcode_libdir_flag_spec is actually meaningless, as there is +- # no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Tell ltmain to make .lib files, not .a files. +- libext=lib +- # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" +- # FIXME: Setting linknames here is a bad hack. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' +- # The linker will automatically build a .lib file if we build a DLL. +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' +- # FIXME: Should let the user specify the lib program. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' +- _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- ;; +- +- darwin* | rhapsody*) +- case $host_os in +- rhapsody* | darwin1.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' +- ;; +- *) # Darwin 1.3 on +- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- else +- case ${MACOSX_DEPLOYMENT_TARGET} in +- 10.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- ;; +- 10.*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' +- ;; +- esac +- fi +- ;; +- esac +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- if test "$GCC" = yes ; then +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- else +- case $cc_basename in +- xlc*) +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- ;; +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +- ;; +- +- dgux*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- freebsd1*) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- +- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor +- # support. Future versions do this automatically, but an explicit c++rt0.o +- # does not break anything, and helps significantly (at the cost of a little +- # extra space). +- freebsd2.2*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- # Unfortunately, older versions of FreeBSD 2 do not have this feature. +- freebsd2*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- # FreeBSD 3 and greater uses gcc -shared to do shared libraries. +- freebsd* | kfreebsd*-gnu | dragonfly*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- hpux9*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- ;; +- +- hpux10*) +- if test "$GCC" = yes -a "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +- fi +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- fi +- ;; +- +- hpux11*) +- if test "$GCC" = yes -a "$with_gnu_ld" = no; then +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- else +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- fi +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- case $host_cpu in +- hppa*64*|ia64*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- *) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- ;; +- esac +- fi +- ;; +- +- irix5* | irix6* | nonstopux*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; +- +- netbsd*) +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- newsos6) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- openbsd*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- else +- case $host_os in +- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- ;; +- esac +- fi +- ;; +- +- os2*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' +- ;; +- +- osf3*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- ;; +- +- osf4* | osf5*) # as osf3* with the addition of -msym flag +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- else +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ +- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' +- +- # Both c and cxx compiler support -rpath directly +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- ;; +- +- solaris*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' +- if test "$GCC" = yes; then +- wlarc='${wl}' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' +- else +- wlarc='' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- case $host_os in +- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; +- *) +- # The compiler driver will combine linker options so we +- # cannot just pass the convience library names through +- # without $wl, iff we do not link with $LD. +- # Luckily, gcc supports the same syntax we need for Sun Studio. +- # Supported since Solaris 2.6 (maybe 2.5.1?) +- case $wlarc in +- '') +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; +- *) +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; +- esac ;; +- esac +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; +- +- sunos4*) +- if test "x$host_vendor" = xsequent; then +- # Use $CC to link under sequent, because it throws in some extra .o +- # files that make .init and .fini sections work. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- sysv4) +- case $host_vendor in +- sni) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? +- ;; +- siemens) +- ## LD is ld it makes a PLAMLIB +- ## CC just makes a GrossModule. +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- ;; +- motorola) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie +- ;; +- esac +- runpath_var='LD_RUN_PATH' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- sysv4.3*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' +- ;; +- +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var=LD_RUN_PATH +- hardcode_runpath_var=yes +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- fi +- ;; +- +- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var='LD_RUN_PATH' +- +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- fi +- ;; +- +- sysv5* | sco3.2v5* | sco5v6*) +- # Note: We can NOT use -z defs as we might desire, because we do not +- # link with -lc, and that would cause any symbols used from libc to +- # always be unresolved, which means just about no library would +- # ever link correctly. If we're not using GNU ld we use -z text +- # though, which does catch some bad symbols but isn't as heavy-handed +- # as -z defs. +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' +- runpath_var='LD_RUN_PATH' +- +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- fi +- ;; +- +- uts4*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +-]) +-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no +- +-# +-# Do we need to explicitly link libc? +-# +-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +-x|xyes) +- # Assume -lc should be added +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- +- if test "$enable_shared" = yes && test "$GCC" = yes; then +- case $_LT_AC_TAGVAR(archive_cmds, $1) in +- *'~'*) +- # FIXME: we may have to deal with multi-command sequences. +- ;; +- '$CC '*) +- # Test whether the compiler implicitly links with -lc since on some +- # systems, -lgcc has to come before -lc. If gcc already passes -lc +- # to ld, don't add -lc before -lgcc. +- AC_MSG_CHECKING([whether -lc should be explicitly linked in]) +- $rm conftest* +- printf "$lt_simple_compile_test_code" > conftest.$ac_ext +- +- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then +- soname=conftest +- lib=conftest +- libobjs=conftest.$ac_objext +- deplibs= +- wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) +- pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +- compiler_flags=-v +- linker_flags=-v +- verstring= +- output_objdir=. +- libname=conftest +- lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)= +- if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) +- then +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- else +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- fi +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag +- else +- cat conftest.err 1>&5 +- fi +- $rm conftest* +- AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) +- ;; +- esac +- fi +- ;; +-esac +-])# AC_LIBTOOL_PROG_LD_SHLIBS +- +- +-# _LT_AC_FILE_LTDLL_C +-# ------------------- +-# Be careful that the start marker always follows a newline. +-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +-# /* ltdll.c starts here */ +-# #define WIN32_LEAN_AND_MEAN +-# #include +-# #undef WIN32_LEAN_AND_MEAN +-# #include +-# +-# #ifndef __CYGWIN__ +-# # ifdef __CYGWIN32__ +-# # define __CYGWIN__ __CYGWIN32__ +-# # endif +-# #endif +-# +-# #ifdef __cplusplus +-# extern "C" { +-# #endif +-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +-# #ifdef __cplusplus +-# } +-# #endif +-# +-# #ifdef __CYGWIN__ +-# #include +-# DECLARE_CYGWIN_DLL( DllMain ); +-# #endif +-# HINSTANCE __hDllInstance_base; +-# +-# BOOL APIENTRY +-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +-# { +-# __hDllInstance_base = hInst; +-# return TRUE; +-# } +-# /* ltdll.c ends here */ +-])# _LT_AC_FILE_LTDLL_C +- +- +-# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +-# --------------------------------- +-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) +- +- +-# old names +-AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +-AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +-AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +-AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +-AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) +- +-# This is just to silence aclocal about the macro not being used +-ifelse([AC_DISABLE_FAST_INSTALL]) +- +-AC_DEFUN([LT_AC_PROG_GCJ], +-[AC_CHECK_TOOL(GCJ, gcj, no) +- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" +- AC_SUBST(GCJFLAGS) +-]) +- +-AC_DEFUN([LT_AC_PROG_RC], +-[AC_CHECK_TOOL(RC, windres, no) +-]) +- +-############################################################ +-# NOTE: This macro has been submitted for inclusion into # +-# GNU Autoconf as AC_PROG_SED. When it is available in # +-# a released version of Autoconf we should remove this # +-# macro and use it instead. # +-############################################################ +-# LT_AC_PROG_SED +-# -------------- +-# Check for a fully-functional sed program, that truncates +-# as few characters as possible. Prefer GNU sed if found. +-AC_DEFUN([LT_AC_PROG_SED], +-[AC_MSG_CHECKING([for a sed that does not truncate output]) +-AC_CACHE_VAL(lt_cv_path_SED, +-[# Loop through the user's path and test for sed and gsed. +-# Then use that list of sed's as ones to test for truncation. +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for lt_ac_prog in sed gsed; do +- for ac_exec_ext in '' $ac_executable_extensions; do +- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then +- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" +- fi +- done +- done +-done +-lt_ac_max=0 +-lt_ac_count=0 +-# Add /usr/xpg4/bin/sed as it is typically found on Solaris +-# along with /bin/sed that truncates output. +-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do +- test ! -f $lt_ac_sed && continue +- cat /dev/null > conftest.in +- lt_ac_count=0 +- echo $ECHO_N "0123456789$ECHO_C" >conftest.in +- # Check for GNU sed and select it if it is found. +- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then +- lt_cv_path_SED=$lt_ac_sed +- break +- fi +- while true; do +- cat conftest.in conftest.in >conftest.tmp +- mv conftest.tmp conftest.in +- cp conftest.in conftest.nl +- echo >>conftest.nl +- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break +- cmp -s conftest.out conftest.nl || break +- # 10000 chars as input seems more than enough +- test $lt_ac_count -gt 10 && break +- lt_ac_count=`expr $lt_ac_count + 1` +- if test $lt_ac_count -gt $lt_ac_max; then +- lt_ac_max=$lt_ac_count +- lt_cv_path_SED=$lt_ac_sed +- fi +- done +-done +-]) +-SED=$lt_cv_path_SED +-AC_MSG_RESULT([$SED]) +-]) +--- a/Makefile.in ++++ b/Makefile.in +@@ -241,19 +241,6 @@ all: rfbconfig.h + .SUFFIXES: + am--refresh: + @: +-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +- @for dep in $?; do \ +- case '$(am__configure_deps)' in \ +- *$$dep*) \ +- echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ +- cd $(srcdir) && $(AUTOMAKE) --gnu \ +- && exit 0; \ +- exit 1;; \ +- esac; \ +- done; \ +- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ +- cd $(top_srcdir) && \ +- $(AUTOMAKE) --gnu Makefile + .PRECIOUS: Makefile + Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ diff --git a/libs/libvncserver/patches/100-noexamples.patch b/libs/libvncserver/patches/100-noexamples.patch new file mode 100644 index 0000000..dc7d933 --- /dev/null +++ b/libs/libvncserver/patches/100-noexamples.patch @@ -0,0 +1,43 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -228,8 +228,8 @@ sysconfdir = @sysconfdir@ + target_alias = @target_alias@ + with_ffmpeg = @with_ffmpeg@ + @WITH_X11VNC_TRUE@X11VNC = x11vnc +-SUBDIRS = libvncserver examples contrib libvncclient vncterm classes client_examples test $(X11VNC) +-DIST_SUBDIRS = libvncserver examples contrib libvncclient vncterm classes client_examples test ++SUBDIRS = libvncserver ++DIST_SUBDIRS = libvncserver + bin_SCRIPTS = libvncserver-config + #include_HEADERS=rfb.h rfbconfig.h rfbint.h rfbproto.h keysym.h rfbregion.h + include_HEADERS = rfb/rfb.h rfb/rfbconfig.h rfb/rfbint.h rfb/rfbproto.h \ +--- a/configure.ac ++++ b/configure.ac +@@ -748,14 +748,6 @@ AC_SUBST(RPMSOURCEDIR) + + AC_CONFIG_FILES([Makefile + libvncserver/Makefile +- contrib/Makefile +- examples/Makefile +- vncterm/Makefile +- classes/Makefile +- classes/ssl/Makefile +- libvncclient/Makefile +- client_examples/Makefile +- test/Makefile + libvncserver-config + LibVNCServer.spec]) + # +--- a/Makefile.am ++++ b/Makefile.am +@@ -4,8 +4,8 @@ if WITH_X11VNC + X11VNC=x11vnc + endif + +-SUBDIRS=libvncserver examples contrib libvncclient vncterm classes client_examples test $(X11VNC) +-DIST_SUBDIRS=libvncserver examples contrib libvncclient vncterm classes client_examples test ++SUBDIRS=libvncserver ++DIST_SUBDIRS=libvncserver + + bin_SCRIPTS = libvncserver-config + diff --git a/libs/libvorbis/Makefile b/libs/libvorbis/Makefile new file mode 100644 index 0000000..9283812 --- /dev/null +++ b/libs/libvorbis/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2008-2009 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:=libvorbis +PKG_VERSION:=1.2.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.xiph.org/releases/vorbis/ +PKG_MD5SUM:=5aa77f55c0e0aab8eb8ed982335daac8 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libvorbis + SECTION:=libs + CATEGORY:=Libraries + TITLE:=libvorbis + URL:=http://xiph.org/vorbis/ + DEPENDS:=+libogg +endef + +define Package/libvorbis/description +Vorbis is a general purpose audio and music encoding format +contemporary to MPEG-4's AAC and TwinVQ, the next generation beyond +MPEG audio layer 3. Unlike the MPEG sponsored formats (and other +proprietary formats such as RealAudio G2 and Windows' flavor of the +month), the Vorbis CODEC specification belongs to the public domain. +All the technical details are published and documented, and any +software entity may make full use of the format without license +fee, royalty or patent concerns. +endef + +CONFIGURE_ARGS+= \ + --disable-oggtest \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/vorbis/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/vorbis/* $(1)/usr/include/vorbis/ + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/ + $(INSTALL_DIR) $(1)/usr/share/aclocal/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(1)/usr/share/aclocal/ +endef + +define Package/libvorbis/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libvorbis)) diff --git a/libs/libvorbis/patches/001-automake-compat.patch b/libs/libvorbis/patches/001-automake-compat.patch new file mode 100644 index 0000000..29d85c1 --- /dev/null +++ b/libs/libvorbis/patches/001-automake-compat.patch @@ -0,0 +1,10 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,6 +1,7 @@ + ## Process this file with automake to produce Makefile.in + + AUTOMAKE_OPTIONS = 1.6 foreign dist-zip dist-bzip2 ++ACLOCAL_AMFLAGS = -I m4 + + SUBDIRS = m4 include vq lib examples test doc + diff --git a/libs/libvorbisidec/Makefile b/libs/libvorbisidec/Makefile new file mode 100644 index 0000000..a975bb7 --- /dev/null +++ b/libs/libvorbisidec/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2006-2011 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:=libvorbisidec +PKG_VERSION:=1.0.2+svn14261 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/libv/libvorbisidec/ +PKG_MD5SUM:=bc617d4af1cd74b38d7c51451dd6eff0 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libvorbisidec + SECTION:=libs + CATEGORY:=Libraries + TITLE:=A fixed-point Ogg/Vorbis decoder library + URL:=http://wiki.xiph.org/index.php/Tremor +endef + +define Package/libvorbisidec/description + libvorbisidec is "tremor", a fixed-point implementation of libvorbis. + It also has libogg built-in. It is suitable as a replacement for + libvorbis and libogg in tremor-aware applications. + Tremor is a decoder only. +endef + +TARGET_CFLAGS += $(FPIC) +CONFIGURE_ARGS += --enable-shared --enable-static + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/tremor $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libvorbisidec.{a,so*} $(1)/usr/lib/ +endef + +define Package/libvorbisidec/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libvorbisidec.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libvorbisidec)) diff --git a/libs/libxapian/Makefile b/libs/libxapian/Makefile new file mode 100644 index 0000000..7b290c0 --- /dev/null +++ b/libs/libxapian/Makefile @@ -0,0 +1,85 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=xapian-core +PKG_VERSION:=1.2.8 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://oligarchy.co.uk/xapian/$(PKG_VERSION) +PKG_MD5SUM:=6c9f9e7ac43aa4e086283201329e98ee + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +PKG_BUILD_DEPENDS:=util-linux + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/libxapian + SECTION:=libs + CATEGORY:=Libraries + TITLE:=xapian + URL:=http://xapian.org + DEPENDS:=+libstdcpp +zlib +endef + +MAKE_FLAGS += \ + SUBDIRS=. + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/share/aclocal + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/aclocal/* \ + $(1)/usr/share/aclocal + + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/xapian.h \ + $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/include/xapian + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/xapian/* \ + $(1)/usr/include/xapian + + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} \ + $(1)/usr/lib/ + $(INSTALL_DIR) $(2)/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/xapian-config \ + $(2)/bin + $(SED) 's,prefix=",prefix="$(STAGING_DIR),g' $(2)/bin/xapian-config + + #FIXME: Libtool should handle this + if [ -f $(TOOLCHAIN_DIR)/usr/lib/libstdc++.la ]; then \ + $(SED) \ + "s,$(STAGING_DIR)/usr/lib/libstdc++,$(TOOLCHAIN_DIR)/usr/lib/libstdc++,g" \ + $(1)/usr/lib/libxapian.la ; \ + else \ + $(SED) \ + "s,$(STAGING_DIR)/usr/lib/libstdc++,$(TOOLCHAIN_DIR)/lib/libstdc++,g" \ + $(1)/usr/lib/libxapian.la ; \ + fi +endef + +define Package/libxapian/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.so* \ + $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/* \ + $(1)/usr/bin +endef + +$(eval $(call BuildPackage,libxapian)) diff --git a/libs/libxapian/patches/001-missing_includes.patch b/libs/libxapian/patches/001-missing_includes.patch new file mode 100644 index 0000000..fba4bc0 --- /dev/null +++ b/libs/libxapian/patches/001-missing_includes.patch @@ -0,0 +1,50 @@ +--- a/backends/flint/flint_version.cc ++++ b/backends/flint/flint_version.cc +@@ -20,6 +20,7 @@ + */ + + #include ++#include + + #include "safeerrno.h" + +--- a/bin/xapian-progsrv.cc ++++ b/bin/xapian-progsrv.cc +@@ -19,6 +19,7 @@ + */ + + #include ++#include + + #include "remoteserver.h" + +--- a/bin/xapian-tcpsrv.cc ++++ b/bin/xapian-tcpsrv.cc +@@ -21,6 +21,7 @@ + */ + + #include ++#include + + #include + +--- a/examples/delve.cc ++++ b/examples/delve.cc +@@ -21,6 +21,7 @@ + */ + + #include ++#include + + #include + +--- a/examples/quest.cc ++++ b/examples/quest.cc +@@ -19,6 +19,7 @@ + */ + + #include ++#include + + #include + diff --git a/libs/libxapian/patches/002-xapian_config_no_ltlibs.patch b/libs/libxapian/patches/002-xapian_config_no_ltlibs.patch new file mode 100644 index 0000000..c5d4dc7 --- /dev/null +++ b/libs/libxapian/patches/002-xapian_config_no_ltlibs.patch @@ -0,0 +1,55 @@ +--- a/m4-macros/xapian.m4 ++++ b/m4-macros/xapian.m4 +@@ -52,11 +52,11 @@ + [$2]) + else + AC_MSG_CHECKING([$XAPIAN_CONFIG works]) +- dnl check for --ltlibs but not --libs as "xapian-config --libs" will ++ dnl check for --libs but not --libs as "xapian-config --libs" will + dnl fail if xapian isn't installed... + + dnl run with exec to avoid leaking output on "real" bourne shells +- if (exec >&5 2>&5 ; $XAPIAN_CONFIG --ltlibs --cxxflags; exit $?) then ++ if (exec >&5 2>&5 ; $XAPIAN_CONFIG --libs --cxxflags; exit $?) then + AC_MSG_RESULT(yes) + else + case $? in +@@ -70,7 +70,7 @@ + AC_MSG_ERROR([\`$XAPIAN_CONFIG' not executable, aborting]) + ;; + esac +- AC_MSG_ERROR([\`$XAPIAN_CONFIG --ltlibs --cxxflags' doesn't work, aborting]) ++ AC_MSG_ERROR([\`$XAPIAN_CONFIG --libs --cxxflags' doesn't work, aborting]) + fi + + dnl If LT_INIT, AC_PROG_LIBTOOL or the deprecated older version +@@ -80,11 +80,11 @@ + XAPIAN_VERSION=`$XAPIAN_CONFIG --version|sed 's/.* //;s/_svn[[0-9]]*$//'` + XAPIAN_CXXFLAGS=`$XAPIAN_CONFIG --cxxflags` + AC_PROVIDE_IFELSE([LT_INIT], +- [XAPIAN_LIBS=`$XAPIAN_CONFIG --ltlibs`], ++ [XAPIAN_LIBS=`$XAPIAN_CONFIG --libs`], + [AC_PROVIDE_IFELSE([AC_PROG_LIBTOOL], +- [XAPIAN_LIBS=`$XAPIAN_CONFIG --ltlibs`], ++ [XAPIAN_LIBS=`$XAPIAN_CONFIG --libs`], + [AC_PROVIDE_IFELSE([AM_PROG_LIBTOOL], +- [XAPIAN_LIBS=`$XAPIAN_CONFIG --ltlibs`], ++ [XAPIAN_LIBS=`$XAPIAN_CONFIG --libs`], + dnl Pass magic option so xapian-config knows we called it (so it + dnl can choose a more appropriate error message if asked to link + dnl with an uninstalled libxapian). Also pass ac_top_srcdir +@@ -92,11 +92,11 @@ + dnl "configure.in" according to which is in use. + [XAPIAN_LIBS=`ac_top_srcdir="$ac_top_srcdir" $XAPIAN_CONFIG --from-xo-lib-xapian --libs` + define([LT_INIT], defn([LT_INIT]) +- [XAPIAN_LIBS=`$XAPIAN_CONFIG --ltlibs`]) ++ [XAPIAN_LIBS=`$XAPIAN_CONFIG --libs`]) + define([AC_PROG_LIBTOOL], defn([AC_PROG_LIBTOOL]) +- [XAPIAN_LIBS=`$XAPIAN_CONFIG --ltlibs`]) ++ [XAPIAN_LIBS=`$XAPIAN_CONFIG --libs`]) + define([AM_PROG_LIBTOOL], defn([AM_PROG_LIBTOOL]) +- [XAPIAN_LIBS=`$XAPIAN_CONFIG --ltlibs`])])])]) ++ [XAPIAN_LIBS=`$XAPIAN_CONFIG --libs`])])])]) + ifelse([$1], , :, [$1]) + fi + AC_SUBST(XAPIAN_CXXFLAGS) diff --git a/libs/libxml2/Makefile b/libs/libxml2/Makefile new file mode 100644 index 0000000..25e93fd --- /dev/null +++ b/libs/libxml2/Makefile @@ -0,0 +1,105 @@ +# +# Copyright (C) 2006-2012 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:=libxml2 +PKG_VERSION:=2.7.8 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://gd.tuwien.ac.at/languages/libxml/ \ + http://xmlsoft.org/sources/ \ + ftp://fr.rpmfind.net/pub/libxml/ +PKG_MD5SUM:=8127a65e8c3b08856093099b52599c86 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libxml2 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Gnome XML library + URL:=http://xmlsoft.org/ + DEPENDS:=+libpthread +zlib +endef + +define Package/libxml2/description + A library for manipulating XML and HTML resources. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --with-c14n \ + --without-catalog \ + --with-debug \ + --without-docbook \ + --with-html \ + --without-ftp \ + --without-http \ + --without-iconv \ + --without-iso8859x \ + --without-legacy \ + --with-output \ + --without-pattern \ + --without-push \ + --without-python \ + --with-reader \ + --without-readline \ + --without-regexps \ + --with-sax1 \ + --with-schemas \ + --with-threads \ + --with-tree \ + --with-valid \ + --with-writer \ + --with-xinclude \ + --with-xpath \ + --with-xptr \ + --with-zlib \ + +define Build/InstallDev + $(INSTALL_DIR) $(2)/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xml2-config $(2)/bin/ + $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(2)/bin/xml2-config + + $(INSTALL_DIR) $(1)/usr/include + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/libxml2 \ + $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxml2.{la,a,so*} \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxml-2.0.pc \ + $(1)/usr/lib/pkgconfig/ + + $(INSTALL_DIR) $(2)/share/aclocal/ + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/aclocal/* \ + $(2)/share/aclocal +endef + +define Package/libxml2/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxml2.so.* \ + $(1)/usr/lib/ +endef + + +$(eval $(call BuildPackage,libxml2)) diff --git a/libs/libxml2/patches/001-debian_CVEs.patch b/libs/libxml2/patches/001-debian_CVEs.patch new file mode 100644 index 0000000..6b34bf6 --- /dev/null +++ b/libs/libxml2/patches/001-debian_CVEs.patch @@ -0,0 +1,1028 @@ +--- libxml2-2.7.8/dict.c 2010-10-12 08:25:31.000000000 +0200 ++++ libxml2-2.7.8.patched/dict.c 2012-09-28 12:08:37.432414664 +0200 +@@ -2,7 +2,7 @@ + * dict.c: dictionary of reusable strings, just used to avoid allocation + * and freeing operations. + * +- * Copyright (C) 2003 Daniel Veillard. ++ * Copyright (C) 2003-2012 Daniel Veillard. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above +@@ -19,6 +19,28 @@ + #define IN_LIBXML + #include "libxml.h" + ++#ifdef HAVE_STDLIB_H ++#include ++#endif ++#ifdef HAVE_TIME_H ++#include ++#endif ++ ++/* ++ * Following http://www.ocert.org/advisories/ocert-2011-003.html ++ * it seems that having hash randomization might be a good idea ++ * when using XML with untrusted data ++ * Note1: that it works correctly only if compiled with WITH_BIG_KEY ++ * which is the default. ++ * Note2: the fast function used for a small dict won't protect very ++ * well but since the attack is based on growing a very big hash ++ * list we will use the BigKey algo as soon as the hash size grows ++ * over MIN_DICT_SIZE so this actually works ++ */ ++#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME) ++#define DICT_RANDOMIZATION ++#endif ++ + #include + #ifdef HAVE_STDINT_H + #include +@@ -44,23 +66,23 @@ + #define WITH_BIG_KEY + + #ifdef WITH_BIG_KEY +-#define xmlDictComputeKey(dict, name, len) \ +- (((dict)->size == MIN_DICT_SIZE) ? \ +- xmlDictComputeFastKey(name, len) : \ +- xmlDictComputeBigKey(name, len)) +- +-#define xmlDictComputeQKey(dict, prefix, plen, name, len) \ +- (((prefix) == NULL) ? \ +- (xmlDictComputeKey(dict, name, len)) : \ +- (((dict)->size == MIN_DICT_SIZE) ? \ +- xmlDictComputeFastQKey(prefix, plen, name, len) : \ +- xmlDictComputeBigQKey(prefix, plen, name, len))) ++#define xmlDictComputeKey(dict, name, len) \ ++ (((dict)->size == MIN_DICT_SIZE) ? \ ++ xmlDictComputeFastKey(name, len, (dict)->seed) : \ ++ xmlDictComputeBigKey(name, len, (dict)->seed)) ++ ++#define xmlDictComputeQKey(dict, prefix, plen, name, len) \ ++ (((prefix) == NULL) ? \ ++ (xmlDictComputeKey(dict, name, len)) : \ ++ (((dict)->size == MIN_DICT_SIZE) ? \ ++ xmlDictComputeFastQKey(prefix, plen, name, len, (dict)->seed) : \ ++ xmlDictComputeBigQKey(prefix, plen, name, len, (dict)->seed))) + + #else /* !WITH_BIG_KEY */ +-#define xmlDictComputeKey(dict, name, len) \ +- xmlDictComputeFastKey(name, len) +-#define xmlDictComputeQKey(dict, prefix, plen, name, len) \ +- xmlDictComputeFastQKey(prefix, plen, name, len) ++#define xmlDictComputeKey(dict, name, len) \ ++ xmlDictComputeFastKey(name, len, (dict)->seed) ++#define xmlDictComputeQKey(dict, prefix, plen, name, len) \ ++ xmlDictComputeFastQKey(prefix, plen, name, len, (dict)->seed) + #endif /* WITH_BIG_KEY */ + + /* +@@ -98,6 +120,8 @@ + xmlDictStringsPtr strings; + + struct _xmlDict *subdict; ++ /* used for randomization */ ++ int seed; + }; + + /* +@@ -125,6 +149,9 @@ + if ((xmlDictMutex = xmlNewRMutex()) == NULL) + return(0); + ++#ifdef DICT_RANDOMIZATION ++ srand(time(NULL)); ++#endif + xmlDictInitialized = 1; + return(1); + } +@@ -277,13 +304,13 @@ + */ + + static uint32_t +-xmlDictComputeBigKey(const xmlChar* data, int namelen) { ++xmlDictComputeBigKey(const xmlChar* data, int namelen, int seed) { + uint32_t hash; + int i; + + if (namelen <= 0 || data == NULL) return(0); + +- hash = 0; ++ hash = seed; + + for (i = 0;i < namelen; i++) { + hash += data[i]; +@@ -310,12 +337,12 @@ + */ + static unsigned long + xmlDictComputeBigQKey(const xmlChar *prefix, int plen, +- const xmlChar *name, int len) ++ const xmlChar *name, int len, int seed) + { + uint32_t hash; + int i; + +- hash = 0; ++ hash = seed; + + for (i = 0;i < plen; i++) { + hash += prefix[i]; +@@ -346,8 +373,8 @@ + * for low hash table fill. + */ + static unsigned long +-xmlDictComputeFastKey(const xmlChar *name, int namelen) { +- unsigned long value = 0L; ++xmlDictComputeFastKey(const xmlChar *name, int namelen, int seed) { ++ unsigned long value = seed; + + if (name == NULL) return(0); + value = *name; +@@ -381,9 +408,9 @@ + */ + static unsigned long + xmlDictComputeFastQKey(const xmlChar *prefix, int plen, +- const xmlChar *name, int len) ++ const xmlChar *name, int len, int seed) + { +- unsigned long value = 0L; ++ unsigned long value = (unsigned long) seed; + + if (plen == 0) + value += 30 * (unsigned long) ':'; +@@ -460,6 +487,11 @@ + dict->subdict = NULL; + if (dict->dict) { + memset(dict->dict, 0, MIN_DICT_SIZE * sizeof(xmlDictEntry)); ++#ifdef DICT_RANDOMIZATION ++ dict->seed = rand(); ++#else ++ dict->seed = 0; ++#endif + return(dict); + } + xmlFree(dict); +@@ -486,6 +518,7 @@ + #ifdef DICT_DEBUG_PATTERNS + fprintf(stderr, "R"); + #endif ++ dict->seed = sub->seed; + dict->subdict = sub; + xmlDictReference(dict->subdict); + } +--- libxml2-2.7.8/encoding.c 2010-11-04 17:40:06.000000000 +0100 ++++ libxml2-2.7.8.patched/encoding.c 2012-09-28 12:08:37.440414665 +0200 +@@ -1928,7 +1928,7 @@ + if (in == NULL) return(-1); + + /* calculate space available */ +- written = out->size - out->use; ++ written = out->size - out->use - 1; /* count '\0' */ + toconv = in->use; + /* + * echo '' | wc -c => 38 +@@ -2059,7 +2059,7 @@ + toconv = in->use; + if (toconv == 0) + return (0); +- written = out->size - out->use; ++ written = out->size - out->use - 1; /* count '\0' */ + if (toconv * 2 >= written) { + xmlBufferGrow(out, out->size + toconv * 2); + written = out->size - out->use - 1; +--- libxml2-2.7.8/entities.c 2010-10-12 08:25:32.000000000 +0200 ++++ libxml2-2.7.8.patched/entities.c 2012-09-28 12:08:37.432414664 +0200 +@@ -528,13 +528,13 @@ + * Macro used to grow the current buffer. + */ + #define growBufferReentrant() { \ +- buffer_size *= 2; \ +- buffer = (xmlChar *) \ +- xmlRealloc(buffer, buffer_size * sizeof(xmlChar)); \ +- if (buffer == NULL) { \ +- xmlEntitiesErrMemory("xmlEncodeEntitiesReentrant: realloc failed");\ +- return(NULL); \ +- } \ ++ xmlChar *tmp; \ ++ size_t new_size = buffer_size * 2; \ ++ if (new_size < buffer_size) goto mem_error; \ ++ tmp = (xmlChar *) xmlRealloc(buffer, new_size); \ ++ if (tmp == NULL) goto mem_error; \ ++ buffer = tmp; \ ++ buffer_size = new_size; \ + } + + +@@ -555,7 +555,7 @@ + const xmlChar *cur = input; + xmlChar *buffer = NULL; + xmlChar *out = NULL; +- int buffer_size = 0; ++ size_t buffer_size = 0; + int html = 0; + + if (input == NULL) return(NULL); +@@ -574,8 +574,8 @@ + out = buffer; + + while (*cur != '\0') { +- if (out - buffer > buffer_size - 100) { +- int indx = out - buffer; ++ size_t indx = out - buffer; ++ if (indx + 100 > buffer_size) { + + growBufferReentrant(); + out = &buffer[indx]; +@@ -692,6 +692,11 @@ + } + *out = 0; + return(buffer); ++ ++mem_error: ++ xmlEntitiesErrMemory("xmlEncodeEntitiesReentrant: realloc failed"); ++ xmlFree(buffer); ++ return(NULL); + } + + /** +@@ -709,7 +714,7 @@ + const xmlChar *cur = input; + xmlChar *buffer = NULL; + xmlChar *out = NULL; +- int buffer_size = 0; ++ size_t buffer_size = 0; + if (input == NULL) return(NULL); + + /* +@@ -724,8 +729,8 @@ + out = buffer; + + while (*cur != '\0') { +- if (out - buffer > buffer_size - 10) { +- int indx = out - buffer; ++ size_t indx = out - buffer; ++ if (indx + 10 > buffer_size) { + + growBufferReentrant(); + out = &buffer[indx]; +@@ -774,6 +779,11 @@ + } + *out = 0; + return(buffer); ++ ++mem_error: ++ xmlEntitiesErrMemory("xmlEncodeSpecialChars: realloc failed"); ++ xmlFree(buffer); ++ return(NULL); + } + + /** +--- libxml2-2.7.8/hash.c 2010-10-12 08:25:32.000000000 +0200 ++++ libxml2-2.7.8.patched/hash.c 2012-09-28 12:08:37.392414663 +0200 +@@ -3,7 +3,7 @@ + * + * Reference: Your favorite introductory book on algorithms + * +- * Copyright (C) 2000 Bjorn Reese and Daniel Veillard. ++ * Copyright (C) 2000,2012 Bjorn Reese and Daniel Veillard. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above +@@ -21,6 +21,22 @@ + #include "libxml.h" + + #include ++#ifdef HAVE_STDLIB_H ++#include ++#endif ++#ifdef HAVE_TIME_H ++#include ++#endif ++ ++/* ++ * Following http://www.ocert.org/advisories/ocert-2011-003.html ++ * it seems that having hash randomization might be a good idea ++ * when using XML with untrusted data ++ */ ++#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME) ++#define HASH_RANDOMIZATION ++#endif ++ + #include + #include + #include +@@ -31,6 +47,10 @@ + + /* #define DEBUG_GROW */ + ++#ifdef HASH_RANDOMIZATION ++static int hash_initialized = 0; ++#endif ++ + /* + * A single entry in the hash table + */ +@@ -53,6 +73,9 @@ + int size; + int nbElems; + xmlDictPtr dict; ++#ifdef HASH_RANDOMIZATION ++ int random_seed; ++#endif + }; + + /* +@@ -65,6 +88,9 @@ + unsigned long value = 0L; + char ch; + ++#ifdef HASH_RANDOMIZATION ++ value = table->random_seed; ++#endif + if (name != NULL) { + value += 30 * (*name); + while ((ch = *name++) != 0) { +@@ -92,6 +118,9 @@ + unsigned long value = 0L; + char ch; + ++#ifdef HASH_RANDOMIZATION ++ value = table->random_seed; ++#endif + if (prefix != NULL) + value += 30 * (*prefix); + else +@@ -156,6 +185,13 @@ + table->table = xmlMalloc(size * sizeof(xmlHashEntry)); + if (table->table) { + memset(table->table, 0, size * sizeof(xmlHashEntry)); ++#ifdef HASH_RANDOMIZATION ++ if (!hash_initialized) { ++ srand(time(NULL)); ++ hash_initialized = 1; ++ } ++ table->random_seed = rand(); ++#endif + return(table); + } + xmlFree(table); +--- libxml2-2.7.8/parser.c 2010-11-04 16:55:45.000000000 +0100 ++++ libxml2-2.7.8.patched/parser.c 2012-09-28 12:08:37.440414665 +0200 +@@ -40,6 +40,7 @@ + #endif + + #include ++#include + #include + #include + #include +@@ -114,10 +115,10 @@ + * parser option. + */ + static int +-xmlParserEntityCheck(xmlParserCtxtPtr ctxt, unsigned long size, ++xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size, + xmlEntityPtr ent) + { +- unsigned long consumed = 0; ++ size_t consumed = 0; + + if ((ctxt == NULL) || (ctxt->options & XML_PARSE_HUGE)) + return (0); +@@ -2580,15 +2581,17 @@ + + /* + * Macro used to grow the current buffer. ++ * buffer##_size is expected to be a size_t ++ * mem_error: is expected to handle memory allocation failures + */ + #define growBuffer(buffer, n) { \ + xmlChar *tmp; \ +- buffer##_size *= 2; \ +- buffer##_size += n; \ +- tmp = (xmlChar *) \ +- xmlRealloc(buffer, buffer##_size * sizeof(xmlChar)); \ ++ size_t new_size = buffer##_size * 2 + n; \ ++ if (new_size < buffer##_size) goto mem_error; \ ++ tmp = (xmlChar *) xmlRealloc(buffer, new_size); \ + if (tmp == NULL) goto mem_error; \ + buffer = tmp; \ ++ buffer##_size = new_size; \ + } + + /** +@@ -2614,14 +2617,14 @@ + xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, + int what, xmlChar end, xmlChar end2, xmlChar end3) { + xmlChar *buffer = NULL; +- int buffer_size = 0; ++ size_t buffer_size = 0; ++ size_t nbchars = 0; + + xmlChar *current = NULL; + xmlChar *rep = NULL; + const xmlChar *last; + xmlEntityPtr ent; + int c,l; +- int nbchars = 0; + + if ((ctxt == NULL) || (str == NULL) || (len < 0)) + return(NULL); +@@ -2638,7 +2641,7 @@ + * allocate a translation buffer. + */ + buffer_size = XML_PARSER_BIG_BUFFER_SIZE; +- buffer = (xmlChar *) xmlMallocAtomic(buffer_size * sizeof(xmlChar)); ++ buffer = (xmlChar *) xmlMallocAtomic(buffer_size); + if (buffer == NULL) goto mem_error; + + /* +@@ -2658,7 +2661,7 @@ + if (val != 0) { + COPY_BUF(0,buffer,nbchars,val); + } +- if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) { ++ if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { + growBuffer(buffer, XML_PARSER_BUFFER_SIZE); + } + } else if ((c == '&') && (what & XML_SUBSTITUTE_REF)) { +@@ -2676,7 +2679,7 @@ + (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) { + if (ent->content != NULL) { + COPY_BUF(0,buffer,nbchars,ent->content[0]); +- if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) { ++ if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { + growBuffer(buffer, XML_PARSER_BUFFER_SIZE); + } + } else { +@@ -2693,8 +2696,7 @@ + current = rep; + while (*current != 0) { /* non input consuming loop */ + buffer[nbchars++] = *current++; +- if (nbchars > +- buffer_size - XML_PARSER_BUFFER_SIZE) { ++ if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { + if (xmlParserEntityCheck(ctxt, nbchars, ent)) + goto int_error; + growBuffer(buffer, XML_PARSER_BUFFER_SIZE); +@@ -2708,8 +2710,8 @@ + const xmlChar *cur = ent->name; + + buffer[nbchars++] = '&'; +- if (nbchars > buffer_size - i - XML_PARSER_BUFFER_SIZE) { +- growBuffer(buffer, XML_PARSER_BUFFER_SIZE); ++ if (nbchars + i + XML_PARSER_BUFFER_SIZE > buffer_size) { ++ growBuffer(buffer, i + XML_PARSER_BUFFER_SIZE); + } + for (;i > 0;i--) + buffer[nbchars++] = *cur++; +@@ -2736,8 +2738,7 @@ + current = rep; + while (*current != 0) { /* non input consuming loop */ + buffer[nbchars++] = *current++; +- if (nbchars > +- buffer_size - XML_PARSER_BUFFER_SIZE) { ++ if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { + if (xmlParserEntityCheck(ctxt, nbchars, ent)) + goto int_error; + growBuffer(buffer, XML_PARSER_BUFFER_SIZE); +@@ -2750,8 +2751,8 @@ + } else { + COPY_BUF(l,buffer,nbchars,c); + str += l; +- if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) { +- growBuffer(buffer, XML_PARSER_BUFFER_SIZE); ++ if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { ++ growBuffer(buffer, XML_PARSER_BUFFER_SIZE); + } + } + if (str < last) +@@ -3755,8 +3756,8 @@ + xmlChar limit = 0; + xmlChar *buf = NULL; + xmlChar *rep = NULL; +- int len = 0; +- int buf_size = 0; ++ size_t len = 0; ++ size_t buf_size = 0; + int c, l, in_space = 0; + xmlChar *current = NULL; + xmlEntityPtr ent; +@@ -3778,7 +3779,7 @@ + * allocate a translation buffer. + */ + buf_size = XML_PARSER_BUFFER_SIZE; +- buf = (xmlChar *) xmlMallocAtomic(buf_size * sizeof(xmlChar)); ++ buf = (xmlChar *) xmlMallocAtomic(buf_size); + if (buf == NULL) goto mem_error; + + /* +@@ -3795,7 +3796,7 @@ + + if (val == '&') { + if (ctxt->replaceEntities) { +- if (len > buf_size - 10) { ++ if (len + 10 > buf_size) { + growBuffer(buf, 10); + } + buf[len++] = '&'; +@@ -3804,7 +3805,7 @@ + * The reparsing will be done in xmlStringGetNodeList() + * called by the attribute() function in SAX.c + */ +- if (len > buf_size - 10) { ++ if (len + 10 > buf_size) { + growBuffer(buf, 10); + } + buf[len++] = '&'; +@@ -3814,7 +3815,7 @@ + buf[len++] = ';'; + } + } else if (val != 0) { +- if (len > buf_size - 10) { ++ if (len + 10 > buf_size) { + growBuffer(buf, 10); + } + len += xmlCopyChar(0, &buf[len], val); +@@ -3826,7 +3827,7 @@ + ctxt->nbentities += ent->owner; + if ((ent != NULL) && + (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) { +- if (len > buf_size - 10) { ++ if (len + 10 > buf_size) { + growBuffer(buf, 10); + } + if ((ctxt->replaceEntities == 0) && +@@ -3854,7 +3855,7 @@ + current++; + } else + buf[len++] = *current++; +- if (len > buf_size - 10) { ++ if (len + 10 > buf_size) { + growBuffer(buf, 10); + } + } +@@ -3862,7 +3863,7 @@ + rep = NULL; + } + } else { +- if (len > buf_size - 10) { ++ if (len + 10 > buf_size) { + growBuffer(buf, 10); + } + if (ent->content != NULL) +@@ -3890,7 +3891,7 @@ + * Just output the reference + */ + buf[len++] = '&'; +- while (len > buf_size - i - 10) { ++ while (len + i + 10 > buf_size) { + growBuffer(buf, i + 10); + } + for (;i > 0;i--) +@@ -3903,7 +3904,7 @@ + if ((len != 0) || (!normalize)) { + if ((!normalize) || (!in_space)) { + COPY_BUF(l,buf,len,0x20); +- while (len > buf_size - 10) { ++ while (len + 10 > buf_size) { + growBuffer(buf, 10); + } + } +@@ -3912,7 +3913,7 @@ + } else { + in_space = 0; + COPY_BUF(l,buf,len,c); +- if (len > buf_size - 10) { ++ if (len + 10 > buf_size) { + growBuffer(buf, 10); + } + } +@@ -3937,7 +3938,18 @@ + } + } else + NEXT; +- if (attlen != NULL) *attlen = len; ++ ++ /* ++ * There we potentially risk an overflow, don't allow attribute value of ++ * lenght more than INT_MAX it is a very reasonnable assumption ! ++ */ ++ if (len >= INT_MAX) { ++ xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, ++ "AttValue lenght too long\n"); ++ goto mem_error; ++ } ++ ++ if (attlen != NULL) *attlen = (int) len; + return(buf); + + mem_error: +@@ -4949,7 +4961,8 @@ + (ctxt->sax->processingInstruction != NULL)) + ctxt->sax->processingInstruction(ctxt->userData, + target, NULL); +- ctxt->instate = state; ++ if (ctxt->instate != XML_PARSER_EOF) ++ ctxt->instate = state; + return; + } + buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); +@@ -5029,7 +5042,8 @@ + } else { + xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL); + } +- ctxt->instate = state; ++ if (ctxt->instate != XML_PARSER_EOF) ++ ctxt->instate = state; + } + } + +@@ -9588,6 +9602,8 @@ + else + name = xmlParseStartTag(ctxt); + #endif /* LIBXML_SAX1_ENABLED */ ++ if (ctxt->instate == XML_PARSER_EOF) ++ return; + if (name == NULL) { + spacePop(ctxt); + return; +@@ -10967,6 +10983,8 @@ + else + name = xmlParseStartTag(ctxt); + #endif /* LIBXML_SAX1_ENABLED */ ++ if (ctxt->instate == XML_PARSER_EOF) ++ goto done; + if (name == NULL) { + spacePop(ctxt); + ctxt->instate = XML_PARSER_EOF; +@@ -11153,7 +11171,9 @@ + else + xmlParseEndTag1(ctxt, 0); + #endif /* LIBXML_SAX1_ENABLED */ +- if (ctxt->nameNr == 0) { ++ if (ctxt->instate == XML_PARSER_EOF) { ++ /* Nothing */ ++ } else if (ctxt->nameNr == 0) { + ctxt->instate = XML_PARSER_EPILOG; + } else { + ctxt->instate = XML_PARSER_CONTENT; +--- libxml2-2.7.8/xmllint.c 2010-11-03 15:49:11.000000000 +0100 ++++ libxml2-2.7.8.patched/xmllint.c 2012-09-28 12:08:37.436414665 +0200 +@@ -2976,7 +2976,7 @@ + printf("\t--huge : remove any internal arbitrary parser limits\n"); + printf("\t--noent : substitute entity references by their value\n"); + printf("\t--noout : don't output the result tree\n"); +- printf("\t--path 'paths': provide a set of paths for resources\n"); ++ printf("\t--path 'paths' : provide a set of paths for resources\n"); + printf("\t--load-trace : print trace of all external entites loaded\n"); + printf("\t--nonet : refuse to fetch DTDs or entities over network\n"); + printf("\t--nocompact : do not generate compact text nodes\n"); +@@ -3032,7 +3032,7 @@ + printf("\t--catalogs : use SGML catalogs from $SGML_CATALOG_FILES\n"); + printf("\t otherwise XML Catalogs starting from \n"); + printf("\t %s are activated by default\n", XML_XML_DEFAULT_CATALOG); +- printf("\t--nocatalogs: deactivate all catalogs\n"); ++ printf("\t--nocatalogs : deactivate all catalogs\n"); + #endif + printf("\t--auto : generate a small doc on the fly\n"); + #ifdef LIBXML_XINCLUDE_ENABLED +--- libxml2-2.7.8/xpath.c 2010-11-03 20:18:27.000000000 +0100 ++++ libxml2-2.7.8.patched/xpath.c 2012-09-28 12:08:37.444414664 +0200 +@@ -252,6 +252,7 @@ + "Encoding error\n", + "Char out of XML range\n", + "Invalid or incomplete context\n", ++ "Stack usage errror\n", + "?? Unknown error ??\n" /* Must be last in the list! */ + }; + #define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) / \ +@@ -2398,6 +2399,42 @@ + ************************************************************************/ + + /** ++ * xmlXPathSetFrame: ++ * @ctxt: an XPath parser context ++ * ++ * Set the callee evaluation frame ++ * ++ * Returns the previous frame value to be restored once done ++ */ ++static int ++xmlXPathSetFrame(xmlXPathParserContextPtr ctxt) { ++ int ret; ++ ++ if (ctxt == NULL) ++ return(0); ++ ret = ctxt->valueFrame; ++ ctxt->valueFrame = ctxt->valueNr; ++ return(ret); ++} ++ ++/** ++ * xmlXPathPopFrame: ++ * @ctxt: an XPath parser context ++ * @frame: the previous frame value ++ * ++ * Remove the callee evaluation frame ++ */ ++static void ++xmlXPathPopFrame(xmlXPathParserContextPtr ctxt, int frame) { ++ if (ctxt == NULL) ++ return; ++ if (ctxt->valueNr < ctxt->valueFrame) { ++ xmlXPatherror(ctxt, __FILE__, __LINE__, XPATH_STACK_ERROR); ++ } ++ ctxt->valueFrame = frame; ++} ++ ++/** + * valuePop: + * @ctxt: an XPath evaluation context + * +@@ -2412,6 +2449,12 @@ + + if ((ctxt == NULL) || (ctxt->valueNr <= 0)) + return (NULL); ++ ++ if (ctxt->valueNr <= ctxt->valueFrame) { ++ xmlXPatherror(ctxt, __FILE__, __LINE__, XPATH_STACK_ERROR); ++ return (NULL); ++ } ++ + ctxt->valueNr--; + if (ctxt->valueNr > 0) + ctxt->value = ctxt->valueTab[ctxt->valueNr - 1]; +@@ -3522,13 +3565,13 @@ + } else if (cur->nodeNr == cur->nodeMax) { + xmlNodePtr *temp; + +- cur->nodeMax *= 2; +- temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * ++ temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * 2 * + sizeof(xmlNodePtr)); + if (temp == NULL) { + xmlXPathErrMemory(NULL, "growing nodeset\n"); + return; + } ++ cur->nodeMax *= 2; + cur->nodeTab = temp; + } + cur->nodeTab[cur->nodeNr++] = xmlXPathNodeSetDupNs(node, ns); +@@ -3627,14 +3670,14 @@ + } else if (cur->nodeNr == cur->nodeMax) { + xmlNodePtr *temp; + +- cur->nodeMax *= 2; +- temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * ++ temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * 2 * + sizeof(xmlNodePtr)); + if (temp == NULL) { + xmlXPathErrMemory(NULL, "growing nodeset\n"); + return; + } + cur->nodeTab = temp; ++ cur->nodeMax *= 2; + } + if (val->type == XML_NAMESPACE_DECL) { + xmlNsPtr ns = (xmlNsPtr) val; +@@ -3738,14 +3781,14 @@ + } else if (val1->nodeNr == val1->nodeMax) { + xmlNodePtr *temp; + +- val1->nodeMax *= 2; +- temp = (xmlNodePtr *) xmlRealloc(val1->nodeTab, val1->nodeMax * ++ temp = (xmlNodePtr *) xmlRealloc(val1->nodeTab, val1->nodeMax * 2 * + sizeof(xmlNodePtr)); + if (temp == NULL) { + xmlXPathErrMemory(NULL, "merging nodeset\n"); + return(NULL); + } + val1->nodeTab = temp; ++ val1->nodeMax *= 2; + } + if (n2->type == XML_NAMESPACE_DECL) { + xmlNsPtr ns = (xmlNsPtr) n2; +@@ -3907,14 +3950,14 @@ + } else if (set1->nodeNr >= set1->nodeMax) { + xmlNodePtr *temp; + +- set1->nodeMax *= 2; + temp = (xmlNodePtr *) xmlRealloc( +- set1->nodeTab, set1->nodeMax * sizeof(xmlNodePtr)); ++ set1->nodeTab, set1->nodeMax * 2 * sizeof(xmlNodePtr)); + if (temp == NULL) { + xmlXPathErrMemory(NULL, "merging nodeset\n"); + return(NULL); + } + set1->nodeTab = temp; ++ set1->nodeMax *= 2; + } + if (n2->type == XML_NAMESPACE_DECL) { + xmlNsPtr ns = (xmlNsPtr) n2; +@@ -3991,14 +4034,14 @@ + } else if (set1->nodeNr >= set1->nodeMax) { + xmlNodePtr *temp; + +- set1->nodeMax *= 2; + temp = (xmlNodePtr *) xmlRealloc( +- set1->nodeTab, set1->nodeMax * sizeof(xmlNodePtr)); ++ set1->nodeTab, set1->nodeMax * 2 * sizeof(xmlNodePtr)); + if (temp == NULL) { + xmlXPathErrMemory(NULL, "merging nodeset\n"); + return(NULL); + } + set1->nodeTab = temp; ++ set1->nodeMax *= 2; + } + set1->nodeTab[set1->nodeNr++] = n2; + } +@@ -6154,6 +6197,7 @@ + ret->valueNr = 0; + ret->valueMax = 10; + ret->value = NULL; ++ ret->valueFrame = 0; + + ret->context = ctxt; + ret->comp = comp; +@@ -11712,6 +11756,7 @@ + xmlXPathObjectPtr contextObj = NULL, exprRes = NULL; + xmlNodePtr oldContextNode, contextNode = NULL; + xmlXPathContextPtr xpctxt = ctxt->context; ++ int frame; + + #ifdef LIBXML_XPTR_ENABLED + /* +@@ -11731,6 +11776,8 @@ + */ + exprOp = &ctxt->comp->steps[op->ch2]; + for (i = 0; i < set->nodeNr; i++) { ++ xmlXPathObjectPtr tmp; ++ + if (set->nodeTab[i] == NULL) + continue; + +@@ -11758,18 +11805,25 @@ + xmlXPathNodeSetAddUnique(contextObj->nodesetval, + contextNode); + ++ frame = xmlXPathSetFrame(ctxt); + valuePush(ctxt, contextObj); + res = xmlXPathCompOpEvalToBoolean(ctxt, exprOp, 1); ++ tmp = valuePop(ctxt); ++ xmlXPathPopFrame(ctxt, frame); + + if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) { +- xmlXPathObjectPtr tmp; +- /* pop the result */ +- tmp = valuePop(ctxt); +- xmlXPathReleaseObject(xpctxt, tmp); +- /* then pop off contextObj, which will be freed later */ +- valuePop(ctxt); ++ while (tmp != contextObj) { ++ /* ++ * Free up the result ++ * then pop off contextObj, which will be freed later ++ */ ++ xmlXPathReleaseObject(xpctxt, tmp); ++ tmp = valuePop(ctxt); ++ } + goto evaluation_error; + } ++ /* push the result back onto the stack */ ++ valuePush(ctxt, tmp); + + if (res) + pos++; +@@ -13357,6 +13411,7 @@ + xmlGenericError(xmlGenericErrorContext, + "xmlXPathCompOpEval: variable %s bound to undefined prefix %s\n", + (char *) op->value4, (char *)op->value5); ++ ctxt->error = XPATH_UNDEF_PREFIX_ERROR; + return (total); + } + val = xmlXPathVariableLookupNS(ctxt->context, +@@ -13373,7 +13428,9 @@ + xmlXPathFunction func; + const xmlChar *oldFunc, *oldFuncURI; + int i; ++ int frame; + ++ frame = xmlXPathSetFrame(ctxt); + if (op->ch1 != -1) + total += + xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); +@@ -13381,15 +13438,18 @@ + xmlGenericError(xmlGenericErrorContext, + "xmlXPathCompOpEval: parameter error\n"); + ctxt->error = XPATH_INVALID_OPERAND; ++ xmlXPathPopFrame(ctxt, frame); + return (total); + } +- for (i = 0; i < op->value; i++) ++ for (i = 0; i < op->value; i++) { + if (ctxt->valueTab[(ctxt->valueNr - 1) - i] == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlXPathCompOpEval: parameter error\n"); + ctxt->error = XPATH_INVALID_OPERAND; ++ xmlXPathPopFrame(ctxt, frame); + return (total); + } ++ } + if (op->cache != NULL) + XML_CAST_FPTR(func) = op->cache; + else { +@@ -13405,6 +13465,8 @@ + xmlGenericError(xmlGenericErrorContext, + "xmlXPathCompOpEval: function %s bound to undefined prefix %s\n", + (char *)op->value4, (char *)op->value5); ++ ctxt->error = XPATH_UNDEF_PREFIX_ERROR; ++ xmlXPathPopFrame(ctxt, frame); + return (total); + } + func = xmlXPathFunctionLookupNS(ctxt->context, +@@ -13426,6 +13488,7 @@ + func(ctxt, op->value); + ctxt->context->function = oldFunc; + ctxt->context->functionURI = oldFuncURI; ++ xmlXPathPopFrame(ctxt, frame); + return (total); + } + case XPATH_OP_ARG: +@@ -14329,6 +14392,7 @@ + ctxt->valueNr = 0; + ctxt->valueMax = 10; + ctxt->value = NULL; ++ ctxt->valueFrame = 0; + } + #ifdef XPATH_STREAMING + if (ctxt->comp->stream) { +--- libxml2-2.7.8/xpointer.c 2010-10-12 08:25:33.000000000 +0200 ++++ libxml2-2.7.8.patched/xpointer.c 2012-09-28 12:08:37.428414664 +0200 +@@ -1007,21 +1007,14 @@ + NEXT; + break; + } +- *cur++ = CUR; + } else if (CUR == '(') { + level++; +- *cur++ = CUR; + } else if (CUR == '^') { +- NEXT; +- if ((CUR == ')') || (CUR == '(') || (CUR == '^')) { +- *cur++ = CUR; +- } else { +- *cur++ = '^'; +- *cur++ = CUR; +- } +- } else { +- *cur++ = CUR; ++ if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) { ++ NEXT; ++ } + } ++ *cur++ = CUR; + NEXT; + } + *cur = 0; +@@ -1269,6 +1262,7 @@ + ctxt->valueNr = 0; + ctxt->valueMax = 10; + ctxt->value = NULL; ++ ctxt->valueFrame = 0; + } + SKIP_BLANKS; + if (CUR == '/') { +--- libxml2-2.7.8/libxml.h 2010-10-12 08:25:32.000000000 +0200 ++++ libxml2-2.7.8.patched/libxml.h 2012-09-28 12:08:37.432414664 +0200 +@@ -13,6 +13,9 @@ + #ifndef _LARGEFILE_SOURCE + #define _LARGEFILE_SOURCE + #endif ++#ifndef _LARGEFILE64_SOURCE ++#define _LARGEFILE64_SOURCE ++#endif + #ifndef _FILE_OFFSET_BITS + #define _FILE_OFFSET_BITS 64 + #endif +--- libxml2-2.7.8/include/libxml/xpath.h 2010-10-12 08:25:32.000000000 +0200 ++++ libxml2-2.7.8.patched/include/libxml/xpath.h 2012-09-28 12:08:37.456414665 +0200 +@@ -68,7 +68,8 @@ + XPATH_UNDEF_PREFIX_ERROR, + XPATH_ENCODING_ERROR, + XPATH_INVALID_CHAR_ERROR, +- XPATH_INVALID_CTXT ++ XPATH_INVALID_CTXT, ++ XPATH_STACK_ERROR + } xmlXPathError; + + /* +@@ -380,6 +381,8 @@ + xmlXPathCompExprPtr comp; /* the precompiled expression */ + int xptr; /* it this an XPointer expression */ + xmlNodePtr ancestor; /* used for walking preceding axis */ ++ ++ int valueFrame; /* used to limit Pop on the stack */ + }; + + /************************************************************************ diff --git a/libs/libxslt/Makefile b/libs/libxslt/Makefile new file mode 100644 index 0000000..4d76669 --- /dev/null +++ b/libs/libxslt/Makefile @@ -0,0 +1,146 @@ +# +# Copyright (C) 2006-2011 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:=libxslt +PKG_VERSION:=1.1.26 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://xmlsoft.org/sources/ \ + ftp://fr.rpmfind.net/pub/libxml/ +PKG_MD5SUM:=e61d0364a30146aaa3001296f853b2b9 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libxslt + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libxml2 + TITLE:=Gnome XSLT library + URL:=http://xmlsoft.org/XSLT/ +endef + +define Package/libxslt/description + A library for XML transformation using XSLT. +endef + +define Package/libexslt + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libxslt + TITLE:=Gnome XSLT library Extention + URL:=http://xmlsoft.org/XSLT/EXSLT/ +endef + +define Package/libexslt/description + A extention for XSLT. +endef + +define Package/xsltproc + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libxml2 +libxslt +libexslt + TITLE:=Gnome XSLT xsltproc Utility + URL:=http://xmlsoft.org/XSLT/ +endef + +define Package/xsltproc/description + XSLT XML transformation utility +endef + +CONFIGURE_ARGS+= \ + --enable-shared \ + --enable-static \ + --without-python \ + --without-crypto \ + --without-debug \ + --without-mem-debug \ + --without-debugger \ + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev/Xslt + $(INSTALL_DIR) $(1)/usr/bin $(2)/bin $(1)/usr/include/libxslt \ + $(1)/usr/include/libexslt $(1)/usr/lib \ + $(1)/usr/lib/pkgconfig $(2)/share/aclocal + + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/xslt-config \ + $(2)/bin/ + + ln -sf $(STAGING_DIR)/host/bin/xslt-config $(1)/usr/bin/xslt-config + + $(SED) \ + 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ + $(2)/bin/xslt-config + + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/libxslt/* \ + $(1)/usr/include/libxslt/ + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxslt.{la,a,so*} \ + $(1)/usr/lib/ + + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxslt.pc \ + $(1)/usr/lib/pkgconfig/ + + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/aclocal/* \ + $(2)/share/aclocal +endef + +define Build/InstallDev/Exslt + $(INSTALL_DIR) $(1)/usr/include/libexslt $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/libexslt/* \ + $(1)/usr/include/libexslt/ + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libexslt.{la,a,so*} \ + $(1)/usr/lib/ + + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libexslt.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Build/InstallDev + $(if $(CONFIG_PACKAGE_libxslt),$(call Build/InstallDev/Xslt,$(1),$(2))) + $(if $(CONFIG_PACKAGE_libexslt),$(call Build/InstallDev/Exslt,$(1),$(2))) +endef + +define Package/libxslt/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxslt.so.* \ + $(1)/usr/lib/ +endef + +define Package/libexslt/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libexslt.so.* \ + $(1)/usr/lib/ +endef + +define Package/xsltproc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/xsltproc \ + $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libxslt)) +$(eval $(call BuildPackage,libexslt)) +$(eval $(call BuildPackage,xsltproc)) diff --git a/libs/libyaml/Makefile b/libs/libyaml/Makefile new file mode 100644 index 0000000..78f996a --- /dev/null +++ b/libs/libyaml/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=yaml +PKG_VERSION:=0.1.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://pyyaml.org/download/libyaml/ +PKG_MD5SUM:=b8ab9064e8e0330423fe640de76608cd + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(FPIC) + +define Package/libyaml + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=libyaml + URL:=http://pyyaml.org/wiki/LibYAML +endef + +define Package/libyaml/description + yaml library written in c +endef + +define Package/libyaml/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libyaml.so $(1)/usr/lib/ +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libyaml.{a,la} $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libyaml)) diff --git a/libs/libzip/Makefile b/libs/libzip/Makefile new file mode 100644 index 0000000..e38557e --- /dev/null +++ b/libs/libzip/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (C) 2012 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:=libzip +PKG_VERSION:=0.10.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.nih.at/libzip/ +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libzip/default + TITLE:=libzip + URL:=http://www.nih.at/libzip/ +endef + +define Package/libzip +$(call Package/libzip/default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+zlib +endef + +define Package/libzip-utils +$(call Package/libzip/default) + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=compression + TITLE+= utilities + DEPENDS:=+libzip +endef + +define Package/libzip/description + C library for reading, creating, and modifying zip archives +endef + +define Package/libzip-utils/description + package contains binaries from libzip library (zipcmp, ziptorrent, zipmerge) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig + + $(CP) $(PKG_INSTALL_DIR)/usr/include/* \ + $(PKG_INSTALL_DIR)/usr/lib/libzip/include/* \ + $(1)/usr/include/ + + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,la,so*} \ + $(1)/usr/lib/ + + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libzip.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/libzip/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/ +endef + +define Package/libzip-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libzip)) +$(eval $(call BuildPackage,libzip-utils)) diff --git a/libs/libzstream/Makefile b/libs/libzstream/Makefile new file mode 100644 index 0000000..f16642a --- /dev/null +++ b/libs/libzstream/Makefile @@ -0,0 +1,69 @@ +# +# Copyright (C) 2012 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:=libzstream +PKG_VERSION:=2012-06-11 +PKG_RELEASE=$(PKG_SOURCE_VERSION) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://dev.freecwmp.org/zstream-clone/ +# PKG_SOURCE_URL:=git://midlink.org/zstream.git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=3b9748999aa3d81a5811eff1cc221266a2588e28 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz + +include $(INCLUDE_DIR)/package.mk + +define Package/libzstream + SECTION:=libs + CATEGORY:=Libraries + TITLE:=minimalistic network stream library + DEPENDS:=+libubox +libopenssl +endef + +define Package/zstream + SECTION:=net + CATEGORY:=Network + SUBMENU:=File Transfer + TITLE:=minimalistic network stream client + DEPENDS:=+libzstream +endef + +TARGET_LDFLAGS += \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/zstream.h $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/include/zstream + $(CP) $(PKG_BUILD_DIR)/zstream/http.h $(1)/usr/include/zstream + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_BUILD_DIR)/libzstream.so $(1)/usr/lib +endef + +define Package/libzstream/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_BUILD_DIR)/libzstream.so $(1)/usr/lib +endef + +define Package/zstream/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DATA) $(PKG_BUILD_DIR)/cli/zstream $(1)/usr/bin +endef + +$(eval $(call BuildPackage,libzstream)) +$(eval $(call BuildPackage,zstream)) diff --git a/libs/lzo/Makefile b/libs/lzo/Makefile new file mode 100644 index 0000000..87e858e --- /dev/null +++ b/libs/lzo/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2006-2012 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:=lzo +PKG_VERSION:=2.06 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.oberhumer.com/opensource/lzo/download/ +PKG_MD5SUM:=95380bd4081f85ef08c5209f4107e9f8 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/liblzo + SECTION:=libs + CATEGORY:=Libraries + TITLE:=A real-time data compression library + URL:=http://www.oberhumer.com/opensource/lzo/ +endef + +define Package/liblzo/description + LZO is a data compression library which is suitable for data de-/compression + in real-time. This means it favours speed over compression ratio. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + ) +endef + +TARGET_CFLAGS += $(FPIC) +MAKE_FLAGS += CFLAGS_O="$(TARGET_CFLAGS)" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/include/lzo $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzo2.{a,so*} $(1)/usr/lib/ +endef + +define Package/liblzo/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzo2.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,liblzo)) diff --git a/libs/matrixssl/Makefile b/libs/matrixssl/Makefile new file mode 100644 index 0000000..6580b8c --- /dev/null +++ b/libs/matrixssl/Makefile @@ -0,0 +1,57 @@ +# +# 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:=matrixssl +PKG_VERSION:=1.2.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://nbd.vd-s.ath.cx/openwrt +PKG_MD5SUM:=771c1489488e62668d673478311d63ca + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libmatrixssl + SECTION:=libs + SUBMENU:=SSL + CATEGORY:=Libraries + DEPENDS:=+libpthread + TITLE:=Embedded SSL implementation + URL:=http://www.matrixssl.org/ +endef + +define Build/Configure +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/src \ + $(TARGET_CONFIGURE_OPTS) \ + DFLAGS="$(TARGET_CFLAGS) -Wall" +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/matrixSsl + $(CP) $(PKG_BUILD_DIR)/matrixSsl.h $(1)/usr/include/matrixSsl/ + ln -sf matrixSsl/matrixSsl.h $(1)/usr/include/matrixSsl.h + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/src/libmatrixssl.so* $(1)/usr/lib/ +endef + +define Package/libmatrixssl/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/src/libmatrixssl.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libmatrixssl)) diff --git a/libs/matrixssl/patches/100-matrixssl_1.2.4.patch b/libs/matrixssl/patches/100-matrixssl_1.2.4.patch new file mode 100644 index 0000000..b4a2bc9 --- /dev/null +++ b/libs/matrixssl/patches/100-matrixssl_1.2.4.patch @@ -0,0 +1,1971 @@ +diff -urN matrixssl.old/matrixSsl.h matrixssl/matrixSsl.h +--- matrixssl.old/matrixSsl.h 2005-02-23 22:43:10.000000000 +0100 ++++ matrixssl/matrixSsl.h 2005-03-06 01:32:33.000000000 +0100 +@@ -154,6 +154,29 @@ + + #define SSL_OPTION_DELETE_SESSION 0 + ++ ++#define SSL_MD5_DIGEST_LENGTH 16 ++#define SSL_MD5_CONTEXT_DATA_SIZE 96 ++ ++typedef struct { ++ unsigned char data[SSL_MD5_CONTEXT_DATA_SIZE]; ++} sslMd5Context_t; ++ ++ ++#define SSL_SHA1_DIGEST_LENGTH 20 ++#define SSL_SHA1_CONTEXT_DATA_SIZE 96 ++ ++typedef struct { ++ unsigned char data[SSL_SHA1_CONTEXT_DATA_SIZE]; ++} sslSha1Context_t; ++ ++ ++#define SSL_CIPHER_CONTEXT_DATA_SIZE 784 ++ ++typedef struct { ++ unsigned char data[SSL_CIPHER_CONTEXT_DATA_SIZE]; ++} sslCipherContext_t; ++ + /******************************************************************************/ + /* + Explicitly import these apis on Windows. If we're being included from the +@@ -220,6 +243,71 @@ + char *privBuf, int32 privLen, char *privPass, + char *trustedCABuf, int32 trustedCALen); + ++ ++/* ++ ARC4 (RC4) API ++*/ ++ ++SSLPUBLIC void matrixArc4Init(sslCipherContext_t *ctx, unsigned char *key, ++ int keylen); ++ ++SSLPUBLIC int matrixArc4(sslCipherContext_t *ctx, unsigned char *in, ++ unsigned char *out, int len); ++ ++/* ++ 3DES (Triple-DES) API ++*/ ++ ++SSLPUBLIC int matrix3desInit(sslCipherContext_t *ctx, unsigned char *IV, ++ unsigned char *key, int keylen); ++ ++SSLPUBLIC int matrix3desEncrypt(sslCipherContext_t *ctx, unsigned char *pt, ++ unsigned char *ct, int len); ++ ++SSLPUBLIC int matrix3desDecrypt(sslCipherContext_t *ctx, unsigned char *ct, ++ unsigned char *pt, int len); ++ ++/* ++ AES API ++*/ ++ ++SSLPUBLIC int matrixAesInit(sslCipherContext_t *ctx, unsigned char *IV, ++ unsigned char *key, int keylen); ++ ++SSLPUBLIC int matrixAesEncrypt(sslCipherContext_t *ctx, unsigned char *pt, ++ unsigned char *ct, int len); ++ ++SSLPUBLIC int matrixAesDecrypt(sslCipherContext_t *ctx, unsigned char *ct, ++ unsigned char *pt, int len); ++ ++/* ++ MD5 API ++*/ ++ ++SSLPUBLIC void matrixMd5Init(sslMd5Context_t *ctx); ++ ++SSLPUBLIC void matrixMd5Update(sslMd5Context_t *ctx, const unsigned char *buf, ++ unsigned long len); ++ ++SSLPUBLIC int matrixMd5Final(sslMd5Context_t *ctx, unsigned char *hash); ++ ++SSLPUBLIC unsigned char *matrixMd5Digest(const unsigned char *buf, ++ unsigned long len, unsigned char *hash); ++ ++/* ++ SHA1 API ++*/ ++ ++SSLPUBLIC void matrixSha1Init(sslSha1Context_t *ctx); ++ ++SSLPUBLIC void matrixSha1Update(sslSha1Context_t *ctx, const unsigned char *buf, ++ unsigned long len); ++ ++SSLPUBLIC int matrixSha1Final(sslSha1Context_t *ctx, unsigned char *hash); ++ ++SSLPUBLIC unsigned char *matrixSha1Digest(const unsigned char *buf, ++ unsigned long len, unsigned char *hash); ++ + /******************************************************************************/ + + #ifdef __cplusplus +diff -urN matrixssl.old/src/crypto/cryptoLayer.h matrixssl/src/crypto/cryptoLayer.h +--- matrixssl.old/src/crypto/cryptoLayer.h 2005-02-23 22:43:10.000000000 +0100 ++++ matrixssl/src/crypto/cryptoLayer.h 2005-03-06 01:32:33.000000000 +0100 +@@ -115,6 +115,7 @@ + */ + /* #define USE_FULL_CERT_PARSE */ + /* #define USE_MD2 */ ++#define USE_AES + + /* + Now that we've set up the required defines, include the crypto layer header +diff -urN matrixssl.old/src/crypto/peersec/aes.c matrixssl/src/crypto/peersec/aes.c +--- matrixssl.old/src/crypto/peersec/aes.c 1970-01-01 01:00:00.000000000 +0100 ++++ matrixssl/src/crypto/peersec/aes.c 2005-03-06 01:32:33.000000000 +0100 +@@ -0,0 +1,1708 @@ ++/* ++ * aes.c ++ * ++ * AES CBC block cipher implementation ++ */ ++/* ++ * Copyright (c) PeerSec Networks, 2002-2004. All Rights Reserved. ++ * The latest version of this code is available at http://www.matrixssl.org ++ * ++ * This software is open source; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This General Public License does NOT permit incorporating this software ++ * into proprietary programs. If you are unable to comply with the GPL, a ++ * commercial license for this software may be purchased from PeerSec Networks ++ * at http://www.peersec.com ++ * ++ * This program is distributed in WITHOUT ANY WARRANTY; without even the ++ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++ * See the GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * http://www.gnu.org/copyleft/gpl.html ++ */ ++/******************************************************************************/ ++ ++#include "../cryptoLayer.h" ++ ++#ifdef USE_AES ++ ++/* The precomputed tables for AES */ ++/* ++Te0[x] = S [x].[02, 01, 01, 03]; ++Te1[x] = S [x].[03, 02, 01, 01]; ++Te2[x] = S [x].[01, 03, 02, 01]; ++Te3[x] = S [x].[01, 01, 03, 02]; ++Te4[x] = S [x].[01, 01, 01, 01]; ++ ++Td0[x] = Si[x].[0e, 09, 0d, 0b]; ++Td1[x] = Si[x].[0b, 0e, 09, 0d]; ++Td2[x] = Si[x].[0d, 0b, 0e, 09]; ++Td3[x] = Si[x].[09, 0d, 0b, 0e]; ++Td4[x] = Si[x].[01, 01, 01, 01]; ++*/ ++ ++static const ulong32 TE0[256] = { ++ 0xc66363a5UL, 0xf87c7c84UL, 0xee777799UL, 0xf67b7b8dUL, ++ 0xfff2f20dUL, 0xd66b6bbdUL, 0xde6f6fb1UL, 0x91c5c554UL, ++ 0x60303050UL, 0x02010103UL, 0xce6767a9UL, 0x562b2b7dUL, ++ 0xe7fefe19UL, 0xb5d7d762UL, 0x4dababe6UL, 0xec76769aUL, ++ 0x8fcaca45UL, 0x1f82829dUL, 0x89c9c940UL, 0xfa7d7d87UL, ++ 0xeffafa15UL, 0xb25959ebUL, 0x8e4747c9UL, 0xfbf0f00bUL, ++ 0x41adadecUL, 0xb3d4d467UL, 0x5fa2a2fdUL, 0x45afafeaUL, ++ 0x239c9cbfUL, 0x53a4a4f7UL, 0xe4727296UL, 0x9bc0c05bUL, ++ 0x75b7b7c2UL, 0xe1fdfd1cUL, 0x3d9393aeUL, 0x4c26266aUL, ++ 0x6c36365aUL, 0x7e3f3f41UL, 0xf5f7f702UL, 0x83cccc4fUL, ++ 0x6834345cUL, 0x51a5a5f4UL, 0xd1e5e534UL, 0xf9f1f108UL, ++ 0xe2717193UL, 0xabd8d873UL, 0x62313153UL, 0x2a15153fUL, ++ 0x0804040cUL, 0x95c7c752UL, 0x46232365UL, 0x9dc3c35eUL, ++ 0x30181828UL, 0x379696a1UL, 0x0a05050fUL, 0x2f9a9ab5UL, ++ 0x0e070709UL, 0x24121236UL, 0x1b80809bUL, 0xdfe2e23dUL, ++ 0xcdebeb26UL, 0x4e272769UL, 0x7fb2b2cdUL, 0xea75759fUL, ++ 0x1209091bUL, 0x1d83839eUL, 0x582c2c74UL, 0x341a1a2eUL, ++ 0x361b1b2dUL, 0xdc6e6eb2UL, 0xb45a5aeeUL, 0x5ba0a0fbUL, ++ 0xa45252f6UL, 0x763b3b4dUL, 0xb7d6d661UL, 0x7db3b3ceUL, ++ 0x5229297bUL, 0xdde3e33eUL, 0x5e2f2f71UL, 0x13848497UL, ++ 0xa65353f5UL, 0xb9d1d168UL, 0x00000000UL, 0xc1eded2cUL, ++ 0x40202060UL, 0xe3fcfc1fUL, 0x79b1b1c8UL, 0xb65b5bedUL, ++ 0xd46a6abeUL, 0x8dcbcb46UL, 0x67bebed9UL, 0x7239394bUL, ++ 0x944a4adeUL, 0x984c4cd4UL, 0xb05858e8UL, 0x85cfcf4aUL, ++ 0xbbd0d06bUL, 0xc5efef2aUL, 0x4faaaae5UL, 0xedfbfb16UL, ++ 0x864343c5UL, 0x9a4d4dd7UL, 0x66333355UL, 0x11858594UL, ++ 0x8a4545cfUL, 0xe9f9f910UL, 0x04020206UL, 0xfe7f7f81UL, ++ 0xa05050f0UL, 0x783c3c44UL, 0x259f9fbaUL, 0x4ba8a8e3UL, ++ 0xa25151f3UL, 0x5da3a3feUL, 0x804040c0UL, 0x058f8f8aUL, ++ 0x3f9292adUL, 0x219d9dbcUL, 0x70383848UL, 0xf1f5f504UL, ++ 0x63bcbcdfUL, 0x77b6b6c1UL, 0xafdada75UL, 0x42212163UL, ++ 0x20101030UL, 0xe5ffff1aUL, 0xfdf3f30eUL, 0xbfd2d26dUL, ++ 0x81cdcd4cUL, 0x180c0c14UL, 0x26131335UL, 0xc3ecec2fUL, ++ 0xbe5f5fe1UL, 0x359797a2UL, 0x884444ccUL, 0x2e171739UL, ++ 0x93c4c457UL, 0x55a7a7f2UL, 0xfc7e7e82UL, 0x7a3d3d47UL, ++ 0xc86464acUL, 0xba5d5de7UL, 0x3219192bUL, 0xe6737395UL, ++ 0xc06060a0UL, 0x19818198UL, 0x9e4f4fd1UL, 0xa3dcdc7fUL, ++ 0x44222266UL, 0x542a2a7eUL, 0x3b9090abUL, 0x0b888883UL, ++ 0x8c4646caUL, 0xc7eeee29UL, 0x6bb8b8d3UL, 0x2814143cUL, ++ 0xa7dede79UL, 0xbc5e5ee2UL, 0x160b0b1dUL, 0xaddbdb76UL, ++ 0xdbe0e03bUL, 0x64323256UL, 0x743a3a4eUL, 0x140a0a1eUL, ++ 0x924949dbUL, 0x0c06060aUL, 0x4824246cUL, 0xb85c5ce4UL, ++ 0x9fc2c25dUL, 0xbdd3d36eUL, 0x43acacefUL, 0xc46262a6UL, ++ 0x399191a8UL, 0x319595a4UL, 0xd3e4e437UL, 0xf279798bUL, ++ 0xd5e7e732UL, 0x8bc8c843UL, 0x6e373759UL, 0xda6d6db7UL, ++ 0x018d8d8cUL, 0xb1d5d564UL, 0x9c4e4ed2UL, 0x49a9a9e0UL, ++ 0xd86c6cb4UL, 0xac5656faUL, 0xf3f4f407UL, 0xcfeaea25UL, ++ 0xca6565afUL, 0xf47a7a8eUL, 0x47aeaee9UL, 0x10080818UL, ++ 0x6fbabad5UL, 0xf0787888UL, 0x4a25256fUL, 0x5c2e2e72UL, ++ 0x381c1c24UL, 0x57a6a6f1UL, 0x73b4b4c7UL, 0x97c6c651UL, ++ 0xcbe8e823UL, 0xa1dddd7cUL, 0xe874749cUL, 0x3e1f1f21UL, ++ 0x964b4bddUL, 0x61bdbddcUL, 0x0d8b8b86UL, 0x0f8a8a85UL, ++ 0xe0707090UL, 0x7c3e3e42UL, 0x71b5b5c4UL, 0xcc6666aaUL, ++ 0x904848d8UL, 0x06030305UL, 0xf7f6f601UL, 0x1c0e0e12UL, ++ 0xc26161a3UL, 0x6a35355fUL, 0xae5757f9UL, 0x69b9b9d0UL, ++ 0x17868691UL, 0x99c1c158UL, 0x3a1d1d27UL, 0x279e9eb9UL, ++ 0xd9e1e138UL, 0xebf8f813UL, 0x2b9898b3UL, 0x22111133UL, ++ 0xd26969bbUL, 0xa9d9d970UL, 0x078e8e89UL, 0x339494a7UL, ++ 0x2d9b9bb6UL, 0x3c1e1e22UL, 0x15878792UL, 0xc9e9e920UL, ++ 0x87cece49UL, 0xaa5555ffUL, 0x50282878UL, 0xa5dfdf7aUL, ++ 0x038c8c8fUL, 0x59a1a1f8UL, 0x09898980UL, 0x1a0d0d17UL, ++ 0x65bfbfdaUL, 0xd7e6e631UL, 0x844242c6UL, 0xd06868b8UL, ++ 0x824141c3UL, 0x299999b0UL, 0x5a2d2d77UL, 0x1e0f0f11UL, ++ 0x7bb0b0cbUL, 0xa85454fcUL, 0x6dbbbbd6UL, 0x2c16163aUL, ++}; ++ ++static const ulong32 Te4[256] = { ++ 0x63636363UL, 0x7c7c7c7cUL, 0x77777777UL, 0x7b7b7b7bUL, ++ 0xf2f2f2f2UL, 0x6b6b6b6bUL, 0x6f6f6f6fUL, 0xc5c5c5c5UL, ++ 0x30303030UL, 0x01010101UL, 0x67676767UL, 0x2b2b2b2bUL, ++ 0xfefefefeUL, 0xd7d7d7d7UL, 0xababababUL, 0x76767676UL, ++ 0xcacacacaUL, 0x82828282UL, 0xc9c9c9c9UL, 0x7d7d7d7dUL, ++ 0xfafafafaUL, 0x59595959UL, 0x47474747UL, 0xf0f0f0f0UL, ++ 0xadadadadUL, 0xd4d4d4d4UL, 0xa2a2a2a2UL, 0xafafafafUL, ++ 0x9c9c9c9cUL, 0xa4a4a4a4UL, 0x72727272UL, 0xc0c0c0c0UL, ++ 0xb7b7b7b7UL, 0xfdfdfdfdUL, 0x93939393UL, 0x26262626UL, ++ 0x36363636UL, 0x3f3f3f3fUL, 0xf7f7f7f7UL, 0xccccccccUL, ++ 0x34343434UL, 0xa5a5a5a5UL, 0xe5e5e5e5UL, 0xf1f1f1f1UL, ++ 0x71717171UL, 0xd8d8d8d8UL, 0x31313131UL, 0x15151515UL, ++ 0x04040404UL, 0xc7c7c7c7UL, 0x23232323UL, 0xc3c3c3c3UL, ++ 0x18181818UL, 0x96969696UL, 0x05050505UL, 0x9a9a9a9aUL, ++ 0x07070707UL, 0x12121212UL, 0x80808080UL, 0xe2e2e2e2UL, ++ 0xebebebebUL, 0x27272727UL, 0xb2b2b2b2UL, 0x75757575UL, ++ 0x09090909UL, 0x83838383UL, 0x2c2c2c2cUL, 0x1a1a1a1aUL, ++ 0x1b1b1b1bUL, 0x6e6e6e6eUL, 0x5a5a5a5aUL, 0xa0a0a0a0UL, ++ 0x52525252UL, 0x3b3b3b3bUL, 0xd6d6d6d6UL, 0xb3b3b3b3UL, ++ 0x29292929UL, 0xe3e3e3e3UL, 0x2f2f2f2fUL, 0x84848484UL, ++ 0x53535353UL, 0xd1d1d1d1UL, 0x00000000UL, 0xededededUL, ++ 0x20202020UL, 0xfcfcfcfcUL, 0xb1b1b1b1UL, 0x5b5b5b5bUL, ++ 0x6a6a6a6aUL, 0xcbcbcbcbUL, 0xbebebebeUL, 0x39393939UL, ++ 0x4a4a4a4aUL, 0x4c4c4c4cUL, 0x58585858UL, 0xcfcfcfcfUL, ++ 0xd0d0d0d0UL, 0xefefefefUL, 0xaaaaaaaaUL, 0xfbfbfbfbUL, ++ 0x43434343UL, 0x4d4d4d4dUL, 0x33333333UL, 0x85858585UL, ++ 0x45454545UL, 0xf9f9f9f9UL, 0x02020202UL, 0x7f7f7f7fUL, ++ 0x50505050UL, 0x3c3c3c3cUL, 0x9f9f9f9fUL, 0xa8a8a8a8UL, ++ 0x51515151UL, 0xa3a3a3a3UL, 0x40404040UL, 0x8f8f8f8fUL, ++ 0x92929292UL, 0x9d9d9d9dUL, 0x38383838UL, 0xf5f5f5f5UL, ++ 0xbcbcbcbcUL, 0xb6b6b6b6UL, 0xdadadadaUL, 0x21212121UL, ++ 0x10101010UL, 0xffffffffUL, 0xf3f3f3f3UL, 0xd2d2d2d2UL, ++ 0xcdcdcdcdUL, 0x0c0c0c0cUL, 0x13131313UL, 0xececececUL, ++ 0x5f5f5f5fUL, 0x97979797UL, 0x44444444UL, 0x17171717UL, ++ 0xc4c4c4c4UL, 0xa7a7a7a7UL, 0x7e7e7e7eUL, 0x3d3d3d3dUL, ++ 0x64646464UL, 0x5d5d5d5dUL, 0x19191919UL, 0x73737373UL, ++ 0x60606060UL, 0x81818181UL, 0x4f4f4f4fUL, 0xdcdcdcdcUL, ++ 0x22222222UL, 0x2a2a2a2aUL, 0x90909090UL, 0x88888888UL, ++ 0x46464646UL, 0xeeeeeeeeUL, 0xb8b8b8b8UL, 0x14141414UL, ++ 0xdedededeUL, 0x5e5e5e5eUL, 0x0b0b0b0bUL, 0xdbdbdbdbUL, ++ 0xe0e0e0e0UL, 0x32323232UL, 0x3a3a3a3aUL, 0x0a0a0a0aUL, ++ 0x49494949UL, 0x06060606UL, 0x24242424UL, 0x5c5c5c5cUL, ++ 0xc2c2c2c2UL, 0xd3d3d3d3UL, 0xacacacacUL, 0x62626262UL, ++ 0x91919191UL, 0x95959595UL, 0xe4e4e4e4UL, 0x79797979UL, ++ 0xe7e7e7e7UL, 0xc8c8c8c8UL, 0x37373737UL, 0x6d6d6d6dUL, ++ 0x8d8d8d8dUL, 0xd5d5d5d5UL, 0x4e4e4e4eUL, 0xa9a9a9a9UL, ++ 0x6c6c6c6cUL, 0x56565656UL, 0xf4f4f4f4UL, 0xeaeaeaeaUL, ++ 0x65656565UL, 0x7a7a7a7aUL, 0xaeaeaeaeUL, 0x08080808UL, ++ 0xbabababaUL, 0x78787878UL, 0x25252525UL, 0x2e2e2e2eUL, ++ 0x1c1c1c1cUL, 0xa6a6a6a6UL, 0xb4b4b4b4UL, 0xc6c6c6c6UL, ++ 0xe8e8e8e8UL, 0xddddddddUL, 0x74747474UL, 0x1f1f1f1fUL, ++ 0x4b4b4b4bUL, 0xbdbdbdbdUL, 0x8b8b8b8bUL, 0x8a8a8a8aUL, ++ 0x70707070UL, 0x3e3e3e3eUL, 0xb5b5b5b5UL, 0x66666666UL, ++ 0x48484848UL, 0x03030303UL, 0xf6f6f6f6UL, 0x0e0e0e0eUL, ++ 0x61616161UL, 0x35353535UL, 0x57575757UL, 0xb9b9b9b9UL, ++ 0x86868686UL, 0xc1c1c1c1UL, 0x1d1d1d1dUL, 0x9e9e9e9eUL, ++ 0xe1e1e1e1UL, 0xf8f8f8f8UL, 0x98989898UL, 0x11111111UL, ++ 0x69696969UL, 0xd9d9d9d9UL, 0x8e8e8e8eUL, 0x94949494UL, ++ 0x9b9b9b9bUL, 0x1e1e1e1eUL, 0x87878787UL, 0xe9e9e9e9UL, ++ 0xcecececeUL, 0x55555555UL, 0x28282828UL, 0xdfdfdfdfUL, ++ 0x8c8c8c8cUL, 0xa1a1a1a1UL, 0x89898989UL, 0x0d0d0d0dUL, ++ 0xbfbfbfbfUL, 0xe6e6e6e6UL, 0x42424242UL, 0x68686868UL, ++ 0x41414141UL, 0x99999999UL, 0x2d2d2d2dUL, 0x0f0f0f0fUL, ++ 0xb0b0b0b0UL, 0x54545454UL, 0xbbbbbbbbUL, 0x16161616UL, ++}; ++ ++static const ulong32 TD0[256] = { ++ 0x51f4a750UL, 0x7e416553UL, 0x1a17a4c3UL, 0x3a275e96UL, ++ 0x3bab6bcbUL, 0x1f9d45f1UL, 0xacfa58abUL, 0x4be30393UL, ++ 0x2030fa55UL, 0xad766df6UL, 0x88cc7691UL, 0xf5024c25UL, ++ 0x4fe5d7fcUL, 0xc52acbd7UL, 0x26354480UL, 0xb562a38fUL, ++ 0xdeb15a49UL, 0x25ba1b67UL, 0x45ea0e98UL, 0x5dfec0e1UL, ++ 0xc32f7502UL, 0x814cf012UL, 0x8d4697a3UL, 0x6bd3f9c6UL, ++ 0x038f5fe7UL, 0x15929c95UL, 0xbf6d7aebUL, 0x955259daUL, ++ 0xd4be832dUL, 0x587421d3UL, 0x49e06929UL, 0x8ec9c844UL, ++ 0x75c2896aUL, 0xf48e7978UL, 0x99583e6bUL, 0x27b971ddUL, ++ 0xbee14fb6UL, 0xf088ad17UL, 0xc920ac66UL, 0x7dce3ab4UL, ++ 0x63df4a18UL, 0xe51a3182UL, 0x97513360UL, 0x62537f45UL, ++ 0xb16477e0UL, 0xbb6bae84UL, 0xfe81a01cUL, 0xf9082b94UL, ++ 0x70486858UL, 0x8f45fd19UL, 0x94de6c87UL, 0x527bf8b7UL, ++ 0xab73d323UL, 0x724b02e2UL, 0xe31f8f57UL, 0x6655ab2aUL, ++ 0xb2eb2807UL, 0x2fb5c203UL, 0x86c57b9aUL, 0xd33708a5UL, ++ 0x302887f2UL, 0x23bfa5b2UL, 0x02036abaUL, 0xed16825cUL, ++ 0x8acf1c2bUL, 0xa779b492UL, 0xf307f2f0UL, 0x4e69e2a1UL, ++ 0x65daf4cdUL, 0x0605bed5UL, 0xd134621fUL, 0xc4a6fe8aUL, ++ 0x342e539dUL, 0xa2f355a0UL, 0x058ae132UL, 0xa4f6eb75UL, ++ 0x0b83ec39UL, 0x4060efaaUL, 0x5e719f06UL, 0xbd6e1051UL, ++ 0x3e218af9UL, 0x96dd063dUL, 0xdd3e05aeUL, 0x4de6bd46UL, ++ 0x91548db5UL, 0x71c45d05UL, 0x0406d46fUL, 0x605015ffUL, ++ 0x1998fb24UL, 0xd6bde997UL, 0x894043ccUL, 0x67d99e77UL, ++ 0xb0e842bdUL, 0x07898b88UL, 0xe7195b38UL, 0x79c8eedbUL, ++ 0xa17c0a47UL, 0x7c420fe9UL, 0xf8841ec9UL, 0x00000000UL, ++ 0x09808683UL, 0x322bed48UL, 0x1e1170acUL, 0x6c5a724eUL, ++ 0xfd0efffbUL, 0x0f853856UL, 0x3daed51eUL, 0x362d3927UL, ++ 0x0a0fd964UL, 0x685ca621UL, 0x9b5b54d1UL, 0x24362e3aUL, ++ 0x0c0a67b1UL, 0x9357e70fUL, 0xb4ee96d2UL, 0x1b9b919eUL, ++ 0x80c0c54fUL, 0x61dc20a2UL, 0x5a774b69UL, 0x1c121a16UL, ++ 0xe293ba0aUL, 0xc0a02ae5UL, 0x3c22e043UL, 0x121b171dUL, ++ 0x0e090d0bUL, 0xf28bc7adUL, 0x2db6a8b9UL, 0x141ea9c8UL, ++ 0x57f11985UL, 0xaf75074cUL, 0xee99ddbbUL, 0xa37f60fdUL, ++ 0xf701269fUL, 0x5c72f5bcUL, 0x44663bc5UL, 0x5bfb7e34UL, ++ 0x8b432976UL, 0xcb23c6dcUL, 0xb6edfc68UL, 0xb8e4f163UL, ++ 0xd731dccaUL, 0x42638510UL, 0x13972240UL, 0x84c61120UL, ++ 0x854a247dUL, 0xd2bb3df8UL, 0xaef93211UL, 0xc729a16dUL, ++ 0x1d9e2f4bUL, 0xdcb230f3UL, 0x0d8652ecUL, 0x77c1e3d0UL, ++ 0x2bb3166cUL, 0xa970b999UL, 0x119448faUL, 0x47e96422UL, ++ 0xa8fc8cc4UL, 0xa0f03f1aUL, 0x567d2cd8UL, 0x223390efUL, ++ 0x87494ec7UL, 0xd938d1c1UL, 0x8ccaa2feUL, 0x98d40b36UL, ++ 0xa6f581cfUL, 0xa57ade28UL, 0xdab78e26UL, 0x3fadbfa4UL, ++ 0x2c3a9de4UL, 0x5078920dUL, 0x6a5fcc9bUL, 0x547e4662UL, ++ 0xf68d13c2UL, 0x90d8b8e8UL, 0x2e39f75eUL, 0x82c3aff5UL, ++ 0x9f5d80beUL, 0x69d0937cUL, 0x6fd52da9UL, 0xcf2512b3UL, ++ 0xc8ac993bUL, 0x10187da7UL, 0xe89c636eUL, 0xdb3bbb7bUL, ++ 0xcd267809UL, 0x6e5918f4UL, 0xec9ab701UL, 0x834f9aa8UL, ++ 0xe6956e65UL, 0xaaffe67eUL, 0x21bccf08UL, 0xef15e8e6UL, ++ 0xbae79bd9UL, 0x4a6f36ceUL, 0xea9f09d4UL, 0x29b07cd6UL, ++ 0x31a4b2afUL, 0x2a3f2331UL, 0xc6a59430UL, 0x35a266c0UL, ++ 0x744ebc37UL, 0xfc82caa6UL, 0xe090d0b0UL, 0x33a7d815UL, ++ 0xf104984aUL, 0x41ecdaf7UL, 0x7fcd500eUL, 0x1791f62fUL, ++ 0x764dd68dUL, 0x43efb04dUL, 0xccaa4d54UL, 0xe49604dfUL, ++ 0x9ed1b5e3UL, 0x4c6a881bUL, 0xc12c1fb8UL, 0x4665517fUL, ++ 0x9d5eea04UL, 0x018c355dUL, 0xfa877473UL, 0xfb0b412eUL, ++ 0xb3671d5aUL, 0x92dbd252UL, 0xe9105633UL, 0x6dd64713UL, ++ 0x9ad7618cUL, 0x37a10c7aUL, 0x59f8148eUL, 0xeb133c89UL, ++ 0xcea927eeUL, 0xb761c935UL, 0xe11ce5edUL, 0x7a47b13cUL, ++ 0x9cd2df59UL, 0x55f2733fUL, 0x1814ce79UL, 0x73c737bfUL, ++ 0x53f7cdeaUL, 0x5ffdaa5bUL, 0xdf3d6f14UL, 0x7844db86UL, ++ 0xcaaff381UL, 0xb968c43eUL, 0x3824342cUL, 0xc2a3405fUL, ++ 0x161dc372UL, 0xbce2250cUL, 0x283c498bUL, 0xff0d9541UL, ++ 0x39a80171UL, 0x080cb3deUL, 0xd8b4e49cUL, 0x6456c190UL, ++ 0x7bcb8461UL, 0xd532b670UL, 0x486c5c74UL, 0xd0b85742UL, ++}; ++ ++static const ulong32 Td4[256] = { ++ 0x52525252UL, 0x09090909UL, 0x6a6a6a6aUL, 0xd5d5d5d5UL, ++ 0x30303030UL, 0x36363636UL, 0xa5a5a5a5UL, 0x38383838UL, ++ 0xbfbfbfbfUL, 0x40404040UL, 0xa3a3a3a3UL, 0x9e9e9e9eUL, ++ 0x81818181UL, 0xf3f3f3f3UL, 0xd7d7d7d7UL, 0xfbfbfbfbUL, ++ 0x7c7c7c7cUL, 0xe3e3e3e3UL, 0x39393939UL, 0x82828282UL, ++ 0x9b9b9b9bUL, 0x2f2f2f2fUL, 0xffffffffUL, 0x87878787UL, ++ 0x34343434UL, 0x8e8e8e8eUL, 0x43434343UL, 0x44444444UL, ++ 0xc4c4c4c4UL, 0xdedededeUL, 0xe9e9e9e9UL, 0xcbcbcbcbUL, ++ 0x54545454UL, 0x7b7b7b7bUL, 0x94949494UL, 0x32323232UL, ++ 0xa6a6a6a6UL, 0xc2c2c2c2UL, 0x23232323UL, 0x3d3d3d3dUL, ++ 0xeeeeeeeeUL, 0x4c4c4c4cUL, 0x95959595UL, 0x0b0b0b0bUL, ++ 0x42424242UL, 0xfafafafaUL, 0xc3c3c3c3UL, 0x4e4e4e4eUL, ++ 0x08080808UL, 0x2e2e2e2eUL, 0xa1a1a1a1UL, 0x66666666UL, ++ 0x28282828UL, 0xd9d9d9d9UL, 0x24242424UL, 0xb2b2b2b2UL, ++ 0x76767676UL, 0x5b5b5b5bUL, 0xa2a2a2a2UL, 0x49494949UL, ++ 0x6d6d6d6dUL, 0x8b8b8b8bUL, 0xd1d1d1d1UL, 0x25252525UL, ++ 0x72727272UL, 0xf8f8f8f8UL, 0xf6f6f6f6UL, 0x64646464UL, ++ 0x86868686UL, 0x68686868UL, 0x98989898UL, 0x16161616UL, ++ 0xd4d4d4d4UL, 0xa4a4a4a4UL, 0x5c5c5c5cUL, 0xccccccccUL, ++ 0x5d5d5d5dUL, 0x65656565UL, 0xb6b6b6b6UL, 0x92929292UL, ++ 0x6c6c6c6cUL, 0x70707070UL, 0x48484848UL, 0x50505050UL, ++ 0xfdfdfdfdUL, 0xededededUL, 0xb9b9b9b9UL, 0xdadadadaUL, ++ 0x5e5e5e5eUL, 0x15151515UL, 0x46464646UL, 0x57575757UL, ++ 0xa7a7a7a7UL, 0x8d8d8d8dUL, 0x9d9d9d9dUL, 0x84848484UL, ++ 0x90909090UL, 0xd8d8d8d8UL, 0xababababUL, 0x00000000UL, ++ 0x8c8c8c8cUL, 0xbcbcbcbcUL, 0xd3d3d3d3UL, 0x0a0a0a0aUL, ++ 0xf7f7f7f7UL, 0xe4e4e4e4UL, 0x58585858UL, 0x05050505UL, ++ 0xb8b8b8b8UL, 0xb3b3b3b3UL, 0x45454545UL, 0x06060606UL, ++ 0xd0d0d0d0UL, 0x2c2c2c2cUL, 0x1e1e1e1eUL, 0x8f8f8f8fUL, ++ 0xcacacacaUL, 0x3f3f3f3fUL, 0x0f0f0f0fUL, 0x02020202UL, ++ 0xc1c1c1c1UL, 0xafafafafUL, 0xbdbdbdbdUL, 0x03030303UL, ++ 0x01010101UL, 0x13131313UL, 0x8a8a8a8aUL, 0x6b6b6b6bUL, ++ 0x3a3a3a3aUL, 0x91919191UL, 0x11111111UL, 0x41414141UL, ++ 0x4f4f4f4fUL, 0x67676767UL, 0xdcdcdcdcUL, 0xeaeaeaeaUL, ++ 0x97979797UL, 0xf2f2f2f2UL, 0xcfcfcfcfUL, 0xcecececeUL, ++ 0xf0f0f0f0UL, 0xb4b4b4b4UL, 0xe6e6e6e6UL, 0x73737373UL, ++ 0x96969696UL, 0xacacacacUL, 0x74747474UL, 0x22222222UL, ++ 0xe7e7e7e7UL, 0xadadadadUL, 0x35353535UL, 0x85858585UL, ++ 0xe2e2e2e2UL, 0xf9f9f9f9UL, 0x37373737UL, 0xe8e8e8e8UL, ++ 0x1c1c1c1cUL, 0x75757575UL, 0xdfdfdfdfUL, 0x6e6e6e6eUL, ++ 0x47474747UL, 0xf1f1f1f1UL, 0x1a1a1a1aUL, 0x71717171UL, ++ 0x1d1d1d1dUL, 0x29292929UL, 0xc5c5c5c5UL, 0x89898989UL, ++ 0x6f6f6f6fUL, 0xb7b7b7b7UL, 0x62626262UL, 0x0e0e0e0eUL, ++ 0xaaaaaaaaUL, 0x18181818UL, 0xbebebebeUL, 0x1b1b1b1bUL, ++ 0xfcfcfcfcUL, 0x56565656UL, 0x3e3e3e3eUL, 0x4b4b4b4bUL, ++ 0xc6c6c6c6UL, 0xd2d2d2d2UL, 0x79797979UL, 0x20202020UL, ++ 0x9a9a9a9aUL, 0xdbdbdbdbUL, 0xc0c0c0c0UL, 0xfefefefeUL, ++ 0x78787878UL, 0xcdcdcdcdUL, 0x5a5a5a5aUL, 0xf4f4f4f4UL, ++ 0x1f1f1f1fUL, 0xddddddddUL, 0xa8a8a8a8UL, 0x33333333UL, ++ 0x88888888UL, 0x07070707UL, 0xc7c7c7c7UL, 0x31313131UL, ++ 0xb1b1b1b1UL, 0x12121212UL, 0x10101010UL, 0x59595959UL, ++ 0x27272727UL, 0x80808080UL, 0xececececUL, 0x5f5f5f5fUL, ++ 0x60606060UL, 0x51515151UL, 0x7f7f7f7fUL, 0xa9a9a9a9UL, ++ 0x19191919UL, 0xb5b5b5b5UL, 0x4a4a4a4aUL, 0x0d0d0d0dUL, ++ 0x2d2d2d2dUL, 0xe5e5e5e5UL, 0x7a7a7a7aUL, 0x9f9f9f9fUL, ++ 0x93939393UL, 0xc9c9c9c9UL, 0x9c9c9c9cUL, 0xefefefefUL, ++ 0xa0a0a0a0UL, 0xe0e0e0e0UL, 0x3b3b3b3bUL, 0x4d4d4d4dUL, ++ 0xaeaeaeaeUL, 0x2a2a2a2aUL, 0xf5f5f5f5UL, 0xb0b0b0b0UL, ++ 0xc8c8c8c8UL, 0xebebebebUL, 0xbbbbbbbbUL, 0x3c3c3c3cUL, ++ 0x83838383UL, 0x53535353UL, 0x99999999UL, 0x61616161UL, ++ 0x17171717UL, 0x2b2b2b2bUL, 0x04040404UL, 0x7e7e7e7eUL, ++ 0xbabababaUL, 0x77777777UL, 0xd6d6d6d6UL, 0x26262626UL, ++ 0xe1e1e1e1UL, 0x69696969UL, 0x14141414UL, 0x63636363UL, ++ 0x55555555UL, 0x21212121UL, 0x0c0c0c0cUL, 0x7d7d7d7dUL, ++}; ++ ++#ifdef SMALL_CODE ++ ++#define Te0(x) TE0[x] ++#define Te1(x) ROR(TE0[x], 8) ++#define Te2(x) ROR(TE0[x], 16) ++#define Te3(x) ROR(TE0[x], 24) ++ ++#define Td0(x) TD0[x] ++#define Td1(x) ROR(TD0[x], 8) ++#define Td2(x) ROR(TD0[x], 16) ++#define Td3(x) ROR(TD0[x], 24) ++ ++#define Te4_0 0x000000FF & Te4 ++#define Te4_1 0x0000FF00 & Te4 ++#define Te4_2 0x00FF0000 & Te4 ++#define Te4_3 0xFF000000 & Te4 ++ ++#else /* SMALL_CODE */ ++ ++#define Te0(x) TE0[x] ++#define Te1(x) TE1[x] ++#define Te2(x) TE2[x] ++#define Te3(x) TE3[x] ++ ++#define Td0(x) TD0[x] ++#define Td1(x) TD1[x] ++#define Td2(x) TD2[x] ++#define Td3(x) TD3[x] ++ ++static const ulong32 TE1[256] = { ++ 0xa5c66363UL, 0x84f87c7cUL, 0x99ee7777UL, 0x8df67b7bUL, ++ 0x0dfff2f2UL, 0xbdd66b6bUL, 0xb1de6f6fUL, 0x5491c5c5UL, ++ 0x50603030UL, 0x03020101UL, 0xa9ce6767UL, 0x7d562b2bUL, ++ 0x19e7fefeUL, 0x62b5d7d7UL, 0xe64dababUL, 0x9aec7676UL, ++ 0x458fcacaUL, 0x9d1f8282UL, 0x4089c9c9UL, 0x87fa7d7dUL, ++ 0x15effafaUL, 0xebb25959UL, 0xc98e4747UL, 0x0bfbf0f0UL, ++ 0xec41adadUL, 0x67b3d4d4UL, 0xfd5fa2a2UL, 0xea45afafUL, ++ 0xbf239c9cUL, 0xf753a4a4UL, 0x96e47272UL, 0x5b9bc0c0UL, ++ 0xc275b7b7UL, 0x1ce1fdfdUL, 0xae3d9393UL, 0x6a4c2626UL, ++ 0x5a6c3636UL, 0x417e3f3fUL, 0x02f5f7f7UL, 0x4f83ccccUL, ++ 0x5c683434UL, 0xf451a5a5UL, 0x34d1e5e5UL, 0x08f9f1f1UL, ++ 0x93e27171UL, 0x73abd8d8UL, 0x53623131UL, 0x3f2a1515UL, ++ 0x0c080404UL, 0x5295c7c7UL, 0x65462323UL, 0x5e9dc3c3UL, ++ 0x28301818UL, 0xa1379696UL, 0x0f0a0505UL, 0xb52f9a9aUL, ++ 0x090e0707UL, 0x36241212UL, 0x9b1b8080UL, 0x3ddfe2e2UL, ++ 0x26cdebebUL, 0x694e2727UL, 0xcd7fb2b2UL, 0x9fea7575UL, ++ 0x1b120909UL, 0x9e1d8383UL, 0x74582c2cUL, 0x2e341a1aUL, ++ 0x2d361b1bUL, 0xb2dc6e6eUL, 0xeeb45a5aUL, 0xfb5ba0a0UL, ++ 0xf6a45252UL, 0x4d763b3bUL, 0x61b7d6d6UL, 0xce7db3b3UL, ++ 0x7b522929UL, 0x3edde3e3UL, 0x715e2f2fUL, 0x97138484UL, ++ 0xf5a65353UL, 0x68b9d1d1UL, 0x00000000UL, 0x2cc1ededUL, ++ 0x60402020UL, 0x1fe3fcfcUL, 0xc879b1b1UL, 0xedb65b5bUL, ++ 0xbed46a6aUL, 0x468dcbcbUL, 0xd967bebeUL, 0x4b723939UL, ++ 0xde944a4aUL, 0xd4984c4cUL, 0xe8b05858UL, 0x4a85cfcfUL, ++ 0x6bbbd0d0UL, 0x2ac5efefUL, 0xe54faaaaUL, 0x16edfbfbUL, ++ 0xc5864343UL, 0xd79a4d4dUL, 0x55663333UL, 0x94118585UL, ++ 0xcf8a4545UL, 0x10e9f9f9UL, 0x06040202UL, 0x81fe7f7fUL, ++ 0xf0a05050UL, 0x44783c3cUL, 0xba259f9fUL, 0xe34ba8a8UL, ++ 0xf3a25151UL, 0xfe5da3a3UL, 0xc0804040UL, 0x8a058f8fUL, ++ 0xad3f9292UL, 0xbc219d9dUL, 0x48703838UL, 0x04f1f5f5UL, ++ 0xdf63bcbcUL, 0xc177b6b6UL, 0x75afdadaUL, 0x63422121UL, ++ 0x30201010UL, 0x1ae5ffffUL, 0x0efdf3f3UL, 0x6dbfd2d2UL, ++ 0x4c81cdcdUL, 0x14180c0cUL, 0x35261313UL, 0x2fc3ececUL, ++ 0xe1be5f5fUL, 0xa2359797UL, 0xcc884444UL, 0x392e1717UL, ++ 0x5793c4c4UL, 0xf255a7a7UL, 0x82fc7e7eUL, 0x477a3d3dUL, ++ 0xacc86464UL, 0xe7ba5d5dUL, 0x2b321919UL, 0x95e67373UL, ++ 0xa0c06060UL, 0x98198181UL, 0xd19e4f4fUL, 0x7fa3dcdcUL, ++ 0x66442222UL, 0x7e542a2aUL, 0xab3b9090UL, 0x830b8888UL, ++ 0xca8c4646UL, 0x29c7eeeeUL, 0xd36bb8b8UL, 0x3c281414UL, ++ 0x79a7dedeUL, 0xe2bc5e5eUL, 0x1d160b0bUL, 0x76addbdbUL, ++ 0x3bdbe0e0UL, 0x56643232UL, 0x4e743a3aUL, 0x1e140a0aUL, ++ 0xdb924949UL, 0x0a0c0606UL, 0x6c482424UL, 0xe4b85c5cUL, ++ 0x5d9fc2c2UL, 0x6ebdd3d3UL, 0xef43acacUL, 0xa6c46262UL, ++ 0xa8399191UL, 0xa4319595UL, 0x37d3e4e4UL, 0x8bf27979UL, ++ 0x32d5e7e7UL, 0x438bc8c8UL, 0x596e3737UL, 0xb7da6d6dUL, ++ 0x8c018d8dUL, 0x64b1d5d5UL, 0xd29c4e4eUL, 0xe049a9a9UL, ++ 0xb4d86c6cUL, 0xfaac5656UL, 0x07f3f4f4UL, 0x25cfeaeaUL, ++ 0xafca6565UL, 0x8ef47a7aUL, 0xe947aeaeUL, 0x18100808UL, ++ 0xd56fbabaUL, 0x88f07878UL, 0x6f4a2525UL, 0x725c2e2eUL, ++ 0x24381c1cUL, 0xf157a6a6UL, 0xc773b4b4UL, 0x5197c6c6UL, ++ 0x23cbe8e8UL, 0x7ca1ddddUL, 0x9ce87474UL, 0x213e1f1fUL, ++ 0xdd964b4bUL, 0xdc61bdbdUL, 0x860d8b8bUL, 0x850f8a8aUL, ++ 0x90e07070UL, 0x427c3e3eUL, 0xc471b5b5UL, 0xaacc6666UL, ++ 0xd8904848UL, 0x05060303UL, 0x01f7f6f6UL, 0x121c0e0eUL, ++ 0xa3c26161UL, 0x5f6a3535UL, 0xf9ae5757UL, 0xd069b9b9UL, ++ 0x91178686UL, 0x5899c1c1UL, 0x273a1d1dUL, 0xb9279e9eUL, ++ 0x38d9e1e1UL, 0x13ebf8f8UL, 0xb32b9898UL, 0x33221111UL, ++ 0xbbd26969UL, 0x70a9d9d9UL, 0x89078e8eUL, 0xa7339494UL, ++ 0xb62d9b9bUL, 0x223c1e1eUL, 0x92158787UL, 0x20c9e9e9UL, ++ 0x4987ceceUL, 0xffaa5555UL, 0x78502828UL, 0x7aa5dfdfUL, ++ 0x8f038c8cUL, 0xf859a1a1UL, 0x80098989UL, 0x171a0d0dUL, ++ 0xda65bfbfUL, 0x31d7e6e6UL, 0xc6844242UL, 0xb8d06868UL, ++ 0xc3824141UL, 0xb0299999UL, 0x775a2d2dUL, 0x111e0f0fUL, ++ 0xcb7bb0b0UL, 0xfca85454UL, 0xd66dbbbbUL, 0x3a2c1616UL, ++}; ++static const ulong32 TE2[256] = { ++ 0x63a5c663UL, 0x7c84f87cUL, 0x7799ee77UL, 0x7b8df67bUL, ++ 0xf20dfff2UL, 0x6bbdd66bUL, 0x6fb1de6fUL, 0xc55491c5UL, ++ 0x30506030UL, 0x01030201UL, 0x67a9ce67UL, 0x2b7d562bUL, ++ 0xfe19e7feUL, 0xd762b5d7UL, 0xabe64dabUL, 0x769aec76UL, ++ 0xca458fcaUL, 0x829d1f82UL, 0xc94089c9UL, 0x7d87fa7dUL, ++ 0xfa15effaUL, 0x59ebb259UL, 0x47c98e47UL, 0xf00bfbf0UL, ++ 0xadec41adUL, 0xd467b3d4UL, 0xa2fd5fa2UL, 0xafea45afUL, ++ 0x9cbf239cUL, 0xa4f753a4UL, 0x7296e472UL, 0xc05b9bc0UL, ++ 0xb7c275b7UL, 0xfd1ce1fdUL, 0x93ae3d93UL, 0x266a4c26UL, ++ 0x365a6c36UL, 0x3f417e3fUL, 0xf702f5f7UL, 0xcc4f83ccUL, ++ 0x345c6834UL, 0xa5f451a5UL, 0xe534d1e5UL, 0xf108f9f1UL, ++ 0x7193e271UL, 0xd873abd8UL, 0x31536231UL, 0x153f2a15UL, ++ 0x040c0804UL, 0xc75295c7UL, 0x23654623UL, 0xc35e9dc3UL, ++ 0x18283018UL, 0x96a13796UL, 0x050f0a05UL, 0x9ab52f9aUL, ++ 0x07090e07UL, 0x12362412UL, 0x809b1b80UL, 0xe23ddfe2UL, ++ 0xeb26cdebUL, 0x27694e27UL, 0xb2cd7fb2UL, 0x759fea75UL, ++ 0x091b1209UL, 0x839e1d83UL, 0x2c74582cUL, 0x1a2e341aUL, ++ 0x1b2d361bUL, 0x6eb2dc6eUL, 0x5aeeb45aUL, 0xa0fb5ba0UL, ++ 0x52f6a452UL, 0x3b4d763bUL, 0xd661b7d6UL, 0xb3ce7db3UL, ++ 0x297b5229UL, 0xe33edde3UL, 0x2f715e2fUL, 0x84971384UL, ++ 0x53f5a653UL, 0xd168b9d1UL, 0x00000000UL, 0xed2cc1edUL, ++ 0x20604020UL, 0xfc1fe3fcUL, 0xb1c879b1UL, 0x5bedb65bUL, ++ 0x6abed46aUL, 0xcb468dcbUL, 0xbed967beUL, 0x394b7239UL, ++ 0x4ade944aUL, 0x4cd4984cUL, 0x58e8b058UL, 0xcf4a85cfUL, ++ 0xd06bbbd0UL, 0xef2ac5efUL, 0xaae54faaUL, 0xfb16edfbUL, ++ 0x43c58643UL, 0x4dd79a4dUL, 0x33556633UL, 0x85941185UL, ++ 0x45cf8a45UL, 0xf910e9f9UL, 0x02060402UL, 0x7f81fe7fUL, ++ 0x50f0a050UL, 0x3c44783cUL, 0x9fba259fUL, 0xa8e34ba8UL, ++ 0x51f3a251UL, 0xa3fe5da3UL, 0x40c08040UL, 0x8f8a058fUL, ++ 0x92ad3f92UL, 0x9dbc219dUL, 0x38487038UL, 0xf504f1f5UL, ++ 0xbcdf63bcUL, 0xb6c177b6UL, 0xda75afdaUL, 0x21634221UL, ++ 0x10302010UL, 0xff1ae5ffUL, 0xf30efdf3UL, 0xd26dbfd2UL, ++ 0xcd4c81cdUL, 0x0c14180cUL, 0x13352613UL, 0xec2fc3ecUL, ++ 0x5fe1be5fUL, 0x97a23597UL, 0x44cc8844UL, 0x17392e17UL, ++ 0xc45793c4UL, 0xa7f255a7UL, 0x7e82fc7eUL, 0x3d477a3dUL, ++ 0x64acc864UL, 0x5de7ba5dUL, 0x192b3219UL, 0x7395e673UL, ++ 0x60a0c060UL, 0x81981981UL, 0x4fd19e4fUL, 0xdc7fa3dcUL, ++ 0x22664422UL, 0x2a7e542aUL, 0x90ab3b90UL, 0x88830b88UL, ++ 0x46ca8c46UL, 0xee29c7eeUL, 0xb8d36bb8UL, 0x143c2814UL, ++ 0xde79a7deUL, 0x5ee2bc5eUL, 0x0b1d160bUL, 0xdb76addbUL, ++ 0xe03bdbe0UL, 0x32566432UL, 0x3a4e743aUL, 0x0a1e140aUL, ++ 0x49db9249UL, 0x060a0c06UL, 0x246c4824UL, 0x5ce4b85cUL, ++ 0xc25d9fc2UL, 0xd36ebdd3UL, 0xacef43acUL, 0x62a6c462UL, ++ 0x91a83991UL, 0x95a43195UL, 0xe437d3e4UL, 0x798bf279UL, ++ 0xe732d5e7UL, 0xc8438bc8UL, 0x37596e37UL, 0x6db7da6dUL, ++ 0x8d8c018dUL, 0xd564b1d5UL, 0x4ed29c4eUL, 0xa9e049a9UL, ++ 0x6cb4d86cUL, 0x56faac56UL, 0xf407f3f4UL, 0xea25cfeaUL, ++ 0x65afca65UL, 0x7a8ef47aUL, 0xaee947aeUL, 0x08181008UL, ++ 0xbad56fbaUL, 0x7888f078UL, 0x256f4a25UL, 0x2e725c2eUL, ++ 0x1c24381cUL, 0xa6f157a6UL, 0xb4c773b4UL, 0xc65197c6UL, ++ 0xe823cbe8UL, 0xdd7ca1ddUL, 0x749ce874UL, 0x1f213e1fUL, ++ 0x4bdd964bUL, 0xbddc61bdUL, 0x8b860d8bUL, 0x8a850f8aUL, ++ 0x7090e070UL, 0x3e427c3eUL, 0xb5c471b5UL, 0x66aacc66UL, ++ 0x48d89048UL, 0x03050603UL, 0xf601f7f6UL, 0x0e121c0eUL, ++ 0x61a3c261UL, 0x355f6a35UL, 0x57f9ae57UL, 0xb9d069b9UL, ++ 0x86911786UL, 0xc15899c1UL, 0x1d273a1dUL, 0x9eb9279eUL, ++ 0xe138d9e1UL, 0xf813ebf8UL, 0x98b32b98UL, 0x11332211UL, ++ 0x69bbd269UL, 0xd970a9d9UL, 0x8e89078eUL, 0x94a73394UL, ++ 0x9bb62d9bUL, 0x1e223c1eUL, 0x87921587UL, 0xe920c9e9UL, ++ 0xce4987ceUL, 0x55ffaa55UL, 0x28785028UL, 0xdf7aa5dfUL, ++ 0x8c8f038cUL, 0xa1f859a1UL, 0x89800989UL, 0x0d171a0dUL, ++ 0xbfda65bfUL, 0xe631d7e6UL, 0x42c68442UL, 0x68b8d068UL, ++ 0x41c38241UL, 0x99b02999UL, 0x2d775a2dUL, 0x0f111e0fUL, ++ 0xb0cb7bb0UL, 0x54fca854UL, 0xbbd66dbbUL, 0x163a2c16UL, ++}; ++static const ulong32 TE3[256] = { ++ ++ 0x6363a5c6UL, 0x7c7c84f8UL, 0x777799eeUL, 0x7b7b8df6UL, ++ 0xf2f20dffUL, 0x6b6bbdd6UL, 0x6f6fb1deUL, 0xc5c55491UL, ++ 0x30305060UL, 0x01010302UL, 0x6767a9ceUL, 0x2b2b7d56UL, ++ 0xfefe19e7UL, 0xd7d762b5UL, 0xababe64dUL, 0x76769aecUL, ++ 0xcaca458fUL, 0x82829d1fUL, 0xc9c94089UL, 0x7d7d87faUL, ++ 0xfafa15efUL, 0x5959ebb2UL, 0x4747c98eUL, 0xf0f00bfbUL, ++ 0xadadec41UL, 0xd4d467b3UL, 0xa2a2fd5fUL, 0xafafea45UL, ++ 0x9c9cbf23UL, 0xa4a4f753UL, 0x727296e4UL, 0xc0c05b9bUL, ++ 0xb7b7c275UL, 0xfdfd1ce1UL, 0x9393ae3dUL, 0x26266a4cUL, ++ 0x36365a6cUL, 0x3f3f417eUL, 0xf7f702f5UL, 0xcccc4f83UL, ++ 0x34345c68UL, 0xa5a5f451UL, 0xe5e534d1UL, 0xf1f108f9UL, ++ 0x717193e2UL, 0xd8d873abUL, 0x31315362UL, 0x15153f2aUL, ++ 0x04040c08UL, 0xc7c75295UL, 0x23236546UL, 0xc3c35e9dUL, ++ 0x18182830UL, 0x9696a137UL, 0x05050f0aUL, 0x9a9ab52fUL, ++ 0x0707090eUL, 0x12123624UL, 0x80809b1bUL, 0xe2e23ddfUL, ++ 0xebeb26cdUL, 0x2727694eUL, 0xb2b2cd7fUL, 0x75759feaUL, ++ 0x09091b12UL, 0x83839e1dUL, 0x2c2c7458UL, 0x1a1a2e34UL, ++ 0x1b1b2d36UL, 0x6e6eb2dcUL, 0x5a5aeeb4UL, 0xa0a0fb5bUL, ++ 0x5252f6a4UL, 0x3b3b4d76UL, 0xd6d661b7UL, 0xb3b3ce7dUL, ++ 0x29297b52UL, 0xe3e33eddUL, 0x2f2f715eUL, 0x84849713UL, ++ 0x5353f5a6UL, 0xd1d168b9UL, 0x00000000UL, 0xeded2cc1UL, ++ 0x20206040UL, 0xfcfc1fe3UL, 0xb1b1c879UL, 0x5b5bedb6UL, ++ 0x6a6abed4UL, 0xcbcb468dUL, 0xbebed967UL, 0x39394b72UL, ++ 0x4a4ade94UL, 0x4c4cd498UL, 0x5858e8b0UL, 0xcfcf4a85UL, ++ 0xd0d06bbbUL, 0xefef2ac5UL, 0xaaaae54fUL, 0xfbfb16edUL, ++ 0x4343c586UL, 0x4d4dd79aUL, 0x33335566UL, 0x85859411UL, ++ 0x4545cf8aUL, 0xf9f910e9UL, 0x02020604UL, 0x7f7f81feUL, ++ 0x5050f0a0UL, 0x3c3c4478UL, 0x9f9fba25UL, 0xa8a8e34bUL, ++ 0x5151f3a2UL, 0xa3a3fe5dUL, 0x4040c080UL, 0x8f8f8a05UL, ++ 0x9292ad3fUL, 0x9d9dbc21UL, 0x38384870UL, 0xf5f504f1UL, ++ 0xbcbcdf63UL, 0xb6b6c177UL, 0xdada75afUL, 0x21216342UL, ++ 0x10103020UL, 0xffff1ae5UL, 0xf3f30efdUL, 0xd2d26dbfUL, ++ 0xcdcd4c81UL, 0x0c0c1418UL, 0x13133526UL, 0xecec2fc3UL, ++ 0x5f5fe1beUL, 0x9797a235UL, 0x4444cc88UL, 0x1717392eUL, ++ 0xc4c45793UL, 0xa7a7f255UL, 0x7e7e82fcUL, 0x3d3d477aUL, ++ 0x6464acc8UL, 0x5d5de7baUL, 0x19192b32UL, 0x737395e6UL, ++ 0x6060a0c0UL, 0x81819819UL, 0x4f4fd19eUL, 0xdcdc7fa3UL, ++ 0x22226644UL, 0x2a2a7e54UL, 0x9090ab3bUL, 0x8888830bUL, ++ 0x4646ca8cUL, 0xeeee29c7UL, 0xb8b8d36bUL, 0x14143c28UL, ++ 0xdede79a7UL, 0x5e5ee2bcUL, 0x0b0b1d16UL, 0xdbdb76adUL, ++ 0xe0e03bdbUL, 0x32325664UL, 0x3a3a4e74UL, 0x0a0a1e14UL, ++ 0x4949db92UL, 0x06060a0cUL, 0x24246c48UL, 0x5c5ce4b8UL, ++ 0xc2c25d9fUL, 0xd3d36ebdUL, 0xacacef43UL, 0x6262a6c4UL, ++ 0x9191a839UL, 0x9595a431UL, 0xe4e437d3UL, 0x79798bf2UL, ++ 0xe7e732d5UL, 0xc8c8438bUL, 0x3737596eUL, 0x6d6db7daUL, ++ 0x8d8d8c01UL, 0xd5d564b1UL, 0x4e4ed29cUL, 0xa9a9e049UL, ++ 0x6c6cb4d8UL, 0x5656faacUL, 0xf4f407f3UL, 0xeaea25cfUL, ++ 0x6565afcaUL, 0x7a7a8ef4UL, 0xaeaee947UL, 0x08081810UL, ++ 0xbabad56fUL, 0x787888f0UL, 0x25256f4aUL, 0x2e2e725cUL, ++ 0x1c1c2438UL, 0xa6a6f157UL, 0xb4b4c773UL, 0xc6c65197UL, ++ 0xe8e823cbUL, 0xdddd7ca1UL, 0x74749ce8UL, 0x1f1f213eUL, ++ 0x4b4bdd96UL, 0xbdbddc61UL, 0x8b8b860dUL, 0x8a8a850fUL, ++ 0x707090e0UL, 0x3e3e427cUL, 0xb5b5c471UL, 0x6666aaccUL, ++ 0x4848d890UL, 0x03030506UL, 0xf6f601f7UL, 0x0e0e121cUL, ++ 0x6161a3c2UL, 0x35355f6aUL, 0x5757f9aeUL, 0xb9b9d069UL, ++ 0x86869117UL, 0xc1c15899UL, 0x1d1d273aUL, 0x9e9eb927UL, ++ 0xe1e138d9UL, 0xf8f813ebUL, 0x9898b32bUL, 0x11113322UL, ++ 0x6969bbd2UL, 0xd9d970a9UL, 0x8e8e8907UL, 0x9494a733UL, ++ 0x9b9bb62dUL, 0x1e1e223cUL, 0x87879215UL, 0xe9e920c9UL, ++ 0xcece4987UL, 0x5555ffaaUL, 0x28287850UL, 0xdfdf7aa5UL, ++ 0x8c8c8f03UL, 0xa1a1f859UL, 0x89898009UL, 0x0d0d171aUL, ++ 0xbfbfda65UL, 0xe6e631d7UL, 0x4242c684UL, 0x6868b8d0UL, ++ 0x4141c382UL, 0x9999b029UL, 0x2d2d775aUL, 0x0f0f111eUL, ++ 0xb0b0cb7bUL, 0x5454fca8UL, 0xbbbbd66dUL, 0x16163a2cUL, ++}; ++ ++static const ulong32 Te4_0[] = { ++0x00000063UL, 0x0000007cUL, 0x00000077UL, 0x0000007bUL, 0x000000f2UL, 0x0000006bUL, 0x0000006fUL, 0x000000c5UL, ++0x00000030UL, 0x00000001UL, 0x00000067UL, 0x0000002bUL, 0x000000feUL, 0x000000d7UL, 0x000000abUL, 0x00000076UL, ++0x000000caUL, 0x00000082UL, 0x000000c9UL, 0x0000007dUL, 0x000000faUL, 0x00000059UL, 0x00000047UL, 0x000000f0UL, ++0x000000adUL, 0x000000d4UL, 0x000000a2UL, 0x000000afUL, 0x0000009cUL, 0x000000a4UL, 0x00000072UL, 0x000000c0UL, ++0x000000b7UL, 0x000000fdUL, 0x00000093UL, 0x00000026UL, 0x00000036UL, 0x0000003fUL, 0x000000f7UL, 0x000000ccUL, ++0x00000034UL, 0x000000a5UL, 0x000000e5UL, 0x000000f1UL, 0x00000071UL, 0x000000d8UL, 0x00000031UL, 0x00000015UL, ++0x00000004UL, 0x000000c7UL, 0x00000023UL, 0x000000c3UL, 0x00000018UL, 0x00000096UL, 0x00000005UL, 0x0000009aUL, ++0x00000007UL, 0x00000012UL, 0x00000080UL, 0x000000e2UL, 0x000000ebUL, 0x00000027UL, 0x000000b2UL, 0x00000075UL, ++0x00000009UL, 0x00000083UL, 0x0000002cUL, 0x0000001aUL, 0x0000001bUL, 0x0000006eUL, 0x0000005aUL, 0x000000a0UL, ++0x00000052UL, 0x0000003bUL, 0x000000d6UL, 0x000000b3UL, 0x00000029UL, 0x000000e3UL, 0x0000002fUL, 0x00000084UL, ++0x00000053UL, 0x000000d1UL, 0x00000000UL, 0x000000edUL, 0x00000020UL, 0x000000fcUL, 0x000000b1UL, 0x0000005bUL, ++0x0000006aUL, 0x000000cbUL, 0x000000beUL, 0x00000039UL, 0x0000004aUL, 0x0000004cUL, 0x00000058UL, 0x000000cfUL, ++0x000000d0UL, 0x000000efUL, 0x000000aaUL, 0x000000fbUL, 0x00000043UL, 0x0000004dUL, 0x00000033UL, 0x00000085UL, ++0x00000045UL, 0x000000f9UL, 0x00000002UL, 0x0000007fUL, 0x00000050UL, 0x0000003cUL, 0x0000009fUL, 0x000000a8UL, ++0x00000051UL, 0x000000a3UL, 0x00000040UL, 0x0000008fUL, 0x00000092UL, 0x0000009dUL, 0x00000038UL, 0x000000f5UL, ++0x000000bcUL, 0x000000b6UL, 0x000000daUL, 0x00000021UL, 0x00000010UL, 0x000000ffUL, 0x000000f3UL, 0x000000d2UL, ++0x000000cdUL, 0x0000000cUL, 0x00000013UL, 0x000000ecUL, 0x0000005fUL, 0x00000097UL, 0x00000044UL, 0x00000017UL, ++0x000000c4UL, 0x000000a7UL, 0x0000007eUL, 0x0000003dUL, 0x00000064UL, 0x0000005dUL, 0x00000019UL, 0x00000073UL, ++0x00000060UL, 0x00000081UL, 0x0000004fUL, 0x000000dcUL, 0x00000022UL, 0x0000002aUL, 0x00000090UL, 0x00000088UL, ++0x00000046UL, 0x000000eeUL, 0x000000b8UL, 0x00000014UL, 0x000000deUL, 0x0000005eUL, 0x0000000bUL, 0x000000dbUL, ++0x000000e0UL, 0x00000032UL, 0x0000003aUL, 0x0000000aUL, 0x00000049UL, 0x00000006UL, 0x00000024UL, 0x0000005cUL, ++0x000000c2UL, 0x000000d3UL, 0x000000acUL, 0x00000062UL, 0x00000091UL, 0x00000095UL, 0x000000e4UL, 0x00000079UL, ++0x000000e7UL, 0x000000c8UL, 0x00000037UL, 0x0000006dUL, 0x0000008dUL, 0x000000d5UL, 0x0000004eUL, 0x000000a9UL, ++0x0000006cUL, 0x00000056UL, 0x000000f4UL, 0x000000eaUL, 0x00000065UL, 0x0000007aUL, 0x000000aeUL, 0x00000008UL, ++0x000000baUL, 0x00000078UL, 0x00000025UL, 0x0000002eUL, 0x0000001cUL, 0x000000a6UL, 0x000000b4UL, 0x000000c6UL, ++0x000000e8UL, 0x000000ddUL, 0x00000074UL, 0x0000001fUL, 0x0000004bUL, 0x000000bdUL, 0x0000008bUL, 0x0000008aUL, ++0x00000070UL, 0x0000003eUL, 0x000000b5UL, 0x00000066UL, 0x00000048UL, 0x00000003UL, 0x000000f6UL, 0x0000000eUL, ++0x00000061UL, 0x00000035UL, 0x00000057UL, 0x000000b9UL, 0x00000086UL, 0x000000c1UL, 0x0000001dUL, 0x0000009eUL, ++0x000000e1UL, 0x000000f8UL, 0x00000098UL, 0x00000011UL, 0x00000069UL, 0x000000d9UL, 0x0000008eUL, 0x00000094UL, ++0x0000009bUL, 0x0000001eUL, 0x00000087UL, 0x000000e9UL, 0x000000ceUL, 0x00000055UL, 0x00000028UL, 0x000000dfUL, ++0x0000008cUL, 0x000000a1UL, 0x00000089UL, 0x0000000dUL, 0x000000bfUL, 0x000000e6UL, 0x00000042UL, 0x00000068UL, ++0x00000041UL, 0x00000099UL, 0x0000002dUL, 0x0000000fUL, 0x000000b0UL, 0x00000054UL, 0x000000bbUL, 0x00000016UL ++}; ++ ++static const ulong32 Te4_1[] = { ++0x00006300UL, 0x00007c00UL, 0x00007700UL, 0x00007b00UL, 0x0000f200UL, 0x00006b00UL, 0x00006f00UL, 0x0000c500UL, ++0x00003000UL, 0x00000100UL, 0x00006700UL, 0x00002b00UL, 0x0000fe00UL, 0x0000d700UL, 0x0000ab00UL, 0x00007600UL, ++0x0000ca00UL, 0x00008200UL, 0x0000c900UL, 0x00007d00UL, 0x0000fa00UL, 0x00005900UL, 0x00004700UL, 0x0000f000UL, ++0x0000ad00UL, 0x0000d400UL, 0x0000a200UL, 0x0000af00UL, 0x00009c00UL, 0x0000a400UL, 0x00007200UL, 0x0000c000UL, ++0x0000b700UL, 0x0000fd00UL, 0x00009300UL, 0x00002600UL, 0x00003600UL, 0x00003f00UL, 0x0000f700UL, 0x0000cc00UL, ++0x00003400UL, 0x0000a500UL, 0x0000e500UL, 0x0000f100UL, 0x00007100UL, 0x0000d800UL, 0x00003100UL, 0x00001500UL, ++0x00000400UL, 0x0000c700UL, 0x00002300UL, 0x0000c300UL, 0x00001800UL, 0x00009600UL, 0x00000500UL, 0x00009a00UL, ++0x00000700UL, 0x00001200UL, 0x00008000UL, 0x0000e200UL, 0x0000eb00UL, 0x00002700UL, 0x0000b200UL, 0x00007500UL, ++0x00000900UL, 0x00008300UL, 0x00002c00UL, 0x00001a00UL, 0x00001b00UL, 0x00006e00UL, 0x00005a00UL, 0x0000a000UL, ++0x00005200UL, 0x00003b00UL, 0x0000d600UL, 0x0000b300UL, 0x00002900UL, 0x0000e300UL, 0x00002f00UL, 0x00008400UL, ++0x00005300UL, 0x0000d100UL, 0x00000000UL, 0x0000ed00UL, 0x00002000UL, 0x0000fc00UL, 0x0000b100UL, 0x00005b00UL, ++0x00006a00UL, 0x0000cb00UL, 0x0000be00UL, 0x00003900UL, 0x00004a00UL, 0x00004c00UL, 0x00005800UL, 0x0000cf00UL, ++0x0000d000UL, 0x0000ef00UL, 0x0000aa00UL, 0x0000fb00UL, 0x00004300UL, 0x00004d00UL, 0x00003300UL, 0x00008500UL, ++0x00004500UL, 0x0000f900UL, 0x00000200UL, 0x00007f00UL, 0x00005000UL, 0x00003c00UL, 0x00009f00UL, 0x0000a800UL, ++0x00005100UL, 0x0000a300UL, 0x00004000UL, 0x00008f00UL, 0x00009200UL, 0x00009d00UL, 0x00003800UL, 0x0000f500UL, ++0x0000bc00UL, 0x0000b600UL, 0x0000da00UL, 0x00002100UL, 0x00001000UL, 0x0000ff00UL, 0x0000f300UL, 0x0000d200UL, ++0x0000cd00UL, 0x00000c00UL, 0x00001300UL, 0x0000ec00UL, 0x00005f00UL, 0x00009700UL, 0x00004400UL, 0x00001700UL, ++0x0000c400UL, 0x0000a700UL, 0x00007e00UL, 0x00003d00UL, 0x00006400UL, 0x00005d00UL, 0x00001900UL, 0x00007300UL, ++0x00006000UL, 0x00008100UL, 0x00004f00UL, 0x0000dc00UL, 0x00002200UL, 0x00002a00UL, 0x00009000UL, 0x00008800UL, ++0x00004600UL, 0x0000ee00UL, 0x0000b800UL, 0x00001400UL, 0x0000de00UL, 0x00005e00UL, 0x00000b00UL, 0x0000db00UL, ++0x0000e000UL, 0x00003200UL, 0x00003a00UL, 0x00000a00UL, 0x00004900UL, 0x00000600UL, 0x00002400UL, 0x00005c00UL, ++0x0000c200UL, 0x0000d300UL, 0x0000ac00UL, 0x00006200UL, 0x00009100UL, 0x00009500UL, 0x0000e400UL, 0x00007900UL, ++0x0000e700UL, 0x0000c800UL, 0x00003700UL, 0x00006d00UL, 0x00008d00UL, 0x0000d500UL, 0x00004e00UL, 0x0000a900UL, ++0x00006c00UL, 0x00005600UL, 0x0000f400UL, 0x0000ea00UL, 0x00006500UL, 0x00007a00UL, 0x0000ae00UL, 0x00000800UL, ++0x0000ba00UL, 0x00007800UL, 0x00002500UL, 0x00002e00UL, 0x00001c00UL, 0x0000a600UL, 0x0000b400UL, 0x0000c600UL, ++0x0000e800UL, 0x0000dd00UL, 0x00007400UL, 0x00001f00UL, 0x00004b00UL, 0x0000bd00UL, 0x00008b00UL, 0x00008a00UL, ++0x00007000UL, 0x00003e00UL, 0x0000b500UL, 0x00006600UL, 0x00004800UL, 0x00000300UL, 0x0000f600UL, 0x00000e00UL, ++0x00006100UL, 0x00003500UL, 0x00005700UL, 0x0000b900UL, 0x00008600UL, 0x0000c100UL, 0x00001d00UL, 0x00009e00UL, ++0x0000e100UL, 0x0000f800UL, 0x00009800UL, 0x00001100UL, 0x00006900UL, 0x0000d900UL, 0x00008e00UL, 0x00009400UL, ++0x00009b00UL, 0x00001e00UL, 0x00008700UL, 0x0000e900UL, 0x0000ce00UL, 0x00005500UL, 0x00002800UL, 0x0000df00UL, ++0x00008c00UL, 0x0000a100UL, 0x00008900UL, 0x00000d00UL, 0x0000bf00UL, 0x0000e600UL, 0x00004200UL, 0x00006800UL, ++0x00004100UL, 0x00009900UL, 0x00002d00UL, 0x00000f00UL, 0x0000b000UL, 0x00005400UL, 0x0000bb00UL, 0x00001600UL ++}; ++ ++static const ulong32 Te4_2[] = { ++0x00630000UL, 0x007c0000UL, 0x00770000UL, 0x007b0000UL, 0x00f20000UL, 0x006b0000UL, 0x006f0000UL, 0x00c50000UL, ++0x00300000UL, 0x00010000UL, 0x00670000UL, 0x002b0000UL, 0x00fe0000UL, 0x00d70000UL, 0x00ab0000UL, 0x00760000UL, ++0x00ca0000UL, 0x00820000UL, 0x00c90000UL, 0x007d0000UL, 0x00fa0000UL, 0x00590000UL, 0x00470000UL, 0x00f00000UL, ++0x00ad0000UL, 0x00d40000UL, 0x00a20000UL, 0x00af0000UL, 0x009c0000UL, 0x00a40000UL, 0x00720000UL, 0x00c00000UL, ++0x00b70000UL, 0x00fd0000UL, 0x00930000UL, 0x00260000UL, 0x00360000UL, 0x003f0000UL, 0x00f70000UL, 0x00cc0000UL, ++0x00340000UL, 0x00a50000UL, 0x00e50000UL, 0x00f10000UL, 0x00710000UL, 0x00d80000UL, 0x00310000UL, 0x00150000UL, ++0x00040000UL, 0x00c70000UL, 0x00230000UL, 0x00c30000UL, 0x00180000UL, 0x00960000UL, 0x00050000UL, 0x009a0000UL, ++0x00070000UL, 0x00120000UL, 0x00800000UL, 0x00e20000UL, 0x00eb0000UL, 0x00270000UL, 0x00b20000UL, 0x00750000UL, ++0x00090000UL, 0x00830000UL, 0x002c0000UL, 0x001a0000UL, 0x001b0000UL, 0x006e0000UL, 0x005a0000UL, 0x00a00000UL, ++0x00520000UL, 0x003b0000UL, 0x00d60000UL, 0x00b30000UL, 0x00290000UL, 0x00e30000UL, 0x002f0000UL, 0x00840000UL, ++0x00530000UL, 0x00d10000UL, 0x00000000UL, 0x00ed0000UL, 0x00200000UL, 0x00fc0000UL, 0x00b10000UL, 0x005b0000UL, ++0x006a0000UL, 0x00cb0000UL, 0x00be0000UL, 0x00390000UL, 0x004a0000UL, 0x004c0000UL, 0x00580000UL, 0x00cf0000UL, ++0x00d00000UL, 0x00ef0000UL, 0x00aa0000UL, 0x00fb0000UL, 0x00430000UL, 0x004d0000UL, 0x00330000UL, 0x00850000UL, ++0x00450000UL, 0x00f90000UL, 0x00020000UL, 0x007f0000UL, 0x00500000UL, 0x003c0000UL, 0x009f0000UL, 0x00a80000UL, ++0x00510000UL, 0x00a30000UL, 0x00400000UL, 0x008f0000UL, 0x00920000UL, 0x009d0000UL, 0x00380000UL, 0x00f50000UL, ++0x00bc0000UL, 0x00b60000UL, 0x00da0000UL, 0x00210000UL, 0x00100000UL, 0x00ff0000UL, 0x00f30000UL, 0x00d20000UL, ++0x00cd0000UL, 0x000c0000UL, 0x00130000UL, 0x00ec0000UL, 0x005f0000UL, 0x00970000UL, 0x00440000UL, 0x00170000UL, ++0x00c40000UL, 0x00a70000UL, 0x007e0000UL, 0x003d0000UL, 0x00640000UL, 0x005d0000UL, 0x00190000UL, 0x00730000UL, ++0x00600000UL, 0x00810000UL, 0x004f0000UL, 0x00dc0000UL, 0x00220000UL, 0x002a0000UL, 0x00900000UL, 0x00880000UL, ++0x00460000UL, 0x00ee0000UL, 0x00b80000UL, 0x00140000UL, 0x00de0000UL, 0x005e0000UL, 0x000b0000UL, 0x00db0000UL, ++0x00e00000UL, 0x00320000UL, 0x003a0000UL, 0x000a0000UL, 0x00490000UL, 0x00060000UL, 0x00240000UL, 0x005c0000UL, ++0x00c20000UL, 0x00d30000UL, 0x00ac0000UL, 0x00620000UL, 0x00910000UL, 0x00950000UL, 0x00e40000UL, 0x00790000UL, ++0x00e70000UL, 0x00c80000UL, 0x00370000UL, 0x006d0000UL, 0x008d0000UL, 0x00d50000UL, 0x004e0000UL, 0x00a90000UL, ++0x006c0000UL, 0x00560000UL, 0x00f40000UL, 0x00ea0000UL, 0x00650000UL, 0x007a0000UL, 0x00ae0000UL, 0x00080000UL, ++0x00ba0000UL, 0x00780000UL, 0x00250000UL, 0x002e0000UL, 0x001c0000UL, 0x00a60000UL, 0x00b40000UL, 0x00c60000UL, ++0x00e80000UL, 0x00dd0000UL, 0x00740000UL, 0x001f0000UL, 0x004b0000UL, 0x00bd0000UL, 0x008b0000UL, 0x008a0000UL, ++0x00700000UL, 0x003e0000UL, 0x00b50000UL, 0x00660000UL, 0x00480000UL, 0x00030000UL, 0x00f60000UL, 0x000e0000UL, ++0x00610000UL, 0x00350000UL, 0x00570000UL, 0x00b90000UL, 0x00860000UL, 0x00c10000UL, 0x001d0000UL, 0x009e0000UL, ++0x00e10000UL, 0x00f80000UL, 0x00980000UL, 0x00110000UL, 0x00690000UL, 0x00d90000UL, 0x008e0000UL, 0x00940000UL, ++0x009b0000UL, 0x001e0000UL, 0x00870000UL, 0x00e90000UL, 0x00ce0000UL, 0x00550000UL, 0x00280000UL, 0x00df0000UL, ++0x008c0000UL, 0x00a10000UL, 0x00890000UL, 0x000d0000UL, 0x00bf0000UL, 0x00e60000UL, 0x00420000UL, 0x00680000UL, ++0x00410000UL, 0x00990000UL, 0x002d0000UL, 0x000f0000UL, 0x00b00000UL, 0x00540000UL, 0x00bb0000UL, 0x00160000UL ++}; ++ ++static const ulong32 Te4_3[] = { ++0x63000000UL, 0x7c000000UL, 0x77000000UL, 0x7b000000UL, 0xf2000000UL, 0x6b000000UL, 0x6f000000UL, 0xc5000000UL, ++0x30000000UL, 0x01000000UL, 0x67000000UL, 0x2b000000UL, 0xfe000000UL, 0xd7000000UL, 0xab000000UL, 0x76000000UL, ++0xca000000UL, 0x82000000UL, 0xc9000000UL, 0x7d000000UL, 0xfa000000UL, 0x59000000UL, 0x47000000UL, 0xf0000000UL, ++0xad000000UL, 0xd4000000UL, 0xa2000000UL, 0xaf000000UL, 0x9c000000UL, 0xa4000000UL, 0x72000000UL, 0xc0000000UL, ++0xb7000000UL, 0xfd000000UL, 0x93000000UL, 0x26000000UL, 0x36000000UL, 0x3f000000UL, 0xf7000000UL, 0xcc000000UL, ++0x34000000UL, 0xa5000000UL, 0xe5000000UL, 0xf1000000UL, 0x71000000UL, 0xd8000000UL, 0x31000000UL, 0x15000000UL, ++0x04000000UL, 0xc7000000UL, 0x23000000UL, 0xc3000000UL, 0x18000000UL, 0x96000000UL, 0x05000000UL, 0x9a000000UL, ++0x07000000UL, 0x12000000UL, 0x80000000UL, 0xe2000000UL, 0xeb000000UL, 0x27000000UL, 0xb2000000UL, 0x75000000UL, ++0x09000000UL, 0x83000000UL, 0x2c000000UL, 0x1a000000UL, 0x1b000000UL, 0x6e000000UL, 0x5a000000UL, 0xa0000000UL, ++0x52000000UL, 0x3b000000UL, 0xd6000000UL, 0xb3000000UL, 0x29000000UL, 0xe3000000UL, 0x2f000000UL, 0x84000000UL, ++0x53000000UL, 0xd1000000UL, 0x00000000UL, 0xed000000UL, 0x20000000UL, 0xfc000000UL, 0xb1000000UL, 0x5b000000UL, ++0x6a000000UL, 0xcb000000UL, 0xbe000000UL, 0x39000000UL, 0x4a000000UL, 0x4c000000UL, 0x58000000UL, 0xcf000000UL, ++0xd0000000UL, 0xef000000UL, 0xaa000000UL, 0xfb000000UL, 0x43000000UL, 0x4d000000UL, 0x33000000UL, 0x85000000UL, ++0x45000000UL, 0xf9000000UL, 0x02000000UL, 0x7f000000UL, 0x50000000UL, 0x3c000000UL, 0x9f000000UL, 0xa8000000UL, ++0x51000000UL, 0xa3000000UL, 0x40000000UL, 0x8f000000UL, 0x92000000UL, 0x9d000000UL, 0x38000000UL, 0xf5000000UL, ++0xbc000000UL, 0xb6000000UL, 0xda000000UL, 0x21000000UL, 0x10000000UL, 0xff000000UL, 0xf3000000UL, 0xd2000000UL, ++0xcd000000UL, 0x0c000000UL, 0x13000000UL, 0xec000000UL, 0x5f000000UL, 0x97000000UL, 0x44000000UL, 0x17000000UL, ++0xc4000000UL, 0xa7000000UL, 0x7e000000UL, 0x3d000000UL, 0x64000000UL, 0x5d000000UL, 0x19000000UL, 0x73000000UL, ++0x60000000UL, 0x81000000UL, 0x4f000000UL, 0xdc000000UL, 0x22000000UL, 0x2a000000UL, 0x90000000UL, 0x88000000UL, ++0x46000000UL, 0xee000000UL, 0xb8000000UL, 0x14000000UL, 0xde000000UL, 0x5e000000UL, 0x0b000000UL, 0xdb000000UL, ++0xe0000000UL, 0x32000000UL, 0x3a000000UL, 0x0a000000UL, 0x49000000UL, 0x06000000UL, 0x24000000UL, 0x5c000000UL, ++0xc2000000UL, 0xd3000000UL, 0xac000000UL, 0x62000000UL, 0x91000000UL, 0x95000000UL, 0xe4000000UL, 0x79000000UL, ++0xe7000000UL, 0xc8000000UL, 0x37000000UL, 0x6d000000UL, 0x8d000000UL, 0xd5000000UL, 0x4e000000UL, 0xa9000000UL, ++0x6c000000UL, 0x56000000UL, 0xf4000000UL, 0xea000000UL, 0x65000000UL, 0x7a000000UL, 0xae000000UL, 0x08000000UL, ++0xba000000UL, 0x78000000UL, 0x25000000UL, 0x2e000000UL, 0x1c000000UL, 0xa6000000UL, 0xb4000000UL, 0xc6000000UL, ++0xe8000000UL, 0xdd000000UL, 0x74000000UL, 0x1f000000UL, 0x4b000000UL, 0xbd000000UL, 0x8b000000UL, 0x8a000000UL, ++0x70000000UL, 0x3e000000UL, 0xb5000000UL, 0x66000000UL, 0x48000000UL, 0x03000000UL, 0xf6000000UL, 0x0e000000UL, ++0x61000000UL, 0x35000000UL, 0x57000000UL, 0xb9000000UL, 0x86000000UL, 0xc1000000UL, 0x1d000000UL, 0x9e000000UL, ++0xe1000000UL, 0xf8000000UL, 0x98000000UL, 0x11000000UL, 0x69000000UL, 0xd9000000UL, 0x8e000000UL, 0x94000000UL, ++0x9b000000UL, 0x1e000000UL, 0x87000000UL, 0xe9000000UL, 0xce000000UL, 0x55000000UL, 0x28000000UL, 0xdf000000UL, ++0x8c000000UL, 0xa1000000UL, 0x89000000UL, 0x0d000000UL, 0xbf000000UL, 0xe6000000UL, 0x42000000UL, 0x68000000UL, ++0x41000000UL, 0x99000000UL, 0x2d000000UL, 0x0f000000UL, 0xb0000000UL, 0x54000000UL, 0xbb000000UL, 0x16000000UL ++}; ++ ++static const ulong32 TD1[256] = { ++ 0x5051f4a7UL, 0x537e4165UL, 0xc31a17a4UL, 0x963a275eUL, ++ 0xcb3bab6bUL, 0xf11f9d45UL, 0xabacfa58UL, 0x934be303UL, ++ 0x552030faUL, 0xf6ad766dUL, 0x9188cc76UL, 0x25f5024cUL, ++ 0xfc4fe5d7UL, 0xd7c52acbUL, 0x80263544UL, 0x8fb562a3UL, ++ 0x49deb15aUL, 0x6725ba1bUL, 0x9845ea0eUL, 0xe15dfec0UL, ++ 0x02c32f75UL, 0x12814cf0UL, 0xa38d4697UL, 0xc66bd3f9UL, ++ 0xe7038f5fUL, 0x9515929cUL, 0xebbf6d7aUL, 0xda955259UL, ++ 0x2dd4be83UL, 0xd3587421UL, 0x2949e069UL, 0x448ec9c8UL, ++ 0x6a75c289UL, 0x78f48e79UL, 0x6b99583eUL, 0xdd27b971UL, ++ 0xb6bee14fUL, 0x17f088adUL, 0x66c920acUL, 0xb47dce3aUL, ++ 0x1863df4aUL, 0x82e51a31UL, 0x60975133UL, 0x4562537fUL, ++ 0xe0b16477UL, 0x84bb6baeUL, 0x1cfe81a0UL, 0x94f9082bUL, ++ 0x58704868UL, 0x198f45fdUL, 0x8794de6cUL, 0xb7527bf8UL, ++ 0x23ab73d3UL, 0xe2724b02UL, 0x57e31f8fUL, 0x2a6655abUL, ++ 0x07b2eb28UL, 0x032fb5c2UL, 0x9a86c57bUL, 0xa5d33708UL, ++ 0xf2302887UL, 0xb223bfa5UL, 0xba02036aUL, 0x5ced1682UL, ++ 0x2b8acf1cUL, 0x92a779b4UL, 0xf0f307f2UL, 0xa14e69e2UL, ++ 0xcd65daf4UL, 0xd50605beUL, 0x1fd13462UL, 0x8ac4a6feUL, ++ 0x9d342e53UL, 0xa0a2f355UL, 0x32058ae1UL, 0x75a4f6ebUL, ++ 0x390b83ecUL, 0xaa4060efUL, 0x065e719fUL, 0x51bd6e10UL, ++ 0xf93e218aUL, 0x3d96dd06UL, 0xaedd3e05UL, 0x464de6bdUL, ++ 0xb591548dUL, 0x0571c45dUL, 0x6f0406d4UL, 0xff605015UL, ++ 0x241998fbUL, 0x97d6bde9UL, 0xcc894043UL, 0x7767d99eUL, ++ 0xbdb0e842UL, 0x8807898bUL, 0x38e7195bUL, 0xdb79c8eeUL, ++ 0x47a17c0aUL, 0xe97c420fUL, 0xc9f8841eUL, 0x00000000UL, ++ 0x83098086UL, 0x48322bedUL, 0xac1e1170UL, 0x4e6c5a72UL, ++ 0xfbfd0effUL, 0x560f8538UL, 0x1e3daed5UL, 0x27362d39UL, ++ 0x640a0fd9UL, 0x21685ca6UL, 0xd19b5b54UL, 0x3a24362eUL, ++ 0xb10c0a67UL, 0x0f9357e7UL, 0xd2b4ee96UL, 0x9e1b9b91UL, ++ 0x4f80c0c5UL, 0xa261dc20UL, 0x695a774bUL, 0x161c121aUL, ++ 0x0ae293baUL, 0xe5c0a02aUL, 0x433c22e0UL, 0x1d121b17UL, ++ 0x0b0e090dUL, 0xadf28bc7UL, 0xb92db6a8UL, 0xc8141ea9UL, ++ 0x8557f119UL, 0x4caf7507UL, 0xbbee99ddUL, 0xfda37f60UL, ++ 0x9ff70126UL, 0xbc5c72f5UL, 0xc544663bUL, 0x345bfb7eUL, ++ 0x768b4329UL, 0xdccb23c6UL, 0x68b6edfcUL, 0x63b8e4f1UL, ++ 0xcad731dcUL, 0x10426385UL, 0x40139722UL, 0x2084c611UL, ++ 0x7d854a24UL, 0xf8d2bb3dUL, 0x11aef932UL, 0x6dc729a1UL, ++ 0x4b1d9e2fUL, 0xf3dcb230UL, 0xec0d8652UL, 0xd077c1e3UL, ++ 0x6c2bb316UL, 0x99a970b9UL, 0xfa119448UL, 0x2247e964UL, ++ 0xc4a8fc8cUL, 0x1aa0f03fUL, 0xd8567d2cUL, 0xef223390UL, ++ 0xc787494eUL, 0xc1d938d1UL, 0xfe8ccaa2UL, 0x3698d40bUL, ++ 0xcfa6f581UL, 0x28a57adeUL, 0x26dab78eUL, 0xa43fadbfUL, ++ 0xe42c3a9dUL, 0x0d507892UL, 0x9b6a5fccUL, 0x62547e46UL, ++ 0xc2f68d13UL, 0xe890d8b8UL, 0x5e2e39f7UL, 0xf582c3afUL, ++ 0xbe9f5d80UL, 0x7c69d093UL, 0xa96fd52dUL, 0xb3cf2512UL, ++ 0x3bc8ac99UL, 0xa710187dUL, 0x6ee89c63UL, 0x7bdb3bbbUL, ++ 0x09cd2678UL, 0xf46e5918UL, 0x01ec9ab7UL, 0xa8834f9aUL, ++ 0x65e6956eUL, 0x7eaaffe6UL, 0x0821bccfUL, 0xe6ef15e8UL, ++ 0xd9bae79bUL, 0xce4a6f36UL, 0xd4ea9f09UL, 0xd629b07cUL, ++ 0xaf31a4b2UL, 0x312a3f23UL, 0x30c6a594UL, 0xc035a266UL, ++ 0x37744ebcUL, 0xa6fc82caUL, 0xb0e090d0UL, 0x1533a7d8UL, ++ 0x4af10498UL, 0xf741ecdaUL, 0x0e7fcd50UL, 0x2f1791f6UL, ++ 0x8d764dd6UL, 0x4d43efb0UL, 0x54ccaa4dUL, 0xdfe49604UL, ++ 0xe39ed1b5UL, 0x1b4c6a88UL, 0xb8c12c1fUL, 0x7f466551UL, ++ 0x049d5eeaUL, 0x5d018c35UL, 0x73fa8774UL, 0x2efb0b41UL, ++ 0x5ab3671dUL, 0x5292dbd2UL, 0x33e91056UL, 0x136dd647UL, ++ 0x8c9ad761UL, 0x7a37a10cUL, 0x8e59f814UL, 0x89eb133cUL, ++ 0xeecea927UL, 0x35b761c9UL, 0xede11ce5UL, 0x3c7a47b1UL, ++ 0x599cd2dfUL, 0x3f55f273UL, 0x791814ceUL, 0xbf73c737UL, ++ 0xea53f7cdUL, 0x5b5ffdaaUL, 0x14df3d6fUL, 0x867844dbUL, ++ 0x81caaff3UL, 0x3eb968c4UL, 0x2c382434UL, 0x5fc2a340UL, ++ 0x72161dc3UL, 0x0cbce225UL, 0x8b283c49UL, 0x41ff0d95UL, ++ 0x7139a801UL, 0xde080cb3UL, 0x9cd8b4e4UL, 0x906456c1UL, ++ 0x617bcb84UL, 0x70d532b6UL, 0x74486c5cUL, 0x42d0b857UL, ++}; ++static const ulong32 TD2[256] = { ++ 0xa75051f4UL, 0x65537e41UL, 0xa4c31a17UL, 0x5e963a27UL, ++ 0x6bcb3babUL, 0x45f11f9dUL, 0x58abacfaUL, 0x03934be3UL, ++ 0xfa552030UL, 0x6df6ad76UL, 0x769188ccUL, 0x4c25f502UL, ++ 0xd7fc4fe5UL, 0xcbd7c52aUL, 0x44802635UL, 0xa38fb562UL, ++ 0x5a49deb1UL, 0x1b6725baUL, 0x0e9845eaUL, 0xc0e15dfeUL, ++ 0x7502c32fUL, 0xf012814cUL, 0x97a38d46UL, 0xf9c66bd3UL, ++ 0x5fe7038fUL, 0x9c951592UL, 0x7aebbf6dUL, 0x59da9552UL, ++ 0x832dd4beUL, 0x21d35874UL, 0x692949e0UL, 0xc8448ec9UL, ++ 0x896a75c2UL, 0x7978f48eUL, 0x3e6b9958UL, 0x71dd27b9UL, ++ 0x4fb6bee1UL, 0xad17f088UL, 0xac66c920UL, 0x3ab47dceUL, ++ 0x4a1863dfUL, 0x3182e51aUL, 0x33609751UL, 0x7f456253UL, ++ 0x77e0b164UL, 0xae84bb6bUL, 0xa01cfe81UL, 0x2b94f908UL, ++ 0x68587048UL, 0xfd198f45UL, 0x6c8794deUL, 0xf8b7527bUL, ++ 0xd323ab73UL, 0x02e2724bUL, 0x8f57e31fUL, 0xab2a6655UL, ++ 0x2807b2ebUL, 0xc2032fb5UL, 0x7b9a86c5UL, 0x08a5d337UL, ++ 0x87f23028UL, 0xa5b223bfUL, 0x6aba0203UL, 0x825ced16UL, ++ 0x1c2b8acfUL, 0xb492a779UL, 0xf2f0f307UL, 0xe2a14e69UL, ++ 0xf4cd65daUL, 0xbed50605UL, 0x621fd134UL, 0xfe8ac4a6UL, ++ 0x539d342eUL, 0x55a0a2f3UL, 0xe132058aUL, 0xeb75a4f6UL, ++ 0xec390b83UL, 0xefaa4060UL, 0x9f065e71UL, 0x1051bd6eUL, ++ 0x8af93e21UL, 0x063d96ddUL, 0x05aedd3eUL, 0xbd464de6UL, ++ 0x8db59154UL, 0x5d0571c4UL, 0xd46f0406UL, 0x15ff6050UL, ++ 0xfb241998UL, 0xe997d6bdUL, 0x43cc8940UL, 0x9e7767d9UL, ++ 0x42bdb0e8UL, 0x8b880789UL, 0x5b38e719UL, 0xeedb79c8UL, ++ 0x0a47a17cUL, 0x0fe97c42UL, 0x1ec9f884UL, 0x00000000UL, ++ 0x86830980UL, 0xed48322bUL, 0x70ac1e11UL, 0x724e6c5aUL, ++ 0xfffbfd0eUL, 0x38560f85UL, 0xd51e3daeUL, 0x3927362dUL, ++ 0xd9640a0fUL, 0xa621685cUL, 0x54d19b5bUL, 0x2e3a2436UL, ++ 0x67b10c0aUL, 0xe70f9357UL, 0x96d2b4eeUL, 0x919e1b9bUL, ++ 0xc54f80c0UL, 0x20a261dcUL, 0x4b695a77UL, 0x1a161c12UL, ++ 0xba0ae293UL, 0x2ae5c0a0UL, 0xe0433c22UL, 0x171d121bUL, ++ 0x0d0b0e09UL, 0xc7adf28bUL, 0xa8b92db6UL, 0xa9c8141eUL, ++ 0x198557f1UL, 0x074caf75UL, 0xddbbee99UL, 0x60fda37fUL, ++ 0x269ff701UL, 0xf5bc5c72UL, 0x3bc54466UL, 0x7e345bfbUL, ++ 0x29768b43UL, 0xc6dccb23UL, 0xfc68b6edUL, 0xf163b8e4UL, ++ 0xdccad731UL, 0x85104263UL, 0x22401397UL, 0x112084c6UL, ++ 0x247d854aUL, 0x3df8d2bbUL, 0x3211aef9UL, 0xa16dc729UL, ++ 0x2f4b1d9eUL, 0x30f3dcb2UL, 0x52ec0d86UL, 0xe3d077c1UL, ++ 0x166c2bb3UL, 0xb999a970UL, 0x48fa1194UL, 0x642247e9UL, ++ 0x8cc4a8fcUL, 0x3f1aa0f0UL, 0x2cd8567dUL, 0x90ef2233UL, ++ 0x4ec78749UL, 0xd1c1d938UL, 0xa2fe8ccaUL, 0x0b3698d4UL, ++ 0x81cfa6f5UL, 0xde28a57aUL, 0x8e26dab7UL, 0xbfa43fadUL, ++ 0x9de42c3aUL, 0x920d5078UL, 0xcc9b6a5fUL, 0x4662547eUL, ++ 0x13c2f68dUL, 0xb8e890d8UL, 0xf75e2e39UL, 0xaff582c3UL, ++ 0x80be9f5dUL, 0x937c69d0UL, 0x2da96fd5UL, 0x12b3cf25UL, ++ 0x993bc8acUL, 0x7da71018UL, 0x636ee89cUL, 0xbb7bdb3bUL, ++ 0x7809cd26UL, 0x18f46e59UL, 0xb701ec9aUL, 0x9aa8834fUL, ++ 0x6e65e695UL, 0xe67eaaffUL, 0xcf0821bcUL, 0xe8e6ef15UL, ++ 0x9bd9bae7UL, 0x36ce4a6fUL, 0x09d4ea9fUL, 0x7cd629b0UL, ++ 0xb2af31a4UL, 0x23312a3fUL, 0x9430c6a5UL, 0x66c035a2UL, ++ 0xbc37744eUL, 0xcaa6fc82UL, 0xd0b0e090UL, 0xd81533a7UL, ++ 0x984af104UL, 0xdaf741ecUL, 0x500e7fcdUL, 0xf62f1791UL, ++ 0xd68d764dUL, 0xb04d43efUL, 0x4d54ccaaUL, 0x04dfe496UL, ++ 0xb5e39ed1UL, 0x881b4c6aUL, 0x1fb8c12cUL, 0x517f4665UL, ++ 0xea049d5eUL, 0x355d018cUL, 0x7473fa87UL, 0x412efb0bUL, ++ 0x1d5ab367UL, 0xd25292dbUL, 0x5633e910UL, 0x47136dd6UL, ++ 0x618c9ad7UL, 0x0c7a37a1UL, 0x148e59f8UL, 0x3c89eb13UL, ++ 0x27eecea9UL, 0xc935b761UL, 0xe5ede11cUL, 0xb13c7a47UL, ++ 0xdf599cd2UL, 0x733f55f2UL, 0xce791814UL, 0x37bf73c7UL, ++ 0xcdea53f7UL, 0xaa5b5ffdUL, 0x6f14df3dUL, 0xdb867844UL, ++ 0xf381caafUL, 0xc43eb968UL, 0x342c3824UL, 0x405fc2a3UL, ++ 0xc372161dUL, 0x250cbce2UL, 0x498b283cUL, 0x9541ff0dUL, ++ 0x017139a8UL, 0xb3de080cUL, 0xe49cd8b4UL, 0xc1906456UL, ++ 0x84617bcbUL, 0xb670d532UL, 0x5c74486cUL, 0x5742d0b8UL, ++}; ++static const ulong32 TD3[256] = { ++ 0xf4a75051UL, 0x4165537eUL, 0x17a4c31aUL, 0x275e963aUL, ++ 0xab6bcb3bUL, 0x9d45f11fUL, 0xfa58abacUL, 0xe303934bUL, ++ 0x30fa5520UL, 0x766df6adUL, 0xcc769188UL, 0x024c25f5UL, ++ 0xe5d7fc4fUL, 0x2acbd7c5UL, 0x35448026UL, 0x62a38fb5UL, ++ 0xb15a49deUL, 0xba1b6725UL, 0xea0e9845UL, 0xfec0e15dUL, ++ 0x2f7502c3UL, 0x4cf01281UL, 0x4697a38dUL, 0xd3f9c66bUL, ++ 0x8f5fe703UL, 0x929c9515UL, 0x6d7aebbfUL, 0x5259da95UL, ++ 0xbe832dd4UL, 0x7421d358UL, 0xe0692949UL, 0xc9c8448eUL, ++ 0xc2896a75UL, 0x8e7978f4UL, 0x583e6b99UL, 0xb971dd27UL, ++ 0xe14fb6beUL, 0x88ad17f0UL, 0x20ac66c9UL, 0xce3ab47dUL, ++ 0xdf4a1863UL, 0x1a3182e5UL, 0x51336097UL, 0x537f4562UL, ++ 0x6477e0b1UL, 0x6bae84bbUL, 0x81a01cfeUL, 0x082b94f9UL, ++ 0x48685870UL, 0x45fd198fUL, 0xde6c8794UL, 0x7bf8b752UL, ++ 0x73d323abUL, 0x4b02e272UL, 0x1f8f57e3UL, 0x55ab2a66UL, ++ 0xeb2807b2UL, 0xb5c2032fUL, 0xc57b9a86UL, 0x3708a5d3UL, ++ 0x2887f230UL, 0xbfa5b223UL, 0x036aba02UL, 0x16825cedUL, ++ 0xcf1c2b8aUL, 0x79b492a7UL, 0x07f2f0f3UL, 0x69e2a14eUL, ++ 0xdaf4cd65UL, 0x05bed506UL, 0x34621fd1UL, 0xa6fe8ac4UL, ++ 0x2e539d34UL, 0xf355a0a2UL, 0x8ae13205UL, 0xf6eb75a4UL, ++ 0x83ec390bUL, 0x60efaa40UL, 0x719f065eUL, 0x6e1051bdUL, ++ 0x218af93eUL, 0xdd063d96UL, 0x3e05aeddUL, 0xe6bd464dUL, ++ 0x548db591UL, 0xc45d0571UL, 0x06d46f04UL, 0x5015ff60UL, ++ 0x98fb2419UL, 0xbde997d6UL, 0x4043cc89UL, 0xd99e7767UL, ++ 0xe842bdb0UL, 0x898b8807UL, 0x195b38e7UL, 0xc8eedb79UL, ++ 0x7c0a47a1UL, 0x420fe97cUL, 0x841ec9f8UL, 0x00000000UL, ++ 0x80868309UL, 0x2bed4832UL, 0x1170ac1eUL, 0x5a724e6cUL, ++ 0x0efffbfdUL, 0x8538560fUL, 0xaed51e3dUL, 0x2d392736UL, ++ 0x0fd9640aUL, 0x5ca62168UL, 0x5b54d19bUL, 0x362e3a24UL, ++ 0x0a67b10cUL, 0x57e70f93UL, 0xee96d2b4UL, 0x9b919e1bUL, ++ 0xc0c54f80UL, 0xdc20a261UL, 0x774b695aUL, 0x121a161cUL, ++ 0x93ba0ae2UL, 0xa02ae5c0UL, 0x22e0433cUL, 0x1b171d12UL, ++ 0x090d0b0eUL, 0x8bc7adf2UL, 0xb6a8b92dUL, 0x1ea9c814UL, ++ 0xf1198557UL, 0x75074cafUL, 0x99ddbbeeUL, 0x7f60fda3UL, ++ 0x01269ff7UL, 0x72f5bc5cUL, 0x663bc544UL, 0xfb7e345bUL, ++ 0x4329768bUL, 0x23c6dccbUL, 0xedfc68b6UL, 0xe4f163b8UL, ++ 0x31dccad7UL, 0x63851042UL, 0x97224013UL, 0xc6112084UL, ++ 0x4a247d85UL, 0xbb3df8d2UL, 0xf93211aeUL, 0x29a16dc7UL, ++ 0x9e2f4b1dUL, 0xb230f3dcUL, 0x8652ec0dUL, 0xc1e3d077UL, ++ 0xb3166c2bUL, 0x70b999a9UL, 0x9448fa11UL, 0xe9642247UL, ++ 0xfc8cc4a8UL, 0xf03f1aa0UL, 0x7d2cd856UL, 0x3390ef22UL, ++ 0x494ec787UL, 0x38d1c1d9UL, 0xcaa2fe8cUL, 0xd40b3698UL, ++ 0xf581cfa6UL, 0x7ade28a5UL, 0xb78e26daUL, 0xadbfa43fUL, ++ 0x3a9de42cUL, 0x78920d50UL, 0x5fcc9b6aUL, 0x7e466254UL, ++ 0x8d13c2f6UL, 0xd8b8e890UL, 0x39f75e2eUL, 0xc3aff582UL, ++ 0x5d80be9fUL, 0xd0937c69UL, 0xd52da96fUL, 0x2512b3cfUL, ++ 0xac993bc8UL, 0x187da710UL, 0x9c636ee8UL, 0x3bbb7bdbUL, ++ 0x267809cdUL, 0x5918f46eUL, 0x9ab701ecUL, 0x4f9aa883UL, ++ 0x956e65e6UL, 0xffe67eaaUL, 0xbccf0821UL, 0x15e8e6efUL, ++ 0xe79bd9baUL, 0x6f36ce4aUL, 0x9f09d4eaUL, 0xb07cd629UL, ++ 0xa4b2af31UL, 0x3f23312aUL, 0xa59430c6UL, 0xa266c035UL, ++ 0x4ebc3774UL, 0x82caa6fcUL, 0x90d0b0e0UL, 0xa7d81533UL, ++ 0x04984af1UL, 0xecdaf741UL, 0xcd500e7fUL, 0x91f62f17UL, ++ 0x4dd68d76UL, 0xefb04d43UL, 0xaa4d54ccUL, 0x9604dfe4UL, ++ 0xd1b5e39eUL, 0x6a881b4cUL, 0x2c1fb8c1UL, 0x65517f46UL, ++ 0x5eea049dUL, 0x8c355d01UL, 0x877473faUL, 0x0b412efbUL, ++ 0x671d5ab3UL, 0xdbd25292UL, 0x105633e9UL, 0xd647136dUL, ++ 0xd7618c9aUL, 0xa10c7a37UL, 0xf8148e59UL, 0x133c89ebUL, ++ 0xa927eeceUL, 0x61c935b7UL, 0x1ce5ede1UL, 0x47b13c7aUL, ++ 0xd2df599cUL, 0xf2733f55UL, 0x14ce7918UL, 0xc737bf73UL, ++ 0xf7cdea53UL, 0xfdaa5b5fUL, 0x3d6f14dfUL, 0x44db8678UL, ++ 0xaff381caUL, 0x68c43eb9UL, 0x24342c38UL, 0xa3405fc2UL, ++ 0x1dc37216UL, 0xe2250cbcUL, 0x3c498b28UL, 0x0d9541ffUL, ++ 0xa8017139UL, 0x0cb3de08UL, 0xb4e49cd8UL, 0x56c19064UL, ++ 0xcb84617bUL, 0x32b670d5UL, 0x6c5c7448UL, 0xb85742d0UL, ++}; ++ ++static const ulong32 Tks0[] = { ++0x00000000UL, 0x0e090d0bUL, 0x1c121a16UL, 0x121b171dUL, 0x3824342cUL, 0x362d3927UL, 0x24362e3aUL, 0x2a3f2331UL, ++0x70486858UL, 0x7e416553UL, 0x6c5a724eUL, 0x62537f45UL, 0x486c5c74UL, 0x4665517fUL, 0x547e4662UL, 0x5a774b69UL, ++0xe090d0b0UL, 0xee99ddbbUL, 0xfc82caa6UL, 0xf28bc7adUL, 0xd8b4e49cUL, 0xd6bde997UL, 0xc4a6fe8aUL, 0xcaaff381UL, ++0x90d8b8e8UL, 0x9ed1b5e3UL, 0x8ccaa2feUL, 0x82c3aff5UL, 0xa8fc8cc4UL, 0xa6f581cfUL, 0xb4ee96d2UL, 0xbae79bd9UL, ++0xdb3bbb7bUL, 0xd532b670UL, 0xc729a16dUL, 0xc920ac66UL, 0xe31f8f57UL, 0xed16825cUL, 0xff0d9541UL, 0xf104984aUL, ++0xab73d323UL, 0xa57ade28UL, 0xb761c935UL, 0xb968c43eUL, 0x9357e70fUL, 0x9d5eea04UL, 0x8f45fd19UL, 0x814cf012UL, ++0x3bab6bcbUL, 0x35a266c0UL, 0x27b971ddUL, 0x29b07cd6UL, 0x038f5fe7UL, 0x0d8652ecUL, 0x1f9d45f1UL, 0x119448faUL, ++0x4be30393UL, 0x45ea0e98UL, 0x57f11985UL, 0x59f8148eUL, 0x73c737bfUL, 0x7dce3ab4UL, 0x6fd52da9UL, 0x61dc20a2UL, ++0xad766df6UL, 0xa37f60fdUL, 0xb16477e0UL, 0xbf6d7aebUL, 0x955259daUL, 0x9b5b54d1UL, 0x894043ccUL, 0x87494ec7UL, ++0xdd3e05aeUL, 0xd33708a5UL, 0xc12c1fb8UL, 0xcf2512b3UL, 0xe51a3182UL, 0xeb133c89UL, 0xf9082b94UL, 0xf701269fUL, ++0x4de6bd46UL, 0x43efb04dUL, 0x51f4a750UL, 0x5ffdaa5bUL, 0x75c2896aUL, 0x7bcb8461UL, 0x69d0937cUL, 0x67d99e77UL, ++0x3daed51eUL, 0x33a7d815UL, 0x21bccf08UL, 0x2fb5c203UL, 0x058ae132UL, 0x0b83ec39UL, 0x1998fb24UL, 0x1791f62fUL, ++0x764dd68dUL, 0x7844db86UL, 0x6a5fcc9bUL, 0x6456c190UL, 0x4e69e2a1UL, 0x4060efaaUL, 0x527bf8b7UL, 0x5c72f5bcUL, ++0x0605bed5UL, 0x080cb3deUL, 0x1a17a4c3UL, 0x141ea9c8UL, 0x3e218af9UL, 0x302887f2UL, 0x223390efUL, 0x2c3a9de4UL, ++0x96dd063dUL, 0x98d40b36UL, 0x8acf1c2bUL, 0x84c61120UL, 0xaef93211UL, 0xa0f03f1aUL, 0xb2eb2807UL, 0xbce2250cUL, ++0xe6956e65UL, 0xe89c636eUL, 0xfa877473UL, 0xf48e7978UL, 0xdeb15a49UL, 0xd0b85742UL, 0xc2a3405fUL, 0xccaa4d54UL, ++0x41ecdaf7UL, 0x4fe5d7fcUL, 0x5dfec0e1UL, 0x53f7cdeaUL, 0x79c8eedbUL, 0x77c1e3d0UL, 0x65daf4cdUL, 0x6bd3f9c6UL, ++0x31a4b2afUL, 0x3fadbfa4UL, 0x2db6a8b9UL, 0x23bfa5b2UL, 0x09808683UL, 0x07898b88UL, 0x15929c95UL, 0x1b9b919eUL, ++0xa17c0a47UL, 0xaf75074cUL, 0xbd6e1051UL, 0xb3671d5aUL, 0x99583e6bUL, 0x97513360UL, 0x854a247dUL, 0x8b432976UL, ++0xd134621fUL, 0xdf3d6f14UL, 0xcd267809UL, 0xc32f7502UL, 0xe9105633UL, 0xe7195b38UL, 0xf5024c25UL, 0xfb0b412eUL, ++0x9ad7618cUL, 0x94de6c87UL, 0x86c57b9aUL, 0x88cc7691UL, 0xa2f355a0UL, 0xacfa58abUL, 0xbee14fb6UL, 0xb0e842bdUL, ++0xea9f09d4UL, 0xe49604dfUL, 0xf68d13c2UL, 0xf8841ec9UL, 0xd2bb3df8UL, 0xdcb230f3UL, 0xcea927eeUL, 0xc0a02ae5UL, ++0x7a47b13cUL, 0x744ebc37UL, 0x6655ab2aUL, 0x685ca621UL, 0x42638510UL, 0x4c6a881bUL, 0x5e719f06UL, 0x5078920dUL, ++0x0a0fd964UL, 0x0406d46fUL, 0x161dc372UL, 0x1814ce79UL, 0x322bed48UL, 0x3c22e043UL, 0x2e39f75eUL, 0x2030fa55UL, ++0xec9ab701UL, 0xe293ba0aUL, 0xf088ad17UL, 0xfe81a01cUL, 0xd4be832dUL, 0xdab78e26UL, 0xc8ac993bUL, 0xc6a59430UL, ++0x9cd2df59UL, 0x92dbd252UL, 0x80c0c54fUL, 0x8ec9c844UL, 0xa4f6eb75UL, 0xaaffe67eUL, 0xb8e4f163UL, 0xb6edfc68UL, ++0x0c0a67b1UL, 0x02036abaUL, 0x10187da7UL, 0x1e1170acUL, 0x342e539dUL, 0x3a275e96UL, 0x283c498bUL, 0x26354480UL, ++0x7c420fe9UL, 0x724b02e2UL, 0x605015ffUL, 0x6e5918f4UL, 0x44663bc5UL, 0x4a6f36ceUL, 0x587421d3UL, 0x567d2cd8UL, ++0x37a10c7aUL, 0x39a80171UL, 0x2bb3166cUL, 0x25ba1b67UL, 0x0f853856UL, 0x018c355dUL, 0x13972240UL, 0x1d9e2f4bUL, ++0x47e96422UL, 0x49e06929UL, 0x5bfb7e34UL, 0x55f2733fUL, 0x7fcd500eUL, 0x71c45d05UL, 0x63df4a18UL, 0x6dd64713UL, ++0xd731dccaUL, 0xd938d1c1UL, 0xcb23c6dcUL, 0xc52acbd7UL, 0xef15e8e6UL, 0xe11ce5edUL, 0xf307f2f0UL, 0xfd0efffbUL, ++0xa779b492UL, 0xa970b999UL, 0xbb6bae84UL, 0xb562a38fUL, 0x9f5d80beUL, 0x91548db5UL, 0x834f9aa8UL, 0x8d4697a3UL ++}; ++ ++static const ulong32 Tks1[] = { ++0x00000000UL, 0x0b0e090dUL, 0x161c121aUL, 0x1d121b17UL, 0x2c382434UL, 0x27362d39UL, 0x3a24362eUL, 0x312a3f23UL, ++0x58704868UL, 0x537e4165UL, 0x4e6c5a72UL, 0x4562537fUL, 0x74486c5cUL, 0x7f466551UL, 0x62547e46UL, 0x695a774bUL, ++0xb0e090d0UL, 0xbbee99ddUL, 0xa6fc82caUL, 0xadf28bc7UL, 0x9cd8b4e4UL, 0x97d6bde9UL, 0x8ac4a6feUL, 0x81caaff3UL, ++0xe890d8b8UL, 0xe39ed1b5UL, 0xfe8ccaa2UL, 0xf582c3afUL, 0xc4a8fc8cUL, 0xcfa6f581UL, 0xd2b4ee96UL, 0xd9bae79bUL, ++0x7bdb3bbbUL, 0x70d532b6UL, 0x6dc729a1UL, 0x66c920acUL, 0x57e31f8fUL, 0x5ced1682UL, 0x41ff0d95UL, 0x4af10498UL, ++0x23ab73d3UL, 0x28a57adeUL, 0x35b761c9UL, 0x3eb968c4UL, 0x0f9357e7UL, 0x049d5eeaUL, 0x198f45fdUL, 0x12814cf0UL, ++0xcb3bab6bUL, 0xc035a266UL, 0xdd27b971UL, 0xd629b07cUL, 0xe7038f5fUL, 0xec0d8652UL, 0xf11f9d45UL, 0xfa119448UL, ++0x934be303UL, 0x9845ea0eUL, 0x8557f119UL, 0x8e59f814UL, 0xbf73c737UL, 0xb47dce3aUL, 0xa96fd52dUL, 0xa261dc20UL, ++0xf6ad766dUL, 0xfda37f60UL, 0xe0b16477UL, 0xebbf6d7aUL, 0xda955259UL, 0xd19b5b54UL, 0xcc894043UL, 0xc787494eUL, ++0xaedd3e05UL, 0xa5d33708UL, 0xb8c12c1fUL, 0xb3cf2512UL, 0x82e51a31UL, 0x89eb133cUL, 0x94f9082bUL, 0x9ff70126UL, ++0x464de6bdUL, 0x4d43efb0UL, 0x5051f4a7UL, 0x5b5ffdaaUL, 0x6a75c289UL, 0x617bcb84UL, 0x7c69d093UL, 0x7767d99eUL, ++0x1e3daed5UL, 0x1533a7d8UL, 0x0821bccfUL, 0x032fb5c2UL, 0x32058ae1UL, 0x390b83ecUL, 0x241998fbUL, 0x2f1791f6UL, ++0x8d764dd6UL, 0x867844dbUL, 0x9b6a5fccUL, 0x906456c1UL, 0xa14e69e2UL, 0xaa4060efUL, 0xb7527bf8UL, 0xbc5c72f5UL, ++0xd50605beUL, 0xde080cb3UL, 0xc31a17a4UL, 0xc8141ea9UL, 0xf93e218aUL, 0xf2302887UL, 0xef223390UL, 0xe42c3a9dUL, ++0x3d96dd06UL, 0x3698d40bUL, 0x2b8acf1cUL, 0x2084c611UL, 0x11aef932UL, 0x1aa0f03fUL, 0x07b2eb28UL, 0x0cbce225UL, ++0x65e6956eUL, 0x6ee89c63UL, 0x73fa8774UL, 0x78f48e79UL, 0x49deb15aUL, 0x42d0b857UL, 0x5fc2a340UL, 0x54ccaa4dUL, ++0xf741ecdaUL, 0xfc4fe5d7UL, 0xe15dfec0UL, 0xea53f7cdUL, 0xdb79c8eeUL, 0xd077c1e3UL, 0xcd65daf4UL, 0xc66bd3f9UL, ++0xaf31a4b2UL, 0xa43fadbfUL, 0xb92db6a8UL, 0xb223bfa5UL, 0x83098086UL, 0x8807898bUL, 0x9515929cUL, 0x9e1b9b91UL, ++0x47a17c0aUL, 0x4caf7507UL, 0x51bd6e10UL, 0x5ab3671dUL, 0x6b99583eUL, 0x60975133UL, 0x7d854a24UL, 0x768b4329UL, ++0x1fd13462UL, 0x14df3d6fUL, 0x09cd2678UL, 0x02c32f75UL, 0x33e91056UL, 0x38e7195bUL, 0x25f5024cUL, 0x2efb0b41UL, ++0x8c9ad761UL, 0x8794de6cUL, 0x9a86c57bUL, 0x9188cc76UL, 0xa0a2f355UL, 0xabacfa58UL, 0xb6bee14fUL, 0xbdb0e842UL, ++0xd4ea9f09UL, 0xdfe49604UL, 0xc2f68d13UL, 0xc9f8841eUL, 0xf8d2bb3dUL, 0xf3dcb230UL, 0xeecea927UL, 0xe5c0a02aUL, ++0x3c7a47b1UL, 0x37744ebcUL, 0x2a6655abUL, 0x21685ca6UL, 0x10426385UL, 0x1b4c6a88UL, 0x065e719fUL, 0x0d507892UL, ++0x640a0fd9UL, 0x6f0406d4UL, 0x72161dc3UL, 0x791814ceUL, 0x48322bedUL, 0x433c22e0UL, 0x5e2e39f7UL, 0x552030faUL, ++0x01ec9ab7UL, 0x0ae293baUL, 0x17f088adUL, 0x1cfe81a0UL, 0x2dd4be83UL, 0x26dab78eUL, 0x3bc8ac99UL, 0x30c6a594UL, ++0x599cd2dfUL, 0x5292dbd2UL, 0x4f80c0c5UL, 0x448ec9c8UL, 0x75a4f6ebUL, 0x7eaaffe6UL, 0x63b8e4f1UL, 0x68b6edfcUL, ++0xb10c0a67UL, 0xba02036aUL, 0xa710187dUL, 0xac1e1170UL, 0x9d342e53UL, 0x963a275eUL, 0x8b283c49UL, 0x80263544UL, ++0xe97c420fUL, 0xe2724b02UL, 0xff605015UL, 0xf46e5918UL, 0xc544663bUL, 0xce4a6f36UL, 0xd3587421UL, 0xd8567d2cUL, ++0x7a37a10cUL, 0x7139a801UL, 0x6c2bb316UL, 0x6725ba1bUL, 0x560f8538UL, 0x5d018c35UL, 0x40139722UL, 0x4b1d9e2fUL, ++0x2247e964UL, 0x2949e069UL, 0x345bfb7eUL, 0x3f55f273UL, 0x0e7fcd50UL, 0x0571c45dUL, 0x1863df4aUL, 0x136dd647UL, ++0xcad731dcUL, 0xc1d938d1UL, 0xdccb23c6UL, 0xd7c52acbUL, 0xe6ef15e8UL, 0xede11ce5UL, 0xf0f307f2UL, 0xfbfd0effUL, ++0x92a779b4UL, 0x99a970b9UL, 0x84bb6baeUL, 0x8fb562a3UL, 0xbe9f5d80UL, 0xb591548dUL, 0xa8834f9aUL, 0xa38d4697UL ++}; ++ ++static const ulong32 Tks2[] = { ++0x00000000UL, 0x0d0b0e09UL, 0x1a161c12UL, 0x171d121bUL, 0x342c3824UL, 0x3927362dUL, 0x2e3a2436UL, 0x23312a3fUL, ++0x68587048UL, 0x65537e41UL, 0x724e6c5aUL, 0x7f456253UL, 0x5c74486cUL, 0x517f4665UL, 0x4662547eUL, 0x4b695a77UL, ++0xd0b0e090UL, 0xddbbee99UL, 0xcaa6fc82UL, 0xc7adf28bUL, 0xe49cd8b4UL, 0xe997d6bdUL, 0xfe8ac4a6UL, 0xf381caafUL, ++0xb8e890d8UL, 0xb5e39ed1UL, 0xa2fe8ccaUL, 0xaff582c3UL, 0x8cc4a8fcUL, 0x81cfa6f5UL, 0x96d2b4eeUL, 0x9bd9bae7UL, ++0xbb7bdb3bUL, 0xb670d532UL, 0xa16dc729UL, 0xac66c920UL, 0x8f57e31fUL, 0x825ced16UL, 0x9541ff0dUL, 0x984af104UL, ++0xd323ab73UL, 0xde28a57aUL, 0xc935b761UL, 0xc43eb968UL, 0xe70f9357UL, 0xea049d5eUL, 0xfd198f45UL, 0xf012814cUL, ++0x6bcb3babUL, 0x66c035a2UL, 0x71dd27b9UL, 0x7cd629b0UL, 0x5fe7038fUL, 0x52ec0d86UL, 0x45f11f9dUL, 0x48fa1194UL, ++0x03934be3UL, 0x0e9845eaUL, 0x198557f1UL, 0x148e59f8UL, 0x37bf73c7UL, 0x3ab47dceUL, 0x2da96fd5UL, 0x20a261dcUL, ++0x6df6ad76UL, 0x60fda37fUL, 0x77e0b164UL, 0x7aebbf6dUL, 0x59da9552UL, 0x54d19b5bUL, 0x43cc8940UL, 0x4ec78749UL, ++0x05aedd3eUL, 0x08a5d337UL, 0x1fb8c12cUL, 0x12b3cf25UL, 0x3182e51aUL, 0x3c89eb13UL, 0x2b94f908UL, 0x269ff701UL, ++0xbd464de6UL, 0xb04d43efUL, 0xa75051f4UL, 0xaa5b5ffdUL, 0x896a75c2UL, 0x84617bcbUL, 0x937c69d0UL, 0x9e7767d9UL, ++0xd51e3daeUL, 0xd81533a7UL, 0xcf0821bcUL, 0xc2032fb5UL, 0xe132058aUL, 0xec390b83UL, 0xfb241998UL, 0xf62f1791UL, ++0xd68d764dUL, 0xdb867844UL, 0xcc9b6a5fUL, 0xc1906456UL, 0xe2a14e69UL, 0xefaa4060UL, 0xf8b7527bUL, 0xf5bc5c72UL, ++0xbed50605UL, 0xb3de080cUL, 0xa4c31a17UL, 0xa9c8141eUL, 0x8af93e21UL, 0x87f23028UL, 0x90ef2233UL, 0x9de42c3aUL, ++0x063d96ddUL, 0x0b3698d4UL, 0x1c2b8acfUL, 0x112084c6UL, 0x3211aef9UL, 0x3f1aa0f0UL, 0x2807b2ebUL, 0x250cbce2UL, ++0x6e65e695UL, 0x636ee89cUL, 0x7473fa87UL, 0x7978f48eUL, 0x5a49deb1UL, 0x5742d0b8UL, 0x405fc2a3UL, 0x4d54ccaaUL, ++0xdaf741ecUL, 0xd7fc4fe5UL, 0xc0e15dfeUL, 0xcdea53f7UL, 0xeedb79c8UL, 0xe3d077c1UL, 0xf4cd65daUL, 0xf9c66bd3UL, ++0xb2af31a4UL, 0xbfa43fadUL, 0xa8b92db6UL, 0xa5b223bfUL, 0x86830980UL, 0x8b880789UL, 0x9c951592UL, 0x919e1b9bUL, ++0x0a47a17cUL, 0x074caf75UL, 0x1051bd6eUL, 0x1d5ab367UL, 0x3e6b9958UL, 0x33609751UL, 0x247d854aUL, 0x29768b43UL, ++0x621fd134UL, 0x6f14df3dUL, 0x7809cd26UL, 0x7502c32fUL, 0x5633e910UL, 0x5b38e719UL, 0x4c25f502UL, 0x412efb0bUL, ++0x618c9ad7UL, 0x6c8794deUL, 0x7b9a86c5UL, 0x769188ccUL, 0x55a0a2f3UL, 0x58abacfaUL, 0x4fb6bee1UL, 0x42bdb0e8UL, ++0x09d4ea9fUL, 0x04dfe496UL, 0x13c2f68dUL, 0x1ec9f884UL, 0x3df8d2bbUL, 0x30f3dcb2UL, 0x27eecea9UL, 0x2ae5c0a0UL, ++0xb13c7a47UL, 0xbc37744eUL, 0xab2a6655UL, 0xa621685cUL, 0x85104263UL, 0x881b4c6aUL, 0x9f065e71UL, 0x920d5078UL, ++0xd9640a0fUL, 0xd46f0406UL, 0xc372161dUL, 0xce791814UL, 0xed48322bUL, 0xe0433c22UL, 0xf75e2e39UL, 0xfa552030UL, ++0xb701ec9aUL, 0xba0ae293UL, 0xad17f088UL, 0xa01cfe81UL, 0x832dd4beUL, 0x8e26dab7UL, 0x993bc8acUL, 0x9430c6a5UL, ++0xdf599cd2UL, 0xd25292dbUL, 0xc54f80c0UL, 0xc8448ec9UL, 0xeb75a4f6UL, 0xe67eaaffUL, 0xf163b8e4UL, 0xfc68b6edUL, ++0x67b10c0aUL, 0x6aba0203UL, 0x7da71018UL, 0x70ac1e11UL, 0x539d342eUL, 0x5e963a27UL, 0x498b283cUL, 0x44802635UL, ++0x0fe97c42UL, 0x02e2724bUL, 0x15ff6050UL, 0x18f46e59UL, 0x3bc54466UL, 0x36ce4a6fUL, 0x21d35874UL, 0x2cd8567dUL, ++0x0c7a37a1UL, 0x017139a8UL, 0x166c2bb3UL, 0x1b6725baUL, 0x38560f85UL, 0x355d018cUL, 0x22401397UL, 0x2f4b1d9eUL, ++0x642247e9UL, 0x692949e0UL, 0x7e345bfbUL, 0x733f55f2UL, 0x500e7fcdUL, 0x5d0571c4UL, 0x4a1863dfUL, 0x47136dd6UL, ++0xdccad731UL, 0xd1c1d938UL, 0xc6dccb23UL, 0xcbd7c52aUL, 0xe8e6ef15UL, 0xe5ede11cUL, 0xf2f0f307UL, 0xfffbfd0eUL, ++0xb492a779UL, 0xb999a970UL, 0xae84bb6bUL, 0xa38fb562UL, 0x80be9f5dUL, 0x8db59154UL, 0x9aa8834fUL, 0x97a38d46UL ++}; ++ ++static const ulong32 Tks3[] = { ++0x00000000UL, 0x090d0b0eUL, 0x121a161cUL, 0x1b171d12UL, 0x24342c38UL, 0x2d392736UL, 0x362e3a24UL, 0x3f23312aUL, ++0x48685870UL, 0x4165537eUL, 0x5a724e6cUL, 0x537f4562UL, 0x6c5c7448UL, 0x65517f46UL, 0x7e466254UL, 0x774b695aUL, ++0x90d0b0e0UL, 0x99ddbbeeUL, 0x82caa6fcUL, 0x8bc7adf2UL, 0xb4e49cd8UL, 0xbde997d6UL, 0xa6fe8ac4UL, 0xaff381caUL, ++0xd8b8e890UL, 0xd1b5e39eUL, 0xcaa2fe8cUL, 0xc3aff582UL, 0xfc8cc4a8UL, 0xf581cfa6UL, 0xee96d2b4UL, 0xe79bd9baUL, ++0x3bbb7bdbUL, 0x32b670d5UL, 0x29a16dc7UL, 0x20ac66c9UL, 0x1f8f57e3UL, 0x16825cedUL, 0x0d9541ffUL, 0x04984af1UL, ++0x73d323abUL, 0x7ade28a5UL, 0x61c935b7UL, 0x68c43eb9UL, 0x57e70f93UL, 0x5eea049dUL, 0x45fd198fUL, 0x4cf01281UL, ++0xab6bcb3bUL, 0xa266c035UL, 0xb971dd27UL, 0xb07cd629UL, 0x8f5fe703UL, 0x8652ec0dUL, 0x9d45f11fUL, 0x9448fa11UL, ++0xe303934bUL, 0xea0e9845UL, 0xf1198557UL, 0xf8148e59UL, 0xc737bf73UL, 0xce3ab47dUL, 0xd52da96fUL, 0xdc20a261UL, ++0x766df6adUL, 0x7f60fda3UL, 0x6477e0b1UL, 0x6d7aebbfUL, 0x5259da95UL, 0x5b54d19bUL, 0x4043cc89UL, 0x494ec787UL, ++0x3e05aeddUL, 0x3708a5d3UL, 0x2c1fb8c1UL, 0x2512b3cfUL, 0x1a3182e5UL, 0x133c89ebUL, 0x082b94f9UL, 0x01269ff7UL, ++0xe6bd464dUL, 0xefb04d43UL, 0xf4a75051UL, 0xfdaa5b5fUL, 0xc2896a75UL, 0xcb84617bUL, 0xd0937c69UL, 0xd99e7767UL, ++0xaed51e3dUL, 0xa7d81533UL, 0xbccf0821UL, 0xb5c2032fUL, 0x8ae13205UL, 0x83ec390bUL, 0x98fb2419UL, 0x91f62f17UL, ++0x4dd68d76UL, 0x44db8678UL, 0x5fcc9b6aUL, 0x56c19064UL, 0x69e2a14eUL, 0x60efaa40UL, 0x7bf8b752UL, 0x72f5bc5cUL, ++0x05bed506UL, 0x0cb3de08UL, 0x17a4c31aUL, 0x1ea9c814UL, 0x218af93eUL, 0x2887f230UL, 0x3390ef22UL, 0x3a9de42cUL, ++0xdd063d96UL, 0xd40b3698UL, 0xcf1c2b8aUL, 0xc6112084UL, 0xf93211aeUL, 0xf03f1aa0UL, 0xeb2807b2UL, 0xe2250cbcUL, ++0x956e65e6UL, 0x9c636ee8UL, 0x877473faUL, 0x8e7978f4UL, 0xb15a49deUL, 0xb85742d0UL, 0xa3405fc2UL, 0xaa4d54ccUL, ++0xecdaf741UL, 0xe5d7fc4fUL, 0xfec0e15dUL, 0xf7cdea53UL, 0xc8eedb79UL, 0xc1e3d077UL, 0xdaf4cd65UL, 0xd3f9c66bUL, ++0xa4b2af31UL, 0xadbfa43fUL, 0xb6a8b92dUL, 0xbfa5b223UL, 0x80868309UL, 0x898b8807UL, 0x929c9515UL, 0x9b919e1bUL, ++0x7c0a47a1UL, 0x75074cafUL, 0x6e1051bdUL, 0x671d5ab3UL, 0x583e6b99UL, 0x51336097UL, 0x4a247d85UL, 0x4329768bUL, ++0x34621fd1UL, 0x3d6f14dfUL, 0x267809cdUL, 0x2f7502c3UL, 0x105633e9UL, 0x195b38e7UL, 0x024c25f5UL, 0x0b412efbUL, ++0xd7618c9aUL, 0xde6c8794UL, 0xc57b9a86UL, 0xcc769188UL, 0xf355a0a2UL, 0xfa58abacUL, 0xe14fb6beUL, 0xe842bdb0UL, ++0x9f09d4eaUL, 0x9604dfe4UL, 0x8d13c2f6UL, 0x841ec9f8UL, 0xbb3df8d2UL, 0xb230f3dcUL, 0xa927eeceUL, 0xa02ae5c0UL, ++0x47b13c7aUL, 0x4ebc3774UL, 0x55ab2a66UL, 0x5ca62168UL, 0x63851042UL, 0x6a881b4cUL, 0x719f065eUL, 0x78920d50UL, ++0x0fd9640aUL, 0x06d46f04UL, 0x1dc37216UL, 0x14ce7918UL, 0x2bed4832UL, 0x22e0433cUL, 0x39f75e2eUL, 0x30fa5520UL, ++0x9ab701ecUL, 0x93ba0ae2UL, 0x88ad17f0UL, 0x81a01cfeUL, 0xbe832dd4UL, 0xb78e26daUL, 0xac993bc8UL, 0xa59430c6UL, ++0xd2df599cUL, 0xdbd25292UL, 0xc0c54f80UL, 0xc9c8448eUL, 0xf6eb75a4UL, 0xffe67eaaUL, 0xe4f163b8UL, 0xedfc68b6UL, ++0x0a67b10cUL, 0x036aba02UL, 0x187da710UL, 0x1170ac1eUL, 0x2e539d34UL, 0x275e963aUL, 0x3c498b28UL, 0x35448026UL, ++0x420fe97cUL, 0x4b02e272UL, 0x5015ff60UL, 0x5918f46eUL, 0x663bc544UL, 0x6f36ce4aUL, 0x7421d358UL, 0x7d2cd856UL, ++0xa10c7a37UL, 0xa8017139UL, 0xb3166c2bUL, 0xba1b6725UL, 0x8538560fUL, 0x8c355d01UL, 0x97224013UL, 0x9e2f4b1dUL, ++0xe9642247UL, 0xe0692949UL, 0xfb7e345bUL, 0xf2733f55UL, 0xcd500e7fUL, 0xc45d0571UL, 0xdf4a1863UL, 0xd647136dUL, ++0x31dccad7UL, 0x38d1c1d9UL, 0x23c6dccbUL, 0x2acbd7c5UL, 0x15e8e6efUL, 0x1ce5ede1UL, 0x07f2f0f3UL, 0x0efffbfdUL, ++0x79b492a7UL, 0x70b999a9UL, 0x6bae84bbUL, 0x62a38fb5UL, 0x5d80be9fUL, 0x548db591UL, 0x4f9aa883UL, 0x4697a38dUL ++}; ++ ++#endif /* SMALL CODE */ ++ ++static const ulong32 rcon[] = { ++ 0x01000000UL, 0x02000000UL, 0x04000000UL, 0x08000000UL, ++ 0x10000000UL, 0x20000000UL, 0x40000000UL, 0x80000000UL, ++ 0x1B000000UL, 0x36000000UL, /* for 128-bit blocks, AES never uses more than 10 rcon values */ ++}; ++ ++ ++static int aes_setup(const unsigned char *key, int keylen, int rounds, aes_CBC *skey); ++static void aes_ecb_encrypt(const unsigned char *pt, unsigned char *ct, aes_CBC *skey); ++static void aes_ecb_decrypt(const unsigned char *ct, unsigned char *pt, aes_CBC *skey); ++ ++#ifdef CLEAN_STACK ++static void _aes_ecb_decrypt(const unsigned char *ct, unsigned char *pt, aes_CBC *skey); ++static void _aes_ecb_encrypt(const unsigned char *pt, unsigned char *ct, aes_CBC *skey); ++#endif ++ ++int matrixAesInit(sslCipherContext_t *ctx, unsigned char *IV, unsigned char *key, int keylen) ++{ ++ int x, err; ++ ++ if (IV == NULL || key == NULL || ctx == NULL) { ++ return -1; ++ } ++/* ++ setup cipher ++ */ ++ if ((err = aes_setup(key, keylen, 0, &ctx->aes)) != CRYPT_OK) { ++ return -1; ++ } ++/* ++ copy IV ++ */ ++ ctx->aes.blocklen = 16; ++ for (x = 0; x < ctx->aes.blocklen; x++) { ++ ctx->aes.IV[x] = IV[x]; ++ } ++ return 0; ++} ++ ++int matrixAesEncrypt(sslCipherContext_t *ctx, unsigned char *pt, unsigned char *ct, int len) ++{ ++ int x, i; ++ unsigned char tmp[MAXBLOCKSIZE]; ++ ++ if (pt == NULL || ct == NULL || ctx == NULL || (len & 0x7) != 0) { ++ matrixStrDebugMsg("Bad parameters to matrixAesEncrypt\n", NULL); ++ return -1; ++ } ++ ++/* ++ is blocklen valid? ++ */ ++ if (ctx->aes.blocklen < 0 || ctx->aes.blocklen > ++ (int)sizeof(ctx->aes.IV)) { ++ return -1; ++ } ++ ++ for (i = 0; i < len; i += ctx->aes.blocklen) { ++/* ++ xor IV against plaintext ++ */ ++ for (x = 0; x < ctx->aes.blocklen; x++) { ++ tmp[x] = pt[x] ^ ctx->aes.IV[x]; ++ } ++/* ++ encrypt ++ */ ++ aes_ecb_encrypt(tmp, ct, &ctx->aes); ++ ++/* ++ store IV [ciphertext] for a future block ++ */ ++ for (x = 0; x < ctx->aes.blocklen; x++) { ++ ctx->aes.IV[x] = ct[x]; ++ } ++ ct += ctx->aes.blocklen; ++ pt += ctx->aes.blocklen; ++ } ++ ++#ifdef CLEAN_STACK ++ zeromem(tmp, sizeof(tmp)); ++#endif ++ return len; ++} ++ ++int matrixAesDecrypt(sslCipherContext_t *ctx, unsigned char *ct, unsigned char *pt, int len) ++{ ++ int x, i; ++ unsigned char tmp[MAXBLOCKSIZE], tmp2[MAXBLOCKSIZE]; ++ ++ if (pt == NULL || ct == NULL || ctx == NULL || (len & 0x7) != 0) { ++ matrixStrDebugMsg("Bad parameters to matrixAesDecrypt\n", NULL); ++ return -1; ++ } ++ ++/* ++ is blocklen valid? ++ */ ++ if (ctx->aes.blocklen < 0 || ctx->aes.blocklen > ++ (int)sizeof(ctx->aes.IV)) { ++ return -1; ++ } ++ for (i = 0; i < len; i += ctx->aes.blocklen) { ++/* ++ decrypt the block from ct into tmp ++ */ ++ aes_ecb_decrypt(ct, tmp, &ctx->aes); ++/* ++ xor IV against the plaintext of the previous step ++ */ ++ for (x = 0; x < ctx->aes.blocklen; x++) { ++/* ++ copy CT in case ct == pt ++ */ ++ tmp2[x] = ct[x]; ++/* ++ actually decrypt the byte ++ */ ++ pt[x] = tmp[x] ^ ctx->aes.IV[x]; ++ } ++/* ++ replace IV with this current ciphertext ++ */ ++ for (x = 0; x < ctx->aes.blocklen; x++) { ++ ctx->aes.IV[x] = tmp2[x]; ++ } ++ ct += ctx->aes.blocklen; ++ pt += ctx->aes.blocklen; ++ } ++#ifdef CLEAN_STACK ++ zeromem(tmp, sizeof(tmp)); ++ zeromem(tmp2, sizeof(tmp2)); ++#endif ++ return len; ++} ++ ++int aes_setup(const unsigned char *key, int keylen, int rounds, aes_CBC *skey) ++{ ++ int i, j; ++ ulong32 temp, *rk, *rrk; ++ ++ if (key == NULL || skey == NULL) { ++ return -1; ++ } ++ ++ if (keylen != 16 && keylen != 24 && keylen != 32) { ++ return CRYPT_INVALID_KEYSIZE; ++ } ++ ++ if (rounds != 0 && rounds != (10 + ((keylen/8)-2)*2)) { ++ return CRYPT_INVALID_ROUNDS; ++ } ++ ++ skey->key.Nr = 10 + ((keylen/8)-2)*2; ++ ++/* ++ setup the forward key ++ */ ++ i = 0; ++ rk = skey->key.eK; ++ LOAD32H(rk[0], key ); ++ LOAD32H(rk[1], key + 4); ++ LOAD32H(rk[2], key + 8); ++ LOAD32H(rk[3], key + 12); ++ if (keylen == 16) { ++ j = 44; ++ for (;;) { ++ temp = rk[3]; ++ rk[4] = rk[0] ^ ++ (Te4_3[byte(temp, 2)]) ^ ++ (Te4_2[byte(temp, 1)]) ^ ++ (Te4_1[byte(temp, 0)]) ^ ++ (Te4_0[byte(temp, 3)]) ^ ++ rcon[i]; ++ rk[5] = rk[1] ^ rk[4]; ++ rk[6] = rk[2] ^ rk[5]; ++ rk[7] = rk[3] ^ rk[6]; ++ if (++i == 10) { ++ break; ++ } ++ rk += 4; ++ } ++ } else if (keylen == 24) { ++ j = 52; ++ LOAD32H(rk[4], key + 16); ++ LOAD32H(rk[5], key + 20); ++ for (;;) { ++ #ifdef _MSC_VER ++ temp = skey->key.eK[rk - skey->key.eK + 5]; ++ #else ++ temp = rk[5]; ++ #endif /* _MSC_VER */ ++ rk[ 6] = rk[ 0] ^ ++ (Te4_3[byte(temp, 2)]) ^ ++ (Te4_2[byte(temp, 1)]) ^ ++ (Te4_1[byte(temp, 0)]) ^ ++ (Te4_0[byte(temp, 3)]) ^ ++ rcon[i]; ++ rk[ 7] = rk[ 1] ^ rk[ 6]; ++ rk[ 8] = rk[ 2] ^ rk[ 7]; ++ rk[ 9] = rk[ 3] ^ rk[ 8]; ++ if (++i == 8) { ++ break; ++ } ++ rk[10] = rk[ 4] ^ rk[ 9]; ++ rk[11] = rk[ 5] ^ rk[10]; ++ rk += 6; ++ } ++ } else if (keylen == 32) { ++ j = 60; ++ LOAD32H(rk[4], key + 16); ++ LOAD32H(rk[5], key + 20); ++ LOAD32H(rk[6], key + 24); ++ LOAD32H(rk[7], key + 28); ++ for (;;) { ++ #ifdef _MSC_VER ++ temp = skey->key.eK[rk - skey->key.eK + 7]; ++ #else ++ temp = rk[7]; ++ #endif /* _MSC_VER */ ++ rk[ 8] = rk[ 0] ^ ++ (Te4_3[byte(temp, 2)]) ^ ++ (Te4_2[byte(temp, 1)]) ^ ++ (Te4_1[byte(temp, 0)]) ^ ++ (Te4_0[byte(temp, 3)]) ^ ++ rcon[i]; ++ rk[ 9] = rk[ 1] ^ rk[ 8]; ++ rk[10] = rk[ 2] ^ rk[ 9]; ++ rk[11] = rk[ 3] ^ rk[10]; ++ if (++i == 7) { ++ break; ++ } ++ temp = rk[11]; ++ rk[12] = rk[ 4] ^ ++ (Te4_3[byte(temp, 3)]) ^ ++ (Te4_2[byte(temp, 2)]) ^ ++ (Te4_1[byte(temp, 1)]) ^ ++ (Te4_0[byte(temp, 0)]); ++ rk[13] = rk[ 5] ^ rk[12]; ++ rk[14] = rk[ 6] ^ rk[13]; ++ rk[15] = rk[ 7] ^ rk[14]; ++ rk += 8; ++ } ++ } else { ++/* ++ this can't happen ++ */ ++ j = 4; ++ } ++ ++/* ++ setup the inverse key now ++ */ ++ rk = skey->key.dK; ++ rrk = skey->key.eK + j - 4; ++ ++/* ++ apply the inverse MixColumn transform to all round keys but the first and the last: ++ */ ++ /* copy first */ ++ *rk++ = *rrk++; ++ *rk++ = *rrk++; ++ *rk++ = *rrk++; ++ *rk = *rrk; ++ rk -= 3; rrk -= 3; ++ ++ for (i = 1; i < skey->key.Nr; i++) { ++ rrk -= 4; ++ rk += 4; ++#ifdef SMALL_CODE ++ temp = rrk[0]; ++ rk[0] = ++ Td0(255 & Te4[byte(temp, 3)]) ^ ++ Td1(255 & Te4[byte(temp, 2)]) ^ ++ Td2(255 & Te4[byte(temp, 1)]) ^ ++ Td3(255 & Te4[byte(temp, 0)]); ++ temp = rrk[1]; ++ rk[1] = ++ Td0(255 & Te4[byte(temp, 3)]) ^ ++ Td1(255 & Te4[byte(temp, 2)]) ^ ++ Td2(255 & Te4[byte(temp, 1)]) ^ ++ Td3(255 & Te4[byte(temp, 0)]); ++ temp = rrk[2]; ++ rk[2] = ++ Td0(255 & Te4[byte(temp, 3)]) ^ ++ Td1(255 & Te4[byte(temp, 2)]) ^ ++ Td2(255 & Te4[byte(temp, 1)]) ^ ++ Td3(255 & Te4[byte(temp, 0)]); ++ temp = rrk[3]; ++ rk[3] = ++ Td0(255 & Te4[byte(temp, 3)]) ^ ++ Td1(255 & Te4[byte(temp, 2)]) ^ ++ Td2(255 & Te4[byte(temp, 1)]) ^ ++ Td3(255 & Te4[byte(temp, 0)]); ++#else /* SMALL CODE */ ++ temp = rrk[0]; ++ rk[0] = ++ Tks0[byte(temp, 3)] ^ ++ Tks1[byte(temp, 2)] ^ ++ Tks2[byte(temp, 1)] ^ ++ Tks3[byte(temp, 0)]; ++ temp = rrk[1]; ++ rk[1] = ++ Tks0[byte(temp, 3)] ^ ++ Tks1[byte(temp, 2)] ^ ++ Tks2[byte(temp, 1)] ^ ++ Tks3[byte(temp, 0)]; ++ temp = rrk[2]; ++ rk[2] = ++ Tks0[byte(temp, 3)] ^ ++ Tks1[byte(temp, 2)] ^ ++ Tks2[byte(temp, 1)] ^ ++ Tks3[byte(temp, 0)]; ++ temp = rrk[3]; ++ rk[3] = ++ Tks0[byte(temp, 3)] ^ ++ Tks1[byte(temp, 2)] ^ ++ Tks2[byte(temp, 1)] ^ ++ Tks3[byte(temp, 0)]; ++#endif /* SMALL CODE */ ++ } ++ ++ /* copy last */ ++ rrk -= 4; ++ rk += 4; ++ *rk++ = *rrk++; ++ *rk++ = *rrk++; ++ *rk++ = *rrk++; ++ *rk = *rrk; ++ ++ return CRYPT_OK; ++} ++ ++#ifdef CLEAN_STACK ++void aes_ecb_encrypt(const unsigned char *pt, unsigned char *ct, aes_CBC *skey) ++{ ++ _aes_ecb_encrypt(pt, ct, skey); ++ burn_stack(sizeof(unsigned long)*8 + sizeof(unsigned long*) + sizeof(int)*2); ++} ++#endif /* CLEAN_STACK */ ++ ++#ifdef CLEAN_STACK ++static void _aes_ecb_encrypt(const unsigned char *pt, unsigned char *ct, aes_CBC *skey) ++#else ++void aes_ecb_encrypt(const unsigned char *pt, unsigned char *ct, aes_CBC *skey) ++#endif /* CLEAN_STACK */ ++{ ++ ulong32 s0, s1, s2, s3, t0, t1, t2, t3, *rk; ++ int Nr, r; ++ ++ if (pt == NULL || ct == NULL || skey == NULL) { ++ return; ++ } ++ ++ Nr = skey->key.Nr; ++ rk = skey->key.eK; ++ ++/* ++ map byte array block to cipher state ++ and add initial round key: ++ */ ++ LOAD32H(s0, pt ); s0 ^= rk[0]; ++ LOAD32H(s1, pt + 4); s1 ^= rk[1]; ++ LOAD32H(s2, pt + 8); s2 ^= rk[2]; ++ LOAD32H(s3, pt + 12); s3 ^= rk[3]; ++ ++/* ++ Nr - 1 full rounds: ++ */ ++ r = Nr >> 1; ++ for (;;) { ++ ++ t0 = ++ Te0(byte(s0, 3)) ^ ++ Te1(byte(s1, 2)) ^ ++ Te2(byte(s2, 1)) ^ ++ Te3(byte(s3, 0)) ^ ++ rk[4]; ++ t1 = ++ Te0(byte(s1, 3)) ^ ++ Te1(byte(s2, 2)) ^ ++ Te2(byte(s3, 1)) ^ ++ Te3(byte(s0, 0)) ^ ++ rk[5]; ++ t2 = ++ Te0(byte(s2, 3)) ^ ++ Te1(byte(s3, 2)) ^ ++ Te2(byte(s0, 1)) ^ ++ Te3(byte(s1, 0)) ^ ++ rk[6]; ++ t3 = ++ Te0(byte(s3, 3)) ^ ++ Te1(byte(s0, 2)) ^ ++ Te2(byte(s1, 1)) ^ ++ Te3(byte(s2, 0)) ^ ++ rk[7]; ++ ++ rk += 8; ++ if (--r == 0) { ++ break; ++ } ++ ++ s0 = ++ Te0(byte(t0, 3)) ^ ++ Te1(byte(t1, 2)) ^ ++ Te2(byte(t2, 1)) ^ ++ Te3(byte(t3, 0)) ^ ++ rk[0]; ++ s1 = ++ Te0(byte(t1, 3)) ^ ++ Te1(byte(t2, 2)) ^ ++ Te2(byte(t3, 1)) ^ ++ Te3(byte(t0, 0)) ^ ++ rk[1]; ++ s2 = ++ Te0(byte(t2, 3)) ^ ++ Te1(byte(t3, 2)) ^ ++ Te2(byte(t0, 1)) ^ ++ Te3(byte(t1, 0)) ^ ++ rk[2]; ++ s3 = ++ Te0(byte(t3, 3)) ^ ++ Te1(byte(t0, 2)) ^ ++ Te2(byte(t1, 1)) ^ ++ Te3(byte(t2, 0)) ^ ++ rk[3]; ++ } ++/* ++ apply last round and map cipher state to byte array block: ++ */ ++ s0 = ++ (Te4_3[byte(t0, 3)]) ^ ++ (Te4_2[byte(t1, 2)]) ^ ++ (Te4_1[byte(t2, 1)]) ^ ++ (Te4_0[byte(t3, 0)]) ^ ++ rk[0]; ++ STORE32H(s0, ct); ++ s1 = ++ (Te4_3[byte(t1, 3)]) ^ ++ (Te4_2[byte(t2, 2)]) ^ ++ (Te4_1[byte(t3, 1)]) ^ ++ (Te4_0[byte(t0, 0)]) ^ ++ rk[1]; ++ STORE32H(s1, ct+4); ++ s2 = ++ (Te4_3[byte(t2, 3)]) ^ ++ (Te4_2[byte(t3, 2)]) ^ ++ (Te4_1[byte(t0, 1)]) ^ ++ (Te4_0[byte(t1, 0)]) ^ ++ rk[2]; ++ STORE32H(s2, ct+8); ++ s3 = ++ (Te4_3[byte(t3, 3)]) ^ ++ (Te4_2[byte(t0, 2)]) ^ ++ (Te4_1[byte(t1, 1)]) ^ ++ (Te4_0[byte(t2, 0)]) ^ ++ rk[3]; ++ STORE32H(s3, ct+12); ++} ++ ++#ifdef CLEAN_STACK ++void aes_ecb_decrypt(const unsigned char *pt, unsigned char *ct, aes_CBC *skey) ++{ ++ _aes_ecb_decrypt(pt, ct, skey); ++ burn_stack(sizeof(unsigned long)*8 + sizeof(unsigned long*) + sizeof(int)*2); ++} ++#endif /* CLEAN_STACK */ ++ ++#ifdef CLEAN_STACK ++static void _aes_ecb_decrypt(const unsigned char *ct, unsigned char *pt, aes_CBC *skey) ++#else ++void aes_ecb_decrypt(const unsigned char *ct, unsigned char *pt, aes_CBC *skey) ++#endif /* CLEAN_STACK */ ++{ ++ ulong32 s0, s1, s2, s3, t0, t1, t2, t3, *rk; ++ int Nr, r; ++ ++ if (pt == NULL || ct == NULL || skey == NULL) { ++ return; ++ } ++ ++ Nr = skey->key.Nr; ++ rk = skey->key.dK; ++ ++/* ++ map byte array block to cipher state and add initial round key: ++ */ ++ LOAD32H(s0, ct ); s0 ^= rk[0]; ++ LOAD32H(s1, ct + 4); s1 ^= rk[1]; ++ LOAD32H(s2, ct + 8); s2 ^= rk[2]; ++ LOAD32H(s3, ct + 12); s3 ^= rk[3]; ++ ++/* ++ Nr - 1 full rounds: ++ */ ++ r = Nr >> 1; ++ for (;;) { ++ ++ t0 = ++ Td0(byte(s0, 3)) ^ ++ Td1(byte(s3, 2)) ^ ++ Td2(byte(s2, 1)) ^ ++ Td3(byte(s1, 0)) ^ ++ rk[4]; ++ t1 = ++ Td0(byte(s1, 3)) ^ ++ Td1(byte(s0, 2)) ^ ++ Td2(byte(s3, 1)) ^ ++ Td3(byte(s2, 0)) ^ ++ rk[5]; ++ t2 = ++ Td0(byte(s2, 3)) ^ ++ Td1(byte(s1, 2)) ^ ++ Td2(byte(s0, 1)) ^ ++ Td3(byte(s3, 0)) ^ ++ rk[6]; ++ t3 = ++ Td0(byte(s3, 3)) ^ ++ Td1(byte(s2, 2)) ^ ++ Td2(byte(s1, 1)) ^ ++ Td3(byte(s0, 0)) ^ ++ rk[7]; ++ ++ rk += 8; ++ if (--r == 0) { ++ break; ++ } ++ ++ s0 = ++ Td0(byte(t0, 3)) ^ ++ Td1(byte(t3, 2)) ^ ++ Td2(byte(t2, 1)) ^ ++ Td3(byte(t1, 0)) ^ ++ rk[0]; ++ s1 = ++ Td0(byte(t1, 3)) ^ ++ Td1(byte(t0, 2)) ^ ++ Td2(byte(t3, 1)) ^ ++ Td3(byte(t2, 0)) ^ ++ rk[1]; ++ s2 = ++ Td0(byte(t2, 3)) ^ ++ Td1(byte(t1, 2)) ^ ++ Td2(byte(t0, 1)) ^ ++ Td3(byte(t3, 0)) ^ ++ rk[2]; ++ s3 = ++ Td0(byte(t3, 3)) ^ ++ Td1(byte(t2, 2)) ^ ++ Td2(byte(t1, 1)) ^ ++ Td3(byte(t0, 0)) ^ ++ rk[3]; ++ } ++ ++/* ++ apply last round and map cipher state to byte array block: ++ */ ++ s0 = ++ (Td4[byte(t0, 3)] & 0xff000000) ^ ++ (Td4[byte(t3, 2)] & 0x00ff0000) ^ ++ (Td4[byte(t2, 1)] & 0x0000ff00) ^ ++ (Td4[byte(t1, 0)] & 0x000000ff) ^ ++ rk[0]; ++ STORE32H(s0, pt); ++ s1 = ++ (Td4[byte(t1, 3)] & 0xff000000) ^ ++ (Td4[byte(t0, 2)] & 0x00ff0000) ^ ++ (Td4[byte(t3, 1)] & 0x0000ff00) ^ ++ (Td4[byte(t2, 0)] & 0x000000ff) ^ ++ rk[1]; ++ STORE32H(s1, pt+4); ++ s2 = ++ (Td4[byte(t2, 3)] & 0xff000000) ^ ++ (Td4[byte(t1, 2)] & 0x00ff0000) ^ ++ (Td4[byte(t0, 1)] & 0x0000ff00) ^ ++ (Td4[byte(t3, 0)] & 0x000000ff) ^ ++ rk[2]; ++ STORE32H(s2, pt+8); ++ s3 = ++ (Td4[byte(t3, 3)] & 0xff000000) ^ ++ (Td4[byte(t2, 2)] & 0x00ff0000) ^ ++ (Td4[byte(t1, 1)] & 0x0000ff00) ^ ++ (Td4[byte(t0, 0)] & 0x000000ff) ^ ++ rk[3]; ++ STORE32H(s3, pt+12); ++} ++ ++#ifdef CLEAN_STACK ++void aes(const unsigned char *ct, unsigned char *pt, aes_CBC *skey) ++{ ++ _aes_ecb_decrypt(ct, pt, skey); ++ burn_stack(sizeof(unsigned long)*8 + sizeof(unsigned long*) + sizeof(int)*2); ++} ++#endif /* CLEAN_STACK */ ++ ++ ++#ifdef PEERSEC_TEST ++ ++int matrixAesTest() ++{ ++ int err; ++ static const struct { ++ int keylen; ++ unsigned char key[32], pt[16], ct[16]; ++ } tests[] = { ++ { 16, ++ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, ++ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, ++ { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, ++ 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }, ++ { 0x69, 0xc4, 0xe0, 0xd8, 0x6a, 0x7b, 0x04, 0x30, ++ 0xd8, 0xcd, 0xb7, 0x80, 0x70, 0xb4, 0xc5, 0x5a } ++ }, { ++ 24, ++ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, ++ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, ++ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 }, ++ { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, ++ 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }, ++ { 0xdd, 0xa9, 0x7c, 0xa4, 0x86, 0x4c, 0xdf, 0xe0, ++ 0x6e, 0xaf, 0x70, 0xa0, 0xec, 0x0d, 0x71, 0x91 } ++ }, { ++ 32, ++ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, ++ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, ++ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, ++ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, ++ { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, ++ 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }, ++ { 0x8e, 0xa2, 0xb7, 0xca, 0x51, 0x67, 0x45, 0xbf, ++ 0xea, 0xfc, 0x49, 0x90, 0x4b, 0x49, 0x60, 0x89 } ++ } ++ }; ++ ++ aes_CBC key; ++ unsigned char tmp[2][16]; ++ int i, y; ++ ++ for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { ++ zeromem(&key, sizeof(key)); ++ if ((err = aes_setup(tests[i].key, tests[i].keylen, 0, &key)) != CRYPT_OK) { ++ return err; ++ } ++ ++ aes_ecb_encrypt(tests[i].pt, tmp[0], &key); ++ aes_ecb_decrypt(tmp[0], tmp[1], &key); ++ if (memcmp(tmp[0], tests[i].ct, 16) || memcmp(tmp[1], tests[i].pt, 16)) { ++#if 0 ++ printf("\n\nTest %d failed\n", i); ++ if (memcmp(tmp[0], tests[i].ct, 16)) { ++ printf("CT: "); ++ for (i = 0; i < 16; i++) { ++ printf("%02x ", tmp[0][i]); ++ } ++ printf("\n"); ++ } else { ++ printf("PT: "); ++ for (i = 0; i < 16; i++) { ++ printf("%02x ", tmp[1][i]); ++ } ++ printf("\n"); ++ } ++#endif /* 0 */ ++ return CRYPT_FAIL_TESTVECTOR; ++ } ++ ++/* ++ now see if we can encrypt all zero bytes 1000 times, ++ decrypt and come back where we started ++ */ ++ for (y = 0; y < 16; y++) tmp[0][y] = 0; ++ for (y = 0; y < 1000; y++) aes_ecb_encrypt(tmp[0], tmp[0], &key); ++ for (y = 0; y < 1000; y++) aes_ecb_decrypt(tmp[0], tmp[0], &key); ++ for (y = 0; y < 16; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; ++ } ++ return CRYPT_OK; ++} ++#endif /* PEERSEC_TEST */ ++ ++#endif /* USE_AES */ ++/******************************************************************************/ +diff -urN matrixssl.old/src/crypto/peersec/md5.c matrixssl/src/crypto/peersec/md5.c +--- matrixssl.old/src/crypto/peersec/md5.c 2005-02-23 22:43:10.000000000 +0100 ++++ matrixssl/src/crypto/peersec/md5.c 2005-03-06 01:32:33.000000000 +0100 +@@ -334,7 +334,7 @@ + #ifdef CLEAN_STACK + psZeromem(md, sizeof(hash_state)); + #endif /* CLEAN_STACK */ +- return 16; ++ return SSL_MD5_HASH_SIZE; + } + + #ifdef PEERSEC_TEST +diff -urN matrixssl.old/src/crypto/peersec/pscrypto.h matrixssl/src/crypto/peersec/pscrypto.h +--- matrixssl.old/src/crypto/peersec/pscrypto.h 2005-02-23 22:43:10.000000000 +0100 ++++ matrixssl/src/crypto/peersec/pscrypto.h 2005-03-06 01:32:33.000000000 +0100 +@@ -40,7 +40,7 @@ + PeerSec crypto-specific defines. + */ + #define SMALL_CODE +-#define CLEAN_STACK ++#undef CLEAN_STACK + /* + If Native 64 bit integers are not supported, we must set the 16 bit flag + to produce 32 bit mp_words in mpi.h +diff -urN matrixssl.old/src/crypto/peersec/sha1.c matrixssl/src/crypto/peersec/sha1.c +--- matrixssl.old/src/crypto/peersec/sha1.c 2005-02-23 22:43:10.000000000 +0100 ++++ matrixssl/src/crypto/peersec/sha1.c 2005-03-06 01:32:33.000000000 +0100 +@@ -273,7 +273,7 @@ + #ifdef CLEAN_STACK + psZeromem(md, sizeof(hash_state)); + #endif /* CLEAN_STACK */ +- return 20; ++ return SSL_SHA1_HASH_SIZE; + } + + #ifdef PEERSEC_TEST +diff -urN matrixssl.old/src/Makefile matrixssl/src/Makefile +--- matrixssl.old/src/Makefile 2005-02-23 22:43:10.000000000 +0100 ++++ matrixssl/src/Makefile 2005-03-06 01:39:06.000000000 +0100 +@@ -15,7 +15,14 @@ + E = + + LIBRARY = libmatrixssl$(SO) +-STATIC = libmatrixsslstatic$(A) ++ ++SOVERSION_MAJ := 1 ++SOVERSION_MIN := 2 ++SOVERSION_REV := 4 ++SONAME := $(LIBRARY).$(SOVERSION_MAJ) ++SOREAL := $(LIBRARY).$(SOVERSION_MAJ).$(SOVERSION_MIN).$(SOVERSION_REV) ++ +++STATIC = libmatrixsslstatic$(A) + + OBJECTS = \ + cipherSuite$(O) \ +@@ -24,6 +31,7 @@ + sslEncode$(O) \ + sslv3$(O) \ + os/linux/linux$(O) \ ++ crypto/peersec/aes$(O) \ + crypto/peersec/arc4$(O) \ + crypto/peersec/asn1$(O) \ + crypto/peersec/base64$(O) \ +@@ -66,7 +74,7 @@ + # + SHARED = -shared + CFLAGS = $(DFLAGS) -DLINUX -I./ -Icrypto/peersec +-LDFLAGS = -lc -lpthread -lcrypto ++LDFLAGS = -lc -lpthread -Wl,-soname,$(SONAME) + + # + # Override variables for compilation on Mac OS X (Darwin) +@@ -105,8 +113,9 @@ + # Build the library + # + $(LIBRARY): $(OBJECTS) +- $(CC) $(SHARED) -o $@ $^ $(LDFLAGS) +- $(STRIP) $(LIBRARY) ++ $(CC) $(SHARED) -o $(SOREAL) $^ $(LDFLAGS) ++ ln -sf $(SOREAL) $(SONAME) ++ ln -sf $(SONAME) $(LIBRARY) + + # + # Build the static library +@@ -119,4 +128,4 @@ + # Clean up all generated files + # + clean: +- rm -f $(LIBRARY) $(OBJECTS) $(STATIC) ++ rm -f $(LIBRARY) $(OBJECTS) $(SONAME) $(SOREAL) +diff -urN matrixssl.old/src/matrixSsl.c matrixssl/src/matrixSsl.c +--- matrixssl.old/src/matrixSsl.c 2005-02-23 22:43:10.000000000 +0100 ++++ matrixssl/src/matrixSsl.c 2005-03-06 01:37:41.000000000 +0100 +@@ -950,6 +950,49 @@ + sslAssert(ssl->hsPool == NULL); + } + ++ ++/******************************************************************************/ ++/* ++ Compute an MD5 digest ++*/ ++unsigned char *matrixMd5Digest( ++ const unsigned char *buf, unsigned long len, unsigned char *hash) ++{ ++ sslMd5Context_t ctx; ++ static unsigned char hashBuf[SSL_MD5_HASH_SIZE]; ++ ++ if (hash == NULL) { ++ hash = hashBuf; ++ } ++ ++ matrixMd5Init(&ctx); ++ matrixMd5Update(&ctx, buf, len); ++ matrixMd5Final(&ctx, hash); ++ ++ return hash; ++} ++ ++/******************************************************************************/ ++/* ++ Compute an SHA1 digest ++*/ ++unsigned char *matrixSha1Digest( ++ const unsigned char *buf, unsigned long len, unsigned char *hash) ++{ ++ sslSha1Context_t ctx; ++ static unsigned char hashBuf[SSL_SHA1_HASH_SIZE]; ++ ++ if (hash == NULL) { ++ hash = hashBuf; ++ } ++ ++ matrixSha1Init(&ctx); ++ matrixSha1Update(&ctx, buf, len); ++ matrixSha1Final(&ctx, hash); ++ ++ return hash; ++} ++ + /******************************************************************************/ + /* + Debugging APIs diff --git a/libs/matrixssl/patches/200-compile-fixes.patch b/libs/matrixssl/patches/200-compile-fixes.patch new file mode 100644 index 0000000..ab6a261 --- /dev/null +++ b/libs/matrixssl/patches/200-compile-fixes.patch @@ -0,0 +1,64 @@ +Index: matrixssl/src/os/linux/linux.c +=================================================================== +--- matrixssl.orig/src/os/linux/linux.c 2010-11-02 21:01:53.702000002 +0100 ++++ matrixssl/src/os/linux/linux.c 2010-11-02 21:02:37.657009753 +0100 +@@ -39,8 +39,12 @@ + + #include "../osLayer.h" + ++#ifndef CLK_TCK ++# define CLK_TCK CLOCKS_PER_SEC ++#endif ++ + #if defined(__i386__) || defined(RDTSC) +-#include ++//#include + /* + As defined in asm/timex.h for x386: + */ +@@ -51,7 +55,7 @@ + static sslTime_t hiresStart; /* zero-time */ + static sslTime_t hiresFreq; /* tics per second */ + #else /* __i386__ */ +-static unsigned int32 prevTicks; /* Check wrap */ ++static uint32 prevTicks; /* Check wrap */ + static sslTime_t elapsedTime; /* Last elapsed time */ + #endif + +Index: matrixssl/src/Makefile +=================================================================== +--- matrixssl.orig/src/Makefile 2010-11-02 21:02:42.312000001 +0100 ++++ matrixssl/src/Makefile 2010-11-02 21:04:21.979001189 +0100 +@@ -63,13 +63,6 @@ + endif + + # +-# Override variables for compilation on x86-64 (AMD64, Nacona, etc) +-# +-ifeq ($(shell uname -m),x86_64) +-DFLAGS += -march=k8 -fPIC -DFP_64BIT -DTFM_X86_64 -DRDTSC +-endif +- +-# + # Compile options + # + SHARED = -shared +@@ -77,18 +70,6 @@ + LDFLAGS = -lc -lpthread -Wl,-soname,$(SONAME) + + # +-# Override variables for compilation on Mac OS X (Darwin) +-# +-ifeq ($(shell uname),Darwin) +-CC = cc +-SO = .dylib +-SHARED = -dynamiclib +-CFLAGS += -DOSX -isystem -I/usr/include +-LDFLAGS = -flat_namespace -install_name @executable_path/../src/$(LIBRARY) +-STRIP = test +-endif +- +-# + # Override variables for compilation on uClinux (example only) + # + ifdef UCLINUX diff --git a/libs/mxml/Makefile b/libs/mxml/Makefile new file mode 100644 index 0000000..fdaa504 --- /dev/null +++ b/libs/mxml/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2010 Tobias Schneider +# Copyright (C) 2007 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mxml +PKG_VERSION:=2.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://ftp.easysw.com/pub/mxml/$(PKG_VERSION)/ +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/mxml + SECTION:=libs + CATEGORY:=Libraries + TITLE:=mini-xml + URL:=http://www.minixml.org/ +endef + +define Package/mxml/description + A small xml library. +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + ) +endef + +define Build/InstallDev + mkdir -p $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/mxml.h $(1)/usr/include/ + mkdir -p $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libmxml.so* $(1)/usr/lib/ + mkdir -p $(1)/usr/lib/pkgconfig + $(CP) $(PKG_BUILD_DIR)/mxml.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/mxml/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libmxml.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,mxml)) diff --git a/libs/mxml/patches/001-targets.patch b/libs/mxml/patches/001-targets.patch new file mode 100644 index 0000000..6d53249 --- /dev/null +++ b/libs/mxml/patches/001-targets.patch @@ -0,0 +1,12 @@ +diff -Nur mxml-2.6-orig/Makefile.in mxml-2.6/Makefile.in +--- mxml-2.6-orig/Makefile.in 2008-12-06 05:20:38.000000000 +0100 ++++ mxml-2.6/Makefile.in 2010-05-28 01:58:37.000000000 +0200 +@@ -88,7 +88,7 @@ + mxml-node.o mxml-search.o mxml-set.o + LIBOBJS = $(PUBLIBOBJS) mxml-private.o mxml-string.o + OBJS = mxmldoc.o testmxml.o $(LIBOBJS) +-TARGETS = $(LIBMXML) mxmldoc testmxml mxml.xml doc/mxml.man ++TARGETS = $(LIBMXML) + + + # diff --git a/libs/mysql/Makefile b/libs/mysql/Makefile new file mode 100644 index 0000000..06c2baf --- /dev/null +++ b/libs/mysql/Makefile @@ -0,0 +1,205 @@ +# +# Copyright (C) 2006-2012 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:=mysql +PKG_VERSION:=5.1.53 +PKG_RELEASE:=7 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=\ + http://mysql.planetmirror.com/Downloads/MySQL-5.1/ \ + http://mysql.he.net/Downloads/MySQL-5.1/ \ + http://www.linorg.usp.br/mysql/Downloads/MySQL-5.1/ \ + http://mysql.holywar.net/Downloads/MySQL-5.1/ +PKG_MD5SUM:=e5e7c5b0b5c382489e6a66778703bc46 + +PKG_BUILD_DEPENDS:=libncurses libreadline +PKG_BUILD_PARALLEL:=1 + +PKG_FIXUP:=libtool no-autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/libmysqlclient/Default + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+uclibcxx +zlib + TITLE:=MySQL client library + URL:=http://dev.mysql.com/ +endef + +define Package/mysql-server/Default + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libmysqlclient +libpthread +libncursesw +libreadline + TITLE:=MySQL Server + URL:=http://dev.mysql.com/ + SUBMENU:=database +endef + +define Package/mysql-server + $(call Package/mysql-server/Default) +endef + +define Package/libmysqlclient + $(call Package/libmysqlclient/Default) +endef + +define Package/libmysqlclient-r + $(call Package/libmysqlclient/Default) + TITLE += threadsafe + DEPENDS+= +libpthread +endef + +TARGET_CXX=g++-uc + +CONFIGURE_VARS += \ + CXXFLAGS="$$$$CXXFLAGS -fno-builtin -fno-rtti -nostdinc++" \ + CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/uClibc++" \ + LDFLAGS="$$$$LDFLAGS" \ + LIBS="-nodefaultlibs -luClibc++ -lm -lc $(LIBGCC_S)" \ + CLIENTCLIBS="-nodefaultlibs -luClibc++ -lm -lc $(LIBGCC_S)" \ + + +define Build/Configure + (cd $(PKG_BUILD_DIR); touch \ + configure.in \ + aclocal.m4 \ + Makefile.in \ + config.h.in \ + configure \ + ); + $(CP) files/lex_hash.h $(PKG_BUILD_DIR)/sql/lex_hash.h + + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + --enable-thread-safe-client \ + --disable-assembler \ + --with-pthread \ + --with-server \ + --without-mysqlmanager \ + --without-raid \ + --with-mysqld-user=root \ + --with-unix-socket-path=/tmp \ + --without-libwrap \ + --without-pstack \ + --with-low-memory \ + --without-embedded-server \ + --without-query-cache \ + --without-mysqlfs \ + --without-vio \ + --without-ssl \ + --without-docs \ + --without-man \ + --without-bench \ + --without-readline \ + --without-debug \ + --with-named-thread-libs=-lpthread \ + , \ + mysql_cv_compress=yes \ + mysql_cv_gethostname_style=glibc2 \ + ac_cv_c_stack_direction=-1 \ + ); +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \ + SUBDIRS="include" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + SUBDIRS="include" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install + +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)/libmysql" \ + CC="g++" \ + CFLAGS="$(HOST_CFLAGS)" \ + CPPFLAGS="$(HOST_CFLAGS)" \ + LDFLAGS="$(HOST_LDFLAGS)" \ + conf_to_src + +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \ + SUBDIRS="libmysql" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + SUBDIRS="libmysql" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install + +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \ + SUBDIRS="libmysql_r" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + SUBDIRS="libmysql_r" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + SUBDIRS="scripts" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + bin_SCRIPTS="mysql_config" \ + install + +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install +endef + + +define Build/InstallDev + $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin/ + ln -sf $(STAGING_DIR)/usr/bin/mysql_config $(2)/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include/ + # NOTE: needed for MySQL-Python + $(CP) $(PKG_BUILD_DIR)/include/mysqld_error.h $(1)/usr/include/mysql/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(1)/usr/lib/ + rm -f $(1)/usr/lib/mysql/libmysqlclient.la +endef + +define Package/libmysqlclient/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/ +endef +define Package/libmysqlclient-r/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient_r.so.* $(1)/usr/lib/ +endef + +define Package/mysql-server/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/mysqld $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/myisamchk $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqladmin $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqldump $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_install_db $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/my_print_defaults $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) files/mysqld.init $(1)/etc/init.d/mysqld + $(INSTALL_CONF) conf/my.cnf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/share/mysql + $(INSTALL_DIR) $(1)/usr/share/mysql/english + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/english/errmsg.sys $(1)/usr/share/mysql/english + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/fill_help_tables.sql $(1)/usr/share/mysql/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/mysql_system_tables.sql $(1)/usr/share/mysql/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/mysql_system_tables_data.sql $(1)/usr/share/mysql/ +endef + +define Package/mysql-server/conffiles +/etc/my.cnf +endef + +$(eval $(call BuildPackage,mysql-server)) +$(eval $(call BuildPackage,libmysqlclient)) +$(eval $(call BuildPackage,libmysqlclient-r)) diff --git a/libs/mysql/conf/my.cnf b/libs/mysql/conf/my.cnf new file mode 100644 index 0000000..ec2ade2 --- /dev/null +++ b/libs/mysql/conf/my.cnf @@ -0,0 +1,54 @@ +[client] +port = 3306 +socket = /var/run/mysqld.sock + +[mysqld] +user = root +socket = /var/run/mysqld.sock +port = 3306 +basedir = /usr + +############ Don't put this on the NAND ############# +# Figure out where you are going to put the databases +# And run mysql_install_db --force +datadir = /mnt/data/mysql/ + +######### This should also not go on the NAND ####### +tmpdir = /mnt/data/tmp/ + +skip-external-locking + +bind-address = 127.0.0.1 + +# Fine Tuning +key_buffer = 16M +max_allowed_packet = 16M +thread_stack = 192K +thread_cache_size = 8 + +# Here you can see queries with especially long duration +#log_slow_queries = /var/log/mysql/mysql-slow.log +#long_query_time = 2 +#log-queries-not-using-indexes + +# The following can be used as easy to replay backup logs or for replication. +#server-id = 1 +#log_bin = /var/log/mysql/mysql-bin.log +#expire_logs_days = 10 +#max_binlog_size = 100M +#binlog_do_db = include_database_name +#binlog_ignore_db = include_database_name + + +[mysqldump] +quick +quote-names +max_allowed_packet = 16M + +[mysql] +#no-auto-rehash # faster start of mysql but no tab completition + +[isamchk] +key_buffer = 16M + + diff --git a/libs/mysql/files/lex_hash.h b/libs/mysql/files/lex_hash.h new file mode 100644 index 0000000..9425f93 --- /dev/null +++ b/libs/mysql/files/lex_hash.h @@ -0,0 +1,6190 @@ +/* + + Do not edit this file directly! + +*/ +/* Copyright 2001-2008 MySQL AB, 2008 Sun Microsystems, Inc. + + 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; version 2 of the License. + + 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; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston + MA 02110-1301 USA. */ + +/* Do not edit this file! This is generated by gen_lex_hash.cc +that seeks for a perfect hash function */ + +#include "lex.h" + +static uchar sql_functions_map[12604]= { +'<', '>', 29, 0, +'!', '|', 32, 0, +'<', 'X', 150, 0, +'B', 'Y', 43, 1, +'A', 'W', 208, 2, +'A', 'V', 61, 4, +'A', 'W', 156, 5, +'C', 'Z', 87, 7, +'A', 'V', 14, 9, +'A', 'Y', 188, 9, +'D', 'U', 136, 10, +'C', 'V', 202, 10, +'D', 'U', 72, 11, +'A', 'U', 104, 11, +'A', 'S', 173, 11, +'H', 'U', 231, 11, +'C', 'S', 245, 11, +'G', 'S', 26, 12, +'S', 'S', 39, 12, +'M', 'M', 61, 12, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 23, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 20, 1, +0, 0, 1, 0, +0, 0, 5, 0, +0, 0, 6, 0, +0, 0, 4, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 0, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'<', '>', 124, 0, +0, 0, 43, 2, +'=', '>', 127, 0, +0, 0, 43, 2, +0, 0, 43, 2, +'S', 'T', 129, 0, +0, 0, 47, 0, +0, 0, 43, 2, +0, 0, 127, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'F', 'S', 131, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 61, 1, +'N', 'R', 145, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 241, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 38, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 42, 2, +0, 0, 8, 0, +0, 0, 2, 0, +0, 0, 3, 0, +0, 0, 7, 0, +0, 0, 9, 0, +0, 0, 23, 0, +0, 0, 27, 0, +0, 0, 197, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 200, 0, +0, 0, 222, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 225, 0, +0, 0, 72, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 80, 1, +0, 0, 10, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'D', 'V', 179, 0, +0, 0, 40, 0, +0, 0, 87, 0, +'A', 'I', 220, 0, +0, 0, 139, 0, +0, 0, 169, 0, +0, 0, 43, 2, +0, 0, 43, 2, +'N', 'P', 229, 0, +0, 0, 43, 2, +0, 0, 231, 0, +0, 0, 43, 2, +'A', 'O', 232, 0, +'D', 'O', 2, 1, +'N', 'U', 18, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 154, 1, +'E', 'U', 26, 1, +0, 0, 43, 2, +0, 0, 10, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 37, 2, +0, 0, 13, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 17, 0, +0, 0, 43, 2, +'D', 'Y', 198, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 24, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 31, 0, +0, 0, 21, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 22, 0, +0, 0, 102, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 108, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 126, 0, +0, 0, 213, 0, +0, 0, 43, 2, +0, 0, 224, 0, +0, 0, 243, 255, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'D', 'N', 247, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 1, +0, 0, 242, 255, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 241, 255, +0, 0, 56, 1, +0, 0, 59, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'T', 'W', 14, 1, +0, 0, 65, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 240, 255, +0, 0, 73, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 82, 1, +0, 0, 172, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 188, 1, +0, 0, 43, 2, +0, 0, 208, 1, +0, 0, 237, 255, +0, 0, 230, 255, +'L', 'Y', 67, 1, +'A', 'U', 87, 1, +'A', 'U', 132, 1, +'A', 'X', 159, 1, +'A', 'U', 201, 1, +0, 0, 43, 2, +'A', 'O', 222, 1, +'N', 'N', 240, 1, +0, 0, 230, 0, +'E', 'I', 17, 2, +'A', 'O', 22, 2, +0, 0, 44, 1, +'A', 'U', 75, 2, +0, 0, 75, 1, +'A', 'R', 96, 2, +0, 0, 43, 2, +'E', 'O', 114, 2, +'H', 'T', 135, 2, +'E', 'Y', 148, 2, +'N', 'S', 187, 2, +0, 0, 31, 2, +'A', 'O', 193, 2, +0, 0, 36, 2, +0, 0, 39, 2, +0, 0, 41, 0, +0, 0, 43, 2, +0, 0, 43, 2, +'O', 'T', 81, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 48, 0, +0, 0, 43, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 45, 0, +'L', 'S', 108, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 57, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 66, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 90, 0, +0, 0, 50, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'T', 116, 1, +0, 0, 53, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 251, 255, +'T', 'T', 153, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 116, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 123, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 129, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 130, 0, +'A', 'E', 154, 1, +0, 0, 96, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 100, 0, +0, 0, 134, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 135, 0, +0, 0, 43, 2, +'D', 'U', 183, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 152, 0, +0, 0, 140, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 143, 0, +0, 0, 158, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 162, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 174, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 175, 0, +0, 0, 186, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 188, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'S', 'U', 237, 1, +0, 0, 190, 0, +0, 0, 43, 2, +0, 0, 192, 0, +'T', 'T', 241, 1, +'1', 'O', 242, 1, +0, 0, 214, 0, +0, 0, 215, 0, +0, 0, 216, 0, +0, 0, 217, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 218, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 221, 0, +0, 0, 232, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 234, 0, +0, 0, 236, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'F', 'S', 37, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'K', 'S', 51, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'O', 60, 2, +0, 0, 240, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 241, 0, +0, 0, 243, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 248, 0, +0, 0, 249, 0, +0, 0, 43, 2, +0, 0, 253, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 0, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 1, 1, +0, 0, 4, 1, +0, 0, 52, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 60, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 64, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 67, 1, +0, 0, 88, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 99, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 103, 1, +'A', 'A', 125, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 155, 1, +'D', 'L', 126, 2, +0, 0, 116, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 120, 1, +0, 0, 174, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 182, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 213, 1, +0, 0, 231, 1, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'E', 169, 2, +0, 0, 234, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'I', 'U', 174, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 248, 1, +0, 0, 232, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 233, 1, +0, 0, 227, 255, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 246, 1, +0, 0, 254, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 11, 2, +0, 0, 25, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 27, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 28, 2, +0, 0, 32, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 33, 2, +'F', 'S', 231, 2, +'E', 'T', 245, 2, +'A', 'R', 5, 3, +0, 0, 43, 2, +'V', 'V', 28, 3, +'A', 'O', 35, 3, +'R', 'R', 68, 3, +0, 0, 191, 0, +'N', 'N', 84, 3, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'O', 97, 3, +'A', 'U', 144, 3, +'A', 'C', 165, 3, +'R', 'W', 168, 3, +'H', 'U', 174, 3, +'U', 'U', 188, 3, +'A', 'T', 194, 3, +'H', 'W', 233, 3, +'A', 'Y', 249, 3, +'N', 'S', 18, 4, +0, 0, 18, 2, +'H', 'R', 45, 4, +0, 0, 14, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 19, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 25, 0, +0, 0, 35, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 42, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 46, 0, +0, 0, 49, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'E', 23, 3, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 64, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 250, 255, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 89, 0, +0, 0, 54, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 60, 0, +'E', 'E', 29, 3, +'N', 'R', 30, 3, +0, 0, 147, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 149, 0, +0, 0, 157, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 160, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'R', 'X', 50, 3, +0, 0, 43, 2, +0, 0, 43, 2, +'O', 'U', 57, 3, +0, 0, 43, 2, +0, 0, 43, 2, +'R', 'U', 64, 3, +0, 0, 163, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 164, 0, +0, 0, 165, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 168, 0, +0, 0, 170, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 172, 0, +'A', 'O', 69, 3, +0, 0, 182, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 184, 0, +'D', 'O', 85, 3, +0, 0, 201, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 205, 0, +0, 0, 208, 0, +'A', 'V', 108, 3, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'M', 'N', 130, 3, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'C', 'C', 132, 3, +0, 0, 238, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 242, 0, +0, 0, 244, 0, +0, 0, 246, 0, +'A', 'K', 133, 3, +0, 0, 250, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 254, 0, +0, 0, 22, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 35, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 47, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 51, 1, +0, 0, 53, 1, +0, 0, 43, 2, +0, 0, 58, 1, +0, 0, 81, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 83, 1, +0, 0, 43, 2, +0, 0, 85, 1, +0, 0, 94, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 97, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 111, 1, +'E', 'I', 189, 3, +0, 0, 113, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 114, 1, +0, 0, 115, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'S', 214, 3, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 149, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 150, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 157, 1, +0, 0, 119, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 142, 1, +0, 0, 173, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 178, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 209, 1, +0, 0, 220, 1, +0, 0, 43, 2, +0, 0, 222, 1, +0, 0, 224, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 249, 1, +'I', 'T', 24, 4, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'I', 36, 4, +0, 0, 0, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 6, 2, +0, 0, 9, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 14, 2, +'E', 'I', 56, 4, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 35, 2, +0, 0, 29, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 30, 2, +0, 0, 12, 0, +'A', 'I', 83, 4, +'H', 'U', 118, 4, +'E', 'O', 134, 4, +'L', 'X', 145, 4, +'A', 'L', 165, 4, +'L', 'R', 185, 4, +0, 0, 187, 0, +'G', 'S', 192, 4, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'I', 219, 4, +'A', 'O', 224, 4, +0, 0, 43, 2, +'F', 'P', 249, 4, +'A', 'L', 4, 5, +0, 0, 43, 2, +'E', 'O', 16, 5, +'C', 'U', 48, 5, +0, 0, 225, 1, +'N', 'P', 149, 5, +0, 0, 19, 2, +0, 0, 33, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 34, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'G', 'T', 92, 4, +0, 0, 37, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'L', 106, 4, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 253, 255, +0, 0, 38, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 39, 0, +0, 0, 55, 0, +0, 0, 62, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 63, 0, +0, 0, 43, 2, +0, 0, 43, 2, +'L', 'M', 132, 4, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 88, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 95, 0, +0, 0, 69, 0, +0, 0, 72, 0, +0, 0, 115, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 128, 0, +0, 0, 136, 0, +0, 0, 43, 2, +'A', 'G', 158, 4, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 144, 0, +0, 0, 145, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 148, 0, +0, 0, 43, 2, +0, 0, 151, 0, +0, 0, 137, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 141, 0, +0, 0, 159, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 161, 0, +0, 0, 43, 2, +0, 0, 43, 2, +'O', 'O', 177, 4, +'A', 'A', 178, 4, +'T', 'T', 179, 4, +'4', '8', 180, 4, +0, 0, 166, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 167, 0, +0, 0, 181, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 183, 0, +0, 0, 198, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 199, 0, +'F', 'S', 205, 4, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 227, 0, +0, 0, 203, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 207, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 210, 0, +0, 0, 239, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 245, 0, +0, 0, 6, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'D', 'M', 239, 4, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 39, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 46, 1, +0, 0, 30, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 34, 1, +0, 0, 70, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 78, 1, +0, 0, 87, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 95, 1, +'G', 'V', 27, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 152, 1, +0, 0, 127, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 132, 1, +0, 0, 133, 1, +0, 0, 134, 1, +0, 0, 43, 2, +'A', 'E', 43, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 145, 1, +0, 0, 146, 1, +0, 0, 43, 2, +0, 0, 148, 1, +0, 0, 136, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 140, 1, +0, 0, 160, 1, +0, 0, 43, 2, +'C', 'R', 67, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'G', 'M', 97, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'C', 'U', 104, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'R', 128, 5, +0, 0, 232, 255, +0, 0, 162, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 165, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'I', 'V', 83, 5, +0, 0, 168, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 171, 1, +0, 0, 176, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 177, 1, +0, 0, 181, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 183, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'N', 'R', 123, 5, +0, 0, 184, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 185, 1, +'R', 'T', 146, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 236, 255, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 216, 1, +0, 0, 211, 1, +0, 0, 43, 2, +0, 0, 212, 1, +'I', 'L', 152, 5, +0, 0, 43, 2, +0, 0, 7, 2, +0, 0, 1, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 3, 2, +'D', 'U', 179, 5, +'E', 'O', 197, 5, +'A', 'U', 234, 5, +'E', 'Y', 43, 6, +'N', 'X', 91, 6, +0, 0, 171, 0, +0, 0, 43, 2, +0, 0, 185, 0, +'N', 'T', 118, 6, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'O', 144, 6, +0, 0, 38, 1, +'A', 'U', 155, 6, +'P', 'U', 176, 6, +'A', 'R', 182, 6, +0, 0, 112, 1, +'E', 'O', 215, 6, +'C', 'Y', 245, 6, +'I', 'R', 37, 7, +'N', 'S', 47, 7, +'A', 'A', 56, 7, +0, 0, 34, 2, +0, 0, 255, 255, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 15, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 20, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 28, 0, +0, 0, 36, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'T', 'T', 208, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 44, 0, +'_', '_', 209, 5, +'A', 'X', 210, 5, +0, 0, 254, 255, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 252, 255, +0, 0, 51, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'A', 255, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'L', 'N', 5, 6, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'R', 'R', 25, 6, +'N', 'R', 0, 6, +0, 0, 56, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 59, 0, +'L', 'U', 8, 6, +'M', 'P', 18, 6, +'T', 'V', 22, 6, +0, 0, 67, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 70, 0, +0, 0, 71, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 74, 0, +0, 0, 83, 0, +0, 0, 43, 2, +0, 0, 86, 0, +'D', 'T', 26, 6, +0, 0, 249, 255, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 248, 255, +'C', 'L', 64, 6, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'S', 'S', 87, 6, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 133, 0, +'I', 'L', 74, 6, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'I', 78, 6, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 113, 0, +0, 0, 109, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 110, 0, +0, 0, 111, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 112, 0, +'A', 'C', 88, 6, +0, 0, 121, 0, +0, 0, 43, 2, +0, 0, 122, 0, +0, 0, 142, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 146, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'T', 102, 6, +0, 0, 150, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 154, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 245, 255, +'D', 'V', 125, 6, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 228, 0, +0, 0, 202, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 212, 0, +0, 0, 219, 0, +0, 0, 43, 2, +0, 0, 229, 0, +0, 0, 237, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 255, 0, +0, 0, 55, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 62, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 68, 1, +0, 0, 77, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 84, 1, +0, 0, 89, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 96, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 98, 1, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'O', 200, 6, +0, 0, 101, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 104, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'C', 'F', 211, 6, +0, 0, 107, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 109, 1, +'B', 'T', 226, 6, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 153, 1, +0, 0, 121, 1, +0, 0, 122, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 131, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 138, 1, +0, 0, 141, 1, +0, 0, 43, 2, +0, 0, 143, 1, +0, 0, 147, 1, +0, 0, 161, 1, +0, 0, 43, 2, +0, 0, 170, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 186, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 214, 1, +'B', 'S', 12, 7, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 229, 255, +'D', 'J', 30, 7, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 221, 1, +0, 0, 233, 255, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 217, 1, +0, 0, 239, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 244, 1, +'I', 'K', 53, 7, +0, 0, 43, 2, +0, 0, 8, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 13, 2, +0, 0, 255, 1, +0, 0, 43, 2, +0, 0, 2, 2, +'R', 'R', 57, 7, +'C', '_', 58, 7, +0, 0, 21, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 24, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 225, 255, +'A', 'O', 111, 7, +'A', 'U', 150, 7, +'N', 'X', 218, 7, +'U', 'U', 229, 7, +0, 0, 178, 0, +0, 0, 43, 2, +'N', 'N', 233, 7, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'O', 241, 7, +'A', 'O', 21, 8, +'A', 'V', 49, 8, +'N', 'P', 71, 8, +'A', 'R', 74, 8, +0, 0, 43, 2, +'E', 'O', 103, 8, +'C', 'W', 130, 8, +'I', 'R', 151, 8, +'N', 'T', 203, 8, +'A', 'A', 245, 8, +0, 0, 26, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 41, 2, +0, 0, 52, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 61, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'N', 126, 7, +0, 0, 65, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'T', 'T', 140, 7, +'A', 'I', 141, 7, +0, 0, 82, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 84, 0, +'T', 'Y', 171, 7, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 117, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 124, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 131, 0, +'A', 'E', 177, 7, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 103, 0, +'B', 'F', 182, 7, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'T', '_', 187, 7, +0, 0, 97, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 99, 0, +0, 0, 101, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'S', 199, 7, +0, 0, 247, 255, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 246, 255, +0, 0, 138, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 155, 0, +'L', 'N', 230, 7, +0, 0, 176, 0, +0, 0, 43, 2, +0, 0, 177, 0, +'N', 'T', 234, 7, +0, 0, 206, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 220, 0, +0, 0, 235, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'N', 'N', 0, 8, +'G', 'G', 1, 8, +'B', 'T', 2, 8, +0, 0, 2, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 3, 1, +'X', 'X', 36, 8, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 42, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 45, 1, +'V', '_', 37, 8, +0, 0, 29, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'R', 'S', 47, 8, +0, 0, 25, 1, +0, 0, 26, 1, +0, 0, 54, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 69, 1, +0, 0, 74, 1, +0, 0, 43, 2, +0, 0, 76, 1, +0, 0, 93, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 239, 255, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'O', 92, 8, +0, 0, 102, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 110, 1, +'D', 'S', 114, 8, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 151, 1, +0, 0, 124, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 144, 1, +0, 0, 159, 1, +0, 0, 43, 2, +0, 0, 164, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 175, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 180, 1, +0, 0, 179, 1, +0, 0, 43, 2, +0, 0, 187, 1, +0, 0, 190, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 210, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 223, 1, +'N', 'N', 161, 8, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'U', 182, 8, +'Y', 'Y', 162, 8, +'B', 'T', 163, 8, +0, 0, 238, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 240, 1, +0, 0, 242, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 245, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 247, 1, +'D', 'S', 210, 8, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'C', 'C', 226, 8, +0, 0, 253, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 5, 2, +'_', '_', 227, 8, +'D', 'T', 228, 8, +0, 0, 15, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 16, 2, +'R', 'R', 246, 8, +'I', '_', 247, 8, +0, 0, 226, 255, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 224, 255, +'G', 'L', 36, 9, +0, 0, 43, 2, +'H', 'O', 42, 9, +'A', 'U', 53, 9, +0, 0, 153, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'O', 'S', 74, 9, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 251, 0, +'E', 'I', 79, 9, +0, 0, 63, 1, +0, 0, 43, 2, +'A', 'R', 84, 9, +0, 0, 43, 2, +'E', 'E', 129, 9, +'A', 'U', 134, 9, +'E', 'I', 158, 9, +'N', 'N', 171, 9, +'A', 'A', 178, 9, +0, 0, 16, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 18, 0, +0, 0, 58, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'L', 'N', 50, 9, +0, 0, 68, 0, +0, 0, 73, 0, +0, 0, 78, 0, +0, 0, 98, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 120, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 132, 0, +0, 0, 223, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 226, 0, +0, 0, 32, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 37, 1, +'C', 'R', 102, 9, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'O', 118, 9, +0, 0, 86, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 90, 1, +0, 0, 100, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 106, 1, +'A', 'D', 130, 9, +0, 0, 117, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 125, 1, +0, 0, 158, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'N', 'P', 155, 9, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 194, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 231, 255, +0, 0, 166, 1, +0, 0, 43, 2, +0, 0, 167, 1, +'M', 'M', 163, 9, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 235, 1, +'P', 'P', 164, 9, +'O', 'T', 165, 9, +0, 0, 228, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 229, 1, +'D', 'I', 172, 9, +0, 0, 251, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 4, 2, +'R', 'R', 179, 9, +'B', 'I', 180, 9, +0, 0, 20, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 23, 2, +'C', 'S', 213, 9, +0, 0, 43, 2, +'O', 'O', 230, 9, +'A', 'E', 14, 10, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 180, 0, +0, 0, 43, 2, +0, 0, 196, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 247, 0, +'A', 'U', 28, 10, +0, 0, 57, 1, +0, 0, 79, 1, +'A', 'R', 72, 10, +0, 0, 43, 2, +'E', 'O', 90, 10, +'Q', 'T', 117, 10, +'A', 'E', 131, 10, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 40, 2, +0, 0, 11, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 26, 0, +'M', 'N', 231, 9, +'P', 'P', 233, 9, +'C', 'S', 241, 9, +'L', 'R', 234, 9, +0, 0, 75, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 76, 0, +0, 0, 77, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 79, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'I', 'T', 2, 10, +0, 0, 80, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 81, 0, +'Y', 'Y', 19, 10, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 107, 0, +'_', '_', 20, 10, +'M', 'S', 21, 10, +0, 0, 105, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 106, 0, +0, 0, 14, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'D', 'D', 49, 10, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 49, 1, +'I', 'I', 50, 10, +'U', 'U', 51, 10, +'M', 'M', 52, 10, +'B', 'T', 53, 10, +0, 0, 31, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 33, 1, +0, 0, 92, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 105, 1, +'A', 'P', 101, 10, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 156, 1, +0, 0, 118, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 126, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 135, 1, +0, 0, 137, 1, +'L', 'L', 121, 10, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 235, 255, +'W', '_', 122, 10, +0, 0, 191, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 198, 1, +0, 0, 226, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 230, 1, +0, 0, 125, 0, +0, 0, 156, 0, +0, 0, 173, 0, +0, 0, 43, 2, +'O', 'O', 154, 10, +0, 0, 209, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'I', 165, 10, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 108, 1, +0, 0, 43, 2, +0, 0, 139, 1, +'Q', 'Y', 193, 10, +0, 0, 243, 1, +0, 0, 250, 1, +'U', 'U', 155, 10, +'R', 'R', 156, 10, +'_', '_', 157, 10, +'M', 'S', 158, 10, +0, 0, 194, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 195, 0, +'S', 'S', 174, 10, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 36, 1, +'T', 'T', 175, 10, +'E', 'E', 176, 10, +'R', 'R', 177, 10, +'_', '_', 178, 10, +'H', 'U', 179, 10, +0, 0, 8, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 12, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 21, 1, +0, 0, 203, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 234, 255, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 228, 255, +'O', 'U', 222, 10, +0, 0, 118, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 244, 255, +0, 0, 43, 2, +0, 0, 204, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 5, 1, +0, 0, 50, 1, +0, 0, 43, 2, +0, 0, 71, 1, +0, 0, 91, 1, +0, 0, 43, 2, +0, 0, 130, 1, +'E', 'U', 253, 10, +0, 0, 236, 1, +0, 0, 43, 2, +0, 0, 22, 2, +0, 0, 85, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'R', 'R', 229, 10, +'R', 'R', 230, 10, +'E', 'E', 231, 10, +'N', 'N', 232, 10, +'T', 'T', 233, 10, +'_', '_', 234, 10, +'D', 'U', 235, 10, +0, 0, 91, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 92, 0, +0, 0, 94, 0, +'R', 'S', 14, 11, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'L', 'L', 16, 11, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 218, 1, +0, 0, 169, 1, +0, 0, 238, 255, +'E', '_', 17, 11, +0, 0, 189, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'N', 'T', 44, 11, +0, 0, 196, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'S', 'S', 51, 11, +'I', 'I', 52, 11, +'_', '_', 53, 11, +'H', 'Y', 54, 11, +0, 0, 202, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 204, 1, +0, 0, 43, 2, +0, 0, 207, 1, +0, 0, 119, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 189, 0, +0, 0, 211, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'I', 90, 11, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 129, 1, +'Q', 'U', 99, 11, +0, 0, 237, 1, +0, 0, 17, 2, +0, 0, 15, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 41, 1, +0, 0, 205, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 215, 1, +0, 0, 219, 1, +'U', 'V', 125, 11, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 233, 0, +0, 0, 252, 0, +'A', 'A', 127, 11, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 128, 1, +'Q', 'Q', 141, 11, +0, 0, 227, 1, +0, 0, 12, 2, +0, 0, 29, 0, +0, 0, 32, 0, +'S', 'S', 128, 11, +'T', 'T', 129, 11, +'E', 'E', 130, 11, +'R', 'R', 131, 11, +'_', '_', 132, 11, +'L', 'S', 133, 11, +0, 0, 10, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 19, 1, +'L', 'L', 142, 11, +'_', '_', 143, 11, +'B', 'T', 144, 11, +0, 0, 192, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'S', 'S', 163, 11, +'I', 'I', 164, 11, +'_', '_', 165, 11, +'M', 'S', 166, 11, +0, 0, 201, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 200, 1, +0, 0, 30, 0, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'E', 192, 11, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'U', 197, 11, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 206, 1, +0, 0, 104, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 114, 0, +'S', 'S', 218, 11, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 48, 1, +'T', 'T', 219, 11, +'E', 'E', 220, 11, +'R', 'R', 221, 11, +'_', '_', 222, 11, +'L', 'S', 223, 11, +0, 0, 9, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 11, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 17, 1, +0, 0, 193, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 13, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 123, 1, +0, 0, 197, 1, +0, 0, 43, 2, +0, 0, 252, 1, +0, 0, 93, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'A', 6, 12, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 193, 1, +'S', 'S', 7, 12, +'T', 'T', 8, 12, +'E', 'E', 9, 12, +'R', 'R', 10, 12, +'_', '_', 11, 12, +'S', 'S', 12, 12, +'S', 'S', 13, 12, +'L', 'L', 14, 12, +'_', '_', 15, 12, +'C', 'C', 16, 12, +'A', 'I', 17, 12, +0, 0, 16, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 18, 1, +0, 0, 179, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 40, 1, +0, 0, 66, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 163, 1, +'Q', 'Q', 40, 12, +'L', 'L', 41, 12, +'_', '_', 42, 12, +'C', 'T', 43, 12, +0, 0, 195, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 199, 1, +'A', 'A', 62, 12, +'S', 'X', 63, 12, +0, 0, 7, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'_', '_', 69, 12, +'Q', 'U', 70, 12, +0, 0, 24, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'P', 'S', 75, 12, +0, 0, 27, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 28, 1, +}; + +static uchar symbols_map[11740]= { +'<', '>', 29, 0, +'!', '|', 32, 0, +'<', 'X', 150, 0, +'B', 'Y', 11, 1, +'A', 'W', 147, 2, +'A', 'V', 0, 4, +'A', 'W', 88, 5, +'C', 'Z', 201, 6, +'A', 'V', 72, 8, +'A', 'Y', 242, 8, +'D', 'U', 187, 9, +'C', 'V', 244, 9, +'D', 'U', 112, 10, +'A', 'U', 144, 10, +'A', 'S', 213, 10, +'H', 'U', 15, 11, +'C', 'S', 29, 11, +'G', 'S', 66, 11, +'S', 'S', 79, 11, +'M', 'M', 101, 11, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 23, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 20, 1, +0, 0, 1, 0, +0, 0, 5, 0, +0, 0, 6, 0, +0, 0, 4, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 0, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'<', '>', 124, 0, +0, 0, 43, 2, +'=', '>', 127, 0, +0, 0, 43, 2, +0, 0, 43, 2, +'S', 'T', 129, 0, +0, 0, 47, 0, +0, 0, 43, 2, +0, 0, 127, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'F', 'S', 131, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 61, 1, +'N', 'R', 145, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 241, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 38, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 42, 2, +0, 0, 8, 0, +0, 0, 2, 0, +0, 0, 3, 0, +0, 0, 7, 0, +0, 0, 9, 0, +0, 0, 23, 0, +0, 0, 27, 0, +0, 0, 197, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 200, 0, +0, 0, 222, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 225, 0, +0, 0, 72, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 80, 1, +0, 0, 10, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'D', 'V', 179, 0, +0, 0, 40, 0, +0, 0, 87, 0, +'A', 'I', 220, 0, +0, 0, 139, 0, +0, 0, 169, 0, +0, 0, 43, 2, +0, 0, 43, 2, +'N', 'P', 229, 0, +0, 0, 43, 2, +0, 0, 231, 0, +0, 0, 43, 2, +0, 0, 43, 1, +'D', 'O', 232, 0, +'N', 'U', 244, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 154, 1, +'E', 'S', 252, 0, +0, 0, 43, 2, +0, 0, 10, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 37, 2, +0, 0, 13, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 17, 0, +0, 0, 43, 2, +'D', 'Y', 198, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 24, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 31, 0, +0, 0, 21, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 22, 0, +0, 0, 102, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 108, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 126, 0, +0, 0, 213, 0, +0, 0, 43, 2, +0, 0, 224, 0, +0, 0, 56, 1, +0, 0, 59, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 65, 1, +0, 0, 73, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 82, 1, +0, 0, 172, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 188, 1, +0, 0, 43, 2, +0, 0, 208, 1, +'L', 'Y', 35, 1, +'A', 'U', 55, 1, +'A', 'U', 84, 1, +'A', 'X', 111, 1, +'A', 'U', 153, 1, +0, 0, 43, 2, +'A', 'O', 174, 1, +'N', 'N', 192, 1, +0, 0, 230, 0, +'E', 'I', 225, 1, +'A', 'O', 230, 1, +0, 0, 44, 1, +'A', 'U', 27, 2, +0, 0, 75, 1, +'A', 'R', 48, 2, +0, 0, 43, 2, +'E', 'O', 66, 2, +'H', 'T', 87, 2, +'E', 'Y', 100, 2, +'N', 'S', 126, 2, +0, 0, 31, 2, +'A', 'O', 132, 2, +0, 0, 36, 2, +0, 0, 39, 2, +0, 0, 41, 0, +0, 0, 43, 2, +0, 0, 43, 2, +'O', 'T', 49, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 48, 0, +0, 0, 43, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 45, 0, +'L', 'S', 76, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 57, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 66, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 90, 0, +0, 0, 50, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 53, 0, +'T', 'T', 105, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 116, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 123, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 129, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 130, 0, +'A', 'E', 106, 1, +0, 0, 96, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 100, 0, +0, 0, 134, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 135, 0, +0, 0, 43, 2, +'D', 'U', 135, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 152, 0, +0, 0, 140, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 143, 0, +0, 0, 158, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 162, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 174, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 175, 0, +0, 0, 186, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 188, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'S', 'U', 189, 1, +0, 0, 190, 0, +0, 0, 43, 2, +0, 0, 192, 0, +'T', 'T', 193, 1, +'1', 'O', 194, 1, +0, 0, 214, 0, +0, 0, 215, 0, +0, 0, 216, 0, +0, 0, 217, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 218, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 221, 0, +0, 0, 232, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 234, 0, +0, 0, 236, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'F', 'S', 245, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'K', 'S', 3, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'O', 12, 2, +0, 0, 240, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 241, 0, +0, 0, 243, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 248, 0, +0, 0, 249, 0, +0, 0, 43, 2, +0, 0, 253, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 0, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 1, 1, +0, 0, 4, 1, +0, 0, 52, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 60, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 64, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 67, 1, +0, 0, 88, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 99, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 103, 1, +'A', 'A', 77, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 155, 1, +'D', 'L', 78, 2, +0, 0, 116, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 120, 1, +0, 0, 174, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 182, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 213, 1, +0, 0, 231, 1, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'E', 121, 2, +0, 0, 234, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 246, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 248, 1, +0, 0, 232, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 233, 1, +0, 0, 254, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 11, 2, +0, 0, 25, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 27, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 28, 2, +0, 0, 32, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 33, 2, +'F', 'S', 170, 2, +'E', 'T', 184, 2, +'A', 'R', 200, 2, +0, 0, 43, 2, +'V', 'V', 223, 2, +'A', 'O', 230, 2, +'R', 'R', 7, 3, +0, 0, 191, 0, +'N', 'N', 23, 3, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'O', 36, 3, +'A', 'U', 83, 3, +'A', 'C', 104, 3, +'R', 'W', 107, 3, +'H', 'U', 113, 3, +'U', 'U', 127, 3, +'A', 'T', 133, 3, +'H', 'W', 172, 3, +'A', 'Y', 188, 3, +'N', 'S', 213, 3, +0, 0, 18, 2, +'H', 'R', 240, 3, +0, 0, 14, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 19, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 25, 0, +0, 0, 35, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 42, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 46, 0, +0, 0, 49, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'E', 218, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 64, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 89, 0, +0, 0, 54, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 60, 0, +'E', 'E', 224, 2, +'N', 'R', 225, 2, +0, 0, 147, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 149, 0, +0, 0, 157, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 160, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'R', 'X', 245, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'O', 'U', 252, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'R', 'U', 3, 3, +0, 0, 163, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 164, 0, +0, 0, 165, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 168, 0, +0, 0, 170, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 172, 0, +'A', 'O', 8, 3, +0, 0, 182, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 184, 0, +'D', 'O', 24, 3, +0, 0, 201, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 205, 0, +0, 0, 208, 0, +'A', 'V', 47, 3, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'M', 'N', 69, 3, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'C', 'C', 71, 3, +0, 0, 238, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 242, 0, +0, 0, 244, 0, +0, 0, 246, 0, +'A', 'K', 72, 3, +0, 0, 250, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 254, 0, +0, 0, 22, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 35, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 47, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 51, 1, +0, 0, 53, 1, +0, 0, 43, 2, +0, 0, 58, 1, +0, 0, 81, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 83, 1, +0, 0, 43, 2, +0, 0, 85, 1, +0, 0, 94, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 97, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 111, 1, +'E', 'I', 128, 3, +0, 0, 113, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 114, 1, +0, 0, 115, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'S', 153, 3, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 149, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 150, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 157, 1, +0, 0, 119, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 142, 1, +0, 0, 173, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 178, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 209, 1, +0, 0, 220, 1, +0, 0, 43, 2, +0, 0, 222, 1, +0, 0, 224, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 249, 1, +'I', 'T', 219, 3, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'I', 231, 3, +0, 0, 0, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 6, 2, +0, 0, 9, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 14, 2, +'E', 'I', 251, 3, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 35, 2, +0, 0, 29, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 30, 2, +0, 0, 12, 0, +'A', 'I', 22, 4, +'H', 'U', 51, 4, +'E', 'O', 67, 4, +'L', 'X', 78, 4, +'A', 'L', 98, 4, +'L', 'R', 118, 4, +0, 0, 187, 0, +'G', 'S', 125, 4, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'I', 152, 4, +'A', 'O', 157, 4, +0, 0, 43, 2, +'F', 'P', 182, 4, +'A', 'L', 193, 4, +0, 0, 43, 2, +'E', 'O', 205, 4, +'C', 'T', 237, 4, +0, 0, 225, 1, +'N', 'P', 81, 5, +0, 0, 19, 2, +0, 0, 33, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 34, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'G', 'N', 31, 4, +0, 0, 37, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'L', 39, 4, +0, 0, 38, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 39, 0, +0, 0, 55, 0, +0, 0, 62, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 63, 0, +0, 0, 43, 2, +0, 0, 43, 2, +'L', 'M', 65, 4, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 88, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 95, 0, +0, 0, 69, 0, +0, 0, 72, 0, +0, 0, 115, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 128, 0, +0, 0, 136, 0, +0, 0, 43, 2, +'A', 'G', 91, 4, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 144, 0, +0, 0, 145, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 148, 0, +0, 0, 43, 2, +0, 0, 151, 0, +0, 0, 137, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 141, 0, +0, 0, 159, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 161, 0, +0, 0, 43, 2, +0, 0, 43, 2, +'O', 'O', 110, 4, +'A', 'A', 111, 4, +'T', 'T', 112, 4, +'4', '8', 113, 4, +0, 0, 166, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 167, 0, +0, 0, 181, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 183, 0, +0, 0, 198, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 199, 0, +'F', 'S', 138, 4, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 227, 0, +0, 0, 203, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 207, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 210, 0, +0, 0, 239, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 245, 0, +0, 0, 6, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'D', 'M', 172, 4, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 39, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 46, 1, +0, 0, 30, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 34, 1, +0, 0, 70, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 78, 1, +0, 0, 87, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 95, 1, +'G', 'V', 216, 4, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 152, 1, +0, 0, 127, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 132, 1, +0, 0, 133, 1, +0, 0, 134, 1, +0, 0, 43, 2, +'A', 'E', 232, 4, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 145, 1, +0, 0, 146, 1, +0, 0, 43, 2, +0, 0, 148, 1, +0, 0, 136, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 140, 1, +0, 0, 160, 1, +0, 0, 43, 2, +'C', 'R', 255, 4, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'G', 'M', 29, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'C', 'U', 36, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'R', 60, 5, +0, 0, 162, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 165, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'I', 'V', 15, 5, +0, 0, 168, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 171, 1, +0, 0, 176, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 177, 1, +0, 0, 181, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 183, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'N', 'R', 55, 5, +0, 0, 184, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 185, 1, +'R', 'T', 78, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 216, 1, +0, 0, 211, 1, +0, 0, 43, 2, +0, 0, 212, 1, +'I', 'L', 84, 5, +0, 0, 43, 2, +0, 0, 7, 2, +0, 0, 1, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 3, 2, +'G', 'U', 111, 5, +'E', 'O', 126, 5, +'A', 'O', 137, 5, +'E', 'Y', 178, 5, +'N', 'X', 226, 5, +0, 0, 171, 0, +0, 0, 43, 2, +0, 0, 185, 0, +'N', 'T', 249, 5, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'O', 19, 6, +0, 0, 38, 1, +'A', 'U', 30, 6, +'P', 'U', 51, 6, +'A', 'R', 57, 6, +0, 0, 112, 1, +'E', 'O', 90, 6, +'C', 'U', 120, 6, +'I', 'R', 157, 6, +'N', 'S', 167, 6, +'A', 'A', 176, 6, +0, 0, 34, 2, +0, 0, 15, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 20, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 28, 0, +0, 0, 36, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 44, 0, +0, 0, 51, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'A', 152, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'L', 'N', 158, 5, +'N', 'R', 153, 5, +0, 0, 56, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 59, 0, +'L', 'U', 161, 5, +'M', 'P', 171, 5, +'T', 'V', 175, 5, +0, 0, 67, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 70, 0, +0, 0, 71, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 74, 0, +0, 0, 83, 0, +0, 0, 43, 2, +0, 0, 86, 0, +'C', 'L', 199, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'S', 'S', 222, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 133, 0, +'I', 'L', 209, 5, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'I', 213, 5, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 113, 0, +0, 0, 109, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 110, 0, +0, 0, 111, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 112, 0, +'A', 'C', 223, 5, +0, 0, 121, 0, +0, 0, 43, 2, +0, 0, 122, 0, +0, 0, 142, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 146, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'P', 237, 5, +0, 0, 150, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 154, 0, +'D', 'V', 0, 6, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 228, 0, +0, 0, 202, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 212, 0, +0, 0, 219, 0, +0, 0, 43, 2, +0, 0, 229, 0, +0, 0, 237, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 255, 0, +0, 0, 55, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 62, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 68, 1, +0, 0, 77, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 84, 1, +0, 0, 89, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 96, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 98, 1, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'O', 75, 6, +0, 0, 101, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 104, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'C', 'F', 86, 6, +0, 0, 107, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 109, 1, +'B', 'T', 101, 6, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 153, 1, +0, 0, 121, 1, +0, 0, 122, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 131, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 138, 1, +0, 0, 141, 1, +0, 0, 43, 2, +0, 0, 143, 1, +0, 0, 147, 1, +0, 0, 161, 1, +0, 0, 43, 2, +0, 0, 170, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 186, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 214, 1, +'B', 'S', 139, 6, +0, 0, 217, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 221, 1, +0, 0, 239, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 244, 1, +'I', 'K', 173, 6, +0, 0, 43, 2, +0, 0, 8, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 13, 2, +0, 0, 255, 1, +0, 0, 43, 2, +0, 0, 2, 2, +'R', 'R', 177, 6, +'C', 'Y', 178, 6, +0, 0, 21, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 24, 2, +'A', 'O', 225, 6, +'A', 'U', 8, 7, +'N', 'X', 45, 7, +'U', 'U', 56, 7, +0, 0, 178, 0, +0, 0, 43, 2, +'N', 'N', 60, 7, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'O', 68, 7, +'A', 'O', 104, 7, +'A', 'V', 132, 7, +'N', 'P', 154, 7, +'A', 'R', 157, 7, +0, 0, 43, 2, +'E', 'O', 186, 7, +'C', 'W', 213, 7, +'I', 'R', 234, 7, +'N', 'T', 30, 8, +0, 0, 43, 2, +0, 0, 26, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 41, 2, +0, 0, 52, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 61, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'N', 240, 6, +0, 0, 65, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'T', 'T', 254, 6, +'A', 'I', 255, 6, +0, 0, 82, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 84, 0, +'T', 'Y', 29, 7, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 117, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 124, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 131, 0, +'A', 'E', 35, 7, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 103, 0, +'B', 'F', 40, 7, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 101, 0, +0, 0, 97, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 99, 0, +0, 0, 138, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 155, 0, +'L', 'N', 57, 7, +0, 0, 176, 0, +0, 0, 43, 2, +0, 0, 177, 0, +'N', 'T', 61, 7, +0, 0, 206, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 220, 0, +0, 0, 235, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'N', 'N', 83, 7, +'G', 'G', 84, 7, +'B', 'T', 85, 7, +0, 0, 2, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 3, 1, +'X', 'X', 119, 7, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 42, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 45, 1, +'V', '_', 120, 7, +0, 0, 29, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'R', 'S', 130, 7, +0, 0, 25, 1, +0, 0, 26, 1, +0, 0, 54, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 69, 1, +0, 0, 74, 1, +0, 0, 43, 2, +0, 0, 76, 1, +0, 0, 93, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'O', 175, 7, +0, 0, 102, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 110, 1, +'D', 'S', 197, 7, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 151, 1, +0, 0, 124, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 144, 1, +0, 0, 159, 1, +0, 0, 43, 2, +0, 0, 164, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 175, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 180, 1, +0, 0, 179, 1, +0, 0, 43, 2, +0, 0, 187, 1, +0, 0, 190, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 210, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 223, 1, +'N', 'N', 244, 7, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'U', 9, 8, +'Y', 'Y', 245, 7, +'B', 'T', 246, 7, +0, 0, 238, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 240, 1, +0, 0, 242, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 245, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 247, 1, +'D', 'S', 37, 8, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'C', 'C', 53, 8, +0, 0, 253, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 5, 2, +'_', '_', 54, 8, +'D', 'T', 55, 8, +0, 0, 15, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 16, 2, +'G', 'L', 94, 8, +0, 0, 43, 2, +'H', 'O', 100, 8, +'A', 'U', 111, 8, +0, 0, 153, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'O', 'S', 132, 8, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 251, 0, +'E', 'I', 137, 8, +0, 0, 63, 1, +0, 0, 43, 2, +'A', 'R', 142, 8, +0, 0, 43, 2, +'E', 'E', 187, 8, +'A', 'Q', 192, 8, +'E', 'I', 212, 8, +'N', 'N', 225, 8, +'A', 'A', 232, 8, +0, 0, 16, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 18, 0, +0, 0, 58, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'L', 'N', 108, 8, +0, 0, 68, 0, +0, 0, 73, 0, +0, 0, 78, 0, +0, 0, 98, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 120, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 132, 0, +0, 0, 223, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 226, 0, +0, 0, 32, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 37, 1, +'C', 'R', 160, 8, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'E', 'O', 176, 8, +0, 0, 86, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 90, 1, +0, 0, 100, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 106, 1, +'A', 'D', 188, 8, +0, 0, 117, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 125, 1, +0, 0, 158, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'N', 'P', 209, 8, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 194, 1, +0, 0, 166, 1, +0, 0, 43, 2, +0, 0, 167, 1, +'M', 'M', 217, 8, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 235, 1, +'P', 'P', 218, 8, +'O', 'T', 219, 8, +0, 0, 228, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 229, 1, +'D', 'I', 226, 8, +0, 0, 251, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 4, 2, +'R', 'R', 233, 8, +'B', 'I', 234, 8, +0, 0, 20, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 23, 2, +'C', 'S', 11, 9, +0, 0, 43, 2, +'O', 'O', 28, 9, +'A', 'E', 68, 9, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 180, 0, +0, 0, 43, 2, +0, 0, 196, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 247, 0, +'A', 'U', 82, 9, +0, 0, 57, 1, +0, 0, 79, 1, +'A', 'R', 126, 9, +0, 0, 43, 2, +'E', 'O', 144, 9, +'Q', 'Q', 171, 9, +'A', 'E', 182, 9, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 40, 2, +0, 0, 11, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 26, 0, +'M', 'N', 29, 9, +'P', 'P', 31, 9, +'C', 'S', 39, 9, +'L', 'R', 32, 9, +0, 0, 75, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 76, 0, +0, 0, 77, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 79, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'I', 'T', 56, 9, +0, 0, 80, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 81, 0, +'Y', 'Y', 73, 9, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 107, 0, +'_', '_', 74, 9, +'M', 'S', 75, 9, +0, 0, 105, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 106, 0, +0, 0, 14, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'D', 'D', 103, 9, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 49, 1, +'I', 'I', 104, 9, +'U', 'U', 105, 9, +'M', 'M', 106, 9, +'B', 'T', 107, 9, +0, 0, 31, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 33, 1, +0, 0, 92, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 105, 1, +'A', 'P', 155, 9, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 156, 1, +0, 0, 118, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 126, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 135, 1, +0, 0, 137, 1, +'L', 'L', 172, 9, +'W', '_', 173, 9, +0, 0, 191, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 198, 1, +0, 0, 226, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 230, 1, +0, 0, 125, 0, +0, 0, 156, 0, +0, 0, 173, 0, +0, 0, 43, 2, +'O', 'O', 205, 9, +0, 0, 209, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'I', 216, 9, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 108, 1, +0, 0, 43, 2, +0, 0, 139, 1, +0, 0, 203, 1, +0, 0, 243, 1, +0, 0, 250, 1, +'U', 'U', 206, 9, +'R', 'R', 207, 9, +'_', '_', 208, 9, +'M', 'S', 209, 9, +0, 0, 194, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 195, 0, +'S', 'S', 225, 9, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 36, 1, +'T', 'T', 226, 9, +'E', 'E', 227, 9, +'R', 'R', 228, 9, +'_', '_', 229, 9, +'H', 'U', 230, 9, +0, 0, 8, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 12, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 21, 1, +'O', 'U', 8, 10, +0, 0, 118, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 204, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 5, 1, +0, 0, 50, 1, +0, 0, 43, 2, +0, 0, 71, 1, +0, 0, 91, 1, +0, 0, 43, 2, +0, 0, 130, 1, +'E', 'U', 39, 10, +0, 0, 236, 1, +0, 0, 43, 2, +0, 0, 22, 2, +0, 0, 85, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'R', 'R', 15, 10, +'R', 'R', 16, 10, +'E', 'E', 17, 10, +'N', 'N', 18, 10, +'T', 'T', 19, 10, +'_', '_', 20, 10, +'D', 'U', 21, 10, +0, 0, 91, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 92, 0, +0, 0, 94, 0, +0, 0, 169, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'L', 'L', 56, 10, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 218, 1, +'E', '_', 57, 10, +0, 0, 189, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'N', 'T', 84, 10, +0, 0, 196, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'S', 'S', 91, 10, +'I', 'I', 92, 10, +'_', '_', 93, 10, +'H', 'Y', 94, 10, +0, 0, 202, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 204, 1, +0, 0, 43, 2, +0, 0, 207, 1, +0, 0, 119, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 189, 0, +0, 0, 211, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'I', 130, 10, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 129, 1, +'Q', 'U', 139, 10, +0, 0, 237, 1, +0, 0, 17, 2, +0, 0, 15, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 41, 1, +0, 0, 205, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 215, 1, +0, 0, 219, 1, +'U', 'V', 165, 10, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 233, 0, +0, 0, 252, 0, +'A', 'A', 167, 10, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 128, 1, +'Q', 'Q', 181, 10, +0, 0, 227, 1, +0, 0, 12, 2, +0, 0, 29, 0, +0, 0, 32, 0, +'S', 'S', 168, 10, +'T', 'T', 169, 10, +'E', 'E', 170, 10, +'R', 'R', 171, 10, +'_', '_', 172, 10, +'L', 'S', 173, 10, +0, 0, 10, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 19, 1, +'L', 'L', 182, 10, +'_', '_', 183, 10, +'B', 'T', 184, 10, +0, 0, 192, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'S', 'S', 203, 10, +'I', 'I', 204, 10, +'_', '_', 205, 10, +'M', 'S', 206, 10, +0, 0, 201, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 200, 1, +0, 0, 30, 0, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'E', 232, 10, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'U', 237, 10, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 206, 1, +0, 0, 104, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 114, 0, +'S', 'S', 2, 11, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 48, 1, +'T', 'T', 3, 11, +'E', 'E', 4, 11, +'R', 'R', 5, 11, +'_', '_', 6, 11, +'L', 'S', 7, 11, +0, 0, 9, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 11, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 17, 1, +0, 0, 193, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 13, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 123, 1, +0, 0, 197, 1, +0, 0, 43, 2, +0, 0, 252, 1, +0, 0, 93, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'A', 'A', 46, 11, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 193, 1, +'S', 'S', 47, 11, +'T', 'T', 48, 11, +'E', 'E', 49, 11, +'R', 'R', 50, 11, +'_', '_', 51, 11, +'S', 'S', 52, 11, +'S', 'S', 53, 11, +'L', 'L', 54, 11, +'_', '_', 55, 11, +'C', 'C', 56, 11, +'A', 'I', 57, 11, +0, 0, 16, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 18, 1, +0, 0, 179, 0, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 40, 1, +0, 0, 66, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 163, 1, +'Q', 'Q', 80, 11, +'L', 'L', 81, 11, +'_', '_', 82, 11, +'C', 'T', 83, 11, +0, 0, 195, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 199, 1, +'A', 'A', 102, 11, +'S', 'X', 103, 11, +0, 0, 7, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'_', '_', 109, 11, +'Q', 'U', 110, 11, +0, 0, 24, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 43, 2, +'P', 'S', 115, 11, +0, 0, 27, 1, +0, 0, 43, 2, +0, 0, 43, 2, +0, 0, 28, 1, +}; + +static unsigned int sql_functions_max_len=29; + +static unsigned int symbols_max_len=29; + +static SYMBOL *get_hash_symbol(const char *s, + unsigned int len,bool function) +{ + register uchar *hash_map; + register const char *cur_str= s; + + if (len == 0) { + DBUG_PRINT("warning", ("get_hash_symbol() received a request for a zero-length symbol, which is probably a mistake.")); return(NULL); + } + if (function){ + if (len>sql_functions_max_len) return 0; + hash_map= sql_functions_map; + register uint32 cur_struct= uint4korr(hash_map+((len-1)*4)); + + for (;;){ + register uchar first_char= (uchar)cur_struct; + + if (first_char == 0) + { + register int16 ires= (int16)(cur_struct>>16); + if (ires==array_elements(symbols)) return 0; + register SYMBOL *res; + if (ires>=0) + res= symbols+ires; + else + res= sql_functions-ires-1; + register uint count= (uint) (cur_str - s); + return lex_casecmp(cur_str,res->name+count,len-count) ? 0 : res; + } + + register uchar cur_char= (uchar)to_upper_lex[(uchar)*cur_str]; + if (cur_char>=8; + if (cur_char>(uchar)cur_struct) return 0; + + cur_struct>>=8; + cur_struct= uint4korr(hash_map+ + (((uint16)cur_struct + cur_char - first_char)*4)); + cur_str++; + } + }else{ + if (len>symbols_max_len) return 0; + hash_map= symbols_map; + register uint32 cur_struct= uint4korr(hash_map+((len-1)*4)); + + for (;;){ + register uchar first_char= (uchar)cur_struct; + + if (first_char==0){ + register int16 ires= (int16)(cur_struct>>16); + if (ires==array_elements(symbols)) return 0; + register SYMBOL *res= symbols+ires; + register uint count= (uint) (cur_str - s); + return lex_casecmp(cur_str,res->name+count,len-count)!=0 ? 0 : res; + } + + register uchar cur_char= (uchar)to_upper_lex[(uchar)*cur_str]; + if (cur_char>=8; + if (cur_char>(uchar)cur_struct) return 0; + + cur_struct>>=8; + cur_struct= uint4korr(hash_map+ + (((uint16)cur_struct + cur_char - first_char)*4)); + cur_str++; + } + } +} diff --git a/libs/mysql/files/mysqld.init b/libs/mysql/files/mysqld.init new file mode 100644 index 0000000..48e6189 --- /dev/null +++ b/libs/mysql/files/mysqld.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org + +START=95 +STOP=10 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 +SERVICE_STOP_TIME=9 + +error() { + echo "${initscript}:" "$@" 1>&2 +} + +start() { + local datadir=$(sed -n -e "s/^[[:space:]]*datadir[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" /etc/my.cnf) + if [ ! -d "$datadir" ]; then + error "Error: datadir '$datadir' in /etc/my.cnf doesn't 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" + return 1 + fi + service_start /usr/bin/mysqld +} + +stop() { + service_stop /usr/bin/mysqld +} diff --git a/libs/mysql/patches/500-cross_compile.patch b/libs/mysql/patches/500-cross_compile.patch new file mode 100644 index 0000000..adbf266 --- /dev/null +++ b/libs/mysql/patches/500-cross_compile.patch @@ -0,0 +1,1444 @@ +--- a/configure ++++ b/configure +@@ -902,10 +902,6 @@ plugin_blackhole_static_target + plugin_blackhole_shared_target + plugin_archive_static_target + plugin_archive_shared_target +-plugin_ftexample_static_target +-plugin_ftexample_shared_target +-plugin_daemon_example_static_target +-plugin_daemon_example_shared_target + plugin_partition_shared_target + plugin_partition_static_target + HAVE_YASSL_FALSE +@@ -1946,10 +1942,9 @@ Optional Packages: + list of plugins. + Available configurations are: none max max-no-ndb + all. +- Available plugins are: partition daemon_example +- ftexample archive blackhole csv example federated +- heap ibmdb2i innobase innodb_plugin myisam myisammrg +- ndbcluster. ++ Available plugins are: partition archive blackhole ++ csv example federated heap ibmdb2i innobase ++ innodb_plugin myisam myisammrg ndbcluster. + --without-plugin-PLUGIN Disable the named plugin from being built. + Otherwise, for plugins which are not selected for + inclusion in mysqld will be built dynamically (if +@@ -2013,16 +2008,6 @@ Description of plugins: + Supports build: static + Configurations: max, max-no-ndb + +- === Daemon Example Plugin === +- Plugin Name: daemon_example +- Description: This is an example plugin daemon. +- Supports build: dynamic +- +- === Simple Parser === +- Plugin Name: ftexample +- Description: Simple full-text parser plugin +- Supports build: dynamic +- + === Archive Storage Engine === + Plugin Name: archive + Description: Archive Storage Engine +@@ -4965,13 +4950,13 @@ if test "${lt_cv_nm_interface+set}" = se + else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext +- (eval echo "\"\$as_me:4968: $ac_compile\"" >&5) ++ (eval echo "\"\$as_me:4953: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 +- (eval echo "\"\$as_me:4971: $NM \\\"conftest.$ac_objext\\\"\"" >&5) ++ (eval echo "\"\$as_me:4956: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 +- (eval echo "\"\$as_me:4974: output\"" >&5) ++ (eval echo "\"\$as_me:4959: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" +@@ -6177,7 +6162,7 @@ ia64-*-hpux*) + ;; + *-*-irix6*) + # Find out which ABI we are using. +- echo '#line 6180 "configure"' > conftest.$ac_ext ++ echo '#line 6165 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +@@ -8030,11 +8015,11 @@ else + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:8033: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:8018: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 +- echo "$as_me:8037: \$? = $ac_status" >&5 ++ echo "$as_me:8022: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. +@@ -8369,11 +8354,11 @@ else + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:8372: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:8357: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 +- echo "$as_me:8376: \$? = $ac_status" >&5 ++ echo "$as_me:8361: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. +@@ -8474,11 +8459,11 @@ else + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:8477: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:8462: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 +- echo "$as_me:8481: \$? = $ac_status" >&5 ++ echo "$as_me:8466: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized +@@ -8529,11 +8514,11 @@ else + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:8532: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:8517: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 +- echo "$as_me:8536: \$? = $ac_status" >&5 ++ echo "$as_me:8521: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized +@@ -11329,7 +11314,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11332 "configure" ++#line 11317 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -11425,7 +11410,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11428 "configure" ++#line 11413 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -16938,11 +16923,11 @@ else + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:16941: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:16926: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 +- echo "$as_me:16945: \$? = $ac_status" >&5 ++ echo "$as_me:16930: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. +@@ -17037,11 +17022,11 @@ else + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:17040: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:17025: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 +- echo "$as_me:17044: \$? = $ac_status" >&5 ++ echo "$as_me:17029: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized +@@ -17089,11 +17074,11 @@ else + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:17092: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:17077: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 +- echo "$as_me:17096: \$? = $ac_status" >&5 ++ echo "$as_me:17081: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized +@@ -26456,120 +26441,6 @@ done + esac + + +-# System characteristics +-case $SYSTEM_TYPE in +- *netware*) ;; +- *) +-{ $as_echo "$as_me:$LINENO: checking for restartable system calls" >&5 +-$as_echo_n "checking for restartable system calls... " >&6; } +-if test "${ac_cv_sys_restartable_syscalls+set}" = set; then +- $as_echo_n "(cached) " >&6 +-else +- if test "$cross_compiling" = yes; then +- { { $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 test program while cross compiling +-See \`config.log' for more details." >&5 +-$as_echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; }; } +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-/* Exit 0 (true) if wait returns something other than -1, +- i.e. the pid of the child, which means that wait was restarted +- after getting the signal. */ +- +-$ac_includes_default +-#include +-#ifdef HAVE_SYS_WAIT_H +-# include +-#endif +- +-/* Some platforms explicitly require an extern "C" signal handler +- when using C++. */ +-#ifdef __cplusplus +-extern "C" void ucatch (int dummy) { } +-#else +-void ucatch (dummy) int dummy; { } +-#endif +- +-int +-main () +-{ +- int i = fork (), status; +- +- if (i == 0) +- { +- sleep (3); +- kill (getppid (), SIGINT); +- sleep (3); +- return 0; +- } +- +- signal (SIGINT, ucatch); +- +- status = wait (&i); +- if (status == -1) +- wait (&i); +- +- return status == -1; +-} +-_ACEOF +-rm -f 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>&5 +- ac_status=$? +- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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_try") 2>&5 +- ac_status=$? +- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_sys_restartable_syscalls=yes +-else +- $as_echo "$as_me: program exited with status $ac_status" >&5 +-$as_echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-ac_cv_sys_restartable_syscalls=no +-fi +-rm -rf conftest.dSYM +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +- +- +-fi +-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_restartable_syscalls" >&5 +-$as_echo "$ac_cv_sys_restartable_syscalls" >&6; } +-if test $ac_cv_sys_restartable_syscalls = yes; then +- +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_RESTARTABLE_SYSCALLS 1 +-_ACEOF +- +-fi +- +- ;; +-esac +- + # Build optimized or debug version ? + # First check for gcc and g++ + if test "$GCC" = "yes" +@@ -26923,84 +26794,6 @@ $as_echo "$as_me: error: \"$with_atomic_ + { (exit 1); exit 1; }; } ;; + esac + +-{ $as_echo "$as_me:$LINENO: checking whether the compiler provides atomic builtins" >&5 +-$as_echo_n "checking whether the compiler provides atomic builtins... " >&6; } +-if test "${mysql_cv_gcc_atomic_builtins+set}" = set; then +- $as_echo_n "(cached) " >&6 +-else +- if test "$cross_compiling" = yes; then +- mysql_cv_gcc_atomic_builtins=no +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +- int main() +- { +- int foo= -10; int bar= 10; +- if (!__sync_fetch_and_add(&foo, bar) || foo) +- return -1; +- bar= __sync_lock_test_and_set(&foo, bar); +- if (bar || foo != 10) +- return -1; +- bar= __sync_val_compare_and_swap(&bar, foo, 15); +- if (bar) +- return -1; +- return 0; +- } +- +-_ACEOF +-rm -f 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>&5 +- ac_status=$? +- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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_try") 2>&5 +- ac_status=$? +- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- mysql_cv_gcc_atomic_builtins=yes +-else +- $as_echo "$as_me: program exited with status $ac_status" >&5 +-$as_echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-mysql_cv_gcc_atomic_builtins=no +-fi +-rm -rf conftest.dSYM +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +- +- +-fi +-{ $as_echo "$as_me:$LINENO: result: $mysql_cv_gcc_atomic_builtins" >&5 +-$as_echo "$mysql_cv_gcc_atomic_builtins" >&6; } +- +-if test "x$mysql_cv_gcc_atomic_builtins" = xyes; then +- +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_GCC_ATOMIC_BUILTINS 1 +-_ACEOF +- +-fi +- + # Force static compilation to avoid linking problems/get more speed + + # Check whether --with-mysqld-ldflags was given. +@@ -40520,100 +40313,6 @@ fi + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + if test "${with_archive_storage_engine+set}" = set; then + with_plugin_archive="$with_archive_storage_engine" + fi +@@ -42056,10 +41755,6 @@ fi + + + +- +- +- +- + # Check whether --with-plugins was given. + if test "${with_plugins+set}" = set; then + withval=$with_plugins; mysql_plugins="`echo $withval | tr ',.:;*' ' '`" +@@ -42072,7 +41767,7 @@ fi + + case "$mysql_plugins" in + all ) +- mysql_plugins='partition daemon_example ftexample archive blackhole csv example federated heap ibmdb2i innobase innodb_plugin myisam myisammrg ndbcluster' ++ mysql_plugins='partition archive blackhole csv example federated heap ibmdb2i innobase innodb_plugin myisam myisammrg ndbcluster' + ;; + none ) + mysql_plugins='' +@@ -42124,36 +41819,6 @@ $as_echo "$as_me: error: bad plugin name + + + +- daemon_example ) +- +- +- +- { $as_echo "$as_me:$LINENO: WARNING: Daemon Example Plugin can only be built as a plugin" >&5 +-$as_echo "$as_me: WARNING: Daemon Example Plugin can only be built as a plugin" >&2;} +- +- +- +- ;; +- +- +- +- +- +- ftexample ) +- +- +- +- { $as_echo "$as_me:$LINENO: WARNING: Simple Parser can only be built as a plugin" >&5 +-$as_echo "$as_me: WARNING: Simple Parser can only be built as a plugin" >&2;} +- +- +- +- ;; +- +- +- +- +- + archive ) + + +@@ -42343,10 +42008,6 @@ $as_echo "$as_me: WARNING: InnoDB Storag + + + +- +- +- +- + * ) + { { $as_echo "$as_me:$LINENO: error: unknown plugin: $plugin" >&5 + $as_echo "$as_me: error: unknown plugin: $plugin" >&2;} +@@ -42419,16 +42080,6 @@ $as_echo "$as_me: error: unknown plugin: + + + +- +- +- +- +- +- +- +- +- +- + if test "X$mysql_plugin_ndbcluster" = Xyes -a \ + "X$with_plugin_ndbcluster" != Xno -o \ + "X$with_plugin_ndbcluster" = Xyes; then +@@ -42489,10 +42140,6 @@ $as_echo "$as_me: error: depends upon di + + + +- +- +- +- + { $as_echo "$as_me:$LINENO: checking whether to use Partition Support" >&5 + $as_echo_n "checking whether to use Partition Support... " >&6; } + mysql_use_plugin_dir="" +@@ -42561,236 +42208,6 @@ $as_echo "yes" >&6; } + + + +- { $as_echo "$as_me:$LINENO: checking whether to use Daemon Example Plugin" >&5 +-$as_echo_n "checking whether to use Daemon Example Plugin... " >&6; } +- mysql_use_plugin_dir="" +- +- +- # Plugin is not disabled, determine if it should be built, +- # or only distributed +- +- +- if test ! -d "$srcdir/plugin/daemon_example"; then +- # Plugin directory was removed after autoconf was run; treat +- # this as a disabled plugin +- if test "X$with_plugin_daemon_example" = Xyes; then +- { $as_echo "$as_me:$LINENO: result: error" >&5 +-$as_echo "error" >&6; } +- { { $as_echo "$as_me:$LINENO: error: disabled" >&5 +-$as_echo "$as_me: error: disabled" >&2;} +- { (exit 1); exit 1; }; } +- fi +- +- # The result message will be printed below +- with_plugin_daemon_example=no +- fi +- +- +- +- case "$with_mysqld_ldflags " in +- *"-all-static "*) +- # No need to build shared plugins when mysqld is linked with +- # -all-static as it won't be able to load them. +- if test "X$mysql_plugin_daemon_example" != Xyes -a \ +- "X$with_plugin_daemon_example" != Xyes; then +- with_plugin_daemon_example=no +- fi +- ;; +- esac +- +- +- +- if test "X$with_plugin_daemon_example" = Xno; then +- { $as_echo "$as_me:$LINENO: result: no" >&5 +-$as_echo "no" >&6; } +- else +- with_plugin_daemon_example='' +- if test "X$mysql_plugin_daemon_example" != Xyes -a \ +- "X$with_plugin_daemon_example" != Xyes; then +- +- +- if test -d "$srcdir/plugin/daemon_example" ; then +- mysql_use_plugin_dir="plugin/daemon_example" +- +- plugin_daemon_example_shared_target="libdaemon_example.la" +- +- plugin_daemon_example_static_target="" +- +- with_plugin_daemon_example=yes +- { $as_echo "$as_me:$LINENO: result: plugin" >&5 +-$as_echo "plugin" >&6; } +- +- else +- mysql_plugin_daemon_example=no +- { $as_echo "$as_me:$LINENO: result: no" >&5 +-$as_echo "no" >&6; } +- fi +- +- +- else +- +- +- { $as_echo "$as_me:$LINENO: result: error" >&5 +-$as_echo "error" >&6; } +- { { $as_echo "$as_me:$LINENO: error: Plugin daemon_example does not support static linking" >&5 +-$as_echo "$as_me: error: Plugin daemon_example does not support static linking" >&2;} +- { (exit 1); exit 1; }; } +- +- +- mysql_plugin_defs="$mysql_plugin_defs, builtin_daemon_example_plugin" +- with_plugin_daemon_example=yes +- { $as_echo "$as_me:$LINENO: result: yes" >&5 +-$as_echo "yes" >&6; } +- +- fi +- fi +- +- +- if test -d "$srcdir/plugin/daemon_example"; then +- # Even if we don't build a plugin, we bundle its source into the dist +- # file. So its Makefile (and Makefiles for any subdirs) must be +- # generated for 'make dist' to work. +- +- +- # autoconf doesn't provide an automatic way to configure DIST_SUBDIRS of +- # a subdir; for our purposes, it's enough to just check for existing +- # Makefile.am files and add them in here +- ac_config_files="$ac_config_files plugin/daemon_example/Makefile" +- +- +- +- +- +- mysql_pg_distdirs="$mysql_pg_distdirs daemon_example" +- if test -n "$mysql_use_plugin_dir" ; then +- mysql_pg_dirs="$mysql_pg_dirs daemon_example" +- mysql_pg_unittest_dirs="$mysql_pg_unittest_dirs ../plugin/daemon_example" +- fi +- fi +- +- +- +- +- +- +- +- +- +- { $as_echo "$as_me:$LINENO: checking whether to use Simple Parser" >&5 +-$as_echo_n "checking whether to use Simple Parser... " >&6; } +- mysql_use_plugin_dir="" +- +- +- # Plugin is not disabled, determine if it should be built, +- # or only distributed +- +- +- if test ! -d "$srcdir/plugin/fulltext"; then +- # Plugin directory was removed after autoconf was run; treat +- # this as a disabled plugin +- if test "X$with_plugin_ftexample" = Xyes; then +- { $as_echo "$as_me:$LINENO: result: error" >&5 +-$as_echo "error" >&6; } +- { { $as_echo "$as_me:$LINENO: error: disabled" >&5 +-$as_echo "$as_me: error: disabled" >&2;} +- { (exit 1); exit 1; }; } +- fi +- +- # The result message will be printed below +- with_plugin_ftexample=no +- fi +- +- +- +- case "$with_mysqld_ldflags " in +- *"-all-static "*) +- # No need to build shared plugins when mysqld is linked with +- # -all-static as it won't be able to load them. +- if test "X$mysql_plugin_ftexample" != Xyes -a \ +- "X$with_plugin_ftexample" != Xyes; then +- with_plugin_ftexample=no +- fi +- ;; +- esac +- +- +- +- if test "X$with_plugin_ftexample" = Xno; then +- { $as_echo "$as_me:$LINENO: result: no" >&5 +-$as_echo "no" >&6; } +- else +- with_plugin_ftexample='' +- if test "X$mysql_plugin_ftexample" != Xyes -a \ +- "X$with_plugin_ftexample" != Xyes; then +- +- +- if test -d "$srcdir/plugin/fulltext" ; then +- mysql_use_plugin_dir="plugin/fulltext" +- +- plugin_ftexample_shared_target="mypluglib.la" +- +- plugin_ftexample_static_target="" +- +- with_plugin_ftexample=yes +- { $as_echo "$as_me:$LINENO: result: plugin" >&5 +-$as_echo "plugin" >&6; } +- +- else +- mysql_plugin_ftexample=no +- { $as_echo "$as_me:$LINENO: result: no" >&5 +-$as_echo "no" >&6; } +- fi +- +- +- else +- +- +- { $as_echo "$as_me:$LINENO: result: error" >&5 +-$as_echo "error" >&6; } +- { { $as_echo "$as_me:$LINENO: error: Plugin ftexample does not support static linking" >&5 +-$as_echo "$as_me: error: Plugin ftexample does not support static linking" >&2;} +- { (exit 1); exit 1; }; } +- +- +- mysql_plugin_defs="$mysql_plugin_defs, builtin_ftexample_plugin" +- with_plugin_ftexample=yes +- { $as_echo "$as_me:$LINENO: result: yes" >&5 +-$as_echo "yes" >&6; } +- +- fi +- fi +- +- +- if test -d "$srcdir/plugin/fulltext"; then +- # Even if we don't build a plugin, we bundle its source into the dist +- # file. So its Makefile (and Makefiles for any subdirs) must be +- # generated for 'make dist' to work. +- +- +- # autoconf doesn't provide an automatic way to configure DIST_SUBDIRS of +- # a subdir; for our purposes, it's enough to just check for existing +- # Makefile.am files and add them in here +- ac_config_files="$ac_config_files plugin/fulltext/Makefile" +- +- +- +- +- +- mysql_pg_distdirs="$mysql_pg_distdirs fulltext" +- if test -n "$mysql_use_plugin_dir" ; then +- mysql_pg_dirs="$mysql_pg_dirs fulltext" +- mysql_pg_unittest_dirs="$mysql_pg_unittest_dirs ../plugin/fulltext" +- fi +- fi +- +- +- +- +- +- +- +- +- + + + +@@ -44204,7 +43621,7 @@ $as_echo "yes" >&6; } + # autoconf doesn't provide an automatic way to configure DIST_SUBDIRS of + # a subdir; for our purposes, it's enough to just check for existing + # Makefile.am files and add them in here +- ac_config_files="$ac_config_files storage/ndb/docs/Makefile storage/ndb/include/Makefile storage/ndb/src/common/debugger/signaldata/Makefile storage/ndb/src/common/debugger/Makefile storage/ndb/src/common/logger/Makefile storage/ndb/src/common/mgmcommon/Makefile storage/ndb/src/common/portlib/Makefile storage/ndb/src/common/transporter/Makefile storage/ndb/src/common/util/Makefile storage/ndb/src/common/Makefile storage/ndb/src/cw/cpcd/Makefile storage/ndb/src/cw/Makefile storage/ndb/src/kernel/blocks/backup/Makefile storage/ndb/src/kernel/blocks/dbdict/Makefile storage/ndb/src/kernel/blocks/dbdih/Makefile storage/ndb/src/kernel/blocks/dblqh/Makefile storage/ndb/src/kernel/blocks/dbtup/Makefile storage/ndb/src/kernel/blocks/Makefile storage/ndb/src/kernel/error/Makefile storage/ndb/src/kernel/vm/Makefile storage/ndb/src/kernel/Makefile storage/ndb/src/mgmapi/Makefile storage/ndb/src/mgmclient/Makefile storage/ndb/src/mgmsrv/Makefile storage/ndb/src/ndbapi/Makefile storage/ndb/src/Makefile storage/ndb/test/ndbapi/bank/Makefile storage/ndb/test/ndbapi/Makefile storage/ndb/test/run-test/Makefile storage/ndb/test/src/Makefile storage/ndb/test/tools/Makefile storage/ndb/test/Makefile storage/ndb/tools/Makefile storage/ndb/Makefile" ++ ac_config_files="$ac_config_files storage/ndb/Makefile storage/ndb/test/Makefile storage/ndb/test/run-test/Makefile storage/ndb/test/tools/Makefile storage/ndb/test/src/Makefile storage/ndb/test/ndbapi/Makefile storage/ndb/test/ndbapi/bank/Makefile storage/ndb/docs/Makefile storage/ndb/tools/Makefile storage/ndb/include/Makefile storage/ndb/src/Makefile storage/ndb/src/mgmsrv/Makefile storage/ndb/src/cw/Makefile storage/ndb/src/cw/cpcd/Makefile storage/ndb/src/mgmclient/Makefile storage/ndb/src/mgmapi/Makefile storage/ndb/src/common/Makefile storage/ndb/src/common/mgmcommon/Makefile storage/ndb/src/common/portlib/Makefile storage/ndb/src/common/debugger/Makefile storage/ndb/src/common/debugger/signaldata/Makefile storage/ndb/src/common/logger/Makefile storage/ndb/src/common/util/Makefile storage/ndb/src/common/transporter/Makefile storage/ndb/src/kernel/Makefile storage/ndb/src/kernel/blocks/Makefile storage/ndb/src/kernel/blocks/dbdict/Makefile storage/ndb/src/kernel/blocks/dbtup/Makefile storage/ndb/src/kernel/blocks/dbdih/Makefile storage/ndb/src/kernel/blocks/dblqh/Makefile storage/ndb/src/kernel/blocks/backup/Makefile storage/ndb/src/kernel/error/Makefile storage/ndb/src/kernel/vm/Makefile storage/ndb/src/ndbapi/Makefile" + + + +@@ -44251,10 +43668,6 @@ $as_echo "yes" >&6; } + + + +- +- +- +- + if test "X$with_plugin_partition" = Xyes; then + if test "X$plugin_partition_static_target" = X -a \ + "X$plugin_partition_shared_target" = X; then +@@ -44273,42 +43686,6 @@ $as_echo "$as_me: error: that's strange, + + + +- if test "X$with_plugin_daemon_example" = Xyes; then +- if test "X$plugin_daemon_example_static_target" = X -a \ +- "X$plugin_daemon_example_shared_target" = X; then +- { { $as_echo "$as_me:$LINENO: error: that's strange, daemon_example failed sanity check" >&5 +-$as_echo "$as_me: error: that's strange, daemon_example failed sanity check" >&2;} +- { (exit 1); exit 1; }; } +- fi +- +- +- fi +- +- +- +- +- +- +- +- +- if test "X$with_plugin_ftexample" = Xyes; then +- if test "X$plugin_ftexample_static_target" = X -a \ +- "X$plugin_ftexample_shared_target" = X; then +- { { $as_echo "$as_me:$LINENO: error: that's strange, ftexample failed sanity check" >&5 +-$as_echo "$as_me: error: that's strange, ftexample failed sanity check" >&2;} +- { (exit 1); exit 1; }; } +- fi +- +- +- fi +- +- +- +- +- +- +- +- + if test "X$with_plugin_archive" = Xyes; then + if test "X$plugin_archive_static_target" = X -a \ + "X$plugin_archive_shared_target" = X; then +@@ -48250,198 +47627,6 @@ $as_echo "$as_me: error: unknown endiann + esac + + +- { $as_echo "$as_me:$LINENO: checking whether GCC atomic builtins are available" >&5 +-$as_echo_n "checking whether GCC atomic builtins are available... " >&6; } +- # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not +- if test "$cross_compiling" = yes; then +- { { $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 test program while cross compiling +-See \`config.log' for more details." >&5 +-$as_echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; }; } +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +- int main() +- { +- long x; +- long y; +- long res; +- char c; +- +- x = 10; +- y = 123; +- res = __sync_bool_compare_and_swap(&x, x, y); +- if (!res || x != y) { +- return(1); +- } +- +- x = 10; +- y = 123; +- res = __sync_bool_compare_and_swap(&x, x + 1, y); +- if (res || x != 10) { +- return(1); +- } +- +- x = 10; +- y = 123; +- res = __sync_add_and_fetch(&x, y); +- if (res != 123 + 10 || x != 123 + 10) { +- return(1); +- } +- +- c = 10; +- res = __sync_lock_test_and_set(&c, 123); +- if (res != 10 || c != 123) { +- return(1); +- } +- +- return(0); +- } +- +-_ACEOF +-rm -f 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>&5 +- ac_status=$? +- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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_try") 2>&5 +- ac_status=$? +- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- +- +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_IB_GCC_ATOMIC_BUILTINS 1 +-_ACEOF +- +- { $as_echo "$as_me:$LINENO: result: yes" >&5 +-$as_echo "yes" >&6; } +- +-else +- $as_echo "$as_me: program exited with status $ac_status" >&5 +-$as_echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +- +- { $as_echo "$as_me:$LINENO: result: no" >&5 +-$as_echo "no" >&6; } +- +- +-fi +-rm -rf conftest.dSYM +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +- +- +- +- { $as_echo "$as_me:$LINENO: checking whether pthread_t can be used by GCC atomic builtins" >&5 +-$as_echo_n "checking whether pthread_t can be used by GCC atomic builtins... " >&6; } +- # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not +- if test "$cross_compiling" = yes; then +- { { $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 test program while cross compiling +-See \`config.log' for more details." >&5 +-$as_echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; }; } +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +- #include +- #include +- +- int main(int argc, char** argv) { +- pthread_t x1; +- pthread_t x2; +- pthread_t x3; +- +- memset(&x1, 0x0, sizeof(x1)); +- memset(&x2, 0x0, sizeof(x2)); +- memset(&x3, 0x0, sizeof(x3)); +- +- __sync_bool_compare_and_swap(&x1, x2, x3); +- +- return(0); +- } +- +-_ACEOF +-rm -f 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>&5 +- ac_status=$? +- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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_try") 2>&5 +- ac_status=$? +- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- +- +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_IB_ATOMIC_PTHREAD_T_GCC 1 +-_ACEOF +- +- { $as_echo "$as_me:$LINENO: result: yes" >&5 +-$as_echo "yes" >&6; } +- +-else +- $as_echo "$as_me: program exited with status $ac_status" >&5 +-$as_echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +- +- { $as_echo "$as_me:$LINENO: result: no" >&5 +-$as_echo "no" >&6; } +- +- +-fi +-rm -rf conftest.dSYM +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +- +- +- + { $as_echo "$as_me:$LINENO: checking whether Solaris libc atomic functions are available" >&5 + $as_echo_n "checking whether Solaris libc atomic functions are available... " >&6; } + # either define HAVE_IB_SOLARIS_ATOMICS or not +@@ -48560,103 +47745,6 @@ fi + done + + +- { $as_echo "$as_me:$LINENO: checking whether pthread_t can be used by Solaris libc atomic functions" >&5 +-$as_echo_n "checking whether pthread_t can be used by Solaris libc atomic functions... " >&6; } +- # either define HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS or not +- if test "$cross_compiling" = yes; then +- { { $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 test program while cross compiling +-See \`config.log' for more details." >&5 +-$as_echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; }; } +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +- #include +- #include +- +- int main(int argc, char** argv) { +- pthread_t x1; +- pthread_t x2; +- pthread_t x3; +- +- memset(&x1, 0x0, sizeof(x1)); +- memset(&x2, 0x0, sizeof(x2)); +- memset(&x3, 0x0, sizeof(x3)); +- +- if (sizeof(pthread_t) == 4) { +- +- atomic_cas_32(&x1, x2, x3); +- +- } else if (sizeof(pthread_t) == 8) { +- +- atomic_cas_64(&x1, x2, x3); +- +- } else { +- +- return(1); +- } +- +- return(0); +- } +- +-_ACEOF +-rm -f 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>&5 +- ac_status=$? +- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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_try") 2>&5 +- ac_status=$? +- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- +- +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS 1 +-_ACEOF +- +- { $as_echo "$as_me:$LINENO: result: yes" >&5 +-$as_echo "yes" >&6; } +- +-else +- $as_echo "$as_me: program exited with status $ac_status" >&5 +-$as_echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +- +- { $as_echo "$as_me:$LINENO: result: no" >&5 +-$as_echo "no" >&6; } +- +- +-fi +-rm -rf conftest.dSYM +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +- +- +- + # this is needed to know which one of atomic_cas_32() or atomic_cas_64() + # to use in the source + # The cast to long int works around a bug in the HP C Compiler +@@ -49573,10 +48661,6 @@ _ACEOF + + + +- +- +- +- + # Only build client code? + + # Check whether --with-server was given. +@@ -51544,8 +50628,6 @@ do + "extra/yassl/taocrypt/test/Makefile") CONFIG_FILES="$CONFIG_FILES extra/yassl/taocrypt/test/Makefile" ;; + "extra/yassl/src/Makefile") CONFIG_FILES="$CONFIG_FILES extra/yassl/src/Makefile" ;; + "extra/yassl/testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES extra/yassl/testsuite/Makefile" ;; +- "plugin/daemon_example/Makefile") CONFIG_FILES="$CONFIG_FILES plugin/daemon_example/Makefile" ;; +- "plugin/fulltext/Makefile") CONFIG_FILES="$CONFIG_FILES plugin/fulltext/Makefile" ;; + "storage/archive/Makefile") CONFIG_FILES="$CONFIG_FILES storage/archive/Makefile" ;; + "storage/blackhole/Makefile") CONFIG_FILES="$CONFIG_FILES storage/blackhole/Makefile" ;; + "storage/csv/Makefile") CONFIG_FILES="$CONFIG_FILES storage/csv/Makefile" ;; +@@ -51557,40 +50639,40 @@ do + "storage/innodb_plugin/Makefile") CONFIG_FILES="$CONFIG_FILES storage/innodb_plugin/Makefile" ;; + "storage/myisam/Makefile") CONFIG_FILES="$CONFIG_FILES storage/myisam/Makefile" ;; + "storage/myisammrg/Makefile") CONFIG_FILES="$CONFIG_FILES storage/myisammrg/Makefile" ;; ++ "storage/ndb/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/Makefile" ;; ++ "storage/ndb/test/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/test/Makefile" ;; ++ "storage/ndb/test/run-test/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/test/run-test/Makefile" ;; ++ "storage/ndb/test/tools/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/test/tools/Makefile" ;; ++ "storage/ndb/test/src/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/test/src/Makefile" ;; ++ "storage/ndb/test/ndbapi/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/test/ndbapi/Makefile" ;; ++ "storage/ndb/test/ndbapi/bank/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/test/ndbapi/bank/Makefile" ;; + "storage/ndb/docs/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/docs/Makefile" ;; ++ "storage/ndb/tools/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/tools/Makefile" ;; + "storage/ndb/include/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/include/Makefile" ;; +- "storage/ndb/src/common/debugger/signaldata/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/common/debugger/signaldata/Makefile" ;; +- "storage/ndb/src/common/debugger/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/common/debugger/Makefile" ;; +- "storage/ndb/src/common/logger/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/common/logger/Makefile" ;; ++ "storage/ndb/src/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/Makefile" ;; ++ "storage/ndb/src/mgmsrv/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/mgmsrv/Makefile" ;; ++ "storage/ndb/src/cw/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/cw/Makefile" ;; ++ "storage/ndb/src/cw/cpcd/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/cw/cpcd/Makefile" ;; ++ "storage/ndb/src/mgmclient/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/mgmclient/Makefile" ;; ++ "storage/ndb/src/mgmapi/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/mgmapi/Makefile" ;; ++ "storage/ndb/src/common/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/common/Makefile" ;; + "storage/ndb/src/common/mgmcommon/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/common/mgmcommon/Makefile" ;; + "storage/ndb/src/common/portlib/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/common/portlib/Makefile" ;; +- "storage/ndb/src/common/transporter/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/common/transporter/Makefile" ;; ++ "storage/ndb/src/common/debugger/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/common/debugger/Makefile" ;; ++ "storage/ndb/src/common/debugger/signaldata/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/common/debugger/signaldata/Makefile" ;; ++ "storage/ndb/src/common/logger/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/common/logger/Makefile" ;; + "storage/ndb/src/common/util/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/common/util/Makefile" ;; +- "storage/ndb/src/common/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/common/Makefile" ;; +- "storage/ndb/src/cw/cpcd/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/cw/cpcd/Makefile" ;; +- "storage/ndb/src/cw/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/cw/Makefile" ;; +- "storage/ndb/src/kernel/blocks/backup/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/kernel/blocks/backup/Makefile" ;; ++ "storage/ndb/src/common/transporter/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/common/transporter/Makefile" ;; ++ "storage/ndb/src/kernel/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/kernel/Makefile" ;; ++ "storage/ndb/src/kernel/blocks/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/kernel/blocks/Makefile" ;; + "storage/ndb/src/kernel/blocks/dbdict/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/kernel/blocks/dbdict/Makefile" ;; ++ "storage/ndb/src/kernel/blocks/dbtup/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/kernel/blocks/dbtup/Makefile" ;; + "storage/ndb/src/kernel/blocks/dbdih/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/kernel/blocks/dbdih/Makefile" ;; + "storage/ndb/src/kernel/blocks/dblqh/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/kernel/blocks/dblqh/Makefile" ;; +- "storage/ndb/src/kernel/blocks/dbtup/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/kernel/blocks/dbtup/Makefile" ;; +- "storage/ndb/src/kernel/blocks/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/kernel/blocks/Makefile" ;; ++ "storage/ndb/src/kernel/blocks/backup/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/kernel/blocks/backup/Makefile" ;; + "storage/ndb/src/kernel/error/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/kernel/error/Makefile" ;; + "storage/ndb/src/kernel/vm/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/kernel/vm/Makefile" ;; +- "storage/ndb/src/kernel/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/kernel/Makefile" ;; +- "storage/ndb/src/mgmapi/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/mgmapi/Makefile" ;; +- "storage/ndb/src/mgmclient/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/mgmclient/Makefile" ;; +- "storage/ndb/src/mgmsrv/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/mgmsrv/Makefile" ;; + "storage/ndb/src/ndbapi/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/ndbapi/Makefile" ;; +- "storage/ndb/src/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/Makefile" ;; +- "storage/ndb/test/ndbapi/bank/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/test/ndbapi/bank/Makefile" ;; +- "storage/ndb/test/ndbapi/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/test/ndbapi/Makefile" ;; +- "storage/ndb/test/run-test/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/test/run-test/Makefile" ;; +- "storage/ndb/test/src/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/test/src/Makefile" ;; +- "storage/ndb/test/tools/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/test/tools/Makefile" ;; +- "storage/ndb/test/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/test/Makefile" ;; +- "storage/ndb/tools/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/tools/Makefile" ;; +- "storage/ndb/Makefile") CONFIG_FILES="$CONFIG_FILES storage/ndb/Makefile" ;; + "storage/ndb/src/libndb.ver") CONFIG_FILES="$CONFIG_FILES storage/ndb/src/libndb.ver" ;; + "storage/ndb/include/ndb_version.h") CONFIG_FILES="$CONFIG_FILES storage/ndb/include/ndb_version.h" ;; + "storage/ndb/include/ndb_global.h") CONFIG_FILES="$CONFIG_FILES storage/ndb/include/ndb_global.h" ;; +--- a/configure.in ++++ b/configure.in +@@ -1611,14 +1611,6 @@ case "$with_mysqld_ldflags " in + esac + + +-# System characteristics +-case $SYSTEM_TYPE in +- *netware*) ;; +- *) +-AC_SYS_RESTARTABLE_SYSCALLS +- ;; +-esac +- + # Build optimized or debug version ? + # First check for gcc and g++ + if test "$GCC" = "yes" +--- a/storage/innodb_plugin/plug.in ++++ b/storage/innodb_plugin/plug.in +@@ -53,88 +53,6 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin, [ + esac + AC_SUBST(INNODB_DYNAMIC_CFLAGS) + +- AC_MSG_CHECKING(whether GCC atomic builtins are available) +- # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not +- AC_TRY_RUN( +- [ +- int main() +- { +- long x; +- long y; +- long res; +- char c; +- +- x = 10; +- y = 123; +- res = __sync_bool_compare_and_swap(&x, x, y); +- if (!res || x != y) { +- return(1); +- } +- +- x = 10; +- y = 123; +- res = __sync_bool_compare_and_swap(&x, x + 1, y); +- if (res || x != 10) { +- return(1); +- } +- +- x = 10; +- y = 123; +- res = __sync_add_and_fetch(&x, y); +- if (res != 123 + 10 || x != 123 + 10) { +- return(1); +- } +- +- c = 10; +- res = __sync_lock_test_and_set(&c, 123); +- if (res != 10 || c != 123) { +- return(1); +- } +- +- return(0); +- } +- ], +- [ +- AC_DEFINE([HAVE_IB_GCC_ATOMIC_BUILTINS], [1], +- [GCC atomic builtins are available]) +- AC_MSG_RESULT(yes) +- ], +- [ +- AC_MSG_RESULT(no) +- ] +- ) +- +- AC_MSG_CHECKING(whether pthread_t can be used by GCC atomic builtins) +- # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not +- AC_TRY_RUN( +- [ +- #include +- #include +- +- int main(int argc, char** argv) { +- pthread_t x1; +- pthread_t x2; +- pthread_t x3; +- +- memset(&x1, 0x0, sizeof(x1)); +- memset(&x2, 0x0, sizeof(x2)); +- memset(&x3, 0x0, sizeof(x3)); +- +- __sync_bool_compare_and_swap(&x1, x2, x3); +- +- return(0); +- } +- ], +- [ +- AC_DEFINE([HAVE_IB_ATOMIC_PTHREAD_T_GCC], [1], +- [pthread_t can be used by GCC atomic builtins]) +- AC_MSG_RESULT(yes) +- ], +- [ +- AC_MSG_RESULT(no) +- ] +- ) +- + AC_MSG_CHECKING(whether Solaris libc atomic functions are available) + # either define HAVE_IB_SOLARIS_ATOMICS or not + AC_CHECK_FUNCS(atomic_cas_ulong \ +@@ -148,48 +66,6 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin, [ + are available]) + ) + +- AC_MSG_CHECKING(whether pthread_t can be used by Solaris libc atomic functions) +- # either define HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS or not +- AC_TRY_RUN( +- [ +- #include +- #include +- +- int main(int argc, char** argv) { +- pthread_t x1; +- pthread_t x2; +- pthread_t x3; +- +- memset(&x1, 0x0, sizeof(x1)); +- memset(&x2, 0x0, sizeof(x2)); +- memset(&x3, 0x0, sizeof(x3)); +- +- if (sizeof(pthread_t) == 4) { +- +- atomic_cas_32(&x1, x2, x3); +- +- } else if (sizeof(pthread_t) == 8) { +- +- atomic_cas_64(&x1, x2, x3); +- +- } else { +- +- return(1); +- } +- +- return(0); +- } +- ], +- [ +- AC_DEFINE([HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS], [1], +- [pthread_t can be used by solaris atomics]) +- AC_MSG_RESULT(yes) +- ], +- [ +- AC_MSG_RESULT(no) +- ] +- ) +- + # this is needed to know which one of atomic_cas_32() or atomic_cas_64() + # to use in the source + AC_CHECK_SIZEOF([pthread_t], [], [#include ]) +--- a/libmysql/Makefile.in ++++ b/libmysql/Makefile.in +@@ -626,7 +626,7 @@ clean-noinstPROGRAMS: + done + conf_to_src$(EXEEXT): $(conf_to_src_OBJECTS) $(conf_to_src_DEPENDENCIES) + @rm -f conf_to_src$(EXEEXT) +- $(conf_to_src_LINK) $(conf_to_src_OBJECTS) $(conf_to_src_LDADD) $(LIBS) ++ $(conf_to_src_LINK) $(conf_to_src_OBJECTS) $(conf_to_src_LDADD) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) diff --git a/libs/mysql/patches/501-disable-pthread-and-tests.patch b/libs/mysql/patches/501-disable-pthread-and-tests.patch new file mode 100644 index 0000000..e295e58 --- /dev/null +++ b/libs/mysql/patches/501-disable-pthread-and-tests.patch @@ -0,0 +1,117 @@ +--- a/sql/Makefile.am ++++ b/sql/Makefile.am +@@ -41,7 +41,6 @@ mysqld_DEPENDENCIES= @mysql_plugin_libs@ + LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ @NDB_SCI_LIBS@ + mysqld_LDADD = libndb.la \ + @MYSQLD_EXTRA_LDFLAGS@ \ +- @pstack_libs@ \ + @mysql_plugin_libs@ \ + $(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \ + $(yassl_libs) $(openssl_libs) @MYSQLD_EXTRA_LIBS@ +@@ -174,10 +173,10 @@ link_sources: + # This generates lex_hash.h + # NOTE Built sources should depend on their sources not the tool + # this avoid the rebuild of the built files in a source dist +-lex_hash.h: gen_lex_hash.cc lex.h +- $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT) +- ./gen_lex_hash$(EXEEXT) > $@-t +- $(MV) $@-t $@ ++#lex_hash.h: gen_lex_hash.cc lex.h ++# $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT) ++# ./gen_lex_hash$(EXEEXT) > $@-t ++# $(MV) $@-t $@ + + # For testing of udf_example.so + udf_example_la_SOURCES= udf_example.c +--- a/sql/Makefile.in ++++ b/sql/Makefile.in +@@ -486,8 +486,6 @@ plugin_partition_static_target = @plugin + prefix = @prefix@ + program_transform_name = @program_transform_name@ + psdir = @psdir@ +-pstack_dir = @pstack_dir@ +-pstack_libs = @pstack_libs@ + readline_basedir = @readline_basedir@ + readline_dir = @readline_dir@ + readline_h_ln_cmd = @readline_h_ln_cmd@ +@@ -541,7 +539,6 @@ mysqld_DEPENDENCIES = @mysql_plugin_libs + LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ @NDB_SCI_LIBS@ + mysqld_LDADD = libndb.la \ + @MYSQLD_EXTRA_LDFLAGS@ \ +- @pstack_libs@ \ + @mysql_plugin_libs@ \ + $(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \ + $(yassl_libs) $(openssl_libs) @MYSQLD_EXTRA_LIBS@ +@@ -1308,10 +1305,10 @@ link_sources: + # This generates lex_hash.h + # NOTE Built sources should depend on their sources not the tool + # this avoid the rebuild of the built files in a source dist +-lex_hash.h: gen_lex_hash.cc lex.h +- $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT) +- ./gen_lex_hash$(EXEEXT) > $@-t +- $(MV) $@-t $@ ++#lex_hash.h: gen_lex_hash.cc lex.h ++# $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT) ++# ./gen_lex_hash$(EXEEXT) > $@-t ++# $(MV) $@-t $@ + + # We might have some stuff not built in this build, but that we want to install + install-exec-hook: +--- a/extra/Makefile.am ++++ b/extra/Makefile.am +@@ -29,16 +29,16 @@ DIST_SUBDIRS = yassl + # This will build mysqld_error.h, mysqld_ername.h and sql_state.h + # NOTE Built files should depend on their sources to avoid + # the built files being rebuilt in source dist +-$(top_builddir)/include/mysqld_error.h: comp_err.c \ +- $(top_srcdir)/sql/share/errmsg.txt +- $(MAKE) $(AM_MAKEFLAGS) comp_err$(EXEEXT) +- $(top_builddir)/extra/comp_err$(EXEEXT) \ +- --charset=$(top_srcdir)/sql/share/charsets \ +- --out-dir=$(top_builddir)/sql/share/ \ +- --header_file=$(top_builddir)/include/mysqld_error.h \ +- --name_file=$(top_builddir)/include/mysqld_ername.h \ +- --state_file=$(top_builddir)/include/sql_state.h \ +- --in_file=$(top_srcdir)/sql/share/errmsg.txt ++#$(top_builddir)/include/mysqld_error.h: comp_err.c \ ++# $(top_srcdir)/sql/share/errmsg.txt ++# $(MAKE) $(AM_MAKEFLAGS) comp_err$(EXEEXT) ++# $(top_builddir)/extra/comp_err$(EXEEXT) \ ++# --charset=$(top_srcdir)/sql/share/charsets \ ++# --out-dir=$(top_builddir)/sql/share/ \ ++# --header_file=$(top_builddir)/include/mysqld_error.h \ ++# --name_file=$(top_builddir)/include/mysqld_ername.h \ ++# --state_file=$(top_builddir)/include/sql_state.h \ ++# --in_file=$(top_srcdir)/sql/share/errmsg.txt + $(top_builddir)/include/mysqld_ername.h: $(top_builddir)/include/mysqld_error.h + $(top_builddir)/include/sql_state.h: $(top_builddir)/include/mysqld_error.h + +--- a/extra/Makefile.in ++++ b/extra/Makefile.in +@@ -938,16 +938,16 @@ uninstall-am: uninstall-binPROGRAMS unin + # This will build mysqld_error.h, mysqld_ername.h and sql_state.h + # NOTE Built files should depend on their sources to avoid + # the built files being rebuilt in source dist +-$(top_builddir)/include/mysqld_error.h: comp_err.c \ +- $(top_srcdir)/sql/share/errmsg.txt +- $(MAKE) $(AM_MAKEFLAGS) comp_err$(EXEEXT) +- $(top_builddir)/extra/comp_err$(EXEEXT) \ +- --charset=$(top_srcdir)/sql/share/charsets \ +- --out-dir=$(top_builddir)/sql/share/ \ +- --header_file=$(top_builddir)/include/mysqld_error.h \ +- --name_file=$(top_builddir)/include/mysqld_ername.h \ +- --state_file=$(top_builddir)/include/sql_state.h \ +- --in_file=$(top_srcdir)/sql/share/errmsg.txt ++#$(top_builddir)/include/mysqld_error.h: comp_err.c \ ++# $(top_srcdir)/sql/share/errmsg.txt ++# $(MAKE) $(AM_MAKEFLAGS) comp_err$(EXEEXT) ++# $(top_builddir)/extra/comp_err$(EXEEXT) \ ++# --charset=$(top_srcdir)/sql/share/charsets \ ++# --out-dir=$(top_builddir)/sql/share/ \ ++# --header_file=$(top_builddir)/include/mysqld_error.h \ ++# --name_file=$(top_builddir)/include/mysqld_ername.h \ ++# --state_file=$(top_builddir)/include/sql_state.h \ ++# --in_file=$(top_srcdir)/sql/share/errmsg.txt + $(top_builddir)/include/mysqld_ername.h: $(top_builddir)/include/mysqld_error.h + $(top_builddir)/include/sql_state.h: $(top_builddir)/include/mysqld_error.h + diff --git a/libs/mysql/patches/502-fix-hostname.patch b/libs/mysql/patches/502-fix-hostname.patch new file mode 100644 index 0000000..a35c3be --- /dev/null +++ b/libs/mysql/patches/502-fix-hostname.patch @@ -0,0 +1,11 @@ +--- a/scripts/mysql_install_db.sh ++++ b/scripts/mysql_install_db.sh +@@ -317,7 +317,7 @@ then + fi + + # Try to determine the hostname +-hostname=`@HOSTNAME@` ++hostname=`cat /proc/sys/kernel/hostname` + + # Check if hostname is valid + if test "$cross_bootstrap" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0 diff --git a/libs/nacl/Makefile b/libs/nacl/Makefile new file mode 100644 index 0000000..546f071 --- /dev/null +++ b/libs/nacl/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2011 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:=nacl +PKG_VERSION:=20110221 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://hyperelliptic.org/nacl +PKG_MD5SUM:=7efb5715561c3d10dafd3fa97b4f2d20 + +include $(INCLUDE_DIR)/package.mk + +define Package/nacl + SECTION:=libs + CATEGORY:=Libraries + TITLE:=NaCl Networking and Cryptography library + URL:=http://nacl.cace-project.eu/ +endef + +define Build/Compile + cp do-openwrt $(PKG_BUILD_DIR) + ( \ + cd $(PKG_BUILD_DIR); \ + chmod +x do-openwrt; \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + AR="$(TARGET_CROSS)ar" \ + RANLIB="$(TARGET_CROSS)ranlib" \ + ./do-openwrt \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/nacl + $(CP) $(PKG_BUILD_DIR)/build/include/*.h $(1)/usr/include/nacl/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/build/lib/libnacl.a $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,nacl)) diff --git a/libs/nacl/do-openwrt b/libs/nacl/do-openwrt new file mode 100755 index 0000000..65d9376 --- /dev/null +++ b/libs/nacl/do-openwrt @@ -0,0 +1,206 @@ +#!/bin/sh +set -e + +# nacl/do +# D. J. Bernstein +# Public domain. + +version=`cat version` +project=nacl + +top="`pwd`/build" +bin="$top/bin" +lib="$top/lib" +include="$top/include" +work="$top/work" + + +# and work around bug in GNU sort +LANG=C +export LANG + +rm -rf "$top" +mkdir -p "$top" +mkdir -p "$bin" +mkdir -p "$lib" +mkdir -p "$include" + +exec >"$top/log" +exec 2>&1 +exec 5>"$top/data" +exec " + echo "" + echo "typedef ${target}_t crypto_${target};" + echo "" + echo "#endif" + ) > "$include/crypto_$target.h" +done + +echo "=== `date` === building randombytes" +rm -rf "$work" +mkdir -p "$work" +cp -pr randombytes/* "$work" +( + cd "$work" + + cp devurandom.c randombytes-impl.c + cp devurandom.h randombytes-impl.h + $CC $CFLAGS -c randombytes-impl.c + mkdir -p lib + mv randombytes-impl.o lib/randombytes.o + mkdir -p include + mv randombytes-impl.h include/randombytes.h +) +cp -pr "$work"/lib/* "$lib" +cp -pr "$work"/include/* "$include" + +rm -rf "$work" +mkdir -p "$work" +echo 'void crypto_'"$project"'_base(void) { ; }' > "$work/${project}_base.c" +( cd "$work" && $CC $CFLAGS -c ${project}_base.c ) +$AR cr "$lib/lib${project}.a" "$work/${project}_base.o" +( $RANLIB "$lib/lib${project}.a" || exit 0 ) + +# loop over operations +cat OPERATIONS \ +| while read o +do + [ -d "$o" ] || continue + + # for each operation, loop over primitives + ls "$o" \ + | sort \ + | while read p + do + [ -d "$o/$p" ] || continue + op="${o}_${p}" + + startdate=`date +%Y%m%d` + + echo "=== `date` === $o/$p" + + rm -rf "$work" + mkdir -p "$work" + + if [ -d "$o/$p/ref" ]; then + implementationdir="$o/$p/ref" + else + implementationdir="$o/$p/portable" + fi + + opi=`echo "$implementationdir" | tr ./- ___` + + echo "=== `date` === $implementationdir" + + cfiles=`ls "$implementationdir" | grep '\.c$' || :` + sfiles=`ls "$implementationdir" | grep '\.[sS]$' || :` + + cp -p "$o"/*.c "$work" + + cp -pr "$implementationdir"/* "$work" + + cp -p MACROS "$work/MACROS" + cp -p PROTOTYPES.c "$work/PROTOTYPES.c" + + ( + cd "$work" + ( + echo "#ifndef ${o}_H" + echo "#define ${o}_H" + echo "" + echo "#include \"${op}.h\"" + echo "" + egrep "${o}"'$|'"${o}"'\(|'"${o}"'_' < MACROS \ + | sed "s/$o/$op/" | while read mop + do + echo "#define ${mop} ${mop}" | sed "s/$op/$o/" + done + echo "#define ${o}_PRIMITIVE \"${p}\"" + echo "#define ${o}_IMPLEMENTATION ${op}_IMPLEMENTATION" + echo "#define ${o}_VERSION ${op}_VERSION" + echo "" + echo "#endif" + ) > "$o.h" + ( + echo "#ifndef ${op}_H" + echo "#define ${op}_H" + echo "" + sed 's/[ ]CRYPTO_/ '"${opi}"'_/g' < api.h + echo '#ifdef __cplusplus' + #echo '#include ' + #egrep "${o}"'$|'"${o}"'\(|'"${o}"'_' < PROTOTYPES.cpp \ + # | sed "s/$o/$opi/" + echo 'extern "C" {' + echo '#endif' + egrep "${o}"'$|'"${o}"'\(|'"${o}"'_' < PROTOTYPES.c \ + | sed "s/$o/$opi/" + echo '#ifdef __cplusplus' + echo '}' + echo '#endif' + echo "" + egrep "${o}"'$|'"${o}"'\(|'"${o}"'_' < MACROS \ + | sed "s/$o/$opi/" | while read mopi + do + echo "#define ${mopi} ${mopi}" | sed "s/$opi/$op/" + done + echo "#define ${op}_IMPLEMENTATION \"${implementationdir}\"" + echo "#ifndef ${opi}_VERSION" + echo "#define ${opi}_VERSION \"-\"" + echo "#endif" + echo "#define ${op}_VERSION ${opi}_VERSION" + echo "" + echo "#endif" + ) > "$op.h" + + echo "=== `date` === $implementationdir $CC $CFLAGS" + for f in $cfiles $sfiles + do + ok=1 + $CC $CFLAGS \ + -I. -I"$include" \ + -c "$f" >errors 2>&1 || ok=0 + ( if [ `wc -l < errors` -lt 25 ] + then + cat errors + else + head errors + echo ... + tail errors + fi + ) \ + | while read err + do + echo "$version $startdate $o $p fromcompiler $implementationdir $f $err" >&5 + done + + [ "$ok" = 1 ] + done + + for f in *.o + do + mv "$f" "${opi}-$f" + done + ) + + echo "=== `date` === $implementationdir $CC $CFLAGS finishing" + + $AR cr "$lib/lib${project}.a" "$work"/*.o \ + && ( $RANLIB "$lib/lib${project}.a" || exit 0 ) \ + && cp -p "$work/$op.h" "$include/$op.h" \ + && [ -f "$o/$p/selected" ] \ + && cp -p "$work/$o.h" "$include/$o.h" \ + || : + done +done + +echo "=== `date` === finishing" diff --git a/libs/neon/Makefile b/libs/neon/Makefile new file mode 100644 index 0000000..4a95cac --- /dev/null +++ b/libs/neon/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2007-2011 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:=neon +PKG_VERSION:=0.29.6 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.webdav.org/neon +PKG_MD5SUM:=591e0c82e6979e7e615211b386b8f6bc + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libneon + SECTION:=libs + CATEGORY:=Libraries + TITLE:=HTTP and WebDAV client library + URL:=http://www.webdav.org/neon/ + DEPENDS:=+libopenssl +libexpat +endef + +TARGET_CFLAGS += $(FPIC) +TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --with-expat \ + --with-ssl="openssl" \ + --without-egd \ + --without-libproxy \ + +CONFIGURE_VARS += \ + LDFLAGS="$$$$LDFLAGS -lcrypto -lssl" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/neon-config $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/neon $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libneon.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/neon.pc $(1)/usr/lib/pkgconfig/ + $(SED) 's,-I$$$${includedir}/,-I$(STAGING_DIR)/usr/include/,g' $(1)/usr/bin/neon-config + $(SED) 's,-L$$$${libdir},,g' $(1)/usr/bin/neon-config +endef + +define Package/libneon/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libneon.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libneon)) diff --git a/libs/neon/patches/001-automake-compat.patch b/libs/neon/patches/001-automake-compat.patch new file mode 100644 index 0000000..f6ffa0f --- /dev/null +++ b/libs/neon/patches/001-automake-compat.patch @@ -0,0 +1,5 @@ +--- /dev/null ++++ b/Makefile.am +@@ -0,0 +1,2 @@ ++SUBDIRS = . ++ACLOCAL_AMFLAGS = -I macros diff --git a/libs/newt/Makefile b/libs/newt/Makefile new file mode 100644 index 0000000..79dad88 --- /dev/null +++ b/libs/newt/Makefile @@ -0,0 +1,76 @@ +# +# Copyright (C) 2006-2011 OpenWrt.org +# Copyright (C) 2011 SMBPhone Inc. +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=newt +PKG_VERSION:=0.52.12 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://fedorahosted.org/releases/n/e/newt/ +PKG_MD5SUM:=51b04128d9e1bf000fa769c417b74486 + +include $(INCLUDE_DIR)/package.mk + +define Package/libnewt + URL:=http://fedorahosted.org/newt/ + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Not Erik's Windowing Toolkit + DEPENDS:= +libslang2 +libpopt +endef + +define Package/libnewt/description + Programming library for colour text mode widget-based user interfaces, + based on S-Lang. +endef + +define Package/whiptail + URL:=http://fedorahosted.org/newt/ + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Dialog boxes from shell scripts + DEPENDS:= +libnewt +endef + +define Package/whiptail/description + A lightweight replacement for the dialog command (dialog boxes from shell + scripts), based on libnewt. +endef + +TARGET_CFLAGS += $(FPIC) -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib + +CONFIGURE_ARGS += \ + --disable-nls \ + --without-tcl \ + --without-gpm-support + +MAKE_FLAGS += AR="$(TARGET_CROSS)ar" + +define Package/libnewt/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libnewt.so* $(1)/usr/lib/ +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/newt.h $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libnewt.{a,so*} $(1)/usr/lib/ +endef + +define Package/whiptail/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/whiptail $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libnewt)) +$(eval $(call BuildPackage,whiptail)) + diff --git a/libs/newt/patches/100-compile-fix-broken-makefile.patch b/libs/newt/patches/100-compile-fix-broken-makefile.patch new file mode 100644 index 0000000..cbada60 --- /dev/null +++ b/libs/newt/patches/100-compile-fix-broken-makefile.patch @@ -0,0 +1,68 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -4,7 +4,8 @@ LIBTCL = -ltcl8.4 + CC = @CC@ + CPP = @CPP@ + CFLAGS = @CFLAGS@ +-CPPFLAGS = -D_GNU_SOURCE -I/usr/include/slang @CPPFLAGS@ ++AR ?= ar ++CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@ + + SHLIBFLAGS= -Wl,--version-script,newt.0.52.ver + VERSION = @VERSION@ +@@ -53,19 +54,19 @@ endif + all: $(TARGET) _snackmodule.so + + test: test.o $(LIBNEWT) +- $(CC) -g -o test test.o $(LIBNEWT) $(LIBS) ++ $(CC) $(CFLAGS) -g -o test test.o $(LIBNEWT) $(LIBS) + + testgrid: testgrid.o $(LIBNEWT) +- $(CC) -g -o testgrid testgrid.o $(LIBNEWT) $(LIBS) ++ $(CC) $(CFLAGS) -g -o testgrid testgrid.o $(LIBNEWT) $(LIBS) + + testtree: testtree.o $(LIBNEWT) +- $(CC) -g -o testtree testtree.o $(LIBNEWT) $(LIBS) ++ $(CC) $(CFLAGS) -g -o testtree testtree.o $(LIBNEWT) $(LIBS) + + showchars: showchars.o $(LIBNEWT) +- $(CC) -g -o showchars showchars.o $(LIBNEWT) $(LIBS) ++ $(CC) $(CFLAGS) -g -o showchars showchars.o $(LIBNEWT) $(LIBS) + + showkey: showkey.o $(LIBNEWT) +- $(CC) -g -o showkey showkey.o $(LIBNEWT) $(LIBS) ++ $(CC) $(CFLAGS) -g -o showkey showkey.o $(LIBNEWT) $(LIBS) + + _snackmodule.so: snackmodule.c $(LIBNEWTSH) + for ver in $(PYTHONVERS) ; do \ +@@ -76,13 +77,13 @@ _snackmodule.so: snackmodule.c $(LIBNE + touch $@ + + whiptail: $(NDIALOGOBJS) $(LIBNEWTSH) +- $(CC) -g -o whiptail $(NDIALOGOBJS) -L . -lnewt $(LIBS) -lpopt ++ $(CC) $(CFLAGS) -g -o whiptail $(NDIALOGOBJS) -L . -lnewt $(LIBS) -lpopt + + whiptcl.so: $(WHIPTCLOBJS) $(LIBNEWTSH) + $(CC) -shared $(SHCFLAGS) -o whiptcl.so $(WHIPTCLOBJS) -L . -lnewt $(LIBTCL) -lpopt + + $(LIBNEWT): $(LIBOBJS) +- ar rv $@ $^ ++ $(AR) rv $@ $^ + + newt.o $(SHAREDDIR)/newt.o: newt.c Makefile + +@@ -102,12 +103,12 @@ $(SHAREDDIR): + sharedlib: $(LIBNEWTSH) + + $(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS) +- $(CC) -shared -o $(LIBNEWTSH) $(SHLIBFLAGS) -Wl,-soname,$(LIBNEWTSONAME) $(SHAREDOBJS) $(LIBS) ++ $(CC) $(CFLAGS) -shared -o $(LIBNEWTSH) $(SHLIBFLAGS) -Wl,-soname,$(LIBNEWTSONAME) $(SHAREDOBJS) $(LIBS) + ln -fs $(LIBNEWTSONAME) libnewt.so + ln -fs $(LIBNEWTSH) $(LIBNEWTSONAME) + + $(SHAREDDIR)/%.o : %.c +- $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< ++ $(CC) $(CFLAGS) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< + + install: $(LIBNEWT) install-sh whiptail + [ -d $(instroot)/$(bindir) ] || install -m 755 -d $(instroot)/$(bindir) diff --git a/libs/newt/patches/110-disable-snackmodule-python.patch b/libs/newt/patches/110-disable-snackmodule-python.patch new file mode 100644 index 0000000..79e7e11 --- /dev/null +++ b/libs/newt/patches/110-disable-snackmodule-python.patch @@ -0,0 +1,45 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -51,7 +51,7 @@ else + TARGET=depend $(PROGS) + endif + +-all: $(TARGET) _snackmodule.so ++all: $(TARGET) + + test: test.o $(LIBNEWT) + $(CC) $(CFLAGS) -g -o test test.o $(LIBNEWT) $(LIBS) +@@ -68,14 +68,6 @@ showchars: showchars.o $(LIBNEWT) + showkey: showkey.o $(LIBNEWT) + $(CC) $(CFLAGS) -g -o showkey showkey.o $(LIBNEWT) $(LIBS) + +-_snackmodule.so: snackmodule.c $(LIBNEWTSH) +- for ver in $(PYTHONVERS) ; do \ +- mkdir -p $$ver ;\ +- $(CC) $(CFLAGS) -I/usr/include/$$ver $(SHCFLAGS) -c -o $$ver/snackmodule.o snackmodule.c ;\ +- $(CC) --shared $(SHCFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L . -lnewt ;\ +- done +- touch $@ +- + whiptail: $(NDIALOGOBJS) $(LIBNEWTSH) + $(CC) $(CFLAGS) -g -o whiptail $(NDIALOGOBJS) -L . -lnewt $(LIBS) -lpopt + +@@ -122,17 +114,12 @@ install: $(LIBNEWT) install-sh whiptail + make -C po datadir=$(instroot)/$(datadir) install + install -m 644 -D libnewt.pc $(instroot)/$(pkgconfigdir)/libnewt.pc + +-install-sh: sharedlib $(WHIPTCLSO) _snackmodule.so ++install-sh: sharedlib $(WHIPTCLSO) + [ -d $(instroot)/$(libdir) ] || install -m 755 -d $(instroot)/$(libdir) + install -m 755 $(LIBNEWTSH) $(instroot)/$(libdir) + ln -sf $(LIBNEWTSONAME) $(instroot)/$(libdir)/libnewt.so + ln -sf $(LIBNEWTSH) $(instroot)/$(libdir)/$(LIBNEWTSONAME) + [ -n "$(WHIPTCLSO)" ] && install -m 755 whiptcl.so $(instroot)/$(libdir) || : +- for ver in $(PYTHONVERS) ; do \ +- [ -d $(instroot)/$(libdir)/$$ver/site-packages ] || install -m 755 -d $(instroot)/$(libdir)/$$ver/site-packages ;\ +- install -m 755 $$ver/_snackmodule.so $(instroot)/$(libdir)/$$ver/site-packages ;\ +- install -m 644 snack.py $(instroot)/$(libdir)/$$ver/site-packages ;\ +- done + + Makefile: newt.spec + echo "You need to rerun ./configure before continuing" diff --git a/libs/nmeap/Makefile b/libs/nmeap/Makefile new file mode 100644 index 0000000..9978e4b --- /dev/null +++ b/libs/nmeap/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2007 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:=nmeap +PKG_VERSION:=0.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/nmeap +PKG_MD5SUM:=cbcc9fdf5176f9d6c9e48f27db443c4f + +include $(INCLUDE_DIR)/package.mk + +define Package/libnmeap + SECTION:=libs + CATEGORY:=Libraries + TITLE:=extensible NMEA-0183 parser written in standard C + URL:=http://www.dmh2000.com/nmea/nmeap.shtml +endef + +define Package/libnmeap/description +The NMEAP parser is intended for use in applications that need to input NMEA-0183 + data from a GPS (typically over a serial port). NMEAP is a linkable library written in portable + standard C and is suitable for both desktop and embedded applications. + It is licensed under the BSD open source license. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/inc/nmeap{,_def}.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/lib/libnmeap.a $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libnmeap)) diff --git a/libs/nmeap/patches/100-no_test.patch b/libs/nmeap/patches/100-no_test.patch new file mode 100644 index 0000000..891e2a8 --- /dev/null +++ b/libs/nmeap/patches/100-no_test.patch @@ -0,0 +1,21 @@ +--- nmeap-0.3/Makefile 2005-05-06 19:57:39.000000000 +0200 ++++ nmeap-0.3.new/Makefile 2007-07-25 15:26:47.000000000 +0200 +@@ -5,18 +5,15 @@ + # directories + BASE :=$(shell pwd) + export SRC=$(BASE)/src +-export TST=$(BASE)/tst + export INC=$(BASE)/inc + export LIB=$(BASE)/lib + + all : + cd $(SRC) && $(MAKE) all +- cd $(TST) && $(MAKE) all + + + clean : + cd $(SRC) && $(MAKE) clean +- cd $(TST) && $(MAKE) clean + + doc : + doxygen diff --git a/libs/opal/Makefile b/libs/opal/Makefile new file mode 100644 index 0000000..380a8b2 --- /dev/null +++ b/libs/opal/Makefile @@ -0,0 +1,69 @@ +# +# 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:=opal +PKG_VERSION:=3.2.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.bz2 +PKG_SOURCE_URL:=@SF/opalvoip +PKG_MD5SUM:=405ba3b03ec706b6e6f873de340937e2 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION) + +# Set location of ptlib (Which needs to have been built already) +export PTLIBDIR=$(BUILD_DIR)/ptlib +export PTLIBPLUGINDIR=$(BUILD_DIR)/ptlib/plugins/ptlib/ + +include $(INCLUDE_DIR)/package.mk + +define Package/libopal + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+ptlib +uclibcxx + TITLE:=Open Phone Abstraction Library + URL:=http://www.opalvoip.org/ +endef + +define Package/libopal/description + Open Phone Abstraction Library, implementation of the ITU H.323 + teleconferencing protocol, and successor of the openh323 library. It + supports not only the H.323 protocol but also SIP and IAX2. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-audio \ + --disable-video \ + --enable-sip \ + --enable-h323 \ + --disable-iax \ + --disable-h224 \ + --disable-h450 \ + --disable-h460 \ + --disable-ivr \ + --disable-rfc4175 \ + --disable-versioncheck \ + --disable-theora \ + --enable-localgsm + +CONFIGURE_VARS += \ + CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti" \ + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS)" \ + CCFLAGS="$(TARGET_CFLAGS)" \ + optnoshared + +define Build/InstallDev + ln -sf $(PKG_NAME)_$(PKG_VERSION) $(BUILD_DIR)/$(PKG_NAME) +endef + +$(eval $(call BuildPackage,libopal)) diff --git a/libs/opal/patches/010-fix-gcc_4_3-compile.patch b/libs/opal/patches/010-fix-gcc_4_3-compile.patch new file mode 100644 index 0000000..15d80b4 --- /dev/null +++ b/libs/opal/patches/010-fix-gcc_4_3-compile.patch @@ -0,0 +1,25 @@ +diff --git a/plugins/video/common/trace.cxx b/plugins/video/common/trace.cxx +index 7262478..de641af 100644 +--- a/plugins/video/common/trace.cxx ++++ b/plugins/video/common/trace.cxx +@@ -30,6 +30,7 @@ + /*****************************************************************************/ + + #include "trace.h" ++#include + + #ifdef __MACOSX__ + #include +diff --git a/plugins/video/H.263-ffmpeg/h263ffmpeg.cxx b/plugins/video/H.263-ffmpeg/h263ffmpeg.cxx +index 4a17b2c..a2f051c 100644 +--- a/plugins/video/H.263-ffmpeg/h263ffmpeg.cxx ++++ b/plugins/video/H.263-ffmpeg/h263ffmpeg.cxx +@@ -54,6 +54,8 @@ + #define _CRT_NONSTDC_NO_WARNINGS + #define _CRT_SECURE_NO_DEPRECATE + #include ++#include ++#include + + #include + #ifdef _WIN32 diff --git a/libs/opencdk/Makefile b/libs/opencdk/Makefile new file mode 100644 index 0000000..2648fd6 --- /dev/null +++ b/libs/opencdk/Makefile @@ -0,0 +1,76 @@ +# +# Copyright (C) 2006-2011 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:=opencdk +PKG_VERSION:=0.6.6 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.gnutls.org/pub/gnutls/attic/opencdk +PKG_MD5SUM:=813d62d7afe7b2c2d8f3df0a6c9d9331 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +PKG_INSTALL=1 + +define Package/libopencdk + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libgcrypt zlib + TITLE:=The Open Crypto Development Kit library + URL:=ftp://ftp.gnutls.org/pub/gnutls/attic/opencdk/ +endef + +define Package/libopencdk/description + This library provides basic parts of the OpenPGP message format. + For reference, please read the rfc2440.txt in the doc/ directory. + Due to some possible security problems, the library also implements + parts of draft-ietf-openpgp-rfc2440bis-08.txt. If you want to exchange + messages with earlier PGP version < 7, you should use the compat mode. +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + --with-libgcrypt-prefix="$(STAGING_DIR)/usr" \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(2)/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/opencdk-config \ + $(2)/bin/ + $(SED) \ + 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ + $(2)/bin/opencdk-config + + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/opencdk.h \ + $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libopencdk.{la,so*} \ + $(1)/usr/lib/ +endef + +define Package/libopencdk/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libopencdk.so.* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libopencdk)) diff --git a/libs/opencdk/patches/100-fix-tests-build b/libs/opencdk/patches/100-fix-tests-build new file mode 100644 index 0000000..c4df1a0 --- /dev/null +++ b/libs/opencdk/patches/100-fix-tests-build @@ -0,0 +1,22 @@ +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -34,7 +34,7 @@ + + CLEANFILES = plain-test + +-LDADD = ../src/libopencdk.la ++LDADD = ../src/libopencdk.la $(LIBGCRYPT_LIBS) + + if HAVE_W32_SYSTEM + # there is a problem with some tests and WINE +--- a/tests/Makefile.in ++++ b/tests/Makefile.in +@@ -258,7 +258,7 @@ + AM_LDFLAGS = -no-install + AM_CPPFLAGS = $(LIBGCRYPT_CFLAGS) + CLEANFILES = plain-test +-LDADD = ../src/libopencdk.la ++LDADD = ../src/libopencdk.la $(LIBGCRYPT_LIBS) + noinst_HEADER = t-support.h + all: all-am + diff --git a/libs/opencdk/patches/200-verify-clearsigned.patch b/libs/opencdk/patches/200-verify-clearsigned.patch new file mode 100644 index 0000000..a222aa8 --- /dev/null +++ b/libs/opencdk/patches/200-verify-clearsigned.patch @@ -0,0 +1,13 @@ +--- opencdk-0.6.6/src/stream.c 2007-11-08 19:31:45.000000000 +0100 ++++ opencdk-0.6.6-my/src/stream.c 2011-01-17 20:30:19.000000000 +0100 +@@ -1384,7 +1384,9 @@ + while (!cdk_stream_eof (s) && count > 0) + { + c = cdk_stream_getc (s); +- if (c == EOF || c == '\r' || c == '\n' ) ++ if (c == '\r') ++ c = cdk_stream_getc (s); ++ if (c == EOF || c == '\n' ) + { + buf[i++] = '\0'; + break; diff --git a/libs/openh323/Makefile b/libs/openh323/Makefile new file mode 100644 index 0000000..da1e985 --- /dev/null +++ b/libs/openh323/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2006-2007 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:=openh323 +PKG_VERSION:=cvs-20051230 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://trash.uid0.hu/openwrt/ +PKG_MD5SUM:=ba1ffd45016f533bec2bb1539b78e43a + +PKG_BUILD_DEPENDS:=pwlib + +include $(INCLUDE_DIR)/package.mk + +define Package/libopenh323 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=OpenH323 library + URL:=http://openh323.sourceforge.net/ +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-minsize \ + --enable-audio \ + --disable-video \ + --enable-localspeex \ + +CONFIGURE_VARS += \ + CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti" \ + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \ + CCFLAGS="$(TARGET_CFLAGS) $(FPIC)" \ + optnoshared + +define Build/InstallDev + ln -sf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR)/$(PKG_NAME) +endef + +$(eval $(call BuildPackage,libopenh323)) diff --git a/libs/openh323/patches/001-configure.patch b/libs/openh323/patches/001-configure.patch new file mode 100644 index 0000000..04ed8c5 --- /dev/null +++ b/libs/openh323/patches/001-configure.patch @@ -0,0 +1,122 @@ +--- openh323-cvs-20051230.orig/configure 2005-08-30 03:12:38.000000000 +0200 ++++ openh323-cvs-20051230/configure 2005-12-30 11:29:57.000000000 +0100 +@@ -3080,10 +3080,10 @@ + if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- test "$cross_compiling" = yes && +- { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} +- { (exit 1); exit 1; }; } ++# test "$cross_compiling" = yes && ++# { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 ++#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} ++# { (exit 1); exit 1; }; } + if test -r "${PWLIBDIR}/version.h"; then + eval "$as_ac_File=yes" + else +@@ -3104,10 +3104,10 @@ + if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- test "$cross_compiling" = yes && +- { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} +- { (exit 1); exit 1; }; } ++# test "$cross_compiling" = yes && ++# { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 ++#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} ++# { (exit 1); exit 1; }; } + if test -r "${OPENH323DIR}/../pwlib/version.h"; then + eval "$as_ac_File=yes" + else +@@ -3129,10 +3129,10 @@ + if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- test "$cross_compiling" = yes && +- { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} +- { (exit 1); exit 1; }; } ++# test "$cross_compiling" = yes && ++# { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 ++#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} ++# { (exit 1); exit 1; }; } + if test -r "${HOME}/pwlib/include/ptlib.h"; then + eval "$as_ac_File=yes" + else +@@ -3153,10 +3153,10 @@ + if test "${ac_cv_file__usr_local_include_ptlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- test "$cross_compiling" = yes && +- { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} +- { (exit 1); exit 1; }; } ++# test "$cross_compiling" = yes && ++# { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 ++#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} ++# { (exit 1); exit 1; }; } + if test -r "/usr/local/include/ptlib.h"; then + ac_cv_file__usr_local_include_ptlib_h=yes + else +@@ -3215,10 +3215,10 @@ + if test "${ac_cv_file__usr_include_ptlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- test "$cross_compiling" = yes && +- { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} +- { (exit 1); exit 1; }; } ++# test "$cross_compiling" = yes && ++# { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 ++#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} ++# { (exit 1); exit 1; }; } + if test -r "/usr/include/ptlib.h"; then + ac_cv_file__usr_include_ptlib_h=yes + else +@@ -3985,10 +3985,10 @@ + if test "${ac_cv_file__usr_local_include_ffmpeg_avcodec_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- test "$cross_compiling" = yes && +- { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} +- { (exit 1); exit 1; }; } ++# test "$cross_compiling" = yes && ++# { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 ++#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} ++# { (exit 1); exit 1; }; } + if test -r "/usr/local/include/ffmpeg/avcodec.h"; then + ac_cv_file__usr_local_include_ffmpeg_avcodec_h=yes + else +@@ -4193,10 +4193,10 @@ + if test "${ac_cv_file__usr_local_lib_libvich263_so+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- test "$cross_compiling" = yes && +- { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} +- { (exit 1); exit 1; }; } ++# test "$cross_compiling" = yes && ++# { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 ++#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} ++# { (exit 1); exit 1; }; } + if test -r "/usr/local/lib/libvich263.so"; then + ac_cv_file__usr_local_lib_libvich263_so=yes + else +@@ -4219,10 +4219,10 @@ + if test "${ac_cv_file__usr_local_include_vich263_encoder_h263_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- test "$cross_compiling" = yes && +- { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} +- { (exit 1); exit 1; }; } ++# test "$cross_compiling" = yes && ++# { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 ++#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} ++# { (exit 1); exit 1; }; } + if test -r "/usr/local/include/vich263/encoder-h263.h"; then + ac_cv_file__usr_local_include_vich263_encoder_h263_h=yes + else diff --git a/libs/openldap/Makefile b/libs/openldap/Makefile new file mode 100644 index 0000000..a9cb408 --- /dev/null +++ b/libs/openldap/Makefile @@ -0,0 +1,150 @@ +# +# Copyright (C) 2006-2012 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:=openldap +PKG_VERSION:=2.4.23 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/ \ + ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/ \ + ftp://ftp.nl.uu.net/pub/unix/db/openldap/openldap-release/ \ + ftp://ftp.plig.org/pub/OpenLDAP/openldap-release/ +PKG_MD5SUM:=90150b8c0d0192e10b30157e68844ddf + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/openldap/Default + TITLE:=LDAP implementation + URL:=http://www.openldap.org/ + MAINTAINER:=W. Michael Petullo +endef + +define Package/openldap/Default/description + OpenLDAP Software is an open source implementation of the + Lightweight Directory Access Protocol (LDAP). +endef + +define Package/libopenldap + $(call Package/openldap/Default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libopenssl +libsasl2 + TITLE+= (libraries) +endef + +define Package/libopenldap/description + $(call Package/openldap/Default/description) + This package contains the shared LDAP client libraries, needed by other programs. +endef + +define Package/libopenldap/conffiles +/etc/openldap/ldap.conf +endef + +define Package/openldap-utils + $(call Package/openldap/Default) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libopenldap + TITLE+= (utilities) +endef + +define Package/openldap-utils/description + $(call Package/openldap/Default/description) + This package contains client programs required to access LDAP servers. +endef + +define Package/openldap-server + $(call Package/openldap/Default) + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libopenldap +libuuid + TITLE+= (server) +endef + +define Package/openldap-server/description + $(call Package/openldap/Default/description) + This package contains server programs required to provide LDAP services. +endef + +define Package/openldap-server/conffiles +/etc/openldap/slapd.conf +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-debug \ + --enable-dynamic \ + --enable-syslog \ + --disable-local \ + --disable-slurpd \ + --with-cyrus-sasl \ + --without-fetch \ + --with-threads \ + --with-tls \ + --with-yielding_select="yes" \ + --without-cyrus-sasl \ + --without-threads \ + --without-tls \ + --enable-null \ + --disable-bdb \ + --disable-hdb \ + --disable-monitor \ + --disable-relay + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + HOSTCC="$(HOSTCC)" \ + depend all install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/{lber,ldap}*.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.{a,so*} $(1)/usr/lib/ +endef + +define Package/libopenldap/install + $(INSTALL_DIR) $(1)/etc/openldap + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/openldap/ldap.conf $(1)/etc/openldap/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.so.* $(1)/usr/lib/ +endef + +define Package/openldap-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/ldap* $(1)/usr/bin/ +endef + +define Package/openldap-server/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/ldap.init $(1)/etc/init.d/ldap + $(INSTALL_DIR) $(1)/etc/openldap/schema + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/openldap/schema/* $(1)/etc/openldap/schema/ + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/openldap/slapd.conf $(1)/etc/openldap/ + $(INSTALL_DIR) $(1)/usr/sbin + # XXX: OpenLDAP installs slapd into libexecdir, not sbindir: + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/slapd $(1)/usr/sbin/ + # XXX: switch default backend to ldif, since bdb is disabled + $(SED) 's|^\(database\)\([ \t]\+\)bdb|\1\2ldif|g' \ + -e 's|^\(index\)|#\1|g' \ + $(1)/etc/openldap/slapd.conf +endef + +$(eval $(call BuildPackage,libopenldap)) +$(eval $(call BuildPackage,openldap-utils)) +$(eval $(call BuildPackage,openldap-server)) diff --git a/libs/openldap/files/ldap.init b/libs/openldap/files/ldap.init new file mode 100644 index 0000000..b30bbf1 --- /dev/null +++ b/libs/openldap/files/ldap.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2011 OpenWrt.org + +START=60 + +SERVICE_USE_PID=1 + +start() { + mkdir -m 0755 -p /var/openldap-data + service_start /usr/sbin/slapd +} + +stop() { + service_stop /usr/sbin/slapd +} + +reload() { + service_reload /usr/sbin/slapd +} diff --git a/libs/openldap/patches/001-automake-compat.patch b/libs/openldap/patches/001-automake-compat.patch new file mode 100644 index 0000000..4ab2622 --- /dev/null +++ b/libs/openldap/patches/001-automake-compat.patch @@ -0,0 +1,312 @@ +--- /dev/null ++++ b/Makefile.am +@@ -0,0 +1 @@ ++SUBDIRS = include libraries clients servers tests doc +--- a/libraries/Makefile.in ++++ b/libraries/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SUBDIRS= \ + liblutil \ + liblber \ +--- a/libraries/liblber/Makefile.in ++++ b/libraries/liblber/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + LIBRARY = liblber.la + + NT_SRCS = nt_err.c +--- a/libraries/libldap/Makefile.in ++++ b/libraries/libldap/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + LIBRARY = libldap.la + + PROGRAMS = apitest dntest ftest ltest urltest +--- a/libraries/libldap_r/Makefile.in ++++ b/libraries/libldap_r/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + LIBRARY = libldap_r.la + + PROGRAMS = apitest ltest +--- a/libraries/liblunicode/Makefile.in ++++ b/libraries/liblunicode/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + LIBRARY = liblunicode.a + + XXDIR = $(srcdir)/ucdata/ +--- a/libraries/liblutil/Makefile.in ++++ b/libraries/liblutil/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + LIBRARY = liblutil.a + PROGRAM = testavl + +--- a/libraries/librewrite/Makefile.in ++++ b/libraries/librewrite/Makefile.in +@@ -16,6 +16,8 @@ + ## Copyright 2000-2001 Pierangelo Masarati + ## + ++SHELL = @SHELL@ ++ + SRCS = config.c context.c info.c ldapmap.c map.c params.c rule.c \ + session.c subst.c var.c xmap.c \ + parse.c rewrite.c +--- a/clients/tools/Makefile.in ++++ b/clients/tools/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SRCS = ldapsearch.c ldapmodify.c ldapdelete.c ldapmodrdn.c \ + ldappasswd.c ldapwhoami.c ldapcompare.c \ + ldapexop.c ldapurl.c common.c +--- a/servers/slapd/Makefile.in ++++ b/servers/slapd/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SLAPTOOLS=slapadd slapcat slapdn slapindex slappasswd slaptest slapauth slapacl slapschema + PROGRAMS=slapd $(SLAPTOOLS) + XPROGRAMS=sslapd libbackends.a .backend liboverlays.a +--- a/servers/slapd/overlays/Makefile.in ++++ b/servers/slapd/overlays/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SRCS = overlays.c \ + accesslog.c \ + auditlog.c \ +--- a/tests/progs/Makefile.in ++++ b/tests/progs/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + PROGRAMS = slapd-tester slapd-search slapd-read slapd-addel slapd-modrdn \ + slapd-modify slapd-bind ldif-filter + +--- a/servers/slapd/back-bdb/Makefile.in ++++ b/servers/slapd/back-bdb/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SRCS = init.c tools.c config.c \ + add.c bind.c compare.c delete.c modify.c modrdn.c search.c \ + extended.c referral.c operational.c \ +--- a/servers/slapd/back-dnssrv/Makefile.in ++++ b/servers/slapd/back-dnssrv/Makefile.in +@@ -18,6 +18,8 @@ + # The DNSSRV backend was written by Kurt D. Zeilenga. + # + ++SHELL = @SHELL@ ++ + SRCS = init.c bind.c search.c config.c referral.c + OBJS = init.lo bind.lo search.lo config.lo referral.lo + +--- a/servers/slapd/back-hdb/Makefile.in ++++ b/servers/slapd/back-hdb/Makefile.in +@@ -15,6 +15,8 @@ + # + ## Copyright 2003 Howard Chu @ Symas Corp. See master COPYRIGHT file for terms. + ++SHELL = @SHELL@ ++ + XXDIR = $(srcdir)/../back-bdb + + XXSRCS = init.c tools.c config.c \ +--- a/servers/slapd/back-ldap/Makefile.in ++++ b/servers/slapd/back-ldap/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SRCS = init.c config.c search.c bind.c unbind.c add.c compare.c \ + delete.c modify.c modrdn.c extended.c chain.c \ + distproc.c monitor.c pbind.c +--- a/servers/slapd/back-ldif/Makefile.in ++++ b/servers/slapd/back-ldif/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SRCS = ldif.c + OBJS = ldif.lo + +--- a/servers/slapd/back-meta/Makefile.in ++++ b/servers/slapd/back-meta/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SRCS = init.c config.c search.c bind.c unbind.c add.c compare.c \ + delete.c modify.c modrdn.c suffixmassage.c map.c \ + conn.c candidates.c dncache.c +--- a/servers/slapd/back-monitor/Makefile.in ++++ b/servers/slapd/back-monitor/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SRCS = init.c search.c compare.c modify.c bind.c \ + operational.c \ + cache.c entry.c \ +--- a/servers/slapd/back-ndb/Makefile.in ++++ b/servers/slapd/back-ndb/Makefile.in +@@ -17,6 +17,8 @@ + ## This work was initially developed by Howard Chu for inclusion + ## in OpenLDAP Software. This work was sponsored by MySQL. + ++SHELL = @SHELL@ ++ + SRCS = init.cpp tools.cpp config.cpp ndbio.cpp \ + add.cpp bind.cpp compare.cpp delete.cpp modify.cpp modrdn.cpp search.cpp + +--- a/servers/slapd/back-null/Makefile.in ++++ b/servers/slapd/back-null/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SRCS = null.c + OBJS = null.lo + +--- a/servers/slapd/back-passwd/Makefile.in ++++ b/servers/slapd/back-passwd/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SRCS = search.c config.c init.c + OBJS = search.lo config.lo init.lo + +--- a/servers/slapd/back-perl/Makefile.in ++++ b/servers/slapd/back-perl/Makefile.in +@@ -14,6 +14,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SRCS = init.c search.c close.c config.c bind.c compare.c \ + modify.c add.c modrdn.c delete.c + OBJS = init.lo search.lo close.lo config.lo bind.lo compare.lo \ +--- a/servers/slapd/back-relay/Makefile.in ++++ b/servers/slapd/back-relay/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SRCS = init.c op.c + OBJS = init.lo op.lo + +--- a/servers/slapd/back-shell/Makefile.in ++++ b/servers/slapd/back-shell/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SRCS = init.c config.c fork.c search.c bind.c unbind.c add.c \ + delete.c modify.c modrdn.c compare.c result.c + OBJS = init.lo config.lo fork.lo search.lo bind.lo unbind.lo add.lo \ +--- a/servers/slapd/back-sock/Makefile.in ++++ b/servers/slapd/back-sock/Makefile.in +@@ -17,6 +17,8 @@ + ## This work was initially developed by Brian Candler for inclusion + ## in OpenLDAP Software. + ++SHELL = @SHELL@ ++ + SRCS = init.c config.c opensock.c search.c bind.c unbind.c add.c \ + delete.c modify.c modrdn.c compare.c result.c + OBJS = init.lo config.lo opensock.lo search.lo bind.lo unbind.lo add.lo \ +--- a/servers/slapd/back-sql/Makefile.in ++++ b/servers/slapd/back-sql/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + SRCS = init.c config.c search.c bind.c compare.c operational.c \ + entry-id.c schema-map.c sql-wrap.c modify.c util.c \ + add.c delete.c modrdn.c api.c +--- a/servers/slapd/shell-backends/Makefile.in ++++ b/servers/slapd/shell-backends/Makefile.in +@@ -13,6 +13,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + PROGRAMS = passwd-shell + + SRCS = passwd-shell.c shellutil.c +--- a/servers/slapd/slapi/Makefile.in ++++ b/servers/slapd/slapi/Makefile.in +@@ -14,6 +14,8 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + ++SHELL = @SHELL@ ++ + LIBRARY = libslapi.la + + #all-common: $(LIBRARY) $(PROGRAMS) diff --git a/libs/openldap/patches/020-autofs-schema.patch b/libs/openldap/patches/020-autofs-schema.patch new file mode 100644 index 0000000..11c73f5 --- /dev/null +++ b/libs/openldap/patches/020-autofs-schema.patch @@ -0,0 +1,26 @@ +--- /dev/null ++++ b/servers/slapd/schema/autofs.schema +@@ -0,0 +1,23 @@ ++attributetype ( 1.3.6.1.1.1.1.31 NAME 'automountMapName' ++ DESC 'Automount map name' ++ EQUALITY caseExactMatch ++ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) ++ ++attributetype ( 1.3.6.1.1.1.1.32 NAME 'automountKey' ++ DESC 'Automount key value' ++ EQUALITY caseExactMatch ++ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) ++ ++attributetype ( 1.3.6.1.1.1.1.33 NAME 'automountInformation' ++ DESC 'Automount information' ++ EQUALITY caseExactMatch ++ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) ++ ++objectclass ( 1.3.6.1.1.1.2.16 NAME 'automountMap' SUP top STRUCTURAL ++ MUST ( automountMapName ) ++ MAY ( description ) ) ++ ++objectclass ( 1.3.6.1.1.1.2.17 NAME 'automount' SUP top STRUCTURAL ++ DESC 'Automount' ++ MUST ( automountKey $ automountInformation ) ++ MAY description ) diff --git a/libs/openldap/patches/750-no-strip.patch b/libs/openldap/patches/750-no-strip.patch new file mode 100644 index 0000000..e771dcb --- /dev/null +++ b/libs/openldap/patches/750-no-strip.patch @@ -0,0 +1,22 @@ +--- a/clients/tools/Makefile.in ++++ b/clients/tools/Makefile.in +@@ -122,7 +122,7 @@ install-local: FORCE + -$(MKDIR) $(DESTDIR)$(bindir) + @( \ + for prg in $(PROGRAMS); do \ +- $(LTINSTALL) $(INSTALLFLAGS) $(STRIP) -m 755 $$prg$(EXEEXT) \ ++ $(LTINSTALL) $(INSTALLFLAGS) -m 755 $$prg$(EXEEXT) \ + $(DESTDIR)$(bindir); \ + done \ + ) +--- a/servers/slapd/Makefile.in ++++ b/servers/slapd/Makefile.in +@@ -377,7 +377,7 @@ install-local-srv: install-slapd install + install-slapd: FORCE + -$(MKDIR) $(DESTDIR)$(libexecdir) + -$(MKDIR) $(DESTDIR)$(localstatedir)/run +- $(LTINSTALL) $(INSTALLFLAGS) $(STRIP) -m 755 \ ++ $(LTINSTALL) $(INSTALLFLAGS) -m 755 \ + slapd$(EXEEXT) $(DESTDIR)$(libexecdir) + @for i in $(SUBDIRS); do \ + if test -d $$i && test -f $$i/Makefile ; then \ diff --git a/libs/orbit2/Makefile b/libs/orbit2/Makefile new file mode 100644 index 0000000..306f98f --- /dev/null +++ b/libs/orbit2/Makefile @@ -0,0 +1,103 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=orbit2 +PKG_VERSION:=2.14.16 +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/ORBit2-$(PKG_VERSION) +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/ORBit2-$(PKG_VERSION) +PKG_SOURCE:=ORBit2-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@GNOME/ORBit2/2.14 +#PKG_MD5SUM:=d7fb9eb41e8196f1aacf2f08375ae555 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +PKG_INSTALL:=1 + +HOST_BUILD_DEPENDS:=libIDL2/host +PKG_BUILD_DEPENDS:=orbit2/host + +BIGENDIAN=no +ifeq ($(CONFIG_BIG_ENDIAN),y) + BIGENDIAN:=yes +endif + +CONFIGURE_VARS += \ + ac_cv_c_bigendian=$(BIGENDIAN) \ + ac_cv_alignof_CORBA_octet=1 \ + ac_cv_alignof_CORBA_boolean=1 \ + ac_cv_alignof_CORBA_char=1 \ + ac_cv_alignof_CORBA_wchar=2 \ + ac_cv_alignof_CORBA_short=2 \ + ac_cv_alignof_CORBA_long=4 \ + ac_cv_alignof_CORBA_long_long=4 \ + ac_cv_alignof_CORBA_float=4 \ + ac_cv_alignof_CORBA_double=4 \ + ac_cv_alignof_CORBA_long_double=4 \ + ac_cv_alignof_CORBA_struct=1 \ + ac_cv_alignof_CORBA_pointer=4 + +define Package/orbit2 + SECTION:=xorg-libraries + CATEGORY:=Xorg + SUBMENU:=libraries + TITLE:=ORBit2 + URL:=http://www.gnome.org/projects/ORBit2/ + DEPENDS:=+glib2 +libIDL2 +endef + +define Package/orbit2/description +ORBit2 is a CORBA 2.4-compliant Object Request Broker (ORB). +endef + +define Build/Configure + $(call Build/Configure/Default) + find $(PKG_BUILD_DIR) -name Makefile -exec sed -i 's,IDL_COMPILER.*orbit-idl-2,IDL_COMPILER = $(STAGING_DIR_HOST)/bin/orbit-idl-2,g' {} \; # tell orbit2 to use the host-built idl-compiler +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/{include/orbit-2.0,lib/pkgconfig} + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} \ + $(1)/usr/lib/ + + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \ + $(1)/usr/lib/pkgconfig/ + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/orbit-2.0/* \ + $(1)/usr/include/orbit-2.0/ + + $(INSTALL_DIR) $(1)/usr/share/aclocal + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/aclocal/* \ + $(1)/usr/share/aclocal/ + + $(INSTALL_DIR) $(1)/usr/share/idl/orbit-2.0 + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/idl/orbit-2.0/* \ + $(1)/usr/share/idl/orbit-2.0/ +endef + +define Package/orbit2/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libORBit*.so* \ + $(1)/usr/lib/ +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,orbit2)) diff --git a/libs/orbit2/patches/001-remove-libtool.patch b/libs/orbit2/patches/001-remove-libtool.patch new file mode 100644 index 0000000..fe83674 --- /dev/null +++ b/libs/orbit2/patches/001-remove-libtool.patch @@ -0,0 +1,6648 @@ +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -59,6645 +59,6 @@ AC_DEFUN([GTK_DOC_CHECK], + AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) + ]) + +-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +- +-# serial 52 AC_PROG_LIBTOOL +- +- +-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +-# ----------------------------------------------------------- +-# If this macro is not defined by Autoconf, define it here. +-m4_ifdef([AC_PROVIDE_IFELSE], +- [], +- [m4_define([AC_PROVIDE_IFELSE], +- [m4_ifdef([AC_PROVIDE_$1], +- [$2], [$3])])]) +- +- +-# AC_PROG_LIBTOOL +-# --------------- +-AC_DEFUN([AC_PROG_LIBTOOL], +-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. +- AC_PROVIDE_IFELSE([AC_PROG_CXX], +- [AC_LIBTOOL_CXX], +- [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX +- ])]) +-dnl And a similar setup for Fortran 77 support +- AC_PROVIDE_IFELSE([AC_PROG_F77], +- [AC_LIBTOOL_F77], +- [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +-])]) +- +-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. +- AC_PROVIDE_IFELSE([AC_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [ifdef([AC_PROG_GCJ], +- [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) +- ifdef([A][M_PROG_GCJ], +- [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) +- ifdef([LT_AC_PROG_GCJ], +- [define([LT_AC_PROG_GCJ], +- defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +-])])# AC_PROG_LIBTOOL +- +- +-# _AC_PROG_LIBTOOL +-# ---------------- +-AC_DEFUN([_AC_PROG_LIBTOOL], +-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl +- +-# This can be used to rebuild libtool when needed +-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" +- +-# Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' +-AC_SUBST(LIBTOOL)dnl +- +-# Prevent multiple expansion +-define([AC_PROG_LIBTOOL], []) +-])# _AC_PROG_LIBTOOL +- +- +-# AC_LIBTOOL_SETUP +-# ---------------- +-AC_DEFUN([AC_LIBTOOL_SETUP], +-[AC_PREREQ(2.50)dnl +-AC_REQUIRE([AC_ENABLE_SHARED])dnl +-AC_REQUIRE([AC_ENABLE_STATIC])dnl +-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +-AC_REQUIRE([AC_CANONICAL_HOST])dnl +-AC_REQUIRE([AC_CANONICAL_BUILD])dnl +-AC_REQUIRE([AC_PROG_CC])dnl +-AC_REQUIRE([AC_PROG_LD])dnl +-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +-AC_REQUIRE([AC_PROG_NM])dnl +- +-AC_REQUIRE([AC_PROG_LN_S])dnl +-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +-AC_REQUIRE([AC_OBJEXT])dnl +-AC_REQUIRE([AC_EXEEXT])dnl +-dnl +-AC_LIBTOOL_SYS_MAX_CMD_LEN +-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +-AC_LIBTOOL_OBJDIR +- +-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +-_LT_AC_PROG_ECHO_BACKSLASH +- +-case $host_os in +-aix3*) +- # AIX sometimes has problems with the GCC collect2 program. For some +- # reason, if we set the COLLECT_NAMES environment variable, the problems +- # vanish in a puff of smoke. +- if test "X${COLLECT_NAMES+set}" != Xset; then +- COLLECT_NAMES= +- export COLLECT_NAMES +- fi +- ;; +-esac +- +-# Sed substitution that helps us do robust quoting. It backslashifies +-# metacharacters that are still active within double-quoted strings. +-Xsed='sed -e 1s/^X//' +-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] +- +-# Same as above, but do not quote variable references. +-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] +- +-# Sed substitution to delay expansion of an escaped shell variable in a +-# double_quote_subst'ed string. +-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' +- +-# Sed substitution to avoid accidental globbing in evaled expressions +-no_glob_subst='s/\*/\\\*/g' +- +-# Constants: +-rm="rm -f" +- +-# Global variables: +-default_ofile=libtool +-can_build_shared=yes +- +-# All known linkers require a `.a' archive for static linking (except MSVC, +-# which needs '.lib'). +-libext=a +-ltmain="$ac_aux_dir/ltmain.sh" +-ofile="$default_ofile" +-with_gnu_ld="$lt_cv_prog_gnu_ld" +- +-AC_CHECK_TOOL(AR, ar, false) +-AC_CHECK_TOOL(RANLIB, ranlib, :) +-AC_CHECK_TOOL(STRIP, strip, :) +- +-old_CC="$CC" +-old_CFLAGS="$CFLAGS" +- +-# Set sane defaults for various variables +-test -z "$AR" && AR=ar +-test -z "$AR_FLAGS" && AR_FLAGS=cru +-test -z "$AS" && AS=as +-test -z "$CC" && CC=cc +-test -z "$LTCC" && LTCC=$CC +-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +-test -z "$DLLTOOL" && DLLTOOL=dlltool +-test -z "$LD" && LD=ld +-test -z "$LN_S" && LN_S="ln -s" +-test -z "$MAGIC_CMD" && MAGIC_CMD=file +-test -z "$NM" && NM=nm +-test -z "$SED" && SED=sed +-test -z "$OBJDUMP" && OBJDUMP=objdump +-test -z "$RANLIB" && RANLIB=: +-test -z "$STRIP" && STRIP=: +-test -z "$ac_objext" && ac_objext=o +- +-# Determine commands to create old-style static archives. +-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +-old_postinstall_cmds='chmod 644 $oldlib' +-old_postuninstall_cmds= +- +-if test -n "$RANLIB"; then +- case $host_os in +- openbsd*) +- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" +- ;; +- *) +- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" +- ;; +- esac +- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +-fi +- +-_LT_CC_BASENAME([$compiler]) +- +-# Only perform the check for file, if the check method requires it +-case $deplibs_check_method in +-file_magic*) +- if test "$file_magic_cmd" = '$MAGIC_CMD'; then +- AC_PATH_MAGIC +- fi +- ;; +-esac +- +-_LT_REQUIRED_DARWIN_CHECKS +- +-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +-enable_win32_dll=yes, enable_win32_dll=no) +- +-AC_ARG_ENABLE([libtool-lock], +- [AC_HELP_STRING([--disable-libtool-lock], +- [avoid locking (might break parallel builds)])]) +-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +- +-AC_ARG_WITH([pic], +- [AC_HELP_STRING([--with-pic], +- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], +- [pic_mode="$withval"], +- [pic_mode=default]) +-test -z "$pic_mode" && pic_mode=default +- +-# Use C for the default configuration in the libtool script +-tagname= +-AC_LIBTOOL_LANG_C_CONFIG +-_LT_AC_TAGCONFIG +-])# AC_LIBTOOL_SETUP +- +- +-# _LT_AC_SYS_COMPILER +-# ------------------- +-AC_DEFUN([_LT_AC_SYS_COMPILER], +-[AC_REQUIRE([AC_PROG_CC])dnl +- +-# If no C compiler was specified, use CC. +-LTCC=${LTCC-"$CC"} +- +-# If no C compiler flags were specified, use CFLAGS. +-LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +- +-# Allow CC to be a program name with arguments. +-compiler=$CC +-])# _LT_AC_SYS_COMPILER +- +- +-# _LT_CC_BASENAME(CC) +-# ------------------- +-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +-AC_DEFUN([_LT_CC_BASENAME], +-[for cc_temp in $1""; do +- case $cc_temp in +- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; +- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; +- \-*) ;; +- *) break;; +- esac +-done +-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +-]) +- +- +-# _LT_COMPILER_BOILERPLATE +-# ------------------------ +-# Check for compiler boilerplate output or warnings with +-# the simple compiler test code. +-AC_DEFUN([_LT_COMPILER_BOILERPLATE], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-ac_outfile=conftest.$ac_objext +-echo "$lt_simple_compile_test_code" >conftest.$ac_ext +-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +-_lt_compiler_boilerplate=`cat conftest.err` +-$rm conftest* +-])# _LT_COMPILER_BOILERPLATE +- +- +-# _LT_LINKER_BOILERPLATE +-# ---------------------- +-# Check for linker boilerplate output or warnings with +-# the simple link test code. +-AC_DEFUN([_LT_LINKER_BOILERPLATE], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-ac_outfile=conftest.$ac_objext +-echo "$lt_simple_link_test_code" >conftest.$ac_ext +-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +-_lt_linker_boilerplate=`cat conftest.err` +-$rm -r conftest* +-])# _LT_LINKER_BOILERPLATE +- +-# _LT_REQUIRED_DARWIN_CHECKS +-# -------------------------- +-# Check for some things on darwin +-AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[ +- case $host_os in +- rhapsody* | darwin*) +- AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) +- AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) +- +- AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], +- [lt_cv_apple_cc_single_mod=no +- if test -z "${LT_MULTI_MODULE}"; then +- # By default we will add the -single_module flag. You can override +- # by either setting the environment variable LT_MULTI_MODULE +- # non-empty at configure time, or by adding -multi_module to the +- # link flags. +- echo "int foo(void){return 1;}" > conftest.c +- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +- -dynamiclib ${wl}-single_module conftest.c +- if test -f libconftest.dylib; then +- lt_cv_apple_cc_single_mod=yes +- rm -rf libconftest.dylib* +- fi +- rm conftest.c +- fi]) +- AC_CACHE_CHECK([for -exported_symbols_list linker flag], +- [lt_cv_ld_exported_symbols_list], +- [lt_cv_ld_exported_symbols_list=no +- save_LDFLAGS=$LDFLAGS +- echo "_main" > conftest.sym +- LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" +- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], +- [lt_cv_ld_exported_symbols_list=yes], +- [lt_cv_ld_exported_symbols_list=no]) +- LDFLAGS="$save_LDFLAGS" +- ]) +- case $host_os in +- rhapsody* | darwin1.[[0123]]) +- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; +- darwin1.*) +- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; +- darwin*) +- # if running on 10.5 or later, the deployment target defaults +- # to the OS version, if on x86, and 10.4, the deployment +- # target defaults to 10.4. Don't you love it? +- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in +- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) +- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; +- 10.[[012]]*) +- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; +- 10.*) +- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; +- esac +- ;; +- esac +- if test "$lt_cv_apple_cc_single_mod" = "yes"; then +- _lt_dar_single_mod='$single_module' +- fi +- if test "$lt_cv_ld_exported_symbols_list" = "yes"; then +- _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' +- else +- _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" +- fi +- if test "$DSYMUTIL" != ":"; then +- _lt_dsymutil="~$DSYMUTIL \$lib || :" +- else +- _lt_dsymutil= +- fi +- ;; +- esac +-]) +- +-# _LT_AC_SYS_LIBPATH_AIX +-# ---------------------- +-# Links a minimal program and checks the executable +-# for the system default hardcoded library path. In most cases, +-# this is /usr/lib:/lib, but when the MPI compilers are used +-# the location of the communication and MPI libs are included too. +-# If we don't find anything, use the default library path according +-# to the aix ld manual. +-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi],[]) +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +-])# _LT_AC_SYS_LIBPATH_AIX +- +- +-# _LT_AC_SHELL_INIT(ARG) +-# ---------------------- +-AC_DEFUN([_LT_AC_SHELL_INIT], +-[ifdef([AC_DIVERSION_NOTICE], +- [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], +- [AC_DIVERT_PUSH(NOTICE)]) +-$1 +-AC_DIVERT_POP +-])# _LT_AC_SHELL_INIT +- +- +-# _LT_AC_PROG_ECHO_BACKSLASH +-# -------------------------- +-# Add some code to the start of the generated configure script which +-# will find an echo command which doesn't interpret backslashes. +-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +-[_LT_AC_SHELL_INIT([ +-# Check that we are running under the correct shell. +-SHELL=${CONFIG_SHELL-/bin/sh} +- +-case X$ECHO in +-X*--fallback-echo) +- # Remove one level of quotation (which was required for Make). +- ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` +- ;; +-esac +- +-echo=${ECHO-echo} +-if test "X[$]1" = X--no-reexec; then +- # Discard the --no-reexec flag, and continue. +- shift +-elif test "X[$]1" = X--fallback-echo; then +- # Avoid inline document here, it may be left over +- : +-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then +- # Yippee, $echo works! +- : +-else +- # Restart under the correct shell. +- exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +-fi +- +-if test "X[$]1" = X--fallback-echo; then +- # used as fallback echo +- shift +- cat </dev/null 2>&1 && unset CDPATH +- +-if test -z "$ECHO"; then +-if test "X${echo_test_string+set}" != Xset; then +-# find a string as large as possible, as long as the shell can cope with it +- for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do +- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... +- if (echo_test_string=`eval $cmd`) 2>/dev/null && +- echo_test_string=`eval $cmd` && +- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null +- then +- break +- fi +- done +-fi +- +-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- : +-else +- # The Solaris, AIX, and Digital Unix default echo programs unquote +- # backslashes. This makes it impossible to quote backslashes using +- # echo "$something" | sed 's/\\/\\\\/g' +- # +- # So, first we look for a working echo in the user's PATH. +- +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for dir in $PATH /usr/ucb; do +- IFS="$lt_save_ifs" +- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && +- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- echo="$dir/echo" +- break +- fi +- done +- IFS="$lt_save_ifs" +- +- if test "X$echo" = Xecho; then +- # We didn't find a better echo, so look for alternatives. +- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- # This shell has a builtin print -r that does the trick. +- echo='print -r' +- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && +- test "X$CONFIG_SHELL" != X/bin/ksh; then +- # If we have ksh, try running configure again with it. +- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} +- export ORIGINAL_CONFIG_SHELL +- CONFIG_SHELL=/bin/ksh +- export CONFIG_SHELL +- exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} +- else +- # Try using printf. +- echo='printf %s\n' +- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- # Cool, printf works +- : +- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && +- test "X$echo_testing_string" = 'X\t' && +- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL +- export CONFIG_SHELL +- SHELL="$CONFIG_SHELL" +- export SHELL +- echo="$CONFIG_SHELL [$]0 --fallback-echo" +- elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && +- test "X$echo_testing_string" = 'X\t' && +- echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- echo="$CONFIG_SHELL [$]0 --fallback-echo" +- else +- # maybe with a smaller string... +- prev=: +- +- for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do +- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null +- then +- break +- fi +- prev="$cmd" +- done +- +- if test "$prev" != 'sed 50q "[$]0"'; then +- echo_test_string=`eval $prev` +- export echo_test_string +- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} +- else +- # Oops. We lost completely, so just stick with echo. +- echo=echo +- fi +- fi +- fi +- fi +-fi +-fi +- +-# Copy echo and quote the copy suitably for passing to libtool from +-# the Makefile, instead of quoting the original, which is used later. +-ECHO=$echo +-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then +- ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +-fi +- +-AC_SUBST(ECHO) +-])])# _LT_AC_PROG_ECHO_BACKSLASH +- +- +-# _LT_AC_LOCK +-# ----------- +-AC_DEFUN([_LT_AC_LOCK], +-[AC_ARG_ENABLE([libtool-lock], +- [AC_HELP_STRING([--disable-libtool-lock], +- [avoid locking (might break parallel builds)])]) +-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +- +-# Some flags need to be propagated to the compiler or linker for good +-# libtool support. +-case $host in +-ia64-*-hpux*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.$ac_objext` in +- *ELF-32*) +- HPUX_IA64_MODE="32" +- ;; +- *ELF-64*) +- HPUX_IA64_MODE="64" +- ;; +- esac +- fi +- rm -rf conftest* +- ;; +-*-*-irix6*) +- # Find out which ABI we are using. +- echo '[#]line __oline__ "configure"' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- if test "$lt_cv_prog_gnu_ld" = yes; then +- case `/usr/bin/file conftest.$ac_objext` in +- *32-bit*) +- LD="${LD-ld} -melf32bsmip" +- ;; +- *N32*) +- LD="${LD-ld} -melf32bmipn32" +- ;; +- *64-bit*) +- LD="${LD-ld} -melf64bmip" +- ;; +- esac +- else +- case `/usr/bin/file conftest.$ac_objext` in +- *32-bit*) +- LD="${LD-ld} -32" +- ;; +- *N32*) +- LD="${LD-ld} -n32" +- ;; +- *64-bit*) +- LD="${LD-ld} -64" +- ;; +- esac +- fi +- fi +- rm -rf conftest* +- ;; +- +-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +-s390*-*linux*|sparc*-*linux*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.o` in +- *32-bit*) +- case $host in +- x86_64-*kfreebsd*-gnu) +- LD="${LD-ld} -m elf_i386_fbsd" +- ;; +- x86_64-*linux*) +- LD="${LD-ld} -m elf_i386" +- ;; +- ppc64-*linux*|powerpc64-*linux*) +- LD="${LD-ld} -m elf32ppclinux" +- ;; +- s390x-*linux*) +- LD="${LD-ld} -m elf_s390" +- ;; +- sparc64-*linux*) +- LD="${LD-ld} -m elf32_sparc" +- ;; +- esac +- ;; +- *64-bit*) +- libsuff=64 +- case $host in +- x86_64-*kfreebsd*-gnu) +- LD="${LD-ld} -m elf_x86_64_fbsd" +- ;; +- x86_64-*linux*) +- LD="${LD-ld} -m elf_x86_64" +- ;; +- ppc*-*linux*|powerpc*-*linux*) +- LD="${LD-ld} -m elf64ppc" +- ;; +- s390*-*linux*) +- LD="${LD-ld} -m elf64_s390" +- ;; +- sparc*-*linux*) +- LD="${LD-ld} -m elf64_sparc" +- ;; +- esac +- ;; +- esac +- fi +- rm -rf conftest* +- ;; +- +-*-*-sco3.2v5*) +- # On SCO OpenServer 5, we need -belf to get full-featured binaries. +- SAVE_CFLAGS="$CFLAGS" +- CFLAGS="$CFLAGS -belf" +- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, +- [AC_LANG_PUSH(C) +- AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) +- AC_LANG_POP]) +- if test x"$lt_cv_cc_needs_belf" != x"yes"; then +- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf +- CFLAGS="$SAVE_CFLAGS" +- fi +- ;; +-sparc*-*solaris*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.o` in +- *64-bit*) +- case $lt_cv_prog_gnu_ld in +- yes*) LD="${LD-ld} -m elf64_sparc" ;; +- *) +- if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then +- LD="${LD-ld} -64" +- fi +- ;; +- esac +- ;; +- esac +- fi +- rm -rf conftest* +- ;; +- +-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +-[*-*-cygwin* | *-*-mingw* | *-*-pw32*) +- AC_CHECK_TOOL(DLLTOOL, dlltool, false) +- AC_CHECK_TOOL(AS, as, false) +- AC_CHECK_TOOL(OBJDUMP, objdump, false) +- ;; +- ]) +-esac +- +-need_locks="$enable_libtool_lock" +- +-])# _LT_AC_LOCK +- +- +-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +-# ---------------------------------------------------------------- +-# Check whether the given compiler option works +-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +-[AC_REQUIRE([LT_AC_PROG_SED]) +-AC_CACHE_CHECK([$1], [$2], +- [$2=no +- ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) +- echo "$lt_simple_compile_test_code" > conftest.$ac_ext +- lt_compiler_flag="$3" +- # Insert the option either (1) after the last *FLAGS variable, or +- # (2) before a word containing "conftest.", or (3) at the end. +- # Note that $ac_compile itself does not contain backslashes and begins +- # with a dollar sign (not a hyphen), so the echo should work correctly. +- # The option is referenced via a variable to avoid confusing sed. +- lt_compile=`echo "$ac_compile" | $SED \ +- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ +- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ +- -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) +- (eval "$lt_compile" 2>conftest.err) +- ac_status=$? +- cat conftest.err >&AS_MESSAGE_LOG_FD +- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD +- if (exit $ac_status) && test -s "$ac_outfile"; then +- # The compiler can only warn and ignore the option if not recognized +- # So say no if there are warnings other than the usual output. +- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp +- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 +- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then +- $2=yes +- fi +- fi +- $rm conftest* +-]) +- +-if test x"[$]$2" = xyes; then +- ifelse([$5], , :, [$5]) +-else +- ifelse([$6], , :, [$6]) +-fi +-])# AC_LIBTOOL_COMPILER_OPTION +- +- +-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +-# [ACTION-SUCCESS], [ACTION-FAILURE]) +-# ------------------------------------------------------------ +-# Check whether the given compiler option works +-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_CACHE_CHECK([$1], [$2], +- [$2=no +- save_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS $3" +- echo "$lt_simple_link_test_code" > conftest.$ac_ext +- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then +- # The linker can only warn and ignore the option if not recognized +- # So say no if there are warnings +- if test -s conftest.err; then +- # Append any errors to the config.log. +- cat conftest.err 1>&AS_MESSAGE_LOG_FD +- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp +- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 +- if diff conftest.exp conftest.er2 >/dev/null; then +- $2=yes +- fi +- else +- $2=yes +- fi +- fi +- $rm -r conftest* +- LDFLAGS="$save_LDFLAGS" +-]) +- +-if test x"[$]$2" = xyes; then +- ifelse([$4], , :, [$4]) +-else +- ifelse([$5], , :, [$5]) +-fi +-])# AC_LIBTOOL_LINKER_OPTION +- +- +-# AC_LIBTOOL_SYS_MAX_CMD_LEN +-# -------------------------- +-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +-[# find the maximum length of command line arguments +-AC_MSG_CHECKING([the maximum length of command line arguments]) +-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl +- i=0 +- teststring="ABCD" +- +- case $build_os in +- msdosdjgpp*) +- # On DJGPP, this test can blow up pretty badly due to problems in libc +- # (any single argument exceeding 2000 bytes causes a buffer overrun +- # during glob expansion). Even if it were fixed, the result of this +- # check would be larger than it should be. +- lt_cv_sys_max_cmd_len=12288; # 12K is about right +- ;; +- +- gnu*) +- # Under GNU Hurd, this test is not required because there is +- # no limit to the length of command line arguments. +- # Libtool will interpret -1 as no limit whatsoever +- lt_cv_sys_max_cmd_len=-1; +- ;; +- +- cygwin* | mingw*) +- # On Win9x/ME, this test blows up -- it succeeds, but takes +- # about 5 minutes as the teststring grows exponentially. +- # Worse, since 9x/ME are not pre-emptively multitasking, +- # you end up with a "frozen" computer, even though with patience +- # the test eventually succeeds (with a max line length of 256k). +- # Instead, let's just punt: use the minimum linelength reported by +- # all of the supported platforms: 8192 (on NT/2K/XP). +- lt_cv_sys_max_cmd_len=8192; +- ;; +- +- amigaos*) +- # On AmigaOS with pdksh, this test takes hours, literally. +- # So we just punt and use a minimum line length of 8192. +- lt_cv_sys_max_cmd_len=8192; +- ;; +- +- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) +- # This has been around since 386BSD, at least. Likely further. +- if test -x /sbin/sysctl; then +- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` +- elif test -x /usr/sbin/sysctl; then +- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` +- else +- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs +- fi +- # And add a safety zone +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` +- ;; +- +- interix*) +- # We know the value 262144 and hardcode it with a safety zone (like BSD) +- lt_cv_sys_max_cmd_len=196608 +- ;; +- +- osf*) +- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure +- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not +- # nice to cause kernel panics so lets avoid the loop below. +- # First set a reasonable default. +- lt_cv_sys_max_cmd_len=16384 +- # +- if test -x /sbin/sysconfig; then +- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in +- *1*) lt_cv_sys_max_cmd_len=-1 ;; +- esac +- fi +- ;; +- sco3.2v5*) +- lt_cv_sys_max_cmd_len=102400 +- ;; +- sysv5* | sco5v6* | sysv4.2uw2*) +- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` +- if test -n "$kargmax"; then +- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` +- else +- lt_cv_sys_max_cmd_len=32768 +- fi +- ;; +- *) +- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` +- if test -n "$lt_cv_sys_max_cmd_len"; then +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` +- else +- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} +- while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ +- = "XX$teststring") >/dev/null 2>&1 && +- new_result=`expr "X$teststring" : ".*" 2>&1` && +- lt_cv_sys_max_cmd_len=$new_result && +- test $i != 17 # 1/2 MB should be enough +- do +- i=`expr $i + 1` +- teststring=$teststring$teststring +- done +- teststring= +- # Add a significant safety factor because C++ compilers can tack on massive +- # amounts of additional arguments before passing them to the linker. +- # It appears as though 1/2 is a usable value. +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` +- fi +- ;; +- esac +-]) +-if test -n $lt_cv_sys_max_cmd_len ; then +- AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +-else +- AC_MSG_RESULT(none) +-fi +-])# AC_LIBTOOL_SYS_MAX_CMD_LEN +- +- +-# _LT_AC_CHECK_DLFCN +-# ------------------ +-AC_DEFUN([_LT_AC_CHECK_DLFCN], +-[AC_CHECK_HEADERS(dlfcn.h)dnl +-])# _LT_AC_CHECK_DLFCN +- +- +-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +-# --------------------------------------------------------------------- +-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +-if test "$cross_compiling" = yes; then : +- [$4] +-else +- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 +- lt_status=$lt_dlunknown +- cat > conftest.$ac_ext < +-#endif +- +-#include +- +-#ifdef RTLD_GLOBAL +-# define LT_DLGLOBAL RTLD_GLOBAL +-#else +-# ifdef DL_GLOBAL +-# define LT_DLGLOBAL DL_GLOBAL +-# else +-# define LT_DLGLOBAL 0 +-# endif +-#endif +- +-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we +- find out it does not work in some platform. */ +-#ifndef LT_DLLAZY_OR_NOW +-# ifdef RTLD_LAZY +-# define LT_DLLAZY_OR_NOW RTLD_LAZY +-# else +-# ifdef DL_LAZY +-# define LT_DLLAZY_OR_NOW DL_LAZY +-# else +-# ifdef RTLD_NOW +-# define LT_DLLAZY_OR_NOW RTLD_NOW +-# else +-# ifdef DL_NOW +-# define LT_DLLAZY_OR_NOW DL_NOW +-# else +-# define LT_DLLAZY_OR_NOW 0 +-# endif +-# endif +-# endif +-# endif +-#endif +- +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif +- +-void fnord() { int i=42;} +-int main () +-{ +- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +- int status = $lt_dlunknown; +- +- if (self) +- { +- if (dlsym (self,"fnord")) status = $lt_dlno_uscore; +- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; +- /* dlclose (self); */ +- } +- else +- puts (dlerror ()); +- +- exit (status); +-}] +-EOF +- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then +- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null +- lt_status=$? +- case x$lt_status in +- x$lt_dlno_uscore) $1 ;; +- x$lt_dlneed_uscore) $2 ;; +- x$lt_dlunknown|x*) $3 ;; +- esac +- else : +- # compilation failed +- $3 +- fi +-fi +-rm -fr conftest* +-])# _LT_AC_TRY_DLOPEN_SELF +- +- +-# AC_LIBTOOL_DLOPEN_SELF +-# ---------------------- +-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +-if test "x$enable_dlopen" != xyes; then +- enable_dlopen=unknown +- enable_dlopen_self=unknown +- enable_dlopen_self_static=unknown +-else +- lt_cv_dlopen=no +- lt_cv_dlopen_libs= +- +- case $host_os in +- beos*) +- lt_cv_dlopen="load_add_on" +- lt_cv_dlopen_libs= +- lt_cv_dlopen_self=yes +- ;; +- +- mingw* | pw32*) +- lt_cv_dlopen="LoadLibrary" +- lt_cv_dlopen_libs= +- ;; +- +- cygwin*) +- lt_cv_dlopen="dlopen" +- lt_cv_dlopen_libs= +- ;; +- +- darwin*) +- # if libdl is installed we need to link against it +- AC_CHECK_LIB([dl], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ +- lt_cv_dlopen="dyld" +- lt_cv_dlopen_libs= +- lt_cv_dlopen_self=yes +- ]) +- ;; +- +- *) +- AC_CHECK_FUNC([shl_load], +- [lt_cv_dlopen="shl_load"], +- [AC_CHECK_LIB([dld], [shl_load], +- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], +- [AC_CHECK_FUNC([dlopen], +- [lt_cv_dlopen="dlopen"], +- [AC_CHECK_LIB([dl], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], +- [AC_CHECK_LIB([svld], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], +- [AC_CHECK_LIB([dld], [dld_link], +- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) +- ]) +- ]) +- ]) +- ]) +- ]) +- ;; +- esac +- +- if test "x$lt_cv_dlopen" != xno; then +- enable_dlopen=yes +- else +- enable_dlopen=no +- fi +- +- case $lt_cv_dlopen in +- dlopen) +- save_CPPFLAGS="$CPPFLAGS" +- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" +- +- save_LDFLAGS="$LDFLAGS" +- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" +- +- save_LIBS="$LIBS" +- LIBS="$lt_cv_dlopen_libs $LIBS" +- +- AC_CACHE_CHECK([whether a program can dlopen itself], +- lt_cv_dlopen_self, [dnl +- _LT_AC_TRY_DLOPEN_SELF( +- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, +- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) +- ]) +- +- if test "x$lt_cv_dlopen_self" = xyes; then +- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" +- AC_CACHE_CHECK([whether a statically linked program can dlopen itself], +- lt_cv_dlopen_self_static, [dnl +- _LT_AC_TRY_DLOPEN_SELF( +- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, +- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) +- ]) +- fi +- +- CPPFLAGS="$save_CPPFLAGS" +- LDFLAGS="$save_LDFLAGS" +- LIBS="$save_LIBS" +- ;; +- esac +- +- case $lt_cv_dlopen_self in +- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; +- *) enable_dlopen_self=unknown ;; +- esac +- +- case $lt_cv_dlopen_self_static in +- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; +- *) enable_dlopen_self_static=unknown ;; +- esac +-fi +-])# AC_LIBTOOL_DLOPEN_SELF +- +- +-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +-# --------------------------------- +-# Check to see if options -c and -o are simultaneously supported by compiler +-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], +- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], +- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no +- $rm -r conftest 2>/dev/null +- mkdir conftest +- cd conftest +- mkdir out +- echo "$lt_simple_compile_test_code" > conftest.$ac_ext +- +- lt_compiler_flag="-o out/conftest2.$ac_objext" +- # Insert the option either (1) after the last *FLAGS variable, or +- # (2) before a word containing "conftest.", or (3) at the end. +- # Note that $ac_compile itself does not contain backslashes and begins +- # with a dollar sign (not a hyphen), so the echo should work correctly. +- lt_compile=`echo "$ac_compile" | $SED \ +- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ +- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ +- -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) +- (eval "$lt_compile" 2>out/conftest.err) +- ac_status=$? +- cat out/conftest.err >&AS_MESSAGE_LOG_FD +- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD +- if (exit $ac_status) && test -s out/conftest2.$ac_objext +- then +- # The compiler can only warn and ignore the option if not recognized +- # So say no if there are warnings +- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp +- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 +- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then +- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes +- fi +- fi +- chmod u+w . 2>&AS_MESSAGE_LOG_FD +- $rm conftest* +- # SGI C++ compiler will create directory out/ii_files/ for +- # template instantiation +- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files +- $rm out/* && rmdir out +- cd .. +- rmdir conftest +- $rm conftest* +-]) +-])# AC_LIBTOOL_PROG_CC_C_O +- +- +-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +-# ----------------------------------------- +-# Check to see if we can do hard links to lock some files if needed +-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +-[AC_REQUIRE([_LT_AC_LOCK])dnl +- +-hard_links="nottested" +-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then +- # do not overwrite the value of need_locks provided by the user +- AC_MSG_CHECKING([if we can lock with hard links]) +- hard_links=yes +- $rm conftest* +- ln conftest.a conftest.b 2>/dev/null && hard_links=no +- touch conftest.a +- ln conftest.a conftest.b 2>&5 || hard_links=no +- ln conftest.a conftest.b 2>/dev/null && hard_links=no +- AC_MSG_RESULT([$hard_links]) +- if test "$hard_links" = no; then +- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) +- need_locks=warn +- fi +-else +- need_locks=no +-fi +-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS +- +- +-# AC_LIBTOOL_OBJDIR +-# ----------------- +-AC_DEFUN([AC_LIBTOOL_OBJDIR], +-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +-[rm -f .libs 2>/dev/null +-mkdir .libs 2>/dev/null +-if test -d .libs; then +- lt_cv_objdir=.libs +-else +- # MS-DOS does not allow filenames that begin with a dot. +- lt_cv_objdir=_libs +-fi +-rmdir .libs 2>/dev/null]) +-objdir=$lt_cv_objdir +-])# AC_LIBTOOL_OBJDIR +- +- +-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +-# ---------------------------------------------- +-# Check hardcoding attributes. +-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +-[AC_MSG_CHECKING([how to hardcode library paths into programs]) +-_LT_AC_TAGVAR(hardcode_action, $1)= +-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ +- test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ +- test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then +- +- # We can hardcode non-existant directories. +- if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && +- # If the only mechanism to avoid hardcoding is shlibpath_var, we +- # have to relink, otherwise we might link with an installed library +- # when we should be linking with a yet-to-be-installed one +- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && +- test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then +- # Linking always hardcodes the temporary library directory. +- _LT_AC_TAGVAR(hardcode_action, $1)=relink +- else +- # We can link without hardcoding, and we can hardcode nonexisting dirs. +- _LT_AC_TAGVAR(hardcode_action, $1)=immediate +- fi +-else +- # We cannot hardcode anything, or else we can only hardcode existing +- # directories. +- _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +-fi +-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) +- +-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then +- # Fast installation is not supported +- enable_fast_install=no +-elif test "$shlibpath_overrides_runpath" = yes || +- test "$enable_shared" = no; then +- # Fast installation is not necessary +- enable_fast_install=needless +-fi +-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH +- +- +-# AC_LIBTOOL_SYS_LIB_STRIP +-# ------------------------ +-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +-[striplib= +-old_striplib= +-AC_MSG_CHECKING([whether stripping libraries is possible]) +-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then +- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" +- test -z "$striplib" && striplib="$STRIP --strip-unneeded" +- AC_MSG_RESULT([yes]) +-else +-# FIXME - insert some real tests, host_os isn't really good enough +- case $host_os in +- darwin*) +- if test -n "$STRIP" ; then +- striplib="$STRIP -x" +- old_striplib="$STRIP -S" +- AC_MSG_RESULT([yes]) +- else +- AC_MSG_RESULT([no]) +-fi +- ;; +- *) +- AC_MSG_RESULT([no]) +- ;; +- esac +-fi +-])# AC_LIBTOOL_SYS_LIB_STRIP +- +- +-# AC_LIBTOOL_SYS_DYNAMIC_LINKER +-# ----------------------------- +-# PORTME Fill in your ld.so characteristics +-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_MSG_CHECKING([dynamic linker characteristics]) +-library_names_spec= +-libname_spec='lib$name' +-soname_spec= +-shrext_cmds=".so" +-postinstall_cmds= +-postuninstall_cmds= +-finish_cmds= +-finish_eval= +-shlibpath_var= +-shlibpath_overrides_runpath=unknown +-version_type=none +-dynamic_linker="$host_os ld.so" +-sys_lib_dlsearch_path_spec="/lib /usr/lib" +-m4_if($1,[],[ +-if test "$GCC" = yes; then +- case $host_os in +- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; +- *) lt_awk_arg="/^libraries:/" ;; +- esac +- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` +- if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then +- # if the path contains ";" then we assume it to be the separator +- # otherwise default to the standard path separator (i.e. ":") - it is +- # assumed that no part of a normal pathname contains ";" but that should +- # okay in the real world where ";" in dirpaths is itself problematic. +- lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` +- else +- lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` +- fi +- # Ok, now we have the path, separated by spaces, we can step through it +- # and add multilib dir if necessary. +- lt_tmp_lt_search_path_spec= +- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` +- for lt_sys_path in $lt_search_path_spec; do +- if test -d "$lt_sys_path/$lt_multi_os_dir"; then +- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" +- else +- test -d "$lt_sys_path" && \ +- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" +- fi +- done +- lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' +-BEGIN {RS=" "; FS="/|\n";} { +- lt_foo=""; +- lt_count=0; +- for (lt_i = NF; lt_i > 0; lt_i--) { +- if ($lt_i != "" && $lt_i != ".") { +- if ($lt_i == "..") { +- lt_count++; +- } else { +- if (lt_count == 0) { +- lt_foo="/" $lt_i lt_foo; +- } else { +- lt_count--; +- } +- } +- } +- } +- if (lt_foo != "") { lt_freq[[lt_foo]]++; } +- if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +-}'` +- sys_lib_search_path_spec=`echo $lt_search_path_spec` +-else +- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +-fi]) +-need_lib_prefix=unknown +-hardcode_into_libs=no +- +-# when you set need_version to no, make sure it does not cause -set_version +-# flags to be left without arguments +-need_version=unknown +- +-case $host_os in +-aix3*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' +- shlibpath_var=LIBPATH +- +- # AIX 3 has no versioning support, so we append a major version to the name. +- soname_spec='${libname}${release}${shared_ext}$major' +- ;; +- +-aix[[4-9]]*) +- version_type=linux +- need_lib_prefix=no +- need_version=no +- hardcode_into_libs=yes +- if test "$host_cpu" = ia64; then +- # AIX 5 supports IA64 +- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- else +- # With GCC up to 2.95.x, collect2 would create an import file +- # for dependence libraries. The import file would start with +- # the line `#! .'. This would cause the generated library to +- # depend on `.', always an invalid library. This was fixed in +- # development snapshots of GCC prior to 3.0. +- case $host_os in +- aix4 | aix4.[[01]] | aix4.[[01]].*) +- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' +- echo ' yes ' +- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then +- : +- else +- can_build_shared=no +- fi +- ;; +- esac +- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct +- # soname into executable. Probably we can add versioning support to +- # collect2, so additional links can be useful in future. +- if test "$aix_use_runtimelinking" = yes; then +- # If using run time linking (on AIX 4.2 or later) use lib.so +- # instead of lib.a to let people know that these are not +- # typical AIX shared libraries. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- else +- # We preserve .a as extension for shared libraries through AIX4.2 +- # and later when we are not doing run time linking. +- library_names_spec='${libname}${release}.a $libname.a' +- soname_spec='${libname}${release}${shared_ext}$major' +- fi +- shlibpath_var=LIBPATH +- fi +- ;; +- +-amigaos*) +- library_names_spec='$libname.ixlibrary $libname.a' +- # Create ${libname}_ixlibrary.a entries in /sys/libs. +- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' +- ;; +- +-beos*) +- library_names_spec='${libname}${shared_ext}' +- dynamic_linker="$host_os ld.so" +- shlibpath_var=LIBRARY_PATH +- ;; +- +-bsdi[[45]]*) +- version_type=linux +- 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' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" +- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" +- # the default ld.so.conf also contains /usr/contrib/lib and +- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow +- # libtool to hard-code these into programs +- ;; +- +-cygwin* | mingw* | pw32*) +- version_type=windows +- shrext_cmds=".dll" +- need_version=no +- need_lib_prefix=no +- +- case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32*) +- library_names_spec='$libname.dll.a' +- # DLL is installed to $(libdir)/../bin by postinstall_cmds +- postinstall_cmds='base_file=`basename \${file}`~ +- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ +- dldir=$destdir/`dirname \$dlpath`~ +- test -d \$dldir || mkdir -p \$dldir~ +- $install_prog $dir/$dlname \$dldir/$dlname~ +- chmod a+x \$dldir/$dlname' +- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ +- dlpath=$dir/\$dldll~ +- $rm \$dlpath' +- shlibpath_overrides_runpath=yes +- +- case $host_os in +- cygwin*) +- # Cygwin DLLs use 'cyg' prefix rather than 'lib' +- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +- ;; +- mingw*) +- # MinGW DLLs use traditional 'lib' prefix +- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` +- if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then +- # It is most probably a Windows format PATH printed by +- # mingw gcc, but we are running on Cygwin. Gcc prints its search +- # path with ; separators, and with drive letters. We can handle the +- # drive letters (cygwin fileutils understands them), so leave them, +- # especially as we might pass files found there to a mingw objdump, +- # which wouldn't understand a cygwinified path. Ahh. +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` +- else +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` +- fi +- ;; +- pw32*) +- # pw32 DLLs use 'pw' prefix rather than 'lib' +- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- ;; +- esac +- ;; +- +- *) +- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' +- ;; +- esac +- dynamic_linker='Win32 ld.exe' +- # FIXME: first we should search . and the directory the executable is in +- shlibpath_var=PATH +- ;; +- +-darwin* | rhapsody*) +- dynamic_linker="$host_os dyld" +- version_type=darwin +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' +- soname_spec='${libname}${release}${major}$shared_ext' +- shlibpath_overrides_runpath=yes +- shlibpath_var=DYLD_LIBRARY_PATH +- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +- m4_if([$1], [],[ +- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) +- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' +- ;; +- +-dgux*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- ;; +- +-freebsd1*) +- dynamic_linker=no +- ;; +- +-freebsd* | dragonfly*) +- # DragonFly does not have aout. When/if they implement a new +- # versioning mechanism, adjust this. +- if test -x /usr/bin/objformat; then +- objformat=`/usr/bin/objformat` +- else +- case $host_os in +- freebsd[[123]]*) objformat=aout ;; +- *) objformat=elf ;; +- esac +- fi +- version_type=freebsd-$objformat +- case $version_type in +- freebsd-elf*) +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' +- need_version=no +- need_lib_prefix=no +- ;; +- freebsd-*) +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' +- need_version=yes +- ;; +- esac +- shlibpath_var=LD_LIBRARY_PATH +- case $host_os in +- freebsd2*) +- shlibpath_overrides_runpath=yes +- ;; +- freebsd3.[[01]]* | freebsdelf3.[[01]]*) +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- ;; +- freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ +- freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- ;; +- *) # from 4.6 on, and DragonFly +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- ;; +- esac +- ;; +- +-gnu*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- hardcode_into_libs=yes +- ;; +- +-hpux9* | hpux10* | hpux11*) +- # Give a soname corresponding to the major version so that dld.sl refuses to +- # link against other versions. +- version_type=sunos +- need_lib_prefix=no +- need_version=no +- case $host_cpu in +- ia64*) +- shrext_cmds='.so' +- hardcode_into_libs=yes +- dynamic_linker="$host_os dld.so" +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- if test "X$HPUX_IA64_MODE" = X32; then +- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" +- else +- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" +- fi +- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec +- ;; +- hppa*64*) +- shrext_cmds='.sl' +- hardcode_into_libs=yes +- dynamic_linker="$host_os dld.sl" +- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH +- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" +- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec +- ;; +- *) +- shrext_cmds='.sl' +- dynamic_linker="$host_os dld.sl" +- shlibpath_var=SHLIB_PATH +- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- ;; +- esac +- # HP-UX runs *really* slowly unless shared libraries are mode 555. +- postinstall_cmds='chmod 555 $lib' +- ;; +- +-interix[[3-9]]*) +- version_type=linux +- need_lib_prefix=no +- 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' +- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- ;; +- +-irix5* | irix6* | nonstopux*) +- case $host_os in +- nonstopux*) version_type=nonstopux ;; +- *) +- if test "$lt_cv_prog_gnu_ld" = yes; then +- version_type=linux +- else +- version_type=irix +- fi ;; +- esac +- need_lib_prefix=no +- need_version=no +- soname_spec='${libname}${release}${shared_ext}$major' +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' +- case $host_os in +- irix5* | nonstopux*) +- libsuff= shlibsuff= +- ;; +- *) +- case $LD in # libtool.m4 will add one of these switches to LD +- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") +- libsuff= shlibsuff= libmagic=32-bit;; +- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") +- libsuff=32 shlibsuff=N32 libmagic=N32;; +- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") +- libsuff=64 shlibsuff=64 libmagic=64-bit;; +- *) libsuff= shlibsuff= libmagic=never-match;; +- esac +- ;; +- esac +- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH +- shlibpath_overrides_runpath=no +- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" +- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" +- hardcode_into_libs=yes +- ;; +- +-# No shared lib support for Linux oldld, aout, or coff. +-linux*oldld* | linux*aout* | linux*coff*) +- dynamic_linker=no +- ;; +- +-# This must be Linux ELF. +-linux* | k*bsd*-gnu) +- version_type=linux +- need_lib_prefix=no +- 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' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- # This implies no fast_install, which is unacceptable. +- # Some rework will be needed to allow for fast_install +- # before this can be enabled. +- hardcode_into_libs=yes +- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" +- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" +- +- # Append ld.so.conf contents to the search path +- if test -f /etc/ld.so.conf; then +- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" +- fi +- +- # We used to test for /lib/ld.so.1 and disable shared libraries on +- # powerpc, because MkLinux only supported shared libraries with the +- # GNU dynamic linker. Since this was broken with cross compilers, +- # most powerpc-linux boxes support dynamic linking these days and +- # people can always --disable-shared, the test was removed, and we +- # assume the GNU/Linux dynamic linker is in use. +- dynamic_linker='GNU/Linux ld.so' +- ;; +- +-netbsd*) +- version_type=sunos +- need_lib_prefix=no +- need_version=no +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' +- dynamic_linker='NetBSD (a.out) ld.so' +- else +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- dynamic_linker='NetBSD ld.elf_so' +- fi +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- ;; +- +-newsos6) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- ;; +- +-nto-qnx*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- ;; +- +-openbsd*) +- version_type=sunos +- sys_lib_dlsearch_path_spec="/usr/lib" +- need_lib_prefix=no +- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. +- case $host_os in +- openbsd3.3 | openbsd3.3.*) need_version=yes ;; +- *) need_version=no ;; +- esac +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- case $host_os in +- openbsd2.[[89]] | openbsd2.[[89]].*) +- shlibpath_overrides_runpath=no +- ;; +- *) +- shlibpath_overrides_runpath=yes +- ;; +- esac +- else +- shlibpath_overrides_runpath=yes +- fi +- ;; +- +-os2*) +- libname_spec='$name' +- shrext_cmds=".dll" +- need_lib_prefix=no +- library_names_spec='$libname${shared_ext} $libname.a' +- dynamic_linker='OS/2 ld.exe' +- shlibpath_var=LIBPATH +- ;; +- +-osf3* | osf4* | osf5*) +- version_type=osf +- need_lib_prefix=no +- need_version=no +- soname_spec='${libname}${release}${shared_ext}$major' +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" +- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" +- ;; +- +-rdos*) +- dynamic_linker=no +- ;; +- +-solaris*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- # ldd complains unless libraries are executable +- postinstall_cmds='chmod +x $lib' +- ;; +- +-sunos4*) +- version_type=sunos +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- if test "$with_gnu_ld" = yes; then +- need_lib_prefix=no +- fi +- need_version=yes +- ;; +- +-sysv4 | sysv4.3*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- case $host_vendor in +- sni) +- shlibpath_overrides_runpath=no +- need_lib_prefix=no +- export_dynamic_flag_spec='${wl}-Blargedynsym' +- runpath_var=LD_RUN_PATH +- ;; +- siemens) +- need_lib_prefix=no +- ;; +- motorola) +- need_lib_prefix=no +- need_version=no +- shlibpath_overrides_runpath=no +- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' +- ;; +- esac +- ;; +- +-sysv4*MP*) +- if test -d /usr/nec ;then +- version_type=linux +- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' +- soname_spec='$libname${shared_ext}.$major' +- shlibpath_var=LD_LIBRARY_PATH +- fi +- ;; +- +-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) +- version_type=freebsd-elf +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- hardcode_into_libs=yes +- if test "$with_gnu_ld" = yes; then +- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' +- shlibpath_overrides_runpath=no +- else +- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' +- shlibpath_overrides_runpath=yes +- case $host_os in +- sco3.2v5*) +- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" +- ;; +- esac +- fi +- sys_lib_dlsearch_path_spec='/usr/lib' +- ;; +- +-uts4*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- ;; +- +-*) +- dynamic_linker=no +- ;; +-esac +-AC_MSG_RESULT([$dynamic_linker]) +-test "$dynamic_linker" = no && can_build_shared=no +- +-AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec], +-[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"]) +-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +-AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec], +-[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"]) +-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +- +-variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +-if test "$GCC" = yes; then +- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +-fi +-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER +- +- +-# _LT_AC_TAGCONFIG +-# ---------------- +-AC_DEFUN([_LT_AC_TAGCONFIG], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_ARG_WITH([tags], +- [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], +- [include additional configurations @<:@automatic@:>@])], +- [tagnames="$withval"]) +- +-if test -f "$ltmain" && test -n "$tagnames"; then +- if test ! -f "${ofile}"; then +- AC_MSG_WARN([output file `$ofile' does not exist]) +- fi +- +- if test -z "$LTCC"; then +- eval "`$SHELL ${ofile} --config | grep '^LTCC='`" +- if test -z "$LTCC"; then +- AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) +- else +- AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) +- fi +- fi +- if test -z "$LTCFLAGS"; then +- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" +- fi +- +- # Extract list of available tagged configurations in $ofile. +- # Note that this assumes the entire list is on one line. +- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` +- +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for tagname in $tagnames; do +- IFS="$lt_save_ifs" +- # Check whether tagname contains only valid characters +- case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in +- "") ;; +- *) AC_MSG_ERROR([invalid tag name: $tagname]) +- ;; +- esac +- +- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null +- then +- AC_MSG_ERROR([tag name \"$tagname\" already exists]) +- fi +- +- # Update the list of available tags. +- if test -n "$tagname"; then +- echo appending configuration tag \"$tagname\" to $ofile +- +- case $tagname in +- CXX) +- if test -n "$CXX" && ( test "X$CXX" != "Xno" && +- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || +- (test "X$CXX" != "Xg++"))) ; then +- AC_LIBTOOL_LANG_CXX_CONFIG +- else +- tagname="" +- fi +- ;; +- +- F77) +- if test -n "$F77" && test "X$F77" != "Xno"; then +- AC_LIBTOOL_LANG_F77_CONFIG +- else +- tagname="" +- fi +- ;; +- +- GCJ) +- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then +- AC_LIBTOOL_LANG_GCJ_CONFIG +- else +- tagname="" +- fi +- ;; +- +- RC) +- AC_LIBTOOL_LANG_RC_CONFIG +- ;; +- +- *) +- AC_MSG_ERROR([Unsupported tag name: $tagname]) +- ;; +- esac +- +- # Append the new tag name to the list of available tags. +- if test -n "$tagname" ; then +- available_tags="$available_tags $tagname" +- fi +- fi +- done +- IFS="$lt_save_ifs" +- +- # Now substitute the updated list of available tags. +- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then +- mv "${ofile}T" "$ofile" +- chmod +x "$ofile" +- else +- rm -f "${ofile}T" +- AC_MSG_ERROR([unable to update list of available tagged configurations.]) +- fi +-fi +-])# _LT_AC_TAGCONFIG +- +- +-# AC_LIBTOOL_DLOPEN +-# ----------------- +-# enable checks for dlopen support +-AC_DEFUN([AC_LIBTOOL_DLOPEN], +- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +-])# AC_LIBTOOL_DLOPEN +- +- +-# AC_LIBTOOL_WIN32_DLL +-# -------------------- +-# declare package support for building win32 DLLs +-AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +-])# AC_LIBTOOL_WIN32_DLL +- +- +-# AC_ENABLE_SHARED([DEFAULT]) +-# --------------------------- +-# implement the --enable-shared flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_SHARED], +-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([shared], +- [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], +- [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_shared=yes ;; +- no) enable_shared=no ;; +- *) +- enable_shared=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_shared=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +-])# AC_ENABLE_SHARED +- +- +-# AC_DISABLE_SHARED +-# ----------------- +-# set the default shared flag to --disable-shared +-AC_DEFUN([AC_DISABLE_SHARED], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_SHARED(no) +-])# AC_DISABLE_SHARED +- +- +-# AC_ENABLE_STATIC([DEFAULT]) +-# --------------------------- +-# implement the --enable-static flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_STATIC], +-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([static], +- [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], +- [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_static=yes ;; +- no) enable_static=no ;; +- *) +- enable_static=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_static=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_static=]AC_ENABLE_STATIC_DEFAULT) +-])# AC_ENABLE_STATIC +- +- +-# AC_DISABLE_STATIC +-# ----------------- +-# set the default static flag to --disable-static +-AC_DEFUN([AC_DISABLE_STATIC], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_STATIC(no) +-])# AC_DISABLE_STATIC +- +- +-# AC_ENABLE_FAST_INSTALL([DEFAULT]) +-# --------------------------------- +-# implement the --enable-fast-install flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_FAST_INSTALL], +-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([fast-install], +- [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], +- [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_fast_install=yes ;; +- no) enable_fast_install=no ;; +- *) +- enable_fast_install=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_fast_install=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +-])# AC_ENABLE_FAST_INSTALL +- +- +-# AC_DISABLE_FAST_INSTALL +-# ----------------------- +-# set the default to --disable-fast-install +-AC_DEFUN([AC_DISABLE_FAST_INSTALL], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_FAST_INSTALL(no) +-])# AC_DISABLE_FAST_INSTALL +- +- +-# AC_LIBTOOL_PICMODE([MODE]) +-# -------------------------- +-# implement the --with-pic flag +-# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +-AC_DEFUN([AC_LIBTOOL_PICMODE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-pic_mode=ifelse($#,1,$1,default) +-])# AC_LIBTOOL_PICMODE +- +- +-# AC_PROG_EGREP +-# ------------- +-# This is predefined starting with Autoconf 2.54, so this conditional +-# definition can be removed once we require Autoconf 2.54 or later. +-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], +- [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 +- then ac_cv_prog_egrep='grep -E' +- else ac_cv_prog_egrep='egrep' +- fi]) +- EGREP=$ac_cv_prog_egrep +- AC_SUBST([EGREP]) +-])]) +- +- +-# AC_PATH_TOOL_PREFIX +-# ------------------- +-# find a file program which can recognize shared library +-AC_DEFUN([AC_PATH_TOOL_PREFIX], +-[AC_REQUIRE([AC_PROG_EGREP])dnl +-AC_MSG_CHECKING([for $1]) +-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +-[case $MAGIC_CMD in +-[[\\/*] | ?:[\\/]*]) +- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. +- ;; +-*) +- lt_save_MAGIC_CMD="$MAGIC_CMD" +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +-dnl $ac_dummy forces splitting on constant user-supplied paths. +-dnl POSIX.2 word splitting is done only on the output of word expansions, +-dnl not every word. This closes a longstanding sh security hole. +- ac_dummy="ifelse([$2], , $PATH, [$2])" +- for ac_dir in $ac_dummy; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$1; then +- lt_cv_path_MAGIC_CMD="$ac_dir/$1" +- if test -n "$file_magic_test_file"; then +- case $deplibs_check_method in +- "file_magic "*) +- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` +- MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | +- $EGREP "$file_magic_regex" > /dev/null; then +- : +- else +- cat <&2 +- +-*** Warning: the command libtool uses to detect shared libraries, +-*** $file_magic_cmd, produces output that libtool cannot recognize. +-*** The result is that libtool may fail to recognize shared libraries +-*** as such. This will affect the creation of libtool libraries that +-*** depend on shared libraries, but programs linked with such libtool +-*** libraries will work regardless of this problem. Nevertheless, you +-*** may want to report the problem to your system manager and/or to +-*** bug-libtool@gnu.org +- +-EOF +- fi ;; +- esac +- fi +- break +- fi +- done +- IFS="$lt_save_ifs" +- MAGIC_CMD="$lt_save_MAGIC_CMD" +- ;; +-esac]) +-MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +-if test -n "$MAGIC_CMD"; then +- AC_MSG_RESULT($MAGIC_CMD) +-else +- AC_MSG_RESULT(no) +-fi +-])# AC_PATH_TOOL_PREFIX +- +- +-# AC_PATH_MAGIC +-# ------------- +-# find a file program which can recognize a shared library +-AC_DEFUN([AC_PATH_MAGIC], +-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +-if test -z "$lt_cv_path_MAGIC_CMD"; then +- if test -n "$ac_tool_prefix"; then +- AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) +- else +- MAGIC_CMD=: +- fi +-fi +-])# AC_PATH_MAGIC +- +- +-# AC_PROG_LD +-# ---------- +-# find the pathname to the GNU or non-GNU linker +-AC_DEFUN([AC_PROG_LD], +-[AC_ARG_WITH([gnu-ld], +- [AC_HELP_STRING([--with-gnu-ld], +- [assume the C compiler uses GNU ld @<:@default=no@:>@])], +- [test "$withval" = no || with_gnu_ld=yes], +- [with_gnu_ld=no]) +-AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_REQUIRE([AC_PROG_CC])dnl +-AC_REQUIRE([AC_CANONICAL_HOST])dnl +-AC_REQUIRE([AC_CANONICAL_BUILD])dnl +-ac_prog=ld +-if test "$GCC" = yes; then +- # Check if gcc -print-prog-name=ld gives a path. +- AC_MSG_CHECKING([for ld used by $CC]) +- case $host in +- *-*-mingw*) +- # gcc leaves a trailing carriage return which upsets mingw +- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; +- *) +- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; +- esac +- case $ac_prog in +- # Accept absolute paths. +- [[\\/]]* | ?:[[\\/]]*) +- re_direlt='/[[^/]][[^/]]*/\.\./' +- # Canonicalize the pathname of ld +- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` +- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do +- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` +- done +- test -z "$LD" && LD="$ac_prog" +- ;; +- "") +- # If it fails, then pretend we aren't using GCC. +- ac_prog=ld +- ;; +- *) +- # If it is relative, then search for the first ld in PATH. +- with_gnu_ld=unknown +- ;; +- esac +-elif test "$with_gnu_ld" = yes; then +- AC_MSG_CHECKING([for GNU ld]) +-else +- AC_MSG_CHECKING([for non-GNU ld]) +-fi +-AC_CACHE_VAL(lt_cv_path_LD, +-[if test -z "$LD"; then +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for ac_dir in $PATH; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then +- lt_cv_path_LD="$ac_dir/$ac_prog" +- # Check to see if the program is GNU ld. I'd rather use --version, +- # but apparently some variants of GNU ld only accept -v. +- # Break only if it was the GNU/non-GNU ld that we prefer. +- case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then +- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' +- lt_cv_file_magic_cmd='func_win32_libid' +- else +- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' +- lt_cv_file_magic_cmd='$OBJDUMP -f' +- fi +- ;; +- +-darwin* | rhapsody*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-freebsd* | dragonfly*) +- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then +- case $host_cpu in +- i*86 ) +- # Not sure whether the presence of OpenBSD here was a mistake. +- # Let's accept both of them until this is cleared up. +- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' +- lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` +- ;; +- esac +- else +- lt_cv_deplibs_check_method=pass_all +- fi +- ;; +- +-gnu*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-hpux10.20* | hpux11*) +- lt_cv_file_magic_cmd=/usr/bin/file +- case $host_cpu in +- ia64*) +- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' +- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so +- ;; +- hppa*64*) +- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] +- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl +- ;; +- *) +- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' +- lt_cv_file_magic_test_file=/usr/lib/libc.sl +- ;; +- esac +- ;; +- +-interix[[3-9]]*) +- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' +- ;; +- +-irix5* | irix6* | nonstopux*) +- case $LD in +- *-32|*"-32 ") libmagic=32-bit;; +- *-n32|*"-n32 ") libmagic=N32;; +- *-64|*"-64 ") libmagic=64-bit;; +- *) libmagic=never-match;; +- esac +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-# This must be Linux ELF. +-linux* | k*bsd*-gnu) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-netbsd*) +- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' +- else +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' +- fi +- ;; +- +-newos6*) +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' +- lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=/usr/lib/libnls.so +- ;; +- +-nto-qnx*) +- lt_cv_deplibs_check_method=unknown +- ;; +- +-openbsd*) +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' +- else +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' +- fi +- ;; +- +-osf3* | osf4* | osf5*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-rdos*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-solaris*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-sysv4 | sysv4.3*) +- case $host_vendor in +- motorola) +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' +- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` +- ;; +- ncr) +- lt_cv_deplibs_check_method=pass_all +- ;; +- sequent) +- lt_cv_file_magic_cmd='/bin/file' +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' +- ;; +- sni) +- lt_cv_file_magic_cmd='/bin/file' +- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" +- lt_cv_file_magic_test_file=/lib/libc.so +- ;; +- siemens) +- lt_cv_deplibs_check_method=pass_all +- ;; +- pc) +- lt_cv_deplibs_check_method=pass_all +- ;; +- esac +- ;; +- +-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) +- lt_cv_deplibs_check_method=pass_all +- ;; +-esac +-]) +-file_magic_cmd=$lt_cv_file_magic_cmd +-deplibs_check_method=$lt_cv_deplibs_check_method +-test -z "$deplibs_check_method" && deplibs_check_method=unknown +-])# AC_DEPLIBS_CHECK_METHOD +- +- +-# AC_PROG_NM +-# ---------- +-# find the pathname to a BSD-compatible name lister +-AC_DEFUN([AC_PROG_NM], +-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +-[if test -n "$NM"; then +- # Let the user override the test. +- lt_cv_path_NM="$NM" +-else +- lt_nm_to_check="${ac_tool_prefix}nm" +- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then +- lt_nm_to_check="$lt_nm_to_check nm" +- fi +- for lt_tmp_nm in $lt_nm_to_check; do +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- tmp_nm="$ac_dir/$lt_tmp_nm" +- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then +- # Check to see if the nm accepts a BSD-compat flag. +- # Adding the `sed 1q' prevents false positives on HP-UX, which says: +- # nm: unknown option "B" ignored +- # Tru64's nm complains that /dev/null is an invalid object file +- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in +- */dev/null* | *'Invalid file or object type'*) +- lt_cv_path_NM="$tmp_nm -B" +- break +- ;; +- *) +- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in +- */dev/null*) +- lt_cv_path_NM="$tmp_nm -p" +- break +- ;; +- *) +- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but +- continue # so that we can try to find one that supports BSD flags +- ;; +- esac +- ;; +- esac +- fi +- done +- IFS="$lt_save_ifs" +- done +- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +-fi]) +-NM="$lt_cv_path_NM" +-])# AC_PROG_NM +- +- +-# AC_CHECK_LIBM +-# ------------- +-# check for math library +-AC_DEFUN([AC_CHECK_LIBM], +-[AC_REQUIRE([AC_CANONICAL_HOST])dnl +-LIBM= +-case $host in +-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) +- # These system don't have libm, or don't need it +- ;; +-*-ncr-sysv4.3*) +- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") +- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") +- ;; +-*) +- AC_CHECK_LIB(m, cos, LIBM="-lm") +- ;; +-esac +-])# AC_CHECK_LIBM +- +- +-# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +-# ----------------------------------- +-# sets LIBLTDL to the link flags for the libltdl convenience library and +-# LTDLINCL to the include flags for the libltdl header and adds +-# --enable-ltdl-convenience to the configure arguments. Note that +-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +-# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +-# (note the single quotes!). If your package is not flat and you're not +-# using automake, define top_builddir and top_srcdir appropriately in +-# the Makefiles. +-AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +- case $enable_ltdl_convenience in +- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; +- "") enable_ltdl_convenience=yes +- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; +- esac +- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la +- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +- # For backwards non-gettext consistent compatibility... +- INCLTDL="$LTDLINCL" +-])# AC_LIBLTDL_CONVENIENCE +- +- +-# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +-# ----------------------------------- +-# sets LIBLTDL to the link flags for the libltdl installable library and +-# LTDLINCL to the include flags for the libltdl header and adds +-# --enable-ltdl-install to the configure arguments. Note that +-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +-# and an installed libltdl is not found, it is assumed to be `libltdl'. +-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +-# '${top_srcdir}/' (note the single quotes!). If your package is not +-# flat and you're not using automake, define top_builddir and top_srcdir +-# appropriately in the Makefiles. +-# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +-AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +- AC_CHECK_LIB(ltdl, lt_dlinit, +- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], +- [if test x"$enable_ltdl_install" = xno; then +- AC_MSG_WARN([libltdl not installed, but installation disabled]) +- else +- enable_ltdl_install=yes +- fi +- ]) +- if test x"$enable_ltdl_install" = x"yes"; then +- ac_configure_args="$ac_configure_args --enable-ltdl-install" +- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la +- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +- else +- ac_configure_args="$ac_configure_args --enable-ltdl-install=no" +- LIBLTDL="-lltdl" +- LTDLINCL= +- fi +- # For backwards non-gettext consistent compatibility... +- INCLTDL="$LTDLINCL" +-])# AC_LIBLTDL_INSTALLABLE +- +- +-# AC_LIBTOOL_CXX +-# -------------- +-# enable support for C++ libraries +-AC_DEFUN([AC_LIBTOOL_CXX], +-[AC_REQUIRE([_LT_AC_LANG_CXX]) +-])# AC_LIBTOOL_CXX +- +- +-# _LT_AC_LANG_CXX +-# --------------- +-AC_DEFUN([_LT_AC_LANG_CXX], +-[AC_REQUIRE([AC_PROG_CXX]) +-AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +-])# _LT_AC_LANG_CXX +- +-# _LT_AC_PROG_CXXCPP +-# ------------------ +-AC_DEFUN([_LT_AC_PROG_CXXCPP], +-[ +-AC_REQUIRE([AC_PROG_CXX]) +-if test -n "$CXX" && ( test "X$CXX" != "Xno" && +- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || +- (test "X$CXX" != "Xg++"))) ; then +- AC_PROG_CXXCPP +-fi +-])# _LT_AC_PROG_CXXCPP +- +-# AC_LIBTOOL_F77 +-# -------------- +-# enable support for Fortran 77 libraries +-AC_DEFUN([AC_LIBTOOL_F77], +-[AC_REQUIRE([_LT_AC_LANG_F77]) +-])# AC_LIBTOOL_F77 +- +- +-# _LT_AC_LANG_F77 +-# --------------- +-AC_DEFUN([_LT_AC_LANG_F77], +-[AC_REQUIRE([AC_PROG_F77]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +-])# _LT_AC_LANG_F77 +- +- +-# AC_LIBTOOL_GCJ +-# -------------- +-# enable support for GCJ libraries +-AC_DEFUN([AC_LIBTOOL_GCJ], +-[AC_REQUIRE([_LT_AC_LANG_GCJ]) +-])# AC_LIBTOOL_GCJ +- +- +-# _LT_AC_LANG_GCJ +-# --------------- +-AC_DEFUN([_LT_AC_LANG_GCJ], +-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], +- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], +- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], +- [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], +- [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], +- [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +-])# _LT_AC_LANG_GCJ +- +- +-# AC_LIBTOOL_RC +-# ------------- +-# enable support for Windows resource files +-AC_DEFUN([AC_LIBTOOL_RC], +-[AC_REQUIRE([LT_AC_PROG_RC]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +-])# AC_LIBTOOL_RC +- +- +-# AC_LIBTOOL_LANG_C_CONFIG +-# ------------------------ +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +-AC_DEFUN([_LT_AC_LANG_C_CONFIG], +-[lt_save_CC="$CC" +-AC_LANG_PUSH(C) +- +-# Source file extension for C test sources. +-ac_ext=c +- +-# Object file extension for compiled C test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="int some_variable = 0;" +- +-# Code to be used in simple link tests +-lt_simple_link_test_code='int main(){return(0);}' +- +-_LT_AC_SYS_COMPILER +- +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE +- +-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +-AC_LIBTOOL_SYS_LIB_STRIP +-AC_LIBTOOL_DLOPEN_SELF +- +-# Report which library types will actually be built +-AC_MSG_CHECKING([if libtool supports shared libraries]) +-AC_MSG_RESULT([$can_build_shared]) +- +-AC_MSG_CHECKING([whether to build shared libraries]) +-test "$can_build_shared" = "no" && enable_shared=no +- +-# On AIX, shared libraries and static libraries use the same namespace, and +-# are all built from PIC. +-case $host_os in +-aix3*) +- test "$enable_shared" = yes && enable_static=no +- if test -n "$RANLIB"; then +- archive_cmds="$archive_cmds~\$RANLIB \$lib" +- postinstall_cmds='$RANLIB $lib' +- fi +- ;; +- +-aix[[4-9]]*) +- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then +- test "$enable_shared" = yes && enable_static=no +- fi +- ;; +-esac +-AC_MSG_RESULT([$enable_shared]) +- +-AC_MSG_CHECKING([whether to build static libraries]) +-# Make sure either enable_shared or enable_static is yes. +-test "$enable_shared" = yes || enable_static=yes +-AC_MSG_RESULT([$enable_static]) +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_POP +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_C_CONFIG +- +- +-# AC_LIBTOOL_LANG_CXX_CONFIG +-# -------------------------- +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +-[AC_LANG_PUSH(C++) +-AC_REQUIRE([AC_PROG_CXX]) +-AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +- +-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +-_LT_AC_TAGVAR(allow_undefined_flag, $1)= +-_LT_AC_TAGVAR(always_export_symbols, $1)=no +-_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_direct, $1)=no +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +-_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +-_LT_AC_TAGVAR(hardcode_automatic, $1)=no +-_LT_AC_TAGVAR(module_cmds, $1)= +-_LT_AC_TAGVAR(module_expsym_cmds, $1)= +-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +-_LT_AC_TAGVAR(no_undefined_flag, $1)= +-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +- +-# Dependencies to place before and after the object being linked: +-_LT_AC_TAGVAR(predep_objects, $1)= +-_LT_AC_TAGVAR(postdep_objects, $1)= +-_LT_AC_TAGVAR(predeps, $1)= +-_LT_AC_TAGVAR(postdeps, $1)= +-_LT_AC_TAGVAR(compiler_lib_search_path, $1)= +-_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)= +- +-# Source file extension for C++ test sources. +-ac_ext=cpp +- +-# Object file extension for compiled C++ test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="int some_variable = 0;" +- +-# Code to be used in simple link tests +-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' +- +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER +- +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE +- +-# Allow CC to be a program name with arguments. +-lt_save_CC=$CC +-lt_save_LD=$LD +-lt_save_GCC=$GCC +-GCC=$GXX +-lt_save_with_gnu_ld=$with_gnu_ld +-lt_save_path_LD=$lt_cv_path_LD +-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then +- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +-else +- $as_unset lt_cv_prog_gnu_ld +-fi +-if test -n "${lt_cv_path_LDCXX+set}"; then +- lt_cv_path_LD=$lt_cv_path_LDCXX +-else +- $as_unset lt_cv_path_LD +-fi +-test -z "${LDCXX+set}" || LD=$LDCXX +-CC=${CXX-"c++"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +- +-# We don't want -fno-exception wen compiling C++ code, so set the +-# no_builtin_flag separately +-if test "$GXX" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +-else +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +-fi +- +-if test "$GXX" = yes; then +- # Set up default GNU C++ configuration +- +- AC_PROG_LD +- +- # Check if GNU C++ uses GNU ld as the underlying linker, since the +- # archiving commands below assume that GNU ld is being used. +- if test "$with_gnu_ld" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- +- # If archive_cmds runs LD, not CC, wlarc should be empty +- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to +- # investigate it a little bit more. (MM) +- wlarc='${wl}' +- +- # ancient GNU ld didn't support --whole-archive et. al. +- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ +- grep 'no-whole-archive' > /dev/null; then +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' +- else +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- else +- with_gnu_ld=no +- wlarc= +- +- # A generic and very simple default shared library creation +- # command for GNU C++ for the case where it uses the native +- # linker, instead of GNU ld. If possible, this setting should +- # overridden to take advantage of the native linker features on +- # the platform it is being used on. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' +- fi +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +- +-else +- GXX=no +- with_gnu_ld=no +- wlarc= +-fi +- +-# PORTME: fill in a description of your system's C++ link characteristics +-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +-_LT_AC_TAGVAR(ld_shlibs, $1)=yes +-case $host_os in +- aix3*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aix[[4-9]]*) +- if test "$host_cpu" = ia64; then +- # On IA64, the linker does run time linking by default, so we don't +- # have to do anything special. +- aix_use_runtimelinking=no +- exp_sym_flag='-Bexport' +- no_entry_flag="" +- else +- aix_use_runtimelinking=no +- +- # Test if we are trying to use run time linking or normal +- # AIX style linking. If -brtl is somewhere in LDFLAGS, we +- # need to do runtime linking. +- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) +- for ld_flag in $LDFLAGS; do +- case $ld_flag in +- *-brtl*) +- aix_use_runtimelinking=yes +- break +- ;; +- esac +- done +- ;; +- esac +- +- exp_sym_flag='-bexport' +- no_entry_flag='-bnoentry' +- fi +- +- # When large executables or shared objects are built, AIX ld can +- # have problems creating the table of contents. If linking a library +- # or program results in "error TOC overflow" add -mminimal-toc to +- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not +- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. +- +- _LT_AC_TAGVAR(archive_cmds, $1)='' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- +- if test "$GXX" = yes; then +- case $host_os in aix4.[[012]]|aix4.[[012]].*) +- # We only want to do this on AIX 4.2 and lower, the check +- # below for broken collect2 doesn't work under 4.3+ +- collect2name=`${CC} -print-prog-name=collect2` +- if test -f "$collect2name" && \ +- strings "$collect2name" | grep resolve_lib_name >/dev/null +- then +- # We have reworked collect2 +- : +- else +- # We have old collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- # It fails to find uninstalled libraries when the uninstalled +- # path is not listed in the libpath. Setting hardcode_minus_L +- # to unsupported forces relinking +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- fi +- ;; +- esac +- shared_flag='-shared' +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag="$shared_flag "'${wl}-G' +- fi +- else +- # not using gcc +- if test "$host_cpu" = ia64; then +- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release +- # chokes on -Wl,-G. The following line is correct: +- shared_flag='-G' +- else +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag='${wl}-G' +- else +- shared_flag='${wl}-bM:SRE' +- fi +- fi +- fi +- +- # It seems that -bexpall does not export symbols beginning with +- # underscore (_), so it is better to generate a list of symbols to export. +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- if test "$aix_use_runtimelinking" = yes; then +- # Warning - without using the other runtime loading flags (-brtl), +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +- else +- if test "$host_cpu" = ia64; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" +- else +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- # Warning - without using the other run time loading flags, +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' +- # Exported symbols can be pulled into shared objects from archives +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- # This is similar to how AIX traditionally builds its shared libraries. +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' +- fi +- fi +- ;; +- +- beos*) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Joseph Beckenbach says some releases of gcc +- # support --undefined. This deserves some investigation. FIXME +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- chorus*) +- case $cc_basename in +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- +- cygwin* | mingw* | pw32*) +- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, +- # as there is no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- +- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- darwin* | rhapsody*) +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" +- if test "$GXX" = yes ; then +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" +- _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" +- _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" +- if test "$lt_cv_apple_cc_single_mod" != "yes"; then +- _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" +- fi +- else +- case $cc_basename in +- xlc*) +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- ;; +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +- ;; +- +- dgux*) +- case $cc_basename in +- ec++*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- ghcx*) +- # Green Hills C++ Compiler +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- freebsd[[12]]*) +- # C++ shared libraries reported to be fairly broken before switch to ELF +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- freebsd-elf*) +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- ;; +- freebsd* | dragonfly*) +- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF +- # conventions +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- ;; +- gnu*) +- ;; +- hpux9*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, +- # but as the default +- # location of the library. +- +- case $cc_basename in +- CC*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aCC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- hpux10*|hpux11*) +- if test $with_gnu_ld = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- case $host_cpu in +- hppa*64*|ia64*) ;; +- *) +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- ;; +- esac +- fi +- case $host_cpu in +- hppa*64*|ia64*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- *) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, +- # but as the default +- # location of the library. +- ;; +- esac +- +- case $cc_basename in +- CC*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aCC*) +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- esac +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes; then +- if test $with_gnu_ld = no; then +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- esac +- fi +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- interix[[3-9]]*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. +- # Instead, shared libraries are loaded at an image base (0x10000000 by +- # default) and relocated if they conflict, which is a slow very memory +- # consuming and fragmenting process. To avoid this, we pick a random, +- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link +- # time. Moving up from 0x10000000 also allows more sbrk(2) space. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- ;; +- irix5* | irix6*) +- case $cc_basename in +- CC*) +- # SGI C++ +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- +- # Archives containing C++ object files must be created using +- # "CC -ar", where "CC" is the IRIX C++ compiler. This is +- # necessary to make sure instantiated templates are included +- # in the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' +- ;; +- *) +- if test "$GXX" = yes; then +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' +- fi +- fi +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; +- esac +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- ;; +- linux* | k*bsd*-gnu) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- +- # Archives containing C++ object files must be created using +- # "CC -Bstatic", where "CC" is the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' +- ;; +- icpc*) +- # Intel C++ +- with_gnu_ld=yes +- # version 8.0 and above of icpc choke on multiply defined symbols +- # if we add $predep_objects and $postdep_objects, however 7.1 and +- # earlier do not add the objects themselves. +- case `$CC -V 2>&1` in +- *"Version 7."*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- ;; +- *) # Version 8.0 or newer +- tmp_idyn= +- case $host_cpu in +- ia64*) tmp_idyn=' -i_dynamic';; +- esac +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- ;; +- esac +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' +- ;; +- pgCC* | pgcpp*) +- # Portland Group C++ compiler +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- ;; +- cxx*) +- # Compaq C++ +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' +- +- runpath_var=LD_RUN_PATH +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) +- # Sun C++ 5.9 +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- +- # Not sure whether something based on +- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 +- # would be better. +- output_verbose_link_cmd='echo' +- +- # Archives containing C++ object files must be created using +- # "CC -xar", where "CC" is the Sun C++ compiler. This is +- # necessary to make sure instantiated templates are included +- # in the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' +- ;; +- esac +- ;; +- esac +- ;; +- lynxos*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- m88k*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- mvs*) +- case $cc_basename in +- cxx*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- netbsd*) +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' +- wlarc= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- fi +- # Workaround some broken pre-1.5 toolchains +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' +- ;; +- openbsd2*) +- # C++ shared libraries are fairly broken +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- openbsd*) +- if test -f /usr/libexec/ld.so; then +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' +- fi +- output_verbose_link_cmd='echo' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- osf3*) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Archives containing C++ object files must be created using +- # "CC -Bstatic", where "CC" is the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' +- +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- cxx*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +- +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- osf4* | osf5*) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Archives containing C++ object files must be created using +- # the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- cxx*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ +- echo "-hidden">> $lib.exp~ +- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ +- $rm $lib.exp' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +- +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- psos*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- sunos4*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.x +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- lcc*) +- # Lucid +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- solaris*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.2, 5.x and Centerline C++ +- _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- case $host_os in +- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; +- *) +- # The compiler driver will combine and reorder linker options, +- # but understands `-z linker_flag'. +- # Supported since Solaris 2.6 (maybe 2.5.1?) +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' +- ;; +- esac +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- +- output_verbose_link_cmd='echo' +- +- # Archives containing C++ object files must be created using +- # "CC -xar", where "CC" is the Sun C++ compiler. This is +- # necessary to make sure instantiated templates are included +- # in the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' +- ;; +- gcx*) +- # Green Hills C++ Compiler +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +- +- # The C++ compiler must be used to create the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' +- ;; +- *) +- # GNU C++ compiler with Solaris linker +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' +- if $CC --version | grep -v '^2\.7' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" +- else +- # g++ 2.7 appears to require `-G' NOT `-shared' on this +- # platform. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" +- fi +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' +- case $host_os in +- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; +- *) +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' +- ;; +- esac +- fi +- ;; +- esac +- ;; +- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var='LD_RUN_PATH' +- +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- ;; +- sysv5* | sco3.2v5* | sco5v6*) +- # Note: We can NOT use -z defs as we might desire, because we do not +- # link with -lc, and that would cause any symbols used from libc to +- # always be unresolved, which means just about no library would +- # ever link correctly. If we're not using GNU ld we use -z text +- # though, which does catch some bad symbols but isn't as heavy-handed +- # as -z defs. +- # For security reasons, it is highly recommended that you always +- # use absolute paths for naming shared libraries, and exclude the +- # DT_RUNPATH tag from executables and libraries. But doing so +- # requires that you compile everything twice, which is a pain. +- # So that behaviour is only enabled if SCOABSPATH is set to a +- # non-empty value in the environment. Most likely only useful for +- # creating official distributions of packages. +- # This is a hack until libtool officially supports absolute path +- # names for shared libraries. +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' +- runpath_var='LD_RUN_PATH' +- +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- ;; +- tandem*) +- case $cc_basename in +- NCC*) +- # NonStop-UX NCC 3.20 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- vxworks*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +-esac +-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no +- +-_LT_AC_TAGVAR(GCC, $1)="$GXX" +-_LT_AC_TAGVAR(LD, $1)="$LD" +- +-AC_LIBTOOL_POSTDEP_PREDEP($1) +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_POP +-CC=$lt_save_CC +-LDCXX=$LD +-LD=$lt_save_LD +-GCC=$lt_save_GCC +-with_gnu_ldcxx=$with_gnu_ld +-with_gnu_ld=$lt_save_with_gnu_ld +-lt_cv_path_LDCXX=$lt_cv_path_LD +-lt_cv_path_LD=$lt_save_path_LD +-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +-])# AC_LIBTOOL_LANG_CXX_CONFIG +- +-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +-# ------------------------------------ +-# Figure out "hidden" library dependencies from verbose +-# compiler output when linking a shared library. +-# Parse the compiler output and extract the necessary +-# objects, libraries and library flags. +-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-dnl we can't use the lt_simple_compile_test_code here, +-dnl because it contains code intended for an executable, +-dnl not a library. It's possible we should let each +-dnl tag define a new lt_????_link_test_code variable, +-dnl but it's only used here... +-ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&1 | sed 5q` in +- *Sun\ C*) +- # Sun C++ 5.9 +- # +- # The more standards-conforming stlport4 library is +- # incompatible with the Cstd library. Avoid specifying +- # it if it's in CXXFLAGS. Ignore libCrun as +- # -library=stlport4 depends on it. +- case " $CXX $CXXFLAGS " in +- *" -library=stlport4 "*) +- solaris_use_stlport4=yes +- ;; +- esac +- if test "$solaris_use_stlport4" != yes; then +- _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' +- fi +- ;; +- esac +- ;; +- +-solaris*) +- case $cc_basename in +- CC*) +- # The more standards-conforming stlport4 library is +- # incompatible with the Cstd library. Avoid specifying +- # it if it's in CXXFLAGS. Ignore libCrun as +- # -library=stlport4 depends on it. +- case " $CXX $CXXFLAGS " in +- *" -library=stlport4 "*) +- solaris_use_stlport4=yes +- ;; +- esac +- +- # Adding this requires a known-good setup of shared libraries for +- # Sun compiler versions before 5.6, else PIC objects from an old +- # archive will be linked into the output, leading to subtle bugs. +- if test "$solaris_use_stlport4" != yes; then +- _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' +- fi +- ;; +- esac +- ;; +-esac +-]) +-case " $_LT_AC_TAGVAR(postdeps, $1) " in +-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; +-esac +-])# AC_LIBTOOL_POSTDEP_PREDEP +- +-# AC_LIBTOOL_LANG_F77_CONFIG +-# -------------------------- +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) +-AC_DEFUN([_LT_AC_LANG_F77_CONFIG], +-[AC_REQUIRE([AC_PROG_F77]) +-AC_LANG_PUSH(Fortran 77) +- +-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +-_LT_AC_TAGVAR(allow_undefined_flag, $1)= +-_LT_AC_TAGVAR(always_export_symbols, $1)=no +-_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_direct, $1)=no +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +-_LT_AC_TAGVAR(hardcode_automatic, $1)=no +-_LT_AC_TAGVAR(module_cmds, $1)= +-_LT_AC_TAGVAR(module_expsym_cmds, $1)= +-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +-_LT_AC_TAGVAR(no_undefined_flag, $1)= +-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +- +-# Source file extension for f77 test sources. +-ac_ext=f +- +-# Object file extension for compiled f77 test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="\ +- subroutine t +- return +- end +-" +- +-# Code to be used in simple link tests +-lt_simple_link_test_code="\ +- program t +- end +-" +- +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER +- +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE +- +-# Allow CC to be a program name with arguments. +-lt_save_CC="$CC" +-CC=${F77-"f77"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +- +-AC_MSG_CHECKING([if libtool supports shared libraries]) +-AC_MSG_RESULT([$can_build_shared]) +- +-AC_MSG_CHECKING([whether to build shared libraries]) +-test "$can_build_shared" = "no" && enable_shared=no +- +-# On AIX, shared libraries and static libraries use the same namespace, and +-# are all built from PIC. +-case $host_os in +-aix3*) +- test "$enable_shared" = yes && enable_static=no +- if test -n "$RANLIB"; then +- archive_cmds="$archive_cmds~\$RANLIB \$lib" +- postinstall_cmds='$RANLIB $lib' +- fi +- ;; +-aix[[4-9]]*) +- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then +- test "$enable_shared" = yes && enable_static=no +- fi +- ;; +-esac +-AC_MSG_RESULT([$enable_shared]) +- +-AC_MSG_CHECKING([whether to build static libraries]) +-# Make sure either enable_shared or enable_static is yes. +-test "$enable_shared" = yes || enable_static=yes +-AC_MSG_RESULT([$enable_static]) +- +-_LT_AC_TAGVAR(GCC, $1)="$G77" +-_LT_AC_TAGVAR(LD, $1)="$LD" +- +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_POP +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_F77_CONFIG +- +- +-# AC_LIBTOOL_LANG_GCJ_CONFIG +-# -------------------------- +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) +-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], +-[AC_LANG_SAVE +- +-# Source file extension for Java test sources. +-ac_ext=java +- +-# Object file extension for compiled Java test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="class foo {}" +- +-# Code to be used in simple link tests +-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' +- +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER +- +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE +- +-# Allow CC to be a program name with arguments. +-lt_save_CC="$CC" +-CC=${GCJ-"gcj"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +- +-# GCJ did not exist at the time GCC didn't implicitly link libc in. +-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- +-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +- +-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_RESTORE +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_GCJ_CONFIG +- +- +-# AC_LIBTOOL_LANG_RC_CONFIG +-# ------------------------- +-# Ensure that the configuration vars for the Windows resource compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) +-AC_DEFUN([_LT_AC_LANG_RC_CONFIG], +-[AC_LANG_SAVE +- +-# Source file extension for RC test sources. +-ac_ext=rc +- +-# Object file extension for compiled RC test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' +- +-# Code to be used in simple link tests +-lt_simple_link_test_code="$lt_simple_compile_test_code" +- +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER +- +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE +- +-# Allow CC to be a program name with arguments. +-lt_save_CC="$CC" +-CC=${RC-"windres"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_RESTORE +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_RC_CONFIG +- +- +-# AC_LIBTOOL_CONFIG([TAGNAME]) +-# ---------------------------- +-# If TAGNAME is not passed, then create an initial libtool script +-# with a default configuration from the untagged config vars. Otherwise +-# add code to config.status for appending the configuration named by +-# TAGNAME from the matching tagged config vars. +-AC_DEFUN([AC_LIBTOOL_CONFIG], +-[# The else clause should only fire when bootstrapping the +-# libtool distribution, otherwise you forgot to ship ltmain.sh +-# with your package, and you will get complaints that there are +-# no rules to generate ltmain.sh. +-if test -f "$ltmain"; then +- # See if we are running on zsh, and set the options which allow our commands through +- # without removal of \ escapes. +- if test -n "${ZSH_VERSION+set}" ; then +- setopt NO_GLOB_SUBST +- fi +- # Now quote all the things that may contain metacharacters while being +- # careful not to overquote the AC_SUBSTed values. We take copies of the +- # variables and quote the copies for generation of the libtool script. +- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ +- SED SHELL STRIP \ +- libname_spec library_names_spec soname_spec extract_expsyms_cmds \ +- old_striplib striplib file_magic_cmd finish_cmds finish_eval \ +- deplibs_check_method reload_flag reload_cmds need_locks \ +- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ +- lt_cv_sys_global_symbol_to_c_name_address \ +- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ +- old_postinstall_cmds old_postuninstall_cmds \ +- _LT_AC_TAGVAR(compiler, $1) \ +- _LT_AC_TAGVAR(CC, $1) \ +- _LT_AC_TAGVAR(LD, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ +- _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ +- _LT_AC_TAGVAR(old_archive_cmds, $1) \ +- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ +- _LT_AC_TAGVAR(predep_objects, $1) \ +- _LT_AC_TAGVAR(postdep_objects, $1) \ +- _LT_AC_TAGVAR(predeps, $1) \ +- _LT_AC_TAGVAR(postdeps, $1) \ +- _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ +- _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \ +- _LT_AC_TAGVAR(archive_cmds, $1) \ +- _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ +- _LT_AC_TAGVAR(postinstall_cmds, $1) \ +- _LT_AC_TAGVAR(postuninstall_cmds, $1) \ +- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ +- _LT_AC_TAGVAR(allow_undefined_flag, $1) \ +- _LT_AC_TAGVAR(no_undefined_flag, $1) \ +- _LT_AC_TAGVAR(export_symbols_cmds, $1) \ +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ +- _LT_AC_TAGVAR(hardcode_automatic, $1) \ +- _LT_AC_TAGVAR(module_cmds, $1) \ +- _LT_AC_TAGVAR(module_expsym_cmds, $1) \ +- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ +- _LT_AC_TAGVAR(fix_srcfile_path, $1) \ +- _LT_AC_TAGVAR(exclude_expsyms, $1) \ +- _LT_AC_TAGVAR(include_expsyms, $1); do +- +- case $var in +- _LT_AC_TAGVAR(old_archive_cmds, $1) | \ +- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ +- _LT_AC_TAGVAR(archive_cmds, $1) | \ +- _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ +- _LT_AC_TAGVAR(module_cmds, $1) | \ +- _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ +- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ +- _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ +- extract_expsyms_cmds | reload_cmds | finish_cmds | \ +- postinstall_cmds | postuninstall_cmds | \ +- old_postinstall_cmds | old_postuninstall_cmds | \ +- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) +- # Double-quote double-evaled strings. +- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" +- ;; +- *) +- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" +- ;; +- esac +- done +- +- case $lt_echo in +- *'\[$]0 --fallback-echo"') +- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` +- ;; +- esac +- +-ifelse([$1], [], +- [cfgfile="${ofile}T" +- trap "$rm \"$cfgfile\"; exit 1" 1 2 15 +- $rm -f "$cfgfile" +- AC_MSG_NOTICE([creating $ofile])], +- [cfgfile="$ofile"]) +- +- cat <<__EOF__ >> "$cfgfile" +-ifelse([$1], [], +-[#! $SHELL +- +-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +-# NOTE: Changes made to this file will be lost: look at ltmain.sh. +-# +-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +-# Free Software Foundation, Inc. +-# +-# This file is part of GNU Libtool: +-# Originally by Gordon Matzigkeit , 1996 +-# +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2 of the License, or +-# (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, but +-# WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-# General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-# As a special exception to the GNU General Public License, if you +-# distribute this file as part of a program that contains a +-# configuration script generated by Autoconf, you may include it under +-# the same distribution terms that you use for the rest of that program. +- +-# A sed program that does not truncate output. +-SED=$lt_SED +- +-# Sed that helps us avoid accidentally triggering echo(1) options like -n. +-Xsed="$SED -e 1s/^X//" +- +-# The HP-UX ksh and POSIX shell print the target directory to stdout +-# if CDPATH is set. +-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +- +-# The names of the tagged configurations supported by this script. +-available_tags= +- +-# ### BEGIN LIBTOOL CONFIG], +-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) +- +-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +- +-# Shell to use when invoking shell scripts. +-SHELL=$lt_SHELL +- +-# Whether or not to build shared libraries. +-build_libtool_libs=$enable_shared +- +-# Whether or not to build static libraries. +-build_old_libs=$enable_static +- +-# Whether or not to add -lc for building shared libraries. +-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) +- +-# Whether or not to disallow shared libs when runtime libs are static +-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) +- +-# Whether or not to optimize for fast installation. +-fast_install=$enable_fast_install +- +-# The host system. +-host_alias=$host_alias +-host=$host +-host_os=$host_os +- +-# The build system. +-build_alias=$build_alias +-build=$build +-build_os=$build_os +- +-# An echo program that does not interpret backslashes. +-echo=$lt_echo +- +-# The archiver. +-AR=$lt_AR +-AR_FLAGS=$lt_AR_FLAGS +- +-# A C compiler. +-LTCC=$lt_LTCC +- +-# LTCC compiler flags. +-LTCFLAGS=$lt_LTCFLAGS +- +-# A language-specific compiler. +-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) +- +-# Is the compiler the GNU C compiler? +-with_gcc=$_LT_AC_TAGVAR(GCC, $1) +- +-# An ERE matcher. +-EGREP=$lt_EGREP +- +-# The linker used to build libraries. +-LD=$lt_[]_LT_AC_TAGVAR(LD, $1) +- +-# Whether we need hard or soft links. +-LN_S=$lt_LN_S +- +-# A BSD-compatible nm program. +-NM=$lt_NM +- +-# A symbol stripping program +-STRIP=$lt_STRIP +- +-# Used to examine libraries when file_magic_cmd begins "file" +-MAGIC_CMD=$MAGIC_CMD +- +-# Used on cygwin: DLL creation program. +-DLLTOOL="$DLLTOOL" +- +-# Used on cygwin: object dumper. +-OBJDUMP="$OBJDUMP" +- +-# Used on cygwin: assembler. +-AS="$AS" +- +-# The name of the directory that contains temporary libtool files. +-objdir=$objdir +- +-# How to create reloadable object files. +-reload_flag=$lt_reload_flag +-reload_cmds=$lt_reload_cmds +- +-# How to pass a linker flag through the compiler. +-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) +- +-# Object file suffix (normally "o"). +-objext="$ac_objext" +- +-# Old archive suffix (normally "a"). +-libext="$libext" +- +-# Shared library suffix (normally ".so"). +-shrext_cmds='$shrext_cmds' +- +-# Executable file suffix (normally ""). +-exeext="$exeext" +- +-# Additional compiler flags for building library objects. +-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +-pic_mode=$pic_mode +- +-# What is the maximum length of a command? +-max_cmd_len=$lt_cv_sys_max_cmd_len +- +-# Does compiler simultaneously support -c and -o options? +-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) +- +-# Must we lock files when doing compilation? +-need_locks=$lt_need_locks +- +-# Do we need the lib prefix for modules? +-need_lib_prefix=$need_lib_prefix +- +-# Do we need a version for libraries? +-need_version=$need_version +- +-# Whether dlopen is supported. +-dlopen_support=$enable_dlopen +- +-# Whether dlopen of programs is supported. +-dlopen_self=$enable_dlopen_self +- +-# Whether dlopen of statically linked programs is supported. +-dlopen_self_static=$enable_dlopen_self_static +- +-# Compiler flag to prevent dynamic linking. +-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) +- +-# Compiler flag to turn off builtin functions. +-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) +- +-# Compiler flag to allow reflexive dlopens. +-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) +- +-# Compiler flag to generate shared objects directly from archives. +-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) +- +-# Compiler flag to generate thread-safe objects. +-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) +- +-# Library versioning type. +-version_type=$version_type +- +-# Format of library name prefix. +-libname_spec=$lt_libname_spec +- +-# List of archive names. First name is the real one, the rest are links. +-# The last name is the one that the linker finds with -lNAME. +-library_names_spec=$lt_library_names_spec +- +-# The coded name of the library, if different from the real name. +-soname_spec=$lt_soname_spec +- +-# Commands used to build and install an old-style archive. +-RANLIB=$lt_RANLIB +-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +-old_postinstall_cmds=$lt_old_postinstall_cmds +-old_postuninstall_cmds=$lt_old_postuninstall_cmds +- +-# Create an old-style archive from a shared archive. +-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) +- +-# Create a temporary old-style archive to link instead of a shared archive. +-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) +- +-# Commands used to build and install a shared archive. +-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +-postinstall_cmds=$lt_postinstall_cmds +-postuninstall_cmds=$lt_postuninstall_cmds +- +-# Commands used to build a loadable module (assumed same as above if empty) +-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) +- +-# Commands to strip libraries. +-old_striplib=$lt_old_striplib +-striplib=$lt_striplib +- +-# Dependencies to place before the objects being linked to create a +-# shared library. +-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) +- +-# Dependencies to place after the objects being linked to create a +-# shared library. +-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) +- +-# Dependencies to place before the objects being linked to create a +-# shared library. +-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) +- +-# Dependencies to place after the objects being linked to create a +-# shared library. +-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) +- +-# The directories searched by this compiler when creating a shared +-# library +-compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1) +- +-# The library search path used internally by the compiler when linking +-# a shared library. +-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) +- +-# Method to check whether dependent libraries are shared objects. +-deplibs_check_method=$lt_deplibs_check_method +- +-# Command to use when deplibs_check_method == file_magic. +-file_magic_cmd=$lt_file_magic_cmd +- +-# Flag that allows shared libraries with undefined symbols to be built. +-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) +- +-# Flag that forces no undefined symbols. +-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) +- +-# Commands used to finish a libtool library installation in a directory. +-finish_cmds=$lt_finish_cmds +- +-# Same as above, but a single script fragment to be evaled but not shown. +-finish_eval=$lt_finish_eval +- +-# Take the output of nm and produce a listing of raw symbols and C names. +-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe +- +-# Transform the output of nm in a proper C declaration +-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +- +-# Transform the output of nm in a C name address pair +-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address +- +-# This is the shared library runtime path variable. +-runpath_var=$runpath_var +- +-# This is the shared library path variable. +-shlibpath_var=$shlibpath_var +- +-# Is shlibpath searched before the hard-coded library search path? +-shlibpath_overrides_runpath=$shlibpath_overrides_runpath +- +-# How to hardcode a shared library path into an executable. +-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) +- +-# Whether we should hardcode library paths into libraries. +-hardcode_into_libs=$hardcode_into_libs +- +-# Flag to hardcode \$libdir into a binary during linking. +-# This must work even if \$libdir does not exist. +-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) +- +-# If ld is used when linking, flag to hardcode \$libdir into +-# a binary during linking. This must work even if \$libdir does +-# not exist. +-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) +- +-# Whether we need a single -rpath flag with a separated argument. +-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) +- +-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +-# resulting binary. +-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) +- +-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +-# resulting binary. +-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) +- +-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +-# the resulting binary. +-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) +- +-# Set to yes if building a shared library automatically hardcodes DIR into the library +-# and all subsequent libraries and executables linked against it. +-hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) +- +-# Variables whose values should be saved in libtool wrapper scripts and +-# restored at relink time. +-variables_saved_for_relink="$variables_saved_for_relink" +- +-# Whether libtool must link a program against all its dependency libraries. +-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) +- +-# Compile-time system search path for libraries +-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +- +-# Run-time system search path for libraries +-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +- +-# Fix the shell variable \$srcfile for the compiler. +-fix_srcfile_path=$lt_fix_srcfile_path +- +-# Set to yes if exported symbols are required. +-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) +- +-# The commands to list exported symbols. +-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) +- +-# The commands to extract the exported symbol list from a shared archive. +-extract_expsyms_cmds=$lt_extract_expsyms_cmds +- +-# Symbols that should not be listed in the preloaded symbols. +-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) +- +-# Symbols that must always be exported. +-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) +- +-ifelse([$1],[], +-[# ### END LIBTOOL CONFIG], +-[# ### END LIBTOOL TAG CONFIG: $tagname]) +- +-__EOF__ +- +-ifelse([$1],[], [ +- case $host_os in +- aix3*) +- cat <<\EOF >> "$cfgfile" +- +-# AIX sometimes has problems with the GCC collect2 program. For some +-# reason, if we set the COLLECT_NAMES environment variable, the problems +-# vanish in a puff of smoke. +-if test "X${COLLECT_NAMES+set}" != Xset; then +- COLLECT_NAMES= +- export COLLECT_NAMES +-fi +-EOF +- ;; +- esac +- +- # We use sed instead of cat because bash on DJGPP gets confused if +- # if finds mixed CR/LF and LF-only lines. Since sed operates in +- # text mode, it properly converts lines to CR/LF. This bash problem +- # is reportedly fixed, but why not run on old versions too? +- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) +- +- mv -f "$cfgfile" "$ofile" || \ +- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") +- chmod +x "$ofile" +-]) +-else +- # If there is no Makefile yet, we rely on a make rule to execute +- # `config.status --recheck' to rerun these tests and create the +- # libtool script then. +- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` +- if test -f "$ltmain_in"; then +- test -f Makefile && make "$ltmain" +- fi +-fi +-])# AC_LIBTOOL_CONFIG +- +- +-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +-# ------------------------------------------- +-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +- +-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +- +-if test "$GCC" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +- +- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], +- lt_cv_prog_compiler_rtti_exceptions, +- [-fno-rtti -fno-exceptions], [], +- [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +-fi +-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI +- +- +-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +-# --------------------------------- +-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +-[AC_REQUIRE([AC_CANONICAL_HOST]) +-AC_REQUIRE([LT_AC_PROG_SED]) +-AC_REQUIRE([AC_PROG_NM]) +-AC_REQUIRE([AC_OBJEXT]) +-# Check for command to grab the raw symbol name followed by C symbol from nm. +-AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +-[ +-# These are sane defaults that work on at least a few old systems. +-# [They come from Ultrix. What could be older than Ultrix?!! ;)] +- +-# Character class describing NM global symbol codes. +-symcode='[[BCDEGRST]]' +- +-# Regexp to match symbols that can be accessed directly from C. +-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' +- +-# Transform an extracted symbol line into a proper C declaration +-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" +- +-# Transform an extracted symbol line into symbol name and symbol address +-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" +- +-# Define system-specific variables. +-case $host_os in +-aix*) +- symcode='[[BCDT]]' +- ;; +-cygwin* | mingw* | pw32*) +- symcode='[[ABCDGISTW]]' +- ;; +-hpux*) # Its linker distinguishes data from code symbols +- if test "$host_cpu" = ia64; then +- symcode='[[ABCDEGRST]]' +- fi +- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" +- ;; +-linux* | k*bsd*-gnu) +- if test "$host_cpu" = ia64; then +- symcode='[[ABCDGIRSTW]]' +- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" +- fi +- ;; +-irix* | nonstopux*) +- symcode='[[BCDEGRST]]' +- ;; +-osf*) +- symcode='[[BCDEGQRST]]' +- ;; +-solaris*) +- symcode='[[BDRT]]' +- ;; +-sco3.2v5*) +- symcode='[[DT]]' +- ;; +-sysv4.2uw2*) +- symcode='[[DT]]' +- ;; +-sysv5* | sco5v6* | unixware* | OpenUNIX*) +- symcode='[[ABDT]]' +- ;; +-sysv4) +- symcode='[[DFNSTU]]' +- ;; +-esac +- +-# Handle CRLF in mingw tool chain +-opt_cr= +-case $build_os in +-mingw*) +- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp +- ;; +-esac +- +-# If we're using GNU nm, then use its standard symbol codes. +-case `$NM -V 2>&1` in +-*GNU* | *'with BFD'*) +- symcode='[[ABCDGIRSTW]]' ;; +-esac +- +-# Try without a prefix undercore, then with it. +-for ac_symprfx in "" "_"; do +- +- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. +- symxfrm="\\1 $ac_symprfx\\2 \\2" +- +- # Write the raw and C identifiers. +- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" +- +- # Check to see that the pipe works correctly. +- pipe_works=no +- +- rm -f conftest* +- cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then +- # Try sorting and uniquifying the output. +- if sort "$nlist" | uniq > "$nlist"T; then +- mv -f "$nlist"T "$nlist" +- else +- rm -f "$nlist"T +- fi +- +- # Make sure that we snagged all the symbols we need. +- if grep ' nm_test_var$' "$nlist" >/dev/null; then +- if grep ' nm_test_func$' "$nlist" >/dev/null; then +- cat < conftest.$ac_ext +-#ifdef __cplusplus +-extern "C" { +-#endif +- +-EOF +- # Now generate the symbol file. +- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' +- +- cat <> conftest.$ac_ext +-#if defined (__STDC__) && __STDC__ +-# define lt_ptr_t void * +-#else +-# define lt_ptr_t char * +-# define const +-#endif +- +-/* The mapping between symbol names and symbols. */ +-const struct { +- const char *name; +- lt_ptr_t address; +-} +-lt_preloaded_symbols[[]] = +-{ +-EOF +- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext +- cat <<\EOF >> conftest.$ac_ext +- {0, (lt_ptr_t) 0} +-}; +- +-#ifdef __cplusplus +-} +-#endif +-EOF +- # Now try linking the two files. +- mv conftest.$ac_objext conftstm.$ac_objext +- lt_save_LIBS="$LIBS" +- lt_save_CFLAGS="$CFLAGS" +- LIBS="conftstm.$ac_objext" +- CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" +- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then +- pipe_works=yes +- fi +- LIBS="$lt_save_LIBS" +- CFLAGS="$lt_save_CFLAGS" +- else +- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD +- fi +- else +- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD +- fi +- else +- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD +- fi +- else +- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD +- cat conftest.$ac_ext >&5 +- fi +- rm -rf conftest* conftst* +- +- # Do not use the global_symbol_pipe unless it works. +- if test "$pipe_works" = yes; then +- break +- else +- lt_cv_sys_global_symbol_pipe= +- fi +-done +-]) +-if test -z "$lt_cv_sys_global_symbol_pipe"; then +- lt_cv_sys_global_symbol_to_cdecl= +-fi +-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then +- AC_MSG_RESULT(failed) +-else +- AC_MSG_RESULT(ok) +-fi +-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +- +- +-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +-# --------------------------------------- +-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= +- +-AC_MSG_CHECKING([for $compiler option to produce PIC]) +- ifelse([$1],[CXX],[ +- # C++ specific cases for pic, static, wl, etc. +- if test "$GXX" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- +- case $host_os in +- aix*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; +- amigaos*) +- # FIXME: we need at least 68020 code to build shared libraries, but +- # adding the `-m68020' flag to GCC prevents building anything better, +- # like `-m68040'. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' +- ;; +- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) +- # PIC is the default for these OSes. +- ;; +- mingw* | cygwin* | os2* | pw32*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- # Although the cygwin gcc ignores -fPIC, still need this for old-style +- # (--disable-auto-import) libraries +- m4_if([$1], [GCJ], [], +- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) +- ;; +- darwin* | rhapsody*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' +- ;; +- *djgpp*) +- # DJGPP does not support shared libraries at all +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- ;; +- interix[[3-9]]*) +- # Interix 3.x gcc -fpic/-fPIC options generate broken code. +- # Instead, we relocate shared libraries at runtime. +- ;; +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic +- fi +- ;; +- hpux*) +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- else +- case $host_os in +- aix[[4-9]]*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- else +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' +- fi +- ;; +- chorus*) +- case $cc_basename in +- cxch68*) +- # Green Hills C++ Compiler +- # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" +- ;; +- esac +- ;; +- darwin*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- case $cc_basename in +- xlc*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- ;; +- esac +- ;; +- dgux*) +- case $cc_basename in +- ec++*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- ;; +- ghcx*) +- # Green Hills C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- ;; +- *) +- ;; +- esac +- ;; +- freebsd* | dragonfly*) +- # FreeBSD uses GNU C++ +- ;; +- hpux9* | hpux10* | hpux11*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' +- if test "$host_cpu" != ia64; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- fi +- ;; +- aCC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' +- case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- ;; +- esac +- ;; +- *) +- ;; +- esac +- ;; +- interix*) +- # This is c89, which is MS Visual C++ (no shared libs) +- # Anyone wants to do a port? +- ;; +- irix5* | irix6* | nonstopux*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- # CC pic flag -KPIC is the default. +- ;; +- *) +- ;; +- esac +- ;; +- linux* | k*bsd*-gnu) +- case $cc_basename in +- KCC*) +- # KAI C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- icpc* | ecpc*) +- # Intel C++ +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- ;; +- pgCC* | pgcpp*) +- # Portland Group C++ compiler. +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- cxx*) +- # Compaq C++ +- # Make sure the PIC flag is empty. It appears that all Alpha +- # Linux and Compaq Tru64 Unix objects are PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- *) +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) +- # Sun C++ 5.9 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' +- ;; +- esac +- ;; +- esac +- ;; +- lynxos*) +- ;; +- m88k*) +- ;; +- mvs*) +- case $cc_basename in +- cxx*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' +- ;; +- *) +- ;; +- esac +- ;; +- netbsd*) +- ;; +- osf3* | osf4* | osf5*) +- case $cc_basename in +- KCC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- ;; +- cxx*) +- # Digital/Compaq C++ +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # Make sure the PIC flag is empty. It appears that all Alpha +- # Linux and Compaq Tru64 Unix objects are PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- *) +- ;; +- esac +- ;; +- psos*) +- ;; +- solaris*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.2, 5.x and Centerline C++ +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' +- ;; +- gcx*) +- # Green Hills C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' +- ;; +- *) +- ;; +- esac +- ;; +- sunos4*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.x +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- lcc*) +- # Lucid +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- ;; +- *) +- ;; +- esac +- ;; +- tandem*) +- case $cc_basename in +- NCC*) +- # NonStop-UX NCC 3.20 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- ;; +- *) +- ;; +- esac +- ;; +- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- esac +- ;; +- vxworks*) +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- ;; +- esac +- fi +-], +-[ +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- +- case $host_os in +- aix*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; +- +- amigaos*) +- # FIXME: we need at least 68020 code to build shared libraries, but +- # adding the `-m68020' flag to GCC prevents building anything better, +- # like `-m68040'. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' +- ;; +- +- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) +- # PIC is the default for these OSes. +- ;; +- +- mingw* | cygwin* | pw32* | os2*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- # Although the cygwin gcc ignores -fPIC, still need this for old-style +- # (--disable-auto-import) libraries +- m4_if([$1], [GCJ], [], +- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) +- ;; +- +- darwin* | rhapsody*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' +- ;; +- +- interix[[3-9]]*) +- # Interix 3.x gcc -fpic/-fPIC options generate broken code. +- # Instead, we relocate shared libraries at runtime. +- ;; +- +- msdosdjgpp*) +- # Just because we use GCC doesn't mean we suddenly get shared libraries +- # on systems that don't support them. +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- enable_shared=no +- ;; +- +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic +- fi +- ;; +- +- hpux*) +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- ;; +- +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- else +- # PORTME Check for flag to pass linker flags through the system compiler. +- case $host_os in +- aix*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- else +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' +- fi +- ;; +- darwin*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- case $cc_basename in +- xlc*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- ;; +- esac +- ;; +- +- mingw* | cygwin* | pw32* | os2*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- m4_if([$1], [GCJ], [], +- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) +- ;; +- +- hpux9* | hpux10* | hpux11*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- ;; +- esac +- # Is there a better lt_prog_compiler_static that works with the bundled CC? +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' +- ;; +- +- irix5* | irix6* | nonstopux*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # PIC (with -KPIC) is the default. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- +- newsos6) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- linux* | k*bsd*-gnu) +- case $cc_basename in +- icc* | ecc*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- ;; +- pgcc* | pgf77* | pgf90* | pgf95*) +- # Portland Group compilers (*not* the Pentium gcc compiler, +- # which looks to be a dead project) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- ccc*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # All Alpha code is PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- *) +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) +- # Sun C 5.9 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- ;; +- *Sun\ F*) +- # Sun Fortran 8.3 passes all unrecognized flags to the linker +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' +- ;; +- esac +- ;; +- esac +- ;; +- +- osf3* | osf4* | osf5*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # All OSF/1 code is PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- +- rdos*) +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- +- solaris*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- case $cc_basename in +- f77* | f90* | f95*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; +- esac +- ;; +- +- sunos4*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- sysv4 | sysv4.2uw2* | sysv4.3*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- sysv4*MP*) +- if test -d /usr/nec ;then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; +- +- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- unicos*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- ;; +- +- uts4*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- ;; +- esac +- fi +-]) +-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) +- +-# +-# Check to make sure the PIC flag actually works. +-# +-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then +- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], +- _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1), +- [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], +- [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in +- "" | " "*) ;; +- *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; +- esac], +- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +-fi +-case $host_os in +- # For platforms which do not support PIC, -DPIC is meaningless: +- *djgpp*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" +- ;; +-esac +- +-# +-# Check to make sure the static flag actually works. +-# +-wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], +- _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1), +- $lt_tmp_static_flag, +- [], +- [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +-]) +- +- +-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +-# ------------------------------------ +-# See if the linker supports building shared libraries. +-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +-ifelse([$1],[CXX],[ +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- case $host_os in +- aix[[4-9]]*) +- # If we're using GNU nm, then we don't want the "-C" option. +- # -C means demangle to AIX nm, but means don't demangle with GNU nm +- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- else +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- fi +- ;; +- pw32*) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" +- ;; +- cygwin* | mingw*) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' +- ;; +- *) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- ;; +- esac +- _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +-],[ +- runpath_var= +- _LT_AC_TAGVAR(allow_undefined_flag, $1)= +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +- _LT_AC_TAGVAR(archive_cmds, $1)= +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)= +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= +- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +- _LT_AC_TAGVAR(hardcode_automatic, $1)=no +- _LT_AC_TAGVAR(module_cmds, $1)= +- _LT_AC_TAGVAR(module_expsym_cmds, $1)= +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- # include_expsyms should be a list of space-separated symbols to be *always* +- # included in the symbol list +- _LT_AC_TAGVAR(include_expsyms, $1)= +- # exclude_expsyms can be an extended regexp of symbols to exclude +- # it will be wrapped by ` (' and `)$', so one must not match beginning or +- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', +- # as well as any symbol that contains `d'. +- _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out +- # platforms (ab)use it in PIC code, but their linkers get confused if +- # the symbol is explicitly referenced. Since portable code cannot +- # rely on this symbol name, it's probably fine to never include it in +- # preloaded symbol tables. +- # Exclude shared library initialization/finalization symbols. +-dnl Note also adjust exclude_expsyms for C++ above. +- extract_expsyms_cmds= +- # Just being paranoid about ensuring that cc_basename is set. +- _LT_CC_BASENAME([$compiler]) +- case $host_os in +- cygwin* | mingw* | pw32*) +- # FIXME: the MSVC++ port hasn't been tested in a loooong time +- # When not using gcc, we currently assume that we are using +- # Microsoft Visual C++. +- if test "$GCC" != yes; then +- with_gnu_ld=no +- fi +- ;; +- interix*) +- # we just hope/assume this is gcc and not c89 (= MSVC++) +- with_gnu_ld=yes +- ;; +- openbsd*) +- with_gnu_ld=no +- ;; +- esac +- +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- if test "$with_gnu_ld" = yes; then +- # If archive_cmds runs LD, not CC, wlarc should be empty +- wlarc='${wl}' +- +- # Set some defaults for GNU ld with shared library support. These +- # are reset later if shared libraries are not supported. Putting them +- # here allows them to be overridden if necessary. +- runpath_var=LD_RUN_PATH +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- # ancient GNU ld didn't support --whole-archive et. al. +- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' +- else +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- supports_anon_versioning=no +- case `$LD -v 2>/dev/null` in +- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 +- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... +- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... +- *\ 2.11.*) ;; # other 2.11 versions +- *) supports_anon_versioning=yes ;; +- esac +- +- # See if GNU ld supports shared libraries. +- case $host_os in +- aix[[3-9]]*) +- # On AIX/PPC, the GNU linker is very broken +- if test "$host_cpu" != ia64; then +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <&2 +- +-*** Warning: the GNU linker, at least up to release 2.9.1, is reported +-*** to be unable to reliably create shared libraries on AIX. +-*** Therefore, libtool is disabling shared libraries support. If you +-*** really care for shared libraries, you may want to modify your PATH +-*** so that a non-GNU linker is found, and then restart. +- +-EOF +- fi +- ;; +- +- amigaos*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- +- # Samuel A. Falvo II reports +- # that the semantics of dynamic libraries on AmigaOS, at least up +- # to version 4, is to share data among multiple programs linked +- # with the same dynamic library. Since this doesn't match the +- # behavior of shared libraries on other platforms, we can't use +- # them. +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- +- beos*) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Joseph Beckenbach says some releases of gcc +- # support --undefined. This deserves some investigation. FIXME +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- cygwin* | mingw* | pw32*) +- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, +- # as there is no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' +- +- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- interix[[3-9]]*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. +- # Instead, shared libraries are loaded at an image base (0x10000000 by +- # default) and relocated if they conflict, which is a slow very memory +- # consuming and fragmenting process. To avoid this, we pick a random, +- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link +- # time. Moving up from 0x10000000 also allows more sbrk(2) space. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- ;; +- +- gnu* | linux* | k*bsd*-gnu) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- tmp_addflag= +- case $cc_basename,$host_cpu in +- pgcc*) # Portland Group C compiler +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- tmp_addflag=' $pic_flag' +- ;; +- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- tmp_addflag=' $pic_flag -Mnomain' ;; +- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 +- tmp_addflag=' -i_dynamic' ;; +- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 +- tmp_addflag=' -i_dynamic -nofor_main' ;; +- ifc* | ifort*) # Intel Fortran compiler +- tmp_addflag=' -nofor_main' ;; +- esac +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) # Sun C 5.9 +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- tmp_sharedflag='-G' ;; +- *Sun\ F*) # Sun Fortran 8.3 +- tmp_sharedflag='-G' ;; +- *) +- tmp_sharedflag='-shared' ;; +- esac +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- +- if test $supports_anon_versioning = yes; then +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ +- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +- $echo "local: *; };" >> $output_objdir/$libname.ver~ +- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' +- fi +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- netbsd*) +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' +- wlarc= +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- fi +- ;; +- +- solaris*) +- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <&2 +- +-*** Warning: The releases 2.8.* of the GNU linker cannot reliably +-*** create shared libraries on Solaris systems. Therefore, libtool +-*** is disabling shared libraries support. We urge you to upgrade GNU +-*** binutils to release 2.9.1 or newer. Another option is to modify +-*** your PATH or compiler configuration so that the native linker is +-*** used, and then restart. +- +-EOF +- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) +- case `$LD -v 2>&1` in +- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <<_LT_EOF 1>&2 +- +-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +-*** reliably create shared libraries on SCO systems. Therefore, libtool +-*** is disabling shared libraries support. We urge you to upgrade GNU +-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +-*** your PATH or compiler configuration so that the native linker is +-*** used, and then restart. +- +-_LT_EOF +- ;; +- *) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- +- sunos4*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- wlarc= +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- *) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- +- if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then +- runpath_var= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- else +- # PORTME fill in a description of your system's linker (not GNU ld) +- case $host_os in +- aix3*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' +- # Note: this linker hardcodes the directories in LIBPATH if there +- # are no directories specified by -L. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then +- # Neither direct hardcoding nor static linking is supported with a +- # broken collect2. +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- fi +- ;; +- +- aix[[4-9]]*) +- if test "$host_cpu" = ia64; then +- # On IA64, the linker does run time linking by default, so we don't +- # have to do anything special. +- aix_use_runtimelinking=no +- exp_sym_flag='-Bexport' +- no_entry_flag="" +- else +- # If we're using GNU nm, then we don't want the "-C" option. +- # -C means demangle to AIX nm, but means don't demangle with GNU nm +- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- else +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- fi +- aix_use_runtimelinking=no +- +- # Test if we are trying to use run time linking or normal +- # AIX style linking. If -brtl is somewhere in LDFLAGS, we +- # need to do runtime linking. +- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) +- for ld_flag in $LDFLAGS; do +- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then +- aix_use_runtimelinking=yes +- break +- fi +- done +- ;; +- esac +- +- exp_sym_flag='-bexport' +- no_entry_flag='-bnoentry' +- fi +- +- # When large executables or shared objects are built, AIX ld can +- # have problems creating the table of contents. If linking a library +- # or program results in "error TOC overflow" add -mminimal-toc to +- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not +- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. +- +- _LT_AC_TAGVAR(archive_cmds, $1)='' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- +- if test "$GCC" = yes; then +- case $host_os in aix4.[[012]]|aix4.[[012]].*) +- # We only want to do this on AIX 4.2 and lower, the check +- # below for broken collect2 doesn't work under 4.3+ +- collect2name=`${CC} -print-prog-name=collect2` +- if test -f "$collect2name" && \ +- strings "$collect2name" | grep resolve_lib_name >/dev/null +- then +- # We have reworked collect2 +- : +- else +- # We have old collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- # It fails to find uninstalled libraries when the uninstalled +- # path is not listed in the libpath. Setting hardcode_minus_L +- # to unsupported forces relinking +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- fi +- ;; +- esac +- shared_flag='-shared' +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag="$shared_flag "'${wl}-G' +- fi +- else +- # not using gcc +- if test "$host_cpu" = ia64; then +- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release +- # chokes on -Wl,-G. The following line is correct: +- shared_flag='-G' +- else +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag='${wl}-G' +- else +- shared_flag='${wl}-bM:SRE' +- fi +- fi +- fi +- +- # It seems that -bexpall does not export symbols beginning with +- # underscore (_), so it is better to generate a list of symbols to export. +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- if test "$aix_use_runtimelinking" = yes; then +- # Warning - without using the other runtime loading flags (-brtl), +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +- else +- if test "$host_cpu" = ia64; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" +- else +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- # Warning - without using the other run time loading flags, +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' +- # Exported symbols can be pulled into shared objects from archives +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- # This is similar to how AIX traditionally builds its shared libraries. +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' +- fi +- fi +- ;; +- +- amigaos*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- # see comment about different semantics on the GNU ld section +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- +- bsdi[[45]]*) +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic +- ;; +- +- cygwin* | mingw* | pw32*) +- # When not using gcc, we currently assume that we are using +- # Microsoft Visual C++. +- # hardcode_libdir_flag_spec is actually meaningless, as there is +- # no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Tell ltmain to make .lib files, not .a files. +- libext=lib +- # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" +- # FIXME: Setting linknames here is a bad hack. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' +- # The linker will automatically build a .lib file if we build a DLL. +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' +- # FIXME: Should let the user specify the lib program. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' +- _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- ;; +- +- darwin* | rhapsody*) +- case $host_os in +- rhapsody* | darwin1.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' +- ;; +- *) # Darwin 1.3 on +- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- else +- case ${MACOSX_DEPLOYMENT_TARGET} in +- 10.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- ;; +- 10.*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' +- ;; +- esac +- fi +- ;; +- esac +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- if test "$GCC" = yes ; then +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" +- _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" +- _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" +- else +- case $cc_basename in +- xlc*) +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- ;; +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +- ;; +- +- dgux*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- freebsd1*) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- +- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor +- # support. Future versions do this automatically, but an explicit c++rt0.o +- # does not break anything, and helps significantly (at the cost of a little +- # extra space). +- freebsd2.2*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- # Unfortunately, older versions of FreeBSD 2 do not have this feature. +- freebsd2*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- # FreeBSD 3 and greater uses gcc -shared to do shared libraries. +- freebsd* | dragonfly*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- hpux9*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- ;; +- +- hpux10*) +- if test "$GCC" = yes -a "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +- fi +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- fi +- ;; +- +- hpux11*) +- if test "$GCC" = yes -a "$with_gnu_ld" = no; then +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- else +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- fi +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- case $host_cpu in +- hppa*64*|ia64*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- *) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- ;; +- esac +- fi +- ;; +- +- irix5* | irix6* | nonstopux*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; +- +- netbsd*) +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- newsos6) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- openbsd*) +- if test -f /usr/libexec/ld.so; then +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- else +- case $host_os in +- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- ;; +- esac +- fi +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- os2*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' +- ;; +- +- osf3*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- ;; +- +- osf4* | osf5*) # as osf3* with the addition of -msym flag +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- else +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ +- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' +- +- # Both c and cxx compiler support -rpath directly +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- ;; +- +- solaris*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' +- if test "$GCC" = yes; then +- wlarc='${wl}' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' +- else +- wlarc='' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- case $host_os in +- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; +- *) +- # The compiler driver will combine and reorder linker options, +- # but understands `-z linker_flag'. GCC discards it without `$wl', +- # but is careful enough not to reorder. +- # Supported since Solaris 2.6 (maybe 2.5.1?) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' +- else +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' +- fi +- ;; +- esac +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; +- +- sunos4*) +- if test "x$host_vendor" = xsequent; then +- # Use $CC to link under sequent, because it throws in some extra .o +- # files that make .init and .fini sections work. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- sysv4) +- case $host_vendor in +- sni) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? +- ;; +- siemens) +- ## LD is ld it makes a PLAMLIB +- ## CC just makes a GrossModule. +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- ;; +- motorola) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie +- ;; +- esac +- runpath_var='LD_RUN_PATH' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- sysv4.3*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' +- ;; +- +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var=LD_RUN_PATH +- hardcode_runpath_var=yes +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- fi +- ;; +- +- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var='LD_RUN_PATH' +- +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- fi +- ;; +- +- sysv5* | sco3.2v5* | sco5v6*) +- # Note: We can NOT use -z defs as we might desire, because we do not +- # link with -lc, and that would cause any symbols used from libc to +- # always be unresolved, which means just about no library would +- # ever link correctly. If we're not using GNU ld we use -z text +- # though, which does catch some bad symbols but isn't as heavy-handed +- # as -z defs. +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' +- runpath_var='LD_RUN_PATH' +- +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- fi +- ;; +- +- uts4*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +-]) +-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no +- +-# +-# Do we need to explicitly link libc? +-# +-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +-x|xyes) +- # Assume -lc should be added +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- +- if test "$enable_shared" = yes && test "$GCC" = yes; then +- case $_LT_AC_TAGVAR(archive_cmds, $1) in +- *'~'*) +- # FIXME: we may have to deal with multi-command sequences. +- ;; +- '$CC '*) +- # Test whether the compiler implicitly links with -lc since on some +- # systems, -lgcc has to come before -lc. If gcc already passes -lc +- # to ld, don't add -lc before -lgcc. +- AC_MSG_CHECKING([whether -lc should be explicitly linked in]) +- $rm conftest* +- echo "$lt_simple_compile_test_code" > conftest.$ac_ext +- +- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then +- soname=conftest +- lib=conftest +- libobjs=conftest.$ac_objext +- deplibs= +- wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) +- pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +- compiler_flags=-v +- linker_flags=-v +- verstring= +- output_objdir=. +- libname=conftest +- lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)= +- if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) +- then +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- else +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- fi +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag +- else +- cat conftest.err 1>&5 +- fi +- $rm conftest* +- AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) +- ;; +- esac +- fi +- ;; +-esac +-])# AC_LIBTOOL_PROG_LD_SHLIBS +- +- +-# _LT_AC_FILE_LTDLL_C +-# ------------------- +-# Be careful that the start marker always follows a newline. +-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +-# /* ltdll.c starts here */ +-# #define WIN32_LEAN_AND_MEAN +-# #include +-# #undef WIN32_LEAN_AND_MEAN +-# #include +-# +-# #ifndef __CYGWIN__ +-# # ifdef __CYGWIN32__ +-# # define __CYGWIN__ __CYGWIN32__ +-# # endif +-# #endif +-# +-# #ifdef __cplusplus +-# extern "C" { +-# #endif +-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +-# #ifdef __cplusplus +-# } +-# #endif +-# +-# #ifdef __CYGWIN__ +-# #include +-# DECLARE_CYGWIN_DLL( DllMain ); +-# #endif +-# HINSTANCE __hDllInstance_base; +-# +-# BOOL APIENTRY +-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +-# { +-# __hDllInstance_base = hInst; +-# return TRUE; +-# } +-# /* ltdll.c ends here */ +-])# _LT_AC_FILE_LTDLL_C +- +- +-# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +-# --------------------------------- +-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) +- +- +-# old names +-AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +-AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +-AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +-AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +-AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) +- +-# This is just to silence aclocal about the macro not being used +-ifelse([AC_DISABLE_FAST_INSTALL]) +- +-AC_DEFUN([LT_AC_PROG_GCJ], +-[AC_CHECK_TOOL(GCJ, gcj, no) +- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" +- AC_SUBST(GCJFLAGS) +-]) +- +-AC_DEFUN([LT_AC_PROG_RC], +-[AC_CHECK_TOOL(RC, windres, no) +-]) +- +- +-# Cheap backport of AS_EXECUTABLE_P and required macros +-# from Autoconf 2.59; we should not use $as_executable_p directly. +- +-# _AS_TEST_PREPARE +-# ---------------- +-m4_ifndef([_AS_TEST_PREPARE], +-[m4_defun([_AS_TEST_PREPARE], +-[if test -x / >/dev/null 2>&1; then +- as_executable_p='test -x' +-else +- as_executable_p='test -f' +-fi +-])])# _AS_TEST_PREPARE +- +-# AS_EXECUTABLE_P +-# --------------- +-# Check whether a file is executable. +-m4_ifndef([AS_EXECUTABLE_P], +-[m4_defun([AS_EXECUTABLE_P], +-[AS_REQUIRE([_AS_TEST_PREPARE])dnl +-$as_executable_p $1[]dnl +-])])# AS_EXECUTABLE_P +- +-# NOTE: This macro has been submitted for inclusion into # +-# GNU Autoconf as AC_PROG_SED. When it is available in # +-# a released version of Autoconf we should remove this # +-# macro and use it instead. # +-# LT_AC_PROG_SED +-# -------------- +-# Check for a fully-functional sed program, that truncates +-# as few characters as possible. Prefer GNU sed if found. +-AC_DEFUN([LT_AC_PROG_SED], +-[AC_MSG_CHECKING([for a sed that does not truncate output]) +-AC_CACHE_VAL(lt_cv_path_SED, +-[# Loop through the user's path and test for sed and gsed. +-# Then use that list of sed's as ones to test for truncation. +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for lt_ac_prog in sed gsed; do +- for ac_exec_ext in '' $ac_executable_extensions; do +- if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then +- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" +- fi +- done +- done +-done +-IFS=$as_save_IFS +-lt_ac_max=0 +-lt_ac_count=0 +-# Add /usr/xpg4/bin/sed as it is typically found on Solaris +-# along with /bin/sed that truncates output. +-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do +- test ! -f $lt_ac_sed && continue +- cat /dev/null > conftest.in +- lt_ac_count=0 +- echo $ECHO_N "0123456789$ECHO_C" >conftest.in +- # Check for GNU sed and select it if it is found. +- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then +- lt_cv_path_SED=$lt_ac_sed +- break +- fi +- while true; do +- cat conftest.in conftest.in >conftest.tmp +- mv conftest.tmp conftest.in +- cp conftest.in conftest.nl +- echo >>conftest.nl +- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break +- cmp -s conftest.out conftest.nl || break +- # 10000 chars as input seems more than enough +- test $lt_ac_count -gt 10 && break +- lt_ac_count=`expr $lt_ac_count + 1` +- if test $lt_ac_count -gt $lt_ac_max; then +- lt_ac_max=$lt_ac_count +- lt_cv_path_SED=$lt_ac_sed +- fi +- done +-done +-]) +-SED=$lt_cv_path_SED +-AC_SUBST([SED]) +-AC_MSG_RESULT([$SED]) +-]) +- + # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- + # + # Copyright © 2004 Scott James Remnant . diff --git a/libs/orbit2/patches/010-dont-run-testprograms.patch b/libs/orbit2/patches/010-dont-run-testprograms.patch new file mode 100644 index 0000000..a38e954 --- /dev/null +++ b/libs/orbit2/patches/010-dont-run-testprograms.patch @@ -0,0 +1,38 @@ +--- a/configure ++++ b/configure +@@ -24219,7 +24219,7 @@ if test "$cross_compiling" = yes; then + See \`config.log' for more details." >&5 + $as_echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +--- a/configure.in ++++ b/configure.in +@@ -196,24 +196,6 @@ dnl This generates warnings from autocon + AC_C_BIGENDIAN + + +-dnl +-dnl So many people with broken linking setups asked about this +-dnl it turned out to be necessary to check for this. +-dnl +-dofus_save_libs="$LIBS" +-LIBS="$ORBIT_LIBS $LIBS" +-AC_TRY_RUN([ #include +- main () +- { +- return 0; +- } ],, +- AC_MSG_ERROR([ +-Linking is badly borked on your system. Please ensure your library path is correct +-Check config.log for details - check near the end of the log above 'failed program was' +-Alternatively ensure that your /etc/ld.so.conf (and/or LD_LIBRARY_PATH) includes the +-prefix you're compiling on: '${prefix}' ])) +-LIBS="$dofus_save_libs" +- + orig_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $ORBIT_CFLAGS" + AC_CHECK_ALIGNOF(CORBA_octet) diff --git a/libs/ortp/Makefile b/libs/ortp/Makefile new file mode 100644 index 0000000..6ba9031 --- /dev/null +++ b/libs/ortp/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ortp +PKG_VERSION:=0.16.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:= \ + http://download.savannah.gnu.org/releases-noredirect/linphone/ortp/sources/ \ + http://www.very-clever.com/download/nongnu/linphone/ortp/sources/ +PKG_MD5SUM:=2b0281600cb958d1c94e318a86b62fe3 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libortp + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Real-time Transport Protocol (RTP) library + URL:=http://www.linphone.org/index.php/eng/code_review/ortp + DEPENDS:= +libpthread +endef + +ifneq ($(CONFIG_avr32),) + TARGET_CFLAGS += -fsigned-char +endif + +CONFIGURE_ARGS += \ + --disable-debug \ + --enable-ipv6 \ + --enable-perf \ + --disable-ssl-hmac \ + --disable-so-reuseaddr \ + --without-srtp \ + +CONFIGURE_VARS += \ + ac_cv_header_srtp_srtp_h=no \ + ac_cv_lib_srtp_srtp_init=no \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/include/ortp \ + $(1)/usr/include/ \ + ) + $(INSTALL_DIR) $(1)/usr/lib + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/libortp.{a,so*} \ + $(1)/usr/lib/ \ + ) + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/pkgconfig/ortp.pc \ + $(1)/usr/lib/pkgconfig/ \ + ) +endef + +define Package/libortp/install + $(INSTALL_DIR) $(1)/usr/lib + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/libortp.so.* \ + $(1)/usr/lib/ \ + ) +endef + +$(eval $(call BuildPackage,libortp)) diff --git a/libs/ossp-js/Makefile b/libs/ossp-js/Makefile new file mode 100644 index 0000000..129cd12 --- /dev/null +++ b/libs/ossp-js/Makefile @@ -0,0 +1,119 @@ +# +# Copyright (C) 2008 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:=js +PKG_VERSION:=1.6.20070208 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.ossp.org/pkg/lib/js/ +PKG_MD5SUM:=07f6cad7e03fd74a949588c3d4b333de + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=aclocal.m4 libtool.m4 + +include $(INCLUDE_DIR)/package.mk + +PKG_INSTALL=1 + +define Package/js/Default + TITLE:=Mozilla JavaScript Engine + URL:=http://www.ossp.org/pkg/lib/js/ +endef + +define Package/js +$(call Package/js/Default) + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=JavaScript + TITLE+= (interpreter) + DEPENDS+= +libjs +libreadline +libncurses +endef + +define Package/libjs +$(call Package/js/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= (library) +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --with-dso \ + --with-editline \ + --with-file \ + --without-perl + +define Build/Configure + (cd $(PKG_BUILD_DIR); rm -f config.cache; \ + ./configure \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --datadir=/usr/share \ + --includedir=/usr/include \ + --infodir=/usr/share/info \ + --libdir=/usr/lib \ + --libexecdir=/usr/lib \ + --localstatedir=/var \ + --mandir=/usr/share/man \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + $(DISABLE_NLS) \ + --disable-shared \ + --enable-static \ + ); + $(MAKE) -C $(PKG_BUILD_DIR) src/jsautocfg.h + $(call Build/Configure/Default) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(2)/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/js-config \ + $(2)/bin/ + $(SED) \ + 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ + $(2)/bin/js-config + + $(INSTALL_DIR) $(1)/usr/include + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/js \ + $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libjs.{la,so*} \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/js.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/js/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/js \ + $(1)/usr/bin/ +endef + +define Package/libjs/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libjs.so.* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,js)) +$(eval $(call BuildPackage,libjs)) diff --git a/libs/pcre/Makefile b/libs/pcre/Makefile new file mode 100644 index 0000000..723d4d4 --- /dev/null +++ b/libs/pcre/Makefile @@ -0,0 +1,86 @@ +# +# Copyright (C) 2006-2011 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:=pcre +PKG_VERSION:=8.11 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/pcre +PKG_MD5SUM:=ef907b8792ec7f90f0dcd773848f0b3b + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libpcre/default + SECTION:=libs + CATEGORY:=Libraries + URL:=http://www.pcre.org/ +endef + +define Package/libpcre + $(call Package/libpcre/default) + TITLE:=A Perl Compatible Regular Expression library +endef + +define Package/libpcrecpp + $(call Package/libpcre/default) + TITLE:=C++ wrapper for Perl Compatible Regular Expression library + DEPENDS:=+libpcre +libstdcpp +endef + + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-utf8 \ + --enable-unicode-properties \ + +ifneq ($(CONFIG_PACKAGE_libpcrecpp),) + CONFIGURE_ARGS+= --enable-cpp +else + CONFIGURE_ARGS+= --disable-cpp +endif + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS)" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pcre-config $(1)/usr/bin/ + + $(INSTALL_DIR) $(2)/bin + $(LN) $(STAGING_DIR)/usr/bin/pcre-config $(2)/bin + + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/pcre*.h $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre*.{a,so*} $(1)/usr/lib// + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpcre*.pc $(1)/usr/lib/pkgconfig/ + +endef + +define Package/libpcre/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre{,posix}.so.* $(1)/usr/lib/ +endef + +define Package/libpcrecpp/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcrecpp.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libpcre)) +$(eval $(call BuildPackage,libpcrecpp)) diff --git a/libs/pcre/patches/750-pcre_config_cross.patch b/libs/pcre/patches/750-pcre_config_cross.patch new file mode 100644 index 0000000..1a5ab00 --- /dev/null +++ b/libs/pcre/patches/750-pcre_config_cross.patch @@ -0,0 +1,26 @@ +--- a/pcre-config.in ++++ b/pcre-config.in +@@ -24,6 +24,10 @@ case `uname -s` in + libR=" -Wl,-R@libdir@" + ;; + esac ++libS= ++if test @libdir@ != /usr/lib ; then ++ libS=-L@libdir@ ++fi + + while test $# -gt 0; do + case "$1" in +@@ -58,10 +62,10 @@ while test $# -gt 0; do + echo $includes @PCRE_STATIC_CFLAG@ + ;; + --libs-posix) +- echo -L@libdir@$libR -lpcreposix -lpcre ++ echo $libS$libR -lpcreposix -lpcre + ;; + --libs) +- echo -L@libdir@$libR -lpcre ++ echo $libS$libR -lpcre + ;; + --libs-cpp) + if test @enable_cpp@ = yes ; then diff --git a/libs/phidget21/Makefile b/libs/phidget21/Makefile new file mode 100644 index 0000000..70a2ef8 --- /dev/null +++ b/libs/phidget21/Makefile @@ -0,0 +1,86 @@ +# +# Copyright (C) 2009 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:=phidget21 +PKG_VERSION:=2.1.6.20091105 +PKG_RELEASE:=1 + +PKG_SOURCE:=Phidgetlinux_$(PKG_VERSION).tar.gz +PKG_BUILD_DIR:=$(BUILD_DIR)/Phidgetlinux +PKG_SOURCE_URL:=http://www.phidgets.com/downloads/libraries/ +PKG_MD5SUM:=eb48c7fc68ab189a0255c35e71d55ecd + +include $(INCLUDE_DIR)/package.mk + +define Package/phidget21 + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libpthread + TITLE:=Phidget API + URL:=http://www.phidgets.com/ +endef + +define Package/phidget21/description + The Phidget API library. +endef + +define Package/phidget-service + SECTION:=misc + CATEGORY:=Network + TITLE:=Phidget Web Service + URL:=http://www.phidgets.com/ + DEPENDS:=phidget21 +endef + +define Package/phidget-service/description + The Phidget Web Service. +endef + +define Build/Configure + $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/include/ + $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/lib/ +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/phidget21 \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) -Wall -Wno-strict-aliasing -fpic -D_LINUX -I. -Iutils" \ + INSTALLPREFIX="$(PKG_INSTALL_DIR)" LDCONFIG="" \ + all install + $(MAKE) -C $(PKG_BUILD_DIR)/webservice \ + $(TARGET_CONFIGURE_OPTS) LDCONFIG="true" \ + CFLAGS="$(TARGET_CFLAGS) -Wall -Wno-strict-aliasing -fpic -D_LINUX -I. -Iutils" \ + phidget21internal.h + $(MAKE) -C $(PKG_BUILD_DIR)/webservice \ + $(TARGET_CONFIGURE_OPTS) LDCONFIG="true" \ + LIBS="-lphidget21 -lpthread -ldl -L../phidget21" \ + CFLAGS="$(TARGET_CFLAGS) -static -D_LINUX -I. -I../phidget21 -I../phidget21/utils" \ + webservice21 +endef + +define Build/InstallDev + ls $(PKG_INSTALL_DIR) + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/phidget21.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libphidget21.so $(1)/usr/lib/ +endef + +define Package/phidget21/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libphidget21.so $(1)/usr/lib/ +endef + +define Package/phidget-service/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/webservice/phidgetwebservice21 $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,phidget21)) +$(eval $(call BuildPackage,phidget-service)) diff --git a/libs/poco/Makefile b/libs/poco/Makefile new file mode 100644 index 0000000..2b75e1f --- /dev/null +++ b/libs/poco/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=poco +PKG_VERSION:=1.3.6p2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.sourceforge.net/project/poco/sources/poco-1.3.6 +PKG_MD5SUM:=32d154ca5f34d20217c0baaffa432c1c + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/poco + NAME:=poco + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Poco C++ libraries + URL:=http://www.pocoproject.org/ + DEPENDS:=+libstdcpp +libpthread +librt +endef + +define Package/poco/description + Modern, powerful open source C++ class libraries and frameworks for building + network- and internet-based applications that run on desktop, server and + embedded systems. +endef + +CONFIGURE_ARGS += \ + --config=Linux \ + --no-tests \ + --no-samples \ + --no-fpenvironment \ + --no-sharedmemory \ + --no-wstring + +define Package/poco/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libPoco{Foundation,XML,Net,Util}.so* $(1)/usr/lib/ +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) -r $(PKG_INSTALL_DIR)/usr/include/Poco $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libPoco{Foundation,XML,Net,Util}.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,poco)) diff --git a/libs/poco/patches/100-sharedmemory.patch b/libs/poco/patches/100-sharedmemory.patch new file mode 100644 index 0000000..811a964 --- /dev/null +++ b/libs/poco/patches/100-sharedmemory.patch @@ -0,0 +1,26 @@ +--- a/configure ++++ b/configure +@@ -50,6 +50,11 @@ + Useful if your C++ compiler has incomplete floating-point support + (such as uClibc-based systems). + ++ --no-sharedmemory ++ Compile with -DPOCO_NO_SHAREDMEMORY ++ Useful if your C++ compiler has incomplete shared memory support ++ (such as uClibc-based systems). ++ + --omit={,} + Do not build the specified component(s). + Example: --omit=Data/MySQL,Data/ODBC,Zip +@@ -140,6 +145,10 @@ + flags="$flags -DPOCO_NO_FPENVIRONMENT" + fi + ++ if [ "$1" = "--no-sharedmemory" ] ; then ++ flags="$flags -DPOCO_NO_SHAREDMEMORY" ++ fi ++ + if [ "$1" = "--poquito" ] ; then + flags="$flags -DPOCO_NO_FILECHANNEL -DPOCO_NO_SPLITTERCHANNEL -DPOCO_NO_SYSLOGCHANNEL -DPOCO_UTIL_NO_INIFILECONFIGURATION -DPOCO_UTIL_NO_XMLCONFIGURATION" + fi + diff --git a/libs/polarssl/Makefile b/libs/polarssl/Makefile new file mode 100644 index 0000000..5dc2cf4 --- /dev/null +++ b/libs/polarssl/Makefile @@ -0,0 +1,81 @@ +# +# Copyright (C) 2011 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:=polarssl +PKG_VERSION:=1.1.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-gpl.tgz +PKG_SOURCE_URL:=http://polarssl.org/code/releases +PKG_MD5SUM:=fdd367e3b5ab43ed2af8ffbdfaf0fb81 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/polarssl/Default + SUBMENU:=SSL + TITLE:=Embedded SSL + URL:=http://polarssl.org/ +endef + +define Package/polarssl/Default/description +The aim of the PolarSSL project is to provide a quality, open-source +cryptographic library written in C and targeted at embedded systems. +endef + +define Package/libpolarssl +$(call Package/polarssl/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= (library) +endef + +define Package/libpolarssl/description +$(call Package/polarssl/Default/description) +This package contains the PolarSSL library. +endef + +define Package/polarssl-progs +$(call Package/polarssl/Default) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libpolarssl + TITLE+= (programs) +endef + +define Package/polarssl-progs/description +$(call Package/polarssl/Default/description) +This package contains the PolarSSL programs. +endef + +PKG_INSTALL:=1 + +CMAKE_OPTIONS += \ + -DCMAKE_BUILD_TYPE:String="Release" \ + -DUSE_SHARED_POLARSSL_LIBRARY:Bool=ON \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/polarssl $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpolarssl.so* $(1)/usr/lib/ +endef + +define Package/libpolarssl/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpolarssl.so* $(1)/usr/lib/ +endef + +define Package/polarssl-progs/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libpolarssl)) +$(eval $(call BuildPackage,polarssl-progs)) diff --git a/libs/polarssl/patches/100-disable-testsuites.patch b/libs/polarssl/patches/100-disable-testsuites.patch new file mode 100644 index 0000000..b001cd6 --- /dev/null +++ b/libs/polarssl/patches/100-disable-testsuites.patch @@ -0,0 +1,29 @@ +--- a/tests/CMakeLists.txt 2012-05-20 18:37:02.390717106 +0200 ++++ b/tests/CMakeLists.txt 2012-05-20 18:37:12.282800152 +0200 +@@ -26,26 +26,3 @@ + endfunction(add_test_suite) + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-unused-value") +- +-add_test_suite(aes) +-add_test_suite(arc4) +-add_test_suite(base64) +-add_test_suite(camellia) +-add_test_suite(cipher cipher.aes) +-add_test_suite(cipher cipher.camellia) +-add_test_suite(cipher cipher.des) +-add_test_suite(ctr_drbg) +-add_test_suite(debug) +-add_test_suite(des) +-add_test_suite(dhm) +-add_test_suite(error) +-add_test_suite(hmac_shax) +-add_test_suite(md) +-add_test_suite(mdx) +-add_test_suite(mpi) +-add_test_suite(pkcs1_v21) +-add_test_suite(shax) +-add_test_suite(rsa) +-add_test_suite(version) +-add_test_suite(xtea) +-add_test_suite(x509parse) diff --git a/libs/popt/Makefile b/libs/popt/Makefile new file mode 100644 index 0000000..1cdcc40 --- /dev/null +++ b/libs/popt/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=popt +PKG_VERSION:=1.7 +PKG_RELEASE:=5 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/ +PKG_MD5SUM:=5988e7aeb0ae4dac8d83561265984cc9 + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=autogen.sh aclocal.m4 + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(FPIC) + +define Package/libpopt + SECTION:=libs + CATEGORY:=Libraries + TITLE:=A command line option parsing library + URL:=http://rpm5.org/files/popt/ +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/popt.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpopt.{a,so*} $(1)/usr/lib/ +endef + +define Package/libpopt/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpopt.so.* $(1)/usr/lib/ +endef + +$(eval $(call RequireCommand,xgettext, \ + $(PKG_NAME) requires the GNU gettext development package installed on the local system to build. \ +)) + +$(eval $(call BuildPackage,libpopt)) + diff --git a/libs/popt/patches/002-no-intl.patch b/libs/popt/patches/002-no-intl.patch new file mode 100644 index 0000000..2f9a4e0 --- /dev/null +++ b/libs/popt/patches/002-no-intl.patch @@ -0,0 +1,81 @@ +--- a/configure.in ++++ b/configure.in +@@ -64,25 +64,14 @@ else + AC_MSG_RESULT(no) + fi + +-if test ! -f ../rpm.c +-then +- AC_MSG_CHECKING(for GNU xgettext) +- xgettext --version 2>&1 | grep 'GNU gettext' >/dev/null 2>&1 || AC_MSG_ERROR([ +- *** GNU gettext is required. The latest version +- *** is always available from ftp://ftp.gnu.org/gnu/gettext/.]) +- AC_MSG_RESULT(yes) +-fi +- + AC_CHECK_FUNCS(strerror mtrace getuid geteuid) + AC_CHECK_FUNC(setreuid, [], [ + AC_CHECK_LIB(ucb, setreuid, [if echo $LIBS | grep -- -lucb >/dev/null ;then :; else LIBS="$LIBS -lc -lucb" USEUCB=y;fi]) + ]) + +-AM_GNU_GETTEXT +- + POPT_SOURCE_PATH="`pwd`" + AC_DEFINE_UNQUOTED(POPT_SOURCE_PATH, "$POPT_SOURCE_PATH", + [Full path to popt top_sourcedir.]) + AC_SUBST(POPT_SOURCE_PATH) + +-AC_OUTPUT([Doxyfile Makefile intl/Makefile po/Makefile.in]) ++AC_OUTPUT([Doxyfile Makefile]) +--- a/Makefile.am ++++ b/Makefile.am +@@ -4,10 +4,9 @@ AUTOMAKE_OPTIONS = 1.4 foreign + + EXTRA_DIST = autogen.sh CHANGES $(man_MANS) popt.spec \ + testit.sh test-poptrc \ +- po/*.in po/*.po po/popt.pot \ + popt.ps + +-SUBDIRS = intl po ++SUBDIRS = + + INCLUDES = -I. -I$(top_srcdir) + +--- a/Makefile.in ++++ b/Makefile.in +@@ -124,7 +124,7 @@ EXTRA_DIST = autogen.sh CHANGES $(man_MA + popt.ps + + +-SUBDIRS = intl po ++SUBDIRS = + + INCLUDES = -I. -I$(top_srcdir) + +@@ -160,7 +160,7 @@ subdir = . + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = config.h +-CONFIG_CLEAN_FILES = Doxyfile intl/Makefile ++CONFIG_CLEAN_FILES = Doxyfile + LTLIBRARIES = $(lib_LTLIBRARIES) + + libpopt_la_LDFLAGS = +@@ -261,8 +261,6 @@ distclean-hdr: + -rm -f config.h stamp-h1 + Doxyfile: $(top_builddir)/config.status Doxyfile.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +-intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in +- cd $(top_builddir) && $(SHELL) ./config.status $@ + libLTLIBRARIES_INSTALL = $(INSTALL) + install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) +@@ -584,7 +582,7 @@ distcleancheck_listfiles = find . -type + distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) +- $(mkinstalldirs) $(distdir)/. $(distdir)/intl $(distdir)/po ++ $(mkinstalldirs) $(distdir)/. + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ diff --git a/libs/postgresql/Makefile b/libs/postgresql/Makefile new file mode 100644 index 0000000..74d2ceb --- /dev/null +++ b/libs/postgresql/Makefile @@ -0,0 +1,250 @@ +# +# Copyright (C) 2006-2012 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:=postgresql +PKG_VERSION:=9.0.1 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=\ + http://ftp9.us.postgresql.org/pub/mirrors/postgresql/source/v$(PKG_VERSION) \ + http://ftp.be.postgresql.org/postgresql/source/v$(PKG_VERSION) \ + ftp://ftp-archives.postgresql.org/pub/source/v$(PKG_VERSION) +PKG_MD5SUM:=57ba57e43cfe29e16dacbf5789be98d1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libpq + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+zlib +libreadline +libpthread +libncurses +shadow-su + TITLE:=PostgreSQL client library + URL:=http://www.postgresql.org/ + SUBMENU:=database +endef + +define Package/libpq/description +PostgreSQL client library. +endef + +define Package/pgsql-cli + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libpq + TITLE:=Command Line Interface (CLI) to PostgreSQL databases + URL:=http://www.postgresql.org/ + SUBMENU:=database +endef + +define Package/pgsql-cli/description +Command Line Interface (CLI) to PostgreSQL databases. +endef + +define Package/pgsql-server + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libpq + TITLE:=PostgreSQL databases Server + URL:=http://www.postgresql.org/ + SUBMENU:=database +endef + +define Package/pgsql-server/description +PostgreSQL databases Server. +endef + +# Need a native ecpg ,pg_config, and zic for build +define Build/Configure + (cd $(PKG_BUILD_DIR); rm -f config.cache; \ + ./configure \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --datadir=/usr/share \ + --includedir=/usr/include \ + --infodir=/usr/share/info \ + --libdir=/usr/lib \ + --libexecdir=/usr/lib \ + --localstatedir=/var \ + --mandir=/usr/share/man \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + $(DISABLE_NLS) \ + --enable-shared \ + --enable-static \ + --disable-integer-datetimes \ + --disable-rpath \ + --without-java \ + --without-krb4 \ + --without-krb5 \ + --without-openssl \ + --without-pam \ + --without-perl \ + --without-python \ + --without-readline \ + --without-rendezvous \ + --without-tcl \ + --without-tk \ + --with-zlib="yes" \ + --enable-depend \ + --with-system-timezone=/tmp \ + ); + $(MAKE) -C $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc CC="$(HOSTCC)" CFLAGS+="-I../../libpq" + mv $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg \ + $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg.host + $(MAKE) -C $(PKG_BUILD_DIR)/src/timezone CC="$(HOSTCC)" + mv $(PKG_BUILD_DIR)/src/timezone/zic $(PKG_BUILD_DIR)/host-zic + $(INSTALL_DIR) $(STAGING_DIR)/host/bin/ + $(CP) $(PKG_BUILD_DIR)/host-zic $(STAGING_DIR)/host/bin/zic + $(MAKE) -C $(PKG_BUILD_DIR)/src/bin/pg_config CC="$(HOSTCC)" + mv $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config \ + $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config.host + $(MAKE) -C $(PKG_BUILD_DIR) distclean + + (cd $(PKG_BUILD_DIR); rm -f config.cache; \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$$$$CPPFLAGS $(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --program-prefix="" \ + --program-suffix="" \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --datadir=/usr/share \ + --includedir=/usr/include \ + --infodir=/usr/share/info \ + --libdir=/usr/lib \ + --libexecdir=/usr/lib \ + --localstatedir=/var \ + --mandir=/usr/share/man \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + $(DISABLE_NLS) \ + $(DISABLE_LARGEFILE) \ + --enable-shared \ + --enable-static \ + --disable-integer-datetimes \ + --disable-rpath \ + --without-java \ + --without-krb4 \ + --without-krb5 \ + --without-openssl \ + --without-pam \ + --without-perl \ + --without-python \ + --without-rendezvous \ + --without-tcl \ + --without-tk \ + --with-zlib="yes" \ + --enable-depend \ + $(if $(CONFIG_TARGET_avr32),--disable-spinlocks) \ + ); + $(SED) 's@ECPG = ../../preproc/ecpg@ECPG = ../../preproc/ecpg.host@' $(PKG_BUILD_DIR)/src/interfaces/ecpg/test/Makefile.regress +endef + +TARGET_CFLAGS += $(FPIC) + +# because PROFILE means something else in the project Makefile +unexport PROFILE + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all + +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install +endef + +define Package/libpq/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpq.so.* $(1)/usr/lib/ +endef + +define Package/pgsql-cli/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/psql $(1)/usr/bin/ +endef + +define Package/pgsql-server/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/share/postgresql + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin + ln -sf postgres $(1)/usr/bin/postmaster + + $(INSTALL_BIN) ./files/postgresql.init $(1)/etc/init.d/postgresql + + $(CP) -r $(PKG_INSTALL_DIR)/usr/share/postgresql/* \ + $(1)/usr/share/postgresql + + $(INSTALL_DATA) ./files/postgresql.config $(1)/etc/config/postgresql + + $(CP) -r \ + $(PKG_INSTALL_DIR)/usr/lib/postgresql \ + $(1)/usr/lib +endef + +define Package/pgsql-server/conffiles +/etc/config/postgresql +endef + +define Package/pgsql-server/postinst +#!/bin/sh +grep -q '^postgres:' /etc/passwd && exit 0 +group=$$(grep '^postgres:' /etc/group | cut -f3 -d:) +if [ -z "$${group}" ] ; then + group=1000 + tst=$$(cat /etc/group | grep ":$${group}:") + while [ -n "$${tst}" ] ; do + group=$$(($${group}+1)) + tst=$$(cat /etc/group | grep ":$${group}:") + done + echo "postgres:x:$${group}:" >>/etc/group +fi + +user=$$(cat /etc/passwd | grep "^postgres:") +if [ -z "$${user}" ] ; then + num="$${group}" + tst=$$(cat /etc/passwd | grep ":.*:$${num}:") + while [ -n "$${tst}" ] ; do + num=$$(($${num}+1)) + tst=$$(cat /etc/passwd | grep ":.*:$${num}:") + done + echo "postgres:*:$${num}:$${group}:PostgreSQL administrator:/tmp:/bin/ash" >>/etc/passwd +fi +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config.host $(1)/usr/bin/pg_config + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libpq $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/libpq-fe.h $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/pg_config.h $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/pg_config_manual.h $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/postgres_ext.h $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/postgresql $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpq.{a,so*} $(1)/usr/lib/ + $(CP) $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg.host $(1)/usr/bin/ecpg + $(CP) $(PKG_BUILD_DIR)/host-zic $(1)/usr/bin/zic +endef + +$(eval $(call BuildPackage,libpq)) +$(eval $(call BuildPackage,pgsql-cli)) +$(eval $(call BuildPackage,pgsql-server)) diff --git a/libs/postgresql/files/postgresql.config b/libs/postgresql/files/postgresql.config new file mode 100644 index 0000000..df17c12 --- /dev/null +++ b/libs/postgresql/files/postgresql.config @@ -0,0 +1,5 @@ +config postgresql config + option PGUSER postgres + option PGDATA /var/postgresql/data + option PGLOG /var/postgresql/data/postgresql.log + option PG_CTL /usr/bin/pg_ctl diff --git a/libs/postgresql/files/postgresql.init b/libs/postgresql/files/postgresql.init new file mode 100644 index 0000000..1e1c52f --- /dev/null +++ b/libs/postgresql/files/postgresql.init @@ -0,0 +1,93 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 + +EXTRA_COMMANDS="status reload" + +config_load "postgresql" +config_get pgdata config PGDATA +config_get pguser config PGUSER +config_get pgctl config PG_CTL +config_get pglog config PGLOG + +start() { + if [ ! -e /usr/bin/su ]; then + echo "The su command is requred to run postgres" + exit 1 + fi + + if [ ! -d ${pgdata} ]; then + echo "Create the data directory (${pgdata}) and try again" + exit 1 + fi + + echo "starting postgres..." + # make sure localhost (without a dot) is in /etc/hosts + grep -q 'localhost$' /etc/hosts || echo '127.0.0.1 localhost' >> /etc/hosts + + # for whatever reason, /dev/null gets wrong perms + chmod a+w /dev/null + + if [ -f ${pgdata}/postmaster.pid ]; then + rm ${pgdata}/postmaster.pid + fi + + config_get pgopts config PGOPTS + if [ -n "${pgopts}" ]; then + pgopts="-o ${pgopts}" + fi + /usr/bin/su ${pguser} -c "/usr/bin/postmaster -D '${pgdata}' &" >> ${pglog} 2>&1 + + while : + do + cnt=$((${cnt} + 1)) + if [ -f "${pgdata}/postmaster.pid" ]; then + ret=0 + break + fi + + if [ ${cnt} -eq 30 ]; then + echo "Postgres failed to start. See ${pglog} for details" + ret=1 + break + fi + sleep 1 + done + + echo "ok" + return ${ret} +} + +stop() { + echo "stopping postgres..." + /usr/bin/su ${pguser} -c "${pgctl} stop -D '${pgdata}' -s -m fast" + ret=$? + if [ -f ${pgdata}/postmaster.pid ]; then + rm ${pgdata}/postmaster.pid + fi + echo "ok" + return ${ret} +} + +restart() { + echo "restarting postgres..." + /usr/bin/su ${pguser} -c "${pgctl} stop -D '${pgdata}' -s -m fast -w" + if [ -f ${pgdata}/postmaster.pid ]; then + rm ${pgdata}/postmaster.pid + fi + /usr/bin/su ${pguser} -c "/usr/bin/postmaster -D '${pgdata}' &" >> ${pglog} 2>&1 + echo "ok" + return $? +} + +reload() { + echo "reloading postgres..." + /usr/bin/su ${pguser} -c "${pgctl} reload -D '${pgdata}' -s" + echo "ok" +} + +status() { + echo "status postgres..." + /usr/bin/su ${pguser} -c "${pgctl} status -D '${pgdata}'" + echo "ok" +} diff --git a/libs/postgresql/patches/200-ranlib.patch b/libs/postgresql/patches/200-ranlib.patch new file mode 100644 index 0000000..1b68b83 --- /dev/null +++ b/libs/postgresql/patches/200-ranlib.patch @@ -0,0 +1,10 @@ +--- a/src/port/Makefile ++++ b/src/port/Makefile +@@ -53,6 +53,7 @@ uninstall: + + libpgport.a: $(OBJS) + $(AR) $(AROPT) $@ $^ ++ $(RANLIB) libpgport.a + + # thread.o needs PTHREAD_CFLAGS (but thread_srv.o does not) + thread.o: thread.c diff --git a/libs/postgresql/patches/800-busybox-default-pager.patch b/libs/postgresql/patches/800-busybox-default-pager.patch new file mode 100644 index 0000000..3cd2532 --- /dev/null +++ b/libs/postgresql/patches/800-busybox-default-pager.patch @@ -0,0 +1,13 @@ +--- a/src/bin/psql/print.h ++++ b/src/bin/psql/print.h +@@ -171,10 +171,6 @@ extern void printQuery(const PGresult *r + extern void setDecimalLocale(void); + extern const printTextFormat *get_line_style(const printTableOpt *opt); + +-#ifndef __CYGWIN__ +-#define DEFAULT_PAGER "more" +-#else + #define DEFAULT_PAGER "less" +-#endif + + #endif /* PRINT_H */ diff --git a/libs/protobuf-c/Makefile b/libs/protobuf-c/Makefile new file mode 100644 index 0000000..fd1e4f6 --- /dev/null +++ b/libs/protobuf-c/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2011 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:=protobuf-c +PKG_VERSION:=0.15 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://protobuf-c.googlecode.com/files +PKG_MD5SUM:=73ff0c8df50d2eee75269ad8f8c07dc8 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libprotobuf-c + TITLE:=Protocol Buffers library + SECTION:=libs + CATEGORY:=Libraries + URL:=http://code.google.com/p/protobuf-c/ +endef + +define Package/libprotobuf-c/description + Runtime library to use Google Protocol Buffers from C applications. + Protocol Buffers are a way of encoding structured data in an efficient yet + extensible format. Google uses Protocol Buffers for almost all of its + internal RPC protocols and file formats. +endef + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-protoc + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/google/protobuf-c + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/google/protobuf-c/* \ + $(1)/usr/include/google/protobuf-c/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libprotobuf-c.{a,la,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/ +endef + +define Package/libprotobuf-c/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libprotobuf-c.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libprotobuf-c)) diff --git a/libs/protobuf/Makefile b/libs/protobuf/Makefile new file mode 100644 index 0000000..f82027b --- /dev/null +++ b/libs/protobuf/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (C) 2007 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:=protobuf +PKG_VERSION:=2.4.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://protobuf.googlecode.com/files +PKG_MD5SUM:=ed436802019c9e1f40cc750eaf78f318 + +PKG_BUILD_DEPENDS:=protobuf/host + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk + +define Package/protobuf + SECTION:=libs + CATEGORY:=Libraries + TITLE:=A structured data encoding library + URL:=http://code.google.com/p/protobuf/ + DEPENDS:=+zlib +libpthread +libstdcpp + MAINTAINER:=Obinou +endef + +define Package/protobuf/description + Protocol Buffers are a way of encoding structured data in an efficient + yet extensible format. Google uses Protocol Buffers for almost all + of its internal RPC protocols and file formats. +endef + +CONFIGURE_ARGS += --with-protoc=$(STAGING_DIR_HOST)/bin/protoc + +define Build/InstallDev + $(INSTALL_DIR) \ + $(1)/usr/lib \ + $(1)/usr/include + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/* \ + $(1)/usr/include/ + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/* \ + $(1)/usr/lib/ +endef + +define Package/protobuf/install + $(INSTALL_DIR) \ + $(1)/usr/lib + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libprotoc.so* \ + $(1)/usr/lib/ + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libprotobuf-lite.so* \ + $(1)/usr/lib/ + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libprotobuf.so* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,protobuf)) +$(eval $(call HostBuild)) diff --git a/libs/pthsem/Makefile b/libs/pthsem/Makefile new file mode 100644 index 0000000..c40930b --- /dev/null +++ b/libs/pthsem/Makefile @@ -0,0 +1,59 @@ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=pthsem +PKG_VERSION:=2.0.8 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.auto.tuwien.ac.at/~mkoegler/pth/ +PKG_MD5SUM:=9144b26dcc27e67498d63dd5456f934c + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/pthsem + SECTION:=libs + CATEGORY:=Libraries + TITLE:=GNU pth extended with semaphore support + URL:=http://www.auto.tuwien.ac.at/~mkoegler/index.php/pth + DEPENDS:=@USE_EGLIBC @TARGET_x86 +endef + +define Package/pthsem/description + GNU pth is a user mode multi threading library. + pthsem is an extend version, with support for semaphores added. It can be installed parallel to a normal pth. +endef + +MAKE_FLAGS += \ + OPTIM="$(TARGET_CFLAGS)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" + +define Build/InstallDev + $(INSTALL_DIR) $(2)/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/pthsem-config \ + $(2)/bin/ + $(SED) \ + 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ + $(2)/bin/pthsem-config + + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h \ + $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpthsem.{a,la,so*} \ + $(1)/usr/lib/ +endef + +define Package/pthsem/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpthsem.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,pthsem)) diff --git a/libs/ptlib/Makefile b/libs/ptlib/Makefile new file mode 100644 index 0000000..bac7a2e --- /dev/null +++ b/libs/ptlib/Makefile @@ -0,0 +1,109 @@ +# +# Copyright (C) 2006-2009 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:=ptlib +PKG_VERSION:=2.2.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.bz2 +PKG_SOURCE_URL:=@SF/opalvoip +PKG_MD5SUM:=dc266ba315e130b304854592e6388725 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/ptlib + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libexpat + TITLE:=Portable Tools library + URL:=http://www.opalvoip.org/ +endef + +define Package/ptlib/description + PTLib is a moderately large class library that has its genesis many years ago as + PWLib (portable Windows Library), a method to product applications to run on both + Microsoft Windows and Unix X-Windows systems. It also was to have a Macintosh port + as well but that never eventuated. The parts of the library relating to GUI + functions have long been removed as other class libraries such as wxWidgets were + much more advanced. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-minsize \ + --enable-opal \ + --enable-internalregex \ + --enable-audio \ + --disable-alsa \ + --disable-asn \ + --disable-avc \ + --enable-configfile \ + --disable-dc \ + --disable-dtmf \ + --enable-expat \ + --disable-ftp \ + --disable-http \ + --disable-httpsvc \ + --disable-jabber \ + --disable-odbc \ + --disable-openldap \ + --disable-openssl \ + --disable-oss \ + --disable-pipechan \ + --disable-plugins \ + --disable-pop3smtp \ + --disable-remconn \ + --enable-resolver \ + --enable-qos \ + --disable-sasl \ + --disable-sdl \ + --disable-serial \ + --disable-shm-video \ + --disable-snmp \ + --disable-soap \ + --disable-socks \ + --enable-stun \ + --disable-telnet \ + --disable-tts \ + --disable-v4l \ + --disable-v4l2 \ + --disable-bsdvideo \ + --disable-video \ + --disable-vxml \ + --enable-wavfile \ + --disable-xmlrpc \ + +CONFIGURE_VARS += \ + CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti" \ + +CONFIGURE_CMD = ./configure + +define Build/Configure/Default + (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \ + if [ -x $(CONFIGURE_CMD) ]; then \ + $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/$(3)/ && \ + $(CONFIGURE_VARS) \ + $(2) \ + $(CONFIGURE_CMD) \ + $(CONFIGURE_ARGS) \ + $(1); \ + fi; \ + ) +endef + +MAKE_FLAGS += optnoshared + +define Build/InstallDev + ln -sf $(PKG_NAME)_$(PKG_VERSION) $(BUILD_DIR)/$(PKG_NAME) + $(SED) 's|//\(#include \)|\1|' $(PKG_BUILD_DIR)/include/ptlib.h +endef + +$(eval $(call BuildPackage,ptlib)) diff --git a/libs/ptlib/patches/010-fix-gcc_4_3-compile.patch b/libs/ptlib/patches/010-fix-gcc_4_3-compile.patch new file mode 100644 index 0000000..2242794 --- /dev/null +++ b/libs/ptlib/patches/010-fix-gcc_4_3-compile.patch @@ -0,0 +1,13 @@ +diff --git a/src/ptclib/sockagg.cxx b/src/ptclib/sockagg.cxx +index a8f89d2..c1960f6 100644 +--- a/src/ptclib/sockagg.cxx ++++ b/src/ptclib/sockagg.cxx +@@ -38,6 +38,7 @@ + + #include + #include +- ++#include ++ + #define new PNEW + diff --git a/libs/ptlib/patches/020-uclibc-res_nsearch.patch b/libs/ptlib/patches/020-uclibc-res_nsearch.patch new file mode 100644 index 0000000..f644350 --- /dev/null +++ b/libs/ptlib/patches/020-uclibc-res_nsearch.patch @@ -0,0 +1,14 @@ +diff -Naur ptlib-2.10.4.orig/src/ptclib/pdns.cxx ptlib-2.10.4/src/ptclib/pdns.cxx +--- ptlib-2.10.4.orig/src/ptclib/pdns.cxx 2012-03-12 13:34:10.000000000 -0400 ++++ ptlib-2.10.4/src/ptclib/pdns.cxx 2012-03-12 13:35:05.000000000 -0400 +@@ -37,6 +37,10 @@ + #include + #include + ++#if defined(__UCLIBC__) ++ #undef P_HAS_RES_NINIT ++#endif ++ + #define new PNEW + + #define USE_RESOLVER_CACHING 1 diff --git a/libs/pwlib/Makefile b/libs/pwlib/Makefile new file mode 100644 index 0000000..84e4f3e --- /dev/null +++ b/libs/pwlib/Makefile @@ -0,0 +1,90 @@ +# +# Copyright (C) 2006-2009 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:=pwlib +PKG_VERSION:=1.11.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://peternixon.net/pub/voxgratia +PKG_MD5SUM:=e1102dfd2608e3a117a2e016d0db53e3 + +PKG_BUILD_DIR:=$(BUILD_DIR)/pwlib-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/pwlib + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Portable Windows library + URL:=http://www.voxgratia.org/ +endef + +define Package/pwlib/description + PWLib is a moderately large class library that was created as a method to + produce applications that run on both Microsoft Windows and the X Window + System. +endef + +TARGET_CFLAGS += $(FPIC) -fpermissive + +CONFIGURE_ARGS += \ + --enable-minsize \ + --enable-openh323 \ + --enable-opal \ + --disable-internalregex \ + --disable-plugins \ + --enable-audio \ + --disable-alsa \ + --enable-asn \ + --disable-avc \ + --disable-dc \ + --disable-dtmf \ + --disable-expat \ + --disable-ftp \ + --enable-http \ + --disable-httpsvc \ + --disable-jabber \ + --disable-openldap \ + --disable-openssl \ + --disable-oss \ + --disable-pipechan \ + --disable-pop3smtp \ + --disable-remconn \ + --disable-resolver \ + --disable-qos \ + --disable-sasl \ + --disable-sdl \ + --disable-serial \ + --disable-shm-video \ + --disable-snmp \ + --disable-soap \ + --disable-socks \ + --enable-stun \ + --disable-telnet \ + --disable-tts \ + --disable-v4l \ + --disable-v4l2 \ + --disable-bsdvideo \ + --disable-video \ + --disable-vxml \ + --disable-wavfile \ + --disable-xmlrpc \ + +CONFIGURE_VARS += \ + STDCXXFLAGS="$(TARGET_CFLAGS) -fno-builtin" \ + +MAKE_FLAGS += optnoshared + +define Build/InstallDev + ln -sf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR)/$(PKG_NAME) + $(SED) 's|//\(#include \)|\1|' $(PKG_BUILD_DIR)/include/ptlib.h +endef + +$(eval $(call BuildPackage,pwlib)) diff --git a/libs/pwlib/patches/002-lib_mak.patch b/libs/pwlib/patches/002-lib_mak.patch new file mode 100644 index 0000000..43018bd --- /dev/null +++ b/libs/pwlib/patches/002-lib_mak.patch @@ -0,0 +1,11 @@ +--- pwlib-cvs-20051227/make/lib.mak.orig 2005-09-25 12:51:23.000000000 +0200 ++++ pwlib-cvs-20051227/make/lib.mak 2005-12-30 01:18:21.000000000 +0100 +@@ -201,7 +201,7 @@ + LDSOOPTS += -Wl,--kill-at + else + ifneq ($(OSTYPE),Darwin) +- LDSOOPTS += -Wl,-soname,$(LIB_SONAME) ++ LDSOOPTS += -soname,$(LIB_SONAME) + endif + endif + LD = $(CPLUS) diff --git a/libs/radiusclient-ng/Makefile b/libs/radiusclient-ng/Makefile new file mode 100644 index 0000000..3d125b9 --- /dev/null +++ b/libs/radiusclient-ng/Makefile @@ -0,0 +1,96 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=radiusclient-ng +PKG_VERSION:=0.5.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.berlios.de/radiusclient-ng/ +PKG_MD5SUM:=6fb7d4d0aefafaee7385831ac46a8e9c + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/radiusclient-ng/Default + URL:=http://developer.berlios.de/projects/radiusclient-ng/ +endef + +define Package/radiusclient-ng/Default/description + Purpose of this project is to build a portable, easy-to-use and + standard compliant library suitable for developing free and commercial + software that need support for RADIUS protocol (RFCs 2128 and 2139). +endef + +define Package/libradiusclient-ng +$(call Package/radiusclient-ng/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE:=RADIUS client library +endef + +define Package/libradiusclient-ng/description +$(call Package/radiusclient-ng/Default/description) + This package contains shared libraries, needed by other programs. +endef + +define Package/libradiusclient-ng/conffiles +/etc/radiusclient-ng/issue +/etc/radiusclient-ng/port-id-map +/etc/radiusclient-ng/radiusclient.conf +/etc/radiusclient-ng/servers +endef + +define Package/radiusclient-ng + $(call Package/radiusclient-ng/Default) + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libradiusclient-ng + TITLE:=RADIUS client +endef + +define Package/radiusclient-ng/description +$(call Package/radiusclient-ng/Default/description) + This package contains a RADIUS client. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/radiusclient-ng.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libradiusclient-ng.{a,so}* $(1)/usr/lib/ +endef + +define Package/libradiusclient-ng/install + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/radiusclient-ng $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libradiusclient-ng.so.* $(1)/usr/lib/ +endef + +define Package/radiusclient-ng/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rad{acct,iusclient,login,status} $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,libradiusclient-ng)) +$(eval $(call BuildPackage,radiusclient-ng)) diff --git a/libs/radiusclient-ng/patches/001-cross_compile.patch b/libs/radiusclient-ng/patches/001-cross_compile.patch new file mode 100644 index 0000000..3925563 --- /dev/null +++ b/libs/radiusclient-ng/patches/001-cross_compile.patch @@ -0,0 +1,48 @@ +--- a/configure ++++ b/configure +@@ -23332,8 +23332,7 @@ echo $ECHO_N "checking for field domainn + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++See \`config.log' for more details." >&2;} } + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +--- a/configure.in ++++ b/configure.in +@@ -104,32 +104,7 @@ AC_REPLACE_FUNCS(strdup strerror strcase + AC_CHECK_FUNCS(flock fcntl uname gethostname sysinfo getdomainname) + AC_CHECK_FUNCS(stricmp random rand snprintf vsnprintf) + +-if test "$ac_cv_func_uname" = 'yes' +-then +- AC_MSG_CHECKING([for field domainname in struct utsname]) +- AC_TRY_RUN([ +- #include +- +- main(int argc, char **argv) +- { +- struct utsname uts; +- uts.domainname[0] = '\0'; +- } +- ], +- AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_STRUCT_UTSNAME_DOMAINNAME), +- AC_MSG_RESULT(no) +- ) +-fi +- +-AC_MSG_CHECKING([for /dev/urandom]) +-if test -c /dev/urandom +-then +- AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_DEV_URANDOM) +-else +- AC_MSG_RESULT(no) +-fi ++AC_DEFINE(HAVE_DEV_URANDOM) + + dnl Determine PATH setting + echo $ac_n "using the following PATH setting for exec'ed programs... $ac_c" 1>&6 diff --git a/libs/radlib/Makefile b/libs/radlib/Makefile new file mode 100644 index 0000000..0f406b2 --- /dev/null +++ b/libs/radlib/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=radlib +PKG_VERSION:=2.12.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/radlib +PKG_SHA1SUM:=1b3feace6d0361436c9e4ce9b06856195a5ac1b1 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/radlib + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libpthread +libsqlite3 + TITLE:=Rapid Application Development Library + URL:=http://www.radlib.teel.ws/ +endef + +define Package/radlib/description + radlib is a rapid application development library for unix multi-process applications +endef + +define Package/radlib-sqlite/description + $(call Package/radlib/description) + This package comes with sqlite support +endef + +EXTRA_LDFLAGS=-lsqlite3 +CONFIGURE_ARGS += \ + --prefix="$(TOOLCHAIN_DIR)/usr" \ + --enable-sqlite + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/h/rad*.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/src/.libs/librad.so* $(1)/usr/lib/ +endef + +define Package/radlib/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/.libs/librad.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/msgRouter/.libs/radmrouted $(1)/usr/bin/ +endef + +define Package/radlib-sqlite/install + $(call Package/radlib/install,$(1)) +endef + +$(eval $(call BuildPackage,radlib)) diff --git a/libs/radlib/patches/001-cross_compile_link_bug.patch b/libs/radlib/patches/001-cross_compile_link_bug.patch new file mode 100644 index 0000000..2c943bd --- /dev/null +++ b/libs/radlib/patches/001-cross_compile_link_bug.patch @@ -0,0 +1,71 @@ +--- a/debug/Makefile.am ++++ b/debug/Makefile.am +@@ -27,8 +27,8 @@ raddebug_LDADD += -lsqlite3 + endif + + # define library directories +-raddebug_LDFLAGS = -L../src/.libs -L$(prefix)/lib -L/usr/lib +-INCLUDES += -I$(prefix)/include -I/usr/include ++raddebug_LDFLAGS = -L../src/.libs -L$(prefix)/lib ++INCLUDES += -I$(prefix)/include + + if MYSQL + raddebug_LDFLAGS += -L$(prefix)/lib64/mysql -L$(prefix)/lib/mysql -L/usr/lib64/mysql -L/usr/lib/mysql +@@ -39,6 +39,6 @@ INCLUDES += -I$(prefix)/pgsql/in + endif + endif + +-if CROSSCOMPILE +-raddebug_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o +-endif ++#if CROSSCOMPILE ++#raddebug_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o ++#endif +--- a/msgRouter/Makefile.am ++++ b/msgRouter/Makefile.am +@@ -27,8 +27,8 @@ radmrouted_LDADD += -lsqlite3 + endif + + # define library directories +-radmrouted_LDFLAGS = -L../src/.libs -L$(prefix)/lib -L/usr/lib +-INCLUDES += -I$(prefix)/include -I/usr/include ++radmrouted_LDFLAGS = -L../src/.libs -L$(prefix)/lib ++INCLUDES += -I$(prefix)/include + + if MYSQL + radmrouted_LDFLAGS += -L$(prefix)/lib64/mysql -L$(prefix)/lib/mysql -L/usr/lib64/mysql -L/usr/lib/mysql +@@ -39,6 +39,6 @@ INCLUDES += -I$(prefix)/pgsql/ + endif + endif + +-if CROSSCOMPILE +-radmrouted_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o +-endif ++#if CROSSCOMPILE ++#radmrouted_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o ++#endif +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -34,9 +34,6 @@ PGSQL_HDRS = \ + $(top_srcdir)/database/postgresql/_pg-types.h + endif + if SQLITE +-SQ_INCLUDES = \ +- -I$(prefix)/include \ +- -I/usr/include + SQ_SOURCES = \ + $(top_srcdir)/src/radsqlite.c + SQLITE_HDRS = \ +@@ -46,11 +43,9 @@ endif + # define include directories + INCLUDES = \ + -I$(top_srcdir)/h \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + $(MY_INCLUDES) \ +- $(PG_INCLUDES) \ +- $(SQ_INCLUDES) ++ $(PG_INCLUDES) + + + diff --git a/libs/rblibtorrent/Makefile b/libs/rblibtorrent/Makefile new file mode 100644 index 0000000..760f185 --- /dev/null +++ b/libs/rblibtorrent/Makefile @@ -0,0 +1,77 @@ +# +# Copyright (C) 2007 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id: Makefile 9173 2007-10-07 03:20:26Z blogic $ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=rblibtorrent +PKG_VERSION:=0.14.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=libtorrent-rasterbar-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/libtorrent +PKG_MD5SUM:=6959f719245d82758235fd73d93373b2 +PKG_BUILD_DIR:=$(BUILD_DIR)/libtorrent-rasterbar-$(PKG_VERSION) +PKG_BUILD_DEPENDS:=libtool +BOOSTPOSTFIX=mt + +include $(INCLUDE_DIR)/package.mk + +define Package/rblibtorrent + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Rasterbar BitTorrent library + URL:=http://www.rasterbar.com/products/libtorrent/ + DEPENDS:=+boost +boost-python +boost-filesystem +boost-regex +boost-thread +boost-program_options +boost-system +libopenssl @BROKEN +endef + +define Package/rblibtorrent/description +Rasterbar libtorrent is a C++ library that aims to be a good alternative to +all the other bittorrent implementations around. It is a library and not a +full featured client, although it comes with a working example client. +endef + +CONFIGURE_ARGS+= \ + --enable-shared \ + --disable-debug \ + --enable-python-binding \ + --with-ssl=$(STAGING_DIR)/usr \ + --with-boost=$(STAGING_DIR)/usr/include \ + --with-boost-libdir=$(STAGING_DIR)/usr/lib \ + --with-zlib=detect \ + --with-boost-system=boost_system-$(BOOSTPOSTFIX) \ + --with-boost-filesystem=boost_filesystem-$(BOOSTPOSTFIX) \ + --with-boost-thread=boost_thread-$(BOOSTPOSTFIX) \ + --with-boost-regex=boost_regex-$(BOOSTPOSTFIX) \ + --with-boost-python=boost_python-$(BOOSTPOSTFIX) \ + --with-boost-program_options=boost_program_options-$(BOOSTPOSTFIX) + +CONFIGURE_VARS+=CC="$(TARGET_CXX)" + +EXTRA_LDFLAGS+=-lz -lpthread + +define Build/Compile + $(call Build/Compile/Default) + $(call Build/Install/Default) +endef + +define Build/InstallDev + mkdir -p $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libtorrent $(1)/usr/include/ + mkdir -p $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/ + mkdir -p $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libtorrent-rasterbar.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/rblibtorrent/install + $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/lib/python2.6/site-packages/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.6/site-packages/*.so* $(1)/usr/lib/python2.6/site-packages/ +endef + +$(eval $(call BuildPackage,rblibtorrent)) diff --git a/libs/rblibtorrent/patches/enable-shared-linking.patch b/libs/rblibtorrent/patches/enable-shared-linking.patch new file mode 100644 index 0000000..dec80cc --- /dev/null +++ b/libs/rblibtorrent/patches/enable-shared-linking.patch @@ -0,0 +1,11 @@ +--- libtorrent-rasterbar-0.14.7/bindings/python/Makefile.in 2009-11-18 09:25:39.000000000 +0100 ++++ libtorrent-rasterbar-0.14.7/bindings/python/Makefile.in 2010-02-26 13:27:58.000000000 +0100 +@@ -408,7 +408,7 @@ + + + @ENABLE_PYTHON_BINDING_TRUE@all-local: +-@ENABLE_PYTHON_BINDING_TRUE@ $(PYTHON) setup.py build ++@ENABLE_PYTHON_BINDING_TRUE@ CXX="$(CXX) -pthread -shared" $(PYTHON) setup.py build + + @ENABLE_PYTHON_BINDING_TRUE@install-exec-local: + @ENABLE_PYTHON_BINDING_TRUE@ $(PYTHON) setup.py install @PYTHON_INSTALL_PARAMS@ diff --git a/libs/re/Makefile b/libs/re/Makefile new file mode 100644 index 0000000..fbafd47 --- /dev/null +++ b/libs/re/Makefile @@ -0,0 +1,64 @@ +# +# Copyright (C) 2010-2011 OpenWrt.org +# Copyright (C) 2010 Alfred E. Heggestad +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=re +PKG_VERSION:=0.4.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.creytiv.com/pub +PKG_MD5SUM:=cff9e0d2bfec09c84e316faaf202809b + +include $(INCLUDE_DIR)/package.mk + +define Package/libre + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libopenssl +libpthread + TITLE:=Generic library for real-time communications with async IO support + URL:=http://www.creytiv.com/ +endef + +TARGET_CFLAGS += $(FPIC) + +ifneq ($(CONFIG_USE_EGLIBC),) +TARGET_CFLAGS += -D_GNU_SOURCE +endif + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + HAVE_LIBRESOLV= \ + CC="$(TARGET_CC)" \ + EXTRA_CFLAGS="$(TARGET_CFLAGS) -DOPENWRT" \ + EXTRA_LFLAGS="-lm" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + SYSROOT="$$$$($(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s#/include/pthread.h##p')" \ + SYSROOT_ALT="$(STAGING_DIR)/usr" \ + RELEASE=1 \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + OS=linux \ + all install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/share/re + $(CP) $(PKG_BUILD_DIR)/mk/re.mk $(1)/usr/share/re/ + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/re $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libre.{a,so} $(1)/usr/lib/ +endef + +define Package/libre/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libre.so $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libre)) diff --git a/libs/rem/Makefile b/libs/rem/Makefile new file mode 100644 index 0000000..0e86b09 --- /dev/null +++ b/libs/rem/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2010-2011 OpenWrt.org +# Copyright (C) 2010 Alfred E. Heggestad +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=rem +PKG_VERSION:=0.4.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.creytiv.com/pub +PKG_MD5SUM:=bfac8837974e911bd4d4017a8f1ce39b + +include $(INCLUDE_DIR)/package.mk + +define Package/librem + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libre +libpthread + TITLE:=Audio and video processing media library + URL:=http://www.creytiv.com/ +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + LIBRE_MK=$(STAGING_DIR)/usr/share/re/re.mk \ + LIBRE_INC=$(STAGING_DIR)/usr/include/re \ + LIBRE_SO=$(STAGING_DIR)/usr/lib \ + CC="$(TARGET_CC)" \ + EXTRA_CFLAGS="$(TARGET_CFLAGS) -DOPENWRT" \ + EXTRA_LFLAGS="-lm" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + SYSROOT="$$$$($(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s#/include/pthread.h##p')" \ + SYSROOT_ALT="$(STAGING_DIR)/usr" \ + RELEASE=1 \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + OS=linux \ + all install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/rem $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/librem.{a,so} $(1)/usr/lib/ +endef + +define Package/librem/install + rm -f $(BUILD_DIR)/$(PKG_NAME) + ln -sf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR)/$(PKG_NAME) + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/librem.so $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,librem)) diff --git a/libs/rrdtool-1.0.x/Makefile b/libs/rrdtool-1.0.x/Makefile new file mode 100644 index 0000000..2ef831f --- /dev/null +++ b/libs/rrdtool-1.0.x/Makefile @@ -0,0 +1,131 @@ +# +# Copyright (C) 2006-2012 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:=rrdtool1 +PKG_VERSION:=1.0.50 +PKG_RELEASE:=2 + +PKG_BUILD_DIR:=$(BUILD_DIR)/rrdtool-$(PKG_VERSION) +PKG_SOURCE:=rrdtool-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:= \ + http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.0.x \ + http://www.fastmirrors.org/rrdtool/rrdtool-1.0.x \ + ftp://ftp.sunet.se/pub/network/monitoring/rrdtool/rrdtool-1.0.x +PKG_MD5SUM:=c466e2e7df95fa8e318e46437da87686 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/rrdtool1/Default + TITLE:=Round Robin Database (RRD) + URL:=http://oss.oetiker.ch/rrdtool/ +endef + +define Package/rrdtool1/description/Default + RRD is the Acronym for Round Robin Database. RRD is a system to store and + display time-series data (i.e. network bandwidth, machine-room temperature, + server load average). It stores the data in a very compact way that will + not expand over time, and it presents useful graphs by processing the data + to enforce a certain data density. It can be used either via simple wrapper + scripts (from shell or Perl) or via frontends that poll network devices and + put friendly user interface on it. + + This is version 1.0.x with cgilib-0.4, gd1.3 and libpng-1.0.9 linked into + librrd.so. The library is much smaller compared to the 1.2.x version with + separate dynamic linked libraries. +endef + +define Package/librrd1 +$(call Package/rrdtool1/Default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+zlib + TITLE+= management library +endef + +define Package/librrd1/description +$(call Package/rrdtool1/description/Default) + This package contains a shared library, used by other programs. +endef + +define Package/rrdcgi1 +$(call Package/rrdtool1/Default) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+librrd1 + TITLE+= CGI graphing tool +endef + +define Package/rrdcgi1/description +$(call Package/rrdtool1/description/Default) + This package contains the rrdcgi tool used to create web pages containing + RRD graphs based on templates. +endef + +define Package/rrdtool1 +$(call Package/rrdtool1/Default) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+librrd1 + TITLE+= management tools +endef + +define Package/rrdtool1/description +$(call Package/rrdtool1/description/Default) + This package contains command line tools used to manage RRDs. +endef + +TARGET_CFLAGS += $(FPIC) --std=c99 + +CONFIGURE_ARGS += \ + $(DISABLE_NLS) \ + --enable-shared=yes \ + --enable-static=yes \ + --disable-rpath \ + --with-gnu-ld \ + --enable-local-zlib + +CONFIGURE_VARS += \ + ac_cv_path_PERL=no \ + rd_cv_ieee_works=yes \ + shrext_cmds=".so" + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + shrext_cmds=".so" \ + all install +endef + +define Package/rrdtool1/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrd{tool,update} $(1)/usr/bin/ +endef + +define Package/rrdcgi1/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdcgi $(1)/usr/bin/ +endef + +define Package/librrd1/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.so.* $(1)/usr/lib/ +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib/rrdtool-1.0/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/rrd.h $(1)/usr/lib/rrdtool-1.0/include/ + $(INSTALL_DIR) $(1)/usr/lib/rrdtool-1.0/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.{a,so*} $(1)/usr/lib/rrdtool-1.0/lib/ +endef + +$(eval $(call BuildPackage,librrd1)) +$(eval $(call BuildPackage,rrdcgi1)) +$(eval $(call BuildPackage,rrdtool1)) diff --git a/libs/rrdtool-1.0.x/patches/001-no_ordering_cd_joke.patch b/libs/rrdtool-1.0.x/patches/001-no_ordering_cd_joke.patch new file mode 100644 index 0000000..442fe49 --- /dev/null +++ b/libs/rrdtool-1.0.x/patches/001-no_ordering_cd_joke.patch @@ -0,0 +1,21 @@ +diff -urN rrdtool-1.0.50/configure rrdtool-1.0.50.new/configure +--- rrdtool-1.0.50/configure 2005-04-25 22:48:09.000000000 +0200 ++++ rrdtool-1.0.50.new/configure 2009-03-09 17:25:38.000000000 +0100 +@@ -24873,17 +24873,12 @@ + echo "${ECHO_T}and out again" >&6 + + echo $ECHO_N "ordering CD from http://people.ee.ethz.ch/~oetiker/wish $ac_c" 1>&6 +-sleep 1 + echo $ECHO_N ".$ac_c" 1>&6 +-sleep 2 + echo $ECHO_N ".$ac_c" 1>&6 +-sleep 1 + echo $ECHO_N ".$ac_c" 1>&6 +-sleep 3 + echo $ECHO_N ".$ac_c" 1>&6 + echo $ECHO_N ".$ac_c" 1>&6 + echo $ECHO_N ".$ac_c" 1>&6 +-sleep 2 + echo "$as_me:$LINENO: result: just kidding ;-)" >&5 + echo "${ECHO_T} just kidding ;-)" >&6 + echo diff --git a/libs/rrdtool-1.0.x/patches/002-no_timezone.patch b/libs/rrdtool-1.0.x/patches/002-no_timezone.patch new file mode 100644 index 0000000..07564b4 --- /dev/null +++ b/libs/rrdtool-1.0.x/patches/002-no_timezone.patch @@ -0,0 +1,24 @@ +--- a/src/rrd_tool.c ++++ b/src/rrd_tool.c +@@ -225,11 +225,8 @@ + struct rusage myusage; + struct timeval starttime; + struct timeval currenttime; +- struct timezone tz; + +- tz.tz_minuteswest =0; +- tz.tz_dsttime=0; +- gettimeofday(&starttime,&tz); ++ gettimeofday(&starttime,NULL); + #endif + + while (fgets(aLine, sizeof(aLine)-1, stdin)){ +@@ -252,7 +249,7 @@ + + #if HAVE_GETRUSAGE + getrusage(RUSAGE_SELF,&myusage); +- gettimeofday(¤ttime,&tz); ++ gettimeofday(¤ttime,NULL); + printf("OK u:%1.2f s:%1.2f r:%1.2f\n", + (double)myusage.ru_utime.tv_sec+ + (double)myusage.ru_utime.tv_usec/1000000.0, diff --git a/libs/rrdtool-1.0.x/patches/020-x86-float-cast.patch b/libs/rrdtool-1.0.x/patches/020-x86-float-cast.patch new file mode 100644 index 0000000..5b8a662 --- /dev/null +++ b/libs/rrdtool-1.0.x/patches/020-x86-float-cast.patch @@ -0,0 +1,13 @@ +Index: rrdtool-1.0.50/src/rrd_format.h +=================================================================== +--- rrdtool-1.0.50.orig/src/rrd_format.h ++++ rrdtool-1.0.50/src/rrd_format.h +@@ -20,7 +20,7 @@ + + #define RRD_COOKIE "RRD" + #define RRD_VERSION "0001" +-#define FLOAT_COOKIE 8.642135E130 ++#define FLOAT_COOKIE ((double)8.642135E130) + + #if defined(WIN32) + #define DNAN ((double)fmod(0.0,0.0)) diff --git a/libs/sctp/Makefile b/libs/sctp/Makefile new file mode 100644 index 0000000..dd9e3a7 --- /dev/null +++ b/libs/sctp/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=lksctp-tools +PKG_VERSION:=1.0.11 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/lksctp/ +PKG_MD5SUM:=e9cf6c57402c9d4f1173a9529466e16d + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +##### +## lksctp library: provides sctp_* functions in user space +##### + +define Package/sctp + SECTION:=libs + CATEGORY:=Network + TITLE:=SCTP user-land library + URL:=http://lksctp.sourceforge.net + DEPENDS:=+kmod-sctp +endef + +define Package/sctp/description + SCTP user-land library for sctp_* functions (when socket API is too limited). +endef + +TARGET_LDFLAGS := -L$(STAGING_DIR)/usr/lib $(TARGET_LDFLAGS) + +define Package/sctp/install + # Install the library in the router + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libsctp.so* \ + $(1)/usr/lib/ + # And also in staging for dependent packages + $(INSTALL_DIR) $(STAGING_DIR)/usr/include/netinet + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/netinet/* \ + $(STAGING_DIR)/usr/include/netinet/ + $(INSTALL_DIR) $(STAGING_DIR)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libsctp.so* \ + $(STAGING_DIR)/usr/lib/ + +endef + +$(eval $(call BuildPackage,sctp)) + diff --git a/libs/serdisplib/Makefile b/libs/serdisplib/Makefile new file mode 100644 index 0000000..7ade455 --- /dev/null +++ b/libs/serdisplib/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2006-2011 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:=serdisplib +PKG_VERSION:=1.97.9 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/serdisplib +PKG_MD5SUM:=130552ec60d01e974712a60274f34de7 + +include $(INCLUDE_DIR)/package.mk + +define Package/serdisplib + SECTION:=libs + CATEGORY:=Libraries + TITLE:=A display control library + URL:=http://serdisplib.sourceforge.net/ + DEPENDS:=+libusb +endef + +define Package/serdisplib/description + serdisplib is a library to drive serial and parallel displays + with built-in controllers. +endef + +CONFIGURE_ARGS+= \ + --enable-shared \ + --enable-static \ + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CFLAGS="$(TARGET_CFLAGS) -Wall -Wno-implicit -I../include -I.." \ + all +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/include/serdisplib $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/lib/libserdisp.{a,so*} $(1)/usr/lib/ +endef + +define Package/serdisplib/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/lib/libserdisp.so.* $(1)/usr/lib +endef + +$(eval $(call BuildPackage,serdisplib)) diff --git a/libs/shflags/Makefile b/libs/shflags/Makefile new file mode 100644 index 0000000..5f1c754 --- /dev/null +++ b/libs/shflags/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2012 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:=shflags +PKG_VERSION:=2012-06-11 +PKG_RELEASE=$(PKG_SOURCE_VERSION) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://dev.freecwmp.org/shflags-clone/ +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=4411ea9115802b86ffee68a2cbbbbf143dfeebbd +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz + +include $(INCLUDE_DIR)/package.mk + +define Package/shflags + SECTION:=libs + CATEGORY:=Libraries + TITLE:=shflags + DEPENDS:=+getopt + URL:=http://code.google.com/p/shflags/ +endef + +define Package/shflags/description + command-line flags module for Unix shell scripts +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Build/Install +endef + +define Package/shflags/install + $(INSTALL_DIR) $(1)/usr/share/shflags + $(CP) $(PKG_BUILD_DIR)/source/1.0/src/shflags $(1)/usr/share/shflags/shflags.sh +endef + +$(eval $(call BuildPackage,shflags)) diff --git a/libs/shflags/patches/000-strip.patch b/libs/shflags/patches/000-strip.patch new file mode 100644 index 0000000..bc05948 --- /dev/null +++ b/libs/shflags/patches/000-strip.patch @@ -0,0 +1,763 @@ +--- a/source/1.0/src/shflags ++++ b/source/1.0/src/shflags +@@ -1,91 +1,10 @@ +-# $Id$ +-# vim:et:ft=sh:sts=2:sw=2 +-# +-# Copyright 2008 Kate Ward. All Rights Reserved. +-# Released under the LGPL (GNU Lesser General Public License) +-# +-# shFlags -- Advanced command-line flag library for Unix shell scripts. +-# http://code.google.com/p/shflags/ +-# +-# Author: kate.ward@forestent.com (Kate Ward) +-# +-# This module implements something like the google-gflags library available +-# from http://code.google.com/p/google-gflags/. +-# +-# FLAG TYPES: This is a list of the DEFINE_*'s that you can do. All flags take +-# a name, default value, help-string, and optional 'short' name (one-letter +-# name). Some flags have other arguments, which are described with the flag. +-# +-# DEFINE_string: takes any input, and intreprets it as a string. +-# +-# DEFINE_boolean: typically does not take any argument: say --myflag to set +-# FLAGS_myflag to true, or --nomyflag to set FLAGS_myflag to false. +-# Alternately, you can say +-# --myflag=true or --myflag=t or --myflag=0 or +-# --myflag=false or --myflag=f or --myflag=1 +-# Passing an option has the same affect as passing the option once. +-# +-# DEFINE_float: takes an input and intreprets it as a floating point number. As +-# shell does not support floats per-se, the input is merely validated as +-# being a valid floating point value. +-# +-# DEFINE_integer: takes an input and intreprets it as an integer. +-# +-# SPECIAL FLAGS: There are a few flags that have special meaning: +-# --help (or -?) prints a list of all the flags in a human-readable fashion +-# --flagfile=foo read flags from foo. (not implemented yet) +-# -- as in getopt(), terminates flag-processing +-# +-# EXAMPLE USAGE: +-# +-# -- begin hello.sh -- +-# #! /bin/sh +-# . ./shflags +-# DEFINE_string name 'world' "somebody's name" n +-# FLAGS "$@" || exit $? +-# eval set -- "${FLAGS_ARGV}" +-# echo "Hello, ${FLAGS_name}." +-# -- end hello.sh -- +-# +-# $ ./hello.sh -n Kate +-# Hello, Kate. +-# +-# NOTE: Not all systems include a getopt version that supports long flags. On +-# these systems, only short flags are recognized. +- +-#============================================================================== +-# shFlags +-# +-# Shared attributes: +-# flags_error: last error message +-# flags_return: last return value +-# +-# __flags_longNames: list of long names for all flags +-# __flags_shortNames: list of short names for all flags +-# __flags_boolNames: list of boolean flag names +-# +-# __flags_opts: options parsed by getopt +-# +-# Per-flag attributes: +-# FLAGS_: contains value of flag named 'flag_name' +-# __flags__default: the default flag value +-# __flags__help: the flag help string +-# __flags__short: the flag short name +-# __flags__type: the flag type +-# +-# Notes: +-# - lists of strings are space separated, and a null value is the '~' char. +- +-# return if FLAGS already loaded + [ -n "${FLAGS_VERSION:-}" ] && return 0 + FLAGS_VERSION='1.0.3' + +-# return values + FLAGS_TRUE=0 + FLAGS_FALSE=1 + FLAGS_ERROR=2 + +-# reserved flag names + FLAGS_RESERVED='ARGC ARGV ERROR FALSE HELP PARENT RESERVED TRUE VERSION' + + _flags_debug() { echo "flags:DEBUG $@" >&2; } +@@ -93,7 +12,6 @@ _flags_warn() { echo "flags:WARN $@" >&2 + _flags_error() { echo "flags:ERROR $@" >&2; } + _flags_fatal() { echo "flags:FATAL $@" >&2; } + +-# specific shell checks + if [ -n "${ZSH_VERSION:-}" ]; then + setopt |grep "^shwordsplit$" >/dev/null + if [ $? -ne ${FLAGS_TRUE} ]; then +@@ -107,20 +25,15 @@ if [ -n "${ZSH_VERSION:-}" ]; then + fi + fi + +-# +-# constants +-# + +-# getopt version + __FLAGS_GETOPT_VERS_STD=0 + __FLAGS_GETOPT_VERS_ENH=1 + __FLAGS_GETOPT_VERS_BSD=2 + + getopt >/dev/null 2>&1 + case $? in +- 0) __FLAGS_GETOPT_VERS=${__FLAGS_GETOPT_VERS_STD} ;; # bsd getopt ++ 0) __FLAGS_GETOPT_VERS=${__FLAGS_GETOPT_VERS_STD} ;; + 2) +- # TODO(kward): look into '-T' option to test the internal getopt() version + if [ "`getopt --version`" = '-- ' ]; then + __FLAGS_GETOPT_VERS=${__FLAGS_GETOPT_VERS_STD} + else +@@ -133,82 +46,49 @@ case $? in + ;; + esac + +-# getopt optstring lengths + __FLAGS_OPTSTR_SHORT=0 + __FLAGS_OPTSTR_LONG=1 + + __FLAGS_NULL='~' + +-# flag info strings + __FLAGS_INFO_DEFAULT='default' + __FLAGS_INFO_HELP='help' + __FLAGS_INFO_SHORT='short' + __FLAGS_INFO_TYPE='type' + +-# flag lengths + __FLAGS_LEN_SHORT=0 + __FLAGS_LEN_LONG=1 + +-# flag types + __FLAGS_TYPE_NONE=0 + __FLAGS_TYPE_BOOLEAN=1 + __FLAGS_TYPE_FLOAT=2 + __FLAGS_TYPE_INTEGER=3 + __FLAGS_TYPE_STRING=4 + +-# set the constants readonly + __flags_constants=`set |awk -F= '/^FLAGS_/ || /^__FLAGS_/ {print $1}'` + for __flags_const in ${__flags_constants}; do +- # skip certain flags + case ${__flags_const} in + FLAGS_HELP) continue ;; + FLAGS_PARENT) continue ;; + esac +- # set flag readonly + if [ -z "${ZSH_VERSION:-}" ]; then + readonly ${__flags_const} +- else # handle zsh ++ else + case ${ZSH_VERSION} in + [123].*) readonly ${__flags_const} ;; +- *) readonly -g ${__flags_const} ;; # declare readonly constants globally ++ *) readonly -g ${__flags_const} ;; + esac + fi + done + unset __flags_const __flags_constants + +-# +-# internal variables +-# +- +-__flags_boolNames=' ' # space separated list of boolean flag names +-__flags_longNames=' ' # space separated list of long flag names +-__flags_shortNames=' ' # space separated list of short flag names +- +-__flags_columns='' # screen width in columns +-__flags_opts='' # temporary storage for parsed getopt flags +- +-#------------------------------------------------------------------------------ +-# private functions +-# +- +-# Define a flag. +-# +-# Calling this function will define the following info variables for the +-# specified flag: +-# FLAGS_flagname - the name for this flag (based upon the long flag name) +-# __flags__default - the default value +-# __flags_flagname_help - the help string +-# __flags_flagname_short - the single letter alias +-# __flags_flagname_type - the type of flag (one of __FLAGS_TYPE_*) +-# +-# Args: +-# _flags__type: integer: internal type of flag (__FLAGS_TYPE_*) +-# _flags__name: string: long flag name +-# _flags__default: default flag value +-# _flags__help: string: help string +-# _flags__short: string: (optional) short flag name +-# Returns: +-# integer: success of operation, or error ++ ++__flags_boolNames=' ' ++__flags_longNames=' ' ++__flags_shortNames=' ' ++__flags_columns='' ++__flags_opts='' ++ + _flags_define() + { + if [ $# -lt 4 ]; then +@@ -226,16 +106,13 @@ _flags_define() + + _flags_return_=${FLAGS_TRUE} + +- # TODO(kward): check for validity of the flag name (e.g. dashes) + +- # check whether the flag name is reserved + echo " ${FLAGS_RESERVED} " |grep " ${_flags_name_} " >/dev/null + if [ $? -eq 0 ]; then + flags_error="flag name (${_flags_name_}) is reserved" + _flags_return_=${FLAGS_ERROR} + fi + +- # require short option for getopt that don't support long options + if [ ${_flags_return_} -eq ${FLAGS_TRUE} \ + -a ${__FLAGS_GETOPT_VERS} -ne ${__FLAGS_GETOPT_VERS_ENH} \ + -a "${_flags_short_}" = "${__FLAGS_NULL}" ] +@@ -244,7 +121,6 @@ _flags_define() + _flags_return_=${FLAGS_ERROR} + fi + +- # check for existing long name definition + if [ ${_flags_return_} -eq ${FLAGS_TRUE} ]; then + if _flags_itemInList "${_flags_name_}" \ + ${__flags_longNames} ${__flags_boolNames} +@@ -255,7 +131,6 @@ _flags_define() + fi + fi + +- # check for existing short name definition + if [ ${_flags_return_} -eq ${FLAGS_TRUE} \ + -a "${_flags_short_}" != "${__FLAGS_NULL}" ] + then +@@ -266,9 +141,6 @@ _flags_define() + fi + fi + +- # handle default value. note, on several occasions the 'if' portion of an +- # if/then/else contains just a ':' which does nothing. a binary reversal via +- # '!' is not done because it does not work on all shells. + if [ ${_flags_return_} -eq ${FLAGS_TRUE} ]; then + case ${_flags_type_} in + ${__FLAGS_TYPE_BOOLEAN}) +@@ -301,7 +173,7 @@ _flags_define() + fi + ;; + +- ${__FLAGS_TYPE_STRING}) ;; # everything in shell is a valid string ++ ${__FLAGS_TYPE_STRING}) ;; + + *) + flags_error="unrecognized flag type '${_flags_type_}'" +@@ -311,7 +183,6 @@ _flags_define() + fi + + if [ ${_flags_return_} -eq ${FLAGS_TRUE} ]; then +- # store flag information + eval "FLAGS_${_flags_name_}='${_flags_default_}'" + eval "__flags_${_flags_name_}_${__FLAGS_INFO_TYPE}=${_flags_type_}" + eval "__flags_${_flags_name_}_${__FLAGS_INFO_DEFAULT}=\ +@@ -319,7 +190,6 @@ _flags_define() + eval "__flags_${_flags_name_}_${__FLAGS_INFO_HELP}=\"${_flags_help_}\"" + eval "__flags_${_flags_name_}_${__FLAGS_INFO_SHORT}='${_flags_short_}'" + +- # append flag name(s) to list of names + __flags_longNames="${__flags_longNames}${_flags_name_} " + __flags_shortNames="${__flags_shortNames}${_flags_short_} " + [ ${_flags_type_} -eq ${__FLAGS_TYPE_BOOLEAN} ] && \ +@@ -333,17 +203,6 @@ _flags_define() + return ${flags_return} + } + +-# Return valid getopt options using currently defined list of long options. +-# +-# This function builds a proper getopt option string for short (and long) +-# options, using the current list of long options for reference. +-# +-# Args: +-# _flags_optStr: integer: option string type (__FLAGS_OPTSTR_*) +-# Output: +-# string: generated option string for getopt +-# Returns: +-# boolean: success of operation (always returns True) + _flags_genOptStr() + { + _flags_optStrType_=$1 +@@ -358,7 +217,6 @@ _flags_genOptStr() + ${_flags_flag_} ${__FLAGS_INFO_SHORT}` + if [ "${_flags_shortName_}" != "${__FLAGS_NULL}" ]; then + _flags_opts_="${_flags_opts_}${_flags_shortName_}" +- # getopt needs a trailing ':' to indicate a required argument + [ ${_flags_type_} -ne ${__FLAGS_TYPE_BOOLEAN} ] && \ + _flags_opts_="${_flags_opts_}:" + fi +@@ -366,7 +224,6 @@ _flags_genOptStr() + + ${__FLAGS_OPTSTR_LONG}) + _flags_opts_="${_flags_opts_:+${_flags_opts_},}${_flags_flag_}" +- # getopt needs a trailing ':' to indicate a required argument + [ ${_flags_type_} -ne ${__FLAGS_TYPE_BOOLEAN} ] && \ + _flags_opts_="${_flags_opts_}:" + ;; +@@ -379,15 +236,6 @@ _flags_genOptStr() + return ${FLAGS_TRUE} + } + +-# Returns flag details based on a flag name and flag info. +-# +-# Args: +-# string: long flag name +-# string: flag info (see the _flags_define function for valid info types) +-# Output: +-# string: value of dereferenced flag variable +-# Returns: +-# integer: one of FLAGS_{TRUE|FALSE|ERROR} + _flags_getFlagInfo() + { + _flags_name_=$1 +@@ -399,13 +247,6 @@ _flags_getFlagInfo() + if [ -n "${_flags_value_}" ]; then + flags_return=${FLAGS_TRUE} + else +- # see if the _flags_name_ variable is a string as strings can be empty... +- # note: the DRY principle would say to have this function call itself for +- # the next three lines, but doing so results in an infinite loop as an +- # invalid _flags_name_ will also not have the associated _type variable. +- # Because it doesn't (it will evaluate to an empty string) the logic will +- # try to find the _type variable of the _type variable, and so on. Not so +- # good ;-) + _flags_typeVar_="__flags_${_flags_name_}_${__FLAGS_INFO_TYPE}" + _flags_strToEval_="_flags_type_=\"\${${_flags_typeVar_}:-}\"" + eval "${_flags_strToEval_}" +@@ -424,15 +265,6 @@ _flags_getFlagInfo() + return ${flags_return} + } + +-# check for presense of item in a list. passed a string (e.g. 'abc'), this +-# function will determine if the string is present in the list of strings (e.g. +-# ' foo bar abc '). +-# +-# Args: +-# _flags__str: string: string to search for in a list of strings +-# unnamed: list: list of strings +-# Returns: +-# boolean: true if item is in the list + _flags_itemInList() + { + _flags_str_=$1 +@@ -449,34 +281,22 @@ _flags_itemInList() + return ${flags_return} + } + +-# Returns the width of the current screen. +-# +-# Output: +-# integer: width in columns of the current screen. + _flags_columns() + { + if [ -z "${__flags_columns}" ]; then +- # determine the value and store it + if eval stty size >/dev/null 2>&1; then +- # stty size worked :-) + set -- `stty size` + __flags_columns=$2 + elif eval tput cols >/dev/null 2>&1; then + set -- `tput cols` + __flags_columns=$1 + else +- __flags_columns=80 # default terminal width ++ __flags_columns=80 + fi + fi + echo ${__flags_columns} + } + +-# Validate a boolean. +-# +-# Args: +-# _flags__bool: boolean: value to validate +-# Returns: +-# bool: true if the value is a valid boolean + _flags_validateBoolean() + { + _flags_bool_=$1 +@@ -492,12 +312,6 @@ _flags_validateBoolean() + return ${flags_return} + } + +-# Validate a float. +-# +-# Args: +-# _flags__float: float: value to validate +-# Returns: +-# bool: true if the value is a valid float + _flags_validateFloat() + { + _flags_float_=$1 +@@ -507,10 +321,10 @@ _flags_validateFloat() + else + flags_return=${FLAGS_TRUE} + case ${_flags_float_} in +- -*) # negative floats ++ -*) + _flags_test_=`expr "${_flags_float_}" : '\(-[0-9][0-9]*\.[0-9][0-9]*\)'` + ;; +- *) # positive floats ++ *) + _flags_test_=`expr "${_flags_float_}" : '\([0-9][0-9]*\.[0-9][0-9]*\)'` + ;; + esac +@@ -521,22 +335,16 @@ _flags_validateFloat() + return ${flags_return} + } + +-# Validate an integer. +-# +-# Args: +-# _flags__integer: interger: value to validate +-# Returns: +-# bool: true if the value is a valid integer + _flags_validateInteger() + { + _flags_int_=$1 + + flags_return=${FLAGS_TRUE} + case ${_flags_int_} in +- -*) # negative ints ++ -*) + _flags_test_=`expr "${_flags_int_}" : '\(-[0-9][0-9]*\)'` + ;; +- *) # positive ints ++ *) + _flags_test_=`expr "${_flags_int_}" : '\([0-9][0-9]*\)'` + ;; + esac +@@ -546,23 +354,12 @@ _flags_validateInteger() + return ${flags_return} + } + +-# Parse command-line options using the standard getopt. +-# +-# Note: the flag options are passed around in the global __flags_opts so that +-# the formatting is not lost due to shell parsing and such. +-# +-# Args: +-# @: varies: command-line options to parse +-# Returns: +-# integer: a FLAGS success condition + _flags_getoptStandard() + { + flags_return=${FLAGS_TRUE} + _flags_shortOpts_=`_flags_genOptStr ${__FLAGS_OPTSTR_SHORT}` + +- # check for spaces in passed options + for _flags_opt_ in "$@"; do +- # note: the silliness with the x's is purely for ksh93 on Ubuntu 6.06 + _flags_match_=`echo "x${_flags_opt_}x" |sed 's/ //g'` + if [ "${_flags_match_}" != "x${_flags_opt_}x" ]; then + flags_error='the available getopt does not support spaces in options' +@@ -585,15 +382,6 @@ _flags_getoptStandard() + return ${flags_return} + } + +-# Parse command-line options using the enhanced getopt. +-# +-# Note: the flag options are passed around in the global __flags_opts so that +-# the formatting is not lost due to shell parsing and such. +-# +-# Args: +-# @: varies: command-line options to parse +-# Returns: +-# integer: a FLAGS success condition + _flags_getoptEnhanced() + { + flags_return=${FLAGS_TRUE} +@@ -617,17 +405,6 @@ _flags_getoptEnhanced() + return ${flags_return} + } + +-# Dynamically parse a getopt result and set appropriate variables. +-# +-# This function does the actual conversion of getopt output and runs it through +-# the standard case structure for parsing. The case structure is actually quite +-# dynamic to support any number of flags. +-# +-# Args: +-# argc: int: original command-line argument count +-# @: varies: output from getopt parsing +-# Returns: +-# integer: a FLAGS success condition + _flags_parseGetopt() + { + _flags_argc_=$1 +@@ -638,35 +415,26 @@ _flags_parseGetopt() + if [ ${__FLAGS_GETOPT_VERS} -ne ${__FLAGS_GETOPT_VERS_ENH} ]; then + set -- $@ + else +- # note the quotes around the `$@' -- they are essential! + eval set -- "$@" + fi + +- # provide user with number of arguments to shift by later +- # NOTE: the FLAGS_ARGC variable is obsolete as of 1.0.3 because it does not +- # properly give user access to non-flag arguments mixed in between flag +- # arguments. Its usage was replaced by FLAGS_ARGV, and it is being kept only +- # for backwards compatibility reasons. + FLAGS_ARGC=`expr $# - 1 - ${_flags_argc_}` + +- # handle options. note options with values must do an additional shift + while true; do + _flags_opt_=$1 + _flags_arg_=${2:-} + _flags_type_=${__FLAGS_TYPE_NONE} + _flags_name_='' + +- # determine long flag name + case "${_flags_opt_}" in +- --) shift; break ;; # discontinue option parsing ++ --) shift; break ;; + +- --*) # long option ++ --*) + _flags_opt_=`expr "${_flags_opt_}" : '--\(.*\)'` + _flags_len_=${__FLAGS_LEN_LONG} + if _flags_itemInList "${_flags_opt_}" ${__flags_longNames}; then + _flags_name_=${_flags_opt_} + else +- # check for negated long boolean version + if _flags_itemInList "${_flags_opt_}" ${__flags_boolNames}; then + _flags_name_=`expr "${_flags_opt_}" : 'no\(.*\)'` + _flags_type_=${__FLAGS_TYPE_BOOLEAN} +@@ -675,12 +443,10 @@ _flags_parseGetopt() + fi + ;; + +- -*) # short option ++ -*) + _flags_opt_=`expr "${_flags_opt_}" : '-\(.*\)'` + _flags_len_=${__FLAGS_LEN_SHORT} + if _flags_itemInList "${_flags_opt_}" ${__flags_shortNames}; then +- # yes. match short name to long name. note purposeful off-by-one +- # (too high) with awk calculations. + _flags_pos_=`echo "${__flags_shortNames}" \ + |awk 'BEGIN{RS=" ";rn=0}$0==e{rn=NR}END{print rn}' \ + e=${_flags_opt_}` +@@ -690,14 +456,12 @@ _flags_parseGetopt() + ;; + esac + +- # die if the flag was unrecognized + if [ -z "${_flags_name_}" ]; then + flags_error="unrecognized option (${_flags_opt_})" + flags_return=${FLAGS_ERROR} + break + fi + +- # set new flag value + [ ${_flags_type_} -eq ${__FLAGS_TYPE_NONE} ] && \ + _flags_type_=`_flags_getFlagInfo \ + "${_flags_name_}" ${__FLAGS_INFO_TYPE}` +@@ -746,7 +510,6 @@ _flags_parseGetopt() + ;; + esac + +- # handle special case help flag + if [ "${_flags_name_}" = 'help' ]; then + if [ ${FLAGS_help} -eq ${FLAGS_TRUE} ]; then + flags_help +@@ -756,12 +519,10 @@ _flags_parseGetopt() + fi + fi + +- # shift the option and non-boolean arguements out. + shift + [ ${_flags_type_} != ${__FLAGS_TYPE_BOOLEAN} ] && shift + done + +- # give user back non-flag arguments + FLAGS_ARGV='' + while [ $# -gt 0 ]; do + FLAGS_ARGV="${FLAGS_ARGV:+${FLAGS_ARGV} }'$1'" +@@ -773,43 +534,18 @@ _flags_parseGetopt() + return ${flags_return} + } + +-#------------------------------------------------------------------------------ +-# public functions +-# +- +-# A basic boolean flag. Boolean flags do not take any arguments, and their +-# value is either 1 (false) or 0 (true). For long flags, the false value is +-# specified on the command line by prepending the word 'no'. With short flags, +-# the presense of the flag toggles the current value between true and false. +-# Specifying a short boolean flag twice on the command results in returning the +-# value back to the default value. +-# +-# A default value is required for boolean flags. +-# +-# For example, lets say a Boolean flag was created whose long name was 'update' +-# and whose short name was 'x', and the default value was 'false'. This flag +-# could be explicitly set to 'true' with '--update' or by '-x', and it could be +-# explicitly set to 'false' with '--noupdate'. ++ + DEFINE_boolean() { _flags_define ${__FLAGS_TYPE_BOOLEAN} "$@"; } + +-# Other basic flags. + DEFINE_float() { _flags_define ${__FLAGS_TYPE_FLOAT} "$@"; } + DEFINE_integer() { _flags_define ${__FLAGS_TYPE_INTEGER} "$@"; } + DEFINE_string() { _flags_define ${__FLAGS_TYPE_STRING} "$@"; } + +-# Parse the flags. +-# +-# Args: +-# unnamed: list: command-line flags to parse +-# Returns: +-# integer: success of operation, or error + FLAGS() + { +- # define a standard 'help' flag if one isn't already defined + [ -z "${__flags_help_type:-}" ] && \ + DEFINE_boolean 'help' false 'show this help' 'h' + +- # parse options + if [ $# -gt 0 ]; then + if [ ${__FLAGS_GETOPT_VERS} -ne ${__FLAGS_GETOPT_VERS_ENH} ]; then + _flags_getoptStandard "$@" +@@ -818,7 +554,6 @@ FLAGS() + fi + flags_return=$? + else +- # nothing passed; won't bother running getopt + __flags_opts='--' + flags_return=${FLAGS_TRUE} + fi +@@ -832,23 +567,11 @@ FLAGS() + return ${flags_return} + } + +-# This is a helper function for determining the `getopt` version for platforms +-# where the detection isn't working. It simply outputs debug information that +-# can be included in a bug report. +-# +-# Args: +-# none +-# Output: +-# debug info that can be included in a bug report +-# Returns: +-# nothing + flags_getoptInfo() + { +- # platform info + _flags_debug "uname -a: `uname -a`" + _flags_debug "PATH: ${PATH}" + +- # shell info + if [ -n "${BASH_VERSION:-}" ]; then + _flags_debug 'shell: bash' + _flags_debug "BASH_VERSION: ${BASH_VERSION}" +@@ -857,7 +580,6 @@ flags_getoptInfo() + _flags_debug "ZSH_VERSION: ${ZSH_VERSION}" + fi + +- # getopt info + getopt >/dev/null + _flags_getoptReturn=$? + _flags_debug "getopt return: ${_flags_getoptReturn}" +@@ -866,39 +588,16 @@ flags_getoptInfo() + unset _flags_getoptReturn + } + +-# Returns whether the detected getopt version is the enhanced version. +-# +-# Args: +-# none +-# Output: +-# none +-# Returns: +-# bool: true if getopt is the enhanced version + flags_getoptIsEnh() + { + test ${__FLAGS_GETOPT_VERS} -eq ${__FLAGS_GETOPT_VERS_ENH} + } + +-# Returns whether the detected getopt version is the standard version. +-# +-# Args: +-# none +-# Returns: +-# bool: true if getopt is the standard version + flags_getoptIsStd() + { + test ${__FLAGS_GETOPT_VERS} -eq ${__FLAGS_GETOPT_VERS_STD} + } + +-# This is effectively a 'usage()' function. It prints usage information and +-# exits the program with ${FLAGS_FALSE} if it is ever found in the command line +-# arguments. Note this function can be overridden so other apps can define +-# their own --help flag, replacing this one, if they want. +-# +-# Args: +-# none +-# Returns: +-# integer: success of operation (always returns true) + flags_help() + { + if [ -n "${FLAGS_HELP:-}" ]; then +@@ -953,19 +652,14 @@ flags_help() + echo "${flags_helpStr_}" >&2 + else + echo " ${flags_flagStr_} ${flags_help_}" >&2 +- # note: the silliness with the x's is purely for ksh93 on Ubuntu 6.06 +- # because it doesn't like empty strings when used in this manner. + flags_emptyStr_="`echo \"x${flags_flagStr_}x\" \ + |awk '{printf "%"length($0)-2"s", ""}'`" + flags_helpStr_=" ${flags_emptyStr_} ${flags_defaultStr_}" + flags_helpStrLen_=`expr "${flags_helpStr_}" : '.*'` + if [ ${__FLAGS_GETOPT_VERS} -eq ${__FLAGS_GETOPT_VERS_STD} \ + -o ${flags_helpStrLen_} -lt ${flags_columns_} ]; then +- # indented to match help string + echo "${flags_helpStr_}" >&2 + else +- # indented four from left to allow for longer defaults as long flag +- # names might be used too, making things too long + echo " ${flags_defaultStr_}" >&2 + fi + fi +@@ -978,12 +672,6 @@ flags_help() + return ${FLAGS_TRUE} + } + +-# Reset shflags back to an uninitialized state. +-# +-# Args: +-# none +-# Returns: +-# nothing + flags_reset() + { + for flags_name_ in ${__flags_longNames}; do +@@ -1000,7 +688,6 @@ flags_reset() + eval ${flags_strToEval_} + done + +- # reset internal variables + __flags_boolNames=' ' + __flags_longNames=' ' + __flags_shortNames=' ' diff --git a/libs/slang2/Makefile b/libs/slang2/Makefile new file mode 100644 index 0000000..594bc82 --- /dev/null +++ b/libs/slang2/Makefile @@ -0,0 +1,97 @@ +# +# Copyright (C) 2006-2011 Openwrt.org +# Copyright (C) 2011 SMBPhone Inc. +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=slang +PKG_VERSION:=2.2.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://space.mit.edu/pub/davis/slang/v2.2 \ + ftp://space.mit.edu/pub/davis/slang/v2.2/OLD +PKG_MD5SUM:=7fcfd447e378f07dd0c0bae671fe6487 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libslang2 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=S-Lang v2.2 + URL:=http://www.jedsoft.org/slang + DEPENDS:= +terminfo +endef + +define Package/libslang2/description + Multi-platform programmer's library providing facilities for interactive + applications. Includes such things as display/screen management, + keyboard input, keymaps, etc. Includes the embeddable S-Lang interpreter. +endef + +define Package/slsh + SECTION:=lang + CATEGORY:=Languages + TITLE:=S-Lang Shell + URL:=http://www.jedsoft.org/slang/slsh.html + DEPENDS:= +libslang2 +endef + +define Package/libslang2/description + This is a shell which is mostly just a wrapper around the S-Lang Interpreter, + which is part of the S-Lang Library. +endef + +TARGET_CFLAGS += $(FPIC) +TARGET_LDFLAGS += -L../src/${ARCH}elfobjs + +CONFIGURE_ARGS += \ + --enable-largefile \ + --disable-warnings \ + --with-terminfo=default \ + --with-readline=slang \ + --without-x \ + --without-pcre \ + --without-onig \ + --without-png \ + --without-z \ + ac_cv_path_nc5config=$(PWD)/files/ncurses5-config + +define Build/Compile + $(call Build/Compile/Default) + $(MAKE) -C $(PKG_BUILD_DIR) \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + static install install-static +endef + +define Package/libslang2/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libslang.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/slang/ $(1)/usr/lib/ +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libslang.{a,so*} $(1)/usr/lib/ +endef + +define Package/slsh/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/slsh $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/slsh/ $(1)/usr/share/ +endef + +$(eval $(call BuildPackage,libslang2)) +$(eval $(call BuildPackage,slsh)) diff --git a/libs/slang2/files/ncurses5-config b/libs/slang2/files/ncurses5-config new file mode 100755 index 0000000..210d43f --- /dev/null +++ b/libs/slang2/files/ncurses5-config @@ -0,0 +1,6 @@ +#!/bin/sh + +if [ "$1" == "--terminfo" ]; then + echo "/usr/share/terminfo" +fi + diff --git a/libs/spandsp/Makefile b/libs/spandsp/Makefile new file mode 100644 index 0000000..e2054a0 --- /dev/null +++ b/libs/spandsp/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2010-2012 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:=spandsp +PKG_VERSION:=0.0.6 +PKG_VERSION_SUFFIX:=pre17 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_VERSION_SUFFIX).tgz +PKG_SOURCE_URL:=http://www.soft-switch.org/downloads/spandsp/ +PKG_MD5SUM:=cc860f77270cf3b881f8ccd42d2d0238 + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/libspandsp + SECTION:=libs + CATEGORY:=Libraries + TITLE:=spandsp library + DEPENDS:=+libtiff +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/{lib,include} + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspandsp* $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ +endef + +define Package/libspandsp/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspandsp*so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libspandsp)) diff --git a/libs/spandsp/patches/100-compile-fixes.patch b/libs/spandsp/patches/100-compile-fixes.patch new file mode 100644 index 0000000..afe9e33 --- /dev/null +++ b/libs/spandsp/patches/100-compile-fixes.patch @@ -0,0 +1,23 @@ +--- a/src/spandsp/fast_convert.h ++++ b/src/spandsp/fast_convert.h +@@ -197,7 +197,7 @@ extern "C" + { + return (long int) (x); + } +-#elif defined(__ppc__) || defined(__powerpc__) ++#elif defined(THISISNOTDEFINEDYADDAYADDA) + static __inline__ long int lfastrint(register double x) + { + int res[2]; +--- a/configure.ac ++++ b/configure.ac +@@ -152,9 +152,7 @@ AC_ARG_ENABLE(builtin_tiff, + + AC_FUNC_ERROR_AT_LINE + AC_FUNC_VPRINTF +-AC_FUNC_MALLOC + AC_FUNC_MEMCMP +-AC_FUNC_REALLOC + AC_FUNC_SELECT_ARGTYPES + + AX_C99_FUNC_LRINT diff --git a/libs/speex/Makefile b/libs/speex/Makefile new file mode 100644 index 0000000..1441049 --- /dev/null +++ b/libs/speex/Makefile @@ -0,0 +1,104 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=speex +PKG_VERSION:=1.2rc1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.us.xiph.org/releases/speex/ +PKG_MD5SUM:=c4438b22c08e5811ff10e2b06ee9b9ae + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/libspeex + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Open source speech compression codec library + URL:=http://www.speex.org/ +endef + +define Package/libspeexdsp + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Open source speech compression codec library output to DSP + URL:=http://www.speex.org/ +endef + +define Package/libspeex/description + Open source patent-free speech compression codec library. + Speex is an Open Source/Free Software patent-free audio compression + format designed for speech. The Speex Project aims to lower the + barrier of entry for voice applications by providing a free + alternative to expensive proprietary speech codecs. Moreover, Speex + is well-adapted to Internet applications and provides useful features + that are not present in most other codecs. + + This package contains the shared codec library, needed by other programs. +endef + +TARGET_CFLAGS += $(FPIC) + +define Package/libspeexdsp/description + Open source patent-free speech compression codec library. + Speex is an Open Source/Free Software patent-free audio compression + format designed for speech. The Speex Project aims to lower the + barrier of entry for voice applications by providing a free + alternative to expensive proprietary speech codecs. Moreover, Speex + is well-adapted to Internet applications and provides useful features + that are not present in most other codecs. + + This package contains the shared dsp library, needed by other programs. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + --enable-fixed-point \ + --disable-oggtest \ + --disable-float-api \ + --disable-vbr \ + --with-ogg=$(STAGING_DIR)/usr \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + bin_PROGRAMS="" \ + all install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/speex $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeex.{a,so*} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeexdsp.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/speex.pc $(1)/usr/lib/pkgconfig/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/speexdsp.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libspeex/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeex.so.* $(1)/usr/lib/ +endef + +define Package/libspeexdsp/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeexdsp.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libspeex)) +$(eval $(call BuildPackage,libspeexdsp)) + diff --git a/libs/sqlite2/Makefile b/libs/sqlite2/Makefile new file mode 100644 index 0000000..68306d6 --- /dev/null +++ b/libs/sqlite2/Makefile @@ -0,0 +1,101 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sqlite2 +PKG_VERSION:=2.8.17 +PKG_RELEASE:=2 + +PKG_SOURCE:=sqlite-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.sqlite.org/ +PKG_MD5SUM:=838dbac20b56d2c4292e98848505a05b + +PKG_BUILD_DIR:=$(BUILD_DIR)/sqlite-$(PKG_VERSION) + +PKG_BUILD_DEPENDS:=libncurses libreadline + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(FPIC) + +define Package/sqlite2/Default + SUBMENU:=database + TITLE:=SQLite (v2.x) database engine + URL:=http://www.sqlite.org/ +endef + +define Package/libsqlite2 + $(call Package/sqlite2/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= (library) +endef + +define Package/libsqlite2/description + SQLite is a small C library that implements a self-contained, embeddable, + zero-configuration SQL database engine. + This package contains the SQLite (v2.x) shared library, used by other programs. +endef + +define Package/sqlite2-cli + $(call Package/sqlite2/Default) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libsqlite2 +libncurses +libreadline + TITLE+= (cli) + SUBMENU:=database +endef + +define Package/sqlite2-cli/description + SQLite is a small C library that implements a self-contained, embeddable, + zero-configuration SQL database engine. + This package contains a terminal-based front-end to the SQLite (v2.x) library + that can evaluate queries interactively and display the results in + multiple formats. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + , \ + config_BUILD_CC="$(HOSTCC)" \ + config_BUILD_CFLAGS="-O2" \ + config_TARGET_CC="$(TARGET_CC)" \ + config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \ + config_TARGET_READLINE_INC="$(TARGET_CPPFLAGS)" \ + config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \ + config_TARGET_TCL_INC="-DNO_TCL=1" \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libsqlite2/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite.so.* $(1)/usr/lib/ +endef + +define Package/sqlite2-cli/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sqlite $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libsqlite2)) +$(eval $(call BuildPackage,sqlite2-cli)) diff --git a/libs/sqlite3/Makefile b/libs/sqlite3/Makefile new file mode 100644 index 0000000..fa77463 --- /dev/null +++ b/libs/sqlite3/Makefile @@ -0,0 +1,102 @@ +# +# Copyright (C) 2006-2012 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:=sqlite +PKG_VERSION:=3071201 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.sqlite.org +PKG_MD5SUM:=eb7bbd258913518ad30971ea7ecb0ca9 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-autoconf-$(PKG_VERSION) +PKG_BUILD_DEPENDS:=libncurses libreadline + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/sqlite3/Default + SUBMENU:=database + TITLE:=SQLite (v3.x) database engine + URL:=http://www.sqlite.org/ +endef + +define Package/sqlite3/Default/description + SQLite is a small C library that implements a self-contained, embeddable, + zero-configuration SQL database engine. +endef + +define Package/libsqlite3 + $(call Package/sqlite3/Default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libpthread + TITLE+= (library) +endef + +define Package/libsqlite3/description +$(call Package/sqlite3/Default/description) + This package contains the SQLite (v3.x) shared library, used by other + programs. +endef + +define Package/sqlite3-cli + $(call Package/sqlite3/Default) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libsqlite3 +libncurses +libreadline + TITLE+= (cli) +endef + +define Package/sqlite3-cli/description +$(call Package/sqlite3/Default/description) + This package contains a terminal-based front-end to the SQLite (v3.x) library + that can evaluate queries interactively and display the results in multiple + formats. +endef + +TARGET_CFLAGS += $(FPIC) \ + -DSQLITE_ENABLE_UNLOCK_NOTIFY \ + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + +CONFIGURE_VARS += \ + config_BUILD_CC="$(HOSTCC)" \ + config_BUILD_CFLAGS="-O2" \ + config_TARGET_CC="$(TARGET_CC)" \ + config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \ + config_TARGET_READLINE_INC="$(TARGET_CPPFLAGS)" \ + config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite3{,ext}.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite3.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libsqlite3/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.so.* $(1)/usr/lib/ +endef + +define Package/sqlite3-cli/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sqlite3 $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libsqlite3)) +$(eval $(call BuildPackage,sqlite3-cli)) diff --git a/libs/st2205tool/Makefile b/libs/st2205tool/Makefile new file mode 100644 index 0000000..81e120f --- /dev/null +++ b/libs/st2205tool/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2008-2009 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:=st2205tool +PKG_VERSION:=1.4.3 +PKG_RELEASE:=2 + +PKG_SOURCE:=st2205tool-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/ +PKG_MD5SUM:=827e3b719ebaf6bc537f2ce0ece3fccb + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/st2205tool + SECTION:=libs + CATEGORY:=Libraries + TITLE:=ST220xu powered photo-frames library + DEPENDS:=+libgd + URL:=http://picframe.spritesserver.nl/wiki/ +endef + +define Package/st2205tool/description + Library for hacked photo-frames based on st220xu chipset. You may use those photo-frames with + mplayer or LCD4Linux +endef + +TARGET_CFLAGS += $(FPIC) + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/libst2205/" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + SETPICLIBS="$(TARGET_LDFLAGS) -lgd -ljpeg -lpng -lz -L../libst2205 -lst2205" \ + + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/libst2205/st2205.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libst2205/libst2205.{a,so*} $(1)/usr/lib/ +endef + + +define Package/st2205tool/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/setpic/setpic $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libst2205/libst2205.so $(1)/usr/lib/libst2205.so.1 +endef + +$(eval $(call BuildPackage,st2205tool)) diff --git a/libs/st2205tool/patches/100-base-makefile.patch b/libs/st2205tool/patches/100-base-makefile.patch new file mode 100644 index 0000000..854d040 --- /dev/null +++ b/libs/st2205tool/patches/100-base-makefile.patch @@ -0,0 +1,45 @@ +--- + Makefile | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +--- st2205tool.orig/Makefile ++++ st2205tool/Makefile +@@ -6,27 +6,27 @@ LIBS = + all: libst2205/libst2205.so setpic/setpic phack splice bgrep + + install: all +- make -C libst2205 install ++ $(MAKE) -C libst2205 install + + libst2205/libst2205.so: +- make -C libst2205 ++ $(MAKE) -C libst2205 + +-setpic/setpic: +- make -C setpic ++setpic/setpic: libst2205/libst2205.so ++ $(MAKE) -C setpic + + phack: $(OBJ) $(SRC) +- gcc -o $(@) $(OBJ) $(LIBS) $(FLAGS) ++ $(GCC) -o $(@) $(OBJ) $(LIBS) $(FLAGS) + + splice: splice.o splice.c +- gcc -o splice splice.o ++ $(GCC) -o splice splice.o + + bgrep: bgrep.o bgrep.c +- gcc -o bgrep bgrep.o ++ $(GCC) -o bgrep bgrep.o + + clean: +- make -C libst2205 clean +- make -C setpic clean ++ $(MAKE) -C libst2205 clean ++ $(MAKE) -C setpic clean + rm -f $(OBJ) phack splice splice.o bgrep bgrep.o + + distclean: clean +- rm -f fwimage.bak memimage.bak fwimage.bin +\ No newline at end of file ++ rm -f fwimage.bak memimage.bak fwimage.bin diff --git a/libs/st2205tool/patches/110-libst-makefile.patch b/libs/st2205tool/patches/110-libst-makefile.patch new file mode 100644 index 0000000..96b95ae --- /dev/null +++ b/libs/st2205tool/patches/110-libst-makefile.patch @@ -0,0 +1,25 @@ +--- st2205tool/libst2205/Makefile.orig 2009-08-19 17:05:54.000000000 +0200 ++++ st2205tool/libst2205/Makefile 2009-08-19 17:06:27.000000000 +0200 +@@ -7,15 +7,15 @@ + all: libst2205.so + + libst2205.so: $(OBJ) $(SRC) $(HEADERS) +- ar -rv libst2205.a $(OBJ) +- gcc -shared -Wl,-soname,libst2205.so.1 -o libst2205.so $(OBJ) $(LIBS) ++ $(AR) -rv libst2205.a $(OBJ) ++ $(GCC) -shared -Wl,-soname,libst2205.so.1 -o libst2205.so $(OBJ) $(LIBS) + + clean: + rm -f $(OBJ) test *.a *.so + + install: libst2205.so +- test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib" +- test -z "/usr/local/include" || /bin/mkdir -p "/usr/local/include" +- install libst2205.so /usr/local/lib +- install st2205.h /usr/local/include +- ldconfig ++# test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib" ++# test -z "/usr/local/include" || /bin/mkdir -p "/usr/local/include" ++# install libst2205.so /usr/local/lib ++# install st2205.h /usr/local/include ++# ldconfig diff --git a/libs/st2205tool/patches/120-setpic-makefile.patch b/libs/st2205tool/patches/120-setpic-makefile.patch new file mode 100644 index 0000000..a3a0121 --- /dev/null +++ b/libs/st2205tool/patches/120-setpic-makefile.patch @@ -0,0 +1,18 @@ +--- st2205tool/setpic/Makefile.orig 2008-01-20 19:50:11.000000000 +0100 ++++ st2205tool/setpic/Makefile 2008-04-22 16:06:40.000000000 +0200 +@@ -1,12 +1,12 @@ + SRC = main.c + OBJ = main.o +-CFLAGS = -g -Wall -I../libst2205 +-LIBS = -lgd -L../libst2205 -lst2205 ++#CFLAGS = -g -Wall -I./../libst2205 ++#LIBS = -lgd -lst2205 + + all: setpic + + setpic: $(OBJ) $(SRC) +- gcc -o $(@) $(OBJ) $(LIBS) $(FLAGS) ++ $(GCC) -o $(@) $(OBJ) $(SETPICLIBS) $(CFLAGS) + + clean: + rm -f $(OBJ) setpic diff --git a/libs/sysfsutils/Makefile b/libs/sysfsutils/Makefile new file mode 100644 index 0000000..aa6499e --- /dev/null +++ b/libs/sysfsutils/Makefile @@ -0,0 +1,69 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sysfsutils +PKG_VERSION:=2.1.0 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/linux-diag +PKG_MD5SUM:=14e7dcd0436d2f49aa403f67e1ef7ddc + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libsysfs + SECTION:=libs + CATEGORY:=Libraries + SUBMENU:=Filesystem + TITLE:=Sysfs library + URL:=http://linux-diag.sourceforge.net/Sysfsutils.html +endef + +define Package/sysfsutils + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Filesystem + DEPENDS:=+libsysfs + TITLE:=System Utilities Based on Sysfs + URL:=http://linux-diag.sourceforge.net/Sysfsutils.html +endef + +define Package/libsysfs/description +The library's purpose is to provide a consistant and stable interface for +querying system device information exposed through sysfs. +endef + +define Package/sysfsutils/description +A utility built upon libsysfs that lists devices by bus, class, and topology. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/sysfs $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsysfs.{a,so*,la} $(1)/usr/lib/ +endef + +define Package/libsysfs/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsysfs.so* $(1)/usr/lib/ +endef + +define Package/sysfsutils/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/systool $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libsysfs)) +$(eval $(call BuildPackage,sysfsutils)) diff --git a/libs/sysfsutils/patches/200-mnt_path_check.patch b/libs/sysfsutils/patches/200-mnt_path_check.patch new file mode 100644 index 0000000..8710578 --- /dev/null +++ b/libs/sysfsutils/patches/200-mnt_path_check.patch @@ -0,0 +1,55 @@ +--- a/lib/sysfs_utils.c ++++ b/lib/sysfs_utils.c +@@ -22,6 +22,7 @@ + */ + #include "libsysfs.h" + #include "sysfs.h" ++#include + + /** + * sysfs_remove_trailing_slash: Removes any trailing '/' in the given path +@@ -53,6 +54,9 @@ int sysfs_get_mnt_path(char *mnt_path, s + { + static char sysfs_path[SYSFS_PATH_MAX] = ""; + const char *sysfs_path_env; ++ FILE *mnt; ++ struct mntent *mntent; ++ int ret; + + if (len == 0 || mnt_path == NULL) + return -1; +@@ -64,12 +68,31 @@ int sysfs_get_mnt_path(char *mnt_path, s + if (sysfs_path_env != NULL) { + safestrcpymax(mnt_path, sysfs_path_env, len); + sysfs_remove_trailing_slash(mnt_path); +- return 0; ++ } else { ++ safestrcpymax(mnt_path, SYSFS_MNT_PATH, len); + } +- safestrcpymax(mnt_path, SYSFS_MNT_PATH, len); + } + +- return 0; ++ /* check that mount point is indeed mounted */ ++ ret = -1; ++ if ((mnt = setmntent(SYSFS_PROC_MNTS, "r")) == NULL) { ++ dprintf("Error getting mount information\n"); ++ return -1; ++ } ++ while ((mntent = getmntent(mnt)) != NULL) { ++ if (strcmp(mntent->mnt_type, SYSFS_FSTYPE_NAME) == 0 && ++ strcmp(mntent->mnt_dir, mnt_path) == 0) { ++ ret = 0; ++ break; ++ } ++ } ++ ++ endmntent(mnt); ++ ++ if (ret < 0) ++ errno = ENOENT; ++ ++ return ret; + } + + /** diff --git a/libs/taglib/Makefile b/libs/taglib/Makefile new file mode 100644 index 0000000..8ef4101 --- /dev/null +++ b/libs/taglib/Makefile @@ -0,0 +1,72 @@ +# +# Copyright (C) 2007-2011 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:=taglib +PKG_VERSION:=1.6.3 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://developer.kde.org/~wheeler/files/src/ +PKG_MD5SUM:=ddf02f4e1d2dc30f76734df806e613eb + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +PKG_INSTALL:=1 + +define Package/taglib + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:= $(CXX_DEPENDS) +zlib @!TARGET_avr32 + TITLE:=Audio output library + URL:=http://developer.kde.org/~wheeler/taglib.html +endef + +define Package/taglibc + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+taglib + TITLE:=Audio output library + URL:=http://developer.kde.org/~wheeler/taglib.html +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(2)/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/taglib-config \ + $(2)/bin/ + $(SED) \ + 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ + $(2)/bin/taglib-config + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libtag{,_c}.so* \ + $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/include/taglib + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/taglib/* \ + $(1)/usr/include/taglib/ +endef + +define Package/taglib/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtag.so.* $(1)/usr/lib/ +endef + +define Package/taglibc/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtag_c.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,taglib)) +$(eval $(call BuildPackage,taglibc)) diff --git a/libs/taglib/patches/100-uclibc++-compat.patch b/libs/taglib/patches/100-uclibc++-compat.patch new file mode 100644 index 0000000..69a175e --- /dev/null +++ b/libs/taglib/patches/100-uclibc++-compat.patch @@ -0,0 +1,49 @@ +--- a/taglib/toolkit/tlist.h ++++ b/taglib/toolkit/tlist.h +@@ -226,6 +226,7 @@ namespace TagLib { + * the same. + */ + bool operator==(const List &l) const; ++ bool operator!=(const List &l) const; + + protected: + /* +--- a/taglib/toolkit/tlist.tcc ++++ b/taglib/toolkit/tlist.tcc +@@ -300,6 +300,12 @@ bool List::operator==(const List & + return d->list == l.d->list; + } + ++template ++bool List::operator!=(const List &l) const ++{ ++ return !(operator==(l)); ++} ++ + //////////////////////////////////////////////////////////////////////////////// + // protected members + //////////////////////////////////////////////////////////////////////////////// +--- a/taglib/toolkit/tstring.cpp ++++ b/taglib/toolkit/tstring.cpp +@@ -546,6 +546,11 @@ bool String::operator==(const String &s) + return d == s.d || d->data == s.d->data; + } + ++bool String::operator!=(const String &s) const ++{ ++ return !(operator==(s)); ++} ++ + String &String::operator+=(const String &s) + { + detach(); +--- a/taglib/toolkit/tstring.h ++++ b/taglib/toolkit/tstring.h +@@ -342,6 +342,7 @@ namespace TagLib { + * returns true if the strings match. + */ + bool operator==(const String &s) const; ++ bool operator!=(const String &s) const; + + /*! + * Appends \a s to the end of the String. diff --git a/libs/tcp_wrappers/Makefile b/libs/tcp_wrappers/Makefile new file mode 100644 index 0000000..ed46f00 --- /dev/null +++ b/libs/tcp_wrappers/Makefile @@ -0,0 +1,61 @@ +# +# 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:=tcp_wrappers +PKG_VERSION:=7.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.porcupine.org/pub/security +PKG_MD5SUM:=e6fa25f71226d090f34de3f6b122fb5a + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/libwrap + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Security wrapper library for TCP services + URL:=ftp://ftp.porcupine.org/pub/security/index.html +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + OPT_CFLAGS="$(TARGET_CFLAGS)" \ + LIBS=-lnsl \ + NETGROUP= \ + VSYSLOG= \ + BUGS= \ + EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 \ + -Dss_family=__ss_family -Dss_len=__ss_len" \ + FACILITY=LOG_DAEMON \ + SEVERITY=LOG_INFO \ + REAL_DAEMON_DIR=/usr/sbin \ + STYLE="-DPROCESS_OPTIONS" \ + tidy all +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/tcpd.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libwrap.a $(1)/usr/lib/ + $(CP) $(PKG_BUILD_DIR)/shared/libwrap.so* $(1)/usr/lib/ +endef + +define Package/libwrap/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/shared/libwrap.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libwrap)) diff --git a/libs/tcp_wrappers/patches/001-debian_subset.patch b/libs/tcp_wrappers/patches/001-debian_subset.patch new file mode 100644 index 0000000..0b3ad2c --- /dev/null +++ b/libs/tcp_wrappers/patches/001-debian_subset.patch @@ -0,0 +1,936 @@ +--- a/hosts_access.c ++++ b/hosts_access.c +@@ -240,6 +240,26 @@ struct request_info *request; + } + } + ++/* hostfile_match - look up host patterns from file */ ++ ++static int hostfile_match(path, host) ++char *path; ++struct hosts_info *host; ++{ ++ char tok[BUFSIZ]; ++ int match = NO; ++ FILE *fp; ++ ++ if ((fp = fopen(path, "r")) != 0) { ++ while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host))) ++ /* void */ ; ++ fclose(fp); ++ } else if (errno != ENOENT) { ++ tcpd_warn("open %s: %m", path); ++ } ++ return (match); ++} ++ + /* host_match - match host name and/or address against pattern */ + + static int host_match(tok, host) +@@ -267,6 +287,8 @@ struct host_info *host; + tcpd_warn("netgroup support is disabled"); /* not tcpd_jump() */ + return (NO); + #endif ++ } else if (tok[0] == '/') { /* /file hack */ ++ return (hostfile_match(tok, host)); + } else if (STR_EQ(tok, "KNOWN")) { /* check address and name */ + char *name = eval_hostname(host); + return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name)); +--- a/tcpd.h ++++ b/tcpd.h +@@ -4,6 +4,25 @@ + * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. + */ + ++#ifndef _TCPWRAPPERS_TCPD_H ++#define _TCPWRAPPERS_TCPD_H ++ ++/* someone else may have defined this */ ++#undef __P ++ ++/* use prototypes if we have an ANSI C compiler or are using C++ */ ++#if defined(__STDC__) || defined(__cplusplus) ++#define __P(args) args ++#else ++#define __P(args) () ++#endif ++ ++/* Need definitions of struct sockaddr_in and FILE. */ ++#include ++#include ++ ++__BEGIN_DECLS ++ + /* Structure to describe one communications endpoint. */ + + #define STRING_LENGTH 128 /* hosts, users, processes */ +@@ -25,10 +44,10 @@ struct request_info { + char pid[10]; /* access via eval_pid(request) */ + struct host_info client[1]; /* client endpoint info */ + struct host_info server[1]; /* server endpoint info */ +- void (*sink) (); /* datagram sink function or 0 */ +- void (*hostname) (); /* address to printable hostname */ +- void (*hostaddr) (); /* address to printable address */ +- void (*cleanup) (); /* cleanup function or 0 */ ++ void (*sink) __P((int)); /* datagram sink function or 0 */ ++ void (*hostname) __P((struct host_info *)); /* address to printable hostname */ ++ void (*hostaddr) __P((struct host_info *)); /* address to printable address */ ++ void (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */ + struct netconfig *config; /* netdir handle */ + }; + +@@ -61,25 +80,30 @@ extern char paranoid[]; + /* Global functions. */ + + #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) +-extern void fromhost(); /* get/validate client host info */ ++extern void fromhost __P((struct request_info *)); /* get/validate client host info */ + #else + #define fromhost sock_host /* no TLI support needed */ + #endif + +-extern int hosts_access(); /* access control */ +-extern void shell_cmd(); /* execute shell command */ +-extern char *percent_x(); /* do % expansion */ +-extern void rfc931(); /* client name from RFC 931 daemon */ +-extern void clean_exit(); /* clean up and exit */ +-extern void refuse(); /* clean up and exit */ +-extern char *xgets(); /* fgets() on steroids */ +-extern char *split_at(); /* strchr() and split */ +-extern unsigned long dot_quad_addr(); /* restricted inet_addr() */ ++extern void shell_cmd __P((char *)); /* execute shell command */ ++extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do % expansion */ ++extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */ ++extern void clean_exit __P((struct request_info *)); /* clean up and exit */ ++extern void refuse __P((struct request_info *)); /* clean up and exit */ ++extern char *xgets __P((char *, int, FILE *)); /* fgets() on steroids */ ++extern char *split_at __P((char *, int)); /* strchr() and split */ ++extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */ + + /* Global variables. */ + ++#ifdef HAVE_WEAKSYMS ++extern int allow_severity __attribute__ ((weak)); /* for connection logging */ ++extern int deny_severity __attribute__ ((weak)); /* for connection logging */ ++#else + extern int allow_severity; /* for connection logging */ + extern int deny_severity; /* for connection logging */ ++#endif ++ + extern char *hosts_allow_table; /* for verification mode redirection */ + extern char *hosts_deny_table; /* for verification mode redirection */ + extern int hosts_access_verbose; /* for verbose matching mode */ +@@ -92,9 +116,14 @@ extern int resident; /* > 0 if residen + */ + + #ifdef __STDC__ ++extern int hosts_access(struct request_info *request); ++extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, ++ char *client_user); + extern struct request_info *request_init(struct request_info *,...); + extern struct request_info *request_set(struct request_info *,...); + #else ++extern int hosts_access(); ++extern int hosts_ctl(); + extern struct request_info *request_init(); /* initialize request */ + extern struct request_info *request_set(); /* update request structure */ + #endif +@@ -117,27 +146,31 @@ extern struct request_info *request_set( + * host_info structures serve as caches for the lookup results. + */ + +-extern char *eval_user(); /* client user */ +-extern char *eval_hostname(); /* printable hostname */ +-extern char *eval_hostaddr(); /* printable host address */ +-extern char *eval_hostinfo(); /* host name or address */ +-extern char *eval_client(); /* whatever is available */ +-extern char *eval_server(); /* whatever is available */ ++extern char *eval_user __P((struct request_info *)); /* client user */ ++extern char *eval_hostname __P((struct host_info *)); /* printable hostname */ ++extern char *eval_hostaddr __P((struct host_info *)); /* printable host address */ ++extern char *eval_hostinfo __P((struct host_info *)); /* host name or address */ ++extern char *eval_client __P((struct request_info *)); /* whatever is available */ ++extern char *eval_server __P((struct request_info *)); /* whatever is available */ + #define eval_daemon(r) ((r)->daemon) /* daemon process name */ + #define eval_pid(r) ((r)->pid) /* process id */ + + /* Socket-specific methods, including DNS hostname lookups. */ + +-extern void sock_host(); /* look up endpoint addresses */ +-extern void sock_hostname(); /* translate address to hostname */ +-extern void sock_hostaddr(); /* address to printable address */ ++/* look up endpoint addresses */ ++extern void sock_host __P((struct request_info *)); ++/* translate address to hostname */ ++extern void sock_hostname __P((struct host_info *)); ++/* address to printable address */ ++extern void sock_hostaddr __P((struct host_info *)); ++ + #define sock_methods(r) \ + { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; } + + /* The System V Transport-Level Interface (TLI) interface. */ + + #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) +-extern void tli_host(); /* look up endpoint addresses etc. */ ++extern void tli_host __P((struct request_info *)); /* look up endpoint addresses etc. */ + #endif + + /* +@@ -178,7 +211,7 @@ extern struct tcpd_context tcpd_context; + * behavior. + */ + +-extern void process_options(); /* execute options */ ++extern void process_options __P((char *, struct request_info *)); /* execute options */ + extern int dry_run; /* verification flag */ + + /* Bug workarounds. */ +@@ -217,3 +250,7 @@ extern char *fix_strtok(); + #define strtok my_strtok + extern char *my_strtok(); + #endif ++ ++__END_DECLS ++ ++#endif /* tcpd.h */ +--- a/Makefile ++++ b/Makefile +@@ -1,5 +1,10 @@ ++GLIBC=$(shell grep -s -c __GLIBC__ /usr/include/features.h) ++ + # @(#) Makefile 1.23 97/03/21 19:27:20 + ++# unset the HOSTNAME environment variable ++HOSTNAME = ++ + what: + @echo + @echo "Usage: edit the REAL_DAEMON_DIR definition in the Makefile then:" +@@ -19,7 +24,7 @@ what: + @echo " generic (most bsd-ish systems with sys5 compatibility)" + @echo " 386bsd aix alpha apollo bsdos convex-ultranet dell-gcc dgux dgux543" + @echo " dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix" +- @echo " linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211" ++ @echo " linux gnu machten mips(untested) ncrsvr4 netbsd next osf power_unix_211" + @echo " ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4" + @echo " sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2" + @echo " uts215 uxp" +@@ -43,8 +48,8 @@ what: + # Ultrix 4.x SunOS 4.x ConvexOS 10.x Dynix/ptx + #REAL_DAEMON_DIR=/usr/etc + # +-# SysV.4 Solaris 2.x OSF AIX +-#REAL_DAEMON_DIR=/usr/sbin ++# SysV.4 Solaris 2.x OSF AIX Linux ++REAL_DAEMON_DIR=/usr/sbin + # + # BSD 4.4 + #REAL_DAEMON_DIR=/usr/libexec +@@ -141,10 +146,21 @@ freebsd: + LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \ + EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all + ++ifneq ($(GLIBC),0) ++MYLIB=-lnsl ++endif ++ + linux: + @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ +- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \ +- NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all ++ LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \ ++ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \ ++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT" ++ ++gnu: ++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ ++ LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \ ++ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \ ++ EXTRA_CFLAGS="-DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT" + + # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x. + hpux hpux8 hpux9 hpux10: +@@ -391,7 +407,7 @@ AR = ar + # the ones provided with this source distribution. The environ.c module + # implements setenv(), getenv(), and putenv(). + +-AUX_OBJ= setenv.o ++#AUX_OBJ= setenv.o + #AUX_OBJ= environ.o + #AUX_OBJ= environ.o strcasecmp.o + +@@ -454,7 +470,8 @@ AUX_OBJ= setenv.o + # host name aliases. Compile with -DSOLARIS_24_GETHOSTBYNAME_BUG to work + # around this. The workaround does no harm on other Solaris versions. + +-BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK ++BUGS = ++#BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK + #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DINET_ADDR_BUG + #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DSOLARIS_24_GETHOSTBYNAME_BUG + +@@ -464,7 +481,7 @@ BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS + # If your system supports NIS or YP-style netgroups, enable the following + # macro definition. Netgroups are used only for host access control. + # +-#NETGROUP= -DNETGROUP ++NETGROUP= -DNETGROUP + + ############################################################### + # System dependencies: whether or not your system has vsyslog() +@@ -491,7 +508,7 @@ VSYSLOG = -Dvsyslog=myvsyslog + # Uncomment the next definition to turn on the language extensions + # (examples: allow, deny, banners, twist and spawn). + # +-#STYLE = -DPROCESS_OPTIONS # Enable language extensions. ++STYLE = -DPROCESS_OPTIONS # Enable language extensions. + + ################################################################ + # Optional: Changing the default disposition of logfile records +@@ -514,7 +531,7 @@ VSYSLOG = -Dvsyslog=myvsyslog + # + # The LOG_XXX names below are taken from the /usr/include/syslog.h file. + +-FACILITY= LOG_MAIL # LOG_MAIL is what most sendmail daemons use ++FACILITY= LOG_DAEMON # LOG_MAIL is what most sendmail daemons use + + # The syslog priority at which successful connections are logged. + +@@ -610,7 +627,7 @@ TABLES = -DHOSTS_DENY=\"/etc/hosts.deny\ + # Paranoid mode implies hostname lookup. In order to disable hostname + # lookups altogether, see the next section. + +-PARANOID= -DPARANOID ++#PARANOID= -DPARANOID + + ######################################## + # Optional: turning off hostname lookups +@@ -623,7 +640,7 @@ PARANOID= -DPARANOID + # In order to perform selective hostname lookups, disable paranoid + # mode (see previous section) and comment out the following definition. + +-HOSTNAME= -DALWAYS_HOSTNAME ++#HOSTNAME= -DALWAYS_HOSTNAME + + ############################################# + # Optional: Turning on host ADDRESS checking +@@ -649,28 +666,46 @@ HOSTNAME= -DALWAYS_HOSTNAME + # source-routed traffic in the kernel. Examples: 4.4BSD derivatives, + # Solaris 2.x, and Linux. See your system documentation for details. + # +-# KILL_OPT= -DKILL_IP_OPTIONS ++KILL_OPT= -DKILL_IP_OPTIONS + + ## End configuration options + ############################ + + # Protection against weird shells or weird make programs. + ++CC = gcc + SHELL = /bin/sh +-.c.o:; $(CC) $(CFLAGS) -c $*.c ++.c.o:; $(CC) $(CFLAGS) -o $*.o -c $*.c ++ ++SOMAJOR = 0 ++SOMINOR = 7.6 ++ ++LIB = libwrap.a ++SHLIB = shared/libwrap.so.$(SOMAJOR).$(SOMINOR) ++SHLIBSOMAJ= shared/libwrap.so.$(SOMAJOR) ++SHLIBSO = shared/libwrap.so ++SHLIBFLAGS = -Lshared -lwrap + +-CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ ++shared/%.o: %.c ++ $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@ ++ ++CFLAGS = -O2 -g -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ + $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \ + -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \ + -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \ + $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \ + $(VSYSLOG) $(HOSTNAME) + ++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS) ++SHCFLAGS = -fPIC -shared -D_REENTRANT ++ + LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \ + hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \ + $(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \ + update.o misc.o diag.o percent_m.o myvsyslog.o + ++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ)); ++ + FROM_OBJ= fromhost.o + + KIT = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \ +@@ -684,46 +719,78 @@ KIT = README miscd.c tcpd.c fromhost.c h + refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \ + scaffold.h tcpdmatch.8 README.NIS + +-LIB = libwrap.a +- +-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk ++all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB) + + # Invalidate all object files when the compiler options (CFLAGS) have changed. + + config-check: + @set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; } +- @set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \ +- if cmp cflags /tmp/cflags.$$$$ ; \ +- then rm /tmp/cflags.$$$$ ; \ +- else mv /tmp/cflags.$$$$ cflags ; \ ++ @set +e; echo $(CFLAGS) >cflags.new ; \ ++ if cmp cflags cflags.new ; \ ++ then rm cflags.new ; \ ++ else mv cflags.new cflags ; \ + fi >/dev/null 2>/dev/null ++ @if [ ! -d shared ]; then mkdir shared; fi + + $(LIB): $(LIB_OBJ) + rm -f $(LIB) + $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ) + -$(RANLIB) $(LIB) + +-tcpd: tcpd.o $(LIB) +- $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS) ++$(SHLIB): $(SHLIB_OBJ) ++ rm -f $(SHLIB) ++ $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ) ++ ln -s $(notdir $(SHLIB)) $(SHLIBSOMAJ) ++ ln -s $(notdir $(SHLIBSOMAJ)) $(SHLIBSO) ++ ++tcpd: tcpd.o $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS) + +-miscd: miscd.o $(LIB) +- $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS) ++miscd: miscd.o $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ miscd.o $(SHLIBFLAGS) + +-safe_finger: safe_finger.o $(LIB) +- $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS) ++safe_finger: safe_finger.o $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS) + + TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o + +-tcpdmatch: $(TCPDMATCH_OBJ) $(LIB) +- $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS) ++tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS) + +-try-from: try-from.o fakelog.o $(LIB) +- $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS) ++try-from: try-from.o fakelog.o $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS) + + TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o + +-tcpdchk: $(TCPDCHK_OBJ) $(LIB) +- $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS) ++tcpdchk: $(TCPDCHK_OBJ) $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS) ++ ++install: install-lib install-bin install-dev ++ ++install-lib: ++ install -o root -g root -m 0644 $(SHLIB) ${DESTDIR}/lib/ ++ ln -s $(notdir $(SHLIB)) ${DESTDIR}/lib/$(notdir $(SHLIBSOMAJ)) ++ ++install-bin: ++ install -o root -g root -m 0755 tcpd ${DESTDIR}/usr/sbin/ ++ install -o root -g root -m 0755 tcpdchk ${DESTDIR}/usr/sbin/ ++ install -o root -g root -m 0755 tcpdmatch ${DESTDIR}/usr/sbin/ ++ install -o root -g root -m 0755 try-from ${DESTDIR}/usr/sbin/ ++ install -o root -g root -m 0755 safe_finger ${DESTDIR}/usr/sbin/ ++ install -o root -g root -m 0644 tcpd.8 ${DESTDIR}/usr/share/man/man8/ ++ install -o root -g root -m 0644 tcpdchk.8 ${DESTDIR}/usr/share/man/man8/ ++ install -o root -g root -m 0644 tcpdmatch.8 ${DESTDIR}/usr/share/man/man8/ ++ install -o root -g root -m 0644 hosts_access.5 ${DESTDIR}/usr/share/man/man5/ ++ install -o root -g root -m 0644 hosts_options.5 ${DESTDIR}/usr/share/man/man5/ ++ ++install-dev: ++ ln -s /lib/$(notdir $(SHLIBSOMAJ)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSO)) ++ install -o root -g root -m 0644 hosts_access.3 ${DESTDIR}/usr/share/man/man3/ ++ install -o root -g root -m 0644 tcpd.h ${DESTDIR}/usr/include/ ++ install -o root -g root -m 0644 $(LIB) ${DESTDIR}/usr/lib/ ++ ln -s hosts_access.3 ${DESTDIR}/usr/share/man/man3/hosts_ctl.3 ++ ln -s hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_init.3 ++ ln -s hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_set.3 + + shar: $(KIT) + @shar $(KIT) +@@ -739,7 +806,8 @@ archive: + + clean: + rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \ +- cflags ++ cflags libwrap*.so* ++ rm -rf shared + + tidy: clean + chmod -R a+r . +@@ -885,5 +953,6 @@ update.o: cflags + update.o: mystdarg.h + update.o: tcpd.h + vfprintf.o: cflags ++weak_symbols.o: tcpd.h + workarounds.o: cflags + workarounds.o: tcpd.h +--- a/hosts_access.5 ++++ b/hosts_access.5 +@@ -8,9 +8,9 @@ name, host name/address) patterns. Exam + impatient reader is encouraged to skip to the EXAMPLES section for a + quick introduction. + .PP +-An extended version of the access control language is described in the +-\fIhosts_options\fR(5) document. The extensions are turned on at +-program build time by building with -DPROCESS_OPTIONS. ++The extended version of the access control language is described in the ++\fIhosts_options\fR(5) document. \fBNote that this language supersedes ++the meaning of \fIshell_command\fB as documented below.\fR + .PP + In the following text, \fIdaemon\fR is the the process name of a + network daemon process, and \fIclient\fR is the name and/or address of +@@ -40,7 +40,7 @@ A newline character is ignored when it i + character. This permits you to break up long lines so that they are + easier to edit. + .IP \(bu +-Blank lines or lines that begin with a `#\' character are ignored. ++Blank lines or lines that begin with a `#' character are ignored. + This permits you to insert comments and whitespace so that the tables + are easier to read. + .IP \(bu +@@ -69,26 +69,33 @@ checks are case insensitive. + .SH PATTERNS + The access control language implements the following patterns: + .IP \(bu +-A string that begins with a `.\' character. A host name is matched if ++A string that begins with a `.' character. A host name is matched if + the last components of its name match the specified pattern. For +-example, the pattern `.tue.nl\' matches the host name +-`wzv.win.tue.nl\'. ++example, the pattern `.tue.nl' matches the host name ++`wzv.win.tue.nl'. + .IP \(bu +-A string that ends with a `.\' character. A host address is matched if ++A string that ends with a `.' character. A host address is matched if + its first numeric fields match the given string. For example, the +-pattern `131.155.\' matches the address of (almost) every host on the ++pattern `131.155.' matches the address of (almost) every host on the + Eind\%hoven University network (131.155.x.x). + .IP \(bu +-A string that begins with an `@\' character is treated as an NIS ++A string that begins with an `@' character is treated as an NIS + (formerly YP) netgroup name. A host name is matched if it is a host + member of the specified netgroup. Netgroup matches are not supported + for daemon process names or for client user names. + .IP \(bu +-An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a +-`net/mask\' pair. A host address is matched if `net\' is equal to the +-bitwise AND of the address and the `mask\'. For example, the net/mask +-pattern `131.155.72.0/255.255.254.0\' matches every address in the +-range `131.155.72.0\' through `131.155.73.255\'. ++An expression of the form `n.n.n.n/m.m.m.m' is interpreted as a ++`net/mask' pair. A host address is matched if `net' is equal to the ++bitwise AND of the address and the `mask'. For example, the net/mask ++pattern `131.155.72.0/255.255.254.0' matches every address in the ++range `131.155.72.0' through `131.155.73.255'. ++.IP \(bu ++A string that begins with a `/' character is treated as a file ++name. A host name or address is matched if it matches any host name ++or address pattern listed in the named file. The file format is ++zero or more lines with zero or more host name or address patterns ++separated by whitespace. A file name pattern can be used anywhere ++a host name or address pattern can be used. + .SH WILDCARDS + The access control language supports explicit wildcards: + .IP ALL +@@ -115,19 +122,19 @@ without -DPARANOID when you want more co + .ne 6 + .SH OPERATORS + .IP EXCEPT +-Intended use is of the form: `list_1 EXCEPT list_2\'; this construct ++Intended use is of the form: `list_1 EXCEPT list_2'; this construct + matches anything that matches \fIlist_1\fR unless it matches + \fIlist_2\fR. The EXCEPT operator can be used in daemon_lists and in + client_lists. The EXCEPT operator can be nested: if the control +-language would permit the use of parentheses, `a EXCEPT b EXCEPT c\' +-would parse as `(a EXCEPT (b EXCEPT c))\'. ++language would permit the use of parentheses, `a EXCEPT b EXCEPT c' ++would parse as `(a EXCEPT (b EXCEPT c))'. + .br + .ne 6 + .SH SHELL COMMANDS + If the first-matched access control rule contains a shell command, that + command is subjected to % substitutions (see next section). + The result is executed by a \fI/bin/sh\fR child process with standard +-input, output and error connected to \fI/dev/null\fR. Specify an `&\' ++input, output and error connected to \fI/dev/null\fR. Specify an `&' + at the end of the command if you do not want to wait until it has + completed. + .PP +@@ -159,7 +166,7 @@ depending on how much information is ava + .IP %u + The client user name (or "unknown"). + .IP %% +-Expands to a single `%\' character. ++Expands to a single `%' character. + .PP + Characters in % expansions that may confuse the shell are replaced by + underscores. +@@ -243,9 +250,9 @@ A positive IDENT lookup result (the clie + less trustworthy. It is possible for an intruder to spoof both the + client connection and the IDENT lookup, although doing so is much + harder than spoofing just a client connection. It may also be that +-the client\'s IDENT server is lying. ++the client's IDENT server is lying. + .PP +-Note: IDENT lookups don\'t work with UDP services. ++Note: IDENT lookups don't work with UDP services. + .SH EXAMPLES + The language is flexible enough that different types of access control + policy can be expressed with a minimum of fuss. Although the language +@@ -285,7 +292,7 @@ ALL: LOCAL @some_netgroup + .br + ALL: .foobar.edu EXCEPT terminalserver.foobar.edu + .PP +-The first rule permits access from hosts in the local domain (no `.\' ++The first rule permits access from hosts in the local domain (no `.' + in the host name) and from members of the \fIsome_netgroup\fP + netgroup. The second rule permits access from all hosts in the + \fIfoobar.edu\fP domain (notice the leading dot), with the exception of +@@ -322,8 +329,8 @@ in.tftpd: LOCAL, .my.domain + /etc/hosts.deny: + .in +3 + .nf +-in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\ +- /usr/ucb/mail -s %d-%h root) & ++in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\ ++ /usr/bin/mail -s %d-%h root) & + .fi + .PP + The safe_finger command comes with the tcpd wrapper and should be +@@ -349,7 +356,7 @@ control rule; when the length of an acce + capacity of an internal buffer; when an access control rule is not + terminated by a newline character; when the result of % + expansion would overflow an internal buffer; when a system call fails +-that shouldn\'t. All problems are reported via the syslog daemon. ++that shouldn't. All problems are reported via the syslog daemon. + .SH FILES + .na + .nf +--- a/rfc931.c ++++ b/rfc931.c +@@ -33,7 +33,7 @@ static char sccsid[] = "@(#) rfc931.c 1. + + int rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */ + +-static jmp_buf timebuf; ++static sigjmp_buf timebuf; + + /* fsocket - open stdio stream on top of socket */ + +@@ -62,7 +62,7 @@ int protocol; + static void timeout(sig) + int sig; + { +- longjmp(timebuf, sig); ++ siglongjmp(timebuf, sig); + } + + /* rfc931 - return remote user name, given socket structures */ +@@ -99,7 +99,7 @@ char *dest; + * Set up a timer so we won't get stuck while waiting for the server. + */ + +- if (setjmp(timebuf) == 0) { ++ if (sigsetjmp(timebuf,1) == 0) { + signal(SIGALRM, timeout); + alarm(rfc931_timeout); + +--- a/tcpd.8 ++++ b/tcpd.8 +@@ -94,7 +94,7 @@ configuration files. + .PP + The example assumes that the network daemons live in /usr/etc. On some + systems, network daemons live in /usr/sbin or in /usr/libexec, or have +-no `in.\' prefix to their name. ++no `in.' prefix to their name. + .SH EXAMPLE 2 + This example applies when \fItcpd\fR expects that the network daemons + are left in their original place. +@@ -110,26 +110,26 @@ finger stream tcp nowait nobody /us + becomes: + .sp + .ti +5 +-finger stream tcp nowait nobody /some/where/tcpd in.fingerd ++finger stream tcp nowait nobody /usr/sbin/tcpd in.fingerd + .sp + .fi + .PP + The example assumes that the network daemons live in /usr/etc. On some + systems, network daemons live in /usr/sbin or in /usr/libexec, the +-daemons have no `in.\' prefix to their name, or there is no userid ++daemons have no `in.' prefix to their name, or there is no userid + field in the inetd configuration file. + .PP + Similar changes will be needed for the other services that are to be +-covered by \fItcpd\fR. Send a `kill -HUP\' to the \fIinetd\fR(8) ++covered by \fItcpd\fR. Send a `kill -HUP' to the \fIinetd\fR(8) + process to make the changes effective. AIX users may also have to +-execute the `inetimp\' command. ++execute the `inetimp' command. + .SH EXAMPLE 3 + In the case of daemons that do not live in a common directory ("secret" + or otherwise), edit the \fIinetd\fR configuration file so that it + specifies an absolute path name for the process name field. For example: + .nf + .sp +- ntalk dgram udp wait root /some/where/tcpd /usr/local/lib/ntalkd ++ ntalk dgram udp wait root /usr/sbin/tcpd /usr/sbin/in.ntalkd + .sp + .fi + .PP +--- a/hosts_access.3 ++++ b/hosts_access.3 +@@ -3,7 +3,7 @@ + hosts_access, hosts_ctl, request_init, request_set \- access control library + .SH SYNOPSIS + .nf +-#include "tcpd.h" ++#include + + extern int allow_severity; + extern int deny_severity; +--- a/options.c ++++ b/options.c +@@ -473,6 +473,9 @@ static struct syslog_names log_fac[] = { + #ifdef LOG_CRON + "cron", LOG_CRON, + #endif ++#ifdef LOG_FTP ++ "ftp", LOG_FTP, ++#endif + #ifdef LOG_LOCAL0 + "local0", LOG_LOCAL0, + #endif +--- a/fix_options.c ++++ b/fix_options.c +@@ -35,7 +35,12 @@ struct request_info *request; + #ifdef IP_OPTIONS + unsigned char optbuf[BUFFER_SIZE / 3], *cp; + char lbuf[BUFFER_SIZE], *lp; ++#if !defined(__GLIBC__) + int optsize = sizeof(optbuf), ipproto; ++#else /* __GLIBC__ */ ++ size_t optsize = sizeof(optbuf); ++ int ipproto; ++#endif /* __GLIBC__ */ + struct protoent *ip; + int fd = request->fd; + unsigned int opt; +--- a/workarounds.c ++++ b/workarounds.c +@@ -163,7 +163,11 @@ int *fromlen; + int fix_getpeername(sock, sa, len) + int sock; + struct sockaddr *sa; ++#if !defined(__GLIBC__) + int *len; ++#else /* __GLIBC__ */ ++size_t *len; ++#endif /* __GLIBC__ */ + { + int ret; + struct sockaddr_in *sin = (struct sockaddr_in *) sa; +--- a/socket.c ++++ b/socket.c +@@ -76,7 +76,11 @@ struct request_info *request; + { + static struct sockaddr_in client; + static struct sockaddr_in server; ++#if !defined (__GLIBC__) + int len; ++#else /* __GLIBC__ */ ++ size_t len; ++#endif /* __GLIBC__ */ + char buf[BUFSIZ]; + int fd = request->fd; + +@@ -224,7 +228,11 @@ int fd; + { + char buf[BUFSIZ]; + struct sockaddr_in sin; ++#if !defined(__GLIBC__) + int size = sizeof(sin); ++#else /* __GLIBC__ */ ++ size_t size = sizeof(sin); ++#endif /* __GLIBC__ */ + + /* + * Eat up the not-yet received datagram. Some systems insist on a +--- a/safe_finger.c ++++ b/safe_finger.c +@@ -26,21 +26,24 @@ static char sccsid[] = "@(#) safe_finger + #include + #include + #include ++#include + + extern void exit(); + + /* Local stuff */ + +-char path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin"; ++char path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin"; + + #define TIME_LIMIT 60 /* Do not keep listinging forever */ + #define INPUT_LENGTH 100000 /* Do not keep listinging forever */ + #define LINE_LENGTH 128 /* Editors can choke on long lines */ + #define FINGER_PROGRAM "finger" /* Most, if not all, UNIX systems */ + #define UNPRIV_NAME "nobody" /* Preferred privilege level */ +-#define UNPRIV_UGID 32767 /* Default uid and gid */ ++#define UNPRIV_UGID 65534 /* Default uid and gid */ + + int finger_pid; ++int allow_severity = SEVERITY; ++int deny_severity = LOG_WARNING; + + void cleanup(sig) + int sig; +--- a/hosts_options.5 ++++ b/hosts_options.5 +@@ -58,12 +58,12 @@ Notice the leading dot on the domain nam + Execute, in a child process, the specified shell command, after + performing the % expansions described in the hosts_access(5) + manual page. The command is executed with stdin, stdout and stderr +-connected to the null device, so that it won\'t mess up the ++connected to the null device, so that it won't mess up the + conversation with the client host. Example: + .sp + .nf + .ti +3 +-spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) & ++spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) & + .fi + .sp + executes, in a background child process, the shell command "safe_finger +--- a/tcpdchk.c ++++ b/tcpdchk.c +@@ -350,6 +350,8 @@ char *pat; + { + if (pat[0] == '@') { + tcpd_warn("%s: daemon name begins with \"@\"", pat); ++ } else if (pat[0] == '/') { ++ tcpd_warn("%s: daemon name begins with \"/\"", pat); + } else if (pat[0] == '.') { + tcpd_warn("%s: daemon name begins with dot", pat); + } else if (pat[strlen(pat) - 1] == '.') { +@@ -382,6 +384,8 @@ char *pat; + { + if (pat[0] == '@') { /* @netgroup */ + tcpd_warn("%s: user name begins with \"@\"", pat); ++ } else if (pat[0] == '/') { ++ tcpd_warn("%s: user name begins with \"/\"", pat); + } else if (pat[0] == '.') { + tcpd_warn("%s: user name begins with dot", pat); + } else if (pat[strlen(pat) - 1] == '.') { +@@ -402,8 +406,13 @@ char *pat; + static int check_host(pat) + char *pat; + { ++ char buf[BUFSIZ]; + char *mask; + int addr_count = 1; ++ FILE *fp; ++ struct tcpd_context saved_context; ++ char *cp; ++ char *wsp = " \t\r\n"; + + if (pat[0] == '@') { /* @netgroup */ + #ifdef NO_NETGRENT +@@ -422,6 +431,21 @@ char *pat; + tcpd_warn("netgroup support disabled"); + #endif + #endif ++ } else if (pat[0] == '/') { /* /path/name */ ++ if ((fp = fopen(pat, "r")) != 0) { ++ saved_context = tcpd_context; ++ tcpd_context.file = pat; ++ tcpd_context.line = 0; ++ while (fgets(buf, sizeof(buf), fp)) { ++ tcpd_context.line++; ++ for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp)) ++ check_host(cp); ++ } ++ tcpd_context = saved_context; ++ fclose(fp); ++ } else if (errno != ENOENT) { ++ tcpd_warn("open %s: %m", pat); ++ } + } else if (mask = split_at(pat, '/')) { /* network/netmask */ + if (dot_quad_addr(pat) == INADDR_NONE + || dot_quad_addr(mask) == INADDR_NONE) +--- a/percent_m.c ++++ b/percent_m.c +@@ -13,7 +13,7 @@ static char sccsid[] = "@(#) percent_m.c + #include + + extern int errno; +-#ifndef SYS_ERRLIST_DEFINED ++#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR) + extern char *sys_errlist[]; + extern int sys_nerr; + #endif +@@ -29,11 +29,15 @@ char *ibuf; + + while (*bp = *cp) + if (*cp == '%' && cp[1] == 'm') { ++#ifdef HAVE_STRERROR ++ strcpy(bp, strerror(errno)); ++#else + if (errno < sys_nerr && errno > 0) { + strcpy(bp, sys_errlist[errno]); + } else { + sprintf(bp, "Unknown error %d", errno); + } ++#endif + bp += strlen(bp); + cp += 2; + } else { +--- a/scaffold.c ++++ b/scaffold.c +@@ -180,10 +180,12 @@ struct request_info *request; + + /* ARGSUSED */ + +-void rfc931(request) +-struct request_info *request; ++void rfc931(rmt_sin, our_sin, dest) ++struct sockaddr_in *rmt_sin; ++struct sockaddr_in *our_sin; ++char *dest; + { +- strcpy(request->user, unknown); ++ strcpy(dest, unknown); + } + + /* check_path - examine accessibility */ +--- /dev/null ++++ b/weak_symbols.c +@@ -0,0 +1,11 @@ ++ /* ++ * @(#) weak_symbols.h 1.5 99/12/29 23:50 ++ * ++ * Author: Anthony Towns ++ */ ++ ++#ifdef HAVE_WEAKSYMS ++#include ++int deny_severity = LOG_WARNING; ++int allow_severity = SEVERITY; ++#endif diff --git a/libs/tcp_wrappers/patches/002-opt_cflags.patch b/libs/tcp_wrappers/patches/002-opt_cflags.patch new file mode 100644 index 0000000..1f38eb3 --- /dev/null +++ b/libs/tcp_wrappers/patches/002-opt_cflags.patch @@ -0,0 +1,12 @@ +--- a/Makefile ++++ b/Makefile +@@ -689,7 +689,8 @@ SHLIBFLAGS = -Lshared -lwrap + shared/%.o: %.c + $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@ + +-CFLAGS = -O2 -g -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ ++OPT_CFLAGS = -O2 -g ++CFLAGS = $(OPT_CFLAGS) -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ + $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \ + -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \ + -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \ diff --git a/libs/tcp_wrappers/patches/003-scaffold_malloc.patch b/libs/tcp_wrappers/patches/003-scaffold_malloc.patch new file mode 100644 index 0000000..ecda5ae --- /dev/null +++ b/libs/tcp_wrappers/patches/003-scaffold_malloc.patch @@ -0,0 +1,17 @@ +--- a/scaffold.c ++++ b/scaffold.c +@@ -20,13 +20,12 @@ static char sccs_id[] = "@(#) scaffold.c + #include + #include + #include ++#include + + #ifndef INADDR_NONE + #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ + #endif + +-extern char *malloc(); +- + /* Application-specific. */ + + #include "tcpd.h" diff --git a/libs/tcp_wrappers/patches/004-ipv4_prefix.patch b/libs/tcp_wrappers/patches/004-ipv4_prefix.patch new file mode 100644 index 0000000..29c9cef --- /dev/null +++ b/libs/tcp_wrappers/patches/004-ipv4_prefix.patch @@ -0,0 +1,72 @@ +--- a/hosts_access.5 ++++ b/hosts_access.5 +@@ -90,6 +90,9 @@ bitwise AND of the address and the `mask + pattern `131.155.72.0/255.255.254.0' matches every address in the + range `131.155.72.0' through `131.155.73.255'. + .IP \(bu ++An expression of the form `n.n.n.n/m\' is interpreted as a ++`net/prefixlen\' pair, as below, for IPv4 addresses. ++.IP \(bu + A string that begins with a `/' character is treated as a file + name. A host name or address is matched if it matches any host name + or address pattern listed in the named file. The file format is +--- a/tcpd.h ++++ b/tcpd.h +@@ -93,6 +93,7 @@ extern void refuse __P((struct request_i + extern char *xgets __P((char *, int, FILE *)); /* fgets() on steroids */ + extern char *split_at __P((char *, int)); /* strchr() and split */ + extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */ ++extern unsigned long prefix_to_netmask __P((char *)); /* 0-32 prefix length */ + + /* Global variables. */ + +--- a/misc.c ++++ b/misc.c +@@ -14,6 +14,8 @@ static char sccsic[] = "@(#) misc.c 1.2 + #include + #include + #include ++#include ++#include + + #include "tcpd.h" + +@@ -85,3 +87,22 @@ char *str; + } + return (runs == 4 ? inet_addr(str) : INADDR_NONE); + } ++ ++/* prefix_to_netmask - convert prefix (0-32) to netmask */ ++ ++unsigned long prefix_to_netmask(str) ++char *str; ++{ ++ unsigned long prefix; ++ char *endptr; ++ ++ if (!isdigit(str[0])) ++ return INADDR_NONE; ++ ++ prefix = strtoul(str, &endptr, 10); ++ if ((endptr == str) || (*endptr != '\0') || (prefix > 32)) ++ return INADDR_NONE; ++ ++ return htonl(~0UL << (32 - prefix)); ++} ++ +--- a/hosts_access.c ++++ b/hosts_access.c +@@ -345,7 +345,12 @@ char *string; + if ((addr = dot_quad_addr(string)) == INADDR_NONE) + return (NO); + if ((net = dot_quad_addr(net_tok)) == INADDR_NONE +- || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) { ++ || ((mask = dot_quad_addr(mask_tok)) == INADDR_NONE ++ && strcmp(mask_tok, "255.255.255.255") ++ && (mask = prefix_to_netmask(mask_tok)) == INADDR_NONE ++ && strcmp(mask_tok, "32"))) { ++ /* 255.255.255.255 == INADDR_NONE, separate check needed. TJ. */ ++ /* 32 == INADDR_NONE, separate check needed. philipp */ + tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok); + return (NO); /* not tcpd_jump() */ + } diff --git a/libs/tiff/Makefile b/libs/tiff/Makefile new file mode 100644 index 0000000..ca31f39 --- /dev/null +++ b/libs/tiff/Makefile @@ -0,0 +1,105 @@ +# +# Copyright (C) 2006-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# blogic@openwrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=tiff +PKG_VERSION:=4.0.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.osgeo.org/libtiff +PKG_MD5SUM:=051c1068e6a0627f461948c365290410 + +PKG_FIXUP:=libtool-ucxx +PKG_REMOVE_FILES:=autogen.sh aclocal.m4 + +PKG_INSTALL:=1 + +PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_libtiffxx + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/tiff/Default + TITLE:=TIFF + URL:=http://www.remotesensing.org/libtiff/ +endef + +define Package/libtiff +$(call Package/tiff/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= library + DEPENDS:=+zlib +libjpeg +endef + +define Package/libtiffxx +$(call Package/tiff/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= library(c++ bindings) + DEPENDS:=+libtiff $(CXX_DEPENDS) +endef + +define Package/tiff-utils +$(call Package/tiff/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= utilities + DEPENDS:=+libtiff +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Configure + $(call Build/Configure/Default, \ + $(if $(CONFIG_PACKAGE_libtiffxx), \ + --enable-cxx, \ + --disable-cxx \ + ) \ + --enable-ccitt \ + --enable-packbits \ + --enable-lzw \ + --enable-thunder \ + --enable-next \ + --enable-logluv \ + --enable-mdi \ + --enable-zlib \ + --enable-jpeg \ + --disable-old-jpeg \ + --disable-jbig \ + --without-x \ + --with-apple-opengl-framework \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/{lib,include} + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ +endef + +define Package/libtiff/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtiff.so.* $(1)/usr/lib/ +endef + +define Package/libtiffxx/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtiffxx.so.* $(1)/usr/lib/ +endef + +define Package/tiff-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libtiff)) +$(eval $(call BuildPackage,libtiffxx)) +$(eval $(call BuildPackage,tiff-utils)) diff --git a/libs/tokyocabinet/Makefile b/libs/tokyocabinet/Makefile new file mode 100644 index 0000000..54f8a00 --- /dev/null +++ b/libs/tokyocabinet/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2007-2011 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:=tokyocabinet +PKG_VERSION:=1.4.47 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://fallabs.com/tokyocabinet +PKG_MD5SUM:=3d94fe2aebf5d9ff0478ed895bc46fc9 + +include $(INCLUDE_DIR)/package.mk + +define Package/tokyocabinet + SUBMENU:=database + SECTION:=libs + CATEGORY:=Libraries + TITLE:=A library of routines to manage databases + URL:=http://fallabs.com/tokyocabinet/ + DEPENDS:=+zlib +bzip2 +libpthread +librt + MAINTAINER:=Obinou +endef + +define Package/tokyocabinet/description + Tokyo Cabinet is a library of routines for managing a database. + The database is a simple data file containing records, each + is a pair of a key and a value. Every key and value is serial bytes + with variable length. Both binary data and character string can be + used as a key and a value. There is neither concept of data tables + nor data types. Records are organized in hash table, B+ tree, + or fixed-length array. + + Tokyo Cabinet is developed as the successor of GDBM and QDBM on the + following purposes. They are achieved and Tokyo Cabinet replaces + conventional DBM products. +endef + +CONFIGURE_ARGS += --prefix=/usr + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) + $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install +endef + +define Build/InstallDev + $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(1)" install +endef + +define Package/tokyocabinet/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtokyocabinet.so* $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/share/tokyocabinet + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/tokyocabinet/tokyocabinet.idl $(1)/usr/share/tokyocabinet +endef + +$(eval $(call BuildPackage,tokyocabinet)) diff --git a/libs/tokyocabinet/patches/100-remove_extra_paths_from_configure.patch b/libs/tokyocabinet/patches/100-remove_extra_paths_from_configure.patch new file mode 100644 index 0000000..aa9ba24 --- /dev/null +++ b/libs/tokyocabinet/patches/100-remove_extra_paths_from_configure.patch @@ -0,0 +1,75 @@ +diff -ru tokyocabinet-1.4.47/configure tokyocabinet-1.4.47-new/configure +--- tokyocabinet-1.4.47/configure 2011-02-11 10:59:53.000000000 +0100 ++++ tokyocabinet-1.4.47-new/configure 2011-06-01 16:54:33.082157954 +0200 +@@ -2066,24 +2066,14 @@ + + # Building flags + MYCFLAGS="-std=c99 -Wall -fPIC -fsigned-char -O2" +-MYCPPFLAGS="-I. -I\$(INCLUDEDIR) -I$HOME/include -I/usr/local/include" ++MYCPPFLAGS="-I." + MYCPPFLAGS="$MYCPPFLAGS -DNDEBUG -D_GNU_SOURCE=1 -D_REENTRANT -D__EXTENSIONS__" +-MYLDFLAGS="-L. -L\$(LIBDIR) -L$HOME/lib -L/usr/local/lib" ++MYLDFLAGS="-L." + MYCMDLDFLAGS="" + MYRUNPATH="\$(LIBDIR)" + MYLDLIBPATHENV="LD_LIBRARY_PATH" + MYPOSTCMD="true" + +-# Building paths +-PATH="$PATH:$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" +-PATH="$PATH:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/xpg4/bin:/usr/xpg6/bin:/usr/ucb" +-CPATH="$HOME/include:/usr/local/include:$CPATH" +-LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LIBRARY_PATH" +-LD_LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH" +-PKG_CONFIG_PATH="$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" +-export PATH CPATH LIBRARY_PATH LD_LIBRARY_PATH PKG_CONFIG_PATH +- +- + + #================================================================ + # Options +diff -ru tokyocabinet-1.4.47/configure.in tokyocabinet-1.4.47-new/configure.in +--- tokyocabinet-1.4.47/configure.in 2010-08-15 16:14:53.000000000 +0200 ++++ tokyocabinet-1.4.47-new/configure.in 2011-06-01 16:53:34.645989924 +0200 +@@ -32,25 +32,14 @@ + + # Building flags + MYCFLAGS="-std=c99 -Wall -fPIC -fsigned-char -O2" +-MYCPPFLAGS="-I. -I\$(INCLUDEDIR) -I$HOME/include -I/usr/local/include" ++MYCPPFLAGS="-I." + MYCPPFLAGS="$MYCPPFLAGS -DNDEBUG -D_GNU_SOURCE=1 -D_REENTRANT -D__EXTENSIONS__" +-MYLDFLAGS="-L. -L\$(LIBDIR) -L$HOME/lib -L/usr/local/lib" ++MYLDFLAGS="-L." + MYCMDLDFLAGS="" + MYRUNPATH="\$(LIBDIR)" + MYLDLIBPATHENV="LD_LIBRARY_PATH" + MYPOSTCMD="true" + +-# Building paths +-PATH="$PATH:$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" +-PATH="$PATH:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/xpg4/bin:/usr/xpg6/bin:/usr/ucb" +-CPATH="$HOME/include:/usr/local/include:$CPATH" +-LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LIBRARY_PATH" +-LD_LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH" +-PKG_CONFIG_PATH="$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" +-export PATH CPATH LIBRARY_PATH LD_LIBRARY_PATH PKG_CONFIG_PATH +- +- +- + #================================================================ + # Options + #================================================================ +diff -ru tokyocabinet-1.4.47/Makefile.in tokyocabinet-1.4.47-new/Makefile.in +--- tokyocabinet-1.4.47/Makefile.in 2010-07-04 10:36:20.000000000 +0200 ++++ tokyocabinet-1.4.47-new/Makefile.in 2011-06-01 15:02:19.383826342 +0200 +@@ -54,8 +54,8 @@ + LDFLAGS = @MYLDFLAGS@ + CMDLDFLAGS = @MYCMDLDFLAGS@ + LIBS = @LIBS@ +-LDENV = LD_RUN_PATH=/lib:/usr/lib:$(LIBDIR):$(HOME)/lib:/usr/local/lib:@MYRUNPATH@:. +-RUNENV = @MYLDLIBPATHENV@=.:/lib:/usr/lib:$(LIBDIR):$(HOME)/lib:/usr/local/lib:@MYRUNPATH@ ++LDENV = LD_RUN_PATH=$(LIBDIR):@MYRUNPATH@:. ++RUNENV = @MYLDLIBPATHENV@=.:$(LIBDIR):@MYRUNPATH@ + POSTCMD = @MYPOSTCMD@ + + diff --git a/libs/tokyocabinet/patches/200-uclibc_0.9.30_compat.patch b/libs/tokyocabinet/patches/200-uclibc_0.9.30_compat.patch new file mode 100644 index 0000000..bf6a434 --- /dev/null +++ b/libs/tokyocabinet/patches/200-uclibc_0.9.30_compat.patch @@ -0,0 +1,29 @@ +--- a/tctdb.c ++++ b/tctdb.c +@@ -20,6 +20,26 @@ + #include "tctdb.h" + #include "myconf.h" + ++#ifdef __UCLIBC__ ++# include ++# if __UCLIBC_MINOR__ <= 9 && __UCLIBC_SUBLEVEL__ <= 30 ++ ++size_t strlen(const char *s); ++long double strtold(const char *nptr, char **endptr); ++static inline long double nanl(const char *tagp) ++{ ++ if (tagp[0] != '\0') { ++ char buf[6 + strlen(tagp)]; ++ sprintf(buf, "NAN(%s)", tagp); ++ return strtold(buf, NULL); ++ } ++ return NAN; ++} ++ ++# endif /* __UCLIBC_MINOR__ <= 9 && __UCLIBC_SUBLEVEL__ <= 30 */ ++#endif /* __UCLIBC__ */ ++ ++ + #define TDBOPAQUESIZ 64 // size of using opaque field + #define TDBLEFTOPQSIZ 64 // size of left opaque field + #define TDBPAGEBUFSIZ 32768 // size of a buffer to read each page diff --git a/libs/ucl/Makefile b/libs/ucl/Makefile new file mode 100644 index 0000000..3d3359a --- /dev/null +++ b/libs/ucl/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ucl +PKG_VERSION:=1.03 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.oberhumer.com/opensource/ucl/download/ +PKG_MD5SUM:=852bd691d8abc75b52053465846fba34 + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libucl + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Portable lossless data compression library + URL:=http://www.oberhumer.com/opensource/ucl/ +endef + +define Package/libucl/description +UCL is a portable lossless data compression library written in ANSI C. UCL +implements a number of compression algorithms that achieve an excellent +compression ratio while allowing *very* fast decompression. Decompression +requires no additional memory. +endef + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared \ + --disable-asm + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/ucl + $(CP) $(PKG_INSTALL_DIR)/usr/include/ucl/ucl{,conf}.h $(1)/usr/include/ucl/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucl.{a,so*} $(1)/usr/lib/ +endef + +define Package/libucl/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucl.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libucl)) + diff --git a/libs/ucl/patches/001-autoconf-compat.patch b/libs/ucl/patches/001-autoconf-compat.patch new file mode 100644 index 0000000..7dda83d --- /dev/null +++ b/libs/ucl/patches/001-autoconf-compat.patch @@ -0,0 +1,11 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -48,7 +48,7 @@ AC_CANONICAL_TARGET + AM_MAINTAINER_MODE + + if test -z "$ac_abs_top_srcdir"; then +- _AC_SRCPATHS(.) ++ _AC_SRCDIRS(.) + fi + if test -r .Conf.settings1; then + . ./.Conf.settings1 diff --git a/libs/unixodbc/Makefile b/libs/unixodbc/Makefile new file mode 100644 index 0000000..e8cca56 --- /dev/null +++ b/libs/unixodbc/Makefile @@ -0,0 +1,115 @@ +# +# Copyright (C) 2012 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:=unixodbc +PKG_VERSION:=2.3.1 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=ftp://ftp.unixodbc.org/pub/unixODBC/ +PKG_SOURCE:=unixODBC-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=86788d4006620fa1f171c13d07fdcaab +PKG_BUILD_DIR:=$(BUILD_DIR)/unixODBC-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +CONFIGURE_ARGS += \ + --disable-gui \ + --with-pic \ + --enable-drivers + +define Package/unixodbc/Default + SUBMENU:=database + TITLE:=unixODBC + URL:=http://www.unixodbc.org/ +endef + +define Package/unixodbc + $(call Package/unixodbc/Default) + TITLE+= (libraries) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libltdl +libpthread +endef + +define Package/unixodbc/description + unixODBC is an Open Source ODBC sub-system and an ODBC SDK for Linux, + Mac OSX, and UNIX. +endef + +define Package/unixodbc-tools + $(call Package/unixodbc/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= Tools + DEPENDS:=+unixodbc +libncurses +libreadline +endef + +define Package/unixodbc-tools/description + Command Line Tools to help install a driver and work with SQL. +endef + +define Package/pgsqlodbc + $(call Package/unixodbc/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Postgresql driver for ODBC + DEPENDS:=+unixodbc +libpq +endef + +define Package/pgsqlodbc/description + Postgresql driver for ODBC. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + $(MAKE_FLAGS) \ + ARCH="$(ARCH)" \ + CC="$(TARGET_CC)" + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + $(MAKE_FLAGS) \ + ARCH="$(ARCH)" \ + install -i +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/odbc* $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/ODBCDataSources + $(TARGET_CC) $(TARGET_CFLAGS) -E ./files/unixodbc_conf.h | tr '@' '\#' >$(1)/usr/include/unixodbc_conf.h +endef + +define Package/unixodbc/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libodbc[ci]*so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libodbc.*so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnn*so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/odbc* $(1)/etc/ +endef + +define Package/unixodbc-tools/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ +endef + +define Package/pgsqlodbc/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libodbcpsql*so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,unixodbc)) +$(eval $(call BuildPackage,unixodbc-tools)) +$(eval $(call BuildPackage,pgsqlodbc)) diff --git a/libs/unixodbc/files/unixodbc_conf.h b/libs/unixodbc/files/unixodbc_conf.h new file mode 100644 index 0000000..f149d02 --- /dev/null +++ b/libs/unixodbc/files/unixodbc_conf.h @@ -0,0 +1,22 @@ +@ifndef HAVE_UNISTD_H + @define HAVE_UNISTD_H +@endif +@ifndef HAVE_PWD_H + @define HAVE_PWD_H +@endif +@ifndef HAVE_SYS_TYPES_H + @define HAVE_SYS_TYPES_H +@endif +@ifndef HAVE_LONG_LONG + @define HAVE_LONG_LONG +@endif +@ifndef ODBCINT64 + @define ODBCINT64 long +@endif +@ifndef UODBCINT64 + @define UODBCINT64 unsigned long +@endif +@ifndef SIZEOF_LONG_INT + @define SIZEOF_LONG_INT __SIZEOF_LONG__ +@endif + \ No newline at end of file diff --git a/libs/ustl/Makefile b/libs/ustl/Makefile new file mode 100644 index 0000000..f467e97 --- /dev/null +++ b/libs/ustl/Makefile @@ -0,0 +1,63 @@ +# +# 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:=ustl +PKG_VERSION:=0.8 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-0.8-0.tar.bz2 +PKG_SOURCE_URL:=@SF/ustl +PKG_MD5SUM:=dd59483c327f1bd1356273bc5ae4dde0 + +include $(INCLUDE_DIR)/package.mk + +define Package/ustl + SECTION:=libs + CATEGORY:=Libraries + TITLE:=C++ STL for embedded systems + DEPENDS:=@!TARGET_avr32 + URL:=http://ustl.sourceforge.net/ +endef + +define Package/ustl/description + C++ Standard Template Library (STL) for embedded systems.\\\ + uSTL is a partial implementation of the STL (Standard Template \\\ + Library) that reduces code size by factoring memory management \\\ + code into a non-template base class and deriving containers \\\ + from it. +endef + +define Build/Configure + $(CP) ./files/config.h $(PKG_BUILD_DIR)/ + $(CP) ./files/Common.mk $(PKG_BUILD_DIR)/ +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CROSS="$(TARGET_CROSS)" \ + OPTFLAGS="$(TARGET_CFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/ustl/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libustl.so.* $(1)/usr/lib/ +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/ustl* $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libustl.{a,so*} $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,ustl)) diff --git a/libs/ustl/files/Common.mk b/libs/ustl/files/Common.mk new file mode 100644 index 0000000..ab0cdf5 --- /dev/null +++ b/libs/ustl/files/Common.mk @@ -0,0 +1,74 @@ +LIBNAME = ustl +MAJOR = 0 +MINOR = 8 +BUILD = 0 + +CC = $(CROSS)gcc +CXX = $(CROSS)g++ +LD = $(CROSS)gcc +AR = $(CROSS)ar +RANLIB = $(CROSS)ranlib +DOXYGEN = echo +INSTALL = install +RM = rm -f +LN = ln -sf + +prefix = /usr +exec_prefix = /usr +BINDIR = /usr/bin +INCDIR = /usr/include +LIBDIR = /usr/lib + +DESTDIR = + +INSTALLDIR = ${INSTALL} -d +INSTALLLIB = ${INSTALL} -p -m 644 +INSTALLEXE = ${INSTALL} -p -m 755 +INSTALLDATA = ${INSTALL} -p -m 644 + +CWARNOPTS = -Wall -W -Wpointer-arith -Wno-cast-align \ + -Wcast-qual -Wwrite-strings -Wredundant-decls +CXXWARNOPTS = ${CWARNOPTS} -Wconversion -Wsign-promo -Wsynth -Woverloaded-virtual +PROCESSOR_OPTS = +INLINE_OPTS = -finline-limit=65535 +CUSTOMINCDIR = +CUSTOMLIBDIR = + +BUILD_SHARED = 1 +BUILD_STATIC = 1 +#DEBUG = 1 +#PROFILE = 1 +STANDALONE = -nodefaultlibs + +CFLAGS = \ + ${CUSTOMINCDIR} ${OPTFLAGS} ${CWARNOPTS} ${STANDALONE} +CXXFLAGS = \ + ${CUSTOMINCDIR} ${OPTFLAGS} ${INLINE_OPTS} \ + ${CXXWARNOPTS} ${STANDALONE} -fno-builtin +LDFLAGS = ${CUSTOMLIBDIR} ${STANDALONE} +OPTFLAGS = ${PROCESSOR_OPTS} +ifdef DEBUG + OPTFLAGS += -O0 -g +else + OPTFLAGS += -O3 -DNDEBUG=1 +endif +ifdef PROFILE + OPTFLAGS += -pg +endif +ifdef STANDALONE + LIBS += -lsupc++ -lgcc_s -lc +endif +ifdef BUILD_SHARED + CFLAGS += -fPIC + CXXFLAGS += -fPIC +endif +SHBLDFL = -shared + +LIBA = lib${LIBNAME}.a +LIBSO = lib${LIBNAME}.so +ifdef MAJOR +LIBSOLNK = ${LIBSO}.${MAJOR}.${MINOR} +LIBSOBLD = ${LIBSO}.${MAJOR}.${MINOR}.${BUILD} +endif +TOCLEAN += ${LIBSO} ${LIBA} ${LIBSOBLD} + diff --git a/libs/ustl/files/config.h b/libs/ustl/files/config.h new file mode 100644 index 0000000..903e225 --- /dev/null +++ b/libs/ustl/files/config.h @@ -0,0 +1,286 @@ +// config.h +// +// Autogenerated from config.h.in by bsconf. +// + +#ifndef CONFIG_H_01E33670634DAAC779EE5FF41CCBB36F +#define CONFIG_H_01E33670634DAAC779EE5FF41CCBB36F + +// Define to the one symbol short name of this package. +#define USTL_NAME "ustl" +// Define to the full name and version of this package. +#define USTL_STRING "ustl 0.8" +// Define to the version of this package. +#define USTL_VERSION 0x080 +// Define to the address where bug reports for this package should be sent. +#define USTL_BUGREPORT "Mike Sharov " + +/// Define to 1 if you want to build without libstdc++ +#define WITHOUT_LIBSTDCPP 1 + +/// Define to 1 if you want stream operations to throw exceptions on +/// insufficient data or insufficient space. All these errors should +/// be preventable in output code; the input code should verify the +/// data in a separate step. It slows down stream operations a lot, +/// but it's your call. By default only debug builds throw. +/// +#undef WANT_STREAM_BOUNDS_CHECKING + +#if !defined(WANT_STREAM_BOUNDS_CHECKING) && !defined(NDEBUG) && !defined(WITHOUT_LIBSTDCPP) + #define WANT_STREAM_BOUNDS_CHECKING 1 +#endif + +/// Define to 1 if you don't want the standard streams. +/// You will not be able to run bvt tests if you do this. +/// +#undef WITHOUT_CIN_COUT_CERR + +/// Define GNU extensions if unavailable. +#ifndef __GNUC__ + /// GCC (and some other compilers) define '__attribute__'; ustl is using this + /// macro to alert the compiler to flag inconsistencies in printf/scanf-like + /// function calls. Just in case '__attribute__' isn't defined, make a dummy. + /// + #ifndef __attribute__ + #define __attribute__(p) + #endif +#endif +#if defined(__GNUC__) && (__GNUC__ >= 4) + #define DLL_EXPORT __attribute__((visibility("default"))) + #define DLL_LOCAL __attribute__((visibility("hidden"))) +#else + #define DLL_EXPORT + #define DLL_LOCAL +#endif +#if defined(__GNUC__) && (__GNUC__ >= 3) && defined(__i386__) + /// GCC 3+ supports the prefetch directive, which some CPUs use to improve caching + #define prefetch(p,rw,loc) __builtin_prefetch(p,rw,loc) +#else + #define prefetch(p,rw,loc) +#endif +#if !defined(__GNUC__) || (__GNUC__ < 3) + /// __alignof__ returns the recommended alignment for the type + #define __alignof__(v) min(sizeof(v), sizeof(void*)) +#endif + +/// Define to 1 if you have the `atexit' function. +#define HAVE_ATEXIT 1 + +/// Define to 1 if you have the header file. +#define HAVE_ASSERT_H 1 + +/// Define to 1 if you have the header file. +#define HAVE_CTYPE_H 1 + +/// Define to 1 if you have the header file. +#define HAVE_ERRNO_H 1 + +/// Define to 1 if you have the header file. +#define HAVE_FCNTL_H 1 + +/// Define to 1 if you have the header file. +#define HAVE_FLOAT_H 1 + +/// Define to 1 if you have the header file. +#define HAVE_INTTYPES_H 1 + +/// Define to 1 if you have the header file. +#define HAVE_LIMITS_H 1 + +/// Define to 1 if you have the header file. +#define HAVE_LOCALE_H 1 + +/// Define to 1 if your system has a working `malloc' function. +#define HAVE_MALLOC 1 + +// Define to 1 if you have the header file. +#define HAVE_MALLOC_H 1 + +// Define to 1 if you have the header file. +#define HAVE_ALLOCA_H 1 + +// Define to 1 if you have the `memchr' function. +#define HAVE_MEMCHR 1 + +// Define to 1 if you have the `memmove' function. +#define HAVE_MEMMOVE 1 + +// Define to 1 if you have the header file. +#define HAVE_MEMORY_H 1 + +// Define to 1 if you have the `memset' function. +#define HAVE_MEMSET 1 + +// Define to 1 if the system has the type `ptrdiff_t'. +#define HAVE_PTRDIFF_T 1 + +// Define to 1 if you have the header file. +#define HAVE_SIGNAL_H 1 + +// Define to 1 if you have the __va_copy function +#define HAVE_VA_COPY 1 + +// Define to 1 if `stat' has the bug that it succeeds when given the +// zero-length file name argument. +/* #undef HAVE_STAT_EMPTY_STRING_BUG */ + +// Define to 1 if you have the header file. +#define HAVE_STDARG_H 1 + +// Define to 1 if you have the header file. +#define HAVE_STDDEF_H 1 + +// Define to 1 if you have the header file. +#define HAVE_STDINT_H 1 + +// Define to 1 if you have the header file. +#define HAVE_STDIO_H 1 + +// Define to 1 if you have the header file. +#define HAVE_STDLIB_H 1 + +// Define to 1 if you have the `strerror' function. +#define HAVE_STRERROR 1 + +// Define to 1 if you have the header file. +#define HAVE_STRINGS_H 1 + +// Define to 1 if you have the header file. +#define HAVE_STRING_H 1 + +// Define to 1 if you have the `strrchr' function. +#define HAVE_STRRCHR 1 + +// Define to 1 if you have the `strsignal' function. +#define HAVE_STRSIGNAL 1 + +// Define to 1 if you have the `strtol' function. +#define HAVE_STRTOL 1 + +// Define to 1 if you have the header file. +#define HAVE_SYS_STAT_H 1 + +// Define to 1 if you have the header file. +#define HAVE_SYS_TYPES_H 1 + +// Define to 1 if you have that is POSIX.1 compatible. +#define HAVE_SYS_WAIT_H 1 + +// Define to 1 if you have the header file. +#define HAVE_TIME_H 1 + +// Define to 1 if you have the header file. +#define HAVE_UNISTD_H 1 + +// Define to 1 if you have the header file. +#define HAVE_MATH_H 1 + +// Define to 1 if you have the rintf function. Will use rint otherwise. +#undef HAVE_RINTF + +// STDC_HEADERS is defined to 1 on sane systems. +#if defined(HAVE_ASSERT_H) && defined(HAVE_CTYPE_H) &&\ + defined(HAVE_ERRNO_H) && defined(HAVE_FLOAT_H) &&\ + defined(HAVE_LIMITS_H) && defined(HAVE_LOCALE_H) &&\ + defined(HAVE_MATH_H) && defined(HAVE_SIGNAL_H) &&\ + defined(HAVE_STDARG_H) && defined(HAVE_STDDEF_H) &&\ + defined(HAVE_STDIO_H) && defined(HAVE_STDLIB_H) &&\ + defined(HAVE_STRING_H) && defined(HAVE_TIME_H) +#define STDC_HEADERS 1 +#endif + +// STDC_HEADERS is defined to 1 on unix systems. +#if defined(HAVE_FCNTL_H) && defined(HAVE_SYS_STAT_H) && defined(HAVE_UNISTD_H) +#define STDUNIX_HEADERS 1 +#endif + +// Define to 1 if you have the header file. +#if (__GNUC__ >= 3) // gcc 2.95 somehow doesn't recognize 'asm volatile' in libc byteswap.h +#define HAVE_BYTESWAP_H 1 +#endif + +// Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 + +// Define to 1 if your compiler treats char as a separate type along with +// signed char and unsigned char. This will create overloads for char. +#define HAVE_THREE_CHAR_TYPES 1 + +// Define as the return type of signal handlers (`int' or `void'). +#define RETSIGTYPE void + +// Define to 1 if you have 64 bit types available +#define HAVE_INT64_T 1 + +// Define to 1 if you have the long long type +#define HAVE_LONG_LONG 1 + +// Define to 1 if you want unrolled specializations for fill and copy +#undef WANT_UNROLLED_COPY + +// Define to 1 if you want to use MMX/SSE/3dNow! processor instructions +#undef WANT_MMX + +// Define to byte sizes of types +#define SIZE_OF_CHAR 1 +#define SIZE_OF_SHORT 2 +#define SIZE_OF_INT 4 +#define SIZE_OF_LONG 4 +#define SIZE_OF_LONG_LONG 8 +#define SIZE_OF_POINTER 4 +#define SIZE_OF_SIZE_T 4 +#define SIZE_OF_BOOL SIZE_OF_CHAR +#undef SIZE_T_IS_LONG + +// Byte order macros, converted in utypes.h +#define USTL_LITTLE_ENDIAN 4321 +#define USTL_BIG_ENDIAN 1234 +#define USTL_BYTE_ORDER USTL_LITTLE_ENDIAN + +// Extended CPU capabilities +#define CPU_HAS_FPU 1 +#define CPU_HAS_EXT_DEBUG 1 +#define CPU_HAS_TIMESTAMPC 1 +#define CPU_HAS_MSR 1 +#define CPU_HAS_CMPXCHG8 1 +#define CPU_HAS_APIC 1 +#define CPU_HAS_SYSCALL 1 +#define CPU_HAS_MTRR 1 +#define CPU_HAS_CMOV 1 +#define CPU_HAS_FCMOV 1 +#if WANT_MMX +#undef CPU_HAS_MMX 1 +#undef CPU_HAS_FXSAVE +#undef CPU_HAS_SSE 1 +#undef CPU_HAS_SSE2 1 +#undef CPU_HAS_SSE3 +#undef CPU_HAS_EXT_3DNOW +#undef CPU_HAS_3DNOW +#endif + +// GCC vector extensions +#if defined(CPU_HAS_MMX) || defined(CPU_HAS_SSE) + #undef HAVE_VECTOR_EXTENSIONS +#endif + +#if CPU_HAS_SSE && defined(__GNUC__) + #define __sse_align __attribute__((aligned(16))) +#else + #define __sse_align +#endif + +// Define to empty if `const' does not conform to ANSI C. +/* #define const */ + +// Define as `__inline' if that's what the C compiler calls it, or to nothing +// if it is not supported. +/* #define inline __inline */ + +// Define to `long' if does not define. +/* typedef long off_t; */ + +// Define to `unsigned' if does not define. +/* typedef long size_t; */ + +#endif // CONFIG_H_01E33670634DAAC779EE5FF41CCBB36F + diff --git a/libs/ustl/patches/001-install-DESTDIR.patch b/libs/ustl/patches/001-install-DESTDIR.patch new file mode 100644 index 0000000..ec3a959 --- /dev/null +++ b/libs/ustl/patches/001-install-DESTDIR.patch @@ -0,0 +1,56 @@ +diff -ruN ustl-0.8-old/Makefile ustl-0.8-new/Makefile +--- ustl-0.8-old/Makefile 2005-11-10 21:06:53.000000000 +0100 ++++ ustl-0.8-new/Makefile 2005-12-08 13:57:07.000000000 +0100 +@@ -39,35 +39,35 @@ + .PHONY: install-static install-shared uninstall-static uninstall-shared + + install-shared: ${LIBSOBLD} install-incs +- @echo "Installing ${LIBSOBLD} to ${LIBDIR} ..." +- @${INSTALLDIR} ${LIBDIR} +- @${INSTALLLIB} ${LIBSOBLD} ${LIBDIR} +- @(cd ${LIBDIR}; ${RM} ${LIBSO} ${LIBSOLNK}; ${LN} -sf ${LIBSOBLD} ${LIBSO}; ${LN} -sf ${LIBSOBLD} ${LIBSOLNK}) ++ @echo "Installing ${LIBSOBLD} to ${DESTDIR}${LIBDIR} ..." ++ @${INSTALLDIR} ${DESTDIR}${LIBDIR} ++ @${INSTALLLIB} ${LIBSOBLD} ${DESTDIR}${LIBDIR} ++ @(cd ${DESTDIR}${LIBDIR}; ${RM} ${LIBSO} ${LIBSOLNK}; ${LN} -sf ${LIBSOBLD} ${LIBSO}; ${LN} -sf ${LIBSOBLD} ${LIBSOLNK}) + + uninstall-shared: uninstall-incs +- @echo "Removing ${LIBSOBLD} from ${LIBDIR} ..." +- @${RM} -f ${LIBDIR}/${LIBSO} ${LIBDIR}/${LIBSOLNK} ${LIBDIR}/${LIBSOBLD} ++ @echo "Removing ${LIBSOBLD} from ${DESTDIR}${LIBDIR} ..." ++ @${RM} -f ${DESTDIR}${LIBDIR}/${LIBSO} ${DESTDIR}${LIBDIR}/${LIBSOLNK} ${DESTDIR}${LIBDIR}/${LIBSOBLD} + + install-static: ${LIBA} install-incs +- @echo "Installing ${LIBA} to ${LIBDIR} ..." +- @${INSTALLDIR} ${LIBDIR} +- @${INSTALLLIB} ${LIBA} ${LIBDIR} ++ @echo "Installing ${LIBA} to ${DESTDIR}${LIBDIR} ..." ++ @${INSTALLDIR} ${DESTDIR}${LIBDIR} ++ @${INSTALLLIB} ${LIBA} ${DESTDIR}${LIBDIR} + + uninstall-static: uninstall-incs +- @echo "Removing ${LIBA} from ${LIBDIR} ..." +- @${RM} -f ${LIBDIR}/${LIBA} ++ @echo "Removing ${LIBA} from ${DESTDIR}${LIBDIR} ..." ++ @${RM} -f ${DESTDIR}${LIBDIR}/${LIBA} + + install-incs: ${INCS} +- @echo "Installing headers to ${INCDIR} ..." +- @${INSTALLDIR} ${INCDIR}/${LIBNAME} ++ @echo "Installing headers to ${DESTDIR}${INCDIR} ..." ++ @${INSTALLDIR} ${DESTDIR}${INCDIR}/${LIBNAME} + @for i in $(filter-out ${LIBNAME}.h,${INCS}); do \ +- ${INSTALLDATA} $$i ${INCDIR}/${LIBNAME}/$$i; \ ++ ${INSTALLDATA} $$i ${DESTDIR}${INCDIR}/${LIBNAME}/$$i; \ + done; +- @${INSTALLDATA} ${LIBNAME}.h ${INCDIR} ++ @${INSTALLDATA} ${LIBNAME}.h ${DESTDIR}${INCDIR} + + uninstall-incs: +- @echo "Removing headers from ${INCDIR} ..." +- @${RM} -rf ${INCDIR}/${LIBNAME} ${INCDIR}/${LIBNAME}.h ++ @echo "Removing headers from ${DESTDIR}${INCDIR} ..." ++ @${RM} -rf ${DESTDIR}${INCDIR}/${LIBNAME} ${DESTDIR}${INCDIR}/${LIBNAME}.h + + + %.o: %.cc diff --git a/libs/ustl/patches/002-install_path.patch b/libs/ustl/patches/002-install_path.patch new file mode 100644 index 0000000..3a7cf8a --- /dev/null +++ b/libs/ustl/patches/002-install_path.patch @@ -0,0 +1,12 @@ +diff -urN ustl.old/Common.mk.in ustl.dev/Common.mk.in +--- ustl.old/Common.mk.in 2005-11-10 21:06:53.000000000 +0100 ++++ ustl.dev/Common.mk.in 2006-03-23 16:12:05.000000000 +0100 +@@ -9,7 +9,7 @@ + AR = @AR@ + RANLIB = @RANLIB@ + DOXYGEN = @DOXYGEN@ +-INSTALL = @INSTALL@ ++INSTALL = install + RM = @RM@ + LN = @LN@ + diff --git a/libs/ustl/patches/003-fix_stream_bounds_check_dep.patch b/libs/ustl/patches/003-fix_stream_bounds_check_dep.patch new file mode 100644 index 0000000..6def743 --- /dev/null +++ b/libs/ustl/patches/003-fix_stream_bounds_check_dep.patch @@ -0,0 +1,54 @@ +--- a/config.h.in ++++ b/config.h.in +@@ -15,6 +15,9 @@ + // Define to the address where bug reports for this package should be sent. + #define USTL_BUGREPORT "@PACKAGE_BUGREPORT@" + ++/// Define to 1 if you want to build without libstdc++ ++#undef WITHOUT_LIBSTDCPP ++ + /// Define to 1 if you want stream operations to throw exceptions on + /// insufficient data or insufficient space. All these errors should + /// be preventable in output code; the input code should verify the +@@ -23,13 +26,10 @@ + /// + #undef WANT_STREAM_BOUNDS_CHECKING + +-#if !defined(WANT_STREAM_BOUNDS_CHECKING) && !defined(NDEBUG) ++#if !defined(WANT_STREAM_BOUNDS_CHECKING) && !defined(NDEBUG) && !defined(WITHOUT_LIBSTDCPP) + #define WANT_STREAM_BOUNDS_CHECKING 1 + #endif + +-/// Define to 1 if you want to build without libstdc++ +-#undef WITHOUT_LIBSTDCPP +- + /// Define to 1 if you don't want the standard streams. + /// You will not be able to run bvt tests if you do this. + /// +--- a/mostream.h ++++ b/mostream.h +@@ -11,7 +11,9 @@ + #include "memlink.h" + #include "uexception.h" + #include "utf8.h" ++#ifdef WANT_STREAM_BOUNDS_CHECKING + #include ++#endif + + namespace ustl { + +--- a/uctrstrm.h ++++ b/uctrstrm.h +@@ -109,8 +109,12 @@ + size_type n; + is >> n; + const size_type expectedSize = n * stream_size_of(value_type()); ++#ifdef WANT_STREAM_BOUNDS_CHECKING + if (expectedSize > is.remaining()) + throw stream_bounds_exception ("read", typeid(v).name(), is.pos(), expectedSize, is.remaining()); ++#else ++ assert(expectedSize <= is.remaining()); ++#endif + v.resize (n); + nr_container_read (is, v); + is.align(); diff --git a/libs/vips/Makefile b/libs/vips/Makefile new file mode 100644 index 0000000..69dff41 --- /dev/null +++ b/libs/vips/Makefile @@ -0,0 +1,80 @@ +# +# Copyright (C) 2010-2012 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:=vips +PKG_VERSION:=7.28.9 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.vips.ecs.soton.ac.uk/supported/7.28/ +PKG_MD5SUM:=c34e4c6367078c6d50893927aa5924bd +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +PKG_INSTALL=1 + +define Package/vips + $(call Package/vips/Default) + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE:=An image manipulation library + URL:=http://www.vips.ecs.soton.ac.uk/ + DEPENDS:=+glib2 +libexif +libjpeg +libpng +libxml2 $(INTL_DEPENDS) +endef + +TARGET_LDFLAGS+= \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +CONFIGURE_ARGS += \ + --disable-cxx \ + --disable-threads \ + --without-cfitsio \ + --without-fftw \ + --without-lcms \ + --without-magick \ + --without-matio \ + --without-OpenEXR \ + --without-orc \ + --without-pangoft2 \ + --without-python \ + --without-tiff \ + --without-v4l \ + --without-x \ + --without-zip \ + --with-jpeg \ + --with-libexif \ + --with-png \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/vips + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/* \ + $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.so* \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/ + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/vips/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.so* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,vips)) diff --git a/libs/vips/patches/001-no_cpp.patch b/libs/vips/patches/001-no_cpp.patch new file mode 100644 index 0000000..8f54073 --- /dev/null +++ b/libs/vips/patches/001-no_cpp.patch @@ -0,0 +1,279 @@ +diff -u --recursive vips-7.28.9-vanilla/configure.in vips-7.28.9/configure.in +--- vips-7.28.9-vanilla/configure.in 2012-07-14 22:35:08.209029299 -0500 ++++ vips-7.28.9/configure.in 2012-07-14 22:36:25.634927858 -0500 +@@ -182,7 +182,6 @@ + AC_PROG_AWK + AC_PROG_CC + AC_PROG_CC_STDC +-AC_PROG_CXX + AC_C_CONST + AC_C_RESTRICT + AC_PROG_RANLIB +@@ -190,45 +189,6 @@ + AC_PROG_LN_S + AM_WITH_DMALLOC + +-# vips_PROG_CXX_WORKS +-# Check whether the C++ compiler works. +-AC_DEFUN([vips_PROG_CXX_WORKS], +- [AC_REQUIRE([AC_PROG_CXX])dnl +- AC_CACHE_CHECK([whether the C++ compiler works], +- [vips_cv_prog_cxx_works], +- [AC_LANG_PUSH([C++]) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], +- [vips_cv_prog_cxx_works=yes], +- [vips_cv_prog_cxx_works=no]) +- AC_LANG_POP([C++])]) +-]) +- +-# option to build without C++ +-# handy for some embedded applications +-# also, including C++ source causes link problems on some +-# platforms, so have an option to disable it +-AC_ARG_ENABLE(cxx, +- AS_HELP_STRING([--enable-cxx], [build C++ components (default: test)])) +- +-if test x"$enable_cxx" != x"no"; then +- vips_PROG_CXX_WORKS +- if test x"$vips_cv_prog_cxx_works" = x"yes"; then +- AC_DEFINE(ENABLE_CXX,1,[build C++ components]) +- AM_CONDITIONAL(ENABLE_CXX, true) +- # need -lstdc++ for (eg.) the C++ format loaders +- # this gets added to vips-7.xx.pc to help mingw and friends link programs +- # using libvips +- VIPS_CXX_LIBS="-lstdc++" +- enable_cxx=yes +- fi +-fi +- +-if test x"$enable_cxx" != x"yes"; then +- AM_CONDITIONAL(ENABLE_CXX, false) +- VIPS_CXX_LIBS="" +- enable_cxx=no +-fi +- + # we need a fully expanded version of $libdir + # without this we get something like + # define VIPS_LIBDIR ${exec_prefix}/lib +@@ -681,7 +641,6 @@ + AC_SUBST(VIPS_CFLAGS) + AC_SUBST(VIPS_INCLUDES) + AC_SUBST(VIPS_LIBS) +-AC_SUBST(VIPS_CXX_LIBS) + AC_SUBST(PACKAGES_USED) + + # you'd think we could have +@@ -689,14 +648,12 @@ + # in AC_OUTPUT, but that seems to break for some combinations of sh/m4 + AC_OUTPUT([ + vips-7.28.pc +- vipsCC-7.28.pc + Makefile + libvips/include/vips/version.h + libvips/include/Makefile + libvips/include/vips/Makefile + libvips/Makefile + libvips/arithmetic/Makefile +- libvips/cimg/Makefile + libvips/colour/Makefile + libvips/conversion/Makefile + libvips/convolution/Makefile +@@ -711,9 +668,6 @@ + libvips/other/Makefile + libvips/resample/Makefile + libvips/video/Makefile +- libvipsCC/include/Makefile +- libvipsCC/include/vips/Makefile +- libvipsCC/Makefile + tools/Makefile + tools/batch_crop + tools/batch_image_convert +@@ -721,7 +675,6 @@ + tools/light_correct + tools/shrink_width + swig/Makefile +- swig/vipsCC/Makefile + swig/python/setup.py + man/Makefile + doc/Makefile +diff -u --recursive vips-7.28.9-vanilla/libvips/Makefile.am vips-7.28.9/libvips/Makefile.am +--- vips-7.28.9-vanilla/libvips/Makefile.am 2012-07-14 22:35:08.206029420 -0500 ++++ vips-7.28.9/libvips/Makefile.am 2012-07-14 22:37:24.446571912 -0500 +@@ -1,14 +1,4 @@ + # only build in the cimg dir if C++ is enabled +-if ENABLE_CXX +-C_COMPILE_DIR = cimg +-C_DIST_DIR = +-C_LIB = cimg/libcimg.la +-else +-C_COMPILE_DIR = +-C_DIST_DIR = cimg +-C_LIB = +-endif +- + SUBDIRS = \ + include \ + foreign \ +@@ -18,7 +8,6 @@ + conversion \ + deprecated \ + convolution \ +- $(C_COMPILE_DIR) \ + freq_filt \ + histograms_lut \ + inplace \ +@@ -34,14 +23,6 @@ + # empty means default to C linking + libvips_la_SOURCES = + +-# if we have C++ components enabled, make sure we link the top-level with c++ +-# +-# sadly the if/endif isn't enough to stop automake detecting a c++ link even +-# when c++ is disabled ... comment out this line if you have linking problems +-if ENABLE_CXX +-nodist_EXTRA_libvips_la_SOURCES = cimg/dummy2.cc +-endif +- + # DLLs need dependant libs there too ... put @VIPS_LIBS@ at the end + libvips_la_LIBADD = \ + resample/libresample.la \ +@@ -50,7 +31,6 @@ + conversion/libconversion.la \ + convolution/libconvolution.la \ + deprecated/libdeprecated.la \ +- $(C_LIB) \ + foreign/libforeign.la \ + freq_filt/libfreq_filt.la \ + histograms_lut/libhistograms_lut.la \ +@@ -62,17 +42,10 @@ + video/libvideo.la \ + @VIPS_LIBS@ + +-if ENABLE_CXX +-libvips_la_LIBADD += @VIPS_CXX_LIBS@ +-endif +- + libvips_la_LDFLAGS = \ + -no-undefined \ + -version-info @LIBRARY_CURRENT@:@LIBRARY_REVISION@:@LIBRARY_AGE@ + +-EXTRA_DIST = \ +- $(C_DIST_DIR) +- + CLEANFILES = + + -include $(INTROSPECTION_MAKEFILE) +diff -u --recursive vips-7.28.9-vanilla/libvips/resample/Makefile.am vips-7.28.9/libvips/resample/Makefile.am +--- vips-7.28.9-vanilla/libvips/resample/Makefile.am 2012-07-14 22:35:08.191030020 -0500 ++++ vips-7.28.9/libvips/resample/Makefile.am 2012-07-14 22:37:49.470569578 -0500 +@@ -2,22 +2,6 @@ + # you'd think we could just define a couple of variables, but that seems to + # confuse libtool and make it link the library with g++ + # instead, have two completely different paths +-if ENABLE_CXX +- +-libresample_la_SOURCES = \ +- im_affine.c \ +- interpolate.c \ +- im_shrink.c \ +- im_rightshift_size.c \ +- transform.c \ +- resample_dispatch.c \ +- bicubic.cpp \ +- lbb.cpp \ +- nohalo.cpp \ +- vsqbs.cpp \ +- templates.h +- +-else + + libresample_la_SOURCES = \ + im_affine.c \ +@@ -27,15 +11,6 @@ + transform.c \ + resample_dispatch.c + +-EXTRA_DIST = \ +- bicubic.cpp \ +- lbb.cpp \ +- nohalo.cpp \ +- vsqbs.cpp \ +- templates.h +- +-endif +- + noinst_LTLIBRARIES = libresample.la + + INCLUDES = -I${top_srcdir}/libvips/include @VIPS_CFLAGS@ @VIPS_INCLUDES@ +diff -u --recursive vips-7.28.9-vanilla/Makefile.am vips-7.28.9/Makefile.am +--- vips-7.28.9-vanilla/Makefile.am 2012-07-14 22:35:08.220028859 -0500 ++++ vips-7.28.9/Makefile.am 2012-07-14 22:38:43.217417048 -0500 +@@ -1,43 +1,17 @@ +- +-# turn off libvipsCC if C++ is disabled +-if ENABLE_CXX +-C_COMPILE_DIR = libvipsCC +-C_DIST_DIR = +-C_PKGCONFIG = vipsCC-7.${VIPS_MINOR_VERSION}.pc +- +-# turn on Python if we can (requires C++) +-if HAVE_PYTHON +-P_COMPILE_DIR = swig +-P_DIST_DIR = +-endif +- +-else +-C_COMPILE_DIR = +-C_DIST_DIR = libvipsCC +-C_PKGCONFIG = +-P_COMPILE_DIR = +-P_DIST_DIR = swig +-endif +- + SUBDIRS = \ + libvips \ + tools \ + po \ + man \ +- doc \ +- $(C_COMPILE_DIR) \ +- $(P_COMPILE_DIR) ++ doc + + EXTRA_DIST = \ + m4 \ + benchmark \ + bootstrap.sh \ + vips-7.${VIPS_MINOR_VERSION}.pc.in \ +- vipsCC-7.${VIPS_MINOR_VERSION}.pc.in \ + acinclude.m4 \ +- depcomp \ +- $(C_DIST_DIR) \ +- $(P_DIST_DIR) ++ depcomp + + pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = vips-7.${VIPS_MINOR_VERSION}.pc $(C_PKGCONFIG) +diff -u --recursive vips-7.28.9-vanilla/tools/Makefile.am vips-7.28.9/tools/Makefile.am +--- vips-7.28.9-vanilla/tools/Makefile.am 2012-07-14 22:35:08.221028819 -0500 ++++ vips-7.28.9/tools/Makefile.am 2012-07-14 22:40:51.397283833 -0500 +@@ -16,9 +16,6 @@ + INCLUDES = -I${top_srcdir}/libvips/include @VIPS_CFLAGS@ @VIPS_INCLUDES@ + AM_LDFLAGS = @LDFLAGS@ + LDADD = @VIPS_CFLAGS@ ${top_builddir}/libvips/libvips.la @VIPS_LIBS@ +-if ENABLE_CXX +-LDADD += @VIPS_CXX_LIBS@ +-endif + + bin_SCRIPTS = \ + light_correct \ +diff -u --recursive vips-7.28.9-vanilla/vips-7.28.pc.in vips-7.28.9/vips-7.28.pc.in +--- vips-7.28.9-vanilla/vips-7.28.pc.in 2012-07-14 22:35:08.208029340 -0500 ++++ vips-7.28.9/vips-7.28.pc.in 2012-07-14 22:41:03.591795535 -0500 +@@ -7,5 +7,5 @@ + Description: Image processing library + Version: @VERSION@ + Requires: @PACKAGES_USED@ +-Libs: -L${libdir} -lvips @VIPS_LIBS@ @VIPS_CXX_LIBS@ ++Libs: -L${libdir} -lvips @VIPS_LIBS@ + Cflags: -I${includedir} diff --git a/libs/wt/Makefile b/libs/wt/Makefile new file mode 100644 index 0000000..b9b4941 --- /dev/null +++ b/libs/wt/Makefile @@ -0,0 +1,164 @@ +# +# Copyright (C) 2007-2011 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:=wt +PKG_VERSION:=3.1.9 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.sourceforge.net/project/witty/wt/$(PKG_VERSION) +PKG_MD5SUM:=ee9490d5f24a47766e54f630ba0da2bb + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +PKG_INSTALL:=1 + +define Package/wt/Default + SECTION:=libs + CATEGORY:=Libraries + URL:=http://www.webtoolkit.eu/wt +endef + +define Package/wt + $(call Package/wt/Default) + MENU:=1 + DEPENDS:= +libstdcpp +boost-date_time +boost-system +boost-filesystem +boost-thread +boost-program_options +boost-signals +boost-regex +libpthread + TITLE:=C++ Web Toolkit +endef + +define Package/wt-resources + $(call Package/wt/Default) + DEPENDS:=wt + TITLE:=Optional Resource Files +endef + +define Package/wt-fcgi + $(call Package/wt/Default) + DEPENDS:=wt +fcgixx + TITLE:=FastCGI Connector +endef + +define Package/wt-http + $(call Package/wt/Default) + DEPENDS:=wt +PACKAGE_wt_http_zlib:zlib +PACKAGE_wt_http_ssl:libopenssl + TITLE:=Built in HTTP Server +endef + +define Package/wt-http/config +config PACKAGE_wt_http_zlib + bool "Enable zlib compression option" + depends on PACKAGE_wt-http + default n +config PACKAGE_wt_http_ssl + bool "Enable ssl option" + depends on PACKAGE_wt-http + default n +endef + +define Package/wt-dbo + $(call Package/wt/Default) + DEPENDS:=wt + TITLE:=Object Relational Mapping +endef + +define Package/wt-dbosqlite3 + $(call Package/wt/Default) + DEPENDS:=wt +wt-dbo + TITLE:=Sqlite3 Dbo Backend +endef + +define Package/wt-resources/conffiles +/usr/share/Wt +endef + +# TODO: some parts of the code show that -DHAVE_GNU_REGEX can be defined to avoid dependence or boost-regex +# But that's turning out not to be the case (some portions still depend on boost-regex) +TARGET_CFLAGS += $(FPIC) +CMAKE_OPTIONS += \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + -DCMAKE_CXX_FLAGS_MINSIZEREL:STRING="-DNDEBUG -DWT_NO_SPIRIT -DWT_NO_XSS_FILTER" \ + -DSHARED_LIBS:BOOL=ON \ + -DBUILD_TESTS=OFF \ + -DBUILD_EXAMPLES=OFF \ + -DINSTALL_RESOURCES=ON \ + -DENABLE_GM=OFF \ + -DENABLE_HARU=OFF \ + -DENABLE_PANGO=OFF \ + -DENABLE_EXT=OFF \ + -DENABLE_POSTGRES=OFF \ + -DENABLE_QT4=OFF \ + -DWT_NO_STD_LOCALE=ON \ + -DWT_NO_STD_WSTRING=ON + +ifndef CONFIG_PACKAGE_wt-http +CMAKE_OPTIONS += \ + -DCONNECTOR_HTTP=OFF +endif + +ifndef CONFIG_PACKAGE_wt_http_zlib +CMAKE_OPTIONS += \ + -DHTTP_WITH_ZLIB=OFF +endif + +ifndef CONFIG_PACKAGE_wt_http_ssl +CMAKE_OPTIONS += \ + -DHTTP_WITH_SSL=OFF +endif + +ifndef CONFIG_PACKAGE_wt-fcgi +CMAKE_OPTIONS += \ + -DCONNECTOR_FCGI=OFF +endif + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) -a $(PKG_INSTALL_DIR)/usr/include/Wt $(1)/usr/include + + $(INSTALL_DIR) $(1)/usr/share/cmake-2.4/Modules + $(CP) $(PKG_INSTALL_DIR)/usr/share/cmake-2.4/Modules/FindWt.cmake $(1)/usr/share/cmake-2.4/Modules + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwt*.so* $(1)/usr/lib +endef + +define BuildPlugin + define Package/$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib + for m in $(2); do \ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwt$$$$$$$${m}.so* $$(1)/usr/lib/ ; \ + done + endef + + $$(eval $$(call BuildPackage,$(1))) +endef + +define Package/wt/install + $(INSTALL_DIR) $(1)/etc/wt + $(INSTALL_DATA) $(PKG_BUILD_DIR)/wt_config.xml $(1)/etc/wt + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwt.so* $(1)/usr/lib +endef + +define Package/wt/conffiles +/etc/wt +endef + +define Package/wt-resources/install + $(INSTALL_DIR) $(1)/usr/share + $(CP) -a $(PKG_INSTALL_DIR)/usr/share/Wt $(1)/usr/share +endef + +$(eval $(call BuildPackage,wt)) +$(eval $(call BuildPackage,wt-resources)) +$(eval $(call BuildPlugin,wt-http,http)) +$(eval $(call BuildPlugin,wt-fcgi,fcgi)) +$(eval $(call BuildPlugin,wt-dbo,dbo)) +$(eval $(call BuildPlugin,wt-dbosqlite3,dbosqlite3)) diff --git a/libs/wt/patches/100-fix_random_dev.patch b/libs/wt/patches/100-fix_random_dev.patch new file mode 100644 index 0000000..977611c --- /dev/null +++ b/libs/wt/patches/100-fix_random_dev.patch @@ -0,0 +1,38 @@ +--- a/src/web/random_device.cpp ++++ b/src/web/random_device.cpp +@@ -39,16 +39,6 @@ + #endif + + #ifdef USE_URANDOM +-#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION +-// A definition is required even for integral static constants +-const bool boost::random_device::has_fixed_range; +-const boost::random_device::result_type boost::random_device::min_value; +-const boost::random_device::result_type boost::random_device::max_value; +-#endif +- +-// the default is the unlimited capacity device, using some secure hash +-// try "/dev/random" for blocking when the entropy pool has drained +-const char * const boost::random_device::default_token = "/dev/urandom"; + + /* + * This uses the POSIX interface for unbuffered reading. +@@ -119,7 +109,6 @@ + #include + #include + #include +-const char * const boost::random_device::default_token = ""; + + // Note about thread-safety: according to my reading of the MSDN page + // 'Threading Issues with Cryptographic Service Providers', both the +@@ -156,6 +145,10 @@ + }; + #endif + ++BOOST_RANDOM_DECL boost::random::random_device::random_device() ++ : pimpl(new impl("/dev/urandom")) ++{} ++ + boost::random_device::random_device(const std::string& token) + : pimpl(new impl(token)) + { diff --git a/libs/wxbase/Makefile b/libs/wxbase/Makefile new file mode 100644 index 0000000..aa50bc1 --- /dev/null +++ b/libs/wxbase/Makefile @@ -0,0 +1,133 @@ +# +# Copyright (C) 2007-2009 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:=wxbase +PKG_VERSION:=2.8.10 +PKG_RELEASE:=1 + +PKG_SOURCE:=wxGTK-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/wxwindows +PKG_MD5SUM:=88b867bc118a183af56efc67014bdf27 + +PKG_BUILD_DIR:=$(BUILD_DIR)/wxGTK-$(PKG_VERSION) + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libwxbase + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Cross-platform C++ framework + URL:=http://www.wxwidgets.org/ + DEPENDS:=+libexpat +libstdcpp +zlib +libpthread +endef + +define Package/libwxbase/description + wxBase contains most of the non-GUI classes from the wxWindows cross- + -platform C++ framework. There are 2 categories: generally useful portable + code (date/time handling, command line parsing, regular expression support) + and wrappers for the OS objects (files, directories, sockets, threads, + etc.) allowing you to write portable programs easily. +endef + +TARGET_CFLAGS += $(FPIC) + +# XXX: aMule *needs* the following configure options to be enabled: +# --enable-intl +# --enable-largefile +# --disable-no_rtti +# --with-regex +# --enable-unicode +CONFIGURE_ARGS+= \ + --enable-shared \ + --disable-rpath \ + --with-gnu-ld \ + --disable-gui \ + --disable-monolithic \ + --enable-plugins \ + --disable-universal \ + --disable-nanox \ + --disable-gtk2 \ + --disable-gpe \ + --disable-optimise \ + --disable-debug \ + --disable-stl \ + --disable-omf \ + --disable-debug_flag \ + --disable-debug_info \ + --disable-debug_gdb \ + --disable-debug_cntxt \ + --disable-mem_tracing \ + --disable-profile \ + --disable-no_rtti \ + --disable-no_exceptions \ + --disable-compat22 \ + --disable-compat24 \ + --enable-intl \ + --disable-backtrace \ + --enable-exceptions \ + --disable-sound \ + --enable-largefile \ + \ + --without-gtk \ + --without-motif \ + --without-mac \ + --without-cocoa \ + --without-wine \ + --without-msw \ + --without-pm \ + --without-mgl \ + --without-microwin \ + --without-x11 \ + --without-libpng \ + --without-libjpeg \ + --without-libtiff \ + --without-libxpm \ + --without-libmspack \ + --without-sdl \ + --without-gnomeprint \ + --without-opengl \ + --without-dmalloc \ + --with-regex="sys" \ + --with-zlib="sys" \ + --without-odbc \ + --with-expat="sys" \ + --without-gtk-prefix \ + --without-x \ + --without-libiconv-prefix \ + --without-sdl-prefix \ + --without-cppunit-prefix \ + +UNICODE=yes + +ifeq ($(UNICODE),yes) + CONFIGURE_ARGS+= --enable-unicode + LIB_PFX:=u +else + CONFIGURE_ARGS+= --disable-unicode + LIB_PFX:= +endif + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include $(1)/usr/lib + $(CP) -L $(PKG_BUILD_DIR)/wx-config $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/wx-2.8 $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwx_base$(LIB_PFX){,_net,_xml}-*.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/wx $(1)/usr/lib/ + $(SED) 's,-I$$$${includedir}/wx-2.8,-I$(STAGING_DIR)/usr/include/wx-2.8,g' $(1)/usr/bin/wx-config + $(SED) 's,-I$$$${libdir}/wx/include,-I$(STAGING_DIR)/usr/lib/wx/include,g' $(1)/usr/bin/wx-config +endef + +define Package/libwxbase/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwx_base$(LIB_PFX){,_net,_xml}-*.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libwxbase)) diff --git a/libs/xmlrpc-c/Makefile b/libs/xmlrpc-c/Makefile new file mode 100644 index 0000000..381c823 --- /dev/null +++ b/libs/xmlrpc-c/Makefile @@ -0,0 +1,218 @@ +# +# Copyright (C) 2007-2012 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:=xmlrpc-c +PKG_REV:=2233 +PKG_VERSION:=advanced_r$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/advanced +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=svn + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=0 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/xmlrpc-c/Default + SECTION:=libs + CATEGORY:=Libraries + TITLE:=XML-RPC library + URL:=http://xmlrpc-c.sourceforge.net/ +endef + +define Package/xmlrpc-c-common + $(call Package/xmlrpc-c/Default) + TITLE+= - common +endef + +define Package/xmlrpc-c-internal + $(call Package/xmlrpc-c/Default) + TITLE+= - (uses internal expat variant) + DEPENDS:=+xmlrpc-c-common +# PROVIDES:=xmlrpc-c + VARIANT:=internal +endef + +define Package/xmlrpc-c + $(call Package/xmlrpc-c/Default) + DEPENDS:=+xmlrpc-c-internal +endef + +define Package/xmlrpc-c-libxml2 + $(call Package/xmlrpc-c/Default) + TITLE+= - (uses libxml2) + DEPENDS:=+xmlrpc-c-common +libxml2 @BROKEN +# PROVIDES:=xmlrpc-c + VARIANT:=libxml2 +endef + +define Package/xmlrpc-c-client + $(call Package/xmlrpc-c/Default) + TITLE+= - client + DEPENDS:=+xmlrpc-c +libcurl +endef + +define Package/xmlrpc-c-server + $(call Package/xmlrpc-c/Default) + TITLE+= - server + DEPENDS:=+xmlrpc-c +endef + +define Package/xmlrpc-c-abyss + $(call Package/xmlrpc-c/Default) + TITLE+= - abyss + DEPENDS:=+xmlrpc-c-common +endef + +define Package/xmlrpc-c-server-abyss + $(call Package/xmlrpc-c/Default) + TITLE+= - abyss server + DEPENDS:=+xmlrpc-c-server +xmlrpc-c-abyss +endef + +define Package/xmlrpc-c/description/Default + Programming library for writing an XML-RPC server or client in C or C++. + XML-RPC is a standard network protocol to allow a client program to make + a simple remote procedure call (RPC) type request of a server. +endef + +Package/xmlrpc-c-common/description = $(Package/xmlrpc-c/description/Default) +Package/xmlrpc-c-libxml2/description = $(Package/xmlrpc-c/description/Default) +Package/xmlrpc-c-internal/description = $(Package/xmlrpc-c/description/Default) + +Package/xmlrpc-c-libxml2/description += Uses external libxml2 library (quite big) +Package/xmlrpc-c-internal/description += Uses internal expat variant (stripped down) + +CONFIGURE_ARGS+= \ + --disable-wininet-client \ + --disable-libwww-client \ + --enable-abyss-server \ + --disable-cplusplus \ + --disable-abyss-threads \ + --disable-cgi-server + +ifeq ($(BUILD_VARIANT),libxml2) + CONFIGURE_ARGS += \ + --enable-libxml2-backend +endif + +ifeq ($(BUILD_VARIANT),internal) + CONFIGURE_ARGS += \ + --disable-libxml2-backend +endif + +define Build/Compile + ( cd $(PKG_BUILD_DIR)/lib/expat/gennmtab && cc -I$(PKG_BUILD_DIR) -c gennmtab.c -o gennmtab.o && cc -o gennmtab gennmtab.o ) + $(call Build/Compile/Default) +endef + +define Build/InstallDev + $(INSTALL_DIR) \ + $(1)/usr/include \ + $(1)/usr/lib \ + $(1)/usr/bin \ + $(2)/bin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/* \ + $(1)/usr/include/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc*.{a,so*} \ + $(1)/usr/lib/ + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/xmlrpc-c-config \ + $(2)/bin/ + $(SED) \ + 's,HEADERINST_DIR="/usr/include",HEADERINST_DIR="$(STAGING_DIR)/usr/include",g' \ + $(2)/bin/xmlrpc-c-config + $(SED) \ + 's,LIBINST_DIR="/usr/lib",LIBINST_DIR="$(STAGING_DIR)/usr/lib",g' \ + $(2)/bin/xmlrpc-c-config +endef + +define Package/xmlrpc-c-libxml2/install + $(INSTALL_DIR) \ + $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc.so* \ + $(1)/usr/lib/ +endef + +define Package/xmlrpc-c-internal/install + $(INSTALL_DIR) \ + $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc.so* \ + $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc_xmltok.so* \ + $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc_xmlparse.so* \ + $(1)/usr/lib/ +endef + +define Package/xmlrpc-c-server/install + $(INSTALL_DIR) \ + $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc_server.so* \ + $(1)/usr/lib/ +endef + +define Package/xmlrpc-c-abyss/install + $(INSTALL_DIR) \ + $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc_abyss.so* \ + $(1)/usr/lib/ +endef + +define Package/xmlrpc-c-server-abyss/install + $(INSTALL_DIR) \ + $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc_server_abyss.so* \ + $(1)/usr/lib/ +endef + +define Package/xmlrpc-c-client/install + $(INSTALL_DIR) \ + $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc_client* \ + $(1)/usr/lib/ +endef + +define Package/xmlrpc-c-common/install + $(INSTALL_DIR) \ + $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc_util.so* \ + $(1)/usr/lib/ +endef + +define Package/xmlrpc-c/install + true +endef + +$(eval $(call BuildPackage,xmlrpc-c)) +$(eval $(call BuildPackage,xmlrpc-c-common)) +$(eval $(call BuildPackage,xmlrpc-c-libxml2)) +$(eval $(call BuildPackage,xmlrpc-c-internal)) +$(eval $(call BuildPackage,xmlrpc-c-server)) +$(eval $(call BuildPackage,xmlrpc-c-abyss)) +$(eval $(call BuildPackage,xmlrpc-c-server-abyss)) +$(eval $(call BuildPackage,xmlrpc-c-client)) diff --git a/libs/xmlrpc-c/patches/001-config.mk.in.patch b/libs/xmlrpc-c/patches/001-config.mk.in.patch new file mode 100644 index 0000000..e190ebb --- /dev/null +++ b/libs/xmlrpc-c/patches/001-config.mk.in.patch @@ -0,0 +1,11 @@ +--- a/config.mk.in ++++ b/config.mk.in +@@ -175,7 +175,7 @@ ifeq ($(patsubst linux-gnu%,linux-gnu,$( + shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN)) + shliblefn = $(1:%=%.$(SHLIB_SUFFIX)) + # SHLIB_CLIB = -lc +- LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB) ++ LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB) $(LDFLAGS) + CFLAGS_SHLIB=-fPIC + endif + diff --git a/libs/xmlrpc-c/patches/002-automake-compat.patch b/libs/xmlrpc-c/patches/002-automake-compat.patch new file mode 100644 index 0000000..7503b7c --- /dev/null +++ b/libs/xmlrpc-c/patches/002-automake-compat.patch @@ -0,0 +1,13 @@ +--- a/configure.in ++++ b/configure.in +@@ -230,9 +230,7 @@ dnl Checks for programs. + dnl ======================================================================= + + AC_PROG_CC +-if test x"$enable_cplusplus" != xno; then +- AC_PROG_CXX +-fi ++AC_PROG_CXX + + + dnl ======================================================================= diff --git a/libs/xmpp4r/Makefile b/libs/xmpp4r/Makefile new file mode 100644 index 0000000..9e2ef4c --- /dev/null +++ b/libs/xmpp4r/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=xmpp4r +PKG_VERSION:=0.5 +PKG_RELEASE:=0 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip +PKG_SOURCE_URL:=http://download.gna.org/xmpp4r +PKG_MD5SUM:=70eafe960727d750a43ec77ffc1856e9 + +include $(INCLUDE_DIR)/package.mk + +define Package/xmpp4r + TITLE:=XMPP/Jabber library for Ruby + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+ruby + MAINTAINER:=Giovanni Di Stasi + URL:=http://home.gna.org/xmpp4r/ +endef + +define Package/xmpp4r/description + This package contains xmpp4r, an XMPP/Jabber library for Ruby. +endef + +define Build/Compile + (cd $(PKG_BUILD_DIR); \ + ruby $(PKG_BUILD_DIR)/setup.rb config \ + --rbconfig=$(wildcard $(STAGING_DIR)/usr/lib/ruby/*.*/*-linux/rbconfig.rb); \ + ruby $(PKG_BUILD_DIR)/setup.rb install --prefix="$(PKG_INSTALL_DIR)"; \ + ) +endef + +define Package/xmpp4r/install + $(INSTALL_DIR) $(1)/usr/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib $(1)/usr +endef + +$(eval $(call BuildPackage,xmpp4r)) diff --git a/libs/zaptel-1.4.x/Makefile b/libs/zaptel-1.4.x/Makefile new file mode 100644 index 0000000..7d6ba2e --- /dev/null +++ b/libs/zaptel-1.4.x/Makefile @@ -0,0 +1,176 @@ +# +# Copyright (C) 2006-2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=zaptel +PKG_VERSION:=1.4.12.1 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/zaptel/releases/ \ + http://ftp.digium.com/pub/zaptel/releases/ +PKG_MD5SUM:=71e83a020b020fa60905edecf70e95a3 + +include $(INCLUDE_DIR)/package.mk + +define Package/zaptel14/Default + TITLE:=Zaptel + URL:=http://ftp.digium.com/pub/zaptel/releases + DEPENDS:= +endef + +define KernelPackage/zaptel14/Default + TITLE:=Zaptel (kernel module) + SUBMENU:=Voice over IP + DEPENDS:= +endef + +define KernelPackage/zaptel14 + $(call KernelPackage/zaptel14/Default) + TITLE:=Zaptel (kernel module) + FILES:=$(PKG_BUILD_DIR)/kernel/zaptel.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,70,zaptel) +endef + +define KernelPackage/zaptel14/description + This package contains the Zaptel core module. No longer includes ztdummy + because it is not needed in all cases (and is in fact broken on x86). +endef + + +define KernelPackage/zaptel14-dummy + $(call KernelPackage/zaptel14/Default) + TITLE:=Zaptel Dummy (timer; kernel module) + DEPENDS += +kmod-zaptel14 + FILES:=$(PKG_BUILD_DIR)/kernel/ztdummy.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,71,ztdummy) +endef + +define KernelPackage/zaptel14/description + This package contains the Zaptel ztdummy driver. Broken on x86 due to lack + of RTC on some hardware. +endef + +define KernelPackage/zaptel14-wcusb + $(call KernelPackage/zaptel14/Default) + DEPENDS += +kmod-zaptel14 + FILES:=$(PKG_BUILD_DIR)/kernel/wcusb.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,72,wcusb) +endef + +define KernelPackage/zaptel14-wcusb/description + This package contains the Zaptel S100U usb driver. +endef + +define KernelPackage/zaptel14-wctdm + $(call KernelPackage/zaptel14/Default) + DEPENDS += +kmod-zaptel14 + FILES:=$(PKG_BUILD_DIR)/kernel/wctdm.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,72,wctdm) +endef + +define KernelPackage/zaptel14-wctdm/description + This package contains the Zaptel wctdm driver. +endef + +define Package/zaptel14-util + $(call Package/zaptel14/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= utils + DEPENDS += +kmod-zaptel14 +zaptel14-libtonezone +libnewt +endef + +define Package/zaptel14-util/description + This package contains the zaptel utils. +endef + +define Package/zaptel14-libtonezone + $(call Package/zaptel14/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= libtonezone (library) + DEPENDS += +kmod-zaptel14 +endef + +define Package/zaptel14-libtonezone/description + This package contains the libraries for accessing zaptel/dummy drivers. +endef + +CONFIGURE_VARS += \ + LDFLAGS="$$$$LDFLAGS -Wl,-rpath-link $(STAGING_DIR)/usr/lib" + +CONFIGURE_ARGS += \ + --with-newt="$(STAGING_DIR)/usr" \ + --without-curses \ + --without-ncurses + +MAKE_FLAGS:= \ + ARCH="$(LINUX_KARCH)" \ + CC="$(TARGET_CC) $(TARGET_CFLAGS)" \ + LD="$(TARGET_CROSS)ld" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + KVERS="$(LINUX_VERSION)" \ + KSRC="$(LINUX_DIR)" \ + TOPDIR_MODULES="zaptel ztdummy wcusb wctdm" \ + SUBDIR_MODULES="" + +define Build/Compile/kmod + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(MAKE_FLAGS) \ + modules +endef + +define Build/Compile/user + $(MAKE) -C $(PKG_BUILD_DIR) \ + ARCH="$(LINUX_KARCH)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + AR="$(TARGET_CROSS)ar" \ + RANLIB="$(TARGET_CROSS)ranlib" \ + install-libs install-include zttest ztcfg zttool ztdiag fxotune ztmonitor ztscan ztspeed fxstest +endef + +define Build/Compile + $(call Build/Compile/kmod) + $(call Build/Compile/user) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/zaptel $(STAGING_DIR)/usr/include/ + $(INSTALL_DIR) $(STAGING_DIR)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.* $(STAGING_DIR)/usr/lib/ +endef + +define Package/zaptel14-util/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/zttest $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztcfg $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/zttool $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztdiag $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/fxotune $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/fxstest $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztmonitor $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztscan $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztspeed $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/hotplug.d/zaptel + $(INSTALL_DATA) ./files/10-create-device-node $(1)/etc/hotplug.d/zaptel/ +endef + +define Package/zaptel14-libtonezone/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.so.* $(1)/usr/lib/ +endef + +$(eval $(call KernelPackage,zaptel14)) +$(eval $(call KernelPackage,zaptel14-dummy)) +$(eval $(call KernelPackage,zaptel14-wcusb)) +$(eval $(call KernelPackage,zaptel14-wctdm)) +$(eval $(call BuildPackage,zaptel14-util)) +$(eval $(call BuildPackage,zaptel14-libtonezone)) diff --git a/libs/zaptel-1.4.x/files/10-create-device-node b/libs/zaptel-1.4.x/files/10-create-device-node new file mode 100644 index 0000000..f49c6c1 --- /dev/null +++ b/libs/zaptel-1.4.x/files/10-create-device-node @@ -0,0 +1,9 @@ +#!/bin/sh + +case "$ACTION" in + add) + /bin/mkdir -p /dev/zap + /bin/mknod -m 0644 /dev/zap/${DEVICENAME#zap} c $MAJOR $MINOR + ;; +esac + diff --git a/libs/zaptel-1.4.x/patches/002-upstream_hrtimer.patch b/libs/zaptel-1.4.x/patches/002-upstream_hrtimer.patch new file mode 100644 index 0000000..1143068 --- /dev/null +++ b/libs/zaptel-1.4.x/patches/002-upstream_hrtimer.patch @@ -0,0 +1,52 @@ +--- + kernel/ztdummy.c | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +--- a/kernel/ztdummy.c ++++ b/kernel/ztdummy.c +@@ -54,7 +54,7 @@ + * the #define USE_RTC should be commented out. + */ + #if defined(__i386__) || defined(__x86_64__) +-#if LINUX_VERSION_CODE >= VERSION_CODE(2,6,13) ++#if LINUX_VERSION_CODE >= VERSION_CODE(2,6,15) + /* The symbol hrtimer_forward is only exported as of 2.6.22: */ + #if defined(CONFIG_HIGH_RES_TIMERS) && LINUX_VERSION_CODE >= VERSION_CODE(2,6,22) + #define USE_HIGHRESTIMER +@@ -90,6 +90,18 @@ + #endif + #include "ztdummy.h" + ++#if defined(USE_HIGHRESTIMER) && ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) ) ++/* compatibility with new hrtimer interface */ ++static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer) ++{ ++ return timer->expires; ++} ++ ++static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) ++{ ++ timer->expires = time; ++} ++#endif + + static struct ztdummy *ztd; + +@@ -199,7 +211,7 @@ static enum hrtimer_restart ztdummy_hr_i + * expired. + * We should worry if overrun is 2 or more; then we really missed + * a tick */ +- overrun = hrtimer_forward(&zaptimer, htmr->expires, ++ overrun = hrtimer_forward(&zaptimer, hrtimer_get_expires(htmr), + ktime_set(0, ZAPTEL_TIME_NS)); + if(overrun > 1) { + if(printk_ratelimit()) +@@ -222,7 +234,7 @@ static enum hrtimer_restart ztdummy_hr_i + /* use kernel system tick timer if PC architecture RTC is not available */ + static void ztdummy_timer(unsigned long param) + { +- timer.expires = jiffies + 1; ++ hrtimer_set_expires(timer, jiffies + 1); + add_timer(&timer); + + ztd->counter += ZAPTEL_TIME; diff --git a/libs/zaptel-1.4.x/patches/100-no_hrtimer_on_x86_only.patch b/libs/zaptel-1.4.x/patches/100-no_hrtimer_on_x86_only.patch new file mode 100644 index 0000000..cd9666e --- /dev/null +++ b/libs/zaptel-1.4.x/patches/100-no_hrtimer_on_x86_only.patch @@ -0,0 +1,22 @@ +--- + kernel/ztdummy.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/kernel/ztdummy.c ++++ b/kernel/ztdummy.c +@@ -53,7 +53,6 @@ + * If using an i386 architecture without a PC real-time clock, + * the #define USE_RTC should be commented out. + */ +-#if defined(__i386__) || defined(__x86_64__) + #if LINUX_VERSION_CODE >= VERSION_CODE(2,6,15) + /* The symbol hrtimer_forward is only exported as of 2.6.22: */ + #if defined(CONFIG_HIGH_RES_TIMERS) && LINUX_VERSION_CODE >= VERSION_CODE(2,6,22) +@@ -66,7 +65,6 @@ + #define USE_RTC + #endif + #endif +-#endif + + #include + #include diff --git a/libs/zaptel-1.4.x/patches/200-Makefile-pwd.patch b/libs/zaptel-1.4.x/patches/200-Makefile-pwd.patch new file mode 100644 index 0000000..fa6aea7 --- /dev/null +++ b/libs/zaptel-1.4.x/patches/200-Makefile-pwd.patch @@ -0,0 +1,14 @@ +--- + Makefile | 1 + + 1 file changed, 1 insertion(+) + +--- a/Makefile ++++ b/Makefile +@@ -18,6 +18,7 @@ ifeq ($(MAKELEVEL),0) + PWD:=$(shell pwd) + export PWD + endif ++PWD:=`pwd` + + ifeq ($(ARCH),) + ARCH:=$(shell uname -m | sed -e s/i.86/i386/) diff --git a/libs/zaptel-1.4.x/patches/330-uname_m.patch b/libs/zaptel-1.4.x/patches/330-uname_m.patch new file mode 100644 index 0000000..7b91ff0 --- /dev/null +++ b/libs/zaptel-1.4.x/patches/330-uname_m.patch @@ -0,0 +1,15 @@ +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/Makefile ++++ b/Makefile +@@ -25,7 +25,7 @@ ARCH:=$(shell uname -m | sed -e s/i.86/i + endif + + ifeq ($(DEB_HOST_GNU_TYPE),) +-UNAME_M:=$(shell uname -m) ++UNAME_M:=$(ARCH) + else + UNAME_M:=$(DEB_HOST_GNU_TYPE) + endif diff --git a/libs/zaptel-1.4.x/patches/340-2.6.32.patch b/libs/zaptel-1.4.x/patches/340-2.6.32.patch new file mode 100644 index 0000000..948cc48 --- /dev/null +++ b/libs/zaptel-1.4.x/patches/340-2.6.32.patch @@ -0,0 +1,16 @@ +--- + kernel/zaptel-base.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/kernel/zaptel-base.c ++++ b/kernel/zaptel-base.c +@@ -59,6 +59,9 @@ + #include + #endif + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) ++#include ++#endif + + #ifndef CONFIG_OLD_HDLC_API + #define NEW_HDLC_INTERFACE diff --git a/libs/zaptel-1.4.x/patches/350-2.6.34.patch b/libs/zaptel-1.4.x/patches/350-2.6.34.patch new file mode 100644 index 0000000..d5696e5 --- /dev/null +++ b/libs/zaptel-1.4.x/patches/350-2.6.34.patch @@ -0,0 +1,11 @@ +--- a/kernel/zconfig.h ++++ b/kernel/zconfig.h +@@ -22,6 +22,8 @@ + #include + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) + #include ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)) ++#include + #else + #include + #endif diff --git a/libs/zaptel-1.4.x/patches/360-slab.patch b/libs/zaptel-1.4.x/patches/360-slab.patch new file mode 100644 index 0000000..0221505 --- /dev/null +++ b/libs/zaptel-1.4.x/patches/360-slab.patch @@ -0,0 +1,31 @@ +--- a/kernel/wctdm.c ++++ b/kernel/wctdm.c +@@ -30,6 +30,8 @@ + #include + #include + #include ++#include ++#include + #include + #include "proslic.h" + #include "wctdm.h" +--- a/kernel/wcusb.c ++++ b/kernel/wcusb.c +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + + #include + #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,19) +--- a/kernel/ztdummy.c ++++ b/kernel/ztdummy.c +@@ -38,6 +38,7 @@ + */ + + #include ++#include + + #ifndef VERSION_CODE + # define VERSION_CODE(vers,rel,seq) ( ((vers)<<16) | ((rel)<<8) | (seq) ) diff --git a/libs/zaptel-1.4.x/patches/370-2.6.36.patch b/libs/zaptel-1.4.x/patches/370-2.6.36.patch new file mode 100644 index 0000000..b3d29a1 --- /dev/null +++ b/libs/zaptel-1.4.x/patches/370-2.6.36.patch @@ -0,0 +1,39 @@ +--- + kernel/zaptel-base.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +--- a/kernel/zaptel-base.c ++++ b/kernel/zaptel-base.c +@@ -5181,6 +5181,20 @@ static int zt_ioctl(struct inode *inode, + return zt_chan_ioctl(inode, file, cmd, data, unit); + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++#include ++static long zt_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long data) ++{ ++ int ret; ++ ++ lock_kernel(); ++ ret = zt_ioctl(file->f_path.dentry->d_inode, file, cmd, data); ++ unlock_kernel(); ++ ++ return ret; ++} ++#endif ++ + int zt_register(struct zt_span *span, int prefmaster) + { + int x; +@@ -7632,7 +7646,11 @@ static struct file_operations zt_fops = + llseek: NULL, + open: zt_open, + release: zt_release, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++ unlocked_ioctl: zt_ioctl_unlocked, ++#else + ioctl: zt_ioctl, ++#endif + read: zt_read, + write: zt_write, + poll: zt_poll, diff --git a/libs/zaptel-1.4.x/patches/371-3.x.patch b/libs/zaptel-1.4.x/patches/371-3.x.patch new file mode 100644 index 0000000..0404a4b --- /dev/null +++ b/libs/zaptel-1.4.x/patches/371-3.x.patch @@ -0,0 +1,23 @@ +--- a/kernel/zaptel-base.c ++++ b/kernel/zaptel-base.c +@@ -5182,14 +5182,20 @@ static int zt_ioctl(struct inode *inode, + } + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++#ifdef CONFIG_BKL + #include ++#endif + static long zt_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long data) + { + int ret; + ++#ifdef CONFIG_BKL + lock_kernel(); ++#endif + ret = zt_ioctl(file->f_path.dentry->d_inode, file, cmd, data); ++#ifdef CONFIG_BKL + unlock_kernel(); ++#endif + + return ret; + } diff --git a/libs/zaptel-1.4.x/patches/380-use_cross_ar.patch b/libs/zaptel-1.4.x/patches/380-use_cross_ar.patch new file mode 100644 index 0000000..90f8ef5 --- /dev/null +++ b/libs/zaptel-1.4.x/patches/380-use_cross_ar.patch @@ -0,0 +1,23 @@ +--- a/Makefile ++++ b/Makefile +@@ -30,6 +30,9 @@ else + UNAME_M:=$(DEB_HOST_GNU_TYPE) + endif + ++AR ?= ar ++RANLIB ?= ranlib ++ + # If you want to build for a kernel other than the current kernel, set KVERS + ifndef KVERS + KVERS:=$(shell uname -r) +@@ -352,8 +355,8 @@ ztspeed: CFLAGS= + sethdlc-new: CFLAGS+=-I$(KINCLUDES) + + $(LTZ_A): $(LTZ_A_OBJS) +- ar rcs $@ $^ +- ranlib $@ ++ $(AR) rcs $@ $^ ++ $(RANLIB) $@ + + $(LTZ_SO): $(LTZ_SO_OBJS) + $(CC) $(CFLAGS) -shared -Wl,-soname,$(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) -o $@ $^ $(LDFLAGS) $(LDLIBS) -lm diff --git a/libs/zaptel-1.4.x/patches/390-include_spinlock_h.patch b/libs/zaptel-1.4.x/patches/390-include_spinlock_h.patch new file mode 100644 index 0000000..ff81638 --- /dev/null +++ b/libs/zaptel-1.4.x/patches/390-include_spinlock_h.patch @@ -0,0 +1,19 @@ +--- a/kernel/ztdummy.c ++++ b/kernel/ztdummy.c +@@ -79,6 +79,7 @@ + #include + #endif + #ifdef LINUX26 ++#include + #ifdef USE_HIGHRESTIMER + #include + #endif +@@ -328,7 +329,7 @@ int init_module(void) + #ifdef LINUX26 + ztd->counter = 0; + #ifdef USE_RTC +- ztd->rtclock = SPIN_LOCK_UNLOCKED; ++ spin_lock_init(&ztd->rtclock); + ztd->rtc_task.func = ztdummy_rtc_interrupt; + ztd->rtc_task.private_data = ztd; + err = rtc_register(&ztd->rtc_task); diff --git a/libs/zaptel/Makefile b/libs/zaptel/Makefile new file mode 100644 index 0000000..cccc705 --- /dev/null +++ b/libs/zaptel/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2006-2009 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:=zaptel +PKG_VERSION:=1.2.27 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/zaptel/releases/ +PKG_MD5SUM:=6e0ccf2a2a805054123b35bf8eb10ae9 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/kernel.mk + +define Package/zaptel-libtonezone + SECTION:=libs + CATEGORY:=Libraries + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Zaptel tonezone library. + URL:=http://downloads.asterisk.org/pub/telephony/zaptel/ +endef + +define Build/Configure +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + HOSTCC="$(HOSTCC)" \ + CFLAGS="$(TARGET_CFLAGS) -I. -DBUILDING_TONEZONE" \ + KSRC="$(LINUX_DIR)" \ + KVERS="$(LINUX_VERSION)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install-tonezone +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/linux + $(CP) $(PKG_INSTALL_DIR)/usr/include/linux/zaptel.h $(1)/usr/include/linux/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/tonezone.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.so* $(1)/usr/lib/ +endef + +define Package/zaptel-libtonezone/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,zaptel-libtonezone)) diff --git a/libs/zaptel/patches/110-Makefile-tonezone_install.patch b/libs/zaptel/patches/110-Makefile-tonezone_install.patch new file mode 100644 index 0000000..2825bb2 --- /dev/null +++ b/libs/zaptel/patches/110-Makefile-tonezone_install.patch @@ -0,0 +1,19 @@ +--- a/Makefile ++++ b/Makefile +@@ -501,6 +501,16 @@ install-include: zaptel.h torisa.h + install -d $(DESTDIR)$(INCLUDE_DIR)/linux + install -m 644 zaptel.h torisa.h $(DESTDIR)$(INCLUDE_DIR)/linux/ + ++install-tonezone: $(LIBTONEZONE_SO) ++ install -D -m 755 $(LIBTONEZONE_SO) $(DESTDIR)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) ++ rm -f $(DESTDIR)/usr/lib/$(LIBTONEZONE_SO) ++ ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \ ++ $(DESTDIR)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER) ++ ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \ ++ $(DESTDIR)/usr/lib/$(LIBTONEZONE_SO) ++ install -D -m 644 zaptel.h $(DESTDIR)/usr/include/linux/zaptel.h ++ install -D -m 644 tonezone.h $(DESTDIR)/usr/include/tonezone.h ++ + install-udev: devices + + # FIRMWARE_DIR also implies HOTPLUG_FIRMWARE, unless set manually. diff --git a/mail/dovecot/Makefile b/mail/dovecot/Makefile new file mode 100644 index 0000000..e13fd1a --- /dev/null +++ b/mail/dovecot/Makefile @@ -0,0 +1,71 @@ +# +# Copyright (C) 2006-2011 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:=1.2.13 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.dovecot.org/releases/1.2 +PKG_MD5SUM:=aaee3b5fd59e01780305553248f686bc + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/dovecot + SECTION:=mail + CATEGORY:=Mail + DEPENDS:=+libopenssl +librt +zlib +libbz2 + TITLE:=An IMAP and POP3 daemon + URL:=http://www.dovecot.org/ +endef + +define Package/dovecot/description + Dovecot is a program which provides POP3 and IMAP services. +endef + +CONFIGURE_ARGS += \ + --without-gssapi \ + --without-pam \ + --without-libcap \ + --with-moduledir=/usr/lib/dovecot/modules \ + --with-notify=dnotify \ + +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 + $(INSTALL_BIN) ./files/dovecot.init $(1)/etc/init.d/dovecot + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/dovecot-example.conf $(1)/etc/dovecot.conf + $(INSTALL_DIR) $(1)/usr/lib/dovecot + $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot/* $(1)/usr/lib/dovecot/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/ + find $(1)/usr/lib/dovecot/modules/ \ + -name "*.a" -o -name "*.la" | xargs rm +endef + +define Package/dovecot/conffiles +/etc/dovecot.conf +endef + +$(eval $(call BuildPackage,dovecot)) diff --git a/mail/dovecot/files/dovecot.init b/mail/dovecot/files/dovecot.init new file mode 100644 index 0000000..7539fb6 --- /dev/null +++ b/mail/dovecot/files/dovecot.init @@ -0,0 +1,23 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=99 + +SERVICE_PID_FILE=/var/run/dovecot/master.pid + +start() { + user_exists dovecot 59 || user_add dovecot 59 + group_exists dovecot 59 || group_add dovecot 59 + mkdir -p -m 0755 /var/lib/dovecot + mkdir -p -m 0755 /var/run/dovecot + chmod 0750 /var/lib/dovecot + service_start /usr/sbin/dovecot +} + +stop() { + service_stop /usr/sbin/dovecot +} + +reload() { + service_reload /usr/sbin/dovecot +} diff --git a/mail/dovecot/patches/001-configure_in.patch b/mail/dovecot/patches/001-configure_in.patch new file mode 100644 index 0000000..2192605 --- /dev/null +++ b/mail/dovecot/patches/001-configure_in.patch @@ -0,0 +1,31 @@ +--- a/configure.in ++++ b/configure.in +@@ -398,9 +398,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 +- ++ ], [ + int main() + { + return epoll_create(5) < 1; +@@ -559,7 +559,7 @@ AC_TRY_COMPILE([ + 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 + #include +@@ -568,6 +568,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; diff --git a/mail/dovecot/patches/002-example_conf.patch b/mail/dovecot/patches/002-example_conf.patch new file mode 100644 index 0000000..c2e98b4 --- /dev/null +++ b/mail/dovecot/patches/002-example_conf.patch @@ -0,0 +1,87 @@ +--- a/dovecot-example.conf ++++ b/dovecot-example.conf +@@ -537,20 +537,20 @@ + + protocol imap { + # Login executable location. +- #login_executable = /usr/libexec/dovecot/imap-login ++ #login_executable = /usr/lib/dovecot/imap-login + + # IMAP executable location. Changing this allows you to execute other + # binaries before the imap process is executed. + # + # This would write rawlogs into user's ~/dovecot.rawlog/, if it exists: +- # mail_executable = /usr/libexec/dovecot/rawlog /usr/libexec/dovecot/imap ++ # mail_executable = /usr/lib/dovecot/rawlog /usr/lib/dovecot/imap + # + # + # This would attach gdb into the imap process and write backtraces into + # /tmp/gdbhelper.* files: +- # mail_executable = /usr/libexec/dovecot/gdbhelper /usr/libexec/dovecot/imap ++ # mail_executable = /usr/lib/dovecot/gdbhelper /usr/lib/dovecot/imap + # +- #mail_executable = /usr/libexec/dovecot/imap ++ #mail_executable = /usr/lib/dovecot/imap + + # Maximum IMAP command line length in bytes. Some clients generate very long + # command lines with huge mailboxes, so you may need to raise this if you get +@@ -614,11 +614,11 @@ protocol imap { + + protocol pop3 { + # Login executable location. +- #login_executable = /usr/libexec/dovecot/pop3-login ++ #login_executable = /usr/lib/dovecot/pop3-login + + # POP3 executable location. See IMAP's mail_executable above for examples + # how this could be changed. +- #mail_executable = /usr/libexec/dovecot/pop3 ++ #mail_executable = /usr/lib/dovecot/pop3 + + # Don't try to set mails non-recent or seen with POP3 sessions. This is + # mostly intended to reduce disk I/O. With maildir it doesn't move files +@@ -743,7 +743,7 @@ protocol lda { + ## + + # Executable location +-#auth_executable = /usr/libexec/dovecot/dovecot-auth ++#auth_executable = /usr/lib/dovecot/dovecot-auth + + # Set max. process size in megabytes. + #auth_process_size = 256 +@@ -872,7 +872,7 @@ auth default { + # database (passwd usually), you can use static userdb. + # REMEMBER: You'll need /etc/pam.d/dovecot file created for PAM + # authentication to actually work. +- passdb pam { ++ #passdb pam { + # [session=yes] [setcred=yes] [failure_show_msg=yes] [max_requests=] + # [cache_key=] [] + # +@@ -905,15 +905,15 @@ auth default { + # args = session=yes %Ls + # args = cache_key=%u dovecot + #args = dovecot +- } ++ #} + + # System users (NSS, /etc/passwd, or similiar) + # In many systems nowadays this uses Name Service Switch, which is + # configured in /etc/nsswitch.conf. +- #passdb passwd { ++ passdb passwd { + # [blocking=yes] - See userdb passwd for explanation + #args = +- #} ++ } + + # Shadow passwords for system users (NSS, /etc/shadow or similiar). + # Deprecated by PAM nowadays. +@@ -1192,7 +1192,7 @@ plugin { + # a dictionary so it can be quickly determined which mailboxes contain + # expired mails. The actual expunging is done in a nightly cronjob, which + # you must set up: +- # dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool ++ # dovecot --exec-mail ext /usr/lib/dovecot/expire-tool + #expire = Trash 7 Spam 30 + #expire_dict = proxy::expire + diff --git a/mail/fetchmail/Makefile b/mail/fetchmail/Makefile new file mode 100644 index 0000000..7702f4e --- /dev/null +++ b/mail/fetchmail/Makefile @@ -0,0 +1,83 @@ +# +# Copyright (C) 2006-2011 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:=fetchmail +PKG_VERSION:=6.3.20 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=http://download.berlios.de/fetchmail +PKG_MD5SUM:=76406dbb37471f911cbb483830afe068 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/fetchmail/Default + SECTION:=mail + CATEGORY:=Mail + TITLE:=Remote mail retriever + URL:=http://fetchmail.berlios.de/ +endef + +define Package/fetchmail/Default/description + Retrieves remote mail via POP/IMAP. + Very useful in conjunction with mutt. +endef + +define Package/fetchmail + $(call Package/fetchmail/Default) + DEPENDS+= +libopenssl + TITLE+= (with SSL support) + VARIANT:=ssl +endef + +define Package/fetchmail/description + $(call Package/fetchmail/Default/description) + This package is built with SSL support. +endef + +define Package/fetchmail-nossl + $(call Package/fetchmail/Default) + TITLE+= (without SSL support) + VARIANT:=nossl +endef + +define Package/fetchmail-nossl/description + $(call Package/fetchmail/Default/description) + This package is built without SSL support. +endef + +CONFIGURE_ARGS += \ + --enable-fallback=procmail \ + --without-hesiod + +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS += \ + --with-ssl="$(STAGING_DIR)/usr" +endif + +ifeq ($(BUILD_VARIANT),nossl) + CONFIGURE_ARGS += \ + --without-ssl +endif + +CONFIGURE_VARS += \ + ac_cv_path_procmail=/usr/sbin/procmail + +define Package/fetchmail/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/fetchmail $(1)/usr/bin/ +endef + +Package/fetchmail-nossl/install = $(Package/fetchmail/install) + +$(eval $(call BuildPackage,fetchmail)) +$(eval $(call BuildPackage,fetchmail-nossl)) diff --git a/mail/imapfilter/Makefile b/mail/imapfilter/Makefile new file mode 100644 index 0000000..802e835 --- /dev/null +++ b/mail/imapfilter/Makefile @@ -0,0 +1,69 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=imapfilter +PKG_VERSION:=2.2.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://imapfilter.hellug.gr/source/ +PKG_MD5SUM:=09c6ffb085a5a244dc9f3e798259f341 + +include $(INCLUDE_DIR)/package.mk + +define Package/imapfilter + SECTION:=mail + CATEGORY:=Mail + DEPENDS:=+liblua +libopenssl +libpcre + TITLE:=IMAP server based email filtering + URL:=http://imapfilter.hellug.gr/ +endef + +define Package/imapfilter/description + IMAPFilter is a mail filtering utility. It connects to remote mail + servers using the Internet Message Access Protocol (IMAP), sends + searching queries to the server and processes mailboxes based on the + results. It can be used to delete, copy, move, flag, etc. messages + residing in mailboxes at the same or different mail servers. The 4rev1 + and 4 versions of the IMAP protocol are supported. + + IMAPFilter uses the Lua programming language as a configuration and + extension language. +endef + +define Build/Configure + (cd $(PKG_BUILD_DIR); \ + ./configure \ + -d /usr \ + ); +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + INCDIRS="$(TARGET_CPPFLAGS)" \ + LIBDIRS="$(TARGET_LDFLAGS)" \ + MYCFLAGS="$(TARGET_CFLAGS) -std=gnu99" \ + MYLDFLAGS="-lcrypt" +endef + +define Package/imapfilter/conffiles +/etc/imapfilter/config.lua +endef + +define Package/imapfilter/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/imapfilter $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/imapfilter + $(INSTALL_CONF) $(PKG_BUILD_DIR)/sample.config.lua $(1)/etc/imapfilter/config.lua + $(INSTALL_DIR) $(1)/usr/share/imapfilter + $(INSTALL_DATA) $(PKG_BUILD_DIR)/{account,auxiliary,common,mailbox,message,options,regex,set,deprecated}.lua $(1)/usr/share/imapfilter/ +endef + +$(eval $(call BuildPackage,imapfilter)) diff --git a/mail/imapfilter/patches/010-pathnames.patch b/mail/imapfilter/patches/010-pathnames.patch new file mode 100644 index 0000000..6e9a43f --- /dev/null +++ b/mail/imapfilter/patches/010-pathnames.patch @@ -0,0 +1,31 @@ +--- a/pathnames.h ++++ b/pathnames.h +@@ -3,7 +3,7 @@ + + + /* Program's home directory. */ +-#define PATHNAME_HOME ".imapfilter" ++#define PATHNAME_HOME "/etc/imapfilter" + + /* Program's configuration file. */ + #define PATHNAME_CONFIG PATHNAME_HOME "/config.lua" +@@ -39,7 +39,7 @@ + #define PATHNAME_CERTS PATHNAME_HOME "/certificates" + + /* Debug temporary file template. */ +-#define PATHNAME_DEBUG PATHNAME_HOME "/debug.XXXXXX" ++#define PATHNAME_DEBUG "/tmp/imapfilterdebug.XXXXXX" + + + #endif /* PATHNAMES_H */ +--- a/imapfilter.c ++++ b/imapfilter.c +@@ -50,7 +50,7 @@ + opts.config = NULL; + opts.oneline = NULL; + +- env.home = getenv("HOME"); ++ env.home = ""; + env.pathmax = -1; + + while ((c = getopt(argc, argv, "Vc:de:il:v?")) != -1) { diff --git a/mail/mini_sendmail/Makefile b/mail/mini_sendmail/Makefile new file mode 100644 index 0000000..8024f88 --- /dev/null +++ b/mail/mini_sendmail/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mini-sendmail +PKG_VERSION:=1.3.6 +PKG_RELEASE:=4 + +PKG_SOURCE:=mini_sendmail-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.acme.com/software/mini_sendmail/ +PKG_MD5SUM:=fb1585d2ad81c519a26d83bfd783dee8 + +PKG_BUILD_DIR:=$(BUILD_DIR)/mini_sendmail-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/mini-sendmail + SECTION:=mail + CATEGORY:=Mail + TITLE:=A small sendmail-compatible mail forwarder + URL:=http://www.acme.com/software/mini_sendmail/ +endef + +define Package/mini-sendmail/description + mini_sendmail reads its standard input up to an end-of-file and sends a + copy of the message found there to all of the addresses listed. + The message is sent by connecting to a local SMTP server. This means + mini_sendmail can be used to send email from inside a chroot(2) area. +endef + +MAKE_FLAGS += \ + OFLAGS="$(TARGET_CFLAGS)" + +define Package/mini-sendmail/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mini_sendmail $(1)/usr/sbin/ +endef + +define Package/mini-sendmail/postinst + ln -sf mini_sendmail $${IPKG_INSTROOT}/usr/sbin/sendmail +endef + +$(eval $(call BuildPackage,mini-sendmail)) diff --git a/mail/mini_sendmail/patches/200-fullname.patch b/mail/mini_sendmail/patches/200-fullname.patch new file mode 100644 index 0000000..95e19a7 --- /dev/null +++ b/mail/mini_sendmail/patches/200-fullname.patch @@ -0,0 +1,36 @@ +Index: mini_sendmail-1.3.6/mini_sendmail.c +=================================================================== +--- mini_sendmail-1.3.6.orig/mini_sendmail.c 2007-08-28 17:58:37.000000000 +0200 ++++ mini_sendmail-1.3.6/mini_sendmail.c 2007-08-28 17:58:37.000000000 +0200 +@@ -542,6 +542,7 @@ + } + + /* Strip off any angle brackets. */ ++/* + while ( len > 0 && *recipient == '<' ) + { + ++recipient; +@@ -551,6 +552,23 @@ + --len; + + (void) snprintf( buf, sizeof(buf), "RCPT TO:<%.*s>", len, recipient ); ++*/ ++ if (len > 0 && recipient[len-1] == '>' ) ++ { ++ /* "" or: "Full Name " */ ++ while (len > 0 && *recipient != '<' ) ++ { ++ ++recipient; ++ --len; ++ } ++ (void) snprintf( buf, sizeof(buf), "RCPT TO:%.*s", len, recipient ); ++ } ++ else ++ { ++ /* name@domain */ ++ (void) snprintf( buf, sizeof(buf), "RCPT TO:<%.*s>", len, recipient ); ++ } ++ + send_command( buf ); + status = read_response(); + if ( status != 250 && status != 251 ) diff --git a/mail/mini_sendmail/patches/500-flags.patch b/mail/mini_sendmail/patches/500-flags.patch new file mode 100644 index 0000000..39b42b4 --- /dev/null +++ b/mail/mini_sendmail/patches/500-flags.patch @@ -0,0 +1,17 @@ +Index: mini_sendmail-1.3.6/Makefile +=================================================================== +--- mini_sendmail-1.3.6.orig/Makefile 2007-08-28 17:58:37.000000000 +0200 ++++ mini_sendmail-1.3.6/Makefile 2007-08-28 17:58:37.000000000 +0200 +@@ -7,9 +7,10 @@ + BINDIR = /usr/local/sbin + MANDIR = /usr/local/man + CC = gcc +-CFLAGS = -O ++OFLAGS = -O ++CFLAGS = $(OFLAGS) + #CFLAGS = -g +-LDFLAGS = -s -static ++LDFLAGS = + #LDFLAGS = -g -static + LDLIBS = $(SYSV_LIBS) + diff --git a/mail/msmtp/Makefile b/mail/msmtp/Makefile new file mode 100644 index 0000000..8392a3c --- /dev/null +++ b/mail/msmtp/Makefile @@ -0,0 +1,122 @@ +# +# Copyright (C) 2009 David Cooper +# Copyright (C) 2009-2012 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:=msmtp +PKG_VERSION:=1.4.27 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/msmtp +PKG_MD5SUM:=2d6d10d9c59ed2b2635554ed35fb9226 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/msmtp/Default + SECTION:=mail + CATEGORY:=Mail + TITLE:=Simple sendmail SMTP forwarding + URL:=http://msmtp.sourceforge.net/ +endef + +define Package/msmtp/Default/description + msmtp is an SMTP client. In the default mode, it transmits a mail to + an SMTP server (for example at a free mail provider) which does the + delivery. To use this program with your mail user agent (MUA), create + a configuration file with your mail account(s) and tell your MUA to + call msmtp instead of /usr/sbin/sendmail. +endef + +define Package/msmtp +$(call Package/msmtp/Default) + DEPENDS+= +libopenssl + TITLE+= (with SSL support) + VARIANT:=ssl +endef + +define Package/msmtp/conffiles +/etc/msmtprc +endef + +define Package/msmtp/description +$(call Package/msmtp/Default/description) + This package is built with SSL support. +endef + +define Package/msmtp-nossl +$(call Package/msmtp/Default) + TITLE+= (without SSL support) + VARIANT:=nossl +endef + +define Package/msmtp-nossl/description +$(call Package/msmtp/Default/description) + This package is built without SSL support. +endef + +define Package/msmtp-queue +$(call Package/msmtp/Default) + DEPENDS+= +bash + TITLE+= (queue scripts) +endef + +define Package/msmtp-queue/description +$(call Package/msmtp/Default/description) + This package contains the msmtp queue scripts. +endef + +CONFIGURE_ARGS += \ + --disable-rpath \ + --without-libintl-prefix \ + --without-libgsasl \ + --without-libidn + +MAKE_FLAGS := + +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS += \ + --with-ssl=openssl +endif + +ifeq ($(BUILD_VARIANT),nossl) + CONFIGURE_ARGS += \ + --with-ssl=no +endif + +define Package/msmtp/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/msmtprc-system.example \ + $(1)/etc/msmtprc + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/msmtp $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin +endef + +define Package/msmtp/postinst + ln -sf ../bin/msmtp $${IPKG_INSTROOT}/usr/sbin/sendmail +endef + +Package/msmtp-nossl/conffiles = $(Package/msmtp/conffiles) +Package/msmtp-nossl/install = $(Package/msmtp/install) +Package/msmtp-nossl/postinst = $(Package/msmtp/postinst) + +define Package/msmtp-queue/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpq/msmtp{q,-queue} $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpqueue/msmtp-{en,list,run}queue.sh $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,msmtp)) +$(eval $(call BuildPackage,msmtp-nossl)) +$(eval $(call BuildPackage,msmtp-queue)) diff --git a/mail/mutt/Makefile b/mail/mutt/Makefile new file mode 100644 index 0000000..eb7381d --- /dev/null +++ b/mail/mutt/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mutt +PKG_VERSION:=1.5.21 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=@SF/mutt +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=a29db8f1d51e2f10c070bf88e8a553fd + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/mutt + SECTION:=mail + CATEGORY:=Mail + DEPENDS:=+libopenssl +libncursesw + TITLE:=Console mail client + URL:=http://www.mutt.org/ +endef + +define Package/mutt/description + Mutt is a small but very powerful text-based mail client for Unix + operating systems. +endef + +CONFIGURE_ARGS += \ + --includedir=$(PKG_BUILD_DIR)/. \ + --oldincludedir=$(PKG_BUILD_DIR)/. \ + --enable-pop \ + --enable-imap \ + --with-ssl \ + --without-idn + +define Package/mutt/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mutt $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,mutt)) diff --git a/mail/mutt/patches/001-no_po_and_docs.patch b/mail/mutt/patches/001-no_po_and_docs.patch new file mode 100644 index 0000000..a645993 --- /dev/null +++ b/mail/mutt/patches/001-no_po_and_docs.patch @@ -0,0 +1,11 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -342,7 +342,7 @@ top_srcdir = @top_srcdir@ + AUTOMAKE_OPTIONS = 1.6 foreign + @BUILD_IMAP_TRUE@IMAP_SUBDIR = imap + @BUILD_IMAP_TRUE@IMAP_INCLUDES = -I$(top_srcdir)/imap +-SUBDIRS = m4 po intl doc contrib $(IMAP_SUBDIR) ++SUBDIRS = m4 intl contrib $(IMAP_SUBDIR) + bin_SCRIPTS = muttbug flea @SMIMEAUX_TARGET@ + @BUILD_HCACHE_TRUE@HCVERSION = hcversion.h + BUILT_SOURCES = keymap_defs.h patchlist.c reldate.h $(HCVERSION) diff --git a/mail/nullmailer/Makefile b/mail/nullmailer/Makefile new file mode 100644 index 0000000..7416064 --- /dev/null +++ b/mail/nullmailer/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2007-2011 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:=nullmailer +PKG_VERSION:=1.05 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://untroubled.org/nullmailer/ +PKG_MD5SUM:=35124cc05f893efba1310e2ec7c876ff + +include $(INCLUDE_DIR)/package.mk + +define Package/nullmailer + SECTION:=mail + CATEGORY:=Mail + DEPENDS:=+libstdcpp + TITLE:=A minimal MTA for hosts which relay to a fixed set of smart relays + URL:=http://untroubled.org/nullmailer/ +endef + +define Package/nullmailer/description + This is nullmailer, a sendmail/qmail/etc replacement MTA for hosts + which relay to a fixed set of smart relays. It is designed to be + simple to configure, secure, and easily extendable. +endef + +TARGET_CFLAGS += $(TARGET_CPPFLAGS) + +define Package/nullmailer/install + $(INSTALL_DIR) $(1)/etc/nullmailer + echo "# List of smart relays" > $(1)/etc/nullmailer/remotes + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mailq $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/nullmailer-inject $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/nullmailer-queue $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/nullmailer-send $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sendmail $(1)/usr/sbin/nullmailer-sendmail + $(INSTALL_DIR) $(1)/usr/lib/nullmailer + $(INSTALL_BIN) $(PKG_BUILD_DIR)/protocols/qmqp $(1)/usr/lib/nullmailer/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/protocols/smtp $(1)/usr/lib/nullmailer/ +endef + +define Package/nullmailer/conffiles +/etc/nullmailer/remotes +endef + +define Package/nullmailer/postinst + ln -sf ../sbin/sendmail $${IPKG_INSTROOT}/usr/lib/sendmail + ln -sf nullmailer-sendmail $${IPKG_INSTROOT}/usr/sbin/sendmail +endef + +$(eval $(call BuildPackage,nullmailer)) diff --git a/mail/procmail/Makefile b/mail/procmail/Makefile new file mode 100644 index 0000000..f006e12 --- /dev/null +++ b/mail/procmail/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2006-2008 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:=procmail +PKG_VERSION:=3.22 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=http://www.procmail.org/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=1678ea99b973eb77eda4ecf6acae53f1 + +include $(INCLUDE_DIR)/package.mk + +define Package/procmail + SECTION:=mail + CATEGORY:=Mail + TITLE:=Mail processing tool + URL:=http://www.procmail.org +endef + +define Package/procmail/description + Procmail is able to process and classify incoming mail into + different mail boxes. + Very useful in conjunction with mutt. +endef + +TARGET_CFLAGS += -DPROCMAIL + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/src -f ../Makefile.openwrt \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" +endef + +define Package/procmail/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/src/procmail $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/formail $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,procmail)) diff --git a/mail/procmail/patches/001-procmail_openwrt.patch b/mail/procmail/patches/001-procmail_openwrt.patch new file mode 100644 index 0000000..c33d826 --- /dev/null +++ b/mail/procmail/patches/001-procmail_openwrt.patch @@ -0,0 +1,51 @@ +This patch is required to make procmail cross compile - it tries to run some automatic tests which +obviously do not work in a cross compiled environment. + + +diff -Naur procmail-3.22_orig/autoconf.h procmail-3.22/autoconf.h +--- procmail-3.22_orig/autoconf.h 1970-01-01 10:00:00.000000000 +1000 ++++ procmail-3.22/autoconf.h 2006-03-23 12:15:36.000000000 +1100 +@@ -0,0 +1,21 @@ ++/* This file was automagically generated by autoconf */ ++ ++/* 5 moves in 64 steps of size 16384 when reallocing */ ++#define NOpw_class ++#define NOstrlcat ++#define NOsetrgid ++#define MAX_argc 7588 ++/* Your system's strstr() is 1.12 times FASTER than my C-routine */ ++#define UDP_protocolno 17 ++#define BIFF_serviceport "512" ++#define IP_localhost {127,0,0,1} ++#define MAILSPOOLDIR "/var/spool/mail/" ++#define SENDMAIL "/usr/sbin/sendmail" ++#define CF_no_procmail_yet ++#define buggy_SENDMAIL ++#define defPATH "PATH=$HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/bin/X11" ++#define defSPATH "PATH=/bin:/usr/bin:/usr/local/bin:/usr/bin/X11" ++#define PM_VERSION "3.22" ++/* Hotwire LOCKINGTEST=100 */ ++/* Procmail will lock via: dotlocking, fcntl() */ ++/* autoconf completed */ +diff -Naur procmail-3.22_orig/Makefile.openwrt procmail-3.22/Makefile.openwrt +--- procmail-3.22_orig/Makefile.openwrt 1970-01-01 10:00:00.000000000 +1000 ++++ procmail-3.22/Makefile.openwrt 2006-03-23 12:15:36.000000000 +1100 +@@ -0,0 +1,18 @@ ++PM_OBJ=cstdio.o common.o exopen.o goodies.o locking.o \ ++ mailfold.o foldinfo.o misc.o pipes.o regexp.o robust.o \ ++ sublib.o acommon.o mcommon.o lastdirsep.o authenticate.o \ ++ lmtp.o memblk.o variables.o from.o comsat.o ++ ++FM_OBJ=common.o fields.o formisc.o sublib.o ecommon.o \ ++ acommon.o ++ ++LDFLAGS = -lm -lnsl -ldl -lc ++CFLAGS = -Os -DPROCMAIL ++ ++all: procmail formail ++ ++procmail: procmail.o $(PM_OBJ) ++ $(CC) $(CFLAGS) $@.o $(PM_OBJ) -o $@ $(LDFLAGS) ++ ++formail: formail.o $(FM_OBJ) ++ $(CC) $(CFLAGS) $@.o $(FM_OBJ) -o $@ $(LDFLAGS) diff --git a/mail/procmail/patches/100-rename_getline.patch b/mail/procmail/patches/100-rename_getline.patch new file mode 100644 index 0000000..6cd359d --- /dev/null +++ b/mail/procmail/patches/100-rename_getline.patch @@ -0,0 +1,52 @@ +--- a/src/fields.c ++++ b/src/fields.c +@@ -110,16 +110,16 @@ + /* try and append one valid field to rdheader from stdin */ + int readhead P((void)) + { int idlen; +- getline(); ++ __getline(); + if((idlen=breakfield(buf,buffilled))<=0) /* not the start of a valid field */ + return 0; + if(idlen==STRLEN(FROM)&&eqFrom_(buf)) /* it's a From_ line */ + { if(rdheader) + return 0; /* the From_ line was a fake! */ +- for(;buflast=='>';getline()); /* gather continued >From_ lines */ ++ for(;buflast=='>';__getline()); /* gather continued >From_ lines */ + } + else +- for(;;getline()) /* get the rest of the continued field */ ++ for(;;__getline()) /* get the rest of the continued field */ + { switch(buflast) /* will this line be continued? */ + { case ' ':case '\t': /* yep, it sure is */ + continue; +--- a/src/formail.c ++++ b/src/formail.c +@@ -819,7 +819,7 @@ + { if(split) /* gobble up the next start separator */ + { buffilled=0; + #ifdef sMAILBOX_SEPARATOR +- getline();buffilled=0; /* but only if it's defined */ ++ __getline();buffilled=0; /* but only if it's defined */ + #endif + if(buflast!=EOF) /* if any */ + goto splitit; +--- a/src/formisc.c ++++ b/src/formisc.c +@@ -115,7 +115,7 @@ + buf[buffilled++]=c; + } + +-int getline P((void)) /* read a newline-terminated line */ ++int __getline P((void)) /* read a newline-terminated line */ + { if(buflast==EOF) /* at the end of our Latin already? */ + { loadchar('\n'); /* fake empty line */ + return EOF; /* spread the word */ +--- a/src/formisc.h ++++ b/src/formisc.h +@@ -17,4 +17,4 @@ + char* + skipwords P((char*start)); + int +- getline P((void)); ++ __getline P((void)); diff --git a/mail/ssmtp/Makefile b/mail/ssmtp/Makefile new file mode 100644 index 0000000..0240ae0 --- /dev/null +++ b/mail/ssmtp/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2007-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ssmtp +PKG_VERSION:=2.64 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.bz2 +PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/s/ssmtp +PKG_MD5SUM:=65b4e0df4934a6cd08c506cabcbe584f + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(TARGET_CPPFLAGS) + +define Package/ssmtp + SECTION:=mail + CATEGORY:=Mail + DEPENDS:=+libopenssl + TITLE:=A minimal and secure mail sender + URL:=http://packages.debian.org/ssmtp +endef + +define Package/ssmtp/description + A secure, effective and simple way of getting mail off a system to your + mail hub. It contains no suid-binaries or other dangerous things - no + mail spool to poke around in, and no daemons running in the background. + mail is simply forwarded to the configured mailhost. Extremely easy + configuration. +endef + +define Package/ssmtp/conffiles +/etc/ssmtp/ssmtp.conf +/etc/ssmtp/revaliases +endef + +CONFIGURE_VARS += \ + LIBS="$(TARGET_LDFLAGS) -lcrypto -lssl" + +CONFIGURE_ARGS += \ + --enable-ssl + +define Package/ssmtp/install + $(INSTALL_DIR) $(1)/etc/ssmtp + $(INSTALL_CONF) $(PKG_BUILD_DIR)/ssmtp.conf $(1)/etc/ssmtp/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/revaliases $(1)/etc/ssmtp/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ssmtp $(1)/usr/sbin/ +endef + +define Package/ssmtp/postinst +#!/bin/sh +ln -sf ssmtp $${IPKG_INSTROOT}/usr/sbin/sendmail +endef + +$(eval $(call BuildPackage,ssmtp)) diff --git a/mail/xmail/Makefile b/mail/xmail/Makefile new file mode 100644 index 0000000..e756c05 --- /dev/null +++ b/mail/xmail/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2007-2012 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:=xmail +PKG_VERSION:=1.26 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.xmailserver.org/ +PKG_MD5SUM:=26d35c2fc104d79ebb6397c7dece5b15 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/xmail + SECTION:=mail + CATEGORY:=Mail + DEPENDS:=+libopenssl +libpthread $(CXX_DEPENDS) + TITLE:=advanced, fast and reliable ESMTP/POP3 mail server + URL:=http://www.xmailserver.org/ +endef + +define Package/xmail/description + XMail is an Internet mail server featuring an SMTP, POP3 and finger server. + It's incredibly easy to set up and has lots of features including : + multiple domains, virtual users and spam protection. +endef + +define Build/Compile + CFLAGS="$(TARGET_CFLAGS)" \ + $(MAKE) -C $(PKG_BUILD_DIR) -f Makefile.lnx \ + $(TARGET_CONFIGURE_OPTS) \ + LD="$(TARGET_CXX)" \ + all + tar -cjf $(PKG_BUILD_DIR)/MailRoot.tar.bz2 -C $(PKG_BUILD_DIR)/MailRoot --exclude bin . +endef + +define Package/xmail/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/MailRoot.tar.bz2 $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/xmail.config $(1)/etc/config/xmail + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/xmail.init $(1)/etc/init.d/xmail +endef + +define Package/xmail/conffiles +/etc/config/xmail +endef + +$(eval $(call BuildPackage,xmail)) diff --git a/mail/xmail/files/xmail.config b/mail/xmail/files/xmail.config new file mode 100644 index 0000000..b4d49a0 --- /dev/null +++ b/mail/xmail/files/xmail.config @@ -0,0 +1,111 @@ +# Configuration parameters for xmail +# +# To see what xmail command line parameters each parameter corresponds to, +# please see /etc/init.d/xmail +# +# The xmail configuration files are contained in /etc/MailRoot.tar.gz, and need +# to be installed in the MAIL_ROOT directory, set by default to +# /var/MailRoot below by: +# MAIL_ROOT=`grep "option.*mail_root.*'$" /etc/config/xmail | sed -e "s/'$//" -e "s/.*'//"` +# mkdir -p $MAIL_ROOT; cd $MAIL_ROOT; tar -xjf /etc/MailRoot.tar.bz2 +# NOTE: On OpenWRT /var is a temporary filesystem, so change mail_root below, +# but it is probably not a good idea to install on a device's internal +# flash due to the amount of writing of the flash that will ensue. +# +# To see what settings are appropriate, please refer to: +# http://www.xmailserver.org/Readme.html +# which also documents the configuration files in mail_root +# ( please note that the values commented out are not real values ) +# + +config xmail + option mail_root '/var/MailRoot' +# option debug 1 +# option log_rotate '3600' +# option split_level 'param-split_level' +# option rx_buffer 'param-rx_buffer' +# option tx_buffer 'param-tx_buffer' +# option maildir_delivery 1 +# option mailbox_delivery 1 +# option dns_cache_dirs 'param-dns_cache_dirs' +# option ipv4_only 1 +# option ipv6_only 1 +# option ipv4_then_ipv6 1 +# option ipv6_then_ipv4 1 + +config pop3 +# option disable 1 +# option ipv6 1 +# option server_port 'param-server_port' +# option session_timeout 'param-session_timeout' +# option log 1 +# option delay_timeout 'param-delay_timeout' +# option bad_login_hang 1 +# option local_address 'param-local_address' + option num_threads 4 + +config pop3s + option disable 1 +# option ipv6 1 +# option server_port 'param-server_port' +# option local_address 'param-local_address' + +config smtp +# option disable 1 +# option ipv6 1 +# option server_port 'param-server_port' +# option session_timeout 'param-session_timeout' +# option log 1 +# option local_address 'param-local_address' + option num_threads 4 +# option max_recipients 'param-max_recipients' +# option expire_timeout 'param-expire_timeout' + +config smtps + option disable 1 +# option ipv6 1 +# option server_port 'param-server_port' +# option local_address 'param-local_address' + +config smail + option num_threads 8 +# option next_try_timeout 'param-next_try_timeout' +# option ratio 'param-ratio' +# option retries 'param-retries' +# option log 1 +# option filters_timeout 'param-filters_timeout' +# option filter_log 1 + +config psync + option disable 1 +# option interval 'param-interval' +# option num_threads 'param-num_threads' +# option timeout 'param-timeout' +# option log 1 + +config finger + option disable 1 +# option ipv6 1 +# option server_port 'param-server_port' +# option log 1 +# option local_address 'param-local_address' + +config ctrl +# option disable 1 +# option ipv6 1 +# option server_port 'param-server_port' +# option session_timeout 'param-session_timeout' +# option log 1 +# option local_address 'param-local_address' +# option num_threads 'param-num_threads' + +config ctrls + option disable 1 +# option ipv6 1 +# option server_port 'param-server_port' +# option session_timeout 'param-session_timeout' + +config lmail + option num_threads 4 +# option sleep_timeout 'param-sleep_timeout' +# option log 1 diff --git a/mail/xmail/files/xmail.init b/mail/xmail/files/xmail.init new file mode 100644 index 0000000..2b4990b --- /dev/null +++ b/mail/xmail/files/xmail.init @@ -0,0 +1,221 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008 OpenWrt.org + +START=90 +STOP=10 + +MAIL_ROOT= +DAEMON=/usr/bin/XMail +NAME=XMail + +append_bool() { + local section="$1" + local option="$2" + local value="$3" + local _loctmp + config_get_bool _loctmp "$section" "$option" 0 + [ "$_loctmp" -le 0 ] && return 0 + append args "$value" +} + +append_parm() { + local section="$1" + local option="$2" + local switch="$3" + local _loctmp + config_get _loctmp "$section" "$option" + [ -z "$_loctmp" ] && return 0 + append args "$switch $_loctmp" +} + +xmail() { + local cfg="$1" + + append_parm "$cfg" mail_root "-Ms" + append_bool "$cfg" debug "-Md" + append_parm "$cfg" log_rotate "-Mr" + append_parm "$cfg" split_level "-Mx" + append_parm "$cfg" rx_buffer "-MR" + append_parm "$cfg" tx_buffer "-MS" + append_bool "$cfg" maildir_delivery "-MM" + append_bool "$cfg" mailbox_delivery "-Mm" + append_parm "$cfg" dns_cache_dirs "-MD" + append_bool "$cfg" ipv4_only "-M4" + append_bool "$cfg" ipv6_only "-M6" + append_bool "$cfg" ipv4_then_ipv6 "-M5" + append_bool "$cfg" ipv6_then_ipv4 "-M7" + + config_get mail_root $cfg mail_root + [ -n "$mail_root" ] || return 0 + MAIL_ROOT=$mail_root +} + +pop3() { + local cfg="$1" + + append_bool "$cfg" disable "-P-" + append_bool "$cfg" ipv6 "-P6" + append_parm "$cfg" server_port "-Pp" + append_parm "$cfg" session_timeout "-Pt" + append_bool "$cfg" log "-Pl" + append_parm "$cfg" delay_timeout "-Pw" + append_bool "$cfg" bad_login_hang "-Ph" + append_parm "$cfg" local_address "-PI" + append_parm "$cfg" num_threads "-PX" +} + +pop3s() { + local cfg="$1" + + append_bool "$cfg" disable "-B-" + append_bool "$cfg" ipv6 "-B6" + append_parm "$cfg" server_port "-Bp" + append_parm "$cfg" local_address "-BI" +} + +smtp() { + local cfg="$1" + + append_bool "$cfg" disable "-S-" + append_bool "$cfg" ipv6 "-S6" + append_parm "$cfg" server_port "-Sp" + append_parm "$cfg" session_timeout "-St" + append_bool "$cfg" log "-Sl" + append_parm "$cfg" local_address "-SI" + append_parm "$cfg" num_threads "-SX" + append_parm "$cfg" max_recipients "-Sr" + append_parm "$cfg" expire_timeout "-Se" +} + +smtps() { + local cfg="$1" + + append_bool "$cfg" disable "-X-" + append_bool "$cfg" ipv6 "-X6" + append_parm "$cfg" server_port "-Xp" + append_parm "$cfg" local_address "-XI" +} + +smail() { + local cfg="$1" + + append_parm "$cfg" num_threads "-Qn" + append_parm "$cfg" next_try_timeout "-Qt" + append_parm "$cfg" ratio "-Qi" + append_parm "$cfg" retries "-Qr" + append_bool "$cfg" log "-Ql" + append_parm "$cfg" filters_timeout "-QT" + append_bool "$cfg" filter_log "-Qg" +} + +psync() { + local cfg="$1" + + append_bool "$cfg" disable "-Y-" + append_parm "$cfg" interval "-Yi" + append_parm "$cfg" num_threads "-Yt" + append_parm "$cfg" timeout "-Yi" + append_bool "$cfg" log "-Yl" +} + +finger() { + local cfg="$1" + + append_bool "$cfg" disable "-F-" + append_bool "$cfg" ipv6 "-F6" + append_parm "$cfg" server_port "-Fp" + append_bool "$cfg" log "-Fl" + append_parm "$cfg" local_address "-FI" +} + +ctrl() { + local cfg="$1" + + append_bool "$cfg" disable "-C-" + append_bool "$cfg" ipv6 "-C6" + append_parm "$cfg" server_port "-Cp" + append_parm "$cfg" session_timeout "-Ct" + append_bool "$cfg" log "-Cl" + append_parm "$cfg" local_address "-CI" + append_parm "$cfg" num_threads "-CX" +} + +ctrls() { + local cfg="$1" + + append_bool "$cfg" disable "-W-" + append_bool "$cfg" ipv6 "-W6" + append_parm "$cfg" server_port "-Wp" + append_parm "$cfg" session_timeout "-Wt" +} + +lmail() { + local cfg="$1" + + append_parm "$cfg" num_threads "-Ln" + append_parm "$cfg" sleep_timeout "-Lt" + append_bool "$cfg" log "-Ll" +} + +start() { + test -f $DAEMON || exit 0 + + set -e + ulimit -c 10000 + ulimit -s 128 + + config_load xmail + + args="" + + config_foreach xmail xmail + config_foreach pop3 pop3 + config_foreach pop3s pop3s + config_foreach smtp smtp + config_foreach smtps smtps + config_foreach smail smail + config_foreach psync psync + config_foreach finger finger + config_foreach ctrl ctrl + config_foreach ctrls ctrls + config_foreach lmail lmail + + [ -z "$MAIL_ROOT" ] && exit 0 + [ -d $MAIL_ROOT ] || exit 0 + + export MAIL_ROOT + + rm -f /var/run/$NAME.pid + + $DAEMON $args + + MAX_WAIT=20 + while [ ! -f /var/run/$NAME.pid -a $MAX_WAIT -gt 0 ] + do + sleep 1 + MAX_WAIT=`expr $MAX_WAIT - 1` + done +} + +stop() { + if [ -f /var/run/$NAME.pid ] + then + config_load xmail + config_foreach xmail xmail + [ -z "$MAIL_ROOT" ] || echo `date` > $MAIL_ROOT/.shutdown + kill -INT `cat /var/run/$NAME.pid` + + MAX_WAIT=20 + while [ -f $MAIL_ROOT/.shutdown -a $MAX_WAIT -gt 0 ] + do + sleep 1 + MAX_WAIT=`expr $MAX_WAIT - 1` + done + fi +} + +restart() { + stop + sleep 1 + start +} diff --git a/mail/xmail/patches/010-Makefile.common.patch b/mail/xmail/patches/010-Makefile.common.patch new file mode 100644 index 0000000..af6aa70 --- /dev/null +++ b/mail/xmail/patches/010-Makefile.common.patch @@ -0,0 +1,21 @@ +--- a/Makefile.common ++++ b/Makefile.common +@@ -76,15 +76,15 @@ + SENDMAILOBJS = SendMail.o + + %.o : %.cpp +- ${CC} ${CPPFLAGS} ${CFLAGS} -c $*.cpp ++ ${CXX} ${CPPFLAGS} ${CFLAGS} -c $*.cpp + + all: ${OUTDIR} ${MKMACHDEPINC} ${MAILSVR} ${CRTLCLNT} ${XMCRYPT} ${MKUSERS} ${SENDMAIL} + + ${OUTDIR}: + @mkdir ${OUTDIR} + +-${MKMACHDEPINC}: ${MKMACHDEP} +- ./${MKMACHDEP} > ${MKMACHDEPINC} ++#${MKMACHDEPINC}: ${MKMACHDEP} ++# ./${MKMACHDEP} > ${MKMACHDEPINC} + + ${MKMACHDEP}: ${MKMACHDEPOBJS} + ${LD} -o ${MKMACHDEP} ${MKMACHDEPOBJS} ${LDFLAGS} diff --git a/mail/xmail/patches/020-Makefile.lnx.patch b/mail/xmail/patches/020-Makefile.lnx.patch new file mode 100644 index 0000000..3f8866b --- /dev/null +++ b/mail/xmail/patches/020-Makefile.lnx.patch @@ -0,0 +1,15 @@ +--- a/Makefile.lnx ++++ b/Makefile.lnx +@@ -19,9 +19,9 @@ + # Davide Libenzi + # + SYSTYPE = linux +-CC = g++ +-LD = g++ +-STRIP = strip ++CC = $(CXX) ++LD = $(CXX) ++#STRIP = strip + + ifneq ("$(WITH_SSL_INCLUDE)", "") + CFLAGS := $(CFLAGS) -I$(WITH_SSL_INCLUDE) diff --git a/mail/xmail/patches/030-sysmachine.patch b/mail/xmail/patches/030-sysmachine.patch new file mode 100644 index 0000000..b3704fb --- /dev/null +++ b/mail/xmail/patches/030-sysmachine.patch @@ -0,0 +1,28 @@ +diff -urN xmail-1.25.orig/SysMachine.h xmail-1.25/SysMachine.h +--- xmail-1.25.orig/SysMachine.h 1970-01-01 01:00:00.000000000 +0100 ++++ xmail-1.25/SysMachine.h 2008-07-28 10:16:47.000000000 +0200 +@@ -0,0 +1,24 @@ ++#ifndef _MACHDEFS_H ++#define _MACHDEFS_H ++ ++ ++#undef MACH_BIG_ENDIAN_WORDS ++ ++#undef MACH_BIG_ENDIAN_BITFIELD ++ ++typedef signed char MachInt8; ++typedef unsigned char MachUInt8; ++#define MACH_TYPE_8BIT char ++ ++typedef signed short MachInt16; ++typedef unsigned short MachUInt16; ++#define MACH_TYPE_16BIT short ++ ++typedef signed int MachInt32; ++typedef unsigned int MachUInt32; ++#define MACH_TYPE_32BIT int ++ ++ ++ ++#endif ++ diff --git a/mail/xmail/patches/040-honour_opt_flags.patch b/mail/xmail/patches/040-honour_opt_flags.patch new file mode 100644 index 0000000..5170432 --- /dev/null +++ b/mail/xmail/patches/040-honour_opt_flags.patch @@ -0,0 +1,15 @@ +--- a/Makefile.common ++++ b/Makefile.common +@@ -24,10 +24,10 @@ + endif + + ifeq ($(XMAIL_DEBUG), 1) +- CFLAGS := $(CFLAGS) -O0 -g ++ CFLAGS := -O0 -g $(CFLAGS) + STRIP = touch + else +- CFLAGS := $(CFLAGS) -O2 ++ CFLAGS := -O2 $(CFLAGS) + endif + + OUTDIR = bin diff --git a/multimedia/crtmpserver/Makefile b/multimedia/crtmpserver/Makefile new file mode 100644 index 0000000..0f3e27e --- /dev/null +++ b/multimedia/crtmpserver/Makefile @@ -0,0 +1,85 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=crtmpserver +PKG_REV:=726 +PKG_VERSION:=r$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=--username=anonymous --password= https://svn.rtmpd.com/crtmpserver/trunk +PKG_SOURCE_SUBDIR:=crtmpserver-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=svn + +include $(INCLUDE_DIR)/package.mk + +define Package/crtmpserver + SECTION:=multimedia + CATEGORY:=Multimedia + DEPENDS:=+libopenssl +libstdcpp +liblua + TITLE:=C++ RTMP Server + URL:=http://www.rtmpd.com/ +endef + +define Package/crtmpserver/description +C++ RTMP Server it is a high performance streaming server able to +stream (live or recorded) in the following technologies: + * To and from Flash (RTMP,RTMPE, RTMPS, RTMPT, RTMPTE) + * To and from embedded devices: iPhone, Android + * From surveillance cameras + * IP-TV using MPEG-TS and RTSP/RTCP/RTP protocols + +Also, crtmpserver can be used as a high performance rendes-vous +server. For example, it enables you to do: + * Audio/Video conferencing + * Online gaming + * Online collaboration + * Simple/complex chat applications +endef + +# XXX: this hack handles the usr/bin vs bin difference of backfire and trunk +TS_BASE:=$(wildcard $(TOOLCHAIN_DIR)/bin/$(TARGET_CC)) +TS_BASE:=$(dir $(if $(TS_BASE),$(TS_BASE),$(wildcard $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CC)))) + +define Build/Configure + (cd $(PKG_BUILD_DIR)/builders/make; \ + cp linux.mk linux-openwrt-uclibc.mk; \ + $(SED) 's,^TOOLCHAIN_BASE[[:space:]]*=.*,TOOLCHAIN_BASE=$(TS_BASE),' \ + -e 's,^TOOLCHAIN_PREFIX[[:space:]]*=.*,TOOLCHAIN_PREFIX=$(TARGET_CROSS),' \ + -e 's,^CCOMPILER[[:space:]]*=.*,CCOMPILER=$(TARGET_CC),' \ + -e 's,^CXXCOMPILER[[:space:]]*=.*,CXXCOMPILER=$(TARGET_CXX),' \ + -e 's,^OPTIMIZATIONS[[:space:]]*=.*,OPTIMIZATIONS=-O2,' \ + -e 's,^SSL_BASE[[:space:]]*=.*,SSL_BASE=$(STAGING_DIR)/usr,' \ + linux-openwrt-uclibc.mk) +endef + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/builders/make \ + PLATFORM=linux-openwrt-uclibc +endef + +define Package/crtmpserver/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/crtmpserver $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/crtmpserver + $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/*.so $(1)/usr/lib/crtmpserver/ + $(foreach app,flvplayback samplefactory admin stresstest appselector vptests applestreamingclient proxypublish, \ + $(INSTALL_DIR) $(1)/usr/lib/crtmpserver/$(app); \ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/applications/$(app)/lib$(app).so \ + $(1)/usr/lib/crtmpserver/$(app)/; \ + ) + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/builders/make/output/dynamic/crtmpserver.lua $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/share/crtmpserver/appselector + $(INSTALL_DIR) $(1)/usr/share/crtmpserver/media +endef + +$(eval $(call BuildPackage,crtmpserver)) + diff --git a/multimedia/crtmpserver/patches/010-link-crypt-for-lua.patch b/multimedia/crtmpserver/patches/010-link-crypt-for-lua.patch new file mode 100644 index 0000000..4840ec4 --- /dev/null +++ b/multimedia/crtmpserver/patches/010-link-crypt-for-lua.patch @@ -0,0 +1,13 @@ +Index: crtmpserver-r692/builders/make/compile.mk +=================================================================== +--- crtmpserver-r692.orig/builders/make/compile.mk ++++ crtmpserver-r692/builders/make/compile.mk +@@ -67,7 +67,7 @@ TINYXML_OBJS = $(TINYXML_SRCS:.cpp=.tiny + + #common + COMMON_INCLUDE=$(LUA_INCLUDE) $(TINYXML_INCLUDE) $(SSL_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/common/include +-COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) -llua -ltinyxml ++COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) -llua -ltinyxml -lcrypt + COMMON_SRCS = $(shell find $(PROJECT_BASE_PATH)/sources/common/src -type f -name "*.cpp") + COMMON_OBJS = $(COMMON_SRCS:.cpp=.common.o) + diff --git a/multimedia/crtmpserver/patches/020-add-rpath.patch b/multimedia/crtmpserver/patches/020-add-rpath.patch new file mode 100644 index 0000000..83ebe56 --- /dev/null +++ b/multimedia/crtmpserver/patches/020-add-rpath.patch @@ -0,0 +1,15 @@ +Index: crtmpserver-r692/builders/make/linux.mk +=================================================================== +--- crtmpserver-r692.orig/builders/make/linux.mk ++++ crtmpserver-r692/builders/make/linux.mk +@@ -31,8 +31,8 @@ OPTIMIZATIONS = -O3 + COMPILE_FLAGS = $(FPIC) $(OPTIMIZATIONS) $(CFLAGS) + + #linking flags +-dynamic_lib_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-soname,$(DYNAMIC_LIB_PREFIX)$(1)$(DYNAMIC_LIB_SUFIX) -Wl,-rpath,"\$$ORIGIN" +-dynamic_exec_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-rpath,"\$$ORIGIN" ++dynamic_lib_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-soname,$(DYNAMIC_LIB_PREFIX)$(1)$(DYNAMIC_LIB_SUFIX) -Wl,-rpath,/usr/lib/crtmpserver ++dynamic_exec_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-rpath,/usr/lib/crtmpserver + + #compile switches + PLATFORM_DEFINES = \ diff --git a/multimedia/crtmpserver/patches/030-default-config.patch b/multimedia/crtmpserver/patches/030-default-config.patch new file mode 100644 index 0000000..a5031c9 --- /dev/null +++ b/multimedia/crtmpserver/patches/030-default-config.patch @@ -0,0 +1,53 @@ +Index: crtmpserver-r726/builders/cmake/crtmpserver/crtmpserver.lua +=================================================================== +--- crtmpserver-r726.orig/builders/cmake/crtmpserver/crtmpserver.lua ++++ crtmpserver-r726/builders/cmake/crtmpserver/crtmpserver.lua +@@ -44,7 +44,7 @@ configuration= + { + -- this is the root directory of all applications + -- usually this is relative to the binary execuable +- rootDirectory="applications", ++ rootDirectory="/usr/lib/crtmpserver", + + + --this is where the applications array starts +@@ -68,7 +68,7 @@ configuration= + -- this is the folder from where the current application gets it's content. + -- It is optional. If not specified, it will be defaulted to: + -- //mediaFolder +- -- mediaFolder="/some/directory/where/media/files/are/stored" ++ mediaFolder="/usr/share/crtmpserver/appselector", + -- the application will also be known by that names. It is optional + --aliases= + --{ +@@ -89,13 +89,6 @@ configuration= + }, + { + ip="0.0.0.0", +- port=8081, +- protocol="inboundRtmps", +- sslKey="server.key", +- sslCert="server.crt" +- }, +- { +- ip="0.0.0.0", + port=8080, + protocol="inboundRtmpt" + }, +@@ -105,7 +98,7 @@ configuration= + description="FLV Playback Sample", + name="flvplayback", + protocol="dynamiclinklibrary", +- mediaFolder="/Volumes/android/backup/media/", ++ mediaFolder="/media/", + aliases= + { + "simpleLive", +@@ -183,6 +176,7 @@ configuration= + name="samplefactory", + description="asdsadasdsa", + protocol="dynamiclinklibrary", ++ mediaFolder="/usr/share/ctmpserver/media", + aliases= + { + "httpOutboundTest" diff --git a/multimedia/crtmpserver/patches/040-use-select.patch b/multimedia/crtmpserver/patches/040-use-select.patch new file mode 100644 index 0000000..466f86c --- /dev/null +++ b/multimedia/crtmpserver/patches/040-use-select.patch @@ -0,0 +1,13 @@ +Index: crtmpserver-r726/builders/make/linux.mk +=================================================================== +--- crtmpserver-r726.orig/builders/make/linux.mk ++++ crtmpserver-r726/builders/make/linux.mk +@@ -38,7 +38,7 @@ dynamic_exec_flags = $(FPIC) $(OPTIMIZAT + PLATFORM_DEFINES = \ + -DLINUX \ + -DLITTLE_ENDIAN_BYTE_ALIGNED \ +- -DNET_EPOLL ++ -DNET_SELECT + + SSL_BASE=/usr/local + diff --git a/multimedia/crtmpserver/patches/050-add-missing-make-defines.patch b/multimedia/crtmpserver/patches/050-add-missing-make-defines.patch new file mode 100644 index 0000000..43447b0 --- /dev/null +++ b/multimedia/crtmpserver/patches/050-add-missing-make-defines.patch @@ -0,0 +1,22 @@ +Index: crtmpserver-r726/builders/make/compile.mk +=================================================================== +--- crtmpserver-r726.orig/builders/make/compile.mk ++++ crtmpserver-r726/builders/make/compile.mk +@@ -43,10 +43,16 @@ FEATURES_DEFINES = \ + -DHAS_PROTOCOL_RTP \ + -DHAS_PROTOCOL_TS \ + -DHAS_PROTOCOL_VAR \ ++ -DHAS_PROTOCOL_CLI \ ++ -DHAS_PROTOCOL_HLS \ ++ -DHAS_PROTOCOL_RAWHTTPSTREAM \ + -DHAS_LUA \ + -DHAS_MEDIA_MP3 \ + -DHAS_MEDIA_MP4 \ +- -DHAS_MEDIA_FLV ++ -DHAS_MEDIA_FLV \ ++ -DHAS_MEDIA_NSV \ ++ -DHAS_SYSLOG ++ + + + DEFINES = $(PLATFORM_DEFINES) $(FEATURES_DEFINES) diff --git a/multimedia/crtmpserver/patches/060-add-dl-for-crypto.patch b/multimedia/crtmpserver/patches/060-add-dl-for-crypto.patch new file mode 100644 index 0000000..cbd5daf --- /dev/null +++ b/multimedia/crtmpserver/patches/060-add-dl-for-crypto.patch @@ -0,0 +1,13 @@ +Index: crtmpserver-r726/builders/make/compile.mk +=================================================================== +--- crtmpserver-r726.orig/builders/make/compile.mk 2012-06-07 19:53:18.028378001 +0200 ++++ crtmpserver-r726/builders/make/compile.mk 2012-06-07 20:02:08.260400669 +0200 +@@ -59,7 +59,7 @@ + + #library paths + SSL_INCLUDE=-I$(SSL_BASE)/include +-SSL_LIB=-L$(SSL_BASE)/lib -lssl -lcrypto ++SSL_LIB=-L$(SSL_BASE)/lib -lssl -lcrypto -ldl + + #lua + LUA_INCLUDE=-I$(PROJECT_BASE_PATH)/3rdparty/lua-dev diff --git a/multimedia/darkice/Makefile b/multimedia/darkice/Makefile new file mode 100644 index 0000000..453b847 --- /dev/null +++ b/multimedia/darkice/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2011 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:=darkice +PKG_VERSION:=1.0 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://darkice.googlecode.com/files/ +PKG_MD5SUM:= 1804e63d42a9703d01fe378c9a77c473 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/darkice + SECTION:=multimedia + CATEGORY:=Multimedia + SUBMENU:=Streaming + TITLE:=DarkIce is a live audio streamer + DEPENDS:=+lame-lib +librt +libpthread +libstdcpp + MAINTAINER:=Artur Wronowski +endef + +define Package/darkice/description +DarkIce is a live audio streamer. It records audio from an audio interface (e.g. sound card), encodes it and sends it to a streaming server. +endef + +CONFIGURE_ARGS += \ + --with-lame \ + --without-aacplus \ + --without-alsa \ + --without-faac \ + --without-jack \ + --without-samplerate \ + --without-twolame \ + --without-vorbis \ + --with-lame-prefix="$(STAGING_DIR)/usr" \ + +define Package/darkice/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/darkice $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/darkice.cfg $(1)/etc/ +endef + +define Package/darkice/conffiles +/etc/darkice.cfg +endef + +$(eval $(call BuildPackage,darkice)) diff --git a/multimedia/darkice/patches/001-upstream_svn_r494.patch b/multimedia/darkice/patches/001-upstream_svn_r494.patch new file mode 100644 index 0000000..3f6b3f1 --- /dev/null +++ b/multimedia/darkice/patches/001-upstream_svn_r494.patch @@ -0,0 +1,15 @@ +--- a/src/SerialUlaw.cpp ++++ b/src/SerialUlaw.cpp +@@ -40,6 +40,12 @@ + #include "config.h" + #endif + ++#ifdef HAVE_STDIO_H ++#include ++#else ++#error need stdio.h ++#endif ++ + #ifdef HAVE_UNISTD_H + #include + #else diff --git a/multimedia/ffmpeg/Config.in b/multimedia/ffmpeg/Config.in new file mode 100644 index 0000000..fcd2124 --- /dev/null +++ b/multimedia/ffmpeg/Config.in @@ -0,0 +1,314 @@ +menu "Configuration" + depends PACKAGE_libffmpeg-custom + +config FFMPEG_CUSTOM_PATENTED + bool "Include patented codecs and technologies" + default BUILD_PATENTED + +comment "Profiles ---" + +config FFMPEG_CUSTOM_FFSERVER_SUPPORT + bool "Include support for ffserver (FFmpeg streaming server)" + select FFMPEG_CUSTOM_MUXER_ffm + select FFMPEG_CUSTOM_DEMUXER_ffm + select FFMPEG_CUSTOM_DEMUXER_rtsp + select FFMPEG_CUSTOM_PROTOCOL_rtp + +config FFMPEG_CUSTOM_LIBDLNA_SUPPORT + bool "Include support for libdlna/ushare" + depends FFMPEG_CUSTOM_PATENTED + select FFMPEG_CUSTOM_DECODER_ac3 + select FFMPEG_CUSTOM_DECODER_atrac3 + select FFMPEG_CUSTOM_DECODER_h264 + select FFMPEG_CUSTOM_DECODER_jpegls + select FFMPEG_CUSTOM_DECODER_mp3 + select FFMPEG_CUSTOM_DECODER_mpeg1video + select FFMPEG_CUSTOM_DECODER_mpeg2video + select FFMPEG_CUSTOM_DECODER_mpeg4 + select FFMPEG_CUSTOM_DECODER_mpegvideo + select FFMPEG_CUSTOM_DECODER_wmav1 + select FFMPEG_CUSTOM_DECODER_wmav2 + select FFMPEG_CUSTOM_DECODER_png + select FFMPEG_CUSTOM_DEMUXER_ac3 + select FFMPEG_CUSTOM_DEMUXER_h264 + select FFMPEG_CUSTOM_DEMUXER_mp3 + select FFMPEG_CUSTOM_DEMUXER_mpegvideo + +config FFMPEG_CUSTOM_MINIDLNA_SUPPORT + bool "Include support for minidlna" + depends FFMPEG_CUSTOM_PATENTED + select FFMPEG_CUSTOM_DECODER_aac + select FFMPEG_CUSTOM_DECODER_ac3 + select FFMPEG_CUSTOM_DECODER_flac + select FFMPEG_CUSTOM_DECODER_h264 + select FFMPEG_CUSTOM_DECODER_jpegls + select FFMPEG_CUSTOM_DECODER_mp3 + select FFMPEG_CUSTOM_DECODER_mpeg1video + select FFMPEG_CUSTOM_DECODER_mpeg2video + select FFMPEG_CUSTOM_DECODER_mpeg4 + select FFMPEG_CUSTOM_DECODER_mpegvideo + select FFMPEG_CUSTOM_DECODER_wmav1 + select FFMPEG_CUSTOM_DECODER_wmav2 + select FFMPEG_CUSTOM_DECODER_png + select FFMPEG_CUSTOM_DEMUXER_aac + select FFMPEG_CUSTOM_DEMUXER_ac3 + select FFMPEG_CUSTOM_DEMUXER_avi + select FFMPEG_CUSTOM_DEMUXER_flac + select FFMPEG_CUSTOM_DEMUXER_h264 + select FFMPEG_CUSTOM_DEMUXER_matroska + select FFMPEG_CUSTOM_DEMUXER_mov + select FFMPEG_CUSTOM_DEMUXER_mp3 + select FFMPEG_CUSTOM_DEMUXER_mpegvideo + select FFMPEG_CUSTOM_PROTOCOL_file + +comment "Encoders ---" + +config FFMPEG_CUSTOM_ENCODER_ac3 + bool "AC3" + depends FFMPEG_CUSTOM_PATENTED + select FFMPEG_CUSTOM_PARSER_ac3 + +config FFMPEG_CUSTOM_ENCODER_jpegls + bool "JPEG-LS" + +config FFMPEG_CUSTOM_ENCODER_mpeg1video + bool "MPEG-1 Video" + +config FFMPEG_CUSTOM_ENCODER_mpeg2video + bool "MPEG-2 Video" + depends FFMPEG_CUSTOM_PATENTED + +config FFMPEG_CUSTOM_ENCODER_mpeg4 + bool "MPEG-4" + depends FFMPEG_CUSTOM_PATENTED + +config FFMPEG_CUSTOM_ENCODER_pcm_s16be + bool "PCM signed 16-bit big-endian" + +config FFMPEG_CUSTOM_ENCODER_pcm_s16le + bool "PCM signed 16-bit little-endian" + +config FFMPEG_CUSTOM_ENCODER_png + bool "PNG" + select FFMPEG_CUSTOM_ENCODER_zlib + +config FFMPEG_CUSTOM_ENCODER_vorbis + bool "Vorbis" + +config FFMPEG_CUSTOM_ENCODER_zlib + bool "Zlib" + +comment "Decoders ---" + +config FFMPEG_CUSTOM_DECODER_aac + bool "AAC (Advanced Audio Coding)" + depends FFMPEG_CUSTOM_PATENTED + select FFMPEG_CUSTOM_PARSER_aac + +config FFMPEG_CUSTOM_DECODER_ac3 + bool "AC3" + depends FFMPEG_CUSTOM_PATENTED + select FFMPEG_CUSTOM_PARSER_ac3 + +config FFMPEG_CUSTOM_DECODER_atrac3 + bool "ATRAC3" + depends FFMPEG_CUSTOM_PATENTED + +config FFMPEG_CUSTOM_DECODER_flac + bool "FLAC" + +config FFMPEG_CUSTOM_DECODER_gif + bool "GIF" + +config FFMPEG_CUSTOM_DECODER_h264 + bool "H.264" + depends FFMPEG_CUSTOM_PATENTED + +config FFMPEG_CUSTOM_DECODER_jpegls + bool "JPEG-LS" + +config FFMPEG_CUSTOM_DECODER_mp2 + bool "MP2 (MPEG Audio Layer 2)" + depends FFMPEG_CUSTOM_PATENTED + +config FFMPEG_CUSTOM_DECODER_mp3 + bool "MP3 (MPEG Audio Layer 2)" + depends FFMPEG_CUSTOM_PATENTED + +config FFMPEG_CUSTOM_DECODER_mpegvideo + bool "MPEG Video" + +config FFMPEG_CUSTOM_DECODER_mpeg1video + bool "MPEG-1 Video" + +config FFMPEG_CUSTOM_DECODER_mpeg2video + bool "MPEG-2 Video" + depends FFMPEG_CUSTOM_PATENTED + +config FFMPEG_CUSTOM_DECODER_mpeg4 + bool "MPEG-4" + depends FFMPEG_CUSTOM_PATENTED + +config FFMPEG_CUSTOM_DECODER_pcm_s16be + bool "PCM signed 16-bit big-endian" + +config FFMPEG_CUSTOM_DECODER_pcm_s16le + bool "PCM signed 16-bit little-endian" + +config FFMPEG_CUSTOM_DECODER_png + bool "PNG" + select FFMPEG_CUSTOM_DECODER_zlib + +config FFMPEG_CUSTOM_DECODER_vorbis + bool "Vorbis" + +config FFMPEG_CUSTOM_DECODER_wmav1 + bool "WMAv1" + depends FFMPEG_CUSTOM_PATENTED + +config FFMPEG_CUSTOM_DECODER_wmav2 + bool "WMAv2" + depends FFMPEG_CUSTOM_PATENTED + +config FFMPEG_CUSTOM_DECODER_zlib + bool "Zlib" + +comment "Muxers ---" + +config FFMPEG_CUSTOM_MUXER_ac3 + bool "AC3" + depends FFMPEG_CUSTOM_PATENTED + +config FFMPEG_CUSTOM_MUXER_ffm + bool "FFM (ffserver live feed)" + +config FFMPEG_CUSTOM_MUXER_h264 + bool "H.264" + depends FFMPEG_CUSTOM_PATENTED + +config FFMPEG_CUSTOM_MUXER_mp3 + bool "MP3 (MPEG Audio Layer 3)" + +config FFMPEG_CUSTOM_MUXER_mp4 + bool "MP4" + +config FFMPEG_CUSTOM_MUXER_mpeg1video + bool "MPEG-1 Video" + +config FFMPEG_CUSTOM_MUXER_mpeg2video + bool "MPEG-2 Video" + +config FFMPEG_CUSTOM_MUXER_mpegts + bool "MPEG-2 (TS)" + +config FFMPEG_CUSTOM_MUXER_ogg + bool "Ogg" + +config FFMPEG_CUSTOM_MUXER_rtp + bool "RTP" + +comment "Demuxers ---" + +config FFMPEG_CUSTOM_DEMUXER_aac + bool "AAC" + +config FFMPEG_CUSTOM_DEMUXER_avi + bool "AVI (Audio Video Interleave)" + +config FFMPEG_CUSTOM_DEMUXER_ac3 + bool "AC3" + +config FFMPEG_CUSTOM_DEMUXER_flac + bool "FLAC" + +config FFMPEG_CUSTOM_DEMUXER_ffm + bool "FFM (ffserver live feed)" + +config FFMPEG_CUSTOM_DEMUXER_h264 + bool "H.264" + depends FFMPEG_CUSTOM_PATENTED + +config FFMPEG_CUSTOM_DEMUXER_matroska + bool "Matroska (MKA,MKV)" + select FFMPEG_CUSTOM_DECODER_zlib + +config FFMPEG_CUSTOM_DEMUXER_mov + bool "MOV/MP4/M4A/3GP/3G2/MJ2" + select FFMPEG_CUSTOM_DECODER_zlib + +config FFMPEG_CUSTOM_DEMUXER_mp3 + bool "MP3 (MPEG Audio Layer 3)" + select FFMPEG_CUSTOM_PARSER_mpegaudio + +config FFMPEG_CUSTOM_DEMUXER_mpegvideo + bool "MPEG Video" + +config FFMPEG_CUSTOM_DEMUXER_mpegps + bool "MPEG-2 (PS)" + +config FFMPEG_CUSTOM_DEMUXER_mpegts + bool "MPEG-2 (TS)" + +config FFMPEG_CUSTOM_DEMUXER_ogg + bool "Ogg" + +config FFMPEG_CUSTOM_DEMUXER_rm + bool "RM" + help + RealMedia format demuxer + +config FFMPEG_CUSTOM_DEMUXER_rtsp + bool "RTSP" + select FFMPEG_CUSTOM_DEMUXER_rm + select FFMPEG_CUSTOM_DEMUXER_sdp + +config FFMPEG_CUSTOM_DEMUXER_sdp + bool "SDP" + select FFMPEG_CUSTOM_DEMUXER_mpegts + +comment "Parsers ---" + +config FFMPEG_CUSTOM_PARSER_aac + bool "AAC (Advanced Audio Coding)" + depends FFMPEG_CUSTOM_PATENTED + +config FFMPEG_CUSTOM_PARSER_ac3 + bool "AC3" + +config FFMPEG_CUSTOM_PARSER_h264 + bool "H.264" + depends FFMPEG_CUSTOM_PATENTED + select FFMPEG_CUSTOM_DECODER_h264 + +config FFMPEG_CUSTOM_PARSER_mpegaudio + bool "MPEG Audio" + +config FFMPEG_CUSTOM_PARSER_mpegvideo + bool "MPEG Video" + +config FFMPEG_CUSTOM_PARSER_mpeg4video + bool "MPEG-4 Video" + +comment "Protocols ---" + +config FFMPEG_CUSTOM_PROTOCOL_file + bool "file:" + +config FFMPEG_CUSTOM_PROTOCOL_http + bool "http:" + +config FFMPEG_CUSTOM_PROTOCOL_pipe + bool "pipe:" + +config FFMPEG_CUSTOM_PROTOCOL_rtp + bool "rtp:" + select FFMPEG_CUSTOM_PROTOCOL_udp + +config FFMPEG_CUSTOM_PROTOCOL_tcp + bool "tcp:" + +config FFMPEG_CUSTOM_PROTOCOL_udp + bool "udp:" + +endmenu + diff --git a/multimedia/ffmpeg/Makefile b/multimedia/ffmpeg/Makefile new file mode 100644 index 0000000..0cc5e6d --- /dev/null +++ b/multimedia/ffmpeg/Makefile @@ -0,0 +1,431 @@ +# +# Copyright (C) 2006-2012 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:=ffmpeg +PKG_VERSION:=0.8.7 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://ffmpeg.org/releases/ +PKG_MD5SUM:=31da4d5610d7138761e23fab8fe3a84d + +FFMPEG_CUSTOM_ENCODERS:= \ + ac3 \ + jpegls \ + mpeg1video \ + mpeg2video \ + mpeg4 \ + pcm_s16be \ + pcm_s16le \ + png \ + vorbis \ + zlib \ + +FFMPEG_CUSTOM_DECODERS:= \ + aac \ + ac3 \ + atrac3 \ + flac \ + gif \ + h264 \ + jpegls \ + mp2 \ + mp3 \ + mpeg1video \ + mpeg2video \ + mpeg4 \ + mpegvideo \ + pcm_s16be \ + pcm_s16le \ + png \ + vorbis \ + wmav1 \ + wmav2 \ + zlib \ + +FFMPEG_CUSTOM_MUXERS:= \ + ac3 \ + ffm \ + h264 \ + mp3 \ + mp4 \ + mpeg1video \ + mpeg2video \ + mpegts \ + ogg \ + rtp \ + +FFMPEG_CUSTOM_DEMUXERS:= \ + aac \ + ac3 \ + avi \ + flac \ + ffm \ + h264 \ + matroska \ + mov \ + mp3 \ + mpegps \ + mpegts \ + mpegvideo \ + ogg \ + rm \ + rtsp \ + sdp \ + v4l2 \ + +FFMPEG_CUSTOM_PARSERS:= \ + aac \ + ac3 \ + h264 \ + mpegaudio \ + mpeg4video \ + mpegvideo \ + +FFMPEG_CUSTOM_PROTOCOLS:= \ + file http pipe rtp tcp udp + +FFMPEG_MINI_ENCODERS:= \ + +FFMPEG_MINI_DECODERS:= \ + aac \ + ac3 \ + atrac3 \ + flac \ + h263 \ + h264 \ + jpegls \ + mp3 \ + mpeg1video \ + mpeg2video \ + mpeg4 \ + mpegvideo \ + png \ + wmav1 \ + wmav2 \ + +FFMPEG_MINI_MUXERS:= \ + ffm \ + +FFMPEG_MINI_DEMUXERS := \ + aac \ + ac3 \ + asf \ + avi \ + ffm \ + flac \ + h264 \ + matroska \ + mov \ + mp3 \ + mpegts \ + mpegvideo \ + rtsp \ + +FFMPEG_MINI_PARSERS:= \ + ac3 \ + flac \ + h263 \ + h264 \ + mpeg4video \ + mpegaudio \ + +FFMPEG_MINI_PROTOCOLS := \ + file http rtp tcp udp \ + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_CONFIG_DEPENDS:= \ + $(patsubst %,CONFIG_FFMPEG_CUSTOM_ENCODER_%,$(FFMPEG_CUSTOM_ENCODERS)) \ + $(patsubst %,CONFIG_FFMPEG_CUSTOM_DECODER_%,$(FFMPEG_CUSTOM_DECODERS)) \ + $(patsubst %,CONFIG_FFMPEG_CUSTOM_MUXER_%,$(FFMPEG_CUSTOM_DEMUXERS)) \ + $(patsubst %,CONFIG_FFMPEG_CUSTOM_DEMUXER_%,$(FFMPEG_CUSTOM_DEMUXERS)) \ + $(patsubst %,CONFIG_FFMPEG_CUSTOM_PARSER_%,$(FFMPEG_CUSTOM_PARSERS)) \ + $(patsubst %,CONFIG_FFMPEG_CUSTOM_PROTOCOL_%,$(FFMPEG_CUSTOM_PROTOCOLS)) + +include $(INCLUDE_DIR)/package.mk + +define Package/ffmpeg/Default + TITLE:=FFmpeg + URL:=http://ffmpeg.mplayerhq.hu/ +endef + +define Package/ffmpeg/Default/description + FFmpeg is a a software package that can record, convert and stream digital + audio and video in numerous formats. +endef + + +define Package/ffmpeg +$(call Package/ffmpeg/Default) + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE+= program + DEPENDS+= +libpthread +libffmpeg-full + VARIANT:=full +endef + +define Package/ffmpeg/description +$(call Package/ffmpeg/Default/description) + . + This package contains the FFmpeg command line tool. +endef + + +define Package/ffprobe +$(call Package/ffmpeg/Default) + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE+= CLI media identifier + DEPENDS+= +libffmpeg-full + VARIANT:=full +endef + +define Package/ffprobe/description +$(call Package/ffmpeg/Default/description) + . + This package contains the FFprobe command line tool. +endef + + +define Package/ffserver +$(call Package/ffserver/Default) + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE+= streaming server + DEPENDS+= +libpthread +libffmpeg-full + VARIANT:=full +endef + +define Package/ffserver/description +$(call Package/ffmpeg/Default/description) + . + This package contains the FFmpeg streaming server. +endef + + +define Package/libffmpeg/Default +$(call Package/ffmpeg/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= libraries + DEPENDS+= +libpthread +zlib +libbz2 + PROVIDES:= libffmpeg +endef + + +define Package/libffmpeg-custom +$(call Package/libffmpeg/Default) + TITLE+= (mini) + DEPENDS+= @DEVEL + VARIANT:=custom + MENU:=1 +endef + +define Package/libffmpeg-custom/config +source "$(SOURCE)/Config.in" +endef + +define Package/libffmpeg-custom/description +$(call Package/ffmpeg/Default/description) + . + This package contains customized FFmpeg shared libraries. +endef + + +define Package/libffmpeg-full +$(call Package/libffmpeg/Default) + TITLE+= (full) + DEPENDS+= @BUILD_PATENTED +alsa-lib + VARIANT:=full +endef + +define Package/libffmpeg-full/description +$(call Package/ffmpeg/Default/description) + . + This package contains full-featured FFmpeg shared libraries. +endef + + +define Package/libffmpeg-mini +$(call Package/libffmpeg/Default) + TITLE+= (mini) + DEPENDS+= @BUILD_PATENTED + VARIANT:=mini +endef + +define Package/libffmpeg-mini/description +$(call Package/ffmpeg/Default/description) + . + This package contains minimal-featured FFmpeg shared libraries. +endef + + +FFMPEG_CONFIGURE:= \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + ./configure \ + --enable-cross-compile \ + --cross-prefix="$(TARGET_CROSS)" \ + --arch="$(ARCH)" \ + --target-os=linux \ + --prefix="/usr" \ + --enable-shared \ + --enable-static \ + --disable-debug \ + --pkg-config="pkg-config" \ + \ + --enable-gpl \ + --enable-version3 \ + \ + --disable-asm \ + --disable-doc \ + --disable-dxva2 \ + --enable-pthreads \ + --disable-optimizations \ + --enable-small \ + --disable-stripping \ + --enable-zlib \ + --disable-outdevs + +ifeq ($(BUILD_VARIANT),custom) + + FFMPEG_ENABLE= \ + $(foreach c, $(2), \ + $(if $($(3)_$(c)),--enable-$(1)="$(c)") \ + ) + + FFMPEG_CONFIGURE+= \ + --disable-ffmpeg \ + --disable-ffplay \ + --disable-ffprobe \ + --disable-ffserver \ + --disable-avfilter \ + --disable-postproc \ + --disable-swscale \ + --disable-everything \ + $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \ + $(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_CUSTOM_DECODER) \ + $(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_CUSTOM_MUXER) \ + $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_CUSTOM_DEMUXER) \ + $(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_CUSTOM_PARSER) \ + $(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_CUSTOM_PROTOCOL) \ + +endif + +ifeq ($(BUILD_VARIANT),mini) + + FFMPEG_ENABLE= \ + $(foreach c, $(2), \ + --enable-$(1)="$(c)" \ + ) + + FFMPEG_CONFIGURE+= \ + --disable-ffmpeg \ + --disable-ffplay \ + --disable-ffprobe \ + --disable-ffserver \ + --disable-avfilter \ + --disable-postproc \ + --disable-swscale \ + --disable-everything \ + $(call FFMPEG_ENABLE,encoder,$(FFMPEG_MINI_ENCODERS)) \ + $(call FFMPEG_ENABLE,decoder,$(FFMPEG_MINI_DECODERS)) \ + $(call FFMPEG_ENABLE,muxer,$(FFMPEG_MINI_MUXERS)) \ + $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_MINI_DEMUXERS)) \ + $(call FFMPEG_ENABLE,parser,$(FFMPEG_MINI_PARSERS)) \ + $(call FFMPEG_ENABLE,protocol,$(FFMPEG_MINI_PROTOCOLS)) \ + +endif + +ifneq ($(CONFIG_TARGET_x86),) + TARGET_CFLAGS += -fomit-frame-pointer +endif + +define Build/Configure + ( cd $(PKG_BUILD_DIR); $(FFMPEG_CONFIGURE) ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Build/InstallDev/custom + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/ +endef + +define Build/InstallDev/full + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swscale} $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swscale}.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swscale}.pc $(1)/usr/lib/pkgconfig/ +endef + +Build/InstallDev/mini = $(Build/InstallDev/custom) + +# XXX: attempt at installing "best" dev files available +ifeq ($(BUILD_VARIANT),custom) + # XXX: only install "custom" dev files if -full & -mini are not selected + ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),) + Build/InstallDev = $(Build/InstallDev/custom) + endif +endif +ifeq ($(BUILD_VARIANT),full) + # XXX: always install "full" dev files if -full is selected + Build/InstallDev = $(Build/InstallDev/full) +endif +ifeq ($(BUILD_VARIANT),mini) + # XXX: only install "mini" dev files if -full is not selected + ifeq ($(CONFIG_PACKAGE_libffmpeg-full),) + Build/InstallDev = $(Build/InstallDev/mini) + endif +endif + +define Package/ffmpeg/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/ +endef + +define Package/ffprobe/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/ +endef + +define Package/ffserver/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/ +endef + +define Package/libffmpeg-custom/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/ +endef + +define Package/libffmpeg-full/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swscale}.so.* $(1)/usr/lib/ +endef + +Package/libffmpeg-mini/install = $(Package/libffmpeg-custom/install) + +$(eval $(call BuildPackage,ffmpeg)) +$(eval $(call BuildPackage,ffprobe)) +$(eval $(call BuildPackage,ffserver)) +$(eval $(call BuildPackage,libffmpeg-custom)) +$(eval $(call BuildPackage,libffmpeg-full)) +$(eval $(call BuildPackage,libffmpeg-mini)) diff --git a/multimedia/fswebcam/Makefile b/multimedia/fswebcam/Makefile new file mode 100644 index 0000000..98afbdc --- /dev/null +++ b/multimedia/fswebcam/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2010-2012 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:=fswebcam +PKG_VERSION:=20110717 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=http://www.sanslogic.co.uk/fswebcam/files +PKG_MD5SUM:=0b343a827771b7546cf4ede19a5ed000 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/fswebcam + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE:=fswebcam + URL:=http://www.sanslogic.co.uk/fswebcam/ + DEPENDS:=+libgd +endef + +define Package/fswebcam/description + fswebcam is a neat and simple webcam app. It captures images from a V4L1/V4L2 compatible + device or file, averages them to reduce noise and draws a caption using the GD Graphics + Library which also handles compressing the image to PNG or JPEG. The resulting image + is saved to a file or sent to stdio where it can be piped to something like ncftpput or scp. +endef + +EXTRA_CFLAGS+= $(TARGET_CPPFLAGS) +EXTRA_LDFLAGS+= $(TARGET_LDFLAGS) -Wl,-rpath-link,$(STAGING_DIR)/usr/lib + +define Package/fswebcam/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/fswebcam $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,fswebcam)) diff --git a/multimedia/ftpd-topfield/Makefile b/multimedia/ftpd-topfield/Makefile new file mode 100644 index 0000000..c271cb4 --- /dev/null +++ b/multimedia/ftpd-topfield/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2008-2011 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:=ftpd-topfield +PKG_VERSION:=0.7.4 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/puppy +PKG_MD5SUM:=4a29f04fd41aaa5890e2f202d936e270 + +include $(INCLUDE_DIR)/package.mk + +define Package/ftpd-topfield + SECTION:=multimedia + CATEGORY:=Multimedia + DEPENDS:=@USB_SUPPORT +libusb + TITLE:=Topfield PVR access via FTP + URL:=http://puppy.sourceforge.net/ +endef + +define Package/ftpd-topfield/description +FTP server to export the filesystem of a connected Topfield PVR +endef + +define Build/Configure +endef + +define Package/ftpd-topfield/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ftpd $(1)/usr/sbin/ftpd-topfield + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/ftpd-topfield.init $(1)/etc/init.d/ftpd-topfield + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/ftpd-topfield.config $(1)/etc/config/ftpd-topfield +endef + +define Package/ftpd-topfield/conffiles +/etc/config/ftpd-topfield +endef + +$(eval $(call BuildPackage,ftpd-topfield)) diff --git a/multimedia/ftpd-topfield/files/ftpd-topfield.config b/multimedia/ftpd-topfield/files/ftpd-topfield.config new file mode 100644 index 0000000..ec5ef2e --- /dev/null +++ b/multimedia/ftpd-topfield/files/ftpd-topfield.config @@ -0,0 +1,4 @@ +config 'ftpd-topfield' + option 'port' '21' + option 'turbo' 'disabled' + option 'elpf' 'disabled' diff --git a/multimedia/ftpd-topfield/files/ftpd-topfield.init b/multimedia/ftpd-topfield/files/ftpd-topfield.init new file mode 100644 index 0000000..27c4825 --- /dev/null +++ b/multimedia/ftpd-topfield/files/ftpd-topfield.init @@ -0,0 +1,35 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +START=50 + +config_cb() { + local cfg="$CONFIG_SECTION" + local cfgt + config_get cfgt "$cfg" TYPE + + case "$cfgt" in + ftpd-topfield) + config_get turbo $cfg turbo + config_get port $cfg port + config_get elpf $cfg elpf + + case "$turbo" in + yes|on|enabled|1) turbo=1;; + esac + case "$elpf" in + yes|on|enabled|1) elpf=1;; + esac + TOPFIELD_ARGS="-D ${turbo:+--turbo }${port:+-P $port }${elpf:+-E}" + ;; + esac +} + +start() { + config_load ftpd-topfield + /usr/sbin/ftpd-topfield $TOPFIELD_ARGS +} + +stop() { + killall ftpd-topfield +} diff --git a/multimedia/ftpd-topfield/patches/001-kernel_header_rename.patch b/multimedia/ftpd-topfield/patches/001-kernel_header_rename.patch new file mode 100644 index 0000000..dedfbba --- /dev/null +++ b/multimedia/ftpd-topfield/patches/001-kernel_header_rename.patch @@ -0,0 +1,14 @@ +diff -up ftpd-topfield-0.7.4/libtopfield/usb_io.h.orig ftpd-topfield-0.7.4/libtopfield/usb_io.h +--- ftpd-topfield-0.7.4/libtopfield/usb_io.h.orig 2008-11-24 10:19:56.000000000 +0100 ++++ ftpd-topfield-0.7.4/libtopfield/usb_io.h 2008-11-24 10:22:27.000000000 +0100 +@@ -35,7 +35,9 @@ + #include + + /* linux/usb_ch9.h wasn't separated out until 2.4.23 */ +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,23) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) ++#include ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,23) + #include + #else + #include diff --git a/multimedia/gmediaserver/Makefile b/multimedia/gmediaserver/Makefile new file mode 100644 index 0000000..5834a07 --- /dev/null +++ b/multimedia/gmediaserver/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (C) 2007-2011 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:=gmediaserver +PKG_VERSION:=0.13.0 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://savannah.nongnu.org/download/gmediaserver/ +PKG_MD5SUM:=c422de386331e2a1a859d45f6fa270a3 + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/gmediaserver + SECTION:=multimedia + CATEGORY:=Multimedia + DEPENDS:=+id3lib +libmagic +file +libupnp +libuuid +zlib $(ICONV_DEPENDS) + TITLE:=An UPnP music media server + URL:=http://www.nongnu.org/gmediaserver/ +endef + +define Package/gmediaserver/description + GMediaServer is a server for UPnP media players like the + Netgear MP101, Linksys WMLS11B etc. It exports one or more + directories using the UPnP protocol so the mediaserver can + browse through them and play audio or video files. +endef + +CONFIGURE_ARGS += \ + --disable-rpath \ + --enable-threads=posix \ + --with-libiconv-prefix="$(ICONV_PREFIX)" \ + --without-libintl-prefix \ + --with-id3lib="$(STAGING_DIR)/usr" \ + --with-libupnp="$(STAGING_DIR)/usr" \ + , \ + LIBS="-lz" \ + +MAKE_FLAGS += \ + AR="$(TARGET_CROSS)ar" \ + LTLIBICONV="" \ + DESTDIR="$(PKG_INSTALL_DIR)" + +define Package/gmediaserver/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) +endef + +define Package/gmediaserver/conffiles +/etc/config/gmediaserver +endef + +$(eval $(call BuildPackage,gmediaserver)) diff --git a/multimedia/gmediaserver/files/gmediaserver.config b/multimedia/gmediaserver/files/gmediaserver.config new file mode 100644 index 0000000..ba1fc9f --- /dev/null +++ b/multimedia/gmediaserver/files/gmediaserver.config @@ -0,0 +1,3 @@ +config gmediaserver + option content_directory '/tmp' + option interface 'br-lan' diff --git a/multimedia/gmediaserver/files/gmediaserver.init b/multimedia/gmediaserver/files/gmediaserver.init new file mode 100644 index 0000000..4fc6067 --- /dev/null +++ b/multimedia/gmediaserver/files/gmediaserver.init @@ -0,0 +1,27 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 + +BIN=gmediaserver +DEFAULT=/etc/default/$BIN +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid + +start() { + mkdir -p $RUN_D + config_load gmediaserver + config_foreach start_service gmediaserver +} + +start_service() { + local cfg="$1" + config_get content_directory "$cfg" content_directory + config_get interface "$cfg" interface + + $BIN --background --interface=${interface:-br-lan} --pid-file=$PID_F ${content_directory:-/tmp} +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) +} + diff --git a/multimedia/gmediaserver/patches/010-compile-fixes.patch b/multimedia/gmediaserver/patches/010-compile-fixes.patch new file mode 100644 index 0000000..3a11500 --- /dev/null +++ b/multimedia/gmediaserver/patches/010-compile-fixes.patch @@ -0,0 +1,144 @@ +--- a/src/upnp.c ++++ b/src/upnp.c +@@ -36,6 +36,7 @@ + #include + #include "intutil.h" + #include "gmediaserver.h" ++#include "webserver.h" + #include "schemas/MediaServer.h" + + #define GMEDIASERVER_SSDP_PAUSE 100 +@@ -265,7 +266,7 @@ handle_get_var_request(struct Upnp_State + say(3, _("Event device UDN: %s\n"), quotearg(request->DevUDN)); + say(3, _("Event service ID: %s\n"), quotearg(request->ServiceID)); + say(3, _("Event variable name: %s\n"), quotearg(request->StateVarName)); +- say(3, _("Event source: %s\n"), inet_ntoa(request->CtrlPtIPAddr)); ++ say(3, _("Event source: %s\n"), inet_ntoa((*(struct sockaddr_in *)&request->CtrlPtIPAddr).sin_addr)); + + if (strcmp(request->DevUDN, device_udn) != 0) { + say(1, _("Discarding event - event device UDN (%s) not recognized\n"), quotearg(request->DevUDN)); +@@ -306,7 +307,7 @@ handle_action_request(struct Upnp_Action + say(3, _("Event device UDN: %s\n"), quotearg(request->DevUDN)); + say(3, _("Event service ID: %s\n"), quotearg(request->ServiceID)); + say(3, _("Event action name: %s\n"), quotearg(request->ActionName)); +- say(3, _("Event source: %s\n"), inet_ntoa(request->CtrlPtIPAddr)); ++ say(3, _("Event source: %s\n"), inet_ntoa((*(struct sockaddr_in *)&request->CtrlPtIPAddr).sin_addr)); + say_document(4, _("Event action request:\n"), request->ActionRequest); + + if (strcmp(request->DevUDN, device_udn) != 0) { +@@ -502,9 +503,24 @@ init_upnp(const char *listenip, uint16_t + res = UpnpEnableWebserver(TRUE); + if (res != UPNP_E_SUCCESS) + die(_("cannot enable UPnP web server - %s\n"), upnp_errmsg(res)); +- res = UpnpSetVirtualDirCallbacks(&virtual_dir_callbacks); +- if (res != UPNP_E_SUCCESS) +- die(_("cannot set virtual directory callbacks - %s\n"), upnp_errmsg(res)); ++ ++#define upnp_set_callback(cb, func) \ ++ do { \ ++ res = UpnpVirtualDir_set_##cb##Callback(func); \ ++ if (res != UPNP_E_SUCCESS) \ ++ { \ ++ die(_("cannot set virtual directory callbacks - %s\n"), \ ++ upnp_errmsg(res)); \ ++ } \ ++ } while(0) ++ ++ upnp_set_callback(GetInfo, webserver_get_info); ++ upnp_set_callback(Open, webserver_open); ++ upnp_set_callback(Read, webserver_read); ++ upnp_set_callback(Seek, webserver_seek); ++ upnp_set_callback(Write, webserver_write); ++ upnp_set_callback(Close, webserver_close); ++ + res = UpnpAddVirtualDir("/files"); + if (res != UPNP_E_SUCCESS) + die(_("cannot add virtual directory for web server - %s\n"), upnp_errmsg(res)); +--- a/src/webserver.c ++++ b/src/webserver.c +@@ -83,7 +83,7 @@ get_entry_from_url(const char *filename) + return get_entry_by_id(id); + } + +-static int ++int + webserver_get_info(const char *filename, struct File_Info *info) + { + Entry *entry; +@@ -180,7 +180,7 @@ webserver_get_info(const char *filename, + return -1; + } + +-static UpnpWebFileHandle ++UpnpWebFileHandle + webserver_open(const char *filename, enum UpnpOpenFileMode mode) + { + Entry *entry; +@@ -277,7 +277,7 @@ webserver_open(const char *filename, enu + return NULL; + } + +-static int ++int + webserver_read(UpnpWebFileHandle fh, char *buf, size_t buflen) + { + WebServerFile *file = (WebServerFile *) fh; +@@ -307,7 +307,7 @@ webserver_read(UpnpWebFileHandle fh, cha + return len; + } + +-static int ++int + webserver_write(UpnpWebFileHandle fh, char *buf, size_t buflen) + { + WebServerFile *file = (WebServerFile *) fh; +@@ -317,7 +317,7 @@ webserver_write(UpnpWebFileHandle fh, ch + return -1; + } + +-static int ++int + webserver_seek(UpnpWebFileHandle fh, off_t offset, int origin) + { + WebServerFile *file = (WebServerFile *) fh; +@@ -396,7 +396,7 @@ webserver_seek(UpnpWebFileHandle fh, off + return 0; + } + +-static int ++int + webserver_close(UpnpWebFileHandle fh) + { + WebServerFile *file = (WebServerFile *) fh; +@@ -419,12 +419,3 @@ webserver_close(UpnpWebFileHandle fh) + + return 0; + } +- +-struct UpnpVirtualDirCallbacks virtual_dir_callbacks = { +- webserver_get_info, +- webserver_open, +- webserver_read, +- webserver_write, +- webserver_seek, +- webserver_close +-}; +--- /dev/null ++++ b/src/webserver.h +@@ -0,0 +1,6 @@ ++int webserver_get_info(const char *filename, struct File_Info *info); ++UpnpWebFileHandle webserver_open(const char *filename, enum UpnpOpenFileMode mode); ++int webserver_read(UpnpWebFileHandle fh, char *buf, size_t buflen); ++int webserver_write(UpnpWebFileHandle fh, char *buf, size_t buflen); ++int webserver_seek(UpnpWebFileHandle fh, off_t offset, int origin); ++int webserver_close(UpnpWebFileHandle fh); +--- a/src/contentdir.c ++++ b/src/contentdir.c +@@ -22,6 +22,7 @@ + #include /* Gnulib/C99 */ + #include /* ? */ + #include /* POSIX */ ++#include + #include "gettext.h" /* Gnulib/gettext */ + #define _(s) gettext(s) + #define N_(s) gettext_noop(s) diff --git a/multimedia/gphoto2/Makefile b/multimedia/gphoto2/Makefile new file mode 100644 index 0000000..d1a0545 --- /dev/null +++ b/multimedia/gphoto2/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2006-2012 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:=gphoto2 +PKG_VERSION:=2.4.11 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/gphoto +PKG_MD5SUM:=2635075f702b40eb2e95a80658bd4773 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/gphoto2 + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE:=Gphoto Digital Camera Control + URL:=http://www.gphoto.org/ + DEPENDS:=+libgphoto2 +libpopt +libpthread +libreadline +libncurses +endef + +define Package/gphoto2/description + For downloading and controlling digital cameras +endef + +CONFIGURE_ARGS += \ + --without-aalib \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + +CONFIGURE_VARS += \ + LIBGPHOTO2_CFLAGS="$$$$CFLAGS -I$(STAGING_DIR)/usr/include/gphoto2 $$$$CPPFLAGS" \ + LIBGPHOTO2_LIBS="$$$$LDFLAGS -lgphoto2 -lgphoto2_port -lltdl" \ + LIBEXIF_CFLAGS="$$$$CFLAGS $$$$CPPFLAGS" \ + LIBEXIF_LIBS="$$$$LDFLAGS -lexif" \ + POPT_CFLAGS="$$$$CFLAGS $$$$CPPFLAGS" \ + POPT_LIBS="$$$$LDFLAGS -lpopt" \ + +define Package/gphoto2/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,gphoto2)) diff --git a/multimedia/gphoto2/patches/001-automake-compat.patch b/multimedia/gphoto2/patches/001-automake-compat.patch new file mode 100644 index 0000000..89cad74 --- /dev/null +++ b/multimedia/gphoto2/patches/001-automake-compat.patch @@ -0,0 +1,10 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -66,7 +66,6 @@ GP_GETTEXT_HACK([],[Lutz Müller and oth + ALL_LINGUAS="az cs da de en_GB es eu fi fr hu id it ja nl pa pl pt_BR ro ru rw sk sr sv uk vi zh_CN zh_TW" + AM_GNU_GETTEXT_VERSION([0.14.1]) + AM_GNU_GETTEXT([external]) +-AM_PO_SUBDIRS() + AM_ICONV() + GP_GETTEXT_FLAGS() + diff --git a/multimedia/gphoto2/patches/002-disable-docs-translations.patch b/multimedia/gphoto2/patches/002-disable-docs-translations.patch new file mode 100644 index 0000000..1def16a --- /dev/null +++ b/multimedia/gphoto2/patches/002-disable-docs-translations.patch @@ -0,0 +1,45 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -62,12 +62,7 @@ GP_REFERENCES()dnl + dnl --------------------------------------------------------------------------- + dnl i18n support + dnl --------------------------------------------------------------------------- +-GP_GETTEXT_HACK([],[Lutz Müller and others],[${MAIL_GPHOTO_TRANSLATION}]) +-ALL_LINGUAS="az cs da de en_GB es eu fi fr hu id it ja nl pa pl pt_BR ro ru rw sk sr sv uk vi zh_CN zh_TW" +-AM_GNU_GETTEXT_VERSION([0.14.1]) +-AM_GNU_GETTEXT([external]) + AM_ICONV() +-GP_GETTEXT_FLAGS() + + dnl We cannot use AC_DEFINE_UNQUOTED() for these definitions, as + dnl we require make to do insert the proper $(datadir) value +@@ -352,11 +347,9 @@ AC_SUBST([AM_LDFLAGS]) + # Create output files + # --------------------------------------------------------------------------- + AC_CONFIG_FILES([ +-po/Makefile.in + Makefile + gphoto2/Makefile + m4m/Makefile +-doc/Makefile + contrib/Makefile + packaging/Makefile + packaging/rpm/Makefile +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,3 +1,3 @@ +-SUBDIRS = m4m contrib doc gphoto2 packaging po ++SUBDIRS = m4m contrib gphoto2 packaging + + ACLOCAL_AMFLAGS = -I auto-m4 -I m4m +--- a/Makefile.in ++++ b/Makefile.in +@@ -278,7 +278,7 @@ target_alias = @target_alias@ + top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ +-SUBDIRS = m4m contrib doc gphoto2 packaging po ++SUBDIRS = m4m contrib gphoto2 packaging + ACLOCAL_AMFLAGS = -I auto-m4 -I m4m + all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive diff --git a/multimedia/gphoto2/patches/100-gpdebug.patch b/multimedia/gphoto2/patches/100-gpdebug.patch new file mode 100644 index 0000000..177fc09 --- /dev/null +++ b/multimedia/gphoto2/patches/100-gpdebug.patch @@ -0,0 +1,11 @@ +--- a/gphoto2/foreach.c ++++ b/gphoto2/foreach.c +@@ -31,6 +31,8 @@ + + #include + ++#define GP_DEBUG (void) ++ + #define GP_ERROR_FRONTEND_BAD_ID -10000 + #define CR(result) {int __r=(result); if(__r<0) return(__r);} + #define CL(result,list) {int __r=(result); if(__r<0) {gp_list_free(list);return(__r);}} diff --git a/multimedia/graphicsmagick/Makefile b/multimedia/graphicsmagick/Makefile new file mode 100644 index 0000000..eccd58a --- /dev/null +++ b/multimedia/graphicsmagick/Makefile @@ -0,0 +1,98 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=GraphicsMagick +PKG_VERSION:=1.3.8 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/graphicsmagick +PKG_MD5SUM:=c0428886ea07736b0f1872d256ab7ebd + +include $(INCLUDE_DIR)/package.mk + +export PATH:=$(PKG_BUILD_DIR)/bin:$(TARGET_PATH) + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +define Package/GraphicsMagick/Default + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE:=GraphicsMagick + URL:=http://www.graphicsmagick.org/ + DEPENDS:=+libbz2 +libfreetype +libltdl +libpthread +libstdcpp +zlib +endef + +define Package/GraphicsMagick + $(call Package/GraphicsMagick/Default) +endef + +define Package/GraphicsMagick/description + An image manipulation library. +endef + +define Package/GraphicsMagick-jpeg + $(call Package/GraphicsMagick/Default) + TITLE+= (jpeg) + DEPENDS:=+GraphicsMagick +libjpeg +zlib +endef + +define Package/GraphicsMagick-jpeg/description + GraphicsMagick JPEG module +endef + +CONFIGURE_ARGS += \ + --with-modules \ + --enable-shared \ + --enable-static \ + --without-xml \ + --without-x \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/GraphicsMagick/magick + $(INSTALL_DIR) $(1)/usr/include/GraphicsMagick/wand + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/* \ + $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.so* \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/ + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/GraphicsMagick/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.so* \ + $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/share/GraphicsMagick-$(PKG_VERSION) + $(CP) \ + $(PKG_INSTALL_DIR)/usr/share/GraphicsMagick-$(PKG_VERSION)/* \ + $(1)/usr/share/GraphicsMagick-$(PKG_VERSION) +endef + +define BuildPlugin + define Package/GraphicsMagick-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/GraphicsMagick-$(PKG_VERSION)/modules-Q8/coders + $(CP) $(PKG_INSTALL_DIR)/usr/lib/GraphicsMagick-$(PKG_VERSION)/modules-Q8/coders/$(1).{so,la} \ + $$(1)/usr/lib/GraphicsMagick-$(PKG_VERSION)/modules-Q8/coders + endef + + $$(eval $$(call BuildPackage,GraphicsMagick-$(1))) +endef + +$(eval $(call BuildPackage,GraphicsMagick)) +$(eval $(call BuildPlugin,jpeg)) diff --git a/multimedia/gst-ffmpeg/Config.in b/multimedia/gst-ffmpeg/Config.in new file mode 100644 index 0000000..9f579c7 --- /dev/null +++ b/multimedia/gst-ffmpeg/Config.in @@ -0,0 +1,269 @@ +menu "Configuration" + depends PACKAGE_gst-ffmpeg + +config GST_FFMPEG_IPV6 + bool "Enable IPv6" + default IPV6 + +config GST_FFMPEG_PATENTED + bool "Include patented codecs and technologies" + default BUILD_PATENTED + +config GET_FFMPEG_LIBDLNA_SUPPORT + bool "Include support for libdlna/ushare" + depends GST_FFMPEG_PATENTED + select GST_FFMPEG_DECODER_ac3 + select GST_FFMPEG_DECODER_atrac3 + select GST_FFMPEG_DECODER_h264 + select GST_FFMPEG_DECODER_jpegls + select GST_FFMPEG_DECODER_mp3 + select GST_FFMPEG_DECODER_mpeg1video + select GST_FFMPEG_DECODER_mpeg2video + select GST_FFMPEG_DECODER_mpeg4 + select GST_FFMPEG_DECODER_mpeg4aac + select GST_FFMPEG_DECODER_mpegvideo + select GST_FFMPEG_DECODER_wmav1 + select GST_FFMPEG_DECODER_wmav2 + select GST_FFMPEG_DECODER_png + select GST_FFMPEG_DEMUXER_ac3 + select GST_FFMPEG_DEMUXER_h264 + select GST_FFMPEG_DEMUXER_mp3 + select GST_FFMPEG_DEMUXER_mpegvideo + +comment "Encoders ---" + +config GST_FFMPEG_ENCODER_ac3 + bool "AC3" + depends GST_FFMPEG_PATENTED + select GST_FFMPEG_PARSER_ac3 + +config GST_FFMPEG_ENCODER_jpegls + bool "JPEG-LS" + +config GST_FFMPEG_ENCODER_mpeg1video + bool "MPEG-1 Video" + +config GST_FFMPEG_ENCODER_mpeg2video + bool "MPEG-2 Video" + depends GST_FFMPEG_PATENTED + +config GST_FFMPEG_ENCODER_mpeg4 + bool "MPEG-4" + depends GST_FFMPEG_PATENTED + +config GST_FFMPEG_ENCODER_pcm_s16be + bool "PCM signed 16-bit big-endian" + +config GST_FFMPEG_ENCODER_pcm_s16le + bool "PCM signed 16-bit little-endian" + +config GST_FFMPEG_ENCODER_png + bool "PNG" + select GST_FFMPEG_ENCODER_zlib + +config GST_FFMPEG_ENCODER_vorbis + bool "Vorbis" + +config GST_FFMPEG_ENCODER_zlib + bool "Zlib" + +comment "Decoders ---" + +config GST_FFMPEG_DECODER_aac + bool "AAC (Advanced Audio Coding)" + depends GST_FFMPEG_PATENTED + select GST_FFMPEG_PARSER_aac + +config GST_FFMPEG_DECODER_ac3 + bool "AC3" + depends GST_FFMPEG_PATENTED + select GST_FFMPEG_PARSER_ac3 + +config GST_FFMPEG_DECODER_atrac3 + bool "ATRAC3" + depends GST_FFMPEG_PATENTED + +config GST_FFMPEG_DECODER_gif + bool "GIF" + +config GST_FFMPEG_DECODER_h264 + bool "H.264" + depends GST_FFMPEG_PATENTED + +config GST_FFMPEG_DECODER_jpegls + bool "JPEG-LS" + +config GST_FFMPEG_DECODER_mp2 + bool "MP2 (MPEG Audio Layer 2)" + depends GST_FFMPEG_PATENTED + +config GST_FFMPEG_DECODER_mp3 + bool "MP3 (MPEG Audio Layer 2)" + depends GST_FFMPEG_PATENTED + +config GST_FFMPEG_DECODER_mpegvideo + bool "MPEG Video" + +config GST_FFMPEG_DECODER_mpeg1video + bool "MPEG-1 Video" + +config GST_FFMPEG_DECODER_mpeg2video + bool "MPEG-2 Video" + depends GST_FFMPEG_PATENTED + +config GST_FFMPEG_DECODER_mpeg4 + bool "MPEG-4" + depends GST_FFMPEG_PATENTED + +config GST_FFMPEG_DECODER_mpeg4aac + bool "MPEG-4 (AAC)" + depends GST_FFMPEG_PATENTED + +config GST_FFMPEG_DECODER_pcm_s16be + bool "PCM signed 16-bit big-endian" + +config GST_FFMPEG_DECODER_pcm_s16le + bool "PCM signed 16-bit little-endian" + +config GST_FFMPEG_DECODER_png + bool "PNG" + select GST_FFMPEG_DECODER_zlib + +config GST_FFMPEG_DECODER_vorbis + bool "Vorbis" + +config GST_FFMPEG_DECODER_wmav1 + bool "WMAv1" + depends GST_FFMPEG_PATENTED + +config GST_FFMPEG_DECODER_wmav2 + bool "WMAv2" + depends GST_FFMPEG_PATENTED + +config GST_FFMPEG_DECODER_zlib + bool "Zlib" + +comment "Muxers ---" + +config GST_FFMPEG_MUXER_ac3 + bool "AC3" + depends GST_FFMPEG_PATENTED + +config GST_FFMPEG_MUXER_ffm + bool "FFM (ffserver live feed)" + +config GST_FFMPEG_MUXER_h264 + bool "H.264" + depends GST_FFMPEG_PATENTED + +config GST_FFMPEG_MUXER_mp3 + bool "MP3 (MPEG Audio Layer 3)" + +config GST_FFMPEG_MUXER_mp4 + bool "MP4" + +config GST_FFMPEG_MUXER_mpeg1video + bool "MPEG-1 Video" + +config GST_FFMPEG_MUXER_mpeg2video + bool "MPEG-2 Video" + +config GST_FFMPEG_MUXER_mpegts + bool "MPEG-2 (TS)" + +config GST_FFMPEG_MUXER_ogg + bool "Ogg" + +config GST_FFMPEG_MUXER_oss + bool "OSS (Open Sound System playback)" + +config GST_FFMPEG_MUXER_rtp + bool "RTP" + +comment "Demuxers ---" + +config GST_FFMPEG_DEMUXER_ac3 + bool "AC3" + +config GST_FFMPEG_DEMUXER_ffm + bool "FFM (ffserver live feed)" + +config GST_FFMPEG_DEMUXER_h264 + bool "H.264" + depends FFMPEG_PATENTED + +config GST_FFMPEG_DEMUXER_mp3 + bool "MP3 (MPEG Audio Layer 3)" + +config GST_FFMPEG_DEMUXER_mpegvideo + bool "MPEG Video" + +config GST_FFMPEG_DEMUXER_mpegps + bool "MPEG-2 (PS)" + +config GST_FFMPEG_DEMUXER_mpegts + bool "MPEG-2 (TS)" + +config GST_FFMPEG_DEMUXER_ogg + bool "Ogg" + +config GST_FFMPEG_DEMUXER_rm + bool "RM" + help + RealMedia format demuxer + +config GST_FFMPEG_DEMUXER_rtsp + bool "RTSP" + select GST_FFMPEG_DEMUXER_rm + select GST_FFMPEG_DEMUXER_sdp + +config GST_FFMPEG_DEMUXER_sdp + bool "SDP" + select GST_FFMPEG_DEMUXER_mpegts + +comment "Parsers ---" + +config GST_FFMPEG_PARSER_aac + bool "AAC (Advanced Audio Coding)" + depends GST_FFMPEG_PATENTED + +config GST_FFMPEG_PARSER_ac3 + bool "AC3" + +config GST_FFMPEG_PARSER_h264 + bool "H.264" + depends GST_FFMPEG_PATENTED + select GST_FFMPEG_DECODER_h264 + +config GST_FFMPEG_PARSER_mpegaudio + bool "MPEG Audio" + +config GST_FFMPEG_PARSER_mpegvideo + bool "MPEG Video" + +config GST_FFMPEG_PARSER_mpeg4video + bool "MPEG-4 Video" + +comment "Protocols ---" + +config GST_FFMPEG_PROTOCOL_file + bool "file:" + +config GST_FFMPEG_PROTOCOL_http + bool "http:" + +config GST_FFMPEG_PROTOCOL_pipe + bool "pipe:" + +config GST_FFMPEG_PROTOCOL_rtp + bool "rtp:" + select GST_FFMPEG_PROTOCOL_udp + +config GST_FFMPEG_PROTOCOL_tcp + bool "tcp:" + +config GST_FFMPEG_PROTOCOL_udp + bool "udp:" + +endmenu + diff --git a/multimedia/gst-ffmpeg/Makefile b/multimedia/gst-ffmpeg/Makefile new file mode 100644 index 0000000..24aea0c --- /dev/null +++ b/multimedia/gst-ffmpeg/Makefile @@ -0,0 +1,170 @@ +# +# Copyright (C) 2006-2011 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:=gst-ffmpeg +PKG_RELEASE:=1 +PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-ffmpeg +PKG_VERSION:=0.10.11 +PKG_MD5SUM:=0d23197ba7ac06ea34fa66d38469ebe5 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +FFMPEG_ENCODERS:= \ + ac3 \ + jpegls \ + mpeg1video \ + mpeg2video \ + mpeg4 \ + pcm_s16be \ + pcm_s16le \ + png \ + vorbis \ + zlib \ + +FFMPEG_DECODERS:= \ + aac \ + ac3 \ + atrac3 \ + gif \ + h264 \ + jpegls \ + mp2 \ + mp3 \ + mpeg1video \ + mpeg2video \ + mpeg4 \ + mpeg4aac \ + mpegvideo \ + pcm_s16be \ + pcm_s16le \ + png \ + vorbis \ + wmav1 \ + wmav2 \ + zlib \ + +FFMPEG_MUXERS:= \ + ac3 \ + ffm \ + h264 \ + mp3 \ + mp4 \ + mpeg1video \ + mpeg2video \ + mpegts \ + ogg \ + oss \ + rtp \ + +FFMPEG_DEMUXERS:= \ + ac3 \ + ffm \ + h264 \ + mp3 \ + mpegps \ + mpegts \ + mpegvideo \ + ogg \ + rm \ + rtsp \ + sdp \ + v4l2 \ + +FFMPEG_PARSERS:= \ + aac \ + ac3 \ + h264 \ + mpegaudio \ + mpegvideo \ + mpeg4video \ + +FFMPEG_PROTOCOLS:= \ + file http pipe rtp tcp udp + +PKG_CONFIG_DEPENDS:= \ + $(patsubst %,CONFIG_GST_FFMPEG_ENCODER_%,$(FFMPEG_ENCODERS)) \ + $(patsubst %,CONFIG_GST_FFMPEG_DECODER_%,$(FFMPEG_DECODERS)) \ + $(patsubst %,CONFIG_GST_FFMPEG_MUXER_%,$(FFMPEG_DEMUXERS)) \ + $(patsubst %,CONFIG_GST_FFMPEG_DEMUXER_%,$(FFMPEG_DEMUXERS)) \ + $(patsubst %,CONFIG_GST_FFMPEG_PARSER_%,$(FFMPEG_PARSERS)) \ + $(patsubst %,CONFIG_GST_FFMPEG_PROTOCOL_%,$(FFMPEG_PROTOCOLS)) + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/gst-ffmpeg + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE:=GStreamer ffmpeg bindings + URL:=http://www.gstreamer.net/modules/gst-ffmpeg.html + MAINTAINER:=Okkel Klaver + DEPENDS:= +libgstreamer +gst-mod-alsa +libbz2 +libgstaudio +endef + +define Package/gst-ffmpeg/description + GStreamer ffmpeg bindings +endef + +define Package/gst-ffmpeg/config +source "$(SOURCE)/Config.in" +endef + +FILTER_CONFIG= \ + $(foreach c, $(3), \ + $(if $(CONFIG_GST_FFMPEG_$(1)_$(c)),--enable-$(2)='$(c)') \ + ) + +FFMPEG_CONFIGURE_ENCODERS:=$(call FILTER_CONFIG,ENCODER,encoder,$(FFMPEG_ENCODERS)) +FFMPEG_CONFIGURE_DECODERS:=$(call FILTER_CONFIG,DECODER,decoder,$(FFMPEG_DECODERS)) +FFMPEG_CONFIGURE_MUXERS:=$(call FILTER_CONFIG,MUXER,muxer,$(FFMPEG_MUXERS)) +FFMPEG_CONFIGURE_DEMUXERS:=$(call FILTER_CONFIG,DEMUXER,demuxer,$(FFMPEG_DEMUXERS)) +FFMPEG_CONFIGURE_PARSERS:=$(call FILTER_CONFIG,PARSER,parser,$(FFMPEG_PARSERS)) +FFMPEG_CONFIGURE_PROTOCOLS:=$(call FILTER_CONFIG,PROTOCOL,protocol,$(FFMPEG_PROTOCOLS)) + +GST_VERSION:=0.10 + +CONFIGURE_ARGS += \ + --with-ffmpeg-extra-configure="--target-os=linux \ + --disable-bsfs \ + --disable-devices \ + --disable-encoders \ + $(FFMPEG_CONFIGURE_ENCODERS) \ + --disable-decoders \ + $(FFMPEG_CONFIGURE_DECODERS) \ + --disable-muxers \ + $(FFMPEG_CONFIGURE_MUXERS) \ + --disable-demuxers \ + $(FFMPEG_CONFIGURE_DEMUXERS) \ + --disable-parsers \ + $(FFMPEG_CONFIGURE_PARSERS) \ + --disable-protocols \ + $(FFMPEG_CONFIGURE_PROTOCOLS)" + +# XXX: trick to force use of embedded FFmpeg headers +TARGET_CFLAGS += $(TARGET_CPPFLAGS) +TARGET_CPPFLAGS := + +TARGET_LDFLAGS += $(FPIC) + +define Build/Prepare +$(call Build/Prepare/Default) +endef + +define Package/gst-ffmpeg/install + $(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION) + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/gstreamer-$(GST_VERSION)/libgstffmpeg.so* \ + $(1)/usr/lib/gstreamer-$(GST_VERSION)/ \ + ) +endef + +$(eval $(call BuildPackage,gst-ffmpeg)) diff --git a/multimedia/gst-plugins-bad/Makefile b/multimedia/gst-plugins-bad/Makefile new file mode 100644 index 0000000..5c1b5df --- /dev/null +++ b/multimedia/gst-plugins-bad/Makefile @@ -0,0 +1,252 @@ +# +# Copyright (C) 2011 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:=gst-plugins-bad +PKG_VERSION:=0.10.19 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-bad/ +PKG_MD5SUM:=368f72e2a1c7a6e8fe60394e4315259b + +PKG_BUILD_DEPENDS:= gstreamer gst-plugins-base liboil + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/gstreamer/Default + CATEGORY:=Multimedia + SECTION:=multimedia + TITLE:=GStreamer + URL:=http://gstreamer.freedesktop.org/ +endef + +define Package/gstreamer/description/Default + GStreamer open source multimedia framework +endef + + +define Package/gst-plugins-bad +$(call Package/gstreamer/Default) + TITLE+= plugins collection (bad) + DEPENDS+= $(GST_DEPENDS) +endef + +define Package/gts-plugins-bad/description +$(call Package/gstreamer/description/Default) + . + This meta package contains only dependencies to the other plugins from + the bad plugins collection. +endef + + +GST_VERSION:=0.10 + +CONFIGURE_ARGS += \ + --disable-debug \ + --disable-examples \ + --disable-nls \ + \ + --disable-directsound \ + --disable-directdraw \ + --disable-osx_video \ + --disable-quicktime \ + --disable-vcd \ + --disable-alsa \ + --disable-assrender \ + --disable-amrwb \ + --disable-apexsink \ + --disable-bz2 \ + --disable-cdaudio \ + --disable-celt \ + --disable-cog \ + --disable-dc1394 \ + --disable-directfb \ + --disable-dirac \ + --disable-dts \ + --disable-divx \ + --disable-resindvd \ + --disable-metadata \ + --disable-faac \ + --disable-faad \ + --disable-fbdev \ + --disable-flite \ + --disable-gsm \ + --disable-jack \ + --disable-jp2k \ + --disable-kate \ + --disable-ladspa \ + --disable-lv2 \ + --disable-modplug \ + --disable-mimic \ + --disable-mpeg2enc \ + --disable-mplex \ + --disable-musepack \ + --disable-musicbrainz \ + --disable-mythtv \ + --disable-nas \ + --disable-neon \ + --disable-ofa \ + --disable-rsvg \ + --disable-timidity \ + --disable-wildmidi \ + --disable-sdl \ + --disable-sdltest \ + --disable-sndfile \ + --disable-soundtouch \ + --disable-spc \ + --disable-gme \ + --disable-swfdec \ + --disable-theoradec \ + --disable-xvid \ + --disable-dvb \ + --disable-wininet \ + --disable-acm \ + --disable-vdpau \ + --disable-schro \ + --disable-zbar \ + --disable-vp8 \ + --disable-librfb \ + \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + --without-x \ + +EXTRA_LDFLAGS+= \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \ + + +define Package/gst-plugins-ugly/install + /bin/true +endef + +# 1: short name +# 2: description +# 3: dependencies on other gstreamer libraries (short name) +# 4: dependencies on other packages +define GstBuildLibrary + + GST_DEPENDS += +libgst$(1) + + define Package/libgst$(1) + $(call Package/gstreamer/Default) + TITLE+= $(2) library (base) + DEPENDS+= +libgstreamer $$(foreach p,$(3),+libgst$$(p)) $(4) + endef + + define Package/libgst$(1)/description + $(call Package/gstreamer/description/Default) + . + This package contains the GStreamer $(2) library. + endef + + define Package/libgst$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/libgst$(1)-$(GST_VERSION).so.* \ + $$(1)/usr/lib/ \ + ) + endef + + $$(eval $$(call BuildPackage,libgst$(1))) +endef +$(eval $(call GstBuildLibrary,photography,photography,,)) + + +# 1: short name +# 2: description +# 3: dependencies on other gstreamer libraries (short name) +# 4: dependencies on other gstreamer plugins (short name) +# 5: dependencies on other packages +define GstBuildPlugin + + GST_DEPENDS += +gst-mod-$(1) + + define Package/gst-mod-$(1) + $(call Package/gstreamer/Default) + TITLE+= $(2) plugin (bad) + DEPENDS+= +libgstreamer $$(foreach p,$(3),+libgst$$(p)) $$(foreach p,$(4),+gst-mod-$$(p)) $(5) + endef + + define Package/gst-mod-$(1)/description + $(call Package/gstreamer/description/Default) + . + This package contains the GStreamer $(2) plugin. + endef + + define Package/gst-mod-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/gstreamer-$(GST_VERSION) + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/gstreamer-$(GST_VERSION)/libgst$(1).so* \ + $$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \ + ) + endef + + $$(eval $$(call BuildPackage,gst-mod-$(1))) +endef + +$(eval $(call GstBuildPlugin,adpcmdec,adpcm decoding support,,,)) +$(eval $(call GstBuildPlugin,adpcmenc,adpcm encoding support,,,)) +$(eval $(call GstBuildPlugin,aiff,aiff support,,,)) +$(eval $(call GstBuildPlugin,asfmux,asf muxing support,rtp,,)) +$(eval $(call GstBuildPlugin,audioparsersbad,audioparsers support,audio tag,,)) +$(eval $(call GstBuildPlugin,autoconvert,autoconvert support,,,)) +$(eval $(call GstBuildPlugin,camerabin,camerabin support,interfaces photography,,)) +$(eval $(call GstBuildPlugin,legacyresample,legacyresample support,,,+liboil +librt)) +$(eval $(call GstBuildPlugin,bayer,bayer support,video,,)) +$(eval $(call GstBuildPlugin,cdxaparse,cdxaparse support,riff,,)) +$(eval $(call GstBuildPlugin,dataurisrc,dataurisrc support,,,)) +$(eval $(call GstBuildPlugin,dccp,dccp support,,,)) +$(eval $(call GstBuildPlugin,debugutilsbad,debugutils support,interfaces,,)) +$(eval $(call GstBuildPlugin,dtmf,dtmf support,rtp,,)) +$(eval $(call GstBuildPlugin,dvdspu,dvdspu support,video,,)) +$(eval $(call GstBuildPlugin,festival,festival support,audio,,)) +$(eval $(call GstBuildPlugin,freeze,freeze support,,,)) +$(eval $(call GstBuildPlugin,frei0r,frei0r support,controller video,,)) +$(eval $(call GstBuildPlugin,h264parse,h264parse support,,,)) +$(eval $(call GstBuildPlugin,hdvparse,hdvparse support,,,)) +$(eval $(call GstBuildPlugin,id3tag,id3tag support,tag,,)) +$(eval $(call GstBuildPlugin,invtelecine,invtelecine support,,,)) +$(eval $(call GstBuildPlugin,jpegformat,jpegformat support,tag,,)) +#$(eval $(call GstBuildPlugin,librfbsrc,librfb support,,,)) +$(eval $(call GstBuildPlugin,liveadder,liveadder support,audio,,)) +$(eval $(call GstBuildPlugin,mpegdemux,mpegdemux support,tag,,+liboil +librt)) +$(eval $(call GstBuildPlugin,mpegtsmux,mpegtsmux support,,,)) +$(eval $(call GstBuildPlugin,mpegpsmux,mpegpsmux support,,,)) +$(eval $(call GstBuildPlugin,mpeg4videoparse,mpeg4videoparse support,,,)) +$(eval $(call GstBuildPlugin,mpegvideoparse,mpegvideoparse support,,,)) +$(eval $(call GstBuildPlugin,mve,mve support,,,)) +$(eval $(call GstBuildPlugin,mxf,mxf support,video,,)) +$(eval $(call GstBuildPlugin,nsf,nsf support,,,)) +$(eval $(call GstBuildPlugin,nuvdemux,nuvdemux support,,,)) +$(eval $(call GstBuildPlugin,pcapparse,pcapparse support,,,)) +$(eval $(call GstBuildPlugin,pnm,pnm support,video,,)) +$(eval $(call GstBuildPlugin,qtmux,qtmux support,tag,,)) +$(eval $(call GstBuildPlugin,rawparse,rawparse support,video,,)) +$(eval $(call GstBuildPlugin,rtpmux,rtpmux support,rtp,,)) +#$(eval $(call GstBuildPlugin,rfbsrc,rfb support,,,)) +$(eval $(call GstBuildPlugin,scaletempoplugin,scaletempo support,,,)) +$(eval $(call GstBuildPlugin,sdpelem,sdp support,interfaces rtp sdp,,)) +$(eval $(call GstBuildPlugin,segmentclip,segmentclip support,audio,,)) +$(eval $(call GstBuildPlugin,selector,selector support,,,)) +$(eval $(call GstBuildPlugin,siren,siren support,rtp,,)) +$(eval $(call GstBuildPlugin,speed,speed support,,,)) +$(eval $(call GstBuildPlugin,subenc,subenc support,controller,,)) +$(eval $(call GstBuildPlugin,stereo,stereo support,audio controller,,)) +$(eval $(call GstBuildPlugin,tta,tta support,,,)) +$(eval $(call GstBuildPlugin,valve,valve support,,,)) +$(eval $(call GstBuildPlugin,videomeasure,videomeasure support,video,,)) +$(eval $(call GstBuildPlugin,videosignal,videosignal support,video,,)) +$(eval $(call GstBuildPlugin,vmnc,vmnc support,,,)) +$(eval $(call GstBuildPlugin,mms,mms support,,,+libmms)) + +$(eval $(call BuildPackage,gst-plugins-bad)) diff --git a/multimedia/gst-plugins-bad/patches/000-gettext.patch b/multimedia/gst-plugins-bad/patches/000-gettext.patch new file mode 100644 index 0000000..b2c2d19 --- /dev/null +++ b/multimedia/gst-plugins-bad/patches/000-gettext.patch @@ -0,0 +1,23 @@ +diff -ur gst-plugins-bad-0.10.19.orig/configure.ac gst-plugins-bad-0.10.19/configure.ac +--- gst-plugins-bad-0.10.19.orig/configure.ac 2011-01-07 01:44:21.000000000 +0100 ++++ gst-plugins-bad-0.10.19/configure.ac 2011-01-07 01:45:31.000000000 +0100 +@@ -1772,7 +1772,6 @@ + ext/vp8/Makefile + ext/xvid/Makefile + ext/zbar/Makefile +-po/Makefile.in + docs/Makefile + docs/plugins/Makefile + docs/version.entities +diff -ur gst-plugins-bad-0.10.19.orig/Makefile.am gst-plugins-bad-0.10.19/Makefile.am +--- gst-plugins-bad-0.10.19.orig/Makefile.am 2011-01-07 01:44:21.000000000 +0100 ++++ gst-plugins-bad-0.10.19/Makefile.am 2011-01-07 01:46:17.000000000 +0100 +@@ -2,7 +2,7 @@ + + SUBDIRS = \ + gst-libs gst sys ext pkgconfig \ +- m4 common docs tests po tools ++ m4 common docs tests tools + + DIST_SUBDIRS = \ + gst gst-libs sys ext pkgconfig \ diff --git a/multimedia/gst-plugins-base/Makefile b/multimedia/gst-plugins-base/Makefile new file mode 100644 index 0000000..27e47cc --- /dev/null +++ b/multimedia/gst-plugins-base/Makefile @@ -0,0 +1,242 @@ +# +# Copyright (C) 2008-2011 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:=gst-plugins-base +PKG_VERSION:=0.10.29 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-base/ +PKG_MD5SUM:=d07e251152cccbaa81807c14cf0fd8c0 + +PKG_BUILD_DEPENDS:= gstreamer liboil +PKG_CONFIG_DEPENDS:= \ + CONFIG_PACKAGE_gst-mod-alsa \ + CONFIG_PACKAGE_gst-mod-app \ + CONFIG_PACKAGE_gst-mod-audioconvert \ + CONFIG_PACKAGE_gst-mod-audiorate \ + CONFIG_PACKAGE_gst-mod-audioresample \ + CONFIG_PACKAGE_gst-mod-audiotestsrc \ + CONFIG_PACKAGE_gst-mod-gio \ + CONFIG_PACKAGE_gst-mod-ogg \ + CONFIG_PACKAGE_gst-mod-tcp \ + CONFIG_PACKAGE_gst-mod-theora \ + CONFIG_PACKAGE_gst-mod-videotestsrc \ + CONFIG_PACKAGE_gst-mod-volume \ + CONFIG_PACKAGE_gst-mod-vorbis \ + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +# -liconv crept in from pkg-config, to be revisited later +include $(INCLUDE_DIR)/nls.mk + +define Package/gstreamer/Default + CATEGORY:=Multimedia + SECTION:=multimedia + TITLE:=GStreamer + URL:=http://gstreamer.freedesktop.org/ +endef + +define Package/gstreamer/description/Default + GStreamer open source multimedia framework +endef + + +define Package/gst-plugins-base +$(call Package/gstreamer/Default) + TITLE+= plugins collection (base) + DEPENDS+= $(GST_DEPENDS) +endef + +define Package/gts-plugins-base/description +$(call Package/gstreamer/description/Default) + . + This meta package contains only dependencies to the other libraries and + plugins from the base plugins collection. +endef + + +GST_COND_SELECT = $(patsubst %,$(if $(CONFIG_PACKAGE_gst-mod-$(1)),--enable,--disable)-%,$(1)) + +GST_VERSION:=0.10 + +CONFIGURE_ARGS += \ + --disable-debug \ + --disable-examples \ + \ + $(call GST_COND_SELECT,alsa) \ + --disable-alsa-test \ + $(call GST_COND_SELECT,app) \ + $(call GST_COND_SELECT,audioconvert) \ + $(call GST_COND_SELECT,audiorate) \ + $(call GST_COND_SELECT,audioresample) \ + $(call GST_COND_SELECT,audiotestsrc) \ + --disable-cdparanoia \ + --disable-ffmpegcolorspace \ + --disable-freetypetest \ + $(call GST_COND_SELECT,gio) \ + --disable-gnome_vfs \ + --disable-gst_v4l \ + --disable-libvisual \ + $(call GST_COND_SELECT,ogg) \ + --disable-oggtest \ + --disable-pango \ + --disable-subparse \ + $(call GST_COND_SELECT,tcp) \ + $(call GST_COND_SELECT,theora) \ + --disable-videorate \ + --disable-videoscale \ + $(call GST_COND_SELECT,videotestsrc) \ + $(call GST_COND_SELECT,volume) \ + $(call GST_COND_SELECT,vorbis) \ + --disable-vorbistest \ + --disable-x \ + --disable-xshm \ + --disable-xvideo \ + \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + --without-x \ + \ + --with-audioresample-format=int \ + +EXTRA_LDFLAGS+= \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \ + + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/gstreamer-$(GST_VERSION) + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/include/gstreamer-$(GST_VERSION)/* \ + $(1)/usr/include/gstreamer-$(GST_VERSION)/ \ + ) + $(INSTALL_DIR) $(1)/usr/lib + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/libgst*-$(GST_VERSION).{a,la,so*} \ + $(1)/usr/lib/ \ + ) + $(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION) + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/gstreamer-$(GST_VERSION)/libgst*.{la,so} \ + $(1)/usr/lib/gstreamer-$(GST_VERSION)/ \ + ) + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/pkgconfig/gstreamer*-$(GST_VERSION).pc \ + $(1)/usr/lib/pkgconfig/ \ + ) +endef + + +define Package/gst-plugins-base/install + /bin/true +endef + + +# 1: short name +# 2: description +# 3: dependencies on other gstreamer libraries (short name) +# 4: dependencies on other packages +define GstBuildLibrary + + GST_DEPENDS += +libgst$(1) + + define Package/libgst$(1) + $(call Package/gstreamer/Default) + TITLE+= $(2) library (base) + DEPENDS+= +libgstreamer $$(foreach p,$(3),+libgst$$(p)) $(4) + endef + + define Package/libgst$(1)/description + $(call Package/gstreamer/description/Default) + . + This package contains the GStreamer $(2) library. + endef + + define Package/libgst$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/libgst$(1)-$(GST_VERSION).so.* \ + $$(1)/usr/lib/ \ + ) + endef + + $$(eval $$(call BuildPackage,libgst$(1))) +endef + +$(eval $(call GstBuildLibrary,app,app,,)) +$(eval $(call GstBuildLibrary,audio,audio,interfaces,)) +$(eval $(call GstBuildLibrary,cdda,CDDA,tag,)) +$(eval $(call GstBuildLibrary,fft,FFT,,)) +$(eval $(call GstBuildLibrary,interfaces,interfaces,)) +$(eval $(call GstBuildLibrary,netbuffer,network buffer,,)) +$(eval $(call GstBuildLibrary,pbutils,utils,,)) +$(eval $(call GstBuildLibrary,riff,RIFF media,audio tag,,)) +$(eval $(call GstBuildLibrary,rtp,RTP,,)) +$(eval $(call GstBuildLibrary,rtsp,RTSP,,)) +$(eval $(call GstBuildLibrary,sdp,SDP,,)) +$(eval $(call GstBuildLibrary,tag,tag support,,)) +$(eval $(call GstBuildLibrary,video,video,,)) + + +# 1: short name +# 2: description +# 3: dependencies on other gstreamer libraries (short name) +# 4: dependencies on other gstreamer plugins (short name) +# 5: dependencies on other packages +define GstBuildPlugin + + GST_DEPENDS += +gst-mod-$(1) + + define Package/gst-mod-$(1) + $(call Package/gstreamer/Default) + TITLE+= $(2) plugin (base) + DEPENDS+= +libgstreamer $$(foreach p,$(3),+libgst$$(p)) $$(foreach p,$(4),+gst-mod-$$(p)) $(5) + endef + + define Package/gst-mod-$(1)/description + $(call Package/gstreamer/description/Default) + . + This package contains the GStreamer $(2) plugin. + endef + + define Package/gst-mod-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/gstreamer-$(GST_VERSION) + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/gstreamer-$(GST_VERSION)/libgst$(1).so* \ + $$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \ + ) + endef + + $$(eval $$(call BuildPackage,gst-mod-$(1))) +endef + +$(eval $(call GstBuildPlugin,alsa,ALSA,audio,,+alsa-lib)) +$(eval $(call GstBuildPlugin,app,app,app,,)) +$(eval $(call GstBuildPlugin,audioconvert,audio format conversion,audio,,)) +$(eval $(call GstBuildPlugin,audiorate,audio rate adjusting,,,)) +$(eval $(call GstBuildPlugin,audioresample,audio resampling,,,)) +$(eval $(call GstBuildPlugin,audiotestsrc,audio test,controller,,)) +$(eval $(call GstBuildPlugin,decodebin,media decoder,pbutils,,)) +$(eval $(call GstBuildPlugin,decodebin2,media decoder (v2),pbutils,,)) +$(eval $(call GstBuildPlugin,gio,GIO,,,)) +$(eval $(call GstBuildPlugin,ogg,Ogg,riff tag,,+libogg)) +$(eval $(call GstBuildPlugin,playbin,playback,video interfaces pbutils,,)) +$(eval $(call GstBuildPlugin,tcp,TCP,dataprotocol,,)) +$(eval $(call GstBuildPlugin,theora,Theora,video tag,ogg,+libtheora)) +$(eval $(call GstBuildPlugin,typefindfunctions,'typefind' functions,,,)) +$(eval $(call GstBuildPlugin,videotestsrc,video test,,,+liboil)) +$(eval $(call GstBuildPlugin,volume,volume,audio controller,,+liboil)) +$(eval $(call GstBuildPlugin,vorbis,Vorbis,audio tag,ogg,+libvorbis)) + +$(eval $(call BuildPackage,gst-plugins-base)) diff --git a/multimedia/gst-plugins-base/patches/001-no_docs.patch b/multimedia/gst-plugins-base/patches/001-no_docs.patch new file mode 100644 index 0000000..a2ca92e --- /dev/null +++ b/multimedia/gst-plugins-base/patches/001-no_docs.patch @@ -0,0 +1,34 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -12,14 +12,12 @@ SUBDIRS = \ + gst sys $(SUBDIRS_EXT) \ + tools \ + tests \ +- docs \ + po \ + common \ + m4 + + DIST_SUBDIRS = \ + pkgconfig \ +- docs \ + gst-libs \ + gst sys ext \ + tools \ +--- a/Makefile.in ++++ b/Makefile.in +@@ -446,14 +446,12 @@ SUBDIRS = \ + gst sys $(SUBDIRS_EXT) \ + tools \ + tests \ +- docs \ + po \ + common \ + m4 + + DIST_SUBDIRS = \ + pkgconfig \ +- docs \ + gst-libs \ + gst sys ext \ + tools \ diff --git a/multimedia/gst-plugins-base/patches/002-no_tests.patch b/multimedia/gst-plugins-base/patches/002-no_tests.patch new file mode 100644 index 0000000..c92135f --- /dev/null +++ b/multimedia/gst-plugins-base/patches/002-no_tests.patch @@ -0,0 +1,36 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -11,7 +11,6 @@ SUBDIRS = \ + gst-libs \ + gst sys $(SUBDIRS_EXT) \ + tools \ +- tests \ + po \ + common \ + m4 +@@ -21,7 +20,6 @@ DIST_SUBDIRS = \ + gst-libs \ + gst sys ext \ + tools \ +- tests \ + po \ + common \ + m4 +--- a/Makefile.in ++++ b/Makefile.in +@@ -445,7 +445,6 @@ SUBDIRS = \ + gst-libs \ + gst sys $(SUBDIRS_EXT) \ + tools \ +- tests \ + po \ + common \ + m4 +@@ -455,7 +454,6 @@ DIST_SUBDIRS = \ + gst-libs \ + gst sys ext \ + tools \ +- tests \ + po \ + common \ + m4 diff --git a/multimedia/gst-plugins-base/patches/003-no_translations.patch b/multimedia/gst-plugins-base/patches/003-no_translations.patch new file mode 100644 index 0000000..8654f8b --- /dev/null +++ b/multimedia/gst-plugins-base/patches/003-no_translations.patch @@ -0,0 +1,46 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -956,7 +956,6 @@ docs/design/Makefile + docs/libs/Makefile + docs/plugins/Makefile + docs/version.entities +-po/Makefile.in + common/Makefile + common/m4/Makefile + m4/Makefile +--- a/Makefile.am ++++ b/Makefile.am +@@ -11,7 +11,6 @@ SUBDIRS = \ + gst-libs \ + gst sys $(SUBDIRS_EXT) \ + tools \ +- po \ + common \ + m4 + +@@ -20,7 +19,6 @@ DIST_SUBDIRS = \ + gst-libs \ + gst sys ext \ + tools \ +- po \ + common \ + m4 + +--- a/Makefile.in ++++ b/Makefile.in +@@ -445,7 +445,6 @@ SUBDIRS = \ + gst-libs \ + gst sys $(SUBDIRS_EXT) \ + tools \ +- po \ + common \ + m4 + +@@ -454,7 +453,6 @@ DIST_SUBDIRS = \ + gst-libs \ + gst sys ext \ + tools \ +- po \ + common \ + m4 + diff --git a/multimedia/gst-plugins-good/Makefile b/multimedia/gst-plugins-good/Makefile new file mode 100644 index 0000000..f60ef8a --- /dev/null +++ b/multimedia/gst-plugins-good/Makefile @@ -0,0 +1,173 @@ +## Copyright (C) 2009-2011 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:=gst-plugins-good +PKG_VERSION:=0.10.23 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-good/ +PKG_MD5SUM:=9cddbb0e7e90677f0cc05c23feffef5c + +PKG_BUILD_DEPENDS:= gstreamer gst-plugins-base liboil + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/gstreamer/Default + CATEGORY:=Multimedia + SECTION:=multimedia + TITLE:=GStreamer + URL:=http://gstreamer.freedesktop.org/ +endef + +define Package/gstreamer/description/Default + GStreamer open source multimedia framework +endef + + +define Package/gst-plugins-good +$(call Package/gstreamer/Default) + TITLE+= plugins collection (good) + DEPENDS+= $(GST_DEPENDS) +endef + +define Package/gts-plugins-good/description +$(call Package/gstreamer/description/Default) + . + This meta package contains only dependencies to the other plugins from + the good plugins collection. +endef + + +GST_VERSION:=0.10 + +CONFIGURE_ARGS += \ + --disable-debug \ + --disable-examples \ + \ + --disable-aalib \ + --disable-alpha \ + --disable-annodex \ + --disable-apetag \ + --disable-auparse \ + --disable-avi \ + --disable-bz2 \ + --disable-cairo \ + --disable-directsound \ + --disable-dv1394 \ + --disable-effectv \ + --disable-esd \ + --disable-flv \ + --disable-flx \ + --disable-gconf \ + --disable-gconftool \ + --disable-gdk_pixbuf \ + --disable-goom \ + --disable-goom2k1 \ + --disable-gst_v4l2 \ + --disable-hal \ + --disable-jpeg \ + --disable-law \ + --disable-libcaca \ + --disable-libdv \ + --disable-libpng \ + --disable-matroska \ + --disable-monoscope \ + --disable-osx_audio \ + --disable-osx_video \ + --disable-pulse \ + --disable-qtdemux \ + --disable-rtspmanager \ + --disable-smpte \ + --disable-shout2 \ + --disable-speex \ + --disable-sunaudio \ + --disable-taglib \ + --disable-videobox \ + --disable-videocrop \ + --disable-videofilter \ + --disable-videomixer \ + --disable-wavpack \ + --disable-x \ + --disable-xshm \ + --disable-xvideo \ + --disable-y4m \ + --disable-zlib \ + \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + --without-x \ + +EXTRA_LDFLAGS+= \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \ + + +define Package/gst-plugins-good/install + /bin/true +endef + + +# 1: short name +# 2: description +# 3: dependencies on other gstreamer libraries (short name) +# 4: dependencies on other gstreamer plugins (short name) +# 5: dependencies on other packages +define GstBuildPlugin + + GST_DEPENDS += +gst-mod-$(1) + + define Package/gst-mod-$(1) + $(call Package/gstreamer/Default) + TITLE+= $(2) plugin (good) + DEPENDS+= +libgstreamer $$(foreach p,$(3),+libgst$$(p)) $$(foreach p,$(4),+gst-mod-$$(p)) $(5) + endef + + define Package/gst-mod-$(1)/description + $(call Package/gstreamer/description/Default) + . + This package contains the GStreamer $(2) plugin. + endef + + define Package/gst-mod-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/gstreamer-$(GST_VERSION) + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/gstreamer-$(GST_VERSION)/libgst$(1).so* \ + $$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \ + ) + endef + + $$(eval $$(call BuildPackage,gst-mod-$(1))) +endef + +$(eval $(call GstBuildPlugin,audiofx,audio effects,audio fft controller,,)) +$(eval $(call GstBuildPlugin,autodetect,format auto-detection,,,)) +$(eval $(call GstBuildPlugin,cutter,audio cutter,audio,,)) +$(eval $(call GstBuildPlugin,debug,debugging,,,)) +$(eval $(call GstBuildPlugin,equalizer,audio equalizer,audio controller,,)) +$(eval $(call GstBuildPlugin,flac,FLAC codec,audio pbutils tag,,+libflac)) +$(eval $(call GstBuildPlugin,id3demux,ID3v1/v2 demuxer,pbutils tag,,)) +$(eval $(call GstBuildPlugin,icydemux,icy demuxer,audio tag,,)) +$(eval $(call GstBuildPlugin,interleave,audio interleave,audio,,)) +$(eval $(call GstBuildPlugin,level,audio level,audio,,)) +$(eval $(call GstBuildPlugin,multifile,multiple files access,,,)) +$(eval $(call GstBuildPlugin,multipart,multipart stream handling,,,)) +$(eval $(call GstBuildPlugin,ossaudio,OSS audio support,audio,,)) +$(eval $(call GstBuildPlugin,replaygain,volume normalization,pbutils,,)) +$(eval $(call GstBuildPlugin,rtp,RTP,audio rtp tag,,)) +$(eval $(call GstBuildPlugin,rtsp,RTSP,interfaces rtp rtsp sdp,,)) +$(eval $(call GstBuildPlugin,souphttpsrc,soup input,audio tag,,+libsoup)) +$(eval $(call GstBuildPlugin,spectrum,spectrum data output,audio fft,,)) +$(eval $(call GstBuildPlugin,udp,UDP,netbuffer,,)) +$(eval $(call GstBuildPlugin,wavenc,Wav encoder,riff,,)) +$(eval $(call GstBuildPlugin,wavparse,Wav parser,audio riff tag,,)) + +$(eval $(call BuildPackage,gst-plugins-good)) diff --git a/multimedia/gst-plugins-good/patches/001-no_docs.patch b/multimedia/gst-plugins-good/patches/001-no_docs.patch new file mode 100644 index 0000000..9a7f60b --- /dev/null +++ b/multimedia/gst-plugins-good/patches/001-no_docs.patch @@ -0,0 +1,20 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -9,7 +9,6 @@ endif + ALWAYS_SUBDIRS = \ + gst sys ext \ + tests \ +- docs \ + po \ + common \ + m4 \ +--- a/Makefile.in ++++ b/Makefile.in +@@ -476,7 +476,6 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk + ALWAYS_SUBDIRS = \ + gst sys ext \ + tests \ +- docs \ + po \ + common \ + m4 \ diff --git a/multimedia/gst-plugins-good/patches/002-no_tests.patch b/multimedia/gst-plugins-good/patches/002-no_tests.patch new file mode 100644 index 0000000..2b67186 --- /dev/null +++ b/multimedia/gst-plugins-good/patches/002-no_tests.patch @@ -0,0 +1,20 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -8,7 +8,6 @@ endif + + ALWAYS_SUBDIRS = \ + gst sys ext \ +- tests \ + po \ + common \ + m4 \ +--- a/Makefile.in ++++ b/Makefile.in +@@ -475,7 +475,6 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk + @USE_GCONFTOOL_TRUE@GCONF_DIR = gconf + ALWAYS_SUBDIRS = \ + gst sys ext \ +- tests \ + po \ + common \ + m4 \ diff --git a/multimedia/gst-plugins-good/patches/003-no_translations.patch b/multimedia/gst-plugins-good/patches/003-no_translations.patch new file mode 100644 index 0000000..453f6f1 --- /dev/null +++ b/multimedia/gst-plugins-good/patches/003-no_translations.patch @@ -0,0 +1,30 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -1147,7 +1147,6 @@ sys/sunaudio/Makefile + sys/v4l2/Makefile + sys/waveform/Makefile + sys/ximage/Makefile +-po/Makefile.in + tests/Makefile + tests/check/Makefile + tests/examples/Makefile +--- a/Makefile.am ++++ b/Makefile.am +@@ -8,7 +8,6 @@ endif + + ALWAYS_SUBDIRS = \ + gst sys ext \ +- po \ + common \ + m4 \ + pkgconfig +--- a/Makefile.in ++++ b/Makefile.in +@@ -475,7 +475,6 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk + @USE_GCONFTOOL_TRUE@GCONF_DIR = gconf + ALWAYS_SUBDIRS = \ + gst sys ext \ +- po \ + common \ + m4 \ + pkgconfig diff --git a/multimedia/gst-plugins-ugly/Makefile b/multimedia/gst-plugins-ugly/Makefile new file mode 100644 index 0000000..1ebdd7e --- /dev/null +++ b/multimedia/gst-plugins-ugly/Makefile @@ -0,0 +1,134 @@ +# +# Copyright (C) 2009-2011 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:=gst-plugins-ugly +PKG_VERSION:=0.10.15 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-ugly/ +PKG_MD5SUM:=21c034a762a5da252f91640e53bfe457 + +PKG_BUILD_DEPENDS:= gstreamer gst-plugins-base liboil +PKG_CONFIG_DEPENDS:= \ + CONFIG_PACKAGE_gst-mod-asf \ + CONFIG_PACKAGE_gst-mod-lame \ + CONFIG_PACKAGE_gst-mod-mad \ + CONFIG_PACKAGE_gst-mod-mpeg2dec \ + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/gstreamer/Default + CATEGORY:=Multimedia + SECTION:=multimedia + TITLE:=GStreamer + URL:=http://gstreamer.freedesktop.org/ +endef + +define Package/gstreamer/description/Default + GStreamer open source multimedia framework +endef + + +define Package/gst-plugins-ugly +$(call Package/gstreamer/Default) + TITLE+= plugins collection (ugly) + DEPENDS+= $(GST_DEPENDS) +endef + +define Package/gts-plugins-ugly/description +$(call Package/gstreamer/description/Default) + . + This meta package contains only dependencies to the other plugins from + the ugly plugins collection. +endef + + +GST_COND_SELECT = $(patsubst %,$(if $(CONFIG_PACKAGE_gst-mod-$(1)),--enable,--disable)-%,$(1)) + +GST_VERSION:=0.10 + +CONFIGURE_ARGS += \ + --disable-debug \ + --disable-examples \ + \ + --disable-a52dec \ + --disable-amrnb \ + --disable-amrwb \ + $(call GST_COND_SELECT,asf) \ + --disable-cdio \ + --disable-dvdlpcmdec \ + --disable-dvdread \ + --disable-dvdsub \ + --disable-iec958 \ + $(call GST_COND_SELECT,lame) \ + $(call GST_COND_SELECT,mad) \ + $(call GST_COND_SELECT,mpeg2dec) \ + --disable-mpegaudioparse \ + --disable-mpegstream \ + --disable-realmedia \ + --disable-sidplay \ + --disable-synaesthesia \ + --disable-twolame \ + --disable-x264 \ + \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + +EXTRA_LDFLAGS+= \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \ + + +define Package/gst-plugins-ugly/install + /bin/true +endef + + +# 1: short name +# 2: description +# 3: dependencies on other gstreamer libraries (short name) +# 4: dependencies on other gstreamer plugins (short name) +# 5: dependencies on other packages +define GstBuildPlugin + + GST_DEPENDS += +gst-mod-$(1) + + define Package/gst-mod-$(1) + $(call Package/gstreamer/Default) + TITLE+= $(2) plugin (ugly) + DEPENDS+= +libgstreamer $$(foreach p,$(3),+libgst$$(p)) $$(foreach p,$(4),+gst-mod-$$(p)) $(5) + endef + + define Package/gst-mod-$(1)/description + $(call Package/gstreamer/description/Default) + . + This package contains the GStreamer $(2) plugin. + endef + + define Package/gst-mod-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/gstreamer-$(GST_VERSION) + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/gstreamer-$(GST_VERSION)/libgst$(1).so* \ + $$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \ + ) + endef + + $$(eval $$(call BuildPackage,gst-mod-$(1))) +endef + +$(eval $(call GstBuildPlugin,asf,ASF demuxer,audio riff rtp rtsp sdp tag,,)) +$(eval $(call GstBuildPlugin,lame,MP3 encoder (using LAME),,,+lame-lib)) +$(eval $(call GstBuildPlugin,mad,MP3 decoder (using MAD),audio tag,,+libid3tag +libmad)) +$(eval $(call GstBuildPlugin,mpeg2dec,MPEG decoder,video,,+libmpeg2)) + +$(eval $(call BuildPackage,gst-plugins-ugly)) diff --git a/multimedia/gst-plugins-ugly/patches/001-no_docs.patch b/multimedia/gst-plugins-ugly/patches/001-no_docs.patch new file mode 100644 index 0000000..1810542 --- /dev/null +++ b/multimedia/gst-plugins-ugly/patches/001-no_docs.patch @@ -0,0 +1,22 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,7 +1,7 @@ + DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc + + SUBDIRS = \ +- gst-libs gst ext docs m4 tests common po ++ gst-libs gst ext m4 tests common po + + # include before EXTRA_DIST for win32 assignment + include $(top_srcdir)/common/win32.mak +--- a/Makefile.in ++++ b/Makefile.in +@@ -395,7 +395,7 @@ top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc + SUBDIRS = \ +- gst-libs gst ext docs m4 tests common po ++ gst-libs gst ext m4 tests common po + + + # the MANIFEST contains all win32 related files that should be disted diff --git a/multimedia/gst-plugins-ugly/patches/002-no_tests.patch b/multimedia/gst-plugins-ugly/patches/002-no_tests.patch new file mode 100644 index 0000000..c7eed9d --- /dev/null +++ b/multimedia/gst-plugins-ugly/patches/002-no_tests.patch @@ -0,0 +1,22 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,7 +1,7 @@ + DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc + + SUBDIRS = \ +- gst-libs gst ext m4 tests common po ++ gst-libs gst ext m4 common po + + # include before EXTRA_DIST for win32 assignment + include $(top_srcdir)/common/win32.mak +--- a/Makefile.in ++++ b/Makefile.in +@@ -395,7 +395,7 @@ top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc + SUBDIRS = \ +- gst-libs gst ext m4 tests common po ++ gst-libs gst ext m4 common po + + + # the MANIFEST contains all win32 related files that should be disted diff --git a/multimedia/gst-plugins-ugly/patches/003-no_translations.patch b/multimedia/gst-plugins-ugly/patches/003-no_translations.patch new file mode 100644 index 0000000..77015ff --- /dev/null +++ b/multimedia/gst-plugins-ugly/patches/003-no_translations.patch @@ -0,0 +1,32 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -495,7 +495,6 @@ docs/version.entities + tests/Makefile + tests/check/Makefile + m4/Makefile +-po/Makefile.in + gst-plugins-ugly.spec + ) + +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,7 +1,7 @@ + DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc + + SUBDIRS = \ +- gst-libs gst ext m4 common po ++ gst-libs gst ext m4 common + + # include before EXTRA_DIST for win32 assignment + include $(top_srcdir)/common/win32.mak +--- a/Makefile.in ++++ b/Makefile.in +@@ -395,7 +395,7 @@ top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc + SUBDIRS = \ +- gst-libs gst ext m4 common po ++ gst-libs gst ext m4 common + + + # the MANIFEST contains all win32 related files that should be disted diff --git a/multimedia/gstreamer/Makefile b/multimedia/gstreamer/Makefile new file mode 100644 index 0000000..5b0cbf7 --- /dev/null +++ b/multimedia/gstreamer/Makefile @@ -0,0 +1,197 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=gstreamer +PKG_VERSION:=0.10.34 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gstreamer/ +PKG_MD5SUM:=e6938af242cd002be9f0b6441e848d83 + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=autogen.sh aclocal.m4 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/gstreamer/Default + CATEGORY:=Multimedia + SECTION:=multimedia + TITLE:=GStreamer + URL:=http://gstreamer.freedesktop.org/ +endef + +define Package/gstreamer/description/Default + GStreamer open source multimedia framework +endef + + +define Package/gstreamer +$(call Package/gstreamer/Default) + TITLE+= framework + DEPENDS+= +libgstreamer \ + +libgstcheck \ + +libgstcontroller \ + +libgstdataprotocol \ + +libgstnet +endef + +define Package/gstreamer/description +$(call Package/gstreamer/description/Default) + . + This meta package contains only dependencies on the other GStreamer + componenents. +endef + + +define Package/gstreamer-utils +$(call Package/gstreamer/Default) + TITLE+= utilities + DEPENDS+= +libgstreamer +endef + +define Package/gstreamer-utils/description +$(call Package/gstreamer/description/Default) + . + This package contains the GStreamer utilities. +endef + + +define Package/libgstreamer +$(call Package/gstreamer/Default) + TITLE+= library (core) + DEPENDS+= +glib2 +libpthread +libxml2 +endef + +define Package/libgstreamer/description +$(call Package/gstreamer/description/Default) + . + This package contains the GStreamer core library. +endef + + +GST_VERSION:=0.10 + +CONFIGURE_ARGS += \ + --disable-debug \ + --disable-examples \ + --disable-tests \ + --disable-valgrind \ + \ + --disable-gst-debug \ + \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + --without-x \ + +EXTRA_LDFLAGS+= \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \ + -L$(ICONV_PREFIX)/lib -L$(INTL_PREFIX)/lib + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/gstreamer-$(GST_VERSION) + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/include/gstreamer-$(GST_VERSION)/* \ + $(1)/usr/include/gstreamer-$(GST_VERSION)/ \ + ) + $(INSTALL_DIR) $(1)/usr/lib + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/libgst*-$(GST_VERSION).{a,la,so*} \ + $(1)/usr/lib/ \ + ) + $(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION) + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/gstreamer-$(GST_VERSION)/libgst*.{la,so} \ + $(1)/usr/lib/gstreamer-$(GST_VERSION)/ \ + ) + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/pkgconfig/gstreamer*-$(GST_VERSION).pc \ + $(1)/usr/lib/pkgconfig/ \ + ) + $(INSTALL_DIR) $(2)/share/aclocal + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/share/aclocal/* \ + $(2)/share/aclocal/ \ + ) +endef + +define Package/gstreamer/install + /bin/true +endef + +define Package/gstreamer-utils/install + $(INSTALL_DIR) $(1)/usr/bin + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/bin/gst-feedback* \ + ./usr/bin/gst-launch* \ + ./usr/bin/gst-inspect* \ + ./usr/bin/gst-typefind* \ + ./usr/bin/gst-xmlinspect* \ + ./usr/bin/gst-xmllaunch* \ + $(1)/usr/bin/ \ + ) +endef + +define Package/libgstreamer/install + $(INSTALL_DIR) $(1)/usr/lib + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/libgstbase-$(GST_VERSION).so.* \ + ./usr/lib/libgstreamer-$(GST_VERSION).so.* \ + $(1)/usr/lib/ \ + ) + $(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION) + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/gstreamer-$(GST_VERSION)/libgst*.so \ + $(1)/usr/lib/gstreamer-$(GST_VERSION)/ \ + ) +endef + + +# 1: short name +# 2: description +# 3: dependencies on other gstreamer libraries (short name) +# 4: dependencies on other packages +define GstBuildLibrary + + define Package/libgst$(1) + $(call Package/gstreamer/Default) + TITLE+= $(2) library (core) + DEPENDS+= +libgstreamer $$(foreach p,$(3),+libgst$$(p)) $(4) + endef + + define Package/libgst$(1)/description + $(call Package/gstreamer/description/Default) + . + This package contains the GStreamer $(2) library. + endef + + define Package/libgst$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib + ( cd $(PKG_INSTALL_DIR); $(CP) \ + ./usr/lib/libgst$(1)-$(GST_VERSION).so.* \ + $$(1)/usr/lib/ \ + ) + endef + + $$(eval $$(call BuildPackage,libgst$(1))) +endef + +$(eval $(call GstBuildLibrary,check,check unit testing)) +$(eval $(call GstBuildLibrary,controller,dynamic parameter control)) +$(eval $(call GstBuildLibrary,dataprotocol,data protocol)) +$(eval $(call GstBuildLibrary,net,network classes)) + +$(eval $(call BuildPackage,gstreamer)) +$(eval $(call BuildPackage,gstreamer-utils)) +$(eval $(call BuildPackage,libgstreamer)) + diff --git a/multimedia/gstreamer/patches/001-no_docs.patch b/multimedia/gstreamer/patches/001-no_docs.patch new file mode 100644 index 0000000..e94fd00 --- /dev/null +++ b/multimedia/gstreamer/patches/001-no_docs.patch @@ -0,0 +1,36 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -8,7 +8,6 @@ aclocal_DATA = gst-element-check-@GST_MA + + SUBDIRS = pkgconfig \ + gst libs plugins tools tests \ +- docs \ + po \ + m4 \ + common +@@ -16,7 +15,6 @@ SUBDIRS = pkgconfig \ + # These are all the possible subdirs + DIST_SUBDIRS = pkgconfig \ + gst libs plugins tools tests \ +- docs \ + po \ + m4 \ + common +--- a/Makefile.in ++++ b/Makefile.in +@@ -445,7 +445,6 @@ aclocaldir = $(datadir)/aclocal + aclocal_DATA = gst-element-check-@GST_MAJORMINOR@.m4 + SUBDIRS = pkgconfig \ + gst libs plugins tools tests \ +- docs \ + po \ + m4 \ + common +@@ -454,7 +453,6 @@ SUBDIRS = pkgconfig \ + # These are all the possible subdirs + DIST_SUBDIRS = pkgconfig \ + gst libs plugins tools tests \ +- docs \ + po \ + m4 \ + common diff --git a/multimedia/gstreamer/patches/002-no_tests.patch b/multimedia/gstreamer/patches/002-no_tests.patch new file mode 100644 index 0000000..6058a38 --- /dev/null +++ b/multimedia/gstreamer/patches/002-no_tests.patch @@ -0,0 +1,39 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -7,14 +7,14 @@ aclocaldir = $(datadir)/aclocal + aclocal_DATA = gst-element-check-@GST_MAJORMINOR@.m4 + + SUBDIRS = pkgconfig \ +- gst libs plugins tools tests \ ++ gst libs plugins tools \ + po \ + m4 \ + common + + # These are all the possible subdirs + DIST_SUBDIRS = pkgconfig \ +- gst libs plugins tools tests \ ++ gst libs plugins tools \ + po \ + m4 \ + common +--- a/Makefile.in ++++ b/Makefile.in +@@ -444,7 +444,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk + aclocaldir = $(datadir)/aclocal + aclocal_DATA = gst-element-check-@GST_MAJORMINOR@.m4 + SUBDIRS = pkgconfig \ +- gst libs plugins tools tests \ ++ gst libs plugins tools \ + po \ + m4 \ + common +@@ -452,7 +452,7 @@ SUBDIRS = pkgconfig \ + + # These are all the possible subdirs + DIST_SUBDIRS = pkgconfig \ +- gst libs plugins tools tests \ ++ gst libs plugins tools \ + po \ + m4 \ + common diff --git a/multimedia/gstreamer/patches/003-no_translations.patch b/multimedia/gstreamer/patches/003-no_translations.patch new file mode 100644 index 0000000..8090563 --- /dev/null +++ b/multimedia/gstreamer/patches/003-no_translations.patch @@ -0,0 +1,45 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -695,7 +695,6 @@ libs/gst/net/Makefile + plugins/Makefile + plugins/indexers/Makefile + plugins/elements/Makefile +-po/Makefile.in + tests/Makefile + tests/benchmarks/Makefile + tests/check/Makefile +--- a/Makefile.am ++++ b/Makefile.am +@@ -8,14 +8,12 @@ aclocal_DATA = gst-element-check-@GST_MA + + SUBDIRS = pkgconfig \ + gst libs plugins tools \ +- po \ + m4 \ + common + + # These are all the possible subdirs + DIST_SUBDIRS = pkgconfig \ + gst libs plugins tools \ +- po \ + m4 \ + common + +--- a/Makefile.in ++++ b/Makefile.in +@@ -445,7 +445,6 @@ aclocaldir = $(datadir)/aclocal + aclocal_DATA = gst-element-check-@GST_MAJORMINOR@.m4 + SUBDIRS = pkgconfig \ + gst libs plugins tools \ +- po \ + m4 \ + common + +@@ -453,7 +452,6 @@ SUBDIRS = pkgconfig \ + # These are all the possible subdirs + DIST_SUBDIRS = pkgconfig \ + gst libs plugins tools \ +- po \ + m4 \ + common + diff --git a/multimedia/hasciicam/Makefile b/multimedia/hasciicam/Makefile new file mode 100644 index 0000000..a982281 --- /dev/null +++ b/multimedia/hasciicam/Makefile @@ -0,0 +1,39 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=hasciicam +PKG_VERSION:=1.1.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.dyne.org/hasciicam/releases/ +PKG_MD5SUM:=2c7393270e18ab913043683fa3390d8c + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/hasciicam + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE:=Live ASCII video feeds + URL:=http://ascii.dyne.org/ + DEPENDS:= +libaa +ftplib +endef + + +CONFIGURE_VARS += \ + LIBS="-lncurses" \ + +define Package/hasciicam/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/hasciicam $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,hasciicam)) diff --git a/multimedia/icecast/Makefile b/multimedia/icecast/Makefile new file mode 100644 index 0000000..2b44113 --- /dev/null +++ b/multimedia/icecast/Makefile @@ -0,0 +1,91 @@ +# +# Copyright (C) 2006-2011 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 +PKG_VERSION:=2.3.2 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.us.xiph.org/releases/icecast/ +PKG_MD5SUM:=ff516b3ccd2bcc31e68f460cd316093f + +PKG_FIXUP:=autoreconf + +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 + TITLE:=A streaming media server for Ogg/Vorbis and MP3 audio streams + URL:=http://www.icecast.org/ +endef + +define Package/icecast/description + Icecast is a streaming media server which currently supports Ogg + Vorbis and MP3 audio streams. It can be used to create an Internet + radio station or a privately running jukebox and many things in + between. It is very versatile in that new formats can be added + relatively easily and supports open standards for commuincation and + interaction. +endef + +define Build/Prepare + $(Build/Prepare/Default) + $(SUBMAKE) -f libvorbisidec.mk \ + BUILD_DIR="$(PKG_BUILD_DIR)" \ + V=99 \ + prepare +endef + +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 +endef + +define Package/icecast/install + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/icecast.xml $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/icecast $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/share/icecast + $(CP) $(PKG_INSTALL_DIR)/usr/share/icecast/admin $(1)/usr/share/icecast/ + $(CP) $(PKG_INSTALL_DIR)/usr/share/icecast/web $(1)/usr/share/icecast/ +endef + +define Package/icecast/conffiles +/etc/icecast.xml +endef + +$(eval $(call BuildPackage,icecast)) diff --git a/multimedia/icecast/libvorbisidec.mk b/multimedia/icecast/libvorbisidec.mk new file mode 100644 index 0000000..eda6e76 --- /dev/null +++ b/multimedia/icecast/libvorbisidec.mk @@ -0,0 +1,41 @@ +# +# 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)) diff --git a/multimedia/icecast/patches/001-icecast-2.3.0-tremor.patch b/multimedia/icecast/patches/001-icecast-2.3.0-tremor.patch new file mode 100644 index 0000000..6fa6f08 --- /dev/null +++ b/multimedia/icecast/patches/001-icecast-2.3.0-tremor.patch @@ -0,0 +1,155 @@ +--- a/src/format_flac.c ++++ b/src/format_flac.c +@@ -18,7 +18,7 @@ + #endif + + #include +-#include ++#include + #include + + typedef struct source_tag source_t; +--- a/src/format_midi.c ++++ b/src/format_midi.c +@@ -18,7 +18,7 @@ + #endif + + #include +-#include ++#include + #include + + typedef struct source_tag source_t; +--- a/src/format_ogg.c ++++ b/src/format_ogg.c +@@ -24,7 +24,7 @@ + #include + #include + +-#include ++#include + + #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 ++#include + #include "refbuf.h" + #include "format.h" + +--- a/src/format_speex.c ++++ b/src/format_speex.c +@@ -18,7 +18,7 @@ + #endif + + #include +-#include ++#include + #include + + typedef struct source_tag source_t; +--- a/src/format_theora.c ++++ b/src/format_theora.c +@@ -18,7 +18,7 @@ + #endif + + #include +-#include ++#include + #include + + typedef struct source_tag source_t; +--- a/src/format_vorbis.c ++++ b/src/format_vorbis.c +@@ -18,8 +18,8 @@ + #endif + + #include +-#include +-#include ++#include ++#include + #include + #include + +--- a/src/source.c ++++ b/src/source.c +@@ -19,7 +19,7 @@ + #include + #include + #include +-#include ++#include + #include + + #ifndef _WIN32 +--- a/src/format_kate.c ++++ b/src/format_kate.c +@@ -19,7 +19,7 @@ + + #include + #include +-#include ++#include + #ifdef HAVE_KATE + #include + #endif +--- a/m4/vorbis.m4 ++++ b/m4/vorbis.m4 +@@ -38,9 +38,9 @@ if test "x$vorbis_prefix" != "x$ogg_pref + ]) + fi + +-VORBIS_LIBS="-lvorbis" +-VORBISFILE_LIBS="-lvorbisfile" +-VORBISENC_LIBS="-lvorbisenc" ++VORBIS_LIBS="-lvorbisidec" ++VORBISFILE_LIBS="-lvorbisidec" ++VORBISENC_LIBS="-lvorbisidec" + + xt_save_LIBS="$LIBS" + xt_save_LDFLAGS="$LDFLAGS" +@@ -58,18 +58,6 @@ AC_TRY_LINK_FUNC(ogg_stream_init, [xt_li + ) + ]) + +-if test "x$xt_lib_vorbis" = "xok"; then +-# +-# Now check if the installed Vorbis is sufficiently new. +-# +-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ +-#include +-#include +- ], [ +-struct ovectl_ratemanage_arg a; +-])],,[xt_lib_vorbis="old version found"]) +-AC_MSG_RESULT([$xt_lib_vorbis]) +-fi + CPPFLAGS="$xt_save_CPPFLAGS" + LIBS="$xt_save_LIBS" + LDFLAGS="$xt_save_LDFLAGS" +--- a/m4/ogg.m4 ++++ b/m4/ogg.m4 +@@ -29,7 +29,7 @@ XIPH_GCC_WARNING([-I$ogg_prefix/include] + ]) + AC_CACHE_CHECK([for libogg], xt_cv_lib_ogg, + [dnl +-OGG_LIBS="-logg" ++OGG_LIBS="-lvorbisidec" + + # + # 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 ],, ++ [ AC_TRY_LINK([#include ],, + [ xt_cv_lib_ogg="pre v1.0, needs updating" ], + [ xt_cv_lib_ogg="not found" ]) + ]) diff --git a/multimedia/icecast/patches/010-fix_libcurl_test_crap.patch b/multimedia/icecast/patches/010-fix_libcurl_test_crap.patch new file mode 100644 index 0000000..8da6e33 --- /dev/null +++ b/multimedia/icecast/patches/010-fix_libcurl_test_crap.patch @@ -0,0 +1,11 @@ +--- a/m4/xiph_curl.m4 ++++ b/m4/xiph_curl.m4 +@@ -52,7 +52,7 @@ AC_CHECK_HEADERS([curl/curl.h],, curl_ok + AC_MSG_CHECKING(for libcurl) + if test "$curl_ok" = "yes" + then +- AC_RUN_IFELSE(AC_LANG_SOURCE([ ++ AC_COMPILE_IFELSE(AC_LANG_SOURCE([ + #include + int main() + { diff --git a/multimedia/imagemagick/Makefile b/multimedia/imagemagick/Makefile new file mode 100644 index 0000000..28a6bff --- /dev/null +++ b/multimedia/imagemagick/Makefile @@ -0,0 +1,157 @@ +# +# Copyright (C) 2010-2012 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:=imagemagick +PKG_VERSION:=6.7.8 +PKG_REVISION:=10 +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/ImageMagick-$(PKG_VERSION)-$(PKG_REVISION) +PKG_SOURCE:=ImageMagick-$(PKG_VERSION)-$(PKG_REVISION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.fifi.org/pub/ImageMagick/ +PKG_MD5SUM:=c66bea4710370b2e115aed512fbe4601 + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=aclocal.m4 m4/libtool.m4 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +PKG_INSTALL=1 + +define Package/imagemagick/Default + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE:=imagemagick + URL:=http://image_magick.veidrodis.com/ +endef + +define Package/imagemagick + $(call Package/imagemagick/Default) + DEPENDS:=+libpthread +libltdl +libjpeg +libtiff +zlib +endef + +define Package/imagemagick/description + An image manipulation library. +endef + +define Package/imagemagick-jpeg + $(call Package/imagemagick/Default) + TITLE+= (jpeg) + DEPENDS:=+imagemagick +endef + +define Package/imagemagick-jpeg/description + imagemagick JPEG module +endef + +define Package/imagemagick-png + $(call Package/imagemagick/Default) + TITLE+= (png) + DEPENDS:=+imagemagick +libpng +endef + +define Package/imagemagick-png/description + imagemagick PNG module +endef + +define Package/imagemagick-tools + $(call Package/imagemagick/Default) + TITLE+= (tools) + DEPENDS:=+imagemagick +endef + +define Package/imagemagick-png/description + imagemagick tools (mogrify,convert) +endef + +define Package/imagemagick-tiff + $(call Package/imagemagick/Default) + TITLE+= (tiff) + DEPENDS:=+imagemagick +endef + +define Package/imagemagick-tiff/description + imagemagick TIFF module +endef + + +CONFIGURE_ARGS += \ + --with-modules \ + --enable-shared \ + --enable-static \ + --without-pango \ + --without-bzlib \ + --without-freetype \ + --without-fontconfig \ + --without-rsvg \ + --without-fftw \ + --without-xml \ + --without-x \ + --without-magick-plus-plus + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -Wall -I$(PKG_BUILD_DIR)/include/linux -I$(PKG_BUILD_DIR)/include" +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/magick + $(INSTALL_DIR) $(1)/usr/include/wand + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/* \ + $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.so* \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/ + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/imagemagick/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.so* \ + $(1)/usr/lib/ +endef + +define Package/imagemagick-tools/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/bin/mogrify \ + $(1)/usr/bin/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/bin/convert \ + $(1)/usr/bin/ +endef + +define BuildPlugin + define Package/imagemagick-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/ImageMagick-$(PKG_VERSION)/modules-Q16/coders + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ImageMagick-$(PKG_VERSION)/modules-Q16/coders/$(1).so \ + $$(1)/usr/lib/ImageMagick-$(PKG_VERSION)/modules-Q16/coders + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ImageMagick-$(PKG_VERSION)/modules-Q16/coders/$(1).la \ + $$(1)/usr/lib/ImageMagick-$(PKG_VERSION)/modules-Q16/coders + endef + + $$(eval $$(call BuildPackage,imagemagick-$(1))) +endef + +$(eval $(call BuildPackage,imagemagick)) +$(eval $(call BuildPackage,imagemagick-tools)) +$(eval $(call BuildPlugin,jpeg)) +$(eval $(call BuildPlugin,png)) +$(eval $(call BuildPlugin,tiff)) + diff --git a/multimedia/kissdx/Makefile b/multimedia/kissdx/Makefile new file mode 100644 index 0000000..1b787db --- /dev/null +++ b/multimedia/kissdx/Makefile @@ -0,0 +1,64 @@ +# +# Copyright (C) 2009-2011 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:=kissdx +PKG_REV:=193 +PKG_VERSION:=r$(PKG_REV) +PKG_RELEASE:=3 + +PKG_SOURCE_PROTO:=svn +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_URL:=http://www.famille-kahn.com/svn/kissdx/kissdx/trunk +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_VERSION:=$(PKG_REV) + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/kissdx + SECTION:=multimedia + CATEGORY:=Multimedia + DEPENDS:=+libjpeg +libdvdread $(ICONV_DEPENDS) + TITLE:=PC-Link clone for KiSS media players + URL:=http://kissdx.vidartysse.net +endef + +define Package/kissdx/description + kissdx is a PC-Link clone for KiSS media players, based for + the most part on kissd (which it now replaces), with added + features for media playback, management, flexibility and more. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CFLAGS="$(TARGET_CFLAGS) -DLinux -DUSE_INTERNAL_SENDFILE -std=gnu99 -Wall -Wstrict-prototypes -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DFILE_OFFSET_BITS=64 -D_GNU_SOURCE -I$(ICONV_PREFIX)/include -I$(STAGING_DIR)/usr/include/dvdread $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) -L$(ICONV_PREFIX)/lib" \ + LDFLAGS="-L$(ICONV_PREFIX)/lib $(TARGET_LDFLAGS)" \ + STRIP=$(STRIP) \ + IconvExternal=defined \ + CC="$(TARGET_CROSS)gcc" all +endef + +define Package/kissdx/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/kissdx $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/kissdx.config $(1)/etc/config/kissdx + $(INSTALL_BIN) ./files/kissdx.init $(1)/etc/init.d/kissdx +endef + +define Package/kissdx/conffiles +/etc/config/kissdx +endef + +$(eval $(call BuildPackage,kissdx)) diff --git a/multimedia/kissdx/files/kissdx.config b/multimedia/kissdx/files/kissdx.config new file mode 100644 index 0000000..5cd2b17 --- /dev/null +++ b/multimedia/kissdx/files/kissdx.config @@ -0,0 +1,34 @@ +config 'kissdx' 'server' + option 'signature' 'kissdx {Version} ({VersionDate}) @ {ShortHostName} {ConfigReloadStatus}' + option 'pidfile' '/var/run/kissdx.pid' + option 'characterset' 'ISO-8859-1' + option 'picturetargetwidth' '1280' + option 'picturetargetheight' '720' + option 'picturemaxzoompercent' '20' + option 'enablehiddenfilestext' 'Show it all' + option 'enablehiddenfilesminutes' '5' + option 'listhiddenentries' 'no' + option 'displaysequencenumbers' 'no' + option 'loglevel' '4' + +config 'kissdx' 'paths' + option 'audio' '/mnt/music' + option 'video' '/mnt/movies' + option 'picture' '/mnt/photos' + +config 'kissdx' 'files' + option 'audio' 'mp3,ogg,wma,wav' + option 'video' 'mpg,mpeg,vob,avi,wmv,ts,mp4,divx' + option 'picture' 'jpg,jpeg,png,bmp' + option 'iso' 'iso,img' + option 'renamefiletypes' 'ts:mpg,wav:mp3' + +config 'kissdx' 'subtitles' + option 'filemapping' '*:{name}*.*' + +config 'kissdx' 'recentfiles' + option 'foldername' '[Recently played]' + option 'max' '30' + +config 'kissdx' 'kml' + option 'forwardurl' 'http://tinystocks.com/k/kiss.php' diff --git a/multimedia/kissdx/files/kissdx.init b/multimedia/kissdx/files/kissdx.init new file mode 100755 index 0000000..9f1a78e --- /dev/null +++ b/multimedia/kissdx/files/kissdx.init @@ -0,0 +1,115 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008 OpenWrt.org + +START=65 + +SERVICE_USE_PID=1 + +CFGFILE=/tmp/kissdx.conf + +create_configfile() { + local signature pidfile characterset \ + picturetargetwidth picturetargetheight picturemaxzoompercent \ + enablehiddenfilestext enablehiddenfilesminutes \ + listhiddenentries displaysequencenumbers loglevel + local path_audio path_video path_picture + local files_audio files_video files_picture files_iso files_renamefiletypes + local subtitles_filemapping + local recentfiles_foldername recentfiles_max + local kml_forwardurl + + echo '### AUTOGENERATED CONFIGURATION FILE - DO NOT EDIT ###' > $CFGFILE + echo '### Edit /etc/config/kissdx to make changes to setup ###' >> $CFGFILE + echo '' >> $CFGFILE + + config_get signature server signature + config_get pidfile server pidfile + config_get characterset server characterset + config_get picturetargetwidth server picturetargetwidth + config_get picturetargetheight server picturetargetheight + config_get picturemaxzoompercent server picturemaxzoompercent + config_get enablehiddenfilestext server enablehiddenfilestext + config_get enablehiddenfilesminutes server enablehiddenfilesminutes + config_get listhiddenentries server listhiddenentries + config_get displaysequencenumbers server displaysequencenumbers + config_get loglevel server loglevel + + config_get path_audio paths audio + config_get path_video paths video + config_get path_picture paths picture + + config_get files_audio files audio + config_get files_video files video + config_get files_picture files picture + config_get files_iso files iso + config_get files_renamefiletypes files renamefiletypes + + config_get subtitles_filemapping subtitles filemapping + + config_get recentfiles_foldername recentfiles foldername + config_get recentfiles_max recentfiles max + + config_get kml_forwardurl kml forwardurl + + echo 'serversignature = ' $signature >> $CFGFILE + echo '#listenaddress = 192.168.1.2' >> $CFGFILE + echo '#networktimeoutinterval = 3600' >> $CFGFILE + echo '#adminserver_port = 8003' >> $CFGFILE + echo 'configautoload = no' >> $CFGFILE + echo '#dvdaccessmethod = libdvdnav' >> $CFGFILE + echo 'pidfilepath = ' $pidfile >> $CFGFILE + echo '#persistentstoragepath = /tmp/kissdx' >> $CFGFILE + echo '#server_character_set = CP850' >> $CFGFILE + echo '#client_character_set = ISO-8859-1' >> $CFGFILE + echo 'config_character_set = ' $characterset >> $CFGFILE + echo 'playlist_character_set = ' $characterset >> $CFGFILE + echo 'displaysequencenumbers = ' $displaysequencenumbers >> $CFGFILE + echo '' >> $CFGFILE + echo '# 0 = caching disabled, -1 = no limit or amount of pictures in cache' >> $CFGFILE + echo 'picturecachesize = 0' >> $CFGFILE + echo '#picturecachetrimminginterval = 10' >> $CFGFILE + echo '' >> $CFGFILE + echo 'audiopath = ' $path_audio >> $CFGFILE + echo 'videopath = ' $path_video >> $CFGFILE + echo 'picturepath = ' $path_picture >> $CFGFILE + echo '' >> $CFGFILE + echo 'audiofileextensions = ' $files_audio >> $CFGFILE + echo 'videofileextensions = ' $files_video >> $CFGFILE + echo 'picturefileextensions = ' $files_picture >> $CFGFILE + echo 'isofileextensions = ' $files_iso >> $CFGFILE + echo '' >> $CFGFILE + echo 'renamefiletypes = ' $files_renamefiletypes >> $CFGFILE + echo '' >> $CFGFILE + echo 'listhiddenentries = ' $listhiddenentries >> $CFGFILE + echo 'enablehiddenfilestext = ' $enablehiddenfilestext >> $CFGFILE + echo 'enablehiddenfilesminutes = ' $enablehiddenfilesminutes >> $CFGFILE + echo '' >> $CFGFILE + echo 'picturetargetwidth = ' $picturetargetwidth >> $CFGFILE + echo 'picturetargetheight = ' $picturetargetheight >> $CFGFILE + echo 'picturemaxzoompercent = ' $picturemaxzoompercent >> $CFGFILE + echo '' >> $CFGFILE + echo 'subtitlefilemapping = ' $subtitles_filemapping >> $CFGFILE + echo '' >> $CFGFILE + echo 'recentlyusedfoldername = ' $recentfiles_foldername >> $CFGFILE + echo 'max_recent_files = ' $recentfiles_max >> $CFGFILE + echo '' >> $CFGFILE + echo 'kmlforwardurl = ' $kml_forwardurl >> $CFGFILE + echo '' >> $CFGFILE + echo '#pretrigger = /usr/bin/kissd-pretrigger' >> $CFGFILE + echo '#posttrigger = /usr/bin/kissd-posttrigger' >> $CFGFILE + echo '#directorypretrigger = /usr/bin/kissddirpretrigger' >> $CFGFILE + echo '#directoryposttrigger = /usr/bin/kisdddirposttrigger' >> $CFGFILE + echo '#Set logging level (1 to 5). 5 means no log. Loglevel can also be' >> $CFGFILE + echo '#specified as one of: Error, Warning, Protocol, Information, Debug.' >> $CFGFILE + echo 'loglevel = ' $loglevel >> $CFGFILE +} + +start () { + config_load kissdx + create_configfile + service_start /usr/bin/kissdx -c $CFGFILE -d +} + +stop() { + service_stop /usr/bin/kissdx +} diff --git a/multimedia/minidlna/Makefile b/multimedia/minidlna/Makefile new file mode 100644 index 0000000..2d74ccf --- /dev/null +++ b/multimedia/minidlna/Makefile @@ -0,0 +1,91 @@ +# +# Copyright (C) 2010-2012 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:=minidlna +PKG_VERSION:=1.0.24 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION)_src.tar.gz +PKG_SOURCE_URL:=@SF/minidlna +PKG_MD5SUM:=be9b4c91e3fcde592dc3f9828098ca0f + +PKG_BUILD_PARALLEL:=0 +PKG_BUILD_DEPENDS:=util-linux + +include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/minidlna + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE:=UPnP A/V & DLNA Media Server + URL:=http://minidlna.sourceforge.net/ + DEPENDS:= +libpthread +libexif +libjpeg +libsqlite3 +libffmpeg \ + +libid3tag +libflac +libvorbis +libuuid \ + $(ICONV_DEPENDS) $(INTL_DEPENDS) +endef + +define Package/minidlna/description + MiniDLNA (aka ReadyDLNA) is server software with the aim of + being fully compliant with DLNA/UPnP-AV clients. +endef + +define Package/minidlna/conffiles +/etc/minidlna.conf +endef + +TARGET_CPPFLAGS += \ + -I$(STAGING_DIR)/usr/include \ + -I$(STAGING_DIR)/usr/include/FLAC \ + -I$(STAGING_DIR)/usr/include/libavcodec \ + -I$(STAGING_DIR)/usr/include/libavformat \ + -I$(STAGING_DIR)/usr/include/libavutil \ + -I$(STAGING_DIR)/usr/include/libexif \ + -I$(STAGING_DIR)/usr/include/uuid \ + -I$(STAGING_DIR)/usr/include/vorbis \ + -I$(ICONV_PREFIX)/include \ + -I$(INTL_PREFIX)/include \ + -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ + +TARGET_LDFLAGS += \ + -L$(ICONV_PREFIX)/lib \ + -L$(INTL_PREFIX)/lib \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \ + +MAKE_FLAGS +=\ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + ICONV_LIBS="-liconv $(if $(INTL_FULL),-lintl)" \ + +MAKE_VARS +=\ + PREFIX="$(STAGING_DIR)/usr" \ + ICONV_PREFIX="$(ICONV_PREFIX)" \ + INTL_PREFIX="$(INTL_PREFIX)" \ + OS_NAME="OpenWrt Linux" \ + OS_VERSION="$(LINUX_VERSION)" \ + OS_URL="http://openwrt.org/" \ + DB_PATH="/var/run/minidlna" \ + LOG_PATH="/var/log" \ + + +define Package/minidlna/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/minidlna $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/minidlna.init $(1)/etc/init.d/minidlna + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/minidlna.config $(1)/etc/config/minidlna +endef + +define Package/minidlna/conffiles +/etc/config/minidlna +endef + +$(eval $(call BuildPackage,minidlna)) diff --git a/multimedia/minidlna/files/minidlna.config b/multimedia/minidlna/files/minidlna.config new file mode 100644 index 0000000..459be3e --- /dev/null +++ b/multimedia/minidlna/files/minidlna.config @@ -0,0 +1,17 @@ +config minidlna config + option 'enabled' '0' + option port '8200' + option interface 'br-lan' + option friendly_name 'OpenWrt DLNA Server' + option db_dir '/var/run/minidlna' + option log_dir '/var/log' + option inotify '1' + option enable_tivo '0' + option strict_dlna '0' + option presentation_url '' + option notify_interval '900' + option serial '12345678' + option model_number '1' + option root_container '.' + list media_dir '/mnt' + option album_art_names 'Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg' diff --git a/multimedia/minidlna/files/minidlna.init b/multimedia/minidlna/files/minidlna.init new file mode 100644 index 0000000..5d7bc6d --- /dev/null +++ b/multimedia/minidlna/files/minidlna.init @@ -0,0 +1,91 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +MINIDLNA_CONFIG_FILE="/tmp/minidlna.conf" + +minidlna_cfg_append() { + echo "$1" >> "$MINIDLNA_CONFIG_FILE" +} + +minidlna_cfg_addbool() { + local cfg="$1" + local key="$2" + local def="$3" + local val + + config_get_bool val "$cfg" "$key" "$def" + [ "$val" -gt 0 ] && val="yes" || val="no" + minidlna_cfg_append "$key=$val" +} + +minidlna_cfg_addstr() { + local cfg="$1" + local key="$2" + local def="$3" + local val + + config_get val "$cfg" "$key" "$def" + [ -n "$val" ] && minidlna_cfg_append "$key=$val" +} + +minidlna_cfg_add_media_dir() { + local val=$1 + + minidlna_cfg_append "media_dir=$val" +} + +minidlna_create_config() { + local cfg=$1 + local port + local interface + + config_get port $cfg port + config_get interface $cfg interface + + [ -z "$interface" -o -t "$port" ] && return 1 + + echo "# this file is generated automatically, don't edit" > "$MINIDLNA_CONFIG_FILE" + + minidlna_cfg_append "port=$port" + minidlna_cfg_append "network_interface=$interface" + + minidlna_cfg_addstr $cfg friendly_name + minidlna_cfg_addstr $cfg db_dir + minidlna_cfg_addstr $cfg log_dir + minidlna_cfg_addbool $cfg inotify '1' + minidlna_cfg_addbool $cfg enable_tivo '0' + minidlna_cfg_addbool $cfg strict_dlna '0' + minidlna_cfg_addstr $cfg album_art_names + minidlna_cfg_addstr $cfg presentation_url + minidlna_cfg_addstr $cfg notify_interval '900' + minidlna_cfg_addstr $cfg serial '12345678' + minidlna_cfg_addstr $cfg model_number '1' + minidlna_cfg_addstr $cfg minissdpsocket + minidlna_cfg_addstr $cfg root_container '.' + config_list_foreach "$cfg" "media_dir" minidlna_cfg_add_media_dir + + return 0 +} + +start() { + local enabled + + config_load 'minidlna' + config_get_bool enabled config 'enabled' '0' + + [ "$enabled" -gt 0 ] || return 1 + + minidlna_create_config config || return 1 + + mkdir -m 0755 -p /var/log + mkdir -m 0755 -p /var/run/minidlna + service_start /usr/bin/minidlna -f "$MINIDLNA_CONFIG_FILE" +} + +stop() { + service_stop /usr/bin/minidlna +} diff --git a/multimedia/minidlna/patches/010-genconfig-checks.patch b/multimedia/minidlna/patches/010-genconfig-checks.patch new file mode 100644 index 0000000..bce8456 --- /dev/null +++ b/multimedia/minidlna/patches/010-genconfig-checks.patch @@ -0,0 +1,92 @@ +--- a/genconfig.sh ++++ b/genconfig.sh +@@ -23,14 +23,18 @@ RM="rm -f" + CONFIGFILE="config.h" + CONFIGMACRO="__CONFIG_H__" + ++PREFIX="${PREFIX:-/usr}" ++ICONV_PREFIX="${ICONV_PREFIX:-$PREFIX}" ++INTL_PREFIX="${INTL_PREFIX:-$PREFIX}" ++ + # Database path +-DB_PATH="/tmp/minidlna" ++DB_PATH="${DB_PATH:-/tmp/minidlna}" + # Log path +-LOG_PATH="${DB_PATH}" ++LOG_PATH="${LOG_PATH:-$DB_PATH}" + + # detecting the OS name and version +-OS_NAME=`uname -s` +-OS_VERSION=`uname -r` ++OS_NAME="${OS_NAME:-$(uname -s)}" ++OS_VERSION="${OS_VERSION:-$(uname -r)}" + TIVO="/*#define TIVO_SUPPORT*/" + NETGEAR="/*#define NETGEAR*/" + READYNAS="/*#define READYNAS*/" +@@ -40,22 +44,22 @@ ${RM} ${CONFIGFILE} + + # Detect if there are missing headers + # NOTE: This check only works with a normal distro +-[ ! -e "/usr/include/sqlite3.h" ] && MISSING="libsqlite3 $MISSING" +-[ ! -e "/usr/include/jpeglib.h" ] && MISSING="libjpeg $MISSING" +-[ ! -e "/usr/include/libexif/exif-loader.h" ] && MISSING="libexif $MISSING" +-[ ! -e "/usr/include/id3tag.h" ] && MISSING="libid3tag $MISSING" +-[ ! -e "/usr/include/ogg/ogg.h" ] && MISSING="libogg $MISSING" +-[ ! -e "/usr/include/vorbis/codec.h" ] && MISSING="libvorbis $MISSING" +-[ ! -e "/usr/include/FLAC/metadata.h" ] && MISSING="libflac $MISSING" +-[ ! -e "/usr/include/ffmpeg/avutil.h" -a \ +- ! -e "/usr/include/libavutil/avutil.h" -a \ +- ! -e "/usr/include/ffmpeg/libavutil/avutil.h" ] && MISSING="libavutil $MISSING" +-[ ! -e "/usr/include/ffmpeg/avformat.h" -a \ +- ! -e "/usr/include/libavformat/avformat.h" -a \ +- ! -e "/usr/include/ffmpeg/libavformat/avformat.h" ] && MISSING="libavformat $MISSING" +-[ ! -e "/usr/include/ffmpeg/avcodec.h" -a \ +- ! -e "/usr/include/libavcodec/avcodec.h" -a \ +- ! -e "/usr/include/ffmpeg/libavcodec/avcodec.h" ] && MISSING="libavcodec $MISSING" ++[ ! -e "${PREFIX}/include/sqlite3.h" ] && MISSING="libsqlite3 $MISSING" ++[ ! -e "${PREFIX}/include/jpeglib.h" ] && MISSING="libjpeg $MISSING" ++[ ! -e "${PREFIX}/include/libexif/exif-loader.h" ] && MISSING="libexif $MISSING" ++[ ! -e "${PREFIX}/include/id3tag.h" ] && MISSING="libid3tag $MISSING" ++[ ! -e "${PREFIX}/include/ogg/ogg.h" ] && MISSING="libogg $MISSING" ++[ ! -e "${PREFIX}/include/vorbis/codec.h" ] && MISSING="libvorbis $MISSING" ++[ ! -e "${PREFIX}/include/FLAC/metadata.h" ] && MISSING="libflac $MISSING" ++[ ! -e "${PREFIX}/include/ffmpeg/avutil.h" -a \ ++ ! -e "${PREFIX}/include/libavutil/avutil.h" -a \ ++ ! -e "${PREFIX}/include/ffmpeg/libavutil/avutil.h" ] && MISSING="libavutil $MISSING" ++[ ! -e "${PREFIX}/include/ffmpeg/avformat.h" -a \ ++ ! -e "${PREFIX}/include/libavformat/avformat.h" -a \ ++ ! -e "${PREFIX}/include/ffmpeg/libavformat/avformat.h" ] && MISSING="libavformat $MISSING" ++[ ! -e "${PREFIX}/include/ffmpeg/avcodec.h" -a \ ++ ! -e "${PREFIX}/include/libavcodec/avcodec.h" -a \ ++ ! -e "${PREFIX}/include/ffmpeg/libavcodec/avcodec.h" ] && MISSING="libavcodec $MISSING" + if [ -n "$MISSING" ]; then + echo -e "\nERROR! Cannot continue." + echo -e "The following required libraries are either missing, or are missing development headers:\n" +@@ -151,8 +155,7 @@ case $OS_NAME in + fi + ;; + *) +- echo "Unknown OS : $OS_NAME" +- exit 1 ++ echo "WARNING: Unknown OS : $OS_NAME" 1>&2 + ;; + esac + +@@ -183,7 +186,7 @@ fi + echo "" >> ${CONFIGFILE} + + echo "/* Enable if the system iconv.h exists. ID3 tag reading in various character sets will not work properly otherwise. */" >> ${CONFIGFILE} +-if [ -f /usr/include/iconv.h ]; then ++if [ -f ${ICONV_PREFIX}/include/iconv.h ]; then + echo "#define HAVE_ICONV_H" >> ${CONFIGFILE} + else + echo -e "\nWARNING!! Iconv support not found. ID3 tag reading may not work." +@@ -192,7 +195,7 @@ fi + echo "" >> ${CONFIGFILE} + + echo "/* Enable if the system libintl.h exists for NLS support. */" >> ${CONFIGFILE} +-if [ -f /usr/include/libintl.h ]; then ++if [ -f ${INTL_PREFIX}/include/libintl.h ]; then + echo "#define ENABLE_NLS" >> ${CONFIGFILE} + else + echo "/*#define ENABLE_NLS*/" >> ${CONFIGFILE} diff --git a/multimedia/minidlna/patches/020-makefile-tweaks.patch b/multimedia/minidlna/patches/020-makefile-tweaks.patch new file mode 100644 index 0000000..8314d94 --- /dev/null +++ b/multimedia/minidlna/patches/020-makefile-tweaks.patch @@ -0,0 +1,48 @@ +--- a/Makefile ++++ b/Makefile +@@ -10,19 +10,23 @@ + # or : + # $ make install + # ++PREFIX ?= /usr ++ICONV_PREFIX ?= $(PREFIX) ++INTL_PREFIX ?= $(PREFIX) + #CFLAGS = -Wall -O -D_GNU_SOURCE -g -DDEBUG + #CFLAGS = -Wall -g -Os -D_GNU_SOURCE + CFLAGS = -Wall -g -O3 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ +- -I/usr/include/ffmpeg \ +- -I/usr/include/libavutil -I/usr/include/libavcodec -I/usr/include/libavformat \ +- -I/usr/include/ffmpeg/libavutil -I/usr/include/ffmpeg/libavcodec -I/usr/include/ffmpeg/libavformat ++ -I$(PREFIX)/include/ffmpeg \ ++ -I$(PREFIX)/include/libavutil -I$(PREFIX)/include/libavcodec -I$(PREFIX)/include/libavformat \ ++ -I$(PREFIX)/include/ffmpeg/libavutil -I$(PREFIX)/include/ffmpeg/libavcodec -I$(PREFIX)/include/ffmpeg/libavformat ++ + #STATIC_LINKING: CFLAGS += -DSTATIC + #STATIC_LINKING: LDFLAGS = -static + CC = gcc + RM = rm -f + INSTALL = install + +-INSTALLPREFIX ?= $(DESTDIR)/usr ++INSTALLPREFIX ?= $(DESTDIR)$(PREFIX) + SBININSTALLDIR = $(INSTALLPREFIX)/sbin + ETCINSTALLDIR = $(DESTDIR)/etc + +@@ -37,7 +41,7 @@ BASEOBJS = minidlna.o upnphttp.o upnpdes + + ALLOBJS = $(BASEOBJS) $(LNXOBJS) + +-LIBS = -lpthread -lexif -ljpeg -lsqlite3 -lavformat -lavutil -lavcodec -lid3tag -lFLAC -logg -lvorbis ++LIBS = -lpthread -lexif -ljpeg -lsqlite3 -lavformat -lavutil -lavcodec -lid3tag -lFLAC -logg -lvorbis -luuid $(ICONV_LIBS) + #STATIC_LINKING: LIBS = -lvorbis -logg -lm -lsqlite3 -lpthread -lexif -ljpeg -lFLAC -lm -lid3tag -lz -lavformat -lavutil -lavcodec -lm + + TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o +@@ -64,7 +68,7 @@ install-conf: + $(INSTALL) -d $(ETCINSTALLDIR) + $(INSTALL) --mode=0644 minidlna.conf $(ETCINSTALLDIR) + +-minidlna: $(BASEOBJS) $(LNXOBJS) $(LIBS) ++minidlna: $(BASEOBJS) $(LNXOBJS) + @echo Linking $@ + @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(BASEOBJS) $(LNXOBJS) $(LIBS) + diff --git a/multimedia/minidlna/patches/030-missing-include.patch b/multimedia/minidlna/patches/030-missing-include.patch new file mode 100644 index 0000000..a1491ba --- /dev/null +++ b/multimedia/minidlna/patches/030-missing-include.patch @@ -0,0 +1,10 @@ +--- a/minidlna.c ++++ b/minidlna.c +@@ -58,6 +58,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/multimedia/mjpg-streamer/Makefile b/multimedia/mjpg-streamer/Makefile new file mode 100644 index 0000000..9f178a3 --- /dev/null +++ b/multimedia/mjpg-streamer/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2006-2011 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:=mjpg-streamer +PKG_REV:=148 +PKG_VERSION:=r$(PKG_REV) +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=https://mjpg-streamer.svn.sourceforge.net/svnroot/mjpg-streamer/mjpg-streamer/ +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=svn + +include $(INCLUDE_DIR)/package.mk + +define Package/mjpg-streamer + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE:=MJPG-streamer + DEPENDS:=+libpthread +libjpeg + URL:=http://mjpg-streamer.wiki.sourceforge.net/ +endef + +define Package/mjpg-streamer/description + Streaming application for Linux-UVC compatible webcams +endef + +EXTRA_CFLAGS += $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) + +define Package/mjpg-streamer/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mjpg_streamer $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/config + $(CP) ./files/mjpg-streamer.config $(1)/etc/config/mjpg-streamer + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mjpg-streamer.init $(1)/etc/init.d/mjpg-streamer + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(foreach input_plugin,file uvc,$(PKG_BUILD_DIR)/input_$(input_plugin).so) $(1)/usr/lib + $(CP) $(foreach output_plugin,http file,$(PKG_BUILD_DIR)/output_$(output_plugin).so) $(1)/usr/lib + $(INSTALL_DIR) $(1)/etc/hotplug.d/usb + $(INSTALL_DATA) ./files/mjpg-streamer.hotplug $(1)/etc/hotplug.d/usb/20-mjpg-streamer + $(INSTALL_DIR) $(1)/www/webcam + $(INSTALL_DATA) $(PKG_BUILD_DIR)/www/* $(1)/www/webcam +endef + +define Package/mjpg-streamer/conffiles +/etc/config/mjpg-streamer +endef + +$(eval $(call BuildPackage,mjpg-streamer)) diff --git a/multimedia/mjpg-streamer/files/mjpg-streamer.config b/multimedia/mjpg-streamer/files/mjpg-streamer.config new file mode 100644 index 0000000..5be37ea --- /dev/null +++ b/multimedia/mjpg-streamer/files/mjpg-streamer.config @@ -0,0 +1,7 @@ +config mjpg-streamer core + option enabled "0" + option device "/dev/video0" + option resolution "640x480" + option fps "5" + option www "/www/webcam" + option port "8080" diff --git a/multimedia/mjpg-streamer/files/mjpg-streamer.hotplug b/multimedia/mjpg-streamer/files/mjpg-streamer.hotplug new file mode 100644 index 0000000..c6f29cc --- /dev/null +++ b/multimedia/mjpg-streamer/files/mjpg-streamer.hotplug @@ -0,0 +1,11 @@ +case "$ACTION" in + add) + # start process + /etc/init.d/mjpg-streamer start + ;; + remove) + # stop process + /etc/init.d/mjpg-streamer stop + ;; +esac + diff --git a/multimedia/mjpg-streamer/files/mjpg-streamer.init b/multimedia/mjpg-streamer/files/mjpg-streamer.init new file mode 100644 index 0000000..b0a2043 --- /dev/null +++ b/multimedia/mjpg-streamer/files/mjpg-streamer.init @@ -0,0 +1,57 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2012 OpenWrt.org + +START=50 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +PROG=/usr/bin/mjpg_streamer + +error() { + echo "${initscript}:" "$@" 1>&2 +} + +section_enabled() { + config_get_bool enabled "$1" 'enabled' 0 + [ $enabled -gt 0 ] +} + +start_instance() { + local s="$1" + + section_enabled "$s" || return 1 + + config_get device "$s" 'device' + config_get resolution "$s" 'resolution' + config_get fps "$s" 'fps' + config_get www "$s" 'www' + config_get port "$s" 'port' + + [ -c "$device" ] || { + error "device '$device' does not exist" + return 1 + } + + service_start /usr/bin/mjpg_streamer --input "input_uvc.so \ + --device $device --fps $fps --resolution $resolution" \ + --output "output_http.so --www $www --port $port" +} + +stop_instance() { + local s="$1" + + section_enabled "$s" || return 1 + + service_stop /usr/bin/mjpg_streamer +} + +start() { + config_load 'mjpg-streamer' + config_foreach start_instance 'mjpg-streamer' +} + +stop() { + config_load 'mjpg-streamer' + config_foreach stop_instance 'mjpg-streamer' +} diff --git a/multimedia/motion/Makefile b/multimedia/motion/Makefile new file mode 100644 index 0000000..0909c24 --- /dev/null +++ b/multimedia/motion/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2008-2011 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:=motion +PKG_VERSION:=20110826-051001 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.lavrsen.dk/sources/motion-daily \ + @SF/motion +PKG_MD5SUM:=e703fce57ae2215cb05f25e3027f5818 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/motion + SECTION:=multimedia + CATEGORY:=Multimedia + DEPENDS:=+libjpeg +libpthread + TITLE:=webcam motion sensing and logging + URL:=http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome +endef + +define Package/motion/conffiles +/etc/motion.conf +endef + +CONFIGURE_ARGS+= \ + --without-optimizecpu \ + --without-ffmpeg \ + --without-jpeg-mmx \ + --without-sdl \ + --without-mysql \ + --without-pgsql \ + --without-sqlite3 \ + +define Package/motion/install + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/motion-dist.conf $(1)/etc/motion.conf + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/motion $(1)/usr/bin/ + +endef + +$(eval $(call BuildPackage,motion)) diff --git a/multimedia/motion/patches/002-honor_cppflags.patch b/multimedia/motion/patches/002-honor_cppflags.patch new file mode 100644 index 0000000..ac10f1e --- /dev/null +++ b/multimedia/motion/patches/002-honor_cppflags.patch @@ -0,0 +1,19 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -31,6 +31,7 @@ examplesdir = $(datadir)/@PACKAGE_NAME@- + # install. # + ################################################################################ + CFLAGS = @CFLAGS@ -Wall -DVERSION=\"@PACKAGE_VERSION@\" -Dsysconfdir=\"$(sysconfdir)\" ++CPPFLAGS = @CPPFLAGS@ + LDFLAGS = @LDFLAGS@ + LIBS = @LIBS@ + VIDEO_OBJ = @VIDEO@ +@@ -118,7 +119,7 @@ endif + ################################################################################ + $(DEPEND_FILE): *.h $(SRC) + @echo "Generating dependencies, please wait..." +- @$(CC) $(CFLAGS) -M $(SRC) > .tmp ++ @$(CC) $(CFLAGS) $(CPPFLAGS) -M $(SRC) > .tmp + @mv -f .tmp $(DEPEND_FILE) + @echo + diff --git a/multimedia/peercast/Makefile b/multimedia/peercast/Makefile new file mode 100644 index 0000000..fec240b --- /dev/null +++ b/multimedia/peercast/Makefile @@ -0,0 +1,64 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=peercast +PKG_VERSION:=0.1214 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.cti.ecp.fr/~beauxir5/peercast +PKG_MD5SUM:=4e8449cde7135ad97f788e67e1bd64ee + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=aclocal.m4 acinclude.m4 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/peercast + SECTION:=multimedia + CATEGORY:=Multimedia + DEPENDS:=+libpthread $(CXX_DEPENDS) + TITLE:=P2P audio and video streaming server + URL:=http://www.peercast.org/ +endef + +define Package/peercast/conffiles +/etc/peercast.ini +endef + +define Package/peercast/description + PeerCast is a fresh new P2P streaming server. It can stream music and + video from a broad variety of formats. Many audio players can listen to + peercast streams, as it's been built to remain compatible with Nullsoft + Shoutcast. +endef + +CONFIGURE_ARGS += \ + --enable-staticbin \ + +CONFIGURE_VARS += \ + LIBS="-lpthread" + +TARGET_CFLAGS += -fpermissive + +define Package/peercast/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/peercast $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/share/peercast/html + $(CP) $(PKG_INSTALL_DIR)/usr/share/peercast/html/en $(1)/usr/share/peercast/html/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/peercast.ini $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/peercast.init $(1)/etc/init.d/peercast +endef + +$(eval $(call BuildPackage,peercast)) diff --git a/multimedia/peercast/files/peercast.ini b/multimedia/peercast/files/peercast.ini new file mode 100644 index 0000000..f703c6e --- /dev/null +++ b/multimedia/peercast/files/peercast.ini @@ -0,0 +1,81 @@ + +[Server] +serverPort = 7144 +autoServe = Yes +forceIP = +isRoot = No +maxBitrateOut = 0 +maxRelays = 1 +maxDirect = 0 +maxRelaysPerChannel = 0 +firewallTimeout = 30 +forceNormal = No +rootMsg = +authType = cookie +cookiesExpire = session +htmlPath = html/en +minPGNUIncoming = 10 +maxPGNUIncoming = 20 +maxServIn = 50 +chanLog = +networkID = 00000000000000000000000000000000 + +[Broadcast] +broadcastMsgInterval = 10 +broadcastMsg = +icyMetaInterval = 8192 +broadcastID = 898145B5C0427118B595AF7D9E110000 +hostUpdateInterval = 180 +maxControlConnections = 3 +rootHost = yp.peercast.org + +[Client] +refreshHTML = 5 +relayBroadcast = 30 +minBroadcastTTL = 1 +maxBroadcastTTL = 7 +pushTries = 5 +pushTimeout = 60 +maxPushHops = 8 +autoQuery = 0 +queryTTL = 7 + +[Privacy] +password = hackme +maxUptime = 0 + +[Filter] +ip = 255.255.255.255 +private = No +ban = No +network = Yes +direct = Yes +[End] + +[Notify] +PeerCast = Yes +Broadcasters = Yes +TrackInfo = Yes +[End] + +[Server1] +allowHTML = Yes +allowBroadcast = Yes +allowNetwork = Yes +allowDirect = Yes +[End] + +[Server2] +allowHTML = No +allowBroadcast = Yes +allowNetwork = No +allowDirect = No +[End] + +[Debug] +logDebug = No +logErrors = No +logNetwork = No +logChannel = No +pauseLog = No +idleSleepTime = 10 diff --git a/multimedia/peercast/files/peercast.init b/multimedia/peercast/files/peercast.init new file mode 100644 index 0000000..033beb0 --- /dev/null +++ b/multimedia/peercast/files/peercast.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 + +PID_F=/var/run/peercast.pid + +start() { + peercast -d -i /etc/peercast.ini -l /var/log/peercast.log -p $PID_F +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1 +} + diff --git a/multimedia/puppy/Makefile b/multimedia/puppy/Makefile new file mode 100644 index 0000000..c17434d --- /dev/null +++ b/multimedia/puppy/Makefile @@ -0,0 +1,36 @@ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=puppy +PKG_VERSION:=1.14 +PKG_RELEASE:=1 + +PKG_SOURCE:=puppy_$(PKG_VERSION)_src.tar.bz2 +PKG_SOURCE_URL:=@SF/puppy +PKG_MD5SUM:=a7a53da5b8ba4fdb15e2fc8e1531b82c + +PKG_BUILD_DIR:=$(BUILD_DIR)/puppy_$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/puppy + SECTION:=multimedia + CATEGORY:=Multimedia + DEPENDS:=@USB_SUPPORT + TITLE:=Topfield PVR file transfer client + URL:=http://puppy.sourceforge.net/ +endef + +define Package/puppy/description +Client to access Topfield PVRs via the USB port +endef + +define Build/Configure +endef + +define Package/puppy/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/puppy $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,puppy)) diff --git a/multimedia/ushare/Makefile b/multimedia/ushare/Makefile new file mode 100644 index 0000000..ed19787 --- /dev/null +++ b/multimedia/ushare/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2008-2011 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:=ushare +PKG_VERSION:=1.1a +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://ushare.geexbox.org/releases/ +PKG_MD5SUM:=5bbcdbf1ff85a9710fa3d4e82ccaa251 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ushare + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE:= UPnP A/V & DLNA Media Server + URL:=http://ushare.geexbox.org/ + DEPENDS:=+libdlna +libupnp +libffmpeg +endef + +define Package/ushare/description + uShare is a UPnP (TM) A/V & DLNA Media Server. It implements the server + component that provides UPnP media devices with information on available + multimedia files. +endef + +MAKE_INSTALL_FLAGS+= \ + INSTALL="install" \ + +define Build/Configure + # this is *NOT* GNU configure + ( cd $(PKG_BUILD_DIR); \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib" \ + PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \ + PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig" \ + ./configure \ + --cross-compile \ + --cross-prefix="$(TARGET_CROSS)" \ + --prefix="/usr" \ + --sysconfdir="/etc" \ + --enable-dlna \ + --disable-nls \ + --disable-debug \ + --disable-optimize \ + --disable-strip \ + ) +endef + +define Package/ushare/conffiles +/etc/config/ushare +/etc/ushare.conf +endef + +define Package/ushare/install + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/ushare.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/ushare $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) +endef + +$(eval $(call BuildPackage,ushare)) diff --git a/multimedia/ushare/files/ushare.config b/multimedia/ushare/files/ushare.config new file mode 100644 index 0000000..d7d0dce --- /dev/null +++ b/multimedia/ushare/files/ushare.config @@ -0,0 +1,9 @@ +config 'ushare' + option 'enabled' '0' + option 'user' 'nobody' + option 'servername' 'OpenWrt' + option 'interface' 'br-lan' + option 'options' '' + option 'content_directories' '/tmp' + option 'disable_telnet' '1' + option 'disable_webif' '1' diff --git a/multimedia/ushare/files/ushare.init b/multimedia/ushare/files/ushare.init new file mode 100644 index 0000000..db661d1 --- /dev/null +++ b/multimedia/ushare/files/ushare.init @@ -0,0 +1,68 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008 OpenWrt.org +START=50 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +append_bool() { + local section="$1" + local option="$2" + local value="$3" + local _val + config_get_bool _val "$section" "$option" '0' + [ "$_val" -gt 0 ] && append args "$3" +} + +append_string() { + local section="$1" + local option="$2" + local value="$3" + local _val + config_get _val "$section" "$option" + [ -n "$_val" ] && append args "$3 $_val" +} + +section_enabled() { + config_get_bool enabled "$1" 'enabled' 0 + [ $enabled -gt 0 ] +} + +start_instance() { + local section="$1" + + section_enabled "$section" || return 1 + + args="" + config_get uid "$section" 'user' + config_get servername "$section" 'servername' + config_get interface "$section" 'interface' + config_get options "$section" 'options' + config_get content_directories "$section" 'content_directories' + append_bool "$section" 'disable_webif' '-w' + append_bool "$section" 'disable_telnet' '-t' + + SERVICE_UID="$uid" \ + service_start /usr/bin/ushare -n "${servername:-OpenWrt}" -i "${interface:-br-lan}" -c "${content_directories:-/tmp}" $args ${options} +} + +stop_instance() { + local section="$1" + + section_enabled "$section" || return 1 + + config_get uid "$section" "user" + + SERVICE_UID="$uid" \ + service_stop /usr/bin/ushare +} + +start() { + config_load 'ushare' + config_foreach start_instance 'ushare' +} + +stop() { + config_load 'ushare' + config_foreach stop_instance 'ushare' +} diff --git a/multimedia/ushare/patches/100-configure_grep_fix.patch b/multimedia/ushare/patches/100-configure_grep_fix.patch new file mode 100644 index 0000000..0bfb161 --- /dev/null +++ b/multimedia/ushare/patches/100-configure_grep_fix.patch @@ -0,0 +1,12 @@ +diff -ruN ushare-1.1a-orig/configure ushare-1.1a/configure +--- ushare-1.1a-orig/configure 2007-12-09 14:03:36.000000000 +0100 ++++ ushare-1.1a/configure 2008-04-19 22:48:35.000000000 +0200 +@@ -130,7 +130,7 @@ + var=$1 + shift + for f in $@; do +- if eval echo \$$var | grep -qv -e "$f"; then ++ if eval echo \$$var | grep -qv -e "$(echo $f | sed -e 's|\.|\\\.|g')"; then + eval "$var=\"\$$var $f\"" + fi + done diff --git a/multimedia/ushare/patches/200-compile-fixes.patch b/multimedia/ushare/patches/200-compile-fixes.patch new file mode 100644 index 0000000..dc38465 --- /dev/null +++ b/multimedia/ushare/patches/200-compile-fixes.patch @@ -0,0 +1,202 @@ +--- a/src/cds.c ++++ b/src/cds.c +@@ -20,6 +20,8 @@ + */ + + #include ++#include ++#include + #include + #include + +--- a/src/http.c ++++ b/src/http.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -77,8 +78,7 @@ set_info_file (struct File_Info *info, c + info->content_type = ixmlCloneDOMString (content_type); + } + +-static int +-http_get_info (const char *filename, struct File_Info *info) ++int http_get_info (const char *filename, struct File_Info *info) + { + extern struct ushare_t *ut; + struct upnp_entry_t *entry = NULL; +@@ -197,8 +197,7 @@ get_file_memory (const char *fullpath, c + return ((UpnpWebFileHandle) file); + } + +-static UpnpWebFileHandle +-http_open (const char *filename, enum UpnpOpenFileMode mode) ++UpnpWebFileHandle http_open (const char *filename, enum UpnpOpenFileMode mode) + { + extern struct ushare_t *ut; + struct upnp_entry_t *entry = NULL; +@@ -251,8 +250,7 @@ http_open (const char *filename, enum Up + return ((UpnpWebFileHandle) file); + } + +-static int +-http_read (UpnpWebFileHandle fh, char *buf, size_t buflen) ++int http_read (UpnpWebFileHandle fh, char *buf, size_t buflen) + { + struct web_file_t *file = (struct web_file_t *) fh; + ssize_t len = -1; +@@ -286,8 +284,7 @@ http_read (UpnpWebFileHandle fh, char *b + return len; + } + +-static int +-http_write (UpnpWebFileHandle fh __attribute__((unused)), ++int http_write (UpnpWebFileHandle fh __attribute__((unused)), + char *buf __attribute__((unused)), + size_t buflen __attribute__((unused))) + { +@@ -296,8 +293,7 @@ http_write (UpnpWebFileHandle fh __attri + return 0; + } + +-static int +-http_seek (UpnpWebFileHandle fh, off_t offset, int origin) ++int http_seek (UpnpWebFileHandle fh, off_t offset, int origin) + { + struct web_file_t *file = (struct web_file_t *) fh; + off_t newpos = -1; +@@ -371,8 +367,7 @@ http_seek (UpnpWebFileHandle fh, off_t o + return 0; + } + +-static int +-http_close (UpnpWebFileHandle fh) ++int http_close (UpnpWebFileHandle fh) + { + struct web_file_t *file = (struct web_file_t *) fh; + +@@ -402,13 +397,3 @@ http_close (UpnpWebFileHandle fh) + + return 0; + } +- +-struct UpnpVirtualDirCallbacks virtual_dir_callbacks = +- { +- http_get_info, +- http_open, +- http_read, +- http_write, +- http_seek, +- http_close +- }; +--- a/src/http.h ++++ b/src/http.h +@@ -25,6 +25,18 @@ + #include + #include + +-struct UpnpVirtualDirCallbacks virtual_dir_callbacks; ++int http_get_info (const char *filename, struct File_Info *info); ++ ++UpnpWebFileHandle http_open (const char *filename, enum UpnpOpenFileMode mode); ++ ++int http_read (UpnpWebFileHandle fh, char *buf, size_t buflen); ++ ++int http_seek (UpnpWebFileHandle fh, off_t offset, int origin); ++ ++int http_write (UpnpWebFileHandle fh __attribute__((unused)), ++ char *buf __attribute__((unused)), ++ size_t buflen __attribute__((unused))); ++ ++int http_close (UpnpWebFileHandle fh); + + #endif /* _HTTP_H_ */ +--- a/src/ushare.c ++++ b/src/ushare.c +@@ -188,7 +188,7 @@ handle_action_request (struct Upnp_Actio + if (strcmp (request->DevUDN + 5, ut->udn)) + return; + +- ip = request->CtrlPtIPAddr.s_addr; ++ ip = (*(struct sockaddr_in *)&request->CtrlPtIPAddr).sin_addr.s_addr; + ip = ntohl (ip); + sprintf (val, "%d.%d.%d.%d", + (ip >> 24) & 0xFF, (ip >> 16) & 0xFF, (ip >> 8) & 0xFF, ip & 0xFF); +@@ -348,13 +348,23 @@ init_upnp (struct ushare_t *ut) + + UpnpEnableWebserver (TRUE); + +- res = UpnpSetVirtualDirCallbacks (&virtual_dir_callbacks); +- if (res != UPNP_E_SUCCESS) +- { +- log_error (_("Cannot set virtual directory callbacks\n")); +- free (description); +- return -1; +- } ++#define upnp_set_callback(cb, func) \ ++ do { \ ++ res = UpnpVirtualDir_set_##cb##Callback(func); \ ++ if (res != UPNP_E_SUCCESS) \ ++ { \ ++ log_error (_("Cannot set virtual directory callbacks\n")); \ ++ free (description); \ ++ return -1; \ ++ } \ ++ } while(0) ++ ++ upnp_set_callback(GetInfo, http_get_info); ++ upnp_set_callback(Open, http_open); ++ upnp_set_callback(Read, http_read); ++ upnp_set_callback(Seek, http_seek); ++ upnp_set_callback(Write, http_write); ++ upnp_set_callback(Close, http_close); + + res = UpnpAddVirtualDir (VIRTUAL_DIR); + if (res != UPNP_E_SUCCESS) +--- a/src/cms.c ++++ b/src/cms.c +@@ -20,6 +20,8 @@ + */ + + #include ++#include ++#include + #include + #include + +--- a/src/mime.c ++++ b/src/mime.c +@@ -20,6 +20,7 @@ + */ + + #include ++#include + #include + + #include "mime.h" +--- a/src/presentation.c ++++ b/src/presentation.c +@@ -19,6 +19,8 @@ + */ + + #include ++#include ++#include + + #if HAVE_LANGINFO_CODESET + # include +--- a/src/services.c ++++ b/src/services.c +@@ -20,6 +20,8 @@ + */ + + #include ++#include ++#include + #include + #include + diff --git a/net/aircrack-ng/Makefile b/net/aircrack-ng/Makefile new file mode 100644 index 0000000..e912dfe --- /dev/null +++ b/net/aircrack-ng/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2006-2011 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:=aircrack-ng +PKG_VERSION:=1.1 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.aircrack-ng.org/ \ + http://archive.aircrack-ng.org/aircrack-ng/$(PKG_VERSION)/ +PKG_MD5SUM:=f7a24ed8fad122c4187d06bfd6f998b4 + +PKG_BUILD_PARALLEL:=0 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/aircrack-ng + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpthread +libopenssl +libpcap + TITLE:=next generation of aircrack with new features + URL:=http://www.aircrack-ng.org/ + SUBMENU:=wireless +endef + +define Package/aircrack-ng/description +Aircrack-ng is the next generation of aircrack with new features +endef + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) -Wall -Iinclude/ $(TARGET_CPPFLAGS) -D_REVISION=0" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + OSNAME=Linux \ + prefix="/usr" \ + sqlite="false" \ + unstable="true" + +define Package/aircrack-ng/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,aircrack-ng)) diff --git a/net/aircrack-ng/patches/100-add-ignore-channel-negative-1.patch b/net/aircrack-ng/patches/100-add-ignore-channel-negative-1.patch new file mode 100644 index 0000000..394a300 --- /dev/null +++ b/net/aircrack-ng/patches/100-add-ignore-channel-negative-1.patch @@ -0,0 +1,52 @@ +--- a/src/aireplay-ng.c ++++ b/src/aireplay-ng.c +@@ -200,7 +200,9 @@ char usage[] = + "\n" + " Miscellaneous options:\n" + "\n" +-" -R : disable /dev/rtc usage\n" ++" -R : disable /dev/rtc usage\n" ++" --ignore-negative-one : if the interface's channel can't be determined,\n" ++" ignore the mismatch, needed for unpatched cfg80211\n" + "\n" + " Attack modes (numbers can still be used):\n" + "\n" +@@ -268,6 +270,7 @@ struct options + int bittest; + + int nodetect; ++ int ignore_negative_one; + int rtc; + } + opt; +@@ -715,6 +718,13 @@ int attack_check(uchar* bssid, char* ess + + iface_chan = wi_get_channel(wi); + ++ if(iface_chan == -1 && !opt.ignore_negative_one) ++ { ++ PCT; printf("Couldn't determine current channel for %s, you should either force the operation with --ignore-negative-one or apply a kernel patch\n", ++ wi_get_ifname(wi)); ++ return -1; ++ } ++ + if(bssid != NULL) + { + ap_chan = wait_for_beacon(bssid, capa, essid); +@@ -723,7 +733,7 @@ int attack_check(uchar* bssid, char* ess + PCT; printf("No such BSSID available.\n"); + return -1; + } +- if(ap_chan != iface_chan) ++ if((ap_chan != iface_chan) && (iface_chan != -1 || !opt.ignore_negative_one)) + { + PCT; printf("%s is on channel %d, but the AP uses channel %d\n", wi_get_ifname(wi), iface_chan, ap_chan); + return -1; +@@ -5765,6 +5775,7 @@ int main( int argc, char *argv[] ) + {"help", 0, 0, 'H'}, + {"fast", 0, 0, 'F'}, + {"bittest", 0, 0, 'B'}, ++ {"ignore-negative-one", 0, &opt.ignore_negative_one, 1}, + {0, 0, 0, 0 } + }; + diff --git a/net/aircrack-ptw/Makefile b/net/aircrack-ptw/Makefile new file mode 100644 index 0000000..5dacde1 --- /dev/null +++ b/net/aircrack-ptw/Makefile @@ -0,0 +1,45 @@ +# +# 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:=aircrack-ptw +PKG_VERSION:=1.0.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.cdc.informatik.tu-darmstadt.de/aircrack-ptw/download +PKG_MD5SUM:=1d7d84d1e69189bc1397db3f565c183a + +include $(INCLUDE_DIR)/package.mk + +define Package/aircrack-ptw + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap + TITLE:=A tool using a new method for breaking WEP Keys + URL:=http://www.cdc.informatik.tu-darmstadt.de/aircrack-ptw/ + SUBMENU:=wireless +endef + +define Build/Configure +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) \ + $(TARGET_LDFLAGS) \ + -lpcap -o $(PKG_BUILD_DIR)/aircrack-ptw \ + $(PKG_BUILD_DIR)/aircrack-ptw.c \ + $(PKG_BUILD_DIR)/aircrack-ptw-lib.c +endef + +define Package/aircrack-ptw/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/aircrack-ptw $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,aircrack-ptw)) diff --git a/net/aircrack-ptw/patches/001-smaller.patch b/net/aircrack-ptw/patches/001-smaller.patch new file mode 100644 index 0000000..9dbf14b --- /dev/null +++ b/net/aircrack-ptw/patches/001-smaller.patch @@ -0,0 +1,12 @@ +diff -purN aircrack-ptw-1.0.0/aircrack-ptw.c aircrack-ptw-1.0.0_patch/aircrack-ptw.c +--- aircrack-ptw-1.0.0/aircrack-ptw.c 2007-04-03 08:50:42.000000000 -0400 ++++ aircrack-ptw-1.0.0_patch/aircrack-ptw.c 2007-04-07 16:50:38.000000000 -0400 +@@ -6,7 +6,7 @@ + + #include "aircrack-ptw-lib.h" + +-#define KEYLIMIT (1000000) ++#define KEYLIMIT (10000) + #define BSSIDLEN (6) + + typedef struct { diff --git a/net/airpwn/Makefile b/net/airpwn/Makefile new file mode 100644 index 0000000..9a47311 --- /dev/null +++ b/net/airpwn/Makefile @@ -0,0 +1,70 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=airpwn +PKG_RELEASE:=1 +PKG_VERSION:=1.3 + +PKG_SOURCE:=airpwn-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/airpwn +PKG_MD5SUM:=15b6f1cd287b4bb20dd586bb6c83628d + +PKG_BUILD_DEPENDS:=libnet1 libopenssl libpcap libpcre + +PKG_FIXUP:=autoreconf +PKG_LIBTOOL_PATHS:=. lorcon + +include $(INCLUDE_DIR)/package.mk + +define Package/airpwn + SECTION:=net + CATEGORY:=Network + SUBMENU:=wireless + TITLE:=Packet injection pwnage + DEPENDS:=+libnet1 +libopenssl +libpcap +libpcre +libpthread + URL:=http://airpwn.sourceforge.net/Airpwn.html +endef + +define Package/airpwn/description + Airpwn is a framework for 802.11 (wireless) packet injection. + Airpwn listens to incoming wireless packets, and if the data + matches a pattern specified in the config files, custom content + is injected "spoofed" from the wireless access point. From the + perspective of the wireless client, airpwn becomes the server. +endef + +CONFIGURE_VARS:= \ + CC="$(TARGET_CC)" \ + LD="$(TARGET_LD)" \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/lib/libnet-1.1.x/include -I$(STAGING_DIR)/usr/include -I$(PKG_BUILD_DIR)/lorcon" \ + LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib/libnet-1.1.x/lib -L$(PKG_BUILD_DIR)/lorcon/.libs -lcrypto -lssl" \ + LIBTOOL="$(STAGING_DIR)/host/bin/libtool" + +define Build/Configure + ( cd $(PKG_BUILD_DIR); tar -xzf lorcon-current.tgz; cd lorcon; \ + $(CONFIGURE_VARS) ./configure $(CONFIGURE_ARGS); \ + $(MAKE) -C $(PKG_BUILD_DIR)/lorcon $(CONFIGURE_VARS); cd ..; \ + $(CONFIGURE_VARS) ./configure $(CONFIGURE_ARGS) ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) $(CONFIGURE_VARS) +endef + +define Package/airpwn/install + $(INSTALL_DIR) $(1)/etc/airpwn + $(INSTALL_DATA) $(PKG_BUILD_DIR)/conf/* $(1)/etc/airpwn/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/airpwn $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lorcon/.libs/liborcon-1.0.0.so $(1)/usr/lib/ + ( cd $(1)/usr/lib; ln -s liborcon-1.0.0.so liborcon.so ) +endef + +$(eval $(call BuildPackage,airpwn)) diff --git a/net/amule/Makefile b/net/amule/Makefile new file mode 100644 index 0000000..ab1f8f1 --- /dev/null +++ b/net/amule/Makefile @@ -0,0 +1,86 @@ +# +# Copyright (C) 2007-2009 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:=aMule +PKG_VERSION:=2.2.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/amule +PKG_MD5SUM:=530d9b48187e36f78fc21bb19e94326d + +PKG_BUILD_DEPENDS:=libgd + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/amule + SUBMENU:=P2P + SECTION:=net + CATEGORY:=Network + TITLE:=A multi-platform eMule-like ed2k client + URL:=http://www.amule.org/ + DEPENDS:=+libpng +libpthread +libncurses +libreadline +libwxbase +libcryptoxx +endef + +CONFIGURE_ARGS+= \ + --enable-shared \ + --disable-static \ + --disable-rpath \ + --with-gnu-ld \ + --disable-ccache \ + --disable-debug \ + --disable-optimize \ + --disable-profile \ + --disable-monolithic \ + --enable-amule-daemon \ + --enable-amulecmd \ + --disable-amulecmdgui \ + --enable-webserver \ + --disable-webservergui \ + --disable-amule-gui \ + --disable-cas \ + --disable-wxcas \ + --disable-ed2k \ + --disable-alc \ + --disable-alcc \ + --disable-systray \ + --disable-utf8-systray \ + --enable-embedded-crypto \ + --enable-gsocket \ + --disable-gtktest \ + --disable-crypto \ + \ + --with-zlib="$(STAGING_DIR)/usr" \ + --with-gdlib-prefix="$(STAGING_DIR)/usr" \ + --with-libpng-prefix="$(STAGING_DIR)/usr" \ + --with-wx-prefix="$(STAGING_DIR)/usr" \ + --with-crypto-prefix="$(STAGING_DIR)/usr" \ + --with-libiconv-prefix="$(ICONV_PREFIX)" \ + --with-libintl-prefix="$(INTL_PREFIX)" \ + --without-x \ + +TARGET_LDFLAGS += \ + -liconv + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + HOSTCC="$(HOSTCC)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/amule/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amule{cmd,d,web} $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/amule $(1)/usr/share/ +endef + +$(eval $(call BuildPackage,amule)) diff --git a/net/amule/patches/001-no_backtrace.patch b/net/amule/patches/001-no_backtrace.patch new file mode 100644 index 0000000..7676235 --- /dev/null +++ b/net/amule/patches/001-no_backtrace.patch @@ -0,0 +1,98 @@ +Index: aMule-2.2.6/configure +=================================================================== +--- aMule-2.2.6.orig/configure 2012-07-28 23:50:12.000000000 +0200 ++++ aMule-2.2.6/configure 2012-07-28 23:50:51.000000000 +0200 +@@ -18375,93 +18375,6 @@ + + + +-# Check for bfd.h (to have proper backtraces without using wxExecute) +- +- echo "$as_me:$LINENO: checking for bfd" >&5 +-echo $ECHO_N "checking for bfd... $ECHO_C" >&6 +- result=no +- for bfd_ldadd in "" "${LIBINTL}"; do +- mule_backup_LIBS="$LIBS" +- mule_backup_LDFLAGS="$LDFLAGS" +- LIBS="-lbfd -liberty ${bfd_ldadd} ${ZLIB_LIBS} $LIBS" +- LDFLAGS="$LDFLAGS ${ZLIB_LDFLAGS}" +- cat >conftest.$ac_ext <<_ACEOF +- +- /* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +- #include +- #include +- +-int +-main () +-{ +- +- char *dummy = bfd_errmsg(bfd_get_error()); +- +- ; +- return 0; +-} +- +-_ACEOF +-rm -f conftest.$ac_objext conftest$ac_exeext +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest$ac_exeext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- +- result=yes +- BFD_CPPFLAGS="-DHAVE_BFD" +- BFD_LIBS="-lbfd -liberty ${bfd_ldadd}" +- LIBS="$mule_backup_LIBS" +- LDFLAGS="$mule_backup_LDFLAGS" +- break +- +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-fi +-rm -f conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- LIBS="$mule_backup_LIBS" +- LDFLAGS="$mule_backup_LDFLAGS" +- done +- +- echo "$as_me:$LINENO: result: $result" >&5 +-echo "${ECHO_T}$result" >&6 +- +- if test $result = no; then +- { echo "$as_me:$LINENO: WARNING: +- bfd.h not found or unusable, please install binutils development +- package if you are a developer or want to help testing aMule" >&5 +-echo "$as_me: WARNING: +- bfd.h not found or unusable, please install binutils development +- package if you are a developer or want to help testing aMule" >&2;} +- +-fi +- +- + echo "$as_me:$LINENO: checking for and backtrace()" >&5 + echo $ECHO_N "checking for and backtrace()... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF diff --git a/net/amwall/Makefile b/net/amwall/Makefile new file mode 100644 index 0000000..3acf3d4 --- /dev/null +++ b/net/amwall/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2006-2011 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:=amwall +PKG_VERSION:=0.1.0 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.amselinux.net/source/ +PKG_MD5SUM:=a8b6438e7fd9ccadc9f68824ae62349c + +include $(INCLUDE_DIR)/package.mk + +define Package/amwall + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libamsel + TITLE:=PF to iptables + URL:=http://www.amselinux.net/ + SUBMENU:=Firewall +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + V= \ + LDIR="$(PKG_BUILD_DIR)" \ + AMSEL_INCLUDE="$(STAGING_DIR)/usr/include" \ + OPT_LDFLAGS="$(TARGET_LDFLAGS)" \ + PREFIX="/usr" \ + CONFIG="$(PKG_BUILD_DIR)/etc/amsel" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + SHELL="/bin/bash" \ + all install +endef + +define Package/amwall/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/amsel + $(CP) $(PKG_INSTALL_DIR)/etc/amsel* $(1)/etc/ +endef + +define Package/amwall/conffiles +/etc/amsel/firewall.conf +endef + +$(eval $(call BuildPackage,amwall)) diff --git a/net/amwall/patches/010-compile_fix.patch b/net/amwall/patches/010-compile_fix.patch new file mode 100644 index 0000000..caa0b42 --- /dev/null +++ b/net/amwall/patches/010-compile_fix.patch @@ -0,0 +1,21 @@ +diff -ur amwall.old/grammar_en.y amwall.dev/grammar_en.y +--- amwall.old/grammar_en.y Sun May 23 17:17:54 2004 ++++ amwall.dev/grammar_en.y Sat Oct 14 17:21:28 2006 +@@ -651,7 +651,7 @@ + { + AMWALL_ADD_RULE("CONTINUE"); + } +- ++ ; + dnat : DNAT + { + switch(chain_type) { +@@ -667,7 +667,7 @@ + + AMWALL_ADD_RULE("DNAT"); + } +- ++ ; + drop : DROP + { + AMWALL_ADD_RULE("DROP"); diff --git a/net/aodv-uu/Makefile b/net/aodv-uu/Makefile new file mode 100644 index 0000000..4a7cd96 --- /dev/null +++ b/net/aodv-uu/Makefile @@ -0,0 +1,104 @@ +# +# Copyright (C) 2006-2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=aodv-uu +PKG_VERSION:=0.9.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://core.it.uu.se/core/files/ +PKG_MD5SUM:=05460543054449cb4b170252a7168c65 + +include $(INCLUDE_DIR)/package.mk + +define Package/aodv-uu/Default + TITLE:=Ad-hoc On-demand Distance Vector Routing + DEPENDS:=@BROKEN + URL:=http://core.it.uu.se/core/index.php/AODV-UU +endef + +define Package/aodv-uu/Default/description + AODV is the Ad-hoc On-demand Distance Vector routing protocol + implementation created at Uppsala University. +endef + +define Package/aodv-uu +$(call Package/aodv-uu/Default) + SECTION:=net + CATEGORY:=Network + TITLE+= (daemon) +endef + +define Package/aodv-uu/description +$(call Package/aodv-uu/Default/description) + This package contains the AODV userland daemon. +endef + +define KernelPackage/aodv-uu +$(call Package/aodv-uu/Default) + TITLE+= (kernel module) + FILES:=$(PKG_BUILD_DIR)/lnx/kaodv.$(LINUX_KMOD_SUFFIX) + SUBMENU:=Network Support + AUTOLOAD:=$(call AutoLoad,80,$(shell cat ./files/aodv-uu.modules)) +endef + +define KernelPackage/aodv-uu/description +$(call Package/aodv-uu/Default/description) + This package contains the AODV kernel module. +endef + +ifneq ($(CONFIG_LINUX_2_4),y) + define Build/Compile/linux26 + $(MAKE) -C $(LINUX_DIR) \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + PATCHLEVEL="$(LINUX_VERSION)" \ + KERNDIR="$(LINUX_DIR)" \ + SUBDIRS="$(PKG_BUILD_DIR)/lnx" \ + modules + endef +else + # We assume 2.4 builds are only for brcm-2.4 yet + define Build/Compile/linux24-brcm + $(call Build/Compile/Default,\ + KERNEL_DIR="$(LINUX_DIR)" \ + KCC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + kaodv-mips \ + ) + cp $(PKG_BUILD_DIR)/lnx/kaodv-mips.$(LINUX_KMOD_SUFFIX) $(PKG_BUILD_DIR)/lnx/kaodv.$(LINUX_KMOD_SUFFIX) + endef +endif + +define Build/Compile + $(call Build/Compile/linux26) + $(call Build/Compile/linux24-brcm) + $(call Build/Compile/Default,\ + KERNEL_DIR="$(LINUX_DIR)" \ + KCC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + aodvd \ + ) +endef + +define Package/aodv-uu/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/aodvd $(1)/usr/sbin +endef + +define Package/kmod-aodv-uu/install + $(INSTALL_DIR) $(1)/etc/modules.d + $(INSTALL_DATA) ./files/aodv-uu.modules $(1)/etc/modules.d/80-aodv-uu + $(INSTALL_DIR) $(1)/lib/modules/$(LINUX_VERSION) + $(CP) $(PKG_BUILD_DIR)/lnx/kaodv.$(LINUX_KMOD_SUFFIX) $(1)/lib/modules/$(LINUX_VERSION)/ +endef + +$(eval $(call BuildPackage,aodv-uu)) +$(eval $(call KernelPackage,aodv-uu)) diff --git a/net/aodv-uu/files/aodv-uu.modules b/net/aodv-uu/files/aodv-uu.modules new file mode 100644 index 0000000..809c4da --- /dev/null +++ b/net/aodv-uu/files/aodv-uu.modules @@ -0,0 +1 @@ +kaodv diff --git a/net/aodv-uu/patches/001-normalize.patch b/net/aodv-uu/patches/001-normalize.patch new file mode 100644 index 0000000..bdc6fda --- /dev/null +++ b/net/aodv-uu/patches/001-normalize.patch @@ -0,0 +1,64 @@ +Index: aodv-uu-0.9.3/lnx/Makefile +=================================================================== +--- aodv-uu-0.9.3.orig/lnx/Makefile 2007-06-04 13:22:19.859836128 +0200 ++++ aodv-uu-0.9.3/lnx/Makefile 2007-06-04 13:22:19.932825032 +0200 +@@ -30,7 +30,7 @@ + KCFLAGS=-Wall -Wno-strict-aliasing -O2 $(KDEFS) $(KINC) $(XDEFS) + KCFLAGS_ARM=-Wall -O2 -D__KERNEL__ -DMODULE -nostdinc $(shell $(ARM_CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp') -I$(KERNEL_INC) + KCFLAGS_MIPS=-Wall -mips2 -O2 -fno-pic -mno-abicalls -mlong-calls -G0 -msoft-float -D__KERNEL__ -DMODULE -nostdinc $(shell $(MIPS_CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp') -I$(KERNEL_INC) $(XDEFS) +- ++endif + .PHONY: clean clean-2.4 clean-2.6 indent default + + # Check for kernel version +@@ -89,5 +89,3 @@ + etags *.c *.h + indent: + indent -kr -i8 -ts8 -sob -l80 -ss -ncs *.c *.h +-endif +- +Index: aodv-uu-0.9.3/Makefile +=================================================================== +--- aodv-uu-0.9.3.orig/Makefile 2007-06-04 13:22:19.866835064 +0200 ++++ aodv-uu-0.9.3/Makefile 2007-06-04 13:22:19.932825032 +0200 +@@ -87,7 +87,7 @@ + mips: aodvd-mips kaodv-mips + + endian.h: +- $(CC) $(CFLAGS) -o endian endian.c ++ gcc -o endian endian.c + ./endian > endian.h + + $(OBJS): %.o: %.c Makefile +@@ -143,19 +143,18 @@ + @makedepend -Y./ -- $(DEFS) -- $(SRC) &>/dev/null + @makedepend -a -Y./ -- $(KDEFS) kaodv.c &>/dev/null + +-install: default +- install -s -m 755 aodvd /usr/sbin/aodvd +- @if [ ! -d /lib/modules/$(KERNEL)/aodv ]; then \ +- mkdir /lib/modules/$(KERNEL)/aodv; \ +- fi +- +- @echo "Installing kernel module in /lib/modules/$(KERNEL)/aodv/"; +- @if [ -f ./kaodv.ko ]; then \ +- install -m 644 kaodv.ko /lib/modules/$(KERNEL)/aodv/kaodv.ko; \ +- else \ +- install -m 644 kaodv.o /lib/modules/$(KERNEL)/aodv/kaodv.o; \ +- fi +- /sbin/depmod -a ++install: install-aodvd install-kaodv ++ ++install-aodvd: ++ @echo "Installing aodv in $(DESTDIR)/usr/sbin"; ++ install -d -m0755 $(DESTDIR)/usr/sbin/ ++ install -m0755 aodvd $(DESTDIR)/usr/sbin/aodvd ++ ++install-kaodv: ++ @echo "Installing kernel module in $(DESTDIR)/lib/modules/$(KERNEL)/"; ++ install -d -m0644 $(DESTDIR)/lib/modules/$(KERNEL)/ ++ install -m 644 lnx/kaodv.$(KMOD_SUFFIX) $(DESTDIR)/lib/modules/$(KERNEL)/kaodv.$(KMOD_SUFFIX); ++ + uninstall: + rm -f /usr/sbin/aodvd + rm -rf /lib/modules/$(KERNEL)/aodv diff --git a/net/aodv-uu/patches/002-linux_2.6.19_ip_route_me_harder_change.patch b/net/aodv-uu/patches/002-linux_2.6.19_ip_route_me_harder_change.patch new file mode 100644 index 0000000..638de87 --- /dev/null +++ b/net/aodv-uu/patches/002-linux_2.6.19_ip_route_me_harder_change.patch @@ -0,0 +1,49 @@ +Index: aodv-uu-0.9.3/lnx/kaodv-mod.c +=================================================================== +--- aodv-uu-0.9.3.orig/lnx/kaodv-mod.c 2007-06-04 13:22:19.830840536 +0200 ++++ aodv-uu-0.9.3/lnx/kaodv-mod.c 2007-06-04 13:22:20.130794936 +0200 +@@ -19,7 +19,7 @@ + * Author: Erik Nordström, + * + *****************************************************************************/ +-#include ++#include + #include + + #ifdef KERNEL26 +@@ -258,7 +258,11 @@ + if (!(*skb)) + return NF_STOLEN; + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) ++ ip_route_me_harder(skb, RTN_UNSPEC); ++#else + ip_route_me_harder(skb); ++#endif + } + break; + case NF_IP_POST_ROUTING: +Index: aodv-uu-0.9.3/lnx/kaodv-queue.c +=================================================================== +--- aodv-uu-0.9.3.orig/lnx/kaodv-queue.c 2007-06-04 13:22:19.837839472 +0200 ++++ aodv-uu-0.9.3/lnx/kaodv-queue.c 2007-06-04 13:22:20.130794936 +0200 +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -246,7 +247,11 @@ + if (!entry->skb) + goto next; + } ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) ++ ip_route_me_harder(&entry->skb, RTN_UNSPEC); ++#else + ip_route_me_harder(&entry->skb); ++#endif + + pkts++; + diff --git a/net/aodv-uu/patches/003-linux_2.6.19_security_netlink_recv_change.patch b/net/aodv-uu/patches/003-linux_2.6.19_security_netlink_recv_change.patch new file mode 100644 index 0000000..53d9064 --- /dev/null +++ b/net/aodv-uu/patches/003-linux_2.6.19_security_netlink_recv_change.patch @@ -0,0 +1,16 @@ +Index: aodv-uu-0.9.3/lnx/kaodv-netlink.c +=================================================================== +--- aodv-uu-0.9.3.orig/lnx/kaodv-netlink.c 2007-06-04 13:22:19.810843576 +0200 ++++ aodv-uu-0.9.3/lnx/kaodv-netlink.c 2007-06-04 13:22:20.326765144 +0200 +@@ -284,7 +284,11 @@ + /* RCV_SKB_FAIL(-EINVAL); */ + + #ifdef KERNEL26 ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) ++ if (security_netlink_recv(skb, CAP_NET_ADMIN)) ++# else + if (security_netlink_recv(skb)) ++# endif + RCV_SKB_FAIL(-EPERM); + #endif + //write_lock_bh(&queue_lock); diff --git a/net/aodv-uu/patches/004-linux_2.6.19_includes.patch b/net/aodv-uu/patches/004-linux_2.6.19_includes.patch new file mode 100644 index 0000000..8dc1adf --- /dev/null +++ b/net/aodv-uu/patches/004-linux_2.6.19_includes.patch @@ -0,0 +1,28 @@ +Index: aodv-uu-0.9.3/main.c +=================================================================== +--- aodv-uu-0.9.3.orig/main.c 2007-06-04 13:22:19.782847832 +0200 ++++ aodv-uu-0.9.3/main.c 2007-06-04 13:22:20.513736720 +0200 +@@ -26,6 +26,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +Index: aodv-uu-0.9.3/nl.c +=================================================================== +--- aodv-uu-0.9.3.orig/nl.c 2007-06-04 13:22:19.789846768 +0200 ++++ aodv-uu-0.9.3/nl.c 2007-06-04 13:22:20.513736720 +0200 +@@ -33,6 +33,10 @@ + #include + #include + #include ++#include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) ++#include ++#endif + + #include "defs.h" + #include "lnx/kaodv-netlink.h" diff --git a/net/aodv-uu/patches/005-linux_2.6.22_skbuff.patch b/net/aodv-uu/patches/005-linux_2.6.22_skbuff.patch new file mode 100644 index 0000000..0831c5f --- /dev/null +++ b/net/aodv-uu/patches/005-linux_2.6.22_skbuff.patch @@ -0,0 +1,164 @@ +Index: aodv-uu-0.9.3/lnx/kaodv-compat.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ aodv-uu-0.9.3/lnx/kaodv-compat.h 2007-06-17 02:49:46.844217144 +0200 +@@ -0,0 +1,15 @@ ++#ifndef __KAODV_COMPAT_H ++#define __KAODV_COMPAT_H ++ ++#include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) ++ ++#define ip_hdr(_skb) (_skb)->nh.iph ++#define skb_reset_network_header(_skb) do { \ ++ _skb->nh.iph = (struct iphdr *)_skb->data; \ ++ } while (0); ++ ++ ++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) */ ++ ++#endif +Index: aodv-uu-0.9.3/lnx/kaodv-ipenc.c +=================================================================== +--- aodv-uu-0.9.3.orig/lnx/kaodv-ipenc.c 2007-06-17 02:31:56.448941960 +0200 ++++ aodv-uu-0.9.3/lnx/kaodv-ipenc.c 2007-06-17 02:45:50.420159064 +0200 +@@ -64,7 +64,7 @@ + if (skb->sk != NULL) + skb_set_owner_w(nskb, skb->sk); + +- iph = skb->nh.iph; ++ iph = ip_hdr(skb); + + skb_put(nskb, sizeof(struct min_ipenc_hdr)); + +@@ -78,7 +78,8 @@ + skb = nskb; + + /* Update pointers */ +- iph = skb->nh.iph = (struct iphdr *)skb->data; ++ skb_reset_network_header(skb); ++ iph = (struct iphdr *)skb->data; + + ipe = (struct min_ipenc_hdr *)(skb->data + (iph->ihl << 2)); + +@@ -99,8 +100,8 @@ + + ip_send_check(iph); + +- if (skb->nh.iph->id == 0) +- ip_select_ident(skb->nh.iph, skb->dst, NULL); ++ if (ip_hdr(skb)->id == 0) ++ ip_select_ident(ip_hdr(skb), skb->dst, NULL); + + return skb; + } +@@ -108,9 +109,7 @@ + struct sk_buff *ip_pkt_decapsulate(struct sk_buff *skb) + { + struct min_ipenc_hdr *ipe; +- /* skb->nh.iph is probably not set yet */ +- struct iphdr *iph = skb->nh.iph; +- ++ struct iphdr *iph = ip_hdr(skb); + + ipe = (struct min_ipenc_hdr *)((char *)iph + (iph->ihl << 2)); + +@@ -123,8 +122,9 @@ + skb->len - (iph->ihl << 2) - sizeof(struct min_ipenc_hdr)); + + skb_trim(skb, skb->len - sizeof(struct min_ipenc_hdr)); +- +- skb->nh.iph = iph = (struct iphdr *)skb->data; ++ ++ skb_reset_network_header(skb); ++ iph = (struct iphdr *)skb->data; + + iph->tot_len = htons((ntohs(iph->tot_len) - sizeof(struct min_ipenc_hdr))); + ip_send_check(iph); +Index: aodv-uu-0.9.3/lnx/kaodv-ipenc.h +=================================================================== +--- aodv-uu-0.9.3.orig/lnx/kaodv-ipenc.h 2007-06-17 02:44:13.881835120 +0200 ++++ aodv-uu-0.9.3/lnx/kaodv-ipenc.h 2007-06-17 02:44:16.549429584 +0200 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include "kaodv-compat.h" + + #define IPPROTO_MIPE 55 + +Index: aodv-uu-0.9.3/lnx/kaodv-mod.c +=================================================================== +--- aodv-uu-0.9.3.orig/lnx/kaodv-mod.c 2007-06-17 02:43:33.776931992 +0200 ++++ aodv-uu-0.9.3/lnx/kaodv-mod.c 2007-06-17 02:43:39.008136728 +0200 +@@ -120,7 +120,7 @@ + const struct net_device *out, + int (*okfn) (struct sk_buff *)) + { +- struct iphdr *iph = (*skb)->nh.iph; ++ struct iphdr *iph = ip_hdr(*skb); + struct expl_entry e; + struct in_addr ifaddr, bcaddr; + int res = 0; +@@ -188,7 +188,7 @@ + if (is_gateway && iph->protocol == IPPROTO_MIPE && + iph->daddr == ifaddr.s_addr) { + ip_pkt_decapsulate(*skb); +- iph = (*skb)->nh.iph; ++ iph = ip_hdr(*skb); + return NF_ACCEPT; + } + /* Ignore packets generated locally or that are for this +Index: aodv-uu-0.9.3/lnx/kaodv-mod.h +=================================================================== +--- aodv-uu-0.9.3.orig/lnx/kaodv-mod.h 2007-06-17 02:44:32.498005032 +0200 ++++ aodv-uu-0.9.3/lnx/kaodv-mod.h 2007-06-17 02:44:34.662675952 +0200 +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include "kaodv-compat.h" + + /* Interface information */ + struct if_info { +Index: aodv-uu-0.9.3/lnx/kaodv-queue.c +=================================================================== +--- aodv-uu-0.9.3.orig/lnx/kaodv-queue.c 2007-06-17 02:45:01.513593992 +0200 ++++ aodv-uu-0.9.3/lnx/kaodv-queue.c 2007-06-17 02:45:11.534070648 +0200 +@@ -152,7 +152,7 @@ + { + int status = -EINVAL; + struct kaodv_queue_entry *entry; +- struct iphdr *iph = skb->nh.iph; ++ struct iphdr *iph = ip_hdr(skb); + + entry = kmalloc(sizeof(*entry), GFP_ATOMIC); + +Index: aodv-uu-0.9.3/lnx/kaodv-queue.h +=================================================================== +--- aodv-uu-0.9.3.orig/lnx/kaodv-queue.h 2007-06-17 02:44:50.537262648 +0200 ++++ aodv-uu-0.9.3/lnx/kaodv-queue.h 2007-06-17 02:44:53.629792512 +0200 +@@ -21,6 +21,7 @@ + *****************************************************************************/ + #ifndef _KAODV_QUEUE_H + #define _KAODV_QUEUE_H ++#include "kaodv-compat.h" + + #define KAODV_QUEUE_DROP 1 + #define KAODV_QUEUE_SEND 2 +Index: aodv-uu-0.9.3/lnx/kaodv-netlink.c +=================================================================== +--- aodv-uu-0.9.3.orig/lnx/kaodv-netlink.c 2007-06-17 02:47:48.927143264 +0200 ++++ aodv-uu-0.9.3/lnx/kaodv-netlink.c 2007-06-17 02:49:11.604574384 +0200 +@@ -338,8 +338,10 @@ + netlink_register_notifier(&kaodv_nl_notifier); + #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)) + kaodvnl = netlink_kernel_create(NETLINK_AODV, kaodv_netlink_rcv_sk); +-#else ++#elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)) + kaodvnl = netlink_kernel_create(NETLINK_AODV, AODVGRP_MAX, kaodv_netlink_rcv_sk, THIS_MODULE); ++#else ++ kaodvnl = netlink_kernel_create(NETLINK_AODV, AODVGRP_MAX, kaodv_netlink_rcv_sk, NULL, THIS_MODULE); + #endif + if (kaodvnl == NULL) { + printk(KERN_ERR "kaodv_netlink: failed to create netlink socket\n"); diff --git a/net/aoetools/Makefile b/net/aoetools/Makefile new file mode 100644 index 0000000..f2f7756 --- /dev/null +++ b/net/aoetools/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2007-2011 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:=aoetools +PKG_VERSION:=32 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/aoetools +PKG_MD5SUM:=62c8b5664d413019d0008f27ab5dc4d1 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/aoetools + SECTION:=net + CATEGORY:=Network + TITLE:=ATA over Ethernet tools + URL:=http://aoetools.sourceforge.net/ + DEPENDS:=+kmod-aoe +libpthread +endef + +define Package/aoetools/description + The aoetools are programs for users of the ATA over Ethernet (AoE) + network storage protocol, a simple protocol for using storage over an + ethernet LAN. The vblade program (storage target) exports a block + device using AoE. +endef + +CONFIGURE_ARGS += NPERSHELF=16 + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/sbin/aoe-{discover,flush,interfaces,mkdevs,mkshelf,revalidate,sancheck,stat,version} \ + $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/aoe{cfg,ping} $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/net/apache/Makefile b/net/apache/Makefile new file mode 100644 index 0000000..b1a1106 --- /dev/null +++ b/net/apache/Makefile @@ -0,0 +1,164 @@ +# +# Copyright (C) 2007-2011 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:=apache +PKG_VERSION:=2.2.15 +PKG_RELEASE:=3 +PKG_SOURCE_NAME:=httpd + +PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://ftp.uni-erlangen.de/pub/mirrors/apache/httpd/ \ + http://apache.imsam.info/httpd/ +PKG_MD5SUM:=016cec97337eccead2aad6a7c27f2e14 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION) + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/apache/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=The Apache Web Server + URL:=http://httpd.apache.org/ +endef + +define Package/apache/Default/description + The Apache Web Server is a powerful and flexible HTTP/1.1 compliant + web server. Originally designed as a replacement for the NCSA HTTP + Server, it has grown to be the most popular web server on the Internet. +endef + +define Package/apache +$(call Package/apache/Default) + DEPENDS:=+libapr +libaprutil +libpcre +libopenssl +unixodbc +endef + +define Package/apache/description +$(call Package/apache/Default/description) + . + This package contains the Apache web server and utility programs. + . + Take care that you don't include apache at the moment into your image + please select it only as module because busybox will override + /usr/sbin/httpd. It'll be solved soon. If you need to include this + package in the image anyway, remove httpd from busybox + (Base system --> Configuration --> Networking Utilities --> httpd). + Also you should take care for the initscripts, apache's httpd isn't + compatible with the one from busybox, so if you want to use apache + for running your webif, you'll need to change the parameters in the + scripts and configure the rest in /etc/httpd.conf. +endef + +define Package/apache/conffiles +/etc/apache/httpd.conf +/etc/apache/extra/httpd-autoindex.conf +/etc/apache/extra/httpd-dav.conf +/etc/apache/extra/httpd-default.conf +/etc/apache/extra/httpd-info.conf +/etc/apache/extra/httpd-languages.conf +/etc/apache/extra/httpd-manual.conf +/etc/apache/extra/httpd-mpm.conf +/etc/apache/extra/httpd-multilang-errordoc.conf +/etc/apache/extra/httpd-ssl.conf +/etc/apache/extra/httpd-userdir.conf +/etc/apache/extra/httpd-vhosts.conf +/etc/apache/magic +/etc/apache/mime.types +endef + +define Package/apache-icons +$(call Package/apache/Default) + TITLE:=Icons from Apache + DEPENDS:=apache +endef + +define Package/apache-icons/description +$(call Package/apache/Default/description) + . + This package contains the icons from Apache. +endef + +TARGET_CFLAGS += $(FPIC) +TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE + +define Build/Configure + $(call Build/Configure/Default, \ + --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \ + --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \ + --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \ + --enable-http \ + --enable-ssl \ + --enable-proxy \ + --disable-disk-cache \ + --enable-maintainer-mode \ + --enable-mime-magic \ + --without-suexec-bin \ + --sysconfdir=/etc/apache \ + ap_cv_void_ptr_lt_long=no \ + logfiledir="/var/log" \ + runtimedir="/var/run" \ + ) +endef + +define Build/InstallDev + rm -rf $(PKG_INSTALL_DIR)/usr/man/ \ + $(PKG_INSTALL_DIR)/usr/share/manual/ + # if you need docs take a look into the build-dir :) + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/* \ + $(1)/etc + $(INSTALL_DIR) $(1)/usr/include/apache + $(CP) $(PKG_INSTALL_DIR)/usr/include/* \ + $(1)/usr/include/apache + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \ + $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \ + $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/* \ + $(1)/usr/share +endef + +define Package/apache/preinst + rm /usr/sbin/httpd + echo -e "You should take a look in the initscripts, busybox's httpd \n\ + uses some parameters which are maybe unsupported by apache." +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_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/{error,htdocs,cgi-bin,build} $(1)/usr/share/ + $(INSTALL_DIR) $(1)/etc/apache + $(CP) $(PKG_INSTALL_DIR)/etc/apache/{httpd.conf,magic,mime.types,extra} $(1)/etc/apache/ +endef + +define Package/apache/postrm + rm -rf /usr/sbin/httpd + ln -s /bin/busybox /usr/sbin/httpd + echo -e "You may need to change your initscripts back for the use \n\ + with busybox's httpd." +endef + +define Package/apache-icons/install + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/ +endef + +$(eval $(call BuildPackage,apache)) +$(eval $(call BuildPackage,apache-icons)) diff --git a/net/apache/patches/001-Makefile_in.patch b/net/apache/patches/001-Makefile_in.patch new file mode 100644 index 0000000..0bccfd3 --- /dev/null +++ b/net/apache/patches/001-Makefile_in.patch @@ -0,0 +1,14 @@ +--- a/server/Makefile.in ++++ b/server/Makefile.in +@@ -26,7 +26,10 @@ gen_test_char: $(gen_test_char_OBJECTS) + $(LINK) $(EXTRA_LDFLAGS) $(gen_test_char_OBJECTS) $(EXTRA_LIBS) + + test_char.h: gen_test_char +- ./gen_test_char > test_char.h ++ true ++# ./gen_test_char > test_char.h ++# doesn't matter if you run it on the buildhost or on an wl500gd, ++# same output on both, so i just patched in the test_char.h :). + + util.lo: test_char.h + diff --git a/net/apache/patches/002-test_char_h.patch b/net/apache/patches/002-test_char_h.patch new file mode 100644 index 0000000..e8ea3cd --- /dev/null +++ b/net/apache/patches/002-test_char_h.patch @@ -0,0 +1,26 @@ +--- /dev/null ++++ b/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) ++#define T_ESCAPE_PATH_SEGMENT (2) ++#define T_OS_ESCAPE_PATH (4) ++#define T_HTTP_TOKEN_STOP (8) ++#define T_ESCAPE_LOGITEM (16) ++#define T_ESCAPE_FORENSIC (32) ++ ++static const unsigned char test_char_table[256] = { ++ 32,62,62,62,62,62,62,62,62,62,63,62,62,62,62,62,62,62,62,62, ++ 62,62,62,62,62,62,62,62,62,62,62,62,14,0,23,6,1,38,1,1, ++ 9,9,1,0,8,0,0,10,0,0,0,0,0,0,0,0,0,0,40,15, ++ 15,8,15,15,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++ 0,0,0,0,0,0,0,0,0,0,0,15,31,15,7,0,7,0,0,0, ++ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++ 0,0,0,15,39,15,1,62,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,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, ++ 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,54,54,54,54, ++ 54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54 ++}; diff --git a/net/apache/patches/003-logdir_fix.patch b/net/apache/patches/003-logdir_fix.patch new file mode 100644 index 0000000..635c65c --- /dev/null +++ b/net/apache/patches/003-logdir_fix.patch @@ -0,0 +1,33 @@ +--- a/build/mkconfNW.awk ++++ b/build/mkconfNW.awk +@@ -24,7 +24,7 @@ BEGIN { + A["sysconfdir"] = "conf" + A["iconsdir"] = "icons" + A["manualdir"] = "manual" +- A["runtimedir"] = "logs" ++ A["runtimedir"] = "log" + A["errordir"] = "error" + A["proxycachedir"] = "proxy" + +--- a/config.layout ++++ b/config.layout +@@ -28,8 +28,8 @@ + cgidir: ${datadir}/cgi-bin + includedir: ${prefix}/include + localstatedir: ${prefix} +- runtimedir: ${localstatedir}/logs +- logfiledir: ${localstatedir}/logs ++ runtimedir: ${localstatedir}/log ++ logfiledir: ${localstatedir}/log + proxycachedir: ${localstatedir}/proxy + + +@@ -150,7 +150,7 @@ + includedir: ${prefix}/include + localstatedir: /var${prefix} + runtimedir: ${localstatedir}/run +- logfiledir: ${localstatedir}/logs ++ logfiledir: ${localstatedir}/log + proxycachedir: ${localstatedir}/proxy + + diff --git a/net/apache/patches/004-pidfile_fix.patch b/net/apache/patches/004-pidfile_fix.patch new file mode 100644 index 0000000..e9f0b6d --- /dev/null +++ b/net/apache/patches/004-pidfile_fix.patch @@ -0,0 +1,11 @@ +--- a/include/scoreboard.h ++++ b/include/scoreboard.h +@@ -42,7 +42,7 @@ extern "C" { + + /* Scoreboard file, if there is one */ + #ifndef DEFAULT_SCOREBOARD +-#define DEFAULT_SCOREBOARD "logs/apache_runtime_status" ++#define DEFAULT_SCOREBOARD "log/apache_runtime_status" + #endif + + /* Scoreboard info on a process is, for now, kept very brief --- diff --git a/net/apache/patches/005-httpd_conf.patch b/net/apache/patches/005-httpd_conf.patch new file mode 100644 index 0000000..60f0dca --- /dev/null +++ b/net/apache/patches/005-httpd_conf.patch @@ -0,0 +1,60 @@ +--- a/docs/conf/httpd.conf.in ++++ b/docs/conf/httpd.conf.in +@@ -51,7 +51,6 @@ Listen @@Port@@ + # Example: + # LoadModule foo_module modules/mod_foo.so + # +-@@LoadModule@@ + + + +@@ -63,8 +62,8 @@ Listen @@Port@@ + # It is usually good practice to create a dedicated user and group for + # running httpd, as with most system services. + # +-User daemon +-Group daemon ++User nobody ++Group nogroup + + + +@@ -191,7 +190,7 @@ ErrorLog "@rel_logfiledir@/error_log" + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + # +-LogLevel warn ++LogLevel debug + + + # +@@ -336,7 +335,7 @@ DefaultType text/plain + # contents of the file itself to determine its type. The MIMEMagicFile + # directive tells the module where the hint definitions are located. + # +-#MIMEMagicFile @rel_sysconfdir@/magic ++MIMEMagicFile @rel_sysconfdir@/magic + + # + # Customizable error responses come in three flavors: +@@ -358,7 +357,7 @@ DefaultType text/plain + # broken on your system. + # + #EnableMMAP off +-#EnableSendfile off ++EnableSendfile off + + # Supplemental configuration + # +@@ -404,7 +403,7 @@ DefaultType text/plain + # starting without SSL on platforms with no /dev/random equivalent + # but a statically compiled-in mod_ssl. + # +- +-SSLRandomSeed startup builtin +-SSLRandomSeed connect builtin +- ++# ++#SSLRandomSeed startup builtin ++#SSLRandomSeed connect builtin ++# diff --git a/net/apcupsd/Makefile b/net/apcupsd/Makefile new file mode 100644 index 0000000..d7bf85a --- /dev/null +++ b/net/apcupsd/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (C) 2006-2011 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:=apcupsd +PKG_VERSION:=3.14.7 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/apcupsd +PKG_MD5SUM:=bb2f8e4fc6b2f5d7b3e236eb57b81640 + +include $(INCLUDE_DIR)/package.mk + +define Package/apcupsd + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libpthread +libusb + TITLE:=UPS control software + URL:=http://www.apcupsd.org/ +endef + +define Build/Configure + $(CP) $(SCRIPT_DIR)/config.* $(PKG_BUILD_DIR)/autoconf/ + $(call Build/Configure/Default, \ + --with-distname=unknown \ + --sysconfdir=/etc/apcupsd \ + --enable-usb \ + --without-x \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + LD="$(TARGET_CC)" \ + all install +endef + +define Package/apcupsd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcupsd $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smtp $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apctest $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcaccess $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/apcupsd + $(INSTALL_CONF) ./files/apcupsd.conf $(1)/etc/apcupsd/ + $(INSTALL_CONF) ./files/apcupsd_mail.conf $(1)/etc/apcupsd/ + $(INSTALL_BIN) ./files/changeme $(1)/etc/apcupsd/ + $(INSTALL_BIN) ./files/commfailure $(1)/etc/apcupsd/ + $(INSTALL_BIN) ./files/commok $(1)/etc/apcupsd/ + $(INSTALL_BIN) ./files/offbattery $(1)/etc/apcupsd/ + $(INSTALL_BIN) ./files/onbattery $(1)/etc/apcupsd/ + $(INSTALL_BIN) ./files/apccontrol $(1)/etc/apcupsd/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/apcupsd.init $(1)/etc/init.d/apcupsd +endef + +define Package/apcupsd/conffiles +/etc/apcupsd/apcupsd.conf +/etc/apcupsd/apcupsd_mail.conf +/etc/apcupsd/changeme +/etc/apcupsd/commfailure +/etc/apcupsd/commok +/etc/apcupsd/offbattery +/etc/apcupsd/onbattery +endef + +$(eval $(call BuildPackage,apcupsd)) diff --git a/net/apcupsd/files/apccontrol b/net/apcupsd/files/apccontrol new file mode 100644 index 0000000..2549354 --- /dev/null +++ b/net/apcupsd/files/apccontrol @@ -0,0 +1,146 @@ +#!/bin/sh +# +# Copyright (C) 1999-2002 Riccardo Facchetti +# +# for apcupsd release 3.14.1 (04 May 2007) - unknown +# +# platforms/apccontrol. Generated from apccontrol.in by configure. +# +# Note, this is a generic file that can be used by most +# systems. If a particular system needs to have something +# special, start with this file, and put a copy in the +# platform subdirectory. +# + +# +# These variables are needed for set up the autoconf other variables. +# +prefix=/usr +exec_prefix=/usr + +APCPID=/var/run/apcupsd.pid +APCUPSD=/usr/sbin/apcupsd +SHUTDOWN=/sbin/shutdown +SCRIPTSHELL=/bin/sh +SCRIPTDIR=/etc/apcupsd +WALL=true + +# +# Concatenate all output from this script to the events file +# Note, the following kills the script in a power fail situation +# where the disks are mounted read-only. +# exec >>/var/log/apcupsd.events 2>&1 + +# +# This piece is to substitute the default behaviour with your own script, +# perl, or C program. +# You can customize every single command creating an executable file (may be a +# script or a compiled program) and calling it the same as the $1 parameter +# passed by apcupsd to this script. +# +# After executing your script, apccontrol continues with the default action. +# If you do not want apccontrol to continue, exit your script with exit +# code 99. E.g. "exit 99". +# +# WARNING: the apccontrol file will be overwritten every time you update your +# apcupsd, doing `make install'. Your own customized scripts will _not_ be +# overwritten. If you wish to make changes to this file (discouraged), you +# should change apccontrol.sh.in and then rerun the configure process. +# +if [ -f ${SCRIPTDIR}/${1} -a -x ${SCRIPTDIR}/${1} ] +then + ${SCRIPTDIR}/${1} ${2} ${3} ${4} + # exit code 99 means he does not want us to do default action + if [ $? = 99 ] ; then + exit 0 + fi +fi + +case "$1" in + killpower) + echo "Apccontrol doing: ${APCUPSD} --killpower on UPS ${2}" + sleep 10 + ${APCUPSD} --killpower + echo "Apccontrol has done: ${APCUPSD} --killpower on UPS ${2}" | ${WALL} + ;; + commfailure) + echo "Warning communications lost with UPS ${2}" | ${WALL} + ;; + commok) + echo "Communications restored with UPS ${2}" | ${WALL} + ;; +# +# powerout, onbattery, offbattery, mainsback events occur +# in that order. +# + powerout) + echo "Warning power loss detected on UPS ${2}" | ${WALL} + ;; + onbattery) + echo "Power failure on UPS ${2}. Running on batteries." | ${WALL} + ;; + offbattery) + ;; + mainsback) + echo "Power has returned on UPS ${2}..." | ${WALL} + if [ -f /etc/powerfail ] ; then + printf "Continuing with shutdown." | ${WALL} + fi + ;; + failing) + echo "Battery power exhaused on UPS ${2}. Doing shutdown." | ${WALL} + ;; + timeout) + echo "Battery time limit exceeded on UPS ${2}. Doing shutdown." | ${WALL} + ;; + loadlimit) + echo "Remaining battery charge below limit on UPS ${2}. Doing shutdown." | ${WALL} + ;; + runlimit) + echo "Remaining battery runtime below limit on UPS ${2}. Doing shutdown." | ${WALL} + ;; + doreboot) + echo "UPS ${2} initiating Reboot Sequence" | ${WALL} + ${SHUTDOWN} -r now "apcupsd UPS ${2} initiated reboot" + ;; + doshutdown) + echo "UPS ${2} initiated Shutdown Sequence" | ${WALL} + ${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown" + ;; + annoyme) + echo "Power problems with UPS ${2}. Please logoff." | ${WALL} + ;; + emergency) + echo "Emergency Shutdown. Possible battery failure on UPS ${2}." | ${WALL} + ;; + changeme) + echo "Emergency! Batteries have failed on UPS ${2}. Change them NOW" | ${WALL} + ;; + remotedown) + echo "Remote Shutdown. Beginning Shutdown Sequence." | ${WALL} + ;; + restartme) + echo -n "Restarting APCUPSD Power Management: " + THEPID=`cat ${APCPID}` + kill ${THEPID} + rm -f ${APCPID} + rm -f /etc/powerfail + rm -f /etc/nologin + sleep 5 + `${APCUPSD}` + echo "apcupsd" + ;; + startselftest) + ;; + endselftest) + ;; + battdetach) + ;; + battattach) + ;; + *) echo "Usage: ${0##*/} command" + echo " warning: this script is intended to be launched by" + echo " apcupsd and should never be launched by users." + exit 1 + ;; +esac diff --git a/net/apcupsd/files/apcupsd.conf b/net/apcupsd/files/apcupsd.conf new file mode 100644 index 0000000..b9acd61 --- /dev/null +++ b/net/apcupsd/files/apcupsd.conf @@ -0,0 +1,322 @@ +## apcupsd.conf v1.1 ## +# +# for apcupsd release 3.14.1 (04 May 2007) - unknown +# +# "apcupsd" POSIX config file + +# +# ========= General configuration parameters ============ +# + +# UPSNAME xxx +# Use this to give your UPS a name in log files and such. This +# is particulary useful if you have multiple UPSes. This does not +# set the EEPROM. It should be 8 characters or less. +UPSNAME ups1 + +# UPSCABLE +# Defines the type of cable connecting the UPS to your computer. +# +# Possible generic choices for are: +# simple, smart, ether, usb +# +# Or a specific cable model number may be used: +# 940-0119A, 940-0127A, 940-0128A, 940-0020B, +# 940-0020C, 940-0023A, 940-0024B, 940-0024C, +# 940-1524C, 940-0024G, 940-0095A, 940-0095B, +# 940-0095C, M-04-02-2000 +# +UPSCABLE smart + +# To get apcupsd to work, in addition to defining the cable +# above, you must also define a UPSTYPE, which corresponds to +# the type of UPS you have (see the Description for more details). +# You must also specify a DEVICE, sometimes referred to as a port. +# For USB UPSes, please leave the DEVICE directive blank. For +# other UPS types, you must specify an appropriate port or address. +# +# UPSTYPE DEVICE Description +# apcsmart /dev/tty** Newer serial character device, +# appropriate for SmartUPS models using +# a serial cable (not USB). +# +# usb Most new UPSes are USB. A blank DEVICE +# setting enables autodetection, which is +# the best choice for most installations. +# +# net hostname:port Network link to a master apcupsd +# through apcupsd's Network Information +# Server. This is used if you don't have +# a UPS directly connected to your computer. +# +# snmp hostname:port:vendor:community +# SNMP Network link to an SNMP-enabled +# UPS device. Vendor is the MIB used by +# the UPS device: can be "APC", "APC_NOTRAP" +# or "RFC" where APC is the powernet MIB, +# "APC_NOTRAP" is powernet with SNMP trap +# catching disabled, and RFC is the IETF's +# rfc1628 UPS-MIB. You usually want "APC". +# Port is usually 161. Community is usually +# "private". +# +# dumb /dev/tty** Old serial character device for use +# with simple-signaling UPSes. +# +# pcnet ipaddr:username:passphrase +# PowerChute Network Shutdown protocol +# which can be used as an alternative to SNMP +# with AP9617 family of smart slot cards. +# ipaddr is the IP address of the UPS mgmt +# card. username and passphrase are the +# credentials for which the card has been +# configured. +# +UPSTYPE apcsmart +DEVICE /dev/ttyS0 + + +# LOCKFILE +# Path for device lock file. Not used on Win32. +LOCKFILE /var/lock + +# SCRIPTDIR +# Directory in which apccontrol and event scripts are located. +SCRIPTDIR /etc/apcupsd + +# PWRFAILDIR +# Directory in which to write the powerfail flag file. This file +# is created when apcupsd initiates a system shutdown and is +# checked in the OS halt scripts to determine if a killpower +# (turning off UPS output power) is required. +PWRFAILDIR /etc + +# NOLOGINDIR +# Directory in which to write the nologin file. The existence +# of this flag file tells the OS to disallow new logins. +NOLOGINDIR /etc + + +# +# ======== Configuration parameters used during power failures ========== +# + +# The ONBATTERYDELAY is the time in seconds from when a power failure +# is detected until we react to it with an onbattery event. +# +# This means that, apccontrol will be called with the powerout argument +# immediately when a power failure is detected. However, the +# onbattery argument is passed to apccontrol only after the +# ONBATTERYDELAY time. If you don't want to be annoyed by short +# powerfailures, make sure that apccontrol powerout does nothing +# i.e. comment out the wall. +#ONBATTERYDELAY 6 + +# +# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so +# the first that occurs will cause the initation of a shutdown. +# + +# If during a power failure, the remaining battery percentage +# (as reported by the UPS) is below or equal to BATTERYLEVEL, +# apcupsd will initiate a system shutdown. +BATTERYLEVEL 5 + +# If during a power failure, the remaining runtime in minutes +# (as calculated internally by the UPS) is below or equal to MINUTES, +# apcupsd, will initiate a system shutdown. +MINUTES 3 + +# If during a power failure, the UPS has run on batteries for TIMEOUT +# many seconds or longer, apcupsd will initiate a system shutdown. +# A value of 0 disables this timer. +# +# Note, if you have a Smart UPS, you will most likely want to disable +# this timer by setting it to zero. That way, you UPS will continue +# on batteries until either the % charge remaing drops to or below BATTERYLEVEL, +# or the remaining battery runtime drops to or below MINUTES. Of course, +# if you are testing, setting this to 60 causes a quick system shutdown +# if you pull the power plug. +# If you have an older dumb UPS, you will want to set this to less than +# the time you know you can run on batteries. +TIMEOUT 0 + +# Time in seconds between annoying users to signoff prior to +# system shutdown. 0 disables. +ANNOY 300 + +# Initial delay after power failure before warning users to get +# off the system. +ANNOYDELAY 60 + +# The condition which determines when users are prevented from +# logging in during a power failure. +# NOLOGON [ disable | timeout | percent | minutes | always ] +NOLOGON disable + +# If KILLDELAY is non-zero, apcupsd will continue running after a +# shutdown has been requested, and after the specified time in +# seconds attempt to kill the power. This is for use on systems +# where apcupsd cannot regain control after a shutdown. +# KILLDELAY 0 disables +KILLDELAY 0 + +# +# ==== Configuration statements for Network Information Server ==== +# + +# NETSERVER [ on | off ] on enables, off disables the network +# information server. If netstatus is on, a network information +# server process will be started for serving the STATUS and +# EVENT data over the network (used by CGI programs). +NETSERVER on + +# NISIP +# IP address on which NIS server will listen for incoming connections. +# This is useful if your server is multi-homed (has more than one +# network interface and IP address). Default value is 0.0.0.0 which +# means any incoming request will be serviced. Alternatively, you can +# configure this setting to any specific IP address of your server and +# NIS will listen for connections only on that interface. Use the +# loopback address (127.0.0.1) to accept connections only from the +# local machine. +NISIP 0.0.0.0 + +# NISPORT default is 3551 as registered with the IANA +# port to use for sending STATUS and EVENTS data over the network. +# It is not used unless NETSERVER is on. If you change this port, +# you will need to change the corresponding value in the cgi directory +# and rebuild the cgi programs. +NISPORT 3551 + +# If you want the last few EVENTS to be available over the network +# by the network information server, you must define an EVENTSFILE. +EVENTSFILE /var/log/apcupsd.events + +# EVENTSFILEMAX +# By default, the size of the EVENTSFILE will be not be allowed to exceed +# 10 kilobytes. When the file grows beyond this limit, older EVENTS will +# be removed from the beginning of the file (first in first out). The +# parameter EVENTSFILEMAX can be set to a different kilobyte value, or set +# to zero to allow the EVENTSFILE to grow without limit. +EVENTSFILEMAX 10 + +# +# ========== Configuration statements used if sharing ============= +# a UPS with more than one machine + +# NETTIME +# Interval (in seconds) at which the NIS client polls the server. +# Used only when this apcupsd is a network client (UPSTYPE net). +#NETTIME 60 + +# +# Remaining items are for ShareUPS (APC expansion card) ONLY +# + +# UPSCLASS [ standalone | shareslave | sharemaster ] +# Normally standalone unless you share an UPS using an APC ShareUPS +# card. +UPSCLASS standalone + +# UPSMODE [ disable | share ] +# Normally disable unless you share an UPS using an APC ShareUPS card. +UPSMODE disable + +# +# ===== Configuration statements to control apcupsd system logging ======== +# + +# Time interval in seconds between writing the STATUS file; 0 disables +STATTIME 0 + +# Location of STATUS file (written to only if STATTIME is non-zero) +STATFILE /var/log/apcupsd.status + +# LOGSTATS [ on | off ] on enables, off disables +# Note! This generates a lot of output, so if +# you turn this on, be sure that the +# file defined in syslog.conf for LOG_NOTICE is a named pipe. +# You probably do not want this on. +LOGSTATS off + +# Time interval in seconds between writing the DATA records to +# the log file. 0 disables. +DATATIME 0 + +# FACILITY defines the logging facility (class) for logging to syslog. +# If not specified, it defaults to "daemon". This is useful +# if you want to separate the data logged by apcupsd from other +# programs. +#FACILITY DAEMON + +# +# ========== Configuration statements used in updating the UPS EPROM ========= +# + +# +# These statements are used only by apctest when choosing "Set EEPROM with conf +# file values" from the EEPROM menu. THESE STATEMENTS HAVE NO EFFECT ON APCUPSD. +# + +# UPS name, max 8 characters +#UPSNAME UPS_IDEN + +# Battery date - 8 characters +#BATTDATE mm/dd/yy + +# Sensitivity to line voltage quality (H cause faster transfer to batteries) +# SENSITIVITY H M L (default = H) +#SENSITIVITY H + +# UPS delay after power return (seconds) +# WAKEUP 000 060 180 300 (default = 0) +#WAKEUP 60 + +# UPS Grace period after request to power off (seconds) +# SLEEP 020 180 300 600 (default = 20) +#SLEEP 180 + +# Low line voltage causing transfer to batteries +# The permitted values depend on your model as defined by last letter +# of FIRMWARE or APCMODEL. Some representative values are: +# D 106 103 100 097 +# M 177 172 168 182 +# A 092 090 088 086 +# I 208 204 200 196 (default = 0 => not valid) +#LOTRANSFER 208 + +# High line voltage causing transfer to batteries +# The permitted values depend on your model as defined by last letter +# of FIRMWARE or APCMODEL. Some representative values are: +# D 127 130 133 136 +# M 229 234 239 224 +# A 108 110 112 114 +# I 253 257 261 265 (default = 0 => not valid) +#HITRANSFER 253 + +# Battery charge needed to restore power +# RETURNCHARGE 00 15 50 90 (default = 15) +#RETURNCHARGE 15 + +# Alarm delay +# 0 = zero delay after pwr fail, T = power fail + 30 sec, L = low battery, N = never +# BEEPSTATE 0 T L N (default = 0) +#BEEPSTATE T + +# Low battery warning delay in minutes +# LOWBATT 02 05 07 10 (default = 02) +#LOWBATT 2 + +# UPS Output voltage when running on batteries +# The permitted values depend on your model as defined by last letter +# of FIRMWARE or APCMODEL. Some representative values are: +# D 115 +# M 208 +# A 100 +# I 230 240 220 225 (default = 0 => not valid) +#OUTPUTVOLTS 230 + +# Self test interval in hours 336=2 weeks, 168=1 week, ON=at power on +# SELFTEST 336 168 ON OFF (default = 336) +#SELFTEST 336 diff --git a/net/apcupsd/files/apcupsd.init b/net/apcupsd/files/apcupsd.init new file mode 100644 index 0000000..5454377 --- /dev/null +++ b/net/apcupsd/files/apcupsd.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 +STOP=50 + +start() { + /usr/sbin/apcupsd -f /etc/apcupsd/apcupsd.conf +} + +stop() { + kill $(cat /var/run/apcupsd.pid) +} diff --git a/net/apcupsd/files/apcupsd_mail.conf b/net/apcupsd/files/apcupsd_mail.conf new file mode 100644 index 0000000..51206c7 --- /dev/null +++ b/net/apcupsd/files/apcupsd_mail.conf @@ -0,0 +1,7 @@ +#!/bin/sh + +MAILPROG="/usr/sbin/smtp" +MAILHOST="mail:25" +FROM="OpenWrt" +TO="apcups@example.com" +HOSTNAME="OpenWrt" \ No newline at end of file diff --git a/net/apcupsd/files/changeme b/net/apcupsd/files/changeme new file mode 100644 index 0000000..bcf448a --- /dev/null +++ b/net/apcupsd/files/changeme @@ -0,0 +1,17 @@ +#!/bin/sh +# +# This shell script if placed in /etc/apcupsd +# will be called by /etc/apcupsd/apccontrol when apcupsd +# detects that the battery should be replaced. +# We send an email message to root to notify him. +# +. /etc/apcupsd/apcupsd_mail.conf + +MSG="$HOSTNAME UPS battery needs changing NOW." +# +( + echo "$MSG" + echo " " + /usr/sbin/apcaccess status +) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO +exit 0 diff --git a/net/apcupsd/files/commfailure b/net/apcupsd/files/commfailure new file mode 100644 index 0000000..b899195 --- /dev/null +++ b/net/apcupsd/files/commfailure @@ -0,0 +1,17 @@ +#!/bin/sh +# +# This shell script if placed in /etc/apcupsd +# will be called by /etc/apcupsd/apccontrol when apcupsd +# loses contact with the UPS (i.e. the serial connection is not responding). +# We send an email message to root to notify him. +# +. /etc/apcupsd/apcupsd_mail.conf + +MSG="$HOSTNAME Communications with UPS lost" +# +( + echo "$MSG" + echo " " + /usr/sbin/apcaccess status +) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO +exit 0 diff --git a/net/apcupsd/files/commok b/net/apcupsd/files/commok new file mode 100644 index 0000000..cd5d1c6 --- /dev/null +++ b/net/apcupsd/files/commok @@ -0,0 +1,17 @@ +#!/bin/sh +# +# This shell script if placed in /etc/apcupsd +# will be called by /etc/apcupsd/apccontrol when apcupsd +# restores contact with the UPS (i.e. the serial connection is restored). +# We send an email message to root to notify him. +# +. /etc/apcupsd/apcupsd_mail.conf + +MSG="$HOSTNAME Communications with UPS restored" +# +( + echo "$MSG" + echo " " + /usr/sbin/apcaccess status +) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO +exit 0 diff --git a/net/apcupsd/files/offbattery b/net/apcupsd/files/offbattery new file mode 100644 index 0000000..22c0b98 --- /dev/null +++ b/net/apcupsd/files/offbattery @@ -0,0 +1,17 @@ +#!/bin/sh +# +# This shell script if placed in /etc/apcupsd +# will be called by /etc/apcupsd/apccontrol when the +# UPS goes back on to the mains after a power failure. +# We send an email message to root to notify him. +# +. /etc/apcupsd/apcupsd_mail.conf + +MSG="$HOSTNAME Power has returned" +# +( + echo "$MSG" + echo " " + /usr/sbin/apcaccess status +) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO +exit 0 diff --git a/net/apcupsd/files/onbattery b/net/apcupsd/files/onbattery new file mode 100644 index 0000000..ee5f653 --- /dev/null +++ b/net/apcupsd/files/onbattery @@ -0,0 +1,17 @@ +#!/bin/sh +# +# This shell script if placed in /etc/apcupsd +# will be called by /etc/apcupsd/apccontrol when the UPS +# goes on batteries. +# We send an email message to root to notify him. +# +. /etc/apcupsd/apcupsd_mail.conf + +MSG="$HOSTNAME Power Failure !!!" +# +( + echo "$MSG" + echo " " + /usr/sbin/apcaccess status +) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO +exit 0 diff --git a/net/apcupsd/patches/010-fix-include-paths.patch b/net/apcupsd/patches/010-fix-include-paths.patch new file mode 100644 index 0000000..2151544 --- /dev/null +++ b/net/apcupsd/patches/010-fix-include-paths.patch @@ -0,0 +1,13 @@ +diff --git a/autoconf/variables.mak.in b/autoconf/variables.mak.in +index b67e467..6022434 100644 +--- a/autoconf/variables.mak.in ++++ b/autoconf/variables.mak.in +@@ -65,7 +65,7 @@ DRVLIBS = @PTHREAD_LFLAGS@ @DRVLIBS@ + X_LIBS = @X_LIBS@ + X_EXTRA_LIBS = @X_EXTRA_LIBS@ + +-CPPFLAGS = @CPPFLAGS@ -I$(topdir)/include $(EXTRAINCS) ++CPPFLAGS = -I$(topdir)/include @CPPFLAGS@ $(EXTRAINCS) + CFLAGS = $(CPPFLAGS) @CFLAGS@ @PTHREAD_CFLAGS@ + CXXFLAGS = $(CPPFLAGS) @CXXFLAGS@ @PTHREAD_CFLAGS@ + LDFLAGS = @LDFLAGS@ diff --git a/net/apf/Makefile b/net/apf/Makefile new file mode 100644 index 0000000..89e46aa --- /dev/null +++ b/net/apf/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2011 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:=apf +PKG_VERSION:=0.8.4 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://gray-world.net/projects/af/ +PKG_MD5SUM:=4411785b05ec59e955152fe4e61705b1 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +CONFIGURE_VARS += \ + LDFLAGS="$$$$LDFLAGS -lcrypto -lssl -lz" + +define Package/apf + SECTION:=net + CATEGORY:=Network + TITLE:=Active port forwarder + URL:=http://gray-world.net/pr_af.shtml + DEPENDS:=+libopenssl +libpthread +endef + +define Package/apf/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/af{client,server} $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/afclient_example.conf $(1)/etc/afclient.conf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/afserver_example.conf $(1)/etc/afserver.conf +endef + +define Package/apf/conffiles +/etc/afclient.conf +/etc/afserver.conf +endef + +$(eval $(call BuildPackage,apf)) diff --git a/net/appweb/Makefile b/net/appweb/Makefile new file mode 100644 index 0000000..9652c96 --- /dev/null +++ b/net/appweb/Makefile @@ -0,0 +1,104 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# Copyright (C) 2009 Embedthis Software +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# Commercial and other licenses are available from http://www.embedthis.com/. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=appweb +PKG_RELEASE:=1 + +# +# Build stable +# +PKG_VERSION:=3.2.2-1 +PKG_SOURCE:=$(PKG_NAME)-src-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.appwebserver.org/software/ +PKG_MD5SUM:=060d43c8194fa6a119cada966fc807a7 + +# +# Build the latest snapshot from the default trunk +# +#PKG_VERSION:=default +#PKG_SOURCE:=tip.tar.gz +#PKG_SOURCE_URL:= http://hg.embedthis.com/appweb/archive/ +#PKG_MD5SUM:= + +include $(INCLUDE_DIR)/package.mk + +# The files in the .tar.gz are +# src/all/... +# src/build/... +# src/test/... +# and so on +# +# What we want is +# $(PKG_BUILD_DIR)/all/... +# $(PKG_BUILD_DIR)/build/... +# $(PKG_BUILD_DIR)/test/... +# and so on +# +# The following two lines make this happen +# 1. change tar option to strip out the top-level, src in +# this case +# 2. change the tar output to the build directory. The +# original tar command was +# $(HOST_TAR) -C/.. $(1) $(TAR_OPTIONS) + +TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS) +TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS) + +define Package/appweb + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=Appweb Web Server + URL:=http://www.appwebserver.org/ + DEPENDS:=@!avr32 +libpthread +endef + +define Package/appweb/description + Appweb is a powerful, compact embedded web server designed for dynamic web + applications. +endef + +CONFIGURE_ARGS += \ + -q \ + --defaults=release \ + --shared \ + --tune=size \ + --without-php \ + --without-ssl \ + --disable-angel \ + --disable-samples \ + --disable-access-log \ + --disable-complete-native \ + --disable-complete-cross \ + --webdir=/www \ + --logdir=/var/log \ + --port=8000 \ + --sslPort=8443 \ + --config=flat + +define Build/Configure + $(call Build/Configure/Default) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + BLD_CC_DYN_LOAD=1 +endef + +define Package/appweb/install + ( cd $(PKG_BUILD_DIR) ; $(PKG_BUILD_DIR)/build/bin/makeInstall \ + --root=$(1) --install --with-openwrt=1 binary ) + rm -rf $(1)/var +endef + +$(eval $(call BuildPackage,appweb)) diff --git a/net/appweb/patches/001-add-ipv6-in-configure.patch b/net/appweb/patches/001-add-ipv6-in-configure.patch new file mode 100644 index 0000000..c6bc95c --- /dev/null +++ b/net/appweb/patches/001-add-ipv6-in-configure.patch @@ -0,0 +1,11 @@ +--- appweb-3.2.2-1/configure 2011-01-24 11:09:55.000000000 -0800 ++++ appweb-3.2.2-1-patched/configure 2011-01-24 11:09:47.000000000 -0800 +@@ -2498,6 +2498,8 @@ + # + # Ignored but provided for compatibility with autoconf + # ++ disable-ipv6|enable-ipv6) ++ ;; + bindir=*|libdir=*|libexecdir=*|moddir=*) + ;; + disable-nls|enable-nls) diff --git a/net/aprx/Makefile b/net/aprx/Makefile new file mode 100644 index 0000000..16e98ba --- /dev/null +++ b/net/aprx/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2008-2011 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:=aprx +PKG_REV:=421 +PKG_VERSION:=2.00_r$(PKG_REV) +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://repo.ham.fi/svn/aprx/trunk/ +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=svn + +include $(INCLUDE_DIR)/package.mk + +define Package/aprx + SECTION:=net + CATEGORY:=Network + TITLE:=APRS RX only I-gate + URL:=http://ham.zmailer.org/oh2mqk/aprx/ +endef + +define Package/aprx/description + This daemon listens for traffic on the specified serial interfaces. + It then forwards appropriate packets to APRS-IS servers. +endef + +CONFIGURE_ARGS += \ + --with-embedded \ + +define Package/aprx/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/aprx.init $(1)/etc/init.d/aprx + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/aprx.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/aprx $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/aprx-stat $(1)/usr/sbin/ +endef + +define Package/aprx/conffiles +/etc/aprx.conf +endef + +$(eval $(call BuildPackage,aprx)) diff --git a/net/aprx/files/aprx.init b/net/aprx/files/aprx.init new file mode 100644 index 0000000..9682eee --- /dev/null +++ b/net/aprx/files/aprx.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2011 OpenWrt.org + +START=99 + +SERVICE_USE_PID=1 + +start() { + mkdir -m 0755 -p /var/log/aprx + service_start /usr/sbin/aprx +} + +stop() { + service_stop /usr/sbin/aprx +} diff --git a/net/aprx/patches/100-Makefile_in.patch b/net/aprx/patches/100-Makefile_in.patch new file mode 100644 index 0000000..cb06f79 --- /dev/null +++ b/net/aprx/patches/100-Makefile_in.patch @@ -0,0 +1,27 @@ +diff -ruN aprx-2.00_r421.orig/Makefile.in aprx-2.00_r421/Makefile.in +--- aprx-2.00_r421.orig/Makefile.in 2010-06-19 15:13:47.000000000 +0000 ++++ aprx-2.00_r421/Makefile.in 2010-08-22 00:14:35.000000000 +0000 +@@ -27,8 +27,9 @@ + CFLAGS= @CFLAGS@ + + # Linker and flags +-LD= @LD@ ++LD= @CC@ + LDFLAGS= @LDFLAGS@ $(PROF) ++datarootdir = @datarootdir@ + + INSTALL= $(srcdir)/install-sh + INSTALL_PROGRAM=$(INSTALL) -m 755 +@@ -89,10 +90,10 @@ + + + $(PROGAPRX): $(OBJSAPRX) VERSION Makefile +- $(LD) $(LDFLAGS) -o $@ $(OBJSAPRX) $(LIBS) ++ $(CC) $(CFLAGS) -o $@ $(OBJSAPRX) $(LIBS) + + $(PROGSTAT): $(OBJSSTAT) VERSION Makefile +- $(LD) $(LDFLAGS) -o $@ $(OBJSSTAT) $(LIBS) ++ $(CC) $(CFLAGS) -o $@ $(OBJSSTAT) $(LIBS) + + .PHONY: man + man: $(MAN) diff --git a/net/aria2/Makefile b/net/aria2/Makefile new file mode 100644 index 0000000..132a94b --- /dev/null +++ b/net/aria2/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2012 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:=aria2 +PKG_VERSION:=1.15.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/aria2 +PKG_MD5SUM:=a749a1f7cfe03a7518630d2310267c42 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/aria2 + SECTION:=net + CATEGORY:=Network + SUBMENU:=File Transfer + TITLE:=lightweight download utility + URL:=http://aria2.sourceforge.net/ + DEPENDS:=+libopenssl +zlib +libxml2 +libstdcpp \ + $(INTL_DEPENDS) $(ICONV_DEPENDS) +endef + +define Package/aria2/description + aria2 is a lightweight multi-protocol & multi-source command-line download + utility +endef + +CONFIGURE_ARGS += \ + --disable-nls \ + --without-gnutls \ + --without-libnettle \ + --without-libgmp \ + --without-libgcrypt \ + --without-libexpat \ + --without-libcares \ + --without-sqlite3 \ + --with-openssl \ + --with-libxml2 \ + --with-libz + +CONFIGURE_VARS += \ + ZLIB_CFLAGS="-I$(STAGING_DIR)/usr/include" \ + ZLIB_LIBS="-L$(STAGING_DIR)/usr/lib" + +define Package/aria2/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aria2c $(1)/usr/bin +endef + +$(eval $(call BuildPackage,aria2)) diff --git a/net/arpd/Makefile b/net/arpd/Makefile new file mode 100644 index 0000000..5c7bd4e --- /dev/null +++ b/net/arpd/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2006-2009 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:=arpd +PKG_VERSION:=0.2 +PKG_RELEASE:=2 + +PKG_MD5SUM:=e2911fa9de1b92ef50deda1489ae944d +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://niels.xtdnet.nl/honeyd + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/arpd + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +libdnet +libevent2 +librt + TITLE:=A daemon to fake ARP replies + URL:=http://niels.xtdnet.nl/honeyd/ +endef + +define Build/Configure + (cd $(PKG_BUILD_DIR); touch \ + stamp-h.in \ + config.h.in \ + ); + $(call Build/Configure/Default, \ + --with-libdnet="$(STAGING_DIR)/usr" \ + --with-libevent="$(STAGING_DIR)/usr" \ + --with-libpcap="$(STAGING_DIR)/usr" \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CCOPT="$(TARGET_CFLAGS)" \ + INCLS="-I. $(TARGET_CPPFLAGS)" \ + LIBS="$(TARGET_LDFLAGS) -lpcap -ldnet -levent" +endef + +define Package/arpd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/arpd $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,arpd)) diff --git a/net/arpd/patches/001-configure_no_bpf.patch b/net/arpd/patches/001-configure_no_bpf.patch new file mode 100644 index 0000000..7113b45 --- /dev/null +++ b/net/arpd/patches/001-configure_no_bpf.patch @@ -0,0 +1,12 @@ +--- a/configure ++++ b/configure +@@ -2258,8 +2258,7 @@ echo "${ECHO_T}$withval" >&6 + if cd $withval; then withval=`pwd`; cd $owd; fi + PCAPINC="-I$withval -I$withval/bpf" + PCAPLIB="-L$withval -lpcap" +- elif test -f $withval/include/pcap.h -a \ +- -f $withval/include/net/bpf.h; then ++ elif test -f $withval/include/pcap.h; then + owd=`pwd` + if cd $withval; then withval=`pwd`; cd $owd; fi + PCAPINC="-I$withval/include" diff --git a/net/arpd/patches/002-function_string.patch b/net/arpd/patches/002-function_string.patch new file mode 100644 index 0000000..c2a3b41 --- /dev/null +++ b/net/arpd/patches/002-function_string.patch @@ -0,0 +1,42 @@ +--- a/arpd.c ++++ b/arpd.c +@@ -265,7 +265,7 @@ arpd_send(eth_t *eth, int op, + spa->addr_ip, tha->addr_eth, tpa->addr_ip); + + if (op == ARP_OP_REQUEST) { +- syslog(LOG_DEBUG, __FUNCTION__ ": who-has %s tell %s", ++ syslog(LOG_DEBUG, "%s: who-has %s tell %s", __FUNCTION__, + addr_ntoa(tpa), addr_ntoa(spa)); + } else if (op == ARP_OP_REPLY) { + syslog(LOG_INFO, "arp reply %s is-at %s", +@@ -282,7 +282,7 @@ arpd_lookup(struct addr *addr) + int error; + + if (addr_cmp(addr, &arpd_ifent.intf_addr) == 0) { +- syslog(LOG_DEBUG, __FUNCTION__ ": %s at %s", ++ syslog(LOG_DEBUG, "%s: %s at %s", __FUNCTION__, + addr_ntoa(addr), addr_ntoa(&arpd_ifent.intf_link_addr)); + return (0); + } +@@ -291,10 +291,10 @@ arpd_lookup(struct addr *addr) + error = arp_get(arpd_arp, &arpent); + + if (error == -1) { +- syslog(LOG_DEBUG, __FUNCTION__ ": no entry for %s", ++ syslog(LOG_DEBUG, "%s: no entry for %s", __FUNCTION__, + addr_ntoa(addr)); + } else { +- syslog(LOG_DEBUG, __FUNCTION__ ": %s at %s", ++ syslog(LOG_DEBUG, "%s: %s at %s", __FUNCTION__, + addr_ntoa(addr), addr_ntoa(&arpent.arp_ha)); + } + return (error); +@@ -423,7 +423,7 @@ arpd_recv_cb(u_char *u, const struct pca + if ((req = SPLAY_FIND(tree, &arpd_reqs, &tmp)) != NULL) { + addr_pack(&src.arp_ha, ADDR_TYPE_ETH, ETH_ADDR_BITS, + ethip->ar_sha, ETH_ADDR_LEN); +- syslog(LOG_DEBUG, __FUNCTION__ ": %s at %s", ++ syslog(LOG_DEBUG, "%s: %s at %s", __FUNCTION__, + addr_ntoa(&req->pa), addr_ntoa(&src.arp_ha)); + + /* This address is claimed */ diff --git a/net/arpd/patches/003-pcap_and_arg.patch b/net/arpd/patches/003-pcap_and_arg.patch new file mode 100644 index 0000000..c48b8f4 --- /dev/null +++ b/net/arpd/patches/003-pcap_and_arg.patch @@ -0,0 +1,76 @@ +--- a/arpd.c ++++ b/arpd.c +@@ -70,7 +70,7 @@ static int arpd_sig; + static void + usage(void) + { +- fprintf(stderr, "Usage: arpd [-d] [-i interface] [net]\n"); ++ fprintf(stderr, "Usage: arpd [-d] [-i interface] [-a 'pcap_expr'] [{host|net|range} ...]\n"); + exit(1); + } + +@@ -182,7 +182,7 @@ arpd_expandips(int naddresses, char **ad + } + + static void +-arpd_init(char *dev, int naddresses, char **addresses) ++arpd_init(char *dev, char *and_pcap_exp, int naddresses, char **addresses) + { + struct bpf_program fcode; + char filter[1024], ebuf[PCAP_ERRBUF_SIZE], *dst; +@@ -214,9 +214,13 @@ arpd_init(char *dev, int naddresses, cha + errx(1, "bad interface configuration: not IP or Ethernet"); + arpd_ifent.intf_addr.addr_bits = IP_ADDR_BITS; + +- snprintf(filter, sizeof(filter), "arp %s%s%s and not ether src %s", ++ snprintf(filter, sizeof(filter), "arp %s%s%s and not ether src %s%s%s%s", + dst ? "and (" : "", dst ? dst : "", dst ? ")" : "", +- addr_ntoa(&arpd_ifent.intf_link_addr)); ++ addr_ntoa(&arpd_ifent.intf_link_addr), ++ and_pcap_exp ? " and (" : "", ++ and_pcap_exp ? and_pcap_exp : "", ++ and_pcap_exp ? ")" : "" ++ ); + + if ((arpd_pcap = pcap_open_live(dev, 128, 0, 500, ebuf)) == NULL) + errx(1, "pcap_open_live: %s", ebuf); +@@ -465,14 +469,15 @@ main(int argc, char *argv[]) + { + struct event recv_ev; + extern int (*event_sigcb)(void); +- char *dev; ++ char *dev, *and_pcap_exp; + int c, debug; + FILE *fp; + + dev = NULL; ++ and_pcap_exp = NULL; + debug = 0; + +- while ((c = getopt(argc, argv, "di:h?")) != -1) { ++ while ((c = getopt(argc, argv, "a:di:h?")) != -1) { + switch (c) { + case 'd': + debug = 1; +@@ -480,6 +485,9 @@ main(int argc, char *argv[]) + case 'i': + dev = optarg; + break; ++ case 'a': ++ and_pcap_exp = optarg; ++ break; + default: + usage(); + break; +@@ -489,9 +497,9 @@ main(int argc, char *argv[]) + argv += optind; + + if (argc == 0) +- arpd_init(dev, 0, NULL); ++ arpd_init(dev, and_pcap_exp, 0, NULL); + else +- arpd_init(dev, argc, argv); ++ arpd_init(dev, and_pcap_exp, argc, argv); + + if ((fp = fopen(PIDFILE, "w")) == NULL) + err(1, "fopen"); diff --git a/net/arpd/patches/004-no_dnet_config_check.patch b/net/arpd/patches/004-no_dnet_config_check.patch new file mode 100644 index 0000000..c3ebc12 --- /dev/null +++ b/net/arpd/patches/004-no_dnet_config_check.patch @@ -0,0 +1,12 @@ +--- a/configure ++++ b/configure +@@ -2170,8 +2170,7 @@ echo "${ECHO_T}$withval" >&6 + DNETLIB="`$withval/bin/dnet-config --libs`" + else + { { echo "$as_me:2172: error: dnet-config not found in $withval/bin" >&5 +-echo "$as_me: error: dnet-config not found in $withval/bin" >&2;} +- { (exit 1); exit 1; }; } ++echo "$as_me: error: dnet-config not found in $withval/bin" >&2;} } + fi + ;; + esac diff --git a/net/arpd/patches/005-remove-dropped-libevent-features.patch b/net/arpd/patches/005-remove-dropped-libevent-features.patch new file mode 100644 index 0000000..0936345 --- /dev/null +++ b/net/arpd/patches/005-remove-dropped-libevent-features.patch @@ -0,0 +1,29 @@ +--- a/arpd.c ++++ b/arpd.c +@@ -449,9 +449,6 @@ arpd_recv(int fd, short type, void *ev) + void + terminate_handler(int sig) + { +- extern int event_gotsig; +- +- event_gotsig = 1; + arpd_sig = sig; + } + +@@ -468,7 +465,6 @@ int + main(int argc, char *argv[]) + { + struct event recv_ev; +- extern int (*event_sigcb)(void); + char *dev, *and_pcap_exp; + int c, debug; + FILE *fp; +@@ -532,8 +528,6 @@ main(int argc, char *argv[]) + perror("signal"); + return (-1); + } +- event_sigcb = arpd_signal; +- + event_dispatch(); + + return (0); diff --git a/net/arpwatch/Makefile b/net/arpwatch/Makefile new file mode 100644 index 0000000..20b1959 --- /dev/null +++ b/net/arpwatch/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2006-2011 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:=arpwatch +PKG_VERSION:=2.1a15 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.free.fr/.mirrors1/ftp.gentoo.org/distfiles/ +PKG_MD5SUM:=cebfeb99c4a7c2a6cee2564770415fe7 + +# use a subdirectory to prevent configure for finding libpcap build dir +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/arpwatch + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap + TITLE:=Ethernet station activity monitor + URL:=http://www-nrg.ee.lbl.gov/ +endef + +define Package/arpwatch/description + Ethernet monitor program for keeping track of ethernet/ip address + pairings. +endef + +define Package/arpwatch/conffiles +/etc/arpwatch/arp.dat +endef + +define Build/Prepare + $(call Build/Prepare/Default) + chmod -R u+w $(PKG_BUILD_DIR) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + ARPDIR=/etc/arpwatch \ + CCOPT="$(TARGET_CFLAGS)" \ + INCLS="-I. $(TARGET_CPPFLAGS)" \ + LIBS="$(TARGET_LDFLAGS) -lpcap" +endef + +define Package/arpwatch/install + $(INSTALL_DIR) $(1)/etc/arpwatch + $(CP) $(PKG_BUILD_DIR)/arp.dat $(1)/etc/arpwatch/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/arp{watch,snmp} $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/arpwatch.init $(1)/etc/init.d/arpwatch +endef + +$(eval $(call BuildPackage,arpwatch)) diff --git a/net/arpwatch/files/arpwatch.init b/net/arpwatch/files/arpwatch.init new file mode 100644 index 0000000..b05692b --- /dev/null +++ b/net/arpwatch/files/arpwatch.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=90 + +start() { + service_start /usr/sbin/arpwatch -f /etc/arpwatch/arp.dat -i br-lan +} + +stop() { + service_stop /usr/sbin/arpwatch +} diff --git a/net/asterisk-1.8.x/Makefile b/net/asterisk-1.8.x/Makefile new file mode 100644 index 0000000..6c769cc --- /dev/null +++ b/net/asterisk-1.8.x/Makefile @@ -0,0 +1,686 @@ +# +# Copyright (C) 2008-2012 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:=asterisk18 +PKG_VERSION:=1.8.10.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk/releases/ +PKG_MD5SUM:=415738d347b9037cbe5f8bfbe66843de + +PKG_BUILD_DIR=$(BUILD_DIR)/asterisk-$(PKG_VERSION) + +include $(INCLUDE_DIR)/ltqtapi.mk +include $(INCLUDE_DIR)/package.mk + +define Package/asterisk18/Default + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + URL:=http://www.asterisk.org/ +endef + +define Package/asterisk18/Default/description + Asterisk is a complete PBX in software. It provides all of the features + you would expect from a PBX and more. Asterisk does voice over IP in three + protocols, and can interoperate with almost all standards-based telephony + equipment using relatively inexpensive hardware. +endef + + +define Package/asterisk18 +$(call Package/asterisk18/Default) + TITLE:=Complete open source PBX, v1.8x + MENU:=1 + DEPENDS:= +libopenssl +libncurses +libpopt +libpthread +zlib @!TARGET_avr32 +endef + +define Package/asterisk18/description +$(call Package/asterisk18/Default/description) +endef + +define Package/asterisk18-sounds +$(call Package/asterisk18/Default) + TITLE:=Sound files + DEPENDS:= asterisk18 +endef + +define Package/asterisk18-sounds/description +$(call Package/asterisk18/Default/description) + This package contains sound files for Asterisk. +endef + +define Package/asterisk18-voicemail +$(call Package/asterisk18/Default) + TITLE:=Voicemail support + DEPENDS:= asterisk18 +endef + +define Package/asterisk18-voicemail/description +$(call Package/asterisk18/Default/description) + This package contains voicemail related modules for Asterisk. +endef + +define Package/asterisk18-app-meetme +$(call Package/asterisk18/Default) + TITLE:=conferencing support + DEPENDS:= asterisk18 +dahdi-tools-libtonezone +kmod-dahdi-linux +endef + +define Package/asterisk18-app-meetme/description +$(call Package/asterisk18/Default/description) + This package provides the MeetMe application driver Conferencing support to + Asterisk. +endef + +define Package/asterisk18-chan-iax2 +$(call Package/asterisk18/Default) + TITLE:=IAX support + DEPENDS:= asterisk18 +asterisk18-res-crypto +endef + +define Package/asterisk18-chan-iax2/description +$(call Package/asterisk18/Default/description) + This package provides IAX support to + Asterisk. +endef + +define Package/asterisk18-cdr +$(call Package/asterisk18/Default) + TITLE:=CDR support + DEPENDS:= asterisk18 @BROKEN +endef + +define Package/asterisk18-cdr/description +$(call Package/asterisk18/Default/description) + This package provides Call Detail Record support to + Asterisk. +endef + +define Package/asterisk18-res-musiconhold +$(call Package/asterisk18/Default) + TITLE:=MOH support + DEPENDS:= asterisk18 +endef + +define Package/asterisk18-res-musiconhold/description +$(call Package/asterisk18/Default/description) + This package provides Music On Hold support to + Asterisk. +endef + +define Package/asterisk18-res-srtp +$(call Package/asterisk18/Default) + TITLE:=SRTP support + DEPENDS:= asterisk18 libsrtp +asterisk18-res-crypto +endef + +define Package/asterisk18-res-srtp/description +$(call Package/asterisk18/Default/description) + This package provides SRTP support to + Asterisk. +endef + +define Package/asterisk18-chan-gtalk +$(call Package/asterisk18/Default) + TITLE:=GTalk support + DEPENDS:= asterisk18 +libiksemel +endef + +define Package/asterisk18-chan-gtalk/description +$(call Package/asterisk18/Default/description) + This package provides the channel chan_gtalk and res_jabber for GTalk + support to Asterisk. +endef + +define Package/asterisk18-chan-mobile +$(call Package/asterisk18/Default) + TITLE:=Mobile channel support + DEPENDS:= asterisk18 +bluez-libs +endef + +define Package/asterisk18-chan-mobile/description +$(call Package/asterisk18/Default/description) + This package provides the channel chan_mobile support to Asterisk. +endef + +define Package/asterisk18-res-timing-timerfd +$(call Package/asterisk18/Default) + TITLE:= Timerfd Timing Interface + DEPENDS:= asterisk18 +endef + +define Package/asterisk18-res-timing-pthread +$(call Package/asterisk18/Default) + TITLE:= pthread Timing Interface + DEPENDS:= asterisk18 +endef + +define Package/asterisk18-res-fax +$(call Package/asterisk18/Default) + TITLE:=Generic FAX Resource for FAX technology resource modules + DEPENDS:= asterisk18 +asterisk18-res-timing-pthread +endef + +define Package/asterisk18-res-fax-spandsp +$(call Package/asterisk18/Default) + TITLE:=Spandsp T.38 and G.711 FAX Resource + DEPENDS:= asterisk18 +asterisk18-res-fax +libspandsp +endef + +define Package/asterisk18-chan-mgcp +$(call Package/asterisk18/Default) + TITLE:=MGCP channel support + DEPENDS:= asterisk18 +endef + +define Package/asterisk18-chan-mgcp/description +$(call Package/asterisk18/Default/description) + This package provides the channel chan_mgcp support to Asterisk. +endef + +define Package/asterisk18-chan-skinny +$(call Package/asterisk18/Default) + TITLE:=Skinny channel support + DEPENDS:= asterisk18 +endef + +define Package/asterisk18-chan-skinny/description +$(call Package/asterisk18/Default/description) + This package provides the channel chan_skinny support to Asterisk. +endef + +define Package/asterisk18-curl +$(call Package/asterisk18/Default) + TITLE:=CURL support + DEPENDS:= asterisk18 +libcurl +endef + +define Package/asterisk18-curl/description +$(call Package/asterisk18/Default/description) + This package provides CURL + support to Asterisk. +endef + +define Package/asterisk18-mysql +$(call Package/asterisk18/Default) + TITLE:=MySQL support + DEPENDS:= asterisk18 +PACKAGE_asterisk18-mysql:libmysqlclient +endef + +define Package/asterisk18-mysql/description +$(call Package/asterisk18/Default/description) + This package provides MySQL + support to Asterisk. +endef + +define Package/asterisk18-chan-lantiq +$(call Package/asterisk18/Default) + TITLE:=Lantiq TAPI support + DEPENDS:= asterisk18 $(LTQ_TAPI_DEPENDS) + URL:=http://git.nanl.de/?p=asterisk_channel_lantiq.git + MAINTAINER:=Mirko Vogt +endef + +define Package/asterisk18-chan-lantiq/description +$(call Package/asterisk18/Default/description) + This package provides the channel chan_lantiq support to Asterisk. +endef + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-app-meetme),) + CONFIGURE_ARGS+= \ + --with-dahdi="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= \ + --without-dahdi +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-chan-gtalk),) + CONFIGURE_ARGS+= \ + --with-gnutls="$(STAGING_DIR)/usr" \ + --with-iksemel="$(STAGING_DIR)/usr" + SITE_VARS+= \ + ac_cv_lib_iksemel_iks_start_sasl=yes \ + ac_cv_lib_gnutls_gnutls_bye=yes +else + CONFIGURE_ARGS+= \ + --without-gnutls \ + --without-iksemel +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-curl),) + CONFIGURE_ARGS+= \ + --with-curl="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= \ + --without-curl +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mysql),) + CONFIGURE_ARGS+= \ + --with-mysqlclient="$(STAGING_DIR)/usr/bin" +else + CONFIGURE_ARGS+= \ + --without-mysqlclient +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-res-fax-spandsp),) + CONFIGURE_ARGS+= \ + --with-spandsp="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= \ + --without-spandsp +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-chan-mobile),) + CONFIGURE_ARGS+= \ + --with-bluetooth="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= \ + --without-bluetooth +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-res-srtp),) + CONFIGURE_ARGS+= \ + --with-srtp="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= \ + --without-srtp +endif + +CONFIGURE_ARGS+= \ + --without-curses \ + --with-gsm=internal \ + --without-cap \ + --without-gtk \ + --without-gtk2 \ + --without-isdnnet \ + --without-kde \ + --without-misdn \ + --without-nbs \ + --with-ncurses="$(STAGING_DIR)/usr" \ + --without-netsnmp \ + --without-newt \ + --without-odbc \ + --without-ogg \ + --without-osptk \ + --with-popt="$(STAGING_DIR)/usr" \ + --without-pri \ + --without-qt \ + --without-radius \ + --without-sdl \ + --without-suppserv \ + --without-tds \ + --without-termcap \ + --without-tinfo \ + --without-vorbis \ + --without-vpb \ + --with-z="$(STAGING_DIR)/usr" \ + --with-sounds-cache="$(DL_DIR)" \ + --disable-xmldoc + +EXTRA_CFLAGS+= $(TARGET_CPPFLAGS) +EXTRA_LDFLAGS+= $(TARGET_LDFLAGS) + +define Build/Prepare + $(call Build/Prepare/Default) +ifneq ($(CONFIG_TARGET_lantiq),) + $(CP) ./src-lantiq/* $(PKG_BUILD_DIR)/ +endif +endef + +define Build/Configure + $(call Build/Configure/Default,,$(SITE_VARS)) +endef + +define Build/Compile + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + include/asterisk/version.h \ + include/asterisk/buildopts.h defaults.h \ + makeopts.embed_rules + ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY" \ + ASTLDFLAGS="$(EXTRA_LDFLAGS)" \ + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + ASTVARLIBDIR="/usr/lib/asterisk" \ + ASTDATADIR="/usr/lib/asterisk" \ + ASTKEYDIR="/usr/lib/asterisk" \ + ASTDBDIR="/usr/lib/asterisk" \ + NOISY_BUILD="1" \ + DEBUG="" \ + OPTIMIZE="" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install samples +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/asterisk-1.8/include/asterisk/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk-1.8/include/asterisk/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/asterisk-1.8/include/ +endef + +define Package/asterisk18/conffiles +/etc/asterisk/asterisk.conf +/etc/asterisk/modules.conf +/etc/asterisk/extensions.conf +/etc/asterisk/sip.conf +/etc/asterisk/sip_notify.conf +/etc/asterisk/features.conf +/etc/asterisk/indications.conf +/etc/asterisk/logger.conf +/etc/asterisk/manager.conf +/etc/asterisk/rtp.conf +/etc/default/asterisk +/etc/init.d/asterisk +endef + +define Package/asterisk18/install + $(INSTALL_DIR) $(1)/etc/asterisk + for f in asterisk extensions features \ + indications logger manager modules \ + sip sip_notify rtp; do \ + $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \ + done + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + for f in app_dial app_echo app_playback app_macro \ + chan_sip res_rtp_asterisk res_rtp_multicast \ + codec_ulaw codec_gsm \ + format_gsm format_pcm format_wav format_wav_gsm \ + pbx_config \ + func_strings func_timeout func_callerid func_logic; do \ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \ + done + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/default + $(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk +endef + +define Package/asterisk18-sounds/install + $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/ + rm -f $(1)/usr/lib/asterisk/sounds/vm-* + rm -f $(1)/usr/lib/asterisk/sounds/conf-* +endef + + +define Package/asterisk18-voicemail/conffiles +/etc/asterisk/voicemail.conf +endef + +define Package/asterisk18-voicemail/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/voicemail.conf $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*voicemail.so $(1)/usr/lib/asterisk/modules/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_adsi.so $(1)/usr/lib/asterisk/modules/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_smdi.so $(1)/usr/lib/asterisk/modules/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/vm-*.gsm $(1)/usr/lib/asterisk/sounds/ +endef + +define Package/asterisk18-app-meetme/conffiles +/etc/asterisk/meetme.conf +endef + +define Package/asterisk18-app-meetme/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_dahdi.so $(1)/usr/lib/asterisk/modules/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/conf-*.gsm $(1)/usr/lib/asterisk/sounds/ +endef + +define Package/asterisk18-chan-iax2/conffiles +/etc/asterisk/iax.conf +/etc/asterisk/iaxprov.conf +endef + +define Package/asterisk18-cdr/conffiles +/etc/asterisk/cdr.conf +/etc/asterisk/cdr_custom.conf +/etc/asterisk/cdr_manager.conf +/etc/asterisk/cdr_odbc.conf +/etc/asterisk/cdr_pgsql.conf +/etc/asterisk/cdr_tds.conf +endef + +define Package/asterisk18-res-musiconhold/conffiles +/etc/asterisk/musiconhold.conf +endef + +define Package/asterisk18-chan-iax2/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iax.conf $(1)/etc/asterisk/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iaxprov.conf $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_iax2.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-cdr/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr*.conf $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*cdr*.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-res-musiconhold/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_musiconhold.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-chan-gtalk/conffiles +/etc/asterisk/gtalk.conf +/etc/asterisk/jabber.conf +endef + +define Package/asterisk18-chan-gtalk/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/gtalk.conf $(1)/etc/asterisk/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/jabber.conf $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_gtalk.so $(1)/usr/lib/asterisk/modules/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_jabber.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-chan-mobile/conffiles +/etc/asterisk/chan_mobile.conf +endef + +define Package/asterisk18-chan-mobile/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/chan_mobile.conf $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_mobile.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-res-timing-timerfd/install + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_timing_timerfd.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-res-timing-pthread/install + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_timing_pthread.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-res-fax/conffiles +/etc/asterisk/res_fax.conf +endef + +define Package/asterisk18-res-fax/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/res_fax.conf $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_fax.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-res-fax-spandsp/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_fax_spandsp.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-chan-mgcp/conffiles +/etc/asterisk/mgcp.conf +endef + +define Package/asterisk18-chan-mgcp/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/mgcp.conf $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_mgcp.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-chan-skinny/conffiles +/etc/asterisk/skinny.conf +endef + +define Package/asterisk18-chan-skinny/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/skinny.conf $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_skinny.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-curl/install + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/func_curl.so $(1)/usr/lib/asterisk/modules/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_curl.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-mysql/conffiles +/etc/asterisk/app_mysql.conf +/etc/asterisk/res_config_mysql.conf +/etc/asterisk/cdr_mysql.conf +endef + +define Package/asterisk18-mysql/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/app_mysql.conf $(1)/etc/asterisk/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/res_config_mysql.conf $(1)/etc/asterisk/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr_mysql.conf $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_mysql.so $(1)/usr/lib/asterisk/modules/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/cdr_mysql.so $(1)/usr/lib/asterisk/modules/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_config_mysql.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-chan-lantiq/conffiles +/etc/asterisk/lantiq.conf +endef + +define Package/asterisk18-chan-lantiq/install + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/lantiq.conf $(1)/etc/asterisk/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_lantiq.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-res-srtp/install + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_srtp.so $(1)/usr/lib/asterisk/modules/ +endef + +define Buildasterisk18ModuleTemplate + + define Package/asterisk18-$(subst _,-,$(1)) + $$(call Package/asterisk18/Default) + TITLE:=$(2) support + DEPENDS:= asterisk18 $(4) + endef + + define Package/asterisk18-$(subst _,-,$(1))/description + $$(call Package/asterisk18/Default/description) + This package provides support $(3) in Asterisk. + endef + + define Package/asterisk18-$(subst _,-,$(1))/install + $(INSTALL_DIR) $$(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$(1).so $$(1)/usr/lib/asterisk/modules/ + endef + + $$(eval $$(call BuildPackage,asterisk18-$(subst _,-,$(1)))) +endef + +$(eval $(call BuildPackage,asterisk18)) +$(eval $(call BuildPackage,asterisk18-voicemail)) +$(eval $(call BuildPackage,asterisk18-sounds)) +#$(eval $(call BuildPackage,asterisk18-app-meetme)) +$(eval $(call BuildPackage,asterisk18-chan-iax2)) +$(eval $(call BuildPackage,asterisk18-cdr)) +$(eval $(call BuildPackage,asterisk18-res-musiconhold)) +$(eval $(call BuildPackage,asterisk18-chan-gtalk)) +$(eval $(call BuildPackage,asterisk18-chan-mobile)) +$(eval $(call BuildPackage,asterisk18-res-fax)) +$(eval $(call BuildPackage,asterisk18-res-fax-spandsp)) +$(eval $(call BuildPackage,asterisk18-res-timing-timerfd)) +$(eval $(call BuildPackage,asterisk18-res-timing-pthread)) +$(eval $(call BuildPackage,asterisk18-chan-mgcp)) +$(eval $(call BuildPackage,asterisk18-chan-skinny)) +$(eval $(call BuildPackage,asterisk18-curl)) +$(eval $(call BuildPackage,asterisk18-mysql)) +$(eval $(call BuildPackage,asterisk18-chan-lantiq)) +$(eval $(call BuildPackage,asterisk18-res-srtp)) +$(eval $(call Buildasterisk18ModuleTemplate,app_authenticate,Authenticate,support for executing arbitrary authenticate commands)) +$(eval $(call Buildasterisk18ModuleTemplate,app_chanisavail,Channel availability check,support for checking if a channel is available)) +$(eval $(call Buildasterisk18ModuleTemplate,app_chanspy,Channel listen in,support for listening in on any channel)) +$(eval $(call Buildasterisk18ModuleTemplate,app_directed_pickup,Directed call pickup,support for directed call pickup)) +$(eval $(call Buildasterisk18ModuleTemplate,app_exec,Exec application,support for application execution)) +$(eval $(call Buildasterisk18ModuleTemplate,app_minivm,Minimal voicemail system,a voicemail system in small building blocks working together based on the Comedian Mail voicemail system)) +$(eval $(call Buildasterisk18ModuleTemplate,app_readexten,Extension to variable,a trivial application to read an extension into a variable)) +$(eval $(call Buildasterisk18ModuleTemplate,app_read,Variable read,a trivial application to read a variable)) +$(eval $(call Buildasterisk18ModuleTemplate,app_sayunixtime,Say Unix time,an application to say Unix time)) +$(eval $(call Buildasterisk18ModuleTemplate,app_sms,SMS,SMS support (ETSI ES 201 912 protocol 1))) +$(eval $(call Buildasterisk18ModuleTemplate,app_stack,Stack applications, stack applications Gosub Return etc., +asterisk18-res-agi)) +$(eval $(call Buildasterisk18ModuleTemplate,app_system,System exec,support for executing system commands)) +$(eval $(call Buildasterisk18ModuleTemplate,app_talkdetect,File playback with audio detect,for file playback with audio detect)) +$(eval $(call Buildasterisk18ModuleTemplate,app_waituntil,Sleep,support sleeping until the given epoch)) +$(eval $(call Buildasterisk18ModuleTemplate,app_while,While loop,a while loop implementation)) +$(eval $(call Buildasterisk18ModuleTemplate,chan_agent,Agents proxy channel, an implementation of agents proxy channel)) +$(eval $(call Buildasterisk18ModuleTemplate,chan_local,Local proxy channel, an implementation of local proxy channel)) +$(eval $(call Buildasterisk18ModuleTemplate,codec_alaw,Signed linear to alaw translation,translation between signed linear and alaw codecs)) +$(eval $(call Buildasterisk18ModuleTemplate,codec_a_mu,Alaw to ulaw translation,translation between alaw and ulaw codecs)) +$(eval $(call Buildasterisk18ModuleTemplate,codec_g722,G.722,a high bit rate 48/56/64Kbps ITU standard codec)) +$(eval $(call Buildasterisk18ModuleTemplate,codec_g726,Signed linear to G.726 translation,translation between signed linear and ITU G.726-32kbps codecs)) +$(eval $(call Buildasterisk18ModuleTemplate,format_g726,G.726,support for headerless G.726 16/24/32/40kbps data format)) +$(eval $(call Buildasterisk18ModuleTemplate,format_g729,G.729,support for raw headerless G729 data)) +$(eval $(call Buildasterisk18ModuleTemplate,format_sln,Raw slinear format,support for raw slinear format)) +$(eval $(call Buildasterisk18ModuleTemplate,format_sln16,Raw slinear 16 format,support for Raw slinear 16 format)) +$(eval $(call Buildasterisk18ModuleTemplate,func_db,Database interaction,functions for interaction with the database)) +$(eval $(call Buildasterisk18ModuleTemplate,func_devstate,Blinky lights control,functions for manually controlled blinky lights)) +$(eval $(call Buildasterisk18ModuleTemplate,func_vmcount,vmcount dialplan,a vmcount dialplan function)) +$(eval $(call Buildasterisk18ModuleTemplate,func_extstate,Hinted extension state,retrieving the state of a hinted extension for dialplan control)) +$(eval $(call Buildasterisk18ModuleTemplate,func_global,Global variable,global variable dialplan functions)) +$(eval $(call Buildasterisk18ModuleTemplate,func_shell,Shell,support for shell execution)) +$(eval $(call Buildasterisk18ModuleTemplate,pbx_ael,Asterisk Extension Logic,support for symbolic Asterisk Extension Logic)) +$(eval $(call Buildasterisk18ModuleTemplate,res_ael_share,Shareable AEL code,support for shareable AEL code mainly between internal and external modules)) +$(eval $(call Buildasterisk18ModuleTemplate,pbx_spool,Call Spool,outgoing call spool support)) +$(eval $(call Buildasterisk18ModuleTemplate,res_agi,Asterisk Gateway Interface,support for the Asterisk Gateway Interface extension)) +$(eval $(call Buildasterisk18ModuleTemplate,res_crypto,Provide Crypto,Cryptographic Signature capability)) +$(eval $(call Buildasterisk18ModuleTemplate,app_alarmreceiver,Alarm receiver,Central Station Alarm receiver for Ademco Contact ID)) +$(eval $(call Buildasterisk18ModuleTemplate,app_setcallerid,Set callerid,support for setting callerid)) +$(eval $(call Buildasterisk18ModuleTemplate,app_verbose,Verbose logging,Verbose logging application)) +$(eval $(call Buildasterisk18ModuleTemplate,func_channel,Channel info,Channel info dialplan function)) +$(eval $(call Buildasterisk18ModuleTemplate,func_blacklist,Blacklist on callerid,looking up the callerid number and see if it is blacklisted)) +$(eval $(call Buildasterisk18ModuleTemplate,app_originate,Originate a call,originating an outbound call and connecting it to a specified extension or application)) +$(eval $(call Buildasterisk18ModuleTemplate,func_uri,URI encoding and decoding,Encodes and decodes URI-safe strings)) +$(eval $(call Buildasterisk18ModuleTemplate,app_disa,Direct Inward System Access,Direct Inward System Access)) +$(eval $(call Buildasterisk18ModuleTemplate,app_senddtmf,Send DTMF digits,Sends arbitrary DTMF digits)) +$(eval $(call Buildasterisk18ModuleTemplate,func_cut,CUT function,CUT function)) +$(eval $(call Buildasterisk18ModuleTemplate,res_clioriginate,Calls via CLI,Originate calls via the CLI)) +$(eval $(call Buildasterisk18ModuleTemplate,app_mixmonitor,Record a call and mix the audio,record a call and mix the audio during the recording)) +$(eval $(call Buildasterisk18ModuleTemplate,app_playtones,Playtones application,play a tone list)) +$(eval $(call Buildasterisk18ModuleTemplate,app_record,Record sound file,to record a sound file)) diff --git a/net/asterisk-1.8.x/files/asterisk.default b/net/asterisk-1.8.x/files/asterisk.default new file mode 100644 index 0000000..9d046c4 --- /dev/null +++ b/net/asterisk-1.8.x/files/asterisk.default @@ -0,0 +1,4 @@ +## startup options for /etc/init.d/asterisk + +ENABLE_ASTERISK="yes" +OPTIONS="" diff --git a/net/asterisk-1.8.x/files/asterisk.init b/net/asterisk-1.8.x/files/asterisk.init new file mode 100644 index 0000000..53bf4af --- /dev/null +++ b/net/asterisk-1.8.x/files/asterisk.init @@ -0,0 +1,21 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008 OpenWrt.org +START=50 + +DEST= +DEFAULT=$DEST/etc/default/asterisk +OPTIONS="" + +start() { + [ -f $DEFAULT ] && . $DEFAULT + [ -d $DEST/var/run/asterisk ] || mkdir -p $DEST/var/run/asterisk + [ -d $DEST/var/log/asterisk ] || mkdir -p $DEST/var/log/asterisk + [ -d $DEST/var/spool/asterisk ] || mkdir -p $DEST/var/spool/asterisk + [ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk + [ -h $DEST/usr/lib/asterisk/astdb ] || ln -sf /var/spool/asterisk/astdb $DEST/usr/lib/asterisk/astdb + $DEST/usr/sbin/asterisk $OPTIONS +} + +stop() { + [ -f $DEST/var/run/asterisk/asterisk.pid ] && kill $(cat $DEST/var/run/asterisk/asterisk.pid) >/dev/null 2>&1 +} diff --git a/net/asterisk-1.8.x/patches/100-build_tools-iconv.patch b/net/asterisk-1.8.x/patches/100-build_tools-iconv.patch new file mode 100644 index 0000000..d3cad82 --- /dev/null +++ b/net/asterisk-1.8.x/patches/100-build_tools-iconv.patch @@ -0,0 +1,11 @@ +--- a/build_tools/menuselect-deps.in ++++ b/build_tools/menuselect-deps.in +@@ -16,7 +16,7 @@ GTK2=@PBX_GTK2@ + H323=@PBX_H323@ + HOARD=@PBX_HOARD@ + ICAL=@PBX_ICAL@ +-ICONV=@PBX_ICONV@ ++ICONV=0 + IKSEMEL=@PBX_IKSEMEL@ + IMAP_TK=@PBX_IMAP_TK@ + IODBC=@PBX_IODBC@ diff --git a/net/asterisk-1.8.x/patches/200-addons-defaultenable.patch b/net/asterisk-1.8.x/patches/200-addons-defaultenable.patch new file mode 100644 index 0000000..65b9e79 --- /dev/null +++ b/net/asterisk-1.8.x/patches/200-addons-defaultenable.patch @@ -0,0 +1,77 @@ +--- a/addons/app_mysql.c ++++ b/addons/app_mysql.c +@@ -25,7 +25,7 @@ + + /*** MODULEINFO + mysqlclient +- no ++ yes + deprecated + func_odbc + ***/ +--- a/addons/app_saycountpl.c ++++ b/addons/app_saycountpl.c +@@ -21,7 +21,7 @@ + */ + + /*** MODULEINFO +- no ++ yes + deprecated + say.conf + ***/ +--- a/addons/cdr_mysql.c ++++ b/addons/cdr_mysql.c +@@ -35,7 +35,7 @@ + + /*** MODULEINFO + mysqlclient +- no ++ yes + deprecated + cdr_adaptive_odbc + ***/ +--- a/addons/chan_mobile.c ++++ b/addons/chan_mobile.c +@@ -27,7 +27,7 @@ + + /*** MODULEINFO + bluetooth +- no ++ yes + extended + ***/ + +--- a/addons/chan_ooh323.c ++++ b/addons/chan_ooh323.c +@@ -18,7 +18,7 @@ + + + /*** MODULEINFO +- no ++ yes + extended + ***/ + +--- a/addons/res_config_mysql.c ++++ b/addons/res_config_mysql.c +@@ -24,7 +24,7 @@ + + /*** MODULEINFO + mysqlclient +- no ++ yes + extended + ***/ + +--- a/res/res_pktccops.c ++++ b/res/res_pktccops.c +@@ -31,7 +31,7 @@ + */ + + /*** MODULEINFO +- no ++ yes + extended + ***/ + diff --git a/net/asterisk-1.8.x/patches/500-nres.patch b/net/asterisk-1.8.x/patches/500-nres.patch new file mode 100644 index 0000000..1d030b5 --- /dev/null +++ b/net/asterisk-1.8.x/patches/500-nres.patch @@ -0,0 +1,11 @@ +--- a/configure ++++ b/configure +@@ -16784,7 +16784,7 @@ if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + +-$as_echo "#define HAVE_RES_NINIT 1" >>confdefs.h ++$as_echo "//#define HAVE_RES_NINIT 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_ndestroy" >&5 + $as_echo_n "checking for library containing res_9_ndestroy... " >&6; } diff --git a/net/asterisk-1.8.x/patches/600-CVE-2012-2186.patch b/net/asterisk-1.8.x/patches/600-CVE-2012-2186.patch new file mode 100644 index 0000000..dbe790b --- /dev/null +++ b/net/asterisk-1.8.x/patches/600-CVE-2012-2186.patch @@ -0,0 +1,10 @@ +--- a/main/manager.c ++++ b/main/manager.c +@@ -4020,6 +4020,7 @@ static int action_originate(struct manse + TryExec(System(rm -rf /)) */ + strcasestr(app, "agi") || /* AGI(/bin/rm,-rf /) + EAGI(/bin/rm,-rf /) */ ++ strcasestr(app, "externalivr") || /* ExternalIVR(rm -rf) */ + strstr(appdata, "SHELL") || /* NoOp(${SHELL(rm -rf /)}) */ + strstr(appdata, "EVAL") /* NoOp(${EVAL(${some_var_containing_SHELL})}) */ + )) { diff --git a/net/asterisk-1.8.x/src-lantiq/channels/chan_lantiq.c b/net/asterisk-1.8.x/src-lantiq/channels/chan_lantiq.c new file mode 100644 index 0000000..1686baa --- /dev/null +++ b/net/asterisk-1.8.x/src-lantiq/channels/chan_lantiq.c @@ -0,0 +1,1560 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2012, Luka Perkov + * Copyright (C) 2012, John Crispin + * Copyright (C) 2012, Andrej VlaÅ¡ić + * Copyright (C) 2012, Kaspar Schleiser for T-Labs + * (Deutsche Telekom Innovation Laboratories) + * Copyright (C) 2012, Mirko Vogt for T-Labs + * (Deutsche Telekom Innovation Laboratories) + * + * Luka Perkov + * John Crispin + * Andrej VlaÅ¡ić + * Kaspar Schleiser + * Mirko Vogt + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*! \file + * + * \brief Asterisk channel line driver for Lantiq based TAPI boards + * + * \author Luka Perkov + * \author John Crispin + * \author Andrej VlaÅ¡ić + * \author Kaspar Schleiser + * \author Mirko Vogt + * + * \ingroup channel_drivers + */ + +#include "asterisk.h" + +ASTERISK_FILE_VERSION(__FILE__, "$Revision: xxx $") + +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_LINUX_COMPILER_H +#include +#endif +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Lantiq TAPI includes */ +#include +#include + +#define RTP_HEADER_LEN 12 + +#define TAPI_AUDIO_PORT_NUM_MAX 2 +#define TAPI_TONE_LOCALE_NONE 0 +#define TAPI_TONE_LOCALE_RINGING_CODE 26 +#define TAPI_TONE_LOCALE_BUSY_CODE 27 +#define TAPI_TONE_LOCALE_CONGESTION_CODE 27 +#define TAPI_TONE_LOCALE_DIAL_CODE 25 +#define TAPI_TONE_LOCALE_WAITING_CODE 37 + +#define LANTIQ_CONTEXT_PREFIX "lantiq" + +static const char config[] = "lantiq.conf"; + +static char firmware_filename[PATH_MAX] = "/lib/firmware/ifx_firmware.bin"; +static char bbd_filename[PATH_MAX] = "/lib/firmware/ifx_bbd_fxs.bin"; +static char base_path[PATH_MAX] = "/dev/vmmc"; +static int per_channel_context = 0; + +/* + * The private structures of the Phone Jack channels are linked for selecting + * outgoing channels. + */ +enum channel_state { + ONHOOK, + OFFHOOK, + DIALING, + INCALL, + CALL_ENDED, + RINGING, + UNKNOWN +}; + +static struct lantiq_pvt { + struct ast_channel *owner; /* Channel we belong to, possibly NULL */ + int port_id; /* Port number of this object, 0..n */ + int channel_state; + char context[AST_MAX_CONTEXT]; /* this port's dialplan context */ + char ext[AST_MAX_EXTENSION+1]; /* the extension this port is connecting*/ + int dial_timer; /* timer handle for autodial timeout */ + char dtmfbuf[AST_MAX_EXTENSION+1]; /* buffer holding dialed digits */ + int dtmfbuf_len; /* lenght of dtmfbuf */ + int rtp_timestamp; /* timestamp for RTP packets */ + uint16_t rtp_seqno; /* Sequence nr for RTP packets */ +} *iflist = NULL; + +static struct lantiq_ctx { + int dev_fd; + int channels; + int ch_fd[TAPI_AUDIO_PORT_NUM_MAX]; +} dev_ctx; + +static int ast_digit_begin(struct ast_channel *ast, char digit); +static int ast_digit_end(struct ast_channel *ast, char digit, unsigned int duration); +static int ast_lantiq_call(struct ast_channel *ast, char *dest, int timeout); +static int ast_lantiq_hangup(struct ast_channel *ast); +static int ast_lantiq_answer(struct ast_channel *ast); +static struct ast_frame *ast_lantiq_read(struct ast_channel *ast); +static int ast_lantiq_write(struct ast_channel *ast, struct ast_frame *frame); +static struct ast_frame *ast_lantiq_exception(struct ast_channel *ast); +static int ast_lantiq_indicate(struct ast_channel *chan, int condition, const void *data, size_t datalen); +static int ast_lantiq_fixup(struct ast_channel *old, struct ast_channel *new); +static struct ast_channel *ast_lantiq_requester(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *cause); + +static const struct ast_channel_tech lantiq_tech = { + .type = "TAPI", + .description = "Lantiq TAPI Telephony API Driver", + .capabilities = AST_FORMAT_G723_1 | AST_FORMAT_SLINEAR | AST_FORMAT_ULAW | AST_FORMAT_G729A, + .send_digit_begin = ast_digit_begin, + .send_digit_end = ast_digit_end, + .call = ast_lantiq_call, + .hangup = ast_lantiq_hangup, + .answer = ast_lantiq_answer, + .read = ast_lantiq_read, + .write = ast_lantiq_write, + .exception = ast_lantiq_exception, + .indicate = ast_lantiq_indicate, + .fixup = ast_lantiq_fixup, + .requester = ast_lantiq_requester +}; + +/* Protect the interface list (of lantiq_pvt's) */ +AST_MUTEX_DEFINE_STATIC(iflock); + +/* + * Protect the monitoring thread, so only one process can kill or start it, and + * not when it's doing something critical. + */ +AST_MUTEX_DEFINE_STATIC(monlock); + +/* Boolean value whether the monitoring thread shall continue. */ +static unsigned int monitor; + +/* The scheduling thread */ +struct ast_sched_thread *sched_thread; + +/* + * This is the thread for the monitor which checks for input on the channels + * which are not currently in use. + */ +static pthread_t monitor_thread = AST_PTHREADT_NULL; + + +#define WORDS_BIGENDIAN +/* struct taken from some GPLed code by Mike Borella */ +typedef struct rtp_header +{ +#if defined(WORDS_BIGENDIAN) + uint8_t version:2, padding:1, extension:1, csrc_count:4; +#else + uint8_t csrc_count:4, extension:1, padding:1, version:2; +#endif +#if defined(WORDS_BIGENDIAN) + uint8_t marker:1, payload_type:7; +#else + uint8_t payload_type:7, marker:1; +#endif + uint16_t seqno; + uint32_t timestamp; + uint32_t ssrc; +} rtp_header_t; + +static int lantiq_dev_open(const char *dev_path, const int32_t ch_num) +{ + char dev_name[PATH_MAX]; + memset(dev_name, 0, sizeof(dev_name)); + snprintf(dev_name, PATH_MAX, "%s%u%u", dev_path, 1, ch_num); + return open((const char*)dev_name, O_RDWR, 0644); +} + +static void lantiq_ring(int c, int r) +{ + uint8_t status; + + if (r) { + status = (uint8_t) ioctl(dev_ctx.ch_fd[c], IFX_TAPI_RING_START, 0); + } else { + status = (uint8_t) ioctl(dev_ctx.ch_fd[c], IFX_TAPI_RING_STOP, 0); + } + + if (status) { + ast_log(LOG_ERROR, "%s ioctl failed\n", + (r ? "IFX_TAPI_RING_START" : "IFX_TAPI_RING_STOP")); + } +} + +static int lantiq_play_tone(int c, int t) +{ + /* stop currently playing tone before starting new one */ + if (t != TAPI_TONE_LOCALE_NONE) { + ioctl(dev_ctx.ch_fd[c], IFX_TAPI_TONE_LOCAL_PLAY, TAPI_TONE_LOCALE_NONE); + } + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_TONE_LOCAL_PLAY, t)) { + ast_log(LOG_ERROR, "IFX_TAPI_TONE_LOCAL_PLAY ioctl failed\n"); + return -1; + } + + return 0; +} + +static enum channel_state lantiq_get_hookstatus(int port) +{ + uint8_t status; + + if (ioctl(dev_ctx.ch_fd[port], IFX_TAPI_LINE_HOOK_STATUS_GET, &status)) { + ast_log(LOG_ERROR, "IFX_TAPI_LINE_HOOK_STATUS_GET ioctl failed\n"); + return UNKNOWN; + } + + if (status) { + return OFFHOOK; + } else { + return ONHOOK; + } +} + +static int +lantiq_dev_binary_buffer_create(const char *path, uint8_t **ppBuf, uint32_t *pBufSz) +{ + FILE *fd; + struct stat file_stat; + int32_t status = 0; + + fd = fopen(path, "rb"); + if (fd == NULL) { + ast_log(LOG_ERROR, "binary file %s open failed\n", path); + return -1; + } + + if (stat(path, &file_stat)) { + ast_log(LOG_ERROR, "file %s statistics get failed\n", path); + return -1; + } + + *ppBuf = malloc(file_stat.st_size); + if (*ppBuf == NULL) { + ast_log(LOG_ERROR, "binary file %s memory allocation failed\n", path); + status = -1; + goto on_exit; + } + + if (fread (*ppBuf, sizeof(uint8_t), file_stat.st_size, fd) <= 0) { + ast_log(LOG_ERROR, "file %s read failed\n", path); + status = -1; + goto on_exit; + } + + *pBufSz = file_stat.st_size; + +on_exit: + if (fd != NULL) + fclose(fd); + + if (*ppBuf != NULL && status) + free(*ppBuf); + + return status; +} + +static int32_t lantiq_dev_firmware_download(int32_t fd, const char *path) +{ + uint8_t *firmware = NULL; + uint32_t size = 0; + VMMC_IO_INIT vmmc_io_init; + + ast_log(LOG_DEBUG, "loading firmware: \"%s\".", path); + + if (lantiq_dev_binary_buffer_create(path, &firmware, &size)) + return -1; + + memset(&vmmc_io_init, 0, sizeof(VMMC_IO_INIT)); + vmmc_io_init.pPRAMfw = firmware; + vmmc_io_init.pram_size = size; + + if (ioctl(fd, FIO_FW_DOWNLOAD, &vmmc_io_init)) { + ast_log(LOG_ERROR, "FIO_FW_DOWNLOAD ioctl failed\n"); + return -1; + } + + if (firmware != NULL) + free(firmware); + + return 0; +} + +static const char *state_string(enum channel_state s) +{ + switch (s) { + case ONHOOK: return "ONHOOK"; + case OFFHOOK: return "OFFHOOK"; + case DIALING: return "DIALING"; + case INCALL: return "INCALL"; + case CALL_ENDED: return "CALL_ENDED"; + case RINGING: return "RINGING"; + default: return "UNKNOWN"; + } +} + +static const char *control_string(int c) +{ + switch (c) { + case AST_CONTROL_HANGUP: return "Other end has hungup"; + case AST_CONTROL_RING: return "Local ring"; + case AST_CONTROL_RINGING: return "Remote end is ringing"; + case AST_CONTROL_ANSWER: return "Remote end has answered"; + case AST_CONTROL_BUSY: return "Remote end is busy"; + case AST_CONTROL_TAKEOFFHOOK: return "Make it go off hook"; + case AST_CONTROL_OFFHOOK: return "Line is off hook"; + case AST_CONTROL_CONGESTION: return "Congestion (circuits busy)"; + case AST_CONTROL_FLASH: return "Flash hook"; + case AST_CONTROL_WINK: return "Wink"; + case AST_CONTROL_OPTION: return "Set a low-level option"; + case AST_CONTROL_RADIO_KEY: return "Key Radio"; + case AST_CONTROL_RADIO_UNKEY: return "Un-Key Radio"; + case AST_CONTROL_PROGRESS: return "Remote end is making Progress"; + case AST_CONTROL_PROCEEDING: return "Remote end is proceeding"; + case AST_CONTROL_HOLD: return "Hold"; + case AST_CONTROL_UNHOLD: return "Unhold"; + case AST_CONTROL_SRCUPDATE: return "Media Source Update"; + case AST_CONTROL_CONNECTED_LINE: return "Connected Line"; + case AST_CONTROL_REDIRECTING: return "Redirecting"; + case AST_CONTROL_INCOMPLETE: return "Incomplete"; + case -1: return "Stop tone"; + default: return "Unknown"; + } +} + +static int ast_lantiq_indicate(struct ast_channel *chan, int condition, const void *data, size_t datalen) +{ + ast_verb(3, "phone indication \"%s\"\n", control_string(condition)); + + struct lantiq_pvt *pvt = chan->tech_pvt; + + switch (condition) { + case -1: + { + lantiq_play_tone(pvt->port_id, TAPI_TONE_LOCALE_NONE); + return 0; + } + case AST_CONTROL_CONGESTION: + case AST_CONTROL_BUSY: + { + lantiq_play_tone(pvt->port_id, TAPI_TONE_LOCALE_BUSY_CODE); + return 0; + } + case AST_CONTROL_RINGING: + { + lantiq_play_tone(pvt->port_id, TAPI_TONE_LOCALE_RINGING_CODE); + return 0; + } + default: + { + /* -1 lets asterisk generate the tone */ + return -1; + } + } +} + +static int ast_lantiq_fixup(struct ast_channel *old, struct ast_channel *new) +{ + ast_log(LOG_DEBUG, "entering... no code here...\n"); + return 0; +} + +static int ast_digit_begin(struct ast_channel *chan, char digit) +{ + /* TODO: Modify this callback to let Asterisk support controlling the length of DTMF */ + ast_log(LOG_DEBUG, "entering... no code here...\n"); + return 0; +} + +static int ast_digit_end(struct ast_channel *ast, char digit, unsigned int duration) +{ + ast_log(LOG_DEBUG, "entering... no code here...\n"); + return 0; +} + +static int ast_lantiq_call(struct ast_channel *ast, char *dest, int timeout) +{ + /* lock to prevent simultaneous access with do_monitor thread processing */ + ast_mutex_lock(&iflock); + + struct lantiq_pvt *pvt = ast->tech_pvt; + ast_log(LOG_DEBUG, "state: %s\n", state_string(pvt->channel_state)); + + if (pvt->channel_state == ONHOOK) { + ast_log(LOG_DEBUG, "port %i is ringing\n", pvt->port_id); + lantiq_ring(pvt->port_id, 1); + pvt->channel_state = RINGING; + + ast_setstate(ast, AST_STATE_RINGING); + ast_queue_control(ast, AST_CONTROL_RINGING); + } else { + ast_log(LOG_DEBUG, "port %i is busy\n", pvt->port_id); + ast_setstate(ast, AST_STATE_BUSY); + ast_queue_control(ast, AST_CONTROL_BUSY); + } + + ast_mutex_unlock(&iflock); + + return 0; +} + +static int ast_lantiq_hangup(struct ast_channel *ast) +{ + /* lock to prevent simultaneous access with do_monitor thread processing */ + ast_mutex_lock(&iflock); + + struct lantiq_pvt *pvt = ast->tech_pvt; + ast_log(LOG_DEBUG, "state: %s\n", state_string(pvt->channel_state)); + + if (ast->_state == AST_STATE_RINGING) { + // FIXME + ast_debug(1, "TAPI: ast_lantiq_hangup(): ast->_state == AST_STATE_RINGING\n"); + } + + switch (pvt->channel_state) { + case RINGING: + case ONHOOK: + lantiq_ring(pvt->port_id, 0); + pvt->channel_state = ONHOOK; + break; + default: + ast_log(LOG_DEBUG, "we were hung up, play busy tone\n"); + pvt->channel_state = CALL_ENDED; + lantiq_play_tone(pvt->port_id, TAPI_TONE_LOCALE_BUSY_CODE); + } + + ast_setstate(ast, AST_STATE_DOWN); + ast_module_unref(ast_module_info->self); + ast->tech_pvt = NULL; + pvt->owner = NULL; + + ast_mutex_unlock(&iflock); + + return 0; +} + +static int ast_lantiq_answer(struct ast_channel *ast) +{ + ast_log(LOG_DEBUG, "entering... no code here...\n"); + return 0; +} + +static struct ast_frame * ast_lantiq_read(struct ast_channel *ast) +{ + ast_log(LOG_DEBUG, "entering... no code here...\n"); + return NULL; +} + +static int ast_lantiq_write(struct ast_channel *ast, struct ast_frame *frame) +{ + char buf[2048]; + struct lantiq_pvt *pvt = ast->tech_pvt; + int ret = -1; + rtp_header_t *rtp_header = (rtp_header_t *) buf; + + if(frame->frametype != AST_FRAME_VOICE) { + ast_log(LOG_DEBUG, "unhandled frame type\n"); + return 0; + } + + if (frame->datalen == 0) { + ast_log(LOG_DEBUG, "we've been prodded\n"); + return 0; + } + + memset(buf, 0, sizeof(rtp_header_t)); + rtp_header->version = 2; + rtp_header->padding = 0; + rtp_header->extension = 0; + rtp_header->csrc_count = 0; + rtp_header->marker = 0; + rtp_header->timestamp = pvt->rtp_timestamp; + rtp_header->seqno = pvt->rtp_seqno++; + rtp_header->ssrc = 0; + rtp_header->payload_type = (uint8_t) frame->subclass.codec; + + pvt->rtp_timestamp += 160; + + memcpy(buf+RTP_HEADER_LEN, frame->data.ptr, frame->datalen); + + ret = write(dev_ctx.ch_fd[pvt->port_id], buf, frame->datalen+RTP_HEADER_LEN); + if (ret <= 0) { + ast_debug(1, "TAPI: ast_lantiq_write(): error writing.\n"); + return -1; + } + +#ifdef TODO_DEVEL_INFO + ast_debug(1, "ast_lantiq_write(): size: %i version: %i padding: %i extension: %i csrc_count: %i\n" + "marker: %i payload_type: %s seqno: %i timestamp: %i ssrc: %i\n", + (int)ret, + (int)rtp_header->version, + (int)rtp_header->padding, + (int)rtp_header->extension, + (int)rtp_header->csrc_count, + (int)rtp_header->marker, + ast_codec2str(rtp_header->payload_type), + (int)rtp_header->seqno, + (int)rtp_header->timestamp, + (int)rtp_header->ssrc); +#endif + + return 0; +} + +static struct ast_frame * ast_lantiq_exception(struct ast_channel *ast) +{ + ast_log(LOG_DEBUG, "entering... no code here...\n"); + return NULL; +} + +static int lantiq_standby(int c) +{ + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_LINE_FEED_SET, IFX_TAPI_LINE_FEED_STANDBY)) { + ast_log(LOG_ERROR, "IFX_TAPI_LINE_FEED_SET ioctl failed\n"); + return -1; + } + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_ENC_STOP, 0)) { + ast_log(LOG_ERROR, "IFX_TAPI_ENC_STOP ioctl failed\n"); + return -1; + } + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_DEC_STOP, 0)) { + ast_log(LOG_ERROR, "IFX_TAPI_DEC_STOP ioctl failed\n"); + return -1; + } + + return lantiq_play_tone(c, TAPI_TONE_LOCALE_NONE); +} + +static int lantiq_end_dialing(int c) +{ + ast_log(LOG_DEBUG, "TODO - DEBUG MSG"); + struct lantiq_pvt *pvt = &iflist[c]; + + if (pvt->dial_timer) { + ast_sched_thread_del(sched_thread, pvt->dial_timer); + pvt->dial_timer = 0; + } + + if(pvt->owner) { + ast_hangup(pvt->owner); + } + + return 0; +} + +static int lantiq_end_call(int c) +{ + ast_log(LOG_DEBUG, "TODO - DEBUG MSG"); + + struct lantiq_pvt *pvt = &iflist[c]; + + if(pvt->owner) { + ast_queue_hangup(pvt->owner); + } + + return 0; +} + +static struct ast_channel * lantiq_channel(int state, int c, char *ext, char *ctx) +{ + ast_log(LOG_DEBUG, "TODO - DEBUG MSG"); + + struct ast_channel *chan = NULL; + + struct lantiq_pvt *pvt = &iflist[c]; + + chan = ast_channel_alloc(1, state, NULL, NULL, "", ext, ctx, 0, c, "TAPI/%s", "1"); + + chan->tech = &lantiq_tech; + chan->nativeformats = AST_FORMAT_ULAW; + chan->readformat = AST_FORMAT_ULAW; + chan->writeformat = AST_FORMAT_ULAW; + chan->tech_pvt = pvt; + + pvt->owner = chan; + + return chan; +} + +static struct ast_channel * ast_lantiq_requester(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *cause) +{ + ast_mutex_lock(&iflock); + + char buf[BUFSIZ]; + struct ast_channel *chan = NULL; + int port_id = -1; + + ast_debug(1, "Asked to create a TAPI channel with formats: %s\n", ast_getformatname_multiple(buf, sizeof(buf), format)); + + + /* check for correct data argument */ + if (ast_strlen_zero(data)) { + ast_log(LOG_ERROR, "Unable to create channel with empty destination.\n"); + *cause = AST_CAUSE_CHANNEL_UNACCEPTABLE; + return NULL; + } + + /* get our port number */ + port_id = atoi((char*) data); + if (port_id < 1 || port_id > dev_ctx.channels) { + ast_log(LOG_ERROR, "Unknown channel ID: \"%s\"\n", (char*) data); + *cause = AST_CAUSE_CHANNEL_UNACCEPTABLE; + return NULL; + } + + /* on asterisk user's side, we're using port 1-2. + * Here in non normal human's world, we begin + * counting at 0. + */ + port_id -= 1; + + chan = lantiq_channel(AST_STATE_DOWN, port_id, NULL, NULL); + + ast_mutex_unlock(&iflock); + return chan; +} + +static int lantiq_dev_data_handler(int c) +{ + char buf[BUFSIZ]; + struct ast_frame frame = {0}; + + int res = read(dev_ctx.ch_fd[c], buf, sizeof(buf)); + if (res <= 0) ast_log(LOG_ERROR, "we got read error %i\n", res); + + rtp_header_t *rtp = (rtp_header_t*) buf; + + frame.src = "TAPI"; + frame.frametype = AST_FRAME_VOICE; + frame.subclass.codec = rtp->payload_type; + frame.samples = res - RTP_HEADER_LEN; + frame.datalen = res - RTP_HEADER_LEN; + frame.data.ptr = buf + RTP_HEADER_LEN; + + ast_mutex_lock(&iflock); + struct lantiq_pvt *pvt = (struct lantiq_pvt *) &iflist[c]; + if (pvt->owner && (pvt->owner->_state == AST_STATE_UP)) { + if(!ast_channel_trylock(pvt->owner)) { + ast_queue_frame(pvt->owner, &frame); + ast_channel_unlock(pvt->owner); + } + } + + ast_mutex_unlock(&iflock); + +/* ast_debug(1, "lantiq_dev_data_handler(): size: %i version: %i padding: %i extension: %i csrc_count: %i \n" + "marker: %i payload_type: %s seqno: %i timestamp: %i ssrc: %i\n", + (int)res, + (int)rtp->version, + (int)rtp->padding, + (int)rtp->extension, + (int)rtp->csrc_count, + (int)rtp->marker, + ast_codec2str(rtp->payload_type), + (int)rtp->seqno, + (int)rtp->timestamp, + (int)rtp->ssrc); +*/ + return 0; +} + +static int accept_call(int c) +{ + ast_log(LOG_DEBUG, "TODO - DEBUG MSG"); + + struct lantiq_pvt *pvt = &iflist[c]; + + if (pvt->owner) { + struct ast_channel *chan = pvt->owner; + + switch (chan->_state) { + case AST_STATE_RINGING: + ast_queue_control(pvt->owner, AST_CONTROL_ANSWER); + pvt->channel_state = INCALL; + break; + default: + ast_log(LOG_WARNING, "entered unhandled state %s\n", ast_state2str(chan->_state)); + } + } + + return 0; +} + +static int lantiq_dev_event_hook(int c, int state) +{ + ast_mutex_lock(&iflock); + + ast_log(LOG_DEBUG, "on port %i detected event %s hook\n", c, state ? "on" : "off"); + + int ret = -1; + if (state) { + switch (iflist[c].channel_state) { + case OFFHOOK: + ret = lantiq_standby(c); + break; + case DIALING: + ret = lantiq_end_dialing(c); + break; + case INCALL: + ret = lantiq_end_call(c); + break; + case CALL_ENDED: + ret = lantiq_standby(c); // TODO: are we sure for this ? + break; + default: + break; + } + iflist[c].channel_state = ONHOOK; + } else { + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_LINE_FEED_SET, IFX_TAPI_LINE_FEED_ACTIVE)) { + ast_log(LOG_ERROR, "IFX_TAPI_LINE_FEED_SET ioctl failed\n"); + goto out; + } + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_ENC_START, 0)) { + ast_log(LOG_ERROR, "IFX_TAPI_ENC_START ioctl failed\n"); + goto out; + } + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_DEC_START, 0)) { + ast_log(LOG_ERROR, "IFX_TAPI_DEC_START ioctl failed\n"); + goto out; + } + + switch (iflist[c].channel_state) { + case RINGING: + ret = accept_call(c); + break; + default: + iflist[c].channel_state = OFFHOOK; + lantiq_play_tone(c, TAPI_TONE_LOCALE_DIAL_CODE); + ret = 0; + break; + } + + } + +out: + ast_mutex_unlock(&iflock); + + return ret; +} + +static void lantiq_reset_dtmfbuf(struct lantiq_pvt *pvt) +{ + pvt->dtmfbuf[0] = '\0'; + pvt->dtmfbuf_len = 0; + pvt->ext[0] = '\0'; +} + +static void lantiq_dial(struct lantiq_pvt *pvt) +{ + struct ast_channel *chan = NULL; + + ast_log(LOG_DEBUG, "user want's to dial %s.\n", pvt->dtmfbuf); + + if (ast_exists_extension(NULL, pvt->context, pvt->dtmfbuf, 1, NULL)) { + ast_debug(1, "found extension %s, dialing\n", pvt->dtmfbuf); + + strcpy(pvt->ext, pvt->dtmfbuf); + + ast_verbose(VERBOSE_PREFIX_3 " extension exists, starting PBX %s\n", pvt->ext); + + chan = lantiq_channel(AST_STATE_UP, 1, pvt->ext+1, pvt->context); + chan->tech_pvt = pvt; + pvt->owner = chan; + + strcpy(chan->exten, pvt->ext); + ast_setstate(chan, AST_STATE_RING); + pvt->channel_state = INCALL; + + if (ast_pbx_start(chan)) { + ast_log(LOG_WARNING, " unable to start PBX on %s\n", chan->name); + ast_hangup(chan); + } + } else { + ast_log(LOG_DEBUG, "no extension found\n"); + lantiq_play_tone(pvt->port_id, TAPI_TONE_LOCALE_BUSY_CODE); + pvt->channel_state = CALL_ENDED; + } + + lantiq_reset_dtmfbuf(pvt); +} + +static int lantiq_event_dial_timeout(const void* data) +{ + ast_debug(1, "TAPI: lantiq_event_dial_timeout()\n"); + + struct lantiq_pvt *pvt = (struct lantiq_pvt *) data; + pvt->dial_timer = 0; + + if (! pvt->channel_state == ONHOOK) { + lantiq_dial(pvt); + } else { + ast_debug(1, "TAPI: lantiq_event_dial_timeout(): dial timeout in state ONHOOK.\n"); + } + + return 0; +} + +static int lantiq_send_digit(int c, char digit) +{ + struct lantiq_pvt *pvt = &iflist[c]; + + struct ast_frame f = { .frametype = AST_FRAME_DTMF, .subclass.integer = digit }; + + if (pvt->owner) { + ast_log(LOG_DEBUG, "Port %i transmitting digit \"%c\"\n", c, digit); + return ast_queue_frame(pvt->owner, &f); + } else { + ast_debug(1, "Warning: lantiq_send_digit() without owner!\n"); + return -1; + } +} + +static void lantiq_dev_event_digit(int c, char digit) +{ + ast_mutex_lock(&iflock); + + ast_log(LOG_DEBUG, "on port %i detected digit \"%c\"\n", c, digit); + + struct lantiq_pvt *pvt = &iflist[c]; + + switch (pvt->channel_state) { + case INCALL: + { + lantiq_send_digit(c, digit); + break; + } + case OFFHOOK: + pvt->channel_state = DIALING; + + lantiq_play_tone(c, TAPI_TONE_LOCALE_NONE); + + /* fall through */ + case DIALING: + if (digit == '#') { + if (pvt->dial_timer) { + ast_sched_thread_del(sched_thread, pvt->dial_timer); + pvt->dial_timer = 0; + } + + lantiq_dial(pvt); + } else { + pvt->dtmfbuf[pvt->dtmfbuf_len] = digit; + pvt->dtmfbuf_len++; + pvt->dtmfbuf[pvt->dtmfbuf_len] = '\0'; + + /* setup autodial timer */ + if (!pvt->dial_timer) { + ast_log(LOG_DEBUG, "setting new timer\n"); + pvt->dial_timer = ast_sched_thread_add(sched_thread, 2000, lantiq_event_dial_timeout, (const void*) pvt); + } else { + ast_log(LOG_DEBUG, "replacing timer\n"); + struct sched_context *sched = ast_sched_thread_get_context(sched_thread); + AST_SCHED_REPLACE(pvt->dial_timer, sched, 2000, lantiq_event_dial_timeout, (const void*) pvt); + } + } + break; + default: + ast_log(LOG_ERROR, "don't know what to do in unhandled state\n"); + break; + } + + ast_mutex_unlock(&iflock); + return; +} + +static void lantiq_dev_event_handler(void) +{ + IFX_TAPI_EVENT_t event; + unsigned int i; + + for (i = 0; i < dev_ctx.channels ; i++) { + ast_mutex_lock(&iflock); + + memset (&event, 0, sizeof(event)); + event.ch = i; + if (ioctl(dev_ctx.dev_fd, IFX_TAPI_EVENT_GET, &event)) { + ast_mutex_unlock(&iflock); + continue; + } + if (event.id == IFX_TAPI_EVENT_NONE) { + ast_mutex_unlock(&iflock); + continue; + } + + ast_mutex_unlock(&iflock); + + switch(event.id) { + case IFX_TAPI_EVENT_FXS_ONHOOK: + lantiq_dev_event_hook(i, 1); + break; + case IFX_TAPI_EVENT_FXS_OFFHOOK: + lantiq_dev_event_hook(i, 0); + break; + case IFX_TAPI_EVENT_DTMF_DIGIT: + lantiq_dev_event_digit(i, (char)event.data.dtmf.ascii); + break; + case IFX_TAPI_EVENT_PULSE_DIGIT: + if (event.data.pulse.digit == 0xB) { + lantiq_dev_event_digit(i, '0'); + } else { + lantiq_dev_event_digit(i, '0' + (char)event.data.pulse.digit); + } + break; + case IFX_TAPI_EVENT_COD_DEC_CHG: + case IFX_TAPI_EVENT_TONE_GEN_END: + case IFX_TAPI_EVENT_CID_TX_SEQ_END: + break; + default: + ast_log(LOG_ERROR, "unknown TAPI event %08X\n", event.id); + break; + } + } +} + +static void * lantiq_events_monitor(void *data) +{ + ast_verbose("TAPI thread started\n"); + + struct pollfd fds[3]; + + fds[0].fd = dev_ctx.dev_fd; + fds[0].events = POLLIN; + fds[1].fd = dev_ctx.ch_fd[0]; + fds[1].events = POLLIN; + fds[2].fd = dev_ctx.ch_fd[1]; + fds[2].events = POLLIN; + + while (monitor) { + ast_mutex_lock(&monlock); + + if (poll(fds, dev_ctx.channels + 1, 2000) <= 0) { + ast_mutex_unlock(&monlock); + continue; + } + + if (fds[0].revents & POLLIN) { + lantiq_dev_event_handler(); + } + + ast_mutex_unlock(&monlock); + + if ((fds[1].revents & POLLIN) && (lantiq_dev_data_handler(0))) { + ast_log(LOG_ERROR, "data handler 0 failed\n"); + break; + } + + if ((fds[2].revents & POLLIN) && (lantiq_dev_data_handler(1))) { + ast_log(LOG_ERROR, "data handler 1 failed\n"); + break; + } + } + + return NULL; +} + +static int restart_monitor(void) +{ + /* If we're supposed to be stopped -- stay stopped */ + if (monitor_thread == AST_PTHREADT_STOP) + return 0; + + ast_mutex_lock(&monlock); + + if (monitor_thread == pthread_self()) { + ast_mutex_unlock(&monlock); + ast_log(LOG_WARNING, "Cannot kill myself\n"); + return -1; + } + + if (monitor_thread != AST_PTHREADT_NULL) { + if (ast_mutex_lock(&iflock)) { + ast_mutex_unlock(&monlock); + ast_log(LOG_WARNING, "Unable to lock the interface list\n"); + return -1; + } + monitor = 0; + while (pthread_kill(monitor_thread, SIGURG) == 0) + sched_yield(); + pthread_join(monitor_thread, NULL); + ast_mutex_unlock(&iflock); + } + + monitor = 1; + /* Start a new monitor */ + if (ast_pthread_create_background(&monitor_thread, NULL, lantiq_events_monitor, NULL) < 0) { + ast_mutex_unlock(&monlock); + ast_log(LOG_ERROR, "Unable to start monitor thread.\n"); + return -1; + } + + ast_mutex_unlock(&monlock); + + return 0; +} + +static void lantiq_cleanup(void) +{ + int c; + + for (c = 0; c < dev_ctx.channels ; c++) { + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_LINE_FEED_SET, IFX_TAPI_LINE_FEED_STANDBY)) { + ast_log(LOG_WARNING, "IFX_TAPI_LINE_FEED_SET ioctl failed\n"); + } + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_ENC_STOP, 0)) { + ast_log(LOG_WARNING, "IFX_TAPI_ENC_STOP ioctl failed\n"); + } + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_DEC_STOP, 0)) { + ast_log(LOG_WARNING, "IFX_TAPI_DEC_STOP ioctl failed\n"); + } + } + + if (ioctl(dev_ctx.dev_fd, IFX_TAPI_DEV_STOP, 0)) { + ast_log(LOG_WARNING, "IFX_TAPI_DEV_STOP ioctl failed\n"); + } + + close(dev_ctx.dev_fd); +} + +static int unload_module(void) +{ + int c; + + ast_channel_unregister(&lantiq_tech); + + if (!ast_mutex_lock(&iflock)) { + for (c = 0; c < dev_ctx.channels ; c++) { + if (iflist[c].owner) + ast_softhangup(iflist[c].owner, AST_SOFTHANGUP_APPUNLOAD); + } + ast_mutex_unlock(&iflock); + } else { + ast_log(LOG_WARNING, "Unable to lock the monitor\n"); + return -1; + } + + if (!ast_mutex_lock(&monlock)) { + if (monitor_thread > AST_PTHREADT_NULL) { + monitor = 0; + while (pthread_kill(monitor_thread, SIGURG) == 0) + sched_yield(); + pthread_join(monitor_thread, NULL); + } + monitor_thread = AST_PTHREADT_STOP; + ast_mutex_unlock(&monlock); + } else { + ast_log(LOG_WARNING, "Unable to lock the monitor\n"); + return -1; + } + + return 0; +} + +static struct lantiq_pvt *lantiq_init_pvt(struct lantiq_pvt *pvt) +{ + if (pvt) { + pvt->owner = NULL; + pvt->port_id = -1; + pvt->channel_state = UNKNOWN; + pvt->context[0] = '\0'; + pvt->ext[0] = '\0'; + pvt->dial_timer = 0; + pvt->dtmfbuf[0] = '\0'; + pvt->dtmfbuf_len = 0; + } else { + ast_log(LOG_ERROR, "unable to clear pvt structure\n"); + } + + return pvt; +} + +static int lantiq_create_pvts(void) +{ + int i; + + iflist = ast_calloc(1, sizeof(struct lantiq_pvt) * dev_ctx.channels); + + if (iflist) { + for (i=0 ; inext) { + if (!strcasecmp(v->name, "channels")) { + dev_ctx.channels = atoi(v->value); + if (!dev_ctx.channels) { + ast_log(LOG_ERROR, "Invalid value for channels in config %s\n", config); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } else if (!strcasecmp(v->name, "firmwarefilename")) { + ast_copy_string(firmware_filename, v->value, sizeof(firmware_filename)); + } else if (!strcasecmp(v->name, "bbdfilename")) { + ast_copy_string(bbd_filename, v->value, sizeof(bbd_filename)); + } else if (!strcasecmp(v->name, "basepath")) { + ast_copy_string(base_path, v->value, sizeof(base_path)); + } else if (!strcasecmp(v->name, "per_channel_context")) { + if (!strcasecmp(v->value, "on")) { + per_channel_context = 1; + } else if (!strcasecmp(v->value, "off")) { + per_channel_context = 0; + } else { + ast_log(LOG_ERROR, "Unknown per_channel_context value '%s'. Try 'on' or 'off'.\n", v->value); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } + } + + for (v = ast_variable_browse(cfg, "general"); v; v = v->next) { + if (!strcasecmp(v->name, "rxgain")) { + rxgain = atoi(v->value); + if (!rxgain) { + rxgain = 0; + ast_log(LOG_WARNING, "Invalid rxgain: %s, using default.\n", v->value); + } + } else if (!strcasecmp(v->name, "txgain")) { + txgain = atoi(v->value); + if (!txgain) { + txgain = 0; + ast_log(LOG_WARNING, "Invalid txgain: %s, using default.\n", v->value); + } + } else if (!strcasecmp(v->name, "echocancel")) { + if (!strcasecmp(v->value, "off")) { + wlec_type = IFX_TAPI_WLEC_TYPE_OFF; + } else if (!strcasecmp(v->value, "nlec")) { + wlec_type = IFX_TAPI_WLEC_TYPE_NE; + if (!strcasecmp(v->name, "echocancelfixedwindowsize")) { + wlec_nbne = atoi(v->value); + } + } else if (!strcasecmp(v->value, "wlec")) { + wlec_type = IFX_TAPI_WLEC_TYPE_NFE; + if (!strcasecmp(v->name, "echocancelnfemovingwindowsize")) { + wlec_nbfe = atoi(v->value); + } else if (!strcasecmp(v->name, "echocancelfixedwindowsize")) { + wlec_nbne = atoi(v->value); + } else if (!strcasecmp(v->name, "echocancelwidefixedwindowsize")) { + wlec_wbne = atoi(v->value); + } + } else if (!strcasecmp(v->value, "nees")) { + wlec_type = IFX_TAPI_WLEC_TYPE_NE_ES; + } else if (!strcasecmp(v->value, "nfees")) { + wlec_type = IFX_TAPI_WLEC_TYPE_NFE_ES; + } else if (!strcasecmp(v->value, "es")) { + wlec_type = IFX_TAPI_WLEC_TYPE_ES; + } else { + wlec_type = IFX_TAPI_WLEC_TYPE_OFF; + ast_log(LOG_ERROR, "Unknown echo cancellation type '%s'\n", v->value); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } else if (!strcasecmp(v->name, "echocancelnlp")) { + if (!strcasecmp(v->value, "on")) { + wlec_nlp = IFX_TAPI_WLEC_NLP_ON; + } else if (!strcasecmp(v->value, "off")) { + wlec_nlp = IFX_TAPI_WLEC_NLP_OFF; + } else { + ast_log(LOG_ERROR, "Unknown echo cancellation nlp '%s'\n", v->value); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } else if (!strcasecmp(v->name, "jitterbuffertype")) { + if (!strcasecmp(v->value, "fixed")) { + jb_type = IFX_TAPI_JB_TYPE_FIXED; + } else if (!strcasecmp(v->value, "adaptive")) { + jb_type = IFX_TAPI_JB_TYPE_ADAPTIVE; + jb_localadpt = IFX_TAPI_JB_LOCAL_ADAPT_DEFAULT; + if (!strcasecmp(v->name, "jitterbufferadaptation")) { + if (!strcasecmp(v->value, "on")) { + jb_localadpt = IFX_TAPI_JB_LOCAL_ADAPT_ON; + } else if (!strcasecmp(v->value, "off")) { + jb_localadpt = IFX_TAPI_JB_LOCAL_ADAPT_OFF; + } + } else if (!strcasecmp(v->name, "jitterbufferscalling")) { + jb_scaling = atoi(v->value); + } else if (!strcasecmp(v->name, "jitterbufferinitialsize")) { + jb_initialsize = atoi(v->value); + } else if (!strcasecmp(v->name, "jitterbufferminsize")) { + jb_minsize = atoi(v->value); + } else if (!strcasecmp(v->name, "jitterbuffermaxsize")) { + jb_maxsize = atoi(v->value); + } + } else { + ast_log(LOG_ERROR, "Unknown jitter buffer type '%s'\n", v->value); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } else if (!strcasecmp(v->name, "jitterbufferpackettype")) { + if (!strcasecmp(v->value, "voice")) { + jb_pckadpt = IFX_TAPI_JB_PKT_ADAPT_VOICE; + } else if (!strcasecmp(v->value, "data")) { + jb_pckadpt = IFX_TAPI_JB_PKT_ADAPT_DATA; + } else if (!strcasecmp(v->value, "datanorep")) { + jb_pckadpt = IFX_TAPI_JB_PKT_ADAPT_DATA_NO_REP; + } else { + ast_log(LOG_ERROR, "Unknown jitter buffer packet adaptation type '%s'\n", v->value); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } else if (!strcasecmp(v->name, "calleridtype")) { + if (!strcasecmp(v->value, "telecordia")) { + cid_type = IFX_TAPI_CID_STD_TELCORDIA; + } else if (!strcasecmp(v->value, "etsifsk")) { + cid_type = IFX_TAPI_CID_STD_ETSI_FSK; + } else if (!strcasecmp(v->value, "etsidtmf")) { + cid_type = IFX_TAPI_CID_STD_ETSI_DTMF; + } else if (!strcasecmp(v->value, "sin")) { + cid_type = IFX_TAPI_CID_STD_SIN; + } else if (!strcasecmp(v->value, "ntt")) { + cid_type = IFX_TAPI_CID_STD_NTT; + } else if (!strcasecmp(v->value, "kpndtmf")) { + cid_type = IFX_TAPI_CID_STD_KPN_DTMF; + } else if (!strcasecmp(v->value, "kpndtmffsk")) { + cid_type = IFX_TAPI_CID_STD_KPN_DTMF_FSK; + } else { + ast_log(LOG_ERROR, "Unknown caller id type '%s'\n", v->value); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } else if (!strcasecmp(v->name, "voiceactivitydetection")) { + if (!strcasecmp(v->value, "on")) { + vad_type = IFX_TAPI_ENC_VAD_ON; + } else if (!strcasecmp(v->value, "g711")) { + vad_type = IFX_TAPI_ENC_VAD_G711; + } else if (!strcasecmp(v->value, "cng")) { + vad_type = IFX_TAPI_ENC_VAD_CNG_ONLY; + } else if (!strcasecmp(v->value, "sc")) { + vad_type = IFX_TAPI_ENC_VAD_SC_ONLY; + } else { + ast_log(LOG_ERROR, "Unknown voice activity detection value '%s'\n", v->value); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } + } + + lantiq_create_pvts(); + + ast_mutex_unlock(&iflock); + + if (ast_channel_register(&lantiq_tech)) { + ast_log(LOG_ERROR, "Unable to register channel class 'Phone'\n"); + ast_config_destroy(cfg); + unload_module(); + return AST_MODULE_LOAD_FAILURE; + } + ast_config_destroy(cfg); + + /* tapi */ +#ifdef TODO_TONES + IFX_TAPI_TONE_t tone; +#endif + IFX_TAPI_DEV_START_CFG_t dev_start; + IFX_TAPI_MAP_DATA_t map_data; + IFX_TAPI_ENC_CFG_t enc_cfg; + IFX_TAPI_LINE_VOLUME_t line_vol; + IFX_TAPI_WLEC_CFG_t wlec_cfg; + IFX_TAPI_JB_CFG_t jb_cfg; + IFX_TAPI_CID_CFG_t cid_cfg; + uint8_t c; + + /* open device */ + dev_ctx.dev_fd = lantiq_dev_open(base_path, 0); + + if (dev_ctx.dev_fd < 0) { + ast_log(LOG_ERROR, "lantiq tapi device open function failed\n"); + return AST_MODULE_LOAD_FAILURE; + } + + for (c = 0; c < dev_ctx.channels ; c++) { + dev_ctx.ch_fd[c] = lantiq_dev_open(base_path, c + 1); + + if (dev_ctx.ch_fd[c] < 0) { + ast_log(LOG_ERROR, "lantiq tapi channel %d open function failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + } + + if (lantiq_dev_firmware_download(dev_ctx.dev_fd, firmware_filename)) { + ast_log(LOG_ERROR, "voice firmware download failed\n"); + return AST_MODULE_LOAD_FAILURE; + } + + if (ioctl(dev_ctx.dev_fd, IFX_TAPI_DEV_STOP, 0)) { + ast_log(LOG_ERROR, "IFX_TAPI_DEV_STOP ioctl failed\n"); + return AST_MODULE_LOAD_FAILURE; + } + + memset(&dev_start, 0x0, sizeof(IFX_TAPI_DEV_START_CFG_t)); + dev_start.nMode = IFX_TAPI_INIT_MODE_VOICE_CODER; + + /* Start TAPI */ + if (ioctl(dev_ctx.dev_fd, IFX_TAPI_DEV_START, &dev_start)) { + ast_log(LOG_ERROR, "IFX_TAPI_DEV_START ioctl failed\n"); + return AST_MODULE_LOAD_FAILURE; + } + + for (c = 0; c < dev_ctx.channels ; c++) { + /* tones */ +#ifdef TODO_TONES + memset(&tone, 0, sizeof(IFX_TAPI_TONE_t)); + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_TONE_TABLE_CFG_SET, &tone)) { + ast_log(LOG_ERROR, "IFX_TAPI_TONE_TABLE_CFG_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } +#endif + /* ringing type */ + IFX_TAPI_RING_CFG_t ringingType; + memset(&ringingType, 0, sizeof(IFX_TAPI_RING_CFG_t)); + ringingType.nMode = IFX_TAPI_RING_CFG_MODE_INTERNAL_BALANCED; + ringingType.nSubmode = IFX_TAPI_RING_CFG_SUBMODE_DC_RNG_TRIP_FAST; + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_RING_CFG_SET, (IFX_int32_t) &ringingType)) { + ast_log(LOG_ERROR, "IFX_TAPI_RING_CFG_SET failed\n"); + return AST_MODULE_LOAD_FAILURE; + } + + /* ring cadence */ + IFX_char_t data[15] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00 }; + + IFX_TAPI_RING_CADENCE_t ringCadence; + memset(&ringCadence, 0, sizeof(IFX_TAPI_RING_CADENCE_t)); + memcpy(&ringCadence.data, data, sizeof(data)); + ringCadence.nr = sizeof(data) * 8; + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_RING_CADENCE_HR_SET, &ringCadence)) { + ast_log(LOG_ERROR, "IFX_TAPI_RING_CADENCE_HR_SET failed\n"); + return AST_MODULE_LOAD_FAILURE; + } + + /* perform mapping */ + memset(&map_data, 0x0, sizeof(IFX_TAPI_MAP_DATA_t)); + map_data.nDstCh = c; + map_data.nChType = IFX_TAPI_MAP_TYPE_PHONE; + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_MAP_DATA_ADD, &map_data)) { + ast_log(LOG_ERROR, "IFX_TAPI_MAP_DATA_ADD %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* set line feed */ + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_LINE_FEED_SET, IFX_TAPI_LINE_FEED_STANDBY)) { + ast_log(LOG_ERROR, "IFX_TAPI_LINE_FEED_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* Configure encoder */ + memset(&enc_cfg, 0x0, sizeof(IFX_TAPI_ENC_CFG_t)); + enc_cfg.nFrameLen = IFX_TAPI_COD_LENGTH_20; + enc_cfg.nEncType = IFX_TAPI_COD_TYPE_MLAW; + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_ENC_CFG_SET, &enc_cfg)) { + ast_log(LOG_ERROR, "IFX_TAPI_ENC_CFG_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* set volume */ + memset(&line_vol, 0, sizeof(line_vol)); + line_vol.nGainRx = rxgain; + line_vol.nGainTx = txgain; + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_PHONE_VOLUME_SET, &line_vol)) { + ast_log(LOG_ERROR, "IFX_TAPI_PHONE_VOLUME_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* Configure line echo canceller */ + memset(&wlec_cfg, 0, sizeof(wlec_cfg)); + wlec_cfg.nType = wlec_type; + wlec_cfg.bNlp = wlec_nlp; + wlec_cfg.nNBFEwindow = wlec_nbfe; + wlec_cfg.nNBNEwindow = wlec_nbne; + wlec_cfg.nWBNEwindow = wlec_wbne; + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_WLEC_PHONE_CFG_SET, &wlec_cfg)) { + ast_log(LOG_ERROR, "IFX_TAPI_WLEC_PHONE_CFG_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* Configure jitter buffer */ + memset(&jb_cfg, 0, sizeof(jb_cfg)); + jb_cfg.nJbType = jb_type; + jb_cfg.nPckAdpt = jb_pckadpt; + jb_cfg.nLocalAdpt = jb_localadpt; + jb_cfg.nScaling = jb_scaling; + jb_cfg.nInitialSize = jb_initialsize; + jb_cfg.nMinSize = jb_minsize; + jb_cfg.nMaxSize = jb_maxsize; + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_JB_CFG_SET, &jb_cfg)) { + ast_log(LOG_ERROR, "IFX_TAPI_JB_CFG_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* Configure Caller ID type */ + memset(&cid_cfg, 0, sizeof(cid_cfg)); + cid_cfg.nStandard = cid_type; + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_CID_CFG_SET, &cid_cfg)) { + ast_log(LOG_ERROR, "IIFX_TAPI_CID_CFG_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* Configure voice activity detection */ + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_ENC_VAD_CFG_SET, vad_type)) { + ast_log(LOG_ERROR, "IFX_TAPI_ENC_VAD_CFG_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* Setup TAPI <-> Asterisk codec type mapping */ + if (lantiq_setup_rtp(c)) { + return AST_MODULE_LOAD_FAILURE; + } + + /* Set initial hook status */ + iflist[c].channel_state = lantiq_get_hookstatus(c); + + if (iflist[c].channel_state == UNKNOWN) { + return AST_MODULE_LOAD_FAILURE; + } + } + + /* make sure our device will be closed properly */ + ast_register_atexit(lantiq_cleanup); + + restart_monitor(); + return AST_MODULE_LOAD_SUCCESS; +} + +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Lantiq TAPI Telephony API Support"); diff --git a/net/asterisk-1.8.x/src-lantiq/configs/lantiq.conf.sample b/net/asterisk-1.8.x/src-lantiq/configs/lantiq.conf.sample new file mode 100644 index 0000000..16ba174 --- /dev/null +++ b/net/asterisk-1.8.x/src-lantiq/configs/lantiq.conf.sample @@ -0,0 +1,138 @@ +; +; TAPI Telephony Interface +; +; Configuration file + +[interfaces] +; +; Number of FXS ports (default: 2) +channels = 2 +; +; Set tapi firmware file path +;firmwarefilename = /lib/firmware/danube_firmware.bin +; +; Set tapi bbd file path +;bbdfilename = /lib/firmware/danube_bbd_fxs.bin +; +; Set vmmc device path +;basepath = /dev/vmmc +; +[general] +; +; Gain setting for the receive and transmit path. +; The value is given in dB within the range (-24dB to +12dB), in 1 dB steps. +; +;rxgain = 1 +;txgain = 1 +; +; +; +; Line echo cancller valid types: +; +; off LEC and echo suppressor turned off. +; nlec LEC using fixed window; no echo suppressor. +; wlec LEC using fixed and moving window; no echo suppressor. +; nees LEC using fixed window and echo suppressor. +; nfees LEC using fixed and moving window and echo suppressor. +; es Echo suppressor +; +;echocancel = off +; +; If nlec or wlec is selected than size of the fixed window in narrowband (8 kHz) sampling mode +; can be defined with: +; A value of 0 defaults to: 16 ms if type is nlec or 8 ms if type is wlec: +; +;echocancelfixedwindowsize = 0 +; +; If wlec is selected than size of the moving window in narrowband (8 kHz) sampling mode +; can be defined with: +; A value of 0 defaults to 8 ms. +; +;echocancelnfemovingwindowsize = 0 +; +; If wlec is selected than size of the moving window in wideband (16 kHz) sampling mode +; can be defined with: +; A value of 0 defaults to 8 ms. +; +;echocancelwidefixedwindowsize = 0 +; +; Activate or deactivate line echo cancller NLP (Non Linear Processor) if the LEC is active, +; valid is on or off: +; +;echocancelnlp = off +; +; +; +; Jitter buffer valid types: +; +; fixed Fixed jitter buffer. +; adaptive Adaptive jitter buffer. +; +;jitterbuffertype = fixed +; +; Jitter buffer packet adaptation valid types: +; +; voice Jitter buffer optimized for voice. +; data Jitter buffer optimized for data. +; datanorep Jitter buffer optimized for data but without doing packet repetition. +; +;jitterbufferpackettype = voice +; +; Following jitter buffer values can only be used with jitter buffer adaptive type: +; Turns on or off jitter buffer adaptation: +; +;jitterbufferadaptation = off +; +; Scaling factor multiplied by 16; in adaptive jitter buffer mode, the target average playout delay is +; equal to the estimated jitter multiplied by the scaling factor. The default value for the scaling factor +; is about 1.4 (scaling=22), meaning that the target average playout delay is equal to the estimated +; jitter. If less packets should be dropped because of jitter, the scaling factor has to be increased. An +; increase in the scaling factor will eventually lead to an increased playout delay. +; The supported range is 1 to 16 (16 up to 256). +; +;jitterbufferscalling = 1 +; +; Initial size of the jitter buffer in time stamps of 125 us: +; +;jitterbufferinitialsize = 125 +; +; Minimum size of the jitter buffer in time stamps of 125 us +; +;jitterbufferminsize = 125 +; +; Maximum size of the jitter buffer in time stamps of 125 us +; +;jitterbuffermaxsize = 125 +; +; +; +; Caller id valid standards: +; +; telecordia Bellcore/Telcordia GR-30-CORE; use Bell202 FSK coding of CID information. (default) +; etsifsk ETSI 300-659-1/2/3 V1.3.1; use V.23 FSK coding to transmit CID information. +; etsidtmf ETSI 300-659-1/2/3 V1.3.1; use DTMF transmission of CID information. +; sin SIN 227 Issue 3.4; use V.23 FSK coding of CID information. +; ntt NTT standard: TELEPHONE SERVICE INTERFACES, edition 5; use a modified V.23 FSK coding of +; CID information. +; kpndtmf KPN; use DTMF transmission of CID information. +; kpndtmffsk KPN; use DTMF and FSK transmission of CID information. +; +;calleridtype = telecordia +; +; +; +; Voice activity detection: +; +; on Voice activity detection on; in this case also comfort noise and spectral +; information (nicer noise) is switched on. +; g711 Voice activity detection on with comfort noise generation, +; but without spectral information. +; cng Voice activity detection on with comfort noise generation, but without silence compression +; sc Voice activity detection on with silence compression, +; but without comfort noise generation. +; +;voiceactivitydetection = on +; +; +; +; diff --git a/net/asterisk-chan-sccp-b/Makefile b/net/asterisk-chan-sccp-b/Makefile new file mode 100644 index 0000000..1c48b48 --- /dev/null +++ b/net/asterisk-chan-sccp-b/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2011 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:=asterisk18-chan-sccp-b +PKG_REV=3004 +PKG_VERSION:=r$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://chan-sccp-b.svn.sourceforge.net/svnroot/chan-sccp-b/trunk +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=svn + +include $(INCLUDE_DIR)/package.mk + +define Package/asterisk18-chan-sccp-b + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + TITLE:=SCCP channel provider for asterisk + URL:=http://chan-sccp-b.net.sourceforge.net/ + MAINTAINER:=Hans Zandbelt + DEPENDS:=+asterisk18 +libltdl +endef + +define Package/asterisk18-chan-sccp-b/description + SCCP channel provider for asterisk. It delivers extended functionality for SCCP phones over chan_skinny delivered + by asterisk by default. +endef + +CONFIGURE_ARGS += \ + --with-asterisk=$(STAGING_DIR)/usr/include/asterisk-1.8 + +define Build/Compile + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + CFLAGS="$(CFLAGS) -DLOW_MEMORY" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/asterisk18-chan-sccp-b/conffiles +/etc/asterisk/sccp.conf +endef + +define Package/asterisk18-chan-sccp-b/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_BIN) ./files/sccp.openwrt.conf $(1)/etc/asterisk/sccp.conf + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_sccp.so $(1)/usr/lib/asterisk/modules/ +endef + +$(eval $(call BuildPackage,asterisk18-chan-sccp-b)) diff --git a/net/asterisk-chan-sccp-b/files/sccp.openwrt.conf b/net/asterisk-chan-sccp-b/files/sccp.openwrt.conf new file mode 100644 index 0000000..c59f4cd --- /dev/null +++ b/net/asterisk-chan-sccp-b/files/sccp.openwrt.conf @@ -0,0 +1,89 @@ +[general] +servername = Openwrt +keepalive = 60 +debug = core +context = default +dateformat = D/M/Y +bindaddr = 192.168.1.1 +port = 2000 +disallow=all +allow=ulaw +allow=alaw +allow=gsm +firstdigittimeout = 16 +digittimeout = 6 +autoanswer_ring_time = 1 +musicclass=default +language=en +deny=0.0.0.0/0.0.0.0 +permit=192.168.1.0/255.255.255.0 +protocolversion=17 + +hotline_enabled=yes +hotline_context=default +hotline_extension=111 + +[SEP001122334455] +type = device +description = Phone Number One +devicetype = 7940 +button = line, 111 +button = line, 113@01:shared +button = speeddial,Phone 2 Line 1, 112, 112@hint + +[SEP00a1a2a3a4a5] +type = device +description = Phone Number Two +devicetype = 7960 +button = line, 112 +button = line, 113@01:shared +button = speeddial,Phone 1 Line 1, 111, 111@hint + +[111] +id = 1000 +type = line +pin = 1234 +label = Phone 1 Line 1 +description = Line 111 +mailbox = 10111 +cid_name = Phone 1 CID +cid_num = 111 +accountcode=79111 +callgroup=1 +pickupgroup=1 +context = default +incominglimit = 2 +vmnum = 600 +trnsfvm = 1000 + +[112] +id = 1001 +type = line +pin = 1234 +label = Phone 2 Line 1 +description = Line 112 +mailbox = 10112 +cid_name = Phone 2 CID +cid_num = 112 +accountcode=79112 +callgroup=1 +pickupgroup=1 +context = default +incominglimit = 2 +vmnum = 600 +trnsfvm = 1000 + +[113] +id = 1002 +type = line +pin = 1234 +label = SharedLine 1 +description = Line 113 +mailbox = 10113 +cid_name = Shared +cid_num = 113 +accountcode=79113 +incominglimit = 2 +vmnum = 600 +trnsfvm = 1000 + diff --git a/net/asterisk-chan-sccp-b/patches/200-register-file-version.patch b/net/asterisk-chan-sccp-b/patches/200-register-file-version.patch new file mode 100644 index 0000000..81ca9d3 --- /dev/null +++ b/net/asterisk-chan-sccp-b/patches/200-register-file-version.patch @@ -0,0 +1,19 @@ +--- a/src/chan_sccp.h ++++ b/src/chan_sccp.h +@@ -127,15 +127,7 @@ extern "C" { + # define CHECK_LEAKS() + # endif + +-# define SCCP_FILE_VERSION(file, version) \ +- static void __attribute__((constructor)) __register_file_version(void) \ +- { \ +- pbx_register_file_version(file, version); \ +- } \ +- static void __attribute__((destructor)) __unregister_file_version(void) \ +- { \ +- pbx_unregister_file_version(file); \ +- } ++# define SCCP_FILE_VERSION(file, version) + + # define DEV_ID_LOG(x) x ? x->id : "SCCP" + diff --git a/net/asterisk-chan-sccp-b/patches/300-stdarg.patch b/net/asterisk-chan-sccp-b/patches/300-stdarg.patch new file mode 100644 index 0000000..be91ed7 --- /dev/null +++ b/net/asterisk-chan-sccp-b/patches/300-stdarg.patch @@ -0,0 +1,10 @@ +--- a/src/chan_sccp.h ++++ b/src/chan_sccp.h +@@ -32,6 +32,7 @@ extern "C" { + #include "common.h" + #include + #include "asterisk/compiler.h" ++#include + #include "asterisk/lock.h" + #include "asterisk/abstract_jb.h" + diff --git a/net/atftp/Makefile b/net/atftp/Makefile new file mode 100644 index 0000000..e15f410 --- /dev/null +++ b/net/atftp/Makefile @@ -0,0 +1,69 @@ +# +# 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:=atftp +PKG_VERSION:=0.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/distfiles/ +PKG_MD5SUM:=3b27365772d918050b2251d98a9c7c82 + +PKG_BUILD_DEPENDS:=libncurses libpcre libreadline + +include $(INCLUDE_DIR)/package.mk + +define Package/atftp/Default + SECTION:=net + CATEGORY:=Network + TITLE:=TFTP + SUBMENU:=File Transfer +endef + +define Package/atftp + $(call Package/atftp/Default) + DEPENDS:=+libreadline +libncurses + TITLE+= client +endef + +define Package/atftpd + $(call Package/atftp/Default) + DEPENDS:=+libpcre +libpthread + TITLE+= server +endef + +CONFIGURE_ARGS += \ + --disable-libwrap + +ifdef CONFIG_USE_EGLIBC + TARGET_CFLAGS += -DHAVE_ARGZ=1 + + define Build/Prepare + $(Build/Prepare/Default) + echo '#include_next ' > $(PKG_BUILD_DIR)/argz.h + endef +endif + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) -Wall -D_REENTRANT" \ + all + +define Package/atftp/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/atftp $(1)/usr/sbin/ +endef + +define Package/atftpd/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/atftpd $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,atftp)) +$(eval $(call BuildPackage,atftpd)) diff --git a/net/atftp/patches/100-mconfig.patch b/net/atftp/patches/100-mconfig.patch new file mode 100644 index 0000000..01c1e36 --- /dev/null +++ b/net/atftp/patches/100-mconfig.patch @@ -0,0 +1,21 @@ +Index: atftp-0.7/MCONFIG +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ atftp-0.7/MCONFIG 2007-08-02 23:04:23.000000000 +0200 +@@ -0,0 +1,16 @@ ++# Generated by configure (confgen version 2) on Sun Jun 19 21:13:24 CEST 2005 ++# ++ ++BINDIR=/usr/bin ++SBINDIR=/usr/sbin ++MANDIR=/usr/man ++BINMODE=755 ++DAEMONMODE=755 ++MANMODE=644 ++PREFIX=/usr ++EXECPREFIX=/usr ++INSTALLROOT= ++CC= ++CFLAGS= ++LDFLAGS= ++LIBS= diff --git a/net/atftp/patches/110-services.patch b/net/atftp/patches/110-services.patch new file mode 100644 index 0000000..ab3e1fb --- /dev/null +++ b/net/atftp/patches/110-services.patch @@ -0,0 +1,79 @@ +Index: atftp-0.7/tftp.c +=================================================================== +--- atftp-0.7.orig/tftp.c 2007-08-02 23:04:23.000000000 +0200 ++++ atftp-0.7/tftp.c 2007-08-02 23:04:23.000000000 +0200 +@@ -409,7 +409,7 @@ + int set_peer(int argc, char **argv) + { + struct hostent *host; /* for host name lookup */ +- struct servent *sp; /* server entry for tftp service */ ++ int port = htons(69); + + /* sanity check */ + if ((argc < 2) || (argc > 3)) +@@ -418,13 +418,6 @@ + return ERR; + } + +- /* get the server entry */ +- sp = getservbyname("tftp", "udp"); +- if (sp == 0) { +- fprintf(stderr, "tftp: udp/tftp, unknown service.\n"); +- return ERR; +- } +- + /* look up the host */ + host = gethostbyname(argv[1]); + /* if valid, update s_inn structure */ +@@ -437,7 +430,7 @@ + Strncpy(data.hostname, host->h_name, + sizeof(data.hostname)); + data.hostname[sizeof(data.hostname)-1] = 0; +- data.sa_peer.sin_port = sp->s_port; ++ data.sa_peer.sin_port = port; + } + else + { +@@ -448,17 +441,17 @@ + /* get the server port */ + if (argc == 3) + { +- sp->s_port = htons(atoi(argv[2])); +- if (sp->s_port < 0) ++ port = htons(atoi(argv[2])); ++ if (port < 0) + { + fprintf(stderr, "%s: bad port number.\n", argv[2]); + data.connected = 0; + return ERR; + } +- data.sa_peer.sin_port = sp->s_port; ++ data.sa_peer.sin_port = port; + } + /* copy port number to data structure */ +- data.port = ntohs(sp->s_port); ++ data.port = ntohs(port); + + data.connected = 1; + return OK; +Index: atftp-0.7/tftpd.c +=================================================================== +--- atftp-0.7.orig/tftpd.c 2007-08-02 23:04:23.000000000 +0200 ++++ atftp-0.7/tftpd.c 2007-08-02 23:04:23.000000000 +0200 +@@ -230,14 +230,8 @@ + + /* find the port */ + if (tftpd_port == 0) +- { +- if ((serv = getservbyname("tftp", "udp")) == NULL) +- { +- logger(LOG_ERR, "atftpd: udp/tftp, unknown service"); +- exit(1); +- } +- tftpd_port = ntohs(serv->s_port); +- } ++ tftpd_port = htons(69); ++ + /* initialise sockaddr_in structure */ + memset(&sa, 0, sizeof(sa)); + sa.sin_family = AF_INET; diff --git a/net/atftp/patches/120-retry_setting.patch b/net/atftp/patches/120-retry_setting.patch new file mode 100644 index 0000000..548090c --- /dev/null +++ b/net/atftp/patches/120-retry_setting.patch @@ -0,0 +1,121 @@ +Index: atftp-0.7/tftp.c +=================================================================== +--- atftp-0.7.orig/tftp.c 2007-08-02 23:04:23.000000000 +0200 ++++ atftp-0.7/tftp.c 2007-08-02 23:04:23.000000000 +0200 +@@ -967,6 +967,7 @@ + { "tftp-timeout", 1, NULL, 'T'}, + { "mode", 1, NULL, 'M'}, + { "option", 1, NULL, 'O'}, ++ { "retry", 1, NULL, 'R'}, + #if 1 + { "timeout", 1, NULL, 't'}, + { "blksize", 1, NULL, 'b'}, +@@ -986,11 +987,16 @@ + }; + + /* Support old argument until 0.8 */ +- while ((c = getopt_long(argc, argv, /*"gpl:r:Vh"*/ "gpl:r:Vht:b:sm", ++ while ((c = getopt_long(argc, argv, /*"gpl:r:Vh"*/ "gpl:r:Vht:b:smR:", + options, &option_index)) != EOF) + { + switch (c) + { ++ case 'R': ++ snprintf(string, sizeof(string), "option retry %s", optarg); ++ make_arg(string, &ac, &av); ++ process_cmd(ac, av); ++ break; + case 'g': + interactive = 0; + if ((action == PUT) || (action == MGET)) +Index: atftp-0.7/tftp_def.c +=================================================================== +--- atftp-0.7.orig/tftp_def.c 2007-08-02 23:04:23.000000000 +0200 ++++ atftp-0.7/tftp_def.c 2007-08-02 23:04:23.000000000 +0200 +@@ -37,6 +37,7 @@ + { "timeout", "5", 0, 1 }, /* 2348, 2349, 2090. */ + { "blksize", "512", 0, 1 }, /* This is the default option */ + { "multicast", "", 0, 1 }, /* structure */ ++ { "retry", "5", 0, 1 }, + { "", "", 0, 0} + }; + +Index: atftp-0.7/tftp_def.h +=================================================================== +--- atftp-0.7.orig/tftp_def.h 2007-08-02 23:04:23.000000000 +0200 ++++ atftp-0.7/tftp_def.h 2007-08-02 23:04:23.000000000 +0200 +@@ -40,7 +40,8 @@ + #define OPT_TIMEOUT 3 + #define OPT_BLKSIZE 4 + #define OPT_MULTICAST 5 +-#define OPT_NUMBER 7 ++#define OPT_RETRY 6 ++#define OPT_NUMBER 8 + + #define OPT_SIZE 12 + #define VAL_SIZE MAXLEN +Index: atftp-0.7/tftp_file.c +=================================================================== +--- atftp-0.7.orig/tftp_file.c 2007-08-02 23:04:23.000000000 +0200 ++++ atftp-0.7/tftp_file.c 2007-08-02 23:04:23.000000000 +0200 +@@ -123,6 +123,7 @@ + struct tftphdr *tftphdr = (struct tftphdr *)data->data_buffer; + FILE *fp = NULL; /* the local file pointer */ + int number_of_timeout = 0; ++ int num_retry = atoi(data->tftp_options[OPT_RETRY].value); + int convert = 0; /* if true, do netascii convertion */ + + int oacks = 0; /* count OACK for improved error checking */ +@@ -141,7 +142,7 @@ + + int prev_block_number = 0; /* needed to support netascii convertion */ + int temp = 0; +- ++ + data->file_size = 0; + tftp_cancel = 0; + from.sin_addr.s_addr = 0; +@@ -288,7 +289,7 @@ + case GET_TIMEOUT: + number_of_timeout++; + fprintf(stderr, "timeout: retrying...\n"); +- if (number_of_timeout > NB_OF_RETRY) ++ if ((num_retry > 0) && (number_of_timeout > num_retry)) + state = S_ABORT; + else + state = timeout_state; +@@ -325,7 +326,7 @@ + number_of_timeout++; + fprintf(stderr, "tftp: packet discard <%s:%d>.\n", + inet_ntoa(from.sin_addr), ntohs(from.sin_port)); +- if (number_of_timeout > NB_OF_RETRY) ++ if ((num_retry > 0) && (number_of_timeout > num_retry)) + state = S_ABORT; + break; + case ERR: +@@ -614,6 +615,7 @@ + struct tftphdr *tftphdr = (struct tftphdr *)data->data_buffer; + FILE *fp; /* the local file pointer */ + int number_of_timeout = 0; ++ int num_retry = atoi(data->tftp_options[OPT_RETRY].value); + struct stat file_stat; + int convert = 0; /* if true, do netascii convertion */ + char string[MAXLEN]; +@@ -751,7 +753,7 @@ + case GET_TIMEOUT: + number_of_timeout++; + fprintf(stderr, "timeout: retrying...\n"); +- if (number_of_timeout > NB_OF_RETRY) ++ if ((num_retry > 0) && (number_of_timeout > num_retry)) + state = S_ABORT; + else + state = timeout_state; +@@ -797,7 +799,7 @@ + number_of_timeout++; + fprintf(stderr, "tftp: packet discard <%s:%d>.\n", + inet_ntoa(from.sin_addr), ntohs(from.sin_port)); +- if (number_of_timeout > NB_OF_RETRY) ++ if ((num_retry > 0) && (number_of_timeout > num_retry)) + state = S_ABORT; + break; + case ERR: diff --git a/net/atftp/patches/130-missing_include.patch b/net/atftp/patches/130-missing_include.patch new file mode 100644 index 0000000..d607d0e --- /dev/null +++ b/net/atftp/patches/130-missing_include.patch @@ -0,0 +1,21 @@ +--- a/stats.c ++++ b/stats.c +@@ -18,6 +18,7 @@ + + #include + #include ++#include + #include "tftp_def.h" + #include "stats.h" + #include "logger.h" +@@ -157,8 +158,8 @@ + + logger(LOG_INFO, " Load measurements:"); + logger(LOG_INFO, " User: %8.3fs Sys:%8.3fs", +- (double)(s_stats.tms.tms_utime) / CLK_TCK, +- (double)(s_stats.tms.tms_stime) / CLK_TCK); ++ (double)(s_stats.tms.tms_utime) / CLOCKS_PER_SEC, ++ (double)(s_stats.tms.tms_stime) / CLOCKS_PER_SEC); + logger(LOG_INFO, " Total:%8.3fs CPU:%8.3f%%", + (double)(tmp.tv_sec + tmp.tv_usec * 1e-6), + (double)(s_stats.tms.tms_utime + s_stats.tms.tms_stime) / diff --git a/net/autossh/Makefile b/net/autossh/Makefile new file mode 100644 index 0000000..ec6e7eb --- /dev/null +++ b/net/autossh/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2006-2012 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:=autossh +PKG_VERSION:=1.4b +PKG_RELEASE:=6 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://www.harding.motd.ca/autossh/ +PKG_MD5SUM:=8f9aa006f6f69e912d3c2f504622d6f7 + +include $(INCLUDE_DIR)/package.mk + +define Package/autossh + SECTION:=net + CATEGORY:=Network + TITLE:=Autossh client + URL:=http://www.harding.motd.ca/autossh/ + SUBMENU:=SSH +endef + +define Build/Compile + $(call Build/Compile/Default, -f Makefile \ + CFLAGS="$(TARGET_CFLAGS) -Wall -D\"SSH_PATH=\\\"\$$$$(SSH)\\\"\" -D\"VER=\\\"\$$$$(VER)\\\"\"" \ + all \ + ) +endef + +define Package/autossh/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/autossh $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/autossh.init $(1)/etc/init.d/autossh + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/autossh.config $(1)/etc/config/autossh + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_DATA) ./files/autossh.hotplug $(1)/etc/hotplug.d/iface/20-autossh +endef + +define Package/autossh/conffiles +/etc/config/autossh +endef + +$(eval $(call BuildPackage,autossh)) diff --git a/net/autossh/files/autossh.config b/net/autossh/files/autossh.config new file mode 100644 index 0000000..6ec3238 --- /dev/null +++ b/net/autossh/files/autossh.config @@ -0,0 +1,5 @@ +config autossh + option ssh '-i /etc/dropbear/id_rsa -N -T -R 2222:localhost:22 user@host' + option gatetime '0' + option monitorport '20000' + option poll '600' diff --git a/net/autossh/files/autossh.hotplug b/net/autossh/files/autossh.hotplug new file mode 100644 index 0000000..4f695f4 --- /dev/null +++ b/net/autossh/files/autossh.hotplug @@ -0,0 +1,14 @@ +#!/bin/sh +# Copyright (C) 2007 OpenWrt.org + +/etc/init.d/autossh enabled && { + + [ "$ACTION" = "ifup" ] && { + /etc/init.d/autossh start + } + + [ "$ACTION" = "ifdown" ] && { + /etc/init.d/autossh stop + } + +} diff --git a/net/autossh/files/autossh.init b/net/autossh/files/autossh.init new file mode 100644 index 0000000..cdff07c --- /dev/null +++ b/net/autossh/files/autossh.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=80 + +start_instance() { + local section="$1" + + config_get ssh "$section" 'ssh' + config_get gatetime "$section" 'gatetime' + config_get monitorport "$section" 'monitorport' + config_get poll "$section" 'poll' + + AUTOSSH_GATETIME="${gatetime:-30}" \ + AUTOSSH_POLL="${poll:-600}" \ + service_start /usr/sbin/autossh -M ${monitorport:-20000} -f ${ssh} +} + +boot() { + return +} + +start() { + config_load 'autossh' + config_foreach start_instance 'autossh' +} + +stop() { + service_stop /usr/sbin/autossh +} diff --git a/net/axel/Makefile b/net/axel/Makefile new file mode 100644 index 0000000..415dc7e --- /dev/null +++ b/net/axel/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2010-2011 OpenWrt.org +# Copyright (C) 2010 Gianluigi Tiesi +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=axel +PKG_VERSION:=2.4 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://alioth.debian.org/frs/download.php/3015 +PKG_MD5SUM:=a2a762fce0c96781965c8f9786a3d09d + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/axel + SECTION:=net + CATEGORY:=Network + SUBMENU:=File Transfer + TITLE:=Axel Download Accelerator + DEPENDS:=+libpthread + URL:=http://axel.alioth.debian.org/ + MAINTAINER:=Gianluigi Tiesi +endef + +define Package/axel/description + Axel tries to accelerate HTTP/FTP downloading process by using multiple connections for one file. + It can use multiple mirrors for a download. Axel has no dependencies and is lightweight, + so it might be useful as a wget clone on byte-critical systems. +endef + +# notes: +# - I'm using := and not += because it is not a standard configure script +# - I ask not to strip, because it should be handled by the toolchain +CONFIGURE_ARGS := \ + --prefix=/usr \ + --etcdir=/etc \ + --debug=0 \ + --i18n=0 \ + --strip=0 + +define Package/axel/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/axel $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/axelrc.example $(1)/etc/axelrc + echo "alternate_output = 1" >> $(1)/etc/axelrc +endef + +define Package/axel/conffiles +/etc/axelrc +endef + +$(eval $(call BuildPackage,axel)) diff --git a/net/babel/Makefile b/net/babel/Makefile new file mode 100644 index 0000000..dc7dac8 --- /dev/null +++ b/net/babel/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2007-2009 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:=babeld +PKG_VERSION:=1.3.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/files/ +PKG_MD5SUM:=56ca5107112aec09279995b7985c5ac3 + +include $(INCLUDE_DIR)/package.mk + +define Package/babeld + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE:=A loop-free distance-vector routing protocol + URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/babel/ + MAINTAINER:=Gabriel Kerneis + DEPENDS:=+kmod-ipv6 +librt +endef + +define Package/babeld/description + Babel is a loop-avoiding distance-vector routing protocol roughly based + on DSDV and AODV, but with provisions for link cost estimation and + redistribution of routes from other routing protocols. + While it is optimised for wireless mesh networks, Babel will also work + efficiently on wired networks. It will generate between 1.2 and 2.4 times + the amount of routing traffic that RIPng would generate, while + never counting to infinity. +endef + +define Package/babeld/conffiles +/etc/babeld.conf +/etc/config/babeld +endef + +MAKE_FLAGS+= \ + CFLAGS="$(TARGET_CFLAGS)" \ + +define Package/babeld/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/babeld $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/babeld.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/babeld.config $(1)/etc/config/babeld + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/babeld.init $(1)/etc/init.d/babeld +endef + +$(eval $(call BuildPackage,babeld)) diff --git a/net/babel/files/babeld.conf b/net/babel/files/babeld.conf new file mode 100644 index 0000000..fd488f9 --- /dev/null +++ b/net/babel/files/babeld.conf @@ -0,0 +1,40 @@ +# babel config file +# Copyright (C) 2008-2010 Juliusz Chroboczek, L. Aaron Kaplan +# , +# +# This config file simply documents sample entries. +# "redistribute" means: redistribute routes from other routing protocols +# into babel. "local" means addresses assigned to local interfaces. +# +# You do not need to edit this file: you can use /etc/config/babeld +# instead (sections "interface" and "filter"). Both files can be used +# simultaneously (the rules of this file are executed first). + +# the default rules are: +# +## redistribute local +## redistribute deny +# +# this says, redistribute local addresses but no other routes + + +# redistribute IPv4 default route into babel +## redistribute local ip 0.0.0.0/0 le 0 metric 128 + +# same but for IPv6 +## redistribute local ip ::/0 le 0 metric 128 + + +# don't redistribute all local addresses, only selected ones +# after the first line, the "deny" rules kicks in. After the "deny" +# no redistribute local rules are going to match +## redistribute local ip 192.160.4.0/24 +## redistribute local deny + + +# Babel refuses to redistribute routes with a protocol number of "boot"; +# this is standard practice, and means that you cannot easily +# redistribute the default route installed by dhcp. It is however +# possible to redistribute such route by explicitly specifying "proto 3" +# on the redistribute line. +## redistribute ip 0.0.0.0/0 le 0 proto 3 metric 128 diff --git a/net/babel/files/babeld.config b/net/babel/files/babeld.config new file mode 100644 index 0000000..688da5a --- /dev/null +++ b/net/babel/files/babeld.config @@ -0,0 +1,69 @@ +package babeld + +config general + # option 'multicast_address' 'ff02:0:0:0:0:0:1:6' + # option 'port' '6696' + # option 'state_file' '/var/lib/babel-state' + # option 'hello_interval' '4' + # option 'wired_hello_interval' '20' + # option 'diversity' '0,128' + # option 'kernel_priority' '0' + # Do not use this option unless you know what you are doing, as it can + # cause persistent route flapping. + ## option 'duplication_priority' '0' + # option 'carrier_sense' 'false' + # option 'assume_wireless' 'false' + # option 'no_split_horizon' 'false' + # option 'debug' '0' + # Listen for connections from a front-end, e.g. on port 33123. + ## option 'local_server' '33123' + # Keep unfeasible routes + ## option 'keep_unfeasible' 'false' + # Use the given kernel routing table for routes inserted by babeld. + ## option 'export_table' '0' + # Export routes from the given kernel routing table. + ## option 'import_table' '0' + # The configuration file is not necessary since you can do everything + # from this file. + # option 'conf_file' '/etc/babeld.conf' + # option 'log_file' '/var/log/babeld.log' + +# You can use aliases (like lan, wlan) or real names (like eth0.0). +# If you use an alias, it must be already defined when babeld starts. +# Otherwise, the name is taken literally and the interface can be +# brought up later (useful for tunnels for instance). +config interface wlan + # Remove this line to enable babeld on this interface + option 'ignore' 'true' + # option 'wired' 'auto' + # option 'link_quality' 'auto' + # option 'split_horizon' 'auto' + # The default is 96 for wired interfaces, and 256 for wireless ones + ## option 'rxcost' '256' + # The default is specified with the -h and -H command-line flags. + ## option 'hello_interval' '4' + # This can be set to a fairly large value, unless significant + # packet loss is expected. The default is four times the hello + # interval. + ## option 'update_interval' '16' + +config interface lan + option 'ignore' 'true' + +# A filter consists in a type ('in', 'out' or 'redistribute'), an action +# ('allow', 'deny' or 'metric xxx') and a set of selectors ('ip', 'eq', +# etc.). See /etc/babeld.conf for more details. +# Here is a sample filter wich redistributes the default route if its +# protocol number is "boot", e.g. when it installed by dhcp. It is +# disabled by default. +config filter + option 'ignore' 'true' + # Type + option 'type' 'redistribute' + # Selectors: ip, eq, le, ge, neigh, id, proto, local, if + option 'ip' '0.0.0.0/0' + option 'le' '0' + option 'proto' '3' + # Action + option 'action' 'metric 128' + diff --git a/net/babel/files/babeld.init b/net/babel/files/babeld.init new file mode 100755 index 0000000..67a3544 --- /dev/null +++ b/net/babel/files/babeld.init @@ -0,0 +1,136 @@ +#!/bin/sh /etc/rc.common + +START=70 + +PID_F='/var/run/babeld.pid' +EXTRA_COMMANDS="status" +EXTRA_HELP=" status Dump Babel's table to the log file." + +listen_ifname() { + local ifname=$(uci_get_state network "$1" ifname "$1") + local switch="$2" + append args "$switch $ifname" + append interfaces "$ifname" +} + +append_ifname() { + local section="$1" + local option="$2" + local switch="$3" + local _name + config_get _name "$section" "$option" + [ -z "$_name" ] && return 0 + local ifname=$(uci_get_state network "$_name" ifname "$_name") + append args "$switch $ifname" +} + +append_bool() { + local section="$1" + local option="$2" + local value="$3" + local _loctmp + config_get_bool _loctmp "$section" "$option" 0 + [ "$_loctmp" -gt 0 ] && append args "$value" +} + +append_parm() { + local section="$1" + local option="$2" + local switch="$3" + local _loctmp + config_get _loctmp "$section" "$option" + [ -z "$_loctmp" ] && return 0 + append args "$switch $_loctmp" +} + +babel_filter() { + local cfg="$1" + local _loctmp + + local _ignored + config_get_bool _ignored "$cfg" 'ignore' 0 + [ "$_ignored" -eq 1 ] && return 0 + + append args "-C '" + + append_parm "$cfg" 'type' '' + + append_bool "$cfg" 'local' 'local' + + append_parm "$cfg" 'ip' 'ip' + append_parm "$cfg" 'eq' 'eq' + append_parm "$cfg" 'le' 'le' + append_parm "$cfg" 'ge' 'ge' + append_parm "$cfg" 'neigh' 'neigh' + append_parm "$cfg" 'id' 'id' + append_parm "$cfg" 'proto' 'proto' + + append_ifname "$cfg" 'if' 'if' + + append_parm "$cfg" 'action' '' + + append args ' ' "'" +} + +babel_addif() { + local cfg="$1" + + local _ignored + config_get_bool _ignored "$cfg" 'ignore' 0 + [ "$_ignored" -eq 1 ] && return 0 + + listen_ifname "$cfg" "-C 'interface" + + append_parm "$cfg" 'wired' 'wired' + append_parm "$cfg" 'link_quality' 'link-quality' + append_parm "$cfg" 'split_horizon' 'split-horizon' + append_parm "$cfg" 'rxcost' 'rxcost' + append_parm "$cfg" 'hello_interval' 'hello-interval' + append_parm "$cfg" 'update_interval' 'update-interval' + + append args ' ' "'" +} + +babel_config() { + local cfg="$1" + + append_bool "$cfg" 'carrier_sense' '-l' + append_bool "$cfg" 'assume_wireless' '-w' + append_bool "$cfg" 'no_split_horizon' '-s' + append_bool "$cfg" 'keep_unfeasible' '-u' + + append_parm "$cfg" 'multicast_address' '-m' + append_parm "$cfg" 'port' '-p' + append_parm "$cfg" 'state_file' '-S' + append_parm "$cfg" 'hello_interval' '-h' + append_parm "$cfg" 'wired_hello_interval' '-H' + append_parm "$cfg" 'diversity' '-z' + append_parm "$cfg" 'kernel_priority' '-k' + append_parm "$cfg" 'duplication_priority' '-A' + append_parm "$cfg" 'debug' '-d' + append_parm "$cfg" 'local_server' '-g' + append_parm "$cfg" 'export_table' '-t' + append_parm "$cfg" 'import_table' '-T' + append_parm "$cfg" 'conf_file' '-c' + append_parm "$cfg" 'log_file' '-L' +} + +start() { + mkdir -p /var/lib + config_load babeld + unset args + unset interfaces + config_foreach babel_config general + config_foreach babel_addif interface + config_foreach babel_filter filter + [ -z "$interfaces" ] && return 0 + eval "/usr/sbin/babeld -D -I $PID_F $args $interfaces" +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) +} + +status() { + [ -f $PID_F ] && kill -USR1 $(cat $PID_F) +} diff --git a/net/bahamut/Makefile b/net/bahamut/Makefile new file mode 100644 index 0000000..a0a8be4 --- /dev/null +++ b/net/bahamut/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2008 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:=bahamut +PKG_VERSION:=1.8.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-release.tar.gz +PKG_SOURCE_URL:=http://bahamut.dal.net/download +PKG_MD5SUM:=a814a4e0ff1fabcf026ea8574b4a1e20 + +include $(INCLUDE_DIR)/package.mk + +define Package/bahamut + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libopenssl +zlib + SUBMENU:=Instant Messaging + TITLE:=Bahamut IRC server + URL:=http://bahamut.dal.net +endef + +TARGET_CFLAGS += \ + -DSYS_ERRLIST_DECLARED + +define Build/Configure + $(call Build/Configure/Default,\ + --with-maxconnections=64 \ + --with-openssl="$(STAGING_DIR)/usr/lib" \ + ,\ + ac_cv_func_dn_skipname=yes \ + ZLIB_HOME="$(STAGING_DIR)/usr" \ + ) +endef + +define Build/Compile + $(call Build/Compile/Default,\ + prefix="$(PKG_INSTALL_DIR)/usr" \ + INSTALL_DIR="$(PKG_INSTALL_DIR)" \ + STAGING_DIR="$(STAGING_DIR)" \ + all \ + ) +endef + +define Package/bahamut/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ircd $(1)/usr/sbin + $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/*.{txt,conf} $(1)/etc/$(PKG_NAME) +endef + +$(eval $(call BuildPackage,bahamut)) diff --git a/net/bahamut/patches/001-cross_compile.patch b/net/bahamut/patches/001-cross_compile.patch new file mode 100644 index 0000000..ee398b0 --- /dev/null +++ b/net/bahamut/patches/001-cross_compile.patch @@ -0,0 +1,71 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -22,8 +22,8 @@ MV=@MV@ + ENGINE=@SENGINE@ + + SHELL=/bin/sh +-SUBDIRS=src doc tools +-INSTDIRS=src doc tools ++SUBDIRS=src ++INSTDIRS=src doc + CLEANSUBDIRS=src tools + + CC=@CC@ +--- a/configure ++++ b/configure +@@ -7057,8 +7057,7 @@ echo $ECHO_N "checking for epoll_create + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++See \`config.log' for more details." >&2;} } + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -1,8 +1,8 @@ + CC=@CC@ + RM=@RM@ + MV=@MV@ +-IRCDLIBS=@LIBS@ +-INCLUDEDIR=-I../include ++IRCDLIBS=-lresolv -lz @LIBS@ -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib ++INCLUDEDIR=-I../include -I$(STAGING_DIR)/usr/include + OPENSSLINC=@SSL_INCLUDES@ + ENGINE=@SENGINE@ + CRYPTO=@ENCRYPT_SRC@ +@@ -11,10 +11,10 @@ INSTALL_BIN=@INSTALL_PROGRAM@ + INSTALL_DIR=@INSTALL_DIR@ + CFLAGS=@CFLAGS@ -fno-strict-aliasing + +-RES_SRC = ++#RES_SRC = + + #This is only for very old systems that NEED this +-#RES_SRC = res_mkquery.c res_init.c res_comp.c ++RES_SRC = res_mkquery.c res_init.c res_comp.c + + SOURCES = blalloc.c bsd.c channel.c clientlist.c clones.c confparse.c \ + fdlist.c fds.c hash.c hide.c inet_addr.c ircd.c ircsprintf.c \ +@@ -22,7 +22,7 @@ SOURCES = blalloc.c bsd.c channel.c clie + m_who.c match.c memcount.c modules.c packet.c parse.c pcre.c \ + probability.c res.c s_auth.c s_bsd.c s_conf.c s_debug.c s_err.c \ + s_misc.c s_numeric.c s_serv.c s_user.c sbuf.c scache.c send.c \ +- struct.c support.c throttle.c userban.c whowas.c zlink.c \ ++ struct.c support.c throttle.c userban.c whowas.c zlink.c $(RES_SRC) \ + $(ENGINE) $(CRYPTO) + + OBJECTS = $(SOURCES:.c=.o) version.o +--- a/src/res_comp.c ++++ b/src/res_comp.c +@@ -229,7 +229,7 @@ dn_skipname(u_char *comp_dn, u_char *eom + * the first name on the list, not the pointer to the start of the + * message. + */ +-int staticdn_find(u_char *exp_dn, u_char *msg, u_char **dnptrs, ++static int dn_find(u_char *exp_dn, u_char *msg, u_char **dnptrs, + u_char **lastdnptr) + { + u_char *dn, *cp, **cpp; diff --git a/net/bahamut/patches/002-glibc_fix.patch b/net/bahamut/patches/002-glibc_fix.patch new file mode 100644 index 0000000..400caed --- /dev/null +++ b/net/bahamut/patches/002-glibc_fix.patch @@ -0,0 +1,37 @@ +--- a/include/resolv.h ++++ b/include/resolv.h +@@ -60,7 +60,7 @@ + #if ((__GNU_LIBRARY__ == 6) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 3)) + # define MAXRESOLVSORT 10 /* number of net to sort on */ + +-struct __res_state { ++struct state { + int retrans; /* retransmition time interval */ + int retry; /* number of times to retransmit */ + u_long options; /* option flags - see below. */ +@@ -79,12 +79,9 @@ struct __res_state { + struct in_addr addr; + u_int32_t mask; + } sort_list[MAXRESOLVSORT]; ++ unsigned short order[MAXSERVICES + 1]; /* search service order */ + }; + +-typedef struct __res_state *res_state; +- +-extern struct __res_state *__res_state(void) __attribute__ ((__const__)); +-#define _res (*__res_state()) + + #else + +@@ -101,9 +98,10 @@ struct state { + unsigned short order[MAXSERVICES + 1]; /* search service order */ + }; + +-extern struct state _res; + #endif + ++extern struct state _res; ++ + extern char *p_cdname(), *p_rr(), *p_type(), *p_class(), *p_time(); + + #if ((__GNU_LIBRARY__ == 6) && (__GLIBC__ >=2) && (__GLIBC_MINOR__ >= 2)) diff --git a/net/bahamut/patches/010-dont-use-host-zlib.patch b/net/bahamut/patches/010-dont-use-host-zlib.patch new file mode 100644 index 0000000..ef8029c --- /dev/null +++ b/net/bahamut/patches/010-dont-use-host-zlib.patch @@ -0,0 +1,16 @@ +diff --git a/configure b/configure +index 4ef7659..c774c65 100755 +--- a/configure ++++ b/configure +@@ -8009,11 +8009,6 @@ fi + # zlib test + # ripped from http://autoconf-archive.cryp.to/check_zlib.html + # +-ZLIB_HOME=/usr/local +-if test ! -f "${ZLIB_HOME}/include/zlib.h" +-then +- ZLIB_HOME=/usr +-fi + if test -n "${ZLIB_HOME}" + then + ZLIB_OLD_LDFLAGS=$LDFLAGS diff --git a/net/baresip/Makefile b/net/baresip/Makefile new file mode 100644 index 0000000..f325467 --- /dev/null +++ b/net/baresip/Makefile @@ -0,0 +1,151 @@ +# +# Copyright (C) 2010-2012 OpenWrt.org +# Copyright (C) 2010 Alfred E. Heggestad +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=baresip +PKG_VERSION:=0.4.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.creytiv.com/pub/ +PKG_MD5SUM:=1574e40bace9593ec40c527299654bb6 + +baresip-mods:= \ + alsa \ + avcodec \ + avformat \ + cons \ + evdev \ + g711 \ + g722 \ + oss \ + sdl \ + speex \ + stdio \ + uuid \ + v4l \ + v4l2 \ + +PKG_CONFIG_DEPENDS:= \ + $(patsubst %,CONFIG_PACKAGE_baresip-mod-%,$(baresip-mods)) \ + +include $(INCLUDE_DIR)/package.mk + +define Package/baresip/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + URL:=http://www.creytiv.com/ +endef + +define Package/baresip +$(call Package/baresip/Default) + TITLE:=Portable and modular SIP User-Agent with A/V support + DEPENDS:=+libre +librem +libpthread +endef + + +baresip-mod-alsa := USE_ALSA +baresip-mod-avcodec := USE_FFMPEG +baresip-mod-avformat := USE_FFMPEG_AVFORMAT +baresip-mod-cons := USE_CONS +baresip-mod-evdev := USE_EVDEV +baresip-mod-g711 := USE_G711 +baresip-mod-g722 := USE_G722 +baresip-mod-oss := USE_OSS +baresip-mod-sdl := USE_SDL +baresip-mod-speex := USE_SPEEX +baresip-mod-stdio := USE_STDIO +baresip-mod-uuid := USE_UUID +baresip-mod-v4l := USE_V4L +baresip-mod-v4l2 := USE_V4L2 + +BARESIP_MOD_OPTIONS:= \ + MOD_AUTODETECT= \ + $(foreach m,$(baresip-mods),$(baresip-mod-$(m))=$(if $(CONFIG_PACKAGE_baresip-mod-$(m)),1)) + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + LIBRE_MK="$(STAGING_DIR)/usr/share/re/re.mk" \ + LIBRE_INC="$(STAGING_DIR)/usr/include/re" \ + LIBRE_SO="$(STAGING_DIR)/usr/lib" \ + LIBREM_PATH="../rem" \ + CC="$(TARGET_CC)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + EXTRA_CFLAGS="$(TARGET_CFLAGS) -DOPENWRT" \ + SYSROOT="$$$$($(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s#/include/pthread.h##p')" \ + SYSROOT_ALT="$(STAGING_DIR)/usr" \ + RELEASE=1 \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + OS="linux" \ + $(BARESIP_MOD_OPTIONS) \ + all install +endef + +define Package/baresip/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/baresip $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/baresip/modules + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/baresip/modules/ice.so \ + $(PKG_INSTALL_DIR)/usr/lib/baresip/modules/stun.so \ + $(PKG_INSTALL_DIR)/usr/lib/baresip/modules/turn.so \ + $(1)/usr/lib/baresip/modules/. + $(INSTALL_DIR) $(1)/usr/share/baresip + $(CP) $(PKG_INSTALL_DIR)/usr/share/baresip/* $(1)/usr/share/baresip/. + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/baresip.init $(1)/etc/init.d/baresip +endef + + +# +# 1. Name +# 2. Title +# 3. Files +# 4. Depends +# +define BuildPlugin + + define Package/baresip-mod-$(1) + $$(call Package/baresip/Default) + TITLE:= baresip $(2) module + DEPENDS:= baresip $(4) + endef + + define Package/baresip-mod-$(1)/install + [ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/usr/lib/baresip/modules + for f in $(3); do \ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/baresip/modules/$$$$$$$${f}.so \ + $$(1)/usr/lib/baresip/modules/ ; \ + done + endef + + $$(eval $$(call BuildPackage,baresip-mod-$(1))) +endef + + +$(eval $(call BuildPackage,baresip)) + +$(eval $(call BuildPlugin,alsa,ALSA audio driver,alsa,+PACKAGE_baresip-mod-alsa:alsa-lib)) +$(eval $(call BuildPlugin,avcodec,FFmpeg video codecs,avcodec,+PACKAGE_baresip-mod-avcodec:libffmpeg-full)) +$(eval $(call BuildPlugin,avformat,FFmpeg video source,avformat,+PACKAGE_baresip-mod-avformat:libffmpeg-full)) +$(eval $(call BuildPlugin,cons,console UI,cons,)) +$(eval $(call BuildPlugin,evdev,input event device UI,evdev,)) +$(eval $(call BuildPlugin,g711,G.711 audio codec,g711,)) +$(eval $(call BuildPlugin,g722,G.722 audio codec,g722,+PACKAGE_baresip-mod-g722:libspandsp)) +$(eval $(call BuildPlugin,sdl,SDL video display,sdl,+libsdl)) +$(eval $(call BuildPlugin,oss,OSS audio driver,oss,)) +$(eval $(call BuildPlugin,speex,Speex audio codec,speex,+PACKAGE_baresip-mod-speex:libspeex)) +$(eval $(call BuildPlugin,stdio,standard I/O UI,stdio,)) +$(eval $(call BuildPlugin,uuid,UUID,uuid,+libuuid)) +$(eval $(call BuildPlugin,v4l,Video4Linux video source,v4l,+PACKAGE_baresip-mod-v4l:libv4l)) +$(eval $(call BuildPlugin,v4l2,Video4Linux2 video source,v4l2,+PACKAGE_baresip-mod-v4l2:libv4l)) diff --git a/net/baresip/files/baresip.init b/net/baresip/files/baresip.init new file mode 100644 index 0000000..e398595 --- /dev/null +++ b/net/baresip/files/baresip.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org +# Copyright (C) 2010 Alfred E. Heggestad +# + +START=92 + +start() { + service_start /usr/bin/baresip -d +} + +stop() { + service_stop /usr/bin/baresip +} diff --git a/net/baresip/patches/100-videodev-compat.patch b/net/baresip/patches/100-videodev-compat.patch new file mode 100644 index 0000000..4b9997c --- /dev/null +++ b/net/baresip/patches/100-videodev-compat.patch @@ -0,0 +1,11 @@ +--- a/modules/v4l/v4l.c ++++ b/modules/v4l/v4l.c +@@ -14,7 +14,7 @@ + #include + #include + #undef __STRICT_ANSI__ /* needed for RHEL4 kernel 2.6.9 */ +-#include ++#include + #include + #include + #include diff --git a/net/batman-adv/Config.in b/net/batman-adv/Config.in new file mode 100644 index 0000000..d6d9320 --- /dev/null +++ b/net/batman-adv/Config.in @@ -0,0 +1,17 @@ + +config KMOD_BATMAN_ADV_DEBUG_LOG + bool "enable verbose debug logging" + depends PACKAGE_kmod-batman-adv + default n +config KMOD_BATMAN_ADV_BLA + bool "enable bridge loop avoidance" + depends PACKAGE_kmod-batman-adv + default y +config KMOD_BATMAN_ADV_BATCTL + bool "enable batctl" + depends PACKAGE_kmod-batman-adv + default y + help + batctl is a more intuitive managment utility for B.A.T.M.A.N.-Advanced. + It is an easier method for configuring batman-adv and + provides some additional tools for debugging as well. diff --git a/net/batman-adv/Makefile b/net/batman-adv/Makefile new file mode 100644 index 0000000..5fdfae6 --- /dev/null +++ b/net/batman-adv/Makefile @@ -0,0 +1,120 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id: Makefile 5624 2006-11-23 00:29:07Z nbd $ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=batman-adv + +PKG_VERSION:=2012.3.0 +BATCTL_VERSION:=2012.3.0 +PKG_RELEASE:=3 +PKG_MD5SUM:=9f2d0bb2792fe0db012203d502e2085c +BATCTL_MD5SUM:=fe9e6a3994539037b48afc5e3d31628c + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION) +PKG_BATCTL_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/batctl-$(BATCTL_VERSION) + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/kernel.mk + +define KernelPackage/batman-adv + URL:=http://www.open-mesh.org/ + MAINTAINER:=Marek Lindner + SUBMENU:=Network Support + DEPENDS:=+kmod-lib-crc16 +libc + TITLE:=B.A.T.M.A.N. Adv + FILES:=$(PKG_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,50,batman-adv) +endef + +define KernelPackage/batman-adv/description +B.A.T.M.A.N. advanced is a kernel module which allows to +build layer 2 mesh networks. This package contains the +version $(PKG_VERSION) of the kernel module plus its user space +configuration & managerment tool batctl. +endef + +define KernelPackage/batman-adv/config + source "$(SOURCE)/Config.in" +endef + +MAKE_BATMAN_ADV_ARGS += \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + KERNELPATH="$(LINUX_DIR)" \ + ARCH="$(LINUX_KARCH)" \ + PATH="$(TARGET_PATH)" \ + SUBDIRS="$(PKG_BUILD_DIR)" \ + PWD="$(PKG_BUILD_DIR)" \ + LINUX_VERSION="$(LINUX_VERSION)" \ + CONFIG_BATMAN_ADV_DEBUG=$(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),y,n) \ + CONFIG_BATMAN_ADV_BLA=$(if $(CONFIG_KMOD_BATMAN_ADV_BLA),y,n) \ + REVISION="" all + +MAKE_BATCTL_ARGS += \ + CFLAGS="$(TARGET_CFLAGS)" \ + CCFLAGS="$(TARGET_CFLAGS)" \ + OFLAGS="$(TARGET_CFLAGS)" \ + REVISION="" \ + CC="$(TARGET_CC)" \ + NODEBUG=1 \ + UNAME="Linux" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + STRIP="/bin/true" \ + batctl install + +ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),) +define Download/batctl + FILE:=batctl-$(BATCTL_VERSION).tar.gz + URL:=$(PKG_SOURCE_URL) + MD5SUM:=$(BATCTL_MD5SUM) +endef +$(eval $(call Download,batctl)) + +BATCTL_EXTRACT = tar xzf "$(DL_DIR)/batctl-$(BATCTL_VERSION).tar.gz" -C "$(BUILD_DIR)/$(PKG_NAME)" +BATCTL_PATCH = $(call Build/DoPatch,"$(PKG_BATCTL_BUILD_DIR)","$(PATCH_DIR)","*batctl*") +BATCTL_BUILD = $(MAKE) -C $(PKG_BATCTL_BUILD_DIR) $(MAKE_BATCTL_ARGS) +BATCTL_INSTALL = $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/sbin/batctl $(1)/usr/sbin/ +endif + +KPATCH ?= $(PATCH) +define Build/DoPatch + @if [ -d "$(2)" ]; then \ + if [ "$$$$(ls $(2) | grep -Ec $(3))" -gt 0 ]; then \ + $(KPATCH) "$(1)" "$(2)" "$(3)"; \ + fi; \ + fi +endef + +define Build/Patch + $(call Build/DoPatch,"$(PKG_BUILD_DIR)","$(PATCH_DIR)","*batman*") + $(BATCTL_EXTRACT) + $(BATCTL_PATCH) +endef + +define Build/Compile + $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATMAN_ADV_ARGS) + $(BATCTL_BUILD) +endef + +define Build/Clean + rm -rf $(BUILD_DIR)/$(PKG_NAME)/ +endef + +define KernelPackage/batman-adv/install + $(INSTALL_DIR) $(1)/etc/config $(1)/etc/hotplug.d/net $(1)/lib/batman-adv $(1)/usr/sbin + $(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config + $(INSTALL_DATA) ./files/lib/batman-adv/config.sh $(1)/lib/batman-adv + $(INSTALL_BIN) ./files/etc/hotplug.d/net/99-batman-adv $(1)/etc/hotplug.d/net + $(INSTALL_BIN) ./files/usr/sbin/batman-adv $(1)/usr/sbin + $(BATCTL_INSTALL) +endef + +$(eval $(call KernelPackage,batman-adv)) diff --git a/net/batman-adv/files/etc/config/batman-adv b/net/batman-adv/files/etc/config/batman-adv new file mode 100644 index 0000000..fb7b384 --- /dev/null +++ b/net/batman-adv/files/etc/config/batman-adv @@ -0,0 +1,18 @@ + +config 'mesh' 'bat0' + option 'interfaces' 'mesh' + option 'aggregated_ogms' + option 'ap_isolation' + option 'bonding' + option 'fragmentation' + option 'gw_bandwidth' + option 'gw_mode' + option 'gw_sel_class' + option 'log_level' + option 'orig_interval' + option 'vis_mode' + option 'bridge_loop_avoidance' + +# yet another batX instance +# config 'mesh' 'bat5' +# option 'interfaces' 'second_mesh' diff --git a/net/batman-adv/files/etc/hotplug.d/net/99-batman-adv b/net/batman-adv/files/etc/hotplug.d/net/99-batman-adv new file mode 100644 index 0000000..42d4c29 --- /dev/null +++ b/net/batman-adv/files/etc/hotplug.d/net/99-batman-adv @@ -0,0 +1,16 @@ +#!/bin/sh + +. /lib/batman-adv/config.sh + +bat_load_module +config_load batman-adv + +case "$ACTION" in + add) + [ -d /sys/class/net/$INTERFACE/mesh/ ] && bat_config "$INTERFACE" + [ -d /sys/class/net/$INTERFACE/batman_adv/ ] && config_foreach bat_add_interface mesh "$INTERFACE" + ;; + remove) + [ -d /sys/class/net/$INTERFACE/batman_adv/ ] && config_foreach bat_del_interface mesh "$INTERFACE" + ;; +esac diff --git a/net/batman-adv/files/lib/batman-adv/config.sh b/net/batman-adv/files/lib/batman-adv/config.sh new file mode 100644 index 0000000..35d61ef --- /dev/null +++ b/net/batman-adv/files/lib/batman-adv/config.sh @@ -0,0 +1,78 @@ +#!/bin/sh + +bat_load_module() +{ + [ -d "/sys/module/batman_adv/" ] && return + + . /lib/functions.sh + load_modules /etc/modules.d/*-crc16 /etc/modules.d/*-batman-adv* +} + +bat_config() +{ + local mesh="$1" + local aggregated_ogms bonding fragmentation gw_bandwidth gw_mode gw_sel_class log_level orig_interval hop_penalty vis_mode bridge_loop_avoidance + + config_get aggregated_ogms "$mesh" aggregated_ogms + config_get bonding "$mesh" bonding + config_get fragmentation "$mesh" fragmentation + config_get gw_bandwidth "$mesh" gw_bandwidth + config_get gw_mode "$mesh" gw_mode + config_get gw_sel_class "$mesh" gw_sel_class + config_get log_level "$mesh" log_level + config_get orig_interval "$mesh" orig_interval + config_get hop_penalty "$mesh" hop_penalty + config_get vis_mode "$mesh" vis_mode + config_get ap_isolation "$mesh" ap_isolation + config_get bridge_loop_avoidance "$mesh" bridge_loop_avoidance + + [ ! -f "/sys/class/net/$mesh/mesh/orig_interval" ] && echo "batman-adv mesh $mesh does not exist - check your interface configuration" && return 1 + + [ -n "$orig_interval" ] && echo $orig_interval > /sys/class/net/$mesh/mesh/orig_interval + [ -n "$hop_penalty" ] && echo $hop_penalty > /sys/class/net/$mesh/mesh/hop_penalty + [ -n "$log_level" ] && echo $log_level > /sys/class/net/$mesh/mesh/log_level 2>&- + [ -n "$aggregate_ogms" ] && echo $aggregate_ogms > /sys/class/net/$mesh/mesh/aggregate_ogms + [ -n "$bonding" ] && echo $bonding > /sys/class/net/$mesh/mesh/bonding + [ -n "$fragmentation" ] && echo $fragmentation > /sys/class/net/$mesh/mesh/fragmentation + [ -n "$gw_bandwidth" ] && echo $gw_bandwidth > /sys/class/net/$mesh/mesh/gw_bandwidth + [ -n "$gw_mode" ] && echo $gw_mode > /sys/class/net/$mesh/mesh/gw_mode + [ -n "$gw_sel_class" ] && echo $gw_sel_class > /sys/class/net/$mesh/mesh/gw_sel_class + [ -n "$vis_mode" ] && echo $vis_mode > /sys/class/net/$mesh/mesh/vis_mode + [ -n "$ap_isolation" ] && echo $ap_isolation > /sys/class/net/$mesh/mesh/ap_isolation + [ -n "$bridge_loop_avoidance" ] && echo $bridge_loop_avoidance > /sys/class/net/$mesh/mesh/bridge_loop_avoidance +} + +bat_add_interface() +{ + local mesh="$1" + local interface="$2" + local interfaces + + sleep 3s # some device (ath) is very lazy to start + config_get interfaces $mesh interfaces + for iface in $interfaces; do + [ -f "/sys/class/net/$iface/batman_adv/mesh_iface" ] || { + iface=$(uci -q -P/var/state get network.$iface.ifname) + [ -f "/sys/class/net/$iface/batman_adv/mesh_iface" ] || continue + } + + [ "$iface" = "$interface" ] && echo $mesh > /sys/class/net/$iface/batman_adv/mesh_iface + done +} + +bat_del_interface() +{ + local mesh="$1" + local interface="$2" + local interfaces + + config_get interfaces $mesh interfaces + for iface in $interfaces; do + [ -f "/sys/class/net/$iface/batman_adv/mesh_iface" ] || { + iface=$(uci -q -P/var/state get network.$iface.ifname) + [ -f "/sys/class/net/$iface/batman_adv/mesh_iface" ] || continue + } + + [ "$iface" = "$interface" ] && echo none > /sys/class/net/$iface/batman_adv/mesh_iface + done +} diff --git a/net/batman-adv/files/usr/sbin/batman-adv b/net/batman-adv/files/usr/sbin/batman-adv new file mode 100644 index 0000000..ca9e603 --- /dev/null +++ b/net/batman-adv/files/usr/sbin/batman-adv @@ -0,0 +1,60 @@ +#!/bin/sh +# Copyright (C) 2011 OpenWrt.org + +. /lib/functions.sh +. /lib/batman-adv/config.sh + +start_mesh() { + local mesh="$1" + local ifaces=$(awk -F':' '{if (NR > 2) print $1}' /proc/net/dev) + + for iface in $ifaces; do + [ -d /sys/class/net/$iface/batman_adv/ ] && bat_add_interface "$mesh" "$iface" + done + + bat_config "$mesh" +} + +stop_mesh() { + local mesh="$1" + local ifaces=$(awk -F':' '{if (NR > 2) print $1}' /proc/net/dev) + + for iface in $ifaces; do + [ -d /sys/class/net/$iface/batman_adv/ ] && bat_del_interface "$mesh" "$iface" + done +} + +# can also be used with "batman-adv start bat0" +start() { + bat_load_module + config_load batman-adv + + if [ -n "$1" ]; then + start_mesh $1 + else + config_foreach start_mesh mesh + fi +} + +# can also be used with "batman-adv stop bat0" +stop () { + config_load batman-adv + + if [ -n "$1" ]; then + stop_mesh $1 + else + config_foreach stop_mesh mesh + fi +} + +restart() { + stop $1 + start $1 +} + +case "$1" in + start) start $2 ;; + stop) stop $2 ;; + restart) restart $2 ;; + *) echo "Usage: batman-adv [mesh instance]" +esac diff --git a/net/batman-adv/patches/0001-batman-adv-make-batadv_test_bit-return-0-or-1-only.patch b/net/batman-adv/patches/0001-batman-adv-make-batadv_test_bit-return-0-or-1-only.patch new file mode 100644 index 0000000..e069fa7 --- /dev/null +++ b/net/batman-adv/patches/0001-batman-adv-make-batadv_test_bit-return-0-or-1-only.patch @@ -0,0 +1,50 @@ +From 716c8c9a8bb7ac1e30e959e50ed74caa7dabe60a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Linus=20L=C3=BCssing?= +Date: Mon, 3 Sep 2012 22:20:31 +0200 +Subject: [PATCH] batman-adv: make batadv_test_bit() return 0 or 1 only +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +On some architectures test_bit() can return other values than 0 or 1: + +With a generic x86 OpenWrt image in a kvm setup (batadv_)test_bit() +frequently returns -1 for me, leading to batadv_iv_ogm_update_seqnos() +wrongly signaling a protected seqno window. + +This patch tries to fix this issue by making batadv_test_bit() return 0 +or 1 only. + +Signed-off-by: Linus Lüssing +Acked-by: Sven Eckelmann +--- + bitarray.h | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/bitarray.h b/bitarray.h +index a081ce1..cebaae7 100644 +--- a/bitarray.h ++++ b/bitarray.h +@@ -20,8 +20,8 @@ + #ifndef _NET_BATMAN_ADV_BITARRAY_H_ + #define _NET_BATMAN_ADV_BITARRAY_H_ + +-/* returns true if the corresponding bit in the given seq_bits indicates true +- * and curr_seqno is within range of last_seqno ++/* Returns 1 if the corresponding bit in the given seq_bits indicates true ++ * and curr_seqno is within range of last_seqno. Otherwise returns 0. + */ + static inline int batadv_test_bit(const unsigned long *seq_bits, + uint32_t last_seqno, uint32_t curr_seqno) +@@ -32,7 +32,7 @@ static inline int batadv_test_bit(const unsigned long *seq_bits, + if (diff < 0 || diff >= BATADV_TQ_LOCAL_WINDOW_SIZE) + return 0; + else +- return test_bit(diff, seq_bits); ++ return test_bit(diff, seq_bits) != 0; + } + + /* turn corresponding bit on, so we can remember that we got the packet */ +-- +1.7.9.1 + diff --git a/net/batman-adv/patches/0002-batman-adv-Fix-change-mac-address-of-soft-iface.patch b/net/batman-adv/patches/0002-batman-adv-Fix-change-mac-address-of-soft-iface.patch new file mode 100644 index 0000000..21d0959 --- /dev/null +++ b/net/batman-adv/patches/0002-batman-adv-Fix-change-mac-address-of-soft-iface.patch @@ -0,0 +1,45 @@ +From 86fa71a4985f60da5918e1f43136dae77852cdc3 Mon Sep 17 00:00:00 2001 +From: Def +Date: Thu, 20 Sep 2012 14:56:13 +0200 +Subject: [PATCH] batman-adv: Fix change mac address of soft iface. + +Into function interface_set_mac_addr, the function tt_local_add was +invoked before updating dev->dev_addr. The new MAC address was not +tagged as NoPurge. + +Signed-off-by: Def +--- + soft-interface.c | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/soft-interface.c b/soft-interface.c +index cf26e41..b762068 100644 +--- a/soft-interface.c ++++ b/soft-interface.c +@@ -100,18 +100,21 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p) + { + struct batadv_priv *bat_priv = netdev_priv(dev); + struct sockaddr *addr = p; ++ uint8_t old_addr[ETH_ALEN]; + + if (!is_valid_ether_addr(addr->sa_data)) + return -EADDRNOTAVAIL; + ++ memcpy(old_addr, dev->dev_addr, ETH_ALEN); ++ memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); ++ + /* only modify transtable if it has been initialized before */ + if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_ACTIVE) { +- batadv_tt_local_remove(bat_priv, dev->dev_addr, ++ batadv_tt_local_remove(bat_priv, old_addr, + "mac address changed", false); + batadv_tt_local_add(dev, addr->sa_data, BATADV_NULL_IFINDEX); + } + +- memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); + dev->addr_assign_type &= ~NET_ADDR_RANDOM; + return 0; + } +-- +1.7.9.1 + diff --git a/net/batman-adv/patches/0003-batman-adv-Fix-symmetry-check-route-flapping-in-mult.patch b/net/batman-adv/patches/0003-batman-adv-Fix-symmetry-check-route-flapping-in-mult.patch new file mode 100644 index 0000000..c36fbce --- /dev/null +++ b/net/batman-adv/patches/0003-batman-adv-Fix-symmetry-check-route-flapping-in-mult.patch @@ -0,0 +1,71 @@ +From 6c9d9eeac0fb5d6625256cd119d0a4994c63e965 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Linus=20L=C3=BCssing?= +Date: Tue, 18 Sep 2012 03:01:08 +0200 +Subject: [PATCH] batman-adv: Fix symmetry check / route flapping in multi + interface setups +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If receiving an OGM from a neighbor other than the currently selected +and if it has the same TQ then we are supposed to switch if this +neighbor provides a more symmetric link than the currently selected one. + +However this symmetry check currently is broken if the interface of the +neighbor we received the OGM from and the one of the currently selected +neighbor differ: We are currently trying to determine the symmetry of the +link towards the selected router via the link we received the OGM from +instead of just checking via the link towards the currently selected +router. + +This leads to way more route switches than necessary and can lead to +permanent route flapping in many common multi interface setups. + +This patch fixes this issue by using the right interface for this +symmetry check. + +Signed-off-by: Linus Lüssing +--- + bat_iv_ogm.c | 13 +++++++------ + 1 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c +index e877af8..469daab 100644 +--- a/bat_iv_ogm.c ++++ b/bat_iv_ogm.c +@@ -642,7 +642,8 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, + struct batadv_neigh_node *router = NULL; + struct batadv_orig_node *orig_node_tmp; + struct hlist_node *node; +- uint8_t bcast_own_sum_orig, bcast_own_sum_neigh; ++ int if_num; ++ uint8_t sum_orig, sum_neigh; + uint8_t *neigh_addr; + + batadv_dbg(BATADV_DBG_BATMAN, bat_priv, +@@ -727,17 +728,17 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, + if (router && (neigh_node->tq_avg == router->tq_avg)) { + orig_node_tmp = router->orig_node; + spin_lock_bh(&orig_node_tmp->ogm_cnt_lock); +- bcast_own_sum_orig = +- orig_node_tmp->bcast_own_sum[if_incoming->if_num]; ++ if_num = router->if_incoming->if_num; ++ sum_orig = orig_node_tmp->bcast_own_sum[if_num]; + spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock); + + orig_node_tmp = neigh_node->orig_node; + spin_lock_bh(&orig_node_tmp->ogm_cnt_lock); +- bcast_own_sum_neigh = +- orig_node_tmp->bcast_own_sum[if_incoming->if_num]; ++ if_num = neigh_node->if_incoming->if_num; ++ sum_neigh = orig_node_tmp->bcast_own_sum[if_num]; + spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock); + +- if (bcast_own_sum_orig >= bcast_own_sum_neigh) ++ if (sum_orig >= sum_neigh) + goto update_tt; + } + +-- +1.7.9.1 + diff --git a/net/batman/Makefile b/net/batman/Makefile new file mode 100644 index 0000000..4026496 --- /dev/null +++ b/net/batman/Makefile @@ -0,0 +1,152 @@ +# +# Copyright (C) 2008-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=batmand +PKG_REV:=1439 +PKG_VERSION:=r$(PKG_REV) +PKG_RELEASE:=2 +PKG_EXTRA_CFLAGS=-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" + +PKG_SOURCE_PROTO:=svn +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=$(if $(PKG_BRANCH),$(PKG_BRANCH),$(PKG_NAME))-$(PKG_VERSION) +PKG_SOURCE_URL:=http://downloads.open-mesh.org/svn/batman/trunk/ +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_SOURCE_SUBDIR) + +PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/batman/linux/modules + +include $(INCLUDE_DIR)/package.mk + +define Package/batmand/Default + URL:=http://www.open-mesh.org/ + MAINTAINER:=Marek Lindner +endef + +define Package/batmand +$(call Package/batmand/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + DEPENDS:=+libpthread +kmod-tun + TITLE:=B.A.T.M.A.N. layer 3 routing daemon +endef + +define Package/batmand/description +B.A.T.M.A.N. layer 3 routing daemon +endef + +define Package/vis +$(call Package/batmand/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + DEPENDS:=+libpthread + TITLE:=visualization server for B.A.T.M.A.N. layer 3 +endef + +define Package/vis/description +visualization server for B.A.T.M.A.N. layer 3 +endef + +define KernelPackage/batgat +$(call Package/batmand/Default) + SUBMENU:=Network Support + DEPENDS:=+batmand @BROKEN + TITLE:=B.A.T.M.A.N. gateway module + FILES:=$(PKG_KMOD_BUILD_DIR)/batgat.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,50,batgat) +endef + + +define KernelPackage/batgat/description +Kernel gateway module for B.A.T.M.A.N. for better tunnel performance +endef + +MAKE_BATMAND_ARGS += \ + EXTRA_CFLAGS='$(TARGET_CFLAGS) $(PKG_EXTRA_CFLAGS)' \ + CCFLAGS="$(TARGET_CFLAGS)" \ + OFLAGS="$(TARGET_CFLAGS)" \ + REVISION="$(PKG_REV)" \ + CC="$(TARGET_CC)" \ + NODEBUG=1 \ + UNAME="Linux" \ + INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ + STRIP="/bin/true" \ + batmand install + +MAKE_VIS_ARGS += \ + EXTRA_CFLAGS='$(TARGET_CFLAGS) $(PKG_EXTRA_CFLAGS)' \ + CCFLAGS="$(TARGET_CFLAGS)" \ + OFLAGS="$(TARGET_CFLAGS)" \ + REVISION="$(PKG_REV)" \ + CC="$(TARGET_CC)" \ + NODEBUG=1 \ + UNAME="Linux" \ + INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ + STRIP="/bin/true" \ + vis install + +MAKE_BATGAT_ARGS += \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + ARCH="$(LINUX_KARCH)" \ + PATH="$(TARGET_PATH)" \ + SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \ + LINUX_VERSION="$(LINUX_VERSION)" \ + REVISION="$(PKG_REV)" modules + + +define Build/Configure +endef + +ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_batmand),) + BUILD_BATMAND := $(MAKE) -C $(PKG_BUILD_DIR)/batman $(MAKE_BATMAND_ARGS) +endif + +ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_vis),) + BUILD_VIS := $(MAKE) -C $(PKG_BUILD_DIR)/vis $(MAKE_VIS_ARGS) +endif + +ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batgat),) + BUILD_BATGAT := $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATGAT_ARGS) +endif + +define Build/Compile + $(BUILD_BATMAND) + $(BUILD_VIS) + cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile + $(BUILD_BATGAT) +endef + +define Package/batmand/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batmand $(1)/usr/sbin/ + $(INSTALL_BIN) ./files/etc/init.d/batmand $(1)/etc/init.d + $(INSTALL_DATA) ./files/etc/config/batmand $(1)/etc/config +endef + +define Package/batmand/conffiles +/etc/config/batmand +endef + +define Package/vis/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/vis $(1)/usr/sbin/ + $(INSTALL_BIN) ./files/etc/init.d/vis $(1)/etc/init.d + $(INSTALL_DATA) ./files/etc/config/vis $(1)/etc/config +endef + +define Package/vis/conffiles +/etc/config/vis +endef + +$(eval $(call BuildPackage,batmand)) +$(eval $(call BuildPackage,vis)) +$(eval $(call KernelPackage,batgat)) diff --git a/net/batman/files/etc/config/batmand b/net/batman/files/etc/config/batmand new file mode 100644 index 0000000..6d1f3be --- /dev/null +++ b/net/batman/files/etc/config/batmand @@ -0,0 +1,12 @@ +config batmand general + option interface ath0 + option hna + option gateway_class + option originator_interval + option preferred_gateway + option routing_class + option visualisation_srv + option policy_routing_script + option disable_client_nat + option disable_aggregation + diff --git a/net/batman/files/etc/config/vis b/net/batman/files/etc/config/vis new file mode 100644 index 0000000..6d30023 --- /dev/null +++ b/net/batman/files/etc/config/vis @@ -0,0 +1,3 @@ +config vis general + option interface ath0 + diff --git a/net/batman/files/etc/init.d/batmand b/net/batman/files/etc/init.d/batmand new file mode 100644 index 0000000..403e9f3 --- /dev/null +++ b/net/batman/files/etc/init.d/batmand @@ -0,0 +1,66 @@ +#!/bin/sh /etc/rc.common +START=90 + +start () { + interface=$(uci get batmand.general.interface) + if [ "$interface" = "" ]; then + echo $1 Error, you must specify at least a network interface + exit + fi + hnas=$(uci get batmand.general.hna) + gateway_class=$(uci get batmand.general.gateway_class) + originator_interval=$(uci get batmand.general.originator_interval) + preferred_gateway=$(uci get batmand.general.preferred_gateway) + routing_class=$(uci get batmand.general.routing_class) + visualisation_srv=$(uci get batmand.general.visualisation_srv) + policy_routing_script=$(uci get batmand.general.policy_routing_script) + disable_client_nat=$(uci get batmand.general.disable_client_nat) + disable_aggregation=$(uci get batmand.general.disable_aggregation) + batman_args="" + + for hna in $hnas + do + batman_args=${batman_args}'-a '$hna' ' + done + + if [ $gateway_class ]; then + batman_args=${batman_args}'-g '$gateway_class' ' + fi + + if [ $originator_interval ]; then + batman_args=${batman_args}'-o '$originator_interval' ' + fi + + if [ $preferred_gateway ]; then + batman_args=${batman_args}'-p '$preferred_gateway' ' + fi + + if [ $routing_class ]; then + batman_args=${batman_args}'-r '$routing_class' ' + fi + + if [ $visualisation_srv ]; then + batman_args=${batman_args}'-s '$visualisation_srv' ' + fi + + if [ $policy_routing_script ]; then + batman_args=${batman_args}'--policy-routing-script '$policy_routing_script' ' + fi + + if [ $disable_client_nat ]; then + batman_args=${batman_args}'--disable-client-nat ' + fi + + if [ $disable_aggregation ]; then + batman_args=${batman_args}'--disable-aggregation ' + fi + + batman_args=${batman_args}$interface + batmand $batman_args >/dev/null 2>&1 +} + +stop () { + killall batmand +} + + diff --git a/net/batman/files/etc/init.d/vis b/net/batman/files/etc/init.d/vis new file mode 100644 index 0000000..ef18eb7 --- /dev/null +++ b/net/batman/files/etc/init.d/vis @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +START=90 + +start () { + interface=$(uci get vis.general.interface) + if [ "$interface" = "" ]; then + echo $1 Error, you must specify at least a network interface + exit + fi + vis_args=$interface + + vis $vis_args >/dev/null 2>&1 +} + +stop () { + killall vis +} + + diff --git a/net/batman/patches/100-2.6.36.patch b/net/batman/patches/100-2.6.36.patch new file mode 100644 index 0000000..566c23b --- /dev/null +++ b/net/batman/patches/100-2.6.36.patch @@ -0,0 +1,47 @@ +--- + batman/linux/modules/gateway.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +--- batmand-r1439.orig/batman/linux/modules/gateway.c ++++ batmand-r1439/batman/linux/modules/gateway.c +@@ -29,6 +29,7 @@ static struct class *batman_class; + static int batgat_open(struct inode *inode, struct file *filp); + static int batgat_release(struct inode *inode, struct file *file); + static int batgat_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg ); ++static long batgat_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg ); + + + static void udp_data_ready(struct sock *sk, int len); +@@ -53,7 +54,11 @@ static int proc_clients_read(char *buf, + static struct file_operations fops = { + .open = batgat_open, + .release = batgat_release, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++ .unlocked_ioctl = batgat_ioctl_unlocked, ++#else + .ioctl = batgat_ioctl, ++#endif + }; + + +@@ -166,6 +171,20 @@ static int batgat_release(struct inode * + } + + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++#include ++static long batgat_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg ) ++{ ++ int ret; ++ ++ lock_kernel(); ++ ret = batgat_ioctl(file->f_path.dentry->d_inode, file, cmd, arg); ++ unlock_kernel(); ++ ++ return ret; ++} ++#endif ++ + static int batgat_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg ) + { + uint8_t tmp_ip[4]; diff --git a/net/bind/Makefile b/net/bind/Makefile new file mode 100644 index 0000000..06929f5 --- /dev/null +++ b/net/bind/Makefile @@ -0,0 +1,198 @@ +# +# Copyright (C) 2006-2012 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:=bind +PKG_VERSION:=9.9.1-P3 +PKG_RELEASE:=1 + +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:=8f407c9a988d7b447a54b4cb54230dcb + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=aclocal.m4 libtool.m4 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/bind/Default + SECTION:=net + CATEGORY:=Network + DEPENDS:=+bind-libs + TITLE:=bind + URL:=https://www.isc.org/software/bind + SUBMENU:=IP Addresses and Names +endef + +define Package/bind-libs + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libopenssl + TITLE:=bind shared libraries + URL:=https://www.isc.org/software/bind +endef + +define Package/bind-server + $(call Package/bind/Default) + TITLE+= DNS server +endef + +define Package/bind-client + $(call Package/bind/Default) + TITLE+= dynamic DNS client +endef + +define Package/bind-tools + $(call Package/bind/Default) + TITLE+= administration tools (all) +endef + +define Package/bind-rndc + $(call Package/bind/Default) + TITLE+= administration tools (rndc and rndc-confgen only) +endef + +define Package/bind-check + $(call Package/bind/Default) + TITLE+= administration tools (named-checkconf and named-checkzone only) +endef + +define Package/bind-dnssec + $(call Package/bind/Default) + TITLE+= administration tools (dnssec-keygen and dnssec-signzone only) +endef + +define Package/bind-host + $(call Package/bind/Default) + TITLE+= simple DNS client +endef + +define Package/bind-dig + $(call Package/bind/Default) + TITLE+= DNS excavation tool +endef + +export BUILD_CC="$(TARGET_CC)" + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --with-randomdev="/dev/urandom" \ + --disable-threads \ + --disable-linux-caps \ + --with-openssl="$(STAGING_DIR)/usr" \ + --with-libtool \ + --with-libxml2=no \ + --enable-epoll=yes \ + --with-gost=no \ + --with-gssapi=no \ + --with-readline=no + +CONFIGURE_VARS += \ + BUILD_CC="$(TARGET_CC)" \ + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \ + BUILD_CC="$(HOSTCC)" \ + CC="$(HOSTCC)" \ + CFLAGS="-O2" \ + LIBS="" \ + gen + $(call Build/Compile/Default) +endef + +define Package/bind-libs/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib +endef + +define Package/bind-server/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/bind + $(CP) \ + ./files/bind/db.0 \ + ./files/bind/db.127 \ + ./files/bind/db.255 \ + ./files/bind/db.local \ + ./files/bind/db.root \ + $(1)/etc/bind/ + $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named + find $(1)/etc/bind/ -name ".svn" | xargs rm -rf +endef + +define Package/bind-server/conffiles +/etc/bind/db.0 +/etc/bind/db.127 +/etc/bind/db.255 +/etc/bind/db.local +/etc/bind/db.root +/etc/bind/named.conf +endef + +define Package/bind-client/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/ +endef + +define Package/bind-tools/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/ +endef + +define Package/bind-rndc/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/ +endef + +define Package/bind-check/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/ +endef + +define Package/bind-dnssec/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/ +endef + +define Package/bind-host/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/ +endef + +define Package/bind-dig/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,bind-libs)) +$(eval $(call BuildPackage,bind-server)) +$(eval $(call BuildPackage,bind-client)) +$(eval $(call BuildPackage,bind-tools)) +$(eval $(call BuildPackage,bind-rndc)) +$(eval $(call BuildPackage,bind-check)) +$(eval $(call BuildPackage,bind-dnssec)) +$(eval $(call BuildPackage,bind-host)) +$(eval $(call BuildPackage,bind-dig)) diff --git a/net/bind/files/bind/db.0 b/net/bind/files/bind/db.0 new file mode 100644 index 0000000..e3aabdb --- /dev/null +++ b/net/bind/files/bind/db.0 @@ -0,0 +1,12 @@ +; +; BIND reverse data file for broadcast zone +; +$TTL 604800 +@ IN SOA localhost. root.localhost. ( + 1 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; +@ IN NS localhost. diff --git a/net/bind/files/bind/db.127 b/net/bind/files/bind/db.127 new file mode 100644 index 0000000..cd05bef --- /dev/null +++ b/net/bind/files/bind/db.127 @@ -0,0 +1,13 @@ +; +; BIND reverse data file for local loopback interface +; +$TTL 604800 +@ IN SOA localhost. root.localhost. ( + 1 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; +@ IN NS localhost. +1.0.0 IN PTR localhost. diff --git a/net/bind/files/bind/db.255 b/net/bind/files/bind/db.255 new file mode 100644 index 0000000..e3aabdb --- /dev/null +++ b/net/bind/files/bind/db.255 @@ -0,0 +1,12 @@ +; +; BIND reverse data file for broadcast zone +; +$TTL 604800 +@ IN SOA localhost. root.localhost. ( + 1 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; +@ IN NS localhost. diff --git a/net/bind/files/bind/db.local b/net/bind/files/bind/db.local new file mode 100644 index 0000000..66b4892 --- /dev/null +++ b/net/bind/files/bind/db.local @@ -0,0 +1,13 @@ +; +; BIND data file for local loopback interface +; +$TTL 604800 +@ IN SOA localhost. root.localhost. ( + 1 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; +@ IN NS localhost. +@ IN A 127.0.0.1 diff --git a/net/bind/files/bind/db.root b/net/bind/files/bind/db.root new file mode 100644 index 0000000..0eb52af --- /dev/null +++ b/net/bind/files/bind/db.root @@ -0,0 +1,45 @@ + +; <<>> DiG 9.2.3 <<>> ns . @a.root-servers.net. +;; global options: printcmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18944 +;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13 + +;; QUESTION SECTION: +;. IN NS + +;; ANSWER SECTION: +. 518400 IN NS A.ROOT-SERVERS.NET. +. 518400 IN NS B.ROOT-SERVERS.NET. +. 518400 IN NS C.ROOT-SERVERS.NET. +. 518400 IN NS D.ROOT-SERVERS.NET. +. 518400 IN NS E.ROOT-SERVERS.NET. +. 518400 IN NS F.ROOT-SERVERS.NET. +. 518400 IN NS G.ROOT-SERVERS.NET. +. 518400 IN NS H.ROOT-SERVERS.NET. +. 518400 IN NS I.ROOT-SERVERS.NET. +. 518400 IN NS J.ROOT-SERVERS.NET. +. 518400 IN NS K.ROOT-SERVERS.NET. +. 518400 IN NS L.ROOT-SERVERS.NET. +. 518400 IN NS M.ROOT-SERVERS.NET. + +;; ADDITIONAL SECTION: +A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4 +B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.201 +C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12 +D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.90 +E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.10 +F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.241 +G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.4 +H.ROOT-SERVERS.NET. 3600000 IN A 128.63.2.53 +I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.17 +J.ROOT-SERVERS.NET. 3600000 IN A 192.58.128.30 +K.ROOT-SERVERS.NET. 3600000 IN A 193.0.14.129 +L.ROOT-SERVERS.NET. 3600000 IN A 199.7.83.42 +M.ROOT-SERVERS.NET. 3600000 IN A 202.12.27.33 + +;; Query time: 81 msec +;; SERVER: 198.41.0.4#53(a.root-servers.net.) +;; WHEN: Sun Feb 1 11:27:14 2004 +;; MSG SIZE rcvd: 436 + diff --git a/net/bind/files/bind/named.conf.example b/net/bind/files/bind/named.conf.example new file mode 100644 index 0000000..1624549 --- /dev/null +++ b/net/bind/files/bind/named.conf.example @@ -0,0 +1,45 @@ +// This is the primary configuration file for the BIND DNS server named. + +options { + directory "/tmp"; + + // If your ISP provided one or more IP addresses for stable + // nameservers, you probably want to use them as forwarders. + // Uncomment the following block, and insert the addresses replacing + // the all-0's placeholder. + + // forwarders { + // 0.0.0.0; + // }; + + auth-nxdomain no; # conform to RFC1035 +}; + +// prime the server with knowledge of the root servers +zone "." { + type hint; + file "/etc/bind/db.root"; +}; + +// be authoritative for the localhost forward and reverse zones, and for +// broadcast zones as per RFC 1912 + +zone "localhost" { + type master; + file "/etc/bind/db.local"; +}; + +zone "127.in-addr.arpa" { + type master; + file "/etc/bind/db.127"; +}; + +zone "0.in-addr.arpa" { + type master; + file "/etc/bind/db.0"; +}; + +zone "255.in-addr.arpa" { + type master; + file "/etc/bind/db.255"; +}; diff --git a/net/bind/files/named.init b/net/bind/files/named.init new file mode 100644 index 0000000..986e5fe --- /dev/null +++ b/net/bind/files/named.init @@ -0,0 +1,40 @@ +#!/bin/sh /etc/rc.common +START=50 + +config_file=/etc/bind/named.conf +pid_file=/var/run/named/named.pid + +start() { + if [ -e $pid_file ] + then + echo " named already running with PID `cat $pid_file`" + return 1 + fi + echo Starting isc-bind + + /usr/sbin/named -c $config_file + + if [ $? -ne 0 ] + then + echo " isc-bind failed to start" + fi +} + +stop() { + echo "Stopping isc-bind" + if [ -e $pid_file ] + then + kill `cat $pid_file` + + if [ $? -ne 0 ] + then + echo " PID " `cat $pid_file` not found + echo " Is the named server running?" + fi + + rm -f $pid_file + + else + echo " $pid_file not found" + fi +} diff --git a/net/bind/patches/001-no-tests.patch b/net/bind/patches/001-no-tests.patch new file mode 100644 index 0000000..c4dc533 --- /dev/null +++ b/net/bind/patches/001-no-tests.patch @@ -0,0 +1,22 @@ +--- a/bin/Makefile.in ++++ b/bin/Makefile.in +@@ -19,7 +19,7 @@ srcdir = @srcdir@ + VPATH = @srcdir@ + top_srcdir = @top_srcdir@ + +-SUBDIRS = named rndc dig dnssec tests tools nsupdate \ ++SUBDIRS = named rndc dig dnssec tools nsupdate \ + check confgen @PKCS11_TOOLS@ + TARGETS = + +--- a/lib/Makefile.in ++++ b/lib/Makefile.in +@@ -23,7 +23,7 @@ top_srcdir = @top_srcdir@ + # Attempt to disable parallel processing. + .NOTPARALLEL: + .NO_PARALLEL: +-SUBDIRS = isc isccc dns isccfg bind9 lwres tests ++SUBDIRS = isc isccc dns isccfg bind9 lwres + TARGETS = + + @BIND9_MAKE_RULES@ diff --git a/net/bing/Makefile b/net/bing/Makefile new file mode 100644 index 0000000..c271e8f --- /dev/null +++ b/net/bing/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2006-2008 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:=bing +PKG_VERSION:=1.3.5 +PKG_RELEASE:=0 + +PKG_SOURCE:=$(PKG_NAME)_src-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://fgouget.free.fr/bing/ +PKG_MD5SUM:=60aaee55277672d0cc163bf3f0b3d53f +TAR_OPTIONS += || true + +include $(INCLUDE_DIR)/package.mk + +define Package/bing + SECTION:=net + CATEGORY:=Network + TITLE:=bing bandwidth measuring utility + URL:=http://fgouget.free.fr/bing/ +endef + +define Package/bing/description + bing evaluates the raw bandwidth of a link (PSTN, xDSL, Cable ...) +endef + +define Build/Compile + $(call Build/Compile/Default,bing) +endef + +define Package/bing/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bing $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,bing)) diff --git a/net/bird/Makefile b/net/bird/Makefile new file mode 100644 index 0000000..9658b62 --- /dev/null +++ b/net/bird/Makefile @@ -0,0 +1,160 @@ +# +# Copyright (C) 2009-2012 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:=bird +PKG_VERSION:=1.3.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=bird-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://bird.network.cz/pub/bird +PKG_MD5SUM:=c400b008ef834d9e7288dcdbe41b7c15 +PKG_BUILD_DEPENDS:=libncurses libreadline + +include $(INCLUDE_DIR)/package.mk + +define Package/bird/Default + TITLE:=The BIRD Internet Routing Daemon + URL:=http://bird.network.cz/ + DEPENDS:= +endef + +define Package/birdc/Default + TITLE:=The BIRD command-line client + URL:=http://bird.network.cz/ + DEPENDS:= +libreadline +libncurses +endef + +define Package/bird/Default/description1 +BIRD is an internet routing daemon which manages TCP/IP routing tables +with support of modern routing protocols, easy to use configuration +interface and powerful route filtering language. It is lightweight and +efficient and therefore appropriate for small embedded routers. + +endef + +define Package/bird/Default/description2 +In BGP, BIRD supports communities, multiprotocol extensions, MD5 +authentication, 32bit AS numbers and could act as a route server or a +route reflector. BIRD also supports multiple RIBs, multiple kernel +routing tables and redistribution between the protocols with a powerful +configuration syntax. + +endef + +define Package/bird/Default/description3 +This is a BIRD command-line client. It is used to send commands to BIRD, +commands can perform simple actions such as enabling/disabling of +protocols, telling BIRD to show various information, telling it to show +a routing table filtered by a filter, or asking BIRD to reconfigure. + +Unless you can't afford dependency on ncurses and readline, you +should install BIRD command-line client together with BIRD. + +endef + +define Package/bird4 +$(call Package/bird/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE+= (IPv4) +endef + +define Package/birdc4 +$(call Package/birdc/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE+= (IPv4) + DEPENDS+= +bird4 +endef + +define Package/bird6 +$(call Package/bird/Default) + SECTION:=ipv6 + CATEGORY:=IPv6 + TITLE+= (IPv6) +endef + +define Package/birdc6 +$(call Package/birdc/Default) + SECTION:=ipv6 + CATEGORY:=IPv6 + TITLE+= (IPv6) + DEPENDS+= +bird6 +endef + +define Package/bird4/description +$(call Package/bird/Default/description1) +This is IPv4 version of BIRD, it supports OSPFv2, RIPv2 and BGP +protocols. + +$(call Package/bird/Default/description2) +endef + +define Package/birdc4/description +$(call Package/bird/Default/description1) +$(call Package/bird/Default/description3) +endef + +define Package/bird6/description +$(call Package/bird/Default/description1) +This is IPv6 version of BIRD, it supports OSPFv3, RIPng and BGP +protocols. + +$(call Package/bird/Default/description2) +endef + +define Package/birdc6/description +$(call Package/bird/Default/description1) +$(call Package/bird/Default/description3) +endef + +CONFIGURE_ARGS += --with-linux-headers="$(LINUX_DIR)" + +define Build/Template + +$(STAMP_BUILT)-$(2): $(STAMP_PREPARED) + $(call Build/Configure/Default,$(3)) + $(call Build/Compile/Default,) + ( cd $(PKG_BUILD_DIR); mv -f bird bird$(2); mv -f birdc birdc$(2) ) + -$(MAKE) -C $(PKG_BUILD_DIR) clean + touch $$@ + +$(STAMP_BUILT): $(STAMP_BUILT)-$(2) + +define Package/bird$(2)/install + $(INSTALL_DIR) $$(1)/usr/sbin + $(INSTALL_BIN) $$(PKG_BUILD_DIR)/bird$(2) $$(1)/usr/sbin/ + $(INSTALL_BIN) ./files/bird$(2)loop $$(1)/usr/sbin/ + $(INSTALL_DIR) $$(1)/etc + $(INSTALL_DATA) ./files/bird$(2).conf $$(1)/etc/ + $(INSTALL_DIR) $$(1)/etc/init.d + $(INSTALL_BIN) ./files/bird$(2).init $$(1)/etc/init.d/bird$(2) + +endef + +define Package/bird$(2)/conffiles +/etc/bird$(2).conf +endef + +define Package/birdc$(2)/install + $(INSTALL_DIR) $$(1)/usr/sbin + $(INSTALL_BIN) $$(PKG_BUILD_DIR)/birdc$(2) $$(1)/usr/sbin/ +endef + +endef + + +$(eval $(call Build/Template,bird4,4, --disable-ipv6)) +$(eval $(call Build/Template,bird6,6, --enable-ipv6)) + +$(eval $(call BuildPackage,bird4)) +$(eval $(call BuildPackage,birdc4)) +$(eval $(call BuildPackage,bird6)) +$(eval $(call BuildPackage,birdc6)) diff --git a/net/bird/files/bird4.conf b/net/bird/files/bird4.conf new file mode 100644 index 0000000..8616a0a --- /dev/null +++ b/net/bird/files/bird4.conf @@ -0,0 +1,121 @@ + +# THIS CONFIG FILE IS NOT A COMPLETE DOCUMENTATION +# PLEASE LOOK IN THE BIRD DOCUMENTATION FOR MORE INFO + +# However, most of options used here are just for example +# and will be removed in real-life configs. + +log syslog all; + +# Override router ID +#router id 192.168.0.1; + +# Turn on global debugging of all protocols +#debug protocols all; + + +# Define a route filter... +# filter test_filter { +# if net ~ 10.0.0.0/16 then accept; +# else reject; +# } + +# The direct protocol automatically generates device routes to all network +# interfaces. Can exist in as many instances as you wish if you want to +# populate multiple routing tables with device routes. Because device routes +# are handled by Linux kernel, this protocol is usually not needed. +# protocol direct { +# interface "*"; # Restrict network interfaces it works with +# } + +# This pseudo-protocol performs synchronization between BIRD's routing +# tables and the kernel. You can run multiple instances of the kernel +# protocol and synchronize different kernel tables with different BIRD tables. +protocol kernel { +# learn; # Learn all alien routes from the kernel +# persist; # Don't remove routes on bird shutdown + scan time 20; # Scan kernel routing table every 20 seconds +# import none; # Default is import all +# export all; # Default is export none +} + +# This pseudo-protocol watches all interface up/down events. +protocol device { + scan time 10; # Scan interfaces every 10 seconds +} + +# Static routes (again, there can be multiple instances, so that you +# can disable/enable various groups of static routes on the fly). +protocol static { +# export all; # Default is export none +# route 0.0.0.0/0 via 62.168.0.13; +# route 10.0.0.0/8 reject; +# route 192.168.0.0/16 reject; +} + + +#protocol rip { +# disabled; +# import all; +# export all; +# export filter test_filter; + +# port 1520; +# period 7; +# infinity 16; +# garbage time 60; +# interface "*" { mode broadcast; }; +# honor neighbor; +# honor always; +# honor never; +# authentication none; +#} + + +#protocol ospf { +# disabled; +# import all; +# export all; +# export where source = RTS_STATIC; + +# area 0 { +# interface "eth*" { +# cost 10; +# hello 3; +# retransmit 2; +# wait 5; +# dead 20; +# type broadcast; +# authentication simple; +# password "pass"; +# }; +# }; +#} + + +#protocol bgp { +# disabled; +# import all; +# export all; +# export where source = RTS_STATIC; + +# local as 65000; +# neighbor 192.168.1.1 as 65001; +# multihop 20 via 192.168.2.1; + +# hold time 240; +# startup hold time 240; +# connect retry time 120; +# keepalive time 80; # defaults to hold time / 3 +# start delay time 5; # How long do we wait before initial connect +# error wait time 60, 300;# Minimum and maximum time we wait after an error (when consecutive +# # errors occur, we increase the delay exponentially ... +# error forget time 300; # ... until this timeout expires) +# disable after error; # Disable the protocol automatically when an error occurs +# next hop self; # Disable next hop processing and always advertise our local address as nexthop +# source address 62.168.0.14; # What local address we use for the TCP connection +# password "secret" # Password used for MD5 authentication +# rr client; # I am a route reflector and the neighor is my client +# rr cluster id 1.0.0.1 # Use this value for cluster id instead of my router id +# }; +#} diff --git a/net/bird/files/bird4.init b/net/bird/files/bird4.init new file mode 100644 index 0000000..8ac5e75 --- /dev/null +++ b/net/bird/files/bird4.init @@ -0,0 +1,21 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org + +START=50 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +start() { + service_start /usr/sbin/bird4 -d +# ( SERVICE_MATCH_NAME=1 service_start /usr/sbin/bird4loop ) +} + +stop() { +# ( SERVICE_MATCH_NAME=1 service_stop /usr/sbin/bird4loop ) + service_stop /usr/sbin/bird4 +} + +reload() { + service_reload /usr/sbin/bird4 +} diff --git a/net/bird/files/bird4loop b/net/bird/files/bird4loop new file mode 100644 index 0000000..074a9a2 --- /dev/null +++ b/net/bird/files/bird4loop @@ -0,0 +1,24 @@ +#!/bin/sh + +BIRD=/usr/sbin/bird4 + +$BIRD -p || return 1 + +. /lib/functions.sh +. /lib/functions/service.sh + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +sig_handler() { + running=0 + service_stop $BIRD +} + +running=1 +trap sig_handler INT +trap sig_handler TERM +while [ $running -gt 0 ]; do + service_check $BIRD || service_start $BIRD -d "$@" + sleep 3 +done diff --git a/net/bird/files/bird6.conf b/net/bird/files/bird6.conf new file mode 100644 index 0000000..8616a0a --- /dev/null +++ b/net/bird/files/bird6.conf @@ -0,0 +1,121 @@ + +# THIS CONFIG FILE IS NOT A COMPLETE DOCUMENTATION +# PLEASE LOOK IN THE BIRD DOCUMENTATION FOR MORE INFO + +# However, most of options used here are just for example +# and will be removed in real-life configs. + +log syslog all; + +# Override router ID +#router id 192.168.0.1; + +# Turn on global debugging of all protocols +#debug protocols all; + + +# Define a route filter... +# filter test_filter { +# if net ~ 10.0.0.0/16 then accept; +# else reject; +# } + +# The direct protocol automatically generates device routes to all network +# interfaces. Can exist in as many instances as you wish if you want to +# populate multiple routing tables with device routes. Because device routes +# are handled by Linux kernel, this protocol is usually not needed. +# protocol direct { +# interface "*"; # Restrict network interfaces it works with +# } + +# This pseudo-protocol performs synchronization between BIRD's routing +# tables and the kernel. You can run multiple instances of the kernel +# protocol and synchronize different kernel tables with different BIRD tables. +protocol kernel { +# learn; # Learn all alien routes from the kernel +# persist; # Don't remove routes on bird shutdown + scan time 20; # Scan kernel routing table every 20 seconds +# import none; # Default is import all +# export all; # Default is export none +} + +# This pseudo-protocol watches all interface up/down events. +protocol device { + scan time 10; # Scan interfaces every 10 seconds +} + +# Static routes (again, there can be multiple instances, so that you +# can disable/enable various groups of static routes on the fly). +protocol static { +# export all; # Default is export none +# route 0.0.0.0/0 via 62.168.0.13; +# route 10.0.0.0/8 reject; +# route 192.168.0.0/16 reject; +} + + +#protocol rip { +# disabled; +# import all; +# export all; +# export filter test_filter; + +# port 1520; +# period 7; +# infinity 16; +# garbage time 60; +# interface "*" { mode broadcast; }; +# honor neighbor; +# honor always; +# honor never; +# authentication none; +#} + + +#protocol ospf { +# disabled; +# import all; +# export all; +# export where source = RTS_STATIC; + +# area 0 { +# interface "eth*" { +# cost 10; +# hello 3; +# retransmit 2; +# wait 5; +# dead 20; +# type broadcast; +# authentication simple; +# password "pass"; +# }; +# }; +#} + + +#protocol bgp { +# disabled; +# import all; +# export all; +# export where source = RTS_STATIC; + +# local as 65000; +# neighbor 192.168.1.1 as 65001; +# multihop 20 via 192.168.2.1; + +# hold time 240; +# startup hold time 240; +# connect retry time 120; +# keepalive time 80; # defaults to hold time / 3 +# start delay time 5; # How long do we wait before initial connect +# error wait time 60, 300;# Minimum and maximum time we wait after an error (when consecutive +# # errors occur, we increase the delay exponentially ... +# error forget time 300; # ... until this timeout expires) +# disable after error; # Disable the protocol automatically when an error occurs +# next hop self; # Disable next hop processing and always advertise our local address as nexthop +# source address 62.168.0.14; # What local address we use for the TCP connection +# password "secret" # Password used for MD5 authentication +# rr client; # I am a route reflector and the neighor is my client +# rr cluster id 1.0.0.1 # Use this value for cluster id instead of my router id +# }; +#} diff --git a/net/bird/files/bird6.init b/net/bird/files/bird6.init new file mode 100644 index 0000000..2efb4f0 --- /dev/null +++ b/net/bird/files/bird6.init @@ -0,0 +1,21 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org + +START=50 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +start() { + service_start /usr/sbin/bird6 -d +# ( SERVICE_MATCH_NAME=1 service_start /usr/sbin/bird6loop ) +} + +stop() { +# ( SERVICE_MATCH_NAME=1 service_stop /usr/sbin/bird6loop ) + service_stop /usr/sbin/bird6 +} + +reload() { + service_reload /usr/sbin/bird6 +} diff --git a/net/bird/files/bird6loop b/net/bird/files/bird6loop new file mode 100644 index 0000000..c01cf2e --- /dev/null +++ b/net/bird/files/bird6loop @@ -0,0 +1,24 @@ +#!/bin/sh + +BIRD=/usr/sbin/bird6 + +$BIRD -p || return 1 + +. /lib/functions.sh +. /lib/functions/service.sh + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +sig_handler() { + running=0 + service_stop $BIRD +} + +running=1 +trap sig_handler INT +trap sig_handler TERM +while [ $running -gt 0 ]; do + service_check $BIRD || service_start $BIRD -d "$@" + sleep 3 +done diff --git a/net/bird/patches/0001-change_config_name.patch b/net/bird/patches/0001-change_config_name.patch new file mode 100644 index 0000000..98532f7 --- /dev/null +++ b/net/bird/patches/0001-change_config_name.patch @@ -0,0 +1,20 @@ +diff --git a/sysdep/config.h b/sysdep/config.h +index 03399bd..bc5eb77 100644 +--- a/sysdep/config.h ++++ b/sysdep/config.h +@@ -46,11 +46,11 @@ typedef u16 word; + # endif + #else + # ifdef DEBUGGING +-# define PATH_CONFIG "bird.conf" +-# define PATH_CONTROL_SOCKET "bird.ctl" ++# define PATH_CONFIG "bird4.conf" ++# define PATH_CONTROL_SOCKET "bird4.ctl" + # else +-# define PATH_CONFIG PATH_CONFIG_DIR "/bird.conf" +-# define PATH_CONTROL_SOCKET PATH_CONTROL_SOCKET_DIR "/bird.ctl" ++# define PATH_CONFIG PATH_CONFIG_DIR "/bird4.conf" ++# define PATH_CONTROL_SOCKET PATH_CONTROL_SOCKET_DIR "/bird4.ctl" + # endif + #endif + diff --git a/net/bitchx/Makefile b/net/bitchx/Makefile new file mode 100644 index 0000000..9857bee --- /dev/null +++ b/net/bitchx/Makefile @@ -0,0 +1,70 @@ +# +# Copyright (C) 2006-2009 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:=bitchx +PKG_VERSION:=1.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=ircii-pana-$(PKG_VERSION)-final.tar.gz +PKG_SOURCE_URL:=http://bitchx.org/files/source/ +PKG_MD5SUM:=611d2dda222f00c10140236f4c331572 + +PKG_BUILD_DIR:=$(BUILD_DIR)/BitchX + +PKG_BUILD_DEPENDS:=libncurses + +include $(INCLUDE_DIR)/package.mk + +define Package/bitchx + SUBMENU:=Instant Messaging + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libncurses + TITLE:=popular IRC client + URL:=http://www.bitchx.org +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all + mkdir -p $(PKG_INSTALL_DIR)/tmp + mkdir -p $(PKG_INSTALL_DIR)/etc/init.d + mkdir -p $(PKG_INSTALL_DIR)/usr/bin + mkdir -p $(PKG_INSTALL_DIR)/usr/lib/bx + mkdir -p $(PKG_INSTALL_DIR)/usr/share/man/man1 + mkdir -p $(PKG_INSTALL_DIR)/usr/lib/bx/translation + mkdir -p $(PKG_INSTALL_DIR)/usr/lib/bx/plugins + mkdir -p $(PKG_INSTALL_DIR)/usr/lib/bx/help + $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/BitchX $(PKG_INSTALL_DIR)/usr/bin/BitchX-1.1-final + rm -f $(PKG_INSTALL_DIR)/usr/bin/BitchX + ln -s /usr/bin/BitchX-1.1-final $(PKG_INSTALL_DIR)/usr/bin/BitchX + $(INSTALL_DATA) $(PKG_BUILD_DIR)/BitchX.help $(PKG_INSTALL_DIR)/usr/lib/bx/BitchX.help + $(INSTALL_DATA) $(PKG_BUILD_DIR)/BitchX.ircnames $(PKG_INSTALL_DIR)/usr/lib/bx/BitchX.ircnames + $(INSTALL_DATA) $(PKG_BUILD_DIR)/BitchX.quit $(PKG_INSTALL_DIR)/usr/lib/bx/BitchX.quit + $(INSTALL_DATA) $(PKG_BUILD_DIR)/BitchX.reasons $(PKG_INSTALL_DIR)/usr/lib/bx/BitchX.kick + $(INSTALL_DATA) $(PKG_BUILD_DIR)/source/wserv $(PKG_INSTALL_DIR)/usr/lib/bx/wserv + $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/scr-bx $(PKG_INSTALL_DIR)/usr/bin/scr-bx + $(CP) $(PKG_BUILD_DIR)/script $(PKG_INSTALL_DIR)/usr/lib/bx/ + $(CP) $(PKG_BUILD_DIR)/translation $(PKG_INSTALL_DIR)/usr/lib/bx/ + bzip2 $(PKG_INSTALL_DIR)/usr/lib/bx/translation/* + $(CP) ./files/bitchxrc $(PKG_INSTALL_DIR)/tmp/.bitchxrc + $(CP) ./files/bitchxrc.init $(PKG_INSTALL_DIR)/etc/init.d/bitchxrc +endef + +define Package/bitchx/install + $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib $(1)/etc/init.d $(1)/tmp + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/init.d/bitchxrc $(1)/etc/init.d/ + $(CP) $(PKG_INSTALL_DIR)/tmp/.bitchxrc $(1)/tmp +endef + +$(eval $(call BuildPackage,bitchx)) diff --git a/net/bitchx/files/bitchxrc b/net/bitchx/files/bitchxrc new file mode 100644 index 0000000..6e2b271 --- /dev/null +++ b/net/bitchx/files/bitchxrc @@ -0,0 +1,2 @@ +IRCUSER OpenWrt +IRCNAME OpenWrt User! diff --git a/net/bitchx/files/bitchxrc.init b/net/bitchx/files/bitchxrc.init new file mode 100644 index 0000000..e5966d3 --- /dev/null +++ b/net/bitchx/files/bitchxrc.init @@ -0,0 +1,11 @@ +#!/bin/sh /etc/rc.common + +START=98 +start() { + # make /tmp/.bitchxrc as many servers ban root + if [ ! -e /tmp/.bitchxrc ] + then + echo "IRCUSER OpenWrt" >/tmp/.bitchxrc + echo "IRCNAME OpenWrt User!" >>/tmp/.bitchxrc + fi +} diff --git a/net/bitchx/patches/001-fix_declarations.patch b/net/bitchx/patches/001-fix_declarations.patch new file mode 100644 index 0000000..b6766da --- /dev/null +++ b/net/bitchx/patches/001-fix_declarations.patch @@ -0,0 +1,24 @@ +diff -urN BitchX/include/ctcp.h BitchX.new/include/ctcp.h +--- BitchX/include/ctcp.h 2003-04-11 03:09:07.000000000 +0200 ++++ BitchX.new/include/ctcp.h 2006-03-29 13:19:21.170693168 +0200 +@@ -56,7 +56,7 @@ + extern CtcpEntryDll *dll_ctcp; + + +-extern char *ctcp_type[]; ++//extern char *ctcp_type[]; /* already declared in ctcp.c + extern int sed; + extern int in_ctcp_flag; + +diff -urN BitchX/include/struct.h BitchX.new/include/struct.h +--- BitchX/include/struct.h 2003-04-11 03:09:07.000000000 +0200 ++++ BitchX.new/include/struct.h 2006-03-29 13:19:26.653859600 +0200 +@@ -1064,7 +1064,7 @@ + int delete; + } TimerList; + +-extern TimerList *PendingTimers; ++//extern TimerList *PendingTimers; + typedef struct nicktab_stru + { + struct nicktab_stru *next; diff --git a/net/bitchx/patches/002-tparm.patch b/net/bitchx/patches/002-tparm.patch new file mode 100644 index 0000000..18bd7bf --- /dev/null +++ b/net/bitchx/patches/002-tparm.patch @@ -0,0 +1,10 @@ +--- BitchX/source/term.c.orig 2006-03-05 15:01:46.000000000 +1000 ++++ BitchX/source/term.c 2006-03-05 15:01:53.000000000 +1000 +@@ -92,7 +92,6 @@ + #endif + + extern char *getenv(); +-extern char *tparm(); + + /* + * The old code assumed termcap. termcap is almost always present, but on diff --git a/net/bitlbee/Makefile b/net/bitlbee/Makefile new file mode 100644 index 0000000..87ce80a --- /dev/null +++ b/net/bitlbee/Makefile @@ -0,0 +1,88 @@ +# +# Copyright (C) 2006-2011 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:=bitlbee +PKG_VERSION:=1.0.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://get.bitlbee.org/src \ + http://get.bitlbee.be/src \ + http://get.us.bitlbee.org/src \ + http://ftp.snt.utwente.nl/pub/software/bitlbee/src +PKG_MD5SUM:=a4d7daa9b64898dd41a3a6d104692d9a + +PKG_BUILD_DEPENDS:=libopenssl glib1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/bitlbee + SUBMENU:=Instant Messaging + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libopenssl +glib1 $(ICONV_DEPENDS) + TITLE:=IRC gateway to IM chat networks + URL:=http://www.bitlbee.org/ +endef + +define Package/bitlbee/conffiles +/etc/bitlbee/motd.txt +/etc/bitlbee/bitlbee.conf +endef + +define Build/Configure + # it's not GNU autoconf stuff + (cd $(PKG_BUILD_DIR); \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + STAGING_DIR="$(STAGING_DIR)" \ + STRIP="$(STRIP)" \ + ./configure \ + --prefix=/usr/ \ + --bindir=/usr/sbin/ \ + --etcdir=/etc/bitlbee/ \ + --datadir=/usr/share/bitlbee/ \ + --config=/var/lib/bitlbee/ \ + --arch=OpenWrt \ + --cpu="$(ARCH)" \ + --debug=0 \ + --strip=1 \ + --sizeopt=1 \ + --ipv6=1 \ + --ssl=openssl \ + --glib1=1 \ + --glib1prefix="$(STAGING_DIR)/usr" \ + ); + $(SED) 's,^CFLAGS=.*,CFLAGS=$(TARGET_CFLAGS),g'\ + $(PKG_BUILD_DIR)/Makefile.settings + @echo 'CFLAGS+=-I$(ICONV_PREFIX)/include' >> \ + $(PKG_BUILD_DIR)/Makefile.settings + @echo 'LFLAGS+=$(TARGET_LDFLAGS)' >> \ + $(PKG_BUILD_DIR)/Makefile.settings + @echo 'LFLAGS+=-L$(ICONV_PREFIX)/lib' >> \ + $(PKG_BUILD_DIR)/Makefile.settings +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +define Package/bitlbee/install + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(1)" install-etc install-bin + $(MAKE) -C $(PKG_BUILD_DIR)/doc/user-guide \ + DESTDIR="$(1)" install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/bitlbee.init $(1)/etc/init.d/bitlbee +endef + +$(eval $(call BuildPackage,bitlbee)) diff --git a/net/bitlbee/files/bitlbee.init b/net/bitlbee/files/bitlbee.init new file mode 100644 index 0000000..b85450b --- /dev/null +++ b/net/bitlbee/files/bitlbee.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +start() { + mkdir -m 0755 -p /var/lib/bitlbee + service_start /usr/sbin/bitlbee -D +} + +stop() { + service_stop /usr/sbin/bitlbee +} diff --git a/net/bitlbee/patches/100-cross_compile_configure_fix b/net/bitlbee/patches/100-cross_compile_configure_fix new file mode 100644 index 0000000..3ba17d2 --- /dev/null +++ b/net/bitlbee/patches/100-cross_compile_configure_fix @@ -0,0 +1,98 @@ +diff -Nur bitlbee-1.0.1-orig/configure bitlbee-1.0.1/configure +--- bitlbee-1.0.1-orig/configure 2006-01-14 16:14:05.000000000 +0100 ++++ bitlbee-1.0.1/configure 2006-03-06 18:30:19.000000000 +0100 +@@ -21,9 +21,12 @@ + + debug=0 + strip=1 ++sizeopt=0 + ipv6=1 + ssl=auto + ++glib1=0 ++ + arch=`uname -s` + cpu=`uname -m` + +@@ -52,11 +55,18 @@ + + --debug=0/1 Disable/enable debugging $debug + --strip=0/1 Disable/enable binary stripping $strip ++--sizeopt=0/1 Disable/enable size optimization $sizeopt ++ ++--arch=... Describe Operating System ?! $arch ++--cpu=... Describe CPU $cpu + + --ipv6=0/1 IPv6 socket support $ipv6 + + --ssl=... SSL library to use (gnutls, nss, openssl, bogus, auto) + $ssl ++--glib1=0/1 Force usage of glib1 even if glib2 is present ++--glib1prefix=... ++ + EOF + exit; + fi +@@ -110,8 +120,13 @@ + echo 'CFLAGS=-g' >> Makefile.settings + echo 'DEBUG=1' >> Makefile.settings + echo '#define DEBUG' >> config.h ++ if [ "$sizeopt" = "1" ]; then ++ echo "Warning: won't optimize for size since debug is on." ++ fi ++elif [ "$sizeopt" = "1" ]; then ++ echo 'CFLAGS=-Os' >> Makefile.settings + else +- echo 'CFLAGS=-O3' >> Makefile.settings ++ echo 'CFLAGS=-O2' >> Makefile.settings + fi + + echo CFLAGS+=-I`pwd` -I`pwd`/protocols -I. >> Makefile.settings +@@ -138,24 +153,33 @@ + exit 1; + fi + +-if type pkg-config > /dev/null 2>/dev/null && pkg-config glib-2.0; then ++if [ "$glib1" != "1" ] && \ ++ type pkg-config > /dev/null 2>/dev/null && pkg-config glib-2.0; then + cat<>Makefile.settings + EFLAGS+=`pkg-config --libs glib-2.0` + CFLAGS+=`pkg-config --cflags glib-2.0` + EOF + echo '#define GLIB2' >> config.h +-elif type glib-config > /dev/null 2> /dev/null; then ++elif [ "x$glib1prefix" = "x" ] && \ ++ type glib-config > /dev/null 2> /dev/null; then + cat<>Makefile.settings + EFLAGS+=`glib-config --libs` + CFLAGS+=`glib-config --cflags` + EOF + echo '#define GLIB1' >> config.h ++elif [ "x$glib1prefix" != "x" ] && \ ++ type "$glib1prefix/bin/glib-config" > /dev/null 2> /dev/null; then ++ cat<>Makefile.settings ++EFLAGS+=`$glib1prefix/bin/glib-config --prefix=$glib1prefix --libs` ++CFLAGS+=`$glib1prefix/bin/glib-config --prefix=$glib1prefix --cflags` ++EOF ++ echo '#define GLIB1' >> config.h + else + echo 'Cannot find glib development libraries, aborting. (Install libglib-dev?)' + exit 1; + fi + +-if [ -r /usr/include/iconv.h ]; then ++if [ -r "$STAGING_DIR/usr/include/iconv.h" ]; then + :; + elif [ -r /usr/local/include/iconv.h ]; then + echo CFLAGS+=-I/usr/local/include >> Makefile.settings; +@@ -360,6 +384,10 @@ + CYGWIN* ) + echo 'Cygwin is not officially supported.' + ;; ++OpenWrt ) ++ echo 'EFLAGS+=-liconv' >> Makefile.settings; ++ echo "CFLAGS+=\"-I$STAGING_DIR/usr/include\"" >> Makefile.settings; ++;; + * ) + echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.' + echo 'Please report any problems at http://bugs.bitlbee.org/.' diff --git a/net/bmon/Makefile b/net/bmon/Makefile new file mode 100644 index 0000000..6235265 --- /dev/null +++ b/net/bmon/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2007 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bmon +PKG_VERSION:=2.1.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://people.suug.ch/~tgr/bmon/files/ +PKG_MD5SUM:=3111a027907016c0902d67350c619df6 + +include $(INCLUDE_DIR)/package.mk + +define Package/bmon + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libncurses + TITLE:=bmon is a portable bandwidth monitor + URL:=http://people.suug.ch/~tgr/bmon/ +endef + +define Package/bmon/description + bmon is a portable bandwidth monitor + and rate estimator running on various + operating systems. It supports various + input methods for different architectures. +endef + +CONFIGURE_ARGS += \ + --disable-cnt-workaround \ + --disable-dbi \ + --disable-rrd \ + --disable-asound \ + +CONFIGURE_VARS += \ + ac_cv_lib_nl_nl_connect=no \ + +define Package/bmon/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bmon $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,bmon)) diff --git a/net/bmon/patches/001-bugfixes.patch b/net/bmon/patches/001-bugfixes.patch new file mode 100644 index 0000000..fcb9306 --- /dev/null +++ b/net/bmon/patches/001-bugfixes.patch @@ -0,0 +1,26 @@ +Index: bmon-2.1.0/src/out_audio.c +=================================================================== +--- bmon-2.1.0.orig/src/out_audio.c 2007-11-20 17:25:54.000000000 +0100 ++++ bmon-2.1.0/src/out_audio.c 2007-11-20 17:25:54.000000000 +0100 +@@ -141,7 +141,7 @@ + .om_draw = audio_draw, + .om_set_opts = audio_set_opts, + .om_probe = audio_probe, +- .om_shutdown audio_shutdown, ++ .om_shutdown = audio_shutdown, + }; + + static void __init audio_init(void) +Index: bmon-2.1.0/src/out_xml_event.c +=================================================================== +--- bmon-2.1.0.orig/src/out_xml_event.c 2007-11-20 17:25:54.000000000 +0100 ++++ bmon-2.1.0/src/out_xml_event.c 2007-11-20 17:25:54.000000000 +0100 +@@ -127,7 +127,7 @@ + .om_draw = xml_event_draw, + .om_set_opts = xml_event_set_opts, + .om_probe = xml_event_probe, +- .om_shutdown xml_event_shutdown, ++ .om_shutdown = xml_event_shutdown, + }; + + static void __init xml_event_init(void) diff --git a/net/bmx6/Makefile b/net/bmx6/Makefile new file mode 100644 index 0000000..bdcdbbf --- /dev/null +++ b/net/bmx6/Makefile @@ -0,0 +1,102 @@ +# +# Copyright (C) 2011 OpenWrt.org, bmx6.net +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bmx6 + + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://git.bmx6.net/bmx6.git +PKG_REV:=c3ef7d76292a765c5e578bd4113030dc34ee3b9a + +PKG_VERSION:=r2011031602 + +#PKG_RELEASE:=1 +#PKG_INSTALL:=1 # this tries to install straight to /usr/sbin/bmx6 + +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) + +include $(INCLUDE_DIR)/package.mk + + +TARGET_CFLAGS += $(FPIC) + +#-DNO_TRAFFIC_DUMP -DNO_DYN_PLUGIN -DNO_DEBUG_DUMP -DNO_DEBUG_ALL -DNO_DEBUG_TRACK -DNO_DEBUG_SYS + +MAKE_ARGS += \ + EXTRA_CFLAGS="$(TARGET_CFLAGS) -I. -I$(STAGING_DIR)/usr/include -DNO_DEBUG_ALL -DNO_DEBUG_DUMP" \ + EXTRA_LDFLAGS="-L$(STAGING_DIR)/usr/lib " \ + REVISION_VERSION="$(PKG_REV)" \ + CC="$(TARGET_CC)" \ + INSTALL_DIR="$(PKG_INSTALL_DIR)" \ + STRIP="/bin/true" \ + build_all + + +define Package/bmx6/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE:=BMX6 layer 3 routing daemon + URL:=http://bmx6.net/ + MAINTAINER:=Axel Neumann +endef + +define Package/bmx6/description +BMX6 layer 3 routing daemon supporting IPv4, IPv6, and IPv4 over IPv6 - http://www.bmx6.net +endef + +define Package/bmx6 + $(call Package/bmx6/Default) + MENU:=1 +endef + +define Package/bmx6-uci-config + $(call Package/bmx6/Default) + DEPENDS:=bmx6 +libuci + TITLE:=configuration plugin based on uci (recommended!) +endef + + + + +define Build/Configure + mkdir -p $(PKG_INSTALL_DIR) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) +endef + + +define Package/bmx6/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bmx6 $(1)/usr/sbin/bmx6 +endef + + +define Package/bmx6-uci-config/conffiles +/etc/config/bmx6 +endef + + +define Package/bmx6-uci-config/install + $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/config $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_uci_config/bmx6_config.so $(1)/usr/lib/bmx6_config.so + $(INSTALL_BIN) ./files/etc/init.d/bmx6 $(1)/etc/init.d/bmx6 + $(INSTALL_DATA) ./files/etc/config/bmx6 $(1)/etc/config/bmx6 +endef + + +$(eval $(call BuildPackage,bmx6)) +$(eval $(call BuildPackage,bmx6-uci-config)) + diff --git a/net/bmx6/files/etc/config/bmx6 b/net/bmx6/files/etc/config/bmx6 new file mode 100644 index 0000000..d593e74 --- /dev/null +++ b/net/bmx6/files/etc/config/bmx6 @@ -0,0 +1,23 @@ +# for more options execute: bmx6 --help + +config 'bmx6' 'general' +# option 'runtime_dir' '/var/run/bmx6' +# option 'niit_source' '10.202.0.116' + +#config 'ip_version' 'ip_version' +# option 'ip_version' '6' # default is 4 +# option 'throw_rules' '0' + +config 'dev' 'mesh_1' + option 'dev' 'eth0.12' + +config 'dev' 'mesh_2' + option 'dev' 'ath0.12' + +#config 'unicast_hna' 'my_global_prefix' +# option 'unicast_hna' '2012:0:0:74:0:0:0:0/64' + +#config 'unicast_hna' 'niit6to4' +# option 'unicast_hna' '0:0:0:0:0:ffff:10.202.0.116/128' + + diff --git a/net/bmx6/files/etc/init.d/bmx6 b/net/bmx6/files/etc/init.d/bmx6 new file mode 100644 index 0000000..c584718 --- /dev/null +++ b/net/bmx6/files/etc/init.d/bmx6 @@ -0,0 +1,20 @@ +#!/bin/sh /etc/rc.common +START=91 + +BIN=/usr/sbin/bmx6 +CONF=/etc/config/bmx6 +PID=/var/run/bmx6/pid + + +start() { + #$BIN -f $CONF -d0 > /dev/null & + start-stop-daemon -b -x $BIN -S -- -f $CONF +} + +stop() { + start-stop-daemon -p $PID -K +} + +restart() { + stop; sleep 3; start +} diff --git a/net/bmxd/Makefile b/net/bmxd/Makefile new file mode 100644 index 0000000..5dfd7f9 --- /dev/null +++ b/net/bmxd/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2008 Freifunk Leipzig +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bmxd + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://github.com/axn/bmxd.git +PKG_REV:=9c1d12b554dccd2efde249f5e44a7d4de59ce1a8 +PKG_VERSION:=r2012011001 +#PKG_RELEASE:=1 +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) + +PKG_EXTRA_CFLAGS:=-DNODEBUGALL + + +include $(INCLUDE_DIR)/package.mk + +define Package/bmxd/Default + URL:=http://www.bmx6.net/ + MAINTAINER:=Axel Neumann +endef + +define Package/bmxd +$(call Package/bmxd/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + DEPENDS:=+kmod-tun + TITLE:=B.a.t.M.a.n. eXperimental (BMX) layer 3 routing daemon +endef + +define Package/bmxd/conffiles +/etc/config/bmxd +endef + + +define Package/bmxd/description +B.a.t.M.a.n. eXperimental (BMX) layer 3 routing daemon +endef + +MAKE_ARGS += \ + EXTRA_CFLAGS="$(TARGET_CFLAGS) $(PKG_EXTRA_CFLAGS)" \ + CCFLAGS="$(TARGET_CFLAGS)" \ + OFLAGS="$(TARGET_CFLAGS)" \ + REVISION="$(PKG_REV)" \ + CC="$(TARGET_CC)" \ + NODEBUG=1 \ + UNAME="Linux" \ + INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ + STRIP="/bin/true" \ + bmxd install + +define Build/Compile + mkdir -p $(PKG_INSTALL_DIR)/usr/sbin + $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) +endef + +define Package/bmxd/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bmxd $(1)/usr/sbin/bmxd + $(INSTALL_BIN) ./files/etc/init.d/bmxd $(1)/etc/init.d + $(INSTALL_DATA) ./files/etc/config/bmxd $(1)/etc/config +endef + +$(eval $(call BuildPackage,bmxd)) diff --git a/net/bmxd/files/etc/config/bmxd b/net/bmxd/files/etc/config/bmxd new file mode 100644 index 0000000..c8619e9 --- /dev/null +++ b/net/bmxd/files/etc/config/bmxd @@ -0,0 +1,9 @@ +config bmxd general + option interface 'ath0' +# option announce +# option gateway_class +# option originator_interval +# option preferred_gateway +# option routing_class +# option visualisation_srv +# option misc 'base-port=14305' diff --git a/net/bmxd/files/etc/init.d/bmxd b/net/bmxd/files/etc/init.d/bmxd new file mode 100644 index 0000000..d23b4c8 --- /dev/null +++ b/net/bmxd/files/etc/init.d/bmxd @@ -0,0 +1,51 @@ +#!/bin/sh /etc/rc.common +START=91 +. /lib/config/uci.sh +uci_load bmxd +start () { + interface="$(uci get bmxd.general.interface)" + if [ "$interface" = "" ]; then + echo $1 Error, you must specify at least a network interface + exit + fi + announce=$(uci get bmxd.general.announce) + gateway_class=$(uci get bmxd.general.gateway_class) + originator_interval=$(uci get bmxd.general.originator_interval) + preferred_gateway=$(uci get bmxd.general.preferred_gateway) + routing_class=$(uci get bmxd.general.routing_class) + visualisation_srv=$(uci get bmxd.general.visualisation_srv) + misc="$(uci get bmxd.general.misc)" + bmx_args="" + + if [ $announce ]; then + bmx_args=${bmx_args}'-a '$announce' ' + fi + + if [ $gateway_class ]; then + bmx_args=${bmx_args}'-g '$gateway_class' ' + fi + + if [ $originator_interval ]; then + bmx_args=${bmx_args}'-o '$originator_interval' ' + fi + + if [ $preferred_gateway ]; then + bmx_args=${bmx_args}'-p '$preferred_gateway' ' + fi + + if [ $routing_class ]; then + bmx_args=${bmx_args}'-r '$routing_class' ' + fi + + if [ $visualisation_srv ]; then + bmx_args=${bmx_args}'-s '$visualisation_srv' ' + fi + + + bmx_args="$misc ${bmx_args} $interface" + bmxd $bmx_args >/dev/null 2>&1 +} + +stop () { + killall bmxd +} diff --git a/net/btpd/Makefile b/net/btpd/Makefile new file mode 100644 index 0000000..351d46e --- /dev/null +++ b/net/btpd/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2009-2011 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:=btpd +PKG_VERSION:=0.16 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/downloads/btpd/btpd +PKG_MD5SUM:=fe042aae8d7c515ecd855673d1c2b33e + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/btpd + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpthread +librt + SUBMENU:=BitTorrent + TITLE:=btpd - BitTorrent Protocol Daemon + URL:=https://github.com/btpd/btpd/wiki/ +endef + +define Package/btpd/description + BTPD is a bittorrent client consisting of a daemon and client commands, + which can be used to read and/or manipulate the daemon state. + The daemon is capable of running several torrents simultaneously and + only uses one tcp port. + It's fairly low on resource usage and should be perfect for file + distribution sites. + Efficient downloads and ease of use makes this client a good choice for + the casual user as well. +endef + +define Package/btpd/conffiles +/etc/config/btpd +endef + +CONFIGURE_ARGS += -C --with-evloop-method=poll + +define Package/btpd/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/bt{cli,info,pd} $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/btpd.init $(1)/etc/init.d/btpd + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/btpd.config $(1)/etc/config/btpd +endef + +$(eval $(call BuildPackage,btpd)) diff --git a/net/btpd/files/btpd.config b/net/btpd/files/btpd.config new file mode 100644 index 0000000..9650fc9 --- /dev/null +++ b/net/btpd/files/btpd.config @@ -0,0 +1,7 @@ +config 'btpd' + option 'directory' '/usb/btpd' + option 'maxkbin' '1000' + option 'maxkbout' '40' + option 'maxpeers' '140' + option 'maxuploads' '50' + option 'port' '47194' diff --git a/net/btpd/files/btpd.init b/net/btpd/files/btpd.init new file mode 100644 index 0000000..867b553 --- /dev/null +++ b/net/btpd/files/btpd.init @@ -0,0 +1,61 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=99 + +append_bool() { + local section="$1" + local option="$2" + local value="$3" + local _loctmp + config_get_bool _loctmp "$section" "$option" 0 + [ "$_loctmp" -gt 0 ] && append args "$value" +} + +append_parm() { + local section="$1" + local option="$2" + local switch="$3" + local _loctmp + config_get _loctmp "$section" "$option" + [ -z "$_loctmp" ] && return 0 + append args "$switch $_loctmp" +} + + +btpd() { + local cfg="$1" + args="" + directory="" + append_bool "$cfg" useipv4 "-4" + append_bool "$cfg" useipv6 "-6" + append_bool "$cfg" emptystart "--empty-start" + append_parm "$cfg" port "-p" + append_parm "$cfg" directory "-d" + append_parm "$cfg" maxpeers "--max-peers" + append_parm "$cfg" maxuploads "--max-uploads" + append_parm "$cfg" maxkbin "--bw-in" + append_parm "$cfg" maxkbout "--bw-out" + config_get directory "$cfg" directory +} + +start() { + config_load btpd + config_foreach btpd btpd + + service_start /usr/bin/btpd $args +} + +stop() { + config_load btpd + config_foreach btpd btpd + + [ -d $directory ] && args="-d $directory " + + while btcli $args kill ; do + sleep 3 + done 2>/dev/null + + service_stop /usr/bin/btpd +} + diff --git a/net/btpd/patches/000-sha1.diff b/net/btpd/patches/000-sha1.diff new file mode 100644 index 0000000..a6d8640 --- /dev/null +++ b/net/btpd/patches/000-sha1.diff @@ -0,0 +1,731 @@ +--- a/btpd/btpd.c ++++ b/btpd/btpd.c +@@ -1,6 +1,6 @@ + #include "btpd.h" + +-#include ++#include "sha1.h" + #include + + static uint8_t m_peer_id[20]; +@@ -114,7 +114,7 @@ btpd_init(void) + idcon[sizeof(idcon) - 1] = '\0'; + n = strlen(idcon); + +- SHA1(idcon, n, m_peer_id); ++ sha1_buffer(idcon, n, m_peer_id); + bcopy(m_peer_id, &seed, sizeof(seed)); + bcopy(BTPD_VERSION, m_peer_id, sizeof(BTPD_VERSION) - 1); + m_peer_id[sizeof(BTPD_VERSION) - 1] = '|'; +--- a/btpd/content.c ++++ b/btpd/content.c +@@ -1,6 +1,6 @@ + #include "btpd.h" + +-#include ++#include "sha1.h" + #include + + struct content { +@@ -60,16 +60,16 @@ static struct timeout m_workev; + static int + test_hash(struct torrent *tp, uint8_t *hash, uint32_t piece) + { +- char piece_hash[SHA_DIGEST_LENGTH]; ++ char piece_hash[SHA1_DIGEST_SIZE]; + tlib_read_hash(tp->tl, tp->pieces_off, piece, piece_hash); +- return bcmp(hash, piece_hash, SHA_DIGEST_LENGTH); ++ return bcmp(hash, piece_hash, SHA1_DIGEST_SIZE); + } + + static int + test_piece(struct torrent *tp, uint32_t piece, int *ok) + { + int err; +- uint8_t hash[SHA_DIGEST_LENGTH]; ++ uint8_t hash[SHA1_DIGEST_SIZE]; + if ((err = bts_sha(tp->cm->rds, piece * tp->piece_length, + torrent_piece_size(tp, piece), hash)) != 0) { + btpd_log(BTPD_L_ERROR, "io error on '%s' (%s).\n", +--- a/btpd/download_subr.c ++++ b/btpd/download_subr.c +@@ -21,7 +21,7 @@ + + #include "btpd.h" + +-#include ++#include "sha1.h" + #include + + static void +@@ -42,7 +42,7 @@ piece_log_hashes(struct piece *pc) + for (unsigned i = 0; i < pc->nblocks; i++) { + uint32_t bsize = torrent_block_size(tp, pc->index, pc->nblocks, i); + cm_get_bytes(tp, pc->index, i * PIECE_BLOCKLEN, bsize, &buf); +- SHA1(buf, bsize, &log->hashes[i * 20]); ++ sha1_buffer(buf, bsize, &log->hashes[i * 20]); + free(buf); + } + } +--- a/btpd/torrent.c ++++ b/btpd/torrent.c +@@ -1,7 +1,5 @@ + #include "btpd.h" + +-#include +- + #define SAVE_INTERVAL 300 + + static unsigned m_nghosts; +--- a/configure.ac ++++ b/configure.ac +@@ -29,13 +29,6 @@ rm -f conftest.c conftest.$OBJEXT + rm -f conftest.c conftest.$OBJEXT + [$3])) + +-AC_ARG_WITH(openssl, +-[ --with-openssl=dir use openssl installed in dir], +-[ +- AC_SUBST(openssl_LDFLAGS,["-L${withval}/lib -Wl,-R,${withval}/lib"]) +- AC_SUBST(openssl_CPPFLAGS,"-I${withval}/include") +-]) +- + AC_ARG_WITH(evloop-method, + [ --with-evloop-method select evloop method (epoll,poll,kqueue)], + evloop_methods=$withval, +@@ -76,11 +69,6 @@ CC_ARGS_OK_IFELSE(-Wno-pointer-sign, + , + AC_MSG_RESULT(no)) + +-old_LDFLAGS="$LDFLAGS" +-LDFLAGS="$LDFLAGS $openssl_LDFLAGS" +-AC_CHECK_LIB(crypto, SHA1_Final,:,AC_MSG_FAILURE(btpd needs openssl's libraries and headers)) +-LDFLAGS=$old_LDFLAGS +- + for m in $evloop_methods; do + case $m in + epoll) +--- a/misc/metainfo.c ++++ b/misc/metainfo.c +@@ -6,8 +6,7 @@ + #include + #include + +-#include +- ++#include "sha1.h" + #include "benc.h" + #include "metainfo.h" + #include "subr.h" +@@ -159,7 +158,7 @@ mi_info_hash(const char *p, uint8_t *has + if (hash == NULL) + if ((hash = malloc(20)) == NULL) + return NULL; +- return SHA1(info, benc_length(info), hash); ++ return (uint8_t *)sha1_buffer(info, benc_length(info), hash); + } + + char * +--- /dev/null ++++ b/misc/sha1.c +@@ -0,0 +1,428 @@ ++/* sha1.c - Functions to compute SHA1 message digest of files or ++ memory blocks according to the NIST specification FIPS-180-1. ++ ++ Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2008, 2009, 2010 Free ++ Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published by the ++ Free Software Foundation; either version 2, or (at your option) any ++ later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ ++ ++/* Written by Scott G. Miller ++ Credits: ++ Robert Klep -- Expansion function fix ++*/ ++ ++#include ++ ++#include "sha1.h" ++ ++#include ++#include ++#include ++ ++#if USE_UNLOCKED_IO ++# include "unlocked-io.h" ++#endif ++ ++#ifdef WORDS_BIGENDIAN ++# define SWAP(n) (n) ++#else ++# define SWAP(n) \ ++ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) ++#endif ++ ++#define BLOCKSIZE 32768 ++#if BLOCKSIZE % 64 != 0 ++# error "invalid BLOCKSIZE" ++#endif ++ ++/* This array contains the bytes used to pad the buffer to the next ++ 64-byte boundary. (RFC 1321, 3.1: Step 1) */ ++static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; ++ ++ ++/* Take a pointer to a 160 bit block of data (five 32 bit ints) and ++ initialize it to the start constants of the SHA1 algorithm. This ++ must be called before using hash in the call to sha1_hash. */ ++void ++sha1_init_ctx (struct sha1_ctx *ctx) ++{ ++ ctx->A = 0x67452301; ++ ctx->B = 0xefcdab89; ++ ctx->C = 0x98badcfe; ++ ctx->D = 0x10325476; ++ ctx->E = 0xc3d2e1f0; ++ ++ ctx->total[0] = ctx->total[1] = 0; ++ ctx->buflen = 0; ++} ++ ++/* Copy the 4 byte value from v into the memory location pointed to by *cp, ++ If your architecture allows unaligned access this is equivalent to ++ * (uint32_t *) cp = v */ ++static inline void ++set_uint32 (char *cp, uint32_t v) ++{ ++ memcpy (cp, &v, sizeof v); ++} ++ ++/* Put result from CTX in first 20 bytes following RESBUF. The result ++ must be in little endian byte order. */ ++void * ++sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf) ++{ ++ char *r = resbuf; ++ set_uint32 (r + 0 * sizeof ctx->A, SWAP (ctx->A)); ++ set_uint32 (r + 1 * sizeof ctx->B, SWAP (ctx->B)); ++ set_uint32 (r + 2 * sizeof ctx->C, SWAP (ctx->C)); ++ set_uint32 (r + 3 * sizeof ctx->D, SWAP (ctx->D)); ++ set_uint32 (r + 4 * sizeof ctx->E, SWAP (ctx->E)); ++ ++ return resbuf; ++} ++ ++/* Process the remaining bytes in the internal buffer and the usual ++ prolog according to the standard and write the result to RESBUF. */ ++void * ++sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf) ++{ ++ /* Take yet unprocessed bytes into account. */ ++ uint32_t bytes = ctx->buflen; ++ size_t size = (bytes < 56) ? 64 / 4 : 64 * 2 / 4; ++ ++ /* Now count remaining bytes. */ ++ ctx->total[0] += bytes; ++ if (ctx->total[0] < bytes) ++ ++ctx->total[1]; ++ ++ /* Put the 64-bit file length in *bits* at the end of the buffer. */ ++ ctx->buffer[size - 2] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); ++ ctx->buffer[size - 1] = SWAP (ctx->total[0] << 3); ++ ++ memcpy (&((char *) ctx->buffer)[bytes], fillbuf, (size - 2) * 4 - bytes); ++ ++ /* Process last bytes. */ ++ sha1_process_block (ctx->buffer, size * 4, ctx); ++ ++ return sha1_read_ctx (ctx, resbuf); ++} ++ ++/* Compute SHA1 message digest for bytes read from STREAM. The ++ resulting message digest number will be written into the 16 bytes ++ beginning at RESBLOCK. */ ++int ++sha1_stream (FILE *stream, void *resblock) ++{ ++ struct sha1_ctx ctx; ++ size_t sum; ++ ++ char *buffer = malloc (BLOCKSIZE + 72); ++ if (!buffer) ++ return 1; ++ ++ /* Initialize the computation context. */ ++ sha1_init_ctx (&ctx); ++ ++ /* Iterate over full file contents. */ ++ while (1) ++ { ++ /* We read the file in blocks of BLOCKSIZE bytes. One call of the ++ computation function processes the whole buffer so that with the ++ next round of the loop another block can be read. */ ++ size_t n; ++ sum = 0; ++ ++ /* Read block. Take care for partial reads. */ ++ while (1) ++ { ++ n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); ++ ++ sum += n; ++ ++ if (sum == BLOCKSIZE) ++ break; ++ ++ if (n == 0) ++ { ++ /* Check for the error flag IFF N == 0, so that we don't ++ exit the loop after a partial read due to e.g., EAGAIN ++ or EWOULDBLOCK. */ ++ if (ferror (stream)) ++ { ++ free (buffer); ++ return 1; ++ } ++ goto process_partial_block; ++ } ++ ++ /* We've read at least one byte, so ignore errors. But always ++ check for EOF, since feof may be true even though N > 0. ++ Otherwise, we could end up calling fread after EOF. */ ++ if (feof (stream)) ++ goto process_partial_block; ++ } ++ ++ /* Process buffer with BLOCKSIZE bytes. Note that ++ BLOCKSIZE % 64 == 0 ++ */ ++ sha1_process_block (buffer, BLOCKSIZE, &ctx); ++ } ++ ++ process_partial_block:; ++ ++ /* Process any remaining bytes. */ ++ if (sum > 0) ++ sha1_process_bytes (buffer, sum, &ctx); ++ ++ /* Construct result in desired memory. */ ++ sha1_finish_ctx (&ctx, resblock); ++ free (buffer); ++ return 0; ++} ++ ++/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The ++ result is always in little endian byte order, so that a byte-wise ++ output yields to the wanted ASCII representation of the message ++ digest. */ ++void * ++sha1_buffer (const char *buffer, size_t len, void *resblock) ++{ ++ struct sha1_ctx ctx; ++ ++ /* Initialize the computation context. */ ++ sha1_init_ctx (&ctx); ++ ++ /* Process whole buffer but last len % 64 bytes. */ ++ sha1_process_bytes (buffer, len, &ctx); ++ ++ /* Put result in desired memory area. */ ++ return sha1_finish_ctx (&ctx, resblock); ++} ++ ++void ++sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx) ++{ ++ /* When we already have some bits in our internal buffer concatenate ++ both inputs first. */ ++ if (ctx->buflen != 0) ++ { ++ size_t left_over = ctx->buflen; ++ size_t add = 128 - left_over > len ? len : 128 - left_over; ++ ++ memcpy (&((char *) ctx->buffer)[left_over], buffer, add); ++ ctx->buflen += add; ++ ++ if (ctx->buflen > 64) ++ { ++ sha1_process_block (ctx->buffer, ctx->buflen & ~63, ctx); ++ ++ ctx->buflen &= 63; ++ /* The regions in the following copy operation cannot overlap. */ ++ memcpy (ctx->buffer, ++ &((char *) ctx->buffer)[(left_over + add) & ~63], ++ ctx->buflen); ++ } ++ ++ buffer = (const char *) buffer + add; ++ len -= add; ++ } ++ ++ /* Process available complete blocks. */ ++ if (len >= 64) ++ { ++#if !_STRING_ARCH_unaligned ++# define alignof(type) offsetof (struct { char c; type x; }, x) ++# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0) ++ if (UNALIGNED_P (buffer)) ++ while (len > 64) ++ { ++ sha1_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); ++ buffer = (const char *) buffer + 64; ++ len -= 64; ++ } ++ else ++#endif ++ { ++ sha1_process_block (buffer, len & ~63, ctx); ++ buffer = (const char *) buffer + (len & ~63); ++ len &= 63; ++ } ++ } ++ ++ /* Move remaining bytes in internal buffer. */ ++ if (len > 0) ++ { ++ size_t left_over = ctx->buflen; ++ ++ memcpy (&((char *) ctx->buffer)[left_over], buffer, len); ++ left_over += len; ++ if (left_over >= 64) ++ { ++ sha1_process_block (ctx->buffer, 64, ctx); ++ left_over -= 64; ++ memcpy (ctx->buffer, &ctx->buffer[16], left_over); ++ } ++ ctx->buflen = left_over; ++ } ++} ++ ++/* --- Code below is the primary difference between md5.c and sha1.c --- */ ++ ++/* SHA1 round constants */ ++#define K1 0x5a827999 ++#define K2 0x6ed9eba1 ++#define K3 0x8f1bbcdc ++#define K4 0xca62c1d6 ++ ++/* Round functions. Note that F2 is the same as F4. */ ++#define F1(B,C,D) ( D ^ ( B & ( C ^ D ) ) ) ++#define F2(B,C,D) (B ^ C ^ D) ++#define F3(B,C,D) ( ( B & C ) | ( D & ( B | C ) ) ) ++#define F4(B,C,D) (B ^ C ^ D) ++ ++/* Process LEN bytes of BUFFER, accumulating context into CTX. ++ It is assumed that LEN % 64 == 0. ++ Most of this code comes from GnuPG's cipher/sha1.c. */ ++ ++void ++sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx) ++{ ++ const uint32_t *words = buffer; ++ size_t nwords = len / sizeof (uint32_t); ++ const uint32_t *endp = words + nwords; ++ uint32_t x[16]; ++ uint32_t a = ctx->A; ++ uint32_t b = ctx->B; ++ uint32_t c = ctx->C; ++ uint32_t d = ctx->D; ++ uint32_t e = ctx->E; ++ ++ /* First increment the byte count. RFC 1321 specifies the possible ++ length of the file up to 2^64 bits. Here we only compute the ++ number of bytes. Do a double word increment. */ ++ ctx->total[0] += len; ++ if (ctx->total[0] < len) ++ ++ctx->total[1]; ++ ++#define rol(x, n) (((x) << (n)) | ((uint32_t) (x) >> (32 - (n)))) ++ ++#define M(I) ( tm = x[I&0x0f] ^ x[(I-14)&0x0f] \ ++ ^ x[(I-8)&0x0f] ^ x[(I-3)&0x0f] \ ++ , (x[I&0x0f] = rol(tm, 1)) ) ++ ++#define R(A,B,C,D,E,F,K,M) do { E += rol( A, 5 ) \ ++ + F( B, C, D ) \ ++ + K \ ++ + M; \ ++ B = rol( B, 30 ); \ ++ } while(0) ++ ++ while (words < endp) ++ { ++ uint32_t tm; ++ int t; ++ for (t = 0; t < 16; t++) ++ { ++ x[t] = SWAP (*words); ++ words++; ++ } ++ ++ R( a, b, c, d, e, F1, K1, x[ 0] ); ++ R( e, a, b, c, d, F1, K1, x[ 1] ); ++ R( d, e, a, b, c, F1, K1, x[ 2] ); ++ R( c, d, e, a, b, F1, K1, x[ 3] ); ++ R( b, c, d, e, a, F1, K1, x[ 4] ); ++ R( a, b, c, d, e, F1, K1, x[ 5] ); ++ R( e, a, b, c, d, F1, K1, x[ 6] ); ++ R( d, e, a, b, c, F1, K1, x[ 7] ); ++ R( c, d, e, a, b, F1, K1, x[ 8] ); ++ R( b, c, d, e, a, F1, K1, x[ 9] ); ++ R( a, b, c, d, e, F1, K1, x[10] ); ++ R( e, a, b, c, d, F1, K1, x[11] ); ++ R( d, e, a, b, c, F1, K1, x[12] ); ++ R( c, d, e, a, b, F1, K1, x[13] ); ++ R( b, c, d, e, a, F1, K1, x[14] ); ++ R( a, b, c, d, e, F1, K1, x[15] ); ++ R( e, a, b, c, d, F1, K1, M(16) ); ++ R( d, e, a, b, c, F1, K1, M(17) ); ++ R( c, d, e, a, b, F1, K1, M(18) ); ++ R( b, c, d, e, a, F1, K1, M(19) ); ++ R( a, b, c, d, e, F2, K2, M(20) ); ++ R( e, a, b, c, d, F2, K2, M(21) ); ++ R( d, e, a, b, c, F2, K2, M(22) ); ++ R( c, d, e, a, b, F2, K2, M(23) ); ++ R( b, c, d, e, a, F2, K2, M(24) ); ++ R( a, b, c, d, e, F2, K2, M(25) ); ++ R( e, a, b, c, d, F2, K2, M(26) ); ++ R( d, e, a, b, c, F2, K2, M(27) ); ++ R( c, d, e, a, b, F2, K2, M(28) ); ++ R( b, c, d, e, a, F2, K2, M(29) ); ++ R( a, b, c, d, e, F2, K2, M(30) ); ++ R( e, a, b, c, d, F2, K2, M(31) ); ++ R( d, e, a, b, c, F2, K2, M(32) ); ++ R( c, d, e, a, b, F2, K2, M(33) ); ++ R( b, c, d, e, a, F2, K2, M(34) ); ++ R( a, b, c, d, e, F2, K2, M(35) ); ++ R( e, a, b, c, d, F2, K2, M(36) ); ++ R( d, e, a, b, c, F2, K2, M(37) ); ++ R( c, d, e, a, b, F2, K2, M(38) ); ++ R( b, c, d, e, a, F2, K2, M(39) ); ++ R( a, b, c, d, e, F3, K3, M(40) ); ++ R( e, a, b, c, d, F3, K3, M(41) ); ++ R( d, e, a, b, c, F3, K3, M(42) ); ++ R( c, d, e, a, b, F3, K3, M(43) ); ++ R( b, c, d, e, a, F3, K3, M(44) ); ++ R( a, b, c, d, e, F3, K3, M(45) ); ++ R( e, a, b, c, d, F3, K3, M(46) ); ++ R( d, e, a, b, c, F3, K3, M(47) ); ++ R( c, d, e, a, b, F3, K3, M(48) ); ++ R( b, c, d, e, a, F3, K3, M(49) ); ++ R( a, b, c, d, e, F3, K3, M(50) ); ++ R( e, a, b, c, d, F3, K3, M(51) ); ++ R( d, e, a, b, c, F3, K3, M(52) ); ++ R( c, d, e, a, b, F3, K3, M(53) ); ++ R( b, c, d, e, a, F3, K3, M(54) ); ++ R( a, b, c, d, e, F3, K3, M(55) ); ++ R( e, a, b, c, d, F3, K3, M(56) ); ++ R( d, e, a, b, c, F3, K3, M(57) ); ++ R( c, d, e, a, b, F3, K3, M(58) ); ++ R( b, c, d, e, a, F3, K3, M(59) ); ++ R( a, b, c, d, e, F4, K4, M(60) ); ++ R( e, a, b, c, d, F4, K4, M(61) ); ++ R( d, e, a, b, c, F4, K4, M(62) ); ++ R( c, d, e, a, b, F4, K4, M(63) ); ++ R( b, c, d, e, a, F4, K4, M(64) ); ++ R( a, b, c, d, e, F4, K4, M(65) ); ++ R( e, a, b, c, d, F4, K4, M(66) ); ++ R( d, e, a, b, c, F4, K4, M(67) ); ++ R( c, d, e, a, b, F4, K4, M(68) ); ++ R( b, c, d, e, a, F4, K4, M(69) ); ++ R( a, b, c, d, e, F4, K4, M(70) ); ++ R( e, a, b, c, d, F4, K4, M(71) ); ++ R( d, e, a, b, c, F4, K4, M(72) ); ++ R( c, d, e, a, b, F4, K4, M(73) ); ++ R( b, c, d, e, a, F4, K4, M(74) ); ++ R( a, b, c, d, e, F4, K4, M(75) ); ++ R( e, a, b, c, d, F4, K4, M(76) ); ++ R( d, e, a, b, c, F4, K4, M(77) ); ++ R( c, d, e, a, b, F4, K4, M(78) ); ++ R( b, c, d, e, a, F4, K4, M(79) ); ++ ++ a = ctx->A += a; ++ b = ctx->B += b; ++ c = ctx->C += c; ++ d = ctx->D += d; ++ e = ctx->E += e; ++ } ++} +--- /dev/null ++++ b/misc/sha1.h +@@ -0,0 +1,92 @@ ++/* Declarations of functions and data types used for SHA1 sum ++ library functions. ++ Copyright (C) 2000, 2001, 2003, 2005, 2006, 2008, 2009, 2010 Free Software ++ Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published by the ++ Free Software Foundation; either version 2, or (at your option) any ++ later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ ++ ++#ifndef SHA1_H ++# define SHA1_H 1 ++ ++# include ++# include ++ ++# ifdef __cplusplus ++extern "C" { ++# endif ++ ++#define SHA1_DIGEST_SIZE 20 ++ ++/* Structure to save state of computation between the single steps. */ ++struct sha1_ctx ++{ ++ uint32_t A; ++ uint32_t B; ++ uint32_t C; ++ uint32_t D; ++ uint32_t E; ++ ++ uint32_t total[2]; ++ uint32_t buflen; ++ uint32_t buffer[32]; ++}; ++ ++ ++/* Initialize structure containing state of computation. */ ++extern void sha1_init_ctx (struct sha1_ctx *ctx); ++ ++/* Starting with the result of former calls of this function (or the ++ initialization function update the context for the next LEN bytes ++ starting at BUFFER. ++ It is necessary that LEN is a multiple of 64!!! */ ++extern void sha1_process_block (const void *buffer, size_t len, ++ struct sha1_ctx *ctx); ++ ++/* Starting with the result of former calls of this function (or the ++ initialization function update the context for the next LEN bytes ++ starting at BUFFER. ++ It is NOT required that LEN is a multiple of 64. */ ++extern void sha1_process_bytes (const void *buffer, size_t len, ++ struct sha1_ctx *ctx); ++ ++/* Process the remaining bytes in the buffer and put result from CTX ++ in first 20 bytes following RESBUF. The result is always in little ++ endian byte order, so that a byte-wise output yields to the wanted ++ ASCII representation of the message digest. */ ++extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf); ++ ++ ++/* Put result from CTX in first 20 bytes following RESBUF. The result is ++ always in little endian byte order, so that a byte-wise output yields ++ to the wanted ASCII representation of the message digest. */ ++extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf); ++ ++ ++/* Compute SHA1 message digest for bytes read from STREAM. The ++ resulting message digest number will be written into the 20 bytes ++ beginning at RESBLOCK. */ ++extern int sha1_stream (FILE *stream, void *resblock); ++ ++/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The ++ result is always in little endian byte order, so that a byte-wise ++ output yields to the wanted ASCII representation of the message ++ digest. */ ++extern void *sha1_buffer (const char *buffer, size_t len, void *resblock); ++ ++# ifdef __cplusplus ++} ++# endif ++ ++#endif +--- a/misc/stream.c ++++ b/misc/stream.c +@@ -5,7 +5,7 @@ + #include + #include + +-#include ++#include "sha1.h" + + #include "metainfo.h" + #include "subr.h" +@@ -161,21 +161,21 @@ bts_put(struct bt_stream *bts, off_t off + int + bts_sha(struct bt_stream *bts, off_t start, off_t length, uint8_t *hash) + { +- SHA_CTX ctx; ++ struct sha1_ctx ctx; + char buf[SHAFILEBUF]; + size_t wantread; + int err = 0; + +- SHA1_Init(&ctx); ++ sha1_init_ctx(&ctx); + while (length > 0) { + wantread = min(length, SHAFILEBUF); + if ((err = bts_get(bts, start, buf, wantread)) != 0) + break; + length -= wantread; + start += wantread; +- SHA1_Update(&ctx, buf, wantread); ++ sha1_process_bytes(buf, wantread, &ctx); + } +- SHA1_Final(hash, &ctx); ++ sha1_finish_ctx(&ctx, hash); + return err; + } + +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,6 +1,6 @@ + AM_CFLAGS=-std=c99 -Wall @WARNNPS@ +-AM_CPPFLAGS=-D_FILE_OFFSET_BITS=64 -D@EVLOOP_METHOD@ -I$(top_srcdir)/misc -I$(top_srcdir)/evloop @openssl_CPPFLAGS@ +-AM_LDFLAGS=@openssl_LDFLAGS@ ++AM_CPPFLAGS=-D_FILE_OFFSET_BITS=64 -D@EVLOOP_METHOD@ -I$(top_srcdir)/misc -I$(top_srcdir)/evloop ++AM_LDFLAGS= + + bin_PROGRAMS=btpd/btpd cli/btcli cli/btinfo + noinst_LIBRARIES=misc/libmisc.a evloop/libevloop.a +@@ -25,15 +25,15 @@ btpd_btpd_SOURCES=\ + btpd/upload.c btpd/upload.h\ + btpd/util.c + btpd_btpd_CFLAGS=@TD_CFLAGS@ $(AM_CFLAGS) +-btpd_btpd_LDADD=@TD_LIBS@ misc/libmisc.a evloop/libevloop.a -lcrypto -lm @CLOCKLIB@ @INETLIBS@ ++btpd_btpd_LDADD=@TD_LIBS@ misc/libmisc.a evloop/libevloop.a -lm @CLOCKLIB@ @INETLIBS@ + + # btinfo + cli_btinfo_SOURCES=cli/btinfo.c +-cli_btinfo_LDADD=misc/libmisc.a -lcrypto -lm ++cli_btinfo_LDADD=misc/libmisc.a -lm + + # btcli + cli_btcli_SOURCES=cli/btcli.c cli/btcli.h cli/add.c cli/del.c cli/list.c cli/kill.c cli/start.c cli/stop.c cli/stat.c +-cli_btcli_LDADD=misc/libmisc.a -lcrypto -lm @INETLIBS@ ++cli_btcli_LDADD=misc/libmisc.a -lm @INETLIBS@ + + # libmisc + misc_libmisc_a_SOURCES=\ +@@ -45,7 +45,8 @@ misc_libmisc_a_SOURCES=\ + misc/iobuf.c misc/iobuf.h\ + misc/queue.h\ + misc/stream.c misc/stream.h\ +- misc/subr.c misc/subr.h ++ misc/subr.c misc/subr.h\ ++ misc/sha1.c misc/sha1.h + + # evloop + EXTRA_evloop_libevloop_a_SOURCES=evloop/epoll.c evloop/kqueue.c evloop/poll.c diff --git a/net/btpd/patches/001-gettime.patch b/net/btpd/patches/001-gettime.patch new file mode 100644 index 0000000..012b95d --- /dev/null +++ b/net/btpd/patches/001-gettime.patch @@ -0,0 +1,11 @@ +--- a/evloop/timer.c ++++ b/evloop/timer.c +@@ -14,7 +14,7 @@ + int + evtimer_gettime(struct timespec *ts) + { +- return clock_gettime(TIMER_CLOCK, ts); ++ return clock_gettime(CLOCK_REALTIME, ts); + } + + #elif defined(HAVE_MACH_ABSOLUTE_TIME) diff --git a/net/btpd/patches/002-config.h.patch b/net/btpd/patches/002-config.h.patch new file mode 100644 index 0000000..1950030 --- /dev/null +++ b/net/btpd/patches/002-config.h.patch @@ -0,0 +1,13 @@ +--- a/misc/sha1.c ++++ b/misc/sha1.c +@@ -23,7 +23,9 @@ + Robert Klep -- Expansion function fix + */ + +-#include ++#ifdef HAVE_CONFIG_H ++# include ++#endif + + #include "sha1.h" + diff --git a/net/btpd/patches/100-clock.diff b/net/btpd/patches/100-clock.diff new file mode 100644 index 0000000..223ef06 --- /dev/null +++ b/net/btpd/patches/100-clock.diff @@ -0,0 +1,4 @@ +--- /dev/null ++++ b/config.cache +@@ -0,0 +1 @@ ++ac_cv_func_clock_gettime=no diff --git a/net/bwm/Makefile b/net/bwm/Makefile new file mode 100644 index 0000000..17d2c30 --- /dev/null +++ b/net/bwm/Makefile @@ -0,0 +1,38 @@ +# +# 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:=bwm +PKG_VERSION:=1.1.0 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/b/bwm +PKG_MD5SUM:=51021a036acb92d2bda0c0c0483f9552 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).orig + +include $(INCLUDE_DIR)/package.mk + +define Package/bwm + SECTION:=net + CATEGORY:=Network + TITLE:=A very tiny bandwidth monitor + URL:=http://ftp.debian.org/debian/pool/main/b/bwm +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) $(PKG_BUILD_DIR)/bwm.c -o $(PKG_BUILD_DIR)/bwm +endef + +define Package/bwm/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bwm $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,bwm)) diff --git a/net/bwm/patches/001-debian.patch b/net/bwm/patches/001-debian.patch new file mode 100644 index 0000000..043d862 --- /dev/null +++ b/net/bwm/patches/001-debian.patch @@ -0,0 +1,45 @@ +--- a/bwm.c ++++ b/bwm.c +@@ -57,7 +57,8 @@ int main(int argc, char *argv[]) + char buffer[256]; + char *buffer_pointer; + +- int inum; ++ int inum = -1; ++ int oldinum = -1; + int field_number; + int total_counter; + int sleep_time = 2; +@@ -90,7 +91,13 @@ int main(int argc, char *argv[]) + + while(1) + { +- printf("%c[H",27); ++ if (inum==oldinum) ++ { ++ printf("%c[H",27); ++ } else { ++ printf("%c[H%c[J",27,27); ++ oldinum = inum; ++ } + printf("Bandwidth Monitor 1.1.0\n\n"); + printf(" Iface RX(KB/sec) TX(KB/sec) Total(KB/sec)\n\n"); + +@@ -138,7 +145,7 @@ int main(int argc, char *argv[]) + + interface[inum].rx_kbytes_dif = + (interface[inum].rx_bytes_new - +- interface[inum].rx_bytes_old) * 1000 / 1024; ++ interface[inum].rx_bytes_old) / 1024 * 1000; + + interface[inum].rx_rate_whole = + interface[inum].rx_kbytes_dif / +@@ -157,7 +164,7 @@ int main(int argc, char *argv[]) + + interface[inum].tx_kbytes_dif = + (interface[inum].tx_bytes_new - +- interface[inum].tx_bytes_old) * 1000 / 1024; ++ interface[inum].tx_bytes_old) / 1024 * 1000; + + interface[inum].tx_rate_whole = + interface[inum].tx_kbytes_dif / diff --git a/net/bwping/Makefile b/net/bwping/Makefile new file mode 100644 index 0000000..c63c46a --- /dev/null +++ b/net/bwping/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2011 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:=bwping +PKG_VERSION:=1.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/bwping +PKG_MD5SUM:=e5d2de8cf61791ad16713bd86609368f + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/bwping + SECTION:=net + CATEGORY:=Network + TITLE:=Open Source bandwidth measurement tool + URL:=http://bwping.sourceforge.net +endef + +define Package/bwping/description + BWPing is a bandwidth measurement tool based on ICMP echo + request/reply. It is especially well suited for lossy links. BWPing + does not not require any special software on the remote host (only + the ability to respond on ICMP echo request messages). +endef + +define Package/bwping/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/$(PKG_NAME) $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,bwping)) diff --git a/net/cbtt/Makefile b/net/cbtt/Makefile new file mode 100644 index 0000000..19f259b --- /dev/null +++ b/net/cbtt/Makefile @@ -0,0 +1,84 @@ +# 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:=cbtt +PKG_VERSION:=20060727 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)80-$(PKG_VERSION)-src.tar.gz +PKG_SOURCE_URL:=@SF/bnbtusermods +PKG_MD5SUM:=d6edf0a11d7e68fa3d121e91308f22f5 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)80-$(PKG_VERSION)-src + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/cbtt/Default + SUBMENU:=BitTorrent + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpthread $(CXX_DEPENDS) +zlib + TITLE:=Bittorrent tracker + URL:=http://bnbtusermods.sourceforge.net/ +endef + +define Package/cbtt +$(call Package/cbtt/Default) +endef + +define Package/cbtt-mysql +$(call Package/cbtt/Default) + DEPENDS+= +libmysqlclient + TITLE+= (with mysql support) +endef + + +define Build/Template + +$(STAMP_BUILT)-$(2): $(STAMP_PREPARED) + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + LFLAGS="$(TARGET_LDFLAGS) -L. $(4) -lz -lm -lpthread" \ + $(3) + touch $$@ + +$(STAMP_BUILT): $(STAMP_BUILT)-$(2) + +define Package/$(1)/install + $(INSTALL_DIR) $$(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(3) $$(1)/usr/bin/ +endef + +endef + +define Build/Configure +endef + +define Build/Compile +endef + +ifneq ($(SDK)$(CONFIG_PACKAGE_cbtt),) + define Build/without-mysql + $(call Build/Template,cbtt,without-mysql,bnbt,) + endef +endif +$(eval $(Build/without-mysql)) + +ifneq ($(SDK)$(CONFIG_PACKAGE_cbtt-mysql),) + define Build/with-mysql + $(call Build/Template,cbtt-mysql,with-mysql,bnbtmysql, \ + -L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient \ + ) + endef +endif +$(eval $(Build/with-mysql)) + +$(eval $(call BuildPackage,cbtt)) +$(eval $(call BuildPackage,cbtt-mysql)) diff --git a/net/cbtt/patches/100-compile.patch b/net/cbtt/patches/100-compile.patch new file mode 100644 index 0000000..4181d8d --- /dev/null +++ b/net/cbtt/patches/100-compile.patch @@ -0,0 +1,35 @@ +Index: cbtt80-20060727-src/Makefile +=================================================================== +--- cbtt80-20060727-src.orig/Makefile 2007-08-27 23:41:22.000000000 +0200 ++++ cbtt80-20060727-src/Makefile 2007-08-27 23:41:22.000000000 +0200 +@@ -1,6 +1,5 @@ + SHELL = /bin/sh + SYSTEM = $(shell uname) +-C++ = g++ + DFLAGS = + OFLAGS = -O2 -w + LFLAGS = -L. -lz +@@ -42,19 +41,19 @@ + all: $(OBJS) $(OBJS_BNBT) $(OBJS_BNBTMYSQL) $(PROGS) + + ./bnbt: $(OBJS) $(OBJS_BNBT) +- $(C++) -o ./bnbt $(OBJS) $(OBJS_BNBT) $(LFLAGS) ++ $(CXX) -o ./bnbt $(OBJS) $(OBJS_BNBT) $(LFLAGS) + + ./bnbtmysql: $(OBJS) $(OBJS_BNBTMYSQL) +- $(C++) -o ./bnbtmysql $(OBJS) $(OBJS_BNBTMYSQL) $(LFLAGS) -L/usr/lib/mysql -lmysqlclient ++ $(CXX) -o ./bnbtmysql $(OBJS) $(OBJS_BNBTMYSQL) $(LFLAGS) + + clean: + rm -f $(OBJS) $(OBJS_BNBT) $(OBJS_BNBTMYSQL) $(PROGS) + + %.o: %.cpp +- $(C++) -o $@ $(CFLAGS) -c $< ++ $(CXX) -o $@ $(CFLAGS) -c $< + + %.mysql.o: %.cpp +- $(C++) -o $@ $(CFLAGS) -DBNBT_MYSQL -c $< ++ $(CXX) -o $@ $(CFLAGS) -DBNBT_MYSQL -c $< + + ./bnbt: $(OBJS) $(OBJS_BNBT) + diff --git a/net/cdp/Makefile b/net/cdp/Makefile new file mode 100644 index 0000000..676a3b6 --- /dev/null +++ b/net/cdp/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2009 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:=cdp-tools +PKG_VERSION:=20070302 +PKG_RELEASE:=1 + +PKG_SOURCE:=cdp-tools.tar.gz +PKG_SOURCE_URL:=http://gpl.internetconnection.net/files/ +PKG_MD5SUM:=94e3a355a5c82a2a5b14114d1f9b0599 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +PKG_BUILD_DEPENDS:=+libpcap +libnet1 + + +define Package/cdp-tools + SECTION:=net + CATEGORY:=Network + TITLE:=CDP tools (CISCO) + URL:=http://gpl.internetconnection.net + DEPENDS:=+libpcap +endef + +define Package/dhcpcd/description + Tools to work with the Cisco Discovery Protocol (CDP) +endef + +define Build/Compile + CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/include/pcap -I$(STAGING_DIR)/usr/lib/libnet-1.1.x/include" \ + LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/usr/lib/libnet-1.1.x/lib" \ + CFLAGS="$(TARGET_CFLAGS)" \ + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + all +endef + + +define Package/cdp-tools/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/{cdp-send,cdp-listen,cdp-routemgr} $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,cdp-tools)) diff --git a/net/cdp/patches/001-compile_fixes.patch b/net/cdp/patches/001-compile_fixes.patch new file mode 100644 index 0000000..90be6df --- /dev/null +++ b/net/cdp/patches/001-compile_fixes.patch @@ -0,0 +1,13 @@ +--- a/Makefile.orig 2006-10-26 20:58:35.000000000 +0300 ++++ b/Makefile 2009-05-22 18:20:44.000000000 +0300 +@@ -1,7 +1,6 @@ +-CFLAGS += $(shell libnet-config --cflags --defines) +-all: cdp-listen cdp-send ++all: cdp-send cdp-listen + +-cdp-listen: cdp-listen.o -lpcap +-cdp-send: cdp-send.o $(shell libnet-config --libs) ++cdp-listen: cdp-listen.o $(STAGING_DIR)/usr/lib/libpcap.so ++cdp-send: cdp-send.o $(STAGING_DIR)/usr/lib/libnet-1.1.x/lib/libnet.a + + clean:; rm -f cdp-send.o cdp-send cdp-listen.o cdp-listen diff --git a/net/chaosvpn/Makefile b/net/chaosvpn/Makefile new file mode 100644 index 0000000..48e79a8 --- /dev/null +++ b/net/chaosvpn/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2010-2011 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:=chaosvpn +PKG_VERSION:=2.0 +PKG_RELEASE:=3 + +PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz +PKG_SOURCE_URL:=http://github.com/downloads/ryd/chaosvpn/ +PKG_MD5SUM:=4263202d65bf4ab0d1356b149d7c53af + +include $(INCLUDE_DIR)/package.mk + +define Package/chaosvpn + SECTION:=net + CATEGORY:=Network + TITLE:=Config generator for chaos vpn + SUBMENU:=VPN + DEPENDS:=+ip +tinc +kmod-tun +libopenssl + URL:=https://wiki.hamburg.ccc.de/index.php/ChaosVPN::DebianHowto + MAINTAINER:=Christopher J. Pilkington +endef + +define Package/chaosvpn/description + Configure tincd for the chaosvpn network +endef + +MAKE_FLAGS += \ + COPT="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)" + +define Package/chaosvpn/install + $(INSTALL_DIR) $(1)/etc/tinc/chaos/ $(1)/usr/sbin/ $(1)/etc/init.d/ $(1)/etc/hotplug.d/iface/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/chaosvpn $(1)/usr/sbin/ + #$(INSTALL_DATA) $(PKG_BUILD_DIR)/chaosvpn.conf $(1)/etc/tinc/ + sed -e 's/"\/sbin\/ip /"\/usr\/sbin\/ip /' <$(PKG_BUILD_DIR)/chaosvpn.conf >$(1)/etc/tinc/chaosvpn.conf + $(INSTALL_BIN) ./files/chaosvpn_config.sh $(1)/usr/sbin/ + $(INSTALL_BIN) ./files/chaosvpn.init $(1)/etc/init.d/chaosvpn + $(INSTALL_BIN) ./files/chaosvpn.hotplug $(1)/etc/hotplug.d/iface/40-chaosvpn +endef + +$(eval $(call BuildPackage,chaosvpn)) + diff --git a/net/chaosvpn/files/chaosvpn.hotplug b/net/chaosvpn/files/chaosvpn.hotplug new file mode 100644 index 0000000..3044e53 --- /dev/null +++ b/net/chaosvpn/files/chaosvpn.hotplug @@ -0,0 +1,3 @@ +[ "$INTERFACE" == "wan" ] || return +[ "$ACTION" == "ifup" ] && /etc/init.d/chaosvpn restart + diff --git a/net/chaosvpn/files/chaosvpn.init b/net/chaosvpn/files/chaosvpn.init new file mode 100644 index 0000000..d415f5d --- /dev/null +++ b/net/chaosvpn/files/chaosvpn.init @@ -0,0 +1,21 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org + +START=99 + +SERVICE_DAEMONIZE=1 + +start() +{ + /usr/sbin/chaosvpn_config.sh + [ $? = 0 ] || { + logger "not starting chaosvpn, check your config" + exit 1 + } + service_start /usr/sbin/chaosvpn -f -c /etc/tinc/chaosvpn.conf +} + +stop() +{ + service_stop /usr/sbin/chaosvpn +} diff --git a/net/chaosvpn/files/chaosvpn_config.sh b/net/chaosvpn/files/chaosvpn_config.sh new file mode 100644 index 0000000..6b3b273 --- /dev/null +++ b/net/chaosvpn/files/chaosvpn_config.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +[ -f "/etc/tinc/chaos/rsa_key.pub" -a -f "/etc/tinc/chaos/rsa_key.priv" ] || { + echo "please generate rsa key pair" + echo "tincd -n chaos --generate-keys=2048" + exit 1 +} + +C=`grep unconfigured_please_change_me /etc/tinc/chaosvpn.conf | wc -l` +[ "$C" = "0" ] || { + echo "/etc/tinc/chaosvpn.conf is not configured yet" + exit 1 +} +exit 0 diff --git a/net/chaosvpn/patches/001-dist-makefile.patch b/net/chaosvpn/patches/001-dist-makefile.patch new file mode 100644 index 0000000..00b1d88 --- /dev/null +++ b/net/chaosvpn/patches/001-dist-makefile.patch @@ -0,0 +1,30 @@ +--- a/Makefile 2010-07-17 14:20:07.000000000 -0400 ++++ b/Makefile 2010-07-17 18:50:30.000000000 -0400 +@@ -1,10 +1,7 @@ +-CC?=gcc +-INCLUDES?=-I/usr/local/include +-LIBDIRS?=-L/usr/local/lib +-CFLAGS?=-std=c99 -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -Wall -g $(INCLUDES) +-LIB?=-lz -lcrypto +-LEX?=flex +-YACC?=yacc ++CC := gcc ++LIBS := -lssl -lz -lcrypto ++LEX := flex ++YACC := yacc + + PREFIX?=/usr + TINCDIR?=/etc/tinc +@@ -21,10 +18,10 @@ + GITDEBVERSION=$(shell debian/scripts/calcdebversion ) + + $(NAME): main.o $(OBJ) $(HEADERS) +- $(CC) -o $@ main.o $(OBJ) $(LIB) $(LIBDIRS) ++ $(CC) $(COPT) -o $@ main.o $(OBJ) $(LIBS) $(LIB) + + %.o: %.c $(HEADERS) +- $(CC) $(CFLAGS) -o $(patsubst %.c,%.o,$<) -c $< ++ $(CC) $(COPT) -o $(patsubst %.c,%.o,$<) -c $< + + lex.yy.o: lex.yy.c y.tab.h + diff --git a/net/chillispot/Makefile b/net/chillispot/Makefile new file mode 100644 index 0000000..42769b2 --- /dev/null +++ b/net/chillispot/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2006-2012 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:=chillispot +PKG_VERSION:=1.1.0 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.chillispot.info/download +PKG_MD5SUM:=9d2597756af3fa14d7331b4a3651fc9b + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/chillispot + SUBMENU:=Captive Portals + SECTION:=net + CATEGORY:=Network + DEPENDS:=+kmod-tun + TITLE:=Wireless LAN HotSpot controller + URL:=http://www.chillispot.info/ +endef + +define Package/chillispot/description + ChilliSpot is an open source captive portal or wireless LAN + access point controller. It is used for authenticating users + of a wireless LAN. It supports web based login which is today's + standard for public HotSpots and it supports Wireless Protected + Access (WPA) which is the standard of the future. Authentication, + authorization and accounting (AAA) is handled by your favorite + radius server. +endef + +define Package/chillispot/conffiles +/etc/chilli.conf +endef + +# uses GNU configure + +define Package/chillispot/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/chilli + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/chilli.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chilli $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,chillispot)) diff --git a/net/chillispot/files/chillispot.init b/net/chillispot/files/chillispot.init new file mode 100644 index 0000000..3fbba8d --- /dev/null +++ b/net/chillispot/files/chillispot.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2012 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 +SERVICE_PID_FILE=/var/run/chilli.pid + +start() { + . /lib/functions/network.sh + + local ipaddr + network_get_ipaddr ipaddr lan && \ + service_start /usr/sbin/chilli --dns1="$ipaddr" +} + +stop() { + service_stop /usr/sbin/chilli +} diff --git a/net/chillispot/patches/001-endian_fix.patch b/net/chillispot/patches/001-endian_fix.patch new file mode 100644 index 0000000..7bc100e --- /dev/null +++ b/net/chillispot/patches/001-endian_fix.patch @@ -0,0 +1,135 @@ +Index: chillispot-1.1.0/src/dhcp.c +=================================================================== +--- chillispot-1.1.0.orig/src/dhcp.c 2006-09-24 19:48:25.000000000 +0200 ++++ chillispot-1.1.0/src/dhcp.c 2007-09-25 15:35:12.521055038 +0200 +@@ -116,6 +116,24 @@ + #endif + + ++/* ++ * BrainSlayer: ++ * wrapper for fixing the big endian bugs within dhcp server code.its surelly not the best. ++ * all dhcp packet fields must be handled in little endian ++ */ ++ ++static uint16_t swap16(uint16_t word) { ++#if __BYTE_ORDER == __BIG_ENDIAN ++ unsigned char low = word>>8; ++ unsigned char high = word&0xff; ++ return ((uint16_t)(high<<8))|low; ++#elif __BYTE_ORDER == __LITTLE_ENDIAN ++ return word; ++#else ++#error "Could not determine the system's endianness" ++#endif ++} ++ + /** + * dhcp_ip_check() + * Generates an IPv4 header checksum. +@@ -125,11 +143,11 @@ + uint32_t sum = 0; + pack->iph.check = 0; + for (i=0; i<(pack->iph.ihl * 2); i++) { +- sum += ((uint16_t*) &pack->iph)[i]; ++ sum += swap16(((uint16_t*) &pack->iph)[i]); /* brainslayer */ + } + while (sum>>16) + sum = (sum & 0xFFFF)+(sum >> 16); +- pack->iph.check = ~sum; ++ pack->iph.check = swap16(~sum); /* brainslayer */ + return 0; + } + +@@ -152,27 +170,28 @@ + } + + /* Sum UDP header and payload */ ++ + for (i=0; i<(udp_len/2); i++) { +- sum += ((uint16_t*) &pack->udph)[i]; ++ sum += swap16(((uint16_t*) &pack->udph)[i]); /* brainslayer */ + } + +- /* Sum any uneven payload octet */ ++ + if (udp_len & 0x01) { + sum += ((uint8_t*) &pack->udph)[udp_len-1]; + } + + /* Sum both source and destination address */ + for (i=0; i<4; i++) { +- sum += ((uint16_t*) &pack->iph.saddr)[i]; ++ sum += swap16(((uint16_t*) &pack->iph.saddr)[i]); /* brainslayer */ + } + + /* Sum both protocol and udp_len (again) */ +- sum = sum + pack->udph.len + ((pack->iph.protocol<<8)&0xFF00); ++ sum = sum + swap16(pack->udph.len) + ((pack->iph.protocol<<8)&0xFF00); /* brainslayer */ + + while (sum>>16) + sum = (sum & 0xFFFF)+(sum >> 16); + +- pack->udph.check = ~sum; ++ pack->udph.check = swap16(~sum); /* brainslayer */ + + return 0; + } +@@ -201,7 +220,7 @@ + + /* Sum TCP header and payload */ + for (i=0; i<(tcp_len/2); i++) { +- sum += ((uint16_t*) pack->payload)[i]; ++ sum += swap16(((uint16_t*) pack->payload)[i]); /* brainslayer */ + } + + /* Sum any uneven payload octet */ +@@ -211,16 +230,16 @@ + + /* Sum both source and destination address */ + for (i=0; i<4; i++) { +- sum += ((uint16_t*) &pack->iph.saddr)[i]; ++ sum += swap16(((uint16_t*) &pack->iph.saddr)[i]); /* brainslayer */ + } + + /* Sum both protocol and tcp_len */ +- sum = sum + htons(tcp_len) + ((pack->iph.protocol<<8)&0xFF00); ++ sum = sum + swap16(htons(tcp_len)) + ((pack->iph.protocol<<8)&0xFF00); /* brainslayer */ + + while (sum>>16) + sum = (sum & 0xFFFF)+(sum >> 16); + +- tcph->check = ~sum; ++ tcph->check = swap16(~sum); /* brainslayer */ + + return 0; + } +Index: chillispot-1.1.0/src/dhcp.h +=================================================================== +--- chillispot-1.1.0.orig/src/dhcp.h 2006-09-24 19:48:25.000000000 +0200 ++++ chillispot-1.1.0/src/dhcp.h 2007-09-25 15:35:12.533055724 +0200 +@@ -119,6 +119,8 @@ + uint16_t prot; + }; + ++#include ++ + /* Constants for IP packet */ + #define DHCP_IP_ALEN 4 + #define DHCP_IP_HLEN 20 +@@ -127,8 +129,15 @@ + #define DHCP_IP_UDP 17 /* UDP Protocol number */ + + struct dhcp_iphdr_t { ++#if __BYTE_ORDER == __LITTLE_ENDIAN /* nbd fix for swapped version and length field */ + uint8_t ihl:4; + uint8_t version:4; ++#elif __BYTE_ORDER == __BIG_ENDIAN ++ uint8_t version:4; ++ uint8_t ihl:4; ++#else ++#error "Could not determine the system's endianness" ++#endif + uint8_t tos; + uint16_t tot_len; + uint16_t id; diff --git a/net/chillispot/patches/102-less_memory-footprint.patch b/net/chillispot/patches/102-less_memory-footprint.patch new file mode 100644 index 0000000..b0a6c9c --- /dev/null +++ b/net/chillispot/patches/102-less_memory-footprint.patch @@ -0,0 +1,12 @@ +diff -baurN --exclude='*~' --exclude='.#*' --exclude='.svn*' --exclude='.conf*' --exclude=dl --exclude=bin --exclude=build_mipsel --exclude=staging_dir_mipsel --exclude=toolchain_build_mipsel --exclude=package/config --exclude=autom4te.cache --exclude='*.tgz' --exclude='*.zip' --exclude='*.tar' --exclude='*.gz' --exclude='.tmp*' chillispot-1.1.0.orig/src/chilli.h chillispot-1.1.0/src/chilli.h +--- chillispot-1.1.0.orig/src/chilli.h 2006-10-19 00:01:55.000000000 +0100 ++++ chillispot-1.1.0/src/chilli.h 2006-12-19 00:02:16.000000000 +0100 +@@ -53,7 +53,7 @@ + /* #define COUNT_DOWNLINK_DROP 1 */ + /* #define COUNT_UPLINK_DROP 1 */ + +-#define APP_NUM_CONN 1024 ++#define APP_NUM_CONN 128 + #define EAP_LEN 2048 /* TODO: Rather large */ + + #define MACOK_MAX 16 diff --git a/net/chillispot/patches/110-macallowed_fix.patch b/net/chillispot/patches/110-macallowed_fix.patch new file mode 100644 index 0000000..8567fc8 --- /dev/null +++ b/net/chillispot/patches/110-macallowed_fix.patch @@ -0,0 +1,21 @@ +diff -r -u chillispot-1.1.0/src/chilli.c chillispot-1.1.0-macallowed/src/chilli.c +--- chillispot-1.1.0/src/chilli.c 2006-09-24 19:48:25.000000000 +0200 ++++ chillispot-1.1.0-macallowed/src/chilli.c 2008-07-18 07:58:03.000000000 +0200 +@@ -534,6 +534,8 @@ + } + } + free(p3); ++ ++ return 0; + } + + int static process_options(int argc, char **argv, int firsttime) { +@@ -2991,7 +2993,7 @@ + + /* Get Service Type */ + if (!radius_getattr(pack, &stateattr, RADIUS_ATTR_SERVICE_TYPE, 0, 0, 0)) { +- if(ntohl(attr->v.i) == RADIUS_SERVICE_TYPE_CHILLISPOT_AUTHORIZE_ONLY) { ++ if(ntohl(stateattr->v.i) == RADIUS_SERVICE_TYPE_CHILLISPOT_AUTHORIZE_ONLY) { + sys_err(LOG_ERR, __FILE__, __LINE__, 0, + "Chillispot-Authorize-Only Service-Type in Access-Accept"); + return dnprot_reject(appconn); diff --git a/net/chillispot/patches/120-fix_bufferoverflow.patch b/net/chillispot/patches/120-fix_bufferoverflow.patch new file mode 100644 index 0000000..abc293b --- /dev/null +++ b/net/chillispot/patches/120-fix_bufferoverflow.patch @@ -0,0 +1,11 @@ +--- a/src/radius.c ++++ b/src/radius.c +@@ -1002,7 +1002,7 @@ int radius_pwencode(struct radius_t *thi + } + + /* Copy first 128 octets of src into dst */ +- if (srclen <= 128) ++ if (srclen > 128) + memcpy(dst, src, 128); + else + memcpy(dst, src, srclen); diff --git a/net/chillispot/patches/150-chillispot-rmtctrl.patch b/net/chillispot/patches/150-chillispot-rmtctrl.patch new file mode 100644 index 0000000..db5df95 --- /dev/null +++ b/net/chillispot/patches/150-chillispot-rmtctrl.patch @@ -0,0 +1,1529 @@ +--- a/src/chilli.c ++++ b/src/chilli.c +@@ -102,6 +102,7 @@ + #include "dhcp.h" + #include "cmdline.h" + #include "chilli.h" ++#include "remotectrl.h" + + struct options_t options; + +@@ -127,6 +128,12 @@ static int do_sighup = 0; + /* Forward declarations */ + int static acct_req(struct app_conn_t *conn, int status_type); + int static config_radius(); ++void admin_disconnect(struct app_conn_t *appconn, int terminateCause); ++void admin_authorize(struct app_conn_t *appconn); ++int send_acct_head( struct rmt_socket_t *client, struct app_conn_t *appconn); ++int send_Connection( struct rmt_socket_t *client, struct app_conn_t *appconn ); ++int send_Acct_Setting ( struct rmt_socket_t *client, struct app_conn_t *appconn ); ++int send_Accounting( struct rmt_socket_t *client, struct app_conn_t *appconn ); + + /* Fireman catches falling childs and eliminates zombies */ + void static fireman(int signum) { +@@ -180,19 +187,18 @@ int static leaky_bucket(struct app_conn_ + struct timeval timenow; + uint64_t timediff; /* In microseconds */ + int result = 0; +- + + gettimeofday(&timenow, NULL); + + timediff = (timenow.tv_sec - conn->last_time.tv_sec) * ((uint64_t) 1000000); + timediff += (timenow.tv_usec - conn->last_time.tv_usec); + +- /* if (options.debug) printf("Leaky bucket timediff: %lld, bucketup: %d, bucketdown: %d %d %d\n", +- timediff, conn->bucketup, conn->bucketdown, +- octetsup, octetsdown);*/ +- +- if (conn->bandwidthmaxup) { ++/* if (options.debug) ++ printf("Leaky bucket timediff: %lld, bucketup: %d, bucketdown: %d %d %d\n", ++ timediff, conn->bucketup, conn->bucketdown, octetsup, octetsdown); ++*/ + ++ if (conn->bandwidthmaxup) { + /* Subtract what the leak since last time we visited */ + if (conn->bucketup > ((timediff * conn->bandwidthmaxup)/8000000)) { + conn->bucketup -= (timediff * conn->bandwidthmaxup) / 8000000; +@@ -200,9 +206,9 @@ int static leaky_bucket(struct app_conn_ + else { + conn->bucketup = 0; + } +- ++// printf("octetsup: %d -> conn->bucketup+octetsup: %d > conn->bucketupsize: %d \n", octetsup, conn->bucketup + octetsup, conn->bucketupsize); + if ((conn->bucketup + octetsup) > conn->bucketupsize) { +- /*if (options.debug) printf("Leaky bucket deleting uplink packet\n");*/ ++ if (options.debug) printf("Leaky bucket deleting uplink packet\n"); + result = -1; + } + else { +@@ -217,9 +223,10 @@ int static leaky_bucket(struct app_conn_ + else { + conn->bucketdown = 0; + } ++// printf("octetsdown: %d -> conn->bucketdown+octetsdown: %d > conn->bucketdownsize: %d \n", octetsdown, conn->bucketdown + octetsdown, conn->bucketdownsize); + + if ((conn->bucketdown + octetsdown) > conn->bucketdownsize) { +- /*if (options.debug) printf("Leaky bucket deleting downlink packet\n");*/ ++ if (options.debug) printf("Leaky bucket deleting downlink packet\n"); + result = -1; + } + else { +@@ -233,6 +240,7 @@ int static leaky_bucket(struct app_conn_ + } + #endif /* ifndef NO_LEAKY_BUCKET */ + ++ + /* Run external script */ + + int set_env(char *name, char *value, int len, struct in_addr *addr, +@@ -550,7 +558,7 @@ int static process_options(int argc, cha + return -1; + } + +- if (cmdline_parser_configfile (args_info.conf_arg, &args_info, 0, 0, 0)) { ++ if (cmdline_parser_configfile (args_info.conf_arg, &args_info, 0, 0, 0)) { + sys_err(LOG_ERR, __FILE__, __LINE__, 0, + "Failed to parse configuration file: %s!", + args_info.conf_arg); +@@ -1056,7 +1064,21 @@ int static process_options(int argc, cha + strlen(args_info.macallowed_arg[numargs]))) + return -1; + } +- ++ /* remote monitor */ ++ /* Defaults to net plus 1 */ ++ if (!args_info.rmtlisten_arg) ++ options.rmtlisten.s_addr = options.uamlisten.s_addr; ++ else ++ if (!inet_aton(args_info.rmtlisten_arg, &options.rmtlisten)){ ++ sys_err(LOG_ERR, __FILE__, __LINE__, 0, ++ "Invalid Remote monitor IP address: %s!", args_info.rmtlisten_arg); ++ return -1; ++ } ++ /* rmtport */ ++ options.rmtport = args_info.rmtport_arg; ++ options.rmtpasswd = args_info.rmtpasswd_arg; ++ options.bandwidthmaxup = args_info.bandwidthmaxup_arg; ++ options.bandwidthmaxdown = args_info.bandwidthmaxdown_arg; + + /* foreground */ + /* If flag not given run as a daemon */ +@@ -1095,7 +1117,6 @@ void static reprocess_options(int argc, + memcpy(&options, &options2, sizeof(options)); + return; + } +- + /* Options which we do not allow to be affected */ + /* fg, conf and statedir are not stored in options */ + options.net = options2.net; /* net */ +@@ -1123,6 +1144,13 @@ void static reprocess_options(int argc, + options.eapolenable = options2.eapolenable; /* eapolenable */ + options.pidfile = options2.pidfile; /* pidfile */ + ++ options.rmtlisten = options2.rmtlisten; /* remote listen */ ++ options.rmtport = options2.rmtport; /* remote port */ ++ options.rmtpasswd = options2.rmtpasswd; /* remote password */ ++ ++// options.bandwidthmaxup = options2.bandwidthmaxup; /* remote password */ ++// options.bandwidthmaxdown = options2.bandwidthmaxdown; /* remote password */ ++ + /* Reinit DHCP parameters */ + (void) dhcp_set(dhcp, (options.debug & DEBUG_DHCP), + options.uamserver, options.uamserverlen, options.uamanydns, +@@ -3099,9 +3127,8 @@ int cb_radius_auth_conf(struct radius_t + appconn->bucketupsize = BUCKET_SIZE_MIN; + #endif + } +- else { ++ else + appconn->bandwidthmaxup = 0; +- } + + /* Bandwidth down */ + if (!radius_getattr(pack, &attr, RADIUS_ATTR_VENDOR_SPECIFIC, +@@ -3116,9 +3143,8 @@ int cb_radius_auth_conf(struct radius_t + appconn->bucketdownsize = BUCKET_SIZE_MIN; + #endif + } +- else { ++ else + appconn->bandwidthmaxdown = 0; +- } + + #ifdef RADIUS_ATTR_CHILLISPOT_BANDWIDTH_MAX_UP + /* Bandwidth up */ +@@ -3623,7 +3649,7 @@ int cb_dhcp_data_ind(struct dhcp_conn_t + appconn->input_octets +=len; + #ifndef NO_LEAKY_BUCKET + #ifdef COUNT_UPLINK_DROP +- if (leaky_bucket(appconn, len, 0)) return 0; ++ if (leaky_bucket(appconn, len, 0)==-1) return 0; + #endif /* ifdef COUNT_UPLINK_DROP */ + #endif /* ifndef NO_LEAKY_BUCKET */ + } +@@ -3889,6 +3915,10 @@ int main(int argc, char **argv) + struct sigaction act; + struct itimerval itval; + ++ struct rmt_socket_t srv; ++ struct rmt_socket_t client[MAX_CLIENTS]; ++ int activeClients = 0; /* Número clientes conectados */ ++ + /* open a connection to the syslog daemon */ + /*openlog(PACKAGE, LOG_PID, LOG_DAEMON);*/ + openlog(PACKAGE, (LOG_PID | LOG_PERROR), LOG_DAEMON); +@@ -4046,6 +4076,8 @@ int main(int argc, char **argv) + if (options.debug) + printf("Waiting for client request...\n"); + ++ ++ srv = rmtctrl_initSrv(options.rmtlisten, options.rmtport); + + /******************************************************************/ + /* Main select loop */ +@@ -4053,6 +4085,8 @@ int main(int argc, char **argv) + + while (keep_going) { + ++ rmtctrl_srv(srv,client,&activeClients); ++ + if (do_timeouts) { + /*if (options.debug) printf("Do timeouts!\n");*/ + (void) radius_timeout(radius); +@@ -4178,3 +4212,487 @@ int main(int argc, char **argv) + return 0; + + } ++ ++void rmtctrl_msg_proccess(struct rmt_socket_t *client) ++{ ++ msg_head_t header; ++ char *msg=NULL; ++ char *reg=NULL; ++ struct app_conn_t *appconn; ++ struct dhcp_conn_t *dhcpconn; ++ char str[2048]; ++ int found=0; ++ int rslt=0; ++ int n; ++ uint64_t l; ++ rslt = rmtctrl_read_msg(client,&header,&msg); ++ if (rslt > 0) ++ { ++ switch (header.id) ++ { ++ case QRY_CONNECTED_LIST: ++ rslt += send_srvData(client); ++ rslt += rmtctrl_write_msg(client,MSG_START,0, "\n" ); ++ rslt += rmtctrl_write_msg(client,MSG_PART,0, "Ord ---------- User Name ----------- -- MAC Address -- -- IP Address - -- Input - - Output - Sta\n" ); ++ for (n=0; ninuse != 0)){ ++ dhcpconn = (struct dhcp_conn_t*) appconn->dnlink; ++ found++; ++ l = found; ++ rslt += send_number(client, MSG_PART, 0, "%3s ", l); ++ rslt += send_line(client,MSG_PART,0, "%-32s ",appconn->proxyuser); ++ rslt += send_mac(client,MSG_PART,0, "%17s ",appconn->hismac); ++ rslt += send_line(client,MSG_PART,0, "%15s ",inet_ntoa(appconn->hisip)); ++ rslt += send_number(client,MSG_PART,0, "%10s ",appconn->input_octets); ++ rslt += send_number(client,MSG_PART,0, "%10s ",appconn->output_octets); ++ rslt += send_number(client, MSG_PART, 0, " %s ",appconn->authenticated); ++ rslt += send_number(client, MSG_PART, 0, " %s \n",dhcpconn->authstate); ++ } ++ } ++ rslt += send_number(client,MSG_END,found, "Total of connected device(s) %s\n",found); ++ break; ++ case QRY_CONNECTED_FULL_LIST: ++ rslt += send_srvData(client); ++ rslt += rmtctrl_write_msg(client,MSG_START,0, "\n" ); ++ for (n=0; ninuse != 0)){ ++ found++; ++ l = found; ++ rslt += send_number(client, MSG_PART, 0, "Connection : %s\n{\n", l); ++ rslt += send_acct_head( client, appconn); ++ rslt += send_line(client, MSG_PART, 0, "%s\n", "}"); ++ } ++ } ++ rslt += send_number(client, MSG_END, found, "Total of connected device(s) %s\n",found); ++ break; ++ case QRY_STATUS: ++ /// ++ rslt += send_Status(client, appconn); ++ break; ++ case CMD_AUTHORIZE: ++ for (n=0; ninuse != 0) && (appconn->authenticated == 0)) ++ { ++ switch (header.extra) ++ { ++ case EXTRA_MAC_OP: ++ if ( strcmp(msg,mac2str(appconn->hismac)) == 0) ++ { ++ found++; ++ l=1; ++ break; ++ } ++ break; ++ case EXTRA_IP_OP: ++ if ( strcmp(msg,inet_ntoa(appconn->hisip)) == 0) ++ { ++ found++; ++ l=1; ++ break; ++ } ++ break; ++ case EXTRA_USER_OP: ++ if ( strcmp(msg,appconn->proxyuser) == 0) ++ { ++ found++; ++ l=1; ++ break; ++ } ++ break; ++ default: ++ found++; ++ l=1; ++ break; ++ } ++ if ( l == 1 ){ ++ admin_authorize(appconn); ++ rslt += send_srvData( client ); ++ rslt += rmtctrl_write_msg(client,MSG_PART,0, " \n" ); ++ rslt += send_acct_head( client, appconn); ++ sys_err(LOG_NOTICE, __FILE__, __LINE__, 0, ++ "Admin Authorize MAC=%s IP=%s", ++ mac2str(appconn->hismac), inet_ntoa(appconn->hisip)); ++ } ++ } ++ } ++ if (found == 0) ++ rslt += rmtctrl_write_msg(client,MSG_END,0, "Not device found to Authorze\n" ); ++ else ++ { ++ rslt += send_number(client, MSG_END, found, "Autorized %s device(s)\n",found); ++ } ++ break; ++ case CMD_DISCONNECT: ++ for (n=0; ninuse != 0) && (appconn->authenticated == 1)) ++ { ++ if (dhcpconn = (struct dhcp_conn_t*) appconn->dnlink) { ++ switch (header.extra) ++ { ++ case EXTRA_MAC_OP: ++ if ( strcmp(msg,mac2str(appconn->hismac)) == 0) ++ { ++ found++; ++ l=1; ++ break; ++ } ++ break; ++ case EXTRA_IP_OP: ++ if ( strcmp(msg,inet_ntoa(appconn->hisip)) == 0) ++ { ++ found++; ++ l=1; ++ break; ++ } ++ break; ++ case EXTRA_USER_OP: ++ if ( strcmp(msg,appconn->proxyuser) == 0) ++ { ++ found++; ++ l=1; ++ break; ++ } ++ break; ++ default: ++ found++; ++ l=1; ++ break; ++ } ++ if ( l == 1 ) { ++ rslt += send_srvData( client ); ++ rslt += rmtctrl_write_msg(client,MSG_PART,0, " \n" ); ++ rslt += send_acct_head( client, appconn); ++ admin_disconnect(appconn, RADIUS_TERMINATE_CAUSE_ADMIN_RESET); ++ sys_err(LOG_NOTICE, __FILE__, __LINE__, 0, ++ "Admin Disconnect username=%s IP=%s", ++ appconn->user, inet_ntoa(appconn->hisip)); ++ } ++ } ++ } ++ } ++ if (found == 0) ++ rslt += rmtctrl_write_msg(client,MSG_END,0, "Not decice found to Disconnect\n" ); ++ else ++ { ++ rslt += send_number(client, MSG_END, found, "Disconnect %s device(s)\n",found); ++ } ++ break; ++ default: ++ rslt += rmtctrl_write_msg(client,MSG_END,0, "Unknow command.\n" ); ++ break; ++ } ++ } ++ else ++ { ++ printf("Desde %s se recibieron %d bytes y se enviaron %d bytes\n",inet_ntoa(client->addr.sin_addr),client->Rx,client->Tx); ++ close(client->fd); /* cierra fd_rmt_client */ ++ printf("Client cerro conexión desde %s\n",inet_ntoa(client->addr.sin_addr) ); ++ client->fd = -1; ++ } ++ if(msg) ++ free(msg); ++} ++ ++void admin_authorize(struct app_conn_t *appconn) ++{ ++ struct radius_packet_t radius_pack; ++ strcpy(appconn->user,"Admin-Authorize"); ++ strcpy(appconn->proxyuser,"Admin-Authorize"); ++ appconn->proxyuserlen = strlen(appconn->proxyuser); ++ appconn->interim_interval = 600; ++ appconn->terminate_cause = 0; ++ appconn->idletimeout = 300; ++ ++ radius_default_pack(radius, &radius_pack, RADIUS_CODE_ACCESS_REQUEST); ++ radius_pack.code = RADIUS_CODE_ACCESS_REQUEST; ++// (void) radius_addattr(radius, &radius_pack, RADIUS_ATTR_USER_NAME, 0, 0, 0, ++// (uint8_t*) appconn->proxyuser, appconn->proxyuserlen); ++ ++ if ( options.bandwidthmaxup > 0 ){ ++ appconn->bandwidthmaxup = options.bandwidthmaxup * 1024; ++ appconn->bucketupsize = BUCKET_TIME * appconn->bandwidthmaxup / 8000; ++ if (appconn->bucketupsize < BUCKET_SIZE_MIN) ++ appconn->bucketupsize = BUCKET_SIZE_MIN; ++ } ++ if ( options.bandwidthmaxdown > 0 ){ ++ appconn->bandwidthmaxdown = options.bandwidthmaxdown * 1024; ++ appconn->bucketdownsize = BUCKET_TIME * appconn->bandwidthmaxdown / 8000; ++ if (appconn->bucketdownsize < BUCKET_SIZE_MIN) ++ appconn->bucketdownsize = BUCKET_SIZE_MIN; ++ } ++ dnprot_accept(appconn); ++} ++ ++void admin_disconnect(struct app_conn_t *appconn, int terminateCause) ++{ ++ dnprot_terminate(appconn); ++ (void) acct_req(appconn, RADIUS_STATUS_TYPE_STOP); ++ set_sessionid(appconn); ++} ++ ++int send_acct_head( struct rmt_socket_t *client, struct app_conn_t *appconn) ++{ ++ int rslt; ++ rslt += send_Connection( client, appconn ); ++ rslt += send_Acct_Setting( client, appconn ); ++ rslt += send_Accounting( client, appconn ); ++ return rslt; ++} ++ ++int send_Connection( struct rmt_socket_t *client, struct app_conn_t *appconn ) ++{ ++ int rslt; ++ uint64_t l; ++ rslt += send_line(client, MSG_PART, 0, "\tSession-Id = %s\n",appconn->sessionid); ++ rslt += send_line(client, MSG_PART, 0, "\tUser-Name = %s\n",appconn->user); ++// rslt = send_line(client, MSG_PART, 0, "\tnasip=%s\n",appconn->nasip); ++ rslt += send_mac(client, MSG_PART, 0, "\tClient-Mac-Address = %s\n",appconn->hismac); ++ rslt += send_mac(client, MSG_PART, 0, "\tNas-Mac-Address = %s\n",appconn->ourmac); ++// rslt += send_line(client, MSG_PART, 0, "\tourip=%s\n",inet_ntoa(appconn->ourip)); ++ rslt += send_line(client, MSG_PART, 0, "\tClient-Ip = %s\n",inet_ntoa(appconn->hisip)); ++ rslt += send_line(client, MSG_PART, 0, "\tClient-Require-Ip = %s\n",inet_ntoa(appconn->reqip)); ++ rslt += send_number(client, MSG_PART, 0, "\tAutheticated = %s\n",appconn->authenticated); ++ l = appconn->uamtime; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tUAM-Time = %s\n",l); ++ if (strlen(appconn->userurl)>0) ++ rslt = send_line(client, MSG_PART, 0, "\tUser-URL = %s\n",appconn->userurl); ++ return rslt; ++} ++ ++int send_Acct_Setting ( struct rmt_socket_t *client, struct app_conn_t *appconn ) ++{ ++ int rslt = 0; ++ uint64_t l; ++ if (appconn->authenticated == 0 ) return 0; ++ /* Account Settings */ ++ l = appconn->sessionterminatetime; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tSession-Terminate-Time = %s\n",l); ++ l = appconn->sessiontimeout; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tSession-Timeout = %s\n",l); ++ l = appconn->idletimeout; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tIdle-Timeout = %s\n",l); ++ l = appconn->bandwidthmaxup; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tBandwidth-Max-Up = %s\n",l); ++ l = appconn->bandwidthmaxdown; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tBandwidth-Max-Down = %s\n",l); ++ l = appconn->maxinputoctets; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tMax-Input-Octets = %s\n",l); ++ l = appconn->maxoutputoctets; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tMax-Output-Octets = %s\n",l); ++ l = appconn->maxtotaloctets; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tMax-Total-Octets = %s\n",l); ++ return rslt; ++} ++ ++int send_Accounting( struct rmt_socket_t *client, struct app_conn_t *appconn ) ++{ ++ if (appconn->authenticated == 0 ) return 0; ++ int rslt = 0; ++ uint64_t l; ++ l = appconn->start_time.tv_sec; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tStart-Time = %s\n",l); ++ l = appconn->interim_time.tv_sec; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tInterim-Time = %s\n",l); ++ l = appconn->interim_interval; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tInterim-Interval = %s\n",l); ++ l = appconn->last_time.tv_sec; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tLast-Time = %s\n",l); ++ l = appconn->input_packets; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tInput-Packets = %s\n",l); ++ l = appconn->output_packets; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tOutput-Packets = %s\n",l); ++ l = appconn->input_octets; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tInput-Octets = %s\n",l); ++ l = appconn->output_octets; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tOutput-Octets = %s\n",l); ++ l = appconn->terminate_cause; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tTerminate-Cause = %s\n",l); ++ l = appconn->bucketup; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tBucket-Up = %s\n",l); ++ l = appconn->bucketdown; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tBucket-Down = %s\n",l); ++ l = appconn->bucketupsize; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tBucket-Up-Size = %s\n",l); ++ l = appconn->bucketdownsize; ++ if (l > 0) ++ rslt += send_number(client, MSG_PART, 0, "\tBucket-Down-Size = %s\n",l); ++ return rslt; ++} ++ ++int send_srvData( struct rmt_socket_t *client) ++{ ++ int rslt=0; ++ rslt += send_line(client, MSG_PART, 0, "%s\n",options.radiusnasid); ++ if (options.radiuslocationid) ++ rslt += send_line(client, MSG_PART, 0, "\tLOCATION ID:%s\n",options.radiuslocationid); ++ if (options.radiuslocationname) ++ rslt += send_line(client, MSG_PART, 0, "\tLOCATION NAME:%s\n",options.radiuslocationname); ++// rslt += send_line(client, MSG_PART, 0, "\tDEVICE: %s ",tun->devname); ++// rslt += send_line(client, MSG_PART, 0, "INTERFACE: %s\n",options.dhcpif); ++// rslt += send_line(client, MSG_PART, 0, "\tIP ADDR: %s ",inet_ntoa(options.dhcplisten)); ++// rslt += send_line(client, MSG_PART, 0, "NETWORK: %s ",inet_ntoa(options.net)); ++// rslt += send_line(client, MSG_PART, 0, "MASK: %s\n",inet_ntoa(options.mask)); ++ if (options.dns1.s_addr) ++ rslt += send_line(client, MSG_PART, 0, "\tDNS SERVERS: %s - ",inet_ntoa(options.dns1)); ++ if (options.dns2.s_addr) ++ rslt += send_line(client, MSG_PART, 0, "%s\n",inet_ntoa(options.dns2)); ++ rslt += send_line(client, MSG_PART, 0, "\tRADIUS SERVERS: %s - ",inet_ntoa(options.radiusserver1)); ++ rslt += send_line(client, MSG_PART, 0, "%s\n",inet_ntoa(options.radiusserver2)); ++ return rslt; ++} ++ ++int send_Status( struct rmt_socket_t *client, struct app_conn_t *appconn ) ++{ ++ int rslt = 0; ++ int n; ++ uint64_t l; ++ l = options.debug; ++ rslt += send_number(client, MSG_PART, 0, "\tdebug=%s\n",l); ++ /* conf */ ++ l = options.interval; ++ rslt += send_number(client, MSG_PART, 0, "\tinterval=%s\n",l); ++ rslt += send_line(client, MSG_PART, 0, "\tpidfile=%s\n",options.pidfile); ++ /* TUN parameters */ ++ rslt += send_line(client, MSG_PART, 0, "\tnet=%s\n",inet_ntoa(options.net)); /* Network IP address */ ++ rslt += send_line(client, MSG_PART, 0, "\tmask=%s\n",inet_ntoa(options.mask)); /* Network mask */ ++ rslt += send_line(client, MSG_PART, 0, "\tnetc=%s\n",options.netc); ++ rslt += send_line(client, MSG_PART, 0, "\tmaskc=%s\n",options.maskc); ++ l = options.allowdyn; ++ rslt += send_number(client, MSG_PART, 0, "\tallowdyn=%s\n",l); /* Allow dynamic address allocation */ ++ rslt += send_line(client, MSG_PART, 0, "\tdynip=%s\n",options.dynip); /* Dynamic IP address pool */ ++ ++ l = options.allowstat; ++ rslt += send_number(client, MSG_PART, 0, "\tallowstat=%s\n",l); /* Allow static address allocation */ ++ rslt += send_line(client, MSG_PART, 0, "\tstatip=%s\n",options.statip); /* Static IP address pool */ ++ ++ rslt += send_line(client, MSG_PART, 0, "\tdns1=%s\n",inet_ntoa(options.dns1)); /* Primary DNS server IP address */ ++ rslt += send_line(client, MSG_PART, 0, "\tdns2=%s\n",inet_ntoa(options.dns2)); /* Secondary DNS server IP address */ ++ rslt += send_line(client, MSG_PART, 0, "\tdomain=%s\n",options.domain); /* Domain to use for DNS lookups */ ++ rslt += send_line(client, MSG_PART, 0, "\tipup=%s\n",options.ipup); /* Script to run after link-up */ ++ rslt += send_line(client, MSG_PART, 0, "\tipdown=%s\n",options.ipdown); /* Script to run after link-down */ ++ rslt += send_line(client, MSG_PART, 0, "\tconup=%s\n",options.conup); /* Script to run after user logon */ ++ rslt += send_line(client, MSG_PART, 0, "\tcondown=%s\n",options.condown); /* Script to run after user logoff */ ++ /* Radius parameters */ ++ rslt += send_line(client, MSG_PART, 0, "\tradiuslisten=%s\n",inet_ntoa(options.radiuslisten)); /* IP address to listen to */ ++ rslt += send_line(client, MSG_PART, 0, "\tradiusserver1=%s\n",inet_ntoa(options.radiusserver1)); /* IP address of radius server 1 */ ++ rslt += send_line(client, MSG_PART, 0, "\tradiusserver2=%s\n",inet_ntoa(options.radiusserver2)); /* IP address of radius server 2 */ ++ l = options.radiusauthport; ++ rslt += send_number(client, MSG_PART, 0, "\tradiusauthport=%s\n",l); /* Authentication UDP port */ ++ l = options.radiusacctport; ++ rslt += send_number(client, MSG_PART, 0, "\tradiusacctport=%s\n",l); /* Accounting UDP port */ ++ rslt += send_line(client, MSG_PART, 0, "\tradiussecret=%s\n",options.radiussecret); /* Radius shared secret */ ++ rslt += send_line(client, MSG_PART, 0, "\tradiusnasid=%s\n",options.radiusnasid); /* Radius NAS-Identifier */ ++ rslt += send_line(client, MSG_PART, 0, "\tradiuscalled=%s\n",options.radiuscalled); /* Radius Called-Station-ID */ ++ rslt += send_line(client, MSG_PART, 0, "\tradiusnasip=%s\n",inet_ntoa(options.radiusnasip)); /* Radius NAS-IP-Address */ ++ rslt += send_line(client, MSG_PART, 0, "\tradiuslocationid=%s\n",options.radiuslocationid); /* WISPr location ID */ ++ rslt += send_line(client, MSG_PART, 0, "\tradiuslocationname=%s\n",options.radiuslocationname); /* WISPr location name */ ++ l = options.radiusnasporttype; ++ rslt += send_number(client, MSG_PART, 0, "\tradiusnasporttype=%s\n",l); /* NAS-Port-Type */ ++ l = options.coaport; ++ rslt += send_number(client, MSG_PART, 0, "\tcoaport=%s\n",l); /* UDP port to listen to */ ++ l = options.coanoipcheck; ++ rslt += send_number(client, MSG_PART, 0, "\tcoaipcheck=%s\n",l); /* Allow disconnect from any IP */ ++ /* Radius proxy parameters */ ++ rslt += send_line(client, MSG_PART, 0, "\tproxylisten=%s\n",inet_ntoa(options.proxylisten)); /* IP address to listen to */ ++ l = options.proxyport; ++ rslt += send_number(client, MSG_PART, 0, "\tproxyport=%s\n",l); /* UDP port to listen to */ ++ rslt += send_line(client, MSG_PART, 0, "\tproxyaddr=%s\n",inet_ntoa(options.proxyaddr)); /* IP address of proxy client(s) */ ++ rslt += send_line(client, MSG_PART, 0, "\tproxymask=%s\n",inet_ntoa(options.proxymask)); /* IP mask of proxy client(s) */ ++ rslt += send_line(client, MSG_PART, 0, "\tproxysecret=%s\n",options.proxysecret); /* Proxy shared secret */ ++ /* Radius configuration management parameters */ ++ rslt += send_line(client, MSG_PART, 0, "\tconfusername=%s\n",options.confusername); /* Username for remote config */ ++ rslt += send_line(client, MSG_PART, 0, "\tconfpassword=%s\n",options.confpassword); /* Password for remote config */ ++ /* DHCP parameters */ ++ l = options.nodhcp; ++ rslt += send_number(client, MSG_PART, 0, "\tnodhcp=%s\n",l); /* Do not use DHCP */ ++ rslt += send_line(client, MSG_PART, 0, "\tdhcpif=%s\n",options.dhcpif); /* Interface: eth0 */ ++ rslt += send_mac(client, MSG_PART, 0, "\tdhcpmac=%s\n",options.dhcpmac); /* Interface MAC address */ ++ l = options.dhcpusemac; ++ rslt += send_number(client, MSG_PART, 0, "\tdhcpusemac=%s\n",l); /* Use given MAC or interface default */ ++ rslt += send_line(client, MSG_PART, 0, "\tdhcplisten=%s\n",inet_ntoa(options.dhcplisten)); /* IP address to listen to */ ++ l = options.lease; ++ rslt += send_number(client, MSG_PART, 0, "\tlease=%s\n",l); /* DHCP lease time */ ++ /* EAPOL parameters */ ++ l = options.eapolenable; ++ rslt += send_number(client, MSG_PART, 0, "\teapolenable=%s\n",l); /* Use eapol */ ++ /* UAM parameters */ ++ l = options.uamserverlen; ++ rslt += send_number(client, MSG_PART, 0, "\tuamserverlen=%s\n",l); /* Number of UAM servers */ ++ for (n = 0; n < options.uamserverlen; n++){ ++ rslt += send_number(client, MSG_PART, 0, "\tuamokip[%s]=",n); ++ rslt += send_line(client, MSG_PART, 0, "%s\n",inet_ntoa(options.uamserver[n])); /* IP address of UAM server */ ++ } ++ l = options.uamserverport; ++ rslt += send_number(client, MSG_PART, 0, "\tuamserverport=%s\n",l); /* Port of UAM server */ ++ rslt += send_line(client, MSG_PART, 0, "\tuamsecret=%s\n",options.uamsecret); /* Shared secret */ ++ rslt += send_line(client, MSG_PART, 0, "\tuamurl=%s\n",options.uamurl); /* URL of authentication server */ ++ rslt += send_line(client, MSG_PART, 0, "\tuamhomepage=%s\n",options.uamhomepage); /* URL of redirection homepage */ ++ l = options.uamhomepageport; ++ rslt += send_number(client, MSG_PART, 0, "\tuamhomepageport=%s\n",l); /* Port of redirection homepage */ ++ rslt += send_line(client, MSG_PART, 0, "\tuamlisten=%s\n",inet_ntoa(options.uamlisten)); /* IP address of local authentication */ ++ l = options.uamport; ++ rslt += send_number(client, MSG_PART, 0, "\tuamport=%s\n",l); /* TCP port to listen to */ ++ l = options.uamokiplen; ++ rslt += send_number(client, MSG_PART, 0, "\tuamokiplen=%s\n",l); /* Number of allowed IP addresses */ ++ for (n=0; n < options.uamokiplen; n++){ ++ rslt += send_number(client, MSG_PART, 0, "\tuamokip[%s]=",n); ++ rslt = send_line(client, MSG_PART, 0, "%s\n",inet_ntoa(options.uamokip[n])); /* List of allowed IP addresses */ ++ } ++ l = options.uamoknetlen; ++ rslt += send_number(client, MSG_PART, 0, "\tuamoknetlen=%s\n",l); /* Number of networks */ ++ for (n=0; n < options.uamoknetlen; n++){ ++ rslt += send_number(client, MSG_PART, 0, "\tuamoknet[%s]=",n); ++ rslt += send_line(client, MSG_PART, 0, "%s/",inet_ntoa(options.uamokaddr[n])); /* List of allowed network IP */ ++ rslt += send_line(client, MSG_PART, 0, "%s\n",inet_ntoa(options.uamokmask[n])); /* List of allowed network mask */ ++ } ++ l = options.uamanydns; ++ rslt += send_number(client, MSG_PART, 0, "\tuamanydns=%s\n",l); /* Allow client to use any DNS server */ ++ /* MAC Authentication */ ++ l = options.macauth; ++ rslt += send_number(client, MSG_PART, 0, "\tmacauth=%s\n",l); /* Use MAC authentication */ ++ l = options.macoklen; ++ rslt += send_number(client, MSG_PART, 0, "\tmacoklen=%s\n",l); /* Number of MAC addresses */ ++ for (n=0; n < options.macoklen; n++){ ++ rslt += send_number(client, MSG_PART, 0, "\tmacok[%s]=",n); ++ rslt += send_mac(client, MSG_PART, 0, "\%s\n",options.macok[n]); /* Allowed MACs */ ++ } ++ rslt += send_line(client, MSG_PART, 0, "\tmacsuffix=%s\n",options.macsuffix); ++ rslt += send_line(client, MSG_PART, 0, "\tmacpasswd=%s\n",options.macpasswd); ++ ++ rslt += send_line(client, MSG_PART, 0, "\trmtlisten=%s\n",inet_ntoa(options.rmtlisten)); ++ l = options.rmtport; ++ rslt += send_number(client, MSG_PART, 0, "\trmtport=%s\n",l); /* Number of MAC addresses */ ++ rslt += send_line(client, MSG_PART, 0, "\trmtpasswd=%s\n",options.rmtpasswd); ++ rslt += send_number(client, MSG_PART, 0, "\tbandwidthmaxup=%s\n",options.bandwidthmaxup); ++ rslt += send_number(client, MSG_PART, 0, "\tbandwidthmaxdown=%s\n",options.bandwidthmaxdown); ++ rslt += rmtctrl_write_msg(client,MSG_END,0, "End of configuration\n"); ++} +--- a/src/chilli.h ++++ b/src/chilli.h +@@ -50,8 +50,8 @@ + /* If the constants below are defined packets which have been dropped + by the traffic shaper will be counted towards accounting and + volume limitation */ +-/* #define COUNT_DOWNLINK_DROP 1 */ +-/* #define COUNT_UPLINK_DROP 1 */ ++#define COUNT_DOWNLINK_DROP 1 ++#define COUNT_UPLINK_DROP 1 + + #define APP_NUM_CONN 128 + #define EAP_LEN 2048 /* TODO: Rather large */ +@@ -68,7 +68,7 @@ + #define CHALLENGESIZE 24 /* From chap.h MAX_CHALLENGE_LENGTH */ + #define USERURLSIZE 256 /* Max length of URL requested by user */ + +-#define BUCKET_SIZE 300000 /* Size of leaky bucket (~200 packets) */ ++//#define BUCKET_SIZE 300000 /* Size of leaky bucket (~200 packets) */ + + /* Time length of leaky bucket in milliseconds */ + /* Bucket size = BUCKET_TIME * Bandwidth-Max radius attribute */ +@@ -194,12 +194,14 @@ struct app_conn_t { + struct in_addr dns1; + struct in_addr dns2; + struct timeval last_time; /* Last time a packet was received or sent */ ++ struct timeval last_up_time; /* Last time a packet was received or sent */ ++ struct timeval last_down_time; /* Last time a packet was received or sent */ + + /* Leaky bucket */ +- uint32_t bucketup; +- uint32_t bucketdown; +- uint32_t bucketupsize; +- uint32_t bucketdownsize; ++ uint64_t bucketup; ++ uint64_t bucketdown; ++ uint64_t bucketupsize; ++ uint64_t bucketdownsize; + + /* UAM information */ + uint8_t uamchal[REDIR_MD5LEN]; +@@ -305,6 +307,11 @@ struct options_t { + int macoklen; /* Number of MAC addresses */ + char* macsuffix; /* Suffix to add to MAC address */ + char* macpasswd; /* Password to use for MAC authentication */ ++ struct in_addr rmtlisten; /* IP address of remote monitor and config */ ++ int rmtport; /* TCP port to listen to monitor and config*/ ++ char* rmtpasswd; /* Password to use for MAC authentication */ ++ int bandwidthmaxup; /* Default Max Up Bandwith setting */ ++ int bandwidthmaxdown; /* Default Max Up Bandwith setting */ + }; + + extern struct app_conn_t connection[APP_NUM_CONN]; +--- a/src/cmdline.c ++++ b/src/cmdline.c +@@ -113,6 +113,11 @@ void clear_given (struct gengetopt_args_ + args_info->macallowed_given = 0 ; + args_info->macsuffix_given = 0 ; + args_info->macpasswd_given = 0 ; ++ args_info->rmtlisten_given = 0 ; ++ args_info->rmtport_given = 0 ; ++ args_info->rmtpasswd_given = 0 ; ++ args_info->bandwidthmaxup_given = 0 ; ++ args_info->bandwidthmaxdown_given = 0 ; + } + + static +@@ -216,7 +221,19 @@ void clear_args (struct gengetopt_args_i + args_info->macsuffix_orig = NULL; + args_info->macpasswd_arg = gengetopt_strdup ("password"); + args_info->macpasswd_orig = NULL; +- ++ args_info->rmtport_arg = 3991; ++ args_info->rmtport_orig = NULL; ++ args_info->rmtlisten_arg = gengetopt_strdup("127.0.0.1"); ++ args_info->rmtlisten_orig = NULL; ++ args_info->rmtport_orig = NULL; ++ args_info->rmtpasswd_arg = NULL; ++ args_info->rmtpasswd_orig = NULL; ++ ++ args_info->bandwidthmaxup_arg = 0; ++ args_info->bandwidthmaxup_orig = NULL; ++ args_info->bandwidthmaxdown_arg = 0; ++ args_info->bandwidthmaxdown_orig = NULL; ++ + } + + void +@@ -284,7 +301,12 @@ cmdline_parser_print_help (void) + printf("%s\n"," --macauth Authenticate based on MAC address \n (default=off)"); + printf("%s\n"," --macallowed=STRING List of allowed MAC addresses"); + printf("%s\n"," --macsuffix=STRING Suffix to add to the MAC address"); +- printf("%s\n"," --macpasswd=STRING Password used when performing MAC \n authentication (default=`password')"); ++ printf("%s\n"," --macpasswd=STRING Password used when performing MAC \n authentication (default='password')"); ++ printf("%s\n"," --rmtlisten=STRING IP address to listen to for monitor and \n configuration (default=`127.0.0.1')"); ++ printf("%s\n"," --rmtport=INT TCP port to bind to for monitor and \n configuration (default=`3991')"); ++ printf("%s\n"," --rmtpasswd=STRING Password used for remote monitor and \n configuration\n"); ++ printf("%s\n"," --bandwidthmaxup=INT Deafaul Max Up Setting in Kilobits\n"); ++ printf("%s\n"," --bandwidthmaxdown=INT Deafaul Max Down Setting in Kilobits\n"); + + } + +@@ -675,6 +697,11 @@ cmdline_parser_release (struct gengetopt + free (args_info->uamport_orig); /* free previous argument */ + args_info->uamport_orig = 0; + } ++ if (args_info->macpasswd_orig) ++ { ++ free (args_info->macpasswd_orig); /* free previous argument */ ++ args_info->macpasswd_orig = 0; ++ } + if (args_info->uamallowed_arg) + { + for (i = 0; i < args_info->uamallowed_given; ++i) +@@ -739,6 +766,34 @@ cmdline_parser_release (struct gengetopt + free (args_info->macpasswd_orig); /* free previous argument */ + args_info->macpasswd_orig = 0; + } ++ if (args_info->rmtlisten_orig) ++ { ++ free (args_info->rmtlisten_orig); /* free previous argument */ ++ args_info->rmtlisten_orig = 0; ++ } ++ if (args_info->rmtport_orig) ++ { ++ free (args_info->rmtport_orig); /* free previous argument */ ++ args_info->rmtport_orig = 0; ++ } ++ ++ if (args_info->rmtpasswd_orig) ++ { ++ free (args_info->rmtpasswd_orig); // free previous argument ++ args_info->rmtpasswd_orig = 0; ++ } ++ ++ if (args_info->bandwidthmaxup_orig) ++ { ++ free (args_info->bandwidthmaxup_orig); // free previous argument ++ args_info->bandwidthmaxup_orig = 0; ++ } ++ ++ if (args_info->bandwidthmaxdown_orig) ++ { ++ free (args_info->bandwidthmaxdown_orig); // free previous argument ++ args_info->bandwidthmaxdown_orig = 0; ++ } + + clear_given (args_info); + } +@@ -1109,7 +1164,41 @@ cmdline_parser_file_save(const char *fil + fprintf(outfile, "%s\n", "macpasswd"); + } + } +- ++ if (args_info->rmtlisten_given) { ++ if (args_info->rmtlisten_orig) { ++ fprintf(outfile, "%s=\"%s\"\n", "rmtlisten", args_info->rmtlisten_orig); ++ } else { ++ fprintf(outfile, "%s\n", "rmtlisten"); ++ } ++ } ++ if (args_info->rmtport_given) { ++ if (args_info->rmtport_orig) { ++ fprintf(outfile, "%s=\"%s\"\n", "rmtport", args_info->rmtport_orig); ++ } else { ++ fprintf(outfile, "%s\n", "rmtport"); ++ } ++ } ++ if (args_info->rmtpasswd_given) { ++ if (args_info->rmtpasswd_orig) { ++ fprintf(outfile, "%s=\"%s\"\n", "rmtpasswd", args_info->rmtpasswd_orig); ++ } else { ++ fprintf(outfile, "%s\n", "rmtpasswd"); ++ } ++ } ++ if (args_info->bandwidthmaxup_given) { ++ if (args_info->bandwidthmaxup_orig) { ++ fprintf(outfile, "%s=\"%s\"\n", "bandwidthmaxup", args_info->bandwidthmaxup_orig); ++ } else { ++ fprintf(outfile, "%s\n", "bandwidthmaxup"); ++ } ++ } ++ if (args_info->bandwidthmaxdown_given) { ++ if (args_info->bandwidthmaxdown_orig) { ++ fprintf(outfile, "%s=\"%s\"\n", "bandwidthmaxdown", args_info->bandwidthmaxdown_orig); ++ } else { ++ fprintf(outfile, "%s\n", "bandwidthmaxdown"); ++ } ++ } + fclose (outfile); + + i = EXIT_SUCCESS; +@@ -1221,6 +1310,7 @@ cmdline_parser_internal (int argc, char + { + int c; /* Character of the parsed option. */ + char *multi_token, *multi_next; /* for multiple options */ ++ char quehace[100]; + + int i; /* Counter */ + +@@ -1299,6 +1389,11 @@ cmdline_parser_internal (int argc, char + { "macallowed", 1, NULL, 0 }, + { "macsuffix", 1, NULL, 0 }, + { "macpasswd", 1, NULL, 0 }, ++ { "rmtport", 1, NULL, 0 }, ++ { "rmtlisten", 1, NULL, 0 }, ++ { "rmtpasswd", 1, NULL, 0 }, ++ { "bandwidthmaxup", 1, NULL, 0 }, ++ { "bandwidthmaxdown", 1, NULL, 0 }, + { NULL, 0, NULL, 0 } + }; + +@@ -1380,8 +1475,6 @@ cmdline_parser_internal (int argc, char + free (args_info->net_orig); /* free previous string */ + args_info->net_orig = gengetopt_strdup (optarg); + break; +- +- + case 0: /* Long option with no short option */ + /* Which modules to print debug messages for. */ + if (strcmp (long_options[option_index].name, "debugfacility") == 0) +@@ -2273,7 +2366,93 @@ cmdline_parser_internal (int argc, char + free (args_info->macpasswd_orig); /* free previous string */ + args_info->macpasswd_orig = gengetopt_strdup (optarg); + } +- ++ /* IP address to listen to for remote monitor and config. */ ++ else if (strcmp (long_options[option_index].name, "rmtlisten") == 0) ++ { ++ if (local_args_info.rmtlisten_given) ++ { ++ fprintf (stderr, "%s: `--rmtlisten' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); ++ goto failure; ++ } ++ if (args_info->rmtlisten_given && ! override) ++ continue; ++ local_args_info.rmtlisten_given = 1; ++ args_info->rmtlisten_given = 1; ++ if (args_info->rmtlisten_arg) ++ free (args_info->rmtlisten_arg); /* free previous string */ ++ args_info->rmtlisten_arg = gengetopt_strdup (optarg); ++ if (args_info->rmtlisten_orig) ++ free (args_info->rmtlisten_orig); /* free previous string */ ++ args_info->rmtlisten_orig = gengetopt_strdup (optarg); ++ } ++ /* TCP port to bind to for authentication requests. */ ++ else if (strcmp (long_options[option_index].name, "rmtport") == 0) ++ { ++ if (local_args_info.rmtport_given) ++ { ++ fprintf (stderr, "%s: `--rmtport' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); ++ goto failure; ++ } ++ if (args_info->rmtport_given && ! override) ++ continue; ++ local_args_info.rmtport_given = 1; ++ args_info->rmtport_given = 1; ++ args_info->rmtport_arg = strtol (optarg,&stop_char,0); ++ if (args_info->rmtport_orig) ++ free (args_info->rmtport_orig); /* free previous string */ ++ args_info->rmtport_orig = gengetopt_strdup (optarg); ++ } ++ /* Password used when performing remote config. */ ++ else if (strcmp (long_options[option_index].name, "rmtpasswd") == 0) ++ { ++ if (local_args_info.rmtpasswd_given) ++ { ++ fprintf (stderr, "%s: `--rmtpasswd' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); ++ goto failure; ++ } ++ if (args_info->rmtpasswd_given && ! override) ++ continue; ++ local_args_info.rmtpasswd_given = 1; ++ args_info->rmtpasswd_given = 1; ++ if (args_info->rmtpasswd_arg) ++ free (args_info->rmtpasswd_arg); // free previous string ++ args_info->rmtpasswd_arg = gengetopt_strdup (optarg); ++ if (args_info->rmtpasswd_orig) ++ free (args_info->rmtpasswd_orig); // free previous string ++ args_info->rmtpasswd_orig = gengetopt_strdup (optarg); ++ } ++ else if (strcmp (long_options[option_index].name, "bandwidthmaxup") == 0) ++ { ++ if (local_args_info.bandwidthmaxup_given) ++ { ++ fprintf (stderr, "%s: `--bandwidthmaxup' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); ++ goto failure; ++ } ++ if (args_info->bandwidthmaxup_given && ! override) ++ continue; ++ local_args_info.bandwidthmaxup_given = 1; ++ args_info->bandwidthmaxup_given = 1; ++ args_info->bandwidthmaxup_arg = strtol (optarg,&stop_char,0); ++ if (args_info->bandwidthmaxup_orig) ++ free (args_info->bandwidthmaxup_orig); /* free previous string */ ++ args_info->bandwidthmaxup_orig = gengetopt_strdup (optarg); ++ } ++ else if (strcmp (long_options[option_index].name, "bandwidthmaxdown") == 0) ++ { ++ if (local_args_info.bandwidthmaxdown_given) ++ { ++ fprintf (stderr, "%s: `--bandwidthmaxdown' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); ++ goto failure; ++ } ++ if (args_info->bandwidthmaxdown_given && ! override) ++ continue; ++ local_args_info.bandwidthmaxdown_given = 1; ++ args_info->bandwidthmaxdown_given = 1; ++ args_info->bandwidthmaxdown_arg = strtol (optarg,&stop_char,0); ++ if (args_info->bandwidthmaxdown_orig) ++ free (args_info->bandwidthmaxdown_orig); /* free previous string */ ++ args_info->bandwidthmaxdown_orig = gengetopt_strdup (optarg); ++ } + break; + case '?': /* Invalid option. */ + /* `getopt_long' already printed an error message. */ +--- a/src/cmdline.ggo ++++ b/src/cmdline.ggo +@@ -119,3 +119,12 @@ option "macallowed" - "List of allowed + option "macsuffix" - "Suffix to add to the MAC address" string no + option "macpasswd" - "Password used when performing MAC authentication" string default="password" no + ++# Remote Monitor and Config ++option "rmtlisten" - "IP address to listen to for authentication requests" string default="127.0.0.1" no ++option "rmtport" - "TCP port to bind to for authentication requests" int default="3991" no ++option "rmtpasswd" - "Password used when performing MAC authentication" string no ++ ++# Extra settings ++option "bandwidthmaxup" - "Default bandwidth control to apply when account don't have setting" int no ++option "bandwidthmaxdown" - "Default bandwidth control to apply when account don't have setting" int no ++ +--- a/src/cmdline.h ++++ b/src/cmdline.h +@@ -122,6 +122,17 @@ struct gengetopt_args_info + char * macsuffix_orig; /* Suffix to add to the MAC address original value given at command line. */ + char * macpasswd_arg; /* Password used when performing MAC authentication (default='password'). */ + char * macpasswd_orig; /* Password used when performing MAC authentication original value given at command line. */ ++ int rmtport_arg; /* TCP port to bind to for remote monitor and config (default='3991'). */ ++ char * rmtport_orig; /* TCP port to bind to for remote monitor and config original value given at command line. */ ++ char * rmtlisten_arg; /* IP address to listen to for remote monitor and config. */ ++ char * rmtlisten_orig; /* IP address to listen to for remote monitor and config original value given at command line. */ ++ char * rmtpasswd_arg; /* Password for remote monitor and config. */ ++ char * rmtpasswd_orig; /* Password for remote monitor and config original value given at command line. */ ++ int bandwidthmaxup_arg; /* Default Bandwidth Max Up. */ ++ char *bandwidthmaxup_orig; /* Default Bandwidth Max Up value given at command line. */ ++ int bandwidthmaxdown_arg; /* Default Bandwidth Max Down. */ ++ char *bandwidthmaxdown_orig; /* Default Bandwidth Max Down value given at command line. */ ++ + + int help_given ; /* Whether help was given. */ + int version_given ; /* Whether version was given. */ +@@ -177,7 +188,11 @@ struct gengetopt_args_info + unsigned int macallowed_given ; /* Whether macallowed was given. */ + int macsuffix_given ; /* Whether macsuffix was given. */ + int macpasswd_given ; /* Whether macpasswd was given. */ +- ++ int rmtport_given ; /* Whether uamport was given. */ ++ int rmtlisten_given ; /* Whether uamlisten was given. */ ++ int rmtpasswd_given ; /* Whether confpassword was given. */ ++ int bandwidthmaxup_given ; ++ int bandwidthmaxdown_given ; + } ; + + int cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info); +--- a/src/Makefile ++++ b/src/Makefile +@@ -54,7 +54,7 @@ PROGRAMS = $(sbin_PROGRAMS) + am_chilli_OBJECTS = chilli.$(OBJEXT) tun.$(OBJEXT) cmdline.$(OBJEXT) \ + ippool.$(OBJEXT) radius.$(OBJEXT) md5.$(OBJEXT) \ + redir.$(OBJEXT) dhcp.$(OBJEXT) syserr.$(OBJEXT) \ +- iphash.$(OBJEXT) lookup.$(OBJEXT) ++ iphash.$(OBJEXT) lookup.$(OBJEXT) remotectrl.$(OBJEXT) + chilli_OBJECTS = $(am_chilli_OBJECTS) + chilli_LDADD = $(LDADD) + DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +@@ -172,7 +172,7 @@ target_alias = + + # add -pg to enable gprof + AM_CFLAGS = -D_GNU_SOURCE -fno-builtin -DSBINDIR='"$(sbindir)"' +-chilli_SOURCES = chilli.c defs.h tun.c tun.h cmdline.c cmdline.h ippool.c ippool.h radius.h radius.c md5.c md5.h redir.h redir.c dhcp.c dhcp.h syserr.c syserr.h iphash.c iphash.h lookup.c lookup.h ++chilli_SOURCES = chilli.c defs.h tun.c tun.h cmdline.c cmdline.h ippool.c ippool.h radius.h radius.c md5.c md5.h redir.h redir.c dhcp.c dhcp.h syserr.c syserr.h iphash.c iphash.h lookup.c lookup.h remotectrl.c remotectrl.h + all: all-am + + .SUFFIXES: +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -54,7 +54,7 @@ PROGRAMS = $(sbin_PROGRAMS) + am_chilli_OBJECTS = chilli.$(OBJEXT) tun.$(OBJEXT) cmdline.$(OBJEXT) \ + ippool.$(OBJEXT) radius.$(OBJEXT) md5.$(OBJEXT) \ + redir.$(OBJEXT) dhcp.$(OBJEXT) syserr.$(OBJEXT) \ +- iphash.$(OBJEXT) lookup.$(OBJEXT) ++ iphash.$(OBJEXT) lookup.$(OBJEXT) remotectrl.$(OBJEXT) + chilli_OBJECTS = $(am_chilli_OBJECTS) + chilli_LDADD = $(LDADD) + DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +@@ -172,7 +172,7 @@ target_alias = @target_alias@ + + # add -pg to enable gprof + AM_CFLAGS = -D_GNU_SOURCE -fno-builtin -DSBINDIR='"$(sbindir)"' +-chilli_SOURCES = chilli.c defs.h tun.c tun.h cmdline.c cmdline.h ippool.c ippool.h radius.h radius.c md5.c md5.h redir.h redir.c dhcp.c dhcp.h syserr.c syserr.h iphash.c iphash.h lookup.c lookup.h ++chilli_SOURCES = chilli.c defs.h tun.c tun.h cmdline.c cmdline.h ippool.c ippool.h radius.h radius.c md5.c md5.h redir.h redir.c dhcp.c dhcp.h syserr.c syserr.h iphash.c iphash.h lookup.c lookup.h remotectrl.c remotectrl.h + all: all-am + + .SUFFIXES: +--- /dev/null ++++ b/src/remotectrl.c +@@ -0,0 +1,340 @@ ++#include ++#include ++#include ++#include ++#include ++ ++#include "remotectrl.h" ++ ++/* ++char *vstrcat(char *first, ...) ++{ ++ size_t len = 0; ++ char *retbuf; ++ va_list argp; ++ char *p; ++ char *tmp=""; ++ if(first == NULL) ++ first=tmp; ++// return NULL; ++ ++ len = strlen(first); ++ ++ va_start(argp, first); ++ ++ while((p = va_arg(argp, char *)) != NULL) ++ len += strlen(p); ++ ++ va_end(argp); ++ retbuf = (char *)malloc(len + 1); // +1 for trailing \0 ++ ++ if(retbuf == NULL) ++ return NULL; // error ++ ++ (void)strcpy(retbuf, first); ++ ++ va_start(argp, first); ++ ++ while((p = va_arg(argp, char *)) != NULL) ++ (void)strcat(retbuf, p); ++ ++ va_end(argp); ++ ++ return retbuf; ++} ++*/ ++ ++int rmtctrl_write_msg( struct rmt_socket_t *sckHnd, uint32_t id, uint32_t extra, char *message ){ ++ msg_head_t header; ++ int rslt; ++ header.id = id; ++ header.len = strlen(message); ++ header.extra = extra; ++ rslt = send(sckHnd->fd,&header,sizeof(struct msg_head_t),0); ++ if (rslt != -1 && header.len > 0) { ++ sckHnd->Tx += rslt; ++ rslt = send(sckHnd->fd, message, header.len, 0); ++ if (rslt > 0) ++ { ++ sckHnd->Tx += rslt; ++ rslt += sizeof(struct msg_head_t); ++ } ++ } ++ return rslt; ++} ++ ++int rmtctrl_read_msg( struct rmt_socket_t *sckHnd, msg_head_t *head, char **message ) ++{ ++// msg_head_t header; ++ int rslt; ++ char *buffer; ++ int reading = 0; ++ int aux = 0; ++ rslt = recv(sckHnd->fd, head, sizeof(struct msg_head_t), 0); ++ if (rslt == sizeof(struct msg_head_t) ) { ++ sckHnd->Rx += rslt; ++ *message = (char *)malloc(head->len+1); ++ memset(*message,'\0', head->len+1); ++ while ( reading < head->len ){ ++ aux = recv(sckHnd->fd, *message, head->len, 0); ++ switch ( aux ) ++ { ++ case -1: ++ switch (errno) ++ { ++ case EINTR: ++ case EAGAIN: ++ usleep (100); ++ break; ++ default: ++ return -1; ++ } ++ break; ++ case 0: // mean socket was closed ++ sckHnd->Rx += reading; ++ return reading; ++ break; ++ break; ++ default: ++ reading+=aux; ++ break; ++ } ++ } ++/* ++ buffer = (char *)malloc(head->len+1); ++ while ( reading < head->len ){ ++ memset(buffer,'\0', head->len+1); ++ aux = recv(sckHnd->fd, buffer, head->len, 0); ++ switch ( aux ) { ++ case -1: ++ switch (errno){ ++ case EINTR: ++ case EAGAIN: ++ usleep (100); ++ break; ++ default: ++ return -1; ++ } ++ break; ++ case 0: // mean socket was closed ++ sckHnd->Rx += reading; ++ return reading; ++ break; ++ break; ++ default: ++ if (reading == 0) ++ *message=(char *)malloc(aux+1); ++ else ++ *message=(char*)realloc(*message,(reading+aux+1)*sizeof(char)); ++// strcat(*message, buffer); ++ memcpy(*message+reading, buffer, aux); ++ reading += aux; ++ *message[reading]=0; ++ } ++ } ++ free(buffer); ++*/ ++ sckHnd->Rx += reading; ++ reading += rslt; ++ return reading; ++ } ++ return rslt; ++} ++ ++void rmtctrl_newClient(struct rmt_socket_t srv, struct rmt_socket_t *client, int *activeClients) ++{ ++ int rslt; ++ int cli = (*activeClients); ++ rmtctrl_accept(srv,&client[cli]); ++ if (client[(*activeClients)].fd != -1) ++ { ++ (*activeClients)++; ++ } ++ if ((*activeClients) >= MAX_CLIENTS) ++ { ++ (*activeClients)--; ++ rslt = rmtctrl_write_msg(&client[(*activeClients)],MSG_END,0, "Sorry Server is too Busy\n Try more late\n" ); ++ if (rslt > 0) client[(*activeClients)].Tx += rslt; ++ rmtctrl_close(&client[(*activeClients)]); ++ } ++} ++ ++void rmtctrl_close ( struct rmt_socket_t *client ) ++{ ++ printf("Desde %s se recibieron %d bytes y se enviaron %d bytes\n",inet_ntoa(client->addr.sin_addr),client->Rx,client->Tx); ++ close(client->fd); /* cierra fd_rmt_client */ ++ printf("Se cerro conexión desde %s\n",inet_ntoa(client->addr.sin_addr) ); ++ client->fd = -1; ++} ++ ++void rmtctrl_accept (struct rmt_socket_t srv, struct rmt_socket_t *client ) ++{ ++ int sin_size=sizeof(struct sockaddr_in); ++ int int_Send; ++ struct sockaddr_in addr; ++ ++ if ((client->fd = accept(srv.fd,(struct sockaddr *)&client->addr,&sin_size))!=-1) ++ { ++ client->Rx = 0; ++ client->Tx = 0; ++ unsigned char c = sizeof(uint32_t); ++ int_Send = send(client->fd, &c, 1, 0); ++ if (int_Send > 0) client->Tx += int_Send; ++ printf("Se abrió una conexión desde %s\n", inet_ntoa(client->addr.sin_addr)); ++ } ++} ++ ++//void cleanClients (int *table, int *n) ++void rmtctrl_cleanClients (struct rmt_socket_t *client, int *n) ++{ ++ int i,j; ++ ++ if ((client == NULL) || ((*n) == 0)) ++ return; ++ ++ j=0; ++ for (i=0; i<(*n); i++) ++ { ++ if (client[i].fd != -1) ++ { ++ client[j].fd = client[i].fd; ++ client[j].addr = client[i].addr; ++ client[j].Rx = client[i].Rx; ++ client[j].Tx = client[i].Tx; ++ j++; ++ } ++ } ++ ++ *n = j; ++} ++ ++int rmtctrl_maxValue (struct rmt_socket_t *client, int n) ++{ ++ int i; ++ int max; ++ ++ if ((client == NULL) || (n<1)) ++ return 0; ++ ++ max = client[0].fd; ++ for (i=0; i max) ++ max = client[i].fd; ++ ++ return max; ++} ++ ++struct rmt_socket_t rmtctrl_initSrv(struct in_addr rmtlisten, int rmtport){ ++ struct rmt_socket_t srv; ++ if ((srv.fd=socket(AF_INET, SOCK_STREAM, 0)) == -1 ) { ++ printf("error en socket()\n"); ++ exit(1); ++ } ++ srv.addr.sin_family = AF_INET; ++ srv.addr.sin_port = htons(rmtport); ++ srv.addr.sin_addr.s_addr = rmtlisten.s_addr; ++ memset(&(srv.addr.sin_zero), 0, 8); ++ ++ if(bind(srv.fd,(struct sockaddr*)&srv.addr,sizeof(struct sockaddr))==-1) { ++ printf("error en bind() \n"); ++ exit(-1); ++ } ++ ++ if(listen(srv.fd,BACKLOG) == -1) { ++ printf("error en listen()\n"); ++ exit(-1); ++ } ++ return srv; ++} ++ ++void rmtctrl_srv(struct rmt_socket_t srv, struct rmt_socket_t *client, int *activeClients) ++{ ++ fd_set fdRead; ++ int maxHnd; ++ int i; ++ struct timeval nowait; ++ memset((char *)&nowait,0,sizeof(nowait)); ++ ++ rmtctrl_cleanClients(client, activeClients); ++ FD_ZERO (&fdRead); ++ FD_SET (srv.fd, &fdRead); ++ ++ for (i=0; i<*activeClients; i++) ++ FD_SET (client[i].fd, &fdRead); ++ ++ maxHnd = rmtctrl_maxValue (client, *activeClients); ++ ++ if (maxHnd < srv.fd) ++ maxHnd = srv.fd; ++ ++ select (maxHnd + 1, &fdRead, NULL, NULL,&nowait); ++ for (i=0; i<*activeClients; i++) ++ { ++ if (FD_ISSET (client[i].fd, &fdRead)) ++ { ++ rmtctrl_msg_proccess(&client[i]); ++ } ++ } ++ if (FD_ISSET (srv.fd, &fdRead)) ++ rmtctrl_newClient(srv,client, &(*activeClients)); ++} ++ ++int send_line( struct rmt_socket_t *client, int msg_type, int msg_extra, char *fmt, char *data) ++{ ++ char str[2048]; ++ memset(str,'\0',2048); ++ sprintf(str,fmt,data); ++ return rmtctrl_write_msg(client,msg_type,msg_extra, str); ++} ++ ++int send_octets( struct rmt_socket_t *client, int msg_type, int msg_extra, char *fmt, uint64_t value) ++{ ++ char *Buffer = (char *)octets2str(value); ++ int ret = send_line( client, msg_type, msg_extra, fmt, Buffer); ++ free(Buffer); ++ return ret; ++} ++ ++int send_mac( struct rmt_socket_t *client, int msg_type, int msg_extra, char *fmt, uint8_t *value) ++{ ++ char *Buffer = (char*)mac2str(value); ++ int ret = send_line( client, msg_type, msg_extra, fmt, Buffer); ++ free(Buffer); ++ return ret; ++} ++ ++int send_number( struct rmt_socket_t *client, int msg_type, int msg_extra, char *fmt, uint64_t value) ++{ ++ char Buffer[64]; ++ sprintf(Buffer,"%d", value); ++ return send_line( client, msg_type, msg_extra, fmt, Buffer); ++} ++ ++const char * mac2str(uint8_t *mac) ++{ ++ char *buffer; ++ buffer=(char*)malloc(18*sizeof(char)); ++ memset(buffer,'\0',18); ++ (void) sprintf(buffer,"%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", ++ mac[0], mac[1], ++ mac[2], mac[3], ++ mac[4], mac[5]); ++ return buffer; ++} ++ ++const char * octets2str(uint64_t value) ++{ ++ char *buffer; ++ buffer=(char*)malloc(13*sizeof(char)); ++ memset(buffer,'\0',13); ++ if (value/8 > 1073741824){ // gigas ++ sprintf(buffer,"%.1f(GiB)",((value/8.0)/1073741824.0)); ++ }else if (value/8 > 1048576){ // megas ++ sprintf(buffer,"%.1f(MiB)",((value/8.0)/1048576.0)); ++ }else if (value/8 > 1024){ // KiloBytes ++ sprintf(buffer,"%.1f(KiB)",((value/8.0)/1024.0)); ++ }else // Bytes ++ sprintf(buffer,"%.1f(B)",(value/8)); ++ return buffer; ++} ++ +--- /dev/null ++++ b/src/remotectrl.h +@@ -0,0 +1,86 @@ ++#include ++#ifndef _RMTCTRL_H ++#define _RMTCTRL_H ++ ++enum ++{ ++ MSG_OK = 0, ++ MSG_START = 1, ++ MSG_PART = 2, ++ MSG_END = 3, ++ QRY_STATUS = 100, ++ QRY_CONNECTED_LIST = 101, ++ QRY_CONNECTED_FULL_LIST = 102, ++ QRY_MACADDR = 103, ++ QRY_IPADDR = 104, ++ QRY_USERNAME = 105, ++ ++ CMD_AUTHORIZE = 200, ++ CMD_DISCONNECT = 201, ++ ++ EXTRA_ALL_OP = 300, ++ EXTRA_MAC_OP = 301, ++ EXTRA_IP_OP = 302, ++ EXTRA_USER_OP = 303, ++}; ++ ++enum ++{ ++ STRING, ++ IP_ADDR, ++ MAC_ADDR, ++ NUMBER, ++ OCTETS, ++}; ++ ++#define PORT 15557 /* El puerto que ser? abierto */ ++#define BACKLOG 2 /* El n?mero de conexiones permitidas */ ++#define MAX_CLIENTS 10 ++static char CONVERT_BUFF[1024]; ++ ++typedef struct msg_head_t { ++ uint32_t id; ++ uint32_t extra; ++ uint32_t len; ++} msg_head_t; ++ ++typedef struct rmt_socket_t { ++ int fd; ++ struct sockaddr_in addr; ++ int Rx; ++ int Tx; ++} rmt_socket_t; ++ ++//char *vstrcat(char *first, ...); ++ ++ ++int rmtctrl_write_msg( struct rmt_socket_t *sckHnd, uint32_t id, uint32_t extra, char *message ); ++int rmtctrl_read_msg( struct rmt_socket_t *sckHnd, msg_head_t *head, char **message ); ++void rmtctrl_newClient(struct rmt_socket_t srv, struct rmt_socket_t *client, int *activeClients); ++void rmtctrl_close ( struct rmt_socket_t *client ); ++void rmtctrl_accept (struct rmt_socket_t srv, struct rmt_socket_t *client ); ++void rmtctrl_cleanClients (struct rmt_socket_t *client, int *n); ++ ++//inicializa las variables y arranca el servidor ++struct rmt_socket_t rmtctrl_initSrv(struct in_addr rmtlisten, int rmtport); ++//esta funcion es la que va dentro del loop del programa que lo utiliza ++void rmtctrl_srv(struct rmt_socket_t srv, struct rmt_socket_t *client, int *activeClients); ++//En esta funcion es donde se define como se procesan los mensajes ++void rmtctrl_msg_proccess(struct rmt_socket_t *client); ++ ++//char * pepe(char *dest, char *sep, char *src); ++ ++//char * send_value(char *name, char *value, int len, struct in_addr *addr, ++// uint8_t *mac, long int *integer); ++//int addfield(char* reg, char *field, char sep); ++//int addfield1(char** reg,int rlen, char *field, int flen, char sep); ++//int sendConnectedInfo(struct app_conn_t *appconn, struct rmt_socket_t *client); ++//const char * value2str( int type, void *value); ++const char * octets2str(uint64_t value); ++const char * mac2str(uint8_t *mac); ++int send_line( struct rmt_socket_t *client, int msg_type, int msg_extra, char *fmt, char *data); ++int send_octets( struct rmt_socket_t *client, int msg_type, int msg_extra, char *fmt, uint64_t value); ++int send_mac( struct rmt_socket_t *client, int msg_type, int msg_extra, char *fmt, uint8_t *value); ++int send_number( struct rmt_socket_t *client, int msg_type, int msg_extra, char *fmt, uint64_t value); ++ ++#endif /* !_RMTCTRL_H */ +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -3,7 +3,7 @@ sbin_PROGRAMS = chilli + # add -pg to enable gprof + AM_CFLAGS = -D_GNU_SOURCE -fno-builtin -DSBINDIR='"$(sbindir)"' + +-chilli_SOURCES = chilli.c defs.h tun.c tun.h cmdline.c cmdline.h ippool.c ippool.h radius.h radius.c md5.c md5.h redir.h redir.c dhcp.c dhcp.h syserr.c syserr.h iphash.c iphash.h lookup.c lookup.h ++chilli_SOURCES = chilli.c defs.h tun.c tun.h cmdline.c cmdline.h ippool.c ippool.h radius.h radius.c md5.c md5.h redir.h redir.c dhcp.c dhcp.h syserr.c syserr.h iphash.c iphash.h lookup.c lookup.h remotectrl.c remotectrl.h + + # chilli_LDFLAGS = -lcrypt + diff --git a/net/chillispot/patches/200-gcc_fix.patch b/net/chillispot/patches/200-gcc_fix.patch new file mode 100644 index 0000000..a819216 --- /dev/null +++ b/net/chillispot/patches/200-gcc_fix.patch @@ -0,0 +1,57 @@ +diff -Naur chillispot-1.1.0/src/tun.c chillispot-1.1.0.patched/src/tun.c +--- chillispot-1.1.0/src/tun.c 2006-09-24 20:48:25.000000000 +0300 ++++ chillispot-1.1.0.patched/src/tun.c 2009-10-20 02:08:49.000000000 +0300 +@@ -366,7 +366,7 @@ + this->addrs++; + return 0; + +-#elif defined (__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__) ++#elif defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__) + + int fd; + struct ifaliasreq areq; +@@ -445,7 +445,7 @@ + #if defined(__linux__) + ifr.ifr_netmask.sa_family = AF_INET; + +-#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__) ++#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__) + ((struct sockaddr_in *) &ifr.ifr_addr)->sin_len = + sizeof (struct sockaddr_in); + ((struct sockaddr_in *) &ifr.ifr_dstaddr)->sin_len = +@@ -497,7 +497,7 @@ + ((struct sockaddr_in *) &ifr.ifr_netmask)->sin_addr.s_addr = + netmask->s_addr; + +-#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__) ++#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__) + ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr = + netmask->s_addr; + +@@ -585,7 +585,7 @@ + close(fd); + return 0; + +-#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__) ++#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__) + + struct { + struct rt_msghdr rt; +@@ -674,7 +674,7 @@ + #if defined(__linux__) + struct ifreq ifr; + +-#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__) ++#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__) + char devname[IFNAMSIZ+5]; /* "/dev/" + ifname */ + int devnum; + struct ifaliasreq areq; +@@ -722,7 +722,7 @@ + ioctl((*tun)->fd, TUNSETNOCSUM, 1); /* Disable checksums */ + return 0; + +-#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__) ++#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__) + + /* Find suitable device */ + for (devnum = 0; devnum < 255; devnum++) { /* TODO 255 */ diff --git a/net/chrony/Makefile b/net/chrony/Makefile new file mode 100644 index 0000000..55f81ca --- /dev/null +++ b/net/chrony/Makefile @@ -0,0 +1,72 @@ +# +# Copyright (C) 2006-2012 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:=chrony +PKG_VERSION:=1.26 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:= ftp://download.tuxfamily.org/projects/chrony/ \ + http://download.tuxfamily.org/chrony/ +PKG_MD5SUM:=ad6dd619ff1986e4ff780363c64e2246 + +include $(INCLUDE_DIR)/package.mk + +define Package/chrony + SUBMENU:=Time Synchronization + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libreadline +libncurses @!TARGET_avr32 @!powerpc + TITLE:=NTP client/server for on-demand connections + URL:=http://chrony.sunsite.dk/ +endef + +define Package/chrony/description + A NTP implementation that has been specifically written to work + well in the case of an intermittent (e.g. dial-on-demand) + connection to the network where your NTP servers are. +endef + +define Package/chrony/conffiles +/etc/chrony/chrony.conf +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --target=$(GNU_TARGET_NAME) \ + --prefix=/usr \ + --with-readline-includes=$(STAGING_DIR)/usr/include \ + --with-readline-library=$(STAGING_DIR)/usr/lib \ + --disable-linuxcaps \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + prefix="$(PKG_INSTALL_DIR)/usr" +endef + +define Package/chrony/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/chronyd $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/chronyc $(1)/usr/bin + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DIR) $(1)/etc/chrony + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_BIN) ./files/ntpd.hotplug $(1)/etc/hotplug.d/iface/20-ntpd + $(INSTALL_BIN) ./files/ntpd.init $(1)/etc/init.d/ntpd + $(INSTALL_CONF) ./files/ntpd.config $(1)/etc/config/ntpd + $(INSTALL_CONF) ./files/chrony.conf $(1)/etc/chrony/chrony.conf + $(INSTALL_CONF) ./files/chrony.keys $(1)/etc/chrony/chrony.keys +endef + +$(eval $(call BuildPackage,chrony)) diff --git a/net/chrony/files/chrony.conf b/net/chrony/files/chrony.conf new file mode 100644 index 0000000..508fdfb --- /dev/null +++ b/net/chrony/files/chrony.conf @@ -0,0 +1,17 @@ +# Chrony configuration + +# Note: time servers and ntp client access is configured in /etc/config/ntpd +# and automatically set at startup + +# Log clock errors above 0.5 seconds +logchange 0.5 + +# Allow command access only from localhost +cmdallow localhost +cmddeny + +# Password config for chronyc +# Note: Using a command key other than "1" will break +# /etc/init.d/ntpd and /etc/hotplug.d/iface/20-ntpd +keyfile /etc/chrony/chrony.keys +commandkey 1 diff --git a/net/chrony/files/chrony.keys b/net/chrony/files/chrony.keys new file mode 100644 index 0000000..c2d429e --- /dev/null +++ b/net/chrony/files/chrony.keys @@ -0,0 +1 @@ +1 chronyc diff --git a/net/chrony/files/ntpd.config b/net/chrony/files/ntpd.config new file mode 100644 index 0000000..7a3b6fd --- /dev/null +++ b/net/chrony/files/ntpd.config @@ -0,0 +1,6 @@ +# Generic NTP configuration +# Time servers and network(s) that may access the time service + +config ntpd + option TimeServers "0.openwrt.pool.ntp.org 1.openwrt.pool.ntp.org 2.openwrt.pool.ntp.org 3.openwrt.pool.ntp.org" + option ClientAccessFrom "lan" diff --git a/net/chrony/files/ntpd.hotplug b/net/chrony/files/ntpd.hotplug new file mode 100644 index 0000000..e2e5adf --- /dev/null +++ b/net/chrony/files/ntpd.hotplug @@ -0,0 +1,21 @@ +COMMAND=/usr/bin/chronyc +CHRONY_KEY=$(awk '/^1 / { print $2; }' /etc/chrony/chrony.keys) + +chrony_control() { +$COMMAND << EOF +password $CHRONY_KEY +$1 +EOF +} + +[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && { + [ -x $COMMAND ] && [ -n "$CHRONY_KEY" ] &&{ + chrony_control online + } +} + +[ "$ACTION" = "ifdown" -a "$INTERFACE" = "wan" ] && { + [ -x $COMMAND ] && [ -n "$CHRONY_KEY" ] &&{ + chrony_control offline + } +} diff --git a/net/chrony/files/ntpd.init b/net/chrony/files/ntpd.init new file mode 100644 index 0000000..6e742fa --- /dev/null +++ b/net/chrony/files/ntpd.init @@ -0,0 +1,56 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +START=60 + +start() { + [ ! -f /var/run/chronyd.pid ] && ( + /usr/sbin/chronyd -f /etc/chrony/chrony.conf + + local NTP_SERVERS + local NTP_SERVER + local CLIENT_NETWORKS + local NETNAME + config_load ntpd + config_get NTP_SERVERS $CONFIG_SECTION TimeServers + config_get CLIENT_NETWORKS $CONFIG_SECTION ClientAccessFrom + CHRONY_KEY=$(awk '/^1 / { print $2; }' /etc/chrony/chrony.keys) + + . /lib/functions/network.sh + + # Define servers and do a rapid series of time measurements + # to get up to date + ( + echo password $CHRONY_KEY + for NTP_SERVER in $NTP_SERVERS; do + echo add server $NTP_SERVER + done + echo burst 5/5 + ) | chronyc > /dev/null 2>&1 + # ... wait until a reference ID is found ... + while chronyc tracking | grep 'Reference ID.*0.0.0.0' >/dev/null ; do sleep 1; done + # ... and finally, adjust the time in a single step + # and allow clients to access the server + ( + echo password $CHRONY_KEY + echo makestep + for NETNAME in $CLIENT_NETWORKS; do + local subnet + if network_get_subnet subnet "$NETNAME"; then + echo allow $subnet + fi + done + ) | chronyc > /dev/null 2>&1 + ) +} + +stop() { + [ -r /var/run/chronyd.pid ] && PID=$(cat /var/run/chronyd.pid) + [ -n "$PID" ] && kill $PID +} + +restart() { + stop + while [ -r /var/run/chronyd.pid ] ; do sleep 1; done + start +} diff --git a/net/chrony/patches/001-crosscompile.patch b/net/chrony/patches/001-crosscompile.patch new file mode 100644 index 0000000..d712e06 --- /dev/null +++ b/net/chrony/patches/001-crosscompile.patch @@ -0,0 +1,25 @@ +--- a/configure ++++ b/configure +@@ -254,6 +254,13 @@ do + --host-machine=* ) + MACHINE=`echo $option | sed -e 's/^.*=//;'` + ;; ++ --target=* ) ++ TARGET=`echo $option | sed -e 's/[^=]*=//;'` ++ OPERATINGSYSTEM=`echo $TARGET | sed -e 's/.*-//;'` ++ MACHINE=`echo $TARGET | sed -e 's/-.*//;'` ++ VERSION="" ++ SYSTEM=${OPERATINGSYSTEM}-${MACHINE} ++ ;; + --help | -h ) + usage + exit 0 +@@ -287,7 +294,7 @@ case $SYSTEM in + ;; + esac + ;; +- Linux* ) ++ Linux* | linux* ) + EXTRA_OBJECTS="sys_linux.o wrap_adjtimex.o" + try_linuxcaps=1 + try_rtc=1 diff --git a/net/chrony/patches/002-ipv6_disabled_fixes.patch b/net/chrony/patches/002-ipv6_disabled_fixes.patch new file mode 100644 index 0000000..629d2c7 --- /dev/null +++ b/net/chrony/patches/002-ipv6_disabled_fixes.patch @@ -0,0 +1,34 @@ +--- a/ntp_io.c ++++ b/ntp_io.c +@@ -355,6 +355,7 @@ read_from_socket(void *anything) + } + #endif + ++#ifdef HAVE_IPV6 + #ifdef IPV6_PKTINFO + if (cmsg->cmsg_level == IPPROTO_IPV6 && cmsg->cmsg_type == IPV6_PKTINFO) { + struct in6_pktinfo ipi; +@@ -365,6 +366,7 @@ read_from_socket(void *anything) + remote_addr.local_ip_addr.family = IPADDR_INET6; + } + #endif ++#endif + + #ifdef SO_TIMESTAMP + if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SO_TIMESTAMP) { +@@ -466,6 +468,7 @@ send_packet(void *packet, int packetlen, + } + #endif + ++#ifdef HAVE_IPV6 + #ifdef IPV6_PKTINFO + if (remote_addr->local_ip_addr.family == IPADDR_INET6) { + struct cmsghdr *cmsg; +@@ -484,6 +487,7 @@ send_packet(void *packet, int packetlen, + sizeof(ipi->ipi6_addr.s6_addr)); + } + #endif ++#endif + + #if 0 + LOG(LOGS_INFO, LOGF_NtpIO, "sending to %s:%d from %s", diff --git a/net/cifs-utils/Makefile b/net/cifs-utils/Makefile new file mode 100644 index 0000000..743e12b --- /dev/null +++ b/net/cifs-utils/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2007-2012 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:=cifs-utils +PKG_VERSION:=5.4 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=http://ftp.samba.org/pub/linux-cifs/cifs-utils +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_MD5SUM:=dde98336c833b59777114145cb8f3c64 + +include $(INCLUDE_DIR)/package.mk + +define Package/cifsmount + SECTION:=net + CATEGORY:=Network + TITLE:=CIFS mount utilities + URL:=http://wiki.samba.org/index.php/LinuxCIFS_utils +endef + +TARGET_CFLAGS += -Wno-error + +CONFIGURE_ARGS += \ + --exec-prefix=/usr \ + --prefix=/ \ + --with-libcap-ng=no \ + --with-libcap=no + +define Package/cifsmount/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mount.cifs $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,cifsmount)) diff --git a/net/click/Makefile b/net/click/Makefile new file mode 100644 index 0000000..ef48d79 --- /dev/null +++ b/net/click/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=click +PKG_VERSION:=20101020 +PKG_RELEASE:=1 +PKG_REV:=8f521a2dcd58ea8205b3b6070be605a21fb9154b + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=git://read.cs.ucla.edu/git/click +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_MD5SUM:=c3cba1c923d0a034cc518720b5ba7b40 + +include $(INCLUDE_DIR)/package.mk + +define Package/click + SECTION:=net + CATEGORY:=Network + DEPENDS:=@BROKEN + TITLE:=Click Modular Router + URL:=http://read.cs.ucla.edu/click +endef + +define Package/click/Description + The Click Modular Router userspace package +endef + +TARGET_CFLAGS += "-static -O2 -MD" +TARGET_CXXFLAGS += "-static -O2 -MD" + +define Build/Configure + (cd $(PKG_BUILD_DIR); \ + rm -rf config.{cache,status} ; \ + ./configure \ + --prefix=/usr \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_HOST_NAME) \ + --build=$(GNU_BUILD_NAME) \ + --enable-tools=mixed \ + --enable-userlevel \ + --enable-wifi \ + --enable-fixincludes \ + --disable-linuxmodule \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + tools elementmap.xml + (cd $(PKG_BUILD_DIR)/userlevel; \ + ../tools/click-mkmindriver/click-mkmindriver -p $(PKG_NAME) -C .. \ + -f $(PKG_BUILD_DIR)/conf/wifi/dump.click \ + -A --all -E Discard -E Print; \ + ) + $(MAKE) -C $(PKG_BUILD_DIR) MINDRIVER=$(PKG_NAME) +endef + +define Package/click/install + $(INSTALL_DIR) $(1)/usr + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/share/click + $(CP) $(PKG_BUILD_DIR)/userlevel/$(PKG_NAME)click $(1)/usr/bin/click + $(CP) $(PKG_BUILD_DIR)/tools/click-align/click-align $(1)/usr/bin/click-align + $(CP) $(PKG_BUILD_DIR)/elementmap.xml $(1)/usr/share/click/elementmap.xml +endef + +$(eval $(call BuildPackage,click)) diff --git a/net/click/files/roofnet.init b/net/click/files/roofnet.init new file mode 100644 index 0000000..bc36394 --- /dev/null +++ b/net/click/files/roofnet.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 + +start() { + killall -q click + cp /usr/bin/srcr.click /tmp + sh /usr/bin/gen_config_roofnet.sh > /tmp/unaligned.click + click-align /tmp/unaligned.click > /tmp/roofnet.click + /usr/bin/click /tmp/roofnet.click > /tmp/roofnet.log 2>&1 & +} + +stop() { + killall click +} diff --git a/net/click/patches/100-compile_fix.patch b/net/click/patches/100-compile_fix.patch new file mode 100644 index 0000000..f798254 --- /dev/null +++ b/net/click/patches/100-compile_fix.patch @@ -0,0 +1,22 @@ +--- a/tools/click-mkmindriver/Makefile.in ++++ b/tools/click-mkmindriver/Makefile.in +@@ -60,7 +60,7 @@ DEPCFLAGS = @DEPCFLAGS@ + DEFS = @DEFS@ + INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ + -I$(top_srcdir)/tools/lib -I$(srcdir) +-LDFLAGS = @LDFLAGS@ ++LDFLAGS = @LDFLAGS@ -lrt + LIBS = @LIBS@ @POSIX_CLOCK_LIBS@ $(DL_LIBS) + + CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS) $(DEPCFLAGS) +--- a/configure ++++ b/configure +@@ -7135,7 +7135,7 @@ fi + $as_echo "$ac_cv_va_list_addr" >&6; } + if test "x$ac_cv_va_list_addr" = xyes; then + +-$as_echo "#define HAVE_ADDRESSABLE_VA_LIST 1" >>confdefs.h ++$as_echo "#define HAVE_ADDRESSABLE_VA_LIST 0" >>confdefs.h + + fi + diff --git a/net/click/patches/110-multithread_fix.patch b/net/click/patches/110-multithread_fix.patch new file mode 100644 index 0000000..b875758 --- /dev/null +++ b/net/click/patches/110-multithread_fix.patch @@ -0,0 +1,12 @@ +--- a/lib/master.cc ++++ b/lib/master.cc +@@ -409,7 +409,9 @@ Master::process_pending(RouterThread *th + while (Task *t = Task::pending_to_task(my_pending)) { + my_pending = t->_pending_nextptr; + t->_pending_nextptr = 0; ++# if HAVE_MULTITHREAD + click_master_mb(); ++# endif + t->process_pending(thread); + } + } diff --git a/net/cmdftp/Makefile b/net/cmdftp/Makefile new file mode 100644 index 0000000..8e99238 --- /dev/null +++ b/net/cmdftp/Makefile @@ -0,0 +1,46 @@ +# +# 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:=cmdftp +PKG_VERSION:=0.9.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.savannah.nongnu.org/releases/$(PKG_NAME) +PKG_MD5SUM:=9bd0741bbb1f218be95c089dc06b2777 + +include $(INCLUDE_DIR)/package.mk + +define Package/cmdftp + SUBMENU:=File Transfer + SECTION:=net + CATEGORY:=Network + TITLE:=cmdftp is a tiny command line FTP client for Unix systems + URL:=http://www.nongnu.org/cmdftp/ +endef + +define Package/cmdftp/description + Features include passive mode for all data transfers, shell + like transparent syntax for local and remote modes, multiple + and recursive file transfers using wildcards, recursive copy and + move commands, remote and local text file viewing and editing, + network errors detection and resuming of currently executing + command, partial download resuming (if server accepts REST + command), tab completion for both local and remote names, + autologin using classic ~/.netrc approach, large file support. + + cmdftp is aimed at being small and simple. +endef + +define Package/cmdftp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,cmdftp)) diff --git a/net/conntrack-tools/Makefile b/net/conntrack-tools/Makefile new file mode 100644 index 0000000..57c7f6d --- /dev/null +++ b/net/conntrack-tools/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2009-2011 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:=conntrack-tools +PKG_VERSION:=1.0.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://www.netfilter.org/projects/conntrack-tools/files \ + ftp://ftp.netfilter.org/pub/conntrack-tools \ + http://mirrors.evolva.ro/netfilter.org/conntrack-tools +PKG_MD5SUM:=5add24d4761baf17af630d5627a71752 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/conntrack-tools + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libnetfilter-conntrack + SUBMENU:=Firewall + TITLE:=Connection tracking userspace tools + URL:=http://conntrack-tools.netfilter.org/ +endef + +define Package/conntrack-tools/description + The conntrack-tools are a set of free software userspace tools for Linux + that allow system administrators interact with the Connection Tracking + System, which is the module that provides stateful packet inspection for + iptables. The conntrack-tools are the userspace daemon conntrackd and the + command line interface conntrack. +endef + +define Package/conntrack-tools/conffiles +/etc/conntrackd/conntrackd.conf +endef + +define Package/conntrack-tools/install + $(INSTALL_DIR) $(1)/etc/conntrackd + $(INSTALL_CONF) \ + $(PKG_BUILD_DIR)/doc/stats/conntrackd.conf \ + $(1)/etc/conntrackd/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/sbin/conntrack \ + $(PKG_INSTALL_DIR)/usr/sbin/conntrackd \ + $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,conntrack-tools)) diff --git a/net/coova-chilli/Makefile b/net/coova-chilli/Makefile new file mode 100644 index 0000000..3b350cb --- /dev/null +++ b/net/coova-chilli/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=coova-chilli +PKG_VERSION:=1.2.9 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://ap.coova.org/chilli +PKG_MD5SUM:=a493d0562fc3b05fe86d8ad65f7f2dc0 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/coova-chilli + SUBMENU:=Captive Portals + SECTION:=net + CATEGORY:=Network + DEPENDS:=+kmod-tun +librt + TITLE:=Wireless LAN HotSpot controller (Coova Chilli Version) + URL:=http://www.coova.org/CoovaChilli +endef + +define Package/coova-chilli/description + CoovaChilli is an open source access controller for wireless LAN + access points and is based on ChilliSpot. It is used for authenticating + users of a wireless (or wired) LAN. It supports web based login (UAM) + which is today's standard for public HotSpots and it supports Wireless + Protected Access (WPA) which is the standard of the future. + Authentication, authorization and accounting (AAA) is handled by your + favorite radius server. +endef + +define Package/coova-chilli/conffiles +/etc/chilli.conf +endef + +define Package/coova-chilli/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/chilli + $(CP) $(PKG_INSTALL_DIR)/etc/chilli/* $(1)/etc/chilli/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,coova-chilli)) diff --git a/net/corkscrew/Makefile b/net/corkscrew/Makefile new file mode 100644 index 0000000..7cc697a --- /dev/null +++ b/net/corkscrew/Makefile @@ -0,0 +1,37 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=corkscrew +PKG_VERSION:=2.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.agroman.net/corkscrew/ +PKG_MD5SUM:=35df77e7f0e59c0ec4f80313be52c10a + +include $(INCLUDE_DIR)/package.mk + +define Package/corkscrew + SECTION:=net + CATEGORY:=Network + SUBMENU:=SSH + TITLE:=Tunneling SSH through HTTP proxies. + URL:=http://www.agroman.net/corkscrew/ +endef + +define Build/Configure + $(call Build/Configure/Default,) +endef + +define Package/corkscrew/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/corkscrew $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,corkscrew)) diff --git a/net/crowdcontrol/Makefile b/net/crowdcontrol/Makefile new file mode 100644 index 0000000..bf5e18f --- /dev/null +++ b/net/crowdcontrol/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2006-2011 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:=crowdcontrol +PKG_VERSION:=0.4b +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/ +PKG_MD5SUM:=a0991ae3d1f1a361558bed1a4aa66a9c + +include $(INCLUDE_DIR)/package.mk + +define Package/crowdcontrol + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=The extra-light http proxy server + URL:=http://sourceforge.net/projects/crowdcontrol/ +endef + +define Package/crowdcontrol/description + Crowd Control is an small, cross-platform HTTP proxy (a fork of the elhttp project) + designed for systems with little RAM, such as a home router. It can filter URLs using + SquidGuard blocklists, and has the unique ability to filter HTTPS domains as well. +endef + +define Build/Configure +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/crowdcontrol $(PKG_BUILD_DIR)/crowdcontrol.c +endef + +define Package/crowdcontrol/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc/crowdcontrol + $(CP) $(PKG_BUILD_DIR)/crowdcontrol $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/*-{domains,expressions,urls} $(1)/etc/crowdcontrol/ +endef + +define Package/crowdcontrol/conffiles +/etc/crowdcontrol/blocked-domains +/etc/crowdcontrol/blocked-expressions +/etc/crowdcontrol/blocked-urls +/etc/crowdcontrol/permitted-domains +/etc/crowdcontrol/permitted-expressions +/etc/crowdcontrol/permitted-urls +endef + +$(eval $(call BuildPackage,crowdcontrol)) diff --git a/net/ctorrent/Makefile b/net/ctorrent/Makefile new file mode 100644 index 0000000..c8593d9 --- /dev/null +++ b/net/ctorrent/Makefile @@ -0,0 +1,84 @@ +# +# Copyright (C) 2006-2008 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:=5 + +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 + 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 new file mode 100644 index 0000000..86ae1d7 --- /dev/null +++ b/net/ctorrent/patches/100-CVE-2009-1759.patch @@ -0,0 +1,364 @@ +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/cups-bjnp/Makefile b/net/cups-bjnp/Makefile new file mode 100644 index 0000000..4a85829 --- /dev/null +++ b/net/cups-bjnp/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cups-bjnp +PKG_VERSION:=0.5.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/cups-bjnp +PKG_MD5SUM:=4f29dd69a487a90ac7603b5be5cb030f + +PKG_BUILD_DEPENDS:=cups + +include $(INCLUDE_DIR)/package.mk + +define Package/cups-bjnp + SECTION:=net + CATEGORY:=Network + TITLE:=BJNP protocol backend for CUPS + URL:=http://sourceforge.net/projects/cups-bjnp/ + DEPENDS:=cups +endef + +define Package/cups-bjnp/description +CUPS backend for the canon printers using the proprietary USB over +IP BJNP protocol. This backend allows Cups to print over the network +to a Canon printer. It currently supports Cups 1.2 and Cups 1.3 and +is designed by reverse engineering. +endef + +CONFIGURE_ARGS += --with-cupsbackenddir=$(STAGING_DIR)/usr/include/cups + +TARGET_CFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +define Package/cups-bjnp/install + $(INSTALL_DIR) $(1)/usr/lib/cups/backend + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bjnp $(1)/usr/lib/cups/backend +endef + + +$(eval $(call BuildPackage,cups-bjnp)) diff --git a/net/cups/Makefile b/net/cups/Makefile new file mode 100644 index 0000000..63f2bae --- /dev/null +++ b/net/cups/Makefile @@ -0,0 +1,120 @@ +# +# Copyright (C) 2006-2012 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:=cups +PKG_VERSION:=1.4.4 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-source.tar.bz2 +PKG_SOURCE_URL:= \ + http://ftp.rz.tu-bs.de/pub/mirror/ftp.easysw.com/ftp/pub/cups/$(PKG_VERSION) \ + ftp://ftp.easysw.com/pub/cups/$(PKG_VERSION) \ + ftp://ftp3.easysw.com/pub/cups/$(PKG_VERSION) +PKG_MD5SUM:=8776403ad60fea9e85eab9c04d88560d + +TARGET_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +include $(INCLUDE_DIR)/package.mk + +define Package/cups + SECTION:=net + CATEGORY:=Network + DEPENDS:=+zlib +libpthread +libpng +libjpeg +libstdcpp +libusb + TITLE:=Common UNIX Printing System + URL:=http://www.cups.org/ +endef + +define Package/cups/description + A printer spooling system for devices with USB or LP support. +endef + +define Package/cups/conffiles +/etc/cups/classes.conf +/etc/cups/client.conf +/etc/cups/cupsd.conf +/etc/cups/printers.conf +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --with-cups-user="nobody" \ + --with-cups-group="nogroup" \ + --without-perl \ + --without-python \ + --without-php \ + --enable-shared \ + --enable-image \ + --enable-libusb \ + --disable-dbus \ + --disable-dnssd \ + --disable-launchd \ + --disable-ldap \ + --disable-pam \ + --disable-slp \ + --disable-gnutls \ + --disable-openssl \ + --disable-cdsassl \ + --disable-ssl \ + --disable-gssapi \ + --disable-tiff, \ + UNAME="Linux" \ + LIBS="$(TARGET_LDFLAGS) -lz -lpng -ljpeg" \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + DSTROOT="$(PKG_INSTALL_DIR)" \ + STRIP="/bin/true" \ + all install +endef + +define Package/cups/install + rm -rf $(1)/etc/cups + $(INSTALL_DIR) $(1)/etc/cups + $(CP) $(PKG_INSTALL_DIR)/etc/cups/* $(1)/etc/cups/ + rm -rf $(1)/etc/cups/certs + ln -sf /tmp $(1)/etc/cups/certs + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + rm -f $(1)/usr/bin/cups-config + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcups*.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/cups $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/share/cups/templates + $(CP) $(PKG_INSTALL_DIR)/usr/share/cups/templates/*.tmpl $(1)/usr/share/cups/templates/ + $(INSTALL_DIR) $(1)/usr/share/cups/mime + $(CP) $(PKG_INSTALL_DIR)/usr/share/cups/mime/* $(1)/usr/share/cups/mime/ + $(INSTALL_DIR) $(1)/usr/share/doc/cups + $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/cups/index.html $(1)/usr/share/doc/cups/ + $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/cups/*.css $(1)/usr/share/doc/cups/ + $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/cups/images $(1)/usr/share/doc/cups/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/sbin/{accept,cupsaddsmb,cupsctl,cupsd,cupsfilter,lpadmin,lpc,lpinfo,lpmove} \ + $(1)/usr/sbin/ + (cd $(1)/usr/sbin; ln -sf accept reject; ln -sf accept cupsenable; ln -sf accept cupsdisable;) + # overwrite default config with our own + $(CP) ./files/etc/cups/* $(1)/etc/cups/ + # install initscript with priority 60 + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/cupsd.init $(1)/etc/init.d/cupsd +endef + +define Build/InstallDev + $(INSTALL_DIR) $(2)/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cups-config $(2)/bin/ + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/cups $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcups*.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,cups)) diff --git a/net/cups/files/cupsd.init b/net/cups/files/cupsd.init new file mode 100644 index 0000000..e5f00da --- /dev/null +++ b/net/cups/files/cupsd.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +start() { + mkdir -m 0755 -p /var/cache/cups + mkdir -m 0755 -p /var/cups + mkdir -m 0755 -p /var/spool/cups/tmp + service_start /usr/sbin/cupsd +} + +stop() { + service_stop /usr/sbin/cupsd +} + +reload() { + service_reload /usr/sbin/cupsd +} diff --git a/net/cups/files/etc/cups/classes.conf b/net/cups/files/etc/cups/classes.conf new file mode 100644 index 0000000..15afda7 --- /dev/null +++ b/net/cups/files/etc/cups/classes.conf @@ -0,0 +1,7 @@ +######################################################################## +# # +# This is a sample class configuration file. This file is included # +# from the main configuration file (cups.conf) and lists all of the # +# printer classes known to the system. # +# # +######################################################################## diff --git a/net/cups/files/etc/cups/client.conf b/net/cups/files/etc/cups/client.conf new file mode 100644 index 0000000..c8d9f91 --- /dev/null +++ b/net/cups/files/etc/cups/client.conf @@ -0,0 +1,9 @@ +######################################################################## +# # +# This is the CUPS client configuration file. This file is used to # +# define client-specific parameters, such as the default server or # +# default encryption settings. # +# # +######################################################################## + +Encryption Never diff --git a/net/cups/files/etc/cups/cupsd.conf b/net/cups/files/etc/cups/cupsd.conf new file mode 100644 index 0000000..79ad944 --- /dev/null +++ b/net/cups/files/etc/cups/cupsd.conf @@ -0,0 +1,47 @@ +######################################################################## +# # +# This is the CUPS configuration file. If you are familiar with # +# Apache or any of the other popular web servers, we've followed the # +# same format. Any configuration variable used here has the same # +# semantics as the corresponding variable in Apache. If we need # +# different functionality then a different name is used to avoid # +# confusion... # +# # +######################################################################## + + +AccessLog syslog +ErrorLog syslog +LogLevel info +PageLog syslog +PreserveJobHistory No +PreserveJobFiles No +AutoPurgeJobs Yes +MaxJobs 25 +MaxPrinterHistory 10 +#Printcap /etc/printcap +#PrintcapFormat BSD +RequestRoot /var/cups +#RemoteRoot remroot +User nobody +Group nogroup +RIPCache 512k +TempDir /var/cups +Port 631 +HostNameLookups Off +KeepAlive On +Browsing On +BrowseProtocols cups + + +Order Deny,Allow +Allow From 127.0.0.1 +Allow From 192.168.1.0/24 + + + +AuthType Basic +AuthClass System +Order Allow,Deny +Allow From All + diff --git a/net/cups/files/etc/cups/printers.conf b/net/cups/files/etc/cups/printers.conf new file mode 100644 index 0000000..88bba1b --- /dev/null +++ b/net/cups/files/etc/cups/printers.conf @@ -0,0 +1,23 @@ + +Info USB Printer +Location +DeviceURI usb:/dev/usb/lp0 +State Idle +Accepting Yes +JobSheets none none +QuotaPeriod 0 +PageLimit 0 +KLimit 0 + + + +Info Parallel Port Printer +Location +DeviceURI parallel:/dev/printers/0 +State Idle +Accepting Yes +JobSheets none none +QuotaPeriod 0 +PageLimit 0 +KLimit 0 + diff --git a/net/cups/patches/100-makefile-targets.patch b/net/cups/patches/100-makefile-targets.patch new file mode 100644 index 0000000..f72532d --- /dev/null +++ b/net/cups/patches/100-makefile-targets.patch @@ -0,0 +1,13 @@ +--- a/Makefile ++++ b/Makefile +@@ -20,8 +20,8 @@ include Makedefs + # Directories to make... + # + +-DIRS = cups filter backend berkeley cgi-bin driver locale man monitor \ +- notifier ppdc scheduler systemv test \ ++DIRS = cups filter backend berkeley cgi-bin driver monitor \ ++ ppdc scheduler systemv \ + $(PHPDIR) \ + conf data doc examples $(FONTS) templates + diff --git a/net/cups/patches/140-uname.patch b/net/cups/patches/140-uname.patch new file mode 100644 index 0000000..3261de6 --- /dev/null +++ b/net/cups/patches/140-uname.patch @@ -0,0 +1,11 @@ +--- a/configure ++++ b/configure +@@ -1966,7 +1966,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +-uname=`uname` ++uname=${UNAME:-`uname`} + uversion=`uname -r | sed -e '1,$s/^[^0-9]*\([0-9]*\)\.\([0-9]*\).*/\1\2/'` + uarch=`uname -m` + diff --git a/net/cups/patches/150-64bit_host_fix.patch b/net/cups/patches/150-64bit_host_fix.patch new file mode 100644 index 0000000..5cfdba5 --- /dev/null +++ b/net/cups/patches/150-64bit_host_fix.patch @@ -0,0 +1,64 @@ +--- a/cups-config.in ++++ b/cups-config.in +@@ -54,7 +54,7 @@ else + CFLAGS="$CFLAGS -I$includedir" + fi + +- if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then ++ if test $libdir != /usr/lib -a $libdir != /usr/lib -a $libdir != /usr/lib; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + fi +--- a/config-scripts/cups-3264.m4 ++++ b/config-scripts/cups-3264.m4 +@@ -108,7 +108,7 @@ case "$uname" in + LIB64CUPSIMAGE="64bit/libcupsimage.so.2" + LIB64DIR="$exec_prefix/lib" + if test -d /usr/lib64; then +- LIB64DIR="${LIB64DIR}64" ++ LIB64DIR="${LIB64DIR}" + fi + UNINSTALL64="uninstall64bit" + fi +--- a/config-scripts/cups-directories.m4 ++++ b/config-scripts/cups-directories.m4 +@@ -107,7 +107,7 @@ if test "$libdir" = "\${exec_prefix}/lib + ;; + Linux*) + if test -d /usr/lib64; then +- libdir="$exec_prefix/lib64" ++ libdir="$exec_prefix/lib" + fi + ;; + HP-UX*) +--- a/configure ++++ b/configure +@@ -10003,7 +10003,7 @@ if test "$libdir" = "\${exec_prefix}/lib + ;; + Linux*) + if test -d /usr/lib64; then +- libdir="$exec_prefix/lib64" ++ libdir="$exec_prefix/lib" + fi + ;; + HP-UX*) +@@ -10626,9 +10626,6 @@ case "$uname" in + LIB32CUPS="32bit/libcups.so.2" + LIB32CUPSIMAGE="32bit/libcupsimage.so.2" + LIB32DIR="$exec_prefix/lib" +- if test -d /usr/lib32; then +- LIB32DIR="${LIB32DIR}32" +- fi + UNINSTALL32="uninstall32bit" + fi + +@@ -10638,9 +10635,6 @@ case "$uname" in + LIB64CUPS="64bit/libcups.so.2" + LIB64CUPSIMAGE="64bit/libcupsimage.so.2" + LIB64DIR="$exec_prefix/lib" +- if test -d /usr/lib64; then +- LIB64DIR="${LIB64DIR}64" +- fi + UNINSTALL64="uninstall64bit" + fi + ;; diff --git a/net/cups/patches/160-ppdc.patch b/net/cups/patches/160-ppdc.patch new file mode 100644 index 0000000..e4da1f4 --- /dev/null +++ b/net/cups/patches/160-ppdc.patch @@ -0,0 +1,16 @@ +--- a/ppdc/Makefile ++++ b/ppdc/Makefile +@@ -239,12 +239,7 @@ framedhelp: + + genstrings: genstrings.o libcupsppdc.a ../cups/libcups.a \ + sample.drv ../data/media.defs +- echo Linking $@... +- $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o genstrings genstrings.o \ +- libcupsppdc.a ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) \ +- $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) +- echo Generating localization strings... +- ./genstrings >sample.c ++ echo Not Linking $@... + + + # diff --git a/net/curlftpfs/Makefile b/net/curlftpfs/Makefile new file mode 100644 index 0000000..cdeaa6a --- /dev/null +++ b/net/curlftpfs/Makefile @@ -0,0 +1,50 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=curlftpfs +PKG_VERSION:=0.9.2 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/curlftpfs +PKG_MD5SUM:=b452123f755114cd4461d56c648d9f12 + +PKG_BUILD_DEPENDS:=libiconv +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/curlftpfs + SECTION:=net + CATEGORY:=Network + SUBMENU:=Filesystem + DEPENDS:=+libcurl +libfuse +glib2 + TITLE:=CurlFtpFS + URL:=http://curlftpfs.sourceforge.net/ +endef + +define Package/curlftpfs/description + CurlFtpFS is a filesystem for accessing FTP hosts + based on FUSE and libcurl. +endef + +EXTRA_CFLAGS += \ + -I$(ICONV_PREFIX)/include \ + -I$(STAGING_DIR)/usr/include/fuse \ + -DICONV_CONST=const + +EXTRA_LDFLAGS += \ + -L$(INTL_PREFIX)/lib \ + -L$(ICONV_PREFIX)/lib \ + -lpthread + +define Package/curlftpfs/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/curlftpfs $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,curlftpfs)) + diff --git a/net/curlftpfs/patches/001-uclibc_mod.patch b/net/curlftpfs/patches/001-uclibc_mod.patch new file mode 100644 index 0000000..8eb1556 --- /dev/null +++ b/net/curlftpfs/patches/001-uclibc_mod.patch @@ -0,0 +1,37 @@ +diff -cr curlftpfs-0.9.2/ftpfs-ls.c curlftpfs-0.9.2-1/ftpfs-ls.c +*** curlftpfs-0.9.2/ftpfs-ls.c 2008-04-23 12:55:41.000000000 +0200 +--- curlftpfs-0.9.2-1/ftpfs-ls.c 2009-09-24 23:19:03.000000000 +0200 +*************** +*** 58,64 **** + "%5s" "%*c" + "%1023c", + mode, &nlink, user, group, &size, month, day, year, file); +! if (res < 9) { + res = sscanf(line, + "%11s" + "%32s" SPACES +--- 58,64 ---- + "%5s" "%*c" + "%1023c", + mode, &nlink, user, group, &size, month, day, year, file); +! if (res < 8) { + res = sscanf(line, + "%11s" + "%32s" SPACES +*************** +*** 69,75 **** + "%5s" "%*c" + "%1023c", + mode, user, group, &size, month, day, year, file); +! if (res < 8) { + return 0; + } + } +--- 69,75 ---- + "%5s" "%*c" + "%1023c", + mode, user, group, &size, month, day, year, file); +! if (res < 7) { + return 0; + } + } diff --git a/net/cutter/Makefile b/net/cutter/Makefile new file mode 100644 index 0000000..f9830b4 --- /dev/null +++ b/net/cutter/Makefile @@ -0,0 +1,43 @@ +# +# 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:=cutter +PKG_VERSION:=1.03 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://www.lowth.com/cutter/software/ +PKG_MD5SUM:=50093db9b64277643969ee75b83ebbd1 + +include $(INCLUDE_DIR)/package.mk + +define Package/cutter + SECTION:=net + CATEGORY:=Network + TITLE:=allows an user to abort TCP/IP connections + URL:=http://www.lowth.com/cutter/ + DEPENDS:=@BROKEN +endef + +define Package/cutter/description + Cutter is an open source program that allows Linux firewall + administrators to abort TCP/IP connections routed over the + firewall or router on which it is run. +endef + +define Build/Compile + $(TARGET_CC) $(PKG_BUILD_DIR)/cutter.c -o $(PKG_BUILD_DIR)/cutter +endef + +define Package/cutter/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/cutter $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,cutter)) diff --git a/net/daemonlogger/Makefile b/net/daemonlogger/Makefile new file mode 100644 index 0000000..3d7a9bf --- /dev/null +++ b/net/daemonlogger/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2007-2011 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:=daemonlogger +PKG_VERSION:=1.2.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=463 +PKG_SOURCE_URL:=http://www.snort.org/downloads/ +PKG_CAT:=zcat +PKG_MD5SUM:=acb64aa6cd5777e297569f100b5c39ee + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/daemonlogger + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +libdnet + TITLE:=Software Network Tap + URL:=http://www.snort.org/snort-downloads/additional-downloads +endef + +CONFIGURE_VARS += \ + BUILD_CC="$(TARGET_CC)" \ + HOSTCC="$(HOSTCC)" + +MAKE_FLAGS := CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)" + +define Package/daemonlogger/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/daemonlogger $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,daemonlogger)) diff --git a/net/dansguardian/Makefile b/net/dansguardian/Makefile new file mode 100644 index 0000000..bba2d8b --- /dev/null +++ b/net/dansguardian/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2008-2009 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:=dansguardian +PKG_VERSION:=2.10.1.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://dansguardian.org/downloads/2/Stable +PKG_MD5SUM:=0987a1c9bfbdf398118386f10279611a + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/dansguardian + SECTION:=net + DEPENDS:=+libpthread $(CXX_DEPENDS) +zlib + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=DansGuardian + URL:=http://dansguardian.org +endef + +define Package/dansguardian/conffiles +/etc/dansguardian/dansguardian.conf +endef + +CONFIGURE_VARS += \ + INCLUDES="" \ + CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \ + LIBS="-lpthread" \ + +define Build/Configure + $(call Build/Configure/Default,\ + --disable-clamav \ + --with-sysconfsubdir=dansguardian \ + --with-proxyuser=root \ + --with-proxygroup=root \ + --disable-pcre \ + ) +endef + +define Package/dansguardian/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dansguardian $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/dansguardian $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/share/dansguardian + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/dansguardian/transparent1x1.gif $(1)/usr/share/dansguardian/ + $(INSTALL_DIR) $(1)/usr/share/dansguardian/languages/ukenglish + $(CP) $(PKG_INSTALL_DIR)/usr/share/dansguardian/languages/ukenglish/* $(1)/usr/share/dansguardian/languages/ukenglish/ +endef + +$(eval $(call BuildPackage,dansguardian)) diff --git a/net/dansguardian/patches/001-include_dir.patch b/net/dansguardian/patches/001-include_dir.patch new file mode 100644 index 0000000..8a619f0 --- /dev/null +++ b/net/dansguardian/patches/001-include_dir.patch @@ -0,0 +1,29 @@ +--- a/configure ++++ b/configure +@@ -861,7 +861,7 @@ sysconfdir='${prefix}/etc' + sharedstatedir='${prefix}/com' + localstatedir='${prefix}/var' + includedir='${prefix}/include' +-oldincludedir='/usr/include' ++oldincludedir='${prefix}/usr/include' + docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' + infodir='${datarootdir}/info' + htmldir='${docdir}' +@@ -6317,7 +6317,7 @@ $as_echo_n "checking for zlib... " >&6; + # Check whether --with-zlib was given. + if test "${with_zlib+set}" = set; then + withval=$with_zlib; # check for header & func (in library) in given prefix +- CPPFLAGS="${CPPFLAGS} -I${withval}/include" ++ CPPFLAGS="${CPPFLAGS}" + if test "x$staticzlib" = "xtrue"; then + LIBS="-Bstatic -L${withval} -lz -Bdynamic ${LIBS}" + else +@@ -10042,7 +10042,7 @@ _ACEOF + if test "${with_libiconv+set}" = set; then + withval=$with_libiconv; # check for header & func (in library) in given prefix + if test "x$withval" != "x"; then +- CPPFLAGS="${CPPFLAGS} -I${withval}/include" ++ CPPFLAGS="${CPPFLAGS}" + LIBS="-L${withval}/lib -liconv ${LIBS}" + else + LIBS="-liconv ${LIBS}" diff --git a/net/dante/Makefile b/net/dante/Makefile new file mode 100644 index 0000000..535022e --- /dev/null +++ b/net/dante/Makefile @@ -0,0 +1,111 @@ +# +# Copyright (C) 2011 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:=dante +PKG_VERSION:=1.2.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.inet.no/dante/files/ +PKG_MD5SUM:=69b9d6234154d7d6a91fcbd98c68e62a + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += -D_GNU_SOURCE +CONFIGURE_ARGS += \ + --without-upnp \ + --without-pam \ + --disable-libwrap + +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/*.{a,so*,la} $(1)/usr/lib/ +endef + + +define Package/dante/default + TITLE:=Dante SOCKS + URL:=http://www.inet.no/dante/ +endef + +define Package/dante/default/description +Dante is a circuit-level firewall/proxy that can be used to provide convenient +and secure network connectivity, requiring only that the server Dante runs on +has external network connectivity. Dante is used daily by Fortune 100 companies +and large international organizations, either as a standard SOCKS server or as +a "reverse proxy". +endef + +define Package/libsocks + $(call Package/dante/default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= Library +endef + +define Package/libsocks/description +$(call Package/dante/default/description) +This package provides the shared libsocks library. +endef + +define Package/libsocks/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsocks.so* $(1)/usr/lib/ +endef + + +define Package/sockd + $(call Package/dante/default) + SUBMENU:=Web Servers/Proxies + SECTION:=net + CATEGORY:=Network + TITLE+= Daemon +endef + +define Package/sockd/description +$(call Package/dante/default/description) +This package provides the Dante sockd daemon. +endef + +define Package/sockd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/sockd $(1)/usr/sbin/ +endef + + +define Package/socksify + $(call Package/dante/default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE+= Client +endef + +define Package/socksify/description +$(call Package/dante/default/description) +This package provides the Dante socksify client. +endef + +define Package/socksify/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/socksify $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdsocks.so* $(1)/usr/lib/ +endef + + +$(eval $(call BuildPackage,libsocks)) +$(eval $(call BuildPackage,sockd)) +$(eval $(call BuildPackage,socksify)) diff --git a/net/dante/patches/001-automake-compat.patch b/net/dante/patches/001-automake-compat.patch new file mode 100644 index 0000000..4349a4b --- /dev/null +++ b/net/dante/patches/001-automake-compat.patch @@ -0,0 +1,482 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -16,7 +16,7 @@ echo "Configuring Dante ${version}${pren + + AM_INIT_AUTOMAKE(dante, ${version}${prename}) + AC_CONFIG_SRCDIR(include/common.h) +-AM_CONFIG_HEADER(include/autoconf.h) ++AM_CONFIG_HEADER(autoconfig-is-soo-stupid.h include/autoconf.h) + + AC_DEFINE(BAREFOOTD, 0, [we are Dante]) + +@@ -38,17 +38,6 @@ AC_PROG_CPP + + AM_CONDITIONAL(PRERELEASE, test x$prerelease != x) + +-#known keywords for --enable/disable-foo(=yes/no)? +-LTINTERNAL="dlopen|dlopen_self|dlopen_self_static|fast_install|libtool_lock|win32_dll|shared_with_static_runtimes|shared_with_static_runtimes_CXX|shared_with_static_runtimes_F77" +-KNOWN_KEYWORDS="$LTINTERNAL|shared|static|debug|warnings|diagnostic|profiling|linting|libwrap|preload|serverdl|clientdl|internal|pidfile|drt_fallback" +-for keyword in `set | egrep '^enable_' | sed -e 's/^enable_\(.*\)=.*/\1/'`; do +- echo $keyword | egrep "^(${KNOWN_KEYWORDS})$" > /dev/null +- if test $? -ne 0; then +- AC_MSG_WARN([unknown option '$keyword', ignoring ...]) +- sleep 10; +- fi +-done +- + case $host in + *-*-osf*) + AC_MSG_WARN([OSF support might be removed in the near future.]) +@@ -175,31 +164,6 @@ case $host in + #XXX make sure compiling with compiler options works + esac + +-AC_MSG_CHECKING([for support for -pipe compiler flag]) +-oCFLAGS=$CFLAGS +-CFLAGS="$CFLAGS -pipe" +-AC_TRY_RUN([ +-int main() +-{ +- return 0; +-}], [AC_MSG_RESULT([yes]) +- comp_flags="${comp_flags} -pipe"], +- AC_MSG_RESULT([no])) +-CFLAGS="$oCFLAGS" +- +-AC_MSG_CHECKING([for support for -Wbounded compiler flag]) +-oCFLAGS=$CFLAGS +-CFLAGS="$CFLAGS -Wbounded" +-AC_TRY_RUN([ +-int main() +-{ +- return 0; +-}], [AC_MSG_RESULT([yes]) +- comp_flags="${comp_flags} -Wbounded"], +- [AC_MSG_RESULT([no]) +- AC_DEFINE(__bounded__(a,b,c), , [empty __bounded__ macro])]) +-CFLAGS="$oCFLAGS" +- + AC_MSG_CHECKING([for compilation with debugging]) + AC_ARG_ENABLE(debug, + [ --enable-debug compile with debugging support], +@@ -608,43 +572,6 @@ else + fi], [AC_MSG_RESULT(no) + AC_MSG_WARN([performance in the server might be degraded without support for the SO_SNDLOWAT socket option])]) + +-AC_MSG_CHECKING([whether realloc with a NULL pointer calls malloc]) +-AC_TRY_RUN([ +-#include +-#ifndef NULL +-#define NULL (char *)0 +-#endif +- +-int main() +-{ +- /* will assume this test doesn\'t fail because of lack of memory */ +- if (realloc(NULL, 1) == NULL) +- return 1; +- else +- return 0; +-}], [AC_MSG_RESULT(yes)], +- [AC_DEFINE(HAVE_NOMALLOC_REALLOC, 1, [realloc never calls malloc]) +- AC_MSG_RESULT(no)]) +- +-AC_MSG_CHECKING([whether free can be called with NULL]) +-AC_TRY_RUN([ +-#include +-#ifndef NULL +-#define NULL (char *)0 +-#endif +- +-int main() +-{ +- /* will assume core dump/seg fault if it doesn\'t work */ +- free(NULL); +- return 0; +-}], [AC_MSG_RESULT(yes)], +- [AC_DEFINE(HAVE_NONULL_FREE, 1, [free does not accept NULL parameter]) +- AC_MSG_RESULT(no)]) +- +-#A good time to save the cache (preload code might fail) +-AC_CACHE_SAVE +- + m4_include(preload.m4) + + #construct SUBDIRS variable +@@ -722,31 +649,8 @@ case $host in + ;; + esac + +-AC_MSG_CHECKING([for CMSG_SPACE in sys/socket.h]) +-AC_TRY_RUN([ +-#include +-#include +-int main() +-{ +- int d = CMSG_SPACE(4); +- return 0; +-} +-], [AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_CMSG_SPACE, 1, CMSG_SPACE exists)], +- [AC_MSG_RESULT(no)]) +- +-AC_MSG_CHECKING([for CMSG_LEN in sys/socket.h]) +-AC_TRY_RUN([ +-#include +-#include +- +-int main() +-{ +- int d = CMSG_LEN(4); +- return 0; +-}], [AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_CMSG_LEN, 1, [CMSG_LEN exists])], +- [AC_MSG_RESULT(no)]) ++AC_DEFINE(HAVE_CMSG_SPACE, 1, [CMSG_SPACE exists]) ++AC_DEFINE(HAVE_CMSG_LEN, 1, [CMSG_LEN exists]) + + AC_MSG_CHECKING([for sa_len in sockaddr]) + AC_TRY_COMPILE([ +@@ -913,10 +817,6 @@ else + AC_MSG_RESULT([yes]) + fi + +-dnl determine GSSAPI support +-no_gssapi=t +-m4_include(gssapi.m4) +- + dnl compatibility library tests + m4_include(libscompat.m4) + +@@ -978,15 +878,6 @@ global: + fi + AC_SUBST(MAPOPT) + +-#expected select behaviour? +-unset nb_select_err +-L_UNCON_SELECT([], +- [nb_select_err=t]) +- +-if test x"${nb_select_err}" = xt; then +- AC_MSG_WARN([operations on nonblocking sockets might fail on this platform]) +-fi +- + AC_MSG_CHECKING([direct route fallback in client enabled]) + with_drtfallback=t + AC_ARG_ENABLE(drt-fallback, +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -180,63 +180,7 @@ selectcheck(s) + [AC_MSG_RESULT(no) + [$2]])]) + +-#can it really be this simple? +-#nope, doesn't handle coff files which also have no underscore +-AC_DEFUN([L_SYMBOL_UNDERSCORE], +-[AC_MSG_CHECKING(for object file type) +-AH_TEMPLATE([HAVE_NO_SYMBOL_UNDERSCORE], [platform symbol type]) +-AC_TRY_RUN([ +-/* look for ELF identification header at the start of argv[0] */ +- +-#include +-#include +-#include +- +-/* +- * ELF header, from ELF standard (Portable Formats Specification, +- * Version 1.1). +- */ +-char elfheader[] = { 0x7f, 'E', 'L', 'F' }; +- +-int +-main (argc, argv) +- int argc; +- char *argv[]; +-{ +- int fd; +- int len = sizeof(elfheader); +- char header[len]; +- +- if ((fd = open(argv[0], O_RDONLY, 0)) == -1) { +- perror("open"); +- exit(1); +- } +- if (read(fd, header, len) != len) { +- perror("read"); +- exit(1); +- } +- if (memcmp(header, elfheader, len) == 0) +- exit(0); /* pointy ears */ +- else +- exit(1); +-} +-], [AC_MSG_RESULT(elf) +- AC_DEFINE(HAVE_NO_SYMBOL_UNDERSCORE)], +- [ +- #XXX exceptions for coff platforms, should be detected automatically +- case $host in +- alpha*-dec-osf*) +- AC_DEFINE(HAVE_NO_SYMBOL_UNDERSCORE) +- AC_MSG_RESULT(coff) +- ;; +- *-*-hpux*) #XXX apparently does not use underscore +- AC_DEFINE(HAVE_NO_SYMBOL_UNDERSCORE) +- AC_MSG_RESULT(a.out?) +- ;; +- *) +- AC_MSG_RESULT(a.out) +- ;; +- esac])]) ++AC_DEFUN([L_SYMBOL_UNDERSCORE], [AC_DEFINE(HAVE_NO_SYMBOL_UNDERSCORE, [1], [Automake sucks])]) + + + dnl addproto - generate AC_DEFINE statements +--- a/preload.m4 ++++ b/preload.m4 +@@ -517,91 +517,6 @@ AC_DEFINE_UNQUOTED(LIBRARY_LIBC, "${LIBC + + L_SYMBOL_UNDERSCORE() + +-AC_MSG_CHECKING([for working dlsym]) +-AC_TRY_RUN([ +-#include +-#include +- +-#include "include/symbols.h" +- +-int main() +-{ +- void *lib; +- void *sym; +- +- if ((lib = dlopen(LIBRARY_CONNECT, DL_LAZY)) == NULL) { +- fprintf(stderr, "dlopen: %s", dlerror()); +- return 1; +- } +- (void)dlerror(); +- if ((sym = dlsym(lib, SYMBOL_CONNECT)) == NULL) { +- fprintf(stderr, "dlsym: %s", dlerror()); +- return 1; +- } +- return 0; +-}], [AC_MSG_RESULT(yes)], +- [AC_MSG_RESULT(no) +- no_preload_client=t +- no_preload_server=t +- no_preload=t]) +- +-AC_MSG_CHECKING([for working RTLD_NEXT]) +-AC_TRY_RUN([ +-#define _GNU_SOURCE +-#include +-#include +- +-#include "include/symbols.h" +- +-int main() +-{ +- void *sym; +- +- if ((sym = dlsym(RTLD_NEXT, SYMBOL_READ)) == NULL) { +- fprintf(stderr, "dlsym: %s", dlerror()); +- return 1; +- } +- return 0; +-}], [AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_RTLD_NEXT, 1, [have working dlsym RTLD_NEXT])], +- [AC_MSG_RESULT(no) +- AC_DEFINE(HAVE_RTLD_NEXT, 0, [no working dlsym RTLD_NEXT])]) +- +-#solaris might block preloading +-AC_MSG_CHECKING([libc preload blocking]) +-AC_TRY_RUN([ +-#include +-#include +-#include +-int +-main(int argc, char *argv[]) +-{ +- char buf[1024]; +- +- strcpy(buf, "lari -V "); +- strcat(buf, argv[0]); +- strcat(buf, " | grep read | grep protected > /dev/null"); +- +- /* +- * return error if 'protected' +- * (ignore errors, not indicative of blocking) */ +- if (system(buf) == 0) +- return 1; +- else +- return 0; +-} +- +-ssize_t +-read(d, buf, nbytes) +- int d; +- void *buf; +- size_t nbytes; +-{ +- return 0; +-} +-], [AC_MSG_RESULT(no)], +- [AC_MSG_RESULT(yes) +- AC_MSG_WARN([this platform blocks preloading of libraries]) +- blocked_preload=t]) ++AC_DEFINE(HAVE_RTLD_NEXT, 1, [have working dlsym RTLD_NEXT]) + + AC_CONFIG_FILES(bin/socksify) +--- a/libscompat.m4 ++++ b/libscompat.m4 +@@ -1,70 +1,6 @@ + dnl libscompat.m4 - tests related to replacement code in libscompat directory + +-AC_MSG_CHECKING([for __attribute__ support]) +-AC_TRY_RUN([ +-#include +- +-void errfunc(void) __attribute((noreturn)); +- +-void errfunc(void) +-{ +- exit(0); +-} +- +-int main() +-{ +- errfunc(); +-}], [AC_MSG_RESULT([yes])], +- [AC_MSG_RESULT([no]) +- AC_DEFINE(__attribute__(a), , [empty __attribute__ macro])]) +- +-AC_MSG_CHECKING([for __printf__ attribute support]) +-if test x"$have_suncc" = xt; then +- AC_MSG_RESULT([disabled for sun cc]) +- AC_DEFINE(format(a,b,c), , [empty format attribute macro]) +-else +- AC_TRY_RUN([ +-#include +- +-void func(const char *fmt, ...) +- __attribute__((format(__printf__, 1, 2))); +- +-void func(const char *fmt, ...) { +- (void)fmt; +- return; +-} +- +-int main() +-{ +- func("foo"); +- return 0; +-}], [AC_MSG_RESULT([yes])], +- [AC_MSG_RESULT([no]) +- AC_DEFINE(format(a,b,c), , [empty format attribute macro])]) +-fi +- +-AC_MSG_CHECKING([for timer macros]) +-AC_TRY_RUN([ +-#include +- +-int main() +-{ +- struct timeval tv, tv2, tv3; +- +- tv.tv_sec = 0; +- tv.tv_usec = 0; +- tv2.tv_sec = 0; +- tv2.tv_usec = 0; +- tv3.tv_sec = 0; +- tv3.tv_usec = 0; +- +- timeradd(&tv, &tv2, &tv3); +- timersub(&tv3, &tv2, &tv); +- +- return 0; }], +-[AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_TIMER_MACROS, 1, [timeradd(), timersub etc. exist in sys/time.h])], +-[AC_MSG_RESULT(no)]) ++AC_DEFINE(HAVE_TIMER_MACROS, 1, [timeradd(), timersub etc. exist in sys/time.h]) + + AC_CHECK_FUNCS(daemon difftime getifaddrs freeifaddrs hstrerror inet_aton) + AC_CHECK_FUNCS(inet_pton issetugid memmove seteuid setegid) +@@ -72,53 +8,7 @@ AC_CHECK_FUNCS(setproctitle sockatmark s + AC_CHECK_FUNCS(bzero) + #inet_ntoa - only checked for incorrect behavior + +-#try to detect gcc bug (irix 64 problem, affects among others inet_ntoa) +-AC_MSG_CHECKING([for incorrect inet_ntoa behaviour]) +-AC_TRY_RUN([ +-#include +-#include +-#include +-#include +-int main(void) +-{ +- struct sockaddr_in addr; +- char *a, *b = "195.195.195.195"; +- addr.sin_addr.s_addr = inet_addr(b); +- a = inet_ntoa(addr.sin_addr); +- if (strcmp(a, b) == 0) +- return 1; +- else +- return 0; +-} +-], [AC_DEFINE(HAVE_BROKEN_INET_NTOA, 1, [platform bug]) +- AC_MSG_RESULT(yes) +- ac_cv_func_inet_ntoa=no], +- AC_MSG_RESULT(no)) +- +-if test x${ac_cv_func_sockatmark} = xyes; then +- AC_MSG_CHECKING([for working sockatmark]) +- AC_TRY_RUN([ +-#include +-#include +- +-int +-main() +-{ +- int s; +- int r; +- +- if ((s = socket(PF_UNIX, SOCK_STREAM, 0)) == -1) +- return 1; +- if ((r = sockatmark(s)) == -1) +- return 1; +- if (r == 0) +- return 0; +- else +- return 1; /* would likely indicate an error */ +-}], [AC_MSG_RESULT(yes)], +- [AC_MSG_RESULT(no) +- ac_cv_func_sockatmark=no]) +-fi ++ac_cv_func_sockatmark=no + + #only compile files that are needed + unset LIBSCSRC +@@ -139,24 +29,3 @@ AC_SUBST([LIBSCSRC]) + if test x${ac_cv_func_bzero} = xno; then + AC_DEFINE(bzero(b, len), memset((b), 0, (len)), [bzero replacement]) + fi +- +-#causes problems with packaging, allow test to be turned off +-AC_ARG_WITH(glibc-secure, +-[ --without-glibc-secure disable libc_enable_secure check @<:@default=detect@:>@], +-[GLIBCSEC=$withval]) +- +-if test "${GLIBCSEC}" != no; then +- AC_MSG_CHECKING([for __libc_enable_secure]) +- AC_TRY_RUN([ +-extern int __libc_enable_secure; +- +-int main() +-{ +- if (__libc_enable_secure == 0) +- return 0; +- +- return 1; +-}],[AC_MSG_RESULT([yes]) +- AC_DEFINE(HAVE_LIBC_ENABLE_SECURE, 1, [linux version of issetugid()])], +- AC_MSG_RESULT([no])) +-fi diff --git a/net/dante/patches/100-do-not-use-defdname.patch b/net/dante/patches/100-do-not-use-defdname.patch new file mode 100644 index 0000000..37b91a9 --- /dev/null +++ b/net/dante/patches/100-do-not-use-defdname.patch @@ -0,0 +1,42 @@ +--- a/lib/addressmatch.c ++++ b/lib/addressmatch.c +@@ -399,18 +399,6 @@ addrmatch(rule, address, protocol, alias + if (hostareeq(rule->addr.domain, hostent->h_name) + || hostisinlist(rule->addr.domain, (const char **)hostent->h_aliases)) + matched = 1; +-#if !HAVE_NO_RESOLVESTUFF +- else if (strchr(hostent->h_name, '.') == NULL) { +- /* if hostname we got is non-qualified, try to qualify it. */ +- char fqdn[MAXHOSTNAMELEN]; +- +- snprintf(fqdn, sizeof(fqdn), "%s.%s", +- hostent->h_name, _res.defdname); +- +- if (hostareeq(rule->addr.domain, fqdn)) +- matched = 1; +- } +-#endif /* !HAVE_NO_RESOLVESTUFF */ + } + + if (!matched && alias) { +@@ -465,20 +453,6 @@ addrmatch(rule, address, protocol, alias + matched = 1; + break; + } +-#if !HAVE_NO_RESOLVESTUFF +- else if (strchr(ip->h_name, '.') == NULL) { +- /* if hostname we got is non-qualified, try to qualify it. */ +- char fqdn[MAXHOSTNAMELEN]; +- +- snprintf(fqdn, sizeof(fqdn), "%s.%s", +- ip->h_name, _res.defdname); +- +- if (hostareeq(rule->addr.domain, fqdn)) { +- matched = 1; +- break; +- } +- } +-#endif /* !HAVE_NO_RESOLVESTUFF */ + } + + hostentfree(host); diff --git a/net/dante/patches/200-fix-RTLD_NEXT.patch b/net/dante/patches/200-fix-RTLD_NEXT.patch new file mode 100644 index 0000000..7281ba6 --- /dev/null +++ b/net/dante/patches/200-fix-RTLD_NEXT.patch @@ -0,0 +1,36 @@ +--- a/lib/address.c ++++ b/lib/address.c +@@ -45,11 +45,12 @@ + + #include "interposition.h" + +-#ifndef __USE_GNU +-#define __USE_GNU /* XXX for RTLD_NEXT on Linux */ +-#endif /* !__USE_GNU */ + #include + ++#ifndef RTLD_NEXT ++#define RTLD_NEXT ((void *) -1l) ++#endif ++ + static const char rcsid[] = + "$Id: address.c,v 1.177.2.2 2010/05/24 16:38:36 karls Exp $"; + +--- a/dlib/interposition.c ++++ b/dlib/interposition.c +@@ -66,11 +66,12 @@ sendto(HAVE_PROT_SENDTO_1, HAVE_PROT_SEN + HAVE_PROT_SENDTO_4, HAVE_PROT_SENDTO_5, HAVE_PROT_SENDTO_6); + #endif + +-#ifndef __USE_GNU +-#define __USE_GNU /* XXX for RTLD_NEXT on Linux */ +-#endif /* !__USE_GNU */ + #include + ++#ifndef RTLD_NEXT ++#define RTLD_NEXT ((void *) -1l) ++#endif ++ + #undef accept + #undef bind + #undef bindresvport diff --git a/net/darkstat/Makefile b/net/darkstat/Makefile new file mode 100644 index 0000000..f0013c9 --- /dev/null +++ b/net/darkstat/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2007-2012 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:=darkstat +PKG_VERSION:=3.0.715 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://unix4lyfe.org/darkstat +PKG_MD5SUM:=5b7abc7538dcd8e30667dac150e81d77 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/darkstat + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +zlib + TITLE:=Network bandwidth monitor + URL:=http://unix4lyfe.org/darkstat/ +endef + +define Package/darkstat/description +darkstat is a packet sniffer that runs as a background process on a cable/DSL +router, gathers all sorts of statistics about network usage, and serves them +over HTTP. +endef + +define Package/darkstat/conffiles +/etc/config/darkstat +endef + +CONFIGURE_ARGS += \ + --disable-debug \ + --with-chroot-dir=/var/empty + +TARGET_CFLAGS += -std=gnu99 + +define Build/Compile + $(HOSTCC) $(PKG_BUILD_DIR)/static/c-ify.c \ + -o $(PKG_BUILD_DIR)/c-ify + $(call Build/Compile/Default) +endef + +define Package/darkstat/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/darkstat $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/darkstat.init $(1)/etc/init.d/darkstat + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/darkstat.config $(1)/etc/config/darkstat +endef + +$(eval $(call BuildPackage,darkstat)) diff --git a/net/darkstat/files/darkstat.config b/net/darkstat/files/darkstat.config new file mode 100644 index 0000000..f83760e --- /dev/null +++ b/net/darkstat/files/darkstat.config @@ -0,0 +1,4 @@ +config darkstat + option interface 'lan' +# option httpaddr '0.0.0.0' +# option httpport '667' diff --git a/net/darkstat/files/darkstat.init b/net/darkstat/files/darkstat.init new file mode 100644 index 0000000..8499e3e --- /dev/null +++ b/net/darkstat/files/darkstat.init @@ -0,0 +1,34 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2012 OpenWrt.org + +START=60 +RUN_D=/var/empty +PID_F=$RUN_D/darkstat.pid + +start() { + mkdir -p $RUN_D + . /lib/functions/network.sh + config_load darkstat + config_foreach start_darkstat darkstat +} + +start_darkstat() { + local cfg="$1" + config_get interface "$cfg" interface + config_get httpaddr "$cfg" httpaddr + config_get httpport "$cfg" httpport + + network_get_device ifname "$interface" && { + /usr/sbin/darkstat --verbose \ + -i "$ifname" \ + ${httpaddr:+-b "$httpaddr"} \ + ${httpport:+-p "$httpport"} \ + --chroot $RUN_D \ + --pidfile $PID_F + } +} + +stop() { + service_kill darkstat $PID_F + rm -f $PID_F +} diff --git a/net/ddns-scripts/Makefile b/net/ddns-scripts/Makefile new file mode 100644 index 0000000..651c623 --- /dev/null +++ b/net/ddns-scripts/Makefile @@ -0,0 +1,42 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=ddns-scripts +PKG_VERSION:=1.0.0 +PKG_RELEASE:=21 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/ddns-scripts + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=Dynamic DNS Scripts + PKGARCH:=all +endef + +define Package/ddns-scripts/description + A highly configurable set of scripts for doing + dynamic dns updates +endef + +define Build/Prepare +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/ddns-scripts/conffiles +/etc/config/ddns +endef + +define Package/ddns-scripts/install + $(INSTALL_DIR) $(1) + $(CP) ./files/* $(1)/ +endef + +$(eval $(call BuildPackage,ddns-scripts)) diff --git a/net/ddns-scripts/files/etc/config/ddns b/net/ddns-scripts/files/etc/config/ddns new file mode 100644 index 0000000..740f87f --- /dev/null +++ b/net/ddns-scripts/files/etc/config/ddns @@ -0,0 +1,95 @@ +################################################################# +# In order to enable dynamic dns you need at least one section, +# and in that seciton the "enabled" option must be set to one +# +# Each section represents an update to a different service +# +# You specify your domain name, your username and your password +# with the optins "domain", "username" and "password" respectively +# +# Next you need to specify the name of the service you are +# connecting to "eg. dyndns.org". The format of the update +# urls for several different dynamic dns services is specified +# in the /usr/lib/ddns/services file. This list is hardly complete +# as there are many, many different dynamic dns services. If your +# service is on the list you can merely specify it with the +# "service_name" option. Otherwise you will need to determine +# the format of the url to update with. You can either add an +# entry to the /usr/lib/ddns/services file or specify this with +# the "update_url" option. +# +# We also need to specify the source of the ip address to associate with +# your domain. The "ip_source" option can be "network", "interface" +# or "web", with "network" as the default. +# +# If "ip_source" is "network" you specify a network section in your +# /etc/network config file (e.g. "wan", which is the default) with +# the "ip_network" option. If you specify "wan", you will update +# with whatever the ip for your wan is. +# +# If "ip_source" is "interface" you specify a hardware interface +# (e.g. "eth1") and whatever the current ip of this interface is +# will be associated with the domain when an update is performed. +# +# If "ip_source" is "script" you specify a script to obtain ip address. +# The "ip_script" option should contain path to your script. +# +# The last possibility is that "ip_source" is "web", which means +# that in order to obtain our ip address we will connect to a +# website, and the first valid ip address listed on that page +# will be assumed to be ours. If you are behind another firewall +# this is the best option since none of the local networks or +# interfaces will have the external ip. The website to connect +# to is specified by the "ip_url" option. You may specify multiple +# urls in the option, separated by whitespace. +# +# Finally we need to specify how often to check whether we need +# to check whether the ip address has changed (and if so update +# it) and how often we need to force an update ( many services +# will expire your domain if you don't connect and do an update +# every so often). Use the "check_interval" to specify how +# often to check whether an update is necessary, the "retry_interval" +# to specify how often to retry in case the update has failed, and +# the "force_interval" option to specify how often to force an +# update. Specify the units for these values with the "check_unit", +# the "retry_init" and the "force_unit" options. Units can be +# "days", "hours", "minutes" or "seconds". The default force_unit +# is hours, the default retry_unit is seconds and the default +# check_unit is seconds. The default check_interval is 600 seconds, +# or ten minutes. The default retry_interval is 60 seconds, or one +# minute. The default force_interval is 72 hours or 3 days. +# +# +######################################################### + +config service "myddns" + option enabled "0" + option interface "wan" + + option service_name "dyndns.org" + option domain "mypersonaldomain.dyndns.org" + option username "myusername" + option password "mypassword" + + option force_interval "72" + option force_unit "hours" + option check_interval "10" + option check_unit "minutes" + option retry_interval "60" + option retry_unit "seconds" + + #option ip_source "network" + #option ip_network "wan" + + #option ip_source "interface" + #option ip_interface "eth0.1" + + #option ip_source "script" + #option ip_script "path to your scrip" + + option ip_source "web" + option ip_url "http://checkip.dyndns.com/" + + #option update_url "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]" + + diff --git a/net/ddns-scripts/files/etc/hotplug.d/iface/25-ddns b/net/ddns-scripts/files/etc/hotplug.d/iface/25-ddns new file mode 100644 index 0000000..4495b5d --- /dev/null +++ b/net/ddns-scripts/files/etc/hotplug.d/iface/25-ddns @@ -0,0 +1,9 @@ +#!/bin/sh + +. /usr/lib/ddns/dynamic_dns_functions.sh + +if [ "$ACTION" = "ifup" ]; then + start_daemon_for_all_ddns_sections "$INTERFACE" +fi + + diff --git a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh new file mode 100644 index 0000000..3d435d3 --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh @@ -0,0 +1,136 @@ +# /usr/lib/dynamic_dns/dynamic_dns_functions.sh +# +# Written by Eric Paul Bishop, Janary 2008 +# Distributed under the terms of the GNU General Public License (GPL) version 2.0 +# +# This script is (loosely) based on the one posted by exobyte in the forums here: +# http://forum.openwrt.org/viewtopic.php?id=14040 + + + +. /lib/functions.sh +. /lib/functions/network.sh + + +#loads all options for a given package and section +#also, sets all_option_variables to a list of the variable names +load_all_config_options() +{ + pkg_name="$1" + section_id="$2" + + ALL_OPTION_VARIABLES="" + # this callback loads all the variables + # in the section_id section when we do + # config_load. We need to redefine + # the option_cb for different sections + # so that the active one isn't still active + # after we're done with it. For reference + # the $1 variable is the name of the option + # and $2 is the name of the section + config_cb() + { + if [ ."$2" = ."$section_id" ]; then + option_cb() + { + ALL_OPTION_VARIABLES="$ALL_OPTION_VARIABLES $1" + } + else + option_cb() { return 0; } + fi + } + + + config_load "$pkg_name" + for var in $ALL_OPTION_VARIABLES + do + config_get "$var" "$section_id" "$var" + done +} + + +get_current_ip() +{ + + #if ip source is not defined, assume we want to get ip from wan + if [ "$ip_source" != "interface" ] && [ "$ip_source" != "web" ] && [ "$ip_source" != "script" ] + then + ip_source="network" + fi + + if [ "$ip_source" = "network" ] + then + if [ -z "$ip_network" ] + then + ip_network="wan" + fi + fi + + current_ip=''; + if [ "$ip_source" = "network" ] + then + network_get_ipaddr current_ip "$ip_network" || return + elif [ "$ip_source" = "interface" ] + then + current_ip=$(ifconfig $ip_interface | grep -o 'inet addr:[0-9.]*' | grep -o "$ip_regex") + elif [ "$ip_source" = "script" ] + then + # get ip from script + current_ip=$($ip_script) + else + # get ip from web + # we check each url in order in ip_url variable, and if no ips are found we use dyndns ip checker + # ip is set to FIRST expression in page that matches the ip_regex regular expression + for addr in $ip_url + do + if [ -z "$current_ip" ] + then + current_ip=$(echo $( wget -O - $addr 2>/dev/null) | grep -o "$ip_regex") + fi + done + + #here we hard-code the dyndns checkip url in case no url was specified + if [ -z "$current_ip" ] + then + current_ip=$(echo $( wget -O - http://checkip.dyndns.org 2>/dev/null) | grep -o "$ip_regex") + fi + fi + + echo "$current_ip" +} + + +verbose_echo() +{ + if [ "$verbose_mode" = 1 ] + then + echo $1 + fi +} + +start_daemon_for_all_ddns_sections() +{ + local event_interface="$1" + + SECTIONS="" + config_cb() + { + SECTIONS="$SECTIONS $2" + } + config_load "ddns" + + for section in $SECTIONS + do + local iface + config_get iface "$section" interface "wan" + [ "$iface" = "$event_interface" ] || continue + /usr/lib/ddns/dynamic_dns_updater.sh $section 0 > /dev/null 2>&1 & + done +} + +monotonic_time() +{ + local uptime + read uptime < /proc/uptime + echo "${uptime%%.*}" +} diff --git a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh new file mode 100755 index 0000000..580bed8 --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh @@ -0,0 +1,354 @@ +#!/bin/sh +# /usr/lib/dynamic_dns/dynamic_dns_updater.sh +# +# Written by Eric Paul Bishop, Janary 2008 +# Distributed under the terms of the GNU General Public License (GPL) version 2.0 +# +# This script is (loosely) based on the one posted by exobyte in the forums here: +# http://forum.openwrt.org/viewtopic.php?id=14040 +# + +. /usr/lib/ddns/dynamic_dns_functions.sh + + +service_id=$1 +if [ -z "$service_id" ] +then + echo "ERRROR: You must specify a service id (the section name in the /etc/config/ddns file) to initialize dynamic DNS." + return 1 +fi + +#default mode is verbose_mode, but easily turned off with second parameter +verbose_mode="1" +if [ -n "$2" ] +then + verbose_mode="$2" +fi + +############################################################### +# Leave this comment here, to clearly document variable names +# that are expected/possible +# +# Now use load_all_config_options to load config +# options, which is a much more flexible solution. +# +# +#config_load "ddns" +# +#config_get enabled $service_id enabled +#config_get service_name $service_id service_name +#config_get update_url $service_id update_url +# +# +#config_get username $service_id username +#config_get password $service_id password +#config_get domain $service_id domain +# +# +#config_get use_https $service_id use_https +#config_get cacert $service_id cacert +# +#config_get ip_source $service_id ip_source +#config_get ip_interface $service_id ip_interface +#config_get ip_network $service_id ip_network +#config_get ip_url $service_id ip_url +# +#config_get force_interval $service_id force_interval +#config_get force_unit $service_id force_unit +# +#config_get check_interval $service_id check_interval +#config_get check_unit $service_id check_unit +######################################################### +load_all_config_options "ddns" "$service_id" + + +#some defaults +if [ -z "$check_interval" ] +then + check_interval=600 +fi + +if [ -z "$retry_interval" ] +then + retry_interval=60 +fi + +if [ -z "$check_unit" ] +then + check_unit="seconds" +fi + + +if [ -z "$force_interval" ] +then + force_interval=72 +fi + +if [ -z "$force_unit" ] +then + force_unit="hours" +fi + +if [ -z "$use_https" ] +then + use_https=0 +fi + + + +#some constants + +if [ "x$use_https" = "x1" ] +then + retrieve_prog="/usr/bin/curl " + if [ -f "$cacert" ] + then + retrieve_prog="${retrieve_prog}--cacert $cacert " + elif [ -d "$cacert" ] + then + retrieve_prog="${retrieve_prog}--capath $cacert " + fi +else + retrieve_prog="/usr/bin/wget -O - "; +fi + +service_file="/usr/lib/ddns/services" + +ip_regex="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}" + +NEWLINE_IFS=' +' + + +#determine what update url we're using if the service_name is supplied +if [ -n "$service_name" ] +then + #remove any lines not containing data, and then make sure fields are enclosed in double quotes + quoted_services=$(cat $service_file | grep "^[\t ]*[^#]" | awk ' gsub("\x27", "\"") { if ($1~/^[^\"]*$/) $1="\""$1"\"" }; { if ( $NF~/^[^\"]*$/) $NF="\""$NF"\"" }; { print $0 }' ) + + + #echo "quoted_services = $quoted_services" + OLD_IFS=$IFS + IFS=$NEWLINE_IFS + for service_line in $quoted_services + do + #grep out proper parts of data and use echo to remove quotes + next_name=$(echo $service_line | grep -o "^[\t ]*\"[^\"]*\"" | xargs -r -n1 echo) + next_url=$(echo $service_line | grep -o "\"[^\"]*\"[\t ]*$" | xargs -r -n1 echo) + + if [ "$next_name" = "$service_name" ] + then + update_url=$next_url + fi + done + IFS=$OLD_IFS +fi + +if [ "x$use_https" = x1 ] +then + update_url=$(echo $update_url | sed -e 's/^http:/https:/') +fi + + +verbose_echo "update_url=$update_url" + + + +#if this service isn't enabled then quit +if [ "$enabled" != "1" ] +then + return 0 +fi + + + + + +#compute update interval in seconds +case "$force_unit" in + "days" ) + force_interval_seconds=$(($force_interval*60*60*24)) + ;; + "hours" ) + force_interval_seconds=$(($force_interval*60*60)) + ;; + "minutes" ) + force_interval_seconds=$(($force_interval*60)) + ;; + "seconds" ) + force_interval_seconds=$force_interval + ;; + * ) + #default is hours + force_interval_seconds=$(($force_interval*60*60)) + ;; +esac + + + +#compute check interval in seconds +case "$check_unit" in + "days" ) + check_interval_seconds=$(($check_interval*60*60*24)) + ;; + "hours" ) + check_interval_seconds=$(($check_interval*60*60)) + ;; + "minutes" ) + check_interval_seconds=$(($check_interval*60)) + ;; + "seconds" ) + check_interval_seconds=$check_interval + ;; + * ) + #default is seconds + check_interval_seconds=$check_interval + ;; +esac + + + +#compute retry interval in seconds +case "$retry_unit" in + "days" ) + retry_interval_seconds=$(($retry_interval*60*60*24)) + ;; + "hours" ) + retry_interval_seconds=$(($retry_interval*60*60)) + ;; + "minutes" ) + retry_interval_seconds=$(($retry_interval*60)) + ;; + "seconds" ) + retry_interval_seconds=$retry_interval + ;; + * ) + #default is seconds + retry_interval_seconds=$retry_interval + ;; +esac + + + +verbose_echo "force seconds = $force_interval_seconds" +verbose_echo "check seconds = $check_interval_seconds" + +#kill old process if it exists & set new pid file +if [ -d /var/run/dynamic_dns ] +then + #if process is already running, stop it + if [ -e "/var/run/dynamic_dns/$service_id.pid" ] + then + old_pid=$(cat /var/run/dynamic_dns/$service_id.pid) + test_match=$(ps | grep "^[\t ]*$old_pid") + verbose_echo "old process id (if it exists) = \"$test_match\"" + if [ -n "$test_match" ] + then + kill $old_pid + fi + fi + +else + #make dir since it doesn't exist + mkdir /var/run/dynamic_dns +fi +echo $$ > /var/run/dynamic_dns/$service_id.pid + + + + +#determine when the last update was +current_time=$(monotonic_time) +last_update=$(( $current_time - (2*$force_interval_seconds) )) +if [ -e "/var/run/dynamic_dns/$service_id.update" ] +then + last_update=$(cat /var/run/dynamic_dns/$service_id.update) +fi +time_since_update=$(($current_time - $last_update)) + + +human_time_since_update=$(( $time_since_update / ( 60 * 60 ) )) +verbose_echo "time_since_update = $human_time_since_update hours" + + + +#do update and then loop endlessly, checking ip every check_interval and forcing an updating once every force_interval + +while [ true ] +do + registered_ip=$(echo $(nslookup "$domain" 2>/dev/null) | grep -o "Name:.*" | grep -o "$ip_regex") + current_ip=$(get_current_ip) + + + current_time=$(monotonic_time) + time_since_update=$(($current_time - $last_update)) + + + verbose_echo "Running IP check..." + verbose_echo "current system ip = $current_ip" + verbose_echo "registered domain ip = $registered_ip" + + + if [ "$current_ip" != "$registered_ip" ] || [ $force_interval_seconds -lt $time_since_update ] + then + verbose_echo "update necessary, performing update ..." + + #do replacement + final_url=$update_url + for option_var in $ALL_OPTION_VARIABLES + do + if [ "$option_var" != "update_url" ] + then + replace_name=$(echo "\[$option_var\]" | tr 'a-z' 'A-Z') + replace_value=$(eval echo "\$$option_var") + replace_value=$(echo $replace_value | sed -f /usr/lib/ddns/url_escape.sed) + final_url=$(echo $final_url | sed s^"$replace_name"^"$replace_value"^g ) + fi + done + final_url=$(echo $final_url | sed s^"\[HTTPAUTH\]"^"${username//^/\\^}${password:+:${password//^/\\^}}"^g ) + final_url=$(echo $final_url | sed s/"\[IP\]"/"$current_ip"/g ) + + + verbose_echo "updating with url=\"$final_url\"" + + #here we actually connect, and perform the update + update_output=$( $retrieve_prog "$final_url" ) + if [ $? -gt 0 ] + then + verbose_echo "update failed" + sleep $retry_interval_seconds + continue + fi + + verbose_echo "Update Output:" + verbose_echo "$update_output" + verbose_echo "" + + #save the time of the update + current_time=$(monotonic_time) + last_update=$current_time + time_since_update='0' + registered_ip=$current_ip + + human_time=$(date) + verbose_echo "update complete, time is: $human_time" + + echo "$last_update" > "/var/run/dynamic_dns/$service_id.update" + else + human_time=$(date) + human_time_since_update=$(( $time_since_update / ( 60 * 60 ) )) + verbose_echo "update unnecessary" + verbose_echo "time since last update = $human_time_since_update hours" + verbose_echo "the time is now $human_time" + fi + + #sleep for 10 minutes, then re-check ip && time since last update + sleep $check_interval_seconds +done + +#should never get here since we're a daemon, but I'll throw it in anyway +return 0 + + + + diff --git a/net/ddns-scripts/files/usr/lib/ddns/services b/net/ddns-scripts/files/usr/lib/ddns/services new file mode 100644 index 0000000..1e6b6b9 --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/services @@ -0,0 +1,59 @@ +# This file contains the update urls for various dynamic dns services. +# Column one contains the service name, column two contains the update url. +# within the update url there are 4 variables you can use: [USERNAME], +# [PASSWORD], [DOMAIN] and [IP]. These are substituted for the username, +# password, and domain name specified in the /etc/config/ddns file when an +# update is performed. The IP is substituted for the current ip address of the +# router. These variables are case sensitive, while urls generally are not, so +# if you need to enter the same text in the url (which seems very unlikely) put +# that text in lowercase, while the variables should remain in uppercase + +"dyndns.org" "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]" +"changeip.com" "http://[USERNAME]:[PASSWORD]@nic.changeip.com/nic/update?u=[USERNAME]&p=[PASSWORD]&cmd=update&hostname=[DOMAIN]&ip=[IP]" +"zoneedit.com" "http://[USERNAME]:[PASSWORD]@dynamic.zoneedit.com/auth/dynamic.html?host=[DOMAIN]&dnsto=[IP]" +"free.editdns.net" "http://dyndns-free.editdns.net/api/dynLinux.php?p=[PASSWORD]&r=[DOMAIN]" + +#noip is an alias of no-ip, so allow both names for the same service +"no-ip.com" "http://[USERNAME]:[PASSWORD]@dynupdate.no-ip.com/nic/update?hostname=[DOMAIN]&myip=[IP]" +"noip.com" "http://[USERNAME]:[PASSWORD]@dynupdate.no-ip.com/nic/update?hostname=[DOMAIN]&myip=[IP]" + +#freedns.afraid.org is weird, you just need an update code, for which we use the password variable +"freedns.afraid.org" "http://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]" + +#### ADD YOURS HERE! ###################################################################################### +# # +# There are TONS of dynamic dns services out there. There's a huge list of them at: # +# http://www.dmoz.org/Computers/Software/Internet/Servers/Address_Management/Dynamic_DNS_Services/ # +# If anyone has time they could update this file to be compatible with a bunch of them # +# # +########################################################################################################### + +# DNS Max and resellers' update urls +"dnsmax.com" "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=1&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]" +"thatip.com" "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=2&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]" + +# Hurricane Electric Dynamic DNS +"he.net" "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]" + +# DNSdynamic.org +"dnsdynamic.org" "http://[USERNAME]:[PASSWORD]@www.dnsdynamic.org/api/?hostname=[DOMAIN]&myip=[IP]" + +# dnsExit.com free dynamic DNS update url +"dnsexit.com" "http://www.dnsexit.com/RemoteUpdate.sv?login=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&myip=[IP]" + +# OVH +"ovh.com" "http://[USERNAME]:[PASSWORD]@www.ovh.com/nic/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]" + +# dns-o-matic is a free service by opendns.com for updating multiple hosts and +# dynamic dns services in one api call. To update all your configured services +# at once, use "all.dnsomatic.com as the hostname. +"dnsomatic.com" "http://[USERNAME]:[PASSWORD]@updates.dnsomatic.com/nic/update?hostname=[DOMAIN]&myip=[IP]" + +# 3322.org +"3322.org" "http://[USERNAME]:[PASSWORD]@members.3322.org/dyndns/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]" + +# namecheap.com +"namecheap.com" "http://dynamicdns.park-your-domain.com/update?host=[USERNAME]&domain=[DOMAIN]&password=[PASSWORD]&ip=[IP]" + +# easydns.com dynamic DNS +"easydns.com" "http://[USERNAME]:[PASSWORD]@api.cp.easydns.com/dyn/tomato.php?hostname=[DOMAIN]&myip=[IP]" diff --git a/net/ddns-scripts/files/usr/lib/ddns/url_escape.sed b/net/ddns-scripts/files/usr/lib/ddns/url_escape.sed new file mode 100644 index 0000000..eac4002 --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/url_escape.sed @@ -0,0 +1,25 @@ +# sed url escaping +s:%:%25:g +s: :%20:g +s:<:%3C:g +s:>:%3E:g +s:#:%23:g +s:{:%7B:g +s:}:%7D:g +s:|:%7C:g +s:\\:%5C:g +s:\^:%5E:g +s:~:%7E:g +s:\[:%5B:g +s:\]:%5D:g +s:`:%60:g +s:;:%3B:g +s:/:%2F:g +s:?:%3F:g +s^:^%3A^g +s:@:%40:g +s:=:%3D:g +s:&:%26:g +s:\$:%24:g +s:\!:%21:g +s:\*:%2A:g diff --git a/net/deluge/Makefile b/net/deluge/Makefile new file mode 100644 index 0000000..6e658d3 --- /dev/null +++ b/net/deluge/Makefile @@ -0,0 +1,111 @@ +# +# Copyright (C) 2008-2011 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:=deluge +PKG_VERSION:=1.2.0 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.deluge-torrent.org/source/ +PKG_MD5SUM:=cec6b48f0abd79ea2cff3815a1124192 + +PKG_BUILD_DEPENDS:=distribute/host + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/deluge/Default + SUBMENU:=BitTorrent + SECTION:=net + CATEGORY:=Network + TITLE:=A lightweight BitTorrent client + URL:=http://deluge-torrent.org/ +endef + +define Package/deluge +$(call Package/deluge/Default) + TITLE+= (console UI & daemon) + DEPENDS+=+python +rblibtorrent +python2-chardet +pyxdg +twisted +twisted-web +pyopenssl +endef + +define Package/deluge-ui-gtk +$(call Package/deluge/Default) + TITLE+= (GTK+ UI) + DEPENDS+=deluge +python-gtk +endef + +define Package/deluge-ui-web +$(call Package/deluge/Default) + TITLE+= (Web UI) + DEPENDS+=deluge +mako +endef + +define Package/deluge/description + BitTorrent client with a client/server model. +endef + +define Package/deluge/conffiles +/etc/config/deluge +endef + +define Build/Compile + $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR)) + + $(SED) 's,#!$(STAGING_DIR)/host/bin/$(PYTHON),#!/usr/bin/$(PYTHON),' $(PKG_INSTALL_DIR)/usr/bin/* +endef + +define Package/deluge/install + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR) + $(CP) \ + $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \ + $(1)$(PYTHON_PKG_DIR)/ + rm -rf $(1)$(PYTHON_PKG_DIR)/deluge/ui/gtkui + rm -rf $(1)$(PYTHON_PKG_DIR)/deluge/ui/web + + $(INSTALL_DIR) $(1)/usr/bin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/bin/* \ + $(1)/usr/bin/ + rm -rf $(1)/usr/bin/deluge-gtk + rm -rf $(1)/usr/bin/deluge-web + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/deluge.config $(1)/etc/config/deluge + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/deluge.init $(1)/etc/init.d/deluge +endef + +define Package/deluge-ui-gtk/install + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/deluge/ui + $(CP) \ + $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/deluge/ui/gtkui \ + $(1)$(PYTHON_PKG_DIR)/deluge/ui/ + + $(INSTALL_DIR) $(1)/usr/bin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/bin/deluge-gtk \ + $(1)/usr/bin/ +endef + +define Package/deluge-ui-web/install + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/deluge/ui + $(CP) \ + $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/deluge/ui/web \ + $(1)$(PYTHON_PKG_DIR)/deluge/ui/ + + $(INSTALL_DIR) $(1)/usr/bin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/bin/deluge-web \ + $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,deluge)) +$(eval $(call BuildPackage,deluge-ui-gtk)) +$(eval $(call BuildPackage,deluge-ui-web)) diff --git a/net/deluge/files/deluge.config b/net/deluge/files/deluge.config new file mode 100644 index 0000000..3d41776 --- /dev/null +++ b/net/deluge/files/deluge.config @@ -0,0 +1,6 @@ +config global deluged + option 'user' 'deluge' + option 'group' 'deluge' + option 'home' '' + option 'options' '' + option 'enabled' 1 diff --git a/net/deluge/files/deluge.init b/net/deluge/files/deluge.init new file mode 100644 index 0000000..50afc26 --- /dev/null +++ b/net/deluge/files/deluge.init @@ -0,0 +1,86 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org +# Copyright (C) 2010 Alexander Sulfrian + +START=50 +STOP=50 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 +SERVICE_PID_FILE="/var/run/deluged.pid" + +error() { + echo "${initscript}:" "$@" 1>&2 +} + +section_enabled() { + config_get_bool enabled "$1" 'enabled' 0 + [ $enabled -gt 0 ] +} + +start_instance() { + local s="$1" + + section_enabled "$s" || return 1 + + config_get uid "$s" 'user' + [ -n "$uid" ] || { + error "user is not set" + return 1 + } + user_exists $uid || { + error "user '$uid' dos not exist" + return 1 + } + + config_get gid "$s" 'group' + [ -n "$gid" ] || { + error "group is not set" + return 1 + } + group_exists $gid || { + error "group '$gid' dos not exist" + return 1 + } + + config_get home "$s" 'home' + [ -n "$home" ] || { + home=$(grep "^${user}:" /etc/passwd | cut -d ':' -f 6) + fi + [ -d "$home" ] || { + error "home directory '$home' for user '$uid' dos not exist" + return 1 + } + + config_get options "$s" 'options' + + HOME="$home" \ + SERVICE_UID="$uid" \ + SERVICE_GID="$gid" \ + service_start /usr/bin/python2.6 /usr/bin/deluged --do-not-daemonize $options +} + +stop_instance() { + local s="$1" + + section_enabled "$s" || return 1 + + config_get uid "$s" 'user' + config_get gid "$s" 'group' + + SERVICE_UID="$uid" \ + SERVICE_GID="$gid" \ + service_stop /usr/bin/python2.6 +} + +start() +{ + config_load 'deluged' + config_foreach start_instance 'deluged' +} + +stop() +{ + config_load 'deluged' + config_foreach stop_instance 'deluged' +} diff --git a/net/dhcp-forwarder/Makefile b/net/dhcp-forwarder/Makefile new file mode 100644 index 0000000..aa6dc3d --- /dev/null +++ b/net/dhcp-forwarder/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2006-2012 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:=dhcp-forwarder +PKG_VERSION:=0.10 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=http://savannah.nongnu.org/download/dhcp-fwd +PKG_MD5SUM:=3b96dd27f6d05502d4048acab453808d + +include $(INCLUDE_DIR)/package.mk + +CONFIGURE_ARGS += \ + --disable-dietlibc + +define Package/dhcp-forwarder + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=DHCP relay agent + URL:=http://www.nongnu.org/dhcp-fwd/ +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + cfg_filename="/etc/dhcp-fwd.conf" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/dhcp-forwarder/conffiles +/etc/dhcp-fwd.conf +endef + +define Package/dhcp-forwarder/install + $(INSTALL_DIR) $(1)/usr/bin $(1)/etc $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcp-fwd $(1)/usr/bin/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/contrib/dhcp-fwd.conf $(1)/etc/ + $(INSTALL_BIN) ./files/dhcp-fwd.init $(1)/etc/init.d/dhcp-fwd +endef + +$(eval $(call BuildPackage,dhcp-forwarder)) diff --git a/net/dhcp-forwarder/files/dhcp-fwd.init b/net/dhcp-forwarder/files/dhcp-fwd.init new file mode 100644 index 0000000..b3d2375 --- /dev/null +++ b/net/dhcp-forwarder/files/dhcp-fwd.init @@ -0,0 +1,17 @@ +#!/bin/sh /etc/rc.common + +START=50 + +LOG_D=/var/log +RUN_D=/var/run +PID_F=$RUN_D/dhcp-fwd.pid + +start() { + [ -d $LOG_D ] || mkdir -p $LOG_D + [ -d $RUN_D ] || mkdir -p $RUN_D + dhcp-fwd +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) +} diff --git a/net/dhcpcd/Makefile b/net/dhcpcd/Makefile new file mode 100644 index 0000000..572f9a3 --- /dev/null +++ b/net/dhcpcd/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=dhcpcd +PKG_VERSION:=3.0.17 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://download.berlios.de/dhcpcd/ +PKG_MD5SUM:=e9100e53f64ca1f9fb0d392c3a623738 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/dhcpcd + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=DHCP client for automatically configuring IPv4 networking + URL:=http://roy.marples.name/projects/dhcpcd +endef + +define Package/dhcpcd/description + Simple configuration: supports executions of a script when the + IP address changes. +endef + +define Package/dhcpcd/install + $(INSTALL_DIR) $(1)/sbin + $(CP) $(PKG_INSTALL_DIR)/sbin/* $(1)/sbin/ +endef + +$(eval $(call BuildPackage,dhcpcd)) + diff --git a/net/dhcpcd/patches/001-run_dir.patch b/net/dhcpcd/patches/001-run_dir.patch new file mode 100644 index 0000000..cbb26ff --- /dev/null +++ b/net/dhcpcd/patches/001-run_dir.patch @@ -0,0 +1,11 @@ +--- dhcpcd-3.0.17/pathnames.h.orig 2007-05-31 15:28:04.000000000 -0700 ++++ dhcpcd-3.0.17/pathnames.h 2007-05-31 15:28:16.000000000 -0700 +@@ -48,7 +48,7 @@ + #define STATEDIR "/var" + #define PIDFILE STATEDIR "/run/" PACKAGE "-%s.pid" + +-#define CONFIGDIR STATEDIR "/lib/" PACKAGE ++#define CONFIGDIR STATEDIR "/run/" PACKAGE + #define INFOFILE CONFIGDIR "/" PACKAGE "-%s.info" + + #endif diff --git a/net/dircproxy/Makefile b/net/dircproxy/Makefile new file mode 100644 index 0000000..6896637 --- /dev/null +++ b/net/dircproxy/Makefile @@ -0,0 +1,37 @@ +# +# Copyright (C) 2006,2007 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:=dircproxy +PKG_VERSION:=1.2.0-RC1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://dircproxy.googlecode.com/files/ +PKG_MD5SUM:=4fe2e82619c7b575599bfb236adbd872 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/dircproxy + SUBMENU:=Instant Messaging + SECTION:=net + CATEGORY:=Network + TITLE:=An IRC proxy server + URL:=http://dircproxy.googlecode.com/ +endef + +# uses Build/Configure/Default + +define Package/dircproxy/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dircproxy{,-crypt} $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,dircproxy)) diff --git a/net/ditg/Makefile b/net/ditg/Makefile new file mode 100644 index 0000000..4470672 --- /dev/null +++ b/net/ditg/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2010-2011 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:=ditg +PKG_VERSION:=2.8.0-rc1 +PKG_RELEASE:=1 + +PKG_SOURCE:=D-ITG-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://www.grid.unina.it/software/ITG/codice +PKG_MD5SUM:=609736113de729df833ac691d1c44ead + +PKG_BUILD_DIR:=$(BUILD_DIR)/D-ITG-$(PKG_VERSION) + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/ditg + TITLE:=D-ITG (Distributed Internet Traffic Generator) + SECTION:=net + CATEGORY:=Network + URL:=http://www.grid.unina.it/software/ITG/ + MAINTAINER:=Giovanni Di Stasi + DEPENDS:=+libpthread $(CXX_DEPENDS) +endef + +define Package/ditg/description + D-ITG (Distributed Internet Traffic Generator) is a platform capable + to produce traffic at packet level accurately replicating appropriate + stochastic processes for both IDT (Inter Departure Time) and PS + (Packet Size) random variables (exponential, uniform, cauchy, normal, + pareto, ...). D-ITG supports both IPv4 and IPv6 traffic generation and + it is capable to generate traffic at network, transport, and + application layer. We believe that D-ITG shows interesting properties + when compared to other traffic generators. +endef + +MAKE_PATH := src + +MAKE_FLAGS += \ + CXXOPT="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -DMULTIPORT -DARM" + +define Package/ditg/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/ITG{Send,Recv,Log,Dec} $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,ditg)) diff --git a/net/djbdns/Changelog b/net/djbdns/Changelog new file mode 100644 index 0000000..2fcd471 --- /dev/null +++ b/net/djbdns/Changelog @@ -0,0 +1,43 @@ +#Changelog for the djbdns port for OpenWRT + +5 20090522 jhalfmoon +enhancement - added patch: dnsroots_updated +enhancement - added patch: tinydns_one_second +enhancement - added patch: srv-records-and-axfrget +enhancement - added patch: dnscache_less_chatty_log +enhancement - added patch: tinydns_mmap_leak +enhancement - added patch: dnscache_dpos_tcp_servfail +enhancement - added patch: dnscache_negative_ttls +enhancement - added patch: dnscache_sigpipe_fix +enhancement - added patch: dnscache_big_udp_packets +enhancement - added patch: dnscache_ignoreip2 (Note: disabled in config by default!) +enhancement - added HIDETTL config option +change - Corrected a typo in the axfrdns description in the Makefile. +change - Cleaned up some lines in the Makefile +change - dnsroots.global now gets copied from the djbdns source folder instead of from the package/files folder. +change - The dnscache-multiple-ip patch was removed as it served no purpose +change - Renamed a few patches to be more consistent with the other patches +change - Updated the README file to reflect the changes + +4 20090418 jhalfmoon +bugfix - The dnscache postinst script had a bug that prevented djbdns from being compiled into a firmware image. +bugfix - The dnscache startup script now uses /dev/urandom instead of /dev/random as a source of randomness. Using /dev/random does not work on 2.6 kernels. +bugfix - dnscache no longer tries to use /tmp/resolv.conf.auto but /etc/resolv.conf instead. This only applies when useresolvconf==1. +change - In menuconfig: djbdns moved from network to network/DNS +change - Removed the dnscache postinst script to the dnscache startup script. The script configures dnscache to accept connections from certain local network adresses. +change - The dnscache startup script was cleaned up a bit. +change - default logging level is now info instead of notice. +enhancement - Added option to add list of resolvers to UCI config for use in forwardonly mode. Two OpenDNS example addresses are added as a default. + +3 20090409 jhalfmoon +bugfix - The restart routines of all scripts were broken causing restart to fail +bugfix - dnsqrx was broken, script accidentally relied on bash instead of sh + +2 20090406 jhalfmoon +bugfix - dnscache init script did not correctly handle /tmp/resolv.conf.auto +enhancement - Addded the dnsqr command from http://homepages.tesco.net/~J.deBoynePollard/Softwares/djbdns/dnsqrx +change - Default dnscache CACHESIZE was set too low, was 200KB, is now 1MB +change - Added list of patches and made some overall adjustments to the README + +1 20090404 jhalfmoon +Initial release diff --git a/net/djbdns/Makefile b/net/djbdns/Makefile new file mode 100644 index 0000000..b47450c --- /dev/null +++ b/net/djbdns/Makefile @@ -0,0 +1,209 @@ +# +# Copyright (C) 2007-2012 OpenWrt.org +# Original port by FreeWRT project. +# +# 2007 Alexander Tsvyashchenko Adapted FreeWRT port for OpenWRT (Trac ticket 2497) +# 2008 Some Danish guy Created a port for OpenWRT 7.09 +# 20090403 jhalfmoon Modified and augmented existing packages to work on OpenWRT buildroot (v8.09) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=djbdns +PKG_VERSION:=1.05 +PKG_RELEASE:=7 + +PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz +PKG_SOURCE_URL:=http://cr.yp.to/djbdns/ +PKG_MD5SUM:=3147c5cd56832aa3b41955c7a51cbeb2 +PKG_BUILD_DEPENDS:=daemontools ucspi-tcp + +include $(INCLUDE_DIR)/package.mk + +define Package/djbdns/Default + SECTION:=net + CATEGORY:=Network + URL:=http://cr.yp.to/djbdns.html + SUBMENU:=IP Addresses and Names +# SUBMENU:=djbdns +endef + +define Package/djbdns-base + $(call Package/djbdns/Default) + TITLE:=djbdns base configuration file +endef + +define Package/djbdns-dnscache + $(call Package/djbdns/Default) + TITLE:=Recursive and forwarding caching name server + DEPENDS:= +djbdns-base +endef + +define Package/djbdns-tinydns + $(call Package/djbdns/Default) + TITLE:=Authoritative name server + DEPENDS:= +djbdns-base +endef + +define Package/djbdns-axfrdns + $(call Package/djbdns/Default) + TITLE:=Zone transfer server + DEPENDS:= +djbdns-base +djbdns-tinydns +ucspi-tcp +endef + +define Package/djbdns-rbldns + $(call Package/djbdns/Default) + TITLE:=Real-time Block List name server + DEPENDS:= +djbdns-base +endef + +define Package/djbdns-walldns + $(call Package/djbdns/Default) + TITLE:=Reverse DNS wall + DEPENDS:= +djbdns-base +endef + +define Package/djbdns-tools + $(call Package/djbdns/Default) + TITLE:=Tools for testing and debugging DNS issues +endef + +define Package/djdbns/description + djbdns is a collection of Domain Name System tools. + It includes software for all the fundamental DNS operations: + * DNS server: publishing addresses of Internet hosts. + * DNS cache: finding addresses of Internet hosts. + * DNS client: talking to a DNS cache. + + Also included is a DNS client C library, several command-line + DNS client utilities, several DNS debugging tools. +endef + +define Package/djbdns-base/description + The shared config file for the djbdns daemons. +endef + +define Package/djbdns-dnscache/description + dnscache is a DNS cache. + It accepts recursive DNS queries from local clients such as web + browsers and mail transfer agents. It collects responses from + remote DNS servers. It caches the responses to save time later. +endef + +define Package/djbdns-tinydns/description + tinydns is a DNS server. + It accepts iterative DNS queries from hosts around the Internet + and responds with locally configured information. +endef + +define Package/djbdns-axfrdns/description + axfrdns is a DNS zone-transfer server. + It reads a zone-transfer request in DNS-over-TCP format + from its standard input and responds with locally configured + information. +endef + +define Package/djbdns-rbldns/description + rbldns is an IP-address-listing DNS server. + It accepts iterative DNS queries from hosts around the Internet asking + about various IP addresses. It provides responses showing whether the + addresses are on a locally configured list, such as RBL or DUL. +endef + +define Package/djbdns-walldns/description + walldns is a reverse DNS wall. + It accepts iterative DNS queries for in-addr.arpa domains from hosts + around the Internet and supplies generic responses that avoid + revealing local host information. +endef + +define Package/djbdns-tools/description + Several command-line DNS client utilities and DNS debugging tools. +endef + +define Build/Compile + TARGET_CC="$(TARGET_CC)" \ + TARGET_CFLAGS="$(TARGET_CFLAGS)" \ + TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \ + TARGET_RANLIB="$(TARGET_CROSS)ranlib" \ + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +define Package/djbdns-base/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/djbdns.conf $(1)/etc/config/djbdns +endef + +define Package/djbdns-base/conffiles +/etc/config/djbdns +endef + +define Package/djbdns-dnscache/install + $(INSTALL_DIR) $(1)/usr/bin + (cd $(PKG_BUILD_DIR); \ + $(INSTALL_BIN) dnscache pickdns pickdns-data $(1)/usr/bin) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/dnscache.init $(1)/etc/init.d/dnscache + $(CP) -r ./files/dnscache $(1)/etc/ + $(CP) $(PKG_BUILD_DIR)/dnsroots.global $(1)/etc/dnscache/ + $(INSTALL_DIR) $(1)/etc/dnscache/ip + $(INSTALL_DIR) $(1)/etc/dnscache/servers + $(CP) $(PKG_BUILD_DIR)/dnsroots.global $(1)/etc/dnscache/servers/@ +endef + +define Package/djbdns-tinydns/install + $(INSTALL_DIR) $(1)/usr/bin + (cd $(PKG_BUILD_DIR); \ + $(INSTALL_BIN) tinydns tinydns-data tinydns-edit tinydns-get $(1)/usr/bin) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/tinydns.init $(1)/etc/init.d/tinydns + $(CP) -r ./files/tinydns $(1)/etc/ +endef + +define Package/djbdns-axfrdns/install + $(INSTALL_DIR) $(1)/usr/bin + (cd $(PKG_BUILD_DIR); \ + $(INSTALL_BIN) axfrdns axfr-get $(1)/usr/bin) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/axfrdns.init $(1)/etc/init.d/axfrdns + $(CP) -r ./files/axfrdns $(1)/etc/ +endef + +define Package/djbdns-rbldns/install + $(INSTALL_DIR) $(1)/usr/bin + (cd $(PKG_BUILD_DIR); \ + $(INSTALL_BIN) rbldns rbldns-data $(1)/usr/bin) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/rbldns.init $(1)/etc/init.d/rbldns + $(CP) -r ./files/rbldns $(1)/etc/ +endef + +define Package/djbdns-walldns/install + $(INSTALL_DIR) $(1)/usr/bin + (cd $(PKG_BUILD_DIR); \ + $(INSTALL_BIN) walldns $(1)/usr/bin) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/walldns.init $(1)/etc/init.d/walldns +endef + +define Package/djbdns-tools/install + $(INSTALL_DIR) $(1)/usr/bin + (cd $(PKG_BUILD_DIR); \ + $(INSTALL_BIN) dnsfilter dnsip dnsipq dnsmx dnsname dnsnamex dnsq \ + dnsqr dnstrace dnstracesort dnstxt random-ip \ + $(1)/usr/bin) + $(INSTALL_BIN) ./files/dnsroots-update $(1)/usr/bin/ + $(INSTALL_BIN) ./files/dnsqrx $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,djbdns-base)) +$(eval $(call BuildPackage,djbdns-tinydns)) +$(eval $(call BuildPackage,djbdns-dnscache)) +$(eval $(call BuildPackage,djbdns-axfrdns)) +$(eval $(call BuildPackage,djbdns-rbldns)) +$(eval $(call BuildPackage,djbdns-walldns)) +$(eval $(call BuildPackage,djbdns-tools)) + diff --git a/net/djbdns/README b/net/djbdns/README new file mode 100644 index 0000000..a6e5921 --- /dev/null +++ b/net/djbdns/README @@ -0,0 +1,319 @@ + +# 20090409 jhalfmoon@milksnot.com - Don't hesitate to let me know if you decide to use it and/or what you think of it. + +This is a port of djbdns for OpenWRT (>= v8.09). Features: + +- works with the most current buildroot +- makes use of the UCI configuration system +- components are seperately packaged to minimize package footprint +- most of the popular and necessary available patches are applied +- documentation available (you're reading it) + +The djbdns package is a set of compact, reliable and fast DNS daemons and tools. This port is based on the work done by a few other people: + +- The FreeWRT project +- Alexander Tsvyashchenko - https://dev.openwrt.org/ticket/2497 +- Some anonymous (Danish?) person - https://dev.openwrt.org/ticket/3837 + +Using the previous work as a base, time went into rewriting the Make file, adding patches, adding the config system and writing this documentation. The ucspi-tcp and daemontools packages were not touched; they work just fine in the state they were found on OpenWRT TRAC. + +The following document meant to give some useful information about this package. You do not need to know all of the following to install or compile this package; it is only meant as an addition to help potential users on their way. An installation could theoretically be as simple as: "opkg install dnscache.ipk ; /etc/init.d/dnscache start". To find more about the workings of djbdns, visit: + +http://cr.yp.to/djbdns.html + +On the following sites you can find even more info, including text about the patches included in this package: + +http://www.lifewithdjbdns.com/ +http://www.thedjbway.org/djbdns/resources.html +http://www.fefe.de/djbdns/ +http://homepages.tesco.net/~J.deBoynePollard/FGA/#DNS +http://binarios.com/miscnotes/djbdns.html +http://web.archive.org/web/20061013054303/http://ezine.daemonnews.org/200210/ezdjbdns.html + +Some info about the bugfixes: + +http://www.securityfocus.com/archive/1/501294/30/0/threaded +http://www.your.org/dnscache/ + +How to build +============ +- copy the folders djbdns, ucspi-tcp (and optionally daemontools) to your buildroot/package directory +- make menuconfig +- select the packages under network/DNS/djbdns and network/ucspi-tcp (and optionally network/daemontools) +- make +- after compilation, the package can be found at bin/packages/ +- now do what you normally do to install self-compiled packages on your OpenWRT machine + +If you wish to tinker with the code, then here are some useful commands to run in the buildroot: + rm -rf build_dir//djbdns-1.05 + make package/cleanup + make package/djbdns/compile V=99 + make package/index +Once you have done a "make menuconfig;make" you can use these commands to quickly rebuild only the djbdns package. + +Usage pointers +============== +- After installation, you can make the servers start automatically on boot by running "/etc/init.d/ enable" . The script will then appear in the /etc/rc.d directory. This is standard OpenWRT functionality. +- All djbdns parameters are stored in the UCI configuration system. Run "uci show djbdns" to see the settings. Data files are not implemented in the UCI system, so these files must be manually backed up when and if you intend to do a sysupgrade (=reflash the firmware). Those files include: dnscache dnsroot.global, dnscache @ file, tinydns data file, axfrdns tcp file, rbldns data file, each in their individual directories in /etc. +- Each package is ready to run out-of-the-box, once installed. The default settings allow you to start playing immediately. The defaults are reasonably secure, but do not take my word for it. Verify it. Note: dnscache has two default example resolver IP addresses. The two default addresses are the OpenDNS resolvers, which might work at the moment, but this may change in the future. +- You will most likely want to customize the settings for each seperate service you wish to use. Read the docs on the weblinks listed above for pointers on how to do so. +- The ucspi-tcp package is only needed if you wish to install and run axfrdns. +- The daemontools package is strictly optional. It is in no way linked to the djbdns package (yet). It is just there for you to play with. +- Starting the init.d scripts from the command line with the environment variable DEBUG set to 1 will prevent the servers from daemonizing and show the servers's log dumped to stdout / stderr instead of /dev/null. Example: "DEBUG=1 /etc/init.d/dnscache start" +- By default, all logging is disabled. Each daemon has a seperate option to activate logging. When logging activated the daemon logs to syslog using facility local1.info. +- Each djbdns server requires an IP address on which to listen on. This port of djbdns allows you to define an interface on which to listen instead of an IP address. The advantage of this is that an interface can get a different IP address assigned, the djbdns stuff will not break. The dnscache server has a patch applied so that it is possible to define multiple interfaces on which to listen, separated by slashes. Example: wan/lan . +- By default, dnscache acts as a recursive name server. If you wish to operate in forwardonly mode, then you need to set the forwardonly flag to '1'. Then you need to do either one of the following: Put the ip addresses of the name servers you wish to use as resolvers in the UCI config (djbdns.dnscache.resolver) or alternatively you can set the useresolvconf flag which will cause the dns servers assigned by dhcp to be used. That last option is a so called set-and-forget mode which will work quite well in most home environments. +- If you want your OpenWRT machine to make use of its own dnscache, then you must make /etc/resolv.conf reflect this. One way of doin this is as follows: uci set network.wan.dns=127.0.0.1 . If you have dnscache listening on some other interface, you would naturally replace 127.0.0.1 by the address of that interface. +- OpenWRT has several applications that can do DNS serving in one way or another (dnsmasq, Maradns, Bind). Make sure you have none of these apps running when you start running a djbdns name server because having two DNS apps listening on the same address is not something you would usually want. A patch for the dnsmasq configuration script and its config file is included with this package. The patch will allow you to configure dnsmasq to listen only on certain interfaces, instead of on all them as it does by default on OpenWRT. Alternatively, you could completely disable and / or remove dnsmasq, if you do not intend to use any of its functionality (which is serving DNS and DHCP). +- The ignoreip patch also has a script supplied along with it, with which you can update the ignorelist. The script contains an explanation of why you might want to do this. +- The ignoreip functionality is disabled by default. If you want to activate it, you need to set the flag 'useignore' flag to '1' in the config. You might also want to check if you are really blocking what you want to block. Be careful with this feature. Think twice before using it. + +To apply the dnsmasq patch +========================== +NOTE: This patch has been incorporated into OpenWRT trunk per 20090409 as seen in https://dev.openwrt.org/ticket/4900 and https://dev.openwrt.org/changeset/15172. + +This is a patch to allow you to use dnsmasq alongside dnscache. It will allow you to configure dnsmasq to listen only on certain interfaces, instead of on all them as it does by default on OpenWRT. It only patches the startup script and configuration file of dnsmasq, not dnsmasq itself. If you need or desire to apply the patch yourself, then there are two possible ways to go about it: + +Patch the dnsmasq package source: +- cd to svn/openwrt/branches/8.09/packages/dnsmasq/files +- do 'patch < dnsmasq.patch +- if all went well you can now compile the package as you nomally would +- you can now either reinstall dnsmasq on your router or re-flash the firmware image. If you reinstall the dnsmasq package then you waste some flash memory, as dnsmasq is usually already included as a part of the firmware image. One way to reinstall the dnsmasq package is to use SSH to upload the image to the router and do: opkg update ; opgk install -force-reinstall dnsmasq.ipk . Or you could configure your OpenWRT build machine as an http server that serves OpenWRT packages and then configure opkg to use your server as an ipkg repository. This is generally a pretty good idea if you are building your own firmware and packages. + +Alternatively, you can patch the dnsmasq files on the router itself: +Look at the patch file and manually patch the files on the router. There are only four lines to modify, so it is not hard. + +NOTE: The dnsmasq paramaters added by this patch are not shown on the Luci webinterface. You will manually have to configure dnsmasq. An example of how to make dnsmasq serve DNS and DHCP only on the lan: +uci set dhcp.@dnsmasq[0].nonwildcard=1 +uci set dhcp.@dnsmasq[0].interfaces=br-lan +uci commit +This will prevent dnsmasq from binding to the wildcard IP address and instead make it listen on the designated (lan) interface. You are then free to run a DNS server on, for example, the loopback and/or the wan interface. + +Assorted notes +============== +- This port was put together with reasonable care. It is not a dirty hack, but that is ofcourse a very subjective statement. +- It was created on and for Kamikaze 8.09 with both a 2.4 and a 2.6 kernel. It was not tested to work on older versions of OpenWRT, but it might. +- This package will build into several packages. Most of the packages rely on the package djbdnsbase. It contains the shared config data for all daemons. It should automatically get installed along with the daemons by opkg. +- The ucspi-tcp package is a requirement for installing axfrdns. If you don't user afrxdns, you won't need to install ucspi-tcp. +- The daemontool package is supplied as a part of this port, but it is not needed or used by anything in the djbdns packages. It is included in case anyone feels the want or need to make use of it. +- Among the applied patches are the latest (as of the 2nd of april 2009) notorious bug fixes for dnscache. +- Most patches are vanilla, ie. unmodified as they can be found on the net. The only patch modified is the djbdns-1.05-slogging patch, which was merged with the server-1.05-nxdomain-logging patch. +- The dnscache gets a patch applied to be able to listen on multiple IP addresses. Tinydns is not patched to have that functionality, although the patch for that is available on the net. +- dnscache is also patched to deliver additional statistics in its log files, including hits/misses and what types of records were queried. These can be used to monitor and/or graph the behaviour of your dnscache server. +- The dnscache package gets configured to listen to 127.0.0.1 and the lan subnet by default. See "ls /etc/dnscache/ip" and "uci show djbdns|grep dnscache" . +- tinydns, axfrdns and rbldns include example data files that are installed by default. Their purpose is to ease installation and testing of the packages and to act as a guide to people who are not familiar with these applications. +- The dnstools part of this package contains a script called dnsroots-update with which you can update the global root file. This is quite useful because IP addresses of the root servers change now and then, although not very often. I seems that few people actually bother to update the global roots file once they have installed dnscache. It is important to run the update script every now and them, or at least at installation time. Do the following to update the list: dnsroots-update > /etc/dnscache/dnsroots.global and then copy the file dnsroots.global to /etc/dnscache/server/@ . The dnstools package is quite large (400K installed) for an embedded system. What you could do instead of running the update script on the router, is to install the djbdns package on some big machine and run the script on there and then copy the output to the dnsroots file on the router. The dnsroots.global file included in this package is up to date as per the date of this writing (2nd of april 2009). + +Testing the installation +======================== +The following may ease any debugging you might wish/need to do: +- Set the syslog buffer to something like 64K or more and make it log to IP address localhost (reboot to activate the changes): + uci set system.@system[0].log_ip=127.0.0.1 + uci set system.@system[0].log_size=64 + uci commit +- Use "logread|less" to browse through the buffered syslog output. +- For realtime log monitoring: Install netcat and make it listen to the syslog output: + opkg install netcat + netcat -ulp 514 + +This paragraph gives a few brief pointers on how to test your installation. The general idea is as follows: Log in to the OpenWRT machine using two seperate SSH sessions or a single session and then use 'screen' to gain multiple sessions. In the first session you have to start the daemon you wish to test. In the second session you run the diagnostic commands. In the following examples, for each daemon and each diagnostic tool, I have supplied the commandline and the expected, approximate output. + +NOTE1: Make sure no other DNS servers are running. Check with "netstat -an|grep 53" and/or do a "killall dnsmasq" just to be sure. +NOTE2: dnscache requires an active internet connection it to work +NOTE3: In the following examples, the servers were running on IP address 10.1.1.2 +NOTE4: Most of these tests require the dnstools package to be installed + +-dnscache +session1 "DEBUG=1 /etc/init.d/dnscache start" + Starting Caching nameserver: dnscachelistening on 0a010102 + starting + +session2 "DNSCACHEIP=$yourwanip dnsqr a example.com" (note: you do no have to modify /etc/resolv.conf to use this command) + 1 example.com: + 45 bytes, 1+1+0+0 records, response, noerror + query: 1 example.com + answer: example.com 172800 A 208.77.188.166 +session2 "dnsip example.com" (note: /etc/resolv.conf must point to the address on which dnscache is listening) + 208.77.188.166 +session2 "nslookup example.com" (note: /etc/resolv.conf must point to the address on which dnscache is listening) + Server: 10.1.1.2 + Address 1: 10.1.1.2 + Name: example.com + Address 1: 208.77.188.166 www.example.com + +-tinydns +session1 "DEBUG=1 /etc/init.d/tinydns start" + Starting Authoritative nameserver: tinydnsstarting tinydns + 0a010102:4eee:fdd8 + 0001 example.net + stats 1 1 0 0 0 0 0 +session2 "dnsq a example.net $yourwanip" + 1 example.net: + 79 bytes, 1+0+1+0 records, response, authoritative, noerror + query: 1 example.net + authority: example.net 2560 SOA ns.example.net hostmaster.example.net 1238703484 16384 2048 1048576 2560 + +-axfrdns +session1 "DEBUG=1 /etc/init.d/axfrdns start" + Starting Zone transfer name server: tcpservertcpserver: status: 0/10 + tcpserver: status: 1/10 + tcpserver: pid 1140 from 10.1.1.2 + tcpserver: ok 1140 0:10.1.1.2:53 :10.1.1.2::1034 + 0a010102:040a:0000 0006 example.net + tcpserver: end 1140 status 0 + tcpserver: status: 0/10 +session2 "tcpclient -RHl0 $yourwanip 53 axfr-get example.net /tmp/zone /tmp/zone.tmp" + The file /tmp/zone should now contain the example.net zone in tinydns-data format. + +-rbldns +session1 "DEBUG=1 /etc/init.d/rbldns start" + Starting Reverse DNS wall: rbldnsstarting rbldns + 0a010102:881d:01ca + 0010 8.4.2.1.test + stats 1 1 0 0 0 0 0 + 0a010102:674a:e70f N 0010 9.4.2.1.test +session2 "dnsq txt 8.4.2.1.test $yourwanip" + 16 8.4.2.1.test: + 59 bytes, 1+1+0+0 records, response, authoritative, noerror + query: 16 8.4.2.1.test + answer: 8.4.2.1.test 2048 16 \020www.somesite.com +session2 "dnsq txt 9.4.2.1.test $yourwanip" + 16 9.4.2.1.test: + 30 bytes, 1+0+0+0 records, response, authoritative, nxdomain + query: 16 9.4.2.1.test + +-walldns +session1 "DEBUG=1 /etc/init.d/walldns start" + Starting Reverse DNS wall: walldnsstarting walldns + 0a010102:7b76:3d97 + 0001 4.3.2.1.in-addr.arpa + stats 1 1 0 0 0 0 0 +session2 "dnsq a 4.3.2.1.in-addr.arpa $yourwanip" + 1 4.3.2.1.in-addr.arpa: + 54 bytes, 1+1+0+0 records, response, authoritative, noerror + query: 1 4.3.2.1.in-addr.arpa + answer: 4.3.2.1.in-addr.arpa 655360 A 1.2.3.4 + +axfrdns defaults +================ +axfrdns is run using tcpserver from the ucspi-tcp package. The following parameters are used to start the tcpserver daemon (which runs as root BTW): +-D: Never delay sending data; enable TCP_NODELAY. +-R: Do not attempt to obtain $TCPREMOTEINFO from the remote host. To avoid loops, you must use this option for servers on TCP ports 53 and 113. +-H: Do not look up the remote host name in DNS; remove the environment variable $TCPREMOTEHOST. To avoid loops, you must use this option for servers on TCP port 53. +-l localname: Do not look up the local host name in DNS; use localname for the environment variable $TCPLOCALHOST. A common choice for localname is 0. To avoid loops, you must use this option for servers on TCP port 53. +-c n (=40): Do not handle more than n simultaneous connections. If there are n simultaneous copies of prog running, defer acceptance of a new connection until one copy finishes. n must be a positive integer. Default: 40. +-b n (=10): Allow a backlog of approximately n TCP SYNs. On some systems, n is silently limited to 5. On systems supporting SYN cookies, the backlog is irrelevant. + +In debug mode and when logging is activated, the following parameter is also active: +-v: Verbose. Print error messages and status messages. + +Applied patches +=============== +crosscompile.patch +https://dev.openwrt.org/ticket/2497 +Patch to make djbdns compile correctly for OpenWRT. I understand that the original patch comes from FreeWRT and was adapted for OpenWRT by Alexander Tsvyashchenko. + +dnsroots-update.patch +Update the dnsroots.global file to be current. + +srv-records-and-axfrget.patch +http://sol.truespace.ca/Files/djbdns/srv.patch +Adds native support for srv records (not really necessary) and also patches axfr-get to decompose SRV and PTR records and write them out in native format, rather than opaque. This last thing is needed to fix a possible problem with tinydns-data. + +dnscache_less_chatty_log +http://sol.truespace.ca/Files/djbdns/log.patch +Makes dnscache log "stat" entries no more than once per 5 seconds. + +tinydns_mmap_leak +http://marc.info/?l=djbdns&m=116399640808774&w=2 +This fixes the following: In the original code if cdb_read encountered an error it returned an error code and the calling function exited without closing the cdb data file resulting in an fd leak, eventually leading to a 'too many files open' error. + +dnscache_big_udp_packets +http://marc.info/?l=djbdns&m=122368590802063&w=2 +Patch to support oversized UDP packets up to 4096 bytes in length, while still correctly truncating responses over 512 bytes when sending them to stub resolvers. + +dnscache_dpos_tcp_servfail +http://marc.info/?l=djbdns&m=119998909915985&w=3 +Fixes broken tcp dns queries in certain situations. For example: A vanilla 1.05 will fail on "dnstxt aol.com aol.com". + +dnscache-cache-negatives +http://sol.truespace.ca/Files/djbdns/nxdomain.patch +Add support for caching of unsuccessful lookup results. + +tinydns_one_second +http://www.tinydns.org/one-second.patch +Causes tinydns to keep its mmap() of the data.cdb file open for at most one second, instead of the default one hundred queries. This improves throughput on high traffic machines. + +dnscache-cachestats.patch +http://romana.now.ie/#djbdns-cachestats +This patch modifies the dnscache program to keep a counter of cache hits and cache misses. Two new fields are added to the stats output line: the fifth number is the number of cache hits; the sixth number is the number of cache misses. + +compiler-temporary-filename.patch +http://homepages.tesco.net/~J.deBoynePollard/Softwares/djbdns/#compiler-temporary-filename +A bit of a nit-picky patch that adjusts the names of generated temorary files to be more 'correct'. A bit silly really. + +dnscache-multiple-ip.patch +http://danp.net/djbdns/patches.html +When applied, dnscache will accept a /-delimited list of IP address in $IP and bind to each in turn. NOTE: This patch is only really useful on embedded systems with very limited memory. On big systems, ther are other ways to achieve listening on multiple IP adresses. You can read more on that over here: http://www.faqts.com/knowledge_base/view.phtml/aid/9644/fid/699 + +dnsnamex-extra-command.patch +http://homepages.tesco.net/~J.deBoynePollard/Softwares/djbdns/#dnsnamex +Not really a patch, but an extra command. dnsnamex prints all of the domain names that the IP address supplied to it maps to, on a single line. + +dnscache-cname-handling.patch +http://homepages.tesco.net/~J.deBoynePollard/FGA/#DNS +Fixes mis-handling of client-side aliases + +dnscache-strict-forwardonly.patch +http://homepages.tesco.net/~J.deBoynePollard/Softwares/djbdns/#dnscache-strict-forwardonly +This patch modifies the behaviour of dnscache such that "forwardonly" mode is fully enforced. + +dnscacheip-space-separator.patch +http://homepages.tesco.net/~J.deBoynePollard/FGA/djbdns-problems.html#dnscacheip-separator-character +Patch to change the separator in ${DNSCACHEIP} to the space character + +tinydns-data-semantic-error.patch +http://homepages.tesco.net/~J.deBoynePollard/FGA/djbdns-problems.html#tinydns-data-semantic-error +Fixes the fact that stock tinydns-data doesn't handle semantic errors in its input + +tinydns-alias-chain-truncation.patch +http://homepages.tesco.net/~J.deBoynePollard/FGA/djbdns-problems.html#tinydns-alias-chain-truncation +Fixes truncation of alias chains by tinydns and axfrdns + +dnscache-slogging.patch +http://www.ohse.de/uwe/patches.html +Patch to enable statistics logging of queried resource records. +This patch is merged with the patch server-1.05-nxdomain-logging.patch that logs nxdomain queries. +http://danp.net/djbdns/ + +dnsfilter-replace.patch +http://www.ohse.de/uwe/patches.html +This patch adds an option to the dnsfilter program (-r). It's use makes dnsfilter simply replace the IP address by the host name if possible. If the IP address cannot be determined for whatever reason then it will be left alone. -r stands for replace. + +dnscache_sigpipe_fix +http://marc.info/?l=djbdns&m=104804013229536&w=2 +This patch tells dnscache to ignore the SIGPIPE signal. + +ignoreip2.patch +http://tinydns.org/djbdns-1.05-ignoreip2.patch +This patch change djbdns's dnscache so that it will ignore thex IP addresses given in the ignoreip file. This patch was made to boycott Verisign, amongst others, who decided to start supplying replies to non-existant and wildcard domains. NOTE: This feature is disabled in the config file by default. Be careful with this one. + +bugfix-dnscache-dempsky-poison.patch +http://www.securityfocus.com/archive/1/501294/30/0/threaded +Patch to fix a potential cache-poisoning attack. This bug only affects domains that serve DNS content using tinydns and axfrdns (only for DNS queries over TCP; clients do not need AXFR permissions) from djbdns 1.05 and allow untrusted users to include arbitrary records. + +bugfix-dnscache-merge-outgoing-requests.patch +http://www.your.org/dnscache/ +This patch prevents a class of poisoning attack by combining identical requests from clients into one outgoing query. Without this patch, an attacker can coerce dnscache into launching hundreds of identical queries at once, making a specific type of attack several orders of magnitude easier. + +bugfix-dnscache-cache-soa-records.patch +http://www.your.org/dnscache/ +This patch allows dnscache to store the responses of "SOA" type queries in its cache. SOA responses are the only type of response unconditionally uncached. dnscache uses its internal cache to prevent certain classes of poisoning attack. Attackers may choose to send floods of SOA requests to bypass these protections. + +dnrqx +http://homepages.tesco.net/~J.deBoynePollard/Softwares/djbdns/dnsqrx +Not really a patch, but a handy script to make dnsq query a given name server instead of the one in /etc/resolv.conf. + +Possible future enhancements to this package +============================================ +- add a Luci webinterface +- add scripts to make the DNS daemons run using daemontools to increase the reliability of the services +- ipv6 support + diff --git a/net/djbdns/files/axfrdns.init b/net/djbdns/files/axfrdns.init new file mode 100644 index 0000000..a40f93a --- /dev/null +++ b/net/djbdns/files/axfrdns.init @@ -0,0 +1,73 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2012 OpenWrt.org +# +# version 20090401 jhalfmoon + +START=47 +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/tcpserver +NAME=tcpserver +DESC="Zone transfer name server" + +APP=/usr/bin/axfrdns +ROOT=/tmp/tinydns + +if [ ! -e /etc/tinydns/data ] ; then + echo Error: Dependency tinydns not found. + exit 111 +fi + +start() { + echo "Starting $DESC: $NAME" + config_load djbdns + mkdir -p $ROOT + ln -sf /etc/tinydns/data $ROOT/data + cd $ROOT + tinydns-data + chown -R $UID:$GID $ROOT + tcprules $ROOT/tcp.cdb $ROOT/tcp.cdb.tmp < /etc/axfrdns/tcp + config_foreach get_userids global + config_foreach start_daemon axfrdns +} + +get_userids() { + local cfg="$1" + config_get UID "$cfg" runasuser + config_get GID "$cfg" runasgroup + UID=`id -u $UID` + GID=`id -g $GID` +} + +start_daemon() { + local cfg="$1" + config_get logging "$cfg" logging + config_get iface "$cfg" interface + config_get AXFR "$cfg" allowedzones +# Unset AXFR if it is empty + [ -z $AXFR ] && export -n AXFR +# Translate listening interfaces to ip addresses + . /lib/functions/network.sh + network_get_ipaddr IP "$iface" || return 1 + export ROOT + if [ "$DEBUG" == 1 ] ; then + $DAEMON -vDRHl0 -c40 -b10 -x $ROOT/tcp.cdb -- $IP 53 $APP + elif [ "$logging" == '1' ] ; then + $DAEMON -vDRHl0 -c40 -b10 -x $ROOT/tcp.cdb -- $IP 53 $APP 2>&1 | logger -p local1.info -t $NAME & + else + $DAEMON -DRHl0 -c40 -b10 -x $ROOT/tcp.cdb -- $IP 53 $APP > /dev/null 2>&1 & + fi +} + +stop() { + echo -n "Stopping $DESC: $NAME" + kill `pidof $NAME|sed "s/$$//g"` > /dev/null 2>&1 + echo " ." +} + +restart() { + echo "Restarting $DESC: $NAME... " + stop + sleep 2 + start +} + diff --git a/net/djbdns/files/axfrdns/tcp b/net/djbdns/files/axfrdns/tcp new file mode 100644 index 0000000..1dc715b --- /dev/null +++ b/net/djbdns/files/axfrdns/tcp @@ -0,0 +1,5 @@ +#Example rules for djb's tcpserver +127.0.0.:allow +10.1.1.:allow +192.168.1.:allow +:deny diff --git a/net/djbdns/files/djbdns.conf b/net/djbdns/files/djbdns.conf new file mode 100644 index 0000000..9541142 --- /dev/null +++ b/net/djbdns/files/djbdns.conf @@ -0,0 +1,41 @@ + +config 'global' + option 'runasuser' 'nobody' + option 'runasgroup' 'nobody' + +config 'dnscache' + option 'interface' 'wan' + option 'interfacesend' 'wan' + option 'defaultallowif' 'lan wan' + option 'cachesize' '1000000' + option 'hidettl' '0' + option 'forwardonly' '1' + option 'useresolvconf' '1' + list 'resolver' '208.67.222.222' + list 'resolver' '208.67.220.220' + option 'useignore' '0' + list 'ignoreip' '203.119.4.28' + list 'ignoreip' '212.181.91.6' + list 'ignoreip' '62.4.64.119' + list 'ignoreip' '64.70.19.33' + list 'ignoreip' '69.25.75.72' + option 'logging' '0' + +config 'tinydns' + option 'interface' 'wan' + option 'logging' '0' + +config 'axfrdns' + option 'interface' 'wan' + option 'allowedzones' '' + option 'logging' '0' + +config 'rbldns' + option 'interface' 'wan' + option 'base' 'test' + option 'logging' '0' + +config 'walldns' + option 'interface' 'wan' + option 'logging' '0' + diff --git a/net/djbdns/files/dnscache.init b/net/djbdns/files/dnscache.init new file mode 100644 index 0000000..97f8ee9 --- /dev/null +++ b/net/djbdns/files/dnscache.init @@ -0,0 +1,122 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2012 OpenWrt.org + +# Preferably start dnscache after udhcpd/dnsmasq, to be sure /etc/resolv.conf is set correctly. dnsmasq is at S60, so dnscache is put at S65 as seen below. If /etc/resolv.conf is not used, then dnscache may be started at S47, just after the firewall has been set up. +START=65 +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/dnscache +NAME=dnscache +DESC="Caching name server" + +ROOT="/tmp/dnscache" +resolvfile="/etc/resolv.conf" + +start() { + echo "Starting $DESC: $NAME" + config_load djbdns + config_foreach get_userids global + mkdir -p $ROOT + cp -fa /etc/dnscache/* $ROOT + rm -f $ROOT/resolvers + rm -f $ROOT/ignoreip + chown -R $UID:$GID $ROOT + config_foreach start_dnscache dnscache +} + +get_userids() { + local cfg="$1" + config_get UID "$cfg" runasuser + config_get GID "$cfg" runasgroup + UID=`id -u $UID` + GID=`id -g $GID` +} + +append_server() { + echo $1 >> $ROOT/resolvers +} + +append_ignore() { + echo $1 >> $ROOT/ignoreip +} + +start_dnscache() { + local cfg="$1" + config_get logging "$cfg" logging + config_get useresolvconf "$cfg" useresolvconf + config_get iface "$cfg" interface + config_get ifacesend "$cfg" interfacesend + config_get defaultallowif "$cfg" defaultallowif + config_get CACHESIZE "$cfg" cachesize + config_get FORWARDONLY "$cfg" forwardonly + config_get HIDETTL "$cfg" hidettl + config_list_foreach "$cfg" "resolver" append_server + config_get useignore "$cfg" useignore + if [ "$useignore" == "1" ] ; then + config_list_foreach "$cfg" "ignoreip" append_ignore + fi +# Add some interface network addresses to list of allowed IP addresses (assumes /24 networks) + . /lib/functions/network.sh + if [ -n "$defaultallowif" ] ; then + for myinterface in `echo $defaultallowif`; do + network_get_ipaddr addr $myinterface || continue + # the next line strips the last octet from the ip address + addr=`echo $addr|sed 's/.[0-9]\+$//'` + touch $ROOT/ip/$addr + echo Adding $ROOT/ip/$addr + done + fi +# Translate listen interface names to IP addresses + network_get_ipaddr IP "$iface" +# Translate send interface name to an IP address + network_get_ipaddr IPSEND "$ifacesend" +# Unset HIDETTL if equal to 0 + if [ "$HIDETTL" == "0" ] ; then + export -n HIDETTL + fi +# If forwardingonly set then activate list of resolvers + if [ "$FORWARDONLY" == "0" ] ; then + # Unset FORWARDONLY if equal to '0' + export -n FORWARDONLY + else +# Use either fixed list of dnsservers or resolv.conf data + if [ "$useresolvconf" == "1" ] ; then + if [ -s "$resolvfile" ] ; then + cat $resolvfile|grep nameserver|sed 's/nameserver //g' > $ROOT/resolvers + else + echo Error: $resolvfile does not exist. + exit 1 + fi + fi + if [ ! "`cat $ROOT/resolvers|wc -L`" == "0" ] ; then + cp -f $ROOT/resolvers $ROOT/servers/@ > /dev/null 2>&1 + else + echo Error: No resolvers are defined. + exit 1 + fi + fi + export IP + export ROOT +# dnscache likes to receive a 128 byte random seed + dd if=/dev/urandom of=$ROOT/randomseed bs=128 count=1 > /dev/null 2>&1 + if [ "$DEBUG" == 1 ] ; then + $DAEMON < /$ROOT/randomseed + elif [ "$logging" == '1' ] ; then + $DAEMON 2>&1 < /$ROOT/randomseed | logger -p local1.info -t $NAME & + else + $DAEMON > /dev/null 2>&1 < /$ROOT/randomseed & + fi +} + +stop() { + echo -n "Stopping $DESC: $NAME" + kill `pidof $NAME|sed "s/$$//g"` > /dev/null 2>&1 + echo " ." +} + +restart() { + echo "Restarting $DESC: $NAME... " + stop + sleep 2 + start +} + diff --git a/net/djbdns/files/dnscache/dnsroots.global b/net/djbdns/files/dnscache/dnsroots.global new file mode 100644 index 0000000..e69de29 diff --git a/net/djbdns/files/dnscache/ignoreip-update b/net/djbdns/files/dnscache/ignoreip-update new file mode 100644 index 0000000..98a2c38 --- /dev/null +++ b/net/djbdns/files/dnscache/ignoreip-update @@ -0,0 +1,95 @@ +#!/bin/sh +# +# update-ignoreip version 0.1 +# Written by J.P. Larocque, , OpenPGP 0x0c14cdda +# This software is in the public domain. +# +# This script is intended for djbdns users that have applied Russell +# Nelson's patch to circumvent wildcard A records in TLDs: +# +# http://tinydns.org/djbdns-1.05-ignoreip2.patch +# +# This script will try the wildcard name for each TLD in the +# 'stupid_tlds' variable (eg, '*.com', '*.cx', etc.). For those +# addresses that resolve, they get added to your dnscache +# 'root/ignoreip' file, and dnscache is restarted. +# +# Run this script from your dnscache directory. This script depends +# on a proper PATH. Old 'root/ignoreips' entries are kept (and dups +# removed), so you can add this program to a cron job to keep ahead +# of new bogus redirection addresses added by Verisign and other TLD +# operators. +# +# Adding this script to a cron job was its intended purpose, but +# please don't do so without understanding how it works and what could +# happen if it breaks. +# +# The latest version of this program can be found at the URL: +# http://ely.ath.cx/~piranha/software/ignoreip-update/ +# This program has been signed with my public key. Its fingerprint is: +# 810B A0AC A7F7 2899 46D2 F2F6 3E7D 5279 0C14 CDDA +# The detached signature can be found at the URL: +# http://ely.ath.cx/~piranha/software/ignoreip-update/ignoreip-update-0.1.asc +# +# Changelog: +# version 0.1 (2003/Sep/17) +# Initially written and released. + +stupid_tlds='ac cc com cx museum net nu ph sh tm ws' +ignoreip='root/ignoreip' + +set -e + +me="`basename "$0"`" + +if [ ! -d 'root' ]; then + echo "$me: run me from the dnscache directory" >&2 + exit 1 +fi + +# I originally implemented this with random names, then realized all +# the current $stupid_tlds answer to "*.$stupid_tld" just like any +# other random name. This code may be useful in the future, if an +# arms race of sorts develops. (Sigh.) + +if which md5sum > /dev/null 2>&1; then + hash_prog=md5sum +elif which md5 > /dev/null 2>&1; then + hash_prog=md5 +else + echo "$me: can't find a suitable hash program" >&2 + exit 1 +fi + +[ "$1" = '-v' ] && verbose=1 || verbose='' + +temp1="`mktemp "ignoreip-update-$$-1-XXXXXX"`" +temp2="`mktemp "ignoreip-update-$$-2-XXXXXX"`" +trap 'rm -f "$temp1" "$temp2"' EXIT + +## Generate random name +#rand="`dd if=/dev/urandom bs=16 count=1 2> /dev/null | "$hash_prog"`" + +# Do lookups on random addresses; break into one addres/line; remove +# empty lines +for stupid_tld in $stupid_tlds; do + dnsip "$rand.$stupid_tld" + #dnsip "*.$stupid_tld" +done | xargs -n 1 echo | grep '.' > "$temp1" + +# Abort if there were no new bogus addresses +[ ! -s "$temp1" ] && exit + +# Remove duplicates (from old list and, eg, .sh/.tm) +touch "$ignoreip" +sort "$ignoreip" "$temp1" | uniq > "$temp2" + +if [ "$verbose" ]; then + diff -u "$ignoreip" "$temp2" || true +fi + +# Update list and restart dnscache +chmod 644 "$temp2" +mv "$temp2" "$ignoreip" +#svc -t . + diff --git a/net/djbdns/files/dnscache/servers/@ b/net/djbdns/files/dnscache/servers/@ new file mode 100644 index 0000000..e69de29 diff --git a/net/djbdns/files/dnsqrx b/net/djbdns/files/dnsqrx new file mode 100644 index 0000000..3202e94 --- /dev/null +++ b/net/djbdns/files/dnsqrx @@ -0,0 +1,9 @@ +#!/bin/sh +# (c) Copyright 2003-2003 Jonathan de Boyne Pollard. All rights reserved. "Moral" rights asserted. +# Permission is hereby granted to distribute this script unmodified. +# This script requires the patch that changes the ${DNSCACHEIP} separator, which can be found at . +t=${1?Missing type} +n=${2?Missing name} +s=${3?Missing server} +i=`dnsip $s` +DNSCACHEIP=${i:?Bad server name} dnsqr $t $n diff --git a/net/djbdns/files/dnsroots-update b/net/djbdns/files/dnsroots-update new file mode 100644 index 0000000..29ffc16 --- /dev/null +++ b/net/djbdns/files/dnsroots-update @@ -0,0 +1,9 @@ +#!/bin/sh + +# This is a script that outputs the current list of active DNS +# root servers. To run, it requires an active internet connection +# and a working resolving DNS server. It also requires that the +# djbdns dnstools be installed, or at least the tools dnsqr and +# dnsip. + +dnsqr ns .|grep answer|cut -f 5 -d " "|sort|while read server; do dnsip $server; done diff --git a/net/djbdns/files/rbldns.init b/net/djbdns/files/rbldns.init new file mode 100644 index 0000000..dfe98f4 --- /dev/null +++ b/net/djbdns/files/rbldns.init @@ -0,0 +1,67 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2012 OpenWrt.org +# +# version 20090401 jhalfmoon + +START=46 +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/rbldns +NAME=rbldns +DESC="Reverse DNS wall" + +ROOT=/tmp/rbldns + +start() { + echo "Starting $DESC: $NAME" + config_load djbdns + config_foreach get_userids global + rm -rf $ROOT + mkdir -p $ROOT + ln -fs /etc/rbldns/data $ROOT/data + cd $ROOT + rbldns-data + chown -R $UID:$GID $ROOT + config_foreach start_daemon rbldns +} + +get_userids() { + local cfg="$1" + config_get UID "$cfg" runasuser + config_get GID "$cfg" runasgroup + UID=`id -u $UID` + GID=`id -g $GID` +} + +start_daemon() { + local cfg="$1" + config_get logging "$cfg" logging + config_get iface "$cfg" interface + config_get BASE "$cfg" base +# Unset BASE if it is empty + [ -z $BASE ] && export -n BASE +# Translate listening interfaces to ip addresses + . /lib/functions/network.sh + network_get_ipaddr IP "$iface" + export ROOT + if [ "$DEBUG" == 1 ] ; then + $DAEMON + elif [ "$logging" == '1' ] ; then + $DAEMON 2>&1 | logger -p local1.info -t $NAME & + else + $DAEMON > /dev/null 2>&1 & + fi +} + +stop() { + echo -n "Stopping $DESC: $NAME" + kill `pidof $NAME|sed "s/$$//g"` > /dev/null 2>&1 + echo " ." +} + +restart() { + echo "Restarting $DESC: $NAME... " + stop + sleep 2 + start +} + diff --git a/net/djbdns/files/rbldns/data b/net/djbdns/files/rbldns/data new file mode 100644 index 0000000..85aae01 --- /dev/null +++ b/net/djbdns/files/rbldns/data @@ -0,0 +1,5 @@ +#example rdldns data file +1.2.4.8 +10.0.0.1 +192.168.0.0/16 +:127.0.0.1:www.somesite.com diff --git a/net/djbdns/files/tinydns.init b/net/djbdns/files/tinydns.init new file mode 100644 index 0000000..bff119d --- /dev/null +++ b/net/djbdns/files/tinydns.init @@ -0,0 +1,63 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2012 OpenWrt.org +# +# version 20090401 jhalfmoon + +START=46 +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/tinydns +NAME=tinydns +DESC="Authoritative nameserver" + +ROOT=/tmp/tinydns + +start() { + echo "Starting $DESC: $NAME" + config_load djbdns + config_foreach get_userids global + mkdir -p $ROOT + ln -sf /etc/tinydns/data $ROOT/data + cd $ROOT + tinydns-data + chown -R $UID:$GID $ROOT + config_foreach start_daemon tinydns +} + +get_userids() { + local cfg="$1" + config_get UID "$cfg" runasuser + config_get GID "$cfg" runasgroup + UID=`id -u $UID` + GID=`id -g $GID` +} + +start_daemon() { + local cfg="$1" + config_get logging "$cfg" logging + config_get iface "$cfg" interface +# Translate listening interfaces to ip addresses + . /lib/functions/network.sh + network_get_ipaddr IP "$iface" + export ROOT + if [ "$DEBUG" == 1 ] ; then + $DAEMON + elif [ "$logging" == '1' ] ; then + $DAEMON 2>&1 | logger -p local1.info -t $NAME & + else + $DAEMON > /dev/null 2>&1 & + fi +} + +stop() { + echo -n "Stopping $DESC: $NAME" + kill `pidof $NAME|sed "s/$$//g"` > /dev/null 2>&1 + echo " ." +} + +restart() { + echo "Restarting $DESC: $NAME... " + stop + sleep 2 + start +} + diff --git a/net/djbdns/files/tinydns/add-alias b/net/djbdns/files/tinydns/add-alias new file mode 100644 index 0000000..eada7a0 --- /dev/null +++ b/net/djbdns/files/tinydns/add-alias @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/local/bin/tinydns-edit data data.new add alias ${1+"$@"} diff --git a/net/djbdns/files/tinydns/add-childns b/net/djbdns/files/tinydns/add-childns new file mode 100644 index 0000000..4114b3e --- /dev/null +++ b/net/djbdns/files/tinydns/add-childns @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/local/bin/tinydns-edit data data.new add childns ${1+"$@"} diff --git a/net/djbdns/files/tinydns/add-host b/net/djbdns/files/tinydns/add-host new file mode 100644 index 0000000..9c61b4e --- /dev/null +++ b/net/djbdns/files/tinydns/add-host @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/local/bin/tinydns-edit data data.new add host ${1+"$@"} diff --git a/net/djbdns/files/tinydns/add-mx b/net/djbdns/files/tinydns/add-mx new file mode 100644 index 0000000..c31a37f --- /dev/null +++ b/net/djbdns/files/tinydns/add-mx @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/local/bin/tinydns-edit data data.new add mx ${1+"$@"} diff --git a/net/djbdns/files/tinydns/add-ns b/net/djbdns/files/tinydns/add-ns new file mode 100644 index 0000000..b35d2b0 --- /dev/null +++ b/net/djbdns/files/tinydns/add-ns @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/local/bin/tinydns-edit data data.new add ns ${1+"$@"} diff --git a/net/djbdns/files/tinydns/data b/net/djbdns/files/tinydns/data new file mode 100644 index 0000000..001311e --- /dev/null +++ b/net/djbdns/files/tinydns/data @@ -0,0 +1,59 @@ +# example verbose tinydns data file +# from http://www.pjvenda.org/linux/doc/tinydns/ +# Copyright (C) 2001-2009 by Pedro Venda +# licensed under a Creative Commons Attribution 2.5 License +# +# REVERSE ZONE +# +# (reverse) dns servers: primary and secondary +Z45.168.192.in-addr.arpa:ns.example.net:hostmaster.example.net:::::::: + +# NS records +&45.168.192.in-addr.arpa::ns.example.net::: +&45.168.192.in-addr.arpa::ns2.example.net::: + +# MX handlers +@45.168.192.in-addr.arpa::relay.example.net:10 +@45.168.192.in-addr.arpa::relay2.example.net:20 + +# +# FORWARD ZONE: +# +# SOA record: primary nameserver is ns.example.net and hostmaster +# mail address is hostmaster@example.net +# (the 'Z' configuration line is the only one that +# allows specifying the hostmaster mail address) +Zexample.net:ns.example.net:hostmaster.example.net:::::::: + +# NS records: primary and secondary nameservers +&example.net::ns.example.net::: +&example.net::ns2.example.net::: + +# MX records: relay.example.net, distance = 10 +# relay2.example.net, distance = 20 +@example.net::relay.example.net:10 +@example.net::relay2.example.net:20 + +# A records: ns.example.net, ns2.example.net +=ns.example.net:192.168.45.1::: +=ns2.example.net:192.168.45.2::: + +# PTR records: relays are in the same hosts as dns servers ++relay.example.net:192.168.45.1::: ++relay2.example.net:192.168.45.2::: + +# more A records: gateway.example.net +=gateway.example.net:192.168.45.254::: + +# CNAME record: nscache.example.net is alias to gateway.example.net +Cnscache.example.net:gateway.example.net::: + +# +# SUB DOMAIN DELEGATION +# + +# NS record +&dmz.example.net::ns.dmz.example.net::: + +# A/PTR record for nameserver +=ns.dmz.example.net:192.168.90.1::: diff --git a/net/djbdns/files/walldns.init b/net/djbdns/files/walldns.init new file mode 100644 index 0000000..9d4f773 --- /dev/null +++ b/net/djbdns/files/walldns.init @@ -0,0 +1,61 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2012 OpenWrt.org +# +# version 20090401 jhalfmoon + +START=46 +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/walldns +NAME=walldns +DESC="Reverse DNS wall" + +ROOT=/tmp/walldns + +start() { + echo "Starting $DESC: $NAME" + config_load djbdns + config_foreach get_userids global + rm -rf $ROOT + mkdir -p $ROOT + chown -R $UID:$GID $ROOT + config_foreach start_daemon walldns +} + +get_userids() { + local cfg="$1" + config_get UID "$cfg" runasuser + config_get GID "$cfg" runasgroup + UID=`id -u $UID` + GID=`id -g $GID` +} + +start_daemon() { + local cfg="$1" + config_get logging "$cfg" logging + config_get iface "$cfg" interface +# Translate listening interfaces to ip addresses + . /lib/functions/network.sh + network_get_ipaddr IP "$iface" + export ROOT + if [ "$DEBUG" == 1 ] ; then + $DAEMON + elif [ "$logging" == '1' ] ; then + $DAEMON 2>&1 | logger -p local1.info -t $NAME & + else + $DAEMON > /dev/null 2>&1 & + fi +} + +stop() { + echo -n "Stopping $DESC: $NAME" + kill `pidof $NAME|sed "s/$$//g"` > /dev/null 2>&1 + echo " ." +} + +restart() { + echo "Restarting $DESC: $NAME... " + stop + sleep 2 + start +} + diff --git a/net/djbdns/patches/010-crosscompile.patch b/net/djbdns/patches/010-crosscompile.patch new file mode 100644 index 0000000..68ce1c3 --- /dev/null +++ b/net/djbdns/patches/010-crosscompile.patch @@ -0,0 +1,170 @@ +--- a/Makefile ++++ b/Makefile +@@ -29,10 +29,6 @@ auto-str.o: \ + compile auto-str.c buffer.h exit.h + ./compile auto-str.c + +-auto_home.c: \ +-auto-str conf-home +- ./auto-str auto_home `head -1 conf-home` > auto_home.c +- + auto_home.o: \ + compile auto_home.c + ./compile auto_home.c +@@ -221,10 +217,6 @@ compile dd.c dns.h stralloc.h gen_alloc. + uint64.h taia.h dd.h + ./compile dd.c + +-direntry.h: \ +-choose compile trydrent.c direntry.h1 direntry.h2 +- ./choose c trydrent direntry.h1 direntry.h2 > direntry.h +- + dns.a: \ + makelib dns_dfd.o dns_domain.o dns_dtda.o dns_ip.o dns_ipq.o dns_mx.o \ + dns_name.o dns_nd.o dns_packet.o dns_random.o dns_rcip.o dns_rcrw.o \ +@@ -508,12 +500,6 @@ systype hasdevtcp.h1 hasdevtcp.h2 + *) cat hasdevtcp.h1 ;; \ + esac ) > hasdevtcp.h + +-hasshsgr.h: \ +-choose compile load tryshsgr.c hasshsgr.h1 hasshsgr.h2 chkshsgr \ +-warn-shsgr +- ./chkshsgr || ( cat warn-shsgr; exit 1 ) +- ./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h +- + hier.o: \ + compile hier.c auto_home.h + ./compile hier.c +@@ -534,10 +520,6 @@ instcheck.o: \ + compile instcheck.c strerr.h error.h exit.h + ./compile instcheck.c + +-iopause.h: \ +-choose compile load trypoll.c iopause.h1 iopause.h2 +- ./choose clr trypoll iopause.h1 iopause.h2 > iopause.h +- + iopause.o: \ + compile iopause.c taia.h tai.h uint64.h select.h iopause.h taia.h + ./compile iopause.c +@@ -590,7 +572,7 @@ warn-auto.sh systype + dgux-*) ;; \ + hp-ux-*) ;; \ + sco*) ;; \ +- *) echo 'ranlib "$$main"' ;; \ ++ *) echo '$(if $(TARGET_RANLIB),$(TARGET_RANLIB),ranlib) "$$main"' ;; \ + esac \ + ) > makelib + chmod 755 makelib +@@ -766,10 +748,6 @@ seek_set.o: \ + compile seek_set.c seek.h + ./compile seek_set.c + +-select.h: \ +-choose compile trysysel.c select.h1 select.h2 +- ./choose c trysysel select.h1 select.h2 > select.h +- + server.o: \ + compile server.c byte.h case.h env.h buffer.h strerr.h ip4.h uint16.h \ + ndelay.h socket.h uint16.h droproot.h qlog.h uint16.h response.h \ +@@ -1060,10 +1038,6 @@ uint32_unpack.o: \ + compile uint32_unpack.c uint32.h + ./compile uint32_unpack.c + +-uint64.h: \ +-choose compile load tryulong64.c uint64.h1 uint64.h2 +- ./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h +- + unix.a: \ + makelib buffer_read.o buffer_write.o error.o error_str.o ndelay_off.o \ + ndelay_on.o open_read.o open_trunc.o openreadclose.o readclose.o \ +--- /dev/null ++++ b/auto_home.c +@@ -0,0 +1,3 @@ ++const char auto_home[] = "\ ++\057\165\163\162\ ++"; +--- a/conf-cc ++++ b/conf-cc +@@ -1,3 +1,3 @@ +-gcc -O2 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings ++$TARGET_CC $TARGET_CFLAGS -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings -include errno.h + + This will be used to compile .c files. +--- a/conf-home ++++ b/conf-home +@@ -1,4 +1,4 @@ +-/usr/local ++/usr + + This is the dnscache home directory. Programs will be installed in + .../bin. +--- a/conf-ld ++++ b/conf-ld +@@ -1,3 +1,3 @@ +-gcc -s ++$TARGET_CC -s $TARGET_LDFLAGS + + This will be used to link .o files into an executable. +--- /dev/null ++++ b/direntry.h +@@ -0,0 +1,10 @@ ++#ifndef DIRENTRY_H ++#define DIRENTRY_H ++ ++/* sysdep: +dirent */ ++ ++#include ++#include ++#define direntry struct dirent ++ ++#endif +--- /dev/null ++++ b/hasshsgr.h +@@ -0,0 +1 @@ ++/* sysdep: -shortsetgroups */ +--- /dev/null ++++ b/iopause.h +@@ -0,0 +1,18 @@ ++#ifndef IOPAUSE_H ++#define IOPAUSE_H ++ ++/* sysdep: +poll */ ++#define IOPAUSE_POLL ++ ++#include ++#include ++ ++typedef struct pollfd iopause_fd; ++#define IOPAUSE_READ POLLIN ++#define IOPAUSE_WRITE POLLOUT ++ ++#include "taia.h" ++ ++extern void iopause(iopause_fd *,unsigned int,struct taia *,struct taia *); ++ ++#endif +--- /dev/null ++++ b/select.h +@@ -0,0 +1,11 @@ ++#ifndef SELECT_H ++#define SELECT_H ++ ++/* sysdep: +sysselect */ ++ ++#include ++#include ++#include ++extern int select(); ++ ++#endif +--- /dev/null ++++ b/uint64.h +@@ -0,0 +1,8 @@ ++#ifndef UINT64_H ++#define UINT64_H ++ ++/* sysdep: -ulong64 */ ++ ++typedef unsigned long long uint64; ++ ++#endif diff --git a/net/djbdns/patches/020-dnsroots-update.patch b/net/djbdns/patches/020-dnsroots-update.patch new file mode 100644 index 0000000..ce5b863 --- /dev/null +++ b/net/djbdns/patches/020-dnsroots-update.patch @@ -0,0 +1,19 @@ +--- a/dnsroots.global ++++ b/dnsroots.global +@@ -1,5 +1,5 @@ + 198.41.0.4 +-128.9.0.107 ++192.228.79.201 + 192.33.4.12 + 128.8.10.90 + 192.203.230.10 +@@ -7,7 +7,7 @@ + 192.112.36.4 + 128.63.2.53 + 192.36.148.17 +-198.41.0.10 ++192.58.128.30 + 193.0.14.129 +-198.32.64.12 ++199.7.83.42 + 202.12.27.33 diff --git a/net/djbdns/patches/030-srv-records-and-axfrget.patch b/net/djbdns/patches/030-srv-records-and-axfrget.patch new file mode 100644 index 0000000..1d16380 --- /dev/null +++ b/net/djbdns/patches/030-srv-records-and-axfrget.patch @@ -0,0 +1,135 @@ +From: Michael Handler +To: dns@list.cr.yp.to +Subject: tinydns-data SRV & axfr-get SRV/PTR patches +Date: Thu, 14 Sep 2000 20:37:50 -0400 + +Here's a combined patch that: + +a) adds a native SRV type to tinydns-data + +Sfqdn:ip:x:port:weight:priority:ttl:timestamp + +Standard rules for ip, x, ttl, and timestamp apply. Port, weight, and +priority all range from 0-65535. Weight and priority are optional; they +default to zero if not provided. + +Sconsole.zoinks.example.com:1.2.3.4:rack102-con1:2001:69:7:300: + +b) makes axfr-get decompose SRV and PTR records and write them out in +native format, rather than opaque. Again, this is necessary because if the +DNAME fields in the records reference the same zone as fqdn, they can have +compression pointers that are bogus outside the context of that specific +packet, and which can't be correctly loaded into data.cdb by tinydns-data. + +--michael + +Laurent G. Bercot updated it for djbdns-1.05: + +--- a/axfr-get.c ++++ b/axfr-get.c +@@ -209,6 +209,26 @@ unsigned int doit(char *buf,unsigned int + if (!stralloc_cats(&line,".:")) return 0; + if (!stralloc_catulong0(&line,dist,0)) return 0; + } ++ else if (byte_equal(data,2,DNS_T_SRV)) { ++ uint16 dist, weight, port; ++ if (!stralloc_copys(&line,"S")) return 0; ++ if (!dns_domain_todot_cat(&line,d1)) return 0; ++ if (!stralloc_cats(&line,"::")) return 0; ++ pos = x_copy(buf,len,pos,data,2); ++ uint16_unpack_big(data,&dist); ++ pos = x_copy(buf,len,pos,data,2); ++ uint16_unpack_big(data,&weight); ++ pos = x_copy(buf,len,pos,data,2); ++ uint16_unpack_big(data,&port); ++ x_getname(buf,len,pos,&d1); ++ if (!dns_domain_todot_cat(&line,d1)) return 0; ++ if (!stralloc_cats(&line,".:")) return 0; ++ if (!stralloc_catulong0(&line,dist,0)) return 0; ++ if (!stralloc_cats(&line,":")) return 0; ++ if (!stralloc_catulong0(&line,weight,0)) return 0; ++ if (!stralloc_cats(&line,":")) return 0; ++ if (!stralloc_catulong0(&line,port,0)) return 0; ++ } + else if (byte_equal(data,2,DNS_T_A) && (dlen == 4)) { + char ipstr[IP4_FMT]; + if (!stralloc_copys(&line,"+")) return 0; +@@ -217,6 +237,14 @@ unsigned int doit(char *buf,unsigned int + x_copy(buf,len,pos,data,4); + if (!stralloc_catb(&line,ipstr,ip4_fmt(ipstr,data))) return 0; + } ++ else if (byte_equal(data,2,DNS_T_PTR)) { ++ if (!stralloc_copys(&line,"^")) return 0; ++ if (!dns_domain_todot_cat(&line,d1)) return 0; ++ if (!stralloc_cats(&line,":")) return 0; ++ x_getname(buf,len,pos,&d1); ++ if (!dns_domain_todot_cat(&line,d1)) return 0; ++ if (!stralloc_cats(&line,".")) return 0; ++ } + else { + unsigned char ch; + unsigned char ch2; +--- a/dns.h ++++ b/dns.h +@@ -20,6 +20,7 @@ + #define DNS_T_SIG "\0\30" + #define DNS_T_KEY "\0\31" + #define DNS_T_AAAA "\0\34" ++#define DNS_T_SRV "\0\41" + #define DNS_T_AXFR "\0\374" + #define DNS_T_ANY "\0\377" + +--- a/tinydns-data.c ++++ b/tinydns-data.c +@@ -196,6 +196,7 @@ int main() + char type[2]; + char soa[20]; + char buf[4]; ++ char srv[6]; + + umask(022); + +@@ -369,6 +370,43 @@ int main() + rr_finish(d2); + } + break; ++ ++ case 'S': ++ if (!dns_domain_fromdot(&d1,f[0].s,f[0].len)) nomem(); ++ if (!stralloc_0(&f[6])) nomem(); ++ if (!scan_ulong(f[6].s,&ttl)) ttl = TTL_POSITIVE; ++ ttdparse(&f[7],ttd); ++ locparse(&f[8],loc); ++ ++ if (!stralloc_0(&f[1])) nomem(); ++ ++ if (byte_chr(f[2].s,f[2].len,'.') >= f[2].len) { ++ if (!stralloc_cats(&f[2],".srv.")) nomem(); ++ if (!stralloc_catb(&f[2],f[0].s,f[0].len)) nomem(); ++ } ++ if (!dns_domain_fromdot(&d2,f[2].s,f[2].len)) nomem(); ++ ++ if (!stralloc_0(&f[4])) nomem(); ++ if (!scan_ulong(f[4].s,&u)) u = 0; ++ uint16_pack_big(srv,u); ++ if (!stralloc_0(&f[5])) nomem(); ++ if (!scan_ulong(f[5].s,&u)) u = 0; ++ uint16_pack_big(srv + 2,u); ++ if (!stralloc_0(&f[3])) nomem(); ++ if (!scan_ulong(f[3].s,&u)) nomem(); ++ uint16_pack_big(srv + 4,u); ++ ++ rr_start(DNS_T_SRV,ttl,ttd,loc); ++ rr_add(srv,6); ++ rr_addname(d2); ++ rr_finish(d1); ++ ++ if (ip4_scan(f[1].s,ip)) { ++ rr_start(DNS_T_A,ttl,ttd,loc); ++ rr_add(ip,4); ++ rr_finish(d2); ++ } ++ break; + + case '^': case 'C': + if (!dns_domain_fromdot(&d1,f[0].s,f[0].len)) nomem(); diff --git a/net/djbdns/patches/040-dnscache-less-chatty-log.patch b/net/djbdns/patches/040-dnscache-less-chatty-log.patch new file mode 100644 index 0000000..9a881c9 --- /dev/null +++ b/net/djbdns/patches/040-dnscache-less-chatty-log.patch @@ -0,0 +1,39 @@ +--- a/log.h ++++ b/log.h +@@ -1,6 +1,8 @@ + #ifndef LOG_H + #define LOG_H + ++#define STATS_DISPLAY_INTERVAL 5 ++ + #include "uint64.h" + + extern void log_startup(void); +--- a/log.c ++++ b/log.c +@@ -1,6 +1,7 @@ + #include "buffer.h" + #include "uint32.h" + #include "uint16.h" ++#include "time.h" + #include "error.h" + #include "byte.h" + #include "log.h" +@@ -274,11 +275,17 @@ void log_rrsoa(const char server[4],cons + + void log_stats(void) + { ++ static time_t prev = 0; ++ time_t cur = time(NULL); + extern uint64 numqueries; + extern uint64 cache_motion; + extern int uactive; + extern int tactive; + ++ if(prev == 0) prev = time(NULL); ++ if(cur - prev < STATS_DISPLAY_INTERVAL) return; ++ prev = cur; ++ + string("stats "); + number(numqueries); space(); + number(cache_motion); space(); diff --git a/net/djbdns/patches/050-tinydns-mmap-leak.patch b/net/djbdns/patches/050-tinydns-mmap-leak.patch new file mode 100644 index 0000000..1885612 --- /dev/null +++ b/net/djbdns/patches/050-tinydns-mmap-leak.patch @@ -0,0 +1,22 @@ +--- a/tdlookup.c ++++ b/tdlookup.c +@@ -298,9 +298,17 @@ int respond(char *q,char qtype[2],char i + if (!r) r = cdb_find(&c,key,4); + if (!r) r = cdb_find(&c,key,3); + if (!r) r = cdb_find(&c,key,2); +- if (r == -1) return 0; ++ if (r == -1) { ++ cdb_free(&c); ++ close(fd); ++ return 0; ++ } + if (r && (cdb_datalen(&c) == 2)) +- if (cdb_read(&c,clientloc,2,cdb_datapos(&c)) == -1) return 0; ++ if (cdb_read(&c,clientloc,2,cdb_datapos(&c)) == -1) { ++ cdb_free(&c); ++ close(fd); ++ return 0; ++ } + + r = doit(q,qtype); + diff --git a/net/djbdns/patches/060-dnscache-big-udp-packets.patch b/net/djbdns/patches/060-dnscache-big-udp-packets.patch new file mode 100644 index 0000000..8f2c142 --- /dev/null +++ b/net/djbdns/patches/060-dnscache-big-udp-packets.patch @@ -0,0 +1,11 @@ +--- a/dns_transmit.c ++++ b/dns_transmit.c +@@ -240,7 +240,7 @@ void dns_transmit_io(struct dns_transmit + + int dns_transmit_get(struct dns_transmit *d,const iopause_fd *x,const struct taia *when) + { +- char udpbuf[513]; ++ char udpbuf[4097]; + unsigned char ch; + int r; + int fd; diff --git a/net/djbdns/patches/070-dnscache-dpos-tcp-servfail.patch b/net/djbdns/patches/070-dnscache-dpos-tcp-servfail.patch new file mode 100644 index 0000000..8d30d5e --- /dev/null +++ b/net/djbdns/patches/070-dnscache-dpos-tcp-servfail.patch @@ -0,0 +1,10 @@ +--- a/dns_transmit.c ++++ b/dns_transmit.c +@@ -166,6 +166,7 @@ static int thistcp(struct dns_transmit * + taia_uint(&d->deadline,10); + taia_add(&d->deadline,&d->deadline,&now); + if (socket_connect4(d->s1 - 1,ip,53) == 0) { ++ d->pos = 0; + d->tcpstate = 2; + return 0; + } diff --git a/net/djbdns/patches/080-dnscache-cache-negatives.patch b/net/djbdns/patches/080-dnscache-cache-negatives.patch new file mode 100644 index 0000000..793ac87 --- /dev/null +++ b/net/djbdns/patches/080-dnscache-cache-negatives.patch @@ -0,0 +1,41 @@ +--- a/query.c ++++ b/query.c +@@ -193,6 +193,7 @@ static int doit(struct query *z,int stat + int k; + int p; + int q; ++ uint32 cachettl; + + errno = error_io; + if (state == 1) goto HAVEPACKET; +@@ -470,6 +471,7 @@ static int doit(struct query *z,int stat + rcode = header[3] & 15; + if (rcode && (rcode != 3)) goto DIE; /* impossible; see irrelevant() */ + ++ cachettl = 0; + flagout = 0; + flagcname = 0; + flagreferral = 0; +@@ -512,6 +514,11 @@ static int doit(struct query *z,int stat + + uint16_unpack_big(header + 8,&datalen); + pos += datalen; ++ ++ if (flagsoa && (pos <= len)) { ++ cachettl = ttlget(buf + pos - 4); ++ if (soattl < cachettl) cachettl = soattl; ++ } + } + posglue = pos; + +@@ -689,8 +696,8 @@ static int doit(struct query *z,int stat + } + + if (rcode == 3) { +- log_nxdomain(whichserver,d,soattl); +- cachegeneric(DNS_T_ANY,d,"",0,soattl); ++ log_nxdomain(whichserver,d,cachettl); ++ cachegeneric(DNS_T_ANY,d,"",0,cachettl); + + NXDOMAIN: + if (z->level) goto LOWERLEVEL; diff --git a/net/djbdns/patches/090-tinydns-one-second.patch b/net/djbdns/patches/090-tinydns-one-second.patch new file mode 100644 index 0000000..660bbcb --- /dev/null +++ b/net/djbdns/patches/090-tinydns-one-second.patch @@ -0,0 +1,40 @@ +--- a/tdlookup.c ++++ b/tdlookup.c +@@ -280,15 +280,24 @@ static int doit(char *q,char qtype[2]) + + int respond(char *q,char qtype[2],char ip[4]) + { +- int fd; ++ static struct tai cdb_valid = { 0 }; ++ static int fd = -1; ++ struct tai one_second; + int r; + char key[6]; + + tai_now(&now); +- fd = open_read("data.cdb"); +- if (fd == -1) return 0; +- cdb_init(&c,fd); +- ++ if (tai_less(&cdb_valid, &now)) { ++ if (fd != -1) { ++ cdb_free(&c); ++ close(fd); ++ } ++ fd = open_read("data.cdb"); ++ if (fd == -1) return 0; ++ cdb_init(&c,fd); ++ tai_uint(&one_second, 1); ++ tai_add(&cdb_valid, &now, &one_second); ++ } + byte_zero(clientloc,2); + key[0] = 0; + key[1] = '%'; +@@ -312,7 +321,5 @@ int respond(char *q,char qtype[2],char i + + r = doit(q,qtype); + +- cdb_free(&c); +- close(fd); + return r; + } diff --git a/net/djbdns/patches/110-dnscache-cachestats.patch b/net/djbdns/patches/110-dnscache-cachestats.patch new file mode 100644 index 0000000..5404719 --- /dev/null +++ b/net/djbdns/patches/110-dnscache-cachestats.patch @@ -0,0 +1,89 @@ +# +# This patch to djbdns 1.05 modifies the dnscache program to keep a +# counter of cache hits and cache misses. +# +# Two new fields are added to the ``stats'' output line: +# . the fifth number is the number of cache hits +# . the sixth number is the number of cache misses +# e.g. +# @400000003fa92ccc317d70f4 stats 3 1201 1 0 21 49 +# indicates 21 hits and 49 misses. +# +# James Raftery 6 Nov. 2003 +# +--- a/cache.c ++++ b/cache.c +@@ -7,6 +7,11 @@ + + uint64 cache_motion = 0; + ++/* record cache stats */ ++/* James Raftery 6 Nov. 2003 */ ++uint64 cache_hit = 0; ++uint64 cache_miss = 0; ++ + static char *x = 0; + static uint32 size; + static uint32 hsize; +@@ -112,15 +117,20 @@ char *cache_get(const char *key,unsigned + if (u > size - pos - 20 - keylen) cache_impossible(); + *datalen = u; + ++ cache_hit++; + return x + pos + 20 + keylen; + } + } + nextpos = prevpos ^ get4(pos); + prevpos = pos; + pos = nextpos; +- if (++loop > 100) return 0; /* to protect against hash flooding */ ++ if (++loop > 100) { /* to protect against hash flooding */ ++ cache_miss++; ++ return 0; ++ } + } + ++ cache_miss++; + return 0; + } + +--- a/cache.h ++++ b/cache.h +@@ -5,6 +5,12 @@ + #include "uint64.h" + + extern uint64 cache_motion; ++ ++/* record cache stats */ ++/* James Raftery 6 Nov. 2003 */ ++extern uint64 cache_hit; ++extern uint64 cache_miss; ++ + extern int cache_init(unsigned int); + extern void cache_set(const char *,unsigned int,const char *,unsigned int,uint32); + extern char *cache_get(const char *,unsigned int,unsigned int *,uint32 *); +--- a/log.c ++++ b/log.c +@@ -279,6 +279,12 @@ void log_stats(void) + time_t cur = time(NULL); + extern uint64 numqueries; + extern uint64 cache_motion; ++ ++ /* record cache stats */ ++ /* James Raftery 6 Nov. 2003 */ ++ extern uint64 cache_hit; ++ extern uint64 cache_miss; ++ + extern int uactive; + extern int tactive; + +@@ -290,6 +296,8 @@ void log_stats(void) + number(numqueries); space(); + number(cache_motion); space(); + number(uactive); space(); +- number(tactive); ++ number(tactive); space(); ++ number(cache_hit); space(); ++ number(cache_miss); + line(); + } diff --git a/net/djbdns/patches/120-compiler-temporary-filename.patch b/net/djbdns/patches/120-compiler-temporary-filename.patch new file mode 100644 index 0000000..324116d --- /dev/null +++ b/net/djbdns/patches/120-compiler-temporary-filename.patch @@ -0,0 +1,93 @@ +--- a/pickdns-data.c ++++ b/pickdns-data.c +@@ -123,7 +123,7 @@ void syntaxerror(const char *why) + } + void die_datatmp(void) + { +- strerr_die2sys(111,FATAL,"unable to create data.tmp: "); ++ strerr_die2sys(111,FATAL,"unable to create data.cdb.tmp: "); + } + + int main() +@@ -142,7 +142,7 @@ int main() + if (fd == -1) strerr_die2sys(111,FATAL,"unable to open data: "); + buffer_init(&b,buffer_unixread,fd,bspace,sizeof bspace); + +- fdcdb = open_trunc("data.tmp"); ++ fdcdb = open_trunc("data.cdb.tmp"); + if (fdcdb == -1) die_datatmp(); + if (cdb_make_start(&cdb,fdcdb) == -1) die_datatmp(); + +@@ -223,8 +223,8 @@ int main() + if (cdb_make_finish(&cdb) == -1) die_datatmp(); + if (fsync(fdcdb) == -1) die_datatmp(); + if (close(fdcdb) == -1) die_datatmp(); /* NFS stupidity */ +- if (rename("data.tmp","data.cdb") == -1) +- strerr_die2sys(111,FATAL,"unable to move data.tmp to data.cdb: "); ++ if (rename("data.cdb.tmp","data.cdb") == -1) ++ strerr_die2sys(111,FATAL,"unable to move data.cdb.tmp to data.cdb: "); + + _exit(0); + } +--- a/rbldns-data.c ++++ b/rbldns-data.c +@@ -42,7 +42,7 @@ void syntaxerror(const char *why) + } + void die_datatmp(void) + { +- strerr_die2sys(111,FATAL,"unable to create data.tmp: "); ++ strerr_die2sys(111,FATAL,"unable to create data.cdb.tmp: "); + } + + int main() +@@ -59,7 +59,7 @@ int main() + if (fd == -1) strerr_die2sys(111,FATAL,"unable to open data: "); + buffer_init(&b,buffer_unixread,fd,bspace,sizeof bspace); + +- fdcdb = open_trunc("data.tmp"); ++ fdcdb = open_trunc("data.cdb.tmp"); + if (fdcdb == -1) die_datatmp(); + if (cdb_make_start(&cdb,fdcdb) == -1) die_datatmp(); + +@@ -121,8 +121,8 @@ int main() + if (cdb_make_finish(&cdb) == -1) die_datatmp(); + if (fsync(fdcdb) == -1) die_datatmp(); + if (close(fdcdb) == -1) die_datatmp(); /* NFS stupidity */ +- if (rename("data.tmp","data.cdb") == -1) +- strerr_die2sys(111,FATAL,"unable to move data.tmp to data.cdb: "); ++ if (rename("data.cdb.tmp","data.cdb") == -1) ++ strerr_die2sys(111,FATAL,"unable to move data.cdb.tmp to data.cdb: "); + + _exit(0); + } +--- a/tinydns-data.c ++++ b/tinydns-data.c +@@ -27,7 +27,7 @@ + + void die_datatmp(void) + { +- strerr_die2sys(111,FATAL,"unable to create data.tmp: "); ++ strerr_die2sys(111,FATAL,"unable to create data.cdb.tmp: "); + } + void nomem(void) + { +@@ -207,7 +207,7 @@ int main() + + buffer_init(&b,buffer_unixread,fddata,bspace,sizeof bspace); + +- fdcdb = open_trunc("data.tmp"); ++ fdcdb = open_trunc("data.cdb.tmp"); + if (fdcdb == -1) die_datatmp(); + if (cdb_make_start(&cdb,fdcdb) == -1) die_datatmp(); + +@@ -487,8 +487,8 @@ int main() + if (cdb_make_finish(&cdb) == -1) die_datatmp(); + if (fsync(fdcdb) == -1) die_datatmp(); + if (close(fdcdb) == -1) die_datatmp(); /* NFS stupidity */ +- if (rename("data.tmp","data.cdb") == -1) +- strerr_die2sys(111,FATAL,"unable to move data.tmp to data.cdb: "); ++ if (rename("data.cdb.tmp","data.cdb") == -1) ++ strerr_die2sys(111,FATAL,"unable to move data.cdb.tmp to data.cdb: "); + + _exit(0); + } diff --git a/net/djbdns/patches/140-dnsnamex-extra-command.patch b/net/djbdns/patches/140-dnsnamex-extra-command.patch new file mode 100644 index 0000000..6a8cafe --- /dev/null +++ b/net/djbdns/patches/140-dnsnamex-extra-command.patch @@ -0,0 +1,156 @@ +--- /dev/null ++++ b/dnsnamex.c +@@ -0,0 +1,34 @@ ++#include "buffer.h" ++#include "exit.h" ++#include "strerr.h" ++#include "ip4.h" ++#include "dns.h" ++ ++#define FATAL "dnsnamex: fatal: " ++ ++static char seed[128]; ++ ++char ip[4]; ++static stralloc out; ++ ++int main(int argc,char **argv) ++{ ++ dns_random_init(seed); ++ ++ if (*argv) ++argv; ++ ++ while (*argv) { ++ if (!ip4_scan(*argv,ip)) ++ strerr_die3x(111,FATAL,"unable to parse IP address ",*argv); ++ if (dns_name4_multi(&out,ip) == -1) ++ strerr_die4sys(111,FATAL,"unable to find host name for ",*argv,": "); ++ ++ buffer_put(buffer_1,out.s,out.len); ++ buffer_puts(buffer_1,"\n"); ++ ++ ++argv; ++ } ++ ++ buffer_flush(buffer_1); ++ _exit(0); ++} +--- /dev/null ++++ b/dns_namex.c +@@ -0,0 +1,48 @@ ++#include "stralloc.h" ++#include "uint16.h" ++#include "byte.h" ++#include "dns.h" ++ ++static char *q = 0; ++ ++int dns_name_packet_multi(stralloc *out,const char *buf,unsigned int len) ++{ ++ unsigned int pos; ++ char header[12]; ++ uint16 numanswers; ++ uint16 datalen; ++ ++ if (!stralloc_copys(out,"")) return -1; ++ ++ pos = dns_packet_copy(buf,len,0,header,12); if (!pos) return -1; ++ uint16_unpack_big(header + 6,&numanswers); ++ pos = dns_packet_skipname(buf,len,pos); if (!pos) return -1; ++ pos += 4; ++ ++ while (numanswers--) { ++ pos = dns_packet_skipname(buf,len,pos); if (!pos) return -1; ++ pos = dns_packet_copy(buf,len,pos,header,10); if (!pos) return -1; ++ uint16_unpack_big(header + 8,&datalen); ++ if (byte_equal(header,2,DNS_T_PTR)) ++ if (byte_equal(header + 2,2,DNS_C_IN)) { ++ if (!dns_packet_getname(buf,len,pos,&q)) return -1; ++ if (!dns_domain_todot_cat(out,q)) return -1; ++ if (!stralloc_cats(out, " ")) return -1 ; ++ } ++ pos += datalen; ++ } ++ ++ return 0; ++} ++ ++int dns_name4_multi(stralloc *out,const char ip[4]) ++{ ++ char name[DNS_NAME4_DOMAIN]; ++ ++ dns_name4_domain(name,ip); ++ if (dns_resolve(name,DNS_T_PTR) == -1) return -1; ++ if (dns_name_packet_multi(out,dns_resolve_tx.packet,dns_resolve_tx.packetlen) == -1) return -1; ++ dns_transmit_free(&dns_resolve_tx); ++ dns_domain_free(&q); ++ return 0; ++} +--- a/dns.h ++++ b/dns.h +@@ -70,9 +70,11 @@ extern struct dns_transmit dns_resolve_t + extern int dns_ip4_packet(stralloc *,const char *,unsigned int); + extern int dns_ip4(stralloc *,const stralloc *); + extern int dns_name_packet(stralloc *,const char *,unsigned int); ++extern int dns_name_packet_multi(stralloc *,const char *,unsigned int); + extern void dns_name4_domain(char *,const char *); + #define DNS_NAME4_DOMAIN 31 + extern int dns_name4(stralloc *,const char *); ++extern int dns_name4_multi(stralloc *,const char *); + extern int dns_txt_packet(stralloc *,const char *,unsigned int); + extern int dns_txt(stralloc *,const stralloc *); + extern int dns_mx_packet(stralloc *,const char *,unsigned int); +--- a/Makefile ++++ b/Makefile +@@ -219,10 +219,10 @@ uint64.h taia.h dd.h + + dns.a: \ + makelib dns_dfd.o dns_domain.o dns_dtda.o dns_ip.o dns_ipq.o dns_mx.o \ +-dns_name.o dns_nd.o dns_packet.o dns_random.o dns_rcip.o dns_rcrw.o \ ++dns_name.o dns_namex.o dns_nd.o dns_packet.o dns_random.o dns_rcip.o dns_rcrw.o \ + dns_resolve.o dns_sortip.o dns_transmit.o dns_txt.o + ./makelib dns.a dns_dfd.o dns_domain.o dns_dtda.o dns_ip.o \ +- dns_ipq.o dns_mx.o dns_name.o dns_nd.o dns_packet.o \ ++ dns_ipq.o dns_mx.o dns_name.o dns_namex.o dns_nd.o dns_packet.o \ + dns_random.o dns_rcip.o dns_rcrw.o dns_resolve.o \ + dns_sortip.o dns_transmit.o dns_txt.o + +@@ -261,6 +261,11 @@ compile dns_name.c stralloc.h gen_alloc. + stralloc.h iopause.h taia.h tai.h uint64.h taia.h + ./compile dns_name.c + ++dns_namex.o: \ ++compile dns_namex.c stralloc.h gen_alloc.h uint16.h byte.h dns.h \ ++stralloc.h iopause.h taia.h tai.h uint64.h taia.h ++ ./compile dns_namex.c ++ + dns_nd.o: \ + compile dns_nd.c byte.h fmt.h dns.h stralloc.h gen_alloc.h iopause.h \ + taia.h tai.h uint64.h taia.h +@@ -394,6 +399,17 @@ compile dnsname.c buffer.h exit.h strerr + gen_alloc.h iopause.h taia.h tai.h uint64.h taia.h + ./compile dnsname.c + ++dnsnamex: \ ++load dnsnamex.o iopause.o dns.a env.a libtai.a alloc.a buffer.a unix.a \ ++byte.a socket.lib ++ ./load dnsnamex iopause.o dns.a env.a libtai.a alloc.a \ ++ buffer.a unix.a byte.a `cat socket.lib` ++ ++dnsnamex.o: \ ++compile dnsnamex.c buffer.h exit.h strerr.h ip4.h dns.h stralloc.h \ ++gen_alloc.h iopause.h taia.h tai.h uint64.h taia.h ++ ./compile dnsnamex.c ++ + dnsq: \ + load dnsq.o iopause.o printrecord.o printpacket.o parsetype.o dns.a \ + env.a libtai.a buffer.a alloc.a unix.a byte.a socket.lib +@@ -658,7 +674,7 @@ prog: \ + dnscache-conf dnscache walldns-conf walldns rbldns-conf rbldns \ + rbldns-data pickdns-conf pickdns pickdns-data tinydns-conf tinydns \ + tinydns-data tinydns-get tinydns-edit axfr-get axfrdns-conf axfrdns \ +-dnsip dnsipq dnsname dnstxt dnsmx dnsfilter random-ip dnsqr dnsq \ ++dnsip dnsipq dnsname dnsnamex dnstxt dnsmx dnsfilter random-ip dnsqr dnsq \ + dnstrace dnstracesort cachetest utime rts + + prot.o: \ diff --git a/net/djbdns/patches/200-dnscache-cname-handling.patch b/net/djbdns/patches/200-dnscache-cname-handling.patch new file mode 100644 index 0000000..ed96ac9 --- /dev/null +++ b/net/djbdns/patches/200-dnscache-cname-handling.patch @@ -0,0 +1,226 @@ +--- a/query.c ++++ b/query.c +@@ -91,6 +91,21 @@ static void cleanup(struct query *z) + } + } + ++static int move_name_to_alias(struct query *z,uint32 ttl) ++{ ++ int j ; ++ ++ if (z->alias[QUERY_MAXALIAS - 1]) return 0 ; ++ for (j = QUERY_MAXALIAS - 1;j > 0;--j) ++ z->alias[j] = z->alias[j - 1]; ++ for (j = QUERY_MAXALIAS - 1;j > 0;--j) ++ z->aliasttl[j] = z->aliasttl[j - 1]; ++ z->alias[0] = z->name[0]; ++ z->aliasttl[0] = ttl; ++ z->name[0] = 0; ++ return 1 ; ++} ++ + static int rqa(struct query *z) + { + int i; +@@ -123,7 +138,6 @@ static int globalip(char *d,char ip[4]) + static char *t1 = 0; + static char *t2 = 0; + static char *t3 = 0; +-static char *cname = 0; + static char *referral = 0; + static unsigned int *records = 0; + +@@ -179,15 +193,14 @@ static int doit(struct query *z,int stat + uint16 datalen; + char *control; + char *d; ++ char *owner_name = 0 ; + const char *dtype; + unsigned int dlen; + int flagout; +- int flagcname; + int flagreferral; + int flagsoa; + uint32 ttl; + uint32 soattl; +- uint32 cnamettl; + int i; + int j; + int k; +@@ -253,7 +266,10 @@ static int doit(struct query *z,int stat + + byte_copy(key,2,DNS_T_CNAME); + cached = cache_get(key,dlen + 2,&cachedlen,&ttl); +- if (cached) { ++ /* A previous explicit query might have caused an empty RRSet to have been ++ ** cached. Take care to ignore such a thing. ++ */ ++ if (cached && cachedlen) { + if (typematch(DNS_T_CNAME,dtype)) { + log_cachedanswer(d,DNS_T_CNAME); + if (!rqa(z)) goto DIE; +@@ -262,8 +278,11 @@ static int doit(struct query *z,int stat + return 1; + } + log_cachedcname(d,cached); +- if (!dns_domain_copy(&cname,cached)) goto DIE; +- goto CNAME; ++ if (!z->level) { ++ if (!move_name_to_alias(z,ttl)) goto DIE ; ++ } ++ if (!dns_domain_copy(&z->name[z->level],cached)) goto DIE; ++ goto NEWNAME; + } + + if (typematch(DNS_T_NS,dtype)) { +@@ -352,7 +371,7 @@ static int doit(struct query *z,int stat + } + } + +- if (!typematch(DNS_T_ANY,dtype) && !typematch(DNS_T_AXFR,dtype) && !typematch(DNS_T_CNAME,dtype) && !typematch(DNS_T_NS,dtype) && !typematch(DNS_T_PTR,dtype) && !typematch(DNS_T_A,dtype) && !typematch(DNS_T_MX,dtype)) { ++ if (!typematch(DNS_T_ANY,dtype) && !typematch(DNS_T_AXFR,dtype) && !typematch(DNS_T_NS,dtype) && !typematch(DNS_T_PTR,dtype) && !typematch(DNS_T_A,dtype) && !typematch(DNS_T_MX,dtype)) { + byte_copy(key,2,dtype); + cached = cache_get(key,dlen + 2,&cachedlen,&ttl); + if (cached && (cachedlen || byte_diff(dtype,2,DNS_T_ANY))) { +@@ -473,29 +492,31 @@ static int doit(struct query *z,int stat + + cachettl = 0; + flagout = 0; +- flagcname = 0; + flagreferral = 0; + flagsoa = 0; + soattl = 0; +- cnamettl = 0; ++ if (!dns_domain_copy(&owner_name,d)) goto DIE; ++ /* This code assumes that the CNAME chain is presented in the correct ++ ** order. The example algorithm in RFC 1034 will actually result in this ++ ** being the case, but the words do not require it to be so. ++ */ + for (j = 0;j < numanswers;++j) { + pos = dns_packet_getname(buf,len,pos,&t1); if (!pos) goto DIE; + pos = dns_packet_copy(buf,len,pos,header,10); if (!pos) goto DIE; + +- if (dns_domain_equal(t1,d)) ++ if (dns_domain_equal(t1,owner_name)) + if (byte_equal(header + 2,2,DNS_C_IN)) { /* should always be true */ + if (typematch(header,dtype)) + flagout = 1; + else if (typematch(header,DNS_T_CNAME)) { +- if (!dns_packet_getname(buf,len,pos,&cname)) goto DIE; +- flagcname = 1; +- cnamettl = ttlget(header + 4); ++ if (!dns_packet_getname(buf,len,pos,&owner_name)) goto DIE; + } + } + + uint16_unpack_big(header + 8,&datalen); + pos += datalen; + } ++ dns_domain_free(&owner_name) ; + posauthority = pos; + + for (j = 0;j < numauthority;++j) { +@@ -522,15 +543,6 @@ static int doit(struct query *z,int stat + } + posglue = pos; + +- +- if (!flagcname && !rcode && !flagout && flagreferral && !flagsoa) +- if (dns_domain_equal(referral,control) || !dns_domain_suffix(referral,control)) { +- log_lame(whichserver,control,referral); +- byte_zero(whichserver,4); +- goto HAVENS; +- } +- +- + if (records) { alloc_free(records); records = 0; } + + k = numanswers + numauthority + numglue; +@@ -677,24 +689,36 @@ static int doit(struct query *z,int stat + + alloc_free(records); records = 0; + ++ if (byte_diff(DNS_T_CNAME,2,dtype)) { ++ /* This code assumes that the CNAME chain is presented in the correct ++ ** order. The example algorithm in RFC 1034 will actually result in this ++ ** being the case, but the words do not require it to be so. ++ */ ++ pos = posanswers; ++ for (j = 0;j < numanswers;++j) { ++ pos = dns_packet_getname(buf,len,pos,&t1); if (!pos) goto DIE; ++ pos = dns_packet_copy(buf,len,pos,header,10); if (!pos) goto DIE; ++ ++ if (dns_domain_equal(t1,d)) ++ if (byte_equal(header + 2,2,DNS_C_IN)) { /* should always be true */ ++ if (typematch(header,DNS_T_CNAME)) { ++ ttl = ttlget(header + 4); ++ if (z->level == 0) { ++ if (!move_name_to_alias(z,ttl)) goto DIE ; ++ } ++ if (!dns_packet_getname(buf,len,pos,&z->name[z->level])) goto DIE; ++ d = z->name[z->level]; ++ if (!dns_domain_suffix(d,control) || !roots_same(d,control)) ++ goto NEWNAME ; /* Cannot trust the chain further - restart using current name */ ++ } ++ } + +- if (flagcname) { +- ttl = cnamettl; +- CNAME: +- if (!z->level) { +- if (z->alias[QUERY_MAXALIAS - 1]) goto DIE; +- for (j = QUERY_MAXALIAS - 1;j > 0;--j) +- z->alias[j] = z->alias[j - 1]; +- for (j = QUERY_MAXALIAS - 1;j > 0;--j) +- z->aliasttl[j] = z->aliasttl[j - 1]; +- z->alias[0] = z->name[0]; +- z->aliasttl[0] = ttl; +- z->name[0] = 0; ++ uint16_unpack_big(header + 8,&datalen); ++ pos += datalen; + } +- if (!dns_domain_copy(&z->name[z->level],cname)) goto DIE; +- goto NEWNAME; + } + ++ /* A "no such name" error applies to the end of any CNAME chain, not to the start. */ + if (rcode == 3) { + log_nxdomain(whichserver,d,cachettl); + cachegeneric(DNS_T_ANY,d,"",0,cachettl); +@@ -707,10 +731,26 @@ static int doit(struct query *z,int stat + return 1; + } + ++ /* We check for a lame server _after_ we have cached any records that it ++ ** might have returned to us. This copes better with the incorrect ++ ** behaviour of one content DNS server software that doesn't return ++ ** complete CNAME chains but instead returns only the first link in a ++ ** chain followed by a lame delegation to the same server. ++ ** Also: We check for a lame server _after_ following the CNAME chain. The ++ ** delegation in a referral answer applies to the _end_ of the chain, not ++ ** to the beginning. ++ */ ++ if (!rcode && !flagout && flagreferral && !flagsoa) ++ if (dns_domain_equal(referral,control) || !dns_domain_suffix(referral,control)) { ++ log_lame(whichserver,control,referral); ++ byte_zero(whichserver,4); ++ goto HAVENS; ++ } ++ + if (!flagout && flagsoa) ++ /* Don't save empty RRSets for those types that we use as special markers. */ + if (byte_diff(DNS_T_ANY,2,dtype)) +- if (byte_diff(DNS_T_AXFR,2,dtype)) +- if (byte_diff(DNS_T_CNAME,2,dtype)) { ++ if (byte_diff(DNS_T_AXFR,2,dtype)) { + save_start(); + save_finish(dtype,d,soattl); + log_nodata(whichserver,d,dtype,soattl); +@@ -822,6 +862,7 @@ static int doit(struct query *z,int stat + DIE: + cleanup(z); + if (records) { alloc_free(records); records = 0; } ++ dns_domain_free(&owner_name) ; + return -1; + } + diff --git a/net/djbdns/patches/210-dnscache-strict-forwardonly.patch b/net/djbdns/patches/210-dnscache-strict-forwardonly.patch new file mode 100644 index 0000000..b64e4a4 --- /dev/null +++ b/net/djbdns/patches/210-dnscache-strict-forwardonly.patch @@ -0,0 +1,47 @@ +--- a/log.h ++++ b/log.h +@@ -25,6 +25,7 @@ extern void log_nxdomain(const char *,co + extern void log_nodata(const char *,const char *,const char *,unsigned int); + extern void log_servfail(const char *); + extern void log_lame(const char *,const char *,const char *); ++extern void log_ignore_referral(const char *,const char *,const char *); + + extern void log_rr(const char *,const char *,const char *,const char *,unsigned int,unsigned int); + extern void log_rrns(const char *,const char *,const char *,unsigned int); +--- a/log.c ++++ b/log.c +@@ -197,6 +197,13 @@ void log_lame(const char server[4],const + line(); + } + ++void log_ignore_referral(const char server[4],const char * control, const char *referral) ++{ ++ string("ignored referral "); ip(server); space(); ++ name(control); space(); name(referral); ++ line(); ++} ++ + void log_servfail(const char *dn) + { + const char *x = error_str(errno); +--- a/query.c ++++ b/query.c +@@ -828,6 +828,18 @@ static int doit(struct query *z,int stat + + + if (!dns_domain_suffix(d,referral)) goto DIE; ++ ++ /* In strict "forwardonly" mode, we don't, as the manual states, ++ ** contact a chain of servers according to "NS" resource records. ++ ** We don't obey any referral responses, therefore. Instead, we ++ ** eliminate the server from the list and try the next one. ++ */ ++ if (flagforwardonly) { ++ log_ignore_referral(whichserver,control,referral); ++ byte_zero(whichserver,4); ++ goto HAVENS; ++ } ++ + control = d + dns_domain_suffixpos(d,referral); + z->control[z->level] = control; + byte_zero(z->servers[z->level],64); diff --git a/net/djbdns/patches/220-dnscacheip-space-separator.patch b/net/djbdns/patches/220-dnscacheip-space-separator.patch new file mode 100644 index 0000000..2e73ffe --- /dev/null +++ b/net/djbdns/patches/220-dnscacheip-space-separator.patch @@ -0,0 +1,11 @@ +--- a/dns_rcip.c ++++ b/dns_rcip.c +@@ -17,7 +17,7 @@ static int init(char ip[64]) + x = env_get("DNSCACHEIP"); + if (x) + while (iplen <= 60) { +- if (*x == '.') ++ if (*x == ' ' || *x == '\t' || *x == '\n') + ++x; + else { + i = ip4_scan(x,ip + iplen); diff --git a/net/djbdns/patches/230-tinydns-data-semantic-error.patch b/net/djbdns/patches/230-tinydns-data-semantic-error.patch new file mode 100644 index 0000000..69b9441 --- /dev/null +++ b/net/djbdns/patches/230-tinydns-data-semantic-error.patch @@ -0,0 +1,194 @@ +--- a/tinydns-data.c ++++ b/tinydns-data.c +@@ -25,6 +25,14 @@ + + #define FATAL "tinydns-data: fatal: " + ++void die_semantic2(const char * s1, const char * s2) ++{ ++ strerr_die3x(111,FATAL,s1,s2) ; ++} ++void die_semantic4(const char * s1, const char * s2,const char * s3, const char * s4) ++{ ++ strerr_die5x(111,FATAL,s1,s2,s3,s4) ; ++} + void die_datatmp(void) + { + strerr_die2sys(111,FATAL,"unable to create data.cdb.tmp: "); +@@ -34,20 +42,39 @@ void nomem(void) + strerr_die1sys(111,FATAL); + } + ++void ttlparse(stralloc *sa,unsigned long * ttl, unsigned long defttl, const char * ltype) ++{ ++ int ttllen ; ++ ++ if (sa->len > 0) { ++ if (!stralloc_0(sa)) nomem(); ++ ttllen = scan_ulong(sa->s,ttl) ; ++ if (ttllen + 1 != sa->len) ++ die_semantic4("unparseable TTL in ",ltype," line: ", sa->s) ; ++ } else ++ *ttl = defttl; ++} ++ + void ttdparse(stralloc *sa,char ttd[8]) + { + unsigned int i; + char ch; + + byte_zero(ttd,8); +- for (i = 0;(i < 16) && (i < sa->len);++i) { ++ for (i = 0;i < sa->len;++i) { ++ if (i >= 16) { ++ if (!stralloc_0(sa)) nomem() ; ++ die_semantic2("timestamp is too long: ", sa->s) ; ++ } + ch = sa->s[i]; + if ((ch >= '0') && (ch <= '9')) + ch -= '0'; + else if ((ch >= 'a') && (ch <= 'f')) + ch -= 'a' - 10; +- else +- ch = 0; ++ else { ++ if (!stralloc_0(sa)) nomem() ; ++ die_semantic2("timestamp contains an invalid character: ", sa->s) ; ++ } + if (!(i & 1)) ch <<= 4; + ttd[i >> 1] |= ch; + } +@@ -55,6 +82,10 @@ void ttdparse(stralloc *sa,char ttd[8]) + + void locparse(stralloc *sa,char loc[2]) + { ++ if (sa->len > 2) { ++ if (!stralloc_0(sa)) nomem() ; ++ die_semantic2("location code longer than two characters: ", sa->s) ; ++ } + loc[0] = (sa->len > 0) ? sa->s[0] : 0; + loc[1] = (sa->len > 1) ? sa->s[1] : 0; + } +@@ -187,6 +218,7 @@ int main() + int i; + int j; + int k; ++ int iplen ; + char ch; + unsigned long ttl; + char ttd[8]; +@@ -267,8 +299,7 @@ int main() + if (!scan_ulong(f[7].s,&u)) uint32_unpack_big(defaultsoa + 16,&u); + uint32_pack_big(soa + 16,u); + +- if (!stralloc_0(&f[8])) nomem(); +- if (!scan_ulong(f[8].s,&ttl)) ttl = TTL_NEGATIVE; ++ ttlparse(&f[8],&ttl,TTL_NEGATIVE,"Z"); + ttdparse(&f[9],ttd); + locparse(&f[10],loc); + +@@ -283,8 +314,7 @@ int main() + + case '.': case '&': + if (!dns_domain_fromdot(&d1,f[0].s,f[0].len)) nomem(); +- if (!stralloc_0(&f[3])) nomem(); +- if (!scan_ulong(f[3].s,&ttl)) ttl = TTL_NS; ++ ttlparse(&f[3],&ttl,TTL_NS,". or &"); + ttdparse(&f[4],ttd); + locparse(&f[5],loc); + +@@ -309,24 +339,26 @@ int main() + rr_addname(d2); + rr_finish(d1); + +- if (ip4_scan(f[1].s,ip)) { ++ iplen = ip4_scan(f[1].s,ip) ; ++ if (iplen != 0 && iplen + 1 == f[1].len) { + rr_start(DNS_T_A,ttl,ttd,loc); + rr_add(ip,4); + rr_finish(d2); +- } ++ } else if (f[1].len > 1) ++ die_semantic4("unparseable IP address in ","& or ."," line: ", f[1].s) ; + + break; + + case '+': case '=': + if (!dns_domain_fromdot(&d1,f[0].s,f[0].len)) nomem(); +- if (!stralloc_0(&f[2])) nomem(); +- if (!scan_ulong(f[2].s,&ttl)) ttl = TTL_POSITIVE; ++ ttlparse(&f[2],&ttl,TTL_POSITIVE,"+ or ="); + ttdparse(&f[3],ttd); + locparse(&f[4],loc); + + if (!stralloc_0(&f[1])) nomem(); + +- if (ip4_scan(f[1].s,ip)) { ++ iplen = ip4_scan(f[1].s,ip) ; ++ if (iplen != 0 && iplen + 1 == f[1].len) { + rr_start(DNS_T_A,ttl,ttd,loc); + rr_add(ip,4); + rr_finish(d1); +@@ -337,13 +369,15 @@ int main() + rr_addname(d1); + rr_finish(dptr); + } +- } ++ } else if (f[1].len > 1) ++ die_semantic4("unparseable IP address in ","+ or ="," line: ", f[1].s) ; ++ else ++ die_semantic4("missing IP address in ","+ or ="," line: ", f[1].s) ; + break; + + case '@': + if (!dns_domain_fromdot(&d1,f[0].s,f[0].len)) nomem(); +- if (!stralloc_0(&f[4])) nomem(); +- if (!scan_ulong(f[4].s,&ttl)) ttl = TTL_POSITIVE; ++ ttlparse(&f[4],&ttl,TTL_POSITIVE,"@"); + ttdparse(&f[5],ttd); + locparse(&f[6],loc); + +@@ -401,18 +435,19 @@ int main() + rr_addname(d2); + rr_finish(d1); + +- if (ip4_scan(f[1].s,ip)) { ++ iplen = ip4_scan(f[1].s,ip) ; ++ if (iplen != 0 && iplen + 1 == f[1].len) { + rr_start(DNS_T_A,ttl,ttd,loc); + rr_add(ip,4); + rr_finish(d2); +- } ++ } else if (f[1].len > 1) ++ die_semantic4("unparseable IP address in ","@"," line: ", f[1].s) ; + break; + + case '^': case 'C': + if (!dns_domain_fromdot(&d1,f[0].s,f[0].len)) nomem(); + if (!dns_domain_fromdot(&d2,f[1].s,f[1].len)) nomem(); +- if (!stralloc_0(&f[2])) nomem(); +- if (!scan_ulong(f[2].s,&ttl)) ttl = TTL_POSITIVE; ++ ttlparse(&f[2],&ttl,TTL_POSITIVE,"^ or C"); + ttdparse(&f[3],ttd); + locparse(&f[4],loc); + +@@ -426,8 +461,7 @@ int main() + + case '\'': + if (!dns_domain_fromdot(&d1,f[0].s,f[0].len)) nomem(); +- if (!stralloc_0(&f[2])) nomem(); +- if (!scan_ulong(f[2].s,&ttl)) ttl = TTL_POSITIVE; ++ ttlparse(&f[2],&ttl,TTL_POSITIVE,"\'"); + ttdparse(&f[3],ttd); + locparse(&f[4],loc); + +@@ -449,8 +483,7 @@ int main() + + case ':': + if (!dns_domain_fromdot(&d1,f[0].s,f[0].len)) nomem(); +- if (!stralloc_0(&f[3])) nomem(); +- if (!scan_ulong(f[3].s,&ttl)) ttl = TTL_POSITIVE; ++ ttlparse(&f[3],&ttl,TTL_POSITIVE,":"); + ttdparse(&f[4],ttd); + locparse(&f[5],loc); + diff --git a/net/djbdns/patches/240-tinydns-alias-chain-truncation.patch b/net/djbdns/patches/240-tinydns-alias-chain-truncation.patch new file mode 100644 index 0000000..f94399e --- /dev/null +++ b/net/djbdns/patches/240-tinydns-alias-chain-truncation.patch @@ -0,0 +1,87 @@ +--- a/tdlookup.c ++++ b/tdlookup.c +@@ -103,12 +103,13 @@ static int doname(void) + return response_addname(d1); + } + +-static int doit(char *q,char qtype[2]) ++static int doit1(char **pqname,char qtype[2]) + { + unsigned int bpos; + unsigned int anpos; + unsigned int aupos; + unsigned int arpos; ++ char *q; + char *control; + char *wild; + int flaggavesoa; +@@ -122,6 +123,12 @@ static int doit(char *q,char qtype[2]) + int addrnum; + uint32 addrttl; + int i; ++ int loop = 0 ; ++ ++RESTART: ++ if (loop++ >= 100) return 0 ; ++ ++ q = *pqname ; + + anpos = response_len; + +@@ -136,7 +143,14 @@ static int doit(char *q,char qtype[2]) + if (byte_equal(type,2,DNS_T_NS)) flagns = 1; + } + if (flagns) break; +- if (!*control) return 0; /* q is not within our bailiwick */ ++ if (!*control) { /* q is not within our bailiwick */ ++ if (loop <= 1) ++ return 0 ; ++ else { ++ response[2] &= ~4; ++ goto DONE; /* The administrator has issued contradictory instructions */ ++ } ++ } + control += *control; + control += 1; + } +@@ -172,9 +186,17 @@ static int doit(char *q,char qtype[2]) + continue; + } + if (!response_rstart(q,type,ttl)) return 0; +- if (byte_equal(type,2,DNS_T_NS) || byte_equal(type,2,DNS_T_CNAME) || byte_equal(type,2,DNS_T_PTR)) { ++ if (byte_equal(type,2,DNS_T_NS) || byte_equal(type,2,DNS_T_PTR)) { + if (!doname()) return 0; + } ++ else if (byte_equal(type,2,DNS_T_CNAME)) { ++ if (!doname()) return 0; ++ if (byte_diff(type,2,qtype)) { ++ response_rfinish(RESPONSE_ANSWER); ++ if (!dns_domain_copy(pqname,d1)) return 0 ; ++ goto RESTART ; ++ } ++ } + else if (byte_equal(type,2,DNS_T_MX)) { + if (!dobytes(2)) return 0; + if (!doname()) return 0; +@@ -275,9 +297,21 @@ static int doit(char *q,char qtype[2]) + } + } + ++DONE: + return 1; + } + ++static int doit(char *qname,char qtype[2]) ++{ ++ int r ; ++ char * q = 0 ; ++ ++ if (!dns_domain_copy(&q, qname)) return 0 ; ++ r = doit1(&q, qtype) ; ++ dns_domain_free(&q) ; ++ return r ; ++} ++ + int respond(char *q,char qtype[2],char ip[4]) + { + static struct tai cdb_valid = { 0 }; diff --git a/net/djbdns/patches/250-dnscache-slogging.patch b/net/djbdns/patches/250-dnscache-slogging.patch new file mode 100644 index 0000000..5a2eaa1 --- /dev/null +++ b/net/djbdns/patches/250-dnscache-slogging.patch @@ -0,0 +1,122 @@ +--- a/server.c ++++ b/server.c +@@ -25,12 +25,63 @@ static int len; + + static char *q; + ++static uint64 stats_numq; ++static uint64 stats_plus; ++static uint64 stats_minus; ++static uint64 stats_nx; ++static uint64 stats_notimp; ++static uint64 stats_weird; ++static uint64 stats_noq; ++ ++/* work around gcc 2.95.2 bug */ ++#define number(x) ( (u64 = (x)), u64_print() ) ++static uint64 u64; ++static void u64_print(void) ++{ ++ char ubuf[20]; ++ unsigned int pos; ++ ++ pos = sizeof ubuf; ++ do { ++ if (!pos) break; ++ ubuf[--pos] = '0' + (u64 % 10); ++ u64 /= 10; ++ } while(u64); ++ ++ buffer_put(buffer_2,ubuf + pos,sizeof ubuf - pos); ++} ++ ++static void string(const char *s) ++{ ++ buffer_puts(buffer_2,s); ++} ++ ++static void line(void) ++{ ++ string("\n"); ++ buffer_flush(buffer_2); ++} ++ ++static void log_stats(void) ++{ ++ string("stats "); ++ number(stats_numq); string(" "); ++ number(stats_plus); string(" "); ++ number(stats_minus); string(" "); ++ number(stats_nx); string(" "); ++ number(stats_notimp); string(" "); ++ number(stats_weird); string(" "); ++ number(stats_noq); ++ line(); ++} ++ + static int doit(void) + { + unsigned int pos; + char header[12]; + char qtype[2]; + char qclass[2]; ++ stats_numq++; + + if (len >= sizeof buf) goto NOQ; + pos = dns_packet_copy(buf,len,0,header,12); if (!pos) goto NOQ; +@@ -56,25 +107,37 @@ static int doit(void) + + case_lowerb(q,dns_domain_length(q)); + if (!respond(q,qtype,ip)) { ++ stats_minus++; + qlog(ip,port,header,q,qtype," - "); + return 0; + } +- qlog(ip,port,header,q,qtype," + "); ++ ++ if ((response[2] & 4) && (response[3] & 3)) { ++ stats_nx++; ++ qlog(ip,port,header,q,qtype," N "); ++ } ++ else { ++ stats_plus++; ++ qlog(ip,port,header,q,qtype," + "); ++ } + return 1; + + NOTIMP: ++ stats_notimp++; + response[3] &= ~15; + response[3] |= 4; + qlog(ip,port,header,q,qtype," I "); + return 1; + + WEIRDCLASS: ++ stats_weird++; + response[3] &= ~15; + response[3] |= 1; + qlog(ip,port,header,q,qtype," C "); + return 1; + + NOQ: ++ stats_noq++; + qlog(ip,port,"\0\0","","\0\0"," / "); + return 0; + } +@@ -83,6 +146,7 @@ int main() + { + char *x; + int udp53; ++ unsigned char flag=0; + + x = env_get("IP"); + if (!x) +@@ -106,6 +170,8 @@ int main() + buffer_putsflush(buffer_2,starting); + + for (;;) { ++ if ((flag++)%32==1) ++ log_stats(); + len = socket_recv4(udp53,buf,sizeof buf,ip,&port); + if (len < 0) continue; + if (!doit()) continue; diff --git a/net/djbdns/patches/260-dnsfilter-replace.patch b/net/djbdns/patches/260-dnsfilter-replace.patch new file mode 100644 index 0000000..b352f1c --- /dev/null +++ b/net/djbdns/patches/260-dnsfilter-replace.patch @@ -0,0 +1,71 @@ +--- a/dnsfilter.c ++++ b/dnsfilter.c +@@ -41,6 +41,7 @@ int inbuflen = 0; + iopause_fd *inio; + int flag0 = 1; + ++int opt_replace = 0; + iopause_fd *io; + int iolen; + +@@ -51,12 +52,16 @@ char name[DNS_NAME4_DOMAIN]; + void errout(int i) + { + int j; +- +- if (!stralloc_copys(&x[i].middle,":")) nomem(); +- if (!stralloc_cats(&x[i].middle,error_str(errno))) nomem(); +- for (j = 0;j < x[i].middle.len;++j) +- if (x[i].middle.s[j] == ' ') +- x[i].middle.s[j] = '-'; ++ ++ if (opt_replace) ++ x[i].middle.len=0; ++ else { ++ if (!stralloc_copys(&x[i].middle,":")) nomem(); ++ if (!stralloc_cats(&x[i].middle,error_str(errno))) nomem(); ++ for (j = 0;j < x[i].middle.len;++j) ++ if (x[i].middle.s[j] == ' ') ++ x[i].middle.s[j] = '-'; ++ } + } + + int main(int argc,char **argv) +@@ -69,7 +74,7 @@ int main(int argc,char **argv) + int j; + int r; + +- while ((opt = getopt(argc,argv,"c:l:")) != opteof) ++ while ((opt = getopt(argc,argv,"c:l:r")) != opteof) + switch(opt) { + case 'c': + scan_ulong(optarg,&u); +@@ -83,8 +88,11 @@ int main(int argc,char **argv) + if (u > 1000000) u = 1000000; + xmax = u; + break; ++ case 'r': ++ opt_replace = 1; ++ break; + default: +- strerr_die1x(111,"dnsfilter: usage: dnsfilter [ -c concurrency ] [ -l lines ]"); ++ strerr_die1x(111,"dnsfilter: usage: dnsfilter [ -c concurrency ] [ -l lines ] [-r]"); + } + + x = (struct line *) alloc(xmax * sizeof(struct line)); +@@ -140,8 +148,13 @@ int main(int argc,char **argv) + else if (r == 1) { + if (dns_name_packet(&x[i].middle,x[i].dt.packet,x[i].dt.packetlen) == -1) + errout(i); +- if (x[i].middle.len) +- if (!stralloc_cats(&x[i].left,"=")) nomem(); ++ if (x[i].middle.len) { ++ if (opt_replace) { ++ if (!stralloc_copys(&x[i].left, "")) nomem(); ++ } else { ++ if (!stralloc_cats(&x[i].left, "=")) nomem(); ++ } ++ } + x[i].flagactive = 0; + --numactive; + } diff --git a/net/djbdns/patches/270-dnscache-sigpipe-fix.patch b/net/djbdns/patches/270-dnscache-sigpipe-fix.patch new file mode 100644 index 0000000..17a739a --- /dev/null +++ b/net/djbdns/patches/270-dnscache-sigpipe-fix.patch @@ -0,0 +1,16 @@ +--- a/dnscache.c ++++ b/dnscache.c +@@ -1,4 +1,5 @@ + #include ++#include + #include "env.h" + #include "exit.h" + #include "scan.h" +@@ -391,6 +392,7 @@ int main() + char *x; + unsigned long cachesize; + ++ signal(SIGPIPE, SIG_IGN); + x = env_get("IP"); + if (!x) + strerr_die2x(111,FATAL,"$IP not set"); diff --git a/net/djbdns/patches/280-dnscache-ignoreip2.patch b/net/djbdns/patches/280-dnscache-ignoreip2.patch new file mode 100644 index 0000000..0a8bfad --- /dev/null +++ b/net/djbdns/patches/280-dnscache-ignoreip2.patch @@ -0,0 +1,117 @@ +This patch change djbdns's dnscache program so that it will ignore the +IP address given in the ignoreip file. I wrote this patch because of +Verisign's oh-so helpful wildcard A record for *.COM and *.NET. + +If you have djbdns-1.05-ignoreip.patch installed, back it out like this: + cd /usr/local/src/djbdns-1.05 + patch -R /service/dnscache/root/ignoreip + svc -t /service/dnscache + +Configure it to ignore all the cretins like this: +awk '{print $2}' </service/dnscache/root/ignoreip + *.ac 194.205.62.122 + *.cc 206.253.214.102 + *.com 64.94.110.11 + *.cx 219.88.106.80 + *.museum 195.7.77.20 + *.net 64.94.110.11 + *.nu 64.55.105.9 + and 212.181.91.6 + *.ph 203.119.4.6 + *.sh 194.205.62.62 + *.tm 194.205.62.62 + *.ws 216.35.187.246 +EOF + svc -t /service/dnscache + +J.P. Larocque contributes a script which updates root/ignoreip: + http://ely.ath.cx/~piranha/software/ignoreip-update/ignoreip-update-0.1 + +If root/ignoreip is not present, no addresses will be ignored. + +-- +--My blog is at angry-economist.russnelson.com | Free markets express in the +Crynwr sells support for free software | PGPok | practical world our belief +521 Pleasant Valley Rd. | +1 315 268 1925 voice | that there is that of God +Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | in all people. -Chris V. + + +--- a/dnscache.c ++++ b/dnscache.c +@@ -24,6 +24,8 @@ + #include "okclient.h" + #include "droproot.h" + ++stralloc ignoreip = {0}; ++ + static int packetquery(char *buf,unsigned int len,char **q,char qtype[2],char qclass[2],char id[2]) + { + unsigned int pos; +@@ -390,6 +392,7 @@ char seed[128]; + int main() + { + char *x; ++ unsigned int i, j, k; + unsigned long cachesize; + + signal(SIGPIPE, SIG_IGN); +@@ -433,6 +436,20 @@ int main() + if (!cache_init(cachesize)) + strerr_die3x(111,FATAL,"not enough memory for cache of size ",x); + ++ if (openreadclose("ignoreip",&ignoreip,64) < 0) ++ strerr_die2x(111,FATAL,"trouble reading ignoreip"); ++ for(j = k = i = 0; i < ignoreip.len; i++) ++ if (ignoreip.s[i] == '\n') { ++ ignoreip.s[i] = '\0'; ++ if (j + 4 > i) ++ strerr_die3x(111,FATAL,"badly malformed ip4 address ",ignoreip.s+k); ++ if (!ip4_scan(ignoreip.s+k,ignoreip.s+j)) ++ strerr_die3x(111,FATAL,"unable to parse address in ignoreip ",ignoreip.s+k); ++ j += 4; ++ k = i + 1; ++ } ++ ignoreip.len = j; ++ + if (env_get("HIDETTL")) + response_hidettl(); + if (env_get("FORWARDONLY")) +--- a/query.c ++++ b/query.c +@@ -13,6 +13,8 @@ + #include "response.h" + #include "query.h" + ++extern stralloc ignoreip; ++ + static int flagforwardonly = 0; + + void query_forwardonly(void) +@@ -173,6 +175,7 @@ static int smaller(char *buf,unsigned in + + static int doit(struct query *z,int state) + { ++ unsigned int ii; + char key[257]; + char *cached; + unsigned int cachedlen; +@@ -662,6 +665,9 @@ static int doit(struct query *z,int stat + pos = dns_packet_copy(buf,len,pos,header,10); if (!pos) goto DIE; + if (byte_equal(header + 8,2,"\0\4")) { + pos = dns_packet_copy(buf,len,pos,header,4); if (!pos) goto DIE; ++ if (ignoreip.len) ++ for(ii = 0; ii < ignoreip.len; ii+= 4) ++ if (byte_equal(header,4,ignoreip.s+ii)) goto NXDOMAIN; + save_data(header,4); + log_rr(whichserver,t1,DNS_T_A,header,4,ttl); + } diff --git a/net/djbdns/patches/300-bugfix-dnscache-dempsky-poison.patch b/net/djbdns/patches/300-bugfix-dnscache-dempsky-poison.patch new file mode 100644 index 0000000..23d8e9f --- /dev/null +++ b/net/djbdns/patches/300-bugfix-dnscache-dempsky-poison.patch @@ -0,0 +1,11 @@ +--- a/response.c ++++ b/response.c +@@ -34,7 +34,7 @@ int response_addname(const char *d) + uint16_pack_big(buf,49152 + name_ptr[i]); + return response_addbytes(buf,2); + } +- if (dlen <= 128) ++ if ((dlen <= 128) && (response_len < 16384)) + if (name_num < NAMES) { + byte_copy(name[name_num],dlen,d); + name_ptr[name_num] = response_len; diff --git a/net/djbdns/patches/310-bugfix-dnscache-merge-outgoing-requests.patch b/net/djbdns/patches/310-bugfix-dnscache-merge-outgoing-requests.patch new file mode 100644 index 0000000..bb3a4e2 --- /dev/null +++ b/net/djbdns/patches/310-bugfix-dnscache-merge-outgoing-requests.patch @@ -0,0 +1,328 @@ +--- a/Makefile ++++ b/Makefile +@@ -315,11 +315,11 @@ stralloc.h iopause.h taia.h tai.h uint64 + ./compile dns_txt.c + + dnscache: \ +-load dnscache.o droproot.o okclient.o log.o cache.o query.o \ ++load dnscache.o droproot.o okclient.o log.o cache.o query.o qmerge.o \ + response.o dd.o roots.o iopause.o prot.o dns.a env.a alloc.a buffer.a \ + libtai.a unix.a byte.a socket.lib + ./load dnscache droproot.o okclient.o log.o cache.o \ +- query.o response.o dd.o roots.o iopause.o prot.o dns.a \ ++ query.o qmerge.o response.o dd.o roots.o iopause.o prot.o dns.a \ + env.a alloc.a buffer.a libtai.a unix.a byte.a `cat \ + socket.lib` + +@@ -340,7 +340,7 @@ compile dnscache.c env.h exit.h scan.h s + uint16.h uint64.h socket.h uint16.h dns.h stralloc.h gen_alloc.h \ + iopause.h taia.h tai.h uint64.h taia.h taia.h byte.h roots.h fmt.h \ + iopause.h query.h dns.h uint32.h alloc.h response.h uint32.h cache.h \ +-uint32.h uint64.h ndelay.h log.h uint64.h okclient.h droproot.h ++uint32.h uint64.h ndelay.h log.h uint64.h okclient.h droproot.h maxclient.h + ./compile dnscache.c + + dnsfilter: \ +@@ -685,11 +685,16 @@ qlog.o: \ + compile qlog.c buffer.h qlog.h uint16.h + ./compile qlog.c + ++qmerge.o: \ ++compile qmerge.c qmerge.h dns.h stralloc.h gen_alloc.h iopause.h \ ++taia.h tai.h uint64.h log.h maxclient.h ++ ./compile qmerge.c ++ + query.o: \ + compile query.c error.h roots.h log.h uint64.h case.h cache.h \ + uint32.h uint64.h byte.h dns.h stralloc.h gen_alloc.h iopause.h \ + taia.h tai.h uint64.h taia.h uint64.h uint32.h uint16.h dd.h alloc.h \ +-response.h uint32.h query.h dns.h uint32.h ++response.h uint32.h query.h dns.h uint32.h qmerge.h + ./compile query.c + + random-ip: \ +--- a/dnscache.c ++++ b/dnscache.c +@@ -20,6 +20,7 @@ + #include "response.h" + #include "cache.h" + #include "ndelay.h" ++#include "maxclient.h" + #include "log.h" + #include "okclient.h" + #include "droproot.h" +@@ -57,7 +58,6 @@ uint64 numqueries = 0; + + static int udp53; + +-#define MAXUDP 200 + static struct udpclient { + struct query q; + struct taia start; +@@ -134,7 +134,6 @@ void u_new(void) + + static int tcp53; + +-#define MAXTCP 20 + struct tcpclient { + struct query q; + struct taia start; +--- a/log.c ++++ b/log.c +@@ -151,6 +151,13 @@ void log_tx(const char *q,const char qty + line(); + } + ++void log_tx_piggyback(const char *q, const char qtype[2], const char *control) ++{ ++ string("txpb "); ++ logtype(qtype); space(); name(q); space(); name(control); ++ line(); ++} ++ + void log_cachedanswer(const char *q,const char type[2]) + { + string("cached "); logtype(type); space(); +--- a/log.h ++++ b/log.h +@@ -20,6 +20,7 @@ extern void log_cachednxdomain(const cha + extern void log_cachedns(const char *,const char *); + + extern void log_tx(const char *,const char *,const char *,const char *,unsigned int); ++extern void log_tx_piggyback(const char *,const char *,const char *); + + extern void log_nxdomain(const char *,const char *,unsigned int); + extern void log_nodata(const char *,const char *,const char *,unsigned int); +--- /dev/null ++++ b/maxclient.h +@@ -0,0 +1,7 @@ ++#ifndef MAXCLIENT_H ++#define MAXCLIENT_H ++ ++#define MAXUDP 200 ++#define MAXTCP 20 ++ ++#endif /* MAXCLIENT_H */ +--- /dev/null ++++ b/qmerge.c +@@ -0,0 +1,115 @@ ++#include "qmerge.h" ++#include "byte.h" ++#include "log.h" ++#include "maxclient.h" ++ ++#define QMERGE_MAX (MAXUDP+MAXTCP) ++struct qmerge inprogress[QMERGE_MAX]; ++ ++static ++int qmerge_key_init(struct qmerge_key *qmk, const char *q, const char qtype[2], ++ const char *control) ++{ ++ if (!dns_domain_copy(&qmk->q, q)) return 0; ++ byte_copy(qmk->qtype, 2, qtype); ++ if (!dns_domain_copy(&qmk->control, control)) return 0; ++ return 1; ++} ++ ++static ++int qmerge_key_equal(struct qmerge_key *a, struct qmerge_key *b) ++{ ++ return ++ byte_equal(a->qtype, 2, b->qtype) && ++ dns_domain_equal(a->q, b->q) && ++ dns_domain_equal(a->control, b->control); ++} ++ ++static ++void qmerge_key_free(struct qmerge_key *qmk) ++{ ++ dns_domain_free(&qmk->q); ++ dns_domain_free(&qmk->control); ++} ++ ++void qmerge_free(struct qmerge **x) ++{ ++ struct qmerge *qm; ++ ++ qm = *x; ++ *x = 0; ++ if (!qm || !qm->active) return; ++ ++ qm->active--; ++ if (!qm->active) { ++ qmerge_key_free(&qm->key); ++ dns_transmit_free(&qm->dt); ++ } ++} ++ ++int qmerge_start(struct qmerge **qm, const char servers[64], int flagrecursive, ++ const char *q, const char qtype[2], const char localip[4], ++ const char *control) ++{ ++ struct qmerge_key k; ++ int i; ++ int r; ++ ++ qmerge_free(qm); ++ ++ byte_zero(&k, sizeof k); ++ if (!qmerge_key_init(&k, q, qtype, control)) return -1; ++ for (i = 0; i < QMERGE_MAX; i++) { ++ if (!inprogress[i].active) continue; ++ if (!qmerge_key_equal(&k, &inprogress[i].key)) continue; ++ log_tx_piggyback(q, qtype, control); ++ inprogress[i].active++; ++ *qm = &inprogress[i]; ++ qmerge_key_free(&k); ++ return 0; ++ } ++ ++ for (i = 0; i < QMERGE_MAX; i++) ++ if (!inprogress[i].active) ++ break; ++ if (i == QMERGE_MAX) return -1; ++ ++ log_tx(q, qtype, control, servers, 0); ++ r = dns_transmit_start(&inprogress[i].dt, servers, flagrecursive, q, qtype, localip); ++ if (r == -1) { qmerge_key_free(&k); return -1; } ++ inprogress[i].active++; ++ inprogress[i].state = 0; ++ qmerge_key_free(&inprogress[i].key); ++ byte_copy(&inprogress[i].key, sizeof k, &k); ++ *qm = &inprogress[i]; ++ return 0; ++} ++ ++void qmerge_io(struct qmerge *qm, iopause_fd *io, struct taia *deadline) ++{ ++ if (qm->state == 0) { ++ dns_transmit_io(&qm->dt, io, deadline); ++ qm->state = 1; ++ } ++ else { ++ io->fd = -1; ++ io->events = 0; ++ } ++} ++ ++int qmerge_get(struct qmerge **x, const iopause_fd *io, const struct taia *when) ++{ ++ int r; ++ struct qmerge *qm; ++ ++ qm = *x; ++ if (qm->state == -1) return -1; /* previous error */ ++ if (qm->state == 0) return 0; /* no packet */ ++ if (qm->state == 2) return 1; /* already got packet */ ++ ++ r = dns_transmit_get(&qm->dt, io, when); ++ if (r == -1) { qm->state = -1; return -1; } /* error */ ++ if (r == 0) { qm->state = 0; return 0; } /* must wait for i/o */ ++ if (r == 1) { qm->state = 2; return 1; } /* got packet */ ++ return -1; /* bug */ ++} +--- /dev/null ++++ b/qmerge.h +@@ -0,0 +1,24 @@ ++#ifndef QMERGE_H ++#define QMERGE_H ++ ++#include "dns.h" ++ ++struct qmerge_key { ++ char *q; ++ char qtype[2]; ++ char *control; ++}; ++ ++struct qmerge { ++ int active; ++ struct qmerge_key key; ++ struct dns_transmit dt; ++ int state; /* -1 = error, 0 = need io, 1 = need get, 2 = got packet */ ++}; ++ ++extern int qmerge_start(struct qmerge **,const char *,int,const char *,const char *,const char *,const char *); ++extern void qmerge_io(struct qmerge *,iopause_fd *,struct taia *); ++extern int qmerge_get(struct qmerge **,const iopause_fd *,const struct taia *); ++extern void qmerge_free(struct qmerge **); ++ ++#endif /* QMERGE_H */ +--- a/query.c ++++ b/query.c +@@ -83,7 +83,7 @@ static void cleanup(struct query *z) + int j; + int k; + +- dns_transmit_free(&z->dt); ++ qmerge_free(&z->qm); + for (j = 0;j < QUERY_MAXALIAS;++j) + dns_domain_free(&z->alias[j]); + for (j = 0;j < QUERY_MAXLEVEL;++j) { +@@ -452,14 +452,8 @@ static int doit(struct query *z,int stat + if (j == 64) goto SERVFAIL; + + dns_sortip(z->servers[z->level],64); +- if (z->level) { +- log_tx(z->name[z->level],DNS_T_A,z->control[z->level],z->servers[z->level],z->level); +- if (dns_transmit_start(&z->dt,z->servers[z->level],flagforwardonly,z->name[z->level],DNS_T_A,z->localip) == -1) goto DIE; +- } +- else { +- log_tx(z->name[0],z->type,z->control[0],z->servers[0],0); +- if (dns_transmit_start(&z->dt,z->servers[0],flagforwardonly,z->name[0],z->type,z->localip) == -1) goto DIE; +- } ++ dtype = z->level ? DNS_T_A : z->type; ++ if (qmerge_start(&z->qm,z->servers[z->level],flagforwardonly,z->name[z->level],dtype,z->localip,z->control[z->level]) == -1) goto DIE; + return 0; + + +@@ -473,10 +467,10 @@ static int doit(struct query *z,int stat + + HAVEPACKET: + if (++z->loop == 100) goto DIE; +- buf = z->dt.packet; +- len = z->dt.packetlen; ++ buf = z->qm->dt.packet; ++ len = z->qm->dt.packetlen; + +- whichserver = z->dt.servers + 4 * z->dt.curserver; ++ whichserver = z->qm->dt.servers + 4 * z->qm->dt.curserver; + control = z->control[z->level]; + d = z->name[z->level]; + dtype = z->level ? DNS_T_A : z->type; +@@ -902,7 +896,7 @@ int query_start(struct query *z,char *dn + + int query_get(struct query *z,iopause_fd *x,struct taia *stamp) + { +- switch(dns_transmit_get(&z->dt,x,stamp)) { ++ switch(qmerge_get(&z->qm,x,stamp)) { + case 1: + return doit(z,1); + case -1: +@@ -913,5 +907,5 @@ int query_get(struct query *z,iopause_fd + + void query_io(struct query *z,iopause_fd *x,struct taia *deadline) + { +- dns_transmit_io(&z->dt,x,deadline); ++ qmerge_io(z->qm,x,deadline); + } +--- a/query.h ++++ b/query.h +@@ -1,7 +1,7 @@ + #ifndef QUERY_H + #define QUERY_H + +-#include "dns.h" ++#include "qmerge.h" + #include "uint32.h" + + #define QUERY_MAXLEVEL 5 +@@ -20,7 +20,7 @@ struct query { + char localip[4]; + char type[2]; + char class[2]; +- struct dns_transmit dt; ++ struct qmerge *qm; + } ; + + extern int query_start(struct query *,char *,char *,char *,char *); diff --git a/net/djbdns/patches/320-bugfix-dnscache-cache-soa-records.patch b/net/djbdns/patches/320-bugfix-dnscache-cache-soa-records.patch new file mode 100644 index 0000000..f2b72a3 --- /dev/null +++ b/net/djbdns/patches/320-bugfix-dnscache-cache-soa-records.patch @@ -0,0 +1,67 @@ +--- a/query.c ++++ b/query.c +@@ -342,6 +342,29 @@ static int doit(struct query *z,int stat + } + } + ++ if (typematch(DNS_T_SOA,dtype)) { ++ byte_copy(key,2,DNS_T_SOA); ++ cached = cache_get(key,dlen + 2,&cachedlen,&ttl); ++ if (cached && (cachedlen || byte_diff(dtype,2,DNS_T_ANY))) { ++ log_cachedanswer(d,DNS_T_SOA); ++ if (!rqa(z)) goto DIE; ++ pos = 0; ++ while (pos = dns_packet_copy(cached,cachedlen,pos,misc,20)) { ++ pos = dns_packet_getname(cached,cachedlen,pos,&t2); ++ if (!pos) break; ++ pos = dns_packet_getname(cached,cachedlen,pos,&t3); ++ if (!pos) break; ++ if (!response_rstart(d,DNS_T_SOA,ttl)) goto DIE; ++ if (!response_addname(t2)) goto DIE; ++ if (!response_addname(t3)) goto DIE; ++ if (!response_addbytes(misc,20)) goto DIE; ++ response_rfinish(RESPONSE_ANSWER); ++ } ++ cleanup(z); ++ return 1; ++ } ++ } ++ + if (typematch(DNS_T_A,dtype)) { + byte_copy(key,2,DNS_T_A); + cached = cache_get(key,dlen + 2,&cachedlen,&ttl); +@@ -374,7 +397,7 @@ static int doit(struct query *z,int stat + } + } + +- if (!typematch(DNS_T_ANY,dtype) && !typematch(DNS_T_AXFR,dtype) && !typematch(DNS_T_NS,dtype) && !typematch(DNS_T_PTR,dtype) && !typematch(DNS_T_A,dtype) && !typematch(DNS_T_MX,dtype)) { ++ if (!typematch(DNS_T_ANY,dtype) && !typematch(DNS_T_AXFR,dtype) && !typematch(DNS_T_NS,dtype) && !typematch(DNS_T_PTR,dtype) && !typematch(DNS_T_A,dtype) && !typematch(DNS_T_MX,dtype) && !typematch(DNS_T_SOA,dtype)) { + byte_copy(key,2,dtype); + cached = cache_get(key,dlen + 2,&cachedlen,&ttl); + if (cached && (cachedlen || byte_diff(dtype,2,DNS_T_ANY))) { +@@ -601,15 +624,24 @@ static int doit(struct query *z,int stat + else if (byte_equal(type,2,DNS_T_AXFR)) + ; + else if (byte_equal(type,2,DNS_T_SOA)) { ++ int non_authority = 0; ++ save_start(); + while (i < j) { + pos = dns_packet_skipname(buf,len,records[i]); if (!pos) goto DIE; + pos = dns_packet_getname(buf,len,pos + 10,&t2); if (!pos) goto DIE; + pos = dns_packet_getname(buf,len,pos,&t3); if (!pos) goto DIE; + pos = dns_packet_copy(buf,len,pos,misc,20); if (!pos) goto DIE; +- if (records[i] < posauthority) ++ if (records[i] < posauthority) { + log_rrsoa(whichserver,t1,t2,t3,misc,ttl); ++ save_data(misc,20); ++ save_data(t2,dns_domain_length(t2)); ++ save_data(t3,dns_domain_length(t3)); ++ non_authority++; ++ } + ++i; + } ++ if (non_authority) ++ save_finish(DNS_T_SOA,t1,ttl); + } + else if (byte_equal(type,2,DNS_T_CNAME)) { + pos = dns_packet_skipname(buf,len,records[j - 1]); if (!pos) goto DIE; diff --git a/net/dmapd/Makefile b/net/dmapd/Makefile new file mode 100644 index 0000000..5dd12df --- /dev/null +++ b/net/dmapd/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2009-2012 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:=dmapd +PKG_VERSION:=0.0.50 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.flyn.org/projects/dmapd +PKG_MD5SUM:=2e04d7fb8437f9e7bd370dc3af450aae + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=2 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/dmapd + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libdmapsharing +libdb47 +vips +GraphicsMagick + TITLE:= dmapd + URL:=http://www.flyn.org/projects/dmapd/ + MAINTAINER:=W. Michael Petullo +endef + +define Package/dmapd/decription + Dmapd is a DMAP server +endef + +define Package/dmapd/conffiles +/etc/dmapd.conf +endef + +TARGET_LDFLAGS+=\ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \ + +define Package/dmapd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_CONF) $(PKG_BUILD_DIR)/distro/dmapd.conf $(1)/etc/ + $(INSTALL_BIN) ./files/dmapd.init $(1)/etc/init.d/dmapd + $(INSTALL_DIR) $(1)/usr/lib/dmapd/$(PKG_VERSION)/modules + $(CP) \ + $(PKG_INSTALL_DIR)/usr/sbin/dmapd \ + $(1)/usr/sbin/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libdmapd.so* \ + $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/dmapd/$(PKG_VERSION)/modules/*.so \ + $(1)/usr/lib/dmapd/$(PKG_VERSION)/modules/ +endef + +$(eval $(call BuildPackage,dmapd)) diff --git a/net/dmapd/files/dmapd.init b/net/dmapd/files/dmapd.init new file mode 100644 index 0000000..e76b0ef --- /dev/null +++ b/net/dmapd/files/dmapd.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2012 OpenWrt.org + +START=60 + +start() { + user_exists dmapd 56 || user_add dmapd 56 + group_exists dmapd 56 || group_add dmapd 56 + [ -d /var/run/dmapd ] || { + mkdir -m 0755 -p /var/run/dmapd + chown dmapd:dmapd /var/run/dmapd + } + [ -d /var/db/dmapd/DAAP ] || { + mkdir -m 0755 -p /var/db/dmapd/DAAP + chown dmapd:dmapd /var/db/dmapd/DAAP + } + [ -d /var/db/dmapd/DPAP ] || { + mkdir -m 0755 -p /var/db/dmapd/DPAP + chown dmapd:dmapd /var/db/dmapd/DPAP + } + mkdir -m 0755 -p /var/lock/subsys + mkdir -m 0755 -p /var/media/music + mkdir -m 0755 -p /var/media/pictures + + service_start /usr/sbin/dmapd -m /var/media/music -p /var/media/pictures --vips-disc-threshold 64k +} + +stop() { + service_stop /usr/sbin/dmapd +} diff --git a/net/dmapd/patches/001-dmapd_conf.patch b/net/dmapd/patches/001-dmapd_conf.patch new file mode 100644 index 0000000..9c1e60a --- /dev/null +++ b/net/dmapd/patches/001-dmapd_conf.patch @@ -0,0 +1,11 @@ +--- a/distro/dmapd.conf ++++ b/distro/dmapd.conf +@@ -3,7 +3,7 @@ + Database-Dir=/var/db/dmapd + + # Name that will be used to identify share: +-Share-Name=dmapd ++Share-Name=OpenWrt + + # User that dmapd will run as, current user if undefined: + User=dmapd diff --git a/net/dns2tcp/Makefile b/net/dns2tcp/Makefile new file mode 100644 index 0000000..4f038e8 --- /dev/null +++ b/net/dns2tcp/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2012 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:=dns2tcp +PKG_VERSION:=0.5.2 +PKG_RELEASE:=1 +PKG_MD5SUM:=51c5dc69f5814c2936ce6832217d292d + +PKG_SOURCE_URL:=http://www.hsc.fr/ressources/outils/dns2tcp/download/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz + +include $(INCLUDE_DIR)/package.mk + +define Package/dns2tcp/Default + SECTION:=net + CATEGORY:=Network + TITLE:=TCP over DNS tunnel + URL:=http://www.hsc.fr/ressources/outils/dns2tcp/ +endef + +define Package/dns2tcp + $(call Package/dns2tcp/Default) + TITLE+= (client) +endef + +define Package/dns2tcpd + $(call Package/dns2tcp/Default) + TITLE+= (server) +endef + +define Package/dns2tcp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/dns2tcpc $(1)/usr/bin +endef + +define Package/dns2tcpd/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/server/dns2tcpd $(1)/usr/bin +endef + +$(eval $(call BuildPackage,dns2tcp)) +$(eval $(call BuildPackage,dns2tcpd)) diff --git a/net/dsl-qos-queue/Makefile b/net/dsl-qos-queue/Makefile new file mode 100644 index 0000000..30d0f9a --- /dev/null +++ b/net/dsl-qos-queue/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=dsl_qos_queue +PKG_VERSION:=0.9.3 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.sonicspike.net/software/download/ +PKG_MD5SUM:=ccbe8d28c3508c67f669fe98532533be + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/dsl-qos-queue + SECTION:=net + CATEGORY:=Network + DEPENDS:=+iptables +kmod-ipt-queue +iptables-mod-ipopt +libipq + TITLE:=ADSL/ATM Bandwith management + URL:=http://www.sonicspike.net/software/ +endef + +define Build/Configure +endef + +define Build/Compile + $(call Build/Compile/Default, \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/libipq $(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + LIBIPQ="-lipq" \ + all \ + ) +endef + +define Package/dsl-qos-queue/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dsl_qos_train $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ipt_rules $(1)/usr/sbin +endef + +$(eval $(call BuildPackage,dsl-qos-queue)) diff --git a/net/dsl-qos-queue/patches/001-cross_compile.patch b/net/dsl-qos-queue/patches/001-cross_compile.patch new file mode 100644 index 0000000..43a9094 --- /dev/null +++ b/net/dsl-qos-queue/patches/001-cross_compile.patch @@ -0,0 +1,40 @@ +--- a/dsl_qos_queue.c ++++ b/dsl_qos_queue.c +@@ -552,12 +552,12 @@ + + syslog(LOG_INFO, "setup()"); + +- rval=system("modprobe ip_queue"); ++/* rval=system("modprobe ip_queue"); + if (WEXITSTATUS(rval)!=0) + { + printf("Unable to install ip_queue module.\n"); + exit(1); +- } ++ }*/ + + for (i=0;i +-#include + #include + #include + #include +@@ -25,6 +23,8 @@ + #include + #include + #include ++#include ++#include + + #include "daemon.h" + diff --git a/net/dsl-qos-queue/patches/010-ports_fix.patch b/net/dsl-qos-queue/patches/010-ports_fix.patch new file mode 100644 index 0000000..4280a11 --- /dev/null +++ b/net/dsl-qos-queue/patches/010-ports_fix.patch @@ -0,0 +1,22 @@ +--- a/ipt_rules ++++ b/ipt_rules +@@ -26,14 +26,14 @@ iptables -t mangle -A MYSHAPER-OUT -p tc + iptables -t mangle -A MYSHAPER-OUT -p icmp -j MARK --set-mark 20 # ICMP (ping) - high prio, impress friends + iptables -t mangle -A MYSHAPER-OUT -p udp --dport 123 -j MARK --set-mark 20 # NTP should be low-lag + iptables -t mangle -A MYSHAPER-OUT -p udp --dport 53 -j MARK --set-mark 21 # DNS name resolution (small packets) +-iptables -t mangle -A MYSHAPER-OUT -p tcp --dport ssh -j MARK --set-mark 22 # secure shell +-iptables -t mangle -A MYSHAPER-OUT -p tcp --sport ssh -j MARK --set-mark 22 # secure shell +-iptables -t mangle -A MYSHAPER-OUT -p tcp --dport telnet -j MARK --set-mark 22 # telnet (ew...) +-iptables -t mangle -A MYSHAPER-OUT -p tcp --sport telnet -j MARK --set-mark 22 # telnet (ew...) ++iptables -t mangle -A MYSHAPER-OUT -p tcp --dport 22 -j MARK --set-mark 22 # secure shell ++iptables -t mangle -A MYSHAPER-OUT -p tcp --sport 22 -j MARK --set-mark 22 # secure shell ++iptables -t mangle -A MYSHAPER-OUT -p tcp --dport 23 -j MARK --set-mark 22 # telnet (ew...) ++iptables -t mangle -A MYSHAPER-OUT -p tcp --sport 23 -j MARK --set-mark 22 # telnet (ew...) + iptables -t mangle -A MYSHAPER-OUT -p ipv6-crypt -j MARK --set-mark 24 # IPSec - we dont know what the payload is though... + iptables -t mangle -A MYSHAPER-OUT -p udp --dport 10000 -j MARK --set-mark 24 # IPSec (udp tunnel) - we dont know what the payload is though... + +-iptables -t mangle -A MYSHAPER-OUT -p tcp --sport http -j MARK --set-mark 25 # Local web server ++iptables -t mangle -A MYSHAPER-OUT -p tcp --sport 80 -j MARK --set-mark 25 # Local web server + iptables -t mangle -A MYSHAPER-OUT -p tcp -m length --length :64 -j MARK --set-mark 21 # small packets (probably just ACKs) + iptables -t mangle -A MYSHAPER-OUT -p tcp --sport 3389 -j MARK --set-mark 23 # windows remote computer connection + iptables -t mangle -A MYSHAPER-OUT -m mark --mark 0 -j MARK --set-mark 26 # redundant- mark any unmarked packets as 26 (low pri diff --git a/net/dsl-qos-queue/patches/020-fix_shebang_line.patch b/net/dsl-qos-queue/patches/020-fix_shebang_line.patch new file mode 100644 index 0000000..1a95300 --- /dev/null +++ b/net/dsl-qos-queue/patches/020-fix_shebang_line.patch @@ -0,0 +1,8 @@ +--- a/ipt_rules ++++ b/ipt_rules +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # add MYSHAPER-OUT chain to the mangle table in iptables - this sets up the table we'll use + # to filter and mark packets. + diff --git a/net/dsniff/Makefile b/net/dsniff/Makefile new file mode 100644 index 0000000..1c07c34 --- /dev/null +++ b/net/dsniff/Makefile @@ -0,0 +1,62 @@ +# +# 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:=dsniff +PKG_VERSION:=2.4b1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.monkey.org/~dugsong/dsniff/beta +PKG_MD5SUM:=2f761fa3475682a7512b0b43568ee7d6 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-2.4 + +include $(INCLUDE_DIR)/package.mk + +define Package/dsniff + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +libnids +libnet0 +libopenssl +libgdbm $(LIBRPC_DEPENDS) @BROKEN + TITLE:=A collection of tools for network auditing and penetration testing + URL:=http://www.monkey.org/~dugsong/dsniff/ +endef + +define Package/dsniff/description + A collection of tools for network auditing and penetration testing. +endef + +TARGET_LDFLAGS += $(LIBRPC) + +define Build/Configure + $(call Build/Configure/Default, \ + --with-gdbm="$(STAGING_DIR)/usr" \ + --with-libnids="$(STAGING_DIR)/usr" \ + --with-libpcap="$(STAGING_DIR)/usr" \ + --with-libnet="$(STAGING_DIR)/usr/lib/libnet-1.0.x" \ + --with-openssl="$(STAGING_DIR)/usr" \ + --without-db \ + --without-x \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + install_prefix="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/dsniff/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,dsniff)) diff --git a/net/dsniff/patches/001-arpspoof_fix.patch b/net/dsniff/patches/001-arpspoof_fix.patch new file mode 100644 index 0000000..fd29227 --- /dev/null +++ b/net/dsniff/patches/001-arpspoof_fix.patch @@ -0,0 +1,53 @@ +diff -urN dsniff.old/arp.c dsniff.dev/arp.c +--- dsniff.old/arp.c 2001-03-15 09:32:58.000000000 +0100 ++++ dsniff.dev/arp.c 2006-03-03 01:41:10.000000000 +0100 +@@ -39,7 +39,7 @@ + + #ifdef BSD + int +-arp_cache_lookup(in_addr_t ip, struct ether_addr *ether) ++arp_cache_lookup(in_addr_t ip, struct ether_addr *ether, const char *lif) + { + int mib[6]; + size_t len; +@@ -91,7 +91,7 @@ + #endif + + int +-arp_cache_lookup(in_addr_t ip, struct ether_addr *ether) ++arp_cache_lookup(in_addr_t ip, struct ether_addr *ether, const char *lif) + { + int sock; + struct arpreq ar; +@@ -99,7 +99,7 @@ + + memset((char *)&ar, 0, sizeof(ar)); + #ifdef __linux__ +- strncpy(ar.arp_dev, "eth0", sizeof(ar.arp_dev)); /* XXX - *sigh* */ ++ strncpy(ar.arp_dev, lif, strlen(lif)); + #endif + sin = (struct sockaddr_in *)&ar.arp_pa; + sin->sin_family = AF_INET; +diff -urN dsniff.old/arp.h dsniff.dev/arp.h +--- dsniff.old/arp.h 2001-03-15 09:27:08.000000000 +0100 ++++ dsniff.dev/arp.h 2006-03-03 01:42:23.000000000 +0100 +@@ -11,6 +11,6 @@ + #ifndef _ARP_H_ + #define _ARP_H_ + +-int arp_cache_lookup(in_addr_t ip, struct ether_addr *ether); ++int arp_cache_lookup(in_addr_t ip, struct ether_addr *ether, const char *lif); + + #endif /* _ARP_H_ */ +diff -urN dsniff.old/arpspoof.c dsniff.dev/arpspoof.c +--- dsniff.old/arpspoof.c 2001-03-15 09:32:58.000000000 +0100 ++++ dsniff.dev/arpspoof.c 2006-03-03 01:42:00.000000000 +0100 +@@ -113,7 +113,7 @@ + int i = 0; + + do { +- if (arp_cache_lookup(ip, mac) == 0) ++ if (arp_cache_lookup(ip, mac, intf) == 0) + return (1); + #ifdef __linux__ + /* XXX - force the kernel to arp. feh. */ diff --git a/net/dsniff/patches/001-decode_pop.patch b/net/dsniff/patches/001-decode_pop.patch new file mode 100644 index 0000000..24e1a47 --- /dev/null +++ b/net/dsniff/patches/001-decode_pop.patch @@ -0,0 +1,122 @@ +diff --git a/decode_pop.c b/decode_pop.c +index 04044f5..767da41 100644 +--- a/decode_pop.c ++++ b/decode_pop.c +@@ -6,6 +6,8 @@ + * Copyright (c) 2000 Dug Song + * + * $Id: decode_pop.c,v 1.4 2001/03/15 08:33:02 dugsong Exp $ ++ * ++ * Rewritten by Stefan Tomanek 2011 + */ + + #include "config.h" +@@ -45,32 +47,88 @@ int + decode_pop(u_char *buf, int len, u_char *obuf, int olen) + { + char *p; ++ char *s; ++ int n; + int i, j; ++ char *user; ++ char *password; ++ enum { ++ NONE, ++ AUTHPLAIN, ++ AUTHLOGIN, ++ USERPASS ++ } mode = NONE; ++ + + obuf[0] = '\0'; + + for (p = strtok(buf, "\r\n"); p != NULL; p = strtok(NULL, "\r\n")) { +- if (strncasecmp(p, "AUTH PLAIN", 10) == 0 || +- strncasecmp(p, "AUTH LOGIN", 10) == 0) { +- strlcat(obuf, p, olen); +- strlcat(obuf, "\n", olen); +- +- /* Decode SASL auth. */ +- for (i = 0; i < 2 && (p = strtok(NULL, "\r\n")); i++) { +- strlcat(obuf, p, olen); +- j = base64_pton(p, p, strlen(p)); +- p[j] = '\0'; +- strlcat(obuf, " [", olen); +- strlcat(obuf, p, olen); +- strlcat(obuf, "]\n", olen); ++ if (mode == NONE) { ++ user = NULL; ++ password = NULL; ++ if (strncasecmp(p, "AUTH PLAIN", 10) == 0) { ++ mode = AUTHPLAIN; ++ continue; ++ } ++ if (strncasecmp(p, "AUTH LOGIN", 10) == 0) { ++ mode = AUTHLOGIN; ++ continue; ++ } ++ if (strncasecmp(p, "USER ", 5) == 0) { ++ mode = USERPASS; ++ /* the traditional login cuts right to the case, ++ * so no continue here ++ */ + } + } +- /* Save regular POP2, POP3 auth info. */ +- else if (strncasecmp(p, "USER ", 5) == 0 || +- strncasecmp(p, "PASS ", 5) == 0 || +- strncasecmp(p, "HELO ", 5) == 0) { +- strlcat(obuf, p, olen); +- strlcat(obuf, "\n", olen); ++ printf("(%d) %s\n", mode, p); ++ if (mode == USERPASS) { ++ if (strncasecmp(p, "USER ", 5) == 0) { ++ user = &p[5]; ++ } else if (strncasecmp(p, "PASS ", 5) == 0) { ++ password = &p[5]; ++ } ++ } ++ ++ if (mode == AUTHPLAIN) { ++ j = base64_pton(p, p, strlen(p)); ++ p[j] = '\0'; ++ n = 0; ++ s = p; ++ /* p consists of three parts, divided by \0 */ ++ while (s <= &p[j] && n<=3) { ++ if (n == 0) { ++ /* we do not process this portion yet */ ++ } else if (n == 1) { ++ user = s; ++ } else if (n == 2) { ++ password = s; ++ } ++ n++; ++ while (*s) s++; ++ s++; ++ } ++ } ++ ++ if (mode == AUTHLOGIN) { ++ j = base64_pton(p, p, strlen(p)); ++ p[j] = '\0'; ++ if (! user) { ++ user = p; ++ } else { ++ password = p; ++ /* got everything we need :-) */ ++ } ++ } ++ ++ if (user && password) { ++ strlcat(obuf, "\nusername [", olen); ++ strlcat(obuf, user, olen); ++ strlcat(obuf, "] password [", olen); ++ strlcat(obuf, password, olen); ++ strlcat(obuf, "]\n", olen); ++ ++ mode = NONE; + } + } + return (strlen(obuf)); + diff --git a/net/dsniff/patches/001-dns.patch b/net/dsniff/patches/001-dns.patch new file mode 100644 index 0000000..e5cf8b2 --- /dev/null +++ b/net/dsniff/patches/001-dns.patch @@ -0,0 +1,704 @@ +diff -Nur dsniff-2.3/dns.c dsniff-2.3.patched/dns.c +--- dsniff-2.3/dns.c 1970-01-01 01:00:00.000000000 +0100 ++++ dsniff-2.3.patched/dns.c 2005-06-09 14:06:36.000000000 +0200 +@@ -0,0 +1,677 @@ ++/* ++ * Copyright (c) 1985, 1993 ++ * The Regents of the University of California. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 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. ++ */ ++ ++/* ++ * Portions Copyright (c) 1993 by Digital Equipment Corporation. ++ * ++ * Permission to use, copy, modify, and distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies, and that ++ * the name of Digital Equipment Corporation not be used in advertising or ++ * publicity pertaining to distribution of the document or software without ++ * specific, written prior permission. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL ++ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT ++ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL ++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR ++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS ++ * SOFTWARE. ++ */ ++ ++/* ++ * Portions Copyright (c) 1996-1999 by Internet Software Consortium. ++ * ++ * Permission to use, copy, modify, and distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS ++ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE ++ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL ++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR ++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS ++ * SOFTWARE. ++ */ ++ ++/* ++ * Copyright (c) 1996,1999 by Internet Software Consortium. ++ * ++ * Permission to use, copy, modify, and distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS ++ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE ++ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL ++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR ++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS ++ * SOFTWARE. ++ */ ++ ++/* ++ * ++ * DNS helper functions not implemented in uclibc ++ * ++ */ ++ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static const char digits[] = "0123456789"; ++ ++/* Forward. */ ++ ++static int special(int); ++static int printable(int); ++static int dn_find(const u_char *, const u_char *, ++ const u_char * const *, ++ const u_char * const *); ++ ++ ++/* ++ * ns_name_ntop(src, dst, dstsiz) ++ * Convert an encoded domain name to printable ascii as per RFC1035. ++ * return: ++ * Number of bytes written to buffer, or -1 (with errno set) ++ * notes: ++ * The root is returned as "." ++ * All other domains are returned in non absolute form ++ */ ++int ++ns_name_ntop(const u_char *src, char *dst, size_t dstsiz) { ++ const u_char *cp; ++ char *dn, *eom; ++ u_char c; ++ u_int n; ++ ++ cp = src; ++ dn = dst; ++ eom = dst + dstsiz; ++ ++ while ((n = *cp++) != 0) { ++ if ((n & NS_CMPRSFLGS) != 0) { ++ /* Some kind of compression pointer. */ ++ return (-1); ++ } ++ if (dn != dst) { ++ if (dn >= eom) { ++ return (-1); ++ } ++ *dn++ = '.'; ++ } ++ if (dn + n >= eom) { ++ return (-1); ++ } ++ for ((void)NULL; n > 0; n--) { ++ c = *cp++; ++ if (special(c)) { ++ if (dn + 1 >= eom) { ++ return (-1); ++ } ++ *dn++ = '\\'; ++ *dn++ = (char)c; ++ } else if (!printable(c)) { ++ if (dn + 3 >= eom) { ++ return (-1); ++ } ++ *dn++ = '\\'; ++ *dn++ = digits[c / 100]; ++ *dn++ = digits[(c % 100) / 10]; ++ *dn++ = digits[c % 10]; ++ } else { ++ if (dn >= eom) { ++ return (-1); ++ } ++ *dn++ = (char)c; ++ } ++ } ++ } ++ if (dn == dst) { ++ if (dn >= eom) { ++ return (-1); ++ } ++ *dn++ = '.'; ++ } ++ if (dn >= eom) { ++ return (-1); ++ } ++ *dn++ = '\0'; ++ return (dn - dst); ++} ++ ++/* ++ * ns_name_pton(src, dst, dstsiz) ++ * Convert a ascii string into an encoded domain name as per RFC1035. ++ * return: ++ * -1 if it fails ++ * 1 if string was fully qualified ++ * 0 is string was not fully qualified ++ * notes: ++ * Enforces label and domain length limits. ++ */ ++ ++int ++ns_name_pton(const char *src, u_char *dst, size_t dstsiz) { ++ u_char *label, *bp, *eom; ++ int c, n, escaped; ++ char *cp; ++ ++ escaped = 0; ++ bp = dst; ++ eom = dst + dstsiz; ++ label = bp++; ++ ++ while ((c = *src++) != 0) { ++ if (escaped) { ++ if ((cp = strchr(digits, c)) != NULL) { ++ n = (cp - digits) * 100; ++ if ((c = *src++) == 0 || ++ (cp = strchr(digits, c)) == NULL) { ++ return (-1); ++ } ++ n += (cp - digits) * 10; ++ if ((c = *src++) == 0 || ++ (cp = strchr(digits, c)) == NULL) { ++ return (-1); ++ } ++ n += (cp - digits); ++ if (n > 255) { ++ return (-1); ++ } ++ c = n; ++ } ++ escaped = 0; ++ } else if (c == '\\') { ++ escaped = 1; ++ continue; ++ } else if (c == '.') { ++ c = (bp - label - 1); ++ if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */ ++ return (-1); ++ } ++ if (label >= eom) { ++ return (-1); ++ } ++ *label = c; ++ /* Fully qualified ? */ ++ if (*src == '\0') { ++ if (c != 0) { ++ if (bp >= eom) { ++ return (-1); ++ } ++ *bp++ = '\0'; ++ } ++ if ((bp - dst) > MAXCDNAME) { ++ return (-1); ++ } ++ return (1); ++ } ++ if (c == 0 || *src == '.') { ++ return (-1); ++ } ++ label = bp++; ++ continue; ++ } ++ if (bp >= eom) { ++ return (-1); ++ } ++ *bp++ = (u_char)c; ++ } ++ c = (bp - label - 1); ++ if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */ ++ return (-1); ++ } ++ if (label >= eom) { ++ return (-1); ++ } ++ *label = c; ++ if (c != 0) { ++ if (bp >= eom) { ++ return (-1); ++ } ++ *bp++ = 0; ++ } ++ if ((bp - dst) > MAXCDNAME) { /* src too big */ ++ return (-1); ++ } ++ return (0); ++} ++ ++/* ++ * ns_name_ntol(src, dst, dstsiz) ++ * Convert a network strings labels into all lowercase. ++ * return: ++ * Number of bytes written to buffer, or -1 (with errno set) ++ * notes: ++ * Enforces label and domain length limits. ++ */ ++ ++int ++ns_name_ntol(const u_char *src, u_char *dst, size_t dstsiz) { ++ const u_char *cp; ++ u_char *dn, *eom; ++ u_char c; ++ u_int n; ++ ++ cp = src; ++ dn = dst; ++ eom = dst + dstsiz; ++ ++ while ((n = *cp++) != 0) { ++ if ((n & NS_CMPRSFLGS) != 0) { ++ /* Some kind of compression pointer. */ ++ return (-1); ++ } ++ *dn++ = n; ++ if (dn + n >= eom) { ++ return (-1); ++ } ++ for ((void)NULL; n > 0; n--) { ++ c = *cp++; ++ if (isupper(c)) ++ *dn++ = tolower(c); ++ else ++ *dn++ = c; ++ } ++ } ++ *dn++ = '\0'; ++ return (dn - dst); ++} ++ ++/* ++ * ns_name_unpack(msg, eom, src, dst, dstsiz) ++ * Unpack a domain name from a message, source may be compressed. ++ * return: ++ * -1 if it fails, or consumed octets if it succeeds. ++ */ ++int ++ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src, ++ u_char *dst, size_t dstsiz) ++{ ++ const u_char *srcp, *dstlim; ++ u_char *dstp; ++ int n, len, checked; ++ ++ len = -1; ++ checked = 0; ++ dstp = dst; ++ srcp = src; ++ dstlim = dst + dstsiz; ++ if (srcp < msg || srcp >= eom) { ++ return (-1); ++ } ++ /* Fetch next label in domain name. */ ++ while ((n = *srcp++) != 0) { ++ /* Check for indirection. */ ++ switch (n & NS_CMPRSFLGS) { ++ case 0: ++ /* Limit checks. */ ++ if (dstp + n + 1 >= dstlim || srcp + n >= eom) { ++ return (-1); ++ } ++ checked += n + 1; ++ *dstp++ = n; ++ memcpy(dstp, srcp, n); ++ dstp += n; ++ srcp += n; ++ break; ++ ++ case NS_CMPRSFLGS: ++ if (srcp >= eom) { ++ return (-1); ++ } ++ if (len < 0) ++ len = srcp - src + 1; ++ srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff)); ++ if (srcp < msg || srcp >= eom) { /* Out of range. */ ++ return (-1); ++ } ++ checked += 2; ++ /* ++ * Check for loops in the compressed name; ++ * if we've looked at the whole message, ++ * there must be a loop. ++ */ ++ if (checked >= eom - msg) { ++ return (-1); ++ } ++ break; ++ ++ default: ++ return (-1); /* flag error */ ++ } ++ } ++ *dstp = '\0'; ++ if (len < 0) ++ len = srcp - src; ++ return (len); ++} ++ ++/* ++ * ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr) ++ * Pack domain name 'domain' into 'comp_dn'. ++ * return: ++ * Size of the compressed name, or -1. ++ * notes: ++ * 'dnptrs' is an array of pointers to previous compressed names. ++ * dnptrs[0] is a pointer to the beginning of the message. The array ++ * ends with NULL. ++ * 'lastdnptr' is a pointer to the end of the array pointed to ++ * by 'dnptrs'. ++ * Side effects: ++ * The list of pointers in dnptrs is updated for labels inserted into ++ * the message as we compress the name. If 'dnptr' is NULL, we don't ++ * try to compress names. If 'lastdnptr' is NULL, we don't update the ++ * list. ++ */ ++int ++ns_name_pack(const u_char *src, u_char *dst, int dstsiz, ++ const u_char **dnptrs, const u_char **lastdnptr) ++{ ++ u_char *dstp; ++ const u_char **cpp, **lpp, *eob, *msg; ++ const u_char *srcp; ++ int n, l, first = 1; ++ ++ srcp = src; ++ dstp = dst; ++ eob = dstp + dstsiz; ++ lpp = cpp = NULL; ++ if (dnptrs != NULL) { ++ if ((msg = *dnptrs++) != NULL) { ++ for (cpp = dnptrs; *cpp != NULL; cpp++) ++ (void)NULL; ++ lpp = cpp; /* end of list to search */ ++ } ++ } else ++ msg = NULL; ++ ++ /* make sure the domain we are about to add is legal */ ++ l = 0; ++ do { ++ n = *srcp; ++ if ((n & NS_CMPRSFLGS) != 0) { ++ return (-1); ++ } ++ l += n + 1; ++ if (l > MAXCDNAME) { ++ return (-1); ++ } ++ srcp += n + 1; ++ } while (n != 0); ++ ++ /* from here on we need to reset compression pointer array on error */ ++ srcp = src; ++ do { ++ /* Look to see if we can use pointers. */ ++ n = *srcp; ++ if (n != 0 && msg != NULL) { ++ l = dn_find(srcp, msg, (const u_char * const *)dnptrs, ++ (const u_char * const *)lpp); ++ if (l >= 0) { ++ if (dstp + 1 >= eob) { ++ goto cleanup; ++ } ++ *dstp++ = (l >> 8) | NS_CMPRSFLGS; ++ *dstp++ = l % 256; ++ return (dstp - dst); ++ } ++ /* Not found, save it. */ ++ if (lastdnptr != NULL && cpp < lastdnptr - 1 && ++ (dstp - msg) < 0x4000 && first) { ++ *cpp++ = dstp; ++ *cpp = NULL; ++ first = 0; ++ } ++ } ++ /* copy label to buffer */ ++ if (n & NS_CMPRSFLGS) { /* Should not happen. */ ++ goto cleanup; ++ } ++ if (dstp + 1 + n >= eob) { ++ goto cleanup; ++ } ++ memcpy(dstp, srcp, n + 1); ++ srcp += n + 1; ++ dstp += n + 1; ++ } while (n != 0); ++ ++ if (dstp > eob) { ++cleanup: ++ if (msg != NULL) ++ *lpp = NULL; ++ return (-1); ++ } ++ return (dstp - dst); ++} ++ ++/* ++ * ns_name_uncompress(msg, eom, src, dst, dstsiz) ++ * Expand compressed domain name to presentation format. ++ * return: ++ * Number of bytes read out of `src', or -1 (with errno set). ++ * note: ++ * Root domain returns as "." not "". ++ */ ++int ++ns_name_uncompress(const u_char *msg, const u_char *eom, const u_char *src, ++ char *dst, size_t dstsiz) ++{ ++ u_char tmp[NS_MAXCDNAME]; ++ int n; ++ ++ if ((n = ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1) ++ return (-1); ++ if (ns_name_ntop(tmp, dst, dstsiz) == -1) ++ return (-1); ++ return (n); ++} ++ ++/* ++ * ns_name_compress(src, dst, dstsiz, dnptrs, lastdnptr) ++ * Compress a domain name into wire format, using compression pointers. ++ * return: ++ * Number of bytes consumed in `dst' or -1 (with errno set). ++ * notes: ++ * 'dnptrs' is an array of pointers to previous compressed names. ++ * dnptrs[0] is a pointer to the beginning of the message. ++ * The list ends with NULL. 'lastdnptr' is a pointer to the end of the ++ * array pointed to by 'dnptrs'. Side effect is to update the list of ++ * pointers for labels inserted into the message as we compress the name. ++ * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr' ++ * is NULL, we don't update the list. ++ */ ++int ++ns_name_compress(const char *src, u_char *dst, size_t dstsiz, ++ const u_char **dnptrs, const u_char **lastdnptr) ++{ ++ u_char tmp[NS_MAXCDNAME]; ++ ++ if (ns_name_pton(src, tmp, sizeof tmp) == -1) ++ return (-1); ++ return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr)); ++} ++ ++/* ++ * special(ch) ++ * Thinking in noninternationalized USASCII (per the DNS spec), ++ * is this characted special ("in need of quoting") ? ++ * return: ++ * boolean. ++ */ ++static int ++special(int ch) { ++ switch (ch) { ++ case 0x22: /* '"' */ ++ case 0x2E: /* '.' */ ++ case 0x3B: /* ';' */ ++ case 0x5C: /* '\\' */ ++ /* Special modifiers in zone files. */ ++ case 0x40: /* '@' */ ++ case 0x24: /* '$' */ ++ return (1); ++ default: ++ return (0); ++ } ++} ++ ++/* ++ * printable(ch) ++ * Thinking in noninternationalized USASCII (per the DNS spec), ++ * is this character visible and not a space when printed ? ++ * return: ++ * boolean. ++ */ ++static int ++printable(int ch) { ++ return (ch > 0x20 && ch < 0x7f); ++} ++ ++/* ++ * Thinking in noninternationalized USASCII (per the DNS spec), ++ * convert this character to lower case if it's upper case. ++ */ ++static int ++mklower(int ch) { ++ if (ch >= 0x41 && ch <= 0x5A) ++ return (ch + 0x20); ++ return (ch); ++} ++ ++/* ++ * dn_find(domain, msg, dnptrs, lastdnptr) ++ * Search for the counted-label name in an array of compressed names. ++ * return: ++ * offset from msg if found, or -1. ++ * notes: ++ * dnptrs is the pointer to the first name on the list, ++ * not the pointer to the start of the message. ++ */ ++static int ++dn_find(const u_char *domain, const u_char *msg, ++ const u_char * const *dnptrs, ++ const u_char * const *lastdnptr) ++{ ++ const u_char *dn, *cp, *sp; ++ const u_char * const *cpp; ++ u_int n; ++ ++ for (cpp = dnptrs; cpp < lastdnptr; cpp++) { ++ sp = *cpp; ++ /* ++ * terminate search on: ++ * root label ++ * compression pointer ++ * unusable offset ++ */ ++ while (*sp != 0 && (*sp & NS_CMPRSFLGS) == 0 && ++ (sp - msg) < 0x4000) { ++ dn = domain; ++ cp = sp; ++ while ((n = *cp++) != 0) { ++ /* ++ * check for indirection ++ */ ++ switch (n & NS_CMPRSFLGS) { ++ case 0: /* normal case, n == len */ ++ if (n != *dn++) ++ goto next; ++ for ((void)NULL; n > 0; n--) ++ if (mklower(*dn++) != ++ mklower(*cp++)) ++ goto next; ++ /* Is next root for both ? */ ++ if (*dn == '\0' && *cp == '\0') ++ return (sp - msg); ++ if (*dn) ++ continue; ++ goto next; ++ ++ case NS_CMPRSFLGS: /* indirection */ ++ cp = msg + (((n & 0x3f) << 8) | *cp); ++ break; ++ ++ default: /* illegal type */ ++ return (-1); ++ } ++ } ++ next: ++ sp += *sp + 1; ++ } ++ } ++ return (-1); ++} ++ ++/* ++ * Expand compressed domain name 'comp_dn' to full domain name. ++ * 'msg' is a pointer to the begining of the message, ++ * 'eomorig' points to the first location after the message, ++ * 'exp_dn' is a pointer to a buffer of size 'length' for the result. ++ * Return size of compressed name or -1 if there was an error. ++ */ ++int ++dn_expand(const u_char *msg, const u_char *eom, const u_char *src, ++ char *dst, int dstsiz) ++{ ++ int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz); ++ ++ if (n > 0 && dst[0] == '.') ++ dst[0] = '\0'; ++ return (n); ++} ++ ++/* ++ * Pack domain name 'exp_dn' in presentation form into 'comp_dn'. ++ * Return the size of the compressed name or -1. ++ * 'length' is the size of the array pointed to by 'comp_dn'. ++ */ ++int ++dn_comp(const char *src, u_char *dst, int dstsiz, ++ u_char **dnptrs, u_char **lastdnptr) ++{ ++ return (ns_name_compress(src, dst, (size_t)dstsiz, ++ (const u_char **)dnptrs, ++ (const u_char **)lastdnptr)); ++} ++ +diff -Nur dsniff-2.3/Makefile.in dsniff-2.3.patched/Makefile.in +--- dsniff-2.3/Makefile.in 2000-12-15 21:03:26.000000000 +0100 ++++ dsniff-2.3.patched/Makefile.in 2005-06-09 14:03:18.000000000 +0200 +@@ -51,7 +51,7 @@ + pathnames.h pcaputil.h record.h rpc.h tcp_raw.h trigger.h \ + version.h vroot.h + +-SRCS = asn1.c base64.c buf.c hex.c magic.c mount.c pcaputil.c rpc.c \ ++SRCS = asn1.c base64.c buf.c dns.c hex.c magic.c mount.c pcaputil.c rpc.c \ + tcp_raw.c trigger.c record.c dsniff.c decode.c decode_aim.c \ + decode_citrix.c decode_cvs.c decode_ftp.c decode_hex.c \ + decode_http.c decode_icq.c decode_imap.c decode_irc.c \ +@@ -99,8 +99,8 @@ + arpspoof: arpspoof.o arp.o + $(CC) $(LDFLAGS) -o $@ arpspoof.o arp.o $(LIBS) $(PCAPLIB) $(LNETLIB) + +-dnsspoof: dnsspoof.o pcaputil.o +- $(CC) $(LDFLAGS) -o $@ dnsspoof.o pcaputil.o $(LIBS) $(PCAPLIB) $(LNETLIB) ++dnsspoof: dnsspoof.o pcaputil.o dns.o ++ $(CC) $(LDFLAGS) -o $@ dnsspoof.o pcaputil.o dns.o $(LIBS) $(PCAPLIB) $(LNETLIB) + + filesnarf: nfs_prot.o filesnarf.o pcaputil.o rpc.o + $(CC) $(LDFLAGS) -o $@ filesnarf.o nfs_prot.o pcaputil.o rpc.o $(LIBS) $(NIDSLIB) $(PCAPLIB) $(LNETLIB) diff --git a/net/dsniff/patches/003-gdbm.patch b/net/dsniff/patches/003-gdbm.patch new file mode 100644 index 0000000..67be3e5 --- /dev/null +++ b/net/dsniff/patches/003-gdbm.patch @@ -0,0 +1,206 @@ +Index: dsniff-2.4/configure +=================================================================== +--- dsniff-2.4.orig/configure 2010-11-03 23:42:49.466000001 +0100 ++++ dsniff-2.4/configure 2010-11-03 23:42:52.921000006 +0100 +@@ -16,6 +16,8 @@ + ac_help="$ac_help + --with-db=DIR use Berkeley DB (with --enable-compat185) in DIR" + ac_help="$ac_help ++ --with-gdbm=DIR use GNU DBM in DIR" ++ac_help="$ac_help + --with-libpcap=DIR use libpcap in DIR" + ac_help="$ac_help + --with-libnet=DIR use libnet in DIR" +@@ -3059,7 +3061,40 @@ + + fi + ++echo $ac_n "checking for libgdbm""... $ac_c" 1>&6 ++echo "configure:3059: checking for libgdbm" >&5 ++# Check whether --with-gdbm or --without-gdbm was given. ++if test "${with_gdbm+set}" = set; then ++ withval="$with_gdbm" ++ case "$withval" in ++ yes|no) ++ echo "$ac_t""no" 1>&6 ++ ;; ++ *) ++ echo "$ac_t""$withval" 1>&6 ++ if test -f $withval/include/gdbm.h -a -f $withval/lib/libgdbm.a; then ++ owd=`pwd` ++ if cd $withval; then withval=`pwd`; cd $owd; fi ++ DBINC="-I$withval/include" ++ DBLIB="-L$withval/lib -lgdbm" ++ else ++ { echo "configure: error: gdbm.h or libgdbm.a not found in $withval" 1>&2; exit 1; } ++ fi ++ ;; ++ esac ++else ++ if test -f ${prefix}/include/gdbm.h; then ++ LNETINC="-I${prefix}/include" ++ LNETLIB="-L${prefix}/lib -lgdbm" ++ elif test -f /usr/include/gdbm.h; then ++ LNETLIB="-lgdbm" ++ else ++ echo "$ac_t""no" 1>&6 ++ { echo "configure: error: libgdbm not found" 1>&2; exit 1; } ++ fi ++ echo "$ac_t""yes" 1>&6 + ++fi + + + echo $ac_n "checking for libnet""... $ac_c" 1>&6 +Index: dsniff-2.4/record.c +=================================================================== +--- dsniff-2.4.orig/record.c 2010-11-03 23:42:49.471000001 +0100 ++++ dsniff-2.4/record.c 2010-11-03 23:42:52.922000005 +0100 +@@ -15,12 +15,7 @@ + #include + #include + #include +-#ifdef HAVE_DB_185_H +-#define DB_LIBRARY_COMPATIBILITY_API +-#include +-#elif HAVE_DB_H +-#include +-#endif ++#include + #include + + #include "options.h" +@@ -37,7 +32,7 @@ + struct netobj data; + }; + +-static DB *db; ++GDBM_FILE dbf; + + static int + xdr_rec(XDR *xdrs, struct rec *rec) +@@ -64,7 +59,6 @@ + + tm = localtime(&rec->time); + strftime(tstr, sizeof(tstr), "%x %X", tm); +- + srcp = libnet_host_lookup(rec->src, Opt_dns); + dstp = libnet_host_lookup(rec->dst, Opt_dns); + +@@ -89,10 +83,10 @@ + fflush(stdout); + } + +-static DBT * ++static datum + record_hash(struct rec *rec) + { +- static DBT key; ++ static datum key; + static u_char hash[16]; + MD5_CTX ctx; + +@@ -105,16 +99,16 @@ + MD5Update(&ctx, rec->data.n_bytes, rec->data.n_len); + MD5Final(hash, &ctx); + +- key.data = hash; +- key.size = sizeof(hash); ++ key.dptr = hash; ++ key.dsize = sizeof(hash); + +- return (&key); ++ return (key); + } + + static int + record_save(struct rec *rec) + { +- DBT *key, data; ++ datum key, data; + XDR xdrs; + u_char buf[2048]; + +@@ -123,15 +117,15 @@ + if (!xdr_rec(&xdrs, rec)) + return (0); + +- data.data = buf; +- data.size = xdr_getpos(&xdrs); ++ data.dptr = buf; ++ data.dsize = xdr_getpos(&xdrs); + + xdr_destroy(&xdrs); + + key = record_hash(rec); + +- if (db->put(db, key, &data, R_NOOVERWRITE) == 0) +- db->sync(db, 0); ++ if (gdbm_store(dbf, key, data, GDBM_INSERT) == 0) ++ gdbm_sync(dbf); + + return (1); + } +@@ -139,18 +133,22 @@ + void + record_dump(void) + { +- DBT key, data; ++ datum nextkey, key, content; + XDR xdrs; + struct rec rec; + +- while (db->seq(db, &key, &data, R_NEXT) == 0) { ++ key = gdbm_firstkey(dbf); ++ while (key.dptr) { ++ nextkey = gdbm_nextkey(dbf, key); ++ content = gdbm_fetch(dbf, key); + memset(&rec, 0, sizeof(rec)); +- xdrmem_create(&xdrs, data.data, data.size, XDR_DECODE); +- ++ xdrmem_create(&xdrs, content.dptr, content.dsize, XDR_DECODE); + if (xdr_rec(&xdrs, &rec)) { + record_print(&rec); + } + xdr_destroy(&xdrs); ++ free(key.dptr); ++ key = nextkey; + } + } + +@@ -158,16 +156,23 @@ + record_init(char *file) + { + int flags, mode; +- ++ // needed for gdbm_open, which does not have the option to create ++ // a database in memory ++ if(file == NULL) { ++ char *record_file = "/tmp/.dsniff.db"; ++ file = record_file; ++ } ++ + if (Opt_read) { +- flags = O_RDONLY; ++ flags = GDBM_READER; + mode = 0; + } + else { +- flags = O_RDWR|O_CREAT; ++ flags = GDBM_WRCREAT; + mode = S_IRUSR|S_IWUSR; + } +- if ((db = dbopen(file, flags, mode, DB_BTREE, NULL)) == NULL) ++ ++ if ((dbf = gdbm_open(file, 1024, flags, mode, NULL)) == NULL) + return (0); + + return (1); +@@ -206,6 +211,6 @@ + void + record_close(void) + { +- db->close(db); ++ gdbm_close(dbf); + } + diff --git a/net/dsniff/patches/004-no_yp.patch b/net/dsniff/patches/004-no_yp.patch new file mode 100644 index 0000000..774e04e --- /dev/null +++ b/net/dsniff/patches/004-no_yp.patch @@ -0,0 +1,45 @@ +Index: dsniff-2.4/decode.c +=================================================================== +--- dsniff-2.4.orig/decode.c 2010-11-03 23:42:49.419000001 +0100 ++++ dsniff-2.4/decode.c 2010-11-03 23:42:56.481000002 +0100 +@@ -51,8 +51,6 @@ + extern int decode_portmap(u_char *, int, u_char *, int); + extern int decode_mountd(u_char *, int, u_char *, int); + extern int decode_vrrp(u_char *, int, u_char *, int); +-extern int decode_ypserv(u_char *, int, u_char *, int); +-extern int decode_yppasswd(u_char *, int, u_char *, int); + + static struct decode decodes[] = { + { "hex", decode_hex }, +@@ -88,8 +86,6 @@ + { "irc", decode_irc }, + { "portmap", decode_portmap }, + { "mountd", decode_mountd }, +- { "ypserv", decode_ypserv }, +- { "yppasswd", decode_yppasswd }, + { NULL } + }; + +Index: dsniff-2.4/dsniff.services +=================================================================== +--- dsniff-2.4.orig/dsniff.services 2010-11-03 23:42:49.429000001 +0100 ++++ dsniff-2.4/dsniff.services 2010-11-03 23:42:56.481000002 +0100 +@@ -66,5 +66,3 @@ + aim 9898/tcp + pcanywhere 65301/tcp + mountd 100005/rpc +-ypserv 100004/rpc +-yppasswd 100009/rpc +Index: dsniff-2.4/Makefile.in +=================================================================== +--- dsniff-2.4.orig/Makefile.in 2010-11-03 23:42:51.736998874 +0100 ++++ dsniff-2.4/Makefile.in 2010-11-03 23:42:56.481000002 +0100 +@@ -60,7 +60,7 @@ + decode_pop.c decode_portmap.c decode_postgresql.c decode_pptp.c \ + decode_rip.c decode_rlogin.c decode_smb.c decode_smtp.c \ + decode_sniffer.c decode_snmp.c decode_socks.c decode_tds.c \ +- decode_telnet.c decode_vrrp.c decode_yp.c decode_x11.c ++ decode_telnet.c decode_vrrp.c decode_x11.c + + GEN = mount.h mount.c nfs_prot.h nfs_prot.c + diff --git a/net/dsniff/patches/005-openssl_fix.patch b/net/dsniff/patches/005-openssl_fix.patch new file mode 100644 index 0000000..1b2f9e7 --- /dev/null +++ b/net/dsniff/patches/005-openssl_fix.patch @@ -0,0 +1,11 @@ +--- dsniff-2.4b1.orig/sshcrypto.c ++++ dsniff-2.4b1/sshcrypto.c +@@ -14,6 +14,8 @@ + + #include + #include ++#include ++#include + + #include + #include diff --git a/net/dsniff/patches/006-pcap_header.patch b/net/dsniff/patches/006-pcap_header.patch new file mode 100644 index 0000000..6836557 --- /dev/null +++ b/net/dsniff/patches/006-pcap_header.patch @@ -0,0 +1,13 @@ +Index: dsniff-2.4/configure +=================================================================== +--- dsniff-2.4.orig/configure 2010-11-03 23:42:52.921000006 +0100 ++++ dsniff-2.4/configure 2010-11-03 23:43:00.504000001 +0100 +@@ -3033,7 +3033,7 @@ + PCAPINC="-I$withval -I$withval/bpf" + PCAPLIB="-L$withval -lpcap" + elif test -f $withval/include/pcap.h -a \ +- -f $withval/include/net/bpf.h -a \ ++ -f $withval/include/pcap-bpf.h -a \ + -f $withval/lib/libpcap.a; then + owd=`pwd` + if cd $withval; then withval=`pwd`; cd $owd; fi diff --git a/net/dsniff/patches/007-time_h.patch b/net/dsniff/patches/007-time_h.patch new file mode 100644 index 0000000..280b8c1 --- /dev/null +++ b/net/dsniff/patches/007-time_h.patch @@ -0,0 +1,22 @@ +diff -urNad --exclude=CVS --exclude=.svn dsniff-2.4b1/msgsnarf.c dsniff-2.4b1/msgsnarf.c +--- dsniff-2.4b1/msgsnarf.c 2001-03-15 08:33:04.000000000 +0000 ++++ dsniff-2.4b1/msgsnarf.c 2005-07-11 20:15:50.000000000 +0000 +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + #include "buf.h" + #include "decode.h" +diff -urNad --exclude=CVS --exclude=.svn dsniff-2.4b1/sshow.c dsniff-2.4b1/sshow.c +--- dsniff-2.4b1/sshow.c 2005-07-11 20:14:19.000000000 +0000 ++++ dsniff-2.4b1/sshow.c 2005-07-11 20:15:26.000000000 +0000 +@@ -15,6 +15,7 @@ + + #include + #include ++#include + + #include + #include diff --git a/net/dsniff/patches/008-md5_include.patch b/net/dsniff/patches/008-md5_include.patch new file mode 100644 index 0000000..f8d3829 --- /dev/null +++ b/net/dsniff/patches/008-md5_include.patch @@ -0,0 +1,13 @@ +Index: dsniff-2.4/record.c +=================================================================== +--- dsniff-2.4.orig/record.c 2010-11-03 23:43:14.268000004 +0100 ++++ dsniff-2.4/record.c 2010-11-03 23:43:16.947000004 +0100 +@@ -14,7 +14,7 @@ + + #include + #include +-#include ++#include "missing/md5.h" + #include + #include + diff --git a/net/dsniff/patches/010-clk-tck-fix.patch b/net/dsniff/patches/010-clk-tck-fix.patch new file mode 100644 index 0000000..cc15bef --- /dev/null +++ b/net/dsniff/patches/010-clk-tck-fix.patch @@ -0,0 +1,15 @@ +Index: dsniff-2.4/sshow.c +=================================================================== +--- dsniff-2.4.orig/sshow.c 2010-11-03 23:41:56.335999997 +0100 ++++ dsniff-2.4/sshow.c 2010-11-03 23:42:10.981000001 +0100 +@@ -42,6 +42,10 @@ + + #define HISTORY_SIZE 16 + ++#ifndef CLK_TCK ++# define CLK_TCK CLOCKS_PER_SEC ++#endif ++ + typedef struct { + u_int min, max; + } range; diff --git a/net/dudders/Makefile b/net/dudders/Makefile new file mode 100644 index 0000000..02549d8 --- /dev/null +++ b/net/dudders/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (C) 2010-2011 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:=dudders +PKG_VERSION:=1.04 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=1d368a86f3c284e95d260a94767a8ded + +PKG_BUILD_DEPENDS:=+libopenssl +libgcrypt +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/dudders + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + DEPENDS:=+libopenssl +libgcrypt +libgpg-error + TITLE:=DNS Update SIG(0) client + MAINTAINER:=Dean Scarff + URL:=http://dudders.sourceforge.net/ +endef + +define Package/dudders/description + Dudders is a utility for updating DNS records. It points + a domain name to a given IP address, using the RFC2136 DNS + UPDATE protocol and a SIG(0) signature. It is designed with + embedded systems in mind. + + You must have either libopenssl or libgcrypt installed to + use this package. +endef + +define Package/dudders/conffiles +/etc/config/dudders +endef + +EXTRA_CFLAGS:= -DNDEBUG -std=gnu99 + +CONFIGURE_ARGS+= \ + --with-libgcrypt-prefix="$(STAGING_DIR)/usr" + +define Package/dudders/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dudders $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/dudders + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/dudders/crypt_gcrypt.so \ + $(1)/usr/lib/dudders/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/dudders/crypt_openssl.so \ + $(1)/usr/lib/dudders/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/dudders.config $(1)/etc/config/dudders + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_BIN) ./files/dudders.hotplug $(1)/etc/hotplug.d/iface/50-dudders +endef + +$(eval $(call BuildPackage,dudders)) diff --git a/net/dudders/files/dudders.config b/net/dudders/files/dudders.config new file mode 100644 index 0000000..27dc4b6 --- /dev/null +++ b/net/dudders/files/dudders.config @@ -0,0 +1,7 @@ +config dudders + option enabled 'no' + option tcp 'yes' + option keyfile '/tmp/dudders.private' + option keyname 'owner.example.com' + option hostname 'test.example.com' + option ttl 86400 diff --git a/net/dudders/files/dudders.hotplug b/net/dudders/files/dudders.hotplug new file mode 100644 index 0000000..7e3026f --- /dev/null +++ b/net/dudders/files/dudders.hotplug @@ -0,0 +1,46 @@ +#!/bin/sh + +. /lib/functions.sh + +config_cb() { + local cfg="$CONFIG_SECTION" + local cfgtype + config_get cfgtype "$cfg" TYPE + dudders=/usr/bin/dudders + + case "$cfgtype" in + dudders) + config_get enabled $cfg enabled + [ "$enabled" = "yes" ] || return 0 + + config_get tcp $cfg tcp + config_get keyname $cfg keyname + config_get mname $cfg mname + config_get zone $cfg zone + config_get keyfile $cfg keyfile + config_get hostname $cfg hostname + config_get ttl $cfg ttl + + [ -r "$keyfile" ] || return 1 + sleep 1 + interface=$(route -n 2>&- \ + |grep '^0.0.0.0' \ + |sed -e 's/.* \([^ ]\+\)$/\1/') + [ -z "$interface" ] && return 0 + [ "$DEVICE" = "$interface" -o \ + "$IFNAME" = "$interface" -o \ + "$PPP_IFACE" = "$interface" ] || return 0 + ipaddr=${PPP_LOCAL:-${IPLOCAL:-$(ifconfig "$interface" \ + |grep -o 'addr:[^ ]\+' \ + |sed -e 's/addr://')}} + OPTS=${keyname:+" -k '$keyname'"} + [ "$tcp" = "yes" ] && OPTS=$OPTS" -T" + OPTS=$OPTS${mname:+" -m '$mname'"} + OPTS=$OPTS${zone:+" -z '$zone'"} + eval $dudders -k $keyfile $OPTS $hostname $ttl $ipaddr + ;; + esac +} +case "${ACTION:-ifup}" in + ifup) config_load dudders ;; +esac diff --git a/net/e169-stats/Makefile b/net/e169-stats/Makefile new file mode 100644 index 0000000..cac9d12 --- /dev/null +++ b/net/e169-stats/Makefile @@ -0,0 +1,37 @@ +# +# Copyright (C) 2010-2011 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:=e169-stats +PKG_VERSION:=0.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.mavetju.org/download +PKG_MD5SUM:=2f6f5b984faeec368a867e59cd2cc36d + +include $(INCLUDE_DIR)/package.mk + +define Package/e169-stats + SECTION:=net + CATEGORY:=Network + TITLE:=Huawei USB modem statistics + URL:=http://www.mavetju.org/weblog/html/00282.html + DEPENDS:=+libncurses +endef + +define Package/e169-stats/description + Huawei E169 statistics, works with other Huawei's devices. +endef + +define Package/e169-stats/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/e169-stats $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,e169-stats)) diff --git a/net/e169-stats/patches/01-make.patch b/net/e169-stats/patches/01-make.patch new file mode 100644 index 0000000..28a56c5 --- /dev/null +++ b/net/e169-stats/patches/01-make.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,7 @@ + all: e169-stats + + e169-stats: e169-stats.c +- gcc -Wall -o e169-stats e169-stats.c -lcurses ++ $(CC) -Wall -o e169-stats e169-stats.c -lcurses -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib + + clean: + -rm e169-stats *.core diff --git a/net/ekg/Makefile b/net/ekg/Makefile new file mode 100644 index 0000000..772e811 --- /dev/null +++ b/net/ekg/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=ekg +PKG_VERSION:=1.7 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://ekg.chmurka.net/ +PKG_MD5SUM:=2aa92b56517fdf09d75519a105772b74 + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ekg + SECTION:=net + CATEGORY:=Network + SUBMENU:=Instant Messaging + TITLE:=Eksperymentalny Klient Gadu-Gadu (Polish IM) + URL:=http://ekg.chmurka.net + DEPENDS:=+zlib +libncurses +endef + +CONFIGURE_ARGS+= \ + --without-c99-vsnprintf \ + --without-bind \ + --without-libgsm \ + --without-libjpeg \ + --without-libungif \ + --without-openssl \ + --disable-libgadu-openssl \ + --enable-ui-ncurses \ + --disable-ui-readline \ + +CONFIGURE_VARS+= \ + CFLAGS="$$$$CFLAGS $(TARGET_CPPFLAGS)" \ + CFLAGS_LIBGADU="$$$$CFLAGS $(TARGET_CPPFLAGS)" \ + +define Package/ekg/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/ekg $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,ekg)) diff --git a/net/ekg/patches/100-compile-fixes.patch b/net/ekg/patches/100-compile-fixes.patch new file mode 100644 index 0000000..2f9ccbd --- /dev/null +++ b/net/ekg/patches/100-compile-fixes.patch @@ -0,0 +1,62 @@ +Index: ekg-1.7/Makefile.in +=================================================================== +--- ekg-1.7.orig/Makefile.in 2010-11-02 16:55:11.021994526 +0100 ++++ ekg-1.7/Makefile.in 2010-11-02 16:59:57.189994991 +0100 +@@ -15,29 +15,31 @@ + + # + +-all: configure libgadu @ekg@ @make_ekgwap@ ++libgadu:=lib/libgadu.a + +-libgadu: +- cd lib && $(MAKE) all ++all: @ekg@ @make_ekgwap@ + +-ekg: +- cd src && $(MAKE) all ++$(libgadu): dep ++ $(MAKE) -C lib + +-make-ekgwap: +- cd ekgwap && $(MAKE) all ++ekg: $(libgadu) ++ $(MAKE) -C src + +-examples: +- cd examples && $(MAKE) all ++make-ekgwap: $(libgadu) ++ $(MAKE) -C ekgwap ++ ++examples: $(libgadu) ++ $(MAKE) -C examples + + # + + dep: dep-libgadu @dep_ekg@ + +-dep-libgadu: +- cd lib && $(MAKE) dep ++dep-libgadu: configure ++ $(MAKE) -C lib dep + +-dep-ekg: +- cd src && $(MAKE) dep ++dep-ekg: configure ++ $(MAKE) -C src dep + + # + +@@ -49,10 +51,10 @@ + install: all install-libgadu @install_ekg@ @install_ekgwap@ + + install-libgadu: +- cd lib && $(MAKE) install ++ $(MAKE) -C lib install + + install-ekg: install-ekg-data install-ekg-man +- cd src && $(MAKE) install ++ $(MAKE) -C src install + + install-ekg-data: + $(INSTALL) -d $(DESTDIR)$(datadir)/ekg/themes diff --git a/net/elinks/Makefile b/net/elinks/Makefile new file mode 100644 index 0000000..af26ac1 --- /dev/null +++ b/net/elinks/Makefile @@ -0,0 +1,92 @@ +# +# Copyright (C) 2006-2009 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:=elinks +PKG_VERSION:=0.11.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://elinks.or.cz/download +PKG_MD5SUM:=fcd087a6d2415cd4c6fd1db53dceb646 + +include $(INCLUDE_DIR)/package.mk + +define Package/elinks + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libopenssl + TITLE:=A text based web browser + URL:=http://elinks.or.cz/ +endef + +define Package/elinks/description +An advanced text based web browser +endef + +SHVAR_TRANS:= \ + $(STAGING_DIR_HOST)/bin/sed -e \ + 'y%*+%pp%;s%[^_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]%_%g' + +define Build/Configure + (cd $(PKG_BUILD_DIR); rm -rf config.cache; \ + x=`echo ac_cv_file_./features.conf | $(SHVAR_TRANS)` && export $$$${x}=yes && \ + x=`echo ac_cv_file_$(abspath $(PKG_BUILD_DIR)/features.conf) | $(SHVAR_TRANS)` && export $$$${x}=yes && \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --program-prefix="" \ + --program-suffix="" \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --datadir=/usr/share \ + --includedir=/usr/include \ + --infodir=/usr/share/info \ + --libdir=/usr/lib \ + --libexecdir=/usr/lib \ + --localstatedir=/var \ + --mandir=/usr/share/man \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + $(DISABLE_NLS) \ + --enable-small\ + --enable-256-colors\ + --disable-backtrace\ + --disable-data\ + --disable-formhist\ + --disable-leds \ + --disable-mailcap\ + --disable-mouse \ + --disable-smb \ + --disable-uri-rewrite\ + --disable-xbel \ + --without-bzlib \ + --without-gpm \ + --without-idn \ + --without-gnutls \ + --without-libiconv \ + --without-lua \ + --with-openssl="$(STAGING_DIR)/usr" \ + --without-spidermonkey\ + --without-x\ + --without-zlib \ + ); +endef + +define Package/elinks/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/elinks $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,elinks)) diff --git a/net/elinks/patches/002-fix_avr32_compile b/net/elinks/patches/002-fix_avr32_compile new file mode 100644 index 0000000..99a8874 --- /dev/null +++ b/net/elinks/patches/002-fix_avr32_compile @@ -0,0 +1,20 @@ +--- a/config/config.sub ++++ b/config/config.sub +@@ -239,7 +239,7 @@ case $basic_machine in + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ +- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ ++ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ +@@ -313,7 +313,7 @@ case $basic_machine in + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ +- | avr-* \ ++ | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ diff --git a/net/etherpuppet/Makefile b/net/etherpuppet/Makefile new file mode 100644 index 0000000..f85f9d2 --- /dev/null +++ b/net/etherpuppet/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2006-2011 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:=etherpuppet +PKG_REV:=90decf83d1d4 +PKG_VERSION:=0.3_r$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://hg.secdev.org/etherpuppet +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=hg + +include $(INCLUDE_DIR)/package.mk + +define Package/etherpuppet + SECTION:=net + CATEGORY:=Network + DEPENDS:=+kmod-tun + TITLE:=A voodoo doll for an Ethernet interface + URL:=http://www.secdev.org/projects/etherpuppet/ + SUBMENU:=VPN +endef + +define Package/etherpuppet/description + Etherpuppet is a small program for Linux that will create a virtual interface + (TUN/TAP) on one machine from the ethernet interface of another machine + through a TCP connection. +endef + +define Build/Configure +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) $(PKG_BUILD_DIR)/$(PKG_NAME).c -o $(PKG_BUILD_DIR)/$(PKG_NAME) +endef + +define Package/etherpuppet/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,etherpuppet)) diff --git a/net/etherwake/Makefile b/net/etherwake/Makefile new file mode 100644 index 0000000..d654390 --- /dev/null +++ b/net/etherwake/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2007-2011 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:=etherwake +PKG_VERSION:=1.09 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/e/etherwake +PKG_MD5SUM:=628e8b2a28d47f262e4c26c989402a59 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).orig + +include $(INCLUDE_DIR)/package.mk + +define Package/etherwake + SECTION:=net + CATEGORY:=Network + TITLE:=WoL client for magic packets via ethernet frames + URL:=http://ftp.debian.org/debian/pool/main/e/etherwake +endef + +define Package/etherwake/description + You can wake up WOL compliant Computers which have been powered down to + sleep mode or start WOL compliant Computers with a BIOS feature. + WOL is an abbreviation for Wake-on-LAN. It is a standard that allows you + to turn on a computer from another location over a network connection. + ether-wake also supports WOL passwords. +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) -D__UCLIBC__ $(PKG_BUILD_DIR)/ether-wake.c -o $(PKG_BUILD_DIR)/etherwake +endef + +define Package/etherwake/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/etherwake $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) +endef + +define Package/etherwake/conffiles +/etc/config/etherwake +endef + +$(eval $(call BuildPackage,etherwake)) diff --git a/net/etherwake/files/etherwake.config b/net/etherwake/files/etherwake.config new file mode 100644 index 0000000..3d8e515 --- /dev/null +++ b/net/etherwake/files/etherwake.config @@ -0,0 +1,28 @@ +config 'etherwake' 'setup' + # possible program pathes + option 'pathes' '/usr/bin/etherwake /usr/bin/ether-wake' + # use sudo, defaults to off + option 'sudo' 'off' + # interface, defaults to 'eth0' + # -i + option 'interface' '' + # send wake-up packet to the broadcast address, defaults to off + # -b + option 'broadcast' 'off' + +config 'target' + # name for the target + option 'name' 'example' + # mac address to wake up + option 'mac' '11:22:33:44:55:66' + # password in hex without any delimiters + option 'password' 'AABBCCDDEEFF' + # wake up on system start, defaults to off + option 'wakeonboot' 'off' + +# To add a new target use: +# uci add etherwake target +# uci set etherwake.@target[-1].name=example +# uci set etherwake.@target[-1].mac=11:22:33:44:55:66 +# uci set etherwake.@target[-1].password=AABBCCDDEEFF +# uci set etherwake.@target[-1].wakeonboot=off diff --git a/net/etherwake/files/etherwake.init b/net/etherwake/files/etherwake.init new file mode 100644 index 0000000..0504cf1 --- /dev/null +++ b/net/etherwake/files/etherwake.init @@ -0,0 +1,132 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009 OpenWrt.org + +NAME='etherwake' +START=60 +PROGRAM='' + +start() +{ + local searchlist='' + local section='' + local value='' + + config_load "${NAME}" + + # check for available program + config_get searchlist 'setup' 'pathes' + PROGRAM=$(search_program "${searchlist}") + [ -z "${PROGRAM}" ] && { + echo "${initscript}: No ${NAME} program installed. Check: opkg list | grep ${NAME}" + exit 1 + } + + # sudo + config_get_bool value 'setup' 'sudo' '0' + [ "${value}" -ne 0 ] && PROGRAM="sudo ${PROGRAM}" + + # interface + config_get value 'setup' 'interface' + [ -n "${value}" ] && append PROGRAM "-i ${value}" + + # broadcast + config_get_bool value 'setup' 'broadcast' '0' + [ "${value}" -ne 0 ] && append PROGRAM '-b' + + # wake up targets + config_foreach etherwake_start target $* +} + +etherwake_start() +{ + local section="$1" + shift + + local names="$*" + + local value='' + local target='' + + if [ -z "${names}" ] + then + # check if boot target + config_get_bool value "${section}" 'wakeonboot' '0' + [ "${value}" -eq 0 ] && return 0 + + # wake up target + do_etherwake "${section}" + return $? + else + # name + config_get value "${section}" 'name' + [ -z "${value}" ] && return 0 + + for target in ${names} + do + [ "${value}" != "${target}" ] && continue + + # wake up target + do_etherwake "${section}" + return $? + done + fi +} + +# execute etherwake command for target +do_etherwake() +{ + local section="$1" + local value='' + local password='' + local args='' + + # password + config_get value "${section}" 'password' + [ -n "${value}" ] && { + password=$(etherwake_password "${value}") + append args "-p ${password}" + } + + # mac address + config_get value "${section}" 'mac' + [ -z "${value}" ] && { echo "${initscript}: Target ${section} has no MAC address"; return 1; } + append args "${value}" + + # name + config_get value "${section}" 'name' + [ -z "${value}" ] && value="{section}" + + # execute command + echo "${initscript}: Waking up ${value} via ${PROGRAM}${args:+ ${args}}" + ${PROGRAM} ${args} + return $? +} + + +# find first available program from searchlist +search_program() +{ + local searchlist="$1" + local test='' + local program='' + + for test in ${searchlist} ; do + [ -x "${test}" ] && { + program="${test}" + break; + } + done + + [ -n "${program}" ] && echo "${program}" + + return +} + +# prepare hex password +etherwake_password() +{ + local delimiter=':' + local password=`echo "$1" | sed "s/../&${delimiter}/g"` + echo "${password%${delimiter}}" + return +} diff --git a/net/etherwake/patches/100-no_ether_hostton.patch b/net/etherwake/patches/100-no_ether_hostton.patch new file mode 100644 index 0000000..e33c06b --- /dev/null +++ b/net/etherwake/patches/100-no_ether_hostton.patch @@ -0,0 +1,37 @@ +--- etherwake-1.09.orig/ether-wake.c 2005-07-10 20:44:25.000000000 +0200 ++++ etherwake-1.09.orig.no_ether_hostton/ether-wake.c 2007-04-29 19:03:41.000000000 +0200 +@@ -15,7 +15,11 @@ + " an optional password appended.\n" + "\n" + " The single required parameter is the Ethernet MAC (station) address\n" ++#if !defined(__UCLIBC__) + " of the machine to wake or a host ID with known NSS 'ethers' entry.\n" ++#else ++" of the machine to wake.\n" ++#endif + " The MAC address may be found with the 'arp' program while the target\n" + " machine is awake.\n" + "\n" +@@ -289,16 +293,22 @@ + if (debug) + fprintf(stderr, "The target station address is %s.\n", + ether_ntoa(eaddr)); ++#if !defined(__UCLIBC__) + } else if (ether_hostton(hostid, eaddr) == 0) { + if (debug) + fprintf(stderr, "Station address for hostname %s is %s.\n", + hostid, ether_ntoa(eaddr)); ++#endif + } else { + (void)fprintf(stderr, + "ether-wake: The Magic Packet host address must be " + "specified as\n" ++#if !defined(__UCLIBC__) + " - a station address, 00:11:22:33:44:55, or\n" + " - a hostname with a known 'ethers' entry.\n"); ++#else ++ " - a station address, 00:11:22:33:44:55\n"); ++#endif + return -1; + } + return 0; diff --git a/net/ethtool/Makefile b/net/ethtool/Makefile new file mode 100644 index 0000000..8061197 --- /dev/null +++ b/net/ethtool/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2006-2012 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:=ethtool +PKG_VERSION:=3.4.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@KERNEL/software/network/ethtool +PKG_MD5SUM:=f1be2ba9d9d3fa1ba65ba634c529eef5 + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ethtool + SECTION:=net + CATEGORY:=Network + TITLE:=Display or change ethernet card settings + URL:=http://www.kernel.org/pub/software/network/ethtool/ +endef + +define Package/ethtool/description + ethtool is a small utility for examining and tuning your ethernet-based + network interface +endef + +define Package/ethtool/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ethtool $(1)/usr/sbin +endef + +$(eval $(call BuildPackage,ethtool)) diff --git a/net/ethtool/patches/100-ixp4xx.patch b/net/ethtool/patches/100-ixp4xx.patch new file mode 100644 index 0000000..806d782 --- /dev/null +++ b/net/ethtool/patches/100-ixp4xx.patch @@ -0,0 +1,203 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -9,7 +9,7 @@ ethtool_SOURCES = ethtool.c ethtool-copy + fec_8xx.c ibm_emac.c ixgb.c ixgbe.c natsemi.c \ + pcnet32.c realtek.c tg3.c marvell.c vioc.c \ + smsc911x.c at76c50x-usb.c sfc.c stmmac.c \ +- rxclass.c sfpid.c ++ rxclass.c sfpid.c ixp4xx.c + + TESTS = test-cmdline test-features + check_PROGRAMS = test-cmdline test-features +--- a/Makefile.in ++++ b/Makefile.in +@@ -60,7 +60,7 @@ am_ethtool_OBJECTS = ethtool.$(OBJEXT) a + realtek.$(OBJEXT) tg3.$(OBJEXT) marvell.$(OBJEXT) \ + vioc.$(OBJEXT) smsc911x.$(OBJEXT) at76c50x-usb.$(OBJEXT) \ + sfc.$(OBJEXT) stmmac.$(OBJEXT) rxclass.$(OBJEXT) \ +- sfpid.$(OBJEXT) ++ sfpid.$(OBJEXT) ixp4xx.$(OBJEXT) + ethtool_OBJECTS = $(am_ethtool_OBJECTS) + ethtool_LDADD = $(LDADD) + am__objects_1 = test_cmdline-ethtool.$(OBJEXT) \ +@@ -247,7 +247,7 @@ ethtool_SOURCES = ethtool.c ethtool-copy + fec_8xx.c ibm_emac.c ixgb.c ixgbe.c natsemi.c \ + pcnet32.c realtek.c tg3.c marvell.c vioc.c \ + smsc911x.c at76c50x-usb.c sfc.c stmmac.c \ +- rxclass.c sfpid.c ++ rxclass.c sfpid.c ixp4xx.c + + test_cmdline_SOURCES = test-cmdline.c test-common.c $(ethtool_SOURCES) + test_cmdline_CFLAGS = -DTEST_ETHTOOL +@@ -389,6 +389,7 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfpid.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smsc911x.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stmmac.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ixp4xx.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_cmdline-amd8111e.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_cmdline-at76c50x-usb.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_cmdline-de2104x.Po@am__quote@ +--- a/ethtool.c ++++ b/ethtool.c +@@ -826,7 +826,7 @@ static const struct { + { "e1000e", e1000_dump_regs }, + { "igb", igb_dump_regs }, + { "ixgb", ixgb_dump_regs }, +- { "ixgbe", ixgbe_dump_regs }, ++ { "ixp4xx", ixp4xx_dump_regs }, + { "natsemi", natsemi_dump_regs }, + { "e100", e100_dump_regs }, + { "amd8111e", amd8111e_dump_regs }, +@@ -842,6 +842,7 @@ static const struct { + { "sfc", sfc_dump_regs }, + { "st_mac100", st_mac100_dump_regs }, + { "st_gmac", st_gmac_dump_regs }, ++ { "ixgbe", ixgbe_dump_regs }, + }; + + void dump_hex(FILE *file, const u8 *data, int len, int offset) +--- a/internal.h ++++ b/internal.h +@@ -238,6 +238,9 @@ int st_mac100_dump_regs(struct ethtool_d + struct ethtool_regs *regs); + int st_gmac_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs); + ++/* Intel IXP4xx internal MAC */ ++int ixp4xx_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs); ++ + /* Rx flow classification */ + int rxclass_parse_ruleopts(struct cmd_context *ctx, + struct ethtool_rx_flow_spec *fsp); +--- /dev/null ++++ b/ixp4xx.c +@@ -0,0 +1,130 @@ ++/* ++ * Copyright (c) 2006 Christian Hohnstaed ++ * This file is released under the GPLv2 ++ */ ++ ++#include ++#include "internal.h" ++ ++#ifndef BIT ++#define BIT(x) (1<data; ++ ++ fprintf(stdout, ++ "TXctrl: 0x%02x:0x%02x\n" ++ " Enable: %s\n" ++ " Duplex: %s\n" ++ " Retry: %s (%d)\n" ++ " Padding: %s\n" ++ " Frame check: %s\n" ++ " TX deferral: %s\n" ++ " Connection: %s\n" ++ "\n", ++ data[0], data[1], ++ data[0] & TX_CNTRL1_TX_EN ? "yes" : "no", ++ data[0] & TX_CNTRL1_DUPLEX ? "half" : "full", ++ data[0] & TX_CNTRL1_RETRY ? "enabled" : "disabled", ++ data[1] & TX_CNTRL2_RETRIES_MASK, ++ data[0] & TX_CNTRL1_PAD_EN ? "enabled" : "disabled", ++ data[0] & TX_CNTRL1_FCS_EN ? "enabled" : "disabled", ++ data[0] & TX_CNTRL1_2DEFER ? "two-part" : "one-part", ++ data[0] & TX_CNTRL1_RMII ? "RMII" : "Full MII" ++ ); ++ ++ fprintf(stdout, ++ "RXctrl: 0x%02x\n" ++ " Enable: %s\n" ++ " Pad strip: %s\n" ++ " CRC check: %s\n" ++ " Pause: %s\n" ++ " Loop: %s\n" ++ " Promiscous: %s\n" ++ " Runt frames: %s\n" ++ " Broadcast: %s\n" ++ "\n", ++ data[2], ++ data[2] & RX_CNTRL1_RX_EN ? "yes" : "no", ++ data[2] & RX_CNTRL1_PADSTRIP_EN ? "enabled" : "disabled", ++ data[2] & RX_CNTRL1_CRC_EN ? "enabled" : "disabled", ++ data[2] & RX_CNTRL1_PAUSE_EN ? "enabled" : "disabled", ++ data[2] & RX_CNTRL1_LOOP_EN ? "enabled" : "disabled", ++ data[2] & RX_CNTRL1_ADDR_FLTR_EN ? "disabled" : "enabled", ++ data[2] & RX_CNTRL1_RX_RUNT_EN ? "forward" : "discard", ++ data[2] & RX_CNTRL1_BCAST_DIS ? "disabled" : "enabled" ++ ); ++ fprintf(stdout, ++ "Core control: 0x%02x\n" ++ " Core state: %s\n" ++ " RX fifo: %s\n" ++ " TX fifo: %s\n" ++ " Send jam: %s\n" ++ " MDC clock %s\n" ++ "\n", ++ data[32], ++ data[32] & CORE_RESET ? "reset" : "normal operation", ++ data[32] & CORE_RX_FIFO_FLUSH ? "flush" : "ok", ++ data[32] & CORE_TX_FIFO_FLUSH ? "flush" : "ok", ++ data[32] & CORE_SEND_JAM ? "yes" : "no", ++ data[32] & CORE_MDC_EN ? "output" : "input" ++ ); ++ fprintf(stdout, ++ "MAC addresses: \n" ++ " Multicast mask: " MAC "\n" ++ " Multicast address: " MAC "\n" ++ " Unicast address: " MAC "\n" ++ "\n", ++ MAC_DATA(data+13), MAC_DATA(data+19), MAC_DATA(data+26) ++ ); ++ fprintf(stdout, ++ "Random seed: 0x%02x\n" ++ "Threshold empty: %3d\n" ++ "Threshold full: %3d\n" ++ "TX buffer size: %3d\n" ++ "TX deferral: %3d\n" ++ "RX deferral: %3d\n" ++ "TX two deferral 1: %3d\n" ++ "TX two deferral 2: %3d\n" ++ "Slot time: %3d\n" ++ "Internal clock: %3d\n" ++ "\n", ++ data[4], data[5], data[6], data[7], data[8], data[9], ++ data[10], data[11], data[12], data[25] ++ ); ++ ++ return 0; ++} diff --git a/net/ettercap/Makefile b/net/ettercap/Makefile new file mode 100644 index 0000000..9b21045 --- /dev/null +++ b/net/ettercap/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ettercap +PKG_VERSION:=NG-0.7.3 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/ettercap +PKG_MD5SUM:=28fb15cd024162c55249888fe1b97820 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/ettercap + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +libnet1 +libopenssl +libpcre +libncurses +libltdl +libpthread +zlib + TITLE:=Ettercap is a suite for man in the middle attacks on LAN. + URL:=http://ettercap.sourceforge.net +endef + +define Package/ettercap/description + It features sniffing of live connections, content filtering on the fly + and many other interesting tricks. + It supports active and passive dissection of many protocols (even + ciphered ones) and includes many feature for network and host analysis. +endef + +define Package/ettercap/conffiles +/etc/etter.conf +endef + +define Build/Prepare + $(call Build/Prepare/Default) + # remove default optimization flags set by configure + $(SED) 's,DEBUG_FLAGS=.*,DEBUG_FLAGS=,g' $(PKG_BUILD_DIR)/configure +endef + +CONFIGURE_ARGS += \ + --with-libpcap="$(STAGING_DIR)/usr" \ + --with-libnet="$(STAGING_DIR)/usr/lib/libnet-1.1.x" \ + --with-openssl="$(STAGING_DIR)/usr" \ + --with-libpcre="$(STAGING_DIR)/usr" \ + --with-iconv="$(ICONV_PREFIX)" \ + --with-libncurses="$(STAGING_DIR)/usr" \ + --disable-gtk \ + --disable-debug \ + --enable-plugins + +MAKE_FLAGS += \ + DESTDIR="$(PKG_INSTALL_DIR)" + +define Package/ettercap/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/etter.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/etter{cap,filter,log} $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/ettercap + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ettercap/*.so $(1)/usr/lib/ettercap/ + $(INSTALL_DIR) $(1)/usr/share/ettercap + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ettercap/* $(1)/usr/share/ettercap/ +endef + +$(eval $(call BuildPackage,ettercap)) diff --git a/net/ettercap/patches/001-cross_compiling.patch b/net/ettercap/patches/001-cross_compiling.patch new file mode 100644 index 0000000..8c95397 --- /dev/null +++ b/net/ettercap/patches/001-cross_compiling.patch @@ -0,0 +1,23 @@ +diff -urN ettercap-NG-0.7.3/configure ettercap-NG-0.7.3.new/configure +--- ettercap-NG-0.7.3/configure 2005-05-27 17:11:45.000000000 +0200 ++++ ettercap-NG-0.7.3.new/configure 2006-08-21 20:15:07.000000000 +0200 +@@ -27354,6 +27354,7 @@ + + echo "$as_me:$LINENO: checking for NS_GET32" >&5 + echo $ECHO_N "checking for NS_GET32... $ECHO_C" >&6 ++cross_compiling=no + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + See \`config.log' for more details." >&5 +diff -urN ettercap-NG-0.7.3/configure.in ettercap-NG-0.7.3.new/configure.in +--- ettercap-NG-0.7.3/configure.in 2005-01-13 10:24:28.000000000 +0100 ++++ ettercap-NG-0.7.3.new/configure.in 2006-08-21 20:13:29.000000000 +0200 +@@ -236,7 +236,7 @@ + AC_CHECK_HEADERS(sys/poll.h poll.h sys/select.h) + AC_CHECK_HEADERS(sys/cdefs.h) + dnl nameser NS_GET32 and so on... +-EC_NS_GET() ++#EC_NS_GET() + + dnl ================================================================== + dnl Checks for typedefs, structures, and compiler characteristics. diff --git a/net/ettercap/patches/002-libnet_check_honor_ldflags.patch b/net/ettercap/patches/002-libnet_check_honor_ldflags.patch new file mode 100644 index 0000000..55b00a7 --- /dev/null +++ b/net/ettercap/patches/002-libnet_check_honor_ldflags.patch @@ -0,0 +1,24 @@ +diff -ruN ettercap-NG-0.7.3-old/configure ettercap-NG-0.7.3-new/configure +--- ettercap-NG-0.7.3-old/configure 2006-10-03 18:24:09.000000000 +0200 ++++ ettercap-NG-0.7.3-new/configure 2006-10-03 18:28:57.000000000 +0200 +@@ -31759,7 +31759,7 @@ + + OLDLDFLAGS="${LDFLAGS}" + OLDLIBS="${LIBS}" +- LDFLAGS="$LNETLIB" ++ LDFLAGS="$LDFLAGS $LNETLIB" + LIBS="$LIBS" + + echo "$as_me:$LINENO: checking for libnet_adv_free_packet in -lnet" >&5 +diff -ruN ettercap-NG-0.7.3-old/configure.in ettercap-NG-0.7.3-new/configure.in +--- ettercap-NG-0.7.3-old/configure.in 2006-10-03 18:24:09.000000000 +0200 ++++ ettercap-NG-0.7.3-new/configure.in 2006-10-03 18:26:45.000000000 +0200 +@@ -500,7 +500,7 @@ + ] + ) + +-EC_CHECK_FUNC(net, libnet_adv_free_packet, $LNETLIB, $LIBS,, AC_MSG_ERROR([Incorrect libnet version. libnet >= 1.1.2.1 required])) ++EC_CHECK_FUNC(net, libnet_adv_free_packet, $LDFLAGS $LNETLIB, $LIBS,, AC_MSG_ERROR([Incorrect libnet version. libnet >= 1.1.2.1 required])) + + dnl ------------------ + dnl Checks for openssl diff --git a/net/ettercap/patches/003-automake-compat.patch b/net/ettercap/patches/003-automake-compat.patch new file mode 100644 index 0000000..eea45f2 --- /dev/null +++ b/net/ettercap/patches/003-automake-compat.patch @@ -0,0 +1,34 @@ +--- a/configure.in ++++ b/configure.in +@@ -197,6 +197,9 @@ dnl ======================== + dnl Libtool related... + dnl ======================== + ++LT_INIT ++LTDL_INIT ++LT_CONFIG_LTDL_DIR([libltdl]) + AC_DISABLE_STATIC + AC_LIBTOOL_WIN32_DLL + AC_LIBTOOL_DLOPEN +--- a/include/ec_os_mingw.h ++++ b/include/ec_os_mingw.h +@@ -163,7 +163,7 @@ EC_API_EXTERN const char *ec_win_get_ec_ + */ + #if !defined(HAVE_DLOPEN) + #define RTLD_NOW 0 +- #define LTDL_SHLIB_EXT "*.dll" ++ #define LT_MODULE_EXT ".dll" + + #define dlopen(dll,flg) ec_win_dlopen (dll, flg) + #define lt_dlopen(dll) ec_win_dlopen (dll, 0) +--- a/src/ec_plugins.c ++++ b/src/ec_plugins.c +@@ -131,7 +131,7 @@ int plugin_filter(struct dirent *d) + int plugin_filter(const struct dirent *d) + #endif + { +- if ( match_pattern(d->d_name, PLUGIN_PATTERN LTDL_SHLIB_EXT) ) ++ if ( match_pattern(d->d_name, PLUGIN_PATTERN LT_MODULE_EXT) ) + return 1; + + return 0; diff --git a/net/ez-ipupdate/Makefile b/net/ez-ipupdate/Makefile new file mode 100644 index 0000000..5a5b890 --- /dev/null +++ b/net/ez-ipupdate/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2006-2012 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:=ez-ipupdate +PKG_VERSION:=3.0.11b8 +PKG_RELEASE:=7 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/e/ez-ipupdate \ + http://ftp.de.debian.org/debian/pool/main/e/ez-ipupdate +PKG_MD5SUM:=000211add4c4845ffa4211841bff4fb0 + +include $(INCLUDE_DIR)/package.mk + +define Package/ez-ipupdate + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=Dynamic DNS services client + URL:=http://ez-ipupdate.com/ +endef + +# uses GNU configure + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +define Package/ez-ipupdate/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ez-ipupdate $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/config/ + $(INSTALL_CONF) ./files/ez-ipupdate.config $(1)/etc/config/ddns + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_BIN) ./files/ez-ipupdate.hotplug $(1)/etc/hotplug.d/iface/30-ez-ipupdate +endef + +define Package/ez-ipupdate/conffiles +/etc/config/ddns +endef + +$(eval $(call BuildPackage,ez-ipupdate)) diff --git a/net/ez-ipupdate/files/ez-ipupdate.config b/net/ez-ipupdate/files/ez-ipupdate.config new file mode 100644 index 0000000..bc9ee6f --- /dev/null +++ b/net/ez-ipupdate/files/ez-ipupdate.config @@ -0,0 +1,14 @@ + +config ddns + option enabled 0 + option interface wan + option program ez-ipupdate + option service zoneedit + option username myname + option password mypassword + option hostname mydomain.com + +# config ddns +# option interface wan +# option program ez-ipupdate +# option config /etc/ez-ipupdate.conf diff --git a/net/ez-ipupdate/files/ez-ipupdate.hotplug b/net/ez-ipupdate/files/ez-ipupdate.hotplug new file mode 100644 index 0000000..3359c6a --- /dev/null +++ b/net/ez-ipupdate/files/ez-ipupdate.hotplug @@ -0,0 +1,81 @@ +NAME=ez-ipupdate +COMMAND=/usr/sbin/$NAME + +case "$ACTION" in + ifup|ifdown) + cleanup() { + [ -e $1 ] && { + kill -9 $(cat $1) + rm $1 + } + } + + ddns() { + local cfg="$1" + config_get program $cfg program + [ "$program" = "$NAME" ] && { + config_get interface $cfg interface + [ "$interface" = "$INTERFACE" ] && { + network_get_device dev "$INTERFACE" || return + + config_get enabled $cfg enabled + enabled=${enabled:-1} + + config_get service $cfg service + + config_get pidfile $cfg pidfile + pidfile=${pidfile:-/var/run/$NAME-$service-$dev.pid} + + case "$ACTION" in + ifdown) + cleanup $pidfile + ;; + *) + case "$enabled" in + 1|yes|true) + [ ! -e $pidfile ] && { + config_get cache $cfg cache + [ -z "$cache" ] && cache=/tmp/$NAME-$service-$dev.cache + + config_get config $cfg config + [ -z "$config" ] && { + config=/var/run/$NAME-$service-$dev.conf + config_get username $cfg username + config_get password $cfg password + config_get hostname $cfg hostname + service=${service:-"dyndns"} + config_get server $cfg server + server_line="" + [ -n "$server" ] && { + server_line="server=$server" + } + cat > $config <&1 | logger -t $NAME & + } + ;; + *) + cleanup $pidfile + ;; + esac + esac + } + } + } + + . /lib/functions/network.sh + + config_load ddns + config_foreach ddns ddns + ;; +esac diff --git a/net/ez-ipupdate/files/ez-ipupdate.init b/net/ez-ipupdate/files/ez-ipupdate.init new file mode 100644 index 0000000..0cea301 --- /dev/null +++ b/net/ez-ipupdate/files/ez-ipupdate.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 + +BIN=ez-ipupdate +CONF=/etc/$BIN.conf +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid + +start() { + [ -f $CONF ] || exit + mkdir -p $RUN_D + $BIN -c $CONF +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) +} diff --git a/net/ez-ipupdate/patches/001-debian_subset.patch b/net/ez-ipupdate/patches/001-debian_subset.patch new file mode 100644 index 0000000..c24b3ea --- /dev/null +++ b/net/ez-ipupdate/patches/001-debian_subset.patch @@ -0,0 +1,568 @@ +--- ez-ipupdate-3.0.11b8.orig/ez-ipupdate.c ++++ ez-ipupdate-3.0.11b8/ez-ipupdate.c +@@ -139,6 +139,9 @@ + #if HAVE_SIGNAL_H + # include + #endif ++#if HAVE_TIME_H ++# include ++#endif + #if HAVE_SYS_TIME_H + # include + #endif +@@ -165,7 +168,7 @@ + #endif + + +-#if __linux__ || __SVR4 || __OpenBSD__ || __FreeBSD__ || __NetBSD__ ++#if __GLIBC__ || __SVR4 || __OpenBSD__ || __FreeBSD__ || __NetBSD__ + # define IF_LOOKUP 1 + # include + # include +@@ -640,7 +643,7 @@ + fprintf(stdout, " -q, --quiet \t\t\tbe quiet\n"); + fprintf(stdout, " -r, --retrys \t\tnumber of trys (default: 1)\n"); + fprintf(stdout, " -R, --run-as-user \tchange to for running, be ware\n\t\t\t\tthat this can cause problems with handeling\n\t\t\t\tSIGHUP properly if that user can't read the\n\t\t\t\tconfig file. also it can't write it's pid file \n\t\t\t\tto a root directory\n"); +- fprintf(stdout, " -Q, --run-as-euser \tchange to effective for running, \n\t\t\t\tthis is NOT secure but it does solve the \n\t\t\t\tproblems with run-as-user and config files and \n\t\t\t\tpid files.\n"); ++ fprintf(stdout, " -Q, --run-as-euser \tchange to effective for running, \n\t\t\t\tthis is NOT secure but it does solve the \n\t\t\t\tproblems with run-as-user and config files and \n\t\t\t\tpid files\n"); + fprintf(stdout, " -s, --server \tthe server to connect to\n"); + fprintf(stdout, " -S, --service-type \tthe type of service that you are using\n"); + width = fprintf(stdout, "\t\t\t\ttry one of: ") + 4*7; +@@ -682,7 +685,7 @@ + + void print_signalhelp( void ) + { +- fprintf(stdout, "\nsignals are only really used when in daemon mode.\n\n"); ++ fprintf(stdout, "\nsignals are only really used when in daemon mode\n\n"); + fprintf(stdout, "signals: \n"); + fprintf(stdout, " HUP\t\tcauses it to re-read its config file\n"); + fprintf(stdout, " TERM\t\twake up and possibly perform an update\n"); +@@ -693,7 +696,7 @@ + #if HAVE_SIGNAL_H + RETSIGTYPE sigint_handler(int sig) + { +- char message[] = "interupted.\n"; ++ char message[] = "interrupted\n"; + close(client_sockfd); + write(2, message, sizeof(message)-1); + +@@ -704,6 +707,10 @@ + } + #endif + ++#if HAVE_SYSLOG_H ++ closelog(); ++#endif ++ + exit(1); + } + RETSIGTYPE generic_sig_handler(int sig) +@@ -798,7 +805,7 @@ + sprintf(buf, "message incomplete because your OS sucks: %s\n", fmt); + #endif + +- syslog(LOG_NOTICE, buf); ++ syslog(LOG_NOTICE, "%s", buf); + } + else + { +@@ -1439,7 +1446,7 @@ + if(!(options & OPT_QUIET)) + { + fprintf(stderr, +- "connected to %s (%s) on port %d.\n", ++ "connected to %s (%s) on port %d\n", + host, + inet_ntoa(address.sin_addr), + ntohs(address.sin_port)); +@@ -1683,7 +1690,7 @@ + close(client_sockfd); + return(-1); + } +- if(strstr(buf, "\r\n") > 0) ++ if(strstr(buf, "\n") != NULL) + { + break; + } +@@ -1702,8 +1709,8 @@ + + if(options & OPT_DAEMON) + { +- fprintf(stderr, "no compile time default service was set therefor you must " +- "specify a service type.\n"); ++ fprintf(stderr, "no compile time default service was set, you must " ++ "specify a service type\n"); + + return(-1); + } +@@ -2039,7 +2046,7 @@ + } + else if(strstr(buf, "\nnumhost") != NULL) + { +- show_message("Too many or too few hosts found\n"); ++ show_message("too many or too few hosts found\n"); + retval = UPDATERES_SHUTDOWN; + } + else if(strstr(buf, "\ndnserr") != NULL) +@@ -2051,17 +2058,17 @@ + } + else if(strstr(buf, "\n911") != NULL) + { +- show_message("Ahhhh! call 911!\n"); ++ show_message("ahhhh! call 911!\n"); + retval = UPDATERES_SHUTDOWN; + } + else if(strstr(buf, "\n999") != NULL) + { +- show_message("Ahhhh! call 999!\n"); ++ show_message("ahhhh! call 999!\n"); + retval = UPDATERES_SHUTDOWN; + } + else if(strstr(buf, "\n!donator") != NULL) + { +- show_message("a feature requested is only available to donators, please donate.\n", host); ++ show_message("a feature requested is only available to donators, please donate\n", host); + retval = UPDATERES_OK; + } + // this one should be last as it is a stupid string to signify waits +@@ -2095,9 +2102,9 @@ + sprintf(reason, "problem parsing reason for wait response"); + } + +- show_message("Wait response received, waiting for %s before next update.\n", ++ show_message("wait response received, waiting for %s before next update\n", + format_time(howlong)); +- show_message("Wait response reason: %d\n", N_STR(reason)); ++ show_message("wait response reason: %d\n", N_STR(reason)); + sleep(howlong); + retval = UPDATERES_ERROR; + } +@@ -3370,7 +3377,7 @@ + { + if(!(options & OPT_QUIET)) + { +- fprintf(stderr, "warning: for GNUDIP the \"address\" parpameter is only used if set to \"0.0.0.0\" thus making an offline request.\n"); ++ fprintf(stderr, "warning: for GNUDIP the \"address\" parameter is only used if set to \"0.0.0.0\" thus making an offline request\n"); + } + } + +@@ -3392,7 +3399,7 @@ + + // send an offline request if address 0.0.0.0 is used + // otherwise, we ignore the address and send an update request +- gnudip_request[0] = strcmp(address, "0.0.0.0") == 0 ? '1' : '0'; ++ gnudip_request[0] = address && strcmp(address, "0.0.0.0") == 0 ? '1' : '0'; + gnudip_request[1] = '\0'; + + // find domainname +@@ -3943,22 +3950,22 @@ + break; + + case 201: +- show_message("Last update was less than %d seconds ago.\n", 300); ++ show_message("last update was less than %d seconds ago\n", 300); + return(UPDATERES_ERROR); + break; + + case 202: +- show_message("Server error.\n"); ++ show_message("server error\n"); + return(UPDATERES_ERROR); + break; + + case 203: +- show_message("Failure because account is frozen (by admin).\n"); ++ show_message("failure because account is frozen (by admin)\n"); + return(UPDATERES_SHUTDOWN); + break; + + case 204: +- show_message("Failure because account is locked (by user).\n"); ++ show_message("failure because account is locked (by user)\n"); + return(UPDATERES_SHUTDOWN); + break; + +@@ -4215,8 +4222,6 @@ + + switch(ret) + { +- char *p; +- + case -1: + if(!(options & OPT_QUIET)) + { +@@ -4349,7 +4354,7 @@ + case SIGHUP: + if(config_file) + { +- show_message("SIGHUP recieved, re-reading config file\n"); ++ show_message("SIGHUP received, re-reading config file\n"); + if(parse_conf_file(config_file, conf_commands) != 0) + { + show_message("error parsing config file \"%s\"\n", config_file); +@@ -4384,6 +4389,7 @@ + + int main(int argc, char **argv) + { ++ char *tmp; + int ifresolve_warned = 0; + int i; + int retval = 1; +@@ -4395,9 +4401,10 @@ + mcheck(NULL); + #endif + +- dprintf((stderr, "staring...\n")); ++ dprintf((stderr, "starting...\n")); + +- program_name = argv[0]; ++ tmp = strrchr(argv[0], '/'); ++ program_name = tmp ? tmp + 1 : argv[0]; + options = 0; + *user = '\0'; + timeout.tv_sec = DEFAULT_TIMEOUT; +@@ -4417,7 +4424,7 @@ + + if(!(options & OPT_QUIET) && !(options & OPT_DAEMON)) + { +- fprintf(stderr, "ez-ipupdate Version %s\nCopyright (C) 1998-2001 Angus Mackay.\n", VERSION); ++ fprintf(stderr, "%s Version %s\nCopyright (C) 1998-2001 Angus Mackay\n", program_name, VERSION); + } + + dprintf((stderr, "options: 0x%04X\n", options)); +@@ -4434,7 +4441,7 @@ + { + if(service->check_info() != 0) + { +- fprintf(stderr, "invalid data to perform requested action.\n"); ++ fprintf(stderr, "invalid data to perform requested action\n"); + exit(1); + } + } +@@ -4456,13 +4463,13 @@ + dprintf((stderr, "user_name: %s\n", user_name)); + dprintf((stderr, "password: %s\n", password)); + } +- if(*user_name == '\0') ++ if(*user_name == '\0' && !(options & OPT_DAEMON)) + { + printf("user name: "); + fgets(user_name, sizeof(user_name), stdin); + chomp(user_name); + } +- if(*password == '\0') ++ if(*password == '\0' && !(options & OPT_DAEMON)) + { + strncpy(password, getpass("password: "), sizeof(password)); + } +@@ -4480,7 +4487,7 @@ + + if(service->check_info() != 0) + { +- fprintf(stderr, "invalid data to perform requested action.\n"); ++ fprintf(stderr, "invalid data to perform requested action\n"); + exit(1); + } + +@@ -4503,7 +4510,7 @@ + + if(interface == NULL) + { +- fprintf(stderr, "invalid data to perform requested action.\n"); ++ fprintf(stderr, "invalid data to perform requested action\n"); + fprintf(stderr, "you must provide an interface for daemon mode"); + exit(1); + } +@@ -4519,23 +4526,25 @@ + if(fork() > 0) { exit(0); } /* parent */ + } + ++# if HAVE_SYSLOG_H ++ openlog(program_name, LOG_PID, LOG_DAEMON ); ++ //options |= OPT_QUIET; ++# endif ++ show_message("version %s, interface %s, host %s, server %s, service %s\n", ++ VERSION, N_STR(interface), N_STR(host), server, service->title); ++ + #if HAVE_GETPID + if(pid_file && pid_file_create(pid_file) != 0) + { +- fprintf(stderr, "exiting...\n"); ++ show_message("could not create pid file %s (%s), exiting\n", ++ pid_file, strerror(errno)); ++#if HAVE_SYSLOG_H ++ closelog(); ++#endif + exit(1); + } + #endif + +-# if HAVE_SYSLOG_H +- openlog(program_name, LOG_PID, LOG_USER ); +- options |= OPT_QUIET; +-# endif +- show_message("ez-ipupdate Version %s, Copyright (C) 1998-2001 Angus Mackay.\n", +- VERSION); +- show_message("%s started for interface %s host %s using server %s and service %s\n", +- program_name, N_STR(interface), N_STR(host), server, service->title); +- + memset(&sin, 0, sizeof(sin)); + + if(cache_file) +@@ -4560,7 +4569,7 @@ + strftime(timebuf, sizeof(timebuf), "%Y/%m/%d %H:%M", ts); + show_message("got last update %s on %s from cache file\n", ipstr, timebuf); + } +- else ++ else if(ipstr||ipdate) + { + show_message("malformed cache file: %s\n", cache_file); + } +@@ -4647,7 +4656,7 @@ + } + else + { +- show_message("failure to update %s->%s (%s)\n", ++ show_message("failed to update %s->%s (%s)\n", + interface, inet_ntoa(sin.sin_addr), N_STR(host)); + memset(&sin, 0, sizeof(sin)); + +@@ -4671,7 +4680,7 @@ + dprintf((stderr, "updateres: %d\n", updateres)); + if(updateres == UPDATERES_SHUTDOWN) + { +- show_message("shuting down updater for %s due to fatal error\n", ++ show_message("shutting down updater for %s due to fatal error\n", + N_STR(host)); + + if(notify_email && *notify_email != '\0') +@@ -4711,7 +4720,7 @@ + #endif + + #else +- fprintf(stderr, "sorry, this mode is only available on platforms that the "); ++ fprintf(stderr, "sorry, this mode is only available on platforms where the "); + fprintf(stderr, "IP address \ncan be determined. feel free to hack the code"); + fprintf(stderr, " though.\n"); + exit(1); +@@ -4799,7 +4808,7 @@ + } + else + { +- show_message("could not resolve ip address for %s.\n", interface); ++ show_message("could not resolve ip address for %s\n", interface); + exit(1); + } + close(sock); +--- ez-ipupdate-3.0.11b8.orig/example.conf ++++ ez-ipupdate-3.0.11b8/example.conf +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/ez-ipupdate -c ++#!/usr/sbin/ez-ipupdate -c + # + # example config file for ez-ipupdate + # +--- ez-ipupdate-3.0.11b8.orig/example-pgpow.conf ++++ ez-ipupdate-3.0.11b8/example-pgpow.conf +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/ez-ipupdate -c ++#!/usr/sbin/ez-ipupdate -c + # + # example config file for ez-ipupdate + # +@@ -10,8 +10,8 @@ + host=mydomain.penguinpowered.com + interface=eth1 + +-# if you use run-as ensure the user has permission to write this file +-cache-file=/tmp/ez-ipupdate.cache ++run-as-user=ez-ipupd ++cache-file=/var/cache/ez-ipupdate/default-cache + + # uncomment this once you have everything working how you want and you are + # ready to have ez-ipupdate running in the background all the time. to stop it +--- ez-ipupdate-3.0.11b8.orig/example-dhs.conf ++++ ez-ipupdate-3.0.11b8/example-dhs.conf +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/ez-ipupdate -c ++#!/usr/sbin/ez-ipupdate -c + # + # example config file for ez-ipupdate + # +@@ -10,8 +10,8 @@ + host=mydomain.whatever.com + interface=eth1 + +-# if you use run-as ensure the user has permission to write this file +-cache-file=/tmp/ez-ipupdate.cache ++run-as-user=ez-ipupd ++cache-file=/var/cache/ez-ipupdate/default-cache + + # uncomment this once you have everything working how you want and you are + # ready to have ez-ipupdate running in the background all the time. to stop it +--- ez-ipupdate-3.0.11b8.orig/example-dyndns.conf ++++ ez-ipupdate-3.0.11b8/example-dyndns.conf +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/ez-ipupdate -c ++#!/usr/sbin/ez-ipupdate -c + # + # example config file for ez-ipupdate + # +@@ -12,14 +12,9 @@ + interface=eth1 + max-interval=2073600 + +-# please create this file and ensure that the user that ez-ipupdate is running +-# as has write permissions to it then uncomment this line, if you don't your +-# dyndns account will probably get banned. if you run ez-ipupdate as root (bad +-# idea, use "run-as-user") then you can just uncomment this line. +-#cache-file=/etc/ez-ipupdate.cache.eth1 +- +-# for the mean time we'll just use a cache file in the temp directory +-cache-file=/tmp/ez-ipupdate.cache ++# if you don't use a cache file your dyndns account will probably get banned. ++run-as-user=ez-ipupd ++cache-file=/var/cache/ez-ipupdate/default-cache + + # uncomment this once you have everything working how you want and you are + # ready to have ez-ipupdate running in the background all the time. to stop it +--- ez-ipupdate-3.0.11b8.orig/example-ods.conf ++++ ez-ipupdate-3.0.11b8/example-ods.conf +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/ez-ipupdate -c ++#!/usr/sbin/ez-ipupdate -c + # + # example config file for ez-ipupdate + # +@@ -10,8 +10,8 @@ + host=mydomain.ods.org + interface=eth1 + +-# if you use run-as ensure the user has permission to write this file +-cache-file=/tmp/ez-ipupdate.cache ++run-as-user=ez-ipupd ++cache-file=/var/cache/ez-ipupdate/default-cache + + # uncomment this once you have everything working how you want and you are + # ready to have ez-ipupdate running in the background all the time. to stop it +--- ez-ipupdate-3.0.11b8.orig/example-tzo.conf ++++ ez-ipupdate-3.0.11b8/example-tzo.conf +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/ez-ipupdate -c ++#!/usr/sbin/ez-ipupdate -c + # + # example config file for ez-ipupdate + # +@@ -14,8 +14,8 @@ + max-interval=2073600 + interface=eth1 + +-# if you use run-as ensure the user has permission to write this file +-cache-file=/tmp/ez-ipupdate.cache ++run-as-user=ez-ipupd ++cache-file=/var/cache/ez-ipupdate/default-cache + + # uncomment this once you have everything working how you want and you are + # ready to have ez-ipupdate running in the background all the time. to stop it +--- ez-ipupdate-3.0.11b8.orig/example-gnudip.conf ++++ ez-ipupdate-3.0.11b8/example-gnudip.conf +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/ez-ipupdate -c ++#!/usr/sbin/ez-ipupdate -c + # + # example config file for ez-ipupdate + # +@@ -14,8 +14,8 @@ + # any other value is ignored + #address=0.0.0.0 + +-# if you use run-as ensure the user has permission to write this file +-cache-file=/tmp/ez-ipupdate.cache ++run-as-user=ez-ipupd ++cache-file=/var/cache/ez-ipupdate/default-cache + + # uncomment this once you have everything working how you want and you are + # ready to have ez-ipupdate running in the background all the time. to stop it +--- ez-ipupdate-3.0.11b8.orig/example-easydns.conf ++++ ez-ipupdate-3.0.11b8/example-easydns.conf +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/ez-ipupdate -c ++#!/usr/sbin/ez-ipupdate -c + # + # example config file for ez-ipupdate + # +@@ -10,8 +10,8 @@ + host=mydomain.whatever.com + interface=eth1 + +-# if you use run-as ensure the user has permission to write this file +-cache-file=/tmp/ez-ipupdate.cache ++run-as-user=ez-ipupd ++cache-file=/var/cache/ez-ipupdate/default-cache + + # uncomment this once you have everything working how you want and you are + # ready to have ez-ipupdate running in the background all the time. to stop it +--- ez-ipupdate-3.0.11b8.orig/example-justlinux.conf ++++ ez-ipupdate-3.0.11b8/example-justlinux.conf +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/ez-ipupdate -c ++#!/usr/sbin/ez-ipupdate -c + # + # example config file for ez-ipupdate + # +@@ -10,8 +10,8 @@ + host=mydomain.penguinpowered.com + interface=eth1 + +-# if you use run-as ensure the user has permission to write this file +-cache-file=/tmp/ez-ipupdate.cache ++run-as-user=ez-ipupd ++cache-file=/var/cache/ez-ipupdate/default-cache + + # uncomment this once you have everything working how you want and you are + # ready to have ez-ipupdate running in the background all the time. to stop it +--- ez-ipupdate-3.0.11b8.orig/example-dyns.conf ++++ ez-ipupdate-3.0.11b8/example-dyns.conf +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/ez-ipupdate -c ++#!/usr/sbin/ez-ipupdate -c + # + # example config file for ez-ipupdate + # +@@ -10,8 +10,8 @@ + host=myhost + #interface=eth1 + +-# if you use run-as ensure the user has permission to write this file +-#cache-file=/tmp/ez-ipupdate.cache ++run-as-user=ez-ipupd ++cache-file=/var/cache/ez-ipupdate/default-cache + + # uncomment this once you have everything working how you want and you are + # ready to have ez-ipupdate running in the background all the time. to stop it +--- ez-ipupdate-3.0.11b8.orig/example-heipv6tb.conf ++++ ez-ipupdate-3.0.11b8/example-heipv6tb.conf +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/ez-ipupdate -c ++#!/usr/sbin/ez-ipupdate -c + # + # example config file for ez-ipupdate + # +@@ -11,14 +11,9 @@ + interface=eth1 + max-interval=2073600 + +-# please create this file and ensure that the user that ez-ipupdate is running +-# as has write permissions to it then uncomment this line, if you don't your +-# dyndns account will probably get banned. if you run ez-ipupdate as root (bad +-# idea, use "run-as-user") then you can just uncomment this line. +-#cache-file=/etc/ez-ipupdate.cache.eth1 +- +-# for the mean time we'll just use a cache file in the temp directory +-cache-file=/tmp/ez-ipupdate.cache ++# if you don't use a cache file your account will probably get banned. ++run-as-user=ez-ipupd ++cache-file=/var/cache/ez-ipupdate/default-cache + + # uncomment this once you have everything working how you want and you are + # ready to have ez-ipupdate running in the background all the time. to stop it diff --git a/net/ez-ipupdate/patches/002-ez_ipupdate_everydns.patch b/net/ez-ipupdate/patches/002-ez_ipupdate_everydns.patch new file mode 100644 index 0000000..74bce56 --- /dev/null +++ b/net/ez-ipupdate/patches/002-ez_ipupdate_everydns.patch @@ -0,0 +1,209 @@ +diff -ur ez-ipupdate-3.0.11b8.orig/ez-ipupdate.c ez-ipupdate-3.0.11b8/ez-ipupdate.c +--- ez-ipupdate-3.0.11b8.orig/ez-ipupdate.c 2009-03-29 22:37:09.000000000 +0200 ++++ ez-ipupdate-3.0.11b8/ez-ipupdate.c 2009-03-29 22:37:20.000000000 +0200 +@@ -103,6 +103,11 @@ + #define HEIPV6TB_DEFAULT_PORT "80" + #define HEIPV6TB_REQUEST "/index.cgi" + ++#define EVERYDNS_DEFAULT_SERVER "dyn.everydns.net" ++#define EVERYDNS_DEFAULT_PORT "80" ++#define EVERYDNS_REQUEST "/index.php" ++#define EVERYDNS_VERSION "0.1" ++ + #define DEFAULT_TIMEOUT 120 + #define DEFAULT_UPDATE_PERIOD 120 + #define DEFAULT_RESOLV_PERIOD 30 +@@ -344,6 +349,10 @@ + int HEIPV6TB_check_info(void); + static char *HEIPV6TB_fields_used[] = { "server", "user", NULL }; + ++int EVERYDNS_update_entry(void); ++int EVERYDNS_check_info(void); ++static char *EVERYDNS_fields_used[] = { "server", "user", "host", "address", NULL }; ++ + struct service_t services[] = { + { "NULL", + { "null", "NULL", 0, }, +@@ -517,6 +526,16 @@ + HEIPV6TB_DEFAULT_PORT, + HEIPV6TB_REQUEST + }, ++ { "everydns", ++ { "everydns", 0, 0, }, ++ NULL, ++ EVERYDNS_update_entry, ++ EVERYDNS_check_info, ++ EVERYDNS_fields_used, ++ EVERYDNS_DEFAULT_SERVER, ++ EVERYDNS_DEFAULT_PORT, ++ EVERYDNS_REQUEST ++ }, + }; + + static struct service_t *service = NULL; +@@ -4251,6 +4270,165 @@ + return(UPDATERES_OK); + } + ++int EVERYDNS_check_info(void) ++{ ++ warn_fields(service->fields_used); ++ ++ return 0; ++} ++ ++int EVERYDNS_update_entry(void) ++{ ++ char buf[BUFFER_SIZE+1]; ++ char *bp = buf; ++ int bytes; ++ int btot; ++ int ret; ++ ++ buf[BUFFER_SIZE] = '\0'; ++ ++ if(do_connect((int*)&client_sockfd, server, port) != 0) ++ { ++ if(!(options & OPT_QUIET)) ++ { ++ show_message("error connecting to %s:%s\n", server, port); ++ } ++ return(UPDATERES_ERROR); ++ } ++ ++ snprintf(buf, BUFFER_SIZE, "GET %s?ver=%s&", request, EVERYDNS_VERSION); ++ output(buf); ++ if(address) ++ { ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "ip", address); ++ output(buf); ++ } ++ if((host != NULL) && (*host == '\0')) ++ { ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "domain", host); ++ output(buf); ++ } ++ snprintf(buf, BUFFER_SIZE, " HTTP/1.0\015\012"); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "Authorization: Basic %s\015\012", auth); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "User-Agent: %s-%s %s [%s] (%s)\015\012", ++ "ez-update", VERSION, OS, (options & OPT_DAEMON) ? "daemon" : "", "by Angus Mackay"); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "Host: %s\015\012", server); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "\015\012"); ++ output(buf); ++ ++ bp = buf; ++ bytes = 0; ++ btot = 0; ++ while((bytes=read_input(bp, BUFFER_SIZE-btot)) > 0) ++ { ++ bp += bytes; ++ btot += bytes; ++ dprintf((stderr, "btot: %d\n", btot)); ++ } ++ close(client_sockfd); ++ buf[btot] = '\0'; ++ ++ dprintf((stderr, "server output: %s\n", buf)); ++ ++ if(sscanf(buf, " HTTP/1.%*c %3d", &ret) != 1) ++ { ++ ret = -1; ++ } ++ ++ switch(ret) ++ { ++ char *p; ++ ++ case -1: ++ if(!(options & OPT_QUIET)) ++ { ++ show_message("strange server response, are you connecting to the right server?\n"); ++ } ++ return(UPDATERES_ERROR); ++ break; ++ ++ case 200: ++ ret = -1; ++ if((p=strstr(buf, "Exit code: ")) != NULL) ++ { ++ sscanf(p, "Exit code: %d", &ret); ++ } ++ ++ /* ++ * 0 - Successfully Updated ++ */ ++ switch(ret) ++ { ++ case -1: ++ if(!(options & OPT_QUIET)) ++ { ++ show_message("strange server response, are you connecting to the right server?\n"); ++ } ++ return(UPDATERES_ERROR); ++ break; ++ ++ case 0: ++ if(!(options & OPT_QUIET)) ++ { ++ printf("request successful\n"); ++ } ++ break; ++ ++ case 2: ++ if(!(options & OPT_QUIET)) ++ { ++ show_message("Bad Username/password\n"); ++ } ++ return(UPDATERES_SHUTDOWN); ++ break; ++ ++ case 5: ++ if(!(options & OPT_QUIET)) ++ { ++ show_message("Last update too recent, please wait...\n"); ++ } ++ return(UPDATERES_ERROR); ++ break; ++ ++ default: ++ if(!(options & OPT_QUIET)) ++ { ++ show_message("unknown return code: %d\n", ret); ++ fprintf(stderr, "server response: %s\n", buf); ++ } ++ return(UPDATERES_ERROR); ++ break; ++ } ++ break; ++ ++ case 401: ++ if(!(options & OPT_QUIET)) ++ { ++ show_message("authentication failure\n"); ++ } ++ return(UPDATERES_SHUTDOWN); ++ break; ++ ++ default: ++ if(!(options & OPT_QUIET)) ++ { ++ // reuse the auth buffer ++ *auth = '\0'; ++ sscanf(buf, " HTTP/1.%*c %*3d %255[^\r\n]", auth); ++ show_message("unknown return code: %d\n", ret); ++ fprintf(stderr, "server response: %s\n", auth); ++ } ++ return(UPDATERES_ERROR); ++ break; ++ } ++ ++ return(UPDATERES_OK); ++} ++ + static int is_in_list(char *needle, char **haystack) + { + char **p; diff --git a/net/ez-ipupdate/patches/003-dnsexit.patch b/net/ez-ipupdate/patches/003-dnsexit.patch new file mode 100644 index 0000000..edfd61d --- /dev/null +++ b/net/ez-ipupdate/patches/003-dnsexit.patch @@ -0,0 +1,263 @@ +diff -Nur ez-ipupdate-3.0.11b8.orig/example-dnsexit.conf ez-ipupdate-3.0.11b8/example-dnsexit.conf +--- ez-ipupdate-3.0.11b8.orig/example-dnsexit.conf 1970-01-01 01:00:00.000000000 +0100 ++++ ez-ipupdate-3.0.11b8/example-dnsexit.conf 2009-03-29 22:40:07.000000000 +0200 +@@ -0,0 +1,20 @@ ++#!/usr/sbin/ez-ipupdate -c ++# ++# example config file for ez-ipupdate ++# ++# this file is actually executable! ++# ++ ++service-type=dnsexit ++user=loginname:password ++host=www.yourdomain.com ++interface=eth0 ++ ++# please ensure the user has permission to write this file ++cache-file=/tmp/ez-ipupdate.cache ++ ++run-as-user=ez-ipupd ++# uncomment this once you have everything working how you want and you are ++# ready to have ez-ipupdate running in the background all the time. to stop it ++# you can use "killall -QUIT ez-ipupdate" under linux. ++#daemon +diff -Nur ez-ipupdate-3.0.11b8.orig/ez-ipupdate.c ez-ipupdate-3.0.11b8/ez-ipupdate.c +--- ez-ipupdate-3.0.11b8.orig/ez-ipupdate.c 2009-03-29 22:39:46.000000000 +0200 ++++ ez-ipupdate-3.0.11b8/ez-ipupdate.c 2009-03-29 22:40:07.000000000 +0200 +@@ -108,6 +108,10 @@ + #define EVERYDNS_REQUEST "/index.php" + #define EVERYDNS_VERSION "0.1" + ++#define DNSEXIT_DEFAULT_SERVER "www.dnsexit.com" ++#define DNSEXIT_DEFAULT_PORT "80" ++#define DNSEXIT_REQUEST "/RemoteUpdate.sv" ++ + #define DEFAULT_TIMEOUT 120 + #define DEFAULT_UPDATE_PERIOD 120 + #define DEFAULT_RESOLV_PERIOD 30 +@@ -353,6 +357,11 @@ + int EVERYDNS_check_info(void); + static char *EVERYDNS_fields_used[] = { "server", "user", "host", "address", NULL }; + ++int DNSEXIT_update_entry(void); ++int DNSEXIT_check_info(void); ++static char *DNSEXIT_fields_used[] = { "server", "user", "address", "wildcard", "mx", "host", NULL }; ++ ++ + struct service_t services[] = { + { "NULL", + { "null", "NULL", 0, }, +@@ -536,6 +545,16 @@ + EVERYDNS_DEFAULT_PORT, + EVERYDNS_REQUEST + }, ++ { "dnsexit", ++ { "dnsexit", 0, 0, }, ++ NULL, ++ DNSEXIT_update_entry, ++ DNSEXIT_check_info, ++ DNSEXIT_fields_used, ++ DNSEXIT_DEFAULT_SERVER, ++ DNSEXIT_DEFAULT_PORT, ++ DNSEXIT_REQUEST ++ }, + }; + + static struct service_t *service = NULL; +@@ -4429,6 +4448,195 @@ + return(UPDATERES_OK); + } + ++int DNSEXIT_check_info(void) ++{ ++ char buf[BUFSIZ+1]; ++ ++ if((host == NULL) || (*host == '\0')) ++ { ++ if(options & OPT_DAEMON) ++ { ++ return(-1); ++ } ++ if(host) { free(host); } ++ printf("host: "); ++ *buf = '\0'; ++ fgets(buf, BUFSIZ, stdin); ++ host = strdup(buf); ++ chomp(host); ++ } ++ ++ if(interface == NULL && address == NULL) ++ { ++ if(options & OPT_DAEMON) ++ { ++ fprintf(stderr, "you must provide either an interface or an address\n"); ++ return(-1); ++ } ++ if(interface) { free(interface); } ++ printf("interface: "); ++ *buf = '\0'; ++ fgets(buf, BUFSIZ, stdin); ++ chomp(buf); ++ option_handler(CMD_interface, buf); ++ } ++ ++ warn_fields(service->fields_used); ++ ++ return 0; ++} ++ ++int DNSEXIT_update_entry(void) ++{ ++ char buf[BUFFER_SIZE+1]; ++ char *bp = buf; ++ int bytes; ++ int btot; ++ int ret; ++ ++ buf[BUFFER_SIZE] = '\0'; ++ ++ if(do_connect((int*)&client_sockfd, server, port) != 0) ++ { ++ if(!(options & OPT_QUIET)) ++ { ++ show_message("error connecting to %s:%s\n", server, port); ++ } ++ return(UPDATERES_ERROR); ++ } ++ ++ snprintf(buf, BUFFER_SIZE, "GET %s?action=edit&", request); ++ output(buf); ++ if(address != NULL && *address != '\0') ++ { ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "myip", address); ++ output(buf); ++ } ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "wildcard", wildcard ? "ON" : "OFF"); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "mx", mx); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "backmx", *mx == '\0' ? "NO" : "YES"); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "host", host); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "login", user_name); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "password", password); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, " HTTP/1.0\015\012"); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "Authorization: Basic %s\015\012", auth); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "User-Agent: %s-%s %s [%s] (%s)\015\012", ++ "ez-update", VERSION, OS, (options & OPT_DAEMON) ? "daemon" : "", "by Angus Mackay"); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "Host: %s\015\012", server); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "\015\012"); ++ output(buf); ++ ++ bp = buf; ++ bytes = 0; ++ btot = 0; ++ while((bytes=read_input(bp, BUFFER_SIZE-btot)) > 0) ++ { ++ bp += bytes; ++ btot += bytes; ++ dprintf((stderr, "btot: %d\n", btot)); ++ } ++ close(client_sockfd); ++ buf[btot] = '\0'; ++ ++ dprintf((stderr, "server output: %s\n", buf)); ++ ++ if(sscanf(buf, " HTTP/1.%*c %3d", &ret) != 1) ++ { ++ ret = -1; ++ } ++ ++ switch(ret) ++ { ++ case -1: ++ if(!(options & OPT_QUIET)) ++ { ++ show_message("strange server response, are you connecting to the right server?\n"); ++ } ++ return(UPDATERES_ERROR); ++ break; ++ ++ case 200: ++ ++ if(strstr(buf, "0=Success") != NULL) ++ { ++ if(!(options & OPT_QUIET)) ++ { ++ printf("Request successful\n"); ++ } ++ } ++ else if(strstr(buf, "1=IP is the same as the IP on the system") != NULL) ++ { ++ if(!(options & OPT_QUIET)) ++ { ++ printf("Request successful but the IP is the same as previous update\n"); ++ } ++ } ++ else if(strstr(buf, "2=Invalid passwords") != NULL) ++ { ++ if(!(options & OPT_QUIET)) ++ { ++ printf("Invalid Password\n"); ++ } ++ } ++ else if(strstr(buf, "3=User not found") != NULL) ++ { ++ if(!(options & OPT_QUIET)) ++ { ++ printf("Username not found\n"); ++ } ++ } ++ else if(strstr(buf, "4=Update too often") != NULL) ++ { ++ if(!(options & OPT_QUIET)) ++ { ++ printf("Updatting too often\n"); ++ } ++ } ++ else ++ { ++ show_message("Errors return from server\n"); ++ if(!(options & OPT_QUIET)) ++ { ++ fprintf(stderr, "server output: %s\n", buf); ++ } ++ return(UPDATERES_ERROR); ++ } ++ break; ++ ++ case 401: ++ if(!(options & OPT_QUIET)) ++ { ++ show_message("authentication failure\n"); ++ } ++ return(UPDATERES_SHUTDOWN); ++ break; ++ ++ default: ++ if(!(options & OPT_QUIET)) ++ { ++ // reuse the auth buffer ++ *auth = '\0'; ++ sscanf(buf, " HTTP/1.%*c %*3d %255[^\r\n]", auth); ++ show_message("unknown return code: %d\n", ret); ++ show_message("server response: %s\n", auth); ++ } ++ return(UPDATERES_ERROR); ++ break; ++ } ++ ++ return(UPDATERES_OK); ++} ++ + static int is_in_list(char *needle, char **haystack) + { + char **p; diff --git a/net/ez-ipupdate/patches/004-zoneedit.patch b/net/ez-ipupdate/patches/004-zoneedit.patch new file mode 100644 index 0000000..acc2b5f --- /dev/null +++ b/net/ez-ipupdate/patches/004-zoneedit.patch @@ -0,0 +1,12 @@ +--- ez-ipupdate-3.0.11b8.orig/ez-ipupdate.c ++++ ez-ipupdate-3.0.11b8/ez-ipupdate.c +@@ -95,7 +95,7 @@ + #define HN_DEFAULT_PORT "80" + #define HN_REQUEST "/vanity/update" + +-#define ZONEEDIT_DEFAULT_SERVER "www.zoneedit.com" ++#define ZONEEDIT_DEFAULT_SERVER "dynamic.zoneedit.com" + #define ZONEEDIT_DEFAULT_PORT "80" + #define ZONEEDIT_REQUEST "/auth/dynamic.html" + + diff --git a/net/faifa/Makefile b/net/faifa/Makefile new file mode 100644 index 0000000..b36e98b --- /dev/null +++ b/net/faifa/Makefile @@ -0,0 +1,96 @@ +# +# Copyright (C) 2006-2012 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:=faifa +PKG_VERSION:=2012-09-13 +PKG_RELEASE:=$(PKG_SOURCE_VERSION) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://github.com/ffainelli/faifa.git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=2842afc90bd9ca08ed2a6c83c04f4015982e6007 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/faifa/Default + TITLE:=configure HomePlug 1.0/AV PLC devices + URL:=http://open-plc.org/ +endef + +define Package/libfaifa + $(call Package/faifa/Default) + TITLE+= (library) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libpcap +libpthread +endef + +define Package/libfaifa/description + Faifa companion library. +endef + +define Package/faifa + $(call Package/faifa/Default) + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpthread +libpcap +libfaifa + TITLE+= (command line) +endef + +define Package/faifa/description + Faifa can configure any Intellon-based Power Line Communication device using + Intellon INT5000 and INT6000 series chips (6000 and 6300 chips). It supports all + Intellon-specific management and control frames as well as standard management + frames. +endef + +define Package/hpavcfg + $(call Package/faifa/Default) + SECTION:=net + CATEGORY:=Network + TITLE:=HomePlug AV lightweight configurator +endef + +define Package/hpavcfg/description + Lightweight configuration tool, only capable of setting a local device key (NMK) +endef + +TARGET_CFLAGS += $(FPIC) + +MAKE_FLAGS += \ + OS=LINUX \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" + +define Build/Configure + (cd $(PKG_BUILD_DIR); ./autogen.sh) + $(call Build/Configure/Default) +endef + +define Package/faifa/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/faifa $(1)/usr/bin/ +endef + +define Package/libfaifa/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfaifa.so* $(1)/usr/lib +endef + +define Package/hpavcfg/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/hpav_cfg $(1)/usr/bin +endef + +$(eval $(call BuildPackage,faifa)) +$(eval $(call BuildPackage,libfaifa)) +$(eval $(call BuildPackage,hpavcfg)) diff --git a/net/fakeidentd/Makefile b/net/fakeidentd/Makefile new file mode 100644 index 0000000..0061078 --- /dev/null +++ b/net/fakeidentd/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2006-2012 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:=fakeidentd +PKG_VERSION:=2.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).c +PKG_SOURCE_URL:=http://distfiles.gentoo.org/distfiles/ +PKG_MD5SUM:=d26693c1a7c883d1432e05fb6f7ead6e +UNPACK_CMD=$(CP) $(DL_DIR)/$(PKG_SOURCE) $(1)/ + +include $(INCLUDE_DIR)/package.mk + +define Package/fakeidentd + SECTION:=net + CATEGORY:=Network + TITLE:=A static, secure identd. + URL:=http://www.guru-group.fi/~too/sw/releases/ +endef + +define Package/fakeidentd/description + A static secure identd, only one source file. +endef + +define Build/Compile + $(SHELL) "$(PKG_BUILD_DIR)/$(MAKE_PATH)/$(PKG_SOURCE)" \ + CC="$(TARGET_CC)" TRG="$(PKG_BUILD_DIR)/$(MAKE_PATH)/$(PKG_NAME)" \ + $(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS) \ + $(TARGET_LDFLAGS) $(EXTRA_LDFLAGS) -DUSE_UNIX_OS +endef + +define Package/fakeidentd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) +endef + +$(eval $(call BuildPackage,fakeidentd)) diff --git a/net/fakeidentd/files/fakeidentd.init b/net/fakeidentd/files/fakeidentd.init new file mode 100644 index 0000000..4959ef2 --- /dev/null +++ b/net/fakeidentd/files/fakeidentd.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2012 OpenWrt.org + +START=85 + +start() { + service_start /usr/sbin/fakeidentd -r +} + +stop() { + service_stop /usr/sbin/fakeidentd +} diff --git a/net/flow-tools/Makefile b/net/flow-tools/Makefile new file mode 100644 index 0000000..1874f5b --- /dev/null +++ b/net/flow-tools/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2007 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:=flow-tools +PKG_VERSION:=0.68 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.eng.oar.net/pub/flow-tools/ +PKG_MD5SUM:=c9e0a8b53c79611b6bffcb9d510a5a38 + +PKG_BUILD_DEPENDS:=+zlib + +include $(INCLUDE_DIR)/package.mk + +define Package/flow-tools + SECTION:=net + CATEGORY:=Network + TITLE:=flow-tools + URL:=http://www.splintered.net/sw/flow-tools/ + DEPENDS:=+zlib +endef + +define Package/flow-tools/description + Flow-tools is a software package for collecting and processing + NetFlow data from Cisco and Juniper routers. +endef + +define Build/Compile + $(call Build/Compile/Default,all) +endef + +define Package/flow-tools/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/flow-* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,flow-tools)) diff --git a/net/flow-tools/patches/001-cross_compile_configure_fix.patch b/net/flow-tools/patches/001-cross_compile_configure_fix.patch new file mode 100644 index 0000000..01a3724 --- /dev/null +++ b/net/flow-tools/patches/001-cross_compile_configure_fix.patch @@ -0,0 +1,11 @@ +-- flow-tools-0.68.orig/configure 2007-02-08 07:21:42.000000000 -0500 ++++ flow-tools-0.68/configure 2007-02-08 07:53:42.000000000 -0500 +@@ -6308,7 +6308,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++} + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" diff --git a/net/flow-tools/patches/002-flex_lib.patch b/net/flow-tools/patches/002-flex_lib.patch new file mode 100644 index 0000000..f6b9877 --- /dev/null +++ b/net/flow-tools/patches/002-flex_lib.patch @@ -0,0 +1,46 @@ +--- flow-tools-0.68.orig/Makefile.in 2007-02-08 07:21:42.000000000 -0500 ++++ flow-tools-0.68/Makefile.in 2007-02-08 08:18:36.000000000 -0500 +@@ -70,7 +70,7 @@ + DEPDIR = @DEPDIR@ + INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ + LEX = @LEX@ +-LEXLIB = @LEXLIB@ ++LEXLIB = + LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ + MYSQLCFLAGS = @MYSQLCFLAGS@ + MYSQLINCLUDE = @MYSQLINCLUDE@ +--- flow-tools-0.68.orig/src/Makefile.in 2007-02-08 07:21:42.000000000 -0500 ++++ flow-tools-0.68/src/Makefile.in 2007-02-08 08:18:31.000000000 -0500 +@@ -70,7 +70,7 @@ + DEPDIR = @DEPDIR@ + INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ + LEX = @LEX@ +-LEXLIB = @LEXLIB@ ++LEXLIB = + LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ + MYSQLCFLAGS = @MYSQLCFLAGS@ + MYSQLINCLUDE = @MYSQLINCLUDE@ +--- flow-tools-0.68.orig/src/acllex.c 2007-02-08 07:21:42.000000000 -0500 ++++ flow-tools-0.68/src/acllex.c 2007-02-08 08:25:10.000000000 -0500 +@@ -503,7 +503,9 @@ + #ifdef __cplusplus + extern "C" int yywrap YY_PROTO(( void )); + #else +-extern int yywrap YY_PROTO(( void )); ++int yywrap (void ) { ++ return 1; ++} + #endif + #endif + +--- flow-tools-0.68.orig/configure 2007-02-08 07:21:42.000000000 -0500 ++++ flow-tools-0.68/configure 2007-02-08 08:19:30.000000000 -0500 +@@ -2952,7 +2952,7 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lfl $LIBS" ++LIBS="$LIBS" + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + /* confdefs.h. */ diff --git a/net/flow-tools/patches/010-python_script_location_fix.patch b/net/flow-tools/patches/010-python_script_location_fix.patch new file mode 100644 index 0000000..5806732 --- /dev/null +++ b/net/flow-tools/patches/010-python_script_location_fix.patch @@ -0,0 +1,30 @@ +diff --git a/bin/flow-log2rrd b/bin/flow-log2rrd +index 0567ba5..db4fdda 100755 +--- a/bin/flow-log2rrd ++++ b/bin/flow-log2rrd +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/bin/env python + + import getopt + import os +diff --git a/bin/flow-rpt2rrd b/bin/flow-rpt2rrd +index 72a74c7..7698f2b 100755 +--- a/bin/flow-rpt2rrd ++++ b/bin/flow-rpt2rrd +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/bin/env python + + import getopt + import os +diff --git a/bin/flow-rptfmt b/bin/flow-rptfmt +index 047d1ba..f663fae 100755 +--- a/bin/flow-rptfmt ++++ b/bin/flow-rptfmt +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/bin/env python + + import sys + import string diff --git a/net/flow-tools/patches/020-invalid_lvalue_in_assignment.patch b/net/flow-tools/patches/020-invalid_lvalue_in_assignment.patch new file mode 100644 index 0000000..aeda139 --- /dev/null +++ b/net/flow-tools/patches/020-invalid_lvalue_in_assignment.patch @@ -0,0 +1,171 @@ +diff --git a/lib/ftchash.c b/lib/ftchash.c +index 9cc7efa..28bafbf 100644 +--- a/lib/ftchash.c ++++ b/lib/ftchash.c +@@ -326,7 +326,7 @@ void *ftchash_foreach(struct ftchash *ft + (char*)ftch->traverse_chunk->base+ftch->traverse_chunk->next) { + + ret = ftch->traverse_rec; +- (char*)ftch->traverse_rec += ftch->d_size; ++ ftch->traverse_rec = vpadd(ftch->traverse_rec, ftch->d_size); + return ret; + + } else { +diff --git a/lib/ftio.c b/lib/ftio.c +index f6c739c..1082416 100644 +--- a/lib/ftio.c ++++ b/lib/ftio.c +@@ -2267,7 +2267,7 @@ int readn(register int fd, register void + break; + + nleft -= nread; +- (char*)ptr += nread; ++ ptr = vpadd(ptr, nread); + } + return (nbytes - nleft); + } /* readn */ +@@ -2292,7 +2292,7 @@ int writen(register int fd, register voi + return(nwritten); /* error */ + + nleft -= nwritten; +- (char*)ptr += nwritten; ++ ptr = vpadd(ptr,nwritten); + } + return(nbytes - nleft); + } /* writen */ +diff --git a/lib/ftlib.h b/lib/ftlib.h +index f91ad0a..66bf2f3 100644 +--- a/lib/ftlib.h ++++ b/lib/ftlib.h +@@ -152,7 +152,6 @@ #define FT_PDU_V8_11_MAXFLOWS 44 /* max + #define FT_PDU_V8_12_MAXFLOWS 44 /* max records in V8 DST_PREFIX_TOS packet */ + #define FT_PDU_V8_13_MAXFLOWS 35 /* max records in V8 PREFIX_TOS packet */ + #define FT_PDU_V8_14_MAXFLOWS 35 /* max records in V8 PREFIX_PORT_TOS packet */ +- + #define FT_PDU_V8_1_VERSION 2 /* version of AS packet */ + #define FT_PDU_V8_2_VERSION 2 /* version of PROTO PORT packet */ + #define FT_PDU_V8_3_VERSION 2 /* version of SRC PREFIX packet */ +@@ -3029,6 +3028,8 @@ #ifndef IN_CLASSD_SSM + #define IN_CLASSD_SSM(i) (((u_int32_t)(i) & 0xff000000) == 0xe8000000) + #endif /* IN_CLASSD_SSM */ + ++void *vpadd(const void* v, const int change); ++ + /* MACHINE DEPENDANT */ + #define fmt_uint fmt_uint32 + +diff --git a/lib/fttlv.c b/lib/fttlv.c +index 7035813..330a783 100644 +--- a/lib/fttlv.c ++++ b/lib/fttlv.c +@@ -68,10 +68,10 @@ int fttlv_enc_uint32(void *buf, int buf_ + } + + bcopy(&t, buf, 2); +- (char*)buf+= 2; ++ buf = vpadd(buf, 2); + + bcopy(&len, buf, 2); +- (char*)buf+= 2; ++ buf = vpadd(buf, 2); + + bcopy(&v, buf, 4); + +@@ -107,10 +107,10 @@ int fttlv_enc_uint16(void *buf, int buf_ + } + + bcopy(&t, buf, 2); +- (char*)buf+= 2; ++ buf = vpadd(buf, 2); + + bcopy(&len, buf, 2); +- (char*)buf+= 2; ++ buf = vpadd(buf, 2); + + bcopy(&v, buf, 2); + +@@ -145,10 +145,10 @@ int fttlv_enc_uint8(void *buf, int buf_s + } + + bcopy(&t, buf, 2); +- (char*)buf+= 2; ++ buf = vpadd(buf, 2); + + bcopy(&len, buf, 2); +- (char*)buf+= 2; ++ buf = vpadd(buf, 2); + + bcopy(&v, buf, 1); + +@@ -183,10 +183,10 @@ int fttlv_enc_str(void *buf, int buf_siz + } + + bcopy(&t, buf, 2); +- (char*)buf+= 2; ++ buf = vpadd(buf, 2); + + bcopy(&len, buf, 2); +- (char*)buf+= 2; ++ buf = vpadd(buf, 2); + + bcopy(v, buf, len); + +@@ -230,16 +230,16 @@ int fttlv_enc_ifname(void *buf, int buf_ + return -1; + + bcopy(&t, buf, 2); +- (char*)buf+= 2; ++ buf = vpadd(buf, 2); + + bcopy(&len, buf, 2); +- (char*)buf+= 2; ++ buf = vpadd(buf, 2); + + bcopy(&ip, buf, 4); +- (char*)buf += 4; ++ buf = vpadd(buf, 4); + + bcopy(&ifIndex, buf, 2); +- (char*)buf += 2; ++ buf = vpadd(buf, 2); + + bcopy(name, buf, n); + +@@ -287,19 +287,19 @@ int fttlv_enc_ifalias(void *buf, int buf + } + + bcopy(&t, buf, 2); +- (char*)buf+= 2; ++ buf = vpadd(buf, 2); + + bcopy(&len, buf, 2); +- (char*)buf+= 2; ++ buf = vpadd(buf, 2); + + bcopy(&ip, buf, 4); +- (char*)buf += 4; ++ buf = vpadd(buf, 4); + + bcopy(&entries, buf, 2); +- (char*)buf += 2; ++ buf = vpadd(buf, 2); + + bcopy(ifIndex_list, buf, esize); +- (char*)buf += esize; ++ buf = vpadd(buf, esize); + + bcopy(name, buf, n); + +diff --git a/lib/support.c b/lib/support.c +index a32ffe7..2e1db9f 100644 +--- a/lib/support.c ++++ b/lib/support.c +@@ -736,3 +736,8 @@ int udp_cksum(struct ip *ip, struct udph + return sum; + } /* udp_cksum */ + ++// void pointer add ++ ++void * vpadd(const void *v, const int change) { ++ return (void *) (((char*) v) + change); ++} diff --git a/net/flow-tools/patches/030-avoid_external_debug_var.patch b/net/flow-tools/patches/030-avoid_external_debug_var.patch new file mode 100644 index 0000000..6ca5740 --- /dev/null +++ b/net/flow-tools/patches/030-avoid_external_debug_var.patch @@ -0,0 +1,13 @@ +diff --git a/lib/ftfile.c b/lib/ftfile.c +index 2f3ae76..f25e849 100644 +--- a/lib/ftfile.c ++++ b/lib/ftfile.c +@@ -53,7 +53,7 @@ #endif + + int load_dir(char *prefix, struct ftfile_entries *fte, int flags, int *depth); + +-extern int debug; ++#define debug 0 + + /* + * function: ftfile_entry_new diff --git a/net/flow-tools/patches/050-fix-64bit_temp_time_t.patch b/net/flow-tools/patches/050-fix-64bit_temp_time_t.patch new file mode 100644 index 0000000..99a06f7 --- /dev/null +++ b/net/flow-tools/patches/050-fix-64bit_temp_time_t.patch @@ -0,0 +1,41 @@ +diff --git a/lib/ftfile.c b/lib/ftfile.c +index f25e849..ec17771 100644 +--- a/lib/ftfile.c ++++ b/lib/ftfile.c +@@ -413,16 +413,17 @@ void ftfile_pathname(char *buf, int bsiz + int done, u_int32 ftime) + { + struct tm *tm; ++ time_t _t = (time_t) ftime; + char *prefix, dbuf[64]; + long gmt_val; + char gmt_sign; + int tm_gmtoff; + +- if (!(tm = localtime ((time_t*)&ftime))) { ++ if (!(tm = localtime (&_t))) { + snprintf(buf, bsize, "."); + } + +- tm_gmtoff = get_gmtoff(ftime); ++ tm_gmtoff = get_gmtoff(_t); + + /* compute GMT offset */ + if (tm_gmtoff >= 0) { +@@ -502,6 +503,7 @@ void ftfile_pathname(char *buf, int bsiz + int ftfile_mkpath(u_int32 ftime, int nest) + { + struct tm *tm; ++ time_t _t = (time_t) ftime; + char buf[32]; + + /* no directories */ +@@ -512,7 +514,7 @@ int ftfile_mkpath(u_int32 ftime, int nes + if ((nest > 3) || (nest < -3)) + return -1; + +- if (!(tm = localtime ((time_t*)&ftime))) ++ if (!(tm = localtime (&_t))) + return -1; + + if (nest == -1) diff --git a/net/flow-tools/patches/060-fix_uninitialized_var_in_flow_send.patch b/net/flow-tools/patches/060-fix_uninitialized_var_in_flow_send.patch new file mode 100644 index 0000000..2240537 --- /dev/null +++ b/net/flow-tools/patches/060-fix_uninitialized_var_in_flow_send.patch @@ -0,0 +1,13 @@ +diff --git a/src/flow-send.c b/src/flow-send.c +index 83ca926..ad87024 100644 +--- a/src/flow-send.c ++++ b/src/flow-send.c +@@ -76,7 +76,7 @@ int main(int argc, char **argv) + u_int32 privacy_mask; + unsigned int v1, v2, one; + int i, n, ret, tx_delay, udp_sock; +- int src_ip_spoof, hdr_len; ++ int src_ip_spoof, hdr_len = 0; + void *rec; + + /* init fterr */ diff --git a/net/flow-tools/patches/070-extra_ftpdu_verify_debugging.patch b/net/flow-tools/patches/070-extra_ftpdu_verify_debugging.patch new file mode 100644 index 0000000..911d369 --- /dev/null +++ b/net/flow-tools/patches/070-extra_ftpdu_verify_debugging.patch @@ -0,0 +1,49 @@ +diff --git a/lib/ftdecode.c b/lib/ftdecode.c +index ff6b0cf..8884db9 100644 +--- a/lib/ftdecode.c ++++ b/lib/ftdecode.c +@@ -122,8 +122,10 @@ int ftpdu_verify(struct ftpdu *ftpdu) + ret = -1; + + /* enough bytes to decode the count and version? */ +- if (ftpdu->bused < 4) ++ if (ftpdu->bused < 4) { ++ fterr_warnx("not enough bytes to decode the count and version."); + goto ftpdu_verify_out_quick; ++ } + + ph = (struct ftpdu_header*)&ftpdu->buf; + +@@ -158,15 +160,22 @@ #endif /* LITTLE_ENDIAN */ + case 5: + + /* max PDU's in record */ +- if (ph->count > FT_PDU_V5_MAXFLOWS) ++ if (ph->count > FT_PDU_V5_MAXFLOWS) { ++ fterr_warnx("too many pdus (%d) in record, max %d", ph->count, ++ FT_PDU_V5_MAXFLOWS); + goto ftpdu_verify_out; ++ } ++ + + size = offsetof(struct ftpdu_v5, records) + + ph->count * sizeof (struct ftrec_v5); + + /* PDU received size == PDU expected size? */ +- if (size != ftpdu->bused) ++ if (size != ftpdu->bused) { ++ fterr_warnx("pdu received size was wrong. expected %d got %d", ++ ftpdu->bused, size); + goto ftpdu_verify_out; ++ } + + ftpdu->ftv.d_version = 5; + ftpdu->decodef = fts3rec_pdu_v5_decode; +@@ -516,6 +525,7 @@ #endif /* LITTLE_ENDIAN */ + break; /* 8 */ + + default: ++ fterr_warnx("ftpdu version not set."); + goto ftpdu_verify_out; + + } /* switch ph->version */ diff --git a/net/flow-tools/patches/080-fix_uninitialized_var_in_flow_export.patch b/net/flow-tools/patches/080-fix_uninitialized_var_in_flow_export.patch new file mode 100644 index 0000000..bd88403 --- /dev/null +++ b/net/flow-tools/patches/080-fix_uninitialized_var_in_flow_export.patch @@ -0,0 +1,13 @@ +diff --git a/src/flow-export.c b/src/flow-export.c +index 52ae4d2..22b0330 100644 +--- a/src/flow-export.c ++++ b/src/flow-export.c +@@ -961,7 +961,7 @@ #endif /* PGSQL */ + + int fmt_xfields_type(char *buf, u_int64 xfield) + { +- int comma; ++ int comma = 0; + + buf[0] = 0; + diff --git a/net/fping/Makefile b/net/fping/Makefile new file mode 100644 index 0000000..93f1bc5 --- /dev/null +++ b/net/fping/Makefile @@ -0,0 +1,61 @@ +# +# 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:=fping +PKG_VERSION:=2.4b2_to-ipv6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.fping.com/download/ +PKG_MD5SUM:=3ad516765514249a40d3c5b6caab812a + +include $(INCLUDE_DIR)/package.mk + +define Package/fping + SECTION:=net + CATEGORY:=Network + TITLE:=A program to ping multiple hosts in parallel + URL:=http://www.fping.com +endef + +define Package/fping/description + fping is a ping(1) like program which uses the Internet Control Message Protocol + (ICMP) echo request to determine if a host is up. fping is different from ping in + that you can specify any number of hosts on the command line, or specify a file + containing the lists of hosts to ping. Instead of trying one host until it timeouts + or replies, fping will send out a ping packet and move on to the next host in a + round-robin fashion. If a host replies, it is noted and removed from the list of + hosts to check. If a host does not respond within a certain time limit and/or retry + limit it will be considered unreachable. +endef + +define Build/Configure + (cd $(PKG_BUILD_DIR); touch \ + configure \ + stamp-h.in \ + config.h.in \ + ); + $(call Build/Configure/Default,) +endef + +define Build/Compile + $(MAKE) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" -C $(PKG_BUILD_DIR) clean $(PKG_NAME) + mv $(PKG_BUILD_DIR)/$(PKG_NAME) $(PKG_BUILD_DIR)/$(PKG_NAME)4 + $(MAKE) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS) -DIPV6=1" -C $(PKG_BUILD_DIR) clean $(PKG_NAME) + mv $(PKG_BUILD_DIR)/$(PKG_NAME) $(PKG_BUILD_DIR)/$(PKG_NAME)6 +endef + +define Package/fping/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/fping4 $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/fping6 $(1)/usr/bin/ + ln -sf fping4 $(1)/usr/bin/fping +endef + +$(eval $(call BuildPackage,fping)) diff --git a/net/fping/patches/001-debian.patch b/net/fping/patches/001-debian.patch new file mode 100644 index 0000000..a24dabb --- /dev/null +++ b/net/fping/patches/001-debian.patch @@ -0,0 +1,165 @@ +--- fping-2.4b2-to-ipv6.orig/fping.8 ++++ fping-2.4b2-to-ipv6/fping.8 +@@ -1,4 +1,4 @@ +-.TH fping l ++.TH fping 8 + .SH NAME + fping \- send ICMP ECHO_REQUEST packets to network hosts + .SH SYNOPSIS +@@ -152,7 +152,7 @@ + example none the less. + .nf + +-#!/usr/local/bin/perl ++#!/usr/bin/perl + require 'open2.pl'; + + $MAILTO = "root"; +@@ -178,7 +178,7 @@ + that are currently reachable. + .nf + +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + $hosts_to_backup = `cat /etc/hosts.backup | fping -a`; + +--- fping-2.4b2-to-ipv6.orig/fping.c ++++ fping-2.4b2-to-ipv6/fping.c +@@ -42,7 +42,6 @@ + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ +-#define IPV6 1 /* This should be a compiler option, or even better be done from the Makefile... ;) */ + + #ifndef _NO_PROTO + #if !__STDC__ && !defined( __cplusplus ) && !defined( FUNCPROTO ) \ +@@ -101,13 +100,8 @@ + #endif + #include + +-/* Linux has bizarre ip.h and ip_icmp.h */ +-#if defined( __linux__ ) +-#include "linux.h" +-#else + #include + #include +-#endif /* defined(__linux__) */ + + #include + #include +@@ -150,7 +144,11 @@ + #define MIN_PING_DATA sizeof( PING_DATA ) + #define MAX_IP_PACKET 65536 /* (theoretical) max IP packet size */ + #define SIZE_IP_HDR 20 ++#ifndef IPV6 + #define SIZE_ICMP_HDR ICMP_MINLEN /* from ip_icmp.h */ ++#else ++#define SIZE_ICMP_HDR sizeof(FPING_ICMPHDR) ++#endif + #define MAX_PING_DATA ( MAX_IP_PACKET - SIZE_IP_HDR - SIZE_ICMP_HDR ) + + /* sized so as to be like traditional ping */ +@@ -474,6 +472,35 @@ + sizeof(opton))) + err(1, "setsockopt(IPV6_RTHDR)"); + #endif ++#ifndef USE_SIN6_SCOPE_ID ++#ifdef IPV6_RECVPKTINFO ++ if (setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &opton, ++ sizeof(opton))) ++ err(1, "setsockopt(IPV6_RECVPKTINFO)"); ++#else /* old adv. API */ ++ if (setsockopt(s, IPPROTO_IPV6, IPV6_PKTINFO, &opton, ++ sizeof(opton))) ++ err(1, "setsockopt(IPV6_PKTINFO)"); ++#endif ++#endif /* USE_SIN6_SCOPE_ID */ ++#ifdef IPV6_RECVHOPLIMIT ++ if (setsockopt(s, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &opton, ++ sizeof(opton))) ++ err(1, "setsockopt(IPV6_RECVHOPLIMIT)"); ++#else /* old adv. API */ ++ if (setsockopt(s, IPPROTO_IPV6, IPV6_HOPLIMIT, &opton, ++ sizeof(opton))) ++ err(1, "setsockopt(IPV6_HOPLIMIT)"); ++#endif ++#ifdef IPV6_CHECKSUM ++#ifndef SOL_RAW ++#define SOL_RAW IPPROTO_IPV6 ++#endif ++ opton = 2; ++ if (setsockopt(s, SOL_RAW, IPV6_CHECKSUM, &opton, ++ sizeof(opton))) ++ err(1, "setsockopt(SOL_RAW,IPV6_CHECKSUM)"); ++#endif + #endif + + if( ( uid = getuid() ) ) +@@ -1112,7 +1139,7 @@ + /* but allow time for the last one to come in */ + if( count_flag ) + { +- if( ( cursor->num_sent >= count ) && ( ht > cursor->timeout ) ) ++ if( ( cursor->num_sent >= count ) && ( cursor->num_recv >= count || ht > cursor->timeout ) ) + { + remove_job( cursor ); + continue; +@@ -1382,15 +1409,15 @@ + if( h->num_recv_i <= h->num_sent_i ) + { + fprintf( stderr, " xmt/rcv/%%loss = %d/%d/%d%%", +- h->num_sent_i, h->num_recv_i, +- ( ( h->num_sent_i - h->num_recv_i ) * 100 ) / h->num_sent_i ); ++ h->num_sent_i, h->num_recv_i, h->num_sent_i > 0 ? ++ ( ( h->num_sent_i - h->num_recv_i ) * 100 ) / h->num_sent_i : 0 ); + + }/* IF */ + else + { + fprintf( stderr, " xmt/rcv/%%return = %d/%d/%d%%", +- h->num_sent_i, h->num_recv_i, +- ( ( h->num_recv_i * 100 ) / h->num_sent_i ) ); ++ h->num_sent_i, h->num_recv_i, h->num_sent_i > 0 ? ++ ( ( h->num_recv_i * 100 ) / h->num_sent_i ) : 0 ); + + }/* ELSE */ + +@@ -2165,20 +2192,33 @@ + struct addrinfo *res, hints; + int ret_ga; + char *hostname; ++ size_t len; + + /* getaddrinfo */ + bzero(&hints, sizeof(struct addrinfo)); +- hints.ai_flags = AI_CANONNAME; ++ hints.ai_flags = name_flag ? AI_CANONNAME : 0; + hints.ai_family = AF_INET6; + hints.ai_socktype = SOCK_RAW; + hints.ai_protocol = IPPROTO_ICMPV6; + + ret_ga = getaddrinfo(name, NULL, &hints, &res); +- if (ret_ga) errx(1, "%s", gai_strerror(ret_ga)); ++ if (ret_ga) { ++ if(!quiet_flag) ++ warnx("%s", gai_strerror(ret_ga)); ++ num_noaddress++; ++ return; ++ } + if (res->ai_canonname) hostname = res->ai_canonname; + else hostname = name; +- if (!res->ai_addr) errx(1, "getaddrinfo failed"); +- (void)memcpy(&dst, res->ai_addr, sizeof(FPING_SOCKADDR)); /*res->ai_addrlen);*/ ++ if (!res->ai_addr) { ++ if(!quiet_flag) ++ warnx("getaddrinfo failed"); ++ num_noaddress++; ++ return; ++ } ++ len = res->ai_addrlen; ++ if (len > sizeof(FPING_SOCKADDR)) len = sizeof(FPING_SOCKADDR); ++ (void)memcpy(&dst, res->ai_addr, len); + add_addr(name, name, &dst); + #endif + } /* add_name() */ diff --git a/net/fprobe-ulog/Makefile b/net/fprobe-ulog/Makefile new file mode 100644 index 0000000..64c02fb --- /dev/null +++ b/net/fprobe-ulog/Makefile @@ -0,0 +1,50 @@ +# +# 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:=fprobe-ulog +PKG_VERSION:=1.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/fprobe +PKG_MD5SUM:=cdb2e4edc47e8a3d5479eeabfb979ebc + +include $(INCLUDE_DIR)/package.mk + +define Package/fprobe-ulog + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpthread + TITLE:=NetFlow probe (ulog-based) + URL:=http://fprobe.sourceforge.net +endef + +define Package/fprobe-ulog/description + A NetFlow probe obtaining packets through linux netfilter code + (iptables ULOG target). +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --with-piddir=/var \ + --with-membulk=index8 \ + --with-hash=xor8 \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +define Package/fprobe-ulog/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/fprobe-ulog $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,fprobe-ulog)) diff --git a/net/fprobe/Makefile b/net/fprobe/Makefile new file mode 100644 index 0000000..f6be152 --- /dev/null +++ b/net/fprobe/Makefile @@ -0,0 +1,47 @@ +# +# 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:=fprobe +PKG_VERSION:=1.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/fprobe +PKG_MD5SUM:=65850d0470078269b33eee58cba77ac2 + +include $(INCLUDE_DIR)/package.mk + +define Package/fprobe + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +libpthread + TITLE:=NetFlow probe (libpcap-based) + URL:=http://fprobe.sourceforge.net/ +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --with-piddir=/var \ + --with-pcap="$(STAGING_DIR)/usr/include" \ + --with-libpcap="$(STAGING_DIR)/usr/lib" \ + --with-membulk=index8 \ + --with-hash=xor8 \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +define Package/fprobe/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/fprobe $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,fprobe)) diff --git a/net/freepops/Makefile b/net/freepops/Makefile new file mode 100644 index 0000000..d1ca8a6 --- /dev/null +++ b/net/freepops/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (C) 2010-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id: Makefile 5624 2006-11-23 00:29:07Z nbd $ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=freepops +PKG_VERSION:=0.2.4 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/freepops +PKG_MD5SUM:=d18848b903ceb68a53ded6b6d9e33047 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install + +include $(INCLUDE_DIR)/package.mk + +define Package/freepops + SECTION:=net + CATEGORY:=Network + TITLE:=POP3 interface to several webmails + DEPENDS:=+libpthread +liblua +luafilesystem +luaexpat @BROKEN # +luacurl + URL:=http://www.freepops.org +endef + +define Package/freepops/description + FreePOPs is a POP3 daemon that translates local POP3 commands + to remote HTTP requests to the supported webmail sites. + + FreePOPs can also be used as RSS aggregator and POP3 forwarder. +endef + +define Build/Configure + cd $(PKG_BUILD_DIR) && \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) -DHAVE_CONFIG_H -I$(PKG_BUILD_DIR)" \ + LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS) -llua -llua-filesystem -llua-curl -llua-expat" \ + PKGCONFIG=true \ + ./configure.sh openwrt -lua -luafilesystem -luacurl -luaexpat +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) WHERE=/usr/ all + $(TARGET_CROSS)strip $(PKG_BUILD_DIR)/src/freepopsd +endef + +define Package/freepops/install + $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR=$(PKG_INSTALL_DIR)/ WHERE=/usr/ install + mkdir -p $(PKG_INSTALL_DIR)/etc/init.d + $(CP) $(PKG_BUILD_DIR)/buildfactory/openwrt/S50freepopsd \ + $(PKG_INSTALL_DIR)/etc/init.d + chmod a+x $(PKG_INSTALL_DIR)/etc/init.d/* + rm -rf $(PKG_INSTALL_DIR)/usr/share/doc + rm -rf $(PKG_INSTALL_DIR)/usr/share/man + rm -rf $(PKG_INSTALL_DIR)/usr/bin/freepops-updater-dialog + rm -rf $(PKG_INSTALL_DIR)/usr/share/freepops/lua/foo.lua + rm -rf $(PKG_INSTALL_DIR)/usr/share/freepops/lua/skeleton.lua + cp -r $(PKG_INSTALL_DIR)/* $(1) +endef + +$(eval $(call BuildPackage,freepops)) diff --git a/net/freeradius2/Makefile b/net/freeradius2/Makefile new file mode 100644 index 0000000..28955f7 --- /dev/null +++ b/net/freeradius2/Makefile @@ -0,0 +1,612 @@ +# +# Copyright (C) 2008-2012 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.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=freeradius-server-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.freeradius.org/pub/freeradius/ +PKG_MD5SUM:=0fb333fe6a64eb2b1dd6ef67f7bca119 + +PKG_BUILD_DIR:=$(BUILD_DIR)/freeradius-server-$(PKG_VERSION) +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/freeradius2/Default + SECTION:=net + CATEGORY:=Network + URL:=http://freeradius.org/ +endef + +define Package/freeradius2 + $(call Package/freeradius2/Default) + DEPENDS:=+libltdl +libopenssl +libpthread +libreadline + TITLE:=A flexible RADIUS server (version 2) + MENU:=1 +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-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 + TITLE:=EAP/PEAP module +endef + +define Package/freeradius2-mod-eap-tls + $(call Package/freeradius2/Default) + DEPENDS:=freeradius2-mod-eap + 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 +PACKAGE_freeradius2-mod-ldap: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 \ + +PACKAGE_freeradius2-mod-sql-mysql:libmysqlclient-r + TITLE:=MySQL module +endef + +define Package/freeradius2-mod-sql-pgsql + $(call Package/freeradius2/Default) + DEPENDS:=freeradius2-mod-sql \ + +PACKAGE_freeradius2-mod-sql-pgsql:libpq + TITLE:=PostgreSQL module +endef + +define Package/freeradius2-mod-sql-sqlite + $(call Package/freeradius2/Default) + DEPENDS:=freeradius2-mod-sql \ + +PACKAGE_freeradius2-mod-sql-sqlite: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 + 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 \ + --with-openssl-includes="$(STAGING_DIR)/usr/include" \ + --with-openssl-libraries="$(STAGING_DIR)/usr/lib" \ + --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/install + $(INSTALL_DIR) $(1)/etc/freeradius2 + $(INSTALL_DIR) $(1)/etc/freeradius2/modules + $(INSTALL_DIR) $(1)/etc/freeradius2/sites + chmod 771 $(1)/etc/freeradius2 + for f in clients.conf dictionary 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/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 + $(INSTALL_DIR) $(1)/usr/lib/freeradius2 + $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius2/libfreeradius-radius{,-*}.so $(1)/usr/lib/freeradius2 + ln -s freeradius2/libfreeradius-radius-$(PKG_VERSION).so $(1)/usr/lib/ + ln -s freeradius2/libfreeradius-eap-$(PKG_VERSION).so $(1)/usr/lib/ + $(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-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,libfreeradius-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 new file mode 100644 index 0000000..27f75c6 --- /dev/null +++ b/net/freeradius2/files/radiusd.init @@ -0,0 +1,22 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 + +DEFAULT=/etc/default/radiusd +LOG_D=/var/log +RUN_D=/var/run +PID_F=$RUN_D/radiusd.pid +RADACCT_D=/var/db/radacct +IPADDR=$(ifconfig br-lan | sed -n 's/.*dr:\(.*\)Bc.*/\1/p') + +start() { + [ -f $DEFAULT ] && . $DEFAULT + mkdir -p $LOG_D + mkdir -p $RUN_D + mkdir -p $RADACCT_D + radiusd -i $IPADDR -p 1812,1813 $OPTIONS +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) +} diff --git a/net/freeradius2/patches/001-fix-makefile.patch b/net/freeradius2/patches/001-fix-makefile.patch new file mode 100644 index 0000000..2daaec8 --- /dev/null +++ b/net/freeradius2/patches/001-fix-makefile.patch @@ -0,0 +1,10 @@ +--- a/Make.inc.in ++++ b/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 new file mode 100644 index 0000000..4eb48b7 --- /dev/null +++ b/net/freeradius2/patches/002-config.patch @@ -0,0 +1,588 @@ +--- a/raddb/dictionary.in ++++ b/raddb/dictionary.in +@@ -23,7 +23,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 +--- a/raddb/eap.conf ++++ b/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 + # +@@ -205,7 +205,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 +@@ -215,7 +215,7 @@ + # message is included ONLY in the + # First packet of a fragment series. + # +- # include_length = yes ++ include_length = yes + + # Check the Certificate Revocation List + # +@@ -281,7 +281,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 +@@ -316,7 +316,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 +@@ -332,14 +332,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 +@@ -348,8 +348,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 +@@ -449,7 +449,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 +@@ -457,7 +457,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 +@@ -473,7 +473,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 +@@ -486,7 +486,7 @@ + # the tunneled request. + # + # allowed values: {no, yes} +- use_tunneled_reply = no ++# use_tunneled_reply = no + + # + # The inner tunneled request can be sent +@@ -498,13 +498,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 +- } ++# } + + ################################################## + # +@@ -573,14 +573,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 +@@ -592,7 +592,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. +--- a/raddb/modules/counter ++++ b/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 +--- a/raddb/modules/pap ++++ b/raddb/modules/pap +@@ -18,5 +18,5 @@ + # + # http://www.openldap.org/faq/data/cache/347.html + pap { +- auto_header = no ++ auto_header = yes + } +--- a/raddb/modules/radutmp ++++ b/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 +--- a/raddb/modules/sradutmp ++++ b/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" + } +--- a/raddb/radiusd.conf.in ++++ b/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} +@@ -290,7 +290,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. + # +@@ -317,7 +317,7 @@ listen { + # ipv6addr = :: + port = 0 + type = acct +-# interface = eth0 ++ interface = br-lan + # clients = per_socket_clients + } + +@@ -541,8 +541,8 @@ security { + # + # allowed values: {no, yes} + # +-proxy_requests = yes +-$INCLUDE proxy.conf ++proxy_requests = no ++#$INCLUDE proxy.conf + + + # CLIENTS CONFIGURATION +@@ -739,7 +739,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, +@@ -752,15 +752,15 @@ instantiate { + # listed in any other section. See 'doc/rlm_expr' for + # more information. + # +- 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. + # +@@ -784,7 +784,7 @@ instantiate { + # to multiple times. + # + ###################################################################### +-$INCLUDE policy.conf ++#$INCLUDE policy.conf + + ###################################################################### + # +@@ -794,9 +794,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/ + + ###################################################################### + # +@@ -804,7 +804,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 +--- a/raddb/sites-available/default ++++ b/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 + + # +@@ -195,8 +195,8 @@ authorize { + # Use the checkval module + # checkval + +- expiration +- logintime ++# expiration ++# logintime + + # + # If no other module has claimed responsibility for +@@ -277,7 +277,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. +@@ -294,7 +294,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 + # +@@ -330,8 +330,8 @@ authenticate { + # + # Pre-accounting. Decide which accounting type to use. + # +-preacct { +- preprocess ++#preacct { ++# preprocess + + # + # Session start times are *implied* in RADIUS. +@@ -354,7 +354,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 +@@ -364,13 +364,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. +@@ -380,7 +380,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 +@@ -432,7 +432,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. +@@ -458,7 +458,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 + +@@ -488,7 +488,7 @@ post-auth { + # ldap + + # For Exec-Program and Exec-Program-Wait +- exec ++# exec + + # + # Calculate the various WiMAX keys. In order for this to work, +@@ -558,12 +558,12 @@ 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 +- attr_filter.access_reject +- } +-} ++# attr_filter.access_reject ++# } ++#} + + # + # When the server decides to proxy a request to a home server, +@@ -573,7 +573,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 +@@ -589,14 +589,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' +@@ -620,7 +620,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 +@@ -642,5 +642,5 @@ post-proxy { + # Post-Proxy-Type Fail { + # detail + # } +-} ++#} + +--- a/raddb/users ++++ b/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 new file mode 100644 index 0000000..7f3e240 --- /dev/null +++ b/net/freeradius2/patches/004-ldap_configure.patch @@ -0,0 +1,4253 @@ +--- a/src/modules/rlm_ldap/configure ++++ b/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 ++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 ++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 ++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 ++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 ." + + _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=' ' ++ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /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 >$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 ++' >$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 = "" + ++} ++{ ++ 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 + + +--- a/src/modules/rlm_ldap/configure.in ++++ b/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 new file mode 100644 index 0000000..bb5f81a --- /dev/null +++ b/net/freeradius2/patches/008-honor_ccpflags.patch @@ -0,0 +1,15 @@ +--- a/src/modules/rules.mak ++++ b/src/modules/rules.mak +@@ -63,10 +63,10 @@ $(LT_OBJS): $(SERVER_HEADERS) + # + ####################################################################### + %.lo: %.c +- $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(RLM_CFLAGS) -c $< ++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(RLM_CFLAGS) -c $< + + %.lo: %.cpp +- $(LIBTOOL) --mode=compile $(CXX) $(CFLAGS) $(RLM_CFLAGS) -c $< ++ $(LIBTOOL) --mode=compile $(CXX) $(CFLAGS) $(CPPFLAGS) $(RLM_CFLAGS) -c $< + + ifneq ($(TARGET),) + ####################################################################### diff --git a/net/freeswitch/Makefile b/net/freeswitch/Makefile new file mode 100644 index 0000000..5c5466b --- /dev/null +++ b/net/freeswitch/Makefile @@ -0,0 +1,798 @@ +# +# Copyright (C) 2009-2012 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:=freeswitch +PKG_DISTNAME:=$(PKG_NAME)_git +PKG_VERSION:=1.0.7 +PKG_RELEASE:=2 + + +# +# The latest FS git hash in PKG_REV can be obtained from http://fisheye.freeswitch.org +# +PKG_REV:=54b4b088d911d4c80f224ed561d8e278229a75ff +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://git.$(PKG_NAME).org/$(PKG_NAME).git +PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(shell echo $(PKG_REV)|cut -b -9).tar.bz2 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + + +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 + + +FS_MOD_AVAILABLE:= \ + alsa \ + amr \ + amrwb \ + avmd \ + blacklist \ + bv \ + callcenter \ + cdr-csv \ + cdr-pg-csv \ + cdr-sqlite \ + celt \ + cepstral \ + cidlookup \ + cluechoo \ + codec2 \ + commands \ + conference \ + console \ + curl \ + dahdi-codec \ + db \ + dialplan-asterisk \ + dialplan-directory \ + dialplan-xml \ + dingaling \ + directory \ + distributor \ + dptools \ + easyroute \ + enum \ + erlang-event \ + esf \ + event-multicast \ + event-socket \ + event-zmq \ + expr \ + fifo \ + file-string \ + flite \ + fsk \ + fsv \ + g723-1 \ + g729 \ + gsmopen \ + h26x \ + h323 \ + hash \ + http-cache \ + ilbc \ + java \ + json-cdr \ + lcr \ + local-stream \ + logfile \ + loopback \ + lua \ + managed \ + mp4 \ + native-file \ + nibblebill \ + openzap \ + opus \ + portaudio \ + portaudio-stream \ + radius-cdr \ + rss \ + rtmp \ + say-de \ + say-en \ + say-es \ + say-fr \ + say-hu \ + say-it \ + say-nl \ + say-pt \ + say-ru \ + say-th \ + say-zh \ + shell-stream \ + silk \ + siren \ + skinny \ + skypopen \ + sms \ + snapshot \ + snipe-hunt \ + sndfile \ + snmp \ + snom \ + sofia \ + spandsp \ + speex \ + spidermonkey \ + spidermonkey-core-db \ + spidermonkey-curl \ + spidermonkey-odbc \ + spidermonkey-socket \ + spidermonkey-teletone \ + spy \ + stress \ + syslog \ + tone-stream \ + tts-commandline \ + unimrcp \ + valet-parking \ + vmd \ + voicemail \ + xml-cdr \ + xml-curl \ + xml-rpc \ + yaml \ + + +PKG_CONFIG_DEPENDS:= \ + CONFIG_FS_SOFIA_WITH_IPV6 \ + CONFIG_FS_SOFIA_WITH_MYSQL \ + CONFIG_FS_SOFIA_WITH_ODBC \ + CONFIG_FS_SOFIA_WITH_OPT \ + CONFIG_FS_SOFIA_WITH_SCTP \ + CONFIG_FS_SOFIA_WITH_ZRTP_GIT \ + $(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-mod-%,$(FS_MOD_AVAILABLE)) \ + + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + + +TAR_OPTIONS+= --strip-components=1 -C $(PKG_BUILD_DIR) + + +define Package/$(PKG_NAME)/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + URL:=http://www.$(PKG_NAME).org/ + MAINTAINER:=Mazilo +endef + + +define Package/$(PKG_NAME) +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH open source telephony platform + DEPENDS:= +libreadline +libncurses +libpthread +libstdcpp +libopenssl +libpq +librt +zlib + MENU:=1 +endef + + +define Package/$(PKG_NAME)/description + FreeSWITCH is an open source telephony platform designed to + facilitate the creation of voice and chat driven products scaling + from a soft-phone up to a soft-switch. See http://wiki.$(PKG_NAME).org +endef + + +define Package/$(PKG_NAME)/config + config FS_SOFIA_WITH_IPV6 + depends on PACKAGE_$(PKG_NAME) + bool "Compile with IPV6 support" + default y + help + Compile $(PKG_NAME) with IPV6 Support. + + config FS_SOFIA_WITH_OPT + depends on PACKAGE_$(PKG_NAME) + bool "Compile with optimization" + default y + help + Compile $(PKG_NAME) with optimization enabled. +endef + + +define Package/$(PKG_NAME)-mod-sofia/config + config FS_SOFIA_WITH_MYSQL + depends on PACKAGE_$(PKG_NAME)-mod-sofia + bool "Compile with MySQL" + default n + select PACKAGE_libmysqlclient + help + Compile $(PKG_NAME) with MySQL. + + config FS_SOFIA_WITH_ODBC + depends on PACKAGE_$(PKG_NAME)-mod-sofia + depends on PACKAGE_sqliteodbc + depends on PACKAGE_unixodbc_svn + bool "Compile with ODBC support (Requires unixodbc_svn NOT YET AVAILABLE)" + default n + help + Compile $(PKG_NAME)-mod-sofia with ODBC Support. Since both sqliteodbc and unixodbc_svn packages are not yet available on OpenWRT, $(PKG_NAME)-mod-sofia CAN NOT be compiled with ODBC support. + + config FS_SOFIA_WITH_SCTP + depends on PACKAGE_$(PKG_NAME)-mod-sofia + depends on PACKAGE_sctp + bool "Compile with SCTP (Stream Control Transfer Protocol) support" + default y + help + Compile $(PKG_NAME)-mod-sofia with SCTP support. + + config FS_SOFIA_WITH_ZRTP_GIT + depends on PACKAGE_$(PKG_NAME)-mod-sofia + depends on PACKAGE_libzrtpcpp + bool "Compile with ZRTP support (Requires libzrtpcpp NOT YET AVAILABLE)" + default n + #select PACKAGE_libzrtpcpp + help + Compile $(PKG_NAME)-mod-sofia with ZRTP Support. Since libzrtpcpp package is not yet available on OpenWRT, $(PKG_NAME)-mod-sofia CAN NOT be compiled with ZRTP support. +endef + + +define Package/$(PKG_NAME)-example-config +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH example config (commented) + DEPENDS:= $(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-example-config/description + The default configuration included with FreeSWITCH. It is not intended to be + a final product, and is thus moved to /usr/share/$(PKG_NAME)/examples/conf to + be an example of how FreeSWITCH can be configured. +endef + + +define Package/$(PKG_NAME)-config-upstream-defaults +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH upstream config + DEPENDS:= $(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-config-upstream-defaults/description + The default configuration included with FreeSWITCH. It is not intended to be + a final product, and but is included for those who don't want to use the + OpenWRT configuration and/or want to try things as prepared by upstream. +endef + + +define Package/$(PKG_NAME)-config-minimal +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH minimal config + DEPENDS:= $(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-config-minimal/description + A minimal configuration of FreeSWITCH for OpenWRT devices. Is what the UCI + configuration began with. +endef + + +define Package/$(PKG_NAME)-collection-upstream-defaults +$(call Package/$(PKG_NAME)/Default) + TITLE:=FS upstream def sample conf + DEPENDS:= $(PKG_NAME) \ + +$(PKG_NAME)-config-upstream-defaults \ + +$(PKG_NAME)-mod-callcenter \ + +$(PKG_NAME)-mod-codec2 \ + +$(PKG_NAME)-mod-commands \ + +$(PKG_NAME)-mod-conference \ + +$(PKG_NAME)-mod-curl \ + +$(PKG_NAME)-mod-dialplan-xml \ + +$(PKG_NAME)-mod-dingaling \ + +$(PKG_NAME)-mod-dptools \ + +$(PKG_NAME)-mod-event-socket \ + +$(PKG_NAME)-mod-g723-1 \ + +$(PKG_NAME)-mod-g729 \ + +$(PKG_NAME)-mod-hash \ + +$(PKG_NAME)-mod-http-cache \ + +$(PKG_NAME)-mod-ilbc \ + +$(PKG_NAME)-mod-local-stream \ + +$(PKG_NAME)-mod-lua \ + +$(PKG_NAME)-mod-native-file \ + +$(PKG_NAME)-mod-sndfile \ + +$(PKG_NAME)-mod-sofia \ + +$(PKG_NAME)-mod-spandsp \ + +$(PKG_NAME)-mod-speex \ + +$(PKG_NAME)-mod-syslog \ + +$(PKG_NAME)-mod-tone-stream \ + +$(PKG_NAME)-mod-xml-curl \ + +$(PKG_NAME)-mod-xml-rpc \ + +$(PKG_NAME)-tools +endef + + +define Package/$(PKG_NAME)-collection-minimal +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH minimal package collection + DEFAULT:=y + DEPENDS:= $(PKG_NAME) \ + +$(PKG_NAME)-config-minimal \ + +$(PKG_NAME)-mod-codec2 \ + +$(PKG_NAME)-mod-commands \ + +$(PKG_NAME)-mod-dialplan-xml \ + +$(PKG_NAME)-mod-dptools \ + +$(PKG_NAME)-mod-event-socket \ + +$(PKG_NAME)-mod-hash \ + +$(PKG_NAME)-mod-local-stream \ + +$(PKG_NAME)-mod-sndfile \ + +$(PKG_NAME)-mod-sofia \ + +$(PKG_NAME)-mod-syslog \ + +$(PKG_NAME)-mod-tone-stream \ + +$(PKG_NAME)-tools +endef + + +define Package/$(PKG_NAME)-sounds-en +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH english sounds + DEPENDS:= $(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-sounds-moh +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH music-on-hold sounds + DEPENDS:= $(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-tools +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH control tools + DEPENDS:= $(PKG_NAME) +endef + +define Package/libopenzap +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH openzap library + DEPENDS:=+libpthread +endef + + +define Download/files + define Download/$(1) + FILE:=$(2) + URL:=$(if $(4),$(4),http://files.$(PKG_NAME).org)/$(5) + MD5SUM:=$(3) + endef + define Prepare/$(1) + $(LN) $(DL_DIR)/$(2) $(PKG_BUILD_DIR)/$(6) + endef + $$(eval $$(call Download,$(1))) +endef + + +MAKE_INSTALL_TARGETS:=install + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-celt),) + $(eval $(call Download/files,celt,celt-0.10.0.tar.gz,a656f6176e9be84027c0e51ceedd710f,,downloads/libs/,libs/)) +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-curl),) + $(eval $(call Download/files,json-cdr,json-c-0.9.tar.gz,4653b3b9c568bb9c782178abfaac128d,,downloads/libs/,libs/)) +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-event-zmq),) + $(eval $(call Download/files,event-zmq,zeromq-2.1.9.tar.gz,94c5e0262a79c5f82bc0b178c1f8a33d,http://download.zeromq.org http://download.zeromq.org/historic,,libs/)) +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-flite),) + $(eval $(call Download/files,flite,flite-1.5.1-current.tar.bz2,36e5d1c1307161211c8ffe9a75a623ae,,downloads/libs/,libs/)) +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-opus),) + $(eval $(call Download/files,opus,opus-0.9.0.tar.gz,8a729db587430392e64280a499e9d061,,downloads/libs/,libs/)) +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en),) + $(eval $(call Download/files,sounds-en,$(PKG_NAME)-sounds-en-us-callie-8000-1.0.16.tar.gz,bde0883eb75fe06f39bde11f50a1f858,,,)) + MAKE_INSTALL_TARGETS+= sounds-install +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh),) + $(eval $(call Download/files,sounds-moh,$(PKG_NAME)-sounds-music-8000-1.0.8.tar.gz,f63ef3cc3507af079ae5c7b8b8a01e42,,,)) + MAKE_INSTALL_TARGETS+= moh-install +endif + + +# +# XXX: -fgnu89-inline is not supported on all compiler versions, so only enable it on avr32 where it solves build issues +# +ifneq ($(CONFIG_avr32),) + TARGET_CFLAGS += -fgnu89-inline + TARGET_CXXFLAGS += -fgnu89-inline +endif + + +ifneq ($(CONFIG_USE_EGLIBC),) + ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),) + TARGET_CFLAGS += -DNO_GETLOGIN + endif +endif + + +FS_TARGET_CFLAGS:= ${TARGET_CFLAGS} -DLUA_USE_LINUX $(FPIC) -std=gnu99 -Wno-format +FS_TARGET_CXXFLAGS:= ${TARGET_CXXFLAGS} -DLUA_USE_LINUX $(FPIC) -Wno-format +FS_TARGET_CPPFLAGS:= -I. -I./lua $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-erlang-event),-I$(STAGING_DIR_HOST)/lib/erlang/lib/erl_interface-3.6/include) $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-json-cdr),-Wno-error) ${TARGET_CPPFLAGS} + + +CONFIGURE_ARGS+= \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix="/usr/share/$(PKG_NAME)" \ + --bindir="/usr/bin" \ + --libdir="/usr/lib" \ + --srcdir="$(PKG_BUILD_DIR)" \ + --sysconfdir="/etc/$(PKG_NAME)" \ + --with-modinstdir="/usr/lib/$(PKG_NAME)" \ + --with-random="/dev/urandom" \ + $(if $(CONFIG_FS_SOFIA_WITH_MYSQL),--with-mysql,--without-mysql) \ + $(call autoconf_bool,CONFIG_FS_SOFIA_WITH_IPV6,ipv6) \ + $(call autoconf_bool,CONFIG_FS_SOFIA_WITH_OPT,optimization) \ + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-celt),--with-ogg="$(STAGING_DIR)/usr",--without-iogg) \ + $(if ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-curl)|$(CONFIG_PACKAGE_$(PKG_NAME)-mod-xml-cdr)|$(CONFIG_PACKAGE_$(PKG_NAME)-mod-xml-curl)),--with-libcurl="$(STAGING_DIR)/usr",--without-libcurl) \ + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-java),--with-java="$(STAGING_DIR)/usr",--without-java) \ + $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-spandsp,builtin-tiff) \ + $(call autoconf_bool,CONFIG_FS_SOFIA_WITH_ZRTP_GIT,zrtp) \ + $(call autoconf_bool,CONFIG_FS_SOFIA_WITH_ODBC,core-odbc-support) \ + $(if $(CONFIG_FS_SOFIA_WITH_ODBC),--with-odbc="$(STAGING_DIR)/usr") \ + $(if $(CONFIG_FS_SOFIA_WITH_ODBC),--with-odbc-lib="$(STAGING_DIR)/usr/lib") \ + + +CONFIGURE_VARS+= \ + config_TARGET_CC="${TARGET_CC}" \ + config_TARGET_CFLAGS="${FS_TARGET_CPPFLAGS} ${FS_TARGET_CFLAGS}" \ + config_TARGET_CXX="${TARGET_CXX}" \ + config_TARGET_CXXFLAGS="${FS_TARGET_CPPFLAGS} ${FS_TARGET_CXXFLAGS}" \ + config_TARGET_CPPFLAGS="${FS_TARGET_CPPFLAGS}" \ + config_TARGET_READLINE_INC="${FS_TARGET_CPPFLAGS}" \ + config_TARGET_READLINE_LIBS="${TARGET_LDFLAGS} -lreadline -lncurses" \ + config_TARGET_LIBS="${TARGET_LDFLAGS} -lpthread" \ + config_BUILD_CC="${HOSTCC}" \ + config_BUILD_CFLAGS="${HOST_CFLAGS}" \ + CC_FOR_BUILD="${HOSTCC}" \ + LDFLAGS="$$$$LDFLAGS" \ + LDFLAGS_FOR_BUILD="${HOST_LDFLAGS}" \ + CC="${TARGET_CC}" \ + CXX="${TARGET_CXX}" \ + CFLAGS="${FS_TARGET_CPPFLAGS} ${FS_TARGET_CFLAGS}" \ + CXXFLAGS="${FS_TARGET_CPPFLAGS} ${FS_TARGET_CXXFLAGS}" \ + CPPFLAGS="${FS_TARGET_CPPFLAGS}" \ + LDFLAGS="${TARGET_LDFLAGS} -Wl,-rpath-link=\"${STAGING_DIR}/usr/lib\"" \ + PATH="${PATH}:${STAGING_DIR}" \ + HOST_CC="/usr/bin/cc" \ + HOST_CXX="/usr/bin/g++" \ + CROSS_COMPILE="1" \ + ax_cv_c_compiler_vendor="gnu" \ + ac_cv_dev_urandom="yes" \ + ac_cv_file_dbd_apr_dbd_mysql_c="no" \ + ac_cv_file__dev_random="no" \ + ac_cv_file__dev_urandom="yes" \ + ac_cv_file___dev_urandom_="yes" \ + ac_cv_func_mmap_fixed_mapped="yes" \ + ac_cv_func_pthread_rwlock_init="yes" \ + ac_cv_struct_rlimit="yes" \ + apr_cv_mutex_recursive="yes" \ + apr_cv_process_shared_works="no" \ + apr_cv_tcp_nodelay_with_cork="yes" \ + apr_cv_type_rwlock_t="yes" \ + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-perl),ac_cv_path_PERL="yes",) \ + libzmq_cv_cxx_werror_flag="" \ + ac_cv_path_PKG_CONFIG=no \ + ac_cv_path_LIBGNUTLS_CONFIG=no + + +define Build/Prepare + $(call Build/Prepare/Default) + $(call Prepare/celt) + $(call Prepare/event-zmq) + $(call Prepare/flite) + $(call Prepare/json-cdr) + $(call Prepare/opus) + $(call Prepare/sounds-en) + $(call Prepare/sounds-moh) +endef + + +define Build/Configure + (cd $(PKG_BUILD_DIR); $(AM_TOOL_PATHS) ./bootstrap.sh) + $(call Build/Configure/Default,) + $(foreach m,$(FS_MOD_AVAILABLE), + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-$(m)), + $(SED) 's|^[ #]*\([^#]*/mod_$(subst -,_,$(m))\)$$$$|\1|g' $(PKG_BUILD_DIR)/modules.conf + , + $(SED) 's|^\([^#]*/mod_$(subst -,_,$(m))\)$$$$|#\1|g' $(PKG_BUILD_DIR)/modules.conf + ) + ) +endef + + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + AR="$(TARGET_CROSS)ar" \ + RANLIB="$(TARGET_CROSS)ranlib" \ + CC="$(TARGET_CC)" \ + CXX="$(TARGET_CXX)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \ + all $(MAKE_INSTALL_TARGETS) + $(SED) 's|^\([ \t]*\)\(.*\)"mod_console"\(.*\)$$$$|\1|' $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml + $(SED) 's|^\([ \t]*\)\(.*\)$$$$|\1\2"mod_syslog"\3\4|' $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml +endef + + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/$(PKG_NAME) + $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/include/* $(1)/usr/include/$(PKG_NAME)/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$(PKG_NAME).{a,so*} $(1)/usr/lib/ +endef + + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$(PKG_NAME).so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/default + $(INSTALL_DATA) ./files/$(PKG_NAME).default $(1)/etc/default/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_DATA) ./files/$(PKG_NAME).hotplug $(1)/etc/hotplug.d/iface/90-$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-collection-upstream-defaults/install + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-example-config/install + $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/examples/conf + $(CP) $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/* $(1)/usr/share/$(PKG_NAME)/examples/conf/ +endef + + +define Package/$(PKG_NAME)-config-upstream-defaults/install + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) + $(CP) $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/* $(1)/etc/$(PKG_NAME)/ +endef + + +define Package/$(PKG_NAME)-collection-minimal/install + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-collection-uci-minimal/install + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-config-minimal/install + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) + $(CP) ./files/etc.minimal/* $(1)/etc/$(PKG_NAME)/ +endef + + +define Package/$(PKG_NAME)-sounds-en/install + $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds + $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en $(1)/usr/share/$(PKG_NAME)/sounds/ +endef + + +define Package/$(PKG_NAME)-sounds-moh/install + $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds + $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music $(1)/usr/share/$(PKG_NAME)/sounds/ +endef + +define Package/libopenzap/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopenzap.so* $(1)/usr/lib/ +endef + +define Package/$(PKG_NAME)-tools/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_cli $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_encode $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_ivrd $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/fsxs $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/gentls_cert $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/tone2wav $(1)/usr/bin/ +endef + + +# +# 1. Name +# 2. Title +# 3. Files +# 4. Inter Depends +# 5. Extra Depends +# +define BuildPlugin + define Package/$(PKG_NAME)-mod-$(1) + $$(call Package/$(PKG_NAME)/Default) + TITLE:= FS $(2) module + DEPENDS:= $(PKG_NAME) $(foreach m,$(4),+$(PKG_NAME)-mod-$(m)) $(5) + endef + + define Package/$(PKG_NAME)-mod-$(1)/install + [ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/usr/lib/$(PKG_NAME) + for f in $(3); do \ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/$$$$$$$${f}.so \ + $$(1)/usr/lib/$(PKG_NAME)/ ; \ + done + if [ -d "./files/etc.packages/$(1)" ]; then \ + $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME) ; \ + $(CP) \ + ./files/etc.packages/$(1)/* \ + $$(1)/etc/$(PKG_NAME)/ ; \ + fi + endef + + define Package/$(PKG_NAME)-mod-$(1)/postinst +#!/bin/sh +sed -i -e 's|^\([ \t]*\)\(.*\)$$$$|\1\2"mod_$(subst -,_,$(1))"\3\4|' $$$${IPKG_INSTROOT}/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml + endef + + define Package/$(PKG_NAME)-mod-$(1)/postrm +#!/bin/sh +sed -i -e 's|^\([ \t]*\)\(.*\)"mod_$(subst -,_,$(1))"\(.*\)$$$$|\1|' $$$${IPKG_INSTROOT}/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml + endef + + $$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(1))) +endef + + +$(eval $(call BuildPackage,$(PKG_NAME))) +$(eval $(call BuildPackage,$(PKG_NAME)-collection-upstream-defaults)) +$(eval $(call BuildPackage,$(PKG_NAME)-collection-minimal)) +$(eval $(call BuildPackage,$(PKG_NAME)-sounds-en)) +$(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh)) +$(eval $(call BuildPackage,$(PKG_NAME)-tools)) +$(eval $(call BuildPackage,$(PKG_NAME)-example-config)) +$(eval $(call BuildPackage,$(PKG_NAME)-config-upstream-defaults)) +$(eval $(call BuildPackage,$(PKG_NAME)-config-minimal)) +$(eval $(call BuildPackage,libopenzap)) + + +# +# $(eval $(call BuildPlugin,Name,Title,Files,Inter Depends,Extra Depends)) +# +$(eval $(call BuildPlugin,alsa,Alsa endpoint,mod_alsa,,+alsa-lib)) +$(eval $(call BuildPlugin,amr,GSM-AMR codec,mod_amr,,)) +$(eval $(call BuildPlugin,amrwb,GSM-AMRWB,mod_amrwb,,)) +$(eval $(call BuildPlugin,avmd,Advanced Voice Mail Detection,mod_avmd,,)) +$(eval $(call BuildPlugin,bv,codec mod_bv,mod_bv,,)) +$(eval $(call BuildPlugin,blacklist,application blacklist,mod_blacklist,,)) +$(eval $(call BuildPlugin,callcenter,Call Center,mod_callcenter,,)) +$(eval $(call BuildPlugin,cdr-csv,CSV-CDR handler,mod_cdr_csv,,)) +$(eval $(call BuildPlugin,cdr-pg-csv,Postgress CDR handler,mod_cdr_pg_csv,,+coreutils +libpq)) +$(eval $(call BuildPlugin,cdr-sqlite,SQLite3 CDR handler,mod_cdr_sqlite,,+libsqlite3)) +$(eval $(call BuildPlugin,celt,CELT ultra-low delay codec,mod_celt,,+libogg)) +$(eval $(call BuildPlugin,cepstral,Cepstral interface,mod_cepstral,,@BROKEN)) # needs +$(eval $(call BuildPlugin,cidlookup,applications mod_cidlookup,mod_cidlookup,,+libcurl)) +$(eval $(call BuildPlugin,cluechoo,Framework Demo,mod_cluechoo,,)) +$(eval $(call BuildPlugin,codec2,CoDec 2,mod_codec2,,)) +$(eval $(call BuildPlugin,commands,API commands,mod_commands,,)) +$(eval $(call BuildPlugin,conference,Conference room,mod_conference,,)) +$(eval $(call BuildPlugin,console,Console logger,mod_console,,)) +$(eval $(call BuildPlugin,curl,HTTP request,mod_curl,,+libcurl)) +$(eval $(call BuildPlugin,dahdi-codec,DAHDI codecs,mod_dahdi_codec,,)) +$(eval $(call BuildPlugin,db,Database backend,mod_db,,)) +$(eval $(call BuildPlugin,dialplan-asterisk,Asterisk dialplan parser,mod_dialplan_asterisk,,)) +$(eval $(call BuildPlugin,dialplan-directory,Dialplan directory,mod_dialplan_directory,,)) +$(eval $(call BuildPlugin,dialplan-xml,Dialplan-XML interface,mod_dialplan_xml,,)) +$(eval $(call BuildPlugin,dingaling,Jabber interface,mod_dingaling,,)) +$(eval $(call BuildPlugin,directory,application mod_directory,mod_directory,,)) +$(eval $(call BuildPlugin,distributor,application mod_distributor,mod_distributor,,)) +$(eval $(call BuildPlugin,dptools,Dialplan tools,mod_dptools,,)) +$(eval $(call BuildPlugin,easyroute,DID routing,mod_easyroute,,)) +$(eval $(call BuildPlugin,enum,ENUM routing,mod_enum,,)) +$(eval $(call BuildPlugin,erlang-event,Erlang event handler,mod_erlang_event,,+erlang)) +$(eval $(call BuildPlugin,esf,Extra SIP Functionality,mod_esf,,)) +$(eval $(call BuildPlugin,event-multicast,Multicast event handler,mod_event_multicast,,)) +$(eval $(call BuildPlugin,event-socket,Socket event handler,mod_event_socket,,)) +$(eval $(call BuildPlugin,event-zmq,Socket event handler by Zero MQ,mod_event_zmq,,)) +$(eval $(call BuildPlugin,expr,Expression evaluation,mod_expr,,)) +$(eval $(call BuildPlugin,fifo,FIFO,mod_fifo,,)) +$(eval $(call BuildPlugin,file-string,File streaming,mod_file_string,,@OBSOLETE)) # merged into dptools +$(eval $(call BuildPlugin,flite,Festival TTS,mod_flite,,@(!(armeb||avr32)||BROKEN))) +$(eval $(call BuildPlugin,fsk,Bell-202 1200-baud FSK decoder,mod_fsk,,)) +$(eval $(call BuildPlugin,fsv,Video,mod_fsv,,)) +$(eval $(call BuildPlugin,g723-1,G.723.1 codec,mod_g723_1,,)) +$(eval $(call BuildPlugin,g729,G.729 codec,mod_g729,,)) +$(eval $(call BuildPlugin,gsmopen,Short Message Service (SMS),mod_gsmopen,spandsp,+alsa-lib @BROKEN)) # needs gsmlib +$(eval $(call BuildPlugin,h26x,H26X linear codec,mod_h26x,,)) +$(eval $(call BuildPlugin,h323,h323 endpoint,mod_h323,,@BROKEN)) # missing header files (other packages needed) +$(eval $(call BuildPlugin,hash,API for manipulating a hash table,mod_hash,,)) +$(eval $(call BuildPlugin,http-cache,HTTP GET with caching,mod_http_cache,,+libcurl)) +$(eval $(call BuildPlugin,ilbc,ILBC codec,mod_ilbc,,)) +$(eval $(call BuildPlugin,java,Java language interface,mod_java,,@BROKEN)) # needs java +$(eval $(call BuildPlugin,json-cdr,JSon-CDR interface,mod_json_cdr,,+libcurl)) +$(eval $(call BuildPlugin,lcr,Least Cost Routing,mod_lcr,,)) +$(eval $(call BuildPlugin,local-stream,Local streaming,mod_local_stream,,)) +$(eval $(call BuildPlugin,logfile,File logger,mod_logfile,,)) +$(eval $(call BuildPlugin,loopback,Loopback endpoint,mod_loopback,,)) +$(eval $(call BuildPlugin,lua,Lua language interface,mod_lua,,+libstdcpp)) +$(eval $(call BuildPlugin,managed,language mod_managed,mod_managed,,+glib2 @BROKEN)) # needs Mono +$(eval $(call BuildPlugin,mp4,MP4 File Format support for video apps.,mod_mp4,,@BROKEN)) # needs libmp4v2 +$(eval $(call BuildPlugin,native-file,Native files,mod_native_file,,)) +$(eval $(call BuildPlugin,nibblebill,Billing,mod_nibblebill,,)) +$(eval $(call BuildPlugin,openzap,Zaptel hardware interface,mod_openzap ozmod_analog ozmod_analog_em ozmod_isdn ozmod_skel ozmod_zt,,+libpcap +libopenzap)) +$(eval $(call BuildPlugin,opus,Opus CoDec,mod_opus,,)) +$(eval $(call BuildPlugin,portaudio,Local audio endpoint,mod_portaudio,,+alsa-lib)) +$(eval $(call BuildPlugin,portaudio-stream,portaudio stream format,mod_portaudio_stream,,+alsa-lib)) +$(eval $(call BuildPlugin,radius-cdr,Radius-CDR interface,mod_radius_cdr,,+freeradius2 @BROKEN)) # fails in freeradius-client +$(eval $(call BuildPlugin,rss,RRS feeds via TTS,mod_rss,,)) +$(eval $(call BuildPlugin,rtmp,RTMP Protocol Handler,mod_rtmp,,)) +$(eval $(call BuildPlugin,say-de,German say,mod_say_de,,)) +$(eval $(call BuildPlugin,say-en,English say,mod_say_en,,)) +$(eval $(call BuildPlugin,say-es,Spanish say,mod_say_es,,)) +$(eval $(call BuildPlugin,say-fr,French say,mod_say_fr,,)) +$(eval $(call BuildPlugin,say-hu,Hungarian say,mod_say_hu,,)) +$(eval $(call BuildPlugin,say-it,Italian say,mod_say_it,,)) +$(eval $(call BuildPlugin,say-nl,Dutch say,mod_say_nl,,)) +$(eval $(call BuildPlugin,say-pt,Portugeese say,mod_say_pt,,)) +$(eval $(call BuildPlugin,say-ru,Russian say,mod_say_ru,,)) +$(eval $(call BuildPlugin,say-th,Thai say,mod_say_th,,)) +$(eval $(call BuildPlugin,say-zh,Chineese say,mod_say_zh,,)) +$(eval $(call BuildPlugin,shell-stream,Shell stream,mod_shell_stream,,)) +$(eval $(call BuildPlugin,silk,codec mod_silk,mod_silk,,)) +$(eval $(call BuildPlugin,siren,G.722.1 codec,mod_siren,,)) +$(eval $(call BuildPlugin,skinny,endpoint mod_skinny,mod_skinny,,)) +$(eval $(call BuildPlugin,skypopen,Skype compatible endpoint,mod_skypopen,,@FEATURE_drawing-backend_libX11)) +$(eval $(call BuildPlugin,sms,SMS application,mod_sms,,)) +$(eval $(call BuildPlugin,snapshot,application mod_snapshot,mod_snapshot,,)) +$(eval $(call BuildPlugin,sndfile,Multi-Format file transcoder,mod_sndfile,,)) +$(eval $(call BuildPlugin,snipe-hunt,application mod_snipe_hunt,mod_snipe_hunt,,)) +$(eval $(call BuildPlugin,snmp,Simple Network Management Protocol,mod_snmp,,+libnetsnmp)) +$(eval $(call BuildPlugin,snom,SNOM specific features,mod_snom,,)) +$(eval $(call BuildPlugin,sofia,SIP,mod_sofia,,)) +$(eval $(call BuildPlugin,spandsp,Span DSP,mod_spandsp,,+libjpeg)) +$(eval $(call BuildPlugin,speex,Speex codec,mod_speex,,)) +$(eval $(call BuildPlugin,spidermonkey,JavaScript,mod_spidermonkey,,@BROKEN)) # fails in js +$(eval $(call BuildPlugin,spidermonkey-core_db,JavaScript DB,mod_spidermonkey_core_db,,@BROKEN)) +$(eval $(call BuildPlugin,spidermonkey-curl,JavaScript Curl,mod_spidermonkey_curl,,@BROKEN)) +$(eval $(call BuildPlugin,spidermonkey-odbc,JavaScript ODBC,mod_spidermonkey_odbc,,@BROKEN)) +$(eval $(call BuildPlugin,spidermonkey-socket,JavaScript socket,mod_spidermonkey_socket,,@BROKEN)) +$(eval $(call BuildPlugin,spidermonkey-teletone,JavaScript teletone,mod_spidermonkey_teletone,,@BROKEN)) +$(eval $(call BuildPlugin,spy,User spy,mod_spy,,)) +$(eval $(call BuildPlugin,stress,application mod_stress,mod_stress,,)) +$(eval $(call BuildPlugin,syslog,SysLog logger,mod_syslog,,)) +$(eval $(call BuildPlugin,tone-stream,Tone generation stream,mod_tone_stream,,)) +$(eval $(call BuildPlugin,tts-commandline,ASR TTS cli,mod_tts_commandline,,)) +$(eval $(call BuildPlugin,unimrcp,MRCP interface,mod_unimrcp,,@BROKEN)) +$(eval $(call BuildPlugin,valet-parking,application mod_valet_parking,mod_valet_parking,,)) +$(eval $(call BuildPlugin,vmd,VoiceMail beep detection,mod_vmd,,)) +$(eval $(call BuildPlugin,voicemail,VoiceMail,mod_voicemail,,)) +$(eval $(call BuildPlugin,xml-cdr,XML-CDR handler,mod_xml_cdr,,+libcurl)) +$(eval $(call BuildPlugin,xml-curl,XML-Curl gateway,mod_xml_curl,,+libcurl)) +$(eval $(call BuildPlugin,xml-rpc,XML-RPC interface,mod_xml_rpc,,)) +$(eval $(call BuildPlugin,yaml,YAML dialplans,mod_yaml,,)) + diff --git a/net/freeswitch/files/etc.minimal/autoload_configs/acl.conf.xml b/net/freeswitch/files/etc.minimal/autoload_configs/acl.conf.xml new file mode 100644 index 0000000..0c117d0 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/autoload_configs/acl.conf.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/autoload_configs/callcenter.conf.xml b/net/freeswitch/files/etc.minimal/autoload_configs/callcenter.conf.xml new file mode 100644 index 0000000..a069413 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/autoload_configs/callcenter.conf.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/autoload_configs/console.conf.xml b/net/freeswitch/files/etc.minimal/autoload_configs/console.conf.xml new file mode 100644 index 0000000..2d9e3e8 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/autoload_configs/console.conf.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/autoload_configs/dingaling.conf.xml b/net/freeswitch/files/etc.minimal/autoload_configs/dingaling.conf.xml new file mode 100644 index 0000000..e68c8b4 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/autoload_configs/dingaling.conf.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/autoload_configs/event_socket.conf.xml b/net/freeswitch/files/etc.minimal/autoload_configs/event_socket.conf.xml new file mode 100644 index 0000000..5ea2e09 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/autoload_configs/event_socket.conf.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/autoload_configs/local_stream.conf.xml b/net/freeswitch/files/etc.minimal/autoload_configs/local_stream.conf.xml new file mode 100644 index 0000000..94a5665 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/autoload_configs/local_stream.conf.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/autoload_configs/lua.conf.xml b/net/freeswitch/files/etc.minimal/autoload_configs/lua.conf.xml new file mode 100644 index 0000000..1eb594f --- /dev/null +++ b/net/freeswitch/files/etc.minimal/autoload_configs/lua.conf.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/autoload_configs/modules.conf.xml b/net/freeswitch/files/etc.minimal/autoload_configs/modules.conf.xml new file mode 100644 index 0000000..a94b32e --- /dev/null +++ b/net/freeswitch/files/etc.minimal/autoload_configs/modules.conf.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/autoload_configs/post_load_modules.conf.xml b/net/freeswitch/files/etc.minimal/autoload_configs/post_load_modules.conf.xml new file mode 100644 index 0000000..8f4e132 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/autoload_configs/post_load_modules.conf.xml @@ -0,0 +1,4 @@ + + + + diff --git a/net/freeswitch/files/etc.minimal/autoload_configs/sofia.conf.xml b/net/freeswitch/files/etc.minimal/autoload_configs/sofia.conf.xml new file mode 100644 index 0000000..24252d0 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/autoload_configs/sofia.conf.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/autoload_configs/spandsp.conf.xml b/net/freeswitch/files/etc.minimal/autoload_configs/spandsp.conf.xml new file mode 100644 index 0000000..aed847f --- /dev/null +++ b/net/freeswitch/files/etc.minimal/autoload_configs/spandsp.conf.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/autoload_configs/switch.conf.xml b/net/freeswitch/files/etc.minimal/autoload_configs/switch.conf.xml new file mode 100644 index 0000000..b0f0c53 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/autoload_configs/switch.conf.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/autoload_configs/timezones.conf.xml b/net/freeswitch/files/etc.minimal/autoload_configs/timezones.conf.xml new file mode 100644 index 0000000..85c805f --- /dev/null +++ b/net/freeswitch/files/etc.minimal/autoload_configs/timezones.conf.xml @@ -0,0 +1,551 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/dialplan/default.xml b/net/freeswitch/files/etc.minimal/dialplan/default.xml new file mode 100644 index 0000000..a368ee5 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/dialplan/default.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/dialplan/default/PLACEHOLDER b/net/freeswitch/files/etc.minimal/dialplan/default/PLACEHOLDER new file mode 100644 index 0000000..e69de29 diff --git a/net/freeswitch/files/etc.minimal/dialplan/public.xml b/net/freeswitch/files/etc.minimal/dialplan/public.xml new file mode 100644 index 0000000..b54aff9 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/dialplan/public.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/dialplan/public/PLACEHOLDER b/net/freeswitch/files/etc.minimal/dialplan/public/PLACEHOLDER new file mode 100644 index 0000000..e69de29 diff --git a/net/freeswitch/files/etc.minimal/directory/default.xml b/net/freeswitch/files/etc.minimal/directory/default.xml new file mode 100644 index 0000000..fd46fc9 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/directory/default.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/directory/default/1000.xml b/net/freeswitch/files/etc.minimal/directory/default/1000.xml new file mode 100644 index 0000000..9bee406 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/directory/default/1000.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/directory/default/1001.xml b/net/freeswitch/files/etc.minimal/directory/default/1001.xml new file mode 100644 index 0000000..97c1931 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/directory/default/1001.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/directory/default/1002.xml b/net/freeswitch/files/etc.minimal/directory/default/1002.xml new file mode 100644 index 0000000..d33691d --- /dev/null +++ b/net/freeswitch/files/etc.minimal/directory/default/1002.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/directory/default/1003.xml b/net/freeswitch/files/etc.minimal/directory/default/1003.xml new file mode 100644 index 0000000..f8b5926 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/directory/default/1003.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/directory/default/1004.xml b/net/freeswitch/files/etc.minimal/directory/default/1004.xml new file mode 100644 index 0000000..c3e7da5 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/directory/default/1004.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/directory/default/default.xml b/net/freeswitch/files/etc.minimal/directory/default/default.xml new file mode 100644 index 0000000..5db6011 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/directory/default/default.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/freeswitch.xml b/net/freeswitch/files/etc.minimal/freeswitch.xml new file mode 100644 index 0000000..ca9224e --- /dev/null +++ b/net/freeswitch/files/etc.minimal/freeswitch.xml @@ -0,0 +1,71 @@ + + + + + + + +
    + +
    + +
    + +
    + +
    + +
    + + + +
    + +
    + + +
    + + + + + +
    +
    diff --git a/net/freeswitch/files/etc.minimal/fur_elise.ttml b/net/freeswitch/files/etc.minimal/fur_elise.ttml new file mode 100644 index 0000000..6e6ef03 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/fur_elise.ttml @@ -0,0 +1,83 @@ +%(167, 0, 659) +%(167, 0, 622) +%(167, 0, 659) +%(167, 0, 622) +%(167, 0, 659) +%(167, 0, 494) +%(167, 0, 554) +%(167, 0, 523) +%(333, 0, 440) +%(167, 0, 0) +%(167, 0, 262) +%(167, 0, 330) +%(167, 0, 440) +%(333, 0, 494) +%(167, 0, 0) +%(167, 0, 330) +%(167, 0, 415) +%(167, 0, 494) +%(333, 0, 523) +%(167, 0, 0) +%(167, 0, 330) +%(167, 0, 659) +%(167, 0, 622) +%(167, 0, 659) +%(167, 0, 622) +%(167, 0, 659) +%(167, 0, 494) +%(167, 0, 554) +%(167, 0, 523) +%(333, 0, 440) +%(167, 0, 0) +%(167, 0, 262) +%(167, 0, 330) +%(167, 0, 440) +%(333, 0, 494) +%(167, 0, 0) +%(167, 0, 330) +%(167, 0, 523) +%(167, 0, 494) +%(167, 0, 440) +%(167, 0, 0) +%(167, 0, 494) +%(167, 0, 523) +%(167, 0, 587) +%(333, 0, 659) +%(167, 0, 0) +%(167, 0, 392) +%(167, 0, 698) +%(167, 0, 784) +%(333, 0, 587) +%(167, 0, 0) +%(167, 0, 349) +%(167, 0, 659) +%(167, 0, 587) +%(333, 0, 523) +%(167, 0, 0) +%(167, 0, 330) +%(167, 0, 587) +%(167, 0, 523) +%(333, 0, 494) +%(167, 0, 0) +%(167, 0, 330) +%(167, 0, 659) +%(167, 0, 330) +%(167, 0, 659) +%(167, 0, 659) +%(167, 0, 1319) +%(167, 0, 622) +%(167, 0, 659) +%(167, 0, 622) +%(167, 0, 659) +%(167, 0, 622) +%(167, 0, 659) +%(167, 0, 622) +%(167, 0, 659) +%(167, 0, 622) +%(167, 0, 659) +%(167, 0, 622) +%(167, 0, 659) +%(167, 0, 494) +%(167, 0, 554) +%(167, 0, 523) +%(333, 0, 440) diff --git a/net/freeswitch/files/etc.minimal/jingle_profiles/client.xml b/net/freeswitch/files/etc.minimal/jingle_profiles/client.xml new file mode 100644 index 0000000..cac7069 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/jingle_profiles/client.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/jingle_profiles/server.xml b/net/freeswitch/files/etc.minimal/jingle_profiles/server.xml new file mode 100644 index 0000000..b60dc27 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/jingle_profiles/server.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/mime.types b/net/freeswitch/files/etc.minimal/mime.types new file mode 100644 index 0000000..34d5fc9 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/mime.types @@ -0,0 +1,983 @@ +# This is a comment. I love comments. + +# This file controls what Internet media types are sent to the client for +# given file extension(s). Sending the correct media type to the client +# is important so they know how to handle the content of the file. +# Extra types can either be added here or by using an AddType directive +# in your config files. For more information about Internet media types, +# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type +# registry is at . + +# MIME type Extensions +application/activemessage +application/andrew-inset ez +application/applefile +application/atom+xml atom +application/atomcat+xml atomcat +application/atomicmail +application/atomsvc+xml atomsvc +application/auth-policy+xml +application/batch-smtp +application/beep+xml +application/cals-1840 +application/ccxml+xml ccxml +application/cellml+xml +application/cnrp+xml +application/commonground +application/conference-info+xml +application/cpl+xml +application/csta+xml +application/cstadata+xml +application/cybercash +application/davmount+xml davmount +application/dca-rft +application/dec-dx +application/dialog-info+xml +application/dicom +application/dns +application/dvcs +application/ecmascript ecma +application/edi-consent +application/edi-x12 +application/edifact +application/epp+xml +application/eshop +application/fastinfoset +application/fastsoap +application/fits +application/font-tdpfr pfr +application/h224 +application/http +application/hyperstudio stk +application/iges +application/im-iscomposing+xml +application/index +application/index.cmd +application/index.obj +application/index.response +application/index.vnd +application/iotp +application/ipp +application/isup +application/javascript js +application/json json +application/kpml-request+xml +application/kpml-response+xml +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/macwriteii +application/marc mrc +application/mathematica ma nb mb +application/mathml+xml mathml +application/mbms-associated-procedure-description+xml +application/mbms-deregister+xml +application/mbms-envelope+xml +application/mbms-msk+xml +application/mbms-msk-response+xml +application/mbms-protection-description+xml +application/mbms-reception-report+xml +application/mbms-register+xml +application/mbms-register-response+xml +application/mbms-user-service-description+xml +application/mbox mbox +application/mediaservercontrol+xml mscml +application/mikey +application/mp4 mp4s +application/mpeg4-generic +application/mpeg4-iod +application/mpeg4-iod-xmt +application/msword doc dot +application/mxf mxf +application/nasdata +application/news-message-id +application/news-transmission +application/nss +application/ocsp-request +application/ocsp-response +application/octet-stream bin dms lha lzh class so iso dmg dist distz pkg bpk dump elc +application/oda oda +application/oebps-package+xml +application/ogg ogg +application/parityfec +application/pdf pdf +application/pgp-encrypted pgp +application/pgp-keys +application/pgp-signature asc sig +application/pics-rules prf +application/pidf+xml +application/pkcs10 p10 +application/pkcs7-mime p7m p7c +application/pkcs7-signature p7s +application/pkix-cert cer +application/pkix-crl crl +application/pkix-pkipath pkipath +application/pkixcmp pki +application/pls+xml pls +application/poc-settings+xml +application/postscript ai eps ps +application/prs.alvestrand.titrax-sheet +application/prs.cww cww +application/prs.nprend +application/prs.plucker +application/qsig +application/rdf+xml rdf +application/reginfo+xml rif +application/relax-ng-compact-syntax rnc +application/remote-printing +application/resource-lists+xml rl +application/riscos +application/rlmi+xml +application/rls-services+xml rs +application/rsd+xml rsd +application/rss+xml rss +application/rtf rtf +application/rtx +application/samlassertion+xml +application/samlmetadata+xml +application/sbml+xml sbml +application/sdp sdp +application/set-payment +application/set-payment-initiation setpay +application/set-registration +application/set-registration-initiation setreg +application/sgml +application/sgml-open-catalog +application/shf+xml shf +application/sieve +application/simple-filter+xml +application/simple-message-summary +application/simplesymbolcontainer +application/slate +application/smil +application/smil+xml smi smil +application/soap+fastinfoset +application/soap+xml +application/spirits-event+xml +application/srgs gram +application/srgs+xml grxml +application/ssml+xml ssml +application/timestamp-query +application/timestamp-reply +application/tve-trigger +application/vemmi +application/vividence.scriptfile +application/vnd.3gpp.bsf+xml +application/vnd.3gpp.pic-bw-large plb +application/vnd.3gpp.pic-bw-small psb +application/vnd.3gpp.pic-bw-var pvb +application/vnd.3gpp.sms +application/vnd.3gpp2.bcmcsinfo+xml +application/vnd.3gpp2.sms +application/vnd.3m.post-it-notes pwn +application/vnd.accpac.simply.aso aso +application/vnd.accpac.simply.imp imp +application/vnd.acucobol acu +application/vnd.acucorp atc acutc +application/vnd.adobe.xdp+xml xdp +application/vnd.adobe.xfdf xfdf +application/vnd.aether.imp +application/vnd.amiga.ami ami +application/vnd.anser-web-certificate-issue-initiation cii +application/vnd.anser-web-funds-transfer-initiation fti +application/vnd.antix.game-component atx +application/vnd.apple.installer+xml mpkg +application/vnd.audiograph aep +application/vnd.autopackage +application/vnd.avistar+xml +application/vnd.blueice.multipass mpm +application/vnd.bmi bmi +application/vnd.businessobjects rep +application/vnd.cab-jscript +application/vnd.canon-cpdl +application/vnd.canon-lips +application/vnd.cendio.thinlinc.clientconf +application/vnd.chemdraw+xml cdxml +application/vnd.chipnuts.karaoke-mmd mmd +application/vnd.cinderella cdy +application/vnd.cirpack.isdn-ext +application/vnd.claymore cla +application/vnd.clonk.c4group c4g c4d c4f c4p c4u +application/vnd.commerce-battelle +application/vnd.commonspace csp cst +application/vnd.contact.cmsg cdbcmsg +application/vnd.cosmocaller cmc +application/vnd.crick.clicker clkx +application/vnd.crick.clicker.keyboard clkk +application/vnd.crick.clicker.palette clkp +application/vnd.crick.clicker.template clkt +application/vnd.crick.clicker.wordbank clkw +application/vnd.criticaltools.wbs+xml wbs +application/vnd.ctc-posml pml +application/vnd.cups-pdf +application/vnd.cups-postscript +application/vnd.cups-ppd ppd +application/vnd.cups-raster +application/vnd.cups-raw +application/vnd.curl curl +application/vnd.cybank +application/vnd.data-vision.rdz rdz +application/vnd.denovo.fcselayout-link fe_launch +application/vnd.dna dna +application/vnd.dolby.mlp mlp +application/vnd.dpgraph dpg +application/vnd.dreamfactory dfac +application/vnd.dvb.esgcontainer +application/vnd.dvb.ipdcesgaccess +application/vnd.dxr +application/vnd.ecdis-update +application/vnd.ecowin.chart mag +application/vnd.ecowin.filerequest +application/vnd.ecowin.fileupdate +application/vnd.ecowin.series +application/vnd.ecowin.seriesrequest +application/vnd.ecowin.seriesupdate +application/vnd.enliven nml +application/vnd.epson.esf esf +application/vnd.epson.msf msf +application/vnd.epson.quickanime qam +application/vnd.epson.salt slt +application/vnd.epson.ssf ssf +application/vnd.ericsson.quickcall +application/vnd.eszigno3+xml es3 et3 +application/vnd.eudora.data +application/vnd.ezpix-album ez2 +application/vnd.ezpix-package ez3 +application/vnd.fdf fdf +application/vnd.ffsns +application/vnd.fints +application/vnd.flographit gph +application/vnd.fluxtime.clip ftc +application/vnd.framemaker fm frame maker +application/vnd.frogans.fnc fnc +application/vnd.frogans.ltf ltf +application/vnd.fsc.weblaunch fsc +application/vnd.fujitsu.oasys oas +application/vnd.fujitsu.oasys2 oa2 +application/vnd.fujitsu.oasys3 oa3 +application/vnd.fujitsu.oasysgp fg5 +application/vnd.fujitsu.oasysprs bh2 +application/vnd.fujixerox.art-ex +application/vnd.fujixerox.art4 +application/vnd.fujixerox.hbpl +application/vnd.fujixerox.ddd ddd +application/vnd.fujixerox.docuworks xdw +application/vnd.fujixerox.docuworks.binder xbd +application/vnd.fut-misnet +application/vnd.fuzzysheet fzs +application/vnd.genomatix.tuxedo txd +application/vnd.google-earth.kml+xml kml +application/vnd.google-earth.kmz kmz +application/vnd.grafeq gqf gqs +application/vnd.gridmp +application/vnd.groove-account gac +application/vnd.groove-help ghf +application/vnd.groove-identity-message gim +application/vnd.groove-injector grv +application/vnd.groove-tool-message gtm +application/vnd.groove-tool-template tpl +application/vnd.groove-vcard vcg +application/vnd.handheld-entertainment+xml zmm +application/vnd.hbci hbci +application/vnd.hcl-bireports +application/vnd.hhe.lesson-player les +application/vnd.hp-hpgl hpgl +application/vnd.hp-hpid hpid +application/vnd.hp-hps hps +application/vnd.hp-jlyt jlt +application/vnd.hp-pcl pcl +application/vnd.hp-pclxl pclxl +application/vnd.httphone +application/vnd.hzn-3d-crossword x3d +application/vnd.ibm.afplinedata +application/vnd.ibm.electronic-media +application/vnd.ibm.minipay mpy +application/vnd.ibm.modcap afp listafp list3820 +application/vnd.ibm.rights-management irm +application/vnd.ibm.secure-container sc +application/vnd.igloader igl +application/vnd.immervision-ivp ivp +application/vnd.immervision-ivu ivu +application/vnd.informedcontrol.rms+xml +application/vnd.intercon.formnet xpw xpx +application/vnd.intertrust.digibox +application/vnd.intertrust.nncp +application/vnd.intu.qbo qbo +application/vnd.intu.qfx qfx +application/vnd.ipunplugged.rcprofile rcprofile +application/vnd.irepository.package+xml irp +application/vnd.is-xpr xpr +application/vnd.jam jam +application/vnd.japannet-directory-service +application/vnd.japannet-jpnstore-wakeup +application/vnd.japannet-payment-wakeup +application/vnd.japannet-registration +application/vnd.japannet-registration-wakeup +application/vnd.japannet-setstore-wakeup +application/vnd.japannet-verification +application/vnd.japannet-verification-wakeup +application/vnd.jcp.javame.midlet-rms rms +application/vnd.jisp jisp +application/vnd.kahootz ktz ktr +application/vnd.kde.karbon karbon +application/vnd.kde.kchart chrt +application/vnd.kde.kformula kfo +application/vnd.kde.kivio flw +application/vnd.kde.kontour kon +application/vnd.kde.kpresenter kpr kpt +application/vnd.kde.kspread ksp +application/vnd.kde.kword kwd kwt +application/vnd.kenameaapp htke +application/vnd.kidspiration kia +application/vnd.kinar kne knp +application/vnd.koan skp skd skt skm +application/vnd.liberty-request+xml +application/vnd.llamagraphics.life-balance.desktop lbd +application/vnd.llamagraphics.life-balance.exchange+xml lbe +application/vnd.lotus-1-2-3 123 +application/vnd.lotus-approach apr +application/vnd.lotus-freelance pre +application/vnd.lotus-notes nsf +application/vnd.lotus-organizer org +application/vnd.lotus-screencam scm +application/vnd.lotus-wordpro lwp +application/vnd.macports.portpkg portpkg +application/vnd.marlin.drm.actiontoken+xml +application/vnd.marlin.drm.conftoken+xml +application/vnd.marlin.drm.mdcf +application/vnd.mcd mcd +application/vnd.medcalcdata mc1 +application/vnd.mediastation.cdkey cdkey +application/vnd.meridian-slingshot +application/vnd.mfer mwf +application/vnd.mfmp mfm +application/vnd.micrografx.flo flo +application/vnd.micrografx.igx igx +application/vnd.mif mif +application/vnd.minisoft-hp3000-save +application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf daf +application/vnd.mobius.dis dis +application/vnd.mobius.mbk mbk +application/vnd.mobius.mqy mqy +application/vnd.mobius.msl msl +application/vnd.mobius.plc plc +application/vnd.mobius.txf txf +application/vnd.mophun.application mpn +application/vnd.mophun.certificate mpc +application/vnd.motorola.flexsuite +application/vnd.motorola.flexsuite.adsi +application/vnd.motorola.flexsuite.fis +application/vnd.motorola.flexsuite.gotap +application/vnd.motorola.flexsuite.kmr +application/vnd.motorola.flexsuite.ttc +application/vnd.motorola.flexsuite.wem +application/vnd.mozilla.xul+xml xul +application/vnd.ms-artgalry cil +application/vnd.ms-asf asf +application/vnd.ms-cab-compressed cab +application/vnd.ms-excel xls xlm xla xlc xlt xlw +application/vnd.ms-fontobject eot +application/vnd.ms-htmlhelp chm +application/vnd.ms-ims ims +application/vnd.ms-lrm lrm +application/vnd.ms-playready.initiator+xml +application/vnd.ms-powerpoint ppt pps pot +application/vnd.ms-project mpp mpt +application/vnd.ms-tnef +application/vnd.ms-wmdrm.lic-chlg-req +application/vnd.ms-wmdrm.lic-resp +application/vnd.ms-wmdrm.meter-chlg-req +application/vnd.ms-wmdrm.meter-resp +application/vnd.ms-works wps wks wcm wdb +application/vnd.ms-wpl wpl +application/vnd.ms-xpsdocument xps +application/vnd.mseq mseq +application/vnd.msign +application/vnd.music-niff +application/vnd.musician mus +application/vnd.ncd.control +application/vnd.nervana +application/vnd.netfpx +application/vnd.neurolanguage.nlu nlu +application/vnd.noblenet-directory nnd +application/vnd.noblenet-sealer nns +application/vnd.noblenet-web nnw +application/vnd.nokia.catalogs +application/vnd.nokia.conml+wbxml +application/vnd.nokia.conml+xml +application/vnd.nokia.isds-radio-presets +application/vnd.nokia.iptv.config+xml +application/vnd.nokia.landmark+wbxml +application/vnd.nokia.landmark+xml +application/vnd.nokia.landmarkcollection+xml +application/vnd.nokia.n-gage.ac+xml +application/vnd.nokia.n-gage.data ngdat +application/vnd.nokia.n-gage.symbian.install n-gage +application/vnd.nokia.ncd +application/vnd.nokia.pcd+wbxml +application/vnd.nokia.pcd+xml +application/vnd.nokia.radio-preset rpst +application/vnd.nokia.radio-presets rpss +application/vnd.novadigm.edm edm +application/vnd.novadigm.edx edx +application/vnd.novadigm.ext ext +application/vnd.oasis.opendocument.chart odc +application/vnd.oasis.opendocument.chart-template otc +application/vnd.oasis.opendocument.formula odf +application/vnd.oasis.opendocument.formula-template otf +application/vnd.oasis.opendocument.graphics odg +application/vnd.oasis.opendocument.graphics-template otg +application/vnd.oasis.opendocument.image odi +application/vnd.oasis.opendocument.image-template oti +application/vnd.oasis.opendocument.presentation odp +application/vnd.oasis.opendocument.presentation-template otp +application/vnd.oasis.opendocument.spreadsheet ods +application/vnd.oasis.opendocument.spreadsheet-template ots +application/vnd.oasis.opendocument.text odt +application/vnd.oasis.opendocument.text-master otm +application/vnd.oasis.opendocument.text-template ott +application/vnd.oasis.opendocument.text-web oth +application/vnd.obn +application/vnd.olpc-sugar xo +application/vnd.oma-scws-config +application/vnd.oma-scws-http-request +application/vnd.oma-scws-http-response +application/vnd.oma.bcast.associated-procedure-parameter+xml +application/vnd.oma.bcast.drm-trigger+xml +application/vnd.oma.bcast.imd+xml +application/vnd.oma.bcast.notification+xml +application/vnd.oma.bcast.sgboot +application/vnd.oma.bcast.sgdd+xml +application/vnd.oma.bcast.sgdu +application/vnd.oma.bcast.simple-symbol-container +application/vnd.oma.bcast.smartcard-trigger+xml +application/vnd.oma.bcast.sprov+xml +application/vnd.oma.dd2+xml dd2 +application/vnd.oma.drm.risd+xml +application/vnd.oma.group-usage-list+xml +application/vnd.oma.poc.groups+xml +application/vnd.oma.xcap-directory+xml +application/vnd.omads-email+xml +application/vnd.omads-file+xml +application/vnd.omads-folder+xml +application/vnd.omaloc-supl-init +application/vnd.openofficeorg.extension oxt +application/vnd.osa.netdeploy +application/vnd.osgi.dp dp +application/vnd.otps.ct-kip+xml +application/vnd.palm prc pdb pqa oprc +application/vnd.paos.xml +application/vnd.pg.format str +application/vnd.pg.osasli ei6 +application/vnd.piaccess.application-licence +application/vnd.picsel efif +application/vnd.poc.group-advertisement+xml +application/vnd.pocketlearn plf +application/vnd.powerbuilder6 pbd +application/vnd.powerbuilder6-s +application/vnd.powerbuilder7 +application/vnd.powerbuilder7-s +application/vnd.powerbuilder75 +application/vnd.powerbuilder75-s +application/vnd.preminet +application/vnd.previewsystems.box box +application/vnd.proteus.magazine mgz +application/vnd.publishare-delta-tree qps +application/vnd.pvi.ptid1 ptid +application/vnd.pwg-multiplexed +application/vnd.pwg-xhtml-print+xml +application/vnd.qualcomm.brew-app-res +application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb +application/vnd.rapid +application/vnd.recordare.musicxml mxl +application/vnd.recordare.musicxml+xml +application/vnd.renlearn.rlprint +application/vnd.rn-realmedia rm +application/vnd.ruckus.download +application/vnd.s3sms +application/vnd.scribus +application/vnd.sealed.3df +application/vnd.sealed.csf +application/vnd.sealed.doc +application/vnd.sealed.eml +application/vnd.sealed.mht +application/vnd.sealed.net +application/vnd.sealed.ppt +application/vnd.sealed.tiff +application/vnd.sealed.xls +application/vnd.sealedmedia.softseal.html +application/vnd.sealedmedia.softseal.pdf +application/vnd.seemail see +application/vnd.sema sema +application/vnd.semd semd +application/vnd.semf semf +application/vnd.shana.informed.formdata ifm +application/vnd.shana.informed.formtemplate itp +application/vnd.shana.informed.interchange iif +application/vnd.shana.informed.package ipk +application/vnd.simtech-mindmapper twd twds +application/vnd.smaf mmf +application/vnd.solent.sdkm+xml sdkm sdkd +application/vnd.spotfire.dxp dxp +application/vnd.spotfire.sfs sfs +application/vnd.sss-cod +application/vnd.sss-dtf +application/vnd.sss-ntf +application/vnd.street-stream +application/vnd.sun.wadl+xml +application/vnd.sus-calendar sus susp +application/vnd.svd svd +application/vnd.swiftview-ics +application/vnd.syncml+xml xsm +application/vnd.syncml.dm+wbxml bdm +application/vnd.syncml.dm+xml xdm +application/vnd.syncml.ds.notification +application/vnd.tao.intent-module-archive tao +application/vnd.tmobile-livetv tmo +application/vnd.trid.tpt tpt +application/vnd.triscape.mxs mxs +application/vnd.trueapp tra +application/vnd.truedoc +application/vnd.ufdl ufd ufdl +application/vnd.uiq.theme utz +application/vnd.umajin umj +application/vnd.unity unityweb +application/vnd.uoml+xml uoml +application/vnd.uplanet.alert +application/vnd.uplanet.alert-wbxml +application/vnd.uplanet.bearer-choice +application/vnd.uplanet.bearer-choice-wbxml +application/vnd.uplanet.cacheop +application/vnd.uplanet.cacheop-wbxml +application/vnd.uplanet.channel +application/vnd.uplanet.channel-wbxml +application/vnd.uplanet.list +application/vnd.uplanet.list-wbxml +application/vnd.uplanet.listcmd +application/vnd.uplanet.listcmd-wbxml +application/vnd.uplanet.signal +application/vnd.vcx vcx +application/vnd.vd-study +application/vnd.vectorworks +application/vnd.vidsoft.vidconference +application/vnd.visio vsd vst vss vsw +application/vnd.visionary vis +application/vnd.vividence.scriptfile +application/vnd.vsf vsf +application/vnd.wap.sic +application/vnd.wap.slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo wtb +application/vnd.wfa.wsc +application/vnd.wordperfect wpd +application/vnd.wqd wqd +application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf stf +application/vnd.wv.csp+wbxml +application/vnd.wv.csp+xml +application/vnd.wv.ssp+xml +application/vnd.xara xar +application/vnd.xfdl xfdl +application/vnd.xmpie.cpkg +application/vnd.xmpie.dpkg +application/vnd.xmpie.plan +application/vnd.xmpie.ppkg +application/vnd.xmpie.xlim +application/vnd.yamaha.hv-dic hvd +application/vnd.yamaha.hv-script hvs +application/vnd.yamaha.hv-voice hvp +application/vnd.yamaha.smaf-audio saf +application/vnd.yamaha.smaf-phrase spf +application/vnd.yellowriver-custom-menu cmp +application/vnd.zzazz.deck+xml zaz +application/voicexml+xml vxml +application/watcherinfo+xml +application/whoispp-query +application/whoispp-response +application/winhlp hlp +application/wita +application/wordperfect5.1 +application/wsdl+xml wsdl +application/wspolicy+xml wspolicy +application/x-ace-compressed ace +application/x-bcpio bcpio +application/x-bittorrent torrent +application/x-bzip bz +application/x-bzip2 bz2 boz +application/x-cdlink vcd +application/x-chat chat +application/x-chess-pgn pgn +application/x-compress +application/x-cpio cpio +application/x-csh csh +application/x-director dcr dir dxr fgd +application/x-dvi dvi +application/x-futuresplash spl +application/x-gtar gtar +application/x-gzip +application/x-hdf hdf +application/x-latex latex +application/x-ms-wmd wmd +application/x-ms-wmz wmz +application/x-msaccess mdb +application/x-msbinder obd +application/x-mscardfile crd +application/x-msclip clp +application/x-msdownload exe dll com bat msi +application/x-msmediaview mvb m13 m14 +application/x-msmetafile wmf +application/x-msmoney mny +application/x-mspublisher pub +application/x-msschedule scd +application/x-msterminal trm +application/x-mswrite wri +application/x-netcdf nc cdf +application/x-pkcs12 p12 pfx +application/x-pkcs7-certificates p7b spc +application/x-pkcs7-certreqresp p7r +application/x-rar-compressed rar +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-stuffit sit +application/x-stuffitx sitx +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-texinfo texinfo texi +application/x-ustar ustar +application/x-wais-source src +application/x-x509-ca-cert der crt +application/x400-bp +application/xcap-att+xml +application/xcap-caps+xml +application/xcap-el+xml +application/xcap-error+xml +application/xcap-ns+xml +application/xenc+xml xenc +application/xhtml+xml xhtml xht +application/xml xml xsl +application/xml-dtd dtd +application/xml-external-parsed-entity +application/xmpp+xml +application/xop+xml xop +application/xslt+xml xslt +application/xspf+xml xspf +application/xv+xml mxml xhvml xvml xvm +application/zip zip +audio/32kadpcm +audio/3gpp +audio/3gpp2 +audio/ac3 +audio/amr +audio/amr-wb +audio/amr-wb+ +audio/asc +audio/basic au snd +audio/bv16 +audio/bv32 +audio/clearmode +audio/cn +audio/dat12 +audio/dls +audio/dsr-es201108 +audio/dsr-es202050 +audio/dsr-es202211 +audio/dsr-es202212 +audio/dvi4 +audio/eac3 +audio/evrc +audio/evrc-qcp +audio/evrc0 +audio/evrc1 +audio/evrcb +audio/evrcb0 +audio/evrcb1 +audio/g722 +audio/g7221 +audio/g723 +audio/g726-16 +audio/g726-24 +audio/g726-32 +audio/g726-40 +audio/g728 +audio/g729 +audio/g7291 +audio/g729d +audio/g729e +audio/gsm +audio/gsm-efr +audio/ilbc +audio/l16 +audio/l20 +audio/l24 +audio/l8 +audio/lpc +audio/midi mid midi kar rmi +audio/mobile-xmf +audio/mp4 mp4a +audio/mp4a-latm +audio/mpa +audio/mpa-robust +audio/mpeg mpga mp2 mp2a mp3 m2a m3a +audio/mpeg4-generic +audio/parityfec +audio/pcma +audio/pcmu +audio/prs.sid +audio/qcelp +audio/red +audio/rtp-enc-aescm128 +audio/rtp-midi +audio/rtx +audio/smv +audio/smv0 +audio/smv-qcp +audio/sp-midi +audio/t140c +audio/t38 +audio/telephone-event +audio/tone +audio/vdvi +audio/vmr-wb +audio/vnd.3gpp.iufp +audio/vnd.4sb +audio/vnd.audiokoz +audio/vnd.celp +audio/vnd.cisco.nse +audio/vnd.cmles.radio-events +audio/vnd.cns.anp1 +audio/vnd.cns.inf1 +audio/vnd.digital-winds eol +audio/vnd.dlna.adts +audio/vnd.dolby.mlp +audio/vnd.everad.plj +audio/vnd.hns.audio +audio/vnd.lucent.voice lvp +audio/vnd.nokia.mobile-xmf +audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 ecelp4800 +audio/vnd.nuera.ecelp7470 ecelp7470 +audio/vnd.nuera.ecelp9600 ecelp9600 +audio/vnd.octel.sbc +audio/vnd.qcelp +audio/vnd.rhetorex.32kadpcm +audio/vnd.sealedmedia.softseal.mpeg +audio/vnd.vmx.cvsd +audio/wav wav +audio/x-aiff aif aiff aifc +audio/x-mpegurl m3u +audio/x-ms-wax wax +audio/x-ms-wma wma +audio/x-pn-realaudio ram ra +audio/x-pn-realaudio-plugin rmp +audio/x-wav wav +chemical/x-cdx cdx +chemical/x-cif cif +chemical/x-cmdf cmdf +chemical/x-cml cml +chemical/x-csml csml +chemical/x-pdb pdb +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +image/fits +image/g3fax g3 +image/gif gif +image/ief ief +image/jp2 +image/jpeg jpeg jpg jpe +image/jpm +image/jpx +image/naplps +image/png png +image/prs.btif btif +image/prs.pti +image/svg+xml svg svgz +image/t38 +image/tiff tiff tif +image/tiff-fx +image/vnd.adobe.photoshop psd +image/vnd.cns.inf2 +image/vnd.djvu djvu djv +image/vnd.dwg dwg +image/vnd.dxf dxf +image/vnd.fastbidsheet fbs +image/vnd.fpx fpx +image/vnd.fst fst +image/vnd.fujixerox.edmics-mmr mmr +image/vnd.fujixerox.edmics-rlc rlc +image/vnd.globalgraphics.pgb +image/vnd.microsoft.icon ico +image/vnd.mix +image/vnd.ms-modi mdi +image/vnd.net-fpx npx +image/vnd.sealed.png +image/vnd.sealedmedia.softseal.gif +image/vnd.sealedmedia.softseal.jpg +image/vnd.svf +image/vnd.wap.wbmp wbmp +image/vnd.xiff xif +image/x-cmu-raster ras +image/x-cmx cmx +image/x-icon +image/x-pcx pcx +image/x-pict pic pct +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +message/cpim +message/delivery-status +message/disposition-notification +message/external-body +message/http +message/news +message/partial +message/rfc822 eml mime +message/s-http +message/sip +message/sipfrag +message/tracking-status +model/iges igs iges +model/mesh msh mesh silo +model/vnd.dwf dwf +model/vnd.flatland.3dml +model/vnd.gdl gdl +model/vnd.gs.gdl +model/vnd.gtw gtw +model/vnd.moml+xml +model/vnd.mts mts +model/vnd.parasolid.transmit.binary +model/vnd.parasolid.transmit.text +model/vnd.vtu vtu +model/vrml wrl vrml +multipart/alternative +multipart/appledouble +multipart/byteranges +multipart/digest +multipart/encrypted +multipart/form-data +multipart/header-set +multipart/mixed +multipart/parallel +multipart/related +multipart/report +multipart/signed +multipart/voice-message +text/calendar ics ifb +text/css css +text/csv csv +text/directory +text/dns +text/enriched +text/html html htm +text/parityfec +text/plain txt text conf def list log in +text/prs.fallenstein.rst +text/prs.lines.tag dsc +text/red +text/rfc822-headers +text/richtext rtx +text/rtf +text/rtp-enc-aescm128 +text/rtx +text/sgml sgml sgm +text/t140 +text/tab-separated-values tsv +text/troff t tr roff man me ms +text/uri-list uri uris urls +text/vnd.abc +text/vnd.curl +text/vnd.dmclientscript +text/vnd.esmertec.theme-descriptor +text/vnd.fly fly +text/vnd.fmi.flexstor flx +text/vnd.in3d.3dml 3dml +text/vnd.in3d.spot spot +text/vnd.iptc.newsml +text/vnd.iptc.nitf +text/vnd.latex-z +text/vnd.motorola.reflex +text/vnd.ms-mediapackage +text/vnd.net2phone.commcenter.command +text/vnd.sun.j2me.app-descriptor jad +text/vnd.trolltech.linguist +text/vnd.wap.si +text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-asm s asm +text/x-c c cc cxx cpp h hh dic +text/x-fortran f for f77 f90 +text/x-pascal p pas +text/x-java-source java +text/x-setext etx +text/x-uuencode uu +text/x-vcalendar vcs +text/x-vcard vcf +text/xml +text/xml-external-parsed-entity +video/3gpp 3gp +video/3gpp-tt +video/3gpp2 3g2 +video/bmpeg +video/bt656 +video/celb +video/dv +video/h261 h261 +video/h263 h263 +video/h263-1998 +video/h263-2000 +video/h264 h264 +video/jpeg jpgv +video/jpm jpm jpgm +video/mj2 mj2 mjp2 +video/mp1s +video/mp2p +video/mp2t +video/mp4 mp4 mp4v mpg4 +video/mp4v-es +video/mpeg mpeg mpg mpe m1v m2v +video/mpeg4-generic +video/mpv +video/nv +video/parityfec +video/pointer +video/quicktime qt mov +video/raw +video/rtp-enc-aescm128 +video/rtx +video/smpte292m +video/vc1 +video/vnd.dlna.mpeg-tts +video/vnd.fvt fvt +video/vnd.hns.video +video/vnd.motorola.video +video/vnd.motorola.videop +video/vnd.mpegurl mxu m4u +video/vnd.nokia.interleaved-multimedia +video/vnd.nokia.videovoip +video/vnd.objectvideo +video/vnd.sealed.mpeg1 +video/vnd.sealed.mpeg4 +video/vnd.sealed.swf +video/vnd.sealedmedia.softseal.mov +video/vnd.vivo viv +video/x-fli fli +video/x-ms-asf asf asx +video/x-ms-wm wm +video/x-ms-wmv wmv +video/x-ms-wmx wmx +video/x-ms-wvx wvx +video/x-msvideo avi +video/x-sgi-movie movie +x-conference/x-cooltalk ice diff --git a/net/freeswitch/files/etc.minimal/sip_profiles/external.xml b/net/freeswitch/files/etc.minimal/sip_profiles/external.xml new file mode 100644 index 0000000..8f10763 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/sip_profiles/external.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/sip_profiles/external/example.xml b/net/freeswitch/files/etc.minimal/sip_profiles/external/example.xml new file mode 100644 index 0000000..63508fb --- /dev/null +++ b/net/freeswitch/files/etc.minimal/sip_profiles/external/example.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/sip_profiles/internal.xml b/net/freeswitch/files/etc.minimal/sip_profiles/internal.xml new file mode 100644 index 0000000..eda2486 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/sip_profiles/internal.xml @@ -0,0 +1,296 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/sip_profiles/internal/example.xml b/net/freeswitch/files/etc.minimal/sip_profiles/internal/example.xml new file mode 100644 index 0000000..220df0d --- /dev/null +++ b/net/freeswitch/files/etc.minimal/sip_profiles/internal/example.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.minimal/tetris.ttml b/net/freeswitch/files/etc.minimal/tetris.ttml new file mode 100644 index 0000000..2e33a5d --- /dev/null +++ b/net/freeswitch/files/etc.minimal/tetris.ttml @@ -0,0 +1,69 @@ +%(428,0,659,494) +%(214,0,494,415) +%(214,0,523,440) +%(214,0,587,494) +%(107,0,659,494) +%(107,0,587,494) +%(214,0,523,440) +%(214,0,494,415) +%(428,0,330,440) +%(214,0,330,440) +%(214,0,523,440) +%(428,0,659,523) +%(214,0,587,494) +%(214,0,523,440) +%(214,0,494,415) +%(214,0,494,440) +%(214,0,494,415) +%(214,0,523,440) +%(428,0,587,494) +%(428,0,659,523) +%(428,0,523,440) +%(428,0,330,440) +%(857,0,330,440) +%(214,0,0,0) +%(428,0,587,349) +%(214,0,698,440) +%(214,0,880,523) +%(107,0,880,523) +%(107,0,880,523) +%(214,0,784,494) +%(214,0,698,440) +%(642,0,659,392) +%(214,0,523,330) +%(214,0,659,392) +%(107,0,659,440) +%(107,0,659,392) +%(214,0,587,349) +%(214,0,523,330) +%(214,0,494,415) +%(214,0,494,330) +%(214,0,494,415) +%(214,0,523,440) +%(214,0,587,494) +%(214,0,587,415) +%(214,0,659,523) +%(214,0,659,415) +%(214,0,523,440) +%(214,0,523,330) +%(428,0,440,330) +%(428,0,440,330) +%(428,0,0,0) +%(857,0,330,262) +%(857,0,262,220) +%(857,0,294,247) +%(857,0,247,208) +%(857,0,262,220) +%(857,0,220,165) +%(857,0,208,165) +%(428,0,247,208) +%(428,0,0,0) +%(857,0,330,262) +%(857,0,262,220) +%(857,0,294,247) +%(857,0,208,165) +%(428,0,262,220) +%(428,0,330,262) +%(857,0,440,330) +%(857,0,415,294) +%(857,0,0,0) diff --git a/net/freeswitch/files/etc.minimal/tones.conf b/net/freeswitch/files/etc.minimal/tones.conf new file mode 100644 index 0000000..36db1d4 --- /dev/null +++ b/net/freeswitch/files/etc.minimal/tones.conf @@ -0,0 +1,63 @@ +[us] +generate-dial => v=-7;%(1000,0,350,440) +detect-dial => 350,440 + +generate-ring => v=-7;%(2000,4000,440,480) +detect-ring => 440,480 + +generate-busy => v=-7;%(500,500,480,620) +detect-busy => 480,620 + +generate-attn => v=0;%(100,100,1400,2060,2450,2600) +detect-attn => 1400,2060,2450,2600 + +generate-callwaiting-sas => v=0;%(300,0,440) +detect-callwaiting-sas => 440 + +generate-callwaiting-cas => v=0;%(80,0,2750,2130) +detect-callwaiting-cas => 2750,2130 + +detect-fail1 => 913.8 +detect-fail2 => 1370.6 +detect-fail3 => 1776.7 + + +[sg] +generate-dial => v=-7;%(1000,0,425) +detect-dial => 425 + +generate-ring => v=-7;%(2000,4000,425) +detect-ring => 425 + +generate-busy => v=-7;%(750,750,425) +detect-busy => 425 + +generate-attn => v=0;%(100,100,1400,2060,2450,2600) +detect-attn => 1400,2060,2450,2600 + +generate-callwaiting-sas => v=0;%(300,0,440) +detect-callwaiting-sas => 440 + +generate-callwaiting-cas => v=0;%(80,0,2750,2130) +detect-callwaiting-cas => 2750,2130 + +detect-fail1 => 913.8 +detect-fail2 => 1370.6 +detect-fail3 => 1776.7 + +[ru] +generate-dial => v=-7;%(1000,425) +detect-dial => 0 +generate-ring => v=-7;%(800,5000,425,0) +detect-ring => 425,0 +generate-busy => v=-7;%(350,350,425,0) +detect-busy => 425,0 +generate-attn => v=0;%(100,100,1400,2060,2450,2600) +detect-attn => 1400,2060,2450,2600 +generate-callwaiting-sas => v=0;%(300,0,440) +detect-callwaiting-sas => 440,480 +generate-callwaiting-cas => v=0;%(80,0,2750,2130) +detect-callwaiting-cas => 2750,2130 +detect-fail1 => 913.8 +detect-fail2 => 1370.6 +detect-fail3 => 1776.7 diff --git a/net/freeswitch/files/etc.minimal/vars.xml b/net/freeswitch/files/etc.minimal/vars.xml new file mode 100644 index 0000000..de1186a --- /dev/null +++ b/net/freeswitch/files/etc.minimal/vars.xml @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/blacklist/autoload_configs/blacklist.conf.xml b/net/freeswitch/files/etc.packages/blacklist/autoload_configs/blacklist.conf.xml new file mode 100644 index 0000000..33be75d --- /dev/null +++ b/net/freeswitch/files/etc.packages/blacklist/autoload_configs/blacklist.conf.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/net/freeswitch/files/etc.packages/blacklist/blacklists/blocked.list b/net/freeswitch/files/etc.packages/blacklist/blacklists/blocked.list new file mode 100644 index 0000000..e69de29 diff --git a/net/freeswitch/files/etc.packages/cdr_csv/autoload_configs/cdr_csv.conf.xml b/net/freeswitch/files/etc.packages/cdr_csv/autoload_configs/cdr_csv.conf.xml new file mode 100644 index 0000000..bcefd46 --- /dev/null +++ b/net/freeswitch/files/etc.packages/cdr_csv/autoload_configs/cdr_csv.conf.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/cdr_pg_csv/autoload_configs/cdr_pg_csv.conf.xml b/net/freeswitch/files/etc.packages/cdr_pg_csv/autoload_configs/cdr_pg_csv.conf.xml new file mode 100644 index 0000000..4fec817 --- /dev/null +++ b/net/freeswitch/files/etc.packages/cdr_pg_csv/autoload_configs/cdr_pg_csv.conf.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/event_multicast/autoload_configs/event_multicast.conf.xml b/net/freeswitch/files/etc.packages/event_multicast/autoload_configs/event_multicast.conf.xml new file mode 100644 index 0000000..eac0392 --- /dev/null +++ b/net/freeswitch/files/etc.packages/event_multicast/autoload_configs/event_multicast.conf.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/http_cache/autoload_configs/http_cache.conf.xml b/net/freeswitch/files/etc.packages/http_cache/autoload_configs/http_cache.conf.xml new file mode 100644 index 0000000..4150d64 --- /dev/null +++ b/net/freeswitch/files/etc.packages/http_cache/autoload_configs/http_cache.conf.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/logfile/autoload_configs/logfile.conf.xml b/net/freeswitch/files/etc.packages/logfile/autoload_configs/logfile.conf.xml new file mode 100644 index 0000000..57f276c --- /dev/null +++ b/net/freeswitch/files/etc.packages/logfile/autoload_configs/logfile.conf.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/pocketsphinx/autoload_configs/pocketsphinx.conf.xml b/net/freeswitch/files/etc.packages/pocketsphinx/autoload_configs/pocketsphinx.conf.xml new file mode 100644 index 0000000..3bf7d5e --- /dev/null +++ b/net/freeswitch/files/etc.packages/pocketsphinx/autoload_configs/pocketsphinx.conf.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/rtmp/autoload_configs/rtmp.conf.xml b/net/freeswitch/files/etc.packages/rtmp/autoload_configs/rtmp.conf.xml new file mode 100644 index 0000000..d5d2788 --- /dev/null +++ b/net/freeswitch/files/etc.packages/rtmp/autoload_configs/rtmp.conf.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-de/lang/de/de.xml b/net/freeswitch/files/etc.packages/say-de/lang/de/de.xml new file mode 100644 index 0000000..1b44c9a --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-de/lang/de/de.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-de/lang/de/demo/demo.xml b/net/freeswitch/files/etc.packages/say-de/lang/de/demo/demo.xml new file mode 100644 index 0000000..61582b2 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-de/lang/de/demo/demo.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-de/lang/de/vm/tts.xml b/net/freeswitch/files/etc.packages/say-de/lang/de/vm/tts.xml new file mode 100644 index 0000000..7a8f18c --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-de/lang/de/vm/tts.xml @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-en/lang/en/demo/demo-ivr.xml b/net/freeswitch/files/etc.packages/say-en/lang/en/demo/demo-ivr.xml new file mode 100644 index 0000000..ec7d7bc --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-en/lang/en/demo/demo-ivr.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-en/lang/en/demo/demo.xml b/net/freeswitch/files/etc.packages/say-en/lang/en/demo/demo.xml new file mode 100644 index 0000000..e3e6f02 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-en/lang/en/demo/demo.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-en/lang/en/dir/sounds.xml b/net/freeswitch/files/etc.packages/say-en/lang/en/dir/sounds.xml new file mode 100644 index 0000000..fc288ff --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-en/lang/en/dir/sounds.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-en/lang/en/dir/tts.xml b/net/freeswitch/files/etc.packages/say-en/lang/en/dir/tts.xml new file mode 100644 index 0000000..84007b7 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-en/lang/en/dir/tts.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-en/lang/en/en.xml b/net/freeswitch/files/etc.packages/say-en/lang/en/en.xml new file mode 100644 index 0000000..2ccd513 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-en/lang/en/en.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-en/lang/en/ivr/sounds.xml b/net/freeswitch/files/etc.packages/say-en/lang/en/ivr/sounds.xml new file mode 100644 index 0000000..e436e29 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-en/lang/en/ivr/sounds.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-en/lang/en/vm/sounds.xml b/net/freeswitch/files/etc.packages/say-en/lang/en/vm/sounds.xml new file mode 100644 index 0000000..5a09041 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-en/lang/en/vm/sounds.xml @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-en/lang/en/vm/tts.xml b/net/freeswitch/files/etc.packages/say-en/lang/en/vm/tts.xml new file mode 100644 index 0000000..1fc877d --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-en/lang/en/vm/tts.xml @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-fr/lang/fr/demo/demo.xml b/net/freeswitch/files/etc.packages/say-fr/lang/fr/demo/demo.xml new file mode 100644 index 0000000..8066020 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-fr/lang/fr/demo/demo.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-fr/lang/fr/dir/sounds.xml b/net/freeswitch/files/etc.packages/say-fr/lang/fr/dir/sounds.xml new file mode 100644 index 0000000..02d6b36 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-fr/lang/fr/dir/sounds.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-fr/lang/fr/dir/tts.xml b/net/freeswitch/files/etc.packages/say-fr/lang/fr/dir/tts.xml new file mode 100644 index 0000000..1f5b0ca --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-fr/lang/fr/dir/tts.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-fr/lang/fr/fr.xml b/net/freeswitch/files/etc.packages/say-fr/lang/fr/fr.xml new file mode 100644 index 0000000..eaf00f2 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-fr/lang/fr/fr.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-fr/lang/fr/vm/sounds.xml b/net/freeswitch/files/etc.packages/say-fr/lang/fr/vm/sounds.xml new file mode 100644 index 0000000..55190a6 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-fr/lang/fr/vm/sounds.xml @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/net/freeswitch/files/etc.packages/say-he/lang/he/demo/demo-ivr.xml b/net/freeswitch/files/etc.packages/say-he/lang/he/demo/demo-ivr.xml new file mode 100644 index 0000000..ec7d7bc --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-he/lang/he/demo/demo-ivr.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-he/lang/he/demo/demo.xml b/net/freeswitch/files/etc.packages/say-he/lang/he/demo/demo.xml new file mode 100644 index 0000000..e3e6f02 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-he/lang/he/demo/demo.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-he/lang/he/dir/sounds.xml b/net/freeswitch/files/etc.packages/say-he/lang/he/dir/sounds.xml new file mode 100644 index 0000000..15ecec3 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-he/lang/he/dir/sounds.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-he/lang/he/he.xml b/net/freeswitch/files/etc.packages/say-he/lang/he/he.xml new file mode 100644 index 0000000..fe7c5d8 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-he/lang/he/he.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-he/lang/he/vm/sounds.xml b/net/freeswitch/files/etc.packages/say-he/lang/he/vm/sounds.xml new file mode 100644 index 0000000..5a09041 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-he/lang/he/vm/sounds.xml @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-ru/lang/ru/demo/demo-ivr.xml b/net/freeswitch/files/etc.packages/say-ru/lang/ru/demo/demo-ivr.xml new file mode 100644 index 0000000..8c6f3f8 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-ru/lang/ru/demo/demo-ivr.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-ru/lang/ru/demo/demo.xml b/net/freeswitch/files/etc.packages/say-ru/lang/ru/demo/demo.xml new file mode 100644 index 0000000..7e450fb --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-ru/lang/ru/demo/demo.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-ru/lang/ru/dir/sounds.xml b/net/freeswitch/files/etc.packages/say-ru/lang/ru/dir/sounds.xml new file mode 100644 index 0000000..02d6b36 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-ru/lang/ru/dir/sounds.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-ru/lang/ru/dir/tts.xml b/net/freeswitch/files/etc.packages/say-ru/lang/ru/dir/tts.xml new file mode 100644 index 0000000..67ae5ab --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-ru/lang/ru/dir/tts.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-ru/lang/ru/ru.xml b/net/freeswitch/files/etc.packages/say-ru/lang/ru/ru.xml new file mode 100644 index 0000000..686e840 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-ru/lang/ru/ru.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-ru/lang/ru/vm/sounds.xml b/net/freeswitch/files/etc.packages/say-ru/lang/ru/vm/sounds.xml new file mode 100644 index 0000000..ffd9ec5 --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-ru/lang/ru/vm/sounds.xml @@ -0,0 +1,365 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/say-ru/lang/ru/vm/tts.xml b/net/freeswitch/files/etc.packages/say-ru/lang/ru/vm/tts.xml new file mode 100644 index 0000000..1fc877d --- /dev/null +++ b/net/freeswitch/files/etc.packages/say-ru/lang/ru/vm/tts.xml @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/sms/chatplan/default.xml b/net/freeswitch/files/etc.packages/sms/chatplan/default.xml new file mode 100644 index 0000000..b67bb63 --- /dev/null +++ b/net/freeswitch/files/etc.packages/sms/chatplan/default.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/syslog/autoload_configs/syslog.conf.xml b/net/freeswitch/files/etc.packages/syslog/autoload_configs/syslog.conf.xml new file mode 100644 index 0000000..636a12c --- /dev/null +++ b/net/freeswitch/files/etc.packages/syslog/autoload_configs/syslog.conf.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/tts_commandline/autoload_configs/tts_commandline.conf.xml b/net/freeswitch/files/etc.packages/tts_commandline/autoload_configs/tts_commandline.conf.xml new file mode 100644 index 0000000..eb81643 --- /dev/null +++ b/net/freeswitch/files/etc.packages/tts_commandline/autoload_configs/tts_commandline.conf.xml @@ -0,0 +1,15 @@ + + + + + + diff --git a/net/freeswitch/files/etc.packages/unimrcp/autoload_configs/unimrcp.conf.xml b/net/freeswitch/files/etc.packages/unimrcp/autoload_configs/unimrcp.conf.xml new file mode 100644 index 0000000..45dda79 --- /dev/null +++ b/net/freeswitch/files/etc.packages/unimrcp/autoload_configs/unimrcp.conf.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/voicemail/autoload_configs/voicemail.conf.xml b/net/freeswitch/files/etc.packages/voicemail/autoload_configs/voicemail.conf.xml new file mode 100644 index 0000000..d039279 --- /dev/null +++ b/net/freeswitch/files/etc.packages/voicemail/autoload_configs/voicemail.conf.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/etc.packages/xml-cdr/autoload_configs/xml_cdr.conf.xml b/net/freeswitch/files/etc.packages/xml-cdr/autoload_configs/xml_cdr.conf.xml new file mode 100644 index 0000000..6f8ef0d --- /dev/null +++ b/net/freeswitch/files/etc.packages/xml-cdr/autoload_configs/xml_cdr.conf.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/freeswitch/files/freeswitch.config b/net/freeswitch/files/freeswitch.config new file mode 100644 index 0000000..9b4ab84 --- /dev/null +++ b/net/freeswitch/files/freeswitch.config @@ -0,0 +1,11 @@ + +config 'global' 'state' + option 'started' '0' + +config 'profile_top' 'internal_top' + +config 'profile_top' 'external_top' + +config 'external_gateway' 'external_example' + + diff --git a/net/freeswitch/files/freeswitch.default b/net/freeswitch/files/freeswitch.default new file mode 100644 index 0000000..079c314 --- /dev/null +++ b/net/freeswitch/files/freeswitch.default @@ -0,0 +1,11 @@ +#FS_DIR="/opt" +FS_DIR_ETC="$FS_DIR/etc/freeswitch" +FS_DIR_MOD="$FS_DIR/usr/lib/freeswitch" +FS_DIR_DB="$FS_DIR/tmp/freeswitch/db" +FS_DIR_LOG="$FS_DIR/tmp/freeswitch/log" +FS_DIR_SCRIPTS="$FS_DIR/usr/share/freeswitch/scripts" +FS_DIR_HTDOCS="$FS_DIR/usr/share/freeswitch/htdocs" +FS_DIR_RECORDINGS="/var/lib/freeswitch/recordings" # NOTE: must be changed in config as well +FS_DIR_VM_STORAGE="/var/lib/freeswitch/storage" # NOTE: must be changed in config as well + +OPTIONS="-conf $FS_DIR_ETC -log $FS_DIR_LOG -db $FS_DIR_DB -mod $FS_DIR_MOD -htdocs $FS_DIR_HTDOCS -scripts $FS_DIR_SCRIPTS" diff --git a/net/freeswitch/files/freeswitch.hotplug b/net/freeswitch/files/freeswitch.hotplug new file mode 100644 index 0000000..ef9656c --- /dev/null +++ b/net/freeswitch/files/freeswitch.hotplug @@ -0,0 +1,65 @@ +#!/bin/sh + +. /lib/functions.sh +LOAD_STATE=1 + +if [ "$ACTION" = "ifup" ]; then + /etc/init.d/freeswitch enabled && { + local not_all_up="$(sh -c ' + . /lib/functions.sh + + LOAD_STATE=1 + local if_is_down=0 + local network_ignore="" + + check_if_down () { + local cfg="$1" + local up + local proto + config_get_bool up "$1" up 0 + config_get proto "$1" proto + if [ "$proto" != "none" ] && [ "$up" -ne 1 ]; then + local new_down=1 + local oIFS="$IFS" + local ignore + IFS=" " + for ignore in $network_ignore; do + [ "$cfg" = "$ignore" ] && new_down=0 + done + IFS="$oIFS" + [ "$new_down" = "1" ] && if_is_down=1 + fi + } + + append_ignore() { + local cfg="$1" + local network + config_get network "$1" network + append network_ignore "$network" + } + + LOAD_STATE=1 + config_load freeswitch + config_foreach append_ignore network_ignore + config_load network + config_foreach check_if_down interface + + echo "$if_is_down" + ')" + [ "$not_all_up" = "0" ] && { + local started + { + mkdir -p /tmp/freeswitch + lock /tmp/freeswitch/.start.lck + config_load freeswitch + config_get started "state" started + [ "$started" != "1" ] && { + /etc/init.d/freeswitch start + uci_set_state freeswitch global state started 1 + } + lock -u /tmp/freeswitch/.start.lck + } & + } + } +fi + diff --git a/net/freeswitch/files/freeswitch.init b/net/freeswitch/files/freeswitch.init new file mode 100644 index 0000000..4476b47 --- /dev/null +++ b/net/freeswitch/files/freeswitch.init @@ -0,0 +1,40 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=90 + +DEFAULT=/etc/default/freeswitch +OPTIONS="" + +boot() { + # Do nothing on boot + exit 0 +} + +start() { + [ -f $DEFAULT ] && . $DEFAULT + mkdir -p $FS_DIR_DB + mkdir -p $FS_DIR_LOG + mkdir -p $FS_DIR_RECORDINGS + mkdir -p $FS_DIR_VM_STORAGE + ulimit -s 240 + $FS_DIR/usr/bin/freeswitch $OPTIONS -nc +} + +stop() { + [ -f $DEFAULT ] && . $DEFAULT + $FS_DIR/usr/bin/freeswitch $OPTIONS -stop +} + +restart() { + # stopping freeswitch is non-blocking, so we wait until freeswitch's + # event socket is down, and then wait an additional ten seconds so that + # freeswitch should be completely shutdown before we start it again + local retval + stop + fs_cli -x status >/dev/null 2>&1 + retval=$? + while [ $retval -eq 0 ]; do sleep 1; fs_cli -x status >/dev/null 2>&1; retval=$?; done + sleep 10 + start +} + diff --git a/net/freeswitch/patches/000-build-openwrt_rules.mk.patch b/net/freeswitch/patches/000-build-openwrt_rules.mk.patch new file mode 100644 index 0000000..3d60f99 --- /dev/null +++ b/net/freeswitch/patches/000-build-openwrt_rules.mk.patch @@ -0,0 +1,7 @@ +--- /dev/null ++++ b/build/openwrt_rules.mk +@@ -0,0 +1,4 @@ ++OPENWRT_DIR=$(shell (cd $(BASE)/../../..;pwd)) ++STAGING_DIR=$(OPENWRT_DIR)/staging_dir/$(shell (cd $(BASE)/..;basename `pwd`)) ++ARCH="$(shell grep CONFIG_ARCH $(OPENWRT_DIR)/.config|cut -d= -d'"' -f2)" ++GNU_TARGET_NAME=$(ARCH)-openwrt-linux diff --git a/net/freeswitch/patches/001-build-modules_conf_in.patch b/net/freeswitch/patches/001-build-modules_conf_in.patch new file mode 100644 index 0000000..838d5a4 --- /dev/null +++ b/net/freeswitch/patches/001-build-modules_conf_in.patch @@ -0,0 +1,33 @@ +--- a/build/modules.conf.in ++++ b/build/modules.conf.in +@@ -41,10 +41,14 @@ applications/mod_valet_parking + #applications/mod_ladspa + #applications/mod_mongo + applications/mod_sms ++#applications/mod_http_cache ++#applications/mod_mp4 ++#applications/mod_protovm + codecs/mod_g723_1 + codecs/mod_amr + #codecs/mod_amrwb + #codecs/mod_silk ++#codecs/mod_theora + #codecs/mod_codec2 + codecs/mod_g729 + #codecs/mod_com_g729 +@@ -62,6 +66,7 @@ dialplans/mod_dialplan_xml + dialplans/mod_dialplan_asterisk + #directories/mod_ldap + #endpoints/mod_dingaling ++#endpoints/mod_gsmopen + #endpoints/mod_portaudio + endpoints/mod_sofia + endpoints/mod_loopback +@@ -82,6 +87,7 @@ endpoints/mod_loopback + #event_handlers/mod_event_multicast + event_handlers/mod_event_socket + #event_handlers/mod_event_zmq ++#event_handlers/mod_json_cdr + event_handlers/mod_cdr_csv + event_handlers/mod_cdr_sqlite + #event_handlers/mod_cdr_mongodb diff --git a/net/freeswitch/patches/002-Makefile.am.patch b/net/freeswitch/patches/002-Makefile.am.patch new file mode 100644 index 0000000..0e84f1b --- /dev/null +++ b/net/freeswitch/patches/002-Makefile.am.patch @@ -0,0 +1,49 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,3 +1,7 @@ ++BASE=. ++ ++include $(BASE)/build/openwrt_rules.mk ++ + EXTRA_DIST = + SUBDIRS = . src + AUTOMAKE_OPTIONS = foreign +@@ -61,7 +65,7 @@ cd-moh-install: uhd-moh-install sounds-m + # (1) if the variable is set in `config.status', edit `config.status' + # (which will cause the Makefiles to be regenerated when you run `make'); + # (2) otherwise, pass the desired values on the `make' command line. +-all-recursive: libfreeswitch.la ++all-recursive: spandsp-reconf libfreeswitch.la + clean-recusive: clean_core + install-recursive: install-libLTLIBRARIES install-binPROGRAMS + $(RECURSIVE_TARGETS): +@@ -586,10 +590,13 @@ speex-reconf: + + tiff-reconf: + cd libs/tiff-3.8.2 && autoreconf -fi +- cd libs/tiff-3.8.2 && sh ./configure.gnu ++ cd libs/tiff-3.8.2 && sh ./configure.gnu --host=$(GNU_TARGET_NAME) + cd libs/spandsp && autoreconf -fi +- cd libs/spandsp && sh ./configure.gnu +- make mod_voipcodecs-clean ++ cd libs/spandsp && sh ./configure.gnu --host=$(GNU_TARGET_NAME) --prefix=$(prefix) ++ cd libs/tiff-3.8.2 && $(MAKE) ++ ++spandsp-reconf: tiff-reconf ++ cd libs/spandsp && $(MAKE) + + python-reconf: + rm -f src/mod/languages/mod_python/Makefile +@@ -612,12 +619,6 @@ iks-reconf: + cd libs/iksemel && sh ./configure.gnu --prefix=$(prefix) + $(MAKE) mod_dingaling-clean + +-spandsp-reconf: +- cd libs/spandsp && $(MAKE) clean || echo +- cd libs/spandsp && autoreconf -fi +- cd libs/spandsp && sh ./configure.gnu --prefix=$(prefix) +- cd libs/spandsp && $(MAKE) +- + sofia-reconf: + cd libs/sofia-sip && sh ./autogen.sh + cd libs/sofia-sip && $(MAKE) clean diff --git a/net/freeswitch/patches/003-libs-esl-Makefile.patch b/net/freeswitch/patches/003-libs-esl-Makefile.patch new file mode 100644 index 0000000..c0034ec --- /dev/null +++ b/net/freeswitch/patches/003-libs-esl-Makefile.patch @@ -0,0 +1,22 @@ +--- a/libs/esl/Makefile ++++ b/libs/esl/Makefile +@@ -7,7 +7,7 @@ PICKY=-O2 + CFLAGS=$(BASE_FLAGS) $(PICKY) + CXXFLAGS=$(BASE_FLAGS) + MYLIB=libesl.a +-LIBS=-lncurses -lesl -lpthread -lm ++LIBS=-L$(STAGING_DIR)/usr/lib -lncurses -lesl -lpthread -lm + LDFLAGS=-L. + OBJS=src/esl.o src/esl_event.o src/esl_threadmutex.o src/esl_config.o src/esl_json.o src/esl_buffer.o + SRC=src/esl.c src/esl_json.c src/esl_event.c src/esl_threadmutex.c src/esl_config.c src/esl_oop.cpp src/esl_json.c src/esl_buffer.c +@@ -19,8 +19,8 @@ OBJS += src/esl_oop.o + all: $(MYLIB) fs_cli testclient testserver ivrd + + $(MYLIB): $(OBJS) $(HEADERS) $(SRC) +- ar rcs $(MYLIB) $(OBJS) +- ranlib $(MYLIB) ++ $(AR) rcs $(MYLIB) $(OBJS) ++ $(RANLIB) $(MYLIB) + + testserver: $(MYLIB) testserver.c + $(CC) $(CC_CFLAGS) $(CFLAGS) testserver.c -o testserver $(LDFLAGS) $(LIBS) diff --git a/net/freeswitch/patches/004-src-mod-applications-mod_mp4-mp4_helper_hpp.patch b/net/freeswitch/patches/004-src-mod-applications-mod_mp4-mp4_helper_hpp.patch new file mode 100644 index 0000000..ac81dd0 --- /dev/null +++ b/net/freeswitch/patches/004-src-mod-applications-mod_mp4-mp4_helper_hpp.patch @@ -0,0 +1,13 @@ +--- a/src/mod/applications/mod_mp4/mp4_helper.hpp ++++ b/src/mod/applications/mod_mp4/mp4_helper.hpp +@@ -22,8 +22,9 @@ the Initial Developer. All Rights Reserv + #ifndef MP4_HELPER_HPP_ + #define MP4_HELPER_HPP_ + ++#include ++#include + #include +-#include + #include + #include + diff --git a/net/freeswitch/patches/005-src-mod-codecs-mod_opus-Makefile.patch b/net/freeswitch/patches/005-src-mod-codecs-mod_opus-Makefile.patch new file mode 100644 index 0000000..94ba6f0 --- /dev/null +++ b/net/freeswitch/patches/005-src-mod-codecs-mod_opus-Makefile.patch @@ -0,0 +1,18 @@ +--- a/src/mod/codecs/mod_opus/Makefile ++++ b/src/mod/codecs/mod_opus/Makefile +@@ -13,13 +13,14 @@ SILK_LA=$(OPUS_BUILDDIR)/silk/libSKP_SIL + LOCAL_LIBADD=$(IETF_LA) $(CELT_LA) $(SILK_LA) -lm -lz + + include $(BASE)/build/modmake.rules ++include $(BASE)/build/openwrt_rules.mk + + $(OPUS_DIR): + $(GETLIB) $(OPUS).tar.gz + + $(OPUS_BUILDDIR)/Makefile: $(OPUS_DIR) + mkdir -p $(OPUS_BUILDDIR) +- cd $(OPUS_BUILDDIR) && $(DEFAULT_VARS) $(OPUS_DIR)/configure --disable-shared --with-pic --srcdir=$(OPUS_DIR) ++ cd $(OPUS_BUILDDIR) && $(DEFAULT_VARS) $(OPUS_DIR)/configure --host=$(GNU_TARGET_NAME) --disable-shared --with-pic --srcdir=$(OPUS_DIR) + $(TOUCH_TARGET) + + $(IETF_LA): $(OPUS_BUILDDIR)/Makefile diff --git a/net/freeswitch/patches/006-src-include-timerfd_wrap_h.patch b/net/freeswitch/patches/006-src-include-timerfd_wrap_h.patch new file mode 100644 index 0000000..dbf995e --- /dev/null +++ b/net/freeswitch/patches/006-src-include-timerfd_wrap_h.patch @@ -0,0 +1,27 @@ +--- a/src/include/timerfd_wrap.h ++++ b/src/include/timerfd_wrap.h +@@ -55,20 +55,12 @@ SWITCH_BEGIN_EXTERN_C + + + #ifndef __NR_timerfd +-#if defined(__x86_64__) +-#define __NR_timerfd_create 283 +-#define __NR_timerfd_settime 286 +-#define __NR_timerfd_gettime 287 +-#elif defined(__i386__) +-#define __NR_timerfd_create 322 +-#define __NR_timerfd_settime 325 +-#define __NR_timerfd_gettime 326 +-#else +-#error invalid system +-#endif ++#include + #endif + +-#define TFD_TIMER_ABSTIME (1 << 0) ++#ifndef TFD_TIMER_ABSTIME ++#include ++#endif + + int timerfd_create(int clockid, int flags) + { diff --git a/net/freeswitch/patches/007-src-mod-endpoints-mod_gsmopen-Makefile.patch b/net/freeswitch/patches/007-src-mod-endpoints-mod_gsmopen-Makefile.patch new file mode 100644 index 0000000..18a130d --- /dev/null +++ b/net/freeswitch/patches/007-src-mod-endpoints-mod_gsmopen-Makefile.patch @@ -0,0 +1,26 @@ +--- a/src/mod/endpoints/mod_gsmopen/Makefile ++++ b/src/mod/endpoints/mod_gsmopen/Makefile +@@ -1,9 +1,16 @@ ++BASE=../../../.. + MODNAME=mod_gsmopen + SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"' +-#LOCAL_CFLAGS += $(SVNDEF) -I/usr/src/gsmlib-1.10 +-LOCAL_CFLAGS += $(SVNDEF) -I../../../../libs/spandsp/src -I../../../..//libs/tiff-3.8.2/libtiff +-#LOCAL_LDFLAGS=-lasound -L/usr/src/gsmlib-1.10/gsmlib/.libs -lgsmme +-LOCAL_LDFLAGS=-L../../../../libs/spandsp/src -lasound -lgsmme -lspandsp +-LOCAL_OBJS=gsmopen_protocol.o +-#OUR_OBJS += /usr/src/gsmlib-1.10/gsmlib/libgsmme.la +-include ../../../../build/modmake.rules ++LOCAL_CFLAGS += $(SVNDEF) -I$(BASE)/libs/spandsp/src -I$(BASE)/libs/tiff-3.8.2/libtiff -fpermissive ++LOCAL_LDFLAGS=-L$(BASE)/libs/spandsp/src -lasound -lgsmme -lspandsp ++LOCAL_OBJS=gsmopen_protocol.o ++ ++include $(BASE)/build/modmake.rules ++ ++TIFF_DIR=$(switch_srcdir)/libs/tiff-3.8.2 ++TIFF_BUILDDIR=$(switch_builddir)/libs/tiff-3.8.2 ++TIFF_LA=$(TIFF_BUILDDIR)/libtiff/libtiff.la ++ ++SPANDSP_DIR=$(switch_srcdir)/libs/spandsp ++SPANDSP_BUILDDIR=$(switch_builddir)/libs/spandsp ++SPANDSP_LA=$(SPANDSP_BUILDDIR)/src/libspandsp.la diff --git a/net/freeswitch/patches/008-src-mod-event_handlers-mod_snmp-Makefile.patch b/net/freeswitch/patches/008-src-mod-event_handlers-mod_snmp-Makefile.patch new file mode 100644 index 0000000..c85f62c --- /dev/null +++ b/net/freeswitch/patches/008-src-mod-event_handlers-mod_snmp-Makefile.patch @@ -0,0 +1,16 @@ +--- a/src/mod/event_handlers/mod_snmp/Makefile ++++ b/src/mod/event_handlers/mod_snmp/Makefile +@@ -1,7 +1,10 @@ +-include ../../../../build/modmake.rules ++BASE=../../../.. ++ ++include $(BASE)/build/modmake.rules ++include $(BASE)/build/openwrt_rules.mk ++ ++LOCAL_CFLAGS=$(shell $(STAGING_DIR)/host/bin/net-snmp-config --cflags --agent-libs) -DNETSNMP_NO_INLINE + +-LOCAL_CFLAGS=`net-snmp-config --cflags` +-LOCAL_LDFLAGS=`net-snmp-config --agent-libs` + LOCAL_OBJS=subagent.o + + local_depend: $(LOCAL_OBJS) diff --git a/net/freeswitch/patches/009-src-mod-codecs-mod_silk-Makefile.patch b/net/freeswitch/patches/009-src-mod-codecs-mod_silk-Makefile.patch new file mode 100644 index 0000000..53c9705 --- /dev/null +++ b/net/freeswitch/patches/009-src-mod-codecs-mod_silk-Makefile.patch @@ -0,0 +1,15 @@ +--- a/src/mod/codecs/mod_silk/Makefile ++++ b/src/mod/codecs/mod_silk/Makefile +@@ -1,4 +1,5 @@ + BASE=../../../.. ++include $(BASE)/build/openwrt_rules.mk + SILK_DIR=$(switch_srcdir)/libs/silk + SILK_BUILDDIR=$(switch_builddir)/libs/silk + LOCAL_CFLAGS=-I$(SILK_DIR)/src -I$(SILK_DIR)/interface +@@ -7,5 +8,5 @@ LOCAL_LIBADD=$(SILK_LA) + include $(BASE)/build/modmake.rules + + $(SILK_LA): $(SILK_DIR)/.update +- cd $(SILK_BUILDDIR) && ./configure --disable-shared && make clean && $(MAKE) ++ cd $(SILK_BUILDDIR) && ./configure --host=$(GNU_TARGET_NAME) --disable-shared && make clean && $(MAKE) + $(TOUCH_TARGET) diff --git a/net/freeswitch/patches/010-ppc_asm.patch b/net/freeswitch/patches/010-ppc_asm.patch new file mode 100644 index 0000000..05db2d1 --- /dev/null +++ b/net/freeswitch/patches/010-ppc_asm.patch @@ -0,0 +1,13 @@ +Index: freeswitch-1.0.7/libs/spandsp/src/spandsp/fast_convert.h +=================================================================== +--- freeswitch-1.0.7.orig/libs/spandsp/src/spandsp/fast_convert.h 2012-08-14 19:52:20.000000000 +0200 ++++ freeswitch-1.0.7/libs/spandsp/src/spandsp/fast_convert.h 2012-08-14 19:53:01.000000000 +0200 +@@ -195,7 +195,7 @@ + { + return (long int) (x); + } +-#elif defined(__ppc__) || defined(__powerpc__) ++#elif 0 /* defined(__ppc__) || defined(__powerpc__) */ + static __inline__ long int lfastrint(register double x) + { + int res[2]; diff --git a/net/frickin/Makefile b/net/frickin/Makefile new file mode 100644 index 0000000..b5220fd --- /dev/null +++ b/net/frickin/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2006-2012 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:=frickin +PKG_VERSION:=1.3 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/frickin +PKG_MD5SUM:=5b2e98da2310c71c703d4617b88a173f + +include $(INCLUDE_DIR)/package.mk + +define Package/frickin + SECTION:=net + CATEGORY:=Network + TITLE:=PPTP (Point-to-Point Tunneling Protocol) proxy + URL:=http://sourceforge.net/projects/frickin/ + SUBMENU:=VPN +endef + +define Package/frickin/description + Frickin PPTP Proxy allows a Point-to-Point Tunneling Protocol (PPTP) + client to connect to a PPTP server through Network Address + Translation (NAT). +endef + +define Build/Configure + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + all +endef + +define Package/frickin/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/frickin.config $(1)/etc/config/frickin + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/frickin.init $(1)/etc/init.d/frickin + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/frickin $(1)/usr/sbin/ +endef + +define Package/frickin/conffiles +/etc/config/frickin +endef + +$(eval $(call BuildPackage,frickin)) diff --git a/net/frickin/files/frickin.config b/net/frickin/files/frickin.config new file mode 100644 index 0000000..32141cd --- /dev/null +++ b/net/frickin/files/frickin.config @@ -0,0 +1,13 @@ +package 'frickin' + +config 'frickin' + option enabled 0 + + # listen on the specified IP address + option listen_ip '192.168.1.1' + + # connect to the specified IP address + option server_ip '192.168.1.253' + + # set the maximum number of simultaneous connections +# option conn_limit 20 diff --git a/net/frickin/files/frickin.init b/net/frickin/files/frickin.init new file mode 100644 index 0000000..7f96acf --- /dev/null +++ b/net/frickin/files/frickin.init @@ -0,0 +1,58 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2012 OpenWrt.org + +START=50 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +append_string() { + local var="$1" + local section="$2" + local option="$3" + local val="$4" + local _val + config_get _val "$section" "$option" + [ -n "$_val" ] && append "$var" "$val $_val" +} + +section_enabled() { + local enabled + config_get_bool enabled "$1" 'enabled' 0 + [ $enabled -gt 0 ] +} + +start_instance() { + local section="$1" + local args + + section_enabled "$section" || return 1 + + append_string args "$section" 'listen_ip' '-l' + append_string args "$section" 'server_ip' '-s' + append_string args "$section" 'conn_limit' '-c' + + SERVICE_PID_FILE="/var/run/frickin-${section}.pid" + service_start /usr/sbin/frickin $args +} + +stop_instance() { + local section="$1" + local id + local if + + section_enabled "$section" || return 1 + + SERVICE_PID_FILE="/var/run/frickin-${section}.pid" + service_stop /usr/sbin/frickin +} + +start() { + config_load 'frickin' + config_foreach start_instance 'frickin' +} + +stop() { + config_load 'frickin' + config_foreach stop_instance 'frickin' +} diff --git a/net/fwknop/Makefile b/net/fwknop/Makefile new file mode 100644 index 0000000..24d7385 --- /dev/null +++ b/net/fwknop/Makefile @@ -0,0 +1,119 @@ +# +# Copyright (C) 2011-2012 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:=fwknop +PKG_VERSION:=2.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.cipherdyne.org/fwknop/download +PKG_MD5SUM:=96de4c5a4ae75a8618ef80269c6a70ad + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/fwknop/Default + TITLE:=FireWall KNock OPerator + URL:=http://www.cipherdyne.org/fwknop/ + MAINTAINER:=Jonathan Bennett +endef + +define Package/fwknop/Default/description + Fwknop implements an authorization scheme known as Single Packet Authorization + (SPA) for Linux systems running iptables. This mechanism requires only a + single encrypted and non-replayed packet to communicate various pieces of + information including desired access through an iptables policy. The main + application of this program is to use iptables in a default-drop stance to + protect services such as SSH with an additional layer of security in order to + make the exploitation of vulnerabilities (both 0-day and unpatched code) much + more difficult. +endef + +define Package/fwknopd + $(call Package/fwknop/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=Firewall + TITLE+= Daemon + DEPENDS:=+iptables +libfko +libpcap +endef + +define Package/fwknopd/description + $(call Package/fwknop/Default/description) + This package contains the fwknop daemon. +endef + +define Package/fwknopd/conffiles +/etc/fwknop/access.conf +/etc/fwknop/fwknopd.conf +endef + +define Package/fwknop + $(call Package/fwknop/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=Firewall + TITLE+= Client + DEPENDS:=+libfko +endef + +define Package/fwknop/description + $(call Package/fwknop/Default/description) + This package contains the fwknop client. +endef + +define Package/libfko + $(call Package/fwknop/Default) + SECTION:=libs + CATEGORY:=Libraries + SUBMENU:=Firewall + TITLE+= Library +endef + +define Package/libfko/description + $(call Package/fwknop/Default/description) + This package contains the libfko shared library. +endef + +CONFIGURE_ARGS += \ + --without-gpgme \ + --with-iptables=/usr/sbin/iptables + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/fko.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfko.{a,la,so*} $(1)/usr/lib/ +endef + +define Package/fwknopd/install + $(INSTALL_DIR) $(1)/etc/fwknop + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/fwknop/{access,fwknopd}.conf \ + $(1)/etc/fwknop/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/extras/fwknop.init.openwrt \ + $(1)/etc/init.d/fwknopd + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fwknopd $(1)/usr/sbin/ +endef + +define Package/fwknop/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fwknop $(1)/usr/bin/ +endef + +define Package/libfko/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfko.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,fwknopd)) +$(eval $(call BuildPackage,fwknop)) +$(eval $(call BuildPackage,libfko)) diff --git a/net/fwknop/patches/001-fix_config.patch b/net/fwknop/patches/001-fix_config.patch new file mode 100644 index 0000000..5ae4a94 --- /dev/null +++ b/net/fwknop/patches/001-fix_config.patch @@ -0,0 +1,32 @@ +--- a/server/fwknopd.conf ++++ b/server/fwknopd.conf +@@ -29,7 +29,12 @@ + # Define the ethernet interface on which we will sniff packets. + # Default if not set is eth0. + # +-#PCAP_INTF eth0; ++ ++# The following line is changed specifically for Openwrt. ++# Openwrt defaults to using eth1 as its wan port. If using PPPoE, ++# Then this needs to be set to pppoe-wan. ++ ++PCAP_INTF eth1; + + # By default fwknopd does not put the pcap interface into promiscuous mode. + # Set this to 'Y' to enable promiscuous sniffing. +@@ -252,8 +257,13 @@ + # The IPT_FORWARD_ACCESS variable is only used if ENABLE_IPT_FORWARDING is + # enabled. + # +-#IPT_FORWARD_ACCESS ACCEPT, filter, FORWARD, 1, FWKNOP_FORWARD, 1; +-#IPT_DNAT_ACCESS DNAT, nat, PREROUTING, 1, FWKNOP_PREROUTING, 1; ++ ++# These two lines are changed specifically for Openwrt, due to ++# different naming conventions. IPT_FORWARD is still disabled ++# by default, and must be enabled earlier in this file to be used. ++ ++IPT_FORWARD_ACCESS ACCEPT, filter, zone_wan_forward, 1, FWKNOP_FORWARD, 1; ++IPT_DNAT_ACCESS DNAT, nat, zone_wan_prerouting, 1, FWKNOP_PREROUTING, 1; + + # The IPT_SNAT_ACCESS variable is not used unless both ENABLE_IPT_SNAT and + # ENABLE_IPT_FORWARDING are enabled. Also, the external static IP must be diff --git a/net/fwknop/patches/002-fix_init.patch b/net/fwknop/patches/002-fix_init.patch new file mode 100644 index 0000000..9efda57 --- /dev/null +++ b/net/fwknop/patches/002-fix_init.patch @@ -0,0 +1,17 @@ +--- a/extras/openwrt/package/fwknop/files/fwknopd.init ++++ b/extras/openwrt/package/fwknop/files/fwknopd.init +@@ -8,12 +8,12 @@ FWKNOPD_BIN=/usr/sbin/fwknopd + + start() + { +- $FWKNOPD_BIN ++ service_start $FWKNOPD_BIN + } + + stop() + { +- $FWKNOPD_BIN -K ++ service_stop $FWKNOPD_BIN -K + } + + restart() diff --git a/net/gatling/Makefile b/net/gatling/Makefile new file mode 100644 index 0000000..cd395f7 --- /dev/null +++ b/net/gatling/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=gatling +PKG_VERSION:=0.11 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://dl.fefe.de +PKG_MD5SUM:=a0fb49ccb6b910bdbd7e76a9960394e3 + +include $(INCLUDE_DIR)/nls.mk +include $(INCLUDE_DIR)/package.mk + +define Package/gatling + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web + TITLE:=gatling - a high performance web server + VERSION:=$(PKG_VERSION)-$(PKG_RELEASE) + URL:=http://www.fefe.de/gatling/ + DEPENDS:=$(ICONV_DEPENDS) +zlib +libowfat +libopenssl +endef + +TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/libowfat \ + -I$(ICONV_PREFIX)/include + +TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib \ + -L$(ICONV_PREFIX)/lib \ + -Wl,-Bdynamic,$(LIBGCC_S) + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/gatling $(1)/bin +endef + +$(eval $(call BuildPackage,gatling)) diff --git a/net/gatling/patches/001-fix_ld_libs.patch b/net/gatling/patches/001-fix_ld_libs.patch new file mode 100644 index 0000000..3112f9f --- /dev/null +++ b/net/gatling/patches/001-fix_ld_libs.patch @@ -0,0 +1,11 @@ +--- gatling-0.11/GNUmakefile 2010-02-09 21:49:18.448989774 +0000 ++++ gatling-0.11_new/GNUmakefile 2010-02-09 21:52:44.821469886 +0000 +@@ -151,7 +151,7 @@ + ar q $@ dummy.o + -ranlib $@ + +-LDLIBS+=`cat libsocket libiconv libcrypt` ++LDLIBS+=-lcrypto -liconv -lcrypt + + $(TARGETS): libsocketkludge.a libsocket libiconv libcrypt md5lib + diff --git a/net/gatling/patches/002-fix_flags.patch b/net/gatling/patches/002-fix_flags.patch new file mode 100644 index 0000000..b956664 --- /dev/null +++ b/net/gatling/patches/002-fix_flags.patch @@ -0,0 +1,14 @@ +diff -ruN gatling-0.11/GNUmakefile gatling-0.11_new/GNUmakefile +--- gatling-0.11/GNUmakefile 2008-12-05 12:31:01.000000000 +0000 ++++ gatling-0.11_new/GNUmakefile 2010-02-05 23:33:08.242872096 +0000 +@@ -16,8 +16,8 @@ + CROSS= + #CROSS=i686-mingw32- + CC=$(CROSS)gcc +-CFLAGS=-pipe -Wall +-LDFLAGS= ++CFLAGS+=-pipe -Wall ++LDFLAGS+= + + path = $(subst :, ,$(PATH)) + diet_path = $(foreach dir,$(path),$(wildcard $(dir)/diet)) diff --git a/net/gatling/patches/010-add_semicolon.patch b/net/gatling/patches/010-add_semicolon.patch new file mode 100644 index 0000000..cbc943c --- /dev/null +++ b/net/gatling/patches/010-add_semicolon.patch @@ -0,0 +1,11 @@ +--- gatling-0.11/acc.c 2010-02-05 23:47:29.252861541 +0000 ++++ gatling-0.11_new/acc.c 2010-02-05 23:47:54.025348536 +0000 +@@ -47,7 +47,7 @@ + #if defined(__i386__) || defined(__x86_64__) + return a[0]==b[0] && a[1]==b[1] && a[2]==b[2]; + #else +- return ((*(uint32_t*)a ^ *(uint32_t*)b) & 0xffffff) == 0 ++ return ((*(uint32_t*)a ^ *(uint32_t*)b) & 0xffffff) == 0; + #endif + } + diff --git a/net/gesftpserver/Makefile b/net/gesftpserver/Makefile new file mode 100644 index 0000000..eb5b830 --- /dev/null +++ b/net/gesftpserver/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sftpserver +PKG_REV:=228 +PKG_VERSION:=r$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.greenend.org.uk/rjk/bzr/sftpserver.dev +PKG_SOURCE_PROTO:=bzr +PKG_SOURCE_SUBDIR:=$(PKG_NAME) +PKG_SOURCE_VERSION:=$(PKG_REV) + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/gesftpserver + SECTION:=net + CATEGORY:=Network + SUBMENU:=SSH + DEPENDS:=+libpthread $(ICONV_DEPENDS) + TITLE:=SFTP server + URL:=http://www.greenend.org.uk/rjk/sftpserver/ +endef + +define Package/gesftpserver/description +This is an experimental free SFTP server. It is currently still under development +(so don't trust it with critical data). It should be possible to use it as a +drop-in replacement for the widely-used OpenSSH SFTP server. It does not include +an SSH server, but rather runs as a subsystem of one. +endef + +CONFIGURE_CMD:=./prepare + +TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components 1 $(TAR_OPTIONS) + +TARGET_LDFLAGS+=-lpthread + +define Package/gesftpserver/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gesftpserver $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,gesftpserver)) diff --git a/net/git/Makefile b/net/git/Makefile new file mode 100644 index 0000000..3373941 --- /dev/null +++ b/net/git/Makefile @@ -0,0 +1,70 @@ +# +# Copyright (C) 2009-2012 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:=git +PKG_VERSION:=1.7.11.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://git-core.googlecode.com/files/ +PKG_MD5SUM:=91e01a22032f5d0ca2941ae7fd49d587 + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/git + SECTION:=net + CATEGORY:=Network + SUBMENU:=Version Control Systems + DEPENDS:=+libopenssl +libpthread + TITLE:=The fast version control system + URL:=http://git-scm.com +endef + +define Package/git/description + Git is a free & open source, distributed version control system + designed to handle everything from small to very large projects + with speed and efficiency. +endef + +MAKE_FLAGS := \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + NO_CURL="YesPlease" \ + NO_EXPAT="YesPlease" \ + NO_MKSTEMPS="YesPlease" \ + NO_GETTEXT="YesPlease" \ + NO_UNIX_SOCKETS="YesPlease" \ + NO_IPV6="YesPlease" \ + NO_ICONV="YesPlease" \ + NO_NSEC="YesPlease" \ + NO_PERL="YesPlease" \ + NO_PYTHON="YesPlease" \ + NO_TCLTK="YesPlease" + +define Build/Configure + $(MAKE) -C $(PKG_BUILD_DIR) \ + configure + + ( cd $(PKG_BUILD_DIR); \ + ./configure --prefix=/usr \ + ); +endef + +define Package/git/install + $(INSTALL_DIR) $(1) + $(RM) $(PKG_INSTALL_DIR)/usr/bin/git-cvsserver + $(CP) $(PKG_INSTALL_DIR)/* $(1)/ +endef + +$(eval $(call BuildPackage,git)) diff --git a/net/git/patches/100-convert_builtin.patch b/net/git/patches/100-convert_builtin.patch new file mode 100644 index 0000000..21a6a72 --- /dev/null +++ b/net/git/patches/100-convert_builtin.patch @@ -0,0 +1,248 @@ +--- /dev/null ++++ b/builtin/daemon.c +@@ -0,0 +1 @@ ++#include "../daemon.c" +--- /dev/null ++++ b/builtin/fast-import.c +@@ -0,0 +1 @@ ++#include "../fast-import.c" +--- /dev/null ++++ b/builtin/http-backend.c +@@ -0,0 +1 @@ ++#include "../http-backend.c" +--- /dev/null ++++ b/builtin/imap-send.c +@@ -0,0 +1 @@ ++#include "../imap-send.c" +--- /dev/null ++++ b/builtin/shell.c +@@ -0,0 +1 @@ ++#include "../shell.c" +--- /dev/null ++++ b/builtin/upload-pack.c +@@ -0,0 +1 @@ ++#include "../upload-pack.c" +--- a/builtin.h ++++ b/builtin.h +@@ -153,5 +153,11 @@ extern int cmd_verify_pack(int argc, con + extern int cmd_show_ref(int argc, const char **argv, const char *prefix); + extern int cmd_pack_refs(int argc, const char **argv, const char *prefix); + extern int cmd_replace(int argc, const char **argv, const char *prefix); ++extern int cmd_daemon(int argc, char **argv, const char *prefix); ++extern int cmd_fast_import(int argc, const char **argv, const char *prefix); ++extern int cmd_http_backend(int argc, char **argv, const char *prefix); ++extern int cmd_imap_send(int argc, char **argv, const char *prefix); ++extern int cmd_shell(int argc, char **argv, const char *prefix); ++extern int cmd_upload_pack(int argc, char **argv, const char *prefix); + + #endif +--- a/daemon.c ++++ b/daemon.c +@@ -1091,7 +1091,7 @@ static int serve(struct string_list *lis + return service_loop(&socklist); + } + +-int main(int argc, char **argv) ++int cmd_daemon(int argc, char **argv, const char *prefix) + { + int listen_port = 0; + struct string_list listen_addr = STRING_LIST_INIT_NODUP; +--- a/fast-import.c ++++ b/fast-import.c +@@ -3347,7 +3347,7 @@ static void parse_argv(void) + read_marks(); + } + +-int main(int argc, const char **argv) ++int cmd_fast_import(int argc, const char **argv, const char *prefix) + { + unsigned int i; + +--- a/http-backend.c ++++ b/http-backend.c +@@ -533,7 +533,7 @@ static struct service_cmd { + {"POST", "/git-receive-pack$", service_rpc} + }; + +-int main(int argc, char **argv) ++int cmd_http_backend(int argc, char **argv, const char *prefix) + { + char *method = getenv("REQUEST_METHOD"); + char *dir; +--- a/imap-send.c ++++ b/imap-send.c +@@ -1502,7 +1502,7 @@ static int git_imap_config(const char *k + return 0; + } + +-int main(int argc, char **argv) ++int cmd_imap_send(int argc, char **argv, const char *prefix) + { + struct msg_data all_msgs, msg; + struct store *ctx = NULL; +--- a/shell.c ++++ b/shell.c +@@ -129,7 +129,7 @@ static struct commands { + { NULL }, + }; + +-int main(int argc, char **argv) ++int cmd_shell(int argc, char **argv, const char *prefix) + { + char *prog; + const char **user_argv; +--- a/upload-pack.c ++++ b/upload-pack.c +@@ -785,7 +785,7 @@ static void upload_pack(void) + } + } + +-int main(int argc, char **argv) ++int cmd_upload_pack(int argc, char **argv, const char *prefix) + { + char *dir; + int i; +--- a/git.c ++++ b/git.c +@@ -269,11 +269,11 @@ const char git_version_string[] = GIT_VE + + struct cmd_struct { + const char *cmd; +- int (*fn)(int, const char **, const char *); ++ int (*fn)(int, char **, const char *); + int option; + }; + +-static int run_builtin(struct cmd_struct *p, int argc, const char **argv) ++static int run_builtin(struct cmd_struct *p, int argc, char **argv) + { + int status, help; + struct stat st; +@@ -326,7 +326,7 @@ static int run_builtin(struct cmd_struct + return 0; + } + +-static void handle_internal_command(int argc, const char **argv) ++static void handle_internal_command(int argc, char **argv) + { + const char *cmd = argv[0]; + static struct cmd_struct commands[] = { +@@ -353,12 +353,14 @@ static void handle_internal_command(int + { "commit-tree", cmd_commit_tree, RUN_SETUP }, + { "config", cmd_config, RUN_SETUP_GENTLY }, + { "count-objects", cmd_count_objects, RUN_SETUP }, ++ { "daemon", cmd_daemon }, + { "describe", cmd_describe, RUN_SETUP }, + { "diff", cmd_diff }, + { "diff-files", cmd_diff_files, RUN_SETUP | NEED_WORK_TREE }, + { "diff-index", cmd_diff_index, RUN_SETUP }, + { "diff-tree", cmd_diff_tree, RUN_SETUP }, + { "fast-export", cmd_fast_export, RUN_SETUP }, ++ { "fast-import", cmd_fast_import }, + { "fetch", cmd_fetch, RUN_SETUP }, + { "fetch-pack", cmd_fetch_pack, RUN_SETUP }, + { "fmt-merge-msg", cmd_fmt_merge_msg, RUN_SETUP }, +@@ -371,6 +373,8 @@ static void handle_internal_command(int + { "grep", cmd_grep, RUN_SETUP_GENTLY }, + { "hash-object", cmd_hash_object }, + { "help", cmd_help }, ++ { "http-backend", cmd_http_backend }, ++ { "imap-send", cmd_imap_send }, + { "index-pack", cmd_index_pack, RUN_SETUP_GENTLY }, + { "init", cmd_init_db }, + { "init-db", cmd_init_db }, +@@ -419,6 +423,7 @@ static void handle_internal_command(int + { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE }, + { "rm", cmd_rm, RUN_SETUP }, + { "send-pack", cmd_send_pack, RUN_SETUP }, ++ { "shell", cmd_shell }, + { "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER }, + { "show", cmd_show, RUN_SETUP }, + { "show-branch", cmd_show_branch, RUN_SETUP }, +@@ -436,6 +441,7 @@ static void handle_internal_command(int + { "update-server-info", cmd_update_server_info, RUN_SETUP }, + { "upload-archive", cmd_upload_archive }, + { "upload-archive--writer", cmd_upload_archive_writer }, ++ { "upload-pack", cmd_upload_pack }, + { "var", cmd_var, RUN_SETUP_GENTLY }, + { "verify-pack", cmd_verify_pack }, + { "verify-tag", cmd_verify_tag, RUN_SETUP }, +--- a/Makefile ++++ b/Makefile +@@ -467,15 +467,7 @@ EXTRA_PROGRAMS = + # ... and all the rest that could be moved out of bindir to gitexecdir + PROGRAMS += $(EXTRA_PROGRAMS) + +-PROGRAM_OBJS += credential-store.o +-PROGRAM_OBJS += daemon.o +-PROGRAM_OBJS += fast-import.o +-PROGRAM_OBJS += http-backend.o +-PROGRAM_OBJS += imap-send.o +-PROGRAM_OBJS += sh-i18n--envsubst.o +-PROGRAM_OBJS += shell.o +-PROGRAM_OBJS += show-index.o +-PROGRAM_OBJS += upload-pack.o ++PROGRAM_OBJS = + + # Binary suffix, set to .exe for Windows builds + X = +@@ -903,6 +895,12 @@ BUILTIN_OBJS += builtin/var.o + BUILTIN_OBJS += builtin/verify-pack.o + BUILTIN_OBJS += builtin/verify-tag.o + BUILTIN_OBJS += builtin/write-tree.o ++BUILTIN_OBJS += builtin/daemon.o ++BUILTIN_OBJS += builtin/fast-import.o ++BUILTIN_OBJS += builtin/http-backend.o ++BUILTIN_OBJS += builtin/imap-send.o ++BUILTIN_OBJS += builtin/shell.o ++BUILTIN_OBJS += builtin/upload-pack.o + + GITLIBS = $(LIB_FILE) $(XDIFF_LIB) + EXTLIBS = +@@ -1502,7 +1500,7 @@ endif + EXTLIBS += -lz + + ifndef NO_OPENSSL +- OPENSSL_LIBSSL = -lssl ++ EXTLIBS += -lssl + ifdef OPENSSLDIR + BASIC_CFLAGS += -I$(OPENSSLDIR)/include + OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib) +@@ -2287,10 +2285,6 @@ endif + git-%$X: %.o GIT-LDFLAGS $(GITLIBS) + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) + +-git-imap-send$X: imap-send.o GIT-LDFLAGS $(GITLIBS) +- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ +- $(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO) +- + git-http-fetch$X: revision.o http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS) + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ + $(LIBS) $(CURL_LIBCURL) +@@ -2587,24 +2581,22 @@ endif + bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \ + execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \ + { test "$$bindir/" = "$$execdir/" || \ +- for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \ ++ for p in $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \ + $(RM) "$$execdir/$$p" && \ + test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \ +- ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \ ++ ln -s git "$$execdir/$$p" 2>/dev/null || \ + cp "$$bindir/$$p" "$$execdir/$$p" || exit; \ + done; \ + } && \ + for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \ + $(RM) "$$bindir/$$p" && \ + test -z "$(NO_INSTALL_HARDLINKS)" && \ +- ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \ + ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \ + cp "$$bindir/git$X" "$$bindir/$$p" || exit; \ + done && \ + for p in $(BUILT_INS); do \ + $(RM) "$$execdir/$$p" && \ + test -z "$(NO_INSTALL_HARDLINKS)" && \ +- ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \ + ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \ + cp "$$execdir/git$X" "$$execdir/$$p" || exit; \ + done && \ diff --git a/net/gpsd/Makefile b/net/gpsd/Makefile new file mode 100644 index 0000000..ca4983a --- /dev/null +++ b/net/gpsd/Makefile @@ -0,0 +1,159 @@ +# +# Copyright (C) 2006-2012 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:=gpsd +PKG_VERSION:=3.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download-mirror.savannah.gnu.org/releases/gpsd +PKG_MD5SUM:=52d9785eaf1a51298bb8900dbde88f98 + +PKG_BUILD_DEPENDS:=libncurses libusb-1.0 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/scons.mk + +define Package/gpsd/Default + DEPENDS:=+librt + URL:=http://catb.org/gpsd/ +endef + +define Package/gpsd/Default/description + gpsd is a userland daemon acting as a translator between GPS and AIS receivers + and their clients. gpsd listens on port 2947 for clients requesting + position/time/velocity information. The receivers are expected to generate + position information in a well-known format -- as NMEA-0183 sentences, SiRF + binary, Rockwell binary, Garmin binary format, or other vendor binary + protocols. gpsd takes this information from the GPS and translates it into + something uniform and easier to understand for clients. +endef + +define Package/gpsd + $(call Package/gpsd/Default) + SECTION:=net + CATEGORY:=Network + DEPENDS+= +libgps +libgpsd + TITLE:=An interface daemon for GPS receivers +endef + +define Package/gpsd/conffiles +/etc/config/gpsd +endef + +define Package/gpsd/description + $(call Package/gpsd/Default/description) + This package contains the GPS daemon. +endef + +define Package/gpsd-clients + $(call Package/gpsd/Default) + SECTION:=net + CATEGORY:=Network + DEPENDS+= +libgps +libgpsd +libncurses + TITLE:=GPS tools and clients +endef + +define Package/gpsd-clients/description + $(call Package/gpsd/Default/description) + This package contains auxiliary tools and example clients for monitoring and + testing the GPS daemon. +endef + +define Package/libgps + $(call Package/gpsd/Default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS+= +libcap + TITLE:=C service library for communicating with the GPS daemon +endef + +define Package/libgps/description + $(call Package/gpsd/Default/description) + This package contains the libgps library. +endef + +define Package/libgpsd + $(call Package/gpsd/Default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS+= +libcap +libusb-1.0 + TITLE:=C service library for GPS applications +endef + +define Package/libgpsd/description + $(call Package/gpsd/Default/description) + This package contains the libgpsd library. +endef + +SCONS_OPTIONS += \ + dbus_export=no \ + tsip=no \ + fv18=no \ + tripmate=no \ + earthmate=no \ + itrax=no \ + navcom=no \ + ubx=no \ + evermore=no \ + ntrip=no \ + libgpsmm=no \ + libQgpsmm=no \ + bluez=no \ + strip=no \ + python=no \ + implicit_link=no \ + chrpath=no + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/gps.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgps*.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgps*.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/gpsd/install + $(INSTALL_DIR) $(1)/etc/config + $(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 + +define Package/gpsd-clients/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/cgps \ + $(PKG_INSTALL_DIR)/usr/bin/gps{ctl,decode,mon,pipe} \ + $(PKG_INSTALL_DIR)/usr/bin/gpxlogger \ + $(PKG_INSTALL_DIR)/usr/bin/lcdgps \ + $(1)/usr/bin/ +endef + +define Package/libgps/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgps.so.* $(1)/usr/lib/ +endef + +define Package/libgpsd/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpsd.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,gpsd)) +$(eval $(call BuildPackage,gpsd-clients)) +$(eval $(call BuildPackage,libgps)) +$(eval $(call BuildPackage,libgpsd)) diff --git a/net/gpsd/files/gpsd.config b/net/gpsd/files/gpsd.config new file mode 100644 index 0000000..ef19202 --- /dev/null +++ b/net/gpsd/files/gpsd.config @@ -0,0 +1,5 @@ +config gpsd core + option device "/dev/ttyUSB0" + option port "2947" + option listen_globally "false" + option enabled "true" diff --git a/net/gpsd/files/gpsd.hotplug b/net/gpsd/files/gpsd.hotplug new file mode 100644 index 0000000..fc15dda --- /dev/null +++ b/net/gpsd/files/gpsd.hotplug @@ -0,0 +1,16 @@ +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/net/gpsd/files/gpsd.init b/net/gpsd/files/gpsd.init new file mode 100644 index 0000000..96cee78 --- /dev/null +++ b/net/gpsd/files/gpsd.init @@ -0,0 +1,32 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2011 OpenWrt.org +START=50 + +NAME=gpsd +PIDF=/var/run/$NAME.pid +PROG=/usr/sbin/$NAME + +start() { + config_load gpsd + config_get device core device + config_get port core port + config_get_bool listen_globally core listen_globally + config_get_bool enabled core enabled + [ "$enabled" != "1" ] && exit + logger -t "$NAME" "Starting..." + [ ! -c "$device" ] && { + logger -t "$NAME" "Unable to find device $device. Exiting." + exit 1 + } + [ "$listen_globally" != "0" ] && append args "-G" + $PROG -n -P $PIDF -S $port $args $device +} + +stop() { + logger -t "$NAME" "Stopping..." + [ -f "$PIDF" ] && { + read PID < "$PIDF" + kill -9 $PID + rm $PIDF + } +} diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile new file mode 100644 index 0000000..e092817 --- /dev/null +++ b/net/haproxy/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2010-2011 OpenWrt.org +# Copyright (C) 2009-2010 Thomas Heil +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=haproxy +PKG_VERSION:=1.4.22 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.4/src +PKG_MD5SUM:=a0b007c76f6a78524f3b3dd5e704979c + +include $(INCLUDE_DIR)/package.mk + +define Package/haproxy + SUBMENU:=Web Servers/Proxies + SECTION:=net + CATEGORY:=Network + TITLE:=The Reliable, High Performance TCP/HTTP Load Balancer + URL:=http://haproxy.1wt.eu/ + DEPENDS:=+libpcre +libltdl + MAINTAINER:=Thomas Heil +endef + +define Package/haproxy/conffiles +/etc/haproxy.cfg +endef + +define Package/haproxy/description + Open source High Performance TCP/HTTP Load Balancer +endef + +define Build/Compile + $(MAKE) TARGET=linux26 -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + LD="$(TARGET_CC)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=8192 -DSYSTEM_MAXCONN=65530" USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 \ + all install +endef + +define Package/haproxy/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/haproxy $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/haproxy.cfg $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/haproxy.init $(1)/etc/init.d/haproxy + $(INSTALL_DIR) $(1)/etc/hotplug.d/net + $(INSTALL_BIN) ./files/haproxy.hotplug $(1)/etc/hotplug.d/net/90-haproxy +endef + +$(eval $(call BuildPackage,haproxy)) diff --git a/net/haproxy/files/haproxy.cfg b/net/haproxy/files/haproxy.cfg new file mode 100644 index 0000000..a54f5f5 --- /dev/null +++ b/net/haproxy/files/haproxy.cfg @@ -0,0 +1,100 @@ +# Example configuration file for HAProxy 1.3, refer to the url below for +# a full documentation and examples for configuration: +# http://haproxy.1wt.eu/download/1.3/doc/configuration.txt + + +# Global parameters +global + + # Log events to a remote syslog server at given address using the + # specified facility and verbosity level. Multiple log options + # are allowed. + #log 10.0.0.1 daemon info + + # Specifiy the maximum number of allowed connections. + maxconn 32000 + + # Raise the ulimit for the maximum allowed number of open socket + # descriptors per process. This is usually at least twice the + # number of allowed connections (maxconn * 2 + nb_servers + 1) . + ulimit-n 65535 + + # Drop privileges (setuid, setgid), default is "root" on OpenWrt. + uid 0 + gid 0 + + # Perform chroot into the specified directory. + #chroot /var/run/haproxy/ + + # Daemonize on startup + daemon + + nosplice + # Enable debugging + #debug + + # Spawn given number of processes and distribute load among them, + # used for multi-core environments or to circumvent per-process + # limits like number of open file descriptors. Default is 1. + #nbproc 2 + + +# Example HTTP proxy listener +listen my_http_proxy + + # Bind to port 81 and 444 on all interfaces (0.0.0.0) + bind :81,:444 + + # We're proxying HTTP here... + mode http + + # Simple HTTP round robin over two servers using the specified + # source ip 192.168.1.1 . + balance roundrobin + server server01 192.168.1.10:80 source 192.168.1.1 + server server02 192.168.1.20:80 source 192.168.1.1 + + # Serve an internal statistics page on /stats: + stats enable + stats uri /stats + + # Enable HTTP basic auth for the statistics: + stats realm HA_Stats + stats auth username:password + + +# Example SMTP proxy listener +listen my_smtp_proxy + + # Disable this instance without commenting out the section. + disabled + + # Bind to port 26 and 588 on localhost + bind 127.0.0.1:26,127.0.0.1:588 + + # This is a TCP proxy + mode tcp + + # Round robin load balancing over two servers on port 123 forcing + # the address 192.168.1.1 and port 25 as source. + balance roundrobin + #use next line for transparent proxy, so the servers can see the + #original ip-address and remove source keyword in server definition + #source 0.0.0.0 usesrc clientip + server server01 192.168.1.10:123 source 192.168.1.1:25 + server server02 192.168.1.20:123 source 192.168.1.1:25 + + +# Special health check listener for integration with external load +# balancers. +listen local_health_check + + # Listen on port 60000 + bind :60000 + + # This is a health check + mode health + + # Enable HTTP-style responses: "HTTP/1.0 200 OK" + # else just print "OK". + #option httpchk diff --git a/net/haproxy/files/haproxy.hotplug b/net/haproxy/files/haproxy.hotplug new file mode 100644 index 0000000..d14b5bf --- /dev/null +++ b/net/haproxy/files/haproxy.hotplug @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$ACTION" = add ]; then + + /etc/init.d/haproxy enabled && \ + /etc/init.d/haproxy start +fi + diff --git a/net/haproxy/files/haproxy.init b/net/haproxy/files/haproxy.init new file mode 100644 index 0000000..96b13ba --- /dev/null +++ b/net/haproxy/files/haproxy.init @@ -0,0 +1,23 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2010 OpenWrt.org + +START=99 +STOP=80 + +SERVICE_USE_PID=1 + +HAPROXY_BIN="/usr/sbin/haproxy" +HAPROXY_CONFIG="/etc/haproxy.cfg" +HAPROXY_PID="/var/run/haproxy.pid" + +start() { + service_start $HAPROXY_BIN -q -D -f "$HAPROXY_CONFIG" -p "$HAPROXY_PID" +} + +stop() { + service_stop $HAPROXY_BIN +} + +reload() { + $HAPROXY_BIN -D -q -f $HAPROXY_CONFIG -p $HAPROXY_PID -sf $(cat $HAPROXY_PID) +} diff --git a/net/haproxy/patches/001-haproxy-1.4.x-sendproxy.patch b/net/haproxy/patches/001-haproxy-1.4.x-sendproxy.patch new file mode 100644 index 0000000..26906d4 --- /dev/null +++ b/net/haproxy/patches/001-haproxy-1.4.x-sendproxy.patch @@ -0,0 +1,441 @@ +--- a/doc/configuration.txt ++++ b/doc/configuration.txt +@@ -1337,6 +1337,7 @@ bind [
    ]: [, ...] tr + bind [
    ]: [, ...] id + bind [
    ]: [, ...] name + bind [
    ]: [, ...] defer-accept ++bind [
    ]: [, ...] accept-proxy + Define one or several listening addresses and/or ports in a frontend. + May be used in sections : defaults | frontend | listen | backend + no | yes | yes | no +@@ -1417,6 +1418,19 @@ bind [
    ]: [, ...] de + with front firewalls which would see an established + connection while the proxy will only see it in SYN_RECV. + ++ accept-proxy is an optional keyword which enforces use of the PROXY ++ protocol over any connection accepted by this listener. The ++ PROXY protocol dictates the layer 3/4 addresses of the ++ incoming connection to be used everywhere an address is used, ++ with the only exception of "tcp-request connection" rules ++ which will only see the real connection address. Logs will ++ reflect the addresses indicated in the protocol, unless it is ++ violated, in which case the real address will still be used. ++ This keyword combined with support from external components ++ can be used as an efficient and reliable alternative to the ++ X-Forwarded-For mechanism which is not always reliable and ++ not even always usable. ++ + It is possible to specify a list of address:port combinations delimited by + commas. The frontend will then listen on all of these addresses. There is no + fixed limit to the number of addresses and ports which can be listened on in +@@ -1427,8 +1441,10 @@ bind [
    ]: [, ...] de + listen http_proxy + bind :80,:443 + bind 10.0.0.1:10080,10.0.0.1:10443 ++ bind 127.0.0.1:8443 accept-proxy + +- See also : "source". ++ See also : "source", "option forwardfor" and the PROXY protocol ++ documentation. + + + bind-process [ all | odd | even | ] ... +@@ -7215,7 +7231,9 @@ marked with a star ('*') after the field + + Detailed fields description : + - "client_ip" is the IP address of the client which initiated the TCP +- connection to haproxy. ++ connection to haproxy. Note that when the connection is accepted on a ++ socket configured with "accept-proxy" and the PROXY protocol is correctly ++ used, then the logs will reflect the forwarded connection's information. + + - "client_port" is the TCP port of the client which initiated the connection. + +@@ -7388,7 +7406,9 @@ with a star ('*') after the field name b + + Detailed fields description : + - "client_ip" is the IP address of the client which initiated the TCP +- connection to haproxy. ++ connection to haproxy. Note that when the connection is accepted on a ++ socket configured with "accept-proxy" and the PROXY protocol is correctly ++ used, then the logs will reflect the forwarded connection's information. + + - "client_port" is the TCP port of the client which initiated the connection. + +--- a/include/common/standard.h ++++ b/include/common/standard.h +@@ -269,6 +269,28 @@ static inline unsigned int __strl2uic(co + return i; + } + ++/* This function reads an unsigned integer from the string pointed to by ++ * and returns it. The pointer is adjusted to point to the first unread ++ * char. The function automatically stops at . ++ */ ++static inline unsigned int __read_uint(const char **s, const char *end) ++{ ++ const char *ptr = *s; ++ unsigned int i = 0; ++ unsigned int j, k; ++ ++ while (ptr < end) { ++ j = *ptr - '0'; ++ k = i * 10; ++ if (j > 9) ++ break; ++ i = k + j; ++ ptr++; ++ } ++ *s = ptr; ++ return i; ++} ++ + extern unsigned int str2ui(const char *s); + extern unsigned int str2uic(const char *s); + extern unsigned int strl2ui(const char *s, int len); +@@ -276,6 +298,7 @@ extern unsigned int strl2uic(const char + extern int strl2ic(const char *s, int len); + extern int strl2irc(const char *s, int len, int *ret); + extern int strl2llrc(const char *s, int len, long long *ret); ++extern unsigned int read_uint(const char **s, const char *end); + unsigned int inetaddr_host(const char *text); + unsigned int inetaddr_host_lim(const char *text, const char *stop); + unsigned int inetaddr_host_lim_ret(const char *text, char *stop, const char **ret); +--- a/include/proto/client.h ++++ b/include/proto/client.h +@@ -25,6 +25,7 @@ + #include + #include + ++int frontend_decode_proxy_request(struct session *s, struct buffer *req, int an_bit); + void get_frt_addr(struct session *s); + int event_accept(int fd); + +--- a/include/types/buffers.h ++++ b/include/types/buffers.h +@@ -135,16 +135,16 @@ + * The field is blanked by buffer_init() and only by analysers themselves + * afterwards. + */ +-#define AN_REQ_INSPECT 0x00000001 /* inspect request contents */ +-#define AN_REQ_WAIT_HTTP 0x00000002 /* wait for an HTTP request */ +-#define AN_REQ_HTTP_PROCESS_FE 0x00000004 /* process the frontend's HTTP part */ +-#define AN_REQ_SWITCHING_RULES 0x00000008 /* apply the switching rules */ +-#define AN_REQ_HTTP_PROCESS_BE 0x00000010 /* process the backend's HTTP part */ +-#define AN_REQ_HTTP_INNER 0x00000020 /* inner processing of HTTP request */ +-#define AN_REQ_HTTP_TARPIT 0x00000040 /* wait for end of HTTP tarpit */ +-#define AN_REQ_HTTP_BODY 0x00000080 /* inspect HTTP request body */ +-#define AN_REQ_STICKING_RULES 0x00000100 /* table persistence matching */ +-/* unused: 0x200 */ ++#define AN_REQ_DECODE_PROXY 0x00000001 /* take the proxied address from a 'PROXY' line */ ++#define AN_REQ_INSPECT 0x00000002 /* inspect request contents */ ++#define AN_REQ_WAIT_HTTP 0x00000004 /* wait for an HTTP request */ ++#define AN_REQ_HTTP_PROCESS_FE 0x00000008 /* process the frontend's HTTP part */ ++#define AN_REQ_SWITCHING_RULES 0x00000010 /* apply the switching rules */ ++#define AN_REQ_HTTP_PROCESS_BE 0x00000020 /* process the backend's HTTP part */ ++#define AN_REQ_HTTP_INNER 0x00000040 /* inner processing of HTTP request */ ++#define AN_REQ_HTTP_TARPIT 0x00000080 /* wait for end of HTTP tarpit */ ++#define AN_REQ_HTTP_BODY 0x00000100 /* inspect HTTP request body */ ++#define AN_REQ_STICKING_RULES 0x00000200 /* table persistence matching */ + #define AN_REQ_PRST_RDP_COOKIE 0x00000400 /* persistence on rdp cookie */ + #define AN_REQ_HTTP_XFER_BODY 0x00000800 /* forward request body */ + +--- a/include/types/protocols.h ++++ b/include/types/protocols.h +@@ -72,6 +72,7 @@ + #define LI_O_FOREIGN 0x0002 /* permit listening on foreing addresses */ + #define LI_O_NOQUICKACK 0x0004 /* disable quick ack of immediate data (linux) */ + #define LI_O_DEF_ACCEPT 0x0008 /* wait up to 1 second for data before accepting */ ++#define LI_O_ACC_PROXY 0x0010 /* find the proxied address in the first request line */ + + /* The listener will be directly referenced by the fdtab[] which holds its + * socket. The listener provides the protocol-specific accept() function to +--- a/src/cfgparse.c ++++ b/src/cfgparse.c +@@ -1466,6 +1466,16 @@ int cfg_parse_listen(const char *file, i + #endif + } + ++ if (!strcmp(args[cur_arg], "accept-proxy")) { /* expect a 'PROXY' line first */ ++ struct listener *l; ++ ++ for (l = curproxy->listen; l != last_listen; l = l->next) ++ l->options |= LI_O_ACC_PROXY; ++ ++ cur_arg ++; ++ continue; ++ } ++ + if (!strcmp(args[cur_arg], "name")) { + struct listener *l; + +@@ -1518,7 +1528,7 @@ int cfg_parse_listen(const char *file, i + continue; + } + +- Alert("parsing [%s:%d] : '%s' only supports the 'transparent', 'defer-accept', 'name', 'id', 'mss' and 'interface' options.\n", ++ Alert("parsing [%s:%d] : '%s' only supports the 'transparent', 'accept-proxy', 'defer-accept', 'name', 'id', 'mss' and 'interface' options.\n", + file, linenum, args[0]); + err_code |= ERR_ALERT | ERR_FATAL; + goto out; +@@ -5731,6 +5741,9 @@ out_uri_auth_compat: + listener->handler = process_session; + listener->analysers |= curproxy->fe_req_ana; + ++ if (listener->options & LI_O_ACC_PROXY) ++ listener->analysers |= AN_REQ_DECODE_PROXY; ++ + /* smart accept mode is automatic in HTTP mode */ + if ((curproxy->options2 & PR_O2_SMARTACC) || + (curproxy->mode == PR_MODE_HTTP && +--- a/src/client.c ++++ b/src/client.c +@@ -22,6 +22,7 @@ + + #include + #include ++#include + #include + + #include +@@ -43,6 +44,191 @@ + #include + + ++/* This analyser tries to fetch a line from the request buffer which looks like : ++ * ++ * "PROXY" PROTO SRC3 DST3 SRC4 "\r\n" ++ * ++ * There must be exactly one space between each field. Fields are : ++ * - PROTO : layer 4 protocol, which must be "TCP4" or "TCP6". ++ * - SRC3 : layer 3 (eg: IP) source address in standard text form ++ * - DST3 : layer 3 (eg: IP) destination address in standard text form ++ * - SRC4 : layer 4 (eg: TCP port) source address in standard text form ++ * - DST4 : layer 4 (eg: TCP port) destination address in standard text form ++ * ++ * This line MUST be at the beginning of the buffer and MUST NOT wrap. ++ * ++ * Once the data is fetched, the values are set in the session's field and data ++ * are removed from the buffer. The function returns zero if it needs to wait ++ * for more data (max: timeout_client), or 1 if it has finished and removed itself. ++ */ ++int frontend_decode_proxy_request(struct session *s, struct buffer *req, int an_bit) ++{ ++ char *line = req->data; ++ char *end = req->data + req->l; ++ int len; ++ ++ DPRINTF(stderr,"[%u] %s: session=%p b=%p, exp(r,w)=%u,%u bf=%08x bl=%d analysers=%02x\n", ++ now_ms, __FUNCTION__, ++ s, ++ req, ++ req->rex, req->wex, ++ req->flags, ++ req->l, ++ req->analysers); ++ ++ if (req->flags & (BF_READ_ERROR|BF_READ_TIMEOUT)) ++ goto fail; ++ ++ len = MIN(req->l, 6); ++ if (!len) ++ goto missing; ++ ++ /* Decode a possible proxy request, fail early if it does not match */ ++ if (strncmp(line, "PROXY ", len) != 0) ++ goto fail; ++ ++ line += 6; ++ if (req->l < 18) /* shortest possible line */ ++ goto missing; ++ ++ if (!memcmp(line, "TCP4 ", 5) != 0) { ++ u32 src3, dst3, sport, dport; ++ ++ line += 5; ++ ++ src3 = inetaddr_host_lim_ret(line, end, &line); ++ if (line == end) ++ goto missing; ++ if (*line++ != ' ') ++ goto fail; ++ ++ dst3 = inetaddr_host_lim_ret(line, end, &line); ++ if (line == end) ++ goto missing; ++ if (*line++ != ' ') ++ goto fail; ++ ++ sport = read_uint((const char **)&line, end); ++ if (line == end) ++ goto missing; ++ if (*line++ != ' ') ++ goto fail; ++ ++ dport = read_uint((const char **)&line, end); ++ if (line > end - 2) ++ goto missing; ++ if (*line++ != '\r') ++ goto fail; ++ if (*line++ != '\n') ++ goto fail; ++ ++ /* update the session's addresses and mark them set */ ++ ((struct sockaddr_in *)&s->cli_addr)->sin_family = AF_INET; ++ ((struct sockaddr_in *)&s->cli_addr)->sin_addr.s_addr = htonl(src3); ++ ((struct sockaddr_in *)&s->cli_addr)->sin_port = htons(sport); ++ ++ ((struct sockaddr_in *)&s->frt_addr)->sin_family = AF_INET; ++ ((struct sockaddr_in *)&s->frt_addr)->sin_addr.s_addr = htonl(dst3); ++ ((struct sockaddr_in *)&s->frt_addr)->sin_port = htons(dport); ++ s->flags |= SN_FRT_ADDR_SET; ++ ++ } ++ else if (!memcmp(line, "TCP6 ", 5) != 0) { ++ u32 sport, dport; ++ char *src_s; ++ char *dst_s, *sport_s, *dport_s; ++ struct in6_addr src3, dst3; ++ ++ line+=5; ++ ++ src_s = line; ++ dst_s = sport_s = dport_s = NULL; ++ while (1) { ++ if (line > end - 2) { ++ goto missing; ++ } ++ else if (*line == '\r') { ++ *line = 0; ++ line++; ++ if (*line++ != '\n') ++ goto fail; ++ break; ++ } ++ ++ if (*line == ' ') { ++ *line = 0; ++ if (!dst_s) ++ dst_s = line+1; ++ else if (!sport_s) ++ sport_s = line+1; ++ else if (!dport_s) ++ dport_s = line+1; ++ } ++ line++; ++ } ++ ++ if (!dst_s || !sport_s || !dport_s) ++ goto fail; ++ ++ sport = read_uint((const char **)&sport_s,dport_s-1); ++ if ( *sport_s != 0 ) ++ goto fail; ++ ++ dport = read_uint((const char **)&dport_s,line-2); ++ if ( *dport_s != 0 ) ++ goto fail; ++ ++ if (inet_pton(AF_INET6, src_s, (void *)&src3) != 1) ++ goto fail; ++ ++ if (inet_pton(AF_INET6, dst_s, (void *)&dst3) != 1) ++ goto fail; ++ ++ /* update the session's addresses and mark them set */ ++ ((struct sockaddr_in6 *)&s->cli_addr)->sin6_family = AF_INET6; ++ memcpy(&((struct sockaddr_in6 *)&s->cli_addr)->sin6_addr, &src3, sizeof(struct in6_addr)); ++ ((struct sockaddr_in6 *)&s->cli_addr)->sin6_port = htons(sport); ++ ++ ((struct sockaddr_in6 *)&s->frt_addr)->sin6_family = AF_INET6; ++ memcpy(&((struct sockaddr_in6 *)&s->frt_addr)->sin6_addr, &dst3, sizeof(struct in6_addr)); ++ ((struct sockaddr_in6 *)&s->frt_addr)->sin6_port = htons(dport); ++ s->flags |= SN_FRT_ADDR_SET; ++ } ++ else { ++ goto fail; ++ } ++ ++ /* remove the PROXY line from the request */ ++ len = line - req->data; ++ buffer_replace2(req, req->data, line, NULL, 0); ++ req->total -= len; /* don't count the header line */ ++ ++ req->analysers &= ~an_bit; ++ return 1; ++ ++ missing: ++ if (!(req->flags & (BF_SHUTR|BF_FULL))) { ++ buffer_dont_connect(s->req); ++ return 0; ++ } ++ /* missing data and buffer is either full or shutdown => fail */ ++ ++ fail: ++ buffer_abort(req); ++ buffer_abort(s->rep); ++ req->analysers = 0; ++ ++ s->fe->counters.failed_req++; ++ if (s->listener->counters) ++ s->listener->counters->failed_req++; ++ ++ if (!(s->flags & SN_ERR_MASK)) ++ s->flags |= SN_ERR_PRXCOND; ++ if (!(s->flags & SN_FINST_MASK)) ++ s->flags |= SN_FINST_R; ++ return 0; ++} ++ + /* Retrieves the original destination address used by the client, and sets the + * SN_FRT_ADDR_SET flag. + */ +--- a/src/proto_http.c ++++ b/src/proto_http.c +@@ -4087,7 +4087,8 @@ void http_end_txn_clean_session(struct s + if (s->rep->lr >= s->rep->data + s->rep->size) + s->rep->lr -= s->req->size; + +- s->req->analysers |= s->fe->fe_req_ana; ++ s->req->analysers = s->fe->fe_req_ana; ++ s->req->analysers &= ~AN_REQ_DECODE_PROXY; + s->rep->analysers = 0; + + http_silent_debug(__LINE__, s); +@@ -7624,7 +7625,6 @@ void http_reset_txn(struct session *s) + http_init_txn(s); + + s->be = s->fe; +- s->req->analysers = s->listener->analysers; + s->logs.logwait = s->fe->to_log; + s->srv = s->prev_srv = s->srv_conn = NULL; + /* re-init store persistence */ +--- a/src/session.c ++++ b/src/session.c +@@ -1055,6 +1055,12 @@ resync_stream_interface: + while (ana_list && max_loops--) { + /* Warning! ensure that analysers are always placed in ascending order! */ + ++ if (ana_list & AN_REQ_DECODE_PROXY) { ++ if (!frontend_decode_proxy_request(s, s->req, AN_REQ_DECODE_PROXY)) ++ break; ++ UPDATE_ANALYSERS(s->req->analysers, ana_list, ana_back, AN_REQ_DECODE_PROXY); ++ } ++ + if (ana_list & AN_REQ_INSPECT) { + if (!tcp_inspect_request(s, s->req, AN_REQ_INSPECT)) + break; +--- a/src/standard.c ++++ b/src/standard.c +@@ -569,6 +569,11 @@ unsigned int strl2uic(const char *s, int + return __strl2uic(s, len); + } + ++unsigned int read_uint(const char **s, const char *end) ++{ ++ return __read_uint(s, end); ++} ++ + /* This one is 7 times faster than strtol() on athlon with checks. + * It returns the value of the number composed of all valid digits read, + * and can process negative numbers too. diff --git a/net/hiawatha/Makefile b/net/hiawatha/Makefile new file mode 100644 index 0000000..943a57c --- /dev/null +++ b/net/hiawatha/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2006-2011 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:=hiawatha +PKG_VERSION:=7.8.2 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.hiawatha-webserver.org/files/ +PKG_MD5SUM:=8aff3f8c759871ea1d1ff22e98030332 + +PKG_CONFIG_DEPENDS:= \ + CONFIG_IPV6 \ + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/hiawatha + CATEGORY:=Network + SECTION:=net + SUBMENU:=Web Servers/Proxies + TITLE:=A very lightweight web server + URL:=http://www.hiawatha-webserver.org/ + MAINTAINER:=Raphaël HUCK + DEPENDS:=+libpthread +zlib +endef + +define Package/hiawatha/description + Hiawatha is an open source webserver with a focus on security. +endef + +CONFIGURE_ARGS+= \ + $(call autoconf_bool,CONFIG_IPV6,ipv6) \ + --disable-cache \ + --disable-monitor \ + --disable-ssl \ + --disable-xslt + +CONFIGURE_VARS+= \ + ac_cv_file__dev_urandom=yes \ + webrootdir=/www + +define Package/hiawatha/conffiles +/etc/hiawatha/hiawatha.conf +/etc/hiawatha/mimetype.conf +endef + +define Package/hiawatha/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/hiawatha $(1)/usr/sbin/ + + $(INSTALL_DIR) $(1)/etc/hiawatha + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/hiawatha/{hiawatha,mimetype}.conf $(1)/etc/hiawatha/ +endef + +$(eval $(call BuildPackage,hiawatha)) diff --git a/net/horst/Makefile b/net/horst/Makefile new file mode 100644 index 0000000..a8a6028 --- /dev/null +++ b/net/horst/Makefile @@ -0,0 +1,43 @@ +# +# 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:=horst +PKG_VERSION:=3.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://br1.einfach.org/horst_dl/ +PKG_MD5SUM:=076d836733fb6ce53a590eddf92ad358 + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/horst + SECTION:=net + CATEGORY:=Network + SUBMENU:=wireless + DEPENDS:=+libncurses + MAINTAINER:=Bruno Randolf + TITLE:=Highly Optimized 802.11 Radio Scanning Tool + URL:=http://br1.einfach.org/horst/ +endef + +define Package/horst/description + [horst] is a scanning and analysis tool for 802.11 wireless networks + and especially IBSS (ad-hoc) mode and mesh networks (OLSR). +endef + +define Package/horst/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/horst $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/horst.sh $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,horst)) diff --git a/net/horst/patches/100-compile-fixes.patch b/net/horst/patches/100-compile-fixes.patch new file mode 100644 index 0000000..29295b0 --- /dev/null +++ b/net/horst/patches/100-compile-fixes.patch @@ -0,0 +1,21 @@ +--- a/Makefile ++++ b/Makefile +@@ -34,9 +34,7 @@ CFLAGS+=-DPCAP + LIBS+=-lpcap + endif + +-buildstamp=.build_debug$(DEBUG)pcap$(PCAP) +- +-all: $(buildstamp) $(NAME) ++all: $(NAME) + + # include dependencies + average.o: average.h util.h +@@ -73,7 +71,3 @@ clean: + -rm -f *.o *~ + -rm -f $(NAME) + -rm -f .build_* +- +-$(buildstamp): +- make clean +- touch $@ diff --git a/net/hping3/Makefile b/net/hping3/Makefile new file mode 100644 index 0000000..a947d74 --- /dev/null +++ b/net/hping3/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2009 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:=hping3 +PKG_VERSION:=20051105 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.hping.org/ +PKG_MD5SUM:=ca4ea4e34bcc2162aedf25df8b2d1747 + +include $(INCLUDE_DIR)/package.mk + +define Package/hping3 + SECTION:=net + CATEGORY:=Network + TITLE:=TCP/IP packet assembler/analyzer + URL:=http://www.hping.org/ + DEPENDS:=+libpcap +libpthread +endef + +define Package/hping3/description + hping is a command-line oriented TCP/IP packet assembler/analyzer. The interface is + inspired to the ping(8) unix command, but hping isn't only able to send ICMP echo + requests. It supports TCP, UDP, ICMP and RAW-IP protocols, has a traceroute mode, the + ability to send files between a covered channel, and many other features. +endef + +define Build/Configure +endef + +define Package/hping3/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/hping3 $(1)/usr/sbin/hping3 +endef + +$(eval $(call BuildPackage,hping3)) diff --git a/net/hping3/patches/100-makefile.patch b/net/hping3/patches/100-makefile.patch new file mode 100644 index 0000000..abf3a0d --- /dev/null +++ b/net/hping3/patches/100-makefile.patch @@ -0,0 +1,48 @@ +--- a/Makefile ++++ b/Makefile +@@ -6,15 +6,15 @@ + # $date: Sun Jul 25 17:56:15 MET DST 1999$ + # $rev: 3$ + +-CC= gcc +-AR=/usr/bin/ar +-RANLIB=/usr/bin/ranlib +-CCOPT= -O2 -Wall -I/usr/include/tcl8.4 -DUSE_TCL +-DEBUG= -g ++#CC= gcc ++#AR=/usr/bin/ar ++#RANLIB=/usr/bin/ranlib ++#CCOPT= -O2 -Wall ++#DEBUG= -g + #uncomment the following if you need libpcap based build under linux + #(not raccomanded) + COMPILE_TIME= +-INSTALL_MANPATH=/usr/local/man ++#INSTALL_MANPATH=/usr/local/man + PCAP=-lpcap + + ARSOBJ = ars.o apd.o split.o rapd.o +@@ -50,20 +50,16 @@ libars.a: $(ARSOBJ) + $(RANLIB) $@ + + hping3: byteorder.h $(OBJ) +- $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) -ltcl8.4 -lm -lpthread +- @echo +- ./hping3 -v +- @echo "use \`make strip' to strip hping3 binary" +- @echo "use \`make install' to install hping3" ++ $(CC) -o hping3 $(CFLAGS) $(LDFLAGS) $(DEBUG) $(OBJ) $(PCAP) -lm -lpthread + + hping3-static: byteorder.h $(OBJ) +- $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) -ltcl8.4 -lm -lpthread -ldl ++ $(CC) -static -o hping3-static $(CFLAGS) $(LDFLAGS) $(DEBUG) $(OBJ) $(PCAP) -lm -lpthread -ldl + + byteorder.h: + ./configure + + .c.o: +- $(CC) -c $(CCOPT) $(DEBUG) $(COMPILE_TIME) $< ++ $(CC) -c $(CFLAGS) $(LDFLAGS) $(DEBUG) $(COMPILE_TIME) $< + + clean: + rm -rf hping3 *.o libars.a diff --git a/net/hping3/patches/101-endianness.patch b/net/hping3/patches/101-endianness.patch new file mode 100644 index 0000000..2666647 --- /dev/null +++ b/net/hping3/patches/101-endianness.patch @@ -0,0 +1,52 @@ +--- a/hping2.h ++++ b/hping2.h +@@ -13,6 +13,7 @@ + #ifndef _HPING2_H + #define _HPING2_H + ++#include + #include + #include + #include +@@ -248,10 +249,10 @@ + * IP header + */ + struct myiphdr { +-#if defined(__LITTLE_ENDIAN_BITFIELD) ++#if __BYTE_ORDER == __LITTLE_ENDIAN + __u8 ihl:4, + version:4; +-#elif defined (__BIG_ENDIAN_BITFIELD) ++#elif __BYTE_ORDER == __BIG_ENDIAN + __u8 version:4, + ihl:4; + #else +@@ -287,10 +288,10 @@ struct mytcphdr { + __u16 th_dport; /* destination port */ + __u32 th_seq; /* sequence number */ + __u32 th_ack; /* acknowledgement number */ +-#if defined (__LITTLE_ENDIAN_BITFIELD) ++#if __BYTE_ORDER == __LITTLE_ENDIAN + __u8 th_x2:4, /* (unused) */ + th_off:4; /* data offset */ +-#elif defined (__BIG_ENDIAN_BITFIELD) ++#elif __BYTE_ORDER == __BIG_ENDIAN + __u8 th_off:4, /* data offset */ + th_x2:4; /* (unused) */ + #else +--- a/bytesex.h ++++ b/bytesex.h +@@ -9,9 +9,12 @@ + + #if defined(__i386__) \ + || defined(__alpha__) \ ++ || (defined(__arm__) && (defined(ARMEL) || defined(__ARMEL__))) \ + || (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__))) + #define BYTE_ORDER_LITTLE_ENDIAN +-#elif defined(__mc68000__) \ ++#elif defined(__mc68000__) \ ++ || (defined(__arm__) && (defined(ARMEB) || defined(__ARMEB__))) \ ++ || defined (__avr32__) \ + || defined (__sparc__) \ + || defined (__sparc) \ + || defined (__PPC__) \ diff --git a/net/hping3/patches/102-lib_rename.patch b/net/hping3/patches/102-lib_rename.patch new file mode 100644 index 0000000..c5d102c --- /dev/null +++ b/net/hping3/patches/102-lib_rename.patch @@ -0,0 +1,11 @@ +--- a/libpcap_stuff.c ++++ b/libpcap_stuff.c +@@ -17,7 +17,7 @@ + #include + #include + #include +-#include ++#include + + #include "globals.h" + diff --git a/net/hsflowd/Makefile b/net/hsflowd/Makefile new file mode 100644 index 0000000..93c6311 --- /dev/null +++ b/net/hsflowd/Makefile @@ -0,0 +1,73 @@ +# +# Copyright (C) 2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=hsflowd +PKG_RELEASE:=1 +PKG_SOURCE_URL:=@SF/host-sflow +PKG_VERSION:=1.20 +PKG_MD5SUM:=0bfc0b05fbab27a80557c5efb5e66693 + +PKG_SOURCE:=hsflowd-$(PKG_VERSION).tar.gz + +include $(INCLUDE_DIR)/package.mk + +define Package/hsflowd + SECTION:=net + CATEGORY:=Base system + DEPENDS:=+libpthread + TITLE:=Host sFlow export agent + URL:=http://host-sflow.sourceforge.net/ +endef + +define Package/sflowovsd + SECTION:=net + CATEGORY:=Base system + DEPENDS:=+hsflowd + TITLE:=Host sFlow Open vSwitch agent + URL:=http://host-sflow.sourceforge.net/ +endef + + +define Package/hsflowd/description + The Host sFlow agent exports server performance metrics using the sFlow + protocol. The agent is intended to provide scalable, multi-vendor, + multi-OS performance monitoring with minimal impact on the systems being + monitored. +endef + +define Package/sflowovsd/description + The Host sFlow agent can automatically configure the sFlow settings in + the Open vSwitch. +endef + +MAKE_VARS += \ + LIBVIRT=no \ + XEN_DDK=no \ + DEBIAN=no \ + PLATFORM=Linux \ + OPT="$(TARGET_CFLAGS) -std=c99" + +define Package/hsflowd/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/Linux/hsflowd $(1)/usr/sbin + $(INSTALL_BIN) ./files/hsflowd.init $(1)/etc/init.d/hsflowd + $(INSTALL_CONF) ./files/hsflowd.config $(1)/etc/config/hsflowd + +endef + +define Package/sflowovsd/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/Linux/sflowovsd $(1)/usr/sbin + $(INSTALL_BIN) ./files/sflowovsd.init $(1)/etc/init.d/sflowovsd +endef + +$(eval $(call BuildPackage,hsflowd)) +$(eval $(call BuildPackage,sflowovsd)) + diff --git a/net/hsflowd/files/hsflowd.config b/net/hsflowd/files/hsflowd.config new file mode 100644 index 0000000..77262f8 --- /dev/null +++ b/net/hsflowd/files/hsflowd.config @@ -0,0 +1,11 @@ +config hsflowd config + option enabled '0' + option dnssd '0' + option polling '30' + option sampling '512' + option uuid '' + +config collector + option ip '192.168.123.123' + option port '6343' + diff --git a/net/hsflowd/files/hsflowd.init b/net/hsflowd/files/hsflowd.init new file mode 100644 index 0000000..7212826 --- /dev/null +++ b/net/hsflowd/files/hsflowd.init @@ -0,0 +1,72 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2012 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +start() { + config_load hsflowd + local args agent conffile dnssd polling sampling uuid + + getcollectors() { + echo " collector {" >> $tmpconf + + config_get ip "$1" ip + [ -n "$ip" ] && echo " ip=${ip}" >> $tmpconf + config_get port "$1" port + [ -n "$port" ] && echo " udpport=${port}" >> $tmpconf + + echo " }" >> $tmpconf + } + + config_get agent config agent_iface "br-lan" + config_get conffile config config_file + config_get_bool dnssd config dnssd 1 + config_get polling config polling 30 + config_get sampling config sampling 512 + config_get uuid config uuid + + [ -z "$uuid" ] && { + uuid="$(cat /proc/sys/kernel/random/uuid)" + uci set hsflowd.config.uuid=$uuid + uci commit hsflowd + } + + args="" + append args "-u $uuid" + + if [ -n "$conffile" ]; then + append args "-f $conffile" + else + tmpconf="/var/etc/hsflowd.conf" + append args "-f $tmpconf" + mkdir -p /var/etc + + echo "sFlow {" > $tmpconf + echo " agent=${agent}" >> $tmpconf + + if [ "$dnssd" -eq 1 ]; then + echo " DNSSD=on" >> $tmpconf + else + echo " DNSSD=off" >> $tmpconf + echo " polling=${polling}" >> $tmpconf + echo " sampling=${sampling}" >> $tmpconf + + config_foreach getcollectors collector + fi + + echo "}" >> $tmpconf + + fi + + + service_start /usr/sbin/hsflowd $args +} + +stop() { + service_stop /usr/sbin/hsflowd + + pid_file="/var/run/hsflowd.pid" + [ -f "$pid_file" ] && rm -f "$pid_file" +} diff --git a/net/hsflowd/files/sflowovsd.init b/net/hsflowd/files/sflowovsd.init new file mode 100644 index 0000000..ab9bac9 --- /dev/null +++ b/net/hsflowd/files/sflowovsd.init @@ -0,0 +1,17 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2012 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +start() { + service_start /usr/sbin/sflowovsd -f /var/run/hsflowd.auto +} + +stop() { + service_stop /usr/sbin/sflowovsd + + pid_file="/var/run/sflowovsd.pid" + [ -f "$pid_file" ] && rm -f "$pid_file" +} diff --git a/net/hsflowd/patches/100-crosscompile.patch b/net/hsflowd/patches/100-crosscompile.patch new file mode 100644 index 0000000..b677182 --- /dev/null +++ b/net/hsflowd/patches/100-crosscompile.patch @@ -0,0 +1,91 @@ +--- a/src/Linux/Makefile ++++ b/src/Linux/Makefile +@@ -74,7 +74,7 @@ HEADERS= hsflowd.h hsflowtokens.h sflowo + SFLOWDIR=../sflow + + #CC= g++ +-CC= gcc -std=gnu99 ++CC?= gcc -std=gnu99 + + OPT_FULL = -O3 -DNDEBUG + OPT_DEBUG = -g -ggdb +--- a/src/sflow/Makefile ++++ b/src/sflow/Makefile +@@ -3,7 +3,7 @@ + + HEADERS= sflow_api.h sflow.h Makefile + +-OPT = -O3 -DNDEBUG ++OPT ?= -O3 -DNDEBUG + #OPT = -g -ggdb -O2 + #OPT= -g -ggdb + +@@ -12,7 +12,7 @@ LDFLAGS= + + #CC= g++ + #CC= gcc -std=c99 +-CC= gcc ++CC?= gcc + + OBJS= sflow_agent.o \ + sflow_sampler.o \ +@@ -20,8 +20,8 @@ OBJS= sflow_agent.o \ + sflow_receiver.o + + libsflow.a: $(OBJS) +- ar cru $@ $(OBJS) +- ranlib $@ ++ $(AR) cru $@ $(OBJS) ++ $(RANLIB) $@ + + all: libsflow.a + +--- a/Makefile ++++ b/Makefile +@@ -11,32 +11,32 @@ all: $(PROG) + + $(PROG): + cd src/sflow; $(MAKE) +- PLATFORM=`uname`; \ ++ PLATFORM?=`uname`; \ + MYVER=`./getVersion`; \ + MYREL=`./getRelease`; \ + cd src/$$PLATFORM; $(MAKE) VERSION=$$MYVER RELEASE=$$MYREL + + clean: + cd src/sflow; $(MAKE) clean +- PLATFORM=`uname`; \ ++ PLATFORM?=`uname`; \ + MYVER=`./getVersion`; \ + MYREL=`./getRelease`; \ + cd src/$$PLATFORM; $(MAKE) VERSION=$$MYVER RELEASE=$$MYREL clean + + install: +- PLATFORM=`uname`; \ ++ PLATFORM?=`uname`; \ + MYVER=`./getVersion`; \ + MYREL=`./getRelease`; \ + cd src/$$PLATFORM; $(MAKE) VERSION=$$MYVER RELEASE=$$MYREL install + + schedule: +- PLATFORM=`uname`; \ ++ PLATFORM?=`uname`; \ + MYVER=`./getVersion`; \ + MYREL=`./getRelease`; \ + cd src/$$PLATFORM; $(MAKE) VERSION=$$MYVER RELEASE=$$MYREL schedule + + rpm: +- PLATFORM=`uname`; \ ++ PLATFORM?=`uname`; \ + MYVER=`./getVersion`; \ + MYREL=`./getRelease`; \ + MYSRCDIR=$(RPM_SOURCES_DIR)/$(PROG)-$$MYVER; \ +@@ -46,7 +46,7 @@ rpm: + rpmbuild -ba $(PROG).spec + + deb: $(PROG) +- PLATFORM=`uname`; \ ++ PLATFORM?=`uname`; \ + MYARCH=`uname -m`; \ + MYVER=`./getVersion`; \ + MYREL=`./getRelease`; \ diff --git a/net/hsflowd/patches/200-uclibc-compat.patch b/net/hsflowd/patches/200-uclibc-compat.patch new file mode 100644 index 0000000..4c0a82e --- /dev/null +++ b/net/hsflowd/patches/200-uclibc-compat.patch @@ -0,0 +1,63 @@ +--- a/src/Linux/hsflowd.c ++++ b/src/Linux/hsflowd.c +@@ -1408,13 +1408,12 @@ extern "C" { + signal(SIGXFSZ, SIG_DFL); + + // ask for the backtrace pointers +- size_t siz = backtrace(backtracePtrs, HSP_NUM_BACKTRACE_PTRS); ++ size_t siz = 0; + + if(f_crash == NULL) { + f_crash = stderr; + } + +- backtrace_symbols_fd(backtracePtrs, siz, fileno(f_crash)); + fflush(f_crash); + // Do something useful with siginfo_t + if (sig == SIGSEGV) { +@@ -1430,7 +1429,6 @@ extern "C" { + // overwrite sigaction with caller's address + backtracePtrs[1] = (void *)(((ucontext_t *)secret)->uc_mcontext.gregs[REG_EIP]); + // then write again: +- backtrace_symbols_fd(backtracePtrs, siz, fileno(f_crash)); + fflush(f_crash); + #endif + // exit with the original signal so we get the right idea +@@ -2005,7 +2003,6 @@ extern "C" { + if(debug) { + myLog(LOG_INFO, "initAgent suceeded"); + // print some stats to help us size HSP_RLIMIT_MEMLOCK etc. +- malloc_stats(); + } + + if(sp->dropPriv) { +--- a/src/Linux/hsflowd.h ++++ b/src/Linux/hsflowd.h +@@ -34,9 +34,7 @@ extern "C" { + #include // for UINT_MAX + + // for signal backtrace +-#include + #include +-#include + + #include // for va_start() + #include "util.h" +--- a/src/Linux/util.c ++++ b/src/Linux/util.c +@@ -39,7 +39,6 @@ extern "C" { + void *mem = SYS_CALLOC(1, bytes); + if(mem == NULL) { + myLog(LOG_ERR, "calloc() failed : %s", strerror(errno)); +- if(debug) malloc_stats(); + exit(EXIT_FAILURE); + } + return mem; +@@ -51,7 +50,6 @@ extern "C" { + void *mem = SYS_REALLOC(ptr, bytes); + if(mem == NULL) { + myLog(LOG_ERR, "realloc() failed : %s", strerror(errno)); +- if(debug) malloc_stats(); + exit(EXIT_FAILURE); + } + return mem; diff --git a/net/hsflowd/patches/300-config_files_path.patch b/net/hsflowd/patches/300-config_files_path.patch new file mode 100644 index 0000000..fe85a8e --- /dev/null +++ b/net/hsflowd/patches/300-config_files_path.patch @@ -0,0 +1,16 @@ +diff -Nurb a/src/Linux/hsflowd.h b/src/Linux/hsflowd.h +--- a/src/Linux/hsflowd.h 2012-03-01 18:16:09.000000000 +0100 ++++ b/src/Linux/hsflowd.h 2012-03-18 18:56:58.689852282 +0100 +@@ -72,9 +72,9 @@ + #define HSP_DAEMON_NAME "hsflowd" + #define HSP_DEFAULT_PIDFILE "/var/run/hsflowd.pid" + #define HSP_DEFAULT_CONFIGFILE "/etc/hsflowd.conf" +-#define HSP_DEFAULT_OUTPUTFILE "/etc/hsflowd.auto" +-#define HSP_DEFAULT_VMSTORE_FILE "/etc/hsflowd.data" +-#define HSP_DEFAULT_CRASH_FILE "/etc/hsflowd.crash" ++#define HSP_DEFAULT_OUTPUTFILE "/var/run/hsflowd.auto" ++#define HSP_DEFAULT_VMSTORE_FILE "/var/run/hsflowd.data" ++#define HSP_DEFAULT_CRASH_FILE "/var/run/hsflowd.crash" + + /* Numbering to avoid clash. See http://www.sflow.org/developers/dsindexnumbers.php */ + #define HSP_DEFAULT_PHYSICAL_DSINDEX 1 diff --git a/net/hsflowd/patches/400-sflowovsd_assert.patch b/net/hsflowd/patches/400-sflowovsd_assert.patch new file mode 100644 index 0000000..dec63b1 --- /dev/null +++ b/net/hsflowd/patches/400-sflowovsd_assert.patch @@ -0,0 +1,12 @@ +diff -Nurb a/src/Linux/Makefile b/src/Linux/Makefile +--- a/src/Linux/Makefile 2011-09-07 01:15:22.000000000 +0200 ++++ b/src/Linux/Makefile 2012-03-21 01:55:40.468569332 +0100 +@@ -97,7 +97,7 @@ + + SFLOWOVS_OBJS=sflowovsd.o util.o + +-CFLAGS+= -I. -I$(SFLOWDIR) $(OPT) -Wall -D_GNU_SOURCE -DHSP_VERSION=$(VERSION) -DUTHEAP ++CFLAGS+= -I. -I$(SFLOWDIR) $(OPT) -Wall -D_GNU_SOURCE -DHSP_VERSION=$(VERSION) + LIBS+= $(SFLOWDIR)/libsflow.a -lresolv -lpthread + + #### BUILD #### diff --git a/net/htpdate/Makefile b/net/htpdate/Makefile new file mode 100644 index 0000000..8c1e9e3 --- /dev/null +++ b/net/htpdate/Makefile @@ -0,0 +1,56 @@ +# +# 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:=htpdate +PKG_VERSION:=1.0.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.clevervest.com/htp/archive/c/ +PKG_MD5SUM:=a13ec89839c33965794ebf53c4e690db + +include $(INCLUDE_DIR)/package.mk + +define Package/htpdate + SUBMENU:=Time Synchronization + SECTION:=net + CATEGORY:=Network + TITLE:=an HTP (Hypertext Time Protocol) implementation + URL:=http://www.clevervest.com/htp/ +endef + +define Package/htpdate/description + The HTTP Time Protocol (HTP) is used to synchronize a computer's time + with web servers as reference time source. Htpdate will synchronize your + computer's time by extracting timestamps from HTTP headers found + in web server responses. Htpdate can be used as a daemon, to keep your + computer synchronized. +endef + +define Package/htpdate/conffiles +/etc/default/htpdate +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" +endef + +define Package/htpdate/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/htpdate $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/default/ + $(INSTALL_CONF) ./files/htpdate.default $(1)/etc/default/htpdate + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/htpdate.init $(1)/etc/init.d/htpdate +endef + +$(eval $(call BuildPackage,htpdate)) + diff --git a/net/htpdate/files/htpdate.default b/net/htpdate/files/htpdate.default new file mode 100644 index 0000000..94674fd --- /dev/null +++ b/net/htpdate/files/htpdate.default @@ -0,0 +1 @@ +OPTIONS="www.google.com www.yahoo.com www.linux.org www.freebsd.org" diff --git a/net/htpdate/files/htpdate.init b/net/htpdate/files/htpdate.init new file mode 100644 index 0000000..1409321 --- /dev/null +++ b/net/htpdate/files/htpdate.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +START=49 +BIN=htpdate +DEFAULT=/etc/default/$BIN +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid + +start() { + [ -f $DEFAULT ] && . $DEFAULT + mkdir -p $RUN_D + $BIN -l -s -t $OPTIONS && $BIN -D $OPTIONS +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) +} + diff --git a/net/htpdate/patches/100-adjtimex.patch b/net/htpdate/patches/100-adjtimex.patch new file mode 100644 index 0000000..ec7c8a9 --- /dev/null +++ b/net/htpdate/patches/100-adjtimex.patch @@ -0,0 +1,20 @@ +--- a/htpdate.c ++++ b/htpdate.c +@@ -359,7 +359,7 @@ static int htpdate_adjtimex( double drif + + /* Read current kernel frequency */ + tmx.modes = 0; +- ntp_adjtime(&tmx); ++ adjtimex(&tmx); + + /* Calculate new frequency */ + freq = (long)(65536e6 * drift); +@@ -377,7 +377,7 @@ static int htpdate_adjtimex( double drif + printlog( 1, "seteuid()" ); + exit(1); + } else { +- return( ntp_adjtime(&tmx) ); ++ return( adjtimex(&tmx) ); + } + + } diff --git a/net/httping/Makefile b/net/httping/Makefile new file mode 100644 index 0000000..cb18864 --- /dev/null +++ b/net/httping/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (C) 2006-2011 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:=httping +PKG_VERSION:=1.5.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://www.vanheusden.com/httping +PKG_MD5SUM:=49f72b124afb8a60f152ec674a162ad6 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/httping/Default + SECTION:=net + CATEGORY:=Network + TITLE:=Httping is like 'ping' but for http-requests + URL:=http://www.vanheusden.com/httping/ +endef + +define Package/httping/Default/description + Give it an url, and it'll show you how long it takes to connect, send a + request and retrieve the reply (only the headers). Be aware that the + transmission across the network also takes time! +endef + +define Package/httping + $(call Package/httping/Default) + DEPENDS+= +libopenssl + TITLE+= (with SSL support) + VARIANT:=ssl +endef + +define Package/httping/description + $(call Package/httping/Default/description) + This package is built with SSL support. +endef + +define Package/httping-nossl + $(call Package/httping/Default) + TITLE+= (without SSL support) + VARIANT:=nossl +endef + +define Package/httping-nossl/description + $(call Package/httping/Default/description) + This package is built without SSL support. +endef + +TARGET_CFLAGS += -D_GNU_SOURCE + +ifeq ($(BUILD_VARIANT),nossl) + MAKE_FLAGS += SSL="no" + TARGET_CFLAGS += -DNO_SSL +endif + +define Package/httping/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/httping $(1)/usr/bin/ +endef + +Package/httping-nossl/install = $(Package/httping/install) + +$(eval $(call BuildPackage,httping)) +$(eval $(call BuildPackage,httping-nossl)) diff --git a/net/httping/patches/002-version.patch b/net/httping/patches/002-version.patch new file mode 100644 index 0000000..23c12e9 --- /dev/null +++ b/net/httping/patches/002-version.patch @@ -0,0 +1,29 @@ +--- a/main.c ++++ b/main.c +@@ -41,6 +41,8 @@ + #include "utils.h" + #include "error.h" + ++#define VERSION "1.5.2" ++ + static volatile int stop = 0; + + int quiet = 0; +@@ -52,7 +54,7 @@ char last_error[ERROR_BUFFER_SIZE]; + + void version(void) + { +- fprintf(stderr, "HTTPing v" VERSION ", (C) 2003-2011 folkert@vanheusden.com\n"); ++ fprintf(stderr, "HTTPing v%s (C) 2003-2011 folkert@vanheusden.com\n", VERSION); + #ifndef NO_SSL + fprintf(stderr, "SSL support included\n"); + #endif +@@ -639,7 +641,7 @@ int main(int argc, char *argv[]) + if (useragent) + sprintf(&request[strlen(request)], "User-Agent: %s\r\n", useragent); + else +- sprintf(&request[strlen(request)], "User-Agent: HTTPing v" VERSION "\r\n"); ++ sprintf(&request[strlen(request)], "User-Agent: HTTPing v%s\r\n", VERSION); + sprintf(&request[strlen(request)], "Host: %s\r\n", hostname); + if (referer) + sprintf(&request[strlen(request)], "Referer: %s\r\n", referer); diff --git a/net/httptunnel/Makefile b/net/httptunnel/Makefile new file mode 100644 index 0000000..ba753ee --- /dev/null +++ b/net/httptunnel/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2006-2011 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:=httptunnel +PKG_VERSION:=3.3 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.nocrew.org/pub/nocrew/unix/ +PKG_MD5SUM:=493cc0f5f21e9955db27ee9cd9a976d5 + +include $(INCLUDE_DIR)/package.mk + +define Package/httptunnel + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libopenssl + SUBMENU:=Firewall Tunnel + TITLE:=bidirectional tunnel in HTTP requests + URL:=http://www.nocrew.org/software/httptunnel.html +endef + +define Package/httptunnel/description + httptunnel creates a bidirectional virtual data connection tunnelled in HTTP requests. + The HTTP requests can be sent via an HTTP proxy if so desired. +endef + +define Package/httptunnel/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/hts $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/htc $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/httptunnel.init $(1)/etc/init.d/httptunnel + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/httptunnel.config $(1)/etc/config/httptunnel +endef + +define Package/httptunnel/conffiles +/etc/config/httptunnel +endef + +$(eval $(call BuildPackage,httptunnel)) diff --git a/net/httptunnel/files/httptunnel.config b/net/httptunnel/files/httptunnel.config new file mode 100644 index 0000000..fb5a5dd --- /dev/null +++ b/net/httptunnel/files/httptunnel.config @@ -0,0 +1,4 @@ +config httptunnel + option destination 'localhost:443' + option sourceport '80' + diff --git a/net/httptunnel/files/httptunnel.init b/net/httptunnel/files/httptunnel.init new file mode 100644 index 0000000..6c84618 --- /dev/null +++ b/net/httptunnel/files/httptunnel.init @@ -0,0 +1,27 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007 OpenWrt.org +START=70 +BIN=hts + +start_httptunnel() { + local section="$1" + + config_get destination "$section" destination + config_get sourceport "$section" sourceport + + echo start httptunnel: dest: "$destination", src: "$sourceport" + + $BIN --forward-port "$destination" "$sourceport" +} + + +start() { + config_load httptunnel + config_foreach start_httptunnel httptunnel +} + +stop() { + ps aux | grep hts | awk '{print }' | \ + xargs kill 2> /dev/null +} + \ No newline at end of file diff --git a/net/icmptx/Makefile b/net/icmptx/Makefile new file mode 100644 index 0000000..2622de3 --- /dev/null +++ b/net/icmptx/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=icmptx +PKG_REV:=33e0b826f99df290ee792f6aa587af273d674309 +PKG_VERSION:=0.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://github.com/jakkarth/icmptx.git +PKG_SOURCE_VERSION:=$(PKG_REV) + +include $(INCLUDE_DIR)/package.mk + +define Package/icmptx + SECTION:=net + CATEGORY:=Network + SUBMENU:=Firewall Tunnel + TITLE:=IP-over-ICMP tunnel + URL:=http://github.com/jakkarth/icmptx +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + OPT_FLAGS="$(TARGET_CFLAGS)" \ + icmptx +endef + +define Package/icmptx/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/icmptx $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,icmptx)) diff --git a/net/icmptx/patches/001-cross_compile.patch b/net/icmptx/patches/001-cross_compile.patch new file mode 100644 index 0000000..c048d56 --- /dev/null +++ b/net/icmptx/patches/001-cross_compile.patch @@ -0,0 +1,24 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,15 +1,17 @@ +-flags=-g3 -Wall -ansi -pedantic -D_GNU_SOURCE ++OPT_FLAGS=-g3 ++ ++flags=$(OPT_FLAGS) -Wall -ansi -pedantic -D_GNU_SOURCE + + all: icmptx + + icmptx: it.o icmptx.c tun_dev.o +- gcc $(flags) -o icmptx icmptx.c it.o tun_dev.o ++ $(CC) $(flags) -o icmptx icmptx.c it.o tun_dev.o + + it.o: it.c tun_dev.h +- gcc $(flags) -c it.c ++ $(CC) $(flags) -c it.c + + tun_dev.o: tun_dev.c +- gcc $(flags) -c tun_dev.c ++ $(CC) $(flags) -c tun_dev.c + + clean: + rm -f tun_dev.o it.o icmptx diff --git a/net/ifstat/Makefile b/net/ifstat/Makefile new file mode 100644 index 0000000..0e54542 --- /dev/null +++ b/net/ifstat/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2007 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:=ifstat +PKG_VERSION:=1.1 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=http://gael.roualland.free.fr/ifstat +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=b655642c33a626cfe976792fbcd9b6e1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ifstat + SECTION:=net + CATEGORY:=Network + TITLE:=Network interface bandwidth usage + URL:=http://gael.roualland.free.fr/ifstat/ +endef + +define Package/ifstat/description + Network interface bandwidth usage, with support for snmp targets +endef + +CONFIGURE_ARGS += \ + --with-proc=yes \ + --with-snmp=no \ + +define Build/Configure + (cd $(PKG_BUILD_DIR); touch \ + config.h.in \ + configure \ + ); + $(call Build/Configure/Default) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) all +endef + +define Package/ifstat/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ifstat $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,ifstat)) diff --git a/net/ifstat/patches/001-configure_cross.patch b/net/ifstat/patches/001-configure_cross.patch new file mode 100644 index 0000000..053b055 --- /dev/null +++ b/net/ifstat/patches/001-configure_cross.patch @@ -0,0 +1,913 @@ +diff -ruN ifstat-1.1-old/configure ifstat-1.1-new/configure +--- ifstat-1.1-old/configure 2004-01-01 20:18:14.000000000 +0100 ++++ ifstat-1.1-new/configure 2007-09-06 12:20:40.000000000 +0200 +@@ -1387,34 +1387,39 @@ + esac + echo $ac_n "checking for proc interface in $file""... $ac_c" 1>&6 + echo "configure:1390: checking for proc interface in $file" >&5 +- if grep -q Inter- $file 2>/dev/null; then +- cat >> confdefs.h <<\EOF ++ if test "$cross_compiling" = yes; then ++ with_proc=cross ++ elif grep -q Inter- $file 2>/dev/null; then ++ with_proc=yes ++ else ++ with_proc=no ++ fi ++ echo "$ac_t""$with_proc" 1>&6 ++fi ++if test "x$with_proc" != "xno"; then ++ cat >> confdefs.h <<\EOF + #define USE_PROC 1 + EOF + +- cat >> confdefs.h <> confdefs.h <&6 ++ with_proc=yes ++ with_ioctl=yes ++ local=yes + fi + + # checking for kstat (Solaris) + test "x$with_kstat" = "xauto" -a "x$local" = "xyes" && with_kstat=no + if test "x$with_kstat" != "xno"; then + echo $ac_n "checking for kstat_open""... $ac_c" 1>&6 +-echo "configure:1413: checking for kstat_open" >&5 ++echo "configure:1418: checking for kstat_open" >&5 + if eval "test \"`echo '$''{'ac_cv_func_kstat_open'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:1446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_kstat_open=yes" + else +@@ -1461,7 +1466,7 @@ + case "x$LIBS" in + *-lkstat*) ;; + *) echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 +-echo "configure:1465: checking for kstat_open in -lkstat" >&5 ++echo "configure:1470: checking for kstat_open in -lkstat" >&5 + ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -1469,7 +1474,7 @@ + ac_save_LIBS="$LIBS" + LIBS="-lkstat $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:1489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -1507,17 +1512,17 @@ + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:1511: checking for $ac_hdr" >&5 ++echo "configure:1516: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:1526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -1557,17 +1562,17 @@ + if test "x$with_ifmib" != "xno"; then + ac_safe=`echo "net/if_mib.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for net/if_mib.h""... $ac_c" 1>&6 +-echo "configure:1561: checking for net/if_mib.h" >&5 ++echo "configure:1566: checking for net/if_mib.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:1576: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -1584,12 +1589,12 @@ + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + echo $ac_n "checking for sysctl""... $ac_c" 1>&6 +-echo "configure:1588: checking for sysctl" >&5 ++echo "configure:1593: checking for sysctl" >&5 + if eval "test \"`echo '$''{'ac_cv_func_sysctl'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:1621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_sysctl=yes" + else +@@ -1642,17 +1647,17 @@ + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:1646: checking for $ac_hdr" >&5 ++echo "configure:1651: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1656: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:1661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -1679,13 +1684,13 @@ + done + + echo $ac_n "checking for working ifmib sysctl""... $ac_c" 1>&6 +-echo "configure:1683: checking for working ifmib sysctl" >&5 ++echo "configure:1688: checking for working ifmib sysctl" >&5 + # try run since interface is available on darwin but doesn't work + if test "$cross_compiling" = yes; then + with_ifmib=maybe + else + cat > conftest.$ac_ext < + #include +@@ -1706,7 +1711,7 @@ + int size; + int main() { return sysctl(ifcount, 5, NULL, &size, NULL, NULL); } + EOF +-if { (eval echo configure:1710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:1715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + with_ifmib=yes + else +@@ -1733,9 +1738,9 @@ + test "x$with_ifdata" = "xauto" -a "x$local" = "xyes" && with_ifdata=no + if test "x$with_ifdata" != "xno"; then + echo $ac_n "checking for SIOCGIFDATA and ifdatareq""... $ac_c" 1>&6 +-echo "configure:1737: checking for SIOCGIFDATA and ifdatareq" >&5 ++echo "configure:1742: checking for SIOCGIFDATA and ifdatareq" >&5 + cat > conftest.$ac_ext < + #include +@@ -1753,7 +1758,7 @@ + ifd.ifd_ifd.ifi_ibytes = ifd.ifd_ifd.ifi_obytes; + ; return 0; } + EOF +-if { (eval echo configure:1757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + with_ifdata=yes + else +@@ -1768,9 +1773,9 @@ + fi + if test "x$with_ifdata" = "xcheckifr"; then + echo $ac_n "checking for SIOCGIFDATA and ifreq.ifr_data""... $ac_c" 1>&6 +-echo "configure:1772: checking for SIOCGIFDATA and ifreq.ifr_data" >&5 ++echo "configure:1777: checking for SIOCGIFDATA and ifreq.ifr_data" >&5 + cat > conftest.$ac_ext < + #include +@@ -1789,7 +1794,7 @@ + ifd.ifi_ibytes = ifd.ifi_obytes; + ; return 0; } + EOF +-if { (eval echo configure:1793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + with_ifdata=yes + cat >> confdefs.h <<\EOF +@@ -1821,17 +1826,17 @@ + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:1825: checking for $ac_hdr" >&5 ++echo "configure:1830: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1835: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:1840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -1858,12 +1863,12 @@ + done + + echo $ac_n "checking for sysctl""... $ac_c" 1>&6 +-echo "configure:1862: checking for sysctl" >&5 ++echo "configure:1867: checking for sysctl" >&5 + if eval "test \"`echo '$''{'ac_cv_func_sysctl'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:1895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_sysctl=yes" + else +@@ -1908,9 +1913,9 @@ + + if test "x$with_route" = "xyes"; then + echo $ac_n "checking for route info sysctl""... $ac_c" 1>&6 +-echo "configure:1912: checking for route info sysctl" >&5 ++echo "configure:1917: checking for route info sysctl" >&5 + cat > conftest.$ac_ext < + #include +@@ -1935,7 +1940,7 @@ + ifm.ifm_data.ifi_ibytes; + ; return 0; } + EOF +-if { (eval echo configure:1939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + with_route=yes + else +@@ -1960,12 +1965,12 @@ + test "x$with_kvm" = "xauto" -a "x$local" = "xyes" && with_kvm=no + if test "x$with_kvm" != "xno"; then + echo $ac_n "checking for kvm_openfiles""... $ac_c" 1>&6 +-echo "configure:1964: checking for kvm_openfiles" >&5 ++echo "configure:1969: checking for kvm_openfiles" >&5 + if eval "test \"`echo '$''{'ac_cv_func_kvm_openfiles'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:1997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_kvm_openfiles=yes" + else +@@ -2012,7 +2017,7 @@ + case "x$LIBS" in + *-lkvm*) ;; + *) echo $ac_n "checking for kvm_openfiles in -lkvm""... $ac_c" 1>&6 +-echo "configure:2016: checking for kvm_openfiles in -lkvm" >&5 ++echo "configure:2021: checking for kvm_openfiles in -lkvm" >&5 + ac_lib_var=`echo kvm'_'kvm_openfiles | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -2020,7 +2025,7 @@ + ac_save_LIBS="$LIBS" + LIBS="-lkvm $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -2059,17 +2064,17 @@ + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:2063: checking for $ac_hdr" >&5 ++echo "configure:2068: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:2073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -2093,12 +2098,12 @@ + for ac_func in knlist + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:2097: checking for $ac_func" >&5 ++echo "configure:2102: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -2142,16 +2147,16 @@ + + with_kvm=yes + echo $ac_n "checking whether knlist takes 3 arguments""... $ac_c" 1>&6 +-echo "configure:2146: checking whether knlist takes 3 arguments" >&5 ++echo "configure:2151: checking whether knlist takes 3 arguments" >&5 + cat > conftest.$ac_ext < + int main() { + knlist((struct nlist *) 0, 0, 10); + ; return 0; } + EOF +-if { (eval echo configure:2155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:2160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + knlist3=yes + else +@@ -2172,12 +2177,12 @@ + else + echo "$ac_t""no" 1>&6 + echo $ac_n "checking for nlist""... $ac_c" 1>&6 +-echo "configure:2176: checking for nlist" >&5 ++echo "configure:2181: checking for nlist" >&5 + if eval "test \"`echo '$''{'ac_cv_func_nlist'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_nlist=yes" + else +@@ -2232,12 +2237,12 @@ + for ac_func in readx + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:2236: checking for $ac_func" >&5 ++echo "configure:2241: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -2288,17 +2293,17 @@ + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:2292: checking for $ac_hdr" >&5 ++echo "configure:2297: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:2302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -2330,17 +2335,17 @@ + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:2334: checking for $ac_hdr" >&5 ++echo "configure:2339: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:2344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2349: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -2373,9 +2378,9 @@ + fi + if test "x$with_kvm" = "xyes"; then + echo $ac_n "checking whether struct ifnet has needed interface data""... $ac_c" 1>&6 +-echo "configure:2377: checking whether struct ifnet has needed interface data" >&5 ++echo "configure:2382: checking whether struct ifnet has needed interface data" >&5 + cat > conftest.$ac_ext < + #include +@@ -2388,7 +2393,7 @@ + in.if_type = in.if_flags + ; return 0; } + EOF +-if { (eval echo configure:2392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:2397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + with_kvm=yes + else +@@ -2402,9 +2407,9 @@ + fi + if test "x$with_kvm" = "xyes"; then + echo $ac_n "checking for struct ifnet if_xname member""... $ac_c" 1>&6 +-echo "configure:2406: checking for struct ifnet if_xname member" >&5 ++echo "configure:2411: checking for struct ifnet if_xname member" >&5 + cat > conftest.$ac_ext < + #include +@@ -2416,7 +2421,7 @@ + struct ifnet in; in.if_xname[0] = 'a'; + ; return 0; } + EOF +-if { (eval echo configure:2420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:2425: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ifxname=yes + else +@@ -2433,9 +2438,9 @@ + echo "$ac_t""$ifxname" 1>&6 + + echo $ac_n "checking for struct ifnet if_next member""... $ac_c" 1>&6 +-echo "configure:2437: checking for struct ifnet if_next member" >&5 ++echo "configure:2442: checking for struct ifnet if_next member" >&5 + cat > conftest.$ac_ext < + #include +@@ -2447,7 +2452,7 @@ + struct ifnet in; in.if_next; + ; return 0; } + EOF +-if { (eval echo configure:2451: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:2456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ifnext=yes + else +@@ -2465,9 +2470,9 @@ + + else + echo $ac_n "checking for struct ifnet if_link member""... $ac_c" 1>&6 +-echo "configure:2469: checking for struct ifnet if_link member" >&5 ++echo "configure:2474: checking for struct ifnet if_link member" >&5 + cat > conftest.$ac_ext < + #include +@@ -2479,7 +2484,7 @@ + struct ifnet in; in.if_link; + ; return 0; } + EOF +-if { (eval echo configure:2483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:2488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + iflink=yes + else +@@ -2512,17 +2517,17 @@ + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:2516: checking for $ac_hdr" >&5 ++echo "configure:2521: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:2526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2531: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -2549,9 +2554,9 @@ + done + + echo $ac_n "checking for dlpi streams interface""... $ac_c" 1>&6 +-echo "configure:2553: checking for dlpi streams interface" >&5 ++echo "configure:2558: checking for dlpi streams interface" >&5 + cat > conftest.$ac_ext < +@@ -2573,7 +2578,7 @@ + struct strbuf ctlptr; putmsg(0, &ctlptr, NULL, 0); + ; return 0; } + EOF +-if { (eval echo configure:2577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:2582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + with_dlpi=yes + else +@@ -2596,11 +2601,11 @@ + test "x$with_win32" = "xauto" -a "x$local" = "xyes" && with_win32=no + if test "x$with_win32" != "xno"; then + echo $ac_n "checking for win32 GetIfTable interface""... $ac_c" 1>&6 +-echo "configure:2600: checking for win32 GetIfTable interface" >&5 ++echo "configure:2605: checking for win32 GetIfTable interface" >&5 + OLIBS="$LIBS" + LIBS="$LIBS -liphlpapi" + cat > conftest.$ac_ext < + #include +@@ -2608,7 +2613,7 @@ + GetIfTable(NULL, NULL, 0); + ; return 0; } + EOF +-if { (eval echo configure:2612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + with_win32=yes + else +@@ -2636,12 +2641,12 @@ + EOF + + echo $ac_n "checking for socket""... $ac_c" 1>&6 +-echo "configure:2640: checking for socket" >&5 ++echo "configure:2645: checking for socket" >&5 + if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_socket=yes" + else +@@ -2688,7 +2693,7 @@ + case "x$LIBS" in + *-lsocket*);; + *) echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 +-echo "configure:2692: checking for socket in -lsocket" >&5 ++echo "configure:2697: checking for socket in -lsocket" >&5 + ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -2696,7 +2701,7 @@ + ac_save_LIBS="$LIBS" + LIBS="-lsocket $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -2737,12 +2742,12 @@ + esac + fi + echo $ac_n "checking for if_nameindex""... $ac_c" 1>&6 +-echo "configure:2741: checking for if_nameindex" >&5 ++echo "configure:2746: checking for if_nameindex" >&5 + if eval "test \"`echo '$''{'ac_cv_func_if_nameindex'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_if_nameindex=yes" + else +@@ -2789,7 +2794,7 @@ + case "x$LIBS" in + *-lnsl*);; + *) echo $ac_n "checking for if_nameindex in -lnsl""... $ac_c" 1>&6 +-echo "configure:2793: checking for if_nameindex in -lnsl" >&5 ++echo "configure:2798: checking for if_nameindex in -lnsl" >&5 + ac_lib_var=`echo nsl'_'if_nameindex | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -2797,7 +2802,7 @@ + ac_save_LIBS="$LIBS" + LIBS="-lnsl $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -2832,9 +2837,9 @@ + fi + if test "x$ifnameindex" != "xyes"; then + echo $ac_n "checking for sockaddr sa_len member""... $ac_c" 1>&6 +-echo "configure:2836: checking for sockaddr sa_len member" >&5 ++echo "configure:2841: checking for sockaddr sa_len member" >&5 + cat > conftest.$ac_ext < +@@ -2843,7 +2848,7 @@ + struct sockaddr sa; sa.sa_len = 1; + ; return 0; } + EOF +-if { (eval echo configure:2847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:2852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + salen=yes + else +@@ -2875,7 +2880,7 @@ + # Extract the first word of "net-snmp-config", so it can be a program name with args. + set dummy net-snmp-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2879: checking for $ac_word" >&5 ++echo "configure:2884: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_netsnmpconfig'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2912,16 +2917,16 @@ + CPPFLAGS="$CPPFLAGS `$netsnmpconfig --base-cflags 2>/dev/null`" + LDFLAGS="$LDFLAGS `$netsnmpconfig --libs 2>/dev/null`" + echo $ac_n "checking whether net-snmp-config hints compiles and links fine""... $ac_c" 1>&6 +-echo "configure:2916: checking whether net-snmp-config hints compiles and links fine" >&5 ++echo "configure:2921: checking whether net-snmp-config hints compiles and links fine" >&5 + cat > conftest.$ac_ext < + int main() { + snmp_sess_init((void *) 0); + ; return 0; } + EOF +-if { (eval echo configure:2925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + snmp_ok=yes + else +@@ -2948,17 +2953,17 @@ + fi + ac_safe=`echo "net-snmp/net-snmp-config.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for net-snmp/net-snmp-config.h""... $ac_c" 1>&6 +-echo "configure:2952: checking for net-snmp/net-snmp-config.h" >&5 ++echo "configure:2957: checking for net-snmp/net-snmp-config.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:2962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -2979,17 +2984,17 @@ + echo "$ac_t""no" 1>&6 + ac_safe=`echo "ucd-snmp/ucd-snmp-config.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for ucd-snmp/ucd-snmp-config.h""... $ac_c" 1>&6 +-echo "configure:2983: checking for ucd-snmp/ucd-snmp-config.h" >&5 ++echo "configure:2988: checking for ucd-snmp/ucd-snmp-config.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:2993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2998: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -3040,18 +3045,18 @@ + for lib in $SNMPLIBALONE "$libsnmp -lcrypto" ; do + if test "x$with_snmp" != "xyes" ; then + echo $ac_n "checking for snmp support in $lib""... $ac_c" 1>&6 +-echo "configure:3044: checking for snmp support in $lib" >&5 ++echo "configure:3049: checking for snmp support in $lib" >&5 + OLIBS="$LIBS" + LIBS="$LIBS $lib" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:3060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + with_snmp=yes + else +diff -ruN ifstat-1.1-old/configure.in ifstat-1.1-new/configure.in +--- ifstat-1.1-old/configure.in 2003-11-22 02:27:51.000000000 +0100 ++++ ifstat-1.1-new/configure.in 2007-09-06 12:20:21.000000000 +0200 +@@ -59,17 +59,22 @@ + *) file=/proc/net/dev ;; + esac + AC_MSG_CHECKING([for proc interface in $file]) +- if grep -q Inter- $file 2>/dev/null; then +- AC_DEFINE([USE_PROC], 1, [Define if you want to use /proc to get stats]) +- AC_DEFINE_UNQUOTED([PROC_FILE], ["$file"], [Proc file to poll for stats]) ++ if test "$cross_compiling" = yes; then ++ with_proc=cross ++ elif grep -q Inter- $file 2>/dev/null; then + with_proc=yes +- with_ioctl=yes +- local=yes + else + with_proc=no + fi + AC_MSG_RESULT([$with_proc]) + fi ++if test "x$with_proc" != "xno"; then ++ AC_DEFINE([USE_PROC], 1, [Define if you want to use /proc to get stats]) ++ AC_DEFINE_UNQUOTED([PROC_FILE], ["$file"], [Proc file to poll for stats]) ++ with_proc=yes ++ with_ioctl=yes ++ local=yes ++fi + + # checking for kstat (Solaris) + test "x$with_kstat" = "xauto" -a "x$local" = "xyes" && with_kstat=no diff --git a/net/iftop/Makefile b/net/iftop/Makefile new file mode 100644 index 0000000..9bd0461 --- /dev/null +++ b/net/iftop/Makefile @@ -0,0 +1,40 @@ +# +# 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:=iftop +PKG_VERSION:=0.17 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.ex-parrot.com/~pdw/iftop/download +PKG_MD5SUM:=062bc8fb3856580319857326e0b8752d + +include $(INCLUDE_DIR)/package.mk + +define Package/iftop + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +libncurses +libpthread + TITLE:=display bandwith usage on an interface + URL:=http://www.ex-parrot.com/~pdw/iftop/ +endef + +define Package/iftop/description + iftop does for network usage what top(1) does for CPU usage. It + listens to network traffic on a named interface and displays a + table of current bandwidth usage by pairs of hosts. Handy for + answering the question 'why is our ADSL link so slow?'. +endef + +define Package/iftop/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/iftop $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,iftop)) diff --git a/net/iftop/patches/001-debian_armeb.patch b/net/iftop/patches/001-debian_armeb.patch new file mode 100644 index 0000000..8abd92e --- /dev/null +++ b/net/iftop/patches/001-debian_armeb.patch @@ -0,0 +1,11 @@ +--- a/ether.h ++++ b/ether.h +@@ -12,7 +12,7 @@ struct ether_header { + u_int8_t ether_dhost[ETHER_ADDR_LEN]; + u_int8_t ether_shost[ETHER_ADDR_LEN]; + u_int16_t ether_type; +-}; ++} __attribute__((packed)); + + struct vlan_8021q_header { + u_int16_t priority_cfi_vid; diff --git a/net/iftop/patches/002-debian_frozen_order.patch b/net/iftop/patches/002-debian_frozen_order.patch new file mode 100644 index 0000000..c622036 --- /dev/null +++ b/net/iftop/patches/002-debian_frozen_order.patch @@ -0,0 +1,10 @@ +--- a/ui.c ++++ b/ui.c +@@ -446,6 +446,7 @@ void screen_hash_clear() { + hash_node_type* n = NULL; + while(hash_next_item(screen_hash, &n) == HASH_STATUS_OK) { + host_pair_line* hpl = (host_pair_line*)n->rec; ++ hpl->total_recv = hpl->total_sent = 0; + memset(hpl->recv, 0, sizeof(hpl->recv)); + memset(hpl->sent, 0, sizeof(hpl->sent)); + } diff --git a/net/iftop/patches/003-debian_arm.patch b/net/iftop/patches/003-debian_arm.patch new file mode 100644 index 0000000..090ea1c --- /dev/null +++ b/net/iftop/patches/003-debian_arm.patch @@ -0,0 +1,15 @@ +--- a/cfgfile.c ++++ b/cfgfile.c +@@ -45,9 +45,9 @@ stringmap config; + extern options_t options ; + + int is_cfgdirective_valid(const char *s) { +- char **t; +- for (t = config_directives; *t != NULL; ++t) +- if (strcmp(s, *t) == 0) return 1; ++ int t; ++ for (t = 0; config_directives[t] != NULL; t++) ++ if (strcmp(s, config_directives[t]) == 0) return 1; + return 0; + } + diff --git a/net/iftop/patches/004-debian_bar_display.patch b/net/iftop/patches/004-debian_bar_display.patch new file mode 100644 index 0000000..7efaa2b --- /dev/null +++ b/net/iftop/patches/004-debian_bar_display.patch @@ -0,0 +1,11 @@ +--- a/options.c ++++ b/options.c +@@ -302,7 +302,7 @@ void options_read_args(int argc, char ** + break; + + case 'b': +- config_set_string("show-bars", "true"); ++ config_set_string("show-bars", "false"); + break; + + case 'B': diff --git a/net/iftop/patches/005-debian_bar_bytes.patch b/net/iftop/patches/005-debian_bar_bytes.patch new file mode 100644 index 0000000..b9ecc26 --- /dev/null +++ b/net/iftop/patches/005-debian_bar_bytes.patch @@ -0,0 +1,11 @@ +--- a/ui.c ++++ b/ui.c +@@ -263,7 +263,7 @@ static void draw_bar_scale(int* y) { + char s[40], *p; + int x; + /* This 1024 vs 1000 stuff is just plain evil */ +- readable_size(i, s, sizeof s, options.log_scale ? 1000 : 1024, 0); ++ readable_size(i, s, sizeof s, options.log_scale ? 1000 : 1024, options.bandwidth_in_bytes); + p = s + strspn(s, " "); + x = get_bar_length(i * 8); + mvaddch(*y + 1, x, ACS_BTEE); diff --git a/net/igmpproxy/Makefile b/net/igmpproxy/Makefile new file mode 100644 index 0000000..1e18ee0 --- /dev/null +++ b/net/igmpproxy/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2006-2011 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:=igmpproxy +PKG_VERSION:=0.1 +PKG_RELEASE:=8 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/igmpproxy +PKG_MD5SUM:=c56f41ec195bc1fe016369bf74efc5a1 + +include $(INCLUDE_DIR)/package.mk + +PKG_FIXUP:=autoreconf + +define Package/igmpproxy + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + DEPENDS:=+USE_EGLIBC:librt + TITLE:=Multicast Routing Daemon + URL:=http://sourceforge.net/projects/igmpproxy +endef + +define Package/igmpproxy/description + IGMPproxy is a simple dynamic Multicast Routing Daemon using + only IGMP signalling (Internet Group Management Protocol). +endef + +define Package/igmpproxy/conffiles +/etc/config/igmpproxy +endef + +TARGET_CFLAGS += -Dlog=igmpproxy_log + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/src \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -std=gnu99" +endef + +define Package/igmpproxy/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/igmpproxy.config $(1)/etc/config/igmpproxy + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/igmpproxy.init $(1)/etc/init.d/igmpproxy + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/igmpproxy $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,igmpproxy)) diff --git a/net/igmpproxy/files/igmpproxy.config b/net/igmpproxy/files/igmpproxy.config new file mode 100644 index 0000000..ca625ac --- /dev/null +++ b/net/igmpproxy/files/igmpproxy.config @@ -0,0 +1,11 @@ +config igmpproxy + option quickleave 1 + +config phyint + option network wan + option direction upstream + list altnet 192.168.1.0/24 + +config phyint + option network lan + option direction downstream diff --git a/net/igmpproxy/files/igmpproxy.init b/net/igmpproxy/files/igmpproxy.init new file mode 100644 index 0000000..a45978f --- /dev/null +++ b/net/igmpproxy/files/igmpproxy.init @@ -0,0 +1,63 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2012 OpenWrt.org + +START=99 +STOP=10 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +# igmpproxy supports both a debug mode and verbosity, which are very useful +# when something isn't working. +# +# Debug mode will print everything to stdout instead of syslog. Generally +# verbosity should NOT be set as it will quickly fill your syslog. +# +# Put any debug or verbosity options into IGMP_OPTS +# +# Examples: +# OPTIONS="-d -v -v" - debug mode and very verbose, this will land in +# stdout and not in syslog +# OPTIONS="-v" - be verbose, this will write aditional information to syslog + +OPTIONS="" + +igmp_header() { + local quickleave + config_get_bool quickleave "$1" quickleave 0 + + mkdir -p /var/etc + rm -f /var/etc/igmpproxy.conf + [ $quickleave -gt 0 ] && echo "quickleave" >> /var/etc/igmpproxy.conf + + [ -L /etc/igmpproxy.conf ] || ln -nsf /var/etc/igmpproxy.conf /etc/igmpproxy.conf +} + +igmp_add_phyint() { + local network direction altnets + + config_get network $1 network + config_get direction $1 direction + config_get altnets $1 altnet + + device=$(uci_get_state network "$network" ifname "$network") + echo -e "\nphyint $device $direction ratelimit 0 threshold 1" >> /var/etc/igmpproxy.conf + + if [ -n "$altnets" ]; then + local altnet + for altnet in $altnets; do + echo -e "\taltnet $altnet" >> /var/etc/igmpproxy.conf + done + fi +} + +start() { + config_load igmpproxy + config_foreach igmp_header igmpproxy + config_foreach igmp_add_phyint phyint + service_start /usr/sbin/igmpproxy $OPTIONS /etc/igmpproxy.conf +} + +stop() { + service_stop /usr/sbin/igmpproxy +} diff --git a/net/igmpproxy/patches/001-Send-IGMP-packets-with-IP-Router-Alert-option-RFC-21.patch b/net/igmpproxy/patches/001-Send-IGMP-packets-with-IP-Router-Alert-option-RFC-21.patch new file mode 100644 index 0000000..ffe1cf1 --- /dev/null +++ b/net/igmpproxy/patches/001-Send-IGMP-packets-with-IP-Router-Alert-option-RFC-21.patch @@ -0,0 +1,79 @@ +From fed8c3db10bc9d3a1e799a774924c00522595d0c Mon Sep 17 00:00:00 2001 +From: Evgeny Yurchenko +Date: Mon, 4 Jan 2010 05:13:59 +0500 +Subject: [PATCH] Send IGMP packets with IP Router Alert option [RFC 2113] included in IP header + +--- + src/igmp.c | 17 ++++++++++++----- + src/igmpproxy.h | 1 + + 2 files changed, 13 insertions(+), 5 deletions(-) + +diff --git a/src/igmp.c b/src/igmp.c +index a0cd27d..b547688 100644 +--- a/src/igmp.c ++++ b/src/igmp.c +@@ -67,7 +67,7 @@ void initIgmp() { + * - Checksum (let the kernel fill it in) + */ + ip->ip_v = IPVERSION; +- ip->ip_hl = sizeof(struct ip) >> 2; ++ ip->ip_hl = (sizeof(struct ip) + 4) >> 2; /* +4 for Router Alert option */ + ip->ip_tos = 0xc0; /* Internet Control */ + ip->ip_ttl = MAXTTL; /* applies to unicasts only */ + ip->ip_p = IPPROTO_IGMP; +@@ -213,7 +213,7 @@ void buildIgmp(uint32_t src, uint32_t dst, int type, int code, uint32_t group, i + ip = (struct ip *)send_buf; + ip->ip_src.s_addr = src; + ip->ip_dst.s_addr = dst; +- ip_set_len(ip, MIN_IP_HEADER_LEN + IGMP_MINLEN + datalen); ++ ip_set_len(ip, IP_HEADER_RAOPT_LEN + IGMP_MINLEN + datalen); + + if (IN_MULTICAST(ntohl(dst))) { + ip->ip_ttl = curttl; +@@ -221,13 +221,20 @@ void buildIgmp(uint32_t src, uint32_t dst, int type, int code, uint32_t group, i + ip->ip_ttl = MAXTTL; + } + +- igmp = (struct igmp *)(send_buf + MIN_IP_HEADER_LEN); ++ /* Add Router Alert option */ ++ ((u_char*)send_buf+MIN_IP_HEADER_LEN)[0] = IPOPT_RA; ++ ((u_char*)send_buf+MIN_IP_HEADER_LEN)[1] = 0x04; ++ ((u_char*)send_buf+MIN_IP_HEADER_LEN)[2] = 0x00; ++ ((u_char*)send_buf+MIN_IP_HEADER_LEN)[3] = 0x00; ++ ++ igmp = (struct igmp *)(send_buf + IP_HEADER_RAOPT_LEN); + igmp->igmp_type = type; + igmp->igmp_code = code; + igmp->igmp_group.s_addr = group; + igmp->igmp_cksum = 0; + igmp->igmp_cksum = inetChksum((u_short *)igmp, +- IGMP_MINLEN + datalen); ++ IP_HEADER_RAOPT_LEN + datalen); ++ + } + + /* +@@ -257,7 +264,7 @@ void sendIgmp(uint32_t src, uint32_t dst, int type, int code, uint32_t group, in + #endif + sdst.sin_addr.s_addr = dst; + if (sendto(MRouterFD, send_buf, +- MIN_IP_HEADER_LEN + IGMP_MINLEN + datalen, 0, ++ IP_HEADER_RAOPT_LEN + IGMP_MINLEN + datalen, 0, + (struct sockaddr *)&sdst, sizeof(sdst)) < 0) { + if (errno == ENETDOWN) + my_log(LOG_ERR, errno, "Sender VIF was down."); +diff --git a/src/igmpproxy.h b/src/igmpproxy.h +index 0de7791..4df8a79 100644 +--- a/src/igmpproxy.h ++++ b/src/igmpproxy.h +@@ -64,6 +64,7 @@ + #define MAX_IP_PACKET_LEN 576 + #define MIN_IP_HEADER_LEN 20 + #define MAX_IP_HEADER_LEN 60 ++#define IP_HEADER_RAOPT_LEN 24 + + #define MAX_MC_VIFS 32 // !!! check this const in the specific includes + +-- +1.7.2.5 + diff --git a/net/igmpproxy/patches/002-Change-default-interface-state-to-disabled-wrt-29458.patch b/net/igmpproxy/patches/002-Change-default-interface-state-to-disabled-wrt-29458.patch new file mode 100644 index 0000000..d7550d7 --- /dev/null +++ b/net/igmpproxy/patches/002-Change-default-interface-state-to-disabled-wrt-29458.patch @@ -0,0 +1,43 @@ +From 85e240727305b156097ee7aa0f0c4473a136291f Mon Sep 17 00:00:00 2001 +From: Constantin Baranov +Date: Tue, 23 Feb 2010 21:08:02 +0400 +Subject: [PATCH] Change default interface state to disabled (wrt #2945877) + +--- + src/ifvc.c | 2 +- + src/igmpproxy.c | 6 ++++-- + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/ifvc.c b/src/ifvc.c +index 545b3b4..9d7ee97 100644 +--- a/src/ifvc.c ++++ b/src/ifvc.c +@@ -139,7 +139,7 @@ void buildIfVc() { + IfDescEp->allowednets->subnet_addr = subnet; + + // Set the default params for the IF... +- IfDescEp->state = IF_STATE_DOWNSTREAM; ++ IfDescEp->state = IF_STATE_DISABLED; + IfDescEp->robustness = DEFAULT_ROBUSTNESS; + IfDescEp->threshold = DEFAULT_THRESHOLD; /* ttl limit */ + IfDescEp->ratelimit = DEFAULT_RATELIMIT; +diff --git a/src/igmpproxy.c b/src/igmpproxy.c +index 1ece15a..35000c7 100644 +--- a/src/igmpproxy.c ++++ b/src/igmpproxy.c +@@ -186,8 +186,10 @@ int igmpProxyInit() { + } + } + +- addVIF( Dp ); +- vifcount++; ++ if (Dp->state != IF_STATE_DISABLED) { ++ addVIF( Dp ); ++ vifcount++; ++ } + } + } + +-- +1.7.2.5 + diff --git a/net/igmpproxy/patches/003-Restrict-igmp-reports-for-downstream-interfaces-wrt-.patch b/net/igmpproxy/patches/003-Restrict-igmp-reports-for-downstream-interfaces-wrt-.patch new file mode 100644 index 0000000..90d4d5f --- /dev/null +++ b/net/igmpproxy/patches/003-Restrict-igmp-reports-for-downstream-interfaces-wrt-.patch @@ -0,0 +1,164 @@ +From 65f777e7f66b55239d935c1cf81bb5abc0f6c89f Mon Sep 17 00:00:00 2001 +From: Grinch +Date: Sun, 16 Aug 2009 19:58:26 +0500 +Subject: [PATCH] Restrict igmp reports for downstream interfaces (wrt #2833339) + +atm all igmp membership reports are forwarded to the upstream interface. +Unfortunately some ISP Providers restrict some multicast groups (esp. those +that are defined as local link groups and that are not supposed to be +forwarded to the wan, i.e 224.0.0.0/24). Therefore there should be some +kind of black oder whitelisting. +As whitelisting can be accomplished quite easy I wrote a litte patch, which +is attached to this request. +--- + doc/igmpproxy.conf.5.in | 19 +++++++++++++++++++ + src/config.c | 23 ++++++++++++++++++++++- + src/igmpproxy.h | 1 + + src/request.c | 20 ++++++++++++++++---- + 4 files changed, 58 insertions(+), 5 deletions(-) + +diff --git a/doc/igmpproxy.conf.5.in b/doc/igmpproxy.conf.5.in +index a4ea7d0..56efa22 100644 +--- a/doc/igmpproxy.conf.5.in ++++ b/doc/igmpproxy.conf.5.in +@@ -116,6 +116,25 @@ This is especially useful for the upstream interface, since the source for multi + traffic is often from a remote location. Any number of altnet parameters can be specified. + .RE + ++.B whitelist ++.I networkaddr ++.RS ++Defines a whitelist for multicast groups. The network address must be in the following ++format 'a.b.c.d/n'. If you want to allow one single group use a network mask of /32, ++i.e. 'a.b.c.d/32'. ++ ++By default all multicast groups are allowed on any downstream interface. If at least one ++whitelist entry is defined, all igmp membership reports for not explicitly whitelisted ++multicast groups will be ignored and therefore not be served by igmpproxy. This is especially ++useful, if your provider does only allow a predefined set of multicast groups. These whitelists ++are only obeyed by igmpproxy itself, they won't prevent any other igmp client running on the ++same machine as igmpproxy from requesting 'unallowed' multicast groups. ++ ++You may specify as many whitelist entries as needed. Although you should keep it as simple as ++possible, as this list is parsed for every membership report and therefore this increases igmp ++response times. Often used or large groups should be defined first, as parsing ends as soon as ++a group matches an entry. ++.RE + + .SH EXAMPLE + ## Enable quickleave +diff --git a/src/config.c b/src/config.c +index 5a96ce0..d72619f 100644 +--- a/src/config.c ++++ b/src/config.c +@@ -46,6 +46,9 @@ struct vifconfig { + + // Keep allowed nets for VIF. + struct SubnetList* allowednets; ++ ++ // Allowed Groups ++ struct SubnetList* allowedgroups; + + // Next config in list... + struct vifconfig* next; +@@ -202,6 +205,8 @@ void configureVifs() { + // Insert the configured nets... + vifLast->next = confPtr->allowednets; + ++ Dp->allowedgroups = confPtr->allowedgroups; ++ + break; + } + } +@@ -215,7 +220,7 @@ void configureVifs() { + */ + struct vifconfig *parsePhyintToken() { + struct vifconfig *tmpPtr; +- struct SubnetList **anetPtr; ++ struct SubnetList **anetPtr, **agrpPtr; + char *token; + short parseError = 0; + +@@ -239,6 +244,7 @@ struct vifconfig *parsePhyintToken() { + tmpPtr->threshold = 1; + tmpPtr->state = IF_STATE_DOWNSTREAM; + tmpPtr->allowednets = NULL; ++ tmpPtr->allowedgroups = NULL; + + // Make a copy of the token to store the IF name + tmpPtr->name = strdup( token ); +@@ -248,6 +254,7 @@ struct vifconfig *parsePhyintToken() { + + // Set the altnet pointer to the allowednets pointer. + anetPtr = &tmpPtr->allowednets; ++ agrpPtr = &tmpPtr->allowedgroups; + + // Parse the rest of the config.. + token = nextConfigToken(); +@@ -266,6 +273,20 @@ struct vifconfig *parsePhyintToken() { + anetPtr = &(*anetPtr)->next; + } + } ++ else if(strcmp("whitelist", token)==0) { ++ // Whitelist ++ token = nextConfigToken(); ++ my_log(LOG_DEBUG, 0, "Config: IF: Got whitelist token %s.", token); ++ ++ *agrpPtr = parseSubnetAddress(token); ++ if(*agrpPtr == NULL) { ++ parseError = 1; ++ my_log(LOG_WARNING, 0, "Unable to parse subnet address."); ++ break; ++ } else { ++ agrpPtr = &(*agrpPtr)->next; ++ } ++ } + else if(strcmp("upstream", token)==0) { + // Upstream + my_log(LOG_DEBUG, 0, "Config: IF: Got upstream token."); +diff --git a/src/igmpproxy.h b/src/igmpproxy.h +index 4dabd1c..0de7791 100644 +--- a/src/igmpproxy.h ++++ b/src/igmpproxy.h +@@ -145,6 +145,7 @@ struct IfDesc { + short Flags; + short state; + struct SubnetList* allowednets; ++ struct SubnetList* allowedgroups; + unsigned int robustness; + unsigned char threshold; /* ttl limit */ + unsigned int ratelimit; +diff --git a/src/request.c b/src/request.c +index e3589f6..89b91de 100644 +--- a/src/request.c ++++ b/src/request.c +@@ -82,10 +82,22 @@ void acceptGroupReport(uint32_t src, uint32_t group, uint8_t type) { + my_log(LOG_DEBUG, 0, "Should insert group %s (from: %s) to route table. Vif Ix : %d", + inetFmt(group,s1), inetFmt(src,s2), sourceVif->index); + +- // The membership report was OK... Insert it into the route table.. +- insertRoute(group, sourceVif->index); +- +- ++ // If we don't have a whitelist we insertRoute and done ++ if(sourceVif->allowedgroups == NULL) ++ { ++ insertRoute(group, sourceVif->index); ++ return; ++ } ++ // Check if this Request is legit on this interface ++ struct SubnetList *sn; ++ for(sn = sourceVif->allowedgroups; sn != NULL; sn = sn->next) ++ if((group & sn->subnet_mask) == sn->subnet_addr) ++ { ++ // The membership report was OK... Insert it into the route table.. ++ insertRoute(group, sourceVif->index); ++ return; ++ } ++ my_log(LOG_INFO, 0, "The group address %s may not be requested from this interface. Ignoring.", inetFmt(group, s1)); + } else { + // Log the state of the interface the report was recieved on. + my_log(LOG_INFO, 0, "Mebership report was recieved on %s. Ignoring.", +-- +1.7.2.5 + diff --git a/net/igmpproxy/patches/004-Restrict-igmp-reports-forwarding-to-upstream-interfa.patch b/net/igmpproxy/patches/004-Restrict-igmp-reports-forwarding-to-upstream-interfa.patch new file mode 100644 index 0000000..a4caed7 --- /dev/null +++ b/net/igmpproxy/patches/004-Restrict-igmp-reports-forwarding-to-upstream-interfa.patch @@ -0,0 +1,62 @@ +From bcd7c648e86d97263c931de53a008c9629e7797e Mon Sep 17 00:00:00 2001 +From: Stefan Becker +Date: Fri, 11 Dec 2009 21:08:57 +0200 +Subject: [PATCH] Restrict igmp reports forwarding to upstream interface + +Utilize the new "whitelist" keyword also on the upstream interface definition. +If specified then only whitelisted multicast groups will be forwarded upstream. + +This can be used to avoid publishing private multicast groups to the world, +e.g. SSDP from a UPnP server on the internal network. +--- + doc/igmpproxy.conf.5.in | 5 +++++ + src/rttable.c | 17 +++++++++++++++++ + 2 files changed, 22 insertions(+), 0 deletions(-) + +diff --git a/doc/igmpproxy.conf.5.in b/doc/igmpproxy.conf.5.in +index 56efa22..d916f05 100644 +--- a/doc/igmpproxy.conf.5.in ++++ b/doc/igmpproxy.conf.5.in +@@ -134,6 +134,11 @@ You may specify as many whitelist entries as needed. Although you should keep it + possible, as this list is parsed for every membership report and therefore this increases igmp + response times. Often used or large groups should be defined first, as parsing ends as soon as + a group matches an entry. ++ ++You may also specify whitelist entries for the upstream interface. Only igmp membership reports ++for explicitely whitelisted multicast groups will be sent out on the upstream interface. This ++is useful if you want to use multicast groups only between your downstream interfaces, like SSDP ++from a UPnP server. + .RE + + .SH EXAMPLE +diff --git a/src/rttable.c b/src/rttable.c +index f0701a8..77dd791 100644 +--- a/src/rttable.c ++++ b/src/rttable.c +@@ -117,6 +117,23 @@ void sendJoinLeaveUpstream(struct RouteTable* route, int join) { + my_log(LOG_ERR, 0 ,"FATAL: Unable to get Upstream IF."); + } + ++ // Check if there is a white list for the upstram VIF ++ if (upstrIf->allowedgroups != NULL) { ++ uint32_t group = route->group; ++ struct SubnetList* sn; ++ ++ // Check if this Request is legit to be forwarded to upstream ++ for(sn = upstrIf->allowedgroups; sn != NULL; sn = sn->next) ++ if((group & sn->subnet_mask) == sn->subnet_addr) ++ // Forward is OK... ++ break; ++ ++ if (sn == NULL) { ++ my_log(LOG_INFO, 0, "The group address %s may not be forwarded upstream. Ignoring.", inetFmt(group, s1)); ++ return; ++ } ++ } ++ + // Send join or leave request... + if(join) { + +-- +1.7.2.5 + diff --git a/net/igmpproxy/patches/100-use-monotic-clock-instead-of-time-of-day.patch b/net/igmpproxy/patches/100-use-monotic-clock-instead-of-time-of-day.patch new file mode 100644 index 0000000..e75283c --- /dev/null +++ b/net/igmpproxy/patches/100-use-monotic-clock-instead-of-time-of-day.patch @@ -0,0 +1,120 @@ +From d0e66e0719ae8eb549f7cc220fdc66575d3db332 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Thu, 29 Mar 2012 17:01:11 +0200 +Subject: [PATCH 4/4] use monotic clock instead of time of day + +The time of day might chance e.g. by daylight savings time during the +runtime, which causes timers to fire repeatedly for a long time. + +Contributed by T-Labs, Deutsche Telekom Innovation Laboratories + +Signed-off-by: Jonas Gorski +--- + configure.ac | 2 ++ + src/igmpproxy.c | 26 +++++++++++++------------- + src/igmpproxy.h | 3 ++- + 3 files changed, 17 insertions(+), 14 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 85beb08..bd84eba 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -25,6 +25,8 @@ AC_CHECK_MEMBERS([struct sockaddr_in.sin_len], [], [], [[ + #include + ]]) + ++AC_SEARCH_LIBS([clock_gettime],[rt]) ++ + AC_CONFIG_FILES([ + Makefile + doc/Makefile +diff --git a/src/igmpproxy.c b/src/igmpproxy.c +index 35000c7..3a9ccad 100644 +--- a/src/igmpproxy.c ++++ b/src/igmpproxy.c +@@ -234,13 +234,13 @@ void igmpProxyRun() { + int MaxFD, Rt, secs; + fd_set ReadFDS; + socklen_t dummy = 0; +- struct timeval curtime, lasttime, difftime, tv; ++ struct timespec curtime, lasttime, difftime, tv; + // The timeout is a pointer in order to set it to NULL if nessecary. +- struct timeval *timeout = &tv; ++ struct timespec *timeout = &tv; + + // Initialize timer vars +- difftime.tv_usec = 0; +- gettimeofday(&curtime, NULL); ++ difftime.tv_nsec = 0; ++ clock_gettime(CLOCK_MONOTONIC, &curtime); + lasttime = curtime; + + // First thing we send a membership query in downstream VIF's... +@@ -263,7 +263,7 @@ void igmpProxyRun() { + if(secs == -1) { + timeout = NULL; + } else { +- timeout->tv_usec = 0; ++ timeout->tv_nsec = 0; + timeout->tv_sec = secs; + } + +@@ -274,7 +274,7 @@ void igmpProxyRun() { + FD_SET( MRouterFD, &ReadFDS ); + + // wait for input +- Rt = select( MaxFD +1, &ReadFDS, NULL, NULL, timeout ); ++ Rt = pselect( MaxFD +1, &ReadFDS, NULL, NULL, timeout, NULL ); + + // log and ignore failures + if( Rt < 0 ) { +@@ -307,20 +307,20 @@ void igmpProxyRun() { + */ + if (Rt == 0) { + curtime.tv_sec = lasttime.tv_sec + secs; +- curtime.tv_usec = lasttime.tv_usec; ++ curtime.tv_nsec = lasttime.tv_nsec; + Rt = -1; /* don't do this next time through the loop */ + } else { +- gettimeofday(&curtime, NULL); ++ clock_gettime(CLOCK_MONOTONIC, &curtime); + } + difftime.tv_sec = curtime.tv_sec - lasttime.tv_sec; +- difftime.tv_usec += curtime.tv_usec - lasttime.tv_usec; +- while (difftime.tv_usec > 1000000) { ++ difftime.tv_nsec += curtime.tv_nsec - lasttime.tv_nsec; ++ while (difftime.tv_nsec > 1000000000) { + difftime.tv_sec++; +- difftime.tv_usec -= 1000000; ++ difftime.tv_nsec -= 1000000000; + } +- if (difftime.tv_usec < 0) { ++ if (difftime.tv_nsec < 0) { + difftime.tv_sec--; +- difftime.tv_usec += 1000000; ++ difftime.tv_nsec += 1000000000; + } + lasttime = curtime; + if (secs == 0 || difftime.tv_sec > 0) +diff --git a/src/igmpproxy.h b/src/igmpproxy.h +index 4df8a79..36a4f04 100644 +--- a/src/igmpproxy.h ++++ b/src/igmpproxy.h +@@ -44,12 +44,13 @@ + #include + #include + #include ++#include + + #include + #include +-#include + #include + #include ++#include + + #include + #include +-- +1.7.2.5 + diff --git a/net/imsnif/Makefile b/net/imsnif/Makefile new file mode 100644 index 0000000..35eb64f --- /dev/null +++ b/net/imsnif/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2008-2011 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:=imsnif +PKG_VERSION:=0.04 +PKG_RELEASE:=4 + +PKG_SOURCE_URL:=@SF/im-snif +PKG_SOURCE:=$(PKG_NAME)f_$(PKG_VERSION).tgz +PKG_MD5SUM:=689c456f8edb77b9b4199a25514ac683 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +PKG_UNPACK:=gzip -dc $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR) -xvf - + +define Package/imsnif + SECTION:=net + CATEGORY:=Network + SUBMENU:=Instant Messaging + DEPENDS:=+libpcap $(CXX_DEPENDS) + TITLE:=MSN Messenger sniffer + URL:=http://sourceforge.net/projects/im-snif +endef + +define Package/imsnif/description + IMsnif is a simple program to log Instant Message activity + on the network. It uses libpcap to capture packets and + analyzes them, logging conversation, contact lists, etc. +endef + +define Build/Compile + $(TARGET_CXX) $(TARGET_CPPFLAGS) -fno-rtti -I$(LINUX_DIR)/include \ + -o $(PKG_BUILD_DIR)/src/imsnif \ + $(PKG_BUILD_DIR)/src/imsniff.cpp \ + $(PKG_BUILD_DIR)/src/util.cpp \ + $(PKG_BUILD_DIR)/src/msn_conntrack.cpp \ + $(PKG_BUILD_DIR)/src/msn_handlers.cpp \ + -L$(STAGING_DIR)/usr/lib -lpcap \ + $(PKG_BUILD_DIR)/src/pcap_stuff.cpp +endef + +define Package/imsnif/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/docs/imsniff.conf.sample $(1)/etc/imsnif.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/imsnif $(1)/etc/init.d + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/imsnif $(1)/usr/bin +endef + +define Package/imsnif/conffiles +/etc/imsnif.conf +endef + +$(eval $(call BuildPackage,imsnif)) diff --git a/net/imsnif/files/imsnif b/net/imsnif/files/imsnif new file mode 100755 index 0000000..12c2f28 --- /dev/null +++ b/net/imsnif/files/imsnif @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common +#Copyright (C) 2007 RoadRunner.cx +START=85 + +start() { + [ -f /etc/imsnif.conf ] && /usr/bin/imsnif || { + cat <tm_year, stm->tm_mon, stm->tm_mday); ++ sprintf (fn, "%s/imsnif_%04d-%02d-%02d.log", debuglogdir, stm->tm_year, stm->tm_mon, stm->tm_mday); + #else + struct tm stm; + localtime_r (&now, &stm); +- sprintf (fn, "%s/imsniff_%04d-%02d-%02d.log", debuglogdir, stm.tm_year, stm.tm_mon, stm.tm_mday); ++ sprintf (fn, "%s/imsnif_%04d-%02d-%02d.log", debuglogdir, stm.tm_year, stm.tm_mon, stm.tm_mday); + #endif + FILE *o=fopen (fn, "a+t"); + if (o!=NULL) diff --git a/net/imspector/Makefile b/net/imspector/Makefile new file mode 100644 index 0000000..9990872 --- /dev/null +++ b/net/imspector/Makefile @@ -0,0 +1,86 @@ +# +# Copyright (C) 2007-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# Author: Carlos Cesario +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=imspector +PKG_VERSION:=0.9 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.imspector.org/downloads +PKG_MD5SUM:=626abf7c2b8f15d56df679ad66624575 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/imspector + SECTION:=net + CATEGORY:=Network + SUBMENU:=Instant Messaging + TITLE:=IMSpector is an Instant Messenger proxy + URL:=http://www.imspector.org + DEPENDS:=+libopenssl +libstdcpp +libmysqlclient +libsqlite3 +libpq \ + +libpthread $(ICONV_DEPENDS) +endef + +define Package/imspector/description + IMSpector is an Instant Messenger proxy with monitoring and blocking, + and content-filtering capabilities. +endef + +define Package/imspector/conffiles +/etc/config/imspector +endef + +define Build/Configure + (cd $(PKG_BUILD_DIR); \ + sed -ie 's/#ADD_PLUGINS/ADD_PLUGINS/' Makefile \ + ); +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + $(TARGET_CONFIGURE_OPTS) \ + SSL_DIR="$(STAGING_DIR)/usr" \ + SSL_LIBS="$(TARGET_LDFLAGS) -lssl -lcrypto" \ + SSL_FLAGS="$(TARGET_CPPFLAGS) -DHAVE_SSL" \ + SSL_OBJS=sslstate.o \ + PREFIX="$(STAGING_DIR)/usr" \ + CXX=$(TARGET_CXX) \ + CXXFLAGS="$(TARGET_CXXFLAGS) $(TARGET_CFLAGS) $(FPIC) $(TARGET_CPPFLAGS) \ + -I$(ICONV_PREFIX)/include \ + $(TARGET_LDFLAGS) -DHAVE_SSL" \ + all +endef + +define Build/Install + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install +endef + +define Package/imspector/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/imspector $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libimspector.so $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/$(PKG_NAME) + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/*.so $(1)/usr/lib/$(PKG_NAME)/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/imspector.config $(1)/etc/config/imspector + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/imspector.init $(1)/etc/init.d/imspector + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/etc/$(PKG_NAME)/badwords.txt $(1)/etc/$(PKG_NAME)/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/etc/$(PKG_NAME)/acl.txt $(1)/etc/$(PKG_NAME)/ +endef + +$(eval $(call BuildPackage,imspector)) diff --git a/net/imspector/files/imspector.config b/net/imspector/files/imspector.config new file mode 100644 index 0000000..571cd64 --- /dev/null +++ b/net/imspector/files/imspector.config @@ -0,0 +1,112 @@ +config imspector + # Enable the proxy + option enabled 1 + + # The listening ip address for redirected connections + option listenaddr 0.0.0.0 + + # The listening port for redirected connections + option port 16667 + + # The HTTP CONNECT proxy port + option http_port 18080 + + #Sets the PID filename. The PID file is created before optionally dropping privs. + option pidfilename /var/run/imspector.pid + + # This is the default location of protocol and logging plugins. + option plugin_dir /usr/lib/imspector/ + + # For dropping privs - you probably want to do this. + option user root + option group root + + # SSL support? + # Create SSL Certs with the following command + # openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 \ + # -keyout /etc/imspector/serverkey.pem \ + # -out /etc/imspector/servercert.pem + + #option ssl on + #option ssl_key "/etc/imspector/serverkey.pem" + + # Fixed cert? + #option ssl_cert "/etc/imspector/servercert.pem" + + # Or certs created on-the-fly and signed against a CA + #option ssl_ca_key "/etc/imspector/cakey.pem" + #option ssl_ca_cert "/etc/imspector/cacert.pem" + + # And finally a directory to store the created certs + #option ssl_cert_dir "/usr/lib/imspector" + + # Directory of CA certs for IM server cert validation + #option ssl_verify_dir "/usr/lib/ssl/certs" + + # Drop connection when the IM server has a bad cert + #option ssl_verify "block" + + # Prefix and postfix to all responses using all responder plugins + #option response_prefix "Message from IMSpector: -=" + #option response_postfix "=-" + + # SQLite DB filename for automated responses + #option responder_filename "/etc/imspector/sqlitedb_responder" + # Inform parties that chats are monitored every N days (default is never) + #option notice_days 7 + # Customised notice text + #option notice_response "Your activities are being logged" + # Inform of a blocked event, but upto a max of every N mins (default is never) + #option filtered_mins 15 + # Customised filtered text (message text or filename follows in response) + #option filtered_response "The message or action was blocked" + + # Will load enabled plugins in plugin_dir + option icq_protocol on + option irc_protocol on + option msn_protocol on + option yahoo_protocol on + option gg_protocol on + option jabber_protocol on + + # MSN via HTTP proxy needs https + option https_protocol on + + # Log typing events? + option log_typing_events off + + # Location where the file logging plugin will start from. + option file_logging_dir "/var/log/imspector" + + # MySQL logging plugin stuff + #option mysql_server "localhost" + #option mysql_database "imspector" + #option mysql_username "imspector" + #option mysql_password "password" + + # SQLite logging plugin stuff + #option sqlite_file "/etc/imspector/sqlitedb" + + # PostgreSQL logging plugin stuff + #option pgsql_connect "host=localhost dbname=imspector user=dbuser password=Password" + + # Bad words filtering + option badwords_filename "/etc/imspector/badwords.txt" + option badwords_replace_character "*" + option badwords_block_count 1 + + # ACL + option acl_filename "/etc/imspector/acl.txt" + + # SQLite-backed filter + #option db_filter_filename "/etc/imspector/sqlitedb_filter" + + # Block all filetransfers? + option block_files off + + # Block webcams? + option block_webcams off + + # Socket-API for filtering + #option censord off + diff --git a/net/imspector/files/imspector.init b/net/imspector/files/imspector.init new file mode 100644 index 0000000..8c0b991 --- /dev/null +++ b/net/imspector/files/imspector.init @@ -0,0 +1,56 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2011 OpenWrt.org + +START=50 + +CFGFILE=/var/etc/imspector.conf + +atom() { + local section="$1" + local option="$2" + + config_get _value "$section" "$option" + [ -n "$_value" ] && echo "$option=${_value}" +} + +start_instance() { + local section="$1" + + config_get_bool enabled "$section" enabled '0' + [ $enabled -gt 0 ] || return 1 + + echo '### AUTOGENERATED CONFIGURATION' > $CFGFILE + echo '### DO NOT EDIT' >> $CFGFILE + echo '### SEE /etc/config/imspector INSTEAD' >> $CFGFILE + echo '' >> $CFGFILE + + options='listenaddr port http_port pidfilename plugin_dir + user group ssl ssl_key ssl_cert ssl_ca_key ssl_ca_cert + ssl_cert_dir ssl_verify_dir ssl_verify response_prefix + response_postfix responder_filename notice_days notice_response + filtered_mins filtered_response icq_protocol irc_protocol + msn_protocol yahoo_protocol gg_protocol jabber_protocol + https_protocol log_typing_events file_logging_dir mysql_server + mysql_database mysql_username mysql_password sqlite_file + pgsql_connect badwords_filename badwords_replace_character + badwords_block_count acl_filename db_filter_filename + block_files block_webcams censord' + + for option in $options; do + atom "$section" "$option" '"' >> $CFGFILE + done + + service_start /usr/sbin/imspector -c "$CFGFILE" +} + +start() { + mkdir -m 0755 -p /var/etc + mkdir -m 0755 -p /var/log/imspector + + config_load 'imspector' + config_foreach start_instance 'imspector' +} + +stop() { + service_stop /usr/sbin/imspector +} diff --git a/net/imspector/patches/010-openssl-1.0.0-compat.patch b/net/imspector/patches/010-openssl-1.0.0-compat.patch new file mode 100644 index 0000000..d8002a1 --- /dev/null +++ b/net/imspector/patches/010-openssl-1.0.0-compat.patch @@ -0,0 +1,14 @@ +--- a/sslstate.h ++++ b/sslstate.h +@@ -29,7 +29,11 @@ class SSLState + int sslverify; + + bool localdebugmode; ++#if OPENSSL_VERSION_NUMBER >= 0x10000000L ++ const SSL_METHOD *method; ++#else + SSL_METHOD *method; ++#endif + SSL_CTX *connectctx; + SSL_CTX *ctx; + diff --git a/net/iodine/Makefile b/net/iodine/Makefile new file mode 100644 index 0000000..03535b8 --- /dev/null +++ b/net/iodine/Makefile @@ -0,0 +1,69 @@ +# +# Copyright (C) 2006-2011 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:=iodine +PKG_VERSION:=0.6.0-rc1 +PKG_RELEASE:=5 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://code.kryo.se/iodine/ +PKG_MD5SUM:=a15bb4faba020d217016fde6e231074a + +include $(INCLUDE_DIR)/package.mk + +define Package/iodine/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Firewall Tunnel + DEPENDS:= +kmod-tun +zlib + TITLE:=IP over DNS tunneling + URL:=http://code.kryo.se/iodine/ +endef + +define Package/iodine + $(call Package/iodine/Default) + TITLE+= client version +endef + +define Package/iodine/description + iodine client version +endef + +define Package/iodined + $(call Package/iodine/Default) + TITLE+= server version +endef + +define Package/iodined/description + iodine server version +endef + +define Build/Configure +endef + +define Package/iodine/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/iodine $(1)/usr/sbin +endef + +define Package/iodined/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/iodined.init $(1)/etc/init.d/iodined + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/iodined.config $(1)/etc/config/iodined + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/iodined $(1)/usr/sbin +endef + +define Package/iodined/conffiles +/etc/config/iodined +endef + +$(eval $(call BuildPackage,iodine)) +$(eval $(call BuildPackage,iodined)) diff --git a/net/iodine/files/iodined.config b/net/iodine/files/iodined.config new file mode 100644 index 0000000..f95549d --- /dev/null +++ b/net/iodine/files/iodined.config @@ -0,0 +1,5 @@ +config iodined + option address '' + option password '' + option tunnelip '10.0.0.1' + option tld '' diff --git a/net/iodine/files/iodined.init b/net/iodine/files/iodined.init new file mode 100644 index 0000000..d91b779 --- /dev/null +++ b/net/iodine/files/iodined.init @@ -0,0 +1,23 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +start_instance () { + local section="$1" + config_get address "$section" 'address' + config_get password "$section" 'password' + config_get tunnelip "$section" 'tunnelip' + config_get tld "$section" 'tld' + + service_start /usr/sbin/iodined -l "$address" -P "$password" "$tunnelip" "$tld" +} + +start() { + config_load 'iodined' + config_foreach start_instance 'iodined' +} + +stop() { + service_stop /usr/sbin/iodined +} diff --git a/net/iodine/patches/010-cross-compile.patch b/net/iodine/patches/010-cross-compile.patch new file mode 100644 index 0000000..5ee860a --- /dev/null +++ b/net/iodine/patches/010-cross-compile.patch @@ -0,0 +1,22 @@ +--- a/src/osflags ++++ b/src/osflags +@@ -16,9 +16,6 @@ link) + windows32) + echo '-lws2_32 -liphlpapi'; + ;; +- Linux) +- [ -e /usr/include/selinux/selinux.h ] && echo '-lselinux'; +- ;; + esac + ;; + cflags) +@@ -26,9 +23,6 @@ cflags) + BeOS) + echo '-Dsocklen_t=int'; + ;; +- Linux) +- [ -e /usr/include/selinux/selinux.h ] && echo '-DHAVE_SETCON'; +- ;; + esac + ;; + *) diff --git a/net/ipcad/Makefile b/net/ipcad/Makefile new file mode 100644 index 0000000..14143a1 --- /dev/null +++ b/net/ipcad/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2006-2009 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:=ipcad +PKG_VERSION:=3.7.3 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/ipcad +PKG_MD5SUM:=125605249958894148ec26d3c88189f5 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ipcad + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap $(LIBRPC_DEPENDS) +libpthread + TITLE:=listens for traffic on the specified interfaces + URL:=http://lionet.info/ipcad/ +endef + +define Package/ipcad/description + This daemon listens for traffic on the specified interfaces. + It has the built-in RSH and NetFlow engines to allow exporting + the accounting data the same way as Cisco routers do. +endef + +define Package/ipcad/conffiles/ +/etc/ipcad.conf +endef + +CONFIGURE_ARGS += \ + --enable-shared \ + --disable-static \ + --with-psrc=pcap \ + --with-pcap-include="$(STAGING_DIR)/usr/include" \ + --with-pcap-libraries="$(STAGING_DIR)/usr/lib" \ + +# XXX: don't detect/use netfilter QUEUE/ULOG captures +CONFIGURE_VARS += \ + ac_cv_func_getifaddrs=no \ + ac_cv_header_ifaddrs_h=no \ + ac_cv_header_linux_netfilter_ipv4_ip_queue_h=no \ + ac_cv_header_linux_netfilter_ipv4_ipt_ULOG_h=no \ + +TARGET_LDFLAGS += $(LIBRPC) + +define Package/ipcad/install + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/ipcad.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ipcad $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,ipcad)) diff --git a/net/ipcad/patches/001-honor_cppflags.patch b/net/ipcad/patches/001-honor_cppflags.patch new file mode 100644 index 0000000..41d532d --- /dev/null +++ b/net/ipcad/patches/001-honor_cppflags.patch @@ -0,0 +1,10 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -9,6 +9,7 @@ + LDFLAGS+= @LDFLAGS@ + LIBS+= @LIBS@ + CFLAGS+= @CFLAGS@ @DEFS@ -W -Wall ++CPPFLAGS+= @CPPFLAGS@ + CPPFLAGS+=-DIPCAD_VERSION=\"@IPCAD_VERSION@\" + CPPFLAGS+=-DCONFIG_FILE=\"${sysconfdir}/ipcad.conf\" + CPPFLAGS+=@DEFS@ -D_REENTRANT -D_THREAD_SAFE diff --git a/net/ipcad/patches/010-no-host-includes.patch b/net/ipcad/patches/010-no-host-includes.patch new file mode 100644 index 0000000..4cac2ce --- /dev/null +++ b/net/ipcad/patches/010-no-host-includes.patch @@ -0,0 +1,16 @@ +diff --git a/configure b/configure +index b2ef966..b675ca8 100755 +--- a/configure ++++ b/configure +@@ -2691,11 +2691,6 @@ fi + + fi + +-LDFLAGS="$LDFLAGS -L${ac_default_prefix}/lib" +-CFLAGS="$CFLAGS -I${ac_default_prefix}/include" +-CPPFLAGS="$CPPFLAGS -I${ac_default_prefix}/include" +- +- + for ac_func in pthread_detach + do + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` diff --git a/net/iperf/Makefile b/net/iperf/Makefile new file mode 100644 index 0000000..34a029f --- /dev/null +++ b/net/iperf/Makefile @@ -0,0 +1,84 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=iperf +PKG_VERSION:=2.0.5 +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:=@SF/$(PKG_NAME) +PKG_MD5SUM:=44b5536b67719f4250faed632a3cd016 + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/iperf/Default + SECTION:=net + CATEGORY:=Network + DEPENDS:= $(CXX_DEPENDS) + TITLE:=Internet Protocol bandwidth measuring tool + URL:=http://sourceforge.net/projects/iperf/ +endef + +define Package/iperf/Default/description + Iperf is a modern alternative for measuring TCP and UDP bandwidth + performance, allowing the tuning of various parameters and + characteristics. +endef + +define Package/iperf +$(call Package/iperf/Default) + TITLE+= (with single thread support) + VARIANT:=single +endef + +define Package/iperf/description +$(call Package/iperf/Default/description) + This package is built with single thread support. +endef + +define Package/iperf-mt +$(call Package/iperf/Default) + DEPENDS+= +libpthread + TITLE+= (with multithread support) + VARIANT:=mt +endef + +define Package/iperf-mt/description +$(call Package/iperf/Default/description) + This package is built with multithread support. +endef + +CONFIGURE_ARGS += --disable-multicast +CONFIGURE_VARS += ac_cv_func_malloc_0_nonnull=yes + +ifeq ($(BUILD_VARIANT),single) + CONFIGURE_ARGS += --disable-threads +else + CONFIGURE_ARGS += --enable-threads=posix + CONFIGURE_VARS += ac_cv_func_pthread_cancel=no +endif + +CONFIGURE_VARS += CXXFLAGS="$$$$CXXFLAGS -fno-rtti" + +ifeq ($(BUILD_VARIANT),mt) + CONFIGURE_VARS += LIBS="-lpthread" +endif + +define Package/iperf/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/iperf $(1)/usr/bin/iperf +endef +Package/iperf-mt/install = $(Package/iperf/install) + +$(eval $(call BuildPackage,iperf)) +$(eval $(call BuildPackage,iperf-mt)) diff --git a/net/iperf/patches/001-set-report-next-time-in-single-thread-mode.patch b/net/iperf/patches/001-set-report-next-time-in-single-thread-mode.patch new file mode 100644 index 0000000..c61c754 --- /dev/null +++ b/net/iperf/patches/001-set-report-next-time-in-single-thread-mode.patch @@ -0,0 +1,14 @@ +--- a/src/Reporter.c ++++ b/src/Reporter.c +@@ -308,6 +308,11 @@ ReportHeader* InitReport( thread_Setting + #else + // set start time + gettimeofday( &(reporthdr->report.startTime), NULL ); ++ ++ // set next time ++ reporthdr->report.nextTime = reporthdr->report.startTime; ++ TimeAdd( reporthdr->report.nextTime, reporthdr->report.intervalTime ); ++ + /* + * Process the report in this thread + */ diff --git a/net/ipkungfu/Makefile b/net/ipkungfu/Makefile new file mode 100644 index 0000000..867a732 --- /dev/null +++ b/net/ipkungfu/Makefile @@ -0,0 +1,80 @@ +# +# 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:=ipkungfu +PKG_VERSION:=0.6.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.linuxkungfu.org/ipkungfu +PKG_MD5SUM:=89f6bc0df356dd4ee650882c54ec9074 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ipkungfu + SECTION:=net + CATEGORY:=Network + TITLE:=IPKungFu is an iptables-based Linux firewall + URL:=http://www.linuxkungfu.org/ + SUBMENU:=Firewall + DEPENDS:=+bash +endef + +define Package/ipkungfu/description + IPKungFu is an iptables-based Linux firewall. + It aims to simplify the configuration of Internet + connection sharing, port forwarding, and packet filtering. +endef + +define Package/ipkungfu/conffiles +/etc/ipkungfu/accept_hosts.conf +/etc/ipkungfu/custom.conf +/etc/ipkungfu/forward.conf +/etc/ipkungfu/log.conf +/etc/ipkungfu/pre.conf +/etc/ipkungfu/services.conf +/etc/ipkungfu/advanced.conf +/etc/ipkungfu/deny_hosts.conf +/etc/ipkungfu/ipkungfu.conf +/etc/ipkungfu/post.conf +/etc/ipkungfu/redirect.conf +/etc/ipkungfu/vhosts.conf +endef + +define Package/ipkungfu/postrm +#!/bin/sh +rm -rf /etc/ipkungfu/cache +rmdir /etc/ipkungfu 2>/dev/null || true +endef + +# uses GNU configure +CONFIGURE_VARS+= \ + ac_cv_path_IPTABLES="/usr/sbin/iptables" \ + ac_cv_path_MD5SUM="/usr/bin/md5sum" \ + ac_cv_path_MODPROBE="/sbin/insmod" \ + ac_cv_path_RMMOD="/sbin/rmmode" \ + ac_cv_path_DEPMOD="/bin/true" \ + ac_cv_path_LSMOD="/sbin/lsmod" \ + ac_cv_path_CUT="/usr/bincut" \ + ac_cv_path_TR="/usr/bintr" \ + ac_cv_path_GREP="/bin/grep" \ + ac_cv_path_SED="/bin/sed" \ + ac_cv_path_AWK="/usr/bin/awk" \ + +define Package/ipkungfu/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dummy_server $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ipkungfu $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/ipkungfu/ + $(CP) $(PKG_BUILD_DIR)/files/conf/* $(1)/etc/ipkungfu/ +endef + +$(eval $(call BuildPackage,ipkungfu)) diff --git a/net/ipkungfu/patches/001-replace-modprobe-with-insmod.patch b/net/ipkungfu/patches/001-replace-modprobe-with-insmod.patch new file mode 100644 index 0000000..477c258 --- /dev/null +++ b/net/ipkungfu/patches/001-replace-modprobe-with-insmod.patch @@ -0,0 +1,22 @@ +Index: ipkungfu-0.6.1/ipkungfu.in +=================================================================== +--- ipkungfu-0.6.1.orig/ipkungfu.in 2007-01-21 19:47:04.000000000 -0800 ++++ ipkungfu-0.6.1/ipkungfu.in 2008-08-03 11:41:13.000000000 -0700 +@@ -618,7 +618,7 @@ + # they're built in. + DEFAULT_MODULES_LIST="ip_nat_irc ip_conntrack_ftp ip_nat_ftp ip_conntrack_irc" + for default_module in $DEFAULT_MODULES_LIST; do +- if [ -f $($MODPROBE -la | grep ${default_module}) ]; then ++ if [ -f $(find /lib/modules/$(uname -r) -name "${default_module}*") ]; then + $MODPROBE ${default_module} 2>&1 | logError + fi + done +@@ -627,7 +627,7 @@ + MODULES_ARRAY=(${MODULES_LIST}) + + for module in ${MODULES_ARRAY[@]}; do +- if [ -e /lib/modules/`uname -r`/kernel/net/ipv4/netfilter/${module}* ]; then ++ if [ -e /lib/modules/`uname -r`/${module}* ]; then + if [ -z "`${LSMOD} | grep ${module}`" ] ; then + if [ $INIT != 1 ] ; then + echo -n -e "Loading ${BRIGHT_COLOUR}${module}${CLOSE_COLOUR} module..." diff --git a/net/ipsec-tools/Makefile b/net/ipsec-tools/Makefile new file mode 100644 index 0000000..50b3332 --- /dev/null +++ b/net/ipsec-tools/Makefile @@ -0,0 +1,93 @@ +# +# Copyright (C) 2006-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=ipsec-tools +PKG_VERSION:=0.8.0 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/ipsec-tools +PKG_MD5SUM:=b79aae3055a51f8de5c0f1b8ca6cf619 + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ipsec-tools + SECTION:=net + CATEGORY:=Network + SUBMENU:=VPN + DEPENDS:=+libopenssl +kmod-ipsec + TITLE:=IPsec management tools + URL:=http://ipsec-tools.sourceforge.net/ +endef + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --with-kernel-headers="$(LINUX_DIR)/include" \ + --without-readline \ + --with-openssl="$(STAGING_DIR)/usr" \ + --without-libradius \ + --without-libpam \ + --enable-dpd \ + --enable-hybrid \ + --enable-security-context=no \ + --enable-natt \ + --enable-adminport \ + --enable-frag \ + $(call autoconf_bool,CONFIG_IPV6,ipv6) + +# override CFLAGS holding "-Werror" that break builds on compile warnings +MAKE_FLAGS+=\ + CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" + +define Build/Prepare + $(call Build/Prepare/Default) + chmod -R u+w $(PKG_BUILD_DIR) +endef + +define Build/Configure + (cd $(PKG_BUILD_DIR); touch \ + configure.ac \ + aclocal.m4 \ + Makefile.in \ + config.h.in \ + configure \ + ); + $(call Build/Configure/Default) + echo "#undef HAVE_SHADOW_H" >> $(PKG_BUILD_DIR)/config.h +endef + +define Package/ipsec-tools/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/racoon/samples/racoon.conf $(1)/etc/ + $(SED) 's|@sysconfdir_x@|/etc|g' $(1)/etc/racoon.conf + $(INSTALL_DIR) $(1)/etc/racoon + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/racoon/samples/psk.txt $(1)/etc/racoon/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/racoon.init $(1)/etc/init.d/racoon + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libipsec.so.* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libracoon.so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/plainrsa-gen $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/racoon $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/racoonctl $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/setkey $(1)/usr/sbin/ +endef + +define Package/ipsec-tools/conffiles +/etc/racoon.conf +/etc/racoon/psk.txt +endef + +$(eval $(call BuildPackage,ipsec-tools)) diff --git a/net/ipsec-tools/files/racoon.init b/net/ipsec-tools/files/racoon.init new file mode 100644 index 0000000..d539b36 --- /dev/null +++ b/net/ipsec-tools/files/racoon.init @@ -0,0 +1,17 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2011 OpenWrt.org +# Copyright (C) 2011 Artem Makhutov + +START=49 + +SERVICE_USE_PID=1 + +start() { + mkdir -m 0700 -p /var/racoon + [ -f /etc/ipsec.conf ] && /usr/sbin/setkey -f /etc/ipsec.conf + service_start /usr/sbin/racoon -f /etc/racoon.conf +} + +stop() { + service_stop /usr/sbin/racoon +} diff --git a/net/ipsec-tools/patches/001-ipsec-tools-def-psk.patch b/net/ipsec-tools/patches/001-ipsec-tools-def-psk.patch new file mode 100644 index 0000000..16f4504 --- /dev/null +++ b/net/ipsec-tools/patches/001-ipsec-tools-def-psk.patch @@ -0,0 +1,25 @@ +diff -brau ipsec-tools-0.7.3.o/src/racoon/oakley.c ipsec-tools-0.7.3/src/racoon/oakley.c +--- a/src/racoon/oakley.c 2009-08-13 11:18:45.000000000 +0200 ++++ b/src/racoon/oakley.c 2011-06-06 09:36:11.000000000 +0200 +@@ -2498,8 +2498,21 @@ + plog(LLV_ERROR, LOCATION, iph1->remote, + "couldn't find the pskey for %s.\n", + saddrwop2str(iph1->remote)); ++ } ++ } ++ if (iph1->authstr == NULL) { ++ /* ++ * If we could not locate a psk above try and locate ++ * the default psk, ie, "*". ++ */ ++ iph1->authstr = privsep_getpsk("*", 1); ++ if (iph1->authstr == NULL) { ++ plog(LLV_ERROR, LOCATION, iph1->remote, ++ "couldn't find the the default pskey either.\n"); + goto end; + } ++ plog(LLV_NOTIFY, LOCATION, iph1->remote, ++ "Using default PSK.\n"); + } + plog(LLV_DEBUG, LOCATION, NULL, "the psk found.\n"); + /* should be secret PSK */ diff --git a/net/ipsec-tools/patches/001-no_libfl.patch b/net/ipsec-tools/patches/001-no_libfl.patch new file mode 100644 index 0000000..b56b596 --- /dev/null +++ b/net/ipsec-tools/patches/001-no_libfl.patch @@ -0,0 +1,22 @@ +--- a/src/racoon/cftoken.l ++++ b/src/racoon/cftoken.l +@@ -104,6 +104,8 @@ static struct include_stack { + static int incstackp = 0; + + static int yy_first_time = 1; ++ ++int yywrap(void) { return 1; } + %} + + /* common seciton */ +--- a/src/setkey/token.l ++++ b/src/setkey/token.l +@@ -86,6 +86,8 @@ + #if defined(SADB_X_EALG_AES) && ! defined(SADB_X_EALG_AESCBC) + #define SADB_X_EALG_AESCBC SADB_X_EALG_AES + #endif ++ ++int yywrap(void) { return 1; } + %} + + /* common section */ diff --git a/net/ipsec-tools/patches/002-patch8-utmp.patch b/net/ipsec-tools/patches/002-patch8-utmp.patch new file mode 100644 index 0000000..5d36cb8 --- /dev/null +++ b/net/ipsec-tools/patches/002-patch8-utmp.patch @@ -0,0 +1,73 @@ +diff -urN build_dir/linux-ar71xx_generic/ipsec-tools-0.8.0/src/racoon/isakmp_cfg.c build_dir/linux-ar71xx_generic/ipsec-tools-0.8.0a/src/racoon/isakmp_cfg.c +--- a/src/racoon/isakmp_cfg.c 2010-09-21 16:14:17.000000000 +0300 ++++ b/src/racoon/isakmp_cfg.c 2011-07-13 11:52:16.000000000 +0300 +@@ -38,7 +38,7 @@ + #include + #include + +-#include ++#include + #if defined(__APPLE__) && defined(__MACH__) + #include + #endif +@@ -1661,7 +1661,8 @@ + int inout; + { + int error = 0; +- struct utmpx ut; ++ struct utmp ut; ++ char term[UT_LINESIZE]; + char addr[NI_MAXHOST]; + + if (usr == NULL || usr[0]=='\0') { +@@ -1670,34 +1671,37 @@ + return -1; + } + +- memset(&ut, 0, sizeof ut); +- gettimeofday((struct timeval *)&ut.ut_tv, NULL); +- snprintf(ut.ut_id, sizeof ut.ut_id, TERMSPEC, port); ++ sprintf(term, TERMSPEC, port); + + switch (inout) { + case ISAKMP_CFG_LOGIN: +- ut.ut_type = USER_PROCESS; +- strncpy(ut.ut_user, usr, sizeof ut.ut_user); ++ strncpy(ut.ut_name, usr, UT_NAMESIZE); ++ ut.ut_name[UT_NAMESIZE - 1] = '\0'; ++ ++ strncpy(ut.ut_line, term, UT_LINESIZE); ++ ut.ut_line[UT_LINESIZE - 1] = '\0'; + + GETNAMEINFO_NULL(raddr, addr); +- strncpy(ut.ut_host, addr, sizeof ut.ut_host); ++ strncpy(ut.ut_host, addr, UT_HOSTSIZE); ++ ut.ut_host[UT_HOSTSIZE - 1] = '\0'; ++ ++ ut.ut_time = time(NULL); + + plog(LLV_INFO, LOCATION, NULL, + "Accounting : '%s' logging on '%s' from %s.\n", +- ut.ut_user, ut.ut_id, addr); +- +- pututxline(&ut); ++ ut.ut_name, ut.ut_line, ut.ut_host); + ++ login(&ut); ++ + break; + case ISAKMP_CFG_LOGOUT: +- ut.ut_type = DEAD_PROCESS; + + plog(LLV_INFO, LOCATION, NULL, + "Accounting : '%s' unlogging from '%s'.\n", +- usr, ut.ut_id); +- +- pututxline(&ut); ++ usr, term); + ++ logout(term); ++ + break; + default: + plog(LLV_ERROR, LOCATION, NULL, "Unepected inout\n"); diff --git a/net/ipsec-tools/patches/003-microsoft-fqdn-in-main.patch b/net/ipsec-tools/patches/003-microsoft-fqdn-in-main.patch new file mode 100644 index 0000000..900741e --- /dev/null +++ b/net/ipsec-tools/patches/003-microsoft-fqdn-in-main.patch @@ -0,0 +1,14 @@ +diff -urN build_dir/linux-ar71xx_generic/ipsec-tools-0.8.0/src/racoon/ipsec_doi.c build_dir/linux-ar71xx_generic/ipsec-tools-0.8.0a/src/racoon/ipsec_doi.c +--- a/src/racoon/ipsec_doi.c 2010-12-14 19:57:31.000000000 +0200 ++++ b/src/racoon/ipsec_doi.c 2011-07-13 12:07:44.000000000 +0300 +@@ -3582,8 +3582,8 @@ + iph1->approval->authmethod == OAKLEY_ATTR_AUTH_METHOD_PSKEY) { + if (id_b->type != IPSECDOI_ID_IPV4_ADDR + && id_b->type != IPSECDOI_ID_IPV6_ADDR) { +- plog(LLV_ERROR, LOCATION, NULL, +- "Expecting IP address type in main mode, " ++ plog(LLV_WARNING, LOCATION, NULL, ++ "Expecting IP address type in main mode (RFC2409) , " + "but %s.\n", s_ipsecdoi_ident(id_b->type)); + return ISAKMP_NTYPE_INVALID_ID_INFORMATION; + } diff --git a/net/ipsec-tools/patches/005-isakmp-fix.patch b/net/ipsec-tools/patches/005-isakmp-fix.patch new file mode 100644 index 0000000..f7aa3c2 --- /dev/null +++ b/net/ipsec-tools/patches/005-isakmp-fix.patch @@ -0,0 +1,11 @@ +--- a/src/racoon/isakmp.c ++++ b/src/racoon/isakmp.c +@@ -31,6 +31,8 @@ + * SUCH DAMAGE. + */ + ++#define __packed __attribute__((__packed__)) ++ + #include "config.h" + + #include diff --git a/net/ipset/Makefile b/net/ipset/Makefile new file mode 100644 index 0000000..3bdccca --- /dev/null +++ b/net/ipset/Makefile @@ -0,0 +1,80 @@ + +# Copyright (C) 2009-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=ipset +PKG_VERSION:=6.11 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://ipset.netfilter.org +PKG_MD5SUM:=bfcc92e30a0fcf10ae6e7c4affa03c84 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ipset/Default + DEPENDS:= @(!(TARGET_ps3||TARGET_pxcab)||BROKEN) +endef + +define Package/ipset +$(call Package/ipset/Default) + SECTION:=net + CATEGORY:=Network + DEPENDS+= +iptables-mod-ipset +kmod-ipt-ipset +libmnl + TITLE:=IPset administration utility + URL:=http://ipset.netfilter.org/ +endef + +CONFIGURE_ARGS += \ + --with-kbuild="$(LINUX_DIR)" + +MAKE_FLAGS += \ + ARCH="$(LINUX_KARCH)" + +IPSET_MODULES:= \ + ipset/ip_set \ + ipset/ip_set_bitmap_ip \ + ipset/ip_set_bitmap_ipmac \ + ipset/ip_set_bitmap_port \ + ipset/ip_set_hash_ip \ + ipset/ip_set_hash_ipport \ + ipset/ip_set_hash_ipportip \ + ipset/ip_set_hash_ipportnet \ + ipset/ip_set_hash_net \ + ipset/ip_set_hash_netiface \ + ipset/ip_set_hash_netport \ + ipset/ip_set_list_set \ + xt_set \ + +define Build/Compile + $(call Build/Compile/Default) + $(call Build/Compile/Default,modules) +endef + +define Package/ipset/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ipset $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libipset*.so* $(1)/usr/lib/ +endef + +define KernelPackage/ipt-ipset +$(call Package/ipset/Default) + SUBMENU:=Netfilter Extensions + TITLE:=IPset netfilter modules + DEPENDS+= +kmod-ipt-core +kmod-nfnetlink + FILES:=$(foreach mod,$(IPSET_MODULES),$(PKG_BUILD_DIR)/kernel/net/netfilter/$(mod).ko) + AUTOLOAD:=$(call AutoLoad,49,$(notdir $(IPSET_MODULES))) +endef + +$(eval $(call BuildPackage,ipset)) +$(eval $(call KernelPackage,ipt-ipset)) diff --git a/net/ipset/patches/100-export.h.patch b/net/ipset/patches/100-export.h.patch new file mode 100644 index 0000000..d8a9ca2 --- /dev/null +++ b/net/ipset/patches/100-export.h.patch @@ -0,0 +1,20 @@ +--- a/kernel/net/netfilter/ipset/ip_set_getport.c ++++ b/kernel/net/netfilter/ipset/ip_set_getport.c +@@ -8,7 +8,7 @@ + /* Get Layer-4 data from the packets */ + + #include +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) + #include + #endif + #include +--- a/kernel/net/netfilter/ipset/pfxlen.c ++++ b/kernel/net/netfilter/ipset/pfxlen.c +@@ -1,5 +1,5 @@ + #include +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) + #include + #endif + #include diff --git a/net/ipset/patches/200-remove-ipv6_addr_copy.patch b/net/ipset/patches/200-remove-ipv6_addr_copy.patch new file mode 100644 index 0000000..82a680f --- /dev/null +++ b/net/ipset/patches/200-remove-ipv6_addr_copy.patch @@ -0,0 +1,22 @@ +--- a/kernel/net/netfilter/ipset/ip_set_hash_ip.c ++++ b/kernel/net/netfilter/ipset/ip_set_hash_ip.c +@@ -241,7 +241,7 @@ hash_ip6_data_isnull(const struct hash_i + static inline void + hash_ip6_data_copy(struct hash_ip6_elem *dst, const struct hash_ip6_elem *src) + { +- ipv6_addr_copy(&dst->ip.in6, &src->ip.in6); ++ dst->ip.in6 = src->ip.in6; + } + + static inline void +--- a/kernel/net/netfilter/ipset/ip_set_hash_net.c ++++ b/kernel/net/netfilter/ipset/ip_set_hash_net.c +@@ -295,7 +295,7 @@ static inline void + hash_net6_data_copy(struct hash_net6_elem *dst, + const struct hash_net6_elem *src) + { +- ipv6_addr_copy(&dst->ip.in6, &src->ip.in6); ++ dst->ip.in6 = src->ip.in6; + dst->cidr = src->cidr; + dst->nomatch = src->nomatch; + } diff --git a/net/ipset/patches/210-fix-ipv6_skip_exthdr.patch b/net/ipset/patches/210-fix-ipv6_skip_exthdr.patch new file mode 100644 index 0000000..aaecc79 --- /dev/null +++ b/net/ipset/patches/210-fix-ipv6_skip_exthdr.patch @@ -0,0 +1,29 @@ +--- a/kernel/net/netfilter/ipset/ip_set_getport.c ++++ b/kernel/net/netfilter/ipset/ip_set_getport.c +@@ -113,6 +113,17 @@ ip_set_get_ip4_port(const struct sk_buff + EXPORT_SYMBOL_GPL(ip_set_get_ip4_port); + + #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) ++static int ip_set_skip_exthdr(const struct sk_buff *skb, int start, ++ u8 *nexthdrp) ++{ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0) ++ __be16 fragoff; ++ return ipv6_skip_exthdr(skb, start, nexthdrp, &fragoff); ++#else ++ return ipv6_skip_exthdr(skb, start, nexthdrp); ++#endif ++} ++ + bool + ip_set_get_ip6_port(const struct sk_buff *skb, bool src, + __be16 *port, u8 *proto) +@@ -121,7 +132,7 @@ ip_set_get_ip6_port(const struct sk_buff + u8 nexthdr; + + nexthdr = ipv6_hdr(skb)->nexthdr; +- protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr); ++ protoff = ip_set_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr); + if (protoff < 0) + return false; + diff --git a/net/iptables-snmp/Makefile b/net/iptables-snmp/Makefile new file mode 100644 index 0000000..4e3cd2b --- /dev/null +++ b/net/iptables-snmp/Makefile @@ -0,0 +1,46 @@ +# +# 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:=iptables-snmp +PKG_VERSION:=0.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.nobiscuit.com/iptables-snmp +PKG_MD5SUM:=8370d2f0c899461a053da491400119d1 + +include $(INCLUDE_DIR)/package.mk + +define Package/iptables-snmp + SECTION:=net + CATEGORY:=Network + DEPENDS:=+snmpd +libiptc + TITLE:=An snmpd plugin to access iptables rules + URL:=http://www.nobiscuit.com/iptables-snmp/ + SUBMENU:=Firewall +endef + +define Package/iptables-snmp/description + This is a plugin that makes iptables rules accessable from snmpd. +endef + +define Build/Compile + $(call Build/Compile/Default, \ + INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + all install \ + ) +endef + +define Package/iptables-snmp/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/iptables-snmp.so $(1)/usr/lib +endef + +$(eval $(call BuildPackage,iptables-snmp)) diff --git a/net/iptables-snmp/patches/001-use_libiptc.patch b/net/iptables-snmp/patches/001-use_libiptc.patch new file mode 100644 index 0000000..a142237 --- /dev/null +++ b/net/iptables-snmp/patches/001-use_libiptc.patch @@ -0,0 +1,25 @@ +diff -urN iptables-snmp-0.1/Makefile.in iptables-snmp-0.1.new/Makefile.in +--- iptables-snmp-0.1/Makefile.in 2005-11-02 13:00:10.000000000 +0100 ++++ iptables-snmp-0.1.new/Makefile.in 2009-08-02 01:13:40.000000000 +0200 +@@ -67,7 +67,7 @@ + + all: iptables-snmp.so + +-iptables-snmp.so: $(OBJS) libiptc.a Makefile ++iptables-snmp.so: $(OBJS) Makefile + $(CC) $(CFLAGS) $(OTHER) $(DFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) + + libiptc.a: $(LIBIPTC_OBJS) Makefile +diff -urN iptables-snmp-0.1/iptables-snmp.c iptables-snmp-0.1.new/iptables-snmp.c +--- iptables-snmp-0.1/iptables-snmp.c 2005-11-02 12:10:54.000000000 +0100 ++++ iptables-snmp-0.1.new/iptables-snmp.c 2009-08-02 01:13:30.000000000 +0200 +@@ -37,6 +37,9 @@ + + #include "libiptc/libiptc.h" + ++/* For backward compatibility */ ++typedef struct iptc_handle *iptc_handle_t; ++ + static oid agent_version_oid[] = { + BASE_OID, 1, 0, AGENT_VERSION_INDEX + }; diff --git a/net/iptraf/Makefile b/net/iptraf/Makefile new file mode 100644 index 0000000..a062b8f --- /dev/null +++ b/net/iptraf/Makefile @@ -0,0 +1,64 @@ +# +# Copyright (C) 2006-2009 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:=iptraf +PKG_VERSION:=3.0.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://iptraf.seul.org/pub/iptraf/ \ + ftp://the.wiretapped.net/pub/security/network-monitoring/iptraf/ +PKG_MD5SUM:=004c2c005a1b78739e22bc49d33e244d + +include $(INCLUDE_DIR)/package.mk + +define Package/iptraf + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libncurses + TITLE:=A console-based network monitoring program + URL:=http://iptraf.seul.org/ +endef + +define Package/iptraf/description + IPTraf is a console-based network statistics utility for Linux. It gathers a + variety of figures such as TCP connection packet and byte counts, interface + statistics and activity indicators, TCP/UDP traffic breakdowns, and LAN + station packet and byte counts. +endef + +define Package/iptraf/postinst +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + mkdir -p $${IPKG_INSTROOT}/var/log/iptraf \ + $${IPKG_INSTROOT}/var/run/iptraf \ + $${IPKG_INSTROOT}/var/lib/iptraf +fi +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/src \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + DEBUG="" \ + INCLUDEDIR="-I../support $(TARGET_CPPFLAGS)" \ + LDOPTS="$(TARGET_LDFLAGS)" \ + PLATFORM="-DPLATFORM=\\\"Linux/$(ARCH)\\\"" \ + TARGET="/usr/bin" \ + WORKDIR="/var/lib/iptraf" \ + all +endef + +define Package/iptraf/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/iptraf $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/rvnamed $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,iptraf)) diff --git a/net/iptraf/patches/001-cross_compile.patch b/net/iptraf/patches/001-cross_compile.patch new file mode 100644 index 0000000..3be7570 --- /dev/null +++ b/net/iptraf/patches/001-cross_compile.patch @@ -0,0 +1,23 @@ +--- a/support/Makefile ++++ b/support/Makefile +@@ -3,16 +3,14 @@ INCLUDEDIR = -I/usr/include/ncurses + OBJS = input.o menurt.o listbox.o winops.o labels.o \ + msgboxes.o txbox.o + +-all: libtextbox.a +- + libtextbox.a: $(OBJS) + rm -rf libtextbox.a +- ar cq libtextbox.a $(OBJS) +- ranlib libtextbox.a +-# gcc -shared -o libtextbox.so $(OBJS) ++ $(AR) cq libtextbox.a $(OBJS) ++ $(RANLIB) libtextbox.a ++# $(CC) -shared -o libtextbox.so $(OBJS) + + %.o: %.c *.h +- gcc -O2 -g -Wall -fPIC $(INCLUDEDIR) -c -o $*.o $< ++ $(CC) $(CFLAGS) -Wall -fPIC $(INCLUDEDIR) -c -o $*.o $< + + clean: + rm -rf *.o *~ libtextbox.a libtextbox.so diff --git a/net/iptraf/patches/002-ifaces.patch b/net/iptraf/patches/002-ifaces.patch new file mode 100644 index 0000000..e4b0b1c --- /dev/null +++ b/net/iptraf/patches/002-ifaces.patch @@ -0,0 +1,281 @@ +--- a/src/dirs.h ++++ b/src/dirs.h +@@ -155,7 +155,6 @@ + */ + + #define ETHFILE get_path(T_WORKDIR, "ethernet.desc") +-#define FDDIFILE get_path(T_WORKDIR, "fddi.desc") + + /* + * The rvnamed program file +--- a/src/hostmon.c ++++ b/src/hostmon.c +@@ -31,7 +31,6 @@ details. + #include + #include + #include +-#include + #include + #include + #include +@@ -294,8 +293,6 @@ void printethent(struct ethtab *table, s + wprintw(table->tabwin, "Ethernet"); + else if (entry->un.desc.linktype == LINK_PLIP) + wprintw(table->tabwin, "PLIP"); +- else if (entry->un.desc.linktype == LINK_FDDI) +- wprintw(table->tabwin, "FDDI"); + + wprintw(table->tabwin, " HW addr: %s", entry->un.desc.ascaddr); + +@@ -723,7 +720,7 @@ void hostmon(const struct OPTIONS *optio + unsigned long long updtime_usec = 0; + + struct desclist elist; /* Ethernet description list */ +- struct desclist flist; /* FDDI description list */ ++ struct desclist flist; /* Other links description list */ + struct desclist *list = NULL; + + FILE *logfile = NULL; +@@ -787,7 +784,6 @@ void hostmon(const struct OPTIONS *optio + + initethtab(&table, options->actmode); + loaddesclist(&elist, LINK_ETHERNET, WITHETCETHERS); +- loaddesclist(&flist, LINK_FDDI, WITHETCETHERS); + + if (logging) { + if (strcmp(current_logfile, "") == 0) { +@@ -901,9 +897,7 @@ void hostmon(const struct OPTIONS *optio + if (pkt_result != PACKET_OK) + continue; + +- if ((linktype == LINK_ETHERNET) || (linktype == LINK_FDDI) +- || (linktype == LINK_PLIP) || (linktype == LINK_TR) || +- (linktype == LINK_VLAN)) { ++ if ((linktype == LINK_ETHERNET) || (linktype == LINK_PLIP) || (linktype == LINK_TR) || (linktype == LINK_VLAN)) { + + if (fromaddr.sll_protocol == htons(ETH_P_IP)) + is_ip = 1; +@@ -921,12 +915,6 @@ void hostmon(const struct OPTIONS *optio + memcpy(scratch_daddr, ((struct ethhdr *) buf)->h_dest, + ETH_ALEN); + list = &elist; +- } else if (linktype == LINK_FDDI) { +- memcpy(scratch_saddr, ((struct fddihdr *) buf)->saddr, +- FDDI_K_ALEN); +- memcpy(scratch_daddr, ((struct fddihdr *) buf)->daddr, +- FDDI_K_ALEN); +- list = &flist; + } else if (linktype == LINK_TR) { + memcpy(scratch_saddr, ((struct trh_hdr *) buf)->saddr, + TR_ALEN); +--- a/src/ifaces.c ++++ b/src/ifaces.c +@@ -37,7 +37,7 @@ extern int accept_unsupported_interfaces + extern int daemonized; + + char ifaces[][6] = +- { "lo", "eth", "sl", "ppp", "ippp", "plip", "fddi", "isdn", "dvb", ++ { "lo", "eth", "sl", "ppp", "ippp", "plip", "isdn", "dvb", + "pvc", "hdlc", "ipsec", "sbni", "tr", "wvlan", "wlan", "sm2", "sm3", + "pent", "lec", "brg", "tun", "tap", "cipcb", "tunl", "vlan" + }; +--- a/src/landesc.c ++++ b/src/landesc.c +@@ -83,8 +83,6 @@ void loaddesclist(struct desclist *list, + + if (linktype == LINK_ETHERNET) + fd = fopen(ETHFILE, "r"); +- else if (linktype == LINK_FDDI) +- fd = fopen(FDDIFILE, "r"); + + if (fd == NULL) { + return; +@@ -205,8 +203,6 @@ void savedesclist(struct desclist *list, + + if (linktype == LINK_ETHERNET) + fd = fopen(ETHFILE, "w"); +- else if (linktype == LINK_FDDI) +- fd = fopen(FDDIFILE, "w"); + + if (fd < 0) { + etherr(); +--- a/src/links.h ++++ b/src/links.h +@@ -6,7 +6,6 @@ + #define LINK_ISDN_RAWIP 6 + #define LINK_ISDN_CISCOHDLC 7 + #define LINK_CISCOHDLC 7 +-#define LINK_FDDI 8 + #define LINK_FRAD 9 + #define LINK_DLCI 10 + #define LINK_TR 11 +--- a/src/log.c ++++ b/src/log.c +@@ -491,8 +491,6 @@ void writeethlog(struct ethtabent *list, + ptmp->un.desc.ascaddr); + else if (ptmp->un.desc.linktype == LINK_PLIP) + fprintf(fd, "\nPLIP address: %s", ptmp->un.desc.ascaddr); +- else if (ptmp->un.desc.linktype == LINK_FDDI) +- fprintf(fd, "\nFDDI address: %s", ptmp->un.desc.ascaddr); + + if (ptmp->un.desc.withdesc) + fprintf(fd, " (%s)", ptmp->un.desc.desc); +--- a/src/options.c ++++ b/src/options.c +@@ -68,8 +68,6 @@ void makeoptionmenu(struct MENU *menu) + tx_additem(menu, NULL, NULL); + tx_additem(menu, " ^E^thernet/PLIP host descriptions...", + "Manages descriptions for Ethernet and PLIP addresses"); +- tx_additem(menu, " ^F^DDI/Token Ring host descriptions...", +- "Manages descriptions for FDDI and FDDI addresses"); + tx_additem(menu, NULL, NULL); + tx_additem(menu, " E^x^it configuration", "Returns to main menu"); + } +@@ -371,9 +369,6 @@ void setoptions(struct OPTIONS *options, + case 14: + ethdescmgr(LINK_ETHERNET); + break; +- case 15: +- ethdescmgr(LINK_FDDI); +- break; + } + + indicatesetting(row, options, statwin); +--- a/src/othptab.c ++++ b/src/othptab.c +@@ -22,7 +22,6 @@ details. + #include + #include + #include +-#include + #include + #include "arphdr.h" + #include "options.h" +@@ -142,11 +141,6 @@ struct othptabent *add_othp_entry(struct + new_entry->smacaddr); + convmacaddr(((struct ethhdr *) packet)->h_dest, + new_entry->dmacaddr); +- } else if (linkproto == LINK_FDDI) { +- convmacaddr(((struct fddihdr *) packet)->saddr, +- new_entry->smacaddr); +- convmacaddr(((struct fddihdr *) packet)->daddr, +- new_entry->dmacaddr); + } else if (linkproto == LINK_TR) { + convmacaddr(((struct trh_hdr *) packet)->saddr, + new_entry->smacaddr); +@@ -376,8 +370,7 @@ void printothpentry(struct othptable *ta + strcat(msgstring, scratchpad); + + if ((entry->linkproto == LINK_ETHERNET) || +- (entry->linkproto == LINK_PLIP) || +- (entry->linkproto == LINK_FDDI)) { ++ (entry->linkproto == LINK_PLIP)) { + sprintf(scratchpad, " from %s to %s on %s", + entry->smacaddr, entry->dmacaddr, entry->iface); + +--- a/src/packet.c ++++ b/src/packet.c +@@ -35,7 +35,6 @@ details. + #include + #include + #include +-#include + #include + #include + #include +@@ -81,8 +80,6 @@ unsigned short getlinktype(unsigned shor + result = LINK_ETHERNET; + else if (strncmp(ifname, "plip", 4) == 0) + result = LINK_PLIP; +- else if (strncmp(ifname, "fddi", 4) == 0) /* For some Ethernet- */ +- result = LINK_ETHERNET; /* emulated FDDI ifaces */ + else if (strncmp(ifname, "dvb", 3) == 0) + result = LINK_ETHERNET; + else if (strncmp(ifname, "sbni", 4) == 0) +@@ -136,9 +133,6 @@ unsigned short getlinktype(unsigned shor + case ARPHRD_PPP: + result = LINK_PPP; + break; +- case ARPHRD_FDDI: +- result = LINK_FDDI; +- break; + case ARPHRD_IEEE802: + case ARPHRD_IEEE802_TR: + result = LINK_TR; +@@ -194,19 +188,6 @@ void adjustpacket(char *tpacket, unsigne + *packet = tpacket + 4; + *readlen -= 4; + break; +- case LINK_FDDI: +- *packet = tpacket + sizeof(struct fddihdr); +- *readlen -= sizeof(struct fddihdr); +- +- /* +- * Move IP data into an aligned buffer. 96 bytes should be sufficient +- * for IP and TCP headers with reasonable numbers of options and some +- * data. +- */ +- +- memmove(aligned_buf, *packet, min(SNAPSHOT_LEN, *readlen)); +- *packet = aligned_buf; +- break; + case LINK_TR: + /* + * Token Ring patch supplied by Tomas Dvorak +--- a/src/promisc.c ++++ b/src/promisc.c +@@ -81,8 +81,8 @@ void init_promisc_list(struct promisc_st + */ + + if ((strncmp(buf, "eth", 3) == 0) || +- (strncmp(buf, "fddi", 4) == 0) || + (strncmp(buf, "tr", 2) == 0) || ++ (strncmp(buf, "vlan", 4) == 0) || + (strncmp(ptmp->params.ifname, "wvlan", 4) == 0) || + (strncmp(ptmp->params.ifname, "lec", 3) == 0) || + (accept_unsupported_interfaces)) { +@@ -195,7 +195,7 @@ void srpromisc(int mode, struct promisc_ + + while (ptmp != NULL) { + if (((strncmp(ptmp->params.ifname, "eth", 3) == 0) || +- (strncmp(ptmp->params.ifname, "fddi", 4) == 0) || ++ (strncmp(ptmp->params.ifname, "vlan", 4) == 0) || + (strncmp(ptmp->params.ifname, "tr", 2) == 0) || + (strncmp(ptmp->params.ifname, "wvlan", 4) == 0) || + (strncmp(ptmp->params.ifname, "lec", 3) == 0)) && +--- a/src/rvnamed.h ++++ b/src/rvnamed.h +@@ -1,9 +1,9 @@ + #include + #include + +-#define CHILDSOCKNAME "/dev/rvndcldcomsk" +-#define PARENTSOCKNAME "/dev/rvndpntcomsk" +-#define IPTSOCKNAME "/dev/rvndiptcomsk" ++#define CHILDSOCKNAME "/tmp/rvndcldcomsk" ++#define PARENTSOCKNAME "/tmp/rvndpntcomsk" ++#define IPTSOCKNAME "/tmp/rvndiptcomsk" + + #define SOCKET_PREFIX "isock" + +--- a/src/tcptable.c ++++ b/src/tcptable.c +@@ -600,8 +600,6 @@ void updateentry(struct tcptable *table, + + if ((linkproto == LINK_ETHERNET) || (linkproto == LINK_PLIP)) { + convmacaddr(((struct ethhdr *) packet)->h_source, newmacaddr); +- } else if (linkproto == LINK_FDDI) { +- convmacaddr(((struct fddihdr *) packet)->saddr, newmacaddr); + } else if (linkproto == LINK_TR) { + convmacaddr(((struct trh_hdr *) packet)->saddr, newmacaddr); + } +--- a/src/tcptable.h ++++ b/src/tcptable.h +@@ -23,7 +23,6 @@ + #include + #include + #include +-#include + #include + // #include + #include diff --git a/net/iptraf/patches/003-exit_menu.patch b/net/iptraf/patches/003-exit_menu.patch new file mode 100644 index 0000000..6429a95 --- /dev/null +++ b/net/iptraf/patches/003-exit_menu.patch @@ -0,0 +1,11 @@ +--- a/src/options.c ++++ b/src/options.c +@@ -372,7 +372,7 @@ void setoptions(struct OPTIONS *options, + } + + indicatesetting(row, options, statwin); +- } while (row != 17); ++ } while (row != 16); + + tx_destroymenu(&menu); + del_panel(statpanel); diff --git a/net/iptraf/patches/004-includes_fix.patch b/net/iptraf/patches/004-includes_fix.patch new file mode 100644 index 0000000..50d218b --- /dev/null +++ b/net/iptraf/patches/004-includes_fix.patch @@ -0,0 +1,20 @@ +--- a/src/othptab.c ++++ b/src/othptab.c +@@ -18,6 +18,7 @@ details. + + #include + #include ++#include + #include + #include + #include +--- a/src/tr.c ++++ b/src/tr.c +@@ -7,6 +7,7 @@ + */ + + #include ++#include + #include + #include + diff --git a/net/iptraf/patches/005-atheros.patch b/net/iptraf/patches/005-atheros.patch new file mode 100644 index 0000000..7e9bcc9 --- /dev/null +++ b/net/iptraf/patches/005-atheros.patch @@ -0,0 +1,40 @@ +--- a/src/ifaces.c 2009-11-28 18:45:44.000000000 +0000 ++++ b/src/ifaces.c 2009-11-28 18:47:46.000000000 +0000 +@@ -32,14 +32,14 @@ + #include "error.h" + + extern int accept_unsupported_interfaces; +-#define NUM_SUPPORTED_IFACES 26 ++#define NUM_SUPPORTED_IFACES 27 + + extern int daemonized; + + char ifaces[][6] = + { "lo", "eth", "sl", "ppp", "ippp", "plip", "isdn", "dvb", + "pvc", "hdlc", "ipsec", "sbni", "tr", "wvlan", "wlan", "sm2", "sm3", +- "pent", "lec", "brg", "tun", "tap", "cipcb", "tunl", "vlan" ++ "pent", "lec", "brg", "tun", "tap", "cipcb", "tunl", "vlan", "ath" + }; + + char *ltrim(char *buf) +--- a/src/packet.c 2009-11-28 18:45:44.000000000 +0000 ++++ b/src/packet.c 2009-11-28 18:48:06.000000000 +0000 +@@ -104,6 +104,8 @@ + result = LINK_ETHERNET; + else if (strncmp(ifname, "tap", 3) == 0) + result = LINK_ETHERNET; ++ else if (strncmp(ifname, "ath", 3) == 0) ++ result = LINK_ETHERNET; + else if ((strncmp(ifname, "isdn", 4) == 0) && (isdn_fd != -1)) { + isdnent = isdn_table_lookup(isdnlist, ifname, isdn_fd); + +--- a/src/promisc.c 2009-11-28 18:45:44.000000000 +0000 ++++ b/src/promisc.c 2009-11-28 18:48:28.000000000 +0000 +@@ -82,6 +82,7 @@ + + if ((strncmp(buf, "eth", 3) == 0) || + (strncmp(buf, "tr", 2) == 0) || ++ (strncmp(buf, "ath", 3) == 0) || + (strncmp(buf, "vlan", 4) == 0) || + (strncmp(ptmp->params.ifname, "wvlan", 4) == 0) || + (strncmp(ptmp->params.ifname, "lec", 3) == 0) || diff --git a/net/iptraf/patches/005-no_size_cmd.patch b/net/iptraf/patches/005-no_size_cmd.patch new file mode 100644 index 0000000..1307835 --- /dev/null +++ b/net/iptraf/patches/005-no_size_cmd.patch @@ -0,0 +1,11 @@ +--- a/src/Makefile ++++ b/src/Makefile +@@ -106,8 +106,6 @@ error.o log.o mode.o getpath.o bar.o par + BINS = iptraf rvnamed rawtime + + all: $(BINS) +- @echo +- @size $(BINS) + + iptraf: $(OBJS) textlib + $(CC) $(LDOPTS) $(PROF) -o iptraf $(OBJS) $(LIBS) diff --git a/net/ipupdate/Makefile b/net/ipupdate/Makefile new file mode 100644 index 0000000..7651a62 --- /dev/null +++ b/net/ipupdate/Makefile @@ -0,0 +1,70 @@ +# +# Copyright (C) 2006-2011 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:=ipupdate +PKG_VERSION:=1.1.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/ipupdate +PKG_MD5SUM:=88ad3ac097190055db4ba816b9d26d13 + + +include $(INCLUDE_DIR)/package.mk + +define Package/ipupdate + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=IPUpdate-Daemon + URL:=http://ipupdate.sourceforge.net +endef + +define Package/ipupdate/description + Lightweight remote DNS update-daemon which implements RFC 2136 dynamic updates. + Compatible with BIND, Simple DNS, and Microsoft DNS Server. +endef + + +define Build/Configure +$(call Build/Configure/Default,, \ + UNAME_S="Linux" \ + UNAME_R="$(LINUX_VERSION)" \ + UNAME_M="$(ARCH)" \ +) +endef + +define Build/Compile + rm -rf $(PKG_INSTALL_DIR) + mkdir -p $(PKG_INSTALL_DIR)/usr + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CC="$(TARGET_CC) $(TARGET_CFLAGS) -s" \ + PRECOMPILED_FILTER=1 \ + STAGING_DIR="$(STAGING_DIR)" \ + DESTDIR="$(PKG_INSTALL_DIR)/usr" \ + all +endef + +define Package/ipupdate/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ipupdate $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/ipupdate + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dollardns $(1)/etc/ipupdate/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/failover $(1)/etc/ipupdate/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ifip $(1)/etc/ipupdate/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/whatismyip $(1)/etc/ipupdate/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/ipupdate.conf $(1)/etc/ +endef + +define Package/ipupdate/conffiles +/etc/ipupdate.conf +endef + +$(eval $(call BuildPackage,ipupdate)) diff --git a/net/ipupdate/patches/100-name_conflict.patch b/net/ipupdate/patches/100-name_conflict.patch new file mode 100644 index 0000000..b0b1c93 --- /dev/null +++ b/net/ipupdate/patches/100-name_conflict.patch @@ -0,0 +1,115 @@ +--- a/include/array.c ++++ b/include/array.c +@@ -1,7 +1,7 @@ + #include "array.h" + + /* +-** split ++** array_split + ** + ** Accepts a string argument converting all delimeters to nulls + ** Returns an allocated array pointer or NULL +@@ -14,7 +14,7 @@ + ** str is not to be deallocated while using this array + */ + +-char** split(char* str, const char* del, int* cnt) ++char** array_split(char* str, const char* del, int* cnt) + { + char** args = NULL; + int inc; +@@ -53,7 +53,7 @@ char** split(char* str, const char* del, + } + + /* +-** splice ++** array_splice + ** + ** remove length elements from array starting at offset + ** All trailing elements will be left aligned +@@ -70,7 +70,7 @@ char** split(char* str, const char* del, + ** Returns the number of elements removed + */ + +-int splice(void** array, int cnt, int offset, int length) ++int array_splice(void** array, int cnt, int offset, int length) + { + int t; + +--- a/include/array.h ++++ b/include/array.h +@@ -1,5 +1,5 @@ + #include + #include + +-char** split(char*, const char*, int*); +-int splice(void**, int, int, int); ++char** array_split(char*, const char*, int*); ++int array_splice(void**, int, int, int); +--- a/ipupdate.c ++++ b/ipupdate.c +@@ -295,7 +295,7 @@ int DoUpdate(int check) + free(zone->keyname); + free(server->zones[j]); + +- server->zonec -= splice((void**)server->zones, server->zonec, j, 1); ++ server->zonec -= array_splice((void**)server->zones, server->zonec, j, 1); + continue; + } + +@@ -317,7 +317,7 @@ int DoUpdate(int check) + free(server->zones); + free(cfg.servers[i]); + +- cfg.serverc -= splice((void**)cfg.servers, cfg.serverc, i, 1); ++ cfg.serverc -= array_splice((void**)cfg.servers, cfg.serverc, i, 1); + continue; + } + i++; +@@ -414,7 +414,7 @@ int checkcname(int *s, struct server *se + asprintf(&msg, "checkcname: server %s: zone %s: host %s: host disabled", server->name, zone->name, zone->hosts[i]); + PostMsgFree(msg); + +- zone->hostc -= splice((void**)zone->hosts, zone->hostc, i, 1); ++ zone->hostc -= array_splice((void**)zone->hosts, zone->hostc, i, 1); + continue; + } + +@@ -446,7 +446,7 @@ int checkcname(int *s, struct server *se + asprintf(&msg, "checkcname: server %s: zone %s: host %s: host disabled", server->name, zone->name, zone->hosts[i]); + PostMsgFree(msg); + +- zone->hostc -= splice((void**)zone->hosts, zone->hostc, i, 1); ++ zone->hostc -= array_splice((void**)zone->hosts, zone->hostc, i, 1); + continue; + } + //append the record to the packet +@@ -488,7 +488,7 @@ int checkcname(int *s, struct server *se + asprintf(&msg, "checkcname: server %s: zone %s: host %s: host disabled", server->name, zone->name, zone->hosts[i]); + PostMsgFree(msg); + +- zone->hostc -= splice((void**)zone->hosts, zone->hostc, i, 1); ++ zone->hostc -= array_splice((void**)zone->hosts, zone->hostc, i, 1); + continue; + } + +@@ -561,7 +561,7 @@ int checkip(int *s, struct server *serve + asprintf(&msg, "checkip: server %s: zone %s: host %s: host disabled", server->name, zone->name, zone->hosts[i]); + PostMsgFree(msg); + +- if (zone->hostc -= splice((void**)zone->hosts, zone->hostc, i, 1)) ++ if (zone->hostc -= array_splice((void**)zone->hosts, zone->hostc, i, 1)) + { + *((unsigned short*)&pkt.data[8]) = htons(zone->hostc); + continue; +--- a/config.c ++++ b/config.c +@@ -873,7 +873,7 @@ void cfg_zone(struct server *server, str + switch (cfg_readblock(data, &term, &ptr)) { + case CFG_QUOTED: + zone->hostp = term; +- zone->hosts = split(zone->hostp, ", \t\r\n", &zone->hostc); ++ zone->hosts = array_split(zone->hostp, ", \t\r\n", &zone->hostc); + if (zone->hostc > 32767) + { + asprintf(&msg, "getconfig: zone \"%s\": there may not be more than 32767 hosts", zone->name); diff --git a/net/ipupdate/patches/200-byteorder.patch b/net/ipupdate/patches/200-byteorder.patch new file mode 100644 index 0000000..48cb9c6 --- /dev/null +++ b/net/ipupdate/patches/200-byteorder.patch @@ -0,0 +1,11 @@ +--- a/include/dns.c ++++ b/include/dns.c +@@ -127,7 +127,7 @@ int dns_t2wtsig(char *pktdata, unsigned + tsig.hitime = 0; + tsig.lotime = htonl(signtime); + tsig.fudge = htons(fudge); +- tsig.macsize = 0x1000; //16 ++ tsig.macsize = htons(16); + memset(tsig.mac, 0, 16); + memcpy(&tsig.id, pktdata, 2); + tsig.error = 0; diff --git a/net/iputils/Makefile b/net/iputils/Makefile new file mode 100644 index 0000000..331751d --- /dev/null +++ b/net/iputils/Makefile @@ -0,0 +1,178 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=iputils +PKG_VERSION:=20101006 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-s$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.skbuff.net/iputils +PKG_MD5SUM:=a36c25e9ec17e48be514dc0485e7376c + +PKG_BUILD_DEPENDS:=sysfsutils +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-s$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + + +define Package/iputils/Default + SECTION:=net + CATEGORY:=Network + URL:=http://www.skbuff.net/iputils +endef + + +define Package/iputils-arping +$(call Package/iputils/Default) + TITLE:=iputils - arping + DEPENDS+= +libsysfs +endef + +define Package/iputils-arping/description + Program arping from iputils. + Sends ARP REQUEST to a neighbour host. +endef + + +define Package/iputils-clockdiff +$(call Package/iputils/Default) + TITLE:=iputils - clockdiff +endef + +define Package/iputils-clockdiff/description + Program clockdiff from iputils. + Measures clock difference between hosts. +endef + + +define Package/iputils-ping +$(call Package/iputils/Default) + TITLE:=iputils - ping +endef + +define Package/iputils-ping/description + Program ping from iputils. + Sends ICMP ECHO_REQUEST to network hosts (IPv4). +endef + + +define Package/iputils-ping6 +$(call Package/iputils/Default) + TITLE:=iputils - ping6 + DEPENDS+= @IPV6 +endef + +define Package/iputils-ping6/description + Program ping6 from iputils. + Sends ICMP ECHO_REQUEST to network hosts (IPv6). +endef + + +define Package/iputils-tftpd +$(call Package/iputils/Default) + TITLE:=iputils - tftpd +endef + +define Package/iputils-tftpd/description + Program tftpd from iputils + Trivial File Transfer Protocol server. +endef + + +define Package/iputils-tracepath +$(call Package/iputils/Default) + TITLE:=iputils - tracepath +endef + +define Package/iputils-tracepath/description + Program tracepath from iputils. + Traces path to a network host discovering MTU along this path (IPv4). +endef + + +define Package/iputils-tracepath6 +$(call Package/iputils/Default) + TITLE:=iputils - tracepath6 + DEPENDS+= @IPV6 +endef + +define Package/iputils-tracepath6/description + Program tracepath6 from iputils. + Traces path to a network host discovering MTU along this path (IPv6). +endef + + +define Package/iputils-traceroute6 +$(call Package/iputils/Default) + TITLE:=iputils - traceroute6 + DEPENDS+= @IPV6 +endef + +define Package/iputils-traceroute6/description + Program traceroute6 from iputils. + Traces path to a network host (IPv6). +endef + +ifeq ($(BOARD),brcm47xx) + TARGET_CFLAGS += -O2 +endif + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)" \ + CONFIG_IPV6="$(CONFIG_IPV6)" \ + CONFIG_USE_UCLIBC="$(CONFIG_USE_UCLIBC)" \ + +define Package/iputils-arping/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/arping $(1)/usr/bin/ +endef + +define Package/iputils-clockdiff/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/clockdiff $(1)/usr/bin/ +endef + +define Package/iputils-ping/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ping $(1)/usr/bin/ +endef + +define Package/iputils-ping6/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ping6 $(1)/usr/bin/ +endef + +define Package/iputils-tftpd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tftpd $(1)/usr/sbin/ +endef + +define Package/iputils-tracepath/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tracepath $(1)/usr/bin/ +endef + +define Package/iputils-tracepath6/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tracepath6 $(1)/usr/bin/ +endef + +define Package/iputils-traceroute6/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/traceroute6 $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,iputils-arping)) +$(eval $(call BuildPackage,iputils-clockdiff)) +$(eval $(call BuildPackage,iputils-ping)) +$(eval $(call BuildPackage,iputils-tftpd)) +$(eval $(call BuildPackage,iputils-tracepath)) +$(eval $(call BuildPackage,iputils-ping6)) +$(eval $(call BuildPackage,iputils-tracepath6)) +$(eval $(call BuildPackage,iputils-traceroute6)) diff --git a/net/iputils/patches/001-iputils.patch b/net/iputils/patches/001-iputils.patch new file mode 100644 index 0000000..e57db13 --- /dev/null +++ b/net/iputils/patches/001-iputils.patch @@ -0,0 +1,14 @@ +diff -ur a/Makefile b/Makefile +--- a/Makefile 2002-09-20 18:23:55.000000000 +0000 ++++ b/Makefile 2007-05-17 13:59:55.000000000 +0000 +@@ -16,8 +16,8 @@ + CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g + CFLAGS=$(CCOPT) $(GLIBCFIX) $(DEFINES) + +-IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd +-IPV6_TARGETS=tracepath6 traceroute6 ping6 ++IPV4_TARGETS=tracepath ping clockdiff arping tftpd ++IPV6_TARGETS=tracepath6 traceroute6 ping6 + TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS) + + LASTTAG:=`git describe HEAD | sed -e 's/-.*//'` diff --git a/net/iputils/patches/002-fix-ipv6.patch b/net/iputils/patches/002-fix-ipv6.patch new file mode 100644 index 0000000..4411ca7 --- /dev/null +++ b/net/iputils/patches/002-fix-ipv6.patch @@ -0,0 +1,14 @@ +--- a/Makefile ++++ b/Makefile +@@ -18,7 +18,10 @@ CFLAGS=$(CCOPT) $(GLIBCFIX) $(DEFINES) + + IPV4_TARGETS=tracepath ping clockdiff arping tftpd + IPV6_TARGETS=tracepath6 traceroute6 ping6 +-TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS) ++TARGETS=$(IPV4_TARGETS) ++ifeq ($(CONFIG_IPV6),y) ++ TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS) ++endif + + LASTTAG:=`git describe HEAD | sed -e 's/-.*//'` + TAG:=`date +s%Y%m%d` diff --git a/net/iputils/patches/003-fix-makefile.patch b/net/iputils/patches/003-fix-makefile.patch new file mode 100644 index 0000000..926c685 --- /dev/null +++ b/net/iputils/patches/003-fix-makefile.patch @@ -0,0 +1,18 @@ +--- a/Makefile ++++ b/Makefile +@@ -30,9 +30,13 @@ all: $(TARGETS) + + + tftpd: tftpd.o tftpsubs.o +-arping: arping.o -lsysfs ++arping: arping.o ++ $(CC) $(CFLAGS) -o $@ arping.o -lsysfs + ping: ping.o ping_common.o +-ping6: ping6.o ping_common.o -lresolv -lcrypto ++ping6: ping6.o ping_common.o ++ifneq ($(CONFIG_USE_UCLIBC),y) ++ $(CC) $(CFLAGS) -o $@ ping6.o ping_common.o -lresolv -lcrypto ++endif + ping.o ping6.o ping_common.o: ping_common.h + tftpd.o tftpsubs.o: tftp.h + diff --git a/net/iputils/patches/010-ping6_uclibc_resolv.patch b/net/iputils/patches/010-ping6_uclibc_resolv.patch new file mode 100644 index 0000000..6955803 --- /dev/null +++ b/net/iputils/patches/010-ping6_uclibc_resolv.patch @@ -0,0 +1,200 @@ +diff --git a/ping6.c b/ping6.c +index c5ff881..ef2243f 100644 +--- a/ping6.c ++++ b/ping6.c +@@ -71,9 +71,11 @@ char copyright[] = + #include + #include + #include ++#ifndef __UCLIBC__ + #include + + #include "ping6_niquery.h" ++#endif /* __UCLIBC__ */ + + #ifndef SOL_IPV6 + #define SOL_IPV6 IPPROTO_IPV6 +@@ -154,6 +156,7 @@ int pmtudisc=-1; + + static int icmp_sock; + ++#ifndef __UCLIBC__ + #include + + /* Node Information query */ +@@ -165,6 +168,7 @@ int ni_subject_type = 0; + char *ni_group; + + __u8 ni_nonce[8]; ++#endif /* __UCLIBC__ */ + + static struct in6_addr in6_anyaddr; + static __inline__ int ipv6_addr_any(struct in6_addr *addr) +@@ -223,6 +227,7 @@ unsigned int if_name2index(const char *ifname) + return i; + } + ++#ifndef __UCLIBC__ + struct niquery_option { + char *name; + int namelen; +@@ -512,6 +517,7 @@ char *ni_groupaddr(const char *name) + strcat(nigroup_buf, q); + return nigroup_buf; + } ++#endif /* __UCLIBC__ */ + + int main(int argc, char *argv[]) + { +@@ -595,12 +601,14 @@ int main(int argc, char *argv[]) + case 'V': + printf("ping6 utility, iputils-ss%s\n", SNAPSHOT); + exit(0); ++#ifndef __UCLIBC__ + case 'N': + if (niquery_option_handler(optarg) < 0) { + usage(); + break; + } + break; ++#endif /* __UCLIBC__ */ + COMMON_OPTIONS + common_options(ch); + break; +@@ -663,6 +671,7 @@ int main(int argc, char *argv[]) + argc--; + } + ++#ifndef __UCLIBC__ + if (ni_query >= 0) { + int i; + for (i = 0; i < 8; i++) +@@ -674,15 +683,20 @@ int main(int argc, char *argv[]) + ni_subject_type = NI_SUBJ_IPV6; + } + } ++#endif /* __UCLIBC__ */ + + if (argc > 1) + usage(); + else if (argc == 1) { + target = *argv; + } else { ++#ifndef __UCLIBC__ + if (ni_query < 0 && ni_subject_type != NI_SUBJ_NAME) ++#endif /* __UCLIBC__ */ + usage(); ++#ifndef __UCLIBC__ + target = ni_group; ++#endif /* __UCLIBC__ */ + } + + memset(&hints, 0, sizeof(hints)); +@@ -817,7 +831,11 @@ int main(int argc, char *argv[]) + exit(2); + } + ++#ifndef __UCLIBC__ + if (datalen >= sizeof(struct timeval) && (ni_query < 0)) { ++#else ++ if (datalen >= sizeof(struct timeval)) { ++#endif /* __UCLIBC__ */ + /* can we time transfer */ + timing = 1; + } +@@ -866,9 +884,11 @@ int main(int argc, char *argv[]) + ICMP6_FILTER_SETPASS(ICMP6_PARAM_PROB, &filter); + } + ++#ifndef __UCLIBC__ + if (ni_query >= 0) + ICMP6_FILTER_SETPASS(ICMPV6_NI_REPLY, &filter); + else ++#endif /* __UCLIBC__ */ + ICMP6_FILTER_SETPASS(ICMP6_ECHO_REPLY, &filter); + + err = setsockopt(icmp_sock, IPPROTO_ICMPV6, ICMP6_FILTER, &filter, +@@ -1100,6 +1120,7 @@ int build_echo(__u8 *_icmph) + return cc; + } + ++#ifndef __UCLIBC__ + int build_niquery(__u8 *_nih) + { + struct ni_hdr *nih; +@@ -1125,6 +1146,7 @@ int build_niquery(__u8 *_nih) + + return cc; + } ++#endif /* __UCLIBC__ */ + + int send_probe(void) + { +@@ -1132,9 +1154,11 @@ int send_probe(void) + + CLR((ntransmitted+1) % mx_dup_ck); + ++#ifndef __UCLIBC__ + if (ni_query >= 0) + len = build_niquery(outpack); + else ++#endif /* __UCLIBC__ */ + len = build_echo(outpack); + + if (cmsglen == 0) { +@@ -1176,6 +1200,7 @@ static void putchar_safe(char c) + printf("\\%03o", c); + } + ++#ifndef __UCLIBC__ + void pr_niquery_reply_name(struct ni_hdr *nih, int len) + { + __u8 *h = (__u8 *)(nih + 1); +@@ -1304,6 +1329,7 @@ void pr_niquery_reply(__u8 *_nih, int len) + } + putchar(';'); + } ++#endif /* __UCLIBC__ */ + + /* + * parse_reply -- +@@ -1353,6 +1379,7 @@ parse_reply(struct msghdr *msg, int cc, void *addr, struct timeval *tv) + hops, 0, tv, pr_addr(&from->sin6_addr), + pr_echo_reply)) + return 0; ++#ifndef __UCLIBC__ + } else if (icmph->icmp6_type == ICMPV6_NI_REPLY) { + struct ni_hdr *nih = (struct ni_hdr *)icmph; + __u16 seq = ntohs(*(__u16 *)nih->ni_nonce); +@@ -1363,6 +1390,7 @@ parse_reply(struct msghdr *msg, int cc, void *addr, struct timeval *tv) + hops, 0, tv, pr_addr(&from->sin6_addr), + pr_niquery_reply)) + return 0; ++#endif /* __UCLIBC__ */ + } else { + int nexthdr; + struct ip6_hdr *iph1 = (struct ip6_hdr*)(icmph+1); +@@ -1557,7 +1585,9 @@ void usage(void) + "Usage: ping6 [-LUdfnqrvVaAD] [-c count] [-i interval] [-w deadline]\n" + " [-p pattern] [-s packetsize] [-t ttl] [-I interface]\n" + " [-M pmtudisc-hint] [-S sndbuf] [-F flowlabel] [-Q tclass]\n" ++#ifndef __UCLIBC__ + " [[-N nodeinfo-option] ...]\n" ++#endif /* __UCLIBC__ */ + " [hop1 ...] destination\n"); + exit(2); + } +diff --git a/ping6_niquery.h b/ping6_niquery.h +index 61a5cfa..34c31f8 100644 +--- a/ping6_niquery.h ++++ b/ping6_niquery.h +@@ -1,3 +1,4 @@ ++#ifndef __UCLIBC__ + #include + + /* Node Information Query */ +@@ -45,3 +46,4 @@ struct ni_hdr { + #define NI_IPV4ADDR_F_TRUNCATE NI_IPV6ADDR_F_TRUNCATE + #define NI_IPV4ADDR_F_ALL NI_IPV6ADDR_F_ALL + ++#endif /* __UCLIBC__ */ diff --git a/net/iputils/patches/011-ping6_use_gnu_source.patch b/net/iputils/patches/011-ping6_use_gnu_source.patch new file mode 100644 index 0000000..dc61b8c --- /dev/null +++ b/net/iputils/patches/011-ping6_use_gnu_source.patch @@ -0,0 +1,11 @@ +--- a/ping6.c ++++ b/ping6.c +@@ -66,6 +66,8 @@ char copyright[] = + * More statistics could always be gathered. + * This program has to run SUID to ROOT to access the ICMP socket. + */ ++ ++#define _GNU_SOURCE + #include "ping_common.h" + + #include diff --git a/net/irssi-glib1/Makefile b/net/irssi-glib1/Makefile new file mode 100644 index 0000000..9752fe6 --- /dev/null +++ b/net/irssi-glib1/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2006-2009 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:=irssi-glib1 +PKG_VERSION:=0.8.10 +PKG_RELEASE:=3 + +PKG_SOURCE:=irssi-$(PKG_VERSION)a.tar.bz2 +PKG_SOURCE_URL:=http://irssi.org/files/ +PKG_MD5SUM:=38e616bccb6a34ff6d91690317c2fa19 + +PKG_BUILD_DIR:=$(BUILD_DIR)/irssi-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/irssi-glib1 + SUBMENU:=Instant Messaging + SECTION:=net + CATEGORY:=Network + DEPENDS:=+glib1 +libncurses + TITLE:=glib1 console irc client + URL:=http://irssi.org/ +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --with-perl=no \ + --with-glib1 \ + --with-glib-prefix="$(STAGING_DIR)/usr" \ + --with-textui \ + --without-terminfo \ + --without-bot \ + --without-file-offset-size \ + --without-ssl \ + --disable-ssl \ + --disable-proxy \ + ) +endef + +define Package/irssi-glib1/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/fe-text/irssi $(1)/usr/bin/irssi-glib1 +endef + +$(eval $(call BuildPackage,irssi-glib1)) diff --git a/net/irssi-glib1/patches/100-cross_compiling_fix.patch b/net/irssi-glib1/patches/100-cross_compiling_fix.patch new file mode 100644 index 0000000..17a60f3 --- /dev/null +++ b/net/irssi-glib1/patches/100-cross_compiling_fix.patch @@ -0,0 +1,61 @@ +--- a/configure ++++ b/configure +@@ -21848,13 +21848,6 @@ _ACEOF + + echo "$as_me:$LINENO: checking size of off_t" >&5 + echo $ECHO_N "checking size of off_t... $ECHO_C" >&6 +-if test "$cross_compiling" = yes; then +- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&5 +-echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } +-else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -21872,35 +21865,8 @@ cat >>conftest.$ac_ext <<_ACEOF + } + + _ACEOF +-rm -f conftest$ac_exeext +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- +- sizeof_off_t=`cat conftestval` +- rm -f conftestval +- +-else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +- +- { { echo "$as_me:$LINENO: error: Unsupported off_t size" >&5 +-echo "$as_me: error: Unsupported off_t size" >&2;} +- { (exit 1); exit 1; }; } +- +-fi ++ sizeof_off_t=8 + rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi + echo "$as_me:$LINENO: result: $sizeof_off_t" >&5 + echo "${ECHO_T}$sizeof_off_t" >&6 + +@@ -22905,6 +22871,7 @@ _ACEOF + echo "*** you can just unpack it to Irssi's source directory and" + echo "*** Irssi will automatically compile and use it." + echo ++ exit 1 + + glib_url=ftp://ftp.gtk.org/pub/gtk/v2.8/ + glib_file=glib-2.8.3.tar.gz diff --git a/net/irssi/Makefile b/net/irssi/Makefile new file mode 100644 index 0000000..fee6d6f --- /dev/null +++ b/net/irssi/Makefile @@ -0,0 +1,98 @@ +# +# Copyright (C) 2006-2011 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:=irssi +PKG_VERSION:=0.8.15 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://irssi.org/files/ +PKG_MD5SUM:=1dcb3f511b88df94b0c996f36668c7da + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/irssi/Default + SUBMENU:=Instant Messaging + SECTION:=net + CATEGORY:=Network + DEPENDS:=+glib2 +libncurses +libpthread + TITLE:=Console IRC client + MAINTAINER:=Peter Wagner + URL:=http://irssi.org/ +endef + +define Package/irssi/Default/description + Irssi is a terminal based IRC client for UNIX systems. +endef + +define Package/irssi +$(call Package/irssi/Default) + TITLE+= (with OpenSSL support) + DEPENDS+= +libopenssl + VARIANT:=ssl +endef + +define Package/irssi/description +$(call Package/irssi/Default/description) + This package is built with OpenSSL support. +endef + +define Package/irssi-nossl +$(call Package/irssi/Default) + TITLE+= (without OpenSSL support) + VARIANT:=nossl +endef + +define Package/irssi-nossl/description +$(call Package/irssi/Default/description) + This package is built without OpenSSL support. +endef + +CONFIGURE_ARGS += \ + --with-perl=no \ + --with-glib-prefix="$(STAGING_DIR)/usr" \ + --with-textui \ + --without-terminfo \ + --without-bot \ + --disable-proxy + +EXTRA_CFLAGS+=$(TARGET_CPPFLAGS) +EXTRA_LDFLAGS+=-lncurses + +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS += \ + --with-ssl="$(STAGING_DIR)/usr" +endif + +ifeq ($(BUILD_VARIANT),nossl) + CONFIGURE_ARGS += \ + --without-ssl \ + --disable-ssl +endif + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/irssi + $(CP) $(PKG_INSTALL_DIR)/usr/include/irssi/* $(1)/usr/include/irssi/ +endef + +define Package/irssi/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/$(PKG_NAME) +endef + +Package/irssi-nossl/install = $(Package/irssi/install) + +$(eval $(call BuildPackage,irssi)) +$(eval $(call BuildPackage,irssi-nossl)) diff --git a/net/isakmpd/Makefile b/net/isakmpd/Makefile new file mode 100644 index 0000000..9301e9a --- /dev/null +++ b/net/isakmpd/Makefile @@ -0,0 +1,51 @@ +# +# 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:=isakmpd +PKG_VERSION:=20041012 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/i/isakmpd/ +PKG_MD5SUM:=e6d25a9e232fb186e1a48dc06453bd57 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).orig + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/kernel.mk + +define Package/isakmpd + SECTION:=net + CATEGORY:=Network + SUBMENU:=VPN + DEPENDS:=+libopenssl +keynote +libgmp + TITLE:=IPsec management tools + URL:=http://isakmpd.sourceforge.net/ +endef + +define Build/Compile + CFLAGS="$(TARGET_CFLAGS)" \ + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + LINUX_DIR="$(LINUX_DIR)" \ + EXTRA_CPPFLAGS="$(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/openssl -I$(STAGING_DIR)/usr/include/keynote" \ + EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" + + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + INSTALL="install -c" \ + install-bin +endef + +define Package/isakmpd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/* $(1)/ +endef + +$(eval $(call BuildPackage,isakmpd)) diff --git a/net/isakmpd/patches/010-debian_3.patch b/net/isakmpd/patches/010-debian_3.patch new file mode 100644 index 0000000..0f50cf9 --- /dev/null +++ b/net/isakmpd/patches/010-debian_3.patch @@ -0,0 +1,1753 @@ +Index: isakmpd-20041012.orig/dpd.c +=================================================================== +--- isakmpd-20041012.orig.orig/dpd.c 2007-06-04 13:22:39.088912864 +0200 ++++ isakmpd-20041012.orig/dpd.c 2007-06-04 13:22:39.282883376 +0200 +@@ -26,6 +26,7 @@ + + #include + #include ++#include + + #include "sysdep.h" + +@@ -174,6 +175,7 @@ + } + break; + default: ++ ; + } + + /* Mark handled. */ +@@ -223,6 +225,7 @@ + dpd_check_event, sa, &tv); + break; + default: ++ ; + } + if (!sa->dpd_event) + log_print("dpd_timer_reset: timer_add_event failed"); +Index: isakmpd-20041012.orig/ipsec.c +=================================================================== +--- isakmpd-20041012.orig.orig/ipsec.c 2007-06-04 13:22:39.093912104 +0200 ++++ isakmpd-20041012.orig/ipsec.c 2007-06-04 13:22:39.283883224 +0200 +@@ -1020,6 +1020,52 @@ + } + } + ++/* ++ * deal with a NOTIFY of INVALID_SPI ++ */ ++static void ++ipsec_invalid_spi (struct message *msg, struct payload *p) ++{ ++ struct sockaddr *dst; ++ int invspisz, off; ++ u_int32_t spi; ++ u_int16_t totsiz; ++ u_int8_t spisz; ++ ++ /* Any notification that make us do something should be protected */ ++ if(!TAILQ_FIRST (&msg->payload[ISAKMP_PAYLOAD_HASH])) ++ { ++ LOG_DBG ((LOG_SA, 40, ++ "ipsec_invalid_spi: missing HASH payload in INVALID_SPI" ++ " notification")); ++ return; ++ } ++ ++ /* ++ * get the invalid spi out of the variable sized notification data ++ * field, which is after the variable sized SPI field [which specifies ++ * the receiving entity's phase-1 SPI, not the invalid spi] ++ */ ++ totsiz = GET_ISAKMP_GEN_LENGTH (p->p); ++ spisz = GET_ISAKMP_NOTIFY_SPI_SZ (p->p); ++ off = ISAKMP_NOTIFY_SPI_OFF + spisz; ++ invspisz = totsiz - off; ++ ++ if (invspisz != sizeof spi) ++ { ++ LOG_DBG ((LOG_SA, 40, ++ "ipsec_invalid_spi: SPI size %d in INVALID_SPI " ++ "payload unsupported", spisz)); ++ return; ++ } ++ memcpy (&spi, p->p + off, sizeof spi); ++ ++ msg->transport->vtbl->get_dst (msg->transport, &dst); ++ ++ /* delete matching SPI's from this peer */ ++ ipsec_delete_spi_list (dst, 0, (u_int8_t *)&spi, 1, "INVALID_SPI"); ++} ++ + static int + ipsec_responder(struct message *msg) + { +@@ -1205,7 +1251,9 @@ + return dv != IPSEC_ENCAP_TUNNEL + && dv != IPSEC_ENCAP_TRANSPORT + && dv != IPSEC_ENCAP_UDP_ENCAP_TUNNEL +- && dv != IPSEC_ENCAP_UDP_ENCAP_TRANSPORT; ++ && dv != IPSEC_ENCAP_UDP_ENCAP_TRANSPORT ++ && dv != IPSEC_ENCAP_UDP_ENCAP_TUNNEL_DRAFT ++ && dv != IPSEC_ENCAP_UDP_ENCAP_TRANSPORT_DRAFT; + #else + return dv < IPSEC_ENCAP_TUNNEL + || dv > IPSEC_ENCAP_TRANSPORT; +@@ -1837,7 +1885,7 @@ + ipsec_get_id(char *section, int *id, struct sockaddr **addr, + struct sockaddr **mask, u_int8_t *tproto, u_int16_t *port) + { +- char *type, *address, *netmask; ++ char *type, *address, *netmask; + + type = conf_get_str(section, "ID-type"); + if (!type) { +Index: isakmpd-20041012.orig/GNUmakefile +=================================================================== +--- isakmpd-20041012.orig.orig/GNUmakefile 2007-06-04 13:22:39.099911192 +0200 ++++ isakmpd-20041012.orig/GNUmakefile 2007-06-04 13:22:39.283883224 +0200 +@@ -40,12 +40,12 @@ + # integrated, freebsd/netbsd means FreeBSD/NetBSD with KAME IPsec. + # darwin means MacOS X 10.2 and later with KAME IPsec. linux means Linux-2.5 + # and later with native IPSec support. +-OS= openbsd ++#OS= openbsd + #OS= netbsd + #OS= freebsd + #OS= freeswan + #OS= darwin +-#OS= linux ++OS= linux + + .CURDIR:= $(shell pwd) + VPATH= ${.CURDIR}/sysdep/${OS} +@@ -55,9 +55,10 @@ + ifndef BINDIR + BINDIR= /sbin + endif +-ifndef LDSTATIC +-LDSTATIC= -static +-endif ++ ++#ifndef LDSTATIC ++#LDSTATIC= -static ++#endif + + SRCS= app.c attribute.c cert.c connection.c \ + constants.c conf.c cookie.c crypto.c dh.c doi.c exchange.c \ +@@ -131,11 +132,14 @@ + ifneq ($(findstring install,$(MAKECMDGOALS)),install) + # Skip 'regress' until the regress/ structure has gmake makefiles for it. + #SUBDIR:= regress +-SUBDIR:= ++#SUBDIR:= apps/certpatch + mksubdirs: + $(foreach DIR, ${SUBDIR}, \ +- cd ${DIR}; ${MAKE} ${MAKEFLAGS} CFLAGS="${CFLAGS}" \ +- MKDEP="${MKDEP}" ${MAKECMDGOALS}) ++ cd ${.CURDIR}/${DIR}; ${MAKE} ${MAKECMDGOALS};) ++ ++# $(foreach DIR, ${SUBDIR}, \ ++# cd ${DIR}; ${MAKE} CFLAGS="${CFLAGS}" \ ++# MKDEP="${MKDEP}" ${MAKECMDGOALS}) + else + mksubdirs: + endif +@@ -173,7 +177,7 @@ + endif + + SRCS+= ${IPSEC_SRCS} ${X509} ${POLICY} ${EC} ${AGGRESSIVE} ${DNSSEC} \ +- $(ISAKMP_CFG) ++ $(ISAKMP_CFG) ${DPD} ${NAT_TRAVERSAL} + CFLAGS+= ${IPSEC_CFLAGS} + LDADD+= ${DESLIB} + DPADD+= ${DESLIBDEP} +Index: isakmpd-20041012.orig/exchange.h +=================================================================== +--- isakmpd-20041012.orig.orig/exchange.h 2007-06-04 13:22:39.104910432 +0200 ++++ isakmpd-20041012.orig/exchange.h 2007-06-04 13:22:39.283883224 +0200 +@@ -221,6 +221,8 @@ + #define EXCHANGE_FLAG_NAT_T_ENABLE 0x10 /* We are doing NAT-T. */ + #define EXCHANGE_FLAG_NAT_T_KEEPALIVE 0x20 /* We are the NAT:ed peer. */ + #define EXCHANGE_FLAG_DPD_CAP_PEER 0x40 /* Peer is DPD capable. */ ++#define EXCHANGE_FLAG_NAT_T_RFC 0x0080 /* Peer does RFC NAT-T. */ ++#define EXCHANGE_FLAG_NAT_T_DRAFT 0x0100 /* Peer does draft NAT-T.*/ + + extern int exchange_add_certs(struct message *); + extern void exchange_finalize(struct message *); +Index: isakmpd-20041012.orig/log.c +=================================================================== +--- isakmpd-20041012.orig.orig/log.c 2007-06-04 13:22:39.110909520 +0200 ++++ isakmpd-20041012.orig/log.c 2007-06-04 13:22:39.284883072 +0200 +@@ -79,7 +79,6 @@ + + struct packhdr { + struct pcap_pkthdr pcap;/* pcap file packet header */ +- u_int32_t sa_family; /* address family */ + union { + struct ip ip4; /* IPv4 header (w/o options) */ + struct ip6_hdr ip6; /* IPv6 header */ +@@ -97,7 +96,7 @@ + static u_int8_t *packet_buf = NULL; + + static int udp_cksum(struct packhdr *, const struct udphdr *, +- u_int16_t *); ++ u_int16_t *, int); + static u_int16_t in_cksum(const u_int16_t *, int); + #endif /* USE_DEBUG */ + +@@ -539,11 +538,9 @@ + udp.uh_ulen = htons(datalen); + + /* ip */ +- hdr.sa_family = htonl(src->sa_family); + switch (src->sa_family) { + default: + /* Assume IPv4. XXX Can 'default' ever happen here? */ +- hdr.sa_family = htonl(AF_INET); + hdr.ip.ip4.ip_src.s_addr = 0x02020202; + hdr.ip.ip4.ip_dst.s_addr = 0x01010101; + /* The rest of the setup is common to AF_INET. */ +@@ -584,9 +581,7 @@ + } + + /* Calculate UDP checksum. */ +- udp.uh_sum = udp_cksum(&hdr, &udp, (u_int16_t *) packet_buf); +- hdrlen += sizeof hdr.sa_family; +- ++ udp.uh_sum = udp_cksum(&hdr, &udp, (u_int16_t *) packet_buf, src->sa_family); + /* pcap file packet header */ + gettimeofday(&tv, 0); + hdr.pcap.ts.tv_sec = tv.tv_sec; +@@ -610,7 +605,7 @@ + + /* Copied from tcpdump/print-udp.c, mostly rewritten. */ + static int +-udp_cksum(struct packhdr *hdr, const struct udphdr *u, u_int16_t *d) ++udp_cksum(struct packhdr *hdr, const struct udphdr *u, u_int16_t *d, int af) + { + struct ip *ip4; + struct ip6_hdr *ip6; +@@ -639,7 +634,7 @@ + + /* Setup pseudoheader. */ + memset(phu.pa, 0, sizeof phu); +- switch (ntohl(hdr->sa_family)) { ++ switch (af) { + case AF_INET: + ip4 = &hdr->ip.ip4; + memcpy(&phu.ip4p.src, &ip4->ip_src, sizeof(struct in_addr)); +@@ -664,7 +659,7 @@ + + /* IPv6 wants a 0xFFFF checksum "on error", not 0x0. */ + if (tlen < 0) +- return (ntohl(hdr->sa_family) == AF_INET ? 0 : 0xFFFF); ++ return (af == AF_INET ? 0 : 0xFFFF); + + sum = 0; + for (i = 0; i < hdrlen; i += 2) +Index: isakmpd-20041012.orig/nat_traversal.c +=================================================================== +--- isakmpd-20041012.orig.orig/nat_traversal.c 2007-06-04 13:22:39.115908760 +0200 ++++ isakmpd-20041012.orig/nat_traversal.c 2007-06-04 13:22:39.284883072 +0200 +@@ -1,4 +1,4 @@ +-/* $OpenBSD: nat_traversal.c,v 1.7 2004/08/08 19:11:06 deraadt Exp $ */ ++/* $OpenBSD: nat_traversal.c,v 1.17 2006/06/14 14:03:33 hshoexer Exp $ */ + + /* + * Copyright (c) 2004 Håkan Olsson. All rights reserved. +@@ -48,40 +48,40 @@ + #include "util.h" + #include "virtual.h" + ++int disable_nat_t = 0; ++ + /* +- * XXX According to draft-ietf-ipsec-nat-t-ike-07.txt, the NAT-T +- * capability of the other peer is determined by a particular vendor ID +- * sent as the first message. This vendor ID string is supposed to be a +- * MD5 hash of "RFC XXXX", where XXXX is the future RFC number. ++ * NAT-T capability of the other peer is determined by a particular vendor ++ * ID sent in the first message. This vendor ID string is supposed to be a ++ * MD5 hash of "RFC 3947". + * + * These seem to be the "well" known variants of this string in use by + * products today. + */ +-static const char *isakmp_nat_t_cap_text[] = { +- "draft-ietf-ipsec-nat-t-ike-00", /* V1 (XXX: may be obsolete) */ +- "draft-ietf-ipsec-nat-t-ike-02\n", /* V2 */ +- "draft-ietf-ipsec-nat-t-ike-03", /* V3 */ +-#ifdef notyet +- "RFC XXXX", +-#endif ++ ++static struct nat_t_cap isakmp_nat_t_cap[] = { ++ { VID_DRAFT_V2_N, EXCHANGE_FLAG_NAT_T_DRAFT, ++ "draft-ietf-ipsec-nat-t-ike-02\n", NULL, 0 }, ++ { VID_DRAFT_V3, EXCHANGE_FLAG_NAT_T_DRAFT, ++ "draft-ietf-ipsec-nat-t-ike-03", NULL, 0 }, ++ { VID_RFC3947, EXCHANGE_FLAG_NAT_T_RFC, ++ "RFC 3947", NULL, 0 }, + }; + ++#define NUMNATTCAP (sizeof isakmp_nat_t_cap / sizeof isakmp_nat_t_cap[0]) ++ + /* In seconds. Recommended in draft-ietf-ipsec-udp-encaps-09. */ + #define NAT_T_KEEPALIVE_INTERVAL 20 + +-/* The MD5 hashes of the above strings is put in this array. */ +-static char **nat_t_hashes; +-static size_t nat_t_hashsize; +- + static int nat_t_setup_hashes(void); +-static int nat_t_add_vendor_payload(struct message *, char *); ++static int nat_t_add_vendor_payload(struct message *, struct nat_t_cap *); + static int nat_t_add_nat_d(struct message *, struct sockaddr *); + static int nat_t_match_nat_d_payload(struct message *, struct sockaddr *); + + void + nat_t_init(void) + { +- nat_t_hashes = (char **)NULL; ++ nat_t_setup_hashes(); + } + + /* Generate the NAT-T capability marker hashes. Executed only once. */ +@@ -89,7 +89,7 @@ + nat_t_setup_hashes(void) + { + struct hash *hash; +- int n = sizeof isakmp_nat_t_cap_text / sizeof isakmp_nat_t_cap_text[0]; ++ int n = NUMNATTCAP; + int i; + + /* The draft says to use MD5. */ +@@ -100,56 +100,49 @@ + "could not find MD5 hash structure!"); + return -1; + } +- nat_t_hashsize = hash->hashsize; + +- /* Allocate one more than is necessary, i.e NULL terminated. */ +- nat_t_hashes = (char **)calloc((size_t)(n + 1), sizeof(char *)); +- if (!nat_t_hashes) { +- log_error("nat_t_setup_hashes: calloc (%lu,%lu) failed", +- (unsigned long)n, (unsigned long)sizeof(char *)); +- return -1; +- } +- +- /* Populate with hashes. */ ++ /* Populate isakmp_nat_t_cap with hashes. */ + for (i = 0; i < n; i++) { +- nat_t_hashes[i] = (char *)malloc(nat_t_hashsize); +- if (!nat_t_hashes[i]) { ++ isakmp_nat_t_cap[i].hashsize = hash->hashsize; ++ isakmp_nat_t_cap[i].hash = (char *)malloc(hash->hashsize); ++ if (!isakmp_nat_t_cap[i].hash) { + log_error("nat_t_setup_hashes: malloc (%lu) failed", +- (unsigned long)nat_t_hashsize); ++ (unsigned long)hash->hashsize); + goto errout; + } + + hash->Init(hash->ctx); + hash->Update(hash->ctx, +- (unsigned char *)isakmp_nat_t_cap_text[i], +- strlen(isakmp_nat_t_cap_text[i])); +- hash->Final(nat_t_hashes[i], hash->ctx); ++ (unsigned char *)isakmp_nat_t_cap[i].text, ++ strlen(isakmp_nat_t_cap[i].text)); ++ hash->Final(isakmp_nat_t_cap[i].hash, hash->ctx); + + LOG_DBG((LOG_EXCHANGE, 50, "nat_t_setup_hashes: " +- "MD5(\"%s\") (%lu bytes)", isakmp_nat_t_cap_text[i], +- (unsigned long)nat_t_hashsize)); ++ "MD5(\"%s\") (%lu bytes)", isakmp_nat_t_cap[i].text, ++ (unsigned long)hash->hashsize)); + LOG_DBG_BUF((LOG_EXCHANGE, 50, "nat_t_setup_hashes", +- nat_t_hashes[i], nat_t_hashsize)); ++ isakmp_nat_t_cap[i].hash, hash->hashsize)); + } + + return 0; + +- errout: ++errout: + for (i = 0; i < n; i++) +- if (nat_t_hashes[i]) +- free(nat_t_hashes[i]); +- free(nat_t_hashes); +- nat_t_hashes = NULL; ++ if (isakmp_nat_t_cap[i].hash) ++ free(isakmp_nat_t_cap[i].hash); + return -1; + } + + /* Add one NAT-T VENDOR payload. */ + static int +-nat_t_add_vendor_payload(struct message *msg, char *hash) ++nat_t_add_vendor_payload(struct message *msg, struct nat_t_cap *cap) + { +- size_t buflen = nat_t_hashsize + ISAKMP_GEN_SZ; ++ size_t buflen = cap->hashsize + ISAKMP_GEN_SZ; + u_int8_t *buf; + ++ if (disable_nat_t) ++ return 0; ++ + buf = malloc(buflen); + if (!buf) { + log_error("nat_t_add_vendor_payload: malloc (%lu) failed", +@@ -158,12 +151,11 @@ + } + + SET_ISAKMP_GEN_LENGTH(buf, buflen); +- memcpy(buf + ISAKMP_VENDOR_ID_OFF, hash, nat_t_hashsize); ++ memcpy(buf + ISAKMP_VENDOR_ID_OFF, cap->hash, cap->hashsize); + if (message_add_payload(msg, ISAKMP_PAYLOAD_VENDOR, buf, buflen, 1)) { + free(buf); + return -1; + } +- + return 0; + } + +@@ -171,16 +163,14 @@ + int + nat_t_add_vendor_payloads(struct message *msg) + { +- int i = 0; ++ int i; + +- if (!nat_t_hashes) +- if (nat_t_setup_hashes()) +- return 0; /* XXX should this be an error? */ ++ if (disable_nat_t) ++ return 0; + +- while (nat_t_hashes[i]) +- if (nat_t_add_vendor_payload(msg, nat_t_hashes[i++])) ++ for (i = 0; i < NUMNATTCAP; i++) ++ if (nat_t_add_vendor_payload(msg, &isakmp_nat_t_cap[i])) + return -1; +- + return 0; + } + +@@ -192,36 +182,31 @@ + { + u_int8_t *pbuf = p->p; + size_t vlen; +- int i = 0; ++ int i; + +- /* Already checked? */ +- if (p->flags & PL_MARK || +- msg->exchange->flags & EXCHANGE_FLAG_NAT_T_CAP_PEER) ++ if (disable_nat_t) + return; + +- if (!nat_t_hashes) +- if (nat_t_setup_hashes()) +- return; +- + vlen = GET_ISAKMP_GEN_LENGTH(pbuf) - ISAKMP_GEN_SZ; +- if (vlen != nat_t_hashsize) { +- LOG_DBG((LOG_EXCHANGE, 50, "nat_t_check_vendor_payload: " +- "bad size %lu != %lu", (unsigned long)vlen, +- (unsigned long)nat_t_hashsize)); +- return; +- } + +- while (nat_t_hashes[i]) +- if (memcmp(nat_t_hashes[i++], pbuf + ISAKMP_GEN_SZ, ++ for (i = 0; i < NUMNATTCAP; i++) { ++ if (vlen != isakmp_nat_t_cap[i].hashsize) { ++ LOG_DBG((LOG_EXCHANGE, 50, "nat_t_check_vendor_payload: " ++ "bad size %lu != %lu", (unsigned long)vlen, ++ (unsigned long)isakmp_nat_t_cap[i].hashsize)); ++ continue; ++ } ++ if (memcmp(isakmp_nat_t_cap[i].hash, pbuf + ISAKMP_GEN_SZ, + vlen) == 0) { + /* This peer is NAT-T capable. */ + msg->exchange->flags |= EXCHANGE_FLAG_NAT_T_CAP_PEER; ++ msg->exchange->flags |= isakmp_nat_t_cap[i].flags; + LOG_DBG((LOG_EXCHANGE, 10, + "nat_t_check_vendor_payload: " + "NAT-T capable peer detected")); + p->flags |= PL_MARK; +- return; + } ++ } + + return; + } +@@ -233,10 +218,8 @@ + { + struct ipsec_exch *ie = (struct ipsec_exch *)msg->exchange->data; + struct hash *hash; +- struct prf *prf; + u_int8_t *res; + in_port_t port; +- int prf_type = PRF_HMAC; /* XXX */ + + hash = hash_get(ie->hash->type); + if (hash == NULL) { +@@ -244,31 +227,25 @@ + return NULL; + } + +- prf = prf_alloc(prf_type, hash->type, msg->exchange->cookies, +- ISAKMP_HDR_COOKIES_LEN); +- if(!prf) { +- log_print("nat_t_generate_nat_d_hash: prf_alloc failed"); +- return NULL; +- } ++ *hashlen = hash->hashsize; + +- *hashlen = prf->blocksize; + res = (u_int8_t *)malloc((unsigned long)*hashlen); + if (!res) { + log_print("nat_t_generate_nat_d_hash: malloc (%lu) failed", + (unsigned long)*hashlen); +- prf_free(prf); + *hashlen = 0; + return NULL; + } + + port = sockaddr_port(sa); +- memset(res, 0, *hashlen); +- +- prf->Update(prf->prfctx, sockaddr_addrdata(sa), sockaddr_addrlen(sa)); +- prf->Update(prf->prfctx, (unsigned char *)&port, sizeof port); +- prf->Final(res, prf->prfctx); +- prf_free (prf); ++ bzero(res, *hashlen); + ++ hash->Init(hash->ctx); ++ hash->Update(hash->ctx, msg->exchange->cookies, ++ sizeof msg->exchange->cookies); ++ hash->Update(hash->ctx, sockaddr_addrdata(sa), sockaddr_addrlen(sa)); ++ hash->Update(hash->ctx, (unsigned char *)&port, sizeof port); ++ hash->Final(res, hash->ctx); + return res; + } + +@@ -276,6 +253,7 @@ + static int + nat_t_add_nat_d(struct message *msg, struct sockaddr *sa) + { ++ int ret; + u_int8_t *hbuf, *buf; + size_t hbuflen, buflen; + +@@ -298,11 +276,19 @@ + memcpy(buf + ISAKMP_NAT_D_DATA_OFF, hbuf, hbuflen); + free(hbuf); + +- if (message_add_payload(msg, ISAKMP_PAYLOAD_NAT_D, buf, buflen, 1)) { ++ if (msg->exchange->flags & EXCHANGE_FLAG_NAT_T_RFC) ++ ret = message_add_payload(msg, ISAKMP_PAYLOAD_NAT_D, buf, ++ buflen, 1); ++ else if (msg->exchange->flags & EXCHANGE_FLAG_NAT_T_DRAFT) ++ ret = message_add_payload(msg, ISAKMP_PAYLOAD_NAT_D_DRAFT, ++ buf, buflen, 1); ++ else ++ ret = -1; ++ ++ if (ret) { + free(buf); + return -1; + } +- + return 0; + } + +@@ -312,14 +298,14 @@ + { + struct sockaddr *sa; + +- msg->transport->vtbl->get_src(msg->transport, &sa); ++ /* Remote address first. */ ++ msg->transport->vtbl->get_dst(msg->transport, &sa); + if (nat_t_add_nat_d(msg, sa)) + return -1; + +- msg->transport->vtbl->get_dst(msg->transport, &sa); ++ msg->transport->vtbl->get_src(msg->transport, &sa); + if (nat_t_add_nat_d(msg, sa)) + return -1; +- + return 0; + } + +@@ -336,8 +322,8 @@ + * If there are no NAT-D payloads in the message, return "found" + * as this will avoid NAT-T (see nat_t_exchange_check_nat_d()). + */ +- p = payload_first(msg, ISAKMP_PAYLOAD_NAT_D); +- if (!p) ++ if ((p = payload_first(msg, ISAKMP_PAYLOAD_NAT_D_DRAFT)) == NULL && ++ (p = payload_first(msg, ISAKMP_PAYLOAD_NAT_D)) == NULL) + return 1; + + hbuf = nat_t_generate_nat_d_hash(msg, sa, &hbuflen); +Index: isakmpd-20041012.orig/udp_encap.c +=================================================================== +--- isakmpd-20041012.orig.orig/udp_encap.c 2007-06-04 13:22:39.121907848 +0200 ++++ isakmpd-20041012.orig/udp_encap.c 2007-06-04 13:22:39.284883072 +0200 +@@ -61,6 +61,11 @@ + + #define UDP_SIZE 65536 + ++#if defined(USE_NAT_TRAVERSAL) && defined (LINUX_IPSEC) ++#include ++#include ++#endif ++ + /* If a system doesn't have SO_REUSEPORT, SO_REUSEADDR will have to do. */ + #ifndef SO_REUSEPORT + #define SO_REUSEPORT SO_REUSEADDR +@@ -134,6 +139,18 @@ + if (sysdep_cleartext(s, laddr->sa_family) == -1) + goto err; + ++#if defined(USE_NAT_TRAVERSAL) && defined (LINUX_IPSEC) ++ { ++#ifndef SOL_UDP ++#define SOL_UDP 17 ++#endif ++ int option = UDP_ENCAP_ESPINUDP; ++ if(setsockopt(s, SOL_UDP, UDP_ENCAP, &option, ++ sizeof (option)) < 0) ++ goto err; ++ } ++#endif ++ + /* Wildcard address ? */ + switch (laddr->sa_family) { + case AF_INET: +Index: isakmpd-20041012.orig/apps/Makefile +=================================================================== +--- isakmpd-20041012.orig.orig/apps/Makefile 2007-06-04 13:22:39.126907088 +0200 ++++ isakmpd-20041012.orig/apps/Makefile 2007-06-04 13:22:39.285882920 +0200 +@@ -31,4 +31,4 @@ + + SUBDIR= certpatch + +-.include ++#.include +Index: isakmpd-20041012.orig/apps/certpatch/GNUmakefile +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ isakmpd-20041012.orig/apps/certpatch/GNUmakefile 2007-06-04 13:22:39.285882920 +0200 +@@ -0,0 +1,55 @@ ++# $OpenBSD: Makefile,v 1.7 2003/06/03 14:35:00 ho Exp $ ++# $EOM: Makefile,v 1.6 2000/03/28 21:22:06 ho Exp $ ++ ++# ++# Copyright (c) 1999 Niels Provos. All rights reserved. ++# Copyright (c) 2001 Niklas Hallqvist. All rights reserved. ++# ++# Redistribution and use in source and binary forms, with or without ++# modification, are permitted provided that the following conditions ++# are met: ++# 1. Redistributions of source code must retain the above copyright ++# notice, this list of conditions and the following disclaimer. ++# 2. Redistributions in binary form must reproduce the above copyright ++# notice, this list of conditions and the following disclaimer in the ++# documentation and/or other materials provided with the distribution. ++# ++# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++# ++ ++# ++# This code was written under funding by Ericsson Radio Systems. ++# ++ ++PROG= certpatch ++SRCS= certpatch.c ++BINDIR?= /usr/sbin ++TOPSRC= ${.CURDIR}../.. ++TOPOBJ!= cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f- ++OS= linux ++FEATURES!= awk '/^FEATURES=/ { print $$0 }' ${.CURDIR}/../../Makefile | sed 's/FEATURES=.//' ++.PATH: ${TOPSRC} ${TOPSRC}/sysdep/${OS} ${TOPOBJ} ++CFLAGS+= -I${TOPSRC} -I${TOPSRC}/sysdep/${OS} -I${TOPOBJ} -Wall ++LDFLAGS+= -lcrypto -lssl -lgmp ++MAN= certpatch.8 ++ ++CFLAGS+= -DMP_FLAVOUR=MP_FLAVOUR_GMP ++LDADD+= -lgmp ++DPADD+= ${LIBGMP} ++ ++# Override LIBSYSDEPDIR definition from Makefile.sysdep ++LIBSYSDEPDIR= ${TOPSRC}/sysdep/common/libsysdep ++ ++all: ${PROG} ++ ++clean: ++ rm -f ${PROG} +Index: isakmpd-20041012.orig/pf_key_v2.c +=================================================================== +--- isakmpd-20041012.orig.orig/pf_key_v2.c 2007-06-04 13:22:39.137905416 +0200 ++++ isakmpd-20041012.orig/pf_key_v2.c 2007-06-04 13:22:39.287882616 +0200 +@@ -1055,6 +1055,10 @@ + #endif + #if defined (USE_NAT_TRAVERSAL) && defined (SADB_X_EXT_UDPENCAP) + struct sadb_x_udpencap udpencap; ++#elif defined (USE_NAT_TRAVERSAL) && defined (SADB_X_EXT_NAT_T_TYPE) ++ struct sadb_x_nat_t_type nat_t_type; ++ struct sadb_x_nat_t_port nat_t_sport; ++ struct sadb_x_nat_t_port nat_t_dport; + #endif + #ifdef USE_DEBUG + char *addr_str; +@@ -1273,10 +1277,15 @@ + log_print("pf_key_v2_set_spi: invalid proto %d", proto->proto); + goto cleanup; + } +- if (incoming) ++ if (incoming) { + sa->transport->vtbl->get_src(sa->transport, &dst); +- else ++ sa->transport->vtbl->get_dst(sa->transport, &src); ++ } ++ else { + sa->transport->vtbl->get_dst(sa->transport, &dst); ++ sa->transport->vtbl->get_src(sa->transport, &src); ++ } ++ + #ifdef KAME + msg.sadb_msg_seq = (incoming ? + pf_key_v2_seq_by_sa(proto->spi[incoming], sizeof ssa.sadb_sa_spi, +@@ -1319,12 +1328,13 @@ + ssa.sadb_sa_flags = 0; + #ifdef SADB_X_SAFLAGS_TUNNEL + if (iproto->encap_mode == IPSEC_ENCAP_TUNNEL || +- iproto->encap_mode == IPSEC_ENCAP_UDP_ENCAP_TUNNEL) ++ iproto->encap_mode == IPSEC_ENCAP_UDP_ENCAP_TUNNEL || ++ iproto->encap_mode == IPSEC_ENCAP_UDP_ENCAP_TUNNEL_DRAFT) + ssa.sadb_sa_flags = SADB_X_SAFLAGS_TUNNEL; + #endif + +-#if defined (USE_NAT_TRAVERSAL) && defined (SADB_X_EXT_UDPENCAP) + if (isakmp_sa->flags & SA_FLAG_NAT_T_ENABLE) { ++#if defined (USE_NAT_TRAVERSAL) && defined (SADB_X_EXT_UDPENCAP) + memset(&udpencap, 0, sizeof udpencap); + ssa.sadb_sa_flags |= SADB_X_SAFLAGS_UDPENCAP; + udpencap.sadb_x_udpencap_exttype = SADB_X_EXT_UDPENCAP; +@@ -1334,8 +1344,40 @@ + if (pf_key_v2_msg_add(update, (struct sadb_ext *)&udpencap, 0) + == -1) + goto cleanup; +- } ++#elif defined (USE_NAT_TRAVERSAL) && defined (SADB_X_EXT_NAT_T_TYPE) ++#ifndef UDP_ENCAP_ESPINUDP ++#define UDP_ENCAP_ESPINUDP 2 ++#endif ++ memset(&nat_t_type, 0, sizeof nat_t_type); ++ memset(&nat_t_sport, 0, sizeof nat_t_sport); ++ memset(&nat_t_dport, 0, sizeof nat_t_dport); ++ ++ /* type = draft-udp-encap-06 */ ++ nat_t_type.sadb_x_nat_t_type_len = sizeof nat_t_type / PF_KEY_V2_CHUNK; ++ nat_t_type.sadb_x_nat_t_type_exttype = SADB_X_EXT_NAT_T_TYPE; ++ nat_t_type.sadb_x_nat_t_type_type = UDP_ENCAP_ESPINUDP; ++ if(pf_key_v2_msg_add(update, (struct sadb_ext *)&nat_t_type, 0) == -1) ++ goto cleanup; ++ ++ /* source port */ ++ nat_t_sport.sadb_x_nat_t_port_len = sizeof nat_t_sport / ++ PF_KEY_V2_CHUNK; ++ nat_t_sport.sadb_x_nat_t_port_exttype = SADB_X_EXT_NAT_T_SPORT; ++ nat_t_sport.sadb_x_nat_t_port_port = sockaddr_port(src); ++ if(pf_key_v2_msg_add(update, (struct sadb_ext *)&nat_t_sport, 0) == -1) ++ goto cleanup; ++ ++ /* destination port */ ++ nat_t_dport.sadb_x_nat_t_port_len = sizeof nat_t_dport / ++ PF_KEY_V2_CHUNK; ++ nat_t_dport.sadb_x_nat_t_port_exttype = SADB_X_EXT_NAT_T_DPORT; ++ nat_t_dport.sadb_x_nat_t_port_port = sockaddr_port(dst); ++ if(pf_key_v2_msg_add(update, (struct sadb_ext *)&nat_t_dport, 0) == -1) ++ goto cleanup; ++ ++ /* original address (transport mode checksum missing info) goes here */ + #endif ++ } + + if (pf_key_v2_msg_add(update, (struct sadb_ext *)&ssa, 0) == -1) + goto cleanup; +@@ -1395,10 +1437,6 @@ + /* + * Setup the ADDRESS extensions. + */ +- if (incoming) +- sa->transport->vtbl->get_dst(sa->transport, &src); +- else +- sa->transport->vtbl->get_src(sa->transport, &src); + len = sizeof *addr + PF_KEY_V2_ROUND(sysdep_sa_len(src)); + addr = calloc(1, len); + if (!addr) +@@ -2167,7 +2205,7 @@ + pf_key_v2_msg_free(ret); + return -1; + +-#elif defined (SADB_X_SPDADD) && defined (SADB_X_SPDDELETE) ++#elif defined (SADB_X_SPDUPDATE) && defined (SADB_X_SPDDELETE) + struct sadb_msg msg; + struct sadb_x_policy *policy = 0; + struct sadb_x_ipsecrequest *ipsecrequest; +@@ -2181,7 +2219,7 @@ + struct sockaddr_in *ip4_sa; + struct sockaddr_in6 *ip6_sa; + +- msg.sadb_msg_type = delete ? SADB_X_SPDDELETE : SADB_X_SPDADD; ++ msg.sadb_msg_type = delete ? SADB_X_SPDDELETE : SADB_X_SPDUPDATE; + msg.sadb_msg_satype = SADB_SATYPE_UNSPEC; + msg.sadb_msg_seq = 0; + flow = pf_key_v2_msg_new(&msg, 0); +Index: isakmpd-20041012.orig/isakmp_num.cst +=================================================================== +--- isakmpd-20041012.orig.orig/isakmp_num.cst 2007-06-04 13:22:39.143904504 +0200 ++++ isakmpd-20041012.orig/isakmp_num.cst 2007-06-04 13:22:39.287882616 +0200 +@@ -57,15 +57,18 @@ + KD 17 # RFC 3547, Key Download + SEQ 18 # RFC 3547, Sequence Number + POP 19 # RFC 3547, Proof of possession +- RESERVED_MIN 20 ++ NAT_D 20 # RFC 3947, NAT Discovery payload ++ NAT_OA 21 # RFC 3947, NAT Original Address payload ++ RESERVED_MIN 22 + RESERVED_MAX 127 + PRIVATE_MIN 128 + # XXX values from draft-ietf-ipsec-nat-t-ike-01,02,03. Later drafts specify + # XXX NAT_D as payload 15 and NAT_OA as 16, but these are allocated by RFC + # XXX 3547 as seen above. +- NAT_D 130 # NAT Discovery payload +- NAT_OA 131 # NAT Original Address payload ++ NAT_D_DRAFT 130 # NAT Discovery payload ++ NAT_OA_DRAFT 131 # NAT Original Address payload + PRIVATE_MAX 255 ++ MAX 255 + . + + # ISAKMP exchange types. +Index: isakmpd-20041012.orig/ipsec_num.cst +=================================================================== +--- isakmpd-20041012.orig.orig/ipsec_num.cst 2007-06-04 13:22:39.149903592 +0200 ++++ isakmpd-20041012.orig/ipsec_num.cst 2007-06-04 13:22:39.287882616 +0200 +@@ -62,10 +62,10 @@ + IPSEC_ENCAP + TUNNEL 1 + TRANSPORT 2 +- FUTURE_UDP_ENCAP_TUNNEL 3 # XXX Not yet assigned +- FUTURE_UDP_ENCAP_TRANSPORT 4 # XXX Not yet assigned +- UDP_ENCAP_TUNNEL 61443 # draft-ietf-ipsec-nat-t-ike +- UDP_ENCAP_TRANSPORT 61443 # draft-ietf-ipsec-nat-t-ike ++ UDP_ENCAP_TUNNEL 3 ++ UDP_ENCAP_TRANSPORT 4 ++ UDP_ENCAP_TUNNEL_DRAFT 61443 # draft-ietf-ipsec-nat-t-ike ++ UDP_ENCAP_TRANSPORT_DRAFT 61443 # draft-ietf-ipsec-nat-t-ike + . + + # IPSEC authentication algorithm. +Index: isakmpd-20041012.orig/nat_traversal.h +=================================================================== +--- isakmpd-20041012.orig.orig/nat_traversal.h 2007-06-04 13:22:39.154902832 +0200 ++++ isakmpd-20041012.orig/nat_traversal.h 2007-06-04 13:22:39.287882616 +0200 +@@ -1,4 +1,4 @@ +-/* $OpenBSD: nat_traversal.h,v 1.2 2004/06/21 23:27:10 ho Exp $ */ ++/* $OpenBSD: nat_traversal.h,v 1.4 2005/07/25 15:03:47 hshoexer Exp $ */ + + /* + * Copyright (c) 2004 Håkan Olsson. All rights reserved. +@@ -27,6 +27,24 @@ + #ifndef _NAT_TRAVERSAL_H_ + #define _NAT_TRAVERSAL_H_ + ++#define VID_DRAFT_V2 0 ++#define VID_DRAFT_V2_N 1 ++#define VID_DRAFT_V3 2 ++#define VID_RFC3947 3 ++ ++struct nat_t_cap { ++ int id; ++ u_int32_t flags; ++ const char *text; ++ char *hash; ++ size_t hashsize; ++}; ++ ++/* ++ * Set if -T is given on the command line to disable NAT-T support. ++ */ ++extern int disable_nat_t; ++ + void nat_t_init(void); + int nat_t_add_vendor_payloads(struct message *); + void nat_t_check_vendor_payload(struct message *, struct payload *); +Index: isakmpd-20041012.orig/message.c +=================================================================== +--- isakmpd-20041012.orig.orig/message.c 2007-06-04 13:22:39.160901920 +0200 ++++ isakmpd-20041012.orig/message.c 2007-06-04 13:22:39.288882464 +0200 +@@ -112,6 +112,7 @@ + message_validate_hash, message_validate_sig, message_validate_nonce, + message_validate_notify, message_validate_delete, + message_validate_vendor, message_validate_attribute, ++ message_validate_nat_d, message_validate_nat_oa, + message_validate_nat_d, message_validate_nat_oa + }; + +@@ -120,7 +121,7 @@ + isakmp_id_fld, isakmp_cert_fld, isakmp_certreq_fld, isakmp_hash_fld, + isakmp_sig_fld, isakmp_nonce_fld, isakmp_notify_fld, isakmp_delete_fld, + isakmp_vendor_fld, isakmp_attribute_fld, isakmp_nat_d_fld, +- isakmp_nat_oa_fld ++ isakmp_nat_oa_fld, isakmp_nat_d_fld, isakmp_nat_oa_fld + }; + + /* +@@ -138,7 +139,8 @@ + ISAKMP_PAYLOAD_SAK, ISAKMP_PAYLOAD_SAT, ISAKMP_PAYLOAD_KD, + ISAKMP_PAYLOAD_SEQ, ISAKMP_PAYLOAD_POP + #endif +- ISAKMP_PAYLOAD_NAT_D, ISAKMP_PAYLOAD_NAT_OA ++ ISAKMP_PAYLOAD_NAT_D, ISAKMP_PAYLOAD_NAT_OA, ++ ISAKMP_PAYLOAD_NAT_D_DRAFT, ISAKMP_PAYLOAD_NAT_OA_DRAFT + }; + + static u_int8_t payload_map[256]; +@@ -347,8 +349,8 @@ + } + /* Ignore most private payloads. */ + if (next >= ISAKMP_PAYLOAD_PRIVATE_MIN && +- next != ISAKMP_PAYLOAD_NAT_D && +- next != ISAKMP_PAYLOAD_NAT_OA) { ++ next != ISAKMP_PAYLOAD_NAT_D_DRAFT && ++ next != ISAKMP_PAYLOAD_NAT_OA_DRAFT) { + LOG_DBG((LOG_MESSAGE, 30, "message_parse_payloads: " + "private next payload type %s in payload of " + "type %d ignored", +@@ -460,8 +462,10 @@ + return ISAKMP_ATTRIBUTE_SZ; + #if defined (USE_NAT_TRAVERSAL) + case ISAKMP_PAYLOAD_NAT_D: ++ case ISAKMP_PAYLOAD_NAT_D_DRAFT: + return ISAKMP_NAT_D_SZ; + case ISAKMP_PAYLOAD_NAT_OA: ++ case ISAKMP_PAYLOAD_NAT_OA_DRAFT: + return ISAKMP_NAT_OA_SZ; + #endif + /* Not yet supported and any other unknown payloads. */ +Index: isakmpd-20041012.orig/policy.c +=================================================================== +--- isakmpd-20041012.orig.orig/policy.c 2007-06-04 13:22:39.165901160 +0200 ++++ isakmpd-20041012.orig/policy.c 2007-06-04 13:22:39.289882312 +0200 +@@ -511,7 +511,10 @@ + break; + } + #if defined (USE_NAT_TRAVERSAL) +- else if (decode_16(value) == IPSEC_ENCAP_UDP_ENCAP_TUNNEL) ++ else if (decode_16(value) == ++ IPSEC_ENCAP_UDP_ENCAP_TUNNEL || ++ decode_16(value) == ++ IPSEC_ENCAP_UDP_ENCAP_TUNNEL_DRAFT) + switch (proto->proto) { + case IPSEC_PROTO_IPSEC_AH: + ah_encapsulation = "udp-encap-tunnel"; +@@ -1932,7 +1935,7 @@ + void + policy_init(void) + { +- char *ptr, *policy_file; ++ char *ptr, *policy_file, *use_keynote; + char **asserts; + size_t sz, len; + int fd, i; +@@ -1940,10 +1943,11 @@ + LOG_DBG((LOG_POLICY, 30, "policy_init: initializing")); + + /* Do we want to use the policy modules? */ +- if (ignore_policy || +- strncmp("yes", conf_get_str("General", "Use-Keynote"), 3)) +- return; +- ++ use_keynote = conf_get_str("General", "Use-Keynote"); ++ if (ignore_policy || ++ (use_keynote && strncmp("yes", use_keynote, 3))) ++ return; ++ + /* Get policy file from configuration. */ + policy_file = conf_get_str("General", "Policy-file"); + if (!policy_file) +Index: isakmpd-20041012.orig/ike_phase_1.c +=================================================================== +--- isakmpd-20041012.orig.orig/ike_phase_1.c 2007-06-04 13:22:39.170900400 +0200 ++++ isakmpd-20041012.orig/ike_phase_1.c 2007-06-04 13:22:39.290882160 +0200 +@@ -1040,9 +1040,9 @@ + + /* Compare expected/desired and received remote ID */ + if (bcmp(rid, payload->p + ISAKMP_ID_DATA_OFF, sz)) { +- free(rid); + log_print("ike_phase_1_recv_ID: " +- "received remote ID other than expected %s", p); ++ "received remote ID other than expected %s - %s", p, payload->p); ++ free(rid); + return -1; + } + free(rid); +Index: isakmpd-20041012.orig/x509.c +=================================================================== +--- isakmpd-20041012.orig.orig/x509.c 2007-06-04 13:22:39.176899488 +0200 ++++ isakmpd-20041012.orig/x509.c 2007-06-04 13:22:39.290882160 +0200 +@@ -910,7 +910,11 @@ + X509_STORE_CTX_init(&csc, x509_cas, cert, NULL); + #if OPENSSL_VERSION_NUMBER >= 0x00907000L + /* XXX See comment in x509_read_crls_from_dir. */ ++#if OPENSSL_VERSION_NUMBER >= 0x00908000L ++ if (x509_cas->param->flags & X509_V_FLAG_CRL_CHECK) { ++#else + if (x509_cas->flags & X509_V_FLAG_CRL_CHECK) { ++#endif + X509_STORE_CTX_set_flags(&csc, X509_V_FLAG_CRL_CHECK); + X509_STORE_CTX_set_flags(&csc, X509_V_FLAG_CRL_CHECK_ALL); + } +Index: isakmpd-20041012.orig/sysdep/linux/sysdep.c +=================================================================== +--- isakmpd-20041012.orig.orig/sysdep/linux/sysdep.c 2007-06-04 13:22:39.182898576 +0200 ++++ isakmpd-20041012.orig/sysdep/linux/sysdep.c 2007-06-04 13:22:39.291882008 +0200 +@@ -169,22 +169,22 @@ + return 0; + + if (!(af == AF_INET || af == AF_INET6)) +- { ++ { + log_print ("sysdep_cleartext: unsupported protocol family %d", af); + return -1; + } + + if (setsockopt (fd, af == AF_INET ? IPPROTO_IP : IPPROTO_IPV6, +- af == AF_INET ? IP_IPSEC_POLICY : IPV6_IPSEC_POLICY, +- &pol_in, sizeof pol_in) < 0 || ++ af == AF_INET ? IP_IPSEC_POLICY : IPV6_IPSEC_POLICY, ++ &pol_in, sizeof pol_in) < 0 || + setsockopt (fd, af == AF_INET ? IPPROTO_IP : IPPROTO_IPV6, +- af == AF_INET ? IP_IPSEC_POLICY : IPV6_IPSEC_POLICY, +- &pol_out, sizeof pol_out) < 0) +- { ++ af == AF_INET ? IP_IPSEC_POLICY : IPV6_IPSEC_POLICY, ++ &pol_out, sizeof pol_out) < 0) ++ { + log_error ("sysdep_cleartext: " +- "setsockopt (%d, IPPROTO_IP%s, IP%s_IPSEC_POLICY, ...) " +- "failed", fd, af == AF_INET ? "" : "V6", +- af == AF_INET ? "" : "V6"); ++ "setsockopt (%d, IPPROTO_IP%s, IP%s_IPSEC_POLICY, ...) " ++ "failed", fd, af == AF_INET ? "" : "V6", ++ af == AF_INET ? "" : "V6"); + return -1; + } + return 0; +Index: isakmpd-20041012.orig/sysdep/linux/GNUmakefile.sysdep +=================================================================== +--- isakmpd-20041012.orig.orig/sysdep/linux/GNUmakefile.sysdep 2007-06-04 13:22:39.187897816 +0200 ++++ isakmpd-20041012.orig/sysdep/linux/GNUmakefile.sysdep 2007-06-04 13:22:39.291882008 +0200 +@@ -33,13 +33,13 @@ + LDADD+= -lgmp ${LIBSYSDEP} ${LIBCRYPTO} + DPADD+= ${LIBGMP} ${LIBSYSDEP} + +-CFLAGS+= -DUSE_OLD_SOCKADDR -DHAVE_PCAP \ +- -DNEED_SYSDEP_APP -DMP_FLAVOUR=MP_FLAVOUR_GMP \ +- -I/usr/src/linux/include -I${.CURDIR}/sysdep/common \ ++CFLAGS+= -DHAVE_GETNAMEINFO -DUSE_OLD_SOCKADDR -DHAVE_PCAP \ ++ -DNEED_SYSDEP_APP -DMP_FLAVOUR=MP_FLAVOUR_GMP -DUSE_AES \ ++ -I${.CURDIR}/sysdep/linux/include -I${.CURDIR}/sysdep/common \ + -I/usr/include/openssl + + FEATURES= debug tripledes blowfish cast ec aggressive x509 policy +-FEATURES+= des aes ++FEATURES+= dpd nat_traversal isakmp_cfg des aes + + IPSEC_SRCS= pf_key_v2.c + IPSEC_CFLAGS= -DUSE_PF_KEY_V2 +@@ -51,7 +51,7 @@ + # hack libsysdep.a dependenc + ${LIBSYSDEPDIR}/.depend ${LIBSYSDEP}: + cd ${LIBSYSDEPDIR} && \ +- ${MAKE} --no-print-directory ${MAKEFLAGS} \ ++ ${MAKE} --no-print-directory \ + CFLAGS="${CFLAGS}" MKDEP="${MKDEP}" ${MAKECMDGOALS} + + ifeq ($(findstring clean,$(MAKECMDGOALS)),clean) +Index: isakmpd-20041012.orig/sysdep/linux/include/bitstring.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ isakmpd-20041012.orig/sysdep/linux/include/bitstring.h 2007-06-04 13:22:39.291882008 +0200 +@@ -0,0 +1,132 @@ ++/* $OpenBSD: bitstring.h,v 1.4 2002/06/19 02:50:10 millert Exp $ */ ++/* $NetBSD: bitstring.h,v 1.5 1997/05/14 15:49:55 pk Exp $ */ ++ ++/* ++ * 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_ ++ ++/* modified for SV/AT and bitstring bugfix by M.R.Murphy, 11oct91 ++ * bitstr_size changed gratuitously, but shorter ++ * bit_alloc spelling error fixed ++ * the following were efficient, but didn't work, they've been made to ++ * work, but are no longer as efficient :-) ++ * bit_nclear, bit_nset, bit_ffc, bit_ffs ++ */ ++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) + 7) >> 3) ++ ++ /* allocate a bitstring */ ++#define bit_alloc(nbits) \ ++ (bitstr_t *)calloc((size_t)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) do { \ ++ register bitstr_t *_name = name; \ ++ register int _start = start, _stop = stop; \ ++ while (_start <= _stop) { \ ++ bit_clear(_name, _start); \ ++ _start++; \ ++ } \ ++} while(0) ++ ++ /* set bits start ... stop in bitstring */ ++#define bit_nset(name, start, stop) do { \ ++ register bitstr_t *_name = name; \ ++ register int _start = start, _stop = stop; \ ++ while (_start <= _stop) { \ ++ bit_set(_name, _start); \ ++ _start++; \ ++ } \ ++} while(0) ++ ++ /* find first bit clear in name */ ++#define bit_ffc(name, nbits, value) do { \ ++ register bitstr_t *_name = name; \ ++ register int _bit, _nbits = nbits, _value = -1; \ ++ for (_bit = 0; _bit < _nbits; ++_bit) \ ++ if (!bit_test(_name, _bit)) { \ ++ _value = _bit; \ ++ break; \ ++ } \ ++ *(value) = _value; \ ++} while(0) ++ ++ /* find first bit set in name */ ++#define bit_ffs(name, nbits, value) do { \ ++ register bitstr_t *_name = name; \ ++ register int _bit, _nbits = nbits, _value = -1; \ ++ for (_bit = 0; _bit < _nbits; ++_bit) \ ++ if (bit_test(_name, _bit)) { \ ++ _value = _bit; \ ++ break; \ ++ } \ ++ *(value) = _value; \ ++} while(0) ++ ++#endif /* !_BITSTRING_H_ */ +Index: isakmpd-20041012.orig/sysdep/linux/include/sys/queue.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ isakmpd-20041012.orig/sysdep/linux/include/sys/queue.h 2007-06-04 13:22:39.292881856 +0200 +@@ -0,0 +1,453 @@ ++/* ++ * Copyright (c) 1991, 1993 ++ * The Regents of the University of California. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. All advertising materials mentioning features or use of this software ++ * must display the following acknowledgement: ++ * This product includes software developed by 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. ++ * ++ * @(#)queue.h 8.5 (Berkeley) 8/20/94 ++ * $FreeBSD: src/sys/sys/queue.h,v 1.45 2001/12/11 11:49:58 sheldonh Exp $ ++ */ ++ ++#ifndef _SYS_QUEUE_H_ ++#define _SYS_QUEUE_H_ ++ ++//#include /* for __offsetof */ ++ ++/* ++ * This file defines four types of data structures: singly-linked lists, ++ * singly-linked tail queues, lists and tail queues. ++ * ++ * A singly-linked list is headed by a single forward pointer. The elements ++ * are singly linked for minimum space and pointer manipulation overhead at ++ * the expense of O(n) removal for arbitrary elements. New elements can be ++ * added to the list after an existing element or at the head of the list. ++ * Elements being removed from the head of the list should use the explicit ++ * macro for this purpose for optimum efficiency. A singly-linked list may ++ * only be traversed in the forward direction. Singly-linked lists are ideal ++ * for applications with large datasets and few or no removals or for ++ * implementing a LIFO queue. ++ * ++ * A singly-linked tail queue is headed by a pair of pointers, one to the ++ * head of the list and the other to the tail of the list. The elements are ++ * singly linked for minimum space and pointer manipulation overhead at the ++ * expense of O(n) removal for arbitrary elements. New elements can be added ++ * to the list after an existing element, at the head of the list, or at the ++ * end of the list. Elements being removed from the head of the tail queue ++ * should use the explicit macro for this purpose for optimum efficiency. ++ * A singly-linked tail queue may only be traversed in the forward direction. ++ * Singly-linked tail queues are ideal for applications with large datasets ++ * and few or no removals or for implementing a FIFO queue. ++ * ++ * A list is headed by a single forward pointer (or an array of forward ++ * pointers for a hash table header). The elements are doubly linked ++ * so that an arbitrary element can be removed without a need to ++ * traverse the list. New elements can be added to the list before ++ * or after an existing element or at the head of the list. A list ++ * may only be traversed in the forward direction. ++ * ++ * A tail queue is headed by a pair of pointers, one to the head of the ++ * list and the other to the tail of the list. The elements are doubly ++ * linked so that an arbitrary element can be removed without a need to ++ * traverse the list. New elements can be added to the list before or ++ * after an existing element, at the head of the list, or at the end of ++ * the list. A tail queue may be traversed in either direction. ++ * ++ * For details on the use of these macros, see the queue(3) manual page. ++ * ++ * ++ * SLIST LIST STAILQ TAILQ ++ * _HEAD + + + + ++ * _HEAD_INITIALIZER + + + + ++ * _ENTRY + + + + ++ * _INIT + + + + ++ * _EMPTY + + + + ++ * _FIRST + + + + ++ * _NEXT + + + + ++ * _PREV - - - + ++ * _LAST - - + + ++ * _FOREACH + + + + ++ * _FOREACH_REVERSE - - - + ++ * _INSERT_HEAD + + + + ++ * _INSERT_BEFORE - + - + ++ * _INSERT_AFTER + + + + ++ * _INSERT_TAIL - - + + ++ * _REMOVE_HEAD + - + - ++ * _REMOVE + + + + ++ * ++ */ ++ ++/* ++ * Singly-linked List declarations. ++ */ ++#define SLIST_HEAD(name, type) \ ++struct name { \ ++ struct type *slh_first; /* first element */ \ ++} ++ ++#define SLIST_HEAD_INITIALIZER(head) \ ++ { NULL } ++ ++#define SLIST_ENTRY(type) \ ++struct { \ ++ struct type *sle_next; /* next element */ \ ++} ++ ++/* ++ * Singly-linked List functions. ++ */ ++#define SLIST_EMPTY(head) ((head)->slh_first == NULL) ++ ++#define SLIST_FIRST(head) ((head)->slh_first) ++ ++#define SLIST_FOREACH(var, head, field) \ ++ for ((var) = SLIST_FIRST((head)); \ ++ (var); \ ++ (var) = SLIST_NEXT((var), field)) ++ ++#define SLIST_INIT(head) do { \ ++ SLIST_FIRST((head)) = NULL; \ ++} while (0) ++ ++#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ ++ SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \ ++ SLIST_NEXT((slistelm), field) = (elm); \ ++} while (0) ++ ++#define SLIST_INSERT_HEAD(head, elm, field) do { \ ++ SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \ ++ SLIST_FIRST((head)) = (elm); \ ++} while (0) ++ ++#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) ++ ++#define SLIST_REMOVE(head, elm, type, field) do { \ ++ if (SLIST_FIRST((head)) == (elm)) { \ ++ SLIST_REMOVE_HEAD((head), field); \ ++ } \ ++ else { \ ++ struct type *curelm = SLIST_FIRST((head)); \ ++ while (SLIST_NEXT(curelm, field) != (elm)) \ ++ curelm = SLIST_NEXT(curelm, field); \ ++ SLIST_NEXT(curelm, field) = \ ++ SLIST_NEXT(SLIST_NEXT(curelm, field), field); \ ++ } \ ++} while (0) ++ ++#define SLIST_REMOVE_HEAD(head, field) do { \ ++ SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ ++} while (0) ++ ++/* ++ * Singly-linked Tail queue declarations. ++ */ ++#define STAILQ_HEAD(name, type) \ ++struct name { \ ++ struct type *stqh_first;/* first element */ \ ++ struct type **stqh_last;/* addr of last next element */ \ ++} ++ ++#define STAILQ_HEAD_INITIALIZER(head) \ ++ { NULL, &(head).stqh_first } ++ ++#define STAILQ_ENTRY(type) \ ++struct { \ ++ struct type *stqe_next; /* next element */ \ ++} ++ ++/* ++ * Singly-linked Tail queue functions. ++ */ ++#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) ++ ++#define STAILQ_FIRST(head) ((head)->stqh_first) ++ ++#define STAILQ_FOREACH(var, head, field) \ ++ for((var) = STAILQ_FIRST((head)); \ ++ (var); \ ++ (var) = STAILQ_NEXT((var), field)) ++ ++#define STAILQ_INIT(head) do { \ ++ STAILQ_FIRST((head)) = NULL; \ ++ (head)->stqh_last = &STAILQ_FIRST((head)); \ ++} while (0) ++ ++#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ ++ if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\ ++ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ ++ STAILQ_NEXT((tqelm), field) = (elm); \ ++} while (0) ++ ++#define STAILQ_INSERT_HEAD(head, elm, field) do { \ ++ if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \ ++ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ ++ STAILQ_FIRST((head)) = (elm); \ ++} while (0) ++ ++#define STAILQ_INSERT_TAIL(head, elm, field) do { \ ++ STAILQ_NEXT((elm), field) = NULL; \ ++ *(head)->stqh_last = (elm); \ ++ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ ++} while (0) ++ ++#define STAILQ_LAST(head, type, field) \ ++ (STAILQ_EMPTY(head) ? \ ++ NULL : \ ++ ((struct type *) \ ++ ((char *)((head)->stqh_last) - __offsetof(struct type, field)))) ++ ++#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) ++ ++#define STAILQ_REMOVE(head, elm, type, field) do { \ ++ if (STAILQ_FIRST((head)) == (elm)) { \ ++ STAILQ_REMOVE_HEAD(head, field); \ ++ } \ ++ else { \ ++ struct type *curelm = STAILQ_FIRST((head)); \ ++ while (STAILQ_NEXT(curelm, field) != (elm)) \ ++ curelm = STAILQ_NEXT(curelm, field); \ ++ if ((STAILQ_NEXT(curelm, field) = \ ++ STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL)\ ++ (head)->stqh_last = &STAILQ_NEXT((curelm), field);\ ++ } \ ++} while (0) ++ ++#define STAILQ_REMOVE_HEAD(head, field) do { \ ++ if ((STAILQ_FIRST((head)) = \ ++ STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ ++ (head)->stqh_last = &STAILQ_FIRST((head)); \ ++} while (0) ++ ++#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ ++ if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \ ++ (head)->stqh_last = &STAILQ_FIRST((head)); \ ++} while (0) ++ ++/* ++ * List declarations. ++ */ ++#define LIST_HEAD(name, type) \ ++struct name { \ ++ struct type *lh_first; /* first element */ \ ++} ++ ++#define LIST_HEAD_INITIALIZER(head) \ ++ { NULL } ++ ++#define LIST_ENTRY(type) \ ++struct { \ ++ struct type *le_next; /* next element */ \ ++ struct type **le_prev; /* address of previous next element */ \ ++} ++ ++/* ++ * List functions. ++ */ ++ ++#define LIST_EMPTY(head) ((head)->lh_first == NULL) ++ ++#define LIST_FIRST(head) ((head)->lh_first) ++ ++#define LIST_FOREACH(var, head, field) \ ++ for ((var) = LIST_FIRST((head)); \ ++ (var); \ ++ (var) = LIST_NEXT((var), field)) ++ ++#define LIST_INIT(head) do { \ ++ LIST_FIRST((head)) = NULL; \ ++} while (0) ++ ++#define LIST_INSERT_AFTER(listelm, elm, field) do { \ ++ if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\ ++ LIST_NEXT((listelm), field)->field.le_prev = \ ++ &LIST_NEXT((elm), field); \ ++ LIST_NEXT((listelm), field) = (elm); \ ++ (elm)->field.le_prev = &LIST_NEXT((listelm), field); \ ++} while (0) ++ ++#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ ++ (elm)->field.le_prev = (listelm)->field.le_prev; \ ++ LIST_NEXT((elm), field) = (listelm); \ ++ *(listelm)->field.le_prev = (elm); \ ++ (listelm)->field.le_prev = &LIST_NEXT((elm), field); \ ++} while (0) ++ ++#define LIST_INSERT_HEAD(head, elm, field) do { \ ++ if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \ ++ LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\ ++ LIST_FIRST((head)) = (elm); \ ++ (elm)->field.le_prev = &LIST_FIRST((head)); \ ++} while (0) ++ ++#define LIST_NEXT(elm, field) ((elm)->field.le_next) ++ ++#define LIST_REMOVE(elm, field) do { \ ++ if (LIST_NEXT((elm), field) != NULL) \ ++ LIST_NEXT((elm), field)->field.le_prev = \ ++ (elm)->field.le_prev; \ ++ *(elm)->field.le_prev = LIST_NEXT((elm), field); \ ++} while (0) ++ ++/* ++ * Tail queue declarations. ++ */ ++#define TAILQ_HEAD(name, type) \ ++struct name { \ ++ struct type *tqh_first; /* first element */ \ ++ struct type **tqh_last; /* addr of last next element */ \ ++} ++ ++#define TAILQ_HEAD_INITIALIZER(head) \ ++ { NULL, &(head).tqh_first } ++ ++#define TAILQ_ENTRY(type) \ ++struct { \ ++ struct type *tqe_next; /* next element */ \ ++ struct type **tqe_prev; /* address of previous next element */ \ ++} ++ ++/* ++ * Tail queue functions. ++ */ ++#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) ++ ++#define TAILQ_FIRST(head) ((head)->tqh_first) ++ ++#define TAILQ_FOREACH(var, head, field) \ ++ for ((var) = TAILQ_FIRST((head)); \ ++ (var); \ ++ (var) = TAILQ_NEXT((var), field)) ++ ++#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ ++ for ((var) = TAILQ_LAST((head), headname); \ ++ (var); \ ++ (var) = TAILQ_PREV((var), headname, field)) ++ ++#define TAILQ_INIT(head) do { \ ++ TAILQ_FIRST((head)) = NULL; \ ++ (head)->tqh_last = &TAILQ_FIRST((head)); \ ++} while (0) ++ ++#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ ++ if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\ ++ TAILQ_NEXT((elm), field)->field.tqe_prev = \ ++ &TAILQ_NEXT((elm), field); \ ++ else \ ++ (head)->tqh_last = &TAILQ_NEXT((elm), field); \ ++ TAILQ_NEXT((listelm), field) = (elm); \ ++ (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \ ++} while (0) ++ ++#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ ++ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ ++ TAILQ_NEXT((elm), field) = (listelm); \ ++ *(listelm)->field.tqe_prev = (elm); \ ++ (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \ ++} while (0) ++ ++#define TAILQ_INSERT_HEAD(head, elm, field) do { \ ++ if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \ ++ TAILQ_FIRST((head))->field.tqe_prev = \ ++ &TAILQ_NEXT((elm), field); \ ++ else \ ++ (head)->tqh_last = &TAILQ_NEXT((elm), field); \ ++ TAILQ_FIRST((head)) = (elm); \ ++ (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \ ++} while (0) ++ ++#define TAILQ_INSERT_TAIL(head, elm, field) do { \ ++ TAILQ_NEXT((elm), field) = NULL; \ ++ (elm)->field.tqe_prev = (head)->tqh_last; \ ++ *(head)->tqh_last = (elm); \ ++ (head)->tqh_last = &TAILQ_NEXT((elm), field); \ ++} while (0) ++ ++#define TAILQ_LAST(head, headname) \ ++ (*(((struct headname *)((head)->tqh_last))->tqh_last)) ++ ++#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) ++ ++#define TAILQ_PREV(elm, headname, field) \ ++ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) ++ ++#define TAILQ_REMOVE(head, elm, field) do { \ ++ if ((TAILQ_NEXT((elm), field)) != NULL) \ ++ TAILQ_NEXT((elm), field)->field.tqe_prev = \ ++ (elm)->field.tqe_prev; \ ++ else \ ++ (head)->tqh_last = (elm)->field.tqe_prev; \ ++ *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \ ++} while (0) ++ ++ ++#ifdef _KERNEL ++ ++/* ++ * XXX insque() and remque() are an old way of handling certain queues. ++ * They bogusly assumes that all queue heads look alike. ++ */ ++ ++struct quehead { ++ struct quehead *qh_link; ++ struct quehead *qh_rlink; ++}; ++ ++#ifdef __GNUC__ ++ ++static __inline void ++insque(void *a, void *b) ++{ ++ struct quehead *element = (struct quehead *)a, ++ *head = (struct quehead *)b; ++ ++ element->qh_link = head->qh_link; ++ element->qh_rlink = head; ++ head->qh_link = element; ++ element->qh_link->qh_rlink = element; ++} ++ ++static __inline void ++remque(void *a) ++{ ++ struct quehead *element = (struct quehead *)a; ++ ++ element->qh_link->qh_rlink = element->qh_rlink; ++ element->qh_rlink->qh_link = element->qh_link; ++ element->qh_rlink = 0; ++} ++ ++#else /* !__GNUC__ */ ++ ++void insque __P((void *a, void *b)); ++void remque __P((void *a)); ++ ++#endif /* __GNUC__ */ ++ ++#endif /* _KERNEL */ ++ ++#endif /* !_SYS_QUEUE_H_ */ +Index: isakmpd-20041012.orig/sysdep/common/pcap.h +=================================================================== +--- isakmpd-20041012.orig.orig/sysdep/common/pcap.h 2007-06-04 13:22:39.203895384 +0200 ++++ isakmpd-20041012.orig/sysdep/common/pcap.h 2007-06-04 13:22:39.292881856 +0200 +@@ -55,8 +55,13 @@ + u_int32_t linktype; /* data link type (DLT_*) */ + }; + ++struct pcap_timeval { ++ int32_t tv_sec; /* seconds */ ++ int32_t tv_usec; /* microseconds */ ++}; ++ + struct pcap_pkthdr { +- struct timeval ts; /* time stamp */ ++ struct pcap_timeval ts; /* time stamp */ + u_int32_t caplen; /* length of portion present */ + u_int32_t len; /* length this packet (off wire) */ + }; +Index: isakmpd-20041012.orig/sysdep/common/libsysdep/arc4random.c +=================================================================== +--- isakmpd-20041012.orig.orig/sysdep/common/libsysdep/arc4random.c 2007-06-04 13:22:39.211894168 +0200 ++++ isakmpd-20041012.orig/sysdep/common/libsysdep/arc4random.c 2007-06-04 13:22:39.292881856 +0200 +@@ -78,7 +78,7 @@ + static void + arc4_stir(struct arc4_stream *as) + { +- int fd; ++ int fd, i; + struct { + struct timeval tv; + u_int8_t rnd[128 - sizeof(struct timeval)]; +Index: isakmpd-20041012.orig/x509v3.cnf +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ isakmpd-20041012.orig/x509v3.cnf 2007-06-04 13:22:39.293881704 +0200 +@@ -0,0 +1,26 @@ ++# default settings ++CERTPATHLEN = 1 ++CERTUSAGE = digitalSignature,keyCertSign ++CERTIP = 0.0.0.0 ++CERTFQDN = nohost.nodomain ++ ++# This section should be referenced when building an x509v3 CA ++# Certificate. ++# The default path length and the key usage can be overriden ++# modified by setting the CERTPATHLEN and CERTUSAGE environment ++# variables. ++[x509v3_CA] ++basicConstraints=critical,CA:true,pathlen:$ENV::CERTPATHLEN ++keyUsage=$ENV::CERTUSAGE ++ ++# This section should be referenced to add an IP Address ++# as an alternate subject name, needed by isakmpd ++# The address must be provided in the CERTIP environment variable ++[x509v3_IPAddr] ++subjectAltName=IP:$ENV::CERTIP ++ ++# This section should be referenced to add a FQDN hostname ++# as an alternate subject name, needed by isakmpd ++# The address must be provided in the CERTFQDN environment variable ++[x509v3_FQDN] ++subjectAltName=DNS:$ENV::CERTFQDN diff --git a/net/isakmpd/patches/020-standardize.patch b/net/isakmpd/patches/020-standardize.patch new file mode 100644 index 0000000..435782b --- /dev/null +++ b/net/isakmpd/patches/020-standardize.patch @@ -0,0 +1,154 @@ +Index: isakmpd-20041012.orig/GNUmakefile +=================================================================== +--- isakmpd-20041012.orig.orig/GNUmakefile 2007-06-04 13:22:39.283883224 +0200 ++++ isakmpd-20041012.orig/GNUmakefile 2007-06-04 13:22:39.722816496 +0200 +@@ -168,7 +168,6 @@ + X509= x509.c + CFLAGS+= -DUSE_LIBCRYPTO + LDADD+= -lcrypto +-DPADD+= ${LIBCRYPTO} + endif + + ifdef USE_RAWKEY +@@ -242,3 +241,16 @@ + + realcleandepend: + rm -f .depend tags ++ ++# Install rules ++install: install-bin install-man ++ ++install-bin: isakmpd ++ -mkdir -p $(DESTDIR)$(BINDIR) ++ $(INSTALL) $(INSTALL_OPTS) -m 755 isakmpd $(DESTDIR)$(BINDIR) ++ ++install-man: ++ -mkdir -p $(DESTDIR)$(MANDIR)/man8 ++ $(INSTALL) $(INSTALL_OPTS) -m 444 isakmpd.8 $(DESTDIR)$(MANDIR)/man8 ++ -mkdir -p $(DESTDIR)$(MANDIR)/man5 ++ $(INSTALL) $(INSTALL_OPTS) -m 444 isakmpd.conf.5 isakmpd.policy.5 $(DESTDIR)$(MANDIR)/man5 +Index: isakmpd-20041012.orig/samples/Makefile +=================================================================== +--- isakmpd-20041012.orig.orig/samples/Makefile 2007-06-04 13:22:39.015923960 +0200 ++++ isakmpd-20041012.orig/samples/Makefile 2007-06-04 13:22:39.722816496 +0200 +@@ -26,7 +26,7 @@ + # + + FILES= VPN-* policy singlehost-* +-TARGETDIR= /usr/share/ipsec/isakmpd ++TARGETDIR= /usr/share/isakmpd/samples + + # The mkdir below is for installation on OpenBSD pre 2.7 + install: +Index: isakmpd-20041012.orig/sysdep/linux/GNUmakefile.sysdep +=================================================================== +--- isakmpd-20041012.orig.orig/sysdep/linux/GNUmakefile.sysdep 2007-06-04 13:22:39.291882008 +0200 ++++ isakmpd-20041012.orig/sysdep/linux/GNUmakefile.sysdep 2007-06-04 13:22:39.722816496 +0200 +@@ -25,18 +25,18 @@ + # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # + +-LIBGMP:= /usr/lib/libgmp.a +-LIBCRYPTO:= /usr/lib/libcrypto.a ++LIBGMP:= ++LIBCRYPTO:= -lcrypto + LIBSYSDEPDIR:= ${.CURDIR}/sysdep/common/libsysdep + LIBSYSDEP:= ${LIBSYSDEPDIR}/libsysdep.a + +-LDADD+= -lgmp ${LIBSYSDEP} ${LIBCRYPTO} ++LDADD+= $(EXTRA_LDFLAGS) -lgmp ${LIBSYSDEP} ${LIBCRYPTO} + DPADD+= ${LIBGMP} ${LIBSYSDEP} + + CFLAGS+= -DHAVE_GETNAMEINFO -DUSE_OLD_SOCKADDR -DHAVE_PCAP \ + -DNEED_SYSDEP_APP -DMP_FLAVOUR=MP_FLAVOUR_GMP -DUSE_AES \ + -I${.CURDIR}/sysdep/linux/include -I${.CURDIR}/sysdep/common \ +- -I/usr/include/openssl ++ $(EXTRA_CPPFLAGS) + + FEATURES= debug tripledes blowfish cast ec aggressive x509 policy + FEATURES+= dpd nat_traversal isakmp_cfg des aes +Index: isakmpd-20041012.orig/Makefile +=================================================================== +--- isakmpd-20041012.orig.orig/Makefile 2007-06-04 13:22:39.028921984 +0200 ++++ isakmpd-20041012.orig/Makefile 2007-06-04 13:22:39.723816344 +0200 +@@ -147,7 +147,6 @@ + .ifdef USE_LIBCRYPTO + CFLAGS+= -DUSE_LIBCRYPTO + LDADD+= -lcrypto +-DPADD+= ${LIBCRYPTO} + .endif + + .ifdef USE_LIBDES +Index: isakmpd-20041012.orig/apps/certpatch/Makefile +=================================================================== +--- isakmpd-20041012.orig.orig/apps/certpatch/Makefile 2007-06-04 13:22:39.035920920 +0200 ++++ isakmpd-20041012.orig/apps/certpatch/Makefile 2007-06-04 13:22:39.723816344 +0200 +@@ -40,7 +40,6 @@ + .PATH: ${TOPSRC} ${TOPSRC}/sysdep/${OS} ${TOPOBJ} + CFLAGS+= -I${TOPSRC} -I${TOPSRC}/sysdep/${OS} -I${TOPOBJ} -Wall + LDADD+= -lcrypto +-DPADD+= ${LIBCRYPTO} + MAN= certpatch.8 + + .if ${FEATURES:Mgmp} == "gmp" +Index: isakmpd-20041012.orig/regress/crypto/Makefile +=================================================================== +--- isakmpd-20041012.orig.orig/regress/crypto/Makefile 2007-06-04 13:22:39.041920008 +0200 ++++ isakmpd-20041012.orig/regress/crypto/Makefile 2007-06-04 13:22:39.723816344 +0200 +@@ -13,7 +13,7 @@ + -DUSE_TRIPLEDES -DUSE_CAST -DUSE_BLOWFISH -DUSE_DES \ + -DUSE_AES + LDADD+= -lcrypto -ldes +-DPADD+= ${LIBCRYPTO} ${LIBDES} ++DPADD+= ${LIBDES} + NOMAN= + DEBUG= -g + +Index: isakmpd-20041012.orig/regress/dh/Makefile +=================================================================== +--- isakmpd-20041012.orig.orig/regress/dh/Makefile 2007-06-04 13:22:39.048918944 +0200 ++++ isakmpd-20041012.orig/regress/dh/Makefile 2007-06-04 13:22:39.726815888 +0200 +@@ -15,7 +15,6 @@ + -DUSE_EC + NOMAN= + LDADD+= -lcrypto +-DPADD+= ${LIBCRYPTO} + DEBUG= -g + + .if ${FEATURES:Mgmp} == "gmp" +Index: isakmpd-20041012.orig/regress/group/Makefile +=================================================================== +--- isakmpd-20041012.orig.orig/regress/group/Makefile 2007-06-04 13:22:39.054918032 +0200 ++++ isakmpd-20041012.orig/regress/group/Makefile 2007-06-04 13:22:39.727815736 +0200 +@@ -15,7 +15,6 @@ + -DUSE_EC + NOMAN= + LDADD+= -lcrypto +-DPADD+= ${LIBCRYPTO} + DEBUG= -g + + .if ${FEATURES:Mgmp} == "gmp" +Index: isakmpd-20041012.orig/regress/rsakeygen/Makefile +=================================================================== +--- isakmpd-20041012.orig.orig/regress/rsakeygen/Makefile 2007-06-04 13:22:39.060917120 +0200 ++++ isakmpd-20041012.orig/regress/rsakeygen/Makefile 2007-06-04 13:22:39.727815736 +0200 +@@ -62,7 +62,6 @@ + .ifdef USE_LIBCRYPTO + CFLAGS+= -DUSE_LIBCRYPTO + LDADD+= -lcrypto +-DPADD+= ${LIBCRYPTO} + .endif + + .if !defined (HAVE_DLOPEN) && !defined (USE_LIBCRYPTO) +Index: isakmpd-20041012.orig/regress/x509/Makefile +=================================================================== +--- isakmpd-20041012.orig.orig/regress/x509/Makefile 2007-06-04 13:22:39.068915904 +0200 ++++ isakmpd-20041012.orig/regress/x509/Makefile 2007-06-04 13:22:39.727815736 +0200 +@@ -78,7 +78,6 @@ + X509= x509.c + CFLAGS+= -DUSE_LIBCRYPTO + LDADD+= -lcrypto ${LIBLWRES} +-DPADD+= ${LIBCRYPTO} + .endif + + .if !defined (HAVE_DLOPEN) && !defined (USE_LIBCRYPTO) || !defined (USE_KEYNOTE) diff --git a/net/isakmpd/patches/030-openssl_hashes.patch b/net/isakmpd/patches/030-openssl_hashes.patch new file mode 100644 index 0000000..f50afc5 --- /dev/null +++ b/net/isakmpd/patches/030-openssl_hashes.patch @@ -0,0 +1,161 @@ +Index: isakmpd-20041012.orig/GNUmakefile +=================================================================== +--- isakmpd-20041012.orig.orig/GNUmakefile 2007-06-04 13:22:39.722816496 +0200 ++++ isakmpd-20041012.orig/GNUmakefile 2007-06-04 13:22:40.000774240 +0200 +@@ -76,13 +76,14 @@ + isakmp_fld.c isakmp_fld.h + MAN= isakmpd.8 isakmpd.conf.5 isakmpd.policy.5 + +-CFLAGS+= -O2 ${DEBUG} -Wall -DNEED_SYSDEP_APP \ ++CFLAGS+= ${DEBUG} -Wall -DNEED_SYSDEP_APP \ + -I${.CURDIR} -I${.CURDIR}/sysdep/${OS} -I. \ + + # Different debugging & profiling suggestions + + # Include symbolic debugging info + DEBUG= -g ++CFLAGS+= -g + + # Do execution time profiles + #CFLAGS+= -pg +@@ -175,6 +176,14 @@ + CFLAGS+= -DUSE_RAWKEY + endif + ++ifdef USE_OPENSSL_MD5 ++CFLAGS+= -DUSE_OPENSSL_MD5 ++endif ++ ++ifdef USE_OPENSSL_SHA1 ++CFLAGS+= -DUSE_OPENSSL_SHA1 ++endif ++ + SRCS+= ${IPSEC_SRCS} ${X509} ${POLICY} ${EC} ${AGGRESSIVE} ${DNSSEC} \ + $(ISAKMP_CFG) ${DPD} ${NAT_TRAVERSAL} + CFLAGS+= ${IPSEC_CFLAGS} +Index: isakmpd-20041012.orig/sysdep/common/libsysdep/GNUmakefile +=================================================================== +--- isakmpd-20041012.orig.orig/sysdep/common/libsysdep/GNUmakefile 2007-06-04 13:22:38.959932472 +0200 ++++ isakmpd-20041012.orig/sysdep/common/libsysdep/GNUmakefile 2007-06-04 13:22:40.000774240 +0200 +@@ -31,10 +31,18 @@ + .CURDIR:= $(shell pwd) + + LIB= sysdep +-SRCS= arc4random.c blowfish.c cast.c md5.c sha1.c strlcat.c strlcpy.c ++SRCS= arc4random.c blowfish.c cast.c strlcat.c strlcpy.c + NOMAN= + CFLAGS+= -I${.CURDIR}/.. -I/usr/include/machine + ++ifeq (,$(findstring USE_OPENSSL_MD5,$(CFLAGS))) ++SRCS+=md5.c ++endif ++ ++ifeq (,$(findstring USE_OPENSSL_SHA1,$(CFLAGS))) ++SRCS+=sha1.c ++endif ++ + lib${LIB}.a: ${SRCS:%.c=%.o} + ar cq $@ ${SRCS:%.c=%.o} + +Index: isakmpd-20041012.orig/sysdep/common/libsysdep/md5.c +=================================================================== +--- isakmpd-20041012.orig.orig/sysdep/common/libsysdep/md5.c 2007-06-04 13:22:38.964931712 +0200 ++++ isakmpd-20041012.orig/sysdep/common/libsysdep/md5.c 2007-06-04 13:22:40.000774240 +0200 +@@ -5,6 +5,8 @@ + * changes to accommodate it in the kernel by ji. + */ + ++#ifndef USE_OPENSSL_MD5 ++ + /* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm + */ + +@@ -390,3 +392,4 @@ + #endif + #endif + ++#endif /* USE_OPENSSL_MD5 */ +Index: isakmpd-20041012.orig/sysdep/common/libsysdep/sha1.c +=================================================================== +--- isakmpd-20041012.orig.orig/sysdep/common/libsysdep/sha1.c 2007-06-04 13:22:38.970930800 +0200 ++++ isakmpd-20041012.orig/sysdep/common/libsysdep/sha1.c 2007-06-04 13:22:40.001774088 +0200 +@@ -1,5 +1,7 @@ + /* $OpenBSD: sha1.c,v 1.2 2001/01/28 22:38:48 niklas Exp $ */ + ++#ifndef USE_OPENSSL_SHA1 ++ + /* + SHA-1 in C + By Steve Reid +@@ -171,3 +173,5 @@ + SHA1Transform(context->state, context->buffer); + #endif + } ++ ++#endif /* USE_OPENSSL_SHA1 */ +Index: isakmpd-20041012.orig/sysdep/common/md5.h +=================================================================== +--- isakmpd-20041012.orig.orig/sysdep/common/md5.h 2007-06-04 13:22:38.976929888 +0200 ++++ isakmpd-20041012.orig/sysdep/common/md5.h 2007-06-04 13:22:40.001774088 +0200 +@@ -1,5 +1,15 @@ + /* $OpenBSD: md5.h,v 1.2 2001/01/28 22:38:47 niklas Exp $ */ + ++#ifdef USE_OPENSSL_MD5 ++ ++#include ++ ++#define MD5Init MD5_Init ++#define MD5Update MD5_Update ++#define MD5Final MD5_Final ++ ++#else /* USE_OPENSSL_MD5 */ ++ + /* GLOBAL.H - RSAREF types and constants + */ + +@@ -71,3 +81,5 @@ + void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); + + #define _MD5_H_ ++ ++#endif /* USE_OPENSSL_MD5 */ +Index: isakmpd-20041012.orig/sysdep/common/sha1.h +=================================================================== +--- isakmpd-20041012.orig.orig/sysdep/common/sha1.h 2007-06-04 13:22:38.982928976 +0200 ++++ isakmpd-20041012.orig/sysdep/common/sha1.h 2007-06-04 13:22:40.001774088 +0200 +@@ -1,5 +1,16 @@ + /* $OpenBSD: sha1.h,v 1.2 2001/01/28 22:38:47 niklas Exp $ */ + ++#ifdef USE_OPENSSL_SHA1 ++ ++#include ++ ++typedef SHA_CTX SHA1_CTX; ++#define SHA1Init SHA1_Init ++#define SHA1Update SHA1_Update ++#define SHA1Final SHA1_Final ++ ++#else /* USE_OPENSSL_SHA1 */ ++ + /* + SHA-1 in C + By Steve Reid +@@ -16,3 +27,5 @@ + void SHA1Init(SHA1_CTX* context); + void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len); + void SHA1Final(unsigned char digest[20], SHA1_CTX* context); ++ ++#endif /* USE_OPENSSL_SHA1 */ +Index: isakmpd-20041012.orig/sysdep/linux/GNUmakefile.sysdep +=================================================================== +--- isakmpd-20041012.orig.orig/sysdep/linux/GNUmakefile.sysdep 2007-06-04 13:22:39.722816496 +0200 ++++ isakmpd-20041012.orig/sysdep/linux/GNUmakefile.sysdep 2007-06-04 13:22:40.001774088 +0200 +@@ -47,6 +47,8 @@ + USE_LIBCRYPO= defined + HAVE_DLOPEN= defined + USE_KEYNOTE= defined ++USE_OPENSSL_MD5= defined ++USE_OPENSSL_SHA1= defined + + # hack libsysdep.a dependenc + ${LIBSYSDEPDIR}/.depend ${LIBSYSDEP}: diff --git a/net/isakmpd/patches/040-security_fix.patch b/net/isakmpd/patches/040-security_fix.patch new file mode 100644 index 0000000..d70a722 --- /dev/null +++ b/net/isakmpd/patches/040-security_fix.patch @@ -0,0 +1,18 @@ +Index: isakmpd-20041012.orig/ipsec.c +=================================================================== +--- isakmpd-20041012.orig.orig/ipsec.c 2007-06-04 13:22:39.283883224 +0200 ++++ isakmpd-20041012.orig/ipsec.c 2007-06-04 13:22:40.247736696 +0200 +@@ -2176,9 +2176,10 @@ + { + struct ipsec_proto *iproto = proto->data; + +- if (proto->sa->phase == 2 && section) +- iproto->replay_window = conf_get_num(section, "ReplayWindow", +- DEFAULT_REPLAY_WINDOW); ++ if (proto->sa->phase == 2) ++ iproto->replay_window = section ? conf_get_num(section, ++ "ReplayWindow", DEFAULT_REPLAY_WINDOW) : ++ DEFAULT_REPLAY_WINDOW; + } + + /* diff --git a/net/isakmpd/patches/050-ar_cross.patch b/net/isakmpd/patches/050-ar_cross.patch new file mode 100644 index 0000000..2bac048 --- /dev/null +++ b/net/isakmpd/patches/050-ar_cross.patch @@ -0,0 +1,13 @@ +Index: isakmpd-20041012.orig/sysdep/common/libsysdep/GNUmakefile +=================================================================== +--- isakmpd-20041012.orig.orig/sysdep/common/libsysdep/GNUmakefile 2007-06-04 13:22:40.000774240 +0200 ++++ isakmpd-20041012.orig/sysdep/common/libsysdep/GNUmakefile 2007-06-04 13:22:40.431708728 +0200 +@@ -44,7 +44,7 @@ + endif + + lib${LIB}.a: ${SRCS:%.c=%.o} +- ar cq $@ ${SRCS:%.c=%.o} ++ $(AR) cq $@ ${SRCS:%.c=%.o} + + clean: + rm -f lib${LIB}.a ${SRCS:%.c=%.o} diff --git a/net/isc-dhcp/Makefile b/net/isc-dhcp/Makefile new file mode 100644 index 0000000..798ee32 --- /dev/null +++ b/net/isc-dhcp/Makefile @@ -0,0 +1,212 @@ +# +# Copyright (C) 2006-2012 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:=isc-dhcp +UPSTREAM_NAME:=dhcp +PKG_VERSION:=4.2.4 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(UPSTREAM_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.isc.org/isc/dhcp/$(PKG_VERSION) +PKG_MD5SUM:=c244cefe663d43100af757d8ff625a1f + +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(UPSTREAM_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/isc-dhcp/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=ISC's DHCP + URL:=https://www.isc.org/software/dhcp +endef + +define Package/isc-dhcp-relay-ipv4 + $(call Package/isc-dhcp/Default) + TITLE+= relay (without IPv6) + VARIANT:=ipv4 +endef + +define Package/isc-dhcp-relay-ipv6 + $(call Package/isc-dhcp/Default) + DEPENDS:= @IPV6 + TITLE+= relay (with IPv6) + VARIANT:=ipv6 +endef + +define Package/isc-dhcp-relay/description + provides a means for relaying DHCP and BOOTP requests from a subnet to which + no DHCP server is directly connected to one or more DHCP servers on other + subnets. +endef + +define Package/isc-dhcp-relay-ipv4/description +$(call Package/isc-dhcp-relay-ipv6/description) + This package is compiled with IPv4 support only. +endef + +define Package/isc-dhcp-relay-ipv6/description +$(call Package/isc-dhcp-relay/description) + This package is compiled with IPv4 and IPv6 support. +endef + +define Package/isc-dhcp-client-ipv4 + $(call Package/isc-dhcp/Default) + TITLE+= client (without IPv6) + VARIANT:=ipv4 +endef + +define Package/isc-dhcp-client-ipv6 + $(call Package/isc-dhcp/Default) + DEPENDS:= @IPV6 + TITLE+= client (with IPv6) + VARIANT:=ipv6 +endef + +define Package/isc-dhcp-client/description + provides a means for configuring one or more network interfaces using the + Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols + fail, by statically assigning an address. +endef + +define Package/isc-dhcp-client-ipv4/description +$(call Package/isc-dhcp-client/description) + This package is compiled with IPv4 support only. +endef + +define Package/isc-dhcp-client-ipv6/description +$(call Package/isc-dhcp-client/description) + This package is compiled with IPv4 and IPv6 support. +endef + +define Package/isc-dhcp-server-ipv4 + $(call Package/isc-dhcp/Default) + TITLE+= server (without IPv6) + VARIANT:=ipv4 +endef + +define Package/isc-dhcp-server-ipv6 + $(call Package/isc-dhcp/Default) + DEPENDS:= @IPV6 + TITLE+= server (with IPv6) + VARIANT:=ipv6 +endef + +define Package/isc-dhcp-server/description + implements the Dynamic Host Configuration Protocol (DHCP) and the Internet + Bootstrap Protocol (BOOTP). +endef + +define Package/isc-dhcp-server-ipv4/description +$(call Package/isc-dhcp-server/description) + This package is compiled with IPv4 support only. +endef + +define Package/isc-dhcp-server-ipv6/description +$(call Package/isc-dhcp-server/description) + This package is compiled with IPv4 and IPv6 support. +endef + +define Package/isc-dhcp-omshell-ipv4 + $(call Package/isc-dhcp/Default) + DEPENDS:= +isc-dhcp-server-ipv4 + TITLE+= omshell (without IPv6) + VARIANT:=ipv4 +endef + +define Package/isc-dhcp-omshell-ipv6 + $(call Package/isc-dhcp/Default) + DEPENDS:= @IPV6 +isc-dhcp-server-ipv6 + TITLE+= omshell (with IPv6) + VARIANT:=ipv6 +endef + +define Package/isc-dhcp-omshell/description + provides an interactive way to connect to, query, and possibly change, the ISC + DHCP Server's state via OMAPI, the Object Management API. +endef + +define Package/isc-dhcp-omshell-ipv4/description +$(call Package/isc-dhcp-omshell/description) + This package is compiled with IPv4 support only. +endef + +define Package/isc-dhcp-omshell-ipv6/description +$(call Package/isc-dhcp-omshell/description) + This package is compiled with IPv4 and IPv6 support. +endef + +CONFIGURE_ARGS += \ + --disable-tracing \ + --enable-paranoia \ + --disable-dependency-tracking \ + ac_cv_file__dev_random=yes + +ifeq ($(BUILD_VARIANT),ipv4) + CONFIGURE_ARGS += --disable-dhcpv6 +endif +ifeq ($(BUILD_VARIANT),ipv6) + CONFIGURE_ARGS += --enable-dhcpv6 +endif + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + BUILD_CC="$(HOSTCC_NOCACHE)" \ + host_alias="$(GNU_TARGET_NAME)" \ + target_alias="$(GNU_TARGET_NAME)" \ + build_alias="$(GNU_HOST_NAME)" \ + ac_cv_file__dev_random=yes \ + all install-exec +endef + +define Package/isc-dhcp-relay-$(BUILD_VARIANT)/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcrelay $(1)/usr/sbin +endef + +define Package/isc-dhcp-server-$(BUILD_VARIANT)/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcpd $(1)/usr/sbin + $(INSTALL_BIN) ./files/dhcpd.init $(1)/etc/init.d/dhcpd + $(INSTALL_BIN) ./files/dhcpd.conf $(1)/etc +ifeq ($(BUILD_VARIANT),ipv6) + $(INSTALL_BIN) ./files/dhcpd6.init $(1)/etc/init.d/dhcpd6 + $(INSTALL_BIN) ./files/dhcpd6.conf $(1)/etc +endif +endef + +define Package/isc-dhcp-client-$(BUILD_VARIANT)/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhclient $(1)/usr/sbin + $(INSTALL_BIN) ./files/dhclient-script $(1)/usr/sbin/ + $(INSTALL_BIN) ./files/dhclient.init $(1)/etc/init.d/dhclient +ifeq ($(BUILD_VARIANT),ipv6) + $(INSTALL_BIN) ./files/dhclient6.init $(1)/etc/init.d/dhclient6 + $(INSTALL_BIN) ./files/dhclient6.conf $(1)/etc +endif +endef + +define Package/isc-dhcp-omshell-$(BUILD_VARIANT)/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/omshell $(1)/usr/bin +endef + +$(eval $(call BuildPackage,isc-dhcp-relay-ipv4)) +$(eval $(call BuildPackage,isc-dhcp-server-ipv4)) +$(eval $(call BuildPackage,isc-dhcp-client-ipv4)) +$(eval $(call BuildPackage,isc-dhcp-omshell-ipv4)) +$(eval $(call BuildPackage,isc-dhcp-relay-ipv6)) +$(eval $(call BuildPackage,isc-dhcp-server-ipv6)) +$(eval $(call BuildPackage,isc-dhcp-client-ipv6)) +$(eval $(call BuildPackage,isc-dhcp-omshell-ipv6)) diff --git a/net/isc-dhcp/files/dhclient-script b/net/isc-dhcp/files/dhclient-script new file mode 100644 index 0000000..4afebc0 --- /dev/null +++ b/net/isc-dhcp/files/dhclient-script @@ -0,0 +1,281 @@ +#!/bin/sh + +make_resolv_conf() { + if [ x"$new_domain_name_servers" != x ]; then + cat /dev/null > /etc/resolv.conf.dhclient + chmod 644 /etc/resolv.conf.dhclient + if [ x"$new_domain_search" != x ]; then + echo search $new_domain_search >> /etc/resolv.conf.dhclient + elif [ x"$new_domain_name" != x ]; then + # Note that the DHCP 'Domain Name Option' is really just a domain + # name, and that this practice of using the domain name option as + # a search path is both nonstandard and deprecated. + echo search $new_domain_name >> /etc/resolv.conf.dhclient + fi + for nameserver in $new_domain_name_servers; do + echo nameserver $nameserver >>/etc/resolv.conf.dhclient + done + + elif [ "x${new_dhcp6_name_servers}" != x ] ; then + cat /dev/null > /etc/resolv.conf.dhclient6 + chmod 644 /etc/resolv.conf.dhclient6 + + if [ "x${new_dhcp6_domain_search}" != x ] ; then + echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 + fi + for nameserver in ${new_dhcp6_name_servers} ; do + echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 + done + fi + + # if both v4 and v6 clients are running, concatenate results + cat /etc/resolv.conf.* > /etc/resolv.conf +} + +# Must be used on exit. Invokes the local dhcp client exit hooks, if any. +exit_with_hooks() { + exit_status=$1 + if [ -f /etc/dhclient-exit-hooks ]; then + . /etc/dhclient-exit-hooks + fi +# probably should do something with exit status of the local script + exit $exit_status +} + +# Invoke the local dhcp client enter hooks, if they exist. +if [ -f /etc/dhclient-enter-hooks ]; then + exit_status=0 + . /etc/dhclient-enter-hooks + # allow the local script to abort processing of this state + # local script must set exit_status variable to nonzero. + if [ $exit_status -ne 0 ]; then + exit $exit_status + fi +fi + +### +### DHCPv4 Handlers +### + +if [ x$new_broadcast_address != x ]; then + new_broadcast_arg="broadcast $new_broadcast_address" +fi +if [ x$new_subnet_mask != x ]; then + new_subnet_arg="netmask $new_subnet_mask" +fi +if [ x$alias_subnet_mask != x ]; then + alias_subnet_arg="netmask $alias_subnet_mask" +fi + +if [ x$reason = xMEDIUM ]; then + # Linux doesn't do mediums (ok, ok, media). + exit_with_hooks 0 +fi + +if [ x$reason = xPREINIT ]; then + if [ x$alias_ip_address != x ]; then + # Bring down alias interface. Its routes will disappear too. + ifconfig $interface:0- 0.0.0.0 + fi + ifconfig $interface 0.0.0.0 up + + # We need to give the kernel some time to get the interface up. + sleep 1 + + exit_with_hooks 0 +fi + +if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then + exit_with_hooks 0 +fi + +if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ + [ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then + current_hostname=`hostname` + if [ x$current_hostname = x ] || \ + [ x$current_hostname = x$old_host_name ]; then + if [ x$current_hostname = x ] || \ + [ x$new_host_name != x$old_host_name ]; then + hostname $new_host_name + fi + fi + + if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \ + [ x$alias_ip_address != x$old_ip_address ]; then + # Possible new alias. Remove old alias. + ifconfig $interface:0- 0.0.0.0 + fi + if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then + # IP address changed. Bringing down the interface will delete all routes, + # and clear the ARP cache. + ifconfig $interface 0.0.0.0 down + + fi + if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \ + [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then + + ifconfig $interface $new_ip_address $new_subnet_arg \ + $new_broadcast_arg + for router in $new_routers; do + if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then + route add -host $router dev $interface + fi + route add default gw $router + done + fi + if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; + then + ifconfig $interface:0- 0.0.0.0 + ifconfig $interface:0 $alias_ip_address $alias_subnet_arg + route add -host $alias_ip_address $interface:0 + fi + make_resolv_conf + exit_with_hooks 0 +fi + +if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ] || [ x$reason = xRELEASE ] \ + || [ x$reason = xSTOP ]; then + if [ x$alias_ip_address != x ]; then + # Turn off alias interface. + ifconfig $interface:0- 0.0.0.0 + fi + if [ x$old_ip_address != x ]; then + # Shut down interface, which will delete routes and clear arp cache. + ifconfig $interface 0.0.0.0 down + fi + if [ x$alias_ip_address != x ]; then + ifconfig $interface:0 $alias_ip_address $alias_subnet_arg + route add -host $alias_ip_address $interface:0 + fi + + # remove v4 dns configuration for this interface + rm /etc/resolv.conf.dhclient + cat /etc/resolv.conf.* > /etc/resolv.conf + + exit_with_hooks 0 +fi + +if [ x$reason = xTIMEOUT ]; then + if [ x$alias_ip_address != x ]; then + ifconfig $interface:0- 0.0.0.0 + fi + ifconfig $interface $new_ip_address $new_subnet_arg \ + $new_broadcast_arg + set $new_routers + if ping -q -c 1 $1; then + if [ x$new_ip_address != x$alias_ip_address ] && \ + [ x$alias_ip_address != x ]; then + ifconfig $interface:0 $alias_ip_address $alias_subnet_arg + route add -host $alias_ip_address dev $interface:0 + fi + for router in $new_routers; do + if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then + route add -host $router dev $interface + fi + route add default gw $router + done + make_resolv_conf + exit_with_hooks 0 + fi + ifconfig $interface 0.0.0.0 down + exit_with_hooks 1 +fi + +### +### DHCPv6 Handlers +### + +if [ x$reason = xPREINIT6 ]; then + # Ensure interface is up. + ifconfig ${interface} up + + # Remove any stale addresses from aborted clients. + ip -f inet6 addr flush dev ${interface} scope global + + exit_with_hooks 0 +fi + +if [ x${old_ip6_prefix} != x ] || [ x${new_ip6_prefix} != x ] ; then + echo Prefix ${reason} old=${old_ip6_prefix} new=${new_ip6_prefix} + + exit_with_hooks 0 +fi + +if [ x$reason = xBOUND6 ]; then + if [ x${new_ip6_address} = x ] || [ x${new_ip6_prefixlen} = x ] ; then + exit_with_hooks 2; + fi + + ifconfig ${interface} add ${new_ip6_address}/${new_ip6_prefixlen} + + # Check for nameserver options. + make_resolv_conf + +### << + # Set up softwire tunnel + if [ x${new_dhcp6_softwire} != x ] ; then + /etc/init.d/dhclient stop + ifconfig ${interface} 0.0.0.0 + ip -6 tunnel add tun0 mode ipip6 \ + remote ${new_dhcp6_softwire} \ + local ${new_ip6_address} \ + dev ${interface} encaplimit none + ip link set tun0 up + ip route add default dev tun0 + fi +### >> + + exit_with_hooks 0 +fi + +if [ x$reason = xRENEW6 ] || [ x$reason = xREBIND6 ]; then + if [ x${new_ip6_address} = x ] || [ x${new_ip6_prefixlen} = x ] ; then + exit_with_hooks 2; + fi + + ifconfig ${interface} add ${new_ip6_address}/${new_ip6_prefixlen} + + # Make sure nothing has moved around on us. + + # Nameservers/domains/etc. + if [ "x${new_dhcp6_name_servers}" != "x${old_dhcp6_name_servers}" ] || + [ "x${new_dhcp6_domain_search}" != "x${old_dhcp6_domain_search}" ] ; then + make_resolv_conf + fi + + exit_with_hooks 0 +fi + +if [ x$reason = xDEPREF6 ]; then + if [ x${new_ip6_address} = x ] ; then + exit_with_hooks 2; + fi + + # Busybox ifconfig has no way to communicate this to the kernel, so ignore it + + exit_with_hooks 0 +fi + +if [ x$reason = xEXPIRE6 -o x$reason = xRELEASE6 -o x$reason = xSTOP6 ]; then + if [ x${old_ip6_address} = x ] || [ x${old_ip6_prefixlen} = x ] ; then + exit_with_hooks 2; + fi + + ifconfig ${interface} del ${old_ip6_address}/${old_ip6_prefixlen} + + # remove v6 dns configuration for this interface + rm /etc/resolv.conf.dhclient6 + cat /etc/resolv.conf.* > /etc/resolv.conf + +### << + # Tear down softwire tunnel + if [ x${old_dhcp6_softwire} != x ] ; then + ip link set tun0 down + ip tunnel del tun0 + fi +### >> + + exit_with_hooks 0 +fi + +exit_with_hooks 0 diff --git a/net/isc-dhcp/files/dhclient.init b/net/isc-dhcp/files/dhclient.init new file mode 100644 index 0000000..b5ffb41 --- /dev/null +++ b/net/isc-dhcp/files/dhclient.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common + +START=60 + +lease_file=/var/dhclient.leases +config_file=/etc/dhclient.conf +pid_file=/var/run/dhclient.pid +script_file=/usr/sbin/dhclient-script + +start() { + /usr/sbin/dhclient -q -nw -cf $config_file -lf $lease_file -pf $pid_file -sf $script_file `/sbin/uci get network.wan.ifname` + + if [ $? -ne 0 ]; then + return 1 + fi +} + +stop() { + if [ ! -e $pid_file ]; then + return 1 + fi + + kill -9 `cat $pid_file` + + if [ $? -ne 0 ]; then + return 1 + fi + + rm $pid_file +} diff --git a/net/isc-dhcp/files/dhclient6.conf b/net/isc-dhcp/files/dhclient6.conf new file mode 100644 index 0000000..ab44699 --- /dev/null +++ b/net/isc-dhcp/files/dhclient6.conf @@ -0,0 +1,2 @@ +option dhcp6.softwire code 54 = ip6-address; +also request dhcp6.softwire; diff --git a/net/isc-dhcp/files/dhclient6.init b/net/isc-dhcp/files/dhclient6.init new file mode 100644 index 0000000..630c3f2 --- /dev/null +++ b/net/isc-dhcp/files/dhclient6.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common + +START=60 + +lease_file=/var/dhclient6.leases +config_file=/etc/dhclient6.conf +pid_file=/var/run/dhclient6.pid +script_file=/usr/sbin/dhclient-script + +start() { + /usr/sbin/dhclient -q -nw -6 -cf $config_file -lf $lease_file -pf $pid_file -sf $script_file `/sbin/uci get network.wan.ifname` + + if [ $? -ne 0 ]; then + return 1 + fi +} + +stop() { + if [ ! -e $pid_file ]; then + return 1 + fi + + kill -9 `cat $pid_file` + + if [ $? -ne 0 ]; then + return 1 + fi + + rm $pid_file +} diff --git a/net/isc-dhcp/files/dhcpd.conf b/net/isc-dhcp/files/dhcpd.conf new file mode 100644 index 0000000..11985ce --- /dev/null +++ b/net/isc-dhcp/files/dhcpd.conf @@ -0,0 +1,13 @@ +# dhcpd.conf + +authoritative; + +default-lease-time 3600; +max-lease-time 86400; + +option domain-name-servers 192.168.1.1; + +subnet 192.168.1.0 netmask 255.255.255.0 { + range 192.168.1.10 192.168.1.50; + option routers 192.168.1.1; +} diff --git a/net/isc-dhcp/files/dhcpd.init b/net/isc-dhcp/files/dhcpd.init new file mode 100644 index 0000000..16ef6ae --- /dev/null +++ b/net/isc-dhcp/files/dhcpd.init @@ -0,0 +1,33 @@ +#!/bin/sh /etc/rc.common + +START=65 + +lease_file=/var/dhcpd.leases +config_file=/etc/dhcpd.conf +pid_file=/var/run/dhcpd.pid + +start() { + if [ ! -e $lease_file ]; then + touch $lease_file + fi + + /usr/sbin/dhcpd -q -cf $config_file -lf $lease_file -pf $pid_file $dhcp_ifs + + if [ $? -ne 0 ]; then + return 1 + fi +} + +stop() { + if [ ! -e $pid_file ]; then + return 1 + fi + + kill -9 `cat $pid_file` + + if [ $? -ne 0 ]; then + return 1 + fi + + rm $pid_file +} diff --git a/net/isc-dhcp/files/dhcpd6.conf b/net/isc-dhcp/files/dhcpd6.conf new file mode 100644 index 0000000..1c0baae --- /dev/null +++ b/net/isc-dhcp/files/dhcpd6.conf @@ -0,0 +1,30 @@ +# dhcpd6.conf + +authoritative; + +default-lease-time 3600; +max-lease-time 86400; + +# Enable RFC 5007 support +#allow leasequery; + +# Global definitions for name server address(es) and domain search list +#option dhcp6.name-servers 3ffe:501:ffff:100:200:ff:fe00:3f3e; +#option dhcp6.domain-search "test.example.com","example.com"; + +# Set preference to 255 (maximum) in order to avoid waiting for +# additional servers when there is only one +#option dhcp6.preference 255; + +# Server side command to enable rapid-commit (2 packet exchange) +#option dhcp6.rapid-commit; + +# The delay before information-request refresh +# (minimum is 10 minutes, maximum one day, default is to not refresh) +# (set to 6 hours) +#option dhcp6.info-refresh-time 3600; + +subnet6 3ffe:501:ffff:101::/64 { + # Use the whole /64 prefix for clients + range6 3ffe:501:ffff:101:: /64; +} diff --git a/net/isc-dhcp/files/dhcpd6.init b/net/isc-dhcp/files/dhcpd6.init new file mode 100644 index 0000000..e38e38b --- /dev/null +++ b/net/isc-dhcp/files/dhcpd6.init @@ -0,0 +1,33 @@ +#!/bin/sh /etc/rc.common + +START=65 + +lease_file=/var/dhcpd6.leases +config_file=/etc/dhcpd6.conf +pid_file=/var/run/dhcpd6.pid + +start() { + if [ ! -e $lease_file ]; then + touch $lease_file + fi + + /usr/sbin/dhcpd -q -6 -cf $config_file -lf $lease_file -pf $pid_file $dhcp_ifs + + if [ $? -ne 0 ]; then + return 1 + fi +} + +stop() { + if [ ! -e $pid_file ]; then + return 1 + fi + + kill -9 `cat $pid_file` + + if [ $? -ne 0 ]; then + return 1 + fi + + rm $pid_file +} diff --git a/net/isc-dhcp/patches/000-compile.patch b/net/isc-dhcp/patches/000-compile.patch new file mode 100644 index 0000000..7f96ce0 --- /dev/null +++ b/net/isc-dhcp/patches/000-compile.patch @@ -0,0 +1,24 @@ +--- a/bind/Makefile ++++ b/bind/Makefile +@@ -61,9 +61,12 @@ all: + echo Bind export libraries already installed ; \ + else \ + echo Building BIND Export libraries - this takes some time. ;\ ++ (cd ${bindsrcdir}/lib/export/dns ; \ ++ echo building gen using ${BUILD_CC} in `pwd` ; \ ++ $(MAKE) CC=${BUILD_CC} CFLAGS="-O2" LIBS="" gen) ; \ + (cd ${bindsrcdir}/lib/export ; \ + echo building in `pwd` ; \ +- MAKE=${GMAKE} ${GMAKE} > ${binddir}/build.log) ; \ ++ $(MAKE) DESTDIR="" install > ${binddir}/build.log) ; \ + \ + echo Installing BIND Export libraries to ${binddir}. ; \ + (cd ${bindsrcdir}/lib/export ; \ +@@ -77,6 +80,7 @@ clean: + + # Include the following so that this Makefile is happy when the parent + # tries to use them. ++install-exec: + + distdir: + diff --git a/net/jtg/Makefile b/net/jtg/Makefile new file mode 100644 index 0000000..4498e85 --- /dev/null +++ b/net/jtg/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2006-2009 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:=jtg +PKG_VERSION:=1.95 +PKG_RELEASE:=1 +PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.netlab.tkk.fi/~jmanner/jtg + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/jtg + TITLE:=Jugi's Traffic Generator + SECTION:=net + CATEGORY:=Network + MAINTAINER:=Roberto Riggio + URL:=https://hoslab.cs.helsinki.fi/savane/projects/jtg/ +endef + +define Package/wing/Description + The JTG generator is a simple, yet powerful and, if required, accurate + traffic generator. jtg differs from other traffic generators in that one + instance of a jtg process only sends one stream (e.g. MGEN can send tens + of streams) and the characteristics of the stream are given only with + command line arguments. On the other hand, a receiving jtg process can + be set to loop and receive several streams but, again, only one at a + time. The received packets can be logged and the log files can be + analyzed with jtg_calc (see later in this file for instructions). jtg6 + is the binary for IPv6 networks. +endef + +define Build/Compile + $(MAKE) $(TARGET_CONFIGURE_OPTS) \ + -C $(PKG_BUILD_DIR) +endef + +define Package/jtg/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/jtg $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,jtg)) diff --git a/net/kamailio/Makefile b/net/kamailio/Makefile new file mode 100644 index 0000000..588edba --- /dev/null +++ b/net/kamailio/Makefile @@ -0,0 +1,268 @@ +# +# Copyright (C) 2009 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:=kamailio +PKG_VERSION:=1.5.2 +PKG_RELEASE:=1 +PKG_VARIANT:=-tls + +PKG_SOURCE_URL:=http://www.kamailio.org/pub/kamailio/1.5.2/src/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_VARIANT)_src.tar.gz +PKG_MD5SUM:=26b0d0d3c67c2d981bee86a803cca51f + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)$(PKG_VARIANT) + +PKG_BUILD_DEPENDS:=curl expat libxml2 mysql openldap openssl pcre postgresql radiusclient-ng + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(FPIC) + +define Package/kamailio/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + URL:=http://www.kamailio.org/ +endef + + +define Package/kamailio +$(call Package/kamailio/Default) + TITLE:=Mature and flexible open source SIP server + MENU:=1 +endef + +define Package/kamailio-example +$(call Package/kamailio/Default) + TITLE:=Kamailio example config + DEPENDS:=kamailio \ + +kamailio-mod-acc \ + +kamailio-mod-maxfwd \ + +kamailio-mod-mi-fifo \ + +kamailio-mod-pv \ + +kamailio-mod-registrar \ + +kamailio-mod-rr \ + +kamailio-mod-sl \ + +kamailio-mod-siputils \ + +kamailio-mod-textops \ + +kamailio-mod-tm \ + +kamailio-mod-uri-db \ + +kamailio-mod-usrloc \ + +kamailio-mod-xlog +endef + +define Package/kamailio-example/conffiles +/etc/default/kamailio +/etc/kamailio/kamailio.cfg +endef + + +define Package/kamailio-tools +$(call Package/kamailio/Default) + TITLE:=Kamailio control tools + DEPENDS:=kamailio +endef + +define Package/kamailio-tools/conffiles +/etc/kamailio/kamctlrc +endef + + +PKG_EXCL_MODULES:= \ + auth_diameter \ + carrierroute \ + db_berkeley \ + db_oracle \ + db_unixodbc \ + mediaproxy \ + mi_xmlrpc \ + osp \ + perl \ + perlvdb \ + purple \ + snmpstats \ + +PKG_MAKE_ARGS:= \ + cfg-dir="etc/kamailio/" \ + bin-dir="usr/sbin/" \ + data-dir="var/lib/kamailio/" \ + lib-dir="usr/lib/kamailio/" \ + modules-dir="usr/lib/kamailio/modules/" \ + exclude_modules="$(PKG_EXCL_MODULES)" \ + + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) $(PKG_MAKE_ARGS) \ + prefix=/ \ + extra_defs="-DUSE_PTHREAD_MUTEX " \ + CC="$(TARGET_CC)" \ + ARCH="$(ARCH)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + ISSMP="no" \ + LOCALBASE="$(STAGING_DIR)/usr" \ + SYSBASE="$(STAGING_DIR)/usr" \ + PCREDEFS:="$(TARGET_CPPFLAGS)" \ + PCRELIBS:="$(TARGET_LDFLAGS)" \ + CROSS_COMPILE=1 \ + all + $(MAKE) -C $(PKG_BUILD_DIR) $(PKG_MAKE_ARGS) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install +endef + +define Package/kamailio/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/sbin/kamailio \ + $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/kamailio/modules +endef + +define Package/kamailio-example/install + $(INSTALL_DIR) $(1)/etc/kamailio + $(CP) \ + $(PKG_INSTALL_DIR)/etc/kamailio/kamailio.cfg \ + $(1)/etc/kamailio/ + $(SED) 's,$(PKG_INSTALL_DIR),,g' \ + $(1)/etc/kamailio/kamailio.cfg + $(INSTALL_DIR) $(1)/etc/default + $(INSTALL_DATA) ./files/kamailio.default $(1)/etc/default/kamailio + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/kamailio.init $(1)/etc/init.d/kamailio +endef + +define Package/kamailio-tools/install + $(INSTALL_DIR) $(1)/etc/kamailio + $(CP) \ + $(PKG_INSTALL_DIR)/etc/kamailio/kamctlrc \ + $(1)/etc/kamailio/ + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/sbin/kam{ctl,dbctl,unix} \ + $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/kamailio + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/kamailio/kamctl \ + $(1)/usr/lib/kamailio/ + $(SED) 's,/bin/bash,/bin/sh,g' \ + -e 's,$(PKG_INSTALL_DIR),,g' \ + $(1)/usr/sbin/kam{ctl,dbctl} +endef + +define BuildPlugin + define Package/kamailio-mod-$(1) + $$(call Package/kamailio/Default) + TITLE:= kamailio $(3) module + DEPENDS:=kamailio $$(foreach m,$(4),+kamailio-mod-$$m) $(5) + endef + + define Package/kamailio-mod-$(1)/install + [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/kamailio/modules/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/kamailio/modules/$(2).so \ + $$(1)/usr/lib/kamailio/modules/ ; + endef + + $$(eval $$(call BuildPackage,kamailio-mod-$(1))) +endef + +$(eval $(call BuildPackage,kamailio)) +$(eval $(call BuildPackage,kamailio-example)) +$(eval $(call BuildPackage,kamailio-tools)) +$(eval $(call BuildPlugin,acc,acc,Accounting,tm,)) +$(eval $(call BuildPlugin,alias-db,alias_db,Database-backend aliases,,)) +$(eval $(call BuildPlugin,auth,auth,Authentication Framework,,)) +$(eval $(call BuildPlugin,auth-db,auth_db,Database-backend authentication,auth,)) +#$(eval $(call BuildPlugin,auth-diameter,auth_diameter,Diameter-backend authentication,sl,)) +$(eval $(call BuildPlugin,auth-radius,auth_radius,RADIUS-backend authentication,auth,+libradiusclient-ng)) +$(eval $(call BuildPlugin,avpops,avpops,AVP operation,,)) +$(eval $(call BuildPlugin,benchmark,benchmark,Config benchmark,,)) +#$(eval $(call BuildPlugin,carrierroute,carrierroute,Carrier Routing,,+libconfuse)) +$(eval $(call BuildPlugin,cfgutils,cfgutils,Config utilities,,)) +$(eval $(call BuildPlugin,cpl-c,cpl-c,Call Processing language interpreter,tm sl usrloc,+libxml2)) +#$(eval $(call BuildPlugin,db-berkeley,db_berkeley,Berkeley DB Database-backend,,)) +$(eval $(call BuildPlugin,db-flatstore,db_flatstore,Fast writing-only text database-backed,,)) +$(eval $(call BuildPlugin,db-mysql,db_mysql,MySQL database-backend,,+libmysqlclient)) +#$(eval $(call BuildPlugin,db-oracle,db_oracle,Oracle Database-backend,,)) +$(eval $(call BuildPlugin,db-postgres,db_postgres,PostgreSQL Database-backend,,+libpq)) +$(eval $(call BuildPlugin,db-text,db_text,Text database-backend,,)) +#$(eval $(call BuildPlugin,db-unixodbc,db_unixodbc,UnixODBC Database-backend,,)) +$(eval $(call BuildPlugin,dialog,dialog,Dialog support,rr tm,)) +$(eval $(call BuildPlugin,dialplan,dialplan,Dialplan management,,+libpcre)) +$(eval $(call BuildPlugin,dispatcher,dispatcher,Dispatcher,,)) +$(eval $(call BuildPlugin,diversion,diversion,Diversion header insertion,,)) +$(eval $(call BuildPlugin,domain,domain,Multi-domain support,,)) +$(eval $(call BuildPlugin,domainpolicy,domainpolicy,Domain policy,,)) +$(eval $(call BuildPlugin,enum,enum,ENUM lookup,,)) +$(eval $(call BuildPlugin,exec,exec,External exec,,)) +$(eval $(call BuildPlugin,group,group,Database-backend user-groups,,)) +$(eval $(call BuildPlugin,h350,h350,H.350,ldap,+libopenldap)) +$(eval $(call BuildPlugin,htable,htable,Hash Table,,)) +$(eval $(call BuildPlugin,imc,imc,IM conferencing,db-mysql tm,)) +$(eval $(call BuildPlugin,jabber,jabber,Jabber,tm,+libexpat)) +$(eval $(call BuildPlugin,lcr,lcr,Least Cost Routing,tm,+libpcre)) +$(eval $(call BuildPlugin,ldap,ldap,LDAP connector,,+libopenldap)) +$(eval $(call BuildPlugin,maxfwd,maxfwd,Max-Forward processor,,)) +$(eval $(call BuildPlugin,mi-datagram,mi_datagram,Datagram support for Management Interface,,)) +$(eval $(call BuildPlugin,mi-fifo,mi_fifo,FIFO support for Management Interface,,)) +#$(eval $(call BuildPlugin,mi-xmlrpc,mi_xmlrpc,XML-RPC support for Management Interface,,+xmlrpc-c)) +#$(eval $(call BuildPlugin,mediaproxy,mediaproxy,NAT traversal,,+mediaproxy)) +$(eval $(call BuildPlugin,misc_radius,misc_radius,Generic RADIUS,,+libradiusclient-ng)) +$(eval $(call BuildPlugin,msilo,msilo,SIP message silo,tm,)) +$(eval $(call BuildPlugin,nat_traversal,nat_traversal,NAT traversal,dialog sl tm,)) +$(eval $(call BuildPlugin,nathelper,nathelper,NAT traversal helper,,+rtpproxy)) +#$(eval $(call BuildPlugin,osp,osp,OSP peering,auth rr sl tm textops,+libosp)) +$(eval $(call BuildPlugin,path,path,SIP path insertion,rr,)) +$(eval $(call BuildPlugin,pdt,pdt,Prefix-to-Domain translator,,)) +$(eval $(call BuildPlugin,peering,peering,Perring,,+libradiusclient-ng)) +#$(eval $(call BuildPlugin,perl,perl,Perl,sl,+perl)) +#$(eval $(call BuildPlugin,perlvdb,perlvdb,Perl Virtual DB,perl,)) +$(eval $(call BuildPlugin,permissions,permissions,Permissions control,,)) +$(eval $(call BuildPlugin,pike,pike,Flood detector,,)) +$(eval $(call BuildPlugin,presence,presence,Presence server,sl tm,+libxml2)) +$(eval $(call BuildPlugin,presence-dialoginfo,presence_dialoginfo,Dialog Event presence,presence,)) +$(eval $(call BuildPlugin,presence-mwi,presence_mwi,Message Waiting Indication presence,presence,)) +$(eval $(call BuildPlugin,presence-xml,presence_xml,XCAP presence,presence xcap-client,)) +$(eval $(call BuildPlugin,pua,pua,Presence User Agent,tm,+libxml2)) +$(eval $(call BuildPlugin,pua-bla,pua_bla,Bridged Line Appearence PUA,presence pua usrloc,)) +$(eval $(call BuildPlugin,pua-dialoginfo,pua_dialoginfo,Dialog Event PUA,dialog pua,)) +$(eval $(call BuildPlugin,pua-mi,pua_mi,PUA Management Interface,pua,)) +$(eval $(call BuildPlugin,pua-usrloc,pua_usrloc,PUA User Location,pua usrloc,)) +$(eval $(call BuildPlugin,pua-xmpp,pua_xmpp,PUA XMPP,presence pua xmpp,)) +#$(eval $(call BuildPlugin,purple,purple,Multi-protocol IM gateway,presence pua,+libpurple)) +$(eval $(call BuildPlugin,pv,pv,Pseudo-Variables,,)) +$(eval $(call BuildPlugin,qos,qos,QoS control,dialog,)) +$(eval $(call BuildPlugin,ratelimit,ratelimit,Traffic shapping,,)) +$(eval $(call BuildPlugin,regex,regex,Regular Expression,,+libpcre)) +$(eval $(call BuildPlugin,registrar,registrar,SIP Registrar,usrloc,)) +$(eval $(call BuildPlugin,rls,rls,Resource List Server,presence pua tm,+libxml2)) +$(eval $(call BuildPlugin,rr,rr,Record-Route and Route,,)) +$(eval $(call BuildPlugin,rtimer,rtimer,Routing Timer,,)) +$(eval $(call BuildPlugin,sanity,sanity,SIP sanity checks,sl,)) +#$(eval $(call BuildPlugin,seas,seas,SIP Express Application Server,tm,)) +$(eval $(call BuildPlugin,siptrace,siptrace,SIP trace,,)) +$(eval $(call BuildPlugin,siputils,siputils,SIP utilities,sl,)) +$(eval $(call BuildPlugin,sl,sl,Stateless replier,,)) +$(eval $(call BuildPlugin,sms,sms,SIP-to-SMS IM gateway,tm,)) +#$(eval $(call BuildPlugin,snmpstats,snmpstats,SNMP,presence usrloc,+libnetsnmp)) +$(eval $(call BuildPlugin,speeddial,speeddial,Per-user speed-dial controller,,)) +$(eval $(call BuildPlugin,sqlops,sqlops,SQL operations,,)) +$(eval $(call BuildPlugin,statistics,statistics,Script statistics,,)) +$(eval $(call BuildPlugin,sst,sst,SIP Session Timer,dialog sl,)) +$(eval $(call BuildPlugin,textops,textops,Text operations,,)) +$(eval $(call BuildPlugin,tlsops,tlsops,TLS operations,,+libopenssl)) +$(eval $(call BuildPlugin,tm,tm,Transaction,,)) +$(eval $(call BuildPlugin,uac,uac,User Agent Client,tm,)) +$(eval $(call BuildPlugin,uac-redirect,uac_redirect,User Agent Client redirection,tm,)) +$(eval $(call BuildPlugin,uri-db,uri_db,Database-backend SIP URI checking,,)) +$(eval $(call BuildPlugin,userblacklist,userblacklist,User blacklists,,)) +$(eval $(call BuildPlugin,usrloc,usrloc,User location,,)) +$(eval $(call BuildPlugin,utils,utils,Misc utilities,,+libcurl)) +$(eval $(call BuildPlugin,xcap-client,xcap_client,XCAP Client,,+libcurl)) +$(eval $(call BuildPlugin,xlog,xlog,Advanced logger,,)) +$(eval $(call BuildPlugin,xmpp,xmpp,SIP-to-XMPP Gateway,tm,+libexpat)) diff --git a/net/kamailio/files/kamailio.default b/net/kamailio/files/kamailio.default new file mode 100644 index 0000000..a61617b --- /dev/null +++ b/net/kamailio/files/kamailio.default @@ -0,0 +1,13 @@ +# OPTIONS +# -n COUNT +# Specifies the number of children processes forked per interface +# -N COUNT +# Specifies the number of children processes forked to handle tcp incoming connections +# -m SIZE +# Size of the shared memory which will be allocated (in Megabytes). +# -u UID +# Changes the user id under which +# -g GID +# Changes the group id under which + +OPTIONS="-n 4 -m 4 - m 8" diff --git a/net/kamailio/files/kamailio.init b/net/kamailio/files/kamailio.init new file mode 100755 index 0000000..1f42a9e --- /dev/null +++ b/net/kamailio/files/kamailio.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009 OpenWrt.org +START=50 + +BIN=kamailio +DEFAULT=/etc/default/$BIN +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid + +start() { + [ -f $DEFAULT ] && . $DEFAULT + mkdir -p $RUN_D + $BIN -P $PID_F $OPTIONS >/dev/null 2>&1 +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) +} + diff --git a/net/kamailio/patches/005-config_h.patch b/net/kamailio/patches/005-config_h.patch new file mode 100644 index 0000000..a641b3a --- /dev/null +++ b/net/kamailio/patches/005-config_h.patch @@ -0,0 +1,20 @@ +--- a/config.h ++++ b/config.h +@@ -48,7 +48,7 @@ + + #define MAX_LISTEN 16 /*!< maximum number of addresses on which we will listen */ + +-#define CHILD_NO 8 /*!< default number of child processes started */ ++#define CHILD_NO 4 /*!< default number of child processes started */ + + #ifndef RT_NO + #define RT_NO 80 /*!< routing tables number */ +@@ -119,7 +119,7 @@ + #define PKG_MEM_POOL_SIZE 4*1024*1024 /*!< Used only if PKG_MALLOC is defined*/ + #endif + +-#define SHM_MEM_SIZE 32 /*!< Used if SH_MEM is defined*/ ++#define SHM_MEM_SIZE 8 /*!< Used if SH_MEM is defined*/ + + #define TIMER_TICK 1 /*!< one second */ + #define UTIMER_TICK 100*1000 /*!< 100 miliseconds*/ diff --git a/net/kamailio/patches/007-modules_build.patch b/net/kamailio/patches/007-modules_build.patch new file mode 100644 index 0000000..3fac163 --- /dev/null +++ b/net/kamailio/patches/007-modules_build.patch @@ -0,0 +1,137 @@ +--- a/modules/carrierroute/Makefile ++++ b/modules/carrierroute/Makefile +@@ -12,10 +12,8 @@ NAME=carrierroute.so + BUILDER = $(shell which confuse-config) + + ifeq ($(BUILDER),) +- CONFUSEDEFS=-I$(LOCALBASE)/include -I/usr/local/include -I/opt/include \ +- -I/usr/sfw/include +- CONFUSELIBS=-L$(LOCALBASE)/lib -L/usr/local/lib -L/usr/sfw/lib \ +- -L/opt/lib -lconfuse ++ CONFUSEDEFS=-I$(LOCALBASE)/include ++ CONFUSELIBS=-L$(LOCALBASE)/lib + else + CONFUSEDEFS = $(shell confuse-config --cflags) + CONFUSELIBS = $(shell confuse-config --libs) +--- a/modules/h350/Makefile ++++ b/modules/h350/Makefile +@@ -9,7 +9,8 @@ include ../../Makefile.defs + + auto_gen= + NAME=h350.so +-LIBS= ++ + DEFS+=-I$(LOCALBASE)/include ++LIBS=-L$(LOCALBASE)/lib -lldap + + include ../../Makefile.modules +--- a/modules/ldap/Makefile ++++ b/modules/ldap/Makefile +@@ -12,8 +12,8 @@ include ../../Makefile.defs + auto_gen= + NAME=ldap.so + +-LIBS=-L$(LOCALBASE)/lib -lldap + DEFS+=-I$(LOCALBASE)/include ++LIBS=-L$(LOCALBASE)/lib -lldap + + ifeq ($(OS),solaris) + DEFS+=-I$(LOCALBASE)/include -I/usr/sfw/include -I/usr/local/include -I/opt/sfw/include -I/opt/csw/include +--- a/modules/pua_bla/Makefile ++++ b/modules/pua_bla/Makefile +@@ -9,8 +9,8 @@ include ../../Makefile.defs + auto_gen= + NAME=pua_bla.so + LIBS= +-DEFS+=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 -I$(LOCALBASE)/include +-LIBS+=-L/usr/include/lib -L$(LOCALBASE)/lib -lxml2 ++DEFS+=-I$(LOCALBASE)/include/libxml2 -I$(LOCALBASE)/include ++LIBS+=-L$(LOCALBASE)/lib -lxml2 + + include ../../Makefile.modules + +--- a/modules/pua_xmpp/Makefile ++++ b/modules/pua_xmpp/Makefile +@@ -10,7 +10,7 @@ auto_gen= + NAME= pua_xmpp.so + LIBS= + +-DEFS+=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 -I$(LOCALBASE)/include +-LIBS+=-L/usr/include/lib -L$(LOCALBASE)/lib -lxml2 ++DEFS+=-I$(LOCALBASE)/include/libxml2 -I$(LOCALBASE)/include ++LIBS+=-L$(LOCALBASE)/lib -lxml2 + + include ../../Makefile.modules +--- a/modules/regex/Makefile ++++ b/modules/regex/Makefile +@@ -7,10 +7,8 @@ NAME=regex.so + BUILDER = $(shell which pcre-config) + + ifeq ($(BUILDER),) +- PCREDEFS=-I$(LOCALBASE)/include -I/usr/local/include -I/opt/include \ +- -I/usr/sfw/include +- PCRELIBS=-L$(LOCALBASE)/lib -L/usr/local/lib -L/usr/sfw/lib \ +- -L/opt/lib -lpcre ++ PCREDEFS=-I$(LOCALBASE)/include ++ PCRELIBS=-L$(LOCALBASE)/lib -lpcre + else + PCREDEFS = $(shell pcre-config --cflags) + PCRELIBS = $(shell pcre-config --libs) +--- a/modules/tlsops/Makefile ++++ b/modules/tlsops/Makefile +@@ -7,8 +7,8 @@ auto_gen= + NAME=tlsops.so + LIBS= + +-DEFS+= -I$(LOCALBASE)/ssl/include +-LIBS+= -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib -lssl -lcrypto ++DEFS+= -I$(LOCALBASE)/include ++LIBS+= -L$(LOCALBASE)/lib -lssl -lcrypto + + include ../../Makefile.modules + +--- a/modules/dialplan/Makefile ++++ b/modules/dialplan/Makefile +@@ -9,10 +9,8 @@ NAME=dialplan.so + BUILDER = $(shell which pcre-config) + + ifeq ($(BUILDER),) +- PCREDEFS=-I$(LOCALBASE)/include -I/usr/local/include -I/opt/include \ +- -I/usr/sfw/include +- PCRELIBS=-L$(LOCALBASE)/lib -L/usr/local/lib -L/usr/sfw/lib \ +- -L/opt/lib -lpcre ++ PCREDEFS=-I$(LOCALBASE)/include ++ PCRELIBS=-L$(LOCALBASE)/lib -lpcre + else + PCREDEFS = $(shell pcre-config --cflags) + PCRELIBS = $(shell pcre-config --libs) +--- a/modules/lcr/Makefile ++++ b/modules/lcr/Makefile +@@ -11,10 +11,8 @@ NAME=lcr.so + BUILDER = $(shell which pcre-config) + + ifeq ($(BUILDER),) +- PCREDEFS=-I$(LOCALBASE)/include -I/usr/local/include -I/opt/include \ +- -I/usr/sfw/include +- PCRELIBS=-L$(LOCALBASE)/lib -L/usr/local/lib -L/usr/sfw/lib \ +- -L/opt/lib -lpcre ++ PCREDEFS=-I$(LOCALBASE)/include ++ PCRELIBS=-L$(LOCALBASE)/lib -lpcre + else + PCREDEFS = $(shell pcre-config --cflags) + PCRELIBS = $(shell pcre-config --libs) +--- a/modules/purple/Makefile ++++ b/modules/purple/Makefile +@@ -3,9 +3,9 @@ auto_gen= + NAME=purple.so + LIBS= + +-DEFS+=-I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 \ +- -I/usr/include/libxml2 +-LIBS+=-lglib-2.0 -lpurple -lxml2 ++DEFS+=-I$(LOCALBASE)/include/glib-2.0/include -I$(LOCALBASE)/include/glib-2.0 \ ++ -I$(LOCALBASE)/incldue/libxml2 ++LIBS+=-L$(LOCALBASE)/lib -lglib-2.0 -lpurple -lxml2 + + + include ../../Makefile.modules diff --git a/net/kamailio3/Makefile b/net/kamailio3/Makefile new file mode 100644 index 0000000..1702545 --- /dev/null +++ b/net/kamailio3/Makefile @@ -0,0 +1,284 @@ +# +# Copyright (C) 2012 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:=kamailio3 +PKG_VERSION:=3.3.0 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=http://www.kamailio.org/pub/kamailio/$(PKG_VERSION)/src/ +PKG_SOURCE:=kamailio-$(PKG_VERSION)$(PKG_VARIANT)_src.tar.gz +PKG_MD5SUM:=c5261066b5c8b617b6a9408679ad514f + +INCL_MODULES:= +KAM_MODULES:= + +include $(INCLUDE_DIR)/nls.mk +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(FPIC) +PREBUILT_STAMP=$(STAGING_DIR)/stamp/.$(PKG_NAME)_prebuilt +TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components 1 $(TAR_OPTIONS) + +define Package/kamailio3/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + URL:=http://www.kamailio.org/ + DEPENDS:=$(ICONV_DEPENDS) +libncurses +libpthread +libreadline +endef + +define Package/kamailio3 +$(call Package/kamailio3/Default) + TITLE:=Mature and flexible open source SIP server version 3.x + MENU:=1 +endef + +define Package/kamailio3-example +$(call Package/kamailio3/Default) + TITLE:=Kamailio3 example config + DEPENDS:=kamailio3 \ + +kamailio3-mod-acc \ + +kamailio3-mod-maxfwd \ + +kamailio3-mod-mi-fifo \ + +kamailio3-mod-pv \ + +kamailio3-mod-registrar \ + +kamailio3-mod-rr \ + +kamailio3-mod-sl \ + +kamailio3-mod-siputils \ + +kamailio3-mod-textops \ + +kamailio3-mod-tm \ + +kamailio3-mod-uri-db \ + +kamailio3-mod-usrloc \ + +kamailio3-mod-xlog +endef + +define Package/kamailio3-example/conffiles +/etc/default/kamailio +/etc/kamailio/kamailio.cfg +endef + +define Package/kamailio3-tools +$(call Package/kamailio3/Default) + TITLE:=Kamailio3 control tools + DEPENDS:=kamailio3 +bash +endef + +define Package/kamailio3-tools/conffiles +/etc/kamailio/kamctlrc +endef + +define Package/kamailio3/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/sbin/kamailio \ + $(1)/usr/sbin/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/sbin/sercmd \ + $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/kamailio/modules + $(INSTALL_DIR) $(1)/usr/lib/kamailio/modules_k + $(INSTALL_DIR) $(1)/usr/lib/kamailio/modules_s + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/kamailio/lib*.so* \ + $(1)/usr/lib/kamailio/ +endef + +define Package/kamailio3-example/install + $(INSTALL_DIR) $(1)/etc/kamailio + $(CP) \ + $(PKG_INSTALL_DIR)/etc/kamailio/kamailio.cfg \ + $(1)/etc/kamailio/ + $(SED) 's,$(PKG_INSTALL_DIR),,g' \ + $(1)/etc/kamailio/kamailio.cfg + $(SED) 's,//lib/kamailio,/usr/lib/kamailio,g' \ + $(1)/etc/kamailio/kamailio.cfg + $(INSTALL_DIR) $(1)/etc/default + $(INSTALL_DATA) ./files/kamailio.default $(1)/etc/default/kamailio + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/kamailio.init $(1)/etc/init.d/kamailio +endef + +define Package/kamailio3-tools/install + $(INSTALL_DIR) $(1)/etc/kamailio + $(CP) \ + $(PKG_BUILD_DIR)/utils/kamctl/kamctlrc \ + $(1)/etc/kamailio/ + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/sbin/kam{ctl,dbctl} \ + $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/kamailio + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/kamailio/kamctl \ + $(1)/usr/lib/kamailio/ +endef + +define BuildPlugin + define Package/kamailio3-mod-$(1) + $$(call Package/kamailio3/Default) + TITLE:= kamailio3 $(3) module + DEPENDS:=kamailio3 $$(foreach m,$(4),+kamailio3-mod-$$m) $(5) + endef + + define Package/kamailio3-mod-$(1)/install + [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/kamailio/$(6) + $(CP) $(PKG_INSTALL_DIR)/usr/lib/kamailio/$(6)/$(2).so \ + $$(1)/usr/lib/kamailio/$(6)/ ; + endef + + INCL_MODULES+=$(2) + KAM_MODULES+=kamailio3-mod-$(1) +endef + +$(eval $(call BuildPlugin,acc,acc,Accounting,tm,,modules_k)) +$(eval $(call BuildPlugin,acc-radius,acc_radius,Accounting for RADIUS backend,acc,+libradiusclient-ng,modules_k)) +$(eval $(call BuildPlugin,alias-db,alias_db,Database-backend aliases,db-sqlite,,modules_k)) +$(eval $(call BuildPlugin,auth,auth,Authentication Framework,,,modules)) +$(eval $(call BuildPlugin,auth-db,auth_db,Database-backend authentication,auth db-sqlite,,modules_k)) +#$(eval $(call BuildPlugin,auth-diameter,auth_diameter,Diameter-backend authentication,sl,,modules_k)) +$(eval $(call BuildPlugin,auth-radius,auth_radius,RADIUS-backend authentication,auth,+libradiusclient-ng,modules_k)) +$(eval $(call BuildPlugin,avpops,avpops,AVP operation,,,modules)) +$(eval $(call BuildPlugin,benchmark,benchmark,Config benchmark,,,modules_k)) +#$(eval $(call BuildPlugin,carrierroute,carrierroute,Carrier Routing,,+libconfuse,modules)) +$(eval $(call BuildPlugin,cfgutils,cfgutils,Config utilities,,,modules_k)) +$(eval $(call BuildPlugin,cfg-db,cfg_db,Load core and module parameters from database,db-sqlite,,modules)) +$(eval $(call BuildPlugin,cfg-rpc,cfg_rpc,Update core and module parameters at runtime via RPC interface,,,modules)) +#$(eval $(call BuildPlugin,cpl-c,cpl-c,Call Processing language interpreter,tm sl usrloc,+libxml2,modules_k)) +$(eval $(call BuildPlugin,ctl,ctl,BINRPC transport interface,,,modules)) +#$(eval $(call BuildPlugin,db-berkeley,db_berkeley,Berkeley DB Database-backend,,,modules)) +$(eval $(call BuildPlugin,db-flatstore,db_flatstore,Fast writing-only text database-backed,,,modules)) +$(eval $(call BuildPlugin,db-mysql,db_mysql,MySQL database-backend,,+libmysqlclient,modules)) +#$(eval $(call BuildPlugin,db-oracle,db_oracle,Oracle Database-backend,,,modules_k)) +#$(eval $(call BuildPlugin,db-postgres,db_postgres,PostgreSQL Database-backend,,+libpq,modules)) +$(eval $(call BuildPlugin,db-sqlite,db_sqlite,Sqlite DB support,,+libsqlite3,modules_k)) +$(eval $(call BuildPlugin,db-text,db_text,Text database-backend,,,modules_k)) +$(eval $(call BuildPlugin,db-unixodbc,db_unixodbc,UnixODBC Database-backend,,+unixodbc,modules_k)) +$(eval $(call BuildPlugin,dialog,dialog,Dialog support,rr tm,,modules_k)) +$(eval $(call BuildPlugin,dialplan,dialplan,Dialplan management,,+libpcre,modules)) +$(eval $(call BuildPlugin,dispatcher,dispatcher,Dispatcher,,,modules_s)) +$(eval $(call BuildPlugin,diversion,diversion,Diversion header insertion,,,modules_s)) +$(eval $(call BuildPlugin,domain,domain,Multi-domain support,,,modules_k)) +$(eval $(call BuildPlugin,domainpolicy,domainpolicy,Domain policy,,,modules_k)) +$(eval $(call BuildPlugin,enum,enum,ENUM lookup,,,modules)) +$(eval $(call BuildPlugin,exec,exec,External exec,,,modules_k)) +$(eval $(call BuildPlugin,group,group,Database-backend user-groups,,,modules_k)) +$(eval $(call BuildPlugin,h350,h350,H.350,ldap,+libopenldap,modules_k)) +$(eval $(call BuildPlugin,htable,htable,Hash Table,,,modules_k)) +$(eval $(call BuildPlugin,imc,imc,IM conferencing,db-mysql tm,,modules_k)) +$(eval $(call BuildPlugin,ipops,ipops,IP and IPv6 operations module,,,modules)) +$(eval $(call BuildPlugin,kex,kex,Core extensions,,,modules_k)) +$(eval $(call BuildPlugin,lcr,lcr,Least Cost Routing,tm,+libpcre,modules)) +$(eval $(call BuildPlugin,ldap,ldap,LDAP connector,,+libopenldap,modules_k)) +$(eval $(call BuildPlugin,maxfwd,maxfwd,Max-Forward processor,,,modules_k)) +$(eval $(call BuildPlugin,mediaproxy,mediaproxy,Automatic NAT traversal,dialog,,modules)) +$(eval $(call BuildPlugin,mi-datagram,mi_datagram,Datagram support for Management Interface,,,modules_k)) +$(eval $(call BuildPlugin,mi-fifo,mi_fifo,FIFO support for Management Interface,,,modules_k)) +#$(eval $(call BuildPlugin,mi-xmlrpc,mi_xmlrpc,XML-RPC support for Management Interface,,+xmlrpc-c,modules_k)) +$(eval $(call BuildPlugin,mi-rpc,mi_rpc,RPC support for Management Interface,,,modules)) +$(eval $(call BuildPlugin,misc_radius,misc_radius,Generic RADIUS,,+libradiusclient-ng,modules_k)) +$(eval $(call BuildPlugin,msilo,msilo,SIP message silo,tm,,modules_k)) +$(eval $(call BuildPlugin,nat_traversal,nat_traversal,NAT traversal,dialog sl tm,,modules_k)) +$(eval $(call BuildPlugin,nathelper,nathelper,NAT traversal helper,,+rtpproxy,modules_k)) +#$(eval $(call BuildPlugin,osp,osp,OSP peering,auth rr sl tm textops,+libosp,modules_k)) +$(eval $(call BuildPlugin,path,path,SIP path insertion,rr,,modules_k)) +$(eval $(call BuildPlugin,pdt,pdt,Prefix-to-Domain translator,,,modules_k)) +$(eval $(call BuildPlugin,peering,peering,Perring,,+libradiusclient-ng,modules)) +#$(eval $(call BuildPlugin,perl,perl,Perl,sl,+perl,modules_k)) +#$(eval $(call BuildPlugin,perlvdb,perlvdb,Perl Virtual DB,perl,,modules_k)) +$(eval $(call BuildPlugin,permissions,permissions,Permissions control,,,modules_k)) +$(eval $(call BuildPlugin,pike,pike,Flood detector,,,modules_k)) +$(eval $(call BuildPlugin,presence,presence,Presence server,sl tm,+libxml2,modules_k)) +$(eval $(call BuildPlugin,presence-dialoginfo,presence_dialoginfo,Dialog Event presence,presence,,modules_k)) +$(eval $(call BuildPlugin,presence-mwi,presence_mwi,Message Waiting Indication presence,presence,,modules_k)) +$(eval $(call BuildPlugin,presence-xml,presence_xml,XCAP presence,presence xcap-client,,modules_k)) +$(eval $(call BuildPlugin,pua,pua,Presence User Agent,tm,+libxml2,modules_k)) +$(eval $(call BuildPlugin,pua-bla,pua_bla,Bridged Line Appearence PUA,presence pua usrloc,,modules_k)) +$(eval $(call BuildPlugin,pua-dialoginfo,pua_dialoginfo,Dialog Event PUA,dialog pua,,modules_k)) +$(eval $(call BuildPlugin,pua-mi,pua_mi,PUA Management Interface,pua,,modules_k)) +$(eval $(call BuildPlugin,pua-usrloc,pua_usrloc,PUA User Location,pua usrloc,,modules_k)) +$(eval $(call BuildPlugin,pua-xmpp,pua_xmpp,PUA XMPP,presence pua xmpp,,modules_k)) +#$(eval $(call BuildPlugin,purple,purple,Multi-protocol IM gateway,presence pua,+libpurple,modules_k)) +$(eval $(call BuildPlugin,pv,pv,Pseudo-Variables,,,modules_k)) +$(eval $(call BuildPlugin,qos,qos,QoS control,dialog,,modules_k)) +$(eval $(call BuildPlugin,ratelimit,ratelimit,Traffic shapping,,,modules)) +$(eval $(call BuildPlugin,regex,regex,Regular Expression,,+libpcre,modules_k)) +$(eval $(call BuildPlugin,registrar,registrar,SIP Registrar,usrloc,,modules_k)) +$(eval $(call BuildPlugin,rls,rls,Resource List Server,presence pua tm,+libxml2,modules_k)) +$(eval $(call BuildPlugin,rr,rr,Record-Route and Route,,,modules_k)) +$(eval $(call BuildPlugin,rtimer,rtimer,Routing Timer,,,modules_k)) +$(eval $(call BuildPlugin,sanity,sanity,SIP sanity checks,sl,,modules)) +#$(eval $(call BuildPlugin,seas,seas,SIP Express Application Server,tm,,modules_k)) +$(eval $(call BuildPlugin,sipcapture,sipcapture,SIP capture module,,,modules)) +$(eval $(call BuildPlugin,siptrace,siptrace,SIP trace,,,modules_k)) +$(eval $(call BuildPlugin,siputils,siputils,SIP utilities,sl,,modules_k)) +$(eval $(call BuildPlugin,sl,sl,Stateless replier,,,modules)) +$(eval $(call BuildPlugin,sms,sms,SIP-to-SMS IM gateway,tm,,modules)) +#$(eval $(call BuildPlugin,snmpstats,snmpstats,SNMP,presence usrloc,+libnetsnmp,modules_k)) +$(eval $(call BuildPlugin,speeddial,speeddial,Per-user speed-dial controller,,,modules_k)) +$(eval $(call BuildPlugin,sqlops,sqlops,SQL operations,,,modules_k)) +$(eval $(call BuildPlugin,statistics,statistics,Script statistics,,,modules_k)) +$(eval $(call BuildPlugin,sst,sst,SIP Session Timer,dialog sl,,modules_k)) +$(eval $(call BuildPlugin,textops,textops,Text operations,,,modules_k)) +$(eval $(call BuildPlugin,tls,tls,TLS operations,,+libopenssl,modules)) +$(eval $(call BuildPlugin,tm,tm,Transaction,,,modules)) +$(eval $(call BuildPlugin,tmx,tmx,Transaction module extensions,,,modules_k)) +$(eval $(call BuildPlugin,uac,uac,User Agent Client,tm,,modules_k)) +$(eval $(call BuildPlugin,uac-redirect,uac_redirect,User Agent Client redirection,tm,,modules_k)) +$(eval $(call BuildPlugin,uri-db,uri_db,Database-backend SIP URI checking,,,modules_k)) +$(eval $(call BuildPlugin,userblacklist,userblacklist,User blacklists,,,modules_k)) +$(eval $(call BuildPlugin,usrloc,usrloc,User location,,,modules_k)) +$(eval $(call BuildPlugin,utils,utils,Misc utilities,,+libcurl +libxml2,modules)) +$(eval $(call BuildPlugin,xcap-client,xcap_client,XCAP Client,,+libcurl,modules_k)) +$(eval $(call BuildPlugin,xlog,xlog,Advanced logger,,,modules_k)) +$(eval $(call BuildPlugin,xmpp,xmpp,SIP-to-XMPP Gateway,tm,+libexpat,modules_k)) + +PKG_MAKE_ARGS:= \ + cfg-dir="/etc/kamailio/" \ + bin-dir="/usr/sbin/" \ + data-dir="/var/lib/kamailio/" \ + lib-dir="/usr/lib/kamailio/" \ + modules-dir="/usr/lib/kamailio/modules/" \ + include_modules="$(INCL_MODULES)" \ + $(KAM3_EXTRA_ARGS) \ + TLS_HOOKS=1 extra_defs="-DUSE_PTHREAD_MUTEX " \ + CFLAGS="$(TARGET_CFLAGS)" \ + ISSMP="no" \ + LOCALBASE="$(STAGING_DIR)/usr" \ + SYSBASE="$(STAGING_DIR)/usr" \ + PCREDEFS:="$(TARGET_CPPFLAGS)" \ + PCRELIBS:="$(TARGET_LDFLAGS)" \ + cfg_target:=/etc/kamailio/ \ + PREFIX:=/usr \ + prefix:=/usr quiet=verbose + +define Build/Compile + if ! [ -f $(PREBUILT_STAMP) ]; then echo $(MAKE) -C $(PKG_BUILD_DIR) $(PKG_MAKE_ARGS) \ + CC="$(TARGET_CC)" \ + ARCH="$(ARCH)" \ + EXTRA_LIBS=-L$(STAGING_DIR)/usr/lib/ \ + all && touch $(PREBUILT_STAMP); \ + fi + $(MAKE) -C $(PKG_BUILD_DIR) $(PKG_MAKE_ARGS) \ + CC="$(TARGET_CC)" \ + ARCH="$(ARCH)" \ + DESTDIR=$(PKG_INSTALL_DIR) \ + prefix=/ \ + install-cfg + $(MAKE) -C $(PKG_BUILD_DIR) $(PKG_MAKE_ARGS) \ + CC="$(TARGET_CC)" \ + ARCH="$(ARCH)" \ + DESTDIR=$(PKG_INSTALL_DIR) \ + prefix=/usr \ + install-bin install-modules-all install-utils +endef + +$(eval $(call BuildPackage,kamailio3)) +$(eval $(call BuildPackage,kamailio3-example)) +$(eval $(call BuildPackage,kamailio3-tools)) +$(foreach m,$(KAM_MODULES),$(eval $(call BuildPackage,$(m)))) diff --git a/net/kamailio3/files/kamailio.default b/net/kamailio3/files/kamailio.default new file mode 100644 index 0000000..a61617b --- /dev/null +++ b/net/kamailio3/files/kamailio.default @@ -0,0 +1,13 @@ +# OPTIONS +# -n COUNT +# Specifies the number of children processes forked per interface +# -N COUNT +# Specifies the number of children processes forked to handle tcp incoming connections +# -m SIZE +# Size of the shared memory which will be allocated (in Megabytes). +# -u UID +# Changes the user id under which +# -g GID +# Changes the group id under which + +OPTIONS="-n 4 -m 4 - m 8" diff --git a/net/kamailio3/files/kamailio.init b/net/kamailio3/files/kamailio.init new file mode 100644 index 0000000..5a382ae --- /dev/null +++ b/net/kamailio3/files/kamailio.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2012 OpenWrt.org +START=99 +APP=kamailio +BIN_FILE="/usr/sbin/"$APP +PID_FILE="/var/run/"$APP".pid" + +start() { + start-stop-daemon -S -x $BIN_FILE -p $PID_FILE -b -m +} + +stop() { + start-stop-daemon -K -x $BIN_FILE -p $PID_FILE -q + rm -rf $PID_FILE +} diff --git a/net/kamailio3/patches/100-cross_compile.patch b/net/kamailio3/patches/100-cross_compile.patch new file mode 100644 index 0000000..963a607 --- /dev/null +++ b/net/kamailio3/patches/100-cross_compile.patch @@ -0,0 +1,13 @@ +Index: kamailio3-3.3.0/modules_s/ldap/Makefile +=================================================================== +--- kamailio3-3.3.0.orig/modules_s/ldap/Makefile 2012-08-14 17:14:01.000000000 +0200 ++++ kamailio3-3.3.0/modules_s/ldap/Makefile 2012-08-14 17:14:12.000000000 +0200 +@@ -14,7 +14,7 @@ + # LD_SCOPE_CHILDREN defined + #DEFS += -DHAVE_SCOPE_CHILDREN + +-LIBS=-L$(LOCALBASE)/lib -L /usr/lib -lldap ++LIBS=-L$(LOCALBASE)/lib -lldap + + DEFS+=-DSER_MOD_INTERFACE + diff --git a/net/karma/Makefile b/net/karma/Makefile new file mode 100644 index 0000000..ad8f05d --- /dev/null +++ b/net/karma/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2007-2009 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:=karma +PKG_VERSION:=20060124 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://theta44.org/software/ +PKG_MD5SUM:=e9d4ccbda89b4b1cd70eefb1db339d0a + +include $(INCLUDE_DIR)/package.mk + +define Package/karma + SECTION:=net + CATEGORY:=Network + SUBMENU:=wireless + DEPENDS:=+kmod-madwifi +ruby +libpcap +libncurses + TITLE:=set of tools for assessing the security of wireless clients + URL:=http://theta44.org/karma/index.html +endef + +define Package/karma/description + KARMA is a set of tools for assessing the security of wireless clients + at multiple layers. Wireless sniffing tools discover clients and their + preferred/trusted networks by passively listening for 802.11 Probe Request + frames. +endef + +define Package/karma/conffiles +/etc/karma-lan.xml +/etc/karma-scan.xml +/etc/karma.xml +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/src/ \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + LDLIBS="$(TARGET_LDFLAGS) -lpcap -lncurses" +endef + +define Package/karma/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/karma $(1)/usr/sbin/karma-ruby + $(CP) $(PKG_BUILD_DIR)/src/karma $(1)/usr/sbin/karma + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_BUILD_DIR)/etc/* $(1)/etc/ +endef + +$(eval $(call BuildPackage,karma)) diff --git a/net/keepalived/Makefile b/net/keepalived/Makefile new file mode 100644 index 0000000..d7396b2 --- /dev/null +++ b/net/keepalived/Makefile @@ -0,0 +1,69 @@ +# +# Copyright (C) 2006-2011 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:=keepalived +PKG_VERSION:=1.1.19 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:= http://www.keepalived.org/software +PKG_MD5SUM:=a35b8d9d462810f7650d292bd7457523 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/kernel.mk + +define Package/keepalived + SECTION:=net + CATEGORY:=Network + TITLE:=Failover and monitoring daemon for LVS clusters + URL:=http://www.keepalived.org/ + DEPENDS:=+libpopt +libopenssl +endef + +define Package/keepalived/description + Failover and monitoring daemon for Linux Virtual Server (LVS) clusters. +endef + +define Package/keepalived/conffiles +/etc/keepalived/keepalived.conf +endef + +acvar=$(subst -,_,$(subst .,_,$(subst /,_,$(1)))) + +CONFIGURE_ARGS+= \ + --enable-shared \ + --disable-static \ + --disable-debug \ + --disable-strip \ + --disable-lvs \ + --disable-lvs-syncd \ + --with-kernel-dir="$(LINUX_DIR)" + +CONFIGURE_VARS+= \ + ac_cv_file_$(call acvar,$(LINUX_DIR)/net/core/link_watch.c)=yes + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + STRIP="/bin/true" \ + all install +endef + +define Package/keepalived/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keepalived $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/genhash $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/keepalived + $(INSTALL_CONF) $(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 +endef + +$(eval $(call BuildPackage,keepalived)) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init new file mode 100644 index 0000000..2807f92 --- /dev/null +++ b/net/keepalived/files/keepalived.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=70 + +SERVICE_USE_PID=1 + +start() { + service_start /usr/sbin/keepalived +} + +stop() { + service_stop /usr/sbin/keepalived +} diff --git a/net/kismet/Makefile b/net/kismet/Makefile new file mode 100644 index 0000000..f99af84 --- /dev/null +++ b/net/kismet/Makefile @@ -0,0 +1,125 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=kismet +PKG_VERSION:=2010-07-R1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.kismetwireless.net/code +PKG_MD5SUM:=85e59186eb529889118b5635f35cf57d + +PKG_BUILD_DEPENDS:=libpcap libncurses libpcre + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/kismet/Default + SECTION:=net + CATEGORY:=Network + TITLE:=Kismet + DEPENDS:= $(CXX_DEPENDS) +libnl + URL:=http://www.kismetwireless.net/ + SUBMENU:=wireless +endef + +define Package/kismet/Default/description + An 802.11 layer2 wireless network detector, sniffer, and intrusion + detection system. +endef + +define Package/kismet-client +$(call Package/kismet/Default) + TITLE+= client + DEPENDS+= +libncurses +endef + +define Package/kismet-client/conffiles +/etc/kismet/kismet.conf +endef + +define Package/kismet-client/description +$(call Package/kismet/Default/description) + This package contains the kismet text interface client. +endef + +define Package/kismet-drone +$(call Package/kismet/Default) + DEPENDS+= +libpcap +libpcre +libcap + TITLE+= drone +endef + +define Package/kismet-drone/conffiles +/etc/kismet/kismet_drone.conf +endef + +define Package/kismet-drone/description +$(call Package/kismet/Default/description) + This package contains the kismet remote sniffing.and monitoring drone. +endef + +define Package/kismet-server +$(call Package/kismet/Default) + DEPENDS+= +libpcap +libpcre +libcap + TITLE+= server +endef + +define Package/kismet-server/conffiles +/etc/kismet/kismet.conf +endef + +define Package/kismet-server/description +$(call Package/kismet/Default/description) + This package contains the kismet server. +endef + +CONFIGURE_ARGS += \ + --sysconfdir=/etc/kismet \ + +CONFIGURE_VARS += \ + CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \ + LIBS="-lm" \ + CLIENTCLIBS="-lm" + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + LD="$(TARGET_CXX)" \ + all +endef + +#FIXME: remove this package? +define Package/kismet/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/kismet $(1)/usr/bin/kismet +endef + +define Package/kismet-client/install + $(INSTALL_DIR) $(1)/etc/kismet/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/kismet.conf $(1)/etc/kismet/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/kismet_client $(1)/usr/bin/ +endef + +define Package/kismet-drone/install + $(INSTALL_DIR) $(1)/etc/kismet/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/kismet_drone.conf $(1)/etc/kismet/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/kismet_drone $(1)/usr/bin/ +endef + +define Package/kismet-server/install + $(INSTALL_DIR) $(1)/etc/kismet/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/kismet.conf $(1)/etc/kismet/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/kismet_server $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,kismet-client)) +$(eval $(call BuildPackage,kismet-drone)) +$(eval $(call BuildPackage,kismet-server)) diff --git a/net/kismet/files/ap_manuf b/net/kismet/files/ap_manuf new file mode 100644 index 0000000..c77edfa --- /dev/null +++ b/net/kismet/files/ap_manuf @@ -0,0 +1,240 @@ +00:00:0C:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:00:74:00:00:00/FF:FF:FF:00:00:00 Ricoh Unknown 0 +00:00:92:00:00:00/FF:FF:FF:00:00:00 Cogent Unknown 0 +00:00:AA:00:00:00/FF:FF:FF:00:00:00 Xerox Unknown 0 +00:00:C5:00:00:00/FF:FF:FF:00:00:00 FarallonCo Unknown 0 +00:00:CE:00:00:00/FF:FF:FF:00:00:00 Megadata Unknown 0 +00:00:DE:00:00:00/FF:FF:FF:00:00:00 Unigraph Unknown 0 +00:01:03:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0 +00:01:24:00:00:00/FF:FF:FF:00:00:00 SMC Unknown default 6 192.168.2.1 +00:01:24:24:00:00/FF:FF:FF:FF:00:00 SMC SMC7004AWBR default 6 192.168.2.1 +00:01:38:00:00:00/FF:FF:FF:00:00:00 XaviTechno Unknown 0 +00:01:95:00:00:00/FF:FF:FF:00:00:00 Sena Unknown 0 +00:01:E6:00:00:00/FF:FF:FF:00:00:00 Hewlett-Pa Unknown 0 +00:01:F4:00:00:00/FF:FF:FF:00:00:00 EnterasysN Unknown 0 +00:02:2D:00:00:00/FF:FF:FF:00:00:00 Lucent Unknown 0 +00:02:44:00:00:00/FF:FF:FF:00:00:00 Surecom Unknown 0 +00:02:6F:00:00:00/FF:FF:FF:00:00:00 Senao Unknown 0 +00:02:72:00:00:00/FF:FF:FF:00:00:00 Cc&C Unknown 0 +00:02:8A:00:00:00/FF:FF:FF:00:00:00 AmbitMicro Unknown 0 +00:02:A5:00:00:00/FF:FF:FF:00:00:00 Compaq Unknown 0 +00:02:B3:00:00:00/FF:FF:FF:00:00:00 Intel Unknown 0 +00:03:0A:00:00:00/FF:FF:FF:00:00:00 Argus Unknown 0 +00:03:2F:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown 0 +00:03:52:00:00:00/FF:FF:FF:00:00:00 Colubris Unknown 0 +00:03:93:00:00:00/FF:FF:FF:00:00:00 AppleCompu Unknown 0 +00:04:23:00:00:00/FF:FF:FF:00:00:00 Intel Unknown 0 +00:04:3A:3A:00:00/FF:FF:FF:FF:00:00 Avaya ad-01444 0 +00:04:5A:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:04:5A:0E:00:00/FF:FF:FF:FF:00:00 Linksys WAP11 linksys 6 192.168.1.1 +00:04:5A:2E:00:00/FF:FF:FF:FF:00:00 Linksys BEFW11S4 linksys 6 192.168.1.1 +00:04:5A:5A:00:00/FF:FF:FF:FF:00:00 Linksys BEFW11S4 linksys 6 192.168.1.1 +00:04:75:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0 +00:04:75:75:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE20096A AP2000 Version 1 3Com 0 169.254.0.1 +00:04:76:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0 +00:04:DB:00:00:00/FF:FF:FF:00:00:00 TellusGrou Unknown 0 +00:04:E2:00:00:00/FF:FF:FF:00:00:00 SMC Unknown 0 +00:04:E2:00:00:00/FF:FF:FF:00:00:00 SMC Unknown SMC 6 192.168.2.1 +00:04:E2:E2:00:00/FF:FF:FF:FF:00:00 SMC 7004AWBR default 6 192.168.2.1 +00:05:3C:00:00:00/FF:FF:FF:00:00:00 Xircom Unknown 0 +00:05:4E:00:00:00/FF:FF:FF:00:00:00 PhilipsCom Unknown 0 +00:05:5D:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown default 6 +00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-1000AP default 6 +00:05:87:00:00:00/FF:FF:FF:00:00:00 Locus Unknown 0 +00:06:25:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:06:25:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:06:25:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys-g 6 192.168.1.1 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys BEFW11S4 v2 linksys 6 192.168.1.1 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WET11 linksys 6 192.168.1.225 +00:06:B1:00:00:00/FF:FF:FF:00:00:00 Sonicwall Unknown 0 +00:07:0E:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:07:13:00:00:00/FF:FF:FF:00:00:00 IpOne Unknown 0 +00:07:40:00:00:00/FF:FF:FF:00:00:00 Melco Unknown 0 +00:07:50:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:07:85:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:07:EB:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:08:21:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:08:A1:00:00:00/FF:FF:FF:00:00:00 CnetTechno Unknown 0 +00:09:43:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:09:5B:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown 0 +00:09:5B:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown NETGEAR 11 192.168.0.1 +00:09:5B:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown Wireless 11 192.168.0.2 +00:09:5B:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown NETGEAR 11 192.168.0.1 +00:09:7C:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:09:92:92:00:00/FF:FF:FF:FF:00:00 Sweex LC000010 wireless 11 192.168.0.1 +00:09:B7:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:09:E8:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0A:04:00:00:00/FF:FF:FF:00:00:00 3comEurope Unknown 0 +00:0A:41:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0A:8A:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0A:8A:8A:00:00/FF:FF:FF:FF:00:00 Cisco AIR-AP1200 0 +00:0A:95:00:00:00/FF:FF:FF:00:00:00 AppleCompu Unknown 0 +00:0A:B7:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0A:E9:00:00:00/FF:FF:FF:00:00:00 Airvast Unknown 0 +00:0B:5F:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0B:6B:00:00:00/FF:FF:FF:00:00:00 WistronNew Unknown 0 +00:0B:6C:00:00:00/FF:FF:FF:00:00:00 Sychip Unknown 0 +00:0B:7D:00:00:00/FF:FF:FF:00:00:00 SolomonExt Unknown 0 +00:0B:85:00:00:00/FF:FF:FF:00:00:00 Airespace Unknown 0 +00:0B:86:00:00:00/FF:FF:FF:00:00:00 Aruba Unknown 0 +00:0B:AC:00:00:00/FF:FF:FF:00:00:00 3comEurope Unknown 0 +00:0B:BE:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0B:CD:00:00:00/FF:FF:FF:00:00:00 CompaqHp Unknown 0 +00:0B:FD:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0C:30:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0C:41:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:0C:85:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0C:CE:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0C:E5:00:00:00/FF:FF:FF:00:00:00 MotorolaBc Unknown 0 +00:0C:F1:00:00:00/FF:FF:FF:00:00:00 Intel Unknown 0 +00:0D:0B:00:00:00/FF:FF:FF:00:00:00 Melco Unknown 0 +00:0D:14:00:00:00/FF:FF:FF:00:00:00 VtechInnov Unknown 0 +00:0D:28:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0D:29:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0D:3A:00:00:00/FF:FF:FF:00:00:00 Microsoft Unknown 0 +00:0D:54:00:00:00/FF:FF:FF:00:00:00 3comEurope Unknown 0 +00:0D:65:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0D:72:00:00:00/FF:FF:FF:00:00:00 2wire Unknown 0 +00:0D:88:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown default 6 192.168.0.1 +00:0D:93:00:00:00/FF:FF:FF:00:00:00 AppleCompu Unknown 0 +00:0D:97:00:00:00/FF:FF:FF:00:00:00 Tropos Unknown 0 +00:0D:9D:00:00:00/FF:FF:FF:00:00:00 HewlettPac Unknown 0 +00:0D:BD:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0D:ED:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0E:35:00:00:00/FF:FF:FF:00:00:00 Intel Unknown 0 +00:0E:38:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0E:3B:00:00:00/FF:FF:FF:00:00:00 HawkingTec Unknown 0 +00:0E:58:00:00:00/FF:FF:FF:00:00:00 RinconNetw Unknown 0 +00:0E:6A:00:00:00/FF:FF:FF:00:00:00 3comEurope Unknown 0 +00:0E:7F:00:00:00/FF:FF:FF:00:00:00 HewlettPac Unknown 0 +00:0E:83:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0E:84:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0E:9B:00:00:00/FF:FF:FF:00:00:00 Private Unknown 0 +00:0E:A6:00:00:00/FF:FF:FF:00:00:00 AsustekCom Unknown 0 +00:0E:D7:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0F:23:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0F:24:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0F:34:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0F:3D:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown default 6 192.168.0.1 +00:0F:66:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:0F:8F:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0F:90:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0F:B5:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown NETGEAR 11 192.168.0.1 +00:0F:EA:00:00:00/FF:FF:FF:00:00:00 GigaByte Unknown 0 +00:0F:F7:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0F:F8:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:10:C6:00:00:00/FF:FF:FF:00:00:00 Usi Unknown 0 +00:10:E7:00:00:00/FF:FF:FF:00:00:00 Breezecom Unknown 0 +00:11:09:00:00:00/FF:FF:FF:00:00:00 Micro-Star Unknown 0 +00:11:0A:00:00:00/FF:FF:FF:00:00:00 HewlettPac Unknown 0 +00:11:20:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:11:21:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:11:24:00:00:00/FF:FF:FF:00:00:00 AppleCompu Unknown 0 +00:11:2F:00:00:00/FF:FF:FF:00:00:00 AsustekCom Unknown 0 +00:11:50:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown 0 +00:17:3F:00:00:00/FF:FF:FF:00:00:00 Belkin54g Unknown 0 +00:11:5C:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:11:88:00:00:00/FF:FF:FF:00:00:00 Enterasys Unknown 0 +00:11:92:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:11:93:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:11:95:00:00:00/FF:FF:FF:00:00:00 AlphaNetwo Unknown 0 +00:11:BB:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:11:D8:00:00:00/FF:FF:FF:00:00:00 AsustekCom Unknown 0 +00:11:F5:00:00:00/FF:FF:FF:00:00:00 Askey Unknown 0 +00:12:00:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:12:01:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:12:17:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:12:25:00:00:00/FF:FF:FF:00:00:00 MotorolaBc Unknown 0 +00:12:43:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:12:7F:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:12:80:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:12:88:00:00:00/FF:FF:FF:00:00:00 2wire Unknown 0 +00:12:D9:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:12:DA:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:12:F0:00:00:00/FF:FF:FF:00:00:00 IntelCorpo Unknown 0 +00:13:10:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:13:19:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:13:1A:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:13:46:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown 0 +00:13:60:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:13:7F:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:13:80:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:13:C4:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:20:00:00:00:00/FF:FF:FF:00:00:00 LexmarkInt Unknown 0 +00:20:A6:00:00:00/FF:FF:FF:00:00:00 Proxim Unknown 0 +00:20:D8:00:00:00/FF:FF:FF:00:00:00 Nortel Unknown 0 +00:20:E0:00:00:00/FF:FF:FF:00:00:00 Actiontec Unknown 0 +00:30:1A:00:00:00/FF:FF:FF:00:00:00 Smartbridge Unknown 0 +00:30:65:00:00:00/FF:FF:FF:00:00:00 Apple Unknown 0 +00:30:65:65:00:00/FF:FF:FF:FF:00:00 Apple Snow Base Station 1 +00:30:6E:00:00:00/FF:FF:FF:00:00:00 HP Unknown 0 +00:30:AB:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown 0 +00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear MR314NA Wireless 1 192.168.0.1 +00:18:4D:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown 0 +00:30:BD:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown 0 +00:30:BD:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown WLAN 11 0.0.0.0 +00:30:BD:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown belkin54g 11 0.0.0.0 +00:30:BD:BD:00:00/FF:FF:FF:FF:00:00 Belkin F5D6230-3 0 +00:30:F1:00:00:00/FF:FF:FF:00:00:00 AcctonTech Unknown 0 +00:40:01:00:00:00/FF:FF:FF:00:00:00 Zyxel Unknown 0 +00:40:05:00:00:00/FF:FF:FF:00:00:00 ANI Unknown default 6 192.168.0.1 +00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DI-614+ default 6 192.168.0.1 +00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DWL-900AP+ default 6 192.168.0.50 +00:40:26:00:00:00/FF:FF:FF:00:00:00 Buffalo Unknown 0 +00:40:26:26:00:00/FF:FF:FF:FF:00:00 Buffalo WLAR-L11G-L 0 +00:40:33:00:00:00/FF:FF:FF:00:00:00 Addtron Unknown 0 +00:40:36:00:00:00/FF:FF:FF:00:00:00 TribeCompu Unknown 0 +00:40:96:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown tsunami 6 +00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-AP342E2R tsunami 6 192.168.1.1 +00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AP-350 tsunami 7 +00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco Aironet 350 tsunami 6 +00:50:08:00:00:00/FF:FF:FF:00:00:00 Compaq Unknown 0 +00:50:18:00:00:00/FF:FF:FF:00:00:00 Amit Unknown 0 +00:50:8B:8B:00:00/FF:FF:FF:FF:00:00 Compaq WL400 - ETSI region compaq 11 +00:50:DA:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0 +00:50:DA:DA:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE747A 0 +00:50:F2:00:00:00/FF:FF:FF:00:00:00 Microsoft Unknown MSHOME 6 192.168.2.1 +00:50:F2:F2:00:00/FF:FF:FF:FF:00:00 Microsoft MN-500 MSHOME 6 192.168.0.1 +00:50:FC:00:00:00/FF:FF:FF:00:00:00 Edimax Unknown 0 +00:60:01:00:00:00/FF:FF:FF:00:00:00 Lucent Unknown 0 +00:60:1D:00:00:00/FF:FF:FF:00:00:00 Orinoco Unknown 0 +00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Orinoco RG1000 0 +00:60:6D:00:00:00/FF:FF:FF:00:00:00 Cabletron Unknown 0 +00:60:B3:00:00:00/FF:FF:FF:00:00:00 Proxim Unknown 0 +00:80:37:37:00:00/FF:FF:FF:FF:00:00 Ericsson A11 (AP-4121-105M-ER-EU) 0 +00:80:48:00:00:00/FF:FF:FF:00:00:00 Compex Unknown 0 +00:80:C6:00:00:00/FF:FF:FF:00:00:00 SOHOware Unknown +00:80:C6:C6:00:00/FF:FF:FF:FF:00:00 SOHOware NetBlaster II +00:80:C8:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown default 6 192.168.0.1 +00:90:0E:00:00:00/FF:FF:FF:00:00:00 Handlink Unknown 0 +00:90:4B:4B:00:00/FF:FF:FF:FF:00:00 Linksys BEFW11S4 linksys 6 192.168.1.1 +00:90:4B:00:00:00/FF:FF:FF:00:00:00 Motorola Unknown 0 +00:90:4C:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown NETGEAR 11 192.168.0.1 +00:90:96:00:00:00/FF:FF:FF:00:00:00 Askey Unknown 0 +00:90:D1:00:00:00/FF:FF:FF:00:00:00 SMC Unknown WLAN 11 +00:90:D1:D1:00:00/FF:FF:FF:FF:00:00 SMC SMC2652W WLAN 11 +00:90:D1:D1:00:00/FF:FF:FF:FF:00:00 SMC SMC2682W BRIDGE 11 +00:A0:04:00:00:00/FF:FF:FF:00:00:00 3Com Unknown +00:A0:04:04:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE51196 +00:A0:C5:00:00:00/FF:FF:FF:00:00:00 Zyxel Unknown 0 +00:A0:F8:00:00:00/FF:FF:FF:00:00:00 Symbol Unknown +00:B0:64:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:C0:02:00:00:00/FF:FF:FF:00:00:00 Sercomm Unknown 0 +00:C0:49:00:00:00/FF:FF:FF:00:00:00 USRobotics Unknown 0 +00:D0:59:00:00:00/FF:FF:FF:00:00:00 AmbitMicro Unknown 0 +00:E0:00:00:00:00/FF:FF:FF:00:00:00 Fujitsu Unknown 0 +00:E0:29:00:00:00/FF:FF:FF:00:00:00 OEM Unknown +00:E0:63:00:00:00/FF:FF:FF:00:00:00 Cabletron Unknown 0 +00:E0:98:00:00:00/FF:FF:FF:00:00:00 Trend Unknown 0 +00:E0:B8:00:00:00/FF:FF:FF:00:00:00 Gateway2000 Unknown 0 +08:00:46:00:00:00/FF:FF:FF:00:00:00 Sony Unknown +00:14:BF:00:00:00/FF:FF:FF:00:00:00 linksys Unknown linksys 6 192.168.1.1 +00:14:6C:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown NETGEAR 11 192.168.0.1 +00:16:B6:00:00:00/FF:FF:FF:00:00:00 linksys Unknown linksys 6 192.168.1.1 +00:18:39:00:00:00/FF:FF:FF:00:00:00 linksys Unknown linksys 6 192.168.1.1 +00:18:F8:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown 0 +02:13:CE:00:00:00/FF:FF:FF:00:00:00 hpsetup Unknown 0 +00:15:E9:00:00:00/FF:FF:FF:00:00:00 dlink Unknown 0 +00:14:51:00:00:00/FF:FF:FF:00:00:00 AppleCompu Unknown 0 +00:C0:A8:00:00:00/FF:FF:FF:00:00:00 AMX Unknown 0 +00:16:CB:00:00:00/FF:FF:FF:00:00:00 Apple Macbook Pro 0 diff --git a/net/kismet/files/client_manuf b/net/kismet/files/client_manuf new file mode 100644 index 0000000..07a9bec --- /dev/null +++ b/net/kismet/files/client_manuf @@ -0,0 +1,455 @@ +00:00:22:22:00:00/FF:FF:FF:FF:00:00 Lucent Orinoco Silver 0 +00:00:8F:8F:00:00/FF:FF:FF:FF:00:00 BreezeCOM Breezenet Pro SA-PC 0 +00:01:03:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0 +00:01:03:03:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE62092A +00:01:03:03:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE777A 0 +00:01:24:00:00:00/FF:FF:FF:00:00:00 SMC Unknown default 6 192.168.2.1 +00:01:F4:F4:00:00/FF:FF:FF:FF:00:00 Entrasys CSIBD-AB-S Roamabout 0 +00:02:2D:00:00:00/FF:FF:FF:00:00:00 Lucent Unknown 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Agere Orinoco Gold +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Agere PC24E-H-FC 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Avaya PC24E-H-ET +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Avaya PC24E-H-FC 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Avaya World Card Silver +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Buffalo WLI-PCM-L11 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Buffalo WLI-PCM-L11 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Buffalo WLI-PCM-L11GP 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Dell TrueMobile 1150 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Dell TrueMobile 1150 Mini-PCI 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Dell Truemobile 1150 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Dell true mobile 1150 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent Orinoco Gold +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent Orinoco Silver +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent Orinoco Silver +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent Orinoco Silver +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent Orinoco Silver +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent PC24E-H-FC 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent PC24E-H-FC 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent PC24E-H-FC 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent WaveLAN Silver 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent WaveLAN Silver (PC24E-H-FC) 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent WaveLAN-Silver +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent WaveLAN/IEEE Version 01.01 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco MiniPCI Card (embedded in Sony Laptop) 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco Orinoco Gold wireless 3 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco Orinoco Gold +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco Orinoco Mini PCI Card 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco PC Card T2 Extended ORiNOCO Europe 128RC4 Kit Gold 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco PC24E-H-ET +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco PC24E-H-FC 0 +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco Silver +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco Silver +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco Silver +00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco Silver +00:02:6F:00:00:00/FF:FF:FF:00:00:00 Senao Unknown 0 +00:02:6F:6F:00:00/FF:FF:FF:FF:00:00 Senao SL-2011 CD +00:02:6F:6F:00:00/FF:FF:FF:FF:00:00 Senao SL-2011CD 0 +00:02:6F:6F:00:00/FF:FF:FF:FF:00:00 Senao SL-2011CD +00:02:6F:6F:00:00/FF:FF:FF:FF:00:00 Senao SL-2511CD PLUS EXT2(F200) 0 +00:02:A5:00:00:00/FF:FF:FF:00:00:00 Compaq Unknown 0 +00:02:A5:A5:00:00/FF:FF:FF:FF:00:00 Compaq WL110 +00:02:A5:A5:00:00/FF:FF:FF:FF:00:00 Compaq WL110 REV.0A 0 +00:02:B3:B3:00:00/FF:FF:FF:FF:00:00 Intel WPC-2011BWW 0 +00:03:2F:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown 0 +00:03:2F:2F:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 0 +00:03:2F:2F:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 +00:03:2F:2F:00:00/FF:FF:FF:FF:00:00 Repotec GL241101 +00:04:5A:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown 0 +00:04:5A:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown Linksys 6 192.168.1.1 +00:04:5A:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:04:5A:5A:00:00/FF:FF:FF:FF:00:00 Linksys BEFW11S4 linksys 0 +00:04:5A:5A:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 +00:04:5A:5A:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 +00:04:5A:5A:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 +00:04:5A:5A:00:00/FF:FF:FF:FF:00:00 Linksys WUSB11 +00:04:75:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0 +00:04:75:75:00:00/FF:FF:FF:FF:00:00 3Com 3CRSHPW696 0 +00:04:75:75:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE62092B 0 +00:04:75:75:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE62092B +00:04:DB:DB:00:00/FF:FF:FF:FF:00:00 Tellus TWL-C11 0 +00:04:E2:00:00:00/FF:FF:FF:00:00:00 SMC Unknown 0 +00:04:E2:E2:00:00/FF:FF:FF:FF:00:00 SMC SMC2632W 0 +00:04:E2:E2:00:00/FF:FF:FF:FF:00:00 SMC SMC2632W +00:04:E2:E2:00:00/FF:FF:FF:FF:00:00 SMC SMC2632W +00:04:E2:E2:00:00/FF:FF:FF:FF:00:00 SMC SMC2632W +00:04:E2:E2:00:00/FF:FF:FF:FF:00:00 SMC SMC2632W +00:05:3C:3C:00:00/FF:FF:FF:FF:00:00 Intel Intel MiniPCI High Rate Wireless (ISL3874A) 0 +00:05:5D:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown 0 +00:05:5D:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown default 6 +00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 Compaq HNW-100 0 +00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DCF-650W +00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 0 +00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 0 +00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 0 +00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 +00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 +00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 +00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 +00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 +00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650H +00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-660 H/W:A1 F/W:4.04 0 +00:06:25:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown 0 +00:06:25:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM340 0 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 D-Link DCF-650W +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Dell True Mobile 1150 6 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys BEFW11S4 v2 linksys 6 192.168.1.1 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WCF11 0 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WCF11 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WCF12 0 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WCF12 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WCF12 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WMP11 0 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WMP11 v2.5 0 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 V.3 0 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v2.5 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v2.5 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3 0 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3 0 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3.0 0 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 ver.3 (FCC-ID: PKW-WPC11-V31[suggests V3.1]) 0 +00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WUSB11 v2.6 0 +00:07:0E:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:07:0E:0E:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352 +00:07:0E:0E:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352 +00:07:50:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:07:50:50:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352 +00:07:50:50:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM350 0 +00:08:21:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:08:21:21:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352 +00:08:21:21:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352 +00:08:21:21:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352 +00:08:21:21:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352 +00:09:43:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:09:43:43:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352 +00:09:5B:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown 0 +00:09:5B:5B:00:00/FF:FF:FF:FF:00:00 Netgear MA401 0 +00:09:5B:5B:00:00/FF:FF:FF:FF:00:00 Netgear MA401RA 0 +00:09:5B:5B:00:00/FF:FF:FF:FF:00:00 Netgear MA401RA +00:09:5B:5B:00:00/FF:FF:FF:FF:00:00 Netgear MA701 0 +00:09:5B:5B:00:00/FF:FF:FF:FF:00:00 Netgear MA701 +00:09:5B:5B:00:00/FF:FF:FF:FF:00:00 Netgear ma101 0 +00:09:5B:5B:00:00/FF:FF:FF:FF:00:00 Netgear wab501 0 +00:09:7C:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:09:7C:7C:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352 +00:09:7C:7C:00:00/FF:FF:FF:FF:00:00 Cisco Cisco Aironet 352 802.11b pcmcia card 0 +00:09:92:92:00:00/FF:FF:FF:FF:00:00 Sweex LC500010 ATMEL PCMCIA FastVNET (502A-D) 0 +00:09:B7:B7:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352 0 +00:09:B7:B7:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352 0 +00:09:E8:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:09:E8:E8:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352 +00:0A:41:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0A:41:41:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352 0 +00:0A:41:41:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352 0 +00:0A:41:41:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352 0 +00:0A:41:41:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352 +00:0A:41:41:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352 +00:0A:8A:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0A:8A:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0A:8A:8A:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352 +00:0B:5F:5F:00:00/FF:FF:FF:FF:00:00 Cisco AIR-CB20A-A-K9 0 +00:20:A6:A6:00:00/FF:FF:FF:FF:00:00 Proxim Symphony (PC Card 4430) 0 +00:20:D6:D6:00:00/FF:FF:FF:FF:00:00 BreezeCOM Breezenet Pro.11 SA-PCR 0 +00:30:65:00:00:00/FF:FF:FF:00:00:00 Apple Unknown 0 +00:30:65:00:00:00/FF:FF:FF:00:00:00 Apple Unknown 0 +00:30:65:65:00:00/FF:FF:FF:FF:00:00 Apple Airport Card 2002 +00:16:CB:00:00:00/FF:FF:FF:00:00:00 Apple Macbook Pro 0 +00:30:AB:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown 0 +00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear MA401 0 +00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear MA401 +00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear MA401 +00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear MA401 +00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear MA401 +00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear MR314 Wireless 1 192.168.0.1 +00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear Netgear ma401 0 +00:30:BD:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown 0 +00:30:BD:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown 0 +00:30:BD:BD:00:00/FF:FF:FF:FF:00:00 Belkin F5D6020 0 +00:30:BD:BD:00:00/FF:FF:FF:FF:00:00 Belkin F5D6020 0 +00:30:BD:BD:00:00/FF:FF:FF:FF:00:00 Belkin F5D6020 +00:30:BD:BD:00:00/FF:FF:FF:FF:00:00 Belkin F5D6020 +00:30:BD:BD:00:00/FF:FF:FF:FF:00:00 Belkin F5D6020 (Version 01.02) 0 +00:30:BD:BD:00:00/FF:FF:FF:FF:00:00 Belkin F5D6020u 0 +00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DI-614+ default 6 192.168.0.1 +00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DI-614+ 22Mbps router/AP/switch default 6 192.168.0.1 +00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DWL-520+ 0 +00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 0 +00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 internet 8 +00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650+ wireless 6 192.168.0.1 +00:40:26:00:00:00/FF:FF:FF:00:00:00 Buffalo Unknown 0 +00:40:96:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:40:96:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown tsunami 6 +00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco 350 +00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PC4800 +00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM340 0 +00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM340 0 +00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM340 +00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM340 +00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM340 +00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM340 (Dell Rebrand) 0 +00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352 +00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352 +00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco PC 4800 DS PCI Adapter 0 +00:50:08:00:00:00/FF:FF:FF:00:00:00 Compaq Unknown 0 +00:50:08:08:00:00/FF:FF:FF:FF:00:00 Compaq WL100 0 +00:50:08:08:00:00/FF:FF:FF:FF:00:00 Compaq WL100 +00:50:8B:8B:00:00/FF:FF:FF:FF:00:00 Compaq Compaq WL100 compaq 0 +00:50:8B:8B:00:00/FF:FF:FF:FF:00:00 Compaq WL200 - ETSI region 0 +00:50:DA:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0 +00:50:DA:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0 +00:50:DA:DA:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE73796B +00:50:F2:F2:00:00/FF:FF:FF:FF:00:00 Microsoft MN-510 0 +00:50:F2:F2:00:00/FF:FF:FF:FF:00:00 Microsoft Wireless Notebook Adapter MN-520 0 +00:60:01:00:00:00/FF:FF:FF:00:00:00 Lucent Unknown 0 +00:60:01:01:00:00/FF:FF:FF:FF:00:00 Lucent WaveLAN Silver +00:60:1D:00:00:00/FF:FF:FF:00:00:00 Lucent Unknown 0 +00:60:1D:00:00:00/FF:FF:FF:00:00:00 Orinoco Unknown 0 +00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Lucent Lucent WaveLAN Turbo - Bronze, P/N: 011498/A 0 +00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Lucent Orinoco Gold +00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Lucent PC24E-00-FC 0 +00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Lucent Silver +00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Lucent WaveLAN Bronze +00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Lucent WaveLAN Gold +00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Lucent Wavelan Turbo Bronze 0 +00:60:6D:00:00:00/FF:FF:FF:00:00:00 Cabletron Unknown 0 +00:60:6D:6D:00:00/FF:FF:FF:FF:00:00 Cabletron CSIBB-AA +00:60:6D:6D:00:00/FF:FF:FF:FF:00:00 Cabletron CSIBB-AA +00:60:6D:6D:00:00/FF:FF:FF:FF:00:00 Cabletron RoamAbout 802.11DS 0 +00:60:B3:00:00:00/FF:FF:FF:00:00:00 Proxim Unknown 0 +00:60:B3:6F:00:00/FF:FF:FF:FF:00:00 WMATA WashingtonMetroAreaTA 0 +00:60:B3:B3:00:00/FF:FF:FF:FF:00:00 3Com XI-815 0 +00:60:B3:B3:00:00/FF:FF:FF:FF:00:00 3Com Zcom WL2000D 0 +00:60:B3:B3:00:00/FF:FF:FF:FF:00:00 Proxim RangeLAN DS 0 +00:60:B3:B3:00:00/FF:FF:FF:FF:00:00 Proxim RangeLan DS 8430 +00:60:B3:B3:00:00/FF:FF:FF:FF:00:00 SMC SMC2642W +00:80:37:37:00:00/FF:FF:FF:FF:00:00 Ericsson C11 (LA-4121-102M-ER-EU) 0 +00:80:C6:00:00:00/FF:FF:FF:00:00:00 SOHOware Unknown 0 +00:90:4B:4B:00:00/FF:FF:FF:FF:00:00 Dell 1180 True Mobile PCI 0 +00:90:96:96:00:00/FF:FF:FF:FF:00:00 Yakumo WLAN PCMCIA Card 11 Mbps 0 +00:90:D1:00:00:00/FF:FF:FF:00:00:00 LeArtery Unknown 0 +00:90:D1:00:00:00/FF:FF:FF:00:00:00 SMC Unknown WLAN 11 +00:90:D1:D1:00:00/FF:FF:FF:FF:00:00 LeArtery SyncByAir LN101 +00:90:D1:D1:00:00/FF:FF:FF:FF:00:00 SMC 2662W 0 +00:90:D1:D1:00:00/FF:FF:FF:FF:00:00 SMC SMC2632W 0 +00:A0:04:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0 +00:A0:65:65:00:00/FF:FF:FF:FF:00:00 Nexland Zcom XI-300 0 +00:A0:F8:00:00:00/FF:FF:FF:00:00:00 Symbol Unknown 0 +00:A0:F8:F8:00:00/FF:FF:FF:FF:00:00 Symbol Spectrum 24 High Rate 11MBps wireless LAN adapter 0 +00:A0:F8:F8:00:00/FF:FF:FF:FF:00:00 Symbol Spectrum24 +00:C0:49:49:00:00/FF:FF:FF:FF:00:00 US Robotics USR1120 0 +00:E0:29:00:00:00/FF:FF:FF:00:00:00 OEM Unknown 0 +00:E0:29:29:00:00/FF:FF:FF:FF:00:00 OEM OEM +00:E0:29:29:00:00/FF:FF:FF:FF:00:00 SMC 2632W 0 +00:E0:29:29:00:00/FF:FF:FF:FF:00:00 SMC EZ-Connect Wireless 0 +08:00:46:00:00:00/FF:FF:FF:00:00:00 Sony Unknown 0 +08:00:46:46:00:00/FF:FF:FF:FF:00:00 Sony PCWA-C100 +00:00:0C:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:00:74:00:00:00/FF:FF:FF:00:00:00 Ricoh Unknown 0 +00:00:92:00:00:00/FF:FF:FF:00:00:00 Cogent Unknown 0 +00:00:AA:00:00:00/FF:FF:FF:00:00:00 Xerox Unknown 0 +00:00:C5:00:00:00/FF:FF:FF:00:00:00 FarallonCo Unknown 0 +00:00:CE:00:00:00/FF:FF:FF:00:00:00 Megadata Unknown 0 +00:00:DE:00:00:00/FF:FF:FF:00:00:00 Unigraph Unknown 0 +00:01:03:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0 +00:01:24:00:00:00/FF:FF:FF:00:00:00 SMC Unknown default 6 192.168.2.1 +00:01:38:00:00:00/FF:FF:FF:00:00:00 XaviTechno Unknown 0 +00:01:95:00:00:00/FF:FF:FF:00:00:00 Sena Unknown 0 +00:01:E6:00:00:00/FF:FF:FF:00:00:00 Hewlett-Pa Unknown 0 +00:01:F4:00:00:00/FF:FF:FF:00:00:00 EnterasysN Unknown 0 +00:02:2D:00:00:00/FF:FF:FF:00:00:00 Lucent Unknown 0 +00:02:44:00:00:00/FF:FF:FF:00:00:00 Surecom Unknown 0 +00:02:6F:00:00:00/FF:FF:FF:00:00:00 Senao Unknown 0 +00:02:72:00:00:00/FF:FF:FF:00:00:00 Cc&C Unknown 0 +00:02:8A:00:00:00/FF:FF:FF:00:00:00 AmbitMicro Unknown 0 +00:02:A5:00:00:00/FF:FF:FF:00:00:00 Compaq Unknown 0 +00:02:B3:00:00:00/FF:FF:FF:00:00:00 Intel Unknown 0 +00:03:0A:00:00:00/FF:FF:FF:00:00:00 Argus Unknown 0 +00:03:2F:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown 0 +00:03:52:00:00:00/FF:FF:FF:00:00:00 Colubris Unknown 0 +00:03:93:00:00:00/FF:FF:FF:00:00:00 AppleCompu Unknown 0 +00:04:23:00:00:00/FF:FF:FF:00:00:00 Intel Unknown 0 +00:04:5A:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:04:75:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0 +00:04:76:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0 +00:04:DB:00:00:00/FF:FF:FF:00:00:00 TellusGrou Unknown 0 +00:04:E2:00:00:00/FF:FF:FF:00:00:00 SMC Unknown 0 +00:04:E2:00:00:00/FF:FF:FF:00:00:00 SMC Unknown SMC 6 192.168.2.1 +00:05:3C:00:00:00/FF:FF:FF:00:00:00 Xircom Unknown 0 +00:05:4E:00:00:00/FF:FF:FF:00:00:00 PhilipsCom Unknown 0 +00:05:5D:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown default 6 +00:05:87:00:00:00/FF:FF:FF:00:00:00 Locus Unknown 0 +00:06:25:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:06:25:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:06:25:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys-g 6 192.168.1.1 +00:06:B1:00:00:00/FF:FF:FF:00:00:00 Sonicwall Unknown 0 +00:07:0E:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:07:13:00:00:00/FF:FF:FF:00:00:00 IpOne Unknown 0 +00:07:40:00:00:00/FF:FF:FF:00:00:00 Melco Unknown 0 +00:07:50:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:07:85:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:07:EB:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:08:21:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:08:A1:00:00:00/FF:FF:FF:00:00:00 CnetTechno Unknown 0 +00:09:43:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:09:5B:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown 0 +00:09:5B:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown NETGEAR 11 192.168.0.1 +00:09:5B:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown Wireless 11 192.168.0.2 +00:09:5B:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown NETGEAR 11 192.168.0.1 +00:09:7C:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:09:B7:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:09:E8:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0A:04:00:00:00/FF:FF:FF:00:00:00 3comEurope Unknown 0 +00:0A:41:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0A:8A:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0A:95:00:00:00/FF:FF:FF:00:00:00 AppleCompu Unknown 0 +00:0A:B7:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0A:E9:00:00:00/FF:FF:FF:00:00:00 Airvast Unknown 0 +00:0B:5F:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0B:6B:00:00:00/FF:FF:FF:00:00:00 WistronNew Unknown 0 +00:0B:6C:00:00:00/FF:FF:FF:00:00:00 Sychip Unknown 0 +00:0B:7D:00:00:00/FF:FF:FF:00:00:00 SolomonExt Unknown 0 +00:0B:85:00:00:00/FF:FF:FF:00:00:00 Airespace Unknown 0 +00:0B:86:00:00:00/FF:FF:FF:00:00:00 Aruba Unknown 0 +00:0B:AC:00:00:00/FF:FF:FF:00:00:00 3comEurope Unknown 0 +00:0B:BE:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0B:CD:00:00:00/FF:FF:FF:00:00:00 CompaqHp Unknown 0 +00:0B:FD:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0C:30:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0C:41:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:0C:85:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0C:CE:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0C:E5:00:00:00/FF:FF:FF:00:00:00 MotorolaBc Unknown 0 +00:0C:F1:00:00:00/FF:FF:FF:00:00:00 Intel Unknown 0 +00:0D:0B:00:00:00/FF:FF:FF:00:00:00 Melco Unknown 0 +00:0D:14:00:00:00/FF:FF:FF:00:00:00 VtechInnov Unknown 0 +00:0D:28:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0D:29:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0D:3A:00:00:00/FF:FF:FF:00:00:00 Microsoft Unknown 0 +00:0D:54:00:00:00/FF:FF:FF:00:00:00 3comEurope Unknown 0 +00:0D:65:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0D:72:00:00:00/FF:FF:FF:00:00:00 2wire Unknown 0 +00:0D:88:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown default 6 192.168.0.1 +00:0D:93:00:00:00/FF:FF:FF:00:00:00 AppleCompu Unknown 0 +00:0D:97:00:00:00/FF:FF:FF:00:00:00 Tropos Unknown 0 +00:0D:9D:00:00:00/FF:FF:FF:00:00:00 HewlettPac Unknown 0 +00:0D:BD:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0D:ED:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0E:35:00:00:00/FF:FF:FF:00:00:00 Intel Unknown 0 +00:0E:38:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0E:3B:00:00:00/FF:FF:FF:00:00:00 HawkingTec Unknown 0 +00:0E:58:00:00:00/FF:FF:FF:00:00:00 RinconNetw Unknown 0 +00:0E:6A:00:00:00/FF:FF:FF:00:00:00 3comEurope Unknown 0 +00:0E:7F:00:00:00/FF:FF:FF:00:00:00 HewlettPac Unknown 0 +00:0E:83:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0E:84:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0E:9B:00:00:00/FF:FF:FF:00:00:00 Private Unknown 0 +00:0E:A6:00:00:00/FF:FF:FF:00:00:00 AsustekCom Unknown 0 +00:0E:D7:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0F:23:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0F:24:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0F:34:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0F:3D:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown default 6 192.168.0.1 +00:0F:66:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:0F:8F:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0F:90:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0F:B5:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown NETGEAR 11 192.168.0.1 +00:0F:EA:00:00:00/FF:FF:FF:00:00:00 GigaByte Unknown 0 +00:0F:F7:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:0F:F8:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:10:C6:00:00:00/FF:FF:FF:00:00:00 Usi Unknown 0 +00:10:E7:00:00:00/FF:FF:FF:00:00:00 Breezecom Unknown 0 +00:11:09:00:00:00/FF:FF:FF:00:00:00 Micro-Star Unknown 0 +00:11:0A:00:00:00/FF:FF:FF:00:00:00 HewlettPac Unknown 0 +00:11:20:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:11:21:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:11:24:00:00:00/FF:FF:FF:00:00:00 AppleCompu Unknown 0 +00:11:2F:00:00:00/FF:FF:FF:00:00:00 AsustekCom Unknown 0 +00:11:50:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown 0 +00:11:5C:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:11:88:00:00:00/FF:FF:FF:00:00:00 Enterasys Unknown 0 +00:11:92:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:11:93:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:11:95:00:00:00/FF:FF:FF:00:00:00 AlphaNetwo Unknown 0 +00:11:BB:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:11:D8:00:00:00/FF:FF:FF:00:00:00 AsustekCom Unknown 0 +00:11:F5:00:00:00/FF:FF:FF:00:00:00 Askey Unknown 0 +00:12:00:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:12:01:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:12:17:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:12:25:00:00:00/FF:FF:FF:00:00:00 MotorolaBc Unknown 0 +00:12:43:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:12:7F:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:12:80:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:12:88:00:00:00/FF:FF:FF:00:00:00 2wire Unknown 0 +00:12:D9:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:12:DA:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:12:F0:00:00:00/FF:FF:FF:00:00:00 IntelCorpo Unknown 0 +00:13:10:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1 +00:13:19:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:13:1A:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:13:46:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown 0 +00:13:60:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:13:7F:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:13:80:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:13:C4:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:20:00:00:00:00/FF:FF:FF:00:00:00 LexmarkInt Unknown 0 +00:20:A6:00:00:00/FF:FF:FF:00:00:00 Proxim Unknown 0 +00:20:D8:00:00:00/FF:FF:FF:00:00:00 Nortel Unknown 0 +00:20:E0:00:00:00/FF:FF:FF:00:00:00 Actiontec Unknown 0 +00:30:1A:00:00:00/FF:FF:FF:00:00:00 Smartbridge Unknown 0 +00:30:65:00:00:00/FF:FF:FF:00:00:00 Apple Unknown 0 +00:30:6E:00:00:00/FF:FF:FF:00:00:00 HP Unknown 0 +00:30:AB:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown 0 +00:30:BD:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown 0 +00:30:BD:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown WLAN 11 0.0.0.0 +00:30:BD:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown belkin54g 11 0.0.0.0 +00:30:F1:00:00:00/FF:FF:FF:00:00:00 AcctonTech Unknown 0 +00:40:01:00:00:00/FF:FF:FF:00:00:00 Zyxel Unknown 0 +00:40:05:00:00:00/FF:FF:FF:00:00:00 ANI Unknown default 6 192.168.0.1 +00:40:26:00:00:00/FF:FF:FF:00:00:00 Buffalo Unknown 0 +00:40:33:00:00:00/FF:FF:FF:00:00:00 Addtron Unknown 0 +00:40:36:00:00:00/FF:FF:FF:00:00:00 TribeCompu Unknown 0 +00:40:96:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown tsunami 6 +00:50:08:00:00:00/FF:FF:FF:00:00:00 Compaq Unknown 0 +00:50:18:00:00:00/FF:FF:FF:00:00:00 Amit Unknown 0 +00:50:DA:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0 +00:50:F2:00:00:00/FF:FF:FF:00:00:00 Microsoft Unknown MSHOME 6 192.168.2.1 +00:50:FC:00:00:00/FF:FF:FF:00:00:00 Edimax Unknown 0 +00:60:01:00:00:00/FF:FF:FF:00:00:00 Lucent Unknown 0 +00:60:1D:00:00:00/FF:FF:FF:00:00:00 Orinoco Unknown 0 +00:60:6D:00:00:00/FF:FF:FF:00:00:00 Cabletron Unknown 0 +00:60:B3:00:00:00/FF:FF:FF:00:00:00 Proxim Unknown 0 +00:80:48:00:00:00/FF:FF:FF:00:00:00 Compex Unknown 0 +00:80:C6:00:00:00/FF:FF:FF:00:00:00 SOHOware Unknown +00:80:C8:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown default 6 192.168.0.1 +00:90:0E:00:00:00/FF:FF:FF:00:00:00 Handlink Unknown 0 +00:90:4C:00:00:00/FF:FF:FF:00:00:00 Netgear/Epigram Unknown NETGEAR 11 192.168.0.1 +00:90:96:00:00:00/FF:FF:FF:00:00:00 Askey Unknown 0 +00:90:D1:00:00:00/FF:FF:FF:00:00:00 SMC Unknown WLAN 11 +00:A0:04:00:00:00/FF:FF:FF:00:00:00 3Com Unknown +00:A0:C5:00:00:00/FF:FF:FF:00:00:00 Zyxel Unknown 0 +00:A0:F8:00:00:00/FF:FF:FF:00:00:00 Symbol Unknown +00:B0:64:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0 +00:C0:02:00:00:00/FF:FF:FF:00:00:00 Sercomm Unknown 0 +00:C0:49:00:00:00/FF:FF:FF:00:00:00 USRobotics Unknown 0 +00:D0:59:00:00:00/FF:FF:FF:00:00:00 AmbitMicro Unknown 0 +00:E0:00:00:00:00/FF:FF:FF:00:00:00 Fujitsu Unknown 0 +00:E0:29:00:00:00/FF:FF:FF:00:00:00 OEM Unknown +00:E0:63:00:00:00/FF:FF:FF:00:00:00 Cabletron Unknown 0 +00:E0:98:00:00:00/FF:FF:FF:00:00:00 Trend Unknown 0 +00:E0:B8:00:00:00/FF:FF:FF:00:00:00 Gateway2000 Unknown 0 +08:00:46:00:00:00/FF:FF:FF:00:00:00 Sony Unknown +00:14:BF:00:00:00/FF:FF:FF:00:00:00 linksys Unknown 0 +00:14:6C:00:00:00/FF:FF:FF:00:00:00 NETGEAR Unknown 0 +00:16:B6:00:00:00/FF:FF:FF:00:00:00 linksys Unknown linksys 6 192.168.1.1 +02:12:F0:00:00:00/FF:FF:FF:00:00:00 hpsetup Unknown 0 +02:13:CE:00:00:00/FF:FF:FF:00:00:00 hpsetup Unknown 0 +00:15:E9:00:00:00/FF:FF:FF:00:00:00 dlink Unknown 0 +00:17:9A:00:00:00/FF:FF:FF:00:00:00 dlink Unknown 0 +00:13:F7:00:00:00/FF:FF:FF:00:00:00 SMC Unknown 0 diff --git a/net/kismet/files/kismet.conf b/net/kismet/files/kismet.conf new file mode 100644 index 0000000..3a11720 --- /dev/null +++ b/net/kismet/files/kismet.conf @@ -0,0 +1,287 @@ +# Kismet config file +# Most of the "static" configs have been moved to here -- the command line +# config was getting way too crowded and cryptic. We want functionality, +# not continually reading --help! + +# Version of Kismet config +version=2005.01.R1 + +# Name of server (Purely for organiational purposes) +servername=Kismet + +# User to setid to (should be your normal user) +suiduser=nobody + +# Sources are defined as: +# source=cardtype,interface,name[,initialchannel] +# Card types and required drivers are listed in the README. +# The initial channel is optional, if hopping is not enabled it can be used +# to set the channel the interface listens on. +# YOU MUST CHANGE THIS TO BE THE SOURCE YOU WANT TO USE +source=wrt54g,eth1,wireless +# For v1 hardware uncomment this: +# source=wrt54g,eth2,wireless + +# Comma-separated list of sources to enable. This is only needed if you defined +# multiple sources and only want to enable some of them. By default, all defined +# sources are enabled. +# For example: +# enablesources=prismsource,ciscosource + +# Do we channelhop? +channelhop=true + +# How many channels per second do we hop? (1-10) +channelvelocity=5 + +# By setting the dwell time for channel hopping we override the channelvelocity +# setting above and dwell on each channel for the given number of seconds. +#channeldwell=10 + +# Do we split channels between cards on the same spectrum? This means if +# multiple 802.11b capture sources are defined, they will be offset to cover +# the most possible spectrum at a given time. This also controls splitting +# fine-tuned sourcechannels lines which cover multiple interfaces (see below) +channelsplit=true + +# Basic channel hopping control: +# These define the channels the cards hop through for various frequency ranges +# supported by Kismet. More finegrain control is available via the +# "sourcechannels" configuration option. +# +# Don't change the IEEE80211 identifiers or channel hopping won't work. + +# Users outside the US might want to use this list: +# defaultchannels=IEEE80211b:1,7,13,2,8,3,14,9,4,10,5,11,6,12 +defaultchannels=IEEE80211b:1,6,11,2,7,3,8,4,9,5,10 + +# 802.11g uses the same channels as 802.11b... +defaultchannels=IEEE80211g:1,6,11,2,7,3,8,4,9,5,10 + +# 802.11a channels are non-overlapping so sequential is fine. You may want to +# adjust the list depending on the channels your card actually supports. +# defaultchannels=IEEE80211a:36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140,149,153,157,161,184,188,192,196,200,204,208,212,216 +defaultchannels=IEEE80211a:36,40,44,48,52,56,60,64 + +# Combo cards like Atheros use both 'a' and 'b/g' channels. Of course, you +# can also explicitly override a given source. You can use the script +# extras/listchan.pl to extract all the channels your card supports. +defaultchannels=IEEE80211ab:1,6,11,2,7,3,8,4,9,5,10,36,40,44,48,52,56,60,64 + +# Fine-tuning channel hopping control: +# The sourcechannels option can be used to set the channel hopping for +# specific interfaces, and to control what interfaces share a list of +# channels for split hopping. This can also be used to easily lock +# one card on a single channel while hopping with other cards. +# Any card without a sourcechannel definition will use the standard hopping +# list. +# sourcechannels=sourcename[,sourcename]:ch1,ch2,ch3,...chN + +# ie, for us channels on the source 'prism2source' (same as normal channel +# hopping behavior): +# sourcechannels=prism2source:1,6,11,2,7,3,8,4,9,5,10 + +# Given two capture sources, "prism2a" and "prism2b", we want prism2a to stay +# on channel 6 and prism2b to hop normally. By not setting a sourcechannels +# line for prism2b, it will use the standard hopping. +# sourcechannels=prism2a:6 + +# To assign the same custom hop channel to multiple sources, or to split the +# same custom hop channel over two sources (if splitchannels is true), list +# them all on the same sourcechannels line: +# sourcechannels=prism2a,prism2b,prism2c:1,6,11 + +# Port to serve GUI data +tcpport=2501 +# People allowed to connect, comma seperated IP addresses or network/mask +# blocks. Netmasks can be expressed as dotted quad (/255.255.255.0) or as +# numbers (/24) +allowedhosts=127.0.0.1 +# Maximum number of concurrent GUI's +maxclients=5 + +# Do we have a GPS? +gps=false +# Host:port that GPSD is running on. This can be localhost OR remote! +gpshost=localhost:2947 +# Do we lock the mode? This overrides coordinates of lock "0", which will +# generate some bad information until you get a GPS lock, but it will +# fix problems with GPS units with broken NMEA that report lock 0 +gpsmodelock=false + +# Packet filtering options: +# filter_tracker - Packets filtered from the tracker are not processed or +# recorded in any way. +# filter_dump - Packets filtered at the dump level are tracked, displayed, +# and written to the csv/xml/network/etc files, but not +# recorded in the packet dump +# filter_export - Controls what packets influence the exported CSV, network, +# xml, gps, etc files. +# All filtering options take arguments containing the type of address and +# addresses to be filtered. Valid address types are 'ANY', 'BSSID', +# 'SOURCE', and 'DEST'. Filtering can be inverted by the use of '!' before +# the address. For example, +# filter_tracker=ANY(!00:00:DE:AD:BE:EF) +# has the same effect as the previous mac_filter config file option. +# filter_tracker=... +# filter_dump=... +# filter_export=... + +# Alerts to be reported and the throttling rates. +# alert=name,throttle/unit,burst +# The throttle/unit describes the number of alerts of this type that are +# sent per time unit. Valid time units are second, minute, hour, and day. +# Burst describes the number of alerts sent before throttling takes place. +# For example: +# alert=FOO,10/min,5 +# Would allow 5 alerts through before throttling is enabled, and will then +# limit the number of alerts to 10 per minute. +# A throttle rate of 0 disables throttling of the alert. +# See the README for a list of alert types. +alert=NETSTUMBLER,5/min,2 +alert=WELLENREITER,5/min,2 +alert=LUCENTTEST,5/min,2 +alert=DEAUTHFLOOD,5/min,4 +alert=BCASTDISCON,5/min,4 +alert=CHANCHANGE,5/min,4 +alert=AIRJACKSSID,5/min,2 +alert=PROBENOJOIN,5/min,2 +alert=DISASSOCTRAFFIC,5/min,2 +alert=NULLPROBERESP,5/min,5 +alert=BSSTIMESTAMP,5/min,5 +alert=MSFBCOMSSID,10/min,1/sec +alert=LONGSSID,10/min,1/sec +alert=MSFDLINKRATE,10/min,1/sec +alert=MSFNETGEARBEACON,10/min,1/sec +alert=DISCONCODEINVALID,10/min,1/sec +alert=DEAUTHCODEINVALID,10/min,1/sec + +# Known WEP keys to decrypt, bssid,hexkey. This is only for networks where +# the keys are already known, and it may impact throughput on slower hardware. +# Multiple wepkey lines may be used for multiple BSSIDs. +# wepkey=00:DE:AD:C0:DE:00,FEEDFACEDEADBEEF01020304050607080900 + +# Is transmission of the keys to the client allowed? This may be a security +# risk for some. If you disable this, you will not be able to query keys from +# a client. +allowkeytransmit=true + +# How often (in seconds) do we write all our data files (0 to disable) +writeinterval=300 + +# Where do we get our manufacturer fingerprints from? Assumed to be in the +# default config directory if an absolute path is not given. +ap_manuf=ap_manuf +client_manuf=client_manuf + +# Use metric measurements in the output? +metric=false + +# Do we write waypoints for gpsdrive to load? Note: This is NOT related to +# recent versions of GPSDrive's native support of Kismet. +waypoints=false +# GPSMap waypoint file. This WILL be truncated. +waypointdata=%h/.gpsdrive/way_kismet.txt + +# How many alerts do we backlog for new clients? Only change this if you have +# a -very- low memory system and need those extra bytes, or if you have a high +# memory system and a huge number of alert conditions. +alertbacklog=50 + +# File types to log, comma seperated +# dump - raw packet dump +# network - plaintext detected networks +# csv - plaintext detected networks in CSV format +# xml - XML formatted network and cisco log +# weak - weak packets (in airsnort format) +# cisco - cisco equipment CDP broadcasts +# gps - gps coordinates +logtypes=dump,network,csv,xml,weak,cisco,gps + +# Do we track probe responses and merge probe networks into their owners? +# This isn't always desireable, depending on the type of monitoring you're +# trying to do. +trackprobenets=true + +# Do we log "noise" packets that we can't decipher? I tend to not, since +# they don't have anything interesting at all in them. +noiselog=false + +# Do we log corrupt packets? Corrupt packets have enough header information +# to see what they are, but someting is wrong with them that prevents us from +# completely dissecting them. Logging these is usually not a bad idea. +corruptlog=true + +# Do we log beacon packets or do we filter them out of the dumpfile +beaconlog=true + +# Do we log PHY layer packets or do we filter them out of the dumpfile +phylog=true + +# Do we mangle packets if we can decrypt them or if they're fuzzy-detected +mangledatalog=true + +# Do we do "fuzzy" crypt detection? (byte-based detection instead of 802.11 +# frame headers) +# valid option: Comma seperated list of card types to perform fuzzy detection +# on, or 'all' +fuzzycrypt=wtapfile,wlanng,wlanng_legacy,wlanng_avs,hostap,wlanng_wext + +# What type of dump do we generate? +# valid option: "wiretap" +dumptype=wiretap +# Do we limit the size of dump logs? Sometimes ethereal can't handle big ones. +# 0 = No limit +# Anything else = Max number of packets to log to a single file before closing +# and opening a new one. +dumplimit=0 + +# Do we write data packets to a FIFO for an external data-IDS (such as Snort)? +# See the docs before enabling this. +#fifo=/tmp/kismet_dump + +# Default log title +logdefault=Kismet + +# logtemplate - Filename logging template. +# This is, at first glance, really nasty and ugly, but you'll hardly ever +# have to touch it so don't complain too much. +# +# %n is replaced by the logging instance name +# %d is replaced by the current date as Mon-DD-YYYY +# %D is replaced by the current date as YYYYMMDD +# %t is replaced by the starting log time +# %i is replaced by the increment log in the case of multiple logs +# %l is replaced by the log type (dump, status, crypt, etc) +# %h is replaced by the home directory +# ie, "netlogs/%n-%d-%i.dump" called with a logging name of "Pok" could expand +# to something like "netlogs/Pok-Dec-20-01-1.dump" for the first instance and +# "netlogs/Pok-Dec-20-01-2.%l" for the second logfile generated. +# %h/netlots/%n-%d-%i.dump could expand to +# /home/foo/netlogs/Pok-Dec-20-01-2.dump +# +# Other possibilities: Sorting by directory +# logtemplate=%l/%n-%d-%i +# Would expand to, for example, +# dump/Pok-Dec-20-01-1 +# crypt/Pok-Dec-20-01-1 +# and so on. The "dump", "crypt", etc, dirs must exist before kismet is run +# in this case. +logtemplate=%n-%d-%i.%l + +# Where do we store the pid file of the server? +piddir=/var/run/ + +# Where state info, etc, is stored. You shouldnt ever need to change this. +# This is a directory. +configdir=%h/.kismet/ + +# cloaked SSID file. You shouldn't ever need to change this. +ssidmap=ssid_map + +# Group map file. You shouldn't ever need to change this. +groupmap=group_map + +# IP range map file. You shouldn't ever need to change this. +ipmap=ip_map + diff --git a/net/kismet/files/kismet_drone.conf b/net/kismet/files/kismet_drone.conf new file mode 100644 index 0000000..901b5b8 --- /dev/null +++ b/net/kismet/files/kismet_drone.conf @@ -0,0 +1,121 @@ +# Kismet drone config file + +version=2005.04.R1 + +# Name of server (Purely for organiational purposes) +servername=Kismet + +# User to setid to (should be your normal user) +suiduser=nobody + +# Port to serve packet data... This probably shouldn't be the same as the port +# you configured kismet_server for, or else you'll have problems running them +# on the same system. +tcpport=3501 +# People allowed to connect, comma seperated IP addresses or network/mask +# blocks. Netmasks can be expressed as dotted quad (/255.255.255.0) or as +# numbers (/24) +allowedhosts=127.0.0.1 +# Maximum number of concurrent stream attachments +maxclients=5 + +# Packet sources: +# source=capture_cardtype,capture_interface,capture_name +# Card type - Specifies the type of device. It can be one of: +# cisco - Cisco card with Linux Kernel drivers +# cisco_cvs - Cisco card with CVS Linux drivers +# cisco_bsd - Cisco on *BSD +# prism2 - Prism2 using wlan-ng drivers with pcap support (all +# current versions support pcap) +# prism2_hostap - Prism2 using hostap drivers +# prism2_legacy - Prism2 using wlan-ng drivers without pcap support (0.1.9) +# prism2_bsd - Prism2 on *BSD +# orinoco - Orinoco cards using Snax's patched driers +# generic - Generic card with no specific support. You will have +# to put this into monitor mode yourself! +# wsp100 - WSP100 embedded remote sensor. +# wtapfile - Saved file of packets readable by libwiretap +# ar5k - ar5k 802.11a using the vt_ar5k drivers +# Capture interface - Specifies the network interface Kismet will watch for +# packets to come in on. Typically "ethX" or "wlanX". For the WSP100 capture +# engine, the WSP100 device sends packets via a UDP stream, so the capture +# interface should be in the form of host:port where 'host' is the WSP100 and +# 'port' is the local UDP port that it will send data to. +# Capture Name - The name Kismet uses for this capture source. This is the +# name used to specify what sources to enable. +# +# To enable multiple sources, specify a source line for each and then use the +# enablesources line to enable them. For example: +# source=prism2,wlan0,prism +# source=cisco,eth0,cisco +source=wrt54g,eth1,wireless +# For v1 hardware uncomment this: +# source=wrt54g,eth2,wireless + +# Comma-separated list of sources to enable. This is only needed if you wish +# to selectively enable multiple sources. +# enablesources=prism,cisco + +# Do we channelhop? +channelhop=true + +# How many channels per second do we hop? (1-10) +channelvelocity=5 + +# By setting the dwell time for channel hopping we override the channelvelocity +# setting above and dwell on each channel for the given number of seconds. +#channeldwell=10 + +# Do we split channels between cards on the same spectrum? This means if +# multiple 802.11b capture sources are defined, they will be offset to cover +# the most possible spectrum at a given time. This also controls splitting +# fine-tuned sourcechannels lines which cover multiple interfaces (see below) +splitchannels=true + +# Basic channel hopping control: +# These define the channels the cards hop through for various frequency ranges +# supported by Kismet. More finegrain control is available via the +# "sourcechannels" configuration option. +# +# Don't change the IEEE80211 identifiers or channel hopping won't work. + +# Users outside the US might want to use this list: +# defaultchannels=IEEE80211b:1,7,13,2,8,3,14,9,4,10,5,11,6,12 +defaultchannels=IEEE80211b:1,6,11,2,7,3,8,4,9,5,10 + +# 802.11g uses the same channels as 802.11b... +defaultchannels=IEEE80211g:1,6,11,2,7,3,8,4,9,5,10 + +# 802.11a channels are non-overlapping so sequential is fine. You may want to +# adjust the list depending on the channels your card actually supports. +# defaultchannels=IEEE80211a:36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140,149,153,157,161,184,188,192,196,200,204,208,212,216 +defaultchannels=IEEE80211a:36,40,44,48,52,56,60,64 + +# Combo cards like Atheros use both 'a' and 'b/g' channels. Of course, you +# can also explicitly override a given source. You can use the script +# extras/listchan.pl to extract all the channels your card supports. +defaultchannels=IEEE80211ab:1,6,11,2,7,3,8,4,9,5,10,36,40,44,48,52,56,60,64 + +# Fine-tuning channel hopping control: +# The sourcechannels option can be used to set the channel hopping for +# specific interfaces, and to control what interfaces share a list of +# channels for split hopping. This can also be used to easily lock +# one card on a single channel while hopping with other cards. +# Any card without a sourcechannel definition will use the standard hopping +# list. +# sourcechannels=sourcename[,sourcename]:ch1,ch2,ch3,...chN + +# ie, for us channels on the source 'prism2source' (same as normal channel +# hopping behavior): +# sourcechannels=prism2source:1,6,11,2,7,3,8,4,9,5,10 + +# Given two capture sources, "prism2a" and "prism2b", we want prism2a to stay +# on channel 6 and prism2b to hop normally. By not setting a sourcechannels +# line for prism2b, it will use the standard hopping. +# sourcechannels=prism2a:6 + +# To assign the same custom hop channel to multiple sources, or to split the +# same custom hop channel over two sources (if splitchannels is true), list +# them all on the same sourcechannels line: +# sourcechannels=prism2a,prism2b,prism2c:1,6,11 + diff --git a/net/kismet/files/kismet_ui.conf b/net/kismet/files/kismet_ui.conf new file mode 100644 index 0000000..e704b37 --- /dev/null +++ b/net/kismet/files/kismet_ui.conf @@ -0,0 +1,61 @@ +# Kismet GUI config file + +# Version of Kismet config +version=2005.04.R1 + +# Do we show the intro window? +showintro=false + +# Gui type to use +# Valid types: curses, panel +gui=panel +# Server to connect to (host:port) +host=localhost:2501 +# Network traffic decay (active/recent/inactive) and packet click rate - increase +# this if you are doing prism2 channel hopping. +decay=3 +# What columns do we display? Comma seperated. Read the documentation for what +# columns are valid. +columns=decay,name,type,wep,channel,packets,flags,ip,size +# What columns do we display for clients? Comma seperated. +clientcolumns=decay,type,mac,manuf,data,crypt,size,ip,signal,quality,noise + +# Do we auotmatically make a group for probed networks or do we show them +# amidst other networks? +autogroup_probe=true +# Do we autogroup data-only networks? +autogroup_data=true + +# Display battery status? +apm=false + +# Simple borders (use - and | instead of smooth vertical and horizontal +# lines. This is required on Zaurus, and might be needed elsewhere if your +# terminal doesn't display the border characters correctly. +simpleborders=false + +# Colors (front, back) of text in the panel front. Valid colors are: +# black, red, yellow, green, blue, magenta, cyan, white +# optionally prefixed with "hi-" for bold/bright colors, ie +# hi-red, hi-yellow, hi-green, etc. + +# Enable colors? +color=true +# Background +backgroundcolor=black +# Default text +textcolor=white +# Window borders +bordercolor=green +# Titles +titlecolor=hi-white +# GPS and APM info +monitorcolor=hi-white +# WEP network color +wepcolor=hi-green +# Factory network color +factorycolor=hi-red +# Open color +opencolor=hi-yellow +# Decloaked network color +cloakcolor=hi-blue diff --git a/net/kismet/patches/010-dont-add-host-include-paths.patch b/net/kismet/patches/010-dont-add-host-include-paths.patch new file mode 100644 index 0000000..23a87bd --- /dev/null +++ b/net/kismet/patches/010-dont-add-host-include-paths.patch @@ -0,0 +1,14 @@ +diff --git a/configure b/configure +index 6936a47..9a85269 100755 +--- a/configure ++++ b/configure +@@ -6980,9 +6980,6 @@ else + fi + + +-# Add additional cflags since some distros bury panel.h +-CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses" +- + termcontrol="none"; + + if test "$wantclient" = "yes"; then diff --git a/net/knock/Makefile b/net/knock/Makefile new file mode 100644 index 0000000..62866fd --- /dev/null +++ b/net/knock/Makefile @@ -0,0 +1,92 @@ +# +# 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:=knock +PKG_VERSION:=0.5 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.zeroflux.org/proj/knock/files/ +PKG_MD5SUM:=ca09d61458974cff90a700aba6120891 + +include $(INCLUDE_DIR)/package.mk + +define Package/knock/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Firewall + DEPENDS:=+libpcap + TITLE:=Port-knocking + URL:=http://www.zeroflux.org/projects/knock +endef + +define Package/knock + $(call Package/knock/Default) + TITLE+= (client) +endef + +define Package/knock/Default/description + It listens to all traffic on an ethernet (or PPP) interface, + looking for special "knock" sequences of port-hits. A client + makes these port-hits by sending a TCP (or UDP) packet to a + port on the server. This port need not be open -- since + knockd listens at the link-layer level, it sees all traffic + even if it's destined for a closed port. When the server + detects a specific sequence of port-hits, it runs a command + defined in its configuration file. This can be used to open + up holes in a firewall for quick access. +endef + +define Package/knock/description + $(call Package/knock/Default/description) + This package contains the port-knocking client. +endef + +define Package/knockd + $(call Package/knock/Default) + TITLE+= (server) +endef + +define Package/knockd/description + $(call Package/knock/Default/description) + This package contains the port-knocking server. +endef + +define Package/knockd/conffiles +/etc/knockd.conf +endef + +define Build/Configure + $(call Build/Configure/Default, \ + , \ + CFLAGS="$$$$CFLAGS $$$$CPPFLAGS" \ + ac_cv_lib_pcap_pcap_open_live=yes \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/knock/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knock $(1)/usr/bin/ +endef + +define Package/knockd/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knockd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knockd $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,knock)) +$(eval $(call BuildPackage,knockd)) diff --git a/net/knock/patches/010_eglibc_define_PATH_MAX.patch b/net/knock/patches/010_eglibc_define_PATH_MAX.patch new file mode 100644 index 0000000..0e7f56e --- /dev/null +++ b/net/knock/patches/010_eglibc_define_PATH_MAX.patch @@ -0,0 +1,11 @@ +diff -Naur knock-0.5/src/knockd.c knock-0.5-new/src/knockd.c +--- knock-0.5/src/knockd.c 2005-06-27 08:11:34.000000000 +0300 ++++ knock-0.5-new/src/knockd.c 2012-07-31 22:49:13.670323836 +0300 +@@ -46,6 +46,7 @@ + #include + #include + #include ++#include /* PATH_MAX in eglibc env */ + #include "list.h" + + static char version[] = "0.5"; diff --git a/net/krb5/Makefile b/net/krb5/Makefile new file mode 100644 index 0000000..58b5a07 --- /dev/null +++ b/net/krb5/Makefile @@ -0,0 +1,130 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=krb5 +PKG_VERSION:=1.8 +PKG_RELEASE:=2 + +PKG_SOURCE:=krb5-$(PKG_VERSION)-signed.tar +PKG_SOURCE_URL:=http://web.mit.edu/kerberos/dist/krb5/$(PKG_VERSION)/ +PKG_MD5SUM:=74257d68373a8df8b9391fc093d594be + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +MAKE_PATH:=src + +define Package/krb5/Default + SECTION:=net + CATEGORY:=Network + TITLE:=Kerberos + URL:=http://web.mit.edu/kerberos/ + MAINTAINER:=W. Michael Petullo +endef + +define Package/krb5-libs + SECTION:=net + CATEGORY:=Network + TITLE:=Kerberos + DEPENDS:=+libncurses + TITLE:=Kerberos 5 Shared Libraries + URL:=http://web.mit.edu/kerberos/ + MAINTAINER:=W. Michael Petullo +endef + +define Package/krb5-server + $(call Package/krb5/Default) + DEPENDS:=+krb5-libs +libpthread + TITLE:=Kerberos 5 Server +endef + +define Package/krb5-client + $(call Package/krb5/Default) + DEPENDS:=+krb5-libs + TITLE:=Kerberos 5 Client +endef + +define Package/krb5/decription + Kerberos +endef + +define Build/Prepare + # Krb5 tarball contains signature and a second tarball + # containing source code. + tar xf "$(DL_DIR)/$(PKG_SOURCE)" -C "$(BUILD_DIR)" + tar xzf "$(BUILD_DIR)/krb5-$(PKG_VERSION).tar.gz" -C "$(BUILD_DIR)" + patch -p1 -d "$(PKG_BUILD_DIR)" < "$(PATCH_DIR)/001-krb5kdc-dir-to-etc.patch" + patch -p1 -d "$(PKG_BUILD_DIR)" < "$(PATCH_DIR)/002-MITKRB5-SA-2011-002.patch" +endef + +CONFIGURE_PATH = ./src + +CONFIGURE_VARS += \ + cross_compiling=yes \ + krb5_cv_attr_constructor_destructor=yes,yes \ + ac_cv_func_regcomp=yes \ + ac_cv_printf_positional=yes \ + ac_cv_file__etc_environment=no \ + ac_cv_file__etc_TIMEZONE=no + +CONFIGURE_ARGS += \ + --enable-thread-support \ + --without-krb4 \ + --without-tcl \ + --disable-ipv6 + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include \ + $(1)/usr/include/krb5 + $(INSTALL_DIR) $(1)/usr + $(CP) $(PKG_INSTALL_DIR)/usr/lib \ + $(1)/usr + rm -f $(1)/usr/lib/libcom_err* +endef + +define Package/krb5-libs/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/lib/krb5 + $(INSTALL_DIR) $(1)/usr/lib/krb5/plugins + $(INSTALL_DIR) $(1)/usr/lib/krb5/plugins/kdb + $(INSTALL_DIR) $(1)/usr/lib/krb5/plugins/libkrb5 + $(CP) $(PKG_INSTALL_DIR)/usr/lib/krb5/plugins/kdb/db2.so $(1)/usr/lib/krb5/plugins/kdb + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib +endef + +define Package/krb5-client/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdestroy $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kinit $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/klist $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kpasswd $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ksu $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kvno $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/krb5-send-pr $(1)/usr/sbin +endef + +# Removed some server-side software to reduce package size. This should be +# put in a separate package if needed. +define Package/krb5-server/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/krb5kdc $(1)/etc/init.d/krb5kdc + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sclient $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kadmin.local $(1)/usr/sbin +# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kadmind $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kdb5_util $(1)/usr/sbin +# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kprop $(1)/usr/sbin +# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kpropd $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/krb5kdc $(1)/usr/sbin +# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sim_server $(1)/usr/sbin +endef + +$(eval $(call BuildPackage,krb5-libs)) +$(eval $(call BuildPackage,krb5-server)) +$(eval $(call BuildPackage,krb5-client)) diff --git a/net/krb5/files/krb5kdc b/net/krb5/files/krb5kdc new file mode 100644 index 0000000..5962683 --- /dev/null +++ b/net/krb5/files/krb5kdc @@ -0,0 +1,17 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009 OpenWrt.org + +START=60 + +start() { + mkdir -p /var/tmp + mkdir -p /etc/krb5kdc + + [ -f /etc/krb5kdc/principal ] || ( echo; echo ) | kdb5_util create -s + + /usr/sbin/krb5kdc +} + +stop() { + killall krb5kdc 2> /dev/null +} diff --git a/net/krb5/patches/001-krb5kdc-dir-to-etc.patch b/net/krb5/patches/001-krb5kdc-dir-to-etc.patch new file mode 100644 index 0000000..a017125 --- /dev/null +++ b/net/krb5/patches/001-krb5kdc-dir-to-etc.patch @@ -0,0 +1,51 @@ +diff -u --recursive krb5-1.8-vanilla/src/include/osconf.hin krb5-1.8/src/include/osconf.hin +--- krb5-1.8-vanilla/src/include/osconf.hin 2010-04-01 16:28:29.408661301 -0500 ++++ krb5-1.8/src/include/osconf.hin 2010-04-01 16:30:52.235467788 -0500 +@@ -61,14 +61,14 @@ + #define DEFAULT_LNAME_FILENAME "@PREFIX/lib/krb5.aname" + #endif /* _WINDOWS */ + +-#define DEFAULT_KDB_FILE "@LOCALSTATEDIR/krb5kdc/principal" +-#define DEFAULT_KEYFILE_STUB "@LOCALSTATEDIR/krb5kdc/.k5." +-#define KRB5_DEFAULT_ADMIN_ACL "@LOCALSTATEDIR/krb5kdc/krb5_adm.acl" ++#define DEFAULT_KDB_FILE "/etc/krb5kdc/principal" ++#define DEFAULT_KEYFILE_STUB "/etc/krb5kdc/.k5." ++#define KRB5_DEFAULT_ADMIN_ACL "/etc/krb5kdc/krb5_adm.acl" + /* Used by old admin server */ +-#define DEFAULT_ADMIN_ACL "@LOCALSTATEDIR/krb5kdc/kadm_old.acl" ++#define DEFAULT_ADMIN_ACL "/etc/krb5kdc/kadm_old.acl" + + /* Location of KDC profile */ +-#define DEFAULT_KDC_PROFILE "@LOCALSTATEDIR/krb5kdc/kdc.conf" ++#define DEFAULT_KDC_PROFILE "/etc/krb5kdc/kdc.conf" + #define KDC_PROFILE_ENV "KRB5_KDC_PROFILE" + + #if TARGET_OS_MAC +@@ -97,8 +97,8 @@ + /* + * Defaults for the KADM5 admin system. + */ +-#define DEFAULT_KADM5_KEYTAB "@LOCALSTATEDIR/krb5kdc/kadm5.keytab" +-#define DEFAULT_KADM5_ACL_FILE "@LOCALSTATEDIR/krb5kdc/kadm5.acl" ++#define DEFAULT_KADM5_KEYTAB "/etc/krb5kdc/kadm5.keytab" ++#define DEFAULT_KADM5_ACL_FILE "/etc/krb5kdc/kadm5.acl" + #define DEFAULT_KADM5_PORT 749 /* assigned by IANA */ + + #define KRB5_DEFAULT_SUPPORTED_ENCTYPES \ +@@ -123,13 +123,13 @@ + * krb5 slave support follows + */ + +-#define KPROP_DEFAULT_FILE "@LOCALSTATEDIR/krb5kdc/slave_datatrans" +-#define KPROPD_DEFAULT_FILE "@LOCALSTATEDIR/krb5kdc/from_master" ++#define KPROP_DEFAULT_FILE "/etc/krb5kdc/slave_datatrans" ++#define KPROPD_DEFAULT_FILE "/etc/krb5kdc/from_master" + #define KPROPD_DEFAULT_KDB5_UTIL "@SBINDIR/kdb5_util" + #define KPROPD_DEFAULT_KDB5_EDIT "@SBINDIR/kdb5_edit" + #define KPROPD_DEFAULT_KPROP "@SBINDIR/kprop" + #define KPROPD_DEFAULT_KRB_DB DEFAULT_KDB_FILE +-#define KPROPD_ACL_FILE "@LOCALSTATEDIR/krb5kdc/kpropd.acl" ++#define KPROPD_ACL_FILE "/etc/krb5kdc/kpropd.acl" + + /* + * GSS mechglue diff --git a/net/krb5/patches/002-MITKRB5-SA-2011-002.patch b/net/krb5/patches/002-MITKRB5-SA-2011-002.patch new file mode 100644 index 0000000..5e0da20 --- /dev/null +++ b/net/krb5/patches/002-MITKRB5-SA-2011-002.patch @@ -0,0 +1,112 @@ +diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h +index 1ca09b4..60caf3d 100644 +--- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h ++++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h +@@ -102,14 +102,18 @@ extern void prepend_err_str (krb5_context ctx, const char *s, krb5_error_code er + #define LDAP_SEARCH(base, scope, filter, attrs) LDAP_SEARCH_1(base, scope, filter, attrs, CHECK_STATUS) + + #define LDAP_SEARCH_1(base, scope, filter, attrs, status_check) \ +- do { \ +- st = ldap_search_ext_s(ld, base, scope, filter, attrs, 0, NULL, NULL, &timelimit, LDAP_NO_LIMIT, &result); \ +- if (translate_ldap_error(st, OP_SEARCH) == KRB5_KDB_ACCESS_ERROR) { \ +- tempst = krb5_ldap_rebind(ldap_context, &ldap_server_handle); \ +- if (ldap_server_handle) \ +- ld = ldap_server_handle->ldap_handle; \ +- } \ +- }while (translate_ldap_error(st, OP_SEARCH) == KRB5_KDB_ACCESS_ERROR && tempst == 0); \ ++ tempst = 0; \ ++ st = ldap_search_ext_s(ld, base, scope, filter, attrs, 0, NULL, \ ++ NULL, &timelimit, LDAP_NO_LIMIT, &result); \ ++ if (translate_ldap_error(st, OP_SEARCH) == KRB5_KDB_ACCESS_ERROR) { \ ++ tempst = krb5_ldap_rebind(ldap_context, &ldap_server_handle); \ ++ if (ldap_server_handle) \ ++ ld = ldap_server_handle->ldap_handle; \ ++ if (tempst == 0) \ ++ st = ldap_search_ext_s(ld, base, scope, filter, attrs, 0, \ ++ NULL, NULL, &timelimit, \ ++ LDAP_NO_LIMIT, &result); \ ++ } \ + \ + if (status_check != IGNORE_STATUS) { \ + if (tempst != 0) { \ +diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c +index 82b0333..84e80ee 100644 +--- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c ++++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c +@@ -302,6 +302,7 @@ krb5_ldap_rebind(krb5_ldap_context *ldap_context, + { + krb5_ldap_server_handle *handle = *ldap_server_handle; + ++ ldap_unbind_ext_s(handle->ldap_handle, NULL, NULL); + if ((ldap_initialize(&handle->ldap_handle, handle->server_info->server_name) != LDAP_SUCCESS) + || (krb5_ldap_bind(ldap_context, handle) != LDAP_SUCCESS)) + return krb5_ldap_request_next_handle_from_pool(ldap_context, ldap_server_handle); +diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c +index f549e23..b70940f 100644 +--- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c ++++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c +@@ -446,12 +446,11 @@ is_principal_in_realm(krb5_ldap_context *ldap_context, + * portion, then the first portion of the principal name SHOULD be + * "krbtgt". All this check is done in the immediate block. + */ +- if (searchfor->length == 2) +- if ((strncasecmp(searchfor->data[0].data, "krbtgt", +- FIND_MAX(searchfor->data[0].length, strlen("krbtgt"))) == 0) && +- (strncasecmp(searchfor->data[1].data, defrealm, +- FIND_MAX(searchfor->data[1].length, defrealmlen)) == 0)) ++ if (searchfor->length == 2) { ++ if (data_eq_string(searchfor->data[0], "krbtgt") && ++ data_eq_string(searchfor->data[1], defrealm)) + return 0; ++ } + + /* first check the length, if they are not equal, then they are not same */ + if (strlen(defrealm) != searchfor->realm.length) +diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c +index 7ad31da..626ed1f 100644 +--- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c ++++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c +@@ -103,10 +103,10 @@ krb5_ldap_get_principal(krb5_context context, krb5_const_principal searchfor, + unsigned int flags, krb5_db_entry *entries, + int *nentries, krb5_boolean *more) + { +- char *user=NULL, *filter=NULL, **subtree=NULL; ++ char *user=NULL, *filter=NULL, *filtuser=NULL; + unsigned int tree=0, ntrees=1, princlen=0; + krb5_error_code tempst=0, st=0; +- char **values=NULL, *cname=NULL; ++ char **values=NULL, **subtree=NULL, *cname=NULL; + LDAP *ld=NULL; + LDAPMessage *result=NULL, *ent=NULL; + krb5_ldap_context *ldap_context=NULL; +@@ -142,12 +142,18 @@ krb5_ldap_get_principal(krb5_context context, krb5_const_principal searchfor, + if ((st=krb5_ldap_unparse_principal_name(user)) != 0) + goto cleanup; + +- princlen = strlen(FILTER) + strlen(user) + 2 + 1; /* 2 for closing brackets */ ++ filtuser = ldap_filter_correct(user); ++ if (filtuser == NULL) { ++ st = ENOMEM; ++ goto cleanup; ++ } ++ ++ princlen = strlen(FILTER) + strlen(filtuser) + 2 + 1; /* 2 for closing brackets */ + if ((filter = malloc(princlen)) == NULL) { + st = ENOMEM; + goto cleanup; + } +- snprintf(filter, princlen, FILTER"%s))", user); ++ snprintf(filter, princlen, FILTER"%s))", filtuser); + + if ((st = krb5_get_subtree_info(ldap_context, &subtree, &ntrees)) != 0) + goto cleanup; +@@ -231,6 +237,9 @@ cleanup: + if (user) + free(user); + ++ if (filtuser) ++ free(filtuser); ++ + if (cname) + free(cname); + diff --git a/net/l2tpd/Makefile b/net/l2tpd/Makefile new file mode 100644 index 0000000..c503580 --- /dev/null +++ b/net/l2tpd/Makefile @@ -0,0 +1,61 @@ +# +# 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:=l2tpd +PKG_VERSION:=0.70pre +PKG_UPSTREAM_VERSION:=0.70-pre20031121 +PKG_RELEASE:=4.1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_UPSTREAM_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/l/l2tpd +PKG_MD5SUM:=3f2707b6e16a8cb72e7bf64f574202fa + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).orig + +include $(INCLUDE_DIR)/package.mk + +define Package/l2tpd + SECTION:=net + CATEGORY:=Network + TITLE:=An L2TP (Layer 2 Tunneling Protocol) daemon + URL:=http://l2tpd.sourceforge.net/ + SUBMENU:=VPN +endef + +define Package/l2tpd/description + l2tpd is the open source implementation of the L2TP tunneling + protocol (RFC2661). It does implement both LAC and LNS role + in a L2TP networking architecture. The main goal of this protocol is + to tunnel PPP frame trough an ip network. +endef + +define Package/l2tpd/conffiles +/etc/l2tpd/l2tpd.conf +/etc/ppp/options.l2tpd +endef + +define Build/Compile + $(call Build/Compile/Default, \ + CFLAGS="$(TARGET_CFLAGS) -I. -DLINUX -DSANITY -DIP_ALLOCATION" \ + ) +endef + +define Package/l2tpd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/l2tpd + $(INSTALL_DATA) ./files/l2tpd.conf $(1)/etc/l2tpd/ + $(INSTALL_DIR) $(1)/etc/ppp + $(INSTALL_DATA) ./files/options.l2tpd $(1)/etc/ppp/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/l2tpd.init $(1)/etc/init.d/l2tpd +endef + +$(eval $(call BuildPackage,l2tpd)) + diff --git a/net/l2tpd/files/l2tpd.conf b/net/l2tpd/files/l2tpd.conf new file mode 100644 index 0000000..2a9ba1c --- /dev/null +++ b/net/l2tpd/files/l2tpd.conf @@ -0,0 +1,29 @@ +; +; This is a minimal sample l2tpd configuration file for use +; with L2TP over IPsec. +; +; The idea is to provide an L2TP daemon to which remote Windows L2TP/IPsec +; clients connect. In this example, the internal (protected) network +; is 192.168.1.0/24. A special IP range within this network is reserved +; for the remote clients: 192.168.1.128/25 +; (i.e. 192.168.1.128 ... 192.168.1.254) +; +; The listen-addr parameter can be used if you want to bind the L2TP daemon +; to a specific IP address instead of to all interfaces. For instance, +; you could bind it to the interface of the internal LAN (e.g. 192.168.1.98 +; in the example below). Yet another IP address (local ip, e.g. 192.168.1.99) +; will be used by l2tpd as its address on pppX interfaces. + +[global] +; listen-addr = 192.168.1.98 + +[lns default] +ip range = 192.168.1.128-192.168.1.254 +local ip = 192.168.1.99 +require chap = yes +refuse pap = yes +require authentication = yes +name = LinuxVPNserver +ppp debug = yes +pppoptfile = /etc/ppp/options.l2tpd +length bit = yes diff --git a/net/l2tpd/files/l2tpd.init b/net/l2tpd/files/l2tpd.init new file mode 100644 index 0000000..7549c19 --- /dev/null +++ b/net/l2tpd/files/l2tpd.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +START=60 +BIN=l2tpd +DEFAULT=/etc/default/$BIN +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid + +start() { + [ -f $DEFAULT ] && . $DEFAULT + $BIN $OPTIONS +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) +} + diff --git a/net/l2tpd/files/options.l2tpd b/net/l2tpd/files/options.l2tpd new file mode 100644 index 0000000..425a56e --- /dev/null +++ b/net/l2tpd/files/options.l2tpd @@ -0,0 +1,17 @@ +ipcp-accept-local +ipcp-accept-remote +ms-dns 192.168.1.1 +ms-dns 192.168.1.3 +ms-wins 192.168.1.2 +ms-wins 192.168.1.4 +noccp +auth +crtscts +idle 1800 +mtu 1410 +mru 1410 +nodefaultroute +debug +lock +proxyarp +connect-delay 5000 diff --git a/net/l2tpd/patches/001-debian-2.patch b/net/l2tpd/patches/001-debian-2.patch new file mode 100644 index 0000000..8a6e204 --- /dev/null +++ b/net/l2tpd/patches/001-debian-2.patch @@ -0,0 +1,3394 @@ +--- l2tpd-0.70-pre20031121.orig/Makefile ++++ l2tpd-0.70-pre20031121/Makefile +@@ -28,7 +28,8 @@ + # become runtime options) debugging flags + # + #DFLAGS= -g -O2 -DDEBUG_PPPD +-DFLAGS= -g -O2 -DDEBUG_PPPD -DDEBUG_CONTROL -DDEBUG_ENTROPY ++#DFLAGS= -g -O2 -Wall -DDEBUG_PPPD -DDEBUG_CONTROL -DDEBUG_ENTROPY ++DFLAGS= -ggdb -Wall -DDEBUG_PPPD -DDEBUG_CONTROL -DDEBUG_ENTROPY + # + # Uncomment the next line for Linux + # +@@ -58,7 +59,7 @@ + + FFLAGS= -DIP_ALLOCATION + +-CFLAGS= $(DFLAGS) -Wall -DSANITY $(OSFLAGS) $(FFLAGS) ++CFLAGS= $(DFLAGS) -Wall -DSANITY $(OSFLAGS) $(FFLAGS) + HDRS=l2tp.h avp.h misc.h control.h call.h scheduler.h file.h aaa.h md5.h + OBJS=l2tpd.o pty.o misc.o control.o avp.o call.o network.o avpsend.o scheduler.o file.o aaa.o md5.o + LIBS= $(OSLIB) # -lefence # efence for malloc checking +--- l2tpd-0.70-pre20031121.orig/control.c ++++ l2tpd-0.70-pre20031121/control.c +@@ -227,7 +227,7 @@ + add_bearer_caps_avp (buf, t->ourbc); + /* FIXME: Tie breaker */ + add_firmware_avp (buf); +- add_hostname_avp (buf); ++ add_hostname_avp (buf, t); + add_vendor_avp (buf); + add_tunnelid_avp (buf, t->ourtid); + if (t->ourrws >= 0) +@@ -346,7 +346,6 @@ + "%s: Peer did not specify assigned tunnel ID. Closing.\n", + __FUNCTION__); + set_error (c, VENDOR_ERROR, "Specify your assigned tunnel ID"); +- c->needclose = -1; + return -EINVAL; + } + if (!(t->lns = get_lns (t))) +@@ -356,7 +355,6 @@ + "%s: Denied connection to unauthorized peer %s\n", + __FUNCTION__, IPADDY (t->peer.sin_addr)); + set_error (c, VENDOR_ERROR, "No Authorization"); +- c->needclose = -1; + return -EINVAL; + } + t->ourrws = t->lns->tun_rws; +@@ -368,7 +366,6 @@ + "%s: Peer did not specify framing capability. Closing.\n", + __FUNCTION__); + set_error (c, VENDOR_ERROR, "Specify framing capability"); +- c->needclose = -1; + return -EINVAL; + } + /* FIXME: Do we need to be sure they specified a version number? +@@ -380,7 +377,6 @@ + if (DEBUG) log(LOG_DEBUG, + "%s: Peer did not specify bearer capability. Closing.\n",__FUNCTION__); + set_error(c, VENDOR_ERROR, "Specify bearer capability"); +- c->needclose = -1; + return -EINVAL; + } */ + if ((!strlen (t->hostname)) && ((t->chal_us.state) || ((t->lns->challenge)))) +@@ -390,7 +386,6 @@ + "%s: Peer did not specify hostname. Closing.\n", + __FUNCTION__); + set_error (c, VENDOR_ERROR, "Specify your hostname"); +- c->needclose = -1; + return -EINVAL; + } + y = tunnels.head; +@@ -427,7 +422,7 @@ + add_frame_caps_avp (buf, t->ourfc); + add_bearer_caps_avp (buf, t->ourbc); + add_firmware_avp (buf); +- add_hostname_avp (buf); ++ add_hostname_avp (buf, t); + add_vendor_avp (buf); + add_tunnelid_avp (buf, t->ourtid); + if (t->ourrws >= 0) +@@ -481,7 +476,6 @@ + "%s: Peer did not specify framing capability. Closing.\n", + __FUNCTION__); + set_error (c, VENDOR_ERROR, "Specify framing capability"); +- c->needclose = -1; + return -EINVAL; + } + /* FIXME: Do we need to be sure they specified a version number? +@@ -493,7 +487,6 @@ + if (DEBUG) log(LOG_DEBUG, + "%s: Peer did not specify bearer capability. Closing.\n",__FUNCTION__); + set_error(c, VENDOR_ERROR, "Specify bearer capability"); +- c->needclose = -1; + return -EINVAL; + } */ + if ((!strlen (t->hostname)) && ((t->chal_them.state) || ((t->chal_us.state)))) +@@ -503,7 +496,6 @@ + "%s: Peer did not specify hostname. Closing.\n", + __FUNCTION__); + set_error (c, VENDOR_ERROR, "Specify your hostname"); +- c->needclose = -1; + return -EINVAL; + } + if (t->tid <= 0) +@@ -513,7 +505,6 @@ + "%s: Peer did not specify assigned tunnel ID. Closing.\n", + __FUNCTION__); + set_error (c, VENDOR_ERROR, "Specify your assigned tunnel ID"); +- c->needclose = -1; + return -EINVAL; + } + if (t->chal_them.state) +@@ -524,7 +515,6 @@ + set_error (c, VENDOR_ERROR, "No secret key on our side"); + log (LOG_WARN, "%s: No secret key for authenticating '%s'\n", + __FUNCTION__, t->hostname); +- c->needclose = -1; + return -EINVAL; + } + if (memcmp +@@ -534,7 +524,6 @@ + "Invalid challenge authentication"); + log (LOG_DEBUG, "%s: Invalid authentication for host '%s'\n", + __FUNCTION__, t->hostname); +- c->needclose = -1; + return -EINVAL; + } + } +@@ -546,7 +535,6 @@ + log (LOG_WARN, "%s: No secret for authenticating to '%s'\n", + __FUNCTION__, t->hostname); + set_error (c, VENDOR_ERROR, "No secret key on our end"); +- c->needclose = -1; + return -EINVAL; + }; + } +@@ -606,7 +594,6 @@ + "Invalid challenge authentication"); + log (LOG_DEBUG, "%s: Invalid authentication for host '%s'\n", + __FUNCTION__, t->hostname); +- c->needclose = -1; + return -EINVAL; + } + } +@@ -1584,6 +1571,14 @@ + wbuf[pos++] = e; + for (x = 0; x < buf->len; x++) + { ++ // we must at least still have 4 bytes left in the worst case scenario: ++ // 1 for a possible escape, 1 for the value and 1 to end the PPP stream. ++ if(pos >= (sizeof(wbuf) - 4)) { ++ if(DEBUG) ++ log(LOG_CRIT, "%s: rx packet is too big after PPP encoding (size %u, max is %u)\n", ++ __FUNCTION__, buf->len, MAX_RECV_SIZE); ++ return -EINVAL; ++ } + e = *((char *) buf->start + x); + if ((e < 0x20) || (e == PPP_ESCAPE) || (e == PPP_FLAG)) + { +@@ -1592,7 +1587,6 @@ + wbuf[pos++] = PPP_ESCAPE; + } + wbuf[pos++] = e; +- + } + wbuf[pos++] = PPP_FLAG; + x = write (c->fd, wbuf, pos); +--- l2tpd-0.70-pre20031121.orig/misc.h ++++ l2tpd-0.70-pre20031121/misc.h +@@ -80,4 +80,11 @@ + extern void safe_copy (char *, char *, int); + extern void opt_destroy (struct ppp_opts *); + extern struct ppp_opts *add_opt (struct ppp_opts *, char *, ...); ++extern u_int16_t get16(u_int8_t *); ++extern u_int32_t get32(u_int8_t *); ++extern u_int64_t get64(u_int8_t *); ++extern void set16(u_int8_t *, u_int16_t); ++extern void set32(u_int8_t *, u_int32_t); ++extern void set64(u_int8_t *, u_int64_t); ++ + #endif +--- l2tpd-0.70-pre20031121.orig/avp.h ++++ l2tpd-0.70-pre20031121/avp.h +@@ -19,22 +19,35 @@ + + struct avp_hdr + { +- _u16 length; +- _u16 vendorid; +- _u16 attr; ++ u_int16_t length; ++ u_int16_t vendorid; ++ u_int16_t attr; + }; + ++#define AVP_F_MANDATORY 0x1 ++#define AVP_F_FIXLEN 0x2 ++#define AVP_F_ASCII 0x4 ++ + struct avp + { +- int num; /* Number of AVP */ +- int m; /* Set M? */ +- int (*handler) (struct tunnel *, struct call *, void *, int); +- /* This should handle the AVP +- taking a tunnel, call, the data, +- and the length of the AVP as +- parameters. Should return 0 +- upon success */ +- char *description; /* A name, for debugging */ ++ u_int32_t num; /* Number of AVP */ ++ u_int32_t flags; ++ u_int32_t sz; /* expected avp payload size as ++ * (AVP_F_FIXLEN) ? (==) : (!>=) ++ * note: size checked is performed ++ * after unhiding */ ++ u_int8_t allowed_states[8]; /* List of allowed message types for ++ * a particular avp. Fixed len for ++ * alignement issues. */ ++ ++ /* This should handle the AVP taking a tunnel, call, ++ * the data, and the length of the AVP as parameters. ++ * Should return 0 upon success */ ++ int (*handle) (struct tunnel *, struct call *, void *, int); ++ ++ /* This should handle avp specifics sanity checks */ ++ int (*validate) (int, struct tunnel *, struct call *, void *, int); ++ char *description; /* A name, for debugging */ + }; + + extern int handle_avps (struct buffer *buf, struct tunnel *t, struct call *c); +@@ -84,8 +97,56 @@ + #define RESULT_CLEAR 1 + #define RESULT_ERROR 2 + #define RESULT_EXISTS 3 ++ ++/* avp id's */ ++#define MESSAGE_TYPE_AVP 0 ++#define RESULT_CODE_AVP 1 ++#define PROTOCOL_VERSION_AVP 2 ++#define FRAMING_CAP_AVP 3 ++#define BEARER_CAP_AVP 4 ++#define TIE_BREAKER_AVP 5 ++#define FIRMWARE_REV_AVP 6 ++#define HOSTNAME_AVP 7 ++#define VENDOR_NAME_AVP 8 ++#define ASSIGNED_TUN_ID_AVP 9 ++#define RX_WIN_SIZE_AVP 10 ++#define CHALLENGE_AVP 11 ++#define CHALLENGE_RESP_AVP 12 ++#define CAUSE_ERROR_AVP 13 ++#define ASSIGNED_SES_ID_AVP 14 ++#define SERIAL_NUMBER_AVP 15 ++#define MIN_BPS_AVP 16 ++#define MAX_BPS_AVP 17 ++#define BEARER_TYPE_AVP 18 ++#define FRAMING_TYPE_AVP 19 ++#define PACKET_DELAY_AVP 20 ++#define CALLED_NUMBER_AVP 21 ++#define CALLING_NUMBER_AVP 22 ++#define SUB_ADDRESS_AVP 23 ++#define TX_CONNECT_SPEED_AVP 24 ++#define PHYS_CHAN_ID_AVP 25 ++#define INIT_RX_LCP_AVP 26 ++#define LAST_TX_LCP_AVP 27 ++#define LAST_RX_LCP_AVP 28 ++#define PROXY_AUTH_TYPE_AVP 29 ++#define PROXY_AUTH_NAME_AVP 30 ++#define PROXY_AUTH_CHAL_AVP 31 ++#define PROXY_AUTH_ID_AVP 32 ++#define PROXY_AUTH_CHAL_RESP_AVP 33 ++#define CALL_ERROR_AVP 34 ++#define ACCM_AVP 35 ++#define RANDOM_VECTOR_AVP 36 ++#define PRIV_GROUP_ID_AVP 37 ++#define RX_CONNECT_SPEED_AVP 38 ++#define SEQ_REQUIRED_AVP 39 ++#define AVP_MAX SEQ_REQUIRED_AVP ++ ++extern int validate_msgtype_avp(int, struct tunnel *, struct call *, void *, int); ++extern int validate_gen_avp(int, struct tunnel *, struct call *, void *, int); ++ + extern void encrypt_avp (struct buffer *, _u16, struct tunnel *); + extern int decrypt_avp (char *, struct tunnel *); ++ + extern int message_type_avp (struct tunnel *, struct call *, void *, int); + extern int protocol_version_avp (struct tunnel *, struct call *, void *, int); + extern int framing_caps_avp (struct tunnel *, struct call *, void *, int); +@@ -97,12 +158,12 @@ + extern int receive_window_size_avp (struct tunnel *, struct call *, void *, + int); + extern int result_code_avp (struct tunnel *, struct call *, void *, int); +-extern int assigned_call_avp (struct tunnel *, struct call *, void *, int); ++extern int assigned_session_avp (struct tunnel *, struct call *, void *, int); + extern int call_serno_avp (struct tunnel *, struct call *, void *, int); + extern int bearer_type_avp (struct tunnel *, struct call *, void *, int); + extern int call_physchan_avp (struct tunnel *, struct call *, void *, int); +-extern int dialed_number_avp (struct tunnel *, struct call *, void *, int); +-extern int dialing_number_avp (struct tunnel *, struct call *, void *, int); ++extern int called_number_avp (struct tunnel *, struct call *, void *, int); ++extern int calling_number_avp (struct tunnel *, struct call *, void *, int); + extern int sub_address_avp (struct tunnel *, struct call *, void *, int); + extern int frame_type_avp (struct tunnel *, struct call *, void *, int); + extern int rx_speed_avp (struct tunnel *, struct call *, void *, int); +@@ -118,7 +179,7 @@ + extern int add_avp_rws (struct buffer *, _u16); + extern int add_tunnelid_avp (struct buffer *, _u16); + extern int add_vendor_avp (struct buffer *); +-extern int add_hostname_avp (struct buffer *); ++extern int add_hostname_avp (struct buffer *, struct tunnel*); + extern int add_firmware_avp (struct buffer *); + extern int add_bearer_caps_avp (struct buffer *buf, _u16 caps); + extern int add_frame_caps_avp (struct buffer *buf, _u16 caps); +--- l2tpd-0.70-pre20031121.orig/network.c ++++ l2tpd-0.70-pre20031121/network.c +@@ -214,6 +214,8 @@ + t->self->needclose = -1; + } + } ++ free(buf->rstart); ++ free(buf); + } + else + { +@@ -371,7 +373,9 @@ + if (debug_network) + { + log (LOG_DEBUG, "%s: recv packet from %s, size = %d," \ +-"tunnel = %d, call = %d\n", __FUNCTION__, inet_ntoa (from.sin_addr), recvsize, tunnel, call); ++ "tunnel = %d, call = %d\n", __func__, ++ inet_ntoa (from.sin_addr), recvsize, ++ tunnel, call); + } + if (packet_dump) + { +--- l2tpd-0.70-pre20031121.orig/aaa.c ++++ l2tpd-0.70-pre20031121/aaa.c +@@ -209,9 +209,11 @@ + __FUNCTION__, u, t, s); + #endif + strncpy (secret, s, size); ++ fclose(f); + return -1; + } + } ++ fclose(f); + return 0; + } + +--- l2tpd-0.70-pre20031121.orig/l2tpd.c ++++ l2tpd-0.70-pre20031121/l2tpd.c +@@ -266,6 +266,9 @@ + /* erase pid file */ + unlink (gconfig.pidfile); + ++ /* erase control pipe */ ++ unlink(CONTROL_PIPE); ++ + exit (1); + } + +@@ -333,13 +336,17 @@ + tcgetattr (c->fd, &ptyconf); + *(c->oldptyconf) = ptyconf; + ptyconf.c_cflag &= ~(ICANON | ECHO); +- ptyconf.c_lflag &= ~ECHO; ++ ptyconf.c_lflag &= ~ECHO; + tcsetattr (c->fd, TCSANOW, &ptyconf); + + snprintf (tty, sizeof (tty), "/dev/tty%c%c", a, b); + fd2 = open (tty, O_RDWR); +- stropt[pos++] = strdup(tty); +- stropt[pos] = NULL; ++ if(!fd2) ++ log(LOG_WARN, "unable to open tty %s", tty); ++ ++ /* XXX JEF: CHECK ME */ ++ stropt[pos++] = strdup(tty); ++ stropt[pos] = NULL; + + #ifdef USE_KERNEL + } +@@ -623,7 +630,13 @@ + { + struct lac *lac; + lac = (struct lac *) data; +- if (!lac->active) ++ ++ if (!lac) ++ { ++ log (LOG_WARN, "%s : called on NULL lac!\n", __FUNCTION__); ++ return; ++ } ++ if (!lac->active) + { + log (LOG_DEBUG, "%s: LAC %s not active", __FUNCTION__, lac->entname); + return; +@@ -635,11 +648,6 @@ + log (LOG_LOG, "%s: maximum retries exceeded.\n", __FUNCTION__); + return; + } +- if (!lac) +- { +- log (LOG_WARN, "%s : called on NULL lac!\n", __FUNCTION__); +- return; +- } + if (!lac->t) + { + #ifdef DEGUG_MAGIC +@@ -774,12 +782,7 @@ + void do_control () + { + char buf[1024]; +- char *host; +- char *tunstr; +- char *callstr; +- +- char *sub_str; /* jz: use by the strtok function */ +- char *tmp_ptr; /* jz: use by the strtok function */ ++ char *host, *tunstr, *callstr, *tmpstr; + struct lac *lac; + int call; + int tunl; +@@ -792,24 +795,39 @@ + if (buf[cnt - 1] == '\n') + buf[--cnt] = 0; + #ifdef DEBUG_CONTROL +- log (LOG_DEBUG, "%s: Got message %s (%d bytes long)\n", ++ log (LOG_DEBUG, "%s: Got message \"%s\" (%d bytes long)\n", + __FUNCTION__, buf, cnt); + #endif + switch (buf[0]) + { + case 't': +- host = strchr (buf, ' ') + 1; ++ host = strchr (buf, ' '); ++ if(!host) ++ goto out; ++ host++; + #ifdef DEBUG_CONTROL + log (LOG_DEBUG, "%s: Attempting to tunnel to %s\n", + __FUNCTION__, host); + #endif + l2tp_call (host, UDP_LISTEN_PORT, NULL, NULL); + break; +- case 'c': +- +- switch_io = 1; /* jz: Switch for Incoming - Outgoing Calls */ +- +- tunstr = strchr (buf, ' ') + 1; ++ case 'c': /* option 'c' for incoming call */ ++ case 'o': /* option 'o' for outgoing call */ ++ tunstr = strchr (buf, ' '); ++ if(!tunstr) ++ goto out; ++ tunstr++; ++ ++ if(buf[0] == 'c') ++ switch_io = 1; /* Switch for Incoming Calls */ ++ else { ++ switch_io = 0; /* Switch for Outgoing Calls */ ++ tmpstr = strchr(tunstr, ' '); ++ if(!tmpstr) ++ goto out; ++ strncpy(dial_no_tmp,tmpstr, sizeof(*dial_no_tmp)); ++ } ++ + lac = laclist; + while (lac) + { +@@ -842,52 +860,12 @@ + #endif + lac_call (tunl, NULL, NULL); + break; +- +- case 'o': /* jz: option 'o' for doing a outgoing call */ +- +- switch_io = 0; /* jz: Switch for incoming - outgoing Calls */ +- +- sub_str = strchr (buf, ' ') + 1; +- +- tunstr = strtok (sub_str, " "); /* jz: using strtok function to get */ +- tmp_ptr = strtok (NULL, " "); /* params out of the pipe */ +- strcpy (dial_no_tmp, tmp_ptr); +- +- lac = laclist; +- while (lac) +- { +- if (!strcasecmp (lac->entname, tunstr)) +- { +- lac->active = -1; +- lac->rtries = 0; +- if (!lac->c) +- magic_lac_dial (lac); +- else +- log (LOG_DEBUG, +- "%s: Session '%s' already active!\n", +- __FUNCTION__, lac->entname); +- break; +- } +- lac = lac->next; +- } +- if (lac) +- break; +- tunl = atoi (tunstr); +- if (!tunl) +- { +- log (LOG_DEBUG, "%s: No such tunnel '%s'\n", __FUNCTION__, +- tunstr); +- break; +- } +-#ifdef DEBUG_CONTROL +- log (LOG_DEBUG, "%s: Attempting to call on tunnel %d\n", +- __FUNCTION__, tunl); +-#endif +- lac_call (tunl, NULL, NULL); +- break; +- + case 'h': +- callstr = strchr (buf, ' ') + 1; ++ callstr = strchr (buf, ' '); ++ if(!callstr) ++ goto out; ++ callstr++; ++ + call = atoi (callstr); + #ifdef DEBUG_CONTROL + log (LOG_DEBUG, "%s: Attempting to call %d\n", __FUNCTION__, +@@ -896,7 +874,11 @@ + lac_hangup (call); + break; + case 'd': +- tunstr = strchr (buf, ' ') + 1; ++ tunstr = strchr (buf, ' '); ++ if(!tunstr) ++ goto out; ++ tunstr++; ++ + lac = laclist; + while (lac) + { +@@ -937,6 +919,8 @@ + } + } + } ++ ++out: + /* Otherwise select goes nuts */ + close (control_fd); + control_fd = open (CONTROL_PIPE, O_RDONLY | O_NONBLOCK, 0600); +@@ -1002,7 +986,6 @@ + int pid=0; + int i,l; + char buf[STRLEN]; +- int pidfilewritten=0; + + if((pid = fork()) < 0) { + log(LOG_LOG, "%s: Unable to fork ()\n",__FUNCTION__); +@@ -1012,56 +995,52 @@ + else if (pid) + exit(0); + +- close(0); +- close(1); +- close(2); ++ ++ close(0); ++ close(1); ++ close(2); ++ dup2(open("/dev/null", O_RDONLY), 0); ++ dup2(open("/dev/null", O_RDONLY), 1); ++ dup2(open("/dev/null", O_RDONLY), 2); + + /* Read previous pid file. */ +- if ((i = open(gconfig.pidfile,O_RDONLY)) > 0) { +- l=read(i,buf,sizeof(buf)-1); +- if (i < 0) { +- log(LOG_LOG, "%s: Unable to read pid file [%s]\n", +- __FUNCTION__, gconfig.pidfile); +- } +- buf[i] = '\0'; +- pid = atoi(buf); +- +- /* If the previous server process is not still running, +- write a new pid file immediately. */ +- if (pid && (pid == getpid () || kill (pid, 0) < 0)) { +- unlink (gconfig.pidfile); +- if ((i = open (gconfig.pidfile, O_WRONLY | O_CREAT, 0640)) >= 0) +- { +- snprintf (buf, sizeof(buf), "%d\n", (int)getpid()); +- write (i, buf, strlen(buf)); +- close (i); +- pidfilewritten = 1; +- } ++ if((i = open(gconfig.pidfile,O_RDONLY)) > 0) { ++ l=read(i,buf,sizeof(buf)-1); ++ if (l >= 0) { ++ buf[l] = '\0'; ++ pid = atoi(buf); + } +- else +- { ++ close(i); ++ ++ /* if pid is read and process exist exit */ ++ if(pid && !kill(pid, 0)) { + log(LOG_LOG, "%s: There's already a l2tpd server running.\n", + __FUNCTION__); + close(server_socket); + exit(1); + } ++ ++ /* remove stalled pid file */ ++ unlink(gconfig.pidfile); + } + + pid = setsid(); + +- if(! pidfilewritten) { +- unlink(gconfig.pidfile); +- if ((i = open (gconfig.pidfile, O_WRONLY | O_CREAT, 0640)) >= 0) { +- snprintf (buf, strlen(buf), "%d\n", (int)getpid()); +- write (i, buf, strlen(buf)); +- close (i); +- pidfilewritten = 1; +- } +- } ++ /* create new pid file */ ++ if ((i = open (gconfig.pidfile, O_WRONLY | O_CREAT, 0644)) >= 0) { ++ snprintf (buf, sizeof(buf), "%d", (int)getpid()); ++ write (i, buf, strlen(buf)); ++ close (i); ++ } ++ else { ++ log(LOG_LOG, "%s: could not write pid file %s error %d", ++ __FUNCTION__, gconfig.pidfile, i); ++ close(server_socket); ++ exit(1); ++ } + } + + +- + void init (int argc,char *argv[]) + { + struct lac *lac; +@@ -1103,10 +1082,6 @@ + } + log (LOG_LOG, "l2tpd version " SERVER_VERSION " started on %s PID:%d\n", + hostname, getpid ()); +- log (LOG_LOG, +- "Written by Mark Spencer, Copyright (C) 1998, Adtran, Inc.\n"); +- log (LOG_LOG, "Forked by Scott Balmos and David Stipp, (C) 2001\n"); +- log (LOG_LOG, "Inherited by Jeff McAdams, (C) 2002\n"); + listenaddr.s_addr = gconfig.listenaddr; + log (LOG_LOG, "%s version %s on a %s, listening on IP address %s, port %d\n", uts.sysname, + uts.release, uts.machine, inet_ntoa(listenaddr), gconfig.port); +--- l2tpd-0.70-pre20031121.orig/misc.c ++++ l2tpd-0.70-pre20031121/misc.c +@@ -301,3 +301,42 @@ + return -1; + } + } ++ ++u_int16_t get16(u_int8_t *p) { ++ return p[0] << 8 | p[1]; ++} ++ ++u_int32_t get32(u_int8_t *p) { ++ return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3]; ++} ++ ++u_int64_t get64(u_int8_t *p) { ++ return (u_int64_t)p[0] << 56 | (u_int64_t)p[1] << 48 | ++ (u_int64_t)p[2] << 40 | (u_int64_t)p[3] << 32 | ++ (u_int64_t)p[4] << 24 | (u_int64_t)p[5] << 16 | ++ (u_int64_t)p[6] << 8 | (u_int64_t)p[7]; ++} ++ ++void set16(u_int8_t *cp, u_int16_t x) { ++ *cp++ = x >> 8; ++ *cp = x & 0xff; ++} ++ ++void set32(u_int8_t *cp, u_int32_t x) { ++ *cp++ = x >> 24; ++ *cp++ = (x >> 16) & 0xff; ++ *cp++ = (x >> 8) & 0xff; ++ *cp = x & 0xff; ++} ++ ++void set64(u_int8_t *cp, u_int64_t x) { ++ *cp++ = x >> 56; ++ *cp++ = (x >> 48) & 0xff; ++ *cp++ = (x >> 40) & 0xff; ++ *cp++ = (x >> 32) & 0xff; ++ *cp++ = (x >> 24) & 0xff; ++ *cp++ = (x >> 16) & 0xff; ++ *cp++ = (x >> 8) & 0xff; ++ *cp = x & 0xff; ++} ++ +--- l2tpd-0.70-pre20031121.orig/avp.c ++++ l2tpd-0.70-pre20031121/avp.c +@@ -4,9 +4,12 @@ + * Layer Two Tunnelling Protocol Daemon + * Copyright (C) 1998 Adtran, Inc. + * Copyright (C) 2002 Jeff McAdams ++ * Copyright (C) 2003 Jean-Francois Dive + * + * Mark Spencer + * ++ * 12/2003 parsing sanitization, Jean-Francois Dive ++ * + * This software is distributed under the terms + * of the GPL, which you should have received + * along with this source. +@@ -20,50 +23,53 @@ + #include + #include "l2tp.h" + +-#define AVP_MAX 39 ++/* TODO: ++ * - Tie breaker. ++ * - Clean Proxy Authentication solution. ++ */ + ++/*****************************************************************************/ + struct avp avps[] = { +- +- {0, 1, &message_type_avp, "Message Type"}, +- {1, 1, &result_code_avp, "Result Code"}, +- {2, 1, &protocol_version_avp, "Protocol Version"}, +- {3, 1, &framing_caps_avp, "Framing Capabilities"}, +- {4, 1, &bearer_caps_avp, "Bearer Capabilities"}, +- {5, 0, NULL, "Tie Breaker"}, +- {6, 0, &firmware_rev_avp, "Firmware Revision"}, +- {7, 0, &hostname_avp, "Host Name"}, +- {8, 1, &vendor_avp, "Vendor Name"}, +- {9, 1, &assigned_tunnel_avp, "Assigned Tunnel ID"}, +- {10, 1, &receive_window_size_avp, "Receive Window Size"}, +- {11, 1, &challenge_avp, "Challenge"}, +- {12, 0, NULL, "Q.931 Cause Code"}, +- {13, 1, &chalresp_avp, "Challenge Response"}, +- {14, 1, &assigned_call_avp, "Assigned Call ID"}, +- {15, 1, &call_serno_avp, "Call Serial Number"}, +- {16, 1, NULL, "Minimum BPS"}, +- {17, 1, NULL, "Maximum BPS"}, +- {18, 1, &bearer_type_avp, "Bearer Type"}, +- {19, 1, &frame_type_avp, "Framing Type"}, +- {20, 1, &packet_delay_avp, "Packet Processing Delay"}, +- {21, 1, &dialed_number_avp, "Dialed Number"}, +- {22, 1, &dialing_number_avp, "Dialing Number"}, +- {23, 1, &sub_address_avp, "Sub-Address"}, +- {24, 1, &tx_speed_avp, "Transmit Connect Speed"}, +- {25, 1, &call_physchan_avp, "Physical channel ID"}, +- {26, 0, NULL, "Initial Received LCP Confreq"}, +- {27, 0, NULL, "Last Sent LCP Confreq"}, +- {28, 0, NULL, "Last Received LCP Confreq"}, +- {29, 1, &ignore_avp, "Proxy Authen Type"}, +- {30, 0, &ignore_avp, "Proxy Authen Name"}, +- {31, 0, &ignore_avp, "Proxy Authen Challenge"}, +- {32, 0, &ignore_avp, "Proxy Authen ID"}, +- {33, 1, &ignore_avp, "Proxy Authen Response"}, +- {34, 1, NULL, "Call Errors"}, +- {35, 1, &ignore_avp, "ACCM"}, +- {36, 1, &rand_vector_avp, "Random Vector"}, +- {37, 1, NULL, "Private Group ID"}, +- {38, 0, &rx_speed_avp, "Receive Connect Speed"}, +- {39, 1, &seq_reqd_avp, "Sequencing Required"} ++ {0, AVP_F_MANDATORY|AVP_F_FIXLEN, 2, {0}, &message_type_avp, &validate_msgtype_avp, "Message Type"}, ++ {1, AVP_F_MANDATORY, MAXSTRLEN, {CDN, StopCCN}, &result_code_avp, &validate_gen_avp, "Result Code"}, ++ {2, AVP_F_MANDATORY|AVP_F_FIXLEN, 2, {SCCRP, SCCRQ}, &protocol_version_avp, &validate_gen_avp, "Protocol Version"}, ++ {3, AVP_F_MANDATORY|AVP_F_FIXLEN, 4, {SCCRP, SCCRQ}, &framing_caps_avp, &validate_gen_avp, "Framing Capabilities"}, ++ {4, AVP_F_MANDATORY|AVP_F_FIXLEN, 4, {SCCRP, SCCRQ}, &bearer_caps_avp, &validate_gen_avp, "Bearer Capabilities"}, ++ {5, 0, 0, {0}, NULL, NULL, "Tie Breaker"}, ++ {6, AVP_F_FIXLEN, 2, {SCCRP, SCCRQ}, &firmware_rev_avp, &validate_gen_avp, "Firmware Revision"}, ++ {7, AVP_F_ASCII, MAXSTRLEN, {SCCRP, SCCRQ}, &hostname_avp, &validate_gen_avp, "Host Name"}, ++ {8, AVP_F_MANDATORY|AVP_F_ASCII, MAXSTRLEN, {SCCRP, SCCRQ}, &vendor_avp, &validate_gen_avp, "Vendor Name"}, ++ {9, AVP_F_MANDATORY|AVP_F_FIXLEN, 2, {SCCRP, SCCRQ, StopCCN}, &assigned_tunnel_avp, &validate_gen_avp, "Assigned Tunnel ID"}, ++ {10, AVP_F_MANDATORY|AVP_F_FIXLEN, 2,{SCCRP, SCCRQ, OCRP, OCCN, StopCCN}, &receive_window_size_avp, &validate_gen_avp, "Receive Window Size"}, ++ {11, AVP_F_MANDATORY, 128, {SCCRP, SCCRQ}, &challenge_avp, &validate_gen_avp, "Challenge"}, ++ {12, 0, 0, {0}, NULL, NULL, "Q.931 Cause Code"}, ++ {13, AVP_F_MANDATORY, MD_SIG_SIZE, {SCCRP, SCCCN}, &chalresp_avp, &validate_gen_avp, "Challenge Response"}, ++ {14, AVP_F_MANDATORY|AVP_F_FIXLEN, 2, {CDN, ICRP, ICRQ, OCRP, OCRQ}, &assigned_session_avp, &validate_gen_avp, "Assigned Session ID"}, ++ {15, AVP_F_MANDATORY|AVP_F_FIXLEN, 4, {ICRQ, OCRQ}, &call_serno_avp, &validate_gen_avp, "Call Serial Number"}, ++ {16, AVP_F_MANDATORY|AVP_F_FIXLEN, 4, {0}, NULL, NULL, "Minimum BPS"}, ++ {17, AVP_F_MANDATORY|AVP_F_FIXLEN, 4, {0}, NULL, NULL, "Maximum BPS"}, ++ {18, AVP_F_MANDATORY|AVP_F_FIXLEN, 4, {ICRQ, OCRQ}, &bearer_type_avp, &validate_gen_avp, "Bearer Type"}, ++ {19, AVP_F_MANDATORY|AVP_F_FIXLEN, 4, {ICCN, OCRQ, OCCN}, &frame_type_avp, &validate_gen_avp, "Framing Type"}, ++ {20, AVP_F_MANDATORY|AVP_F_FIXLEN, 2, {ICRP, OCRQ, ICCN, OCRP, OCCN}, &packet_delay_avp, &validate_gen_avp, "Packet Processing Delay"}, ++ {21, AVP_F_MANDATORY|AVP_F_ASCII, MAXSTRLEN, {ICRQ, OCRQ}, &called_number_avp, &validate_gen_avp, "Called Number"}, ++ {22, AVP_F_MANDATORY|AVP_F_ASCII, MAXSTRLEN, {ICRQ}, &calling_number_avp, &validate_gen_avp, "Calling Number"}, ++ {23, AVP_F_MANDATORY|AVP_F_ASCII, MAXSTRLEN, {OCRP, ICRQ}, &sub_address_avp, &validate_gen_avp, "Sub-Address"}, ++ {24, AVP_F_MANDATORY|AVP_F_FIXLEN, 4, {ICCN, OCCN, OCRP}, &tx_speed_avp, &validate_gen_avp, "Transmit Connect Speed"}, ++ {25, AVP_F_MANDATORY|AVP_F_FIXLEN, 4, {ICRQ, OCRQ, OCRP, OCCN}, &call_physchan_avp, &validate_gen_avp, "Physical channel ID"}, ++ {26, 0, 0, {0}, NULL, NULL, "Initial Received LCP Confreq"}, ++ {27, 0, 0, {0}, NULL, NULL, "Last Sent LCP Confreq"}, ++ {28, 0, 0, {0}, NULL, NULL, "Last Received LCP Confreq"}, ++ {29, AVP_F_MANDATORY, 0, {0}, &ignore_avp, NULL, "Proxy Authen Type"}, ++ {30, 0, 0, {0}, &ignore_avp, NULL, "Proxy Authen Name"}, ++ {31, 0, 0, {0}, &ignore_avp, NULL, "Proxy Authen Challenge"}, ++ {32, 0, 0, {0}, &ignore_avp, NULL, "Proxy Authen ID"}, ++ {33, AVP_F_MANDATORY, 0, {0}, &ignore_avp, NULL, "Proxy Authen Response"}, ++ {34, AVP_F_MANDATORY|AVP_F_FIXLEN, 26, {0}, NULL, NULL, "Call Errors"}, ++ {35, AVP_F_MANDATORY|AVP_F_FIXLEN, 10, {0}, &ignore_avp, NULL, "ACCM"}, ++ {36, AVP_F_MANDATORY, 1024, {0}, &rand_vector_avp, &validate_gen_avp, "Random Vector"}, ++ {37, AVP_F_MANDATORY, 0, {0}, NULL, NULL, "Private Group ID"}, ++ {38, AVP_F_FIXLEN, 4, {ICCN, OCCN, OCRP}, &rx_speed_avp, &validate_gen_avp, "Receive Connect Speed"}, ++ {39, AVP_F_MANDATORY, 0, {ICCN, OCCN, OCRP}, &seq_reqd_avp, &validate_gen_avp, "Sequencing Required"} + }; + + char *msgtypes[] = { +@@ -111,6 +117,7 @@ + "Call was connected but no appropriate framing was detect" + }; + ++/*****************************************************************************/ + void wrong_length (struct call *c, char *field, int expected, int found, + int min) + { +@@ -126,12 +133,9 @@ + c->needclose = -1; + } + +-/* +- * t, c, data, and datalen may be assumed to be defined for all avp's +- */ +- +-int message_type_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++/*****************************************************************************/ ++int validate_msgtype_avp(int attr, struct tunnel *t, struct call *c, ++ void *data, int datalen) + { + /* + * This will be with every control message. It is critical that this +@@ -139,28 +143,9 @@ + * (assuming sanity check) + */ + +- _u16 *raw = data; +- c->msgtype = ntohs (raw[3]); +- if (datalen != 8) +- { +- if (DEBUG) +- log (LOG_DEBUG, "%s: wrong size (%d != 8)\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Message Type", 8, datalen, 0); +- return -EINVAL; +- } +- if ((c->msgtype > MAX_MSG) || (!msgtypes[c->msgtype])) +- { +- if (DEBUG) +- log (LOG_DEBUG, "%s: unknown message type %d\n", __FUNCTION__, +- c->msgtype); +- return -EINVAL; +- } +- if (debug_avp) +- if (DEBUG) +- log (LOG_DEBUG, "%s: message type %d (%s)\n", __FUNCTION__, +- c->msgtype, msgtypes[c->msgtype]); +-#ifdef SANITY ++ u_int8_t *p = data + sizeof(struct avp_hdr); ++ c->msgtype = get16(p); ++ + if (t->sanity) + { + /* +@@ -172,11 +157,11 @@ + if (DEBUG) + log (LOG_DEBUG, + "%s: attempting to negotiate tunnel inside a call!\n", +- __FUNCTION__); ++ __func__); + return -EINVAL; + } + +- switch (c->msgtype) ++ switch (get16(p)) + { + case SCCRQ: + if ((t->state != 0) && (t->state != SCCRQ)) +@@ -189,7 +174,7 @@ + if (DEBUG) + log (LOG_DEBUG, + "%s: attempting to negotiate SCCRQ with state != 0\n", +- __FUNCTION__); ++ __func__); + return -EINVAL; + } + break; +@@ -199,7 +184,7 @@ + if (DEBUG) + log (LOG_DEBUG, + "%s: attempting to negotiate SCCRP with state != SCCRQ!\n", +- __FUNCTION__); ++ __func__); + return -EINVAL; + } + break; +@@ -209,7 +194,7 @@ + if (DEBUG) + log (LOG_DEBUG, + "%s: attempting to negotiate SCCCN with state != SCCRP!\n", +- __FUNCTION__); ++ __func__); + return -EINVAL; + } + break; +@@ -219,7 +204,7 @@ + if (DEBUG) + log (LOG_DEBUG, + "%s: attempting to negotiate ICRQ when state != SCCCN\n", +- __FUNCTION__); ++ __func__); + return -EINVAL; + } + if (c != t->self) +@@ -227,7 +212,7 @@ + if (DEBUG) + log (LOG_DEBUG, + "%s: attempting to negotiate ICRQ on a call!\n", +- __FUNCTION__); ++ __func__); + return -EINVAL; + } + break; +@@ -237,7 +222,7 @@ + if (DEBUG) + log (LOG_DEBUG, + "%s: attempting to negotiate ICRP on tunnel!=SCCCN\n", +- __FUNCTION__); ++ __func__); + return -EINVAL; + } + if (c->state != ICRQ) +@@ -245,7 +230,7 @@ + if (DEBUG) + log (LOG_DEBUG, + "%s: attempting to negotiate ICRP when state != ICRQ\n", +- __FUNCTION__); ++ __func__); + return -EINVAL; + } + break; +@@ -255,7 +240,7 @@ + if (DEBUG) + log (LOG_DEBUG, + "%s: attempting to negotiate ICCN when state != ICRP\n", +- __FUNCTION__); ++ __func__); + return -EINVAL; + } + break; +@@ -265,7 +250,7 @@ + if (DEBUG) + log (LOG_DEBUG, + "%s: attempting to negotiate SLI when state != ICCN\n", +- __FUNCTION__); ++ __func__); + return -EINVAL; + } + break; +@@ -275,7 +260,7 @@ + if (DEBUG) + log (LOG_DEBUG, + "%s: attempting to negotiate OCRP on tunnel!=SCCCN\n", +- __FUNCTION__); ++ __func__); + return -EINVAL; + } + if (c->state != OCRQ) +@@ -283,7 +268,7 @@ + if (DEBUG) + log (LOG_DEBUG, + "%s: attempting to negotiate OCRP when state != OCRQ\n", +- __FUNCTION__); ++ __func__); + return -EINVAL; + } + break; +@@ -294,7 +279,7 @@ + if (DEBUG) + log (LOG_DEBUG, + "%s: attempting to negotiate OCCN when state != OCRQ\n", +- __FUNCTION__); ++ __func__); + return -EINVAL; + } + break; +@@ -303,72 +288,33 @@ + case Hello: + break; + default: +- log (LOG_WARN, "%s: i don't know how to handle %s messages\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return -EINVAL; +- } +- } +-#endif +- if (c->msgtype == ICRQ) +- { +- struct call *tmp; +- if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, "%s: new incoming call\n", __FUNCTION__); +- } +- tmp = new_call (t); +- if (!tmp) +- { +- log (LOG_WARN, "%s: unable to create new call\n", __FUNCTION__); ++ log (LOG_WARN, "%s: unknown messages type %d\n", ++ __func__, get16(p)); + return -EINVAL; + } +- tmp->next = t->call_head; +- t->call_head = tmp; +- t->count++; +- /* +- * Is this still safe to assume that the head will always +- * be the most recent call being negotiated? +- * Probably... FIXME anyway... +- */ +- + } +- return 0; ++ return 0; + } + +-int rand_vector_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) +-{ +- int size; +- _u16 *raw = (_u16 *) data; +- size = (raw[0] & 0x0FFF) - 6; +- if (t->sanity) +- { +- if (size < 0) +- { +- if (DEBUG) +- log (LOG_DEBUG, "%s: Random vector too small (%d < 0)\n", +- __FUNCTION__, size); +- wrong_length (c, "Random Vector", 6, datalen, 1); +- return -EINVAL; +- } +- if (size > MAX_VECTOR_SIZE) +- { +- if (DEBUG) +- log (LOG_DEBUG, "%s: Random vector too large (%d > %d)\n", +- __FUNCTION__, datalen, MAX_VECTOR_SIZE); +- wrong_length (c, "Random Vector", 6, datalen, 1); +- return -EINVAL; +- } +- } +- if (debug_avp) +- log (LOG_DEBUG, "%s: Random Vector of %d octets\n", __FUNCTION__, +- size); +- t->chal_us.vector = (unsigned char *) &raw[3]; +- t->chal_us.vector_len = size; +- return 0; ++/*****************************************************************************/ ++int validate_gen_avp(int attr, struct tunnel *t, struct call *c, ++ void *data, int datalen) { ++ (void)data; (void)datalen; ++ int i = 0, found = 0; ++ ++ if(t->sanity) { ++ for(i = 0; i < 8; i++) { ++ if(c->msgtype == avps[attr].allowed_states[i]) ++ found++; ++ } ++ if(!found) ++ return -EINVAL; ++ } ++ return 0; + } + ++/* t, c, data, and datalen may be assumed to be defined for all avp's */ ++/*****************************************************************************/ + int ignore_avp (struct tunnel *t, struct call *c, void *data, int datalen) + { + /* +@@ -383,94 +329,88 @@ + * + */ + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, "%s : Ignoring AVP\n", __FUNCTION__); +- } ++ log (LOG_DEBUG, "%s : Ignoring AVP\n", __func__); + return 0; + } + +-int seq_reqd_avp (struct tunnel *t, struct call *c, void *data, int datalen) ++/*****************************************************************************/ ++int message_type_avp (struct tunnel *t, struct call *c, void *data, ++ int avplen) + { +-#ifdef SANITY +- if (t->sanity) ++ u_int8_t *p = data + sizeof(struct avp_hdr); ++ ++ if(!c->msgtype) ++ c->msgtype = get16(p); ++ ++ if ((c->msgtype > MAX_MSG) || (!msgtypes[c->msgtype])) + { +- if (datalen != 6) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is incorrect size. %d != 6\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Sequencing Required", 6, datalen, 1); +- return -EINVAL; +- } +- switch (c->msgtype) ++ log (LOG_DEBUG, "%s: unknown message type %d\n", __func__, ++ c->msgtype); ++ return -EINVAL; ++ } ++ if (debug_avp) ++ log (LOG_DEBUG, "%s: message type %d (%s)\n", __func__, ++ c->msgtype, msgtypes[c->msgtype]); ++ if (c->msgtype == ICRQ) ++ { ++ struct call *tmp; ++ if (debug_avp) ++ log (LOG_DEBUG, "%s: new incoming call\n", __func__); ++ tmp = new_call (t); ++ if (!tmp) + { +- case ICCN: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: sequencing required not appropriate for %s!\n", +- __FUNCTION__, msgtypes[c->msgtype]); ++ log (LOG_WARN, "%s: unable to create new call\n", __func__); + return -EINVAL; + } ++ tmp->next = t->call_head; ++ t->call_head = tmp; ++ t->count++; ++ /* ++ * Is this still safe to assume that the head will always ++ * be the most recent call being negotiated? ++ * Probably... FIXME anyway... ++ */ + } +-#endif ++ return 0; ++} ++ ++/*****************************************************************************/ ++int rand_vector_avp (struct tunnel *t, struct call *c, void *data, ++ int avplen) ++{ ++ u_int8_t *p = data + sizeof(struct avp_hdr); ++ int datalen = avplen - sizeof(struct avp_hdr); + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, "%s: peer requires sequencing.\n", __FUNCTION__); +- } ++ log (LOG_DEBUG, "%s: random vector len %d\n", __func__, datalen); ++ t->chal_us.vector = (unsigned char *)p; ++ t->chal_us.vector_len = datalen; ++ return 0; ++} ++ ++/*****************************************************************************/ ++int seq_reqd_avp (struct tunnel *t, struct call *c, void *data, int datalen) ++{ ++ if (debug_avp) ++ log (LOG_DEBUG, "%s: peer requires sequencing.\n", __func__); + c->seq_reqd = -1; + return 0; + } + ++/*****************************************************************************/ + int result_code_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++ int avplen) + { +- /* +- * Find out what version of l2tp the other side is using. +- * I'm not sure what we're supposed to do with this but whatever.. +- */ ++ u_int8_t *p = data + sizeof(struct avp_hdr); ++ int datalen = avplen - sizeof(struct avp_hdr); ++ u_int16_t result = get16(p); ++ u_int16_t error = get16(p + 2); + +- int error; +- int result; +- _u16 *raw = data; +-#ifdef SANITY +- if (t->sanity) +- { +- if (datalen < 10) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is incorrect size. %d < 10\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Result Code", 10, datalen, 1); +- return -EINVAL; +- } +- switch (c->msgtype) +- { +- case CDN: +- case StopCCN: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: result code not appropriate for %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- } +-#endif +- result = ntohs (raw[3]); +- error = ntohs (raw[4]); + if ((c->msgtype == StopCCN) && ((result > 7) || (result < 1))) + { + if (DEBUG) + log (LOG_DEBUG, +- "%s: result code out of range (%d %d %d). Ignoring.\n", +- __FUNCTION__, result, error, datalen); ++ "%s: (StopCCN) result code out of range ! (1 < %d < 7)\n", ++ __func__, result); + return 0; + } + +@@ -478,1112 +418,348 @@ + { + if (DEBUG) + log (LOG_DEBUG, +- "%s: result code out of range (%d %d %d). Ignoring.\n", +- __FUNCTION__, result, error, datalen); ++ "%s: (CDN) result code out of range !(1 < %d < 11)\n", ++ __func__, result); + return 0; + } + + c->error = error; + c->result = result; +- safe_copy (c->errormsg, (char *) &raw[5], datalen - 10); ++ memcpy(c->errormsg, (char*)p + 4, datalen - 4); ++ c->errormsg[datalen - 4] = '\0'; ++ + if (debug_avp) + { +- if (DEBUG && (c->msgtype == StopCCN)) ++ if(c->msgtype == StopCCN) + { + log (LOG_DEBUG, + "%s: peer closing for reason %d (%s), error = %d (%s)\n", +- __FUNCTION__, result, stopccn_result_codes[result], error, ++ __func__, result, stopccn_result_codes[result], error, + c->errormsg); + } + else + { + log (LOG_DEBUG, + "%s: peer closing for reason %d (%s), error = %d (%s)\n", +- __FUNCTION__, result, cdn_result_codes[result], error, ++ __func__, result, cdn_result_codes[result], error, + c->errormsg); + } + } + return 0; + } + ++/*****************************************************************************/ + int protocol_version_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++ int avplen) + { +- /* +- * Find out what version of l2tp the other side is using. +- * I'm not sure what we're supposed to do with this but whatever.. +- */ ++ u_int8_t *p = data + sizeof(struct avp_hdr); + +- int ver; +- _u16 *raw = data; +-#ifdef SANITY +- if (t->sanity) +- { +- if (datalen != 8) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is incorrect size. %d != 8\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Protocol Version", 8, datalen, 1); +- return -EINVAL; +- } +- switch (c->msgtype) +- { +- case SCCRP: +- case SCCRQ: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: protocol version not appropriate for %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- } +-#endif +- ver = ntohs (raw[3]); + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: peer is using version %d, revision %d.\n", __FUNCTION__, +- (ver >> 8), ver & 0xFF); +- } ++ log (LOG_DEBUG, "%s: peer is using version %d, revision %d.\n", ++ __func__,*p, *(p+1)); + return 0; + } + ++/*****************************************************************************/ + int framing_caps_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++ int avplen) + { +- /* +- * Retrieve the framing capabilities +- * from the peer +- */ +- +- int caps; +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); ++ u_int16_t caps = get16(p + 2); + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case SCCRP: +- case SCCRQ: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: framing capabilities not appropriate for %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen != 10) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is incorrect size. %d != 10\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Framming Capabilities", 10, datalen, 0); +- return -EINVAL; +- } +- } +-#endif +- caps = ntohs (raw[4]); + if (debug_avp) +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: supported peer frames:%s%s\n", __FUNCTION__, +- caps & ASYNC_FRAMING ? " async" : "", +- caps & SYNC_FRAMING ? " sync" : ""); ++ log (LOG_DEBUG, "%s: supported peer frames:%s %s\n", __func__, ++ caps & ASYNC_FRAMING ? "async" : "", ++ caps & SYNC_FRAMING ? "sync" : ""); ++ + t->fc = caps & (ASYNC_FRAMING | SYNC_FRAMING); + return 0; + } + ++/*****************************************************************************/ + int bearer_caps_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++ int avplen) + { +- /* +- * What kind of bearer channels does our peer support? +- */ +- int caps; +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); ++ u_int16_t caps = get16(p + 2); + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case SCCRP: +- case SCCRQ: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: bearer capabilities not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen != 10) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is incorrect size. %d != 10\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Bearer Capabilities", 10, datalen, 0); +- return -EINVAL; +- } +- } +-#endif +- caps = ntohs (raw[4]); + if (debug_avp) +- { +- if (DEBUG) +- { +- log (LOG_DEBUG, +- "%s: supported peer bearers:%s%s\n", +- __FUNCTION__, +- caps & ANALOG_BEARER ? " analog" : "", +- caps & DIGITAL_BEARER ? " digital" : ""); +- } ++ log (LOG_DEBUG, "%s: supported peer bearers:%s %s\n", ++ __func__, ++ caps & ANALOG_BEARER ? "analog" : "", ++ caps & DIGITAL_BEARER ? "digital" : ""); + +- } + t->bc = caps & (ANALOG_BEARER | DIGITAL_BEARER); + return 0; + } + +- +-/* FIXME: I need to handle tie breakers eventually */ +- ++/*****************************************************************************/ + int firmware_rev_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++ int avplen) + { +- /* +- * Report and record remote firmware version +- */ +- int ver; +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case SCCRP: +- case SCCRQ: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: firmware revision not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen != 8) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is incorrect size. %d != 8\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Firmware Revision", 8, datalen, 0); +- return -EINVAL; +- } +- } +-#endif +- ver = ntohs (raw[3]); ++ t->firmware = get16(p); + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: peer reports firmware version %d (0x%.4x)\n", +- __FUNCTION__, ver, ver); +- } +- t->firmware = ver; ++ log (LOG_DEBUG, "%s: peer reports firmware version %d (0x%.4X)\n", ++ __func__, t->firmware, t->firmware); + return 0; + } + ++/*****************************************************************************/ + int bearer_type_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++ int avplen) + { +- /* +- * What kind of bearer channel is the call on? +- */ +- int b; +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case ICRQ: +- case OCRQ: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: bearer type not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen != 10) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is incorrect size. %d != 10\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Bearer Type", 10, datalen, 0); +- return -EINVAL; +- } +- } +-#endif +- b = ntohs (raw[4]); ++ t->call_head->bearer = get16(p + 2); + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: peer bears:%s\n", __FUNCTION__, +- b & ANALOG_BEARER ? " analog" : "digital"); +- } +- t->call_head->bearer = b; ++ log (LOG_DEBUG, "%s: peer bears: %s\n", __func__, ++ (t->call_head->bearer & ANALOG_BEARER) ? "analog" : "digital"); + return 0; + } + +-int frame_type_avp (struct tunnel *t, struct call *c, void *data, int datalen) ++/*****************************************************************************/ ++int frame_type_avp (struct tunnel *t, struct call *c, void *data, int avplen) + { +- /* +- * What kind of frame channel is the call on? +- */ +- int b; +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case ICCN: +- case OCRQ: +- case OCCN: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: frame type not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen != 10) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is incorrect size. %d != 10\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Frame Type", 10, datalen, 0); +- return -EINVAL; +- } +- } +-#endif +- b = ntohs (raw[4]); ++ c->frame = get16(p + 2); + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: peer uses:%s frames\n", __FUNCTION__, +- b & ASYNC_FRAMING ? " async" : "sync"); +- } +- c->frame = b; ++ log (LOG_DEBUG, "%s: peer uses:%s frames\n", __func__, ++ (c->frame & ASYNC_FRAMING) ? "async" : "sync"); + return 0; + } + +-int hostname_avp (struct tunnel *t, struct call *c, void *data, int datalen) ++/*****************************************************************************/ ++int hostname_avp (struct tunnel *t, struct call *c, void *data, int avplen) + { +- /* +- * What is the peer's name? +- */ +- int size; +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); ++ int datalen = avplen - sizeof(struct avp_hdr); ++ ++ memcpy(t->hostname, p, datalen); ++ t->hostname[datalen] = '\0'; + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case SCCRP: +- case SCCRQ: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: hostname not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen < 6) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is too small. %d < 6\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Hostname", 6, datalen, 1); +- return -EINVAL; +- } +- } +-#endif +- size = raw[0] & 0x0FFF; +- if (size > MAXSTRLEN - 1) +- { +- if (DEBUG) +- log (LOG_DEBUG, "%s: truncating reported hostname (size is %d)\n", +- __FUNCTION__, size); +- size = MAXSTRLEN - 1; +- } +- safe_copy (t->hostname, (char *) &raw[3], size - 6); + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: peer reports hostname '%s'\n", __FUNCTION__, +- t->hostname); +- } ++ log (LOG_DEBUG, "%s: peer reports hostname '%s'\n", __func__, ++ t->hostname); ++ + return 0; + } + +-int dialing_number_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++/*****************************************************************************/ ++int calling_number_avp (struct tunnel *t, struct call *c, void *data, ++ int avplen) + { +- /* +- * What is the peer's name? +- */ +- int size; +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); ++ int datalen = avplen - sizeof(struct avp_hdr); ++ ++ memcpy(t->call_head->dialing, p, datalen); ++ t->call_head->dialing[datalen] = '\0'; + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case ICRQ: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: dialing number not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen < 6) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is too small. %d < 6\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Dialing Number", 6, datalen, 1); +- return -EINVAL; +- } +- } +-#endif +- size = raw[0] & 0x0FFF; +- if (size > MAXSTRLEN - 1) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: truncating reported dialing number (size is %d)\n", +- __FUNCTION__, size); +- size = MAXSTRLEN - 1; +- } +- safe_copy (t->call_head->dialing, (char *) &raw[3], size); + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: peer reports dialing number '%s'\n", __FUNCTION__, +- t->call_head->dialing); +- } ++ log (LOG_DEBUG, "%s: peer reports dialing number '%s'\n", __func__, ++ t->call_head->dialing); ++ + return 0; + } + +-int dialed_number_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++/*****************************************************************************/ ++int called_number_avp (struct tunnel *t, struct call *c, void *data, ++ int avplen) + { +- /* +- * What is the peer's name? +- */ +- int size; +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); ++ int datalen = avplen - sizeof(struct avp_hdr); ++ ++ memcpy(t->call_head->dialed, p, datalen); ++ t->call_head->dialed[datalen] = '\0'; + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case OCRQ: +- case ICRQ: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: dialed number not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen < 6) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is too small. %d < 6\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Dialed Number", 6, datalen, 1); +- return -EINVAL; +- } +- } +-#endif +- size = raw[0] & 0x0FFF; +- if (size > MAXSTRLEN - 1) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: truncating reported dialed number (size is %d)\n", +- __FUNCTION__, size); +- size = MAXSTRLEN - 1; +- } +- safe_copy (t->call_head->dialed, (char *) &raw[3], size); + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: peer reports dialed number '%s'\n", __FUNCTION__, +- t->call_head->dialed); +- } ++ log (LOG_DEBUG, "%s: peer reports dialed number '%s'\n", __func__, ++ t->call_head->dialed); ++ + return 0; + } + ++/*****************************************************************************/ + int sub_address_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++ int avplen) + { +- /* +- * What is the peer's name? +- */ +- int size; +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); ++ int datalen = avplen - sizeof(struct avp_hdr); ++ ++ memcpy(t->call_head->subaddy, p, datalen); ++ t->call_head->subaddy[datalen] = '\0'; + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case OCRP: +- case ICRQ: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: sub_address not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen < 6) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is too small. %d < 6\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Sub-address", 6, datalen, 1); +- return -EINVAL; +- } +- } +-#endif +- size = raw[0] & 0x0FFF; +- if (size > MAXSTRLEN - 1) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: truncating reported sub address (size is %d)\n", +- __FUNCTION__, size); +- size = MAXSTRLEN - 1; +- } +- safe_copy (t->call_head->subaddy, (char *) &raw[3], size); + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: peer reports subaddress '%s'\n", __FUNCTION__, +- t->call_head->subaddy); +- } ++ log (LOG_DEBUG, "%s: peer reports subaddress '%s'\n", __func__, ++ t->call_head->subaddy); + return 0; + } + +-int vendor_avp (struct tunnel *t, struct call *c, void *data, int datalen) ++/*****************************************************************************/ ++int vendor_avp (struct tunnel *t, struct call *c, void *data, int avplen) + { +- /* +- * What vendor makes the other end? +- */ +- int size; +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); ++ int datalen = avplen - sizeof(struct avp_hdr); ++ ++ memcpy(t->vendor, p, datalen); ++ t->vendor[datalen] = '\0'; + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case SCCRP: +- case SCCRQ: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: vendor not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen < 6) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is too small. %d < 6\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Vendor", 6, datalen, 1); +- return -EINVAL; +- } +- } +-#endif +- size = raw[0] & 0x0FFF; +- if (size > MAXSTRLEN - 1) +- { +- if (DEBUG) +- log (LOG_DEBUG, "%s: truncating reported vendor (size is %d)\n", +- __FUNCTION__, size); +- size = MAXSTRLEN - 1; +- } +- safe_copy (t->vendor, (char *) &raw[3], size); + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: peer reports vendor '%s'\n", __FUNCTION__, t->vendor); +- } ++ log (LOG_DEBUG, "%s: peer reports vendor '%s'\n", __func__, t->vendor); + return 0; + } + +-int challenge_avp (struct tunnel *t, struct call *c, void *data, int datalen) ++/*****************************************************************************/ ++int challenge_avp (struct tunnel *t, struct call *c, void *data, int avplen) + { +- /* +- * We are sent a challenge +- */ +- _u16 *raw = data; +- int size; +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case SCCRP: +- case SCCRQ: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: challenge not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen < 6) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is too small. %d < 6\n", __FUNCTION__, +- datalen); +- wrong_length (c, "challenge", 6, datalen, 1); +- return -EINVAL; +- } +- } +-#endif +- /* size = raw[0] & 0x0FFF; */ +- /* length field of AVP's is only 10 bits long, not 12 */ +- size = raw[0] & 0x03FF; +- size -= sizeof (struct avp_hdr); +- /* if (size != MD_SIG_SIZE) +- { +- log (LOG_DEBUG, "%s: Challenge is not the right length (%d != %d)\n", +- __FUNCTION__, size, MD_SIG_SIZE); +- return -EINVAL; +- } */ +- t->chal_us.challenge = malloc(size+1); +- if (t->chal_us.challenge == NULL) +- { ++ u_int8_t *p = data + sizeof(struct avp_hdr); ++ int datalen = avplen - sizeof(struct avp_hdr); ++ ++ t->chal_us.challenge = calloc(datalen, 1); ++ if (!t->chal_us.challenge) + return -ENOMEM; +- } +- memset(t->chal_us.challenge, 0, size+1); +- bcopy (&raw[3], (t->chal_us.challenge), size); ++ memcpy(t->chal_us.challenge, p, datalen); + t->chal_us.state = STATE_CHALLENGED; ++ + if (debug_avp) +- { +- log (LOG_DEBUG, "%s: challenge avp found\n", __FUNCTION__); +- } ++ log (LOG_DEBUG, "%s: challenge avp found\n", __func__); ++ + return 0; + } + +-int chalresp_avp (struct tunnel *t, struct call *c, void *data, int datalen) ++/*****************************************************************************/ ++int chalresp_avp (struct tunnel *t, struct call *c, void *data, int avplen) + { +- /* +- * We are sent a challenge +- */ +- _u16 *raw = data; +- int size; +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case SCCRP: +- case SCCCN: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: challenge response not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen < 6) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is too small. %d < 6\n", __FUNCTION__, +- datalen); +- wrong_length (c, "challenge", 6, datalen, 1); +- return -EINVAL; +- } +- } +-#endif +- size = raw[0] & 0x0FFF; +- size -= sizeof (struct avp_hdr); +- if (size != MD_SIG_SIZE) +- { +- log (LOG_DEBUG, "%s: Challenge is not the right length (%d != %d)\n", +- __FUNCTION__, size, MD_SIG_SIZE); +- return -EINVAL; +- } ++ u_int8_t *p = data + sizeof(struct avp_hdr); + +- bcopy (&raw[3], t->chal_them.reply, MD_SIG_SIZE); +- if (debug_avp) +- { +- log (LOG_DEBUG, "%s: Challenge reply found\n", __FUNCTION__); +- } ++ memcpy(t->chal_them.reply, p, MD_SIG_SIZE); ++ if(debug_avp) ++ log(LOG_DEBUG, "%s: Challenge reply found\n", __func__); + return 0; + } + ++/*****************************************************************************/ + int assigned_tunnel_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++ int avplen) + { +- /* +- * What is their TID that we must use from now on? +- */ +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); ++ u_int16_t id = get16(p); + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case SCCRP: +- case SCCRQ: +- case StopCCN: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: tunnel ID not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen != 8) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is wrong size. %d != 8\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Assigned Tunnel ID", 8, datalen, 0); +- return -EINVAL; +- } +- } +-#endif + if (c->msgtype == StopCCN) +- { +- t->qtid = ntohs (raw[3]); +- } ++ t->qtid = id; + else +- { +- t->tid = ntohs (raw[3]); +- } ++ t->tid = id; + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: using peer's tunnel %d\n", __FUNCTION__, +- ntohs (raw[3])); +- } ++ log (LOG_DEBUG, "%s: using peer's tunnel %d\n", __func__, id); + return 0; + } + +-int assigned_call_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++/*****************************************************************************/ ++int assigned_session_avp (struct tunnel *t, struct call *c, void *data, ++ int avplen) + { +- /* +- * What is their CID that we must use from now on? +- */ +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); ++ u_int16_t id = get16(p); ++ ++ switch(c->msgtype) { ++ case CDN: ++ case ICRP: ++ case OCRP: ++ c->cid = id; ++ break; ++ case ICRQ: ++ t->call_head->cid = id; ++ break; ++ }; + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case CDN: +- case ICRP: +- case ICRQ: +- case OCRP: /* jz: deleting the debug message */ +- break; +- case OCRQ: +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: call ID not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen != 8) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is wrong size. %d != 8\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Assigned Call ID", 8, datalen, 0); +- return -EINVAL; +- } +- } +-#endif +- if (c->msgtype == CDN) +- { +- c->qcid = ntohs (raw[3]); +- } +- else if (c->msgtype == ICRQ) +- { +- t->call_head->cid = ntohs (raw[3]); +- } +- else if (c->msgtype == ICRP) +- { +- c->cid = ntohs (raw[3]); +- } +- else if (c->msgtype == OCRP) +- { /* jz: copy callid to c->cid */ +- c->cid = ntohs (raw[3]); +- } +- else +- { +- log (LOG_DEBUG, "%s: Dunno what to do when it's state %s!\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- } + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: using peer's call %d\n", __FUNCTION__, ntohs (raw[3])); +- } ++ log (LOG_DEBUG, "%s: assigned session id: %d\n", __func__, id); + return 0; + } + ++/*****************************************************************************/ + int packet_delay_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++ int avplen) + { +- /* +- * What is their CID that we must use from now on? +- */ +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case ICRP: +- case OCRQ: +- case ICCN: +- case OCRP: +- case OCCN: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: packet delay not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen != 8) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is wrong size. %d != 8\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Assigned Call ID", 8, datalen, 0); +- return -EINVAL; +- } +- } +-#endif +- c->ppd = ntohs (raw[3]); ++ c->ppd = get16(p); + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: peer's delay is %d 1/10's of a second\n", __FUNCTION__, +- ntohs (raw[3])); +- } ++ log (LOG_DEBUG, "%s: peer's delay is %d 1/10's of a second\n", __func__, ++ c->ppd); + return 0; + } + +-int call_serno_avp (struct tunnel *t, struct call *c, void *data, int datalen) ++/*****************************************************************************/ ++int call_serno_avp (struct tunnel *t, struct call *c, void *data, int avplen) + { + /* + * What is the serial number of the call? + */ +- _u16 *raw = data; +- +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case ICRQ: +- case OCRQ: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: call ID not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen != 10) +- { +-#ifdef STRICT +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is wrong size. %d != 10\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Serial Number", 10, datalen, 0); +- return -EINVAL; +-#else +- log (LOG_DEBUG, +- "%s: peer is using old style serial number. Will be invalid.\n", +- __FUNCTION__); +-#endif ++ u_int8_t *p = data + sizeof(struct avp_hdr); + +- } +- } +-#endif +- t->call_head->serno = (((unsigned int) ntohs (raw[3])) << 16) | +- ((unsigned int) ntohs (raw[4])); ++ t->call_head->serno = get32(p); + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: serial number is %d\n", __FUNCTION__, +- t->call_head->serno); +- } ++ log (LOG_DEBUG, "%s: serial number is %d\n", __func__, ++ t->call_head->serno); + return 0; + } + +-int rx_speed_avp (struct tunnel *t, struct call *c, void *data, int datalen) ++/*****************************************************************************/ ++int rx_speed_avp (struct tunnel *t, struct call *c, void *data, int avplen) + { +- /* +- * What is the received baud rate of the call? +- */ +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case ICCN: +- case OCCN: +- case OCRP: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: rx connect speed not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen != 10) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is wrong size. %d != 10\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Connect Speed (RX)", 10, datalen, 0); +- return -EINVAL; +- } +- } +-#endif +- c->rxspeed = (((unsigned int) ntohs (raw[3])) << 16) | +- ((unsigned int) ntohs (raw[4])); +- if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: receive baud rate is %d\n", __FUNCTION__, c->rxspeed); +- } ++ c->rxspeed = get32(p); ++ if(debug_avp) ++ log(LOG_DEBUG, "%s: receive baud rate is %d\n", __func__, c->rxspeed); + return 0; + } + +-int tx_speed_avp (struct tunnel *t, struct call *c, void *data, int datalen) ++/*****************************************************************************/ ++int tx_speed_avp (struct tunnel *t, struct call *c, void *data, int avplen) + { +- /* +- * What is the tranmsit baud rate of the call? +- */ +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case ICCN: +- case OCCN: +- case OCRP: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: tx connect speed not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen != 10) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is wrong size. %d != 10\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Connect Speed (tx)", 10, datalen, 0); +- return -EINVAL; +- } +- } +-#endif +- c->txspeed = (((unsigned int) ntohs (raw[3])) << 16) | +- ((unsigned int) ntohs (raw[4])); ++ c->txspeed = get32(p); + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: transmit baud rate is %d\n", __FUNCTION__, c->txspeed); +- } ++ log (LOG_DEBUG, "%s: transmit baud rate is %d\n", ++ __func__, c->txspeed); + return 0; + } ++ ++/*****************************************************************************/ + int call_physchan_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++ int avplen) + { +- /* +- * What is the physical channel? +- */ +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case ICRQ: +- case OCRQ: +- case OCRP: +- case OCCN: +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: physical channel not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen != 10) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is wrong size. %d != 10\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Physical Channel", 10, datalen, 0); +- return -EINVAL; +- } +- } +-#endif +- t->call_head->physchan = (((unsigned int) ntohs (raw[3])) << 16) | +- ((unsigned int) ntohs (raw[4])); ++ t->call_head->physchan = get32(p); + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: physical channel is %d\n", __FUNCTION__, +- t->call_head->physchan); +- } ++ log(LOG_DEBUG, "%s: physical channel is %d\n", __func__, ++ t->call_head->physchan); + return 0; + } + ++/*****************************************************************************/ + int receive_window_size_avp (struct tunnel *t, struct call *c, void *data, +- int datalen) ++ int avplen) + { +- /* +- * What is their RWS? +- */ +- _u16 *raw = data; ++ u_int8_t *p = data + sizeof(struct avp_hdr); + +-#ifdef SANITY +- if (t->sanity) +- { +- switch (c->msgtype) +- { +- case SCCRP: +- case SCCRQ: +- case OCRP: /* jz */ +- case OCCN: /* jz */ +- case StopCCN: +-/* case ICRP: +- case ICCN: */ +- break; +- default: +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: RWS not appropriate for message %s. Ignoring.\n", +- __FUNCTION__, msgtypes[c->msgtype]); +- return 0; +- } +- if (datalen != 8) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: avp is wrong size. %d != 8\n", __FUNCTION__, +- datalen); +- wrong_length (c, "Receive Window Size", 8, datalen, 0); +- return -EINVAL; +- } +- } +-#endif +- t->rws = ntohs (raw[3]); ++ t->rws = get16(p); + /* if (c->rws >= 0) + c->fbit = FBIT; */ + if (debug_avp) +- { +- if (DEBUG) +- log (LOG_DEBUG, +- "%s: peer wants RWS of %d. Will use flow control.\n", +- __FUNCTION__, t->rws); +- } ++ log (LOG_DEBUG, "%s: peer wants RWS of %d. Will use flow control.\n", ++ __func__, t->rws); + return 0; + } + + ++/*****************************************************************************/ + int handle_avps (struct buffer *buf, struct tunnel *t, struct call *c) + { + /* +@@ -1594,82 +770,100 @@ + + struct avp_hdr *avp; + int len = buf->len - sizeof (struct control_hdr); ++ u_int16_t rlen = 0; ++ u_int16_t attr = 0; + int firstavp = -1; +- int hidlen; ++ int hidlen = 0; + char *data = buf->start + sizeof (struct control_hdr); + avp = (struct avp_hdr *) data; ++ + if (debug_avp) + log (LOG_DEBUG, "%s: handling avp's for tunnel %d, call %d\n", +- __FUNCTION__, t->ourtid, c->ourcid); ++ __func__, t->ourtid, c->ourcid); ++ ++ if(len < 6) { ++ log (LOG_WARN, "%s: packet too small\n", __func__); ++ set_error(c, ERROR_LENGTH, "Invalid message length"); ++ return -EINVAL; ++ } ++ + while (len > 0) + { +- /* Go ahead and byte-swap the header */ +- swaps (avp, sizeof (struct avp_hdr)); +- if (avp->attr > AVP_MAX) ++ rlen = get16((u_int8_t*)&avp->length); ++ attr = get16((u_int8_t*)&avp->attr); ++ ++ /* AVP header checks */ ++ if (attr > AVP_MAX) + { +- if (AMBIT (avp->length)) ++ if (AMBIT(rlen)) + { + log (LOG_WARN, +- "%s: dont know how to handle mandatory attribute %d. Closing %s.\n" +- __FUNCTION__, avp->attr, +- (c != t->self) ? "call" : "tunnel"); +- set_error (c, VENDOR_ERROR, +- "mandatory attribute %d cannot be handled", +- avp->attr); +- c->needclose = -1; ++ "%s: unhandeled mandatory attribute %d. Closing %s.\n", ++ __func__, attr, (c != t->self) ? "call" : "tunnel"); ++ set_error (c, VENDOR_ERROR, ++ "mandatory attribute %d cannot be handled", attr); + return -EINVAL; + } + else + { + if (DEBUG) + log (LOG_WARN, +- "%s: dont know how to handle atribute %d.\n", +- __FUNCTION__, avp->attr); ++ "%s: handeled attribute %d.\n", ++ __func__, attr); + goto next; + } + } +- if (ALENGTH (avp->length) > len) ++ if (ALENGTH (rlen) > len) + { + log (LOG_WARN, +- "%s: AVP received with length > remaining packet length!\n", +- __FUNCTION__); ++ "%s: AVP reported length > remaining packet length\n", ++ __func__); + set_error (c, ERROR_LENGTH, "Invalid AVP length"); +- c->needclose = -1; + return -EINVAL; + } +- if (avp->attr && firstavp) ++ if (ALENGTH (rlen) < sizeof (struct avp_hdr)) + { +- log (LOG_WARN, "%s: First AVP was not message type.\n", +- __FUNCTION__); +- set_error (c, VENDOR_ERROR, "First AVP must be message type"); +- c->needclose = -1; ++ log (LOG_WARN, "%s: AVP reported length too small (%d).\n", ++ __func__, ALENGTH (rlen)); ++ set_error (c, ERROR_LENGTH, "AVP too small"); + return -EINVAL; + } +- if (ALENGTH (avp->length) < sizeof (struct avp_hdr)) ++ if (avps[attr].sz) { ++ if((avps[attr].flags & AVP_F_FIXLEN) ? ++ (ALENGTH(rlen) - sizeof(struct avp_hdr)) != avps[attr].sz : ++ (ALENGTH(rlen) - sizeof(struct avp_hdr)) > avps[attr].sz) { ++ log (LOG_DEBUG, "%s: %s avp size mismatch (%d %s %d)\n", ++ __func__, ++ avps[attr].description, ++ (avps[attr].flags & AVP_F_FIXLEN) ? "!=" : "<", ++ ALENGTH(rlen), avps[attr].sz); ++ set_error (c, ERROR_LENGTH, "AVP size check failed"); ++ return -EINVAL; ++ } ++ } ++ if (attr && firstavp) + { +- log (LOG_WARN, "%s: AVP with too small of size (%d).\n", +- __FUNCTION__, ALENGTH (avp->length)); +- set_error (c, ERROR_LENGTH, "AVP too small"); +- c->needclose = -1; ++ log (LOG_WARN, "%s: First AVP was not message type.\n", ++ __func__); ++ set_error (c, VENDOR_ERROR, "First AVP must be message type"); + return -EINVAL; + } +- if (AZBITS (avp->length)) ++ if (AZBITS (rlen)) + { +- log (LOG_WARN, "%s: %sAVP has reserved bits set.\n", __FUNCTION__, +- AMBIT (avp->length) ? "Mandatory " : ""); +- if (AMBIT (avp->length)) ++ log (LOG_WARN, "%s: %sAVP has reserved bits set.\n", __func__, ++ AMBIT (rlen) ? "Mandatory " : ""); ++ if (AMBIT (rlen)) + { + set_error (c, ERROR_RESERVED, "reserved bits set in AVP"); +- c->needclose = -1; + return -EINVAL; + } + goto next; + } +- if (AHBIT (avp->length)) ++ ++ /* decryption */ ++ if (AHBIT (rlen)) + { +-#ifdef DEBUG_HIDDEN +- log (LOG_DEBUG, "%s: Hidden bit set on AVP.\n", __FUNCTION__); +-#endif ++ log (LOG_DEBUG, "%s: Hidden bit set on AVP.\n", __func__); + /* We want to rewrite the AVP as an unhidden AVP + and then pass it along as normal. Remeber how + long the AVP was in the first place though! */ +@@ -1678,12 +872,11 @@ + { + if (debug_avp) + log (LOG_WARN, "%s: Unable to handle hidden %sAVP\n:", +- __FUNCTION__, +- (AMBIT (avp->length) ? "mandatory " : "")); +- if (AMBIT (avp->length)) ++ __func__, ++ (AMBIT (rlen) ? "mandatory " : "")); ++ if (AMBIT (rlen)) + { + set_error (c, VENDOR_ERROR, "Invalid Hidden AVP"); +- c->needclose = -1; + return -EINVAL; + } + goto next; +@@ -1696,17 +889,43 @@ + } + else + hidlen = 0; +- if (avps[avp->attr].handler) ++ ++ /* validate */ ++ if (avps[attr].validate) ++ { ++ if(avps[attr].validate(attr, t, c, avp, ALENGTH (rlen))) { ++ if (AMBIT (rlen)) ++ { ++ log (LOG_WARN, ++ "%s: verification of AVP %d (%s) failed.\n", ++ __func__, attr, ++ avps[attr].description); ++ set_error (c, VENDOR_ERROR, "processing failed on mandatory AVP"); ++ return -EINVAL; ++ } ++ else ++ { ++ if (DEBUG) ++ log (LOG_DEBUG, ++ "%s: Bad exit status handling attribute %d (%s).\n", ++ __func__, attr, ++ avps[attr].description); ++ } ++ } ++ } ++ ++ /* handling */ ++ if (avps[attr].handle) + { +- if (avps[avp->attr].handler (t, c, avp, ALENGTH (avp->length))) ++ if (avps[attr].handle(t, c, avp, ALENGTH (rlen))) + { +- if (AMBIT (avp->length)) ++ if (AMBIT (rlen)) + { + log (LOG_WARN, +- "%s: Bad exit status handling attribute %d (%s) on mandatory packet.\n", +- __FUNCTION__, avp->attr, +- avps[avp->attr].description); +- c->needclose = -1; ++ "%s: Bad exit status handling mandatory attribute %d (%s).\n", ++ __func__, attr, ++ avps[attr].description); ++ set_error (c, VENDOR_ERROR, "processing failed on mandatory AVP"); + return -EINVAL; + } + else +@@ -1714,29 +933,31 @@ + if (DEBUG) + log (LOG_DEBUG, + "%s: Bad exit status handling attribute %d (%s).\n", +- __FUNCTION__, avp->attr, +- avps[avp->attr].description); ++ __func__, attr, ++ avps[attr].description); + } + } + } + else + { +- if (AMBIT (avp->length)) ++ if (AMBIT (rlen)) + { + log (LOG_WARN, + "%s: No handler for mandatory attribute %d (%s). Closing %s.\n", +- __FUNCTION__, avp->attr, avps[avp->attr].description, ++ __func__, attr, ++ avps[attr].description, + (c != t->self) ? "call" : "tunnel"); + set_error (c, VENDOR_ERROR, "No handler for attr %d (%s)\n", +- avp->attr, avps[avp->attr].description); ++ attr, ++ avps[attr].description); + return -EINVAL; + } + else + { + if (DEBUG) + log (LOG_WARN, "%s: no handler for atribute %d (%s).\n", +- __FUNCTION__, avp->attr, +- avps[avp->attr].description); ++ __func__, attr, ++ avps[attr].description); + } + } + next: +@@ -1748,16 +969,17 @@ + } + else + { +- len -= ALENGTH (avp->length); +- data += ALENGTH (avp->length); /* Next AVP, please */ ++ len -= ALENGTH (rlen); ++ data += ALENGTH (rlen); /* Next AVP, please */ + } + avp = (struct avp_hdr *) data; + firstavp = 0; + } + if (len != 0) + { +- log (LOG_WARN, "%s: negative overall packet length\n", __FUNCTION__); ++ log (LOG_WARN, "%s: negative overall packet length\n", __func__); + return -EINVAL; + } ++ + return 0; + } +--- l2tpd-0.70-pre20031121.orig/avpsend.c ++++ l2tpd-0.70-pre20031121/avpsend.c +@@ -1,11 +1,5 @@ + /* +- * $Id$ +- * +- * Layer Two Tunnelling Protocol Daemon +- * Copyright (C) 1998 Adtran, Inc. +- * Copyright (C) 2002 Jeff McAdams +- * +- * Mark Spencer ++ * Copyright (C) 2004 Jean-Francois Dive + * + * This software is distributed under the terms + * of the GPL, which you should have received +@@ -14,337 +8,288 @@ + * Attribute Value Pair creating routines + */ + ++/* TODO: Handle Tie break */ ++/* TODO: Get real hostname / config */ ++/* TODO: There should be an overflow check on ++ * the buffer size. (safe for now as ++ * packet size = 4k ++ */ ++ + #include + #include +-#include ++#include + #include "l2tp.h" + +-/* +- * These routines should add avp's to a buffer +- * to be sent +- */ ++extern struct avp avps[]; + ++/* We could add here padding support which would allow ++ * to keep alignemnt straight */ ++static int add_avp(struct buffer *buf, u_int32_t avpid, unsigned char *v, ++ u_int32_t sz, u_int8_t setpayload) { ++ u_int8_t *p = buf->start + buf->len; ++ ++ if(avpid > AVP_MAX || !avps[avpid].flags) { ++ log(LOG_DEBUG, "%s: invalid avp id %d\n", __func__, avpid); ++ return 1; ++ } ++ ++ set16(p, (sz + 6) | (avps[avpid].flags & AVP_F_MANDATORY ? MBIT : 0)); ++ set16(p + 2, VENDOR_ID); ++ set16(p + 4, avpid); ++ if(setpayload) ++ memcpy(p + 6, v, sz); + +-/* FIXME: If SANITY is on, we should check for buffer overruns */ ++ buf->len += (sz + 6); ++ return 0; ++} + +-/* FIXME: Can't this be condensed alot? */ ++/*****************************************************************************/ ++int add_message_type_avp(struct buffer *buf, _u16 type) { ++ u_int8_t t[2]; ++ set16(t, type); ++ if(add_avp(buf, MESSAGE_TYPE_AVP, t, 2, 1)) ++ return 1; ++ return 0; ++} + +-int add_message_type_avp (struct buffer *buf, _u16 type) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0x8 | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = 0; +- raw[3] = htons (type); +- buf->len += 8; ++/*****************************************************************************/ ++int add_protocol_avp(struct buffer *buf) { ++ u_int8_t t[2]; ++ set16(t, OUR_L2TP_VERSION); ++ if(add_avp(buf, PROTOCOL_VERSION_AVP, t, 2, 1)) ++ return 1; + return 0; + } + +-int add_protocol_avp (struct buffer *buf) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0x8 | MBIT); /* Length and M bit */ +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x2); /* Value of our AVP */ +- raw[3] = htons (OUR_L2TP_VERSION); +- buf->len += 8; ++/*****************************************************************************/ ++int add_frame_caps_avp(struct buffer *buf, _u16 caps) { ++ u_int8_t t[4]; ++ t[0] = 0; ++ t[1] = 0; ++ set16(&t[2], caps); ++ if(add_avp(buf, FRAMING_CAP_AVP, t, 4, 1)) ++ return 1; + return 0; + } + +-int add_frame_caps_avp (struct buffer *buf, _u16 caps) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0xA | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x3); +- raw[3] = 0; +- raw[4] = htons (caps); +- buf->len += 10; ++/*****************************************************************************/ ++int add_bearer_caps_avp(struct buffer *buf, _u16 caps) { ++ u_int8_t t[4]; ++ t[0] = 0; ++ t[1] = 0; ++ set16(&t[2], caps); ++ if(add_avp(buf, BEARER_CAP_AVP, t, 4, 1)) ++ return 1; + return 0; + } + +-int add_bearer_caps_avp (struct buffer *buf, _u16 caps) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0xA | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x4); +- raw[3] = 0; +- raw[4] = htons (caps); +- buf->len += 10; ++/*****************************************************************************/ ++int add_firmware_avp(struct buffer *buf) { ++ u_int8_t t[2]; ++ set16(t, OUR_L2TP_VERSION); ++ if(add_avp(buf, FIRMWARE_REV_AVP, t, 2, 1)) ++ return 1; + return 0; + } + +-/* FIXME: I need to send tie breaker AVP's */ +- +-int add_firmware_avp (struct buffer *buf) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0x8); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x6); +- raw[3] = htons (FIRMWARE_REV); +- buf->len += 8; ++/*****************************************************************************/ ++int add_hostname_avp(struct buffer *buf, struct tunnel *t) { ++ char n[STRLEN]; ++ int sz = 0; ++ if(t->lac && t->lac->hostname[0]) { ++ strncpy(n,t->lac->hostname, sizeof(n)); ++ sz = strnlen(t->lac->hostname, sizeof(t->lac->hostname)); ++ } ++ else if(t->lns && t->lns->hostname[0]) { ++ strncpy(n,t->lns->hostname, sizeof(n)); ++ sz = strnlen(t->lns->hostname, sizeof(t->lns->hostname)); ++ } ++ else { ++ if(gethostname(n, STRLEN)) { ++ strcpy(n,"eriwan"); ++ sz = 6; ++ } ++ else ++ sz = strnlen(n, sizeof(n)); ++ } ++ if(add_avp(buf, HOSTNAME_AVP, n, sz, 1)) ++ return 1; + return 0; + } + +-/* +-int add_hostname_avp(struct buffer *buf) { +- _u16 *raw = (_u16 *)(buf->start + buf->len); +- raw[0] = htons((0x6 + strlen(hostname)) | MBIT); +- raw[1] = htons(VENDOR_ID); +- raw[2] = htons(0x7); +- strcpy((char *)(&raw[3]), hostname); +- buf->len += 6 + strlen(hostname); +- return 0; ++/*****************************************************************************/ ++int add_vendor_avp(struct buffer *buf) { ++ if(add_avp(buf, VENDOR_NAME_AVP, VENDOR_NAME, strlen(VENDOR_NAME), 1)) ++ return 1; ++ return 0; + } +-*/ + +-int add_hostname_avp (struct buffer *buf) +-{ +- char names[6] = "eriwan"; +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0xC | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x7); +- strcpy ((char *) (&raw[3]), names); +- buf->len += 12; +- return 0; +-} +- +-int add_vendor_avp (struct buffer *buf) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0x6 + strlen (VENDOR_NAME)); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x8); +- strcpy ((char *) (&raw[3]), VENDOR_NAME); +- buf->len += 6 + strlen (VENDOR_NAME); +- return 0; +-} +- +-int add_tunnelid_avp (struct buffer *buf, _u16 tid) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0x8 | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x9); +- raw[3] = htons (tid); +- buf->len += 8; +- return 0; +-} +- +-int add_avp_rws (struct buffer *buf, _u16 rws) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0x8 | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0xA); +- raw[3] = htons (rws); +- buf->len += 8; +- return 0; +-} +- +-int add_challenge_avp (struct buffer *buf, char *c, int len) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons ((0x6 + len) | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0xB); +- bcopy (c, (char *) (&raw[3]), len); +- buf->len += 6 + len; +- return 0; +-} +- +-int add_chalresp_avp (struct buffer *buf, char *c, int len) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons ((0x6 + len) | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0xD); +- bcopy (c, (char *) (&raw[3]), len); +- buf->len += 6 + len; +- return 0; +-} +- +-int add_randvect_avp (struct buffer *buf, char *c, int len) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons ((0x6 + len) | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x24); +- bcopy (c, (char *) (&raw[3]), len); +- buf->len += 6 + len; +- return 0; +-} +- +-int add_result_code_avp (struct buffer *buf, _u16 result, _u16 error, +- char *msg, int len) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons ((0xA + len) | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x1); +- raw[3] = htons (result); +- raw[4] = htons (error); +- bcopy (msg, (char *) &raw[5], len); +- buf->len += (10 + len); ++/*****************************************************************************/ ++int add_tunnelid_avp(struct buffer *buf, _u16 tid) { ++ u_int8_t t[2]; ++ set16(t, tid); ++ if(add_avp(buf, ASSIGNED_TUN_ID_AVP, t, 2, 1)) ++ return 1; + return 0; + } + ++/*****************************************************************************/ ++int add_avp_rws(struct buffer *buf, _u16 rws) { ++ u_int8_t t[2]; ++ set16(t, rws); ++ if(add_avp(buf, RX_WIN_SIZE_AVP, t, 2, 1)) ++ return 1; ++ return 0; ++} ++ ++/*****************************************************************************/ ++int add_challenge_avp(struct buffer *buf, char *c, int len) { ++ if(add_avp(buf, CHALLENGE_AVP, c, len, 1)) ++ return 1; ++ return 0; ++} ++ ++/*****************************************************************************/ ++int add_chalresp_avp(struct buffer *buf, char *c, int len) { ++ if(add_avp(buf, CHALLENGE_RESP_AVP, c, len, 1)) ++ return 1; ++ return 0; ++} ++ ++/*****************************************************************************/ ++int add_randvect_avp(struct buffer *buf, char *c, int len) { ++ if(add_avp(buf, RANDOM_VECTOR_AVP, c, len, 1)) ++ return 1; ++ return 0; ++} ++ ++/*****************************************************************************/ ++int add_result_code_avp(struct buffer *buf, _u16 result, _u16 error, ++ char *msg, int len) { ++ u_int8_t t[4]; ++ set16(t, result); ++ set16(&t[2], error); ++ memcpy((u_int8_t*)(buf->start + buf->len + 10), msg, len); ++ memcpy((u_int8_t*)(buf->start + buf->len + 6), t, 4); ++ if(add_avp(buf, RESULT_CODE_AVP, 0, 4 + len, 0)) ++ return 1; ++ return 0; ++} ++ ++/*****************************************************************************/ + #ifdef TEST_HIDDEN +-int add_callid_avp (struct buffer *buf, _u16 callid, struct tunnel *t) +-{ +-#else +-int add_callid_avp (struct buffer *buf, _u16 callid) +-{ +-#endif +- _u16 *raw = (_u16 *) (buf->start + buf->len); +-#ifdef TEST_HIDDEN ++int add_callid_avp(struct buffer *buf, _u16 callid, struct tunnel *t) { ++ u_int8_t t[2]; + if (t->hbit) + raw++; +-#endif +- raw[0] = htons (0x8 | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0xE); +- raw[3] = htons (callid); +- buf->len += 8; +-#ifdef TEST_HIDDEN ++ set16(t, callid); ++ if(add_avp(buf, ASSIGNED_SES_ID_AVP, t, 2, 1)) ++ return 1; + if (t->hbit) + encrypt_avp (buf, 8, t); ++ return 0; ++} ++#else ++int add_callid_avp(struct buffer *buf, _u16 callid) { ++ u_int8_t t[2]; ++ set16(t, callid); ++ if(add_avp(buf, ASSIGNED_SES_ID_AVP, t, 2, 1)) ++ return 1; ++ return 0; ++} + #endif ++ ++/*****************************************************************************/ ++int add_serno_avp(struct buffer *buf, unsigned int serno) { ++ u_int8_t t[4]; ++ set32(t, serno); ++ if(add_avp(buf, SERIAL_NUMBER_AVP, t, 4, 1)) ++ return 1; ++ return 0; ++} ++ ++/*****************************************************************************/ ++int add_bearer_avp(struct buffer *buf, int bearer) { ++ u_int8_t t[4]; ++ set32(t, bearer); ++ if(add_avp(buf, BEARER_TYPE_AVP, t, 4, 1)) ++ return 1; ++ return 0; ++} ++ ++/*****************************************************************************/ ++int add_frame_avp(struct buffer *buf, int frame) { ++ u_int8_t t[4]; ++ set32(t, frame); ++ if(add_avp(buf, FRAMING_TYPE_AVP, t, 4, 1)) ++ return 1; ++ return 0; ++} ++ ++/*****************************************************************************/ ++int add_txspeed_avp(struct buffer *buf, int speed) { ++ u_int8_t t[4]; ++ set32(t, speed); ++ if(add_avp(buf, TX_CONNECT_SPEED_AVP, t, 4, 1)) ++ return 1; ++ return 0; ++} ++ ++/*****************************************************************************/ ++int add_rxspeed_avp(struct buffer *buf, int speed) { ++ u_int8_t t[4]; ++ set32(t, speed); ++ if(add_avp(buf, RX_CONNECT_SPEED_AVP, t, 4, 1)) ++ return 1; ++ return 0; ++} ++ ++/*****************************************************************************/ ++int add_physchan_avp(struct buffer *buf, unsigned int physchan) { ++ u_int8_t t[4]; ++ set32(t, physchan); ++ if(add_avp(buf, PHYS_CHAN_ID_AVP, t, 4, 1)) ++ return 1; ++ return 0; ++} ++ ++/*****************************************************************************/ ++int add_ppd_avp(struct buffer *buf, _u16 ppd) { ++ u_int8_t t[2]; ++ set16(t, ppd); ++ if(add_avp(buf, PACKET_DELAY_AVP, t, 2, 1)) ++ return 1; ++ return 0; ++} ++ ++/*****************************************************************************/ ++int add_seqreqd_avp(struct buffer *buf) { ++ if(add_avp(buf, SEQ_REQUIRED_AVP, 0, 0, 0)) ++ return 1; ++ return 0; ++} ++ ++/*****************************************************************************/ ++int add_minbps_avp(struct buffer *buf, int speed) { ++ u_int8_t t[4]; ++ set32(t, speed); ++ if(add_avp(buf, MIN_BPS_AVP, t, 4, 1)) ++ return 1; + return 0; + } + +-int add_serno_avp (struct buffer *buf, unsigned int serno) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0xA | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0xF); +- raw[3] = htons ((serno >> 16) & 0xFFFF); +- raw[4] = htons (serno & 0xFFFF); +- buf->len += 10; +- return 0; +-} +- +-int add_bearer_avp (struct buffer *buf, int bearer) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0xA | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x12); +- raw[3] = htons ((bearer >> 16) & 0xFFFF); +- raw[4] = htons (bearer & 0xFFFF); +- buf->len += 10; +- return 0; +-} +- +-int add_frame_avp (struct buffer *buf, int frame) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0xA | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x13); +- raw[3] = htons ((frame >> 16) & 0xFFFF); +- raw[4] = htons (frame & 0xFFFF); +- buf->len += 10; +- return 0; +-} +- +-int add_txspeed_avp (struct buffer *buf, int speed) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0xA | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x18); +- raw[3] = htons ((speed >> 16) & 0xFFFF); +- raw[4] = htons (speed & 0xFFFF); +- buf->len += 10; +- return 0; +-} +- +-int add_rxspeed_avp (struct buffer *buf, int speed) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0xA | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x26); +- raw[3] = htons ((speed >> 16) & 0xFFFF); +- raw[4] = htons (speed & 0xFFFF); +- buf->len += 10; +- return 0; +-} +- +-int add_physchan_avp (struct buffer *buf, unsigned int physchan) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0x8 | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x19); +- raw[3] = htons ((physchan >> 16) & 0xFFFF); +- raw[4] = htons (physchan & 0xFFFF); +- buf->len += 10; +- return 0; +-} +- +-int add_ppd_avp (struct buffer *buf, _u16 ppd) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0x8 | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x14); +- raw[3] = htons (ppd); +- buf->len += 8; +- return 0; +-} +- +-int add_seqreqd_avp (struct buffer *buf) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0x6 | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x27); +- buf->len += 6; +- return 0; +-} +- +-/* jz: options dor the outgoing call */ +- +-/* jz: Minimum BPS - 16 */ +-int add_minbps_avp (struct buffer *buf, int speed) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0xA | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x10); +- raw[3] = htons ((speed >> 16) & 0xFFFF); +- raw[4] = htons (speed & 0xFFFF); +- buf->len += 10; +- return 0; +-} +- +-/* jz: Maximum BPS - 17 */ +-int add_maxbps_avp (struct buffer *buf, int speed) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons (0xA | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x11); +- raw[3] = htons ((speed >> 16) & 0xFFFF); +- raw[4] = htons (speed & 0xFFFF); +- buf->len += 10; +- return 0; +-} +- +-/* jz: Dialed Number 21 */ +-int add_number_avp (struct buffer *buf, char *no) +-{ +- _u16 *raw = (_u16 *) (buf->start + buf->len); +- raw[0] = htons ((0x6 + strlen (no)) | MBIT); +- raw[1] = htons (VENDOR_ID); +- raw[2] = htons (0x15); +- strncpy ((char *) (&(raw[3])), no, strlen (no)); +- buf->len += 6 + strlen (no); ++/*****************************************************************************/ ++int add_maxbps_avp(struct buffer *buf, int speed) { ++ u_int8_t t[4]; ++ set32(t, speed); ++ if(add_avp(buf, MAX_BPS_AVP, t, 4, 1)) ++ return 1; + return 0; + } ++ ++/*****************************************************************************/ ++int add_number_avp(struct buffer *buf, char *no) { ++ if(add_avp(buf, CALLED_NUMBER_AVP, no, strlen(no), 1)) ++ return 1; ++ return 0; ++} diff --git a/net/l2tpd/patches/002-debian-2-pty-rev.patch b/net/l2tpd/patches/002-debian-2-pty-rev.patch new file mode 100644 index 0000000..135e17e --- /dev/null +++ b/net/l2tpd/patches/002-debian-2-pty-rev.patch @@ -0,0 +1,21 @@ +diff -ruN l2tpd-0.70pre-old/l2tpd.c l2tpd-0.70pre-new/l2tpd.c +--- l2tpd-0.70pre-old/l2tpd.c 2005-12-16 12:02:02.000000000 +0100 ++++ l2tpd-0.70pre-new/l2tpd.c 2005-12-16 12:14:24.000000000 +0100 +@@ -336,17 +336,10 @@ + tcgetattr (c->fd, &ptyconf); + *(c->oldptyconf) = ptyconf; + ptyconf.c_cflag &= ~(ICANON | ECHO); +- ptyconf.c_lflag &= ~ECHO; + tcsetattr (c->fd, TCSANOW, &ptyconf); + + snprintf (tty, sizeof (tty), "/dev/tty%c%c", a, b); + fd2 = open (tty, O_RDWR); +- if(!fd2) +- log(LOG_WARN, "unable to open tty %s", tty); +- +- /* XXX JEF: CHECK ME */ +- stropt[pos++] = strdup(tty); +- stropt[pos] = NULL; + + #ifdef USE_KERNEL + } diff --git a/net/l2tpd/patches/003-jacco-pty.patch b/net/l2tpd/patches/003-jacco-pty.patch new file mode 100644 index 0000000..67169b8 --- /dev/null +++ b/net/l2tpd/patches/003-jacco-pty.patch @@ -0,0 +1,1194 @@ +diff -ruN l2tpd-0.70pre-old/l2tpd.c l2tpd-0.70pre-new/l2tpd.c +--- l2tpd-0.70pre-old/l2tpd.c 2005-12-16 12:34:12.000000000 +0100 ++++ l2tpd-0.70pre-new/l2tpd.c 2005-12-16 12:34:54.000000000 +0100 +@@ -16,6 +16,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -274,8 +275,8 @@ + + int start_pppd (struct call *c, struct ppp_opts *opts) + { +- char a, b; +- char tty[80]; ++ /* char a, b; */ ++ char *tty; + char *stropt[80]; + struct ppp_opts *p; + #ifdef USE_KERNEL +@@ -324,12 +325,45 @@ + else + { + #endif +- if ((c->fd = getPtyMaster (&a, &b)) < 0) ++ c->fd = open("/dev/ptmx", O_RDWR); ++ if (c->fd == -1) ++ { ++ log (LOG_WARN, "%s: unable to open /dev/ptmx to allocate pty\n", ++ __FUNCTION__); ++ return -EINVAL; ++ } else ++ { ++ if (grantpt(c->fd)) ++ { ++ log (LOG_WARN, "%s: unable to grantpt() on pty\n", ++ __FUNCTION__); ++ close(c->fd); ++ return -EINVAL; ++ } ++ if (unlockpt(c->fd)) ++ { ++ log (LOG_WARN, "%s: unable to unlockpt() on pty\n", ++ __FUNCTION__); ++ close(c->fd); ++ return -EINVAL; ++ } ++ tty = ptsname(c->fd); ++ if (tty == NULL) ++ { ++ log (LOG_WARN, "%s: unable to obtain name of slave tty\n", ++ __FUNCTION__); ++ close(c->fd); ++ return -EINVAL; ++ } ++ } ++ ++ ++ /* if ((c->fd = getPtyMaster (&a, &b)) < 0) + { + log (LOG_WARN, "%s: unable to allocate pty, abandoning!\n", + __FUNCTION__); + return -EINVAL; +- } ++ } */ + + /* set fd opened above to not echo so we don't see read our own packets + back of the file descriptor that we just wrote them to */ +@@ -338,8 +372,14 @@ + ptyconf.c_cflag &= ~(ICANON | ECHO); + tcsetattr (c->fd, TCSANOW, &ptyconf); + +- snprintf (tty, sizeof (tty), "/dev/tty%c%c", a, b); ++/* snprintf (tty, sizeof (tty), "/dev/tty%c%c", a, b); */ + fd2 = open (tty, O_RDWR); ++ if (fd2 == -1) ++ { ++ log (LOG_WARN, "%s: unable to open slave tty %s\n", __FUNCTION__, tty); ++ close(c->fd); ++ return -EINVAL; ++ } + + #ifdef USE_KERNEL + } +diff -ruN l2tpd-0.70pre-old/l2tpd.c.orig l2tpd-0.70pre-new/l2tpd.c.orig +--- l2tpd-0.70pre-old/l2tpd.c.orig 1970-01-01 01:00:00.000000000 +0100 ++++ l2tpd-0.70pre-new/l2tpd.c.orig 2005-12-16 12:14:24.000000000 +0100 +@@ -0,0 +1,1104 @@ ++/* ++ * $Id$ ++ * ++ * Layer Two Tunnelling Protocol Daemon ++ * Copyright (C) 1998 Adtran, Inc. ++ * Copyright (C) 2002 Jeff McAdams ++ * ++ * Mark Spencer ++ * ++ * This software is distributed under the terms ++ * of the GPL, which you should have received ++ * along with this source. ++ * ++ * Main Daemon source. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#if (__GLIBC__ < 2) ++# if defined(FREEBSD) ++# include ++# elif defined(LINUX) ++# include ++# elif defined(SOLARIS) ++# include ++# endif ++#else ++# include ++#endif ++#include ++#include ++#include ++#include ++#include ++#ifdef USE_KERNEL ++#include ++#endif ++#include "l2tp.h" ++ ++struct tunnel_list tunnels; ++int max_tunnels = DEF_MAX_TUNNELS; ++struct utsname uts; ++int ppd = 1; /* Packet processing delay */ ++int control_fd; /* descriptor of control area */ ++char *args; ++ ++char *dial_no_tmp; /* jz: Dialnumber for Outgoing Call */ ++int switch_io = 0; /* jz: Switch for Incoming or Outgoing Call */ ++ ++void init_tunnel_list (struct tunnel_list *t) ++{ ++ t->head = NULL; ++ t->count = 0; ++ t->calls = 0; ++} ++ ++/* Now sends to syslog instead - MvO */ ++void show_status (void) ++{ ++ struct schedule_entry *se; ++ struct tunnel *t; ++ struct call *c; ++ struct lns *tlns; ++ struct lac *tlac; ++ struct host *h; ++ int s = 0; ++ log (LOG_WARN, "====== l2tpd statistics ========\n"); ++ log (LOG_WARN, " Scheduler entries:\n"); ++ se = events; ++ while (se) ++ { ++ s++; ++ t = (struct tunnel *) se->data; ++ tlac = (struct lac *) se->data; ++ c = (struct call *) se->data; ++ if (se->func == &hello) ++ { ++ log (LOG_WARN, "%d: HELLO to %d\n", s, t->tid); ++ } ++ else if (se->func == &magic_lac_dial) ++ { ++ log (LOG_WARN, "%d: Magic dial on %s\n", s, tlac->entname); ++ } ++ else if (se->func == &send_zlb) ++ { ++ log (LOG_WARN, "%d: Send payload ZLB on call %d:%d\n", s, ++ c->container->tid, c->cid); ++ } ++ else if (se->func == &dethrottle) ++ { ++ log (LOG_WARN, "%d: Dethrottle call %d:%d\n", s, c->container->tid, ++ c->cid); ++ } ++ else ++ log (LOG_WARN, "%d: Unknown event\n", s); ++ se = se->next; ++ }; ++ log (LOG_WARN, "Total Events scheduled: %d\n", s); ++ log (LOG_WARN, "Number of tunnels open: %d\n", tunnels.count); ++ t = tunnels.head; ++ while (t) ++ { ++ log (LOG_WARN, "Tunnel %s, ID = %d (local), %d (remote) to %s:%d\n" ++ " control_seq_num = %d, control_rec_seq_num = %d,\n" ++ " cLr = %d\n", ++ (t->lac ? t->lac->entname : (t->lns ? t->lns->entname : "")), ++ t->ourtid, t->tid, IPADDY (t->peer.sin_addr), ++ ntohs (t->peer.sin_port), t->control_seq_num, ++ t->control_rec_seq_num, t->cLr); ++ c = t->call_head; ++ while (c) ++ { ++ log (LOG_WARN, ++ "Call %s, ID = %d (local), %d (remote), serno = %u,\n" ++ " data_seq_num = %d, data_rec_seq_num = %d,\n" ++ " pLr = %d, tx = %u bytes (%u), rx= %u bytes (%u)\n", ++ (c->lac ? c->lac-> ++ entname : (c->lns ? c->lns->entname : "")), c->ourcid, ++ c->cid, c->serno, c->data_seq_num, c->data_rec_seq_num, ++ c->pLr, c->tx_bytes, c->tx_pkts, c->rx_bytes, c->rx_pkts); ++ c = c->next; ++ } ++ t = t->next; ++ } ++ log (LOG_WARN, "==========Config File===========\n"); ++ tlns = lnslist; ++ while (tlns) ++ { ++ log (LOG_WARN, "LNS entry %s\n", ++ tlns->entname[0] ? tlns->entname : "(unnamed)"); ++ tlns = tlns->next; ++ }; ++ tlac = laclist; ++ while (tlac) ++ { ++ log (LOG_WARN, "LAC entry %s, LNS is/are:", ++ tlac->entname[0] ? tlac->entname : "(unnamed)"); ++ h = tlac->lns; ++ if (h) ++ { ++ while (h) ++ { ++ log (LOG_WARN, " %s", h->hostname); ++ h = h->next; ++ } ++ } ++ else ++ log (LOG_WARN, " [none]"); ++ log (LOG_WARN, "\n"); ++ tlac = tlac->next; ++ }; ++ log (LOG_WARN, "================================\n"); ++} ++ ++void null_handler(int sig) ++{ ++ /* FIXME ++ * A sighup is received when a call is terminated, unknown origine .. ++ * I catch it and ll looks good, but .. ++ */ ++} ++ ++void status_handler (int sig) ++{ ++ show_status (); ++} ++ ++void child_handler (int signal) ++{ ++ /* ++ * Oops, somebody we launched was killed. ++ * It's time to reap them and close that call. ++ * But first, we have to find out what PID died. ++ * unfortunately, pppd will ++ */ ++ struct tunnel *t; ++ struct call *c; ++ pid_t pid; ++ int status; ++ t = tunnels.head; ++ /* Keep looping until all are cleared */ ++ for(;;) ++ { ++ pid = waitpid (-1, &status, WNOHANG); ++ if (pid < 1) ++ { ++ /* ++ * Oh well, nobody there. Maybe we reaped it ++ * somewhere else already ++ */ ++ return; ++ } ++ while (t) ++ { ++ c = t->call_head; ++ while (c) ++ { ++ if (c->pppd == pid) ++ { ++ if ( WIFEXITED( status ) ) ++ { ++ log (LOG_DEBUG, "%s : pppd exited for call %d with code %d\n", __FUNCTION__, ++ c->cid, WEXITSTATUS( status ) ); ++ } ++ else if( WIFSIGNALED( status ) ) ++ { ++ log (LOG_DEBUG, "%s : pppd terminated for call %d by signal %d\n", __FUNCTION__, ++ c->cid, WTERMSIG( status ) ); ++ } ++ else ++ { ++ log (LOG_DEBUG, "%s : pppd exited for call %d for unknown reason\n", __FUNCTION__, ++ c->cid ); ++ } ++ c->needclose = -1; ++ /* ++ * OK...pppd died, we can go ahead and close the pty for ++ * it ++ */ ++ close (c->fd); ++ c->fd = -1; ++ return; ++ } ++ c = c->next; ++ } ++ t = t->next; ++ } ++ } ++} ++ ++void death_handler (int signal) ++{ ++ /* ++ * If we get here, somebody terminated us with a kill or a control-c. ++ * we call call_close on each tunnel twice to get a StopCCN out ++ * for each one (we can't pause to make sure it's received. ++ * Then we close the connections ++ */ ++ struct tunnel *st, *st2; ++ int sec; ++ log (LOG_CRIT, "%s: Fatal signal %d received\n", __FUNCTION__, signal); ++ st = tunnels.head; ++ while (st) ++ { ++ st2 = st->next; ++ strcpy (st->self->errormsg, "Server closing"); ++ sec = st->self->closing; ++ if (st->lac) ++ st->lac->redial = 0; ++ call_close (st->self); ++ if (!sec) ++ { ++ st->self->closing = -1; ++ call_close (st->self); ++ } ++ st = st2; ++ } ++ ++ /* erase pid file */ ++ unlink (gconfig.pidfile); ++ ++ /* erase control pipe */ ++ unlink(CONTROL_PIPE); ++ ++ exit (1); ++} ++ ++int start_pppd (struct call *c, struct ppp_opts *opts) ++{ ++ char a, b; ++ char tty[80]; ++ char *stropt[80]; ++ struct ppp_opts *p; ++#ifdef USE_KERNEL ++ struct l2tp_call_opts co; ++#endif ++ int pos = 1; ++ int fd2; ++#ifdef DEBUG_PPPD ++ int x; ++#endif ++ struct termios ptyconf; ++ char *str; ++ p = opts; ++ stropt[0] = strdup (PPPD); ++ while (p) ++ { ++ stropt[pos] = (char *) malloc (strlen (p->option) + 1); ++ strncpy (stropt[pos], p->option, strlen (p->option) + 1); ++ pos++; ++ p = p->next; ++ } ++ stropt[pos] = NULL; ++ if (c->pppd > 0) ++ { ++ log (LOG_WARN, "%s: PPP already started on call!\n", __FUNCTION__); ++ return -EINVAL; ++ } ++ if (c->fd > -1) ++ { ++ log (LOG_WARN, "%s: file descriptor already assigned!\n", ++ __FUNCTION__); ++ return -EINVAL; ++ } ++#ifdef USE_KERNEL ++ if (kernel_support) ++ { ++ co.ourtid = c->container->ourtid; ++ co.ourcid = c->ourcid; ++ ioctl (server_socket, L2TPIOCGETCALLOPTS, &co); ++ stropt[pos++] = strdup ("channel"); ++ stropt[pos] = (char *) malloc (10); ++ snprintf (stropt[pos], 10, "%d", co.id); ++ pos++; ++ stropt[pos] = NULL; ++ } ++ else ++ { ++#endif ++ if ((c->fd = getPtyMaster (&a, &b)) < 0) ++ { ++ log (LOG_WARN, "%s: unable to allocate pty, abandoning!\n", ++ __FUNCTION__); ++ return -EINVAL; ++ } ++ ++ /* set fd opened above to not echo so we don't see read our own packets ++ back of the file descriptor that we just wrote them to */ ++ tcgetattr (c->fd, &ptyconf); ++ *(c->oldptyconf) = ptyconf; ++ ptyconf.c_cflag &= ~(ICANON | ECHO); ++ tcsetattr (c->fd, TCSANOW, &ptyconf); ++ ++ snprintf (tty, sizeof (tty), "/dev/tty%c%c", a, b); ++ fd2 = open (tty, O_RDWR); ++ ++#ifdef USE_KERNEL ++ } ++#endif ++ str = stropt[0]; ++#ifdef DEBUG_PPPD ++ log (LOG_DEBUG, "%s: I'm running: ", __FUNCTION__); ++ for (x = 0; stropt[x]; x++) ++ { ++ log (LOG_DEBUG, "\"%s\" ", stropt[x]); ++ }; ++ log (LOG_DEBUG, "\n"); ++#endif ++ c->pppd = fork (); ++ if (c->pppd < 0) ++ { ++ log (LOG_WARN, "%s: unable to fork(), abandoning!\n", __FUNCTION__); ++ return -EINVAL; ++ } ++ else if (!c->pppd) ++ { ++ struct call *sc; ++ struct tunnel *st; ++ ++ close (0); ++ close (1); ++ close (2); ++#ifdef USE_KERNEL ++ if (!kernel_support && (fd2 < 0)) ++#else ++ if (fd2 < 0) ++#endif ++ { ++ log (LOG_WARN, "%s: Unable to open %s to launch pppd!\n", ++ __FUNCTION__, tty); ++ exit (1); ++ } ++ dup2 (fd2, 0); ++ dup2 (fd2, 1); ++ ++ ++ /* close all the calls pty fds */ ++ st = tunnels.head; ++ while (st) ++ { ++ sc = st->call_head; ++ while (sc) ++ { ++ close (sc->fd); ++ sc = sc->next; ++ } ++ st = st->next; ++ } ++ ++ /* close the UDP socket fd */ ++ close (server_socket); ++ ++ /* close the control pipe fd */ ++ close (control_fd); ++ ++ if( c->dialing[0] ) ++ { ++ setenv( "CALLER_ID", c->dialing, 1 ); ++ } ++ execv (PPPD, stropt); ++ log (LOG_WARN, "%s: Exec of %s failed!\n", __FUNCTION__, PPPD); ++ exit (1); ++ }; ++ close (fd2); ++ pos = 0; ++ while (stropt[pos]) ++ { ++ free (stropt[pos]); ++ pos++; ++ }; ++ return 0; ++} ++ ++void destroy_tunnel (struct tunnel *t) ++{ ++ /* ++ * Immediately destroy a tunnel (and all its calls) ++ * and free its resources. This may be called ++ * by the tunnel itself,so it needs to be ++ * "suicide safe" ++ */ ++ ++ struct call *c, *me; ++ struct tunnel *p; ++ struct timeval tv; ++ if (!t) ++ return; ++ ++ /* ++ * Save ourselves until the very ++ * end, since we might be calling this ourselves. ++ * We must divorce ourself from the tunnel ++ * structure, however, to avoid recursion ++ * because of the logic of the destroy_call ++ */ ++ me = t->self; ++ ++ /* ++ * Destroy all the member calls ++ */ ++ c = t->call_head; ++ while (c) ++ { ++ destroy_call (c); ++ c = c->next; ++ }; ++ /* ++ * Remove ourselves from the list of tunnels ++ */ ++ ++ if (tunnels.head == t) ++ { ++ tunnels.head = t->next; ++ tunnels.count--; ++ } ++ else ++ { ++ p = tunnels.head; ++ if (p) ++ { ++ while (p->next && (p->next != t)) ++ p = p->next; ++ if (p->next) ++ { ++ p->next = t->next; ++ tunnels.count--; ++ } ++ else ++ { ++ log (LOG_WARN, ++ "%s: unable to locate tunnel in tunnel list\n", ++ __FUNCTION__); ++ } ++ } ++ else ++ { ++ log (LOG_WARN, "%s: tunnel list is empty!\n", __FUNCTION__); ++ } ++ } ++ if (t->lac) ++ { ++ t->lac->t = NULL; ++ if (t->lac->redial && (t->lac->rtimeout > 0) && !t->lac->rsched && ++ t->lac->active) ++ { ++ log (LOG_LOG, "%s: Will redial in %d seconds\n", __FUNCTION__, ++ t->lac->rtimeout); ++ tv.tv_sec = t->lac->rtimeout; ++ tv.tv_usec = 0; ++ t->lac->rsched = schedule (tv, magic_lac_dial, t->lac); ++ } ++ } ++ /* XXX L2TP/IPSec: remove relevant SAs here? NTB 20011010 ++ * XXX But what if another tunnel is using same SA? ++ */ ++ if (t->lns) ++ t->lns->t = NULL; ++ free (t); ++ free (me); ++} ++ ++struct tunnel *l2tp_call (char *host, int port, struct lac *lac, ++ struct lns *lns) ++{ ++ /* ++ * Establish a tunnel from us to host ++ * on port port ++ */ ++ struct call *tmp = NULL; ++ struct hostent *hp; ++ unsigned int addr; ++ port = htons (port); ++ hp = gethostbyname (host); ++ if (!hp) ++ { ++ log (LOG_WARN, "%s: gethostbyname() failed for %s.\n", __FUNCTION__, ++ host); ++ return NULL; ++ } ++ bcopy (hp->h_addr, &addr, hp->h_length); ++ /* Force creation of a new tunnel ++ and set it's tid to 0 to cause ++ negotiation to occur */ ++ /* XXX L2TP/IPSec: Set up SA to addr:port here? NTB 20011010 ++ */ ++ tmp = get_call (0, 0, addr, port); ++ if (!tmp) ++ { ++ log (LOG_WARN, "%s: Unable to create tunnel to %s.\n", __FUNCTION__, ++ host); ++ return NULL; ++ } ++ tmp->container->tid = 0; ++ tmp->container->lac = lac; ++ tmp->container->lns = lns; ++ tmp->lac = lac; ++ tmp->lns = lns; ++ if (lac) ++ lac->t = tmp->container; ++ if (lns) ++ lns->t = tmp->container; ++ /* ++ * Since our state is 0, we will establish a tunnel now ++ */ ++ log (LOG_LOG, "%s:Connecting to host %s, port %d\n", __FUNCTION__, host, ++ ntohs (port)); ++ control_finish (tmp->container, tmp); ++ return tmp->container; ++} ++ ++void magic_lac_tunnel (void *data) ++{ ++ struct lac *lac; ++ lac = (struct lac *) data; ++ if (!lac) ++ { ++ log (LOG_WARN, "%s: magic_lac_tunnel: called on NULL lac!\n", ++ __FUNCTION__); ++ return; ++ } ++ if (lac->lns) ++ { ++ /* FIXME: I should try different LNS's if I get failures */ ++ l2tp_call (lac->lns->hostname, lac->lns->port, lac, NULL); ++ return; ++ } ++ else if (deflac && deflac->lns) ++ { ++ l2tp_call (deflac->lns->hostname, deflac->lns->port, lac, NULL); ++ return; ++ } ++ else ++ { ++ log (LOG_WARN, "%s: Unable to find hostname to dial for '%s'\n", ++ __FUNCTION__, lac->entname); ++ return; ++ } ++} ++ ++struct call *lac_call (int tid, struct lac *lac, struct lns *lns) ++{ ++ struct tunnel *t = tunnels.head; ++ struct call *tmp; ++ while (t) ++ { ++ if (t->ourtid == tid) ++ { ++ tmp = new_call (t); ++ if (!tmp) ++ { ++ log (LOG_WARN, "%s: unable to create new call\n", ++ __FUNCTION__); ++ return NULL; ++ } ++ tmp->next = t->call_head; ++ t->call_head = tmp; ++ t->count++; ++ tmp->cid = 0; ++ tmp->lac = lac; ++ tmp->lns = lns; ++ if (lac) ++ lac->c = tmp; ++ log (LOG_LOG, "%s: Calling on tunnel %d\n", __FUNCTION__, tid); ++ strcpy (tmp->dial_no, dial_no_tmp); /* jz: copy dialnumber to tmp->dial_no */ ++ control_finish (t, tmp); ++ return tmp; ++ } ++ t = t->next; ++ }; ++ log (LOG_DEBUG, "%s: No such tunnel %d to generate call.\n", __FUNCTION__, ++ tid); ++ return NULL; ++} ++ ++void magic_lac_dial (void *data) ++{ ++ struct lac *lac; ++ lac = (struct lac *) data; ++ ++ if (!lac) ++ { ++ log (LOG_WARN, "%s : called on NULL lac!\n", __FUNCTION__); ++ return; ++ } ++ if (!lac->active) ++ { ++ log (LOG_DEBUG, "%s: LAC %s not active", __FUNCTION__, lac->entname); ++ return; ++ } ++ lac->rsched = NULL; ++ lac->rtries++; ++ if (lac->rmax && (lac->rtries > lac->rmax)) ++ { ++ log (LOG_LOG, "%s: maximum retries exceeded.\n", __FUNCTION__); ++ return; ++ } ++ if (!lac->t) ++ { ++#ifdef DEGUG_MAGIC ++ log (LOG_DEBUG, "%s : tunnel not up! Connecting!\n", __FUNCTION__); ++#endif ++ magic_lac_tunnel (lac); ++ return; ++ } ++ lac_call (lac->t->ourtid, lac, NULL); ++} ++ ++void lac_hangup (int cid) ++{ ++ struct tunnel *t = tunnels.head; ++ struct call *tmp; ++ while (t) ++ { ++ tmp = t->call_head; ++ while (tmp) ++ { ++ if (tmp->ourcid == cid) ++ { ++ log (LOG_LOG, ++ "%s :Hanging up call %d, Local: %d, Remote: %d\n", ++ __FUNCTION__, tmp->serno, tmp->ourcid, tmp->cid); ++ strcpy (tmp->errormsg, "Goodbye!"); ++/* tmp->needclose = -1; */ ++ kill (tmp->pppd, SIGTERM); ++ return; ++ } ++ tmp = tmp->next; ++ } ++ t = t->next; ++ }; ++ log (LOG_DEBUG, "%s : No such call %d to hang up.\n", __FUNCTION__, cid); ++ return; ++} ++ ++void lac_disconnect (int tid) ++{ ++ struct tunnel *t = tunnels.head; ++ while (t) ++ { ++ if (t->ourtid == tid) ++ { ++ log (LOG_LOG, ++ "%s: Disconnecting from %s, Local: %d, Remote: %d\n", ++ __FUNCTION__, IPADDY (t->peer.sin_addr), t->ourtid, t->tid); ++ t->self->needclose = -1; ++ strcpy (t->self->errormsg, "Goodbye!"); ++ call_close (t->self); ++ return; ++ } ++ t = t->next; ++ }; ++ log (LOG_DEBUG, "%s: No such tunnel %d to hang up.\n", __FUNCTION__, tid); ++ return; ++} ++ ++struct tunnel *new_tunnel () ++{ ++ struct tunnel *tmp = malloc (sizeof (struct tunnel)); ++ char entropy_buf[2] = "\0"; ++ if (!tmp) ++ return NULL; ++ tmp->control_seq_num = 0; ++ tmp->control_rec_seq_num = 0; ++ tmp->cLr = 0; ++ tmp->call_head = NULL; ++ tmp->next = NULL; ++ tmp->debug = -1; ++ tmp->tid = -1; ++ tmp->hello = NULL; ++#ifndef TESTING ++/* while(get_call((tmp->ourtid = rand() & 0xFFFF),0,0,0)); */ ++#ifdef USE_KERNEL ++ if (kernel_support) ++ tmp->ourtid = ioctl (server_socket, L2TPIOCADDTUNNEL, 0); ++ else ++#endif ++/* tmp->ourtid = rand () & 0xFFFF; */ ++ /* get_entropy((char *)&tmp->ourtid, 2); */ ++ get_entropy(entropy_buf, 2); ++ { ++ int *temp; ++ temp = (int *)entropy_buf; ++ tmp->ourtid = *temp & 0xFFFF; ++#ifdef DEBUG_ENTROPY ++ log(LOG_DEBUG, "ourtid = %u, entropy_buf = %hx\n", tmp->ourtid, *temp); ++#endif ++ } ++#else ++ tmp->ourtid = 0x6227; ++#endif ++ tmp->nego = 0; ++ tmp->count = 0; ++ tmp->state = 0; /* Nothing */ ++ tmp->peer.sin_family = AF_INET; ++ tmp->peer.sin_port = 0; ++ bzero (&(tmp->peer.sin_addr), sizeof (tmp->peer.sin_addr)); ++ tmp->sanity = -1; ++ tmp->qtid = -1; ++ tmp->ourfc = ASYNC_FRAMING | SYNC_FRAMING; ++ tmp->ourbc = 0; ++ tmp->ourtb = (((_u64) rand ()) << 32) | ((_u64) rand ()); ++ tmp->fc = -1; /* These really need to be specified by the peer */ ++ tmp->bc = -1; /* And we want to know if they forgot */ ++ tmp->hostname[0] = 0; ++ tmp->vendor[0] = 0; ++ tmp->secret[0] = 0; ++ if (!(tmp->self = new_call (tmp))) ++ { ++ free (tmp); ++ return NULL; ++ }; ++ tmp->ourrws = DEFAULT_RWS_SIZE; ++ tmp->self->ourfbit = FBIT; ++ tmp->lac = NULL; ++ tmp->lns = NULL; ++ tmp->chal_us.state = 0; ++ tmp->chal_us.secret[0] = 0; ++ memset (tmp->chal_us.reply, 0, MD_SIG_SIZE); ++ tmp->chal_them.state = 0; ++ tmp->chal_them.secret[0] = 0; ++ memset (tmp->chal_them.reply, 0, MD_SIG_SIZE); ++ tmp->chal_them.vector = (unsigned char *) malloc (VECTOR_SIZE); ++ tmp->chal_us.vector = NULL; ++ tmp->hbit = 0; ++ return tmp; ++} ++ ++void do_control () ++{ ++ char buf[1024]; ++ char *host, *tunstr, *callstr, *tmpstr; ++ struct lac *lac; ++ int call; ++ int tunl; ++ int cnt = -1; ++ while (cnt) ++ { ++ cnt = read (control_fd, buf, sizeof (buf)); ++ if (cnt > 0) ++ { ++ if (buf[cnt - 1] == '\n') ++ buf[--cnt] = 0; ++#ifdef DEBUG_CONTROL ++ log (LOG_DEBUG, "%s: Got message \"%s\" (%d bytes long)\n", ++ __FUNCTION__, buf, cnt); ++#endif ++ switch (buf[0]) ++ { ++ case 't': ++ host = strchr (buf, ' '); ++ if(!host) ++ goto out; ++ host++; ++#ifdef DEBUG_CONTROL ++ log (LOG_DEBUG, "%s: Attempting to tunnel to %s\n", ++ __FUNCTION__, host); ++#endif ++ l2tp_call (host, UDP_LISTEN_PORT, NULL, NULL); ++ break; ++ case 'c': /* option 'c' for incoming call */ ++ case 'o': /* option 'o' for outgoing call */ ++ tunstr = strchr (buf, ' '); ++ if(!tunstr) ++ goto out; ++ tunstr++; ++ ++ if(buf[0] == 'c') ++ switch_io = 1; /* Switch for Incoming Calls */ ++ else { ++ switch_io = 0; /* Switch for Outgoing Calls */ ++ tmpstr = strchr(tunstr, ' '); ++ if(!tmpstr) ++ goto out; ++ strncpy(dial_no_tmp,tmpstr, sizeof(*dial_no_tmp)); ++ } ++ ++ lac = laclist; ++ while (lac) ++ { ++ if (!strcasecmp (lac->entname, tunstr)) ++ { ++ lac->active = -1; ++ lac->rtries = 0; ++ if (!lac->c) ++ magic_lac_dial (lac); ++ else ++ log (LOG_DEBUG, ++ "%s: Session '%s' already active!\n", ++ __FUNCTION__, lac->entname); ++ break; ++ } ++ lac = lac->next; ++ } ++ if (lac) ++ break; ++ tunl = atoi (tunstr); ++ if (!tunl) ++ { ++ log (LOG_DEBUG, "%s: No such tunnel '%s'\n", __FUNCTION__, ++ tunstr); ++ break; ++ } ++#ifdef DEBUG_CONTROL ++ log (LOG_DEBUG, "%s: Attempting to call on tunnel %d\n", ++ __FUNCTION__, tunl); ++#endif ++ lac_call (tunl, NULL, NULL); ++ break; ++ case 'h': ++ callstr = strchr (buf, ' '); ++ if(!callstr) ++ goto out; ++ callstr++; ++ ++ call = atoi (callstr); ++#ifdef DEBUG_CONTROL ++ log (LOG_DEBUG, "%s: Attempting to call %d\n", __FUNCTION__, ++ call); ++#endif ++ lac_hangup (call); ++ break; ++ case 'd': ++ tunstr = strchr (buf, ' '); ++ if(!tunstr) ++ goto out; ++ tunstr++; ++ ++ lac = laclist; ++ while (lac) ++ { ++ if (!strcasecmp (lac->entname, tunstr)) ++ { ++ lac->active = 0; ++ lac->rtries = 0; ++ if (lac->t) ++ lac_disconnect (lac->t->ourtid); ++ else ++ log (LOG_DEBUG, "%s: Session '%s' not up\n", ++ __FUNCTION__, lac->entname); ++ break; ++ } ++ lac = lac->next; ++ } ++ if (lac) ++ break; ++ tunl = atoi (tunstr); ++ if (!tunl) ++ { ++ log (LOG_DEBUG, "%s: No such tunnel '%s'\n", __FUNCTION__, ++ tunstr); ++ break; ++ } ++#ifdef DEBUG_CONTROL ++ log (LOG_DEBUG, "%s: Attempting to disconnect tunnel %d\n", ++ __FUNCTION__, tunl); ++#endif ++ lac_disconnect (tunl); ++ break; ++ case 's': ++ show_status (); ++ break; ++ default: ++ log (LOG_DEBUG, "%s: Unknown command %c\n", __FUNCTION__, ++ buf[0]); ++ } ++ } ++ } ++ ++out: ++ /* Otherwise select goes nuts */ ++ close (control_fd); ++ control_fd = open (CONTROL_PIPE, O_RDONLY | O_NONBLOCK, 0600); ++} ++ ++void usage(void) { ++ printf("Usage: l2tpd -D -c [config file] -s [secret file] -p [pid file]\n"); ++ printf("\n"); ++ exit(1); ++} ++ ++void init_args(int argc, char *argv[]) { ++ int i=0; ++ gconfig.daemon=1; ++ memset(gconfig.altauthfile,0,STRLEN); ++ memset(gconfig.altconfigfile,0,STRLEN); ++ memset(gconfig.authfile,0,STRLEN); ++ memset(gconfig.configfile,0,STRLEN); ++ memset(gconfig.pidfile,0,STRLEN); ++ strncpy(gconfig.altauthfile,ALT_DEFAULT_AUTH_FILE, ++ sizeof(gconfig.altauthfile) - 1); ++ strncpy(gconfig.altconfigfile,ALT_DEFAULT_CONFIG_FILE, ++ sizeof(gconfig.altconfigfile) - 1); ++ strncpy(gconfig.authfile,DEFAULT_AUTH_FILE, ++ sizeof(gconfig.authfile) - 1); ++ strncpy(gconfig.configfile,DEFAULT_CONFIG_FILE, ++ sizeof(gconfig.configfile) - 1); ++ strncpy(gconfig.pidfile,DEFAULT_PID_FILE, ++ sizeof(gconfig.pidfile) - 1); ++ for (i = 1; i < argc; i++) { ++ if(! strncmp(argv[i],"-c",2)) { ++ if(++i == argc) ++ usage(); ++ else ++ strncpy(gconfig.configfile,argv[i], ++ sizeof(gconfig.configfile) - 1); ++ } ++ else if (! strncmp(argv[i],"-D",2)) { ++ gconfig.daemon=0; ++ } ++ else if (! strncmp(argv[i],"-s",2)) { ++ if(++i == argc) ++ usage(); ++ else ++ strncpy(gconfig.authfile,argv[i], ++ sizeof(gconfig.authfile) - 1); ++ } ++ else if (! strncmp(argv[i],"-p",2)) { ++ if(++i == argc) ++ usage(); ++ else ++ strncpy(gconfig.pidfile,argv[i], ++ sizeof(gconfig.pidfile) - 1); ++ } ++ else { ++ usage(); ++ } ++ } ++} ++ ++ ++void daemonize() { ++ int pid=0; ++ int i,l; ++ char buf[STRLEN]; ++ ++ if((pid = fork()) < 0) { ++ log(LOG_LOG, "%s: Unable to fork ()\n",__FUNCTION__); ++ close(server_socket); ++ exit(1); ++ } ++ else if (pid) ++ exit(0); ++ ++ ++ close(0); ++ close(1); ++ close(2); ++ dup2(open("/dev/null", O_RDONLY), 0); ++ dup2(open("/dev/null", O_RDONLY), 1); ++ dup2(open("/dev/null", O_RDONLY), 2); ++ ++ /* Read previous pid file. */ ++ if((i = open(gconfig.pidfile,O_RDONLY)) > 0) { ++ l=read(i,buf,sizeof(buf)-1); ++ if (l >= 0) { ++ buf[l] = '\0'; ++ pid = atoi(buf); ++ } ++ close(i); ++ ++ /* if pid is read and process exist exit */ ++ if(pid && !kill(pid, 0)) { ++ log(LOG_LOG, "%s: There's already a l2tpd server running.\n", ++ __FUNCTION__); ++ close(server_socket); ++ exit(1); ++ } ++ ++ /* remove stalled pid file */ ++ unlink(gconfig.pidfile); ++ } ++ ++ pid = setsid(); ++ ++ /* create new pid file */ ++ if ((i = open (gconfig.pidfile, O_WRONLY | O_CREAT, 0644)) >= 0) { ++ snprintf (buf, sizeof(buf), "%d", (int)getpid()); ++ write (i, buf, strlen(buf)); ++ close (i); ++ } ++ else { ++ log(LOG_LOG, "%s: could not write pid file %s error %d", ++ __FUNCTION__, gconfig.pidfile, i); ++ close(server_socket); ++ exit(1); ++ } ++} ++ ++ ++void init (int argc,char *argv[]) ++{ ++ struct lac *lac; ++ struct in_addr listenaddr; ++ ++ init_args (argc,argv); ++ srand( time(NULL) ); ++ rand_source = 0; ++ init_addr (); ++ if (init_config ()) ++ { ++ log (LOG_CRIT, "%s: Unable to load config file\n", __FUNCTION__); ++ exit (1); ++ } ++ if (uname (&uts)) ++ { ++ log (LOG_CRIT, "%s : Unable to determine host system\n", ++ __FUNCTION__); ++ exit (1); ++ } ++ init_tunnel_list (&tunnels); ++ if (init_network ()) ++ exit (1); ++ if (gconfig.daemon) ++ daemonize (); ++ signal (SIGTERM, &death_handler); ++ signal (SIGINT, &death_handler); ++ signal (SIGCHLD, &child_handler); ++ signal (SIGUSR1, &status_handler); ++ signal (SIGHUP, &null_handler); ++ init_scheduler (); ++ mkfifo (CONTROL_PIPE, 0600); ++ control_fd = open (CONTROL_PIPE, O_RDONLY | O_NONBLOCK, 0600); ++ if (control_fd < 0) ++ { ++ log (LOG_CRIT, "%s: Unable to open " CONTROL_PIPE " for reading.", ++ __FUNCTION__); ++ exit (1); ++ } ++ log (LOG_LOG, "l2tpd version " SERVER_VERSION " started on %s PID:%d\n", ++ hostname, getpid ()); ++ listenaddr.s_addr = gconfig.listenaddr; ++ log (LOG_LOG, "%s version %s on a %s, listening on IP address %s, port %d\n", uts.sysname, ++ uts.release, uts.machine, inet_ntoa(listenaddr), gconfig.port); ++ lac = laclist; ++ while (lac) ++ { ++ if (lac->autodial) ++ { ++#ifdef DEBUG_MAGIC ++ log (LOG_DEBUG, "%s: Autodialing '%s'\n", __FUNCTION__, ++ lac->entname[0] ? lac->entname : "(unnamed)"); ++#endif ++ lac->active = -1; ++ switch_io = 1; /* If we're a LAC, autodials will be ICRQ's */ ++ magic_lac_dial (lac); ++ } ++ lac = lac->next; ++ } ++} ++ ++int main (int argc, char *argv[]) ++{ ++ init(argc,argv); ++ dial_no_tmp = calloc (128, sizeof (char)); ++ network_thread (); ++ return 0; ++} diff --git a/net/l2tpd/patches/004-gcc4.patch b/net/l2tpd/patches/004-gcc4.patch new file mode 100644 index 0000000..c4a906e --- /dev/null +++ b/net/l2tpd/patches/004-gcc4.patch @@ -0,0 +1,12 @@ +diff -urN ../tmp-orig/l2tpd-0.70-pre20031121/aaa.c ./aaa.c +--- ../tmp-orig/l2tpd-0.70-pre20031121/aaa.c 2004-12-09 09:54:10.159417376 +0100 ++++ ./aaa.c 2004-12-09 09:54:01.918670160 +0100 +@@ -27,7 +27,7 @@ + + /* FIXME: Accounting? */ + +-static struct addr_ent *uaddr[ADDR_HASH_SIZE]; ++struct addr_ent *uaddr[ADDR_HASH_SIZE]; + + void init_addr () + { diff --git a/net/l2tpd/patches/004-nonblock.patch b/net/l2tpd/patches/004-nonblock.patch new file mode 100644 index 0000000..7fc2226 --- /dev/null +++ b/net/l2tpd/patches/004-nonblock.patch @@ -0,0 +1,26 @@ +--- l2tpd-0.70-pre20031121.orig/l2tpd.c.orig 2006-04-05 13:28:36.000000000 +0100 ++++ l2tpd-0.70-pre20031121.orig/l2tpd.c 2006-04-05 13:33:39.000000000 +0100 +@@ -289,6 +289,8 @@ + #endif + struct termios ptyconf; + char *str; ++ int flags; ++ + p = opts; + stropt[0] = strdup (PPPD); + while (p) +@@ -347,6 +349,14 @@ + close(c->fd); + return -EINVAL; + } ++ flags = fcntl(c->fd, F_GETFL); ++ if (flags < 0 || fcntl(c->fd, F_SETFL, flags | O_NONBLOCK) < 0) ++ { ++ log (LOG_WARN, "%s: unable to fcntl(O_NONBLOCK) on pty\n", ++ __FUNCTION__); ++ close(c->fd); ++ return -EINVAL; ++ } + tty = ptsname(c->fd); + if (tty == NULL) + { diff --git a/net/l2tpd/patches/005-df-disable.patch b/net/l2tpd/patches/005-df-disable.patch new file mode 100644 index 0000000..806c48d --- /dev/null +++ b/net/l2tpd/patches/005-df-disable.patch @@ -0,0 +1,25 @@ +Patch to stop l2tpd setting the DF bit on each of the packets it sends. +Apart from not being useful with L2TP, this also prevents interoperating +with Cisco IOS over IPSEC. + +--- l2tpd-0.70-pre20031121.orig/network.c.orig 2006-04-11 08:50:38.000000000 +0100 ++++ l2tpd-0.70-pre20031121.orig/network.c 2006-04-11 08:58:18.000000000 +0100 +@@ -56,6 +56,18 @@ + __FUNCTION__); + return -EINVAL; + }; ++#ifdef IP_MTU_DISCOVER ++#ifdef IP_PMTUDISC_DONT ++ { ++ /* Don't set DF bit on outbound packets */ ++ int val = IP_PMTUDISC_DONT; ++ if (setsockopt(server_socket, IPPROTO_IP, IP_MTU_DISCOVER, &val, sizeof(val)) < 0) ++ { ++ log (LOG_LOG, "Failed to disable PMTU discovery\n"); ++ } ++ } ++#endif ++#endif + /* L2TP/IPSec: Set up SA for listening port here? NTB 20011015 + */ + if (bind (server_socket, (struct sockaddr *) &server, sizeof (server))) diff --git a/net/l2tpns/Makefile b/net/l2tpns/Makefile new file mode 100644 index 0000000..c64378d --- /dev/null +++ b/net/l2tpns/Makefile @@ -0,0 +1,61 @@ +# +# 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:=l2tpns +PKG_VERSION:=2.1.21 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/l2tpns +PKG_MD5SUM:=385c58055723ebc6c38062acd2db9c2c + +include $(INCLUDE_DIR)/package.mk + +define Package/l2tpns + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libcli + TITLE:=An L2TP enhanced server + URL:=http://sourceforge.net/projects/l2tpns + SUBMENU:=VPN +endef + +define Package/l2tpns/description + l2tpns is a layer 2 tunneling protocol network server (LNS). + it supports up to 65535 concurrent sessions per server/cluster + plus ISP features such as rate limiting, walled garden, usage + accounting, and more. +endef + +define Package/l2tpns/conffiles +/etc/l2tpns/ip_pool +/etc/l2tpns/startup-config +/etc/l2tpns/users +endef + +define Build/Compile + $(call Build/Compile/Default, \ + LD="$(TARGET_CC)" \ + OPTIM="$(TARGET_CFLAGS)" \ + STAGING_DIR="$(STAGING_DIR)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install \ + ) +endef + +define Package/l2tpns/install + $(INSTALL_DIR) $(1)/etc/l2tpns + $(CP) $(PKG_INSTALL_DIR)/etc/l2tpns/* $(1)/etc/l2tpns/ + $(INSTALL_DIR) $(1)/usr/lib/l2tpns + $(CP) $(PKG_INSTALL_DIR)/usr/lib/l2tpns/* $(1)/usr/lib/l2tpns/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,l2tpns)) diff --git a/net/l2tpns/patches/001-honor_includes_no_fifo_scheduler.patch b/net/l2tpns/patches/001-honor_includes_no_fifo_scheduler.patch new file mode 100644 index 0000000..470538b --- /dev/null +++ b/net/l2tpns/patches/001-honor_includes_no_fifo_scheduler.patch @@ -0,0 +1,51 @@ +--- a/Makefile ++++ b/Makefile +@@ -11,17 +11,14 @@ + DEFINES += -DETCDIR='"$(etcdir)"' + + OPTIM = +-OPTIM += -g + OPTIM += -O3 + +-CC = gcc +-LD = gcc +-INCLUDES = -I. ++INCLUDES = -I. -I$(STAGING_DIR)/usr/include + CPPFLAGS = $(INCLUDES) $(DEFINES) + CFLAGS = -Wall -Wformat-security -Wno-format-zero-length $(OPTIM) +-LDFLAGS = ++LDFLAGS = -L$(STAGING_DIR)/usr/lib + LDLIBS = +-INSTALL = install -c -D -o root -g root ++INSTALL = install -c -D + + l2tpns.LIBS = -lm -lcli -ldl + +--- a/l2tpns.c ++++ b/l2tpns.c +@@ -4239,23 +4239,8 @@ + struct sched_param params = {0}; + params.sched_priority = 1; + +- if (get_nprocs() < 2) +- { +- LOG(0, 0, 0, "Not using FIFO scheduler, there is only 1 processor in the system.\n"); +- config->scheduler_fifo = 0; +- } +- else +- { +- if ((ret = sched_setscheduler(0, SCHED_FIFO, ¶ms)) == 0) +- { +- LOG(1, 0, 0, "Using FIFO scheduler. Say goodbye to any other processes running\n"); +- } +- else +- { +- LOG(0, 0, 0, "Error setting scheduler to FIFO: %s\n", strerror(errno)); +- config->scheduler_fifo = 0; +- } +- } ++ LOG(0, 0, 0, "Not using FIFO scheduler, there is only 1 processor in the system.\n"); ++ config->scheduler_fifo = 0; + } + + /* Set up the cluster communications port. */ diff --git a/net/l2tpv3tun/Makefile b/net/l2tpv3tun/Makefile new file mode 100644 index 0000000..f965569 --- /dev/null +++ b/net/l2tpv3tun/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2009-2010 Thomas Heil +# Copyright (C) 2010-2011 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:=l2tpv3tun +PKG_VERSION:=0.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://www.openl2tp.org/releases +PKG_MD5SUM:=d3b4a9af652cca9f34d3eea4a7ff6041 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/package.mk + +define Package/l2tpv3tun + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libnl +ip +kmod-l2tp +kmod-l2tp-ip +kmod-l2tp-eth + TITLE:=Control utility for static L2TP v3 (Pseudowire) tunnels + MAINTAINER:=Thomas Heil + URL:=http://www.openl2tp.org +endef + +define Package/l2tpv3tun/description + The l2tpv3tun utility is a command line frontend for configuring static + L2TP v3 pseudowire tunnels. +endef + +MAKE_FLAGS += \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(LINUX_DIR)/include" \ + LD="$(TARGET_CC)" \ + LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib -lnl -lnl-genl" + +define Package/l2tpv3tun/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/l2tpv3tun $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/lib/network + $(INSTALL_BIN) ./files/l2tp.sh $(1)/lib/network/ +endef + +$(eval $(call BuildPackage,l2tpv3tun)) diff --git a/net/l2tpv3tun/files/l2tp.sh b/net/l2tpv3tun/files/l2tp.sh new file mode 100644 index 0000000..a3eeb1d --- /dev/null +++ b/net/l2tpv3tun/files/l2tp.sh @@ -0,0 +1,213 @@ +# l2tp.sh - L2TPv3 tunnel backend +# Copyright (c) 2010 OpenWrt.org + +l2tp_next_tunnel_id() { + local max=0 + local val + for val in $( + local l + l2tpv3tun show tunnel | while read l; do + case "$l" in + Tunnel*,*encap*) l="${l#Tunnel }"; echo "${l%%,*}";; + esac + done + ); do + [ "$val" -gt "$max" ] && max="$val" + done + echo $((max + 1)) +} + +l2tp_next_session_id() { + local tunnel="$1" + local max=0 + local val + for val in $( + local l + l2tpv3tun show session${tunnel:+ tunnel_id "$tunnel"} | while read l; do + case "$l" in + Session*in*) l="${l#Session }"; echo "${l%% *}";; + esac + done + ); do + [ "$val" -gt "$max" ] && max="$val" + done + echo $((max + 1)) +} + +l2tp_tunnel_exists() { + test -n "$(l2tpv3tun show tunnel tunnel_id "$1" 2>/dev/null)" +} + +l2tp_session_exists() { + test -n "$(l2tpv3tun show session tunnel_id "$1" session_id "$2" 2>/dev/null)" +} + +l2tp_ifname() { + l2tpv3tun show session tunnel_id "$1" session_id "$2" 2>/dev/null | \ + sed -ne 's/^.*interface name: //p' +} + +l2tp_lock() { + lock /var/lock/l2tp-setup +} + +l2tp_unlock() { + lock -u /var/lock/l2tp-setup +} + +l2tp_log() { + logger -t "ifup-l2tp" "$@" +} + + +# Hook into scan_interfaces() to synthesize a .device option +# This is needed for /sbin/ifup to properly dispatch control +# to setup_interface_l2tp() even if no .ifname is set in +# the configuration. +scan_l2tp() { + local dev + config_get dev "$1" device + config_set "$1" device "${dev:+$dev }l2tp-$1" +} + +coldplug_interface_l2tp() { + setup_interface_l2tp "l2tp-$1" "$1" +} + +setup_interface_l2tp() { + local iface="$1" + local cfg="$2" + local link="l2tp-$cfg" + + l2tp_lock + + # prevent recursion + local up="$(uci_get_state network "$cfg" up 0)" + [ "$up" = 0 ] || { + l2tp_unlock + return 0 + } + + local tunnel_id + config_get tunnel_id "$cfg" tunnel_id + [ -n "$tunnel_id" ] || { + tunnel_id="$(l2tp_next_tunnel_id)" + uci_set_state network "$cfg" tunnel_id "$tunnel_id" + l2tp_log "No tunnel ID specified, assuming $tunnel_id" + } + + local peer_tunnel_id + config_get peer_tunnel_id "$cfg" peer_tunnel_id + [ -n "$peer_tunnel_id" ] || { + peer_tunnel_id="$tunnel_id" + uci_set_state network "$cfg" peer_tunnel_id "$peer_tunnel_id" + l2tp_log "No peer tunnel ID specified, assuming $peer_tunnel_id" + } + + local encap + config_get encap "$cfg" encap udp + + local sport dport + [ "$encap" = udp ] && { + config_get sport "$cfg" sport 1701 + config_get dport "$cfg" dport 1701 + } + + local peeraddr + config_get peeraddr "$cfg" peeraddr + [ -z "$peeraddr" ] && config_get peeraddr "$cfg" peer6addr + + local localaddr + case "$peeraddr" in + *:*) config_get localaddr "$cfg" local6addr ;; + *) config_get localaddr "$cfg" localaddr ;; + esac + + [ -n "$localaddr" -a -n "$peeraddr" ] || { + l2tp_log "Missing local or peer address for tunnel $cfg - skipping" + return 1 + } + + ( + while ! l2tp_tunnel_exists "$tunnel_id"; do + [ -n "$sport" ] && l2tpv3tun show tunnel 2>/dev/null | grep -q "ports: $sport/" && { + l2tp_log "There already is a tunnel with src port $sport - skipping" + l2tp_unlock + return 1 + } + + l2tpv3tun add tunnel tunnel_id "$tunnel_id" peer_tunnel_id "$peer_tunnel_id" \ + encap "$encap" local "$localaddr" remote "$peeraddr" \ + ${sport:+udp_sport "$sport"} ${dport:+udp_dport "$dport"} + + # Wait for tunnel + sleep 1 + done + + + local session_id + config_get session_id "$cfg" session_id + [ -n "$session_id" ] || { + session_id="$(l2tp_next_session_id "$tunnel_id")" + uci_set_state network "$cfg" session_id "$session_id" + l2tp_log "No session ID specified, assuming $session_id" + } + + local peer_session_id + config_get peer_session_id "$cfg" peer_session_id + [ -n "$peer_session_id" ] || { + peer_session_id="$session_id" + uci_set_state network "$cfg" peer_session_id "$peer_session_id" + l2tp_log "No peer session ID specified, assuming $peer_session_id" + } + + + while ! l2tp_session_exists "$tunnel_id" "$session_id"; do + l2tpv3tun add session ifname "$link" tunnel_id "$tunnel_id" \ + session_id "$session_id" peer_session_id "$peer_session_id" + + # Wait for session + sleep 1 + done + + + local dev + config_get dev "$cfg" device + + local ifn + config_get ifn "$cfg" ifname + + uci_set_state network "$cfg" ifname "${ifn:-$dev}" + uci_set_state network "$cfg" device "$dev" + + local mtu + config_get mtu "$cfg" mtu 1462 + + local ttl + config_get ttl "$cfg" ttl + + ip link set mtu "$mtu" ${ttl:+ ttl "$ttl"} dev "$link" + + # IP setup inherited from proto static + prepare_interface "$link" "$cfg" + setup_interface_static "${ifn:-$dev}" "$cfg" + + ip link set up dev "$link" + + uci_set_state network "$cfg" up 1 + l2tp_unlock + ) & +} + +stop_interface_l2tp() { + local cfg="$1" + local link="l2tp-$cfg" + + local tunnel=$(uci_get_state network "$cfg" tunnel_id) + local session=$(uci_get_state network "$cfg" session_id) + + [ -n "$tunnel" ] && [ -n "$session" ] && { + l2tpv3tun del session tunnel_id "$tunnel" session_id "$session" + l2tpv3tun del tunnel tunnel_id "$tunnel" + } +} diff --git a/net/l2tpv3tun/patches/010-custom_ifname.patch b/net/l2tpv3tun/patches/010-custom_ifname.patch new file mode 100644 index 0000000..14a085f --- /dev/null +++ b/net/l2tpv3tun/patches/010-custom_ifname.patch @@ -0,0 +1,20 @@ +--- a/main.c ++++ b/main.c +@@ -560,6 +560,7 @@ static void usage(void) + fprintf(stderr, " session_id ID peer_session_id ID\n"); + fprintf(stderr, " [ cookie HEXSTR ] [ peer_cookie HEXSTR ]\n"); + fprintf(stderr, " [ offset OFFSET ] [ peer_offset OFFSET ]\n"); ++ fprintf(stderr, " [ ifname IFNAME ]\n"); + fprintf(stderr, " %s del tunnel tunnel_id ID\n", L2TP_CMD_ROOT); + fprintf(stderr, " %s del session tunnel_id ID session_id ID\n", L2TP_CMD_ROOT); + fprintf(stderr, " %s show tunnel [ tunnel_id ID ]\n", L2TP_CMD_ROOT); +@@ -671,6 +672,9 @@ static int parse_args(int argc, char **a + p->peer_cookie_len = slen / 2; + if (hex2mem(*argv, p->peer_cookie, p->peer_cookie_len) < 0) + invarg("cookie must be a hex string\n", *argv); ++ } else if (strcmp(*argv, "ifname") == 0) { ++ NEXT_ARG(); ++ p->ifname = *argv; + } else if (strcmp(*argv, "tunnel") == 0) { + p->tunnel = 1; + } else if (strcmp(*argv, "session") == 0) { diff --git a/net/l2tpv3tun/patches/100-nl_handle_alloc.patch b/net/l2tpv3tun/patches/100-nl_handle_alloc.patch new file mode 100644 index 0000000..f245468 --- /dev/null +++ b/net/l2tpv3tun/patches/100-nl_handle_alloc.patch @@ -0,0 +1,23 @@ +--- a/main.c ++++ b/main.c +@@ -100,7 +100,7 @@ struct l2tp_data { + }; + + /* netlink socket */ +-static struct nl_handle *nl_sock; ++static struct nl_sock *nl_sock; + static int nl_family; + + /***************************************************************************** +@@ -788,9 +788,9 @@ static int do_show(int argc, char **argv + + int do_ipl2tp(int argc, char **argv) + { +- nl_sock = nl_handle_alloc(); ++ nl_sock = nl_socket_alloc(); + if (!nl_sock) { +- perror("nl_handle_alloc"); ++ perror("nl_socket_alloc"); + return 1; + } + diff --git a/net/l7-protocols/Makefile b/net/l7-protocols/Makefile new file mode 100644 index 0000000..6f7acf7 --- /dev/null +++ b/net/l7-protocols/Makefile @@ -0,0 +1,78 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=l7-protocols +PKG_VERSION:=2009-05-28 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/l7-filter +PKG_MD5SUM:=91be154d12134dcdbc560cc7aa7fe4ce + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/l7-protocols + SECTION:=net + CATEGORY:=Network + TITLE:=Protocols for layer7 filtering + URL:=http://l7-filter.sourceforge.net/ + SUBMENU:=Firewall + DEPENDS:=iptables-mod-filter +endef + +define Package/l7-protocols/description + l7-filter classifies packets based on patterns in application + layer data. This allows correct classification of P2P traffic that + uses unpredictable ports as well as standard protocols running on + non-standard ports. +endef + +define Package/l7-protocols-testing + $(call Package/l7-protocols) + TITLE:=testing utilities for layer7 + DEPENDS+=l7-protocols $(CXX_DEPENDS) +endef + +define Package/l7-protocols-testing/description + testing utilities for layer 7 patterns +endef + +define Build/Configure +endef + +ifneq ($(SDK)$(CONFIG_PACKAGE_l7-protocols-testing),) + define Build/Compile + cd $(PKG_BUILD_DIR)/testing && $(MAKE) $(TARGET_CONFIGURE_OPTS) + endef +else + define Build/Compile + endef +endif + +define Package/l7-protocols/install + $(INSTALL_DIR) $(1)/etc/l7-protocols + $(CP) $(PKG_BUILD_DIR)/example_traffic \ + $(PKG_BUILD_DIR)/extra \ + $(PKG_BUILD_DIR)/file_types \ + $(PKG_BUILD_DIR)/groups.sh \ + $(PKG_BUILD_DIR)/malware \ + $(PKG_BUILD_DIR)/protocols \ + $(1)/etc/l7-protocols +endef + +define Package/l7-protocols-testing/install + $(INSTALL_DIR) $(1)/etc/l7-protocols/testing + $(CP) $(PKG_BUILD_DIR)/testing/data \ + $(1)/etc/l7-protocols/testing + $(INSTALL_BIN) \ + $(PKG_BUILD_DIR)/testing/rand{chars,printable} \ + $(PKG_BUILD_DIR)/testing/test_speed-{kernel,userspace} \ + $(PKG_BUILD_DIR)/testing/match_kernel \ + $(PKG_BUILD_DIR)/testing/doallspeeds.sh \ + $(PKG_BUILD_DIR)/testing/test_match.sh \ + $(PKG_BUILD_DIR)/testing/timeit.sh \ + $(1)/etc/l7-protocols/testing +endef + +$(eval $(call BuildPackage,l7-protocols)) +$(eval $(call BuildPackage,l7-protocols-testing)) diff --git a/net/l7-protocols/patches/100-testing_crosscompile.patch b/net/l7-protocols/patches/100-testing_crosscompile.patch new file mode 100644 index 0000000..70ee2d1 --- /dev/null +++ b/net/l7-protocols/patches/100-testing_crosscompile.patch @@ -0,0 +1,27 @@ +--- a/testing/Makefile ++++ b/testing/Makefile +@@ -1,19 +1,19 @@ + all: randchars randprintable test_speed-kernel test_speed-userspace match_kernel + + randchars: randchars.c +- gcc -O2 -o randchars randchars.c ++ $(CC) -O2 -o randchars randchars.c + + randprintable: randprintable.c +- gcc -O2 -o randprintable randprintable.c ++ $(CC) -O2 -o randprintable randprintable.c + + test_speed-kernel: test_speed-kernel.c +- gcc -o test_speed-kernel test_speed-kernel.c ++ $(CC) -o test_speed-kernel test_speed-kernel.c + + test_speed-userspace: test_speed-userspace.cpp l7-parse-patterns.cpp l7-parse-patterns.h +- g++ -Wall -o test_speed-userspace test_speed-userspace.cpp l7-parse-patterns.cpp ++ $(CXX) -Wall -o test_speed-userspace test_speed-userspace.cpp l7-parse-patterns.cpp + + match_kernel: match-kernel.c +- gcc -O2 -o match_kernel match-kernel.c ++ $(CC) -O2 -o match_kernel match-kernel.c + + clean: + rm -f randprintable randchars test_speed-kernel test_speed-userspace match_kernel diff --git a/net/l7-protocols/patches/101-testing-timeit.patch b/net/l7-protocols/patches/101-testing-timeit.patch new file mode 100644 index 0000000..6656889 --- /dev/null +++ b/net/l7-protocols/patches/101-testing-timeit.patch @@ -0,0 +1,102 @@ +--- a/testing/timeit.sh ++++ b/testing/timeit.sh +@@ -1,11 +1,8 @@ + #!/bin/bash + +-# "man 1 time" for details +-export TIME="%U seconds" +- + add() + { +- if ! dc -e ""; then ++ if ! dc p >/dev/null 2>&1; then + echo you do not have dc, so I cannot add these numbers... + exit 1 + fi +@@ -14,7 +11,7 @@ add() + tot=0 + + while read n; do +- tot=`dc -e "$n $tot + pop" 2> /dev/null` ++ tot=`dc $n $tot + p 2> /dev/null` + done + + echo $tot seconds +@@ -34,7 +31,7 @@ extract() + + if [ ! $3 ] || [ $2 == "-h" ] || [ $2 == "--help" ]; then + echo +- echo Syntax: ./timeit.sh patternfile kernel\|userspace all\|print\|real [data_files] ++ echo Syntax: .//usr/bin/timeit.sh patternfile kernel\|userspace all\|print\|real [data_files] + echo + echo \"kernel\" uses the kernel pattern and library + echo \"userspace\" uses userspace pattern and library +@@ -72,12 +69,12 @@ echo Timing $1 + if [ $3 == "all" ]; then + echo Using all characters + if [ $2 == "kernel" ]; then +- if ! ./randchars | time $speedprog "`extract $1`" verbose; then ++ if ! ./randchars | /usr/bin/time $speedprog "`extract $1`" verbose 2>&1 >/dev/null | grep user | cut -d\ -f2; then + echo $speedprog failed. > /dev/stderr + exit 1 + fi + else +- if ! ./randchars | time $speedprog -f "$1" -v; then ++ if ! ./randchars | /usr/bin/time $speedprog -f "$1" -v 2>&1 >/dev/null | grep user | cut -d\ -f2; then + echo $speedprog failed. > /dev/stderr + exit 1 + fi +@@ -85,12 +82,12 @@ if [ $3 == "all" ]; then + elif [ $3 == "print" ]; then + echo Using only printable characters + if [ $2 == "kernel" ]; then +- if ! ./randprintable | time $speedprog "`extract $1`" verbose; then ++ if ! ./randprintable | /usr/bin/time $speedprog "`extract $1`" verbose 2>&1 >/dev/null | grep user | cut -d\ -f2; then + echo $speedprog failed. > /dev/stderr + exit 1 + fi + else +- if ! ./randprintable | time $speedprog -f "$1" -v; then ++ if ! ./randprintable | /usr/bin/time $speedprog -f "$1" -v 2>&1 >/dev/null | grep user | cut -d\ -f2; then + echo $speedprog failed. > /dev/stderr + exit 1 + fi +@@ -107,12 +104,12 @@ elif [ $3 == "real" ]; then + printf $f\\t + #echo `extract $1` + if [ $2 == "kernel" ]; then +- if ! cat $f | time $speedprog "`extract $1`" 2> /dev/stdout | tee -a tmp.$$; then ++ if ! cat $f | /usr/bin/time $speedprog "`extract $1`" 2>&1 >/dev/null | grep user | cut -d\ -f2 | tee -a tmp.$$; then + echo $speedprog failed. > /dev/stderr + exit 1 + fi + else +- if ! cat $f | time $speedprog -f "$1" 2> /dev/stdout | tee -a tmp.$$; then ++ if ! cat $f | /usr/bin/time $speedprog -f "$1" 2>&1 >/dev/null | grep user | cut -d\ -f2 | tee -a tmp.$$; then + echo $speedprog failed. > /dev/stderr + exit 1 + fi +@@ -123,12 +120,12 @@ elif [ $3 == "real" ]; then + for f in data/*; do + printf $f\\t + if [ $2 == "kernel" ]; then +- if ! cat $f | time $speedprog "`extract $1`" 2> /dev/stdout | tee -a tmp.$$; then ++ if ! cat $f | /usr/bin/time $speedprog "`extract $1`" 2>&1 >/dev/null | grep user | cut -d\ -f2 | tee -a tmp.$$; then + echo $speedprog failed. > /dev/stderr + exit 1 + fi + else +- if ! cat $f | time $speedprog -f "$1" 2> /dev/stdout | tee -a tmp.$$; then ++ if ! cat $f | /usr/bin/time $speedprog -f "$1" 2>&1 >/dev/null | grep user | cut -d\ -f2 | tee -a tmp.$$; then + echo $speedprog failed. > /dev/stderr + exit 1 + fi +@@ -137,7 +134,7 @@ elif [ $3 == "real" ]; then + fi + + printf Total:\ +- cat tmp.$$ | cut -d\ -f 2 | add ++ cat tmp.$$ | cut -ds -f 1| add + + rm tmp.$$ + else diff --git a/net/l7-protocols/patches/102-testing-doallspeeds.patch b/net/l7-protocols/patches/102-testing-doallspeeds.patch new file mode 100644 index 0000000..850a1d6 --- /dev/null +++ b/net/l7-protocols/patches/102-testing-doallspeeds.patch @@ -0,0 +1,16 @@ +--- a/testing/doallspeeds.sh ++++ b/testing/doallspeeds.sh +@@ -25,11 +25,11 @@ for f in ../*/*.pat; do + printf `basename $f .pat` + + if [ $userspace ]; then +- gtime=`./timeit.sh $f userspace real | grep Total | cut -d\ -f 2` ++ gtime=`./timeit.sh $f userspace real | grep Total | cut -d\ -f 2 | awk '{print $1}'` + printf \\t$gtime + fi + if [ $kernel ]; then +- htime=`./timeit.sh $f kernel real | grep Total | cut -d\ -f 2` ++ htime=`./timeit.sh $f kernel real | grep Total | cut -d\ -f 2 | awk '{print $1}'` + printf \\t$htime + fi + printf \\n diff --git a/net/leafnode/Makefile b/net/leafnode/Makefile new file mode 100644 index 0000000..8532dd1 --- /dev/null +++ b/net/leafnode/Makefile @@ -0,0 +1,90 @@ +# +# Copyright (C) 2009-2011 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:=leafnode +PKG_VERSION:=1.11.8 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/leafnode +PKG_MD5SUM:=a3edafeb854efaa3fbb0f7951d02160f + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +CONFIGURE_ARGS+=--sysconfdir=/etc/leafnode +CONFIGURE_VARS+=LIBS=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +EXTRA_CFLAGS+= $(TARGET_CPPFLAGS) + +EXTRA_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +define Package/leafnode/Default + SUBMENU:=NNTP + SECTION:=net + CATEGORY:=Network + URL:=http://leafnode.sourceforge.net +endef + +define Package/leafnode + $(call Package/leafnode/Default) + DEPENDS:=+libpcre +xinetd + TITLE:=Leafnode store-and-forward NNTP proxy +endef + +define Package/leafnode/description + This package contains the "leafnode", "fetchnews" and + "texpire" programs and the necessary configuration files + for the leafnode proxy +endef + +define Package/leafnode-extra + $(call Package/leafnode/Default) + DEPENDS:=leafnode + TITLE:=Leafnode extra programs +endef + +define Package/leafnode-extra/description + This package contains the more rarely used "checkgroups", + "applyfilter" and "leafnode-version" programs from the + leafnode suite +endef + +define Package/leafnode/conffiles +/etc/leafnode/config.example +/etc/xinetd.d/nntp +/etc/crontabs/news +endef + +define Package/leafnode/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/leafnode $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fetchnews $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/texpire $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/leafnode + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/leafnode/config.example $(1)/etc/leafnode/ + $(INSTALL_DIR) $(1)/etc/xinetd.d + $(INSTALL_DATA) ./files/nntp $(1)/etc/xinetd.d/ + $(INSTALL_DIR) $(1)/etc/crontabs + $(INSTALL_DATA) ./files/news $(1)/etc/crontabs/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/leafnode.init $(1)/etc/init.d/leafnode +endef + +define Package/leafnode-extra/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/checkgroups $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/applyfilter $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/leafnode-version $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,leafnode)) +$(eval $(call BuildPackage,leafnode-extra)) diff --git a/net/leafnode/files/leafnode.init b/net/leafnode/files/leafnode.init new file mode 100644 index 0000000..8a54cdf --- /dev/null +++ b/net/leafnode/files/leafnode.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2011 OpenWrt.org + +START=49 + +start() { + user_exists news 31 || user_add news 31 "" /var/spool/news + group_exists news 31 || group_add news 31 + [ -d /var/spool/news ] || { + mkdir -m 0755 -p /var/spool/news + chown news:news /var/spool/news + } +} diff --git a/net/leafnode/files/news b/net/leafnode/files/news new file mode 100644 index 0000000..7e1fd79 --- /dev/null +++ b/net/leafnode/files/news @@ -0,0 +1,2 @@ +45 * * * * fetchnews +15 3 * * * texpire diff --git a/net/leafnode/files/nntp b/net/leafnode/files/nntp new file mode 100644 index 0000000..7f0c4bd --- /dev/null +++ b/net/leafnode/files/nntp @@ -0,0 +1,10 @@ +service nntp +{ + disable = no + flags = REUSE + socket_type = stream + wait = no + user = news + server = /usr/sbin/leafnode + log_on_failure += USERID +} diff --git a/net/lft/Makefile b/net/lft/Makefile new file mode 100644 index 0000000..1c946b2 --- /dev/null +++ b/net/lft/Makefile @@ -0,0 +1,71 @@ +# +# Copyright (C) 2006-2011 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:=lft +PKG_VERSION:=3.32 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://pwhois.org/get +PKG_MD5SUM:=5f09c9ad2475cb237b8277a2d69c569c + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/lft/Default + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap + TITLE:=The alternative traceroute and whois tools for network engineers + URL:=http://pwhois.org/lft +endef + +define Package/lft/Default/description + LFT, short for Layer Four Traceroute, is a sort of 'traceroute' that + often works much faster (than the commonly-used Van Jacobson method) + and goes through many configurations of packet-filters (firewalls). + More importantly, LFT implements numerous other features including AS + number lookups through several reliable sources, loose source routing, + netblock name lookups, et al. +endef + +define Package/lft + $(call Package/lft/Default) +endef + +define Package/lft/description + $(call Package/lft/Default/description) + This package contains the lft 'traceroute' program. +endef + +define Package/whob + $(call Package/lft/Default) +endef + +define Package/whob/description + $(call Package/lft/Default/description) + This package contains the whob 'whois' program. +endef + +CONFIGURE_ARGS += \ + --with-pcap="$(STAGING_DIR)/usr" + +define Package/lft/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lft $(1)/usr/bin/ +endef + +define Package/whob/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/whob $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,lft)) +$(eval $(call BuildPackage,whob)) diff --git a/net/lft/patches/001-no_strip.patch b/net/lft/patches/001-no_strip.patch new file mode 100644 index 0000000..f58fbda --- /dev/null +++ b/net/lft/patches/001-no_strip.patch @@ -0,0 +1,11 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -50,8 +50,6 @@ whob: whois.o + + install: lft lft.8 whob whob.8 + @echo "LFT and WhoB" +- @echo " \_Stripping binaries" +- @strip lft whob + @echo " \_Copying files to their intended destinations" + @test -d $(DESTDIR)$(bindir)/. || $(MKDIR) $(DESTDIR)$(bindir) + $(INSTALL) lft $(DESTDIR)$(bindir)/lft diff --git a/net/lftp/Makefile b/net/lftp/Makefile new file mode 100644 index 0000000..9503f70 --- /dev/null +++ b/net/lftp/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2008-2012 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:=lftp +PKG_VERSION:=4.3.6 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=http://lftp.cybermirror.org \ + http://lftp.cybermirror.org/old +PKG_MD5SUM:=ffcdbaec5d1416cb6dd754efd43fa61a + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/lftp + SUBMENU:=File Transfer + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libncurses +libopenssl +libreadline $(CXX_DEPENDS) +libexpat + TITLE:=Sophisticated file transfer program + URL:=http://lftp.yar.ru/ +endef + +define Package/lftp/description + lftp is sophisticated file transfer program with command line interface. It + supports FTP, HTTP, FISH, SFTP and FILE (local FS) protocols. GNU Readline + library is used for input. BitTorrent protocol is supported as built-in + `torrent' command. +endef + +CONFIGURE_ARGS += \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + --without-gnutls \ + --without-libresolv \ + --with-openssl="$(STAGING_DIR)/usr" \ + --disable-static + +CONFIGURE_VARS += \ + LIBS="-lz -lutil -lcurses -ldl" \ + i_cv_posix_fallocate_works=no + +MAKE_VARS += \ + LD="$(TARGET_CXX)" + +define Package/lftp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lftp $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,lftp)) diff --git a/net/lftp/patches/001-libintl.patch b/net/lftp/patches/001-libintl.patch new file mode 100644 index 0000000..13b3961 --- /dev/null +++ b/net/lftp/patches/001-libintl.patch @@ -0,0 +1,18 @@ +--- a/lib/gettext.h ++++ b/lib/gettext.h +@@ -22,7 +22,6 @@ + #if ENABLE_NLS + + /* Get declarations of GNU message catalog functions. */ +-# include + + /* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by + the gettext() and ngettext() macros. This is an alternative to calling +@@ -54,7 +53,6 @@ + #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) + # include + # if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H +-# include + # endif + #endif + diff --git a/net/lighttpd/Makefile b/net/lighttpd/Makefile new file mode 100644 index 0000000..bae692e --- /dev/null +++ b/net/lighttpd/Makefile @@ -0,0 +1,327 @@ +# +# Copyright (C) 2006-2012 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.30 +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:=4630517b8342d4ec0a2d61a0a9e05c82 + +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/ +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 + +define Package/lighttpd-mod-access + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=Access restrictions module +endef + +define Package/lighttpd-mod-accesslog + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=Access logging module +endef + +define Package/lighttpd-mod-alias + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=Directory alias module +endef + +define Package/lighttpd-mod-auth + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=Authentication module +endef + +define Package/lighttpd-mod-cgi + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=CGI module +endef + +define Package/lighttpd-mod-cml + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=Cache Meta Language module +endef + +define Package/lighttpd-mod-compress + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd +zlib + TITLE:=Compress output module +endef + +define Package/lighttpd-mod-evasive + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=Evasive module +endef + +define Package/lighttpd-mod-evhost + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=Exnhanced Virtual-Hosting module +endef + +define Package/lighttpd-mod-expire + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=Expire module +endef + +define Package/lighttpd-mod-extforward + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=Extract client IP module +endef + +define Package/lighttpd-mod-fastcgi + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=FastCGI module +endef + +define Package/lighttpd-mod-flv-streaming + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=flv streaming module +endef + +define Package/lighttpd-mod-magnet + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=magnet module +endef + +define Package/lighttpd-mod-mysql-vhost + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd +libmysqlclient + TITLE:=Mysql virtual hosting module +endef + +define Package/lighttpd-mod-proxy + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=Proxy module +endef + +define Package/lighttpd-mod-redirect + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd +libpcre + TITLE:=URL redirection module +endef + +define Package/lighttpd-mod-rewrite + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd +libpcre + TITLE:=URL rewriting module +endef + +define Package/lighttpd-mod-rrdtool + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=rrdtool module +endef + +define Package/lighttpd-mod-scgi + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=SCGI module +endef + +define Package/lighttpd-mod-secdownload + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=Secure and fast download module +endef + +define Package/lighttpd-mod-setenv + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=Environment variable setting module +endef + +define Package/lighttpd-mod-simple-vhost + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=Simple virtual hosting module +endef + +define Package/lighttpd-mod-ssi + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd +libpcre + TITLE:=SSI module +endef + +define Package/lighttpd-mod-status + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=Server status display module +endef + +define Package/lighttpd-mod-trigger-b4-dl + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd +libpcre + TITLE:=Trigger before download module +endef + +define Package/lighttpd-mod-userdir + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=User directory module +endef + +define Package/lighttpd-mod-usertrack + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd + TITLE:=User tracking module +endef + +define Package/lighttpd-mod-webdav + $(call Package/lighttpd/Default) + DEPENDS:=lighttpd +libsqlite3 +libuuid +libxml2 + TITLE:=WebDAV module +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 \ + --without-lua \ + --without-memcache \ + --without-mysql \ + --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-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_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/$(1)/install + [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/lighttpd + for m in $(2); do \ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$$$$$$$${m}.so $$(1)/usr/lib/lighttpd/ ; \ + done + endef + + $$(eval $$(call BuildPackage,$(1))) +endef + +$(eval $(call BuildPackage,lighttpd)) +$(eval $(call BuildPlugin,lighttpd-mod-access,access)) +$(eval $(call BuildPlugin,lighttpd-mod-accesslog,accesslog)) +$(eval $(call BuildPlugin,lighttpd-mod-alias,alias)) +$(eval $(call BuildPlugin,lighttpd-mod-auth,auth)) +$(eval $(call BuildPlugin,lighttpd-mod-cgi,cgi)) +$(eval $(call BuildPlugin,lighttpd-mod-cml,cml)) +$(eval $(call BuildPlugin,lighttpd-mod-compress,compress)) +$(eval $(call BuildPlugin,lighttpd-mod-evasive,evasive)) +$(eval $(call BuildPlugin,lighttpd-mod-evhost,evhost)) +$(eval $(call BuildPlugin,lighttpd-mod-expire,expire)) +$(eval $(call BuildPlugin,lighttpd-mod-extforward,extforward)) +$(eval $(call BuildPlugin,lighttpd-mod-fastcgi,fastcgi)) +$(eval $(call BuildPlugin,lighttpd-mod-flv-streaming,flv_streaming)) +$(eval $(call BuildPlugin,lighttpd-mod-magnet,magnet)) +$(eval $(call BuildPlugin,lighttpd-mod-proxy,proxy)) +$(eval $(call BuildPlugin,lighttpd-mod-redirect,redirect)) +$(eval $(call BuildPlugin,lighttpd-mod-rewrite,rewrite)) +$(eval $(call BuildPlugin,lighttpd-mod-rrdtool,rrdtool)) +$(eval $(call BuildPlugin,lighttpd-mod-scgi,scgi)) +$(eval $(call BuildPlugin,lighttpd-mod-secdownload,secdownload)) +$(eval $(call BuildPlugin,lighttpd-mod-setenv,setenv)) +$(eval $(call BuildPlugin,lighttpd-mod-simple-vhost,simple_vhost)) +$(eval $(call BuildPlugin,lighttpd-mod-ssi,ssi)) +$(eval $(call BuildPlugin,lighttpd-mod-status,status)) +$(eval $(call BuildPlugin,lighttpd-mod-trigger-b4-dl,trigger_b4_dl)) +$(eval $(call BuildPlugin,lighttpd-mod-userdir,userdir)) +$(eval $(call BuildPlugin,lighttpd-mod-usertrack,usertrack)) +$(eval $(call BuildPlugin,lighttpd-mod-webdav,webdav)) diff --git a/net/lighttpd/files/lighttpd.conf b/net/lighttpd/files/lighttpd.conf new file mode 100644 index 0000000..269f546 --- /dev/null +++ b/net/lighttpd/files/lighttpd.conf @@ -0,0 +1,231 @@ +# lighttpd configuration file +# +## modules to load +# all other module should only be loaded if really neccesary +# - saves some time +# - saves memory +#server.modules = ( +# "mod_rewrite", +# "mod_redirect", +# "mod_alias", +# "mod_auth", +# "mod_status", +# "mod_setenv", +# "mod_fastcgi", +# "mod_proxy", +# "mod_simple_vhost", +# "mod_cgi", +# "mod_ssi", +# "mod_usertrack", +# "mod_expire", +# "mod_webdav" +#) + +# force use of the "write" backend (closes: #2401) +server.network-backend = "write" + +## a static document-root, for virtual-hosting take look at the +## server.virtual-* options +server.document-root = "/www/" + +## where to send error-messages to +#server.errorlog = "/var/log/lighttpd/error.log" + +## files to check for if .../ is requested +index-file.names = ( "index.html", "default.html", "index.htm", "default.htm" ) + +## mimetype mapping +mimetype.assign = ( + ".pdf" => "application/pdf", + ".class" => "application/octet-stream", + ".pac" => "application/x-ns-proxy-autoconfig", + ".swf" => "application/x-shockwave-flash", + ".wav" => "audio/x-wav", + ".gif" => "image/gif", + ".jpg" => "image/jpeg", + ".jpeg" => "image/jpeg", + ".png" => "image/png", + ".svg" => "image/svg+xml", + ".css" => "text/css", + ".html" => "text/html", + ".htm" => "text/html", + ".js" => "text/javascript", + ".txt" => "text/plain", + ".dtd" => "text/xml", + ".xml" => "text/xml" + ) + +## Use the "Content-Type" extended attribute to obtain mime type if possible +#mimetypes.use-xattr = "enable" + +## send a different Server: header +## be nice and keep it at lighttpd +#server.tag = "lighttpd" + +$HTTP["url"] =~ "\.pdf$" { + server.range-requests = "disable" +} + +## +# which extensions should not be handle via static-file transfer +# +# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi +static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) + +######### Options that are good to be but not neccesary to be changed ####### + +## bind to port (default: 80) +#server.port = 81 + +## bind to localhost (default: all interfaces) +#server.bind = "localhost" + +## error-handler for status 404 +#server.error-handler-404 = "/error-handler.html" +#server.error-handler-404 = "/error-handler.php" + +## to help the rc.scripts +server.pid-file = "/var/run/lighttpd.pid" + + +###### virtual hosts +## +## If you want name-based virtual hosting add the next three settings and load +## mod_simple_vhost +## +## document-root = +## virtual-server-root + virtual-server-default-host + virtual-server-docroot or +## virtual-server-root + http-host + virtual-server-docroot +## +#simple-vhost.server-root = "/home/weigon/wwwroot/servers/" +#simple-vhost.default-host = "grisu.home.kneschke.de" +#simple-vhost.document-root = "/pages/" + + +## +## Format: .html +## -> ..../status-404.html for 'File not found' +#server.errorfile-prefix = "/www/error-" + +## virtual directory listings +#server.dir-listing = "enable" + +## send unhandled HTTP-header headers to error-log +#debug.dump-unknown-headers = "enable" + +### only root can use these options +# +# chroot() to directory (default: no chroot() ) +#server.chroot = "/" + +## change uid to (default: don't care) +#server.username = "nobody" +# +server.upload-dirs = ( "/tmp" ) + +## change uid to (default: don't care) +#server.groupname = "nobody" + +#### compress module +#compress.cache-dir = "/dev/null/" +#compress.filetype = ("text/plain", "text/html") + +#### proxy module +## read proxy.txt for more info +#proxy.server = ( +# ".php" => ( +# "localhost" => ( +# "host" => "192.168.0.101", +# "port" => 80 +# ) +# ) +#) + +#### fastcgi module +## read fastcgi.txt for more info +#fastcgi.server = ( +# ".php" => ( +# "localhost" => ( +# "socket" => "/tmp/php-fastcgi.socket", +# "bin-path" => "/usr/local/bin/php" +# ) +# ) +#) + +#### CGI module +#cgi.assign = ( ".pl" => "/usr/bin/perl", ".cgi" => "/usr/bin/perl" ) + +#### SSL engine +#ssl.engine = "enable" +#ssl.pemfile = "server.pem" + +#### status module +#status.status-url = "/server-status" +#status.config-url = "/server-config" + +#### auth module +## read authentification.txt for more info +#auth.backend = "plain" +#auth.backend.plain.userfile = "lighttpd.user" +#auth.backend.plain.groupfile = "lighttpd.group" +#auth.require = ( +# "/server-status" => ( +# "method" => "digest", +# "realm" => "download archiv", +# "require" => "group=www|user=jan|host=192.168.2.10" +# ), +# "/server-info" => ( +# "method" => "digest", +# "realm" => "download archiv", +# "require" => "group=www|user=jan|host=192.168.2.10" +# ) +#) + +#### url handling modules (rewrite, redirect, access) +#url.rewrite = ( "^/$" => "/server-status" ) +#url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" ) + +#### both rewrite/redirect support back reference to regex conditional using %n +#$HTTP["host"] =~ "^www\.(.*)" { +# url.redirect = ( "^/(.*)" => "http://%1/$1" ) +#} + +#### expire module +#expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes") + +#### ssi +#ssi.extension = ( ".shtml" ) + +#### setenv +#setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" ) +#setenv.add-response-header = ( "X-Secret-Message" => "42" ) + +#### variable usage: +## variable name without "." is auto prefixed by "var." and becomes "var.bar" +#bar = 1 +#var.mystring = "foo" + +## integer add +#bar += 1 +## string concat, with integer cast as string, result: "www.foo1.com" +#server.name = "www." + mystring + var.bar + ".com" +## array merge +#index-file.names = (foo + ".php") + index-file.names +#index-file.names += (foo + ".php") + +#### include +#include /etc/lighttpd/lighttpd-inc.conf +## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf" +#include "lighttpd-inc.conf" + +#### include_shell +#include_shell "echo var.a=1" +## the above is same as: +#var.a=1 + +#### webdav +#$HTTP["url"] =~ "^/webdav($|/)" { +# webdav.activate = "enable" +# webdav.is-readonly = "enable" +# webdav.sqlite-db-name = "/var/run/lighttpd-webdav-lock.db" +#} diff --git a/net/lighttpd/files/lighttpd.init b/net/lighttpd/files/lighttpd.init new file mode 100644 index 0000000..d73a5da --- /dev/null +++ b/net/lighttpd/files/lighttpd.init @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +SERVICE_USE_PID=1 + +START=50 + +start() { + mkdir -m 0755 -p /var/log/lighttpd + service_start /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf +} + +stop() { + service_stop /usr/sbin/lighttpd +} + diff --git a/net/linuxigd/Makefile b/net/linuxigd/Makefile new file mode 100644 index 0000000..ac667c3 --- /dev/null +++ b/net/linuxigd/Makefile @@ -0,0 +1,69 @@ +# +# Copyright (C) 2006-2012 OpenWrt.org +# Copyright (C) 2006 loswillios +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=linuxigd +PKG_VERSION:=1.0 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/linux-igd +PKG_MD5SUM:=929f5c4878c91d534613b7c7070215d9 + +PKG_BUILD_DEPENDS:=iptables libupnp + +include $(INCLUDE_DIR)/package.mk + +define Package/linuxigd + SECTION:=net + CATEGORY:=Network + TITLE:=UPnP daemon + SUBMENU:=Firewall + DEPENDS:=+libip4tc +libupnp +libpthread @BROKEN + URL:=http://linux-igd.sourceforge.net/ +endef + +define Package/linuxigd/description + It implements the UPnP Internet Gateway Device specification (IGD) + and allows UPnP aware clients, such as MSN Messenger, Azureus or + Miranda to work properly from behind a NAT firewall. + + Please edit /etc/upnpd.conf before using upnpd! +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -DIPTABLES_143 -Wl,-rpath-link=$(STAGING_DIR)/usr/lib" \ + BINDIR="/usr/sbin" \ + MANDIR="/usr/man" \ + HAVE_LIBIPTC=1 \ + LIBIPTC_PREFIX="$(STAGING_DIR)/usr" \ + LIBUPNP_PREFIX="$(STAGING_DIR)/usr" \ + LIBS="-lpthread -lupnp -lixml -lthreadutil -lip4tc -L../lib" \ + all +endef + +define Package/linuxigd/conffiles +/etc/upnpd.conf +endef + +define Package/linuxigd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/upnpd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/linuxigd + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/*.gif $(1)/etc/linuxigd/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/*.xml $(1)/etc/linuxigd/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/upnpd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/upnpd.init $(1)/etc/init.d/upnpd +endef + +$(eval $(call BuildPackage,linuxigd)) diff --git a/net/linuxigd/files/upnpd.conf b/net/linuxigd/files/upnpd.conf new file mode 100644 index 0000000..4d67407 --- /dev/null +++ b/net/linuxigd/files/upnpd.conf @@ -0,0 +1,71 @@ +# +# The full path and name of the iptables executable, +# (enclosed in quotes). +# +iptables_location = "/usr/sbin/iptables" + +# +# Daemon debug level. Messages are logged via syslog to debug. +# 0 - no debug messages +# 1 - log errors +# 2 - log errors and basic info +# 3 - log errors and verbose info +# default = 0 +debug_mode = 2 + +# +# Should the daemon insert rules in the forward chain +# This is necessary if your firewall has a drop or reject +# policy in your forward chain. +# allowed values: yes,no +# default = no +insert_forward_rules = yes + +# +# The name of the chain to put the forward rules in. +# This directive is only activ if "insert_forward_rules = yes" +# above. +# allowed values: a-z, A-Z, _, - +# default = FORWARD +forward_chain_name = forwarding_wan + +# +# The name of the chain to put prerouting rules in. +# allowed values: a-z, A-Z, _, - +# default = PREROUTING +prerouting_chain_name = prerouting_wan + +# +# The internet line upstream bit rate reported from +# the daemon. Value in bits per second +# default = 0 +upstream_bitrate = 512000 + +# +# The internet line downstream bit rate reported from +# the daemon. Value in bits per second +# default = 0 +downstream_bitrate = 512000 + +# +# The default duration of port mappings, used when the client +# doesn't specify a duration. +# Can have the following values: +# 0 - no default duration specified +# seconds | HH:MM - duration from the time of addition +# @seconds | @HH:MM - expire mapping at the specified time of day +# default = 0 +duration = 0 + +# The name of the igd device xml description document +# default = gatedesc.xml +description_document_name = gatedesc.xml + +# The path to the xml documents +# Do not include the trailing "/" +# default = /etc/linuxigd +# WARNING! The make install does put the xml files +# in /etc/linuxigd, if you change this variable +# you have to make sure the xml docs are in the +# right place +xml_document_path = /etc/linuxigd diff --git a/net/linuxigd/files/upnpd.init b/net/linuxigd/files/upnpd.init new file mode 100644 index 0000000..fd627c4 --- /dev/null +++ b/net/linuxigd/files/upnpd.init @@ -0,0 +1,24 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2012 OpenWrt.org +# Copyright (C) 2006 loswillios + +START=65 + +start() { + . /lib/functions/network.sh + + network_get_device wan_if 'wan' || return 1 + network_get_device lan_if 'lan' || return 1 + + route add -net 239.0.0.0 netmask 255.0.0.0 $lan_if + service_start /usr/sbin/upnpd $wan_if $lan_if +} + +stop() { + . /lib/functions/network.sh + + service_stop /usr/sbin/upnpd + + network_get_device lan_if 'lan' && \ + route del -net 239.0.0.0 netmask 255.0.0.0 $lan_if +} diff --git a/net/linuxigd/patches/001-iptables_defs.patch b/net/linuxigd/patches/001-iptables_defs.patch new file mode 100644 index 0000000..0cee3c0 --- /dev/null +++ b/net/linuxigd/patches/001-iptables_defs.patch @@ -0,0 +1,73 @@ +diff -urN linuxigd-1.0/iptc.c linuxigd-1.0.new/iptc.c +--- linuxigd-1.0/iptc.c 2006-09-11 17:55:48.000000000 +0200 ++++ linuxigd-1.0.new/iptc.c 2007-06-02 12:24:34.000000000 +0200 +@@ -22,9 +22,9 @@ + struct ipt_entry_match *get_udp_match(const char *sports, const char *dports, unsigned int *nfcache); + struct ipt_entry_target *get_dnat_target(const char *input, unsigned int *nfcache); + +-static u_int16_t parse_port(const char *port); +-static void parse_ports(const char *portstring, u_int16_t *ports); +-static int service_to_port(const char *name); ++static u_int16_t igd_parse_port(const char *port); ++void parse_ports(const char *portstring, u_int16_t *ports); ++static int igd_service_to_port(const char *name); + + static void parse_range(const char *input, struct ip_nat_range *range); + static struct ipt_natinfo *append_range(struct ipt_natinfo *info, const struct ip_nat_range *range); +@@ -336,13 +336,12 @@ + } + + /* Copied and modified from libipt_tcp.c and libipt_udp.c */ +- + static u_int16_t +-parse_port(const char *port) ++igd_parse_port(const char *port) + { + unsigned int portnum; + +- if ((portnum = service_to_port(port)) != -1) { ++ if ((portnum = igd_service_to_port(port)) != -1) { + return (u_int16_t)portnum; + } + else { +@@ -350,7 +349,7 @@ + } + } + +-static void ++void + parse_ports(const char *portstring, u_int16_t *ports) + { + char *buffer; +@@ -358,19 +357,18 @@ + + buffer = strdup(portstring); + if ((cp = strchr(buffer, ':')) == NULL) +- ports[0] = ports[1] = parse_port(buffer); ++ ports[0] = ports[1] = igd_parse_port(buffer); + else { + *cp = '\0'; + cp++; + +- ports[0] = buffer[0] ? parse_port(buffer) : 0; +- ports[1] = cp[0] ? parse_port(cp) : 0xFFFF; ++ ports[0] = buffer[0] ? igd_parse_port(buffer) : 0; ++ ports[1] = cp[0] ? igd_parse_port(cp) : 0xFFFF; + } + free(buffer); + } +- + static int +-service_to_port(const char *name) ++igd_service_to_port(const char *name) + { + struct servent *service; + +@@ -382,7 +380,6 @@ + + + +- + /* Copied and modified from libipt_DNAT.c */ + + static void diff --git a/net/linuxigd/patches/002-netfilter_nat_headers.patch b/net/linuxigd/patches/002-netfilter_nat_headers.patch new file mode 100644 index 0000000..abbc11e --- /dev/null +++ b/net/linuxigd/patches/002-netfilter_nat_headers.patch @@ -0,0 +1,16 @@ +diff -urN linuxigd-1.0/iptc.c linuxigd-1.0.new/iptc.c +--- linuxigd-1.0/iptc.c 2006-09-11 17:55:48.000000000 +0200 ++++ linuxigd-1.0.new/iptc.c 2007-07-13 14:50:23.000000000 +0200 +@@ -6,7 +6,12 @@ + #include + #include + #include ++#include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) ++#include ++#else + #include ++#endif + #include /* inet_addr */ + #include "globals.h" + #include "util.h" diff --git a/net/linuxigd/patches/003-Makefile-fix.patch b/net/linuxigd/patches/003-Makefile-fix.patch new file mode 100644 index 0000000..25a1c54 --- /dev/null +++ b/net/linuxigd/patches/003-Makefile-fix.patch @@ -0,0 +1,13 @@ +Index: linuxigd-1.0/Makefile +=================================================================== +--- linuxigd-1.0.orig/Makefile 2008-02-27 10:45:26.000000000 +0100 ++++ linuxigd-1.0/Makefile 2008-02-27 10:45:54.000000000 +0100 +@@ -27,7 +27,7 @@ + @echo "make $@ finished on `date`" + + %.o: %.c +- $(CC) $(CFLAGS) $(INCLUDES) -c $< ++ $(CC) $(CFLAGS) $(INCLUDES) -D_GNU_SOURCE -c $< + + clean: + rm -f *.o upnpd diff --git a/net/linuxigd/patches/004-iptables-1.4.3.2-compat.patch b/net/linuxigd/patches/004-iptables-1.4.3.2-compat.patch new file mode 100644 index 0000000..b982761 --- /dev/null +++ b/net/linuxigd/patches/004-iptables-1.4.3.2-compat.patch @@ -0,0 +1,101 @@ +diff -ur linuxigd-1.0.orig/iptc.c linuxigd-1.0/iptc.c +--- linuxigd-1.0.orig/iptc.c 2009-05-05 14:01:59.000000000 +0200 ++++ linuxigd-1.0/iptc.c 2009-05-05 14:05:48.000000000 +0200 +@@ -7,16 +7,24 @@ + #include + #include + #include +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +-#include ++#ifdef IPTABLES_143 ++# include ++# define ip_nat_multi_range nf_nat_multi_range_compat ++# define ip_nat_range nf_nat_range + #else +-#include ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) ++# include ++# else ++# include ++# endif + #endif + #include /* inet_addr */ + #include "globals.h" + #include "util.h" + #include "iptc.h" + ++#define IPTC_HANDLE struct iptc_handle * ++ + struct ipt_natinfo + { + struct ipt_entry_target t; +@@ -49,7 +57,7 @@ + const char *dnat_to, + const int append) + { +- iptc_handle_t handle; ++ IPTC_HANDLE handle; + struct ipt_entry *chain_entry; + struct ipt_entry_match *entry_match = NULL; + struct ipt_entry_target *entry_target = NULL; +@@ -126,15 +134,15 @@ + return; + } + if (append) +- result = iptc_append_entry(labelit, chain_entry, &handle); ++ result = iptc_append_entry(labelit, chain_entry, handle); + else +- result = iptc_insert_entry(labelit, chain_entry, 0, &handle); ++ result = iptc_insert_entry(labelit, chain_entry, 0, handle); + + if (!result) { + trace(1, "libiptc error: Can't add, %s", iptc_strerror(errno)); + return; + } +- result = iptc_commit(&handle); ++ result = iptc_commit(handle); + if (!result) { + trace(1, "libiptc error: Commit error, %s", iptc_strerror(errno)); + return; +@@ -159,7 +167,7 @@ + const char *target, + const char *dnat_to) + { +- iptc_handle_t handle; ++ IPTC_HANDLE handle; + const struct ipt_entry *e; + ipt_chainlabel labelit; + int i, result; +@@ -182,7 +190,7 @@ + } + + /* check through rules to find match */ +- for (e = iptc_first_rule(chain, &handle), i=0; e; e = iptc_next_rule(e, &handle), i++) { ++ for (e = iptc_first_rule(chain, handle), i=0; e; e = iptc_next_rule(e, handle), i++) { + if (s_src != INADDR_NONE && e->ip.src.s_addr != s_src) continue; + if (s_dest != INADDR_NONE && e->ip.dst.s_addr != s_dest) continue; + if (iniface && strcmp(e->ip.iniface, iniface) != 0) continue; +@@ -190,7 +198,7 @@ + if (protocol && strcmp(protocol, "TCP") == 0 && e->ip.proto != IPPROTO_TCP) continue; + if (protocol && strcmp(protocol, "UDP") == 0 && e->ip.proto != IPPROTO_UDP) continue; + if ((srcports || destports) && IPT_MATCH_ITERATE(e, matchcmp, srcports, destports) == 0) continue; +- if (target && strcmp(target, iptc_get_target(e, &handle)) != 0) continue; ++ if (target && strcmp(target, iptc_get_target(e, handle)) != 0) continue; + if (dnat_to && strcmp(target, "DNAT") == 0) { + struct ipt_entry_target *t; + struct ip_nat_multi_range *mr; +@@ -214,12 +222,12 @@ + break; + } + if (!e) return; +- result = iptc_delete_num_entry(chain, i, &handle); ++ result = iptc_delete_num_entry(chain, i, handle); + if (!result) { + trace(1, "libiptc error: Delete error, %s", iptc_strerror(errno)); + return; + } +- result = iptc_commit(&handle); ++ result = iptc_commit(handle); + if (!result) { + trace(1, "libiptc error: Commit error, %s", iptc_strerror(errno)); + return; diff --git a/net/linuxigd/patches/005-includes.patch b/net/linuxigd/patches/005-includes.patch new file mode 100644 index 0000000..586f650 --- /dev/null +++ b/net/linuxigd/patches/005-includes.patch @@ -0,0 +1,30 @@ +--- a/gatedevice.c ++++ b/gatedevice.c +@@ -1,5 +1,6 @@ + #include + #include ++#include + #include + #include + #include +--- a/main.c ++++ b/main.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + #include "globals.h" + #include "config.h" + #include "gatedevice.h" +--- a/pmlist.c ++++ b/pmlist.c +@@ -2,6 +2,8 @@ + #include + #include + #include ++#include ++#include + #include "globals.h" + #include "config.h" + #include "pmlist.h" diff --git a/net/lispmob/Makefile b/net/lispmob/Makefile new file mode 100644 index 0000000..36399ba --- /dev/null +++ b/net/lispmob/Makefile @@ -0,0 +1,128 @@ +# +# Copyright (C) 2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=lispmob +PKG_REV:=50eeffe971a07e06b2f1b73b0b7a6bc4167e0ab5 +PKG_VERSION:=20120417 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=git://github.com/LISPmob/lispmob.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/lisp + SUBMENU:=Network Support + TITLE:=LISP Protocol Support + DEPENDS:=+kmod-lisp-int +kmod-ipv6 + URL:=http://lisp.cisco.com/ + FILES:=$(PKG_BUILD_DIR)/lisp_mod/lisp.ko + AUTOLOAD:=$(call AutoLoad,51,lisp) +endef + +define KernelPackage/lisp/description + Kernel module for Locator/ID Separation Protocol +endef + +define KernelPackage/lisp-int + SUBMENU:=Network Support + TITLE:=Logical Interface for LISP + URL:=http://lisp.cisco.com/ + FILES:=$(PKG_BUILD_DIR)/lisp_int/lisp_int.ko + AUTOLOAD:=$(call AutoLoad,50,lisp_int) +endef + +define KernelPackage/lisp-int/description + Kernel module for LISP logical interface +endef + +define Package/lispd + SECTION:=net + CATEGORY:=Network + TITLE:=Locator/ID separation protocol daemon + URL:=http://lisp.cisco.com/ + DEPENDS:= +librt +libopenssl +confuse +kmod-lisp +endef + +define Package/lispd/description + lispd is the Locator/ID separation protocol daemon +endef + +define Package/lispconf + SECTION:=net + CATEGORY:=Network + TITLE:=Tool to query the LISP kernel module + URL:=http://lisp.cisco.com/ +endef + +define Package/lispconf/description + lispconf can be used to query the kernel module for + information such as map-cache or database contents +endef + +include $(INCLUDE_DIR)/kernel-defaults.mk + +ifdef CONFIG_PACKAGE_kmod-lisp + define Build/Compile/lisp + $(MAKE) $(KERNEL_MAKEOPTS) \ + SUBDIRS="$(PKG_BUILD_DIR)/lisp_mod" \ + modules + endef +endif + +ifdef CONFIG_PACKAGE_kmod-lisp-int + define Build/Compile/lisp-int + $(MAKE) $(KERNEL_MAKEOPTS) \ + SUBDIRS="$(PKG_BUILD_DIR)/lisp_int" \ + modules + endef +endif + +ifdef CONFIG_PACKAGE_lispd + define Build/Compile/lispd + +$(MAKE_VARS) \ + $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/lispd \ + $(MAKE_FLAGS) + endef +endif + +ifdef CONFIG_PACKAGE_lispconf + define Build/Compile/lispconf + +$(MAKE_VARS) \ + $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/lispconf \ + $(MAKE_FLAGS) + endef +endif + +define Build/Compile + $(Build/Compile/lisp) + $(Build/Compile/lisp-int) + $(Build/Compile/lispd) + $(Build/Compile/lispconf) +endef + +define Package/lispconf/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lispconf/lispconf $(1)/usr/sbin/ +endef + +define Package/lispd/install + $(INSTALL_DIR) $(1)/etc $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lispd/lispd $(1)/usr/sbin/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/lispd/lispd.conf.example $(1)/etc/lispd.conf +endef + +$(eval $(call KernelPackage,lisp)) +$(eval $(call KernelPackage,lisp-int)) +$(eval $(call BuildPackage,lispd)) +$(eval $(call BuildPackage,lispconf)) diff --git a/net/lispmob/patches/010-disable-modprobe.patch b/net/lispmob/patches/010-disable-modprobe.patch new file mode 100644 index 0000000..ad475ee --- /dev/null +++ b/net/lispmob/patches/010-disable-modprobe.patch @@ -0,0 +1,29 @@ +--- a/lispd/lispd.c ++++ b/lispd/lispd.c +@@ -160,6 +160,7 @@ int main(int argc, char **argv) + * Unload/load LISP kernel modules + */ + ++/* + system("/sbin/modprobe -r lisp lisp_int"); + + if (system("/sbin/modprobe lisp")) { +@@ -175,6 +176,7 @@ int main(int argc, char **argv) + } + syslog(LOG_DAEMON, "Loaded the 'lisp_int' kernel module"); + sleep(1); ++*/ + + /* + * Setup LISP and routing netlink sockets +--- a/lispd/lispd_iface_mgmt.c ++++ b/lispd/lispd_iface_mgmt.c +@@ -1624,7 +1624,7 @@ void exit_cleanup(void) { + close(netlink_fd); + + /* Remove lisp modules */ +- system("/sbin/modprobe -r lisp lisp_int"); ++// system("/sbin/modprobe -r lisp lisp_int"); + + /* Remove source routing ip rule */ + delete_source_routing(ctrl_iface, &source_rloc, NULL); diff --git a/net/live/Makefile b/net/live/Makefile new file mode 100644 index 0000000..16a2ec8 --- /dev/null +++ b/net/live/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2011 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:=live +PKG_VERSION:=2012.02.04 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.live555.com/liveMedia/public/ +PKG_MD5SUM:=5c9753e027af08c065f156e2a0bec023 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/openrtsp + SECTION:=video + CATEGORY:=Video Streaming + TITLE:=live555 streaming libraries and testProgs + URL:=http://www.live555.com/ + DEPENDS:=+libstdcpp +endef + +define Build/Configure + ( cd $(PKG_BUILD_DIR); \ + $(SED) 's/@CROSS_COMPILE@/$(TARGET_CROSS)/g' \ + -e 's/@CFLAGS@/$(TARGET_CFLAGS)/g' \ + config.OpenWrt; \ + ./genMakefiles OpenWrt; \ + ) +endef + +define Package/openrtsp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/testProgs/openRTSP $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,openrtsp)) diff --git a/net/live/patches/101-openwrt.patch b/net/live/patches/101-openwrt.patch new file mode 100644 index 0000000..dffedbc --- /dev/null +++ b/net/live/patches/101-openwrt.patch @@ -0,0 +1,23 @@ +--- /dev/null ++++ b/config.OpenWrt +@@ -0,0 +1,20 @@ ++CROSS_COMPILE= @CROSS_COMPILE@ ++COMPILE_OPTS = $(INCLUDES) -I. @CFLAGS@ -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLOCALE_NOT_USED ++C = c ++C_COMPILER = $(CROSS_COMPILE)gcc ++CFLAGS += $(COMPILE_OPTS) ++C_FLAGS = $(CFLAGS) ++CPP = cpp ++CPLUSPLUS_COMPILER = $(CROSS_COMPILE)g++ ++CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 ++CPLUSPLUS_FLAGS += $(CPPFLAGS) -fexceptions ++OBJ = o ++LINK = $(CROSS_COMPILE)g++ -o ++LINK_OPTS = -L. $(LDFLAGS) ++CONSOLE_LINK_OPTS = $(LINK_OPTS) ++LIBRARY_LINK = $(CROSS_COMPILE)ar cr ++LIBRARY_LINK_OPTS = ++LIB_SUFFIX = a ++LIBS_FOR_CONSOLE_APPLICATION = $(CXXLIBS) ++LIBS_FOR_GUI_APPLICATION = $(LIBS_FOR_CONSOLE_APPLICATION) ++EXE = diff --git a/net/lldpd/Makefile b/net/lldpd/Makefile new file mode 100644 index 0000000..a39fff0 --- /dev/null +++ b/net/lldpd/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2008-2012 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:=lldpd +PKG_VERSION:=0.6.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://media.luffy.cx/files/lldpd +PKG_MD5SUM:=77279577e3b6d85a33dc0afe7c960b27 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/lldpd + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE:=Link Layer Discovery Protocol daemon + URL:=https://github.com/vincentbernat/lldpd/wiki + DEPENDS:=+libevent2 +endef + +define Package/lldpd/description + LLDP (Link Layer Discovery Protocol) is an industry standard protocol designed + to supplant proprietary Link-Layer protocols such as + Extreme's EDP (Extreme Discovery Protocol) and + CDP (Cisco Discovery Protocol). + The goal of LLDP is to provide an inter-vendor compatible mechanism to deliver + Link-Layer notifications to adjacent network devices. +endef + +define Package/lldpd/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lldp{ctl,d} $(1)/usr/sbin/ + $(INSTALL_BIN) ./files/lldpd.init $(1)/etc/init.d/lldpd + $(INSTALL_DATA) ./files/lldpd.config $(1)/etc/config/lldpd +endef + +define Package/lldpd/conffiles +/etc/config/lldpd +endef + +$(eval $(call BuildPackage,lldpd)) diff --git a/net/lldpd/files/lldpd.config b/net/lldpd/files/lldpd.config new file mode 100644 index 0000000..14ba02f --- /dev/null +++ b/net/lldpd/files/lldpd.config @@ -0,0 +1,8 @@ +config lldpd config + option enable_cdp 1 + option enable_fdp 1 + option enable_sonmp 1 + option enable_edp 1 + + option lldp_class 4 + option lldp_location "2:FR:6:Commercial Rd:3:Roseville:19:4" diff --git a/net/lldpd/files/lldpd.init b/net/lldpd/files/lldpd.init new file mode 100644 index 0000000..5d34283 --- /dev/null +++ b/net/lldpd/files/lldpd.init @@ -0,0 +1,40 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2012 OpenWrt.org + +START=90 + +SERVICE_USE_PID=1 + +start() { + local enable_cdp + local enable_fdp + local enable_sonmp + local enable_edp + local lldp_class + local lldp_location + + config_load 'lldpd' + config_get_bool enable_cdp 'config' 'enable_cdp' 0 + config_get_bool enable_fdp 'config' 'enable_fdp' 0 + config_get_bool enable_sonmp 'config' 'enable_sonmp' 0 + config_get_bool enable_edp 'config' 'enable_edp' 0 + config_get lldp_class 'config' 'lldp_class' + config_get lldp_location 'config' 'lldp_location' + + [ $enable_cdp -gt 0 ] && append args '-c' + [ $enable_fdp -gt 0 ] && append args '-f' + [ $enable_sonmp -gt 0 ] && append args '-s' + [ $enable_edp -gt 0 ] && append args '-e' + + service_start /usr/sbin/lldpd $args \ + ${lldp_class:+ -M $lldp_class} + + [ -n "$lldp_location" ] && { + sleep 1 + /usr/sbin/lldpctl -L "$lldp_location" > /dev/null 2>&1 + } +} + +stop() { + service_stop /usr/sbin/lldpd +} diff --git a/net/lldpd/patches/001-no-multiuser.patch b/net/lldpd/patches/001-no-multiuser.patch new file mode 100644 index 0000000..5f216c4 --- /dev/null +++ b/net/lldpd/patches/001-no-multiuser.patch @@ -0,0 +1,40 @@ +--- a/src/priv.c ++++ b/src/priv.c +@@ -518,12 +518,14 @@ priv_init(char *chrootdir) + fatal("[priv]: unable to create socket pair for privilege separation"); + + /* Get users */ ++ /* + if ((user = getpwnam(PRIVSEP_USER)) == NULL) + fatal("[priv]: no " PRIVSEP_USER " user for privilege separation"); + uid = user->pw_uid; + if ((group = getgrnam(PRIVSEP_GROUP)) == NULL) + fatal("[priv]: no " PRIVSEP_GROUP " group for privilege separation"); + gid = group->gr_gid; ++ */ + + /* Spawn off monitor */ + if ((monitored = fork()) < 0) +@@ -534,17 +536,17 @@ priv_init(char *chrootdir) + if (RUNNING_ON_VALGRIND) + LLOG_WARNX("[priv]: running on valgrind, keep privileges"); + else { +- if (chroot(chrootdir) == -1) +- fatal("[priv]: unable to chroot"); +- if (chdir("/") != 0) ++ /*if (chroot(chrootdir) == -1) ++ fatal("[priv]: unable to chroot");*/ ++ if (chdir("/tmp") != 0) + fatal("[priv]: unable to chdir"); + gidset[0] = gid; +- if (setresgid(gid, gid, gid) == -1) ++ /*if (setresgid(gid, gid, gid) == -1) + fatal("[priv]: setresgid() failed"); + if (setgroups(1, gidset) == -1) + fatal("[priv]: setgroups() failed"); + if (setresuid(uid, uid, uid) == -1) +- fatal("[priv]: setresuid() failed"); ++ fatal("[priv]: setresuid() failed");*/ + } + remote = pair[0]; + close(pair[1]); diff --git a/net/lldpd/patches/002-no-stack-protector.patch b/net/lldpd/patches/002-no-stack-protector.patch new file mode 100644 index 0000000..0a0c6fb --- /dev/null +++ b/net/lldpd/patches/002-no-stack-protector.patch @@ -0,0 +1,10 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -48,7 +48,6 @@ AX_CFLAGS_GCC_OPTION([-Wformat]) + AX_CFLAGS_GCC_OPTION([-Wformat-security]) + AX_CFLAGS_GCC_OPTION([-Wcast-align]) + AX_CFLAGS_GCC_OPTION([-Winline]) +-AX_CFLAGS_GCC_OPTION([-fstack-protector]) + AX_CFLAGS_GCC_OPTION([-D_FORTIFY_SOURCE=2]) + AX_CFLAGS_GCC_OPTION([-Wdeclaration-after-statement]) + AX_CFLAGS_GCC_OPTION([-Wno-unused-parameter]) diff --git a/net/lsm/Makefile b/net/lsm/Makefile new file mode 100644 index 0000000..dbbf389 --- /dev/null +++ b/net/lsm/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2010-2011 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:=lsm +PKG_VERSION:=0.131 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://lsm.foobar.fi/download +PKG_MD5SUM:=c3ff15f5e0d3988a1a45f35392639d40 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/lsm + SECTION:=net + CATEGORY:=Network + DEPENDS:=+ssmtp + TITLE:=A link state monitor + URL:=http://lsm.foobar.fi/ +endef + +define Package/lsm/description + lsm is a link state monitor for carrying out actions when a link + transistions from the up to down state or vice versa. +endef + +define Package/lsm/conffiles +/etc/lsm/lsm.conf +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" +endef + +define Package/lsm/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lsm $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/lsm + $(INSTALL_DIR) $(1)/etc/lsm/script.d + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DATA) ./files/connections.conf $(1)/etc/lsm/connections.conf + $(INSTALL_DATA) ./files/lsm.conf $(1)/etc/lsm/lsm.conf + $(INSTALL_BIN) ./files/lsm_script $(1)/etc/lsm/script + $(INSTALL_BIN) ./files/lsm.init $(1)/etc/init.d/lsm +endef + +define Package/lsm/conffiles +/etc/lsm/connections.conf +/etc/lsm/lsm.conf +endef + +$(eval $(call BuildPackage,lsm)) diff --git a/net/lsm/files/connections.conf b/net/lsm/files/connections.conf new file mode 100644 index 0000000..087a895 --- /dev/null +++ b/net/lsm/files/connections.conf @@ -0,0 +1,13 @@ +connection { + name=Provider1 + checkip=1.1.1.1 + device=pppoe-wan + ttl=2 +} + +connection { + name=Provider2 + checkip=2.2.2.2 + device=eth0.2 + ttl=1 +} diff --git a/net/lsm/files/lsm.conf b/net/lsm/files/lsm.conf new file mode 100644 index 0000000..ca73372 --- /dev/null +++ b/net/lsm/files/lsm.conf @@ -0,0 +1,42 @@ +# +# (C) 2009 Mika Ilmaranta +# +# License: GPLv2 +# + +# +# Debug level: 0 .. 8 are normal, 9 gives lots of stuff and 100 doesn't +# bother to detach +# +#debug=10 +#debug=9 +debug=8 +# reopen_on_enodev=1 + +# +# Defaults for the connection entries +# +defaults { + name=defaults + checkip=127.0.0.1 + eventscript=/etc/lsm/script + max_packet_loss=20 + max_successive_pkts_lost=7 + min_packet_loss=5 + min_successive_pkts_rcvd=10 + interval_ms=2000 + timeout_ms=2000 + warn_email=root + check_arp=0 + sourceip= +# if using ping probes for monitoring only then defaults should +# not define a default device for packets to autodiscover their path +# to destination +# device=eth0 +# use system default ttl + ttl=0 +} + +include /etc/lsm/connections.conf + +#EOF diff --git a/net/lsm/files/lsm.init b/net/lsm/files/lsm.init new file mode 100644 index 0000000..a018fa5 --- /dev/null +++ b/net/lsm/files/lsm.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org + +START=45 + +SERVICE_USE_PID=1 +SERVICE_PID_FILE=/var/run/lsm.pid + +start() { + service_start /usr/sbin/lsm /etc/lsm/lsm.conf $SERVICE_PID_FILE +} + +stop() { + service_stop /usr/sbin/lsm +} + +reload() { + service_reload /usr/sbin/lsm +} diff --git a/net/lsm/files/lsm_script b/net/lsm/files/lsm_script new file mode 100644 index 0000000..a373b31 --- /dev/null +++ b/net/lsm/files/lsm_script @@ -0,0 +1,77 @@ +#!/bin/sh +# +# (C) 2009 Mika Ilmaranta +# (C) 2009 Tom Eastep +# +# License: GPLv2 +# + +DATE=$(/bin/date) + +STATE=${1} +NAME=${2} +CHECKIP=${3} +DEVICE=${4} +WARN_EMAIL=${5} +REPLIED=${6} +WAITING=${7} +TIMEOUT=${8} +REPLY_LATE=${9} +CONS_RCVD=${10} +CONS_WAIT=${11} +CONS_MISS=${12} +AVG_RTT=${13} + +if [ -f /usr/share/shorewall-lite/lib.base ]; then + VARDIR=/etc/shorewall-lite/state + STATEDIR=/etc/shorewall-lite +else + VARDIR=/var/lib/shorewall + STATEDIR=/etc/shorewall +fi + +[ -f ${STATEDIR}/vardir ] && . ${STATEDIR}/vardir + +cat < ${VARDIR}/${DEVICE}.status # Uncomment this line if you are running Shorewall 4.4.x or earlier + ${VARDIR}/firewall enable ${DEVICE} +else + echo 1 > ${VARDIR}/${DEVICE}.status # Uncomment this line if you are running Shorewall 4.4.x or earlier + ${VARDIR}/firewall disable ${DEVICE} +fi + +/sbin/shorewall-lite show routing > /var/log/lsm + +exit 0 + +#EOF diff --git a/net/mac-to-devinfo/Makefile b/net/mac-to-devinfo/Makefile new file mode 100644 index 0000000..0bfdb2f --- /dev/null +++ b/net/mac-to-devinfo/Makefile @@ -0,0 +1,98 @@ +# +# Copyright (C) 2009 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:=mac-to-devinfo +PKG_VERSION:=1.0.0 +PKG_RELEASE:=2 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/mac-to-devinfo + SECTION:=net + CATEGORY:=Network + TITLE:=MAC Address to Device Information + MAINTAINER:=Daniel Dickinson +endef + +define Package/mac-to-devinfo/description + Scripts to take a mac address (or ip if the ip is in the arp cache) + and translate it into device information (mostly OUI owner, from the + IEEE data files, but more information may be available for specific + devices/vendors). +endef + +define Package/smap-to-devinfo + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + DEPENDS:=mac-to-devinfo +smap +httping + TITLE:=SIP Device Information from Scan +endef + +define Package/smap-to-devinfo/description + A script to use smap to discover all SIP devices on the networks + (provided ICMP and SIP are allowed to the network from the host) and + translate (through the ip then mac) into the device information. +endef + +define Package/netdiscover-to-devinfo + SECTION:=net + CATEGORY:=Network + DEPENDS:=mac-to-devinfo +netdiscover + TITLE:=Device Information from Scan for MAC addresses +endef + +define Package/netdiscover-to-devinfo/description + A script to use netdiscover to discover all devices on the specified + arp-able networks and translate into the device information. +endef + +define Build/Prepare +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/mac-to-devinfo/conffiles +/etc/config/mactodevinfo +endef + +define Package/mac-to-devinfo/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/mac-to-devinfo $(1)/usr/bin + $(INSTALL_BIN) ./files/ip-to-devinfo $(1)/usr/bin + $(INSTALL_BIN) ./files/prep-devinfo $(1)/usr/bin + $(INSTALL_BIN) ./files/clean-devinfo $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/lib/mac-to-devinfo + $(INSTALL_BIN) ./files/devinfo-functions.sh $(1)/usr/lib/mac-to-devinfo + $(INSTALL_DIR) $(1)/usr/share/mac-to-devinfo + $(CP) ./files/macdevdb $(1)/usr/share/mac-to-devinfo + $(INSTALL_DIR) $(1)/etc/config + $(CP) ./files/mactodevinfo $(1)/etc/config +endef + +define Package/smap-to-devinfo/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/smap-to-devinfo $(1)/usr/bin + $(INSTALL_BIN) ./files/netsmap-to-devinfo $(1)/usr/bin +endef + +define Package/netdiscover-to-devinfo/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/netdiscover-to-devinfo $(1)/usr/bin +endef + +$(eval $(call BuildPackage,mac-to-devinfo)) +$(eval $(call BuildPackage,smap-to-devinfo)) +$(eval $(call BuildPackage,netdiscover-to-devinfo)) diff --git a/net/mac-to-devinfo/files/clean-devinfo b/net/mac-to-devinfo/files/clean-devinfo new file mode 100644 index 0000000..a34411a --- /dev/null +++ b/net/mac-to-devinfo/files/clean-devinfo @@ -0,0 +1,26 @@ +#!/bin/sh +# clean-devinfo - clean up after MAC IEEE and custom information +# Copyright (C) 2009 Daniel Dickinson + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +OUIDIR=/var/cache/mac-to-devinfo + +rm -rf $OUIDIR +#!/bin/sh + +OUIDIR=/var/cache/mac-to-devinfo + +rm -rf $OUIDIR diff --git a/net/mac-to-devinfo/files/devinfo-functions.sh b/net/mac-to-devinfo/files/devinfo-functions.sh new file mode 100644 index 0000000..fc29334 --- /dev/null +++ b/net/mac-to-devinfo/files/devinfo-functions.sh @@ -0,0 +1,122 @@ +#!/bin/sh +# Shell script compatibility wrappers for /sbin/uci +# +# Copyright (C) 2008 Felix Fietkau +# Copyright (C) 2009 Daniel Dickinson +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# $UCI and $UCISTATE must be set + +CONFIG_APPEND= +_C=0 +LOAD_STATE=1 +LIST_SEP=" " + +config_load() { + local PACKAGE="$1" + local DATA + local RET + + _C=0 + + if [ -z "$CONFIG_APPEND" ]; then + CONFIG_SECTIONS= + CONFIG_NUM_SECTIONS=0 + CONFIG_SECTION= + fi + export NO_EXPORT= + DATA="$($UCI -P $UCISTATE -S -n export "$PACKAGE" 2>/dev/null)" + RET="$?" + [ "$RET" != 0 -o -z "$DATA" ] || eval "$DATA" + unset DATA + + ${CONFIG_SECTION:+config_cb} + return "$RET" +} + +reset_cb() { + config_cb() { return 0; } + option_cb() { return 0; } + list_cb() { return 0; } +} +reset_cb +config () { + local cfgtype="$1" + local name="$2" + + CONFIG_NUM_SECTIONS=$(($CONFIG_NUM_SECTIONS + 1)) + name="${name:-cfg$CONFIG_NUM_SECTIONS}" + append CONFIG_SECTIONS "$name" + [ -n "$NO_CALLBACK" ] || config_cb "$cfgtype" "$name" + CONFIG_SECTION="$name" + eval "CONFIG_${CONFIG_SECTION}_TYPE=\"$cfgtype\"" +} + +option () { + local varname="$1"; shift + local value="$*" + + eval "CONFIG_${CONFIG_SECTION}_${varname}=\"$value\"" + [ -n "$NO_CALLBACK" ] || option_cb "$varname" "$*" +} + +list() { + local varname="$1"; shift + local value="$*" + local len + + config_get len "$CONFIG_SECTION" "${varname}_LENGTH" + len="$((${len:-0} + 1))" + config_set "$CONFIG_SECTION" "${varname}_ITEM$len" "$value" + config_set "$CONFIG_SECTION" "${varname}_LENGTH" "$len" + append "CONFIG_${CONFIG_SECTION}_${varname}" "$value" "$LIST_SEP" + list_cb "$varname" "$*" +} + +config_get() { + case "$3" in + "") eval "echo \"\${CONFIG_${1}_${2}}\"";; + *) eval "$1=\${CONFIG_${2}_${3}}";; + esac +} + +config_foreach() { + local function="$1" + [ "$#" -ge 1 ] && shift + local type="$1" + [ "$#" -ge 1 ] && shift + local section cfgtype + + [ -z "$CONFIG_SECTIONS" ] && return 0 + for section in ${CONFIG_SECTIONS}; do + config_get cfgtype "$section" TYPE + [ -n "$type" -a "x$cfgtype" != "x$type" ] && continue + $function "$section" "$@" + done +} + +package() { + return 0 +} + +append() { + local var="$1" + local value="$2" + local sep="${3:- }" + + eval "$var=\${$var:+\${$var}\${value:+\$sep}}\$value" +} + diff --git a/net/mac-to-devinfo/files/ip-to-devinfo b/net/mac-to-devinfo/files/ip-to-devinfo new file mode 100644 index 0000000..eb4d851 --- /dev/null +++ b/net/mac-to-devinfo/files/ip-to-devinfo @@ -0,0 +1,80 @@ +#!/bin/sh +# ip-to-devinfo - IP (through arping or ping and arp cache) to MAC IEEE and +# custom information +# Copyright (C) 2009 Daniel Dickinson + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +ARP=arp +MACTODEV=mac-to-devinfo + +usage() { + echo "Usage: $0 [-i interface] [-x port] IP-address" +} + +if [ "$1" == "-i" ]; then + INTERFACE="$2" + if [ -z "$INTERFACE" ]; then + echo "-i without interface" + usage + exit 1 + fi + shift + shift +fi + +if [ "$1" == "-x" ]; then + PORT="-x $2" + if [ -z "$PORT" ]; then + echo "-x without the port" + usage + exit 1 + fi + shift + shift +fi + +IP="$1" +shift + +if [ -z "$IP" ]; then + echo "Must specify IP address" + usage + exit 1 +fi + + +if [ ! -x "$(which $ARP)" ]; then + do_arp() { + cat /proc/net/arp + } + ARPMACFIELD=4 +else + do_arp() { + $ARP -n + } + ARPMACFIELD=3 +fi + +if [ -z "$INTERFACE" ]; then + ping -q -c 2 $IP >/dev/null + MAC=$(do_arp|grep "$IP "|tr -s \ | cut -f$ARPMACFIELD -d\ ) +else + MAC=$(arping -f -c 5 -I $INTERFACE $IP | grep 'Unicast reply from' | cut -f2 -d \[ | cut -f1 -d\]) +fi + +$MACTODEV $PORT $MAC + + diff --git a/net/mac-to-devinfo/files/mac-to-devinfo b/net/mac-to-devinfo/files/mac-to-devinfo new file mode 100644 index 0000000..cce253a --- /dev/null +++ b/net/mac-to-devinfo/files/mac-to-devinfo @@ -0,0 +1,197 @@ +#!/bin/sh +# mac-to-devinfo - MAC IEEE and custom information +# Copyright (C) 2009 Daniel Dickinson + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +UCIBIN=uci +UCIFUNC=/usr/lib/mac-to-devinfo/devinfo-functions.sh +OVERRIDETABLE=mactodevinfo +DEVDB=macdevdb +UCICONFIG=/etc/config + +OUIURL=http://standards.ieee.org/regauth/oui/oui.txt +IABURL=http://standards.ieee.org/regauth/oui/iab.txt + +OUIDIR=/var/cache/mac-to-devinfo + +OUIFILE=$OUIDIR/oui.txt +IABFILE=$OUIDIR/iab.txt + +UCIDEVDB=/usr/share/mac-to-devinfo +UCISTATE="$(mktemp -t)" + +. $UCIFUNC + + +if [ "$1" == "-x" ]; then + PORT="$2" + if [ -z "$PORT" ]; then + echo "-x without the port" + echo "Usage: $0 [-x port] MAC-address" + exit 1 + fi + shift + shift +fi + +MAC="$1" + +if [ -z "$MAC" ]; then + echo "Unknown MAC address | Unknown | unknown | unknown | unknown" + exit 1 +fi + +MAC=$(echo $MAC | sed -e 's/^\([0-9]\):/0\1:/g' | sed -e 's/:\([0-9]\)$/:0\1/g' | sed -e 's/:\([0-9]\):/:0\1:/g') + +parse_override() { + local cfg="$1" + config_get name "$cfg" name + config_get maclow "$cfg" maclow + config_get machigh "$cfg" machigh + config_get vendor "$cfg" vendor + config_get devtype "$cfg" devtype + config_get model "$cfg" model + config_get ouiowneroverride "$cfg" ouiowner + LOW=$(echo $maclow | sed -e 's/://g') + HIGH=$(echo $machigh | sed -e 's/://g') + if [ -z "$LOW" ] || [ -z "$HIGH" ] || [ -n "$(echo $LOW | grep -E -v '^[0-9A-Fa-f]{12}$')" ] || [ -n "$(echo $HIGH | grep -E -v '^[0-9A-Fa-f]{12}$')" ]; then + echo "Invalid mac range for $name: $ouiowneroverride $vendor $devtype $model : $LOW-$HIGH" >&2 + return 1 + fi + + LOWMSB=$(expr substr "$LOW" 1 6) + LOWLSB=$(expr substr "$LOW" 7 6) + HIGHMSB=$(expr substr "$HIGH" 1 6) + HIGHLSB=$(expr substr "$HIGH" 7 6) + + if [ -z "$LOWMSB" ] || [ -z "$LOWLSB" ] || [ -z "$HIGHMSB" ] || [ -z "$HIGHLSB" ]; then + echo "Error splitting database address strings" + return 1 + fi + + MACMSB=$(expr substr "$MACNUM" 1 6) + MACLSB=$(expr substr "$MACNUM" 7 6) + + if [ -z "$MACMSB" ] || [ -z "$MACLSB" ]; then + echo "Error spliiting mac address string" + return 1 + fi + + if [ -n "$ouiowneroverride" ]; then + OUIOWNER="$ouiowneroverride" + fi + if [ $((0x$MACMSB)) -ge $((0x$LOWMSB)) ] && [ $((0x$MACMSB)) -le $((0x$HIGHMSB)) ]; then + if [ $((0x$MACLSB)) -ge $((0x$LOWLSB)) ] && [ $((0x$MACLSB)) -le $((0x$HIGHLSB)) ]; then + if [ "$PORT" == "5060" ]; then + if [ "$vendor" == "Vertical Communications" ]; then + devtype="VoIP Phone" + model="IP200x" + fi + fi + if [ "$PORT" == "6060" ]; then + if [ "$vendor" == "Vertical Communications" ]; then + devtype="VoIP PBX" + model="Xcelerator IP" + fi + fi + if [ -n "$OUTSTRING" ]; then + echo "ERROR: We already have found information '$OUTSTRING'" >&2 + echo -n "and now we have: " >&2 + echo "$MAC | $OUIOWNER | $vendor | $devtype | $model" >&2 + return 1 + else + echo "$MAC | $OUIOWNER | $vendor | $devtype | $model" + return 0 + fi + fi + fi + return 0 +} + +if [ ! -r "$OUIFILE" ] || [ ! -r "$IABFILE" ]; then + echo "Missing IEEE Registration Authority Database. Please run prep-devinfo" + exit 1 +fi + +OUI="$(echo $MAC | cut -f1-3 -d: | sed -e 's/:/-/g' | tr abcdef ABCDEF )" + +OUIOWNER="$(cat $OUIFILE | grep $OUI | tr -s '\t' | cut -f2- -d"$(printf '\t')" )" + +if [ -z "$OUIOWNER" ] || [ "$OUIOWNER" = "IEEE REGISTRATION AUTHORITY" ]; then + if [ -n "$(cat $IABFILE | grep $OUI)" ]; then + LOWRANGE="$(echo $MAC | cut -f4-6 -d: | sed -e 's/://g' | tr abcdef ABCDEF )" + for range in $(cat $IABFILE |grep -E '[0-9A-F]{6}\-[0-9A-F]{6}' |cut -f1 -d"$(printf '\t')" ); do + LOW="$(echo $range | cut -f1 -d- )" + HIGH="$(echo $range | cut -f2 -d- )" + if [ -z "$LOW" ] || [ -z "$HIGH" ]; then + echo "Error parsing IAB table" + exit 1 + + fi + LOWMSB=$(expr substr "$LOW" 1 6) + LOWLSB=$(expr substr "$LOW" 7 6) + HIGHMSB=$(expr substr "$HIGH" 1 6) + HIGHLSB=$(expr substr "$HIGH" 7 6) + + if [ -z "$LOWMSB" ] || [ -z "$LOWLSB" ] || [ -z "$HIGHMSB" ] || [ -z "$HIGHLSB" ]; then + echo "Error splitting registration authority IAB address strings" + exit 1 + fi + + MACMSB=$(expr substr "$LOWRANGE" 1 6) + MACLSB=$(expr substr "$LOWRANGE" 7 6) + + if [ -z "$MACMSB" ] || [ -z "$MACLSB" ]; then + echo "Error splitting mac address string" + exit 1 + fi + if [ $((0x$MACMSB)) -ge $((0x$LOWMSB)) ] && [ $((0x$MACMSB)) -le $((0x$HIGHMSB)) ]; then + if [ $((0x$MACLSB)) -ge $((0x$LOWLSB)) ] && [ $((0x$MACLSB)) -le $((0x$HIGHLSB)) ]; then + OUIOWNER="$(cat $IABFILE | grep "$LOW-$HIGH" | tr -s '\t' | cut -f3- -d"$(printf '\t')" )" + break; + fi + fi + done + fi +fi + +if [ -z "$OUIOWNER" ]; then + OUIOWNER="Unknown Organization" +fi + +MACNUM="$(echo $MAC |sed -e 's/://g' | tr ABCDEF abcdef )" + +UCI="$UCIBIN -c $UCIDEVDB" +config_load $DEVDB +DEVSTRING=$(config_foreach parse_override mactodevinfo) + +SAVEDEVSTRING="$DEVSTRING" + +UCI="$UCIBIN -c $UCICONFIG" +config_load $OVERRIDETABLE +DEVSTRING=$(config_foreach parse_override mactodevinfo) + +if [ -z "$DEVSTRING" ]; then + if [ -z "$SAVEDEVSTRING" ]; then + echo "$MAC | $OUIOWNER | unknown | unknown | unknown" + else + echo "$SAVEDEVSTRING" + fi +else + echo "$DEVSTRING" +fi + +rm -f $UCISTATE diff --git a/net/mac-to-devinfo/files/macdevdb b/net/mac-to-devinfo/files/macdevdb new file mode 100644 index 0000000..8bb8873 --- /dev/null +++ b/net/mac-to-devinfo/files/macdevdb @@ -0,0 +1,8 @@ + +config 'mactodevinfo' + option 'maclow' '00:19:15:00:00:00' + option 'machigh' '00:19:15:ff:ff:ff' + option 'vendor' 'Vertical Communications' + option 'devtype' 'SIP devices' + option 'model' 'varies' + diff --git a/net/mac-to-devinfo/files/mactodevinfo b/net/mac-to-devinfo/files/mactodevinfo new file mode 100644 index 0000000..9cd0e5e --- /dev/null +++ b/net/mac-to-devinfo/files/mactodevinfo @@ -0,0 +1,2 @@ +package mactodevinfo + diff --git a/net/mac-to-devinfo/files/netdiscover-to-devinfo b/net/mac-to-devinfo/files/netdiscover-to-devinfo new file mode 100644 index 0000000..c460dc1 --- /dev/null +++ b/net/mac-to-devinfo/files/netdiscover-to-devinfo @@ -0,0 +1,67 @@ +#!/bin/sh +# netdiscover-to-devinfo - netdiscover to MAC IEEE and custom information +# Copyright (C) 2009 Daniel Dickinson + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +MACTODEV=mac-to-devinfo + +if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then + echo "Usage: netdiscover-to-devinfo IP-range Interface Timeout [-r repeats] [-s sleep_between_arp_requests]" + exit 1 +fi + +prep-devinfo +IFS=' +' + +IPRANGE=$1 +IFACE=$2 +TIMEOUT=$3 + +shift 3 + +while getopts "r:s:h" param; do + case "$param" in + h) + usage + exit 1 + ;; + r) + REPEATS=" -c $OPTARG" + ;; + s) + SLEEPREQ="-s $OPTARG" + ;; + ?|*) + usage + exit 1 + break + ;; + + esac +done + + +for line in $(sh -c "netdiscover -t $TIMEOUT-k -m -i $IFACE -r $IPRANGE $REPEATS $SLEEPREQ 2>/dev/null" | grep -E '[0-9]([0-9]?[0-9])?.[0-9]([0-9]?[0-9])?.[0-9]([0-9]?[0-9])?.[0-9]([0-9]?[0-9])?.[0-9]([0-9]?[0-9])?'); do + unset IFS + IP=$(echo $line | tr -s \ | cut -f1 -d\ ) + MAC=$(echo $line | tr -s \ | cut -f2 -d\ ) + echo "$IP"" | ""$($MACTODEV $MAC)" + IFS=' +' +done + +unset IFS diff --git a/net/mac-to-devinfo/files/netsmap-to-devinfo b/net/mac-to-devinfo/files/netsmap-to-devinfo new file mode 100644 index 0000000..11a7e41 --- /dev/null +++ b/net/mac-to-devinfo/files/netsmap-to-devinfo @@ -0,0 +1,156 @@ +#!/bin/sh +# netsmap-to-devinfo - netdisovered then smap'ed IP addresses to MAC IEEE +# and custom information +# Copyright (C) 2009 Daniel Dickinson + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +MACTODEV=mac-to-devinfo +IPTODEV=ip-to-devinfo + +usage() { + echo "$0: -i interferace -r ip-range [options]" + echo "" + echo "-r ip-range range to probe (CIDR, e.g. 192.168.2.0/24)" + echo "-i interface interface to use in scan" + echo "-t timeout time to rate for arp responses for device detection" + echo "-p port[,port...] command-separated lists of ports to scan for SIP responses" + echo "-c repeat_count Number of times to send each request (default 1)" + echo "-s sleepreq ms to wait between sending arp requests" + echo "-x Assume we're running on an Xcelerator IP" + echo "-h help" +} + + +while getopts "r:i:t:p:c:s:xh" param; do + case "$param" in + h) + usage + exit 1 + ;; + r) + IPRANGE=$OPTARG + ;; + i) + INTERFACE=$OPTARG + ;; + t) + TIMEOUT=$OPTARG + ;; + p) + PORTARG=$OPTARG + ;; + c) + REPEATCOUNT=$OPTARG + ;; + s) + SLEEPREQ="-s $OPTARG" + ;; + x) + XIP=TRUE + ;; + ?|*) + usage + exit 1 + break + ;; + + esac +done + +if [ "$IPRANGE" = "" ]; then + echo "Must specify an ip range" + usage + exit 1 +fi + +if [ "$INTERFACE" = "" ]; then + echo "Must speciy the interface" + usage + exit 1 +fi + +if [ "$TIMEOUT" = "" ]; then + TIMEOUT=20 + usage +fi + +unset PORTS + +if [ -n "$PORTARG" ]; then + PORTLIST="$PORTARG" + + if [ -z "$(echo $PORTLIST | grep ',')" ]; then + PORTS="$PORTLIST" + else + FIELD=1 + oldcurport="" + curport="$(echo $PORTLIST | cut -f$FIELD -d, )" + while [ "$curport" != "$oldcurport" ]; do + PORTS="$curport $PORTS" + FIELD=$(($FIELD + 1)) + oldcurport="$(echo $PORTLIST | cut -f$FIELD -d, )" + curport="$(echo $PORTLIST | cut -f$FIELD -d, )" + done + fi +fi + + +prep-devinfo + +IFS=' +' + +if [ -n "$REPEATCOUNT" ]; then + REPEAT="-c $REPEATCOUNT" +fi + +for line in $(sh -c "netdiscover -t $TIMEOUT -k -m -i $INTERFACE -r $IPRANGE $REPEAT $SLEEPREQ 2>/dev/null" | grep -E '[0-9]([0-9]?[0-9])?.[0-9]([0-9]?[0-9])?.[0-9]([0-9]?[0-9])?.[0-9]([0-9]?[0-9])?.[0-9]([0-9]?[0-9])?'); do + unset IFS + IP=$(echo $line | tr -s \ | cut -f1 -d\ ) + MAC=$(echo $line | tr -s \ | cut -f2 -d\ ) + + if [ -n "$PORTS" ]; then + for port in $PORTS; do + + if [ "$XIP" = "TRUE" ]; then + XIP_PORT="-x $port" + fi + for sip_device in $(smap -p $port $IP rng-32bit-tables.h diff --git a/net/matrixtunnel/Makefile b/net/matrixtunnel/Makefile new file mode 100644 index 0000000..819f1aa --- /dev/null +++ b/net/matrixtunnel/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=matrixtunnel +PKG_VERSION:=0.2 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://znerol.ch/files +PKG_MD5SUM:=af169751efc7d87d500716a48d74ddc5 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +MAKE_PATH:=src + +define Package/matrixtunnel + SECTION:=net + CATEGORY:=Network + SUBMENU:=VPN + DEPENDS:=+libmatrixssl + TITLE:=SSL tunnel based on matrixssl + URL:=http://znerol.ch/svn/matrixtunnel/trunk/ +endef + +define Package/matrixtunnel/description + matrixtunnel is a stripped down version of stunnel + based on matrixssl library. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + --with-matrixssl-src="$(BUILD_DIR)/matrixssl" \ + ) +endef + +define Package/matrixtunnel/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/matrixtunnel $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,matrixtunnel)) diff --git a/net/mdk3/Makefile b/net/mdk3/Makefile new file mode 100644 index 0000000..735523e --- /dev/null +++ b/net/mdk3/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mdk3 +PKG_VERSION:=v6 +PKG_RELEASE:=1 +PKG_MD5SUM:=67705a814ded2a2e6f70522ca0dc6da9 + +PKG_BUILD_DIR:=$(BUILD_DIR)/mdk3-$(PKG_VERSION) +PKG_SOURCE_URL:=http://homepages.tu-darmstadt.de/~p_larbig/wlan/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/mdk3 + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpthread + TITLE:= MDK3 + URL:=http://homepages.tu-darmstadt.de/~p_larbig/wlan/ + SUBMENU:=wireless +endef + +define Package/mdk3/description + Tool to exploit wireless vulnerabilities +endef + +define Package/mdk3/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/mdk3 $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,mdk3)) diff --git a/net/mdk3/patches/001-radiotap_needs_types_h.patch b/net/mdk3/patches/001-radiotap_needs_types_h.patch new file mode 100644 index 0000000..77a155a --- /dev/null +++ b/net/mdk3/patches/001-radiotap_needs_types_h.patch @@ -0,0 +1,11 @@ +diff -urN mdk3-v6/osdep/radiotap/radiotap-parser.c mdk3-v6.new/osdep/radiotap/radiotap-parser.c +--- mdk3-v6/osdep/radiotap/radiotap-parser.c 2009-08-16 18:16:14.000000000 +0200 ++++ mdk3-v6.new/osdep/radiotap/radiotap-parser.c 2009-11-01 10:30:08.000000000 +0100 +@@ -18,6 +18,7 @@ + + #include + #include ++#include + + #include "radiotap-parser.h" + diff --git a/net/mdk3/patches/010-fix-dependencies.patch b/net/mdk3/patches/010-fix-dependencies.patch new file mode 100644 index 0000000..fe8d7aa --- /dev/null +++ b/net/mdk3/patches/010-fix-dependencies.patch @@ -0,0 +1,17 @@ +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- mdk3-v6.orig/Makefile ++++ mdk3-v6/Makefile +@@ -18,8 +18,8 @@ osd: + $(LIBOSD): + $(MAKE) -C $(OSD) + +-mdk3: mdk3.c $(OSD)/libosdep.a +- $(CC) $(CFLAGS) $(LINKFLAGS) $^ -o $@ $(LIBS) ++mdk3: $(LIBOSD) mdk3.c ++ $(CC) $(CFLAGS) $(LINKFLAGS) mdk3.c $(OSD)/lib$(OSD).a -o $@ $(LIBS) + + install: mdk3 + $(MAKE) -C $(OSD) install diff --git a/net/mdnsresponder/Makefile b/net/mdnsresponder/Makefile new file mode 100644 index 0000000..462c6bb --- /dev/null +++ b/net/mdnsresponder/Makefile @@ -0,0 +1,162 @@ +# +# Copyright (C) 2009-2011 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:=mDNSResponder +PKG_VERSION:=214.3.2 +PKG_RELEASE:=4 + +PKG_SOURCE:=mDNSResponder-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://opensource.apple.com/tarballs/mDNSResponder/ +PKG_MD5SUM:=05d39f40767ccece4b740c5afad14a23 + +PKG_BUILD_DIR:=$(BUILD_DIR)/mDNSResponder-$(PKG_VERSION) + +PKG_BUILD_PARALLEL:=0 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/mDNSResponder/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=mDNS + URL:=http://developer.apple.com/networking/bonjour/ +endef + +define Package/mDNSResponder/Default/description + Bonjour, also known as zero-configuration networking, enables + automatic discovery of computers, devices, and services on + IP networks. +endef + +define Package/mdns-utils +$(call Package/mDNSResponder/Default) + TITLE+= client utilities +endef + +define Package/mdns-utils/description +$(call Package/mDNSResponder/Default/description) + . + This package contains mDNS client utilities: + - dns-sd + - mDNSClient + - mDNSIdentify + - mDNSNetMonitor + - mDNSProxyResponder + - mDNSResponder +endef + +define Package/mdnsd +$(call Package/mDNSResponder/Default) + TITLE+= server daemon +endef + +define Package/mdnsd/description +$(call Package/mDNSResponder/Default/description) + . + This package contains the mDNS server daemon. +endef + +define Package/mdnsresponder +$(call Package/mDNSResponder/Default) + TITLE+= suite (meta) + DEPENDS+= +mdns-utils +mdnsd +endef + +define Package/mdnsresponder/description +$(call Package/mDNSResponder/Default/description) + . + This meta package contains only dependencies on other packages. +endef + +# I have no idea why -lc is required, but without it, C library symbols are +# not found: +MAKE_FLAGS += \ + CFLAGS_DEBUG="$(TARGET_CFLAGS)" \ + LINKOPTS=-lc \ + LDCONFIG= \ + ETCBASE="$(PKG_INSTALL_DIR)/etc" \ + INSTBASE="$(PKG_INSTALL_DIR)/usr" \ + NSSINSTPATH="$(PKG_INSTALL_DIR)/lib" \ + MANPATH="$(PKG_INSTALL_DIR)/usr/man" \ + STARTUPSCRIPTDIR="$(PKG_INSTALL_DIR)/etc/init.d" \ + RUNLEVELSCRIPTSDIR="$(PKG_INSTALL_DIR)/etc/rc.d" \ + os=linux-uclibc +MAKE_PATH = mDNSPosix + +define Build/Compile + $(call Build/Compile/Default) + # XXX: mDNSResponder's "make install" does not seem to create: + mkdir -p $(PKG_INSTALL_DIR)/lib/ + mkdir -p $(PKG_INSTALL_DIR)/usr/bin/ + mkdir -p $(PKG_INSTALL_DIR)/usr/sbin/ + mkdir -p $(PKG_INSTALL_DIR)/usr/lib/ + mkdir -p $(PKG_INSTALL_DIR)/usr/man/man5/ + mkdir -p $(PKG_INSTALL_DIR)/usr/man/man8/ + mkdir -p $(PKG_INSTALL_DIR)/usr/include/ + mkdir -p $(PKG_INSTALL_DIR)/etc/ + mkdir -p $(PKG_INSTALL_DIR)/etc/init.d/ + mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/ + mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc2.d/ + mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc3.d/ + mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc4.d/ + mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc5.d/ + mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc0.d/ + mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc6.d/ + # XXX: mDNSResponder's makefile creates absolute link + rm -f $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so + ln -fs libdns_sd.so.1 $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/mDNSShared/dns_sd.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/*.so* $(1)/usr/lib/ +endef + +define Package/mdns-utils/conffile + /etc/init.d/mDNSResponder +endef + +define Package/mdns-utils/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/dns-sd $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSClientPosix $(1)/usr/bin/mDNSClient + $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSIdentify $(1)/usr/bin/mDNSIdentify + $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSNetMonitor $(1)/usr/bin/mDNSNetMonitor + $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSProxyResponderPosix $(1)/usr/bin/mDNSProxyResponder + $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSResponderPosix $(1)/usr/bin/mDNSResponder + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/mDNSResponder.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mDNSResponder.init $(1)/etc/init.d/mDNSResponder +endef + +define Package/mdns-utils/conffiles +/etc/mDNSResponder.conf +endef + +define Package/mdnsd/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/mdnsd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mdnsd.init $(1)/etc/init.d/mdnsd +endef + +define Package/mdnsresponder/install + : +endef + +$(eval $(call BuildPackage,mdns-utils)) +$(eval $(call BuildPackage,mdnsd)) +$(eval $(call BuildPackage,mdnsresponder)) diff --git a/net/mdnsresponder/files/mDNSResponder.conf b/net/mdnsresponder/files/mDNSResponder.conf new file mode 100644 index 0000000..23aab16 --- /dev/null +++ b/net/mdnsresponder/files/mDNSResponder.conf @@ -0,0 +1,4 @@ +"OpenWrt SSH" +_ssh._tcp. local +22 +OpenWrt SSH server diff --git a/net/mdnsresponder/files/mDNSResponder.init b/net/mdnsresponder/files/mDNSResponder.init new file mode 100644 index 0000000..87f9e90 --- /dev/null +++ b/net/mdnsresponder/files/mDNSResponder.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2011 OpenWrt.org + +START=61 + +SERVICE_USE_PID=1 + +start() { + service_start /usr/bin/mDNSResponder -b -f /etc/mDNSResponder.conf +} + +stop() { + service_stop /usr/bin/mDNSResponder +} diff --git a/net/mdnsresponder/files/mdnsd.init b/net/mdnsresponder/files/mdnsd.init new file mode 100755 index 0000000..6d77f0a --- /dev/null +++ b/net/mdnsresponder/files/mdnsd.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2011 OpenWrt.org + +START=60 + +SERVICE_USE_PID=1 + +start() { + service_start /usr/sbin/mdnsd +} + +stop() { + service_stop /usr/sbin/mdnsd +} diff --git a/net/mdnsresponder/patches/001-cross_compile.patch b/net/mdnsresponder/patches/001-cross_compile.patch new file mode 100644 index 0000000..3903fee --- /dev/null +++ b/net/mdnsresponder/patches/001-cross_compile.patch @@ -0,0 +1,125 @@ +diff -u --recursive mDNSResponder-214.3.2-vanilla/Clients/Makefile mDNSResponder-214.3.2/Clients/Makefile +--- mDNSResponder-214.3.2-vanilla/Clients/Makefile 2010-10-15 08:38:44.817282399 -0500 ++++ mDNSResponder-214.3.2/Clients/Makefile 2010-10-15 08:40:09.696672081 -0500 +@@ -62,6 +62,8 @@ + + ############################################################################# + ++CC = @cc ++ + # On OS X the dns_sd library functions are included in libSystem, which is implicitly linked with every executable + # If /usr/lib/libSystem.dylib exists, then we're on OS X, so we don't need also to link the "dns_sd" shared library + ifneq "$(wildcard /usr/lib/libSystem.dylib)" "" +@@ -81,10 +83,10 @@ + mkdir build + + build/dns-sd: build dns-sd.c ClientCommon.c +- cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ ++ $(CC) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ + + build/dns-sd64: build dns-sd.c ClientCommon.c +- cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64 ++ $(CC) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64 + + # Note, we can make a 'fat' version of dns-sd using 'lipo', as shown below, but we + # don't, because we don't want or need a 'fat' version of dns-sd, because it will +diff -u --recursive mDNSResponder-214.3.2-vanilla/mDNSPosix/Makefile mDNSResponder-214.3.2/mDNSPosix/Makefile +--- mDNSResponder-214.3.2-vanilla/mDNSPosix/Makefile 2010-10-15 08:38:44.798283212 -0500 ++++ mDNSResponder-214.3.2/mDNSPosix/Makefile 2010-10-15 08:46:28.739548087 -0500 +@@ -316,10 +316,11 @@ + SHAREDDIR ?= ../mDNSShared + JDK = /usr/jdk + +-CC = @cc ++CC = @gcc + BISON = @bison + FLEX = @flex +-LD = ld -shared ++LD = @ld ++SOOPTS = -shared + CP = cp + RM = rm + LN = ln -s -f +@@ -344,7 +345,7 @@ + CFLAGS_DEBUG = -Os -DMDNS_DEBUGMSGS=0 + OBJDIR ?= objects/prod + BUILDDIR ?= build/prod +-STRIP = strip -S ++STRIP = @strip -S + endif + + # Configure per-OS peculiarities +@@ -353,7 +354,7 @@ + CFLAGS_OS = -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN -DNOT_HAVE_SOCKLEN_T -DNOT_HAVE_IF_NAMETOINDEX \ + -DLOG_PERROR=0 -D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME -DTARGET_OS_SOLARIS + CC = gcc +-LD = gcc -shared ++LD = gcc + LINKOPTS = -lsocket -lnsl -lresolv + JAVACFLAGS_OS += -I$(JDK)/include/solaris + ifneq ($(DEBUG),1) +@@ -404,7 +405,8 @@ + CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp -Werror -Wdeclaration-after-statement \ + -D__MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_10_4 #-Wunreachable-code + CC = @gcc-4.0 +-LD = $(CC) -dynamiclib ++LD = $(CC) ++SOOPTS = -dynamiclib + LINKOPTS = -lSystem + LDSUFFIX = dylib + JDK = /System/Library/Frameworks/JavaVM.framework/Home +@@ -426,8 +428,9 @@ + NSSLINKNAME := $(NSSLIBNAME).so.2 + NSSINSTPATH := /lib + +-# If not otherwise defined, we install into /usr/lib and /usr/include ++# If not otherwise defined, we install into /usr/lib, /usr/include and /etc + # and our startup script is called mdns (e.g. /etc/init.d/mdns) ++ETCBASE?=/etc + INSTBASE?=/usr + STARTUPSCRIPTNAME?=mdns + +@@ -511,7 +514,7 @@ + CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o + + $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS) +- @$(LD) $(LINKOPTS) -o $@ $+ ++ @$(LD) $(SOOPTS) $(LINKOPTS) -o $@ $+ + @$(STRIP) $@ + + Clients: setup libdns_sd ../Clients/build/dns-sd +@@ -546,7 +549,7 @@ + InstalledClients: $(INSTBASE)/bin/dns-sd + @echo $+ " installed" + +-InstalledNSS: $(NSSINSTPATH)/$(NSSLINKNAME) /etc/nss_mdns.conf $(MANPATH)/man5/nss_mdns.conf.5 $(MANPATH)/man8/libnss_mdns.8 ++InstalledNSS: $(NSSINSTPATH)/$(NSSLINKNAME) $(ETCBASE)/nss_mdns.conf $(MANPATH)/man5/nss_mdns.conf.5 $(MANPATH)/man8/libnss_mdns.8 + @echo $+ " installed" + + # Note: If daemon already installed, we make sure it's stopped before overwriting it +@@ -601,19 +604,21 @@ + + $(NSSINSTPATH)/$(NSSLINKNAME): $(NSSINSTPATH)/$(NSSLIBFILE) + $(LN) $< $@ +- ldconfig ++ifdef LDCONFIG ++ $(LDCONFIG) ++endif + + $(NSSINSTPATH)/$(NSSLIBFILE): $(BUILDDIR)/$(NSSLIBFILE) + $(CP) $< $@ + chmod 444 $@ + +-/etc/nss_mdns.conf: nss_mdns.conf ++$(ETCBASE)/nss_mdns.conf: nss_mdns.conf + $(CP) $< $@ + chmod 444 $@ + # Check the nsswitch.conf file. + # If 'mdns' does not already appear on the "hosts:" line, then add it right before 'dns' +- cp -f /etc/nsswitch.conf /etc/nsswitch.conf.pre-mdns +- sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' /etc/nsswitch.conf.pre-mdns > /etc/nsswitch.conf ++ -[ -f $(ETCBASE)/nsswitch.conf ] && cp -f $(ETCBASE)/nsswitch.conf $(ETCBASE)/nsswitch.conf.pre-mdns ++ -[ -f $(ETCBASE)/nsswitch.conf ] && sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' $(ETCBASE)/nsswitch.conf.pre-mdns > $(ETCBASE)/nsswitch.conf + + ############################################################################# + diff --git a/net/mdnsresponder/patches/002-uclibc.patch b/net/mdnsresponder/patches/002-uclibc.patch new file mode 100644 index 0000000..bfb0289 --- /dev/null +++ b/net/mdnsresponder/patches/002-uclibc.patch @@ -0,0 +1,21 @@ +diff -u --recursive mDNSResponder-214.3.2-vanilla/mDNSPosix/Makefile mDNSResponder-214.3.2/mDNSPosix/Makefile +--- mDNSResponder-214.3.2-vanilla/mDNSPosix/Makefile 2010-10-15 08:38:44.798283212 -0500 ++++ mDNSResponder-214.3.2/mDNSPosix/Makefile 2010-10-15 08:48:27.334503432 -0500 +@@ -361,12 +361,16 @@ + endif + else + +-ifeq ($(os),linux) ++# Any variant containing linux: ++ifeq ($(findstring linux,$(os)),linux) + CFLAGS_OS = -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX + FLEXFLAGS_OS = -l + JAVACFLAGS_OS += -I$(JDK)/include/linux ++# uClibc does not provide NSS, do not compile nss_mdns: ++ifneq ($(os),linux-uclibc) + OPTIONALTARG = nss_mdns + OPTINSTALL = InstalledNSS ++endif + else + + ifeq ($(os),netbsd) diff --git a/net/memcached/Makefile b/net/memcached/Makefile new file mode 100644 index 0000000..8d7cff9 --- /dev/null +++ b/net/memcached/Makefile @@ -0,0 +1,68 @@ +# +# Copyright (C) 2009-2012 OpenWrt.org +# Copyright (C) 2009-2012 Thomas Heil +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=memcached +PKG_VERSION:=1.4.12 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://memcached.googlecode.com/files +PKG_MD5SUM:=4194de21b58a92de684ce69b8e501c44 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/memcached + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libevent +libpthread + TITLE:=The high-performance, distributed memory object caching system + MAINTAINER:=Thomas Heil + URL:=http://memcached.org/ +endef + +define Package/memcached/description + Free and open source, high-performance, distributed memory object caching system +endef + +define Package/memcached/conffiles +/etc/config/memcached +endef + +ifeq ($(CONFIG_BIG_ENDIAN),y) +CONFIGURE_VARS += ac_cv_c_endian=big +else +CONFIGURE_VARS += ac_cv_c_endian=little +endif + +CONFIGURE_ARGS += \ + --with-libevent=$(STAGING_DIR)/usr/include/libevent \ + --disable-docs \ + --disable-dtrace \ + --disable-coverage \ + --disable-sasl + +TARGET_CFLAGS += \ + -std=gnu99 + +TARGET_LDFLAGS = \ + -L$(STAGING_DIR)/usr/lib/libevent -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib + +define Package/memcached/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/memcached $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/memcached.config $(1)/etc/config/memcached + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/memcached.init $(1)/etc/init.d/memcached +endef + +$(eval $(call BuildPackage,memcached)) diff --git a/net/memcached/files/memcached.config b/net/memcached/files/memcached.config new file mode 100644 index 0000000..4071116 --- /dev/null +++ b/net/memcached/files/memcached.config @@ -0,0 +1,6 @@ +config memcached + option user 'nobody' + option maxconn '1024' + option listen '0.0.0.0' + option port '11211' + option memory '64' diff --git a/net/memcached/files/memcached.init b/net/memcached/files/memcached.init new file mode 100644 index 0000000..063bf64 --- /dev/null +++ b/net/memcached/files/memcached.init @@ -0,0 +1,27 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org + +START=80 + +start_instance () { + local section="$1" + + config_get user "$section" user + config_get maxconn "$section" maxconn + config_get listen "$section" listen + config_get port "$section" port + config_get memory "$section" memory + + service_start /usr/bin/memcached -d -u ${user:-nobody} \ + -c ${maxconn:-1024} -l ${listen:-0.0.0.0} \ + -p ${port:-11211} -U ${port:-11211} -m ${memory:-64} +} + +start() { + config_load 'memcached' + config_foreach start_instance 'memcached' +} + +stop() { + service_stop /usr/bin/memcached +} diff --git a/net/memcached/patches/100-fix_iov_max.patch b/net/memcached/patches/100-fix_iov_max.patch new file mode 100644 index 0000000..1a5da94 --- /dev/null +++ b/net/memcached/patches/100-fix_iov_max.patch @@ -0,0 +1,23 @@ +--- a/memcached.c ++++ b/memcached.c +@@ -13,6 +13,10 @@ + * Anatoly Vorobey + * Brad Fitzpatrick + */ ++#ifndef __need_IOV_MAX ++#define __need_IOV_MAX ++#endif ++ + #include "memcached.h" + #include + #include +@@ -29,9 +33,6 @@ + #define _P1003_1B_VISIBLE + #endif + /* need this to get IOV_MAX on some platforms. */ +-#ifndef __need_IOV_MAX +-#define __need_IOV_MAX +-#endif + #include + #include + #include diff --git a/net/mercurial/Makefile b/net/mercurial/Makefile new file mode 100644 index 0000000..a94b758 --- /dev/null +++ b/net/mercurial/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2006-2011 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:=mercurial +PKG_VERSION:=1.8.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://mercurial.selenic.com/release +PKG_MD5SUM:=b3dcc3de473e003dd1cc0500dcd9de47 + +PKG_BUILD_DEPENDS:=python-mini + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/mercurial + SECTION:=net + CATEGORY:=Network + DEPENDS:=+python + TITLE:=Mercurial Source Control Management (SCM) system + URL:=http://mercurial.selenic.com/ + SUBMENU:=Version Control Systems +endef + +define Package/mercurial/description + A fast, lightweight Source Control Management system designed for efficient + handling of very large distributed projects. +endef + +define Build/Compile + $(call Build/Compile/PyMod,, \ + install --prefix="$(PKG_INSTALL_DIR)", \ + ) +endef + +define Package/mercurial/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/bin $(1)/usr/ + $(CP) $(PKG_INSTALL_DIR)/lib $(1)/usr/ +endef + +$(eval $(call BuildPackage,mercurial)) diff --git a/net/mercurial/patches/001-no_bzip2.patch b/net/mercurial/patches/001-no_bzip2.patch new file mode 100644 index 0000000..d43acca --- /dev/null +++ b/net/mercurial/patches/001-no_bzip2.patch @@ -0,0 +1,183 @@ +--- a/mercurial/archival.py ++++ b/mercurial/archival.py +@@ -37,7 +37,6 @@ def tidyprefix(dest, kind, prefix): + + exts = { + 'tar': ['.tar'], +- 'tbz2': ['.tbz2', '.tar.bz2'], + 'tgz': ['.tgz', '.tar.gz'], + 'zip': ['.zip'], + } +@@ -51,7 +50,7 @@ def guesskind(dest): + + class tarit(object): + '''write archive to tar file or stream. can write uncompressed, +- or compress with gzip or bzip2.''' ++ or compress with gzip.''' + + class GzipFileWithTime(gzip.GzipFile): + +@@ -205,7 +204,6 @@ class fileit(object): + archivers = { + 'files': fileit, + 'tar': tarit, +- 'tbz2': lambda name, mtime: tarit(name, mtime, 'bz2'), + 'tgz': lambda name, mtime: tarit(name, mtime, 'gz'), + 'uzip': lambda name, mtime: zipit(name, mtime, False), + 'zip': zipit, +--- a/mercurial/bundlerepo.py ++++ b/mercurial/bundlerepo.py +@@ -307,7 +307,7 @@ def getremotechanges(ui, repo, other, re + cg = other.changegroup(incoming, "incoming") + else: + cg = other.changegroupsubset(incoming, revs, 'incoming') +- bundletype = other.local() and "HG10BZ" or "HG10UN" ++ bundletype = other.local() and "HG10GZ" or "HG10UN" + fname = bundle = changegroup.writebundle(cg, bundlename, bundletype) + # keep written bundle? + if bundlename: +--- a/mercurial/changegroup.py ++++ b/mercurial/changegroup.py +@@ -7,7 +7,7 @@ + + from i18n import _ + import util +-import struct, os, bz2, zlib, tempfile ++import struct, os, zlib, tempfile + + def readexactly(stream, n): + '''read n bytes from stream.read and abort if less was available''' +@@ -45,7 +45,6 @@ class nocompress(object): + bundletypes = { + "": ("", nocompress), + "HG10UN": ("HG10UN", nocompress), +- "HG10BZ": ("HG10", lambda: bz2.BZ2Compressor()), + "HG10GZ": ("HG10GZ", lambda: zlib.compressobj()), + } + +@@ -59,14 +58,13 @@ def collector(cl, mmfs, files): + return collect + + # hgweb uses this list to communicate its preferred type +-bundlepriority = ['HG10GZ', 'HG10BZ', 'HG10UN'] ++bundlepriority = ['HG10GZ', 'HG10UN'] + + def writebundle(cg, filename, bundletype): + """Write a bundle file and return its filename. + + Existing files will not be overwritten. + If no filename is specified, a temporary file is created. +- bz2 compression can be turned off. + The bundle file will be deleted in case of errors. + """ + +@@ -124,12 +122,6 @@ def decompressor(fh, alg): + zd = zlib.decompressobj() + for chunk in f: + yield zd.decompress(chunk) +- elif alg == 'BZ': +- def generator(f): +- zd = bz2.BZ2Decompressor() +- zd.decompress("BZ") +- for chunk in util.filechunkiter(f, 4096): +- yield zd.decompress(chunk) + else: + raise util.Abort("unknown bundle compression '%s'" % alg) + return util.chunkbuffer(generator(fh)) +--- a/mercurial/hgweb/hgwebdir_mod.py ++++ b/mercurial/hgweb/hgwebdir_mod.py +@@ -204,7 +204,7 @@ class hgwebdir(object): + def archivelist(ui, nodeid, url): + allowed = ui.configlist("web", "allow_archive", untrusted=True) + archives = [] +- for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]: ++ for i in [('zip', '.zip'), ('gz', '.tar.gz')]: + if i[0] in allowed or ui.configbool("web", "allow" + i[0], + untrusted=True): + archives.append({"type" : i[0], "extension": i[1], +--- a/mercurial/hgweb/hgweb_mod.py ++++ b/mercurial/hgweb/hgweb_mod.py +@@ -40,7 +40,7 @@ class hgweb(object): + self.mtime = -1 + self.size = -1 + self.reponame = name +- self.archives = 'zip', 'gz', 'bz2' ++ self.archives = 'zip', 'gz' + self.stripecount = 1 + # a repo owner may set web.templates in .hg/hgrc to get any file + # readable by the user running the CGI script +@@ -284,7 +284,6 @@ class hgweb(object): + yield {"type" : i, "extension" : spec[2], "node" : nodeid} + + archive_specs = { +- 'bz2': ('application/x-bzip2', 'tbz2', '.tar.bz2', None), + 'gz': ('application/x-gzip', 'tgz', '.tar.gz', None), + 'zip': ('application/zip', 'zip', '.zip', None), + } +--- a/mercurial/repair.py ++++ b/mercurial/repair.py +@@ -19,7 +19,7 @@ def _bundle(repo, bases, heads, node, su + os.mkdir(backupdir) + name = os.path.join(backupdir, "%s-%s.hg" % (short(node), suffix)) + if compress: +- bundletype = "HG10BZ" ++ bundletype = "HG10GZ" + else: + bundletype = "HG10UN" + return changegroup.writebundle(cg, name, bundletype) +--- a/mercurial/commands.py ++++ b/mercurial/commands.py +@@ -162,7 +162,6 @@ def archive(ui, repo, dest, **opts): + + :``files``: a directory full of files (default) + :``tar``: tar archive, uncompressed +- :``tbz2``: tar archive, compressed using bzip2 + :``tgz``: tar archive, compressed using gzip + :``uzip``: zip archive, uncompressed + :``zip``: zip archive, compressed using deflate +@@ -644,8 +643,8 @@ def bundle(ui, repo, fname, dest=None, * + -a/--all (or --base null). + + You can change compression method with the -t/--type option. +- The available compression methods are: none, bzip2, and +- gzip (by default, bundles are compressed using bzip2). ++ The available compression methods are: none, and ++ gzip (by default, bundles are compressed using gzip). + + The bundle file can then be transferred using conventional means + and applied to another repository with the unbundle or pull +@@ -712,8 +711,8 @@ def bundle(ui, repo, fname, dest=None, * + else: + cg = repo.changegroup(o, 'bundle') + +- bundletype = opts.get('type', 'bzip2').lower() +- btypes = {'none': 'HG10UN', 'bzip2': 'HG10BZ', 'gzip': 'HG10GZ'} ++ bundletype = opts.get('type', 'gzip').lower() ++ btypes = {'none': 'HG10UN', 'gzip': 'HG10GZ'} + bundletype = btypes.get(bundletype) + if bundletype not in changegroup.bundletypes: + raise util.Abort(_('unknown bundle type specified with --type')) +@@ -4316,7 +4315,7 @@ table = { + _('a base changeset assumed to be available at the destination'), + _('REV')), + ('a', 'all', None, _('bundle all changesets in the repository')), +- ('t', 'type', 'bzip2', ++ ('t', 'type', 'gzip', + _('bundle compression type to use'), _('TYPE')), + ] + remoteopts, + _('[-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]')), +--- a/setup.py ++++ b/setup.py +@@ -36,12 +36,6 @@ except: + raise SystemExit( + "Couldn't import standard zlib (incomplete Python install).") + +-try: +- import bz2 +-except: +- raise SystemExit( +- "Couldn't import standard bz2 (incomplete Python install).") +- + import os, subprocess, time + import shutil + import tempfile diff --git a/net/mgen/Makefile b/net/mgen/Makefile new file mode 100644 index 0000000..3ad35ae --- /dev/null +++ b/net/mgen/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mgen +PKG_VERSION:=5.01b +PKG_RELEASE:=2 + +PKG_SOURCE:=src-$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://downloads.pf.itd.nrl.navy.mil/mgen/ +PKG_MD5SUM:=1e467131446d649c8a0aebdcd8e5f2a9 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/mgen + TITLE:=Multi-Generator + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpthread $(CXX_DEPENDS) + URL:=http://cs.itd.nrl.navy.mil/work/mgen/ +endef + +define Package/mgen/Description + The Multi-Generator (MGEN) is open source software developed by + the Naval Research Laboratory (NRL) PROTocol Engineering Advanced + Networking (PROTEAN) Research Group. MGEN provides the ability to + perform IP network performance tests and measurements using UDP/IP + traffic (TCP is currently being developed). +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/unix \ + CC="$(TARGET_CXX)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + SYSTEM_LIBS="-ldl -lpthread" \ + -f Makefile.linux mgen +endef + +define Package/mgen/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/unix/mgen $(1)/usr/bin/mgen +endef + +$(eval $(call BuildPackage,mgen)) diff --git a/net/mgen/patches/100-ipv6.patch b/net/mgen/patches/100-ipv6.patch new file mode 100644 index 0000000..4878a96 --- /dev/null +++ b/net/mgen/patches/100-ipv6.patch @@ -0,0 +1,24 @@ +diff -urN mgen.old/protolib/unix/Makefile.linux mgen/protolib/unix/Makefile.linux +--- mgen.old/protolib/unix/Makefile.linux 2008-03-07 22:23:06.000000000 +0100 ++++ mgen/protolib/unix/Makefile.linux 2009-06-06 20:40:29.000000000 +0200 +@@ -39,7 +39,7 @@ + # (We export these for other Makefiles as needed) + # + +-SYSTEM_HAVES = -DLINUX -DHAVE_IPV6 -DHAVE_GETLOGIN -D_FILE_OFFSET_BITS=64 -DHAVE_LOCKF \ ++SYSTEM_HAVES = -DLINUX -DHAVE_GETLOGIN -D_FILE_OFFSET_BITS=64 -DHAVE_LOCKF \ + -DHAVE_OLD_SIGNALHANDLER -DHAVE_DIRFD -DHAVE_ASSERT -DNO_SCM_RIGHTS -DHAVE_SCHED + + # (TBD) Move ProtoRouteMgr to ProtokitEx ?? +diff -urN mgen.old/unix/Makefile.linux mgen/unix/Makefile.linux +--- mgen.old/unix/Makefile.linux 2007-06-22 21:16:20.000000000 +0200 ++++ mgen/unix/Makefile.linux 2009-06-06 20:40:10.000000000 +0200 +@@ -35,7 +35,7 @@ + # (We export these for other Makefiles as needed) + # + +-SYSTEM_HAVES = -DLINUX -DHAVE_PSELECT -DHAVE_SCHED -DHAVE_IPV6 -DHAVE_GETLOGIN -DHAVE_LOCKF -DHAVE_DIRFD \ ++SYSTEM_HAVES = -DLINUX -DHAVE_PSELECT -DHAVE_SCHED -DHAVE_GETLOGIN -DHAVE_LOCKF -DHAVE_DIRFD \ + -DHAVE_ASSERT $(NETSEC) + + SYSTEM = linux diff --git a/net/miau/Makefile b/net/miau/Makefile new file mode 100644 index 0000000..0ed0756 --- /dev/null +++ b/net/miau/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2006-2011 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:=miau +PKG_VERSION:=0.6.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/miau +PKG_MD5SUM:=8778b8564c679cf5487b1972ca0b35e4 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/miau + SUBMENU:=Instant Messaging + SECTION:=net + CATEGORY:=Network + TITLE:=Another IRC-bouncer/proxy + URL:=http://miau.sourceforge.net/ +endef + +define Package/miau/description + In short, miau is an IRC-bouncer/proxy. + Being more verbose, miau is small but quite featured + IRC-bouncer - a service bit like HTTP-proxy, but + for IRC-networks. +endef + +define Package/miau/conffiles +/etc/miau/miaurc +endef + +CONFIGURE_ARGS += \ + --enable-automode \ + --enable-releasenick \ + --enable-uptime \ + --enable-privlog \ + --enable-onconnect + +define Package/miau/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/miau + $(INSTALL_BIN) ./files/miau.init $(1)/etc/init.d/miau + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/doc/miau/examples/miaurc $(1)/etc/miau/ +endef + +$(eval $(call BuildPackage,miau)) diff --git a/net/miau/files/miau.init b/net/miau/files/miau.init new file mode 100644 index 0000000..4a71877 --- /dev/null +++ b/net/miau/files/miau.init @@ -0,0 +1,28 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org +START=50 + +OPTIONS="-d /etc/miau/" +LOG_DIR="/var/log/miau" +ERR_LOG="$LOG_DIR/error.log" +OUT_LOG="$LOG_DIR/miau.log" + +start() { + [ -f /var/run/miau.pid ] && { + echo "[ERROR] miau is running" + exit 0 + } + [ -d $LOG_DIR ] || mkdir -p $LOG_DIR + /usr/bin/miau -f $OPTIONS > $OUT_LOG 2> $ERR_LOG & + PID=$! + sleep 1 + if [ -d /proc/$PID ]; then + echo $PID > /var/run/miau.pid + else + echo "[ERROR] Unable to run miau as a daemon" + fi +} + +stop() { + [ -f /var/run/miau.pid ] && kill $(cat /var/run/miau.pid) >/dev/null 2>&1 && rm /var/run/miau.pid +} diff --git a/net/miax/Makefile b/net/miax/Makefile new file mode 100644 index 0000000..85194f4 --- /dev/null +++ b/net/miax/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2006-2009 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:=miax +PKG_VERSION:=1.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/miax +PKG_MD5SUM:=44f0d2ef46ee2697d890b7b96846adc7 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/miax + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + DEPENDS:=+libpthread +bluez-libs + TITLE:=A console iax (asterisk) client + URL:=http://www.eja.it/?l=en&n=miax +endef + +define Package/miax/description + miax is a console iax (asterisk) client, it can work with + a soundcard as a normal voip phone, taking input/output from + keyboard, analog/gsm/isdn modem or bluetooth phones. +endef + +define Build/Compile + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + CC="$(TARGET_CC)" \ + OFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + all +endef + +define Package/miax/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/miax $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,miax)) diff --git a/net/miax/patches/001-cross.patch b/net/miax/patches/001-cross.patch new file mode 100644 index 0000000..f47c110 --- /dev/null +++ b/net/miax/patches/001-cross.patch @@ -0,0 +1,24 @@ +diff -ruN miax-1.4-old/Makefile miax-1.4-new/Makefile +--- miax-1.4-old/Makefile 2005-04-27 18:56:13.000000000 +0200 ++++ miax-1.4-new/Makefile 2005-11-30 01:07:21.000000000 +0100 +@@ -1,4 +1,5 @@ +-CFLAGS= -Iiax/ -Igsm/inc -DIAXC_IAX2 -DLIBIAX -g -DPOSIXSLEEP -DLINUX -O2 ++OFLAGS= -02 -g ++CFLAGS= -Iiax/ -Igsm/inc $(CPPFLAGS) -DIAXC_IAX2 -DLIBIAX -DPOSIXSLEEP -DLINUX $(OFLAGS) + SYSLIBS=-lpthread -lm -lbluetooth + + +@@ -32,11 +33,10 @@ + miax.o + + all: $(OBJS) +- gcc $(OBJS) $(CFLAGS) $(SYSLIBS) -o miax +- cp miax /bin/miax ++ $(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) $(SYSLIBS) -o miax + + static: $(OBJS) bluetooth.o +- gcc $(OBJS) $(CFLAGS) $(SYSLIBS) -static -o miax ++ $(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) $(SYSLIBS) -static -o miax + + clean: + rm -f $(OBJS) miax diff --git a/net/mii-tool/Makefile b/net/mii-tool/Makefile new file mode 100644 index 0000000..ca63fb3 --- /dev/null +++ b/net/mii-tool/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mii-tool +PKG_VERSION:=1.9.1.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://downloads.openwrt.org/sources +PKG_MD5SUM:=f65dbeb1c2392acffd4c94138b1f2e52 + +include $(INCLUDE_DIR)/package.mk + +define Package/mii-tool + SECTION:=net + CATEGORY:=Network + TITLE:=configure media type using MII commands + URL:=http://freshmeat.net/projects/mii-tool/ +endef + +define Package/mii-tool/description + The mii-tool command allows you to set or autodetect the media type + or mii chipset-based ethernet devices. It traditionally had been + distributed in the net-tools package. This is a single distribution + optimized for embedded systems and fully automated cross/-sysroot-builds +endef + +MAKE_FLAGS += CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE -I. -idirafter ./include/" + +define Package/mii-tool/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/mii-tool $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,mii-tool)) diff --git a/net/mii-tool/patches/001-include_linux_sockios.patch b/net/mii-tool/patches/001-include_linux_sockios.patch new file mode 100644 index 0000000..3f11bf8 --- /dev/null +++ b/net/mii-tool/patches/001-include_linux_sockios.patch @@ -0,0 +1,12 @@ +Index: mii-tool-1.9.1.1/mii-tool.c +=================================================================== +--- mii-tool-1.9.1.1.orig/mii-tool.c ++++ mii-tool-1.9.1.1/mii-tool.c +@@ -50,6 +50,7 @@ static char version[] = + #include + #include + #endif ++#include + #include "mii.h" + + #define MAX_ETH 8 /* Maximum # of interfaces */ diff --git a/net/mini_httpd/Makefile b/net/mini_httpd/Makefile new file mode 100644 index 0000000..669d9b7 --- /dev/null +++ b/net/mini_httpd/Makefile @@ -0,0 +1,189 @@ +# +# 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:=mini-httpd +PKG_VERSION:=1.19 +PKG_RELEASE:=1 + +PKG_SOURCE:=mini_httpd-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.acme.com/software/mini_httpd/ +PKG_MD5SUM:=792a529dfe974355aad8ba6c80e54e7a + +PKG_BUILD_DIR:=$(BUILD_DIR)/mini_httpd-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/mini-httpd/Default + SUBMENU:=Web Servers/Proxies + SECTION:=net + CATEGORY:=Network + TITLE:=A small web server + URL:=http://www.acme.com/software/mini_httpd/ +endef + +define Package/mini-httpd/Default/conffiles +/etc/mini_httpd.conf +/etc/default/mini_httpd +endef + +define Package/mini-httpd/Default/description + mini_httpd is a small HTTP server. Its performance is not great, but for + low or medium traffic sites it's quite adequate. It implements all the + basic features of an HTTP server, including: + - GET, HEAD, and POST methods + - CGI + - Basic authentication + - Security against ".." filename snooping + - The common MIME types + - Trailing-slash redirection + - index.html, index.htm, index.cgi + - Directory listings + - Multihoming / virtual hosting + - Standard logging + - Custom error pages + It can also be configured to do IPv6. +endef + +define Package/mini-httpd +$(call Package/mini-httpd/Default) +endef + +define Package/mini-httpd/conffiles +$(call Package/mini-httpd/Default/conffiles) +endef + +define Package/mini-httpd/description +$(call Package/mini-httpd/Default/description) +endef + +define Package/mini-httpd-matrixssl +$(call Package/mini-httpd/Default) + DEPENDS:= +libmatrixssl + TITLE+= (built with MatrixSSL) +endef + +define Package/mini-httpd-matrixssl/conffiles +$(call Package/mini-httpd/Default/conffiles) +/etc/mini_httpd.pem +endef + +define Package/mini-httpd-matrixssl/description +$(call Package/mini-httpd/Default/description) + This package is built with SSL/HTTPS using MatrixSSL. +endef + +define Package/mini-httpd-openssl +$(call Package/mini-httpd/Default) + DEPENDS:= +libopenssl + TITLE+= (built with OpenSSL) +endef + +define Package/mini-httpd-openssl/conffiles +$(call Package/mini-httpd/Default/conffiles) +/etc/mini_httpd.pem +endef + +define Package/mini-httpd-openssl/description +$(call Package/mini-httpd/Default/description) + This package is built with SSL/HTTPS using OpenSSL. +endef + +define Package/mini-httpd-htpasswd + $(call Package/mini-httpd/Default) + TITLE:=Utility to generate HTTP access files +endef + +define Package/mini-httpd-htpasswd/description +$(call Package/mini-httpd/Default/description) + This package generates .htaccess/.htpasswd files to use HTTP access authentication. +endef + + +define Build/Template + +$(STAMP_BUILT)-$(2): $(STAMP_PREPARED) + -$(MAKE) -C $(PKG_BUILD_DIR) clean + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + OFLAGS="$(TARGET_CFLAGS)" \ + $(3) \ + all + ( cd $(PKG_BUILD_DIR); mv -f mini_httpd mini_httpd-$(2) ) + touch $$@ + +$(STAMP_BUILT): $(STAMP_BUILT)-$(2) + +define Package/$(1)/install + $(INSTALL_DIR) $$(1)/etc +ifeq ($(2),without-ssl) + $(INSTALL_DATA) ./files/mini_httpd.conf $$(1)/etc/mini_httpd.conf +else + $(INSTALL_DATA) ./files/mini_httpd-ssl.conf $$(1)/etc/mini_httpd.conf + $(INSTALL_CONF) ./files/mini_httpd.pem $$(1)/etc/mini_httpd.pem +endif + $(INSTALL_DIR) $$(1)/etc/default + $(INSTALL_DATA) ./files/mini_httpd.default $$(1)/etc/default/mini_httpd + $(INSTALL_DIR) $$(1)/etc/init.d + $(INSTALL_BIN) ./files/mini_httpd.init $$(1)/etc/init.d/mini_httpd + $(INSTALL_DIR) $$(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mini_httpd-$(2) $$(1)/usr/sbin/mini_httpd +endef + +endef + + +define Build/Prepare +$(call Build/Prepare/Default) + $(CP) ./files/matrixssl_helper.{c,h} $(PKG_BUILD_DIR)/ +endef + +define Build/Configure +endef + +define Build/Compile +endef + +# always build without SSL because we might need htpassd +define Build/without-ssl + $(call Build/Template,mini-httpd,without-ssl,) +endef +$(eval $(Build/without-ssl)) + +ifneq ($(SDK)$(CONFIG_PACKAGE_mini-httpd-matrixssl),) + define Build/with-matrixssl + $(call Build/Template,mini-httpd-matrixssl,with-matrixssl, \ + SSL_DEFS="-DUSE_SSL -DHAVE_MATRIXSSL" \ + SSL_INC="$(TARGET_CPPFLAGS)" \ + SSL_LIBS="$(TARGET_LDFLAGS) -lmatrixssl" \ + SSL_OBJS="matrixssl_helper.o" \ + ) + endef +endif +$(eval $(Build/with-matrixssl)) + +ifneq ($(SDK)$(CONFIG_PACKAGE_mini-httpd-openssl),) + define Build/with-openssl + $(call Build/Template,mini-httpd-openssl,with-openssl, \ + SSL_DEFS="-DUSE_SSL -DHAVE_OPENSSL" \ + SSL_INC="$(TARGET_CPPFLAGS)" \ + SSL_LIBS="$(TARGET_LDFLAGS) -lcrypto -lssl" \ + ) + endef +endif +$(eval $(Build/with-openssl)) + +define Package/mini-httpd-htpasswd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/htpasswd $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,mini-httpd)) +$(eval $(call BuildPackage,mini-httpd-matrixssl)) +$(eval $(call BuildPackage,mini-httpd-openssl)) +$(eval $(call BuildPackage,mini-httpd-htpasswd)) diff --git a/net/mini_httpd/files/matrixssl_helper.c b/net/mini_httpd/files/matrixssl_helper.c new file mode 100644 index 0000000..e3fe334 --- /dev/null +++ b/net/mini_httpd/files/matrixssl_helper.c @@ -0,0 +1,455 @@ +/* + * MatrixSSL helper functions + * + * Copyright (C) 2005 Nicolas Thill + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Portions borrowed from MatrixSSL example code + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "matrixssl_helper.h" + +#define SSL_SOCKET_EOF 0x0001 +#define SSL_SOCKET_CLOSE_NOTIFY 0x0002 + +#define min(a, b) ( (a) < (b) ) ? (a) : (b) + +static int _ssl_read(SSL *ssl, char *buf, int len); +static int _ssl_write(SSL *ssl, char *buf, int len); +static void _ssl_setSocketBlock(int fd); +static void _ssl_setSocketNonblock(int fd); +static void _ssl_closeSocket(int fd); + + +SSL * SSL_new(sslKeys_t *keys) +{ + SSL * ssl; + ssl = (SSL *)malloc(sizeof(SSL)); + + if (!ssl) return 0; + + ssl->keys = keys; + if ( matrixSslNewSession(&(ssl->ssl), ssl->keys, NULL, SSL_FLAGS_SERVER) < 0 ) { + } + + ssl->insock.size = 1024; + ssl->insock.buf = ssl->insock.start = ssl->insock.end = + (unsigned char *)malloc(ssl->insock.size); + + ssl->outsock.size = 1024; + ssl->outsock.buf = ssl->outsock.start = ssl->outsock.end = + (unsigned char *)malloc(ssl->outsock.size); + + ssl->inbuf.size = 0; + ssl->inbuf.buf = ssl->inbuf.start = ssl->inbuf.end = NULL; + + return ssl; +} + + +int SSL_accept(SSL *ssl) { + + unsigned char buf[1024]; + int status, rc; + +readMore: + rc = _ssl_read(ssl, buf, sizeof(buf)); + if (rc == 0) { + if (ssl->status == SSL_SOCKET_EOF || ssl->status == SSL_SOCKET_CLOSE_NOTIFY) { + SSL_free(ssl); + return -1; + } + if (matrixSslHandshakeIsComplete(ssl->ssl) == 0) { + goto readMore; + } + } else if (rc > 0) { + return 0; + } else { + SSL_free(ssl); + return -1; + } + + return 1; +} + + +void SSL_set_fd(SSL *ssl, int fd) { + ssl->fd = fd; +} + + +int SSL_read(SSL *ssl, char *buf, int len) { + int rc; +readMore: + rc = _ssl_read(ssl, buf, len); + if (rc <= 0) { + if (rc < 0 || ssl->status == SSL_SOCKET_EOF || ssl->status == SSL_SOCKET_CLOSE_NOTIFY) { + _ssl_closeSocket(ssl->fd); + return rc; + } + goto readMore; + } + return rc; +} + + +int SSL_write(SSL *ssl, char *buf, int len) { + int rc; +writeMore: + rc = _ssl_write(ssl, buf, len); + if (rc <= 0) { + if (rc < 0) { + return rc; + } + goto writeMore; + } + return rc; +} + + +void SSL_free(SSL * ssl) +{ + matrixSslDeleteSession(ssl->ssl); + if (ssl->insock.buf) { + free(ssl->insock.buf); + } + if (ssl->outsock.buf) { + free(ssl->outsock.buf); + } + if (ssl->inbuf.buf) { + free(ssl->inbuf.buf); + } + free(ssl); +} + + + +static void _ssl_setSocketBlock(int fd) +{ + fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_NONBLOCK); + fcntl(fd, F_SETFD, FD_CLOEXEC); +} + + +static void _ssl_setSocketNonblock(int fd) +{ + fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK); +} + + +static void _ssl_closeSocket(int fd) +{ + char buf[32]; + + if (fd != -1) { + _ssl_setSocketNonblock(fd); + if (shutdown(fd, 1) >= 0) { + while (recv(fd, buf, sizeof(buf), 0) > 0); + } + close(fd); + } +} + + +static int _ssl_read(SSL *ssl, char *buf, int len) +{ + int bytes, rc, remaining; + unsigned char error, alertLevel, alertDescription, performRead; + + ssl->status = 0; + + if (ssl->ssl == NULL || len <= 0) { + return -1; + } +/* + If inbuf is valid, then we have previously decoded data that must be + returned, return as much as possible. Once all buffered data is + returned, free the inbuf. +*/ + if (ssl->inbuf.buf) { + if (ssl->inbuf.start < ssl->inbuf.end) { + remaining = (int)(ssl->inbuf.end - ssl->inbuf.start); + bytes = (int)min(len, remaining); + memcpy(buf, ssl->inbuf.start, bytes); + ssl->inbuf.start += bytes; + return bytes; + } + free(ssl->inbuf.buf); + ssl->inbuf.buf = NULL; + } +/* + Pack the buffered socket data (if any) so that start is at zero. +*/ + if (ssl->insock.buf < ssl->insock.start) { + if (ssl->insock.start == ssl->insock.end) { + ssl->insock.start = ssl->insock.end = ssl->insock.buf; + } else { + memmove(ssl->insock.buf, ssl->insock.start, ssl->insock.end - ssl->insock.start); + ssl->insock.end -= (ssl->insock.start - ssl->insock.buf); + ssl->insock.start = ssl->insock.buf; + } + } +/* + Read up to as many bytes as there are remaining in the buffer. We could + Have encrypted data already cached in conn->insock, but might as well read more + if we can. +*/ + performRead = 0; +readMore: + if (ssl->insock.end == ssl->insock.start || performRead) { + performRead = 1; + bytes = recv(ssl->fd, (char *)ssl->insock.end, + (int)((ssl->insock.buf + ssl->insock.size) - ssl->insock.end), MSG_NOSIGNAL); + if (bytes == -1) { + ssl->status = errno; + return -1; + } + if (bytes == 0) { + ssl->status = SSL_SOCKET_EOF; + return 0; + } + ssl->insock.end += bytes; + } +/* + Define a temporary sslBuf +*/ + ssl->inbuf.start = ssl->inbuf.end = ssl->inbuf.buf = (unsigned char *)malloc(len); + ssl->inbuf.size = len; +/* + Decode the data we just read from the socket +*/ +decodeMore: + error = 0; + alertLevel = 0; + alertDescription = 0; + + rc = matrixSslDecode(ssl->ssl, &ssl->insock, &ssl->inbuf, &error, &alertLevel, + &alertDescription); + switch (rc) { +/* + Successfully decoded a record that did not return data or require a response. +*/ + case SSL_SUCCESS: + return 0; +/* + Successfully decoded an application data record, and placed in tmp buf +*/ + case SSL_PROCESS_DATA: +/* + Copy as much as we can from the temp buffer into the caller's buffer + and leave the remainder in conn->inbuf until the next call to read + It is possible that len > data in buffer if the encoded record + was longer than len, but the decoded record isn't! +*/ + rc = (int)(ssl->inbuf.end - ssl->inbuf.start); + rc = min(rc, len); + memcpy(buf, ssl->inbuf.start, rc); + ssl->inbuf.start += rc; + return rc; +/* + We've decoded a record that requires a response into tmp + If there is no data to be flushed in the out buffer, we can write out + the contents of the tmp buffer. Otherwise, we need to append the data + to the outgoing data buffer and flush it out. +*/ + case SSL_SEND_RESPONSE: + bytes = send(ssl->fd, (char *)ssl->inbuf.start, + (int)(ssl->inbuf.end - ssl->inbuf.start), MSG_NOSIGNAL); + if (bytes == -1) { + ssl->status = errno; + if (ssl->status != EAGAIN) { + goto readError; + } + ssl->status = 0; + } + ssl->inbuf.start += bytes; + if (ssl->inbuf.start < ssl->inbuf.end) { +/* + This must be a non-blocking socket since it didn't all get sent + out and there was no error. We want to finish the send here + simply because we are likely in the SSL handshake. +*/ + _ssl_setSocketBlock(ssl->fd); + bytes = send(ssl->fd, (char *)ssl->inbuf.start, + (int)(ssl->inbuf.end - ssl->inbuf.start), MSG_NOSIGNAL); + if (bytes == -1) { + ssl->status = errno; + goto readError; + } + ssl->inbuf.start += bytes; +/* + Can safely set back to non-blocking because we wouldn't + have got here if this socket wasn't non-blocking to begin with. +*/ + _ssl_setSocketNonblock(ssl->fd); + } + ssl->inbuf.start = ssl->inbuf.end = ssl->inbuf.buf; + return 0; +/* + There was an error decoding the data, or encoding the out buffer. + There may be a response data in the out buffer, so try to send. + We try a single hail-mary send of the data, and then close the socket. + Since we're closing on error, we don't worry too much about a clean flush. +*/ + case SSL_ERROR: + if (ssl->inbuf.start < ssl->inbuf.end) { + _ssl_setSocketNonblock(ssl->fd); + bytes = send(ssl->fd, (char *)ssl->inbuf.start, + (int)(ssl->inbuf.end - ssl->inbuf.start), MSG_NOSIGNAL); + } + goto readError; +/* + We've decoded an alert. The level and description passed into + matrixSslDecode are filled in with the specifics. +*/ + case SSL_ALERT: + if (alertDescription == SSL_ALERT_CLOSE_NOTIFY) { + ssl->status = SSL_SOCKET_CLOSE_NOTIFY; + goto readZero; + } + goto readError; +/* + We have a partial record, we need to read more data off the socket. + If we have a completely full conn->insock buffer, we'll need to grow it + here so that we CAN read more data when called the next time. +*/ + case SSL_PARTIAL: + if (ssl->insock.start == ssl->insock.buf && ssl->insock.end == + (ssl->insock.buf + ssl->insock.size)) { + if (ssl->insock.size > SSL_MAX_BUF_SIZE) { + goto readError; + } + ssl->insock.size *= 2; + ssl->insock.start = ssl->insock.buf = + (unsigned char *)realloc(ssl->insock.buf, ssl->insock.size); + ssl->insock.end = ssl->insock.buf + (ssl->insock.size / 2); + } + if (!performRead) { + performRead = 1; + free(ssl->inbuf.buf); + ssl->inbuf.buf = NULL; + goto readMore; + } else { + goto readZero; + } +/* + The out buffer is too small to fit the decoded or response + data. Increase the size of the buffer and call decode again +*/ + case SSL_FULL: + ssl->inbuf.size *= 2; + if (ssl->inbuf.buf != (unsigned char*)buf) { + free(ssl->inbuf.buf); + ssl->inbuf.buf = NULL; + } + ssl->inbuf.start = ssl->inbuf.end = ssl->inbuf.buf = + (unsigned char *)malloc(ssl->inbuf.size); + goto decodeMore; + } +/* + We consolidated some of the returns here because we must ensure + that conn->inbuf is cleared if pointing at caller's buffer, otherwise + it will be freed later on. +*/ +readZero: + if (ssl->inbuf.buf == (unsigned char*)buf) { + ssl->inbuf.buf = NULL; + } + return 0; +readError: + if (ssl->inbuf.buf == (unsigned char*)buf) { + ssl->inbuf.buf = NULL; + } + return -1; +} + + +int _ssl_write(SSL *ssl, char *buf, int len) +{ + int rc; + + ssl->status = 0; +/* + Pack the buffered socket data (if any) so that start is at zero. +*/ + if (ssl->outsock.buf < ssl->outsock.start) { + if (ssl->outsock.start == ssl->outsock.end) { + ssl->outsock.start = ssl->outsock.end = ssl->outsock.buf; + } else { + memmove(ssl->outsock.buf, ssl->outsock.start, ssl->outsock.end - ssl->outsock.start); + ssl->outsock.end -= (ssl->outsock.start - ssl->outsock.buf); + ssl->outsock.start = ssl->outsock.buf; + } + } +/* + If there is buffered output data, the caller must be trying to + send the same amount of data as last time. We don't support + sending additional data until the original buffered request has + been completely sent. +*/ + if (ssl->outBufferCount > 0 && len != ssl->outBufferCount) { + return -1; + } +/* + If we don't have buffered data, encode the caller's data +*/ + if (ssl->outBufferCount == 0) { +retryEncode: + rc = matrixSslEncode(ssl->ssl, (unsigned char *)buf, len, &ssl->outsock); + switch (rc) { + case SSL_ERROR: + return -1; + case SSL_FULL: + if (ssl->outsock.size > SSL_MAX_BUF_SIZE) { + return -1; + } + ssl->outsock.size *= 2; + ssl->outsock.buf = + (unsigned char *)realloc(ssl->outsock.buf, ssl->outsock.size); + ssl->outsock.end = ssl->outsock.buf + (ssl->outsock.end - ssl->outsock.start); + ssl->outsock.start = ssl->outsock.buf; + goto retryEncode; + } + } +/* + We've got data to send. +*/ + rc = send(ssl->fd, (char *)ssl->outsock.start, + (int)(ssl->outsock.end - ssl->outsock.start), MSG_NOSIGNAL); + if (rc == -1) { + ssl->status = errno; + return -1; + } + ssl->outsock.start += rc; +/* + If we wrote it all return the length, otherwise remember the number of + bytes passed in, and return 0 to be called again later. +*/ + if (ssl->outsock.start == ssl->outsock.end) { + ssl->outBufferCount = 0; + return len; + } + ssl->outBufferCount = len; + return 0; +} + diff --git a/net/mini_httpd/files/matrixssl_helper.h b/net/mini_httpd/files/matrixssl_helper.h new file mode 100644 index 0000000..e5854df --- /dev/null +++ b/net/mini_httpd/files/matrixssl_helper.h @@ -0,0 +1,39 @@ +/* + * MatrixSSL helper functions + * + * Copyright (C) 2005 Nicolas Thill + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __MATRIXSSL_HELPER_H__ +#define __MATRIXSSL_HELPER_H__ + +#include + +typedef struct __SSL { + int fd; + ssl_t *ssl; + sslKeys_t *keys; + sslBuf_t insock, outsock, inbuf; + int outBufferCount; + int partial; + int status; +} SSL; + +SSL * SSL_new(sslKeys_t *keys); +void SSL_set_fd(SSL *ssl, int fd); +int SSL_accept(SSL *ssl); +int SSL_read(SSL *ssl, char *b, int len); +int SSL_write(SSL *ssl, char *buf, int len); +void SSL_free(SSL *ssl); + +#endif /* __MATRIXSSL_HELPER_H__ */ diff --git a/net/mini_httpd/files/mini_httpd-ssl.conf b/net/mini_httpd/files/mini_httpd-ssl.conf new file mode 100644 index 0000000..1cd7022 --- /dev/null +++ b/net/mini_httpd/files/mini_httpd-ssl.conf @@ -0,0 +1,7 @@ +cgipat=cgi-bin/**|**.sh +dir=/www +nochroot +pidfile=/var/run/mini_httpd.pid +user=root +ssl +certfile=/etc/mini_httpd.pem diff --git a/net/mini_httpd/files/mini_httpd.conf b/net/mini_httpd/files/mini_httpd.conf new file mode 100644 index 0000000..d636a43 --- /dev/null +++ b/net/mini_httpd/files/mini_httpd.conf @@ -0,0 +1,5 @@ +cgipat=cgi-bin/**|**.sh +dir=/www +nochroot +pidfile=/var/run/mini_httpd.pid +user=root diff --git a/net/mini_httpd/files/mini_httpd.default b/net/mini_httpd/files/mini_httpd.default new file mode 100644 index 0000000..85b229e --- /dev/null +++ b/net/mini_httpd/files/mini_httpd.default @@ -0,0 +1 @@ +OPTIONS="-C /etc/mini_httpd.conf" diff --git a/net/mini_httpd/files/mini_httpd.init b/net/mini_httpd/files/mini_httpd.init new file mode 100644 index 0000000..4e0a3a7 --- /dev/null +++ b/net/mini_httpd/files/mini_httpd.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 + +BIN=mini_httpd +DEFAULT=/etc/default/$BIN +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid +[ -f $DEFAULT ] && . $DEFAULT + +start() { + [ -d $RUN_D ] || mkdir -p $RUN_D + $BIN $OPTIONS 2>/dev/null +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) +} diff --git a/net/mini_httpd/files/mini_httpd.pem b/net/mini_httpd/files/mini_httpd.pem new file mode 100644 index 0000000..8a1241a --- /dev/null +++ b/net/mini_httpd/files/mini_httpd.pem @@ -0,0 +1,29 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQC5rFJOQakwMmF9aoVnAXaQLOOPoYOEk19/ls9VZt1ZqfzQuTbG +GGrgMIDclB0kHMFvSbzeiVjMnrSdQTNe1gOQAGtHhHiqugrLqH9m3wqOerbf/Yir +hic9U6X9RaWC6BzNgcYU1QtPn1sDtbMNFAB6jzF3W76EIlHEobgMtfqtxwIDAQAB +AoGBAKJst9eToyDxgc1ICQlSA1kem7eDUF0C2xDvadLI2KxegzZIQD1NEPmsFJ5h +x5hWu3TSabG3LwJZd6D1b63vxE6QRMhcDG3idb7kXzhOOZyfnlnrBtJ3VJC/UH5H +O1pMMBxcu2fXrua+h7BW0gMoZhchvsArDoWaZPjNUNHiNRYBAkEA3Ngnge7njqlf +/UlLkQHHfxgorQ78GjOzrrUvz86pFtW8RKCjAv55HIqAhWrSgxWF4yXkPO2XOHC9 +KTeVKccjAQJBANc63r3M3yP817cPzyo/8BJQD9nAzmolrsBf1YMxML20UmEbObax +QdmxoYu/a8tOD4gT6EZDkauJU0yS69HGeMcCQQCvRmbkuuXQ1iC29+sfpVfeSSBP +aaswaIRdTrQprA2LcAtCNHPsNmeM/WfPe96j5vsiMrqYmMECLIgVJGYgiEoBAkEA +kzg1e+ZTC667bwBlWCT79crFzNDRYFH+QqBKz74p9NkPMFULGSgOPvX95jU9aocu +oInda5J0Zb09OTeWDpuPqQJAUIeY36WUst7NaW40mZXkMjjR2QtWi7P4cmv7nLp0 +WdPQzkUW1Bv4sSUQ7svQqpmZPaFiyhXL1VSa1M5MPd3tbA== +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICOTCCAaKgAwIBAgIJANRuTbnzy8ObMA0GCSqGSIb3DQEBBAUAMFMxCzAJBgNV +BAYTAkZSMQ4wDAYDVQQIEwVQYXJpczEOMAwGA1UEBxMFUGFyaXMxEDAOBgNVBAoT +B015IEhvbWUxEjAQBgNVBAMTCU15IFJvdXRlcjAeFw0wNTAxMTQwMjQzMjdaFw0w +NjAxMTQwMjQzMjdaMFMxCzAJBgNVBAYTAkZSMQ4wDAYDVQQIEwVQYXJpczEOMAwG +A1UEBxMFUGFyaXMxEDAOBgNVBAoTB015IEhvbWUxEjAQBgNVBAMTCU15IFJvdXRl +cjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuaxSTkGpMDJhfWqFZwF2kCzj +j6GDhJNff5bPVWbdWan80Lk2xhhq4DCA3JQdJBzBb0m83olYzJ60nUEzXtYDkABr +R4R4qroKy6h/Zt8Kjnq23/2Iq4YnPVOl/UWlgugczYHGFNULT59bA7WzDRQAeo8x +d1u+hCJRxKG4DLX6rccCAwEAAaMVMBMwEQYJYIZIAYb4QgEBBAQDAgZAMA0GCSqG +SIb3DQEBBAUAA4GBAErI3QmcZVzjxKcoPTO3z8cRJV87SVFp0qbIjbYCBDUWB1QY +/bMkQPr2zJyfJmUYLEs4iKgHrmlaUCMHy9NZKOg9ZxrW42BtQ5QnOtDm3UifwzJW +oCFC3uPWfTYsZn/FrUXlErds+xXXT63VJzBe6DdXwHcdcdxzl05oIyL9JIzI +-----END CERTIFICATE----- diff --git a/net/mini_httpd/patches/001-cgi_path.patch b/net/mini_httpd/patches/001-cgi_path.patch new file mode 100644 index 0000000..c847d94 --- /dev/null +++ b/net/mini_httpd/patches/001-cgi_path.patch @@ -0,0 +1,16 @@ +diff -ruN mini_httpd-1.19-old/mini_httpd.c mini_httpd-1.19-new/mini_httpd.c +--- mini_httpd-1.19-old/mini_httpd.c 2005-10-19 01:11:24.000000000 +0200 ++++ mini_httpd-1.19-new/mini_httpd.c 2005-10-19 01:13:05.000000000 +0200 +@@ -138,10 +138,10 @@ + #define CGI_NICE 10 + #endif /* CGI_NICE */ + #ifndef CGI_PATH +-#define CGI_PATH "/usr/local/bin:/usr/ucb:/bin:/usr/bin" ++#define CGI_PATH "/usr/bin:/bin:/usr/sbin:/sbin" + #endif /* CGI_PATH */ + #ifndef CGI_LD_LIBRARY_PATH +-#define CGI_LD_LIBRARY_PATH "/usr/local/lib:/usr/lib" ++#define CGI_LD_LIBRARY_PATH "/usr/lib:/lib" + #endif /* CGI_LD_LIBRARY_PATH */ + #ifndef AUTH_FILE + #define AUTH_FILE ".htpasswd" diff --git a/net/mini_httpd/patches/500-matrixssl.patch b/net/mini_httpd/patches/500-matrixssl.patch new file mode 100644 index 0000000..0ab8d68 --- /dev/null +++ b/net/mini_httpd/patches/500-matrixssl.patch @@ -0,0 +1,161 @@ +diff -ruN mini_httpd-1.19-orig/Makefile mini_httpd-1.19-3/Makefile +--- mini_httpd-1.19-orig/Makefile 2002-11-02 00:02:57.000000000 +0100 ++++ mini_httpd-1.19-3/Makefile 2005-03-09 08:52:21.000000000 +0100 +@@ -14,17 +14,30 @@ + # http://www.openssl.org/ Make sure the SSL_TREE definition points to the + # tree with your OpenSSL installation - depending on how you installed it, + # it may be in /usr/local instead of /usr/local/ssl. ++ ++# OpenSSL + #SSL_TREE = /usr/local/ssl + #SSL_DEFS = -DUSE_SSL + #SSL_INC = -I${SSL_TREE}/include + #SSL_LIBS = -L${SSL_TREE}/lib -lssl -lcrypto ++#SSL_OBJS = ++ ++# MatrixSSL ++#SSL_TREE = ++#SSL_DEFS = -DUSE_SSL -DHAVE_MATRIXSSL ++#SSL_INC = ++#SSL_LIBS = -lmatrixssl ++#SSL_OBJS = matrixssl_helper.o + + +-BINDIR = /usr/local/sbin +-MANDIR = /usr/local/man ++DESTDIR = ++ ++BINDIR = $(DESTDIR)/usr/sbin ++MANDIR = $(DESTDIR)/usr/share/man + CC = gcc + CDEFS = ${SSL_DEFS} ${SSL_INC} +-CFLAGS = -O ${CDEFS} ++OFLAGS = -O ++CFLAGS = ${OFLAGS} ${CDEFS} + #CFLAGS = -g ${CDEFS} +-LDFLAGS = -s ++LDFLAGS = + #LDFLAGS = -g +@@ -32,12 +45,15 @@ + + all: mini_httpd htpasswd + +-mini_httpd: mini_httpd.o match.o tdate_parse.o +- ${CC} ${CFLAGS} ${LDFLAGS} mini_httpd.o match.o tdate_parse.o ${LDLIBS} -o mini_httpd ++mini_httpd: mini_httpd.o match.o tdate_parse.o ${SSL_OBJS} ++ ${CC} ${CFLAGS} ${LDFLAGS} mini_httpd.o match.o tdate_parse.o ${SSL_OBJS} ${LDLIBS} -o mini_httpd + + mini_httpd.o: mini_httpd.c version.h port.h match.h tdate_parse.h mime_encodings.h mime_types.h + ${CC} ${CFLAGS} -c mini_httpd.c + ++matrixssl_helper.o: matrixssl_helper.c ++ ${CC} ${CFLAGS} -c matrixssl_helper.c ++ + match.o: match.c match.h + ${CC} ${CFLAGS} -c match.c + +@@ -71,16 +87,18 @@ + chmod 600 mini_httpd.pem + + +-install: all +- rm -f ${BINDIR}/mini_httpd ${BINDIR}/htpasswd ++install: all uninstall + -mkdir -p ${BINDIR} + cp mini_httpd htpasswd ${BINDIR} +- rm -f ${MANDIR}/man8/mini_httpd.8 ${MANDIR}/man1/htpasswd.1 + -mkdir -p ${MANDIR}/man8 + cp mini_httpd.8 ${MANDIR}/man8 + -mkdir -p ${MANDIR}/man1 + cp htpasswd.1 ${MANDIR}/man1 + ++uninstall: ++ rm -f ${BINDIR}/mini_httpd ${BINDIR}/htpasswd ++ rm -f ${MANDIR}/man8/mini_httpd.8 ${MANDIR}/man1/htpasswd.1 ++ + clean: + rm -f mini_httpd mime_encodings.h mime_types.h htpasswd mini_httpd.rnd *.o core core.* *.core + +diff -ruN mini_httpd-1.19-orig/mini_httpd.c mini_httpd-1.19-3/mini_httpd.c +--- mini_httpd-1.19-orig/mini_httpd.c 2003-12-03 19:27:22.000000000 +0100 ++++ mini_httpd-1.19-3/mini_httpd.c 2005-03-09 08:46:28.000000000 +0100 +@@ -66,8 +66,14 @@ + #endif /* HAVE_SENDFILE */ + + #ifdef USE_SSL ++# ifdef HAVE_OPENSSL + #include + #include ++# else /* HAVE_OPENSSL */ ++# ifdef HAVE_MATRIXSSL ++# include "matrixssl_helper.h" ++# endif /* HAVE_MATRIXSSL */ ++# endif /* HAVE_OPENSSL */ + #endif /* USE_SSL */ + + extern char* crypt( const char* key, const char* setting ); +@@ -193,7 +199,13 @@ + static int do_ssl; + static char* certfile; + static char* cipher; ++#ifdef HAVE_OPENSSL + static SSL_CTX* ssl_ctx; ++#else /* HAVE_OPENSSL */ ++ #ifdef HAVE_MATRIXSSL ++static sslKeys_t* keys; ++ #endif /* HAVE_MATRIXSSL */ ++#endif /* HAVE_OPENSSL */ + #endif /* USE_SSL */ + static char cwd[MAXPATHLEN]; + static int got_hup; +@@ -540,6 +552,7 @@ + #ifdef USE_SSL + if ( do_ssl ) + { ++# ifdef HAVE_OPENSSL + SSL_load_error_strings(); + SSLeay_add_ssl_algorithms(); + ssl_ctx = SSL_CTX_new( SSLv23_server_method() ); +@@ -559,6 +572,17 @@ + exit( 1 ); + } + } ++# else /* HAVE_OPENSSL */ ++# ifdef HAVE_MATRIXSSL ++ matrixSslOpen(); ++ if ( matrixSslReadKeys( &keys, certfile, certfile, NULL, NULL ) < 0 ) ++ { ++ syslog( LOG_CRIT, "can't load certificate and/or private key\n"); ++ (void) fprintf( stderr, "%s: can't load certificate and/or private key\n", argv0 ); ++ exit( 1 ); ++ } ++# endif /* HAVE_MATRIXSSL */ ++# endif /* HAVE_OPENSSL */ + } + #endif /* USE_SSL */ + +@@ -1174,6 +1198,7 @@ + #ifdef USE_SSL + if ( do_ssl ) + { ++# ifdef HAVE_OPENSSL + ssl = SSL_new( ssl_ctx ); + SSL_set_fd( ssl, conn_fd ); + if ( SSL_accept( ssl ) == 0 ) +@@ -1181,6 +1206,16 @@ + ERR_print_errors_fp( stderr ); + exit( 1 ); + } ++# else /* HAVE_OPENSSL */ ++# ifdef HAVE_MATRIXSSL ++ ssl = SSL_new(keys); ++ SSL_set_fd( ssl, conn_fd ); ++ if ( SSL_accept( ssl ) <= 0 ) ++ { ++ perror( "SSL_accept" ); ++ } ++# endif /* HAVE_MATRIXSSL */ ++# endif /* HAVE_OPENSSL */ + } + #endif /* USE_SSL */ + diff --git a/net/mini_snmpd/Makefile b/net/mini_snmpd/Makefile new file mode 100644 index 0000000..b97d2ad --- /dev/null +++ b/net/mini_snmpd/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2009-2012 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:=mini_snmpd +PKG_VERSION:=1.2b +PKG_RELEASE:=7 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://members.aon.at/linuxfreak/linux/ +PKG_MD5SUM:=9e432c50ba8216d7fab0983b11b7112a + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/mini-snmpd + SECTION:=net + CATEGORY:=Network + TITLE:=SNMP server for embedded systems + URL:=http://members.aon.at/linuxfreak/linux/mini_snmpd.html +endef + +ifneq ($(CONFIG_IPV6),) + TARGET_CFLAGS+= -D__IPV6__ +else + TARGET_CFLAGS+= -D__IPV4__ +endif + +TARGET_CFLAGS+= -DSYSLOG + +MAKE_FLAGS+= \ + OFLAGS="$(TARGET_CFLAGS)" \ + STRIP="/bin/true" \ + INSTALL_ROOT="$(PKG_INSTALL_DIR)" + +define Build/Compile + $(call Build/Compile/Default,mini_snmpd) +endef + +define Package/mini-snmpd/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/sbin/mini_snmpd $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/mini_snmpd.config $(1)/etc/config/mini_snmpd + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mini_snmpd.init $(1)/etc/init.d/mini_snmpd +endef + +define Package/mini-snmpd/conffiles +/etc/config/mini_snmpd +endef + +$(eval $(call BuildPackage,mini-snmpd)) diff --git a/net/mini_snmpd/files/mini_snmpd.config b/net/mini_snmpd/files/mini_snmpd.config new file mode 100644 index 0000000..e41bdc9 --- /dev/null +++ b/net/mini_snmpd/files/mini_snmpd.config @@ -0,0 +1,16 @@ +config mini_snmpd + option enabled 0 + option ipv6 0 + option community 'public' + option contact '' + option location '' + + # enable basic disk usage statistics on specified mountpoint + list disks '/jffs' + list disks '/tmp' + + # enable basic network statistics on specified interface + # 4 interfaces maximum, as named in /etc/config/network + list interfaces 'loopback' + list interfaces 'lan' + list interfaces 'wan' diff --git a/net/mini_snmpd/files/mini_snmpd.init b/net/mini_snmpd/files/mini_snmpd.init new file mode 100644 index 0000000..20e2c62 --- /dev/null +++ b/net/mini_snmpd/files/mini_snmpd.init @@ -0,0 +1,65 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2012 OpenWrt.org + +START=50 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +append_disk() { + local disk="$1" + append disks "$disk" ',' +} + +append_interface() { + local name="$1" + local device + network_get_device device "$name" + append interfaces "${device:-$name}" ',' +} + +append_string() { + local section="$1" + local option="$2" + local value="$3" + local _val + config_get _val "$section" "$option" + [ -n "$_val" ] && append args "$3 $_val" +} + +start_instance() { + local cfg="$1" + local args="" + local disks="" + local interfaces="" + local ipv6 + + append_string "$cfg" community "-c" + append_string "$cfg" location "-L" + append_string "$cfg" contact "-C" + + config_get_bool ipv6 "$cfg" "ipv6" '0' + [ "$ipv6" -gt 0 ] && append args "-6" + + config_get_bool enabled "$cfg" "enabled" '1' + [ "$enabled" -gt 0 ] || return 1 + + config_list_foreach "$section" 'disks' append_disk + args="${args}${disks:+ -d $disks}" + + config_list_foreach "$section" 'interfaces' append_interface + args="${args}${interfaces:+ -i $interfaces}" + + service_start /usr/bin/mini_snmpd $args +} + +start() { + . /lib/functions/network.sh + + config_load 'mini_snmpd' + config_foreach start_instance 'mini_snmpd' +} + +stop() { + service_stop /usr/bin/mini_snmpd +} diff --git a/net/mini_snmpd/patches/100-dualstack.patch b/net/mini_snmpd/patches/100-dualstack.patch new file mode 100644 index 0000000..08aa4a0 --- /dev/null +++ b/net/mini_snmpd/patches/100-dualstack.patch @@ -0,0 +1,218 @@ +--- a/globals.c ++++ b/globals.c +@@ -27,9 +27,9 @@ + * Global variables + */ + +-#ifdef __IPV4__ + const struct in_addr inaddr_any = { INADDR_ANY }; +-#endif ++ ++int g_family = AF_INET; + + in_port_t g_udp_port = 161; + in_port_t g_tcp_port = 161; +--- a/mini_snmpd.c ++++ b/mini_snmpd.c +@@ -54,6 +54,10 @@ static void print_help(void) + fprintf(stderr, "-d, --disks nnn set the disks to monitor (/)\n"); + fprintf(stderr, "-i, --interfaces nnn set the network interfaces to monitor (lo)\n"); + fprintf(stderr, "-I, --listen nnn set the network interface to listen (all)\n"); ++#ifdef __IPV6__ ++ fprintf(stderr, "-4, --ipv4 use IPv4 (default)\n"); ++ fprintf(stderr, "-6, --ipv6 use IPv6\n"); ++#endif + fprintf(stderr, "-t, --timeout nnn set the timeout for MIB updates (1 second)\n"); + fprintf(stderr, "-a, --auth require authentication (thus SNMP version 2c)\n"); + fprintf(stderr, "-v, --verbose verbose syslog messages \n"); +@@ -117,7 +121,7 @@ static void handle_udp_client(void) + #endif + + /* Call the protocol handler which will prepare the response packet */ +- inet_ntop(my_af_inet, &sockaddr.my_sin_addr, straddr, sizeof(straddr)); ++ inet_ntop(g_family, &sockaddr.my_sin_addr, straddr, sizeof(straddr)); + if (snmp(&g_udp_client) == -1) { + lprintf(LOG_WARNING, "could not handle packet from UDP client %s:%d: %m\n", + straddr, sockaddr.my_sin_port); +@@ -132,7 +136,7 @@ static void handle_udp_client(void) + /* Send the whole UDP packet to the socket at once */ + rv = sendto(g_udp_sockfd, g_udp_client.packet, g_udp_client.size, + MSG_DONTWAIT, (struct sockaddr *)&sockaddr, socklen); +- inet_ntop(my_af_inet, &sockaddr.my_sin_addr, straddr, sizeof(straddr)); ++ inet_ntop(g_family, &sockaddr.my_sin_addr, straddr, sizeof(straddr)); + if (rv == -1) { + lprintf(LOG_WARNING, "could not send packet to UDP client %s:%d: %m\n", + straddr, sockaddr.my_sin_port); +@@ -176,7 +180,7 @@ static void handle_tcp_connect(void) + } + tmp_sockaddr.my_sin_addr = client->addr; + tmp_sockaddr.my_sin_port = client->port; +- inet_ntop(my_af_inet, &tmp_sockaddr.my_sin_addr, straddr, sizeof(straddr)); ++ inet_ntop(g_family, &tmp_sockaddr.my_sin_addr, straddr, sizeof(straddr)); + lprintf(LOG_WARNING, "maximum number of %d clients reached, kicking out %s:%d\n", + MAX_NR_CLIENTS, straddr, tmp_sockaddr.my_sin_port); + close(client->sockfd); +@@ -190,7 +194,7 @@ static void handle_tcp_connect(void) + } + + /* Now fill out the client control structure values */ +- inet_ntop(my_af_inet, &sockaddr.my_sin_addr, straddr, sizeof(straddr)); ++ inet_ntop(g_family, &sockaddr.my_sin_addr, straddr, sizeof(straddr)); + lprintf(LOG_DEBUG, "connected TCP client %s:%d\n", + straddr, sockaddr.my_sin_port); + client->timestamp = time(NULL); +@@ -211,7 +215,7 @@ static void handle_tcp_client_write(clie + sockaddr.my_sin_addr = client->addr; + sockaddr.my_sin_port = client->port; + rv = send(client->sockfd, client->packet, client->size, 0); +- inet_ntop(my_af_inet, &sockaddr.my_sin_addr, straddr, sizeof(straddr)); ++ inet_ntop(g_family, &sockaddr.my_sin_addr, straddr, sizeof(straddr)); + if (rv == -1) { + lprintf(LOG_WARNING, "could not send packet to TCP client %s:%d: %m\n", + straddr, sockaddr.my_sin_port); +@@ -246,7 +250,7 @@ static void handle_tcp_client_read(clien + sockaddr.my_sin_port = client->port; + rv = read(client->sockfd, client->packet + client->size, + sizeof (client->packet) - client->size); +- inet_ntop(my_af_inet, &sockaddr.my_sin_addr, straddr, sizeof(straddr)); ++ inet_ntop(g_family, &sockaddr.my_sin_addr, straddr, sizeof(straddr)); + if (rv == -1) { + lprintf(LOG_WARNING, "could not read packet from TCP client %s:%d: %m\n", + straddr, sockaddr.my_sin_port); +@@ -304,7 +308,11 @@ static void handle_tcp_client_read(clien + + int main(int argc, char *argv[]) + { ++#ifdef __IPV6__ ++ static const char short_options[] = "p:P:c:D:V:L:C:d:i:I:t:T:avl46h"; ++#else + static const char short_options[] = "p:P:c:D:V:L:C:d:i:I:t:T:avlh"; ++#endif + static const struct option long_options[] = { + { "udp-port", 1, 0, 'p' }, + { "tcp-port", 1, 0, 'P' }, +@@ -316,6 +324,10 @@ int main(int argc, char *argv[]) + { "disks", 1, 0, 'd' }, + { "interfaces", 1, 0, 'i' }, + { "listen", 1, 0, 'I' }, ++#ifdef __IPV6__ ++ { "ipv4", 0, 0, '4' }, ++ { "ipv6", 0, 0, '6' }, ++#endif + { "timeout", 1, 0, 't' }, + { "traps", 1, 0, 'T' }, + { "auth", 0, 0, 'a' }, +@@ -327,7 +339,12 @@ int main(int argc, char *argv[]) + int option_index = 1; + int c; + +- struct my_sockaddr_t sockaddr; ++ union { ++ struct sockaddr_in sa; ++#ifdef __IPV6__ ++ struct sockaddr_in6 sa6; ++#endif ++ } sockaddr; + my_socklen_t socklen; + struct timeval tv_last; + struct timeval tv_now; +@@ -396,6 +413,14 @@ int main(int argc, char *argv[]) + case 'v': + g_verbose = 1; + break; ++#ifdef __IPV6__ ++ case '4': ++ g_family = AF_INET; ++ break; ++ case '6': ++ g_family = AF_INET6; ++ break; ++#endif + case 'l': + print_version(); + exit(EXIT_ARGS); +@@ -435,15 +460,24 @@ int main(int argc, char *argv[]) + #endif + + /* Open the server's UDP port and prepare it for listening */ +- g_udp_sockfd = socket(my_pf_inet, SOCK_DGRAM, 0); ++ g_udp_sockfd = socket((g_family == AF_INET) ? PF_INET : PF_INET6, SOCK_DGRAM, 0); + if (g_udp_sockfd == -1) { + lprintf(LOG_ERR, "could not create UDP socket: %m\n"); + exit(EXIT_SYSCALL); + } +- sockaddr.my_sin_family = my_af_inet; +- sockaddr.my_sin_port = htons(g_udp_port); +- sockaddr.my_sin_addr = my_inaddr_any; +- socklen = sizeof (sockaddr); ++ if (g_family == AF_INET) { ++ sockaddr.sa.sin_family = g_family; ++ sockaddr.sa.sin_port = htons(g_udp_port); ++ sockaddr.sa.sin_addr = inaddr_any; ++ socklen = sizeof(sockaddr.sa); ++#ifdef __IPV6__ ++ } else { ++ sockaddr.sa6.sin6_family = g_family; ++ sockaddr.sa6.sin6_port = htons(g_udp_port); ++ sockaddr.sa6.sin6_addr = in6addr_any; ++ socklen = sizeof(sockaddr.sa6); ++#endif ++ } + if (bind(g_udp_sockfd, (struct sockaddr *)&sockaddr, socklen) == -1) { + lprintf(LOG_ERR, "could not bind UDP socket to port %d: %m\n", g_udp_port); + exit(EXIT_SYSCALL); +@@ -457,7 +491,7 @@ int main(int argc, char *argv[]) + } + + /* Open the server's TCP port and prepare it for listening */ +- g_tcp_sockfd = socket(my_pf_inet, SOCK_STREAM, 0); ++ g_tcp_sockfd = socket((g_family == AF_INET) ? PF_INET : PF_INET6, SOCK_STREAM, 0); + if (g_tcp_sockfd == -1) { + lprintf(LOG_ERR, "could not create TCP socket: %m\n"); + exit(EXIT_SYSCALL); +@@ -474,10 +508,19 @@ int main(int argc, char *argv[]) + lprintf(LOG_WARNING, "could not set SO_REUSEADDR on TCP socket: %m\n"); + exit(EXIT_SYSCALL); + } +- sockaddr.my_sin_family = my_af_inet; +- sockaddr.my_sin_port = htons(g_tcp_port); +- sockaddr.my_sin_addr = my_inaddr_any; +- socklen = sizeof (sockaddr); ++ if (g_family == AF_INET) { ++ sockaddr.sa.sin_family = g_family; ++ sockaddr.sa.sin_port = htons(g_udp_port); ++ sockaddr.sa.sin_addr = inaddr_any; ++ socklen = sizeof(sockaddr.sa); ++#ifdef __IPV6__ ++ } else { ++ sockaddr.sa6.sin6_family = g_family; ++ sockaddr.sa6.sin6_port = htons(g_udp_port); ++ sockaddr.sa6.sin6_addr = in6addr_any; ++ socklen = sizeof(sockaddr.sa6); ++#endif ++ } + if (bind(g_tcp_sockfd, (struct sockaddr *)&sockaddr, socklen) == -1) { + lprintf(LOG_ERR, "could not bind TCP socket to port %d: %m\n", g_tcp_port); + exit(EXIT_SYSCALL); +--- a/mini_snmpd.h ++++ b/mini_snmpd.h +@@ -255,6 +255,7 @@ typedef struct demoinfo_s { + + extern in_port_t g_udp_port; + extern in_port_t g_tcp_port; ++extern int g_family; + extern int g_timeout; + extern int g_auth; + extern int g_verbose; +@@ -265,9 +266,9 @@ extern char *g_vendor; + extern char *g_location; + extern char *g_contact; + extern char *g_bind_to_device; +-#ifdef __IPV4__ ++ + extern const struct in_addr inaddr_any; +-#endif ++ + + extern char *g_disk_list[MAX_NR_DISKS]; + extern int g_disk_list_length; diff --git a/net/mini_snmpd/patches/101-opt_flags.patch b/net/mini_snmpd/patches/101-opt_flags.patch new file mode 100644 index 0000000..70dbce5 --- /dev/null +++ b/net/mini_snmpd/patches/101-opt_flags.patch @@ -0,0 +1,14 @@ +--- a/Makefile ++++ b/Makefile +@@ -32,9 +32,9 @@ HEADERS = mini_snmpd.h + SOURCES = mini_snmpd.c protocol.c mib.c globals.c utils.c linux.c freebsd.c + VERSION = 1.2b + VENDOR = .1.3.6.1.4.1 +-OFLAGS = -O2 -DDEBUG -g ++OFLAGS = -O2 + CFLAGS = -Wall -Werror -DVERSION="\"$(VERSION)\"" -DVENDOR="\"$(VENDOR)\"" \ +- $(OFLAGS) -D__TRAPS__ -D__LINUX__ -D__IPV6__ ++ $(OFLAGS) -D__TRAPS__ -D__LINUX__ + LDFLAGS = $(OFLAGS) + TARGET = mini_snmpd + MAN = mini_snmpd.8 diff --git a/net/mini_snmpd/patches/102-mib_fix_uninitialized_memory.patch b/net/mini_snmpd/patches/102-mib_fix_uninitialized_memory.patch new file mode 100644 index 0000000..fc8cecf --- /dev/null +++ b/net/mini_snmpd/patches/102-mib_fix_uninitialized_memory.patch @@ -0,0 +1,34 @@ +--- a/mib.c ++++ b/mib.c +@@ -290,6 +290,7 @@ static int mib_build_entry(const oid_t * + value->data.max_length = sizeof (int) + 2; + value->data.encoded_length = 0; + value->data.buffer = malloc(value->data.max_length); ++ memset(value->data.buffer, 0, value->data.max_length); + if (encode_snmp_element_integer(value, (int)default_value) == -1) { + return -1; + } +@@ -298,6 +299,7 @@ static int mib_build_entry(const oid_t * + value->data.max_length = strlen((const char *)default_value) + 4; + value->data.encoded_length = 0; + value->data.buffer = malloc(value->data.max_length); ++ memset(value->data.buffer, 0, value->data.max_length); + if (encode_snmp_element_string(value, (const char *)default_value) == -1) { + return -1; + } +@@ -306,6 +308,7 @@ static int mib_build_entry(const oid_t * + value->data.max_length = MAX_NR_SUBIDS * 5 + 4; + value->data.encoded_length = 0; + value->data.buffer = malloc(value->data.max_length); ++ memset(value->data.buffer, 0, value->data.max_length); + if (encode_snmp_element_oid(value, oid_aton((const char *)default_value)) == -1) { + return -1; + } +@@ -316,6 +319,7 @@ static int mib_build_entry(const oid_t * + value->data.max_length = sizeof (unsigned int) + 2; + value->data.encoded_length = 0; + value->data.buffer = malloc(value->data.max_length); ++ memset(value->data.buffer, 0, value->data.max_length); + if (encode_snmp_element_unsigned(value, type, (unsigned int)default_value) == -1) { + return -1; + } diff --git a/net/mini_snmpd/patches/103-mib_encode_snmp_element_oid_fix.patch b/net/mini_snmpd/patches/103-mib_encode_snmp_element_oid_fix.patch new file mode 100644 index 0000000..a1f105c --- /dev/null +++ b/net/mini_snmpd/patches/103-mib_encode_snmp_element_oid_fix.patch @@ -0,0 +1,21 @@ +--- a/mib.c ++++ b/mib.c +@@ -120,6 +120,9 @@ static int encode_snmp_element_oid(value + int length; + int i; + ++ if (oid_value == NULL) { ++ return -1; ++ } + buffer = value->data.buffer; + length = 1; + for (i = 2; i < oid_value->subid_list_length; i++) { +@@ -310,6 +313,8 @@ static int mib_build_entry(const oid_t * + value->data.buffer = malloc(value->data.max_length); + memset(value->data.buffer, 0, value->data.max_length); + if (encode_snmp_element_oid(value, oid_aton((const char *)default_value)) == -1) { ++ lprintf(LOG_ERR, "could not create MIB entry '%s.%d.%d': invalid oid '%s'\n", ++ oid_ntoa(prefix), column, row, (char *)default_value); + return -1; + } + break; diff --git a/net/miniupnpc/Makefile b/net/miniupnpc/Makefile new file mode 100644 index 0000000..1692d43 --- /dev/null +++ b/net/miniupnpc/Makefile @@ -0,0 +1,72 @@ +# +# Copyright (C) 2010-2011 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:=miniupnpc +PKG_VERSION:=1.6 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=http://miniupnp.free.fr/files +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=88055f2d4a061cfd4cfe25a9eae22f67 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/miniupnpc/Default + TITLE:=Lightweight UPnP + URL:=http://miniupnp.tuxfamily.org/ +endef + +define Package/miniupnpc + $(call Package/miniupnpc/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=Firewall + TITLE+= client + DEPENDS:=+libminiupnpc +endef + +define Package/libminiupnpc + $(call Package/miniupnpc/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= library +endef + +TARGET_CFLAGS += $(FPIC) + +MAKE_FLAGS += \ + PREFIX="$(PKG_INSTALL_DIR)" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/miniupnpc + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/miniupnpc/*.h \ + $(1)/usr/include/miniupnpc/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a} \ + $(1)/usr/lib/ +endef + +define Package/miniupnpc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upnpc $(1)/usr/bin/ +endef + +define Package/libminiupnpc/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/lib/libminiupnpc.so.* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,miniupnpc)) +$(eval $(call BuildPackage,libminiupnpc)) diff --git a/net/miniupnpc/patches/100-no_minixml_test.patch b/net/miniupnpc/patches/100-no_minixml_test.patch new file mode 100644 index 0000000..e549ef0 --- /dev/null +++ b/net/miniupnpc/patches/100-no_minixml_test.patch @@ -0,0 +1,13 @@ +--- a/Makefile ++++ b/Makefile +@@ -107,8 +107,8 @@ installpythonmodule: pythonmodule + python setup.py install + + validateminixml: minixmlvalid +- @echo "minixml validation test" +- ./minixmlvalid ++ @echo "(skipping) minixml validation test" ++# ./minixmlvalid + touch $@ + + clean: diff --git a/net/miniupnpc/patches/200-miniupnpc_desc.patch b/net/miniupnpc/patches/200-miniupnpc_desc.patch new file mode 100644 index 0000000..9a38847 --- /dev/null +++ b/net/miniupnpc/patches/200-miniupnpc_desc.patch @@ -0,0 +1,11 @@ +--- a/upnpcommands.c ++++ b/upnpcommands.c +@@ -351,7 +351,7 @@ UPNP_AddPortMapping(const char * control + AddPortMappingArgs[5].elt = "NewEnabled"; + AddPortMappingArgs[5].val = "1"; + AddPortMappingArgs[6].elt = "NewPortMappingDescription"; +- AddPortMappingArgs[6].val = desc?desc:"libminiupnpc"; ++ AddPortMappingArgs[6].val = desc?desc:"miniupnpc"; + AddPortMappingArgs[7].elt = "NewLeaseDuration"; + AddPortMappingArgs[7].val = "0"; + if(simpleUPnPcommand(-1, controlURL, servicetype, "AddPortMapping", AddPortMappingArgs, buffer, &bufsize) < 0) { diff --git a/net/miniupnpd/Makefile b/net/miniupnpd/Makefile new file mode 100644 index 0000000..dcbc557 --- /dev/null +++ b/net/miniupnpd/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2006-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=miniupnpd +PKG_VERSION:=1.6.20110730 +PKG_RELEASE:=6 + +PKG_SOURCE_URL:=http://miniupnp.free.fr/files +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=8bd5c0447b6dc1101b96e958ee67d3ea + +include $(INCLUDE_DIR)/package.mk + +define Package/miniupnpd + SECTION:=net + CATEGORY:=Network + DEPENDS:=+iptables +libip4tc + TITLE:=Lightweight UPnP daemon + SUBMENU:=Firewall + URL:=http://miniupnp.free.fr/ + MAINTAINER:=Daniel Dickinson +endef + +define Package/miniupnpd/conffiles +/etc/config/upnpd +endef + +define Build/Compile + echo "OpenWRT/$(OPENWRTVERSION)" | tr \(\)\ _ >$(PKG_BUILD_DIR)/os.openwrt + $(MAKE) -C $(PKG_BUILD_DIR) -f Makefile.linux \ + $(TARGET_CONFIGURE_OPTS) \ + STAGING_DIR="$(STAGING_DIR)" \ + CC="$(TARGET_CC)" \ + TARGET_OPENWRT=1 \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(firstword $(wildcard $(KERNEL_BUILD_DIR)/iptables-*/include)) -DIPTABLES_143" \ + LIBS="$(STAGING_DIR)/usr/lib/libip4tc.so" +endef + +define Package/miniupnpd/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/hotplug.d/iface $(1)/etc/hotplug.d/firewall + $(INSTALL_BIN) $(PKG_BUILD_DIR)/miniupnpd $(1)/usr/sbin/miniupnpd + $(INSTALL_BIN) ./files/miniupnpd.init $(1)/etc/init.d/miniupnpd + $(INSTALL_CONF) ./files/upnpd.config $(1)/etc/config/upnpd + $(INSTALL_DATA) ./files/miniupnpd.iface.hotplug $(1)/etc/hotplug.d/iface/50-miniupnpd + $(INSTALL_DATA) ./files/miniupnpd.firewall.hotplug $(1)/etc/hotplug.d/firewall/50-miniupnpd + $(INSTALL_DIR) $(1)/usr/share/miniupnpd +endef + +$(eval $(call BuildPackage,miniupnpd)) diff --git a/net/miniupnpd/files/miniupnpd.firewall.hotplug b/net/miniupnpd/files/miniupnpd.firewall.hotplug new file mode 100644 index 0000000..f2d980c --- /dev/null +++ b/net/miniupnpd/files/miniupnpd.firewall.hotplug @@ -0,0 +1,50 @@ +#!/bin/sh + +miniupnpd_add_rules() { + local zone="$1" + local network="$2" + local iface="$3" + + miniupnpd_remove_rules + + logger -t miniupnpd "adding firewall rules for $iface to zone $zone" + + iptables -t nat -N MINIUPNPD 2>/dev/null + iptables -t nat -I zone_${zone}_prerouting -i $iface -j MINIUPNPD + iptables -t filter -N MINIUPNPD 2>/dev/null + iptables -t filter -I zone_${zone}_forward -i $iface ! -o $iface -j MINIUPNPD + + uci_set_state upnpd state "" state + uci_set_state upnpd state zone "$zone" + uci_set_state upnpd state ifname "$iface" + uci_set_state upnpd state network "$network" +} + +miniupnpd_remove_rules() { + local zone="$(uci_get_state upnpd state zone)" + local iface="$(uci_get_state upnpd state ifname)" + + [ -n "$zone" ] && [ -n "$iface" ] && { + logger -t miniupnpd "removing firewall rules for $iface from zone $zone" + + while iptables -t nat -D zone_${zone}_prerouting \ + -i $iface -j MINIUPNPD 2>/dev/null; do :; done + + while iptables -t filter -D zone_${zone}_forward \ + -i $iface ! -o $iface -j MINIUPNPD 2>/dev/null; do :; done + } + + uci_revert_state upnpd +} + +/etc/init.d/miniupnpd enabled && [ -n "`pidof miniupnpd`" ] && { + + local extif="$(uci_get upnpd config external_iface)" + local curif="$(uci_get_state upnpd state network)" + + if [ "$ACTION" = "add" ] && [ "$INTERFACE" = "$extif" ]; then + miniupnpd_add_rules "$ZONE" "$INTERFACE" "$DEVICE" + elif [ "$ACTION" = "remove" ] && [ "$INTERFACE" = "$curif" ]; then + miniupnpd_remove_rules + fi +} diff --git a/net/miniupnpd/files/miniupnpd.iface.hotplug b/net/miniupnpd/files/miniupnpd.iface.hotplug new file mode 100644 index 0000000..472b8c2 --- /dev/null +++ b/net/miniupnpd/files/miniupnpd.iface.hotplug @@ -0,0 +1,8 @@ +#!/bin/sh + +/etc/init.d/miniupnpd enabled && [ "$ACTION" = "ifup" ] && { + local iface + for iface in $(uci_get upnpd config internal_iface; uci_get upnpd config external_iface); do + [ "$INTERFACE" = "$iface" ] && /etc/init.d/miniupnpd restart + done +} diff --git a/net/miniupnpd/files/miniupnpd.init b/net/miniupnpd/files/miniupnpd.init new file mode 100644 index 0000000..f238b2c --- /dev/null +++ b/net/miniupnpd/files/miniupnpd.init @@ -0,0 +1,199 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=95 + +SERVICE_USE_PID=1 + +upnpd_get_port_range() { + local _var="$1"; shift + local _val + + config_get _val "$@" + + case "$_val" in + [0-9]*[:-][0-9]*) + export -n -- "${_var}_start=${_val%%[:-]*}" + export -n -- "${_var}_end=${_val##*[:-]}" + ;; + [0-9]*) + export -n -- "${_var}_start=$_val" + export -n -- "${_var}_end=" + ;; + esac +} + +conf_rule_add() { + local cfg="$1" + local tmpconf="$2" + local action external_port_start external_port_end int_addr + local internal_port_start internal_port_end + + config_get action "$cfg" action "deny" # allow or deny + upnpd_get_port_range "ext" "$cfg" ext_ports "0-65535" # external ports: x, x-y, x:y + config_get int_addr "$cfg" int_addr "0.0.0.0/0" # ip or network and subnet mask (internal) + upnpd_get_port_range "int" "$cfg" int_ports "0-65535" # internal ports: x, x-y, x:y or range + + # Make a single IP IP/32 so that miniupnpd.conf can use it. + case "$int_addr" in + */*) ;; + *) int_addr="$int_addr/32" ;; + esac + + echo "${action} ${ext_start}${ext_end:+-}${ext_end} ${int_addr} ${int_start}${int_end:+-}${int_end}" >>$tmpconf +} + +upnpd_write_bool() { + local opt="$1" + local def="${2:-0}" + local alt="$3" + local val + + config_get_bool val config "$opt" "$def" + if [ "$val" -eq 0 ]; then + echo "${alt:-$opt}=no" >> $tmpconf + else + echo "${alt:-$opt}=yes" >> $tmpconf + fi +} + +boot() { + return +} + +start() { + type miniupnpd_add_rules >/dev/null 2>/dev/null || \ + ACTION=- . /etc/hotplug.d/firewall/50-miniupnpd + + config_load "upnpd" + local extiface intiface upload download logging secure enabled natpmp + local extip port usesysuptime conffile serial_number model_number + local uuid notify_interval presentation_url enable_upnp + local upnp_lease_file clean_ruleset_threshold clean_ruleset_interval + + config_get extiface config external_iface + config_get intiface config internal_iface + config_get extip config external_ip + config_get port config port 5000 + config_get upload config upload + config_get download config download + config_get_bool logging config log_output 0 + config_get conffile config config_file + config_get serial_number config serial_number + config_get model_number config model_number + config_get uuid config uuid + config_get notify_interval config notify_interval + config_get presentation_url config presentation_url + config_get upnp_lease_file config upnp_lease_file + config_get clean_ruleset_threshold config clean_ruleset_threshold + config_get clean_ruleset_interval config clean_ruleset_interval + + local args + + . /lib/functions/network.sh + + local ifname + network_get_device ifname ${extiface:-wan} + + if [ -n "$conffile" ]; then + args="-f $conffile" + else + local tmpconf="/var/etc/miniupnpd.conf" + args="-f $tmpconf" + mkdir -p /var/etc + + echo "ext_ifname=$ifname" >$tmpconf + + [ -n "$extip" ] && \ + echo "ext_ip=$extip" >>$tmpconf + + local iface + for iface in ${intiface:-lan}; do + local ipnet + network_get_subnet ipnet "$iface" && { + echo "listening_ip=$ipnet" >>$tmpconf + } + done + + [ "$port" != "auto" ] && \ + echo "port=$port" >>$tmpconf + + config_load "upnpd" + upnpd_write_bool enable_natpmp 1 + upnpd_write_bool enable_upnp 1 + upnpd_write_bool secure_mode 1 + upnpd_write_bool system_uptime 1 + + [ -n "$upnp_lease_file" ] && \ + echo "lease_file=$upnp_lease_file" >>$tmpconf + + [ -n "$upload" -a -n "$download" ] && { + echo "bitrate_down=$(($download * 1024 * 8))" >>$tmpconf + echo "bitrate_up=$(($upload * 1024 * 8))" >>$tmpconf + } + + [ -n "${presentation_url}" ] && \ + echo "presentation_url=${presentation_url}" >>$tmpconf + + [ -n "${notify_interval}" ] && \ + echo "notify_interval=${notify_interval}" >>$tmpconf + + [ -n "${clean_ruleset_threshold}" ] && \ + echo "clean_ruleset_threshold=${clean_ruleset_threshold}" >>$tmpconf + + [ -n "${clean_ruleset_interval}" ] && \ + echo "clean_ruleset_interval=${clean_ruleset_interval}" >>$tmpconf + + [ -z "$uuid" ] && { + uuid="$(cat /proc/sys/kernel/random/uuid)" + uci set upnpd.config.uuid=$uuid + uci commit upnpd + } + + [ "$uuid" = "nocli" ] || \ + echo "uuid=$uuid" >>$tmpconf + + [ -n "${serial_number}" ] && \ + echo "serial=${serial_number}" >>$tmpconf + + [ -n "${model_number}" ] && \ + echo "model_number=${model_number}" >>$tmpconf + + config_foreach conf_rule_add perm_rule "$tmpconf" + fi + + + if [ -n "$ifname" ]; then + # start firewall + local zone + config_load firewall + config_get zone core "${extiface:-wan}_zone" + + [ -n "$zone" ] && \ + miniupnpd_add_rules "$zone" "${extiface:-wan}" "$ifname" + + if [ "$logging" = "1" ]; then + SERVICE_DAEMONIZE=1 \ + service_start /usr/sbin/miniupnpd $args -d + else + SERVICE_DAEMONIZE= \ + service_start /usr/sbin/miniupnpd $args + fi + else + logger -t "upnp daemon" "external interface not found, not starting" + fi +} + +stop() { + service_stop /usr/sbin/miniupnpd + + type miniupnpd_remove_rules >/dev/null 2>/dev/null || \ + ACTION=- . /etc/hotplug.d/firewall/50-miniupnpd + + miniupnpd_remove_rules + + iptables -t nat -F MINIUPNPD 2>/dev/null + iptables -t nat -X MINIUPNPD 2>/dev/null + iptables -t filter -F MINIUPNPD 2>/dev/null + iptables -t filter -X MINIUPNPD 2>/dev/null +} diff --git a/net/miniupnpd/files/upnpd.config b/net/miniupnpd/files/upnpd.config new file mode 100644 index 0000000..02b4b2a --- /dev/null +++ b/net/miniupnpd/files/upnpd.config @@ -0,0 +1,24 @@ +config upnpd config + option enable_natpmp 1 + option enable_upnp 1 + option secure_mode 1 + option log_output 0 + option download 1024 + option upload 512 + option external_iface wan + option internal_iface lan + option port 5000 + +config perm_rule + option action allow + option ext_ports 1024-65535 + option int_addr 0.0.0.0/0 # Does not override secure_mode + option int_ports 1024-65535 + option comment "Allow high ports" + +config perm_rule + option action deny + option ext_ports 0-65535 + option int_addr 0.0.0.0/0 + option int_ports 0-65535 + option comment "Default deny" diff --git a/net/mosquitto/Makefile b/net/mosquitto/Makefile new file mode 100644 index 0000000..56f2a64 --- /dev/null +++ b/net/mosquitto/Makefile @@ -0,0 +1,101 @@ +# +# Copyright (C) 2011,2012 OpenWrt.org +# Copyright (C) 2010 Jo-Philipp Wich +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mosquitto +PKG_VERSION:=0.15 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://mosquitto.org/files/source/ +PKG_MD5SUM:=7ae0ac38f1f379578ab5530e5dc7269e + +include $(INCLUDE_DIR)/package.mk + +define Package/mosquitto/default + SECTION:=net + CATEGORY:=Network + TITLE:=mosquitto - an MQTT message broker + URL:=http://www.mosquitto.org/ +endef + +define Package/mosquitto + $(Package/mosquitto/default) +endef + +define Package/mosquitto/description + mosquitto is a message broker that supports v3.1 of the MQ Telemetry +Transport protocol. MQTT provides a lightweight method for +messaging using a publish/subscribe model. +endef + +define Package/mosquitto-client + $(Package/mosquitto/default) + TITLE:= mosquitto - client tools + DEPENDS:= +libmosquitto +endef + +define Package/mosquitto-client/description + Command line client tools for publishing messages to MQTT servers +and subscribing to topics. +endef + +define Package/libmosquitto + $(Package/mosquitto/default) + SECTION:=libs + CATEGORY:=Libraries + TITLE:= mosquitto - client library +endef + +define Package/libmosquitto/description + Library required for mosquitto's command line client tools, also for +use by any third party software that wants to communicate with a +mosquitto server. + +Should be useable for communicating with any MQTT v3.1 compatible +server, such as IBM's RSMB, in addition to Mosquitto +endef + + +define Package/mosquitto/conffiles +/etc/mosquitto/mosquitto.conf +endef + +define Package/mosquitto/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto + $(INSTALL_DIR) $(1)/etc/mosquitto + $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mosquitto.init $(1)/etc/init.d/mosquitto +endef + +define Package/mosquitto-client/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub + $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub +endef + +# This installs files into ./staging_dir/. so that you can cross compile from the host +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/lib + # This should just get symlinked, but I can't work out the magic syntax :( + $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.0 $(1)/usr/lib/libmosquitto.so +endef + +# This installs files on the target. Compare with Build/InstallDev +define Package/libmosquitto/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.0 $(1)/usr/lib/libmosquitto.so.0 +endef +$(eval $(call BuildPackage,mosquitto)) +$(eval $(call BuildPackage,libmosquitto)) +$(eval $(call BuildPackage,mosquitto-client)) diff --git a/net/mosquitto/files/mosquitto.init b/net/mosquitto/files/mosquitto.init new file mode 100755 index 0000000..aafa105 --- /dev/null +++ b/net/mosquitto/files/mosquitto.init @@ -0,0 +1,29 @@ +#!/bin/sh /etc/rc.common +# Basic init script for mosquitto +# April 2012, OpenWrt.org +# Provides support for the luci-app-mosquitto package, if installed + +START=80 +APP=`which mosquitto` +USE_UCI_CONFIG=$(uci -q get mosquitto.owrt.use_uci) +if [ $? -eq 1 ]; then + USE_UCI_CONFIG=0 +fi + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +start() { + user_exists mosquitto 200 || user_add mosquitto 200 + if [ "$USE_UCI_CONFIG" -eq 1 ]; then + CONF=/tmp/mosquitto.converted.$$.conf + mosquitto.uci.convert -f $CONF + else + CONF=/etc/mosquitto/mosquitto.conf + fi + service_start $APP -c $CONF +} + +stop() { + service_stop $APP +} diff --git a/net/mosquitto/patches/100-disable-memory-reporting.patch b/net/mosquitto/patches/100-disable-memory-reporting.patch new file mode 100644 index 0000000..8d589b4 --- /dev/null +++ b/net/mosquitto/patches/100-disable-memory-reporting.patch @@ -0,0 +1,12 @@ +diff -r 490c907277dc config.h +--- a/config.h Sat Jan 15 22:23:50 2011 +0000 ++++ b/config.h Wed Jan 26 13:37:36 2011 +0000 +@@ -15,7 +15,7 @@ + /* Compile with memory tracking support? If disabled, mosquitto won't track + * heap memory usage nor export '$SYS/broker/heap/current size', but will use + * slightly less memory and CPU time. */ +-#define WITH_MEMORY_TRACKING ++//#define WITH_MEMORY_TRACKING + + /* Compile with the ability to upgrade from old style sqlite persistent + * databases to the new mosquitto format. This means a dependency on sqlite. It diff --git a/net/mosquitto/patches/101-disable-docbook.patch b/net/mosquitto/patches/101-disable-docbook.patch new file mode 100644 index 0000000..8670197 --- /dev/null +++ b/net/mosquitto/patches/101-disable-docbook.patch @@ -0,0 +1,11 @@ +diff -r bebd02e8bed4 -r 77b64fb10075 Makefile +--- a/Makefile Thu Jul 07 13:34:54 2011 +0100 ++++ b/Makefile Thu Jul 07 16:50:05 2011 +0000 +@@ -1,6 +1,6 @@ + include config.mk + +-DIRS=lib client src man ++DIRS=lib client src + DISTDIRS=man + + .PHONY : all mosquitto clean reallyclean install uninstall dist sign copy diff --git a/net/mrtg/Makefile b/net/mrtg/Makefile new file mode 100644 index 0000000..ef3d9c9 --- /dev/null +++ b/net/mrtg/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2011-2012 OpenWrt.org +# Copyright (C) 2011 Paolo Pisati +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mrtg +PKG_VERSION:=2.17.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://oss.oetiker.ch/mrtg/pub/ +PKG_MD5SUM:=c803f671d04367ee719039ea71fb5b37 + +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/mrtg + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libgd +libpng +zlib +perl +perlbase-essential +perlbase-findbin \ + +perlbase-cwd +perlbase-config +perlbase-file +perlbase-getopt \ + +perlbase-math +perlbase-integer +perlbase-xsloader +perlbase-pod \ + +perlbase-universal +perlbase-socket +perlbase-posix +perlbase-autoloader \ + +perlbase-fcntl +perlbase-tie +perlbase-io +perlbase-symbol \ + +perlbase-selectsaver +perlbase-errno + TITLE:=The Multi Router Traffic Grapher + URL:=http://oss.oetiker.ch/mrtg/index.en.html +endef + +define Package/mrtg/description + The Multi Router Traffic Grapher, or just simply MRTG, is free software for + monitoring and measuring the traffic load on network links. It allows the + user to see traffic load on a network over time in graphical form. It was + originally developed by Tobias Oetiker and Dave Rand to monitor router + traffic, but has developed into a tool that can create graphs and statistics + for almost anything. +endef + +define Package/mrtg/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/* $(1)/usr/share/ +endef + +$(eval $(call BuildPackage,mrtg)) diff --git a/net/mrtg/patches/001-rm-printf-longlong-fmt-test.patch b/net/mrtg/patches/001-rm-printf-longlong-fmt-test.patch new file mode 100644 index 0000000..d6cb0c8 --- /dev/null +++ b/net/mrtg/patches/001-rm-printf-longlong-fmt-test.patch @@ -0,0 +1,50 @@ +--- mrtg-2.17.3.orig/configure.in 2011-12-25 23:54:18.284584003 +0100 ++++ mrtg-2.17.3/configure.in 2011-12-25 23:54:52.377260252 +0100 +@@ -19,47 +19,6 @@ + + AC_PATH_PROGS(NROFF, groff nroff) + +-dnl Check for long long type (64 bit rateup) +-AC_CHECK_HEADERS(inttypes.h) +-AC_CHECK_TYPE(unsigned long long) +-AC_CHECK_TYPE(long long) +-AC_CHECK_FUNCS(strtoll) +- +-# Taken from libIDL-0.8.2 +-AC_MSG_CHECKING([for printf long long format specifier]) +-AC_CACHE_VAL(long_long_format_specifier,[ +- for format in ll l q I64; do +- AC_TRY_RUN([#include +- int main() +- { +- long long b, a = -0x3AFAFAFAFAFAFAFALL; +- char buffer[1000]; +- sprintf (buffer, "%${format}u", a); +- sscanf (buffer, "%${format}u", &b); +- exit (b!=a); +- } +- ], +- long_long_format_specifier="%${format}d" +- long_long_format="${format}d" +- break) +- done]) +-AC_MSG_RESULT($long_long_format_specifier) +-AC_DEFINE_UNQUOTED(LLD, "$long_long_format_specifier", +- [How to print a long long]) +-AC_DEFINE_UNQUOTED(LLD_FORMAT, "$long_long_format", +- [long long format without % specifier]) +- +-AH_BOTTOM( +-#ifndef HAVE_STRTOLL +-long long int strtoll(const char *str, char **ptr, int base) +-{ +- long long int ll; +- sscanf(str, LLD, &ll); +- return ll; +-} +-#endif +-) +- + dnl Checks for libraries. + AC_CHECK_LIB(m, pow, [ MATHLIBS="-lm" ]) + diff --git a/net/mtr/Makefile b/net/mtr/Makefile new file mode 100644 index 0000000..d6aedec --- /dev/null +++ b/net/mtr/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (C) 2006-2012 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:=mtr +PKG_VERSION:=0.82 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.bitwizard.nl/mtr +PKG_MD5SUM:=10601ea543fda3e51545c4bce195b64c + +PKG_INSTALL:=1 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/mtr + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libncurses + TITLE:=Full screen ncurses traceroute tool + URL:=http://www.bitwizard.nl/mtr/ +endef + +define Package/mtr/description + mtr combines the functionality of the 'traceroute' and 'ping' programs + in a single network diagnostic tool. + As mtr starts, it investigates the network connection between the host + mtr runs on and a user-specified destination host. After it + determines the address of each network hop between the machines, + it sends a sequence ICMP ECHO requests to each one to determine the + quality of the link to each machine. As it does this, it prints + running statistics about each machine. +endef + +CONFIGURE_ARGS += \ + --without-gtk \ + +#CONFIGURE_VARS += \ +# ac_cv_lib_resolv_res_mkquery=no \ + +define Build/Configure + (cd $(PKG_BUILD_DIR); touch \ + configure.in \ + aclocal.m4 \ + Makefile.in \ + img/Makefile.in \ + stamp-h.in \ + config.h.in \ + configure \ + ); + $(call Build/Configure/Default) +endef + +define Package/mtr/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mtr $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,mtr)) diff --git a/net/mtr/patches/501-dns.patch b/net/mtr/patches/501-dns.patch new file mode 100644 index 0000000..0976cb3 --- /dev/null +++ b/net/mtr/patches/501-dns.patch @@ -0,0 +1,510 @@ +--- a/dns.c ++++ b/dns.c +@@ -880,6 +880,507 @@ void restell(char *s) + fputs("\r",stderr); + } + ++#ifdef __UCLIBC__ ++ ++static const char digits[] = "0123456789"; ++#define __set_errno(e) (errno = (e)) ++ ++#define NS_PUT16(s, cp) do { \ ++ register u_int16_t t_s = (u_int16_t)(s); \ ++ register u_char *t_cp = (u_char *)(cp); \ ++ *t_cp++ = t_s >> 8; \ ++ *t_cp = t_s; \ ++ (cp) += NS_INT16SZ; \ ++} while (0) ++ ++ ++ ++#define NS_PUT32(l, cp) do { \ ++ register u_int32_t t_l = (u_int32_t)(l); \ ++ register u_char *t_cp = (u_char *)(cp); \ ++ *t_cp++ = t_l >> 24; \ ++ *t_cp++ = t_l >> 16; \ ++ *t_cp++ = t_l >> 8; \ ++ *t_cp = t_l; \ ++ (cp) += NS_INT32SZ; \ ++} while (0) ++ ++ ++void ++ns_put16(u_int src, u_char *dst) { ++ NS_PUT16(src, dst); ++} ++ ++void ++ns_put32(u_long src, u_char *dst) { ++ NS_PUT32(src, dst); ++} ++ ++void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); } ++void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); } ++ ++int ++mklower(int ch) { ++ if (ch >= 0x41 && ch <= 0x5A) ++ return (ch + 0x20); ++ return (ch); ++} ++ ++ ++static int ++dn_find(const u_char *domain, const u_char *msg, ++ const u_char * const *dnptrs, ++ const u_char * const *lastdnptr) ++{ ++ const u_char *dn, *cp, *sp; ++ const u_char * const *cpp; ++ u_int n; ++ ++ for (cpp = dnptrs; cpp < lastdnptr; cpp++) { ++ sp = *cpp; ++ /* ++ * terminate search on: ++ * root label ++ * compression pointer ++ * unusable offset ++ */ ++ while (*sp != 0 && (*sp & NS_CMPRSFLGS) == 0 && ++ (sp - msg) < 0x4000) { ++ dn = domain; ++ cp = sp; ++ while ((n = *cp++) != 0) { ++ /* ++ * check for indirection ++ */ ++ switch (n & NS_CMPRSFLGS) { ++ case 0: /* normal case, n == len */ ++ if (n != *dn++) ++ goto next; ++ for ((void)NULL; n > 0; n--) ++ if (mklower(*dn++) != ++ mklower(*cp++)) ++ goto next; ++ /* Is next root for both ? */ ++ if (*dn == '\0' && *cp == '\0') ++ return (sp - msg); ++ if (*dn) ++ continue; ++ goto next; ++ ++ case NS_CMPRSFLGS: /* indirection */ ++ cp = msg + (((n & 0x3f) << 8) | *cp); ++ break; ++ ++ default: /* illegal type */ ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ } ++ next: ++ sp += *sp + 1; ++ } ++ } ++ __set_errno (ENOENT); ++ return (-1); ++} ++ ++ ++int ++ns_name_pack(const u_char *src, u_char *dst, int dstsiz, ++ const u_char **dnptrs, const u_char **lastdnptr) ++{ ++ u_char *dstp; ++ const u_char **cpp, **lpp, *eob, *msg; ++ const u_char *srcp; ++ int n, l, first = 1; ++ ++ srcp = src; ++ dstp = dst; ++ eob = dstp + dstsiz; ++ lpp = cpp = NULL; ++ if (dnptrs != NULL) { ++ if ((msg = *dnptrs++) != NULL) { ++ for (cpp = dnptrs; *cpp != NULL; cpp++) ++ (void)NULL; ++ lpp = cpp; /* end of list to search */ ++ } ++ } else ++ msg = NULL; ++ ++ /* make sure the domain we are about to add is legal */ ++ l = 0; ++ do { ++ n = *srcp; ++ if ((n & NS_CMPRSFLGS) != 0 && n != 0x41) { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ if (n == 0x41) ++ n = *++srcp / 8; ++ l += n + 1; ++ if (l > MAXCDNAME) { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ srcp += n + 1; ++ } while (n != 0); ++ ++ /* from here on we need to reset compression pointer array on error */ ++ srcp = src; ++ do { ++ /* Look to see if we can use pointers. */ ++ n = *srcp; ++ if (n != 0 && n != 0x41 && msg != NULL) { ++ l = dn_find(srcp, msg, (const u_char * const *)dnptrs, ++ (const u_char * const *)lpp); ++ if (l >= 0) { ++ if (dstp + 1 >= eob) { ++ goto cleanup; ++ } ++ *dstp++ = (l >> 8) | NS_CMPRSFLGS; ++ *dstp++ = l % 256; ++ return (dstp - dst); ++ } ++ /* Not found, save it. */ ++ if (lastdnptr != NULL && cpp < lastdnptr - 1 && ++ (dstp - msg) < 0x4000 && first) { ++ *cpp++ = dstp; ++ *cpp = NULL; ++ first = 0; ++ } ++ } ++ /* copy label to buffer */ ++ if ((n & NS_CMPRSFLGS) != 0 && n != 0x41) { /* Should not happen. */ ++ goto cleanup; ++ } ++ if (n == 0x41) { ++ n = *++srcp / 8; ++ if (dstp + 1 >= eob) ++ goto cleanup; ++ *dstp++ = 0x41; ++ } ++ if (dstp + 1 + n >= eob) { ++ goto cleanup; ++ } ++ memcpy(dstp, srcp, n + 1); ++ srcp += n + 1; ++ dstp += n + 1; ++ } while (n != 0); ++ ++ if (dstp > eob) { ++cleanup: ++ if (msg != NULL) ++ *lpp = NULL; ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ return (dstp - dst); ++} ++ ++ ++int ++ns_name_pton(const char *src, u_char *dst, size_t dstsiz) { ++ u_char *label, *bp, *eom; ++ int c, n, escaped; ++ char *cp; ++ ++ escaped = 0; ++ bp = dst; ++ eom = dst + dstsiz; ++ label = bp++; ++ ++ while ((c = *src++) != 0) { ++ if (escaped) { ++ if ((cp = strchr(digits, c)) != NULL) { ++ n = (cp - digits) * 100; ++ if ((c = *src++) == 0 || ++ (cp = strchr(digits, c)) == NULL) { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ n += (cp - digits) * 10; ++ if ((c = *src++) == 0 || ++ (cp = strchr(digits, c)) == NULL) { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ n += (cp - digits); ++ if (n > 255) { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ c = n; ++ } else if (c == '[' && label == bp - 1 && *src == 'x') { ++ /* Theoretically we would have to handle \[o ++ as well but we do not since we do not need ++ it internally. */ ++ *label = 0x41; ++ label = bp++; ++ ++src; ++ while (isxdigit (*src)) { ++ n = *src > '9' ? *src - 'a' + 10 : *src - '0'; ++ ++src; ++ if (! isxdigit(*src)) { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ n <<= 4; ++ n += *src > '9' ? *src - 'a' + 10 : *src - '0'; ++ if (bp + 1 >= eom) { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ *bp++ = n; ++ ++src; ++ } ++ *label = (bp - label - 1) * 8; ++ if (*src++ != ']' || *src++ != '.') { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ escaped = 0; ++ label = bp++; ++ if (bp >= eom) { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ continue; ++ } ++ escaped = 0; ++ } else if (c == '\\') { ++ escaped = 1; ++ continue; ++ } else if (c == '.') { ++ c = (bp - label - 1); ++ if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */ ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ if (label >= eom) { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ *label = c; ++ /* Fully qualified ? */ ++ if (*src == '\0') { ++ if (c != 0) { ++ if (bp >= eom) { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ *bp++ = '\0'; ++ } ++ if ((bp - dst) > MAXCDNAME) { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ return (1); ++ } ++ if (c == 0 || *src == '.') { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ label = bp++; ++ continue; ++ } ++ if (bp >= eom) { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ *bp++ = (u_char)c; ++ } ++ c = (bp - label - 1); ++ if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */ ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ if (label >= eom) { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ *label = c; ++ if (c != 0) { ++ if (bp >= eom) { ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ *bp++ = 0; ++ } ++ if ((bp - dst) > MAXCDNAME) { /* src too big */ ++ __set_errno (EMSGSIZE); ++ return (-1); ++ } ++ return (0); ++} ++ ++ ++ ++int ++ns_name_compress(const char *src, u_char *dst, size_t dstsiz, ++ const u_char **dnptrs, const u_char **lastdnptr) ++{ ++ u_char tmp[NS_MAXCDNAME]; ++ ++ if (ns_name_pton(src, tmp, sizeof tmp) == -1) ++ return (-1); ++ return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr)); ++} ++ ++ ++int ++dn_comp(const char *src, u_char *dst, int dstsiz, ++ u_char **dnptrs, u_char **lastdnptr) ++{ ++ return (ns_name_compress(src, dst, (size_t)dstsiz, ++ (const u_char **)dnptrs, ++ (const u_char **)lastdnptr)); ++} ++ ++ ++ ++ ++int ++res_nmkquery(res_state statp, ++ int op, /* opcode of query */ ++ const char *dname, /* domain name */ ++ int class, int type, /* class and type of query */ ++ const u_char *data, /* resource record data */ ++ int datalen, /* length of data */ ++ const u_char *newrr_in, /* new rr for modify or append */ ++ u_char *buf, /* buffer to put query */ ++ int buflen) /* size of buffer */ ++{ ++ register HEADER *hp; ++ register u_char *cp; ++ register int n; ++ u_char *dnptrs[20], **dpp, **lastdnptr; ++ ++#ifdef DEBUG ++ if (statp->options & RES_DEBUG) ++ printf(";; res_nmkquery(%s, %s, %s, %s)\n", ++ _res_opcodes[op], dname, p_class(class), p_type(type)); ++#endif ++ /* ++ * Initialize header fields. ++ */ ++ if ((buf == NULL) || (buflen < HFIXEDSZ)) ++ return (-1); ++ memset(buf, 0, HFIXEDSZ); ++ hp = (HEADER *) buf; ++ /* We randomize the IDs every time. The old code just ++ incremented by one after the initial randomization which ++ still predictable if the application does multiple ++ requests. */ ++#if 0 ++ hp->id = htons(++statp->id); ++#else ++ hp->id = htons(statp->id); ++ int randombits; ++ do ++ { ++#ifdef RANDOM_BITS ++ RANDOM_BITS (randombits); ++#else ++ struct timeval tv; ++ gettimeofday (&tv, NULL); ++ randombits = (tv.tv_sec << 8) ^ tv.tv_usec; ++#endif ++ } ++ while ((randombits & 0xffff) == 0); ++ statp->id = (statp->id + randombits) & 0xffff; ++#endif ++ hp->opcode = op; ++ hp->rd = (statp->options & RES_RECURSE) != 0; ++ hp->rcode = NOERROR; ++ cp = buf + HFIXEDSZ; ++ buflen -= HFIXEDSZ; ++ dpp = dnptrs; ++ *dpp++ = buf; ++ *dpp++ = NULL; ++ lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0]; ++ /* ++ * perform opcode specific processing ++ */ ++ switch (op) { ++ case QUERY: /*FALLTHROUGH*/ ++ case NS_NOTIFY_OP: ++ if ((buflen -= QFIXEDSZ) < 0) ++ return (-1); ++ if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0) ++ return (-1); ++ cp += n; ++ buflen -= n; ++ __putshort(type, cp); ++ cp += INT16SZ; ++ __putshort(class, cp); ++ cp += INT16SZ; ++ hp->qdcount = htons(1); ++ if (op == QUERY || data == NULL) ++ break; ++ /* ++ * Make an additional record for completion domain. ++ */ ++ buflen -= RRFIXEDSZ; ++ n = dn_comp((char *)data, cp, buflen, dnptrs, lastdnptr); ++ if (n < 0) ++ return (-1); ++ cp += n; ++ buflen -= n; ++ __putshort(T_NULL, cp); ++ cp += INT16SZ; ++ __putshort(class, cp); ++ cp += INT16SZ; ++ __putlong(0, cp); ++ cp += INT32SZ; ++ __putshort(0, cp); ++ cp += INT16SZ; ++ hp->arcount = htons(1); ++ break; ++ ++ case IQUERY: ++ /* ++ * Initialize answer section ++ */ ++ if (buflen < 1 + RRFIXEDSZ + datalen) ++ return (-1); ++ *cp++ = '\0'; /* no domain name */ ++ __putshort(type, cp); ++ cp += INT16SZ; ++ __putshort(class, cp); ++ cp += INT16SZ; ++ __putlong(0, cp); ++ cp += INT32SZ; ++ __putshort(datalen, cp); ++ cp += INT16SZ; ++ if (datalen) { ++ memcpy(cp, data, datalen); ++ cp += datalen; ++ } ++ hp->ancount = htons(1); ++ break; ++ ++ default: ++ return (-1); ++ } ++ return (cp - buf); ++} ++ ++int ++res_mkquery(int op, /* opcode of query */ ++ const char *dname, /* domain name */ ++ int class, int type, /* class and type of query */ ++ const u_char *data, /* resource record data */ ++ int datalen, /* length of data */ ++ const u_char *newrr_in, /* new rr for modify or append */ ++ u_char *buf, /* buffer to put query */ ++ int buflen) /* size of buffer */ ++{ ++ return (res_nmkquery(&_res, op, dname, class, type, ++ data, datalen, ++ newrr_in, buf, buflen)); ++} ++ ++#endif + + void dorequest(char *s,int type,word id) + { diff --git a/net/mtr/patches/502-fix-res_ninit.patch b/net/mtr/patches/502-fix-res_ninit.patch new file mode 100644 index 0000000..dc0a02b --- /dev/null +++ b/net/mtr/patches/502-fix-res_ninit.patch @@ -0,0 +1,31 @@ +--- a/dns.c ++++ b/dns.c +@@ -1267,28 +1267,6 @@ res_nmkquery(res_state statp, + return (-1); + memset(buf, 0, HFIXEDSZ); + hp = (HEADER *) buf; +- /* We randomize the IDs every time. The old code just +- incremented by one after the initial randomization which +- still predictable if the application does multiple +- requests. */ +-#if 0 +- hp->id = htons(++statp->id); +-#else +- hp->id = htons(statp->id); +- int randombits; +- do +- { +-#ifdef RANDOM_BITS +- RANDOM_BITS (randombits); +-#else +- struct timeval tv; +- gettimeofday (&tv, NULL); +- randombits = (tv.tv_sec << 8) ^ tv.tv_usec; +-#endif +- } +- while ((randombits & 0xffff) == 0); +- statp->id = (statp->id + randombits) & 0xffff; +-#endif + hp->opcode = op; + hp->rd = (statp->options & RES_RECURSE) != 0; + hp->rcode = NOERROR; diff --git a/net/mtr/patches/520-libresolv_fix.patch b/net/mtr/patches/520-libresolv_fix.patch new file mode 100644 index 0000000..b8f6aac --- /dev/null +++ b/net/mtr/patches/520-libresolv_fix.patch @@ -0,0 +1,17 @@ +--- a/configure.in ++++ b/configure.in +@@ -72,10 +72,10 @@ AC_CHECK_FUNC(gethostbyname, , + AC_CHECK_FUNCS(seteuid) + # AC_CHECK_FUNC(setuid, , AC_MSG_ERROR (I Need either seteuid or setuid)) + +-AC_CHECK_FUNC(res_mkquery, , +- AC_CHECK_LIB(bind, res_mkquery, , +- AC_CHECK_LIB(resolv, res_mkquery, , +- AC_CHECK_LIB(resolv, __res_mkquery, , AC_MSG_ERROR(No resolver library found))))) ++#AC_CHECK_FUNC(res_mkquery, , ++# AC_CHECK_LIB(bind, res_mkquery, , ++# AC_CHECK_LIB(resolv, res_mkquery, , ++# AC_CHECK_LIB(resolv, __res_mkquery, , AC_MSG_ERROR(No resolver library found))))) + # This next line would override the just detected-or-not -lresolv. + # This apparently hurts BSD. And it's bad practise. So it should go. + # However, it probably didn't get added for nothing..... Holler if diff --git a/net/mtr/patches/521-gtk_fix.patch b/net/mtr/patches/521-gtk_fix.patch new file mode 100644 index 0000000..4314573 --- /dev/null +++ b/net/mtr/patches/521-gtk_fix.patch @@ -0,0 +1,27 @@ +--- a/configure.in ++++ b/configure.in +@@ -48,16 +48,16 @@ AC_ARG_ENABLE(ipv6, + [ --disable-ipv6 Do not enable IPv6], + WANTS_IPV6=$enableval, WANTS_IPV6=yes) + +-if test "x$WANTS_GTK" = "xyes"; then +- AM_PATH_GTK_2_0(2.6.0, CFLAGS="$CFLAGS $GTK_CFLAGS" +- LIBS="$LIBS $GTK_LIBS -lm", +- AC_MSG_WARN(Building without GTK2 display support) +- AC_DEFINE(NO_GTK, 1, [Define if you don't have the GTK+ libraries available.]) +- GTK_OBJ="") +-else ++#if test "x$WANTS_GTK" = "xyes"; then ++# AM_PATH_GTK_2_0(2.6.0, CFLAGS="$CFLAGS $GTK_CFLAGS" ++# LIBS="$LIBS $GTK_LIBS -lm", ++# AC_MSG_WARN(Building without GTK2 display support) ++# AC_DEFINE(NO_GTK, 1, [Define if you don't have the GTK+ libraries available.]) ++# GTK_OBJ="") ++#else + AC_DEFINE(NO_GTK) + GTK_OBJ="" +-fi ++#fi + + AC_CHECK_FUNC(socket, , + AC_CHECK_LIB(socket, socket, , AC_MSG_ERROR(No socket library found))) diff --git a/net/multiwan/Makefile b/net/multiwan/Makefile new file mode 100644 index 0000000..f5161cc --- /dev/null +++ b/net/multiwan/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2010-2012 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:=multiwan +PKG_VERSION:=1.0.22 +PKG_RELEASE:=2 + +include $(INCLUDE_DIR)/package.mk + +define Package/multiwan + SECTION:=net + CATEGORY:=Network + DEPENDS:=+ip +iptables +kmod-ipt-conntrack +iptables-mod-conntrack-extra +iptables-mod-ipopt + TITLE:=Simple multi WAN configuration + URL:=ftp://ftp.netlab7.com/ + MAINTAINER:=Craig M. Coffee +endef + +define Package/multiwan/description +An agent script that makes Multi-WAN configuration simple, +easy and manageable. Complete with load balancing, failover and an easy +to manage traffic ruleset. +endef + +define Package/multiwan/conffiles +/etc/config/multiwan +endef + +define Build/Compile +endef + +define Package/multiwan/install + $(CP) ./files/* $(1) +endef + +define Package/multiwan/postinst +[ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/multiwan enable +exit 0 +endef + +$(eval $(call BuildPackage,multiwan)) diff --git a/net/multiwan/files/etc/config/multiwan b/net/multiwan/files/etc/config/multiwan new file mode 100644 index 0000000..c88bdf3 --- /dev/null +++ b/net/multiwan/files/etc/config/multiwan @@ -0,0 +1,57 @@ + +config 'multiwan' 'config' + # REMOVE THIS LINE OR PUT TO 1 TO ENABLE MULTIWAN + option 'enabled' '0' + + option 'default_route' 'balancer' + # health_monitor below is defaulted to parallel, and can be set to + # serial to save system resources. + # option 'health_monitor' 'serial' + # option 'debug' '1' + +config 'interface' 'wan' + option 'weight' '10' + option 'health_interval' '10' + option 'icmp_hosts' 'dns' + # icmp_count is defaulted to 1, and can be increased to reduce + # false positives. + # option 'icmp_count' '3' + option 'timeout' '3' + option 'health_fail_retries' '3' + option 'health_recovery_retries' '5' + option 'failover_to' 'wan2' + option 'dns' 'auto' + +config 'interface' 'wan2' + option 'weight' '10' + option 'health_interval' '10' + option 'icmp_hosts' 'gateway' + option 'timeout' '3' + option 'health_fail_retries' '3' + option 'health_recovery_retries' '5' + option 'failover_to' 'balancer' + option 'dns' '208.67.222.222 208.67.220.220' + +config 'mwanfw' + option 'src' '192.168.1.0/24' + option 'dst' 'ftp.netlab7.com' + option 'proto' 'tcp' + option 'ports' '21' + option 'wanrule' 'wan2' + +# VoIP traffic goes through wan +# config 'mwanfw' + # option 'src' '192.168.1.0/24' + # option 'proto' 'udp' + # option 'port_type' 'source-ports' + # option 'ports' '5060,16384:16482' + # option 'wanrule' 'wan' + +config 'mwanfw' + option 'src' '192.168.0.3' + option 'proto' 'icmp' + option 'wanrule' 'balancer' + +config 'mwanfw' + option 'dst' 'www.whatismyip.com' + option 'wanrule' 'fastbalancer' diff --git a/net/multiwan/files/etc/init.d/multiwan b/net/multiwan/files/etc/init.d/multiwan new file mode 100755 index 0000000..8784430 --- /dev/null +++ b/net/multiwan/files/etc/init.d/multiwan @@ -0,0 +1,20 @@ +#!/bin/sh /etc/rc.common +START=99 +EXTRA_COMMANDS="single" + +start () { + /usr/bin/multiwan agent & +} + +stop () { + sh /usr/bin/multiwan stop +} + +restart () { + /usr/bin/multiwan restart & +} + +single () { + /usr/bin/multiwan single & +} + diff --git a/net/multiwan/files/usr/bin/multiwan b/net/multiwan/files/usr/bin/multiwan new file mode 100755 index 0000000..34cfa54 --- /dev/null +++ b/net/multiwan/files/usr/bin/multiwan @@ -0,0 +1,1043 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/network.sh + +silencer() { + if [ -z "$debug" -o "$debug" == "0" ]; then + $* > /dev/null 2>&1 + else + $* + fi +} + +mwnote() { + logger ${debug:+-s} -p 5 -t multiwan "$1" +} + +failover() { + local failchk=$(query_config failchk $2) + local recvrychk=$(query_config recvrychk $2) + + local wanid=$(query_config wanid $2) + local failover_to=$(uci_get_state multiwan ${2} failover_to) + local failover_to_wanid=$(query_config wanid $failover_to) + + local existing_failover=$(iptables -n -L FW${wanid}MARK -t mangle | echo $(($(wc -l) - 2))) + + add() { + + wan_fail_map=$(echo $wan_fail_map | sed -e "s/${1}\[${failchk}\]//g") + wan_fail_map="$wan_fail_map${1}[x]" + wan_recovery_map=$(echo $wan_recovery_map | sed -e "s/${1}\[${recvrychk}\]//g") + update_cache + + if [ "$existing_failover" == "2" ]; then + if [ "$failover_to" != "balancer" -a "$failover_to" != "fastbalancer" -a "$failover_to" != "disable" -a "$failover_to_wanid" != "$wanid" ]; then + iptables -I FW${wanid}MARK 2 -t mangle -j FW${failover_to_wanid}MARK + elif [ "$failover_to" == "balancer" ]; then + iptables -I FW${wanid}MARK 2 -t mangle -j LoadBalancer + elif [ "$failover_to" == "fastbalancer" ]; then + iptables -I FW${wanid}MARK 2 -t mangle -j FastBalancer + fi + fi + mwnote "$1 has failed and is currently offline." + } + + del() { + + wan_recovery_map=$(echo $wan_recovery_map | sed -e "s/${1}\[${recvrychk}\]//g") + wan_fail_map=$(echo $wan_fail_map | sed -e "s/${1}\[${failchk}\]//g") + update_cache + + if [ "$existing_failover" == "3" ]; then + iptables -D FW${wanid}MARK 2 -t mangle + fi + mwnote "$1 has recovered and is back online!" + } + + case $1 in + add) add $2;; + del) del $2;; + esac +} + +fail_wan() { + local new_fail_count + + local health_fail_retries=$(uci_get_state multiwan ${1} health_fail_retries) + local weight=$(uci_get_state multiwan ${1} weight) + + local failchk=$(query_config failchk $1) + local recvrychk=$(query_config recvrychk $1) + wan_recovery_map=$(echo $wan_recovery_map | sed -e "s/${1}\[${recvrychk}\]//g") + + if [ -z "$failchk" ]; then + failchk=1 + wan_fail_map="$wan_fail_map${1}[1]" + fi + + if [ "$failchk" != "x" ]; then + new_fail_count=$(($failchk + 1)) + if [ "$new_fail_count" -lt "$health_fail_retries" ]; then + wan_fail_map=$(echo $wan_fail_map | sed -e "s/${1}\[${failchk}\]/$1\[${new_fail_count}\]/g") + else + failover add $1 + refresh_dns + if [ "$weight" != "disable" ]; then + refresh_loadbalancer + fi + fi + fi + update_cache +} + +recover_wan() { + local new_fail_count + + local health_recovery_retries=$(uci_get_state multiwan ${1} health_recovery_retries) + local weight=$(uci_get_state multiwan ${1} weight) + + local failchk=$(query_config failchk $1) + local recvrychk=$(query_config recvrychk $1) + local wanid=$(query_config wanid $1) + + if [ ! -z "$failchk" -a "$failchk" != "x" ]; then + wan_fail_map=$(echo $wan_fail_map | sed -e "s/${1}\[${failchk}\]//g") + update_cache + fi + + if [ "$failchk" == "x" ]; then + if [ -z "$recvrychk" ]; then + wan_recovery_map="$wan_recovery_map${1}[1]" + update_cache + if [ "$health_recovery_retries" == "1" ]; then + recover_wan $1 + fi + else + new_recovery_count=$(($recvrychk + 1)) + if [ "$new_recovery_count" -lt "$health_recovery_retries" ]; then + wan_recovery_map=$(echo $wan_recovery_map | sed -e "s/${1}\[${recvrychk}\]/$1\[${new_recovery_count}\]/g") + update_cache + else + failover del $1 + refresh_dns + if [ "$weight" != "disable" ]; then + refresh_loadbalancer + fi + fi + fi + fi +} + +acquire_wan_data() { + local check_old_map + local get_wanid + local old_ifname + local old_ipaddr + local old_gateway + + local ifname ipaddr gateway + network_get_device ifname ${1} || ifname=x + network_get_ipaddr ipaddr ${1} || ipaddr=x + network_get_gateway gateway ${1} || gateway=x + + check_old_map=$(echo $wan_id_map 2>&1 | grep -o "$1\[") + + if [ -z $check_old_map ]; then + wancount=$(($wancount + 1)) + if [ $wancount -gt 20 ]; then + wancount=20 + return + fi + wan_if_map="$wan_if_map${1}[${ifname}]" + wan_id_map="$wan_id_map${1}[${wancount}]" + wan_gw_map="$wan_gw_map${1}[${gateway}]" + wan_ip_map="$wan_ip_map${1}[${ipaddr}]" + else + old_ipaddr=$(query_config ipaddr $1) + old_gateway=$(query_config gateway $1) + old_ifname=$(query_config ifname $1) + get_wanid=$(query_config wanid $1) + + wan_if_map=$(echo $wan_if_map | sed -e "s/${1}\[${old_ifname}\]/$1\[${ifname}\]/g") + wan_ip_map=$(echo $wan_ip_map | sed -e "s/${1}\[${old_ipaddr}\]/$1\[${ipaddr}\]/g") + wan_gw_map=$(echo $wan_gw_map | sed -e "s/${1}\[${old_gateway}\]/$1\[${gateway}\]/g") + + if [ "$old_ifname" != "$ifname" ]; then + iptables -D MultiWanPreHandler -t mangle -i $old_$ifname -m state --state NEW -j FW${get_wanid}MARK + iptables -A MultiWanPreHandler -t mangle -i $ifname -m state --state NEW -j FW${get_wanid}MARK + iptables -D MultiWanPostHandler -t mangle -o $old_$ifname -m mark --mark 0x1 -j FW${get_wanid}MARK + iptables -A MultiWanPostHandler -t mangle -o $ifname -m mark --mark 0x1 -j FW${get_wanid}MARK + fi + + if [ "$ifname" != "x" -a "$ipaddr" != "x" -a "$gateway" != "x" ]; then + failover del $1 + iprules_config $get_wanid + else + failover add $1 + fi + + refresh_routes + refresh_loadbalancer + refresh_dns + update_cache + fi +} + +update_cache() { + if [ ! -d /tmp/.mwan ]; then + mkdir /tmp/.mwan > /dev/null 2>&1 + fi + + rm /tmp/.mwan/cache > /dev/null 2>&1 + touch /tmp/.mwan/cache + + echo "# Automatically Generated by Multi-WAN Agent Script. Do not modify or remove. #" > /tmp/.mwan/cache + echo "wan_id_map=\"$wan_id_map\"" >> /tmp/.mwan/cache + echo "wan_if_map=\"$wan_if_map\"" >> /tmp/.mwan/cache + echo "wan_ip_map=\"$wan_ip_map\"" >> /tmp/.mwan/cache + echo "wan_gw_map=\"$wan_gw_map\"" >> /tmp/.mwan/cache + echo "wan_fail_map=\"$wan_fail_map\"" >> /tmp/.mwan/cache + echo "wan_recovery_map=\"$wan_recovery_map\"" >> /tmp/.mwan/cache + echo "wan_monitor_map=\"$wan_monitor_map\"" >> /tmp/.mwan/cache +} + +query_config() { + case $1 in + ifname) echo $wan_if_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';; + ipaddr) echo $wan_ip_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';; + gateway) echo $wan_gw_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';; + wanid) echo $wan_id_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';; + failchk) echo $wan_fail_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';; + recvrychk) echo $wan_recovery_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';; + monitor) echo $wan_monitor_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';; + group) echo $wan_id_map | grep -o "\w*\[$2\]" | awk -F "[" '{print $1}';; + esac +} + +mwan_kill() { + local otherpids=$(ps 2>&1 | grep 'multiwan agent' | grep -v $$ | awk '{print $1}') + [ -n "$otherpids" ] && kill $otherpids > /dev/null 2>&1 + sleep 2 +} + +# For system shutdownl: stop +# A plain stop will leave network in a limp state, without wan access +# stop single: restore to a single wan +# stop restart: restart multiple wan's +stop() { + mwan_kill + flush $1 + + if [ "$1" == "single" ]; then + # ifup is quite expensive--do it only when single wan is requested + echo "## Refreshing Interfaces ##" + local i=0 + while [ $((i++)) -lt $wancount ]; do + local group=$(query_config group $i) + ifup $group >&- 2>&- && sleep 1 + done + + echo "## Unloaded, updating syslog and exiting. ##" + mwnote "Succesfully Unloaded on $(exec date -R)." + rm -fr /tmp/.mwan >&- 2>&- + fi + ip route flush cache + + if [ "$1" == "restart" ]; then + echo "## Restarting Multi-WAN. ##" + mwnote "Reinitializing Multi-WAN Configuration." + rm -fr /tmp/.mwan >&- 2>&- + /etc/init.d/multiwan start >&- 2>&- + fi + + exit +} + +clear_rules() { + local restore_single=$1 + local group + + iptables -t mangle -D PREROUTING -j MultiWan + iptables -t mangle -D FORWARD -j MultiWan + iptables -t mangle -D OUTPUT -j MultiWan + iptables -t mangle -D POSTROUTING -j MultiWan + iptables -t mangle -F MultiWan + iptables -t mangle -X MultiWan + iptables -t mangle -F MultiWanRules + iptables -t mangle -X MultiWanRules + iptables -t mangle -F MultiWanDNS + iptables -t mangle -X MultiWanDNS + iptables -t mangle -F MultiWanPreHandler + iptables -t mangle -X MultiWanPreHandler + iptables -t mangle -F MultiWanPostHandler + iptables -t mangle -X MultiWanPostHandler + iptables -t mangle -F LoadBalancer + iptables -t mangle -X LoadBalancer + iptables -t mangle -F FastBalancer + iptables -t mangle -X FastBalancer + iptables -t mangle -F MultiWanLoadBalancer + iptables -t mangle -X MultiWanLoadBalancer + + local i=0 + while [ $((i++)) -lt $wancount ]; do + iptables -t mangle -F FW${i}MARK + iptables -t mangle -X FW${i}MARK + done + + if [ ! -z "$CHKFORQOS" ]; then + iptables -t mangle -F PREROUTING + iptables -t mangle -F FORWARD + iptables -t mangle -F OUTPUT + iptables -t mangle -F POSTROUTING + iptables -t mangle -F MultiWanQoS + iptables -t mangle -X MultiWanQoS + + i=0 + while [ $((i++)) -lt $wancount ]; do + group=$(query_config group $i) + iptables -t mangle -F qos_${group} + iptables -t mangle -F qos_${group}_ct + iptables -t mangle -X qos_${group} + iptables -t mangle -X qos_${group}_ct + done + fi + + [ "$restore_single" == 'single' ] && + /etc/init.d/qos restart > /dev/null 2>&1 +} + +qos_init() { + local ifname + local queue_count + local get_wan_tc + local get_wan_iptables + local add_qos_iptables + local add_qos_tc + local execute + local iprule + local qos_if_test + + ifname=$(query_config ifname $1) + + if [ "$ifname" == "x" ]; then + return + fi + + qos_if_test=$(echo $qos_if_done | grep $ifname.) + + if [ ! -z "$qos_if_test" ]; then + return + fi + + qos_if_done=$(echo ${qos_if_done}.${ifname}) + + queue_count=$(tc filter list dev $ifname | tail -n 1 | awk -F " " '{print $10}' | sed "s/0x//g") + + if [ -z "$queue_count" ]; then + return + fi + + queue_count=$(($queue_count + 1)) + + iptables -t mangle -N qos_${1} + iptables -t mangle -N qos_${1}_ct + + get_wan_tc=$(tc filter list dev $ifname | grep "0x" | sed -e "s/filter /tc filter add dev $ifname /g" -e "s/pref/prio/g" -e "s/fw//g") + get_wan_iptables=$(iptables-save | egrep '(-A Default )|(-A Default_ct )' | grep -v "MultiWanQoS" | sed -e "s/Default /qos_${1} /g" -e "s/Default_ct /qos_${1}_ct /g" -e "s/-A/iptables -t mangle -A/g") + + + local i=0 + while [ $i -lt $queue_count ]; do + echo "s/\(0x$i \|0x$i\/0xffffffff\)/0x$(($2 * 10 + $i)) /g" >> /tmp/.mwan/qos.$1.sedfilter + i=$(($i + 1)) + done + + add_qos_iptables=$(echo "$get_wan_iptables" | sed -f /tmp/.mwan/qos.$1.sedfilter) + echo "$add_qos_iptables" | while read execute; do ${execute}; done + + rm /tmp/.mwan/qos.$1.sedfilter + i=1 + while [ $i -lt $queue_count ]; do + echo "s/0x$i /0x${2}${i} fw /g" >> /tmp/.mwan/qos.$1.sedfilter + i=$(($i + 1)) + done + + add_qos_tc=$(echo "$get_wan_tc" | sed -f /tmp/.mwan/qos.$1.sedfilter) + echo "$add_qos_tc" | while read execute; do ${execute}; done + rm /tmp/.mwan/qos.$1.sedfilter + + i=0 + while [ $i -lt $queue_count ]; do + if [ $i -lt $(($queue_count - 1)) ]; then + ip rule add fwmark 0x$(($2 * 10 + $i + 1)) table $(($2 + 170)) prio $(( $2 * 10 + $i + 2)) + fi + iptables -t mangle -A MultiWanQoS -m mark --mark 0x$(($2 * 10 + $i)) -j qos_${1} + i=$(($i + 1)) + done +} + +mwanrule() { + local src + local dst + local ports + local proto + local wanrule + + config_get src $1 src + config_get dst $1 dst + config_get port_type $1 port_type 'dports' + config_get ports $1 ports + config_get proto $1 proto + config_get wanrule $1 wanrule + + if [ -z "$wanrule" ]; then + return + fi + + if [ "$wanrule" != "balancer" -a "$wanrule" != "fastbalancer" ]; then + wanrule=$(query_config wanid ${wanrule}) + wanrule="FW${wanrule}MARK" + elif [ "$wanrule" == "balancer" ]; then + wanrule="LoadBalancer" + elif [ "$wanrule" == "fastbalancer" ]; then + wanrule="FastBalancer" + fi + if [ "$dst" == "all" ]; then + dst=$NULL + fi + if [ "$proto" == "all" ]; then + proto=$NULL + fi + if [ "$ports" == "all" ]; then + ports=$NULL + fi + add_rule() { + if [ "$proto" == "icmp" ]; then + ports=$NULL + fi + if [ "$src" == "all" ]; then + src=$NULL + fi + iptables -t mangle -A MultiWanRules ${src:+-s $src} ${dst:+-d $dst} \ + -m mark --mark 0x0 ${proto:+-p $proto -m $proto} \ + ${ports:+-m multiport --$port_type $ports} \ + -j $wanrule + } + if [ -z "$proto" -a ! -z "$ports" ]; then + proto=tcp + add_rule + proto=udp + add_rule + return + fi + add_rule +} + +refresh_dns() { + local dns + local group + local ipaddr + local gateway + local ifname + local failchk + local compile_dns + local dns_server + + iptables -F MultiWanDNS -t mangle + + rm /tmp/resolv.conf.auto + touch /tmp/resolv.conf.auto + + echo "## Refreshing DNS Resolution and Tables ##" + + local i=0 + while [ $((i++)) -lt $wancount ]; do + group=$(query_config group $i) + gateway=$(query_config gateway $group) + ipaddr=$(query_config ipaddr $group) + ifname=$(query_config ifname $group) + failchk=$(query_config failchk $group) + + dns=$(uci_get_state multiwan ${group} dns 'auto') + [ "$dns" == "auto" ] && network_get_dnsserver dns ${group} + dns=$(echo $dns | sed -e "s/ /\n/g") + + if [ ! -z "$dns" -a "$failchk" != "x" -a "$ipaddr" != "x" -a "$gateway" != "x" -a "$ifname" != "x" ]; then + echo "$dns" | while read dns_server; do + iptables -t mangle -A MultiWanDNS -d $dns_server -p tcp --dport 53 -j FW${i}MARK + iptables -t mangle -A MultiWanDNS -d $dns_server -p udp --dport 53 -j FW${i}MARK + + compile_dns="nameserver $dns_server" + echo "$compile_dns" >> /tmp/resolv.conf.auto + done + fi + done + + last_resolv_update=$(ls -l -e /tmp/resolv.conf.auto | awk -F " " '{print $5, $9}') +} + +iptables_init() { + echo "## IPTables Rule Initialization ##" + local iprule + local group + local ifname + local execute + local IMQ_NFO + local default_route_id + local i + + if [ ! -z "$CHKFORQOS" ]; then + echo "## QoS Initialization ##" + + /etc/init.d/qos restart > /dev/null 2>&1 + + IMQ_NFO=$(iptables -n -L PREROUTING -t mangle -v | grep IMQ | awk -F " " '{print $6,$12}') + + iptables -t mangle -F PREROUTING + iptables -t mangle -F FORWARD + iptables -t mangle -F POSTROUTING + iptables -t mangle -F OUTPUT + + echo "$IMQ_NFO" | while read execute; do + iptables -t mangle -A PREROUTING -i $(echo $execute | awk -F " " '{print $1}') -j IMQ --todev $(echo $execute | awk -F " " '{print $2}') + done + + iptables -t mangle -N MultiWanQoS + + i=0 + while [ $((i++)) -lt $wancount ]; do + qos_init $(query_config group $i) $i + done + + fi + + iptables -t mangle -N MultiWan + iptables -t mangle -N LoadBalancer + iptables -t mangle -N FastBalancer + iptables -t mangle -N MultiWanRules + iptables -t mangle -N MultiWanDNS + iptables -t mangle -N MultiWanPreHandler + iptables -t mangle -N MultiWanPostHandler + iptables -t mangle -N MultiWanLoadBalancer + + echo "## Creating FW Rules ##" + i=0 + while [ $((i++)) -lt $wancount ]; do + iprule=$(($i * 10)) + iptables -t mangle -N FW${i}MARK + iptables -t mangle -A FW${i}MARK -j MARK --set-mark 0x${iprule} + iptables -t mangle -A FW${i}MARK -j CONNMARK --save-mark + done + + iptables -t mangle -A LoadBalancer -j MARK --set-mark 0x1 + iptables -t mangle -A LoadBalancer -j CONNMARK --save-mark + + if [ -z "$CHKFORMODULE" ]; then + iptables -t mangle -A FastBalancer -j MARK --set-mark 0x2 + iptables -t mangle -A FastBalancer -j CONNMARK --save-mark + else + mwnote "Performance load balancer(fastbalanacer) is unavailable due to current kernel limitations." + iptables -t mangle -A FastBalancer -j MARK --set-mark 0x1 + iptables -t mangle -A FastBalancer -j CONNMARK --save-mark + fi + + iptables -t mangle -A MultiWan -j CONNMARK --restore-mark + iptables -t mangle -A MultiWan -j MultiWanPreHandler + iptables -t mangle -A MultiWan -j MultiWanRules + iptables -t mangle -A MultiWan -j MultiWanLoadBalancer + iptables -t mangle -A MultiWan -j MultiWanDNS + iptables -t mangle -A MultiWan -j MultiWanPostHandler + + iptables -t mangle -I PREROUTING -j MultiWan + iptables -t mangle -I FORWARD -j MultiWan + iptables -t mangle -I OUTPUT -j MultiWan + iptables -t mangle -I POSTROUTING -j MultiWan + + + refresh_dns + + config_load "multiwan" + config_foreach mwanrule mwanfw + + if [ "$default_route" != "balancer" -a "$default_route" != "fastbalancer" ]; then + default_route_id=$(query_config wanid $default_route) + iptables -t mangle -A MultiWanRules -m mark --mark 0x0 -j FW${default_route_id}MARK + elif [ "$default_route" == "fastbalancer" ]; then + iptables -t mangle -A MultiWanRules -m mark --mark 0x0 -j FastBalancer + else + iptables -t mangle -A MultiWanRules -m mark --mark 0x0 -j LoadBalancer + fi + + i=0 + while [ $((i++)) -lt $wancount ]; do + group=$(query_config group $i) + ifname=$(query_config ifname $group) + iptables -t mangle -A MultiWanPreHandler -i $ifname -m state --state NEW -j FW${i}MARK + iptables -t mangle -A MultiWanPostHandler -o $ifname -m mark --mark 0x1 -j FW${i}MARK + done + + if [ ! -z "$CHKFORQOS" ]; then + iptables -t mangle -A MultiWan -j MultiWanQoS + fi +} + +refresh_loadbalancer() { + local group + local gateway + local ifname + local failchk + local weight + local nexthop + local pre_nexthop_chk + local rand_probability + + echo "## Refreshing Load Balancer ##" + + ip rule del prio 9 > /dev/null 2>&1 + ip route flush table 170 > /dev/null 2>&1 + + for TABLE in 170; do + ip route | grep -Ev ^default | while read ROUTE; do + ip route add table $TABLE to $ROUTE + done + done + + iptables -F MultiWanLoadBalancer -t mangle + + local total_weight=0 + + local i=0 + while [ $((i++)) -lt $wancount ]; do + group=$(query_config group $i) + failchk=$(query_config failchk $group) + gateway=$(query_config gateway $group) + ifname=$(query_config ifname $group) + weight=$(uci_get_state multiwan ${group} weight) + if [ "$gateway" != "x" -a "$ifname" != "x" -a "$failchk" != "x" -a "$weight" != "disable" ]; then + total_weight=$(($total_weight + $weight)) + fi + done + + i=0 + while [ $((i++)) -lt $wancount ]; do + group=$(query_config group $i) + failchk=$(query_config failchk $group) + gateway=$(query_config gateway $group) + ifname=$(query_config ifname $group) + + weight=$(uci_get_state multiwan ${group} weight) + + if [ "$gateway" != "x" -a "$ifname" != "x" -a "$failchk" != "x" -a "$weight" != "disable" ]; then + nexthop="$nexthop nexthop via $gateway dev $ifname weight $weight" + + rand_probability=$(($weight * 100 / $total_weight)) + total_weight=$(($total_weight - $weight)) + + if [ $rand_probability -lt 10 ]; then + rand_probability="0.0${rand_probability}" + elif [ $rand_probability -lt 100 ]; then + rand_probability="0.${rand_probability}" + else + rand_probability="1.0" + fi + + if [ -z "$CHKFORMODULE" ]; then + iptables -A MultiWanLoadBalancer -t mangle -m mark --mark 0x2 -m statistic --mode random --probability $rand_probability -j FW${i}MARK + fi + fi + + done + + pre_nexthop_chk=$(echo $nexthop | awk -F "nexthop" '{print NF-1}') + if [ "$pre_nexthop_chk" == "1" ]; then + ip route add default via $(echo $nexthop | awk -F " " '{print $3}') dev $(echo $nexthop | awk -F " " '{print $5}') proto static table 170 + elif [ "$pre_nexthop_chk" -gt "1" ]; then + ip route add proto static table 170 default scope global $nexthop + fi + + ip rule add fwmark 0x1 table 170 prio 9 + ip route flush cache +} + +refresh_routes() { + local iprule + local gateway + local group + local ifname + local ipaddr + + echo "## Refreshing Routing Tables ##" + + local i=0 + while [ $((i++)) -lt $wancount ]; do + group=$(query_config group $i) + gateway=$(query_config gateway $group) + ifname=$(query_config ifname $group) + ipaddr=$(query_config ipaddr $group) + ip route flush table $(($i + 170)) > /dev/null 2>&1 + + TABLE=$(($i + 170)) + ip route | grep -Ev ^default | while read ROUTE; do + ip route add table $TABLE to $ROUTE + done + + if [ "$gateway" != "x" -a "$ipaddr" != "x" -a "$ifname" != "x" ]; then + ip route add default via $gateway table $(($i + 170)) src $ipaddr proto static + route add default gw $gateway > /dev/null 2>&1 + fi + done + + ip route flush cache +} + +iprules_config() { + local iprule + local group + local gateway + local ipaddr + + group=$(query_config group $1) + gateway=$(query_config gateway $group) + ipaddr=$(query_config ipaddr $group) + + CHKIPROUTE=$(grep MWAN${1} /etc/iproute2/rt_tables) + if [ -z "$CHKIPROUTE" ]; then + echo "$(($1 + 170)) MWAN${1}" >> /etc/iproute2/rt_tables + fi + + ip rule del prio $(($1 * 10)) > /dev/null 2>&1 + ip rule del prio $(($1 * 10 + 1)) > /dev/null 2>&1 + + if [ "$gateway" != "x" -a "$ipaddr" != "x" ]; then + ip rule add from $ipaddr table $(($1 + 170)) prio $(($1 * 10)) + ip rule add fwmark 0x$(($1 * 10)) table $(($1 + 170)) prio $(($1 * 10 + 1)) + fi +} + +flush() { + local restore_single=$1 + echo "## Flushing IP Rules & Routes ##" + + ip rule flush > /dev/null 2>&1 + ip rule add lookup main prio 32766 > /dev/null 2>&1 + ip rule add lookup default prio 32767 > /dev/null 2>&1 + + ip route flush table 170 > /dev/null + + local i=0 + while [ $((i++)) -lt $wancount ]; do + ip route del default > /dev/null 2>&1 + ip route flush table $(($i + 170)) > /dev/null 2>&1 + done + + echo "## Clearing Rules ##" + clear_rules $restore_single > /dev/null 2>&1 + + rm $jobfile > /dev/null 2>&1 +} + +main_init() { + local RP_PATH IFACE + local group + local health_interval + + echo "## Main Initialization ##" + + mkdir /tmp/.mwan > /dev/null 2>&1 + + mwan_kill + flush + + echo "## IP Rules Initialization ##" + + CHKIPROUTE=$(grep LoadBalancer /etc/iproute2/rt_tables) + if [ -z "$CHKIPROUTE" ]; then + echo "#" >> /etc/iproute2/rt_tables + echo "170 LoadBalancer" >> /etc/iproute2/rt_tables + fi + + local i=0 + while [ $((i++)) -lt $wancount ]; do + iprules_config $i + done + + refresh_routes + iptables_init + + refresh_loadbalancer + + RP_PATH=/proc/sys/net/ipv4/conf + for IFACE in $(ls $RP_PATH); do + echo 0 > $RP_PATH/$IFACE/rp_filter + done + mwnote "Succesfully Initialized on $(date -R)." + fail_start_check + + while :; do + schedule_tasks + do_tasks + done +} + +monitor_wan() { + local ifname ipaddr gateway icmp_hosts_acquire icmp_test_host + local check_test + + . /tmp/.mwan/cache + + local timeout=$(uci_get_state multiwan ${1} timeout) + local icmp_hosts=$(uci_get_state multiwan ${1} icmp_hosts) + local icmp_count=$(uci_get_state multiwan ${1} icmp_count '1') + local health_interval=$(uci_get_state multiwan ${1} health_interval) + local ifname_cur=$(query_config ifname $1) + local ipaddr_cur=$(query_config ipaddr $1) + local gateway_cur=$(query_config gateway $1) + + while :; do + [ "${health_monitor%.*}" = 'parallel' ] && sleep $health_interval + + network_get_device ifname ${1} || ifname=x + network_get_ipaddr ipaddr ${1} || ipaddr=x + network_get_gateway gateway ${1} || gateway=x + + if [ "$ifname_cur" != "$ifname" -o "$ipaddr_cur" != "$ipaddr" -o "$gateway_cur" != "$gateway" ]; then + add_task "$1" acquire + if [ "${health_monitor%.*}" = 'parallel' ]; then + exit + else + return + fi + else + [ "$gateway" != "x" ] && ! ip route | grep -o $gateway >&- 2>&- && + add_task route refresh + fi + + if [ "$icmp_hosts" != "disable" -a "$ifname" != "x" -a "$ipaddr" != "x" -a "$gateway" != "x" ]; then + + if [ "$icmp_hosts" == "gateway" -o -z "$icmp_hosts" ]; then + icmp_hosts_acquire=$gateway + elif [ "$icmp_hosts" == "dns" ]; then + icmp_hosts_acquire=$(uci_get_state multiwan $1 dns 'auto') + [ "$icmp_hosts_acquire" == "auto" ] && + network_get_dnsserver icmp_hosts_acquire $1 + else + icmp_hosts_acquire=$icmp_hosts + fi + + icmp_hosts=$(echo $icmp_hosts_acquire | sed -e "s/\,/ /g" | sed -e "s/ /\n/g") + + ping_test() { + echo "$icmp_hosts" | while read icmp_test_host; do + ping -c "$icmp_count" -W $timeout -I $ifname $icmp_test_host 2>&1 | grep -o "round-trip" + done + } + + check_test=$(ping_test) + + if [ -z "$check_test" ]; then + add_task "$1" fail + else + add_task "$1" pass + fi + + elif [ "$icmp_hosts" == "disable" ]; then + add_task "$1" pass + fi + + [ "$health_monitor" = 'serial' ] && { + wan_monitor_map=$(echo $wan_monitor_map | sed -e "s/$1\[\w*\]/$1\[$(date +%s)\]/g") + update_cache + break + } + done +} + +# Add a task to the $jobfile while ensuring +# no duplicate tasks for the specified group +add_task() { + local group=$1 + local task=$2 + grep -o "$group.$task" $jobfile >&- 2>&- || echo "$group.$task" >> $jobfile +} + +# For health_monitor "parallel", start a background monitor for each group. +# For health_monitor "serial", queue monitor tasks for do_tasks. +schedule_tasks() { + local group health_interval monitored_last_at current_time diff delay + local i=0 + + get_health_interval() { + group=$(query_config group $1) + health_interval=$(uci_get_state multiwan ${group} health_interval 'disable') + [ "$health_interval" = "disable" ] && health_interval=0 + } + + [ "$health_monitor" = 'parallel' ] && { + while [ $((i++)) -lt $wancount ]; do + get_health_interval $i + if [ "$health_interval" -gt 0 ]; then + monitor_wan $group & + sleep 1 + fi + done + echo "## Started background monitor_wan ##" + health_monitor="parallel.started" + } + + [ "$health_monitor" = 'serial' ] && { + local monitor_disabled=1 + + until [ -f $jobfile ]; do + current_time=$(date +%s) + delay=$max_interval + i=0 + + while [ $((i++)) -lt $wancount ]; do + get_health_interval $i + if [ "$health_interval" -gt 0 ]; then + monitor_disabled=0 + + monitored_last=$(query_config monitor $group) + [ -z "$monitored_last" ] && { + monitored_last=$current_time + wan_monitor_map="${wan_monitor_map}${group}[$monitored_last]" + update_cache + } + + will_monitor_at=$(($monitored_last + $health_interval)) + diff=$(($will_monitor_at - $current_time)) + [ $diff -le 0 ] && add_task "$group" 'monitor' + + delay=$(($delay > $diff ? $diff : $delay)) + fi + done + + [ "$monitor_disabled" -eq 1 ] && { + # Although health monitors are disabled, still + # need to check up on iptables rules in do_tasks + sleep "$iptables_interval" + break + } + [ $delay -gt 0 ] && sleep $delay + done + } +} + +rule_counter=0 +# Process each task in the $jobfile in FIFO order +do_tasks() { + local check_iptables + local queued_task + local current_resolv_file + + while :; do + + . /tmp/.mwan/cache + + if [ "$((++rule_counter))" -eq 5 -o "$health_monitor" = 'serial' ]; then + + check_iptables=$(iptables -n -L MultiWan -t mangle | grep "references" | awk -F "(" '{print $2}' | cut -d " " -f 1) + + if [ -z "$check_iptables" -o "$check_iptables" -lt 4 ]; then + mwnote "Netfilter rules appear to of been altered." + /etc/init.d/multiwan restart + exit + fi + + current_resolv_file=$(ls -l -e /tmp/resolv.conf.auto | awk -F " " '{print $5, $9}') + + if [ "$last_resolv_update" != "$current_resolv_file" ]; then + refresh_dns + fi + + rule_counter=0 + fi + + if [ -f $jobfile ]; then + + mv $jobfile $jobfile.work + + while read LINE; do + + execute_task() { + case $2 in + fail) fail_wan $1;; + pass) recover_wan $1;; + acquire) + acquire_wan_data $1 + [ "${health_monitor%.*}" = 'parallel' ] && { + monitor_wan $1 & + echo "## Started background monitor_wan ##" + } + ;; + monitor) monitor_wan $1;; + refresh) refresh_routes;; + *) echo "## Unknown task command: $2 ##";; + esac + } + + queued_task=$(echo $LINE | awk -F "." '{print $1,$2}') + execute_task $queued_task + done < $jobfile.work + + rm $jobfile.work + fi + + if [ "$health_monitor" = 'serial' ]; then + break + else + sleep 1 + fi + done +} + +fail_start_check(){ + local ipaddr + local gateway + local ifname + local group + + local i=0 + while [ $((i++)) -lt $wancount ]; do + group=$(query_config group $i) + ifname=$(query_config ifname $group) + ipaddr=$(query_config ipaddr $group) + gateway=$(query_config gateway $group) + + if [ "$ifname" == "x" -o "$ipaddr" == "x" -o "$gateway" == "x" ]; then + failover add $group + fi + done +} + +wancount=0 +max_interval=$(((1<<31) - 1)) + +config_clear +config_load "multiwan" +config_get_bool enabled config enabled '1' +[ "$enabled" -gt 0 ] || exit +config_get default_route config default_route +config_get health_monitor config health_monitor +config_get iptables_interval config iptables_interval '30' +config_get debug config debug + +[ "$health_monitor" = 'serial' ] || health_monitor='parallel' + +config_foreach acquire_wan_data interface + +update_cache + +CHKFORQOS=$(iptables -n -L Default -t mangle 2>&1 | grep "Chain Default") +CHKFORMODULE=$(iptables -m statistic 2>&1 | grep -o "File not found") + +jobfile="/tmp/.mwan/jobqueue" + +case $1 in + agent) silencer main_init;; + stop) silencer stop;; + restart) silencer stop restart;; + single) silencer stop single;; +esac diff --git a/net/mutella/Makefile b/net/mutella/Makefile new file mode 100644 index 0000000..d7a3502 --- /dev/null +++ b/net/mutella/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mutella +PKG_VERSION:=0.4.5 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=1a676eacf562e3b8de90493f99fe059c + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/mutella + SUBMENU:=P2P + SECTION:=net + CATEGORY:=Network + TITLE:=Gnutella client with command line and http interface + URL:=http://mutella.sourceforge.net/ + DEPENDS:=+libncurses +libreadline +libpthread +libstdcpp +zlib +endef + +define Package/mutella/description + Mutella supports all the functionality required to participate as + a full-featured node in the Gnutella network. "Full-featured" implies + support for file search, download and sharing. It is optimized for a + high-bandwidth connection, where it sets standards for server + performance and stability, but can also run on a modest-speed line. + . + Mutella can either be controlled via a colourful text mode interface + or via a web browser using a built in http interface. +endef + +CONFIGURE_VARS += \ + CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \ + +define Package/mutella/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mutella{,_sio} $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/mutella $(1)/usr/share/ +endef + +$(eval $(call BuildPackage,mutella)) + diff --git a/net/mutella/patches/001-no_backtrace.patch b/net/mutella/patches/001-no_backtrace.patch new file mode 100644 index 0000000..65021db --- /dev/null +++ b/net/mutella/patches/001-no_backtrace.patch @@ -0,0 +1,15 @@ +Index: mutella-0.4.5/mutella/main.cpp +=================================================================== +--- mutella-0.4.5.orig/mutella/main.cpp 2007-09-22 05:48:22.000000000 +0200 ++++ mutella-0.4.5/mutella/main.cpp 2007-09-22 05:48:22.000000000 +0200 +@@ -45,6 +45,10 @@ + #define HAVE_BACKTRACE + #endif + ++#ifdef __UCLIBC__ ++#undef HAVE_BACKTRACE ++#endif ++ + #ifdef HAVE_BACKTRACE + #include + #endif diff --git a/net/mutella/patches/002-gcc4_fixes.patch b/net/mutella/patches/002-gcc4_fixes.patch new file mode 100644 index 0000000..249d9c8 --- /dev/null +++ b/net/mutella/patches/002-gcc4_fixes.patch @@ -0,0 +1,12 @@ +Index: mutella-0.4.5/mutella/gnushare.h +=================================================================== +--- mutella-0.4.5.orig/mutella/gnushare.h 2007-09-22 05:48:21.000000000 +0200 ++++ mutella-0.4.5/mutella/gnushare.h 2007-09-22 05:48:27.000000000 +0200 +@@ -26,6 +26,7 @@ + #include "mthread.h" + + class MGnuDirector; ++class MShareThread; + + class MGnuShare + { diff --git a/net/mutella/patches/003-gcc4_3_fixes.patch b/net/mutella/patches/003-gcc4_3_fixes.patch new file mode 100644 index 0000000..f7be59d --- /dev/null +++ b/net/mutella/patches/003-gcc4_3_fixes.patch @@ -0,0 +1,34 @@ +diff --git a/mutella/common.h b/mutella/common.h +--- a/mutella/common.h ++++ b/mutella/common.h +@@ -50,7 +50,7 @@ CString restore_string(CString s, bool bFormMode = true); + bool QueryMatch(CString Result, const CString& Query); + // fast functions which do not copy the string + void MakeWordList(LPSTR szQuery, vector& QWords); +-void MakeWordList(LPSTR szQuery, vector& QWords, vector& QWords); ++void MakeWordList(LPSTR szQuery, vector& QWordsInc, vector&QWordsExc); + bool MatchWordList(const CString& ResultLower, const vector& QWords, bool bMatchAll = true); + + // slower but 'storage-independent' versions +diff --git a/mutella/mutella.h b/mutella/mutella.h +--- a/mutella/mutella.h ++++ b/mutella/mutella.h +@@ -79,6 +79,7 @@ using std::insert_iterator; + #include + #include + #include ++#include + + // library-type includes + #include "defines.h" +diff --git a/mutella/tstring.h b/mutella/tstring.h +--- a/mutella/tstring.h ++++ b/mutella/tstring.h +@@ -22,6 +22,7 @@ + #define __TSTRING_H__INCLUDED__ + + #include ++#include + #include + + #ifdef TSTRING_DEBUG diff --git a/net/mutella/patches/004-no-host-paths.patch b/net/mutella/patches/004-no-host-paths.patch new file mode 100644 index 0000000..c32e524 --- /dev/null +++ b/net/mutella/patches/004-no-host-paths.patch @@ -0,0 +1,58 @@ +--- a/mutella/Makefile.am ++++ b/mutella/Makefile.am +@@ -12,8 +12,8 @@ EXTRA_DIST = main.cpp common.cpp common. + ####### kdevelop will overwrite this part!!! (end)############ + + # set the include path found by configure +-INCLUDES= $(all_includes) -I$(includedir) ++INCLUDES= $(all_includes) + + # the library search path. +-mutella_LDFLAGS = $(all_libraries) -L$(libdir) ++mutella_LDFLAGS = $(all_libraries) + +--- a/mutella/Makefile.in ++++ b/mutella/Makefile.in +@@ -221,10 +221,10 @@ EXTRA_DIST = main.cpp common.cpp common. + ####### kdevelop will overwrite this part!!! (end)############ + + # set the include path found by configure +-INCLUDES = $(all_includes) -I$(includedir) ++INCLUDES = $(all_includes) + + # the library search path. +-mutella_LDFLAGS = $(all_libraries) -L$(libdir) ++mutella_LDFLAGS = $(all_libraries) + all: all-recursive + + .SUFFIXES: +--- a/util/Makefile.am ++++ b/util/Makefile.am +@@ -9,10 +9,10 @@ bin_PROGRAMS = mutella_sio + mutella_sio_SOURCES = sockio.c + + # set the include path found by configure +-INCLUDES= $(all_includes) -I$(includedir) ++INCLUDES= $(all_includes) + + # the library search path. +-mutella_sio_LDFLAGS = $(all_libraries) -L$(libdir) ++mutella_sio_LDFLAGS = $(all_libraries) + + + +--- a/util/Makefile.in ++++ b/util/Makefile.in +@@ -166,10 +166,10 @@ EXTRA_DIST = sockio.c + mutella_sio_SOURCES = sockio.c + + # set the include path found by configure +-INCLUDES = $(all_includes) -I$(includedir) ++INCLUDES = $(all_includes) + + # the library search path. +-mutella_sio_LDFLAGS = $(all_libraries) -L$(libdir) ++mutella_sio_LDFLAGS = $(all_libraries) + all: all-am + + .SUFFIXES: diff --git a/net/mvprelay/Makefile b/net/mvprelay/Makefile new file mode 100644 index 0000000..432e7ff --- /dev/null +++ b/net/mvprelay/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2007 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:=mvprelay +PKG_VERSION:=0.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/ +PKG_MD5SUM:=189fb792470c966834d5204705ebee83 + +include $(INCLUDE_DIR)/package.mk + +define Package/mvprelay + SECTION:=net + CATEGORY:=Network + TITLE:=relays requests from the MVP + URL:=http://mvpmc.wikispaces.com/mvprelay +endef + +define Package/mvprelay/description + Relays requests from the MediaMVP to the TFTP server +endef + +define Build/Configure +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) $(PKG_BUILD_DIR)/$(PKG_NAME).c -o $(PKG_BUILD_DIR)/$(PKG_NAME) +endef + +define Package/mvprelay/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,mvprelay)) diff --git a/net/n2n/Makefile b/net/n2n/Makefile new file mode 100644 index 0000000..1925dc8 --- /dev/null +++ b/net/n2n/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2007-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_BRANCH:=trunk +PKG_SOURCE_URL:=https://svn.ntop.org/svn/ntop/trunk/n2n +PKG_REV:=3875 + +PKG_NAME:=n2n +PKG_VERSION:=$(PKG_REV) +PKG_RELEASE:=4 + +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +PKG_SOURCE_PROTO:=svn +PKG_SOURCE_VERSION:=$(PKG_REV) + +include $(INCLUDE_DIR)/package.mk + +define Package/n2n + SECTION:=net + CATEGORY:=Network + TITLE:=VPN tunneling daemon + URL:=http://www.ntop.org/n2n/ + SUBMENU:=VPN + DEPENDS:=+libpthread +kmod-tun +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + INSTALL_PROG=":" +endef + +define Package/n2n/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/edge $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/supernode $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/n2n.config $(1)/etc/config/n2n + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/n2n.init $(1)/etc/init.d/n2n +endef + +define Package/n2n/conffiles +/etc/config/n2n +endef + +$(eval $(call BuildPackage,n2n)) diff --git a/net/n2n/files/n2n.config b/net/n2n/files/n2n.config new file mode 100644 index 0000000..bf4acfe --- /dev/null +++ b/net/n2n/files/n2n.config @@ -0,0 +1,7 @@ +config edge + option ipaddr '' + option supernode '' + option port '' + option community '' + option key '' + option route '' diff --git a/net/n2n/files/n2n.init b/net/n2n/files/n2n.init new file mode 100644 index 0000000..2454de2 --- /dev/null +++ b/net/n2n/files/n2n.init @@ -0,0 +1,56 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2012 OpenWrt.org + +START=90 + +start_instance() { + local cfg="$1" + + config_get type "$cfg" TYPE + + case "$type" in + edge) + config_get ipaddr "$cfg" 'ipaddr' + [ -n "$ipaddr" ] || return 1 + config_get supernode "$cfg" 'supernode' + config_get port "$cfg" 'port' + config_get community "$cfg" 'community' + config_get key "$cfg" 'key' + config_get_bool route "$cfg" 'route' '0' + [ "$route" = "1" ] && args='-r' + service_start /usr/sbin/edge -f $args -a $ipaddr -c $community -k $key -l ${supernode}:${port} + ;; + supernode) + config_get port "$cfg" port + [ -n "$port" ] || return 1 + service_start /usr/sbin/supernode -l $port + ;; + esac +} + +stop_instance() { + local cfg="$1" + + config_get type "$cfg" TYPE + + case "$type" in + edge) + service_stop /usr/sbin/edge + ;; + supernode) + service_stop /usr/sbin/supernode + ;; + esac +} + +start() { + config_load 'n2n' + config_foreach start_instance 'edge' + config_foreach start_instance 'supernode' +} + +stop() { + config_load 'n2n' + config_foreach stop_instance 'edge' + config_foreach stop_instance 'supernode' +} diff --git a/net/natpmp/Makefile b/net/natpmp/Makefile new file mode 100644 index 0000000..c936359 --- /dev/null +++ b/net/natpmp/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2007-2012 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:=natpmp +PKG_VERSION:=0.2.3 +PKG_RELEASE:=5 + +PKG_SOURCE_URL:=http://download.savannah.nongnu.org/releases/natpmp/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=f696565d59c488b9ad9f43625be93377 + +include $(INCLUDE_DIR)/package.mk + +define Package/natpmp + SECTION:=net + CATEGORY:=Network + DEPENDS:=+ip + SUBMENU:=Firewall + TITLE:=A daemon implementing NAT-PMP + URL:=http://savannah.nongnu.org/projects/natpmp +endef + +define Package/natpmp/description + This is a daemon implementing NAT-PMP. NAT-PMP is a protocol for + handling port forwarding requests from clients behind a NAT. +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CC="$(TARGET_CC)" \ + LD="$(TARGET_CC)" \ + CFLAGS="$(strip $(TARGET_CFLAGS))" \ + CPPFLAGS="$$$$CPPFLAGS $(TARGET_CPPFLAGS) -DIPTABLES_PATH=\\\"/usr/sbin\\\"" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + prefix="$(PKG_INSTALL_DIR)/usr" +endef + +define Package/natpmp/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/natpmp $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/natpmp.config $(1)/etc/config/natpmp + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/natpmp.init $(1)/etc/init.d/natpmp +endef + +define Package/natpmp/conffiles +/etc/config/natpmp +endef + +$(eval $(call BuildPackage,natpmp)) diff --git a/net/natpmp/files/natpmp.config b/net/natpmp/files/natpmp.config new file mode 100644 index 0000000..9239d56 --- /dev/null +++ b/net/natpmp/files/natpmp.config @@ -0,0 +1,4 @@ +config natpmp + option outbound_interface wan + option inbound_interfaces lan + option iptables_chain natpmp diff --git a/net/natpmp/files/natpmp.init b/net/natpmp/files/natpmp.init new file mode 100644 index 0000000..374e364 --- /dev/null +++ b/net/natpmp/files/natpmp.init @@ -0,0 +1,76 @@ +#!/bin/sh /etc/rc.common + +START=70 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +IP=$(which ip) +IPTABLES=$(which iptables) +NATPMP=/usr/sbin/natpmp +PIDFILE=/var/run/natpmp.pid + +natpmp_config() { + local cfg="$1" + + config_get PUBLIC_IF "$cfg" outbound_interface + config_get PRIVATE_IFS "$cfg" inbound_interfaces + config_get IPTABLES_CHAIN "$cfg" iptables_chain +} + +start() { + config_load natpmp + config_foreach natpmp_config natpmp + + . /lib/functions/network.sh + + # Flush all the rules in the natpmp chain, or create it, if it doesn't exists. + $IPTABLES -t nat -F $IPTABLES_CHAIN 2>/dev/null || \ + $IPTABLES -t nat -N $IPTABLES_CHAIN + + # Handle all incoming connections in the natpmp chain. + $IPTABLES -t nat -D PREROUTING -j $IPTABLES_CHAIN 2>/dev/null || true + $IPTABLES -t nat -A PREROUTING -j $IPTABLES_CHAIN + + # Iterate through the private interfaces. + BIND_ARGS="" + for IF in $PRIVATE_IFS; do + local dev + network_get_device dev "$IF" || dev="$IF" + + # Get the IP address of this interface. + ADDR=`$IP addr show dev $dev 2>/dev/null | grep "^ *inet .* $dev\$" | cut -d " " -f 6 | cut -d / -f 1` + if [ -n "$ADDR" ] ; then + # Add the IP address to the argument list. + BIND_ARGS="$BIND_ARGS -a $ADDR" + else + echo "Could not get IP address of interface $dev. Skipping." >&2 + fi + done + + if [ -z "$BIND_ARGS" ] ; then + echo "No IP addresses to bind to. Exiting." >&2 + exit 1 + fi + + local pubdev + network_get_device pubdev "$PUBLIC_IF" || pubdev="$PUBLIC_IF" + + SERVICE_PID_FILE="$PIDFILE" + service_start $NATPMP -i "$pubdev" $BIND_ARGS -- "$IPTABLES_CHAIN" +} + +stop() { + config_load natpmp + config_foreach natpmp_config natpmp + + # Unlink chain + $IPTABLES -t nat -D PREROUTING -j $IPTABLES_CHAIN 2>/dev/null || true + + # Flush all the rules in the natpmp chain + $IPTABLES -t nat -F $IPTABLES_CHAIN 2>/dev/null && \ + $IPTABLES -t nat -X $IPTABLES_CHAIN + + SERVICE_PID_FILE="$PIDFILE" + service_stop $NATPMP +} diff --git a/net/nbd/Makefile b/net/nbd/Makefile new file mode 100644 index 0000000..ea63cc8 --- /dev/null +++ b/net/nbd/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2006-2011 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:=nbd +PKG_VERSION:=2.9.23 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/nbd +PKG_MD5SUM:=065b6ded41887a08be6dbb8d77280f24 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +# -liconv due to glib2, to be revisited later +include $(INCLUDE_DIR)/nls.mk + +PKG_BUILD_DEPENDS:=glib2 libintl + +define Package/nbd + SECTION:=net + CATEGORY:=Network + TITLE:=Network Block Device utilities + URL:=http://nbd.sourceforge.net + DEPENDS:=+kmod-nbd +endef + +define Package/nbd/description + This package contains the network block device client. +endef + +CONFIGURE_ARGS+= \ + --disable-glibtest + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + nbd-client +endef + +define Package/nbd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nbd-client $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,nbd)) diff --git a/net/nbtscan/Makefile b/net/nbtscan/Makefile new file mode 100644 index 0000000..b930f9d --- /dev/null +++ b/net/nbtscan/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2008 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:=nbtscan +PKG_VERSION:=1.5.1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/n/nbtscan/ +PKG_MD5SUM:=85bb085077c380b82a6ff73e0de0c154 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)a + +include $(INCLUDE_DIR)/package.mk + +define Package/nbtscan + SECTION:=net + CATEGORY:=Network + TITLE:=NBTscan is a program for scanning IP networks for NetBIOS name information + URL:=http://www.inetcat.net/software/nbtscan.html +endef + +define Package/nbtscan/description + NBTscan is a program for scanning IP networks for NetBIOS name information. + It sends NetBIOS status query to each address in supplied range and lists + received information in human readable form. For each responded host it lists + IP address, NetBIOS computer name, logged-in user name and MAC address. +endef + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" +endef + + +define Package/nbtscan/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/nbtscan $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,nbtscan)) diff --git a/net/ncftp/Makefile b/net/ncftp/Makefile new file mode 100644 index 0000000..053ab7f --- /dev/null +++ b/net/ncftp/Makefile @@ -0,0 +1,68 @@ +# +# Copyright (C) 2010-2011 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:=ncftp +PKG_VERSION:=3.2.5 +PKG_RELEASE:=1 + +PKG_INSTALL:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.ncftp.com/ncftp +PKG_MD5SUM:=b05c7a6d5269c04891f02f43d4312b30 + +include $(INCLUDE_DIR)/package.mk + +define Package/ncftp/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=File Transfer + TITLE:=NcFTP Client + URL:=http://www.ncftpd.com/ +endef + +define Package/ncftp/Default/description + NcFTP Client (also known as just NcFTP) is a set of FREE application + programs implementing the File Transfer Protocol (FTP). +endef + +define Package/ncftp +$(call Package/ncftp/Default) + TITLE+= (main program) +endef + +define Package/ncftp/description +$(call Package/ncftp/Default/description) + Main program. +endef + +define Package/ncftp-utils +$(call Package/ncftp/Default) + TITLE+= (utilities) +endef + +define Package/ncftp-utils/description +$(call Package/ncftp/Default/description) + Utilities. +endef + +define Package/ncftp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ncftp $(1)/usr/bin/ +endef + +define Package/ncftp-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/ncftp{batch,get,ls,put,spooler} \ + $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,ncftp)) +$(eval $(call BuildPackage,ncftp-utils)) diff --git a/net/ndyndns/Makefile b/net/ndyndns/Makefile new file mode 100644 index 0000000..180d7d2 --- /dev/null +++ b/net/ndyndns/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2008-2012 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:=ndyndns +PKG_VERSION:=2.1 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://ndyndns.googlecode.com/files +PKG_MD5SUM:=0cdb4dcba5f8c1664f53884b3c2179e9 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +MAKE_FLAGS:=PLATFORM=linux + +define Package/ndyndns + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=DynDNS.com update daemon + URL:=http://ndyndns.googlecode.com/ + DEPENDS:=+libcurl +libopenssl +endef + +define Package/ndyndns/description + The ndyndns daemon is an update client for DynDNS.com. It + checks for an IP address change every two minutes, avoids + unnecessary updates, reports errors, logs to syslog, and + generally complies with everything required of a proper dyndns + client. +endef + +define Package/ndyndns/conffiles +/etc/ndyndns/ndyndns.conf.sample +endef + +define Package/ndyndns/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ndyndns $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) files/ndyndns.init $(1)/etc/init.d/ndyndns + $(INSTALL_DIR) $(1)/etc/ndyndns + $(INSTALL_CONF) files/ndyndns.conf.sample $(1)/etc/ndyndns +endef + +$(eval $(call BuildPackage,ndyndns)) diff --git a/net/ndyndns/files/ndyndns.conf.sample b/net/ndyndns/files/ndyndns.conf.sample new file mode 100644 index 0000000..eedd341 --- /dev/null +++ b/net/ndyndns/files/ndyndns.conf.sample @@ -0,0 +1,7 @@ +[config] + +[dyndns] +username = user +password = password +hosts = hostname.dyndns.org +wildcard diff --git a/net/ndyndns/files/ndyndns.init b/net/ndyndns/files/ndyndns.init new file mode 100644 index 0000000..0ef1ccd --- /dev/null +++ b/net/ndyndns/files/ndyndns.init @@ -0,0 +1,21 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2012 OpenWrt.org + +START=80 + +start() { + . /lib/functions/network.sh + + [ -f /etc/ndyndns/ndyndns.conf ] || { + echo "$0: missing config file '/etc/ndyndns/ndyndns.conf'" 1>&2 + return 1 + } + + local device + network_get_device device wan && \ + service_start /usr/sbin/ndyndns -c /etc/ndyndns -f /etc/ndyndns/ndyndns.conf -i $device +} + +stop() { + service_stop /usr/sbin/ndyndns +} diff --git a/net/ndyndns/patches/010-dont-add-host-includes.patch b/net/ndyndns/patches/010-dont-add-host-includes.patch new file mode 100644 index 0000000..a28dc4a --- /dev/null +++ b/net/ndyndns/patches/010-dont-add-host-includes.patch @@ -0,0 +1,24 @@ +diff -urN ndyndns-2.1.orig/configure ndyndns-2.1/configure +--- ndyndns-2.1.orig/configure 2010-07-17 13:22:39.000000000 +0200 ++++ ndyndns-2.1/configure 2011-01-26 16:24:15.834445729 +0100 +@@ -3318,7 +3318,7 @@ + fi + + +-CURLINC=-I`curl-config --prefix`/include ++CURLINC=-I`curl-config --cflags` + + CURLLIB=`curl-config --libs` + +diff -urN ndyndns-2.1.orig/configure.in ndyndns-2.1/configure.in +--- ndyndns-2.1.orig/configure.in 2010-07-17 13:22:11.000000000 +0200 ++++ ndyndns-2.1/configure.in 2011-01-26 16:24:14.090441650 +0100 +@@ -24,7 +24,7 @@ + fi + AC_SUBST(PLATFORM) + +-CURLINC=-I`curl-config --prefix`/include ++CURLINC=-I`curl-config --cflags` + AC_SUBST(CURLINC) + CURLLIB=`curl-config --libs` + AC_SUBST(CURLLIB) diff --git a/net/ndyndns/patches/020-ndyndns.patch b/net/ndyndns/patches/020-ndyndns.patch new file mode 100644 index 0000000..00f3f57 --- /dev/null +++ b/net/ndyndns/patches/020-ndyndns.patch @@ -0,0 +1,211 @@ +diff -urN ndyndns-2.1.orig/cfg.c ndyndns-2.1/cfg.c +--- ndyndns-2.1.orig/cfg.c 2011-01-26 17:02:05.762443700 +0100 ++++ ndyndns-2.1/cfg.c 2011-01-26 17:03:43.334443683 +0100 +@@ -804,34 +804,6 @@ + continue; + } + +- tmp = parse_line_string(point, "user"); +- if (tmp) { +- switch (prs) { +- default: +- parse_warn(lnum, "user"); +- break; +- case PRS_CONFIG: +- cfg_set_user(tmp); +- break; +- } +- free(tmp); +- continue; +- } +- +- tmp = parse_line_string(point, "group"); +- if (tmp) { +- switch (prs) { +- default: +- parse_warn(lnum, "group"); +- break; +- case PRS_CONFIG: +- cfg_set_group(tmp); +- break; +- } +- free(tmp); +- continue; +- } +- + tmp = parse_line_string(point, "interface"); + if (tmp) { + switch (prs) { +diff -urN ndyndns-2.1.orig/chroot.c ndyndns-2.1/chroot.c +--- ndyndns-2.1.orig/chroot.c 2011-01-26 17:02:05.762443700 +0100 ++++ ndyndns-2.1/chroot.c 2011-01-26 17:03:54.470442525 +0100 +@@ -19,8 +19,6 @@ + #include + #include + #include +-#include +-#include + + #include "defines.h" + #include "log.h" +@@ -82,32 +80,3 @@ + } + } + } +- +-void drop_root(uid_t uid, gid_t gid) +-{ +- if (uid == 0 || gid == 0) { +- log_line("FATAL - drop_root: attempt to drop root to root?\n"); +- exit(EXIT_FAILURE); +- } +- +- if (getgid() == 0) { +- if (setregid(gid, gid) == -1) { +- log_line("FATAL - drop_root: failed to drop real gid == root!\n"); +- exit(EXIT_FAILURE); +- } +- } +- +- if (getuid() == 0) { +- if (setreuid(uid, uid) == -1) { +- log_line("FATAL - drop_root: failed to drop real uid == root!\n"); +- exit(EXIT_FAILURE); +- } +- } +- +- /* be absolutely sure */ +- if (getgid() == 0 || getuid() == 0) { +- log_line("FATAL - drop_root: tried to drop root, but still have root!\n"); +- exit(EXIT_FAILURE); +- } +-} +- +diff -urN ndyndns-2.1.orig/Makefile.in ndyndns-2.1/Makefile.in +--- ndyndns-2.1.orig/Makefile.in 2011-01-26 17:02:05.766443748 +0100 ++++ ndyndns-2.1/Makefile.in 2011-01-26 17:03:43.338443633 +0100 +@@ -1,11 +1,9 @@ + #CC = gcc -Wall -Wpointer-arith -Wstrict-prototypes -pedantic + CC = @CC@ +-dnslib = -lnss_dns + objects = log.o nstrl.o util.o chroot.o pidfile.o signals.o strlist.o checkip.o $(PLATFORM).o cfg.o ndyndns.o +-CURLINC = @CURLINC@ + CURLLIB = @CURLLIB@ + VERSION = @VERSION@ +-CFLAGS = @CFLAGS@ -Wall -Wextra -pedantic $(CURLINC) ++CFLAGS += -Wall -Wpointer-arith -Wstrict-prototypes -pedantic + PLATFORM = @PLATFORM@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ +@@ -16,7 +14,7 @@ + all: ndyndns + + ndyndns : $(objects) +- $(CC) $(LDFLAGS) $(dnslib) $(CURLLIB) -o ndyndns $(objects) ++ $(CC) $(LDFLAGS) $(CURLLIB) -o ndyndns $(objects) + + ndyndns.o : log.h nstrl.h util.h chroot.h pidfile.h signals.h strlist.h checkip.h $(PLATFORM).h cfg.h + $(CC) $(CFLAGS) -c -o $@ ndyndns.c +diff -urN ndyndns-2.1.orig/ndyndns.c ndyndns-2.1/ndyndns.c +--- ndyndns-2.1.orig/ndyndns.c 2011-01-26 17:02:05.766443748 +0100 ++++ ndyndns-2.1/ndyndns.c 2011-01-26 17:04:15.526443092 +0100 +@@ -32,8 +32,6 @@ + #include + #include + #include +-#include +-#include + + #include + #include +@@ -897,40 +895,6 @@ + strlcpy(pidfile, pidfname, sizeof pidfile); + } + +-void cfg_set_user(char *username) +-{ +- int t; +- char *p; +- struct passwd *pws; +- +- t = (unsigned int) strtol(username, &p, 10); +- if (*p != '\0') { +- pws = getpwnam(username); +- if (pws) { +- cfg_uid = (int)pws->pw_uid; +- if (!cfg_gid) +- cfg_gid = (int)pws->pw_gid; +- } else suicide("FATAL - Invalid uid specified.\n"); +- } else +- cfg_uid = t; +-} +- +-void cfg_set_group(char *groupname) +-{ +- int t; +- char *p; +- struct group *grp; +- +- t = (unsigned int) strtol(groupname, &p, 10); +- if (*p != '\0') { +- grp = getgrnam(groupname); +- if (grp) { +- cfg_gid = (int)grp->gr_gid; +- } else suicide("FATAL - Invalid gid specified.\n"); +- } else +- cfg_gid = t; +-} +- + void cfg_set_interface(char *interface) + { + strlcpy(ifname, interface, sizeof ifname); +@@ -954,8 +918,6 @@ + {"disable-chroot", 0, 0, 'x'}, + {"file", 1, 0, 'f'}, + {"cfg-stdin", 0, 0, 'F'}, +- {"user", 1, 0, 'u'}, +- {"group", 1, 0, 'g'}, + {"interface", 1, 0, 'i'}, + {"remote", 0, 0, 'r'}, + {"help", 0, 0, 'h'}, +@@ -963,7 +925,7 @@ + {0, 0, 0, 0} + }; + +- c = getopt_long(argc, argv, "rdnp:qc:xf:Fu:g:i:hv", long_options, &option_index); ++ c = getopt_long(argc, argv, "rdnp:qc:xf:i:hv", long_options, &option_index); + if (c == -1) break; + + switch (c) { +@@ -983,8 +945,6 @@ + " -F, --cfg-stdin read configuration file from standard input\n" + " -p, --pidfile pidfile path\n"); + printf( +- " -u, --user user name that ndyndns should run as\n" +- " -g, --group group name that ndyndns should run as\n" + " -i, --interface interface ip to check (default: ppp0)\n" + " -r, --remote get ip from remote dyndns host (overrides -i)\n" + " -h, --help print this help and exit\n" +@@ -1060,14 +1020,6 @@ + cfg_set_pidfile(optarg); + break; + +- case 'u': +- cfg_set_user(optarg); +- break; +- +- case 'g': +- cfg_set_group(optarg); +- break; +- + case 'i': + cfg_set_interface(optarg); + break; +@@ -1095,7 +1047,6 @@ + + /* Note that failure cases are handled by called fns. */ + imprison(get_chroot()); +- drop_root(cfg_uid, cfg_gid); + + /* Cover our tracks... */ + wipe_chroot(); diff --git a/net/net-snmp/Makefile b/net/net-snmp/Makefile new file mode 100644 index 0000000..8fd1c4f --- /dev/null +++ b/net/net-snmp/Makefile @@ -0,0 +1,262 @@ +# +# Copyright (C) 2006-2012 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:=net-snmp +PKG_VERSION:=5.4.2.1 +PKG_RELEASE:=5 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/net-snmp +PKG_MD5SUM:=984932520143f0c8bf7b7ce1fc9e1da1 + +PKG_FIXUP = patch-libtool + +include $(INCLUDE_DIR)/package.mk + +define Package/net-snmp/Default + SECTION:=net + CATEGORY:=Network + URL:=http://www.net-snmp.org/ +endef + +define Package/net-snmp/Default/description + Simple Network Management Protocol (SNMP) is a widely used protocol for + monitoring the health and welfare of network equipment (eg. routers), + computer equipment and even devices like UPSs. Net-SNMP is a suite of + applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both + IPv4 and IPv6. +endef + + +define Package/libnetsnmp +$(call Package/net-snmp/Default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libelf + TITLE:=Open source SNMP implementation (libraries) +endef + +define Package/libnetsnmp/description +$(call Package/net-snmp/Default/description) + . + This package contains shared libraries, needed by other programs. +endef + + +define Package/snmp-utils +$(call Package/net-snmp/Default) + DEPENDS:=+libnetsnmp + TITLE:=Open source SNMP implementation (utilities) +endef + +define Package/snmp-utils/description +$(call Package/net-snmp/Default/description) + . + This package contains SNMP client utilities. +endef + + +define Package/snmpd +$(call Package/net-snmp/Default) + DEPENDS:=+libnetsnmp + TITLE:=Open source SNMP implementation (daemon) +endef + +define Package/snmpd/description +$(call Package/net-snmp/Default/description) + . + This package contains the SNMP agent, dynamically linked. +endef + + +define Package/snmpd-static +$(call Package/net-snmp/Default) + TITLE:=Open source SNMP implementation (daemon) + DEPENDS:=+libelf +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 = \ + host/hr_device \ + host/hr_disk \ + host/hr_filesys \ + host/hr_network \ + host/hr_partition \ + host/hr_proc \ + host/hr_storage \ + host/hr_system \ + ieee802dot11 \ + if-mib/ifXTable \ + mibII/at \ + mibII/icmp \ + mibII/ifTable \ + mibII/ip \ + mibII/snmp_mib \ + mibII/sysORTable \ + mibII/system_mib \ + mibII/tcp \ + mibII/udp \ + mibII/vacm_context \ + mibII/vacm_vars \ + snmpv3/snmpEngine \ + snmpv3/snmpMPDStats \ + snmpv3/usmConf \ + snmpv3/usmStats \ + snmpv3/usmUser \ + tunnel \ + ucd-snmp/disk \ + ucd-snmp/dlmod \ + ucd-snmp/extensible \ + ucd-snmp/loadave \ + ucd-snmp/memory \ + ucd-snmp/pass \ + ucd-snmp/proc \ + ucd-snmp/vmstat \ + util_funcs \ + utilities/execute \ + +SNMP_MIB_MODULES_EXCLUDED = \ + agent_mibs \ + agentx \ + disman/event \ + disman/schedule \ + hardware \ + host \ + if-mib \ + mibII \ + notification \ + notification-log-mib \ + snmpv3mibs \ + target \ + tcp-mib \ + ucd_snmp \ + udp-mib \ + utilities \ + +SNMP_TRANSPORTS_INCLUDED = Callback UDP + +SNMP_TRANSPORTS_EXCLUDED = TCP TCPIPv6 Unix + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-mfd-rewrites \ + --enable-shared \ + --enable-static \ + --with-endianness=little \ + --with-logfile=/var/log/snmpd.log \ + --with-persistent-directory=/usr/lib/snmp/ \ + --with-default-snmp-version=1 \ + --with-sys-contact=root@localhost \ + --with-sys-location=Unknown \ + --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)" \ + --with-out-transports="$(SNMP_TRANSPORTS_EXCLUDED)" \ + --with-transports="$(SNMP_TRANSPORTS_INCLUDED)" \ + --without-openssl \ + --without-libwrap \ + --without-rpm \ + --without-zlib \ + $(call autoconf_bool,CONFIG_IPV6,ipv6) \ + +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 + $(INSTALL_DIR) $(2)/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(2)/bin/ + $(SED) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin/net-snmp-config + + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/net-snmp $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} $(1)/usr/lib/ +endef + +define Package/libnetsnmp/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(1)/usr/lib/ +endef + +define Package/snmpd/conffiles +/etc/default/snmpd +/etc/config/snmpd +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/default + $(INSTALL_DATA) ./files/snmpd.default $(1)/etc/default/snmpd + $(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 +endef + +define Package/snmpd-static/conffiles +/etc/default/snmpd +/etc/config/snmpd +endef + +define Package/snmpd-static/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/default + $(INSTALL_DATA) ./files/snmpd.default $(1)/etc/default/snmpd + $(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/ +endef + +$(eval $(call BuildPackage,libnetsnmp)) +$(eval $(call BuildPackage,snmp-utils)) +$(eval $(call BuildPackage,snmpd)) +$(eval $(call BuildPackage,snmpd-static)) diff --git a/net/net-snmp/files/snmpd.conf b/net/net-snmp/files/snmpd.conf new file mode 100644 index 0000000..4bdc3d4 --- /dev/null +++ b/net/net-snmp/files/snmpd.conf @@ -0,0 +1,82 @@ +config agent + option agentaddress UDP:161 + +config com2sec public + option secname ro + option source default + option community public + +config com2sec private + option secname rw + option source localhost + option community private + +config group public_v1 + option group public + option version v1 + option secname ro + +config group public_v2c + option group public + option version v2c + option secname ro + +config group public_usm + option group public + option version usm + option secname ro + +config group private_v1 + option group private + option version v1 + option secname rw + +config group private_v2c + option group private + option version v2c + option secname rw + +config group private_usm + option group private + option version usm + option secname rw + +config view all + option viewname all + option type included + option oid .1 + +config access public_access + option group public + option context none + option version any + option level noauth + option prefix exact + option read all + option write none + option notify none + +config access private_access + option group private + option context none + option version any + option level noauth + option prefix exact + option read all + option write all + option notify all + +config system + option sysLocation 'office' + option sysContact 'bofh@example.com' + option sysName 'HeartOfGold' +# option sysServices 72 +# option sysDescr 'adult playground' +# option sysObjectID '1.2.3.4' + +config exec + option name filedescriptors + option prog /bin/cat + option args /proc/sys/fs/file-nr +# option miboid 1.2.3.4 + diff --git a/net/net-snmp/files/snmpd.default b/net/net-snmp/files/snmpd.default new file mode 100644 index 0000000..758c8e4 --- /dev/null +++ b/net/net-snmp/files/snmpd.default @@ -0,0 +1 @@ +OPTIONS="-Lf /dev/null -p /var/run/snmpd.pid" diff --git a/net/net-snmp/files/snmpd.init b/net/net-snmp/files/snmpd.init new file mode 100644 index 0000000..770961e --- /dev/null +++ b/net/net-snmp/files/snmpd.init @@ -0,0 +1,135 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008 OpenWrt.org +START=50 + +DEFAULT=/etc/default/snmpd +LIB_D=/var/lib/snmp +LOG_D=/var/log +RUN_D=/var/run +PID_F=$RUN_D/snmpd.pid +RUN_C=$RUN_D/snmpd.conf + +snmpd_agent_add() { + local cfg="$1" + + config_get agentaddress "$cfg" agentaddress + [ -n "$agentaddress" ] || return 0 + echo "agentaddress $agentaddress" >> $RUN_C +} +snmpd_system_add() { + local cfg="$1" + config_get syslocation "$cfg" sysLocation + [ -n "$syslocation" ] && echo "sysLocation $syslocation" >> $RUN_C + config_get syscontact "$cfg" sysContact + [ -n "$syscontact" ] && echo "sysContact $syscontact" >> $RUN_C + config_get sysname "$cfg" sysName + [ -n "$sysname" ] && echo "sysName $sysname" >> $RUN_C + config_get sysservice "$cfg" sysService + [ -n "$sysservice" ] && echo "sysService $sysservice" >> $RUN_C + config_get sysdescr "$cfg" sysDescr + [ -n "$sysdescr" ] && echo "sysDescr $sysdescr" >> $RUN_C + config_get sysobjectid "$cfg" sysObjectID + [ -n "$sysobjectid" ] && echo "sysObjectID $sysobjectid" >> $RUN_C +} +snmpd_com2sec_add() { + local cfg="$1" + config_get secname "$cfg" secname + [ -n "$secname" ] || return 0 + config_get source "$cfg" source + [ -n "$source" ] || return 0 + config_get community "$cfg" community + [ -n "$community" ] || return 0 + echo "com2sec $secname $source $community" >> $RUN_C +} +snmpd_group_add() { + local cfg="$1" + config_get group "$cfg" group + [ -n "$group" ] || return 0 + config_get version "$cfg" version + [ -n "$version" ] || return 0 + config_get secname "$cfg" secname + [ -n "$secname" ] || return 0 + echo "group $group $version $secname" >> $RUN_C +} +snmpd_view_add() { + local cfg="$1" + config_get viewname "$cfg" viewname + [ -n "$viewname" ] || return 0 + config_get type "$cfg" type + [ -n "$type" ] || return 0 + config_get oid "$cfg" oid + [ -n "$oid" ] || return 0 + # optional mask + config_get mask "$cfg" mask + echo "view $viewname $type $oid $mask" >> $RUN_C +} +snmpd_access_add() { + local cfg="$1" + config_get group "$cfg" group + [ -n "$group" ] || return 0 + config_get context "$cfg" context + [ -n $context ] || return 0 + [ "$context" == "none" ] && context='""' + config_get version "$cfg" version + [ -n "$version" ] || return 0 + config_get level "$cfg" level + [ -n "$level" ] || return 0 + config_get prefix "$cfg" prefix + [ -n "$prefix" ] || return 0 + config_get read "$cfg" read + [ -n "$read" ] || return 0 + config_get write "$cfg" write + [ -n "$write" ] || return 0 + config_get notify "$cfg" notify + [ -n "$notify" ] || return 0 + echo "access $group $context $version $level $prefix $read $write $notify" >> $RUN_C +} +snmpd_pass_add() { + local cfg="$1" + local pass='pass' + + config_get miboid "$cfg" miboid + [ -n "$miboid" ] || return 0 + config_get prog "$cfg" prog + [ -n "$prog" ] || return 0 + config_get_bool persist "$cfg" persist 0 + [ $persist -ne 0 ] && pass='pass_persist' + config_get priority "$cfg" priority + priority=${priority:+-p $priority} + echo "$pass $priority $miboid $prog" >> $RUN_C +} +snmpd_exec_add() { + local cfg="$1" + + config_get name "$cfg" name + [ -n "$name" ] || return 0 + config_get prog "$cfg" prog + [ -n "$prog" ] || return 0 + config_get args "$cfg" args + config_get miboid "$cfg" miboid + echo "exec $miboid $name $prog $args" >> $RUN_C +} +start() { + [ -d $LIB_D ] || mkdir -p $LIB_D + [ -d $LOG_D ] || mkdir -p $LOG_D + [ -d $RUN_D ] || mkdir -p $RUN_D + [ -f $RUN_C ] && rm -f $RUN_C + + config_load snmpd + + config_foreach snmpd_agent_add agent + config_foreach snmpd_system_add system + config_foreach snmpd_com2sec_add com2sec + config_foreach snmpd_group_add group + config_foreach snmpd_view_add view + config_foreach snmpd_access_add access + config_foreach snmpd_pass_add pass + config_foreach snmpd_exec_add exec + + [ -f $DEFAULT ] && . $DEFAULT + $DEBUG /usr/sbin/snmpd $OPTIONS +} +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) + [ -f $RUN_C ] && rm -f $RUN_C +} diff --git a/net/net-snmp/patches/100-debian-statistics.patch b/net/net-snmp/patches/100-debian-statistics.patch new file mode 100644 index 0000000..af4d27a --- /dev/null +++ b/net/net-snmp/patches/100-debian-statistics.patch @@ -0,0 +1,22 @@ +--- a/agent/mibgroup/mibII/interfaces.c ++++ b/agent/mibgroup/mibII/interfaces.c +@@ -1550,6 +1550,10 @@ Interface_Scan_Init(void) + struct ifnet *nnew; + char *stats, *ifstart = line; + ++ /* Ignore interfaces with no statistics. */ ++ if (strstr(line, "No statistics available.")) ++ continue; ++ + if (line[strlen(line) - 1] == '\n') + line[strlen(line) - 1] = '\0'; + +@@ -1583,7 +1587,7 @@ Interface_Scan_Init(void) + &coll) != 5)) { + if ((scan_line_to_use == scan_line_2_2) + && !strstr(line, "No statistics available")) +- snmp_log(LOG_ERR, ++ snmp_log(LOG_DEBUG, + "/proc/net/dev data format error, line ==|%s|", + line); + continue; diff --git a/net/net-snmp/patches/110-debian-makefiles.patch b/net/net-snmp/patches/110-debian-makefiles.patch new file mode 100644 index 0000000..5ce771c --- /dev/null +++ b/net/net-snmp/patches/110-debian-makefiles.patch @@ -0,0 +1,40 @@ +--- a/local/Makefile.in ++++ b/local/Makefile.in +@@ -100,7 +100,7 @@ tkmib.made: $(srcdir)/tkmib + + mib2c.made: $(srcdir)/mib2c + if test "x$(PERL)" != "x" ; then \ +- $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%;s#/usr/local/share/snmp#$(snmplibdir)#;' ${srcdir}/mib2c > mib2c.made; \ ++ $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%;s#/usr/local/share/snmp#$(snmplibdir)#;s#/usr/local/etc/snmp#$(SNMPCONFPATH)#;' ${srcdir}/mib2c > mib2c.made; \ + 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 + UCDMIBS = UCD-SNMP-MIB.txt UCD-DEMO-MIB.txt UCD-IPFWACC-MIB.txt \ + UCD-DLMOD-MIB.txt UCD-DISKIO-MIB.txt + ++EXTRAMIBS = BGP4-MIB.txt BRIDGE-MIB.txt GNOME-SMI.txt OSPF-MIB.txt \ ++ OSPF-TRAP-MIB.txt RIPv2-MIB.txt SOURCE-ROUTING-MIB.txt \ ++ LM-SENSORS-MIB.txt ++ + DEFAULTMIBS = @default_mibs_install@ + + MIBS = $(V1MIBS) $(V2MIBS) $(V3MIBS) $(RFCMIBS) \ + $(AGENTMIBS) $(IANAMIBS) \ +- $(NETSNMPMIBS) $(UCDMIBS) $(DEFAULTMIBS) ++ $(NETSNMPMIBS) $(UCDMIBS) $(DEFAULTMIBS) $(EXTRAMIBS) + + 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) + diff --git a/net/net-snmp/patches/120-debian-searchdirs.patch b/net/net-snmp/patches/120-debian-searchdirs.patch new file mode 100644 index 0000000..d8c88f3 --- /dev/null +++ b/net/net-snmp/patches/120-debian-searchdirs.patch @@ -0,0 +1,14 @@ +--- a/local/mib2c ++++ b/local/mib2c +@@ -60,8 +60,9 @@ $currentlevel = -1; + if($ENV{MIB2C_DIR}) { + push @def_search_dirs, split(/:/, $ENV{MIB2C_DIR}); + } +-push @def_search_dirs, "/usr/local/share/snmp/"; +-push @def_search_dirs, "/usr/local/share/snmp/mib2c-data"; ++push @def_search_dirs, "/etc/snmp/"; ++push @def_search_dirs, "/usr/share/snmp/"; ++push @def_search_dirs, "/usr/share/snmp/mib2c-data"; + push @def_search_dirs, "./mib2c-conf.d"; + + sub usage { diff --git a/net/net-snmp/patches/130-debian-extramibs.patch b/net/net-snmp/patches/130-debian-extramibs.patch new file mode 100644 index 0000000..e741ee7 --- /dev/null +++ b/net/net-snmp/patches/130-debian-extramibs.patch @@ -0,0 +1,6261 @@ +--- /dev/null ++++ b/mibs/BGP4-MIB.txt +@@ -0,0 +1,929 @@ ++ BGP4-MIB DEFINITIONS ::= BEGIN ++ ++ IMPORTS ++ MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE, ++ IpAddress, Integer32, Counter32, Gauge32, mib-2 ++ FROM SNMPv2-SMI ++ MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP ++ FROM SNMPv2-CONF; ++ ++ bgp MODULE-IDENTITY ++ LAST-UPDATED "9902100000Z" ++ ORGANIZATION "IETF IDR Working Group" ++ CONTACT-INFO "E-mail: idr@merit.net ++ ++ Susan Hares (Editor) ++ Merit Network ++ 4251 Plymouth Road ++ Suite C ++ Ann Arbor, MI 48105-2785 ++ Tel: +1 734 936 2095 ++ Fax: +1 734 647 3185 ++ E-mail: skh@merit.edu ++ ++ Jeff Johnson (Editor) ++ RedBack Networks, Inc. ++ 1389 Moffett Park Drive ++ Sunnyvale, CA 94089-1134 ++ Tel: +1 408 548 3516 ++ Fax: +1 408 548 3599 ++ E-mail: jeff@redback.com" ++ DESCRIPTION ++ "The MIB module for BGP-4." ++ REVISION "9902100000Z" ++ DESCRIPTION ++ "Corrected duplicate OBJECT IDENTIFIER ++ assignment in the conformance information." ++ REVISION "9601080000Z" ++ DESCRIPTION ++ "1) Fixed the definitions of the traps to ++ make them equivalent to their initial ++ definition in RFC 1269. ++ 2) Added compliance and conformance info." ++ ::= { mib-2 15 } ++ ++ bgpVersion OBJECT-TYPE ++ SYNTAX OCTET STRING (SIZE (1..255)) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "Vector of supported BGP protocol version ++ numbers. Each peer negotiates the version ++ from this vector. Versions are identified ++ via the string of bits contained within this ++ object. The first octet contains bits 0 to ++ 7, the second octet contains bits 8 to 15, ++ and so on, with the most significant bit ++ referring to the lowest bit number in the ++ octet (e.g., the MSB of the first octet ++ refers to bit 0). If a bit, i, is present ++ and set, then the version (i+1) of the BGP ++ is supported." ++ ::= { bgp 1 } ++ ++ bgpLocalAs OBJECT-TYPE ++ SYNTAX INTEGER (0..65535) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The local autonomous system number." ++ ::= { bgp 2 } ++ ++ ++ ++ -- BGP Peer table. This table contains, one entry per BGP ++ -- peer, information about the BGP peer. ++ ++ bgpPeerTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF BgpPeerEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "BGP peer table. This table contains, ++ one entry per BGP peer, information about the ++ connections with BGP peers." ++ ::= { bgp 3 } ++ ++ bgpPeerEntry OBJECT-TYPE ++ SYNTAX BgpPeerEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "Entry containing information about the ++ connection with a BGP peer." ++ INDEX { bgpPeerRemoteAddr } ++ ::= { bgpPeerTable 1 } ++ ++ BgpPeerEntry ::= SEQUENCE { ++ bgpPeerIdentifier ++ IpAddress, ++ bgpPeerState ++ INTEGER, ++ bgpPeerAdminStatus ++ INTEGER, ++ bgpPeerNegotiatedVersion ++ Integer32, ++ bgpPeerLocalAddr ++ IpAddress, ++ bgpPeerLocalPort ++ INTEGER, ++ bgpPeerRemoteAddr ++ IpAddress, ++ bgpPeerRemotePort ++ INTEGER, ++ bgpPeerRemoteAs ++ INTEGER, ++ bgpPeerInUpdates ++ Counter32, ++ bgpPeerOutUpdates ++ Counter32, ++ bgpPeerInTotalMessages ++ Counter32, ++ bgpPeerOutTotalMessages ++ Counter32, ++ bgpPeerLastError ++ OCTET STRING, ++ bgpPeerFsmEstablishedTransitions ++ Counter32, ++ bgpPeerFsmEstablishedTime ++ Gauge32, ++ bgpPeerConnectRetryInterval ++ INTEGER, ++ bgpPeerHoldTime ++ INTEGER, ++ bgpPeerKeepAlive ++ INTEGER, ++ bgpPeerHoldTimeConfigured ++ INTEGER, ++ bgpPeerKeepAliveConfigured ++ INTEGER, ++ bgpPeerMinASOriginationInterval ++ INTEGER, ++ bgpPeerMinRouteAdvertisementInterval ++ INTEGER, ++ bgpPeerInUpdateElapsedTime ++ Gauge32 ++ } ++ ++ bgpPeerIdentifier OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The BGP Identifier of this entry's BGP peer." ++ ::= { bgpPeerEntry 1 } ++ ++ bgpPeerState OBJECT-TYPE ++ SYNTAX INTEGER { ++ idle(1), ++ connect(2), ++ active(3), ++ opensent(4), ++ openconfirm(5), ++ established(6) ++ } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The BGP peer connection state." ++ ::= { bgpPeerEntry 2 } ++ ++ bgpPeerAdminStatus OBJECT-TYPE ++ SYNTAX INTEGER { ++ stop(1), ++ start(2) ++ } ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "The desired state of the BGP connection. A ++ transition from 'stop' to 'start' will cause ++ the BGP Start Event to be generated. A ++ transition from 'start' to 'stop' will cause ++ the BGP Stop Event to be generated. This ++ parameter can be used to restart BGP peer ++ connections. Care should be used in providing ++ write access to this object without adequate ++ authentication." ++ ::= { bgpPeerEntry 3 } ++ ++ bgpPeerNegotiatedVersion OBJECT-TYPE ++ SYNTAX Integer32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The negotiated version of BGP running between ++ the two peers." ++ ::= { bgpPeerEntry 4 } ++ ++ bgpPeerLocalAddr OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The local IP address of this entry's BGP ++ connection." ++ ::= { bgpPeerEntry 5 } ++ ++ bgpPeerLocalPort OBJECT-TYPE ++ SYNTAX INTEGER (0..65535) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The local port for the TCP connection between ++ the BGP peers." ++ ::= { bgpPeerEntry 6 } ++ ++ bgpPeerRemoteAddr OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The remote IP address of this entry's BGP ++ peer." ++ ::= { bgpPeerEntry 7 } ++ ++ bgpPeerRemotePort OBJECT-TYPE ++ SYNTAX INTEGER (0..65535) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The remote port for the TCP connection between ++ the BGP peers. Note that the objects ++ bgpPeerLocalAddr, bgpPeerLocalPort, ++ bgpPeerRemoteAddr and bgpPeerRemotePort ++ provide the appropriate reference to the ++ standard MIB TCP connection table." ++ ::= { bgpPeerEntry 8 } ++ ++ bgpPeerRemoteAs OBJECT-TYPE ++ SYNTAX INTEGER (0..65535) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The remote autonomous system number." ++ ::= { bgpPeerEntry 9 } ++ ++ bgpPeerInUpdates OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of BGP UPDATE messages received on ++ this connection. This object should be ++ initialized to zero (0) when the connection is ++ established." ++ ::= { bgpPeerEntry 10 } ++ ++ bgpPeerOutUpdates OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of BGP UPDATE messages transmitted ++ on this connection. This object should be ++ initialized to zero (0) when the connection is ++ established." ++ ::= { bgpPeerEntry 11 } ++ ++ bgpPeerInTotalMessages OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The total number of messages received from the ++ remote peer on this connection. This object ++ should be initialized to zero when the ++ connection is established." ++ ::= { bgpPeerEntry 12 } ++ ++ bgpPeerOutTotalMessages OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The total number of messages transmitted to ++ the remote peer on this connection. This object ++ should be initialized to zero when the ++ connection is established." ++ ::= { bgpPeerEntry 13 } ++ ++ bgpPeerLastError OBJECT-TYPE ++ SYNTAX OCTET STRING (SIZE (2)) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The last error code and subcode seen by this ++ peer on this connection. If no error has ++ occurred, this field is zero. Otherwise, the ++ first byte of this two byte OCTET STRING ++ contains the error code, and the second byte ++ contains the subcode." ++ ::= { bgpPeerEntry 14 } ++ ++ bgpPeerFsmEstablishedTransitions OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The total number of times the BGP FSM ++ transitioned into the established state." ++ ::= { bgpPeerEntry 15 } ++ ++ bgpPeerFsmEstablishedTime OBJECT-TYPE ++ SYNTAX Gauge32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "This timer indicates how long (in seconds) this ++ peer has been in the Established state or how long ++ since this peer was last in the Established state. ++ It is set to zero when a new peer is configured or ++ the router is booted." ++ ::= { bgpPeerEntry 16 } ++ ++ bgpPeerConnectRetryInterval OBJECT-TYPE ++ SYNTAX INTEGER (1..65535) ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "Time interval in seconds for the ConnectRetry ++ timer. The suggested value for this timer is ++ 120 seconds." ++ ::= { bgpPeerEntry 17 } ++ ++ bgpPeerHoldTime OBJECT-TYPE ++ SYNTAX INTEGER ( 0 | 3..65535 ) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "Time interval in seconds for the Hold Timer ++ established with the peer. The value of this ++ object is calculated by this BGP speaker by ++ using the smaller of the value in ++ bgpPeerHoldTimeConfigured and the Hold Time ++ received in the OPEN message. This value ++ must be at lease three seconds if it is not ++ zero (0) in which case the Hold Timer has ++ not been established with the peer, or, the ++ value of bgpPeerHoldTimeConfigured is zero (0)." ++ ::= { bgpPeerEntry 18 } ++ ++ bgpPeerKeepAlive OBJECT-TYPE ++ SYNTAX INTEGER ( 0 | 1..21845 ) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "Time interval in seconds for the KeepAlive ++ timer established with the peer. The value of ++ this object is calculated by this BGP speaker ++ such that, when compared with bgpPeerHoldTime, ++ it has the same proportion as what ++ bgpPeerKeepAliveConfigured has when compared ++ with bgpPeerHoldTimeConfigured. If the value ++ of this object is zero (0), it indicates that ++ the KeepAlive timer has not been established ++ with the peer, or, the value of ++ bgpPeerKeepAliveConfigured is zero (0)." ++ ::= { bgpPeerEntry 19 } ++ ++ bgpPeerHoldTimeConfigured OBJECT-TYPE ++ SYNTAX INTEGER ( 0 | 3..65535 ) ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "Time interval in seconds for the Hold Time ++ configured for this BGP speaker with this peer. ++ This value is placed in an OPEN message sent to ++ this peer by this BGP speaker, and is compared ++ with the Hold Time field in an OPEN message ++ received from the peer when determining the Hold ++ Time (bgpPeerHoldTime) with the peer. This value ++ must not be less than three seconds if it is not ++ zero (0) in which case the Hold Time is NOT to be ++ established with the peer. The suggested value for ++ this timer is 90 seconds." ++ ::= { bgpPeerEntry 20 } ++ ++ bgpPeerKeepAliveConfigured OBJECT-TYPE ++ SYNTAX INTEGER ( 0 | 1..21845 ) ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "Time interval in seconds for the KeepAlive timer ++ configured for this BGP speaker with this peer. ++ The value of this object will only determine the ++ KEEPALIVE messages' frequency relative to the value ++ specified in bgpPeerHoldTimeConfigured; the actual ++ time interval for the KEEPALIVE messages is ++ indicated by bgpPeerKeepAlive. A reasonable ++ maximum value for this timer would be configured to ++ be one third of that of bgpPeerHoldTimeConfigured. ++ If the value of this object is zero (0), no ++ periodical KEEPALIVE messages are sent to the peer ++ after the BGP connection has been established. The ++ suggested value for this timer is 30 seconds." ++ ::= { bgpPeerEntry 21 } ++ ++ bgpPeerMinASOriginationInterval OBJECT-TYPE ++ SYNTAX INTEGER (1..65535) ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "Time interval in seconds for the ++ MinASOriginationInterval timer. ++ The suggested value for this timer is 15 seconds." ++ ::= { bgpPeerEntry 22 } ++ ++ bgpPeerMinRouteAdvertisementInterval OBJECT-TYPE ++ SYNTAX INTEGER (1..65535) ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "Time interval in seconds for the ++ MinRouteAdvertisementInterval timer. ++ The suggested value for this timer is 30 seconds." ++ ::= { bgpPeerEntry 23 } ++ ++ bgpPeerInUpdateElapsedTime OBJECT-TYPE ++ SYNTAX Gauge32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "Elapsed time in seconds since the last BGP ++ UPDATE message was received from the peer. ++ Each time bgpPeerInUpdates is incremented, ++ the value of this object is set to zero (0)." ++ ::= { bgpPeerEntry 24 } ++ ++ ++ ++ bgpIdentifier OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The BGP Identifier of local system." ++ ::= { bgp 4 } ++ ++ ++ ++ -- Received Path Attribute Table. This table contains, ++ -- one entry per path to a network, path attributes ++ -- received from all peers running BGP version 3 or less. ++ -- This table is obsolete, having been replaced in ++ -- functionality with the bgp4PathAttrTable. ++ ++ bgpRcvdPathAttrTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF BgpPathAttrEntry ++ MAX-ACCESS not-accessible ++ STATUS obsolete ++ DESCRIPTION ++ "The BGP Received Path Attribute Table contains ++ information about paths to destination networks ++ received from all peers running BGP version 3 or ++ less." ++ ::= { bgp 5 } ++ ++ bgpPathAttrEntry OBJECT-TYPE ++ SYNTAX BgpPathAttrEntry ++ MAX-ACCESS not-accessible ++ STATUS obsolete ++ DESCRIPTION ++ "Information about a path to a network." ++ INDEX { bgpPathAttrDestNetwork, ++ bgpPathAttrPeer } ++ ::= { bgpRcvdPathAttrTable 1 } ++ ++ BgpPathAttrEntry ::= SEQUENCE { ++ bgpPathAttrPeer ++ IpAddress, ++ bgpPathAttrDestNetwork ++ IpAddress, ++ bgpPathAttrOrigin ++ INTEGER, ++ bgpPathAttrASPath ++ OCTET STRING, ++ bgpPathAttrNextHop ++ IpAddress, ++ bgpPathAttrInterASMetric ++ Integer32 ++ } ++ ++ bgpPathAttrPeer OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS obsolete ++ DESCRIPTION ++ "The IP address of the peer where the path ++ information was learned." ++ ::= { bgpPathAttrEntry 1 } ++ ++ bgpPathAttrDestNetwork OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS obsolete ++ DESCRIPTION ++ "The address of the destination network." ++ ::= { bgpPathAttrEntry 2 } ++ ++ bgpPathAttrOrigin OBJECT-TYPE ++ SYNTAX INTEGER { ++ igp(1),-- networks are interior ++ egp(2),-- networks learned via EGP ++ incomplete(3) -- undetermined ++ } ++ MAX-ACCESS read-only ++ STATUS obsolete ++ DESCRIPTION ++ "The ultimate origin of the path information." ++ ::= { bgpPathAttrEntry 3 } ++ ++ bgpPathAttrASPath OBJECT-TYPE ++ SYNTAX OCTET STRING (SIZE (2..255)) ++ MAX-ACCESS read-only ++ STATUS obsolete ++ DESCRIPTION ++ "The set of ASs that must be traversed to reach ++ the network. This object is probably best ++ represented as SEQUENCE OF INTEGER. For SMI ++ compatibility, though, it is represented as ++ OCTET STRING. Each AS is represented as a pair ++ of octets according to the following algorithm: ++ ++ first-byte-of-pair = ASNumber / 256; ++ second-byte-of-pair = ASNumber & 255;" ++ ::= { bgpPathAttrEntry 4 } ++ ++ bgpPathAttrNextHop OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS obsolete ++ DESCRIPTION ++ "The address of the border router that should ++ be used for the destination network." ++ ::= { bgpPathAttrEntry 5 } ++ ++ bgpPathAttrInterASMetric OBJECT-TYPE ++ SYNTAX Integer32 ++ MAX-ACCESS read-only ++ STATUS obsolete ++ DESCRIPTION ++ "The optional inter-AS metric. If this ++ attribute has not been provided for this route, ++ the value for this object is 0." ++ ::= { bgpPathAttrEntry 6 } ++ ++ ++ ++ -- BGP-4 Received Path Attribute Table. This table contains, ++ -- one entry per path to a network, path attributes ++ -- received from all peers running BGP-4. ++ ++ bgp4PathAttrTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF Bgp4PathAttrEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "The BGP-4 Received Path Attribute Table contains ++ information about paths to destination networks ++ received from all BGP4 peers." ++ ::= { bgp 6 } ++ ++ bgp4PathAttrEntry OBJECT-TYPE ++ SYNTAX Bgp4PathAttrEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "Information about a path to a network." ++ INDEX { bgp4PathAttrIpAddrPrefix, ++ bgp4PathAttrIpAddrPrefixLen, ++ bgp4PathAttrPeer } ++ ::= { bgp4PathAttrTable 1 } ++ ++ Bgp4PathAttrEntry ::= SEQUENCE { ++ bgp4PathAttrPeer ++ IpAddress, ++ bgp4PathAttrIpAddrPrefixLen ++ INTEGER, ++ bgp4PathAttrIpAddrPrefix ++ IpAddress, ++ bgp4PathAttrOrigin ++ INTEGER, ++ bgp4PathAttrASPathSegment ++ OCTET STRING, ++ bgp4PathAttrNextHop ++ IpAddress, ++ bgp4PathAttrMultiExitDisc ++ INTEGER, ++ bgp4PathAttrLocalPref ++ INTEGER, ++ bgp4PathAttrAtomicAggregate ++ INTEGER, ++ bgp4PathAttrAggregatorAS ++ INTEGER, ++ bgp4PathAttrAggregatorAddr ++ IpAddress, ++ bgp4PathAttrCalcLocalPref ++ INTEGER, ++ bgp4PathAttrBest ++ INTEGER, ++ bgp4PathAttrUnknown ++ OCTET STRING ++ } ++ ++ bgp4PathAttrPeer OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The IP address of the peer where the path ++ information was learned." ++ ::= { bgp4PathAttrEntry 1 } ++ bgp4PathAttrIpAddrPrefixLen OBJECT-TYPE ++ SYNTAX INTEGER (0..32) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "Length in bits of the IP address prefix in the ++ Network Layer Reachability Information field." ++ ::= { bgp4PathAttrEntry 2 } ++ ++ bgp4PathAttrIpAddrPrefix OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "An IP address prefix in the Network Layer ++ Reachability Information field. This object ++ is an IP address containing the prefix with ++ length specified by bgp4PathAttrIpAddrPrefixLen. ++ Any bits beyond the length specified by ++ bgp4PathAttrIpAddrPrefixLen are zeroed." ++ ::= { bgp4PathAttrEntry 3 } ++ ++ bgp4PathAttrOrigin OBJECT-TYPE ++ SYNTAX INTEGER { ++ igp(1),-- networks are interior ++ egp(2),-- networks learned via EGP ++ incomplete(3) -- undetermined ++ } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The ultimate origin of the path information." ++ ::= { bgp4PathAttrEntry 4 } ++ ++ bgp4PathAttrASPathSegment OBJECT-TYPE ++ SYNTAX OCTET STRING (SIZE (2..255)) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The sequence of AS path segments. Each AS ++ path segment is represented by a triple ++ . ++ ++ The type is a 1-octet field which has two ++ possible values: ++ 1 AS_SET: unordered set of ASs a ++ route in the UPDATE message ++ has traversed ++ 2 AS_SEQUENCE: ordered set of ASs ++ a route in the UPDATE message ++ has traversed. ++ ++ The length is a 1-octet field containing the ++ number of ASs in the value field. ++ ++ The value field contains one or more AS ++ numbers, each AS is represented in the octet ++ string as a pair of octets according to the ++ following algorithm: ++ ++ first-byte-of-pair = ASNumber / 256; ++ second-byte-of-pair = ASNumber & 255;" ++ ::= { bgp4PathAttrEntry 5 } ++ ++ bgp4PathAttrNextHop OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The address of the border router that should ++ be used for the destination network." ++ ::= { bgp4PathAttrEntry 6 } ++ ++ bgp4PathAttrMultiExitDisc OBJECT-TYPE ++ SYNTAX INTEGER (-1..2147483647) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "This metric is used to discriminate between ++ multiple exit points to an adjacent autonomous ++ system. A value of -1 indicates the absence of ++ this attribute." ++ ::= { bgp4PathAttrEntry 7 } ++ ++ bgp4PathAttrLocalPref OBJECT-TYPE ++ SYNTAX INTEGER (-1..2147483647) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The originating BGP4 speaker's degree of ++ preference for an advertised route. A value of ++ -1 indicates the absence of this attribute." ++ ::= { bgp4PathAttrEntry 8 } ++ ++ bgp4PathAttrAtomicAggregate OBJECT-TYPE ++ SYNTAX INTEGER { ++ lessSpecificRrouteNotSelected(1), ++ lessSpecificRouteSelected(2) ++ } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "Whether or not a system has selected ++ a less specific route without selecting a ++ more specific route." ++ ::= { bgp4PathAttrEntry 9 } ++ ++ bgp4PathAttrAggregatorAS OBJECT-TYPE ++ SYNTAX INTEGER (0..65535) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The AS number of the last BGP4 speaker that ++ performed route aggregation. A value of zero (0) ++ indicates the absence of this attribute." ++ ::= { bgp4PathAttrEntry 10 } ++ ++ bgp4PathAttrAggregatorAddr OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The IP address of the last BGP4 speaker that ++ performed route aggregation. A value of ++ 0.0.0.0 indicates the absence of this attribute." ++ ::= { bgp4PathAttrEntry 11 } ++ ++ bgp4PathAttrCalcLocalPref OBJECT-TYPE ++ SYNTAX INTEGER (-1..2147483647) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The degree of preference calculated by the ++ receiving BGP4 speaker for an advertised route. ++ A value of -1 indicates the absence of this ++ attribute." ++ ::= { bgp4PathAttrEntry 12 } ++ ++ bgp4PathAttrBest OBJECT-TYPE ++ SYNTAX INTEGER { ++ false(1),-- not chosen as best route ++ true(2) -- chosen as best route ++ } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "An indication of whether or not this route ++ was chosen as the best BGP4 route." ++ ::= { bgp4PathAttrEntry 13 } ++ ++ bgp4PathAttrUnknown OBJECT-TYPE ++ SYNTAX OCTET STRING (SIZE(0..255)) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "One or more path attributes not understood ++ by this BGP4 speaker. Size zero (0) indicates ++ the absence of such attribute(s). Octets ++ beyond the maximum size, if any, are not ++ recorded by this object." ++ ::= { bgp4PathAttrEntry 14 } ++ ++ ++ -- Traps. ++ ++ -- note that in RFC 1657, bgpTraps was incorrectly ++ -- assigned a value of { bgp 7 }, and each of the ++ -- traps had the bgpPeerRemoteAddr object inappropriately ++ -- removed from their OBJECTS clause. The following ++ -- definitions restore the semantics of the traps as ++ -- they were initially defined in RFC 1269. ++ ++ -- { bgp 7 } is unused ++ ++ bgpTraps OBJECT IDENTIFIER ::= { bgp 0 } ++ ++ bgpEstablished NOTIFICATION-TYPE ++ OBJECTS { bgpPeerRemoteAddr, ++ bgpPeerLastError, ++ bgpPeerState } ++ STATUS current ++ DESCRIPTION ++ "The BGP Established event is generated when ++ the BGP FSM enters the ESTABLISHED state." ++ ::= { bgpTraps 1 } ++ ++ bgpBackwardTransition NOTIFICATION-TYPE ++ OBJECTS { bgpPeerRemoteAddr, ++ bgpPeerLastError, ++ bgpPeerState } ++ STATUS current ++ DESCRIPTION ++ "The BGPBackwardTransition Event is generated ++ when the BGP FSM moves from a higher numbered ++ state to a lower numbered state." ++ ::= { bgpTraps 2 } ++ ++ -- conformance information ++ ++ bgpMIBConformance OBJECT IDENTIFIER ::= { bgp 8 } ++ bgpMIBCompliances OBJECT IDENTIFIER ::= { bgpMIBConformance 1 } ++ bgpMIBGroups OBJECT IDENTIFIER ::= { bgpMIBConformance 2 } ++ ++ -- compliance statements ++ ++ bgpMIBCompliance MODULE-COMPLIANCE ++ STATUS current ++ DESCRIPTION ++ "The compliance statement for entities which ++ implement the BGP4 mib." ++ MODULE -- this module ++ MANDATORY-GROUPS { bgp4MIBGlobalsGroup, ++ bgp4MIBPeerGroup, ++ bgp4MIBPathAttrGroup, ++ bgp4MIBNotificationGroup } ++ ::= { bgpMIBCompliances 1 } ++ ++ -- units of conformance ++ ++ bgp4MIBGlobalsGroup OBJECT-GROUP ++ OBJECTS { bgpVersion, ++ bgpLocalAs, ++ bgpIdentifier } ++ STATUS current ++ DESCRIPTION ++ "A collection of objects providing information ++ on global BGP state." ++ ::= { bgpMIBGroups 1 } ++ ++ bgp4MIBPeerGroup OBJECT-GROUP ++ OBJECTS { bgpPeerIdentifier, ++ bgpPeerState, ++ bgpPeerAdminStatus, ++ bgpPeerNegotiatedVersion, ++ bgpPeerLocalAddr, ++ bgpPeerLocalPort, ++ bgpPeerRemoteAddr, ++ bgpPeerRemotePort, ++ bgpPeerRemoteAs, ++ bgpPeerInUpdates, ++ bgpPeerOutUpdates, ++ bgpPeerInTotalMessages, ++ bgpPeerOutTotalMessages, ++ bgpPeerLastError, ++ bgpPeerFsmEstablishedTransitions, ++ bgpPeerFsmEstablishedTime, ++ bgpPeerConnectRetryInterval, ++ bgpPeerHoldTime, ++ bgpPeerKeepAlive, ++ bgpPeerHoldTimeConfigured, ++ bgpPeerKeepAliveConfigured, ++ bgpPeerMinASOriginationInterval, ++ bgpPeerMinRouteAdvertisementInterval, ++ bgpPeerInUpdateElapsedTime } ++ STATUS current ++ DESCRIPTION ++ "A collection of objects for managing ++ BGP peers." ++ ::= { bgpMIBGroups 2 } ++ ++ bgp4MIBRcvdPathAttrGroup OBJECT-GROUP ++ OBJECTS { bgpPathAttrPeer, ++ bgpPathAttrDestNetwork, ++ bgpPathAttrOrigin, ++ bgpPathAttrASPath, ++ bgpPathAttrNextHop, ++ bgpPathAttrInterASMetric } ++ STATUS obsolete ++ DESCRIPTION ++ "A collection of objects for managing BGP ++ path entries. ++ ++ This conformance group is obsolete, ++ replaced by bgp4MIBPathAttrGroup." ++ ::= { bgpMIBGroups 3 } ++ ++ bgp4MIBPathAttrGroup OBJECT-GROUP ++ OBJECTS { bgp4PathAttrPeer, ++ bgp4PathAttrIpAddrPrefixLen, ++ bgp4PathAttrIpAddrPrefix, ++ bgp4PathAttrOrigin, ++ bgp4PathAttrASPathSegment, ++ bgp4PathAttrNextHop, ++ bgp4PathAttrMultiExitDisc, ++ bgp4PathAttrLocalPref, ++ bgp4PathAttrAtomicAggregate, ++ bgp4PathAttrAggregatorAS, ++ bgp4PathAttrAggregatorAddr, ++ bgp4PathAttrCalcLocalPref, ++ bgp4PathAttrBest, ++ bgp4PathAttrUnknown } ++ STATUS current ++ DESCRIPTION ++ "A collection of objects for managing ++ BGP path entries." ++ ::= { bgpMIBGroups 4 } ++ ++ bgp4MIBNotificationGroup NOTIFICATION-GROUP ++ NOTIFICATIONS { bgpEstablished, ++ bgpBackwardTransition } ++ STATUS current ++ DESCRIPTION ++ "A collection of notifications for signaling ++ changes in BGP peer relationships." ++ ::= { bgpMIBGroups 5 } ++ ++ 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 ++ ++IMPORTS ++ MODULE-IDENTITY, ++ OBJECT-IDENTITY, ++ enterprises ++ FROM SNMPv2-SMI; ++ ++gnome MODULE-IDENTITY ++ LAST-UPDATED "200709070000Z" ++ ORGANIZATION "GNOME project" ++ CONTACT-INFO ++ "GNU Network Object Model Environment project ++ ++ see http://www.gnome.org for contact persons of a particular ++ area or subproject of GNOME. ++ ++ Administrative contact for MIB module: ++ ++ Jochen Friedrich ++ Ramsaystr. 9 ++ 63450 Hanau ++ Germany ++ ++ email: jochen@scram.de" ++ DESCRIPTION ++ "The Structure of GNOME." ++ ++ -- revision history ++ ++ REVISION "200709070000Z" -- Sep 07, 2007 ++ DESCRIPTION ++ "Fixed wrong enterprise number (how comes this ++ typo was unnoticed for so long?)." ++ ++ REVISION "200505070000Z" -- May 07, 2005 ++ DESCRIPTION ++ "Added gnomeLDAP subtree for LDAP definitions." ++ ++ REVISION "200312070000Z" -- December 07, 2003 ++ DESCRIPTION ++ "Added gnomeSysadmin subtree for GNOME project system administration. ++ Updated contact info." ++ ++ REVISION "9809010000Z" -- September 01, 1998 ++ DESCRIPTION ++ "Initial version." ++ ++ ::= { enterprises 3319 } -- assigned by IANA ++ ++gnomeProducts OBJECT-IDENTITY ++ STATUS current ++ DESCRIPTION ++ "gnomeProducts is the root OBJECT IDENTIFIER from ++ which sysObjectID values are assigned." ++ ::= { gnome 1 } ++ ++gnomeMgmt OBJECT-IDENTITY ++ STATUS current ++ DESCRIPTION ++ "gnomeMgmt defines the subtree for production GNOME related ++ MIB registrations." ++ ::= { gnome 2 } ++ ++gnomeTest OBJECT-IDENTITY ++ STATUS current ++ DESCRIPTION ++ "gnomeTest defines the subtree for testing GNOME related ++ MIB registrations." ++ ::= { gnome 3 } ++ ++gnomeSysadmin OBJECT-IDENTITY ++ STATUS current ++ DESCRIPTION ++ "gnomeSysadmin defines the subtree for GNOME related Sysadmin ++ MIB registrations." ++ ::= { gnome 4 } ++ ++gnomeLDAP OBJECT-IDENTITY ++ STATUS current ++ DESCRIPTION ++ "gnomeLDAP defines the subtree for GNOME related LDAP ++ registrations." ++ ::= { gnome 5 } ++ ++-- more to come if necessary. ++ ++END +--- /dev/null ++++ b/mibs/OSPF-MIB.txt +@@ -0,0 +1,2723 @@ ++OSPF-MIB DEFINITIONS ::= BEGIN ++ ++ IMPORTS ++ MODULE-IDENTITY, OBJECT-TYPE, Counter32, Gauge32, ++ Integer32, IpAddress ++ FROM SNMPv2-SMI ++ TEXTUAL-CONVENTION, TruthValue, RowStatus ++ FROM SNMPv2-TC ++ MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF ++ mib-2 FROM RFC1213-MIB; ++ ++-- This MIB module uses the extended OBJECT-TYPE macro as ++-- defined in [9]. ++ ++ospf MODULE-IDENTITY ++ LAST-UPDATED "9501201225Z" -- Fri Jan 20 12:25:50 PST 1995 ++ ORGANIZATION "IETF OSPF Working Group" ++ CONTACT-INFO ++ " Fred Baker ++ Postal: Cisco Systems ++ 519 Lado Drive ++ Santa Barbara, California 93111 ++ Tel: +1 805 681 0115 ++ E-Mail: fred@cisco.com ++ ++ Rob Coltun ++ Postal: RainbowBridge Communications ++ Tel: (301) 340-9416 ++ E-Mail: rcoltun@rainbow-bridge.com" ++ DESCRIPTION ++ "The MIB module to describe the OSPF Version 2 ++ Protocol" ++ ::= { mib-2 14 } ++ ++-- The Area ID, in OSPF, has the same format as an IP Address, ++-- but has the function of defining a summarization point for ++-- Link State Advertisements ++ ++AreaID ::= TEXTUAL-CONVENTION ++ STATUS current ++ DESCRIPTION ++ "An OSPF Area Identifier." ++ SYNTAX IpAddress ++ ++ ++-- The Router ID, in OSPF, has the same format as an IP Address, ++-- but identifies the router independent of its IP Address. ++ ++RouterID ::= TEXTUAL-CONVENTION ++ STATUS current ++ DESCRIPTION ++ "A OSPF Router Identifier." ++ SYNTAX IpAddress ++ ++ ++-- The OSPF Metric is defined as an unsigned value in the range ++ ++Metric ::= TEXTUAL-CONVENTION ++ STATUS current ++ DESCRIPTION ++ "The OSPF Internal Metric." ++ SYNTAX Integer32 (0..'FFFF'h) ++ ++BigMetric ::= TEXTUAL-CONVENTION ++ STATUS current ++ DESCRIPTION ++ "The OSPF External Metric." ++ SYNTAX Integer32 (0..'FFFFFF'h) ++ ++-- Status Values ++ ++Status ::= TEXTUAL-CONVENTION ++ STATUS current ++ DESCRIPTION ++ "The status of an interface: 'enabled' indicates that ++ it is willing to communicate with other OSPF Routers, ++ while 'disabled' indicates that it is not." ++ SYNTAX INTEGER { enabled (1), disabled (2) } ++ ++-- Time Durations measured in seconds ++ ++PositiveInteger ::= TEXTUAL-CONVENTION ++ STATUS current ++ DESCRIPTION ++ "A positive integer. Values in excess are precluded as ++ unnecessary and prone to interoperability issues." ++ SYNTAX Integer32 (0..'7FFFFFFF'h) ++ ++HelloRange ::= TEXTUAL-CONVENTION ++ STATUS current ++ DESCRIPTION ++ "The range of intervals on which hello messages are ++ exchanged." ++ SYNTAX Integer32 (1..'FFFF'h) ++ ++UpToMaxAge ::= TEXTUAL-CONVENTION ++ STATUS current ++ DESCRIPTION ++ "The values that one might find or configure for ++ variables bounded by the maximum age of an LSA." ++ SYNTAX Integer32 (0..3600) ++ ++ ++-- The range of ifIndex ++ ++InterfaceIndex ::= TEXTUAL-CONVENTION ++ STATUS current ++ DESCRIPTION ++ "The range of ifIndex." ++ SYNTAX Integer32 ++ ++ ++-- Potential Priorities for the Designated Router Election ++ ++DesignatedRouterPriority ::= TEXTUAL-CONVENTION ++ STATUS current ++ DESCRIPTION ++ "The values defined for the priority of a system for ++ becoming the designated router." ++ SYNTAX Integer32 (0..'FF'h) ++ ++TOSType ::= TEXTUAL-CONVENTION ++ STATUS current ++ DESCRIPTION ++ "Type of Service is defined as a mapping to the IP Type of ++ Service Flags as defined in the IP Forwarding Table MIB ++ ++ +-----+-----+-----+-----+-----+-----+-----+-----+ ++ | | | | ++ | PRECEDENCE | TYPE OF SERVICE | 0 | ++ | | | | ++ +-----+-----+-----+-----+-----+-----+-----+-----+ ++ ++ IP TOS IP TOS ++ Field Policy Field Policy ++ ++ Contents Code Contents Code ++ 0 0 0 0 ==> 0 0 0 0 1 ==> 2 ++ 0 0 1 0 ==> 4 0 0 1 1 ==> 6 ++ 0 1 0 0 ==> 8 0 1 0 1 ==> 10 ++ 0 1 1 0 ==> 12 0 1 1 1 ==> 14 ++ 1 0 0 0 ==> 16 1 0 0 1 ==> 18 ++ 1 0 1 0 ==> 20 1 0 1 1 ==> 22 ++ 1 1 0 0 ==> 24 1 1 0 1 ==> 26 ++ 1 1 1 0 ==> 28 1 1 1 1 ==> 30 ++ ++ The remaining values are left for future definition." ++ SYNTAX Integer32 (0..30) ++ ++ ++-- OSPF General Variables ++ ++-- These parameters apply globally to the Router's ++-- OSPF Process. ++ ++ospfGeneralGroup OBJECT IDENTIFIER ::= { ospf 1 } ++ ++ ++ ospfRouterId OBJECT-TYPE ++ SYNTAX RouterID ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "A 32-bit integer uniquely identifying the ++ router in the Autonomous System. ++ ++ By convention, to ensure uniqueness, this ++ should default to the value of one of the ++ router's IP interface addresses." ++ REFERENCE ++ "OSPF Version 2, C.1 Global parameters" ++ ::= { ospfGeneralGroup 1 } ++ ++ ++ ospfAdminStat OBJECT-TYPE ++ SYNTAX Status ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "The administrative status of OSPF in the ++ router. The value 'enabled' denotes that the ++ OSPF Process is active on at least one inter- ++ face; 'disabled' disables it on all inter- ++ faces." ++ ::= { ospfGeneralGroup 2 } ++ ++ ospfVersionNumber OBJECT-TYPE ++ SYNTAX INTEGER { version2 (2) } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The current version number of the OSPF proto- ++ col is 2." ++ REFERENCE ++ "OSPF Version 2, Title" ++ ::= { ospfGeneralGroup 3 } ++ ++ ++ ospfAreaBdrRtrStatus OBJECT-TYPE ++ SYNTAX TruthValue ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "A flag to note whether this router is an area ++ border router." ++ REFERENCE ++ "OSPF Version 2, Section 3 Splitting the AS into ++ Areas" ++ ::= { ospfGeneralGroup 4 } ++ ++ ++ ospfASBdrRtrStatus OBJECT-TYPE ++ SYNTAX TruthValue ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "A flag to note whether this router is config- ++ ured as an Autonomous System border router." ++ REFERENCE ++ "OSPF Version 2, Section 3.3 Classification of ++ routers" ++ ::= { ospfGeneralGroup 5 } ++ ++ ospfExternLsaCount OBJECT-TYPE ++ SYNTAX Gauge32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of external (LS type 5) link-state ++ advertisements in the link-state database." ++ REFERENCE ++ "OSPF Version 2, Appendix A.4.5 AS external link ++ advertisements" ++ ::= { ospfGeneralGroup 6 } ++ ++ ++ ospfExternLsaCksumSum OBJECT-TYPE ++ SYNTAX Integer32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The 32-bit unsigned sum of the LS checksums of ++ the external link-state advertisements con- ++ tained in the link-state database. This sum ++ can be used to determine if there has been a ++ change in a router's link state database, and ++ to compare the link-state database of two ++ routers." ++ ::= { ospfGeneralGroup 7 } ++ ++ ++ ospfTOSSupport OBJECT-TYPE ++ SYNTAX TruthValue ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "The router's support for type-of-service rout- ++ ing." ++ REFERENCE ++ "OSPF Version 2, Appendix F.1.2 Optional TOS ++ support" ++ ::= { ospfGeneralGroup 8 } ++ ++ ospfOriginateNewLsas OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of new link-state advertisements ++ that have been originated. This number is in- ++ cremented each time the router originates a new ++ LSA." ++ ::= { ospfGeneralGroup 9 } ++ ++ ++ ospfRxNewLsas OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of link-state advertisements re- ++ ceived determined to be new instantiations. ++ This number does not include newer instantia- ++ tions of self-originated link-state advertise- ++ ments." ++ ::= { ospfGeneralGroup 10 } ++ ++ ospfExtLsdbLimit OBJECT-TYPE ++ SYNTAX Integer32 (-1..'7FFFFFFF'h) ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "The maximum number of non-default AS- ++ external-LSAs entries that can be stored in the ++ link-state database. If the value is -1, then ++ there is no limit. ++ ++ When the number of non-default AS-external-LSAs ++ in a router's link-state database reaches ++ ospfExtLsdbLimit, the router enters Overflow- ++ State. The router never holds more than ++ ospfExtLsdbLimit non-default AS-external-LSAs ++ in its database. OspfExtLsdbLimit MUST be set ++ identically in all routers attached to the OSPF ++ backbone and/or any regular OSPF area. (i.e., ++ OSPF stub areas and NSSAs are excluded)." ++ DEFVAL { -1 } ++ ::= { ospfGeneralGroup 11 } ++ ++ ospfMulticastExtensions OBJECT-TYPE ++ SYNTAX Integer32 ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "A Bit Mask indicating whether the router is ++ forwarding IP multicast (Class D) datagrams ++ based on the algorithms defined in the Multi- ++ cast Extensions to OSPF. ++ ++ Bit 0, if set, indicates that the router can ++ forward IP multicast datagrams in the router's ++ directly attached areas (called intra-area mul- ++ ticast routing). ++ ++ Bit 1, if set, indicates that the router can ++ forward IP multicast datagrams between OSPF ++ areas (called inter-area multicast routing). ++ ++ Bit 2, if set, indicates that the router can ++ forward IP multicast datagrams between Auto- ++ nomous Systems (called inter-AS multicast rout- ++ ing). ++ ++ Only certain combinations of bit settings are ++ allowed, namely: 0 (no multicast forwarding is ++ enabled), 1 (intra-area multicasting only), 3 ++ (intra-area and inter-area multicasting), 5 ++ (intra-area and inter-AS multicasting) and 7 ++ (multicasting everywhere). By default, no mul- ++ ticast forwarding is enabled." ++ DEFVAL { 0 } ++ ::= { ospfGeneralGroup 12 } ++ ++ ospfExitOverflowInterval OBJECT-TYPE ++ SYNTAX PositiveInteger ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "The number of seconds that, after entering ++ OverflowState, a router will attempt to leave ++ OverflowState. This allows the router to again ++ originate non-default AS-external-LSAs. When ++ set to 0, the router will not leave Overflow- ++ State until restarted." ++ DEFVAL { 0 } ++ ::= { ospfGeneralGroup 13 } ++ ++ ++ ospfDemandExtensions OBJECT-TYPE ++ SYNTAX TruthValue ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "The router's support for demand routing." ++ REFERENCE ++ "OSPF Version 2, Appendix on Demand Routing" ++ ::= { ospfGeneralGroup 14 } ++ ++ ++-- The OSPF Area Data Structure contains information ++-- regarding the various areas. The interfaces and ++-- virtual links are configured as part of these areas. ++-- Area 0.0.0.0, by definition, is the Backbone Area ++ ++ ++ ospfAreaTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF OspfAreaEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "Information describing the configured parame- ++ ters and cumulative statistics of the router's ++ attached areas." ++ REFERENCE ++ "OSPF Version 2, Section 6 The Area Data Struc- ++ ture" ++ ::= { ospf 2 } ++ ++ ++ ospfAreaEntry OBJECT-TYPE ++ SYNTAX OspfAreaEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "Information describing the configured parame- ++ ters and cumulative statistics of one of the ++ router's attached areas." ++ INDEX { ospfAreaId } ++ ::= { ospfAreaTable 1 } ++ ++OspfAreaEntry ::= ++ SEQUENCE { ++ ospfAreaId ++ AreaID, ++ ospfAuthType ++ Integer32, ++ ospfImportAsExtern ++ INTEGER, ++ ospfSpfRuns ++ Counter32, ++ ospfAreaBdrRtrCount ++ Gauge32, ++ ospfAsBdrRtrCount ++ Gauge32, ++ ospfAreaLsaCount ++ Gauge32, ++ ospfAreaLsaCksumSum ++ Integer32, ++ ospfAreaSummary ++ INTEGER, ++ ospfAreaStatus ++ RowStatus ++ } ++ ++ ospfAreaId OBJECT-TYPE ++ SYNTAX AreaID ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "A 32-bit integer uniquely identifying an area. ++ Area ID 0.0.0.0 is used for the OSPF backbone." ++ REFERENCE ++ "OSPF Version 2, Appendix C.2 Area parameters" ++ ::= { ospfAreaEntry 1 } ++ ++ ++ ospfAuthType OBJECT-TYPE ++ SYNTAX Integer32 ++ -- none (0), ++ -- simplePassword (1) ++ -- md5 (2) ++ -- reserved for specification by IANA (> 2) ++ MAX-ACCESS read-create ++ STATUS obsolete ++ DESCRIPTION ++ "The authentication type specified for an area. ++ Additional authentication types may be assigned ++ locally on a per Area basis." ++ REFERENCE ++ "OSPF Version 2, Appendix E Authentication" ++ DEFVAL { 0 } -- no authentication, by default ++ ::= { ospfAreaEntry 2 } ++ ++ ospfImportAsExtern OBJECT-TYPE ++ SYNTAX INTEGER { ++ importExternal (1), ++ importNoExternal (2), ++ importNssa (3) ++ } ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The area's support for importing AS external ++ link- state advertisements." ++ REFERENCE ++ "OSPF Version 2, Appendix C.2 Area parameters" ++ DEFVAL { importExternal } ++ ::= { ospfAreaEntry 3 } ++ ++ ++ ospfSpfRuns OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of times that the intra-area route ++ table has been calculated using this area's ++ link-state database. This is typically done ++ using Dijkstra's algorithm." ++ ::= { ospfAreaEntry 4 } ++ ++ ++ ospfAreaBdrRtrCount OBJECT-TYPE ++ SYNTAX Gauge32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The total number of area border routers reach- ++ able within this area. This is initially zero, ++ and is calculated in each SPF Pass." ++ ::= { ospfAreaEntry 5 } ++ ++ ospfAsBdrRtrCount OBJECT-TYPE ++ SYNTAX Gauge32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The total number of Autonomous System border ++ routers reachable within this area. This is ++ initially zero, and is calculated in each SPF ++ Pass." ++ ::= { ospfAreaEntry 6 } ++ ++ ++ ospfAreaLsaCount OBJECT-TYPE ++ SYNTAX Gauge32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The total number of link-state advertisements ++ in this area's link-state database, excluding ++ AS External LSA's." ++ ::= { ospfAreaEntry 7 } ++ ++ ++ ospfAreaLsaCksumSum OBJECT-TYPE ++ SYNTAX Integer32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The 32-bit unsigned sum of the link-state ad- ++ vertisements' LS checksums contained in this ++ area's link-state database. This sum excludes ++ external (LS type 5) link-state advertisements. ++ The sum can be used to determine if there has ++ been a change in a router's link state data- ++ base, and to compare the link-state database of ++ two routers." ++ DEFVAL { 0 } ++ ::= { ospfAreaEntry 8 } ++ ++ ospfAreaSummary OBJECT-TYPE ++ SYNTAX INTEGER { ++ noAreaSummary (1), ++ sendAreaSummary (2) ++ } ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The variable ospfAreaSummary controls the im- ++ port of summary LSAs into stub areas. It has ++ no effect on other areas. ++ ++ If it is noAreaSummary, the router will neither ++ originate nor propagate summary LSAs into the ++ stub area. It will rely entirely on its de- ++ fault route. ++ ++ If it is sendAreaSummary, the router will both ++ summarize and propagate summary LSAs." ++ DEFVAL { noAreaSummary } ++ ::= { ospfAreaEntry 9 } ++ ++ ++ ospfAreaStatus OBJECT-TYPE ++ SYNTAX RowStatus ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "This variable displays the status of the en- ++ try. Setting it to 'invalid' has the effect of ++ rendering it inoperative. The internal effect ++ (row removal) is implementation dependent." ++ ::= { ospfAreaEntry 10 } ++ ++ ++-- OSPF Area Default Metric Table ++ ++-- The OSPF Area Default Metric Table describes the metrics ++-- that a default Area Border Router will advertise into a ++-- Stub area. ++ ++ ++ ospfStubAreaTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF OspfStubAreaEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "The set of metrics that will be advertised by ++ a default Area Border Router into a stub area." ++ REFERENCE ++ "OSPF Version 2, Appendix C.2, Area Parameters" ++ ::= { ospf 3 } ++ ++ ++ ospfStubAreaEntry OBJECT-TYPE ++ SYNTAX OspfStubAreaEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "The metric for a given Type of Service that ++ will be advertised by a default Area Border ++ Router into a stub area." ++ REFERENCE ++ "OSPF Version 2, Appendix C.2, Area Parameters" ++ INDEX { ospfStubAreaId, ospfStubTOS } ++ ::= { ospfStubAreaTable 1 } ++ ++OspfStubAreaEntry ::= ++ SEQUENCE { ++ ospfStubAreaId ++ AreaID, ++ ospfStubTOS ++ TOSType, ++ ospfStubMetric ++ BigMetric, ++ ospfStubStatus ++ RowStatus, ++ ospfStubMetricType ++ INTEGER ++ } ++ ++ ospfStubAreaId OBJECT-TYPE ++ SYNTAX AreaID ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The 32 bit identifier for the Stub Area. On ++ creation, this can be derived from the in- ++ stance." ++ ::= { ospfStubAreaEntry 1 } ++ ++ ++ ospfStubTOS OBJECT-TYPE ++ SYNTAX TOSType ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The Type of Service associated with the ++ metric. On creation, this can be derived from ++ the instance." ++ ::= { ospfStubAreaEntry 2 } ++ ++ ++ ospfStubMetric OBJECT-TYPE ++ SYNTAX BigMetric ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The metric value applied at the indicated type ++ of service. By default, this equals the least ++ metric at the type of service among the inter- ++ faces to other areas." ++ ::= { ospfStubAreaEntry 3 } ++ ++ ++ ospfStubStatus OBJECT-TYPE ++ SYNTAX RowStatus ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "This variable displays the status of the en- ++ try. Setting it to 'invalid' has the effect of ++ rendering it inoperative. The internal effect ++ (row removal) is implementation dependent." ++ ::= { ospfStubAreaEntry 4 } ++ ++ ospfStubMetricType OBJECT-TYPE ++ SYNTAX INTEGER { ++ ospfMetric (1), -- OSPF Metric ++ comparableCost (2), -- external type 1 ++ nonComparable (3) -- external type 2 ++ } ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "This variable displays the type of metric ad- ++ vertised as a default route." ++ DEFVAL { ospfMetric } ++ ::= { ospfStubAreaEntry 5 } ++ ++-- OSPF Link State Database ++ ++-- The Link State Database contains the Link State ++-- Advertisements from throughout the areas that the ++-- device is attached to. ++ ++ ++ ospfLsdbTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF OspfLsdbEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "The OSPF Process's Link State Database." ++ REFERENCE ++ "OSPF Version 2, Section 12 Link State Adver- ++ tisements" ++ ::= { ospf 4 } ++ ++ ++ ospfLsdbEntry OBJECT-TYPE ++ SYNTAX OspfLsdbEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "A single Link State Advertisement." ++ INDEX { ospfLsdbAreaId, ospfLsdbType, ++ ospfLsdbLsid, ospfLsdbRouterId } ++ ::= { ospfLsdbTable 1 } ++ ++OspfLsdbEntry ::= ++ SEQUENCE { ++ ospfLsdbAreaId ++ AreaID, ++ ospfLsdbType ++ INTEGER, ++ ospfLsdbLsid ++ IpAddress, ++ ospfLsdbRouterId ++ RouterID, ++ ospfLsdbSequence ++ Integer32, ++ ospfLsdbAge ++ Integer32, ++ ospfLsdbChecksum ++ Integer32, ++ ospfLsdbAdvertisement ++ OCTET STRING ++ } ++ ospfLsdbAreaId OBJECT-TYPE ++ SYNTAX AreaID ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The 32 bit identifier of the Area from which ++ the LSA was received." ++ REFERENCE ++ "OSPF Version 2, Appendix C.2 Area parameters" ++ ::= { ospfLsdbEntry 1 } ++ ++-- External Link State Advertisements are permitted ++-- for backward compatibility, but should be displayed in ++-- the ospfExtLsdbTable rather than here. ++ ++ ospfLsdbType OBJECT-TYPE ++ SYNTAX INTEGER { ++ routerLink (1), ++ networkLink (2), ++ summaryLink (3), ++ asSummaryLink (4), ++ asExternalLink (5), -- but see ospfExtLsdbTable ++ multicastLink (6), ++ nssaExternalLink (7) ++ } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The type of the link state advertisement. ++ Each link state type has a separate advertise- ++ ment format." ++ REFERENCE ++ "OSPF Version 2, Appendix A.4.1 The Link State ++ Advertisement header" ++ ::= { ospfLsdbEntry 2 } ++ ++ ospfLsdbLsid OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The Link State ID is an LS Type Specific field ++ containing either a Router ID or an IP Address; ++ it identifies the piece of the routing domain ++ that is being described by the advertisement." ++ REFERENCE ++ "OSPF Version 2, Section 12.1.4 Link State ID" ++ ::= { ospfLsdbEntry 3 } ++ ospfLsdbRouterId OBJECT-TYPE ++ SYNTAX RouterID ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The 32 bit number that uniquely identifies the ++ originating router in the Autonomous System." ++ REFERENCE ++ "OSPF Version 2, Appendix C.1 Global parameters" ++ ::= { ospfLsdbEntry 4 } ++ ++-- Note that the OSPF Sequence Number is a 32 bit signed ++-- integer. It starts with the value '80000001'h, ++-- or -'7FFFFFFF'h, and increments until '7FFFFFFF'h ++-- Thus, a typical sequence number will be very negative. ++ ++ ospfLsdbSequence OBJECT-TYPE ++ SYNTAX Integer32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The sequence number field is a signed 32-bit ++ integer. It is used to detect old and dupli- ++ cate link state advertisements. The space of ++ sequence numbers is linearly ordered. The ++ larger the sequence number the more recent the ++ advertisement." ++ REFERENCE ++ "OSPF Version 2, Section 12.1.6 LS sequence ++ number" ++ ::= { ospfLsdbEntry 5 } ++ ++ ++ ospfLsdbAge OBJECT-TYPE ++ SYNTAX Integer32 -- Should be 0..MaxAge ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "This field is the age of the link state adver- ++ tisement in seconds." ++ REFERENCE ++ "OSPF Version 2, Section 12.1.1 LS age" ++ ::= { ospfLsdbEntry 6 } ++ ++ ospfLsdbChecksum OBJECT-TYPE ++ SYNTAX Integer32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "This field is the checksum of the complete ++ contents of the advertisement, excepting the ++ age field. The age field is excepted so that ++ an advertisement's age can be incremented ++ without updating the checksum. The checksum ++ used is the same that is used for ISO connec- ++ tionless datagrams; it is commonly referred to ++ as the Fletcher checksum." ++ REFERENCE ++ "OSPF Version 2, Section 12.1.7 LS checksum" ++ ::= { ospfLsdbEntry 7 } ++ ++ ++ ospfLsdbAdvertisement OBJECT-TYPE ++ SYNTAX OCTET STRING (SIZE (1..65535)) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The entire Link State Advertisement, including ++ its header." ++ REFERENCE ++ "OSPF Version 2, Section 12 Link State Adver- ++ tisements" ++ ::= { ospfLsdbEntry 8 } ++ ++ ++-- Address Range Table ++ ++-- The Address Range Table acts as an adjunct to the Area ++-- Table; It describes those Address Range Summaries that ++-- are configured to be propagated from an Area to reduce ++-- the amount of information about it which is known beyond ++-- its borders. ++ ++ ospfAreaRangeTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF OspfAreaRangeEntry ++ MAX-ACCESS not-accessible ++ STATUS obsolete ++ DESCRIPTION ++ "A range if IP addresses specified by an IP ++ address/IP network mask pair. For example, ++ class B address range of X.X.X.X with a network ++ mask of 255.255.0.0 includes all IP addresses ++ from X.X.0.0 to X.X.255.255" ++ REFERENCE ++ "OSPF Version 2, Appendix C.2 Area parameters" ++ ::= { ospf 5 } ++ ospfAreaRangeEntry OBJECT-TYPE ++ SYNTAX OspfAreaRangeEntry ++ MAX-ACCESS not-accessible ++ STATUS obsolete ++ DESCRIPTION ++ "A range if IP addresses specified by an IP ++ address/IP network mask pair. For example, ++ class B address range of X.X.X.X with a network ++ mask of 255.255.0.0 includes all IP addresses ++ from X.X.0.0 to X.X.255.255" ++ REFERENCE ++ "OSPF Version 2, Appendix C.2 Area parameters" ++ INDEX { ospfAreaRangeAreaId, ospfAreaRangeNet } ++ ::= { ospfAreaRangeTable 1 } ++ ++OspfAreaRangeEntry ::= ++ SEQUENCE { ++ ospfAreaRangeAreaId ++ AreaID, ++ ospfAreaRangeNet ++ IpAddress, ++ ospfAreaRangeMask ++ IpAddress, ++ ospfAreaRangeStatus ++ RowStatus, ++ ospfAreaRangeEffect ++ INTEGER ++ } ++ ++ ospfAreaRangeAreaId OBJECT-TYPE ++ SYNTAX AreaID ++ MAX-ACCESS read-only ++ STATUS obsolete ++ DESCRIPTION ++ "The Area the Address Range is to be found ++ within." ++ REFERENCE ++ "OSPF Version 2, Appendix C.2 Area parameters" ++ ::= { ospfAreaRangeEntry 1 } ++ ++ ++ ospfAreaRangeNet OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS obsolete ++ DESCRIPTION ++ "The IP Address of the Net or Subnet indicated ++ by the range." ++ REFERENCE ++ "OSPF Version 2, Appendix C.2 Area parameters" ++ ::= { ospfAreaRangeEntry 2 } ++ ++ ++ ospfAreaRangeMask OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-create ++ STATUS obsolete ++ DESCRIPTION ++ "The Subnet Mask that pertains to the Net or ++ Subnet." ++ REFERENCE ++ "OSPF Version 2, Appendix C.2 Area parameters" ++ ::= { ospfAreaRangeEntry 3 } ++ ++ ospfAreaRangeStatus OBJECT-TYPE ++ SYNTAX RowStatus ++ MAX-ACCESS read-create ++ STATUS obsolete ++ DESCRIPTION ++ "This variable displays the status of the en- ++ try. Setting it to 'invalid' has the effect of ++ rendering it inoperative. The internal effect ++ (row removal) is implementation dependent." ++ ::= { ospfAreaRangeEntry 4 } ++ ++ ++ ospfAreaRangeEffect OBJECT-TYPE ++ SYNTAX INTEGER { ++ advertiseMatching (1), ++ doNotAdvertiseMatching (2) ++ } ++ MAX-ACCESS read-create ++ STATUS obsolete ++ DESCRIPTION ++ "Subnets subsumed by ranges either trigger the ++ advertisement of the indicated summary (adver- ++ tiseMatching), or result in the subnet's not ++ being advertised at all outside the area." ++ DEFVAL { advertiseMatching } ++ ::= { ospfAreaRangeEntry 5 } ++ ++ ++ ++-- OSPF Host Table ++ ++-- The Host/Metric Table indicates what hosts are directly ++-- attached to the Router, and what metrics and types of ++-- service should be advertised for them. ++ ++ ospfHostTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF OspfHostEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "The list of Hosts, and their metrics, that the ++ router will advertise as host routes." ++ REFERENCE ++ "OSPF Version 2, Appendix C.6 Host route param- ++ eters" ++ ::= { ospf 6 } ++ ++ ++ ospfHostEntry OBJECT-TYPE ++ SYNTAX OspfHostEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "A metric to be advertised, for a given type of ++ service, when a given host is reachable." ++ INDEX { ospfHostIpAddress, ospfHostTOS } ++ ::= { ospfHostTable 1 } ++ ++OspfHostEntry ::= ++ SEQUENCE { ++ ospfHostIpAddress ++ IpAddress, ++ ospfHostTOS ++ TOSType, ++ ospfHostMetric ++ Metric, ++ ospfHostStatus ++ RowStatus, ++ ospfHostAreaID ++ AreaID ++ } ++ ++ ospfHostIpAddress OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The IP Address of the Host." ++ REFERENCE ++ "OSPF Version 2, Appendix C.6 Host route parame- ++ ters" ++ ::= { ospfHostEntry 1 } ++ ++ ++ ospfHostTOS OBJECT-TYPE ++ SYNTAX TOSType ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The Type of Service of the route being config- ++ ured." ++ REFERENCE ++ "OSPF Version 2, Appendix C.6 Host route parame- ++ ters" ++ ::= { ospfHostEntry 2 } ++ ++ ++ ospfHostMetric OBJECT-TYPE ++ SYNTAX Metric ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The Metric to be advertised." ++ REFERENCE ++ "OSPF Version 2, Appendix C.6 Host route parame- ++ ters" ++ ::= { ospfHostEntry 3 } ++ ++ ospfHostStatus OBJECT-TYPE ++ SYNTAX RowStatus ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "This variable displays the status of the en- ++ try. Setting it to 'invalid' has the effect of ++ rendering it inoperative. The internal effect ++ (row removal) is implementation dependent." ++ ::= { ospfHostEntry 4 } ++ ++ ++ ospfHostAreaID OBJECT-TYPE ++ SYNTAX AreaID ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The Area the Host Entry is to be found within. ++ By default, the area that a subsuming OSPF in- ++ terface is in, or 0.0.0.0" ++ REFERENCE ++ "OSPF Version 2, Appendix C.2 Area parameters" ++ ::= { ospfHostEntry 5 } ++ ++ ++-- OSPF Interface Table ++ ++-- The OSPF Interface Table augments the ipAddrTable ++-- with OSPF specific information. ++ ++ ospfIfTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF OspfIfEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "The OSPF Interface Table describes the inter- ++ faces from the viewpoint of OSPF." ++ REFERENCE ++ "OSPF Version 2, Appendix C.3 Router interface ++ parameters" ++ ::= { ospf 7 } ++ ++ ++ ospfIfEntry OBJECT-TYPE ++ SYNTAX OspfIfEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "The OSPF Interface Entry describes one inter- ++ face from the viewpoint of OSPF." ++ INDEX { ospfIfIpAddress, ospfAddressLessIf } ++ ::= { ospfIfTable 1 } ++ ++OspfIfEntry ::= ++ SEQUENCE { ++ ospfIfIpAddress ++ IpAddress, ++ ospfAddressLessIf ++ Integer32, ++ ospfIfAreaId ++ AreaID, ++ ospfIfType ++ INTEGER, ++ ospfIfAdminStat ++ Status, ++ ospfIfRtrPriority ++ DesignatedRouterPriority, ++ ospfIfTransitDelay ++ UpToMaxAge, ++ ospfIfRetransInterval ++ UpToMaxAge, ++ ospfIfHelloInterval ++ HelloRange, ++ ospfIfRtrDeadInterval ++ PositiveInteger, ++ ospfIfPollInterval ++ PositiveInteger, ++ ospfIfState ++ INTEGER, ++ ospfIfDesignatedRouter ++ IpAddress, ++ ospfIfBackupDesignatedRouter ++ IpAddress, ++ ospfIfEvents ++ Counter32, ++ ospfIfAuthType ++ INTEGER, ++ ospfIfAuthKey ++ OCTET STRING, ++ ospfIfStatus ++ RowStatus, ++ ospfIfMulticastForwarding ++ INTEGER, ++ ospfIfDemand ++ TruthValue ++ } ++ ++ ospfIfIpAddress OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The IP address of this OSPF interface." ++ ::= { ospfIfEntry 1 } ++ ++ ospfAddressLessIf OBJECT-TYPE ++ SYNTAX Integer32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "For the purpose of easing the instancing of ++ addressed and addressless interfaces; This ++ variable takes the value 0 on interfaces with ++ IP Addresses, and the corresponding value of ++ ifIndex for interfaces having no IP Address." ++ ::= { ospfIfEntry 2 } ++ ospfIfAreaId OBJECT-TYPE ++ SYNTAX AreaID ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "A 32-bit integer uniquely identifying the area ++ to which the interface connects. Area ID ++ 0.0.0.0 is used for the OSPF backbone." ++ DEFVAL { '00000000'H } -- 0.0.0.0 ++ ::= { ospfIfEntry 3 } ++ ++ ospfIfType OBJECT-TYPE ++ SYNTAX INTEGER { ++ broadcast (1), ++ nbma (2), ++ pointToPoint (3), ++ pointToMultipoint (5) ++ } ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The OSPF interface type. ++ ++ By way of a default, this field may be intuited ++ from the corresponding value of ifType. Broad- ++ cast LANs, such as Ethernet and IEEE 802.5, ++ take the value 'broadcast', X.25 and similar ++ technologies take the value 'nbma', and links ++ that are definitively point to point take the ++ value 'pointToPoint'." ++ ::= { ospfIfEntry 4 } ++ ++ ++ ospfIfAdminStat OBJECT-TYPE ++ SYNTAX Status ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The OSPF interface's administrative status. ++ The value formed on the interface, and the in- ++ terface will be advertised as an internal route ++ to some area. The value 'disabled' denotes ++ that the interface is external to OSPF." ++ DEFVAL { enabled } ++ ::= { ospfIfEntry 5 } ++ ++ ospfIfRtrPriority OBJECT-TYPE ++ SYNTAX DesignatedRouterPriority ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The priority of this interface. Used in ++ multi-access networks, this field is used in ++ the designated router election algorithm. The ++ value 0 signifies that the router is not eligi- ++ ble to become the designated router on this ++ particular network. In the event of a tie in ++ this value, routers will use their Router ID as ++ a tie breaker." ++ DEFVAL { 1 } ++ ::= { ospfIfEntry 6 } ++ ++ ++ ospfIfTransitDelay OBJECT-TYPE ++ SYNTAX UpToMaxAge ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The estimated number of seconds it takes to ++ transmit a link state update packet over this ++ interface." ++ DEFVAL { 1 } ++ ::= { ospfIfEntry 7 } ++ ++ ++ ospfIfRetransInterval OBJECT-TYPE ++ SYNTAX UpToMaxAge ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The number of seconds between link-state ad- ++ vertisement retransmissions, for adjacencies ++ belonging to this interface. This value is ++ also used when retransmitting database descrip- ++ tion and link-state request packets." ++ DEFVAL { 5 } ++ ::= { ospfIfEntry 8 } ++ ++ ++ ospfIfHelloInterval OBJECT-TYPE ++ SYNTAX HelloRange ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The length of time, in seconds, between the ++ Hello packets that the router sends on the in- ++ terface. This value must be the same for all ++ routers attached to a common network." ++ DEFVAL { 10 } ++ ::= { ospfIfEntry 9 } ++ ++ ++ ospfIfRtrDeadInterval OBJECT-TYPE ++ SYNTAX PositiveInteger ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The number of seconds that a router's Hello ++ packets have not been seen before it's neigh- ++ bors declare the router down. This should be ++ some multiple of the Hello interval. This ++ value must be the same for all routers attached ++ to a common network." ++ DEFVAL { 40 } ++ ::= { ospfIfEntry 10 } ++ ++ ++ ospfIfPollInterval OBJECT-TYPE ++ SYNTAX PositiveInteger ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The larger time interval, in seconds, between ++ the Hello packets sent to an inactive non- ++ broadcast multi- access neighbor." ++ DEFVAL { 120 } ++ ::= { ospfIfEntry 11 } ++ ++ ++ ospfIfState OBJECT-TYPE ++ SYNTAX INTEGER { ++ down (1), ++ loopback (2), ++ waiting (3), ++ pointToPoint (4), ++ designatedRouter (5), ++ backupDesignatedRouter (6), ++ otherDesignatedRouter (7) ++ } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The OSPF Interface State." ++ DEFVAL { down } ++ ::= { ospfIfEntry 12 } ++ ++ ++ ospfIfDesignatedRouter OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The IP Address of the Designated Router." ++ DEFVAL { '00000000'H } -- 0.0.0.0 ++ ::= { ospfIfEntry 13 } ++ ++ ++ ospfIfBackupDesignatedRouter OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The IP Address of the Backup Designated ++ Router." ++ DEFVAL { '00000000'H } -- 0.0.0.0 ++ ::= { ospfIfEntry 14 } ++ ++ ospfIfEvents OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of times this OSPF interface has ++ changed its state, or an error has occurred." ++ ::= { ospfIfEntry 15 } ++ ++ ++ ospfIfAuthKey OBJECT-TYPE ++ SYNTAX OCTET STRING (SIZE (0..256)) ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The Authentication Key. If the Area's Author- ++ ization Type is simplePassword, and the key ++ length is shorter than 8 octets, the agent will ++ left adjust and zero fill to 8 octets. ++ ++ Note that unauthenticated interfaces need no ++ authentication key, and simple password authen- ++ tication cannot use a key of more than 8 oc- ++ tets. Larger keys are useful only with authen- ++ tication mechanisms not specified in this docu- ++ ment. ++ ++ When read, ospfIfAuthKey always returns an Oc- ++ tet String of length zero." ++ REFERENCE ++ "OSPF Version 2, Section 9 The Interface Data ++ Structure" ++ DEFVAL { '0000000000000000'H } -- 0.0.0.0.0.0.0.0 ++ ::= { ospfIfEntry 16 } ++ ++ ospfIfStatus OBJECT-TYPE ++ SYNTAX RowStatus ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "This variable displays the status of the en- ++ try. Setting it to 'invalid' has the effect of ++ rendering it inoperative. The internal effect ++ (row removal) is implementation dependent." ++ ::= { ospfIfEntry 17 } ++ ++ ++ ospfIfMulticastForwarding OBJECT-TYPE ++ SYNTAX INTEGER { ++ blocked (1), -- no multicast forwarding ++ multicast (2), -- using multicast address ++ unicast (3) -- to each OSPF neighbor ++ } ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The way multicasts should forwarded on this ++ interface; not forwarded, forwarded as data ++ link multicasts, or forwarded as data link uni- ++ casts. Data link multicasting is not meaning- ++ ful on point to point and NBMA interfaces, and ++ setting ospfMulticastForwarding to 0 effective- ++ ly disables all multicast forwarding." ++ DEFVAL { blocked } ++ ::= { ospfIfEntry 18 } ++ ++ ++ ospfIfDemand OBJECT-TYPE ++ SYNTAX TruthValue ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "Indicates whether Demand OSPF procedures (hel- ++ lo supression to FULL neighbors and setting the ++ DoNotAge flag on proogated LSAs) should be per- ++ formed on this interface." ++ DEFVAL { false } ++ ::= { ospfIfEntry 19 } ++ ++ ++ ospfIfAuthType OBJECT-TYPE ++ SYNTAX INTEGER (0..255) ++ -- none (0), ++ -- simplePassword (1) ++ -- md5 (2) ++ -- reserved for specification by IANA (> 2) ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The authentication type specified for an in- ++ terface. Additional authentication types may ++ be assigned locally." ++ REFERENCE ++ "OSPF Version 2, Appendix E Authentication" ++ DEFVAL { 0 } -- no authentication, by default ++ ::= { ospfIfEntry 20 } ++ ++ ++-- OSPF Interface Metric Table ++ ++-- The Metric Table describes the metrics to be advertised ++-- for a specified interface at the various types of service. ++-- As such, this table is an adjunct of the OSPF Interface ++-- Table. ++ ++-- Types of service, as defined by RFC 791, have the ability ++-- to request low delay, high bandwidth, or reliable linkage. ++ ++-- For the purposes of this specification, the measure of ++-- bandwidth ++ ++-- Metric = 10^8 / ifSpeed ++ ++-- is the default value. For multiple link interfaces, note ++-- that ifSpeed is the sum of the individual link speeds. ++-- This yields a number having the following typical values: ++ ++-- Network Type/bit rate Metric ++ ++-- >= 100 MBPS 1 ++-- Ethernet/802.3 10 ++-- E1 48 ++-- T1 (ESF) 65 ++-- 64 KBPS 1562 ++-- 56 KBPS 1785 ++-- 19.2 KBPS 5208 ++-- 9.6 KBPS 10416 ++ ++-- Routes that are not specified use the default (TOS 0) metric ++ ++ ospfIfMetricTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF OspfIfMetricEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "The TOS metrics for a non-virtual interface ++ identified by the interface index." ++ REFERENCE ++ "OSPF Version 2, Appendix C.3 Router interface ++ parameters" ++ ::= { ospf 8 } ++ ++ ospfIfMetricEntry OBJECT-TYPE ++ SYNTAX OspfIfMetricEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "A particular TOS metric for a non-virtual in- ++ terface identified by the interface index." ++ REFERENCE ++ "OSPF Version 2, Appendix C.3 Router interface ++ parameters" ++ INDEX { ospfIfMetricIpAddress, ++ ospfIfMetricAddressLessIf, ++ ospfIfMetricTOS } ++ ::= { ospfIfMetricTable 1 } ++ ++OspfIfMetricEntry ::= ++ SEQUENCE { ++ ospfIfMetricIpAddress ++ IpAddress, ++ ospfIfMetricAddressLessIf ++ Integer32, ++ ospfIfMetricTOS ++ TOSType, ++ ospfIfMetricValue ++ Metric, ++ ospfIfMetricStatus ++ RowStatus ++ } ++ ++ ospfIfMetricIpAddress OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The IP address of this OSPF interface. On row ++ creation, this can be derived from the in- ++ stance." ++ ::= { ospfIfMetricEntry 1 } ++ ++ ospfIfMetricAddressLessIf OBJECT-TYPE ++ SYNTAX Integer32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "For the purpose of easing the instancing of ++ addressed and addressless interfaces; This ++ variable takes the value 0 on interfaces with ++ IP Addresses, and the value of ifIndex for in- ++ terfaces having no IP Address. On row crea- ++ tion, this can be derived from the instance." ++ ::= { ospfIfMetricEntry 2 } ++ ++ ++ ospfIfMetricTOS OBJECT-TYPE ++ SYNTAX TOSType ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The type of service metric being referenced. ++ On row creation, this can be derived from the ++ instance." ++ ::= { ospfIfMetricEntry 3 } ++ ++ ++ ospfIfMetricValue OBJECT-TYPE ++ SYNTAX Metric ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The metric of using this type of service on ++ this interface. The default value of the TOS 0 ++ Metric is 10^8 / ifSpeed." ++ ::= { ospfIfMetricEntry 4 } ++ ++ ospfIfMetricStatus OBJECT-TYPE ++ SYNTAX RowStatus ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "This variable displays the status of the en- ++ try. Setting it to 'invalid' has the effect of ++ rendering it inoperative. The internal effect ++ (row removal) is implementation dependent." ++ ::= { ospfIfMetricEntry 5 } ++ ++ ++-- OSPF Virtual Interface Table ++ ++-- The Virtual Interface Table describes the virtual ++-- links that the OSPF Process is configured to ++-- carry on. ++ ++ ospfVirtIfTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF OspfVirtIfEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "Information about this router's virtual inter- ++ faces." ++ REFERENCE ++ "OSPF Version 2, Appendix C.4 Virtual link ++ parameters" ++ ::= { ospf 9 } ++ ++ ++ ospfVirtIfEntry OBJECT-TYPE ++ SYNTAX OspfVirtIfEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "Information about a single Virtual Interface." ++ INDEX { ospfVirtIfAreaId, ospfVirtIfNeighbor } ++ ::= { ospfVirtIfTable 1 } ++ ++OspfVirtIfEntry ::= ++ SEQUENCE { ++ ospfVirtIfAreaId ++ AreaID, ++ ospfVirtIfNeighbor ++ RouterID, ++ ospfVirtIfTransitDelay ++ UpToMaxAge, ++ ospfVirtIfRetransInterval ++ UpToMaxAge, ++ ospfVirtIfHelloInterval ++ HelloRange, ++ ospfVirtIfRtrDeadInterval ++ PositiveInteger, ++ ospfVirtIfState ++ INTEGER, ++ ospfVirtIfEvents ++ Counter32, ++ ospfVirtIfAuthType ++ INTEGER, ++ ospfVirtIfAuthKey ++ OCTET STRING, ++ ospfVirtIfStatus ++ RowStatus ++ } ++ ++ ospfVirtIfAreaId OBJECT-TYPE ++ SYNTAX AreaID ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The Transit Area that the Virtual Link ++ traverses. By definition, this is not 0.0.0.0" ++ ::= { ospfVirtIfEntry 1 } ++ ++ ++ ospfVirtIfNeighbor OBJECT-TYPE ++ SYNTAX RouterID ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The Router ID of the Virtual Neighbor." ++ ::= { ospfVirtIfEntry 2 } ++ ++ ++ ospfVirtIfTransitDelay OBJECT-TYPE ++ SYNTAX UpToMaxAge ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The estimated number of seconds it takes to ++ transmit a link- state update packet over this ++ interface." ++ DEFVAL { 1 } ++ ::= { ospfVirtIfEntry 3 } ++ ++ ++ ospfVirtIfRetransInterval OBJECT-TYPE ++ SYNTAX UpToMaxAge ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The number of seconds between link-state ad- ++ vertisement retransmissions, for adjacencies ++ belonging to this interface. This value is ++ also used when retransmitting database descrip- ++ tion and link-state request packets. This ++ value should be well over the expected round- ++ trip time." ++ DEFVAL { 5 } ++ ::= { ospfVirtIfEntry 4 } ++ ++ ++ ospfVirtIfHelloInterval OBJECT-TYPE ++ SYNTAX HelloRange ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The length of time, in seconds, between the ++ Hello packets that the router sends on the in- ++ terface. This value must be the same for the ++ virtual neighbor." ++ DEFVAL { 10 } ++ ::= { ospfVirtIfEntry 5 } ++ ++ ++ ospfVirtIfRtrDeadInterval OBJECT-TYPE ++ SYNTAX PositiveInteger ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The number of seconds that a router's Hello ++ packets have not been seen before it's neigh- ++ bors declare the router down. This should be ++ some multiple of the Hello interval. This ++ value must be the same for the virtual neigh- ++ bor." ++ DEFVAL { 60 } ++ ::= { ospfVirtIfEntry 6 } ++ ++ ++ ospfVirtIfState OBJECT-TYPE ++ SYNTAX INTEGER { ++ down (1), -- these use the same encoding ++ pointToPoint (4) -- as the ospfIfTable ++ } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "OSPF virtual interface states." ++ DEFVAL { down } ++ ::= { ospfVirtIfEntry 7 } ++ ++ ++ ospfVirtIfEvents OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of state changes or error events on ++ this Virtual Link" ++ ::= { ospfVirtIfEntry 8 } ++ ++ ++ ospfVirtIfAuthKey OBJECT-TYPE ++ SYNTAX OCTET STRING (SIZE(0..256)) ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "If Authentication Type is simplePassword, the ++ device will left adjust and zero fill to 8 oc- ++ tets. ++ ++ Note that unauthenticated interfaces need no ++ authentication key, and simple password authen- ++ tication cannot use a key of more than 8 oc- ++ tets. Larger keys are useful only with authen- ++ tication mechanisms not specified in this docu- ++ ment. ++ ++ When read, ospfVifAuthKey always returns a ++ string of length zero." ++ REFERENCE ++ "OSPF Version 2, Section 9 The Interface Data ++ Structure" ++ DEFVAL { '0000000000000000'H } -- 0.0.0.0.0.0.0.0 ++ ::= { ospfVirtIfEntry 9 } ++ ++ ++ ospfVirtIfStatus OBJECT-TYPE ++ SYNTAX RowStatus ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "This variable displays the status of the en- ++ try. Setting it to 'invalid' has the effect of ++ rendering it inoperative. The internal effect ++ (row removal) is implementation dependent." ++ ::= { ospfVirtIfEntry 10 } ++ ++ ++ ospfVirtIfAuthType OBJECT-TYPE ++ SYNTAX INTEGER (0..255) ++ -- none (0), ++ -- simplePassword (1) ++ -- md5 (2) ++ -- reserved for specification by IANA (> 2) ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The authentication type specified for a virtu- ++ al interface. Additional authentication types ++ may be assigned locally." ++ REFERENCE ++ "OSPF Version 2, Appendix E Authentication" ++ DEFVAL { 0 } -- no authentication, by default ++ ::= { ospfVirtIfEntry 11 } ++ ++ ++-- OSPF Neighbor Table ++ ++-- The OSPF Neighbor Table describes all neighbors in ++-- the locality of the subject router. ++ ++ ospfNbrTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF OspfNbrEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "A table of non-virtual neighbor information." ++ REFERENCE ++ "OSPF Version 2, Section 10 The Neighbor Data ++ Structure" ++ ::= { ospf 10 } ++ ++ ++ ospfNbrEntry OBJECT-TYPE ++ SYNTAX OspfNbrEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "The information regarding a single neighbor." ++ REFERENCE ++ "OSPF Version 2, Section 10 The Neighbor Data ++ Structure" ++ INDEX { ospfNbrIpAddr, ospfNbrAddressLessIndex } ++ ::= { ospfNbrTable 1 } ++ ++OspfNbrEntry ::= ++ SEQUENCE { ++ ospfNbrIpAddr ++ IpAddress, ++ ospfNbrAddressLessIndex ++ InterfaceIndex, ++ ospfNbrRtrId ++ RouterID, ++ ospfNbrOptions ++ Integer32, ++ ospfNbrPriority ++ DesignatedRouterPriority, ++ ospfNbrState ++ INTEGER, ++ ospfNbrEvents ++ Counter32, ++ ospfNbrLsRetransQLen ++ Gauge32, ++ ospfNbmaNbrStatus ++ RowStatus, ++ ospfNbmaNbrPermanence ++ INTEGER, ++ ospfNbrHelloSuppressed ++ TruthValue ++ } ++ ++ ospfNbrIpAddr OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The IP address this neighbor is using in its ++ IP Source Address. Note that, on addressless ++ links, this will not be 0.0.0.0, but the ad- ++ dress of another of the neighbor's interfaces." ++ ::= { ospfNbrEntry 1 } ++ ++ ++ ospfNbrAddressLessIndex OBJECT-TYPE ++ SYNTAX InterfaceIndex ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "On an interface having an IP Address, zero. ++ On addressless interfaces, the corresponding ++ value of ifIndex in the Internet Standard MIB. ++ On row creation, this can be derived from the ++ instance." ++ ::= { ospfNbrEntry 2 } ++ ++ ++ ospfNbrRtrId OBJECT-TYPE ++ SYNTAX RouterID ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "A 32-bit integer (represented as a type IpAd- ++ dress) uniquely identifying the neighboring ++ router in the Autonomous System." ++ DEFVAL { '00000000'H } -- 0.0.0.0 ++ ::= { ospfNbrEntry 3 } ++ ++ ++ ospfNbrOptions OBJECT-TYPE ++ SYNTAX Integer32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "A Bit Mask corresponding to the neighbor's op- ++ tions field. ++ ++ Bit 0, if set, indicates that the system will ++ operate on Type of Service metrics other than ++ TOS 0. If zero, the neighbor will ignore all ++ metrics except the TOS 0 metric. ++ ++ Bit 1, if set, indicates that the associated ++ area accepts and operates on external informa- ++ tion; if zero, it is a stub area. ++ ++ Bit 2, if set, indicates that the system is ca- ++ pable of routing IP Multicast datagrams; i.e., ++ that it implements the Multicast Extensions to ++ OSPF. ++ ++ Bit 3, if set, indicates that the associated ++ area is an NSSA. These areas are capable of ++ carrying type 7 external advertisements, which ++ are translated into type 5 external advertise- ++ ments at NSSA borders." ++ REFERENCE ++ "OSPF Version 2, Section 12.1.2 Options" ++ DEFVAL { 0 } ++ ::= { ospfNbrEntry 4 } ++ ++ ++ ospfNbrPriority OBJECT-TYPE ++ SYNTAX DesignatedRouterPriority ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The priority of this neighbor in the designat- ++ ed router election algorithm. The value 0 sig- ++ nifies that the neighbor is not eligible to be- ++ come the designated router on this particular ++ network." ++ DEFVAL { 1 } ++ ::= { ospfNbrEntry 5 } ++ ++ ++ ospfNbrState OBJECT-TYPE ++ SYNTAX INTEGER { ++ down (1), ++ attempt (2), ++ init (3), ++ twoWay (4), ++ exchangeStart (5), ++ exchange (6), ++ loading (7), ++ full (8) ++ } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The State of the relationship with this Neigh- ++ bor." ++ REFERENCE ++ "OSPF Version 2, Section 10.1 Neighbor States" ++ DEFVAL { down } ++ ::= { ospfNbrEntry 6 } ++ ++ ++ ospfNbrEvents OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of times this neighbor relationship ++ has changed state, or an error has occurred." ++ ::= { ospfNbrEntry 7 } ++ ++ ++ ospfNbrLsRetransQLen OBJECT-TYPE ++ SYNTAX Gauge32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The current length of the retransmission ++ queue." ++ ::= { ospfNbrEntry 8 } ++ ++ ++ ospfNbmaNbrStatus OBJECT-TYPE ++ SYNTAX RowStatus ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "This variable displays the status of the en- ++ try. Setting it to 'invalid' has the effect of ++ rendering it inoperative. The internal effect ++ (row removal) is implementation dependent." ++ ::= { ospfNbrEntry 9 } ++ ++ ++ ospfNbmaNbrPermanence OBJECT-TYPE ++ SYNTAX INTEGER { ++ dynamic (1), -- learned through protocol ++ permanent (2) -- configured address ++ } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "This variable displays the status of the en- ++ try. 'dynamic' and 'permanent' refer to how ++ the neighbor became known." ++ DEFVAL { permanent } ++ ::= { ospfNbrEntry 10 } ++ ++ ++ ospfNbrHelloSuppressed OBJECT-TYPE ++ SYNTAX TruthValue ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "Indicates whether Hellos are being suppressed ++ to the neighbor" ++ ::= { ospfNbrEntry 11 } ++ ++ ++-- OSPF Virtual Neighbor Table ++ ++-- This table describes all virtual neighbors. ++-- Since Virtual Links are configured in the ++-- virtual interface table, this table is read-only. ++ ++ ospfVirtNbrTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF OspfVirtNbrEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "A table of virtual neighbor information." ++ REFERENCE ++ "OSPF Version 2, Section 15 Virtual Links" ++ ::= { ospf 11 } ++ ++ ++ ospfVirtNbrEntry OBJECT-TYPE ++ SYNTAX OspfVirtNbrEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "Virtual neighbor information." ++ INDEX { ospfVirtNbrArea, ospfVirtNbrRtrId } ++ ::= { ospfVirtNbrTable 1 } ++ ++OspfVirtNbrEntry ::= ++ SEQUENCE { ++ ospfVirtNbrArea ++ AreaID, ++ ospfVirtNbrRtrId ++ RouterID, ++ ospfVirtNbrIpAddr ++ IpAddress, ++ ospfVirtNbrOptions ++ Integer32, ++ ospfVirtNbrState ++ INTEGER, ++ ospfVirtNbrEvents ++ Counter32, ++ ospfVirtNbrLsRetransQLen ++ Gauge32, ++ ospfVirtNbrHelloSuppressed ++ TruthValue ++ } ++ ++ ospfVirtNbrArea OBJECT-TYPE ++ SYNTAX AreaID ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The Transit Area Identifier." ++ ::= { ospfVirtNbrEntry 1 } ++ ++ ++ ospfVirtNbrRtrId OBJECT-TYPE ++ SYNTAX RouterID ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "A 32-bit integer uniquely identifying the ++ neighboring router in the Autonomous System." ++ ::= { ospfVirtNbrEntry 2 } ++ ++ ++ ospfVirtNbrIpAddr OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The IP address this Virtual Neighbor is us- ++ ing." ++ ::= { ospfVirtNbrEntry 3 } ++ ++ ++ ospfVirtNbrOptions OBJECT-TYPE ++ SYNTAX Integer32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "A Bit Mask corresponding to the neighbor's op- ++ tions field. ++ ++ Bit 1, if set, indicates that the system will ++ operate on Type of Service metrics other than ++ TOS 0. If zero, the neighbor will ignore all ++ metrics except the TOS 0 metric. ++ ++ Bit 2, if set, indicates that the system is ++ Network Multicast capable; ie, that it imple- ++ ments OSPF Multicast Routing." ++ ::= { ospfVirtNbrEntry 4 } ++ ospfVirtNbrState OBJECT-TYPE ++ SYNTAX INTEGER { ++ down (1), ++ attempt (2), ++ init (3), ++ twoWay (4), ++ exchangeStart (5), ++ exchange (6), ++ loading (7), ++ full (8) ++ } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The state of the Virtual Neighbor Relation- ++ ship." ++ ::= { ospfVirtNbrEntry 5 } ++ ++ ++ ospfVirtNbrEvents OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of times this virtual link has ++ changed its state, or an error has occurred." ++ ::= { ospfVirtNbrEntry 6 } ++ ++ ++ ospfVirtNbrLsRetransQLen OBJECT-TYPE ++ SYNTAX Gauge32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The current length of the retransmission ++ queue." ++ ::= { ospfVirtNbrEntry 7 } ++ ++ ++ ospfVirtNbrHelloSuppressed OBJECT-TYPE ++ SYNTAX TruthValue ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "Indicates whether Hellos are being suppressed ++ to the neighbor" ++ ::= { ospfVirtNbrEntry 8 } ++ ++-- OSPF Link State Database, External ++ ++-- The Link State Database contains the Link State ++-- Advertisements from throughout the areas that the ++-- device is attached to. ++ ++-- This table is identical to the OSPF LSDB Table in ++-- format, but contains only External Link State ++-- Advertisements. The purpose is to allow external ++-- LSAs to be displayed once for the router rather ++-- than once in each non-stub area. ++ ++ ospfExtLsdbTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF OspfExtLsdbEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "The OSPF Process's Links State Database." ++ REFERENCE ++ "OSPF Version 2, Section 12 Link State Adver- ++ tisements" ++ ::= { ospf 12 } ++ ++ ++ ospfExtLsdbEntry OBJECT-TYPE ++ SYNTAX OspfExtLsdbEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "A single Link State Advertisement." ++ INDEX { ospfExtLsdbType, ospfExtLsdbLsid, ospfExtLsdbRouterId } ++ ::= { ospfExtLsdbTable 1 } ++ ++OspfExtLsdbEntry ::= ++ SEQUENCE { ++ ospfExtLsdbType ++ INTEGER, ++ ospfExtLsdbLsid ++ IpAddress, ++ ospfExtLsdbRouterId ++ RouterID, ++ ospfExtLsdbSequence ++ Integer32, ++ ospfExtLsdbAge ++ Integer32, ++ ospfExtLsdbChecksum ++ Integer32, ++ ospfExtLsdbAdvertisement ++ OCTET STRING ++ } ++ ++ ospfExtLsdbType OBJECT-TYPE ++ SYNTAX INTEGER { ++ asExternalLink (5) ++ } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The type of the link state advertisement. ++ Each link state type has a separate advertise- ++ ment format." ++ REFERENCE ++ "OSPF Version 2, Appendix A.4.1 The Link State ++ Advertisement header" ++ ::= { ospfExtLsdbEntry 1 } ++ ++ ++ ospfExtLsdbLsid OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The Link State ID is an LS Type Specific field ++ containing either a Router ID or an IP Address; ++ it identifies the piece of the routing domain ++ that is being described by the advertisement." ++ REFERENCE ++ "OSPF Version 2, Section 12.1.4 Link State ID" ++ ::= { ospfExtLsdbEntry 2 } ++ ++ ++ ospfExtLsdbRouterId OBJECT-TYPE ++ SYNTAX RouterID ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The 32 bit number that uniquely identifies the ++ originating router in the Autonomous System." ++ REFERENCE ++ "OSPF Version 2, Appendix C.1 Global parameters" ++ ::= { ospfExtLsdbEntry 3 } ++ ++-- Note that the OSPF Sequence Number is a 32 bit signed ++-- integer. It starts with the value '80000001'h, ++-- or -'7FFFFFFF'h, and increments until '7FFFFFFF'h ++-- Thus, a typical sequence number will be very negative. ++ ospfExtLsdbSequence OBJECT-TYPE ++ SYNTAX Integer32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The sequence number field is a signed 32-bit ++ integer. It is used to detect old and dupli- ++ cate link state advertisements. The space of ++ sequence numbers is linearly ordered. The ++ larger the sequence number the more recent the ++ advertisement." ++ REFERENCE ++ "OSPF Version 2, Section 12.1.6 LS sequence ++ number" ++ ::= { ospfExtLsdbEntry 4 } ++ ++ ++ ospfExtLsdbAge OBJECT-TYPE ++ SYNTAX Integer32 -- Should be 0..MaxAge ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "This field is the age of the link state adver- ++ tisement in seconds." ++ REFERENCE ++ "OSPF Version 2, Section 12.1.1 LS age" ++ ::= { ospfExtLsdbEntry 5 } ++ ++ ++ ospfExtLsdbChecksum OBJECT-TYPE ++ SYNTAX Integer32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "This field is the checksum of the complete ++ contents of the advertisement, excepting the ++ age field. The age field is excepted so that ++ an advertisement's age can be incremented ++ without updating the checksum. The checksum ++ used is the same that is used for ISO connec- ++ tionless datagrams; it is commonly referred to ++ as the Fletcher checksum." ++ REFERENCE ++ "OSPF Version 2, Section 12.1.7 LS checksum" ++ ::= { ospfExtLsdbEntry 6 } ++ ++ ++ ospfExtLsdbAdvertisement OBJECT-TYPE ++ SYNTAX OCTET STRING (SIZE(36)) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The entire Link State Advertisement, including ++ its header." ++ REFERENCE ++ "OSPF Version 2, Section 12 Link State Adver- ++ tisements" ++ ::= { ospfExtLsdbEntry 7 } ++ ++ ++-- OSPF Use of the CIDR Route Table ++ ++ospfRouteGroup OBJECT IDENTIFIER ::= { ospf 13 } ++ ++-- The IP Forwarding Table defines a number of objects for use by ++-- the routing protocol to externalize its information. Most of ++-- the variables (ipForwardDest, ipForwardMask, ipForwardPolicy, ++-- ipForwardNextHop, ipForwardIfIndex, ipForwardType, ++-- ipForwardProto, ipForwardAge, and ipForwardNextHopAS) are ++-- defined there. ++ ++-- Those that leave some discretion are defined here. ++ ++-- ipCidrRouteProto is, of course, ospf (13). ++ ++-- ipCidrRouteAge is the time since the route was first calculated, ++-- as opposed to the time since the last SPF run. ++ ++-- ipCidrRouteInfo is an OBJECT IDENTIFIER for use by the routing ++-- protocol. The following values shall be found there depending ++-- on the way the route was calculated. ++ ++ospfIntraArea OBJECT IDENTIFIER ::= { ospfRouteGroup 1 } ++ospfInterArea OBJECT IDENTIFIER ::= { ospfRouteGroup 2 } ++ospfExternalType1 OBJECT IDENTIFIER ::= { ospfRouteGroup 3 } ++ospfExternalType2 OBJECT IDENTIFIER ::= { ospfRouteGroup 4 } ++ ++-- ipCidrRouteMetric1 is, by definition, the primary routing ++-- metric. Therefore, it should be the metric that route ++-- selection is based on. For intra-area and inter-area routes, ++-- it is an OSPF metric. For External Type 1 (comparable value) ++-- routes, it is an OSPF metric plus the External Metric. For ++-- external Type 2 (non-comparable value) routes, it is the ++-- external metric. ++ ++-- ipCidrRouteMetric2 is, by definition, a secondary routing ++-- metric. Therefore, it should be the metric that breaks a tie ++-- among routes having equal metric1 values and the same ++-- calculation rule. For intra-area, inter-area routes, and ++-- External Type 1 (comparable value) routes, it is unused. For ++-- external Type 2 (non-comparable value) routes, it is the metric ++-- to the AS border router. ++ ++-- ipCidrRouteMetric3, ipCidrRouteMetric4, and ipCidrRouteMetric5 are ++-- unused. ++ ++-- ++-- The OSPF Area Aggregate Table ++-- ++-- This table replaces the OSPF Area Summary Table, being an ++-- extension of that for CIDR routers. ++ ++ ospfAreaAggregateTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF OspfAreaAggregateEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "A range of IP addresses specified by an IP ++ address/IP network mask pair. For example, ++ class B address range of X.X.X.X with a network ++ mask of 255.255.0.0 includes all IP addresses ++ from X.X.0.0 to X.X.255.255. Note that if ++ ranges are configured such that one range sub- ++ sumes another range (e.g., 10.0.0.0 mask ++ 255.0.0.0 and 10.1.0.0 mask 255.255.0.0), the ++ most specific match is the preferred one." ++ REFERENCE ++ "OSPF Version 2, Appendix C.2 Area parameters" ++ ::= { ospf 14 } ++ ++ ++ ospfAreaAggregateEntry OBJECT-TYPE ++ SYNTAX OspfAreaAggregateEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "A range of IP addresses specified by an IP ++ address/IP network mask pair. For example, ++ class B address range of X.X.X.X with a network ++ mask of 255.255.0.0 includes all IP addresses ++ from X.X.0.0 to X.X.255.255. Note that if ++ ranges are range configured such that one range ++ subsumes another range (e.g., 10.0.0.0 mask ++ 255.0.0.0 and 10.1.0.0 mask 255.255.0.0), the ++ most specific match is the preferred one." ++ REFERENCE ++ "OSPF Version 2, Appendix C.2 Area parameters" ++ INDEX { ospfAreaAggregateAreaID, ospfAreaAggregateLsdbType, ++ ospfAreaAggregateNet, ospfAreaAggregateMask } ++ ::= { ospfAreaAggregateTable 1 } ++ ++ ++OspfAreaAggregateEntry ::= ++ SEQUENCE { ++ ospfAreaAggregateAreaID ++ AreaID, ++ ospfAreaAggregateLsdbType ++ INTEGER, ++ ospfAreaAggregateNet ++ IpAddress, ++ ospfAreaAggregateMask ++ IpAddress, ++ ospfAreaAggregateStatus ++ RowStatus, ++ ospfAreaAggregateEffect ++ INTEGER ++ } ++ ++ ospfAreaAggregateAreaID OBJECT-TYPE ++ SYNTAX AreaID ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The Area the Address Aggregate is to be found ++ within." ++ REFERENCE ++ "OSPF Version 2, Appendix C.2 Area parameters" ++ ::= { ospfAreaAggregateEntry 1 } ++ ++ ++ ospfAreaAggregateLsdbType OBJECT-TYPE ++ SYNTAX INTEGER { ++ summaryLink (3), ++ nssaExternalLink (7) ++ } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The type of the Address Aggregate. This field ++ specifies the Lsdb type that this Address Ag- ++ gregate applies to." ++ REFERENCE ++ "OSPF Version 2, Appendix A.4.1 The Link State ++ Advertisement header" ++ ::= { ospfAreaAggregateEntry 2 } ++ ++ ++ ospfAreaAggregateNet OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The IP Address of the Net or Subnet indicated ++ by the range." ++ REFERENCE ++ "OSPF Version 2, Appendix C.2 Area parameters" ++ ::= { ospfAreaAggregateEntry 3 } ++ ++ ++ ospfAreaAggregateMask OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The Subnet Mask that pertains to the Net or ++ Subnet." ++ REFERENCE ++ "OSPF Version 2, Appendix C.2 Area parameters" ++ ::= { ospfAreaAggregateEntry 4 } ++ ++ ++ ospfAreaAggregateStatus OBJECT-TYPE ++ SYNTAX RowStatus ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "This variable displays the status of the en- ++ try. Setting it to 'invalid' has the effect of ++ rendering it inoperative. The internal effect ++ (row removal) is implementation dependent." ++ ::= { ospfAreaAggregateEntry 5 } ++ ++ ++ ospfAreaAggregateEffect OBJECT-TYPE ++ SYNTAX INTEGER { ++ advertiseMatching (1), ++ doNotAdvertiseMatching (2) ++ } ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "Subnets subsumed by ranges either trigger the ++ advertisement of the indicated aggregate (ad- ++ vertiseMatching), or result in the subnet's not ++ being advertised at all outside the area." ++ DEFVAL { advertiseMatching } ++ ::= { ospfAreaAggregateEntry 6 } ++ ++ ++-- conformance information ++ ++ospfConformance OBJECT IDENTIFIER ::= { ospf 15 } ++ ++ospfGroups OBJECT IDENTIFIER ::= { ospfConformance 1 } ++ospfCompliances OBJECT IDENTIFIER ::= { ospfConformance 2 } ++ ++-- compliance statements ++ ++ ospfCompliance MODULE-COMPLIANCE ++ STATUS current ++ DESCRIPTION ++ "The compliance statement " ++ MODULE -- this module ++ MANDATORY-GROUPS { ++ ospfBasicGroup, ++ ospfAreaGroup, ++ ospfStubAreaGroup, ++ ospfIfGroup, ++ ospfIfMetricGroup, ++ ospfVirtIfGroup, ++ ospfNbrGroup, ++ ospfVirtNbrGroup, ++ ospfAreaAggregateGroup ++ } ++ ::= { ospfCompliances 1 } ++ ++ ++-- units of conformance ++ ++ ospfBasicGroup OBJECT-GROUP ++ OBJECTS { ++ ospfRouterId, ++ ospfAdminStat, ++ ospfVersionNumber, ++ ospfAreaBdrRtrStatus, ++ ospfASBdrRtrStatus, ++ ospfExternLsaCount, ++ ospfExternLsaCksumSum, ++ ospfTOSSupport, ++ ospfOriginateNewLsas, ++ ospfRxNewLsas, ++ ospfExtLsdbLimit, ++ ospfMulticastExtensions, ++ ospfExitOverflowInterval, ++ ospfDemandExtensions ++ } ++ STATUS current ++ DESCRIPTION ++ "These objects are required for OSPF systems." ++ ::= { ospfGroups 1 } ++ ++ ++ ospfAreaGroup OBJECT-GROUP ++ OBJECTS { ++ ospfAreaId, ++ ospfImportAsExtern, ++ ospfSpfRuns, ++ ospfAreaBdrRtrCount, ++ ospfAsBdrRtrCount, ++ ospfAreaLsaCount, ++ ospfAreaLsaCksumSum, ++ ospfAreaSummary, ++ ospfAreaStatus ++ } ++ STATUS current ++ DESCRIPTION ++ "These objects are required for OSPF systems ++ supporting areas." ++ ::= { ospfGroups 2 } ++ ++ ++ ospfStubAreaGroup OBJECT-GROUP ++ OBJECTS { ++ ospfStubAreaId, ++ ospfStubTOS, ++ ospfStubMetric, ++ ospfStubStatus, ++ ospfStubMetricType ++ } ++ STATUS current ++ DESCRIPTION ++ "These objects are required for OSPF systems ++ supporting stub areas." ++ ::= { ospfGroups 3 } ++ ++ ++ ospfLsdbGroup OBJECT-GROUP ++ OBJECTS { ++ ospfLsdbAreaId, ++ ospfLsdbType, ++ ospfLsdbLsid, ++ ospfLsdbRouterId, ++ ospfLsdbSequence, ++ ospfLsdbAge, ++ ospfLsdbChecksum, ++ ospfLsdbAdvertisement ++ } ++ STATUS current ++ DESCRIPTION ++ "These objects are required for OSPF systems ++ that display their link state database." ++ ::= { ospfGroups 4 } ++ ++ ++ ospfAreaRangeGroup OBJECT-GROUP ++ OBJECTS { ++ ospfAreaRangeAreaId, ++ ospfAreaRangeNet, ++ ospfAreaRangeMask, ++ ospfAreaRangeStatus, ++ ospfAreaRangeEffect ++ } ++ STATUS obsolete ++ DESCRIPTION ++ "These objects are required for non-CIDR OSPF ++ systems that support multiple areas." ++ ::= { ospfGroups 5 } ++ ++ ++ ospfHostGroup OBJECT-GROUP ++ OBJECTS { ++ ospfHostIpAddress, ++ ospfHostTOS, ++ ospfHostMetric, ++ ospfHostStatus, ++ ospfHostAreaID ++ } ++ STATUS current ++ DESCRIPTION ++ "These objects are required for OSPF systems ++ that support attached hosts." ++ ::= { ospfGroups 6 } ++ ++ ++ ospfIfGroup OBJECT-GROUP ++ OBJECTS { ++ ospfIfIpAddress, ++ ospfAddressLessIf, ++ ospfIfAreaId, ++ ospfIfType, ++ ospfIfAdminStat, ++ ospfIfRtrPriority, ++ ospfIfTransitDelay, ++ ospfIfRetransInterval, ++ ospfIfHelloInterval, ++ ospfIfRtrDeadInterval, ++ ospfIfPollInterval, ++ ospfIfState, ++ ospfIfDesignatedRouter, ++ ospfIfBackupDesignatedRouter, ++ ospfIfEvents, ++ ospfIfAuthType, ++ ospfIfAuthKey, ++ ospfIfStatus, ++ ospfIfMulticastForwarding, ++ ospfIfDemand ++ } ++ STATUS current ++ DESCRIPTION ++ "These objects are required for OSPF systems." ++ ::= { ospfGroups 7 } ++ ++ ++ ospfIfMetricGroup OBJECT-GROUP ++ OBJECTS { ++ ospfIfMetricIpAddress, ++ ospfIfMetricAddressLessIf, ++ ospfIfMetricTOS, ++ ospfIfMetricValue, ++ ospfIfMetricStatus ++ } ++ STATUS current ++ DESCRIPTION ++ "These objects are required for OSPF systems." ++ ::= { ospfGroups 8 } ++ ++ ++ ospfVirtIfGroup OBJECT-GROUP ++ OBJECTS { ++ ospfVirtIfAreaId, ++ ospfVirtIfNeighbor, ++ ospfVirtIfTransitDelay, ++ ospfVirtIfRetransInterval, ++ ospfVirtIfHelloInterval, ++ ospfVirtIfRtrDeadInterval, ++ ospfVirtIfState, ++ ospfVirtIfEvents, ++ ospfVirtIfAuthType, ++ ospfVirtIfAuthKey, ++ ospfVirtIfStatus ++ } ++ STATUS current ++ DESCRIPTION ++ "These objects are required for OSPF systems." ++ ::= { ospfGroups 9 } ++ ++ ++ ospfNbrGroup OBJECT-GROUP ++ OBJECTS { ++ ospfNbrIpAddr, ++ ospfNbrAddressLessIndex, ++ ospfNbrRtrId, ++ ospfNbrOptions, ++ ospfNbrPriority, ++ ospfNbrState, ++ ospfNbrEvents, ++ ospfNbrLsRetransQLen, ++ ospfNbmaNbrStatus, ++ ospfNbmaNbrPermanence, ++ ospfNbrHelloSuppressed ++ } ++ STATUS current ++ DESCRIPTION ++ "These objects are required for OSPF systems." ++ ::= { ospfGroups 10 } ++ ++ ++ ospfVirtNbrGroup OBJECT-GROUP ++ OBJECTS { ++ ospfVirtNbrArea, ++ ospfVirtNbrRtrId, ++ ospfVirtNbrIpAddr, ++ ospfVirtNbrOptions, ++ ospfVirtNbrState, ++ ospfVirtNbrEvents, ++ ospfVirtNbrLsRetransQLen, ++ ospfVirtNbrHelloSuppressed ++ } ++ STATUS current ++ DESCRIPTION ++ "These objects are required for OSPF systems." ++ ::= { ospfGroups 11 } ++ ++ ++ ospfExtLsdbGroup OBJECT-GROUP ++ OBJECTS { ++ ospfExtLsdbType, ++ ospfExtLsdbLsid, ++ ospfExtLsdbRouterId, ++ ospfExtLsdbSequence, ++ ospfExtLsdbAge, ++ ospfExtLsdbChecksum, ++ ospfExtLsdbAdvertisement ++ } ++ STATUS current ++ DESCRIPTION ++ "These objects are required for OSPF systems ++ that display their link state database." ++ ::= { ospfGroups 12 } ++ ++ ++ ospfAreaAggregateGroup OBJECT-GROUP ++ OBJECTS { ++ ospfAreaAggregateAreaID, ++ ospfAreaAggregateLsdbType, ++ ospfAreaAggregateNet, ++ ospfAreaAggregateMask, ++ ospfAreaAggregateStatus, ++ ospfAreaAggregateEffect ++ } ++ STATUS current ++ DESCRIPTION ++ "These objects are required for OSPF systems." ++ ::= { ospfGroups 13 } ++ ++END +--- /dev/null ++++ b/mibs/OSPF-TRAP-MIB.txt +@@ -0,0 +1,443 @@ ++OSPF-TRAP-MIB DEFINITIONS ::= BEGIN ++ ++ IMPORTS ++ MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE, IpAddress ++ FROM SNMPv2-SMI ++ MODULE-COMPLIANCE, OBJECT-GROUP ++ FROM SNMPv2-CONF ++ ospfRouterId, ospfIfIpAddress, ospfAddressLessIf, ospfIfState, ++ ospfVirtIfAreaId, ospfVirtIfNeighbor, ospfVirtIfState, ++ ospfNbrIpAddr, ospfNbrAddressLessIndex, ospfNbrRtrId, ++ ospfNbrState, ospfVirtNbrArea, ospfVirtNbrRtrId, ospfVirtNbrState, ++ ospfLsdbType, ospfLsdbLsid, ospfLsdbRouterId, ospfLsdbAreaId, ++ ospfExtLsdbLimit, ospf ++ FROM OSPF-MIB; ++ ++ ospfTrap MODULE-IDENTITY ++ LAST-UPDATED "9501201225Z" -- Fri Jan 20 12:25:50 PST 1995 ++ ORGANIZATION "IETF OSPF Working Group" ++ CONTACT-INFO ++ " Fred Baker ++ Postal: Cisco Systems ++ 519 Lado Drive ++ Santa Barbara, California 93111 ++ Tel: +1 805 681 0115 ++ E-Mail: fred@cisco.com ++ ++ Rob Coltun ++ Postal: RainbowBridge Communications ++ Tel: (301) 340-9416 ++ E-Mail: rcoltun@rainbow-bridge.com" ++ DESCRIPTION ++ "The MIB module to describe traps for the OSPF ++ Version 2 Protocol." ++ ::= { ospf 16 } ++ ++-- Trap Support Objects ++ ++-- The following are support objects for the OSPF traps. ++ ++ospfTrapControl OBJECT IDENTIFIER ::= { ospfTrap 1 } ++ospfTraps OBJECT IDENTIFIER ::= { ospfTrap 2 } ++ ++ ospfSetTrap OBJECT-TYPE ++ SYNTAX OCTET STRING (SIZE(4)) ++ MAX-ACCESS read-write ++ STATUS current ++ DESCRIPTION ++ "A four-octet string serving as a bit map for ++ the trap events defined by the OSPF traps. This ++ object is used to enable and disable specific ++ OSPF traps where a 1 in the bit field ++ represents enabled. The right-most bit (least ++ significant) represents trap 0." ++ ::= { ospfTrapControl 1 } ++ ++ ++ ospfConfigErrorType OBJECT-TYPE ++ SYNTAX INTEGER { ++ badVersion (1), ++ areaMismatch (2), ++ unknownNbmaNbr (3), -- Router is Dr eligible ++ unknownVirtualNbr (4), ++ authTypeMismatch(5), ++ authFailure (6), ++ netMaskMismatch (7), ++ helloIntervalMismatch (8), ++ deadIntervalMismatch (9), ++ optionMismatch (10) } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "Potential types of configuration conflicts. ++ Used by the ospfConfigError and ospfConfigVir- ++ tError traps." ++ ::= { ospfTrapControl 2 } ++ ++ ++ ospfPacketType OBJECT-TYPE ++ SYNTAX INTEGER { ++ hello (1), ++ dbDescript (2), ++ lsReq (3), ++ lsUpdate (4), ++ lsAck (5) } ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "OSPF packet types." ++ ::= { ospfTrapControl 3 } ++ ++ ++ ospfPacketSrc OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The IP address of an inbound packet that can- ++ not be identified by a neighbor instance." ++ ::= { ospfTrapControl 4 } ++ ++ ++-- Traps ++ ++ ++ ospfIfStateChange NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfIfIpAddress, ++ ospfAddressLessIf, ++ ospfIfState -- The new state ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfIfStateChange trap signifies that there ++ has been a change in the state of a non-virtual ++ OSPF interface. This trap should be generated ++ when the interface state regresses (e.g., goes ++ from Dr to Down) or progresses to a terminal ++ state (i.e., Point-to-Point, DR Other, Dr, or ++ Backup)." ++ ::= { ospfTraps 16 } ++ ++ ++ ospfVirtIfStateChange NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfVirtIfAreaId, ++ ospfVirtIfNeighbor, ++ ospfVirtIfState -- The new state ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfIfStateChange trap signifies that there ++ has been a change in the state of an OSPF vir- ++ tual interface. ++ This trap should be generated when the inter- ++ face state regresses (e.g., goes from Point- ++ to-Point to Down) or progresses to a terminal ++ state (i.e., Point-to-Point)." ++ ::= { ospfTraps 1 } ++ ++ ++ ospfNbrStateChange NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfNbrIpAddr, ++ ospfNbrAddressLessIndex, ++ ospfNbrRtrId, ++ ospfNbrState -- The new state ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfNbrStateChange trap signifies that ++ there has been a change in the state of a non- ++ virtual OSPF neighbor. This trap should be ++ generated when the neighbor state regresses ++ (e.g., goes from Attempt or Full to 1-Way or ++ Down) or progresses to a terminal state (e.g., ++ 2-Way or Full). When an neighbor transitions ++ from or to Full on non-broadcast multi-access ++ and broadcast networks, the trap should be gen- ++ erated by the designated router. A designated ++ router transitioning to Down will be noted by ++ ospfIfStateChange." ++ ::= { ospfTraps 2 } ++ ++ ++ ospfVirtNbrStateChange NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfVirtNbrArea, ++ ospfVirtNbrRtrId, ++ ospfVirtNbrState -- The new state ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfIfStateChange trap signifies that there ++ has been a change in the state of an OSPF vir- ++ tual neighbor. This trap should be generated ++ when the neighbor state regresses (e.g., goes ++ from Attempt or Full to 1-Way or Down) or ++ progresses to a terminal state (e.g., Full)." ++ ::= { ospfTraps 3 } ++ ospfIfConfigError NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfIfIpAddress, ++ ospfAddressLessIf, ++ ospfPacketSrc, -- The source IP address ++ ospfConfigErrorType, -- Type of error ++ ospfPacketType ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfIfConfigError trap signifies that a ++ packet has been received on a non-virtual in- ++ terface from a router whose configuration ++ parameters conflict with this router's confi- ++ guration parameters. Note that the event op- ++ tionMismatch should cause a trap only if it ++ prevents an adjacency from forming." ++ ::= { ospfTraps 4 } ++ ++ ++ ospfVirtIfConfigError NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfVirtIfAreaId, ++ ospfVirtIfNeighbor, ++ ospfConfigErrorType, -- Type of error ++ ospfPacketType ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfConfigError trap signifies that a pack- ++ et has been received on a virtual interface ++ from a router whose configuration parameters ++ conflict with this router's configuration ++ parameters. Note that the event optionMismatch ++ should cause a trap only if it prevents an ad- ++ jacency from forming." ++ ::= { ospfTraps 5 } ++ ++ ++ ospfIfAuthFailure NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfIfIpAddress, ++ ospfAddressLessIf, ++ ospfPacketSrc, -- The source IP address ++ ospfConfigErrorType, -- authTypeMismatch or ++ -- authFailure ++ ospfPacketType ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfIfAuthFailure trap signifies that a ++ packet has been received on a non-virtual in- ++ terface from a router whose authentication key ++ or authentication type conflicts with this ++ router's authentication key or authentication ++ type." ++ ::= { ospfTraps 6 } ++ ++ ++ ospfVirtIfAuthFailure NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfVirtIfAreaId, ++ ospfVirtIfNeighbor, ++ ospfConfigErrorType, -- authTypeMismatch or ++ -- authFailure ++ ospfPacketType ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfVirtIfAuthFailure trap signifies that a ++ packet has been received on a virtual interface ++ from a router whose authentication key or au- ++ thentication type conflicts with this router's ++ authentication key or authentication type." ++ ::= { ospfTraps 7 } ++ ++ ++ ospfIfRxBadPacket NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfIfIpAddress, ++ ospfAddressLessIf, ++ ospfPacketSrc, -- The source IP address ++ ospfPacketType ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfIfRxBadPacket trap signifies that an ++ OSPF packet has been received on a non-virtual ++ interface that cannot be parsed." ++ ::= { ospfTraps 8 } ++ ++ ospfVirtIfRxBadPacket NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfVirtIfAreaId, ++ ospfVirtIfNeighbor, ++ ospfPacketType ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfRxBadPacket trap signifies that an OSPF ++ packet has been received on a virtual interface ++ that cannot be parsed." ++ ::= { ospfTraps 9 } ++ ++ ++ ospfTxRetransmit NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfIfIpAddress, ++ ospfAddressLessIf, ++ ospfNbrRtrId, -- Destination ++ ospfPacketType, ++ ospfLsdbType, ++ ospfLsdbLsid, ++ ospfLsdbRouterId ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfTxRetransmit trap signifies than an ++ OSPF packet has been retransmitted on a non- ++ virtual interface. All packets that may be re- ++ transmitted are associated with an LSDB entry. ++ The LS type, LS ID, and Router ID are used to ++ identify the LSDB entry." ++ ::= { ospfTraps 10 } ++ ++ ++ ospfVirtIfTxRetransmit NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfVirtIfAreaId, ++ ospfVirtIfNeighbor, ++ ospfPacketType, ++ ospfLsdbType, ++ ospfLsdbLsid, ++ ospfLsdbRouterId ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfTxRetransmit trap signifies than an ++ OSPF packet has been retransmitted on a virtual ++ interface. All packets that may be retransmit- ++ ted are associated with an LSDB entry. The LS ++ type, LS ID, and Router ID are used to identify ++ the LSDB entry." ++ ::= { ospfTraps 11 } ++ ++ ++ ospfOriginateLsa NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfLsdbAreaId, -- 0.0.0.0 for AS Externals ++ ospfLsdbType, ++ ospfLsdbLsid, ++ ospfLsdbRouterId ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfOriginateLsa trap signifies that a new ++ LSA has been originated by this router. This ++ trap should not be invoked for simple refreshes ++ of LSAs (which happesn every 30 minutes), but ++ instead will only be invoked when an LSA is ++ (re)originated due to a topology change. Addi- ++ tionally, this trap does not include LSAs that ++ are being flushed because they have reached ++ MaxAge." ++ ::= { ospfTraps 12 } ++ ++ ++ ospfMaxAgeLsa NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfLsdbAreaId, -- 0.0.0.0 for AS Externals ++ ospfLsdbType, ++ ospfLsdbLsid, ++ ospfLsdbRouterId ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfMaxAgeLsa trap signifies that one of ++ the LSA in the router's link-state database has ++ aged to MaxAge." ++ ::= { ospfTraps 13 } ++ ++ ++ ospfLsdbOverflow NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfExtLsdbLimit ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfLsdbOverflow trap signifies that the ++ number of LSAs in the router's link-state data- ++ base has exceeded ospfExtLsdbLimit." ++ ::= { ospfTraps 14 } ++ ++ ++ ospfLsdbApproachingOverflow NOTIFICATION-TYPE ++ OBJECTS { ++ ospfRouterId, -- The originator of the trap ++ ospfExtLsdbLimit ++ } ++ STATUS current ++ DESCRIPTION ++ "An ospfLsdbApproachingOverflow trap signifies ++ that the number of LSAs in the router's link- ++ state database has exceeded ninety percent of ++ ospfExtLsdbLimit." ++ ::= { ospfTraps 15 } ++ ++ ++-- conformance information ++ ++ospfTrapConformance OBJECT IDENTIFIER ::= { ospfTrap 3 } ++ ++ospfTrapGroups OBJECT IDENTIFIER ::= { ospfTrapConformance 1 } ++ospfTrapCompliances OBJECT IDENTIFIER ::= { ospfTrapConformance 2 } ++ ++-- compliance statements ++ ++ ospfTrapCompliance MODULE-COMPLIANCE ++ STATUS current ++ DESCRIPTION ++ "The compliance statement " ++ MODULE -- this module ++ MANDATORY-GROUPS { ospfTrapControlGroup } ++ ++ ++ GROUP ospfTrapControlGroup ++ DESCRIPTION ++ "This group is optional but recommended for all ++ OSPF systems" ++ ::= { ospfTrapCompliances 1 } ++ ++ ++-- units of conformance ++ ++ ospfTrapControlGroup OBJECT-GROUP ++ OBJECTS { ++ ospfSetTrap, ++ ospfConfigErrorType, ++ ospfPacketType, ++ ospfPacketSrc ++ } ++ STATUS current ++ DESCRIPTION ++ "These objects are required to control traps ++ from OSPF systems." ++ ::= { ospfTrapGroups 1 } ++ ++ ++END +--- /dev/null ++++ b/mibs/RIPv2-MIB.txt +@@ -0,0 +1,530 @@ ++ RIPv2-MIB DEFINITIONS ::= BEGIN ++ ++ IMPORTS ++ MODULE-IDENTITY, OBJECT-TYPE, Counter32, ++ TimeTicks, IpAddress FROM SNMPv2-SMI ++ TEXTUAL-CONVENTION, RowStatus FROM SNMPv2-TC ++ MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF ++ mib-2 FROM RFC1213-MIB; ++ ++ -- This MIB module uses the extended OBJECT-TYPE macro as ++ -- defined in [9]. ++ ++ rip2 MODULE-IDENTITY ++ LAST-UPDATED "9407272253Z" -- Wed Jul 27 22:53:04 PDT 1994 ++ ORGANIZATION "IETF RIP-II Working Group" ++ CONTACT-INFO ++ " Fred Baker ++ Postal: Cisco Systems ++ 519 Lado Drive ++ Santa Barbara, California 93111 ++ Tel: +1 805 681 0115 ++ E-Mail: fbaker@cisco.com ++ ++ Postal: Gary Malkin ++ Xylogics, Inc. ++ 53 Third Avenue ++ Burlington, MA 01803 ++ ++ Phone: (617) 272-8140 ++ EMail: gmalkin@Xylogics.COM" ++ DESCRIPTION ++ "The MIB module to describe the RIP2 Version 2 Protocol" ++ ::= { mib-2 23 } ++ ++ -- RIP-2 Management Information Base ++ ++ -- the RouteTag type represents the contents of the ++ -- Route Domain field in the packet header or route entry. ++ -- The use of the Route Domain is deprecated. ++ ++ RouteTag ::= TEXTUAL-CONVENTION ++ STATUS current ++ DESCRIPTION ++ "the RouteTag type represents the contents of the Route Domain ++ field in the packet header or route entry" ++ SYNTAX OCTET STRING (SIZE (2)) ++ ++--4.1 Global Counters ++ ++-- The RIP-2 Globals Group. ++-- Implementation of this group is mandatory for systems ++-- which implement RIP-2. ++ ++-- These counters are intended to facilitate debugging quickly ++-- changing routes or failing neighbors ++ ++rip2Globals OBJECT IDENTIFIER ::= { rip2 1 } ++ ++ rip2GlobalRouteChanges OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of route changes made to the IP Route ++ Database by RIP. This does not include the refresh ++ of a route's age." ++ ::= { rip2Globals 1 } ++ ++ rip2GlobalQueries OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of responses sent to RIP queries ++ from other systems." ++ ::= { rip2Globals 2 } ++ ++--4.2 RIP Interface Tables ++ ++-- RIP Interfaces Groups ++-- Implementation of these Groups is mandatory for systems ++-- which implement RIP-2. ++ ++-- The RIP Interface Status Table. ++ ++ rip2IfStatTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF Rip2IfStatEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "A list of subnets which require separate ++ status monitoring in RIP." ++ ::= { rip2 2 } ++ ++ rip2IfStatEntry OBJECT-TYPE ++ SYNTAX Rip2IfStatEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "A Single Routing Domain in a single Subnet." ++ INDEX { rip2IfStatAddress } ++ ::= { rip2IfStatTable 1 } ++ ++ Rip2IfStatEntry ::= ++ SEQUENCE { ++ rip2IfStatAddress ++ IpAddress, ++ rip2IfStatRcvBadPackets ++ Counter32, ++ rip2IfStatRcvBadRoutes ++ Counter32, ++ rip2IfStatSentUpdates ++ Counter32, ++ rip2IfStatStatus ++ RowStatus ++ } ++ ++ rip2IfStatAddress OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The IP Address of this system on the indicated ++ subnet. For unnumbered interfaces, the value 0.0.0.N, ++ where the least significant 24 bits (N) is the ifIndex ++ for the IP Interface in network byte order." ++ ::= { rip2IfStatEntry 1 } ++ ++ rip2IfStatRcvBadPackets OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of RIP response packets received by ++ the RIP process which were subsequently discarded ++ for any reason (e.g. a version 0 packet, or an ++ unknown command type)." ++ ::= { rip2IfStatEntry 2 } ++ ++ rip2IfStatRcvBadRoutes OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of routes, in valid RIP packets, ++ which were ignored for any reason (e.g. unknown ++ address family, or invalid metric)." ++ ::= { rip2IfStatEntry 3 } ++ ++ rip2IfStatSentUpdates OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of triggered RIP updates actually ++ sent on this interface. This explicitly does ++ NOT include full updates sent containing new ++ information." ++ ::= { rip2IfStatEntry 4 } ++ ++ rip2IfStatStatus OBJECT-TYPE ++ SYNTAX RowStatus ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "Writing invalid has the effect of deleting ++ this interface." ++ ::= { rip2IfStatEntry 5 } ++ ++-- The RIP Interface Configuration Table. ++ ++ rip2IfConfTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF Rip2IfConfEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "A list of subnets which require separate ++ configuration in RIP." ++ ::= { rip2 3 } ++ ++ rip2IfConfEntry OBJECT-TYPE ++ SYNTAX Rip2IfConfEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "A Single Routing Domain in a single Subnet." ++ INDEX { rip2IfConfAddress } ++ ::= { rip2IfConfTable 1 } ++ ++ Rip2IfConfEntry ::= ++ SEQUENCE { ++ rip2IfConfAddress ++ IpAddress, ++ rip2IfConfDomain ++ RouteTag, ++ rip2IfConfAuthType ++ INTEGER, ++ rip2IfConfAuthKey ++ OCTET STRING (SIZE(0..16)), ++ rip2IfConfSend ++ INTEGER, ++ rip2IfConfReceive ++ INTEGER, ++ rip2IfConfDefaultMetric ++ INTEGER, ++ rip2IfConfStatus ++ RowStatus, ++ rip2IfConfSrcAddress ++ IpAddress ++ } ++ ++ rip2IfConfAddress OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The IP Address of this system on the indicated ++ subnet. For unnumbered interfaces, the value 0.0.0.N, ++ where the least significant 24 bits (N) is the ifIndex ++ for the IP Interface in network byte order." ++ ::= { rip2IfConfEntry 1 } ++ ++ rip2IfConfDomain OBJECT-TYPE ++ SYNTAX RouteTag ++ MAX-ACCESS read-create ++ STATUS obsolete ++ DESCRIPTION ++ "Value inserted into the Routing Domain field ++ of all RIP packets sent on this interface." ++ DEFVAL { '0000'h } ++ ::= { rip2IfConfEntry 2 } ++ ++ rip2IfConfAuthType OBJECT-TYPE ++ SYNTAX INTEGER { ++ noAuthentication (1), ++ simplePassword (2), ++ md5 (3) ++ } ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The type of Authentication used on this ++ interface." ++ DEFVAL { noAuthentication } ++ ::= { rip2IfConfEntry 3 } ++ ++ rip2IfConfAuthKey OBJECT-TYPE ++ SYNTAX OCTET STRING (SIZE(0..16)) ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The value to be used as the Authentication Key ++ whenever the corresponding instance of ++ rip2IfConfAuthType has a value other than ++ noAuthentication. A modification of the corresponding ++ instance of rip2IfConfAuthType does not modify ++ the rip2IfConfAuthKey value. If a string shorter ++ than 16 octets is supplied, it will be left- ++ justified and padded to 16 octets, on the right, ++ with nulls (0x00). ++ ++ Reading this object always results in an OCTET ++ STRING of length zero; authentication may not ++ be bypassed by reading the MIB object." ++ DEFVAL { ''h } ++ ::= { rip2IfConfEntry 4 } ++ ++ rip2IfConfSend OBJECT-TYPE ++ SYNTAX INTEGER { ++ doNotSend (1), ++ ripVersion1 (2), ++ rip1Compatible (3), ++ ripVersion2 (4), ++ ripV1Demand (5), ++ ripV2Demand (6) ++ } ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "What the router sends on this interface. ++ ripVersion1 implies sending RIP updates compliant ++ with RFC 1058. rip1Compatible implies ++ broadcasting RIP-2 updates using RFC 1058 route ++ subsumption rules. ripVersion2 implies ++ multicasting RIP-2 updates. ripV1Demand indicates ++ the use of Demand RIP on a WAN interface under RIP ++ Version 1 rules. ripV2Demand indicates the use of ++ Demand RIP on a WAN interface under Version 2 rules." ++ DEFVAL { rip1Compatible } ++ ::= { rip2IfConfEntry 5 } ++ ++ rip2IfConfReceive OBJECT-TYPE ++ SYNTAX INTEGER { ++ rip1 (1), ++ rip2 (2), ++ rip1OrRip2 (3), ++ doNotRecieve (4) ++ } ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "This indicates which version of RIP updates ++ are to be accepted. Note that rip2 and ++ rip1OrRip2 implies reception of multicast ++ packets." ++ DEFVAL { rip1OrRip2 } ++ ::= { rip2IfConfEntry 6 } ++ ++ rip2IfConfDefaultMetric OBJECT-TYPE ++ SYNTAX INTEGER ( 0..15 ) ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "This variable indicates the metric that is to ++ be used for the default route entry in RIP updates ++ originated on this interface. A value of zero ++ indicates that no default route should be ++ originated; in this case, a default route via ++ another router may be propagated." ++ ::= { rip2IfConfEntry 7 } ++ ++ rip2IfConfStatus OBJECT-TYPE ++ SYNTAX RowStatus ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "Writing invalid has the effect of deleting ++ this interface." ++ ::= { rip2IfConfEntry 8 } ++ ++ rip2IfConfSrcAddress OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-create ++ STATUS current ++ DESCRIPTION ++ "The IP Address this system will use as a source ++ address on this interface. If it is a numbered ++ interface, this MUST be the same value as ++ rip2IfConfAddress. On unnumbered interfaces, ++ it must be the value of rip2IfConfAddress for ++ some interface on the system." ++ ::= { rip2IfConfEntry 9 } ++ ++--4.3 Peer Table ++ ++-- Peer Table ++ ++-- The RIP Peer Group ++-- Implementation of this Group is Optional ++ ++-- This group provides information about active peer ++-- relationships intended to assist in debugging. An ++-- active peer is a router from which a valid RIP ++-- updated has been heard in the last 180 seconds. ++ ++ rip2PeerTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF Rip2PeerEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "A list of RIP Peers." ++ ::= { rip2 4 } ++ ++ rip2PeerEntry OBJECT-TYPE ++ SYNTAX Rip2PeerEntry ++ MAX-ACCESS not-accessible ++ STATUS current ++ DESCRIPTION ++ "Information regarding a single routing peer." ++ INDEX { rip2PeerAddress, rip2PeerDomain } ++ ::= { rip2PeerTable 1 } ++ ++ Rip2PeerEntry ::= ++ SEQUENCE { ++ rip2PeerAddress ++ IpAddress, ++ rip2PeerDomain ++ RouteTag, ++ rip2PeerLastUpdate ++ TimeTicks, ++ rip2PeerVersion ++ INTEGER, ++ rip2PeerRcvBadPackets ++ Counter32, ++ rip2PeerRcvBadRoutes ++ Counter32 ++ } ++ ++ rip2PeerAddress OBJECT-TYPE ++ SYNTAX IpAddress ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The IP Address that the peer is using as its source ++ address. Note that on an unnumbered link, this may ++ not be a member of any subnet on the system." ++ ::= { rip2PeerEntry 1 } ++ ++ rip2PeerDomain OBJECT-TYPE ++ SYNTAX RouteTag ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The value in the Routing Domain field in RIP ++ packets received from the peer. As domain suuport ++ is deprecated, this must be zero." ++ ::= { rip2PeerEntry 2 } ++ ++ rip2PeerLastUpdate OBJECT-TYPE ++ SYNTAX TimeTicks ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The value of sysUpTime when the most recent ++ RIP update was received from this system." ++ ::= { rip2PeerEntry 3 } ++ ++ rip2PeerVersion OBJECT-TYPE ++ SYNTAX INTEGER ( 0..255 ) ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The RIP version number in the header of the ++ last RIP packet received." ++ ::= { rip2PeerEntry 4 } ++ ++ rip2PeerRcvBadPackets OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of RIP response packets from this ++ peer discarded as invalid." ++ ::= { rip2PeerEntry 5 } ++ ++ ++ rip2PeerRcvBadRoutes OBJECT-TYPE ++ SYNTAX Counter32 ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The number of routes from this peer that were ++ ignored because the entry format was invalid." ++ ::= { rip2PeerEntry 6 } ++ ++-- conformance information ++ ++rip2Conformance OBJECT IDENTIFIER ::= { rip2 5 } ++ ++rip2Groups OBJECT IDENTIFIER ::= { rip2Conformance 1 } ++rip2Compliances OBJECT IDENTIFIER ::= { rip2Conformance 2 } ++ ++-- compliance statements ++rip2Compliance MODULE-COMPLIANCE ++ STATUS current ++ DESCRIPTION ++ "The compliance statement " ++ MODULE -- this module ++ MANDATORY-GROUPS { ++ rip2GlobalGroup, ++ rip2IfStatGroup, ++ rip2IfConfGroup, ++ rip2PeerGroup ++ } ++ GROUP rip2GlobalGroup ++ DESCRIPTION ++ "This group defines global controls for RIP-II systems." ++ GROUP rip2IfStatGroup ++ DESCRIPTION ++ "This group defines interface statistics for RIP-II systems." ++ GROUP rip2IfConfGroup ++ DESCRIPTION ++ "This group defines interface configuration for RIP-II systems." ++ GROUP rip2PeerGroup ++ DESCRIPTION ++ "This group defines peer information for RIP-II systems." ++ ::= { rip2Compliances 1 } ++ ++-- units of conformance ++ ++rip2GlobalGroup OBJECT-GROUP ++ OBJECTS { ++ rip2GlobalRouteChanges, ++ rip2GlobalQueries ++ } ++ STATUS current ++ DESCRIPTION ++ "This group defines global controls for RIP-II systems." ++ ::= { rip2Groups 1 } ++rip2IfStatGroup OBJECT-GROUP ++ OBJECTS { ++ rip2IfStatAddress, ++ rip2IfStatRcvBadPackets, ++ rip2IfStatRcvBadRoutes, ++ rip2IfStatSentUpdates, ++ rip2IfStatStatus ++ } ++ STATUS current ++ DESCRIPTION ++ "This group defines interface statistics for RIP-II systems." ++ ::= { rip2Groups 2 } ++rip2IfConfGroup OBJECT-GROUP ++ OBJECTS { ++ rip2IfConfAddress, ++ rip2IfConfAuthType, ++ rip2IfConfAuthKey, ++ rip2IfConfSend, ++ rip2IfConfReceive, ++ rip2IfConfDefaultMetric, ++ rip2IfConfStatus, ++ rip2IfConfSrcAddress ++ } ++ STATUS current ++ DESCRIPTION ++ "This group defines interface configuration for RIP-II systems." ++ ::= { rip2Groups 3 } ++rip2PeerGroup OBJECT-GROUP ++ OBJECTS { ++ rip2PeerAddress, ++ rip2PeerDomain, ++ rip2PeerLastUpdate, ++ rip2PeerVersion, ++ rip2PeerRcvBadPackets, ++ rip2PeerRcvBadRoutes ++ } ++ STATUS current ++ DESCRIPTION ++ "This group defines peer information for RIP-II systems." ++ ::= { rip2Groups 4 } ++END +--- /dev/null ++++ b/mibs/SOURCE-ROUTING-MIB.txt +@@ -0,0 +1,452 @@ ++SOURCE-ROUTING-MIB DEFINITIONS ::= BEGIN ++ ++IMPORTS ++ Counter, Gauge ++ FROM RFC1155-SMI ++ dot1dBridge, dot1dSr ++ FROM BRIDGE-MIB ++ OBJECT-TYPE ++ FROM RFC-1212; ++ ++-- groups in the SR MIB ++ ++-- dot1dSr is imported from the Bridge MIB ++ ++dot1dPortPair OBJECT IDENTIFIER ::= { dot1dBridge 10 } ++ ++-- the dot1dSr group ++ ++-- this group is implemented by those bridges that ++-- support the source route bridging mode, including Source ++-- Routing and SRT bridges. ++ ++dot1dSrPortTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF Dot1dSrPortEntry ++ ACCESS not-accessible ++ STATUS mandatory ++ DESCRIPTION ++ "A table that contains information about every ++ port that is associated with this source route ++ bridge." ++ ::= { dot1dSr 1 } ++ ++dot1dSrPortEntry OBJECT-TYPE ++ SYNTAX Dot1dSrPortEntry ++ ACCESS not-accessible ++ STATUS mandatory ++ DESCRIPTION ++ "A list of information for each port of a source ++ route bridge." ++ INDEX { dot1dSrPort } ++ ++ ::= { dot1dSrPortTable 1 } ++ ++Dot1dSrPortEntry ::= ++ SEQUENCE { ++ dot1dSrPort ++ INTEGER, ++ dot1dSrPortHopCount ++ INTEGER, ++ dot1dSrPortLocalSegment ++ INTEGER, ++ dot1dSrPortBridgeNum ++ INTEGER, ++ dot1dSrPortTargetSegment ++ INTEGER, ++ dot1dSrPortLargestFrame ++ INTEGER, ++ dot1dSrPortSTESpanMode ++ INTEGER, ++ dot1dSrPortSpecInFrames ++ Counter, ++ dot1dSrPortSpecOutFrames ++ Counter, ++ dot1dSrPortApeInFrames ++ Counter, ++ dot1dSrPortApeOutFrames ++ Counter, ++ dot1dSrPortSteInFrames ++ Counter, ++ dot1dSrPortSteOutFrames ++ Counter, ++ dot1dSrPortSegmentMismatchDiscards ++ Counter, ++ dot1dSrPortDuplicateSegmentDiscards ++ Counter, ++ dot1dSrPortHopCountExceededDiscards ++ Counter, ++ dot1dSrPortDupLanIdOrTreeErrors ++ Counter, ++ dot1dSrPortLanIdMismatches ++ Counter ++ } ++ ++dot1dSrPort OBJECT-TYPE ++ SYNTAX INTEGER (1..65535) ++ ACCESS read-only ++ STATUS mandatory ++ DESCRIPTION ++ "The port number of the port for which this entry ++ ++ contains Source Route management information." ++ ::= { dot1dSrPortEntry 1 } ++ ++dot1dSrPortHopCount OBJECT-TYPE ++ SYNTAX INTEGER ++ ACCESS read-write ++ STATUS mandatory ++ DESCRIPTION ++ "The maximum number of routing descriptors allowed ++ in an All Paths or Spanning Tree Explorer frames." ++ ::= { dot1dSrPortEntry 2 } ++ ++dot1dSrPortLocalSegment OBJECT-TYPE ++ SYNTAX INTEGER ++ ACCESS read-write ++ STATUS mandatory ++ DESCRIPTION ++ "The segment number that uniquely identifies the ++ segment to which this port is connected. Current ++ source routing protocols limit this value to the ++ range: 0 through 4095. (The value 0 is used by ++ some management applications for special test ++ cases.) A value of 65535 signifies that no segment ++ number is assigned to this port." ++ ::= { dot1dSrPortEntry 3 } ++ ++dot1dSrPortBridgeNum OBJECT-TYPE ++ SYNTAX INTEGER ++ ACCESS read-write ++ STATUS mandatory ++ DESCRIPTION ++ "A bridge number uniquely identifies a bridge when ++ more than one bridge is used to span the same two ++ segments. Current source routing protocols limit ++ this value to the range: 0 through 15. A value of ++ 65535 signifies that no bridge number is assigned ++ to this bridge." ++ ::= { dot1dSrPortEntry 4 } ++ ++dot1dSrPortTargetSegment OBJECT-TYPE ++ SYNTAX INTEGER ++ ACCESS read-write ++ STATUS mandatory ++ DESCRIPTION ++ "The segment number that corresponds to the target ++ segment this port is considered to be connected to ++ by the bridge. Current source routing protocols ++ limit this value to the range: 0 through 4095. ++ ++ (The value 0 is used by some management ++ applications for special test cases.) A value of ++ 65535 signifies that no target segment is assigned ++ to this port." ++ ::= { dot1dSrPortEntry 5 } ++ ++-- It would be nice if we could use ifMtu as the size of the ++-- largest frame, 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). ++ ++dot1dSrPortLargestFrame OBJECT-TYPE ++ SYNTAX INTEGER ++ ACCESS read-write ++ STATUS mandatory ++ DESCRIPTION ++ "The maximum size of the INFO field (LLC and ++ above) that this port can send/receive. It does ++ not include any MAC level (framing) octets. The ++ value of this object is used by this bridge to ++ determine whether a modification of the ++ LargestFrame (LF, see [14]) field of the Routing ++ Control field of the Routing Information Field is ++ necessary. ++ ++ 64 valid values are defined by the IEEE 802.5M SRT ++ Addendum: 516, 635, 754, 873, 993, 1112, 1231, ++ 1350, 1470, 1542, 1615, 1688, 1761, 1833, 1906, ++ 1979, 2052, 2345, 2638, 2932, 3225, 3518, 3812, ++ 4105, 4399, 4865, 5331, 5798, 6264, 6730, 7197, ++ 7663, 8130, 8539, 8949, 9358, 9768, 10178, 10587, ++ 10997, 11407, 12199, 12992, 13785, 14578, 15370, ++ 16163, 16956, 17749, 20730, 23711, 26693, 29674, ++ 32655, 35637, 38618, 41600, 44591, 47583, 50575, ++ 53567, 56559, 59551, and 65535. ++ ++ An illegal value will not be accepted by the ++ bridge." ++ ::= { dot1dSrPortEntry 6 } ++ ++dot1dSrPortSTESpanMode OBJECT-TYPE ++ SYNTAX INTEGER { ++ auto-span(1), ++ disabled(2), ++ forced(3) ++ } ++ ACCESS read-write ++ STATUS mandatory ++ DESCRIPTION ++ "Determines how this port behaves when presented ++ with a Spanning Tree Explorer frame. The value ++ 'disabled(2)' indicates that the port will not ++ accept or send Spanning Tree Explorer packets; any ++ STE packets received will be silently discarded. ++ The value 'forced(3)' indicates the port will ++ always accept and propagate Spanning Tree Explorer ++ frames. This allows a manually configured ++ Spanning Tree for this class of packet to be ++ configured. Note that unlike transparent ++ bridging, this is not catastrophic to the network ++ if there are loops. The value 'auto-span(1)' can ++ only be returned by a bridge that both implements ++ the Spanning Tree Protocol and has use of the ++ protocol enabled on this port. The behavior of the ++ port for Spanning Tree Explorer frames is ++ determined by the state of dot1dStpPortState. If ++ the port is in the 'forwarding' state, the frame ++ will be accepted or propagated. Otherwise, it ++ will be silently discarded." ++ ::= { dot1dSrPortEntry 7 } ++ ++dot1dSrPortSpecInFrames OBJECT-TYPE ++ SYNTAX Counter ++ ACCESS read-only ++ STATUS mandatory ++ DESCRIPTION ++ "The number of Specifically Routed frames, also ++ referred to as Source Routed Frames, that have ++ been received from this port's segment." ++ ::= { dot1dSrPortEntry 8 } ++ ++dot1dSrPortSpecOutFrames OBJECT-TYPE ++ SYNTAX Counter ++ ACCESS read-only ++ STATUS mandatory ++ DESCRIPTION ++ "The number of Specifically Routed frames, also ++ referred to as Source Routed Frames, that this ++ port has transmitted on its segment." ++ ::= { dot1dSrPortEntry 9 } ++ ++dot1dSrPortApeInFrames OBJECT-TYPE ++ SYNTAX Counter ++ ACCESS read-only ++ STATUS mandatory ++ DESCRIPTION ++ "The number of All Paths Explorer frames, also ++ referred to as All Routes Explorer frames, that ++ have been received by this port from its segment." ++ ::= { dot1dSrPortEntry 10 } ++ ++dot1dSrPortApeOutFrames OBJECT-TYPE ++ SYNTAX Counter ++ ACCESS read-only ++ STATUS mandatory ++ DESCRIPTION ++ "The number of all Paths Explorer Frames, also ++ referred to as All Routes Explorer frames, that ++ have been transmitted by this port on its ++ segment." ++ ::= { dot1dSrPortEntry 11 } ++ ++dot1dSrPortSteInFrames OBJECT-TYPE ++ SYNTAX Counter ++ ACCESS read-only ++ STATUS mandatory ++ DESCRIPTION ++ "The number of spanning tree explorer frames that ++ have been received by this port from its segment." ++ ::= { dot1dSrPortEntry 12 } ++ ++dot1dSrPortSteOutFrames OBJECT-TYPE ++ SYNTAX Counter ++ ACCESS read-only ++ STATUS mandatory ++ DESCRIPTION ++ "The number of spanning tree explorer frames that ++ have been transmitted by this port on its ++ segment." ++ ::= { dot1dSrPortEntry 13 } ++ ++dot1dSrPortSegmentMismatchDiscards OBJECT-TYPE ++ SYNTAX Counter ++ ACCESS read-only ++ STATUS mandatory ++ DESCRIPTION ++ "The number of explorer frames that have been ++ discarded by this port because the routing ++ descriptor field contained an invalid adjacent ++ segment value." ++ ::= { dot1dSrPortEntry 14 } ++ ++dot1dSrPortDuplicateSegmentDiscards OBJECT-TYPE ++ SYNTAX Counter ++ ACCESS read-only ++ STATUS mandatory ++ DESCRIPTION ++ "The number of frames that have been discarded by ++ this port because the routing descriptor field ++ contained a duplicate segment identifier." ++ ::= { dot1dSrPortEntry 15 } ++ ++dot1dSrPortHopCountExceededDiscards OBJECT-TYPE ++ SYNTAX Counter ++ ACCESS read-only ++ STATUS mandatory ++ DESCRIPTION ++ "The number of explorer frames that have been ++ discarded by this port because the Routing ++ Information Field has exceeded the maximum route ++ descriptor length." ++ ::= { dot1dSrPortEntry 16 } ++ ++dot1dSrPortDupLanIdOrTreeErrors OBJECT-TYPE ++ SYNTAX Counter ++ ACCESS read-only ++ STATUS mandatory ++ DESCRIPTION ++ "The number of duplicate LAN IDs or Tree errors. ++ This helps in detection of problems in networks ++ containing older IBM Source Routing Bridges." ++ ::= { dot1dSrPortEntry 17 } ++ ++dot1dSrPortLanIdMismatches OBJECT-TYPE ++ SYNTAX Counter ++ ACCESS read-only ++ STATUS mandatory ++ DESCRIPTION ++ "The number of ARE and STE frames that were ++ discarded because the last LAN ID in the routing ++ information field did not equal the LAN-in ID. ++ This error can occur in implementations which do ++ only a LAN-in ID and Bridge Number check instead ++ of a LAN-in ID, Bridge Number, and LAN-out ID ++ check before they forward broadcast frames." ++ ::= { dot1dSrPortEntry 18 } ++ ++-- scalar object in dot1dSr ++ ++dot1dSrBridgeLfMode OBJECT-TYPE ++ SYNTAX INTEGER { ++ mode3(1), ++ mode6(2) ++ } ++ ACCESS read-write ++ STATUS mandatory ++ DESCRIPTION ++ "Indicates whether the bridge operates using older ++ 3 bit length negotiation fields or the newer 6 bit ++ length field in its RIF." ++ ::= { dot1dSr 2 } ++ ++-- The Port-Pair Database ++ ++-- Implementation of this group is optional. ++ ++-- This group is implemented by those bridges that support ++-- the direct multiport model of the source route bridging ++-- mode as defined in the IEEE 802.5 SRT Addendum to ++-- 802.1d. ++ ++-- Bridges implementing this group may report 65535 for ++-- dot1dSrPortBridgeNumber and dot1dSrPortTargetSegment, ++-- indicating that those objects are not applicable. ++ ++dot1dPortPairTableSize OBJECT-TYPE ++ SYNTAX Gauge ++ ACCESS read-only ++ STATUS mandatory ++ DESCRIPTION ++ "The total number of entries in the Bridge Port ++ Pair Database." ++ ::= { dot1dPortPair 1 } ++ ++-- the Bridge Port-Pair table ++ ++-- this table represents port pairs within a bridge forming ++-- a unique bridge path, as defined in the IEEE 802.5M SRT ++-- Addendum. ++ ++dot1dPortPairTable OBJECT-TYPE ++ SYNTAX SEQUENCE OF Dot1dPortPairEntry ++ ACCESS not-accessible ++ STATUS mandatory ++ DESCRIPTION ++ "A table that contains information about every ++ ++ port pair database entity associated with this ++ source routing bridge." ++ ::= { dot1dPortPair 2 } ++ ++dot1dPortPairEntry OBJECT-TYPE ++ SYNTAX Dot1dPortPairEntry ++ ACCESS not-accessible ++ STATUS mandatory ++ DESCRIPTION ++ "A list of information for each port pair entity ++ of a bridge." ++ INDEX { dot1dPortPairLowPort, dot1dPortPairHighPort } ++ ::= { dot1dPortPairTable 1 } ++ ++Dot1dPortPairEntry ::= ++ SEQUENCE { ++ dot1dPortPairLowPort ++ INTEGER, ++ dot1dPortPairHighPort ++ INTEGER, ++ dot1dPortPairBridgeNum ++ INTEGER, ++ dot1dPortPairBridgeState ++ INTEGER ++ } ++ ++dot1dPortPairLowPort OBJECT-TYPE ++ SYNTAX INTEGER (1..65535) ++ ACCESS read-write ++ STATUS mandatory ++ DESCRIPTION ++ "The port number of the lower numbered port for ++ which this entry contains port pair database ++ information." ++ ::= { dot1dPortPairEntry 1 } ++ ++dot1dPortPairHighPort OBJECT-TYPE ++ SYNTAX INTEGER (1..65535) ++ ACCESS read-write ++ STATUS mandatory ++ DESCRIPTION ++ "The port number of the higher numbered port for ++ which this entry contains port pair database ++ information." ++ ::= { dot1dPortPairEntry 2 } ++ ++dot1dPortPairBridgeNum OBJECT-TYPE ++ SYNTAX INTEGER ++ ++ ACCESS read-write ++ STATUS mandatory ++ DESCRIPTION ++ "A bridge number that uniquely identifies the path ++ provided by this source routing bridge between the ++ segments connected to dot1dPortPairLowPort and ++ dot1dPortPairHighPort. The purpose of bridge ++ number is to disambiguate between multiple paths ++ connecting the same two LANs." ++ ::= { dot1dPortPairEntry 3 } ++ ++dot1dPortPairBridgeState OBJECT-TYPE ++ SYNTAX INTEGER { ++ enabled(1), ++ disabled(2), ++ invalid(3) ++ } ++ ACCESS read-write ++ STATUS mandatory ++ DESCRIPTION ++ "The state of dot1dPortPairBridgeNum. Writing ++ 'invalid(3)' to this object removes the ++ corresponding entry." ++ ::= { dot1dPortPairEntry 4 } ++ ++END diff --git a/net/net-snmp/patches/140-debian-docfiles.patch b/net/net-snmp/patches/140-debian-docfiles.patch new file mode 100644 index 0000000..9a80e46 --- /dev/null +++ b/net/net-snmp/patches/140-debian-docfiles.patch @@ -0,0 +1,95 @@ +--- a/FAQ ++++ b/FAQ +@@ -99,7 +99,7 @@ TABLE OF CONTENTS + I don't understand the new access control stuff - what does it mean? + How do I configure SNMPv3 users? + The 'createUser' line disappears when I start the agent. Why? +- What's the difference between /var/net-snmp and /usr/local/share/snmp? ++ What's the difference between /var/lib/snmp and /usr/share/snmp? + My new agent is ignoring the old snmpd.conf file. Why? + Why am I getting "Connection refused"? + Why can't I see values in the UCDavis 'extensible' or 'disk' trees? +@@ -643,7 +643,7 @@ How do I add a MIB to the tools? + There are two steps required to add a new MIB file to the tools. + Firstly, copy the MIB file into the appropiate location: + +- cp MY-MIB.txt /usr/local/share/snmp/mibs ++ cp MY-MIB.txt /usr/share/snmp/mibs + (which makes it available to everyone on the system) + + or +@@ -1177,7 +1177,7 @@ My traphandler script doesn't work when + If this is the case, then you can specify this interpreter + explicitly as part of the trap handle directive: + +- traphandle default /usr/bin/perl /usr/local/bin/log_it ++ traphandle default /usr/bin/perl /usr/bin/log_it + + In this case, it's almost certain that you'll also + need to give the full path to the traphandle script (as shown) +@@ -1251,7 +1251,7 @@ OK, what should I put in snmp.conf? + string to use. + + Some of these (such as the MIB file location), might be best put in +- a shared snmp.conf file (typically /usr/local/share/snmp/snmp.conf or ++ a shared snmp.conf file (typically /usr/share/snmp/snmp.conf or + /etc/snmp/snmp.conf) to apply to all users of the system. Others + (particularly the SNMPv3 security settings), are more likely to refer + to a particular user, and should go in a personal snmp.conf file +@@ -1476,7 +1476,7 @@ Why aren't my mib files being read in? + + + Alternatively, the tools may be looking in the wrong place. +- The default location for the mib files is /usr/local/share/snmp/mibs. ++ The default location for the mib files is /usr/share/snmp/mibs. + Again, this is set when the suite is first configured and compiled. + This can be changed using the environmental variable 'MIBDIRS' + or the snmp.conf directive 'mibdirs'. +@@ -2430,7 +2430,7 @@ How do I configure SNMPv3 users? + + There are three ways to configure SNMPv3 users: + +- 1) Stop the agent, and create a file /var/net-snmp/snmpd.conf, ++ 1) Stop the agent, and create a file /var/lib/snmp/snmpd.conf, + containing the line + + createUser {myUser} MD5 {myPassword} DES +@@ -2443,7 +2443,7 @@ How do I configure SNMPv3 users? + net-snmp-config --create-snmpv3-user + + and follow the instructions. This will create an entry +- in the /var/net-snmp/snmpd.conf file similar to the above. ++ in the /var/lib/snmp/snmpd.conf file similar to the above. + Then re-start the snmpd agent. + + 3) Make sure the agent is running, and will respond to a suitable +@@ -2476,16 +2476,16 @@ The 'createUser' line disappears when I + + + +-What's the difference between /var/net-snmp and /usr/local/share/snmp? +---------------------------------------------------------------------- ++What's the difference between /var/lib/snmp and /usr/share/snmp? ++---------------------------------------------------------------- + +- The /var/net-snmp location is primarily used for information set ++ The /var/lib/snmp location is primarily used for information set + during the running of the agent, which needs to be persistent between + one run of the agent and the next. Apart from "createUser" (see + the previous entry), you shouldn't need to touch this file. + + All other user-provided configuration should go in the traditional +- location (typically /usr/local/share/snmp/snmpd.conf or /etc/snmp). ++ location (typically /usr/share/snmp or /etc/snmp). + + + +@@ -2498,7 +2498,7 @@ My new agent is ignoring the old snmpd.c + distribution), with the current release installed from the source. + + The default location for this file with the basic distribution is +- /usr/local/share/snmp/snmpd.conf (or PREFIX/share/snmp/snmpd.conf). ++ /usr/share/snmp/snmpd.conf (or PREFIX/share/snmp/snmpd.conf). + Ready-installed versions often look for the file as /etc/snmpd.conf, + or /etc/snmp/snmpd.conf. Try moving the old config file to the new + location, and restart the agent. diff --git a/net/net-snmp/patches/150-debian-defaultconfig.patch b/net/net-snmp/patches/150-debian-defaultconfig.patch new file mode 100644 index 0000000..205ed1a --- /dev/null +++ b/net/net-snmp/patches/150-debian-defaultconfig.patch @@ -0,0 +1,142 @@ +--- a/EXAMPLE.conf.def ++++ b/EXAMPLE.conf.def +@@ -6,7 +6,7 @@ + ############################################################################### + # + # This file is intended to only be an example. If, however, you want +-# to use it, it should be placed in SYSCONFDIR/snmp/snmpd.conf. ++# to use it, it should be placed in /etc/snmp/snmpd.conf. + # When the snmpd agent starts up, this is where it will look for it. + # + # You might be interested in generating your own snmpd.conf file using +@@ -58,31 +58,37 @@ + # from): + + # sec.name source community +-com2sec local localhost COMMUNITY +-com2sec mynetwork NETWORK/24 COMMUNITY ++com2sec paranoid default public ++#com2sec readonly default public ++#com2sec readwrite default private + + #### + # Second, map the security names into group names: + + # sec.model sec.name +-group MyRWGroup v1 local +-group MyRWGroup v2c local +-group MyRWGroup usm local +-group MyROGroup v1 mynetwork +-group MyROGroup v2c mynetwork +-group MyROGroup usm mynetwork ++group MyROSystem v1 paranoid ++group MyROSystem v2c paranoid ++group MyROSystem usm paranoid ++group MyROGroup v1 readonly ++group MyROGroup v2c readonly ++group MyROGroup usm readonly ++group MyRWGroup v1 readwrite ++group MyRWGroup v2c readwrite ++group MyRWGroup usm readwrite + + #### + # Third, create a view for us to let the groups have rights to: + + # incl/excl subtree mask + view all included .1 80 ++view system included .iso.org.dod.internet.mgmt.mib-2.system + + #### + # Finally, grant the 2 groups access to the 1 view with different + # write permissions: + + # context sec.model sec.level match read write notif ++access MyROSystem "" any noauth exact system none none + access MyROGroup "" any noauth exact all none none + access MyRWGroup "" any noauth exact all all none + +@@ -100,8 +106,8 @@ access MyRWGroup "" any noaut + # value of an object whose value is given here will fail with an error + # status of notWritable. + +-syslocation Right here, right now. +-syscontact Me ++syslocation Unknown (configure /etc/snmp/snmpd.local.conf) ++syscontact Root (configure /etc/snmp/snmpd.local.conf) + + # Example output of snmpwalk: + # % snmpwalk -v 1 -c public localhost system +@@ -135,13 +141,13 @@ syscontact Me + # + + # Make sure mountd is running +-proc mountd ++#proc mountd + + # Make sure there are no more than 4 ntalkds running, but 0 is ok too. +-proc ntalkd 4 ++#proc ntalkd 4 + + # Make sure at least one sendmail, but less than or equal to 10 are running. +-proc sendmail 10 1 ++#proc sendmail 10 1 + + # A snmpwalk of the prTable would look something like this: + # +@@ -199,7 +205,7 @@ proc sendmail 10 1 + # ARGS: optional arguments to be passed to the program + + # a simple hello world +-exec echotest /bin/echo hello world ++#exec echotest /bin/echo hello world + + # Run a shell script containing: + # +@@ -250,7 +256,7 @@ exec echotest /bin/echo hello world + + # Check the / partition and make sure it contains at least 10 megs. + +-disk / 10000 ++#disk / 10000 + + # % snmpwalk -v 1 -c public localhost .EXTENSIBLEDOTMIB.DISKMIBNUM + # enterprises.ucdavis.diskTable.dskEntry.diskIndex.1 = 0 +@@ -279,7 +285,7 @@ disk / 10000 + # 15MAX: Similar, but for 15 min average. + + # Check for loads: +-load 12 14 14 ++#load 12 14 14 + + # % snmpwalk -v 1 -c public localhost .EXTENSIBLEDOTMIB.LOADAVEMIBNUM + # enterprises.ucdavis.loadTable.laEntry.loadaveIndex.1 = 1 +@@ -365,7 +371,7 @@ load 12 14 14 + # (commented out here since it requires that you place the + # script in the right location. (its not installed by default)) + +-# pass .EXTENSIBLEDOTMIB.255 /bin/sh PREFIX/local/passtest ++# pass .EXTENSIBLEDOTMIB.255 /bin/sh /usr/local/passtest + + # % snmpwalk -v 1 -c public localhost .EXTENSIBLEDOTMIB.255 + # enterprises.ucdavis.255.1 = "life the universe and everything" +--- /dev/null ++++ b/EXAMPLE-trap.conf +@@ -0,0 +1,18 @@ ++############################################################################### ++# ++# EXAMPLE-trap.conf: ++# An example configuration file for configuring the Net-SNMP snmptrapd agent. ++# ++############################################################################### ++# ++# This file is intended to only be an example. If, however, you want ++# to use it, it should be placed in /etc/snmp/snmptrapd.conf. ++# When the snmptrapd agent starts up, this is where it will look for it. ++# ++# All lines beginning with a '#' are comments and are intended for you ++# to read. All other lines are configuration commands for the agent. ++ ++# ++# PLEASE: read the snmptrapd.conf(5) manual page as well! ++# ++ diff --git a/net/net-snmp/patches/160-no_ldconfig.patch b/net/net-snmp/patches/160-no_ldconfig.patch new file mode 100644 index 0000000..f883c7f --- /dev/null +++ b/net/net-snmp/patches/160-no_ldconfig.patch @@ -0,0 +1,12 @@ +diff -urN net-snmp-5.4.2.1/configure net-snmp-5.4.2.1.new/configure +--- net-snmp-5.4.2.1/configure 2008-10-31 16:53:45.000000000 +0100 ++++ net-snmp-5.4.2.1.new/configure 2009-08-02 00:46:05.000000000 +0200 +@@ -10218,7 +10218,7 @@ + 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' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' ++ finish_cmds='' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. diff --git a/net/net-snmp/patches/170-ldflags.patch b/net/net-snmp/patches/170-ldflags.patch new file mode 100644 index 0000000..d9826bc --- /dev/null +++ b/net/net-snmp/patches/170-ldflags.patch @@ -0,0 +1,11 @@ +--- a/Makefile.top ++++ b/Makefile.top +@@ -81,7 +81,7 @@ LIBCURRENT = 16 + LIBAGE = 1 + LIBREVISION = 2 + +-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) diff --git a/net/net-snmp/patches/750-ieee802dot11.patch b/net/net-snmp/patches/750-ieee802dot11.patch new file mode 100644 index 0000000..9e0625c --- /dev/null +++ b/net/net-snmp/patches/750-ieee802dot11.patch @@ -0,0 +1,6156 @@ +--- /dev/null ++++ b/agent/mibgroup/ieee802dot11.c +@@ -0,0 +1,4915 @@ ++/**************************************************************************** ++* * ++* File Name: ieee802dot11.c * ++* Used By: * ++* * ++* Operating System: * ++* Purpose: * ++* * ++* Comments: * ++* * ++* Author: Larry Simmons * ++* lsimmons@avantcom.com * ++* www.avantcom.com * ++* * ++* Creation Date: 09/02/03 * ++* * ++* Ver Date Inits Modification * ++* ----- -------- ----- ------------ * ++* 0.0.1 09/02/03 LRS created * ++* 0.0.2 09/24/03 LRS wouldn't build after fresh ./configure * ++****************************************************************************/ ++/**************************************************************************** ++* Includes * ++****************************************************************************/ ++#include ++#include ++#include ++#include "ieee802dot11.h" ++#include "iwlib.h" ++ ++/**************************************************************************** ++* Defines * ++****************************************************************************/ ++#define DISPLAYWIEXT // display wireless ext info ++#define TABLE_SIZE 1 ++//#define MINLOADFREQ 15 // min reload frequency in seconds ++#define MINLOADFREQ 5 // min reload frequency in seconds // for testing ++#define PROC_NET_DEV "/proc/net/dev" ++#define PROC_NET_WIRELESS "/proc/net/wireless" ++ ++#ifndef UCHAR ++ typedef unsigned char UCHAR; ++#endif ++ ++/**************************************************************************** ++* Private Functions * ++****************************************************************************/ ++static void loadTables(); ++static void loadWiExt ( int, char *, struct wireless_info * ); ++static void load80211Structs ( int, char *, struct wireless_info * ); ++static void initStructs(); ++ ++// Wireless Extensions Specific Functions ++static void loadWiExtTo80211Structs ( int, char *, struct wireless_info * ); ++static void displayWiExt ( struct wireless_info ); ++ ++// Linked List Functions ++static void addList ( char *, char *, int ); ++static void initLists(); // initialize all the linked lists ++static void flushLists(); // flush all the linked lists ++static void flushList ( char * ); // flush a single linked list ++ ++// Utility Functions ++static int openSocket ( void ); ++static int mWatt2dbm ( int ); ++static char *htob ( char * ); ++static int hasChanged ( char *, int ); ++ ++/**************************************************************************** ++* Private Variables * ++****************************************************************************/ ++static unsigned long lastLoad = 0; // ET in secs at last table load ++ ++static struct avNode *lastNode, *newNode, *np; ++ ++/**************************************************************************** ++* External Functions * ++****************************************************************************/ ++ ++/**************************************************************************** ++* ieee802dot11_variables_oid: * ++* this is the top level oid that we want to register under. This * ++* is essentially a prefix, with the suffix appearing in the * ++* variable below. * ++****************************************************************************/ ++oid ieee802dot11_variables_oid[] = { 1,2,840,10036 }; ++ ++/**************************************************************************** ++* variable7 ieee802dot11_variables: * ++* this variable defines function callbacks and type return information * ++* for the ieee802dot11 mib section * ++****************************************************************************/ ++struct variable7 ieee802dot11_variables[] = { ++/* magic number , variable type , ro/rw , callback fn , L, oidsuffix */ ++#define DOT11STATIONID 3 ++ { DOT11STATIONID , ASN_OCTET_STR , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,1 } }, ++#define DOT11MEDIUMOCCUPANCYLIMIT 4 ++ { DOT11MEDIUMOCCUPANCYLIMIT, ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,2 } }, ++#define DOT11CFPOLLABLE 5 ++ { DOT11CFPOLLABLE , ASN_INTEGER , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,3 } }, ++#define DOT11CFPPERIOD 6 ++ { DOT11CFPPERIOD , ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,4 } }, ++#define DOT11CFPMAXDURATION 7 ++ { DOT11CFPMAXDURATION , ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,5 } }, ++#define DOT11AUTHENTICATIONRESPONSETIMEOUT 8 ++ { DOT11AUTHENTICATIONRESPONSETIMEOUT, ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,6 } }, ++#define DOT11PRIVACYOPTIONIMPLEMENTED 9 ++ { DOT11PRIVACYOPTIONIMPLEMENTED, ASN_INTEGER , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,7 } }, ++#define DOT11POWERMANAGEMENTMODE 10 ++ { DOT11POWERMANAGEMENTMODE, ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,8 } }, ++#define DOT11DESIREDSSID 11 ++ { DOT11DESIREDSSID , ASN_OCTET_STR , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,9 } }, ++#define DOT11DESIREDBSSTYPE 12 ++ { DOT11DESIREDBSSTYPE , ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,10 } }, ++#define DOT11OPERATIONALRATESET 13 ++ { DOT11OPERATIONALRATESET, ASN_OCTET_STR , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,11 } }, ++#define DOT11BEACONPERIOD 14 ++ { DOT11BEACONPERIOD , ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,12 } }, ++#define DOT11DTIMPERIOD 15 ++ { DOT11DTIMPERIOD , ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,13 } }, ++#define DOT11ASSOCIATIONRESPONSETIMEOUT 16 ++ { DOT11ASSOCIATIONRESPONSETIMEOUT, ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,14 } }, ++#define DOT11DISASSOCIATEREASON 17 ++ { DOT11DISASSOCIATEREASON, ASN_INTEGER , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,15 } }, ++#define DOT11DISASSOCIATESTATION 18 ++ { DOT11DISASSOCIATESTATION, ASN_OCTET_STR , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,16 } }, ++#define DOT11DEAUTHENTICATEREASON 19 ++ { DOT11DEAUTHENTICATEREASON, ASN_INTEGER , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,17 } }, ++#define DOT11DEAUTHENTICATESTATION 20 ++ { DOT11DEAUTHENTICATESTATION, ASN_OCTET_STR , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,18 } }, ++#define DOT11AUTHENTICATEFAILSTATUS 21 ++ { DOT11AUTHENTICATEFAILSTATUS, ASN_INTEGER , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,19 } }, ++#define DOT11AUTHENTICATEFAILSTATION 22 ++ { DOT11AUTHENTICATEFAILSTATION, ASN_OCTET_STR , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,20 } }, ++ ++#define DOT11AUTHENTICATIONALGORITHM 26 ++ { DOT11AUTHENTICATIONALGORITHM, ASN_INTEGER , RONLY , var_dot11AuthenticationAlgorithmsTable, 4, { 1,2,1,2 } }, ++#define DOT11AUTHENTICATIONALGORITHMSENABLE 27 ++ { DOT11AUTHENTICATIONALGORITHMSENABLE, ASN_INTEGER , RWRITE, var_dot11AuthenticationAlgorithmsTable, 4, { 1,2,1,3 } }, ++ ++#define DOT11WEPDEFAULTKEYVALUE 31 ++ { DOT11WEPDEFAULTKEYVALUE, ASN_OCTET_STR , RWRITE, var_dot11WEPDefaultKeysTable, 4, { 1,3,1,2 } }, ++ ++#define DOT11WEPKEYMAPPINGADDRESS 35 ++ { DOT11WEPKEYMAPPINGADDRESS, ASN_OCTET_STR , RWRITE, var_dot11WEPKeyMappingsTable, 4, { 1,4,1,2 } }, ++#define DOT11WEPKEYMAPPINGWEPON 36 ++ { DOT11WEPKEYMAPPINGWEPON, ASN_INTEGER , RWRITE, var_dot11WEPKeyMappingsTable, 4, { 1,4,1,3 } }, ++#define DOT11WEPKEYMAPPINGVALUE 37 ++ { DOT11WEPKEYMAPPINGVALUE, ASN_OCTET_STR , RWRITE, var_dot11WEPKeyMappingsTable, 4, { 1,4,1,4 } }, ++#define DOT11WEPKEYMAPPINGSTATUS 38 ++ { DOT11WEPKEYMAPPINGSTATUS, ASN_INTEGER , RWRITE, var_dot11WEPKeyMappingsTable, 4, { 1,4,1,5 } }, ++ ++#define DOT11PRIVACYINVOKED 41 ++ { DOT11PRIVACYINVOKED , ASN_INTEGER , RWRITE, var_dot11PrivacyTable, 4, { 1,5,1,1 } }, ++#define DOT11WEPDEFAULTKEYID 42 ++ { DOT11WEPDEFAULTKEYID, ASN_INTEGER , RWRITE, var_dot11PrivacyTable, 4, { 1,5,1,2 } }, ++#define DOT11WEPKEYMAPPINGLENGTH 43 ++ { DOT11WEPKEYMAPPINGLENGTH, ASN_INTEGER , RWRITE, var_dot11PrivacyTable, 4, { 1,5,1,3 } }, ++#define DOT11EXCLUDEUNENCRYPTED 44 ++ { DOT11EXCLUDEUNENCRYPTED, ASN_INTEGER , RWRITE, var_dot11PrivacyTable, 4, { 1,5,1,4 } }, ++#define DOT11WEPICVERRORCOUNT 45 ++ { DOT11WEPICVERRORCOUNT, ASN_COUNTER , RONLY , var_dot11PrivacyTable, 4, { 1,5,1,5 } }, ++#define DOT11WEPEXCLUDEDCOUNT 46 ++ { DOT11WEPEXCLUDEDCOUNT, ASN_COUNTER , RONLY , var_dot11PrivacyTable, 4, { 1,5,1,6 } }, ++ ++#define DOT11MACADDRESS 49 ++ { DOT11MACADDRESS , ASN_OCTET_STR , RONLY , var_dot11OperationTable, 4, { 2,1,1,1 } }, ++#define DOT11RTSTHRESHOLD 50 ++ { DOT11RTSTHRESHOLD , ASN_INTEGER , RWRITE, var_dot11OperationTable, 4, { 2,1,1,2 } }, ++#define DOT11SHORTRETRYLIMIT 51 ++ { DOT11SHORTRETRYLIMIT, ASN_INTEGER , RWRITE, var_dot11OperationTable, 4, { 2,1,1,3 } }, ++#define DOT11LONGRETRYLIMIT 52 ++ { DOT11LONGRETRYLIMIT , ASN_INTEGER , RWRITE, var_dot11OperationTable, 4, { 2,1,1,4 } }, ++#define DOT11FRAGMENTATIONTHRESHOLD 53 ++ { DOT11FRAGMENTATIONTHRESHOLD, ASN_INTEGER , RWRITE, var_dot11OperationTable, 4, { 2,1,1,5 } }, ++#define DOT11MAXTRANSMITMSDULIFETIME 54 ++ { DOT11MAXTRANSMITMSDULIFETIME, ASN_INTEGER , RWRITE, var_dot11OperationTable, 4, { 2,1,1,6 } }, ++#define DOT11MAXRECEIVELIFETIME 55 ++ { DOT11MAXRECEIVELIFETIME, ASN_INTEGER , RWRITE, var_dot11OperationTable, 4, { 2,1,1,7 } }, ++#define DOT11MANUFACTURERID 56 ++ { DOT11MANUFACTURERID , ASN_OCTET_STR , RONLY , var_dot11OperationTable, 4, { 2,1,1,8 } }, ++#define DOT11PRODUCTID 57 ++ { DOT11PRODUCTID , ASN_OCTET_STR , RONLY , var_dot11OperationTable, 4, { 2,1,1,9 } }, ++ ++#define DOT11TRANSMITTEDFRAGMENTCOUNT 60 ++ { DOT11TRANSMITTEDFRAGMENTCOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,1 } }, ++#define DOT11MULTICASTTRANSMITTEDFRAMECOUNT 61 ++ { DOT11MULTICASTTRANSMITTEDFRAMECOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,2 } }, ++#define DOT11FAILEDCOUNT 62 ++ { DOT11FAILEDCOUNT , ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,3 } }, ++#define DOT11RETRYCOUNT 63 ++ { DOT11RETRYCOUNT , ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,4 } }, ++#define DOT11MULTIPLERETRYCOUNT 64 ++ { DOT11MULTIPLERETRYCOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,5 } }, ++#define DOT11FRAMEDUPLICATECOUNT 65 ++ { DOT11FRAMEDUPLICATECOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,6 } }, ++#define DOT11RTSSUCCESSCOUNT 66 ++ { DOT11RTSSUCCESSCOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,7 } }, ++#define DOT11RTSFAILURECOUNT 67 ++ { DOT11RTSFAILURECOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,8 } }, ++#define DOT11ACKFAILURECOUNT 68 ++ { DOT11ACKFAILURECOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,9 } }, ++#define DOT11RECEIVEDFRAGMENTCOUNT 69 ++ { DOT11RECEIVEDFRAGMENTCOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,10 } }, ++#define DOT11MULTICASTRECEIVEDFRAMECOUNT 70 ++ { DOT11MULTICASTRECEIVEDFRAMECOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,11 } }, ++#define DOT11FCSERRORCOUNT 71 ++ { DOT11FCSERRORCOUNT , ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,12 } }, ++#define DOT11TRANSMITTEDFRAMECOUNT 72 ++ { DOT11TRANSMITTEDFRAMECOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,13 } }, ++#define DOT11WEPUNDECRYPTABLECOUNT 73 ++ { DOT11WEPUNDECRYPTABLECOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,14 } }, ++ ++#define DOT11ADDRESS 77 ++ { DOT11ADDRESS , ASN_OCTET_STR , RWRITE, var_dot11GroupAddressesTable, 4, { 2,3,1,2 } }, ++#define DOT11GROUPADDRESSESSTATUS 78 ++ { DOT11GROUPADDRESSESSTATUS, ASN_INTEGER , RWRITE, var_dot11GroupAddressesTable, 4, { 2,3,1,3 } }, ++ ++#define DOT11RESOURCETYPEIDNAME 79 ++ { DOT11RESOURCETYPEIDNAME, ASN_OCTET_STR , RONLY , var_ieee802dot11, 3, { 3,1,1 } }, ++#define DOT11MANUFACTUREROUI 82 ++ { DOT11MANUFACTUREROUI, ASN_OCTET_STR , RONLY , var_dot11ResourceInfoTable, 5, { 3,1,2,1,1 } }, ++#define DOT11MANUFACTURERNAME 83 ++ { DOT11MANUFACTURERNAME, ASN_OCTET_STR , RONLY , var_dot11ResourceInfoTable, 5, { 3,1,2,1,2 } }, ++#define DOT11MANUFACTURERPRODUCTNAME 84 ++ { DOT11MANUFACTURERPRODUCTNAME, ASN_OCTET_STR , RONLY , var_dot11ResourceInfoTable, 5, { 3,1,2,1,3 } }, ++#define DOT11MANUFACTURERPRODUCTVERSION 85 ++ { DOT11MANUFACTURERPRODUCTVERSION, ASN_OCTET_STR , RONLY , var_dot11ResourceInfoTable, 5, { 3,1,2,1,4 } }, ++ ++#define DOT11PHYTYPE 88 ++ { DOT11PHYTYPE , ASN_INTEGER , RONLY , var_dot11PhyOperationTable, 4, { 4,1,1,1 } }, ++#define DOT11CURRENTREGDOMAIN 89 ++ { DOT11CURRENTREGDOMAIN, ASN_INTEGER , RWRITE, var_dot11PhyOperationTable, 4, { 4,1,1,2 } }, ++#define DOT11TEMPTYPE 90 ++ { DOT11TEMPTYPE , ASN_INTEGER , RONLY , var_dot11PhyOperationTable, 4, { 4,1,1,3 } }, ++#define DOT11CURRENTTXANTENNA 93 ++ { DOT11CURRENTTXANTENNA, ASN_INTEGER , RWRITE, var_dot11PhyAntennaTable, 4, { 4,2,1,1 } }, ++#define DOT11DIVERSITYSUPPORT 94 ++ { DOT11DIVERSITYSUPPORT, ASN_INTEGER , RONLY , var_dot11PhyAntennaTable, 4, { 4,2,1,2 } }, ++#define DOT11CURRENTRXANTENNA 95 ++ { DOT11CURRENTRXANTENNA, ASN_INTEGER , RWRITE, var_dot11PhyAntennaTable, 4, { 4,2,1,3 } }, ++#define DOT11NUMBERSUPPORTEDPOWERLEVELS 98 ++ { DOT11NUMBERSUPPORTEDPOWERLEVELS, ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,1 } }, ++#define DOT11TXPOWERLEVEL1 99 ++ { DOT11TXPOWERLEVEL1 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,2 } }, ++#define DOT11TXPOWERLEVEL2 100 ++ { DOT11TXPOWERLEVEL2 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,3 } }, ++#define DOT11TXPOWERLEVEL3 101 ++ { DOT11TXPOWERLEVEL3 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,4 } }, ++#define DOT11TXPOWERLEVEL4 102 ++ { DOT11TXPOWERLEVEL4 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,5 } }, ++#define DOT11TXPOWERLEVEL5 103 ++ { DOT11TXPOWERLEVEL5 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,6 } }, ++#define DOT11TXPOWERLEVEL6 104 ++ { DOT11TXPOWERLEVEL6 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,7 } }, ++#define DOT11TXPOWERLEVEL7 105 ++ { DOT11TXPOWERLEVEL7 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,8 } }, ++#define DOT11TXPOWERLEVEL8 106 ++ { DOT11TXPOWERLEVEL8 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,9 } }, ++#define DOT11CURRENTTXPOWERLEVEL 107 ++ { DOT11CURRENTTXPOWERLEVEL, ASN_INTEGER , RWRITE, var_dot11PhyTxPowerTable, 4, { 4,3,1,10 } }, ++ ++#define DOT11HOPTIME 110 ++ { DOT11HOPTIME , ASN_INTEGER , RONLY , var_dot11PhyFHSSTable, 4, { 4,4,1,1 } }, ++#define DOT11CURRENTCHANNELNUMBER 111 ++ { DOT11CURRENTCHANNELNUMBER, ASN_INTEGER , RWRITE, var_dot11PhyFHSSTable, 4, { 4,4,1,2 } }, ++#define DOT11MAXDWELLTIME 112 ++ { DOT11MAXDWELLTIME , ASN_INTEGER , RONLY , var_dot11PhyFHSSTable, 4, { 4,4,1,3 } }, ++#define DOT11CURRENTDWELLTIME 113 ++ { DOT11CURRENTDWELLTIME, ASN_INTEGER , RWRITE, var_dot11PhyFHSSTable, 4, { 4,4,1,4 } }, ++#define DOT11CURRENTSET 114 ++ { DOT11CURRENTSET , ASN_INTEGER , RWRITE, var_dot11PhyFHSSTable, 4, { 4,4,1,5 } }, ++#define DOT11CURRENTPATTERN 115 ++ { DOT11CURRENTPATTERN , ASN_INTEGER , RWRITE, var_dot11PhyFHSSTable, 4, { 4,4,1,6 } }, ++#define DOT11CURRENTINDEX 116 ++ { DOT11CURRENTINDEX , ASN_INTEGER , RWRITE, var_dot11PhyFHSSTable, 4, { 4,4,1,7 } }, ++ ++#define DOT11CURRENTCHANNEL 119 ++ { DOT11CURRENTCHANNEL , ASN_INTEGER , RWRITE, var_dot11PhyDSSSTable, 4, { 4,5,1,1 } }, ++#define DOT11CCAMODESUPPORTED 120 ++ { DOT11CCAMODESUPPORTED, ASN_INTEGER , RONLY , var_dot11PhyDSSSTable, 4, { 4,5,1,2 } }, ++#define DOT11CURRENTCCAMODE 121 ++ { DOT11CURRENTCCAMODE , ASN_INTEGER , RWRITE, var_dot11PhyDSSSTable, 4, { 4,5,1,3 } }, ++#define DOT11EDTHRESHOLD 122 ++ { DOT11EDTHRESHOLD , ASN_INTEGER , RWRITE, var_dot11PhyDSSSTable, 4, { 4,5,1,4 } }, ++ ++#define DOT11CCAWATCHDOGTIMERMAX 125 ++ { DOT11CCAWATCHDOGTIMERMAX, ASN_INTEGER , RWRITE, var_dot11PhyIRTable, 4, { 4,6,1,1 } }, ++#define DOT11CCAWATCHDOGCOUNTMAX 126 ++ { DOT11CCAWATCHDOGCOUNTMAX, ASN_INTEGER , RWRITE, var_dot11PhyIRTable, 4, { 4,6,1,2 } }, ++#define DOT11CCAWATCHDOGTIMERMIN 127 ++ { DOT11CCAWATCHDOGTIMERMIN, ASN_INTEGER , RWRITE, var_dot11PhyIRTable, 4, { 4,6,1,3 } }, ++#define DOT11CCAWATCHDOGCOUNTMIN 128 ++ { DOT11CCAWATCHDOGCOUNTMIN, ASN_INTEGER , RWRITE, var_dot11PhyIRTable, 4, { 4,6,1,4 } }, ++ ++#define DOT11REGDOMAINSSUPPORTVALUE 132 ++ { DOT11REGDOMAINSSUPPORTVALUE, ASN_INTEGER , RONLY , var_dot11RegDomainsSupportedTable, 4, { 4,7,1,2 } }, ++ ++#define DOT11SUPPORTEDTXANTENNA 136 ++ { DOT11SUPPORTEDTXANTENNA, ASN_INTEGER , RWRITE, var_dot11AntennasListTable, 4, { 4,8,1,2 } }, ++#define DOT11SUPPORTEDRXANTENNA 137 ++ { DOT11SUPPORTEDRXANTENNA, ASN_INTEGER , RWRITE, var_dot11AntennasListTable, 4, { 4,8,1,3 } }, ++#define DOT11DIVERSITYSELECTIONRX 138 ++ { DOT11DIVERSITYSELECTIONRX, ASN_INTEGER , RWRITE, var_dot11AntennasListTable, 4, { 4,8,1,4 } }, ++ ++#define DOT11SUPPORTEDDATARATESTXVALUE 142 ++ { DOT11SUPPORTEDDATARATESTXVALUE, ASN_INTEGER , RONLY , var_dot11SupportedDataRatesTxTable, 4, { 4,9,1,2 } }, ++ ++#define DOT11SUPPORTEDDATARATESRXVALUE 146 ++ { DOT11SUPPORTEDDATARATESRXVALUE, ASN_INTEGER , RONLY , var_dot11SupportedDataRatesRxTable, 4, { 4,10,1,2 } }, ++}; ++// ( L = length of the oidsuffix ) ++ ++/**************************************************************************** ++* * ++* init_ieee802dot11() - perform any required initialization * ++* * ++****************************************************************************/ ++void init_ieee802dot11 ( void ) { ++ ++ /* register ourselves with the agent to handle our mib tree */ ++ REGISTER_MIB("ieee802dot11", ieee802dot11_variables, variable7, ++ ieee802dot11_variables_oid); ++ ++ initLists(); ++} ++ ++/**************************************************************************** ++* * ++* shutdown_ieee802dot11() - perform any required cleanup @ shutdown * ++* * ++****************************************************************************/ ++void shutdown_ieee802dot11 ( void ) ++{ ++ flushLists(); ++} ++ ++/**************************************************************************** ++* * ++* var_ieee802dot11() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_ieee802dot11 ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method) ++{ ++ loadTables(); ++ ++ if ( header_generic ( vp, name, length, exact,var_len,write_method ) ++ == MATCH_FAILED ) ++ return NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11RESOURCETYPEIDNAME: ++ if ( !haveResourceTypeIDName ) ++ return NULL; ++ *var_len = strlen ( resourceTypeIDName ); ++ return ( UCHAR * ) resourceTypeIDName; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11StationConfigTable() - return a variable value from the table * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11StationConfigTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method ) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ static char MACWork[17]; ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &scList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ sc = ( struct scTbl_data * ) np->data; ++ rName[vp->namelen] = sc->ifIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) { ++ ++ switch ( vp->magic ) { // found requested OID, now check for requested variable ++ case DOT11STATIONID: ++ if ( sc->haveStationID ) found = TRUE; break; ++ case DOT11MEDIUMOCCUPANCYLIMIT: ++ if ( sc->haveMediumOccupancyLimit ) found = TRUE; break; ++ case DOT11CFPOLLABLE: ++ if ( sc->haveCFPPollable ) found = TRUE; break; ++ case DOT11CFPPERIOD: ++ if ( sc->haveCFPPeriod ) found = TRUE; break; ++ case DOT11CFPMAXDURATION: ++ if ( sc->haveMaxDuration ) found = TRUE; break; ++ case DOT11AUTHENTICATIONRESPONSETIMEOUT: ++ if ( sc->haveAuthenticationResponseTimeOut ) found = TRUE; break; ++ case DOT11PRIVACYOPTIONIMPLEMENTED: ++ if ( sc->havePrivacyOptionImplemented ) found = TRUE; break; ++ case DOT11POWERMANAGEMENTMODE: ++ if ( sc->havePowerManagementMode ) found = TRUE; break; ++ case DOT11DESIREDSSID: ++ if ( sc->haveDesiredSSID ) found = TRUE; break; ++ case DOT11DESIREDBSSTYPE: ++ if ( sc->haveDesiredBSSType ) found = TRUE; break; ++ case DOT11OPERATIONALRATESET: ++ if ( sc->haveOperationalRateSet ) found = TRUE; break; ++ case DOT11BEACONPERIOD: ++ if ( sc->haveBeaconPeriod ) found = TRUE; break; ++ case DOT11DTIMPERIOD: ++ if ( sc->haveDTIMPeriod ) found = TRUE; break; ++ case DOT11ASSOCIATIONRESPONSETIMEOUT: ++ if ( sc->haveAssociationResponseTimeOut ) found = TRUE; break; ++ case DOT11DISASSOCIATEREASON: ++ if ( sc->disAssociationReason ) found = TRUE; break; ++ case DOT11DISASSOCIATESTATION: ++ if ( sc->haveDisAssociationStation ) found = TRUE; break; ++ case DOT11DEAUTHENTICATEREASON: ++ if ( sc->deAuthenticationReason ) found = TRUE; break; ++ case DOT11DEAUTHENTICATESTATION: ++ if ( sc->haveDeAuthenticationStation ) found = TRUE; break; ++ case DOT11AUTHENTICATEFAILSTATUS: ++ if ( sc->authenticateFailStatus ) found = TRUE; break; ++ case DOT11AUTHENTICATEFAILSTATION: ++ if ( sc->haveAuthenticateFailStation ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); ++ *length = vp->namelen + 1; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11STATIONID: ++// *write_method = write_dot11StationID; ++ MACWork[ 0] = sc->stationID [ 0]; ++ MACWork[ 1] = sc->stationID [ 1]; ++ MACWork[ 2] = sc->stationID [ 3]; ++ MACWork[ 3] = sc->stationID [ 4]; ++ MACWork[ 4] = sc->stationID [ 6]; ++ MACWork[ 5] = sc->stationID [ 7]; ++ MACWork[ 6] = sc->stationID [ 9]; ++ MACWork[ 7] = sc->stationID [10]; ++ MACWork[ 8] = sc->stationID [12]; ++ MACWork[ 9] = sc->stationID [13]; ++ MACWork[10] = sc->stationID [15]; ++ MACWork[11] = sc->stationID [16]; ++ MACWork[12] = '\0'; ++ *var_len = 6; ++ return ( UCHAR * ) htob ( MACWork ); ++ ++ case DOT11MEDIUMOCCUPANCYLIMIT: ++// *write_method = write_dot11MediumOccupancyLimit; ++ sc->mediumOccupancyLimit = 5; ++ return ( UCHAR * ) &sc->mediumOccupancyLimit; ++ ++ case DOT11CFPOLLABLE: ++ return ( UCHAR * ) &sc->CFPPollable; ++ ++ case DOT11CFPPERIOD: ++// *write_method = write_dot11CFPPeriod; ++ return ( UCHAR * ) &sc->CFPPeriod; ++ ++ case DOT11CFPMAXDURATION: ++// *write_method = write_dot11CFPMaxDuration; ++ return ( UCHAR * ) &sc->maxDuration; ++ ++ case DOT11AUTHENTICATIONRESPONSETIMEOUT: ++// *write_method = write_dot11AuthenticationResponseTimeOut; ++ return ( UCHAR * ) &sc->authenticationResponseTimeOut; ++ ++ case DOT11PRIVACYOPTIONIMPLEMENTED: ++ return ( UCHAR * ) &sc->privacyOptionImplemented; ++ ++ case DOT11POWERMANAGEMENTMODE: ++// *write_method = write_dot11PowerManagementMode; ++ return ( UCHAR * ) &sc->powerManagementMode; ++ ++ case DOT11DESIREDSSID: ++// *write_method = write_dot11DesiredSSID; ++ *var_len = strlen ( sc->desiredSSID ); ++ return ( UCHAR * ) sc->desiredSSID; ++ ++ case DOT11DESIREDBSSTYPE: ++// *write_method = write_dot11DesiredBSSType; ++ return ( UCHAR * ) &sc->desiredBSSType; ++ ++ case DOT11OPERATIONALRATESET: ++// *write_method = write_dot11OperationalRateSet; ++ *var_len = strlen ( sc->operationalRateSet ); ++ return ( UCHAR * ) sc->operationalRateSet; ++ ++ case DOT11BEACONPERIOD: ++// *write_method = write_dot11BeaconPeriod; ++ return ( UCHAR * ) &sc->beaconPeriod; ++ ++ case DOT11DTIMPERIOD: ++// *write_method = write_dot11DTIMPeriod; ++ return ( UCHAR * ) &sc->DTIMPeriod; ++ ++ case DOT11ASSOCIATIONRESPONSETIMEOUT: ++// *write_method = write_dot11AssociationResponseTimeOut; ++ return ( UCHAR * ) &sc->associationResponseTimeOut; ++ ++ case DOT11DISASSOCIATEREASON: ++ return ( UCHAR * ) &sc->disAssociationReason; ++ ++ case DOT11DISASSOCIATESTATION: ++ MACWork[ 0] = sc->disAssociationStation[ 0]; ++ MACWork[ 1] = sc->disAssociationStation[ 1]; ++ MACWork[ 2] = sc->disAssociationStation[ 3]; ++ MACWork[ 3] = sc->disAssociationStation[ 4]; ++ MACWork[ 4] = sc->disAssociationStation[ 6]; ++ MACWork[ 5] = sc->disAssociationStation[ 7]; ++ MACWork[ 6] = sc->disAssociationStation[ 9]; ++ MACWork[ 7] = sc->disAssociationStation[10]; ++ MACWork[ 8] = sc->disAssociationStation[12]; ++ MACWork[ 9] = sc->disAssociationStation[13]; ++ MACWork[10] = sc->disAssociationStation[15]; ++ MACWork[11] = sc->disAssociationStation[16]; ++ MACWork[12] = '\0'; ++ *var_len = 6; ++ return ( UCHAR * ) htob ( MACWork ); ++ ++ case DOT11DEAUTHENTICATEREASON: ++ return ( UCHAR * ) &sc->deAuthenticationReason; ++ ++ case DOT11DEAUTHENTICATESTATION: ++ MACWork[ 0] = sc->deAuthenticationStation[ 0]; ++ MACWork[ 1] = sc->deAuthenticationStation[ 1]; ++ MACWork[ 2] = sc->deAuthenticationStation[ 3]; ++ MACWork[ 3] = sc->deAuthenticationStation[ 4]; ++ MACWork[ 4] = sc->deAuthenticationStation[ 6]; ++ MACWork[ 5] = sc->deAuthenticationStation[ 7]; ++ MACWork[ 6] = sc->deAuthenticationStation[ 9]; ++ MACWork[ 7] = sc->deAuthenticationStation[10]; ++ MACWork[ 8] = sc->deAuthenticationStation[12]; ++ MACWork[ 9] = sc->deAuthenticationStation[13]; ++ MACWork[10] = sc->deAuthenticationStation[15]; ++ MACWork[11] = sc->deAuthenticationStation[16]; ++ MACWork[12] = '\0'; ++ *var_len = 6; ++ return ( UCHAR * ) htob ( MACWork ); ++ ++ case DOT11AUTHENTICATEFAILSTATUS: ++ return ( UCHAR * ) &sc->authenticateFailStatus; ++ ++ case DOT11AUTHENTICATEFAILSTATION: ++ MACWork[ 0] = sc->authenticateFailStation[ 0]; ++ MACWork[ 1] = sc->authenticateFailStation[ 1]; ++ MACWork[ 2] = sc->authenticateFailStation[ 3]; ++ MACWork[ 3] = sc->authenticateFailStation[ 4]; ++ MACWork[ 4] = sc->authenticateFailStation[ 6]; ++ MACWork[ 5] = sc->authenticateFailStation[ 7]; ++ MACWork[ 6] = sc->authenticateFailStation[ 9]; ++ MACWork[ 7] = sc->authenticateFailStation[10]; ++ MACWork[ 8] = sc->authenticateFailStation[12]; ++ MACWork[ 9] = sc->authenticateFailStation[13]; ++ MACWork[10] = sc->authenticateFailStation[15]; ++ MACWork[11] = sc->authenticateFailStation[16]; ++ MACWork[12] = '\0'; ++ *var_len = 6; ++ return ( UCHAR * ) htob ( MACWork ); ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11AuthenticationAlgorithmsTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11AuthenticationAlgorithmsTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method ) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &aaList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ aa = ( struct aaTbl_data * ) np->data; ++ rName[vp->namelen + 0] = aa->ifIndex; ++ rName[vp->namelen + 1] = aa->authenticationAlgorithmsIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11AUTHENTICATIONALGORITHM: ++ if ( aa->haveAuthenticationAlgorithm ) found = TRUE; break; ++ case DOT11AUTHENTICATIONALGORITHMSENABLE: ++ if ( aa->authenticationAlgorithmsEnable ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); ++ *length = vp->namelen + 2; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11AUTHENTICATIONALGORITHM: ++ return ( UCHAR * ) &aa->authenticationAlgorithm; ++ ++ case DOT11AUTHENTICATIONALGORITHMSENABLE: ++// *write_method = write_dot11AuthenticationAlgorithmsEnable; ++ return ( UCHAR * ) &aa->authenticationAlgorithmsEnable; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11WEPDefaultKeysTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11WEPDefaultKeysTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method ) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &dfList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ df = ( struct dfTbl_data * ) np->data; ++ rName[vp->namelen + 0] = df->ifIndex; ++ rName[vp->namelen + 1] = df->WEPDefaultKeyIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11WEPDEFAULTKEYVALUE: ++ if ( df->haveWEPDefaultKeyValue ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); ++ *length = vp->namelen + 2; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11WEPDEFAULTKEYVALUE: ++// *write_method = write_dot11WEPDefaultKeyValue; ++ *var_len = strlen ( df->WEPDefaultKeyValue ); ++ return ( UCHAR * ) df->WEPDefaultKeyValue; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11WEPKeyMappingsTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11WEPKeyMappingsTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method) ++{ ++ static char MACWork[17]; ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &kmList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ km = ( struct kmTbl_data * ) np->data; ++ rName[vp->namelen + 0] = km->ifIndex; ++ rName[vp->namelen + 1] = km->WEPKeyMappingIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11WEPKEYMAPPINGADDRESS: ++ if ( km->haveWEPKeyMappingAddress ) found = TRUE; break; ++ case DOT11WEPKEYMAPPINGWEPON: ++ if ( km->haveWEPKeyMappingWEPOn ) found = TRUE; break; ++ case DOT11WEPKEYMAPPINGVALUE: ++ if ( km->haveWEPKeyMappingValue ) found = TRUE; break; ++ case DOT11WEPKEYMAPPINGSTATUS: ++ if ( km->haveWEPKeyMappingStatus ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); ++ *length = vp->namelen + 2; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11WEPKEYMAPPINGADDRESS: ++// *write_method = write_dot11WEPKeyMappingAddress; ++ MACWork[ 0] = km->WEPKeyMappingAddress[ 0]; ++ MACWork[ 1] = km->WEPKeyMappingAddress[ 1]; ++ MACWork[ 2] = km->WEPKeyMappingAddress[ 3]; ++ MACWork[ 3] = km->WEPKeyMappingAddress[ 4]; ++ MACWork[ 4] = km->WEPKeyMappingAddress[ 6]; ++ MACWork[ 5] = km->WEPKeyMappingAddress[ 7]; ++ MACWork[ 6] = km->WEPKeyMappingAddress[ 9]; ++ MACWork[ 7] = km->WEPKeyMappingAddress[10]; ++ MACWork[ 8] = km->WEPKeyMappingAddress[12]; ++ MACWork[ 9] = km->WEPKeyMappingAddress[13]; ++ MACWork[10] = km->WEPKeyMappingAddress[15]; ++ MACWork[11] = km->WEPKeyMappingAddress[16]; ++ MACWork[12] = '\0'; ++ *var_len = 6; ++ return ( UCHAR * ) htob ( MACWork ); ++ ++ case DOT11WEPKEYMAPPINGWEPON: ++// *write_method = write_dot11WEPKeyMappingWEPOn; ++ return ( UCHAR * ) &km->WEPKeyMappingWEPOn; ++ ++ case DOT11WEPKEYMAPPINGVALUE: ++// *write_method = write_dot11WEPKeyMappingValue; ++ *var_len = strlen ( km->WEPKeyMappingValue ); ++ return ( UCHAR * ) km->WEPKeyMappingValue; ++ ++ case DOT11WEPKEYMAPPINGSTATUS: ++// *write_method = write_dot11WEPKeyMappingStatus; ++ return ( UCHAR * ) &km->WEPKeyMappingStatus; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11PrivacyTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11PrivacyTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method ) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &prList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ pr = ( struct prTbl_data * ) np->data; ++ rName[vp->namelen] = pr->ifIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11PRIVACYINVOKED: ++ if ( pr->havePrivacyInvoked ) found = TRUE; break; ++ case DOT11WEPDEFAULTKEYID: ++ if ( pr->haveWEPDefaultKeyID ) found = TRUE; break; ++ case DOT11WEPKEYMAPPINGLENGTH: ++ if ( pr->haveWEPKeyMappingLength ) found = TRUE; break; ++ case DOT11EXCLUDEUNENCRYPTED: ++ if ( pr->haveExcludeUnencrypted ) found = TRUE; break; ++ case DOT11WEPICVERRORCOUNT: ++ if ( pr->haveWEPICVErrorCount ) found = TRUE; break; ++ case DOT11WEPEXCLUDEDCOUNT: ++ if ( pr->haveWEPExcludedCount ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); ++ *length = vp->namelen + 1; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11PRIVACYINVOKED: ++// *write_method = write_dot11PrivacyInvoked; ++ return ( UCHAR * ) &pr->privacyInvoked; ++ ++ case DOT11WEPDEFAULTKEYID: ++// *write_method = write_dot11WEPDefaultKeyID; ++ return ( UCHAR * ) &pr->WEPDefaultKeyID; ++ ++ case DOT11WEPKEYMAPPINGLENGTH: ++// *write_method = write_dot11WEPKeyMappingLength; ++ return ( UCHAR * ) &pr->WEPKeyMappingLength; ++ ++ case DOT11EXCLUDEUNENCRYPTED: ++// *write_method = write_dot11ExcludeUnencrypted; ++ return ( UCHAR * ) &pr->excludeUnencrypted; ++ ++ case DOT11WEPICVERRORCOUNT: ++ return ( UCHAR * ) &pr->WEPICVErrorCount; ++ ++ case DOT11WEPEXCLUDEDCOUNT: ++ return ( UCHAR * ) &pr->WEPExcludedCount; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11OperationTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11OperationTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method ) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ static char MACWork[17]; ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &opList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ op = ( struct opTbl_data * ) np->data; ++ rName[vp->namelen] = op->ifIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) { ++ ++ switch ( vp->magic ) { // found requested OID, now check for requested variable ++ case DOT11MACADDRESS: ++ if ( op->haveMACAddress ) found = TRUE; break; ++ case DOT11RTSTHRESHOLD: ++ if ( op->haveRTSThreshold ) found = TRUE; break; ++ case DOT11SHORTRETRYLIMIT: ++ if ( op->haveShortRetryLimit ) found = TRUE; break; ++ case DOT11LONGRETRYLIMIT: ++ if ( op->haveLongRetryLimit ) found = TRUE; break; ++ case DOT11FRAGMENTATIONTHRESHOLD: ++ if ( op->haveFragmentationThreshold ) found = TRUE; break; ++ case DOT11MAXTRANSMITMSDULIFETIME: ++ if ( op->haveMaxTransmitMSDULifetime ) found = TRUE; break; ++ case DOT11MAXRECEIVELIFETIME: ++ if ( op->haveMaxReceiveLifetime ) found = TRUE; break; ++ case DOT11MANUFACTURERID: ++ if ( op->haveManufacturerID ) found = TRUE; break; ++ case DOT11PRODUCTID: ++ if ( op->haveProductID ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); ++ *length = vp->namelen + 1; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11MACADDRESS: ++ MACWork[ 0] = op->MACAddress[ 0]; ++ MACWork[ 1] = op->MACAddress[ 1]; ++ MACWork[ 2] = op->MACAddress[ 3]; ++ MACWork[ 3] = op->MACAddress[ 4]; ++ MACWork[ 4] = op->MACAddress[ 6]; ++ MACWork[ 5] = op->MACAddress[ 7]; ++ MACWork[ 6] = op->MACAddress[ 9]; ++ MACWork[ 7] = op->MACAddress[10]; ++ MACWork[ 8] = op->MACAddress[12]; ++ MACWork[ 9] = op->MACAddress[13]; ++ MACWork[10] = op->MACAddress[15]; ++ MACWork[11] = op->MACAddress[16]; ++ MACWork[12] = '\0'; ++ *var_len = 6; ++ return ( UCHAR * ) htob ( MACWork ); ++ ++ case DOT11RTSTHRESHOLD: ++// *write_method = write_dot11RTSThreshold; ++ return ( UCHAR * ) &op->RTSThreshold; ++ ++ case DOT11SHORTRETRYLIMIT: ++// *write_method = write_dot11ShortRetryLimit; ++ return ( UCHAR * ) &op->shortRetryLimit; ++ ++ case DOT11LONGRETRYLIMIT: ++// *write_method = write_dot11LongRetryLimit; ++ return ( UCHAR * ) &op->longRetryLimit; ++ ++ case DOT11FRAGMENTATIONTHRESHOLD: ++// *write_method = write_dot11FragmentationThreshold; ++ return ( UCHAR * ) &op->fragmentationThreshold; ++ ++ case DOT11MAXTRANSMITMSDULIFETIME: ++// *write_method = write_dot11MaxTransmitMSDULifetime; ++ return ( UCHAR * ) &op->maxTransmitMSDULifetime; ++ ++ case DOT11MAXRECEIVELIFETIME: ++// *write_method = write_dot11MaxReceiveLifetime; ++ return ( UCHAR * ) &op->maxReceiveLifetime; ++ ++ case DOT11MANUFACTURERID: ++ *var_len = strlen ( op->manufacturerID ); ++ return ( UCHAR * ) op->manufacturerID; ++ ++ case DOT11PRODUCTID: ++ *var_len = strlen ( op->productID ); ++ return ( UCHAR * ) op->productID; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11CountersTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11CountersTable(struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &coList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ co = ( struct coTbl_data * ) np->data; ++ rName[vp->namelen] = co->ifIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11TRANSMITTEDFRAGMENTCOUNT: ++ if ( co->haveTransmittedFragmentCount ) found = TRUE; break; ++ case DOT11MULTICASTTRANSMITTEDFRAMECOUNT: ++ if ( co->haveTransmittedFrameCount ) found = TRUE; break; ++ case DOT11FAILEDCOUNT: ++ if ( co->haveFailedCount ) found = TRUE; break; ++ case DOT11RETRYCOUNT: ++ if ( co->haveRetryCount ) found = TRUE; break; ++ case DOT11MULTIPLERETRYCOUNT: ++ if ( co->haveMultipleRetryCount ) found = TRUE; break; ++ case DOT11FRAMEDUPLICATECOUNT: ++ if ( co->haveFrameDuplicateCount ) found = TRUE; break; ++ case DOT11RTSSUCCESSCOUNT: ++ if ( co->haveRTSSuccessCount ) found = TRUE; break; ++ case DOT11RTSFAILURECOUNT: ++ if ( co->haveRTSFailureCount ) found = TRUE; break; ++ case DOT11ACKFAILURECOUNT: ++ if ( co->haveACKFailureCount ) found = TRUE; break; ++ case DOT11RECEIVEDFRAGMENTCOUNT: ++ if ( co->haveReceivedFragmentCount ) found = TRUE; break; ++ case DOT11MULTICASTRECEIVEDFRAMECOUNT: ++ if ( co->haveMulticastReceivedFrameCount ) found = TRUE; break; ++ case DOT11FCSERRORCOUNT: ++ if ( co->haveFCSErrorCount ) found = TRUE; break; ++ case DOT11TRANSMITTEDFRAMECOUNT: ++ if ( co->haveTransmittedFrameCount ) found = TRUE; break; ++ case DOT11WEPUNDECRYPTABLECOUNT: ++ if ( co->haveWEPUndecryptableCount ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); ++ *length = vp->namelen + 1; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11TRANSMITTEDFRAGMENTCOUNT: return ( UCHAR * ) &co->transmittedFragmentCount; ++ case DOT11MULTICASTTRANSMITTEDFRAMECOUNT: return ( UCHAR * ) &co->transmittedFrameCount; ++ case DOT11FAILEDCOUNT: return ( UCHAR * ) &co->failedCount; ++ case DOT11RETRYCOUNT: return ( UCHAR * ) &co->retryCount; ++ case DOT11MULTIPLERETRYCOUNT: return ( UCHAR * ) &co->multipleRetryCount; ++ case DOT11FRAMEDUPLICATECOUNT: return ( UCHAR * ) &co->frameDuplicateCount; ++ case DOT11RTSSUCCESSCOUNT: return ( UCHAR * ) &co->RTSSuccessCount; ++ case DOT11RTSFAILURECOUNT: return ( UCHAR * ) &co->RTSFailureCount; ++ case DOT11ACKFAILURECOUNT: return ( UCHAR * ) &co->ACKFailureCount; ++ case DOT11RECEIVEDFRAGMENTCOUNT: return ( UCHAR * ) &co->receivedFragmentCount; ++ case DOT11MULTICASTRECEIVEDFRAMECOUNT: return ( UCHAR * ) &co->multicastReceivedFrameCount; ++ case DOT11FCSERRORCOUNT: return ( UCHAR * ) &co->FCSErrorCount; ++ case DOT11TRANSMITTEDFRAMECOUNT: return ( UCHAR * ) &co->transmittedFrameCount; ++ case DOT11WEPUNDECRYPTABLECOUNT: return ( UCHAR * ) &co->WEPUndecryptableCount; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11GroupAddressesTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11GroupAddressesTable(struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method) ++{ ++ static char MACWork[17]; ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &gaList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ ga = ( struct gaTbl_data * ) np->data; ++ rName[vp->namelen + 0] = ga->ifIndex; ++ rName[vp->namelen + 1] = ga->groupAddressesIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11ADDRESS: ++ if ( ga->haveAddress ) found = TRUE; break; ++ case DOT11GROUPADDRESSESSTATUS: ++ if ( ga->haveGroupAddressesStatus ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); ++ *length = vp->namelen + 2; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11ADDRESS: ++// *write_method = write_dot11Address; ++ MACWork[ 0] = ga->address[ 0]; ++ MACWork[ 1] = ga->address[ 1]; ++ MACWork[ 2] = ga->address[ 3]; ++ MACWork[ 3] = ga->address[ 4]; ++ MACWork[ 4] = ga->address[ 6]; ++ MACWork[ 5] = ga->address[ 7]; ++ MACWork[ 6] = ga->address[ 9]; ++ MACWork[ 7] = ga->address[10]; ++ MACWork[ 8] = ga->address[12]; ++ MACWork[ 9] = ga->address[13]; ++ MACWork[10] = ga->address[15]; ++ MACWork[11] = ga->address[16]; ++ MACWork[12] = '\0'; ++ *var_len = 6; ++ return ( UCHAR * ) htob ( MACWork ); ++ ++ case DOT11GROUPADDRESSESSTATUS: ++// *write_method = write_dot11GroupAddressesStatus; ++ return ( UCHAR * ) &ga->groupAddressesStatus; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11ResourceInfoTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11ResourceInfoTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method ) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &riList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ ri = ( struct riTbl_data * ) np->data; ++ rName[vp->namelen] = ri->ifIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11MANUFACTUREROUI: ++ if ( ri->haveManufacturerOUI ) found = TRUE; break; ++ case DOT11MANUFACTURERNAME: ++ if ( ri->haveManufacturerName ) found = TRUE; break; ++ case DOT11MANUFACTURERPRODUCTNAME: ++ if ( ri->haveManufacturerProductName ) found = TRUE; break; ++ case DOT11MANUFACTURERPRODUCTVERSION: ++ if ( ri->haveManufacturerProductVersion ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); ++ *length = vp->namelen + 1; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11MANUFACTUREROUI: ++ *var_len = strlen ( ri->manufacturerOUI ); ++ return ( UCHAR * ) ri->manufacturerOUI; ++ ++ case DOT11MANUFACTURERNAME: ++ *var_len = strlen ( ri->manufacturerName ); ++ return ( UCHAR * ) ri->manufacturerName; ++ ++ case DOT11MANUFACTURERPRODUCTNAME: ++ *var_len = strlen ( ri->manufacturerProductName ); ++ return ( UCHAR * ) ri->manufacturerProductName; ++ ++ case DOT11MANUFACTURERPRODUCTVERSION: ++ *var_len = strlen ( ri->manufacturerProductVersion ); ++ return ( UCHAR * ) ri->manufacturerProductVersion; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11PhyOperationTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11PhyOperationTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method ) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &poList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ po = ( struct poTbl_data * ) np->data; ++ rName[vp->namelen] = po->ifIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11PHYTYPE: ++ if ( po->havePHYType ) found = TRUE; break; ++ case DOT11CURRENTREGDOMAIN: ++ if ( po->haveCurrentRegDomain ) found = TRUE; break; ++ case DOT11TEMPTYPE: ++ if ( po->haveTempType ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); ++ *length = vp->namelen + 1; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11PHYTYPE: ++ return ( UCHAR * ) &po->PHYType; ++ ++ case DOT11CURRENTREGDOMAIN: ++// *write_method = write_dot11CurrentRegDomain; ++ return ( UCHAR * ) &po->currentRegDomain; ++ ++ case DOT11TEMPTYPE: ++ return ( UCHAR * ) &po->tempType; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11PhyAntennaTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11PhyAntennaTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method ) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &paList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ pa = ( struct paTbl_data * ) np->data; ++ rName[vp->namelen] = pa->ifIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11CURRENTTXANTENNA: ++ if ( pa->haveCurrentTxAntenna ) found = TRUE; break; ++ case DOT11DIVERSITYSUPPORT: ++ if ( pa->haveDiversitySupport ) found = TRUE; break; ++ case DOT11CURRENTRXANTENNA: ++ if ( pa->haveCurrentRxAntenna ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); ++ *length = vp->namelen + 1; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11CURRENTTXANTENNA: ++// *write_method = write_dot11CurrentTxAntenna; ++ return ( UCHAR * ) &pa->currentTxAntenna; ++ ++ case DOT11DIVERSITYSUPPORT: ++ return ( UCHAR * ) &pa->diversitySupport; ++ ++ case DOT11CURRENTRXANTENNA: ++// *write_method = write_dot11CurrentRxAntenna; ++ return ( UCHAR * ) &pa->currentRxAntenna; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11PhyTxPowerTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11PhyTxPowerTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method ) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &ptList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ pt = ( struct ptTbl_data * ) np->data; ++ rName[vp->namelen] = pt->ifIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11NUMBERSUPPORTEDPOWERLEVELS: ++ if ( pt->haveNumberSupportedPowerLevels ) found = TRUE; break; ++ case DOT11TXPOWERLEVEL1: ++ if ( pt->haveTxPowerLevel1 ) found = TRUE; break; ++ case DOT11TXPOWERLEVEL2: ++ if ( pt->haveTxPowerLevel2 ) found = TRUE; break; ++ case DOT11TXPOWERLEVEL3: ++ if ( pt->haveTxPowerLevel3 ) found = TRUE; break; ++ case DOT11TXPOWERLEVEL4: ++ if ( pt->haveTxPowerLevel4 ) found = TRUE; break; ++ case DOT11TXPOWERLEVEL5: ++ if ( pt->haveTxPowerLevel5 ) found = TRUE; break; ++ case DOT11TXPOWERLEVEL6: ++ if ( pt->haveTxPowerLevel6 ) found = TRUE; break; ++ case DOT11TXPOWERLEVEL7: ++ if ( pt->haveTxPowerLevel7 ) found = TRUE; break; ++ case DOT11TXPOWERLEVEL8: ++ if ( pt->haveTxPowerLevel8 ) found = TRUE; break; ++ case DOT11CURRENTTXPOWERLEVEL: ++ if ( pt->currentTxPowerLevel ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); ++ *length = vp->namelen + 1; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11NUMBERSUPPORTEDPOWERLEVELS: ++ return ( UCHAR * ) &pt->numberSupportedPowerLevels; ++ ++ case DOT11TXPOWERLEVEL1: return ( UCHAR * ) &pt->TxPowerLevel1; ++ case DOT11TXPOWERLEVEL2: return ( UCHAR * ) &pt->TxPowerLevel2; ++ case DOT11TXPOWERLEVEL3: return ( UCHAR * ) &pt->TxPowerLevel3; ++ case DOT11TXPOWERLEVEL4: return ( UCHAR * ) &pt->TxPowerLevel4; ++ case DOT11TXPOWERLEVEL5: return ( UCHAR * ) &pt->TxPowerLevel5; ++ case DOT11TXPOWERLEVEL6: return ( UCHAR * ) &pt->TxPowerLevel6; ++ case DOT11TXPOWERLEVEL7: return ( UCHAR * ) &pt->TxPowerLevel7; ++ case DOT11TXPOWERLEVEL8: return ( UCHAR * ) &pt->TxPowerLevel8; ++ ++ case DOT11CURRENTTXPOWERLEVEL: ++// *write_method = write_dot11CurrentTxPowerLevel; ++ return ( UCHAR * ) &pt->currentTxPowerLevel; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11PhyFHSSTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11PhyFHSSTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method ) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &pfList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ pf = ( struct pfTbl_data * ) np->data; ++ rName[vp->namelen] = pf->ifIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11HOPTIME: ++ if ( pf->haveHopTime ) found = TRUE; break; ++ case DOT11CURRENTCHANNELNUMBER: ++ if ( pf->haveCurrentChannelNumber ) found = TRUE; break; ++ case DOT11MAXDWELLTIME: ++ if ( pf->haveMaxDwellTime ) found = TRUE; break; ++ case DOT11CURRENTDWELLTIME: ++ if ( pf->haveCurrentDwellTime ) found = TRUE; break; ++ case DOT11CURRENTSET: ++ if ( pf->haveCurrentSet ) found = TRUE; break; ++ case DOT11CURRENTPATTERN: ++ if ( pf->haveCurrentPattern ) found = TRUE; break; ++ case DOT11CURRENTINDEX: ++ if ( pf->haveCurrentIndex ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); ++ *length = vp->namelen + 1; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11HOPTIME: ++ return ( UCHAR * ) &pf->hopTime; ++ ++ case DOT11CURRENTCHANNELNUMBER: ++// *write_method = write_dot11CurrentChannelNumber; ++ return ( UCHAR * ) &pf->currentChannelNumber; ++ ++ case DOT11MAXDWELLTIME: ++ return ( UCHAR * ) &pf->maxDwellTime; ++ ++ case DOT11CURRENTDWELLTIME: ++// *write_method = write_dot11CurrentDwellTime; ++ return ( UCHAR * ) &pf->currentDwellTime; ++ ++ case DOT11CURRENTSET: ++// *write_method = write_dot11CurrentSet; ++ return ( UCHAR * ) &pf->currentSet; ++ ++ case DOT11CURRENTPATTERN: ++// *write_method = write_dot11CurrentPattern; ++ return ( UCHAR * ) &pf->currentPattern; ++ ++ case DOT11CURRENTINDEX: ++// *write_method = write_dot11CurrentIndex; ++ return ( UCHAR * ) &pf->currentIndex; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11PhyDSSSTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11PhyDSSSTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method ) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &pdList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ pd = ( struct pdTbl_data * ) np->data; ++ rName[vp->namelen] = pd->ifIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11CURRENTCHANNEL: ++ if ( pd->haveCurrentChannel ) found = TRUE; break; ++ case DOT11CCAMODESUPPORTED: ++ if ( pd->haveCCAModeSupported ) found = TRUE; break; ++ case DOT11CURRENTCCAMODE: ++ if ( pd->haveCurrentCCAMode ) found = TRUE; break; ++ case DOT11EDTHRESHOLD: ++ if ( pd->haveEDThreshold ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); ++ *length = vp->namelen + 1; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11CURRENTCHANNEL: ++// *write_method = write_dot11CurrentChannel; ++ return ( UCHAR * ) &pd->currentChannel; ++ ++ case DOT11CCAMODESUPPORTED: ++ return ( UCHAR * ) &pd->CCAModeSupported; ++ ++ case DOT11CURRENTCCAMODE: ++// *write_method = write_dot11CurrentCCAMode; ++ return ( UCHAR * ) &pd->currentCCAMode; ++ ++ case DOT11EDTHRESHOLD: ++// *write_method = write_dot11EDThreshold; ++ return ( UCHAR * ) &pd->EDThreshold; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11PhyIRTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11PhyIRTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method) ++{ ++ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &piList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ pi = ( struct piTbl_data * ) np->data; ++ rName[vp->namelen] = pi->ifIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11CCAWATCHDOGTIMERMAX: ++ if ( pi->CCAWatchdogTimerMax ) found = TRUE; break; ++ case DOT11CCAWATCHDOGCOUNTMAX: ++ if ( pi->CCAWatchdogCountMax ) found = TRUE; break; ++ case DOT11CCAWATCHDOGTIMERMIN: ++ if ( pi->CCAWatchdogTimerMin ) found = TRUE; break; ++ case DOT11CCAWATCHDOGCOUNTMIN: ++ if ( pi->CCAWatchdogCountMin ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); ++ *length = vp->namelen + 1; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11CCAWATCHDOGTIMERMAX: ++// *write_method = write_dot11CCAWatchdogTimerMax; ++ return ( UCHAR * ) &pi->CCAWatchdogTimerMax; ++ ++ case DOT11CCAWATCHDOGCOUNTMAX: ++// *write_method = write_dot11CCAWatchdogCountMax; ++ return ( UCHAR * ) &pi->CCAWatchdogCountMax; ++ ++ case DOT11CCAWATCHDOGTIMERMIN: ++// *write_method = write_dot11CCAWatchdogTimerMin; ++ return ( UCHAR * ) &pi->CCAWatchdogTimerMin; ++ ++ case DOT11CCAWATCHDOGCOUNTMIN: ++// *write_method = write_dot11CCAWatchdogCountMin; ++ return ( UCHAR * ) &pi->CCAWatchdogCountMin; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11RegDomainsSupportedTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11RegDomainsSupportedTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &rdList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ rd = ( struct rdTbl_data * ) np->data; ++ rName[vp->namelen + 0] = rd->ifIndex; ++ rName[vp->namelen + 1] = rd->regDomainsSupportIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11REGDOMAINSSUPPORTVALUE: ++ if ( rd->haveRegDomainsSupportValue ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); ++ *length = vp->namelen + 2; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11REGDOMAINSSUPPORTVALUE: ++ return ( UCHAR * ) &rd->regDomainsSupportValue; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11AntennasListTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11AntennasListTable(struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &alList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ al = ( struct alTbl_data * ) np->data; ++ rName[vp->namelen + 0] = al->ifIndex; ++ rName[vp->namelen + 1] = al->antennaListIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11SUPPORTEDTXANTENNA: ++ if ( al->haveSupportedTxAntenna ) found = TRUE; break; ++ case DOT11SUPPORTEDRXANTENNA: ++ if ( al->haveSupportedRxAntenna ) found = TRUE; break; ++ case DOT11DIVERSITYSELECTIONRX: ++ if ( al->haveDiversitySelectionRx ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); ++ *length = vp->namelen + 2; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11SUPPORTEDTXANTENNA: ++// *write_method = write_dot11SupportedTxAntenna; ++ return ( UCHAR * ) &al->supportedTxAntenna; ++ ++ case DOT11SUPPORTEDRXANTENNA: ++// *write_method = write_dot11SupportedRxAntenna; ++ return ( UCHAR * ) &al->supportedRxAntenna; ++ ++ case DOT11DIVERSITYSELECTIONRX: ++// *write_method = write_dot11DiversitySelectionRx; ++ return ( UCHAR * ) &al->diversitySelectionRx; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11SupportedDataRatesTxTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11SupportedDataRatesTxTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method ) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &rtList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ rt = ( struct rtTbl_data * ) np->data; ++ rName[vp->namelen + 0] = rt->ifIndex; ++ rName[vp->namelen + 1] = rt->supportedDataRatesTxIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11SUPPORTEDDATARATESTXVALUE: ++ if ( rt->haveSupportedDataRatesTxValue ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); ++ *length = vp->namelen + 2; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11SUPPORTEDDATARATESTXVALUE: ++ return ( UCHAR * ) &rt->supportedDataRatesTxValue; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++* var_dot11SupportedDataRatesRxTable() - * ++* * ++****************************************************************************/ ++unsigned char * ++var_dot11SupportedDataRatesRxTable ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, ++ WriteMethod **write_method ) ++{ ++ int found = FALSE; ++ oid rName [ MAX_OID_LEN ]; // OID to be returned ++ ++ loadTables(); ++ memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid )); ++ for ( np = LIST_FIRST ( &rrList ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ rr = ( struct rrTbl_data * ) np->data; ++ rName[vp->namelen + 0] = rr->ifIndex; ++ rName[vp->namelen + 1] = rr->supportedDataRatesRxIndex; ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) || ++ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) { ++ switch ( vp->magic ) { ++ case DOT11SUPPORTEDDATARATESRXVALUE: ++ if ( rr->haveSupportedDataRatesRxValue ) found = TRUE; break; ++ } ++ } ++ if ( found ) ++ break; ++ } ++ ++ if ( !found ) ++ return NULL; ++ ++ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); ++ *length = vp->namelen + 2; ++ *var_len = sizeof ( long ); ++ *write_method = NULL; ++ ++ switch ( vp->magic ) { ++ ++ case DOT11SUPPORTEDDATARATESRXVALUE: ++ return ( UCHAR * ) &rr->supportedDataRatesRxValue; ++ ++ default: ++ ERROR_MSG ( "" ); ++ } ++ ++ return NULL; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11StationID(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static unsigned char string[SPRINT_MAX_LEN]; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_OCTET_STR ) { ++ fprintf ( stderr, "write to dot11StationID not ASN_OCTET_STR\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( string )) { ++ fprintf ( stderr,"write to dot11StationID: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11MediumOccupancyLimit(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11MediumOccupancyLimit not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr,"write to dot11MediumOccupancyLimit: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CFPPeriod(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CFPPeriod not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11CFPPeriod: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CFPMaxDuration(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CFPMaxDuration not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11CFPMaxDuration: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11AuthenticationResponseTimeOut(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11AuthenticationResponseTimeOut not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11AuthenticationResponseTimeOut: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11PowerManagementMode(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11PowerManagementMode not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )) { ++ fprintf ( stderr, "write to dot11PowerManagementMode: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11DesiredSSID(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static unsigned char string[SPRINT_MAX_LEN]; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_OCTET_STR ) { ++ fprintf ( stderr, "write to dot11DesiredSSID not ASN_OCTET_STR\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( string )){ ++ fprintf ( stderr, "write to dot11DesiredSSID: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11DesiredBSSType(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11DesiredBSSType not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11DesiredBSSType: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11OperationalRateSet(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static unsigned char string[SPRINT_MAX_LEN]; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_OCTET_STR ) { ++ fprintf ( stderr, "write to dot11OperationalRateSet not ASN_OCTET_STR\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( string )){ ++ fprintf ( stderr, "write to dot11OperationalRateSet: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11BeaconPeriod(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11BeaconPeriod not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr,"write to dot11BeaconPeriod: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11DTIMPeriod(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11DTIMPeriod not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr,"write to dot11DTIMPeriod: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11AssociationResponseTimeOut(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11AssociationResponseTimeOut not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )) { ++ fprintf ( stderr,"write to dot11AssociationResponseTimeOut: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11AuthenticationAlgorithmsEnable(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11AuthenticationAlgorithmsEnable not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr,"write to dot11AuthenticationAlgorithmsEnable: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11WEPDefaultKeyValue(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static unsigned char string[SPRINT_MAX_LEN]; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_OCTET_STR ) { ++ fprintf ( stderr, "write to dot11WEPDefaultKeyValue not ASN_OCTET_STR\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( string )){ ++ fprintf ( stderr,"write to dot11WEPDefaultKeyValue: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11WEPKeyMappingAddress(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static unsigned char string[SPRINT_MAX_LEN]; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_OCTET_STR ) { ++ fprintf ( stderr, "write to dot11WEPKeyMappingAddress not ASN_OCTET_STR\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( string )) { ++ fprintf ( stderr,"write to dot11WEPKeyMappingAddress: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11WEPKeyMappingWEPOn(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11WEPKeyMappingWEPOn not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11WEPKeyMappingWEPOn: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11WEPKeyMappingValue(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static unsigned char string[SPRINT_MAX_LEN]; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_OCTET_STR ) { ++ fprintf ( stderr, "write to dot11WEPKeyMappingValue not ASN_OCTET_STR\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( string )) { ++ fprintf ( stderr, "write to dot11WEPKeyMappingValue: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11WEPKeyMappingStatus(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11WEPKeyMappingStatus not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11WEPKeyMappingStatus: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11PrivacyInvoked(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11PrivacyInvoked not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11PrivacyInvoked: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11WEPDefaultKeyID(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11WEPDefaultKeyID not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11WEPDefaultKeyID: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11WEPKeyMappingLength(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11WEPKeyMappingLength not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11WEPKeyMappingLength: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11ExcludeUnencrypted(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11ExcludeUnencrypted not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr,"write to dot11ExcludeUnencrypted: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11RTSThreshold(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ){ ++ fprintf ( stderr, "write to dot11RTSThreshold not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11RTSThreshold: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11ShortRetryLimit(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11ShortRetryLimit not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11ShortRetryLimit: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11LongRetryLimit(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11LongRetryLimit not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr,"write to dot11LongRetryLimit: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11FragmentationThreshold(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11FragmentationThreshold not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr,"write to dot11FragmentationThreshold: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11MaxTransmitMSDULifetime(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11MaxTransmitMSDULifetime not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11MaxTransmitMSDULifetime: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11MaxReceiveLifetime(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11MaxReceiveLifetime not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11MaxReceiveLifetime: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11Address(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static unsigned char string[SPRINT_MAX_LEN]; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_OCTET_STR ) { ++ fprintf ( stderr, "write to dot11Address not ASN_OCTET_STR\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( string )){ ++ fprintf ( stderr, "write to dot11Address: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11GroupAddressesStatus(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11GroupAddressesStatus not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr,"write to dot11GroupAddressesStatus: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CurrentRegDomain(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CurrentRegDomain not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11CurrentRegDomain: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CurrentTxAntenna(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CurrentTxAntenna not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11CurrentTxAntenna: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CurrentRxAntenna(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CurrentRxAntenna not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr,"write to dot11CurrentRxAntenna: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CurrentTxPowerLevel(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CurrentTxPowerLevel not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11CurrentTxPowerLevel: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CurrentChannelNumber(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CurrentChannelNumber not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr,"write to dot11CurrentChannelNumber: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CurrentDwellTime(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CurrentDwellTime not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11CurrentDwellTime: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CurrentSet(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CurrentSet not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11CurrentSet: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CurrentPattern(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CurrentPattern not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11CurrentPattern: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CurrentIndex(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CurrentIndex not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11CurrentIndex: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CurrentChannel(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CurrentChannel not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11CurrentChannel: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CurrentCCAMode(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CurrentCCAMode not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr,"write to dot11CurrentCCAMode: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11EDThreshold(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11EDThreshold not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11EDThreshold: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CCAWatchdogTimerMax(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CCAWatchdogTimerMax not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11CCAWatchdogTimerMax: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CCAWatchdogCountMax(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CCAWatchdogCountMax not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11CCAWatchdogCountMax: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CCAWatchdogTimerMin(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CCAWatchdogTimerMin not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11CCAWatchdogTimerMin: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11CCAWatchdogCountMin(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11CCAWatchdogCountMin not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11CCAWatchdogCountMin: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11SupportedTxAntenna(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11SupportedTxAntenna not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11SupportedTxAntenna: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11SupportedRxAntenna(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11SupportedRxAntenna not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr,"write to dot11SupportedRxAntenna: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++int ++write_dot11DiversitySelectionRx(int action, ++ u_char *var_val, ++ u_char var_val_type, ++ size_t var_val_len, ++ u_char *statP, ++ oid *name, ++ size_t name_len) ++{ ++ static long *long_ret; ++ int size; ++ ++ switch ( action ) { ++ ++ case RESERVE1: ++ if ( var_val_type != ASN_INTEGER ) { ++ fprintf ( stderr, "write to dot11DiversitySelectionRx not ASN_INTEGER\n" ); ++ return SNMP_ERR_WRONGTYPE; ++ } ++ if ( var_val_len > sizeof ( long_ret )){ ++ fprintf ( stderr, "write to dot11DiversitySelectionRx: bad length\n" ); ++ return SNMP_ERR_WRONGLENGTH; ++ } ++ break; ++ ++ case RESERVE2: ++ case FREE: ++ case ACTION: ++ case UNDO: ++ break; ++ ++ case COMMIT: ++ break; ++ } ++ ++ return SNMP_ERR_NOERROR; ++} ++ ++/**************************************************************************** ++* * ++* loadTables() - Load the Tables * ++* * ++****************************************************************************/ ++static void loadTables() ++{ ++ int skfd; // generic raw socket desc ++ struct iwreq wrq; // ioctl request structure ++ struct ifreq ifr; ++ struct timeval et; // elapsed time ++ struct wireless_info info; // workarea for wireless ioctl information ++ FILE *fp; ++ char bfr[1024], ifName[1024]; ++ char *s, *t; ++ ++ gettimeofday ( &et, ( struct timezone * ) 0 ); // get time-of-day ++ if ( et.tv_sec < lastLoad + MINLOADFREQ ) // only reload so often ++ return; ++ lastLoad = et.tv_sec; ++ ++ skfd = openSocket(); // open socket ++ if ( skfd < 0 ) { ++ syslog ( LOG_ERR, "SNMP ieee802dot11.loadTables() - %s\n", "socket open failure" ); ++ return; ++ } ++ ++ flushLists(); ++ ++ // find interfaces in /proc/net/dev and find the wireless interfaces ++ fp = fopen ( PROC_NET_DEV, "r" ); ++ if ( fp ) { ++ while ( fgets ( bfr, sizeof ( bfr ), fp )) { ++ if ( strstr ( bfr, ":" )) { ++ s = bfr; t = ifName; ++ while ( isspace ( *s )) // discard white space ++ *s++; ++ while ( *s != ':' ) // get interface name ++ *t++ = *s++; ++ *t = '\0'; ++ ++ // verify as a wireless device ++ memset (( char * ) &info, 0, sizeof ( struct wireless_info )); ++ strncpy ( wrq.ifr_name, ifName, IFNAMSIZ ); ++ if ( ioctl ( skfd, SIOCGIWNAME, &wrq ) >= 0 ) { ++ printf ( "%s ifName: %s\n", "loadTables() -", ifName ); ++ initStructs(); ++ loadWiExt( skfd, ifName, &info ); ++ displayWiExt ( info ); ++ load80211Structs ( skfd, ifName, &info ); ++ } ++ } ++ } ++ fclose ( fp ); ++ } ++ ++ close ( skfd ); ++} ++ ++/**************************************************************************** ++* * ++* load80211Structs() - load the 802.11 structures * ++* * ++****************************************************************************/ ++static void ++load80211Structs ( int skfd, char *ifName, struct wireless_info *wi ) ++{ ++ int rc, ifIndex = 0; ++ struct ifreq ifr; ++ char MACAddress [ MACADDR_LEN + 1 ]; ++ ++ strcpy ( ifr.ifr_name, ifName ); ++ rc = ioctl ( skfd, SIOCGIFHWADDR, &ifr ); ++ if ( rc >= 0 ) { ++ ++ sprintf ( MACAddress, "%02X:%02X:%02X:%02X:%02X:%02X\0", ++ ( UCHAR ) ifr.ifr_hwaddr.sa_data[0], ( UCHAR ) ifr.ifr_hwaddr.sa_data[1], ++ ( UCHAR ) ifr.ifr_hwaddr.sa_data[2], ( UCHAR ) ifr.ifr_hwaddr.sa_data[3], ++ ( UCHAR ) ifr.ifr_hwaddr.sa_data[4], ( UCHAR ) ifr.ifr_hwaddr.sa_data[5] ); ++ ++ nSc.haveStationID = TRUE; ++ strcpy ( nSc.stationID, MACAddress ); ++ nOp.haveMACAddress = TRUE; ++ strcpy ( nOp.MACAddress, MACAddress ); ++ nRi.haveManufacturerOUI = TRUE; ++ strncpy ( nRi.manufacturerOUI, MACAddress, MAN_OUI_LEN ); ++ ++ ifIndex = if_nametoindex ( ifName ); ++ if ( !ifIndex ) { ++ syslog ( LOG_ERR, "SNMP %s - %s %s\n", ++ "ieee802dot11.load80211Structs()", ifName, "has no ifIndex" ); ++ return; ++ } ++ ++ loadWiExtTo80211Structs ( ifIndex, ifName, wi ); ++ ++ if ( hasChanged (( char * ) &nSc, sizeof ( nSc ))) { ++ nSc.ifIndex = ifIndex; ++ sprintf ( nSc.UID, "%04d\0", nSc.ifIndex ); ++ strcpy ( nSc.ifName, ifName ); ++ addList (( char * ) &scList, ( char * ) &nSc, sizeof ( nSc )); ++ } ++ ++ if ( hasChanged (( char * ) &nPr, sizeof ( nPr ))) { ++ nPr.ifIndex = ifIndex; ++ sprintf ( nPr.UID, "%04d\0", nPr.ifIndex ); ++ strcpy ( nPr.ifName, ifName ); ++ addList (( char * ) &prList, ( char * ) &nPr, sizeof ( nPr )); ++ } ++ ++ if ( hasChanged (( char * ) &nOp, sizeof ( nOp ))) { ++ nOp.ifIndex = ifIndex; ++ sprintf ( nOp.UID, "%04d\0", nOp.ifIndex ); ++ strcpy ( nOp.ifName, ifName ); ++ addList (( char * ) &opList, ( char * ) &nOp, sizeof ( nOp )); ++ } ++ ++ if ( hasChanged (( char * ) &nCo, sizeof ( nCo ))) { ++ nCo.ifIndex = ifIndex; ++ sprintf ( nCo.UID, "%04d\0", nCo.ifIndex ); ++ strcpy ( nCo.ifName, ifName ); ++ addList (( char * ) &coList, ( char * ) &nCo, sizeof ( nCo )); ++ } ++ ++ if ( hasChanged (( char * ) &nRi, sizeof ( nRi ))) { ++ nRi.ifIndex = ifIndex; ++ sprintf ( nRi.UID, "%04d\0", nRi.ifIndex ); ++ strcpy ( nRi.ifName, ifName ); ++ addList (( char * ) &riList, ( char * ) &nRi, sizeof ( nRi )); ++ } ++ ++ if ( hasChanged (( char * ) &nPo, sizeof ( nPo ))) { ++ nPo.ifIndex = ifIndex; ++ sprintf ( nPo.UID, "%04d\0", nPo.ifIndex ); ++ strcpy ( nPo.ifName, ifName ); ++ addList (( char * ) &poList, ( char * ) &nPo, sizeof ( nPo )); ++ } ++ ++ if ( hasChanged (( char * ) &nPa, sizeof ( nPa ))) { ++ nPa.ifIndex = ifIndex; ++ sprintf ( nPa.UID, "%04d\0", nPa.ifIndex ); ++ strcpy ( nPa.ifName, ifName ); ++ addList (( char * ) &paList, ( char * ) &nPa, sizeof ( nPa )); ++ } ++ ++ if ( hasChanged (( char * ) &nPt, sizeof ( nPt ))) { ++ nPt.ifIndex = ifIndex; ++ sprintf ( nPt.UID, "%04d\0", nPt.ifIndex ); ++ strcpy ( nPt.ifName, ifName ); ++ addList (( char * ) &ptList, ( char * ) &nPt, sizeof ( nPt )); ++ } ++ ++ if ( hasChanged (( char * ) &nPf, sizeof ( nPf ))) { ++ nPf.ifIndex = ifIndex; ++ sprintf ( nPf.UID, "%04d\0", nPf.ifIndex ); ++ strcpy ( nPf.ifName, ifName ); ++ addList (( char * ) &pfList, ( char * ) &nPf, sizeof ( nPf )); ++ } ++ ++ if ( hasChanged (( char * ) &nPd, sizeof ( nPd ))) { ++ nPd.ifIndex = ifIndex; ++ sprintf ( nPd.UID, "%04d\0", nPd.ifIndex ); ++ strcpy ( nPd.ifName, ifName ); ++ addList (( char * ) &pdList, ( char * ) &nPd, sizeof ( nPd )); ++ } ++ ++ if ( hasChanged (( char * ) &nPi, sizeof ( nPi ))) { ++ nPi.ifIndex = ifIndex; ++ sprintf ( nPi.UID, "%04d\0", nPi.ifIndex ); ++ strcpy ( nPi.ifName, ifName ); ++ addList (( char * ) &piList, ( char * ) &nPi, sizeof ( nPi )); ++ } ++ } ++ ++//printf ( "%s - ifIndex: %d ifName: %s UID: %s\n", ++// "load80211Structs() - HASCHANGED", ifIndex, ifName, nSc.UID ); ++} ++ ++/**************************************************************************** ++* * ++* initStructs() - initialize structures * ++* * ++****************************************************************************/ ++static void initStructs() ++{ ++ int i; ++ ++ // 802.11 MIB Stuctures ++ memset (( char * ) &nSc, 0, sizeof ( nSc )); memset (( char * ) &nAa, 0, sizeof ( nAa )); ++ memset (( char * ) &nDf, 0, sizeof ( nDf )); memset (( char * ) &nKm, 0, sizeof ( nKm )); ++ memset (( char * ) &nPr, 0, sizeof ( nPr )); memset (( char * ) &nOp, 0, sizeof ( nOp )); ++ memset (( char * ) &nCo, 0, sizeof ( nCo )); memset (( char * ) &nGa, 0, sizeof ( nGa )); ++ memset (( char * ) &nRi, 0, sizeof ( nRi )); memset (( char * ) &nPo, 0, sizeof ( nPo )); ++ memset (( char * ) &nPa, 0, sizeof ( nPa )); memset (( char * ) &nPt, 0, sizeof ( nPt )); ++ memset (( char * ) &nPf, 0, sizeof ( nPf )); memset (( char * ) &nPd, 0, sizeof ( nPd )); ++ memset (( char * ) &nPi, 0, sizeof ( nPi )); memset (( char * ) &nRd, 0, sizeof ( nRd )); ++ memset (( char * ) &nAl, 0, sizeof ( nAl )); memset (( char * ) &nRt, 0, sizeof ( nRt )); ++ memset (( char * ) &nRr, 0, sizeof ( nRr )); ++ ++ // Wireless Extensions ++ wepCurrentKey = 0; ++ haveWepCurrentKey = FALSE; ++ for ( i = 0; i < MAX_WEP_KEYS; i++ ) { ++ wep[i].len = 0; ++ wep[i].key[0] = '\0'; ++ wep[i].haveKey = FALSE; ++ } ++} ++ ++/**************************************************************************** ++* * ++* Wireless Extensions Specific Functions * ++* * ++****************************************************************************/ ++/**************************************************************************** ++* * ++* loadWiExtTo80211Structs() - load wireless extensions to 802.11 structures * ++* * ++****************************************************************************/ ++static void ++loadWiExtTo80211Structs ( int ifIndex, char *ifName, struct wireless_info *wi ) ++{ ++ int i, j = 0; ++ ++ // dot11Smt Group ++ // dot11StationConfigTable ++ nSc.havePrivacyOptionImplemented = TRUE; ++ nSc.privacyOptionImplemented = 1; // assume we support WEP ++ ++ if ( wi->has_power ) { ++ nSc.havePowerManagementMode = TRUE; ++ nSc.powerManagementMode = 1; // assume power is active ++ if ( !wi->power.disabled && ++ wi->power.flags & IW_POWER_MIN ) ++ nSc.powerManagementMode = 2; // power save mode ++ } ++ ++ if ( wi->has_essid && strlen ( wi->essid )) { ++ nSc.haveDesiredSSID = TRUE; ++ strcpy ( nSc.desiredSSID, wi->essid ); ++ } ++ ++ if ( wi->has_mode ) { ++ nSc.haveDesiredBSSType = TRUE; ++ if ( wi->mode == IW_MODE_ADHOC ) ++ nSc.desiredBSSType = 2; // independent ++ else if ( wi->has_ap_addr ) ++ nSc.desiredBSSType = 1; // infrastructure ++ else ++ nSc.desiredBSSType = 3; // any ++ } ++ ++ if ( wi->has_range ) { ++ for ( i = 0; i < wi->range.num_bitrates && j < 126; i++ ) { ++ nSc.haveOperationalRateSet = TRUE; ++ nSc.operationalRateSet[j++] = ( char ) ( wi->range.bitrate[i] / 500000L ); ++ } ++ } ++ ++ // dot11AuthenticationAlgorithmsTable ++ nAa.haveAuthenticationAlgorithm = TRUE; // it's a rule to always have ++ nAa.haveAuthenticationAlgorithmsEnable = TRUE; // 'open' supported ++ nAa.ifIndex = ifIndex; ++ nAa.authenticationAlgorithmsIndex = 1; // index number one ++ nAa.authenticationAlgorithm = 1; // 1 => open key ++ sprintf ( nAa.UID, "%04d%04d\0", nAa.ifIndex, nAa.authenticationAlgorithmsIndex ); ++ nAa.authenticationAlgorithmsEnable = 1; // enabled by default ++ if ( ( wi->has_key ) && ++ ( wi->key_size != 0 ) && ++ !( wi->key_flags & IW_ENCODE_DISABLED )) ++ nAa.authenticationAlgorithmsEnable = 2; ++ addList (( char * ) &aaList, ( char * ) &nAa, sizeof ( nAa )); ++ ++ nAa.haveAuthenticationAlgorithm = TRUE; // I'm gonna assume we always support WEP ++ nAa.haveAuthenticationAlgorithmsEnable = TRUE; ++ nAa.ifIndex = ifIndex; ++ nAa.authenticationAlgorithmsIndex = 2; // index number 2 ++ nAa.authenticationAlgorithm = 2; // 2 => shared key ++ sprintf ( nAa.UID, "%04d%04d\0", nAa.ifIndex, nAa.authenticationAlgorithmsIndex ); ++ nAa.authenticationAlgorithmsEnable = 2; ++ if ( ( wi->has_key ) && ++ ( wi->key_size != 0 ) && ++ !( wi->key_flags & IW_ENCODE_DISABLED )) ++ nAa.authenticationAlgorithmsEnable = 1; // disabled by default ++ addList (( char * ) &aaList, ( char * ) &nAa, sizeof ( nAa )); ++ ++ //dot11WEPDefaultKeysTable ++ if ( wi->has_range ) { ++ for ( i = 0; i < MAX_WEP_KEYS; i++ ) { ++ nDf.haveWEPDefaultKeyValue = TRUE; ++ nDf.ifIndex = ifIndex; ++ nDf.WEPDefaultKeyIndex = i + 1; // index number ++ sprintf ( nDf.UID, "%04d%04d\0", nDf.ifIndex, nDf.WEPDefaultKeyIndex ); ++ if ( wep[i].haveKey ) ++ strcpy ( nDf.WEPDefaultKeyValue, "*****" ); ++ else ++ nDf.WEPDefaultKeyValue[0] = '\0'; ++ addList (( char * ) &dfList, ( char * ) &nDf, sizeof ( nDf )); ++ } ++ } ++ ++ // dot11PrivacyTable ++ nPr.havePrivacyInvoked = TRUE; ++ nPr.privacyInvoked = 2; // 2 => FALSE ++ nPr.haveWEPDefaultKeyID = TRUE; ++ nPr.WEPDefaultKeyID = 0; ++ nPr.haveExcludeUnencrypted = TRUE; ++ nPr.excludeUnencrypted = 2; // 2 => FALSE ++ if ( wi->has_range ) { ++ if ( ( wi->key_size != 0 ) && ++ !( wi->key_flags & IW_ENCODE_DISABLED )) { ++ nPr.privacyInvoked = 1; ++ if ( wi->key_flags & IW_ENCODE_RESTRICTED ) ++ nPr.excludeUnencrypted = 1; ++ nPr.WEPDefaultKeyID = wepCurrentKey; ++ } ++ } ++ ++ // dot11Mac Group ++ // dot11OperationTable ++ if ( wi->has_range ) { ++ nOp.haveRTSThreshold = TRUE; ++ nOp.RTSThreshold = wi->range.max_rts; ++ } ++ ++ if ( wi->has_frag && wi->frag.value ) { ++ nOp.haveFragmentationThreshold = TRUE; ++ nOp.fragmentationThreshold = wi->frag.value; ++ } ++ ++ // dot11Phy Group ++ // dot11PhyOperationTable ++ if ( strstr ( wi->name, "IEEE 802.11-FS" )) nPo.PHYType = 1; // So what if I ++ if ( strstr ( wi->name, "IEEE 802.11-DS" )) nPo.PHYType = 2; // made up a couple? ++ if ( strstr ( wi->name, "IEEE 802.11-IR" )) nPo.PHYType = 3; ++ if ( strstr ( wi->name, "IEEE 802.11-OFDM" )) nPo.PHYType = 4; // 802.11a ++ if ( strstr ( wi->name, "IEEE 802.11-OFDM/DS" )) nPo.PHYType = 5; // 802.11g ++ if ( strstr ( wi->name, "IEEE 802.11-TURBO" )) nPo.PHYType = 6; // Atheros TURBO mode ++ if ( nPo.PHYType ) nPo.havePHYType = TRUE; ++ ++ // dot11PhyDSSSTable ++ if ( wi->has_range ) { // && wi->freq <= ( double ) 2483000000 ) { // DSSS frequencies only ++ for ( i = 0; i < wi->range.num_frequency; i++ ) { ++ if ((( double ) ( wi->range.freq[i].e * 10 ) * ( double ) wi->range.freq[i].m ) == wi->freq ) { ++ nPd.haveCurrentChannel = TRUE; ++ nPd.currentChannel = wi->range.freq[i].i; ++ } ++ } ++ } ++ ++ // dot11SupportedDataRatesTxTable ++ if ( wi->has_range ) { ++ for ( i = 0; i < wi->range.num_bitrates; i++ ) { ++ nRt.ifIndex = ifIndex; ++ nRt.supportedDataRatesTxIndex = i + 1; ++ nRt.supportedDataRatesTxValue = wi->range.bitrate[i] / 500000L; ++ nRt.haveSupportedDataRatesTxValue = TRUE; ++ sprintf ( nRt.UID, "%04d%04d\0", nRt.ifIndex, nRt.supportedDataRatesTxIndex ); ++ strcpy ( nRt.ifName, ifName ); ++ addList (( char * ) &rtList, ( char * ) &nRt, sizeof ( nRt )); ++ } ++ } ++ ++ // dot11SupportedDataRatesRxTable ++ if ( wi->has_range ) { ++ for ( i = 0; i < wi->range.num_bitrates; i++ ) { ++ nRr.ifIndex = ifIndex; ++ nRr.supportedDataRatesRxIndex = i + 1; ++ nRr.supportedDataRatesRxValue = wi->range.bitrate[i] / 500000L; ++ nRr.haveSupportedDataRatesRxValue = TRUE; ++ sprintf ( nRr.UID, "%04d%04d\0", nRr.ifIndex, nRr.supportedDataRatesRxIndex ); ++ strcpy ( nRr.ifName, ifName ); ++ addList (( char * ) &rrList, ( char * ) &nRr, sizeof ( nRr )); ++ } ++ } ++ ++//printf ( "%s max_encoding_tokens: %d\n", ++// "loadWiExtTo80211Structs() - ", wi->range.max_encoding_tokens ); ++} ++ ++/**************************************************************************** ++* * ++* loadWiExt() - load wireless extensions structures; * ++* use ioctl calls and read /proc/net/wireless * ++* * ++****************************************************************************/ ++static void loadWiExt ( int skfd, char *ifname, struct wireless_info *wi ) ++{ ++ struct iwreq wrq; // ioctl request structure ++ FILE *fp; ++ char bfr[1024]; ++ char buffer[sizeof ( iwrange ) * 2]; /* Large enough */ ++ char *s, *t; ++ int i, j; ++ ++ strncpy ( wrq.ifr_name, ifname, IFNAMSIZ ); ++ ++ /* Get wireless name */ ++ if ( ioctl ( skfd, SIOCGIWNAME, &wrq ) >= 0 ) { ++ strncpy ( wi->name, wrq.u.name, IFNAMSIZ ); ++ wi->name[IFNAMSIZ] = '\0'; ++ } ++ ++ /* Get ranges */ // NOTE: some version checking in iwlib.c ++ memset ( buffer, 0, sizeof ( buffer )); ++ wrq.u.data.pointer = ( caddr_t ) &buffer; ++ wrq.u.data.length = sizeof ( buffer ); ++ wrq.u.data.flags = 0; ++ if ( ioctl ( skfd, SIOCGIWRANGE, &wrq ) >= 0 ) { ++ memcpy (( char * ) &wi->range, buffer, sizeof ( iwrange )); ++ wi->has_range = 1; ++ } ++ ++ /* Get network ID */ ++ if ( ioctl ( skfd, SIOCGIWNWID, &wrq ) >= 0 ) { ++ memcpy ( &wi->nwid, &wrq.u.nwid, sizeof ( iwparam )); ++ wi->has_nwid = 1; ++ } ++ ++ /* Get frequency / channel */ // THIS NUMBER LOOKS FUNNY ++ if ( ioctl ( skfd, SIOCGIWFREQ, &wrq ) >= 0 ) { ++ wi->has_freq = 1; ++ wi->freq = (( double ) wrq.u.freq.m ) * pow ( 10, wrq.u.freq.e ); ++ } ++ ++ /* Get sensitivity */ ++ if ( ioctl ( skfd, SIOCGIWSENS, &wrq ) >= 0 ) { ++ wi->has_sens = 1; ++ memcpy ( &wi->sens, &wrq.u.sens, sizeof ( iwparam )); ++ } ++ ++ /* Get encryption information */ ++ wrq.u.data.pointer = ( caddr_t ) &wi->key; ++ wrq.u.data.length = IW_ENCODING_TOKEN_MAX; ++ wrq.u.data.flags = 0; ++ if ( ioctl ( skfd, SIOCGIWENCODE, &wrq ) >= 0 ) { ++ wi->has_key = 1; ++ wi->key_size = wrq.u.data.length; ++ wi->key_flags = wrq.u.data.flags; ++ wepCurrentKey = wrq.u.data.flags & IW_ENCODE_INDEX; ++ } ++ ++ for ( i = 0; i < wi->range.max_encoding_tokens; i++ ) { ++ wrq.u.data.pointer = ( caddr_t ) &wi->key; ++ wrq.u.data.length = IW_ENCODING_TOKEN_MAX; ++ wrq.u.data.flags = i; ++ if ( ioctl ( skfd, SIOCGIWENCODE, &wrq ) >= 0 ) { ++ if ( ( wrq.u.data.length != 0 ) && ++ !( wrq.u.data.flags & IW_ENCODE_DISABLED )) { ++ wep[i].len = wrq.u.data.length; ++ wep[i].haveKey = TRUE; ++ t = wep[i].key; ++ for ( j = 0; j < wrq.u.data.length; j++ ) { ++ if (( j & 0x1 ) == 0 && j != 0 ) ++ strcpy ( t++, "-"); ++ sprintf ( t, "%.2X", wi->key[j] ); ++ t += 2; ++ } ++ t = '\0'; ++ } ++ } ++ } ++ ++ /* Get ESSID */ ++ wrq.u.essid.pointer = ( caddr_t ) &wi->essid; ++ wrq.u.essid.length = IW_ESSID_MAX_SIZE + 1; ++ wrq.u.essid.flags = 0; ++ if ( ioctl ( skfd, SIOCGIWESSID, &wrq ) >= 0 ) { ++ wi->has_essid = 1; ++ wi->essid_on = wrq.u.data.flags; ++ } ++ ++ /* Get AP address */ ++ if ( ioctl ( skfd, SIOCGIWAP, &wrq ) >= 0 ) { ++ wi->has_ap_addr = 1; ++ memcpy ( &wi->ap_addr, &wrq.u.ap_addr, sizeof ( sockaddr )); ++ } ++ ++ /* Get NickName */ ++ wrq.u.essid.pointer = ( caddr_t ) &wi->nickname; ++ wrq.u.essid.length = IW_ESSID_MAX_SIZE + 1; ++ wrq.u.essid.flags = 0; ++ if ( ioctl ( skfd, SIOCGIWNICKN, &wrq ) >= 0 ) { ++ if ( wrq.u.data.length > 1 ) ++ wi->has_nickname = 1; ++ } ++ ++ /* Get bit rate */ ++ if ( ioctl ( skfd, SIOCGIWRATE, &wrq ) >= 0 ) { ++ wi->has_bitrate = 1; ++ memcpy ( &wi->bitrate, &wrq.u.bitrate, sizeof ( iwparam )); ++ } ++ ++ /* Get RTS threshold */ ++ if ( ioctl ( skfd, SIOCGIWRTS, &wrq ) >= 0 ) { ++ wi->has_rts = 1; ++ memcpy ( &wi->rts, &wrq.u.rts, sizeof ( iwparam )); ++ } ++ ++ /* Get fragmentation threshold */ ++ if ( ioctl ( skfd, SIOCGIWFRAG, &wrq ) >= 0 ) { ++ wi->has_frag = 1; ++ memcpy ( &wi->frag, &wrq.u.frag, sizeof ( iwparam )); ++ } ++ ++ /* Get operation mode */ ++ if ( ioctl ( skfd, SIOCGIWMODE, &wrq ) >= 0 ) { ++ wi->mode = wrq.u.mode; ++ if ( wi->mode < IW_NUM_OPER_MODE && wi->mode >= 0 ) ++ wi->has_mode = 1; ++ } ++ ++ /* Get Power Management settings */ // #if WIRELESS_EXT > 9 ++ wrq.u.power.flags = 0; ++ if ( ioctl ( skfd, SIOCGIWPOWER, &wrq ) >= 0 ) { ++ wi->has_power = 1; ++ memcpy ( &wi->power, &wrq.u.power, sizeof ( iwparam )); ++ } ++ ++ /* Get retry limit/lifetime */ // #if WIRELESS_EXT > 10 ++ if ( ioctl ( skfd, SIOCGIWRETRY, &wrq ) >= 0 ) { ++ wi->has_retry = 1; ++ memcpy ( &wi->retry, &wrq.u.retry, sizeof ( iwparam )); ++ } ++ ++ /* Get stats */ // #if WIRELESS_EXT > 11 ++ wrq.u.data.pointer = ( caddr_t ) &wi->stats; ++ wrq.u.data.length = 0; ++ wrq.u.data.flags = 1; /* Clear updated flag */ ++ if ( ioctl ( skfd, SIOCGIWSTATS, &wrq ) < 0 ) ++ wi->has_stats = 1; ++ ++ if ( !wi->has_stats ) { // no ioctl support, go to file ++ fp = fopen ( PROC_NET_WIRELESS, "r" ); ++ if ( fp ) { ++ while ( fgets ( bfr, sizeof ( bfr ), fp )) { ++ bfr [ sizeof ( bfr ) - 1 ] = '\0'; // no buffer overruns here! ++ strtok (( char * ) &bfr, "\n" ); // '\n' => '\0' ++ if ( strstr ( bfr, ifname ) && strstr ( bfr, ":" )) { ++ wi->has_stats = 1; ++ s = bfr; ++ s = strchr ( s, ':' ); s++; /* Skip ethX: */ ++ s = strtok ( s, " " ); /* ' ' => '\0' */ ++ sscanf ( s, "%X", &wi->stats.status ); // status ++ ++ s = strtok ( NULL, " " ); // link quality ++ if ( strchr ( s, '.' ) != NULL ) ++ wi->stats.qual.updated |= 1; ++ sscanf ( s, "%d", &wi->stats.qual.qual ); ++ ++ s = strtok ( NULL, " " ); // signal level ++ if ( strchr ( s,'.' ) != NULL ) ++ wi->stats.qual.updated |= 2; ++ sscanf ( s, "%d", &wi->stats.qual.level ); ++ ++ s = strtok ( NULL, " " ); // noise level ++ if ( strchr ( s, '.' ) != NULL ) ++ wi->stats.qual.updated += 4; ++ sscanf ( s, "%d", &wi->stats.qual.noise ); ++ ++ s = strtok ( NULL, " " ); sscanf ( s, "%d", &wi->stats.discard.nwid ); ++ s = strtok ( NULL, " " ); sscanf ( s, "%d", &wi->stats.discard.code ); ++ s = strtok ( NULL, " " ); sscanf ( s, "%d", &wi->stats.discard.fragment ); ++ s = strtok ( NULL, " " ); sscanf ( s, "%d", &wi->stats.discard.retries ); ++ s = strtok ( NULL, " " ); sscanf ( s, "%d", &wi->stats.discard.misc ); ++ s = strtok ( NULL, " " ); sscanf ( s, "%d", &wi->stats.miss.beacon ); ++ } ++ } ++ fclose ( fp ); ++ } ++ } ++ ++// printf ( "%s bfr: %s\n", "loadTables()", bfr ); ++} ++ ++/**************************************************************************** ++* * ++* displayWiExt() - show what I got from Wireless Extensions * ++* * ++****************************************************************************/ ++static void displayWiExt ( struct wireless_info info ) ++{ ++#ifdef DISPLAYWIEXT ++ int i; ++ char title[] = "displayWiExt() -"; ++ ++ printf ( "========================================\n" ); ++ printf ( "===> Wireless Extension IOCTL calls <===\n" ); ++ printf ( "========================================\n" ); ++ ++ if ( strlen ( info.name )) ++ printf ( "%s name: %s\n", "SIOCGIWNAME", info.name ); ++ else ++ printf ( "%s\n", "no info.name support" ); ++ ++ if ( info.has_nickname = 1 ) ++ printf ( "%s nickname: %s\n", "SIOCGIWNICKN", info.nickname ); ++ else ++ printf ( "%s %s\n", "SIOCGIWNICKN", " ===> no info.nickname support" ); ++ ++ if ( info.has_essid ) ++ printf ( "%s essid_on: %d essid: %s\n", "SIOCGIWESSID", info.essid_on, info.essid ); ++ else ++ printf ( "%s %s\n", "SIOCGIWESSID", " ===> no info.essid support" ); ++ ++ if ( info.has_range ) { ++ printf ( "%s throughput: %d\n", "SIOCGIWRANGE", info.range.throughput ); ++ printf ( "%s min_nwid: %d\n", "SIOCGIWRANGE", info.range.min_nwid ); ++ printf ( "%s max_nwid: %d\n", "SIOCGIWRANGE", info.range.max_nwid ); ++ printf ( "%s sensitivity: %d\n", "SIOCGIWRANGE", info.range.sensitivity ); ++ printf ( "%s num_bitrates: %d\n", "SIOCGIWRANGE", info.range.num_bitrates ); ++ for ( i = 0; i < info.range.num_bitrates; i++ ) ++ printf ( "%s bitrate[%d]: %d\n", "SIOCGIWRANGE", i, info.range.bitrate[i] ); ++ printf ( "%s min_rts: %d\n", "SIOCGIWRANGE", info.range.min_rts ); ++ printf ( "%s max_rts: %d\n", "SIOCGIWRANGE", info.range.max_rts ); ++ printf ( "%s min_frag: %d\n", "SIOCGIWRANGE", info.range.min_frag ); ++ printf ( "%s max_frag: %d\n", "SIOCGIWRANGE", info.range.max_frag ); ++ printf ( "%s min_pmp: %d\n", "SIOCGIWRANGE", info.range.min_pmp ); ++ printf ( "%s max_pmp: %d\n", "SIOCGIWRANGE", info.range.max_pmp ); ++ printf ( "%s min_pmt: %d\n", "SIOCGIWRANGE", info.range.min_pmt ); ++ printf ( "%s max_pmt: %d\n", "SIOCGIWRANGE", info.range.max_pmt ); ++ printf ( "%s pmp_flags: %d\n", "SIOCGIWRANGE", info.range.pmp_flags ); ++ printf ( "%s pmt_flags: %d\n", "SIOCGIWRANGE", info.range.pmt_flags ); ++ printf ( "%s pm_capa: %d\n", "SIOCGIWRANGE", info.range.pm_capa ); ++ printf ( "%s num_encoding_sizes: %d\n", "SIOCGIWRANGE", info.range.num_encoding_sizes ); ++ for ( i = 0; i < info.range.num_encoding_sizes; i++ ) ++ printf ( "%s encoding_size[%d]: %d\n", "SIOCGIWRANGE", i, info.range.encoding_size[i] ); ++ printf ( "%s max_encoding_tokens: %d\n", "SIOCGIWRANGE", info.range.max_encoding_tokens ); ++// printf ( "%s encoding_login_index: %d\n", "SIOCGIWRANGE", info.range.encoding_login_index ); ++ printf ( "%s txpower_capa: %d\n", "SIOCGIWRANGE", info.range.txpower_capa ); ++ printf ( "%s num_txpower: %d dBm\n", "SIOCGIWRANGE", info.range.num_txpower ); ++ for ( i = 0; i < info.range.num_txpower; i++ ) ++ printf ( "%s txpower[%d]: %d\n", "SIOCGIWRANGE", i, info.range.txpower[i] ); ++ printf ( "%s we_version_compiled: %d\n", "SIOCGIWRANGE", info.range.we_version_compiled ); ++ printf ( "%s we_version_source: %d\n", "SIOCGIWRANGE", info.range.we_version_source ); ++ printf ( "%s retry_capa: %d\n", "SIOCGIWRANGE", info.range.retry_capa ); ++ printf ( "%s retry_flags: %d\n", "SIOCGIWRANGE", info.range.retry_flags ); ++ printf ( "%s r_time_flags: %d\n", "SIOCGIWRANGE", info.range.r_time_flags ); ++ printf ( "%s min_retry: %d\n", "SIOCGIWRANGE", info.range.min_retry ); ++ printf ( "%s max_retry: %d\n", "SIOCGIWRANGE", info.range.max_retry ); ++ printf ( "%s min_r_time: %d\n", "SIOCGIWRANGE", info.range.min_r_time ); ++ printf ( "%s max_r_time: %d\n", "SIOCGIWRANGE", info.range.max_r_time ); ++ printf ( "%s num_channels: %d\n", "SIOCGIWRANGE", info.range.num_channels ); ++ printf ( "%s num_frequency: %d\n", "SIOCGIWRANGE", info.range.num_frequency ); ++ for ( i = 0; i < info.range.num_frequency; i++ ) ++ printf ( "%s freq[%d].i: %d freq[%d].e: %d freq[%d].m: %d\n", "SIOCGIWRANGE", ++ i, info.range.freq[i].i, i, info.range.freq[i].e, i, info.range.freq[i].m ); ++ } ++ else ++ printf ( "%s %s\n", "SIOCGIWRANGE", " ===> no info.range support" ); ++ ++ if ( info.has_nwid ) ++ printf ( "%s nwid - disabled: %d value: %X\n", "SIOCGIWNWID", info.nwid.disabled, info.nwid.value ); ++ else ++ printf ( "%s %s\n", "SIOCGIWNWID", " ===> no info.nwid support" ); ++ ++ if ( info.has_freq ) { ++// printf ( "%s freq: %g\n", "SIOCGIWFREQ", info.freq / GIGA ); ++ printf ( "%s freq: %g\n", "SIOCGIWFREQ", info.freq ); ++ } ++ else ++ printf ( "%s %s\n", "SIOCGIWFREQ", " ===> no info.freq support" ); ++ ++ if ( info.has_sens ) ++ printf ( "%s sens: %d\n", "SIOCGIWSENS", info.sens ); ++ else ++ printf ( "%s %s\n", "SIOCGIWSENS", " ===> no info.sens support" ); ++ ++ if ( info.has_key ) { ++ printf ( "%s key_size: %d key_flags: %d wepCurrentKey: %d\n", ++ "SIOCGIWENCODE", info.key_size, info.key_flags, wepCurrentKey ); ++ printf ( "%s MODE: %d DISABLED: %d INDEX: %d OPEN: %d RESTRICTED: %d NOKEY: %d TEMP: %d\n", ++ "SIOCGIWENCODE", info.key_flags & IW_ENCODE_MODE, ++ info.key_flags & IW_ENCODE_DISABLED ? 1:0, info.key_flags & IW_ENCODE_INDEX, ++ info.key_flags & IW_ENCODE_OPEN ? 1:0, info.key_flags & IW_ENCODE_RESTRICTED ? 1:0, ++ info.key_flags & IW_ENCODE_NOKEY ? 1:0, info.key_flags & IW_ENCODE_TEMP ? 1:0 ); ++ } ++ else ++ printf ( "%s %s\n", "SIOCGIWENCODE", " ===> no info.key support" ); ++ ++ for ( i = 0; i < MAX_WEP_KEYS; i++ ) { ++ if ( wep[i].haveKey ) ++ printf ( "%s wep[%d].len: %d wep[%d].key: %s\n", ++ "SIOCGIWENCODE", i, wep[i].len, i, wep[i].key ); ++ } ++ ++ if ( info.has_ap_addr ) ++ printf ( "%s ap_addr.sa_data: %02X:%02X:%02X:%02X:%02X:%02X ap_addr.sa_family: %d\n", ++ "SIOCGIWAP", ( UCHAR ) info.ap_addr.sa_data[0], ( UCHAR ) info.ap_addr.sa_data[1], ++ ( UCHAR ) info.ap_addr.sa_data[2], ( UCHAR ) info.ap_addr.sa_data[3], ++ ( UCHAR ) info.ap_addr.sa_data[4], ( UCHAR ) info.ap_addr.sa_data[5], ++ info.ap_addr.sa_family ); ++ else ++ printf ( "%s %s\n", "SIOCGIWAP", " ===> no ap_addr information" ); ++ ++ if ( info.has_bitrate ) ++ printf ( "%s bitrate: %d value: %d fixed: %d disabled: %d flags: %d\n", ++ "SIOCGIWRATE", info.bitrate, info.bitrate.value, info.bitrate.fixed, ++ info.bitrate.disabled, info.bitrate.flags ); ++ else ++ printf ( "%s %s\n", "SIOCGIWRATE", " ===> no info.bitrate support" ); ++ ++ if ( info.has_rts ) ++ printf ( "%s rts: %d\n", "SIOCGIWRTS", info.rts ); ++ else ++ printf ( "%s %s\n", "SIOCGIWRTS", " ===> no info.rts support" ); ++ ++ if ( info.has_frag ) ++ printf ( "%s frag: %d\n", "SIOCGIWFRAG", info.frag ); ++ else ++ printf ( "%s %s\n", "SIOCGIWFRAG", " ===> no info.frag support" ); ++ ++ if ( info.has_mode ) ++ printf ( "%s mode: %d\n", "SIOCGIWMODE", info.mode ); ++ else ++ printf ( "%s %s\n", "SIOCGIWMODE", " ===> no info.mode support" ); ++ ++ if ( info.has_power ) { ++ printf ( "%s power: %d\n", "SIOCGIWPOWER", info.power ); ++ printf ( "%s disabled: %d MIN: %d MAX: %d TIMEOUT: %d RELATIVE: %d\n", ++ "SIOCGIWPOWER", ++ info.power.disabled ? 1:0, ++ info.power.flags & IW_POWER_MIN ? 1:0, ++ info.power.flags & IW_POWER_MAX ? 1:0, ++ info.power.flags & IW_POWER_TIMEOUT ? 1:0, ++ info.power.flags & IW_POWER_RELATIVE ? 1:0 ); ++ printf ( "%s UNICAST: %d MULTICAST: %d ALL: %d FORCE: %d REPEATER: %d\n", ++ "SIOCGIWPOWER", ++ info.power.flags & IW_POWER_UNICAST_R ? 1:0, ++ info.power.flags & IW_POWER_MULTICAST_R ? 1:0, ++ info.power.flags & IW_POWER_ALL_R ? 1:0, ++ info.power.flags & IW_POWER_FORCE_S ? 1:0, ++ info.power.flags & IW_POWER_REPEATER ? 1:0 ); ++ } ++ else ++ printf ( "%s %s\n", "SIOCGIWPOWER", " ===> no info.power support" ); ++ ++ if ( info.has_retry ) ++ printf ( "%s retry: %d\n", "SIOCGIWRETRY", info.retry ); ++ else ++ printf ( "%s %s\n", "SIOCGIWRETRY", " ===> no info.retry support" ); ++ ++ if ( info.has_stats ) { ++ printf ( "%s status: %d\n", "SIOCGIWSTATS", info.stats.status ); ++ printf ( "%s qual.level: %d\n", "SIOCGIWSTATS", info.stats.qual.level ); ++ printf ( "%s qual.noise: %d\n", "SIOCGIWSTATS", info.stats.qual.noise ); ++ printf ( "%s qual.qual: %d\n", "SIOCGIWSTATS", info.stats.qual.qual ); ++ printf ( "%s qual.updated: %d\n", "SIOCGIWSTATS", info.stats.qual.updated ); ++ printf ( "%s discard.code: %d\n", "SIOCGIWSTATS", info.stats.discard.code ); ++ printf ( "%s discard.fragment: %d\n", "SIOCGIWSTATS", info.stats.discard.fragment ); ++ printf ( "%s discard.misc: %d\n", "SIOCGIWSTATS", info.stats.discard.misc ); ++ printf ( "%s discard.nwid: %d\n", "SIOCGIWSTATS", info.stats.discard.nwid ); ++ printf ( "%s discard.retries: %d\n", "SIOCGIWSTATS", info.stats.discard.retries ); ++ printf ( "%s miss.beacon: %d\n", "SIOCGIWSTATS", info.stats.miss.beacon ); ++ } ++ else ++ printf ( "%s %s\n", "SIOCGIWSTATS", " ===> no info.stats support" ); ++ ++ if ( info.txpower.flags & IW_TXPOW_MWATT ) ++ printf ( "%s txpower1: %d dBm disabled: %d fixed: %d flags: %d\n", "SIOCGIWRANGE", ++ mWatt2dbm ( info.txpower.value ), info.txpower.disabled, info.txpower.fixed, info.txpower.flags); ++ else ++ printf ( "%s txpower2: %d dBm disabled: %d fixed: %d flags: %d\n", "SIOCGIWRANGE", info.txpower.value, info.txpower.disabled, info.txpower.fixed, info.txpower.flags ); ++ ++ if ( info.has_range ) ++ if ( info.sens.value < 0 ) ++ printf ( "%s sens: %d dBm\n", "SIOCGIWRANGE", info.sens.value ); ++ else ++ printf ( "%s sens: %d/%d\n", "SIOCGIWRANGE", info.sens.value, info.range.sensitivity ); ++ ++ if ( info.has_range && ( info.stats.qual.level != 0 )) ++ if ( info.stats.qual.level > info.range.max_qual.level ) ++ /* Statistics are in dBm (absolute power measurement) */ ++ printf ( "%s Quality: %d/%d Signal level: %d dBm Noise level: %d dBm\n", ++ "SIOCGIWRANGE", ++ info.stats.qual.qual, info.range.max_qual.qual, ++ info.stats.qual.level - 0x100, ++ info.stats.qual.noise - 0x100 ); ++ else ++ printf ( "%s Quality: %d/%d Signal level: %d/%d Noise level: %d/%d", ++ "SIOCGIWRANGE", ++ info.stats.qual.qual, info.range.max_qual.qual, ++ info.stats.qual.level, info.range.max_qual.level, ++ info.stats.qual.noise, info.range.max_qual.noise ); ++ ++#endif // #ifdef DISPLAYWIEXT ++} ++ ++/**************************************************************************** ++* * ++* Linked List Functions * ++* * ++****************************************************************************/ ++/**************************************************************************** ++* * ++* addList() - add an entry to a linked list * ++* * ++****************************************************************************/ ++static void ++addList ( char *l, char *data, int len ) ++{ ++ char uid[256]; ++ LIST_HEAD ( , avNode ) *list; ++ ++ // NOTE: this assumes the UID is at the begining of the ++ // data structure and that UIDs are strings ++ ++ list = ( LIST_HEAD ( , avNode ) * ) l; // NOTE: don't know how to get ++ strcpy ( uid, data ); // rid of compiler warning on ++ // LISTHEAD typecast ++ // create a new node and the data that goes in it ++ newNode = malloc ( sizeof ( struct avNode )); ++ newNode->data = malloc ( len ); ++ memcpy ( newNode->data, data, len ); ++ ++ // this deals with an empty list ++ if ( LIST_EMPTY ( list )) { ++ LIST_INSERT_HEAD ( list, newNode, nodes ); ++ return; ++ } ++ ++ // this deals with UIDs that match ++ for ( np = LIST_FIRST ( list ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ if ( strncmp ( uid, np->data, strlen ( uid )) == 0 ) { // found matching UID ++ LIST_INSERT_AFTER ( np, newNode, nodes ); ++ if ( np->data ) ++ free ( np->data ); ++ LIST_REMOVE ( np, nodes ); ++ free ( np ); ++ return; ++ } ++ } ++ ++ // this deals with inserting a new UID in the list ++ for ( np = LIST_FIRST ( list ); np != NULL; np = LIST_NEXT ( np, nodes )) { ++ lastNode = np; ++ if ( strncmp ( np->data, uid, strlen ( uid )) > 0 ) { // old ID > new ID AND ++ LIST_INSERT_BEFORE ( np, newNode, nodes ); ++ return; ++ } ++ } ++ ++ // this deals with a UID that needs to go on the end of the list ++ LIST_INSERT_AFTER ( lastNode, newNode, nodes ); ++ ++ return; ++} ++ ++/**************************************************************************** ++* * ++* initLists() - initialize all the linked lists * ++* * ++****************************************************************************/ ++static void initLists() ++{ ++ LIST_INIT ( &scList ); LIST_INIT ( &aaList ); LIST_INIT ( &dfList ); ++ LIST_INIT ( &kmList ); LIST_INIT ( &prList ); ++ LIST_INIT ( &opList ); LIST_INIT ( &coList ); ++ LIST_INIT ( &gaList ); LIST_INIT ( &riList ); LIST_INIT ( &poList ); ++ LIST_INIT ( &paList ); LIST_INIT ( &ptList ); LIST_INIT ( &pfList ); ++ LIST_INIT ( &pdList ); LIST_INIT ( &piList ); LIST_INIT ( &rdList ); ++ LIST_INIT ( &alList ); LIST_INIT ( &rtList ); LIST_INIT ( &rrList ); ++} ++/**************************************************************************** ++* * ++* flushLists() - flush all linked lists * ++* * ++****************************************************************************/ ++static void flushLists() ++{ ++ flushList (( char * ) &scList ); flushList (( char * ) &aaList ); ++ flushList (( char * ) &dfList ); flushList (( char * ) &kmList ); ++ flushList (( char * ) &prList ); ++ flushList (( char * ) &opList ); flushList (( char * ) &coList ); ++ flushList (( char * ) &gaList ); flushList (( char * ) &riList ); ++ flushList (( char * ) &poList ); flushList (( char * ) &paList ); ++ flushList (( char * ) &ptList ); flushList (( char * ) &pfList ); ++ flushList (( char * ) &pdList ); flushList (( char * ) &piList ); ++ flushList (( char * ) &rdList ); flushList (( char * ) &alList ); ++ flushList (( char * ) &rtList ); flushList (( char * ) &rrList ); ++} ++ ++/**************************************************************************** ++* * ++* flushList() - flush a linked list * ++* * ++****************************************************************************/ ++static void flushList ( char *l ) ++{ ++ LIST_HEAD ( , avNode ) *list; ++ ++ list = ( LIST_HEAD ( , avNode ) * ) l; // NOTE: don't know how to get ++ while ( !LIST_EMPTY ( list )) { // rid of compiler warning on ++ np = LIST_FIRST ( list ); // LISTHEAD typecast ++ if ( np->data ) ++ free ( np->data ); ++ LIST_REMOVE ( np, nodes ); ++ free ( np ); ++ } ++} ++ ++/**************************************************************************** ++* * ++* Utility Functions * ++* * ++****************************************************************************/ ++/**************************************************************************** ++* * ++* The following two routines were taken directly from iwlib.c * ++* * ++****************************************************************************/ ++ /* ++ * Open a socket. ++ * Depending on the protocol present, open the right socket. The socket ++ * will allow us to talk to the driver. ++ */ ++static int openSocket ( void ) ++{ ++ static const int families[] = { ++ AF_INET, AF_IPX, AF_AX25, AF_APPLETALK ++ }; ++ unsigned int i; ++ int sock; ++ ++ /* ++ * Now pick any (exisiting) useful socket family for generic queries ++ * Note : don't open all the socket, only returns when one matches, ++ * all protocols might not be valid. ++ * Workaround by Jim Kaba ++ * Note : in 99% of the case, we will just open the inet_sock. ++ * The remaining 1% case are not fully correct... ++ */ ++ ++ /* Try all families we support */ ++ for(i = 0; i < sizeof(families)/sizeof(int); ++i) { ++ /* Try to open the socket, if success returns it */ ++ sock = socket(families[i], SOCK_DGRAM, 0); ++ if(sock >= 0) ++ return sock; ++ } ++ ++ return -1; ++} ++ ++/*------------------------------------------------------------------*/ ++/* ++ * Convert a value in milliWatt to a value in dBm. ++ */ ++static int mWatt2dbm ( int in ) ++{ ++#ifdef WE_NOLIBM ++ /* Version without libm : slower */ ++ double fin = (double) in; ++ int res = 0; ++ ++ /* Split integral and floating part to avoid accumulating rounding errors */ ++ while(fin > 10.0) ++ { ++ res += 10; ++ fin /= 10.0; ++ } ++ while(fin > 1.000001) /* Eliminate rounding errors, take ceil */ ++ { ++ res += 1; ++ fin /= LOG10_MAGIC; ++ } ++ return(res); ++#else /* WE_NOLIBM */ ++ /* Version with libm : faster */ ++ return((int) (ceil(10.0 * log10((double) in)))); ++#endif /* WE_NOLIBM */ ++} ++ ++/**************************************************************************** ++* * ++* htob - converts hex string to binary * ++* * ++****************************************************************************/ ++static char *htob ( char *s ) ++{ ++ char nibl, *byt; ++ static char bin[20]; ++ ++ byt = bin; ++ ++ while ((nibl = *s++) && nibl != ' ') { /* While not end of string. */ ++ nibl -= ( nibl > '9') ? ('A' - 10): '0'; ++ *byt = nibl << 4; /* place high nibble */ ++ if((nibl = *s++) && nibl != ' ') { ++ nibl -= ( nibl > '9') ? ('A' - 10): '0'; ++ *byt |= nibl; /* place low nibble */ ++ } ++ else break; ++ ++byt; ++ } ++ *++byt = '\0'; ++ return ( bin ); ++} ++ ++/**************************************************************************** ++* * ++* hasChanged() - see if area has been changed from NULLs * ++* * ++****************************************************************************/ ++static int hasChanged ( char *loc, int len ) ++{ ++ char *wrk; ++ int changed = TRUE; ++ ++ wrk = malloc ( len ); ++ memset ( wrk, 0, len ); ++ if ( memcmp ( loc, wrk, len ) == 0 ) ++ changed = FALSE; ++ free ( wrk ); ++ ++ return ( changed ); ++} ++ +--- /dev/null ++++ b/agent/mibgroup/ieee802dot11.h +@@ -0,0 +1,730 @@ ++/**************************************************************************** ++* * ++* File Name: ieee802dot11.h * ++* Used By: * ++* * ++* Operating System: * ++* Purpose: * ++* * ++* Comments: * ++* * ++* Author: Larry Simmons * ++* lsimmons@avantcom.com * ++* www.avantcom.com * ++* * ++* Creation Date: 09/02/03 * ++* * ++* Ver Date Inits Modification * ++* ----- -------- ----- ------------ * ++* 0.0.1 09/02/03 LRS created * ++* 0.0.2 09/24/03 LRS wouldn't build after fresh ./configure * ++****************************************************************************/ ++/* This file was generated by mib2c and is intended for use as a mib module ++ for the ucd-snmp snmpd agent. */ ++#ifndef _MIBGROUP_IEEE802DOT11_H ++#define _MIBGROUP_IEEE802DOT11_H ++/* we may use header_generic and header_simple_table from the util_funcs module */ ++ ++/**************************************************************************** ++* Includes * ++****************************************************************************/ ++#include ++ ++/**************************************************************************** ++* Linked List Defines * ++****************************************************************************/ ++// here are some Linked List MACROS I wanted to use, ++// but curiously were not in /usr/includes/sys/queue.h ++ ++#ifndef LIST_EMPTY ++ #define LIST_EMPTY(head) ((head)->lh_first == NULL) ++#endif ++ ++#ifndef LIST_NEXT ++ #define LIST_NEXT(elm, field) ((elm)->field.le_next) ++#endif ++ ++#ifndef LIST_INSERT_BEFORE ++ #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ ++ (elm)->field.le_prev = (listelm)->field.le_prev; \ ++ LIST_NEXT((elm), field) = (listelm); \ ++ *(listelm)->field.le_prev = (elm); \ ++ (listelm)->field.le_prev = &LIST_NEXT((elm), field); \ ++ } while (0) ++#endif ++ ++#ifndef LIST_FIRST ++ #define LIST_FIRST(head) ((head)->lh_first) ++#endif ++ ++/**************************************************************************** ++* 802.11 MIB Defines * ++****************************************************************************/ ++#define SYS_STRING_LEN 256 ++#define MACADDR_LEN ( 6 * 2 ) + 5 ++#define OPER_RATE_SET_LEN 126 ++#define MAN_OUI_LEN ( 3 * 2 ) + 2 ++#define WEP_STR_LEN 64 ++#define SNMP_STR_LEN 128 ++#define TEXT_LEN 80 ++#define IFINDEX_LEN 4 ++#define IFNAME_LEN 16 ++#define MAX_WEP_KEYS 4 ++ ++#define AUTHENICATION_ALGORITHMS_INDEX_LEN 4 ++#define WEP_DEFAULT_KEY_INDEX_LEN 4 ++#define WEP_KEY_MAPPING_INDEX_LEN 4 ++#define GROUP_ADDRESS_INDEX_LEN 4 ++#define REG_DOMAIN_SUPPORT_INDEX_LEN 4 ++#define ANTENNA_LIST_INDEX_LEN 4 ++#define SUPPORTED_DATA_RATES_TX_INDEX_LEN 4 ++#define SUPPORTED_DATA_RATES_RX_INDEX_LEN 4 ++ ++#define SC_UID_LEN IFINDEX_LEN ++#define AA_UID_LEN IFINDEX_LEN + AUTHENICATION_ALGORITHMS_INDEX_LEN ++#define DF_UID_LEN IFINDEX_LEN + WEP_DEFAULT_KEY_INDEX_LEN ++#define KM_UID_LEN IFINDEX_LEN + WEP_KEY_MAPPING_INDEX_LEN ++#define PR_UID_LEN IFINDEX_LEN ++#define OP_UID_LEN IFINDEX_LEN ++#define CO_UID_LEN IFINDEX_LEN ++#define GA_UID_LEN IFINDEX_LEN + GROUP_ADDRESS_INDEX_LEN ++#define RI_UID_LEN IFINDEX_LEN ++#define PO_UID_LEN IFINDEX_LEN ++#define PA_UID_LEN IFINDEX_LEN ++#define PT_UID_LEN IFINDEX_LEN ++#define PF_UID_LEN IFINDEX_LEN ++#define PD_UID_LEN IFINDEX_LEN ++#define PI_UID_LEN IFINDEX_LEN ++#define RD_UID_LEN IFINDEX_LEN + REG_DOMAIN_SUPPORT_INDEX_LEN ++#define AL_UID_LEN IFINDEX_LEN + ANTENNA_LIST_INDEX_LEN ++#define RT_UID_LEN IFINDEX_LEN + SUPPORTED_DATA_RATES_TX_INDEX_LEN ++#define RR_UID_LEN IFINDEX_LEN + SUPPORTED_DATA_RATES_RX_INDEX_LEN ++ ++/**************************************************************************** ++* Linked List Structure * ++****************************************************************************/ ++static struct avNode { ++ LIST_ENTRY ( avNode ) nodes; ++ char *data; // pointer to data ++}; ++ ++typedef LIST_HEAD ( , avNode ) avList_t; ++ ++/**************************************************************************** ++* 802.11 MIB structures * ++****************************************************************************/ ++/**************************************************************************** ++* dot11Smt Group * ++****************************************************************************/ ++/**************************************************************************** ++* dot11StationConfigTable * ++****************************************************************************/ ++static struct scTbl_data { ++ ++ char UID [ SC_UID_LEN + 1 ]; // unique ID ++ char ifName [ IFNAME_LEN + 1 ]; // ifName of card ++ ++ long ifIndex; // ifindex of card ++ ++ char stationID [ MACADDR_LEN + 1 ]; // Default actual MacAddr ++ long mediumOccupancyLimit; ++ long CFPPollable; ++ long CFPPeriod; ++ long maxDuration; ++ long authenticationResponseTimeOut; ++ long privacyOptionImplemented; ++ long powerManagementMode; ++ char desiredSSID [ SNMP_STR_LEN + 1 ]; ++ long desiredBSSType; ++ char operationalRateSet [ OPER_RATE_SET_LEN + 1]; ++ long beaconPeriod; ++ long DTIMPeriod; ++ long associationResponseTimeOut; ++ long disAssociationReason; ++ char disAssociationStation [ MACADDR_LEN + 1 ]; ++ long deAuthenticationReason; ++ char deAuthenticationStation [ MACADDR_LEN + 1 ]; ++ long authenticateFailStatus; ++ char authenticateFailStation [ MACADDR_LEN + 1 ]; ++ ++ long haveStationID; ++ long haveMediumOccupancyLimit; ++ long haveCFPPollable; ++ long haveCFPPeriod; ++ long haveMaxDuration; ++ long haveAuthenticationResponseTimeOut; ++ long havePrivacyOptionImplemented; ++ long havePowerManagementMode; ++ long haveDesiredSSID; ++ long haveDesiredBSSType; ++ long haveOperationalRateSet; ++ long haveBeaconPeriod; ++ long haveDTIMPeriod; ++ long haveAssociationResponseTimeOut; ++ long haveDisAssociationReason; ++ long haveDisAssociationStation; ++ long haveDeAuthenticationReason; ++ long haveDeAuthenticationStation; ++ long haveAuthenticateFailStatus; ++ long haveAuthenticateFailStation; ++ ++} nSc, *sc = &nSc; ++ ++static avList_t scList; ++ ++/**************************************************************************** ++* dot11AuthenticationAlgorithmsTable * ++****************************************************************************/ ++static struct aaTbl_data { ++ ++ char UID [ AA_UID_LEN + 1 ]; ++ char ifName [ IFNAME_LEN + 1 ]; // ifName of card ++ ++ long ifIndex; // ifindex of card ++ long authenticationAlgorithmsIndex; ++ ++ long authenticationAlgorithm; ++ long authenticationAlgorithmsEnable; ++ ++ long haveAuthenticationAlgorithm; ++ long haveAuthenticationAlgorithmsEnable; ++ ++} nAa, *aa = &nAa; ++ ++static avList_t aaList; ++ ++/**************************************************************************** ++* dot11WEPDefaultKeysTable * ++****************************************************************************/ ++static struct dfTbl_data { ++ ++ char UID [ DF_UID_LEN + 1 ]; ++ char ifName [ IFNAME_LEN + 1 ]; ++ ++ long ifIndex; // ifindex of card ++ long WEPDefaultKeyIndex; ++ ++ char WEPDefaultKeyValue [ WEP_STR_LEN + 1 ]; ++ long haveWEPDefaultKeyValue; ++ ++} nDf, *df = &nDf; ++ ++static avList_t dfList; ++ ++/**************************************************************************** ++* dot11WEPKeyMappingsTable * ++****************************************************************************/ ++static struct kmTbl_data { ++ ++ char UID [ KM_UID_LEN + 1 ]; ++ char ifName [ IFNAME_LEN + 1 ]; ++ ++ long ifIndex; ++ long WEPKeyMappingIndex; ++ ++ char WEPKeyMappingAddress [ MACADDR_LEN + 1 ]; ++ long WEPKeyMappingWEPOn; ++ char WEPKeyMappingValue [ WEP_STR_LEN + 1 ]; ++ long WEPKeyMappingStatus; ++ ++ long haveWEPKeyMappingIndex; ++ long haveWEPKeyMappingAddress; ++ long haveWEPKeyMappingWEPOn; ++ long haveWEPKeyMappingValue; ++ long haveWEPKeyMappingStatus; ++ ++} nKm, *km = &nKm; ++ ++static avList_t kmList; ++ ++/**************************************************************************** ++* dot11PrivacyTable * ++****************************************************************************/ ++static struct prTbl_data { ++ ++ char UID [ PR_UID_LEN + 1 ]; ++ char ifName [ IFNAME_LEN + 1 ]; ++ ++ long ifIndex; ++ ++ long privacyInvoked; ++ long WEPDefaultKeyID; ++ long WEPKeyMappingLength; ++ long excludeUnencrypted; ++ unsigned long WEPICVErrorCount; ++ unsigned long WEPExcludedCount; ++ ++ long havePrivacyInvoked; ++ long haveWEPDefaultKeyID; ++ long haveWEPKeyMappingLength; ++ long haveExcludeUnencrypted; ++ long haveWEPICVErrorCount; ++ long haveWEPExcludedCount; ++ ++} nPr, *pr = &nPr; ++ ++static avList_t prList; ++ ++/**************************************************************************** ++* dot11Mac Group * ++****************************************************************************/ ++/**************************************************************************** ++* dot11OperationTable * ++****************************************************************************/ ++static struct opTbl_data { ++ ++ char UID [ OP_UID_LEN + 1 ]; // unique ID ++ char ifName [ IFNAME_LEN + 1 ]; // ifName of card ++ ++ long ifIndex; // ifindex of card ++ ++ char MACAddress [ MACADDR_LEN + 1 ]; ++ long RTSThreshold; ++ long shortRetryLimit; ++ long longRetryLimit; ++ long fragmentationThreshold; ++ long maxTransmitMSDULifetime; ++ long maxReceiveLifetime; ++ char manufacturerID [ SNMP_STR_LEN + 1 ]; ++ char productID [ SNMP_STR_LEN + 1 ]; ++ ++ long haveMACAddress; ++ long haveRTSThreshold; ++ long haveShortRetryLimit; ++ long haveLongRetryLimit; ++ long haveFragmentationThreshold; ++ long haveMaxTransmitMSDULifetime; ++ long haveMaxReceiveLifetime; ++ long haveManufacturerID; ++ long haveProductID; ++ ++} nOp, *op = &nOp; ++ ++static avList_t opList; ++ ++/**************************************************************************** ++* dot11CountersTable * ++****************************************************************************/ ++static struct coTbl_data { ++ ++ char UID [ CO_UID_LEN + 1 ]; // unique ID ++ char ifName [ IFNAME_LEN + 1 ]; // ifName of card ++ ++ long ifIndex; // ifindex of card ++ ++ unsigned long transmittedFragmentCount; ++ unsigned long multicastTransmittedFrameCount; ++ unsigned long failedCount; ++ unsigned long retryCount; ++ unsigned long multipleRetryCount; ++ unsigned long frameDuplicateCount; ++ unsigned long RTSSuccessCount; ++ unsigned long RTSFailureCount; ++ unsigned long ACKFailureCount; ++ unsigned long receivedFragmentCount; ++ unsigned long multicastReceivedFrameCount; ++ unsigned long FCSErrorCount; ++ unsigned long transmittedFrameCount; ++ unsigned long WEPUndecryptableCount; ++ ++ long haveTransmittedFragmentCount; ++ long haveMulticastTransmittedFrameCount; ++ long haveFailedCount; ++ long haveRetryCount; ++ long haveMultipleRetryCount; ++ long haveFrameDuplicateCount; ++ long haveRTSSuccessCount; ++ long haveRTSFailureCount; ++ long haveACKFailureCount; ++ long haveReceivedFragmentCount; ++ long haveMulticastReceivedFrameCount; ++ long haveFCSErrorCount; ++ long haveTransmittedFrameCount; ++ long haveWEPUndecryptableCount; ++ ++} nCo, *co = &nCo; ++ ++static avList_t coList; ++ ++/**************************************************************************** ++* dot11GroupAddressesTable * ++****************************************************************************/ ++static struct gaTbl_data { ++ ++ char UID [ GA_UID_LEN + 1 ]; ++ char ifName [ IFNAME_LEN + 1 ]; ++ ++ long ifIndex; // ifindex of card ++ long groupAddressesIndex; ++ ++ char address [ MACADDR_LEN + 1 ]; ++ long groupAddressesStatus; ++ ++ long haveAddress; ++ long haveGroupAddressesStatus; ++ ++} nGa, *ga = &nGa; ++ ++static avList_t gaList; ++ ++/**************************************************************************** ++* dot11Res Group * ++****************************************************************************/ ++static char resourceTypeIDName[] = "RTID"; ++static long haveResourceTypeIDName = 1; ++ ++/**************************************************************************** ++* dot11ResourceInfoTable * ++****************************************************************************/ ++static struct riTbl_data { ++ ++ char UID [ RI_UID_LEN + 1 ]; // unique ID ++ char ifName [ IFNAME_LEN + 1 ]; // ifName of card ++ ++ long ifIndex; // ifindex of card ++ ++ char manufacturerOUI [ MAN_OUI_LEN + 1 ]; ++ char manufacturerName [ SYS_STRING_LEN + 1 ]; ++ char manufacturerProductName [ SYS_STRING_LEN + 1 ]; ++ char manufacturerProductVersion [ SYS_STRING_LEN + 1 ]; ++ ++ char haveManufacturerOUI; ++ char haveManufacturerName; ++ char haveManufacturerProductName; ++ char haveManufacturerProductVersion; ++ ++} nRi, *ri = &nRi; ++ ++static avList_t riList; ++ ++/**************************************************************************** ++* dot11Phy Group * ++****************************************************************************/ ++/**************************************************************************** ++* dot11PhyOperationTable * ++****************************************************************************/ ++static struct poTbl_data { ++ ++ char UID [ PO_UID_LEN + 1 ]; // unique ID ++ char ifName [ IFNAME_LEN + 1 ]; // ifName of card ++ ++ long ifIndex; // ifindex of card ++ ++ long PHYType; ++ long currentRegDomain; ++ long tempType; ++ ++ long havePHYType; ++ long haveCurrentRegDomain; ++ long haveTempType; ++ ++} nPo, *po = &nPo; ++ ++static avList_t poList; ++ ++/**************************************************************************** ++* dot11PhyAntennaEntry * ++****************************************************************************/ ++static struct paTbl_data { ++ ++ char UID [ PA_UID_LEN + 1 ]; // unique ID ++ char ifName [ IFNAME_LEN + 1 ]; // ifName of card ++ ++ long ifIndex; // ifindex of card ++ ++ long currentTxAntenna; ++ long diversitySupport; ++ long currentRxAntenna; ++ ++ long haveCurrentTxAntenna; ++ long haveDiversitySupport; ++ long haveCurrentRxAntenna; ++ ++} nPa, *pa = &nPa; ++ ++static avList_t paList; ++ ++/**************************************************************************** ++* dot11PhyTxPowerTable * ++****************************************************************************/ ++static struct ptTbl_data { ++ ++ char UID [ PT_UID_LEN + 1 ]; // unique ID ++ char ifName [ IFNAME_LEN + 1 ]; // ifName of card ++ ++ long ifIndex; // ifindex of card ++ ++ long numberSupportedPowerLevels; ++ long TxPowerLevel1; ++ long TxPowerLevel2; ++ long TxPowerLevel3; ++ long TxPowerLevel4; ++ long TxPowerLevel5; ++ long TxPowerLevel6; ++ long TxPowerLevel7; ++ long TxPowerLevel8; ++ long currentTxPowerLevel; ++ ++ long haveNumberSupportedPowerLevels; ++ long haveTxPowerLevel1; ++ long haveTxPowerLevel2; ++ long haveTxPowerLevel3; ++ long haveTxPowerLevel4; ++ long haveTxPowerLevel5; ++ long haveTxPowerLevel6; ++ long haveTxPowerLevel7; ++ long haveTxPowerLevel8; ++ long haveCurrentTxPowerLevel ; ++ ++} nPt, *pt = &nPt; ++ ++static avList_t ptList; ++ ++/**************************************************************************** ++* dot11PhyFHSSTable * ++****************************************************************************/ ++static struct pfTbl_data { ++ ++ char UID [ PF_UID_LEN + 1 ]; // unique ID ++ char ifName [ IFNAME_LEN + 1 ]; // ifName of card ++ ++ long ifIndex; // ifindex of card ++ ++ long hopTime; ++ long currentChannelNumber; ++ long maxDwellTime; ++ long currentDwellTime; ++ long currentSet; ++ long currentPattern; ++ long currentIndex; ++ ++ long haveHopTime; ++ long haveCurrentChannelNumber; ++ long haveMaxDwellTime; ++ long haveCurrentDwellTime; ++ long haveCurrentSet; ++ long haveCurrentPattern; ++ long haveCurrentIndex; ++ ++} nPf, *pf = &nPf; ++ ++static avList_t pfList; ++ ++/**************************************************************************** ++* dot11PhyDSSSTable * ++****************************************************************************/ ++static struct pdTbl_data { ++ ++ char UID [ PD_UID_LEN + 1 ]; // unique ID ++ char ifName [ IFNAME_LEN + 1 ]; // ifName of card ++ ++ long ifIndex; // ifindex of card ++ ++ long currentChannel; ++ long CCAModeSupported; ++ long currentCCAMode; ++ long EDThreshold; ++ ++ long haveCurrentChannel; ++ long haveCCAModeSupported ; ++ long haveCurrentCCAMode; ++ long haveEDThreshold; ++ ++} nPd, *pd = &nPd; ++ ++static avList_t pdList; ++ ++/**************************************************************************** ++* dot11PhyIRTable * ++****************************************************************************/ ++static struct piTbl_data { ++ ++ char UID [ PI_UID_LEN + 1 ]; // unique ID ++ char ifName [ IFNAME_LEN + 1 ]; // ifName of card ++ ++ long ifIndex; // ifindex of card ++ ++ long CCAWatchdogTimerMax; ++ long CCAWatchdogCountMax; ++ long CCAWatchdogTimerMin; ++ long CCAWatchdogCountMin; ++ ++ long haveCCAWatchdogTimerMax; ++ long haveCCAWatchdogCountMax; ++ long haveCCAWatchdogTimerMin; ++ long haveCCAWatchdogCountMin; ++ ++} nPi, *pi = &nPi; ++ ++static avList_t piList; ++ ++/**************************************************************************** ++* dot11RegDomainsSupportedTable * ++****************************************************************************/ ++static struct rdTbl_data { ++ ++ char UID [ RD_UID_LEN + 1 ]; ++ char ifName [ IFNAME_LEN + 1 ]; ++ ++ long ifIndex; // ifindex of card ++ long regDomainsSupportIndex; ++ ++ long regDomainsSupportValue; ++ long haveRegDomainsSupportValue; ++ ++} nRd, *rd = &nRd; ++ ++static avList_t rdList; ++ ++/**************************************************************************** ++* dot11AntennasListTable * ++****************************************************************************/ ++static struct alTbl_data { ++ ++ char UID [ AL_UID_LEN + 1 ]; ++ char ifName [ IFNAME_LEN + 1 ]; ++ ++ long ifIndex; // ifindex of card ++ long antennaListIndex; ++ ++ long supportedTxAntenna; ++ long supportedRxAntenna; ++ long diversitySelectionRx ; ++ ++ long haveSupportedTxAntenna; ++ long haveSupportedRxAntenna; ++ long haveDiversitySelectionRx ; ++ ++} nAl, *al = &nAl; ++ ++static avList_t alList; ++ ++/**************************************************************************** ++* dot11SupportedDataRatesTxTable * ++****************************************************************************/ ++static struct rtTbl_data { ++ ++ char UID [ RT_UID_LEN + 1 ]; ++ char ifName [ IFNAME_LEN + 1 ]; ++ ++ long ifIndex; // ifindex of card ++ long supportedDataRatesTxIndex; ++ ++ long supportedDataRatesTxValue; ++ long haveSupportedDataRatesTxValue; ++ ++} nRt, *rt = &nRt; ++ ++static avList_t rtList; ++ ++/**************************************************************************** ++* dot11SupportedDataRatesRxTable * ++****************************************************************************/ ++static struct rrTbl_data { ++ ++ char UID [ RR_UID_LEN + 1 ]; ++ char ifName [ IFNAME_LEN + 1 ]; ++ ++ long ifIndex; // ifindex of card ++ long supportedDataRatesRxIndex; ++ ++ long supportedDataRatesRxValue; ++ long haveSupportedDataRatesRxValue; ++ ++} nRr, *rr = &nRr; ++ ++static avList_t rrList; ++ ++/**************************************************************************** ++* Wireless Extensions Structures * ++****************************************************************************/ ++static long wepCurrentKey; ++static long haveWepCurrentKey; ++static struct wepTbl_data { ++ ++ long len; ++ char key [ WEP_STR_LEN + 1 ]; ++ long haveKey; ++ ++} wep[4]; ++ ++/**************************************************************************** ++* * ++****************************************************************************/ ++config_require(util_funcs) ++ ++/* function prototypes */ ++ ++void init_ieee802dot11 ( void ); ++FindVarMethod var_ieee802dot11; ++FindVarMethod var_dot11StationConfigTable; ++FindVarMethod var_dot11AuthenticationAlgorithmsTable; ++FindVarMethod var_dot11WEPDefaultKeysTable; ++FindVarMethod var_dot11WEPKeyMappingsTable; ++FindVarMethod var_dot11PrivacyTable; ++FindVarMethod var_dot11OperationTable; ++FindVarMethod var_dot11CountersTable; ++FindVarMethod var_dot11GroupAddressesTable; ++FindVarMethod var_dot11ResourceInfoTable; ++FindVarMethod var_dot11PhyOperationTable; ++FindVarMethod var_dot11PhyAntennaTable; ++FindVarMethod var_dot11PhyTxPowerTable; ++FindVarMethod var_dot11PhyFHSSTable; ++FindVarMethod var_dot11PhyDSSSTable; ++FindVarMethod var_dot11PhyIRTable; ++FindVarMethod var_dot11RegDomainsSupportedTable; ++FindVarMethod var_dot11AntennasListTable; ++FindVarMethod var_dot11SupportedDataRatesTxTable; ++FindVarMethod var_dot11SupportedDataRatesRxTable; ++ ++WriteMethod write_dot11StationID; ++WriteMethod write_dot11MediumOccupancyLimit; ++WriteMethod write_dot11CFPPeriod; ++WriteMethod write_dot11CFPMaxDuration; ++WriteMethod write_dot11AuthenticationResponseTimeOut; ++WriteMethod write_dot11PowerManagementMode; ++WriteMethod write_dot11DesiredSSID; ++WriteMethod write_dot11DesiredBSSType; ++WriteMethod write_dot11OperationalRateSet; ++WriteMethod write_dot11BeaconPeriod; ++WriteMethod write_dot11DTIMPeriod; ++WriteMethod write_dot11AssociationResponseTimeOut; ++WriteMethod write_dot11AuthenticationAlgorithmsEnable; ++WriteMethod write_dot11WEPDefaultKeyValue; ++WriteMethod write_dot11WEPKeyMappingAddress; ++WriteMethod write_dot11WEPKeyMappingWEPOn; ++WriteMethod write_dot11WEPKeyMappingValue; ++WriteMethod write_dot11WEPKeyMappingStatus; ++WriteMethod write_dot11PrivacyInvoked; ++WriteMethod write_dot11WEPDefaultKeyID; ++WriteMethod write_dot11WEPKeyMappingLength; ++WriteMethod write_dot11ExcludeUnencrypted; ++WriteMethod write_dot11RTSThreshold; ++WriteMethod write_dot11ShortRetryLimit; ++WriteMethod write_dot11LongRetryLimit; ++WriteMethod write_dot11FragmentationThreshold; ++WriteMethod write_dot11MaxTransmitMSDULifetime; ++WriteMethod write_dot11MaxReceiveLifetime; ++WriteMethod write_dot11Address; ++WriteMethod write_dot11GroupAddressesStatus; ++WriteMethod write_dot11CurrentRegDomain; ++WriteMethod write_dot11CurrentTxAntenna; ++WriteMethod write_dot11CurrentRxAntenna; ++WriteMethod write_dot11CurrentTxPowerLevel; ++WriteMethod write_dot11CurrentChannelNumber; ++WriteMethod write_dot11CurrentDwellTime; ++WriteMethod write_dot11CurrentSet; ++WriteMethod write_dot11CurrentPattern; ++WriteMethod write_dot11CurrentIndex; ++WriteMethod write_dot11CurrentChannel; ++WriteMethod write_dot11CurrentCCAMode; ++WriteMethod write_dot11EDThreshold; ++WriteMethod write_dot11CCAWatchdogTimerMax; ++WriteMethod write_dot11CCAWatchdogCountMax; ++WriteMethod write_dot11CCAWatchdogTimerMin; ++WriteMethod write_dot11CCAWatchdogCountMin; ++WriteMethod write_dot11SupportedTxAntenna; ++WriteMethod write_dot11SupportedRxAntenna; ++WriteMethod write_dot11DiversitySelectionRx; ++ ++#endif /* _MIBGROUP_IEEE802DOT11_H */ +--- /dev/null ++++ b/agent/mibgroup/iwlib.h +@@ -0,0 +1,502 @@ ++/* ++ * Wireless Tools ++ * ++ * Jean II - HPLB 97->99 - HPL 99->02 ++ * ++ * Common header for the Wireless Extension library... ++ * ++ * This file is released under the GPL license. ++ * Copyright (c) 1997-2002 Jean Tourrilhes ++ */ ++ ++#ifndef IWLIB_H ++#define IWLIB_H ++ ++/*#include "CHANGELOG.h"*/ ++ ++/***************************** INCLUDES *****************************/ ++ ++/* Standard headers */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include /* gethostbyname, getnetbyname */ ++#include /* struct ether_addr */ ++#include /* struct timeval */ ++#include ++ ++/* This is our header selection. Try to hide the mess and the misery :-( ++ * Don't look, you would go blind ;-) */ ++ ++#ifndef LINUX_VERSION_CODE ++#include ++#endif ++ ++/* Kernel headers 2.4.X + Glibc 2.2 - Mandrake 8.0, Debian 2.3, RH 7.1 ++ * Kernel headers 2.2.X + Glibc 2.2 - Slackware 8.0 */ ++#if defined(__GLIBC__) \ ++ && __GLIBC__ == 2 \ ++ && __GLIBC_MINOR__ >= 2 \ ++ && LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) ++//#define GLIBC22_HEADERS ++#define GENERIC_HEADERS ++ ++/* Kernel headers 2.4.X + Glibc 2.1 - Debian 2.2 upgraded, RH 7.0 ++ * Kernel headers 2.2.X + Glibc 2.1 - Debian 2.2, RH 6.1 */ ++#elif defined(__GLIBC__) \ ++ && __GLIBC__ == 2 \ ++ && __GLIBC_MINOR__ == 1 \ ++ && LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) ++//#define GLIBC_HEADERS ++#define GENERIC_HEADERS ++ ++/* Kernel headers 2.2.X + Glibc 2.0 - Debian 2.1 */ ++#elif defined(__GLIBC__) \ ++ && __GLIBC__ == 2 \ ++ && __GLIBC_MINOR__ == 0 \ ++ && LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0) \ ++ && LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) ++#define GLIBC_HEADERS ++#define KLUDGE_HEADERS ++ ++/* Note : is it really worth supporting kernel 2.0.X, knowing that ++ * we require WE v9, which is only available in 2.2.X and higher ? ++ * I guess one could use 2.0.x with an upgraded wireless.h... */ ++ ++/* Kernel headers 2.0.X + Glibc 2.0 - Debian 2.0, RH 5 */ ++#elif defined(__GLIBC__) \ ++ && __GLIBC__ == 2 \ ++ && __GLIBC_MINOR__ == 0 \ ++ && LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) \ ++ && LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0) ++#define GLIBC_HEADERS ++ ++/* Kernel headers 2.0.X + libc5 - old systems */ ++#elif defined(_LINUX_C_LIB_VERSION_MAJOR) \ ++ && _LINUX_C_LIB_VERSION_MAJOR == 5 \ ++ && LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0) \ ++ && LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) ++#define LIBC5_HEADERS ++ ++/* Unsupported combination */ ++#else ++#error "Your kernel/libc combination is not supported" ++#endif ++ ++#ifdef GENERIC_HEADERS ++/* Proposed by Dr. Michael Rietz , 27.3.2 */ ++/* If this works for all, it might be more stable on the long term - Jean II */ ++#include /* For ARPHRD_ETHER */ ++#include /* For AF_INET & struct sockaddr */ ++#include /* For struct sockaddr_in */ ++#include ++#endif /* GENERIC_HEADERS */ ++ ++#ifdef GLIBC22_HEADERS ++/* Added by Ross G. Miller , 3/28/01 */ ++#include /* For ARPHRD_ETHER */ ++#include /* For AF_INET & struct sockaddr */ ++#include ++#endif /* GLIBC22_HEADERS */ ++ ++#ifdef KLUDGE_HEADERS ++#include ++#endif /* KLUDGE_HEADERS */ ++ ++#ifdef GLIBC_HEADERS ++#include /* For ARPHRD_ETHER */ ++#include /* For AF_INET & struct sockaddr */ ++#include /* For struct sockaddr_in */ ++#endif /* KLUDGE_HEADERS || GLIBC_HEADERS */ ++ ++#ifdef LIBC5_HEADERS ++#include /* For AF_INET & struct sockaddr & socket() */ ++#include /* For ARPHRD_ETHER */ ++#include /* For struct sockaddr_in */ ++#endif /* LIBC5_HEADERS */ ++ ++/* Those 3 headers were previously included in wireless.h */ ++#include /* for "caddr_t" et al */ ++#include /* for "struct sockaddr" et al */ ++#include /* for IFNAMSIZ and co... */ ++ ++#ifdef WEXT_HEADER ++/* Private copy of Wireless extensions */ ++#include WEXT_HEADER ++#else /* !WEXT_HEADER */ ++/* System wide Wireless extensions */ ++#include ++#endif /* !WEXT_HEADER */ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/****************************** DEBUG ******************************/ ++ ++ ++/************************ CONSTANTS & MACROS ************************/ ++ ++/* Paths */ ++#define PROC_NET_WIRELESS "/proc/net/wireless" ++#define PROC_NET_DEV "/proc/net/dev" ++ ++/* Some usefull constants */ ++#define KILO 1e3 ++#define MEGA 1e6 ++#define GIGA 1e9 ++/* For doing log10/exp10 without libm */ ++#define LOG10_MAGIC 1.25892541179 ++ ++/* Backward compatibility for Wireless Extension 9 */ ++#ifndef IW_POWER_MODIFIER ++#define IW_POWER_MODIFIER 0x000F /* Modify a parameter */ ++#define IW_POWER_MIN 0x0001 /* Value is a minimum */ ++#define IW_POWER_MAX 0x0002 /* Value is a maximum */ ++#define IW_POWER_RELATIVE 0x0004 /* Value is not in seconds/ms/us */ ++#endif /* IW_POWER_MODIFIER */ ++ ++#ifndef IW_ENCODE_NOKEY ++#define IW_ENCODE_NOKEY 0x0800 /* Key is write only, so not here */ ++#define IW_ENCODE_MODE 0xF000 /* Modes defined below */ ++#endif /* IW_ENCODE_NOKEY */ ++#ifndef IW_ENCODE_TEMP ++#define IW_ENCODE_TEMP 0x0400 /* Temporary key */ ++#endif /* IW_ENCODE_TEMP */ ++ ++/* More backward compatibility */ ++#ifndef SIOCSIWCOMMIT ++#define SIOCSIWCOMMIT SIOCSIWNAME ++#endif /* SIOCSIWCOMMIT */ ++ ++/****************************** TYPES ******************************/ ++ ++/* Shortcuts */ ++typedef struct iw_statistics iwstats; ++typedef struct iw_range iwrange; ++typedef struct iw_param iwparam; ++typedef struct iw_freq iwfreq; ++typedef struct iw_quality iwqual; ++typedef struct iw_priv_args iwprivargs; ++typedef struct sockaddr sockaddr; ++ ++/* Structure for storing all wireless information for each device ++ * This is pretty exhaustive... */ ++typedef struct wireless_info ++{ ++ char name[IFNAMSIZ + 1]; /* Wireless/protocol name */ ++ int has_nwid; ++ iwparam nwid; /* Network ID */ ++ int has_freq; ++ double freq; /* Frequency/channel */ ++ int has_sens; ++ iwparam sens; /* sensitivity */ ++ int has_key; ++ unsigned char key[IW_ENCODING_TOKEN_MAX]; /* Encoding key used */ ++ int key_size; /* Number of bytes */ ++ int key_flags; /* Various flags */ ++ int has_essid; ++ int essid_on; ++ char essid[IW_ESSID_MAX_SIZE + 1]; /* ESSID (extended network) */ ++ int has_nickname; ++ char nickname[IW_ESSID_MAX_SIZE + 1]; /* NickName */ ++ int has_ap_addr; ++ sockaddr ap_addr; /* Access point address */ ++ int has_bitrate; ++ iwparam bitrate; /* Bit rate in bps */ ++ int has_rts; ++ iwparam rts; /* RTS threshold in bytes */ ++ int has_frag; ++ iwparam frag; /* Fragmentation threshold in bytes */ ++ int has_mode; ++ int mode; /* Operation mode */ ++ int has_power; ++ iwparam power; /* Power management parameters */ ++ int has_txpower; ++ iwparam txpower; /* Transmit Power in dBm */ ++ int has_retry; ++ iwparam retry; /* Retry limit or lifetime */ ++ ++ /* Stats */ ++ iwstats stats; ++ int has_stats; ++ iwrange range; ++ int has_range; ++} wireless_info; ++ ++/* Structure for storing all wireless information for each device ++ * This is a cut down version of the one above, containing only ++ * the things *truly* needed to configure a card. ++ * Don't add other junk, I'll remove it... */ ++typedef struct wireless_config ++{ ++ char name[IFNAMSIZ + 1]; /* Wireless/protocol name */ ++ int has_nwid; ++ iwparam nwid; /* Network ID */ ++ int has_freq; ++ double freq; /* Frequency/channel */ ++ int has_key; ++ unsigned char key[IW_ENCODING_TOKEN_MAX]; /* Encoding key used */ ++ int key_size; /* Number of bytes */ ++ int key_flags; /* Various flags */ ++ int has_essid; ++ int essid_on; ++ char essid[IW_ESSID_MAX_SIZE + 1]; /* ESSID (extended network) */ ++ int has_mode; ++ int mode; /* Operation mode */ ++} wireless_config; ++ ++typedef struct stream_descr ++{ ++ char * end; /* End of the stream */ ++ char * current; /* Current event in stream of events */ ++ char * value; /* Current value in event */ ++} stream_descr; ++ ++/* Prototype for handling display of each single interface on the ++ * system - see iw_enum_devices() */ ++typedef int (*iw_enum_handler)(int skfd, ++ char * ifname, ++ char * args[], ++ int count); ++ ++/**************************** PROTOTYPES ****************************/ ++/* ++ * All the functions in iwcommon.c ++ */ ++ ++/* ---------------------- SOCKET SUBROUTINES -----------------------*/ ++int ++ iw_sockets_open(void); ++void ++ iw_enum_devices(int skfd, ++ iw_enum_handler fn, ++ char * args[], ++ int count); ++/* --------------------- WIRELESS SUBROUTINES ----------------------*/ ++int ++ iw_get_range_info(int skfd, ++ char * ifname, ++ iwrange * range); ++int ++ iw_print_version_info(char * toolname); ++int ++ iw_get_priv_info(int skfd, ++ char * ifname, ++ iwprivargs * priv, ++ int maxpriv); ++int ++ iw_get_basic_config(int skfd, ++ char * ifname, ++ wireless_config * info); ++int ++ iw_set_basic_config(int skfd, ++ char * ifname, ++ wireless_config * info); ++/* --------------------- PROTOCOL SUBROUTINES --------------------- */ ++int ++ iw_protocol_compare(char * protocol1, ++ char * protocol2); ++/* -------------------- FREQUENCY SUBROUTINES --------------------- */ ++void ++ iw_float2freq(double in, ++ iwfreq * out); ++double ++ iw_freq2float(iwfreq * in); ++void ++ iw_print_freq(char * buffer, ++ double freq); ++int ++ iw_freq_to_channel(double freq, ++ struct iw_range * range); ++void ++ iw_print_bitrate(char * buffer, ++ int bitrate); ++/* ---------------------- POWER SUBROUTINES ----------------------- */ ++int ++ iw_dbm2mwatt(int in); ++int ++ iw_mwatt2dbm(int in); ++/* -------------------- STATISTICS SUBROUTINES -------------------- */ ++int ++ iw_get_stats(int skfd, ++ char * ifname, ++ iwstats * stats); ++void ++ iw_print_stats(char * buffer, ++ iwqual * qual, ++ iwrange * range, ++ int has_range); ++/* --------------------- ENCODING SUBROUTINES --------------------- */ ++void ++ iw_print_key(char * buffer, ++ unsigned char * key, ++ int key_size, ++ int key_flags); ++int ++ iw_in_key(char * input, ++ unsigned char * key); ++int ++ iw_in_key_full(int skfd, ++ char * ifname, ++ char * input, ++ unsigned char * key, ++ __u16 * flags); ++/* ----------------- POWER MANAGEMENT SUBROUTINES ----------------- */ ++void ++ iw_print_pm_value(char * buffer, ++ int value, ++ int flags); ++void ++ iw_print_pm_mode(char * buffer, ++ int flags); ++/* --------------- RETRY LIMIT/LIFETIME SUBROUTINES --------------- */ ++#if WIRELESS_EXT > 10 ++void ++ iw_print_retry_value(char * buffer, ++ int value, ++ int flags); ++#endif ++/* ----------------------- TIME SUBROUTINES ----------------------- */ ++void ++ iw_print_timeval(char * buffer, ++ const struct timeval * time); ++/* --------------------- ADDRESS SUBROUTINES ---------------------- */ ++int ++ iw_check_mac_addr_type(int skfd, ++ char * ifname); ++int ++ iw_check_if_addr_type(int skfd, ++ char * ifname); ++#if 0 ++int ++ iw_check_addr_type(int skfd, ++ char * ifname); ++#endif ++void ++ iw_ether_ntop(const struct ether_addr* eth, char* buf); ++char* ++ iw_ether_ntoa(const struct ether_addr* eth); ++int ++ iw_ether_aton(const char* bufp, struct ether_addr* eth); ++int ++ iw_in_inet(char *bufp, struct sockaddr *sap); ++int ++ iw_in_addr(int skfd, ++ char * ifname, ++ char * bufp, ++ struct sockaddr * sap); ++/* ----------------------- MISC SUBROUTINES ------------------------ */ ++int ++ iw_get_priv_size(int args); ++ ++#if WIRELESS_EXT > 13 ++/* ---------------------- EVENT SUBROUTINES ---------------------- */ ++void ++ iw_init_event_stream(struct stream_descr * stream, ++ char * data, ++ int len); ++int ++ iw_extract_event_stream(struct stream_descr * stream, ++ struct iw_event * iwe); ++#endif /* WIRELESS_EXT > 13 */ ++ ++/**************************** VARIABLES ****************************/ ++ ++extern const char * const iw_operation_mode[]; ++#define IW_NUM_OPER_MODE 7 ++ ++/************************* INLINE FUNTIONS *************************/ ++/* ++ * Functions that are so simple that it's more efficient inlining them ++ */ ++ ++/* ++ * Note : I've defined wrapper for the ioctl request so that ++ * it will be easier to migrate to other kernel API if needed ++ */ ++ ++/*------------------------------------------------------------------*/ ++/* ++ * Wrapper to push some Wireless Parameter in the driver ++ */ ++static inline int ++iw_set_ext(int skfd, /* Socket to the kernel */ ++ char * ifname, /* Device name */ ++ int request, /* WE ID */ ++ struct iwreq * pwrq) /* Fixed part of the request */ ++{ ++ /* Set device name */ ++ strncpy(pwrq->ifr_name, ifname, IFNAMSIZ); ++ /* Do the request */ ++ return(ioctl(skfd, request, pwrq)); ++} ++ ++/*------------------------------------------------------------------*/ ++/* ++ * Wrapper to extract some Wireless Parameter out of the driver ++ */ ++static inline int ++iw_get_ext(int skfd, /* Socket to the kernel */ ++ char * ifname, /* Device name */ ++ int request, /* WE ID */ ++ struct iwreq * pwrq) /* Fixed part of the request */ ++{ ++ /* Set device name */ ++ strncpy(pwrq->ifr_name, ifname, IFNAMSIZ); ++ /* Do the request */ ++ return(ioctl(skfd, request, pwrq)); ++} ++ ++/*------------------------------------------------------------------*/ ++/* Backwards compatability ++ * Actually, those form are much easier to use when dealing with ++ * struct sockaddr... */ ++static inline char* ++iw_pr_ether(char* bufp, const unsigned char* addr) ++{ ++ iw_ether_ntop((const struct ether_addr *) addr, bufp); ++ return bufp; ++} ++/* Backwards compatability */ ++static inline int ++iw_in_ether(const char *bufp, struct sockaddr *sap) ++{ ++ sap->sa_family = ARPHRD_ETHER; ++ return iw_ether_aton(bufp, (struct ether_addr *) sap->sa_data) ? 0 : -1; ++} ++ ++/*------------------------------------------------------------------*/ ++/* ++ * Create an Ethernet broadcast address ++ */ ++static inline void ++iw_broad_ether(struct sockaddr *sap) ++{ ++ sap->sa_family = ARPHRD_ETHER; ++ memset((char *) sap->sa_data, 0xFF, ETH_ALEN); ++} ++ ++/*------------------------------------------------------------------*/ ++/* ++ * Create an Ethernet NULL address ++ */ ++static inline void ++iw_null_ether(struct sockaddr *sap) ++{ ++ sap->sa_family = ARPHRD_ETHER; ++ memset((char *) sap->sa_data, 0x00, ETH_ALEN); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* IWLIB_H */ diff --git a/net/net-tools/Makefile b/net/net-tools/Makefile new file mode 100644 index 0000000..0efc6f2 --- /dev/null +++ b/net/net-tools/Makefile @@ -0,0 +1,324 @@ +# +# Copyright (C) 2006 - 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=net-tools +PKG_VERSION:=1.60 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.tazenda.demon.co.uk/phil/net-tools/ +PKG_MD5SUM:=888774accab40217dde927e21979c165 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/net-tools-arp + SECTION:=net + CATEGORY:=Network + TITLE:=net-tools - arp + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-arp/description + Program arp from net-tools. Manipulate kernel's ARP cache. + Add, delete an entry, or to dump the entire cache. +endef + +define Package/net-tools-dnsdomainname + SECTION:=net + CATEGORY:=Network + DEPENDS += net-tools-hostname + TITLE:=net-tools - dnsdomainname + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-dnsdomainname/description + Program dnsdomainname from net-tools. + Reports the system's DNS domain name. +endef + +define Package/net-tools-domainname + SECTION:=net + CATEGORY:=Network + DEPENDS += net-tools-hostname + TITLE:=net-tools - domainname + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-domainname/description + Program domainname from net-tools. + Reports the system's NIS/YP domain name. +endef + +define Package/net-tools-hostname + SECTION:=net + CATEGORY:=Network + TITLE:=net-tools - hostname + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-hostname/description + Program hostname from net-tools. + Reports or sets the name of the current host system. +endef + +define Package/net-tools-ifconfig + SECTION:=net + CATEGORY:=Network + TITLE:=net-tools - ifconfig + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-ifconfig/description + Program ifconfig from net-tools. + Configure network interfaces. +endef + +define Package/net-tools-ipmaddr + SECTION:=net + CATEGORY:=Network + TITLE:=net-tools - ipmaddr + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-ipmaddr/description + Program ipmaddr from net-tools. Adds, + deletes and shows an interface's multicast addresses. +endef + +define Package/net-tools-iptunnel + SECTION:=net + CATEGORY:=Network + TITLE:=net-tools - iptunnel + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-iptunnel/description + Program iptunnel from net-tools. + Adds, changes, deletes and shows an interface's tunnels. +endef + +define Package/net-tools-mii-tool + SECTION:=net + CATEGORY:=Network + TITLE:=net-tools - mii-tool + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-mii-tool/description + Program mii-tool from net-tools. Checks or sets + the status of a network interface's Media Independent + Interface (MII) unit. +endef + +define Package/net-tools-nameif + SECTION:=net + CATEGORY:=Network + TITLE:=net-tools - nameif + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-nameif/description + Program nameif from net-tools + Trivial File Transfer Protocol server. +endef + +define Package/net-tools-netstat + SECTION:=net + CATEGORY:=Network + TITLE:=net-tools - netstat + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-netstat/description + Program netstat from net-tools. Report network + connections, routing tables, and interface statistics. +endef + +define Package/net-tools-nisdomainname + SECTION:=net + CATEGORY:=Network + DEPENDS += net-tools-hostname + TITLE:=net-tools - nisdomainname + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-nisdomainname/description + Program nisdomainname from net-tools. + Same as domainname. +endef + +define Package/net-tools-plipconfig + SECTION:=net + CATEGORY:=Network + TITLE:=net-tools - plipconfig + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-plipconfig/description + Program plipconfig from net-tools. Fine tune the + PLIP device parameters, to improve its performance. +endef + +define Package/net-tools-rarp + SECTION:=net + CATEGORY:=Network + TITLE:=net-tools - rarp + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-rarp/description + Program rarp from net-tools. + Manipulate the kernel's RARP table. +endef + +define Package/net-tools-route + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE:=net-tools - route + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-route/description + Program route from net-tools. + Manipulate the IP routing table. +endef + +define Package/net-tools-slattach + SECTION:=net + CATEGORY:=Network + TITLE:=net-tools - slattach + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-slattach/description + Program slattach from net-tools. Attaches a + network interface to a serial line. This allows + to use normal terminal lines for point-to-point + links to other computers. +endef + +define Package/net-tools-ypdomainname + SECTION:=net + CATEGORY:=Network + DEPENDS += net-tools-hostname + TITLE:=net-tools - ypdomainname + URL:=http://www.tazenda.demon.co.uk/phil/net-tools +endef + +define Package/net-tools-ypdomainname/description + Program route from net-tools. + Same as domainname. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + AR="$(TARGET_CROSS)ar" \ + COPTS="$(TARGET_CFLAGS)" +endef + +define Package/net-tools-arp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/arp $(1)/usr/bin/ +endef + +define Package/net-tools-dnsdomainname/install + $(INSTALL_DIR) $(1)/usr/bin + ln -sf hostname $(1)/usr/bin/dnsdomainname +endef + +define Package/net-tools-domainname/install + $(INSTALL_DIR) $(1)/usr/bin + ln -sf hostname $(1)/usr/bin/domainname +endef + +define Package/net-tools-hostname/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostname $(1)/usr/bin/ +endef + +define Package/net-tools-ifconfig/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ifconfig $(1)/usr/sbin/ +endef + +define Package/net-tools-ipmaddr/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ipmaddr $(1)/usr/bin/ +endef + +define Package/net-tools-iptunnel/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/iptunnel $(1)/usr/bin/ +endef + +define Package/net-tools-mii-tool/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mii-tool $(1)/usr/bin/ +endef + +define Package/net-tools-nameif/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/nameif $(1)/usr/bin/ +endef + +define Package/net-tools-netstat/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/netstat $(1)/usr/bin/ +endef + +define Package/net-tools-nisdomainname/install + $(INSTALL_DIR) $(1)/usr/bin + ln -sf hostname $(1)/usr/bin/nisdomainname +endef + +define Package/net-tools-plipconfig/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/plipconfig $(1)/usr/bin/ +endef + +define Package/net-tools-rarp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/rarp $(1)/usr/bin/ +endef + +define Package/net-tools-route/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/route $(1)/usr/bin/ +endef + +define Package/net-tools-slattach/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/slattach $(1)/usr/bin/ +endef + +define Package/net-tools-ypdomainname/install + $(INSTALL_DIR) $(1)/usr/bin + ln -sf hostname $(1)/usr/bin/ypdomainname +endef + +$(eval $(call BuildPackage,net-tools-arp)) +$(eval $(call BuildPackage,net-tools-hostname)) +$(eval $(call BuildPackage,net-tools-dnsdomainname)) +$(eval $(call BuildPackage,net-tools-domainname)) +$(eval $(call BuildPackage,net-tools-ifconfig)) +$(eval $(call BuildPackage,net-tools-ipmaddr)) +$(eval $(call BuildPackage,net-tools-iptunnel)) +$(eval $(call BuildPackage,net-tools-mii-tool)) +$(eval $(call BuildPackage,net-tools-nameif)) +$(eval $(call BuildPackage,net-tools-netstat)) +$(eval $(call BuildPackage,net-tools-nisdomainname)) +$(eval $(call BuildPackage,net-tools-plipconfig)) +$(eval $(call BuildPackage,net-tools-rarp)) +$(eval $(call BuildPackage,net-tools-route)) +$(eval $(call BuildPackage,net-tools-slattach)) +$(eval $(call BuildPackage,net-tools-ypdomainname)) diff --git a/net/net-tools/patches/001-config.patch b/net/net-tools/patches/001-config.patch new file mode 100644 index 0000000..04760fb --- /dev/null +++ b/net/net-tools/patches/001-config.patch @@ -0,0 +1,209 @@ +--- /dev/null 2006-11-02 13:38:16.000000000 +0100 ++++ net-tools-1.60.works/config.make 2007-01-14 04:43:34.000000000 +0100 +@@ -0,0 +1,35 @@ ++# I18N=0 ++HAVE_AFUNIX=1 ++HAVE_AFINET=1 ++HAVE_AFINET6=1 ++# HAVE_AFIPX=0 ++# HAVE_AFATALK=0 ++# HAVE_AFAX25=0 ++# HAVE_AFNETROM=0 ++# HAVE_AFROSE=0 ++# HAVE_AFX25=0 ++# HAVE_AFECONET=0 ++# HAVE_AFDECnet=0 ++# HAVE_AFASH=0 ++HAVE_HWETHER=1 ++# HAVE_HWARC=0 ++# HAVE_HWSLIP=0 ++HAVE_HWPPP=1 ++HAVE_HWTUNNEL=1 ++# HAVE_HWSTRIP=0 ++# HAVE_HWTR=0 ++# HAVE_HWAX25=0 ++# HAVE_HWROSE=0 ++# HAVE_HWNETROM=0 ++# HAVE_HWX25=0 ++# HAVE_HWFR=0 ++# HAVE_HWSIT=0 ++# HAVE_HWFDDI=0 ++# HAVE_HWHIPPI=0 ++# HAVE_HWASH=0 ++# HAVE_HWHDLCLAPB=0 ++# HAVE_HWIRDA=0 ++# HAVE_HWEC=0 ++HAVE_FW_MASQUERADE=1 ++HAVE_IP_TOOLS=1 ++HAVE_MII=1 +--- /dev/null 2006-11-02 13:38:16.000000000 +0100 ++++ net-tools-1.60.works/config.status 2007-01-14 04:43:34.000000000 +0100 +@@ -0,0 +1,91 @@ ++# ++# config.in Configure.sh source for the net-tools. ++# This file contains the definition of what the support ++# library contains. Most of all, it defines which types ++# of address families and hardware we know of. ++# ++# NET-TOOLS A collection of programs that form the base set of the ++# NET-3 Networking Distribution for the LINUX operating ++# system. ++# ++# Version: config.in 1.22 (99-04-19) ++# ++# Author: Fred N. van Kempen, ++# Copyright 1988-1993 MicroWalt Corporation ++# ++# Bernd 'eckes' Eckenfels ++# Arnaldo Carvalho de Melo ++# GNU gettext - I18N ++# ++# This program is free software; you can redistribute it ++# and/or modify it under the terms of the GNU General ++# Public License as published by the Free Software ++# Foundation; either version 2 of the License, or (at ++# your option) any later version. ++# ++= /* ++= * config.h Automatically generated configuration includefile ++= * ++= * NET-TOOLS A collection of programs that form the base set of the ++= * NET-3 Networking Distribution for the LINUX operating ++= * system. ++= * ++= * DO NOT EDIT DIRECTLY ++= * ++= */ ++* ++* ++* Internationalization ++* ++* The net-tools package has currently been translated to French, ++* German and Brazilian Portugese. Other translations are, of ++* course, welcome. Answer `n' here if you have no support for ++* internationalization on your system. ++* ++bool 'Does your system support GNU gettext?' I18N n ++* ++* ++* Protocol Families. ++* ++bool 'UNIX protocol family' HAVE_AFUNIX y ++bool 'INET (TCP/IP) protocol family' HAVE_AFINET y ++bool 'INET6 (IPv6) protocol family' HAVE_AFINET6 n ++bool 'Novell IPX/SPX protocol family' HAVE_AFIPX n ++bool 'Appletalk DDP protocol family' HAVE_AFATALK n ++bool 'AX25 (packet radio) protocol family' HAVE_AFAX25 n ++bool 'NET/ROM (packet radio) protocol family' HAVE_AFNETROM n ++bool 'Rose (packet radio) protocol family' HAVE_AFROSE n ++bool 'X.25 (CCITT) protocol family' HAVE_AFX25 n ++bool 'Econet protocol family' HAVE_AFECONET n ++bool 'DECnet protocol family' HAVE_AFDECnet n ++bool 'Ash protocol family' HAVE_AFASH n ++* ++* ++* Device Hardware types. ++* ++bool 'Ethernet (generic) support' HAVE_HWETHER y ++bool 'ARCnet support' HAVE_HWARC n ++bool 'SLIP (serial line) support' HAVE_HWSLIP n ++bool 'PPP (serial line) support' HAVE_HWPPP y ++bool 'IPIP Tunnel support' HAVE_HWTUNNEL y ++bool 'STRIP (Metricom radio) support' HAVE_HWSTRIP n ++bool 'Token ring (generic) support' HAVE_HWTR n ++bool 'AX25 (packet radio) support' HAVE_HWAX25 n ++bool 'Rose (packet radio) support' HAVE_HWROSE n ++bool 'NET/ROM (packet radio) support' HAVE_HWNETROM n ++bool 'X.25 (generic) support' HAVE_HWX25 n ++bool 'DLCI/FRAD (frame relay) support' HAVE_HWFR n ++bool 'SIT (IPv6-in-IPv4) support' HAVE_HWSIT n ++bool 'FDDI (generic) support' HAVE_HWFDDI n ++bool 'HIPPI (generic) support' HAVE_HWHIPPI n ++bool 'Ash hardware support' HAVE_HWASH n ++bool '(Cisco)-HDLC/LAPB support' HAVE_HWHDLCLAPB n ++bool 'IrDA support' HAVE_HWIRDA n ++bool 'Econet hardware support' HAVE_HWEC n ++* ++* ++* Other Features. ++* ++bool 'IP Masquerading support' HAVE_FW_MASQUERADE y ++bool 'Build iptunnel and ipmaddr' HAVE_IP_TOOLS y ++bool 'Build mii-tool' HAVE_MII y +--- /dev/null 2006-11-02 13:38:16.000000000 +0100 ++++ net-tools-1.60.works/config.h 2007-01-14 04:43:34.000000000 +0100 +@@ -0,0 +1,74 @@ ++/* ++* config.h Automatically generated configuration includefile ++* ++* NET-TOOLS A collection of programs that form the base set of the ++* NET-3 Networking Distribution for the LINUX operating ++* system. ++* ++* DO NOT EDIT DIRECTLY ++* ++*/ ++ ++/* ++ * ++ * Internationalization ++ * ++ * The net-tools package has currently been translated to French, ++ * German and Brazilian Portugese. Other translations are, of ++ * course, welcome. Answer `n' here if you have no support for ++ * internationalization on your system. ++ * ++ */ ++#define I18N 0 ++ ++/* ++ * ++ * Protocol Families. ++ * ++ */ ++#define HAVE_AFUNIX 1 ++#define HAVE_AFINET 1 ++#define HAVE_AFINET6 1 ++#define HAVE_AFIPX 0 ++#define HAVE_AFATALK 0 ++#define HAVE_AFAX25 0 ++#define HAVE_AFNETROM 0 ++#define HAVE_AFROSE 0 ++#define HAVE_AFX25 0 ++#define HAVE_AFECONET 0 ++#define HAVE_AFDECnet 0 ++#define HAVE_AFASH 0 ++ ++/* ++ * ++ * Device Hardware types. ++ * ++ */ ++#define HAVE_HWETHER 1 ++#define HAVE_HWARC 0 ++#define HAVE_HWSLIP 0 ++#define HAVE_HWPPP 1 ++#define HAVE_HWTUNNEL 1 ++#define HAVE_HWSTRIP 0 ++#define HAVE_HWTR 0 ++#define HAVE_HWAX25 0 ++#define HAVE_HWROSE 0 ++#define HAVE_HWNETROM 0 ++#define HAVE_HWX25 0 ++#define HAVE_HWFR 0 ++#define HAVE_HWSIT 0 ++#define HAVE_HWFDDI 0 ++#define HAVE_HWHIPPI 0 ++#define HAVE_HWASH 0 ++#define HAVE_HWHDLCLAPB 0 ++#define HAVE_HWIRDA 0 ++#define HAVE_HWEC 0 ++ ++/* ++ * ++ * Other Features. ++ * ++ */ ++#define HAVE_FW_MASQUERADE 1 ++#define HAVE_IP_TOOLS 1 ++#define HAVE_MII 1 diff --git a/net/net-tools/patches/002-compile-fixes.patch b/net/net-tools/patches/002-compile-fixes.patch new file mode 100644 index 0000000..a72bf3e --- /dev/null +++ b/net/net-tools/patches/002-compile-fixes.patch @@ -0,0 +1,74 @@ +--- net-tools-1.60/lib/inet_sr.c 2000-02-20 22:46:45.000000000 +0100 ++++ net-tools-1.60.works/lib/inet_sr.c 2007-01-14 04:44:40.000000000 +0100 +@@ -105,6 +105,7 @@ + case 2: + isnet = 0; break; + default: ++ break; + } + + /* Fill in the other fields. */ +--- net-tools-1.60/hostname.c 2001-04-08 19:04:23.000000000 +0200 ++++ net-tools-1.60.works/hostname.c 2007-01-14 04:46:09.000000000 +0100 +@@ -98,6 +98,7 @@ + fprintf(stderr, _("%s: name too long\n"), program_name); + break; + default: ++ break; + } + exit(1); + }; +@@ -117,6 +118,7 @@ + fprintf(stderr, _("%s: name too long\n"), program_name); + break; + default: ++ break; + } + exit(1); + }; +@@ -174,6 +176,7 @@ + printf("%s\n", hp->h_name); + break; + default: ++ break; + } + } + +@@ -330,7 +333,7 @@ + case 'h': + default: + usage(); +- ++ break; + }; + + +--- net-tools-1.60/mii-tool.c 2000-05-21 16:31:17.000000000 +0200 ++++ net-tools-1.60.works/mii-tool.c 2007-01-14 04:47:42.000000000 +0100 +@@ -379,16 +379,16 @@ + /*--------------------------------------------------------------------*/ + + const char *usage = +-"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...] +- -V, --version display version information +- -v, --verbose more verbose output +- -R, --reset reset MII to poweron state +- -r, --restart restart autonegotiation +- -w, --watch monitor for link status changes +- -l, --log with -w, write events to syslog +- -A, --advertise=media,... advertise only specified media +- -F, --force=media force specified media technology +-media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD, ++"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\n\ ++ -V, --version display version information\n\ ++ -v, --verbose more verbose output\n\ ++ -R, --reset reset MII to poweron state\n\ ++ -r, --restart restart autonegotiation\n\ ++ -w, --watch monitor for link status changes\n\ ++ -l, --log with -w, write events to syslog\n\ ++ -A, --advertise=media,... advertise only specified media\n\ ++ -F, --force=media force specified media technology\n\ ++media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,\n\ + (to advertise both HD and FD) 100baseTx, 10baseT\n"; + + int main(int argc, char **argv) diff --git a/net/netatalk/Makefile b/net/netatalk/Makefile new file mode 100644 index 0000000..60c106b --- /dev/null +++ b/net/netatalk/Makefile @@ -0,0 +1,84 @@ +# +# Copyright (C) 2009-2012 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:=netatalk +PKG_VERSION:=2.2.1 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/netatalk +PKG_MD5SUM:=4a371025daf96adb73fa491efdbfef28 + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/netatalk + SECTION:=net + CATEGORY:=Network + SUBMENU:=Filesystem + DEPENDS:=+libdb47 +libgcrypt +libopenssl $(LIBRPC_DEPENDS) + TITLE:=netatalk + URL:=http://netatalk.sourceforge.net + MAINTAINER:=W. Michael Petullo +endef + +define Package/netatalk/decription + Netatalk is a freely-available Open Source AFP fileserver. + It also provides a kernel level implementation of the AppleTalk + Protocol Suite. +endef + +define Package/netatalk/conffiles +/etc/netatalk/afpd.conf +endef + +TARGET_CFLAGS += -std=gnu99 -Wl,-rpath-link=$(STAGING_DIR)/usr/lib +TARGET_LDFLAGS += $(LIBRPC) + +CONFIGURE_ARGS += \ + --disable-afs \ + --enable-hfs \ + --disable-debugging \ + --disable-shell-check \ + --disable-timelord \ + --disable-a2boot \ + --disable-cups \ + --disable-tcp-wrappers \ + --with-cnid-default-backend=dbd \ + --with-bdb="$(STAGING_DIR)/usr/" \ + --with-libgcrypt-dir="$(STAGING_DIR)/usr" \ + --with-ssl-dir="$(STAGING_DIR)/usr" \ + --with-uams-path="/usr/lib/uams" \ + --disable-admin-group \ + --disable-srvloc \ + --disable-zeroconf \ + --without-shadow \ + --without-ldap + +define Package/netatalk/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/lib/uams + $(INSTALL_DIR) $(1)/etc/netatalk + $(INSTALL_DIR) $(1)/etc/init.d + $(CP) $(PKG_INSTALL_DIR)/usr/bin/afppasswd $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/afpd $(1)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_dbd $(1)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_metad $(1)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/uams/*.so $(1)/usr/lib/uams/ + $(CP) ./files/AppleVolumes.default $(1)/etc/netatalk/ + $(CP) $(PKG_INSTALL_DIR)/etc/netatalk/AppleVolumes.system $(1)/etc/netatalk/ + $(INSTALL_CONF) ./files/afpd.conf $(1)/etc/netatalk/ + $(INSTALL_BIN) ./files/afpd.init $(1)/etc/init.d/afpd +endef + +$(eval $(call BuildPackage,netatalk)) diff --git a/net/netatalk/files/AppleVolumes.default b/net/netatalk/files/AppleVolumes.default new file mode 100644 index 0000000..5835163 --- /dev/null +++ b/net/netatalk/files/AppleVolumes.default @@ -0,0 +1,2 @@ +- +/tmp Temp allow:root,nobody cnidscheme:dbd diff --git a/net/netatalk/files/afpd.conf b/net/netatalk/files/afpd.conf new file mode 100644 index 0000000..097e954 --- /dev/null +++ b/net/netatalk/files/afpd.conf @@ -0,0 +1 @@ +- -noddp -uampath /usr/lib/uams -uamlist uams_guest.so,uams_passwd.so,uams_dhx_passwd.so,uams_randnum.so,uams_dhx2.so -passwdfile /etc/netatalk/afppasswd -savepassword -passwdminlen 0 -nosetpassword -defaultvol /etc/netatalk/AppleVolumes.default -systemvol /etc/netatalk/AppleVolumes.system -nouservol -guestname "nobody" -sleep 1 -icon diff --git a/net/netatalk/files/afpd.init b/net/netatalk/files/afpd.init new file mode 100644 index 0000000..8b13339 --- /dev/null +++ b/net/netatalk/files/afpd.init @@ -0,0 +1,23 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2012 OpenWrt.org + +START=70 + +MAXCONS="7" + +start() +{ + service_start /usr/sbin/cnid_metad + service_start /usr/sbin/afpd -c ${MAXCONS} +} + +stop() +{ + service_stop /usr/sbin/afpd + service_stop /usr/sbin/cnid_metad +} + +reload() +{ + service_reload /usr/sbin/afpd +} diff --git a/net/netatalk/patches/001-automake-compat.patch b/net/netatalk/patches/001-automake-compat.patch new file mode 100644 index 0000000..e56b086 --- /dev/null +++ b/net/netatalk/patches/001-automake-compat.patch @@ -0,0 +1,9 @@ +--- a/macros/iconv.m4 ++++ b/macros/iconv.m4 +@@ -114,6 +114,5 @@ int main() { + + CFLAGS="$savedcflags" + LDFLAGS="$savedldflags" +- CPPFLAGS="$saved_CPPFLAGS" + + ]) diff --git a/net/netcat/Makefile b/net/netcat/Makefile new file mode 100644 index 0000000..b2e95ca --- /dev/null +++ b/net/netcat/Makefile @@ -0,0 +1,57 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=netcat +PKG_VERSION:=0.7.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=0a29eff1736ddb5effd0b1ec1f6fe0ef + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/netcat + SECTION:=net + CATEGORY:=Network + TITLE:=A feature-rich network debugging and exploration tool. + URL:=http://netcat.sourceforge.net/ +endef + +define Package/netcat/description + Netcat is a featured networking utility which reads and writes data across network connections, using the TCP/IP protocol. + It is designed to be a reliable "back-end" tool that can be used directly or easily driven by other programs and scripts. At the same time, it is a feature-rich network debugging and exploration tool, since it can create almost any kind of connection you would need and has several interesting built-in capabilities. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-rpath \ + --with-included-getopt \ + ) +endef + +define Package/netcat/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/netcat \ + $(1)/usr/bin +endef + +define Package/netcat/postinst +#!/bin/sh +if [ -e $${IPKG_INSTROOT}/usr/bin/nc ]; then + rm -rf $${IPKG_INSTROOT}/usr/bin/nc; +fi +ln -s ./netcat $${IPKG_INSTROOT}/usr/bin/nc +endef + +define Package/netcat/postrm +#!/bin/sh +rm $${IPKG_INSTROOT}/usr/bin/nc +ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/nc +$${IPKG_INSTROOT}/usr/bin/nc 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/nc +exit 0 +endef + + +$(eval $(call BuildPackage,netcat)) diff --git a/net/netcat/patches/001-netcat_flag_count.patch b/net/netcat/patches/001-netcat_flag_count.patch new file mode 100644 index 0000000..44ee9e1 --- /dev/null +++ b/net/netcat/patches/001-netcat_flag_count.patch @@ -0,0 +1,22 @@ +Index: netcat-0.7.1/src/flagset.c +=================================================================== +--- netcat-0.7.1.orig/src/flagset.c 2009-02-06 19:56:01.000000000 +0100 ++++ netcat-0.7.1/src/flagset.c 2009-02-06 19:56:13.000000000 +0100 +@@ -134,7 +134,7 @@ + + int netcat_flag_count(void) + { +- register char c; ++ register unsigned char c; + register int i; + int ret = 0; + +@@ -154,7 +154,7 @@ + Assumed that the bit number 1 is the sign, and that we will shift the + bit 1 (or the bit that takes its place later) until the the most right, + WHY it has to keep the wrong sign? */ +- ret -= (c >> 7); ++ ret += (c >> 7); + c <<= 1; + } + } diff --git a/net/netdiscover/Makefile b/net/netdiscover/Makefile new file mode 100644 index 0000000..f22c8a5 --- /dev/null +++ b/net/netdiscover/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=netdiscover +PKG_VERSION:=0.3-beta6 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://nixgeneration.com/~jaime/netdiscover/releases/ +PKG_MD5SUM:=0919227a91ecaeeb2443cff249417be2 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/netdiscover + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +libnet1 +libpthread + TITLE:=An active/passive address reconnaissance tool + URL:=http://nixgeneration.com/~jaime/netdiscover/ + MAINTAINER:=Daniel Dickinson +endef + +CONFIGURE_VARS+= \ + CPPFLAGS="$(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/lib/libnet-1.1.x/include" \ + LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib/libnet-1.1.x/lib" \ + +define Package/netdiscover/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/netdiscover $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,netdiscover)) diff --git a/net/netdiscover/patches/00-add-machine-ouput.patch b/net/netdiscover/patches/00-add-machine-ouput.patch new file mode 100644 index 0000000..eed7f0f --- /dev/null +++ b/net/netdiscover/patches/00-add-machine-ouput.patch @@ -0,0 +1,467 @@ +diff -Naur netdiscover-0.3-beta6.orig/src/ifaces.c netdiscover-0.3-beta6/src/ifaces.c +--- netdiscover-0.3-beta6.orig/src/ifaces.c 2009-06-24 18:21:11.000000000 -0400 ++++ netdiscover-0.3-beta6/src/ifaces.c 2009-06-24 21:44:05.000000000 -0400 +@@ -127,6 +127,7 @@ + memcpy(type, packet + 20, 2); /* ARP Opcode */ + new_arprep_l->header = new_header; /* Add header */ + new_arprep_l->count = 1; /* Count */ ++ new_arprep_l->printed = 0; + new_arprep_l->next = NULL; + + /* Source IP */ +diff -Naur netdiscover-0.3-beta6.orig/src/main.c netdiscover-0.3-beta6/src/main.c +--- netdiscover-0.3-beta6.orig/src/main.c 2009-06-24 18:21:11.000000000 -0400 ++++ netdiscover-0.3-beta6/src/main.c 2009-06-24 21:34:59.000000000 -0400 +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include "ifaces.h" + #include "screen.h" + +@@ -39,8 +40,17 @@ + char *disp; + char *sip; + int autos; ++ int machine; + }; + ++/* Injection Thread data structure */ ++struct t_inject { ++ struct t_data *datos; ++ pthread_t *sniffer; ++ pthread_t *screen; ++ pthread_t *keys; ++ int scan_secs; ++}; + + void *inject_arp(void *arg); + void *screen_refresh(void *arg); +@@ -77,7 +87,7 @@ + + + pthread_t injection, sniffer, screen, keys; +-int fastmode, pcount, node, ssleep; ++int fastmode, pcount, node, ssleep, nokeywait; + long sleept; + + +@@ -86,7 +96,9 @@ + { + while ( 1 == 1 ) + { +- read_key(); ++ struct t_data *datos; ++ datos = (struct t_data *)arg; ++ read_key(datos->machine); + } + } + +@@ -97,20 +109,24 @@ + int c; + int esniff = 0; + int erange = 0; ++ int scan_secs = 0; + struct t_data datos; +- ++ struct t_inject injectdata; ++ + datos.sip = NULL; + datos.disp = NULL; ++ datos.machine = 0; + datos.autos = 0; + sleept = 99; + node = 67; + pcount = 1; ++ nokeywait = 0; + + current_network = (char *) malloc ((sizeof(char)) * 16); + sprintf(current_network,"Starting."); + + /* Fetch parameters */ +- while ((c = getopt(argc, argv, "i:s:r:n:c:pSfh")) != EOF) ++ while ((c = getopt(argc, argv, "i:s:r:n:c:t:pSfhkm")) != EOF) + { + switch (c) + { +@@ -138,12 +154,20 @@ + case 'n': + node = atoi(optarg); + break; ++ ++ case 't': ++ scan_secs = atoi(optarg); ++ break; + + case 'r': + datos.sip = (char *) malloc (sizeof(char) * strlen(optarg)); + sprintf(datos.sip, "%s", optarg); + erange = 1; + break; ++ ++ case 'm': ++ datos.machine = 1; ++ break; + + case 'f': + fastmode = 1; +@@ -153,6 +177,10 @@ + usage(argv[0]); + exit(1); + break; ++ ++ case 'k': ++ nokeywait = 1; ++ break; + + default: + break; +@@ -181,7 +209,7 @@ + /* Init some stuff */ + lnet_init(datos.disp); + init_lists(); +- system("clear"); ++ if (!datos.machine) system("clear"); + + /* If no mode was selected, enable auto scan */ + if ((erange != 1) && (esniff != 1)) +@@ -189,9 +217,15 @@ + datos.autos = 1; + } + ++ + /* Start the execution */ +- pthread_create(&screen, NULL, screen_refresh, (void *)NULL); +- pthread_create(&keys, NULL, keys_thread, (void *)NULL); ++ pthread_create(&screen, NULL, screen_refresh, (void *)&datos); ++ if (!nokeywait) { ++ pthread_create(&keys, NULL, keys_thread, (void *)&datos); ++ injectdata.keys = &keys; ++ } else { ++ injectdata.keys = NULL; ++ } + pthread_create(&sniffer, NULL, start_sniffer, (void *)&datos); + + if (esniff == 1) +@@ -201,10 +235,19 @@ + } + else + { +- if (pthread_create(&injection, NULL, inject_arp, (void *)&datos)) ++ injectdata.datos = &datos; ++ injectdata.sniffer = &sniffer; ++ injectdata.screen = &screen; ++ injectdata.scan_secs = scan_secs; ++ ++ if (pthread_create(&injection, NULL, inject_arp, (void *)&injectdata)) + perror("Could not create injection thread"); + +- pthread_join(sniffer,NULL); ++ if (scan_secs > 0) { ++ pthread_join(injection,NULL); ++ } else { ++ pthread_join(sniffer,NULL); ++ } + } + + +@@ -215,10 +258,11 @@ + /* Refresh screen function called by screen thread */ + void *screen_refresh(void *arg) + { +- ++ struct t_data *datos; ++ datos = (struct t_data *)arg; + while (1==1) + { +- print_screen(); ++ print_screen(datos->machine); + sleep(1); + } + +@@ -228,9 +272,11 @@ + /* Inject ARP Replys to the network */ + void *inject_arp(void *arg) + { ++ struct t_inject *inject; + struct t_data *datos; + +- datos = (struct t_data *)arg; ++ inject = (struct t_inject *)arg; ++ datos = inject->datos; + sleep(2); + + if ( datos->autos != 1 ) +@@ -251,6 +297,12 @@ + + sprintf(current_network,"Finished!"); + lnet_destroy(); ++ if (inject->scan_secs > 0) { ++ sleep(inject->scan_secs); ++ pthread_kill(*(inject->sniffer), SIGKILL); ++ pthread_kill(*(inject->screen), SIGKILL); ++ pthread_kill(*(inject->keys), SIGKILL); ++ } + + return NULL; + } +@@ -400,6 +452,9 @@ + " -n node: last ip octet used for scanning (from 2 to 253)\n" + " -S enable sleep time supression betwen each request (hardcore mode)\n" + " -f enable fastmode scan, saves a lot of time, recommended for auto\n\n" ++ " -k nokeywait: Don't wait for keypress\n" ++ " -t time: maximum time to listen after last arp request sent (seconds)\n" ++ " -m don't clear and format screen, just output replies\n" + "If -p or -r arent enabled, netdiscover will scan for common lan addresses\n", + VERSION, comando); + } +diff -Naur netdiscover-0.3-beta6.orig/src/screen.c netdiscover-0.3-beta6/src/screen.c +--- netdiscover-0.3-beta6.orig/src/screen.c 2009-06-24 18:21:11.000000000 -0400 ++++ netdiscover-0.3-beta6/src/screen.c 2009-06-25 19:15:24.000000000 -0400 +@@ -114,7 +114,7 @@ + + + /* Read input keys */ +-void read_key() ++void read_key(int machine) + { + int ch; + ch = getchar(); +@@ -162,12 +162,12 @@ + smode = 2; + } + +- print_screen(); ++ print_screen(machine); + } + + + /* Clear and fill the screen */ +-void print_screen() ++void print_screen(int machine) + { + /* Get Console Size */ + if (ioctl(0, TIOCGWINSZ, &win_sz) < 0) +@@ -177,16 +177,16 @@ + } + + /* Flush and print screen */ +- fprintf( stderr, "\33[1;1H" ); +- fill_screen(); +- fprintf( stderr, "\33[J" ); ++ if (!machine) fprintf( stderr, "\33[1;1H" ); ++ fill_screen(machine); ++ if (!machine) fprintf( stderr, "\33[J" ); + fflush(stdout); + } + + + /* Fills the screen using white spaces to avoid refresh problems * + * not a very smart way, but it works :) */ +-void fill_screen() ++void fill_screen(int machine) + { + int x, j; + struct arp_rep_l *arprep_l; +@@ -196,40 +196,42 @@ + + pthread_mutex_lock(listm); + +- sprintf(line, " Currently scanning: %s | Our Mac is: %s - %i", +- current_network, ourmac, scroll); +- printf("%s", line); +- +- /* Fill with spaces */ +- for (j=strlen(line); jcount, arprep_count->hosts, arprep_count->length); +- printf("%s", line); +- +- /* Fill with spaces */ +- for (j=strlen(line); jcount, arprep_count->hosts, arprep_count->length); ++ printf("%s", line); ++ ++ /* Fill with spaces */ ++ for (j=strlen(line); jsip); ++ sprintf(tline, "%s ", arprep_l->sip); + strcat(line, tline); +- +- /* Fill with spaces */ +- for (j=strlen(line); j<17; j++) +- strcat(line, blank); ++ ++ /* Fill with spaces */ ++ for (j=strlen(line); j<17; j++) ++ strcat(line, blank); + + /* IP & MAC */ + sprintf(tline, "%02x:%02x:%02x:%02x:%02x:%02x ", +@@ -260,21 +262,29 @@ + /* Count, Length & Vendor */ + sprintf(tline, "%02d %03d %s", arprep_l->count, + arprep_l->header->length, arprep_l->vendor ); +- strcat(line, tline); +- +- /* Fill again with spaces */ +- for (j=strlen(line); jprinted) { ++ printf("%s\n", line); ++ arprep_l->printed = 1; ++ if (!machine) { ++ arprep_l->printed = 0; ++ } ++ } + } + + arprep_l = arprep_l->next; + x += 1; +- +- /* Check if end of screen was reached */ +- if (x >= ( (win_sz.ws_row + scroll) - 7)) +- break; ++ ++ if (!machine) { ++ /* Check if end of screen was reached */ ++ if (x >= ( (win_sz.ws_row + scroll) - 7)) ++ break; ++ } + } + + } /* Print only arp request */ +@@ -292,10 +302,10 @@ + /* Get source IP */ + sprintf(tline, "%s ", arprep_l->sip); + strcat(line, tline); +- +- /* Fill with spaces */ +- for (j=strlen(line); j<17; j++) +- strcat(line, blank); ++ ++ /* Fill with spaces */ ++ for (j=strlen(line); j<17; j++) ++ strcat(line, blank); + + /* Get source MAC */ + sprintf(tline, "%02x:%02x:%02x:%02x:%02x:%02x ", +@@ -308,27 +318,29 @@ + sprintf(tline, "%s", arprep_l->dip); + strcat(line, tline); + +- /* Fill with spaces */ +- for (j=strlen(line); j<54; j++) +- strcat(line, blank); ++ /* Fill with spaces */ ++ for (j=strlen(line); j<54; j++) ++ strcat(line, blank); + + /* Count, Length & Vendor */ + sprintf(tline, "%02d", arprep_l->count); + strcat(line, tline); + +- /* Fill again with spaces */ +- for (j=strlen(line); jnext; + x += 1; +- +- /* Check if end of screen was reached */ +- if (x >= ( (win_sz.ws_row + scroll) - 7)) +- break; ++ ++ if (!machine) { ++ /* Check if end of screen was reached */ ++ if (x >= ( (win_sz.ws_row + scroll) - 7)) ++ break; ++ } + } + } + else if(smode == 2) +diff -Naur netdiscover-0.3-beta6.orig/src/screen.h netdiscover-0.3-beta6/src/screen.h +--- netdiscover-0.3-beta6.orig/src/screen.h 2009-06-24 18:21:11.000000000 -0400 ++++ netdiscover-0.3-beta6/src/screen.h 2009-06-24 21:42:13.000000000 -0400 +@@ -60,6 +60,7 @@ + char *vendor; + short type; + unsigned int count; ++ int printed; + struct arp_rep_l *next; + }; + diff --git a/net/netdiscover/patches/01-initfix+end-fix.patch b/net/netdiscover/patches/01-initfix+end-fix.patch new file mode 100644 index 0000000..6ba5ffe --- /dev/null +++ b/net/netdiscover/patches/01-initfix+end-fix.patch @@ -0,0 +1,34 @@ +diff -Naur netdiscover-0.3-beta6.01machine/src/main.c netdiscover-0.3-beta6/src/main.c +--- netdiscover-0.3-beta6.01machine/src/main.c 2009-06-25 18:19:18.000000000 -0400 ++++ netdiscover-0.3-beta6/src/main.c 2009-07-16 06:37:43.000000000 -0400 +@@ -121,6 +121,8 @@ + node = 67; + pcount = 1; + nokeywait = 0; ++ fastmode = 0; ++ ssleep = 0; + + current_network = (char *) malloc ((sizeof(char)) * 16); + sprintf(current_network,"Starting."); +@@ -250,7 +252,6 @@ + } + } + +- + return 0; + } + +@@ -299,9 +300,10 @@ + lnet_destroy(); + if (inject->scan_secs > 0) { + sleep(inject->scan_secs); +- pthread_kill(*(inject->sniffer), SIGKILL); +- pthread_kill(*(inject->screen), SIGKILL); +- pthread_kill(*(inject->keys), SIGKILL); ++ pthread_kill(*(inject->sniffer), SIGTERM); ++ pthread_kill(*(inject->screen), SIGTERM); ++ pthread_kill(*(inject->keys), SIGTERM); ++ sighandler(SIGTERM); + } + + return NULL; diff --git a/net/netio/Config.in b/net/netio/Config.in new file mode 100644 index 0000000..cd8d255 --- /dev/null +++ b/net/netio/Config.in @@ -0,0 +1,4 @@ +menu "Configuration" + depends on PACKAGE_uclibcxx + +endmenu diff --git a/net/netio/Makefile b/net/netio/Makefile new file mode 100644 index 0000000..4837382 --- /dev/null +++ b/net/netio/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2006-2011 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:=netio +PKG_VERSION:=1.31 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)$(subst .,,$(PKG_VERSION)).zip +PKG_SOURCE_URL:=http://www.ars.de/ars/ars.nsf/f24a6a0b94c22d82862566960071bf5a/aa577bc4be573b05c125706d004c75b5/%24FILE/ +PKG_MD5SUM:=6b81e3c71b9dfa3bd60c53fa82e89085 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +PKG_UNPACK:=mkdir -p $(PKG_BUILD_DIR); unzip $(DL_DIR)/$(PKG_SOURCE) -d $(PKG_BUILD_DIR) + +define Package/netio + $(call Package/netio/Default) + SECTION:=net + CATEGORY:=Network + DEPENDS:=$(CXX_DEPENDS) +libpthread + TITLE:=Network throughput benchmark + URL:=http://www.ars.de/ars/ars.nsf/docs/netio +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) linux CC="$(TARGET_CC)" +endef + +define Package/netio/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,netio)) diff --git a/net/netio/patches/001-Makefile.patch b/net/netio/patches/001-Makefile.patch new file mode 100644 index 0000000..517b16a --- /dev/null +++ b/net/netio/patches/001-Makefile.patch @@ -0,0 +1,11 @@ +--- a/Makefile 2011-01-17 17:15:11.000000000 +0100 ++++ b/Makefile 2010-10-14 15:03:42.000000000 +0200 +@@ -84,7 +84,7 @@ + $(MAKE) all CC="gcc -O -s" O=.o X= \ + CFLAGS="-DUNIX" LFLAGS="" LIBS="-lsocket -lpthread -lnsl" OUT=-o + linux: +- $(MAKE) all CC="gcc -O -s" O=.o X= \ ++ $(MAKE) all CC="$(CC) -O -s" O=.o X= \ + CFLAGS="-DUNIX" LFLAGS="" LIBS="-lpthread" OUT=-o + macosx: + $(MAKE) all CC="gcc -O" O=.o X= \ diff --git a/net/netperf/Makefile b/net/netperf/Makefile new file mode 100644 index 0000000..815853e --- /dev/null +++ b/net/netperf/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2006-2011 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:=netperf +PKG_VERSION:=2.4.5 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.netperf.org/netperf/ +PKG_MD5SUM:=5cfaae1d024551161b8eafbd48faedf4 + +include $(INCLUDE_DIR)/package.mk + +define Package/netperf + SECTION:=net + CATEGORY:=Network + TITLE:=Network performance measurement tool + URL:=http://www.netperf.org/ +endef + +define Package/netperf/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/netserver.init $(1)/etc/init.d/netserver + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/netperf $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/netserver $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/arr_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/packet_byte_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/sctp_stream_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/snapshot_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/tcp_range_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/tcp_rr_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/tcp_stream_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/udp_rr_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/udp_stream_script $(1)/lib/netperf +endef + +$(eval $(call BuildPackage,netperf)) diff --git a/net/netperf/files/netserver.init b/net/netperf/files/netserver.init new file mode 100644 index 0000000..42fcf33 --- /dev/null +++ b/net/netperf/files/netserver.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +start() { + service_start /usr/bin/netserver +} + +stop() { + service_stop /usr/bin/netserver +} diff --git a/net/netperf/patches/001-dccp.patch b/net/netperf/patches/001-dccp.patch new file mode 100644 index 0000000..ae84cee --- /dev/null +++ b/net/netperf/patches/001-dccp.patch @@ -0,0 +1,38 @@ +[PATCH] fix build on systems where IPROTO_DCCP is defined, but SOCK_DCCP isn't + +On some systems (E.G. uClibc 0.9.31) IPROTO_DCCP is defined, but SOCK_DCCP +isn't - Causing the build to break. Fix it by checking for both before +using. + +Signed-off-by: Peter Korsgaard +--- + src/netsh.c | 2 +- + src/nettest_bsd.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +Index: netperf-2.4.5/src/netsh.c +=================================================================== +--- netperf-2.4.5.orig/src/netsh.c ++++ netperf-2.4.5/src/netsh.c +@@ -452,7 +452,7 @@ parse_protocol(char protocol_string[]) + return IPPROTO_SDP; + } + #endif +-#ifdef IPPROTO_DCCP ++#if defined(IPPROTO_DCCP) && defined(SOCK_DCCP) + if (!strcasecmp(temp,"dccp")) { + socket_type = SOCK_DCCP; + return IPPROTO_DCCP; +Index: netperf-2.4.5/src/nettest_bsd.c +=================================================================== +--- netperf-2.4.5.orig/src/nettest_bsd.c ++++ netperf-2.4.5/src/nettest_bsd.c +@@ -712,7 +712,7 @@ complete_addrinfo(char *controlhost, cha + that we did this so the code for the Solaris kludge can do + the fix-up for us. also flip error over to EAI_AGAIN and + make sure we don't "count" this time around the loop. */ +-#if defined(IPPROTO_DCCP) ++#if defined(IPPROTO_DCCP) && defined(SOCK_DCCP) + /* only tweak on this one the second time around, after we've + kludged the ai_protocol field */ + if ((hints.ai_socktype == SOCK_DCCP) && diff --git a/net/netpipe/Makefile b/net/netpipe/Makefile new file mode 100644 index 0000000..81d2712 --- /dev/null +++ b/net/netpipe/Makefile @@ -0,0 +1,49 @@ +# +# 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:=netpipe +PKG_VERSION:=3.7.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=NetPIPE-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.scl.ameslab.gov/netpipe/code +PKG_MD5SUM:=cc458a9154f6b8c6da9fae16627beec4 + +PKG_BUILD_DIR:=$(BUILD_DIR)/NetPIPE-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/netpipe + SECTION:=net + CATEGORY:=Network + TITLE:=A Network Protocol Independent Performance Evaluator + URL:=http://www.scl.ameslab.gov/netpipe/ +endef + +define Package/netpipe/description + NetPIPE is a protocol independent performance tool that visually + represents the network performance under a variety of conditions. It + performs simple ping-pong tests, bouncing messages of increasing size + between two processes, whether across a network or within an SMP + system. Message sizes are chosen at regular intervals, and with slight + perturbations, to provide a complete test of the communication system. + Each data point involves many ping-pong tests to provide an accurate + timing. Latencies are calculated by dividing the round trip time in + half for small messages ( < 64 Bytes ). +endef + +define Build/Configure +endef + +define Package/netpipe/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPtcp $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,netpipe)) diff --git a/net/netstat-nat/Makefile b/net/netstat-nat/Makefile new file mode 100644 index 0000000..8673695 --- /dev/null +++ b/net/netstat-nat/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=netstat-nat +PKG_VERSION:=1.4.10 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://tweegy.nl/download +PKG_MD5SUM:=c1bbb3ee9774ebfa27c440e2d9dd7286 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/netstat-nat + SECTION:=net + CATEGORY:=Network + TITLE:=A netstat variant for NAT connections + URL:=http://tweegy.nl/projects/netstat-nat/ +endef + +define Package/netstat-nat/description + Netstat-nat is a small program written in C. + It displays NAT connections, managed by netfilter/iptables which comes + with the > 2.4.x linux kernels. + The program reads its information from '/proc/net/ip_conntrack', which + is the temporary conntrack-storage of netfilter. +endef + +define Package/netstat-nat/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/netstat-nat $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,netstat-nat)) diff --git a/net/nfs-kernel-server/Makefile b/net/nfs-kernel-server/Makefile new file mode 100644 index 0000000..aca76f6 --- /dev/null +++ b/net/nfs-kernel-server/Makefile @@ -0,0 +1,152 @@ +# Copyright (C) 2009 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:=nfs-kernel-server +PKG_VERSION:=1.2.6 +PKG_RELEASE:=1 +PKG_MD5SUM:=8be543ca270c2234ff18f8c8d35e0d37 + +PKG_SOURCE_URL:=@SF/nfs +PKG_SOURCE:=nfs-utils-$(PKG_VERSION).tar.bz2 + +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/nfs-utils-$(PKG_VERSION) +PKG_BUILD_DIR:=$(BUILD_DIR)/nfs-utils-$(PKG_VERSION) +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_DEPENDS:=$(PKG_NAME)/host + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk + +define Package/nfs-kernel-server/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Filesystem + DEPENDS:=+libwrap +libblkid +libuuid $(LIBRPC_DEPENDS) + URL:=http://nfs.sourceforge.net/ +endef + +define Package/nfs-kernel-server + $(call Package/nfs-kernel-server/Default) + TITLE:=Kernel NFS server support + DEPENDS+= +kmod-fs-nfsd +kmod-fs-nfs +portmap +endef + +define Package/nfs-kernel-server/description + Kernel NFS server support +endef + +define Package/nfs-kernel-server-utils + $(call Package/nfs-kernel-server/Default) + TITLE:=NFS server utils + DEPENDS:=nfs-kernel-server +endef + +define Package/nfs-kernel-server-utils/description + NFS server utils +endef + +define Package/nfs-kernel-server/conffiles +/etc/exports +endef + +define Package/nfs-utils + $(call Package/nfs-kernel-server/Default) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS+= +libevent +USE_UCLIBC:librpc + TITLE:=updated mount utility (includes nfs4) +endef + +define Package/nfs-utils/description + Updated mount.nfs command - allows mounting nfs4 volumes +endef + +TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/lib -I$(STAGING_DIR)/usr/include/libevent \ + -I$(STAGING_DIR)/usr/include/ -Drpc_uint=uint +TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib $(LIBRPC) \ + -L$(STAGING_DIR)/usr/lib/libevent + +CONFIGURE_ARGS += \ + --disable-gss \ + --disable-nfsv4 \ + --disable-nfsv41 \ + --enable-static \ + --enable-shared \ + --disable-caps \ + --disable-tirpc \ + --disable-nfsdcld + +CONFIGURE_VARS += \ + CONFIG_SQLITE3_TRUE="\#" \ + CONFIG_NFSDCLD_TRUE="\#" + +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 + +HOST_CFLAGS += -Dlinux + +HOST_CONFIGURE_ARGS += \ + --disable-gss \ + --disable-nfsv4 \ + --disable-nfsv41 \ + --without-tcp-wrappers + +HOST_CONFIGURE_VARS += \ + ac_cv_lib_event_event_dispatch=yes \ + ac_cv_lib_nfsidmap_nfs4_init_name_mapping=yes \ + ac_cv_lib_blkid_blkid_get_library_version=yes \ + ac_cv_header_event_h=yes \ + ac_cv_header_nfsidmap_h=yes \ + ac_cv_header_blkid_blkid_h=yes \ + GSSGLUE_CFLAGS=" " \ + GSSGLUE_LIBS=" " \ + RPCSECGSS_CFLAGS=" " \ + RPCSECGSS_LIBS=" " \ + CONFIG_SQLITE3_TRUE="\#" \ + CONFIG_NFSDCLD_TRUE="\#" + +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR)/tools/rpcgen all +endef + +define Host/Install + $(INSTALL_BIN) $(HOST_BUILD_DIR)/tools/rpcgen/rpcgen $(STAGING_DIR_HOST)/bin/rpcgen +endef + +define Package/nfs-kernel-server/install + $(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/sbin + $(INSTALL_DATA) ./files/nfsd.exports $(1)/etc/exports + $(INSTALL_BIN) ./files/nfsd.init $(1)/etc/init.d/nfsd + $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/statd/sm-notify $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/statd/statd $(1)/usr/sbin/rpc.statd + $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/nfsd/nfsd $(1)/usr/sbin/rpc.nfsd + $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/mountd/mountd $(1)/usr/sbin/rpc.mountd + $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/exportfs/exportfs $(1)/usr/sbin/ +endef + +define Package/nfs-kernel-server-utils/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/showmount/showmount $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/nfsstat/nfsstat $(1)/usr/sbin +endef + +define Package/nfs-utils/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/mount.nfs $(1)/sbin/ + (cd $(1)/sbin; ln -sf mount.nfs mount.nfs4; ln -sf mount.nfs umount.nfs; ln -sf mount.nfs umount.nfs4) +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,nfs-kernel-server)) +$(eval $(call BuildPackage,nfs-kernel-server-utils)) +$(eval $(call BuildPackage,nfs-utils)) diff --git a/net/nfs-kernel-server/files/nfsd.exports b/net/nfs-kernel-server/files/nfsd.exports new file mode 100644 index 0000000..0453e04 --- /dev/null +++ b/net/nfs-kernel-server/files/nfsd.exports @@ -0,0 +1 @@ +/mnt *(ro,all_squash,insecure,sync) diff --git a/net/nfs-kernel-server/files/nfsd.init b/net/nfs-kernel-server/files/nfsd.init new file mode 100644 index 0000000..2531d59 --- /dev/null +++ b/net/nfs-kernel-server/files/nfsd.init @@ -0,0 +1,40 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +START=60 +STOP=60 + +SERVICE_USE_PID=1 + +NFS_D=/var/lib/nfs +LOCK_D=/var/lib/nfs/sm + +start() { + grep -q /proc/fs/nfsd /proc/mounts || \ + mount -t nfsd nfsd /proc/fs/nfsd + mkdir -p $NFS_D + mkdir -p $LOCK_D + touch $NFS_D/rmtab + + sysctl -w fs.nfs.nlm_tcpport=32777 fs.nfs.nlm_udpport=32777 > /dev/null + service_start /usr/sbin/rpc.statd -p 32778 -o 32779 + /usr/sbin/exportfs -r + /usr/sbin/rpc.nfsd + SERVICE_WRITE_PID=1 \ + SERVICE_DAEMONIZE=1 \ + service_start /usr/sbin/rpc.mountd -p 32780 -F +} + +stop() { + service_stop /usr/sbin/rpc.mountd + rpc.nfsd 0 2> /dev/null + /usr/sbin/exportfs -au + service_stop /usr/sbin/rpc.statd + grep -q /proc/fs/nfsd /proc/mounts && \ + umount /proc/fs/nfsd +} + +reload() { + /usr/sbin/exportfs -r +} + diff --git a/net/nfs-kernel-server/patches/100-nfs_utils_uclibc.patch b/net/nfs-kernel-server/patches/100-nfs_utils_uclibc.patch new file mode 100644 index 0000000..09aa65e --- /dev/null +++ b/net/nfs-kernel-server/patches/100-nfs_utils_uclibc.patch @@ -0,0 +1,49 @@ +--- a/support/include/sockaddr.h ++++ b/support/include/sockaddr.h +@@ -20,7 +20,10 @@ + #ifndef NFS_UTILS_SOCKADDR_H + #define NFS_UTILS_SOCKADDR_H + ++/* uClibc doesn't have/need libio.h */ ++#ifndef __UCLIBC__ + #include ++#endif + #include + #include + #include +--- a/support/nfs/svc_socket.c ++++ b/support/nfs/svc_socket.c +@@ -40,10 +40,13 @@ int getservport(u_long number, const cha + char rpcdata[1024], servdata[1024]; + struct rpcent rpcbuf, *rpcp; + struct servent servbuf, *servp = NULL; +- int ret; +- ++ int ret=0; ++#ifndef __UCLIBC__ + ret = getrpcbynumber_r(number, &rpcbuf, rpcdata, sizeof rpcdata, + &rpcp); ++#else ++ rpcp = getrpcbynumber (number); ++#endif + if (ret == 0 && rpcp != NULL) { + /* First try name. */ + ret = getservbyname_r(rpcp->r_name, proto, &servbuf, servdata, +--- a/utils/mountd/cache.c ++++ b/utils/mountd/cache.c +@@ -168,6 +168,7 @@ static void auth_unix_gid(FILE *f) + pw = getpwuid(uid); + if (!pw) + rv = -1; ++#ifndef __UCLIBC__ + else { + rv = getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups); + if (rv == -1 && ngroups >= groups_len) { +@@ -182,6 +183,7 @@ static void auth_unix_gid(FILE *f) + } + } + } ++#endif + qword_printuint(f, uid); + qword_printuint(f, time(0) + DEFAULT_TTL); + if (rv >= 0) { diff --git a/net/nfs-kernel-server/patches/101-no_malloc_h.patch b/net/nfs-kernel-server/patches/101-no_malloc_h.patch new file mode 100644 index 0000000..afe4c98 --- /dev/null +++ b/net/nfs-kernel-server/patches/101-no_malloc_h.patch @@ -0,0 +1,10 @@ +--- a/tools/rpcgen/rpc_cout.c ++++ b/tools/rpcgen/rpc_cout.c +@@ -36,7 +36,6 @@ static char sccsid[] = "@(#)rpc_cout.c 1 + #include + #include + #include +-#include + #include + #include "rpc_parse.h" + #include "rpc_util.h" diff --git a/net/nfs-kernel-server/patches/200-osd_login-install.patch b/net/nfs-kernel-server/patches/200-osd_login-install.patch new file mode 100644 index 0000000..749443f --- /dev/null +++ b/net/nfs-kernel-server/patches/200-osd_login-install.patch @@ -0,0 +1,10 @@ +--- a/utils/osd_login/Makefile.in ++++ b/utils/osd_login/Makefile.in +@@ -426,6 +426,7 @@ uninstall-am: + all-local: $(OSD_LOGIN_FILES) + + install-data-hook: ++ mkdir -p $(DESTDIR)/sbin + $(INSTALL) --mode 755 osd_login $(DESTDIR)/sbin/osd_login + + # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/net/nfs-server/Makefile b/net/nfs-server/Makefile new file mode 100644 index 0000000..6257fdf --- /dev/null +++ b/net/nfs-server/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2006-2011 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:=nfs-server +PKG_VERSION:=2.2beta47 +PKG_RELEASE:=3 + +PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/n/nfs-user-server +PKG_SOURCE:=nfs-user-server_$(PKG_VERSION).orig.tar.gz +PKG_MD5SUM:=79a29fe9f79b2f3241d4915767b8c511 + +include $(INCLUDE_DIR)/package.mk + +define Package/nfs-server + SECTION:=net + CATEGORY:=Network + SUBMENU:=Filesystem + DEPENDS:=+portmap $(LIBRPC_DEPENDS) + TITLE:=User Space NFS server + URL:=http://packages.debian.org/nfs-user-server +endef + +define Package/nfs-server/description +User Space NFS server +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include +TARGET_LDFLAGS += $(LIBRPC) + +define Package/nfs-server/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/nfsd.exports $(1)/etc/exports + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/nfsd.init $(1)/etc/init.d/nfsd + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/rpc.* $(1)/usr/sbin/ +endef + +define Package/nfs-server/conffiles +/etc/exports +endef + +$(eval $(call BuildPackage,nfs-server)) diff --git a/net/nfs-server/files/nfsd.exports b/net/nfs-server/files/nfsd.exports new file mode 100644 index 0000000..75a387a --- /dev/null +++ b/net/nfs-server/files/nfsd.exports @@ -0,0 +1 @@ +/mnt (ro,all_squash,insecure) diff --git a/net/nfs-server/files/nfsd.init b/net/nfs-server/files/nfsd.init new file mode 100644 index 0000000..f66c1af --- /dev/null +++ b/net/nfs-server/files/nfsd.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 +STOP=50 + +start() { + service_start /usr/sbin/rpc.mountd -r + service_start /usr/sbin/rpc.nfsd +} + +stop() { + service_stop /usr/sbin/rpc.nfsd + service_stop /usr/sbin/rpc.mountd -r +} diff --git a/net/nfs-server/patches/001-build_config.patch b/net/nfs-server/patches/001-build_config.patch new file mode 100644 index 0000000..5aa1cde --- /dev/null +++ b/net/nfs-server/patches/001-build_config.patch @@ -0,0 +1,67 @@ +--- nfs-server-2.2beta47.old/site.mk 1970-01-01 01:00:00.000000000 +0100 ++++ nfs-server-2.2beta47/site.mk 2005-03-24 22:42:20.000000000 +0100 +@@ -0,0 +1,11 @@ ++# ++# Site-specific make options generated by BUILD. Please do not edit. ++# ++ ++# ugidd support ++UGIDD_PROG= ++UGIDD_MAN= ++# Location of tcp_wrapper library ++LIBWRAP_DIR=-L/usr/share/stuff/src/openwrt/experimental/buildroot/build_mipsel/staging_dir/lib ++LIBWRAP_LIB=-lwrap ++DEVTAB_FILE= +--- nfs-server-2.2beta47.old/site.h 1970-01-01 01:00:00.000000000 +0100 ++++ nfs-server-2.2beta47/site.h 2005-03-24 22:44:19.000000000 +0100 +@@ -0,0 +1,50 @@ ++/* ++ * Site-specific configuration options generated by BUILD. ++ * Please do not edit. ++ */ ++ ++/* ++ * If ENABLE_DEVTAB is defined, nfsd will use the new inode ++ * number generation scheme for avoiding inode number clashes ++ * on big hard disks. ++ */ ++/* #undef ENABLE_DEVTAB */ ++ ++/* ++ * If MULTIPLE_SERVER_READWRITE is defined, you will be able ++ * to run several nfsd process in parallel servicing all NFS ++ * requests. ++ */ ++#define MULTIPLE_SERVERS_READWRITE ++ ++/* ++ * If ENABLE_UGID_DAEMON is defined, the real rpc.ugidd is built, ++ * nfsd is built to support ugidd queries. ++ * Otherwise, a dummy program is created ++ */ ++/* #undef ENABLE_UGID_DAEMON */ ++ ++/* ++ * If ENABLE_UGID_NIS is defined, nfsd will support user mapping ++ * vie the client's NIS server. ++ */ ++/* #undef ENABLE_UGID_NIS */ ++ ++/* ++ * if HOSTS_ACCESS is defined, ugidd uses host access control ++ * provided by libwrap.a from tcp_wrappers ++ */ ++#define HOSTS_ACCESS ++ ++/* ++ * Define correct ownership of export control file ++ */ ++#define EXPORTSOWNERUID ((uid_t) 0) ++#define EXPORTSOWNERGID ((gid_t) 0) ++ ++/* ++ * If WANT_LOG_MOUNTS is defined, every mount request will be logged ++ * to syslogd with the name of source site and a path that was ++ * it requested ++ */ ++#define WANT_LOG_MOUNTS diff --git a/net/nfs-server/patches/002-cross_compile_fix.patch b/net/nfs-server/patches/002-cross_compile_fix.patch new file mode 100644 index 0000000..646a34a --- /dev/null +++ b/net/nfs-server/patches/002-cross_compile_fix.patch @@ -0,0 +1,149 @@ +diff -urN nfs-server-2.2beta47.old/configure nfs-server-2.2beta47/configure +--- nfs-server-2.2beta47.old/configure 1999-06-11 12:06:04.000000000 +0200 ++++ nfs-server-2.2beta47/configure 2005-03-24 22:24:39.000000000 +0100 +@@ -1960,7 +1960,7 @@ + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then +- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&6 + else + if test "$cross_compiling" = yes; then +- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&6 + else + if test "$cross_compiling" = yes; then +- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&6 + else + if test "$cross_compiling" = yes; then +- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&6 + else + if test "$cross_compiling" = yes; then +- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&6 + else + if test "$cross_compiling" = yes; then +- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&6 + else + if test "$cross_compiling" = yes; then +- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&6 + else + if test "$cross_compiling" = yes; then +- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext <&6 + else + if test "$cross_compiling" = yes; then +- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext < + + #ifdef HAVE_SYSLOG_H + #include +--- nfs-server-2.2beta47.old/fh.c 1999-11-10 10:41:14.000000000 +0100 ++++ nfs-server-2.2beta47/fh.c 2005-03-24 22:50:50.000000000 +0100 +@@ -50,6 +50,7 @@ + */ + + #include ++#include + #include "nfsd.h" + #include "rpcmisc.h" + #include "signals.h" +@@ -350,7 +351,7 @@ + #ifndef ENABLE_DEVTAB + psi_t dmajor, dminor; + +-#if SIZEOF_DEV_T == 4 ++#if (SIZEOF_DEV_T == 4) + /* This folds the upper 16 bits into bits 8..15, and + * the lower 16 bits into bits 0..7 + */ +--- nfs-server-2.2beta47.old/ugid_map.c 2005-03-24 22:34:56.000000000 +0100 ++++ nfs-server-2.2beta47/ugid_map.c 2005-03-24 22:54:00.000000000 +0100 +@@ -34,14 +34,8 @@ + #define UGID_CHUNK0_BYTES (UGID_CHUNK * sizeof(idmap_t)) + #define UGID_EXPIRE 300 /* 5 minutes */ + +-/* +- * Make sure we get the right size for ugid_t +- */ +-#if SIZEOF_UID_T != SIZEOF_GID_T +-#error Sorry, this code relies on sizeof(uid_t) == sizeof(gid_t) +-#endif + +-#define UGID_BITS (SIZEOF_UID_T * BITSPERBYTE) ++#define UGID_BITS (sizeof(uid_t) * BITSPERBYTE) + #define BITSTOLEVEL(b) ((UGID_BITS - (b)) / UGID_CHUNK_BITS - 1) + #define UGID_LOWER(id, b) ((id) & ~((1 << (b)) - 1)) + #define UGID_UPPER(id, b) (((id + (1 << (b))) & ~((1 << (b)) - 1))-1) diff --git a/net/nfs-server/patches/003-debian_subset.patch b/net/nfs-server/patches/003-debian_subset.patch new file mode 100644 index 0000000..2ac3f93 --- /dev/null +++ b/net/nfs-server/patches/003-debian_subset.patch @@ -0,0 +1,698 @@ +--- nfs-user-server-2.2beta47.orig/BUILD ++++ nfs-user-server-2.2beta47/BUILD +@@ -48,7 +48,7 @@ + shift + done + +-function read_yesno { ++read_yesno() { + ans="" + echo >&2 + default=$2 +@@ -84,7 +84,7 @@ + echo $ans + } + +-function read_ugid { ++read_ugid() { + ans="" + prompt="$2 [default $3 $4] " + default=$3 +@@ -145,7 +145,7 @@ + + if ! $batch; then + echo -n "Please press return to continue" +- read ++ read ans + fi + + version=`cat .version` +--- nfs-user-server-2.2beta47.orig/Makefile.in ++++ nfs-user-server-2.2beta47/Makefile.in +@@ -95,20 +95,20 @@ + LIBSRCS = fileblocks.c fsusage.c realpath.c strerror.c \ + utimes.c mkdir.c rename.c getopt.c getopt_long.c \ + alloca.c mountlist.c xmalloc.c \ +- xstrdup.c strdup.c strstr.c nfsmounted.c faccess.c \ ++ xstrdup.c strdup.c strstr.c nfsmounted.c \ + haccess.c failsafe.c signals.c + XDRFILES = mount.x nfs_prot.x + GENFILES = mount.h mount_xdr.c mount_svc.c nfs_prot.h nfs_prot_xdr.c \ + ugid.h ugid_xdr.c ugid_clnt.c + HDRS = system.h nfsd.h auth.h fh.h logging.h fakefsuid.h \ +- rpcmisc.h faccess.h rquotad.h rquota.h haccess.h ++ rpcmisc.h rquotad.h rquota.h haccess.h + LIBHDRS = fsusage.h getopt.h mountlist.h failsafe.h signals.h + MANPAGES5 = exports + MANPAGES8p = mountd nfsd $(UGIDD_MAN) + MANPAGES8 = showmount + MANPAGES = $(MANPAGES5) $(MANPAGES8p) $(MANPAGES8) + LIBOBJS = version.o fsusage.o mountlist.o xmalloc.o xstrdup.o \ +- nfsmounted.o faccess.o haccess.o failsafe.o \ ++ nfsmounted.o haccess.o failsafe.o \ + signals.o @LIBOBJS@ @ALLOCA@ + OBJS = logging.o fh.o devtab.o auth_init.o auth_clnt.o auth.o + NFSD_OBJS = nfsd.o rpcmisc.o nfs_dispatch.o getattr.o setattr.o \ +@@ -116,7 +116,7 @@ + MOUNTD_OBJS = mountd.o rpcmisc.o mount_dispatch.o mount_xdr.o rmtab.o \ + $(OBJS) + SHOWMOUNT_OBJS = showmount.o mount_xdr.o +-UGIDD_OBJS = ugidd.o ugid_xdr.o logging.o ++UGIDD_OBJS = ugidd.o ugid_xdr.o logging.o rpcmisc.o + DAEMONS = $(rpcprefix)mountd $(rpcprefix)nfsd $(UGIDD_PROG) + CLIENTS = showmount + +--- nfs-user-server-2.2beta47.orig/auth.c ++++ nfs-user-server-2.2beta47/auth.c +@@ -143,6 +143,21 @@ + return okay; + } + ++static inline int ++auth_atob(const char *name, struct in_addr *ap) ++{ ++ int m; ++ ++ if (!isdigit(*name)) ++ return 0; ++ for (m = 0; isdigit(*name); name++) ++ m = m * 10 + (unsigned char) *name - '0'; ++ if (m > 32) ++ return 0; ++ ap->s_addr = m ? ~((1 << (32 - m)) - 1) : 0; ++ return 1; ++} ++ + /* + * Get a client entry for a specific name or pattern. + * If necessary, this function performs a hostname lookup to +@@ -614,7 +629,9 @@ + if (auth_aton(hname, &haddr, &ename)) { + if (*ename == '\0') + is_hostaddr = 1; +- else if (*ename == '/' && auth_aton(ename+1, &hmask, NULL)) ++ else if (*ename == '/' && ++ (auth_aton(ename+1, &hmask, NULL) || ++ auth_atob(ename+1, &hmask))) + is_netmask = 1; + } + is_special = is_wildcard + is_netgroup + is_netmask; +--- nfs-user-server-2.2beta47.orig/auth_init.c ++++ nfs-user-server-2.2beta47/auth_init.c +@@ -23,6 +23,7 @@ + #define EXPORTSFILE "/etc/exports" + #endif + ++#if 0 + /* Support for file access control on /etc/exports by Alex Yuriev. */ + #include "faccess.h" + #ifndef EXPORTSOWNERUID +@@ -31,6 +32,7 @@ + #ifndef EXPORTSOWNERGID + #define EXPORTSOWNERGID ((gid_t) 0) + #endif ++#endif + + exportnode * export_list = NULL; + int allow_non_root = 0; +@@ -395,6 +397,7 @@ + auth_file = fname; /* Save for re-initialization */ + + /* Check protection of exports file. */ ++#if 0 /* A man's house is his castle. */ + switch(iCheckAccess(auth_file, EXPORTSOWNERUID, EXPORTSOWNERGID)) { + case FACCESSWRITABLE: + Dprintf(L_ERROR, +@@ -409,6 +412,7 @@ + Dprintf(L_ERROR, "exiting because of security violation.\n"); + exit(1); + } ++#endif + + if ((ef = fopen(fname, "r")) == NULL) { + Dprintf(L_ERROR, "Could not open exports file %s: %s\n", +@@ -468,7 +472,7 @@ + + /* Build the RPC mount export list data structure. */ + resex = (exportnode *) xmalloc(sizeof *resex); +- resex->ex_dir = mount_point; ++ resex->ex_dir = xstrdup(path); + resex->ex_groups = NULL; + + #ifndef NEW_STYLE_EXPORTS_FILE +--- nfs-user-server-2.2beta47.orig/configure.in ++++ nfs-user-server-2.2beta47/configure.in +@@ -53,7 +53,7 @@ + AC_CHECK_LIB(crypt, main) + AC_CHECK_LIB(nys, main) + AC_REPLACE_FUNCS(strerror realpath mkdir rename utimes strdup strstr getopt getopt_long) +-AC_HAVE_FUNCS(getcwd seteuid setreuid getdtablesize setgroups lchown setsid setfsuid setfsgid innetgr quotactl authdes_getucred) ++AC_HAVE_FUNCS(getcwd seteuid setreuid getdtablesize setgroups lchown setsid setfsuid setfsgid innetgr quotactl authdes_getucred strsignal) + AC_AUTHDES_GETUCRED + AC_BROKEN_SETFSUID + AC_MOUNTLIST +--- nfs-user-server-2.2beta47.orig/exports.man ++++ nfs-user-server-2.2beta47/exports.man +@@ -8,7 +8,7 @@ + The file + .I /etc/exports + serves as the access control list for file systems which may be +-exported to NFS clients. It it used by both the NFS mount daemon, ++exported to NFS clients. It is used by both the NFS mount daemon, + .IR mountd (8) + and the NFS file server daemon + .IR nfsd (8). +@@ -75,11 +75,12 @@ + off, specify + .IR insecure . + .TP ++.IR ro ++Disallow the client to modify files and directories. The client is only ++allowed to issue read-only requests. ++.TP + .IR rw +-Allow the client to modify files and directories. The default is to +-restrict the client to read-only request, which can be made explicit +-by using the +-.IR ro " option. ++Allow the client to modify files and directories. This is the default. + .TP + .I noaccess + This makes everything below the directory inaccessible for the named +@@ -98,6 +99,14 @@ + .TP + .IR link_absolute + Leave all symbolic link as they are. This is the default operation. ++.SS Anonymous Entries ++.PP ++Entries where hosts are not specified are known as anonymous entries. They ++have different default settings compared to normal entries. The differences ++include ++.IR all_squash , ++.IR no_secure ", and" ++.IR ro . + .SS User ID Mapping + .PP + .I nfsd +--- nfs-user-server-2.2beta47.orig/failsafe.c ++++ nfs-user-server-2.2beta47/failsafe.c +@@ -10,8 +10,12 @@ + #include "logging.h" + #include "signals.h" + #include ++#ifdef HAVE_STRSIGNAL ++#include ++#else + + static const char * get_signame(int signo); ++#endif + + void + failsafe(int level, int ncopies) +@@ -111,9 +115,17 @@ + pid, running? "Continue" : "Exit"); + } else { + Dprintf(L_WARNING, "failsafe: " ++#ifdef HAVE_STRSIGNAL ++ "child %d terminated by: %s. " ++#else + "child %d terminated by %s. " ++#endif + "Restarting.", ++#ifdef HAVE_STRSIGNAL ++ pid, strsignal(signo)); ++#else + pid, get_signame(signo)); ++#endif + child = -1; /* Restart */ + } + } else if (WIFEXITED(status)) { +@@ -159,6 +171,7 @@ + /* NOP */ + } + ++#ifndef HAVE_STRSIGNAL + static const char * + get_signame(int signo) + { +@@ -199,3 +212,4 @@ + sprintf(namebuf, "signal #%d", signo); + return namebuf; + } ++#endif +--- nfs-user-server-2.2beta47.orig/mount_dispatch.c ++++ nfs-user-server-2.2beta47/mount_dispatch.c +@@ -131,7 +131,7 @@ + dent = &dtbl[proc_index]; + + memset(&argument, 0, dent->arg_size); +- if (!svc_getargs(transp, (xdrproc_t) dent->xdr_argument, &argument)) { ++ if (!svc_getargs(transp, (xdrproc_t) dent->xdr_argument, (caddr_t) &argument)) { + svcerr_decode(transp); + goto done; + } +@@ -148,7 +148,7 @@ + if (!svc_sendreply(transp, dent->xdr_result, (caddr_t) resp)) { + svcerr_systemerr(transp); + } +- if (!svc_freeargs(transp, (xdrproc_t) dent->xdr_argument, &argument)) { ++ if (!svc_freeargs(transp, (xdrproc_t) dent->xdr_argument, (caddr_t) &argument)) { + Dprintf(L_ERROR, "unable to free RPC arguments, exiting\n"); + exit(1); + } +--- nfs-user-server-2.2beta47.orig/mount_xdr.c ++++ nfs-user-server-2.2beta47/mount_xdr.c +@@ -190,7 +190,7 @@ + xdr_ppathcnf(XDR *xdrs, ppathcnf *objp) + { + +- register long *buf=buf; ++ int32_t *buf=buf; + + int i=i; + +--- nfs-user-server-2.2beta47.orig/mountd.c ++++ nfs-user-server-2.2beta47/mountd.c +@@ -310,6 +310,7 @@ + int c; + + program_name = argv[0]; ++ chdir("/"); + + /* Parse the command line options and arguments. */ + opterr = 0; +--- nfs-user-server-2.2beta47.orig/nfs_dispatch.c ++++ nfs-user-server-2.2beta47/nfs_dispatch.c +@@ -147,7 +147,7 @@ + nfsclient = NULL; + + memset(&argument, 0, dent->arg_size); +- if (!svc_getargs(transp, (xdrproc_t) dent->xdr_argument, &argument)) { ++ if (!svc_getargs(transp, (xdrproc_t) dent->xdr_argument, (caddr_t) &argument)) { + svcerr_decode(transp); + goto done; + } +@@ -173,7 +173,7 @@ + svc_sendreply(transp, dent->xdr_result, (caddr_t) &result); + #endif + +- if (!svc_freeargs(transp, (xdrproc_t) dent->xdr_argument, &argument)) { ++ if (!svc_freeargs(transp, (xdrproc_t) dent->xdr_argument, (caddr_t) &argument)) { + Dprintf(L_ERROR, "unable to free RPC arguments, exiting\n"); + exit(1); + } +--- nfs-user-server-2.2beta47.orig/nfs_prot_xdr.c ++++ nfs-user-server-2.2beta47/nfs_prot_xdr.c +@@ -98,7 +98,7 @@ + xdr_fattr(XDR *xdrs, fattr *objp) + { + +- register long *buf=buf; ++ int32_t *buf=buf; + + + if (xdrs->x_op == XDR_ENCODE) { +@@ -273,7 +273,7 @@ + xdr_sattr(XDR *xdrs, sattr *objp) + { + +- register long *buf=buf; ++ int32_t *buf=buf; + + + if (xdrs->x_op == XDR_ENCODE) { +@@ -553,7 +553,7 @@ + xdr_writeargs(XDR *xdrs, writeargs *objp) + { + +- register long *buf = buf; ++ int32_t *buf = buf; + + + if (xdrs->x_op == XDR_ENCODE) { +@@ -777,7 +777,7 @@ + xdr_statfsokres(XDR *xdrs, statfsokres *objp) + { + +- register long *buf=buf; ++ int32_t *buf=buf; + + + if (xdrs->x_op == XDR_ENCODE) { +--- nfs-user-server-2.2beta47.orig/nfsd.c ++++ nfs-user-server-2.2beta47/nfsd.c +@@ -36,6 +36,7 @@ + #define CHK_READ 0 + #define CHK_WRITE 1 + #define CHK_NOACCESS 2 ++#define CHK_ROOT 4 + + /* Make larger reads possible. Without crashing the machine :-) */ + #undef NFS_MAXDATA +@@ -173,7 +174,8 @@ + return NULL; + } + +- auth_user(nfsmount, rqstp); ++ if (!(flags & CHK_ROOT) || strcmp(nfsmount->path, fhc->path)) ++ auth_user(nfsmount, rqstp); + + *statp = NFS_OK; + return fhc; +@@ -244,7 +246,7 @@ + nfsstat status; + fhcache *fhc; + +- fhc = auth_fh(rqstp, argp, &status, CHK_READ); ++ fhc = auth_fh(rqstp, argp, &status, CHK_READ | CHK_ROOT); + if (fhc == NULL) + return status; + +@@ -575,7 +577,12 @@ + #endif + + /* MvS: Some clients use chardev 0xFFFF for a FIFO. */ ++#if defined(major) && defined(minor) ++ if (S_ISCHR(argp->attributes.mode) && ++ major(dev) == 0xff && minor(dev) == 0xff) { ++#else + if (S_ISCHR(argp->attributes.mode) && dev == 0xFFFF) { ++#endif + is_borc = 0; + dev = 0; + argp->attributes.mode &= ~S_IFMT; +@@ -882,7 +889,9 @@ + + /* This code is from Mark Shand's version */ + errno = 0; +- if (efs_lstat(h->path, &sbuf) < 0 || !(S_ISDIR(sbuf.st_mode))) ++ if (efs_lstat(h->path, &sbuf) < 0) ++ return (NFSERR_ACCES); ++ if (!S_ISDIR(sbuf.st_mode)) + return (NFSERR_NOTDIR); + if ((dirp = efs_opendir(h->path)) == NULL) + return ((errno ? nfs_errno() : NFSERR_NAMETOOLONG)); +@@ -940,7 +949,7 @@ + char *path; + struct fs_usage fs; + +- fhc = auth_fh(rqstp, argp, &status, CHK_READ | CHK_NOACCESS); ++ fhc = auth_fh(rqstp, argp, &status, CHK_READ | CHK_NOACCESS | CHK_ROOT); + if (fhc == NULL) + return status; + path = fhc->path; +--- nfs-user-server-2.2beta47.orig/rpcmisc.c ++++ nfs-user-server-2.2beta47/rpcmisc.c +@@ -64,25 +64,25 @@ + asize = sizeof(saddr); + sock = 0; + if (getsockname(0, (struct sockaddr *) &saddr, &asize) == 0) { +- int ssize = sizeof (int); ++ int ssize = sizeof (i); + + if (saddr.sin_family != AF_INET) + goto not_inetd; +- if (getsockopt(0, SOL_SOCKET, SO_TYPE, &_rpcfdtype, &ssize) < 0) ++ if (getsockopt(0, SOL_SOCKET, SO_TYPE, &i, &ssize) < 0) + goto not_inetd; ++ _rpcfdtype = i; + background_logging(); /* no more logging to stderr */ + closedown = time(NULL) + _RPCSVC_CLOSEDOWN; + _rpcpmstart = 1; + } else { + not_inetd: +- _rpcfdtype = 0; + for (i = 0; (vers = verstbl[i]) != 0; i++) + pmap_unset(prog, vers); + sock = RPC_ANYSOCK; + } + + if ((_rpcfdtype == 0) || (_rpcfdtype == SOCK_DGRAM)) { +- if (_rpcfdtype == 0 && defport != 0) ++ if (_rpcpmstart == 0 && defport != 0) + sock = makesock(defport, IPPROTO_UDP, bufsiz); + transp = svcudp_create(sock); + if (transp == NULL) +@@ -97,7 +97,7 @@ + } + + if ((_rpcfdtype == 0) || (_rpcfdtype == SOCK_STREAM)) { +- if (_rpcfdtype == 0 && defport != 0) ++ if (_rpcpmstart == 0 && defport != 0) + sock = makesock(defport, IPPROTO_TCP, bufsiz); + transp = svctcp_create(sock, 0, 0); + if (transp == NULL) +@@ -220,11 +220,14 @@ + } + #endif /* SO_SNDBUF */ + +- if (bind(s, (struct sockaddr *) &sin, sizeof(sin)) == -1) +- Dprintf(L_FATAL, "Could not bind %s socket to %s:%d: %s\n", ++ if (bind(s, (struct sockaddr *) &sin, sizeof(sin)) == -1) { ++ Dprintf(L_ERROR, "Could not bind %s socket to %s:%d: %s\n", + prot_name, inet_ntoa(sin.sin_addr), + ntohs(sin.sin_port), + strerror(errno)); ++ close(s); ++ s = RPC_ANYSOCK; ++ } + + return (s); + } +--- nfs-user-server-2.2beta47.orig/showmount.c ++++ nfs-user-server-2.2beta47/showmount.c +@@ -200,7 +200,7 @@ + memset(&exportlist, '\0', sizeof(exportlist)); + clnt_stat = clnt_call(mclient, MOUNTPROC_EXPORT, + (xdrproc_t) xdr_void, NULL, +- (xdrproc_t) xdr_exports, &exportlist, ++ (xdrproc_t) xdr_exports, (caddr_t) &exportlist, + total_timeout); + if (clnt_stat != RPC_SUCCESS) { + clnt_perror(mclient, "rpc mount export"); +@@ -233,7 +233,7 @@ + memset(&dumplist, '\0', sizeof(dumplist)); + clnt_stat = clnt_call(mclient, MOUNTPROC_DUMP, + (xdrproc_t) xdr_void, NULL, +- (xdrproc_t) xdr_mountlist, &dumplist, ++ (xdrproc_t) xdr_mountlist, (caddr_t) &dumplist, + total_timeout); + if (clnt_stat != RPC_SUCCESS) { + clnt_perror(mclient, "rpc mount dump"); +--- nfs-user-server-2.2beta47.orig/ugid_clnt.c ++++ nfs-user-server-2.2beta47/ugid_clnt.c +@@ -16,7 +16,7 @@ + static int clnt_res; + + memset((char *)&clnt_res, 0, sizeof(clnt_res)); +- if (clnt_call(clnt, AUTHENTICATE, (xdrproc_t) xdr_int, argp, (xdrproc_t) xdr_int, &clnt_res, TIMEOUT) != RPC_SUCCESS) { ++ if (clnt_call(clnt, AUTHENTICATE, (xdrproc_t) xdr_int, (caddr_t) argp, (xdrproc_t) xdr_int, (caddr_t) &clnt_res, TIMEOUT) != RPC_SUCCESS) { + return (NULL); + } + return (&clnt_res); +@@ -28,7 +28,7 @@ + static int clnt_res; + + memset((char *)&clnt_res, 0, sizeof(clnt_res)); +- if (clnt_call(clnt, NAME_UID, (xdrproc_t) xdr_ugname, argp, (xdrproc_t) xdr_int, &clnt_res, TIMEOUT) != RPC_SUCCESS) { ++ if (clnt_call(clnt, NAME_UID, (xdrproc_t) xdr_ugname, (caddr_t) argp, (xdrproc_t) xdr_int, (caddr_t) &clnt_res, TIMEOUT) != RPC_SUCCESS) { + return (NULL); + } + return (&clnt_res); +@@ -40,7 +40,7 @@ + static int clnt_res; + + memset((char *)&clnt_res, 0, sizeof(clnt_res)); +- if (clnt_call(clnt, GROUP_GID, (xdrproc_t) xdr_ugname, argp, (xdrproc_t) xdr_int, &clnt_res, TIMEOUT) != RPC_SUCCESS) { ++ if (clnt_call(clnt, GROUP_GID, (xdrproc_t) xdr_ugname, (caddr_t) argp, (xdrproc_t) xdr_int, (caddr_t) &clnt_res, TIMEOUT) != RPC_SUCCESS) { + return (NULL); + } + return (&clnt_res); +@@ -52,7 +52,7 @@ + static ugname clnt_res; + + memset((char *)&clnt_res, 0, sizeof(clnt_res)); +- if (clnt_call(clnt, UID_NAME, (xdrproc_t) xdr_int, argp, (xdrproc_t) xdr_ugname, &clnt_res, TIMEOUT) != RPC_SUCCESS) { ++ if (clnt_call(clnt, UID_NAME, (xdrproc_t) xdr_int, (caddr_t) argp, (xdrproc_t) xdr_ugname, (caddr_t) &clnt_res, TIMEOUT) != RPC_SUCCESS) { + return (NULL); + } + return (&clnt_res); +@@ -64,7 +64,7 @@ + static ugname clnt_res; + + memset((char *)&clnt_res, 0, sizeof(clnt_res)); +- if (clnt_call(clnt, GID_GROUP, (xdrproc_t) xdr_int, argp, (xdrproc_t) xdr_ugname, &clnt_res, TIMEOUT) != RPC_SUCCESS) { ++ if (clnt_call(clnt, GID_GROUP, (xdrproc_t) xdr_int, (caddr_t) argp, (xdrproc_t) xdr_ugname, (caddr_t) &clnt_res, TIMEOUT) != RPC_SUCCESS) { + return (NULL); + } + return (&clnt_res); +--- nfs-user-server-2.2beta47.orig/ugid_map.c ++++ nfs-user-server-2.2beta47/ugid_map.c +@@ -602,7 +602,7 @@ + * the server's port after clntudp_create, so we fetch it + * explicitly. + */ +- clnt_control(clnt, CLGET_SERVER_ADDR, &addr); ++ clnt_control(clnt, CLGET_SERVER_ADDR, (caddr_t) &addr); + if (!SECURE_PORT(addr.sin_port)) { + Dprintf(L_ERROR, "%s on %s runs on unprivileged port.\n", + name, inet_ntoa(addr.sin_addr)); +--- nfs-user-server-2.2beta47.orig/ugidd.c ++++ nfs-user-server-2.2beta47/ugidd.c +@@ -20,6 +20,8 @@ + #include "ugid.h" + #include "logging.h" + #include "haccess.h" ++#include "rpcmisc.h" ++#include "signals.h" + #ifdef HAVE_LIBWRAP_BUG + #include + #endif +@@ -27,6 +29,8 @@ + + static void ugidprog_1(struct svc_req *rqstp, SVCXPRT *transp); + static void usage(void); ++static void terminate(void); ++static RETSIGTYPE sigterm(int sig); + + #ifndef HAVE_RPCGEN_C + #define authenticate_1_svc authenticate_1 +@@ -39,17 +43,23 @@ + + static struct option longopts[] = { + { "debug", 0, 0, 'd' }, ++ { "port", required_argument, 0, 'P' }, + { NULL, 0, 0, 0 } + }; + ++static int ugidd_versions[] = { ++ UGIDVERS, ++ 0 ++}; ++ + int + main(argc, argv) + int argc; + char **argv; + { +- SVCXPRT *transp; + int c, longind; + int foreground = 0; ++ int port = 0; + + #ifndef HOSTS_ACCESS + fprintf(stderr, +@@ -59,40 +69,34 @@ + sleep(1); + #endif + +- while ((c = getopt_long(argc, argv, "d", longopts, &longind)) != EOF) { ++ chdir("/"); ++ ++ while ((c = getopt_long(argc, argv, "dP:", longopts, &longind)) != EOF) { + switch (c) { + case 'd': + foreground = 1; + enable_logging("ugid"); + break; ++ case 'P': ++ port = atoi(optarg); ++ if (port <= 0 || port > 65535) { ++ fprintf(stderr, "ugidd: bad port number: %s\n", ++ optarg); ++ usage(); ++ } ++ break; + default: + usage(); + } + } + +- (void)pmap_unset(UGIDPROG, UGIDVERS); ++ log_open("ugidd", foreground); + +- transp = svcudp_create(RPC_ANYSOCK); +- if (transp == NULL) { +- (void)fprintf(stderr, "cannot create udp service.\n"); +- exit(1); +- } +- if (!svc_register(transp, UGIDPROG, UGIDVERS, ugidprog_1, IPPROTO_UDP)) { +- fprintf(stderr, "unable to register (UGIDPROG, UGIDVERS, UDP)\n"); +- exit(1); +- } +- +- transp = svctcp_create(RPC_ANYSOCK, 0, 0); +- if (transp == NULL) { +- fprintf(stderr, "cannot create tcp service.\n"); +- exit(1); +- } +- if (!svc_register(transp, UGIDPROG, UGIDVERS, ugidprog_1, IPPROTO_TCP)) { +- fprintf(stderr, "unable to register (UGIDPROG, UGIDVERS, TCP)\n"); +- exit(1); +- } ++ /* Create services and register with portmapper */ ++ _rpcfdtype = SOCK_DGRAM; ++ rpc_init("ugidd", UGIDPROG, ugidd_versions, ugidprog_1, port, 0); + +- if (!foreground) { ++ if (!foreground && !_rpcpmstart) { + if ((c = fork()) > 0) + exit(0); + if (c < 0) { +@@ -117,7 +121,8 @@ + #endif + } + +- log_open("ugidd", foreground); ++ install_signal_handler(SIGTERM, sigterm); ++ atexit(terminate); + + svc_run(); + Dprintf(L_ERROR, "svc_run returned\n"); +@@ -127,7 +132,7 @@ + static void + usage() + { +- fprintf(stderr, "rpc.ugidd: [-d]\n"); ++ fprintf(stderr, "rpc.ugidd: [-d] [-P port]\n"); + exit (2); + } + +@@ -188,7 +193,7 @@ + return; + } + bzero((char *)&argument, sizeof(argument)); +- if (!svc_getargs(transp, xdr_argument, &argument)) { ++ if (!svc_getargs(transp, xdr_argument, (caddr_t) &argument)) { + svcerr_decode(transp); + return; + } +@@ -196,7 +201,7 @@ + if (result != NULL && !svc_sendreply(transp, xdr_result, result)) { + svcerr_systemerr(transp); + } +- if (!svc_freeargs(transp, xdr_argument, &argument)) { ++ if (!svc_freeargs(transp, xdr_argument, (caddr_t) &argument)) { + (void)fprintf(stderr, "unable to free arguments\n"); + exit(1); + } +@@ -321,6 +326,19 @@ + } + + ++static RETSIGTYPE ++sigterm(int sig) ++{ ++ exit(0); ++} ++ ++static void ++terminate(void) ++{ ++ rpc_exit(UGIDPROG, ugidd_versions); ++} ++ ++ + + #else /* ENABLE_UGID_DAEMON */ + diff --git a/net/nfs-server/patches/004-gcc34_fix.patch b/net/nfs-server/patches/004-gcc34_fix.patch new file mode 100644 index 0000000..21915ce --- /dev/null +++ b/net/nfs-server/patches/004-gcc34_fix.patch @@ -0,0 +1,24 @@ +diff -urN nfs-server-2.2beta47.old/fh.c nfs-server-2.2beta47.dev/fh.c +--- nfs-server-2.2beta47.old/fh.c 2005-04-29 00:37:48.000000000 +0200 ++++ nfs-server-2.2beta47.dev/fh.c 2005-04-29 00:39:44.000000000 +0200 +@@ -351,13 +351,13 @@ + #ifndef ENABLE_DEVTAB + psi_t dmajor, dminor; + +-#if (SIZEOF_DEV_T == 4) +- /* This folds the upper 16 bits into bits 8..15, and +- * the lower 16 bits into bits 0..7 +- */ +- dev = (((dev >> 16) & 0xff00) ^ ((dev >> 8) & 0xff00)) | +- (((dev >> 8) & 0xff) ^ (dev & 0xff)); +-#endif ++ if (sizeof(dev_t) == 4) { ++ /* This folds the upper 16 bits into bits 8..15, and ++ * the lower 16 bits into bits 0..7 ++ */ ++ dev = (((dev >> 16) & 0xff00) ^ ((dev >> 8) & 0xff00)) | ++ (((dev >> 8) & 0xff) ^ (dev & 0xff)); ++ } + + /* + * Assuming major and minor numbers are small integers, diff --git a/net/nfs-server/patches/005-remove_warning.patch b/net/nfs-server/patches/005-remove_warning.patch new file mode 100644 index 0000000..5484b79 --- /dev/null +++ b/net/nfs-server/patches/005-remove_warning.patch @@ -0,0 +1,30 @@ +--- nfs-server-2.2beta47.old/auth_clnt.c 1999-11-10 10:18:06.000000000 +0100 ++++ nfs-server-2.2beta47/auth_clnt.c 2005-03-24 23:44:16.000000000 +0100 +@@ -238,19 +238,23 @@ + + /* First, set the user ID. */ + if (auth_uid != cred_uid) { +- if (setfsuid(cred_uid) < 0) ++ if (setfsuid(cred_uid) < 0) { ++#if 0 + Dprintf(L_ERROR, "Unable to setfsuid %d: %s\n", + cred_uid, strerror(errno)); +- else ++#endif ++ } else + auth_uid = cred_uid; + } + + /* Next, the group ID. */ + if (auth_gid != cred_gid) { +- if (setfsgid(cred_gid) < 0) ++ if (setfsgid(cred_gid) < 0) { ++#if 0 + Dprintf(L_ERROR, "Unable to setfsgid %d: %s\n", + cred_gid, strerror(errno)); +- else ++#endif ++ } else + auth_gid = cred_gid; + } + diff --git a/net/nginx/Config.in b/net/nginx/Config.in new file mode 100644 index 0000000..e451037 --- /dev/null +++ b/net/nginx/Config.in @@ -0,0 +1,39 @@ +# +# Copyright (C) 2010-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +menu "Configuration" + depends on PACKAGE_nginx + +config NGINX_STUB_STATUS + bool + prompt "Enable stub status module" + default n + help + Enable the stub status module which gives some status from the server. + +config NGINX_FLV + bool + prompt "Enable FLV module" + default n + help + Provides the ability to seek within FLV (Flash) files using time-based offsets. + +config NGINX_SSL + bool + prompt "Enable SSL module" + default n + help + Enable HTTPS/SSL support. + +config NGINX_DAV + bool + prompt "Enable WebDAV module" + default n + help + Enable the HTTP and WebDAV methods PUT, DELETE, MKCOL, COPY and MOVE. + +endmenu diff --git a/net/nginx/Makefile b/net/nginx/Makefile new file mode 100644 index 0000000..d56a729 --- /dev/null +++ b/net/nginx/Makefile @@ -0,0 +1,103 @@ +# +# Copyright (C) 2009-2012 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:=nginx +PKG_VERSION:=1.2.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://nginx.org/download/ +PKG_MD5SUM:=53105bbe3ac9319db54d9eb46119695b + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +PKG_CONFIG_DEPENDS := \ + CONFIG_NGINX_STUB_STATUS \ + CONFIG_NGINX_FLV \ + CONFIG_NGINX_SSL \ + CONFIG_NGINX_DAV + +include $(INCLUDE_DIR)/package.mk + +define Package/nginx + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=Nginx web server + URL:=http://nginx.org/ + DEPENDS:=+libpcre +libopenssl +zlib +libpthread + MENU:=1 +endef + +define Package/nginx/description + nginx is an HTTP and reverse proxy server, as well as a mail proxy server, + written by Igor Sysoev. +endef + +define Package/nginx/config + source "$(SOURCE)/Config.in" +endef + +config_files=nginx.conf mime.types fastcgi_params koi-utf koi-win win-utf + +define Package/nginx/conffiles +/etc/nginx/ +endef + +ADDITIONAL_MODULES:= + +ifeq ($(CONFIG_IPV6),y) + ADDITIONAL_MODULES += --with-ipv6 +endif +ifeq ($(CONFIG_NGINX_STUB_STATUS),y) + ADDITIONAL_MODULES += --with-http_stub_status_module +endif +ifeq ($(CONFIG_NGINX_FLV),y) + ADDITIONAL_MODULES += --with-http_flv_module +endif +ifeq ($(CONFIG_NGINX_SSL),y) + ADDITIONAL_MODULES += --with-http_ssl_module +else + ADDITIONAL_MODULES += --without-http-cache +endif +ifeq ($(CONFIG_NGINX_DAV),y) + ADDITIONAL_MODULES += --with-http_dav_module +endif + +define Build/Configure + # TODO: fix --crossbuild + (cd $(PKG_BUILD_DIR) ;\ + ./configure \ + --crossbuild=Linux::$(ARCH) \ + --prefix=/usr \ + --conf-path=/etc/nginx/nginx.conf \ + --error-log-path=/var/log/nginx/error.log \ + --pid-path=/var/run/nginx.pid \ + --lock-path=/var/lock/nginx.lock \ + --http-log-path=/var/log/nginx/access.log \ + --http-client-body-temp-path=/var/lib/nginx/body \ + --http-proxy-temp-path=/var/lib/nginx/proxy \ + --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ + --with-cc="$(TARGET_CC)" \ + --with-cc-opt="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \ + --with-ld-opt="$(TARGET_LDFLAGS)" \ + $(ADDITIONAL_MODULES) ) +endef + +define Package/nginx/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nginx $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/nginx + $(INSTALL_DATA) $(addprefix $(PKG_INSTALL_DIR)/etc/nginx/,$(config_files)) $(1)/etc/nginx/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/nginx.init $(1)/etc/init.d/nginx +endef + +$(eval $(call BuildPackage,nginx)) diff --git a/net/nginx/files/nginx.init b/net/nginx/files/nginx.init new file mode 100644 index 0000000..adf36b4 --- /dev/null +++ b/net/nginx/files/nginx.init @@ -0,0 +1,24 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2012 OpenWrt.org + +START=50 +NGINX_BIN=/usr/sbin/nginx + +start() { + mkdir -p /var/log/nginx + mkdir -p /var/lib/nginx + $NGINX_BIN +} + +stop() { + $NGINX_BIN -s stop +} + +reload() { + $NGINX_BIN -s reload +} + +shutdown() { + $NGINX_BIN -s quit +} + diff --git a/net/nginx/patches/101-feature_test_fix.patch b/net/nginx/patches/101-feature_test_fix.patch new file mode 100644 index 0000000..cb84d84 --- /dev/null +++ b/net/nginx/patches/101-feature_test_fix.patch @@ -0,0 +1,107 @@ +--- a/auto/cc/name ++++ b/auto/cc/name +@@ -7,7 +7,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then + + ngx_feature="C compiler" + ngx_feature_name= +- ngx_feature_run=yes ++ ngx_feature_run= + ngx_feature_incs= + ngx_feature_path= + ngx_feature_libs= +--- a/auto/cc/conf ++++ b/auto/cc/conf +@@ -149,7 +149,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then + else + ngx_feature="C99 variadic macros" + ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS" +- ngx_feature_run=yes ++ ngx_feature_run=no + ngx_feature_incs="#include + #define var(dummy, ...) sprintf(__VA_ARGS__)" + ngx_feature_path= +@@ -163,7 +163,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then + + ngx_feature="gcc variadic macros" + ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS" +- ngx_feature_run=yes ++ ngx_feature_run=no + ngx_feature_incs="#include + #define var(dummy, args...) sprintf(args)" + ngx_feature_path= +--- a/auto/os/linux ++++ b/auto/os/linux +@@ -48,7 +48,7 @@ fi + + ngx_feature="epoll" + ngx_feature_name="NGX_HAVE_EPOLL" +-ngx_feature_run=yes ++ngx_feature_run=no + ngx_feature_incs="#include " + ngx_feature_path= + ngx_feature_libs= +@@ -73,7 +73,7 @@ fi + CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE" + ngx_feature="sendfile()" + ngx_feature_name="NGX_HAVE_SENDFILE" +-ngx_feature_run=yes ++ngx_feature_run=no + ngx_feature_incs="#include + #include " + ngx_feature_path= +@@ -94,7 +94,7 @@ fi + CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" + ngx_feature="sendfile64()" + ngx_feature_name="NGX_HAVE_SENDFILE64" +-ngx_feature_run=yes ++ngx_feature_run=no + ngx_feature_incs="#include + #include " + ngx_feature_path= +@@ -112,7 +112,7 @@ ngx_include="sys/prctl.h"; . auto/includ + + ngx_feature="prctl(PR_SET_DUMPABLE)" + ngx_feature_name="NGX_HAVE_PR_SET_DUMPABLE" +-ngx_feature_run=yes ++ngx_feature_run=no + ngx_feature_incs="#include " + ngx_feature_path= + ngx_feature_libs= +--- a/auto/unix ++++ b/auto/unix +@@ -618,7 +618,7 @@ ngx_feature_test="void *p; p = memalign( + + ngx_feature="mmap(MAP_ANON|MAP_SHARED)" + ngx_feature_name="NGX_HAVE_MAP_ANON" +-ngx_feature_run=yes ++ngx_feature_run=no + ngx_feature_incs="#include " + ngx_feature_path= + ngx_feature_libs= +@@ -631,7 +631,7 @@ ngx_feature_test="void *p; + + ngx_feature='mmap("/dev/zero", MAP_SHARED)' + ngx_feature_name="NGX_HAVE_MAP_DEVZERO" +-ngx_feature_run=yes ++ngx_feature_run=no + ngx_feature_incs="#include + #include + #include " +@@ -646,7 +646,7 @@ ngx_feature_test='void *p; int fd; + + ngx_feature="System V shared memory" + ngx_feature_name="NGX_HAVE_SYSVSHM" +-ngx_feature_run=yes ++ngx_feature_run=no + ngx_feature_incs="#include + #include " + ngx_feature_path= +@@ -660,7 +660,7 @@ ngx_feature_test="int id; + + ngx_feature="POSIX semaphores" + ngx_feature_name="NGX_HAVE_POSIX_SEM" +-ngx_feature_run=yes ++ngx_feature_run=no + ngx_feature_incs="#include " + ngx_feature_path= + ngx_feature_libs= diff --git a/net/nginx/patches/102-sizeof_test_fix.patch b/net/nginx/patches/102-sizeof_test_fix.patch new file mode 100644 index 0000000..0cd93cc --- /dev/null +++ b/net/nginx/patches/102-sizeof_test_fix.patch @@ -0,0 +1,26 @@ +--- a/auto/types/sizeof ++++ b/auto/types/sizeof +@@ -25,8 +25,13 @@ $NGX_INCLUDE_UNISTD_H + $NGX_INCLUDE_INTTYPES_H + $NGX_INCLUDE_AUTO_CONFIG_H + ++char object_code_block[] = { ++ '\n', 'e', '4', 'V', 'A', ++ '0', 'x', ('0' + sizeof($ngx_type)), ++ 'Y', '3', 'p', 'M', '\n' ++}; ++ + int main() { +- printf("%d", (int) sizeof($ngx_type)); + return 0; + } + +@@ -40,7 +45,7 @@ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>& + + + if [ -x $NGX_AUTOTEST ]; then +- ngx_size=`$NGX_AUTOTEST` ++ ngx_size=`sed -ne 's/^e4VA0x\(.\)Y3pM$/\1/p' < $NGX_AUTOTEST` + echo " $ngx_size bytes" + fi + diff --git a/net/nginx/patches/103-sys_nerr.patch b/net/nginx/patches/103-sys_nerr.patch new file mode 100644 index 0000000..5f5d106 --- /dev/null +++ b/net/nginx/patches/103-sys_nerr.patch @@ -0,0 +1,12 @@ +--- a/src/os/unix/ngx_errno.c ++++ b/src/os/unix/ngx_errno.c +@@ -8,6 +8,9 @@ + #include + #include + ++#ifndef NGX_SYS_NERR ++#define NGX_SYS_NERR 128 ++#endif + + /* + * The strerror() messages are copied because: diff --git a/net/nginx/patches/200-config.patch b/net/nginx/patches/200-config.patch new file mode 100644 index 0000000..f350095 --- /dev/null +++ b/net/nginx/patches/200-config.patch @@ -0,0 +1,18 @@ +--- a/conf/nginx.conf ++++ b/conf/nginx.conf +@@ -1,5 +1,5 @@ + +-#user nobody; ++user nobody nogroup; + worker_processes 1; + + #error_log logs/error.log; +@@ -16,7 +16,7 @@ events { + + http { + include mime.types; +- default_type application/octet-stream; ++ #default_type application/octet-stream; + + #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + # '$status $body_bytes_sent "$http_referer" ' diff --git a/net/ngircd/Makefile b/net/ngircd/Makefile new file mode 100644 index 0000000..ab9795d --- /dev/null +++ b/net/ngircd/Makefile @@ -0,0 +1,93 @@ +# +# Copyright (C) 2008-2012 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:=ngircd +PKG_VERSION:=18 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:= \ + http://ngircd.barton.de/pub/ngircd/ \ + ftp://ftp.berlios.de/pub/ngircd/ +PKG_MD5SUM:=4958c8b2d128cf3e9888af3f782892a1 + +PKG_INSTALL:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/ngircd/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Instant Messaging + DEPENDS:=+zlib + TITLE:=Next Generation IRC Server + URL:=http://ngircd.barton.de +endef + +define Package/ngircd/Default/description + ngIRCd is an Open Source server for the Internet Relay Chat (IRC), which + is developed and published under the terms of the GNU General Public Licence. + ngIRCd means "next generation IRC daemon", it's written from scratch and + not deduced from the "grandfather of IRC daemons", the daemon of the IRCNet. +endef + +define Package/ngircd + $(call Package/ngircd/Default) + TITLE+= (with OpenSSL support) + DEPENDS+= +libopenssl + VARIANT:=ssl +endef + +define Package/ngircd/conffiles +/etc/ngircd.conf +endef + +define Package/ngircd/description + $(call Package/ngircd/Default/description) + This package is built with OpenSSL support. +endef + +define Package/ngircd-nossl +$(call Package/ngircd/Default) + TITLE+= (without OpenSSL support) + VARIANT:=nossl +endef + +Package/ngircd-nossl/conffiles = $(Package/ngircd/conffiles) + +define Package/ngircd-nossl/description + $(call Package/ngircd/Default/description) + This package is built without OpenSSL support. +endef + +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS += \ + --with-openssl="$(STAGING_DIR)/usr" +endif + +ifeq ($(BUILD_VARIANT),nossl) + CONFIGURE_ARGS += \ + --without-openssl +endif + +define Package/ngircd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ngircd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/ngircd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/ngircd.init $(1)/etc/init.d/ngircd +endef + +Package/ngircd-nossl/install = $(Package/ngircd/install) + +$(eval $(call BuildPackage,ngircd)) +$(eval $(call BuildPackage,ngircd-nossl)) diff --git a/net/ngircd/files/ngircd.init b/net/ngircd/files/ngircd.init new file mode 100644 index 0000000..6a21358 --- /dev/null +++ b/net/ngircd/files/ngircd.init @@ -0,0 +1,11 @@ +#!/bin/sh /etc/rc.common + +START=65 + +start() { + service_start /usr/sbin/ngircd +} + +stop() { + service_stop /usr/sbin/ngircd +} diff --git a/net/ngrep/Makefile b/net/ngrep/Makefile new file mode 100644 index 0000000..a516b43 --- /dev/null +++ b/net/ngrep/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ngrep +PKG_VERSION:=1.45 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/ngrep +PKG_MD5SUM:=bc8150331601f3b869549c94866b4f1c + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ngrep + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +libpcre + TITLE:=network grep + URL:=http://ngrep.sourceforge.net +endef + +define Package/ngrep/description + ngrep a pcap-aware tool that will allow you to specify extended + regular expressions to match against data payloads of packets. It + currently recognizes TCP, UDP, and ICMP across Ethernet, PPP, SLIP, + FDDI, Token Ring and null interfaces, and understands BPF filter + logic in the same fashion as more common packet sniffing tools, + like tcpdump and snoop. +endef + +CONFIGURE_ARGS+= \ + --with-pcap-includes=$(STAGING_DIR)/usr/include \ + --enable-pcre \ + --with-pcre=$(STAGING_DIR)/usr \ + --disable-dropprivs \ + +CONFIGURE_VARS+= \ + LDFLAGS="$(TARGET_LDFLAGS) -lpcre" \ + +define Package/ngrep/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/ngrep $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,ngrep)) diff --git a/net/ngrep/patches/001-makefile_in.patch b/net/ngrep/patches/001-makefile_in.patch new file mode 100644 index 0000000..5d7ab09 --- /dev/null +++ b/net/ngrep/patches/001-makefile_in.patch @@ -0,0 +1,20 @@ +diff -u ngrep-1.45/Makefile.in ngrep-1.45.mod/Makefile.in +--- ngrep-1.45/Makefile.in Tue Nov 28 15:35:37 2006 ++++ ngrep-1.45.mod/Makefile.in Sat May 19 10:40:57 2007 +@@ -32,13 +32,13 @@ + + INSTALL = ./install-sh + +-REGEX_DIR=@REGEX_DIR@ +-REGEX_OBJS=@REGEX_OBJS@ ++REGEX_DIR= ++REGEX_OBJS= + + + all: $(TARGET) + +-$(TARGET): $(REGEX_OBJS) $(OBJS) ++$(TARGET): $(OBJS) + $(CC) $(CFLAGS) $(LDFLAGS) $(STRIPFLAG) -o $(TARGET) $(OBJS) $(REGEX_OBJS) $(LIBS) + + debug: $(REGEX_OBJS) $(OBJS) \ No newline at end of file diff --git a/net/ngrep/patches/001-ngrep.patch b/net/ngrep/patches/001-ngrep.patch new file mode 100644 index 0000000..c3cb2e7 --- /dev/null +++ b/net/ngrep/patches/001-ngrep.patch @@ -0,0 +1,12 @@ +diff -ur ngrep-1.45/ngrep.c ngrep-1.45.mod/ngrep.c +--- ngrep-1.45/ngrep.c Tue Nov 28 15:38:43 2006 ++++ ngrep-1.45.mod/ngrep.c Sat May 19 10:21:27 2007 +@@ -92,7 +92,7 @@ + #endif + + #if USE_PCRE +-#include "pcre-5.0/pcre.h" ++#include "pcre.h" + #else + #include "regex-0.12/regex.h" + #endif diff --git a/net/nmap/Makefile b/net/nmap/Makefile new file mode 100644 index 0000000..e31e7b4 --- /dev/null +++ b/net/nmap/Makefile @@ -0,0 +1,139 @@ +# +# Copyright (C) 2006-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +#TODO +# +# * uClibcpp not supported, performance +100x slower. libstdcpp is being used. https://bugs.busybox.net/show_bug.cgi?id=2545 +# * liblua is still not recognized/blindly accepted. Impossible to compile with support +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=nmap +PKG_VERSION:=6.01 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://nmap.org/dist/ +PKG_MD5SUM:=a1a71940f238abb835dbf3ee7412bcea + +PKG_INSTALL:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +NMAP_DEPENDS:=+libpcap +libstdcpp +NCAT_DEPENDS:=+libpcap +NPING_DEPENDS:=+libpcap +libpthread +libstdcpp +NDIFF_DEPENDS:=+python + +define Package/nmap/default + SUBMENU:=NMAP Suite + SECTION:=net + CATEGORY:=Network + URL:=http://nmap.org/ +endef + +define Package/nmap +$(call Package/nmap/default) + DEPENDS:=$(NMAP_DEPENDS) + VARIANT:=nossl + TITLE:=Utility for network exploration or security auditing +endef + +define Package/nmap-ssl +$(call Package/nmap/default) + DEPENDS:=$(NMAP_DEPENDS) +libopenssl + VARIANT:=ssl + TITLE:=Nmap (with OpenSSL support) +endef + +define Package/ncat +$(call Package/nmap/default) + DEPENDS:=$(NCAT_DEPENDS) + VARIANT:=nossl + TITLE:=Much-improved reimplementation of Netcat +endef + +define Package/ncat-ssl +$(call Package/nmap/default) + DEPENDS:=$(NCAT_DEPENDS) +libopenssl + VARIANT:=ssl + TITLE:=Ncat (with OpenSSL support) +endef + +define Package/nping +$(call Package/nmap/default) + DEPENDS:=$(NPING_DEPENDS) + VARIANT:=nossl + TITLE:=Network packet generation tool / ping utility +endef + +define Package/ndiff +$(call Package/nmap/default) + DEPENDS:=$(NDIFF_DEPENDS) + VARIANT:=nossl + TITLE:=Utility to compare the results of Nmap scans +endef + +CONFIGURE_ARGS += \ + --with-libdnet=included \ + --with-libpcre=included \ + --with-libpcap="$(STAGING_DIR)/usr" \ + --without-liblua + +CONFIGURE_VARS += CXXFLAGS="$$$$CXXFLAGS -fno-builtin -fno-rtti" + +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS += --without-openssl +endif + +define Package/nmap/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nmap $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/share/nmap + $(CP) $(PKG_INSTALL_DIR)/usr/share/nmap/* $(1)/usr/share/nmap/ +endef + +define Package/nmap-ssl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nmap $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/share/nmap + $(CP) $(PKG_INSTALL_DIR)/usr/share/nmap/* $(1)/usr/share/nmap/ +endef + +define Package/ncat/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ncat $(1)/usr/bin/ +endef + +define Package/ncat-ssl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ncat $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/share/ncat + $(CP) $(PKG_INSTALL_DIR)/usr/share/ncat/ca-bundle.crt $(1)/usr/share/ncat/ +endef + +define Package/ndiff/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ndiff $(1)/usr/bin/ +endef + +define Package/nping/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nping $(1)/usr/bin/ +endef + + +$(eval $(call BuildPackage,nmap)) +$(eval $(call BuildPackage,nmap-ssl)) +$(eval $(call BuildPackage,ncat)) +$(eval $(call BuildPackage,ncat-ssl)) +$(eval $(call BuildPackage,nping)) +$(eval $(call BuildPackage,ndiff)) diff --git a/net/nocatauth/Makefile b/net/nocatauth/Makefile new file mode 100644 index 0000000..61d413e --- /dev/null +++ b/net/nocatauth/Makefile @@ -0,0 +1,68 @@ +# +# Copyright (C) 2009-2011 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:=nocatauth +PKG_VERSION:=nightly +PKG_RELEASE:=2 + +PKG_SOURCE:=NoCatAuth-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://nocat.net/downloads/NoCatAuth/ +PKG_MD5SUM:=b3a5f8d62b322a9409806037ab8d374e + +PKG_BUILD_DIR:=$(BUILD_DIR)/NoCatAuth-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/nocatauth + SUBMENU:=Captive Portals + SECTION:=net + CATEGORY:=Network + DEPENDS:=+perl +perlbase-essential +perlbase-posix +perlbase-autoloader +perlbase-xsloader +perlbase-fcntl +perlbase-tie +perlbase-getopt +perlbase-findbin +perlbase-cwd +perlbase-config +perlbase-file +perlbase-sigtrap +perlbase-io +perlbase-symbol +perlbase-selectsaver +perlbase-socket +perlbase-errno +kmod-ipt-ipopt +kmod-ipt-nat-extra +iptables-mod-ipopt +iptables-mod-nat-extra + TITLE:=Open public network perl-based gateway daemon + URL:=http://nocat.net +endef + +define Package/nocatauth/description + NoCatAuth is the original "catch and release" captive portal + implementation. It provides a simple splash screen web page for + clients on your network, as well as a variety of authenticated + modes. It is written in Perl. +endef + +define Build/Configure +endef + +define Build/Compile + mkdir -p $(PKG_INSTALL_DIR) + $(MAKE) -C $(PKG_BUILD_DIR) \ + PREFIX="$(PKG_INSTALL_DIR)" \ + gateway +endef + +define Package/nocatauth/install + $(INSTALL_DIR) $(1) + $(INSTALL_DIR) $(1)/www + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/htdocs/{status,splash}.html $(1)/www + $(INSTALL_DIR) $(1)/www/images + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/htdocs/images/auth_logo.gif $(1)/www/images + $(INSTALL_DIR) $(1)/usr/nocatauth/lib + $(CP) $(PKG_INSTALL_DIR)/lib/* $(1)/usr/nocatauth/lib + $(INSTALL_DIR) $(1)/usr/nocatauth/bin + $(CP) $(PKG_INSTALL_DIR)/bin/* $(1)/usr/nocatauth/bin + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/nocat.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/nocatauth-gateway $(1)/etc/init.d/nocatauth-gateway +endef + +define Package/nocatauth/conffiles +/etc/nocat.conf +endef + +$(eval $(call BuildPackage,nocatauth)) diff --git a/net/nocatauth/files/nocatauth-gateway b/net/nocatauth/files/nocatauth-gateway new file mode 100755 index 0000000..ec4c07e --- /dev/null +++ b/net/nocatauth/files/nocatauth-gateway @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009 OpenWrt.org + +START=90 +GATEWAY=/usr/nocatauth/bin/gateway +CONF=/etc/nocat.conf + +start() { + $GATEWAY -f $CONF +} + +stop() { + killall gateway +} diff --git a/net/nocatauth/patches/001-ptp-local.patch b/net/nocatauth/patches/001-ptp-local.patch new file mode 100644 index 0000000..ce5dd50 --- /dev/null +++ b/net/nocatauth/patches/001-ptp-local.patch @@ -0,0 +1,56 @@ +diff -ru NoCatAuth-nightly/bin/detect-fw.sh NoCatAuth-patched/bin/detect-fw.sh +--- NoCatAuth-nightly/bin/detect-fw.sh 2002-08-08 23:28:43.000000000 -0700 ++++ NoCatAuth-patched/bin/detect-fw.sh 2009-03-18 15:03:00.000000000 -0700 +@@ -9,8 +9,7 @@ + + # Do we have iptables *and* are running Linux 2.4? + # +-elif which iptables >/dev/null 2>&1 && \ +- test X"`uname -sr | cut -d. -f-2`" = X"Linux 2.4"; then ++elif which iptables >/dev/null 2>&1 ; then + FIREWALL=iptables + FW_BIN=iptables + +diff -ru NoCatAuth-nightly/bin/gateway NoCatAuth-patched/bin/gateway +--- NoCatAuth-nightly/bin/gateway 2003-03-07 17:56:51.000000000 -0800 ++++ NoCatAuth-patched/bin/gateway 2009-03-19 00:24:05.000000000 -0700 +@@ -7,6 +7,7 @@ + use lib "$FindBin::Bin/../lib"; + use NoCat; + use strict; ++use sigtrap qw(stack-trace untrapped error-signals); + + # Gracefully handle termination signals. + $SIG{INT} = sub { exit }; +diff -ru NoCatAuth-nightly/lib/NoCat/Gateway.pm NoCatAuth-patched/lib/NoCat/Gateway.pm +--- NoCatAuth-nightly/lib/NoCat/Gateway.pm 2003-07-30 22:22:22.000000000 -0700 ++++ NoCatAuth-patched/lib/NoCat/Gateway.pm 2009-03-19 00:22:09.000000000 -0700 +@@ -90,13 +90,12 @@ + + sub run { + my $self = shift; +- my $kids = 0; + my $hup = 0; + + return unless $self->bind_socket; + + local $SIG{PIPE} = "IGNORE"; +- local $SIG{CHLD} = sub { $kids++ }; ++ local $SIG{CHLD} = "IGNORE"; + local $SIG{HUP} = sub { $hup++ }; + + # Reset history. +@@ -134,13 +133,6 @@ + $self->log( 6, "HUP received, resetting log file." ); + $hup = 0; + } +- +- # See if any kids have expired, reap zombies +- if ( $kids ) { +- 1 until ( wait == -1 ); +- $kids = 0; +- } +- + } # loop forever + } + diff --git a/net/nocatauth/patches/002-openwrt.patch b/net/nocatauth/patches/002-openwrt.patch new file mode 100644 index 0000000..f6c3ed3 --- /dev/null +++ b/net/nocatauth/patches/002-openwrt.patch @@ -0,0 +1,30 @@ +diff -ur NoCatAuth-nightly/gateway.conf NoCatAuth-patched/gateway.conf +--- NoCatAuth-nightly/gateway.conf 2003-02-10 17:59:09.000000000 -0800 ++++ NoCatAuth-patched/gateway.conf 2009-03-19 01:20:42.000000000 -0700 +@@ -46,7 +46,7 @@ + ## + # GatewayLog -- Optional. If unset, messages will go to STDERR. + # +-GatewayLog /usr/local/nocat/nocat.log ++GatewayLog /var/log/nocat.log + + ## + # LoginTimeout - Number of seconds after a client's last +@@ -79,7 +79,7 @@ + # DocumentRoot -- Where all of the application templates (including + # SplashPage) are hiding. Can be different from Apache's DocumentRoot. + # +-DocumentRoot /usr/local/nocat/htdocs ++DocumentRoot /www + + # SplashForm -- Form displayed to users on capture. + # +@@ -289,7 +289,7 @@ + # the bin/ parent directory. Set this only if you put it + # somewhere that NoCat doesn't expect. + # +-# PGPKeyPath /usr/local/nocat/pgp ++# PGPKeyPath /usr/lib/nocatauth/pgp + + ## + # MessageVerify -- Shell command to verify a PGP signed diff --git a/net/nocatauth/patches/003-fix-module-loading b/net/nocatauth/patches/003-fix-module-loading new file mode 100644 index 0000000..9f12172 --- /dev/null +++ b/net/nocatauth/patches/003-fix-module-loading @@ -0,0 +1,31 @@ +diff -ru NoCatAuth-nightly/libexec/iptables/initialize.fw NoCatAuth-patched/libexec/iptables/initialize.fw +--- NoCatAuth-nightly/libexec/iptables/initialize.fw 2003-03-26 19:21:04.000000000 -0800 ++++ NoCatAuth-patched/libexec/iptables/initialize.fw 2009-03-19 19:24:31.000000000 -0700 +@@ -26,18 +26,6 @@ + # + echo "1" > /proc/sys/net/ipv4/ip_forward + echo "1" > /proc/sys/net/ipv4/conf/all/rp_filter +- +- # Load alllll the kernel modules we need. +- # +- rmmod ipchains > /dev/null 2>&1 # for RH 7.1 users. +- +- for module in ip_tables ipt_REDIRECT ipt_MASQUERADE ipt_MARK ipt_REJECT \ +- ipt_TOS ipt_LOG iptable_mangle iptable_filter iptable_nat ip_nat_ftp \ +- ip_conntrack ip_conntrack_ftp ip_conntrack_irc \ +- ip_nat_irc ipt_mac ipt_state ipt_mark; do +- +- modprobe $module +- done + fi + + # Flush all user-defined chains +@@ -241,6 +229,8 @@ + # Add any other local firewall rules below. + ## + ++iptables -t nat -I POSTROUTING -o $ExternalDevice -j MASQUERADE ++ + ## + # Uncomment the following to permit all 10/8 traffic *before* auth + ## diff --git a/net/nocatauth/patches/004-fw_detect.patch b/net/nocatauth/patches/004-fw_detect.patch new file mode 100644 index 0000000..18bb971 --- /dev/null +++ b/net/nocatauth/patches/004-fw_detect.patch @@ -0,0 +1,55 @@ +diff -urN NoCatAuth-nightly/bin/detect-fw.sh NoCatAuth-nightly.new/bin/detect-fw.sh +--- NoCatAuth-nightly/bin/detect-fw.sh 2010-03-27 17:44:01.000000000 +0100 ++++ NoCatAuth-nightly.new/bin/detect-fw.sh 2010-03-27 17:44:39.000000000 +0100 +@@ -6,47 +6,12 @@ + if [ -n "$1" -a -n "$2" -a -d "$2/$1" ]; then + FIREWALL=$1 + shift +- +-# Do we have iptables *and* are running Linux 2.4? +-# +-elif which iptables >/dev/null 2>&1 ; then +- FIREWALL=iptables +- FW_BIN=iptables +- +-# +-# Or do we have ipchains? +-# +-elif which ipchains >/dev/null 2>&1; then +- FIREWALL=ipchains +- FW_BIN=ipchains +- +-# +-# Or ip_filter (e.g. *BSD, Solaris, HP-UX, etc)? +-# +-# +-elif which ipf >/dev/null 2>&1; then +-ipf_running="`ipf -V | grep 'Running' | awk '{print $2}'`"; +- if [ "$ipf_running" = "yes" ]; then +- FIREWALL="ipfilter" +- FW_BIN=ipf +- else +- echo "ERROR: ip_filter appears to exist, but we're not postive that it's running" +- echo "1. You must be root for us to verify this" +- echo "2. Check that it's compiled in your kernel (either staticlly or a loaded module)" +- fi +- +-# Or packetfilter (OpenBSD 3.0+) +-elif which pfctl >/dev/null 2>&1; then +- FIREWALL=pf +- FW_BIN=pfctl +- +-else +- echo "No supported firewalls detected! Check your path." +- echo "Supported firewalls include: iptables, ipchains, ipf, pf." +- exit 1 + fi + +-echo $(which $FW_BIN) found. ++FIREWALL=iptables ++FW_BIN=iptables ++ ++echo $FW_BIN found. + + # Remove the existing *.fw links in /usr/local/nocat/bin (or wherever this is being run from) + TARGET=$1 diff --git a/net/nocatsplash/Makefile b/net/nocatsplash/Makefile new file mode 100644 index 0000000..c12eff9 --- /dev/null +++ b/net/nocatsplash/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2006-2009 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:=nocatsplash +PKG_VERSION:=0.93pre2 +PKG_RELEASE:=2 + +PKG_SOURCE:=NoCatSplash-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://nocat.net/downloads/NoCatSplash/ +PKG_MD5SUM:=b0aa5cc33a3bbdd8e65726ff3cfe3cd1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/NoCatSplash-$(PKG_VERSION) + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/nocatsplash + SUBMENU:=Captive Portals + SECTION:=net + CATEGORY:=Network + DEPENDS:=+glib1 +iptables-mod-ipopt +iptables-mod-nat-extra + TITLE:=Open public network gateway daemon + URL:=http://nocat.net +endef + +define Package/nocatsplash/description + NoCatSplash is an Open Public Network Gateway Daemon. + It performs as a [captive/open/active] portal. When run on a gateway/router + on a network, all web requests are redirected until the client either logs + in or clicks "I Accept" to an AUP. The gateway daemon then changes the + firewall rules on the gateway to pass traffic for that client (based on IP + address and MAC address). +endef + +define Package/nocatsplash/conffiles +/etc/nocat.conf +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --with-firewall=iptables \ + --with-glib-prefix="$(STAGING_DIR)/usr" \ + ) +endef + +define Package/nocatsplash/install + $(INSTALL_DIR) $(1) + $(CP) $(PKG_INSTALL_DIR)/* $(1)/ +endef + +$(eval $(call BuildPackage,nocatsplash)) diff --git a/net/nocatsplash/patches/001-openwrt_firewall.patch b/net/nocatsplash/patches/001-openwrt_firewall.patch new file mode 100644 index 0000000..a6f7129 --- /dev/null +++ b/net/nocatsplash/patches/001-openwrt_firewall.patch @@ -0,0 +1,19 @@ +diff -urN NoCatSplash-0.92.old/libexec/iptables/initialize.fw NoCatSplash-0.92/libexec/iptables/initialize.fw +--- NoCatSplash-0.92.old/libexec/iptables/initialize.fw 2002-12-27 11:44:41.000000000 +0100 ++++ NoCatSplash-0.92/libexec/iptables/initialize.fw 2005-04-04 20:45:57.000000000 +0200 +@@ -28,13 +28,9 @@ + + # Load alllll the kernel modules we need. + # +-rmmod ipchains > /dev/null 2>&1 # for RH 7.1 users. + +-for module in ip_tables ipt_REDIRECT ipt_MASQUERADE ipt_MARK ipt_REJECT \ +- ipt_TOS ipt_LOG iptable_mangle iptable_filter iptable_nat ip_nat_ftp \ +- ip_conntrack ipt_mac ipt_state ipt_mark; do +- +- modprobe $module ++for module in ipt_TOS ipt_mac ipt_REDIRECT; do ++ insmod $module + done + + diff --git a/net/nodogsplash/Makefile b/net/nodogsplash/Makefile new file mode 100644 index 0000000..69ac310 --- /dev/null +++ b/net/nodogsplash/Makefile @@ -0,0 +1,79 @@ +# +# Copyright (C) 2007-2012 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:=nodogsplash +PKG_VERSION:=0.9_beta9.9.6 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://kokoro.ucsd.edu/nodogsplash/ \ + http://kokoro.ucsd.edu/nodogsplash/old/ +PKG_MD5SUM:=3ba0d862b4d63ecf97f16176a486faed + +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/nodogsplash + SUBMENU:=Captive Portals + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpthread +iptables-mod-ipopt + TITLE:=Open public network gateway daemon + URL:=http://kokoro.ucsd.edu/nodogsplash/ +endef + +define Package/nodogsplash/description + Nodogsplash offers a simple way to open a free hotspot providing restricted access to an + internet connection. It is intended for use on wireless access points running OpenWRT + (but may also work on other Linux-based devices). +endef + +define Build/Configure + $(call Build/Configure/Default,\ + --enable-static \ + --enable-shared \ + ) +endef + +define Build/Compile + $(call Build/Compile/Default, \ + mkinstalldirs="$(INSTALL_DIR)") +endef + +define Build/Install + mkdir -p $(PKG_INSTALL_DIR)/usr/{share{,/doc/$(PKG_NAME)-$(PKG_VERSION)},lib,include{,/nodogsplash},bin,sbin}/ + $(call Build/Install/Default, \ + mkinstalldirs="$(INSTALL_DIR)" \ + install) +endef + +define Package/nodogsplash/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) + $(INSTALL_CONF) $(PKG_BUILD_DIR)/$(PKG_NAME).conf $(1)/etc/$(PKG_NAME)/ + $(SED) 's,br0,br-lan,' $(1)/etc/$(PKG_NAME)/$(PKG_NAME).conf + $(CP) $(PKG_BUILD_DIR)/htdocs $(1)/etc/$(PKG_NAME)/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) + $(SED) 's,\(do_module_tests "imq"\),#\1,' $(1)/etc/init.d/$(PKG_NAME) + $(SED) 's,\(do_module_tests "ipt_IMQ"\),#\1,' $(1)/etc/init.d/$(PKG_NAME) + $(SED) 's,\(do_module_tests "sch_htb"\),#\1,' $(1)/etc/init.d/$(PKG_NAME) +endef + +define Package/nodogsplash/conffiles +/etc/nodogsplash/nodogsplash.conf +endef + +$(eval $(call BuildPackage,nodogsplash)) diff --git a/net/nodogsplash/files/nodogsplash.init b/net/nodogsplash/files/nodogsplash.init new file mode 100644 index 0000000..7eba60b --- /dev/null +++ b/net/nodogsplash/files/nodogsplash.init @@ -0,0 +1,176 @@ +#!/bin/sh /etc/rc.common +# +# description: Startup/shutdown script for nodogsplash captive portal +# +# P. Kube 2007 +# +# (Based on wifidog startup script +# Date : 2004-08-25 +# Version : 1.0 +# Comment by that author: Could be better, but it's working as expected) +# + + +IPT=/usr/sbin/iptables +WD_DIR=/usr/bin +OPTIONS="" +START=65 +STOP=65 +# -s -d 5 runs in background, with level 5 (not so verbose) messages to syslog +# -f -d 7 runs in foreground, with level 7 (verbose) debug messages to terminal +# N.B.: -f will fail if starting at boot from rcS +#OPTIONS="-s -d 5" + +start() { + echo "Starting nodogsplash ... " + if $WD_DIR/ndsctl status 2> /dev/null; then + echo "FAILED: nodogsplash already running" + else + if test_module && $WD_DIR/nodogsplash $OPTIONS; then + echo "OK: nodogsplash started" + else + echo "FAILED: nodogsplash exited with non 0 status" + fi + fi +} + +stop() { + echo "Stopping nodogsplash ... " + if $WD_DIR/ndsctl status 2> /dev/null; then + if $WD_DIR/ndsctl stop; then + echo "OK: nodogsplash stopped" + else + echo "FAILED: ndsctl stop exited with non 0 status" + fi + else + echo "FAILED: nodogsplash was not running" + fi +} + +status() { + $WD_DIR/ndsctl status +} + +test_module() { + + ### Test ipt_mark with iptables + test_ipt_mark () { + ($IPT -A FORWARD -m mark --mark 2 -j ACCEPT 2>&1) > /dev/null + IPTABLES_OK=$? + if [ "$IPTABLES_OK" -eq 0 ]; then + ($IPT -D FORWARD -m mark --mark 2 -j ACCEPT 2>&1) > /dev/null + return 0 + else + return 1 + fi + } + ### Test ipt_mac with iptables + test_ipt_mac () { + ($IPT -A INPUT -m mac --mac-source 00:00:00:00:00:00 -j ACCEPT 2>&1) > /dev/null + IPTABLES_OK=$? + if [ "$IPTABLES_OK" -eq 0 ]; then + ($IPT -D INPUT -m mac --mac-source 00:00:00:00:00:00 -j ACCEPT 2>&1) > /dev/null + return 0 + else + return 1 + fi + } + + ### Test ipt_IMQ with iptables + test_ipt_IMQ () { + ($IPT -t mangle -A PREROUTING -j IMQ --todev 0 2>&1) > /dev/null + IPTABLES_OK=$? + if [ "$IPTABLES_OK" -eq 0 ]; then + ($IPT -t mangle -D PREROUTING -j IMQ --todev 0 2>&1) > /dev/null + return 0 + else + return 1 + fi + } + + ### Test imq with ip + test_imq () { + (ip link set imq0 up 2>&1) > /dev/null + IMQ0_OK=$? + (ip link set imq1 up 2>&1) > /dev/null + IMQ1_OK=$? + if [ "$IMQ0_OK" -eq 0 -a "$IMQ1_OK" -eq 0 ]; then + (ip link set imq0 down 2>&1) > /dev/null + (ip link set imq1 down 2>&1) > /dev/null + return 0 + else + return 1 + fi + } + + ### Test sch_htb with tc; requires imq0 + test_sch_htb () { + (tc qdisc del dev imq0 root 2>&1) > /dev/null + (tc qdisc add dev imq0 root htb 2>&1) > /dev/null + TC_OK=$? + if [ "$TC_OK" -eq 0 ]; then + (tc qdisc del dev imq0 root 2>&1) > /dev/null + return 0 + else + return 1 + fi + } + + + ### Find a module on disk + module_exists () { + EXIST=$(find /lib/modules/`uname -r` -name $1.*o 2> /dev/null) + if [ -n "$EXIST" ]; then + return 0 + else + return 1 + fi + } + + ### Test if a module is in memory + module_in_memory () { + MODULE=$(lsmod | grep $1 | awk '{print $1}') + if [ "$MODULE" = "$1" ]; then + return 0 + else + return 1 + fi + } + + ### Test functionality of a module; load if necessary + do_module_tests () { + echo " Testing module $1 $2" + "test_$1" + if [ $? -ne 0 ]; then + echo " Module $1 $2 needed" + echo " Scanning disk for $1 module" + module_exists $1 + if [ $? -ne 0 ]; then + echo " $1 module missing: please install it" + exit 1 + else + echo " $1 exists, trying to load" + insmod $1 $2 > /dev/null + if [ $? -ne 0 ]; then + echo " Error: insmod $1 $2 failed" + exit 1 + else + echo " $1 $2 loaded successfully" + fi + fi + else + echo " $1 is working" + fi + + } + + echo " Testing required modules" + + do_module_tests "ipt_mac" + do_module_tests "ipt_mark" + # if not using traffic control, + # you can comment out the following 3 lines: + do_module_tests "imq" "numdevs=2" + do_module_tests "ipt_IMQ" + do_module_tests "sch_htb" +} diff --git a/net/nodogsplash/patches/001-crash_on_missing_rdir_param.patch b/net/nodogsplash/patches/001-crash_on_missing_rdir_param.patch new file mode 100644 index 0000000..6bcf2e9 --- /dev/null +++ b/net/nodogsplash/patches/001-crash_on_missing_rdir_param.patch @@ -0,0 +1,18 @@ +--- a/src/http.c ++++ b/src/http.c +@@ -455,10 +455,15 @@ http_nodogsplash_decode_authtarget(reque + var = httpdGetVariableByName(r,"tok"); + if(var && var->value) { + token = var->value; ++ } else { ++ token = ""; + } ++ + var = httpdGetVariableByName(r,"redir"); + if(var && var->value) { + redir = var->value; ++ } else { ++ redir = ""; + } + + authtarget = http_nodogsplash_make_authtarget(token,redir); diff --git a/net/nodogsplash/patches/002-deprecated_iptables_syntax.patch b/net/nodogsplash/patches/002-deprecated_iptables_syntax.patch new file mode 100644 index 0000000..26a22af --- /dev/null +++ b/net/nodogsplash/patches/002-deprecated_iptables_syntax.patch @@ -0,0 +1,11 @@ +--- a/src/fw_iptables.c ++++ b/src/fw_iptables.c +@@ -449,7 +449,7 @@ iptables_fw_init(void) { + /* CHAIN_TO_ROUTER, related and established packets ACCEPT */ + rc |= iptables_do_command("-t filter -A " CHAIN_TO_ROUTER " -m state --state RELATED,ESTABLISHED -j ACCEPT"); + /* CHAIN_TO_ROUTER, bogus SYN packets DROP */ +- rc |= iptables_do_command("-t filter -A " CHAIN_TO_ROUTER " -p tcp --tcp-flags SYN SYN --tcp-option \\! 2 -j DROP"); ++ rc |= iptables_do_command("-t filter -A " CHAIN_TO_ROUTER " -p tcp --tcp-flags SYN SYN \\! --tcp-option 2 -j DROP"); + + /* CHAIN_TO_ROUTER, packets to HTTP listening on gw_port on router ACCEPT */ + rc |= iptables_do_command("-t filter -A " CHAIN_TO_ROUTER " -p tcp --dport %d -j ACCEPT", gw_port); diff --git a/net/nprobe/Makefile b/net/nprobe/Makefile new file mode 100644 index 0000000..400bc9b --- /dev/null +++ b/net/nprobe/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=nprobe +PKG_VERSION:=4.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=nProbe-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://downloads.openwrt.org/sources +PKG_MD5SUM:=32ed12f60eab771a79bd5f90622fa2a3 + +BUILD_DEPENDS:=libwrap +PKG_FIXUP:=autoreconf + +PKG_BUILD_DIR:=$(BUILD_DIR)/nProbe + +include $(INCLUDE_DIR)/package.mk + +define Package/nprobe + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libpcap +libpcre +libpthread +NPROBE_MYSQL_SUPPORT:libmysqlclient +zlib + TITLE:=nProbe + URL:=http://invisible-island.net/dialog/ +endef + +define Package/nprobe/config + config NPROBE_MYSQL_SUPPORT + depends on PACKAGE_nprobe + bool "MySQL support" + +endef + +define Package/nprobe/description + nprobe +endef + +ifndef CONFIG_NPROBE_MYSQL_SUPPORT + CONFIGURE_VARS += ac_cv_prog_MYSQL=no +endif + +define Build/Configure + # patch creates these, so we make them executable + chmod +x $(PKG_BUILD_DIR)/configure + chmod +x $(PKG_BUILD_DIR)/config.guess + $(call Build/Configure/Default, \ + --with-only-ipv4 \ + PCAP_ROOT="$(STAGING_DIR)/usr" \ + ) +endef + +define Build/Compile + DESTDIR=$(PKG_INSTALL_DIR) \ + LDFLAGS="$(TARGET_LDFLAGS) -ldl" \ + $(MAKE) -C $(PKG_BUILD_DIR) \ + all install +endef + +define Package/nprobe/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nprobe \ + $(1)/usr/bin/ + $(CP) -a $(PKG_INSTALL_DIR)/usr/lib/*.so* \ + $(1)/usr/lib +endef + +$(eval $(call BuildPackage,nprobe)) + diff --git a/net/nprobe/patches/001-automake-compat.patch b/net/nprobe/patches/001-automake-compat.patch new file mode 100644 index 0000000..4360b70 --- /dev/null +++ b/net/nprobe/patches/001-automake-compat.patch @@ -0,0 +1,46 @@ +--- /dev/null ++++ b/acinclude.m4 +@@ -0,0 +1 @@ ++sinclude(acinclude.m4.in) +--- a/acinclude.m4.in ++++ b/acinclude.m4.in +@@ -120,7 +120,7 @@ else + esac + fi + msg="enabled" +-AC_DEFINE(DEBUG) ++AC_DEFINE([DEBUG], [], [Enable debugging]) + ],[ + if test ".$ac_cv_prog_gcc" = ".yes"; then + case "$CFLAGS" in +--- a/configure.in ++++ b/configure.in +@@ -13,18 +13,16 @@ AC_REVISION([1.0]) + + + dnl> acconfig.h is deprecated +-AH_TEMPLATE([ HAVE_UINT64_T ],) +-AH_TEMPLATE([ HAVE_U_INT64_T ],) +-AH_TEMPLATE([ HAVE_U_INT32_T ],) +-AH_TEMPLATE([ HAVE_U_INT16_T ],) +-AH_TEMPLATE([ HAVE_U_INT8_T ],) +-AH_TEMPLATE([ HAVE_INT64_T ],) +-AH_TEMPLATE([ HAVE_INT32_T ],) +-AH_TEMPLATE([ HAVE_INT16_T ],) +-AH_TEMPLATE([ HAVE_INT8_T ],) +-AH_TEMPLATE([ u_int],) +-AH_TEMPLATE([ HAVE_ZLIB ], [ Define if you have zlib ]) +-AH_TEMPLATE([ DEBUG ], [ Define if you want a debugging version.]) ++AC_DEFINE([HAVE_UINT64_T], [], [Define if you have uint64_t]) ++AC_DEFINE([HAVE_U_INT64_T], [], [Define if you have u_int64_t]) ++AC_DEFINE([HAVE_U_INT32_T], [], [Define if you have u_int32_t]) ++AC_DEFINE([HAVE_U_INT16_T], [], [Define if you have u_int16_t]) ++AC_DEFINE([HAVE_U_INT8_T], [], [Define if you have u_int8_t]) ++AC_DEFINE([HAVE_INT64_T], [], [Define if you have int64_t]) ++AC_DEFINE([HAVE_INT32_T], [], [Define if you have int32_t]) ++AC_DEFINE([HAVE_INT16_T], [], [Define if you have int16_t]) ++AC_DEFINE([HAVE_INT8_T], [], [Define if you have int8_t]) ++AC_DEFINE([HAVE_ZLIB], [], [Define if you have zlib]) + + echo + echo "Welcome to $PACKAGE_NAME, Version $PACKAGE_VERSION" diff --git a/net/nprobe/patches/002-path_to_pcap.patch b/net/nprobe/patches/002-path_to_pcap.patch new file mode 100644 index 0000000..7f2c155 --- /dev/null +++ b/net/nprobe/patches/002-path_to_pcap.patch @@ -0,0 +1,13 @@ +--- a/configure.in ++++ b/configure.in +@@ -331,8 +331,8 @@ dnl> user defined directory passed as op + dnl> + if test ".${PCAP_ROOT}" != .; then + if test -d $PCAP_ROOT && +- test -r $PCAP_ROOT/libpcap.a && +- test -r $PCAP_ROOT/pcap.h; then ++ test -r $PCAP_ROOT/lib/libpcap.a && ++ test -r $PCAP_ROOT/include/pcap.h; then + PCAP_ROOT=`cd ${PCAP_ROOT} && pwd` + CORELIBS="${CORELIBS} -L$PCAP_ROOT -lpcap" + INCS="${INCS} -I$PCAP_ROOT" diff --git a/net/nprobe/patches/003-ipv6_fix.patch b/net/nprobe/patches/003-ipv6_fix.patch new file mode 100644 index 0000000..689487b --- /dev/null +++ b/net/nprobe/patches/003-ipv6_fix.patch @@ -0,0 +1,35 @@ +--- a/nprobe.c ++++ b/nprobe.c +@@ -241,8 +241,10 @@ void processPacket(u_char *_deviceId, + u_short eth_type, off=0, numPkts = 1; + u_int8_t flags = 0, proto = 0; + struct ip ip; ++ #ifndef IPV4_ONLY + struct ip6_hdr ipv6; + struct ip6_ext ipv6ext; ++ #endif + struct tcphdr tp; + struct udphdr up; + struct icmp icmpPkt; +@@ -362,7 +364,9 @@ void processPacket(u_char *_deviceId, + isFragment = (ntohs(ip.ip_off) & 0x3fff) ? 1 : 0; + + off = ntohs(ip.ip_off); +- } else if(eth_type == ETHERTYPE_IPV6) { ++ } ++ #ifndef IPV4_ONLY ++ else if(eth_type == ETHERTYPE_IPV6) { + memcpy(&ipv6, p+ehshift, sizeof(struct ip6_hdr)); + if(((ipv6.ip6_vfc >> 4) & 0x0f) != 6) return; /* IP v6 only */ + estimatedLen = sizeof(struct ip6_hdr)+ehshift+htons(ipv6.ip6_plen); +@@ -392,7 +396,9 @@ void processPacket(u_char *_deviceId, + hlen += (ipv6ext.ip6e_len+1)*8; + proto = ipv6ext.ip6e_nxt; + } +- } else ++ } ++ #endif //IPV4_ONLY ++ else + return; /* Anything else that's not IPv4/v6 */ + + plen = length-ehshift; diff --git a/net/nstx/Makefile b/net/nstx/Makefile new file mode 100644 index 0000000..6b5f0a9 --- /dev/null +++ b/net/nstx/Makefile @@ -0,0 +1,64 @@ +# +# 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:=nstx +PKG_VERSION:=1.1-beta6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/n/nstx/ +PKG_MD5SUM:=275abd75a856b07a798b1f2360088cf5 + +include $(INCLUDE_DIR)/package.mk + +define Package/nstx/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Firewall Tunnel + TITLE:=allows you to pass IP packets via DNS queries + URL:=http://savannah.nongnu.org/projects/nstx/ +endef + +define Package/nstx + $(call Package/nstx/Default) + TITLE+= client version +endef + +define Package/nstx/description + nstx client version +endef + +define Package/nstxd + $(call Package/nstx/Default) + TITLE+= server version +endef + +define Package/nstxd/description + nstx server version +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" +endef + +define Package/nstx/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/nstxcd $(1)/usr/sbin/ +endef + +define Package/nstxd/install + $(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/nstxd $(1)/usr/sbin +endef + +$(eval $(call BuildPackage,nstx)) +$(eval $(call BuildPackage,nstxd)) diff --git a/net/nstx/patches/001-debian_changes.patch b/net/nstx/patches/001-debian_changes.patch new file mode 100644 index 0000000..df31962 --- /dev/null +++ b/net/nstx/patches/001-debian_changes.patch @@ -0,0 +1,382 @@ +diff -urN nstx-1.1-beta6/Makefile nstx-1.1-beta6.new/Makefile +--- nstx-1.1-beta6/Makefile 2004-06-27 23:46:38.000000000 +0200 ++++ nstx-1.1-beta6.new/Makefile 2006-12-24 12:15:23.000000000 +0100 +@@ -1,4 +1,4 @@ +-CFLAGS += -ggdb -Wall -Werror ++CFLAGS += -ggdb -Wall -Werror -Wsign-compare + + NSTXD_SRCS = nstxd.c nstx_encode.c nstx_pstack.c nstx_dns.c nstx_tuntap.c nstx_queue.c + NSTXD_OBJS = ${NSTXD_SRCS:.c=.o} +diff -urN nstx-1.1-beta6/nstx_dns.c nstx-1.1-beta6.new/nstx_dns.c +--- nstx-1.1-beta6/nstx_dns.c 2004-06-27 23:43:34.000000000 +0200 ++++ nstx-1.1-beta6.new/nstx_dns.c 2006-12-24 12:15:23.000000000 +0100 +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + + #include "nstxfun.h" + #include "nstxdns.h" +@@ -58,7 +59,7 @@ + * DNS-packet 'msg'. */ + + static char * +-decompress_label(const char *msg, int msglen, const char *lbl) ++decompress_label(const char *msg, unsigned int msglen, const char *lbl) + { + const char *ptr = lbl; + char *buf; +@@ -69,7 +70,7 @@ + + while ((chunklen = *ptr)) { + if (chunklen > 63) { +- if ((ptr-msg) >= (msglen-1)) { ++ if ((ptr-msg) >= ((signed int)msglen-1)) { + DEBUG("Bad pointer at end of msg"); + if (buf) + free(buf); +@@ -104,13 +105,15 @@ + ptr += chunklen + 1; + } + } +- buf[buflen] = 0; +- buflen++; ++ if (buf) { ++ buf[buflen] = 0; ++ buflen++; ++ } + return buf; + } + + static const unsigned char * +-_cstringify(const unsigned char *data, int *dlen, int clen) ++_cstringify(const unsigned char *data, int *dlen, unsigned int clen) + { + static unsigned char *buf; + +@@ -143,7 +146,7 @@ + { + int len; + +- len = strlen(data); ++ len = strlen((char*)data); + return _cstringify(data, &len, 63); + } + +@@ -183,24 +186,24 @@ + static const unsigned char * + lbl2data (const unsigned char *data, size_t len) + { +- static unsigned char *buf; +- ++ static signed char *buf = NULL; + const unsigned char *s = data; +- unsigned char *d; +- unsigned int llen; ++ signed char *d; ++ signed int llen; + + d = buf = realloc(buf, len); ++ assert(d); + do + { + llen = *s++; +- if ((llen > 63) || (llen > len - (s - data))) +- return NULL; ++ if ((llen > 63) || (llen > (signed int)(len - (s - data)))) ++ break; + memcpy(d, s, llen); + s += llen; + d += llen; + } while (llen); + *d = '\0'; +- return buf; ++ return (const unsigned char*)buf; + } + + /* New DNS-Code */ +@@ -318,7 +321,7 @@ + const char *ptr; + static char *fqdn; + +- ptr = data2lbl(data); ++ ptr = (char*)data2lbl((unsigned char*)data); + fqdn = realloc(fqdn, strlen(ptr)+strlen(suffix)+1); + strcpy(fqdn, ptr); + strcat(fqdn, suffix); +@@ -336,8 +339,9 @@ + free(buf); + + off = strstr(fqdn, suffix); +- if (off) +- buf = strdup(lbl2data(fqdn, off - fqdn)); ++ /* only parse if the fqdn was found, and there is more than the fqdn */ ++ if (off && off != fqdn) ++ buf = strdup((char*)lbl2data((unsigned char*)fqdn, off - fqdn)); + else + /* Our suffix not found... */ + buf = NULL; +@@ -364,7 +368,7 @@ + const char *ptr; + char *buf; + +- ptr = data2txt(data, &len); ++ ptr = (char*)data2txt((unsigned char*)data, &len); + buf = malloc(len); + memcpy(buf, ptr, len); + +@@ -477,7 +481,7 @@ + { + offsets[i++] = ptr - buf; + rrp = _new_listitem(&pkt->query); +- rrp->data = decompress_label(buf, len, ptr); ++ rrp->data = decompress_label((char*)buf, len, (char*)ptr); + if (!rrp->data) + { + syslog(LOG_ERR, "dns_extractpkt: decompress_label choked in qd\n"); +@@ -517,8 +521,9 @@ + if (j < i) + rrp->link = j; + } +- ptr = _skip_lbl(ptr, &remain); +- rrp->len = ptr[8]*256+ptr[9]; ++ // ptr = _skip_lbl(ptr, &remain); ++ // rrp->len = ptr[8]*256+ptr[9]; ++ rrp->len = ptr[10]*256+ptr[11]; + ptr += 12; + remain -= 12; + if (remain < rrp->len) +diff -urN nstx-1.1-beta6/nstx_encode.c nstx-1.1-beta6.new/nstx_encode.c +--- nstx-1.1-beta6/nstx_encode.c 2004-06-27 23:43:34.000000000 +0200 ++++ nstx-1.1-beta6.new/nstx_encode.c 2006-12-24 12:15:23.000000000 +0100 +@@ -30,11 +30,11 @@ + + void init_revmap (void) + { +- int i; ++ unsigned int i; + + revmap = malloc(256); + +- for (i = 0; i < strlen(map); i++) ++ for (i = 0; i < strlen((char*)map); i++) + revmap[map[i]] = i; + } + +@@ -70,11 +70,11 @@ + if (!revmap) + init_revmap(); + +- len = strlen(data)-1; +- ++ len = strlen((char*)data); ++ + buf = realloc(buf, ((len+3)/4)*3); + +- while (off < len) { ++ while (off+3 < len) { + buf[i+0] = (revmap[data[off]]<<2)|((revmap[data[off+1]]&48)>>4); + buf[i+1] = ((revmap[data[off+1]]&15)<<4)|((revmap[data[off+2]]&60)>>2); + buf[i+2] = ((revmap[data[off+2]]&3)<<6)|(revmap[data[off+3]]); +diff -urN nstx-1.1-beta6/nstx_pstack.c nstx-1.1-beta6.new/nstx_pstack.c +--- nstx-1.1-beta6/nstx_pstack.c 2004-06-27 23:43:34.000000000 +0200 ++++ nstx-1.1-beta6.new/nstx_pstack.c 2006-12-24 12:15:23.000000000 +0100 +@@ -49,7 +49,7 @@ + char *netpacket; + int netpacketlen; + +- if ((!ptr) || len < sizeof(struct nstxhdr)) ++ if ((!ptr) || (signed int) len < (signed int) sizeof(struct nstxhdr)) + return; + + if (!nstxpkt->id) +diff -urN nstx-1.1-beta6/nstx_tuntap.c nstx-1.1-beta6.new/nstx_tuntap.c +--- nstx-1.1-beta6/nstx_tuntap.c 2004-06-27 23:43:34.000000000 +0200 ++++ nstx-1.1-beta6.new/nstx_tuntap.c 2006-12-24 12:15:23.000000000 +0100 +@@ -215,7 +215,7 @@ + + struct nstxmsg *nstx_select (int timeout) + { +- int peerlen; ++ unsigned peerlen; + fd_set set; + struct timeval tv; + static struct nstxmsg *ret = NULL; +diff -urN nstx-1.1-beta6/nstxcd.8 nstx-1.1-beta6.new/nstxcd.8 +--- nstx-1.1-beta6/nstxcd.8 1970-01-01 01:00:00.000000000 +0100 ++++ nstx-1.1-beta6.new/nstxcd.8 2006-12-24 12:15:23.000000000 +0100 +@@ -0,0 +1,36 @@ ++.TH NSTXCD "8" "May 2004" "nstx 1.1-beta4" "User Commands" ++.SH NAME ++nstxcd \- IP over DNS tunneling client ++ ++.SH SYNOPSIS ++.B "nstxcd \fIDOMAIN\fR \fIIPADDRESS\fR" ++ ++.SH DESCRIPTION ++.B nstxcd ++tunnels IP packets over DNS, allowing them to be sent to a server without ++any protocols other than DNS being used. ++ ++.SH OPTIONS ++.B nstxcd ++takes the following options: ++.IP "domain" ++The domain that nstxcd will send requests to. This domain must be delegated ++to a machine that is running nstxd. ++.IP "IP address" ++The IP address of a DNS server that can be reached from the current machine. ++ ++.SH USAGE ++.Bnstxcd ++should be run against a domain that has been delegated to a machine running ++nstxd. It will then take any packets that are sent to the tun0 interface and ++send them over DNS to the other tunnel endpoint. Responses will appear on ++the tun0 interface. ++ ++.SH AUTHORS ++ ++.IP ++Florian Heinz ++.IP ++Julien Oster ++.IP ++http://nstx.dereference.de/nstx/ +diff -urN nstx-1.1-beta6/nstxcd.c nstx-1.1-beta6.new/nstxcd.c +--- nstx-1.1-beta6/nstxcd.c 2004-06-27 23:43:34.000000000 +0200 ++++ nstx-1.1-beta6.new/nstxcd.c 2006-12-24 12:15:23.000000000 +0100 +@@ -63,7 +63,7 @@ + int main (int argc, char * argv[]) { + struct nstxmsg *msg; + const char *device = NULL; +- char ch; ++ int ch; + + nsid = time(NULL); + +@@ -110,11 +110,11 @@ + const char *data; + int datalen; + +- pkt = dns_extractpkt (reply, len); ++ pkt = dns_extractpkt ((unsigned char*)reply, len); + if (!pkt) + return; + while ((data = dns_getanswerdata(pkt, &datalen))) { +- data = txt2data(data, &datalen); ++ data = (char*)txt2data((unsigned char*)data, &datalen); + nstx_handlepacket (data, datalen, &sendtun); + } + dequeueitem(pkt->id); +@@ -159,9 +159,9 @@ + data += l; + datalen -= l; + +- dns_addquery(pkt, dns_data2fqdn(nstx_encode(p, sizeof(nh)+l))); ++ dns_addquery(pkt, dns_data2fqdn(nstx_encode((unsigned char*)p, sizeof(nh)+l))); + free(p); +- p = dns_constructpacket(pkt, &l); ++ p = (char*)dns_constructpacket(pkt, &l); + sendns(p, l, NULL); + free(p); + +diff -urN nstx-1.1-beta6/nstxd.8 nstx-1.1-beta6.new/nstxd.8 +--- nstx-1.1-beta6/nstxd.8 1970-01-01 01:00:00.000000000 +0100 ++++ nstx-1.1-beta6.new/nstxd.8 2006-12-24 12:15:23.000000000 +0100 +@@ -0,0 +1,47 @@ ++.TH NSTXD "7" "Mar 2005" "nstx 1.1-beta6" "User Commands" ++.SH NAME ++nstxd \- IP over DNS tunneling daemon ++ ++.SH SYNOPSIS ++.B "nstxd \fIOPTION\fR \fIDOMAIN\fR" ++ ++.SH DESCRIPTION ++.B nstxd ++listens for well formed DNS requests and translates them into IP packets. ++Responses are sent in the form of DNS replies. This allows clients to ++tunnel IP packets over the DNS protocol. ++ ++.SH OPTIONS ++.B nstxd ++takes the following option: ++.IP \-d tun-device ++Use this tun device instead of tun0 ++.IP \-i ipaddr ++Bind to this IP address rather than every available address ++.IP \-C dir ++Chroot to this directory on startup ++.IP \-D ++Daemonize on startup ++.IP \-g ++Switch on debug messages ++.IP \-u user ++Run as the following user ++.IP "domain" ++The domain that nstxd will listen to requests for. This should be a domain ++that is delegated to the machine running nstxd. ++ ++.SH USAGE ++A domain should be delegated to the machine that will run nstxd. nstxd should ++then be run giving that domain as the only argument. nstxd will then listen ++for requests and translate them into IP packets that will appear on the tun0 ++interface. Packets sent to the tun0 interface will be transferred back to ++the client as DNS answers. ++ ++.SH AUTHORS ++ ++.IP ++Florian Heinz ++.IP ++Julien Oster ++.IP ++http://nstx.dereference.de/nstx/ +diff -urN nstx-1.1-beta6/nstxd.c nstx-1.1-beta6.new/nstxd.c +--- nstx-1.1-beta6/nstxd.c 2004-06-27 23:55:17.000000000 +0200 ++++ nstx-1.1-beta6.new/nstxd.c 2006-12-24 12:15:23.000000000 +0100 +@@ -67,7 +67,7 @@ + } + + int main (int argc, char *argv[]) { +- char ch; ++ signed char ch; + const char *device = NULL, *dir = NULL; + in_addr_t bindto = INADDR_ANY; + uid_t uid = 0; +@@ -172,7 +172,7 @@ + dns_setid(pkt, q->id); + dns_settype(pkt, DNS_RESPONSE); + dns_addanswer(pkt, "\xb4\x00\x00\x00", 4, dns_addquery(pkt, q->name)); +- buf = dns_constructpacket (pkt, &len); ++ buf = (char*)dns_constructpacket (pkt, &len); + sendns(buf, len, &q->peer); + free(buf); + } +@@ -188,7 +188,7 @@ + + if (msg) { + if (msg->src == FROMNS) { +- pkt = dns_extractpkt(msg->data, msg->len); ++ pkt = dns_extractpkt((unsigned char*)msg->data, msg->len); + if (pkt) + { + name = dns_getquerydata(pkt); +@@ -198,7 +198,7 @@ + name); + queueitem(pkt->id, name, &msg->peer); + if ((data = dns_fqdn2data(name)) && +- (buf = nstx_decode(data, &len))) ++ (buf = nstx_decode((unsigned char*)data, &len))) + { + nstx_handlepacket(buf, len, &sendtun); + } +@@ -220,7 +220,7 @@ + len = dns_getfreespace(pkt, DNS_RESPONSE); + buf = dequeue_senditem(&len); + dns_addanswer(pkt, buf, len, link); +- buf = dns_constructpacket(pkt, &len); ++ buf = (char*)dns_constructpacket(pkt, &len); + sendns(buf, len, &qitem->peer); + } + timeoutqueue(do_timeout); diff --git a/net/ntpclient/Makefile b/net/ntpclient/Makefile new file mode 100644 index 0000000..841f3e0 --- /dev/null +++ b/net/ntpclient/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ntpclient +PKG_VERSION:=2007_365 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://doolittle.icarus.com/ntpclient/ +PKG_MD5SUM:=cb98711f11769cdd22fc592844cef414 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-2007 + +include $(INCLUDE_DIR)/package.mk + +define Package/ntpclient + SUBMENU:=Time Synchronization + SECTION:=net + CATEGORY:=Network + TITLE:=NTP (Network Time Protocol) client + URL:=http://doolittle.icarus.com/ntpclient/ + DEPENDS:=+librt +endef + +define Package/ntpclient/description + NTP client for setting system time from NTP servers. +endef + +define Package/ntpclient/conffiles +/etc/config/ntpclient +endef + +MAKE_FLAGS += \ + all adjtimex + +define Package/ntpclient/install + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_DATA) ./files/ntpclient.hotplug $(1)/etc/hotplug.d/iface/20-ntpclient + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/ntpclient.config $(1)/etc/config/ntpclient + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpclient $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/adjtimex $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/rate.awk $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,ntpclient)) diff --git a/net/ntpclient/files/ntpclient.config b/net/ntpclient/files/ntpclient.config new file mode 100644 index 0000000..10be886 --- /dev/null +++ b/net/ntpclient/files/ntpclient.config @@ -0,0 +1,23 @@ +config ntpserver + option hostname '0.openwrt.pool.ntp.org' + option port '123' + +config ntpserver + option hostname '1.openwrt.pool.ntp.org' + option port '123' + +config ntpserver + option hostname '2.openwrt.pool.ntp.org' + option port '123' + +config ntpserver + option hostname '3.openwrt.pool.ntp.org' + option port '123' + +config ntpdrift + option freq '0' + +config ntpclient + option interval 600 + #option count 10 + #option interface wan diff --git a/net/ntpclient/files/ntpclient.hotplug b/net/ntpclient/files/ntpclient.hotplug new file mode 100644 index 0000000..536f531 --- /dev/null +++ b/net/ntpclient/files/ntpclient.hotplug @@ -0,0 +1,78 @@ +#!/bin/sh +# Copyright (C) 2006 OpenWrt.org + +. /lib/functions.sh + +unset SERVER +unset PORT +unset INTERVAL +unset COUNT +unset INTERFACE_GLOBAL + +NTPC=`which ntpclient` + +check_server() { + local hostname + local port + local interface + [ -n "$SERVER" ] && return + config_get hostname $1 hostname + config_get port $1 port + config_get interface $1 interface + + [ -z "$interface" ] && interface=$INTERFACE_GLOBAL + + [ -n "$interface" ] && { + # $INTERFACE is passed from hotplug event + [ "$interface" = "$INTERFACE" ] || return + } + + [ -z "$hostname" ] && return + $NTPC -c 1 -p ${port:-123} -i 2 -h $hostname > /dev/null && { SERVER=$hostname; PORT=${port:-123}; } +} + +set_drift() { + config_get freq $1 freq + [ -n "$freq" ] && adjtimex -f $freq >/dev/null +} + +start_ntpclient() { + config_foreach set_drift ntpdrift + config_foreach check_server ntpserver + [ -z "$SERVER" ] && exit 0 + logger starting ntpclient + $NTPC ${COUNT:+-c $COUNT} ${INTERVAL:+-i $INTERVAL} -s -l -D -p $PORT -h $SERVER 2> /dev/null +} + +stop_ntpclient() { + logger stopping ntpclient + killall ntpclient +} + +load_settings() { + local interval + local count + local iface + + config_get interval $1 interval + config_get count $1 count + config_get interface $1 interface + + [ -n "$count" ] && COUNT=$count + [ -n "$interval" ] && INTERVAL=$interval + [ -n "$interface" ] && INTERFACE_GLOBAL=$interface +} + +config_load ntpclient +config_foreach load_settings ntpclient + +NTP_RUNNING=`ps | grep $NTPC | grep -v grep` + +case "${ACTION:-ifup}" in + ifup) + [ -z "$NTP_RUNNING" ] && start_ntpclient + ;; + ifdown) + [ -n "$NTP_RUNNING" ] && stop_ntpclient + ;; +esac diff --git a/net/ntpclient/patches/100-daemon.patch b/net/ntpclient/patches/100-daemon.patch new file mode 100644 index 0000000..0ff8d5e --- /dev/null +++ b/net/ntpclient/patches/100-daemon.patch @@ -0,0 +1,24 @@ +Index: ntpclient-2007/ntpclient.c +=================================================================== +--- ntpclient-2007.orig/ntpclient.c 2008-08-12 03:11:34.000000000 +0200 ++++ ntpclient-2007/ntpclient.c 2008-08-12 03:11:36.000000000 +0200 +@@ -614,7 +614,7 @@ + ntpc.cross_check=1; + + for (;;) { +- c = getopt( argc, argv, "c:" DEBUG_OPTION "f:g:h:i:lp:q:" REPLAY_OPTION "st"); ++ c = getopt( argc, argv, "c:" DEBUG_OPTION "f:g:h:i:lp:q:" REPLAY_OPTION "stD"); + if (c == EOF) break; + switch (c) { + case 'c': +@@ -663,6 +663,10 @@ + (ntpc.cross_check)=0; + break; + ++ case 'D': ++ daemon(); ++ break; ++ + default: + usage(argv[0]); + exit(1); diff --git a/net/ntpd/Makefile b/net/ntpd/Makefile new file mode 100644 index 0000000..514b674 --- /dev/null +++ b/net/ntpd/Makefile @@ -0,0 +1,197 @@ +# +# Copyright (C) 2006-2011 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:=ntp +PKG_VERSION:=4.2.6p5 +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:=00df80a84ec9528fcfb09498075525bc + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_BUILD_DEPENDS:=libelf +PKG_FIXUP:=autoreconf +PKG_LIBTOOL_PATHS:=. sntp + +include $(INCLUDE_DIR)/package.mk + +define Package/ntpd/Default + SUBMENU:=Time Synchronization + SECTION:=net + CATEGORY:=Network + TITLE:=ISC ntp + MAINTAINER:=Peter Wagner + URL:=http://www.ntp.org/ + DEPENDS:=+libcap +endef + +define Package/ntpd/Default/description + The ISC ntp suite is a collection of tools used to synchronize the + system clock with remote NTP time servers and run/montior local NTP + servers. +endef + +define Package/ntpd +$(call Package/ntpd/Default) + TITLE+= server + VARIANT:=nossl +endef + +define Package/ntpd/description +$(call Package/ntpd/Default/description) + . + This package contains the ntpd server. +endef + +define Package/ntpd-ssl +$(call Package/ntpd/Default) + TITLE+= server (with OpenSSL support) + VARIANT:=ssl + DEPENDS+= +libopenssl +endef + +define Package/ntpd-ssl/description +$(call Package/ntpd/Default/description) + . + This package contains the ntpd server with OpenSSL support. +endef + +define Package/ntpdate +$(call Package/ntpd/Default) + TITLE+=date + VARIANT:=nossl +endef + +define Package/ntpdate/description +$(call Package/ntpd/Default/description) + . + This package contains ntpdate. +endef + +define Package/ntp-utils +$(call Package/ntpd/Default) + TITLE+= utilities + VARIANT:=nossl +endef + +define Package/ntp-utils/description +$(call Package/ntpd/Default/description) + . + This package contains ntpdc, ntpq and ntptime. +endef + +define Package/ntp-keygen +$(call Package/ntpd/Default) + TITLE+=keygen + VARIANT:=nossl +endef + +define Package/ntp-keygen/description +$(call Package/ntpd/Default/description) + . + This package contains the ntp-keygen. +endef + +define Package/ntp-keygen-ssl +$(call Package/ntpd/Default) + TITLE+=keygen (with OpenSSL support) + VARIANT:=ssl + DEPENDS+= +libopenssl +endef + +define Package/ntp-keygen-ssl/description +$(call Package/ntpd/Default/description) + . + This package contains the ntp-keygen with OpenSSL support. +endef + +define Package/ntpd/conffiles +/etc/ntp.conf +endef + +TARGET_CPPFLAGS += \ + -I$(STAGING_DIR)/usr/include/libelf + +CONFIGURE_VARS += \ + ac_cv_header_md5_h=no \ + ac_cv_lib_rt_sched_setscheduler=no \ + ac_cv_header_dns_sd_h=no + +CONFIGURE_ARGS += \ + --disable-all-clocks \ + --disable-parse-clocks \ + --without-ntpsnmpd \ + --without-lineeditlibs \ + --enable-NMEA \ + --enable-LOCAL-CLOCK \ + --enable-SHM \ + --enable-linuxcaps + +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS += \ + --with-crypto \ + --with-openssl-incdir="$(STAGING_DIR)/usr/include" \ + --with-openssl-libdir="$(STAGING_DIR)/usr/lib" +endif + +define Package/ntpd/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpd/ntpd $(1)/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/ntp.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/ntpd.init $(1)/etc/init.d/ntpd + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_BIN) ./files/ntpd.hotplug $(1)/etc/hotplug.d/iface/20-ntpd +endef + +define Package/ntpd/postinst +#!/bin/sh +[ -L "$${IPKG_INSTROOT}/usr/sbin/ntpd" ] && rm -f "$${IPKG_INSTROOT}/usr/sbin/ntpd" +exit 0 +endef + +define Package/ntpd/postrm +#!/bin/sh +/bin/busybox ntpd -h 2>&1 | grep -q BusyBox && ln -sf ../../bin/busybox /usr/sbin/ntpd +exit 0 +endef + +Package/ntpd-ssl/conffiles = $(Package/ntpd/conffiles) +Package/ntpd-ssl/install = $(Package/ntpd/install) + +define Package/ntpdate/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdate/ntpdate $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/ntpdate.init $(1)/etc/init.d/ntpdate +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 + +define Package/ntp-keygen/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/util/ntp-keygen $(1)/usr/sbin/ +endef + +Package/ntp-keygen-ssl/install = $(Package/ntp-keygen/install) + +$(eval $(call BuildPackage,ntpd)) +$(eval $(call BuildPackage,ntpd-ssl)) +$(eval $(call BuildPackage,ntpdate)) +$(eval $(call BuildPackage,ntp-utils)) +$(eval $(call BuildPackage,ntp-keygen)) +$(eval $(call BuildPackage,ntp-keygen-ssl)) diff --git a/net/ntpd/files/ntp.conf b/net/ntpd/files/ntp.conf new file mode 100644 index 0000000..8bfb8e3 --- /dev/null +++ b/net/ntpd/files/ntp.conf @@ -0,0 +1,26 @@ +# use a random selection of 4 public stratum 2 servers +# see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers + +#restrict default nomodify notrap noquery +#restrict default noquery + +restrict 127.0.0.1 + +driftfile /var/lib/ntp/ntp.drift + +server 0.openwrt.pool.ntp.org iburst +server 1.openwrt.pool.ntp.org iburst +server 2.openwrt.pool.ntp.org iburst +server 3.openwrt.pool.ntp.org iburst + + +# GPS(NMEA)+PPS +#server 127.127.20.0 minpoll 4 prefer +#fudge 127.127.20.0 flag3 1 flag2 0 + +# SMA PPS +#server 127.127.28.0 minpoll 4 prefer +#fudge 127.127.28.0 refid PPS flag3 1 + +#server 192.168.1.253 + diff --git a/net/ntpd/files/ntpd.hotplug b/net/ntpd/files/ntpd.hotplug new file mode 100644 index 0000000..992628f --- /dev/null +++ b/net/ntpd/files/ntpd.hotplug @@ -0,0 +1,10 @@ +NAME=ntpd +CONFIG=/etc/ntp.conf +COMMAND=/usr/sbin/$NAME + +[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && { + [ -x $COMMAND ] && [ -r $CONFIG ] && { + killall ntpd + /etc/init.d/ntpd start + } & +} diff --git a/net/ntpd/files/ntpd.init b/net/ntpd/files/ntpd.init new file mode 100644 index 0000000..5eb75f6 --- /dev/null +++ b/net/ntpd/files/ntpd.init @@ -0,0 +1,21 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=65 +STOP=65 + +SERVICE_USE_PID=1 + +start() { +# ln -sf /dev/ttyS0 /dev/gps0 +# /usr/sbin/setgarmin -d /dev/gps -c /etc/setgarmin.conf + user_exists ntp 123 || user_add ntp 123 123 ntp /var/lib/ntp + group_exists ntp 123 || group_add ntp 123 + mkdir -p /var/lib/ntp + chown -R ntp:ntp /var/lib/ntp + service_start /sbin/ntpd -g -u ntp:ntp -p /var/run/ntpd.pid +} + +stop() { + service_stop /sbin/ntpd +} diff --git a/net/ntpd/files/ntpdate.init b/net/ntpd/files/ntpdate.init new file mode 100644 index 0000000..2f33210 --- /dev/null +++ b/net/ntpd/files/ntpdate.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2008 OpenWrt.org + +START=60 + +STEP_SERVERS="0.openwrt.pool.ntp.org 1.openwrt.pool.ntp.org 2.openwrt.pool.ntp.org" +TIMEOUT="2" # in seconds + +start() { + for s in $STEP_SERVERS ; do + /usr/sbin/ntpdate -s -b -u -t "$TIMEOUT" "$s" && break + done +} diff --git a/net/ntripcaster/Makefile b/net/ntripcaster/Makefile new file mode 100644 index 0000000..51b43e7 --- /dev/null +++ b/net/ntripcaster/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2011 segal.ubi.pt +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ntripcaster +PKG_VERSION:=0.1.5 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION).zip +PKG_SOURCE_URL:=http://igs.bkg.bund.de/root_ftp/NTRIP/software/ +PKG_MD5SUM:=8c85a6c31d8c5cdf2638fe103207a1fd + +include $(INCLUDE_DIR)/package.mk + +define Package/ntripcaster + SECTION:=net + CATEGORY:=Network + SUBMENU:=NTRIP + TITLE:=Standard Ntrip Broadcaster + URL:=http://igs.bkg.bund.de/ntrip/download + MAINTAINER:=Nuno Goncalves + DEPENDS:=+libpthread +endef + +define Package/ntripcaster/description + BKG Standard Ntrip Broadcaster +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + unzip $(DL_DIR)/$(PKG_SOURCE) -d $(PKG_BUILD_DIR) + mv $(PKG_BUILD_DIR)/$(PKG_NAME)$(PKG_VERSION)/* $(PKG_BUILD_DIR) + chmod +x $(PKG_BUILD_DIR)/configure +endef + +define Package/ntripcaster/install + $(INSTALL_DIR) $(1)/usr/local/ntripcaster/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ntripcaster $(1)/usr/local/ntripcaster/bin/ + $(INSTALL_DIR) $(1)/usr/local/ntripcaster/conf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/conf/ntripcaster.conf.dist $(1)/usr/local/ntripcaster/conf/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/conf/sourcetable.dat.dist $(1)/usr/local/ntripcaster/conf/ +endef + +$(eval $(call BuildPackage,ntripcaster)) diff --git a/net/ntripclient/Makefile b/net/ntripclient/Makefile new file mode 100644 index 0000000..0d03281 --- /dev/null +++ b/net/ntripclient/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2011 segal.ubi.pt +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ntripclient +PKG_VERSION:=1.5.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME).zip +PKG_SOURCE_URL:=http://igs.bkg.bund.de/root_ftp/NTRIP/software/ +PKG_MD5SUM:=4b357fa648d74e4e13c4b5a2a39f5624 + +include $(INCLUDE_DIR)/package.mk + +define Package/ntripclient + SECTION:=net + CATEGORY:=Network + SUBMENU:=NTRIP + TITLE:=Ntrip Version 2.0 Command Line Client + URL:=http://igs.bkg.bund.de/ntrip/download + MAINTAINER:=Nuno Goncalves +endef + +define Package/ntripclient/description + Ntrip Version 2.0 Command Line Client, reading from Ntrip Version 1.0 or 2.0 Caster +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + unzip $(DL_DIR)/$(PKG_SOURCE) -d $(PKG_BUILD_DIR) +endef + +define Package/ntripclient/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntripclient $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,ntripclient)) diff --git a/net/ntripserver/Makefile b/net/ntripserver/Makefile new file mode 100644 index 0000000..2d9d2a0 --- /dev/null +++ b/net/ntripserver/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2011 segal.ubi.pt +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ntripserver +PKG_VERSION:=1.5.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME).zip +PKG_SOURCE_URL:=http://igs.bkg.bund.de/root_ftp/NTRIP/software/ +PKG_MD5SUM:=cecff5da0173896df041bd889935fc12 + +include $(INCLUDE_DIR)/package.mk + +define Package/ntripserver + SECTION:=net + CATEGORY:=Network + SUBMENU:=NTRIP + TITLE:=Ntrip Version 2.0 Command Line Server + URL:=http://igs.bkg.bund.de/ntrip/download + MAINTAINER:=Nuno Goncalves +endef + +define Package/ntripserver/description + Ntrip Version 2.0 Command Line Server, reading from SISNeT Server, TCP/UDP IP Port, Serial port, or NtripCaster to support an Ntrip Version 1.0 or 2.0 Caster +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + unzip $(DL_DIR)/$(PKG_SOURCE) -d $(PKG_BUILD_DIR) +endef + +define Package/ntripserver/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntripserver $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,ntripserver)) diff --git a/net/nufw/Makefile b/net/nufw/Makefile new file mode 100644 index 0000000..2e82742 --- /dev/null +++ b/net/nufw/Makefile @@ -0,0 +1,117 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=nufw +PKG_VERSION:=2.2.21 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.nufw.org/download/nufw/ +PKG_MD5SUM:=7eb500e7ddb3db622dc6c5d43b495c9a + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=autogen.sh aclocal.m4 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/nufw/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Firewall + DEPENDS:=+glib2 +libgnutls +libsasl2 +libnetfilter-queue $(ICONV_DEPENDS) $(INTL_DEPENDS) + TITLE:=nufw + URL:=http://www.nufw.org/ +endef + +define Package/nufw/description + NuFW adds user-based filtering to Netfilter, + the state of the art IP filtering layer from + the Linux kernel. Its exclusive algorithm allows + authenticated filtering even on multiuser computers. +endef + +define Package/nufw + $(call Package/nufw/Default) +endef + +define Package/nutcpc + $(call Package/nufw/Default) + TITLE:=client version +endef + +define Package/nufw-python + $(call Package/nufw/Default) + TITLE:=python bindings +endef + +define PyPackage/nufw-python/filespec ++|$(PYTHON_PKG_DIR)/nuauth_command/__init__.py ++|$(PYTHON_PKG_DIR)/nuauth_command/client.py ++|$(PYTHON_PKG_DIR)/nuauth_command/command_dec.py ++|$(PYTHON_PKG_DIR)/nuauth_command/version.py +endef + + +define Package/nufw-modules + $(call Package/nufw/Default) + TITLE:=NuFW modules +endef + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared \ + --disable-pam-nufw \ + --without-system-auth \ + --with-libgnutls-prefix="$(STAGING_DIR)/usr/" \ + --with-libgcrypt-prefix="$(STAGING_DIR)/usr/" \ + --with-libsasl-prefix="$(STAGING_DIR)/usr/" + +define Build/Configure + (cd $(PKG_BUILD_DIR) ; test -x ./autogen.sh && ./autogen.sh || true) + $(call Build/Configure/Default) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) \ + -I$(INTL_PREFIX)/include \ + -I$(ICONV_PREFIX)/include" \ + LDFLAGS="$(TARGET_LDFLAGS) \ + -L$(INTL_PREFIX)/lib \ + -L$(ICONV_PREFIX)/lib \ + -Wl,-rpath-link,$(STAGING_DIR)/usr/lib -liconv \ + -lgnutls -lnetfilter_queue -lpthread -lgcrypt" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + + +define Package/nufw/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nufw $(1)/usr/sbin/ +endef + +define Package/nutcpc/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nutcpc $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnuclient.so* $(1)/usr/lib/ +endef + +define Package/nufw-modules/install + $(INSTALL_DIR) $(1)/usr/lib/nuauth/modules/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/nuauth/modules/*.so* $(1)/usr/lib/nuauth/modules/ +endef + +$(eval $(call BuildPackage,nufw)) +$(eval $(call BuildPackage,nutcpc)) +$(eval $(call BuildPackage,nufw-modules)) +$(eval $(call PyPackage,nufw-python)) +$(eval $(call BuildPackage,nufw-python)) diff --git a/net/nufw/patches/001-no_doc_tests.patch b/net/nufw/patches/001-no_doc_tests.patch new file mode 100644 index 0000000..97d4459 --- /dev/null +++ b/net/nufw/patches/001-no_doc_tests.patch @@ -0,0 +1,23 @@ +Index: nufw-2.2.21/Makefile.am +=================================================================== +--- nufw-2.2.21.orig/Makefile.am 2008-11-18 10:12:32.000000000 +0100 ++++ nufw-2.2.21/Makefile.am 2009-10-05 20:26:45.000000000 +0200 +@@ -1,4 +1,4 @@ +-SUBDIRS = src scripts doc tests conf python selinux ++SUBDIRS = src scripts conf python selinux + + PATCH_FILES = patches/dump-connection-mark.diff + EXTRA_DIST = autogen.sh $(PATCH_FILES) +Index: nufw-2.2.21/Makefile.in +=================================================================== +--- nufw-2.2.21.orig/Makefile.in 2009-02-03 22:46:54.000000000 +0100 ++++ nufw-2.2.21/Makefile.in 2009-10-05 20:27:05.000000000 +0200 +@@ -193,7 +193,7 @@ + target_alias = @target_alias@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ +-SUBDIRS = src scripts doc tests conf python selinux ++SUBDIRS = src scripts conf python selinux + PATCH_FILES = patches/dump-connection-mark.diff + EXTRA_DIST = autogen.sh $(PATCH_FILES) + all: all-recursive diff --git a/net/nufw/patches/002-debian_fixes.patch b/net/nufw/patches/002-debian_fixes.patch new file mode 100644 index 0000000..7cea0a7 --- /dev/null +++ b/net/nufw/patches/002-debian_fixes.patch @@ -0,0 +1,22788 @@ +--- nufw-2.2.21.orig/aclocal.m4 ++++ nufw-2.2.21/aclocal.m4 +@@ -1,4 +1,4 @@ +-# generated automatically by aclocal 1.10.1 -*- Autoconf -*- ++# generated automatically by aclocal 1.10.2 -*- Autoconf -*- + + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +@@ -13,8 +13,8 @@ + + m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +-m4_if(AC_AUTOCONF_VERSION, [2.61],, +-[m4_warning([this file was generated for autoconf 2.61. ++m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],, ++[m4_warning([this file was generated for autoconf 2.64. + You have another version of autoconf. It may work, but is not guaranteed to. + If you have problems, you may need to regenerate the build system entirely. + To do so, use the procedure documented by the package, typically `autoreconf'.])]) +@@ -114,8 +114,9 @@ + { + int major, minor, micro; + char *tmp_version; ++ int ignored; + +- system ("touch conf.glibtest"); ++ ignored = system ("touch conf.glibtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_glib_version"); +@@ -340,167 +341,6 @@ + AC_SUBST(LIBGCRYPT_LIBS) + ]) + +-dnl Autoconf macros for libgnutls +-dnl $id$ +- +-# Modified for LIBGNUTLS -- nmav +-# Configure paths for LIBGCRYPT +-# Shamelessly stolen from the one of XDELTA by Owen Taylor +-# Werner Koch 99-12-09 +- +-dnl AM_PATH_LIBGNUTLS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) +-dnl Test for libgnutls, and define LIBGNUTLS_CFLAGS and LIBGNUTLS_LIBS +-dnl +-AC_DEFUN([AM_PATH_LIBGNUTLS], +-[dnl +-dnl Get the cflags and libraries from the libgnutls-config script +-dnl +-AC_ARG_WITH(libgnutls-prefix, +- [ --with-libgnutls-prefix=PFX Prefix where libgnutls is installed (optional)], +- libgnutls_config_prefix="$withval", libgnutls_config_prefix="") +- +- if test x$libgnutls_config_prefix != x ; then +- if test x${LIBGNUTLS_CONFIG+set} != xset ; then +- LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config +- fi +- fi +- +- AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no) +- min_libgnutls_version=ifelse([$1], ,0.1.0,$1) +- AC_MSG_CHECKING(for libgnutls - version >= $min_libgnutls_version) +- no_libgnutls="" +- if test "$LIBGNUTLS_CONFIG" = "no" ; then +- no_libgnutls=yes +- else +- LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags` +- LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs` +- libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version` +- +- +- ac_save_CFLAGS="$CFLAGS" +- ac_save_LIBS="$LIBS" +- CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS" +- LIBS="$LIBS $LIBGNUTLS_LIBS" +-dnl +-dnl Now check if the installed libgnutls is sufficiently new. Also sanity +-dnl checks the results of libgnutls-config to some extent +-dnl +- rm -f conf.libgnutlstest +- AC_TRY_RUN([ +-#include +-#include +-#include +-#include +- +-int +-main () +-{ +- system ("touch conf.libgnutlstest"); +- +- if( strcmp( gnutls_check_version(NULL), "$libgnutls_config_version" ) ) +- { +- printf("\n*** 'libgnutls-config --version' returned %s, but LIBGNUTLS (%s)\n", +- "$libgnutls_config_version", gnutls_check_version(NULL) ); +- printf("*** was found! If libgnutls-config was correct, then it is best\n"); +- printf("*** to remove the old version of LIBGNUTLS. You may also be able to fix the error\n"); +- printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); +- printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); +- printf("*** required on your system.\n"); +- printf("*** If libgnutls-config was wrong, set the environment variable LIBGNUTLS_CONFIG\n"); +- printf("*** to point to the correct copy of libgnutls-config, and remove the file config.cache\n"); +- printf("*** before re-running configure\n"); +- } +- else if ( strcmp(gnutls_check_version(NULL), LIBGNUTLS_VERSION ) ) +- { +- printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION); +- printf("*** library (version %s)\n", gnutls_check_version(NULL) ); +- } +- else +- { +- if ( gnutls_check_version( "$min_libgnutls_version" ) ) +- { +- return 0; +- } +- else +- { +- printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n", +- gnutls_check_version(NULL) ); +- printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n", +- "$min_libgnutls_version" ); +- printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n"); +- printf("*** \n"); +- printf("*** If you have already installed a sufficiently new version, this error\n"); +- printf("*** probably means that the wrong copy of the libgnutls-config shell script is\n"); +- printf("*** being found. The easiest way to fix this is to remove the old version\n"); +- printf("*** of LIBGNUTLS, but you can also set the LIBGNUTLS_CONFIG environment to point to the\n"); +- printf("*** correct copy of libgnutls-config. (In this case, you will have to\n"); +- printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); +- printf("*** so that the correct libraries are found at run-time))\n"); +- } +- } +- return 1; +-} +-],, no_libgnutls=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) +- CFLAGS="$ac_save_CFLAGS" +- LIBS="$ac_save_LIBS" +- fi +- +- if test "x$no_libgnutls" = x ; then +- AC_MSG_RESULT(yes) +- ifelse([$2], , :, [$2]) +- else +- if test -f conf.libgnutlstest ; then +- : +- else +- AC_MSG_RESULT(no) +- fi +- if test "$LIBGNUTLS_CONFIG" = "no" ; then +- echo "*** The libgnutls-config script installed by LIBGNUTLS could not be found" +- echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in" +- echo "*** your path, or set the LIBGNUTLS_CONFIG environment variable to the" +- echo "*** full path to libgnutls-config." +- else +- if test -f conf.libgnutlstest ; then +- : +- else +- echo "*** Could not run libgnutls test program, checking why..." +- CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS" +- LIBS="$LIBS $LIBGNUTLS_LIBS" +- AC_TRY_LINK([ +-#include +-#include +-#include +-#include +-], [ return !!gnutls_check_version(NULL); ], +- [ echo "*** The test program compiled, but did not run. This usually means" +- echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong" +- echo "*** version of LIBGNUTLS. If it is not finding LIBGNUTLS, you'll need to set your" +- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" +- echo "*** to the installed location Also, make sure you have run ldconfig if that" +- echo "*** is required on your system" +- echo "***" +- echo "*** If you have an old version installed, it is best to remove it, although" +- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" +- echo "***" ], +- [ echo "*** The test program failed to compile or link. See the file config.log for the" +- echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed" +- echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you" +- echo "*** may want to edit the libgnutls-config script: $LIBGNUTLS_CONFIG" ]) +- CFLAGS="$ac_save_CFLAGS" +- LIBS="$ac_save_LIBS" +- fi +- fi +- LIBGNUTLS_CFLAGS="" +- LIBGNUTLS_LIBS="" +- ifelse([$3], , :, [$3]) +- fi +- rm -f conf.libgnutlstest +- AC_SUBST(LIBGNUTLS_CFLAGS) +- AC_SUBST(LIBGNUTLS_LIBS) +-]) +- +-dnl *-*wedit:notab*-* Please keep this as the last line. +- + # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + # + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +@@ -877,12 +717,12 @@ + # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) + # --------------------------------------------------- + m4_define([lt_decl_varnames_tagged], +-[_$0(m4_quote(m4_default([$1], [[, ]])), +- m4_quote(m4_if([$2], [], +- m4_quote(lt_decl_tag_varnames), +- m4_quote(m4_shift($@)))), +- m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) +-m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) ++[m4_assert([$# <= 2])dnl ++_$0(m4_quote(m4_default([$1], [[, ]])), ++ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), ++ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) ++m4_define([_lt_decl_varnames_tagged], ++[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + + # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +@@ -1442,10 +1282,10 @@ + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; +- darwin*) # darwin 5.x on ++ darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment +- # target defaults to 10.4. Don't you love it? ++ # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; +@@ -1487,7 +1327,11 @@ + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" +- if test "$GCC" = "yes"; then ++ case $cc_basename in ++ ifort*) _lt_dar_can_shared=yes ;; ++ *) _lt_dar_can_shared=$GCC ;; ++ esac ++ if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" +@@ -2009,7 +1853,7 @@ + lt_cv_sys_max_cmd_len=-1; + ;; + +- cygwin* | mingw*) ++ cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, +@@ -2177,10 +2021,6 @@ + # endif + #endif + +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif +- + void fnord() { int i=42;} + int main () + { +@@ -2196,7 +2036,7 @@ + else + puts (dlerror ()); + +- exit (status); ++ return status; + }] + _LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then +@@ -2235,7 +2075,7 @@ + lt_cv_dlopen_self=yes + ;; + +- mingw* | pw32*) ++ mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; +@@ -2532,6 +2372,7 @@ + [AC_REQUIRE([AC_CANONICAL_HOST])dnl + m4_require([_LT_DECL_EGREP])dnl + m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++m4_require([_LT_DECL_OBJDUMP])dnl + m4_require([_LT_DECL_SED])dnl + AC_MSG_CHECKING([dynamic linker characteristics]) + m4_if([$1], +@@ -2696,14 +2537,14 @@ + # libtool to hard-code these into programs + ;; + +-cygwin* | mingw* | pw32*) ++cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32*) ++ yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ +@@ -2726,7 +2567,7 @@ + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; +- mingw*) ++ mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` +@@ -3164,7 +3005,7 @@ + version_type=linux + need_lib_prefix=no + need_version=no +- library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes +@@ -3188,7 +3029,7 @@ + if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" + fi +- ++ + if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" + fi +@@ -3465,6 +3306,7 @@ + # -- PORTME fill in with the dynamic library characteristics + m4_defun([_LT_CHECK_MAGIC_METHOD], + [m4_require([_LT_DECL_EGREP]) ++m4_require([_LT_DECL_OBJDUMP]) + AC_CACHE_CHECK([how to recognize dependent libraries], + lt_cv_deplibs_check_method, + [lt_cv_file_magic_cmd='$MAGIC_CMD' +@@ -3515,6 +3357,12 @@ + fi + ;; + ++cegcc) ++ # use the weaker test based on 'objdump'. See mingw*. ++ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' ++ lt_cv_file_magic_cmd='$OBJDUMP -f' ++ ;; ++ + darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; +@@ -3826,7 +3674,7 @@ + aix*) + symcode='[[BCDT]]' + ;; +-cygwin* | mingw* | pw32*) ++cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; + hpux*) +@@ -4072,7 +3920,7 @@ + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; +- mingw* | cygwin* | os2* | pw32*) ++ mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style +@@ -4099,10 +3947,11 @@ + fi + ;; + hpux*) +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. ++ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit ++ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag ++ # sets the default TLS model and affects inlining. + case $host_cpu in +- hppa*64*|ia64*) ++ hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +@@ -4200,12 +4049,19 @@ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; +- icpc* | ecpc* ) +- # Intel C++ ++ ecpc* ) ++ # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; ++ icpc* ) ++ # Intel C++, used to be incompatible with GCC. ++ # ICC 10 doesn't accept -KPIC any more. ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ++ ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +@@ -4371,7 +4227,7 @@ + # PIC is the default for these OSes. + ;; + +- mingw* | cygwin* | pw32* | os2*) ++ mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style +@@ -4387,10 +4243,11 @@ + ;; + + hpux*) +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. ++ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit ++ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag ++ # sets the default TLS model and affects inlining. + case $host_cpu in +- hppa*64*|ia64*) ++ hppa*64*) + # +Z the default + ;; + *) +@@ -4440,7 +4297,7 @@ + fi + ;; + +- mingw* | cygwin* | pw32* | os2*) ++ mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], +@@ -4471,11 +4328,25 @@ + + linux* | k*bsd*-gnu) + case $cc_basename in +- icc* | ecc* | ifort*) ++ # old Intel for x86_64 which still supported -KPIC. ++ ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; ++ # icc used to be incompatible with GCC. ++ # ICC 10 doesn't accept -KPIC any more. ++ icc* | ifort*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ++ ;; ++ # Lahey Fortran 8.1. ++ lf95*) ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ++ ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) +@@ -4657,7 +4528,7 @@ + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; +- cygwin* | mingw*) ++ cygwin* | mingw* | cegcc*) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + linux* | k*bsd*-gnu) +@@ -4712,7 +4583,7 @@ + extract_expsyms_cmds= + + case $host_os in +- cygwin* | mingw* | pw32*) ++ cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. +@@ -4727,6 +4598,9 @@ + openbsd*) + with_gnu_ld=no + ;; ++ linux* | k*bsd*-gnu) ++ _LT_TAGVAR(link_all_deplibs, $1)=no ++ ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes +@@ -4799,7 +4673,7 @@ + fi + ;; + +- cygwin* | mingw* | pw32*) ++ cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +@@ -4865,6 +4739,9 @@ + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; ++ lf95*) # Lahey Fortran 8.1 ++ _LT_TAGVAR(whole_archive_flag_spec, $1)= ++ tmp_sharedflag='--shared' ;; + xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; +@@ -5097,6 +4974,7 @@ + fi + fi + ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes +@@ -5151,7 +5029,7 @@ + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + +- cygwin* | mingw* | pw32*) ++ cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is +@@ -5255,7 +5133,7 @@ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +@@ -6036,6 +5914,7 @@ + fi + fi + ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. +@@ -6094,7 +5973,7 @@ + esac + ;; + +- cygwin* | mingw* | pw32*) ++ cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +@@ -7475,6 +7354,18 @@ + ]) + + ++# _LT_DECL_OBJDUMP ++# -------------- ++# If we don't have a new enough Autoconf to choose the best objdump ++# available, choose the one first in the user's PATH. ++m4_defun([_LT_DECL_OBJDUMP], ++[AC_CHECK_TOOL(OBJDUMP, objdump, false) ++test -z "$OBJDUMP" && OBJDUMP=objdump ++_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) ++AC_SUBST([OBJDUMP]) ++]) ++ ++ + # _LT_DECL_SED + # ------------ + # Check for a fully-functional sed program, that truncates +@@ -7935,7 +7826,7 @@ + [enable_win32_dll=yes + + case $host in +-*-*-cygwin* | *-*-mingw* | *-*-pw32*) ++*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) +@@ -8176,14 +8067,14 @@ + + # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- + # +-# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +-# Written by Gary V. Vaughan, 2004 ++# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. ++# Written by Gary V. Vaughan, 2004 + # + # This file is free software; the Free Software Foundation gives + # unlimited permission to copy and/or distribute it, with or without + # modifications, as long as this notice is preserved. + +-# serial 5 ltsugar.m4 ++# serial 6 ltsugar.m4 + + # This is to help aclocal find these macros, as it can't see m4_define. + AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) +@@ -8239,14 +8130,14 @@ + # Produce a SEP delimited list of all paired combinations of elements of + # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list + # has the form PREFIXmINFIXSUFFIXn. ++# Needed until we can rely on m4_combine added in Autoconf 2.62. + m4_define([lt_combine], +-[m4_if([$2], [], [], +- [m4_if([$4], [], [], +- [lt_join(m4_quote(m4_default([$1], [[, ]])), +- lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_prefix, [$2], +- [m4_foreach(_Lt_suffix, lt_car([m4_shiftn(3, $@)]), +- [_Lt_prefix[]$3[]_Lt_suffix ])])))))])])dnl +-]) ++[m4_if(m4_eval([$# > 3]), [1], ++ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl ++[[m4_foreach([_Lt_prefix], [$2], ++ [m4_foreach([_Lt_suffix], ++ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, ++ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + + # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +@@ -8309,15 +8200,15 @@ + + # Generated from ltversion.in. + +-# serial 2976 ltversion.m4 ++# serial 3012 ltversion.m4 + # This file is part of GNU Libtool + +-m4_define([LT_PACKAGE_VERSION], [2.2.4]) +-m4_define([LT_PACKAGE_REVISION], [1.2976]) ++m4_define([LT_PACKAGE_VERSION], [2.2.6]) ++m4_define([LT_PACKAGE_REVISION], [1.3012]) + + AC_DEFUN([LTVERSION_VERSION], +-[macro_version='2.2.4' +-macro_revision='1.2976' ++[macro_version='2.2.6' ++macro_revision='1.3012' + _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) + _LT_DECL(, macro_revision, 0) + ]) +@@ -8573,7 +8464,7 @@ + fi[]dnl + ])# PKG_CHECK_MODULES + +-# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. ++# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -8588,7 +8479,7 @@ + [am__api_version='1.10' + dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to + dnl require some minimum version. Point them to the right macro. +-m4_if([$1], [1.10.1], [], ++m4_if([$1], [1.10.2], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl + ]) + +@@ -8602,12 +8493,12 @@ + # AM_SET_CURRENT_AUTOMAKE_VERSION + # ------------------------------- + # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. ++# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. + AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +-[AM_AUTOMAKE_VERSION([1.10.1])dnl ++[AM_AUTOMAKE_VERSION([1.10.2])dnl + m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +-_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) ++_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + + # AM_AUX_DIR_EXPAND -*- Autoconf -*- + +@@ -8857,19 +8748,28 @@ + + # Generate code to set up dependency tracking. -*- Autoconf -*- + +-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 ++# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 + # Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-#serial 3 ++#serial 4 + + # _AM_OUTPUT_DEPENDENCY_COMMANDS + # ------------------------------ + AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +-[for mf in $CONFIG_FILES; do ++[# Autoconf 2.62 quotes --file arguments for eval, but not when files ++# are listed without --file. Let's play safe and only enable the eval ++# if we detect the quoting. ++case $CONFIG_FILES in ++*\'*) eval set x "$CONFIG_FILES" ;; ++*) set x $CONFIG_FILES ;; ++esac ++shift ++for mf ++do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. +@@ -9213,13 +9113,13 @@ + + # Helper functions for option handling. -*- Autoconf -*- + +-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. ++# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 3 ++# serial 4 + + # _AM_MANGLE_OPTION(NAME) + # ----------------------- +@@ -9236,7 +9136,7 @@ + # ---------------------------------- + # OPTIONS is a space-separated list of Automake options. + AC_DEFUN([_AM_SET_OPTIONS], +-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) ++[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + + # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) + # ------------------------------------------- +--- nufw-2.2.21.orig/Makefile.in ++++ nufw-2.2.21/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -99,6 +99,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -111,9 +113,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -124,6 +123,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -132,6 +132,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -191,6 +192,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + SUBDIRS = src scripts doc tests conf python selinux +@@ -240,7 +242,7 @@ + -rm -rf .libs _libs + + distclean-libtool: +- -rm -f libtool ++ -rm -f libtool config.lt + + # This directory's subdirectories are mostly independent; you can cd + # into them and run `make' without going through this Makefile. +@@ -317,7 +319,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/ltmain.sh ++++ nufw-2.2.21/ltmain.sh +@@ -1,6 +1,6 @@ + # Generated from ltmain.m4sh. + +-# ltmain.sh (GNU libtool) 2.2.4 ++# ltmain.sh (GNU libtool) 2.2.6 + # Written by Gordon Matzigkeit , 1996 + + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. +@@ -65,7 +65,7 @@ + # compiler: $LTCC + # compiler flags: $LTCFLAGS + # linker: $LD (gnu? $with_gnu_ld) +-# $progname: (GNU libtool) 2.2.4 Debian-2.2.4-0ubuntu4 ++# $progname: (GNU libtool) 2.2.6 Debian-2.2.6a-4 + # automake: $automake_version + # autoconf: $autoconf_version + # +@@ -73,9 +73,9 @@ + + PROGRAM=ltmain.sh + PACKAGE=libtool +-VERSION="2.2.4 Debian-2.2.4-0ubuntu4" ++VERSION="2.2.6 Debian-2.2.6a-4" + TIMESTAMP="" +-package_revision=1.2976 ++package_revision=1.3012 + + # Be Bourne compatible + if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +@@ -805,7 +805,7 @@ + + + case $host in +- *cygwin* | *mingw* | *pw32*) ++ *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; +@@ -893,8 +893,9 @@ + # determined imposters. + func_lalib_p () + { +- $SED -e 4q "$1" 2>/dev/null \ +- | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 ++ test -f "$1" && ++ $SED -e 4q "$1" 2>/dev/null \ ++ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 + } + + # func_lalib_unsafe_p file +@@ -907,7 +908,7 @@ + func_lalib_unsafe_p () + { + lalib_p=no +- if test -r "$1" && exec 5<&0 <"$1"; then ++ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line +@@ -1275,7 +1276,7 @@ + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in +- cygwin* | mingw* | pw32* | os2*) ++ cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac +@@ -2046,7 +2047,7 @@ + 'exit $?' + tstripme="$stripme" + case $host_os in +- cygwin* | mingw* | pw32*) ++ cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" +@@ -2152,7 +2153,7 @@ + + # Do a test to see if this is really a libtool program. + case $host in +- *cygwin*|*mingw*) ++ *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result +@@ -2358,7 +2359,7 @@ + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in +- *cygwin* | *mingw* ) ++ *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; +@@ -2370,7 +2371,7 @@ + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in +- *cygwin | *mingw* ) ++ *cygwin | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; +@@ -2426,7 +2427,7 @@ + } lt_dlsymlist; + " + case $host in +- *cygwin* | *mingw* ) ++ *cygwin* | *mingw* | *cegcc* ) + $ECHO >> "$output_objdir/$my_dlsyms" "\ + /* DATA imports from DLLs on WIN32 con't be const, because + runtime relocations are performed -- see ld's documentation +@@ -2512,7 +2513,7 @@ + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in +- *cygwin* | *mingw* ) ++ *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` +@@ -2691,25 +2692,16 @@ + + + +-# func_emit_wrapper arg ++# func_emit_wrapper_part1 [arg=no] + # +-# emit a libtool wrapper script on stdout +-# don't directly open a file because we may want to +-# incorporate the script contents within a cygwin/mingw +-# wrapper executable. Must ONLY be called from within +-# func_mode_link because it depends on a number of variable +-# set therein. +-# +-# arg is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +-# variable will take. If 'yes', then the emitted script +-# will assume that the directory in which it is stored is +-# the '.lib' directory. This is a cygwin/mingw-specific +-# behavior. +-func_emit_wrapper () ++# Emit the first part of a libtool wrapper script on stdout. ++# For more information, see the description associated with ++# func_emit_wrapper(), below. ++func_emit_wrapper_part1 () + { +- func_emit_wrapper_arg1=no ++ func_emit_wrapper_part1_arg1=no + if test -n "$1" ; then +- func_emit_wrapper_arg1=$1 ++ func_emit_wrapper_part1_arg1=$1 + fi + + $ECHO "\ +@@ -2794,10 +2786,27 @@ + file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done ++" ++} ++# end: func_emit_wrapper_part1 ++ ++# func_emit_wrapper_part2 [arg=no] ++# ++# Emit the second part of a libtool wrapper script on stdout. ++# For more information, see the description associated with ++# func_emit_wrapper(), below. ++func_emit_wrapper_part2 () ++{ ++ func_emit_wrapper_part2_arg1=no ++ if test -n "$1" ; then ++ func_emit_wrapper_part2_arg1=$1 ++ fi ++ ++ $ECHO "\ + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. +- WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 ++ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then +@@ -2888,7 +2897,7 @@ + " + case $host in + # Backslashes separate directories on plain windows +- *-*-mingw | *-*-os2*) ++ *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} + " +@@ -2914,7 +2923,207 @@ + fi\ + " + } +-# end: func_emit_wrapper ++# end: func_emit_wrapper_part2 ++ ++ ++# func_emit_wrapper [arg=no] ++# ++# Emit a libtool wrapper script on stdout. ++# Don't directly open a file because we may want to ++# incorporate the script contents within a cygwin/mingw ++# wrapper executable. Must ONLY be called from within ++# func_mode_link because it depends on a number of variables ++# set therein. ++# ++# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR ++# variable will take. If 'yes', then the emitted script ++# will assume that the directory in which it is stored is ++# the $objdir directory. This is a cygwin/mingw-specific ++# behavior. ++func_emit_wrapper () ++{ ++ func_emit_wrapper_arg1=no ++ if test -n "$1" ; then ++ func_emit_wrapper_arg1=$1 ++ fi ++ ++ # split this up so that func_emit_cwrapperexe_src ++ # can call each part independently. ++ func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" ++ func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" ++} ++ ++ ++# func_to_host_path arg ++# ++# Convert paths to host format when used with build tools. ++# Intended for use with "native" mingw (where libtool itself ++# is running under the msys shell), or in the following cross- ++# build environments: ++# $build $host ++# mingw (msys) mingw [e.g. native] ++# cygwin mingw ++# *nix + wine mingw ++# where wine is equipped with the `winepath' executable. ++# In the native mingw case, the (msys) shell automatically ++# converts paths for any non-msys applications it launches, ++# but that facility isn't available from inside the cwrapper. ++# Similar accommodations are necessary for $host mingw and ++# $build cygwin. Calling this function does no harm for other ++# $host/$build combinations not listed above. ++# ++# ARG is the path (on $build) that should be converted to ++# the proper representation for $host. The result is stored ++# in $func_to_host_path_result. ++func_to_host_path () ++{ ++ func_to_host_path_result="$1" ++ if test -n "$1" ; then ++ case $host in ++ *mingw* ) ++ lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' ++ case $build in ++ *mingw* ) # actually, msys ++ # awkward: cmd appends spaces to result ++ lt_sed_strip_trailing_spaces="s/[ ]*\$//" ++ func_to_host_path_tmp1=`( cmd //c echo "$1" |\ ++ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` ++ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ ++ $SED -e "$lt_sed_naive_backslashify"` ++ ;; ++ *cygwin* ) ++ func_to_host_path_tmp1=`cygpath -w "$1"` ++ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ ++ $SED -e "$lt_sed_naive_backslashify"` ++ ;; ++ * ) ++ # Unfortunately, winepath does not exit with a non-zero ++ # error code, so we are forced to check the contents of ++ # stdout. On the other hand, if the command is not ++ # found, the shell will set an exit code of 127 and print ++ # *an error message* to stdout. So we must check for both ++ # error code of zero AND non-empty stdout, which explains ++ # the odd construction: ++ func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` ++ if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then ++ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ ++ $SED -e "$lt_sed_naive_backslashify"` ++ else ++ # Allow warning below. ++ func_to_host_path_result="" ++ fi ++ ;; ++ esac ++ if test -z "$func_to_host_path_result" ; then ++ func_error "Could not determine host path corresponding to" ++ func_error " '$1'" ++ func_error "Continuing, but uninstalled executables may not work." ++ # Fallback: ++ func_to_host_path_result="$1" ++ fi ++ ;; ++ esac ++ fi ++} ++# end: func_to_host_path ++ ++# func_to_host_pathlist arg ++# ++# Convert pathlists to host format when used with build tools. ++# See func_to_host_path(), above. This function supports the ++# following $build/$host combinations (but does no harm for ++# combinations not listed here): ++# $build $host ++# mingw (msys) mingw [e.g. native] ++# cygwin mingw ++# *nix + wine mingw ++# ++# Path separators are also converted from $build format to ++# $host format. If ARG begins or ends with a path separator ++# character, it is preserved (but converted to $host format) ++# on output. ++# ++# ARG is a pathlist (on $build) that should be converted to ++# the proper representation on $host. The result is stored ++# in $func_to_host_pathlist_result. ++func_to_host_pathlist () ++{ ++ func_to_host_pathlist_result="$1" ++ if test -n "$1" ; then ++ case $host in ++ *mingw* ) ++ lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' ++ # Remove leading and trailing path separator characters from ++ # ARG. msys behavior is inconsistent here, cygpath turns them ++ # into '.;' and ';.', and winepath ignores them completely. ++ func_to_host_pathlist_tmp2="$1" ++ # Once set for this call, this variable should not be ++ # reassigned. It is used in tha fallback case. ++ func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ ++ $SED -e 's|^:*||' -e 's|:*$||'` ++ case $build in ++ *mingw* ) # Actually, msys. ++ # Awkward: cmd appends spaces to result. ++ lt_sed_strip_trailing_spaces="s/[ ]*\$//" ++ func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ ++ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` ++ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ ++ $SED -e "$lt_sed_naive_backslashify"` ++ ;; ++ *cygwin* ) ++ func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` ++ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ ++ $SED -e "$lt_sed_naive_backslashify"` ++ ;; ++ * ) ++ # unfortunately, winepath doesn't convert pathlists ++ func_to_host_pathlist_result="" ++ func_to_host_pathlist_oldIFS=$IFS ++ IFS=: ++ for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do ++ IFS=$func_to_host_pathlist_oldIFS ++ if test -n "$func_to_host_pathlist_f" ; then ++ func_to_host_path "$func_to_host_pathlist_f" ++ if test -n "$func_to_host_path_result" ; then ++ if test -z "$func_to_host_pathlist_result" ; then ++ func_to_host_pathlist_result="$func_to_host_path_result" ++ else ++ func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" ++ fi ++ fi ++ fi ++ IFS=: ++ done ++ IFS=$func_to_host_pathlist_oldIFS ++ ;; ++ esac ++ if test -z "$func_to_host_pathlist_result" ; then ++ func_error "Could not determine the host path(s) corresponding to" ++ func_error " '$1'" ++ func_error "Continuing, but uninstalled executables may not work." ++ # Fallback. This may break if $1 contains DOS-style drive ++ # specifications. The fix is not to complicate the expression ++ # below, but for the user to provide a working wine installation ++ # with winepath so that path translation in the cross-to-mingw ++ # case works properly. ++ lt_replace_pathsep_nix_to_dos="s|:|;|g" ++ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ ++ $SED -e "$lt_replace_pathsep_nix_to_dos"` ++ fi ++ # Now, add the leading and trailing path separators back ++ case "$1" in ++ :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" ++ ;; ++ esac ++ case "$1" in ++ *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" ++ ;; ++ esac ++ ;; ++ esac ++ fi ++} ++# end: func_to_host_pathlist + + # func_emit_cwrapperexe_src + # emit the source code for a wrapper executable on stdout +@@ -2951,6 +3160,12 @@ + # include + # ifdef __CYGWIN__ + # include ++# define HAVE_SETENV ++# ifdef __STRICT_ANSI__ ++char *realpath (const char *, char *); ++int putenv (char *); ++int setenv (const char *, const char *, int); ++# endif + # endif + #endif + #include +@@ -3057,29 +3272,105 @@ + int check_executable (const char *path); + char *strendzap (char *str, const char *pat); + void lt_fatal (const char *message, ...); ++void lt_setenv (const char *name, const char *value); ++char *lt_extend_str (const char *orig_value, const char *add, int to_end); ++void lt_opt_process_env_set (const char *arg); ++void lt_opt_process_env_prepend (const char *arg); ++void lt_opt_process_env_append (const char *arg); ++int lt_split_name_value (const char *arg, char** name, char** value); ++void lt_update_exe_path (const char *name, const char *value); ++void lt_update_lib_path (const char *name, const char *value); + +-static const char *script_text = ++static const char *script_text_part1 = + EOF + +- func_emit_wrapper yes | ++ func_emit_wrapper_part1 yes | ++ $SED -e 's/\([\\"]\)/\\\1/g' \ ++ -e 's/^/ "/' -e 's/$/\\n"/' ++ echo ";" ++ cat </dev/null || echo $SHELL` +- case $lt_newargv0 in +- *.exe | *.EXE) ;; +- *) lt_newargv0=$lt_newargv0.exe ;; +- esac +- ;; +- * ) lt_newargv0=$SHELL ;; +- esac +- fi +- +- cat <"))); ++ for (i = 0; i < newargc; i++) + { +- LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, newargz[i])); ++ LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); + } + + EOF + + case $host_os in + mingw*) +- cat <"), ++ (value ? value : ""))); ++ { ++#ifdef HAVE_SETENV ++ /* always make a copy, for consistency with !HAVE_SETENV */ ++ char *str = xstrdup (value); ++ setenv (name, str, 1); ++#else ++ int len = strlen (name) + 1 + strlen (value) + 1; ++ char *str = XMALLOC (char, len); ++ sprintf (str, "%s=%s", name, value); ++ if (putenv (str) != EXIT_SUCCESS) ++ { ++ XFREE (str); ++ } ++#endif ++ } ++} ++ ++char * ++lt_extend_str (const char *orig_value, const char *add, int to_end) ++{ ++ char *new_value; ++ if (orig_value && *orig_value) ++ { ++ int orig_value_len = strlen (orig_value); ++ int add_len = strlen (add); ++ new_value = XMALLOC (char, add_len + orig_value_len + 1); ++ if (to_end) ++ { ++ strcpy (new_value, orig_value); ++ strcpy (new_value + orig_value_len, add); ++ } ++ else ++ { ++ strcpy (new_value, add); ++ strcpy (new_value + add_len, orig_value); ++ } ++ } ++ else ++ { ++ new_value = xstrdup (add); ++ } ++ return new_value; ++} ++ ++int ++lt_split_name_value (const char *arg, char** name, char** value) ++{ ++ const char *p; ++ int len; ++ if (!arg || !*arg) ++ return 1; ++ ++ p = strchr (arg, (int)'='); ++ ++ if (!p) ++ return 1; ++ ++ *value = xstrdup (++p); ++ ++ len = strlen (arg) - strlen (*value); ++ *name = XMALLOC (char, len); ++ strncpy (*name, arg, len-1); ++ (*name)[len - 1] = '\0'; ++ ++ return 0; ++} ++ ++void ++lt_opt_process_env_set (const char *arg) ++{ ++ char *name = NULL; ++ char *value = NULL; ++ ++ if (lt_split_name_value (arg, &name, &value) != 0) ++ { ++ XFREE (name); ++ XFREE (value); ++ lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); ++ } ++ ++ lt_setenv (name, value); ++ XFREE (name); ++ XFREE (value); ++} ++ ++void ++lt_opt_process_env_prepend (const char *arg) ++{ ++ char *name = NULL; ++ char *value = NULL; ++ char *new_value = NULL; ++ ++ if (lt_split_name_value (arg, &name, &value) != 0) ++ { ++ XFREE (name); ++ XFREE (value); ++ lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); ++ } ++ ++ new_value = lt_extend_str (getenv (name), value, 0); ++ lt_setenv (name, new_value); ++ XFREE (new_value); ++ XFREE (name); ++ XFREE (value); ++} ++ ++void ++lt_opt_process_env_append (const char *arg) ++{ ++ char *name = NULL; ++ char *value = NULL; ++ char *new_value = NULL; ++ ++ if (lt_split_name_value (arg, &name, &value) != 0) ++ { ++ XFREE (name); ++ XFREE (value); ++ lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); ++ } ++ ++ new_value = lt_extend_str (getenv (name), value, 1); ++ lt_setenv (name, new_value); ++ XFREE (new_value); ++ XFREE (name); ++ XFREE (value); ++} ++ ++void ++lt_update_exe_path (const char *name, const char *value) ++{ ++ LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", ++ (name ? name : ""), ++ (value ? value : ""))); ++ ++ if (name && *name && value && *value) ++ { ++ char *new_value = lt_extend_str (getenv (name), value, 0); ++ /* some systems can't cope with a ':'-terminated path #' */ ++ int len = strlen (new_value); ++ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) ++ { ++ new_value[len-1] = '\0'; ++ } ++ lt_setenv (name, new_value); ++ XFREE (new_value); ++ } ++} ++ ++void ++lt_update_lib_path (const char *name, const char *value) ++{ ++ LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", ++ (name ? name : ""), ++ (value ? value : ""))); ++ ++ if (name && *name && value && *value) ++ { ++ char *new_value = lt_extend_str (getenv (name), value, 0); ++ lt_setenv (name, new_value); ++ XFREE (new_value); ++ } ++} ++ ++ + EOF + } + # end: func_emit_cwrapperexe_src +@@ -3515,7 +4033,7 @@ + { + $opt_debug + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) ++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra +@@ -3959,6 +4477,13 @@ + -L*) + func_stripname '-L' '' "$arg" + dir=$func_stripname_result ++ if test -z "$dir"; then ++ if test "$#" -gt 0; then ++ func_fatal_error "require no space between \`-L' and \`$1'" ++ else ++ func_fatal_error "need path for \`-L' option" ++ fi ++ fi + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; +@@ -3977,14 +4502,16 @@ + ;; + esac + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) ++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; ++ ::) dllsearchpath=$dir;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; ++ ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; +@@ -3995,7 +4522,7 @@ + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) ++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) + # These systems don't actually have a C or math library (as such) + continue + ;; +@@ -4072,7 +4599,7 @@ + + -no-install) + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) ++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" +@@ -4820,19 +5347,19 @@ + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" ++ tmp_libs= ++ for deplib in $dependency_libs; do ++ deplibs="$deplib $deplibs" ++ if $opt_duplicate_deps ; then ++ case "$tmp_libs " in ++ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; ++ esac ++ fi ++ tmp_libs="$tmp_libs $deplib" ++ done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi +- tmp_libs= +- for deplib in $dependency_libs; do +- deplibs="$deplib $deplibs" +- if $opt_duplicate_deps ; then +- case "$tmp_libs " in +- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; +- esac +- fi +- tmp_libs="$tmp_libs $deplib" +- done + continue + fi # $pass = conv + +@@ -5032,7 +5559,7 @@ + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in +- *cygwin* | *mingw*) ++ *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + notinst_deplibs="$notinst_deplibs $lib" + need_relink=no +@@ -5102,7 +5629,7 @@ + elif test -n "$soname_spec"; then + # bleh windows + case $host in +- *cygwin* | mingw*) ++ *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" +@@ -5369,6 +5896,7 @@ + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do ++ path= + case $deplib in + -L*) path="$deplib" ;; + *.la) +@@ -5884,7 +6412,7 @@ + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in +- *.$objext) ++ *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then +@@ -5955,7 +6483,7 @@ + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) ++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) +@@ -6454,7 +6982,7 @@ + + orig_export_symbols= + case $host_os in +- cygwin* | mingw*) ++ cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then +@@ -7079,14 +7607,16 @@ + esac + fi + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) ++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; ++ ::) dllsearchpath=$libdir;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; ++ ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; +@@ -7156,6 +7686,10 @@ + wrappers_required=no + fi + ;; ++ *cegcc) ++ # Disable wrappers for cegcc, we are cross compiling anyway. ++ wrappers_required=no ++ ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no +@@ -7308,11 +7842,10 @@ + + func_emit_cwrapperexe_src > $cwrappersource + +- # we should really use a build-platform specific compiler +- # here, but OTOH, the wrappers (shell script and this C one) +- # are only useful if you want to execute the "real" binary. +- # Since the "real" binary is built for $host, then this +- # wrapper might as well be built for $host, too. ++ # The wrapper executable is built using the $host compiler, ++ # because it contains $host paths and files. If cross- ++ # compiling, it, like the target executable, must be ++ # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper +@@ -7597,7 +8130,7 @@ + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in +- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; ++ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $ECHO > $output "\ + # $outputname - a libtool library file +--- nufw-2.2.21.orig/configure.ac ++++ nufw-2.2.21/configure.ac +@@ -87,6 +87,7 @@ + #AM_CHECK_PATH([libgcrypt], [gcry_md_open],AC_DEFINE([HAVE_LIBRARY_GCRYPT],[1],[Gcrypt lib flag]), check_gcrypt=no,[-L/usr/local/lib]) + #AM_CHECK_PATH(libgnutls], [gnutls_init],AC_DEFINE([HAVE_LIBRARY_GNUTLS],[1],[Gnutls lib flag]), check_gnutls=no) + ++PKG_PROG_PKG_CONFIG + + NEED_LIBGCRYPT_VERSION=1.2.0 + AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_VERSION") +@@ -99,11 +100,7 @@ + fi + + NEED_LIBGNUTLS_VERSION=1.0.16 +-AM_PATH_LIBGNUTLS("$NEED_LIBGNUTLS_VERSION") +-if test "x$LIBGNUTLS_LIBS" = "x"; then +- AC_MSG_ERROR([libgnutls is needed. +- See www.gnu.org/software/gnutls/ .]) +-fi ++PKG_CHECK_MODULES(GNUTLS, gnutls >= $NEED_LIBGNUTLS_VERSION,,exit) + + #Configure database support, depending on user input + AC_ARG_WITH(prelude-log, +--- nufw-2.2.21.orig/configure ++++ nufw-2.2.21/configure +@@ -1,62 +1,83 @@ + #! /bin/sh + # Guess values for system-dependent variables and create Makefiles. +-# Generated by GNU Autoconf 2.61 for NuFW 2.2.21. ++# Generated by GNU Autoconf 2.64 for NuFW 2.2.21. + # + # Report bugs to . + # + # 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, 2009 Free Software ++# Foundation, Inc. ++# + # This configure script is free software; the Free Software Foundation + # gives unlimited permission to copy, distribute and modify it. +-## --------------------- ## +-## M4sh Initialization. ## +-## --------------------- ## ++## -------------------- ## ++## M4sh Initialization. ## ++## -------------------- ## + + # Be more Bourne compatible + DUALCASE=1; export DUALCASE # for MKS sh +-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then ++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 + else +- case `(set -o) 2>/dev/null` in +- *posix*) set -o posix ;; ++ case `(set -o) 2>/dev/null` in #( ++ *posix*) : ++ set -o posix ;; #( ++ *) : ++ ;; + esac +- + fi + + +- +- +-# PATH needs CR +-# Avoid depending upon Character Ranges. +-as_cr_letters='abcdefghijklmnopqrstuvwxyz' +-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +-as_cr_Letters=$as_cr_letters$as_cr_LETTERS +-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 ++# Prefer a ksh shell builtin over an external printf program on Solaris, ++# but without wasting forks for bash or zsh. ++if test -z "$BASH_VERSION$ZSH_VERSION" \ ++ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then ++ as_echo='print -r --' ++ as_echo_n='print -rn --' ++elif (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 + +-# Support unset when possible. +-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +- as_unset=unset +-else +- as_unset=false ++# 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 + + +@@ -65,20 +86,18 @@ + # 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. +-case $0 in ++case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +-done ++ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break ++ done + IFS=$as_save_IFS + + ;; +@@ -89,354 +108,322 @@ + as_myself=$0 + fi + if test ! -f "$as_myself"; then +- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 +- { (exit 1); exit 1; } ++ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 ++ exit 1 + fi + +-# Work around bugs in pre-3.0 UWIN ksh. +-for as_var in ENV MAIL MAILPATH +-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var ++# Unset variables that we do not need and which cause bugs (e.g. in ++# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" ++# suppresses any "Segmentation fault" message there. '((' could ++# trigger a bug in pdksh 5.2.14. ++for as_var in BASH_ENV ENV MAIL MAILPATH ++do eval test x\${$as_var+set} = xset \ ++ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : + done + PS1='$ ' + 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 +- +-# Required to use basename. +-if expr a : '\(a\)' >/dev/null 2>&1 && +- test "X`expr 00001 : '.*\(...\)'`" = X001; then +- as_expr=expr +-else +- as_expr=false +-fi +- +-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then +- as_basename=basename +-else +- as_basename=false +-fi +- +- +-# Name of the executable. +-as_me=`$as_basename -- "$0" || +-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ +- X"$0" : 'X\(//\)$' \| \ +- X"$0" : 'X\(/\)' \| . 2>/dev/null || +-echo X/"$0" | +- sed '/^.*\/\([^/][^/]*\)\/*$/{ +- s//\1/ +- q +- } +- /^X\/\(\/\/\)$/{ +- s//\1/ +- q +- } +- /^X\/\(\/\).*/{ +- s//\1/ +- q +- } +- s/.*/./; q'` ++LC_ALL=C ++export LC_ALL ++LANGUAGE=C ++export LANGUAGE + + # CDPATH. +-$as_unset CDPATH +- ++(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + if test "x$CONFIG_SHELL" = x; then +- if (eval ":") 2>/dev/null; then +- as_have_required=yes ++ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : ++ emulate sh ++ NULLCMD=: ++ # 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 + else +- as_have_required=no ++ case \`(set -o) 2>/dev/null\` in #( ++ *posix*) : ++ set -o posix ;; #( ++ *) : ++ ;; ++esac + fi +- +- if test $as_have_required = yes && (eval ": +-(as_func_return () { +- (exit \$1) +-} +-as_func_success () { +- as_func_return 0 +-} +-as_func_failure () { +- as_func_return 1 +-} +-as_func_ret_success () { +- return 0 +-} +-as_func_ret_failure () { +- return 1 +-} ++" ++ as_required="as_fn_return () { (exit \$1); } ++as_fn_success () { as_fn_return 0; } ++as_fn_failure () { as_fn_return 1; } ++as_fn_ret_success () { return 0; } ++as_fn_ret_failure () { return 1; } + + exitcode=0 +-if as_func_success; then +- : +-else +- exitcode=1 +- echo as_func_success failed. +-fi +- +-if as_func_failure; then +- exitcode=1 +- echo as_func_failure succeeded. +-fi +- +-if as_func_ret_success; then +- : ++as_fn_success || { exitcode=1; echo as_fn_success failed.; } ++as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } ++as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } ++as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } ++if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : ++ ++else ++ exitcode=1; echo positional parameters were not saved. ++fi ++test x\$exitcode = x0 || exit 1" ++ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO ++ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO ++ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && ++ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 ++test \$(( 1 + 1 )) = 2 || exit 1" ++ if (eval "$as_required") 2>/dev/null; then : ++ as_have_required=yes + else +- exitcode=1 +- echo as_func_ret_success failed. +-fi +- +-if as_func_ret_failure; then +- exitcode=1 +- echo as_func_ret_failure succeeded. ++ as_have_required=no + fi ++ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then +- : + else +- exitcode=1 +- echo positional parameters were not saved. +-fi +- +-test \$exitcode = 0) || { (exit 1); exit 1; } +- +-( +- as_lineno_1=\$LINENO +- as_lineno_2=\$LINENO +- test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && +- test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +-") 2> /dev/null; then +- : +-else +- as_candidate_shells= +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++as_found=false + for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- case $as_dir in ++ as_found=: ++ case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do +- as_candidate_shells="$as_candidate_shells $as_dir/$as_base" ++ # Try only shells that exist, to save several forks. ++ as_shell=$as_dir/$as_base ++ if { test -f "$as_shell" || test -f "$as_shell.exe"; } && ++ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : ++ CONFIG_SHELL=$as_shell as_have_required=yes ++ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : ++ break 2 ++fi ++fi + done;; + esac ++ as_found=false + done ++$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && ++ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : ++ CONFIG_SHELL=$SHELL as_have_required=yes ++fi; } + IFS=$as_save_IFS + + +- for as_shell in $as_candidate_shells $SHELL; do +- # Try only shells that exist, to save several forks. +- if { test -f "$as_shell" || test -f "$as_shell.exe"; } && +- { ("$as_shell") 2> /dev/null <<\_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 +- # is contrary to our usage. Disable this feature. +- alias -g '${1+"$@"}'='"$@"' +- setopt NO_GLOB_SUBST +-else +- case `(set -o) 2>/dev/null` in +- *posix*) set -o posix ;; +-esac +- ++ if test "x$CONFIG_SHELL" != x; then : ++ # We cannot yet assume a decent shell, so we have to provide a ++ # neutralization value for shells without unset; and this also ++ # works around shells that cannot unset nonexistent variables. ++ BASH_ENV=/dev/null ++ ENV=/dev/null ++ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV ++ export CONFIG_SHELL ++ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} ++fi ++ ++ if test x$as_have_required = xno; then : ++ $as_echo "$0: This script requires a shell more modern than all" ++ $as_echo "$0: the shells that I found on your system." ++ if test x${ZSH_VERSION+set} = xset ; then ++ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" ++ $as_echo "$0: be upgraded to zsh 4.3.4 or later." ++ else ++ $as_echo "$0: Please tell bug-autoconf@gnu.org and ++$0: nufw-devel@nongnu.org about your system, including any ++$0: error possibly output before this message. Then install ++$0: a modern shell, or manually run the script under such a ++$0: shell if you do have one." ++ fi ++ exit 1 + fi +- +- +-: +-_ASEOF +-}; then +- CONFIG_SHELL=$as_shell +- as_have_required=yes +- if { "$as_shell" 2> /dev/null <<\_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 +- # is contrary to our usage. Disable this feature. +- alias -g '${1+"$@"}'='"$@"' +- setopt NO_GLOB_SUBST +-else +- case `(set -o) 2>/dev/null` in +- *posix*) set -o posix ;; +-esac +- + fi +- +- +-: +-(as_func_return () { +- (exit $1) +-} +-as_func_success () { +- as_func_return 0 +-} +-as_func_failure () { +- as_func_return 1 +-} +-as_func_ret_success () { +- return 0 +-} +-as_func_ret_failure () { +- return 1 +-} +- +-exitcode=0 +-if as_func_success; then +- : +-else +- exitcode=1 +- echo as_func_success failed. + fi ++SHELL=${CONFIG_SHELL-/bin/sh} ++export SHELL ++# Unset more variables known to interfere with behavior of common tools. ++CLICOLOR_FORCE= GREP_OPTIONS= ++unset CLICOLOR_FORCE GREP_OPTIONS + +-if as_func_failure; then +- exitcode=1 +- echo as_func_failure succeeded. +-fi ++## --------------------- ## ++## M4sh Shell Functions. ## ++## --------------------- ## ++# as_fn_unset VAR ++# --------------- ++# Portably unset VAR. ++as_fn_unset () ++{ ++ { eval $1=; unset $1;} ++} ++as_unset=as_fn_unset ++ ++# as_fn_set_status STATUS ++# ----------------------- ++# Set $? to STATUS, without forking. ++as_fn_set_status () ++{ ++ return $1 ++} # as_fn_set_status ++ ++# as_fn_exit STATUS ++# ----------------- ++# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. ++as_fn_exit () ++{ ++ set +e ++ as_fn_set_status $1 ++ exit $1 ++} # as_fn_exit ++ ++# as_fn_mkdir_p ++# ------------- ++# Create "$as_dir" as a directory, including parents if necessary. ++as_fn_mkdir_p () ++{ + +-if as_func_ret_success; then +- : +-else +- exitcode=1 +- echo as_func_ret_success failed. +-fi ++ case $as_dir in #( ++ -*) as_dir=./$as_dir;; ++ esac ++ test -d "$as_dir" || eval $as_mkdir_p || { ++ as_dirs= ++ while :; do ++ case $as_dir in #( ++ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( ++ *) as_qdir=$as_dir;; ++ esac ++ as_dirs="'$as_qdir' $as_dirs" ++ as_dir=`$as_dirname -- "$as_dir" || ++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ ++ X"$as_dir" : 'X\(//\)[^/]' \| \ ++ X"$as_dir" : 'X\(//\)$' \| \ ++ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || ++$as_echo X"$as_dir" | ++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\/\)[^/].*/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\/\)$/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\).*/{ ++ s//\1/ ++ q ++ } ++ s/.*/./; q'` ++ test -d "$as_dir" && break ++ done ++ test -z "$as_dirs" || eval "mkdir $as_dirs" ++ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + +-if as_func_ret_failure; then +- exitcode=1 +- echo as_func_ret_failure succeeded. +-fi + +-if ( set x; as_func_ret_success y && test x = "$1" ); then +- : ++} # as_fn_mkdir_p ++# as_fn_append VAR VALUE ++# ---------------------- ++# Append the text in VALUE to the end of the definition contained in VAR. Take ++# advantage of any shell optimizations that allow amortized linear growth over ++# repeated appends, instead of the typical quadratic growth present in naive ++# implementations. ++if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : ++ eval 'as_fn_append () ++ { ++ eval $1+=\$2 ++ }' + else +- exitcode=1 +- echo positional parameters were not saved. +-fi +- +-test $exitcode = 0) || { (exit 1); exit 1; } +- +-( +- as_lineno_1=$LINENO +- as_lineno_2=$LINENO +- test "x$as_lineno_1" != "x$as_lineno_2" && +- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } +- +-_ASEOF +-}; then +- break +-fi +- +-fi +- +- done +- +- 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+"$@"} +-fi +- +- +- if test $as_have_required = no; then +- echo This script requires a shell more modern than all the +- echo shells that I found on your system. Please install a +- echo modern shell, or manually run the script under such a +- echo shell if you do have one. +- { (exit 1); exit 1; } +-fi +- +- +-fi +- +-fi ++ as_fn_append () ++ { ++ eval $1=\$$1\$2 ++ } ++fi # as_fn_append + ++# as_fn_arith ARG... ++# ------------------ ++# Perform arithmetic evaluation on the ARGs, and store the result in the ++# global $as_val. Take advantage of shells that can avoid forks. The arguments ++# must be portable across $(()) and expr. ++if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : ++ eval 'as_fn_arith () ++ { ++ as_val=$(( $* )) ++ }' ++else ++ as_fn_arith () ++ { ++ as_val=`expr "$@" || test $? -eq 1` ++ } ++fi # as_fn_arith + + +-(eval "as_func_return () { +- (exit \$1) +-} +-as_func_success () { +- as_func_return 0 +-} +-as_func_failure () { +- as_func_return 1 +-} +-as_func_ret_success () { +- return 0 +-} +-as_func_ret_failure () { +- return 1 +-} ++# as_fn_error ERROR [LINENO LOG_FD] ++# --------------------------------- ++# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are ++# provided, also output the error to LOG_FD, referencing LINENO. Then exit the ++# script with status $?, using 1 if that was 0. ++as_fn_error () ++{ ++ as_status=$?; test $as_status -eq 0 && as_status=1 ++ if test "$3"; then ++ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 ++ fi ++ $as_echo "$as_me: error: $1" >&2 ++ as_fn_exit $as_status ++} # as_fn_error + +-exitcode=0 +-if as_func_success; then +- : ++if expr a : '\(a\)' >/dev/null 2>&1 && ++ test "X`expr 00001 : '.*\(...\)'`" = X001; then ++ as_expr=expr + else +- exitcode=1 +- echo as_func_success failed. +-fi +- +-if as_func_failure; then +- exitcode=1 +- echo as_func_failure succeeded. ++ as_expr=false + fi + +-if as_func_ret_success; then +- : ++if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then ++ as_basename=basename + else +- exitcode=1 +- echo as_func_ret_success failed. +-fi +- +-if as_func_ret_failure; then +- exitcode=1 +- echo as_func_ret_failure succeeded. ++ as_basename=false + fi + +-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then +- : ++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then ++ as_dirname=dirname + else +- exitcode=1 +- echo positional parameters were not saved. ++ as_dirname=false + 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 +-} ++as_me=`$as_basename -- "$0" || ++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ ++ X"$0" : 'X\(//\)$' \| \ ++ X"$0" : 'X\(/\)' \| . 2>/dev/null || ++$as_echo X/"$0" | ++ sed '/^.*\/\([^/][^/]*\)\/*$/{ ++ s//\1/ ++ q ++ } ++ /^X\/\(\/\/\)$/{ ++ s//\1/ ++ q ++ } ++ /^X\/\(\/\).*/{ ++ s//\1/ ++ q ++ } ++ s/.*/./; q'` + ++# Avoid depending upon Character Ranges. ++as_cr_letters='abcdefghijklmnopqrstuvwxyz' ++as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' ++as_cr_Letters=$as_cr_letters$as_cr_LETTERS ++as_cr_digits='0123456789' ++as_cr_alnum=$as_cr_Letters$as_cr_digits + + +- as_lineno_1=$LINENO +- as_lineno_2=$LINENO +- test "x$as_lineno_1" != "x$as_lineno_2" && +- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { +- +- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO +- # uniformly replaced by the line number. The first 'sed' inserts a +- # line-number line after each line using $LINENO; the second 'sed' +- # does the real work. The second script uses 'N' to pair each +- # line-number line with the line containing $LINENO, and appends +- # trailing '-' during substitution so that $LINENO is not a special +- # case at line end. +- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the +- # scripts with optimization help from Paolo Bonzini. Blame Lee +- # E. McMahon (1931-1989) for sed's syntax. :-) ++ as_lineno_1=$LINENO as_lineno_1a=$LINENO ++ as_lineno_2=$LINENO as_lineno_2a=$LINENO ++ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && ++ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { ++ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= +@@ -453,8 +440,7 @@ + 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 +- { (exit 1); exit 1; }; } ++ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the +@@ -464,49 +450,40 @@ + exit + } + +- +-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then +- as_dirname=dirname +-else +- as_dirname=false +-fi +- + ECHO_C= ECHO_N= ECHO_T= +-case `echo -n x` in ++case `echo -n x` in #((((( + -n*) +- case `echo 'x\c'` in ++ case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. +- *) ECHO_C='\c';; ++ xy) ECHO_C='\c';; ++ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ++ ECHO_T=' ';; + esac;; + *) + ECHO_N='-n';; + esac + +-if expr a : '\(a\)' >/dev/null 2>&1 && +- test "X`expr 00001 : '.*\(...\)'`" = X001; then +- as_expr=expr +-else +- as_expr=false +-fi +- + rm -f conf$$ conf$$.exe conf$$.file + 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 +@@ -514,7 +491,7 @@ + rmdir conf$$.dir 2>/dev/null + + if mkdir -p . 2>/dev/null; then +- as_mkdir_p=: ++ as_mkdir_p='mkdir -p "$as_dir"' + else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +@@ -531,12 +508,12 @@ + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then +- test -d "$1/."; ++ test -d "$1/."; + else +- case $1 in +- -*)set "./$1";; ++ case $1 in #( ++ -*)set "./$1";; + esac; +- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ++ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +@@ -551,7 +528,6 @@ + + + +- + # Check that we are running under the correct shell. + SHELL=${CONFIG_SHELL-/bin/sh} + +@@ -718,7 +694,6 @@ + subdirs= + MFLAGS= + MAKEFLAGS= +-SHELL=${CONFIG_SHELL-/bin/sh} + + # Identity of this package. + PACKAGE_NAME='NuFW' +@@ -726,6 +701,7 @@ + PACKAGE_VERSION='2.2.21' + PACKAGE_STRING='NuFW 2.2.21' + PACKAGE_BUGREPORT='nufw-devel@nongnu.org' ++PACKAGE_URL='' + + ac_unique_file="src/nufw/main.c" + # Factoring default headers for most tests. +@@ -764,172 +740,210 @@ + # include + #endif" + +-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 +-LIBTOOL +-build +-build_cpu +-build_vendor +-build_os +-host +-host_cpu +-host_vendor +-host_os +-SED +-GREP +-EGREP +-FGREP +-LD +-DUMPBIN +-ac_ct_DUMPBIN +-NM +-LN_S +-AR +-STRIP +-RANLIB +-lt_ECHO +-DSYMUTIL +-NMEDIT +-LIPO +-OTOOL +-OTOOL64 +-CPP +-INSTALL_PROGRAM +-INSTALL_SCRIPT +-INSTALL_DATA +-DOCBOOK2MAN +-DOCBOOK2PDF +-LIBOBJS +-LIBGCRYPT_CONFIG +-LIBGCRYPT_CFLAGS +-LIBGCRYPT_LIBS +-LIBGNUTLS_CONFIG +-LIBGNUTLS_CFLAGS +-LIBGNUTLS_LIBS +-PYTHON +-PKG_CONFIG +-GLIB_CFLAGS +-GLIB_LIBS +-GLIB_GENMARSHAL +-GOBJECT_QUERY +-GLIB_MKENUMS +-USE_SYSTEM_AUTH_TRUE +-USE_SYSTEM_AUTH_FALSE +-USE_LDAP_TRUE +-USE_LDAP_FALSE +-USE_PRELUDE_LOG_TRUE +-USE_PRELUDE_LOG_FALSE +-USE_MYSQL_LOG_TRUE +-USE_MYSQL_LOG_FALSE +-USE_MYSQL_AUTH_TRUE +-USE_MYSQL_AUTH_FALSE +-HAVE_MYSQL_CONFIG_TRUE +-HAVE_MYSQL_CONFIG_FALSE +-USE_PGSQL_LOG_TRUE +-USE_PGSQL_LOG_FALSE +-USE_PLAINTEXT_AUTH_TRUE +-USE_PLAINTEXT_AUTH_FALSE +-USE_MARK_GROUP_TRUE +-USE_MARK_GROUP_FALSE +-USE_MARK_FIELD_TRUE +-USE_MARK_FIELD_FALSE +-USE_MARK_FLAG_TRUE +-USE_MARK_FLAG_FALSE +-USE_SYSLOG_LOG_TRUE +-USE_SYSLOG_LOG_FALSE +-BUILD_NUFW_TRUE +-BUILD_NUFW_FALSE +-BUILD_NUAUTH_TRUE +-BUILD_NUAUTH_FALSE +-BUILD_NUTCPC_TRUE +-BUILD_NUTCPC_FALSE +-BUILD_LIBNUCLIENT_TRUE +-BUILD_LIBNUCLIENT_FALSE +-BUILD_PAM_NUFW_TRUE +-BUILD_PAM_NUFW_FALSE +-BUILD_NUAUTH_COMMAND_TRUE +-BUILD_NUAUTH_COMMAND_FALSE +-HAVE_IPQ_TRUE +-HAVE_IPQ_FALSE +-USE_USER_MARK_TRUE +-USE_USER_MARK_FALSE +-HAVE_NFQUEUE_ONLY_TRUE +-HAVE_NFQUEUE_ONLY_FALSE +-HAVE_NFQUEUE_CONNTRACK_TRUE +-HAVE_NFQUEUE_CONNTRACK_FALSE +-HAVE_CONNTRACK_ONLY_TRUE +-HAVE_CONNTRACK_ONLY_FALSE +-am__isrc +-CYGPATH_W +-PACKAGE +-VERSION +-ACLOCAL +-AUTOCONF +-AUTOMAKE +-AUTOHEADER +-MAKEINFO +-install_sh +-INSTALL_STRIP_PROGRAM +-mkdir_p +-AWK +-SET_MAKE +-am__leading_dot +-AMTAR +-am__tar +-am__untar +-DEPDIR +-am__include +-am__quote +-AMDEP_TRUE +-AMDEP_FALSE +-AMDEPBACKSLASH +-CCDEPMODE +-am__fastdepCC_TRUE ++ac_subst_vars='LTLIBOBJS + am__fastdepCC_FALSE +-LTLIBOBJS' ++am__fastdepCC_TRUE ++CCDEPMODE ++AMDEPBACKSLASH ++AMDEP_FALSE ++AMDEP_TRUE ++am__quote ++am__include ++DEPDIR ++am__untar ++am__tar ++AMTAR ++am__leading_dot ++SET_MAKE ++AWK ++mkdir_p ++MKDIR_P ++INSTALL_STRIP_PROGRAM ++install_sh ++MAKEINFO ++AUTOHEADER ++AUTOMAKE ++AUTOCONF ++ACLOCAL ++VERSION ++PACKAGE ++CYGPATH_W ++am__isrc ++HAVE_CONNTRACK_ONLY_FALSE ++HAVE_CONNTRACK_ONLY_TRUE ++HAVE_NFQUEUE_CONNTRACK_FALSE ++HAVE_NFQUEUE_CONNTRACK_TRUE ++HAVE_NFQUEUE_ONLY_FALSE ++HAVE_NFQUEUE_ONLY_TRUE ++USE_USER_MARK_FALSE ++USE_USER_MARK_TRUE ++HAVE_IPQ_FALSE ++HAVE_IPQ_TRUE ++BUILD_NUAUTH_COMMAND_FALSE ++BUILD_NUAUTH_COMMAND_TRUE ++BUILD_PAM_NUFW_FALSE ++BUILD_PAM_NUFW_TRUE ++BUILD_LIBNUCLIENT_FALSE ++BUILD_LIBNUCLIENT_TRUE ++BUILD_NUTCPC_FALSE ++BUILD_NUTCPC_TRUE ++BUILD_NUAUTH_FALSE ++BUILD_NUAUTH_TRUE ++BUILD_NUFW_FALSE ++BUILD_NUFW_TRUE ++USE_SYSLOG_LOG_FALSE ++USE_SYSLOG_LOG_TRUE ++USE_MARK_FLAG_FALSE ++USE_MARK_FLAG_TRUE ++USE_MARK_FIELD_FALSE ++USE_MARK_FIELD_TRUE ++USE_MARK_GROUP_FALSE ++USE_MARK_GROUP_TRUE ++USE_PLAINTEXT_AUTH_FALSE ++USE_PLAINTEXT_AUTH_TRUE ++USE_PGSQL_LOG_FALSE ++USE_PGSQL_LOG_TRUE ++HAVE_MYSQL_CONFIG_FALSE ++HAVE_MYSQL_CONFIG_TRUE ++USE_MYSQL_AUTH_FALSE ++USE_MYSQL_AUTH_TRUE ++USE_MYSQL_LOG_FALSE ++USE_MYSQL_LOG_TRUE ++USE_PRELUDE_LOG_FALSE ++USE_PRELUDE_LOG_TRUE ++USE_LDAP_FALSE ++USE_LDAP_TRUE ++USE_SYSTEM_AUTH_FALSE ++USE_SYSTEM_AUTH_TRUE ++GLIB_MKENUMS ++GOBJECT_QUERY ++GLIB_GENMARSHAL ++GLIB_LIBS ++GLIB_CFLAGS ++PYTHON ++GNUTLS_LIBS ++GNUTLS_CFLAGS ++LIBGCRYPT_LIBS ++LIBGCRYPT_CFLAGS ++LIBGCRYPT_CONFIG ++PKG_CONFIG ++LIBOBJS ++DOCBOOK2PDF ++DOCBOOK2MAN ++INSTALL_DATA ++INSTALL_SCRIPT ++INSTALL_PROGRAM ++CPP ++OTOOL64 ++OTOOL ++LIPO ++NMEDIT ++DSYMUTIL ++lt_ECHO ++RANLIB ++STRIP ++AR ++OBJDUMP ++LN_S ++NM ++ac_ct_DUMPBIN ++DUMPBIN ++LD ++FGREP ++EGREP ++GREP ++SED ++host_os ++host_vendor ++host_cpu ++host ++build_os ++build_vendor ++build_cpu ++build ++LIBTOOL ++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_URL ++PACKAGE_BUGREPORT ++PACKAGE_STRING ++PACKAGE_VERSION ++PACKAGE_TARNAME ++PACKAGE_NAME ++PATH_SEPARATOR ++SHELL' + ac_subst_files='' ++ac_user_opts=' ++enable_option_checking ++enable_shared ++enable_static ++with_pic ++enable_fast_install ++with_gnu_ld ++enable_libtool_lock ++with_libgcrypt_prefix ++with_prelude_log ++with_mysql_log ++with_mysql_auth ++with_pgsql_log ++with_syslog_log ++with_plaintext_auth ++with_mark_group ++with_mark_field ++with_mark_flag ++with_system_auth ++with_ldap ++with_nfqueue ++with_nfconntrack ++with_utf8 ++with_fixedtimeout ++enable_nufw ++enable_nuauth ++enable_libnuclient ++enable_nutcpc ++enable_pam_nufw ++enable_nuauth_command ++enable_debug ++with_perf_display ++enable_glibtest ++with_user_mark ++enable_dependency_tracking ++' + ac_precious_vars='build_alias + host_alias + target_alias +@@ -939,12 +953,16 @@ + LIBS + CPPFLAGS + CPP +-PKG_CONFIG' ++PKG_CONFIG ++GNUTLS_CFLAGS ++GNUTLS_LIBS' + + + # 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 +@@ -1043,13 +1061,20 @@ + 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 +- { (exit 1); exit 1; }; } +- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` +- eval enable_$ac_feature=no ;; ++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && ++ as_fn_error "invalid feature name: $ac_useropt" ++ 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 ;; +@@ -1062,13 +1087,20 @@ + 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 +- { (exit 1); exit 1; }; } +- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` +- eval enable_$ac_feature=\$ac_optarg ;; ++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && ++ as_fn_error "invalid feature name: $ac_useropt" ++ 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- \ +@@ -1259,22 +1291,36 @@ + 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 +- { (exit 1); exit 1; }; } +- ac_package=`echo $ac_package | sed 's/[-.]/_/g'` +- eval with_$ac_package=\$ac_optarg ;; ++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && ++ as_fn_error "invalid package name: $ac_useropt" ++ 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 +- { (exit 1); exit 1; }; } +- ac_package=`echo $ac_package | sed 's/[-.]/_/g'` +- eval with_$ac_package=no ;; ++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && ++ as_fn_error "invalid package name: $ac_useropt" ++ 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. +@@ -1294,25 +1340,25 @@ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + +- -*) { echo "$as_me: error: unrecognized option: $ac_option +-Try \`$0 --help' for more information." >&2 +- { (exit 1); exit 1; }; } ++ -*) as_fn_error "unrecognized option: \`$ac_option' ++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 +- { (exit 1); exit 1; }; } ++ case $ac_envvar in #( ++ '' | [0-9]* | *[!_$as_cr_alnum]* ) ++ as_fn_error "invalid variable name: \`$ac_envvar'" ;; ++ esac + 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} + ;; + +@@ -1321,23 +1367,36 @@ + + if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` +- { echo "$as_me: error: missing argument to $ac_option" >&2 +- { (exit 1); exit 1; }; } ++ as_fn_error "missing argument to $ac_option" ++fi ++ ++if test -n "$ac_unrecognized_opts"; then ++ case $enable_option_checking in ++ no) ;; ++ fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; ++ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; ++ esac + fi + +-# Be sure to have absolute directory names. ++# 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 +- { (exit 1); exit 1; }; } ++ as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + done + + # There might be people who depend on the old broken behavior: `$host' +@@ -1351,7 +1410,7 @@ + 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 +@@ -1367,23 +1426,21 @@ + 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 +- { (exit 1); exit 1; }; } ++ as_fn_error "working directory cannot be determined" + test "X$ac_ls_di" = "X$ac_pwd_ls_di" || +- { echo "$as_me: error: pwd does not report name of working directory" >&2 +- { (exit 1); exit 1; }; } ++ as_fn_error "pwd does not report name of working directory" + + + # Find the source files, if location was not specified. + if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then 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 +@@ -1410,13 +1467,11 @@ + 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 +- { (exit 1); exit 1; }; } ++ as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + 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 +- { (exit 1); exit 1; }; } ++ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + pwd)` + # When building in place, set srcdir=. + if test "$ac_abs_confdir" = "$ac_pwd"; then +@@ -1464,9 +1519,9 @@ + + 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 +@@ -1476,25 +1531,25 @@ + 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/nufw] +- --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/nufw] ++ --htmldir=DIR html documentation [DOCDIR] ++ --dvidir=DIR dvi documentation [DOCDIR] ++ --pdfdir=DIR pdf documentation [DOCDIR] ++ --psdir=DIR ps documentation [DOCDIR] + _ACEOF + + cat <<\_ACEOF +@@ -1517,6 +1572,7 @@ + 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] +@@ -1544,7 +1600,6 @@ + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-libgcrypt-prefix=PFX + prefix where LIBGCRYPT is installed (optional) +- --with-libgnutls-prefix=PFX Prefix where libgnutls is installed (optional) + --with-prelude-log Support user activity logging in Prelude + --with-mysql-log Support user activity logging in Mysql database + --with-mysql-auth Support user authentication in Mysql database +@@ -1575,87 +1630,506 @@ + you have headers in a nonstandard directory + CPP C preprocessor + PKG_CONFIG path to pkg-config utility ++ GNUTLS_CFLAGS ++ C compiler flags for GNUTLS, overriding pkg-config ++ GNUTLS_LIBS linker flags for GNUTLS, overriding pkg-config + + Use these variables to override the choices made by `configure' or to help + it to find libraries and programs with nonstandard names/locations. + +-Report bugs to . +-_ACEOF +-ac_status=$? ++Report bugs to . ++_ACEOF ++ac_status=$? ++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" || ++ { 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` ++ # A ".." for each directory in $ac_dir_suffix. ++ 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/ ;; ++ esac ;; ++esac ++ac_abs_top_builddir=$ac_pwd ++ac_abs_builddir=$ac_pwd$ac_dir_suffix ++# for backward compatibility: ++ac_top_builddir=$ac_top_build_prefix ++ ++case $srcdir in ++ .) # We are building in place. ++ ac_srcdir=. ++ ac_top_srcdir=$ac_top_builddir_sub ++ ac_abs_top_srcdir=$ac_pwd ;; ++ [\\/]* | ?:[\\/]* ) # Absolute name. ++ ac_srcdir=$srcdir$ac_dir_suffix; ++ ac_top_srcdir=$srcdir ++ ac_abs_top_srcdir=$srcdir ;; ++ *) # Relative name. ++ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ++ ac_top_srcdir=$ac_top_build_prefix$srcdir ++ ac_abs_top_srcdir=$ac_pwd/$srcdir ;; ++esac ++ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix ++ ++ cd "$ac_dir" || { ac_status=$?; continue; } ++ # Check for guested configure. ++ if test -f "$ac_srcdir/configure.gnu"; then ++ echo && ++ $SHELL "$ac_srcdir/configure.gnu" --help=recursive ++ elif test -f "$ac_srcdir/configure"; then ++ echo && ++ $SHELL "$ac_srcdir/configure" --help=recursive ++ else ++ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 ++ fi || ac_status=$? ++ cd "$ac_pwd" || { ac_status=$?; break; } ++ done ++fi ++ ++test -n "$ac_init_help" && exit $ac_status ++if $ac_init_version; then ++ cat <<\_ACEOF ++NuFW configure 2.2.21 ++generated by GNU Autoconf 2.64 ++ ++Copyright (C) 2009 Free Software Foundation, Inc. ++This configure script is free software; the Free Software Foundation ++gives unlimited permission to copy, distribute and modify it. ++_ACEOF ++ exit ++fi ++ ++## ------------------------ ## ++## Autoconf initialization. ## ++## ------------------------ ## ++ ++# ac_fn_c_try_compile LINENO ++# -------------------------- ++# Try to compile conftest.$ac_ext, and return whether this succeeded. ++ac_fn_c_try_compile () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ 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:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_compile") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then : ++ ac_retval=0 ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_retval=1 ++fi ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} ++ return $ac_retval ++ ++} # ac_fn_c_try_compile ++ ++# ac_fn_c_try_link LINENO ++# ----------------------- ++# Try to link conftest.$ac_ext, and return whether this succeeded. ++ac_fn_c_try_link () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ 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:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++ 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 : ++ ac_retval=0 ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_retval=1 ++fi ++ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information ++ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would ++ # interfere with the next link command; also delete a directory that is ++ # left behind by Apple's compiler. We do this before executing the actions. ++ rm -rf conftest.dSYM conftest_ipa8_conftest.oo ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} ++ return $ac_retval ++ ++} # ac_fn_c_try_link ++ ++# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES ++# ------------------------------------------------------- ++# Tests whether HEADER exists and can be compiled using the include files in ++# INCLUDES, setting the cache variable VAR accordingly. ++ac_fn_c_check_header_compile () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++$as_echo_n "checking for $2... " >&6; } ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$4 ++#include <$2> ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ eval "$3=yes" ++else ++ eval "$3=no" ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} ++ ++} # ac_fn_c_check_header_compile ++ ++# ac_fn_c_try_cpp LINENO ++# ---------------------- ++# Try to preprocess conftest.$ac_ext, and return whether this succeeded. ++ac_fn_c_try_cpp () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ if { { ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then : ++ ac_retval=0 ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_retval=1 + fi ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} ++ return $ac_retval + +-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 +- ac_builddir=. ++} # ac_fn_c_try_cpp + +-case "$ac_dir" in +-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +-*) +- ac_dir_suffix=/`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,/,,'` +- case $ac_top_builddir_sub in +- "") ac_top_builddir_sub=. ac_top_build_prefix= ;; +- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; +- esac ;; ++# ac_fn_c_try_run LINENO ++# ---------------------- ++# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes ++# that executables *can* be run. ++ac_fn_c_try_run () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ if { { ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; + esac +-ac_abs_top_builddir=$ac_pwd +-ac_abs_builddir=$ac_pwd$ac_dir_suffix +-# for backward compatibility: +-ac_top_builddir=$ac_top_build_prefix +- +-case $srcdir in +- .) # We are building in place. +- ac_srcdir=. +- ac_top_srcdir=$ac_top_builddir_sub +- ac_abs_top_srcdir=$ac_pwd ;; +- [\\/]* | ?:[\\/]* ) # Absolute name. +- ac_srcdir=$srcdir$ac_dir_suffix; +- ac_top_srcdir=$srcdir +- ac_abs_top_srcdir=$srcdir ;; +- *) # Relative name. +- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix +- ac_top_srcdir=$ac_top_build_prefix$srcdir +- ac_abs_top_srcdir=$ac_pwd/$srcdir ;; ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' ++ { { case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; + esac +-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_try") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then : ++ ac_retval=0 ++else ++ $as_echo "$as_me: program exited with status $ac_status" >&5 ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 + +- cd "$ac_dir" || { ac_status=$?; continue; } +- # Check for guested configure. +- if test -f "$ac_srcdir/configure.gnu"; then +- echo && +- $SHELL "$ac_srcdir/configure.gnu" --help=recursive +- elif test -f "$ac_srcdir/configure"; then +- echo && +- $SHELL "$ac_srcdir/configure" --help=recursive +- else +- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 +- fi || ac_status=$? +- cd "$ac_pwd" || { ac_status=$?; break; } +- done ++ ac_retval=$ac_status + fi ++ rm -rf conftest.dSYM conftest_ipa8_conftest.oo ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} ++ return $ac_retval + +-test -n "$ac_init_help" && exit $ac_status +-if $ac_init_version; then +- cat <<\_ACEOF +-NuFW configure 2.2.21 +-generated by GNU Autoconf 2.61 ++} # ac_fn_c_try_run + +-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +-This configure script is free software; the Free Software Foundation +-gives unlimited permission to copy, distribute and modify it. ++# ac_fn_c_check_func LINENO FUNC VAR ++# ---------------------------------- ++# Tests whether FUNC exists, setting the cache variable VAR accordingly ++ac_fn_c_check_func () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++$as_echo_n "checking for $2... " >&6; } ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++/* Define $2 to an innocuous variant, in case declares $2. ++ For example, HP-UX 11i declares gettimeofday. */ ++#define $2 innocuous_$2 ++ ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char $2 (); below. ++ Prefer to if __STDC__ is defined, since ++ exists even on freestanding compilers. */ ++ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ ++#undef $2 ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char $2 (); ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined __stub_$2 || defined __stub___$2 ++choke me ++#endif ++ ++int ++main () ++{ ++return $2 (); ++ ; ++ return 0; ++} + _ACEOF +- exit ++if ac_fn_c_try_link "$LINENO"; then : ++ eval "$3=yes" ++else ++ eval "$3=no" ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} ++ ++} # ac_fn_c_check_func ++ ++# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES ++# ---------------------------------------------------- ++# Tries to find if the field MEMBER exists in type AGGR, after including ++# INCLUDES, setting cache variable VAR accordingly. ++ac_fn_c_check_member () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 ++$as_echo_n "checking for $2.$3... " >&6; } ++if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$5 ++int ++main () ++{ ++static $2 ac_aggr; ++if (ac_aggr.$3) ++return 0; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ eval "$4=yes" ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$5 ++int ++main () ++{ ++static $2 ac_aggr; ++if (sizeof ac_aggr.$3) ++return 0; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ eval "$4=yes" ++else ++ eval "$4=no" + fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++eval ac_res=\$$4 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} ++ ++} # ac_fn_c_check_member ++ ++# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES ++# ------------------------------------------------------- ++# Tests whether HEADER exists, giving a warning if it cannot be compiled using ++# the include files in INCLUDES and setting the cache variable VAR ++# accordingly. ++ac_fn_c_check_header_mongrel () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++$as_echo_n "checking for $2... " >&6; } ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : ++ $as_echo_n "(cached) " >&6 ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++else ++ # Is the header compilable? ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 ++$as_echo_n "checking $2 usability... " >&6; } ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$4 ++#include <$2> ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_header_compiler=yes ++else ++ ac_header_compiler=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 ++$as_echo "$ac_header_compiler" >&6; } ++ ++# Is the header present? ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 ++$as_echo_n "checking $2 presence... " >&6; } ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include <$2> ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ ac_header_preproc=yes ++else ++ ac_header_preproc=no ++fi ++rm -f conftest.err conftest.$ac_ext ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 ++$as_echo "$ac_header_preproc" >&6; } ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( ++ yes:no: ) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 ++$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 ++$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ++ ;; ++ no:yes:* ) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 ++$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 ++$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 ++$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 ++$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 ++$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ++( cat <<\_ASBOX ++## ------------------------------------ ## ++## Report this to nufw-devel@nongnu.org ## ++## ------------------------------------ ## ++_ASBOX ++ ) | sed "s/^/$as_me: WARNING: /" >&2 ++ ;; ++esac ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++$as_echo_n "checking for $2... " >&6; } ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : ++ $as_echo_n "(cached) " >&6 ++else ++ eval "$3=\$ac_header_compiler" ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++fi ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} ++ ++} # ac_fn_c_check_header_mongrel + cat >config.log <<_ACEOF + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. + + It was created by NuFW $as_me 2.2.21, which was +-generated by GNU Autoconf 2.61. Invocation command line was ++generated by GNU Autoconf 2.64. Invocation command line was + + $ $0 $@ + +@@ -1691,8 +2165,8 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- echo "PATH: $as_dir" +-done ++ $as_echo "PATH: $as_dir" ++ done + IFS=$as_save_IFS + + } >&5 +@@ -1726,12 +2200,12 @@ + | -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'" ;; ++ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) +- ac_configure_args1="$ac_configure_args1 '$ac_arg'" ++ as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else +@@ -1747,13 +2221,13 @@ + -* ) ac_must_keep_next=true ;; + esac + fi +- ac_configure_args="$ac_configure_args '$ac_arg'" ++ as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done + done +-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } ++{ ac_configure_args0=; unset ac_configure_args0;} ++{ ac_configure_args1=; unset ac_configure_args1;} + + # When interrupted or exit'd, cleanup temporary files, and complete + # config.log. We remove comments because anyway the quotes in there +@@ -1778,12 +2252,13 @@ + 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:${as_lineno-$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) ;; #( +- *) $as_unset $ac_var ;; ++ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( ++ *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done +@@ -1812,9 +2287,9 @@ + 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 + +@@ -1829,9 +2304,9 @@ + 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 +@@ -1847,64 +2322,69 @@ + 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 && + exit $exit_status + ' 0 + for ac_signal in 1 2 13 15; do +- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal ++ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal + done + ac_signal=0 + + # confdefs.h avoids OS command line length limits that DEFS can exceed. + rm -f -r conftest* confdefs.h + ++$as_echo "/* confdefs.h */" > confdefs.h ++ + # Predefined preprocessor variables. + + cat >>confdefs.h <<_ACEOF + #define PACKAGE_NAME "$PACKAGE_NAME" + _ACEOF + +- + cat >>confdefs.h <<_ACEOF + #define PACKAGE_TARNAME "$PACKAGE_TARNAME" + _ACEOF + +- + cat >>confdefs.h <<_ACEOF + #define PACKAGE_VERSION "$PACKAGE_VERSION" + _ACEOF + +- + cat >>confdefs.h <<_ACEOF + #define PACKAGE_STRING "$PACKAGE_STRING" + _ACEOF + +- + cat >>confdefs.h <<_ACEOF + #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" + _ACEOF + ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_URL "$PACKAGE_URL" ++_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:${as_lineno-$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 +@@ -1914,16 +2394,16 @@ + # 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:${as_lineno-$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:${as_lineno-$LINENO}: creating cache $cache_file" >&5 ++$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file + fi + +@@ -1937,68 +2417,56 @@ + 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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 ++$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} ++ { $as_echo "$as_me:${as_lineno-$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 + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. +- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; ++ *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + 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;} +- { (exit 1); exit 1; }; } +-fi +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ++ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++ { $as_echo "$as_me:${as_lineno-$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_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 ++fi ++## -------------------- ## ++## Main body of script. ## ++## -------------------- ## + + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' +@@ -2020,10 +2488,10 @@ + 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; } +-if test "${ac_cv_prog_CC+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_CC+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +@@ -2033,25 +2501,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + 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:${as_lineno-$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:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -2060,10 +2528,10 @@ + 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; } +-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$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 : ++ $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. +@@ -2073,25 +2541,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + 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:${as_lineno-$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:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + if test "x$ac_ct_CC" = x; then +@@ -2099,12 +2567,8 @@ + 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:${as_lineno-$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 +@@ -2117,10 +2581,10 @@ + 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; } +-if test "${ac_cv_prog_CC+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_CC+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +@@ -2130,25 +2594,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + 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:${as_lineno-$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:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -2157,10 +2621,10 @@ + 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; } +-if test "${ac_cv_prog_CC+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_CC+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +@@ -2171,18 +2635,18 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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 + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + if test $ac_prog_rejected = yes; then +@@ -2201,11 +2665,11 @@ + 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:${as_lineno-$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:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -2216,10 +2680,10 @@ + 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; } +-if test "${ac_cv_prog_CC+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_CC+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +@@ -2229,25 +2693,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + 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:${as_lineno-$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:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -2260,10 +2724,10 @@ + 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; } +-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$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 : ++ $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. +@@ -2273,25 +2737,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + 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:${as_lineno-$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:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -2303,12 +2767,8 @@ + 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:${as_lineno-$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 +@@ -2318,98 +2778,82 @@ + fi + + +-test -z "$CC" && { { 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 +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error "no acceptable C compiler found in \$PATH ++See \`config.log' for more details." "$LINENO" 5; } + + # Provide some information about the compiler. +-echo "$as_me:$LINENO: checking for C compiler version" >&5 +-ac_compiler=`set X $ac_compile; echo $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_compiler --version >&5") 2>&5 +- ac_status=$? +- 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_compiler -v >&5") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } +-{ (ac_try="$ac_compiler -V >&5" ++$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 ++set X $ac_compile ++ac_compiler=$2 ++for ac_option in --version -v -V -qversion; do ++ { { ac_try="$ac_compiler $ac_option >&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_compiler -V >&5") 2>&5 ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } ++ if test -s conftest.err; then ++ sed '10a\ ++... rest of stderr output deleted ... ++ 10q' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ rm -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++done + +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +- ++#include + int + main () + { ++FILE *f = fopen ("conftest.out", "w"); ++ return ferror (f) || fclose (f) != 0; + + ; + return 0; + } + _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 conftest.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:${as_lineno-$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 + rm -f $ac_rmfiles + +-if { (ac_try="$ac_link_default" ++if { { ac_try="$ac_link_default" + 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:${as_lineno-$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 +- (exit $ac_status); }; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; 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' + # in a Makefile. We should not override ac_cv_exeext if it was cached, +@@ -2419,14 +2863,14 @@ + 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 + # certainly right. + break;; + *.* ) +- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; ++ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi +@@ -2445,78 +2889,75 @@ + else + ac_file='' + fi +- +-{ echo "$as_me:$LINENO: result: $ac_file" >&5 +-echo "${ECHO_T}$ac_file" >&6; } +-if test -z "$ac_file"; then +- echo "$as_me: failed program was:" >&5 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 ++$as_echo "$ac_file" >&6; } ++if test -z "$ac_file"; then : ++ $as_echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + +-{ { 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 +-See \`config.log' for more details." >&2;} +- { (exit 77); exit 77; }; } ++{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++{ as_fn_set_status 77 ++as_fn_error "C compiler cannot create executables ++See \`config.log' for more details." "$LINENO" 5; }; } + 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; } +-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 ++$as_echo_n "checking whether the C compiler works... " >&6; } + # If not cross compiling, check that we can run a simple program. + if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' +- { (case "(($ac_try" in ++ { { 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:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; 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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_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. +-If you meant to cross compile, use \`--host'. +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++See \`config.log' for more details." "$LINENO" 5; } + fi + fi + fi +-{ echo "$as_me:$LINENO: result: yes" >&5 +-echo "${ECHO_T}yes" >&6; } ++{ $as_echo "$as_me:${as_lineno-$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 conftest.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; } +- +-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +-if { (ac_try="$ac_link" ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 ++$as_echo_n "checking whether we are cross compiling... " >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 ++$as_echo "$cross_compiling" >&6; } ++ ++{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) + # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will + # work properly (i.e., refer to `conftest.exe'), while it won't with +@@ -2524,37 +2965,31 @@ + 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 +-See \`config.log' for more details." >&5 +-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error "cannot compute suffix of executables: cannot compile and link ++See \`config.log' for more details." "$LINENO" 5; } + 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:${as_lineno-$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; } +-if test "${ac_cv_objext+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$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 : ++ $as_echo_n "(cached) " >&6 + else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -2566,51 +3001,46 @@ + } + _ACEOF + rm -f conftest.o conftest.obj +-if { (ac_try="$ac_compile" ++if { { ac_try="$ac_compile" + 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:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; 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 +-See \`config.log' for more details." >&5 +-echo "$as_me: error: cannot compute suffix of object files: cannot compile +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error "cannot compute suffix of object files: cannot compile ++See \`config.log' for more details." "$LINENO" 5; } + 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:${as_lineno-$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; } +-if test "${ac_cv_c_compiler_gnu+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$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 : ++ $as_echo_n "(cached) " >&6 + else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -2624,54 +3054,34 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then ++if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_compiler_gnu=no ++ ac_compiler_gnu=no + fi +- + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + 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:${as_lineno-$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; } +-if test "${ac_cv_prog_cc_g+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$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 : ++ $as_echo_n "(cached) " >&6 + else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -2682,34 +3092,11 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then ++if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- CFLAGS="" +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ CFLAGS="" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -2720,35 +3107,12 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 +-sed 's/^/| /' conftest.$ac_ext >&5 ++if ac_fn_c_try_compile "$LINENO"; then : + +- ac_c_werror_flag=$ac_save_c_werror_flag ++else ++ ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -2759,42 +3123,18 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then ++if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- + fi +- + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +- + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + 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:${as_lineno-$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 +@@ -2810,18 +3150,14 @@ + 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; } +-if test "${ac_cv_prog_cc_c89+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$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 : ++ $as_echo_n "(cached) " >&6 + else + ac_cv_prog_cc_c89=no + ac_save_CC=$CC +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + #include +@@ -2878,31 +3214,9 @@ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" + do + CC="$ac_save_CC $ac_arg" +- 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then ++ if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- + fi +- + rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break + done +@@ -2913,17 +3227,19 @@ + # 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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 ++$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; + esac ++if test "x$ac_cv_prog_cc_c89" != xno; then : + ++fi + + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' +@@ -2935,20 +3251,18 @@ + # check for a ISO C99 compiler + + +- case $ac_cv_prog_cc_stdc in +- no) ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; +- *) { echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5 +-echo $ECHO_N "checking for $CC option to accept ISO C99... $ECHO_C" >&6; } +-if test "${ac_cv_prog_cc_c99+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ case $ac_cv_prog_cc_stdc in #( ++ no) : ++ ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( ++ *) : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 ++$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } ++if test "${ac_cv_prog_cc_c99+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_cv_prog_cc_c99=no + ac_save_CC=$CC +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + #include +@@ -3087,34 +3401,12 @@ + return 0; + } + _ACEOF +-for ac_arg in '' -std=gnu99 -c99 -qlanglvl=extc99 ++for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 + do + CC="$ac_save_CC $ac_arg" +- 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then ++ if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c99=$ac_arg +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- + fi +- + rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break + done +@@ -3125,31 +3417,27 @@ + # AC_CACHE_VAL + case "x$ac_cv_prog_cc_c99" in + x) +- { echo "$as_me:$LINENO: result: none needed" >&5 +-echo "${ECHO_T}none needed" >&6; } ;; ++ { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: unsupported" >&5 ++$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" +- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5 +-echo "${ECHO_T}$ac_cv_prog_cc_c99" >&6; } ;; ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 ++$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; + esac +-if test "x$ac_cv_prog_cc_c99" != xno; then ++if test "x$ac_cv_prog_cc_c99" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + else +- { 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; } +-if test "${ac_cv_prog_cc_c89+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$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 : ++ $as_echo_n "(cached) " >&6 + else + ac_cv_prog_cc_c89=no + ac_save_CC=$CC +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + #include +@@ -3206,31 +3494,9 @@ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" + do + CC="$ac_save_CC $ac_arg" +- 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then ++ if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- + fi +- + rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break + done +@@ -3241,54 +3507,50 @@ + # 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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 ++$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; + esac +-if test "x$ac_cv_prog_cc_c89" != xno; then ++if test "x$ac_cv_prog_cc_c89" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + else + ac_cv_prog_cc_stdc=no + fi + +- + fi +- + ;; + esac +- { echo "$as_me:$LINENO: checking for $CC option to accept ISO Standard C" >&5 +-echo $ECHO_N "checking for $CC option to accept ISO Standard C... $ECHO_C" >&6; } +- if test "${ac_cv_prog_cc_stdc+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-fi +- +- case $ac_cv_prog_cc_stdc in +- no) { echo "$as_me:$LINENO: result: unsupported" >&5 +-echo "${ECHO_T}unsupported" >&6; } ;; +- '') { echo "$as_me:$LINENO: result: none needed" >&5 +-echo "${ECHO_T}none needed" >&6; } ;; +- *) { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6; } ;; ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 ++$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } ++ if test "${ac_cv_prog_cc_stdc+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++fi ++ ++ case $ac_cv_prog_cc_stdc in #( ++ no) : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 ++$as_echo "unsupported" >&6; } ;; #( ++ '') : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 ++$as_echo "none needed" >&6; } ;; #( ++ *) : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 ++$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; + esac + + +- +-{ echo "$as_me:$LINENO: checking for an ANSI C99-conforming __func__" >&5 +-echo $ECHO_N "checking for an ANSI C99-conforming __func__... $ECHO_C" >&6; } +-if test "${ac_cv_cpp_func+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C99-conforming __func__" >&5 ++$as_echo_n "checking for an ANSI C99-conforming __func__... " >&6; } ++if test "${ac_cv_cpp_func+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -3299,33 +3561,10 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then ++if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_cpp_func=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -3336,56 +3575,29 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then ++if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_cpp_func=__FUNCTION__ + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_cpp_func=no ++ ac_cv_cpp_func=no + fi +- + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +- + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_cpp_func" >&5 +-echo "${ECHO_T}$ac_cv_cpp_func" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_func" >&5 ++$as_echo "$ac_cv_cpp_func" >&6; } + + if test $ac_cv_cpp_func = yes; then + +-cat >>confdefs.h <<\_ACEOF +-#define __PRELUDE_FUNC__ __func__ +-_ACEOF ++$as_echo "#define __PRELUDE_FUNC__ __func__" >>confdefs.h + + elif test $ac_cv_cpp_func = __FUNCTION__; then + +-cat >>confdefs.h <<\_ACEOF +-#define __PRELUDE_FUNC__ __FUNCTION__ +-_ACEOF ++$as_echo "#define __PRELUDE_FUNC__ __FUNCTION__" >>confdefs.h + + elif test $ac_cv_cpp_func = no; then + +-cat >>confdefs.h <<\_ACEOF +-#define __PRELUDE_FUNC__ "" +-_ACEOF ++$as_echo "#define __PRELUDE_FUNC__ \"\"" >>confdefs.h + + fi + +@@ -3393,14 +3605,14 @@ + + case `pwd` in + *\ * | *\ *) +- { echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +-echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 ++$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; + esac + + + +-macro_version='2.2.4' +-macro_revision='1.2976' ++macro_version='2.2.6' ++macro_revision='1.3012' + + + +@@ -3418,24 +3630,16 @@ + + ac_aux_dir= + for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do +- if test -f "$ac_dir/install-sh"; then +- ac_aux_dir=$ac_dir +- ac_install_sh="$ac_aux_dir/install-sh -c" +- break +- elif test -f "$ac_dir/install.sh"; then +- ac_aux_dir=$ac_dir +- ac_install_sh="$ac_aux_dir/install.sh -c" +- break +- elif test -f "$ac_dir/shtool"; then +- ac_aux_dir=$ac_dir +- ac_install_sh="$ac_aux_dir/shtool install -c" +- break +- fi ++ for ac_t in install-sh install.sh shtool; do ++ if test -f "$ac_dir/$ac_t"; then ++ ac_aux_dir=$ac_dir ++ ac_install_sh="$ac_aux_dir/$ac_t -c" ++ break 2 ++ fi ++ done + done + if test -z "$ac_aux_dir"; then +- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +-echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + fi + + # These three variables are undocumented and unsupported, +@@ -3449,35 +3653,27 @@ + + # Make sure we can run config.sub. + $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || +- { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +-echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} +- { (exit 1); exit 1; }; } +- +-{ echo "$as_me:$LINENO: checking build system type" >&5 +-echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +-if test "${ac_cv_build+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 ++$as_echo_n "checking build system type... " >&6; } ++if test "${ac_cv_build+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_build_alias=$build_alias + test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + test "x$ac_build_alias" = x && +- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +-echo "$as_me: error: cannot guess build type; you must specify one" >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 + ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || +- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +-echo "${ECHO_T}$ac_cv_build" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 ++$as_echo "$ac_cv_build" >&6; } + case $ac_cv_build in + *-*-*) ;; +-*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +-echo "$as_me: error: invalid value of canonical build" >&2;} +- { (exit 1); exit 1; }; };; ++*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; + esac + build=$ac_cv_build + ac_save_IFS=$IFS; IFS='-' +@@ -3493,28 +3689,24 @@ + case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +-{ echo "$as_me:$LINENO: checking host system type" >&5 +-echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +-if test "${ac_cv_host+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 ++$as_echo_n "checking host system type... " >&6; } ++if test "${ac_cv_host+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build + else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || +- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + fi + + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +-echo "${ECHO_T}$ac_cv_host" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 ++$as_echo "$ac_cv_host" >&6; } + case $ac_cv_host in + *-*-*) ;; +-*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +-echo "$as_me: error: invalid value of canonical host" >&2;} +- { (exit 1); exit 1; }; };; ++*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; + esac + host=$ac_cv_host + ac_save_IFS=$IFS; IFS='-' +@@ -3530,51 +3722,46 @@ + case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +-{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +-echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } +-if test "${ac_cv_path_SED+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 ++$as_echo_n "checking for a sed that does not truncate output... " >&6; } ++if test "${ac_cv_path_SED+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done +- echo "$ac_script" | sed 99q >conftest.sed +- $as_unset ac_script || ac_script= +- # Extract the first word of "sed gsed" to use in msg output +-if test -z "$SED"; then +-set dummy sed gsed; ac_prog_name=$2 +-if test "${ac_cv_path_SED+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else ++ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed ++ { ac_script=; unset ac_script;} ++ if test -z "$SED"; then + ac_path_SED_found=false +-# Loop through the user's path and test for each of PROGNAME-LIST +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++ # Loop through the user's path and test for each of PROGNAME-LIST ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_prog in sed gsed; do +- for ac_exec_ext in '' $ac_executable_extensions; do +- ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" +- { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +- # Check for GNU ac_path_SED and select it if it is found. ++ for ac_prog in sed gsed; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" ++ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue ++# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED + case `"$ac_path_SED" --version 2>&1` in + *GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; + *) + ac_count=0 +- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" ++ $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" +- echo '' >> "conftest.nl" ++ $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break +- ac_count=`expr $ac_count + 1` ++ as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" +@@ -3586,31 +3773,21 @@ + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; + esac + +- +- $ac_path_SED_found && break 3 ++ $ac_path_SED_found && break 3 ++ done ++ done + done +-done +- +-done + IFS=$as_save_IFS +- +- +-fi +- +-SED="$ac_cv_path_SED" +-if test -z "$SED"; then +- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5 +-echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;} +- { (exit 1); exit 1; }; } +-fi +- ++ if test -z "$ac_cv_path_SED"; then ++ as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 ++ fi + else + ac_cv_path_SED=$SED + fi + + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 +-echo "${ECHO_T}$ac_cv_path_SED" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 ++$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +@@ -3627,45 +3804,40 @@ + + + +-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +-if test "${ac_cv_path_GREP+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- # Extract the first word of "grep ggrep" to use in msg output +-if test -z "$GREP"; then +-set dummy grep ggrep; ac_prog_name=$2 +-if test "${ac_cv_path_GREP+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 ++$as_echo_n "checking for grep that handles long lines and -e... " >&6; } ++if test "${ac_cv_path_GREP+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else ++ if test -z "$GREP"; then + ac_path_GREP_found=false +-# Loop through the user's path and test for each of PROGNAME-LIST +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++ # Loop through the user's path and test for each of PROGNAME-LIST ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_prog in grep ggrep; do +- for ac_exec_ext in '' $ac_executable_extensions; do +- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" +- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +- # Check for GNU ac_path_GREP and select it if it is found. ++ for ac_prog in grep ggrep; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" ++ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue ++# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP + case `"$ac_path_GREP" --version 2>&1` in + *GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; + *) + ac_count=0 +- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" ++ $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" +- echo 'GREP' >> "conftest.nl" ++ $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break +- ac_count=`expr $ac_count + 1` ++ as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" +@@ -3677,77 +3849,61 @@ + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; + esac + +- +- $ac_path_GREP_found && break 3 ++ $ac_path_GREP_found && break 3 ++ done ++ done + done +-done +- +-done + IFS=$as_save_IFS +- +- +-fi +- +-GREP="$ac_cv_path_GREP" +-if test -z "$GREP"; then +- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} +- { (exit 1); exit 1; }; } +-fi +- ++ if test -z "$ac_cv_path_GREP"; then ++ as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ fi + else + ac_cv_path_GREP=$GREP + fi + +- + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +-echo "${ECHO_T}$ac_cv_path_GREP" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 ++$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +-{ echo "$as_me:$LINENO: checking for egrep" >&5 +-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +-if test "${ac_cv_path_EGREP+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 ++$as_echo_n "checking for egrep... " >&6; } ++if test "${ac_cv_path_EGREP+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else +- # Extract the first word of "egrep" to use in msg output +-if test -z "$EGREP"; then +-set dummy egrep; ac_prog_name=$2 +-if test "${ac_cv_path_EGREP+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else ++ if test -z "$EGREP"; then + ac_path_EGREP_found=false +-# Loop through the user's path and test for each of PROGNAME-LIST +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++ # Loop through the user's path and test for each of PROGNAME-LIST ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_prog in egrep; do +- for ac_exec_ext in '' $ac_executable_extensions; do +- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" +- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +- # Check for GNU ac_path_EGREP and select it if it is found. ++ for ac_prog in egrep; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" ++ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue ++# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP + case `"$ac_path_EGREP" --version 2>&1` in + *GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; + *) + ac_count=0 +- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" ++ $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" +- echo 'EGREP' >> "conftest.nl" ++ $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break +- ac_count=`expr $ac_count + 1` ++ as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" +@@ -3759,78 +3915,62 @@ + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; + esac + +- +- $ac_path_EGREP_found && break 3 ++ $ac_path_EGREP_found && break 3 ++ done ++ done + done +-done +- +-done + IFS=$as_save_IFS +- +- +-fi +- +-EGREP="$ac_cv_path_EGREP" +-if test -z "$EGREP"; then +- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} +- { (exit 1); exit 1; }; } +-fi +- ++ if test -z "$ac_cv_path_EGREP"; then ++ as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ fi + else + ac_cv_path_EGREP=$EGREP + fi + +- + fi + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 ++$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +-{ echo "$as_me:$LINENO: checking for fgrep" >&5 +-echo $ECHO_N "checking for fgrep... $ECHO_C" >&6; } +-if test "${ac_cv_path_FGREP+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 ++$as_echo_n "checking for fgrep... " >&6; } ++if test "${ac_cv_path_FGREP+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else +- # Extract the first word of "fgrep" to use in msg output +-if test -z "$FGREP"; then +-set dummy fgrep; ac_prog_name=$2 +-if test "${ac_cv_path_FGREP+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else ++ if test -z "$FGREP"; then + ac_path_FGREP_found=false +-# Loop through the user's path and test for each of PROGNAME-LIST +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++ # Loop through the user's path and test for each of PROGNAME-LIST ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_prog in fgrep; do +- for ac_exec_ext in '' $ac_executable_extensions; do +- ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" +- { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +- # Check for GNU ac_path_FGREP and select it if it is found. ++ for ac_prog in fgrep; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" ++ { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue ++# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP + case `"$ac_path_FGREP" --version 2>&1` in + *GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; + *) + ac_count=0 +- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" ++ $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" +- echo 'FGREP' >> "conftest.nl" ++ $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break +- ac_count=`expr $ac_count + 1` ++ as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" +@@ -3842,33 +3982,22 @@ + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; + esac + +- +- $ac_path_FGREP_found && break 3 ++ $ac_path_FGREP_found && break 3 ++ done ++ done + done +-done +- +-done + IFS=$as_save_IFS +- +- +-fi +- +-FGREP="$ac_cv_path_FGREP" +-if test -z "$FGREP"; then +- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} +- { (exit 1); exit 1; }; } +-fi +- ++ if test -z "$ac_cv_path_FGREP"; then ++ as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ fi + else + ac_cv_path_FGREP=$FGREP + fi + +- + fi + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 +-echo "${ECHO_T}$ac_cv_path_FGREP" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 ++$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +@@ -3893,7 +4022,7 @@ + + + # Check whether --with-gnu-ld was given. +-if test "${with_gnu_ld+set}" = set; then ++if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes + else + with_gnu_ld=no +@@ -3902,8 +4031,8 @@ + ac_prog=ld + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. +- { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 ++$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw +@@ -3932,14 +4061,14 @@ + ;; + esac + elif test "$with_gnu_ld" = yes; then +- { echo "$as_me:$LINENO: checking for GNU ld" >&5 +-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 ++$as_echo_n "checking for GNU ld... " >&6; } + else +- { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 ++$as_echo_n "checking for non-GNU ld... " >&6; } + fi +-if test "${lt_cv_path_LD+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++if test "${lt_cv_path_LD+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +@@ -3969,19 +4098,17 @@ + + LD="$lt_cv_path_LD" + if test -n "$LD"; then +- { echo "$as_me:$LINENO: result: $LD" >&5 +-echo "${ECHO_T}$LD" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 ++$as_echo "$LD" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi +-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} +- { (exit 1); exit 1; }; } +-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +-if test "${lt_cv_prog_gnu_ld+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 ++$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } ++if test "${lt_cv_prog_gnu_ld+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + # I'd rather use --version here, but apparently some GNU lds only accept -v. + case `$LD -v 2>&1 &5 +-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 ++$as_echo "$lt_cv_prog_gnu_ld" >&6; } + with_gnu_ld=$lt_cv_prog_gnu_ld + + +@@ -4005,10 +4132,10 @@ + + + +-{ echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 +-echo $ECHO_N "checking for BSD- or MS-compatible name lister (nm)... $ECHO_C" >&6; } +-if test "${lt_cv_path_NM+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 ++$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } ++if test "${lt_cv_path_NM+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$NM"; then + # Let the user override the test. +@@ -4054,8 +4181,8 @@ + : ${lt_cv_path_NM=no} + fi + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +-echo "${ECHO_T}$lt_cv_path_NM" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 ++$as_echo "$lt_cv_path_NM" >&6; } + if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" + else +@@ -4065,10 +4192,10 @@ + 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; } +-if test "${ac_cv_prog_DUMPBIN+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_DUMPBIN+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +@@ -4078,25 +4205,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_DUMPBIN="$ac_tool_prefix$ac_prog" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + DUMPBIN=$ac_cv_prog_DUMPBIN + if test -n "$DUMPBIN"; then +- { echo "$as_me:$LINENO: result: $DUMPBIN" >&5 +-echo "${ECHO_T}$DUMPBIN" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 ++$as_echo "$DUMPBIN" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -4109,10 +4236,10 @@ + 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; } +-if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +@@ -4122,25 +4249,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_DUMPBIN="$ac_prog" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN + if test -n "$ac_ct_DUMPBIN"; then +- { echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 +-echo "${ECHO_T}$ac_ct_DUMPBIN" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 ++$as_echo "$ac_ct_DUMPBIN" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -4152,12 +4279,8 @@ + 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:${as_lineno-$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 + DUMPBIN=$ac_ct_DUMPBIN +@@ -4176,45 +4299,45 @@ + + + +-{ echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 +-echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6; } +-if test "${lt_cv_nm_interface+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 ++$as_echo_n "checking the name lister ($NM) interface... " >&6; } ++if test "${lt_cv_nm_interface+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext +- (eval echo "\"\$as_me:4186: $ac_compile\"" >&5) ++ (eval echo "\"\$as_me:4309: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 +- (eval echo "\"\$as_me:4189: $NM \\\"conftest.$ac_objext\\\"\"" >&5) ++ (eval echo "\"\$as_me:4312: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 +- (eval echo "\"\$as_me:4192: output\"" >&5) ++ (eval echo "\"\$as_me:4315: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 +-echo "${ECHO_T}$lt_cv_nm_interface" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 ++$as_echo "$lt_cv_nm_interface" >&6; } + +-{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 +-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 ++$as_echo_n "checking whether ln -s works... " >&6; } + LN_S=$as_ln_s + if test "$LN_S" = "ln -s"; then +- { echo "$as_me:$LINENO: result: yes" >&5 +-echo "${ECHO_T}yes" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } + else +- { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +-echo "${ECHO_T}no, using $LN_S" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 ++$as_echo "no, using $LN_S" >&6; } + fi + + # find the maximum length of command line arguments +-{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +-echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } +-if test "${lt_cv_sys_max_cmd_len+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 ++$as_echo_n "checking the maximum length of command line arguments... " >&6; } ++if test "${lt_cv_sys_max_cmd_len+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + i=0 + teststring="ABCD" +@@ -4235,7 +4358,7 @@ + lt_cv_sys_max_cmd_len=-1; + ;; + +- cygwin* | mingw*) ++ cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, +@@ -4331,11 +4454,11 @@ + fi + + if test -n $lt_cv_sys_max_cmd_len ; then +- { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +-echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 ++$as_echo "$lt_cv_sys_max_cmd_len" >&6; } + else +- { echo "$as_me:$LINENO: result: none" >&5 +-echo "${ECHO_T}none" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 ++$as_echo "none" >&6; } + fi + max_cmd_len=$lt_cv_sys_max_cmd_len + +@@ -4348,8 +4471,8 @@ + : ${MV="mv -f"} + : ${RM="rm -f"} + +-{ echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 +-echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 ++$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } + # Try some XSI features + xsi_shell=no + ( _lt_dummy="a/b/c" +@@ -4358,18 +4481,18 @@ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +-{ echo "$as_me:$LINENO: result: $xsi_shell" >&5 +-echo "${ECHO_T}$xsi_shell" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 ++$as_echo "$xsi_shell" >&6; } + + +-{ echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 +-echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 ++$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } + lt_shell_append=no + ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +-{ echo "$as_me:$LINENO: result: $lt_shell_append" >&5 +-echo "${ECHO_T}$lt_shell_append" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 ++$as_echo "$lt_shell_append" >&6; } + + + if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +@@ -4403,31 +4526,132 @@ + + + +-{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +-echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } +-if test "${lt_cv_ld_reload_flag+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 ++$as_echo_n "checking for $LD option to reload object files... " >&6; } ++if test "${lt_cv_ld_reload_flag+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_ld_reload_flag='-r' ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 ++$as_echo "$lt_cv_ld_reload_flag" >&6; } ++reload_flag=$lt_cv_ld_reload_flag ++case $reload_flag in ++"" | " "*) ;; ++*) reload_flag=" $reload_flag" ;; ++esac ++reload_cmds='$LD$reload_flag -o $output$reload_objs' ++case $host_os in ++ darwin*) ++ if test "$GCC" = yes; then ++ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' ++ else ++ reload_cmds='$LD$reload_flag -o $output$reload_objs' ++ fi ++ ;; ++esac ++ ++ ++ ++ ++ ++ ++ ++ ++ ++if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. ++set dummy ${ac_tool_prefix}objdump; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_OBJDUMP+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$OBJDUMP"; then ++ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ 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_OBJDUMP="${ac_tool_prefix}objdump" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++OBJDUMP=$ac_cv_prog_OBJDUMP ++if test -n "$OBJDUMP"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 ++$as_echo "$OBJDUMP" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_OBJDUMP"; then ++ ac_ct_OBJDUMP=$OBJDUMP ++ # Extract the first word of "objdump", so it can be a program name with args. ++set dummy objdump; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_OBJDUMP"; then ++ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ 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_OBJDUMP="objdump" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP ++if test -n "$ac_ct_OBJDUMP"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 ++$as_echo "$ac_ct_OBJDUMP" >&6; } + else +- lt_cv_ld_reload_flag='-r' ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +-echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } +-reload_flag=$lt_cv_ld_reload_flag +-case $reload_flag in +-"" | " "*) ;; +-*) reload_flag=" $reload_flag" ;; +-esac +-reload_cmds='$LD$reload_flag -o $output$reload_objs' +-case $host_os in +- darwin*) +- if test "$GCC" = yes; then +- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' +- else +- reload_cmds='$LD$reload_flag -o $output$reload_objs' +- fi +- ;; ++ ++ if test "x$ac_ct_OBJDUMP" = x; then ++ OBJDUMP="false" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$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 ++ OBJDUMP=$ac_ct_OBJDUMP ++ fi ++else ++ OBJDUMP="$ac_cv_prog_OBJDUMP" ++fi + ++test -z "$OBJDUMP" && OBJDUMP=objdump + + + +@@ -4437,10 +4661,10 @@ + + + +-{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 +-echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; } +-if test "${lt_cv_deplibs_check_method+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 ++$as_echo_n "checking how to recognize dependent libraries... " >&6; } ++if test "${lt_cv_deplibs_check_method+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + lt_cv_file_magic_cmd='$MAGIC_CMD' + lt_cv_file_magic_test_file= +@@ -4490,6 +4714,12 @@ + fi + ;; + ++cegcc) ++ # use the weaker test based on 'objdump'. See mingw*. ++ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' ++ lt_cv_file_magic_cmd='$OBJDUMP -f' ++ ;; ++ + darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; +@@ -4627,8 +4857,8 @@ + esac + + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +-echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 ++$as_echo "$lt_cv_deplibs_check_method" >&6; } + file_magic_cmd=$lt_cv_file_magic_cmd + deplibs_check_method=$lt_cv_deplibs_check_method + test -z "$deplibs_check_method" && deplibs_check_method=unknown +@@ -4647,10 +4877,10 @@ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. + set dummy ${ac_tool_prefix}ar; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_AR+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_AR+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +@@ -4660,25 +4890,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_AR="${ac_tool_prefix}ar" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + AR=$ac_cv_prog_AR + if test -n "$AR"; then +- { echo "$as_me:$LINENO: result: $AR" >&5 +-echo "${ECHO_T}$AR" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 ++$as_echo "$AR" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -4687,10 +4917,10 @@ + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. + set dummy ar; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +@@ -4700,25 +4930,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_AR="ar" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + ac_ct_AR=$ac_cv_prog_ac_ct_AR + if test -n "$ac_ct_AR"; then +- { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +-echo "${ECHO_T}$ac_ct_AR" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 ++$as_echo "$ac_ct_AR" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + if test "x$ac_ct_AR" = x; then +@@ -4726,12 +4956,8 @@ + 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:${as_lineno-$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 + AR=$ac_ct_AR +@@ -4756,10 +4982,10 @@ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. + set dummy ${ac_tool_prefix}strip; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_STRIP+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_STRIP+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +@@ -4769,25 +4995,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_STRIP="${ac_tool_prefix}strip" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + STRIP=$ac_cv_prog_STRIP + if test -n "$STRIP"; then +- { echo "$as_me:$LINENO: result: $STRIP" >&5 +-echo "${ECHO_T}$STRIP" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 ++$as_echo "$STRIP" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -4796,10 +5022,10 @@ + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. + set dummy strip; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +@@ -4809,25 +5035,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_STRIP="strip" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP + if test -n "$ac_ct_STRIP"; then +- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +-echo "${ECHO_T}$ac_ct_STRIP" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 ++$as_echo "$ac_ct_STRIP" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + if test "x$ac_ct_STRIP" = x; then +@@ -4835,12 +5061,8 @@ + 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:${as_lineno-$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 + STRIP=$ac_ct_STRIP +@@ -4859,10 +5081,10 @@ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. + set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_RANLIB+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_RANLIB+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +@@ -4872,25 +5094,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_RANLIB="${ac_tool_prefix}ranlib" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + RANLIB=$ac_cv_prog_RANLIB + if test -n "$RANLIB"; then +- { echo "$as_me:$LINENO: result: $RANLIB" >&5 +-echo "${ECHO_T}$RANLIB" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 ++$as_echo "$RANLIB" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -4899,10 +5121,10 @@ + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. + set dummy ranlib; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +@@ -4912,25 +5134,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_RANLIB="ranlib" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB + if test -n "$ac_ct_RANLIB"; then +- { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +-echo "${ECHO_T}$ac_ct_RANLIB" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 ++$as_echo "$ac_ct_RANLIB" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + if test "x$ac_ct_RANLIB" = x; then +@@ -4938,12 +5160,8 @@ + 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:${as_lineno-$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 + RANLIB=$ac_ct_RANLIB +@@ -5020,10 +5238,10 @@ + + + # Check for command to grab the raw symbol name followed by C symbol from nm. +-{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +-echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } +-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 ++$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } ++if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + + # These are sane defaults that work on at least a few old systems. +@@ -5040,7 +5258,7 @@ + aix*) + symcode='[BCDT]' + ;; +-cygwin* | mingw* | pw32*) ++cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; + hpux*) +@@ -5138,18 +5356,18 @@ + int main(){nm_test_var='a';nm_test_func();return(0);} + _LT_EOF + +- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm +- if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 ++ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && test -s "$nlist"; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" +@@ -5202,11 +5420,11 @@ + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" +- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && test -s conftest${ac_exeext}; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" +@@ -5240,11 +5458,11 @@ + lt_cv_sys_global_symbol_to_cdecl= + fi + if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then +- { echo "$as_me:$LINENO: result: failed" >&5 +-echo "${ECHO_T}failed" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 ++$as_echo "failed" >&6; } + else +- { echo "$as_me:$LINENO: result: ok" >&5 +-echo "${ECHO_T}ok" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 ++$as_echo "ok" >&6; } + fi + + +@@ -5269,7 +5487,7 @@ + + + # Check whether --enable-libtool-lock was given. +-if test "${enable_libtool_lock+set}" = set; then ++if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; + fi + +@@ -5281,11 +5499,11 @@ + ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext +- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" +@@ -5299,12 +5517,12 @@ + ;; + *-*-irix6*) + # Find out which ABI we are using. +- echo '#line 5302 "configure"' > conftest.$ac_ext +- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ echo '#line 5520 "configure"' > conftest.$ac_ext ++ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) +@@ -5338,11 +5556,11 @@ + s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext +- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in +@@ -5391,10 +5609,10 @@ + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" +- { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +-echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } +-if test "${lt_cv_cc_needs_belf+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 ++$as_echo_n "checking whether the C compiler needs -belf... " >&6; } ++if test "${lt_cv_cc_needs_belf+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' +@@ -5402,11 +5620,7 @@ + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -5417,34 +5631,13 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- lt_cv_cc_needs_belf=no ++ lt_cv_cc_needs_belf=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +@@ -5452,8 +5645,8 @@ + ac_compiler_gnu=$ac_cv_c_compiler_gnu + + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +-echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 ++$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" +@@ -5462,11 +5655,11 @@ + sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext +- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in +@@ -5492,10 +5685,10 @@ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. + set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_DSYMUTIL+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +@@ -5505,25 +5698,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_DSYMUTIL="${ac_tool_prefix}dsymutil" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + DSYMUTIL=$ac_cv_prog_DSYMUTIL + if test -n "$DSYMUTIL"; then +- { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 +-echo "${ECHO_T}$DSYMUTIL" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 ++$as_echo "$DSYMUTIL" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -5532,10 +5725,10 @@ + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. + set dummy dsymutil; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +@@ -5545,25 +5738,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_DSYMUTIL="dsymutil" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL + if test -n "$ac_ct_DSYMUTIL"; then +- { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 +-echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 ++$as_echo "$ac_ct_DSYMUTIL" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + if test "x$ac_ct_DSYMUTIL" = x; then +@@ -5571,12 +5764,8 @@ + 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:${as_lineno-$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 + DSYMUTIL=$ac_ct_DSYMUTIL +@@ -5588,10 +5777,10 @@ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. + set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_NMEDIT+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_NMEDIT+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +@@ -5601,25 +5790,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_NMEDIT="${ac_tool_prefix}nmedit" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + NMEDIT=$ac_cv_prog_NMEDIT + if test -n "$NMEDIT"; then +- { echo "$as_me:$LINENO: result: $NMEDIT" >&5 +-echo "${ECHO_T}$NMEDIT" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 ++$as_echo "$NMEDIT" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -5628,10 +5817,10 @@ + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. + set dummy nmedit; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +@@ -5641,25 +5830,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_NMEDIT="nmedit" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT + if test -n "$ac_ct_NMEDIT"; then +- { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 +-echo "${ECHO_T}$ac_ct_NMEDIT" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 ++$as_echo "$ac_ct_NMEDIT" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + if test "x$ac_ct_NMEDIT" = x; then +@@ -5667,12 +5856,8 @@ + 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:${as_lineno-$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 + NMEDIT=$ac_ct_NMEDIT +@@ -5684,10 +5869,10 @@ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. + set dummy ${ac_tool_prefix}lipo; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_LIPO+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_LIPO+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +@@ -5697,25 +5882,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_LIPO="${ac_tool_prefix}lipo" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + LIPO=$ac_cv_prog_LIPO + if test -n "$LIPO"; then +- { echo "$as_me:$LINENO: result: $LIPO" >&5 +-echo "${ECHO_T}$LIPO" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 ++$as_echo "$LIPO" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -5724,10 +5909,10 @@ + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. + set dummy lipo; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +@@ -5737,25 +5922,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_LIPO="lipo" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO + if test -n "$ac_ct_LIPO"; then +- { echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 +-echo "${ECHO_T}$ac_ct_LIPO" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 ++$as_echo "$ac_ct_LIPO" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + if test "x$ac_ct_LIPO" = x; then +@@ -5763,12 +5948,8 @@ + 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:${as_lineno-$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 + LIPO=$ac_ct_LIPO +@@ -5780,10 +5961,10 @@ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. + set dummy ${ac_tool_prefix}otool; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_OTOOL+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_OTOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +@@ -5793,25 +5974,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_OTOOL="${ac_tool_prefix}otool" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + OTOOL=$ac_cv_prog_OTOOL + if test -n "$OTOOL"; then +- { echo "$as_me:$LINENO: result: $OTOOL" >&5 +-echo "${ECHO_T}$OTOOL" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 ++$as_echo "$OTOOL" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -5820,10 +6001,10 @@ + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. + set dummy otool; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +@@ -5833,25 +6014,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_OTOOL="otool" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL + if test -n "$ac_ct_OTOOL"; then +- { echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 +-echo "${ECHO_T}$ac_ct_OTOOL" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 ++$as_echo "$ac_ct_OTOOL" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + if test "x$ac_ct_OTOOL" = x; then +@@ -5859,12 +6040,8 @@ + 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:${as_lineno-$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 + OTOOL=$ac_ct_OTOOL +@@ -5876,10 +6053,10 @@ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. + set dummy ${ac_tool_prefix}otool64; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_OTOOL64+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_OTOOL64+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +@@ -5889,25 +6066,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_OTOOL64="${ac_tool_prefix}otool64" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + OTOOL64=$ac_cv_prog_OTOOL64 + if test -n "$OTOOL64"; then +- { echo "$as_me:$LINENO: result: $OTOOL64" >&5 +-echo "${ECHO_T}$OTOOL64" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 ++$as_echo "$OTOOL64" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -5916,10 +6093,10 @@ + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. + set dummy otool64; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +@@ -5929,25 +6106,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_OTOOL64="otool64" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 + if test -n "$ac_ct_OTOOL64"; then +- { echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 +-echo "${ECHO_T}$ac_ct_OTOOL64" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 ++$as_echo "$ac_ct_OTOOL64" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + if test "x$ac_ct_OTOOL64" = x; then +@@ -5955,12 +6132,8 @@ + 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:${as_lineno-$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 + OTOOL64=$ac_ct_OTOOL64 +@@ -5995,10 +6168,10 @@ + + + +- { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 +-echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; } +-if test "${lt_cv_apple_cc_single_mod+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 ++$as_echo_n "checking for -single_module linker flag... " >&6; } ++if test "${lt_cv_apple_cc_single_mod+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then +@@ -6022,22 +6195,18 @@ + rm -f conftest.* + fi + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 +-echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; } +- { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 +-echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; } +-if test "${lt_cv_ld_exported_symbols_list+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 ++$as_echo "$lt_cv_apple_cc_single_mod" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 ++$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } ++if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -6048,39 +6217,18 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- lt_cv_ld_exported_symbols_list=no ++ lt_cv_ld_exported_symbols_list=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 +-echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 ++$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; +@@ -6121,15 +6269,15 @@ + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 ++$as_echo_n "checking how to run the C preprocessor... " >&6; } + # On Suns, sometimes $CPP names a directory. + if test -n "$CPP" && test -d "$CPP"; then + CPP= + fi + if test -z "$CPP"; then +- if test "${ac_cv_prog_CPP+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ if test "${ac_cv_prog_CPP+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" +@@ -6143,11 +6291,7 @@ + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #ifdef __STDC__ + # include +@@ -6156,76 +6300,34 @@ + #endif + Syntax error + _ACEOF +-if { (ac_try="$ac_cpp conftest.$ac_ext" +-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_cpp conftest.$ac_ext") 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 +- (exit $ac_status); } >/dev/null && { +- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || +- test ! -s conftest.err +- }; then +- : +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 ++if ac_fn_c_try_cpp "$LINENO"; then : + ++else + # Broken: fails on valid input. + continue + fi +- + rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + _ACEOF +-if { (ac_try="$ac_cpp conftest.$ac_ext" +-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_cpp conftest.$ac_ext") 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 +- (exit $ac_status); } >/dev/null && { +- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || +- test ! -s conftest.err +- }; then ++if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. + continue + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- + # Passes both tests. + ac_preproc_ok=: + break + fi +- + rm -f conftest.err conftest.$ac_ext + + done + # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. + rm -f conftest.err conftest.$ac_ext +-if $ac_preproc_ok; then ++if $ac_preproc_ok; then : + break + fi + +@@ -6237,8 +6339,8 @@ + else + ac_cv_prog_CPP=$CPP + fi +-{ echo "$as_me:$LINENO: result: $CPP" >&5 +-echo "${ECHO_T}$CPP" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 ++$as_echo "$CPP" >&6; } + ac_preproc_ok=false + for ac_c_preproc_warn_flag in '' yes + do +@@ -6248,11 +6350,7 @@ + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #ifdef __STDC__ + # include +@@ -6261,83 +6359,40 @@ + #endif + Syntax error + _ACEOF +-if { (ac_try="$ac_cpp conftest.$ac_ext" +-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_cpp conftest.$ac_ext") 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 +- (exit $ac_status); } >/dev/null && { +- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || +- test ! -s conftest.err +- }; then +- : +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 ++if ac_fn_c_try_cpp "$LINENO"; then : + ++else + # Broken: fails on valid input. + continue + fi +- + rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + _ACEOF +-if { (ac_try="$ac_cpp conftest.$ac_ext" +-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_cpp conftest.$ac_ext") 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 +- (exit $ac_status); } >/dev/null && { +- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || +- test ! -s conftest.err +- }; then ++if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. + continue + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- + # Passes both tests. + ac_preproc_ok=: + break + fi +- + rm -f conftest.err conftest.$ac_ext + + done + # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. + rm -f conftest.err conftest.$ac_ext +-if $ac_preproc_ok; then +- : ++if $ac_preproc_ok; then : ++ + else +- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +-See \`config.log' for more details." >&5 +-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error "C preprocessor \"$CPP\" fails sanity check ++See \`config.log' for more details." "$LINENO" 5; } + fi + + ac_ext=c +@@ -6347,16 +6402,12 @@ + ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +-if test "${ac_cv_header_stdc+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 ++$as_echo_n "checking for ANSI C header files... " >&6; } ++if test "${ac_cv_header_stdc+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + #include +@@ -6371,47 +6422,23 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then ++if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_header_stdc=no ++ ac_cv_header_stdc=no + fi +- + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + + _ACEOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- $EGREP "memchr" >/dev/null 2>&1; then +- : ++ $EGREP "memchr" >/dev/null 2>&1; then : ++ + else + ac_cv_header_stdc=no + fi +@@ -6421,18 +6448,14 @@ + + if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + + _ACEOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- $EGREP "free" >/dev/null 2>&1; then +- : ++ $EGREP "free" >/dev/null 2>&1; then : ++ + else + ac_cv_header_stdc=no + fi +@@ -6442,14 +6465,10 @@ + + if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +- if test "$cross_compiling" = yes; then ++ if test "$cross_compiling" = yes; then : + : + else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + #include +@@ -6476,113 +6495,36 @@ + return 0; + } + _ACEOF +-rm -f 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_link") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- : +-else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 ++if ac_fn_c_try_run "$LINENO"; then : + +-( exit $ac_status ) +-ac_cv_header_stdc=no ++else ++ ac_cv_header_stdc=no + fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + +- + fi + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +-echo "${ECHO_T}$ac_cv_header_stdc" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 ++$as_echo "$ac_cv_header_stdc" >&6; } + if test $ac_cv_header_stdc = yes; then + +-cat >>confdefs.h <<\_ACEOF +-#define STDC_HEADERS 1 +-_ACEOF ++$as_echo "#define STDC_HEADERS 1" >>confdefs.h + + fi + + # On IRIX 5.3, sys/types and inttypes.h are conflicting. +- +- +- +- +- +- +- +- +- + for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +-do +-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +-{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-$ac_includes_default +- +-#include <$ac_header> +-_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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then +- eval "$as_ac_Header=yes" +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- eval "$as_ac_Header=no" +-fi +- +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-fi +-ac_res=`eval echo '${'$as_ac_Header'}'` +- { echo "$as_me:$LINENO: result: $ac_res" >&5 +-echo "${ECHO_T}$ac_res" >&6; } +-if test `eval echo '${'$as_ac_Header'}'` = yes; then ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default ++" ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + _ACEOF + + fi +@@ -6590,58 +6532,13 @@ + done + + +- + for ac_header in dlfcn.h +-do +-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +-{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-$ac_includes_default +- +-#include <$ac_header> +-_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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then +- eval "$as_ac_Header=yes" +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- eval "$as_ac_Header=no" +-fi +- +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-fi +-ac_res=`eval echo '${'$as_ac_Header'}'` +- { echo "$as_me:$LINENO: result: $ac_res" >&5 +-echo "${ECHO_T}$ac_res" >&6; } +-if test `eval echo '${'$as_ac_Header'}'` = yes; then ++do : ++ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default ++" ++if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++#define HAVE_DLFCN_H 1 + _ACEOF + + fi +@@ -6661,7 +6558,7 @@ + + + # Check whether --enable-shared was given. +-if test "${enable_shared+set}" = set; then ++if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; +@@ -6692,7 +6589,7 @@ + + + # Check whether --enable-static was given. +-if test "${enable_static+set}" = set; then ++if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; +@@ -6724,7 +6621,7 @@ + + + # Check whether --with-pic was given. +-if test "${with_pic+set}" = set; then ++if test "${with_pic+set}" = set; then : + withval=$with_pic; pic_mode="$withval" + else + pic_mode=default +@@ -6740,7 +6637,7 @@ + + + # Check whether --enable-fast-install was given. +-if test "${enable_fast_install+set}" = set; then ++if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; +@@ -6821,10 +6718,10 @@ + setopt NO_GLOB_SUBST + fi + +-{ echo "$as_me:$LINENO: checking for objdir" >&5 +-echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } +-if test "${lt_cv_objdir+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 ++$as_echo_n "checking for objdir... " >&6; } ++if test "${lt_cv_objdir+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + rm -f .libs 2>/dev/null + mkdir .libs 2>/dev/null +@@ -6836,8 +6733,8 @@ + fi + rmdir .libs 2>/dev/null + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +-echo "${ECHO_T}$lt_cv_objdir" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 ++$as_echo "$lt_cv_objdir" >&6; } + objdir=$lt_cv_objdir + + +@@ -6929,10 +6826,10 @@ + case $deplibs_check_method in + file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then +- { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +-echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } +-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 ++$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } ++if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + case $MAGIC_CMD in + [\\/*] | ?:[\\/]*) +@@ -6982,11 +6879,11 @@ + + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if test -n "$MAGIC_CMD"; then +- { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +-echo "${ECHO_T}$MAGIC_CMD" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 ++$as_echo "$MAGIC_CMD" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -6995,10 +6892,10 @@ + + if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then +- { echo "$as_me:$LINENO: checking for file" >&5 +-echo $ECHO_N "checking for file... $ECHO_C" >&6; } +-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 ++$as_echo_n "checking for file... " >&6; } ++if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + case $MAGIC_CMD in + [\\/*] | ?:[\\/]*) +@@ -7048,11 +6945,11 @@ + + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if test -n "$MAGIC_CMD"; then +- { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +-echo "${ECHO_T}$MAGIC_CMD" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 ++$as_echo "$MAGIC_CMD" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -7128,10 +7025,10 @@ + if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + +- { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 ++$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } ++if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext +@@ -7146,11 +7043,11 @@ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:7149: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:7046: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 +- echo "$as_me:7153: \$? = $ac_status" >&5 ++ echo "$as_me:7050: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. +@@ -7163,8 +7060,8 @@ + $RM conftest* + + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 ++$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + + if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +@@ -7183,8 +7080,8 @@ + lt_prog_compiler_pic= + lt_prog_compiler_static= + +-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 ++$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' +@@ -7218,7 +7115,7 @@ + # PIC is the default for these OSes. + ;; + +- mingw* | cygwin* | pw32* | os2*) ++ mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style +@@ -7233,10 +7130,11 @@ + ;; + + hpux*) +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. ++ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit ++ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag ++ # sets the default TLS model and affects inlining. + case $host_cpu in +- hppa*64*|ia64*) ++ hppa*64*) + # +Z the default + ;; + *) +@@ -7286,7 +7184,7 @@ + fi + ;; + +- mingw* | cygwin* | pw32* | os2*) ++ mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' +@@ -7316,11 +7214,25 @@ + + linux* | k*bsd*-gnu) + case $cc_basename in +- icc* | ecc* | ifort*) ++ # old Intel for x86_64 which still supported -KPIC. ++ ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; ++ # icc used to be incompatible with GCC. ++ # ICC 10 doesn't accept -KPIC any more. ++ icc* | ifort*) ++ lt_prog_compiler_wl='-Wl,' ++ lt_prog_compiler_pic='-fPIC' ++ lt_prog_compiler_static='-static' ++ ;; ++ # Lahey Fortran 8.1. ++ lf95*) ++ lt_prog_compiler_wl='-Wl,' ++ lt_prog_compiler_pic='--shared' ++ lt_prog_compiler_static='--static' ++ ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) +@@ -7440,8 +7352,8 @@ + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; + esac +-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +-echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 ++$as_echo "$lt_prog_compiler_pic" >&6; } + + + +@@ -7452,10 +7364,10 @@ + # Check to make sure the PIC flag actually works. + # + if test -n "$lt_prog_compiler_pic"; then +- { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } +-if test "${lt_cv_prog_compiler_pic_works+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 ++$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } ++if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext +@@ -7470,11 +7382,11 @@ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:7473: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:7385: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 +- echo "$as_me:7477: \$? = $ac_status" >&5 ++ echo "$as_me:7389: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. +@@ -7487,8 +7399,8 @@ + $RM conftest* + + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 +-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 ++$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + + if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in +@@ -7511,10 +7423,10 @@ + # Check to make sure the static flag actually works. + # + wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +-if test "${lt_cv_prog_compiler_static_works+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 ++$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } ++if test "${lt_cv_prog_compiler_static_works+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" +@@ -7539,8 +7451,8 @@ + LDFLAGS="$save_LDFLAGS" + + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 +-echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 ++$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + + if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +@@ -7554,10 +7466,10 @@ + + + +- { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +-if test "${lt_cv_prog_compiler_c_o+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 ++$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } ++if test "${lt_cv_prog_compiler_c_o+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null +@@ -7575,11 +7487,11 @@ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:7578: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:7490: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 +- echo "$as_me:7582: \$? = $ac_status" >&5 ++ echo "$as_me:7494: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized +@@ -7601,18 +7513,18 @@ + $RM conftest* + + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +-echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 ++$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + +- { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +-if test "${lt_cv_prog_compiler_c_o+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 ++$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } ++if test "${lt_cv_prog_compiler_c_o+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null +@@ -7630,11 +7542,11 @@ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:7633: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:7545: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 +- echo "$as_me:7637: \$? = $ac_status" >&5 ++ echo "$as_me:7549: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized +@@ -7656,8 +7568,8 @@ + $RM conftest* + + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +-echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 ++$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + +@@ -7665,19 +7577,19 @@ + hard_links="nottested" + if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user +- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 ++$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no +- { echo "$as_me:$LINENO: result: $hard_links" >&5 +-echo "${ECHO_T}$hard_links" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 ++$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then +- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 ++$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi + else +@@ -7689,8 +7601,8 @@ + + + +- { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 ++$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= +@@ -7734,7 +7646,7 @@ + extract_expsyms_cmds= + + case $host_os in +- cygwin* | mingw* | pw32*) ++ cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. +@@ -7749,6 +7661,9 @@ + openbsd*) + with_gnu_ld=no + ;; ++ linux* | k*bsd*-gnu) ++ link_all_deplibs=no ++ ;; + esac + + ld_shlibs=yes +@@ -7821,7 +7736,7 @@ + fi + ;; + +- cygwin* | mingw* | pw32*) ++ cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' +@@ -7887,6 +7802,9 @@ + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; ++ lf95*) # Lahey Fortran 8.1 ++ whole_archive_flag_spec= ++ tmp_sharedflag='--shared' ;; + xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; +@@ -8119,6 +8037,7 @@ + fi + fi + ++ export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes +@@ -8128,11 +8047,7 @@ + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -8143,24 +8058,7 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { +@@ -8174,15 +8072,9 @@ + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" +@@ -8195,11 +8087,7 @@ + else + # Determine the default libpath from the value encoded in an + # empty executable. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -8210,24 +8098,7 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { +@@ -8241,15 +8112,9 @@ + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" +@@ -8285,7 +8150,7 @@ + export_dynamic_flag_spec=-rdynamic + ;; + +- cygwin* | mingw* | pw32*) ++ cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is +@@ -8316,7 +8181,11 @@ + whole_archive_flag_spec='' + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" +- if test "$GCC" = "yes"; then ++ case $cc_basename in ++ ifort*) _lt_dar_can_shared=yes ;; ++ *) _lt_dar_can_shared=$GCC ;; ++ esac ++ if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" +@@ -8408,7 +8277,7 @@ + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) +- archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +@@ -8457,38 +8326,16 @@ + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" +- cat >conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ + int foo(void) {} + _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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' +@@ -8744,8 +8591,8 @@ + fi + fi + +-{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +-echo "${ECHO_T}$ld_shlibs" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 ++$as_echo "$ld_shlibs" >&6; } + test "$ld_shlibs" = no && can_build_shared=no + + with_gnu_ld=$with_gnu_ld +@@ -8781,16 +8628,16 @@ + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. +- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 ++$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + +- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } 2>conftest.err; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext +@@ -8804,11 +8651,11 @@ + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= +- if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 ++ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } + then + archive_cmds_need_lc=no + else +@@ -8819,8 +8666,8 @@ + cat conftest.err 1>&5 + fi + $RM conftest* +- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +-echo "${ECHO_T}$archive_cmds_need_lc" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 ++$as_echo "$archive_cmds_need_lc" >&6; } + ;; + esac + fi +@@ -8983,8 +8830,8 @@ + + + +- { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 ++$as_echo_n "checking dynamic linker characteristics... " >&6; } + + if test "$GCC" = yes; then + case $host_os in +@@ -9146,14 +8993,14 @@ + # libtool to hard-code these into programs + ;; + +-cygwin* | mingw* | pw32*) ++cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32*) ++ yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ +@@ -9176,7 +9023,7 @@ + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; +- mingw*) ++ mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` +@@ -9405,11 +9252,7 @@ + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -9420,37 +9263,13 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 +- if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then ++if ac_fn_c_try_link "$LINENO"; then : ++ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + shlibpath_overrides_runpath=yes + fi +- +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +@@ -9657,7 +9476,7 @@ + version_type=linux + need_lib_prefix=no + need_version=no +- library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes +@@ -9674,8 +9493,8 @@ + dynamic_linker=no + ;; + esac +-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +-echo "${ECHO_T}$dynamic_linker" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 ++$as_echo "$dynamic_linker" >&6; } + test "$dynamic_linker" = no && can_build_shared=no + + variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +@@ -9776,8 +9595,8 @@ + + + +- { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 ++$as_echo_n "checking how to hardcode library paths into programs... " >&6; } + hardcode_action= + if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || +@@ -9801,8 +9620,8 @@ + # directories. + hardcode_action=unsupported + fi +-{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 +-echo "${ECHO_T}$hardcode_action" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 ++$as_echo "$hardcode_action" >&6; } + + if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then +@@ -9834,7 +9653,7 @@ + lt_cv_dlopen_self=yes + ;; + +- mingw* | pw32*) ++ mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; +@@ -9846,18 +9665,14 @@ + + darwin*) + # if libdl is installed we need to link against it +- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +-if test "${ac_cv_lib_dl_dlopen+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 ++$as_echo_n "checking for dlopen in -ldl... " >&6; } ++if test "${ac_cv_lib_dl_dlopen+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-ldl $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -9875,39 +9690,18 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_dl_dlopen=no ++ ac_cv_lib_dl_dlopen=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +-if test $ac_cv_lib_dl_dlopen = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 ++$as_echo "$ac_cv_lib_dl_dlopen" >&6; } ++if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" + else + +@@ -9920,102 +9714,18 @@ + ;; + + *) +- { echo "$as_me:$LINENO: checking for shl_load" >&5 +-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } +-if test "${ac_cv_func_shl_load+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-/* Define shl_load to an innocuous variant, in case declares shl_load. +- For example, HP-UX 11i declares gettimeofday. */ +-#define shl_load innocuous_shl_load +- +-/* System header to define __stub macros and hopefully few prototypes, +- which can conflict with char shl_load (); below. +- Prefer to if __STDC__ is defined, since +- exists even on freestanding compilers. */ +- +-#ifdef __STDC__ +-# include +-#else +-# include +-#endif +- +-#undef shl_load +- +-/* Override any GCC internal prototype to avoid an error. +- Use char because int might match the return type of a GCC +- builtin and then its argument prototype would still apply. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-char shl_load (); +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined __stub_shl_load || defined __stub___shl_load +-choke me +-#endif +- +-int +-main () +-{ +-return shl_load (); +- ; +- 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 "echo \"\$as_me:$LINENO: $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 +- (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 +- ac_cv_func_shl_load=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_func_shl_load=no +-fi +- +-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_shl_load" >&5 +-echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } +-if test $ac_cv_func_shl_load = yes; then ++ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" ++if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" + else +- { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } +-if test "${ac_cv_lib_dld_shl_load+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 ++$as_echo_n "checking for shl_load in -ldld... " >&6; } ++if test "${ac_cv_lib_dld_shl_load+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-ldld $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -10033,137 +9743,32 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_dld_shl_load=no ++ ac_cv_lib_dld_shl_load=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } +-if test $ac_cv_lib_dld_shl_load = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 ++$as_echo "$ac_cv_lib_dld_shl_load" >&6; } ++if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" + else +- { echo "$as_me:$LINENO: checking for dlopen" >&5 +-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } +-if test "${ac_cv_func_dlopen+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-/* Define dlopen to an innocuous variant, in case declares dlopen. +- For example, HP-UX 11i declares gettimeofday. */ +-#define dlopen innocuous_dlopen +- +-/* System header to define __stub macros and hopefully few prototypes, +- which can conflict with char dlopen (); below. +- Prefer to if __STDC__ is defined, since +- exists even on freestanding compilers. */ +- +-#ifdef __STDC__ +-# include +-#else +-# include +-#endif +- +-#undef dlopen +- +-/* Override any GCC internal prototype to avoid an error. +- Use char because int might match the return type of a GCC +- builtin and then its argument prototype would still apply. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-char dlopen (); +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined __stub_dlopen || defined __stub___dlopen +-choke me +-#endif +- +-int +-main () +-{ +-return dlopen (); +- ; +- 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 "echo \"\$as_me:$LINENO: $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 +- (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 +- ac_cv_func_dlopen=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_func_dlopen=no +-fi +- +-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_dlopen" >&5 +-echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } +-if test $ac_cv_func_dlopen = yes; then ++ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" ++if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" + else +- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +-if test "${ac_cv_lib_dl_dlopen+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 ++$as_echo_n "checking for dlopen in -ldl... " >&6; } ++if test "${ac_cv_lib_dl_dlopen+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-ldl $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -10181,53 +9786,28 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_dl_dlopen=no ++ ac_cv_lib_dl_dlopen=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +-if test $ac_cv_lib_dl_dlopen = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 ++$as_echo "$ac_cv_lib_dl_dlopen" >&6; } ++if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" + else +- { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } +-if test "${ac_cv_lib_svld_dlopen+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 ++$as_echo_n "checking for dlopen in -lsvld... " >&6; } ++if test "${ac_cv_lib_svld_dlopen+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lsvld $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -10245,53 +9825,28 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_svld_dlopen=no ++ ac_cv_lib_svld_dlopen=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } +-if test $ac_cv_lib_svld_dlopen = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 ++$as_echo "$ac_cv_lib_svld_dlopen" >&6; } ++if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" + else +- { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } +-if test "${ac_cv_lib_dld_dld_link+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 ++$as_echo_n "checking for dld_link in -ldld... " >&6; } ++if test "${ac_cv_lib_dld_dld_link+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-ldld $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -10309,39 +9864,18 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_dld_dld_link=no ++ ac_cv_lib_dld_dld_link=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } +-if test $ac_cv_lib_dld_dld_link = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 ++$as_echo "$ac_cv_lib_dld_dld_link" >&6; } ++if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" + fi + +@@ -10380,10 +9914,10 @@ + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + +- { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } +-if test "${lt_cv_dlopen_self+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 ++$as_echo_n "checking whether a program can dlopen itself... " >&6; } ++if test "${lt_cv_dlopen_self+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +@@ -10391,7 +9925,7 @@ + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10394 "configure" ++#line 9928 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -10432,10 +9966,6 @@ + # endif + #endif + +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif +- + void fnord() { int i=42;} + int main () + { +@@ -10451,14 +9981,14 @@ + else + puts (dlerror ()); + +- exit (status); ++ return status; + } + _LT_EOF +- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in +@@ -10475,15 +10005,15 @@ + + + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +-echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 ++$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" +- { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } +-if test "${lt_cv_dlopen_self_static+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 ++$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } ++if test "${lt_cv_dlopen_self_static+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +@@ -10491,7 +10021,7 @@ + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10494 "configure" ++#line 10024 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -10532,10 +10062,6 @@ + # endif + #endif + +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif +- + void fnord() { int i=42;} + int main () + { +@@ -10551,14 +10077,14 @@ + else + puts (dlerror ()); + +- exit (status); ++ return status; + } + _LT_EOF +- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in +@@ -10575,8 +10101,8 @@ + + + fi +-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 ++$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" +@@ -10614,13 +10140,13 @@ + + striplib= + old_striplib= +-{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 ++$as_echo_n "checking whether stripping libraries is possible... " >&6; } + if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" +- { echo "$as_me:$LINENO: result: yes" >&5 +-echo "${ECHO_T}yes" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } + else + # FIXME - insert some real tests, host_os isn't really good enough + case $host_os in +@@ -10628,16 +10154,16 @@ + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" +- { echo "$as_me:$LINENO: result: yes" >&5 +-echo "${ECHO_T}yes" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + ;; + *) +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + ;; + esac + fi +@@ -10654,13 +10180,13 @@ + + + # Report which library types will actually be built +- { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } +- { echo "$as_me:$LINENO: result: $can_build_shared" >&5 +-echo "${ECHO_T}$can_build_shared" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 ++$as_echo_n "checking if libtool supports shared libraries... " >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 ++$as_echo "$can_build_shared" >&6; } + +- { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 ++$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and +@@ -10680,15 +10206,15 @@ + fi + ;; + esac +- { echo "$as_me:$LINENO: result: $enable_shared" >&5 +-echo "${ECHO_T}$enable_shared" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 ++$as_echo "$enable_shared" >&6; } + +- { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 ++$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes +- { echo "$as_me:$LINENO: result: $enable_static" >&5 +-echo "${ECHO_T}$enable_static" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 ++$as_echo "$enable_static" >&6; } + + + +@@ -10735,22 +10261,23 @@ + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # OS/2's system install, which has a completely different semantic + # ./install, which can be erroneously created by make from ./install.sh. +-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } ++# Reject install programs that cannot install multiple files. ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 ++$as_echo_n "checking for a BSD-compatible install... " >&6; } + if test -z "$INSTALL"; then +-if test "${ac_cv_path_install+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++if test "${ac_cv_path_install+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- # Account for people who put trailing slashes in PATH elements. +-case $as_dir/ in +- ./ | .// | /cC/* | \ ++ # Account for people who put trailing slashes in PATH elements. ++case $as_dir/ in #(( ++ ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ +- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ ++ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. +@@ -10768,17 +10295,29 @@ + # program-specific install script used by HP pwplus--don't use. + : + else +- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" +- break 3 ++ rm -rf conftest.one conftest.two conftest.dir ++ echo one > conftest.one ++ echo two > conftest.two ++ mkdir conftest.dir ++ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && ++ test -s conftest.one && test -s conftest.two && ++ test -s conftest.dir/conftest.one && ++ test -s conftest.dir/conftest.two ++ then ++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" ++ break 3 ++ fi + fi + fi + done + done + ;; + esac +-done ++ ++ done + IFS=$as_save_IFS + ++rm -rf conftest.one conftest.two conftest.dir + + fi + if test "${ac_cv_path_install+set}" = set; then +@@ -10791,8 +10330,8 @@ + INSTALL=$ac_install_sh + fi + fi +-{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +-echo "${ECHO_T}$INSTALL" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 ++$as_echo "$INSTALL" >&6; } + + # Use test -z because SunOS4 sh mishandles braces in ${var-val}. + # It thinks the first close brace ends the variable substitution. +@@ -10804,264 +10343,244 @@ + + + # Checks for endianess +-{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +-echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } +-if test "${ac_cv_c_bigendian+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- # See if sys/param.h defines the BYTE_ORDER macro. +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 ++$as_echo_n "checking whether byte ordering is bigendian... " >&6; } ++if test "${ac_cv_c_bigendian+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_cv_c_bigendian=unknown ++ # See if we're dealing with a universal compiler. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#ifndef __APPLE_CC__ ++ not a universal capable compiler ++ #endif ++ typedef int dummy; ++ ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ++ # Check for potential -arch flags. It is not universal unless ++ # there are at least two -arch flags with different values. ++ ac_arch= ++ ac_prev= ++ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do ++ if test -n "$ac_prev"; then ++ case $ac_word in ++ i?86 | x86_64 | ppc | ppc64) ++ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ++ ac_arch=$ac_word ++ else ++ ac_cv_c_bigendian=universal ++ break ++ fi ++ ;; ++ esac ++ ac_prev= ++ elif test "x$ac_word" = "x-arch"; then ++ ac_prev=arch ++ fi ++ done ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ if test $ac_cv_c_bigendian = unknown; then ++ # See if sys/param.h defines the BYTE_ORDER macro. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include +-#include ++ #include + + int + main () + { +-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ +- && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) +- bogus endian macros +-#endif ++#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ ++ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ ++ && LITTLE_ENDIAN) ++ bogus endian macros ++ #endif + + ; + 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then ++if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include +-#include ++ #include + + int + main () + { + #if BYTE_ORDER != BIG_ENDIAN +- not big endian +-#endif ++ not big endian ++ #endif + + ; + 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then ++if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_c_bigendian=no ++ ac_cv_c_bigendian=no + fi +- + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ fi ++ if test $ac_cv_c_bigendian = unknown; then ++ # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include + +- # It does not; compile a test program. +-if test "$cross_compiling" = yes; then +- # try to guess the endianness by grepping values into an object file +- ac_cv_c_bigendian=unknown +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ ++int ++main () ++{ ++#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) ++ bogus endian macros ++ #endif ++ ++ ; ++ return 0; ++} + _ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ # It does; now see whether it defined to _BIG_ENDIAN or not. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +-short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +-void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +-short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +-short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +-void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } ++#include ++ + int + main () + { +- _ascii (); _ebcdic (); ++#ifndef _BIG_ENDIAN ++ not big endian ++ #endif ++ + ; + 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then +- if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ++if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes ++else ++ ac_cv_c_bigendian=no + fi +-if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then +- if test "$ac_cv_c_bigendian" = unknown; then +- ac_cv_c_bigendian=no +- else +- # finding both strings is unlikely to happen, but who knows? +- ac_cv_c_bigendian=unknown +- fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ fi ++ if test $ac_cv_c_bigendian = unknown; then ++ # Compile a test program. ++ if test "$cross_compiling" = yes; then : ++ # Try to guess by grepping values from an object file. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++short int ascii_mm[] = ++ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; ++ short int ascii_ii[] = ++ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; ++ int use_ascii (int i) { ++ return ascii_mm[i] + ascii_ii[i]; ++ } ++ short int ebcdic_ii[] = ++ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; ++ short int ebcdic_mm[] = ++ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; ++ int use_ebcdic (int i) { ++ return ebcdic_mm[i] + ebcdic_ii[i]; ++ } ++ extern int foo; + ++int ++main () ++{ ++return use_ascii (foo) == use_ebcdic (foo); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ++ ac_cv_c_bigendian=yes ++ fi ++ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then ++ if test "$ac_cv_c_bigendian" = unknown; then ++ ac_cv_c_bigendian=no ++ else ++ # finding both strings is unlikely to happen, but who knows? ++ ac_cv_c_bigendian=unknown ++ fi ++ fi + fi +- + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + $ac_includes_default + int + main () + { + +- /* Are we little or big endian? From Harbison&Steele. */ +- union +- { +- long int l; +- char c[sizeof (long int)]; +- } u; +- u.l = 1; +- return u.c[sizeof (long int) - 1] == 1; ++ /* Are we little or big endian? From Harbison&Steele. */ ++ union ++ { ++ long int l; ++ char c[sizeof (long int)]; ++ } u; ++ u.l = 1; ++ return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; + } + _ACEOF +-rm -f 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_link") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then ++if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no + else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-ac_cv_c_bigendian=yes ++ ac_cv_c_bigendian=yes + fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + +- ++ fi + fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 ++$as_echo "$ac_cv_c_bigendian" >&6; } ++ case $ac_cv_c_bigendian in #( ++ yes) ++ $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ++;; #( ++ no) ++ ;; #( ++ universal) + +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-fi +-{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +-echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } +-case $ac_cv_c_bigendian in +- yes) ++$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + +-cat >>confdefs.h <<\_ACEOF +-#define WORDS_BIGENDIAN 1 +-_ACEOF +- ;; +- no) +- ;; +- *) +- { { echo "$as_me:$LINENO: error: unknown endianness +-presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +-echo "$as_me: error: unknown endianness +-presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} +- { (exit 1); exit 1; }; } ;; +-esac ++ ;; #( ++ *) ++ as_fn_error "unknown endianness ++ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; ++ esac + + + case $host in + *-*-linux*) + +-cat >>confdefs.h <<\_ACEOF +-#define LINUX 1 +-_ACEOF ++$as_echo "#define LINUX 1" >>confdefs.h + + CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199506L" ;; + *-*-darwin*) +-cat >>confdefs.h <<\_ACEOF +-#define FREEBSD 1 +-_ACEOF ++$as_echo "#define FREEBSD 1" >>confdefs.h + ;; + *-*-freebsd*) +-cat >>confdefs.h <<\_ACEOF +-#define FREEBSD 1 +-_ACEOF ++$as_echo "#define FREEBSD 1" >>confdefs.h + ;; +-*) { { echo "$as_me:$LINENO: error: Linux, FreeBSD, Darwin only, dude!" >&5 +-echo "$as_me: error: Linux, FreeBSD, Darwin only, dude!" >&2;} +- { (exit 1); exit 1; }; };; ++*) as_fn_error "Linux, FreeBSD, Darwin only, dude!" "$LINENO" 5;; + esac + + # Global definitions +@@ -11073,125 +10592,25 @@ + CFLAGS="$CFLAGS -D_ISOC99_SOURCE -D_GNU_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE" + + # check to see if struct dirent has the d_type member +-{ echo "$as_me:$LINENO: checking for struct dirent.d_type" >&5 +-echo $ECHO_N "checking for struct dirent.d_type... $ECHO_C" >&6; } +-if test "${ac_cv_member_struct_dirent_d_type+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include +- +-int +-main () +-{ +-static struct dirent ac_aggr; +-if (ac_aggr.d_type) +-return 0; +- ; +- 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then +- ac_cv_member_struct_dirent_d_type=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include +- +-int +-main () +-{ +-static struct dirent ac_aggr; +-if (sizeof ac_aggr.d_type) +-return 0; +- ; +- 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then +- ac_cv_member_struct_dirent_d_type=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_member_struct_dirent_d_type=no +-fi +- +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-fi +- +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-fi +-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_dirent_d_type" >&5 +-echo "${ECHO_T}$ac_cv_member_struct_dirent_d_type" >&6; } +-if test $ac_cv_member_struct_dirent_d_type = yes; then ++ac_fn_c_check_member "$LINENO" "struct dirent" "d_type" "ac_cv_member_struct_dirent_d_type" "#include ++" ++if test "x$ac_cv_member_struct_dirent_d_type" = x""yes; then : + +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_STRUCT_DIRENT_D_TYPE 1 +-_ACEOF ++$as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h + + fi + + + # Checks for libraries. + +- +-{ echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 +-echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6; } +-if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 ++$as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } ++if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lpthread $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -11209,39 +10628,18 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_mutex_init=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_pthread_pthread_mutex_init=no ++ ac_cv_lib_pthread_pthread_mutex_init=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 +-echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6; } +-if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 ++$as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } ++if test "x$ac_cv_lib_pthread_pthread_mutex_init" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_LIBPTHREAD 1 + _ACEOF +@@ -11256,10 +10654,10 @@ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}docbook2man", so it can be a program name with args. + set dummy ${ac_tool_prefix}docbook2man; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_DOCBOOK2MAN+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_DOCBOOK2MAN+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$DOCBOOK2MAN"; then + ac_cv_prog_DOCBOOK2MAN="$DOCBOOK2MAN" # Let the user override the test. +@@ -11269,25 +10667,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_DOCBOOK2MAN="${ac_tool_prefix}docbook2man" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + DOCBOOK2MAN=$ac_cv_prog_DOCBOOK2MAN + if test -n "$DOCBOOK2MAN"; then +- { echo "$as_me:$LINENO: result: $DOCBOOK2MAN" >&5 +-echo "${ECHO_T}$DOCBOOK2MAN" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOK2MAN" >&5 ++$as_echo "$DOCBOOK2MAN" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -11296,10 +10694,10 @@ + ac_ct_DOCBOOK2MAN=$DOCBOOK2MAN + # Extract the first word of "docbook2man", so it can be a program name with args. + set dummy docbook2man; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_ac_ct_DOCBOOK2MAN+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_DOCBOOK2MAN+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_DOCBOOK2MAN"; then + ac_cv_prog_ac_ct_DOCBOOK2MAN="$ac_ct_DOCBOOK2MAN" # Let the user override the test. +@@ -11309,25 +10707,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_DOCBOOK2MAN="docbook2man" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + ac_ct_DOCBOOK2MAN=$ac_cv_prog_ac_ct_DOCBOOK2MAN + if test -n "$ac_ct_DOCBOOK2MAN"; then +- { echo "$as_me:$LINENO: result: $ac_ct_DOCBOOK2MAN" >&5 +-echo "${ECHO_T}$ac_ct_DOCBOOK2MAN" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DOCBOOK2MAN" >&5 ++$as_echo "$ac_ct_DOCBOOK2MAN" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + if test "x$ac_ct_DOCBOOK2MAN" = x; then +@@ -11335,12 +10733,8 @@ + 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:${as_lineno-$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 + DOCBOOK2MAN=$ac_ct_DOCBOOK2MAN +@@ -11352,10 +10746,10 @@ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}docbook2pdf", so it can be a program name with args. + set dummy ${ac_tool_prefix}docbook2pdf; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_DOCBOOK2PDF+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_DOCBOOK2PDF+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$DOCBOOK2PDF"; then + ac_cv_prog_DOCBOOK2PDF="$DOCBOOK2PDF" # Let the user override the test. +@@ -11365,25 +10759,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_DOCBOOK2PDF="${ac_tool_prefix}docbook2pdf" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + DOCBOOK2PDF=$ac_cv_prog_DOCBOOK2PDF + if test -n "$DOCBOOK2PDF"; then +- { echo "$as_me:$LINENO: result: $DOCBOOK2PDF" >&5 +-echo "${ECHO_T}$DOCBOOK2PDF" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOK2PDF" >&5 ++$as_echo "$DOCBOOK2PDF" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -11392,10 +10786,10 @@ + ac_ct_DOCBOOK2PDF=$DOCBOOK2PDF + # Extract the first word of "docbook2pdf", so it can be a program name with args. + set dummy docbook2pdf; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_ac_ct_DOCBOOK2PDF+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_DOCBOOK2PDF+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_DOCBOOK2PDF"; then + ac_cv_prog_ac_ct_DOCBOOK2PDF="$ac_ct_DOCBOOK2PDF" # Let the user override the test. +@@ -11405,25 +10799,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_DOCBOOK2PDF="docbook2pdf" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + ac_ct_DOCBOOK2PDF=$ac_cv_prog_ac_ct_DOCBOOK2PDF + if test -n "$ac_ct_DOCBOOK2PDF"; then +- { echo "$as_me:$LINENO: result: $ac_ct_DOCBOOK2PDF" >&5 +-echo "${ECHO_T}$ac_ct_DOCBOOK2PDF" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DOCBOOK2PDF" >&5 ++$as_echo "$ac_ct_DOCBOOK2PDF" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + if test "x$ac_ct_DOCBOOK2PDF" = x; then +@@ -11431,12 +10825,8 @@ + 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:${as_lineno-$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 + DOCBOOK2PDF=$ac_ct_DOCBOOK2PDF +@@ -11447,16 +10837,12 @@ + + + # Checks for header files. +-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +-if test "${ac_cv_header_stdc+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 ++$as_echo_n "checking for ANSI C header files... " >&6; } ++if test "${ac_cv_header_stdc+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + #include +@@ -11471,68 +10857,23 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then ++if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_header_stdc=no ++ ac_cv_header_stdc=no + fi +- + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + + _ACEOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- $EGREP "memchr" >/dev/null 2>&1; then +- : +-else +- ac_cv_header_stdc=no +-fi +-rm -f conftest* +- +-fi +- +-if test $ac_cv_header_stdc = yes; then +- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include ++ $EGREP "memchr" >/dev/null 2>&1; then : + +-_ACEOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- $EGREP "free" >/dev/null 2>&1; then +- : + else + ac_cv_header_stdc=no + fi +@@ -11541,232 +10882,81 @@ + fi + + if test $ac_cv_header_stdc = yes; then +- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +- if test "$cross_compiling" = yes; then +- : +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-#include + #include +-#if ((' ' & 0x0FF) == 0x020) +-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +-#else +-# define ISLOWER(c) \ +- (('a' <= (c) && (c) <= 'i') \ +- || ('j' <= (c) && (c) <= 'r') \ +- || ('s' <= (c) && (c) <= 'z')) +-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +-#endif +- +-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +-int +-main () +-{ +- int i; +- for (i = 0; i < 256; i++) +- if (XOR (islower (i), ISLOWER (i)) +- || toupper (i) != TOUPPER (i)) +- return 2; +- return 0; +-} +-_ACEOF +-rm -f 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_link") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- : +-else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-ac_cv_header_stdc=no +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +- +- +-fi +-fi +-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +-echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +-if test $ac_cv_header_stdc = yes; then +- +-cat >>confdefs.h <<\_ACEOF +-#define STDC_HEADERS 1 +-_ACEOF +- +-fi +- +- +- +- +- +- +- +- +- +-for ac_header in arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h +-do +-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +- { echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-fi +-ac_res=`eval echo '${'$as_ac_Header'}'` +- { echo "$as_me:$LINENO: result: $ac_res" >&5 +-echo "${ECHO_T}$ac_res" >&6; } +-else +- # Is the header compilable? +-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-$ac_includes_default +-#include <$ac_header> +-_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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then +- ac_header_compiler=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 + +- ac_header_compiler=no ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "free" >/dev/null 2>&1; then : ++ ++else ++ ac_cv_header_stdc=no + fi ++rm -f conftest* + +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +-echo "${ECHO_T}$ac_header_compiler" >&6; } ++fi + +-# Is the header present? +-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++if test $ac_cv_header_stdc = yes; then ++ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. ++ if test "$cross_compiling" = yes; then : ++ : ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-#include <$ac_header> ++#include ++#include ++#if ((' ' & 0x0FF) == 0x020) ++# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') ++# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) ++#else ++# define ISLOWER(c) \ ++ (('a' <= (c) && (c) <= 'i') \ ++ || ('j' <= (c) && (c) <= 'r') \ ++ || ('s' <= (c) && (c) <= 'z')) ++# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) ++#endif ++ ++#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) ++int ++main () ++{ ++ int i; ++ for (i = 0; i < 256; i++) ++ if (XOR (islower (i), ISLOWER (i)) ++ || toupper (i) != TOUPPER (i)) ++ return 2; ++ return 0; ++} + _ACEOF +-if { (ac_try="$ac_cpp conftest.$ac_ext" +-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_cpp conftest.$ac_ext") 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 +- (exit $ac_status); } >/dev/null && { +- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || +- test ! -s conftest.err +- }; then +- ac_header_preproc=yes ++if ac_fn_c_try_run "$LINENO"; then : ++ + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 ++ ac_cv_header_stdc=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi + +- ac_header_preproc=no + fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 ++$as_echo "$ac_cv_header_stdc" >&6; } ++if test $ac_cv_header_stdc = yes; then + +-rm -f conftest.err conftest.$ac_ext +-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +-echo "${ECHO_T}$ac_header_preproc" >&6; } ++$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +-# So? What about this header? +-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in +- yes:no: ) +- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} +- ac_header_preproc=yes +- ;; +- no:yes:* ) +- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +- ( cat <<\_ASBOX +-## ------------------------------------ ## +-## Report this to nufw-devel@nongnu.org ## +-## ------------------------------------ ## +-_ASBOX +- ) | sed "s/^/$as_me: WARNING: /" >&2 +- ;; +-esac +-{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- eval "$as_ac_Header=\$ac_header_preproc" + fi +-ac_res=`eval echo '${'$as_ac_Header'}'` +- { echo "$as_me:$LINENO: result: $ac_res" >&5 +-echo "${ECHO_T}$ac_res" >&6; } + +-fi +-if test `eval echo '${'$as_ac_Header'}'` = yes; then ++for ac_header in arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + _ACEOF + + fi +@@ -11775,16 +10965,12 @@ + + + # Checks for typedefs, structures, and compiler characteristics. +-{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +-if test "${ac_cv_c_const+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 ++$as_echo_n "checking for an ANSI C-conforming const... " >&6; } ++if test "${ac_cv_c_const+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -11844,203 +11030,44 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then ++if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_c_const=no ++ ac_cv_c_const=no + fi +- + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +-echo "${ECHO_T}$ac_cv_c_const" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 ++$as_echo "$ac_cv_c_const" >&6; } + if test $ac_cv_c_const = no; then + +-cat >>confdefs.h <<\_ACEOF +-#define const +-_ACEOF ++$as_echo "#define const /**/" >>confdefs.h + + fi + + + # Checks for library functions. +- + for ac_header in stdlib.h +-do +-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +- { echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-fi +-ac_res=`eval echo '${'$as_ac_Header'}'` +- { echo "$as_me:$LINENO: result: $ac_res" >&5 +-echo "${ECHO_T}$ac_res" >&6; } +-else +- # Is the header compilable? +-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-$ac_includes_default +-#include <$ac_header> +-_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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then +- ac_header_compiler=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_header_compiler=no +-fi +- +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +-echo "${ECHO_T}$ac_header_compiler" >&6; } +- +-# Is the header present? +-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include <$ac_header> +-_ACEOF +-if { (ac_try="$ac_cpp conftest.$ac_ext" +-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_cpp conftest.$ac_ext") 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 +- (exit $ac_status); } >/dev/null && { +- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || +- test ! -s conftest.err +- }; then +- ac_header_preproc=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_header_preproc=no +-fi +- +-rm -f conftest.err conftest.$ac_ext +-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +-echo "${ECHO_T}$ac_header_preproc" >&6; } +- +-# So? What about this header? +-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in +- yes:no: ) +- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} +- ac_header_preproc=yes +- ;; +- no:yes:* ) +- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +- ( cat <<\_ASBOX +-## ------------------------------------ ## +-## Report this to nufw-devel@nongnu.org ## +-## ------------------------------------ ## +-_ASBOX +- ) | sed "s/^/$as_me: WARNING: /" >&2 +- ;; +-esac +-{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- eval "$as_ac_Header=\$ac_header_preproc" +-fi +-ac_res=`eval echo '${'$as_ac_Header'}'` +- { echo "$as_me:$LINENO: result: $ac_res" >&5 +-echo "${ECHO_T}$ac_res" >&6; } +- +-fi +-if test `eval echo '${'$as_ac_Header'}'` = yes; then ++do : ++ ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" ++if test "x$ac_cv_header_stdlib_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++#define HAVE_STDLIB_H 1 + _ACEOF + + fi + + done + +-{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +-echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } +-if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 ++$as_echo_n "checking for GNU libc compatible malloc... " >&6; } ++if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else +- if test "$cross_compiling" = yes; then ++ if test "$cross_compiling" = yes; then : + ac_cv_func_malloc_0_nonnull=no + else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #if defined STDC_HEADERS || defined HAVE_STDLIB_H + # include +@@ -12056,52 +11083,24 @@ + return 0; + } + _ACEOF +-rm -f 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_link") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then ++if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_malloc_0_nonnull=yes + else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-ac_cv_func_malloc_0_nonnull=no ++ ac_cv_func_malloc_0_nonnull=no + fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + +- + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +-echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } +-if test $ac_cv_func_malloc_0_nonnull = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 ++$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } ++if test $ac_cv_func_malloc_0_nonnull = yes; then : + +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_MALLOC 1 +-_ACEOF ++$as_echo "#define HAVE_MALLOC 1" >>confdefs.h + + else +- cat >>confdefs.h <<\_ACEOF +-#define HAVE_MALLOC 0 +-_ACEOF ++ $as_echo "#define HAVE_MALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; +@@ -12110,30 +11109,23 @@ + esac + + +-cat >>confdefs.h <<\_ACEOF +-#define malloc rpl_malloc +-_ACEOF ++$as_echo "#define malloc rpl_malloc" >>confdefs.h + + fi + + +- +-{ echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 +-echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6; } +-if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 ++$as_echo_n "checking whether lstat dereferences a symlink specified with a trailing slash... " >&6; } ++if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + rm -f conftest.sym conftest.file + echo >conftest.file + if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then +- if test "$cross_compiling" = yes; then ++ if test "$cross_compiling" = yes; then : + ac_cv_func_lstat_dereferences_slashed_symlink=no + else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + $ac_includes_default + int +@@ -12148,39 +11140,15 @@ + return 0; + } + _ACEOF +-rm -f 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_link") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then ++if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_lstat_dereferences_slashed_symlink=yes + else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-ac_cv_func_lstat_dereferences_slashed_symlink=no ++ ac_cv_func_lstat_dereferences_slashed_symlink=no + fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + +- + else + # If the `ln -s' command failed, then we probably don't even + # have an lstat function. +@@ -12189,8 +11157,8 @@ + rm -f conftest.sym conftest.file + + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +-echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 ++$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } + + test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && + +@@ -12208,19 +11176,15 @@ + + fi + +-{ echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5 +-echo $ECHO_N "checking whether stat accepts an empty string... $ECHO_C" >&6; } +-if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 ++$as_echo_n "checking whether stat accepts an empty string... " >&6; } ++if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else +- if test "$cross_compiling" = yes; then ++ if test "$cross_compiling" = yes; then : + ac_cv_func_stat_empty_string_bug=yes + else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + $ac_includes_default + int +@@ -12232,149 +11196,40 @@ + return 0; + } + _ACEOF +-rm -f 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_link") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_func_stat_empty_string_bug=no +-else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-ac_cv_func_stat_empty_string_bug=yes +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +- +- +-fi +-{ echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5 +-echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6; } +-if test $ac_cv_func_stat_empty_string_bug = yes; then +- case " $LIBOBJS " in +- *" stat.$ac_objext "* ) ;; +- *) LIBOBJS="$LIBOBJS stat.$ac_objext" +- ;; +-esac +- +- +-cat >>confdefs.h <<_ACEOF +-#define HAVE_STAT_EMPTY_STRING_BUG 1 +-_ACEOF +- +-fi +- +- +- +- +- +- +-for ac_func in gethostbyname memset socket strcasecmp strspn +-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; } +-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-/* Define $ac_func to an innocuous variant, in case declares $ac_func. +- For example, HP-UX 11i declares gettimeofday. */ +-#define $ac_func innocuous_$ac_func +- +-/* System header to define __stub macros and hopefully few prototypes, +- which can conflict with char $ac_func (); below. +- Prefer to if __STDC__ is defined, since +- exists even on freestanding compilers. */ +- +-#ifdef __STDC__ +-# include +-#else +-# include +-#endif +- +-#undef $ac_func +- +-/* Override any GCC internal prototype to avoid an error. +- Use char because int might match the return type of a GCC +- builtin and then its argument prototype would still apply. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-char $ac_func (); +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined __stub_$ac_func || defined __stub___$ac_func +-choke me +-#endif +- +-int +-main () +-{ +-return $ac_func (); +- ; +- 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 "echo \"\$as_me:$LINENO: $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 +- (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 +- eval "$as_ac_var=yes" ++if ac_fn_c_try_run "$LINENO"; then : ++ ac_cv_func_stat_empty_string_bug=no + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 ++ ac_cv_func_stat_empty_string_bug=yes ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi + +- eval "$as_ac_var=no" + fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 ++$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } ++if test $ac_cv_func_stat_empty_string_bug = yes; then ++ case " $LIBOBJS " in ++ *" stat.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS stat.$ac_objext" ++ ;; ++esac ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STAT_EMPTY_STRING_BUG 1 ++_ACEOF + +-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 ++ ++for ac_func in gethostbyname memset socket strcasecmp strspn ++do : ++ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ++ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" ++eval as_val=\$$as_ac_var ++ 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 +@@ -12387,10 +11242,126 @@ + #AM_CHECK_PATH(libgnutls], [gnutls_init],AC_DEFINE([HAVE_LIBRARY_GNUTLS],[1],[Gnutls lib flag]), check_gnutls=no) + + ++ ++if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then ++ if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. ++set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $PKG_CONFIG in ++ [\\/]* | ?:[\\/]*) ++ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ++ ;; ++ *) ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ 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_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++ ;; ++esac ++fi ++PKG_CONFIG=$ac_cv_path_PKG_CONFIG ++if test -n "$PKG_CONFIG"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 ++$as_echo "$PKG_CONFIG" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_path_PKG_CONFIG"; then ++ ac_pt_PKG_CONFIG=$PKG_CONFIG ++ # Extract the first word of "pkg-config", so it can be a program name with args. ++set dummy pkg-config; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $ac_pt_PKG_CONFIG in ++ [\\/]* | ?:[\\/]*) ++ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ++ ;; ++ *) ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ 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_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++ ;; ++esac ++fi ++ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG ++if test -n "$ac_pt_PKG_CONFIG"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 ++$as_echo "$ac_pt_PKG_CONFIG" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_pt_PKG_CONFIG" = x; then ++ PKG_CONFIG="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$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 ++ PKG_CONFIG=$ac_pt_PKG_CONFIG ++ fi ++else ++ PKG_CONFIG="$ac_cv_path_PKG_CONFIG" ++fi ++ ++fi ++if test -n "$PKG_CONFIG"; then ++ _pkg_min_version=0.9.0 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 ++$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } ++ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++ else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ PKG_CONFIG="" ++ fi ++ ++fi ++ + NEED_LIBGCRYPT_VERSION=1.2.0 + + # Check whether --with-libgcrypt-prefix was given. +-if test "${with_libgcrypt_prefix+set}" = set; then ++if test "${with_libgcrypt_prefix+set}" = set; then : + withval=$with_libgcrypt_prefix; libgcrypt_config_prefix="$withval" + else + libgcrypt_config_prefix="" +@@ -12404,10 +11375,10 @@ + + # Extract the first word of "libgcrypt-config", so it can be a program name with args. + set dummy libgcrypt-config; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_path_LIBGCRYPT_CONFIG+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_path_LIBGCRYPT_CONFIG+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + case $LIBGCRYPT_CONFIG in + [\\/]* | ?:[\\/]*) +@@ -12419,14 +11390,14 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_path_LIBGCRYPT_CONFIG="$as_dir/$ac_word$ac_exec_ext" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + test -z "$ac_cv_path_LIBGCRYPT_CONFIG" && ac_cv_path_LIBGCRYPT_CONFIG="no" +@@ -12435,11 +11406,11 @@ + fi + LIBGCRYPT_CONFIG=$ac_cv_path_LIBGCRYPT_CONFIG + if test -n "$LIBGCRYPT_CONFIG"; then +- { echo "$as_me:$LINENO: result: $LIBGCRYPT_CONFIG" >&5 +-echo "${ECHO_T}$LIBGCRYPT_CONFIG" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBGCRYPT_CONFIG" >&5 ++$as_echo "$LIBGCRYPT_CONFIG" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -12452,8 +11423,8 @@ + min_libgcrypt_version="$tmp" + fi + +- { echo "$as_me:$LINENO: checking for LIBGCRYPT - version >= $min_libgcrypt_version" >&5 +-echo $ECHO_N "checking for LIBGCRYPT - version >= $min_libgcrypt_version... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBGCRYPT - version >= $min_libgcrypt_version" >&5 ++$as_echo_n "checking for LIBGCRYPT - version >= $min_libgcrypt_version... " >&6; } + ok=no + if test "$LIBGCRYPT_CONFIG" != "no" ; then + req_major=`echo $min_libgcrypt_version | \ +@@ -12486,11 +11457,11 @@ + fi + fi + if test $ok = yes; then +- { echo "$as_me:$LINENO: result: yes ($libgcrypt_config_version)" >&5 +-echo "${ECHO_T}yes ($libgcrypt_config_version)" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($libgcrypt_config_version)" >&5 ++$as_echo "yes ($libgcrypt_config_version)" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + if test $ok = yes; then + # If we have a recent libgcrypt, we should also check that the +@@ -12498,15 +11469,15 @@ + if test "$req_libgcrypt_api" -gt 0 ; then + tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0` + if test "$tmp" -gt 0 ; then +- { echo "$as_me:$LINENO: checking LIBGCRYPT API version" >&5 +-echo $ECHO_N "checking LIBGCRYPT API version... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBGCRYPT API version" >&5 ++$as_echo_n "checking LIBGCRYPT API version... " >&6; } + if test "$req_libgcrypt_api" -eq "$tmp" ; then +- { echo "$as_me:$LINENO: result: okay" >&5 +-echo "${ECHO_T}okay" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: okay" >&5 ++$as_echo "okay" >&6; } + else + ok=no +- { echo "$as_me:$LINENO: result: does not match. want=$req_libgcrypt_api got=$tmp" >&5 +-echo "${ECHO_T}does not match. want=$req_libgcrypt_api got=$tmp" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: does not match. want=$req_libgcrypt_api got=$tmp" >&5 ++$as_echo "does not match. want=$req_libgcrypt_api got=$tmp" >&6; } + fi + fi + fi +@@ -12521,302 +11492,93 @@ + : + fi + +- +- +-if test "x$LIBGCRYPT_LIBS" = "x"; then +- { { echo "$as_me:$LINENO: error: libgcrypt is needed. +- See ftp://ftp.gnupg.org/gcrypt/ ." >&5 +-echo "$as_me: error: libgcrypt is needed. +- See ftp://ftp.gnupg.org/gcrypt/ ." >&2;} +- { (exit 1); exit 1; }; } +-else +- CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS" +- LDFLAGS="$LDFLAGS $LIBGCRYPT_LIBS" +-fi +- +-NEED_LIBGNUTLS_VERSION=1.0.16 +- +-# Check whether --with-libgnutls-prefix was given. +-if test "${with_libgnutls_prefix+set}" = set; then +- withval=$with_libgnutls_prefix; libgnutls_config_prefix="$withval" +-else +- libgnutls_config_prefix="" +-fi +- +- +- if test x$libgnutls_config_prefix != x ; then +- if test x${LIBGNUTLS_CONFIG+set} != xset ; then +- LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config +- fi +- fi +- +- # Extract the first word of "libgnutls-config", so it can be a program name with args. +-set dummy libgnutls-config; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_path_LIBGNUTLS_CONFIG+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- case $LIBGNUTLS_CONFIG in +- [\\/]* | ?:[\\/]*) +- ac_cv_path_LIBGNUTLS_CONFIG="$LIBGNUTLS_CONFIG" # Let the user override the test with a path. +- ;; +- *) +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- 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_path_LIBGNUTLS_CONFIG="$as_dir/$ac_word$ac_exec_ext" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +-done +-IFS=$as_save_IFS +- +- test -z "$ac_cv_path_LIBGNUTLS_CONFIG" && ac_cv_path_LIBGNUTLS_CONFIG="no" +- ;; +-esac +-fi +-LIBGNUTLS_CONFIG=$ac_cv_path_LIBGNUTLS_CONFIG +-if test -n "$LIBGNUTLS_CONFIG"; then +- { echo "$as_me:$LINENO: result: $LIBGNUTLS_CONFIG" >&5 +-echo "${ECHO_T}$LIBGNUTLS_CONFIG" >&6; } +-else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } +-fi +- +- +- min_libgnutls_version="$NEED_LIBGNUTLS_VERSION" +- { echo "$as_me:$LINENO: checking for libgnutls - version >= $min_libgnutls_version" >&5 +-echo $ECHO_N "checking for libgnutls - version >= $min_libgnutls_version... $ECHO_C" >&6; } +- no_libgnutls="" +- if test "$LIBGNUTLS_CONFIG" = "no" ; then +- no_libgnutls=yes +- else +- LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags` +- LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs` +- libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version` +- +- +- ac_save_CFLAGS="$CFLAGS" +- ac_save_LIBS="$LIBS" +- CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS" +- LIBS="$LIBS $LIBGNUTLS_LIBS" +- rm -f conf.libgnutlstest +- if test "$cross_compiling" = yes; then +- echo $ac_n "cross compiling; assumed OK... $ac_c" +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-#include +-#include +-#include +-#include +- +-int +-main () +-{ +- system ("touch conf.libgnutlstest"); +- +- if( strcmp( gnutls_check_version(NULL), "$libgnutls_config_version" ) ) +- { +- printf("\n*** 'libgnutls-config --version' returned %s, but LIBGNUTLS (%s)\n", +- "$libgnutls_config_version", gnutls_check_version(NULL) ); +- printf("*** was found! If libgnutls-config was correct, then it is best\n"); +- printf("*** to remove the old version of LIBGNUTLS. You may also be able to fix the error\n"); +- printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); +- printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); +- printf("*** required on your system.\n"); +- printf("*** If libgnutls-config was wrong, set the environment variable LIBGNUTLS_CONFIG\n"); +- printf("*** to point to the correct copy of libgnutls-config, and remove the file config.cache\n"); +- printf("*** before re-running configure\n"); +- } +- else if ( strcmp(gnutls_check_version(NULL), LIBGNUTLS_VERSION ) ) +- { +- printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION); +- printf("*** library (version %s)\n", gnutls_check_version(NULL) ); +- } +- else +- { +- if ( gnutls_check_version( "$min_libgnutls_version" ) ) +- { +- return 0; +- } +- else +- { +- printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n", +- gnutls_check_version(NULL) ); +- printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n", +- "$min_libgnutls_version" ); +- printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n"); +- printf("*** \n"); +- printf("*** If you have already installed a sufficiently new version, this error\n"); +- printf("*** probably means that the wrong copy of the libgnutls-config shell script is\n"); +- printf("*** being found. The easiest way to fix this is to remove the old version\n"); +- printf("*** of LIBGNUTLS, but you can also set the LIBGNUTLS_CONFIG environment to point to the\n"); +- printf("*** correct copy of libgnutls-config. (In this case, you will have to\n"); +- printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); +- printf("*** so that the correct libraries are found at run-time))\n"); +- } +- } +- return 1; +-} +- +-_ACEOF +-rm -f 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_link") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- : +-else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-no_libgnutls=yes +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +- +- +- CFLAGS="$ac_save_CFLAGS" +- LIBS="$ac_save_LIBS" +- fi +- +- if test "x$no_libgnutls" = x ; then +- { echo "$as_me:$LINENO: result: yes" >&5 +-echo "${ECHO_T}yes" >&6; } +- : +- else +- if test -f conf.libgnutlstest ; then +- : +- else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } +- fi +- if test "$LIBGNUTLS_CONFIG" = "no" ; then +- echo "*** The libgnutls-config script installed by LIBGNUTLS could not be found" +- echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in" +- echo "*** your path, or set the LIBGNUTLS_CONFIG environment variable to the" +- echo "*** full path to libgnutls-config." +- else +- if test -f conf.libgnutlstest ; then +- : +- else +- echo "*** Could not run libgnutls test program, checking why..." +- CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS" +- LIBS="$LIBS $LIBGNUTLS_LIBS" +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-#include +-#include +-#include +-#include +- +-int +-main () +-{ +- return !!gnutls_check_version(NULL); +- ; +- 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 "echo \"\$as_me:$LINENO: $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 +- (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 +- echo "*** The test program compiled, but did not run. This usually means" +- echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong" +- echo "*** version of LIBGNUTLS. If it is not finding LIBGNUTLS, you'll need to set your" +- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" +- echo "*** to the installed location Also, make sure you have run ldconfig if that" +- echo "*** is required on your system" +- echo "***" +- echo "*** If you have an old version installed, it is best to remove it, although" +- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" +- echo "***" ++ ++ ++if test "x$LIBGCRYPT_LIBS" = "x"; then ++ as_fn_error "libgcrypt is needed. ++ See ftp://ftp.gnupg.org/gcrypt/ ." "$LINENO" 5 + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 ++ CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS" ++ LDFLAGS="$LDFLAGS $LIBGCRYPT_LIBS" ++fi ++ ++NEED_LIBGNUTLS_VERSION=1.0.16 ++ ++pkg_failed=no ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNUTLS" >&5 ++$as_echo_n "checking for GNUTLS... " >&6; } + +- echo "*** The test program failed to compile or link. See the file config.log for the" +- echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed" +- echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you" +- echo "*** may want to edit the libgnutls-config script: $LIBGNUTLS_CONFIG" ++if test -n "$PKG_CONFIG"; then ++ if test -n "$GNUTLS_CFLAGS"; then ++ pkg_cv_GNUTLS_CFLAGS="$GNUTLS_CFLAGS" ++ else ++ if test -n "$PKG_CONFIG" && \ ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= \$NEED_LIBGNUTLS_VERSION\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "gnutls >= $NEED_LIBGNUTLS_VERSION") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++ pkg_cv_GNUTLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= $NEED_LIBGNUTLS_VERSION" 2>/dev/null` ++else ++ pkg_failed=yes ++fi ++ fi ++else ++ pkg_failed=untried ++fi ++if test -n "$PKG_CONFIG"; then ++ if test -n "$GNUTLS_LIBS"; then ++ pkg_cv_GNUTLS_LIBS="$GNUTLS_LIBS" ++ else ++ if test -n "$PKG_CONFIG" && \ ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= \$NEED_LIBGNUTLS_VERSION\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "gnutls >= $NEED_LIBGNUTLS_VERSION") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++ pkg_cv_GNUTLS_LIBS=`$PKG_CONFIG --libs "gnutls >= $NEED_LIBGNUTLS_VERSION" 2>/dev/null` ++else ++ pkg_failed=yes ++fi ++ fi ++else ++ pkg_failed=untried + fi + +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext +- CFLAGS="$ac_save_CFLAGS" +- LIBS="$ac_save_LIBS" +- fi +- fi +- LIBGNUTLS_CFLAGS="" +- LIBGNUTLS_LIBS="" +- : +- fi +- rm -f conf.libgnutlstest + + ++if test $pkg_failed = yes; then ++ ++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then ++ _pkg_short_errors_supported=yes ++else ++ _pkg_short_errors_supported=no ++fi ++ if test $_pkg_short_errors_supported = yes; then ++ GNUTLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gnutls >= $NEED_LIBGNUTLS_VERSION"` ++ else ++ GNUTLS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gnutls >= $NEED_LIBGNUTLS_VERSION"` ++ fi ++ # Put the nasty error message in config.log where it belongs ++ echo "$GNUTLS_PKG_ERRORS" >&5 + +-if test "x$LIBGNUTLS_LIBS" = "x"; then +- { { echo "$as_me:$LINENO: error: libgnutls is needed. +- See www.gnu.org/software/gnutls/ ." >&5 +-echo "$as_me: error: libgnutls is needed. +- See www.gnu.org/software/gnutls/ ." >&2;} +- { (exit 1); exit 1; }; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ exit ++elif test $pkg_failed = untried; then ++ exit ++else ++ GNUTLS_CFLAGS=$pkg_cv_GNUTLS_CFLAGS ++ GNUTLS_LIBS=$pkg_cv_GNUTLS_LIBS ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++ : + fi + + #Configure database support, depending on user input + + # Check whether --with-prelude-log was given. +-if test "${with_prelude_log+set}" = set; then ++if test "${with_prelude_log+set}" = set; then : + withval=$with_prelude_log; enable_prelude_log=$withval + else + enable_prelude_log="" +@@ -12825,7 +11587,7 @@ + + + # Check whether --with-mysql-log was given. +-if test "${with_mysql_log+set}" = set; then ++if test "${with_mysql_log+set}" = set; then : + withval=$with_mysql_log; enable_mysql_log=$withval + else + enable_mysql_log="" +@@ -12833,7 +11595,7 @@ + + + # Check whether --with-mysql-auth was given. +-if test "${with_mysql_auth+set}" = set; then ++if test "${with_mysql_auth+set}" = set; then : + withval=$with_mysql_auth; enable_mysql_auth=$withval + else + enable_mysql_auth="" +@@ -12841,7 +11603,7 @@ + + + # Check whether --with-pgsql-log was given. +-if test "${with_pgsql_log+set}" = set; then ++if test "${with_pgsql_log+set}" = set; then : + withval=$with_pgsql_log; enable_pgsql_log=$withval + else + enable_pgsql_log="" +@@ -12849,7 +11611,7 @@ + + + # Check whether --with-syslog-log was given. +-if test "${with_syslog_log+set}" = set; then ++if test "${with_syslog_log+set}" = set; then : + withval=$with_syslog_log; enable_syslog_log=$withval + else + enable_syslog_log="yes" +@@ -12858,7 +11620,7 @@ + + + # Check whether --with-plaintext-auth was given. +-if test "${with_plaintext_auth+set}" = set; then ++if test "${with_plaintext_auth+set}" = set; then : + withval=$with_plaintext_auth; enable_plaintext_auth=$withval + else + enable_plaintext_auth="yes" +@@ -12866,7 +11628,7 @@ + + + # Check whether --with-mark-group was given. +-if test "${with_mark_group+set}" = set; then ++if test "${with_mark_group+set}" = set; then : + withval=$with_mark_group; enable_mark_group=$withval + else + enable_mark_group="yes" +@@ -12874,7 +11636,7 @@ + + + # Check whether --with-mark-field was given. +-if test "${with_mark_field+set}" = set; then ++if test "${with_mark_field+set}" = set; then : + withval=$with_mark_field; enable_mark_field=$withval + else + enable_mark_field="yes" +@@ -12882,7 +11644,7 @@ + + + # Check whether --with-mark-flag was given. +-if test "${with_mark_flag+set}" = set; then ++if test "${with_mark_flag+set}" = set; then : + withval=$with_mark_flag; enable_mark_flag=$withval + else + enable_mark_flag="yes" +@@ -12890,7 +11652,7 @@ + + + # Check whether --with-system-auth was given. +-if test "${with_system_auth+set}" = set; then ++if test "${with_system_auth+set}" = set; then : + withval=$with_system_auth; enable_system_auth=$withval + else + enable_system_auth="yes" +@@ -12899,7 +11661,7 @@ + + + # Check whether --with-ldap was given. +-if test "${with_ldap+set}" = set; then ++if test "${with_ldap+set}" = set; then : + withval=$with_ldap; ldap=$withval + else + ldap="" +@@ -12909,7 +11671,7 @@ + + + # Check whether --with-nfqueue was given. +-if test "${with_nfqueue+set}" = set; then ++if test "${with_nfqueue+set}" = set; then : + withval=$with_nfqueue; use_nfqueue=$withval + else + use_nfqueue="yes" +@@ -12917,7 +11679,7 @@ + + + # Check whether --with-nfconntrack was given. +-if test "${with_nfconntrack+set}" = set; then ++if test "${with_nfconntrack+set}" = set; then : + withval=$with_nfconntrack; use_nfconntrack=$withval + else + use_nfconntrack="yes" +@@ -12927,7 +11689,7 @@ + + + # Check whether --with-utf8 was given. +-if test "${with_utf8+set}" = set; then ++if test "${with_utf8+set}" = set; then : + withval=$with_utf8; + cat >>confdefs.h <<_ACEOF + #define USE_UTF8 1 +@@ -12937,49 +11699,49 @@ + + + # Check whether --with-fixedtimeout was given. +-if test "${with_fixedtimeout+set}" = set; then ++if test "${with_fixedtimeout+set}" = set; then : + withval=$with_fixedtimeout; have_conntrack_fixedtimeout=$withval + fi + + + + # Check whether --enable-nufw was given. +-if test "${enable_nufw+set}" = set; then ++if test "${enable_nufw+set}" = set; then : + enableval=$enable_nufw; build_nufw=$enableval + else + build_nufw="yes" + fi + + # Check whether --enable-nuauth was given. +-if test "${enable_nuauth+set}" = set; then ++if test "${enable_nuauth+set}" = set; then : + enableval=$enable_nuauth; build_nuauth=$enableval + else + build_nuauth="yes" + fi + + # Check whether --enable-libnuclient was given. +-if test "${enable_libnuclient+set}" = set; then ++if test "${enable_libnuclient+set}" = set; then : + enableval=$enable_libnuclient; build_libnuclient=$enableval + else + build_libnuclient="yes" + fi + + # Check whether --enable-nutcpc was given. +-if test "${enable_nutcpc+set}" = set; then ++if test "${enable_nutcpc+set}" = set; then : + enableval=$enable_nutcpc; build_nutcpc=$enableval + else + build_nutcpc="yes" + fi + + # Check whether --enable-pam-nufw was given. +-if test "${enable_pam_nufw+set}" = set; then ++if test "${enable_pam_nufw+set}" = set; then : + enableval=$enable_pam_nufw; build_pam_nufw=$enableval + else + build_pam_nufw="no" + fi + + # Check whether --enable-nuauth-command was given. +-if test "${enable_nuauth_command+set}" = set; then ++if test "${enable_nuauth_command+set}" = set; then : + enableval=$enable_nuauth_command; build_nuauth_command=$enableval + else + build_nuauth_command="yes" +@@ -12990,10 +11752,10 @@ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}python", so it can be a program name with args. + set dummy ${ac_tool_prefix}python; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_PYTHON+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_PYTHON+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$PYTHON"; then + ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test. +@@ -13003,25 +11765,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_PYTHON="${ac_tool_prefix}python" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + PYTHON=$ac_cv_prog_PYTHON + if test -n "$PYTHON"; then +- { echo "$as_me:$LINENO: result: $PYTHON" >&5 +-echo "${ECHO_T}$PYTHON" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 ++$as_echo "$PYTHON" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -13030,10 +11792,10 @@ + ac_ct_PYTHON=$PYTHON + # Extract the first word of "python", so it can be a program name with args. + set dummy python; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_ac_ct_PYTHON+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_PYTHON+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_PYTHON"; then + ac_cv_prog_ac_ct_PYTHON="$ac_ct_PYTHON" # Let the user override the test. +@@ -13043,25 +11805,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_PYTHON="python" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + ac_ct_PYTHON=$ac_cv_prog_ac_ct_PYTHON + if test -n "$ac_ct_PYTHON"; then +- { echo "$as_me:$LINENO: result: $ac_ct_PYTHON" >&5 +-echo "${ECHO_T}$ac_ct_PYTHON" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PYTHON" >&5 ++$as_echo "$ac_ct_PYTHON" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + if test "x$ac_ct_PYTHON" = x; then +@@ -13069,12 +11831,8 @@ + 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:${as_lineno-$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 + PYTHON=$ac_ct_PYTHON +@@ -13091,7 +11849,7 @@ + fi + + # Check whether --enable-debug was given. +-if test "${enable_debug+set}" = set; then ++if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; debug=$enableval + else + debug="" +@@ -13099,7 +11857,7 @@ + + + # Check whether --with-perf-display was given. +-if test "${with_perf_display+set}" = set; then ++if test "${with_perf_display+set}" = set; then : + withval=$with_perf_display; use_perf_display=$withval + else + use_perf_display="yes" +@@ -13120,18 +11878,14 @@ + -o "${build_nutcpc}" = "yes" \ + -o "${build_pam_nufw}" = "yes" \ + ; then +- { echo "$as_me:$LINENO: checking for sasl_server_init in -lsasl2" >&5 +-echo $ECHO_N "checking for sasl_server_init in -lsasl2... $ECHO_C" >&6; } +-if test "${ac_cv_lib_sasl2_sasl_server_init+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sasl_server_init in -lsasl2" >&5 ++$as_echo_n "checking for sasl_server_init in -lsasl2... " >&6; } ++if test "${ac_cv_lib_sasl2_sasl_server_init+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lsasl2 $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -13149,43 +11903,20 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_sasl2_sasl_server_init=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_sasl2_sasl_server_init=no ++ ac_cv_lib_sasl2_sasl_server_init=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_sasl2_sasl_server_init" >&5 +-echo "${ECHO_T}$ac_cv_lib_sasl2_sasl_server_init" >&6; } +-if test $ac_cv_lib_sasl2_sasl_server_init = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sasl2_sasl_server_init" >&5 ++$as_echo "$ac_cv_lib_sasl2_sasl_server_init" >&6; } ++if test "x$ac_cv_lib_sasl2_sasl_server_init" = x""yes; then : + +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_LIBRARY_SASL2 1 +-_ACEOF ++$as_echo "#define HAVE_LIBRARY_SASL2 1" >>confdefs.h + + else + check_sasl=no +@@ -13194,18 +11925,14 @@ + fi + + if test "${build_nuauth}" = "yes"; then +- { echo "$as_me:$LINENO: checking for sasl_server_init in -lsasl2" >&5 +-echo $ECHO_N "checking for sasl_server_init in -lsasl2... $ECHO_C" >&6; } +-if test "${ac_cv_lib_sasl2_sasl_server_init+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sasl_server_init in -lsasl2" >&5 ++$as_echo_n "checking for sasl_server_init in -lsasl2... " >&6; } ++if test "${ac_cv_lib_sasl2_sasl_server_init+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lsasl2 $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -13223,43 +11950,20 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_sasl2_sasl_server_init=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_sasl2_sasl_server_init=no ++ ac_cv_lib_sasl2_sasl_server_init=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_sasl2_sasl_server_init" >&5 +-echo "${ECHO_T}$ac_cv_lib_sasl2_sasl_server_init" >&6; } +-if test $ac_cv_lib_sasl2_sasl_server_init = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sasl2_sasl_server_init" >&5 ++$as_echo "$ac_cv_lib_sasl2_sasl_server_init" >&6; } ++if test "x$ac_cv_lib_sasl2_sasl_server_init" = x""yes; then : + +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_LIBRARY_SASL2 1 +-_ACEOF ++$as_echo "#define HAVE_LIBRARY_SASL2 1" >>confdefs.h + + else + check_sasl=no +@@ -13267,7 +11971,7 @@ + + # glib stuff + # Check whether --enable-glibtest was given. +-if test "${enable_glibtest+set}" = set; then ++if test "${enable_glibtest+set}" = set; then : + enableval=$enable_glibtest; + else + enable_glibtest=yes +@@ -13302,10 +12006,10 @@ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. + set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) +@@ -13317,14 +12021,14 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + ;; +@@ -13332,11 +12036,11 @@ + fi + PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then +- { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +-echo "${ECHO_T}$PKG_CONFIG" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 ++$as_echo "$PKG_CONFIG" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -13345,10 +12049,10 @@ + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) +@@ -13360,14 +12064,14 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + ;; +@@ -13375,11 +12079,11 @@ + fi + ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG + if test -n "$ac_pt_PKG_CONFIG"; then +- { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +-echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 ++$as_echo "$ac_pt_PKG_CONFIG" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + if test "x$ac_pt_PKG_CONFIG" = x; then +@@ -13387,12 +12091,8 @@ + 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:${as_lineno-$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 + PKG_CONFIG=$ac_pt_PKG_CONFIG +@@ -13404,14 +12104,14 @@ + fi + if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.16 +- { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +-echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 ++$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then +- { echo "$as_me:$LINENO: result: yes" >&5 +-echo "${ECHO_T}yes" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + PKG_CONFIG="" + fi + +@@ -13425,8 +12125,8 @@ + fi + + min_glib_version=2.4.0 +- { echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5 +-echo $ECHO_N "checking for GLIB - version >= $min_glib_version... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB - version >= $min_glib_version" >&5 ++$as_echo_n "checking for GLIB - version >= $min_glib_version... " >&6; } + + if test x$PKG_CONFIG != xno ; then + ## don't try to run the test against uninstalled libtool libs +@@ -13461,14 +12161,10 @@ + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$GLIB_LIBS $LIBS" + rm -f conf.glibtest +- if test "$cross_compiling" = yes; then ++ if test "$cross_compiling" = yes; then : + echo $ac_n "cross compiling; assumed OK... $ac_c" + else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + #include +@@ -13480,8 +12176,9 @@ + { + int major, minor, micro; + char *tmp_version; ++ int ignored; + +- system ("touch conf.glibtest"); ++ ignored = system ("touch conf.glibtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_glib_version"); +@@ -13543,50 +12240,26 @@ + } + + _ACEOF +-rm -f 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_link") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- : +-else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 ++if ac_fn_c_try_run "$LINENO"; then : + +-( exit $ac_status ) +-no_glib=yes ++else ++ no_glib=yes + fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + +- + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_glib" = x ; then +- { echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 +-echo "${ECHO_T}yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 ++$as_echo "yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; } + : + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://www.freedesktop.org/software/pkgconfig/" +@@ -13599,11 +12272,7 @@ + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$LIBS $GLIB_LIBS" +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + #include +@@ -13617,24 +12286,7 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GLIB or finding the wrong" + echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" +@@ -13645,15 +12297,11 @@ + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- echo "*** The test program failed to compile or link. See the file config.log for the" ++ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GLIB is incorrectly installed." + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi +@@ -13673,18 +12321,14 @@ + rm -f conf.glibtest + + if test "$enable_system_auth" = "yes"; then +- { echo "$as_me:$LINENO: checking for pam_start in -lpam" >&5 +-echo $ECHO_N "checking for pam_start in -lpam... $ECHO_C" >&6; } +-if test "${ac_cv_lib_pam_pam_start+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5 ++$as_echo_n "checking for pam_start in -lpam... " >&6; } ++if test "${ac_cv_lib_pam_pam_start+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lpam $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -13702,43 +12346,20 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pam_pam_start=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_pam_pam_start=no ++ ac_cv_lib_pam_pam_start=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_pam_pam_start" >&5 +-echo "${ECHO_T}$ac_cv_lib_pam_pam_start" >&6; } +-if test $ac_cv_lib_pam_pam_start = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5 ++$as_echo "$ac_cv_lib_pam_pam_start" >&6; } ++if test "x$ac_cv_lib_pam_pam_start" = x""yes; then : + +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_LIBRARY_PAM 1 +-_ACEOF ++$as_echo "#define HAVE_LIBRARY_PAM 1" >>confdefs.h + + else + check_pam=no +@@ -13747,18 +12368,14 @@ + fi + + if test "${ldap}" = "yes"; then +- { echo "$as_me:$LINENO: checking for ldap_simple_bind_s in -lldap" >&5 +-echo $ECHO_N "checking for ldap_simple_bind_s in -lldap... $ECHO_C" >&6; } +-if test "${ac_cv_lib_ldap_ldap_simple_bind_s+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_simple_bind_s in -lldap" >&5 ++$as_echo_n "checking for ldap_simple_bind_s in -lldap... " >&6; } ++if test "${ac_cv_lib_ldap_ldap_simple_bind_s+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lldap $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -13776,43 +12393,20 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ldap_ldap_simple_bind_s=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_ldap_ldap_simple_bind_s=no ++ ac_cv_lib_ldap_ldap_simple_bind_s=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_simple_bind_s" >&5 +-echo "${ECHO_T}$ac_cv_lib_ldap_ldap_simple_bind_s" >&6; } +-if test $ac_cv_lib_ldap_ldap_simple_bind_s = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_simple_bind_s" >&5 ++$as_echo "$ac_cv_lib_ldap_ldap_simple_bind_s" >&6; } ++if test "x$ac_cv_lib_ldap_ldap_simple_bind_s" = x""yes; then : + +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_LIBRARY_LDAP 1 +-_ACEOF ++$as_echo "#define HAVE_LIBRARY_LDAP 1" >>confdefs.h + + else + check_ldap=no +@@ -13823,18 +12417,14 @@ + if test "$enable_mysql_log" = "yes" \ + -o "$enable_mysql_auth" = "yes" ; then + if which mysql_config 1>/dev/null; then +- { echo "$as_me:$LINENO: checking for mysql_real_connect in -lmysqlclient" >&5 +-echo $ECHO_N "checking for mysql_real_connect in -lmysqlclient... $ECHO_C" >&6; } +-if test "${ac_cv_lib_mysqlclient_mysql_real_connect+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_real_connect in -lmysqlclient" >&5 ++$as_echo_n "checking for mysql_real_connect in -lmysqlclient... " >&6; } ++if test "${ac_cv_lib_mysqlclient_mysql_real_connect+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lmysqlclient $(mysql_config --libs) $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -13852,60 +12442,33 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mysqlclient_mysql_real_connect=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_mysqlclient_mysql_real_connect=no ++ ac_cv_lib_mysqlclient_mysql_real_connect=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_mysqlclient_mysql_real_connect" >&5 +-echo "${ECHO_T}$ac_cv_lib_mysqlclient_mysql_real_connect" >&6; } +-if test $ac_cv_lib_mysqlclient_mysql_real_connect = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_real_connect" >&5 ++$as_echo "$ac_cv_lib_mysqlclient_mysql_real_connect" >&6; } ++if test "x$ac_cv_lib_mysqlclient_mysql_real_connect" = x""yes; then : + +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_LIBRARY_MYSQLCLIENT 1 +-_ACEOF ++$as_echo "#define HAVE_LIBRARY_MYSQLCLIENT 1" >>confdefs.h + + else + check_mysql=no + fi + +- { echo "$as_me:$LINENO: checking for mysql_ssl_set in -lmysqlclient" >&5 +-echo $ECHO_N "checking for mysql_ssl_set in -lmysqlclient... $ECHO_C" >&6; } +-if test "${ac_cv_lib_mysqlclient_mysql_ssl_set+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_ssl_set in -lmysqlclient" >&5 ++$as_echo_n "checking for mysql_ssl_set in -lmysqlclient... " >&6; } ++if test "${ac_cv_lib_mysqlclient_mysql_ssl_set+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lmysqlclient $(mysql_config --libs) $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -13923,63 +12486,38 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mysqlclient_mysql_ssl_set=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_mysqlclient_mysql_ssl_set=no ++ ac_cv_lib_mysqlclient_mysql_ssl_set=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_mysqlclient_mysql_ssl_set" >&5 +-echo "${ECHO_T}$ac_cv_lib_mysqlclient_mysql_ssl_set" >&6; } +-if test $ac_cv_lib_mysqlclient_mysql_ssl_set = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_ssl_set" >&5 ++$as_echo "$ac_cv_lib_mysqlclient_mysql_ssl_set" >&6; } ++if test "x$ac_cv_lib_mysqlclient_mysql_ssl_set" = x""yes; then : + + cat >>confdefs.h <<_ACEOF + #define HAVE_MYSQL_SSL 1 + _ACEOF + + else +- { echo "$as_me:$LINENO: mysqlclient has no ssl support" >&5 +-echo "$as_me: mysqlclient has no ssl support" >&6;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: mysqlclient has no ssl support" >&5 ++$as_echo "$as_me: mysqlclient has no ssl support" >&6;} + fi + + have_mysql_config="yes" + else +- { echo "$as_me:$LINENO: checking for mysql_real_connect in -lmysqlclient" >&5 +-echo $ECHO_N "checking for mysql_real_connect in -lmysqlclient... $ECHO_C" >&6; } +-if test "${ac_cv_lib_mysqlclient_mysql_real_connect+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_real_connect in -lmysqlclient" >&5 ++$as_echo_n "checking for mysql_real_connect in -lmysqlclient... " >&6; } ++if test "${ac_cv_lib_mysqlclient_mysql_real_connect+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lmysqlclient $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -13997,60 +12535,33 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mysqlclient_mysql_real_connect=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_mysqlclient_mysql_real_connect=no ++ ac_cv_lib_mysqlclient_mysql_real_connect=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_mysqlclient_mysql_real_connect" >&5 +-echo "${ECHO_T}$ac_cv_lib_mysqlclient_mysql_real_connect" >&6; } +-if test $ac_cv_lib_mysqlclient_mysql_real_connect = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_real_connect" >&5 ++$as_echo "$ac_cv_lib_mysqlclient_mysql_real_connect" >&6; } ++if test "x$ac_cv_lib_mysqlclient_mysql_real_connect" = x""yes; then : + +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_LIBRARY_MYSQLCLIENT 1 +-_ACEOF ++$as_echo "#define HAVE_LIBRARY_MYSQLCLIENT 1" >>confdefs.h + + else + check_mysql=no + fi + +- { echo "$as_me:$LINENO: checking for mysql_ssl_set in -lmysqlclient" >&5 +-echo $ECHO_N "checking for mysql_ssl_set in -lmysqlclient... $ECHO_C" >&6; } +-if test "${ac_cv_lib_mysqlclient_mysql_ssl_set+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_ssl_set in -lmysqlclient" >&5 ++$as_echo_n "checking for mysql_ssl_set in -lmysqlclient... " >&6; } ++if test "${ac_cv_lib_mysqlclient_mysql_ssl_set+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lmysqlclient $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -14068,47 +12579,26 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mysqlclient_mysql_ssl_set=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_mysqlclient_mysql_ssl_set=no ++ ac_cv_lib_mysqlclient_mysql_ssl_set=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_mysqlclient_mysql_ssl_set" >&5 +-echo "${ECHO_T}$ac_cv_lib_mysqlclient_mysql_ssl_set" >&6; } +-if test $ac_cv_lib_mysqlclient_mysql_ssl_set = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_ssl_set" >&5 ++$as_echo "$ac_cv_lib_mysqlclient_mysql_ssl_set" >&6; } ++if test "x$ac_cv_lib_mysqlclient_mysql_ssl_set" = x""yes; then : + + cat >>confdefs.h <<_ACEOF + #define HAVE_MYSQL_SSL 1 + _ACEOF + + else +- { echo "$as_me:$LINENO: mysqlclient has no ssl support" >&5 +-echo "$as_me: mysqlclient has no ssl support" >&6;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: mysqlclient has no ssl support" >&5 ++$as_echo "$as_me: mysqlclient has no ssl support" >&6;} + fi + + fi +@@ -14122,138 +12612,9 @@ + OLDCPPFLAGS="$CPPFLAGS" + CFLAGS="$CFLAGS -I/usr/include/libprelude/" + CPPFLAGS="$CFLAGS -I/usr/include/libprelude/" +- if test "${ac_cv_header_prelude_h+set}" = set; then +- { echo "$as_me:$LINENO: checking for prelude.h" >&5 +-echo $ECHO_N "checking for prelude.h... $ECHO_C" >&6; } +-if test "${ac_cv_header_prelude_h+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-fi +-{ echo "$as_me:$LINENO: result: $ac_cv_header_prelude_h" >&5 +-echo "${ECHO_T}$ac_cv_header_prelude_h" >&6; } +-else +- # Is the header compilable? +-{ echo "$as_me:$LINENO: checking prelude.h usability" >&5 +-echo $ECHO_N "checking prelude.h usability... $ECHO_C" >&6; } +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-$ac_includes_default +-#include +-_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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then +- ac_header_compiler=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 ++ ac_fn_c_check_header_mongrel "$LINENO" "prelude.h" "ac_cv_header_prelude_h" "$ac_includes_default" ++if test "x$ac_cv_header_prelude_h" = x""yes; then : + +- ac_header_compiler=no +-fi +- +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +-echo "${ECHO_T}$ac_header_compiler" >&6; } +- +-# Is the header present? +-{ echo "$as_me:$LINENO: checking prelude.h presence" >&5 +-echo $ECHO_N "checking prelude.h presence... $ECHO_C" >&6; } +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include +-_ACEOF +-if { (ac_try="$ac_cpp conftest.$ac_ext" +-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_cpp conftest.$ac_ext") 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 +- (exit $ac_status); } >/dev/null && { +- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || +- test ! -s conftest.err +- }; then +- ac_header_preproc=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_header_preproc=no +-fi +- +-rm -f conftest.err conftest.$ac_ext +-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +-echo "${ECHO_T}$ac_header_preproc" >&6; } +- +-# So? What about this header? +-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in +- yes:no: ) +- { echo "$as_me:$LINENO: WARNING: prelude.h: accepted by the compiler, rejected by the preprocessor!" >&5 +-echo "$as_me: WARNING: prelude.h: accepted by the compiler, rejected by the preprocessor!" >&2;} +- { echo "$as_me:$LINENO: WARNING: prelude.h: proceeding with the compiler's result" >&5 +-echo "$as_me: WARNING: prelude.h: proceeding with the compiler's result" >&2;} +- ac_header_preproc=yes +- ;; +- no:yes:* ) +- { echo "$as_me:$LINENO: WARNING: prelude.h: present but cannot be compiled" >&5 +-echo "$as_me: WARNING: prelude.h: present but cannot be compiled" >&2;} +- { echo "$as_me:$LINENO: WARNING: prelude.h: check for missing prerequisite headers?" >&5 +-echo "$as_me: WARNING: prelude.h: check for missing prerequisite headers?" >&2;} +- { echo "$as_me:$LINENO: WARNING: prelude.h: see the Autoconf documentation" >&5 +-echo "$as_me: WARNING: prelude.h: see the Autoconf documentation" >&2;} +- { echo "$as_me:$LINENO: WARNING: prelude.h: section \"Present But Cannot Be Compiled\"" >&5 +-echo "$as_me: WARNING: prelude.h: section \"Present But Cannot Be Compiled\"" >&2;} +- { echo "$as_me:$LINENO: WARNING: prelude.h: proceeding with the preprocessor's result" >&5 +-echo "$as_me: WARNING: prelude.h: proceeding with the preprocessor's result" >&2;} +- { echo "$as_me:$LINENO: WARNING: prelude.h: in the future, the compiler will take precedence" >&5 +-echo "$as_me: WARNING: prelude.h: in the future, the compiler will take precedence" >&2;} +- ( cat <<\_ASBOX +-## ------------------------------------ ## +-## Report this to nufw-devel@nongnu.org ## +-## ------------------------------------ ## +-_ASBOX +- ) | sed "s/^/$as_me: WARNING: /" >&2 +- ;; +-esac +-{ echo "$as_me:$LINENO: checking for prelude.h" >&5 +-echo $ECHO_N "checking for prelude.h... $ECHO_C" >&6; } +-if test "${ac_cv_header_prelude_h+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- ac_cv_header_prelude_h=$ac_header_preproc +-fi +-{ echo "$as_me:$LINENO: result: $ac_cv_header_prelude_h" >&5 +-echo "${ECHO_T}$ac_cv_header_prelude_h" >&6; } +- +-fi +-if test $ac_cv_header_prelude_h = yes; then +- : + else + check_prelude=no + fi +@@ -14261,18 +12622,14 @@ + + + # Check for prelude_init() function libprelude.so +- { echo "$as_me:$LINENO: checking for prelude_init in -lprelude" >&5 +-echo $ECHO_N "checking for prelude_init in -lprelude... $ECHO_C" >&6; } +-if test "${ac_cv_lib_prelude_prelude_init+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prelude_init in -lprelude" >&5 ++$as_echo_n "checking for prelude_init in -lprelude... " >&6; } ++if test "${ac_cv_lib_prelude_prelude_init+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lprelude $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -14290,43 +12647,20 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_prelude_prelude_init=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_prelude_prelude_init=no ++ ac_cv_lib_prelude_prelude_init=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_prelude_prelude_init" >&5 +-echo "${ECHO_T}$ac_cv_lib_prelude_prelude_init" >&6; } +-if test $ac_cv_lib_prelude_prelude_init = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_prelude_prelude_init" >&5 ++$as_echo "$ac_cv_lib_prelude_prelude_init" >&6; } ++if test "x$ac_cv_lib_prelude_prelude_init" = x""yes; then : + +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_LIBRARY_PRELUDE 1 +-_ACEOF ++$as_echo "#define HAVE_LIBRARY_PRELUDE 1" >>confdefs.h + + else + check_prelude=no +@@ -14337,18 +12671,14 @@ + fi + + if test "$enable_pgsql_log" = "yes"; then +- { echo "$as_me:$LINENO: checking for PQconnectdb in -lpq" >&5 +-echo $ECHO_N "checking for PQconnectdb in -lpq... $ECHO_C" >&6; } +-if test "${ac_cv_lib_pq_PQconnectdb+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQconnectdb in -lpq" >&5 ++$as_echo_n "checking for PQconnectdb in -lpq... " >&6; } ++if test "${ac_cv_lib_pq_PQconnectdb+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lpq $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -14365,44 +12695,21 @@ + ; + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pq_PQconnectdb=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_pq_PQconnectdb=no ++ ac_cv_lib_pq_PQconnectdb=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQconnectdb" >&5 +-echo "${ECHO_T}$ac_cv_lib_pq_PQconnectdb" >&6; } +-if test $ac_cv_lib_pq_PQconnectdb = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQconnectdb" >&5 ++$as_echo "$ac_cv_lib_pq_PQconnectdb" >&6; } ++if test "x$ac_cv_lib_pq_PQconnectdb" = x""yes; then : + +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_LIBRARY_PQ 1 +-_ACEOF ++$as_echo "#define HAVE_LIBRARY_PQ 1" >>confdefs.h + + else + check_pgsql=no +@@ -14510,18 +12817,14 @@ + + + if test "${build_libnuclient}" = "yes"; then +- { echo "$as_me:$LINENO: checking for sasl_server_init in -lsasl2" >&5 +-echo $ECHO_N "checking for sasl_server_init in -lsasl2... $ECHO_C" >&6; } +-if test "${ac_cv_lib_sasl2_sasl_server_init+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sasl_server_init in -lsasl2" >&5 ++$as_echo_n "checking for sasl_server_init in -lsasl2... " >&6; } ++if test "${ac_cv_lib_sasl2_sasl_server_init+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lsasl2 $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -14539,43 +12842,20 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_sasl2_sasl_server_init=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_sasl2_sasl_server_init=no ++ ac_cv_lib_sasl2_sasl_server_init=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_sasl2_sasl_server_init" >&5 +-echo "${ECHO_T}$ac_cv_lib_sasl2_sasl_server_init" >&6; } +-if test $ac_cv_lib_sasl2_sasl_server_init = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sasl2_sasl_server_init" >&5 ++$as_echo "$ac_cv_lib_sasl2_sasl_server_init" >&6; } ++if test "x$ac_cv_lib_sasl2_sasl_server_init" = x""yes; then : + +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_LIBRARY_SASL2 1 +-_ACEOF ++$as_echo "#define HAVE_LIBRARY_SASL2 1" >>confdefs.h + + else + check_sasl=no +@@ -14586,18 +12866,14 @@ + if test "${build_nufw}" = "yes"; then + if test "${use_nfqueue}" = "yes"; then + # if we don't have we can't build nufw +- { echo "$as_me:$LINENO: checking for nfnl_open in -lnfnetlink" >&5 +-echo $ECHO_N "checking for nfnl_open in -lnfnetlink... $ECHO_C" >&6; } +-if test "${ac_cv_lib_nfnetlink_nfnl_open+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nfnl_open in -lnfnetlink" >&5 ++$as_echo_n "checking for nfnl_open in -lnfnetlink... " >&6; } ++if test "${ac_cv_lib_nfnetlink_nfnl_open+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lnfnetlink $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -14615,56 +12891,31 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nfnetlink_nfnl_open=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_nfnetlink_nfnl_open=no ++ ac_cv_lib_nfnetlink_nfnl_open=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_nfnetlink_nfnl_open" >&5 +-echo "${ECHO_T}$ac_cv_lib_nfnetlink_nfnl_open" >&6; } +-if test $ac_cv_lib_nfnetlink_nfnl_open = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nfnetlink_nfnl_open" >&5 ++$as_echo "$ac_cv_lib_nfnetlink_nfnl_open" >&6; } ++if test "x$ac_cv_lib_nfnetlink_nfnl_open" = x""yes; then : + have_nfqueue="yes" + else + build_nufw="" + fi + +- { echo "$as_me:$LINENO: checking for nfq_open in -lnetfilter_queue" >&5 +-echo $ECHO_N "checking for nfq_open in -lnetfilter_queue... $ECHO_C" >&6; } +-if test "${ac_cv_lib_netfilter_queue_nfq_open+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nfq_open in -lnetfilter_queue" >&5 ++$as_echo_n "checking for nfq_open in -lnetfilter_queue... " >&6; } ++if test "${ac_cv_lib_netfilter_queue_nfq_open+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lnetfilter_queue -lnfnetlink $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -14682,58 +12933,31 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_netfilter_queue_nfq_open=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_netfilter_queue_nfq_open=no ++ ac_cv_lib_netfilter_queue_nfq_open=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_netfilter_queue_nfq_open" >&5 +-echo "${ECHO_T}$ac_cv_lib_netfilter_queue_nfq_open" >&6; } +-if test $ac_cv_lib_netfilter_queue_nfq_open = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netfilter_queue_nfq_open" >&5 ++$as_echo "$ac_cv_lib_netfilter_queue_nfq_open" >&6; } ++if test "x$ac_cv_lib_netfilter_queue_nfq_open" = x""yes; then : + have_nfqueue="yes" + else +- { { echo "$as_me:$LINENO: error: libnetfilter_queue not present" >&5 +-echo "$as_me: error: libnetfilter_queue not present" >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "libnetfilter_queue not present" "$LINENO" 5 + fi + +- { echo "$as_me:$LINENO: checking for nfq_set_queue_maxlen in -lnetfilter_queue" >&5 +-echo $ECHO_N "checking for nfq_set_queue_maxlen in -lnetfilter_queue... $ECHO_C" >&6; } +-if test "${ac_cv_lib_netfilter_queue_nfq_set_queue_maxlen+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nfq_set_queue_maxlen in -lnetfilter_queue" >&5 ++$as_echo_n "checking for nfq_set_queue_maxlen in -lnetfilter_queue... " >&6; } ++if test "${ac_cv_lib_netfilter_queue_nfq_set_queue_maxlen+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lnetfilter_queue -lnfnetlink $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -14751,39 +12975,18 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_netfilter_queue_nfq_set_queue_maxlen=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_netfilter_queue_nfq_set_queue_maxlen=no ++ ac_cv_lib_netfilter_queue_nfq_set_queue_maxlen=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_netfilter_queue_nfq_set_queue_maxlen" >&5 +-echo "${ECHO_T}$ac_cv_lib_netfilter_queue_nfq_set_queue_maxlen" >&6; } +-if test $ac_cv_lib_netfilter_queue_nfq_set_queue_maxlen = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netfilter_queue_nfq_set_queue_maxlen" >&5 ++$as_echo "$ac_cv_lib_netfilter_queue_nfq_set_queue_maxlen" >&6; } ++if test "x$ac_cv_lib_netfilter_queue_nfq_set_queue_maxlen" = x""yes; then : + + cat >>confdefs.h <<_ACEOF + #define HAVE_NFQ_SET_QUEUE_MAXLEN 1 +@@ -14791,18 +12994,14 @@ + + fi + +- { echo "$as_me:$LINENO: checking for nlif_catch in -lnfnetlink" >&5 +-echo $ECHO_N "checking for nlif_catch in -lnfnetlink... $ECHO_C" >&6; } +-if test "${ac_cv_lib_nfnetlink_nlif_catch+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nlif_catch in -lnfnetlink" >&5 ++$as_echo_n "checking for nlif_catch in -lnfnetlink... " >&6; } ++if test "${ac_cv_lib_nfnetlink_nlif_catch+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lnfnetlink $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -14820,51 +13019,26 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nfnetlink_nlif_catch=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_nfnetlink_nlif_catch=no ++ ac_cv_lib_nfnetlink_nlif_catch=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_nfnetlink_nlif_catch" >&5 +-echo "${ECHO_T}$ac_cv_lib_nfnetlink_nlif_catch" >&6; } +-if test $ac_cv_lib_nfnetlink_nlif_catch = yes; then +- { echo "$as_me:$LINENO: checking for nfq_get_indev_name in -lnetfilter_queue" >&5 +-echo $ECHO_N "checking for nfq_get_indev_name in -lnetfilter_queue... $ECHO_C" >&6; } +-if test "${ac_cv_lib_netfilter_queue_nfq_get_indev_name+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nfnetlink_nlif_catch" >&5 ++$as_echo "$ac_cv_lib_nfnetlink_nlif_catch" >&6; } ++if test "x$ac_cv_lib_nfnetlink_nlif_catch" = x""yes; then : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nfq_get_indev_name in -lnetfilter_queue" >&5 ++$as_echo_n "checking for nfq_get_indev_name in -lnetfilter_queue... " >&6; } ++if test "${ac_cv_lib_netfilter_queue_nfq_get_indev_name+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lnetfilter_queue -lnfnetlink $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -14882,47 +13056,26 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_netfilter_queue_nfq_get_indev_name=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_netfilter_queue_nfq_get_indev_name=no ++ ac_cv_lib_netfilter_queue_nfq_get_indev_name=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_netfilter_queue_nfq_get_indev_name" >&5 +-echo "${ECHO_T}$ac_cv_lib_netfilter_queue_nfq_get_indev_name" >&6; } +-if test $ac_cv_lib_netfilter_queue_nfq_get_indev_name = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netfilter_queue_nfq_get_indev_name" >&5 ++$as_echo "$ac_cv_lib_netfilter_queue_nfq_get_indev_name" >&6; } ++if test "x$ac_cv_lib_netfilter_queue_nfq_get_indev_name" = x""yes; then : + + cat >>confdefs.h <<_ACEOF + #define HAVE_NFQ_INDEV_NAME 1 + _ACEOF + + else +- { echo "$as_me:$LINENO: WARNING: \"Support of interface resolution in nfnetlink but not in netfilter_queue\"" >&5 +-echo "$as_me: WARNING: \"Support of interface resolution in nfnetlink but not in netfilter_queue\"" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Support of interface resolution in nfnetlink but not in netfilter_queue\"" >&5 ++$as_echo "$as_me: WARNING: \"Support of interface resolution in nfnetlink but not in netfilter_queue\"" >&2;} + fi + + +@@ -14934,146 +13087,14 @@ + _ACEOF + + else +- +- +-for ac_header in libipq/libipq.h libipq.h +-do +-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +- { echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-fi +-ac_res=`eval echo '${'$as_ac_Header'}'` +- { echo "$as_me:$LINENO: result: $ac_res" >&5 +-echo "${ECHO_T}$ac_res" >&6; } +-else +- # Is the header compilable? +-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-$ac_includes_default +-#include <$ac_header> +-_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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then +- ac_header_compiler=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_header_compiler=no +-fi +- +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +-echo "${ECHO_T}$ac_header_compiler" >&6; } +- +-# Is the header present? +-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include <$ac_header> +-_ACEOF +-if { (ac_try="$ac_cpp conftest.$ac_ext" +-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_cpp conftest.$ac_ext") 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 +- (exit $ac_status); } >/dev/null && { +- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || +- test ! -s conftest.err +- }; then +- ac_header_preproc=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_header_preproc=no +-fi +- +-rm -f conftest.err conftest.$ac_ext +-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +-echo "${ECHO_T}$ac_header_preproc" >&6; } +- +-# So? What about this header? +-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in +- yes:no: ) +- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} +- ac_header_preproc=yes +- ;; +- no:yes:* ) +- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +- ( cat <<\_ASBOX +-## ------------------------------------ ## +-## Report this to nufw-devel@nongnu.org ## +-## ------------------------------------ ## +-_ASBOX +- ) | sed "s/^/$as_me: WARNING: /" >&2 +- ;; +-esac +-{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- eval "$as_ac_Header=\$ac_header_preproc" +-fi +-ac_res=`eval echo '${'$as_ac_Header'}'` +- { echo "$as_me:$LINENO: result: $ac_res" >&5 +-echo "${ECHO_T}$ac_res" >&6; } +- +-fi +-if test `eval echo '${'$as_ac_Header'}'` = yes; then ++ for ac_header in libipq/libipq.h libipq.h ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + _ACEOF + + fi +@@ -15081,18 +13102,14 @@ + done + + # if we don't have we can't build nufw +- { echo "$as_me:$LINENO: checking for ipq_message_type in -lipq" >&5 +-echo $ECHO_N "checking for ipq_message_type in -lipq... $ECHO_C" >&6; } +-if test "${ac_cv_lib_ipq_ipq_message_type+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ipq_message_type in -lipq" >&5 ++$as_echo_n "checking for ipq_message_type in -lipq... " >&6; } ++if test "${ac_cv_lib_ipq_ipq_message_type+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lipq $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -15110,39 +13127,18 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ipq_ipq_message_type=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_ipq_ipq_message_type=no ++ ac_cv_lib_ipq_ipq_message_type=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_ipq_ipq_message_type" >&5 +-echo "${ECHO_T}$ac_cv_lib_ipq_ipq_message_type" >&6; } +-if test $ac_cv_lib_ipq_ipq_message_type = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipq_ipq_message_type" >&5 ++$as_echo "$ac_cv_lib_ipq_ipq_message_type" >&6; } ++if test "x$ac_cv_lib_ipq_ipq_message_type" = x""yes; then : + have_ipq="yes" + else + build_nufw="" +@@ -15153,7 +13149,7 @@ + # check if we have a version of libipq supporting mark + + # Check whether --with-user-mark was given. +-if test "${with_user_mark+set}" = set; then ++if test "${with_user_mark+set}" = set; then : + withval=$with_user_mark; enable_user_mark="yes" + else + enable_user_mark="" +@@ -15161,18 +13157,14 @@ + + + if test "$enable_user_mark" = "yes"; then +- { echo "$as_me:$LINENO: checking for ipq_set_vwmark in -lipq" >&5 +-echo $ECHO_N "checking for ipq_set_vwmark in -lipq... $ECHO_C" >&6; } +-if test "${ac_cv_lib_ipq_ipq_set_vwmark+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ipq_set_vwmark in -lipq" >&5 ++$as_echo_n "checking for ipq_set_vwmark in -lipq... " >&6; } ++if test "${ac_cv_lib_ipq_ipq_set_vwmark+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lipq $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -15190,47 +13182,26 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ipq_ipq_set_vwmark=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_ipq_ipq_set_vwmark=no ++ ac_cv_lib_ipq_ipq_set_vwmark=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_ipq_ipq_set_vwmark" >&5 +-echo "${ECHO_T}$ac_cv_lib_ipq_ipq_set_vwmark" >&6; } +-if test $ac_cv_lib_ipq_ipq_set_vwmark = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipq_ipq_set_vwmark" >&5 ++$as_echo "$ac_cv_lib_ipq_ipq_set_vwmark" >&6; } ++if test "x$ac_cv_lib_ipq_ipq_set_vwmark" = x""yes; then : + + cat >>confdefs.h <<_ACEOF + #define HAVE_LIBIPQ_MARK 1 + _ACEOF + + else +- { echo "$as_me:$LINENO: result: libipq has no support for mark" >&5 +-echo "${ECHO_T}libipq has no support for mark" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: libipq has no support for mark" >&5 ++$as_echo "libipq has no support for mark" >&6; } + fi + + fi +@@ -15239,18 +13210,14 @@ + fi + + if test "${use_nfconntrack}" = "yes"; then +- { echo "$as_me:$LINENO: checking for nfct_dump_conntrack_table in -lnetfilter_conntrack" >&5 +-echo $ECHO_N "checking for nfct_dump_conntrack_table in -lnetfilter_conntrack... $ECHO_C" >&6; } +-if test "${ac_cv_lib_netfilter_conntrack_nfct_dump_conntrack_table+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nfct_dump_conntrack_table in -lnetfilter_conntrack" >&5 ++$as_echo_n "checking for nfct_dump_conntrack_table in -lnetfilter_conntrack... " >&6; } ++if test "${ac_cv_lib_netfilter_conntrack_nfct_dump_conntrack_table+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lnetfilter_conntrack -ldl -lnfnetlink $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -15268,39 +13235,18 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_netfilter_conntrack_nfct_dump_conntrack_table=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_netfilter_conntrack_nfct_dump_conntrack_table=no ++ ac_cv_lib_netfilter_conntrack_nfct_dump_conntrack_table=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_netfilter_conntrack_nfct_dump_conntrack_table" >&5 +-echo "${ECHO_T}$ac_cv_lib_netfilter_conntrack_nfct_dump_conntrack_table" >&6; } +-if test $ac_cv_lib_netfilter_conntrack_nfct_dump_conntrack_table = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netfilter_conntrack_nfct_dump_conntrack_table" >&5 ++$as_echo "$ac_cv_lib_netfilter_conntrack_nfct_dump_conntrack_table" >&6; } ++if test "x$ac_cv_lib_netfilter_conntrack_nfct_dump_conntrack_table" = x""yes; then : + have_conntrack="yes" + else + have_conntrack="" +@@ -15316,18 +13262,14 @@ + #define HAVE_LIBCONNTRACK 1 + _ACEOF + +- { echo "$as_me:$LINENO: checking for nfct_callback_register in -lnetfilter_conntrack" >&5 +-echo $ECHO_N "checking for nfct_callback_register in -lnetfilter_conntrack... $ECHO_C" >&6; } +-if test "${ac_cv_lib_netfilter_conntrack_nfct_callback_register+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nfct_callback_register in -lnetfilter_conntrack" >&5 ++$as_echo_n "checking for nfct_callback_register in -lnetfilter_conntrack... " >&6; } ++if test "${ac_cv_lib_netfilter_conntrack_nfct_callback_register+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lnetfilter_conntrack -ldl -lnfnetlink $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -15345,39 +13287,18 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_netfilter_conntrack_nfct_callback_register=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_netfilter_conntrack_nfct_callback_register=no ++ ac_cv_lib_netfilter_conntrack_nfct_callback_register=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_netfilter_conntrack_nfct_callback_register" >&5 +-echo "${ECHO_T}$ac_cv_lib_netfilter_conntrack_nfct_callback_register" >&6; } +-if test $ac_cv_lib_netfilter_conntrack_nfct_callback_register = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netfilter_conntrack_nfct_callback_register" >&5 ++$as_echo "$ac_cv_lib_netfilter_conntrack_nfct_callback_register" >&6; } ++if test "x$ac_cv_lib_netfilter_conntrack_nfct_callback_register" = x""yes; then : + have_new_conntrack_api="yes" + else + have_new_conntrack_api="" +@@ -15401,18 +13322,14 @@ + + if test "${build_pam_nufw}" = "yes"; then + #AC_CHECK_LIB([pam], [pam_sm_authenticate],AC_DEFINE([HAVE_LIBRARY_PAM],[1],[Pam lib flag]), check_pam=no) +- { echo "$as_me:$LINENO: checking for pam_start in -lpam" >&5 +-echo $ECHO_N "checking for pam_start in -lpam... $ECHO_C" >&6; } +-if test "${ac_cv_lib_pam_pam_start+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5 ++$as_echo_n "checking for pam_start in -lpam... " >&6; } ++if test "${ac_cv_lib_pam_pam_start+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lpam $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + /* Override any GCC internal prototype to avoid an error. +@@ -15430,43 +13347,20 @@ + 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 "echo \"\$as_me:$LINENO: $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 +- (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 ++if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pam_pam_start=yes + else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_pam_pam_start=no ++ ac_cv_lib_pam_pam_start=no + fi +- +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +- conftest$ac_exeext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_pam_pam_start" >&5 +-echo "${ECHO_T}$ac_cv_lib_pam_pam_start" >&6; } +-if test $ac_cv_lib_pam_pam_start = yes; then ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5 ++$as_echo "$ac_cv_lib_pam_pam_start" >&6; } ++if test "x$ac_cv_lib_pam_pam_start" = x""yes; then : + +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_LIBRARY_PAM 1 +-_ACEOF ++$as_echo "#define HAVE_LIBRARY_PAM 1" >>confdefs.h + + else + check_pam=no +@@ -15566,14 +13460,14 @@ + + if test "x$GCC" = "xyes"; then + +- { echo "$as_me:$LINENO: checking gcc version" >&5 +-echo $ECHO_N "checking gcc version... $ECHO_C" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking gcc version" >&5 ++$as_echo_n "checking gcc version... " >&6; } + gccver=$($CC -dumpversion) + gccvermajor=$(echo $gccver | cut -d . -f1) + gccverminor=$(echo $gccver | cut -d . -f2) + gccvernum=$(expr $gccvermajor "*" 100 + $gccverminor) +- { echo "$as_me:$LINENO: result: $gccver" >&5 +-echo "${ECHO_T}$gccver" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gccver" >&5 ++$as_echo "$gccver" >&6; } + + CFLAGS="$CFLAGS -Wall" + +@@ -15611,44 +13505,42 @@ + -o x${check_gnutls} = xno \ + -o x${check_pam} = xno \ + ; then +- { echo "$as_me:$LINENO: result: " >&5 +-echo "${ECHO_T}" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 ++$as_echo "" >&6; } + if test x${check_pthread} = xno; then +- { echo "$as_me:$LINENO: result: ERROR: pthread library needed" >&5 +-echo "${ECHO_T}ERROR: pthread library needed" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ERROR: pthread library needed" >&5 ++$as_echo "ERROR: pthread library needed" >&6; } + fi + if test x${check_gcrypt} = xno; then +- { echo "$as_me:$LINENO: result: ERROR: gcrypt library needed for encryption" >&5 +-echo "${ECHO_T}ERROR: gcrypt library needed for encryption" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ERROR: gcrypt library needed for encryption" >&5 ++$as_echo "ERROR: gcrypt library needed for encryption" >&6; } + fi + if test x${check_pam} = xno; then +- { echo "$as_me:$LINENO: result: ERROR: PAM library needed for system authentication" >&5 +-echo "${ECHO_T}ERROR: PAM library needed for system authentication" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ERROR: PAM library needed for system authentication" >&5 ++$as_echo "ERROR: PAM library needed for system authentication" >&6; } + fi + if test x${check_gnutls} = xno; then +- { echo "$as_me:$LINENO: result: ERROR: gnutls library needed for encryption" >&5 +-echo "${ECHO_T}ERROR: gnutls library needed for encryption" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ERROR: gnutls library needed for encryption" >&5 ++$as_echo "ERROR: gnutls library needed for encryption" >&6; } + fi + if test x${check_ldap} = xno; then +- { echo "$as_me:$LINENO: result: ERROR: ldap library needed for authentication" >&5 +-echo "${ECHO_T}ERROR: ldap library needed for authentication" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ERROR: ldap library needed for authentication" >&5 ++$as_echo "ERROR: ldap library needed for authentication" >&6; } + fi + if test x${check_glib} = xno; then +- { echo "$as_me:$LINENO: result: ERROR: glib is required in order to compile nuauth" >&5 +-echo "${ECHO_T}ERROR: glib is required in order to compile nuauth" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ERROR: glib is required in order to compile nuauth" >&5 ++$as_echo "ERROR: glib is required in order to compile nuauth" >&6; } + fi + if test x${check_mysql} = xno; then +- { echo "$as_me:$LINENO: result: ERROR: mysqlclient library needed if selected" >&5 +-echo "${ECHO_T}ERROR: mysqlclient library needed if selected" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ERROR: mysqlclient library needed if selected" >&5 ++$as_echo "ERROR: mysqlclient library needed if selected" >&6; } + fi + if test x${check_prelude} = xno; then +- { echo "$as_me:$LINENO: result: ERROR: libprelude library needed if Prelude logging selected" >&5 +-echo "${ECHO_T}ERROR: libprelude library needed if Prelude logging selected" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ERROR: libprelude library needed if Prelude logging selected" >&5 ++$as_echo "ERROR: libprelude library needed if Prelude logging selected" >&6; } + fi + if test x${check_pgsql} = xno; then +- { { echo "$as_me:$LINENO: error: libpq library needed if PostgreSQL support selected" >&5 +-echo "$as_me: error: libpq library needed if PostgreSQL support selected" >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "libpq library needed if PostgreSQL support selected" "$LINENO" 5 + fi + exit 1 + fi +@@ -15660,16 +13552,16 @@ + -o "${build_pam_nufw}" = "yes" \ + ; then + if test x${check_sasl} = xno; then +- { echo "$as_me:$LINENO: result: ERROR: sasl library needed for authentication" >&5 +-echo "${ECHO_T}ERROR: sasl library needed for authentication" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ERROR: sasl library needed for authentication" >&5 ++$as_echo "ERROR: sasl library needed for authentication" >&6; } + exit 1 + fi + fi + + am__api_version='1.10' + +-{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 ++$as_echo_n "checking whether build environment is sane... " >&6; } + # Just in case + sleep 1 + echo timestamp > conftest.file +@@ -15692,11 +13584,8 @@ + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". +- { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +-alias in your environment" >&5 +-echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +-alias in your environment" >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "ls -t appears to fail. Make sure there is not a broken ++alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file +@@ -15705,26 +13594,20 @@ + # Ok. + : + else +- { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +-Check your system clock" >&5 +-echo "$as_me: error: newly created file is older than distributed files! +-Check your system clock" >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "newly created file is older than distributed files! ++Check your system clock" "$LINENO" 5 + fi +-{ echo "$as_me:$LINENO: result: yes" >&5 +-echo "${ECHO_T}yes" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } + test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" + # Use a double $ so make ignores it. + test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +-# Double any \ or $. echo might interpret backslashes. ++# Double any \ or $. + # By default was `s,x,x', remove it if useless. +-cat <<\_ACEOF >conftest.sed +-s/[\\$]/&&/g;s/;s,x,x,$// +-_ACEOF +-program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +-rm -f conftest.sed ++ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' ++program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + + # expand $ac_aux_dir to an absolute path + am_aux_dir=`cd $ac_aux_dir && pwd` +@@ -15735,22 +13618,22 @@ + am_missing_run="$MISSING --run " + else + am_missing_run= +- { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 ++$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + fi + +-{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +-echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 ++$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } + if test -z "$MKDIR_P"; then +- if test "${ac_cv_path_mkdir+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ if test "${ac_cv_path_mkdir+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_prog in mkdir gmkdir; do ++ for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( +@@ -15762,7 +13645,7 @@ + esac + done + done +-done ++ done + IFS=$as_save_IFS + + fi +@@ -15778,8 +13661,8 @@ + MKDIR_P="$ac_install_sh -d" + fi + fi +-{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +-echo "${ECHO_T}$MKDIR_P" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 ++$as_echo "$MKDIR_P" >&6; } + + mkdir_p="$MKDIR_P" + case $mkdir_p in +@@ -15791,10 +13674,10 @@ + 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; } +-if test "${ac_cv_prog_AWK+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_AWK+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +@@ -15804,36 +13687,37 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_AWK="$ac_prog" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + AWK=$ac_cv_prog_AWK + if test -n "$AWK"; then +- { echo "$as_me:$LINENO: result: $AWK" >&5 +-echo "${ECHO_T}$AWK" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 ++$as_echo "$AWK" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + + test -n "$AWK" && break + done + +-{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +-set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 ++$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } ++set x ${MAKE-make} ++ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` ++if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : ++ $as_echo_n "(cached) " >&6 + else + cat >conftest.make <<\_ACEOF + SHELL = /bin/sh +@@ -15850,12 +13734,12 @@ + rm -f conftest.make + fi + if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then +- { echo "$as_me:$LINENO: result: yes" >&5 +-echo "${ECHO_T}yes" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } + SET_MAKE= + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" + fi + +@@ -15880,8 +13764,8 @@ + .PHONY: am__doit + END + # If we don't find an include directive, just comment out the code. +-{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 ++$as_echo_n "checking for style of include used by $am_make... " >&6; } + am__include="#" + am__quote= + _am_result=none +@@ -15908,12 +13792,12 @@ + fi + + +-{ echo "$as_me:$LINENO: result: $_am_result" >&5 +-echo "${ECHO_T}$_am_result" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 ++$as_echo "$_am_result" >&6; } + rm -f confinc confmf + + # Check whether --enable-dependency-tracking was given. +-if test "${enable_dependency_tracking+set}" = set; then ++if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; + fi + +@@ -15936,9 +13820,7 @@ + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then +- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi + fi + +@@ -15992,10 +13874,10 @@ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. + set dummy ${ac_tool_prefix}strip; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_STRIP+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_STRIP+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +@@ -16005,25 +13887,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_STRIP="${ac_tool_prefix}strip" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + STRIP=$ac_cv_prog_STRIP + if test -n "$STRIP"; then +- { echo "$as_me:$LINENO: result: $STRIP" >&5 +-echo "${ECHO_T}$STRIP" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 ++$as_echo "$STRIP" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + +@@ -16032,10 +13914,10 @@ + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. + set dummy strip; ac_word=$2 +-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +@@ -16045,25 +13927,25 @@ + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; 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_STRIP="strip" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +-done ++ done + IFS=$as_save_IFS + + fi + fi + ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP + if test -n "$ac_ct_STRIP"; then +- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +-echo "${ECHO_T}$ac_ct_STRIP" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 ++$as_echo "$ac_ct_STRIP" >&6; } + else +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + fi + + if test "x$ac_ct_STRIP" = x; then +@@ -16071,12 +13953,8 @@ + 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:${as_lineno-$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 + STRIP=$ac_ct_STRIP +@@ -16101,10 +13979,10 @@ + + depcc="$CC" am_compiler_list= + +-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 ++$as_echo_n "checking dependency style of $depcc... " >&6; } ++if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : ++ $as_echo_n "(cached) " >&6 + else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up +@@ -16192,8 +14070,8 @@ + fi + + fi +-{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 ++$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } + CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if +@@ -16236,12 +14114,13 @@ + 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:${as_lineno-$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) ;; #( +- *) $as_unset $ac_var ;; ++ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( ++ *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done +@@ -16249,8 +14128,8 @@ + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) +- # `set' does not quote correctly, so add quotes (double-quote +- # substitution turns \\\\ into \\, and sed turns \\ into \). ++ # `set' does not quote correctly, so add quotes: double-quote ++ # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" +@@ -16273,12 +14152,12 @@ + 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:${as_lineno-$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:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 ++$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi + fi + rm -f confcache +@@ -16294,199 +14173,127 @@ + 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" +- ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' ++ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" ++ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' + done + LIBOBJS=$ac_libobjs + + LTLIBOBJS=$ac_ltlibobjs + + ++ + if test -z "${USE_SYSTEM_AUTH_TRUE}" && test -z "${USE_SYSTEM_AUTH_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"USE_SYSTEM_AUTH\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"USE_SYSTEM_AUTH\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"USE_SYSTEM_AUTH\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${USE_LDAP_TRUE}" && test -z "${USE_LDAP_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"USE_LDAP\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"USE_LDAP\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"USE_LDAP\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${USE_PRELUDE_LOG_TRUE}" && test -z "${USE_PRELUDE_LOG_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"USE_PRELUDE_LOG\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"USE_PRELUDE_LOG\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"USE_PRELUDE_LOG\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${USE_MYSQL_LOG_TRUE}" && test -z "${USE_MYSQL_LOG_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"USE_MYSQL_LOG\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"USE_MYSQL_LOG\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"USE_MYSQL_LOG\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${USE_MYSQL_AUTH_TRUE}" && test -z "${USE_MYSQL_AUTH_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"USE_MYSQL_AUTH\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"USE_MYSQL_AUTH\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"USE_MYSQL_AUTH\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${HAVE_MYSQL_CONFIG_TRUE}" && test -z "${HAVE_MYSQL_CONFIG_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"HAVE_MYSQL_CONFIG\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"HAVE_MYSQL_CONFIG\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"HAVE_MYSQL_CONFIG\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${USE_PGSQL_LOG_TRUE}" && test -z "${USE_PGSQL_LOG_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"USE_PGSQL_LOG\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"USE_PGSQL_LOG\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"USE_PGSQL_LOG\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${USE_PLAINTEXT_AUTH_TRUE}" && test -z "${USE_PLAINTEXT_AUTH_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"USE_PLAINTEXT_AUTH\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"USE_PLAINTEXT_AUTH\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"USE_PLAINTEXT_AUTH\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${USE_MARK_GROUP_TRUE}" && test -z "${USE_MARK_GROUP_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"USE_MARK_GROUP\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"USE_MARK_GROUP\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"USE_MARK_GROUP\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${USE_MARK_FIELD_TRUE}" && test -z "${USE_MARK_FIELD_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"USE_MARK_FIELD\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"USE_MARK_FIELD\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"USE_MARK_FIELD\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${USE_MARK_FLAG_TRUE}" && test -z "${USE_MARK_FLAG_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"USE_MARK_FLAG\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"USE_MARK_FLAG\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"USE_MARK_FLAG\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${USE_SYSLOG_LOG_TRUE}" && test -z "${USE_SYSLOG_LOG_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"USE_SYSLOG_LOG\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"USE_SYSLOG_LOG\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"USE_SYSLOG_LOG\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${BUILD_NUFW_TRUE}" && test -z "${BUILD_NUFW_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"BUILD_NUFW\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"BUILD_NUFW\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"BUILD_NUFW\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${BUILD_NUAUTH_TRUE}" && test -z "${BUILD_NUAUTH_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"BUILD_NUAUTH\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"BUILD_NUAUTH\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"BUILD_NUAUTH\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${BUILD_NUTCPC_TRUE}" && test -z "${BUILD_NUTCPC_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"BUILD_NUTCPC\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"BUILD_NUTCPC\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"BUILD_NUTCPC\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${BUILD_LIBNUCLIENT_TRUE}" && test -z "${BUILD_LIBNUCLIENT_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"BUILD_LIBNUCLIENT\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"BUILD_LIBNUCLIENT\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"BUILD_LIBNUCLIENT\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${BUILD_PAM_NUFW_TRUE}" && test -z "${BUILD_PAM_NUFW_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"BUILD_PAM_NUFW\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"BUILD_PAM_NUFW\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"BUILD_PAM_NUFW\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${BUILD_NUAUTH_COMMAND_TRUE}" && test -z "${BUILD_NUAUTH_COMMAND_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"BUILD_NUAUTH_COMMAND\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"BUILD_NUAUTH_COMMAND\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"BUILD_NUAUTH_COMMAND\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${HAVE_IPQ_TRUE}" && test -z "${HAVE_IPQ_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"HAVE_IPQ\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"HAVE_IPQ\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"HAVE_IPQ\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${USE_USER_MARK_TRUE}" && test -z "${USE_USER_MARK_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"USE_USER_MARK\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"USE_USER_MARK\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"USE_USER_MARK\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${HAVE_NFQUEUE_ONLY_TRUE}" && test -z "${HAVE_NFQUEUE_ONLY_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"HAVE_NFQUEUE_ONLY\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"HAVE_NFQUEUE_ONLY\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"HAVE_NFQUEUE_ONLY\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${HAVE_NFQUEUE_CONNTRACK_TRUE}" && test -z "${HAVE_NFQUEUE_CONNTRACK_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"HAVE_NFQUEUE_CONNTRACK\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"HAVE_NFQUEUE_CONNTRACK\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"HAVE_NFQUEUE_CONNTRACK\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${HAVE_CONNTRACK_ONLY_TRUE}" && test -z "${HAVE_CONNTRACK_ONLY_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"HAVE_CONNTRACK_ONLY\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"HAVE_CONNTRACK_ONLY\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"HAVE_CONNTRACK_ONLY\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"AMDEP\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"AMDEP\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then +- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +-Usually this means the macro was only invoked conditionally." >&5 +-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +-Usually this means the macro was only invoked conditionally." >&2;} +- { (exit 1); exit 1; }; } ++ as_fn_error "conditional \"am__fastdepCC\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi + + : ${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:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 ++$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} ++as_write_fail=0 ++cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 + #! $SHELL + # Generated by $as_me. + # Run this file to recreate the current configuration. +@@ -16496,59 +14303,79 @@ + debug=false + ac_cs_recheck=false + ac_cs_silent=false +-SHELL=\${CONFIG_SHELL-$SHELL} +-_ACEOF + +-cat >>$CONFIG_STATUS <<\_ACEOF +-## --------------------- ## +-## M4sh Initialization. ## +-## --------------------- ## ++SHELL=\${CONFIG_SHELL-$SHELL} ++export SHELL ++_ASEOF ++cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ++## -------------------- ## ++## M4sh Initialization. ## ++## -------------------- ## + + # Be more Bourne compatible + DUALCASE=1; export DUALCASE # for MKS sh +-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then ++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 + else +- case `(set -o) 2>/dev/null` in +- *posix*) set -o posix ;; ++ case `(set -o) 2>/dev/null` in #( ++ *posix*) : ++ set -o posix ;; #( ++ *) : ++ ;; + esac +- + fi + + +- +- +-# PATH needs CR +-# Avoid depending upon Character Ranges. +-as_cr_letters='abcdefghijklmnopqrstuvwxyz' +-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +-as_cr_Letters=$as_cr_letters$as_cr_LETTERS +-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 ++# Prefer a ksh shell builtin over an external printf program on Solaris, ++# but without wasting forks for bash or zsh. ++if test -z "$BASH_VERSION$ZSH_VERSION" \ ++ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then ++ as_echo='print -r --' ++ as_echo_n='print -rn --' ++elif (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 + +-# Support unset when possible. +-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +- as_unset=unset +-else +- as_unset=false ++# 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 + + +@@ -16557,20 +14384,18 @@ + # 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. +-case $0 in ++case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. +- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +-done ++ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break ++ done + IFS=$as_save_IFS + + ;; +@@ -16581,32 +14406,111 @@ + as_myself=$0 + fi + if test ! -f "$as_myself"; then +- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 +- { (exit 1); exit 1; } ++ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 ++ exit 1 + fi + +-# Work around bugs in pre-3.0 UWIN ksh. +-for as_var in ENV MAIL MAILPATH +-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var ++# Unset variables that we do not need and which cause bugs (e.g. in ++# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" ++# suppresses any "Segmentation fault" message there. '((' could ++# trigger a bug in pdksh 5.2.14. ++for as_var in BASH_ENV ENV MAIL MAILPATH ++do eval test x\${$as_var+set} = xset \ ++ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : + done + PS1='$ ' + 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 ++# NLS nuisances. ++LC_ALL=C ++export LC_ALL ++LANGUAGE=C ++export LANGUAGE ++ ++# CDPATH. ++(unset CDPATH) >/dev/null 2>&1 && unset CDPATH ++ ++ ++# as_fn_error ERROR [LINENO LOG_FD] ++# --------------------------------- ++# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are ++# provided, also output the error to LOG_FD, referencing LINENO. Then exit the ++# script with status $?, using 1 if that was 0. ++as_fn_error () ++{ ++ as_status=$?; test $as_status -eq 0 && as_status=1 ++ if test "$3"; then ++ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 ++ fi ++ $as_echo "$as_me: error: $1" >&2 ++ as_fn_exit $as_status ++} # as_fn_error ++ ++ ++# as_fn_set_status STATUS ++# ----------------------- ++# Set $? to STATUS, without forking. ++as_fn_set_status () ++{ ++ return $1 ++} # as_fn_set_status ++ ++# as_fn_exit STATUS ++# ----------------- ++# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. ++as_fn_exit () ++{ ++ set +e ++ as_fn_set_status $1 ++ exit $1 ++} # as_fn_exit ++ ++# as_fn_unset VAR ++# --------------- ++# Portably unset VAR. ++as_fn_unset () ++{ ++ { eval $1=; unset $1;} ++} ++as_unset=as_fn_unset ++# as_fn_append VAR VALUE ++# ---------------------- ++# Append the text in VALUE to the end of the definition contained in VAR. Take ++# advantage of any shell optimizations that allow amortized linear growth over ++# repeated appends, instead of the typical quadratic growth present in naive ++# implementations. ++if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : ++ eval 'as_fn_append () ++ { ++ eval $1+=\$2 ++ }' ++else ++ as_fn_append () ++ { ++ eval $1=\$$1\$2 ++ } ++fi # as_fn_append ++ ++# as_fn_arith ARG... ++# ------------------ ++# Perform arithmetic evaluation on the ARGs, and store the result in the ++# global $as_val. Take advantage of shells that can avoid forks. The arguments ++# must be portable across $(()) and expr. ++if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : ++ eval 'as_fn_arith () ++ { ++ as_val=$(( $* )) ++ }' ++else ++ as_fn_arith () ++ { ++ as_val=`expr "$@" || test $? -eq 1` ++ } ++fi # as_fn_arith ++ + +-# Required to use basename. + if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +@@ -16620,13 +14524,17 @@ + as_basename=false + fi + ++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then ++ as_dirname=dirname ++else ++ as_dirname=false ++fi + +-# Name of the executable. + 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 +@@ -16641,104 +14549,103 @@ + } + s/.*/./; q'` + +-# CDPATH. +-$as_unset CDPATH +- +- +- +- as_lineno_1=$LINENO +- as_lineno_2=$LINENO +- test "x$as_lineno_1" != "x$as_lineno_2" && +- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { +- +- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO +- # uniformly replaced by the line number. The first 'sed' inserts a +- # line-number line after each line using $LINENO; the second 'sed' +- # does the real work. The second script uses 'N' to pair each +- # line-number line with the line containing $LINENO, and appends +- # trailing '-' during substitution so that $LINENO is not a special +- # case at line end. +- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the +- # scripts with optimization help from Paolo Bonzini. Blame Lee +- # E. McMahon (1931-1989) for sed's syntax. :-) +- sed -n ' +- p +- /[$]LINENO/= +- ' <$as_myself | +- sed ' +- s/[$]LINENO.*/&-/ +- t lineno +- b +- :lineno +- N +- :loop +- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ +- t loop +- 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 +- { (exit 1); exit 1; }; } +- +- # Don't try to exec as it changes $[0], causing all sort of problems +- # (the dirname of $[0] is not the place where we might find the +- # original and so on. Autoconf is especially sensitive to this). +- . "./$as_me.lineno" +- # Exit status is that of the last command. +- exit +-} +- +- +-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then +- as_dirname=dirname +-else +- as_dirname=false +-fi ++# Avoid depending upon Character Ranges. ++as_cr_letters='abcdefghijklmnopqrstuvwxyz' ++as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' ++as_cr_Letters=$as_cr_letters$as_cr_LETTERS ++as_cr_digits='0123456789' ++as_cr_alnum=$as_cr_Letters$as_cr_digits + + ECHO_C= ECHO_N= ECHO_T= +-case `echo -n x` in ++case `echo -n x` in #((((( + -n*) +- case `echo 'x\c'` in ++ case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. +- *) ECHO_C='\c';; ++ xy) ECHO_C='\c';; ++ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ++ ECHO_T=' ';; + esac;; + *) + ECHO_N='-n';; + esac + +-if expr a : '\(a\)' >/dev/null 2>&1 && +- test "X`expr 00001 : '.*\(...\)'`" = X001; then +- as_expr=expr +-else +- as_expr=false +-fi +- + rm -f conf$$ conf$$.exe conf$$.file + 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 + rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file + rmdir conf$$.dir 2>/dev/null + ++ ++# as_fn_mkdir_p ++# ------------- ++# Create "$as_dir" as a directory, including parents if necessary. ++as_fn_mkdir_p () ++{ ++ ++ case $as_dir in #( ++ -*) as_dir=./$as_dir;; ++ esac ++ test -d "$as_dir" || eval $as_mkdir_p || { ++ as_dirs= ++ while :; do ++ case $as_dir in #( ++ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( ++ *) as_qdir=$as_dir;; ++ esac ++ as_dirs="'$as_qdir' $as_dirs" ++ as_dir=`$as_dirname -- "$as_dir" || ++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ ++ X"$as_dir" : 'X\(//\)[^/]' \| \ ++ X"$as_dir" : 'X\(//\)$' \| \ ++ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || ++$as_echo X"$as_dir" | ++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\/\)[^/].*/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\/\)$/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\).*/{ ++ s//\1/ ++ q ++ } ++ s/.*/./; q'` ++ test -d "$as_dir" && break ++ done ++ test -z "$as_dirs" || eval "mkdir $as_dirs" ++ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" ++ ++ ++} # as_fn_mkdir_p + if mkdir -p . 2>/dev/null; then +- as_mkdir_p=: ++ as_mkdir_p='mkdir -p "$as_dir"' + else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +@@ -16755,12 +14662,12 @@ + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then +- test -d "$1/."; ++ test -d "$1/."; + else +- case $1 in +- -*)set "./$1";; ++ case $1 in #( ++ -*)set "./$1";; + esac; +- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ++ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +@@ -16775,13 +14682,19 @@ + + + exec 6>&1 ++## ----------------------------------- ## ++## Main body of $CONFIG_STATUS script. ## ++## ----------------------------------- ## ++_ASEOF ++test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +-# Save the log message, to keep $[0] and so on meaningful, and to ++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ++# Save the log message, to keep $0 and so on meaningful, and to + # report actual input values of CONFIG_FILES etc. instead of their + # values after options handling. + ac_log=" + This file was extended by NuFW $as_me 2.2.21, which was +-generated by GNU Autoconf 2.61. Invocation command line was ++generated by GNU Autoconf 2.64. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS +@@ -16794,7 +14707,16 @@ + + _ACEOF + +-cat >>$CONFIG_STATUS <<_ACEOF ++case $ac_config_files in *" ++"*) set x $ac_config_files; shift; ac_config_files=$*;; ++esac ++ ++case $ac_config_headers in *" ++"*) set x $ac_config_headers; shift; ac_config_headers=$*;; ++esac ++ ++ ++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + # Files that config.status was made for. + config_files="$ac_config_files" + config_headers="$ac_config_headers" +@@ -16802,22 +14724,24 @@ + + _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. ++\`$as_me' instantiates files and other configuration actions ++from templates according to the current configuration. Unless the files ++and actions are specified as TAGs, all are instantiated by default. + +-Usage: $0 [OPTIONS] [FILE]... ++Usage: $0 [OPTION]... [TAG]... + + -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 +- --header=FILE[:TEMPLATE] +- instantiate the configuration header FILE ++ --file=FILE[:TEMPLATE] ++ instantiate the configuration file FILE ++ --header=FILE[:TEMPLATE] ++ instantiate the configuration header FILE + + Configuration files: + $config_files +@@ -16828,16 +14752,16 @@ + Configuration commands: + $config_commands + +-Report bugs to ." ++Report bugs to ." + + _ACEOF +-cat >>$CONFIG_STATUS <<_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_cs_version="\\ + NuFW config.status 2.2.21 +-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.64, ++ with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +-Copyright (C) 2006 Free Software Foundation, Inc. ++Copyright (C) 2009 Free Software Foundation, Inc. + This config.status script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it." + +@@ -16845,11 +14769,12 @@ + srcdir='$srcdir' + INSTALL='$INSTALL' + MKDIR_P='$MKDIR_P' ++AWK='$AWK' ++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 +@@ -16871,34 +14796,38 @@ + -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 ++ as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift +- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ++ case $ac_optarg in ++ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; ++ esac ++ as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header +- { echo "$as_me: error: ambiguous option: $1 +-Try \`$0 --help' for more information." >&2 +- { (exit 1); exit 1; }; };; ++ as_fn_error "ambiguous option: \`$1' ++Try \`$0 --help' for more information.";; + --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 +-Try \`$0 --help' for more information." >&2 +- { (exit 1); exit 1; }; } ;; ++ -*) as_fn_error "unrecognized option: \`$1' ++Try \`$0 --help' for more information." ;; + +- *) ac_config_targets="$ac_config_targets $1" ++ *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac +@@ -16913,27 +14842,29 @@ + 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 + # + # INIT-COMMANDS + # +@@ -16974,6 +14905,7 @@ + lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' + reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' + reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' ++OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' + deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' + file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' + AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +@@ -17079,6 +15011,7 @@ + lt_SP2NL \ + lt_NL2SP \ + reload_flag \ ++OBJDUMP \ + deplibs_check_method \ + file_magic_cmd \ + AR \ +@@ -17194,7 +15127,7 @@ + + _ACEOF + +-cat >>$CONFIG_STATUS <<\_ACEOF ++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + + # Handling of arguments. + for ac_config_target in $ac_config_targets +@@ -17245,9 +15178,7 @@ + "tests/pki/Makefile") CONFIG_FILES="$CONFIG_FILES tests/pki/Makefile" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + +- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +-echo "$as_me: error: invalid argument: $ac_config_target" >&2;} +- { (exit 1); exit 1; }; };; ++ *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac + done + +@@ -17274,7 +15205,7 @@ + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + ' 0 +- trap '{ (exit 1); exit 1; }' 1 2 13 15 ++ trap 'as_fn_exit 1' 1 2 13 15 + } + # Create a (secure) tmp directory for tmp files. + +@@ -17285,272 +15216,139 @@ + { + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +-} || +-{ +- echo "$me: cannot create a temporary directory in ." >&2 +- { (exit 1); exit 1; } +-} +- +-# +-# Set up the sed scripts for CONFIG_FILES section. +-# ++} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 + +-# 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_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 +-LIBTOOL!$LIBTOOL$ac_delim +-build!$build$ac_delim +-build_cpu!$build_cpu$ac_delim +-build_vendor!$build_vendor$ac_delim +-build_os!$build_os$ac_delim +-host!$host$ac_delim +-host_cpu!$host_cpu$ac_delim +-host_vendor!$host_vendor$ac_delim +-host_os!$host_os$ac_delim +-SED!$SED$ac_delim +-GREP!$GREP$ac_delim +-EGREP!$EGREP$ac_delim +-FGREP!$FGREP$ac_delim +-LD!$LD$ac_delim +-DUMPBIN!$DUMPBIN$ac_delim +-ac_ct_DUMPBIN!$ac_ct_DUMPBIN$ac_delim +-NM!$NM$ac_delim +-LN_S!$LN_S$ac_delim +-AR!$AR$ac_delim +-STRIP!$STRIP$ac_delim +-RANLIB!$RANLIB$ac_delim +-lt_ECHO!$lt_ECHO$ac_delim +-DSYMUTIL!$DSYMUTIL$ac_delim +-NMEDIT!$NMEDIT$ac_delim +-LIPO!$LIPO$ac_delim +-OTOOL!$OTOOL$ac_delim +-OTOOL64!$OTOOL64$ac_delim +-CPP!$CPP$ac_delim +-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +-INSTALL_DATA!$INSTALL_DATA$ac_delim +-DOCBOOK2MAN!$DOCBOOK2MAN$ac_delim +-DOCBOOK2PDF!$DOCBOOK2PDF$ac_delim +-LIBOBJS!$LIBOBJS$ac_delim +-LIBGCRYPT_CONFIG!$LIBGCRYPT_CONFIG$ac_delim +-LIBGCRYPT_CFLAGS!$LIBGCRYPT_CFLAGS$ac_delim +-LIBGCRYPT_LIBS!$LIBGCRYPT_LIBS$ac_delim +-LIBGNUTLS_CONFIG!$LIBGNUTLS_CONFIG$ac_delim +-LIBGNUTLS_CFLAGS!$LIBGNUTLS_CFLAGS$ac_delim +-LIBGNUTLS_LIBS!$LIBGNUTLS_LIBS$ac_delim +-PYTHON!$PYTHON$ac_delim +-PKG_CONFIG!$PKG_CONFIG$ac_delim +-GLIB_CFLAGS!$GLIB_CFLAGS$ac_delim +-GLIB_LIBS!$GLIB_LIBS$ac_delim +-GLIB_GENMARSHAL!$GLIB_GENMARSHAL$ac_delim +-GOBJECT_QUERY!$GOBJECT_QUERY$ac_delim +-GLIB_MKENUMS!$GLIB_MKENUMS$ac_delim +-USE_SYSTEM_AUTH_TRUE!$USE_SYSTEM_AUTH_TRUE$ac_delim +-USE_SYSTEM_AUTH_FALSE!$USE_SYSTEM_AUTH_FALSE$ac_delim +-USE_LDAP_TRUE!$USE_LDAP_TRUE$ac_delim +-USE_LDAP_FALSE!$USE_LDAP_FALSE$ac_delim +-USE_PRELUDE_LOG_TRUE!$USE_PRELUDE_LOG_TRUE$ac_delim +-USE_PRELUDE_LOG_FALSE!$USE_PRELUDE_LOG_FALSE$ac_delim +-_ACEOF +- +- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; 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;} +- { (exit 1); exit 1; }; } +- else +- ac_delim="$ac_delim!$ac_delim _$ac_delim!! " +- fi +-done + +-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` ++ac_cr=`echo X | tr X '\015'` ++# On cygwin, bash can eat \r inside `` if the user requested igncr. ++# But we know of no other shell where ac_cr would be empty at this ++# point, so we can use a bashism as a fallback. ++if test "x$ac_cr" = x; then ++ eval ac_cr=\$\'\\r\' ++fi ++ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /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 + +-cat >>$CONFIG_STATUS <<_ACEOF +-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +-_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 >$CONFIG_STATUS <<_ACEOF +-CEOF$ac_eof ++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_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ++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 +-USE_MYSQL_LOG_TRUE!$USE_MYSQL_LOG_TRUE$ac_delim +-USE_MYSQL_LOG_FALSE!$USE_MYSQL_LOG_FALSE$ac_delim +-USE_MYSQL_AUTH_TRUE!$USE_MYSQL_AUTH_TRUE$ac_delim +-USE_MYSQL_AUTH_FALSE!$USE_MYSQL_AUTH_FALSE$ac_delim +-HAVE_MYSQL_CONFIG_TRUE!$HAVE_MYSQL_CONFIG_TRUE$ac_delim +-HAVE_MYSQL_CONFIG_FALSE!$HAVE_MYSQL_CONFIG_FALSE$ac_delim +-USE_PGSQL_LOG_TRUE!$USE_PGSQL_LOG_TRUE$ac_delim +-USE_PGSQL_LOG_FALSE!$USE_PGSQL_LOG_FALSE$ac_delim +-USE_PLAINTEXT_AUTH_TRUE!$USE_PLAINTEXT_AUTH_TRUE$ac_delim +-USE_PLAINTEXT_AUTH_FALSE!$USE_PLAINTEXT_AUTH_FALSE$ac_delim +-USE_MARK_GROUP_TRUE!$USE_MARK_GROUP_TRUE$ac_delim +-USE_MARK_GROUP_FALSE!$USE_MARK_GROUP_FALSE$ac_delim +-USE_MARK_FIELD_TRUE!$USE_MARK_FIELD_TRUE$ac_delim +-USE_MARK_FIELD_FALSE!$USE_MARK_FIELD_FALSE$ac_delim +-USE_MARK_FLAG_TRUE!$USE_MARK_FLAG_TRUE$ac_delim +-USE_MARK_FLAG_FALSE!$USE_MARK_FLAG_FALSE$ac_delim +-USE_SYSLOG_LOG_TRUE!$USE_SYSLOG_LOG_TRUE$ac_delim +-USE_SYSLOG_LOG_FALSE!$USE_SYSLOG_LOG_FALSE$ac_delim +-BUILD_NUFW_TRUE!$BUILD_NUFW_TRUE$ac_delim +-BUILD_NUFW_FALSE!$BUILD_NUFW_FALSE$ac_delim +-BUILD_NUAUTH_TRUE!$BUILD_NUAUTH_TRUE$ac_delim +-BUILD_NUAUTH_FALSE!$BUILD_NUAUTH_FALSE$ac_delim +-BUILD_NUTCPC_TRUE!$BUILD_NUTCPC_TRUE$ac_delim +-BUILD_NUTCPC_FALSE!$BUILD_NUTCPC_FALSE$ac_delim +-BUILD_LIBNUCLIENT_TRUE!$BUILD_LIBNUCLIENT_TRUE$ac_delim +-BUILD_LIBNUCLIENT_FALSE!$BUILD_LIBNUCLIENT_FALSE$ac_delim +-BUILD_PAM_NUFW_TRUE!$BUILD_PAM_NUFW_TRUE$ac_delim +-BUILD_PAM_NUFW_FALSE!$BUILD_PAM_NUFW_FALSE$ac_delim +-BUILD_NUAUTH_COMMAND_TRUE!$BUILD_NUAUTH_COMMAND_TRUE$ac_delim +-BUILD_NUAUTH_COMMAND_FALSE!$BUILD_NUAUTH_COMMAND_FALSE$ac_delim +-HAVE_IPQ_TRUE!$HAVE_IPQ_TRUE$ac_delim +-HAVE_IPQ_FALSE!$HAVE_IPQ_FALSE$ac_delim +-USE_USER_MARK_TRUE!$USE_USER_MARK_TRUE$ac_delim +-USE_USER_MARK_FALSE!$USE_USER_MARK_FALSE$ac_delim +-HAVE_NFQUEUE_ONLY_TRUE!$HAVE_NFQUEUE_ONLY_TRUE$ac_delim +-HAVE_NFQUEUE_ONLY_FALSE!$HAVE_NFQUEUE_ONLY_FALSE$ac_delim +-HAVE_NFQUEUE_CONNTRACK_TRUE!$HAVE_NFQUEUE_CONNTRACK_TRUE$ac_delim +-HAVE_NFQUEUE_CONNTRACK_FALSE!$HAVE_NFQUEUE_CONNTRACK_FALSE$ac_delim +-HAVE_CONNTRACK_ONLY_TRUE!$HAVE_CONNTRACK_ONLY_TRUE$ac_delim +-HAVE_CONNTRACK_ONLY_FALSE!$HAVE_CONNTRACK_ONLY_FALSE$ac_delim +-am__isrc!$am__isrc$ac_delim +-CYGPATH_W!$CYGPATH_W$ac_delim +-PACKAGE!$PACKAGE$ac_delim +-VERSION!$VERSION$ac_delim +-ACLOCAL!$ACLOCAL$ac_delim +-AUTOCONF!$AUTOCONF$ac_delim +-AUTOMAKE!$AUTOMAKE$ac_delim +-AUTOHEADER!$AUTOHEADER$ac_delim +-MAKEINFO!$MAKEINFO$ac_delim +-install_sh!$install_sh$ac_delim +-INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +-mkdir_p!$mkdir_p$ac_delim +-AWK!$AWK$ac_delim +-SET_MAKE!$SET_MAKE$ac_delim +-am__leading_dot!$am__leading_dot$ac_delim +-AMTAR!$AMTAR$ac_delim +-am__tar!$am__tar$ac_delim +-am__untar!$am__untar$ac_delim +-DEPDIR!$DEPDIR$ac_delim +-am__include!$am__include$ac_delim +-am__quote!$am__quote$ac_delim +-AMDEP_TRUE!$AMDEP_TRUE$ac_delim +-AMDEP_FALSE!$AMDEP_FALSE$ac_delim +-AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +-CCDEPMODE!$CCDEPMODE$ac_delim +-am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +-am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +-LTLIBOBJS!$LTLIBOBJS$ac_delim +-_ACEOF ++ . ./conf$$subs.sh || ++ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + +- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 68; 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;} +- { (exit 1); exit 1; }; } ++ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + 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-2.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 >$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 ++' >$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 = "" ++ ++} ++{ ++ 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_fn_error "could not setup config files machinery" "$LINENO" 5 ++_ACEOF + + # VPATH may cause trouble with some makes, so we remove $(srcdir), + # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +@@ -17567,20 +15365,128 @@ + }' + fi + +-cat >>$CONFIG_STATUS <<\_ACEOF ++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + fi # test -n "$CONFIG_FILES" + ++# Set up the scripts for CONFIG_HEADERS section. ++# No need to generate them if there are no CONFIG_HEADERS. ++# This happens for instance with `./config.status Makefile'. ++if test -n "$CONFIG_HEADERS"; then ++cat >"$tmp/defines.awk" <<\_ACAWK || ++BEGIN { ++_ACEOF ++ ++# Transform confdefs.h into an awk script `defines.awk', embedded as ++# here-document in config.status, that substitutes the proper values into ++# config.h.in to produce config.h. ++ ++# Create a delimiter string that does not exist in confdefs.h, to ease ++# handling of long lines. ++ac_delim='%!_!# ' ++for ac_last_try in false false :; do ++ ac_t=`sed -n "/$ac_delim/p" confdefs.h` ++ if test -z "$ac_t"; then ++ break ++ elif $ac_last_try; then ++ as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 ++ else ++ ac_delim="$ac_delim!$ac_delim _$ac_delim!! " ++ fi ++done ++ ++# For the awk script, D is an array of macro values keyed by name, ++# likewise P contains macro parameters if any. Preserve backslash ++# newline sequences. ++ ++ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* ++sed -n ' ++s/.\{148\}/&'"$ac_delim"'/g ++t rset ++:rset ++s/^[ ]*#[ ]*define[ ][ ]*/ / ++t def ++d ++:def ++s/\\$// ++t bsnl ++s/["\\]/\\&/g ++s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ ++D["\1"]=" \3"/p ++s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p ++d ++:bsnl ++s/["\\]/\\&/g ++s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ ++D["\1"]=" \3\\\\\\n"\\/p ++t cont ++s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p ++t cont ++d ++:cont ++n ++s/.\{148\}/&'"$ac_delim"'/g ++t clear ++:clear ++s/\\$// ++t bsnlc ++s/["\\]/\\&/g; s/^/"/; s/$/"/p ++d ++:bsnlc ++s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p ++b cont ++' >$CONFIG_STATUS || ac_write_fail=1 ++ ++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ++ for (key in D) D_is_set[key] = 1 ++ FS = "" ++} ++/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { ++ line = \$ 0 ++ split(line, arg, " ") ++ if (arg[1] == "#") { ++ defundef = arg[2] ++ mac1 = arg[3] ++ } else { ++ defundef = substr(arg[1], 2) ++ mac1 = arg[2] ++ } ++ split(mac1, mac2, "(") #) ++ macro = mac2[1] ++ prefix = substr(line, 1, index(line, defundef) - 1) ++ if (D_is_set[macro]) { ++ # Preserve the white space surrounding the "#". ++ print prefix "define", macro P[macro] D[macro] ++ next ++ } else { ++ # Replace #undef with comments. This is necessary, for example, ++ # in the case of _POSIX_SOURCE, which is predefined and required ++ # on some systems where configure will not decide to define it. ++ if (defundef == "undef") { ++ print "/*", prefix defundef, macro, "*/" ++ next ++ } ++ } ++} ++{ print } ++_ACAWK ++_ACEOF ++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ++ as_fn_error "could not setup config headers machinery" "$LINENO" 5 ++fi # test -n "$CONFIG_HEADERS" ++ + +-for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS ++eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" ++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;} +- { (exit 1); exit 1; }; };; ++ :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac +@@ -17608,26 +15514,34 @@ + [\\/$]*) 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;} +- { (exit 1); exit 1; }; };; ++ as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac +- ac_file_inputs="$ac_file_inputs $ac_f" ++ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ++ as_fn_append 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:${as_lineno-$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_fn_error "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac +@@ -17637,42 +15551,7 @@ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +-echo X"$ac_file" | +- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ +- s//\1/ +- q +- } +- /^X\(\/\/\)[^/].*/{ +- s//\1/ +- q +- } +- /^X\(\/\/\)$/{ +- s//\1/ +- q +- } +- /^X\(\/\).*/{ +- s//\1/ +- q +- } +- s/.*/./; q'` +- { as_dir="$ac_dir" +- case $as_dir in #( +- -*) as_dir=./$as_dir;; +- esac +- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { +- as_dirs= +- while :; do +- case $as_dir in #( +- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( +- *) as_qdir=$as_dir;; +- esac +- as_dirs="'$as_qdir' $as_dirs" +- as_dir=`$as_dirname -- "$as_dir" || +-$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"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q +@@ -17690,20 +15569,15 @@ + q + } + s/.*/./; q'` +- 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;} +- { (exit 1); exit 1; }; }; } ++ as_dir="$ac_dir"; as_fn_mkdir_p + 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/ ;; +@@ -17748,12 +15622,12 @@ + esac + _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 + } +@@ -17761,36 +15635,37 @@ + /@docdir@/p + /@infodir@/p + /@localedir@/p +-/@mandir@/p +-' $ac_file_inputs` in ++/@mandir@/p' ++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:${as_lineno-$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 + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g +- s&\\\${datarootdir}&$datarootdir&g' ;; ++ s&\\\${datarootdir}&$datarootdir&g' ;; + esac + _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 +@@ -17801,121 +15676,50 @@ + s&@INSTALL@&$ac_INSTALL&;t t + s&@MKDIR_P@&$ac_MKDIR_P&;t t + $ac_datarootdir_hack +-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out ++" ++eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ ++ || as_fn_error "could not create $ac_file" "$LINENO" 5 + + 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:${as_lineno-$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_fn_error "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # +-_ACEOF +- +-# Transform confdefs.h into a sed script `conftest.defines', that +-# substitutes the proper values into config.h.in to produce config.h. +-rm -f conftest.defines conftest.tail +-# First, append a space to every undef/define line, to ease matching. +-echo 's/$/ /' >conftest.defines +-# Then, protect against being on the right side of a sed subst, or in +-# an unquoted here document, in config.status. If some macros were +-# called several times there might be several #defines for the same +-# symbol, which is useless. But do not sort them, since the last +-# AC_DEFINE must be honored. +-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +-# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +-# NAME is the cpp macro being defined, VALUE is the value it is being given. +-# PARAMS is the parameter list in the macro definition--in most cases, it's +-# just an empty string. +-ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +-ac_dB='\\)[ (].*,\\1define\\2' +-ac_dC=' ' +-ac_dD=' ,' +- +-uniq confdefs.h | +- sed -n ' +- t rset +- :rset +- s/^[ ]*#[ ]*define[ ][ ]*// +- t ok +- d +- :ok +- s/[\\&,]/\\&/g +- s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p +- s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p +- ' >>conftest.defines +- +-# Remove the space that was appended to ease matching. +-# Then replace #undef with comments. This is necessary, for +-# example, in the case of _POSIX_SOURCE, which is predefined and required +-# on some systems where configure will not decide to define it. +-# (The regexp can be short, since the line contains either #define or #undef.) +-echo 's/ $// +-s,^[ #]*u.*,/* & */,' >>conftest.defines +- +-# Break up conftest.defines: +-ac_max_sed_lines=50 +- +-# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +-# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +-# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +-# et cetera. +-ac_in='$ac_file_inputs' +-ac_out='"$tmp/out1"' +-ac_nxt='"$tmp/out2"' +- +-while : +-do +- # Write a here document: +- cat >>$CONFIG_STATUS <<_ACEOF +- # First, check the format of the line: +- cat >"\$tmp/defines.sed" <<\\CEOF +-/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +-/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +-b +-:def +-_ACEOF +- sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS +- echo 'CEOF +- sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS +- ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in +- sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail +- grep . conftest.tail >/dev/null || break +- rm -f conftest.defines +- mv conftest.tail conftest.defines +-done +-rm -f conftest.defines conftest.tail +- +-echo "ac_result=$ac_in" >>$CONFIG_STATUS +-cat >>$CONFIG_STATUS <<\_ACEOF + if test x"$ac_file" != x-; then +- echo "/* $configure_input */" >"$tmp/config.h" +- cat "$ac_result" >>"$tmp/config.h" +- if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then +- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +-echo "$as_me: $ac_file is unchanged" >&6;} ++ { ++ $as_echo "/* $configure_input */" \ ++ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" ++ } >"$tmp/config.h" \ ++ || as_fn_error "could not create $ac_file" "$LINENO" 5 ++ if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 ++$as_echo "$as_me: $ac_file is unchanged" >&6;} + else +- rm -f $ac_file +- mv "$tmp/config.h" $ac_file ++ rm -f "$ac_file" ++ mv "$tmp/config.h" "$ac_file" \ ++ || as_fn_error "could not create $ac_file" "$LINENO" 5 + fi + else +- echo "/* $configure_input */" +- cat "$ac_result" ++ $as_echo "/* $configure_input */" \ ++ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ ++ || as_fn_error "could not create -" "$LINENO" 5 + fi +- rm -f "$tmp/out12" +-# Compute $ac_file's index in $config_headers. +-_am_arg=$ac_file ++# Compute "$ac_file"'s index in $config_headers. ++_am_arg="$ac_file" + _am_stamp_count=1 + for _am_header in $config_headers :; do + case $_am_header in +@@ -17930,7 +15734,7 @@ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +-echo X"$_am_arg" | ++$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q +@@ -17950,8 +15754,8 @@ + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + +- :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +-echo "$as_me: executing $ac_file commands" >&6;} ++ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 ++$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + +@@ -18079,6 +15883,9 @@ + reload_flag=$lt_reload_flag + reload_cmds=$lt_reload_cmds + ++# An object symbol dumper. ++OBJDUMP=$lt_OBJDUMP ++ + # Method to check whether dependent libraries are shared objects. + deplibs_check_method=$lt_deplibs_check_method + +@@ -18589,7 +16396,16 @@ + chmod +x "$ofile" + + ;; +- "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do ++ "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files ++# are listed without --file. Let's play safe and only enable the eval ++# if we detect the quoting. ++case $CONFIG_FILES in ++*\'*) eval set x "$CONFIG_FILES" ;; ++*) set x $CONFIG_FILES ;; ++esac ++shift ++for mf ++do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. +@@ -18605,7 +16421,7 @@ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +-echo X"$mf" | ++$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q +@@ -18649,42 +16465,7 @@ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +-echo X"$file" | +- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ +- s//\1/ +- q +- } +- /^X\(\/\/\)[^/].*/{ +- s//\1/ +- q +- } +- /^X\(\/\/\)$/{ +- s//\1/ +- q +- } +- /^X\(\/\).*/{ +- s//\1/ +- q +- } +- s/.*/./; q'` +- { as_dir=$dirpart/$fdir +- case $as_dir in #( +- -*) as_dir=./$as_dir;; +- esac +- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { +- as_dirs= +- while :; do +- case $as_dir in #( +- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( +- *) as_qdir=$as_dir;; +- esac +- as_dirs="'$as_qdir' $as_dirs" +- as_dir=`$as_dirname -- "$as_dir" || +-$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"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q +@@ -18702,12 +16483,7 @@ + q + } + s/.*/./; q'` +- 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;} +- { (exit 1); exit 1; }; }; } ++ as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +@@ -18718,11 +16494,13 @@ + done # for ac_tag + + +-{ (exit 0); exit 0; } ++as_fn_exit 0 + _ACEOF +-chmod +x $CONFIG_STATUS + ac_clean_files=$ac_clean_files_save + ++test $ac_write_fail = 0 || ++ as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 ++ + + # configure is writing to config.log, and then calls config.status. + # config.status does its own redirection, appending to config.log. +@@ -18742,129 +16520,133 @@ + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. +- $ac_cs_success || { (exit 1); exit 1; } ++ $ac_cs_success || as_fn_exit $? ++fi ++if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 ++$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + fi + +-{ echo "$as_me:$LINENO: result: ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: + + Configuration complete + " >&5 +-echo "${ECHO_T} ++$as_echo " + + Configuration complete + " >&6; } + + if test "$debug"; then +- { echo "$as_me:$LINENO: result: * Compiling with developement DEBUG support" >&5 +-echo "${ECHO_T}* Compiling with developement DEBUG support" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: * Compiling with developement DEBUG support" >&5 ++$as_echo "* Compiling with developement DEBUG support" >&6; } + fi + + if test "${build_nuauth}" = "yes"; then +- { echo "$as_me:$LINENO: result: * Compiling NuAuth" >&5 +-echo "${ECHO_T}* Compiling NuAuth" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: * Compiling NuAuth" >&5 ++$as_echo "* Compiling NuAuth" >&6; } + if test "$enable_system_auth" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuAuth: compile auth module system" >&5 +-echo "${ECHO_T} - NuAuth: compile auth module system" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuAuth: compile auth module system" >&5 ++$as_echo " - NuAuth: compile auth module system" >&6; } + fi + + if test "${ldap}" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuAuth: compile module ldap" >&5 +-echo "${ECHO_T} - NuAuth: compile module ldap" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuAuth: compile module ldap" >&5 ++$as_echo " - NuAuth: compile module ldap" >&6; } + fi + + if test "${enable_prelude_log}" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuAuth: compile log module prelude" >&5 +-echo "${ECHO_T} - NuAuth: compile log module prelude" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuAuth: compile log module prelude" >&5 ++$as_echo " - NuAuth: compile log module prelude" >&6; } + fi + + if test "${enable_mysql_log}" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuAuth: compile log module mysql" >&5 +-echo "${ECHO_T} - NuAuth: compile log module mysql" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuAuth: compile log module mysql" >&5 ++$as_echo " - NuAuth: compile log module mysql" >&6; } + fi + + if test "${enable_mysql_auth}" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuAuth: compile authentication module mysql" >&5 +-echo "${ECHO_T} - NuAuth: compile authentication module mysql" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuAuth: compile authentication module mysql" >&5 ++$as_echo " - NuAuth: compile authentication module mysql" >&6; } + fi + + if test "${enable_pgsql_log}" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuAuth: compile log module pgsql" >&5 +-echo "${ECHO_T} - NuAuth: compile log module pgsql" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuAuth: compile log module pgsql" >&5 ++$as_echo " - NuAuth: compile log module pgsql" >&6; } + fi + + if test "${enable_syslog_log}" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuAuth: compile syslog log module" >&5 +-echo "${ECHO_T} - NuAuth: compile syslog log module" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuAuth: compile syslog log module" >&5 ++$as_echo " - NuAuth: compile syslog log module" >&6; } + fi + + if test "${enable_plaintext_auth}" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuAuth: compile plaintext auth module" >&5 +-echo "${ECHO_T} - NuAuth: compile plaintext auth module" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuAuth: compile plaintext auth module" >&5 ++$as_echo " - NuAuth: compile plaintext auth module" >&6; } + fi + + if test "${enable_mark_group}" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuAuth: compile mark group module" >&5 +-echo "${ECHO_T} - NuAuth: compile mark group module" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuAuth: compile mark group module" >&5 ++$as_echo " - NuAuth: compile mark group module" >&6; } + fi + + if test "${enable_mark_field}" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuAuth: compile mark field module" >&5 +-echo "${ECHO_T} - NuAuth: compile mark field module" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuAuth: compile mark field module" >&5 ++$as_echo " - NuAuth: compile mark field module" >&6; } + fi + + if test "${enable_mark_flag}" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuAuth: compile mark flag module" >&5 +-echo "${ECHO_T} - NuAuth: compile mark flag module" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuAuth: compile mark flag module" >&5 ++$as_echo " - NuAuth: compile mark flag module" >&6; } + fi + fi + + if test "${build_nufw}" = "yes"; then +- { echo "$as_me:$LINENO: result: * Compiling NuFW" >&5 +-echo "${ECHO_T}* Compiling NuFW" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: * Compiling NuFW" >&5 ++$as_echo "* Compiling NuFW" >&6; } + if test "${have_conntrack}" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuFW: libnetfilter_conntrack support" >&5 +-echo "${ECHO_T} - NuFW: libnetfilter_conntrack support" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuFW: libnetfilter_conntrack support" >&5 ++$as_echo " - NuFW: libnetfilter_conntrack support" >&6; } + fi + if test "${have_nfqueue}" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuFW: libnetfilter_queue support" >&5 +-echo "${ECHO_T} - NuFW: libnetfilter_queue support" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuFW: libnetfilter_queue support" >&5 ++$as_echo " - NuFW: libnetfilter_queue support" >&6; } + else + if test "${have_ipq}" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuFW: libipq support" >&5 +-echo "${ECHO_T} - NuFW: libipq support" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuFW: libipq support" >&5 ++$as_echo " - NuFW: libipq support" >&6; } + if test "$enable_user_mark" = "yes"; then +- { echo "$as_me:$LINENO: result: - NuFW: User mark support" >&5 +-echo "${ECHO_T} - NuFW: User mark support" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: - NuFW: User mark support" >&5 ++$as_echo " - NuFW: User mark support" >&6; } + fi + fi + fi + else + if test "${use_nfconntrack}" = "yes"; then +- { echo "$as_me:$LINENO: result: !!! WARNING !!! NuFW daemon WON'T be compiled: libnetfilter_queue not present" >&5 +-echo "${ECHO_T}!!! WARNING !!! NuFW daemon WON'T be compiled: libnetfilter_queue not present" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: !!! WARNING !!! NuFW daemon WON'T be compiled: libnetfilter_queue not present" >&5 ++$as_echo "!!! WARNING !!! NuFW daemon WON'T be compiled: libnetfilter_queue not present" >&6; } + else +- { echo "$as_me:$LINENO: result: !!! WARNING !!! NuFW daemon WON'T be compiled: libipq not present" >&5 +-echo "${ECHO_T}!!! WARNING !!! NuFW daemon WON'T be compiled: libipq not present" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: !!! WARNING !!! NuFW daemon WON'T be compiled: libipq not present" >&5 ++$as_echo "!!! WARNING !!! NuFW daemon WON'T be compiled: libipq not present" >&6; } + fi + fi + + if test "${build_libnuclient}" = "yes"; then +- { echo "$as_me:$LINENO: result: * Compiling libnuclient" >&5 +-echo "${ECHO_T}* Compiling libnuclient" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: * Compiling libnuclient" >&5 ++$as_echo "* Compiling libnuclient" >&6; } + fi + + if test "${build_nutcpc}" = "yes"; then +- { echo "$as_me:$LINENO: result: * Compiling nutcpc" >&5 +-echo "${ECHO_T}* Compiling nutcpc" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: * Compiling nutcpc" >&5 ++$as_echo "* Compiling nutcpc" >&6; } + fi + + if test "${build_pam_nufw}" = "yes"; then +- { echo "$as_me:$LINENO: result: * Compiling pam_nufw" >&5 +-echo "${ECHO_T}* Compiling pam_nufw" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: * Compiling pam_nufw" >&5 ++$as_echo "* Compiling pam_nufw" >&6; } + fi + +-{ echo "$as_me:$LINENO: result: ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: + Now type 'make' and then 'sudo make install'" >&5 +-echo "${ECHO_T} ++$as_echo " + Now type 'make' and then 'sudo make install'" >&6; } + +--- nufw-2.2.21.orig/src/Makefile.in ++++ nufw-2.2.21/src/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -84,6 +84,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -96,9 +98,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -109,6 +108,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -117,6 +117,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -176,6 +177,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + EXTRA_DIST = doxygen.cfg doxygen.sh +@@ -188,8 +190,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -295,7 +297,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nufw/Makefile.in ++++ nufw-2.2.21/src/nufw/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -111,6 +111,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -123,9 +125,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -136,6 +135,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -144,6 +144,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -203,6 +204,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @BUILD_NUFW_TRUE@AM_CPPFLAGS = -DLOCAL_STATE_DIR=\"$(localstatedir)\" -DCONFIG_DIR=\"$(sysconfdir)\" -I$(top_srcdir)/src/include/ +@@ -226,8 +228,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -348,7 +350,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/include/config.h ++++ nufw-2.2.21/src/include/config.h +@@ -1,6 +1,9 @@ + /* src/include/config.h. Generated from config.h.in by configure. */ + /* src/include/config.h.in. Generated from configure.ac by autoheader. */ + ++/* Define if building universal (internal helper macro) */ ++/* #undef AC_APPLE_UNIVERSAL_BUILD */ ++ + /* Build nuauth_command */ + #define BUILD_NUAUTH_COMMAND 1 + +@@ -44,19 +47,19 @@ + #define HAVE_LIBPTHREAD 1 + + /* ldap lib flag */ +-/* #undef HAVE_LIBRARY_LDAP */ ++#define HAVE_LIBRARY_LDAP 1 + + /* mysql lib flag */ +-/* #undef HAVE_LIBRARY_MYSQLCLIENT */ ++#define HAVE_LIBRARY_MYSQLCLIENT 1 + + /* pam lib flag */ + #define HAVE_LIBRARY_PAM 1 + + /* pgsql lib flag */ +-/* #undef HAVE_LIBRARY_PQ */ ++#define HAVE_LIBRARY_PQ 1 + + /* prelude library flag */ +-/* #undef HAVE_LIBRARY_PRELUDE */ ++#define HAVE_LIBRARY_PRELUDE 1 + + /* SASL lib flag */ + #define HAVE_LIBRARY_SASL2 1 +@@ -72,7 +75,7 @@ + #define HAVE_MEMSET 1 + + /* Will compile mysql log module with ssl support */ +-/* #undef HAVE_MYSQL_SSL */ ++#define HAVE_MYSQL_SSL 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_NETDB_H 1 +@@ -84,7 +87,7 @@ + #define HAVE_NEW_NFCT_API 1 + + /* Found iface resolution in nfnetlink and libnetfilter_queue */ +-/* #undef HAVE_NFQ_INDEV_NAME */ ++#define HAVE_NFQ_INDEV_NAME 1 + + /* Found queue max length support in netfilter_queue */ + #define HAVE_NFQ_SET_QUEUE_MAXLEN 1 +@@ -155,6 +158,9 @@ + /* Define to the one symbol short name of this package. */ + #define PACKAGE_TARNAME "nufw" + ++/* Define to the home page for this package. */ ++#define PACKAGE_URL "" ++ + /* Define to the version of this package. */ + #define PACKAGE_VERSION "2.2.21" + +@@ -168,14 +174,22 @@ + #define USE_NFQUEUE 1 + + /* Will use UTF8 exchange */ +-/* #undef USE_UTF8 */ ++#define USE_UTF8 1 + + /* Version number of package */ + #define VERSION "2.2.21" + +-/* Define to 1 if your processor stores words with the most significant byte +- first (like Motorola and SPARC, unlike Intel and VAX). */ +-/* #undef WORDS_BIGENDIAN */ ++/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most ++ significant byte first (like Motorola and SPARC, unlike Intel). */ ++#if defined AC_APPLE_UNIVERSAL_BUILD ++# if defined __BIG_ENDIAN__ ++# define WORDS_BIGENDIAN 1 ++# endif ++#else ++# ifndef WORDS_BIGENDIAN ++/* # undef WORDS_BIGENDIAN */ ++# endif ++#endif + + /* Define to __FUNCTION__ or "" if '__func__' does not conform to ANSI C. */ + #define __PRELUDE_FUNC__ __func__ +--- nufw-2.2.21.orig/src/include/Makefile.in ++++ nufw-2.2.21/src/include/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -95,6 +95,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -107,9 +109,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -120,6 +119,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -128,6 +128,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -187,6 +188,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + noinst_LTLIBRARIES = libnufw.la +@@ -205,8 +207,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -300,7 +302,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/include/config.h.in ++++ nufw-2.2.21/src/include/config.h.in +@@ -1,5 +1,8 @@ + /* src/include/config.h.in. Generated from configure.ac by autoheader. */ + ++/* Define if building universal (internal helper macro) */ ++#undef AC_APPLE_UNIVERSAL_BUILD ++ + /* Build nuauth_command */ + #undef BUILD_NUAUTH_COMMAND + +@@ -154,6 +157,9 @@ + /* Define to the one symbol short name of this package. */ + #undef PACKAGE_TARNAME + ++/* Define to the home page for this package. */ ++#undef PACKAGE_URL ++ + /* Define to the version of this package. */ + #undef PACKAGE_VERSION + +@@ -172,9 +178,17 @@ + /* Version number of package */ + #undef VERSION + +-/* Define to 1 if your processor stores words with the most significant byte +- first (like Motorola and SPARC, unlike Intel and VAX). */ +-#undef WORDS_BIGENDIAN ++/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most ++ significant byte first (like Motorola and SPARC, unlike Intel). */ ++#if defined AC_APPLE_UNIVERSAL_BUILD ++# if defined __BIG_ENDIAN__ ++# define WORDS_BIGENDIAN 1 ++# endif ++#else ++# ifndef WORDS_BIGENDIAN ++# undef WORDS_BIGENDIAN ++# endif ++#endif + + /* Define to __FUNCTION__ or "" if '__func__' does not conform to ANSI C. */ + #undef __PRELUDE_FUNC__ +--- nufw-2.2.21.orig/src/clients/Makefile.in ++++ nufw-2.2.21/src/clients/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -84,6 +84,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -96,9 +98,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -109,6 +108,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -117,6 +117,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -176,6 +177,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + SUBDIRS = lib nutcpc pam_nufw +@@ -186,8 +188,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -293,7 +295,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/clients/nutcpc/Makefile.in ++++ nufw-2.2.21/src/clients/nutcpc/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -98,6 +98,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -110,9 +112,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -123,6 +122,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -131,6 +131,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -190,6 +191,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @BUILD_NUTCPC_TRUE@EXTRA_DIST = valgrind.sh valgrind.supp +@@ -207,8 +209,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -318,7 +320,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/clients/pam_nufw/Makefile.in ++++ nufw-2.2.21/src/clients/pam_nufw/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -104,6 +104,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -116,9 +118,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -129,6 +128,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -137,6 +137,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -196,6 +197,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @BUILD_PAM_NUFW_TRUE@TITLE = pam_nufw +@@ -214,8 +216,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -316,7 +318,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/clients/lib/Makefile.in ++++ nufw-2.2.21/src/clients/lib/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -125,6 +125,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -137,9 +139,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -150,6 +149,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -158,6 +158,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -217,6 +218,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @BUILD_LIBNUCLIENT_TRUE@AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -I$(top_srcdir)/src/include/ +@@ -242,8 +244,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -432,7 +434,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/clients/lib/tests/Makefile.in ++++ nufw-2.2.21/src/clients/lib/tests/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -72,6 +72,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -84,9 +86,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -97,6 +96,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -105,6 +105,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -164,6 +165,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + EXTRA_DIST = dummy_client.c +@@ -174,8 +176,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +--- nufw-2.2.21.orig/src/nuauth/Makefile.in ++++ nufw-2.2.21/src/nuauth/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -119,6 +119,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -131,9 +133,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -144,6 +143,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -152,6 +152,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -211,6 +212,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + SUBDIRS = modules +@@ -244,8 +246,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -442,7 +444,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -84,6 +84,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -96,9 +98,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -109,6 +108,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -117,6 +117,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -176,6 +177,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + SUBDIRS = ldap log_syslog log_script log_mysql log_pgsql plaintext system xml_defs \ +@@ -189,8 +191,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -296,7 +298,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/session_authtype/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/session_authtype/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -104,6 +104,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -116,9 +118,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -129,6 +128,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -137,6 +137,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -196,6 +197,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -212,8 +214,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -305,7 +307,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/mark_uid/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/mark_uid/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -104,6 +104,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -116,9 +118,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -129,6 +128,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -137,6 +137,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -196,6 +197,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -212,8 +214,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -305,7 +307,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/ipauth_guest/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/ipauth_guest/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -104,6 +104,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -116,9 +118,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -129,6 +128,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -137,6 +137,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -196,6 +197,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -212,8 +214,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -305,7 +307,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/log_mysql/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/log_mysql/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -110,6 +110,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -122,9 +124,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -135,6 +134,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -143,6 +143,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -202,6 +203,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @USE_MYSQL_LOG_TRUE@AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -221,8 +223,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -333,7 +335,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/log_nuprelude/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/log_nuprelude/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -111,6 +111,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -123,9 +125,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -136,6 +135,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -144,6 +144,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -203,6 +204,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @USE_PRELUDE_LOG_TRUE@AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -221,8 +223,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -333,7 +335,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/log_syslog/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/log_syslog/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -106,6 +106,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -118,9 +120,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -131,6 +130,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -139,6 +139,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -198,6 +199,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @USE_SYSLOG_LOG_TRUE@AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -214,8 +216,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -309,7 +311,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/session_expire/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/session_expire/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -104,6 +104,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -116,9 +118,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -129,6 +128,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -137,6 +137,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -196,6 +197,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -212,8 +214,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -305,7 +307,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/plaintext/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/plaintext/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -112,6 +112,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -124,9 +126,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -137,6 +136,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -145,6 +145,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -204,6 +205,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @USE_PLAINTEXT_AUTH_TRUE@AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -221,8 +223,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -333,7 +335,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/system/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/system/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -109,6 +109,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -121,9 +123,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -134,6 +133,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -142,6 +142,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -201,6 +202,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @USE_SYSTEM_AUTH_TRUE@AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -218,8 +220,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -314,7 +316,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/log_pgsql/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/log_pgsql/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -110,6 +110,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -122,9 +124,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -135,6 +134,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -143,6 +143,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -202,6 +203,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @USE_PGSQL_LOG_TRUE@AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -220,8 +222,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -332,7 +334,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/mark_group/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/mark_group/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -111,6 +111,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -123,9 +125,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -136,6 +135,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -144,6 +144,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -203,6 +204,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @USE_MARK_GROUP_TRUE@AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -220,8 +222,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -332,7 +334,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/ldap/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/ldap/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -110,6 +110,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -122,9 +124,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -135,6 +134,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -143,6 +143,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -202,6 +203,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @USE_LDAP_TRUE@AM_CPPFLAGS = -fPIC -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -220,8 +222,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -332,7 +334,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/auth_mysql/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/auth_mysql/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -111,6 +111,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -123,9 +125,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -136,6 +135,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -144,6 +144,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -203,6 +204,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @USE_MYSQL_AUTH_TRUE@AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -224,8 +226,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -336,7 +338,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/x509_std/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/x509_std/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -108,6 +108,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -120,9 +122,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -133,6 +132,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -141,6 +141,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -200,6 +201,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -217,8 +219,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -327,7 +329,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/log_script/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/log_script/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -102,6 +102,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -114,9 +116,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -127,6 +126,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -135,6 +135,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -194,6 +195,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -210,8 +212,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -303,7 +305,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/xml_defs/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/xml_defs/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -108,6 +108,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -120,9 +122,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -133,6 +132,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -141,6 +141,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -200,6 +201,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -217,8 +219,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -327,7 +329,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/mark_flag/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/mark_flag/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -104,6 +104,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -116,9 +118,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -129,6 +128,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -137,6 +137,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -196,6 +197,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -212,8 +214,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -305,7 +307,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/src/nuauth/modules/mark_field/Makefile.in ++++ nufw-2.2.21/src/nuauth/modules/mark_field/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -111,6 +111,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -123,9 +125,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -136,6 +135,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -144,6 +144,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -203,6 +204,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @USE_MARK_FIELD_TRUE@AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DMODULE_DIR=\"$(libdir)\" +@@ -220,8 +222,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -332,7 +334,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/python/Makefile.in ++++ nufw-2.2.21/python/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -72,6 +72,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -84,9 +86,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -97,6 +96,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -105,6 +105,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -164,6 +165,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + EXTRA_DIST = test_nuclient.py nuclient/classes.py nuclient/func.py nuclient/__init__.py +@@ -174,8 +176,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +--- nufw-2.2.21.orig/scripts/Makefile.in ++++ nufw-2.2.21/scripts/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -84,6 +84,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -96,9 +98,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -109,6 +108,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -117,6 +117,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -176,6 +177,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + SUBDIRS = nuauth_command auth_mysql +@@ -187,8 +189,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -294,7 +296,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/scripts/nuauth_command/Makefile.in ++++ nufw-2.2.21/scripts/nuauth_command/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -85,6 +85,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -97,9 +99,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -110,6 +109,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -118,6 +118,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -177,6 +178,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + @BUILD_NUAUTH_COMMAND_TRUE@SUBDIRS = scripts nuauth_command +@@ -188,8 +190,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -295,7 +297,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/scripts/nuauth_command/nuauth_command/Makefile.in ++++ nufw-2.2.21/scripts/nuauth_command/nuauth_command/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -72,6 +72,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -84,9 +86,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -97,6 +96,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -105,6 +105,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -164,6 +165,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + EXTRA_DIST = client.py command_dec.py __init__.py version.py +@@ -174,8 +176,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +--- nufw-2.2.21.orig/scripts/nuauth_command/scripts/Makefile.in ++++ nufw-2.2.21/scripts/nuauth_command/scripts/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -72,6 +72,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -84,9 +86,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -97,6 +96,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -105,6 +105,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -164,6 +165,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + edit = sed \ +@@ -178,8 +180,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +--- nufw-2.2.21.orig/scripts/auth_mysql/Makefile.in ++++ nufw-2.2.21/scripts/auth_mysql/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -72,6 +72,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -84,9 +86,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -97,6 +96,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -105,6 +105,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -164,6 +165,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + PHP_FILES = authmysql/index.php authmysql/pages/authentication_error.php authmysql/pages/authentication.php authmysql/pages/authentication_success.php +@@ -175,8 +177,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +--- nufw-2.2.21.orig/conf/Makefile.in ++++ nufw-2.2.21/conf/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -72,6 +72,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -84,9 +86,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -97,6 +96,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -105,6 +105,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -164,6 +165,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + CONFIG_FILES = acls.nufw mark_field.conf mark_group.conf nuaclgen.conf nuauth.conf nuclient.conf nutop.conf periods.xml users-plaintext.nufw +@@ -179,8 +181,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +--- nufw-2.2.21.orig/tests/Makefile.in ++++ nufw-2.2.21/tests/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -84,6 +84,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -96,9 +98,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -109,6 +108,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -117,6 +117,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -176,6 +177,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + SUBDIRS = inl_tests pki +@@ -198,8 +200,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -305,7 +307,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/tests/pki/Makefile.in ++++ nufw-2.2.21/tests/pki/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -72,6 +72,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -84,9 +86,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -97,6 +96,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -105,6 +105,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -164,6 +165,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + EXTRA_DIST = gen_certs.sh gen_config.sh gen_server_cnf.sh gen_user_cnf.sh +@@ -183,8 +185,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +--- nufw-2.2.21.orig/tests/inl_tests/Makefile.in ++++ nufw-2.2.21/tests/inl_tests/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -99,6 +99,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -111,9 +113,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -124,6 +123,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -132,6 +132,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -191,6 +192,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + EXTRA_DIST = \ +@@ -217,8 +219,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -312,7 +314,7 @@ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ +- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ ++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique + tags: TAGS +--- nufw-2.2.21.orig/debian/nutcpc.install ++++ nufw-2.2.21/debian/nutcpc.install +@@ -0,0 +1 @@ ++src/clients/nutcpc/.libs/nutcpc usr/bin +--- nufw-2.2.21.orig/debian/nuauth.default ++++ nufw-2.2.21/debian/nuauth.default +@@ -0,0 +1,10 @@ ++#Change to "true" for Nufw to be started ++NUAUTH_START="true" ++ ++#Add "v"s so nufw gets more verbose ++NUAUTH_VERBOSITY="vv" ++ ++#User nuauth runs on. Change this to some entry existing in /etc/passwd ++NUAUTH_USER="nuauth" ++ ++#EDIT /etc/nuauth/nuauth.conf for other options! +--- nufw-2.2.21.orig/debian/nuauth.dirs ++++ nufw-2.2.21/debian/nuauth.dirs +@@ -0,0 +1,5 @@ ++etc/nufw/certs ++etc/default ++usr/sbin ++usr/share/nuauth ++var/run/nuauth +--- nufw-2.2.21.orig/debian/nuauth.install ++++ nufw-2.2.21/debian/nuauth.install +@@ -0,0 +1,43 @@ ++conf/nuauth.conf etc/nufw ++conf/periods.xml etc/nufw ++conf/acls.nufw etc/nufw ++conf/users-plaintext.nufw etc/nufw ++src/nuauth/nuauth usr/sbin ++src/nuauth/modules/ldap/.libs/libldap.so usr/lib/nuauth/modules ++src/nuauth/modules/ldap/libldap.la usr/lib/nuauth/modules ++src/nuauth/modules/ldap/.libs/libldap.a usr/lib/nuauth/modules ++src/nuauth/modules/plaintext/.libs/libplaintext.so usr/lib/nuauth/modules ++src/nuauth/modules/plaintext/libplaintext.la usr/lib/nuauth/modules ++src/nuauth/modules/plaintext/.libs/libplaintext.a usr/lib/nuauth/modules ++src/nuauth/modules/system/.libs/libsystem.so usr/lib/nuauth/modules ++src/nuauth/modules/system/libsystem.la usr/lib/nuauth/modules ++src/nuauth/modules/system/.libs/libsystem.a usr/lib/nuauth/modules ++src/nuauth/modules/log_syslog/.libs/libsyslog.so usr/lib/nuauth/modules ++src/nuauth/modules/log_syslog/libsyslog.la usr/lib/nuauth/modules ++src/nuauth/modules/log_syslog/.libs/libsyslog.a usr/lib/nuauth/modules ++src/nuauth/modules/xml_defs/.libs/libxml_defs.so usr/lib/nuauth/modules ++src/nuauth/modules/xml_defs/.libs/libxml_defs.a usr/lib/nuauth/modules ++src/nuauth/modules/xml_defs/libxml_defs.la usr/lib/nuauth/modules ++src/nuauth/modules/x509_std/.libs/libx509_std.so usr/lib/nuauth/modules ++src/nuauth/modules/x509_std/.libs/libx509_std.a usr/lib/nuauth/modules ++src/nuauth/modules/x509_std/libx509_std.la usr/lib/nuauth/modules ++src/nuauth/modules/mark_uid/.libs/libmark_uid.so usr/lib/nuauth/modules ++src/nuauth/modules/mark_uid/.libs/libmark_uid.a usr/lib/nuauth/modules ++src/nuauth/modules/mark_uid/libmark_uid.la usr/lib/nuauth/modules ++src/nuauth/modules/mark_group/.libs/libmark_group.so usr/lib/nuauth/modules ++src/nuauth/modules/mark_group/.libs/libmark_group.a usr/lib/nuauth/modules ++src/nuauth/modules/mark_group/libmark_group.la usr/lib/nuauth/modules ++src/nuauth/modules/mark_field/.libs/libmark_field.so usr/lib/nuauth/modules ++src/nuauth/modules/mark_field/.libs/libmark_field.a usr/lib/nuauth/modules ++src/nuauth/modules/mark_field/libmark_field.la usr/lib/nuauth/modules ++src/nuauth/modules/mark_flag/.libs/libmark_flag.so usr/lib/nuauth/modules ++src/nuauth/modules/mark_flag/.libs/libmark_flag.a usr/lib/nuauth/modules ++src/nuauth/modules/mark_flag/libmark_flag.la usr/lib/nuauth/modules ++src/nuauth/modules/session_expire/.libs/libsession_expire.so usr/lib/nuauth/modules ++src/nuauth/modules/session_expire/.libs/libsession_expire.a usr/lib/nuauth/modules ++src/nuauth/modules/session_expire/libsession_expire.la usr/lib/nuauth/modules ++src/nuauth/modules/session_authtype/.libs/libsession_authtype.so usr/lib/nuauth/modules ++src/nuauth/modules/session_authtype/.libs/libsession_authtype.a usr/lib/nuauth/modules ++src/nuauth/modules/session_authtype/libsession_authtype.la usr/lib/nuauth/modules ++src/nuauth/modules/log_nuprelude/.libs/libnuprelude.so usr/lib/nuauth/modules ++src/nuauth/modules/log_nuprelude/.libs/libnuprelude.a usr/lib/nuauth/modules +--- nufw-2.2.21.orig/debian/nuauth-log-mysql.docs ++++ nufw-2.2.21/debian/nuauth-log-mysql.docs +@@ -0,0 +1,3 @@ ++conf/nulog.ipv4.mysql.dump ++conf/nulog.ipv6.mysql.dump ++conf/nulog-v1-v2.mysql.dump +--- nufw-2.2.21.orig/debian/nuauth-log-pgsql.install ++++ nufw-2.2.21/debian/nuauth-log-pgsql.install +@@ -0,0 +1,3 @@ ++src/nuauth/modules/log_pgsql/.libs/libpgsql.a usr/lib/nuauth/modules ++src/nuauth/modules/log_pgsql/libpgsql.la usr/lib/nuauth/modules ++src/nuauth/modules/log_pgsql/.libs/libpgsql.so usr/lib/nuauth/modules +--- nufw-2.2.21.orig/debian/nuauth-extra.install ++++ nufw-2.2.21/debian/nuauth-extra.install +@@ -0,0 +1,9 @@ ++src/nuauth/modules/ipauth_guest/.libs/libipauth_guest.so usr/lib/nuauth/modules ++src/nuauth/modules/ipauth_guest/libipauth_guest.la usr/lib/nuauth/modules ++src/nuauth/modules/ipauth_guest/.libs/libipauth_guest.a usr/lib/nuauth/modules ++src/nuauth/modules/auth_mysql/.libs/libauth_mysql.a usr/lib/nuauth/modules ++src/nuauth/modules/auth_mysql/libauth_mysql.la usr/lib/nuauth/modules ++src/nuauth/modules/auth_mysql/.libs/libauth_mysql.so usr/lib/nuauth/modules ++src/nuauth/modules/log_script/.libs/libscript.a usr/lib/nuauth/modules ++src/nuauth/modules/log_script/libscript.la usr/lib/nuauth/modules ++src/nuauth/modules/log_script/.libs/libscript.so usr/lib/nuauth/modules +--- nufw-2.2.21.orig/debian/rules ++++ nufw-2.2.21/debian/rules +@@ -0,0 +1,503 @@ ++#!/usr/bin/make -f ++# -*- makefile -*- ++# Sample debian/rules that uses debhelper. ++# GNU copyright 1997 to 1999 by Joey Hess. ++ ++# Uncomment this to turn on verbose mode. ++#export DH_VERBOSE=1 ++maindir = $(shell pwd) ++b = $(shell pwd)/debian ++ ++ ++# These are used for cross-compiling and for saving the configure script ++# from having to guess our platform (since we know it already) ++DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) ++DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) ++ ++ ++CFLAGS = -Wall -g ++ ++ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) ++ CFLAGS += -O0 ++else ++ CFLAGS += -O2 ++endif ++ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) ++ INSTALL_PROGRAM += -s ++endif ++ ++# Which packages should we build? ++ ++CONFIGURE = CFLAGS='$(CFLAGS)' ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \ ++ --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --localstatedir=/var \ ++ --sysconfdir=/etc/nufw/ --with-mysql-log --with-pgsql-log --with-system-auth --with-ldap \ ++ --with-utf8 --with-nfqueue --with-nfconntrack --without-fixedtimeout --enable-pam-nufw \ ++ --with-prelude-log --with-mysql-auth ++ # --with-utf8 --with-nfqueue --with-nfconntrack --with-fixedtimeout #FIXME : THIS line should be used ++ ++config.status: configure ++ dh_testdir ++ # Add here commands to configure the package. ++ CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \ ++ --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --localstatedir=/var \ ++ --sysconfdir=/etc/nufw/ --with-mysql-log --with-pgsql-log --with-system-auth --with-ldap \ ++ --with-nfqueue --with-nfconntrack --with-fixedtimeout --with-utf8 --enable-pam-nufw \ ++ --with-prelude-log --with-mysql-auth ++ ++build: build-stamp ++ ++clean: ++ dh_testdir ++ dh_testroot ++ rm -f build-stamp ++ rm -f build-nufw build-nufw-stamp ++ rm -f config-nufw-stamp install-stamp ++ ++ # Add here commands to clean up after the build process. ++ [ ! -f Makefile ] || $(MAKE) distclean ++ rm -f tests/pki/Makefile ++ -find scripts/nuauth_command/ -name '*.pyc' -exec rm {} \; ++ [ ! -d scripts/nuauth_command/build ] || rm -rf scripts/nuauth_command/build ++ [ ! -f scripts/nuauth_command/scripts/nuauth_command ] || rm -f scripts/nuauth_command/scripts/nuauth_command ++ rm -f tests/inl_tests/libnobuffer.so ++ rm -f config.log ++ ++ dh_clean ++ ++config-nufw: config-nufw-stamp ++config-nufw-stamp: ++ dh_testdir -a ++ @echo "Doing $@" ++ [ ! -f Makefile ] || make clean ++ $(CONFIGURE) ++ touch config-nufw-stamp ++ ++build-nufw:build-nufw-stamp ++build-nufw-stamp: config-nufw-stamp ++ dh_testdir -a ++ @echo "Doing $@" ++ $(MAKE) ++ #$(MAKE) && \ ++ #(cd src/nufw && mv nufw nufw.plain); ++ touch build-nufw-stamp ++ ++build-stamp: build-nufw ++ @echo "--- Compiling" ++ dh_testdir ++ touch build-stamp ++ ++binary-arch: build nufw nuauth libnuclient3 libnuclient-dev nutcpc nuauth-extra nuauth-log-mysql nuauth-log-pgsql libpam-nufw nuauth-utils ++ ++nufw: ++ @echo "--- Building: $@" ++ dh_installdirs -p$@ -P$(b)/$@ ++ dh_testdir -p$@ -P$(b)/$@ ++ dh_testroot -p$@ -P$(b)/$@ ++ dh_installchangelogs -p$@ -P$(b)/$@ ChangeLog ++ dh_installdocs -p$@ -P$(b)/$@ ++ dh_installexamples -p$@ -P$(b)/$@ ++# dh_install -p$@ -P$(b)/$@ ++# rm debian/$@/usr/sbin/nufw ++ /usr/bin/install -m 755 src/nufw/nufw debian/nufw/usr/sbin/nufw ++# dh_installmenu ++ dh_installdebconf -p$@ -P$(b)/$@ ++# dh_installlogrotate ++# dh_installemacsen ++# dh_installpam ++# dh_installmime ++ dh_installinit -p$@ -P$(b)/$@ -u"start 40 2 3 4 5 . stop 89 0 1 6 ." ++# dh_installcron ++# dh_installinfo ++ dh_installman -pnufw doc/nufw.8 ++ dh_link -p$@ -P$(b)/$@ ++ dh_strip -p$@ -P$(b)/$@ ++ dh_compress -p$@ -P$(b)/$@ ++ dh_fixperms -p$@ -P$(b)/$@ ++# dh_perl ++# dh_python ++ dh_makeshlibs -p$@ -P$(b)/$@ -n ++ dh_installdeb -p$@ -P$(b)/$@ ++ dh_shlibdeps -p$@ -P$(b)/$@ ++ dh_gencontrol -p$@ -P$(b)/$@ ++ dh_md5sums -p$@ -P$(b)/$@ ++ dh_builddeb -p$@ -P$(b)/$@ ++ ++ ++libnuclient3: ++ @echo "--- Building: $@" ++ dh_installdirs -p$@ -P$(b)/$@ ++ dh_testdir -p$@ -P$(b)/$@ ++ dh_testroot -p$@ -P$(b)/$@ ++ dh_installchangelogs -p$@ -P$(b)/$@ ChangeLog ++ dh_installdocs -p$@ -P$(b)/$@ ++ dh_installexamples -p$@ -P$(b)/$@ ++ dh_install -p$@ ++# rm debian/$@/usr/sbin/nufw ++# dh_installmenu ++ dh_installdebconf -p$@ -P$(b)/$@ ++# dh_installlogrotate ++# dh_installemacsen ++# dh_installpam ++# dh_installmime ++# dh_installcron ++# dh_installinfo ++ dh_link -p$@ -P$(b)/$@ ++ dh_strip -p$@ -P$(b)/$@ ++ dh_compress -p$@ -P$(b)/$@ ++ dh_fixperms -p$@ -P$(b)/$@ ++# dh_perl ++# dh_python ++ dh_makeshlibs -p$@ -P$(b)/$@ -n ++ dh_installdeb -p$@ -P$(b)/$@ ++ dh_shlibdeps -p$@ -P$(b)/$@ ++ dh_gencontrol -p$@ -P$(b)/$@ ++ dh_md5sums -p$@ -P$(b)/$@ ++ dh_builddeb -p$@ -P$(b)/$@ ++ ++libnuclient-dev: ++ @echo "--- Building: $@" ++ dh_installdirs -p$@ -P$(b)/$@ ++ dh_testdir -p$@ -P$(b)/$@ ++ dh_testroot -p$@ -P$(b)/$@ ++ dh_installchangelogs -p$@ -P$(b)/$@ ChangeLog ++ dh_installdocs -p$@ -P$(b)/$@ ++ dh_installexamples -p$@ -P$(b)/$@ ++ dh_install -p$@ ++# rm debian/$@/usr/sbin/nufw ++# dh_installmenu ++ dh_installdebconf -p$@ -P$(b)/$@ ++# dh_installlogrotate ++# dh_installemacsen ++# dh_installpam ++# dh_installmime ++# dh_installcron ++# dh_installinfo ++ dh_link -p$@ -P$(b)/$@ ++ dh_strip -p$@ -P$(b)/$@ ++ dh_compress -p$@ -P$(b)/$@ ++ dh_fixperms -p$@ -P$(b)/$@ ++# dh_perl ++# dh_python ++ dh_makeshlibs -p$@ -P$(b)/$@ -n ++ dh_installdeb -p$@ -P$(b)/$@ ++ dh_shlibdeps -L libnuclient3 -l debian/libnuclient3/usr/lib -p$@ -P$(b)/$@ ++ dh_gencontrol -p$@ -P$(b)/$@ ++ dh_md5sums -p$@ -P$(b)/$@ ++ dh_builddeb -p$@ -P$(b)/$@ ++ ++libpam-nufw: ++ @echo "--- Building: $@" ++ dh_installdirs -p$@ -P$(b)/$@ ++ dh_testdir -p$@ -P$(b)/$@ ++ dh_testroot -p$@ -P$(b)/$@ ++ dh_installchangelogs -p$@ -P$(b)/$@ ChangeLog ++ dh_installdocs -p$@ -P$(b)/$@ ++ dh_installexamples -p$@ -P$(b)/$@ ++ dh_install -p$@ ++# rm debian/$@/usr/sbin/nufw ++ # remove local rpath (#495769) ++ chrpath -d $(CURDIR)/debian/libpam-nufw/lib/security/pam_nufw.so ++# dh_installmenu ++ dh_installdebconf -p$@ -P$(b)/$@ ++# dh_installlogrotate ++# dh_installemacsen ++# dh_installpam ++# dh_installmime ++ ++# dh_installcron ++# dh_installinfo ++ dh_link -p$@ -P$(b)/$@ ++ dh_strip -p$@ -P$(b)/$@ ++ dh_compress -p$@ -P$(b)/$@ ++ dh_fixperms -p$@ -P$(b)/$@ ++# dh_perl ++# dh_python ++ dh_makeshlibs -p$@ -P$(b)/$@ -n ++ dh_installdeb -p$@ -P$(b)/$@ ++ dh_shlibdeps -p$@ -P$(b)/$@ ++ dh_gencontrol -p$@ -P$(b)/$@ ++ dh_md5sums -p$@ -P$(b)/$@ ++ dh_builddeb -p$@ -P$(b)/$@ ++ ++nuauth: ++ @echo "--- Building: $@" ++ dh_installdirs -p$@ -P$(b)/$@ ++ dh_testdir -p$@ -P$(b)/$@ ++ dh_testroot -p$@ -P$(b)/$@ ++ dh_installchangelogs -p$@ -P$(b)/$@ ChangeLog ++ dh_installdocs -p$@ -P$(b)/$@ ++ dh_installexamples -p$@ -P$(b)/$@ ++ mkdir -p $(CURDIR)/debian/$@/etc/nufw/ ++ dh_install -p$@ ++ sed -e "sµ^#\? *nuauth_tls_key=.*µnuauth_tls_key=\"/etc/nufw/certs/nuauth-key.pem\"µ" \ ++ -e "sµ^#\? *nuauth_tls_cert=.*µnuauth_tls_cert=\"/etc/nufw/certs/nuauth-cert.pem\"µ" \ ++ -e "sµ^ *plaintext_aclfile=.*µplaintext_aclfile=\"/etc/nufw/acls.nufw\"µ" \ ++ -e "sµ^ *plaintext_userfile=.*µplaintext_userfile=\"/etc/nufw/users-plaintext.nufw\"µ" \ ++ -e "sµ^ *nuauth_user_check_module=.*µnuauth_user_check_module=\"system\"µ" \ ++ -e "sµ^ *nuauth_tls_request_cert=.*µnuauth_tls_request_cert=1µ" \ ++ -e "sµ^#\? *nuauth_tls_disable_nufw_fqdn_check=.*µnuauth_tls_disable_nufw_fqdn_check=1µ" \ ++ < $(CURDIR)/conf/nuauth.conf >$(CURDIR)/debian/$@/etc/nufw/nuauth.conf ++ mv $(CURDIR)/debian/$@/etc/nufw/nuauth.conf $(CURDIR)/debian/$@/usr/share/nuauth/nuauth.conf ++ cp $(CURDIR)/conf/acls.nufw $(CURDIR)/debian/$@/etc/nufw/ ++ cp $(CURDIR)/conf/users-plaintext.nufw $(CURDIR)/debian/$@/etc/nufw/ ++ cp $(CURDIR)/conf/periods.xml $(CURDIR)/debian/$@/etc/nufw/ ++ rmdir $(CURDIR)/debian/$@/var/run/nuauth ++ pwd ++# dh_install -p$@ -P$(b)/$@ ++# dh_installmenu ++ dh_installdebconf -p$@ -P$(b)/$@ ++# dh_installlogrotate ++# dh_installemacsen ++# dh_installpam ++# dh_installmime ++# dh_installcron ++# dh_installinfo ++ dh_link -p$@ -P$(b)/$@ ++ dh_strip -p$@ -P$(b)/$@ ++ dh_installinit -p$@ -P$(b)/$@ -u"start 40 2 3 4 5 . stop 89 0 1 6 ." ++ dh_installman -pnuauth doc/nuauth.8 ++ dh_compress -p$@ -P$(b)/$@ ++ dh_fixperms -p$@ -P$(b)/$@ ++# dh_perl ++# dh_python ++ dh_makeshlibs -p$@ -P$(b)/$@ -n ++ dh_installdeb -p$@ -P$(b)/$@ ++ dh_shlibdeps -p$@ -P$(b)/$@ ++ dh_gencontrol -p$@ -P$(b)/$@ ++ dh_md5sums -p$@ -P$(b)/$@ ++ dh_builddeb -p$@ -P$(b)/$@ ++ ++nuauth-extra: ++ @echo "--- Building: $@" ++ dh_installdirs -p$@ -P$(b)/$@ ++ dh_testdir -p$@ -P$(b)/$@ ++ dh_testroot -p$@ -P$(b)/$@ ++ dh_installchangelogs -p$@ -P$(b)/$@ ChangeLog ++ dh_installdocs -p$@ -P$(b)/$@ ++ dh_installexamples -p$@ -P$(b)/$@ ++ dh_install -p$@ ++# rm debian/$@/usr/sbin/nufw ++# dh_installmenu ++ dh_installdebconf -p$@ -P$(b)/$@ ++# dh_installlogrotate ++# dh_installemacsen ++# dh_installpam ++# dh_installmime ++# dh_installcron ++# dh_installinfo ++ dh_link -p$@ -P$(b)/$@ ++ dh_strip -p$@ -P$(b)/$@ ++ dh_compress -p$@ -P$(b)/$@ ++ dh_fixperms -p$@ -P$(b)/$@ ++# dh_perl ++# dh_python ++ dh_makeshlibs -p$@ -P$(b)/$@ -n ++ dh_installdeb -p$@ -P$(b)/$@ ++ dh_shlibdeps -p$@ -P$(b)/$@ ++ dh_gencontrol -p$@ -P$(b)/$@ ++ dh_md5sums -p$@ -P$(b)/$@ ++ dh_builddeb -p$@ -P$(b)/$@ ++ ++nuauth-log-mysql: ++ @echo "--- Building: $@" ++ dh_installdirs -p$@ -P$(b)/$@ ++ dh_testdir -p$@ -P$(b)/$@ ++ dh_testroot -p$@ -P$(b)/$@ ++ dh_installchangelogs -p$@ -P$(b)/$@ ChangeLog ++ dh_installdocs -p$@ -P$(b)/$@ ++ dh_installexamples -p$@ -P$(b)/$@ ++ dh_install -p$@ ++# rm debian/$@/usr/sbin/nufw ++# dh_installmenu ++ dh_installdebconf -p$@ -P$(b)/$@ ++# dh_installlogrotate ++# dh_installemacsen ++# dh_installpam ++# dh_installmime ++# dh_installcron ++# dh_installinfo ++ dh_link -p$@ -P$(b)/$@ ++ dh_strip -p$@ -P$(b)/$@ ++ dh_compress -p$@ -P$(b)/$@ ++ dh_fixperms -p$@ -P$(b)/$@ ++# dh_perl ++# dh_python ++ dh_makeshlibs -p$@ -P$(b)/$@ -n ++ dh_installdeb -p$@ -P$(b)/$@ ++ dh_shlibdeps -p$@ -P$(b)/$@ ++ dh_gencontrol -p$@ -P$(b)/$@ ++ dh_md5sums -p$@ -P$(b)/$@ ++ dh_builddeb -p$@ -P$(b)/$@ ++ ++nuauth-log-pgsql: ++ @echo "--- Building: $@" ++ dh_installdirs -p$@ -P$(b)/$@ ++ dh_testdir -p$@ -P$(b)/$@ ++ dh_testroot -p$@ -P$(b)/$@ ++ dh_installchangelogs -p$@ -P$(b)/$@ ChangeLog ++ dh_installdocs -p$@ -P$(b)/$@ ++ dh_installexamples -p$@ -P$(b)/$@ ++ dh_install -p$@ ++# rm debian/$@/usr/sbin/nufw ++# dh_installmenu ++ dh_installdebconf -p$@ -P$(b)/$@ ++# dh_installlogrotate ++# dh_installemacsen ++# dh_installpam ++# dh_installmime ++# dh_installcron ++# dh_installinfo ++ dh_link -p$@ -P$(b)/$@ ++ dh_strip -p$@ -P$(b)/$@ ++ dh_compress -p$@ -P$(b)/$@ ++ dh_fixperms -p$@ -P$(b)/$@ ++# dh_perl ++# dh_python ++ dh_makeshlibs -p$@ -P$(b)/$@ -n ++ dh_installdeb -p$@ -P$(b)/$@ ++ dh_shlibdeps -p$@ -P$(b)/$@ ++ dh_gencontrol -p$@ -P$(b)/$@ ++ dh_md5sums -p$@ -P$(b)/$@ ++ dh_builddeb -p$@ -P$(b)/$@ ++ ++nuauth-utils: ++ @echo "--- Building: $@" ++ dh_installdirs -p$@ -P$(b)/$@ ++ dh_testdir -p$@ -P$(b)/$@ ++ dh_testroot -p$@ -P$(b)/$@ ++ dh_installchangelogs -p$@ -P$(b)/$@ ChangeLog ++ dh_installdocs -p$@ -P$(b)/$@ ++ dh_installexamples -p$@ -P$(b)/$@ ++ dh_install -p$@ ++# rm debian/$@/usr/sbin/nufw ++# dh_installmenu ++ dh_installdebconf -p$@ -P$(b)/$@ ++ cp $(CURDIR)/conf/nuaclgen.conf $(CURDIR)/debian/$@/etc/nufw/ ++ cp $(CURDIR)/conf/nutop.conf $(CURDIR)/debian/$@/etc/nufw/ ++ cp $(CURDIR)/scripts/nuaclgen $(CURDIR)/debian/$@/usr/bin ++ cp $(CURDIR)/scripts/nutop $(CURDIR)/debian/$@/usr/bin ++ cp $(CURDIR)/scripts/clean_conntrack.pl $(CURDIR)/debian/$@/usr/sbin ++ #make -C $(CURDIR)/scripts/nuauth_command install DESTDIR=$(CURDIR)/debian/$@/ ++ cd $(CURDIR)/scripts/nuauth_command && ./setup.py install --no-compile \ ++ --install-lib=$(CURDIR)/debian/$@/usr/share/python-support/nuauth_command \ ++ --prefix=$(CURDIR)/debian/$@/usr ++ #find $(CURDIR)/debian/$@/ -name \*.pyc -exec rm -f {} \; ++ dh_python ++ dh_pysupport ++# dh_installlogrotate ++# dh_installemacsen ++# dh_installpam ++# dh_installmime ++# dh_installcron ++# dh_installinfo ++ dh_link -p$@ -P$(b)/$@ ++ dh_strip -p$@ -P$(b)/$@ ++ dh_installman -pnuauth-utils doc/nuaclgen.8 ++ dh_installman -pnuauth-utils doc/nutop.8 ++ dh_compress -p$@ -P$(b)/$@ ++ dh_fixperms -p$@ -P$(b)/$@ ++# dh_perl ++# dh_python ++ dh_makeshlibs -p$@ -P$(b)/$@ -n ++ dh_installdeb -p$@ -P$(b)/$@ ++ dh_shlibdeps -p$@ -P$(b)/$@ ++ dh_gencontrol -p$@ -P$(b)/$@ ++ dh_md5sums -p$@ -P$(b)/$@ ++ dh_builddeb -p$@ -P$(b)/$@ ++ ++nutcpc: ++ @echo "--- Building: $@" ++ dh_installdirs -p$@ -P$(b)/$@ ++ dh_testdir -p$@ -P$(b)/$@ ++ dh_testroot -p$@ -P$(b)/$@ ++ dh_installchangelogs -p$@ -P$(b)/$@ ChangeLog ++ dh_installdocs -p$@ -P$(b)/$@ ++ dh_installexamples -p$@ -P$(b)/$@ ++ dh_install -p$@ ++# rm debian/$@/usr/sbin/nufw ++# dh_installmenu ++ dh_installman -pnutcpc doc/nutcpc.1 ++ dh_installdebconf -p$@ -P$(b)/$@ ++# dh_installlogrotate ++# dh_installemacsen ++# dh_installpam ++# dh_installmime ++# dh_installcron ++# dh_installinfo ++ dh_link -p$@ -P$(b)/$@ ++ dh_strip -p$@ -P$(b)/$@ ++ dh_compress -p$@ -P$(b)/$@ ++ dh_fixperms -p$@ -P$(b)/$@ ++# dh_perl ++# dh_python ++ dh_makeshlibs -p$@ -P$(b)/$@ -n ++ dh_installdeb -p$@ -P$(b)/$@ ++ dh_shlibdeps -L libnuclient3 -l debian/libnuclient3/usr/lib -p$@ -P$(b)/$@ ++ dh_gencontrol -p$@ -P$(b)/$@ ++ dh_md5sums -p$@ -P$(b)/$@ ++ dh_builddeb -p$@ -P$(b)/$@ ++ ++install: install-stamp ++install-stamp: ++ dh_testdir -a ++ @echo "Installing $@" ++ dh_testroot -a ++# dh_clean -k -a ++# dh_installdirs -a ++ ++ # Add here commands to install the package into debian/nufw. ++ #$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp/ ++#default certificates ++# cp $(CURDIR)/conf/certs/nufw-key.pem $(CURDIR)/debian/tmp/etc/nufw/certs ++# cp $(CURDIR)/conf/certs/nufw-cert.pem $(CURDIR)/debian/tmp/etc/nufw/certs ++# cp $(CURDIR)/conf/certs/nuauth-key.pem $(CURDIR)/debian/tmp/etc/nufw/certs ++# cp $(CURDIR)/conf/certs/nuauth-cert.pem $(CURDIR)/debian/tmp/etc/nufw/certs ++ ++# cp $(CURDIR)/conf/nufw.init $(CURDIR)/debian/tmp/etc/init.d/nufw ++# cp $(CURDIR)/conf/nuauth $(CURDIR)/debian/tmp/etc/init.d/nuauth ++# chmod 755 $(CURDIR)/debian/tmp/etc/init.d/* ++# ln -s $(CURDIR)/debian/tmp/usr/lib/nuauth $(CURDIR)/debian/tmp/usr/lib/nuauth ++ touch $(maindir)/install-stamp ++ ++ ++# Build architecture-independent files here. ++binary-indep: build install ++# We have nothing to do by default. ++ ++# Build architecture-dependent files here. ++binary-arch: build install ++# dh_testdir $(dhbuildpackages) ++# dh_testroot $(dhbuildpackages) ++# dh_installchangelogs $(dhbuildpackages) ChangeLog ++# dh_installdocs $(dhbuildpackages) ++# dh_installexamples $(dhbuildpackages) ++# dh_install $(dhbuildpackages) --sourcedir=debian/tmp ++## dh_installmenu ++# dh_installdebconf $(dhbuildpackages) ++## dh_installlogrotate ++## dh_installemacsen ++## dh_installpam ++## dh_installmime ++# dh_installinit $(dhbuildpackages) -u"start 40 2 3 4 5 . stop 89 0 1 6 ." ++## dh_installcron ++## dh_installinfo ++# dh_installman -pnufw doc/nufw.1 ++# dh_installman -pnuauth doc/nuauth.1 ++# dh_installman -pnutcpc doc/nutcpc.1 ++# dh_installman -pnuauth-utils doc/nuaclgen.1 ++# dh_installman -pnuauth-utils doc/nutop.1 ++# dh_link $(dhbuildpackages) ++# dh_strip $(dhbuildpackages) ++# dh_compress $(dhbuildpackages) ++# dh_fixperms $(dhbuildpackages) ++## dh_perl ++## dh_python ++# dh_makeshlibs $(dhbuildpackages) -n ++# dh_installdeb $(dhbuildpackages) ++# dh_shlibdeps $(dhbuildpackages) ++# dh_gencontrol $(dhbuildpackages) ++# dh_md5sums $(dhbuildpackages) ++# dh_builddeb $(dhbuildpackages) ++ ++binary: binary-indep binary-arch ++.PHONY: build clean binary-indep binary-arch binary install +--- nufw-2.2.21.orig/debian/copyright ++++ nufw-2.2.21/debian/copyright +@@ -0,0 +1,29 @@ ++This package was debianized by Vincent Deffontaines on ++Thu, 13 Nov 2003 13:03:54 +0100. ++ ++It was downloaded from http://www.nufw.org ++ ++Upstream Authors: Eric Leblond ++ Vincent Deffontaines ++ ++Copyright (C) 2007-2008 INL ++ ++NuFW is licensed under the GPLv2 ++ ++ This package 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; version 2 dated June, 1991. ++ ++ This package 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 package; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, ++ MA 02110-1301, USA. ++ ++On Debian GNU/Linux systems, the complete text of the GNU General ++Public License 2 can be found in `/usr/share/common-licenses/GPL-2'. ++ +--- nufw-2.2.21.orig/debian/README.Debian ++++ nufw-2.2.21/debian/README.Debian +@@ -0,0 +1,54 @@ ++TLS and certificates ++-------------------- ++ ++By default, NuFW requires a valid certificate authority, and valid certificates to ++be installed on all components (especially for nuauth and nufw). ++See http://nufw.org/docs/handbook22.html#hardening for details. ++ ++To make the installation easier, the Debian package uses the non-strict mode ++by default. ++ ++The following modifications have been done (revert them to use strict mode): ++ ++In file /etc/default/nufw, change :: ++ ++ NUFW_OPTIONS="" ++ ++to :: ++ ++ NUFW_OPTIONS="-s" ++ ++In file /etc/nufw/nuauth.conf, change :: ++ ++ nuauth_tls_request_cert=2 ++ # nuauth_tls_disable_nufw_fqdn_check=0 ++ ++to :: ++ ++ nuauth_tls_request_cert=1 ++ nuauth_tls_disable_nufw_fqdn_check=1 ++ ++ ++Documentation ++------------- ++ ++NuFW handbook (containing the installation guide, and more information) can ++be found at: ++ ++http://nufw.org/docs/handbook22.html ++ ++PDF version: http://nufw.org/docs/handbook22.pdf ++ ++The handbook is not packaged in Debian due to the license (Creative ++Commons by-nc-sa 3.0). ++ ++An installation guide for Debian can be found at: ++http://software.inl.fr/trac/wiki/nufw_install_debian ++ ++ ++More links: ++Documentation, links, forums, etc.: ++ http://software.inl.fr/trac/wiki/EdenWall/NuFW ++ ++ -- Pierre Chifflier Tue, 25 Nov 2008 11:45:25 +0100 ++ +--- nufw-2.2.21.orig/debian/libnuclient3.postinst ++++ nufw-2.2.21/debian/libnuclient3.postinst +@@ -0,0 +1,19 @@ ++#!/bin/sh ++ ++set -e ++ ++# dh_installdeb will replace this with shell code automatically ++# generated by other debhelper scripts. ++ ++case "$1" in ++ configure) ++ ++ ldconfig ++ ++ ;; ++esac ++ ++#DEBHELPER# ++ ++exit 0 ++ +--- nufw-2.2.21.orig/debian/nuauth-log-mysql.install ++++ nufw-2.2.21/debian/nuauth-log-mysql.install +@@ -0,0 +1,3 @@ ++src/nuauth/modules/log_mysql/.libs/libmysql.a usr/lib/nuauth/modules ++src/nuauth/modules/log_mysql/libmysql.la usr/lib/nuauth/modules ++src/nuauth/modules/log_mysql/.libs/libmysql.so usr/lib/nuauth/modules +--- nufw-2.2.21.orig/debian/nuauth.postinst ++++ nufw-2.2.21/debian/nuauth.postinst +@@ -0,0 +1,72 @@ ++#!/bin/sh ++CONFIGFILE1=/etc/default/nuauth ++CONFIGFILE2=/etc/nufw/nuauth.conf ++set -e ++. /usr/share/debconf/confmodule ++ ++grepconf () { ++ w=" " # space tab ++ sq=/etc/nufw/nuauth.conf ++ # sed is cool. ++ res=`sed -ne ' ++ s/^\s*'$1'\s*=\s*"\?\([^"]*\)\"$/\1/p; ++ t end; ++ d; ++ :end q' < $sq` ++ [ -n "$res" ] || res=$2 ++ echo "$res" ++} ++ ++grepdefault () { ++ w=" " # space tab ++ sq=/etc/default/nuauth ++ # sed is cool. ++ res=`sed -ne ' ++ s/^\s*'$1'\s*=\s*"\?\([^"]*\)\"$/\1/p; ++ t end; ++ d; ++ :end q' < $sq` ++ [ -n "$res" ] || res=$2 ++ echo "$res" ++} ++ ++# Installing the config ++ucf --three-way --debconf-ok /usr/share/nuauth/nuauth.conf /etc/nufw/nuauth.conf ++ ++NUAUTH_USER=`grepdefault NUAUTH_USER nobody` ++nuauth_tls_key=`grepconf nuauth_tls_key /etc/nufw/certs/nuauth-key.pem` ++nuauth_tls_cert=`grepconf nuauth_tls_cert /etc/nufw/certs/nuauth-cert.pem` ++ ++if grep -q -e "^$NUAUTH_USER:" /etc/passwd ++then ++ chown $NUAUTH_USER /var/run/nuauth/ ++else ++ echo "FATAL : User \"$NUAUTH_USER\" does not exist, but is supposed to run nuath" ++ exit -1 ++fi ++ ++ ++# ssl certificate generation ++if [ -x /usr/bin/openssl ]; then ++ if [ ! -e $nuauth_tls_key ]; then ++ ++ make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/nufw/certs/nuauth.pem ++ ++ if [ -f /etc/nufw/certs/nuauth.pem ]; then ++ # split key and certificate data ++ openssl x509 -in /etc/nufw/certs/nuauth.pem -out $nuauth_tls_cert ++ openssl rsa -in /etc/nufw/certs/nuauth.pem -out $nuauth_tls_key ++ chmod 0600 $nuauth_tls_key ++ chown $NUAUTH_USER $nuauth_tls_key ++ rm -f /etc/nufw/certs/nuauth.pem ++ find /etc/nufw/certs -type l -maxdepth 1 -delete ++ fi ++ ++ fi ++fi ++ ++db_stop ++ ++#DEBHELPER# ++ ++exit 0 +--- nufw-2.2.21.orig/debian/nuauth-utils.install ++++ nufw-2.2.21/debian/nuauth-utils.install +@@ -0,0 +1,5 @@ ++conf/nuaclgen.conf etc/nufw ++conf/nutop.conf etc/nufw ++scripts/nuaclgen usr/bin ++scripts/nutop usr/bin ++scripts/clean_conntrack.pl usr/sbin +--- nufw-2.2.21.orig/debian/control ++++ nufw-2.2.21/debian/control +@@ -0,0 +1,186 @@ ++Source: nufw ++Section: net ++Priority: optional ++XS-Python-Version: all ++Maintainer: Pierre Chifflier ++Build-Depends: debhelper (>= 5), po-debconf, automake1.9, ++ libldap2-dev, libglib2.0-dev, ++ libmysqlclient-dev | libmysqlclient15-dev, ++ libpq-dev, ++ iptables-dev, ++ libtool, ++ libgnutls-dev|libgnutls11-dev, libsasl2-dev, ++ libpam0g-dev, ++ libprelude-dev, ++ libnetfilter-conntrack-dev, libnetfilter-queue-dev, libnfnetlink-dev, ++ python-support (>= 0.4), python-dev, ++ pkg-config, ++ chrpath ++Standards-Version: 3.8.2 ++Homepage: http://www.nufw.org/-English-.html ++ ++Package: nufw ++Architecture: any ++Depends: ${shlibs:Depends}, ${misc:Depends}, debconf (>= 1.3.22), ssl-cert, openssl ++Suggests: ulogd, ulogd-mysql ++Description: The authenticating firewall [NFQUEUE daemon] ++ NuFW is an authenticating firewall based on netfilter's NFQUEUE target. ++ It allows to write filtering rules based on user identity, in addition ++ to classical network criteria. Unless other solutions, NuFW uses a ++ strict security model and can apply different access rules to users ++ connected on the same host, for example. ++ . ++ NuFW can: ++ * Act as a traditional firewall ++ * Add user identity to the list of parameters used to write firewall rules ++ * Authenticate any connection or protocol ++ * Perform accounting, routing and quality of service based on users ++ * Filter packets with criteria such as application and OS ++ * Log all traffic in SQL with username and application information ++ * Be the key of a secure and simple Single Sign On system. ++ . ++ This package provides the daemon receiving packets through the NFQUEUE ++ netfilter rule. Informations about those packets are forwarded to the ++ nuauth daemon, which decides if packets should be accepted or denied, ++ sends back the information to Nufw that applies decisions. ++ ++Package: nuauth ++Architecture: any ++Pre-Depends: passwd, adduser ++Depends: ${shlibs:Depends}, ${misc:Depends}, debconf (>= 1.3.22), ucf, libsasl2-modules, ssl-cert, openssl ++Recommends: nuauth-utils ++Description: The authenticating firewall [authentication daemon] ++ NuFW is an authenticating firewall based on netfilter's NFQUEUE target. ++ It allows to write filtering rules based on user identity, in addition ++ to classical network criteria. Unless other solutions, NuFW uses a ++ strict security model and can apply different access rules to users ++ connected on the same host, for example. ++ . ++ NuFW can: ++ * Act as a traditional firewall ++ * Add user identity to the list of parameters used to write firewall rules ++ * Authenticate any connection or protocol ++ * Perform accounting, routing and quality of service based on users ++ * Filter packets with criteria such as application and OS ++ * Log all traffic in SQL with username and application information ++ * Be the key of a secure and simple Single Sign On system. ++ . ++ This package provides the authentication daemon, which uses a user database ++ (though PAM modules) and an ACL database (which can be a LDAP directory, ++ or XML/DBM files, etc.). ++ Nuauth handles both client authentication, taking decisions on requests ++ sent by the nufw daemon to accept packets or not, and sending decision ++ to the nufw daemon. ++ ++Package: nuauth-extra ++Architecture: any ++Depends: ${shlibs:Depends}, ${misc:Depends}, nuauth ++Recommends: nuauth-utils ++Description: The authenticating firewall [extra modules] ++ NuFW is an authenticating firewall based on netfilter's NFQUEUE target. ++ It allows to write filtering rules based on user identity, in addition ++ to classical network criteria. Unless other solutions, NuFW uses a ++ strict security model and can apply different access rules to users ++ connected on the same host, for example. ++ . ++ Nuauth-extra provides extra modules for nuauth, such as the ipauth_guest ++ and auth_mysql modules. ++ ++Package: nuauth-log-mysql ++Architecture: any ++Depends: ${shlibs:Depends}, ${misc:Depends}, nuauth ++Recommends: nuauth-utils ++Description: The authenticating firewall [MySQL log module] ++ NuFW is an authenticating firewall based on netfilter's NFQUEUE target. ++ It allows to write filtering rules based on user identity, in addition ++ to classical network criteria. Unless other solutions, NuFW uses a ++ strict security model and can apply different access rules to users ++ connected on the same host, for example. ++ . ++ This package adds support for nuauth logging users activity into a MySQL ++ database. You can use this for an SSO solution, too. ++ ++Package: nuauth-log-pgsql ++Architecture: any ++Depends: ${shlibs:Depends}, ${misc:Depends}, nuauth ++Recommends: nuauth-utils ++Description: The authenticating firewall [PostgreSQL log module] ++ NuFW is an authenticating firewall based on netfilter's NFQUEUE target. ++ It allows to write filtering rules based on user identity, in addition ++ to classical network criteria. Unless other solutions, NuFW uses a ++ strict security model and can apply different access rules to users ++ connected on the same host, for example. ++ . ++ This package adds support for nuauth logging users activity into a PostgreSQL ++ database. You can use this for an SSO solution, too. ++ ++Package: nutcpc ++Architecture: any ++Depends: ${shlibs:Depends}, ${misc:Depends}, libnuclient3 (= ${binary:Version}) ++Description: The authenticating firewall [client] ++ NuFW is an authenticating firewall based on netfilter's NFQUEUE target. ++ It allows to write filtering rules based on user identity, in addition ++ to classical network criteria. Unless other solutions, NuFW uses a ++ strict security model and can apply different access rules to users ++ connected on the same host, for example. ++ . ++ nutcpc is a console-mode client for the NUFW authenticating firewall. ++ It is in charge of authenticating the user, and replying to nuauth requests ++ to send information on network connections. ++ ++Package: nuauth-utils ++Architecture: all ++Depends: ${shlibs:Depends}, ${python:Depends}, ${misc:Depends}, python-ipy, perl, libnet-ldap-perl, nuauth ++XB-Python-Version: ${python:Versions} ++Description: The authenticating firewall [tools for admin] ++ NuFW is an authenticating firewall based on netfilter's NFQUEUE target. ++ It allows to write filtering rules based on user identity, in addition ++ to classical network criteria. Unless other solutions, NuFW uses a ++ strict security model and can apply different access rules to users ++ connected on the same host, for example. ++ . ++ nuaclgen is a perl script that helps generate LDAP ACLs for use with nuauth, ++ the nufw authentication daemon. nuauth_command is a Python script to control ++ the nuauth daemon. ++ ++Package: libnuclient3 ++Architecture: any ++Depends: ${shlibs:Depends}, ${misc:Depends}, libsasl2-modules ++Replaces: libnuclient ++Conflicts: libnuclient ++Description: The authenticating firewall [client library] ++ NuFW is an authenticating firewall based on netfilter's NFQUEUE target. ++ It allows to write filtering rules based on user identity, in addition ++ to classical network criteria. Unless other solutions, NuFW uses a ++ strict security model and can apply different access rules to users ++ connected on the same host, for example. ++ . ++ This library provides the library for nufw clients. ++ ++Package: libnuclient-dev ++Architecture: any ++Depends: ${shlibs:Depends}, ${misc:Depends}, libsasl2-dev, libgnutls-dev|libgnutls11-dev, libnuclient3 (= ${binary:Version}) ++Section: libdevel ++Description: The authenticating firewall [client development files] ++ NuFW is an authenticating firewall based on netfilter's NFQUEUE target. ++ It allows to write filtering rules based on user identity, in addition ++ to classical network criteria. Unless other solutions, NuFW uses a ++ strict security model and can apply different access rules to users ++ connected on the same host, for example. ++ . ++ This library provides files needed to develop a NuFW client. ++ ++Package: libpam-nufw ++Architecture: any ++Depends: ${shlibs:Depends}, ${misc:Depends}, libnuclient3 (= ${binary:Version}) ++Description: The authenticating firewall [PAM module] ++ NuFW is an authenticating firewall based on netfilter's NFQUEUE target. ++ It allows to write filtering rules based on user identity, in addition ++ to classical network criteria. Unless other solutions, NuFW uses a ++ strict security model and can apply different access rules to users ++ connected on the same host, for example. ++ . ++ This packages contains a PAM module to transparently authenticate to the NuFW ++ authentication daemon. It uses the login and password to start a NuFW client, ++ for the duration of the session. ++ +--- nufw-2.2.21.orig/debian/nufw.install ++++ nufw-2.2.21/debian/nufw.install +@@ -0,0 +1 @@ ++usr/sbin/nufw +--- nufw-2.2.21.orig/debian/nutcpc.dirs ++++ nufw-2.2.21/debian/nutcpc.dirs +@@ -0,0 +1 @@ ++usr/bin +--- nufw-2.2.21.orig/debian/nuauth-log-pgsql.docs ++++ nufw-2.2.21/debian/nuauth-log-pgsql.docs +@@ -0,0 +1 @@ ++conf/nulog.pgsql.dump +--- nufw-2.2.21.orig/debian/nufw.default ++++ nufw-2.2.21/debian/nufw.default +@@ -0,0 +1,26 @@ ++#Change to "true" for Nufw to be started ++NUFW_START="true" ++ ++#Add "v"s so nufw gets more verbose ++NUFW_VERBOSITY="vv" ++ ++#Address of the nuauth server ++#NUFW_NUAUTH_ADDRESS="127.0.0.1" ++ ++#UDP port the nuauth server listens on ++#NUFW_NUAUTH_PORT=4128 ++ ++#Timeout to forget about packets when there's no match (seconds) ++#NUFW_TIMEOUT=15 ++ ++#Track Size ++#NUFW_TRACK_SIZE=1000 ++ ++#SSL certificates and keys ++NUFW_SSL_CERTIFICATE="/etc/nufw/certs/nufw-cert.pem" ++NUFW_SSL_KEY="/etc/nufw/certs/nufw-key.pem" ++ ++# Additional options ++# For ex., add -s here to disable TLS strict checking mode ++# See http://nufw.org/docs/handbook22.html#hardening ++NUFW_OPTIONS="-s" +--- nufw-2.2.21.orig/debian/docs ++++ nufw-2.2.21/debian/docs +@@ -0,0 +1,3 @@ ++NEWS ++README ++TODO +--- nufw-2.2.21.orig/debian/nufw.init ++++ nufw-2.2.21/debian/nufw.init +@@ -0,0 +1,117 @@ ++#! /bin/sh ++# ++# Written by Miquel van Smoorenburg . ++# Modified for Debian ++# by Ian Murdock . ++# Customized for nufw by Vincent Deffontaines ++# ++# ++ ++### BEGIN INIT INFO ++# Provides: nufw-nfqueue ++# Required-Start: $syslog ++# Required-Stop: $syslog ++# Should-Start: $local_fs ++# Should-Stop: $local_fs ++# Default-Start: 2 3 4 5 ++# Default-Stop: 0 1 6 ++# Short-Description: Control script for nufw ++# Description: Init script to control (start/stop/reload) ++# the nufw server. ++### END INIT INFO ++ ++PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin ++DAEMON=/usr/sbin/nufw ++NAME=nufw ++PID=nufw ++DESC=nufw ++NUFW_START="false" ++ ++ ++test -x $DAEMON || exit 0 ++ ++NUFW_OPTIONS="" ++ ++# Include nufw defaults if available ++if [ -f /etc/default/nufw ] ; then ++ . /etc/default/nufw ++fi ++ ++if [ "$NUFW_START" != "true" ]; then ++ exit 0 ++fi ++ ++if [ -z "$NUFW_VERBOSITY" ]; then ++ NUFW_VERBOSITY="vv" ++fi ++ ++if [ "$NUFW_NUAUTH_ADDRESS" != "" ]; then ++ NUFW_OPTIONS="$NUFW_OPTIONS -d $NUFW_NUAUTH_ADDRESS" ++fi ++ ++if [ "$NUFW_NUAUTH_PORT" != "" ]; then ++ NUFW_OPTIONS="$NUFW_OPTIONS -p $NUFW_NUAUTH_PORT" ++fi ++ ++if [ "$NUFW_TIMEOUT" != "" ]; then ++ NUFW_OPTIONS="$NUFW_OPTIONS -t $NUFW_TIMEOUT" ++fi ++ ++if [ "$NUFW_TRACK_SIZE" != "" ]; then ++ NUFW_OPTIONS="$NUFW_OPTIONS -T $NUFW_TRACK_SIZE" ++fi ++ ++DAEMON_OPTS="-D -$NUFW_VERBOSITY \ ++ $NUFW_OPTIONS \ ++ -k $NUFW_SSL_KEY -c $NUFW_SSL_CERTIFICATE -C -M -m" ++ ++set -e ++ ++case "$1" in ++ start) ++ echo -n "Starting $DESC: " ++ start-stop-daemon --start --quiet --pidfile /var/run/$PID.pid \ ++ --exec $DAEMON -- $DAEMON_OPTS ++ echo "$NAME." ++ ;; ++ stop) ++ echo -n "Stopping $DESC: " ++ start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/$PID.pid \ ++ --retry 5 --exec $DAEMON ++ echo "$NAME." ++ ;; ++ #reload) ++ # ++ # If the daemon can reload its config files on the fly ++ # for example by sending it SIGHUP, do it here. ++ # ++ # If the daemon responds to changes in its config file ++ # directly anyway, make this a do-nothing entry. ++ # ++ # echo "Reloading $DESC configuration files." ++ # start-stop-daemon --stop --signal 1 --quiet --pidfile \ ++ # /var/run/$NAME.pid --exec $DAEMON ++ #;; ++ restart|force-reload) ++ # ++ # If the "reload" option is implemented, move the "force-reload" ++ # option to the "reload" entry above. If not, "force-reload" is ++ # just the same as "restart". ++ # ++ echo -n "Restarting $DESC: " ++ start-stop-daemon --stop --quiet --oknodo --pidfile \ ++ /var/run/$PID.pid --retry 5 --exec $DAEMON ++ sleep 1 ++ start-stop-daemon --start --quiet --pidfile \ ++ /var/run/$PID.pid --exec $DAEMON -- $DAEMON_OPTS ++ echo "$NAME." ++ ;; ++ *) ++ N=/etc/init.d/$NAME ++ # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 ++ echo "Usage: $N {start|stop|restart|force-reload}" >&2 ++ exit 1 ++ ;; ++esac ++ ++exit 0 +--- nufw-2.2.21.orig/debian/nuauth.postrm ++++ nufw-2.2.21/debian/nuauth.postrm +@@ -0,0 +1,45 @@ ++#! /bin/sh ++# postrm script for nuauth ++# ++# see: dh_installdeb(1) ++ ++set -e ++ ++# summary of how this script can be called: ++# * `remove' ++# * `purge' ++# * `upgrade' ++# * `failed-upgrade' ++# * `abort-install' ++# * `abort-install' ++# * `abort-upgrade' ++# * `disappear' overwrit>r> ++# for details, see /usr/doc/packaging-manual/ ++ ++case "$1" in ++ purge|disappear) ++ ++# update-rc.d -f nuauth remove >/dev/null ++ userdel nuauth 2>/dev/null || true ++ for FILE in /etc/nufw/nuauth.conf; do ++ # Taken from the ucf example postrm ++ for ext in '~' '%' .bak .dpkg-tmp .dpkg-new .dpkg-old .dpkg-dist .ucf-dist; do ++ rm -f $FILE$ext ++ done ++ rm -f $FILE ++ if which ucf >/dev/null 2>&1; then ++ ucf --purge $FILE ++ fi ++ done ++ ;; ++ remove|upgrade|failed-upgrade|abort-install|abort-upgrade) ++ # nothing ++ ;; ++esac ++ ++# dh_installdeb will replace this with shell code automatically ++# generated by other debhelper scripts. ++ ++#DEBHELPER# ++ ++ +--- nufw-2.2.21.orig/debian/libpam-nufw.dirs ++++ nufw-2.2.21/debian/libpam-nufw.dirs +@@ -0,0 +1 @@ ++lib/security +--- nufw-2.2.21.orig/debian/libnuclient3.install ++++ nufw-2.2.21/debian/libnuclient3.install +@@ -0,0 +1,2 @@ ++src/clients/lib/.libs/libnuclient.so.3.0.0 usr/lib ++src/clients/lib/.libs/libnuclient.so.3 usr/lib +--- nufw-2.2.21.orig/debian/nuauth-extra.docs ++++ nufw-2.2.21/debian/nuauth-extra.docs +@@ -0,0 +1,4 @@ ++conf/auth_mysql/auth_mysql.ipv4.mysql.dump ++conf/auth_mysql/auth_mysql.ipv6.mysql.dump ++conf/auth_mysql/check_net.mysql ++scripts/auth_mysql/authmysql +--- nufw-2.2.21.orig/debian/nuauth.preinst ++++ nufw-2.2.21/debian/nuauth.preinst +@@ -0,0 +1,50 @@ ++#!/bin/sh ++ ++set -e ++ ++# summary of how this script can be called: ++# * `install' ++# * `install' ++# * `upgrade' ++# * `abort-upgrade' ++ ++case "$1" in ++ install|upgrade) ++ # 1. create group if not existing ++ addgroup --quiet --system nuauth 2>/dev/null || true ++ # 2. create homedir if not existing ++ test -d /var/run/nuauth || mkdir -p /var/run/nuauth ++ # 3. create user if not existing ++ adduser --quiet \ ++ --system \ ++ --ingroup nuauth \ ++ --no-create-home \ ++ --disabled-password \ ++ nuauth 2>/dev/null || true ++ # 4. adjust passwd entry ++ usermod -c "Nuauth for NuFW" \ ++ -d /var/run/nuauth \ ++ -g nuauth \ ++ nuauth ++ # 5. adjust file and directory permissions ++ chown -R nuauth:nuauth /var/run/nuauth ++ chmod u=rwx,g=rx,o= /var/run/nuauth ++ ;; ++ configure) ++ ;; ++ abort-upgrade) ++ ;; ++ *) ++ echo "preinst called with unknown argument \`$1'" >&2 ++ exit 0 ++ ;; ++esac ++ ++# dh_installdeb will replace this with shell code automatically ++# generated by other debhelper scripts. ++ ++#DEBHELPER# ++ ++exit 0 ++ ++ +--- nufw-2.2.21.orig/debian/compat ++++ nufw-2.2.21/debian/compat +@@ -0,0 +1 @@ ++5 +--- nufw-2.2.21.orig/debian/watch ++++ nufw-2.2.21/debian/watch +@@ -0,0 +1,11 @@ ++# debian watch file ++# You can run the "uscan" command ++# to check for upstream updates and more. ++# See uscan(1) for format ++ ++# Compulsory line, this is a version 3 file ++version=3 ++ ++#http://nufw.org/download/nufw/nufw-2.2.3.tar.gz ++http://nufw.org/download/nufw/nufw-([0-9].*)\.tar\.gz ++ +--- nufw-2.2.21.orig/debian/nutcpc.docs ++++ nufw-2.2.21/debian/nutcpc.docs +@@ -0,0 +1,3 @@ ++NEWS ++README ++TODO +--- nufw-2.2.21.orig/debian/libnuclient-dev.dirs ++++ nufw-2.2.21/debian/libnuclient-dev.dirs +@@ -0,0 +1 @@ ++usr/include/nuclient +--- nufw-2.2.21.orig/debian/libpam-nufw.install ++++ nufw-2.2.21/debian/libpam-nufw.install +@@ -0,0 +1 @@ ++src/clients/pam_nufw/.libs/pam_nufw.so lib/security +--- nufw-2.2.21.orig/debian/nuauth-log-mysql.dirs ++++ nufw-2.2.21/debian/nuauth-log-mysql.dirs +@@ -0,0 +1 @@ ++usr/lib +--- nufw-2.2.21.orig/debian/nuauth.init ++++ nufw-2.2.21/debian/nuauth.init +@@ -0,0 +1,107 @@ ++#! /bin/sh ++# ++# Written by Miquel van Smoorenburg . ++# Modified for Debian ++# by Ian Murdock . ++# Customized for nuauth by Vincent Deffontaines ++# ++# ++ ++### BEGIN INIT INFO ++# Provides: nuauth ++# Required-Start: $syslog ++# Required-Stop: $syslog ++# Should-Start: $local_fs ++# Should-Stop: $local_fs ++# Default-Start: 2 3 4 5 ++# Default-Stop: 0 1 6 ++# Short-Description: Control script for nuauth ++# Description: Init script to control (start/stop/reload) ++# the nuauth server. ++### END INIT INFO ++ ++PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin ++DAEMON=/usr/sbin/nuauth ++PID=nuauth ++NAME=nuauth ++DESC=nuauth ++NUAUTH_START="no" ++ ++ ++test -x $DAEMON || exit 0 ++ ++# Include nuauth defaults if available ++if [ -f /etc/default/nuauth ] ; then ++ . /etc/default/nuauth ++fi ++ ++if [ "$NUAUTH_START" != "true" ]; then ++ exit 0 ++fi ++ ++if [ ! "$NUAUTH_VERBOSITY" ]; then ++ NUAUTH_VERBOSITY="vv" ++fi ++ ++if [ ! "$NUAUTH_USER" ]; then ++ echo "No user configured to run nuauth... Trying \"nobody\" ..." ++ NUAUTH_USER="nobody" ++fi ++ ++DAEMON_OPTS="-D -$NUAUTH_VERBOSITY" ++ ++set -e ++ ++case "$1" in ++ start) ++ # ubuntu wipes everything in /var/run at boot ++ if [ ! -d /var/run/nuauth ]; then ++ mkdir /var/run/nuauth ++ chown $NUAUTH_USER /var/run/nuauth ++ fi ++ echo -n "Starting $DESC: " ++ start-stop-daemon --start --quiet --pidfile /var/run/$PID/$PID.pid \ ++ --chuid $NUAUTH_USER --exec $DAEMON -- $DAEMON_OPTS ++ echo "$NAME." ++ ;; ++ stop) ++ echo -n "Stopping $DESC: " ++ start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/$PID/$PID.pid \ ++ --retry 5 --exec $DAEMON ++ echo "$NAME." ++ ;; ++ #reload) ++ # ++ # If the daemon can reload its config files on the fly ++ # for example by sending it SIGHUP, do it here. ++ # ++ # If the daemon responds to changes in its config file ++ # directly anyway, make this a do-nothing entry. ++ # ++ # echo "Reloading $DESC configuration files." ++ # start-stop-daemon --stop --signal 1 --quiet --pidfile \ ++ # /var/run/$NAME.pid --exec $DAEMON ++ #;; ++ restart|force-reload) ++ # ++ # If the "reload" option is implemented, move the "force-reload" ++ # option to the "reload" entry above. If not, "force-reload" is ++ # just the same as "restart". ++ # ++ echo -n "Restarting $DESC: " ++ start-stop-daemon --stop --quiet --oknodo --pidfile \ ++ /var/run/$PID/$PID.pid --retry 5 --exec $DAEMON ++ sleep 1 ++ start-stop-daemon --start --quiet --pidfile /var/run/$PID/$PID.pid \ ++ --chuid $NUAUTH_USER --exec $DAEMON -- $DAEMON_OPTS ++ echo "$NAME." ++ ;; ++ *) ++ N=/etc/init.d/$NAME ++ # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 ++ echo "Usage: $N {start|stop|restart|force-reload}" >&2 ++ exit 1 ++ ;; ++esac ++ ++exit 0 +--- nufw-2.2.21.orig/debian/nuauth-utils.dirs ++++ nufw-2.2.21/debian/nuauth-utils.dirs +@@ -0,0 +1 @@ ++etc/nufw +--- nufw-2.2.21.orig/debian/nufw.dirs ++++ nufw-2.2.21/debian/nufw.dirs +@@ -0,0 +1,2 @@ ++etc/nufw/certs ++usr/sbin +--- nufw-2.2.21.orig/debian/nuauth.docs ++++ nufw-2.2.21/debian/nuauth.docs +@@ -0,0 +1,4 @@ ++NEWS ++README ++TODO ++conf/acls.schema +--- nufw-2.2.21.orig/debian/pycompat ++++ nufw-2.2.21/debian/pycompat +@@ -0,0 +1 @@ ++2 +--- nufw-2.2.21.orig/debian/nufw.postinst ++++ nufw-2.2.21/debian/nufw.postinst +@@ -0,0 +1,31 @@ ++#!/bin/sh ++CONFIGFILE=/etc/default/nufw ++ ++set -e ++#set -x ++. /usr/share/debconf/confmodule ++ ++# ssl certificate generation ++if [ -x /usr/bin/openssl ]; then ++ if [ ! -e /etc/nufw/certs/nufw-key.pem ]; then ++ ++ make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/nufw/certs/nufw.pem ++ ++ if [ -f /etc/nufw/certs/nufw.pem ]; then ++ # split key and certificate data ++ openssl x509 -in /etc/nufw/certs/nufw.pem -out /etc/nufw/certs/nufw-cert.pem ++ openssl rsa -in /etc/nufw/certs/nufw.pem -out /etc/nufw/certs/nufw-key.pem ++ chmod 0600 /etc/nufw/certs/nufw-key.pem ++ rm -f /etc/nufw/certs/nufw.pem ++ find /etc/nufw/certs -type l -maxdepth 1 -delete ++ fi ++ ++ fi ++fi ++ ++db_stop ++ ++ ++#DEBHELPER# ++ ++exit 0 +--- nufw-2.2.21.orig/debian/libnuclient-dev.install ++++ nufw-2.2.21/debian/libnuclient-dev.install +@@ -0,0 +1,4 @@ ++src/clients/lib/.libs/libnuclient.so usr/lib ++src/clients/lib/libnuclient.la usr/lib ++src/clients/lib/nuclient.h usr/include/nuclient ++src/include/nufw_source.h usr/include/nuclient +--- nufw-2.2.21.orig/debian/changelog ++++ nufw-2.2.21/debian/changelog +@@ -0,0 +1,560 @@ ++nufw (2.2.21-4) unstable; urgency=high ++ ++ * Fix FTBFS against gnutls26 >= 2.7.x (Closes: #529841) ++ This required to run autogen.sh ++ * Urgency high because of above bug ++ * Update dependency on libmysqlclient-dev ++ * Bump standards version to 3.8.2 (no changes) ++ ++ -- Pierre Chifflier Sat, 15 Aug 2009 16:33:32 +0200 ++ ++nufw (2.2.21-3) unstable; urgency=low ++ ++ * Apply patch from Jérôme Soyer: ++ * Add more modules to nuauth: ++ - mark_field ++ - mark_flag ++ - session_authtype ++ * Add more modules to nuauth-extra: ++ - script ++ ++ -- Pierre Chifflier Tue, 10 Mar 2009 15:34:07 +0100 ++ ++nufw (2.2.21-2) unstable; urgency=low ++ ++ * Upload to unstable ++ ++ -- Pierre Chifflier Wed, 25 Feb 2009 12:03:36 +0100 ++ ++nufw (2.2.21-1) experimental; urgency=low ++ ++ * New upstream release ++ ++ -- Pierre Chifflier Wed, 04 Feb 2009 13:49:18 +0100 ++ ++nufw (2.2.20-2) experimental; urgency=low ++ ++ * Add Homepage field (Closes: #511453) ++ ++ -- Pierre Chifflier Mon, 19 Jan 2009 11:08:20 +0100 ++ ++nufw (2.2.20-1) experimental; urgency=low ++ ++ * New upstream release ++ ++ -- Pierre Chifflier Wed, 10 Dec 2008 13:36:54 +0100 ++ ++nufw (2.2.19-1) experimental; urgency=low ++ ++ * New upstream release ++ * Upstream uses strict TLS checking mode by default. Use less ++ strict, but easier to use configuration (see README.Debian) ++ ++ -- Pierre Chifflier Fri, 05 Dec 2008 10:21:05 +0100 ++ ++nufw (2.2.15-3) unstable; urgency=low ++ ++ * Rewrite certificate generation code to use make-ssl-cert (Closes: #497778) ++ ++ -- Pierre Chifflier Thu, 04 Sep 2008 13:49:00 +0200 ++ ++nufw (2.2.15-2) unstable; urgency=high ++ ++ * Remove rpath to insecure location (Closes: #495769) ++ * urgency=high because of RC bug ++ * Add dependency on rpath ++ * Bump standards version (no changes) ++ ++ -- Pierre Chifflier Mon, 25 Aug 2008 11:42:20 +0200 ++ ++nufw (2.2.15-1) unstable; urgency=low ++ ++ * New upstream release ++ * Rebuild with support for several python versions (Closes: #476238) ++ ++ -- Pierre Chifflier Tue, 15 Apr 2008 15:54:47 +0200 ++ ++nufw (2.2.14-2) unstable; urgency=low ++ ++ * Rebuild for python transition (Closes: #476173) ++ ++ -- Pierre Chifflier Tue, 15 Apr 2008 09:16:45 +0200 ++ ++nufw (2.2.14-1) unstable; urgency=low ++ ++ * New upstream release ++ * Debian directory is now separated from upstream ++ ++ -- Pierre Chifflier Tue, 08 Apr 2008 15:15:58 +0200 ++ ++nufw (2.2.13-2) unstable; urgency=low ++ ++ * Backport patch from upstream to fix build (error with inline functions) ++ ++ -- Pierre Chifflier Thu, 03 Apr 2008 11:50:15 +0200 ++ ++nufw (2.2.13-1) unstable; urgency=low ++ ++ * New upstream release ++ ++ -- Pierre Chifflier Wed, 02 Apr 2008 12:12:11 +0200 ++ ++nufw (2.2.11-2) unstable; urgency=low ++ ++ * Fix bashism in NuFW init script (Closes: #465013) ++ * Fix spelling in control (mysql -> MySQL) ++ ++ -- Pierre Chifflier Sun, 10 Feb 2008 18:22:09 +0100 ++ ++nufw (2.2.11-1) unstable; urgency=low ++ ++ * New upstream release ++ * Bump standards version ++ ++ -- Pierre Chifflier Wed, 09 Jan 2008 09:24:33 +0100 ++ ++nufw (2.2.10-2) unstable; urgency=low ++ ++ * Add python-ipy to build-deps ++ ++ -- Pierre Chifflier Wed, 05 Dec 2007 14:13:55 +0100 ++ ++nufw (2.2.10-1) unstable; urgency=low ++ ++ * New upstream release ++ ++ -- Pierre Chifflier Wed, 05 Dec 2007 09:37:11 +0100 ++ ++nufw (2.2.9-3) unstable; urgency=low ++ ++ * Change build order and tell dh_shlibdeps to search libs in correct dir .. ++ ++ -- Pierre Chifflier Fri, 30 Nov 2007 13:47:36 +0100 ++ ++nufw (2.2.9-2) unstable; urgency=low ++ ++ * Tell dh_shlibdeps to use libnuclient3 ++ ++ -- Pierre Chifflier Fri, 30 Nov 2007 12:01:34 +0100 ++ ++nufw (2.2.9-1) unstable; urgency=low ++ ++ * New upstream release ++ ++ -- Pierre Chifflier Mon, 26 Nov 2007 12:17:37 +0100 ++ ++nufw (2.2.8-1) unstable; urgency=low ++ ++ * New upstream release ++ * Create directory /var/run/nuauth in package ++ * Do not use --enable-debug, so it does not flood the log with debug ++ messages ++ ++ -- Pierre Chifflier Tue, 13 Nov 2007 13:56:41 +0100 ++ ++nufw (2.2.7-1) unstable; urgency=low ++ ++ * New upstream release ++ ++ -- Pierre Chifflier Mon, 29 Oct 2007 20:09:27 +0100 ++ ++nufw (2.2.6-3) unstable; urgency=low ++ ++ * Enable Prelude module ++ ++ -- Pierre Chifflier Sun, 28 Oct 2007 09:36:37 +0100 ++ ++nufw (2.2.6-2) unstable; urgency=low ++ ++ * Make libnuclient-dev depend on libnuclient3 ++ ++ -- Pierre Chifflier Fri, 26 Oct 2007 17:53:04 +0200 ++ ++nufw (2.2.6-1) unstable; urgency=low ++ ++ * New upstream release ++ ++ -- Pierre Chifflier Wed, 10 Oct 2007 11:57:28 +0200 ++ ++nufw (2.2.5-2) unstable; urgency=low ++ ++ * Add binary package libnuclient-dev ++ ++ -- Pierre Chifflier Wed, 12 Sep 2007 21:41:39 +0200 ++ ++nufw (2.2.5-1) unstable; urgency=low ++ ++ * New upstream release ++ ++ -- Pierre Chifflier Tue, 11 Sep 2007 16:05:35 +0200 ++ ++nufw (2.2.4-1) unstable; urgency=low ++ ++ * New upstream release ++ * Add nuauth-command script to nuauth-utils ++ * Use python-support for nuauth-utils ++ * Update nuauth-utils dependencies ++ ++ -- Pierre Chifflier Mon, 20 Aug 2007 23:18:37 +0200 ++ ++nufw (2.2.3-2) unstable; urgency=low ++ ++ * Fix init script (Closes: #436958) ++ * Move system files to nuauth (Closes: #427973) ++ * Add --retry to really wait for script exit ++ ++ -- Pierre Chifflier Mon, 13 Aug 2007 15:14:06 +0200 ++ ++nufw (2.2.3-1) unstable; urgency=low ++ ++ * New upstream release ++ * Add watch file ++ * Update my mail address ++ ++ -- Pierre Chifflier Sun, 05 Aug 2007 22:28:35 +0200 ++ ++nufw (2.2.2-2) unstable; urgency=low ++ ++ * Also move system backend to nuauth (Closes: #427973) ++ ++ -- Pierre Chifflier Wed, 04 Jul 2007 11:30:30 +0200 ++ ++nufw (2.2.2-1) unstable; urgency=medium ++ ++ * New upstream release ++ + restore compatibility with 2.0 versions ++ + not compatible with 2.2.1 ++ * Do not include plaintext files in nuauth-extra (Closes: #427973) ++ * Urgency=medium because of RC bug ++ ++ -- Pierre Chifflier Tue, 26 Jun 2007 16:48:15 +0200 ++ ++nufw (2.2.1-1) unstable; urgency=low ++ ++ * New upstream release ++ * Change build dependency from postgresql-dev to libpq-dev ++ ++ -- Pierre Chifflier Mon, 18 Jun 2007 11:22:34 +0200 ++ ++nufw (2.2.0-3) unstable; urgency=high ++ ++ * Move module plaintext to nuauth (Closes: #427973) ++ * Urgency=high because of RC bug ++ * Remove dependency on libnuclient3, now correctly detected by dh_shlibdeps ++ ++ -- Pierre Chifflier Fri, 08 Jun 2007 11:36:36 +0200 ++ ++nufw (2.2.0-2) unstable; urgency=high ++ ++ * Conficts/Replaces package libnuclient (Closes: #427611) ++ * Urgency=high because of RC bug ++ ++ -- Pierre Chifflier Tue, 05 Jun 2007 14:44:13 +0200 ++ ++nufw (2.2.0-1) unstable; urgency=low ++ ++ * New upstream release ++ * Complete rewrite of the package ++ * Remove templates (Closes: #414507, #420931, #361428) ++ * Set nuauth-utils arch to all (Closes: #419923) ++ * Set myself as Maintainer, with Jean-Michel's agreement ++ * Update libnuclient files location ++ * Update copyright file ++ * Update dependencies on debconf ++ * Spell check packages descriptions ++ * Add LSB sections to init scripts ++ * Remove dependencies on libnetfilter*, detected by dh_shlibdeps ++ * Rename libnuclient to libnuclient3 ++ * Remove debconf stuff, not needed ++ * Use ucf for nuauth.conf ++ ++ -- Pierre Chifflier Tue, 29 May 2007 09:26:17 +0200 ++ ++nufw (2.0.16-1) unstable; urgency=low ++ ++ * New upstream release (Closes: #411515) ++ * Ack NMU (Closes: #378385) ++ * Add myself to Uploaders ++ * Bump Standards version to 3.7.2 ++ * Add LSB sections to init scripts ++ * Update depends on debconf ++ * Change libpam-nufw description to be less than 80 characters ++ * Change dependency to libpq-dev (Closes: #409768) ++ * Update Czech template (Closes: #412697) ++ ++ -- Pierre Chifflier Fri, 16 Mar 2007 16:24:56 +0100 ++ ++nufw (2.0.9-5.2) unstable; urgency=high ++ ++ * Non-maintainer upload. ++ * Added nauth: missing pre-dep on passwd (Closes: #408269) ++ - added pre-dep on adduser too, since it uses adduser in preinst ++ * Urgency high due RCness ++ ++ -- Bastian Venthur Thu, 1 Feb 2007 11:54:30 +0100 ++ ++nufw (2.0.9-5.1) unstable; urgency=low ++ ++ * Non-maintainer upload to fix longstanding l10n issues ++ * Add debconf-updatepo to the clean target in debian/rules ++ Closes: #349839 ++ * add the nufw20.templates and nuauth20.templates files to ++ debian/po/POTFILES.in so that these files are translated too ++ * General rewrite of the debconf templates in a desperate attempt to ++ have them DevRef compliant, remove untranslatable strings and, ++ unfortunately, drive translators crazy. Closes: #361423 ++ * Fix typo in the package description. Closes: #390090 ++ * Lintian fixes: ++ - Remove redundant declaration of conffiles in /etc. Closes: #356772 ++ * Debconf translation updates: ++ - French updated ++ - Czech updated. Closes: #345142 ++ - Swedish updated. Closes: #347608 ++ - German added. Sent during the call for updates for the NMU campaign. ++ - Russian added. Sent during the call for updates for the NMU campaign. ++ ++ -- Christian Perrier Sun, 3 Dec 2006 12:14:00 +0100 ++ ++nufw (2.0.9-5) unstable; urgency=low ++ ++ * One more patch for compilation on hppa. ++ ++ -- Jean-Michel Kelbert Sat, 2 Dec 2006 12:31:12 +0100 ++ ++nufw (2.0.9-4) unstable; urgency=low ++ ++ * Apply a patch provided by upstream to compile on hppa. This time it should ++ work ! ++ ++ -- Jean-Michel Kelbert Tue, 28 Nov 2006 21:12:17 +0100 ++ ++nufw ++(2.0.9-3) unstable; urgency=low ++ ++ * Apply a patch provided by upstream to compile on hppa. ++ ++ -- Jean-Michel Kelbert Thu, 9 Nov 2006 21:41:03 +0100 ++ ++nufw (2.0.9-2) unstable; urgency=low ++ ++ * Change copyright file to not include the entire GPL. ++ ++ -- Jean-Michel Kelbert Wed, 1 Nov 2006 20:04:30 +0100 ++ ++nufw (2.0.9-1) unstable; urgency=low ++ ++ * New upstream release. ++ * Adapt packaging to version 2. ++ * Many thanks to Vincent Deffontaines for its packaging. ++ ++ -- Jean-Michel Kelbert Mon, 9 Oct 2006 21:58:20 +0200 ++ ++nufw (1.0.23-1.1) unstable; urgency=high ++ ++ * Non-maintainer upload. ++ * Unbreak syntactically wrong debconf template, which caused problems ++ during package installation. (Closes: #360581) ++ ++ -- Steinar H. Gunderson Sun, 16 Jul 2006 00:02:00 +0200 ++ ++nufw (1.0.23-1) unstable; urgency=low ++ ++ * New upstream release ++ * Update debconf configuration to take care of new options. ++ * Upgrade build depends to libmysqlclient15-dev ++ (closes: #356719) ++ ++ -- Jean-Michel Kelbert Thu, 30 Mar 2006 21:01:38 +0200 ++ ++nufw (1.0.16-1) unstable; urgency=low ++ ++ * New upstream release. This is a security release. The NuFW team has ++ identified a problem that could lead to Denial of Service from legitimate ++ users of the authentication service. ++ This has been assigned CVE-2005-3950. ++ (closes: #341544) ++ * Add debconf-updatepo in debian/rules. ++ (closes: #329942) ++ * Add debconf-2.0 as an alternate to debconf. ++ (closes: #332049) ++ * Use gnutls12 instead of gnutls11. ++ (closes: #335769) ++ * Update the French translation for debconf. ++ (closes: #332575) ++ * Add the Swedish translation for debconf. ++ (closes: #336780) ++ ++ -- Jean-Michel Kelbert Tue, 27 Dec 2005 17:04:58 +0100 ++ ++nufw (1.0.13-1) unstable; urgency=low ++ ++ * New upstream release ++ ++ -- Jean-Michel Kelbert Sun, 16 Oct 2005 18:12:39 +0200 ++ ++nufw (1.0.11-1) unstable; urgency=low ++ ++ * Add the Vietnamese translation for debconf. ++ (closes: #316322) ++ * Add the French translation for debconf. ++ (closes: #307763) ++ * Add the Czech translation for debconf. ++ (closes: #310700) ++ ++ -- Jean-Michel Kelbert Fri, 2 Sep 2005 22:02:12 +0200 ++ ++nufw (1.0.10-1) stable; urgency=low ++ ++ * new upstream release ++ ++ -- Eric Leblond Mon, 4 Jul 2005 11:32:01 +0200 ++ ++nufw (1.0.8-1) unstable; urgency=low ++ ++ * new upstream release ++ ++ -- Eric Leblond Fri, 10 Jun 2005 15:46:35 +0200 ++ ++nufw (1.0.7-1) unstable; urgency=low ++ ++ * new upstream release ++ ++ -- Eric Leblond Wed, 8 Jun 2005 09:46:42 +0200 ++ ++nufw (1.0.6-1) unstable; urgency=low ++ ++ * new upstream release ++ ++ -- Eric Leblond Thu, 2 Jun 2005 21:56:16 +0200 ++ ++nufw (1.0.5-1) unstable; urgency=low ++ ++ * new upstream release ++ ++ -- Eric Leblond Thu, 12 May 2005 12:20:42 +0200 ++ ++nufw (1.0.3-1) unstable; urgency=low ++ ++ * new upstream release ++ ++ -- Eric Leblond Wed, 20 Apr 2005 09:17:25 +0200 ++ ++nufw (1.0.2-1) unstable; urgency=low ++ ++ * new upstream release ++ ++ -- Eric Leblond Tue, 29 Mar 2005 07:16:56 +0200 ++ ++nufw (1.0.1-1) unstable; urgency=low ++ ++ * New upstream release. ++ ++ -- Eric Leblond Tue, 15 Mar 2005 23:22:12 +0100 ++ ++nufw (1.0-1) unstable; urgency=low ++ ++ * New upstream release. ++ * Add --with-system-auth to configure in debian/rules to support PAM+NSS ++ authentication. ++ * Add --with-ldap to support LDAP directory for users and acl lookup. ++ * Add --with-gdbm to support gdbm users lookup. ++ * Add --with-ident to support support ident users authentication. ++ * Add libgcrypt11-dev, libgnutls11-dev, libident-dev, libpam-dev to ++ Build-Depends. ++ * Add postrm and preinst for nuauth. ++ ++ -- Jean-Michel Kelbert Tue, 22 Feb 2005 22:53:22 +0100 ++ ++nufw (0.8.5-3) unstable; urgency=low ++ ++ * Change debian/copyright to reflect changes made by upstreams to the ++ license. ++ * Initial upload in Debian. Thanks to Vincent Deffontaines for packaging the ++ package before me. ++ (closes: #258746) ++ ++ -- Jean-Michel Kelbert Mon, 20 Dec 2004 22:23:16 +0100 ++ ++nufw (0.8.5-1) unstable; urgency=low ++ ++ * New upstream release. ++ * Upstream add an exception to the GPL which allows linking with OpenSSL. ++ ++ -- Jean-Michel Kelbert Wed, 1 Sep 2004 23:03:10 +0200 ++ ++nufw (0.8.2-1) unstable; urgency=low ++ ++ * Update Description in debian/control. Thanks to Brandon Robinson. ++ * Switch to gettext for the debconf templates. ++ * Change the way of packaging. ++ * Correct minor policy violations. ++ ++ -- Jean-Michel Kelbert Fri, 30 Jul 2004 13:41:25 +0200 ++ ++nufw (0.8.1-1) unstable; urgency=low ++ ++ * New upstream version. Adds a paquet for libnuclient, the client ++ authentication library. ++ ++ -- Vincent Deffontaines Mon, 19 Jul 2004 21:23:13 +0200 ++ ++nufw (0.8.0-1) unstable; urgency=low ++ ++ * New upstream version. Adds the strict logs update option, together with ++ some scaling bugfix, that would cause nuauth to grow heavily on some ++ particular [DoS] conditions. ++ ++ -- Vincent Deffontaines Mon, 5 Jul 2004 21:23:13 +0200 ++ ++nufw (0.7.1-1) unstable; urgency=low ++ ++ * New upstream version. Fixes some bug that would rarely memleak nuauth. ++ Adds the SQL sync option. ++ ++ -- Vincent Deffontaines Fri, 11 Jun 2004 18:08:19 +0200 ++ ++nufw (0.7.0-1) unstable; urgency=low ++ ++ * New upstream version. 0.7.0 is the first release with SSL connections all ++ the way. ++ ++ -- Vincent Deffontaines Tue, 30 Mar 2004 21:18:37 +0200 ++ ++nufw (0.6.5-1) unstable; urgency=low ++ ++ * New upstream version ++ ++ -- Vincent Deffontaines Sun, 14 Mar 2004 18:52:38 +0100 ++ ++nufw (0.6.4-1) unstable; urgency=low ++ ++ * New upstream version ++ * Splitted debian nuauth packages into 3, so that modules support is ... ++ modular ++ ++ -- Vincent Deffontaines Wed, 7 Jan 2004 23:49:34 +0100 ++ ++nufw (0.6.3-1) unstable; urgency=low ++ ++ * Nesw upstream version ++ ++ -- Vincent Deffontaines Wed, 7 Jan 2004 00:33:47 +0100 ++ ++nufw (0.6.2-1) unstable; urgency=low ++ ++ * Upstream changed to 0.6.2 ++ ++ -- Vincent Deffontaines Sun, 4 Jan 2004 23:42:57 +0100 ++ ++nufw (0.6.1-1) unstable; urgency=low ++ ++ * Upstream changed to 0.6.1 ++ ++ -- Vincent Deffontaines Mon, 22 Dec 2003 15:55:24 +0100 ++ ++nufw (0.5.4-1) unstable; urgency=low ++ ++ * Initial Release. ++ ++ -- Vincent Deffontaines Thu, 13 Nov 2003 13:03:54 +0100 ++ +--- nufw-2.2.21.orig/debian/nuauth-log-pgsql.dirs ++++ nufw-2.2.21/debian/nuauth-log-pgsql.dirs +@@ -0,0 +1 @@ ++usr/lib +--- nufw-2.2.21.orig/selinux/Makefile.in ++++ nufw-2.2.21/selinux/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -72,6 +72,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -84,9 +86,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -97,6 +96,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -105,6 +105,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -164,6 +165,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + EXTRA_DIST = nuauth.fc nuauth.if nuauth.te nufw.fc nufw.if nufw.te README.selinux +@@ -176,8 +178,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +--- nufw-2.2.21.orig/doc/Makefile.in ++++ nufw-2.2.21/doc/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.10.1 from Makefile.am. ++# Makefile.in generated by automake 1.10.2 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -80,6 +80,8 @@ + GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ + GLIB_LIBS = @GLIB_LIBS@ + GLIB_MKENUMS = @GLIB_MKENUMS@ ++GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ ++GNUTLS_LIBS = @GNUTLS_LIBS@ + GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ + INSTALL = @INSTALL@ +@@ -92,9 +94,6 @@ + LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ + LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ + LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +-LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ +-LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ +-LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ +@@ -105,6 +104,7 @@ + MKDIR_P = @MKDIR_P@ + NM = @NM@ + NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ + OBJEXT = @OBJEXT@ + OTOOL = @OTOOL@ + OTOOL64 = @OTOOL64@ +@@ -113,6 +113,7 @@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ +@@ -172,6 +173,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + man_MANS = nuaclgen.8 nuauth.8 nufw.8 nutcpc.1 nutop.8 libnuclient.3 nuclient.conf.5 +@@ -191,8 +193,8 @@ + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +- && exit 0; \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ +@@ -233,8 +235,8 @@ + esac; \ + done; \ + for i in $$list; do \ +- if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ +- else file=$$i; fi; \ ++ if test -f $$i; then file=$$i; \ ++ else file=$(srcdir)/$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ +@@ -278,8 +280,8 @@ + esac; \ + done; \ + for i in $$list; do \ +- if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ +- else file=$$i; fi; \ ++ if test -f $$i; then file=$$i; \ ++ else file=$(srcdir)/$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 3*) ;; \ +@@ -323,8 +325,8 @@ + esac; \ + done; \ + for i in $$list; do \ +- if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ +- else file=$$i; fi; \ ++ if test -f $$i; then file=$$i; \ ++ else file=$(srcdir)/$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 5*) ;; \ +@@ -368,8 +370,8 @@ + esac; \ + done; \ + for i in $$list; do \ +- if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ +- else file=$$i; fi; \ ++ if test -f $$i; then file=$$i; \ ++ else file=$(srcdir)/$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 8*) ;; \ diff --git a/net/nuttcp/Makefile b/net/nuttcp/Makefile new file mode 100644 index 0000000..7240444 --- /dev/null +++ b/net/nuttcp/Makefile @@ -0,0 +1,80 @@ +# +# Copyright (C) 2011 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:=nuttcp +PKG_VERSION:=6.1.2 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.lcp.nrl.navy.mil/pub/nuttcp +PKG_MD5SUM:=a16d4d6d5def02cea980e57feaf30500 + +include $(INCLUDE_DIR)/package.mk + +define Package/nuttcp/Default + SECTION:=net + CATEGORY:=Network + TITLE:=Network performance measurement tool + URL:=http://lcp.nrl.navy.mil/nuttcp/nuttcp.html +endef + +define Package/nuttcp/Default/description + nuttcp is a network performance measurement tool intended for use by network + and system managers. Its most basic usage is to determine the raw TCP (or UDP) + network layer throughput by transferring memory buffers from a source system + across an interconnecting network to a destination system, either transferring + data for a specified time interval, or alternatively transferring a specified + number of bytes. In addition to reporting the achieved network throughput in + Mbps, nuttcp also provides additional useful information related to the data + transfer such as user, system, and wall-clock time, transmitter and receiver + CPU utilization, and loss percentage (for UDP transfers). +endef + +define Package/nuttcp + $(call Package/nuttcp/Default) +endef + +define Package/nuttcp/description + $(call Package/nuttcp/Default/description) +endef + +define Package/nuttcp-xinetd + $(call Package/nuttcp/Default) + TITLE+= xinetd service files + DEPENDS:=+nuttcp +xinetd +endef + +define Package/nuttcp-xinetd/description + $(call Package/nuttcp/Default/description) + This package contains the nuttcp xinetd service files. +endef + +MAKE_FLAGS += \ + APP="nuttcp" \ + OPT="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -Wall" + +define Package/nuttcp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/nuttcp $(1)/usr/bin/ +endef + +define Package/nuttcp-xinetd/install + $(INSTALL_DIR) $(1)/etc/xinetd.d + $(INSTALL_DATA) $(PKG_BUILD_DIR)/xinetd.d/nuttcp* $(1)/etc/xinetd.d/ + $(SED) 's,/local,,' $(1)/etc/xinetd.d/nuttcp* +endef + +define Package/nuttcp-xinetd/conffiles +/etc/xinetd.d/nuttcp +/etc/xinetd.d/nuttcp4 +/etc/xinetd.d/nuttcp6 +endef + +$(eval $(call BuildPackage,nuttcp)) +$(eval $(call BuildPackage,nuttcp-xinetd)) diff --git a/net/nzbget/Makefile b/net/nzbget/Makefile new file mode 100644 index 0000000..4ed25e9 --- /dev/null +++ b/net/nzbget/Makefile @@ -0,0 +1,69 @@ +# +# Copyright (C) 2009-2012 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:=nzbget +PKG_VERSION:=0.8.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/nzbget +PKG_MD5SUM:=c47f464fe988deeb4fc5381506c1fbe3 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_LDFLAGS+=-Wl,-rpath-link="$(STAGING_DIR)/usr/lib" -lcrypto -lsigc-2.0 +TARGET_CFLAGS += $(FPIC) + +define Package/nzbget + SUBMENU:=NNTP + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libxml2 +libpar2 +libopenssl +libpthread +libncurses + URL:=http://nzbget.sourceforge.net/ + TITLE:=Binary newsgrabber for nzb-files + MAINTAINER:=Artur Wronowski +endef + +define Package/nzbget/description +A command-line client/server based binary newsgrabber for nzb-files. +endef + +CONFIGURE_ARGS += \ + --disable-nls \ + --with-tlslib=OpenSSL \ + --with-libpar2-includes=$(STAGING_DIR)/usr/include/libpar2 \ + --with-libpar2-libraries=$(STAGING_DIR)/usr/lib \ + --with-libsigc-includes=$(STAGING_DIR)/usr/include/sigc++-2.0 \ + --with-libsigc-libraries=$(STAGING_DIR)/usr/lib \ + --with-openssl-includes=$(STAGING_DIR)/usr/include \ + --with-openssl-libraries=$(STAGING_DIR)/usr/lib \ + --with-libcurses-includes=$(STAGING_DIR)/usr/include \ + --with-libcurses-libraries=$(STAGING_DIR)/usr/lib \ + , \ + PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" + +CONFIGURE_VARS += \ + ac_cv_header_regex_h=no \ + CPPFLAGS="-I$(STAGING_DIR)/usr/include/libxml2 $$$$CPPFLAGS" + +define Package/nzbget/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nzbget $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/nzbget.conf.example $(1)/etc/nzbget.conf +endef + +define Package/nzbget/conffiles +/etc/nzbget.conf +endef + +$(eval $(call BuildPackage,nzbget)) diff --git a/net/nzbget/patches/001-openssl-1.0.0-compat.patch b/net/nzbget/patches/001-openssl-1.0.0-compat.patch new file mode 100644 index 0000000..04374ab --- /dev/null +++ b/net/nzbget/patches/001-openssl-1.0.0-compat.patch @@ -0,0 +1,32 @@ +--- a/TLS.cpp ++++ b/TLS.cpp +@@ -908,7 +908,7 @@ int tls_check_cert(tls_t *tls, const cha + char *buf; + int bufsize; + /* needed to get the DNS subjectAltNames: */ +- STACK *subj_alt_names; ++ STACK_OF(GENERAL_NAME) *subj_alt_names; + int subj_alt_names_count; + GENERAL_NAME *subj_alt_name; + /* did we find a name matching hostname? */ +@@ -960,7 +960,7 @@ int tls_check_cert(tls_t *tls, const cha + /* Try the DNS subjectAltNames. */ + match_found = 0; + if ((subj_alt_names = +- (STACK*)X509_get_ext_d2i(x509cert, NID_subject_alt_name, NULL, NULL))) ++ (STACK_OF(GENERAL_NAME) *)X509_get_ext_d2i(x509cert, NID_subject_alt_name, NULL, NULL))) + { + subj_alt_names_count = sk_GENERAL_NAME_num(subj_alt_names); + for (i = 0; i < subj_alt_names_count; i++) +@@ -1105,7 +1105,11 @@ int tls_init(tls_t *tls, const char *key + + #ifdef HAVE_OPENSSL + ++ #if OPENSSL_VERSION_NUMBER >= 0x10000000L ++ const SSL_METHOD *ssl_method = NULL; ++ #else + SSL_METHOD *ssl_method = NULL; ++ #endif + + ssl_method = force_sslv3 ? SSLv3_client_method() : SSLv23_client_method(); + if (!ssl_method) diff --git a/net/nzbgetweb/Makefile b/net/nzbgetweb/Makefile new file mode 100644 index 0000000..9e30178 --- /dev/null +++ b/net/nzbgetweb/Makefile @@ -0,0 +1,66 @@ +# +# Copyright (C) 2009 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:=nzbgetweb +PKG_VERSION:=1.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip +PKG_SOURCE_URL:=@SF/nzbget +PKG_MD5SUM:=78ccce66f9df07ee69250ec79819c37c + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/nzbgetweb + +include $(INCLUDE_DIR)/package.mk + +define Package/nzbgetweb + SUBMENU:=NNTP + SECTION:=net + CATEGORY:=Network + DEPENDS:=+nzbget +php5 +php5-cgi +php5-mod-session +php5-mod-gd +php5-mod-xml +uhttpd + URL:=http://nzbget.sourceforge.net/ + TITLE:=Web interface for nzbget + MAINTAINER:=Artur Wronowski +endef + +define Package/nzbgetweb/description +Web interface for nzbget. +endef + +define Package/nzbgetweb/postinst +#!/bin/sh +uci batch < +// $Id: xmlrpc.inc,v 1.174 2009/03/16 19:36:38 ggiunta Exp $ + +// Copyright (c) 1999,2000,2002 Edd Dumbill. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// * Neither the name of the "XML-RPC for PHP" nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// 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. + + if(!function_exists('xml_parser_create')) + { + // For PHP 4 onward, XML functionality is always compiled-in on windows: + // no more need to dl-open it. It might have been compiled out on *nix... + if(strtoupper(substr(PHP_OS, 0, 3) != 'WIN')) + { + dl('xml.so'); + } + } + + // G. Giunta 2005/01/29: declare global these variables, + // so that xmlrpc.inc will work even if included from within a function + // Milosch: 2005/08/07 - explicitly request these via $GLOBALS where used. + $GLOBALS['xmlrpcI4']='i4'; + $GLOBALS['xmlrpcInt']='int'; + $GLOBALS['xmlrpcBoolean']='boolean'; + $GLOBALS['xmlrpcDouble']='double'; + $GLOBALS['xmlrpcString']='string'; + $GLOBALS['xmlrpcDateTime']='dateTime.iso8601'; + $GLOBALS['xmlrpcBase64']='base64'; + $GLOBALS['xmlrpcArray']='array'; + $GLOBALS['xmlrpcStruct']='struct'; + $GLOBALS['xmlrpcValue']='undefined'; + + $GLOBALS['xmlrpcTypes']=array( + $GLOBALS['xmlrpcI4'] => 1, + $GLOBALS['xmlrpcInt'] => 1, + $GLOBALS['xmlrpcBoolean'] => 1, + $GLOBALS['xmlrpcString'] => 1, + $GLOBALS['xmlrpcDouble'] => 1, + $GLOBALS['xmlrpcDateTime'] => 1, + $GLOBALS['xmlrpcBase64'] => 1, + $GLOBALS['xmlrpcArray'] => 2, + $GLOBALS['xmlrpcStruct'] => 3 + ); + + $GLOBALS['xmlrpc_valid_parents'] = array( + 'VALUE' => array('MEMBER', 'DATA', 'PARAM', 'FAULT'), + 'BOOLEAN' => array('VALUE'), + 'I4' => array('VALUE'), + 'INT' => array('VALUE'), + 'STRING' => array('VALUE'), + 'DOUBLE' => array('VALUE'), + 'DATETIME.ISO8601' => array('VALUE'), + 'BASE64' => array('VALUE'), + 'MEMBER' => array('STRUCT'), + 'NAME' => array('MEMBER'), + 'DATA' => array('ARRAY'), + 'ARRAY' => array('VALUE'), + 'STRUCT' => array('VALUE'), + 'PARAM' => array('PARAMS'), + 'METHODNAME' => array('METHODCALL'), + 'PARAMS' => array('METHODCALL', 'METHODRESPONSE'), + 'FAULT' => array('METHODRESPONSE'), + 'NIL' => array('VALUE'), // only used when extension activated + 'EX:NIL' => array('VALUE') // only used when extension activated + ); + + // define extra types for supporting NULL (useful for json or ) + $GLOBALS['xmlrpcNull']='null'; + $GLOBALS['xmlrpcTypes']['null']=1; + + // Not in use anymore since 2.0. Shall we remove it? + /// @deprecated + $GLOBALS['xmlEntities']=array( + 'amp' => '&', + 'quot' => '"', + 'lt' => '<', + 'gt' => '>', + 'apos' => "'" + ); + + // tables used for transcoding different charsets into us-ascii xml + + $GLOBALS['xml_iso88591_Entities']=array(); + $GLOBALS['xml_iso88591_Entities']['in'] = array(); + $GLOBALS['xml_iso88591_Entities']['out'] = array(); + for ($i = 0; $i < 32; $i++) + { + $GLOBALS['xml_iso88591_Entities']['in'][] = chr($i); + $GLOBALS['xml_iso88591_Entities']['out'][] = '&#'.$i.';'; + } + for ($i = 160; $i < 256; $i++) + { + $GLOBALS['xml_iso88591_Entities']['in'][] = chr($i); + $GLOBALS['xml_iso88591_Entities']['out'][] = '&#'.$i.';'; + } + + /// @todo add to iso table the characters from cp_1252 range, i.e. 128 to 159? + /// These will NOT be present in true ISO-8859-1, but will save the unwary + /// windows user from sending junk (though no luck when reciving them...) + /* + $GLOBALS['xml_cp1252_Entities']=array(); + for ($i = 128; $i < 160; $i++) + { + $GLOBALS['xml_cp1252_Entities']['in'][] = chr($i); + } + $GLOBALS['xml_cp1252_Entities']['out'] = array( + '€', '?', '‚', 'ƒ', + '„', '…', '†', '‡', + 'ˆ', '‰', 'Š', '‹', + 'Œ', '?', 'Ž', '?', + '?', '‘', '’', '“', + '”', '•', '–', '—', + '˜', '™', 'š', '›', + 'œ', '?', 'ž', 'Ÿ' + ); + */ + + $GLOBALS['xmlrpcerr'] = array( + 'unknown_method'=>1, + 'invalid_return'=>2, + 'incorrect_params'=>3, + 'introspect_unknown'=>4, + 'http_error'=>5, + 'no_data'=>6, + 'no_ssl'=>7, + 'curl_fail'=>8, + 'invalid_request'=>15, + 'no_curl'=>16, + 'server_error'=>17, + 'multicall_error'=>18, + 'multicall_notstruct'=>9, + 'multicall_nomethod'=>10, + 'multicall_notstring'=>11, + 'multicall_recursion'=>12, + 'multicall_noparams'=>13, + 'multicall_notarray'=>14, + + 'cannot_decompress'=>103, + 'decompress_fail'=>104, + 'dechunk_fail'=>105, + 'server_cannot_decompress'=>106, + 'server_decompress_fail'=>107 + ); + + $GLOBALS['xmlrpcstr'] = array( + 'unknown_method'=>'Unknown method', + 'invalid_return'=>'Invalid return payload: enable debugging to examine incoming payload', + 'incorrect_params'=>'Incorrect parameters passed to method', + 'introspect_unknown'=>"Can't introspect: method unknown", + 'http_error'=>"Didn't receive 200 OK from remote server.", + 'no_data'=>'No data received from server.', + 'no_ssl'=>'No SSL support compiled in.', + 'curl_fail'=>'CURL error', + 'invalid_request'=>'Invalid request payload', + 'no_curl'=>'No CURL support compiled in.', + 'server_error'=>'Internal server error', + 'multicall_error'=>'Received from server invalid multicall response', + 'multicall_notstruct'=>'system.multicall expected struct', + 'multicall_nomethod'=>'missing methodName', + 'multicall_notstring'=>'methodName is not a string', + 'multicall_recursion'=>'recursive system.multicall forbidden', + 'multicall_noparams'=>'missing params', + 'multicall_notarray'=>'params is not an array', + + 'cannot_decompress'=>'Received from server compressed HTTP and cannot decompress', + 'decompress_fail'=>'Received from server invalid compressed HTTP', + 'dechunk_fail'=>'Received from server invalid chunked HTTP', + 'server_cannot_decompress'=>'Received from client compressed HTTP request and cannot decompress', + 'server_decompress_fail'=>'Received from client invalid compressed HTTP request' + ); + + // The charset encoding used by the server for received messages and + // by the client for received responses when received charset cannot be determined + // or is not supported + $GLOBALS['xmlrpc_defencoding']='UTF-8'; + + // The encoding used internally by PHP. + // String values received as xml will be converted to this, and php strings will be converted to xml + // as if having been coded with this + $GLOBALS['xmlrpc_internalencoding']='ISO-8859-1'; + + $GLOBALS['xmlrpcName']='XML-RPC for PHP'; + $GLOBALS['xmlrpcVersion']='3.0.0.beta'; + + // let user errors start at 800 + $GLOBALS['xmlrpcerruser']=800; + // let XML parse errors start at 100 + $GLOBALS['xmlrpcerrxml']=100; + + // formulate backslashes for escaping regexp + // Not in use anymore since 2.0. Shall we remove it? + /// @deprecated + $GLOBALS['xmlrpc_backslash']=chr(92).chr(92); + + // set to TRUE to enable correct decoding of and values + $GLOBALS['xmlrpc_null_extension']=false; + + // set to TRUE to enable encoding of php NULL values to instead of + $GLOBALS['xmlrpc_null_apache_encoding']=false; + + // used to store state during parsing + // quick explanation of components: + // ac - used to accumulate values + // isf - used to indicate a parsing fault (2) or xmlrpcresp fault (1) + // isf_reason - used for storing xmlrpcresp fault string + // lv - used to indicate "looking for a value": implements + // the logic to allow values with no types to be strings + // params - used to store parameters in method calls + // method - used to store method name + // stack - array with genealogy of xml elements names: + // used to validate nesting of xmlrpc elements + $GLOBALS['_xh']=null; + + /** + * Convert a string to the correct XML representation in a target charset + * To help correct communication of non-ascii chars inside strings, regardless + * of the charset used when sending requests, parsing them, sending responses + * and parsing responses, an option is to convert all non-ascii chars present in the message + * into their equivalent 'charset entity'. Charset entities enumerated this way + * are independent of the charset encoding used to transmit them, and all XML + * parsers are bound to understand them. + * Note that in the std case we are not sending a charset encoding mime type + * along with http headers, so we are bound by RFC 3023 to emit strict us-ascii. + * + * @todo do a bit of basic benchmarking (strtr vs. str_replace) + * @todo make usage of iconv() or recode_string() or mb_string() where available + */ + function xmlrpc_encode_entitites($data, $src_encoding='', $dest_encoding='') + { + if ($src_encoding == '') + { + // lame, but we know no better... + $src_encoding = $GLOBALS['xmlrpc_internalencoding']; + } + + switch(strtoupper($src_encoding.'_'.$dest_encoding)) + { + case 'ISO-8859-1_': + case 'ISO-8859-1_US-ASCII': + $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&', '"', ''', '<', '>'), $data); + $escaped_data = str_replace($GLOBALS['xml_iso88591_Entities']['in'], $GLOBALS['xml_iso88591_Entities']['out'], $escaped_data); + break; + case 'ISO-8859-1_UTF-8': + $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&', '"', ''', '<', '>'), $data); + $escaped_data = utf8_encode($escaped_data); + break; + case 'ISO-8859-1_ISO-8859-1': + case 'US-ASCII_US-ASCII': + case 'US-ASCII_UTF-8': + case 'US-ASCII_': + case 'US-ASCII_ISO-8859-1': + case 'UTF-8_UTF-8': + //case 'CP1252_CP1252': + $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&', '"', ''', '<', '>'), $data); + break; + case 'UTF-8_': + case 'UTF-8_US-ASCII': + case 'UTF-8_ISO-8859-1': + // NB: this will choke on invalid UTF-8, going most likely beyond EOF + $escaped_data = ''; + // be kind to users creating string xmlrpcvals out of different php types + $data = (string) $data; + $ns = strlen ($data); + for ($nn = 0; $nn < $ns; $nn++) + { + $ch = $data[$nn]; + $ii = ord($ch); + //1 7 0bbbbbbb (127) + if ($ii < 128) + { + /// @todo shall we replace this with a (supposedly) faster str_replace? + switch($ii){ + case 34: + $escaped_data .= '"'; + break; + case 38: + $escaped_data .= '&'; + break; + case 39: + $escaped_data .= '''; + break; + case 60: + $escaped_data .= '<'; + break; + case 62: + $escaped_data .= '>'; + break; + default: + $escaped_data .= $ch; + } // switch + } + //2 11 110bbbbb 10bbbbbb (2047) + else if ($ii>>5 == 6) + { + $b1 = ($ii & 31); + $ii = ord($data[$nn+1]); + $b2 = ($ii & 63); + $ii = ($b1 * 64) + $b2; + $ent = sprintf ('&#%d;', $ii); + $escaped_data .= $ent; + $nn += 1; + } + //3 16 1110bbbb 10bbbbbb 10bbbbbb + else if ($ii>>4 == 14) + { + $b1 = ($ii & 15); + $ii = ord($data[$nn+1]); + $b2 = ($ii & 63); + $ii = ord($data[$nn+2]); + $b3 = ($ii & 63); + $ii = ((($b1 * 64) + $b2) * 64) + $b3; + $ent = sprintf ('&#%d;', $ii); + $escaped_data .= $ent; + $nn += 2; + } + //4 21 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + else if ($ii>>3 == 30) + { + $b1 = ($ii & 7); + $ii = ord($data[$nn+1]); + $b2 = ($ii & 63); + $ii = ord($data[$nn+2]); + $b3 = ($ii & 63); + $ii = ord($data[$nn+3]); + $b4 = ($ii & 63); + $ii = ((((($b1 * 64) + $b2) * 64) + $b3) * 64) + $b4; + $ent = sprintf ('&#%d;', $ii); + $escaped_data .= $ent; + $nn += 3; + } + } + break; +/* + case 'CP1252_': + case 'CP1252_US-ASCII': + $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&', '"', ''', '<', '>'), $data); + $escaped_data = str_replace($GLOBALS['xml_iso88591_Entities']['in'], $GLOBALS['xml_iso88591_Entities']['out'], $escaped_data); + $escaped_data = str_replace($GLOBALS['xml_cp1252_Entities']['in'], $GLOBALS['xml_cp1252_Entities']['out'], $escaped_data); + break; + case 'CP1252_UTF-8': + $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&', '"', ''', '<', '>'), $data); + /// @todo we could use real UTF8 chars here instead of xml entities... (note that utf_8 encode all allone will NOT convert them) + $escaped_data = str_replace($GLOBALS['xml_cp1252_Entities']['in'], $GLOBALS['xml_cp1252_Entities']['out'], $escaped_data); + $escaped_data = utf8_encode($escaped_data); + break; + case 'CP1252_ISO-8859-1': + $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&', '"', ''', '<', '>'), $data); + // we might as well replave all funky chars with a '?' here, but we are kind and leave it to the receiving application layer to decide what to do with these weird entities... + $escaped_data = str_replace($GLOBALS['xml_cp1252_Entities']['in'], $GLOBALS['xml_cp1252_Entities']['out'], $escaped_data); + break; +*/ + default: + $escaped_data = ''; + error_log("Converting from $src_encoding to $dest_encoding: not supported..."); + } + return $escaped_data; + } + + /// xml parser handler function for opening element tags + function xmlrpc_se($parser, $name, $attrs, $accept_single_vals=false) + { + // if invalid xmlrpc already detected, skip all processing + if ($GLOBALS['_xh']['isf'] < 2) + { + // check for correct element nesting + // top level element can only be of 2 types + /// @todo optimization creep: save this check into a bool variable, instead of using count() every time: + /// there is only a single top level element in xml anyway + if (count($GLOBALS['_xh']['stack']) == 0) + { + if ($name != 'METHODRESPONSE' && $name != 'METHODCALL' && ( + $name != 'VALUE' && !$accept_single_vals)) + { + $GLOBALS['_xh']['isf'] = 2; + $GLOBALS['_xh']['isf_reason'] = 'missing top level xmlrpc element'; + return; + } + else + { + $GLOBALS['_xh']['rt'] = strtolower($name); + $GLOBALS['_xh']['rt'] = strtolower($name); + } + } + else + { + // not top level element: see if parent is OK + $parent = end($GLOBALS['_xh']['stack']); + if (!array_key_exists($name, $GLOBALS['xmlrpc_valid_parents']) || !in_array($parent, $GLOBALS['xmlrpc_valid_parents'][$name])) + { + $GLOBALS['_xh']['isf'] = 2; + $GLOBALS['_xh']['isf_reason'] = "xmlrpc element $name cannot be child of $parent"; + return; + } + } + + switch($name) + { + // optimize for speed switch cases: most common cases first + case 'VALUE': + /// @todo we could check for 2 VALUE elements inside a MEMBER or PARAM element + $GLOBALS['_xh']['vt']='value'; // indicator: no value found yet + $GLOBALS['_xh']['ac']=''; + $GLOBALS['_xh']['lv']=1; + $GLOBALS['_xh']['php_class']=null; + break; + case 'I4': + case 'INT': + case 'STRING': + case 'BOOLEAN': + case 'DOUBLE': + case 'DATETIME.ISO8601': + case 'BASE64': + if ($GLOBALS['_xh']['vt']!='value') + { + //two data elements inside a value: an error occurred! + $GLOBALS['_xh']['isf'] = 2; + $GLOBALS['_xh']['isf_reason'] = "$name element following a {$GLOBALS['_xh']['vt']} element inside a single value"; + return; + } + $GLOBALS['_xh']['ac']=''; // reset the accumulator + break; + case 'STRUCT': + case 'ARRAY': + if ($GLOBALS['_xh']['vt']!='value') + { + //two data elements inside a value: an error occurred! + $GLOBALS['_xh']['isf'] = 2; + $GLOBALS['_xh']['isf_reason'] = "$name element following a {$GLOBALS['_xh']['vt']} element inside a single value"; + return; + } + // create an empty array to hold child values, and push it onto appropriate stack + $cur_val = array(); + $cur_val['values'] = array(); + $cur_val['type'] = $name; + // check for out-of-band information to rebuild php objs + // and in case it is found, save it + if (@isset($attrs['PHP_CLASS'])) + { + $cur_val['php_class'] = $attrs['PHP_CLASS']; + } + $GLOBALS['_xh']['valuestack'][] = $cur_val; + $GLOBALS['_xh']['vt']='data'; // be prepared for a data element next + break; + case 'DATA': + if ($GLOBALS['_xh']['vt']!='data') + { + //two data elements inside a value: an error occurred! + $GLOBALS['_xh']['isf'] = 2; + $GLOBALS['_xh']['isf_reason'] = "found two data elements inside an array element"; + return; + } + case 'METHODCALL': + case 'METHODRESPONSE': + case 'PARAMS': + // valid elements that add little to processing + break; + case 'METHODNAME': + case 'NAME': + /// @todo we could check for 2 NAME elements inside a MEMBER element + $GLOBALS['_xh']['ac']=''; + break; + case 'FAULT': + $GLOBALS['_xh']['isf']=1; + break; + case 'MEMBER': + $GLOBALS['_xh']['valuestack'][count($GLOBALS['_xh']['valuestack'])-1]['name']=''; // set member name to null, in case we do not find in the xml later on + //$GLOBALS['_xh']['ac']=''; + // Drop trough intentionally + case 'PARAM': + // clear value type, so we can check later if no value has been passed for this param/member + $GLOBALS['_xh']['vt']=null; + break; + case 'NIL': + case 'EX:NIL': + if ($GLOBALS['xmlrpc_null_extension']) + { + if ($GLOBALS['_xh']['vt']!='value') + { + //two data elements inside a value: an error occurred! + $GLOBALS['_xh']['isf'] = 2; + $GLOBALS['_xh']['isf_reason'] = "$name element following a {$GLOBALS['_xh']['vt']} element inside a single value"; + return; + } + $GLOBALS['_xh']['ac']=''; // reset the accumulator + break; + } + // we do not support the extension, so + // drop through intentionally + default: + /// INVALID ELEMENT: RAISE ISF so that it is later recognized!!! + $GLOBALS['_xh']['isf'] = 2; + $GLOBALS['_xh']['isf_reason'] = "found not-xmlrpc xml element $name"; + break; + } + + // Save current element name to stack, to validate nesting + $GLOBALS['_xh']['stack'][] = $name; + + /// @todo optimization creep: move this inside the big switch() above + if($name!='VALUE') + { + $GLOBALS['_xh']['lv']=0; + } + } + } + + /// Used in decoding xml chunks that might represent single xmlrpc values + function xmlrpc_se_any($parser, $name, $attrs) + { + xmlrpc_se($parser, $name, $attrs, true); + } + + /// xml parser handler function for close element tags + function xmlrpc_ee($parser, $name, $rebuild_xmlrpcvals = true) + { + if ($GLOBALS['_xh']['isf'] < 2) + { + // push this element name from stack + // NB: if XML validates, correct opening/closing is guaranteed and + // we do not have to check for $name == $curr_elem. + // we also checked for proper nesting at start of elements... + $curr_elem = array_pop($GLOBALS['_xh']['stack']); + + switch($name) + { + case 'VALUE': + // This if() detects if no scalar was inside + if ($GLOBALS['_xh']['vt']=='value') + { + $GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac']; + $GLOBALS['_xh']['vt']=$GLOBALS['xmlrpcString']; + } + + if ($rebuild_xmlrpcvals) + { + // build the xmlrpc val out of the data received, and substitute it + $temp = new xmlrpcval($GLOBALS['_xh']['value'], $GLOBALS['_xh']['vt']); + // in case we got info about underlying php class, save it + // in the object we're rebuilding + if (isset($GLOBALS['_xh']['php_class'])) + $temp->_php_class = $GLOBALS['_xh']['php_class']; + // check if we are inside an array or struct: + // if value just built is inside an array, let's move it into array on the stack + $vscount = count($GLOBALS['_xh']['valuestack']); + if ($vscount && $GLOBALS['_xh']['valuestack'][$vscount-1]['type']=='ARRAY') + { + $GLOBALS['_xh']['valuestack'][$vscount-1]['values'][] = $temp; + } + else + { + $GLOBALS['_xh']['value'] = $temp; + } + } + else + { + /// @todo this needs to treat correctly php-serialized objects, + /// since std deserializing is done by php_xmlrpc_decode, + /// which we will not be calling... + if (isset($GLOBALS['_xh']['php_class'])) + { + } + + // check if we are inside an array or struct: + // if value just built is inside an array, let's move it into array on the stack + $vscount = count($GLOBALS['_xh']['valuestack']); + if ($vscount && $GLOBALS['_xh']['valuestack'][$vscount-1]['type']=='ARRAY') + { + $GLOBALS['_xh']['valuestack'][$vscount-1]['values'][] = $GLOBALS['_xh']['value']; + } + } + break; + case 'BOOLEAN': + case 'I4': + case 'INT': + case 'STRING': + case 'DOUBLE': + case 'DATETIME.ISO8601': + case 'BASE64': + $GLOBALS['_xh']['vt']=strtolower($name); + /// @todo: optimization creep - remove the if/elseif cycle below + /// since the case() in which we are already did that + if ($name=='STRING') + { + $GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac']; + } + elseif ($name=='DATETIME.ISO8601') + { + if (!preg_match('/^[0-9]{8}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/', $GLOBALS['_xh']['ac'])) + { + error_log('XML-RPC: invalid value received in DATETIME: '.$GLOBALS['_xh']['ac']); + } + $GLOBALS['_xh']['vt']=$GLOBALS['xmlrpcDateTime']; + $GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac']; + } + elseif ($name=='BASE64') + { + /// @todo check for failure of base64 decoding / catch warnings + $GLOBALS['_xh']['value']=base64_decode($GLOBALS['_xh']['ac']); + } + elseif ($name=='BOOLEAN') + { + // special case here: we translate boolean 1 or 0 into PHP + // constants true or false. + // Strings 'true' and 'false' are accepted, even though the + // spec never mentions them (see eg. Blogger api docs) + // NB: this simple checks helps a lot sanitizing input, ie no + // security problems around here + if ($GLOBALS['_xh']['ac']=='1' || strcasecmp($GLOBALS['_xh']['ac'], 'true') == 0) + { + $GLOBALS['_xh']['value']=true; + } + else + { + // log if receiveing something strange, even though we set the value to false anyway + if ($GLOBALS['_xh']['ac']!='0' && strcasecmp($GLOBALS['_xh']['ac'], 'false') != 0) + error_log('XML-RPC: invalid value received in BOOLEAN: '.$GLOBALS['_xh']['ac']); + $GLOBALS['_xh']['value']=false; + } + } + elseif ($name=='DOUBLE') + { + // we have a DOUBLE + // we must check that only 0123456789-. are characters here + // NOTE: regexp could be much stricter than this... + if (!preg_match('/^[+-eE0123456789 \t.]+$/', $GLOBALS['_xh']['ac'])) + { + /// @todo: find a better way of throwing an error than this! + error_log('XML-RPC: non numeric value received in DOUBLE: '.$GLOBALS['_xh']['ac']); + $GLOBALS['_xh']['value']='ERROR_NON_NUMERIC_FOUND'; + } + else + { + // it's ok, add it on + $GLOBALS['_xh']['value']=(double)$GLOBALS['_xh']['ac']; + } + } + else + { + // we have an I4/INT + // we must check that only 0123456789- are characters here + if (!preg_match('/^[+-]?[0123456789 \t]+$/', $GLOBALS['_xh']['ac'])) + { + /// @todo find a better way of throwing an error than this! + error_log('XML-RPC: non numeric value received in INT: '.$GLOBALS['_xh']['ac']); + $GLOBALS['_xh']['value']='ERROR_NON_NUMERIC_FOUND'; + } + else + { + // it's ok, add it on + $GLOBALS['_xh']['value']=(int)$GLOBALS['_xh']['ac']; + } + } + //$GLOBALS['_xh']['ac']=''; // is this necessary? + $GLOBALS['_xh']['lv']=3; // indicate we've found a value + break; + case 'NAME': + $GLOBALS['_xh']['valuestack'][count($GLOBALS['_xh']['valuestack'])-1]['name'] = $GLOBALS['_xh']['ac']; + break; + case 'MEMBER': + //$GLOBALS['_xh']['ac']=''; // is this necessary? + // add to array in the stack the last element built, + // unless no VALUE was found + if ($GLOBALS['_xh']['vt']) + { + $vscount = count($GLOBALS['_xh']['valuestack']); + $GLOBALS['_xh']['valuestack'][$vscount-1]['values'][$GLOBALS['_xh']['valuestack'][$vscount-1]['name']] = $GLOBALS['_xh']['value']; + } else + error_log('XML-RPC: missing VALUE inside STRUCT in received xml'); + break; + case 'DATA': + //$GLOBALS['_xh']['ac']=''; // is this necessary? + $GLOBALS['_xh']['vt']=null; // reset this to check for 2 data elements in a row - even if they're empty + break; + case 'STRUCT': + case 'ARRAY': + // fetch out of stack array of values, and promote it to current value + $curr_val = array_pop($GLOBALS['_xh']['valuestack']); + $GLOBALS['_xh']['value'] = $curr_val['values']; + $GLOBALS['_xh']['vt']=strtolower($name); + if (isset($curr_val['php_class'])) + { + $GLOBALS['_xh']['php_class'] = $curr_val['php_class']; + } + break; + case 'PARAM': + // add to array of params the current value, + // unless no VALUE was found + if ($GLOBALS['_xh']['vt']) + { + $GLOBALS['_xh']['params'][]=$GLOBALS['_xh']['value']; + $GLOBALS['_xh']['pt'][]=$GLOBALS['_xh']['vt']; + } + else + error_log('XML-RPC: missing VALUE inside PARAM in received xml'); + break; + case 'METHODNAME': + $GLOBALS['_xh']['method']=preg_replace('/^[\n\r\t ]+/', '', $GLOBALS['_xh']['ac']); + break; + case 'NIL': + case 'EX:NIL': + if ($GLOBALS['xmlrpc_null_extension']) + { + $GLOBALS['_xh']['vt']='null'; + $GLOBALS['_xh']['value']=null; + $GLOBALS['_xh']['lv']=3; + break; + } + // drop through intentionally if nil extension not enabled + case 'PARAMS': + case 'FAULT': + case 'METHODCALL': + case 'METHORESPONSE': + break; + default: + // End of INVALID ELEMENT! + // shall we add an assert here for unreachable code??? + break; + } + } + } + + /// Used in decoding xmlrpc requests/responses without rebuilding xmlrpc values + function xmlrpc_ee_fast($parser, $name) + { + xmlrpc_ee($parser, $name, false); + } + + /// xml parser handler function for character data + function xmlrpc_cd($parser, $data) + { + // skip processing if xml fault already detected + if ($GLOBALS['_xh']['isf'] < 2) + { + // "lookforvalue==3" means that we've found an entire value + // and should discard any further character data + if($GLOBALS['_xh']['lv']!=3) + { + // G. Giunta 2006-08-23: useless change of 'lv' from 1 to 2 + //if($GLOBALS['_xh']['lv']==1) + //{ + // if we've found text and we're just in a then + // say we've found a value + //$GLOBALS['_xh']['lv']=2; + //} + // we always initialize the accumulator before starting parsing, anyway... + //if(!@isset($GLOBALS['_xh']['ac'])) + //{ + // $GLOBALS['_xh']['ac'] = ''; + //} + $GLOBALS['_xh']['ac'].=$data; + } + } + } + + /// xml parser handler function for 'other stuff', ie. not char data or + /// element start/end tag. In fact it only gets called on unknown entities... + function xmlrpc_dh($parser, $data) + { + // skip processing if xml fault already detected + if ($GLOBALS['_xh']['isf'] < 2) + { + if(substr($data, 0, 1) == '&' && substr($data, -1, 1) == ';') + { + // G. Giunta 2006-08-25: useless change of 'lv' from 1 to 2 + //if($GLOBALS['_xh']['lv']==1) + //{ + // $GLOBALS['_xh']['lv']=2; + //} + $GLOBALS['_xh']['ac'].=$data; + } + } + return true; + } + + class xmlrpc_client + { + var $path; + var $server; + var $port=0; + var $method='http'; + var $errno; + var $errstr; + var $debug=0; + var $username=''; + var $password=''; + var $authtype=1; + var $cert=''; + var $certpass=''; + var $cacert=''; + var $cacertdir=''; + var $key=''; + var $keypass=''; + var $verifypeer=true; + var $verifyhost=1; + var $no_multicall=false; + var $proxy=''; + var $proxyport=0; + var $proxy_user=''; + var $proxy_pass=''; + var $proxy_authtype=1; + var $cookies=array(); + var $extracurlopts=array(); + + /** + * List of http compression methods accepted by the client for responses. + * NB: PHP supports deflate, gzip compressions out of the box if compiled w. zlib + * + * NNB: you can set it to any non-empty array for HTTP11 and HTTPS, since + * in those cases it will be up to CURL to decide the compression methods + * it supports. You might check for the presence of 'zlib' in the output of + * curl_version() to determine wheter compression is supported or not + */ + var $accepted_compression = array(); + /** + * Name of compression scheme to be used for sending requests. + * Either null, gzip or deflate + */ + var $request_compression = ''; + /** + * CURL handle: used for keep-alive connections (PHP 4.3.8 up, see: + * http://curl.haxx.se/docs/faq.html#7.3) + */ + var $xmlrpc_curl_handle = null; + /// Wheter to use persistent connections for http 1.1 and https + var $keepalive = false; + /// Charset encodings that can be decoded without problems by the client + var $accepted_charset_encodings = array(); + /// Charset encoding to be used in serializing request. NULL = use ASCII + var $request_charset_encoding = ''; + /** + * Decides the content of xmlrpcresp objects returned by calls to send() + * valid strings are 'xmlrpcvals', 'phpvals' or 'xml' + */ + var $return_type = 'xmlrpcvals'; + /** + * Sent to servers in http headers + */ + var $user_agent; + + /** + * @param string $path either the complete server URL or the PATH part of the xmlrc server URL, e.g. /xmlrpc/server.php + * @param string $server the server name / ip address + * @param integer $port the port the server is listening on, defaults to 80 or 443 depending on protocol used + * @param string $method the http protocol variant: defaults to 'http', 'https' and 'http11' can be used if CURL is installed + */ + function xmlrpc_client($path, $server='', $port='', $method='') + { + // allow user to specify all params in $path + if($server == '' and $port == '' and $method == '') + { + $parts = parse_url($path); + $server = $parts['host']; + $path = isset($parts['path']) ? $parts['path'] : ''; + if(isset($parts['query'])) + { + $path .= '?'.$parts['query']; + } + if(isset($parts['fragment'])) + { + $path .= '#'.$parts['fragment']; + } + if(isset($parts['port'])) + { + $port = $parts['port']; + } + if(isset($parts['scheme'])) + { + $method = $parts['scheme']; + } + if(isset($parts['user'])) + { + $this->username = $parts['user']; + } + if(isset($parts['pass'])) + { + $this->password = $parts['pass']; + } + } + if($path == '' || $path[0] != '/') + { + $this->path='/'.$path; + } + else + { + $this->path=$path; + } + $this->server=$server; + if($port != '') + { + $this->port=$port; + } + if($method != '') + { + $this->method=$method; + } + + // if ZLIB is enabled, let the client by default accept compressed responses + if(function_exists('gzinflate') || ( + function_exists('curl_init') && (($info = curl_version()) && + ((is_string($info) && strpos($info, 'zlib') !== null) || isset($info['libz_version']))) + )) + { + $this->accepted_compression = array('gzip', 'deflate'); + } + + // keepalives: enabled by default + $this->keepalive = true; + + // by default the xml parser can support these 3 charset encodings + $this->accepted_charset_encodings = array('UTF-8', 'ISO-8859-1', 'US-ASCII'); + + // initialize user_agent string + $this->user_agent = $GLOBALS['xmlrpcName'] . ' ' . $GLOBALS['xmlrpcVersion']; + } + + /** + * Enables/disables the echoing to screen of the xmlrpc responses received + * @param integer $debug values 0, 1 and 2 are supported (2 = echo sent msg too, before received response) + * @access public + */ + function setDebug($in) + { + $this->debug=$in; + } + + /** + * Add some http BASIC AUTH credentials, used by the client to authenticate + * @param string $u username + * @param string $p password + * @param integer $t auth type. See curl_setopt man page for supported auth types. Defaults to CURLAUTH_BASIC (basic auth) + * @access public + */ + function setCredentials($u, $p, $t=1) + { + $this->username=$u; + $this->password=$p; + $this->authtype=$t; + } + + /** + * Add a client-side https certificate + * @param string $cert + * @param string $certpass + * @access public + */ + function setCertificate($cert, $certpass) + { + $this->cert = $cert; + $this->certpass = $certpass; + } + + /** + * Add a CA certificate to verify server with (see man page about + * CURLOPT_CAINFO for more details + * @param string $cacert certificate file name (or dir holding certificates) + * @param bool $is_dir set to true to indicate cacert is a dir. defaults to false + * @access public + */ + function setCaCertificate($cacert, $is_dir=false) + { + if ($is_dir) + { + $this->cacertdir = $cacert; + } + else + { + $this->cacert = $cacert; + } + } + + /** + * Set attributes for SSL communication: private SSL key + * NB: does not work in older php/curl installs + * Thanks to Daniel Convissor + * @param string $key The name of a file containing a private SSL key + * @param string $keypass The secret password needed to use the private SSL key + * @access public + */ + function setKey($key, $keypass) + { + $this->key = $key; + $this->keypass = $keypass; + } + + /** + * Set attributes for SSL communication: verify server certificate + * @param bool $i enable/disable verification of peer certificate + * @access public + */ + function setSSLVerifyPeer($i) + { + $this->verifypeer = $i; + } + + /** + * Set attributes for SSL communication: verify match of server cert w. hostname + * @param int $i + * @access public + */ + function setSSLVerifyHost($i) + { + $this->verifyhost = $i; + } + + /** + * Set proxy info + * @param string $proxyhost + * @param string $proxyport Defaults to 8080 for HTTP and 443 for HTTPS + * @param string $proxyusername Leave blank if proxy has public access + * @param string $proxypassword Leave blank if proxy has public access + * @param int $proxyauthtype set to constant CURLAUTH_NTLM to use NTLM auth with proxy + * @access public + */ + function setProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '', $proxyauthtype = 1) + { + $this->proxy = $proxyhost; + $this->proxyport = $proxyport; + $this->proxy_user = $proxyusername; + $this->proxy_pass = $proxypassword; + $this->proxy_authtype = $proxyauthtype; + } + + /** + * Enables/disables reception of compressed xmlrpc responses. + * Note that enabling reception of compressed responses merely adds some standard + * http headers to xmlrpc requests. It is up to the xmlrpc server to return + * compressed responses when receiving such requests. + * @param string $compmethod either 'gzip', 'deflate', 'any' or '' + * @access public + */ + function setAcceptedCompression($compmethod) + { + if ($compmethod == 'any') + $this->accepted_compression = array('gzip', 'deflate'); + else + $this->accepted_compression = array($compmethod); + } + + /** + * Enables/disables http compression of xmlrpc request. + * Take care when sending compressed requests: servers might not support them + * (and automatic fallback to uncompressed requests is not yet implemented) + * @param string $compmethod either 'gzip', 'deflate' or '' + * @access public + */ + function setRequestCompression($compmethod) + { + $this->request_compression = $compmethod; + } + + /** + * Adds a cookie to list of cookies that will be sent to server. + * NB: setting any param but name and value will turn the cookie into a 'version 1' cookie: + * do not do it unless you know what you are doing + * @param string $name + * @param string $value + * @param string $path + * @param string $domain + * @param int $port + * @access public + * + * @todo check correctness of urlencoding cookie value (copied from php way of doing it...) + */ + function setCookie($name, $value='', $path='', $domain='', $port=null) + { + $this->cookies[$name]['value'] = urlencode($value); + if ($path || $domain || $port) + { + $this->cookies[$name]['path'] = $path; + $this->cookies[$name]['domain'] = $domain; + $this->cookies[$name]['port'] = $port; + $this->cookies[$name]['version'] = 1; + } + else + { + $this->cookies[$name]['version'] = 0; + } + } + + /** + * Directly set cURL options, for extra flexibility + * It allows eg. to bind client to a specific IP interface / address + * @param $options array + */ + function SetCurlOptions( $options ) + { + $this->extracurlopts = $options; + } + + /** + * Set user-agent string that will be used by this client instance + * in http headers sent to the server + */ + function SetUserAgent( $agentstring ) + { + $this->user_agent = $agentstring; + } + + /** + * Send an xmlrpc request + * @param mixed $msg The message object, or an array of messages for using multicall, or the complete xml representation of a request + * @param integer $timeout Connection timeout, in seconds, If unspecified, a platform specific timeout will apply + * @param string $method if left unspecified, the http protocol chosen during creation of the object will be used + * @return xmlrpcresp + * @access public + */ + function& send($msg, $timeout=0, $method='') + { + // if user deos not specify http protocol, use native method of this client + // (i.e. method set during call to constructor) + if($method == '') + { + $method = $this->method; + } + + if(is_array($msg)) + { + // $msg is an array of xmlrpcmsg's + $r = $this->multicall($msg, $timeout, $method); + return $r; + } + elseif(is_string($msg)) + { + $n = new xmlrpcmsg(''); + $n->payload = $msg; + $msg = $n; + } + + // where msg is an xmlrpcmsg + $msg->debug=$this->debug; + + if($method == 'https') + { + $r =& $this->sendPayloadHTTPS( + $msg, + $this->server, + $this->port, + $timeout, + $this->username, + $this->password, + $this->authtype, + $this->cert, + $this->certpass, + $this->cacert, + $this->cacertdir, + $this->proxy, + $this->proxyport, + $this->proxy_user, + $this->proxy_pass, + $this->proxy_authtype, + $this->keepalive, + $this->key, + $this->keypass + ); + } + elseif($method == 'http11') + { + $r =& $this->sendPayloadCURL( + $msg, + $this->server, + $this->port, + $timeout, + $this->username, + $this->password, + $this->authtype, + null, + null, + null, + null, + $this->proxy, + $this->proxyport, + $this->proxy_user, + $this->proxy_pass, + $this->proxy_authtype, + 'http', + $this->keepalive + ); + } + else + { + $r =& $this->sendPayloadHTTP10( + $msg, + $this->server, + $this->port, + $timeout, + $this->username, + $this->password, + $this->authtype, + $this->proxy, + $this->proxyport, + $this->proxy_user, + $this->proxy_pass, + $this->proxy_authtype + ); + } + + return $r; + } + + /** + * @access private + */ + function &sendPayloadHTTP10($msg, $server, $port, $timeout=0, + $username='', $password='', $authtype=1, $proxyhost='', + $proxyport=0, $proxyusername='', $proxypassword='', $proxyauthtype=1) + { + if($port==0) + { + $port=80; + } + + // Only create the payload if it was not created previously + if(empty($msg->payload)) + { + $msg->createPayload($this->request_charset_encoding); + } + + $payload = $msg->payload; + // Deflate request body and set appropriate request headers + if(function_exists('gzdeflate') && ($this->request_compression == 'gzip' || $this->request_compression == 'deflate')) + { + if($this->request_compression == 'gzip') + { + $a = @gzencode($payload); + if($a) + { + $payload = $a; + $encoding_hdr = "Content-Encoding: gzip\r\n"; + } + } + else + { + $a = @gzcompress($payload); + if($a) + { + $payload = $a; + $encoding_hdr = "Content-Encoding: deflate\r\n"; + } + } + } + else + { + $encoding_hdr = ''; + } + + // thanks to Grant Rauscher for this + $credentials=''; + if($username!='') + { + $credentials='Authorization: Basic ' . base64_encode($username . ':' . $password) . "\r\n"; + if ($authtype != 1) + { + error_log('XML-RPC: '.__METHOD__.': warning. Only Basic auth is supported with HTTP 1.0'); + } + } + + $accepted_encoding = ''; + if(is_array($this->accepted_compression) && count($this->accepted_compression)) + { + $accepted_encoding = 'Accept-Encoding: ' . implode(', ', $this->accepted_compression) . "\r\n"; + } + + $proxy_credentials = ''; + if($proxyhost) + { + if($proxyport == 0) + { + $proxyport = 8080; + } + $connectserver = $proxyhost; + $connectport = $proxyport; + $uri = 'http://'.$server.':'.$port.$this->path; + if($proxyusername != '') + { + if ($proxyauthtype != 1) + { + error_log('XML-RPC: '.__METHOD__.': warning. Only Basic auth to proxy is supported with HTTP 1.0'); + } + $proxy_credentials = 'Proxy-Authorization: Basic ' . base64_encode($proxyusername.':'.$proxypassword) . "\r\n"; + } + } + else + { + $connectserver = $server; + $connectport = $port; + $uri = $this->path; + } + + // Cookie generation, as per rfc2965 (version 1 cookies) or + // netscape's rules (version 0 cookies) + $cookieheader=''; + if (count($this->cookies)) + { + $version = ''; + foreach ($this->cookies as $name => $cookie) + { + if ($cookie['version']) + { + $version = ' $Version="' . $cookie['version'] . '";'; + $cookieheader .= ' ' . $name . '="' . $cookie['value'] . '";'; + if ($cookie['path']) + $cookieheader .= ' $Path="' . $cookie['path'] . '";'; + if ($cookie['domain']) + $cookieheader .= ' $Domain="' . $cookie['domain'] . '";'; + if ($cookie['port']) + $cookieheader .= ' $Port="' . $cookie['port'] . '";'; + } + else + { + $cookieheader .= ' ' . $name . '=' . $cookie['value'] . ";"; + } + } + $cookieheader = 'Cookie:' . $version . substr($cookieheader, 0, -1) . "\r\n"; + } + + $op= 'POST ' . $uri. " HTTP/1.0\r\n" . + 'User-Agent: ' . $this->user_agent . "\r\n" . + 'Host: '. $server . ':' . $port . "\r\n" . + $credentials . + $proxy_credentials . + $accepted_encoding . + $encoding_hdr . + 'Accept-Charset: ' . implode(',', $this->accepted_charset_encodings) . "\r\n" . + $cookieheader . + 'Content-Type: ' . $msg->content_type . "\r\nContent-Length: " . + strlen($payload) . "\r\n\r\n" . + $payload; + + if($this->debug > 1) + { + print "
    \n---SENDING---\n" . htmlentities($op) . "\n---END---\n
    "; + // let the client see this now in case http times out... + flush(); + } + + if($timeout>0) + { + $fp=@fsockopen($connectserver, $connectport, $this->errno, $this->errstr, $timeout); + } + else + { + $fp=@fsockopen($connectserver, $connectport, $this->errno, $this->errstr); + } + if($fp) + { + if($timeout>0 && function_exists('stream_set_timeout')) + { + stream_set_timeout($fp, $timeout); + } + } + else + { + $this->errstr='Connect error: '.$this->errstr; + $r=new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $this->errstr . ' (' . $this->errno . ')'); + return $r; + } + + if(!fputs($fp, $op, strlen($op))) + { + fclose($fp); + $this->errstr='Write error'; + $r=new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $this->errstr); + return $r; + } + else + { + // reset errno and errstr on succesful socket connection + $this->errstr = ''; + } + // G. Giunta 2005/10/24: close socket before parsing. + // should yeld slightly better execution times, and make easier recursive calls (e.g. to follow http redirects) + $ipd=''; + do + { + // shall we check for $data === FALSE? + // as per the manual, it signals an error + $ipd.=fread($fp, 32768); + } while(!feof($fp)); + fclose($fp); + $r =& $msg->parseResponse($ipd, false, $this->return_type); + return $r; + + } + + /** + * @access private + */ + function &sendPayloadHTTPS($msg, $server, $port, $timeout=0, $username='', + $password='', $authtype=1, $cert='',$certpass='', $cacert='', $cacertdir='', + $proxyhost='', $proxyport=0, $proxyusername='', $proxypassword='', $proxyauthtype=1, + $keepalive=false, $key='', $keypass='') + { + $r =& $this->sendPayloadCURL($msg, $server, $port, $timeout, $username, + $password, $authtype, $cert, $certpass, $cacert, $cacertdir, $proxyhost, $proxyport, + $proxyusername, $proxypassword, $proxyauthtype, 'https', $keepalive, $key, $keypass); + return $r; + } + + /** + * Contributed by Justin Miller + * Requires curl to be built into PHP + * NB: CURL versions before 7.11.10 cannot use proxy to talk to https servers! + * @access private + */ + function &sendPayloadCURL($msg, $server, $port, $timeout=0, $username='', + $password='', $authtype=1, $cert='', $certpass='', $cacert='', $cacertdir='', + $proxyhost='', $proxyport=0, $proxyusername='', $proxypassword='', $proxyauthtype=1, $method='https', + $keepalive=false, $key='', $keypass='') + { + if(!function_exists('curl_init')) + { + $this->errstr='CURL unavailable on this install'; + $r=new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['no_curl'], $GLOBALS['xmlrpcstr']['no_curl']); + return $r; + } + if($method == 'https') + { + if(($info = curl_version()) && + ((is_string($info) && strpos($info, 'OpenSSL') === null) || (is_array($info) && !isset($info['ssl_version'])))) + { + $this->errstr='SSL unavailable on this install'; + $r=new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['no_ssl'], $GLOBALS['xmlrpcstr']['no_ssl']); + return $r; + } + } + + if($port == 0) + { + if($method == 'http') + { + $port = 80; + } + else + { + $port = 443; + } + } + + // Only create the payload if it was not created previously + if(empty($msg->payload)) + { + $msg->createPayload($this->request_charset_encoding); + } + + // Deflate request body and set appropriate request headers + $payload = $msg->payload; + if(function_exists('gzdeflate') && ($this->request_compression == 'gzip' || $this->request_compression == 'deflate')) + { + if($this->request_compression == 'gzip') + { + $a = @gzencode($payload); + if($a) + { + $payload = $a; + $encoding_hdr = 'Content-Encoding: gzip'; + } + } + else + { + $a = @gzcompress($payload); + if($a) + { + $payload = $a; + $encoding_hdr = 'Content-Encoding: deflate'; + } + } + } + else + { + $encoding_hdr = ''; + } + + if($this->debug > 1) + { + print "
    \n---SENDING---\n" . htmlentities($payload) . "\n---END---\n
    "; + // let the client see this now in case http times out... + flush(); + } + + if(!$keepalive || !$this->xmlrpc_curl_handle) + { + $curl = curl_init($method . '://' . $server . ':' . $port . $this->path); + if($keepalive) + { + $this->xmlrpc_curl_handle = $curl; + } + } + else + { + $curl = $this->xmlrpc_curl_handle; + } + + // results into variable + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + + if($this->debug) + { + curl_setopt($curl, CURLOPT_VERBOSE, 1); + } + curl_setopt($curl, CURLOPT_USERAGENT, $this->user_agent); + // required for XMLRPC: post the data + curl_setopt($curl, CURLOPT_POST, 1); + // the data + curl_setopt($curl, CURLOPT_POSTFIELDS, $payload); + + // return the header too + curl_setopt($curl, CURLOPT_HEADER, 1); + + // will only work with PHP >= 5.0 + // NB: if we set an empty string, CURL will add http header indicating + // ALL methods it is supporting. This is possibly a better option than + // letting the user tell what curl can / cannot do... + if(is_array($this->accepted_compression) && count($this->accepted_compression)) + { + //curl_setopt($curl, CURLOPT_ENCODING, implode(',', $this->accepted_compression)); + // empty string means 'any supported by CURL' (shall we catch errors in case CURLOPT_SSLKEY undefined ?) + if (count($this->accepted_compression) == 1) + { + curl_setopt($curl, CURLOPT_ENCODING, $this->accepted_compression[0]); + } + else + curl_setopt($curl, CURLOPT_ENCODING, ''); + } + // extra headers + $headers = array('Content-Type: ' . $msg->content_type , 'Accept-Charset: ' . implode(',', $this->accepted_charset_encodings)); + // if no keepalive is wanted, let the server know it in advance + if(!$keepalive) + { + $headers[] = 'Connection: close'; + } + // request compression header + if($encoding_hdr) + { + $headers[] = $encoding_hdr; + } + + curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); + // timeout is borked + if($timeout) + { + curl_setopt($curl, CURLOPT_TIMEOUT, $timeout == 1 ? 1 : $timeout - 1); + } + + if($username && $password) + { + curl_setopt($curl, CURLOPT_USERPWD, $username.':'.$password); + if (defined('CURLOPT_HTTPAUTH')) + { + curl_setopt($curl, CURLOPT_HTTPAUTH, $authtype); + } + else if ($authtype != 1) + { + error_log('XML-RPC: '.__METHOD__.': warning. Only Basic auth is supported by the current PHP/curl install'); + } + } + + if($method == 'https') + { + // set cert file + if($cert) + { + curl_setopt($curl, CURLOPT_SSLCERT, $cert); + } + // set cert password + if($certpass) + { + curl_setopt($curl, CURLOPT_SSLCERTPASSWD, $certpass); + } + // whether to verify remote host's cert + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->verifypeer); + // set ca certificates file/dir + if($cacert) + { + curl_setopt($curl, CURLOPT_CAINFO, $cacert); + } + if($cacertdir) + { + curl_setopt($curl, CURLOPT_CAPATH, $cacertdir); + } + // set key file (shall we catch errors in case CURLOPT_SSLKEY undefined ?) + if($key) + { + curl_setopt($curl, CURLOPT_SSLKEY, $key); + } + // set key password (shall we catch errors in case CURLOPT_SSLKEY undefined ?) + if($keypass) + { + curl_setopt($curl, CURLOPT_SSLKEYPASSWD, $keypass); + } + // whether to verify cert's common name (CN); 0 for no, 1 to verify that it exists, and 2 to verify that it matches the hostname used + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, $this->verifyhost); + } + + // proxy info + if($proxyhost) + { + if($proxyport == 0) + { + $proxyport = 8080; // NB: even for HTTPS, local connection is on port 8080 + } + curl_setopt($curl, CURLOPT_PROXY, $proxyhost.':'.$proxyport); + //curl_setopt($curl, CURLOPT_PROXYPORT,$proxyport); + if($proxyusername) + { + curl_setopt($curl, CURLOPT_PROXYUSERPWD, $proxyusername.':'.$proxypassword); + if (defined('CURLOPT_PROXYAUTH')) + { + curl_setopt($curl, CURLOPT_PROXYAUTH, $proxyauthtype); + } + else if ($proxyauthtype != 1) + { + error_log('XML-RPC: '.__METHOD__.': warning. Only Basic auth to proxy is supported by the current PHP/curl install'); + } + } + } + + // NB: should we build cookie http headers by hand rather than let CURL do it? + // the following code does not honour 'expires', 'path' and 'domain' cookie attributes + // set to client obj the the user... + if (count($this->cookies)) + { + $cookieheader = ''; + foreach ($this->cookies as $name => $cookie) + { + $cookieheader .= $name . '=' . $cookie['value'] . '; '; + } + curl_setopt($curl, CURLOPT_COOKIE, substr($cookieheader, 0, -2)); + } + + foreach ($this->extracurlopts as $opt => $val) + { + curl_setopt($curl, $opt, $val); + } + + $result = curl_exec($curl); + + if ($this->debug > 1) + { + print "
    \n---CURL INFO---\n";
    +				foreach(curl_getinfo($curl) as $name => $val)
    +					 print $name . ': ' . htmlentities($val). "\n";
    +				print "---END---\n
    "; + } + + if(!$result) /// @todo we should use a better check here - what if we get back '' or '0'? + { + $this->errstr='no response'; + $resp=new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['curl_fail'], $GLOBALS['xmlrpcstr']['curl_fail']. ': '. curl_error($curl)); + curl_close($curl); + if($keepalive) + { + $this->xmlrpc_curl_handle = null; + } + } + else + { + if(!$keepalive) + { + curl_close($curl); + } + $resp =& $msg->parseResponse($result, true, $this->return_type); + } + return $resp; + } + + /** + * Send an array of request messages and return an array of responses. + * Unless $this->no_multicall has been set to true, it will try first + * to use one single xmlrpc call to server method system.multicall, and + * revert to sending many successive calls in case of failure. + * This failure is also stored in $this->no_multicall for subsequent calls. + * Unfortunately, there is no server error code universally used to denote + * the fact that multicall is unsupported, so there is no way to reliably + * distinguish between that and a temporary failure. + * If you are sure that server supports multicall and do not want to + * fallback to using many single calls, set the fourth parameter to FALSE. + * + * NB: trying to shoehorn extra functionality into existing syntax has resulted + * in pretty much convoluted code... + * + * @param array $msgs an array of xmlrpcmsg objects + * @param integer $timeout connection timeout (in seconds) + * @param string $method the http protocol variant to be used + * @param boolean fallback When true, upon receiveing an error during multicall, multiple single calls will be attempted + * @return array + * @access public + */ + function multicall($msgs, $timeout=0, $method='', $fallback=true) + { + if ($method == '') + { + $method = $this->method; + } + if(!$this->no_multicall) + { + $results = $this->_try_multicall($msgs, $timeout, $method); + if(is_array($results)) + { + // System.multicall succeeded + return $results; + } + else + { + // either system.multicall is unsupported by server, + // or call failed for some other reason. + if ($fallback) + { + // Don't try it next time... + $this->no_multicall = true; + } + else + { + if (is_a($results, 'xmlrpcresp')) + { + $result = $results; + } + else + { + $result = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['multicall_error'], $GLOBALS['xmlrpcstr']['multicall_error']); + } + } + } + } + else + { + // override fallback, in case careless user tries to do two + // opposite things at the same time + $fallback = true; + } + + $results = array(); + if ($fallback) + { + // system.multicall is (probably) unsupported by server: + // emulate multicall via multiple requests + foreach($msgs as $msg) + { + $results[] =& $this->send($msg, $timeout, $method); + } + } + else + { + // user does NOT want to fallback on many single calls: + // since we should always return an array of responses, + // return an array with the same error repeated n times + foreach($msgs as $msg) + { + $results[] = $result; + } + } + return $results; + } + + /** + * Attempt to boxcar $msgs via system.multicall. + * Returns either an array of xmlrpcreponses, an xmlrpc error response + * or false (when received response does not respect valid multicall syntax) + * @access private + */ + function _try_multicall($msgs, $timeout, $method) + { + // Construct multicall message + $calls = array(); + foreach($msgs as $msg) + { + $call['methodName'] = new xmlrpcval($msg->method(),'string'); + $numParams = $msg->getNumParams(); + $params = array(); + for($i = 0; $i < $numParams; $i++) + { + $params[$i] = $msg->getParam($i); + } + $call['params'] = new xmlrpcval($params, 'array'); + $calls[] = new xmlrpcval($call, 'struct'); + } + $multicall = new xmlrpcmsg('system.multicall'); + $multicall->addParam(new xmlrpcval($calls, 'array')); + + // Attempt RPC call + $result =& $this->send($multicall, $timeout, $method); + + if($result->faultCode() != 0) + { + // call to system.multicall failed + return $result; + } + + // Unpack responses. + $rets = $result->value(); + + if ($this->return_type == 'xml') + { + return $rets; + } + else if ($this->return_type == 'phpvals') + { + ///@todo test this code branch... + $rets = $result->value(); + if(!is_array($rets)) + { + return false; // bad return type from system.multicall + } + $numRets = count($rets); + if($numRets != count($msgs)) + { + return false; // wrong number of return values. + } + + $response = array(); + for($i = 0; $i < $numRets; $i++) + { + $val = $rets[$i]; + if (!is_array($val)) { + return false; + } + switch(count($val)) + { + case 1: + if(!isset($val[0])) + { + return false; // Bad value + } + // Normal return value + $response[$i] = new xmlrpcresp($val[0], 0, '', 'phpvals'); + break; + case 2: + /// @todo remove usage of @: it is apparently quite slow + $code = @$val['faultCode']; + if(!is_int($code)) + { + return false; + } + $str = @$val['faultString']; + if(!is_string($str)) + { + return false; + } + $response[$i] = new xmlrpcresp(0, $code, $str); + break; + default: + return false; + } + } + return $response; + } + else // return type == 'xmlrpcvals' + { + $rets = $result->value(); + if($rets->kindOf() != 'array') + { + return false; // bad return type from system.multicall + } + $numRets = $rets->arraysize(); + if($numRets != count($msgs)) + { + return false; // wrong number of return values. + } + + $response = array(); + for($i = 0; $i < $numRets; $i++) + { + $val = $rets->arraymem($i); + switch($val->kindOf()) + { + case 'array': + if($val->arraysize() != 1) + { + return false; // Bad value + } + // Normal return value + $response[$i] = new xmlrpcresp($val->arraymem(0)); + break; + case 'struct': + $code = $val->structmem('faultCode'); + if($code->kindOf() != 'scalar' || $code->scalartyp() != 'int') + { + return false; + } + $str = $val->structmem('faultString'); + if($str->kindOf() != 'scalar' || $str->scalartyp() != 'string') + { + return false; + } + $response[$i] = new xmlrpcresp(0, $code->scalarval(), $str->scalarval()); + break; + default: + return false; + } + } + return $response; + } + } + } // end class xmlrpc_client + + class xmlrpcresp + { + var $val = 0; + var $valtyp; + var $errno = 0; + var $errstr = ''; + var $payload; + var $hdrs = array(); + var $_cookies = array(); + var $content_type = 'text/xml'; + var $raw_data = ''; + + /** + * @param mixed $val either an xmlrpcval obj, a php value or the xml serialization of an xmlrpcval (a string) + * @param integer $fcode set it to anything but 0 to create an error response + * @param string $fstr the error string, in case of an error response + * @param string $valtyp either 'xmlrpcvals', 'phpvals' or 'xml' + * + * @todo add check that $val / $fcode / $fstr is of correct type??? + * NB: as of now we do not do it, since it might be either an xmlrpcval or a plain + * php val, or a complete xml chunk, depending on usage of xmlrpc_client::send() inside which creator is called... + */ + function xmlrpcresp($val, $fcode = 0, $fstr = '', $valtyp='') + { + if($fcode != 0) + { + // error response + $this->errno = $fcode; + $this->errstr = $fstr; + //$this->errstr = htmlspecialchars($fstr); // XXX: encoding probably shouldn't be done here; fix later. + } + else + { + // successful response + $this->val = $val; + if ($valtyp == '') + { + // user did not declare type of response value: try to guess it + if (is_object($this->val) && is_a($this->val, 'xmlrpcval')) + { + $this->valtyp = 'xmlrpcvals'; + } + else if (is_string($this->val)) + { + $this->valtyp = 'xml'; + + } + else + { + $this->valtyp = 'phpvals'; + } + } + else + { + // user declares type of resp value: believe him + $this->valtyp = $valtyp; + } + } + } + + /** + * Returns the error code of the response. + * @return integer the error code of this response (0 for not-error responses) + * @access public + */ + function faultCode() + { + return $this->errno; + } + + /** + * Returns the error code of the response. + * @return string the error string of this response ('' for not-error responses) + * @access public + */ + function faultString() + { + return $this->errstr; + } + + /** + * Returns the value received by the server. + * @return mixed the xmlrpcval object returned by the server. Might be an xml string or php value if the response has been created by specially configured xmlrpc_client objects + * @access public + */ + function value() + { + return $this->val; + } + + /** + * Returns an array with the cookies received from the server. + * Array has the form: $cookiename => array ('value' => $val, $attr1 => $val1, $attr2 = $val2, ...) + * with attributes being e.g. 'expires', 'path', domain'. + * NB: cookies sent as 'expired' by the server (i.e. with an expiry date in the past) + * are still present in the array. It is up to the user-defined code to decide + * how to use the received cookies, and wheter they have to be sent back with the next + * request to the server (using xmlrpc_client::setCookie) or not + * @return array array of cookies received from the server + * @access public + */ + function cookies() + { + return $this->_cookies; + } + + /** + * Returns xml representation of the response. XML prologue not included + * @param string $charset_encoding the charset to be used for serialization. if null, US-ASCII is assumed + * @return string the xml representation of the response + * @access public + */ + function serialize($charset_encoding='') + { + if ($charset_encoding != '') + $this->content_type = 'text/xml; charset=' . $charset_encoding; + else + $this->content_type = 'text/xml'; + $result = "\n"; + if($this->errno) + { + // G. Giunta 2005/2/13: let non-ASCII response messages be tolerated by clients + // by xml-encoding non ascii chars + $result .= "\n" . +"\nfaultCode\n" . $this->errno . +"\n\n\nfaultString\n" . +xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $charset_encoding) . "\n\n" . +"\n\n"; + } + else + { + if(!is_object($this->val) || !is_a($this->val, 'xmlrpcval')) + { + if (is_string($this->val) && $this->valtyp == 'xml') + { + $result .= "\n\n" . + $this->val . + "\n"; + } + else + { + /// @todo try to build something serializable? + die('cannot serialize xmlrpcresp objects whose content is native php values'); + } + } + else + { + $result .= "\n\n" . + $this->val->serialize($charset_encoding) . + "\n"; + } + } + $result .= "\n"; + $this->payload = $result; + return $result; + } + } + + class xmlrpcmsg + { + var $payload; + var $methodname; + var $params=array(); + var $debug=0; + var $content_type = 'text/xml'; + + /** + * @param string $meth the name of the method to invoke + * @param array $pars array of parameters to be paased to the method (xmlrpcval objects) + */ + function xmlrpcmsg($meth, $pars=0) + { + $this->methodname=$meth; + if(is_array($pars) && count($pars)>0) + { + for($i=0; $iaddParam($pars[$i]); + } + } + } + + /** + * @access private + */ + function xml_header($charset_encoding='') + { + if ($charset_encoding != '') + { + return "\n\n"; + } + else + { + return "\n\n"; + } + } + + /** + * @access private + */ + function xml_footer() + { + return ''; + } + + /** + * @access private + */ + function kindOf() + { + return 'msg'; + } + + /** + * @access private + */ + function createPayload($charset_encoding='') + { + if ($charset_encoding != '') + $this->content_type = 'text/xml; charset=' . $charset_encoding; + else + $this->content_type = 'text/xml'; + $this->payload=$this->xml_header($charset_encoding); + $this->payload.='' . $this->methodname . "\n"; + $this->payload.="\n"; + for($i=0; $iparams); $i++) + { + $p=$this->params[$i]; + $this->payload.="\n" . $p->serialize($charset_encoding) . + "\n"; + } + $this->payload.="\n"; + $this->payload.=$this->xml_footer(); + } + + /** + * Gets/sets the xmlrpc method to be invoked + * @param string $meth the method to be set (leave empty not to set it) + * @return string the method that will be invoked + * @access public + */ + function method($meth='') + { + if($meth!='') + { + $this->methodname=$meth; + } + return $this->methodname; + } + + /** + * Returns xml representation of the message. XML prologue included + * @return string the xml representation of the message, xml prologue included + * @access public + */ + function serialize($charset_encoding='') + { + $this->createPayload($charset_encoding); + return $this->payload; + } + + /** + * Add a parameter to the list of parameters to be used upon method invocation + * @param xmlrpcval $par + * @return boolean false on failure + * @access public + */ + function addParam($par) + { + // add check: do not add to self params which are not xmlrpcvals + if(is_object($par) && is_a($par, 'xmlrpcval')) + { + $this->params[]=$par; + return true; + } + else + { + return false; + } + } + + /** + * Returns the nth parameter in the message. The index zero-based. + * @param integer $i the index of the parameter to fetch (zero based) + * @return xmlrpcval the i-th parameter + * @access public + */ + function getParam($i) { return $this->params[$i]; } + + /** + * Returns the number of parameters in the messge. + * @return integer the number of parameters currently set + * @access public + */ + function getNumParams() { return count($this->params); } + + /** + * Given an open file handle, read all data available and parse it as axmlrpc response. + * NB: the file handle is not closed by this function. + * NNB: might have trouble in rare cases to work on network streams, as we + * check for a read of 0 bytes instead of feof($fp). + * But since checking for feof(null) returns false, we would risk an + * infinite loop in that case, because we cannot trust the caller + * to give us a valid pointer to an open file... + * @access public + * @return xmlrpcresp + * @todo add 2nd & 3rd param to be passed to ParseResponse() ??? + */ + function &parseResponseFile($fp) + { + $ipd=''; + while($data=fread($fp, 32768)) + { + $ipd.=$data; + } + //fclose($fp); + $r =& $this->parseResponse($ipd); + return $r; + } + + /** + * Parses HTTP headers and separates them from data. + * @access private + */ + function &parseResponseHeaders(&$data, $headers_processed=false) + { + // Support "web-proxy-tunelling" connections for https through proxies + if(preg_match('/^HTTP\/1\.[0-1] 200 Connection established/', $data)) + { + // Look for CR/LF or simple LF as line separator, + // (even though it is not valid http) + $pos = strpos($data,"\r\n\r\n"); + if($pos || is_int($pos)) + { + $bd = $pos+4; + } + else + { + $pos = strpos($data,"\n\n"); + if($pos || is_int($pos)) + { + $bd = $pos+2; + } + else + { + // No separation between response headers and body: fault? + $bd = 0; + } + } + if ($bd) + { + // this filters out all http headers from proxy. + // maybe we could take them into account, too? + $data = substr($data, $bd); + } + else + { + error_log('XML-RPC: '.__METHOD__.': HTTPS via proxy error, tunnel connection possibly failed'); + $r=new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $GLOBALS['xmlrpcstr']['http_error']. ' (HTTPS via proxy error, tunnel connection possibly failed)'); + return $r; + } + } + + // Strip HTTP 1.1 100 Continue header if present + while(preg_match('/^HTTP\/1\.1 1[0-9]{2} /', $data)) + { + $pos = strpos($data, 'HTTP', 12); + // server sent a Continue header without any (valid) content following... + // give the client a chance to know it + if(!$pos && !is_int($pos)) // works fine in php 3, 4 and 5 + { + break; + } + $data = substr($data, $pos); + } + if(!preg_match('/^HTTP\/[0-9.]+ 200 /', $data)) + { + $errstr= substr($data, 0, strpos($data, "\n")-1); + error_log('XML-RPC: '.__METHOD__.': HTTP error, got response: ' .$errstr); + $r=new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $GLOBALS['xmlrpcstr']['http_error']. ' (' . $errstr . ')'); + return $r; + } + + $GLOBALS['_xh']['headers'] = array(); + $GLOBALS['_xh']['cookies'] = array(); + + // be tolerant to usage of \n instead of \r\n to separate headers and data + // (even though it is not valid http) + $pos = strpos($data,"\r\n\r\n"); + if($pos || is_int($pos)) + { + $bd = $pos+4; + } + else + { + $pos = strpos($data,"\n\n"); + if($pos || is_int($pos)) + { + $bd = $pos+2; + } + else + { + // No separation between response headers and body: fault? + // we could take some action here instead of going on... + $bd = 0; + } + } + // be tolerant to line endings, and extra empty lines + $ar = preg_split("/\r?\n/", trim(substr($data, 0, $pos))); + while(list(,$line) = @each($ar)) + { + // take care of multi-line headers and cookies + $arr = explode(':',$line,2); + if(count($arr) > 1) + { + $header_name = strtolower(trim($arr[0])); + /// @todo some other headers (the ones that allow a CSV list of values) + /// do allow many values to be passed using multiple header lines. + /// We should add content to $GLOBALS['_xh']['headers'][$header_name] + /// instead of replacing it for those... + if ($header_name == 'set-cookie' || $header_name == 'set-cookie2') + { + if ($header_name == 'set-cookie2') + { + // version 2 cookies: + // there could be many cookies on one line, comma separated + $cookies = explode(',', $arr[1]); + } + else + { + $cookies = array($arr[1]); + } + foreach ($cookies as $cookie) + { + // glue together all received cookies, using a comma to separate them + // (same as php does with getallheaders()) + if (isset($GLOBALS['_xh']['headers'][$header_name])) + $GLOBALS['_xh']['headers'][$header_name] .= ', ' . trim($cookie); + else + $GLOBALS['_xh']['headers'][$header_name] = trim($cookie); + // parse cookie attributes, in case user wants to correctly honour them + // feature creep: only allow rfc-compliant cookie attributes? + // @todo support for server sending multiple time cookie with same name, but using different PATHs + $cookie = explode(';', $cookie); + foreach ($cookie as $pos => $val) + { + $val = explode('=', $val, 2); + $tag = trim($val[0]); + $val = trim(@$val[1]); + /// @todo with version 1 cookies, we should strip leading and trailing " chars + if ($pos == 0) + { + $cookiename = $tag; + $GLOBALS['_xh']['cookies'][$tag] = array(); + $GLOBALS['_xh']['cookies'][$cookiename]['value'] = urldecode($val); + } + else + { + if ($tag != 'value') + { + $GLOBALS['_xh']['cookies'][$cookiename][$tag] = $val; + } + } + } + } + } + else + { + $GLOBALS['_xh']['headers'][$header_name] = trim($arr[1]); + } + } + elseif(isset($header_name)) + { + /// @todo version1 cookies might span multiple lines, thus breaking the parsing above + $GLOBALS['_xh']['headers'][$header_name] .= ' ' . trim($line); + } + } + + $data = substr($data, $bd); + + if($this->debug && count($GLOBALS['_xh']['headers'])) + { + print '
    ';
    +					foreach($GLOBALS['_xh']['headers'] as $header => $value)
    +					{
    +						print htmlentities("HEADER: $header: $value\n");
    +					}
    +					foreach($GLOBALS['_xh']['cookies'] as $header => $value)
    +					{
    +						print htmlentities("COOKIE: $header={$value['value']}\n");
    +					}
    +					print "
    \n"; + } + + // if CURL was used for the call, http headers have been processed, + // and dechunking + reinflating have been carried out + if(!$headers_processed) + { + // Decode chunked encoding sent by http 1.1 servers + if(isset($GLOBALS['_xh']['headers']['transfer-encoding']) && $GLOBALS['_xh']['headers']['transfer-encoding'] == 'chunked') + { + if(!$data = decode_chunked($data)) + { + error_log('XML-RPC: '.__METHOD__.': errors occurred when trying to rebuild the chunked data received from server'); + $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['dechunk_fail'], $GLOBALS['xmlrpcstr']['dechunk_fail']); + return $r; + } + } + + // Decode gzip-compressed stuff + // code shamelessly inspired from nusoap library by Dietrich Ayala + if(isset($GLOBALS['_xh']['headers']['content-encoding'])) + { + $GLOBALS['_xh']['headers']['content-encoding'] = str_replace('x-', '', $GLOBALS['_xh']['headers']['content-encoding']); + if($GLOBALS['_xh']['headers']['content-encoding'] == 'deflate' || $GLOBALS['_xh']['headers']['content-encoding'] == 'gzip') + { + // if decoding works, use it. else assume data wasn't gzencoded + if(function_exists('gzinflate')) + { + if($GLOBALS['_xh']['headers']['content-encoding'] == 'deflate' && $degzdata = @gzuncompress($data)) + { + $data = $degzdata; + if($this->debug) + print "
    ---INFLATED RESPONSE---[".strlen($data)." chars]---\n" . htmlentities($data) . "\n---END---
    "; + } + elseif($GLOBALS['_xh']['headers']['content-encoding'] == 'gzip' && $degzdata = @gzinflate(substr($data, 10))) + { + $data = $degzdata; + if($this->debug) + print "
    ---INFLATED RESPONSE---[".strlen($data)." chars]---\n" . htmlentities($data) . "\n---END---
    "; + } + else + { + error_log('XML-RPC: '.__METHOD__.': errors occurred when trying to decode the deflated data received from server'); + $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['decompress_fail'], $GLOBALS['xmlrpcstr']['decompress_fail']); + return $r; + } + } + else + { + error_log('XML-RPC: '.__METHOD__.': the server sent deflated data. Your php install must have the Zlib extension compiled in to support this.'); + $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['cannot_decompress'], $GLOBALS['xmlrpcstr']['cannot_decompress']); + return $r; + } + } + } + } // end of 'if needed, de-chunk, re-inflate response' + + // real stupid hack to avoid PHP complaining about returning NULL by ref + $r = null; + $r =& $r; + return $r; + } + + /** + * Parse the xmlrpc response contained in the string $data and return an xmlrpcresp object. + * @param string $data the xmlrpc response, eventually including http headers + * @param bool $headers_processed when true prevents parsing HTTP headers for interpretation of content-encoding and consequent decoding + * @param string $return_type decides return type, i.e. content of response->value(). Either 'xmlrpcvals', 'xml' or 'phpvals' + * @return xmlrpcresp + * @access public + */ + function &parseResponse($data='', $headers_processed=false, $return_type='xmlrpcvals') + { + if($this->debug) + { + //by maHo, replaced htmlspecialchars with htmlentities + print "
    ---GOT---\n" . htmlentities($data) . "\n---END---\n
    "; + } + + if($data == '') + { + error_log('XML-RPC: '.__METHOD__.': no response received from server.'); + $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['no_data'], $GLOBALS['xmlrpcstr']['no_data']); + return $r; + } + + $GLOBALS['_xh']=array(); + + $raw_data = $data; + // parse the HTTP headers of the response, if present, and separate them from data + if(substr($data, 0, 4) == 'HTTP') + { + $r =& $this->parseResponseHeaders($data, $headers_processed); + if ($r) + { + // failed processing of HTTP response headers + // save into response obj the full payload received, for debugging + $r->raw_data = $data; + return $r; + } + } + else + { + $GLOBALS['_xh']['headers'] = array(); + $GLOBALS['_xh']['cookies'] = array(); + } + + if($this->debug) + { + $start = strpos($data, '', $start); + $comments = substr($data, $start, $end-$start); + print "
    ---SERVER DEBUG INFO (DECODED) ---\n\t".htmlentities(str_replace("\n", "\n\t", base64_decode($comments)))."\n---END---\n
    "; + } + } + + // be tolerant of extra whitespace in response body + $data = trim($data); + + /// @todo return an error msg if $data=='' ? + + // be tolerant of junk after methodResponse (e.g. javascript ads automatically inserted by free hosts) + // idea from Luca Mariano originally in PEARified version of the lib + $pos = strrpos($data, ''); + if($pos !== false) + { + $data = substr($data, 0, $pos+17); + } + + // if user wants back raw xml, give it to him + if ($return_type == 'xml') + { + $r = new xmlrpcresp($data, 0, '', 'xml'); + $r->hdrs = $GLOBALS['_xh']['headers']; + $r->_cookies = $GLOBALS['_xh']['cookies']; + $r->raw_data = $raw_data; + return $r; + } + + // try to 'guestimate' the character encoding of the received response + $resp_encoding = guess_encoding(@$GLOBALS['_xh']['headers']['content-type'], $data); + + $GLOBALS['_xh']['ac']=''; + //$GLOBALS['_xh']['qt']=''; //unused... + $GLOBALS['_xh']['stack'] = array(); + $GLOBALS['_xh']['valuestack'] = array(); + $GLOBALS['_xh']['isf']=0; // 0 = OK, 1 for xmlrpc fault responses, 2 = invalid xmlrpc + $GLOBALS['_xh']['isf_reason']=''; + $GLOBALS['_xh']['rt']=''; // 'methodcall or 'methodresponse' + + // if response charset encoding is not known / supported, try to use + // the default encoding and parse the xml anyway, but log a warning... + if (!in_array($resp_encoding, array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) + // the following code might be better for mb_string enabled installs, but + // makes the lib about 200% slower... + //if (!is_valid_charset($resp_encoding, array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) + { + error_log('XML-RPC: '.__METHOD__.': invalid charset encoding of received response: '.$resp_encoding); + $resp_encoding = $GLOBALS['xmlrpc_defencoding']; + } + $parser = xml_parser_create($resp_encoding); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true); + // G. Giunta 2005/02/13: PHP internally uses ISO-8859-1, so we have to tell + // the xml parser to give us back data in the expected charset. + // What if internal encoding is not in one of the 3 allowed? + // we use the broadest one, ie. utf8 + // This allows to send data which is native in various charset, + // by extending xmlrpc_encode_entitites() and setting xmlrpc_internalencoding + if (!in_array($GLOBALS['xmlrpc_internalencoding'], array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) + { + xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, 'UTF-8'); + } + else + { + xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $GLOBALS['xmlrpc_internalencoding']); + } + + if ($return_type == 'phpvals') + { + xml_set_element_handler($parser, 'xmlrpc_se', 'xmlrpc_ee_fast'); + } + else + { + xml_set_element_handler($parser, 'xmlrpc_se', 'xmlrpc_ee'); + } + + xml_set_character_data_handler($parser, 'xmlrpc_cd'); + xml_set_default_handler($parser, 'xmlrpc_dh'); + + // first error check: xml not well formed + if(!xml_parse($parser, $data, count($data))) + { + // thanks to Peter Kocks + if((xml_get_current_line_number($parser)) == 1) + { + $errstr = 'XML error at line 1, check URL'; + } + else + { + $errstr = sprintf('XML error: %s at line %d, column %d', + xml_error_string(xml_get_error_code($parser)), + xml_get_current_line_number($parser), xml_get_current_column_number($parser)); + } + error_log($errstr); + $r=new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['invalid_return'], $GLOBALS['xmlrpcstr']['invalid_return'].' ('.$errstr.')'); + xml_parser_free($parser); + if($this->debug) + { + print $errstr; + } + $r->hdrs = $GLOBALS['_xh']['headers']; + $r->_cookies = $GLOBALS['_xh']['cookies']; + $r->raw_data = $raw_data; + return $r; + } + xml_parser_free($parser); + // second error check: xml well formed but not xml-rpc compliant + if ($GLOBALS['_xh']['isf'] > 1) + { + if ($this->debug) + { + /// @todo echo something for user? + } + + $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['invalid_return'], + $GLOBALS['xmlrpcstr']['invalid_return'] . ' ' . $GLOBALS['_xh']['isf_reason']); + } + // third error check: parsing of the response has somehow gone boink. + // NB: shall we omit this check, since we trust the parsing code? + elseif ($return_type == 'xmlrpcvals' && !is_object($GLOBALS['_xh']['value'])) + { + // something odd has happened + // and it's time to generate a client side error + // indicating something odd went on + $r=new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['invalid_return'], + $GLOBALS['xmlrpcstr']['invalid_return']); + } + else + { + if ($this->debug) + { + print "
    ---PARSED---\n";
    +					// somehow htmlentities chokes on var_export, and some full html string...
    +					//print htmlentitites(var_export($GLOBALS['_xh']['value'], true));
    +					print htmlspecialchars(var_export($GLOBALS['_xh']['value'], true));
    +					print "\n---END---
    "; + } + + // note that using =& will raise an error if $GLOBALS['_xh']['st'] does not generate an object. + $v =& $GLOBALS['_xh']['value']; + + if($GLOBALS['_xh']['isf']) + { + /// @todo we should test here if server sent an int and a string, + /// and/or coerce them into such... + if ($return_type == 'xmlrpcvals') + { + $errno_v = $v->structmem('faultCode'); + $errstr_v = $v->structmem('faultString'); + $errno = $errno_v->scalarval(); + $errstr = $errstr_v->scalarval(); + } + else + { + $errno = $v['faultCode']; + $errstr = $v['faultString']; + } + + if($errno == 0) + { + // FAULT returned, errno needs to reflect that + $errno = -1; + } + + $r = new xmlrpcresp(0, $errno, $errstr); + } + else + { + $r=new xmlrpcresp($v, 0, '', $return_type); + } + } + + $r->hdrs = $GLOBALS['_xh']['headers']; + $r->_cookies = $GLOBALS['_xh']['cookies']; + $r->raw_data = $raw_data; + return $r; + } + } + + class xmlrpcval + { + var $me=array(); + var $mytype=0; + var $_php_class=null; + + /** + * @param mixed $val + * @param string $type any valid xmlrpc type name (lowercase). If null, 'string' is assumed + */ + function xmlrpcval($val=-1, $type='') + { + /// @todo: optimization creep - do not call addXX, do it all inline. + /// downside: booleans will not be coerced anymore + if($val!==-1 || $type!='') + { + // optimization creep: inlined all work done by constructor + switch($type) + { + case '': + $this->mytype=1; + $this->me['string']=$val; + break; + case 'i4': + case 'int': + case 'double': + case 'string': + case 'boolean': + case 'dateTime.iso8601': + case 'base64': + case 'null': + $this->mytype=1; + $this->me[$type]=$val; + break; + case 'array': + $this->mytype=2; + $this->me['array']=$val; + break; + case 'struct': + $this->mytype=3; + $this->me['struct']=$val; + break; + default: + error_log("XML-RPC: ".__METHOD__.": not a known type ($type)"); + } + /*if($type=='') + { + $type='string'; + } + if($GLOBALS['xmlrpcTypes'][$type]==1) + { + $this->addScalar($val,$type); + } + elseif($GLOBALS['xmlrpcTypes'][$type]==2) + { + $this->addArray($val); + } + elseif($GLOBALS['xmlrpcTypes'][$type]==3) + { + $this->addStruct($val); + }*/ + } + } + + /** + * Add a single php value to an (unitialized) xmlrpcval + * @param mixed $val + * @param string $type + * @return int 1 or 0 on failure + */ + function addScalar($val, $type='string') + { + $typeof=@$GLOBALS['xmlrpcTypes'][$type]; + if($typeof!=1) + { + error_log("XML-RPC: ".__METHOD__.": not a scalar type ($type)"); + return 0; + } + + // coerce booleans into correct values + // NB: we should either do it for datetimes, integers and doubles, too, + // or just plain remove this check, implemented on booleans only... + if($type==$GLOBALS['xmlrpcBoolean']) + { + if(strcasecmp($val,'true')==0 || $val==1 || ($val==true && strcasecmp($val,'false'))) + { + $val=true; + } + else + { + $val=false; + } + } + + switch($this->mytype) + { + case 1: + error_log('XML-RPC: '.__METHOD__.': scalar xmlrpcval can have only one value'); + return 0; + case 3: + error_log('XML-RPC: '.__METHOD__.': cannot add anonymous scalar to struct xmlrpcval'); + return 0; + case 2: + // we're adding a scalar value to an array here + //$ar=$this->me['array']; + //$ar[]=new xmlrpcval($val, $type); + //$this->me['array']=$ar; + // Faster (?) avoid all the costly array-copy-by-val done here... + $this->me['array'][]=new xmlrpcval($val, $type); + return 1; + default: + // a scalar, so set the value and remember we're scalar + $this->me[$type]=$val; + $this->mytype=$typeof; + return 1; + } + } + + /** + * Add an array of xmlrpcval objects to an xmlrpcval + * @param array $vals + * @return int 1 or 0 on failure + * @access public + * + * @todo add some checking for $vals to be an array of xmlrpcvals? + */ + function addArray($vals) + { + if($this->mytype==0) + { + $this->mytype=$GLOBALS['xmlrpcTypes']['array']; + $this->me['array']=$vals; + return 1; + } + elseif($this->mytype==2) + { + // we're adding to an array here + $this->me['array'] = array_merge($this->me['array'], $vals); + return 1; + } + else + { + error_log('XML-RPC: '.__METHOD__.': already initialized as a [' . $this->kindOf() . ']'); + return 0; + } + } + + /** + * Add an array of named xmlrpcval objects to an xmlrpcval + * @param array $vals + * @return int 1 or 0 on failure + * @access public + * + * @todo add some checking for $vals to be an array? + */ + function addStruct($vals) + { + if($this->mytype==0) + { + $this->mytype=$GLOBALS['xmlrpcTypes']['struct']; + $this->me['struct']=$vals; + return 1; + } + elseif($this->mytype==3) + { + // we're adding to a struct here + $this->me['struct'] = array_merge($this->me['struct'], $vals); + return 1; + } + else + { + error_log('XML-RPC: '.__METHOD__.': already initialized as a [' . $this->kindOf() . ']'); + return 0; + } + } + + // poor man's version of print_r ??? + // DEPRECATED! + function dump($ar) + { + foreach($ar as $key => $val) + { + echo "$key => $val
    "; + if($key == 'array') + { + while(list($key2, $val2) = each($val)) + { + echo "-- $key2 => $val2
    "; + } + } + } + } + + /** + * Returns a string containing "struct", "array" or "scalar" describing the base type of the value + * @return string + * @access public + */ + function kindOf() + { + switch($this->mytype) + { + case 3: + return 'struct'; + break; + case 2: + return 'array'; + break; + case 1: + return 'scalar'; + break; + default: + return 'undef'; + } + } + + /** + * @access private + */ + function serializedata($typ, $val, $charset_encoding='') + { + $rs=''; + switch(@$GLOBALS['xmlrpcTypes'][$typ]) + { + case 1: + switch($typ) + { + case $GLOBALS['xmlrpcBase64']: + $rs.="<${typ}>" . base64_encode($val) . ""; + break; + case $GLOBALS['xmlrpcBoolean']: + $rs.="<${typ}>" . ($val ? '1' : '0') . ""; + break; + case $GLOBALS['xmlrpcString']: + // G. Giunta 2005/2/13: do NOT use htmlentities, since + // it will produce named html entities, which are invalid xml + $rs.="<${typ}>" . xmlrpc_encode_entitites($val, $GLOBALS['xmlrpc_internalencoding'], $charset_encoding). ""; + break; + case $GLOBALS['xmlrpcInt']: + case $GLOBALS['xmlrpcI4']: + $rs.="<${typ}>".(int)$val.""; + break; + case $GLOBALS['xmlrpcDouble']: + // avoid using standard conversion of float to string because it is locale-dependent, + // and also because the xmlrpc spec forbids exponential notation. + // sprintf('%F') could be most likely ok but it fails eg. on 2e-14. + // The code below tries its best at keeping max precision while avoiding exp notation, + // but there is of course no limit in the number of decimal places to be used... + $rs.="<${typ}>".preg_replace('/\\.?0+$/','',number_format((double)$val, 128, '.', '')).""; + break; + case $GLOBALS['xmlrpcDateTime']: + if (is_string($val)) + { + $rs.="<${typ}>${val}"; + } + else if(is_a($val, 'DateTime')) + { + $rs.="<${typ}>".$val->format('Ymd\TH:i:s').""; + } + else if(is_int($val)) + { + $rs.="<${typ}>".strftime("%Y%m%dT%H:%M:%S", $val).""; + } + else + { + // not really a good idea here: but what shall we output anyway? left for backward compat... + $rs.="<${typ}>${val}"; + } + break; + case $GLOBALS['xmlrpcNull']: + if ($GLOBALS['xmlrpc_null_apache_encoding']) + { + $rs.=""; + } + else + { + $rs.=""; + } + break; + default: + // no standard type value should arrive here, but provide a possibility + // for xmlrpcvals of unknown type... + $rs.="<${typ}>${val}"; + } + break; + case 3: + // struct + if ($this->_php_class) + { + $rs.='\n"; + } + else + { + $rs.="\n"; + } + foreach($val as $key2 => $val2) + { + $rs.=''.xmlrpc_encode_entitites($key2, $GLOBALS['xmlrpc_internalencoding'], $charset_encoding)."\n"; + //$rs.=$this->serializeval($val2); + $rs.=$val2->serialize($charset_encoding); + $rs.="\n"; + } + $rs.=''; + break; + case 2: + // array + $rs.="\n\n"; + for($i=0; $iserializeval($val[$i]); + $rs.=$val[$i]->serialize($charset_encoding); + } + $rs.="\n"; + break; + default: + break; + } + return $rs; + } + + /** + * Returns xml representation of the value. XML prologue not included + * @param string $charset_encoding the charset to be used for serialization. if null, US-ASCII is assumed + * @return string + * @access public + */ + function serialize($charset_encoding='') + { + // add check? slower, but helps to avoid recursion in serializing broken xmlrpcvals... + //if (is_object($o) && (get_class($o) == 'xmlrpcval' || is_subclass_of($o, 'xmlrpcval'))) + //{ + reset($this->me); + list($typ, $val) = each($this->me); + return '' . $this->serializedata($typ, $val, $charset_encoding) . "\n"; + //} + } + + // DEPRECATED + function serializeval($o) + { + // add check? slower, but helps to avoid recursion in serializing broken xmlrpcvals... + //if (is_object($o) && (get_class($o) == 'xmlrpcval' || is_subclass_of($o, 'xmlrpcval'))) + //{ + $ar=$o->me; + reset($ar); + list($typ, $val) = each($ar); + return '' . $this->serializedata($typ, $val) . "\n"; + //} + } + + /** + * Checks wheter a struct member with a given name is present. + * Works only on xmlrpcvals of type struct. + * @param string $m the name of the struct member to be looked up + * @return boolean + * @access public + */ + function structmemexists($m) + { + return array_key_exists($m, $this->me['struct']); + } + + /** + * Returns the value of a given struct member (an xmlrpcval object in itself). + * Will raise a php warning if struct member of given name does not exist + * @param string $m the name of the struct member to be looked up + * @return xmlrpcval + * @access public + */ + function structmem($m) + { + return $this->me['struct'][$m]; + } + + /** + * Reset internal pointer for xmlrpcvals of type struct. + * @access public + */ + function structreset() + { + reset($this->me['struct']); + } + + /** + * Return next member element for xmlrpcvals of type struct. + * @return xmlrpcval + * @access public + */ + function structeach() + { + return each($this->me['struct']); + } + + // DEPRECATED! this code looks like it is very fragile and has not been fixed + // for a long long time. Shall we remove it for 2.0? + function getval() + { + // UNSTABLE + reset($this->me); + list($a,$b)=each($this->me); + // contributed by I Sofer, 2001-03-24 + // add support for nested arrays to scalarval + // i've created a new method here, so as to + // preserve back compatibility + + if(is_array($b)) + { + @reset($b); + while(list($id,$cont) = @each($b)) + { + $b[$id] = $cont->scalarval(); + } + } + + // add support for structures directly encoding php objects + if(is_object($b)) + { + $t = get_object_vars($b); + @reset($t); + while(list($id,$cont) = @each($t)) + { + $t[$id] = $cont->scalarval(); + } + @reset($t); + while(list($id,$cont) = @each($t)) + { + @$b->$id = $cont; + } + } + // end contrib + return $b; + } + + /** + * Returns the value of a scalar xmlrpcval + * @return mixed + * @access public + */ + function scalarval() + { + reset($this->me); + list(,$b)=each($this->me); + return $b; + } + + /** + * Returns the type of the xmlrpcval. + * For integers, 'int' is always returned in place of 'i4' + * @return string + * @access public + */ + function scalartyp() + { + reset($this->me); + list($a,)=each($this->me); + if($a==$GLOBALS['xmlrpcI4']) + { + $a=$GLOBALS['xmlrpcInt']; + } + return $a; + } + + /** + * Returns the m-th member of an xmlrpcval of struct type + * @param integer $m the index of the value to be retrieved (zero based) + * @return xmlrpcval + * @access public + */ + function arraymem($m) + { + return $this->me['array'][$m]; + } + + /** + * Returns the number of members in an xmlrpcval of array type + * @return integer + * @access public + */ + function arraysize() + { + return count($this->me['array']); + } + + /** + * Returns the number of members in an xmlrpcval of struct type + * @return integer + * @access public + */ + function structsize() + { + return count($this->me['struct']); + } + } + + + // date helpers + + /** + * Given a timestamp, return the corresponding ISO8601 encoded string. + * + * Really, timezones ought to be supported + * but the XML-RPC spec says: + * + * "Don't assume a timezone. It should be specified by the server in its + * documentation what assumptions it makes about timezones." + * + * These routines always assume localtime unless + * $utc is set to 1, in which case UTC is assumed + * and an adjustment for locale is made when encoding + * + * @param int $timet (timestamp) + * @param int $utc (0 or 1) + * @return string + */ + function iso8601_encode($timet, $utc=0) + { + if(!$utc) + { + $t=strftime("%Y%m%dT%H:%M:%S", $timet); + } + else + { + if(function_exists('gmstrftime')) + { + // gmstrftime doesn't exist in some versions + // of PHP + $t=gmstrftime("%Y%m%dT%H:%M:%S", $timet); + } + else + { + $t=strftime("%Y%m%dT%H:%M:%S", $timet-date('Z')); + } + } + return $t; + } + + /** + * Given an ISO8601 date string, return a timet in the localtime, or UTC + * @param string $idate + * @param int $utc either 0 or 1 + * @return int (datetime) + */ + function iso8601_decode($idate, $utc=0) + { + $t=0; + if(preg_match('/([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/', $idate, $regs)) + { + if($utc) + { + $t=gmmktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); + } + else + { + $t=mktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); + } + } + return $t; + } + + /** + * Takes an xmlrpc value in PHP xmlrpcval object format and translates it into native PHP types. + * + * Works with xmlrpc message objects as input, too. + * + * Given proper options parameter, can rebuild generic php object instances + * (provided those have been encoded to xmlrpc format using a corresponding + * option in php_xmlrpc_encode()) + * PLEASE NOTE that rebuilding php objects involves calling their constructor function. + * This means that the remote communication end can decide which php code will + * get executed on your server, leaving the door possibly open to 'php-injection' + * style of attacks (provided you have some classes defined on your server that + * might wreak havoc if instances are built outside an appropriate context). + * Make sure you trust the remote server/client before eanbling this! + * + * @author Dan Libby (dan@libby.com) + * + * @param xmlrpcval $xmlrpc_val + * @param array $options if 'decode_php_objs' is set in the options array, xmlrpc structs can be decoded into php objects; if 'dates_as_objects' is set xmlrpc datetimes are decoded as php DateTime objects (standard is + * @return mixed + */ + function php_xmlrpc_decode($xmlrpc_val, $options=array()) + { + switch($xmlrpc_val->kindOf()) + { + case 'scalar': + if (in_array('extension_api', $options)) + { + reset($xmlrpc_val->me); + list($typ,$val) = each($xmlrpc_val->me); + switch ($typ) + { + case 'dateTime.iso8601': + $xmlrpc_val->scalar = $val; + $xmlrpc_val->xmlrpc_type = 'datetime'; + $xmlrpc_val->timestamp = iso8601_decode($val); + return $xmlrpc_val; + case 'base64': + $xmlrpc_val->scalar = $val; + $xmlrpc_val->type = $typ; + return $xmlrpc_val; + default: + return $xmlrpc_val->scalarval(); + } + } + if (in_array('dates_as_objects', $options) && $xmlrpc_val->scalartyp() == 'dateTime.iso8601') + { + // we return a Datetime object instead of a string + // since now the constructor of xmlrpcval accepts safely strings, ints and datetimes, + // we cater to all 3 cases here + $out = $xmlrpc_val->scalarval(); + if (is_string($out)) + { + $out = strtotime($out); + } + if (is_int($out)) + { + $result = new Datetime(); + $result->setTimestamp($out); + return $result; + } + elseif (is_a($out, 'Datetime')) + { + return $out; + } + } + return $xmlrpc_val->scalarval(); + case 'array': + $size = $xmlrpc_val->arraysize(); + $arr = array(); + for($i = 0; $i < $size; $i++) + { + $arr[] = php_xmlrpc_decode($xmlrpc_val->arraymem($i), $options); + } + return $arr; + case 'struct': + $xmlrpc_val->structreset(); + // If user said so, try to rebuild php objects for specific struct vals. + /// @todo should we raise a warning for class not found? + // shall we check for proper subclass of xmlrpcval instead of + // presence of _php_class to detect what we can do? + if (in_array('decode_php_objs', $options) && $xmlrpc_val->_php_class != '' + && class_exists($xmlrpc_val->_php_class)) + { + $obj = @new $xmlrpc_val->_php_class; + while(list($key,$value)=$xmlrpc_val->structeach()) + { + $obj->$key = php_xmlrpc_decode($value, $options); + } + return $obj; + } + else + { + $arr = array(); + while(list($key,$value)=$xmlrpc_val->structeach()) + { + $arr[$key] = php_xmlrpc_decode($value, $options); + } + return $arr; + } + case 'msg': + $paramcount = $xmlrpc_val->getNumParams(); + $arr = array(); + for($i = 0; $i < $paramcount; $i++) + { + $arr[] = php_xmlrpc_decode($xmlrpc_val->getParam($i)); + } + return $arr; + } + } + + // This constant left here only for historical reasons... + // it was used to decide if we have to define xmlrpc_encode on our own, but + // we do not do it anymore + if(function_exists('xmlrpc_decode')) + { + define('XMLRPC_EPI_ENABLED','1'); + } + else + { + define('XMLRPC_EPI_ENABLED','0'); + } + + /** + * Takes native php types and encodes them into xmlrpc PHP object format. + * It will not re-encode xmlrpcval objects. + * + * Feature creep -- could support more types via optional type argument + * (string => datetime support has been added, ??? => base64 not yet) + * + * If given a proper options parameter, php object instances will be encoded + * into 'special' xmlrpc values, that can later be decoded into php objects + * by calling php_xmlrpc_decode() with a corresponding option + * + * @author Dan Libby (dan@libby.com) + * + * @param mixed $php_val the value to be converted into an xmlrpcval object + * @param array $options can include 'encode_php_objs', 'auto_dates', 'null_extension' or 'extension_api' + * @return xmlrpcval + */ + function php_xmlrpc_encode($php_val, $options=array()) + { + $type = gettype($php_val); + switch($type) + { + case 'string': + if (in_array('auto_dates', $options) && preg_match('/^[0-9]{8}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/', $php_val)) + $xmlrpc_val = new xmlrpcval($php_val, $GLOBALS['xmlrpcDateTime']); + else + $xmlrpc_val = new xmlrpcval($php_val, $GLOBALS['xmlrpcString']); + break; + case 'integer': + $xmlrpc_val = new xmlrpcval($php_val, $GLOBALS['xmlrpcInt']); + break; + case 'double': + $xmlrpc_val = new xmlrpcval($php_val, $GLOBALS['xmlrpcDouble']); + break; + // + // Add support for encoding/decoding of booleans, since they are supported in PHP + case 'boolean': + $xmlrpc_val = new xmlrpcval($php_val, $GLOBALS['xmlrpcBoolean']); + break; + // + case 'array': + // PHP arrays can be encoded to either xmlrpc structs or arrays, + // depending on wheter they are hashes or plain 0..n integer indexed + // A shorter one-liner would be + // $tmp = array_diff(array_keys($php_val), range(0, count($php_val)-1)); + // but execution time skyrockets! + $j = 0; + $arr = array(); + $ko = false; + foreach($php_val as $key => $val) + { + $arr[$key] = php_xmlrpc_encode($val, $options); + if(!$ko && $key !== $j) + { + $ko = true; + } + $j++; + } + if($ko) + { + $xmlrpc_val = new xmlrpcval($arr, $GLOBALS['xmlrpcStruct']); + } + else + { + $xmlrpc_val = new xmlrpcval($arr, $GLOBALS['xmlrpcArray']); + } + break; + case 'object': + if(is_a($php_val, 'xmlrpcval')) + { + $xmlrpc_val = $php_val; + } + else if(is_a($php_val, 'DateTime')) + { + $xmlrpc_val = new xmlrpcval($php_val->format('Ymd\TH:i:s'), $GLOBALS['xmlrpcStruct']); + } + else + { + $arr = array(); + reset($php_val); + while(list($k,$v) = each($php_val)) + { + $arr[$k] = php_xmlrpc_encode($v, $options); + } + $xmlrpc_val = new xmlrpcval($arr, $GLOBALS['xmlrpcStruct']); + if (in_array('encode_php_objs', $options)) + { + // let's save original class name into xmlrpcval: + // might be useful later on... + $xmlrpc_val->_php_class = get_class($php_val); + } + } + break; + case 'NULL': + if (in_array('extension_api', $options)) + { + $xmlrpc_val = new xmlrpcval('', $GLOBALS['xmlrpcString']); + } + else if (in_array('null_extension', $options)) + { + $xmlrpc_val = new xmlrpcval('', $GLOBALS['xmlrpcNull']); + } + else + { + $xmlrpc_val = new xmlrpcval(); + } + break; + case 'resource': + if (in_array('extension_api', $options)) + { + $xmlrpc_val = new xmlrpcval((int)$php_val, $GLOBALS['xmlrpcInt']); + } + else + { + $xmlrpc_val = new xmlrpcval(); + } + // catch "user function", "unknown type" + default: + // giancarlo pinerolo + // it has to return + // an empty object in case, not a boolean. + $xmlrpc_val = new xmlrpcval(); + break; + } + return $xmlrpc_val; + } + + /** + * Convert the xml representation of a method response, method request or single + * xmlrpc value into the appropriate object (a.k.a. deserialize) + * @param string $xml_val + * @param array $options + * @return mixed false on error, or an instance of either xmlrpcval, xmlrpcmsg or xmlrpcresp + */ + function php_xmlrpc_decode_xml($xml_val, $options=array()) + { + $GLOBALS['_xh'] = array(); + $GLOBALS['_xh']['ac'] = ''; + $GLOBALS['_xh']['stack'] = array(); + $GLOBALS['_xh']['valuestack'] = array(); + $GLOBALS['_xh']['params'] = array(); + $GLOBALS['_xh']['pt'] = array(); + $GLOBALS['_xh']['isf'] = 0; + $GLOBALS['_xh']['isf_reason'] = ''; + $GLOBALS['_xh']['method'] = false; + $GLOBALS['_xh']['rt'] = ''; + /// @todo 'guestimate' encoding + $parser = xml_parser_create(); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true); + // What if internal encoding is not in one of the 3 allowed? + // we use the broadest one, ie. utf8! + if (!in_array($GLOBALS['xmlrpc_internalencoding'], array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) + { + xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, 'UTF-8'); + } + else + { + xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $GLOBALS['xmlrpc_internalencoding']); + } + xml_set_element_handler($parser, 'xmlrpc_se_any', 'xmlrpc_ee'); + xml_set_character_data_handler($parser, 'xmlrpc_cd'); + xml_set_default_handler($parser, 'xmlrpc_dh'); + if(!xml_parse($parser, $xml_val, 1)) + { + $errstr = sprintf('XML error: %s at line %d, column %d', + xml_error_string(xml_get_error_code($parser)), + xml_get_current_line_number($parser), xml_get_current_column_number($parser)); + error_log($errstr); + xml_parser_free($parser); + return false; + } + xml_parser_free($parser); + if ($GLOBALS['_xh']['isf'] > 1) // test that $GLOBALS['_xh']['value'] is an obj, too??? + { + error_log($GLOBALS['_xh']['isf_reason']); + return false; + } + switch ($GLOBALS['_xh']['rt']) + { + case 'methodresponse': + $v =& $GLOBALS['_xh']['value']; + if ($GLOBALS['_xh']['isf'] == 1) + { + $vc = $v->structmem('faultCode'); + $vs = $v->structmem('faultString'); + $r = new xmlrpcresp(0, $vc->scalarval(), $vs->scalarval()); + } + else + { + $r = new xmlrpcresp($v); + } + return $r; + case 'methodcall': + $m = new xmlrpcmsg($GLOBALS['_xh']['method']); + for($i=0; $i < count($GLOBALS['_xh']['params']); $i++) + { + $m->addParam($GLOBALS['_xh']['params'][$i]); + } + return $m; + case 'value': + return $GLOBALS['_xh']['value']; + default: + return false; + } + } + + /** + * decode a string that is encoded w/ "chunked" transfer encoding + * as defined in rfc2068 par. 19.4.6 + * code shamelessly stolen from nusoap library by Dietrich Ayala + * + * @param string $buffer the string to be decoded + * @return string + */ + function decode_chunked($buffer) + { + // length := 0 + $length = 0; + $new = ''; + + // read chunk-size, chunk-extension (if any) and crlf + // get the position of the linebreak + $chunkend = strpos($buffer,"\r\n") + 2; + $temp = substr($buffer,0,$chunkend); + $chunk_size = hexdec( trim($temp) ); + $chunkstart = $chunkend; + while($chunk_size > 0) + { + $chunkend = strpos($buffer, "\r\n", $chunkstart + $chunk_size); + + // just in case we got a broken connection + if($chunkend == false) + { + $chunk = substr($buffer,$chunkstart); + // append chunk-data to entity-body + $new .= $chunk; + $length += strlen($chunk); + break; + } + + // read chunk-data and crlf + $chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart); + // append chunk-data to entity-body + $new .= $chunk; + // length := length + chunk-size + $length += strlen($chunk); + // read chunk-size and crlf + $chunkstart = $chunkend + 2; + + $chunkend = strpos($buffer,"\r\n",$chunkstart)+2; + if($chunkend == false) + { + break; //just in case we got a broken connection + } + $temp = substr($buffer,$chunkstart,$chunkend-$chunkstart); + $chunk_size = hexdec( trim($temp) ); + $chunkstart = $chunkend; + } + return $new; + } + + /** + * xml charset encoding guessing helper function. + * Tries to determine the charset encoding of an XML chunk received over HTTP. + * NB: according to the spec (RFC 3023), if text/xml content-type is received over HTTP without a content-type, + * we SHOULD assume it is strictly US-ASCII. But we try to be more tolerant of unconforming (legacy?) clients/servers, + * which will be most probably using UTF-8 anyway... + * + * @param string $httpheaders the http Content-type header + * @param string $xmlchunk xml content buffer + * @param string $encoding_prefs comma separated list of character encodings to be used as default (when mb extension is enabled) + * + * @todo explore usage of mb_http_input(): does it detect http headers + post data? if so, use it instead of hand-detection!!! + */ + function guess_encoding($httpheader='', $xmlchunk='', $encoding_prefs=null) + { + // discussion: see http://www.yale.edu/pclt/encoding/ + // 1 - test if encoding is specified in HTTP HEADERS + + //Details: + // LWS: (\13\10)?( |\t)+ + // token: (any char but excluded stuff)+ + // quoted string: " (any char but double quotes and cointrol chars)* " + // header: Content-type = ...; charset=value(; ...)* + // where value is of type token, no LWS allowed between 'charset' and value + // Note: we do not check for invalid chars in VALUE: + // this had better be done using pure ereg as below + // Note 2: we might be removing whitespace/tabs that ought to be left in if + // the received charset is a quoted string. But nobody uses such charset names... + + /// @todo this test will pass if ANY header has charset specification, not only Content-Type. Fix it? + $matches = array(); + if(preg_match('/;\s*charset\s*=([^;]+)/i', $httpheader, $matches)) + { + return strtoupper(trim($matches[1], " \t\"")); + } + + // 2 - scan the first bytes of the data for a UTF-16 (or other) BOM pattern + // (source: http://www.w3.org/TR/2000/REC-xml-20001006) + // NOTE: actually, according to the spec, even if we find the BOM and determine + // an encoding, we should check if there is an encoding specified + // in the xml declaration, and verify if they match. + /// @todo implement check as described above? + /// @todo implement check for first bytes of string even without a BOM? (It sure looks harder than for cases WITH a BOM) + if(preg_match('/^(\x00\x00\xFE\xFF|\xFF\xFE\x00\x00|\x00\x00\xFF\xFE|\xFE\xFF\x00\x00)/', $xmlchunk)) + { + return 'UCS-4'; + } + elseif(preg_match('/^(\xFE\xFF|\xFF\xFE)/', $xmlchunk)) + { + return 'UTF-16'; + } + elseif(preg_match('/^(\xEF\xBB\xBF)/', $xmlchunk)) + { + return 'UTF-8'; + } + + // 3 - test if encoding is specified in the xml declaration + // Details: + // SPACE: (#x20 | #x9 | #xD | #xA)+ === [ \x9\xD\xA]+ + // EQ: SPACE?=SPACE? === [ \x9\xD\xA]*=[ \x9\xD\xA]* + if (preg_match('/^<\?xml\s+version\s*=\s*'. "((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))". + '\s+encoding\s*=\s*' . "((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/", + $xmlchunk, $matches)) + { + return strtoupper(substr($matches[2], 1, -1)); + } + + // 4 - if mbstring is available, let it do the guesswork + // NB: we favour finding an encoding that is compatible with what we can process + if(extension_loaded('mbstring')) + { + if($encoding_prefs) + { + $enc = mb_detect_encoding($xmlchunk, $encoding_prefs); + } + else + { + $enc = mb_detect_encoding($xmlchunk); + } + // NB: mb_detect likes to call it ascii, xml parser likes to call it US_ASCII... + // IANA also likes better US-ASCII, so go with it + if($enc == 'ASCII') + { + $enc = 'US-'.$enc; + } + return $enc; + } + else + { + // no encoding specified: as per HTTP1.1 assume it is iso-8859-1? + // Both RFC 2616 (HTTP 1.1) and 1945 (HTTP 1.0) clearly state that for text/xxx content types + // this should be the standard. And we should be getting text/xml as request and response. + // BUT we have to be backward compatible with the lib, which always used UTF-8 as default... + return $GLOBALS['xmlrpc_defencoding']; + } + } + + /** + * Checks if a given charset encoding is present in a list of encodings or + * if it is a valid subset of any encoding in the list + * @param string $encoding charset to be tested + * @param mixed $validlist comma separated list of valid charsets (or array of charsets) + */ + function is_valid_charset($encoding, $validlist) + { + $charset_supersets = array( + 'US-ASCII' => array ('ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4', + 'ISO-8859-5', 'ISO-8859-6', 'ISO-8859-7', 'ISO-8859-8', + 'ISO-8859-9', 'ISO-8859-10', 'ISO-8859-11', 'ISO-8859-12', + 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15', 'UTF-8', + 'EUC-JP', 'EUC-', 'EUC-KR', 'EUC-CN') + ); + if (is_string($validlist)) + $validlist = explode(',', $validlist); + if (@in_array(strtoupper($encoding), $validlist)) + return true; + else + { + if (array_key_exists($encoding, $charset_supersets)) + foreach ($validlist as $allowed) + if (in_array($allowed, $charset_supersets[$encoding])) + return true; + return false; + } + } + +?> \ No newline at end of file diff --git a/net/nzbgetweb/files/lib/xmlrpc_wrappers.inc b/net/nzbgetweb/files/lib/xmlrpc_wrappers.inc new file mode 100644 index 0000000..1a663f0 --- /dev/null +++ b/net/nzbgetweb/files/lib/xmlrpc_wrappers.inc @@ -0,0 +1,955 @@ +' . $funcname[1]; + } + $exists = method_exists($funcname[0], $funcname[1]); + if (!$exists && version_compare(phpversion(), '5.1') < 0) + { + // workaround for php 5.0: static class methods are not seen by method_exists + $exists = is_callable( $funcname ); + } + } + else + { + $plainfuncname = $funcname; + $exists = function_exists($funcname); + } + + if(!$exists) + { + error_log('XML-RPC: function to be wrapped is not defined: '.$plainfuncname); + return false; + } + else + { + // determine name of new php function + if($newfuncname == '') + { + if(is_array($funcname)) + { + if(is_string($funcname[0])) + $xmlrpcfuncname = "{$prefix}_".implode('_', $funcname); + else + $xmlrpcfuncname = "{$prefix}_".get_class($funcname[0]) . '_' . $funcname[1]; + } + else + { + $xmlrpcfuncname = "{$prefix}_$funcname"; + } + } + else + { + $xmlrpcfuncname = $newfuncname; + } + while($buildit && function_exists($xmlrpcfuncname)) + { + $xmlrpcfuncname .= 'x'; + } + + // start to introspect PHP code + if(is_array($funcname)) + { + $func = new ReflectionMethod($funcname[0], $funcname[1]); + if($func->isPrivate()) + { + error_log('XML-RPC: method to be wrapped is private: '.$plainfuncname); + return false; + } + if($func->isProtected()) + { + error_log('XML-RPC: method to be wrapped is protected: '.$plainfuncname); + return false; + } + if($func->isConstructor()) + { + error_log('XML-RPC: method to be wrapped is the constructor: '.$plainfuncname); + return false; + } + // php 503 always says isdestructor = true... + if( version_compare(phpversion(), '5.0.3') != 0 && $func->isDestructor()) + { + error_log('XML-RPC: method to be wrapped is the destructor: '.$plainfuncname); + return false; + } + if($func->isAbstract()) + { + error_log('XML-RPC: method to be wrapped is abstract: '.$plainfuncname); + return false; + } + /// @todo add more checks for static vs. nonstatic? + } + else + { + $func = new ReflectionFunction($funcname); + } + if($func->isInternal()) + { + // Note: from PHP 5.1.0 onward, we will possibly be able to use invokeargs + // instead of getparameters to fully reflect internal php functions ? + error_log('XML-RPC: function to be wrapped is internal: '.$plainfuncname); + return false; + } + + // retrieve parameter names, types and description from javadoc comments + + // function description + $desc = ''; + // type of return val: by default 'any' + $returns = $GLOBALS['xmlrpcValue']; + // desc of return val + $returnsDocs = ''; + // type + name of function parameters + $paramDocs = array(); + + $docs = $func->getDocComment(); + if($docs != '') + { + $docs = explode("\n", $docs); + $i = 0; + foreach($docs as $doc) + { + $doc = trim($doc, " \r\t/*"); + if(strlen($doc) && strpos($doc, '@') !== 0 && !$i) + { + if($desc) + { + $desc .= "\n"; + } + $desc .= $doc; + } + elseif(strpos($doc, '@param') === 0) + { + // syntax: @param type [$name] desc + if(preg_match('/@param\s+(\S+)(\s+\$\S+)?\s+(.+)/', $doc, $matches)) + { + if(strpos($matches[1], '|')) + { + //$paramDocs[$i]['type'] = explode('|', $matches[1]); + $paramDocs[$i]['type'] = 'mixed'; + } + else + { + $paramDocs[$i]['type'] = $matches[1]; + } + $paramDocs[$i]['name'] = trim($matches[2]); + $paramDocs[$i]['doc'] = $matches[3]; + } + $i++; + } + elseif(strpos($doc, '@return') === 0) + { + // syntax: @return type desc + //$returns = preg_split('/\s+/', $doc); + if(preg_match('/@return\s+(\S+)\s+(.+)/', $doc, $matches)) + { + $returns = php_2_xmlrpc_type($matches[1]); + if(isset($matches[2])) + { + $returnsDocs = $matches[2]; + } + } + } + } + } + + // execute introspection of actual function prototype + $params = array(); + $i = 0; + foreach($func->getParameters() as $paramobj) + { + $params[$i] = array(); + $params[$i]['name'] = '$'.$paramobj->getName(); + $params[$i]['isoptional'] = $paramobj->isOptional(); + $i++; + } + + + // start building of PHP code to be eval'd + $innercode = ''; + $i = 0; + $parsvariations = array(); + $pars = array(); + $pnum = count($params); + foreach($params as $param) + { + if (isset($paramDocs[$i]['name']) && $paramDocs[$i]['name'] && strtolower($paramDocs[$i]['name']) != strtolower($param['name'])) + { + // param name from phpdoc info does not match param definition! + $paramDocs[$i]['type'] = 'mixed'; + } + + if($param['isoptional']) + { + // this particular parameter is optional. save as valid previous list of parameters + $innercode .= "if (\$paramcount > $i) {\n"; + $parsvariations[] = $pars; + } + $innercode .= "\$p$i = \$msg->getParam($i);\n"; + if ($decode_php_objects) + { + $innercode .= "if (\$p{$i}->kindOf() == 'scalar') \$p$i = \$p{$i}->scalarval(); else \$p$i = php_{$prefix}_decode(\$p$i, array('decode_php_objs'));\n"; + } + else + { + $innercode .= "if (\$p{$i}->kindOf() == 'scalar') \$p$i = \$p{$i}->scalarval(); else \$p$i = php_{$prefix}_decode(\$p$i);\n"; + } + + $pars[] = "\$p$i"; + $i++; + if($param['isoptional']) + { + $innercode .= "}\n"; + } + if($i == $pnum) + { + // last allowed parameters combination + $parsvariations[] = $pars; + } + } + + $sigs = array(); + $psigs = array(); + if(count($parsvariations) == 0) + { + // only known good synopsis = no parameters + $parsvariations[] = array(); + $minpars = 0; + } + else + { + $minpars = count($parsvariations[0]); + } + + if($minpars) + { + // add to code the check for min params number + // NB: this check needs to be done BEFORE decoding param values + $innercode = "\$paramcount = \$msg->getNumParams();\n" . + "if (\$paramcount < $minpars) return new {$prefix}resp(0, {$GLOBALS['xmlrpcerr']['incorrect_params']}, '{$GLOBALS['xmlrpcstr']['incorrect_params']}');\n" . $innercode; + } + else + { + $innercode = "\$paramcount = \$msg->getNumParams();\n" . $innercode; + } + + $innercode .= "\$np = false;\n"; + // since there are no closures in php, if we are given an object instance, + // we store a pointer to it in a global var... + if ( is_array($funcname) && is_object($funcname[0]) ) + { + $GLOBALS['xmlrpcWPFObjHolder'][$xmlrpcfuncname] =& $funcname[0]; + $innercode .= "\$obj =& \$GLOBALS['xmlrpcWPFObjHolder']['$xmlrpcfuncname'];\n"; + $realfuncname = '$obj->'.$funcname[1]; + } + else + { + $realfuncname = $plainfuncname; + } + foreach($parsvariations as $pars) + { + $innercode .= "if (\$paramcount == " . count($pars) . ") \$retval = {$catch_warnings}$realfuncname(" . implode(',', $pars) . "); else\n"; + // build a 'generic' signature (only use an appropriate return type) + $sig = array($returns); + $psig = array($returnsDocs); + for($i=0; $i < count($pars); $i++) + { + if (isset($paramDocs[$i]['type'])) + { + $sig[] = php_2_xmlrpc_type($paramDocs[$i]['type']); + } + else + { + $sig[] = $GLOBALS['xmlrpcValue']; + } + $psig[] = isset($paramDocs[$i]['doc']) ? $paramDocs[$i]['doc'] : ''; + } + $sigs[] = $sig; + $psigs[] = $psig; + } + $innercode .= "\$np = true;\n"; + $innercode .= "if (\$np) return new {$prefix}resp(0, {$GLOBALS['xmlrpcerr']['incorrect_params']}, '{$GLOBALS['xmlrpcstr']['incorrect_params']}'); else {\n"; + //$innercode .= "if (\$_xmlrpcs_error_occurred) return new xmlrpcresp(0, $GLOBALS['xmlrpcerr']user, \$_xmlrpcs_error_occurred); else\n"; + $innercode .= "if (is_a(\$retval, '{$prefix}resp')) return \$retval; else\n"; + if($returns == $GLOBALS['xmlrpcDateTime'] || $returns == $GLOBALS['xmlrpcBase64']) + { + $innercode .= "return new {$prefix}resp(new {$prefix}val(\$retval, '$returns'));"; + } + else + { + if ($encode_php_objects) + $innercode .= "return new {$prefix}resp(php_{$prefix}_encode(\$retval, array('encode_php_objs')));\n"; + else + $innercode .= "return new {$prefix}resp(php_{$prefix}_encode(\$retval));\n"; + } + // shall we exclude functions returning by ref? + // if($func->returnsReference()) + // return false; + $code = "function $xmlrpcfuncname(\$msg) {\n" . $innercode . "}\n}"; + //print_r($code); + if ($buildit) + { + $allOK = 0; + eval($code.'$allOK=1;'); + // alternative + //$xmlrpcfuncname = create_function('$m', $innercode); + + if(!$allOK) + { + error_log('XML-RPC: could not create function '.$xmlrpcfuncname.' to wrap php function '.$plainfuncname); + return false; + } + } + + /// @todo examine if $paramDocs matches $parsvariations and build array for + /// usage as method signature, plus put together a nice string for docs + + $ret = array('function' => $xmlrpcfuncname, 'signature' => $sigs, 'docstring' => $desc, 'signature_docs' => $psigs, 'source' => $code); + return $ret; + } + } + + /** + * Given a user-defined PHP class or php object, map its methods onto a list of + * PHP 'wrapper' functions that can be exposed as xmlrpc methods from an xmlrpc_server + * object and called from remote clients (as well as their corresponding signature info). + * + * @param mixed $classname the name of the class whose methods are to be exposed as xmlrpc methods, or an object instance of that class + * @param array $extra_options see the docs for wrap_php_method for more options + * string method_type 'static', 'nonstatic', 'all' and 'auto' (default); the latter will switch between static and non-static depending on wheter $classname is a class name or object instance + * @return array or false on failure + * + * @todo get_class_methods will return both static and non-static methods. + * we have to differentiate the action, depending on wheter we recived a class name or object + */ + function wrap_php_class($classname, $extra_options=array()) + { + $methodfilter = isset($extra_options['method_filter']) ? $extra_options['method_filter'] : ''; + $methodtype = isset($extra_options['method_type']) ? $extra_options['method_type'] : 'auto'; + + if(version_compare(phpversion(), '5.0.3') == -1) + { + // up to php 5.0.3 some useful reflection methods were missing + error_log('XML-RPC: cannot not wrap php functions unless running php version bigger than 5.0.3'); + return false; + } + + $result = array(); + $mlist = get_class_methods($classname); + foreach($mlist as $mname) + { + if ($methodfilter == '' || preg_match($methodfilter, $mname)) + { + // echo $mlist."\n"; + $func = new ReflectionMethod($classname, $mname); + if(!$func->isPrivate() && !$func->isProtected() && !$func->isConstructor() && !$func->isDestructor() && !$func->isAbstract()) + { + if(($func->isStatic && ($methodtype == 'all' || $methodtype == 'static' || ($methodtype == 'auto' && is_string($classname)))) || + (!$func->isStatic && ($methodtype == 'all' || $methodtype == 'nonstatic' || ($methodtype == 'auto' && is_object($classname))))) + { + $methodwrap = wrap_php_function(array($classname, $mname), '', $extra_options); + if ( $methodwrap ) + { + $result[$methodwrap['function']] = $methodwrap['function']; + } + } + } + } + } + return $result; + } + + /** + * Given an xmlrpc client and a method name, register a php wrapper function + * that will call it and return results using native php types for both + * params and results. The generated php function will return an xmlrpcresp + * oject for failed xmlrpc calls + * + * Known limitations: + * - server must support system.methodsignature for the wanted xmlrpc method + * - for methods that expose many signatures, only one can be picked (we + * could in priciple check if signatures differ only by number of params + * and not by type, but it would be more complication than we can spare time) + * - nested xmlrpc params: the caller of the generated php function has to + * encode on its own the params passed to the php function if these are structs + * or arrays whose (sub)members include values of type datetime or base64 + * + * Notes: the connection properties of the given client will be copied + * and reused for the connection used during the call to the generated + * php function. + * Calling the generated php function 'might' be slow: a new xmlrpc client + * is created on every invocation and an xmlrpc-connection opened+closed. + * An extra 'debug' param is appended to param list of xmlrpc method, useful + * for debugging purposes. + * + * @param xmlrpc_client $client an xmlrpc client set up correctly to communicate with target server + * @param string $methodname the xmlrpc method to be mapped to a php function + * @param array $extra_options array of options that specify conversion details. valid ptions include + * integer signum the index of the method signature to use in mapping (if method exposes many sigs) + * integer timeout timeout (in secs) to be used when executing function/calling remote method + * string protocol 'http' (default), 'http11' or 'https' + * string new_function_name the name of php function to create. If unsepcified, lib will pick an appropriate name + * string return_source if true return php code w. function definition instead fo function name + * bool encode_php_objs let php objects be sent to server using the 'improved' xmlrpc notation, so server can deserialize them as php objects + * bool decode_php_objs --- WARNING !!! possible security hazard. only use it with trusted servers --- + * mixed return_on_fault a php value to be returned when the xmlrpc call fails/returns a fault response (by default the xmlrpcresp object is returned in this case). If a string is used, '%faultCode%' and '%faultString%' tokens will be substituted with actual error values + * bool debug set it to 1 or 2 to see debug results of querying server for method synopsis + * @return string the name of the generated php function (or false) - OR AN ARRAY... + */ + function wrap_xmlrpc_method($client, $methodname, $extra_options=0, $timeout=0, $protocol='', $newfuncname='') + { + // mind numbing: let caller use sane calling convention (as per javadoc, 3 params), + // OR the 2.0 calling convention (no options) - we really love backward compat, don't we? + if (!is_array($extra_options)) + { + $signum = $extra_options; + $extra_options = array(); + } + else + { + $signum = isset($extra_options['signum']) ? (int)$extra_options['signum'] : 0; + $timeout = isset($extra_options['timeout']) ? (int)$extra_options['timeout'] : 0; + $protocol = isset($extra_options['protocol']) ? $extra_options['protocol'] : ''; + $newfuncname = isset($extra_options['new_function_name']) ? $extra_options['new_function_name'] : ''; + } + //$encode_php_objects = in_array('encode_php_objects', $extra_options); + //$verbatim_client_copy = in_array('simple_client_copy', $extra_options) ? 1 : + // in_array('build_class_code', $extra_options) ? 2 : 0; + + $encode_php_objects = isset($extra_options['encode_php_objs']) ? (bool)$extra_options['encode_php_objs'] : false; + $decode_php_objects = isset($extra_options['decode_php_objs']) ? (bool)$extra_options['decode_php_objs'] : false; + $simple_client_copy = isset($extra_options['simple_client_copy']) ? (int)($extra_options['simple_client_copy']) : 0; + $buildit = isset($extra_options['return_source']) ? !($extra_options['return_source']) : true; + $prefix = isset($extra_options['prefix']) ? $extra_options['prefix'] : 'xmlrpc'; + if (isset($extra_options['return_on_fault'])) + { + $decode_fault = true; + $fault_response = $extra_options['return_on_fault']; + } + else + { + $decode_fault = false; + $fault_response = ''; + } + $debug = isset($extra_options['debug']) ? ($extra_options['debug']) : 0; + + $msgclass = $prefix.'msg'; + $valclass = $prefix.'val'; + $decodefunc = 'php_'.$prefix.'_decode'; + + $msg = new $msgclass('system.methodSignature'); + $msg->addparam(new $valclass($methodname)); + $client->setDebug($debug); + $response =& $client->send($msg, $timeout, $protocol); + if($response->faultCode()) + { + error_log('XML-RPC: could not retrieve method signature from remote server for method '.$methodname); + return false; + } + else + { + $msig = $response->value(); + if ($client->return_type != 'phpvals') + { + $msig = $decodefunc($msig); + } + if(!is_array($msig) || count($msig) <= $signum) + { + error_log('XML-RPC: could not retrieve method signature nr.'.$signum.' from remote server for method '.$methodname); + return false; + } + else + { + // pick a suitable name for the new function, avoiding collisions + if($newfuncname != '') + { + $xmlrpcfuncname = $newfuncname; + } + else + { + // take care to insure that methodname is translated to valid + // php function name + $xmlrpcfuncname = $prefix.'_'.preg_replace(array('/\./', '/[^a-zA-Z0-9_\x7f-\xff]/'), + array('_', ''), $methodname); + } + while($buildit && function_exists($xmlrpcfuncname)) + { + $xmlrpcfuncname .= 'x'; + } + + $msig = $msig[$signum]; + $mdesc = ''; + // if in 'offline' mode, get method description too. + // in online mode, favour speed of operation + if(!$buildit) + { + $msg = new $msgclass('system.methodHelp'); + $msg->addparam(new $valclass($methodname)); + $response =& $client->send($msg, $timeout, $protocol); + if (!$response->faultCode()) + { + $mdesc = $response->value(); + if ($client->return_type != 'phpvals') + { + $mdesc = $mdesc->scalarval(); + } + } + } + + $results = build_remote_method_wrapper_code($client, $methodname, + $xmlrpcfuncname, $msig, $mdesc, $timeout, $protocol, $simple_client_copy, + $prefix, $decode_php_objects, $encode_php_objects, $decode_fault, + $fault_response); + + //print_r($code); + if ($buildit) + { + $allOK = 0; + eval($results['source'].'$allOK=1;'); + // alternative + //$xmlrpcfuncname = create_function('$m', $innercode); + if($allOK) + { + return $xmlrpcfuncname; + } + else + { + error_log('XML-RPC: could not create function '.$xmlrpcfuncname.' to wrap remote method '.$methodname); + return false; + } + } + else + { + $results['function'] = $xmlrpcfuncname; + return $results; + } + } + } + } + + /** + * Similar to wrap_xmlrpc_method, but will generate a php class that wraps + * all xmlrpc methods exposed by the remote server as own methods. + * For more details see wrap_xmlrpc_method. + * @param xmlrpc_client $client the client obj all set to query the desired server + * @param array $extra_options list of options for wrapped code + * @return mixed false on error, the name of the created class if all ok or an array with code, class name and comments (if the appropriatevoption is set in extra_options) + */ + function wrap_xmlrpc_server($client, $extra_options=array()) + { + $methodfilter = isset($extra_options['method_filter']) ? $extra_options['method_filter'] : ''; + //$signum = isset($extra_options['signum']) ? (int)$extra_options['signum'] : 0; + $timeout = isset($extra_options['timeout']) ? (int)$extra_options['timeout'] : 0; + $protocol = isset($extra_options['protocol']) ? $extra_options['protocol'] : ''; + $newclassname = isset($extra_options['new_class_name']) ? $extra_options['new_class_name'] : ''; + $encode_php_objects = isset($extra_options['encode_php_objs']) ? (bool)$extra_options['encode_php_objs'] : false; + $decode_php_objects = isset($extra_options['decode_php_objs']) ? (bool)$extra_options['decode_php_objs'] : false; + $verbatim_client_copy = isset($extra_options['simple_client_copy']) ? !($extra_options['simple_client_copy']) : true; + $buildit = isset($extra_options['return_source']) ? !($extra_options['return_source']) : true; + $prefix = isset($extra_options['prefix']) ? $extra_options['prefix'] : 'xmlrpc'; + + $msgclass = $prefix.'msg'; + //$valclass = $prefix.'val'; + $decodefunc = 'php_'.$prefix.'_decode'; + + $msg = new $msgclass('system.listMethods'); + $response =& $client->send($msg, $timeout, $protocol); + if($response->faultCode()) + { + error_log('XML-RPC: could not retrieve method list from remote server'); + return false; + } + else + { + $mlist = $response->value(); + if ($client->return_type != 'phpvals') + { + $mlist = $decodefunc($mlist); + } + if(!is_array($mlist) || !count($mlist)) + { + error_log('XML-RPC: could not retrieve meaningful method list from remote server'); + return false; + } + else + { + // pick a suitable name for the new function, avoiding collisions + if($newclassname != '') + { + $xmlrpcclassname = $newclassname; + } + else + { + $xmlrpcclassname = $prefix.'_'.preg_replace(array('/\./', '/[^a-zA-Z0-9_\x7f-\xff]/'), + array('_', ''), $client->server).'_client'; + } + while($buildit && class_exists($xmlrpcclassname)) + { + $xmlrpcclassname .= 'x'; + } + + /// @todo add function setdebug() to new class, to enable/disable debugging + $source = "class $xmlrpcclassname\n{\nvar \$client;\n\n"; + $source .= "function $xmlrpcclassname()\n{\n"; + $source .= build_client_wrapper_code($client, $verbatim_client_copy, $prefix); + $source .= "\$this->client =& \$client;\n}\n\n"; + $opts = array('simple_client_copy' => 2, 'return_source' => true, + 'timeout' => $timeout, 'protocol' => $protocol, + 'encode_php_objs' => $encode_php_objects, 'prefix' => $prefix, + 'decode_php_objs' => $decode_php_objects + ); + /// @todo build javadoc for class definition, too + foreach($mlist as $mname) + { + if ($methodfilter == '' || preg_match($methodfilter, $mname)) + { + $opts['new_function_name'] = preg_replace(array('/\./', '/[^a-zA-Z0-9_\x7f-\xff]/'), + array('_', ''), $mname); + $methodwrap = wrap_xmlrpc_method($client, $mname, $opts); + if ($methodwrap) + { + if (!$buildit) + { + $source .= $methodwrap['docstring']; + } + $source .= $methodwrap['source']."\n"; + } + else + { + error_log('XML-RPC: will not create class method to wrap remote method '.$mname); + } + } + } + $source .= "}\n"; + if ($buildit) + { + $allOK = 0; + eval($source.'$allOK=1;'); + // alternative + //$xmlrpcfuncname = create_function('$m', $innercode); + if($allOK) + { + return $xmlrpcclassname; + } + else + { + error_log('XML-RPC: could not create class '.$xmlrpcclassname.' to wrap remote server '.$client->server); + return false; + } + } + else + { + return array('class' => $xmlrpcclassname, 'code' => $source, 'docstring' => ''); + } + } + } + } + + /** + * Given the necessary info, build php code that creates a new function to + * invoke a remote xmlrpc method. + * Take care that no full checking of input parameters is done to ensure that + * valid php code is emitted. + * Note: real spaghetti code follows... + * @access private + */ + function build_remote_method_wrapper_code($client, $methodname, $xmlrpcfuncname, + $msig, $mdesc='', $timeout=0, $protocol='', $client_copy_mode=0, $prefix='xmlrpc', + $decode_php_objects=false, $encode_php_objects=false, $decode_fault=false, + $fault_response='') + { + $code = "function $xmlrpcfuncname ("; + if ($client_copy_mode < 2) + { + // client copy mode 0 or 1 == partial / full client copy in emitted code + $innercode = build_client_wrapper_code($client, $client_copy_mode, $prefix); + $innercode .= "\$client->setDebug(\$debug);\n"; + $this_ = ''; + } + else + { + // client copy mode 2 == no client copy in emitted code + $innercode = ''; + $this_ = 'this->'; + } + $innercode .= "\$msg = new {$prefix}msg('$methodname');\n"; + + if ($mdesc != '') + { + // take care that PHP comment is not terminated unwillingly by method description + $mdesc = "/**\n* ".str_replace('*/', '* /', $mdesc)."\n"; + } + else + { + $mdesc = "/**\nFunction $xmlrpcfuncname\n"; + } + + // param parsing + $plist = array(); + $pcount = count($msig); + for($i = 1; $i < $pcount; $i++) + { + $plist[] = "\$p$i"; + $ptype = $msig[$i]; + if($ptype == 'i4' || $ptype == 'int' || $ptype == 'boolean' || $ptype == 'double' || + $ptype == 'string' || $ptype == 'dateTime.iso8601' || $ptype == 'base64' || $ptype == 'null') + { + // only build directly xmlrpcvals when type is known and scalar + $innercode .= "\$p$i = new {$prefix}val(\$p$i, '$ptype');\n"; + } + else + { + if ($encode_php_objects) + { + $innercode .= "\$p$i =& php_{$prefix}_encode(\$p$i, array('encode_php_objs'));\n"; + } + else + { + $innercode .= "\$p$i =& php_{$prefix}_encode(\$p$i);\n"; + } + } + $innercode .= "\$msg->addparam(\$p$i);\n"; + $mdesc .= '* @param '.xmlrpc_2_php_type($ptype)." \$p$i\n"; + } + if ($client_copy_mode < 2) + { + $plist[] = '$debug=0'; + $mdesc .= "* @param int \$debug when 1 (or 2) will enable debugging of the underlying {$prefix} call (defaults to 0)\n"; + } + $plist = implode(', ', $plist); + $mdesc .= '* @return '.xmlrpc_2_php_type($msig[0])." (or an {$prefix}resp obj instance if call fails)\n*/\n"; + + $innercode .= "\$res =& \${$this_}client->send(\$msg, $timeout, '$protocol');\n"; + if ($decode_fault) + { + if (is_string($fault_response) && ((strpos($fault_response, '%faultCode%') !== false) || (strpos($fault_response, '%faultString%') !== false))) + { + $respcode = "str_replace(array('%faultCode%', '%faultString%'), array(\$res->faultCode(), \$res->faultString()), '".str_replace("'", "''", $fault_response)."')"; + } + else + { + $respcode = var_export($fault_response, true); + } + } + else + { + $respcode = '$res'; + } + if ($decode_php_objects) + { + $innercode .= "if (\$res->faultcode()) return $respcode; else return php_{$prefix}_decode(\$res->value(), array('decode_php_objs'));"; + } + else + { + $innercode .= "if (\$res->faultcode()) return $respcode; else return php_{$prefix}_decode(\$res->value());"; + } + + $code = $code . $plist. ") {\n" . $innercode . "\n}\n"; + + return array('source' => $code, 'docstring' => $mdesc); + } + + /** + * Given necessary info, generate php code that will rebuild a client object + * Take care that no full checking of input parameters is done to ensure that + * valid php code is emitted. + * @access private + */ + function build_client_wrapper_code($client, $verbatim_client_copy, $prefix='xmlrpc') + { + $code = "\$client = new {$prefix}_client('".str_replace("'", "\'", $client->path). + "', '" . str_replace("'", "\'", $client->server) . "', $client->port);\n"; + + // copy all client fields to the client that will be generated runtime + // (this provides for future expansion or subclassing of client obj) + if ($verbatim_client_copy) + { + foreach($client as $fld => $val) + { + if($fld != 'debug' && $fld != 'return_type') + { + $val = var_export($val, true); + $code .= "\$client->$fld = $val;\n"; + } + } + } + // only make sure that client always returns the correct data type + $code .= "\$client->return_type = '{$prefix}vals';\n"; + //$code .= "\$client->setDebug(\$debug);\n"; + return $code; + } +?> \ No newline at end of file diff --git a/net/nzbgetweb/files/lib/xmlrpcs.inc b/net/nzbgetweb/files/lib/xmlrpcs.inc new file mode 100644 index 0000000..441dc3d --- /dev/null +++ b/net/nzbgetweb/files/lib/xmlrpcs.inc @@ -0,0 +1,1246 @@ + +// $Id: xmlrpcs.inc,v 1.71 2008/10/29 23:41:28 ggiunta Exp $ + +// Copyright (c) 1999,2000,2002 Edd Dumbill. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// * Neither the name of the "XML-RPC for PHP" nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// 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. + + // XML RPC Server class + // requires: xmlrpc.inc + + $GLOBALS['xmlrpcs_capabilities'] = array( + // xmlrpc spec: always supported + 'xmlrpc' => new xmlrpcval(array( + 'specUrl' => new xmlrpcval('http://www.xmlrpc.com/spec', 'string'), + 'specVersion' => new xmlrpcval(1, 'int') + ), 'struct'), + // if we support system.xxx functions, we always support multicall, too... + // Note that, as of 2006/09/17, the following URL does not respond anymore + 'system.multicall' => new xmlrpcval(array( + 'specUrl' => new xmlrpcval('http://www.xmlrpc.com/discuss/msgReader$1208', 'string'), + 'specVersion' => new xmlrpcval(1, 'int') + ), 'struct'), + // introspection: version 2! we support 'mixed', too + 'introspection' => new xmlrpcval(array( + 'specUrl' => new xmlrpcval('http://phpxmlrpc.sourceforge.net/doc-2/ch10.html', 'string'), + 'specVersion' => new xmlrpcval(2, 'int') + ), 'struct') + ); + + /* Functions that implement system.XXX methods of xmlrpc servers */ + $_xmlrpcs_getCapabilities_sig=array(array($GLOBALS['xmlrpcStruct'])); + $_xmlrpcs_getCapabilities_doc='This method lists all the capabilites that the XML-RPC server has: the (more or less standard) extensions to the xmlrpc spec that it adheres to'; + $_xmlrpcs_getCapabilities_sdoc=array(array('list of capabilities, described as structs with a version number and url for the spec')); + function _xmlrpcs_getCapabilities($server, $m=null) + { + $outAr = $GLOBALS['xmlrpcs_capabilities']; + // NIL extension + if ($GLOBALS['xmlrpc_null_extension']) { + $outAr['nil'] = new xmlrpcval(array( + 'specUrl' => new xmlrpcval('http://www.ontosys.com/xml-rpc/extensions.php', 'string'), + 'specVersion' => new xmlrpcval(1, 'int') + ), 'struct'); + } + return new xmlrpcresp(new xmlrpcval($outAr, 'struct')); + } + + // listMethods: signature was either a string, or nothing. + // The useless string variant has been removed + $_xmlrpcs_listMethods_sig=array(array($GLOBALS['xmlrpcArray'])); + $_xmlrpcs_listMethods_doc='This method lists all the methods that the XML-RPC server knows how to dispatch'; + $_xmlrpcs_listMethods_sdoc=array(array('list of method names')); + function _xmlrpcs_listMethods($server, $m=null) // if called in plain php values mode, second param is missing + { + + $outAr=array(); + foreach($server->dmap as $key => $val) + { + $outAr[]=new xmlrpcval($key, 'string'); + } + if($server->allow_system_funcs) + { + foreach($GLOBALS['_xmlrpcs_dmap'] as $key => $val) + { + $outAr[]=new xmlrpcval($key, 'string'); + } + } + return new xmlrpcresp(new xmlrpcval($outAr, 'array')); + } + + $_xmlrpcs_methodSignature_sig=array(array($GLOBALS['xmlrpcArray'], $GLOBALS['xmlrpcString'])); + $_xmlrpcs_methodSignature_doc='Returns an array of known signatures (an array of arrays) for the method name passed. If no signatures are known, returns a none-array (test for type != array to detect missing signature)'; + $_xmlrpcs_methodSignature_sdoc=array(array('list of known signatures, each sig being an array of xmlrpc type names', 'name of method to be described')); + function _xmlrpcs_methodSignature($server, $m) + { + // let accept as parameter both an xmlrpcval or string + if (is_object($m)) + { + $methName=$m->getParam(0); + $methName=$methName->scalarval(); + } + else + { + $methName=$m; + } + if(strpos($methName, "system.") === 0) + { + $dmap=$GLOBALS['_xmlrpcs_dmap']; $sysCall=1; + } + else + { + $dmap=$server->dmap; $sysCall=0; + } + if(isset($dmap[$methName])) + { + if(isset($dmap[$methName]['signature'])) + { + $sigs=array(); + foreach($dmap[$methName]['signature'] as $inSig) + { + $cursig=array(); + foreach($inSig as $sig) + { + $cursig[]=new xmlrpcval($sig, 'string'); + } + $sigs[]=new xmlrpcval($cursig, 'array'); + } + $r=new xmlrpcresp(new xmlrpcval($sigs, 'array')); + } + else + { + // NB: according to the official docs, we should be returning a + // "none-array" here, which means not-an-array + $r=new xmlrpcresp(new xmlrpcval('undef', 'string')); + } + } + else + { + $r=new xmlrpcresp(0,$GLOBALS['xmlrpcerr']['introspect_unknown'], $GLOBALS['xmlrpcstr']['introspect_unknown']); + } + return $r; + } + + $_xmlrpcs_methodHelp_sig=array(array($GLOBALS['xmlrpcString'], $GLOBALS['xmlrpcString'])); + $_xmlrpcs_methodHelp_doc='Returns help text if defined for the method passed, otherwise returns an empty string'; + $_xmlrpcs_methodHelp_sdoc=array(array('method description', 'name of the method to be described')); + function _xmlrpcs_methodHelp($server, $m) + { + // let accept as parameter both an xmlrpcval or string + if (is_object($m)) + { + $methName=$m->getParam(0); + $methName=$methName->scalarval(); + } + else + { + $methName=$m; + } + if(strpos($methName, "system.") === 0) + { + $dmap=$GLOBALS['_xmlrpcs_dmap']; $sysCall=1; + } + else + { + $dmap=$server->dmap; $sysCall=0; + } + if(isset($dmap[$methName])) + { + if(isset($dmap[$methName]['docstring'])) + { + $r=new xmlrpcresp(new xmlrpcval($dmap[$methName]['docstring']), 'string'); + } + else + { + $r=new xmlrpcresp(new xmlrpcval('', 'string')); + } + } + else + { + $r=new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['introspect_unknown'], $GLOBALS['xmlrpcstr']['introspect_unknown']); + } + return $r; + } + + $_xmlrpcs_multicall_sig = array(array($GLOBALS['xmlrpcArray'], $GLOBALS['xmlrpcArray'])); + $_xmlrpcs_multicall_doc = 'Boxcar multiple RPC calls in one request. See http://www.xmlrpc.com/discuss/msgReader$1208 for details'; + $_xmlrpcs_multicall_sdoc = array(array('list of response structs, where each struct has the usual members', 'list of calls, with each call being represented as a struct, with members "methodname" and "params"')); + function _xmlrpcs_multicall_error($err) + { + if(is_string($err)) + { + $str = $GLOBALS['xmlrpcstr']["multicall_${err}"]; + $code = $GLOBALS['xmlrpcerr']["multicall_${err}"]; + } + else + { + $code = $err->faultCode(); + $str = $err->faultString(); + } + $struct = array(); + $struct['faultCode'] = new xmlrpcval($code, 'int'); + $struct['faultString'] = new xmlrpcval($str, 'string'); + return new xmlrpcval($struct, 'struct'); + } + + function _xmlrpcs_multicall_do_call($server, $call) + { + if($call->kindOf() != 'struct') + { + return _xmlrpcs_multicall_error('notstruct'); + } + $methName = @$call->structmem('methodName'); + if(!$methName) + { + return _xmlrpcs_multicall_error('nomethod'); + } + if($methName->kindOf() != 'scalar' || $methName->scalartyp() != 'string') + { + return _xmlrpcs_multicall_error('notstring'); + } + if($methName->scalarval() == 'system.multicall') + { + return _xmlrpcs_multicall_error('recursion'); + } + + $params = @$call->structmem('params'); + if(!$params) + { + return _xmlrpcs_multicall_error('noparams'); + } + if($params->kindOf() != 'array') + { + return _xmlrpcs_multicall_error('notarray'); + } + $numParams = $params->arraysize(); + + $msg = new xmlrpcmsg($methName->scalarval()); + for($i = 0; $i < $numParams; $i++) + { + if(!$msg->addParam($params->arraymem($i))) + { + $i++; + return _xmlrpcs_multicall_error(new xmlrpcresp(0, + $GLOBALS['xmlrpcerr']['incorrect_params'], + $GLOBALS['xmlrpcstr']['incorrect_params'] . ": probable xml error in param " . $i)); + } + } + + $result = $server->execute($msg); + + if($result->faultCode() != 0) + { + return _xmlrpcs_multicall_error($result); // Method returned fault. + } + + return new xmlrpcval(array($result->value()), 'array'); + } + + function _xmlrpcs_multicall_do_call_phpvals($server, $call) + { + if(!is_array($call)) + { + return _xmlrpcs_multicall_error('notstruct'); + } + if(!array_key_exists('methodName', $call)) + { + return _xmlrpcs_multicall_error('nomethod'); + } + if (!is_string($call['methodName'])) + { + return _xmlrpcs_multicall_error('notstring'); + } + if($call['methodName'] == 'system.multicall') + { + return _xmlrpcs_multicall_error('recursion'); + } + if(!array_key_exists('params', $call)) + { + return _xmlrpcs_multicall_error('noparams'); + } + if(!is_array($call['params'])) + { + return _xmlrpcs_multicall_error('notarray'); + } + + // this is a real dirty and simplistic hack, since we might have received a + // base64 or datetime values, but they will be listed as strings here... + $numParams = count($call['params']); + $pt = array(); + foreach($call['params'] as $val) + $pt[] = php_2_xmlrpc_type(gettype($val)); + + $result = $server->execute($call['methodName'], $call['params'], $pt); + + if($result->faultCode() != 0) + { + return _xmlrpcs_multicall_error($result); // Method returned fault. + } + + return new xmlrpcval(array($result->value()), 'array'); + } + + function _xmlrpcs_multicall($server, $m) + { + $result = array(); + // let accept a plain list of php parameters, beside a single xmlrpc msg object + if (is_object($m)) + { + $calls = $m->getParam(0); + $numCalls = $calls->arraysize(); + for($i = 0; $i < $numCalls; $i++) + { + $call = $calls->arraymem($i); + $result[$i] = _xmlrpcs_multicall_do_call($server, $call); + } + } + else + { + $numCalls=count($m); + for($i = 0; $i < $numCalls; $i++) + { + $result[$i] = _xmlrpcs_multicall_do_call_phpvals($server, $m[$i]); + } + } + + return new xmlrpcresp(new xmlrpcval($result, 'array')); + } + + $GLOBALS['_xmlrpcs_dmap']=array( + 'system.listMethods' => array( + 'function' => '_xmlrpcs_listMethods', + 'signature' => $_xmlrpcs_listMethods_sig, + 'docstring' => $_xmlrpcs_listMethods_doc, + 'signature_docs' => $_xmlrpcs_listMethods_sdoc), + 'system.methodHelp' => array( + 'function' => '_xmlrpcs_methodHelp', + 'signature' => $_xmlrpcs_methodHelp_sig, + 'docstring' => $_xmlrpcs_methodHelp_doc, + 'signature_docs' => $_xmlrpcs_methodHelp_sdoc), + 'system.methodSignature' => array( + 'function' => '_xmlrpcs_methodSignature', + 'signature' => $_xmlrpcs_methodSignature_sig, + 'docstring' => $_xmlrpcs_methodSignature_doc, + 'signature_docs' => $_xmlrpcs_methodSignature_sdoc), + 'system.multicall' => array( + 'function' => '_xmlrpcs_multicall', + 'signature' => $_xmlrpcs_multicall_sig, + 'docstring' => $_xmlrpcs_multicall_doc, + 'signature_docs' => $_xmlrpcs_multicall_sdoc), + 'system.getCapabilities' => array( + 'function' => '_xmlrpcs_getCapabilities', + 'signature' => $_xmlrpcs_getCapabilities_sig, + 'docstring' => $_xmlrpcs_getCapabilities_doc, + 'signature_docs' => $_xmlrpcs_getCapabilities_sdoc) + ); + + $GLOBALS['_xmlrpcs_occurred_errors'] = ''; + $GLOBALS['_xmlrpcs_prev_ehandler'] = ''; + + /** + * Error handler used to track errors that occur during server-side execution of PHP code. + * This allows to report back to the client whether an internal error has occurred or not + * using an xmlrpc response object, instead of letting the client deal with the html junk + * that a PHP execution error on the server generally entails. + * + * NB: in fact a user defined error handler can only handle WARNING, NOTICE and USER_* errors. + * + */ + function _xmlrpcs_errorHandler($errcode, $errstring, $filename=null, $lineno=null, $context=null) + { + // obey the @ protocol + if (error_reporting() == 0) + return; + + //if($errcode != E_NOTICE && $errcode != E_WARNING && $errcode != E_USER_NOTICE && $errcode != E_USER_WARNING) + if($errcode != E_STRICT) + { + $GLOBALS['_xmlrpcs_occurred_errors'] = $GLOBALS['_xmlrpcs_occurred_errors'] . $errstring . "\n"; + } + // Try to avoid as much as possible disruption to the previous error handling + // mechanism in place + if($GLOBALS['_xmlrpcs_prev_ehandler'] == '') + { + // The previous error handler was the default: all we should do is log error + // to the default error log (if level high enough) + if(ini_get('log_errors') && (intval(ini_get('error_reporting')) & $errcode)) + { + error_log($errstring); + } + } + else + { + // Pass control on to previous error handler, trying to avoid loops... + if($GLOBALS['_xmlrpcs_prev_ehandler'] != '_xmlrpcs_errorHandler') + { + // NB: this code will NOT work on php < 4.0.2: only 2 params were used for error handlers + if(is_array($GLOBALS['_xmlrpcs_prev_ehandler'])) + { + // the following works both with static class methods and plain object methods as error handler + call_user_func_array($GLOBALS['_xmlrpcs_prev_ehandler'], array($errcode, $errstring, $filename, $lineno, $context)); + } + else + { + $GLOBALS['_xmlrpcs_prev_ehandler']($errcode, $errstring, $filename, $lineno, $context); + } + } + } + } + + $GLOBALS['_xmlrpc_debuginfo']=''; + + /** + * Add a string to the debug info that can be later seralized by the server + * as part of the response message. + * Note that for best compatbility, the debug string should be encoded using + * the $GLOBALS['xmlrpc_internalencoding'] character set. + * @param string $m + * @access public + */ + function xmlrpc_debugmsg($m) + { + $GLOBALS['_xmlrpc_debuginfo'] .= $m . "\n"; + } + + class xmlrpc_server + { + /** + * Array defining php functions exposed as xmlrpc methods by this server + * @access private + */ + var $dmap=array(); + /** + * Defines how functions in dmap will be invoked: either using an xmlrpc msg object + * or plain php values. + * valid strings are 'xmlrpcvals', 'phpvals' or 'epivals' + */ + var $functions_parameters_type='xmlrpcvals'; + /** + * Option used for fine-tuning the encoding the php values returned from + * functions registered in the dispatch map when the functions_parameters_types + * member is set to 'phpvals' + * @see php_xmlrpc_encode for a list of values + */ + var $phpvals_encoding_options = array( 'auto_dates' ); + /// controls wether the server is going to echo debugging messages back to the client as comments in response body. valid values: 0,1,2,3 + var $debug = 1; + /** + * Controls behaviour of server when invoked user function throws an exception: + * 0 = catch it and return an 'internal error' xmlrpc response (default) + * 1 = catch it and return an xmlrpc response with the error corresponding to the exception + * 2 = allow the exception to float to the upper layers + */ + var $exception_handling = 0; + /** + * When set to true, it will enable HTTP compression of the response, in case + * the client has declared its support for compression in the request. + */ + var $compress_response = false; + /** + * List of http compression methods accepted by the server for requests. + * NB: PHP supports deflate, gzip compressions out of the box if compiled w. zlib + */ + var $accepted_compression = array(); + /// shall we serve calls to system.* methods? + var $allow_system_funcs = true; + /// list of charset encodings natively accepted for requests + var $accepted_charset_encodings = array(); + /** + * charset encoding to be used for response. + * NB: if we can, we will convert the generated response from internal_encoding to the intended one. + * can be: a supported xml encoding (only UTF-8 and ISO-8859-1 at present, unless mbstring is enabled), + * null (leave unspecified in response, convert output stream to US_ASCII), + * 'default' (use xmlrpc library default as specified in xmlrpc.inc, convert output stream if needed), + * or 'auto' (use client-specified charset encoding or same as request if request headers do not specify it (unless request is US-ASCII: then use library default anyway). + * NB: pretty dangerous if you accept every charset and do not have mbstring enabled) + */ + var $response_charset_encoding = ''; + /** + * Storage for internal debug info + * @access private + */ + var $debug_info = ''; + /** + * Extra data passed at runtime to method handling functions. Used only by EPI layer + */ + var $user_data = null; + + /** + * @param array $dispmap the dispatch map withd efinition of exposed services + * @param boolean $servicenow set to false to prevent the server from runnung upon construction + */ + function xmlrpc_server($dispMap=null, $serviceNow=true) + { + // if ZLIB is enabled, let the server by default accept compressed requests, + // and compress responses sent to clients that support them + if(function_exists('gzinflate')) + { + $this->accepted_compression = array('gzip', 'deflate'); + $this->compress_response = true; + } + + // by default the xml parser can support these 3 charset encodings + $this->accepted_charset_encodings = array('UTF-8', 'ISO-8859-1', 'US-ASCII'); + + // dispMap is a dispatch array of methods + // mapped to function names and signatures + // if a method + // doesn't appear in the map then an unknown + // method error is generated + /* milosch - changed to make passing dispMap optional. + * instead, you can use the class add_to_map() function + * to add functions manually (borrowed from SOAPX4) + */ + if($dispMap) + { + $this->dmap = $dispMap; + if($serviceNow) + { + $this->service(); + } + } + } + + /** + * Set debug level of server. + * @param integer $in debug lvl: determines info added to xmlrpc responses (as xml comments) + * 0 = no debug info, + * 1 = msgs set from user with debugmsg(), + * 2 = add complete xmlrpc request (headers and body), + * 3 = add also all processing warnings happened during method processing + * (NB: this involves setting a custom error handler, and might interfere + * with the standard processing of the php function exposed as method. In + * particular, triggering an USER_ERROR level error will not halt script + * execution anymore, but just end up logged in the xmlrpc response) + * Note that info added at elevel 2 and 3 will be base64 encoded + * @access public + */ + function setDebug($in) + { + $this->debug=$in; + } + + /** + * Return a string with the serialized representation of all debug info + * @param string $charset_encoding the target charset encoding for the serialization + * @return string an XML comment (or two) + */ + function serializeDebug($charset_encoding='') + { + // Tough encoding problem: which internal charset should we assume for debug info? + // It might contain a copy of raw data received from client, ie with unknown encoding, + // intermixed with php generated data and user generated data... + // so we split it: system debug is base 64 encoded, + // user debug info should be encoded by the end user using the INTERNAL_ENCODING + $out = ''; + if ($this->debug_info != '') + { + $out .= "\n"; + } + if($GLOBALS['_xmlrpc_debuginfo']!='') + { + + $out .= "\n"; + // NB: a better solution MIGHT be to use CDATA, but we need to insert it + // into return payload AFTER the beginning tag + //$out .= "', ']_]_>', $GLOBALS['_xmlrpc_debuginfo']) . "\n]]>\n"; + } + return $out; + } + + /** + * Execute the xmlrpc request, printing the response + * @param string $data the request body. If null, the http POST request will be examined + * @return xmlrpcresp the response object (usually not used by caller...) + * @access public + */ + function service($data=null, $return_payload=false) + { + if ($data === null) + { + // workaround for a known bug in php ver. 5.2.2 that broke $HTTP_RAW_POST_DATA + $ver = phpversion(); + if ($ver[0] >= 5) + { + $data = file_get_contents('php://input'); + } + else + { + $data = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : ''; + } + } + $raw_data = $data; + + // reset internal debug info + $this->debug_info = ''; + + // Echo back what we received, before parsing it + if($this->debug > 1) + { + $this->debugmsg("+++GOT+++\n" . $data . "\n+++END+++"); + } + + $r = $this->parseRequestHeaders($data, $req_charset, $resp_charset, $resp_encoding); + if (!$r) + { + $r=$this->parseRequest($data, $req_charset); + } + + // save full body of request into response, for more debugging usages + $r->raw_data = $raw_data; + + if($this->debug > 2 && $GLOBALS['_xmlrpcs_occurred_errors']) + { + $this->debugmsg("+++PROCESSING ERRORS AND WARNINGS+++\n" . + $GLOBALS['_xmlrpcs_occurred_errors'] . "+++END+++"); + } + + $payload=$this->xml_header($resp_charset); + if($this->debug > 0) + { + $payload = $payload . $this->serializeDebug($resp_charset); + } + + // G. Giunta 2006-01-27: do not create response serialization if it has + // already happened. Helps building json magic + if (empty($r->payload)) + { + $r->serialize($resp_charset); + } + $payload = $payload . $r->payload; + + if ($return_payload) + { + return $payload; + } + + // if we get a warning/error that has output some text before here, then we cannot + // add a new header. We cannot say we are sending xml, either... + if(!headers_sent()) + { + header('Content-Type: '.$r->content_type); + // we do not know if client actually told us an accepted charset, but if he did + // we have to tell him what we did + header("Vary: Accept-Charset"); + + // http compression of output: only + // if we can do it, and we want to do it, and client asked us to, + // and php ini settings do not force it already + $php_no_self_compress = !ini_get('zlib.output_compression') && (ini_get('output_handler') != 'ob_gzhandler'); + if($this->compress_response && function_exists('gzencode') && $resp_encoding != '' + && $php_no_self_compress) + { + if(strpos($resp_encoding, 'gzip') !== false) + { + $payload = gzencode($payload); + header("Content-Encoding: gzip"); + header("Vary: Accept-Encoding"); + } + elseif (strpos($resp_encoding, 'deflate') !== false) + { + $payload = gzcompress($payload); + header("Content-Encoding: deflate"); + header("Vary: Accept-Encoding"); + } + } + + // do not ouput content-length header if php is compressing output for us: + // it will mess up measurements + if($php_no_self_compress) + { + header('Content-Length: ' . (int)strlen($payload)); + } + } + else + { + error_log('XML-RPC: '.__METHOD__.': http headers already sent before response is fully generated. Check for php warning or error messages'); + } + + print $payload; + + // return request, in case subclasses want it + return $r; + } + + /** + * Add a method to the dispatch map + * @param string $methodname the name with which the method will be made available + * @param string $function the php function that will get invoked + * @param array $sig the array of valid method signatures + * @param string $doc method documentation + * @param array $sigdoc the array of valid method signatures docs (one string per param, one for return type) + * @access public + */ + function add_to_map($methodname,$function,$sig=null,$doc=false,$sigdoc=false) + { + $this->dmap[$methodname] = array( + 'function' => $function, + 'docstring' => $doc + ); + if ($sig) + { + $this->dmap[$methodname]['signature'] = $sig; + } + if ($sigdoc) + { + $this->dmap[$methodname]['signature_docs'] = $sigdoc; + } + } + + /** + * Verify type and number of parameters received against a list of known signatures + * @param array $in array of either xmlrpcval objects or xmlrpc type definitions + * @param array $sig array of known signatures to match against + * @access private + */ + function verifySignature($in, $sig) + { + // check each possible signature in turn + if (is_object($in)) + { + $numParams = $in->getNumParams(); + } + else + { + $numParams = count($in); + } + foreach($sig as $cursig) + { + if(count($cursig)==$numParams+1) + { + $itsOK=1; + for($n=0; $n<$numParams; $n++) + { + if (is_object($in)) + { + $p=$in->getParam($n); + if($p->kindOf() == 'scalar') + { + $pt=$p->scalartyp(); + } + else + { + $pt=$p->kindOf(); + } + } + else + { + $pt= $in[$n] == 'i4' ? 'int' : strtolower($in[$n]); // dispatch maps never use i4... + } + + // param index is $n+1, as first member of sig is return type + if($pt != $cursig[$n+1] && $cursig[$n+1] != $GLOBALS['xmlrpcValue']) + { + $itsOK=0; + $pno=$n+1; + $wanted=$cursig[$n+1]; + $got=$pt; + break; + } + } + if($itsOK) + { + return array(1,''); + } + } + } + if(isset($wanted)) + { + return array(0, "Wanted ${wanted}, got ${got} at param ${pno}"); + } + else + { + return array(0, "No method signature matches number of parameters"); + } + } + + /** + * Parse http headers received along with xmlrpc request. If needed, inflate request + * @return null on success or an xmlrpcresp + * @access private + */ + function parseRequestHeaders(&$data, &$req_encoding, &$resp_encoding, &$resp_compression) + { + // check if $_SERVER is populated: it might have been disabled via ini file + // (this is true even when in CLI mode) + if (count($_SERVER) == 0) + { + error_log('XML-RPC: '.__METHOD__.': cannot parse request headers as $_SERVER is not populated'); + } + + if($this->debug > 1) + { + if(function_exists('getallheaders')) + { + $this->debugmsg(''); // empty line + foreach(getallheaders() as $name => $val) + { + $this->debugmsg("HEADER: $name: $val"); + } + } + + } + + if(isset($_SERVER['HTTP_CONTENT_ENCODING'])) + { + $content_encoding = str_replace('x-', '', $_SERVER['HTTP_CONTENT_ENCODING']); + } + else + { + $content_encoding = ''; + } + + // check if request body has been compressed and decompress it + if($content_encoding != '' && strlen($data)) + { + if($content_encoding == 'deflate' || $content_encoding == 'gzip') + { + // if decoding works, use it. else assume data wasn't gzencoded + if(function_exists('gzinflate') && in_array($content_encoding, $this->accepted_compression)) + { + if($content_encoding == 'deflate' && $degzdata = @gzuncompress($data)) + { + $data = $degzdata; + if($this->debug > 1) + { + $this->debugmsg("\n+++INFLATED REQUEST+++[".strlen($data)." chars]+++\n" . $data . "\n+++END+++"); + } + } + elseif($content_encoding == 'gzip' && $degzdata = @gzinflate(substr($data, 10))) + { + $data = $degzdata; + if($this->debug > 1) + $this->debugmsg("+++INFLATED REQUEST+++[".strlen($data)." chars]+++\n" . $data . "\n+++END+++"); + } + else + { + $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['server_decompress_fail'], $GLOBALS['xmlrpcstr']['server_decompress_fail']); + return $r; + } + } + else + { + //error_log('The server sent deflated data. Your php install must have the Zlib extension compiled in to support this.'); + $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['server_cannot_decompress'], $GLOBALS['xmlrpcstr']['server_cannot_decompress']); + return $r; + } + } + } + + // check if client specified accepted charsets, and if we know how to fulfill + // the request + if ($this->response_charset_encoding == 'auto') + { + $resp_encoding = ''; + if (isset($_SERVER['HTTP_ACCEPT_CHARSET'])) + { + // here we should check if we can match the client-requested encoding + // with the encodings we know we can generate. + /// @todo we should parse q=0.x preferences instead of getting first charset specified... + $client_accepted_charsets = explode(',', strtoupper($_SERVER['HTTP_ACCEPT_CHARSET'])); + // Give preference to internal encoding + $known_charsets = array($GLOBALS['xmlrpc_internalencoding'], 'UTF-8', 'ISO-8859-1', 'US-ASCII'); + foreach ($known_charsets as $charset) + { + foreach ($client_accepted_charsets as $accepted) + if (strpos($accepted, $charset) === 0) + { + $resp_encoding = $charset; + break; + } + if ($resp_encoding) + break; + } + } + } + else + { + $resp_encoding = $this->response_charset_encoding; + } + + if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) + { + $resp_compression = $_SERVER['HTTP_ACCEPT_ENCODING']; + } + else + { + $resp_compression = ''; + } + + // 'guestimate' request encoding + /// @todo check if mbstring is enabled and automagic input conversion is on: it might mingle with this check??? + $req_encoding = guess_encoding(isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : '', + $data); + + return null; + } + + /** + * Parse an xml chunk containing an xmlrpc request and execute the corresponding + * php function registered with the server + * @param string $data the xml request + * @param string $req_encoding (optional) the charset encoding of the xml request + * @return xmlrpcresp + * @access private + */ + function parseRequest($data, $req_encoding='') + { + // 2005/05/07 commented and moved into caller function code + //if($data=='') + //{ + // $data=$GLOBALS['HTTP_RAW_POST_DATA']; + //} + + // G. Giunta 2005/02/13: we do NOT expect to receive html entities + // so we do not try to convert them into xml character entities + //$data = xmlrpc_html_entity_xlate($data); + + $GLOBALS['_xh']=array(); + $GLOBALS['_xh']['ac']=''; + $GLOBALS['_xh']['stack']=array(); + $GLOBALS['_xh']['valuestack'] = array(); + $GLOBALS['_xh']['params']=array(); + $GLOBALS['_xh']['pt']=array(); + $GLOBALS['_xh']['isf']=0; + $GLOBALS['_xh']['isf_reason']=''; + $GLOBALS['_xh']['method']=false; // so we can check later if we got a methodname or not + $GLOBALS['_xh']['rt']=''; + + // decompose incoming XML into request structure + if ($req_encoding != '') + { + if (!in_array($req_encoding, array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) + // the following code might be better for mb_string enabled installs, but + // makes the lib about 200% slower... + //if (!is_valid_charset($req_encoding, array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) + { + error_log('XML-RPC: '.__METHOD__.': invalid charset encoding of received request: '.$req_encoding); + $req_encoding = $GLOBALS['xmlrpc_defencoding']; + } + /// @BUG this will fail on PHP 5 if charset is not specified in the xml prologue, + // the encoding is not UTF8 and there are non-ascii chars in the text... + /// @todo use an ampty string for php 5 ??? + $parser = xml_parser_create($req_encoding); + } + else + { + $parser = xml_parser_create(); + } + + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true); + // G. Giunta 2005/02/13: PHP internally uses ISO-8859-1, so we have to tell + // the xml parser to give us back data in the expected charset + // What if internal encoding is not in one of the 3 allowed? + // we use the broadest one, ie. utf8 + // This allows to send data which is native in various charset, + // by extending xmlrpc_encode_entitites() and setting xmlrpc_internalencoding + if (!in_array($GLOBALS['xmlrpc_internalencoding'], array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) + { + xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, 'UTF-8'); + } + else + { + xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $GLOBALS['xmlrpc_internalencoding']); + } + + if ($this->functions_parameters_type != 'xmlrpcvals') + xml_set_element_handler($parser, 'xmlrpc_se', 'xmlrpc_ee_fast'); + else + xml_set_element_handler($parser, 'xmlrpc_se', 'xmlrpc_ee'); + xml_set_character_data_handler($parser, 'xmlrpc_cd'); + xml_set_default_handler($parser, 'xmlrpc_dh'); + if(!xml_parse($parser, $data, 1)) + { + // return XML error as a faultCode + $r=new xmlrpcresp(0, + $GLOBALS['xmlrpcerrxml']+xml_get_error_code($parser), + sprintf('XML error: %s at line %d, column %d', + xml_error_string(xml_get_error_code($parser)), + xml_get_current_line_number($parser), xml_get_current_column_number($parser))); + xml_parser_free($parser); + } + elseif ($GLOBALS['_xh']['isf']) + { + xml_parser_free($parser); + $r=new xmlrpcresp(0, + $GLOBALS['xmlrpcerr']['invalid_request'], + $GLOBALS['xmlrpcstr']['invalid_request'] . ' ' . $GLOBALS['_xh']['isf_reason']); + } + else + { + xml_parser_free($parser); + // small layering violation in favor of speed and memory usage: + // we should allow the 'execute' method handle this, but in the + // most common scenario (xmlrpcvals type server with some methods + // registered as phpvals) that would mean a useless encode+decode pass + if ($this->functions_parameters_type != 'xmlrpcvals' || (isset($this->dmap[$GLOBALS['_xh']['method']]['parameters_type']) && ($this->dmap[$GLOBALS['_xh']['method']]['parameters_type'] == 'phpvals'))) + { + if($this->debug > 1) + { + $this->debugmsg("\n+++PARSED+++\n".var_export($GLOBALS['_xh']['params'], true)."\n+++END+++"); + } + $r = $this->execute($GLOBALS['_xh']['method'], $GLOBALS['_xh']['params'], $GLOBALS['_xh']['pt']); + } + else + { + // build an xmlrpcmsg object with data parsed from xml + $m=new xmlrpcmsg($GLOBALS['_xh']['method']); + // now add parameters in + for($i=0; $iaddParam($GLOBALS['_xh']['params'][$i]); + } + + if($this->debug > 1) + { + $this->debugmsg("\n+++PARSED+++\n".var_export($m, true)."\n+++END+++"); + } + $r = $this->execute($m); + } + } + return $r; + } + + /** + * Execute a method invoked by the client, checking parameters used + * @param mixed $m either an xmlrpcmsg obj or a method name + * @param array $params array with method parameters as php types (if m is method name only) + * @param array $paramtypes array with xmlrpc types of method parameters (if m is method name only) + * @return xmlrpcresp + * @access private + */ + function execute($m, $params=null, $paramtypes=null) + { + if (is_object($m)) + { + $methName = $m->method(); + } + else + { + $methName = $m; + } + $sysCall = $this->allow_system_funcs && (strpos($methName, "system.") === 0); + $dmap = $sysCall ? $GLOBALS['_xmlrpcs_dmap'] : $this->dmap; + + if(!isset($dmap[$methName]['function'])) + { + // No such method + return new xmlrpcresp(0, + $GLOBALS['xmlrpcerr']['unknown_method'], + $GLOBALS['xmlrpcstr']['unknown_method']); + } + + // Check signature + if(isset($dmap[$methName]['signature'])) + { + $sig = $dmap[$methName]['signature']; + if (is_object($m)) + { + list($ok, $errstr) = $this->verifySignature($m, $sig); + } + else + { + list($ok, $errstr) = $this->verifySignature($paramtypes, $sig); + } + if(!$ok) + { + // Didn't match. + return new xmlrpcresp( + 0, + $GLOBALS['xmlrpcerr']['incorrect_params'], + $GLOBALS['xmlrpcstr']['incorrect_params'] . ": ${errstr}" + ); + } + } + + $func = $dmap[$methName]['function']; + // let the 'class::function' syntax be accepted in dispatch maps + if(is_string($func) && strpos($func, '::')) + { + $func = explode('::', $func); + } + // verify that function to be invoked is in fact callable + if(!is_callable($func)) + { + error_log("XML-RPC: ".__METHOD__.": function $func registered as method handler is not callable"); + return new xmlrpcresp( + 0, + $GLOBALS['xmlrpcerr']['server_error'], + $GLOBALS['xmlrpcstr']['server_error'] . ": no function matches method" + ); + } + + // If debug level is 3, we should catch all errors generated during + // processing of user function, and log them as part of response + if($this->debug > 2) + { + $GLOBALS['_xmlrpcs_prev_ehandler'] = set_error_handler('_xmlrpcs_errorHandler'); + } + try + { + // Allow mixed-convention servers + if (is_object($m)) + { + if($sysCall) + { + $r = call_user_func($func, $this, $m); + } + else + { + $r = call_user_func($func, $m); + } + if (!is_a($r, 'xmlrpcresp')) + { + error_log("XML-RPC: ".__METHOD__.": function $func registered as method handler does not return an xmlrpcresp object"); + if (is_a($r, 'xmlrpcval')) + { + $r = new xmlrpcresp($r); + } + else + { + $r = new xmlrpcresp( + 0, + $GLOBALS['xmlrpcerr']['server_error'], + $GLOBALS['xmlrpcstr']['server_error'] . ": function does not return xmlrpcresp object" + ); + } + } + } + else + { + // call a 'plain php' function + if($sysCall) + { + array_unshift($params, $this); + $r = call_user_func_array($func, $params); + } + else + { + // 3rd API convention for method-handling functions: EPI-style + if ($this->functions_parameters_type == 'epivals') + { + $r = call_user_func_array($func, array($methName, $params, $this->user_data)); + // mimic EPI behaviour: if we get an array that looks like an error, make it + // an eror response + if (is_array($r) && array_key_exists('faultCode', $r) && array_key_exists('faultString', $r)) + { + $r = new xmlrpcresp(0, (integer)$r['faultCode'], (string)$r['faultString']); + } + else + { + // functions using EPI api should NOT return resp objects, + // so make sure we encode the return type correctly + $r = new xmlrpcresp(php_xmlrpc_encode($r, array('extension_api'))); + } + } + else + { + $r = call_user_func_array($func, $params); + } + } + // the return type can be either an xmlrpcresp object or a plain php value... + if (!is_a($r, 'xmlrpcresp')) + { + // what should we assume here about automatic encoding of datetimes + // and php classes instances??? + $r = new xmlrpcresp(php_xmlrpc_encode($r, $this->phpvals_encoding_options)); + } + } + } + catch(Exception $e) + { + // (barring errors in the lib) an uncatched exception happened + // in the called function, we wrap it in a proper error-response + switch($this->exception_handling) + { + case 2: + throw $e; + break; + case 1: + $r = new xmlrpcresp(0, $e->getCode(), $e->getMessage()); + break; + default: + $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['server_error'], $GLOBALS['xmlrpcstr']['server_error']); + } + } + if($this->debug > 2) + { + // note: restore the error handler we found before calling the + // user func, even if it has been changed inside the func itself + if($GLOBALS['_xmlrpcs_prev_ehandler']) + { + set_error_handler($GLOBALS['_xmlrpcs_prev_ehandler']); + } + else + { + restore_error_handler(); + } + } + return $r; + } + + /** + * add a string to the 'internal debug message' (separate from 'user debug message') + * @param string $strings + * @access private + */ + function debugmsg($string) + { + $this->debug_info .= $string."\n"; + } + + /** + * @access private + */ + function xml_header($charset_encoding='') + { + if ($charset_encoding != '') + { + return "\n"; + } + else + { + return "\n"; + } + } + + /** + * A debugging routine: just echoes back the input packet as a string value + * DEPRECATED! + */ + function echoInput() + { + $r=new xmlrpcresp(new xmlrpcval( "'Aha said I: '" . $GLOBALS['HTTP_RAW_POST_DATA'], 'string')); + print $r->serialize(); + } + } +?> \ No newline at end of file diff --git a/net/obfsproxy/Makefile b/net/obfsproxy/Makefile new file mode 100644 index 0000000..c0800ce --- /dev/null +++ b/net/obfsproxy/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2012 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:=obfsproxy +PKG_VERSION:=0.1.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://www.torproject.org/dist/obfsproxy \ + https://archive.torproject.org/tor-package-archive/obfsproxy +PKG_MD5SUM:=d3b898b1f5ea21c611bceaeb3c20e0d7 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/obfsproxy + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=A pluggable transports proxy + URL:=https://www.torproject.org/projects/obfsproxy + DEPENDS:=+libevent2 +libopenssl +endef + +define Package/obfsproxy/description + obfsproxy is a tool that attempts to circumvent censorship, by transforming + the Tor traffic between the client and the bridge. This way, censors, who + usually monitor traffic between the client and the bridge, will see + innocent-looking transformed traffic instead of the actual Tor traffic. +endef + +define Package/obfsproxy/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/obfsproxy $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,obfsproxy)) diff --git a/net/obfsproxy/patches/001-no-werror.patch b/net/obfsproxy/patches/001-no-werror.patch new file mode 100644 index 0000000..87b60f7 --- /dev/null +++ b/net/obfsproxy/patches/001-no-werror.patch @@ -0,0 +1,9 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,5 +1,5 @@ + ACLOCAL_AMFLAGS = -I m4 +-WARNINGS = -Wall -Wwrite-strings -Werror ++WARNINGS = -Wall -Wwrite-strings + AM_CPPFLAGS = -I. -I$(srcdir)/src + AM_CFLAGS = $(WARNINGS) @libevent_CFLAGS@ @libcrypto_CFLAGS@ + LDADD = libobfsproxy.a @libevent_LIBS@ @libcrypto_LIBS@ @ws32_LIBS@ diff --git a/net/obfsproxy/patches/002-no-build-hardening.patch b/net/obfsproxy/patches/002-no-build-hardening.patch new file mode 100644 index 0000000..795c7f2 --- /dev/null +++ b/net/obfsproxy/patches/002-no-build-hardening.patch @@ -0,0 +1,12 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -23,9 +23,6 @@ AC_CHECK_HEADERS([sys/socket.h]) + AC_CHECK_HEADERS([sys/types.h]) + AC_CHECK_HEADERS([netinet/in.h]) + +-### Compiler Hardening ### +-AX_ENABLE_HARDENING +- + ### Libraries ### + + PKG_CHECK_MODULES([libevent], [libevent >= 2.0]) diff --git a/net/oidentd/Makefile b/net/oidentd/Makefile new file mode 100644 index 0000000..9959c5f --- /dev/null +++ b/net/oidentd/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2006-2011 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:=oidentd +PKG_VERSION:=2.0.8 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/ojnk +PKG_MD5SUM:=c3d9a56255819ef8904b867284386911 + +include $(INCLUDE_DIR)/package.mk + +define Package/oidentd + SECTION:=net + CATEGORY:=Network + TITLE:=Identd server + URL:=http://dev.ojnk.net/ +endef + +define Package/oidentd/description + A nat aware identd server that will correctly forwared requests to clients. +endef + +# uses GNU configure + +define Build/Compile + $(call Build/Compile/Default,all) +endef + +define Package/oidentd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/src/oidentd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/oidentd.init $(1)/etc/init.d/oidentd +endef + +$(eval $(call BuildPackage,oidentd)) diff --git a/net/oidentd/files/oidentd.init b/net/oidentd/files/oidentd.init new file mode 100644 index 0000000..4b4f309 --- /dev/null +++ b/net/oidentd/files/oidentd.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=85 + +start() { + service_start /usr/sbin/oidentd -m -f 113 +} + +stop() { + service_stop /usr/sbin/oidentd +} diff --git a/net/olsrd/Makefile b/net/olsrd/Makefile new file mode 100644 index 0000000..e176185 --- /dev/null +++ b/net/olsrd/Makefile @@ -0,0 +1,264 @@ +# +# Copyright (C) 2009-2012 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:=olsrd +PKG_VERSION:=0.6.3 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.olsr.org/releases/0.6 + +PKG_MD5SUM:=b28ed2e3dc6c529ab690f1c805ad32a2 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(FPIC) + +define Package/olsrd/template + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + MAINTAINER:=Saverio Proto + TITLE:=OLSR (Optimized Link State Routing) daemon + URL:=http://www.olsr.org/ +endef + +define Package/olsrd + $(call Package/olsrd/template) + MENU:=1 + DEPENDS:=+libpthread +endef + +define Package/olsrd/conffiles +/etc/config/olsrd +endef + +define Package/olsrd-mod-arprefresh + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=Kernel ARP cache refresh plugin +endef + +define Package/olsrd-mod-dot-draw + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=Dot topology information plugin +endef + +define Package/olsrd-mod-bmf + $(call Package/olsrd/template) + DEPENDS:=olsrd +kmod-tun + TITLE:=Basic multicast forwarding plugin +endef + +define Package/olsrd-mod-dyn-gw + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=Dynamic internet gateway plugin +endef + +define Package/olsrd-mod-dyn-gw-plain + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=Dynamic internet gateway plain plugin +endef + +define Package/olsrd-mod-httpinfo + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=Small informative web server plugin +endef + +define Package/olsrd-mod-jsoninfo + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=Small informative plugin with JSON output +endef + +define Package/olsrd-mod-mdns + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=MDNS/Zeroconf/Bonjour packet distribution +endef + +define Package/olsrd-mod-nameservice + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=Lightweight hostname resolver plugin +endef + +define Package/olsrd-mod-p2pd + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=Peer to Peer Discovery plugin +endef + + +define Package/olsrd-mod-pgraph + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=output network topology for pgraph +endef + +define Package/olsrd-mod-quagga + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=Quagga plugin +endef + +define Package/olsrd-mod-secure + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=Message signing plugin to secure routing domain +endef + +define Package/olsrd-mod-tas + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=tas - tiny appliation server programming example +endef + +define Package/olsrd-mod-txtinfo + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=Small informative web server plugin +endef + +define Package/olsrd-mod-watchdog + $(call Package/olsrd/template) + DEPENDS:=olsrd + TITLE:=Watchdog plugin +endef + +define Package/olsrd-mod-secure/conffiles +/etc/olsrd.d/olsrd_secure_key +endef + +MAKE_FLAGS+= \ + NO_DEBUG_MESSAGES=1 \ + OS="linux" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + STRIP="true" \ + INSTALL_LIB="true" \ + SUBDIRS="arprefresh bmf dot_draw dyn_gw dyn_gw_plain httpinfo jsoninfo mdns nameservice p2pd pgraph quagga secure tas txtinfo watchdog" + +define Build/Compile + $(call Build/Compile/Default,all) + $(call Build/Compile/Default,libs) +endef + +define Package/olsrd/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/olsrd.config $(1)/etc/config/olsrd + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/olsrd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/olsrd.init $(1)/etc/init.d/olsrd +endef + +define Package/olsrd-mod-arprefresh/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/arprefresh/olsrd_arprefresh.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-dot-draw/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dot_draw/olsrd_dot_draw.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-bmf/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmf/olsrd_bmf.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-dyn-gw/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw/olsrd_dyn_gw.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-dyn-gw-plain/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw_plain/olsrd_dyn_gw_plain.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-httpinfo/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/httpinfo/olsrd_httpinfo.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-jsoninfo/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/jsoninfo/olsrd_jsoninfo.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-mdns/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/mdns/olsrd_mdns.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-nameservice/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/nameservice/olsrd_nameservice.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-p2pd/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/p2pd/olsrd_p2pd.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-pgraph/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/pgraph/olsrd_pgraph.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-quagga/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/quagga/olsrd_quagga.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-secure/install + $(INSTALL_DIR) $(1)/etc/olsrd.d + $(CP) ./files/olsrd_secure_key $(1)/etc/olsrd.d/ + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/secure/olsrd_secure.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-tas/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/tas/olsrd_tas.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-txtinfo/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/txtinfo/olsrd_txtinfo.so.* $(1)/usr/lib/ +endef + +define Package/olsrd-mod-watchdog/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/watchdog/olsrd_watchdog.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,olsrd)) +$(eval $(call BuildPackage,olsrd-mod-arprefresh)) +$(eval $(call BuildPackage,olsrd-mod-dot-draw)) +$(eval $(call BuildPackage,olsrd-mod-bmf)) +$(eval $(call BuildPackage,olsrd-mod-dyn-gw)) +$(eval $(call BuildPackage,olsrd-mod-dyn-gw-plain)) +$(eval $(call BuildPackage,olsrd-mod-httpinfo)) +$(eval $(call BuildPackage,olsrd-mod-jsoninfo)) +$(eval $(call BuildPackage,olsrd-mod-mdns)) +$(eval $(call BuildPackage,olsrd-mod-nameservice)) +$(eval $(call BuildPackage,olsrd-mod-p2pd)) +$(eval $(call BuildPackage,olsrd-mod-pgraph)) +$(eval $(call BuildPackage,olsrd-mod-quagga)) +$(eval $(call BuildPackage,olsrd-mod-secure)) +$(eval $(call BuildPackage,olsrd-mod-tas)) +$(eval $(call BuildPackage,olsrd-mod-txtinfo)) +$(eval $(call BuildPackage,olsrd-mod-watchdog)) diff --git a/net/olsrd/files/olsrd.config b/net/olsrd/files/olsrd.config new file mode 100644 index 0000000..9a19eb9 --- /dev/null +++ b/net/olsrd/files/olsrd.config @@ -0,0 +1,26 @@ +config olsrd + # uncomment the following line to use a custom config file instead: + #option config_file '/etc/olsrd.conf' + + option IpVersion '4' + +config LoadPlugin + option library 'olsrd_arprefresh.so.0.1' + +config LoadPlugin + option library 'olsrd_dyn_gw.so.0.5' + +config LoadPlugin + option library 'olsrd_httpinfo.so.0.1' + option port '1978' + list Net '0.0.0.0 0.0.0.0' + +config LoadPlugin + option library 'olsrd_nameservice.so.0.3' + +config LoadPlugin + option library 'olsrd_txtinfo.so.0.1' + option accept '0.0.0.0' + +config Interface + list interface 'wlan' diff --git a/net/olsrd/files/olsrd.init b/net/olsrd/files/olsrd.init new file mode 100644 index 0000000..7578316 --- /dev/null +++ b/net/olsrd/files/olsrd.init @@ -0,0 +1,715 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2012 OpenWrt.org + +START=65 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +CONF=/var/etc/olsrd.conf +PID=/var/run/olsrd.pid +PID6=/var/run/olsrd.ipv6.pid + +OLSRD_OLSRD_SCHEMA='ignore:internal config_file:internal DebugLevel=0 AllowNoInt=yes' +OLSRD_IPCCONNECT_SCHEMA='ignore:internal Host:list Net:list2' +OLSRD_LOADPLUGIN_SCHEMA='ignore:internal library:internal Host4:list Net4:list2 Host:list Net:list2 Host6:list Net6:list2 Ping:list redistribute:list NonOlsrIf:list name:list lat lon latlon_infile HNA:list2 hosts:list2' +OLSRD_INTERFACE_SCHEMA='ignore:internal interface:internal AutoDetectChanges:bool' +OLSRD_INTERFACE_DEFAULTS_SCHEMA='AutoDetectChanges:bool' + +T=' ' +N=' +' + +validate_varname() { + local varname="$1" + [ -z "$varname" -o "$varname" != "${varname%%[!A-Za-z0-9_]*}" ] && return 1 + return 0 +} + +validate_olsrd_option() { + local str="$1" + [ -z "$str" -o "$str" != "${str%%[! 0-9A-Za-z./|:_-]*}" ] && return 1 + return 0 +} + +system_config() { + local cfg="$1" + local cfgt + local hostname + local latlon + + config_get cfgt "$cfg" TYPE + + if [ "$cfgt" = "system" ]; then + config_get hostname "$cfg" hostname + hostname="${hostname:-OpenWrt}" + SYSTEM_HOSTNAME="$hostname" + fi + + if [ -z "$SYSTEM_LAT" -o -z "$SYSTEM_LON" ]; then + config_get latlon "$cfg" latlon + IFS=" ${T}${N}," + set -- $latlon + unset IFS + SYSTEM_LAT="$1" + SYSTEM_LON="$2" + fi + + if [ -z "$SYSTEM_LAT" -o -z "$SYSTEM_LON" ]; then + config_get latlon "$cfg" latitude + SYSTEM_LAT="$latlon" + config_get latlon "$cfg" longitude + SYSTEM_LON="$latlon" + fi +} + +olsrd_find_config_file() { + local cfg="$1" + validate_varname "$cfg" || return 0 + + config_get_bool ignore "$cfg" ignore 0 + [ "$ignore" -ne 0 ] && return 0 + config_get OLSRD_CONFIG_FILE "$cfg" config_file + + return 0 +} + +warning_invalid_value() { + local package="$1" + validate_varname "$package" || package= + local config="$2" + validate_varname "$config" || config= + local option="$3" + validate_varname "$option" || option= + + echo -n "Warning: Invalid value" 1>&2 + + if [ -n "$package" -a -n "$config" ]; then + echo -n " in option '$package.$config${option:+.}$option'" 1>&2 + fi + + echo ", skipped" 1>&2 + + return 0 +} + +olsrd_write_option() { + local param="$1" + local cfg="$2" + validate_varname "$cfg" || return 1 + local option="$3" + validate_varname "$option" || return 1 + local value="$4" + local option_type="$5" + + if [ "$option_type" = bool ]; then + case "$value" in + 1|on|true|enabled|yes) value=yes;; + 0|off|false|disabled|no) value=no;; + *) warning_invalid_value olsrd "$cfg" "$option"; return 1;; + esac + fi + + if ! validate_olsrd_option "$value"; then + warning_invalid_value olsrd "$cfg" "$option" + return 1 + fi + + if [ "$value" != "${value%%[G-Zg-z_-]*}" ]; then + if [ "$option" != "Ip6AddrType" -a "$option" != "LinkQualityMult" -a "$value" != "yes" -a "$value" != "no" ]; then + value="\"$value\"" + fi + fi + + echo -n "${N}$param$option $value" + + return 0 +} + +olsrd_write_plparam() { + local param="$1" + local cfg="$2" + validate_varname "$cfg" || return 1 + local option="$3" + validate_varname "$option" || return 1 + local value="$4" + local option_type="$5" + local _option + + if [ "$option_type" = bool ]; then + case "$value" in + 1|on|true|enabled|yes) value=yes;; + 0|off|false|disabled|no) value=no;; + *) warning_invalid_value olsrd "$cfg" "$option"; return 1;; + esac + fi + + if ! validate_olsrd_option "$value"; then + warning_invalid_value olsrd "$cfg" "$option" + return 1 + fi + + IFS='-_' + set -- $option + option="$*" + unset IFS + _option="$option" + if [ "$option" = 'hosts' ]; then + set -- $value + option="$1" + shift + value="$*" + fi + if [ "$option" = 'NonOlsrIf' ]; then + if validate_varname "$value"; then + if network_get_device ifname "$value"; then + echo "Info: mdns Interface '$value' ifname '$ifname' found" 1>&2 + else + echo "Warning: mdns Interface '$value' not found, skipped" 1>&2 + fi + else + warning_invalid_value olsrd "$cfg" "NonOlsrIf" + fi + [ -z "$ifname" ] || value=$ifname + fi + + echo -n "${N}${param}PlParam \"$option\" \"$value\"" + + return 0 +} + +config_update_schema() { + unset IFS + local schema_varname="$1" + validate_varname "$schema_varname" || return 1 + local command="$2" + validate_varname "$command" || return 1 + local option="$3" + validate_varname "$option" || return 1 + local value="$4" + local schema + local cur_option + + case "$varname" in + *_LENGTH) return 0;; + *_ITEM*) return 0;; + esac + + eval "export -n -- \"schema=\${$schema_varname}\"" + + for cur_option in $schema; do + [ "${cur_option%%[:=]*}" = "$option" ] && return 0 + done + + if [ "$command" = list ]; then + set -- $value + if [ "$#" -ge "3" ]; then + schema_entry="$option:list3" + elif [ "$#" -ge "2" ]; then + schema_entry="$option:list2" + else + schema_entry="$option:list" + fi + else + schema_entry="$option" + fi + + append "$schema_varname" "$schema_entry" + + return 0 +} + +config_write_options() { + unset IFS + local schema="$1" + local cfg="$2" + validate_varname "$cfg" || return 1 + local write_func="$3" + [ -z "$write_func" ] && output_func=echo + local write_param="$4" + local schema_entry + local option + local option_length + local option_type + local default + local value + local list_size + local list_item + local list_value + local i + local position + + for schema_entry in $schema; do + default="${schema_entry#*[=]}" + [ "$default" = "$schema_entry" ] && default= + option="${schema_entry%%[=]*}" + IFS=':' + set -- $option + unset IFS + option="$1" + option_type="$2" + validate_varname "$option" || continue + [ -z "$option_type" ] || validate_varname "$option_type" || continue + [ "$option_type" = internal ] && continue + config_get value "$cfg" "$option" + + if [ -z "$value" ]; then + IFS='+' + set -- $default + unset IFS + value=$* + elif [ "$value" = '-' -a -n "$default" ]; then + continue + fi + + [ -z "$value" ] && continue + + case "$option_type" in + list) list_size=1;; + list2) list_size=2;; + list3) list_size=3;; + *) list_size=0;; + esac + + if [ "$list_size" -gt 0 ]; then + config_get option_length "$cfg" "${option}_LENGTH" + if [ -n "$option_length" ]; then + i=1 + while [ "$i" -le "$option_length" ]; do + config_get list_value "$cfg" "${option}_ITEM$i" + "$write_func" "$write_param" "$cfg" "$option" "$list_value" "$option_type" || break + i=$((i + 1)) + done + else + list_value= + i=0 + for list_item in $value; do + append "list_value" "$list_item" + i=$((i + 1)) + position=$((i % list_size)) + if [ "$position" -eq 0 ]; then + "$write_func" "$write_param" "$cfg" "$option" "$list_value" "$option_type" || break + list_value= + fi + done + [ "$position" -ne 0 ] && "$write_func" "$write_param" "$cfg" "$option" "$list_value" "$option_type" + fi + else + "$write_func" "$write_param" "$cfg" "$option" "$value" "$option_type" + fi + done + + return 0 +} + +olsrd_write_olsrd() { + local cfg="$1" + validate_varname "$cfg" || return 0 + local ignore + + config_get_bool ignore "$cfg" ignore 0 + [ "$ignore" -ne 0 ] && return 0 + + [ "$OLSRD_COUNT" -gt 0 ] && return 0 + + config_get ipversion "$cfg" IpVersion + if [ "$ipversion" = "6and4" ]; then + OLSRD_IPVERSION_6AND4=1 + config_set "$cfg" IpVersion '6' + fi + config_get smartgateway "$cfg" SmartGateway + config_get smartgatewayuplink "$cfg" SmartGatewayUplink + + config_write_options "$OLSRD_OLSRD_SCHEMA" "$cfg" olsrd_write_option + echo + OLSRD_COUNT=$((OLSRD_COUNT + 1)) + return 0 +} + +olsrd_write_ipcconnect() { + local cfg="$1" + validate_varname "$cfg" || return 0 + local ignore + + config_get_bool ignore "$cfg" ignore 0 + [ "$ignore" -ne 0 ] && return 0 + + [ "$IPCCONNECT_COUNT" -gt 0 ] && return 0 + + echo -n "${N}IpcConnect${N}{" + config_write_options "$OLSRD_IPCCONNECT_SCHEMA" "$cfg" olsrd_write_option "${T}" + echo "${N}}" + IPCCONNECT_COUNT=$((IPCCONNECT_COUNT + 1)) + + return 0 +} + +olsrd_write_hna4() { + local cfg="$1" + validate_varname "$cfg" || return 0 + local ignore + + config_get_bool ignore "$cfg" ignore 0 + [ "$ignore" -ne 0 ] && return 0 + + config_get netaddr "$cfg" netaddr + if ! validate_olsrd_option "$netaddr"; then + warning_invalid_value olsrd "$cfg" "netaddr" + return 0 + fi + + config_get netmask "$cfg" netmask + if ! validate_olsrd_option "$netmask"; then + warning_invalid_value olsrd "$cfg" "netmask" + return 0 + fi + + [ "$HNA4_COUNT" -le 0 ] && echo -n "${N}Hna4${N}{" + echo -n "${N}${T}${T}$netaddr $netmask" + HNA4_COUNT=$((HNA4_COUNT + 1)) + + return 0 +} + +olsrd_write_hna6() { + local cfg="$1" + validate_varname "$cfg" || return 0 + local ignore + + config_get_bool ignore "$cfg" ignore 0 + [ "$ignore" -ne 0 ] && return 0 + + config_get netaddr "$cfg" netaddr + if ! validate_olsrd_option "$netaddr"; then + warning_invalid_value olsrd "$cfg" "netaddr" + return 0 + fi + + config_get prefix "$cfg" prefix + if ! validate_olsrd_option "$prefix"; then + warning_invalid_value olsrd "$cfg" "prefix" + return 0 + fi + + [ "$HNA6_COUNT" -le 0 ] && echo -n "${N}Hna6${N}{" + echo -n "${N}${T}${T}$netaddr $prefix" + HNA6_COUNT=$((HNA6_COUNT + 1)) + + return 0 +} + +olsrd_write_loadplugin() { + local cfg="$1" + validate_varname "$cfg" || return 0 + local ignore + local name + local suffix + local lat + local lon + local latlon_infile + + config_get_bool ignore "$cfg" ignore 0 + [ "$ignore" -ne 0 ] && return 0 + + config_get library "$cfg" library + if ! validate_olsrd_option "$library"; then + warning_invalid_value olsrd "$cfg" "library" + return 0 + fi + if ! [ -x "/lib/$library" -o -x "/usr/lib/$library" -o -x "/usr/local/lib/$library" ]; then + echo "Warning: Plugin library '$library' not found, skipped" 1>&2 + return 0 + fi + + case "$library" in + olsrd_nameservice.*) + config_get name "$cfg" name + [ -z "$name" ] && config_set "$cfg" name $SYSTEM_HOSTNAME + + config_get suffix "$cfg" suffix + [ -z "$suffix" ] && config_set "$cfg" suffix '.olsr' + + config_get lat "$cfg" lat + config_get lon "$cfg" lon + config_get latlon_infile "$cfg" latlon_infile + if [ \( -z "$lat" -o -z "$lat" \) -a -z "$latlon_infile" ]; then + if [ -f '/var/run/latlon.txt' ]; then + config_set "$cfg" lat '' + config_set "$cfg" lon '' + config_set "$cfg" latlon_infile '/var/run/latlon.txt' + else + config_set "$cfg" lat "$SYSTEM_LAT" + config_set "$cfg" lon "$SYSTEM_LON" + fi + fi + + for f in latlon_file hosts_file services_file resolv_file macs_file; do + config_get $f "$cfg" $f + done + + [ -z "$latlon_file" ] && config_set "$cfg" latlon_file '/var/run/latlon.js' + ;; + olsrd_watchdog.*) + config_get wd_file "$cfg" file + ;; + esac + + echo -n "${N}LoadPlugin \"$library\"${N}{" + config_write_options "$OLSRD_LOADPLUGIN_SCHEMA" "$cfg" olsrd_write_plparam "${T}" + echo "${N}}" + + return 0 +} + +olsrd_write_interface() { + local cfg="$1" + validate_varname "$cfg" || return 0 + local ignore + local interfaces + local interface + local ifnames + + config_get_bool ignore "$cfg" ignore 0 + [ "$ignore" -ne 0 ] && return 0 + + ifnames= + config_get interfaces "$cfg" interface + for interface in $interfaces; do + if validate_varname "$interface"; then + if network_get_device IFNAME "$interface"; then + ifnames="$ifnames \"$IFNAME\"" + ifsglobal="$ifsglobal $IFNAME" + else + echo "Warning: Interface '$interface' not found, skipped" 1>&2 + fi + else + warning_invalid_value olsrd "$cfg" "interface" + fi + done + + [ -z "$ifnames" ] && return 0 + + echo -n "${N}Interface$ifnames${N}{" + config_write_options "$OLSRD_INTERFACE_SCHEMA" "$cfg" olsrd_write_option "${T}" + echo "${N}}" + INTERFACES_COUNT=$((INTERFACES_COUNT + 1)) + + return 0 +} + +olsrd_write_interface_defaults() { + local cfg="$1" + validate_varname "$cfg" || return 0 + + echo -n "${N}InterfaceDefaults$ifnames${N}{" + config_write_options "$OLSRD_INTERFACE_DEFAULTS_SCHEMA" "$cfg" olsrd_write_option "${T}" + echo "${N}}" + + return 1 +} + +olsrd_update_schema() { + local command="$1" + validate_varname "$command" || return 0 + local varname="$2" + validate_varname "$varname" || return 0 + local value="$3" + local cfg="$CONFIG_SECTION" + local cfgt + local cur_varname + + config_get cfgt "$cfg" TYPE + case "$cfgt" in + olsrd) config_update_schema OLSRD_OLSRD_SCHEMA "$command" "$varname" "$value";; + IpcConnect) config_update_schema OLSRD_IPCCONNECT_SCHEMA "$command" "$varname" "$value";; + LoadPlugin) config_update_schema OLSRD_LOADPLUGIN_SCHEMA "$command" "$varname" "$value";; + Interface) config_update_schema OLSRD_INTERFACE_SCHEMA "$command" "$varname" "$value";; + InterfaceDefaults) config_update_schema OLSRD_INTERFACE_DEFAULTS_SCHEMA "$command" "$varname" "$value";; + esac + + return 0 +} + +olsrd_write_config() { + OLSRD_IPVERSION_6AND4=0 + OLSRD_COUNT=0 + config_foreach olsrd_write_olsrd olsrd + IPCCONNECT_COUNT=0 + config_foreach olsrd_write_ipcconnect IpcConnect + HNA4_COUNT=0 + config_foreach olsrd_write_hna4 Hna4 + [ "$HNA4_COUNT" -gt 0 ] && echo "${N}}" + HNA6_COUNT=0 + config_foreach olsrd_write_hna6 Hna6 + [ "$HNA6_COUNT" -gt 0 ] && echo "${N}}" + config_foreach olsrd_write_loadplugin LoadPlugin + INTERFACES_COUNT=0 + config_foreach olsrd_write_interface_defaults InterfaceDefaults + config_foreach olsrd_write_interface Interface + echo + + return 0 +} + +olsrd_setup_smartgw_rules() { + # Check if ipip is installed + [ ! -e /etc/modules.d/[0-9]*-ipip ] && echo "Warning: kmod-ipip is missing. SmartGateway will not work until you install it." + + wanifnames=$(ip r l e 0/0 t all | sed -e 's/^.* dev //' |cut -d " " -f 1 | sort | uniq) + nowan=0 + if [ -z "$wanifnames" ]; then + nowan=1 + fi + + IP4T=$(which iptables) + IP6T=$(which ip6tables) + + # Delete smartgw firewall rules first + for IPT in $IP4T $IP6T; do + while $IPT -D forwarding_rule -o tnl_+ -j ACCEPT 2> /dev/null; do :;done + for IFACE in $wanifnames; do + while $IPT -D forwarding_rule -i tunl0 -o $IFACE -j ACCEPT 2> /dev/null; do :; done + done + for IFACE in $ifsglobal; do + while $IPT -D input_rule -i $IFACE -p 4 -j ACCEPT 2> /dev/null; do :; done + done + done + while $IP4T -t nat -D postrouting_rule -o tnl_+ -j MASQUERADE 2> /dev/null; do :;done + + if [ "$smartgateway" == "yes" ]; then + echo "Notice: Inserting firewall rules for SmartGateway" + if [ ! "$smartgatewayuplink" == "none" ]; then + if [ "$smartgatewayuplink" == "ipv4" ]; then + # Allow everything to be forwarded to tnl_+ and use NAT for it + $IP4T -I forwarding_rule -o tnl_+ -j ACCEPT + $IP4T -t nat -I postrouting_rule -o tnl_+ -j MASQUERADE + # Allow forwarding from tunl0 to (all) wan-interfaces + if [ "$nowan"="0" ]; then + for IFACE in $wanifnames; do + $IP4T -A forwarding_rule -i tunl0 -o $IFACE -j ACCEPT + done + fi + # Allow incoming ipip on all olsr-interfaces + for IFACE in $ifsglobal; do + $IP4T -I input_rule -i $IFACE -p 4 -j ACCEPT + done + elif [ "$smartgatewayuplink" == "ipv6" ]; then + $IP6T -I forwarding_rule -o tnl_+ -j ACCEPT + if [ "$nowan"="0" ]; then + for IFACE in $wanifnames; do + $IP6T -A forwarding_rule -i tunl0 -o $IFACE -j ACCEPT + done + fi + for IFACE in $ifsglobal; do + $IP6T -I input_rule -i $IFACE -p 4 -j ACCEPT + done + else + for IPT in $IP4T $IP6T; do + $IPT -I forwarding_rule -o tnl_+ -j ACCEPT + $IPT -t nat -I postrouting_rule -o tnl_+ -j MASQUERADE + if [ "$nowan"="0" ]; then + for IFACE in $wanifnames; do + $IPT -A forwarding_rule -i tunl0 -o $IFACE -j ACCEPT + done + fi + for IFACE in $ifsglobal; do + $IPT -I input_rule -i $IFACE -p 4 -j ACCEPT + done + done + fi + fi + fi +} + +error() { + echo "${initscript}:" "$@" 1>&2 +} + +start() { + SYSTEM_HOSTNAME= + SYSTEM_LAT= + SYSTEM_LON= + config_load system + config_foreach system_config system + + option_cb() { + olsrd_update_schema "option" "$@" + } + + list_cb() { + olsrd_update_schema "list" "$@" + } + + . /lib/functions/network.sh + + config_load olsrd + reset_cb + + OLSRD_CONFIG_FILE= + config_foreach olsrd_find_config_file olsrd + + if [ -z "$OLSRD_CONFIG_FILE" ]; then + mkdir -p -- /var/etc/ + olsrd_write_config > /var/etc/olsrd.conf + if [ "$INTERFACES_COUNT" -gt 0 -a "$OLSRD_COUNT" -gt 0 ]; then + OLSRD_CONFIG_FILE=/var/etc/olsrd.conf + fi + fi + + [ -z "$OLSRD_CONFIG_FILE" ] && return 1 + + local bindv6only='0' + if [ "$OLSRD_IPVERSION_6AND4" -ne 0 ]; then + bindv6only="$(sysctl -n net.ipv6.bindv6only)" + sysctl -w net.ipv6.bindv6only=1 > /dev/null + sed -e '/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/d' < "$OLSRD_CONFIG_FILE" > /var/etc/olsrd.conf.ipv6 + sed -e 's/^IpVersion[ ][ ]*6$/IpVersion 4/' -e 's/^\t\t[A-Fa-f0-9.:]*[:][A-Fa-f0-9.:]*[ ][0-9]*$//' < "$OLSRD_CONFIG_FILE" > /var/etc/olsrd.conf.ipv4 + rm $OLSRD_CONFIG_FILE + + # some filenames should get the suffix .ipv6 + for file in $latlon_file $hosts_file $services_file $resolv_file $macs_file $wd_file;do + f=$(echo $file|sed 's/\//\\\//g') + sed -i "s/$f/$f.ipv6/g" /var/etc/olsrd.conf.ipv6 + done + + SERVICE_PID_FILE="$PID6" + if service_check /usr/sbin/olsrd; then + error "there already is an IPv6 instance of olsrd running ($(cat $PID6)), not starting." + else + service_start /usr/sbin/olsrd -f /var/etc/olsrd.conf.ipv6 -nofork + fi + + SERVICE_PID_FILE="$PID" + if service_check /usr/sbin/olsrd; then + error "there already is an IPv4 instance of olsrd running ($(cat $PID)), not starting." + else + service_start /usr/sbin/olsrd -f /var/etc/olsrd.conf.ipv4 -nofork + fi + + sleep 3 + sysctl -w net.ipv6.bindv6only="$bindv6only" > /dev/null + + else + + if [ "$ipversion" = "6" ]; then + sed -i '/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/d' "$OLSRD_CONFIG_FILE" + fi + + SERVICE_PID_FILE="$PID" + if service_check /usr/sbin/olsrd; then + error "there already is an IPv4 instance of olsrd running ($(cat $PID)), not starting." + return 1 + else + service_start /usr/sbin/olsrd -f "$OLSRD_CONFIG_FILE" -nofork + fi + fi + olsrd_setup_smartgw_rules +} + +stop() { + SERVICE_PID_FILE="$PID" + service_stop /usr/sbin/olsrd + + SERVICE_PID_FILE="$PID6" + service_stop /usr/sbin/olsrd +} diff --git a/net/olsrd/files/olsrd_secure_key b/net/olsrd/files/olsrd_secure_key new file mode 100644 index 0000000..4a7d725 --- /dev/null +++ b/net/olsrd/files/olsrd_secure_key @@ -0,0 +1 @@ +1234567890123456 \ No newline at end of file diff --git a/net/olsrd/patches/100-olsrd-fix-stack-corruption-in-net_output.patch b/net/olsrd/patches/100-olsrd-fix-stack-corruption-in-net_output.patch new file mode 100644 index 0000000..77c2323 --- /dev/null +++ b/net/olsrd/patches/100-olsrd-fix-stack-corruption-in-net_output.patch @@ -0,0 +1,52 @@ +From f4d250ad4fad5fcfe5b5feaac3f3e121adef3fba Mon Sep 17 00:00:00 2001 +From: Jo-Philipp Wich +Date: Fri, 22 Jun 2012 03:17:59 +0200 +Subject: [PATCH] olsrd: fix stack corruption in net_output() + +The net_output() function indirectly uses the stack variables dst and dst6 +outside of the scope they're declared in, this might leads to olsr_sendto() +being called with a corrupted destination sockaddr_in. + +This failure condition can be observed in the log, olsrd will continuosly +print "sendto(v4): Invalid Argument" or a similar message. On ARM it has been +reported to result in "Unsupported Address Family". + +This bug became apparant on a custon OpenWrt x86_64 uClibc target using the +Linaro GCC 4.7-2012.04 compiler, it has been reported for an unspecified ARM +target as well. + +The offending code seems to be unchanged since 2008 and it does not cause +issues on 32bit systems and/or with older (Linaro) GCC versions, but the +compiler used in our tests seems to perform more aggressive optimizations +leading to a stack corruption. +--- + src/net_olsr.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +--- a/src/net_olsr.c ++++ b/src/net_olsr.c +@@ -336,6 +336,8 @@ net_output(struct interface *ifp) + { + struct sockaddr_in *sin = NULL; + struct sockaddr_in6 *sin6 = NULL; ++ struct sockaddr_in dst; ++ struct sockaddr_in6 dst6; + struct ptf *tmp_ptf_list; + union olsr_packet *outmsg; + int retval; +@@ -354,7 +356,6 @@ net_output(struct interface *ifp) + outmsg->v4.olsr_packlen = htons(ifp->netbuf.pending); + + if (olsr_cnf->ip_version == AF_INET) { +- struct sockaddr_in dst; + /* IP version 4 */ + sin = (struct sockaddr_in *)&ifp->int_broadaddr; + +@@ -365,7 +366,6 @@ net_output(struct interface *ifp) + if (sin->sin_port == 0) + sin->sin_port = htons(olsr_cnf->olsrport); + } else { +- struct sockaddr_in6 dst6; + /* IP version 6 */ + sin6 = (struct sockaddr_in6 *)&ifp->int6_multaddr; + /* Copy sin */ diff --git a/net/openconnect/Makefile b/net/openconnect/Makefile new file mode 100644 index 0000000..280775f --- /dev/null +++ b/net/openconnect/Makefile @@ -0,0 +1,49 @@ +# +# 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:=openconnect +PKG_VERSION:=3.18 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/openconnect/ +PKG_MD5SUM:=5a440ad946cfec0f1ee7ee5519081cf1 + +include $(INCLUDE_DIR)/package.mk + +define Package/openconnect + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libxml2 +libopenssl +kmod-tun +resolveip + TITLE:=VPN client for Cisco's AnyConnect SSL VPN + URL:=http://www.infradead.org/openconnect/ + SUBMENU:=VPN +endef + +define Package/openconnect/description + A VPN client compatible with Cisco's AnyConnect SSL VPN. + + OpenConnect is a client for Cisco's AnyConnect SSL VPN, which is + supported by IOS 12.4(9)T or later on Cisco SR500, 870, 880, 1800, 2800, + 3800, 7200 Series and Cisco 7301 Routers. +endef + +CONFIGURE_ARGS += \ + --disable-shared \ + --with-vpnc-script=/lib/netifd/vpnc-script + +define Package/openconnect/install + $(INSTALL_DIR) $(1)/lib/netifd/proto + $(INSTALL_BIN) ./files/openconnect.sh $(1)/lib/netifd/proto/ + $(INSTALL_BIN) ./files/vpnc-script $(1)/lib/netifd/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/openconnect $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,openconnect)) diff --git a/net/openconnect/files/openconnect.sh b/net/openconnect/files/openconnect.sh new file mode 100755 index 0000000..2110067 --- /dev/null +++ b/net/openconnect/files/openconnect.sh @@ -0,0 +1,56 @@ +#!/bin/sh +. /lib/functions.sh +. ../netifd-proto.sh +init_proto "$@" + +proto_openconnect_init_config() { + proto_config_add_string "server" + proto_config_add_int "port" + proto_config_add_string "username" + proto_config_add_string "cookie" + proto_config_add_string "password" + no_device=1 + available=1 +} + +proto_openconnect_setup() { + local config="$1" + + json_get_vars server port username cookie password + + grep -q tun /proc/modules || insmod tun + + serv_addr= + for ip in $(resolveip -t 5 "$server"); do + proto_add_host_dependency "$config" "$server" + serv_addr=1 + done + [ -n "$serv_addr" ] || { + echo "Could not resolve server address" + sleep 5 + proto_setup_failed "$config" + exit 1 + } + + [ -n "$port" ] && port=":$port" + + cmdline="$server$port -i vpn-$config --no-cert-check --non-inter --syslog --script /lib/netifd/vpnc-script" + + [ -n "$cookie" ] && append cmdline "-C $cookie" + [ -n "$username" ] && append cmdline "-u $username" + [ -n "$password" ] && { + umask 077 + pwfile="/var/run/openconnect-$config.passwd" + echo "$password" > "$pwfile" + append cmdline "--passwd-file=$pwfile" + } + + proto_export INTERFACE="$config" + proto_run_command "$config" /usr/sbin/openconnect $cmdline +} + +proto_openconnect_teardown() { + proto_kill_command "$config" +} + +add_protocol openconnect diff --git a/net/openconnect/files/vpnc-script b/net/openconnect/files/vpnc-script new file mode 100755 index 0000000..4d12d7e --- /dev/null +++ b/net/openconnect/files/vpnc-script @@ -0,0 +1,156 @@ +#!/bin/sh +# List of parameters passed through environment +#* reason -- why this script was called, one of: pre-init connect disconnect +#* VPNGATEWAY -- vpn gateway address (always present) +#* TUNDEV -- tunnel device (always present) +#* INTERNAL_IP4_ADDRESS -- address (always present) +#* INTERNAL_IP4_MTU -- mtu (often unset) +#* INTERNAL_IP4_NETMASK -- netmask (often unset) +#* INTERNAL_IP4_NETMASKLEN -- netmask length (often unset) +#* INTERNAL_IP4_NETADDR -- address of network (only present if netmask is set) +#* INTERNAL_IP4_DNS -- list of dns servers +#* INTERNAL_IP4_NBNS -- list of wins servers +#* INTERNAL_IP6_ADDRESS -- IPv6 address +#* INTERNAL_IP6_NETMASK -- IPv6 netmask +#* INTERNAL_IP6_DNS -- IPv6 list of dns servers +#* CISCO_DEF_DOMAIN -- default domain name +#* CISCO_BANNER -- banner from server +#* CISCO_SPLIT_INC -- number of networks in split-network-list +#* CISCO_SPLIT_INC_%d_ADDR -- network address +#* CISCO_SPLIT_INC_%d_MASK -- subnet mask (for example: 255.255.255.0) +#* CISCO_SPLIT_INC_%d_MASKLEN -- subnet masklen (for example: 24) +#* CISCO_SPLIT_INC_%d_PROTOCOL -- protocol (often just 0) +#* CISCO_SPLIT_INC_%d_SPORT -- source port (often just 0) +#* CISCO_SPLIT_INC_%d_DPORT -- destination port (often just 0) +#* CISCO_IPV6_SPLIT_INC -- number of networks in IPv6 split-network-list +#* CISCO_IPV6_SPLIT_INC_%d_ADDR -- IPv6 network address +#* CISCO_IPV6_SPLIT_INC_$%d_MASKLEN -- IPv6 subnet masklen + +# FIXMEs: + +# Section A: route handling + +# 1) The 3 values CISCO_SPLIT_INC_%d_PROTOCOL/SPORT/DPORT are currently being ignored +# In order to use them, we'll probably need os specific solutions +# * Linux: iptables -t mangle -I PREROUTING -j ROUTE --oif $TUNDEV +# This would be an *alternative* to changing the routes (and thus 2) and 3) +# shouldn't be relevant at all) +# 2) There are two different functions to set routes: generic routes and the +# default route. Why isn't the defaultroute handled via the generic route case? +# 3) In the split tunnel case, all routes but the default route might get replaced +# without getting restored later. We should explicitely check and save them just +# like the defaultroute +# 4) Replies to a dhcp-server should never be sent into the tunnel + +# Section B: Split DNS handling + +# 1) Maybe dnsmasq can do something like that +# 2) Parse dns packets going out via tunnel and redirect them to original dns-server + +do_connect() { + if [ -n "$CISCO_BANNER" ]; then + echo "Connect Banner:" + echo "$CISCO_BANNER" | while read LINE ; do echo "|" "$LINE" ; done + echo + fi + + proto_init_update "$TUNDEV" 1 + + if [ -n "$INTERNAL_IP4_MTU" ]; then + MTU=$INTERNAL_IP4_MTU + fi + + if [ -z "$MTU" ]; then + MTU=1412 + fi + + proto_add_ipv4_address "$INTERNAL_IP4_ADDRESS" 32 "" "$INTERNAL_IP4_ADDRESS" + + if [ -n "$INTERNAL_IP4_NETMASKLEN" ]; then + proto_add_ipv4_route "$INTERNAL_IP4_NETADDR" "$INTERNAL_IP4_NETMASKLEN" + fi + + # If the netmask is provided, it contains the address _and_ netmask + if [ -n "$INTERNAL_IP6_ADDRESS" ] && [ -z "$INTERNAL_IP6_NETMASK" ]; then + INTERNAL_IP6_NETMASK="$INTERNAL_IP6_ADDRESS/128" + fi + + if [ -n "$INTERNAL_IP6_NETMASK" ]; then + addr="${INTERNAL_IP6_NETMASK%%/*}" + mask="${INTERNAL_IP6_NETMASK##*/}" + [[ "$addr" != "$mask" ]] && proto_add_ipv6_address "$addr" "$mask" + fi + + [ -n "$INTERNAL_IP4_DNS" ] && proto_add_dns_server "$INTERNAL_IP4_DNS" + [ -n "$CISCO_DEF_DOMAIN" ] && proto_add_dns_search "$CISCO_DEF_DOMAIN" + + if [ -n "$CISCO_SPLIT_INC" ]; then + i=0 + while [ $i -lt $CISCO_SPLIT_INC ] ; do + eval NETWORK="\${CISCO_SPLIT_INC_${i}_ADDR}" + eval NETMASK="\${CISCO_SPLIT_INC_${i}_MASK}" + eval NETMASKLEN="\${CISCO_SPLIT_INC_${i}_MASKLEN}" + if [ $NETWORK != "0.0.0.0" ]; then + proto_add_ipv4_route "$NETWORK" "$NETMASKLEN" + else + proto_add_ipv4_route "0.0.0.0" 0 + fi + i=$(($i + 1)) + done + elif [ -n "$INTERNAL_IP4_ADDRESS" ]; then + proto_add_ipv4_route "0.0.0.0" 0 + fi + if [ -n "$CISCO_IPV6_SPLIT_INC" ]; then + i=0 + while [ $i -lt $CISCO_IPV6_SPLIT_INC ] ; do + eval NETWORK="\${CISCO_IPV6_SPLIT_INC_${i}_ADDR}" + eval NETMASKLEN="\${CISCO_IPV6_SPLIT_INC_${i}_MASKLEN}" + if [ $NETMASKLEN -lt 128 ]; then + proto_add_ipv6_route "$NETWORK" "$NETMASKLEN" + else + proto_add_ipv6_route "::0" 0 + fi + i=$(($i + 1)) + done + elif [ -n "$INTERNAL_IP6_NETMASK" -o -n "$INTERNAL_IP6_ADDRESS" ]; then + proto_add_ipv6_route "::0" 0 + fi + proto_send_update "$INTERFACE" +} + +do_disconnect() { + proto_init_update "$TUNDEV" 0 + proto_send_update "$INTERFACE" +} + +#### Main + +if [ -z "$reason" ]; then + echo "this script must be called from vpnc" 1>&2 + exit 1 +fi +if [ -z "$INTERFACE" ]; then + echo "this script must be called for an active interface" + exit 1 +fi + +. /lib/netifd/netifd-proto.sh + +case "$reason" in + pre-init) + ;; + connect) + do_connect + ;; + disconnect) + do_disconnect + ;; + reconnect) + ;; + *) + echo "unknown reason '$reason'. Maybe vpnc-script is out of date" 1>&2 + exit 1 + ;; +esac + +exit 0 diff --git a/net/openconnect/patches/100-passwd_file.patch b/net/openconnect/patches/100-passwd_file.patch new file mode 100644 index 0000000..3e074d5 --- /dev/null +++ b/net/openconnect/patches/100-passwd_file.patch @@ -0,0 +1,100 @@ +--- a/main.c ++++ b/main.c +@@ -77,6 +77,7 @@ enum { + OPT_CAFILE, + OPT_COOKIEONLY, + OPT_COOKIE_ON_STDIN, ++ OPT_COOKIE_FILE, + OPT_CSD_USER, + OPT_CSD_WRAPPER, + OPT_DISABLE_IPV6, +@@ -91,6 +92,7 @@ enum { + OPT_NO_PROXY, + OPT_PIDFILE, + OPT_PASSWORD_ON_STDIN, ++ OPT_PASSWORD_FILE, + OPT_PRINTCOOKIE, + OPT_RECONNECT_TIMEOUT, + OPT_SERVERCERT, +@@ -139,7 +141,9 @@ static struct option long_options[] = { + OPTION("queue-len", 1, 'Q'), + OPTION("xmlconfig", 1, 'x'), + OPTION("cookie-on-stdin", 0, OPT_COOKIE_ON_STDIN), ++ OPTION("cookie-file", 1, OPT_COOKIE_FILE), + OPTION("passwd-on-stdin", 0, OPT_PASSWORD_ON_STDIN), ++ OPTION("passwd-file", 1, OPT_PASSWORD_FILE), + OPTION("no-passwd", 0, OPT_NO_PASSWD), + OPTION("reconnect-timeout", 1, OPT_RECONNECT_TIMEOUT), + OPTION("dtls-ciphers", 1, OPT_DTLS_CIPHERS), +@@ -177,6 +181,7 @@ static void usage(void) + printf(" -K, --key-type=TYPE %s\n", _("Private key type (PKCS#12 / TPM / PEM)")); + printf(" -C, --cookie=COOKIE %s\n", _("Use WebVPN cookie COOKIE")); + printf(" --cookie-on-stdin %s\n", _("Read cookie from standard input")); ++ printf(" --cookie-file=FILE %s\n", _("Read cookie from a file")); + printf(" -d, --deflate %s\n", _("Enable compression (default)")); + printf(" -D, --no-deflate %s\n", _("Disable compression")); + printf(" --force-dpd=INTERVAL %s\n", _("Set minimum Dead Peer Detection interval")); +@@ -217,6 +222,7 @@ static void usage(void) + printf(" --no-cert-check %s\n", _("Do not require server SSL cert to be valid")); + printf(" --non-inter %s\n", _("Do not expect user input; exit if it is required")); + printf(" --passwd-on-stdin %s\n", _("Read password from standard input")); ++ printf(" --passwd-file=FILE %s\n", _("Read password from a file")); + printf(" --reconnect-timeout %s\n", _("Connection retry timeout in seconds")); + printf(" --servercert=FINGERPRINT %s\n", _("Server's certificate SHA1 fingerprint")); + printf(" --useragent=STRING %s\n", _("HTTP header User-Agent: field")); +@@ -226,15 +232,28 @@ static void usage(void) + exit(1); + } + +-static void read_stdin(char **string) ++static void read_file(const char *file, char **string) + { + char *c = malloc(100); ++ FILE *f; ++ ++ if (file) { ++ f = fopen(file, "r"); ++ if (!f) { ++ fprintf(stderr, _("Failed to open password file\n")); ++ exit(1); ++ } ++ } else { ++ file = "stdin"; ++ f = stdin; ++ } ++ + if (!c) { +- fprintf(stderr, _("Allocation failure for string from stdin\n")); ++ fprintf(stderr, _("Allocation failure for string from %s\n"), file); + exit(1); + } +- if (!fgets(c, 100, stdin)) { +- perror(_("fgets (stdin)")); ++ if (!fgets(c, 100, f)) { ++ perror(_("fgets")); + exit(1); + } + +@@ -332,14 +351,20 @@ int main(int argc, char **argv) + cookieonly = 2; + break; + case OPT_COOKIE_ON_STDIN: +- read_stdin(&vpninfo->cookie); ++ optarg = NULL; ++ /* fall through */ ++ case OPT_COOKIE_FILE: ++ read_file(optarg, &vpninfo->cookie); + /* If the cookie is empty, ignore it */ + if (! *vpninfo->cookie) { + vpninfo->cookie = NULL; + } + break; + case OPT_PASSWORD_ON_STDIN: +- read_stdin(&vpninfo->password); ++ optarg = NULL; ++ /* fall through */ ++ case OPT_PASSWORD_FILE: ++ read_file(optarg, &vpninfo->password); + break; + case OPT_NO_PASSWD: + vpninfo->nopasswd = 1; diff --git a/net/opendchub/Makefile b/net/opendchub/Makefile new file mode 100644 index 0000000..a6ef84e --- /dev/null +++ b/net/opendchub/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=opendchub +PKG_VERSION:=0.8.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/opendchub +PKG_MD5SUM:=e812ac26323f3a8113ce1a0761ce9544 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/opendchub + SUBMENU:=P2P + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libopenssl +libpthread + TITLE:=software for the Direct Connect network + URL:=http://opendchub.sourceforge.net/ +endef + +define Package/opendchub/description + Open DC hub is a Unix/Linux version of the hub software + for the Direct Connect network +endef + +CONFIGURE_ARGS += \ + --disable-perl \ + +define Package/opendchub/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opendchub $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,opendchub)) diff --git a/net/openl2tp/Makefile b/net/openl2tp/Makefile new file mode 100644 index 0000000..32adfc7 --- /dev/null +++ b/net/openl2tp/Makefile @@ -0,0 +1,128 @@ +# +# Copyright (C) 2009-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=openl2tp +PKG_VERSION:=1.8 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/openl2tp +PKG_MD5SUM:=e3d08dedfb9e6a9a1e24f6766f6dadd0 + +PKG_BUILD_DEPENDS:=libreadline libncurses USE_UCLIBC:librpc +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_PARALLEL:=1 +PPPD_VERSION:=2.4.5 + +include $(INCLUDE_DIR)/package.mk + +define Package/openl2tp/Default + SUBMENU:=VPN + SECTION:=net + CATEGORY:=Network + TITLE:=An L2TP (Layer 2 Tunneling Protocol) daemon + URL:=http://www.openl2tp.org/ + PROVIDES:=openl2tp + DEPENDS:=+ppp-mod-pppol2tp +endef + +define Package/openl2tp/description/Default + OpenL2TP is an open source L2TP client/server, written by Katalix Systems + specifically for Linux. It has been designed for use as an enterprise + L2TP VPN server or in commercial, Linux-based, embedded networking + products and is able to support hundreds of sessions, each with different + configuration. +endef + + +define Package/openl2tp-full +$(call Package/openl2tp/Default) + TITLE+=(full) + VARIANT:=full + DEPENDS+=+portmap +libreadline +libncurses $(LIBRPC_DEPENDS) +endef + +define Package/openl2tp-full/description +$(call Package/openl2tp/description/Default) + . + This package a full-featured, RPC-enabled OpenL2TP. +endef + + +define Package/openl2tp-mini +$(call Package/openl2tp/Default) + TITLE+=(mini) + VARIANT:=mini +endef + +define Package/openl2tp-mini/description +$(call Package/openl2tp/description/Default) + . + This package a minimal-featured, RPC-disabled OpenL2TP. +endef + + +MAKE_FLAGS+= \ + KERNEL_SRCDIR="$(LINUX_DIR)" \ + KERNEL_BLDDIR="$(LINUX_DIR)" \ + PPPD_VERSION="$(PKG_PPPD_VERSION)" \ + READLINE_DIR="$(STAGING_DIR)/usr" \ + PPPD_SRCDIR="$(STAGING_DIR)/usr/include" \ + PPPD_LIBDIR="$(STAGING_DIR)/usr/lib" \ + CFLAGS.optimize="$(TARGET_CFLAGS)" \ + CPPFLAGS-y="-I$(STAGING_DIR)/usr/include" \ + L2TP_FEATURE_LOCAL_CONF_FILE=y \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + +ifeq ($(BUILD_VARIANT),full) + + MAKE_FLAGS += \ + L2TP_FEATURE_RPC_MANAGEMENT=y \ + L2TP_FEATURE_LOCAL_STAT_FILE=y \ + LIBS.dmalloc="-L$(STAGING_DIR)/usr/lib $(LIBRPC)" \ + +endif +ifeq ($(BUILD_VARIANT),mini) + + MAKE_FLAGS += \ + L2TP_FEATURE_RPC_MANAGEMENT= \ + L2TP_FEATURE_LOCAL_STAT_FILE= \ + +endif + +define Build/Prepare + $(call Build/Prepare/Default) + $(CP) ./src/*.[ch] $(PKG_BUILD_DIR)/ +endef + +define Package/openl2tp-full/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/l2tpconfig $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/openl2tpd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PPPD_VERSION) + $(INSTALL_BIN) $(PKG_BUILD_DIR)/pppd/openl2tp.so $(1)/usr/lib/pppd/$(PPPD_VERSION)/ + $(INSTALL_DIR) $(1)/usr/lib/openl2tp + $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/event_sock.so $(1)/usr/lib/openl2tp/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/ipsec.so $(1)/usr/lib/openl2tp/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/ppp_null.so $(1)/usr/lib/openl2tp/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/ppp_unix.so $(1)/usr/lib/openl2tp/ +endef + +define Package/openl2tp-mini/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/openl2tpd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/openl2tp + $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/ipsec.so $(1)/usr/lib/openl2tp/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/ppp_unix.so $(1)/usr/lib/openl2tp/ +endef + +$(eval $(call BuildPackage,openl2tp-full)) +$(eval $(call BuildPackage,openl2tp-mini)) diff --git a/net/openl2tp/patches/001-makefile.patch b/net/openl2tp/patches/001-makefile.patch new file mode 100644 index 0000000..cae8e8e --- /dev/null +++ b/net/openl2tp/patches/001-makefile.patch @@ -0,0 +1,70 @@ +--- a/Makefile ++++ b/Makefile +@@ -158,7 +158,7 @@ CFLAGS= -I. -Iusl -Icli -isystem inclu + $(CPPFLAGS) $(CPPFLAGS.dmalloc) \ + -DSYS_LIBDIR=$(SYS_LIBDIR) + LDFLAGS.l2tpd= -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc +-LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc ++LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline -lncurses $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc + + OPT_CFLAGS?= -O + +@@ -185,11 +185,11 @@ RPCGENFLAGS= -N -M -C -L + + .PHONY: all clean distclean install daemon app test + +-all: generated-files daemon $(APP) ++all: daemon $(APP) + +-daemon: generated-files $(SUBDIRS:%=subdir-%) openl2tpd ++daemon: $(SUBDIRS:%=subdir-%) openl2tpd + +-app: generated-files l2tpconfig ++app: l2tpconfig + + test: subdir-test + $(MAKE) -C $@ $(MFLAGS) $@ +@@ -197,7 +197,7 @@ test: subdir-test + + .PHONY: $(SUBDIRS:%=subdir-%) + +-$(SUBDIRS:%=subdir-%): FORCE ++$(SUBDIRS:%=subdir-%): FORCE generated-files + $(MAKE) -C $(@:subdir-%=%) $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)" + + ifeq ($(L2TP_FEATURE_LOCAL_CONF_FILE),y) +@@ -212,10 +212,10 @@ LDFLAGS.l2tpd+= -lfl + $(YACC) -d -o l2tp_config_parse.c $< + + l2tp_config_token.o: l2tp_config_token.c +- $(CC) -I. -MMD -w $(CFLAGS.optimize) -c -DYY_NO_UNPUT $< ++ $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) -DYY_NO_UNPUT $< + + l2tp_config_parse.o: l2tp_config_parse.c l2tp_config_parse.h +- $(CC) -I. -MMD -w $(CFLAGS.optimize) -c -DYY_NO_UNPUT $< ++ $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) -DYY_NO_UNPUT $< + endif + + # Compile without -Wall because rpcgen-generated code is full of warnings. +@@ -265,9 +265,13 @@ TAGS: + @for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) $@; done + etags $(wildcard *.c) $(wildcard *.h) + ++$(L2TPD_SRCS.o): generated-files ++ + openl2tpd: $(L2TPD_SRCS.o) + $(CC) -o $@ $^ $(LDFLAGS.l2tpd) + ++$(L2TPCONFIG_SRCS.o): generated-files ++ + l2tpconfig: $(L2TPCONFIG_SRCS.o) + $(CC) -o $@ $^ $(LDFLAGS.l2tpconfig) + +@@ -317,6 +321,7 @@ endif + else \ + mv $@.tmp $@ ;\ + fi ++ @echo '$@ generated.' + + .PHONY: all install-all install-daemon install-app + diff --git a/net/openl2tp/patches/002-no_libfl.patch b/net/openl2tp/patches/002-no_libfl.patch new file mode 100644 index 0000000..ae1dc6a --- /dev/null +++ b/net/openl2tp/patches/002-no_libfl.patch @@ -0,0 +1,22 @@ +--- a/l2tp_config_token.l ++++ b/l2tp_config_token.l +@@ -23,6 +23,8 @@ static int resolveip(const char *val, st + int lineno; + int command; + ++int yywrap(void) { return 1; } ++ + %} + + /* common section */ +--- a/Makefile ++++ b/Makefile +@@ -204,7 +204,7 @@ ifeq ($(L2TP_FEATURE_LOCAL_CONF_FILE),y) + # Config file parser + LEX= flex + YACC= bison +-LDFLAGS.l2tpd+= -lfl ++LDFLAGS.l2tpd+= + %.c: %.l + $(LEX) -o$@ $< + diff --git a/net/openl2tp/patches/010-ppp_unix.patch b/net/openl2tp/patches/010-ppp_unix.patch new file mode 100644 index 0000000..839749e --- /dev/null +++ b/net/openl2tp/patches/010-ppp_unix.patch @@ -0,0 +1,11 @@ +--- a/plugins/ppp_unix.c ++++ b/plugins/ppp_unix.c +@@ -888,6 +888,8 @@ static int ppp_unix_pppd_spawn(struct pp + + if (ppp->ppp_profile_data->proxy_arp) { + argv[arg++] = "proxyarp"; ++ } else { ++ argv[arg++] = "noproxyarp"; + } + + argv[arg++] = "plugin"; diff --git a/net/openl2tp/src/l2tp_rpc.h b/net/openl2tp/src/l2tp_rpc.h new file mode 100644 index 0000000..3989b92 --- /dev/null +++ b/net/openl2tp/src/l2tp_rpc.h @@ -0,0 +1,1475 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _L2TP_RPC_H_RPCGEN +#define _L2TP_RPC_H_RPCGEN + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define L2TP_APP_COPYRIGHT_INFO "(c) Copyright 2004-2010" +#define L2TP_APP_VENDOR_INFO "Katalix Systems Ltd." +#define L2TP_APP_MAJOR_VERSION 1 +#define L2TP_APP_MINOR_VERSION 8 +#define L2TP_DEBUG_PROTOCOL 1 +#define L2TP_DEBUG_FSM 2 +#define L2TP_DEBUG_API 4 +#define L2TP_DEBUG_AVP 8 +#define L2TP_DEBUG_AVP_HIDE 16 +#define L2TP_DEBUG_AVP_DATA 32 +#define L2TP_DEBUG_FUNC 64 +#define L2TP_DEBUG_XPRT 128 +#define L2TP_DEBUG_DATA 256 +#define L2TP_DEBUG_SYSTEM 512 +#define L2TP_DEBUG_PPP 1024 +#define L2TP_ERR_BASE 500 +#define L2TP_ERR_PARAM_NOT_MODIFIABLE 500 +#define L2TP_ERR_PEER_ADDRESS_MISSING 501 +#define L2TP_ERR_PEER_NOT_FOUND 502 +#define L2TP_ERR_PEER_PROFILE_NOT_FOUND 503 +#define L2TP_ERR_PPP_PROFILE_NOT_FOUND 504 +#define L2TP_ERR_PROFILE_ALREADY_EXISTS 505 +#define L2TP_ERR_PROFILE_NAME_ILLEGAL 506 +#define L2TP_ERR_PROFILE_NAME_MISSING 507 +#define L2TP_ERR_SESSION_ALREADY_EXISTS 508 +#define L2TP_ERR_SESSION_ID_ALLOC_FAILURE 509 +#define L2TP_ERR_SESSION_LIMIT_EXCEEDED 510 +#define L2TP_ERR_SESSION_NOT_FOUND 511 +#define L2TP_ERR_SESSION_PROFILE_NOT_FOUND 512 +#define L2TP_ERR_SESSION_SPEC_MISSING 513 +#define L2TP_ERR_SESSION_TYPE_BAD 514 +#define L2TP_ERR_SESSION_TYPE_ILLEGAL_FOR_TUNNEL 515 +#define L2TP_ERR_TUNNEL_ADD_ADMIN_DISABLED 516 +#define L2TP_ERR_TUNNEL_CREATE_ADMIN_DISABLED 517 +#define L2TP_ERR_TUNNEL_ALREADY_EXISTS 518 +#define L2TP_ERR_TUNNEL_ID_ALLOC_FAILURE 519 +#define L2TP_ERR_TUNNEL_NOT_FOUND 520 +#define L2TP_ERR_TUNNEL_PROFILE_NOT_FOUND 521 +#define L2TP_ERR_TUNNEL_SPEC_MISSING 522 +#define L2TP_ERR_TUNNEL_TOO_MANY_SESSIONS 523 +#define L2TP_ERR_TUNNEL_TOO_MANY_SAME_IP 524 +#define L2TP_ERR_TUNNEL_LIMIT_EXCEEDED 525 +#define L2TP_ERR_SESSION_TYPE_NOT_SUPPORTED 526 +#define L2TP_ERR_TUNNEL_HIDE_AVPS_NEEDS_SECRET 527 +#define L2TP_ERR_MAX 528 + +struct optstring { + int valid; + union { + char *value; + } optstring_u; +}; +typedef struct optstring optstring; +#define OPTSTRING(_var) _var.optstring_u.value +#define OPTSTRING_PTR(_var) ((_var.valid == 1) ? _var.optstring_u.value : NULL) + +enum l2tp_api_tunnel_auth_mode { + L2TP_API_TUNNEL_AUTH_MODE_NONE = 0, + L2TP_API_TUNNEL_AUTH_MODE_SIMPLE = 1, + L2TP_API_TUNNEL_AUTH_MODE_CHALLENGE = 2, +}; +typedef enum l2tp_api_tunnel_auth_mode l2tp_api_tunnel_auth_mode; + +enum l2tp_api_tunnel_mode { + L2TP_API_TUNNEL_MODE_LACLNS = 0, + L2TP_API_TUNNEL_MODE_LAC = 1, + L2TP_API_TUNNEL_MODE_LNS = 2, +}; +typedef enum l2tp_api_tunnel_mode l2tp_api_tunnel_mode; + +struct l2tp_api_ip_addr { + uint32_t s_addr; +}; +typedef struct l2tp_api_ip_addr l2tp_api_ip_addr; +#define L2TP_API_APP_FEATURE_LOCAL_CONF_FILE 1 +#define L2TP_API_APP_FEATURE_LAC_SUPPORT 2 +#define L2TP_API_APP_FEATURE_LNS_SUPPORT 4 +#define L2TP_API_APP_FEATURE_RPC_MANAGEMENT 8 +#define L2TP_API_APP_FEATURE_LAIC_SUPPORT 16 +#define L2TP_API_APP_FEATURE_LAOC_SUPPORT 32 +#define L2TP_API_APP_FEATURE_LNIC_SUPPORT 64 +#define L2TP_API_APP_FEATURE_LNOC_SUPPORT 128 +#define L2TP_API_APP_FEATURE_LOCAL_STAT_FILE 256 + +struct l2tp_api_app_msg_data { + char *build_date; + char *build_time; + int major; + int minor; + uint32_t cookie; + struct { + u_int patches_len; + int *patches_val; + } patches; + uint32_t features; +}; +typedef struct l2tp_api_app_msg_data l2tp_api_app_msg_data; +#define L2TP_API_CONFIG_FLAG_TRACE_FLAGS 1 +#define L2TP_API_CONFIG_FLAG_MAX_TUNNELS 2 +#define L2TP_API_CONFIG_FLAG_DRAIN_TUNNELS 4 +#define L2TP_API_CONFIG_FLAG_MAX_SESSIONS 8 +#define L2TP_API_CONFIG_FLAG_TUNNEL_ESTABLISH_TIMEOUT 16 +#define L2TP_API_CONFIG_FLAG_SESSION_ESTABLISH_TIMEOUT 32 +#define L2TP_API_CONFIG_FLAG_DENY_LOCAL_TUNNEL_CREATES 64 +#define L2TP_API_CONFIG_FLAG_DENY_REMOTE_TUNNEL_CREATES 128 +#define L2TP_API_CONFIG_FLAG_RESET_STATISTICS 256 +#define L2TP_API_CONFIG_FLAG_TUNNEL_PERSIST_PEND_TIMEOUT 512 +#define L2TP_API_CONFIG_FLAG_SESSION_PERSIST_PEND_TIMEOUT 1024 + +struct l2tp_api_system_config { + uint32_t flags; + int udp_port; + uint32_t trace_flags; + uint32_t trace_flags_mask; + int max_tunnels; + int max_sessions; + int drain_tunnels; + int tunnel_establish_timeout; + int session_establish_timeout; + int tunnel_persist_pend_timeout; + int session_persist_pend_timeout; + bool_t deny_local_tunnel_creates; + bool_t deny_remote_tunnel_creates; +}; +typedef struct l2tp_api_system_config l2tp_api_system_config; + +struct l2tp_api_system_msg_stats { + uint32_t rx; + uint32_t tx; + uint32_t rx_bad; +}; +typedef struct l2tp_api_system_msg_stats l2tp_api_system_msg_stats; +#define L2TP_API_MSG_TYPE_COUNT 17 + +struct l2tp_api_system_stats { + uint32_t short_frames; + uint32_t wrong_version_frames; + uint32_t unexpected_data_frames; + uint32_t bad_rcvd_frames; + uint32_t total_rcvd_control_frames; + uint32_t total_sent_control_frames; + uint32_t total_control_frame_send_fails; + uint32_t total_retransmitted_control_frames; + uint32_t no_control_frame_resources; + uint32_t no_peer_resources; + uint32_t no_tunnel_resources; + uint32_t no_session_resources; + uint32_t no_ppp_resources; + uint32_t too_many_tunnels; + uint32_t too_many_sessions; + uint32_t auth_fails; + uint32_t no_matching_tunnel_id_discards; + uint32_t no_matching_session_id_discards; + uint32_t mismatched_tunnel_ids; + uint32_t mismatched_session_ids; + uint32_t encode_message_fails; + uint32_t tunnel_setup_failures; + uint32_t session_setup_failures; + uint32_t event_queue_full_errors; + uint32_t ignored_avps; + uint32_t vendor_avps; + uint32_t illegal_messages; + uint32_t unsupported_messages; + struct { + u_int messages_len; + struct l2tp_api_system_msg_stats *messages_val; + } messages; +}; +typedef struct l2tp_api_system_stats l2tp_api_system_stats; + +struct l2tp_api_system_status { + struct l2tp_api_system_stats stats; + uint32_t num_tunnels; + uint32_t num_sessions; +}; +typedef struct l2tp_api_system_status l2tp_api_system_status; + +struct l2tp_api_system_msg_data { + struct l2tp_api_system_config config; + struct l2tp_api_system_status status; +}; +typedef struct l2tp_api_system_msg_data l2tp_api_system_msg_data; + +struct l2tp_api_peer_msg_data { + int result_code; + struct l2tp_api_ip_addr peer_addr; + struct l2tp_api_ip_addr local_addr; + int num_tunnels; +}; +typedef struct l2tp_api_peer_msg_data l2tp_api_peer_msg_data; + +struct l2tp_api_peer_list_entry { + struct l2tp_api_ip_addr peer_addr; + struct l2tp_api_ip_addr local_addr; + struct l2tp_api_peer_list_entry *next; +}; +typedef struct l2tp_api_peer_list_entry l2tp_api_peer_list_entry; + +struct l2tp_api_peer_list_msg_data { + int result; + struct l2tp_api_peer_list_entry *peers; +}; +typedef struct l2tp_api_peer_list_msg_data l2tp_api_peer_list_msg_data; +#define L2TP_API_PEER_PROFILE_DEFAULT_PROFILE_NAME "default" +#define L2TP_API_PEER_PROFILE_FLAG_LACLNS 1 +#define L2TP_API_PEER_PROFILE_FLAG_TUNNEL_PROFILE_NAME 2 +#define L2TP_API_PEER_PROFILE_FLAG_SESSION_PROFILE_NAME 4 +#define L2TP_API_PEER_PROFILE_FLAG_PPP_PROFILE_NAME 8 +#define L2TP_API_PEER_PROFILE_FLAG_PEER_IPADDR 16 +#define L2TP_API_PEER_PROFILE_FLAG_PEER_PORT 32 +#define L2TP_API_PEER_PROFILE_FLAG_NETMASK 64 + +struct l2tp_api_peer_profile_msg_data { + uint32_t flags; + int result_code; + struct l2tp_api_ip_addr peer_addr; + uint16_t peer_port; + bool_t we_can_be_lac; + bool_t we_can_be_lns; + char *profile_name; + optstring default_tunnel_profile_name; + optstring default_session_profile_name; + optstring default_ppp_profile_name; + struct l2tp_api_ip_addr netmask; + int use_count; +}; +typedef struct l2tp_api_peer_profile_msg_data l2tp_api_peer_profile_msg_data; + +struct l2tp_api_peer_profile_list_entry { + char *profile_name; + struct l2tp_api_peer_profile_list_entry *next; +}; +typedef struct l2tp_api_peer_profile_list_entry l2tp_api_peer_profile_list_entry; + +struct l2tp_api_peer_profile_list_msg_data { + int result; + int num_profiles; + struct l2tp_api_peer_profile_list_entry *profiles; +}; +typedef struct l2tp_api_peer_profile_list_msg_data l2tp_api_peer_profile_list_msg_data; + +struct l2tp_api_peer_profile_unset_msg_data { + uint32_t flags; + int result_code; + char *profile_name; +}; +typedef struct l2tp_api_peer_profile_unset_msg_data l2tp_api_peer_profile_unset_msg_data; + +struct l2tp_api_tunnel_peer { + bool_t framing_cap_sync; + bool_t framing_cap_async; + bool_t bearer_cap_digital; + bool_t bearer_cap_analog; + uint8_t protocol_version_ver; + uint8_t protocol_version_rev; + uint16_t rx_window_size; + uint16_t firmware_revision; + optstring host_name; + optstring vendor_name; + struct { + u_int tiebreaker_len; + uint8_t *tiebreaker_val; + } tiebreaker; + uint16_t result_code_result; + uint16_t result_code_error; + optstring result_code_message; +}; +typedef struct l2tp_api_tunnel_peer l2tp_api_tunnel_peer; + +struct l2tp_api_tunnel_stats { + uint32_t retransmits; + uint32_t tx_zlbs; + uint32_t tx_zlb_fails; + uint32_t rx_zlbs; + uint32_t data_pkt_discards; + uint32_t duplicate_pkt_discards; + uint32_t rx_hellos; + uint32_t tx_hellos; + uint32_t tx_hello_fails; + uint16_t ns; + uint16_t nr; + uint16_t peer_ns; + uint16_t peer_nr; + uint16_t cwnd; + uint16_t ssthresh; + uint16_t congpkt_acc; + uint64_t control_rx_packets; + uint64_t control_rx_bytes; + uint64_t control_rx_oos_packets; + uint64_t control_rx_oos_discards; + uint64_t control_tx_packets; + uint64_t control_tx_bytes; + uint64_t data_rx_packets; + uint64_t data_rx_bytes; + uint64_t data_rx_errors; + uint64_t data_rx_oos_packets; + uint64_t data_rx_oos_discards; + uint64_t data_tx_packets; + uint64_t data_tx_bytes; + uint64_t data_tx_errors; + bool_t using_ipsec; +}; +typedef struct l2tp_api_tunnel_stats l2tp_api_tunnel_stats; +#define L2TP_API_TUNNEL_FLAG_HIDE_AVPS 1 +#define L2TP_API_TUNNEL_FLAG_OUR_ADDR 2 +#define L2TP_API_TUNNEL_FLAG_PEER_ADDR 4 +#define L2TP_API_TUNNEL_FLAG_CONFIG_ID 8 +#define L2TP_API_TUNNEL_FLAG_OUR_UDP_PORT 16 +#define L2TP_API_TUNNEL_FLAG_AUTH_MODE 32 +#define L2TP_API_TUNNEL_FLAG_FRAMING_CAP 64 +#define L2TP_API_TUNNEL_FLAG_BEARER_CAP 128 +#define L2TP_API_TUNNEL_FLAG_USE_TIEBREAKER 256 +#define L2TP_API_TUNNEL_FLAG_PERSIST 512 +#define L2TP_API_TUNNEL_FLAG_HELLO_TIMEOUT 1024 +#define L2TP_API_TUNNEL_FLAG_MAX_RETRIES 2048 +#define L2TP_API_TUNNEL_FLAG_RX_WINDOW_SIZE 4096 +#define L2TP_API_TUNNEL_FLAG_TX_WINDOW_SIZE 8192 +#define L2TP_API_TUNNEL_FLAG_RETRY_TIMEOUT 16384 +#define L2TP_API_TUNNEL_FLAG_IDLE_TIMEOUT 32768 +#define L2TP_API_TUNNEL_FLAG_PEER_UDP_PORT 65536 +#define L2TP_API_TUNNEL_FLAG_SECRET 131072 +#define L2TP_API_TUNNEL_FLAG_ALLOW_PPP_PROXY 262144 +#define L2TP_API_TUNNEL_FLAG_TRACE_FLAGS 524288 +#define L2TP_API_TUNNEL_FLAG_USE_UDP_CHECKSUMS 1048576 +#define L2TP_API_TUNNEL_FLAG_HOST_NAME 2097152 +#define L2TP_API_TUNNEL_FLAG_TUNNEL_ID 4194304 +#define L2TP_API_TUNNEL_FLAG_PROFILE_NAME 8388608 +#define L2TP_API_TUNNEL_FLAG_MAX_SESSIONS 16777216 +#define L2TP_API_TUNNEL_FLAG_TUNNEL_NAME 33554432 +#define L2TP_API_TUNNEL_FLAG_UNUSED_2 67108864 +#define L2TP_API_TUNNEL_FLAG_PEER_PROFILE_NAME 134217728 +#define L2TP_API_TUNNEL_FLAG_SESSION_PROFILE_NAME 268435456 +#define L2TP_API_TUNNEL_FLAG_PPP_PROFILE_NAME 536870912 +#define L2TP_API_TUNNEL_FLAG_DO_PMTU_DISCOVERY 1073741824 +#define L2TP_API_TUNNEL_FLAG_MTU 2147483648 +#define L2TP_API_TUNNEL_FLAG_INTERFACE_NAME 1 + +struct l2tp_api_tunnel_msg_data { + uint32_t flags; + uint32_t flags2; + uint16_t tunnel_id; + uint16_t peer_tunnel_id; + int result_code; + int hide_avps; + optstring tunnel_name; + struct l2tp_api_ip_addr our_addr; + struct l2tp_api_ip_addr peer_addr; + uint16_t our_udp_port; + uint16_t peer_udp_port; + int config_id; + enum l2tp_api_tunnel_auth_mode auth_mode; + bool_t framing_cap_sync; + bool_t framing_cap_async; + bool_t bearer_cap_digital; + bool_t bearer_cap_analog; + bool_t use_tiebreaker; + bool_t allow_ppp_proxy; + bool_t use_udp_checksums; + bool_t created_by_admin; + optstring create_time; + int max_sessions; + int num_sessions; + int use_count; + int num_establish_retries; + enum l2tp_api_tunnel_mode mode; + int hello_timeout; + int max_retries; + uint16_t rx_window_size; + uint16_t tx_window_size; + uint16_t actual_tx_window_size; + int retry_timeout; + int idle_timeout; + uint32_t trace_flags; + uint32_t trace_flags_mask; + bool_t do_pmtu_discovery; + bool_t persist; + int mtu; + optstring state; + optstring secret; + optstring host_name; + optstring tunnel_profile_name; + optstring peer_profile_name; + optstring session_profile_name; + optstring ppp_profile_name; + optstring interface_name; + struct { + u_int tiebreaker_len; + uint8_t *tiebreaker_val; + } tiebreaker; + uint16_t result_code_result; + uint16_t result_code_error; + optstring result_code_message; + struct l2tp_api_tunnel_peer peer; + struct l2tp_api_tunnel_stats stats; +}; +typedef struct l2tp_api_tunnel_msg_data l2tp_api_tunnel_msg_data; + +struct l2tp_api_tunnel_list_msg_data { + int result; + struct { + u_int tunnel_ids_len; + uint16_t *tunnel_ids_val; + } tunnel_ids; +}; +typedef struct l2tp_api_tunnel_list_msg_data l2tp_api_tunnel_list_msg_data; +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_PROFILE_NAME "default" +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_AUTH_MODE L2TP_API_TUNNEL_AUTH_MODE_NONE +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_FRAMING_CAP_SYNC 1 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_FRAMING_CAP_ASYNC 1 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_BEARER_CAP_DIGITAL 1 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_BEARER_CAP_ANALOG 1 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_USE_TIEBREAKER 0 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_HELLO_TIMEOUT 60 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_MAX_RETRIES 5 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_RX_WINDOW_SIZE 10 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_TX_WINDOW_SIZE 10 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_RETRY_TIMEOUT 1 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_IDLE_TIMEOUT 0 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_ZLB_TIMEOUT 5 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_TRACE_FLAGS 0 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_ALLOW_PPP_PROXY 0 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_USE_UDP_CHECKSUMS 1 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_DO_PMTU_DISCOVERY 0 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_MTU 1460 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_HIDE_AVPS 0 +#define L2TP_API_TUNNEL_PROFILE_DEFAULT_MAX_SESSIONS 0 +#define L2TP_API_TUNNEL_PROFILE_FLAG_HIDE_AVPS 1 +#define L2TP_API_TUNNEL_PROFILE_FLAG_AUTH_MODE 2 +#define L2TP_API_TUNNEL_PROFILE_FLAG_FRAMING_CAP 4 +#define L2TP_API_TUNNEL_PROFILE_FLAG_BEARER_CAP 8 +#define L2TP_API_TUNNEL_PROFILE_FLAG_USE_TIEBREAKER 16 +#define L2TP_API_TUNNEL_PROFILE_FLAG_UNUSED_1 32 +#define L2TP_API_TUNNEL_PROFILE_FLAG_HELLO_TIMEOUT 64 +#define L2TP_API_TUNNEL_PROFILE_FLAG_MAX_RETRIES 128 +#define L2TP_API_TUNNEL_PROFILE_FLAG_RX_WINDOW_SIZE 256 +#define L2TP_API_TUNNEL_PROFILE_FLAG_TX_WINDOW_SIZE 512 +#define L2TP_API_TUNNEL_PROFILE_FLAG_RETRY_TIMEOUT 1024 +#define L2TP_API_TUNNEL_PROFILE_FLAG_IDLE_TIMEOUT 2048 +#define L2TP_API_TUNNEL_PROFILE_FLAG_SECRET 4096 +#define L2TP_API_TUNNEL_PROFILE_FLAG_ALLOW_PPP_PROXY 8192 +#define L2TP_API_TUNNEL_PROFILE_FLAG_TRACE_FLAGS 16384 +#define L2TP_API_TUNNEL_PROFILE_FLAG_USE_UDP_CHECKSUMS 32768 +#define L2TP_API_TUNNEL_PROFILE_FLAG_HOST_NAME 65536 +#define L2TP_API_TUNNEL_PROFILE_FLAG_MAX_SESSIONS 131072 +#define L2TP_API_TUNNEL_PROFILE_FLAG_OUR_ADDR 262144 +#define L2TP_API_TUNNEL_PROFILE_FLAG_PEER_ADDR 524288 +#define L2TP_API_TUNNEL_PROFILE_FLAG_OUR_UDP_PORT 1048576 +#define L2TP_API_TUNNEL_PROFILE_FLAG_PEER_UDP_PORT 2097152 +#define L2TP_API_TUNNEL_PROFILE_FLAG_UNUSED_2 4194304 +#define L2TP_API_TUNNEL_PROFILE_FLAG_PEER_PROFILE_NAME 8388608 +#define L2TP_API_TUNNEL_PROFILE_FLAG_SESSION_PROFILE_NAME 16777216 +#define L2TP_API_TUNNEL_PROFILE_FLAG_PPP_PROFILE_NAME 33554432 +#define L2TP_API_TUNNEL_PROFILE_FLAG_DO_PMTU_DISCOVERY 67108864 +#define L2TP_API_TUNNEL_PROFILE_FLAG_MTU 134217728 + +struct l2tp_api_tunnel_profile_msg_data { + uint32_t flags; + char *profile_name; + int result_code; + int hide_avps; + enum l2tp_api_tunnel_auth_mode auth_mode; + bool_t framing_cap_sync; + bool_t framing_cap_async; + bool_t bearer_cap_digital; + bool_t bearer_cap_analog; + bool_t use_tiebreaker; + bool_t allow_ppp_proxy; + bool_t use_udp_checksums; + int hello_timeout; + int max_retries; + uint16_t rx_window_size; + uint16_t tx_window_size; + int retry_timeout; + int idle_timeout; + uint32_t trace_flags; + uint32_t trace_flags_mask; + int max_sessions; + struct l2tp_api_ip_addr our_addr; + struct l2tp_api_ip_addr peer_addr; + uint16_t our_udp_port; + uint16_t peer_udp_port; + bool_t do_pmtu_discovery; + int mtu; + optstring peer_profile_name; + optstring session_profile_name; + optstring ppp_profile_name; + optstring secret; + optstring host_name; +}; +typedef struct l2tp_api_tunnel_profile_msg_data l2tp_api_tunnel_profile_msg_data; + +struct l2tp_api_tunnel_profile_list_entry { + char *profile_name; + struct l2tp_api_tunnel_profile_list_entry *next; +}; +typedef struct l2tp_api_tunnel_profile_list_entry l2tp_api_tunnel_profile_list_entry; + +struct l2tp_api_tunnel_profile_list_msg_data { + int result; + int num_profiles; + struct l2tp_api_tunnel_profile_list_entry *profiles; +}; +typedef struct l2tp_api_tunnel_profile_list_msg_data l2tp_api_tunnel_profile_list_msg_data; + +struct l2tp_api_tunnel_profile_unset_msg_data { + uint32_t flags; + int result_code; + char *profile_name; +}; +typedef struct l2tp_api_tunnel_profile_unset_msg_data l2tp_api_tunnel_profile_unset_msg_data; +#define L2TP_API_SESSION_DEFAULT_SESSION_TYPE L2TP_API_SESSION_TYPE_UNSPECIFIED +#define L2TP_API_SESSION_FLAG_TRACE_FLAGS 1 +#define L2TP_API_SESSION_FLAG_SEQUENCING_REQUIRED 2 +#define L2TP_API_SESSION_FLAG_PPP_PROFILE_NAME 4 +#define L2TP_API_SESSION_FLAG_SESSION_TYPE 8 +#define L2TP_API_SESSION_FLAG_PRIV_GROUP_ID 16 +#define L2TP_API_SESSION_FLAG_FRAMING_TYPE 32 +#define L2TP_API_SESSION_FLAG_BEARER_TYPE 64 +#define L2TP_API_SESSION_FLAG_MINIMUM_BPS 128 +#define L2TP_API_SESSION_FLAG_MAXIMUM_BPS 256 +#define L2TP_API_SESSION_FLAG_CONNECT_SPEED 512 +#define L2TP_API_SESSION_FLAG_USE_PPP_PROXY 1024 +#define L2TP_API_SESSION_FLAG_PROXY_AUTH_TYPE 8192 +#define L2TP_API_SESSION_FLAG_PROXY_AUTH_NAME 16384 +#define L2TP_API_SESSION_FLAG_PROXY_AUTH_CHALLENGE 32768 +#define L2TP_API_SESSION_FLAG_PROXY_AUTH_RESPONSE 65536 +#define L2TP_API_SESSION_FLAG_CALLING_NUMBER 131072 +#define L2TP_API_SESSION_FLAG_CALLED_NUMBER 262144 +#define L2TP_API_SESSION_FLAG_SUB_ADDRESS 524288 +#define L2TP_API_SESSION_FLAG_INITIAL_RCVD_LCP_CONFREQ 1048576 +#define L2TP_API_SESSION_FLAG_LAST_SENT_LCP_CONFREQ 2097152 +#define L2TP_API_SESSION_FLAG_LAST_RCVD_LCP_CONFREQ 4194304 +#define L2TP_API_SESSION_FLAG_USER_NAME 8388608 +#define L2TP_API_SESSION_FLAG_USER_PASSWORD 16777216 +#define L2TP_API_SESSION_FLAG_USE_SEQUENCE_NUMBERS 33554432 +#define L2TP_API_SESSION_FLAG_REORDER_TIMEOUT 67108864 +#define L2TP_API_SESSION_FLAG_TUNNEL_NAME 134217728 +#define L2TP_API_SESSION_FLAG_SESSION_NAME 268435456 +#define L2TP_API_SESSION_FLAG_INTERFACE_NAME 536870912 +#define L2TP_API_SESSION_FLAG_PROFILE_NAME 1073741824 +#define L2TP_API_SESSION_FLAG_NO_PPP 2147483648 + +enum l2tp_api_session_proxy_auth_type { + L2TP_API_SESSION_PROXY_AUTH_TYPE_RESERVED = 0, + L2TP_API_SESSION_PROXY_AUTH_TYPE_PLAIN_TEXT = 1, + L2TP_API_SESSION_PROXY_AUTH_TYPE_PPP_CHAP = 2, + L2TP_API_SESSION_PROXY_AUTH_TYPE_PPP_PAP = 3, + L2TP_API_SESSION_PROXY_AUTH_TYPE_NO_AUTH = 4, + L2TP_API_SESSION_PROXY_AUTH_TYPE_PPP_MSCHAPV1 = 5, +}; +typedef enum l2tp_api_session_proxy_auth_type l2tp_api_session_proxy_auth_type; + +struct l2tp_api_session_call_errors { + uint32_t crc_errors; + uint32_t framing_errors; + uint32_t hardware_overruns; + uint32_t buffer_overruns; + uint32_t timeout_errors; + uint32_t alignment_errors; +}; +typedef struct l2tp_api_session_call_errors l2tp_api_session_call_errors; + +struct l2tp_api_session_stats { + uint64_t data_rx_packets; + uint64_t data_rx_bytes; + uint64_t data_rx_errors; + uint64_t data_rx_oos_packets; + uint64_t data_rx_oos_discards; + uint64_t data_tx_packets; + uint64_t data_tx_bytes; + uint64_t data_tx_errors; +}; +typedef struct l2tp_api_session_stats l2tp_api_session_stats; + +struct l2tp_api_session_peer_info { + uint16_t result_code; + uint16_t error_code; + optstring error_message; + uint32_t minimum_bps; + uint32_t maximum_bps; + uint32_t connect_speed; + uint32_t rx_connect_speed; + enum l2tp_api_session_proxy_auth_type proxy_auth_type; + uint8_t proxy_auth_id; + optstring proxy_auth_name; + struct { + u_int proxy_auth_challenge_len; + uint8_t *proxy_auth_challenge_val; + } proxy_auth_challenge; + struct { + u_int proxy_auth_response_len; + uint8_t *proxy_auth_response_val; + } proxy_auth_response; + optstring private_group_id; + bool_t framing_type_sync; + bool_t framing_type_async; + bool_t bearer_type_digital; + bool_t bearer_type_analog; + bool_t sequencing_required; + uint32_t call_serial_number; + uint32_t physical_channel_id; + struct { + u_int initial_rcvd_lcp_confreq_len; + uint8_t *initial_rcvd_lcp_confreq_val; + } initial_rcvd_lcp_confreq; + struct { + u_int last_sent_lcp_confreq_len; + uint8_t *last_sent_lcp_confreq_val; + } last_sent_lcp_confreq; + struct { + u_int last_rcvd_lcp_confreq_len; + uint8_t *last_rcvd_lcp_confreq_val; + } last_rcvd_lcp_confreq; + optstring calling_number; + optstring called_number; + optstring sub_address; + uint16_t q931_cause_code; + uint16_t q931_cause_msg; + optstring q931_advisory_msg; + struct l2tp_api_session_call_errors call_errors; + uint32_t send_accm; + uint32_t recv_accm; +}; +typedef struct l2tp_api_session_peer_info l2tp_api_session_peer_info; + +enum l2tp_api_session_type { + L2TP_API_SESSION_TYPE_UNSPECIFIED = 0, + L2TP_API_SESSION_TYPE_LAIC = 1, + L2TP_API_SESSION_TYPE_LAOC = 2, + L2TP_API_SESSION_TYPE_LNIC = 3, + L2TP_API_SESSION_TYPE_LNOC = 4, +}; +typedef enum l2tp_api_session_type l2tp_api_session_type; + +struct l2tp_api_session_msg_data { + uint32_t flags; + uint16_t tunnel_id; + uint16_t session_id; + int result_code; + optstring tunnel_name; + uint16_t peer_session_id; + optstring state; + optstring session_name; + optstring interface_name; + enum l2tp_api_session_type session_type; + optstring user_name; + optstring user_password; + optstring priv_group_id; + optstring profile_name; + bool_t created_by_admin; + optstring create_time; + bool_t no_ppp; + bool_t sequencing_required; + bool_t use_sequence_numbers; + int reorder_timeout; + bool_t framing_type_sync; + bool_t framing_type_async; + bool_t bearer_type_digital; + bool_t bearer_type_analog; + uint32_t call_serial_number; + uint32_t physical_channel_id; + uint32_t trace_flags; + uint32_t trace_flags_mask; + int minimum_bps; + int maximum_bps; + int tx_connect_speed; + int rx_connect_speed; + struct l2tp_api_session_peer_info peer; + optstring ppp_profile_name; + struct l2tp_api_session_stats stats; + bool_t use_ppp_proxy; + enum l2tp_api_session_proxy_auth_type proxy_auth_type; + optstring proxy_auth_name; + struct { + u_int proxy_auth_challenge_len; + uint8_t *proxy_auth_challenge_val; + } proxy_auth_challenge; + struct { + u_int proxy_auth_response_len; + uint8_t *proxy_auth_response_val; + } proxy_auth_response; + optstring calling_number; + optstring called_number; + optstring sub_address; + struct { + u_int initial_rcvd_lcp_confreq_len; + uint8_t *initial_rcvd_lcp_confreq_val; + } initial_rcvd_lcp_confreq; + struct { + u_int last_sent_lcp_confreq_len; + uint8_t *last_sent_lcp_confreq_val; + } last_sent_lcp_confreq; + struct { + u_int last_rcvd_lcp_confreq_len; + uint8_t *last_rcvd_lcp_confreq_val; + } last_rcvd_lcp_confreq; +}; +typedef struct l2tp_api_session_msg_data l2tp_api_session_msg_data; + +struct l2tp_api_session_list_msg_data { + int result; + struct { + u_int session_ids_len; + uint16_t *session_ids_val; + } session_ids; +}; +typedef struct l2tp_api_session_list_msg_data l2tp_api_session_list_msg_data; + +struct l2tp_api_session_incall_msg_data { + int ppp_unit; + char *tunnel_profile_name; + struct l2tp_api_session_msg_data session; +}; +typedef struct l2tp_api_session_incall_msg_data l2tp_api_session_incall_msg_data; +#define L2TP_API_SESSION_PROFILE_DEFAULT_PROFILE_NAME "default" +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_TRACE_FLAGS 0 +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_SEQUENCING_REQUIRED 0 +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_TYPE L2TP_API_SESSION_TYPE_UNSPECIFIED +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_FRAMING_TYPE_SYNC 1 +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_FRAMING_TYPE_ASYNC 1 +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_BEARER_TYPE_ANALOG 1 +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_BEARER_TYPE_DIGITAL 1 +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_MINIMUM_BPS 0 +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_MAXIMUM_BPS 0 +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_TX_CONNECT_SPEED 1000000 +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_RX_CONNECT_SPEED 0 +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_USE_PPP_PROXY FALSE +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_USE_SEQUENCE_NUMBERS FALSE +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_REORDER_TIMEOUT 0 +#define L2TP_API_SESSION_PROFILE_DEFAULT_SESSION_NO_PPP FALSE +#define L2TP_API_SESSION_PROFILE_FLAG_TRACE_FLAGS 1 +#define L2TP_API_SESSION_PROFILE_FLAG_SEQUENCING_REQUIRED 2 +#define L2TP_API_SESSION_PROFILE_FLAG_PPP_PROFILE_NAME 4 +#define L2TP_API_SESSION_PROFILE_FLAG_SESSION_TYPE 8 +#define L2TP_API_SESSION_PROFILE_FLAG_PRIV_GROUP_ID 16 +#define L2TP_API_SESSION_PROFILE_FLAG_FRAMING_TYPE 32 +#define L2TP_API_SESSION_PROFILE_FLAG_BEARER_TYPE 64 +#define L2TP_API_SESSION_PROFILE_FLAG_MINIMUM_BPS 128 +#define L2TP_API_SESSION_PROFILE_FLAG_MAXIMUM_BPS 256 +#define L2TP_API_SESSION_PROFILE_FLAG_CONNECT_SPEED 512 +#define L2TP_API_SESSION_PROFILE_FLAG_USE_PPP_PROXY 1024 +#define L2TP_API_SESSION_PROFILE_FLAG_USE_SEQUENCE_NUMBERS 2048 +#define L2TP_API_SESSION_PROFILE_FLAG_REORDER_TIMEOUT 4096 +#define L2TP_API_SESSION_PROFILE_FLAG_NO_PPP 8192 + +struct l2tp_api_session_profile_msg_data { + uint32_t flags; + int result_code; + char *profile_name; + bool_t sequencing_required; + bool_t use_sequence_numbers; + bool_t no_ppp; + int reorder_timeout; + bool_t do_pmtu_discovery; + int mtu; + int mru; + uint32_t trace_flags; + uint32_t trace_flags_mask; + optstring ppp_profile_name; + enum l2tp_api_session_type session_type; + optstring priv_group_id; + bool_t framing_type_sync; + bool_t framing_type_async; + bool_t bearer_type_digital; + bool_t bearer_type_analog; + int minimum_bps; + int maximum_bps; + int tx_connect_speed; + int rx_connect_speed; + bool_t use_ppp_proxy; +}; +typedef struct l2tp_api_session_profile_msg_data l2tp_api_session_profile_msg_data; + +struct l2tp_api_session_profile_list_entry { + char *profile_name; + struct l2tp_api_session_profile_list_entry *next; +}; +typedef struct l2tp_api_session_profile_list_entry l2tp_api_session_profile_list_entry; + +struct l2tp_api_session_profile_list_msg_data { + int result; + int num_profiles; + struct l2tp_api_session_profile_list_entry *profiles; +}; +typedef struct l2tp_api_session_profile_list_msg_data l2tp_api_session_profile_list_msg_data; + +struct l2tp_api_session_profile_unset_msg_data { + uint32_t flags; + int result_code; + char *profile_name; +}; +typedef struct l2tp_api_session_profile_unset_msg_data l2tp_api_session_profile_unset_msg_data; +#define L2TP_API_PPP_PROFILE_FLAG_TRACE_FLAGS 1 +#define L2TP_API_PPP_PROFILE_FLAG_ASYNCMAP 2 +#define L2TP_API_PPP_PROFILE_FLAG_MRU 4 +#define L2TP_API_PPP_PROFILE_FLAG_MTU 8 +#define L2TP_API_PPP_PROFILE_FLAG_USE_RADIUS 32 +#define L2TP_API_PPP_PROFILE_FLAG_RADIUS_HINT 64 +#define L2TP_API_PPP_PROFILE_FLAG_SYNC_MODE 256 +#define L2TP_API_PPP_PROFILE_FLAG_CHAP_INTERVAL 512 +#define L2TP_API_PPP_PROFILE_FLAG_CHAP_MAX_CHALLENGE 1024 +#define L2TP_API_PPP_PROFILE_FLAG_CHAP_RESTART 2048 +#define L2TP_API_PPP_PROFILE_FLAG_PAP_MAX_AUTH_REQUESTS 4096 +#define L2TP_API_PPP_PROFILE_FLAG_PAP_RESTART_INTERVAL 8192 +#define L2TP_API_PPP_PROFILE_FLAG_PAP_TIMEOUT 16384 +#define L2TP_API_PPP_PROFILE_FLAG_IDLE_TIMEOUT 32768 +#define L2TP_API_PPP_PROFILE_FLAG_IPCP_MAX_CONFIG_REQUESTS 65536 +#define L2TP_API_PPP_PROFILE_FLAG_IPCP_MAX_CONFIG_NAKS 131072 +#define L2TP_API_PPP_PROFILE_FLAG_IPCP_MAX_TERMINATE_REQUESTS 262144 +#define L2TP_API_PPP_PROFILE_FLAG_IPCP_RETRANSMIT_INTERVAL 524288 +#define L2TP_API_PPP_PROFILE_FLAG_LCP_ECHO_FAILURE_COUNT 1048576 +#define L2TP_API_PPP_PROFILE_FLAG_LCP_ECHO_INTERVAL 2097152 +#define L2TP_API_PPP_PROFILE_FLAG_LCP_MAX_CONFIG_REQUESTS 4194304 +#define L2TP_API_PPP_PROFILE_FLAG_LCP_MAX_CONFIG_NAKS 8388608 +#define L2TP_API_PPP_PROFILE_FLAG_LCP_MAX_TERMINATE_REQUESTS 16777216 +#define L2TP_API_PPP_PROFILE_FLAG_LCP_RETRANSMIT_INTERVAL 33554432 +#define L2TP_API_PPP_PROFILE_FLAG_MAX_CONNECT_TIME 67108864 +#define L2TP_API_PPP_PROFILE_FLAG_MAX_FAILURE_COUNT 134217728 +#define L2TP_API_PPP_PROFILE_FLAG_DNS_ADDR_1 1 +#define L2TP_API_PPP_PROFILE_FLAG_DNS_ADDR_2 2 +#define L2TP_API_PPP_PROFILE_FLAG_WINS_ADDR_1 4 +#define L2TP_API_PPP_PROFILE_FLAG_WINS_ADDR_2 8 +#define L2TP_API_PPP_PROFILE_FLAG_LOCAL_IP_ADDR 16 +#define L2TP_API_PPP_PROFILE_FLAG_PEER_IP_ADDR 32 +#define L2TP_API_PPP_PROFILE_FLAG_IP_POOL_NAME 64 +#define L2TP_API_PPP_PROFILE_FLAG_USE_AS_DEFAULT_ROUTE 128 +#define L2TP_API_PPP_PROFILE_FLAG_MULTILINK 256 +#define L2TP_API_PPP_PROFILE_FLAG_LOCAL_NAME 512 +#define L2TP_API_PPP_PROFILE_FLAG_REMOTE_NAME 1024 +#define L2TP_API_PPP_PROFILE_FLAG_PROXY_ARP 2048 +#define L2TP_API_PPP_PROFILE_FLAG_AUTH_NONE 4096 +#define L2TP_API_PPP_PROFILE_FLAG_AUTH_REFUSE_EAP 8192 +#define L2TP_API_PPP_PROFILE_FLAG_AUTH_REFUSE_MSCHAPV2 16384 +#define L2TP_API_PPP_PROFILE_FLAG_AUTH_REFUSE_MSCHAP 32768 +#define L2TP_API_PPP_PROFILE_FLAG_AUTH_REFUSE_CHAP 65536 +#define L2TP_API_PPP_PROFILE_FLAG_AUTH_REFUSE_PAP 131072 +#define L2TP_API_PPP_PROFILE_FLAG_AUTH_PEER 262144 +#define L2TP_API_PPP_PROFILE_DEFAULT_PROFILE_NAME "default" +#define L2TP_API_PPP_PROFILE_DEFAULT_TRACE_FLAGS 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_ASYNCMAP 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_MRU 1500 +#define L2TP_API_PPP_PROFILE_DEFAULT_MTU 1500 +#define L2TP_API_PPP_PROFILE_DEFAULT_AUTH_NONE 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_AUTH_PEER 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_AUTH_REFUSE_PAP 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_AUTH_REFUSE_CHAP 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_AUTH_REFUSE_MSCHAP 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_AUTH_REFUSE_MSCHAPV2 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_AUTH_REFUSE_EAP 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_SYNC_MODE L2TP_API_PPP_SYNCMODE_SYNC_ASYNC +#define L2TP_API_PPP_PROFILE_DEFAULT_CHAP_INTERVAL 10 +#define L2TP_API_PPP_PROFILE_DEFAULT_CHAP_MAX_CHALLENGE 10 +#define L2TP_API_PPP_PROFILE_DEFAULT_CHAP_RESTART 3 +#define L2TP_API_PPP_PROFILE_DEFAULT_PAP_MAX_AUTH_REQUESTS 10 +#define L2TP_API_PPP_PROFILE_DEFAULT_PAP_RESTART_INTERVAL 3 +#define L2TP_API_PPP_PROFILE_DEFAULT_PAP_TIMEOUT 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_IDLE_TIMEOUT 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_IPCP_MAX_CONFIG_REQUESTS 10 +#define L2TP_API_PPP_PROFILE_DEFAULT_IPCP_MAX_CONFIG_NAKS 10 +#define L2TP_API_PPP_PROFILE_DEFAULT_IPCP_MAX_TERMINATE_REQUESTS 3 +#define L2TP_API_PPP_PROFILE_DEFAULT_IPCP_RETRANSMIT_INTERVAL 3 +#define L2TP_API_PPP_PROFILE_DEFAULT_LCP_ECHO_FAILURE_COUNT 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_LCP_ECHO_INTERVAL 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_LCP_MAX_CONFIG_REQUESTS 10 +#define L2TP_API_PPP_PROFILE_DEFAULT_LCP_MAX_CONFIG_NAKS 10 +#define L2TP_API_PPP_PROFILE_DEFAULT_LCP_MAX_TERMINATE_REQUESTS 3 +#define L2TP_API_PPP_PROFILE_DEFAULT_LCP_RETRANSMIT_INTERVAL 3 +#define L2TP_API_PPP_PROFILE_DEFAULT_MAX_CONNECT_TIME 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_MAX_FAILURE_COUNT 10 +#define L2TP_API_PPP_PROFILE_DEFAULT_LOCAL_IP_ADDR 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_PEER_IP_ADDR 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_DNS_ADDR_1 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_DNS_ADDR_2 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_WINS_ADDR_1 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_WINS_ADDR_2 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_USE_RADIUS 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_RADIUS_HINT "" +#define L2TP_API_PPP_PROFILE_DEFAULT_USE_AS_DEFAULT_ROUTE 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_MULTILINK 0 +#define L2TP_API_PPP_PROFILE_DEFAULT_PROXY_ARP 0 + +enum l2tp_api_ppp_sync_mode { + L2TP_API_PPP_SYNCMODE_SYNC_ASYNC = 0, + L2TP_API_PPP_SYNCMODE_SYNC = 1, + L2TP_API_PPP_SYNCMODE_ASYNC = 2, +}; +typedef enum l2tp_api_ppp_sync_mode l2tp_api_ppp_sync_mode; + +struct l2tp_api_ppp_profile_msg_data { + uint32_t flags; + uint32_t flags2; + int result_code; + uint32_t trace_flags; + uint32_t trace_flags_mask; + char *profile_name; + uint32_t asyncmap; + uint16_t mru; + uint16_t mtu; + bool_t auth_none; + bool_t auth_peer; + bool_t auth_refuse_pap; + bool_t auth_refuse_chap; + bool_t auth_refuse_mschap; + bool_t auth_refuse_mschapv2; + bool_t auth_refuse_eap; + enum l2tp_api_ppp_sync_mode sync_mode; + int chap_interval; + int chap_max_challenge; + int chap_restart; + int pap_max_auth_requests; + int pap_restart_interval; + int pap_timeout; + int idle_timeout; + int ipcp_max_config_requests; + int ipcp_max_config_naks; + int ipcp_max_terminate_requests; + int ipcp_retransmit_interval; + int lcp_echo_failure_count; + int lcp_echo_interval; + int lcp_max_config_requests; + int lcp_max_config_naks; + int lcp_max_terminate_requests; + int lcp_retransmit_interval; + int max_connect_time; + int max_failure_count; + struct l2tp_api_ip_addr local_ip_addr; + struct l2tp_api_ip_addr peer_ip_addr; + struct l2tp_api_ip_addr dns_addr_1; + struct l2tp_api_ip_addr dns_addr_2; + struct l2tp_api_ip_addr wins_addr_1; + struct l2tp_api_ip_addr wins_addr_2; + optstring ip_pool_name; + bool_t use_radius; + optstring radius_hint; + bool_t use_as_default_route; + bool_t multilink; + optstring local_name; + optstring remote_name; + bool_t proxy_arp; +}; +typedef struct l2tp_api_ppp_profile_msg_data l2tp_api_ppp_profile_msg_data; + +struct l2tp_api_ppp_profile_list_entry { + char *profile_name; + struct l2tp_api_ppp_profile_list_entry *next; +}; +typedef struct l2tp_api_ppp_profile_list_entry l2tp_api_ppp_profile_list_entry; + +struct l2tp_api_ppp_profile_list_msg_data { + int result; + int num_profiles; + struct l2tp_api_ppp_profile_list_entry *profiles; +}; +typedef struct l2tp_api_ppp_profile_list_msg_data l2tp_api_ppp_profile_list_msg_data; + +struct l2tp_api_ppp_profile_unset_msg_data { + uint32_t flags; + uint32_t flags2; + int result_code; + char *profile_name; +}; +typedef struct l2tp_api_ppp_profile_unset_msg_data l2tp_api_ppp_profile_unset_msg_data; + +struct l2tp_api_user_list_entry { + char *user_name; + char *create_time; + bool_t created_by_admin; + uint16_t tunnel_id; + uint16_t session_id; + struct l2tp_api_user_list_entry *next; +}; +typedef struct l2tp_api_user_list_entry l2tp_api_user_list_entry; + +struct l2tp_api_user_list_msg_data { + int result; + int num_users; + struct l2tp_api_user_list_entry *users; +}; +typedef struct l2tp_api_user_list_msg_data l2tp_api_user_list_msg_data; +#define L2TP_API_TEST_FLAG_FAKE_RX_DROP 1 +#define L2TP_API_TEST_FLAG_FAKE_TX_DROP 2 +#define L2TP_API_TEST_FLAG_FAKE_TRIGGER_TYPE 4 +#define L2TP_API_TEST_FLAG_CLEAR_FAKE_TRIGGER 8 +#define L2TP_API_TEST_FLAG_HOLD_TUNNELS 16 +#define L2TP_API_TEST_FLAG_HOLD_SESSIONS 32 +#define L2TP_API_TEST_FLAG_NO_RANDOM_IDS 64 +#define L2TP_API_TEST_FLAG_RESET_IDS 128 +#define L2TP_API_TEST_FLAG_DO_TRANSPORT_TEST 256 +#define L2TP_API_TEST_FLAG_TUNNEL_ID 512 +#define L2TP_API_TEST_FLAG_SESSION_ID 1024 +#define L2TP_API_TEST_FLAG_DEFAULT_CONFIG 2048 +#define L2TP_API_TEST_FLAG_SHOW_PROFILE_USAGE 4096 + +enum l2tp_api_test_trigger_type { + L2TP_API_TEST_FAKE_TRIGGER_OFF = 0, + L2TP_API_TEST_FAKE_TRIGGER_ON = 1, + L2TP_API_TEST_FAKE_TRIGGER_ONCE = 2, + L2TP_API_TEST_FAKE_TRIGGER_LOW = 3, + L2TP_API_TEST_FAKE_TRIGGER_MEDIUM = 4, + L2TP_API_TEST_FAKE_TRIGGER_HIGH = 5, +}; +typedef enum l2tp_api_test_trigger_type l2tp_api_test_trigger_type; + +struct l2tp_api_test_msg_data { + uint32_t flags; + bool_t fake_rx_drop; + bool_t fake_tx_drop; + bool_t fake_trigger_fired; + bool_t hold_tunnels; + bool_t hold_sessions; + bool_t no_random_ids; + bool_t show_profile_usage; + int num_rx_drops; + int num_tx_drops; + enum l2tp_api_test_trigger_type fake_trigger_type; + uint16_t tunnel_id; + uint16_t session_id; + int num_tunnel_id_hash_hits; + int num_tunnel_id_hash_misses; + int num_tunnel_name_hash_hits; + int num_tunnel_name_hash_misses; + int num_session_id_hash_hits; + int num_session_id_hash_misses; +}; +typedef struct l2tp_api_test_msg_data l2tp_api_test_msg_data; + +struct l2tp_tunnel_delete_1_argument { + uint16_t tunnel_id; + optstring tunnel_name; + optstring reason; +}; +typedef struct l2tp_tunnel_delete_1_argument l2tp_tunnel_delete_1_argument; + +struct l2tp_tunnel_get_1_argument { + uint16_t tunnel_id; + optstring tunnel_name; +}; +typedef struct l2tp_tunnel_get_1_argument l2tp_tunnel_get_1_argument; + +struct l2tp_session_delete_1_argument { + uint16_t tunnel_id; + optstring tunnel_name; + uint16_t session_id; + optstring session_name; + optstring reason; +}; +typedef struct l2tp_session_delete_1_argument l2tp_session_delete_1_argument; + +struct l2tp_session_get_1_argument { + uint16_t tunnel_id; + optstring tunnel_name; + uint16_t session_id; + optstring session_name; +}; +typedef struct l2tp_session_get_1_argument l2tp_session_get_1_argument; + +struct l2tp_session_list_1_argument { + uint16_t tunnel_id; + optstring tunnel_name; +}; +typedef struct l2tp_session_list_1_argument l2tp_session_list_1_argument; + +struct l2tp_peer_get_1_argument { + struct l2tp_api_ip_addr local_addr; + struct l2tp_api_ip_addr peer_addr; +}; +typedef struct l2tp_peer_get_1_argument l2tp_peer_get_1_argument; + +#define L2TP_PROG 300773 +#define L2TP_VERSION 1 + +#if defined(__STDC__) || defined(__cplusplus) +#define L2TP_APP_INFO_GET 1 +extern enum clnt_stat l2tp_app_info_get_1(struct l2tp_api_app_msg_data *, CLIENT *); +extern bool_t l2tp_app_info_get_1_svc(struct l2tp_api_app_msg_data *, struct svc_req *); +#define L2TP_SYSTEM_MODIFY 2 +extern enum clnt_stat l2tp_system_modify_1(struct l2tp_api_system_msg_data , int *, CLIENT *); +extern bool_t l2tp_system_modify_1_svc(struct l2tp_api_system_msg_data , int *, struct svc_req *); +#define L2TP_SYSTEM_GET 3 +extern enum clnt_stat l2tp_system_get_1(struct l2tp_api_system_msg_data *, CLIENT *); +extern bool_t l2tp_system_get_1_svc(struct l2tp_api_system_msg_data *, struct svc_req *); +#define L2TP_PEER_PROFILE_CREATE 4 +extern enum clnt_stat l2tp_peer_profile_create_1(struct l2tp_api_peer_profile_msg_data , int *, CLIENT *); +extern bool_t l2tp_peer_profile_create_1_svc(struct l2tp_api_peer_profile_msg_data , int *, struct svc_req *); +#define L2TP_PEER_PROFILE_DELETE 5 +extern enum clnt_stat l2tp_peer_profile_delete_1(char *, int *, CLIENT *); +extern bool_t l2tp_peer_profile_delete_1_svc(char *, int *, struct svc_req *); +#define L2TP_PEER_PROFILE_MODIFY 6 +extern enum clnt_stat l2tp_peer_profile_modify_1(struct l2tp_api_peer_profile_msg_data , int *, CLIENT *); +extern bool_t l2tp_peer_profile_modify_1_svc(struct l2tp_api_peer_profile_msg_data , int *, struct svc_req *); +#define L2TP_PEER_PROFILE_GET 7 +extern enum clnt_stat l2tp_peer_profile_get_1(char *, struct l2tp_api_peer_profile_msg_data *, CLIENT *); +extern bool_t l2tp_peer_profile_get_1_svc(char *, struct l2tp_api_peer_profile_msg_data *, struct svc_req *); +#define L2TP_PEER_PROFILE_LIST 8 +extern enum clnt_stat l2tp_peer_profile_list_1(struct l2tp_api_peer_profile_list_msg_data *, CLIENT *); +extern bool_t l2tp_peer_profile_list_1_svc(struct l2tp_api_peer_profile_list_msg_data *, struct svc_req *); +#define L2TP_TUNNEL_CREATE 9 +extern enum clnt_stat l2tp_tunnel_create_1(struct l2tp_api_tunnel_msg_data , int *, CLIENT *); +extern bool_t l2tp_tunnel_create_1_svc(struct l2tp_api_tunnel_msg_data , int *, struct svc_req *); +#define L2TP_TUNNEL_DELETE 10 +extern enum clnt_stat l2tp_tunnel_delete_1(uint16_t , optstring , optstring , int *, CLIENT *); +extern bool_t l2tp_tunnel_delete_1_svc(uint16_t , optstring , optstring , int *, struct svc_req *); +#define L2TP_TUNNEL_MODIFY 11 +extern enum clnt_stat l2tp_tunnel_modify_1(struct l2tp_api_tunnel_msg_data , int *, CLIENT *); +extern bool_t l2tp_tunnel_modify_1_svc(struct l2tp_api_tunnel_msg_data , int *, struct svc_req *); +#define L2TP_TUNNEL_GET 12 +extern enum clnt_stat l2tp_tunnel_get_1(uint16_t , optstring , struct l2tp_api_tunnel_msg_data *, CLIENT *); +extern bool_t l2tp_tunnel_get_1_svc(uint16_t , optstring , struct l2tp_api_tunnel_msg_data *, struct svc_req *); +#define L2TP_TUNNEL_LIST 13 +extern enum clnt_stat l2tp_tunnel_list_1(struct l2tp_api_tunnel_list_msg_data *, CLIENT *); +extern bool_t l2tp_tunnel_list_1_svc(struct l2tp_api_tunnel_list_msg_data *, struct svc_req *); +#define L2TP_TUNNEL_PROFILE_CREATE 14 +extern enum clnt_stat l2tp_tunnel_profile_create_1(struct l2tp_api_tunnel_profile_msg_data , int *, CLIENT *); +extern bool_t l2tp_tunnel_profile_create_1_svc(struct l2tp_api_tunnel_profile_msg_data , int *, struct svc_req *); +#define L2TP_TUNNEL_PROFILE_DELETE 15 +extern enum clnt_stat l2tp_tunnel_profile_delete_1(char *, int *, CLIENT *); +extern bool_t l2tp_tunnel_profile_delete_1_svc(char *, int *, struct svc_req *); +#define L2TP_TUNNEL_PROFILE_MODIFY 16 +extern enum clnt_stat l2tp_tunnel_profile_modify_1(struct l2tp_api_tunnel_profile_msg_data , int *, CLIENT *); +extern bool_t l2tp_tunnel_profile_modify_1_svc(struct l2tp_api_tunnel_profile_msg_data , int *, struct svc_req *); +#define L2TP_TUNNEL_PROFILE_GET 17 +extern enum clnt_stat l2tp_tunnel_profile_get_1(char *, struct l2tp_api_tunnel_profile_msg_data *, CLIENT *); +extern bool_t l2tp_tunnel_profile_get_1_svc(char *, struct l2tp_api_tunnel_profile_msg_data *, struct svc_req *); +#define L2TP_TUNNEL_PROFILE_LIST 18 +extern enum clnt_stat l2tp_tunnel_profile_list_1(struct l2tp_api_tunnel_profile_list_msg_data *, CLIENT *); +extern bool_t l2tp_tunnel_profile_list_1_svc(struct l2tp_api_tunnel_profile_list_msg_data *, struct svc_req *); +#define L2TP_SESSION_CREATE 19 +extern enum clnt_stat l2tp_session_create_1(struct l2tp_api_session_msg_data , int *, CLIENT *); +extern bool_t l2tp_session_create_1_svc(struct l2tp_api_session_msg_data , int *, struct svc_req *); +#define L2TP_SESSION_DELETE 20 +extern enum clnt_stat l2tp_session_delete_1(uint16_t , optstring , uint16_t , optstring , optstring , int *, CLIENT *); +extern bool_t l2tp_session_delete_1_svc(uint16_t , optstring , uint16_t , optstring , optstring , int *, struct svc_req *); +#define L2TP_SESSION_MODIFY 21 +extern enum clnt_stat l2tp_session_modify_1(struct l2tp_api_session_msg_data , int *, CLIENT *); +extern bool_t l2tp_session_modify_1_svc(struct l2tp_api_session_msg_data , int *, struct svc_req *); +#define L2TP_SESSION_GET 22 +extern enum clnt_stat l2tp_session_get_1(uint16_t , optstring , uint16_t , optstring , struct l2tp_api_session_msg_data *, CLIENT *); +extern bool_t l2tp_session_get_1_svc(uint16_t , optstring , uint16_t , optstring , struct l2tp_api_session_msg_data *, struct svc_req *); +#define L2TP_SESSION_LIST 23 +extern enum clnt_stat l2tp_session_list_1(uint16_t , optstring , struct l2tp_api_session_list_msg_data *, CLIENT *); +extern bool_t l2tp_session_list_1_svc(uint16_t , optstring , struct l2tp_api_session_list_msg_data *, struct svc_req *); +#define L2TP_SESSION_INCALL_IND 24 +extern enum clnt_stat l2tp_session_incall_ind_1(struct l2tp_api_session_incall_msg_data , int *, CLIENT *); +extern bool_t l2tp_session_incall_ind_1_svc(struct l2tp_api_session_incall_msg_data , int *, struct svc_req *); +#define L2TP_SESSION_PROFILE_CREATE 25 +extern enum clnt_stat l2tp_session_profile_create_1(struct l2tp_api_session_profile_msg_data , int *, CLIENT *); +extern bool_t l2tp_session_profile_create_1_svc(struct l2tp_api_session_profile_msg_data , int *, struct svc_req *); +#define L2TP_SESSION_PROFILE_DELETE 26 +extern enum clnt_stat l2tp_session_profile_delete_1(char *, int *, CLIENT *); +extern bool_t l2tp_session_profile_delete_1_svc(char *, int *, struct svc_req *); +#define L2TP_SESSION_PROFILE_MODIFY 27 +extern enum clnt_stat l2tp_session_profile_modify_1(struct l2tp_api_session_profile_msg_data , int *, CLIENT *); +extern bool_t l2tp_session_profile_modify_1_svc(struct l2tp_api_session_profile_msg_data , int *, struct svc_req *); +#define L2TP_SESSION_PROFILE_GET 28 +extern enum clnt_stat l2tp_session_profile_get_1(char *, struct l2tp_api_session_profile_msg_data *, CLIENT *); +extern bool_t l2tp_session_profile_get_1_svc(char *, struct l2tp_api_session_profile_msg_data *, struct svc_req *); +#define L2TP_SESSION_PROFILE_LIST 29 +extern enum clnt_stat l2tp_session_profile_list_1(struct l2tp_api_session_profile_list_msg_data *, CLIENT *); +extern bool_t l2tp_session_profile_list_1_svc(struct l2tp_api_session_profile_list_msg_data *, struct svc_req *); +#define L2TP_PPP_PROFILE_CREATE 30 +extern enum clnt_stat l2tp_ppp_profile_create_1(struct l2tp_api_ppp_profile_msg_data , int *, CLIENT *); +extern bool_t l2tp_ppp_profile_create_1_svc(struct l2tp_api_ppp_profile_msg_data , int *, struct svc_req *); +#define L2TP_PPP_PROFILE_DELETE 31 +extern enum clnt_stat l2tp_ppp_profile_delete_1(char *, int *, CLIENT *); +extern bool_t l2tp_ppp_profile_delete_1_svc(char *, int *, struct svc_req *); +#define L2TP_PPP_PROFILE_MODIFY 32 +extern enum clnt_stat l2tp_ppp_profile_modify_1(struct l2tp_api_ppp_profile_msg_data , int *, CLIENT *); +extern bool_t l2tp_ppp_profile_modify_1_svc(struct l2tp_api_ppp_profile_msg_data , int *, struct svc_req *); +#define L2TP_PPP_PROFILE_GET 33 +extern enum clnt_stat l2tp_ppp_profile_get_1(char *, struct l2tp_api_ppp_profile_msg_data *, CLIENT *); +extern bool_t l2tp_ppp_profile_get_1_svc(char *, struct l2tp_api_ppp_profile_msg_data *, struct svc_req *); +#define L2TP_PPP_PROFILE_LIST 34 +extern enum clnt_stat l2tp_ppp_profile_list_1(struct l2tp_api_ppp_profile_list_msg_data *, CLIENT *); +extern bool_t l2tp_ppp_profile_list_1_svc(struct l2tp_api_ppp_profile_list_msg_data *, struct svc_req *); +#define L2TP_PEER_GET 35 +extern enum clnt_stat l2tp_peer_get_1(struct l2tp_api_ip_addr , struct l2tp_api_ip_addr , struct l2tp_api_peer_msg_data *, CLIENT *); +extern bool_t l2tp_peer_get_1_svc(struct l2tp_api_ip_addr , struct l2tp_api_ip_addr , struct l2tp_api_peer_msg_data *, struct svc_req *); +#define L2TP_PEER_LIST 36 +extern enum clnt_stat l2tp_peer_list_1(struct l2tp_api_peer_list_msg_data *, CLIENT *); +extern bool_t l2tp_peer_list_1_svc(struct l2tp_api_peer_list_msg_data *, struct svc_req *); +#define L2TP_USER_LIST 37 +extern enum clnt_stat l2tp_user_list_1(struct l2tp_api_user_list_msg_data *, CLIENT *); +extern bool_t l2tp_user_list_1_svc(struct l2tp_api_user_list_msg_data *, struct svc_req *); +#define L2TP_PEER_PROFILE_UNSET 38 +extern enum clnt_stat l2tp_peer_profile_unset_1(struct l2tp_api_peer_profile_unset_msg_data , int *, CLIENT *); +extern bool_t l2tp_peer_profile_unset_1_svc(struct l2tp_api_peer_profile_unset_msg_data , int *, struct svc_req *); +#define L2TP_TUNNEL_PROFILE_UNSET 39 +extern enum clnt_stat l2tp_tunnel_profile_unset_1(struct l2tp_api_tunnel_profile_unset_msg_data , int *, CLIENT *); +extern bool_t l2tp_tunnel_profile_unset_1_svc(struct l2tp_api_tunnel_profile_unset_msg_data , int *, struct svc_req *); +#define L2TP_SESSION_PROFILE_UNSET 40 +extern enum clnt_stat l2tp_session_profile_unset_1(struct l2tp_api_session_profile_unset_msg_data , int *, CLIENT *); +extern bool_t l2tp_session_profile_unset_1_svc(struct l2tp_api_session_profile_unset_msg_data , int *, struct svc_req *); +#define L2TP_PPP_PROFILE_UNSET 41 +extern enum clnt_stat l2tp_ppp_profile_unset_1(struct l2tp_api_ppp_profile_unset_msg_data , int *, CLIENT *); +extern bool_t l2tp_ppp_profile_unset_1_svc(struct l2tp_api_ppp_profile_unset_msg_data , int *, struct svc_req *); +#define L2TP_TEST_LOG 97 +extern enum clnt_stat l2tp_test_log_1(char *, int *, CLIENT *); +extern bool_t l2tp_test_log_1_svc(char *, int *, struct svc_req *); +#define L2TP_TEST_MODIFY 98 +extern enum clnt_stat l2tp_test_modify_1(struct l2tp_api_test_msg_data , int *, CLIENT *); +extern bool_t l2tp_test_modify_1_svc(struct l2tp_api_test_msg_data , int *, struct svc_req *); +#define L2TP_TEST_GET 99 +extern enum clnt_stat l2tp_test_get_1(struct l2tp_api_test_msg_data *, CLIENT *); +extern bool_t l2tp_test_get_1_svc(struct l2tp_api_test_msg_data *, struct svc_req *); +extern int l2tp_prog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +#define L2TP_APP_INFO_GET 1 +extern enum clnt_stat l2tp_app_info_get_1(); +extern bool_t l2tp_app_info_get_1_svc(); +#define L2TP_SYSTEM_MODIFY 2 +extern enum clnt_stat l2tp_system_modify_1(); +extern bool_t l2tp_system_modify_1_svc(); +#define L2TP_SYSTEM_GET 3 +extern enum clnt_stat l2tp_system_get_1(); +extern bool_t l2tp_system_get_1_svc(); +#define L2TP_PEER_PROFILE_CREATE 4 +extern enum clnt_stat l2tp_peer_profile_create_1(); +extern bool_t l2tp_peer_profile_create_1_svc(); +#define L2TP_PEER_PROFILE_DELETE 5 +extern enum clnt_stat l2tp_peer_profile_delete_1(); +extern bool_t l2tp_peer_profile_delete_1_svc(); +#define L2TP_PEER_PROFILE_MODIFY 6 +extern enum clnt_stat l2tp_peer_profile_modify_1(); +extern bool_t l2tp_peer_profile_modify_1_svc(); +#define L2TP_PEER_PROFILE_GET 7 +extern enum clnt_stat l2tp_peer_profile_get_1(); +extern bool_t l2tp_peer_profile_get_1_svc(); +#define L2TP_PEER_PROFILE_LIST 8 +extern enum clnt_stat l2tp_peer_profile_list_1(); +extern bool_t l2tp_peer_profile_list_1_svc(); +#define L2TP_TUNNEL_CREATE 9 +extern enum clnt_stat l2tp_tunnel_create_1(); +extern bool_t l2tp_tunnel_create_1_svc(); +#define L2TP_TUNNEL_DELETE 10 +extern enum clnt_stat l2tp_tunnel_delete_1(); +extern bool_t l2tp_tunnel_delete_1_svc(); +#define L2TP_TUNNEL_MODIFY 11 +extern enum clnt_stat l2tp_tunnel_modify_1(); +extern bool_t l2tp_tunnel_modify_1_svc(); +#define L2TP_TUNNEL_GET 12 +extern enum clnt_stat l2tp_tunnel_get_1(); +extern bool_t l2tp_tunnel_get_1_svc(); +#define L2TP_TUNNEL_LIST 13 +extern enum clnt_stat l2tp_tunnel_list_1(); +extern bool_t l2tp_tunnel_list_1_svc(); +#define L2TP_TUNNEL_PROFILE_CREATE 14 +extern enum clnt_stat l2tp_tunnel_profile_create_1(); +extern bool_t l2tp_tunnel_profile_create_1_svc(); +#define L2TP_TUNNEL_PROFILE_DELETE 15 +extern enum clnt_stat l2tp_tunnel_profile_delete_1(); +extern bool_t l2tp_tunnel_profile_delete_1_svc(); +#define L2TP_TUNNEL_PROFILE_MODIFY 16 +extern enum clnt_stat l2tp_tunnel_profile_modify_1(); +extern bool_t l2tp_tunnel_profile_modify_1_svc(); +#define L2TP_TUNNEL_PROFILE_GET 17 +extern enum clnt_stat l2tp_tunnel_profile_get_1(); +extern bool_t l2tp_tunnel_profile_get_1_svc(); +#define L2TP_TUNNEL_PROFILE_LIST 18 +extern enum clnt_stat l2tp_tunnel_profile_list_1(); +extern bool_t l2tp_tunnel_profile_list_1_svc(); +#define L2TP_SESSION_CREATE 19 +extern enum clnt_stat l2tp_session_create_1(); +extern bool_t l2tp_session_create_1_svc(); +#define L2TP_SESSION_DELETE 20 +extern enum clnt_stat l2tp_session_delete_1(); +extern bool_t l2tp_session_delete_1_svc(); +#define L2TP_SESSION_MODIFY 21 +extern enum clnt_stat l2tp_session_modify_1(); +extern bool_t l2tp_session_modify_1_svc(); +#define L2TP_SESSION_GET 22 +extern enum clnt_stat l2tp_session_get_1(); +extern bool_t l2tp_session_get_1_svc(); +#define L2TP_SESSION_LIST 23 +extern enum clnt_stat l2tp_session_list_1(); +extern bool_t l2tp_session_list_1_svc(); +#define L2TP_SESSION_INCALL_IND 24 +extern enum clnt_stat l2tp_session_incall_ind_1(); +extern bool_t l2tp_session_incall_ind_1_svc(); +#define L2TP_SESSION_PROFILE_CREATE 25 +extern enum clnt_stat l2tp_session_profile_create_1(); +extern bool_t l2tp_session_profile_create_1_svc(); +#define L2TP_SESSION_PROFILE_DELETE 26 +extern enum clnt_stat l2tp_session_profile_delete_1(); +extern bool_t l2tp_session_profile_delete_1_svc(); +#define L2TP_SESSION_PROFILE_MODIFY 27 +extern enum clnt_stat l2tp_session_profile_modify_1(); +extern bool_t l2tp_session_profile_modify_1_svc(); +#define L2TP_SESSION_PROFILE_GET 28 +extern enum clnt_stat l2tp_session_profile_get_1(); +extern bool_t l2tp_session_profile_get_1_svc(); +#define L2TP_SESSION_PROFILE_LIST 29 +extern enum clnt_stat l2tp_session_profile_list_1(); +extern bool_t l2tp_session_profile_list_1_svc(); +#define L2TP_PPP_PROFILE_CREATE 30 +extern enum clnt_stat l2tp_ppp_profile_create_1(); +extern bool_t l2tp_ppp_profile_create_1_svc(); +#define L2TP_PPP_PROFILE_DELETE 31 +extern enum clnt_stat l2tp_ppp_profile_delete_1(); +extern bool_t l2tp_ppp_profile_delete_1_svc(); +#define L2TP_PPP_PROFILE_MODIFY 32 +extern enum clnt_stat l2tp_ppp_profile_modify_1(); +extern bool_t l2tp_ppp_profile_modify_1_svc(); +#define L2TP_PPP_PROFILE_GET 33 +extern enum clnt_stat l2tp_ppp_profile_get_1(); +extern bool_t l2tp_ppp_profile_get_1_svc(); +#define L2TP_PPP_PROFILE_LIST 34 +extern enum clnt_stat l2tp_ppp_profile_list_1(); +extern bool_t l2tp_ppp_profile_list_1_svc(); +#define L2TP_PEER_GET 35 +extern enum clnt_stat l2tp_peer_get_1(); +extern bool_t l2tp_peer_get_1_svc(); +#define L2TP_PEER_LIST 36 +extern enum clnt_stat l2tp_peer_list_1(); +extern bool_t l2tp_peer_list_1_svc(); +#define L2TP_USER_LIST 37 +extern enum clnt_stat l2tp_user_list_1(); +extern bool_t l2tp_user_list_1_svc(); +#define L2TP_PEER_PROFILE_UNSET 38 +extern enum clnt_stat l2tp_peer_profile_unset_1(); +extern bool_t l2tp_peer_profile_unset_1_svc(); +#define L2TP_TUNNEL_PROFILE_UNSET 39 +extern enum clnt_stat l2tp_tunnel_profile_unset_1(); +extern bool_t l2tp_tunnel_profile_unset_1_svc(); +#define L2TP_SESSION_PROFILE_UNSET 40 +extern enum clnt_stat l2tp_session_profile_unset_1(); +extern bool_t l2tp_session_profile_unset_1_svc(); +#define L2TP_PPP_PROFILE_UNSET 41 +extern enum clnt_stat l2tp_ppp_profile_unset_1(); +extern bool_t l2tp_ppp_profile_unset_1_svc(); +#define L2TP_TEST_LOG 97 +extern enum clnt_stat l2tp_test_log_1(); +extern bool_t l2tp_test_log_1_svc(); +#define L2TP_TEST_MODIFY 98 +extern enum clnt_stat l2tp_test_modify_1(); +extern bool_t l2tp_test_modify_1_svc(); +#define L2TP_TEST_GET 99 +extern enum clnt_stat l2tp_test_get_1(); +extern bool_t l2tp_test_get_1_svc(); +extern int l2tp_prog_1_freeresult (); +#endif /* K&R C */ + +/* the xdr functions */ + +#if defined(__STDC__) || defined(__cplusplus) +extern bool_t xdr_optstring (XDR *, optstring*); +extern bool_t xdr_l2tp_api_tunnel_auth_mode (XDR *, l2tp_api_tunnel_auth_mode*); +extern bool_t xdr_l2tp_api_tunnel_mode (XDR *, l2tp_api_tunnel_mode*); +extern bool_t xdr_l2tp_api_ip_addr (XDR *, l2tp_api_ip_addr*); +extern bool_t xdr_l2tp_api_app_msg_data (XDR *, l2tp_api_app_msg_data*); +extern bool_t xdr_l2tp_api_system_config (XDR *, l2tp_api_system_config*); +extern bool_t xdr_l2tp_api_system_msg_stats (XDR *, l2tp_api_system_msg_stats*); +extern bool_t xdr_l2tp_api_system_stats (XDR *, l2tp_api_system_stats*); +extern bool_t xdr_l2tp_api_system_status (XDR *, l2tp_api_system_status*); +extern bool_t xdr_l2tp_api_system_msg_data (XDR *, l2tp_api_system_msg_data*); +extern bool_t xdr_l2tp_api_peer_msg_data (XDR *, l2tp_api_peer_msg_data*); +extern bool_t xdr_l2tp_api_peer_list_entry (XDR *, l2tp_api_peer_list_entry*); +extern bool_t xdr_l2tp_api_peer_list_msg_data (XDR *, l2tp_api_peer_list_msg_data*); +extern bool_t xdr_l2tp_api_peer_profile_msg_data (XDR *, l2tp_api_peer_profile_msg_data*); +extern bool_t xdr_l2tp_api_peer_profile_list_entry (XDR *, l2tp_api_peer_profile_list_entry*); +extern bool_t xdr_l2tp_api_peer_profile_list_msg_data (XDR *, l2tp_api_peer_profile_list_msg_data*); +extern bool_t xdr_l2tp_api_peer_profile_unset_msg_data (XDR *, l2tp_api_peer_profile_unset_msg_data*); +extern bool_t xdr_l2tp_api_tunnel_peer (XDR *, l2tp_api_tunnel_peer*); +extern bool_t xdr_l2tp_api_tunnel_stats (XDR *, l2tp_api_tunnel_stats*); +extern bool_t xdr_l2tp_api_tunnel_msg_data (XDR *, l2tp_api_tunnel_msg_data*); +extern bool_t xdr_l2tp_api_tunnel_list_msg_data (XDR *, l2tp_api_tunnel_list_msg_data*); +extern bool_t xdr_l2tp_api_tunnel_profile_msg_data (XDR *, l2tp_api_tunnel_profile_msg_data*); +extern bool_t xdr_l2tp_api_tunnel_profile_list_entry (XDR *, l2tp_api_tunnel_profile_list_entry*); +extern bool_t xdr_l2tp_api_tunnel_profile_list_msg_data (XDR *, l2tp_api_tunnel_profile_list_msg_data*); +extern bool_t xdr_l2tp_api_tunnel_profile_unset_msg_data (XDR *, l2tp_api_tunnel_profile_unset_msg_data*); +extern bool_t xdr_l2tp_api_session_proxy_auth_type (XDR *, l2tp_api_session_proxy_auth_type*); +extern bool_t xdr_l2tp_api_session_call_errors (XDR *, l2tp_api_session_call_errors*); +extern bool_t xdr_l2tp_api_session_stats (XDR *, l2tp_api_session_stats*); +extern bool_t xdr_l2tp_api_session_peer_info (XDR *, l2tp_api_session_peer_info*); +extern bool_t xdr_l2tp_api_session_type (XDR *, l2tp_api_session_type*); +extern bool_t xdr_l2tp_api_session_msg_data (XDR *, l2tp_api_session_msg_data*); +extern bool_t xdr_l2tp_api_session_list_msg_data (XDR *, l2tp_api_session_list_msg_data*); +extern bool_t xdr_l2tp_api_session_incall_msg_data (XDR *, l2tp_api_session_incall_msg_data*); +extern bool_t xdr_l2tp_api_session_profile_msg_data (XDR *, l2tp_api_session_profile_msg_data*); +extern bool_t xdr_l2tp_api_session_profile_list_entry (XDR *, l2tp_api_session_profile_list_entry*); +extern bool_t xdr_l2tp_api_session_profile_list_msg_data (XDR *, l2tp_api_session_profile_list_msg_data*); +extern bool_t xdr_l2tp_api_session_profile_unset_msg_data (XDR *, l2tp_api_session_profile_unset_msg_data*); +extern bool_t xdr_l2tp_api_ppp_sync_mode (XDR *, l2tp_api_ppp_sync_mode*); +extern bool_t xdr_l2tp_api_ppp_profile_msg_data (XDR *, l2tp_api_ppp_profile_msg_data*); +extern bool_t xdr_l2tp_api_ppp_profile_list_entry (XDR *, l2tp_api_ppp_profile_list_entry*); +extern bool_t xdr_l2tp_api_ppp_profile_list_msg_data (XDR *, l2tp_api_ppp_profile_list_msg_data*); +extern bool_t xdr_l2tp_api_ppp_profile_unset_msg_data (XDR *, l2tp_api_ppp_profile_unset_msg_data*); +extern bool_t xdr_l2tp_api_user_list_entry (XDR *, l2tp_api_user_list_entry*); +extern bool_t xdr_l2tp_api_user_list_msg_data (XDR *, l2tp_api_user_list_msg_data*); +extern bool_t xdr_l2tp_api_test_trigger_type (XDR *, l2tp_api_test_trigger_type*); +extern bool_t xdr_l2tp_api_test_msg_data (XDR *, l2tp_api_test_msg_data*); +extern bool_t xdr_l2tp_tunnel_delete_1_argument (XDR *, l2tp_tunnel_delete_1_argument*); +extern bool_t xdr_l2tp_tunnel_get_1_argument (XDR *, l2tp_tunnel_get_1_argument*); +extern bool_t xdr_l2tp_session_delete_1_argument (XDR *, l2tp_session_delete_1_argument*); +extern bool_t xdr_l2tp_session_get_1_argument (XDR *, l2tp_session_get_1_argument*); +extern bool_t xdr_l2tp_session_list_1_argument (XDR *, l2tp_session_list_1_argument*); +extern bool_t xdr_l2tp_peer_get_1_argument (XDR *, l2tp_peer_get_1_argument*); + +#else /* K&R C */ +extern bool_t xdr_optstring (); +extern bool_t xdr_l2tp_api_tunnel_auth_mode (); +extern bool_t xdr_l2tp_api_tunnel_mode (); +extern bool_t xdr_l2tp_api_ip_addr (); +extern bool_t xdr_l2tp_api_app_msg_data (); +extern bool_t xdr_l2tp_api_system_config (); +extern bool_t xdr_l2tp_api_system_msg_stats (); +extern bool_t xdr_l2tp_api_system_stats (); +extern bool_t xdr_l2tp_api_system_status (); +extern bool_t xdr_l2tp_api_system_msg_data (); +extern bool_t xdr_l2tp_api_peer_msg_data (); +extern bool_t xdr_l2tp_api_peer_list_entry (); +extern bool_t xdr_l2tp_api_peer_list_msg_data (); +extern bool_t xdr_l2tp_api_peer_profile_msg_data (); +extern bool_t xdr_l2tp_api_peer_profile_list_entry (); +extern bool_t xdr_l2tp_api_peer_profile_list_msg_data (); +extern bool_t xdr_l2tp_api_peer_profile_unset_msg_data (); +extern bool_t xdr_l2tp_api_tunnel_peer (); +extern bool_t xdr_l2tp_api_tunnel_stats (); +extern bool_t xdr_l2tp_api_tunnel_msg_data (); +extern bool_t xdr_l2tp_api_tunnel_list_msg_data (); +extern bool_t xdr_l2tp_api_tunnel_profile_msg_data (); +extern bool_t xdr_l2tp_api_tunnel_profile_list_entry (); +extern bool_t xdr_l2tp_api_tunnel_profile_list_msg_data (); +extern bool_t xdr_l2tp_api_tunnel_profile_unset_msg_data (); +extern bool_t xdr_l2tp_api_session_proxy_auth_type (); +extern bool_t xdr_l2tp_api_session_call_errors (); +extern bool_t xdr_l2tp_api_session_stats (); +extern bool_t xdr_l2tp_api_session_peer_info (); +extern bool_t xdr_l2tp_api_session_type (); +extern bool_t xdr_l2tp_api_session_msg_data (); +extern bool_t xdr_l2tp_api_session_list_msg_data (); +extern bool_t xdr_l2tp_api_session_incall_msg_data (); +extern bool_t xdr_l2tp_api_session_profile_msg_data (); +extern bool_t xdr_l2tp_api_session_profile_list_entry (); +extern bool_t xdr_l2tp_api_session_profile_list_msg_data (); +extern bool_t xdr_l2tp_api_session_profile_unset_msg_data (); +extern bool_t xdr_l2tp_api_ppp_sync_mode (); +extern bool_t xdr_l2tp_api_ppp_profile_msg_data (); +extern bool_t xdr_l2tp_api_ppp_profile_list_entry (); +extern bool_t xdr_l2tp_api_ppp_profile_list_msg_data (); +extern bool_t xdr_l2tp_api_ppp_profile_unset_msg_data (); +extern bool_t xdr_l2tp_api_user_list_entry (); +extern bool_t xdr_l2tp_api_user_list_msg_data (); +extern bool_t xdr_l2tp_api_test_trigger_type (); +extern bool_t xdr_l2tp_api_test_msg_data (); +extern bool_t xdr_l2tp_tunnel_delete_1_argument (); +extern bool_t xdr_l2tp_tunnel_get_1_argument (); +extern bool_t xdr_l2tp_session_delete_1_argument (); +extern bool_t xdr_l2tp_session_get_1_argument (); +extern bool_t xdr_l2tp_session_list_1_argument (); +extern bool_t xdr_l2tp_peer_get_1_argument (); + +#endif /* K&R C */ + +#ifdef __cplusplus +} +#endif + +#endif /* !_L2TP_RPC_H_RPCGEN */ diff --git a/net/openl2tp/src/l2tp_rpc_client.c b/net/openl2tp/src/l2tp_rpc_client.c new file mode 100644 index 0000000..2acec51 --- /dev/null +++ b/net/openl2tp/src/l2tp_rpc_client.c @@ -0,0 +1,426 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include /* for memset */ +#include "l2tp_rpc.h" +#define OPTSTRING(_var) _var.optstring_u.value +#define OPTSTRING_PTR(_var) ((_var.valid == 1) ? _var.optstring_u.value : NULL) + +/* Default timeout can be changed using clnt_control() */ +static struct timeval TIMEOUT = { 25, 0 }; + +enum clnt_stat +l2tp_app_info_get_1(struct l2tp_api_app_msg_data *clnt_res, CLIENT *clnt) +{ + return (clnt_call (clnt, L2TP_APP_INFO_GET, (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_l2tp_api_app_msg_data, (caddr_t) clnt_res, + TIMEOUT)); + +} + +enum clnt_stat +l2tp_system_modify_1(struct l2tp_api_system_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_SYSTEM_MODIFY, + (xdrproc_t) xdr_l2tp_api_system_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_system_get_1(struct l2tp_api_system_msg_data *clnt_res, CLIENT *clnt) +{ + return (clnt_call (clnt, L2TP_SYSTEM_GET, (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_l2tp_api_system_msg_data, (caddr_t) clnt_res, + TIMEOUT)); + +} + +enum clnt_stat +l2tp_peer_profile_create_1(struct l2tp_api_peer_profile_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_PEER_PROFILE_CREATE, + (xdrproc_t) xdr_l2tp_api_peer_profile_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_peer_profile_delete_1(char *name, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_PEER_PROFILE_DELETE, + (xdrproc_t) xdr_wrapstring, (caddr_t) &name, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_peer_profile_modify_1(struct l2tp_api_peer_profile_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_PEER_PROFILE_MODIFY, + (xdrproc_t) xdr_l2tp_api_peer_profile_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_peer_profile_get_1(char *name, struct l2tp_api_peer_profile_msg_data *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_PEER_PROFILE_GET, + (xdrproc_t) xdr_wrapstring, (caddr_t) &name, + (xdrproc_t) xdr_l2tp_api_peer_profile_msg_data, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_peer_profile_list_1(struct l2tp_api_peer_profile_list_msg_data *clnt_res, CLIENT *clnt) +{ + return (clnt_call (clnt, L2TP_PEER_PROFILE_LIST, (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_l2tp_api_peer_profile_list_msg_data, (caddr_t) clnt_res, + TIMEOUT)); + +} + +enum clnt_stat +l2tp_tunnel_create_1(struct l2tp_api_tunnel_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_TUNNEL_CREATE, + (xdrproc_t) xdr_l2tp_api_tunnel_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_tunnel_delete_1(uint16_t tunnel_id, optstring tunnel_name, optstring reason, int *clnt_res, CLIENT *clnt) +{ + l2tp_tunnel_delete_1_argument arg; + arg.tunnel_id = tunnel_id; + arg.tunnel_name = tunnel_name; + arg.reason = reason; + return (clnt_call (clnt, L2TP_TUNNEL_DELETE, (xdrproc_t) xdr_l2tp_tunnel_delete_1_argument, (caddr_t) &arg, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_tunnel_modify_1(struct l2tp_api_tunnel_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_TUNNEL_MODIFY, + (xdrproc_t) xdr_l2tp_api_tunnel_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_tunnel_get_1(uint16_t tunnel_id, optstring tunnel_name, struct l2tp_api_tunnel_msg_data *clnt_res, CLIENT *clnt) +{ + l2tp_tunnel_get_1_argument arg; + arg.tunnel_id = tunnel_id; + arg.tunnel_name = tunnel_name; + return (clnt_call (clnt, L2TP_TUNNEL_GET, (xdrproc_t) xdr_l2tp_tunnel_get_1_argument, (caddr_t) &arg, + (xdrproc_t) xdr_l2tp_api_tunnel_msg_data, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_tunnel_list_1(struct l2tp_api_tunnel_list_msg_data *clnt_res, CLIENT *clnt) +{ + return (clnt_call (clnt, L2TP_TUNNEL_LIST, (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_l2tp_api_tunnel_list_msg_data, (caddr_t) clnt_res, + TIMEOUT)); + +} + +enum clnt_stat +l2tp_tunnel_profile_create_1(struct l2tp_api_tunnel_profile_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_TUNNEL_PROFILE_CREATE, + (xdrproc_t) xdr_l2tp_api_tunnel_profile_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_tunnel_profile_delete_1(char *name, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_TUNNEL_PROFILE_DELETE, + (xdrproc_t) xdr_wrapstring, (caddr_t) &name, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_tunnel_profile_modify_1(struct l2tp_api_tunnel_profile_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_TUNNEL_PROFILE_MODIFY, + (xdrproc_t) xdr_l2tp_api_tunnel_profile_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_tunnel_profile_get_1(char *name, struct l2tp_api_tunnel_profile_msg_data *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_TUNNEL_PROFILE_GET, + (xdrproc_t) xdr_wrapstring, (caddr_t) &name, + (xdrproc_t) xdr_l2tp_api_tunnel_profile_msg_data, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_tunnel_profile_list_1(struct l2tp_api_tunnel_profile_list_msg_data *clnt_res, CLIENT *clnt) +{ + return (clnt_call (clnt, L2TP_TUNNEL_PROFILE_LIST, (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_l2tp_api_tunnel_profile_list_msg_data, (caddr_t) clnt_res, + TIMEOUT)); + +} + +enum clnt_stat +l2tp_session_create_1(struct l2tp_api_session_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_SESSION_CREATE, + (xdrproc_t) xdr_l2tp_api_session_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_session_delete_1(uint16_t tunnel_id, optstring tunnel_name, uint16_t session_id, optstring session_name, optstring reason, int *clnt_res, CLIENT *clnt) +{ + l2tp_session_delete_1_argument arg; + arg.tunnel_id = tunnel_id; + arg.tunnel_name = tunnel_name; + arg.session_id = session_id; + arg.session_name = session_name; + arg.reason = reason; + return (clnt_call (clnt, L2TP_SESSION_DELETE, (xdrproc_t) xdr_l2tp_session_delete_1_argument, (caddr_t) &arg, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_session_modify_1(struct l2tp_api_session_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_SESSION_MODIFY, + (xdrproc_t) xdr_l2tp_api_session_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_session_get_1(uint16_t tunnel_id, optstring tunnel_name, uint16_t session_id, optstring session_name, struct l2tp_api_session_msg_data *clnt_res, CLIENT *clnt) +{ + l2tp_session_get_1_argument arg; + arg.tunnel_id = tunnel_id; + arg.tunnel_name = tunnel_name; + arg.session_id = session_id; + arg.session_name = session_name; + return (clnt_call (clnt, L2TP_SESSION_GET, (xdrproc_t) xdr_l2tp_session_get_1_argument, (caddr_t) &arg, + (xdrproc_t) xdr_l2tp_api_session_msg_data, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_session_list_1(uint16_t tunnel_id, optstring tunnel_name, struct l2tp_api_session_list_msg_data *clnt_res, CLIENT *clnt) +{ + l2tp_session_list_1_argument arg; + arg.tunnel_id = tunnel_id; + arg.tunnel_name = tunnel_name; + return (clnt_call (clnt, L2TP_SESSION_LIST, (xdrproc_t) xdr_l2tp_session_list_1_argument, (caddr_t) &arg, + (xdrproc_t) xdr_l2tp_api_session_list_msg_data, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_session_incall_ind_1(struct l2tp_api_session_incall_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_SESSION_INCALL_IND, + (xdrproc_t) xdr_l2tp_api_session_incall_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_session_profile_create_1(struct l2tp_api_session_profile_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_SESSION_PROFILE_CREATE, + (xdrproc_t) xdr_l2tp_api_session_profile_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_session_profile_delete_1(char *name, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_SESSION_PROFILE_DELETE, + (xdrproc_t) xdr_wrapstring, (caddr_t) &name, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_session_profile_modify_1(struct l2tp_api_session_profile_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_SESSION_PROFILE_MODIFY, + (xdrproc_t) xdr_l2tp_api_session_profile_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_session_profile_get_1(char *name, struct l2tp_api_session_profile_msg_data *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_SESSION_PROFILE_GET, + (xdrproc_t) xdr_wrapstring, (caddr_t) &name, + (xdrproc_t) xdr_l2tp_api_session_profile_msg_data, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_session_profile_list_1(struct l2tp_api_session_profile_list_msg_data *clnt_res, CLIENT *clnt) +{ + return (clnt_call (clnt, L2TP_SESSION_PROFILE_LIST, (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_l2tp_api_session_profile_list_msg_data, (caddr_t) clnt_res, + TIMEOUT)); + +} + +enum clnt_stat +l2tp_ppp_profile_create_1(struct l2tp_api_ppp_profile_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_PPP_PROFILE_CREATE, + (xdrproc_t) xdr_l2tp_api_ppp_profile_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_ppp_profile_delete_1(char *name, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_PPP_PROFILE_DELETE, + (xdrproc_t) xdr_wrapstring, (caddr_t) &name, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_ppp_profile_modify_1(struct l2tp_api_ppp_profile_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_PPP_PROFILE_MODIFY, + (xdrproc_t) xdr_l2tp_api_ppp_profile_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_ppp_profile_get_1(char *name, struct l2tp_api_ppp_profile_msg_data *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_PPP_PROFILE_GET, + (xdrproc_t) xdr_wrapstring, (caddr_t) &name, + (xdrproc_t) xdr_l2tp_api_ppp_profile_msg_data, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_ppp_profile_list_1(struct l2tp_api_ppp_profile_list_msg_data *clnt_res, CLIENT *clnt) +{ + return (clnt_call (clnt, L2TP_PPP_PROFILE_LIST, (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_l2tp_api_ppp_profile_list_msg_data, (caddr_t) clnt_res, + TIMEOUT)); + +} + +enum clnt_stat +l2tp_peer_get_1(struct l2tp_api_ip_addr local_addr, struct l2tp_api_ip_addr peer_addr, struct l2tp_api_peer_msg_data *clnt_res, CLIENT *clnt) +{ + l2tp_peer_get_1_argument arg; + arg.local_addr = local_addr; + arg.peer_addr = peer_addr; + return (clnt_call (clnt, L2TP_PEER_GET, (xdrproc_t) xdr_l2tp_peer_get_1_argument, (caddr_t) &arg, + (xdrproc_t) xdr_l2tp_api_peer_msg_data, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_peer_list_1(struct l2tp_api_peer_list_msg_data *clnt_res, CLIENT *clnt) +{ + return (clnt_call (clnt, L2TP_PEER_LIST, (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_l2tp_api_peer_list_msg_data, (caddr_t) clnt_res, + TIMEOUT)); + +} + +enum clnt_stat +l2tp_user_list_1(struct l2tp_api_user_list_msg_data *clnt_res, CLIENT *clnt) +{ + return (clnt_call (clnt, L2TP_USER_LIST, (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_l2tp_api_user_list_msg_data, (caddr_t) clnt_res, + TIMEOUT)); + +} + +enum clnt_stat +l2tp_peer_profile_unset_1(struct l2tp_api_peer_profile_unset_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_PEER_PROFILE_UNSET, + (xdrproc_t) xdr_l2tp_api_peer_profile_unset_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_tunnel_profile_unset_1(struct l2tp_api_tunnel_profile_unset_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_TUNNEL_PROFILE_UNSET, + (xdrproc_t) xdr_l2tp_api_tunnel_profile_unset_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_session_profile_unset_1(struct l2tp_api_session_profile_unset_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_SESSION_PROFILE_UNSET, + (xdrproc_t) xdr_l2tp_api_session_profile_unset_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_ppp_profile_unset_1(struct l2tp_api_ppp_profile_unset_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_PPP_PROFILE_UNSET, + (xdrproc_t) xdr_l2tp_api_ppp_profile_unset_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_test_log_1(char *text, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_TEST_LOG, + (xdrproc_t) xdr_wrapstring, (caddr_t) &text, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_test_modify_1(struct l2tp_api_test_msg_data params, int *clnt_res, CLIENT *clnt) +{ + return (clnt_call(clnt, L2TP_TEST_MODIFY, + (xdrproc_t) xdr_l2tp_api_test_msg_data, (caddr_t) ¶ms, + (xdrproc_t) xdr_int, (caddr_t) clnt_res, + TIMEOUT)); +} + +enum clnt_stat +l2tp_test_get_1(struct l2tp_api_test_msg_data *clnt_res, CLIENT *clnt) +{ + return (clnt_call (clnt, L2TP_TEST_GET, (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_l2tp_api_test_msg_data, (caddr_t) clnt_res, + TIMEOUT)); + +} diff --git a/net/openl2tp/src/l2tp_rpc_server.c b/net/openl2tp/src/l2tp_rpc_server.c new file mode 100644 index 0000000..b2dd30a --- /dev/null +++ b/net/openl2tp/src/l2tp_rpc_server.c @@ -0,0 +1,665 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "l2tp_rpc.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef SIG_PF +#define SIG_PF void(*)(int) +#endif +#define OPTSTRING(_var) _var.optstring_u.value +#define OPTSTRING_PTR(_var) ((_var.valid == 1) ? _var.optstring_u.value : NULL) + +int +_l2tp_app_info_get_1 (void *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_app_info_get_1_svc(result, rqstp)); +} + +int +_l2tp_system_modify_1 (struct l2tp_api_system_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_system_modify_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_system_get_1 (void *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_system_get_1_svc(result, rqstp)); +} + +int +_l2tp_peer_profile_create_1 (struct l2tp_api_peer_profile_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_peer_profile_create_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_peer_profile_delete_1 (char * *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_peer_profile_delete_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_peer_profile_modify_1 (struct l2tp_api_peer_profile_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_peer_profile_modify_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_peer_profile_get_1 (char * *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_peer_profile_get_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_peer_profile_list_1 (void *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_peer_profile_list_1_svc(result, rqstp)); +} + +int +_l2tp_tunnel_create_1 (struct l2tp_api_tunnel_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_tunnel_create_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_tunnel_delete_1 (l2tp_tunnel_delete_1_argument *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_tunnel_delete_1_svc(argp->tunnel_id, argp->tunnel_name, argp->reason, result, rqstp)); +} + +int +_l2tp_tunnel_modify_1 (struct l2tp_api_tunnel_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_tunnel_modify_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_tunnel_get_1 (l2tp_tunnel_get_1_argument *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_tunnel_get_1_svc(argp->tunnel_id, argp->tunnel_name, result, rqstp)); +} + +int +_l2tp_tunnel_list_1 (void *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_tunnel_list_1_svc(result, rqstp)); +} + +int +_l2tp_tunnel_profile_create_1 (struct l2tp_api_tunnel_profile_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_tunnel_profile_create_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_tunnel_profile_delete_1 (char * *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_tunnel_profile_delete_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_tunnel_profile_modify_1 (struct l2tp_api_tunnel_profile_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_tunnel_profile_modify_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_tunnel_profile_get_1 (char * *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_tunnel_profile_get_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_tunnel_profile_list_1 (void *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_tunnel_profile_list_1_svc(result, rqstp)); +} + +int +_l2tp_session_create_1 (struct l2tp_api_session_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_session_create_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_session_delete_1 (l2tp_session_delete_1_argument *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_session_delete_1_svc(argp->tunnel_id, argp->tunnel_name, argp->session_id, argp->session_name, argp->reason, result, rqstp)); +} + +int +_l2tp_session_modify_1 (struct l2tp_api_session_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_session_modify_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_session_get_1 (l2tp_session_get_1_argument *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_session_get_1_svc(argp->tunnel_id, argp->tunnel_name, argp->session_id, argp->session_name, result, rqstp)); +} + +int +_l2tp_session_list_1 (l2tp_session_list_1_argument *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_session_list_1_svc(argp->tunnel_id, argp->tunnel_name, result, rqstp)); +} + +int +_l2tp_session_incall_ind_1 (struct l2tp_api_session_incall_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_session_incall_ind_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_session_profile_create_1 (struct l2tp_api_session_profile_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_session_profile_create_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_session_profile_delete_1 (char * *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_session_profile_delete_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_session_profile_modify_1 (struct l2tp_api_session_profile_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_session_profile_modify_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_session_profile_get_1 (char * *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_session_profile_get_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_session_profile_list_1 (void *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_session_profile_list_1_svc(result, rqstp)); +} + +int +_l2tp_ppp_profile_create_1 (struct l2tp_api_ppp_profile_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_ppp_profile_create_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_ppp_profile_delete_1 (char * *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_ppp_profile_delete_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_ppp_profile_modify_1 (struct l2tp_api_ppp_profile_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_ppp_profile_modify_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_ppp_profile_get_1 (char * *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_ppp_profile_get_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_ppp_profile_list_1 (void *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_ppp_profile_list_1_svc(result, rqstp)); +} + +int +_l2tp_peer_get_1 (l2tp_peer_get_1_argument *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_peer_get_1_svc(argp->local_addr, argp->peer_addr, result, rqstp)); +} + +int +_l2tp_peer_list_1 (void *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_peer_list_1_svc(result, rqstp)); +} + +int +_l2tp_user_list_1 (void *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_user_list_1_svc(result, rqstp)); +} + +int +_l2tp_peer_profile_unset_1 (struct l2tp_api_peer_profile_unset_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_peer_profile_unset_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_tunnel_profile_unset_1 (struct l2tp_api_tunnel_profile_unset_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_tunnel_profile_unset_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_session_profile_unset_1 (struct l2tp_api_session_profile_unset_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_session_profile_unset_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_ppp_profile_unset_1 (struct l2tp_api_ppp_profile_unset_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_ppp_profile_unset_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_test_log_1 (char * *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_test_log_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_test_modify_1 (struct l2tp_api_test_msg_data *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_test_modify_1_svc(*argp, result, rqstp)); +} + +int +_l2tp_test_get_1 (void *argp, void *result, struct svc_req *rqstp) +{ + return (l2tp_test_get_1_svc(result, rqstp)); +} + +void +l2tp_prog_1(struct svc_req *rqstp, register SVCXPRT *transp) +{ + union { + struct l2tp_api_system_msg_data l2tp_system_modify_1_arg; + struct l2tp_api_peer_profile_msg_data l2tp_peer_profile_create_1_arg; + char *l2tp_peer_profile_delete_1_arg; + struct l2tp_api_peer_profile_msg_data l2tp_peer_profile_modify_1_arg; + char *l2tp_peer_profile_get_1_arg; + struct l2tp_api_tunnel_msg_data l2tp_tunnel_create_1_arg; + l2tp_tunnel_delete_1_argument l2tp_tunnel_delete_1_arg; + struct l2tp_api_tunnel_msg_data l2tp_tunnel_modify_1_arg; + l2tp_tunnel_get_1_argument l2tp_tunnel_get_1_arg; + struct l2tp_api_tunnel_profile_msg_data l2tp_tunnel_profile_create_1_arg; + char *l2tp_tunnel_profile_delete_1_arg; + struct l2tp_api_tunnel_profile_msg_data l2tp_tunnel_profile_modify_1_arg; + char *l2tp_tunnel_profile_get_1_arg; + struct l2tp_api_session_msg_data l2tp_session_create_1_arg; + l2tp_session_delete_1_argument l2tp_session_delete_1_arg; + struct l2tp_api_session_msg_data l2tp_session_modify_1_arg; + l2tp_session_get_1_argument l2tp_session_get_1_arg; + l2tp_session_list_1_argument l2tp_session_list_1_arg; + struct l2tp_api_session_incall_msg_data l2tp_session_incall_ind_1_arg; + struct l2tp_api_session_profile_msg_data l2tp_session_profile_create_1_arg; + char *l2tp_session_profile_delete_1_arg; + struct l2tp_api_session_profile_msg_data l2tp_session_profile_modify_1_arg; + char *l2tp_session_profile_get_1_arg; + struct l2tp_api_ppp_profile_msg_data l2tp_ppp_profile_create_1_arg; + char *l2tp_ppp_profile_delete_1_arg; + struct l2tp_api_ppp_profile_msg_data l2tp_ppp_profile_modify_1_arg; + char *l2tp_ppp_profile_get_1_arg; + l2tp_peer_get_1_argument l2tp_peer_get_1_arg; + struct l2tp_api_peer_profile_unset_msg_data l2tp_peer_profile_unset_1_arg; + struct l2tp_api_tunnel_profile_unset_msg_data l2tp_tunnel_profile_unset_1_arg; + struct l2tp_api_session_profile_unset_msg_data l2tp_session_profile_unset_1_arg; + struct l2tp_api_ppp_profile_unset_msg_data l2tp_ppp_profile_unset_1_arg; + char *l2tp_test_log_1_arg; + struct l2tp_api_test_msg_data l2tp_test_modify_1_arg; + } argument; + union { + struct l2tp_api_app_msg_data l2tp_app_info_get_1_res; + int l2tp_system_modify_1_res; + struct l2tp_api_system_msg_data l2tp_system_get_1_res; + int l2tp_peer_profile_create_1_res; + int l2tp_peer_profile_delete_1_res; + int l2tp_peer_profile_modify_1_res; + struct l2tp_api_peer_profile_msg_data l2tp_peer_profile_get_1_res; + struct l2tp_api_peer_profile_list_msg_data l2tp_peer_profile_list_1_res; + int l2tp_tunnel_create_1_res; + int l2tp_tunnel_delete_1_res; + int l2tp_tunnel_modify_1_res; + struct l2tp_api_tunnel_msg_data l2tp_tunnel_get_1_res; + struct l2tp_api_tunnel_list_msg_data l2tp_tunnel_list_1_res; + int l2tp_tunnel_profile_create_1_res; + int l2tp_tunnel_profile_delete_1_res; + int l2tp_tunnel_profile_modify_1_res; + struct l2tp_api_tunnel_profile_msg_data l2tp_tunnel_profile_get_1_res; + struct l2tp_api_tunnel_profile_list_msg_data l2tp_tunnel_profile_list_1_res; + int l2tp_session_create_1_res; + int l2tp_session_delete_1_res; + int l2tp_session_modify_1_res; + struct l2tp_api_session_msg_data l2tp_session_get_1_res; + struct l2tp_api_session_list_msg_data l2tp_session_list_1_res; + int l2tp_session_incall_ind_1_res; + int l2tp_session_profile_create_1_res; + int l2tp_session_profile_delete_1_res; + int l2tp_session_profile_modify_1_res; + struct l2tp_api_session_profile_msg_data l2tp_session_profile_get_1_res; + struct l2tp_api_session_profile_list_msg_data l2tp_session_profile_list_1_res; + int l2tp_ppp_profile_create_1_res; + int l2tp_ppp_profile_delete_1_res; + int l2tp_ppp_profile_modify_1_res; + struct l2tp_api_ppp_profile_msg_data l2tp_ppp_profile_get_1_res; + struct l2tp_api_ppp_profile_list_msg_data l2tp_ppp_profile_list_1_res; + struct l2tp_api_peer_msg_data l2tp_peer_get_1_res; + struct l2tp_api_peer_list_msg_data l2tp_peer_list_1_res; + struct l2tp_api_user_list_msg_data l2tp_user_list_1_res; + int l2tp_peer_profile_unset_1_res; + int l2tp_tunnel_profile_unset_1_res; + int l2tp_session_profile_unset_1_res; + int l2tp_ppp_profile_unset_1_res; + int l2tp_test_log_1_res; + int l2tp_test_modify_1_res; + struct l2tp_api_test_msg_data l2tp_test_get_1_res; + } result; + bool_t retval; + xdrproc_t _xdr_argument, _xdr_result; + bool_t (*local)(char *, void *, struct svc_req *); + + if (l2tp_api_rpc_check_request(transp) < 0) return; switch (rqstp->rq_proc) { + case NULLPROC: + (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL); + return; + + case L2TP_APP_INFO_GET: + _xdr_argument = (xdrproc_t) xdr_void; + _xdr_result = (xdrproc_t) xdr_l2tp_api_app_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_app_info_get_1; + break; + + case L2TP_SYSTEM_MODIFY: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_system_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_system_modify_1; + break; + + case L2TP_SYSTEM_GET: + _xdr_argument = (xdrproc_t) xdr_void; + _xdr_result = (xdrproc_t) xdr_l2tp_api_system_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_system_get_1; + break; + + case L2TP_PEER_PROFILE_CREATE: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_peer_profile_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_peer_profile_create_1; + break; + + case L2TP_PEER_PROFILE_DELETE: + _xdr_argument = (xdrproc_t) xdr_wrapstring; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_peer_profile_delete_1; + break; + + case L2TP_PEER_PROFILE_MODIFY: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_peer_profile_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_peer_profile_modify_1; + break; + + case L2TP_PEER_PROFILE_GET: + _xdr_argument = (xdrproc_t) xdr_wrapstring; + _xdr_result = (xdrproc_t) xdr_l2tp_api_peer_profile_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_peer_profile_get_1; + break; + + case L2TP_PEER_PROFILE_LIST: + _xdr_argument = (xdrproc_t) xdr_void; + _xdr_result = (xdrproc_t) xdr_l2tp_api_peer_profile_list_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_peer_profile_list_1; + break; + + case L2TP_TUNNEL_CREATE: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_tunnel_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_tunnel_create_1; + break; + + case L2TP_TUNNEL_DELETE: + _xdr_argument = (xdrproc_t) xdr_l2tp_tunnel_delete_1_argument; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_tunnel_delete_1; + break; + + case L2TP_TUNNEL_MODIFY: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_tunnel_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_tunnel_modify_1; + break; + + case L2TP_TUNNEL_GET: + _xdr_argument = (xdrproc_t) xdr_l2tp_tunnel_get_1_argument; + _xdr_result = (xdrproc_t) xdr_l2tp_api_tunnel_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_tunnel_get_1; + break; + + case L2TP_TUNNEL_LIST: + _xdr_argument = (xdrproc_t) xdr_void; + _xdr_result = (xdrproc_t) xdr_l2tp_api_tunnel_list_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_tunnel_list_1; + break; + + case L2TP_TUNNEL_PROFILE_CREATE: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_tunnel_profile_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_tunnel_profile_create_1; + break; + + case L2TP_TUNNEL_PROFILE_DELETE: + _xdr_argument = (xdrproc_t) xdr_wrapstring; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_tunnel_profile_delete_1; + break; + + case L2TP_TUNNEL_PROFILE_MODIFY: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_tunnel_profile_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_tunnel_profile_modify_1; + break; + + case L2TP_TUNNEL_PROFILE_GET: + _xdr_argument = (xdrproc_t) xdr_wrapstring; + _xdr_result = (xdrproc_t) xdr_l2tp_api_tunnel_profile_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_tunnel_profile_get_1; + break; + + case L2TP_TUNNEL_PROFILE_LIST: + _xdr_argument = (xdrproc_t) xdr_void; + _xdr_result = (xdrproc_t) xdr_l2tp_api_tunnel_profile_list_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_tunnel_profile_list_1; + break; + + case L2TP_SESSION_CREATE: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_session_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_session_create_1; + break; + + case L2TP_SESSION_DELETE: + _xdr_argument = (xdrproc_t) xdr_l2tp_session_delete_1_argument; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_session_delete_1; + break; + + case L2TP_SESSION_MODIFY: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_session_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_session_modify_1; + break; + + case L2TP_SESSION_GET: + _xdr_argument = (xdrproc_t) xdr_l2tp_session_get_1_argument; + _xdr_result = (xdrproc_t) xdr_l2tp_api_session_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_session_get_1; + break; + + case L2TP_SESSION_LIST: + _xdr_argument = (xdrproc_t) xdr_l2tp_session_list_1_argument; + _xdr_result = (xdrproc_t) xdr_l2tp_api_session_list_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_session_list_1; + break; + + case L2TP_SESSION_INCALL_IND: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_session_incall_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_session_incall_ind_1; + break; + + case L2TP_SESSION_PROFILE_CREATE: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_session_profile_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_session_profile_create_1; + break; + + case L2TP_SESSION_PROFILE_DELETE: + _xdr_argument = (xdrproc_t) xdr_wrapstring; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_session_profile_delete_1; + break; + + case L2TP_SESSION_PROFILE_MODIFY: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_session_profile_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_session_profile_modify_1; + break; + + case L2TP_SESSION_PROFILE_GET: + _xdr_argument = (xdrproc_t) xdr_wrapstring; + _xdr_result = (xdrproc_t) xdr_l2tp_api_session_profile_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_session_profile_get_1; + break; + + case L2TP_SESSION_PROFILE_LIST: + _xdr_argument = (xdrproc_t) xdr_void; + _xdr_result = (xdrproc_t) xdr_l2tp_api_session_profile_list_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_session_profile_list_1; + break; + + case L2TP_PPP_PROFILE_CREATE: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_ppp_profile_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_ppp_profile_create_1; + break; + + case L2TP_PPP_PROFILE_DELETE: + _xdr_argument = (xdrproc_t) xdr_wrapstring; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_ppp_profile_delete_1; + break; + + case L2TP_PPP_PROFILE_MODIFY: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_ppp_profile_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_ppp_profile_modify_1; + break; + + case L2TP_PPP_PROFILE_GET: + _xdr_argument = (xdrproc_t) xdr_wrapstring; + _xdr_result = (xdrproc_t) xdr_l2tp_api_ppp_profile_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_ppp_profile_get_1; + break; + + case L2TP_PPP_PROFILE_LIST: + _xdr_argument = (xdrproc_t) xdr_void; + _xdr_result = (xdrproc_t) xdr_l2tp_api_ppp_profile_list_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_ppp_profile_list_1; + break; + + case L2TP_PEER_GET: + _xdr_argument = (xdrproc_t) xdr_l2tp_peer_get_1_argument; + _xdr_result = (xdrproc_t) xdr_l2tp_api_peer_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_peer_get_1; + break; + + case L2TP_PEER_LIST: + _xdr_argument = (xdrproc_t) xdr_void; + _xdr_result = (xdrproc_t) xdr_l2tp_api_peer_list_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_peer_list_1; + break; + + case L2TP_USER_LIST: + _xdr_argument = (xdrproc_t) xdr_void; + _xdr_result = (xdrproc_t) xdr_l2tp_api_user_list_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_user_list_1; + break; + + case L2TP_PEER_PROFILE_UNSET: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_peer_profile_unset_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_peer_profile_unset_1; + break; + + case L2TP_TUNNEL_PROFILE_UNSET: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_tunnel_profile_unset_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_tunnel_profile_unset_1; + break; + + case L2TP_SESSION_PROFILE_UNSET: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_session_profile_unset_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_session_profile_unset_1; + break; + + case L2TP_PPP_PROFILE_UNSET: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_ppp_profile_unset_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_ppp_profile_unset_1; + break; + + case L2TP_TEST_LOG: + _xdr_argument = (xdrproc_t) xdr_wrapstring; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_test_log_1; + break; + + case L2TP_TEST_MODIFY: + _xdr_argument = (xdrproc_t) xdr_l2tp_api_test_msg_data; + _xdr_result = (xdrproc_t) xdr_int; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_test_modify_1; + break; + + case L2TP_TEST_GET: + _xdr_argument = (xdrproc_t) xdr_void; + _xdr_result = (xdrproc_t) xdr_l2tp_api_test_msg_data; + local = (bool_t (*) (char *, void *, struct svc_req *))_l2tp_test_get_1; + break; + + default: + svcerr_noproc (transp); + return; + } + memset ((char *)&argument, 0, sizeof (argument)); + if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { + svcerr_decode (transp); + return; + } + retval = (bool_t) (*local)((char *)&argument, (void *)&result, rqstp); + if (retval > 0 && !svc_sendreply(transp, (xdrproc_t) _xdr_result, (char *)&result)) { + svcerr_systemerr (transp); + } + if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { + syslog (LOG_ERR, "%s", "unable to free arguments"); + exit (1); + } + if (!l2tp_prog_1_freeresult (transp, _xdr_result, (caddr_t) &result)) + syslog (LOG_ERR, "%s", "unable to free results"); + + return; +} diff --git a/net/openl2tp/src/l2tp_rpc_xdr.c b/net/openl2tp/src/l2tp_rpc_xdr.c new file mode 100644 index 0000000..9c540c3 --- /dev/null +++ b/net/openl2tp/src/l2tp_rpc_xdr.c @@ -0,0 +1,2957 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "l2tp_rpc.h" + +bool_t +xdr_optstring (XDR *xdrs, optstring *objp) +{ + register int32_t *buf; + + if (!xdr_int (xdrs, &objp->valid)) + return FALSE; + switch (objp->valid) { + case 1: + if (!xdr_string (xdrs, &objp->optstring_u.value, ~0)) + return FALSE; + break; + default: + break; + } + return TRUE; +} +#define OPTSTRING(_var) _var.optstring_u.value +#define OPTSTRING_PTR(_var) ((_var.valid == 1) ? _var.optstring_u.value : NULL) + +bool_t +xdr_l2tp_api_tunnel_auth_mode (XDR *xdrs, l2tp_api_tunnel_auth_mode *objp) +{ + register int32_t *buf; + + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_tunnel_mode (XDR *xdrs, l2tp_api_tunnel_mode *objp) +{ + register int32_t *buf; + + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_ip_addr (XDR *xdrs, l2tp_api_ip_addr *objp) +{ + register int32_t *buf; + + if (!xdr_uint32_t (xdrs, &objp->s_addr)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_app_msg_data (XDR *xdrs, l2tp_api_app_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_string (xdrs, &objp->build_date, 16)) + return FALSE; + if (!xdr_string (xdrs, &objp->build_time, 16)) + return FALSE; + if (!xdr_int (xdrs, &objp->major)) + return FALSE; + if (!xdr_int (xdrs, &objp->minor)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->cookie)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->patches.patches_val, (u_int *) &objp->patches.patches_len, ~0, + sizeof (int), (xdrproc_t) xdr_int)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->features)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_system_config (XDR *xdrs, l2tp_api_system_config *objp) +{ + register int32_t *buf; + + + if (xdrs->x_op == XDR_ENCODE) { + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_int (xdrs, &objp->udp_port)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + buf = XDR_INLINE (xdrs, 9 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->max_tunnels)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_sessions)) + return FALSE; + if (!xdr_int (xdrs, &objp->drain_tunnels)) + return FALSE; + if (!xdr_int (xdrs, &objp->tunnel_establish_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->session_establish_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->tunnel_persist_pend_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->session_persist_pend_timeout)) + return FALSE; + if (!xdr_bool (xdrs, &objp->deny_local_tunnel_creates)) + return FALSE; + if (!xdr_bool (xdrs, &objp->deny_remote_tunnel_creates)) + return FALSE; + } else { + IXDR_PUT_LONG(buf, objp->max_tunnels); + IXDR_PUT_LONG(buf, objp->max_sessions); + IXDR_PUT_LONG(buf, objp->drain_tunnels); + IXDR_PUT_LONG(buf, objp->tunnel_establish_timeout); + IXDR_PUT_LONG(buf, objp->session_establish_timeout); + IXDR_PUT_LONG(buf, objp->tunnel_persist_pend_timeout); + IXDR_PUT_LONG(buf, objp->session_persist_pend_timeout); + IXDR_PUT_BOOL(buf, objp->deny_local_tunnel_creates); + IXDR_PUT_BOOL(buf, objp->deny_remote_tunnel_creates); + } + return TRUE; + } else if (xdrs->x_op == XDR_DECODE) { + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_int (xdrs, &objp->udp_port)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + buf = XDR_INLINE (xdrs, 9 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->max_tunnels)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_sessions)) + return FALSE; + if (!xdr_int (xdrs, &objp->drain_tunnels)) + return FALSE; + if (!xdr_int (xdrs, &objp->tunnel_establish_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->session_establish_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->tunnel_persist_pend_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->session_persist_pend_timeout)) + return FALSE; + if (!xdr_bool (xdrs, &objp->deny_local_tunnel_creates)) + return FALSE; + if (!xdr_bool (xdrs, &objp->deny_remote_tunnel_creates)) + return FALSE; + } else { + objp->max_tunnels = IXDR_GET_LONG(buf); + objp->max_sessions = IXDR_GET_LONG(buf); + objp->drain_tunnels = IXDR_GET_LONG(buf); + objp->tunnel_establish_timeout = IXDR_GET_LONG(buf); + objp->session_establish_timeout = IXDR_GET_LONG(buf); + objp->tunnel_persist_pend_timeout = IXDR_GET_LONG(buf); + objp->session_persist_pend_timeout = IXDR_GET_LONG(buf); + objp->deny_local_tunnel_creates = IXDR_GET_BOOL(buf); + objp->deny_remote_tunnel_creates = IXDR_GET_BOOL(buf); + } + return TRUE; + } + + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_int (xdrs, &objp->udp_port)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_tunnels)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_sessions)) + return FALSE; + if (!xdr_int (xdrs, &objp->drain_tunnels)) + return FALSE; + if (!xdr_int (xdrs, &objp->tunnel_establish_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->session_establish_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->tunnel_persist_pend_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->session_persist_pend_timeout)) + return FALSE; + if (!xdr_bool (xdrs, &objp->deny_local_tunnel_creates)) + return FALSE; + if (!xdr_bool (xdrs, &objp->deny_remote_tunnel_creates)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_system_msg_stats (XDR *xdrs, l2tp_api_system_msg_stats *objp) +{ + register int32_t *buf; + + if (!xdr_uint32_t (xdrs, &objp->rx)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->tx)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->rx_bad)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_system_stats (XDR *xdrs, l2tp_api_system_stats *objp) +{ + register int32_t *buf; + + if (!xdr_uint32_t (xdrs, &objp->short_frames)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->wrong_version_frames)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->unexpected_data_frames)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->bad_rcvd_frames)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->total_rcvd_control_frames)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->total_sent_control_frames)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->total_control_frame_send_fails)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->total_retransmitted_control_frames)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->no_control_frame_resources)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->no_peer_resources)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->no_tunnel_resources)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->no_session_resources)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->no_ppp_resources)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->too_many_tunnels)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->too_many_sessions)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->auth_fails)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->no_matching_tunnel_id_discards)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->no_matching_session_id_discards)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->mismatched_tunnel_ids)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->mismatched_session_ids)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->encode_message_fails)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->tunnel_setup_failures)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->session_setup_failures)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->event_queue_full_errors)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->ignored_avps)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->vendor_avps)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->illegal_messages)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->unsupported_messages)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->messages.messages_val, (u_int *) &objp->messages.messages_len, L2TP_API_MSG_TYPE_COUNT, + sizeof (l2tp_api_system_msg_stats), (xdrproc_t) xdr_l2tp_api_system_msg_stats)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_system_status (XDR *xdrs, l2tp_api_system_status *objp) +{ + register int32_t *buf; + + if (!xdr_l2tp_api_system_stats (xdrs, &objp->stats)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->num_tunnels)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->num_sessions)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_system_msg_data (XDR *xdrs, l2tp_api_system_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_l2tp_api_system_config (xdrs, &objp->config)) + return FALSE; + if (!xdr_l2tp_api_system_status (xdrs, &objp->status)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_peer_msg_data (XDR *xdrs, l2tp_api_peer_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->peer_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->local_addr)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_tunnels)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_peer_list_entry (XDR *xdrs, l2tp_api_peer_list_entry *objp) +{ + register int32_t *buf; + + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->peer_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->local_addr)) + return FALSE; + if (!xdr_pointer (xdrs, (char **)&objp->next, sizeof (l2tp_api_peer_list_entry), (xdrproc_t) xdr_l2tp_api_peer_list_entry)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_peer_list_msg_data (XDR *xdrs, l2tp_api_peer_list_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_int (xdrs, &objp->result)) + return FALSE; + if (!xdr_pointer (xdrs, (char **)&objp->peers, sizeof (l2tp_api_peer_list_entry), (xdrproc_t) xdr_l2tp_api_peer_list_entry)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_peer_profile_msg_data (XDR *xdrs, l2tp_api_peer_profile_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->peer_addr)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_port)) + return FALSE; + if (!xdr_bool (xdrs, &objp->we_can_be_lac)) + return FALSE; + if (!xdr_bool (xdrs, &objp->we_can_be_lns)) + return FALSE; + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->default_tunnel_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->default_session_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->default_ppp_profile_name)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->netmask)) + return FALSE; + if (!xdr_int (xdrs, &objp->use_count)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_peer_profile_list_entry (XDR *xdrs, l2tp_api_peer_profile_list_entry *objp) +{ + register int32_t *buf; + + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + if (!xdr_pointer (xdrs, (char **)&objp->next, sizeof (l2tp_api_peer_profile_list_entry), (xdrproc_t) xdr_l2tp_api_peer_profile_list_entry)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_peer_profile_list_msg_data (XDR *xdrs, l2tp_api_peer_profile_list_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_int (xdrs, &objp->result)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_profiles)) + return FALSE; + if (!xdr_pointer (xdrs, (char **)&objp->profiles, sizeof (l2tp_api_peer_profile_list_entry), (xdrproc_t) xdr_l2tp_api_peer_profile_list_entry)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_peer_profile_unset_msg_data (XDR *xdrs, l2tp_api_peer_profile_unset_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_tunnel_peer (XDR *xdrs, l2tp_api_tunnel_peer *objp) +{ + register int32_t *buf; + + + if (xdrs->x_op == XDR_ENCODE) { + buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->framing_cap_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_cap_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_analog)) + return FALSE; + + } else { + IXDR_PUT_BOOL(buf, objp->framing_cap_sync); + IXDR_PUT_BOOL(buf, objp->framing_cap_async); + IXDR_PUT_BOOL(buf, objp->bearer_cap_digital); + IXDR_PUT_BOOL(buf, objp->bearer_cap_analog); + } + if (!xdr_uint8_t (xdrs, &objp->protocol_version_ver)) + return FALSE; + if (!xdr_uint8_t (xdrs, &objp->protocol_version_rev)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->rx_window_size)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->firmware_revision)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->host_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->vendor_name)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->tiebreaker.tiebreaker_val, (u_int *) &objp->tiebreaker.tiebreaker_len, 8, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->result_code_result)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->result_code_error)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->result_code_message)) + return FALSE; + return TRUE; + } else if (xdrs->x_op == XDR_DECODE) { + buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->framing_cap_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_cap_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_analog)) + return FALSE; + + } else { + objp->framing_cap_sync = IXDR_GET_BOOL(buf); + objp->framing_cap_async = IXDR_GET_BOOL(buf); + objp->bearer_cap_digital = IXDR_GET_BOOL(buf); + objp->bearer_cap_analog = IXDR_GET_BOOL(buf); + } + if (!xdr_uint8_t (xdrs, &objp->protocol_version_ver)) + return FALSE; + if (!xdr_uint8_t (xdrs, &objp->protocol_version_rev)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->rx_window_size)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->firmware_revision)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->host_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->vendor_name)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->tiebreaker.tiebreaker_val, (u_int *) &objp->tiebreaker.tiebreaker_len, 8, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->result_code_result)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->result_code_error)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->result_code_message)) + return FALSE; + return TRUE; + } + + if (!xdr_bool (xdrs, &objp->framing_cap_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_cap_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_analog)) + return FALSE; + if (!xdr_uint8_t (xdrs, &objp->protocol_version_ver)) + return FALSE; + if (!xdr_uint8_t (xdrs, &objp->protocol_version_rev)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->rx_window_size)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->firmware_revision)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->host_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->vendor_name)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->tiebreaker.tiebreaker_val, (u_int *) &objp->tiebreaker.tiebreaker_len, 8, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->result_code_result)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->result_code_error)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->result_code_message)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_tunnel_stats (XDR *xdrs, l2tp_api_tunnel_stats *objp) +{ + register int32_t *buf; + + if (!xdr_uint32_t (xdrs, &objp->retransmits)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->tx_zlbs)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->tx_zlb_fails)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->rx_zlbs)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->data_pkt_discards)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->duplicate_pkt_discards)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->rx_hellos)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->tx_hellos)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->tx_hello_fails)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->ns)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->nr)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_ns)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_nr)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->cwnd)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->ssthresh)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->congpkt_acc)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->control_rx_packets)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->control_rx_bytes)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->control_rx_oos_packets)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->control_rx_oos_discards)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->control_tx_packets)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->control_tx_bytes)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_rx_packets)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_rx_bytes)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_rx_errors)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_rx_oos_packets)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_rx_oos_discards)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_tx_packets)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_tx_bytes)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_tx_errors)) + return FALSE; + if (!xdr_bool (xdrs, &objp->using_ipsec)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_tunnel_msg_data (XDR *xdrs, l2tp_api_tunnel_msg_data *objp) +{ + register int32_t *buf; + + + if (xdrs->x_op == XDR_ENCODE) { + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->flags2)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_tunnel_id)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_int (xdrs, &objp->hide_avps)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->tunnel_name)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->our_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->peer_addr)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->our_udp_port)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_udp_port)) + return FALSE; + if (!xdr_int (xdrs, &objp->config_id)) + return FALSE; + if (!xdr_l2tp_api_tunnel_auth_mode (xdrs, &objp->auth_mode)) + return FALSE; + buf = XDR_INLINE (xdrs, 8 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->framing_cap_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_cap_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_analog)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_tiebreaker)) + return FALSE; + if (!xdr_bool (xdrs, &objp->allow_ppp_proxy)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_udp_checksums)) + return FALSE; + if (!xdr_bool (xdrs, &objp->created_by_admin)) + return FALSE; + + } else { + IXDR_PUT_BOOL(buf, objp->framing_cap_sync); + IXDR_PUT_BOOL(buf, objp->framing_cap_async); + IXDR_PUT_BOOL(buf, objp->bearer_cap_digital); + IXDR_PUT_BOOL(buf, objp->bearer_cap_analog); + IXDR_PUT_BOOL(buf, objp->use_tiebreaker); + IXDR_PUT_BOOL(buf, objp->allow_ppp_proxy); + IXDR_PUT_BOOL(buf, objp->use_udp_checksums); + IXDR_PUT_BOOL(buf, objp->created_by_admin); + } + if (!xdr_optstring (xdrs, &objp->create_time)) + return FALSE; + buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->max_sessions)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_sessions)) + return FALSE; + if (!xdr_int (xdrs, &objp->use_count)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_establish_retries)) + return FALSE; + + } else { + IXDR_PUT_LONG(buf, objp->max_sessions); + IXDR_PUT_LONG(buf, objp->num_sessions); + IXDR_PUT_LONG(buf, objp->use_count); + IXDR_PUT_LONG(buf, objp->num_establish_retries); + } + if (!xdr_l2tp_api_tunnel_mode (xdrs, &objp->mode)) + return FALSE; + if (!xdr_int (xdrs, &objp->hello_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_retries)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->rx_window_size)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tx_window_size)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->actual_tx_window_size)) + return FALSE; + if (!xdr_int (xdrs, &objp->retry_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->idle_timeout)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->do_pmtu_discovery)) + return FALSE; + if (!xdr_bool (xdrs, &objp->persist)) + return FALSE; + if (!xdr_int (xdrs, &objp->mtu)) + return FALSE; + + } else { + IXDR_PUT_BOOL(buf, objp->do_pmtu_discovery); + IXDR_PUT_BOOL(buf, objp->persist); + IXDR_PUT_LONG(buf, objp->mtu); + } + if (!xdr_optstring (xdrs, &objp->state)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->secret)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->host_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->tunnel_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->peer_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->session_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ppp_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->interface_name)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->tiebreaker.tiebreaker_val, (u_int *) &objp->tiebreaker.tiebreaker_len, 8, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->result_code_result)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->result_code_error)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->result_code_message)) + return FALSE; + if (!xdr_l2tp_api_tunnel_peer (xdrs, &objp->peer)) + return FALSE; + if (!xdr_l2tp_api_tunnel_stats (xdrs, &objp->stats)) + return FALSE; + return TRUE; + } else if (xdrs->x_op == XDR_DECODE) { + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->flags2)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_tunnel_id)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_int (xdrs, &objp->hide_avps)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->tunnel_name)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->our_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->peer_addr)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->our_udp_port)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_udp_port)) + return FALSE; + if (!xdr_int (xdrs, &objp->config_id)) + return FALSE; + if (!xdr_l2tp_api_tunnel_auth_mode (xdrs, &objp->auth_mode)) + return FALSE; + buf = XDR_INLINE (xdrs, 8 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->framing_cap_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_cap_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_analog)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_tiebreaker)) + return FALSE; + if (!xdr_bool (xdrs, &objp->allow_ppp_proxy)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_udp_checksums)) + return FALSE; + if (!xdr_bool (xdrs, &objp->created_by_admin)) + return FALSE; + + } else { + objp->framing_cap_sync = IXDR_GET_BOOL(buf); + objp->framing_cap_async = IXDR_GET_BOOL(buf); + objp->bearer_cap_digital = IXDR_GET_BOOL(buf); + objp->bearer_cap_analog = IXDR_GET_BOOL(buf); + objp->use_tiebreaker = IXDR_GET_BOOL(buf); + objp->allow_ppp_proxy = IXDR_GET_BOOL(buf); + objp->use_udp_checksums = IXDR_GET_BOOL(buf); + objp->created_by_admin = IXDR_GET_BOOL(buf); + } + if (!xdr_optstring (xdrs, &objp->create_time)) + return FALSE; + buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->max_sessions)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_sessions)) + return FALSE; + if (!xdr_int (xdrs, &objp->use_count)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_establish_retries)) + return FALSE; + + } else { + objp->max_sessions = IXDR_GET_LONG(buf); + objp->num_sessions = IXDR_GET_LONG(buf); + objp->use_count = IXDR_GET_LONG(buf); + objp->num_establish_retries = IXDR_GET_LONG(buf); + } + if (!xdr_l2tp_api_tunnel_mode (xdrs, &objp->mode)) + return FALSE; + if (!xdr_int (xdrs, &objp->hello_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_retries)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->rx_window_size)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tx_window_size)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->actual_tx_window_size)) + return FALSE; + if (!xdr_int (xdrs, &objp->retry_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->idle_timeout)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->do_pmtu_discovery)) + return FALSE; + if (!xdr_bool (xdrs, &objp->persist)) + return FALSE; + if (!xdr_int (xdrs, &objp->mtu)) + return FALSE; + + } else { + objp->do_pmtu_discovery = IXDR_GET_BOOL(buf); + objp->persist = IXDR_GET_BOOL(buf); + objp->mtu = IXDR_GET_LONG(buf); + } + if (!xdr_optstring (xdrs, &objp->state)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->secret)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->host_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->tunnel_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->peer_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->session_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ppp_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->interface_name)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->tiebreaker.tiebreaker_val, (u_int *) &objp->tiebreaker.tiebreaker_len, 8, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->result_code_result)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->result_code_error)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->result_code_message)) + return FALSE; + if (!xdr_l2tp_api_tunnel_peer (xdrs, &objp->peer)) + return FALSE; + if (!xdr_l2tp_api_tunnel_stats (xdrs, &objp->stats)) + return FALSE; + return TRUE; + } + + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->flags2)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_tunnel_id)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_int (xdrs, &objp->hide_avps)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->tunnel_name)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->our_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->peer_addr)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->our_udp_port)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_udp_port)) + return FALSE; + if (!xdr_int (xdrs, &objp->config_id)) + return FALSE; + if (!xdr_l2tp_api_tunnel_auth_mode (xdrs, &objp->auth_mode)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_cap_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_cap_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_analog)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_tiebreaker)) + return FALSE; + if (!xdr_bool (xdrs, &objp->allow_ppp_proxy)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_udp_checksums)) + return FALSE; + if (!xdr_bool (xdrs, &objp->created_by_admin)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->create_time)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_sessions)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_sessions)) + return FALSE; + if (!xdr_int (xdrs, &objp->use_count)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_establish_retries)) + return FALSE; + if (!xdr_l2tp_api_tunnel_mode (xdrs, &objp->mode)) + return FALSE; + if (!xdr_int (xdrs, &objp->hello_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_retries)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->rx_window_size)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tx_window_size)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->actual_tx_window_size)) + return FALSE; + if (!xdr_int (xdrs, &objp->retry_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->idle_timeout)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + if (!xdr_bool (xdrs, &objp->do_pmtu_discovery)) + return FALSE; + if (!xdr_bool (xdrs, &objp->persist)) + return FALSE; + if (!xdr_int (xdrs, &objp->mtu)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->state)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->secret)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->host_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->tunnel_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->peer_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->session_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ppp_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->interface_name)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->tiebreaker.tiebreaker_val, (u_int *) &objp->tiebreaker.tiebreaker_len, 8, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->result_code_result)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->result_code_error)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->result_code_message)) + return FALSE; + if (!xdr_l2tp_api_tunnel_peer (xdrs, &objp->peer)) + return FALSE; + if (!xdr_l2tp_api_tunnel_stats (xdrs, &objp->stats)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_tunnel_list_msg_data (XDR *xdrs, l2tp_api_tunnel_list_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_int (xdrs, &objp->result)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->tunnel_ids.tunnel_ids_val, (u_int *) &objp->tunnel_ids.tunnel_ids_len, ~0, + sizeof (uint16_t), (xdrproc_t) xdr_uint16_t)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_tunnel_profile_msg_data (XDR *xdrs, l2tp_api_tunnel_profile_msg_data *objp) +{ + register int32_t *buf; + + + if (xdrs->x_op == XDR_ENCODE) { + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_int (xdrs, &objp->hide_avps)) + return FALSE; + if (!xdr_l2tp_api_tunnel_auth_mode (xdrs, &objp->auth_mode)) + return FALSE; + buf = XDR_INLINE (xdrs, 9 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->framing_cap_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_cap_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_analog)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_tiebreaker)) + return FALSE; + if (!xdr_bool (xdrs, &objp->allow_ppp_proxy)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_udp_checksums)) + return FALSE; + if (!xdr_int (xdrs, &objp->hello_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_retries)) + return FALSE; + + } else { + IXDR_PUT_BOOL(buf, objp->framing_cap_sync); + IXDR_PUT_BOOL(buf, objp->framing_cap_async); + IXDR_PUT_BOOL(buf, objp->bearer_cap_digital); + IXDR_PUT_BOOL(buf, objp->bearer_cap_analog); + IXDR_PUT_BOOL(buf, objp->use_tiebreaker); + IXDR_PUT_BOOL(buf, objp->allow_ppp_proxy); + IXDR_PUT_BOOL(buf, objp->use_udp_checksums); + IXDR_PUT_LONG(buf, objp->hello_timeout); + IXDR_PUT_LONG(buf, objp->max_retries); + } + if (!xdr_uint16_t (xdrs, &objp->rx_window_size)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tx_window_size)) + return FALSE; + if (!xdr_int (xdrs, &objp->retry_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->idle_timeout)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_sessions)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->our_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->peer_addr)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->our_udp_port)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_udp_port)) + return FALSE; + if (!xdr_bool (xdrs, &objp->do_pmtu_discovery)) + return FALSE; + if (!xdr_int (xdrs, &objp->mtu)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->peer_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->session_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ppp_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->secret)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->host_name)) + return FALSE; + return TRUE; + } else if (xdrs->x_op == XDR_DECODE) { + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_int (xdrs, &objp->hide_avps)) + return FALSE; + if (!xdr_l2tp_api_tunnel_auth_mode (xdrs, &objp->auth_mode)) + return FALSE; + buf = XDR_INLINE (xdrs, 9 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->framing_cap_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_cap_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_analog)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_tiebreaker)) + return FALSE; + if (!xdr_bool (xdrs, &objp->allow_ppp_proxy)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_udp_checksums)) + return FALSE; + if (!xdr_int (xdrs, &objp->hello_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_retries)) + return FALSE; + + } else { + objp->framing_cap_sync = IXDR_GET_BOOL(buf); + objp->framing_cap_async = IXDR_GET_BOOL(buf); + objp->bearer_cap_digital = IXDR_GET_BOOL(buf); + objp->bearer_cap_analog = IXDR_GET_BOOL(buf); + objp->use_tiebreaker = IXDR_GET_BOOL(buf); + objp->allow_ppp_proxy = IXDR_GET_BOOL(buf); + objp->use_udp_checksums = IXDR_GET_BOOL(buf); + objp->hello_timeout = IXDR_GET_LONG(buf); + objp->max_retries = IXDR_GET_LONG(buf); + } + if (!xdr_uint16_t (xdrs, &objp->rx_window_size)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tx_window_size)) + return FALSE; + if (!xdr_int (xdrs, &objp->retry_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->idle_timeout)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_sessions)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->our_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->peer_addr)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->our_udp_port)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_udp_port)) + return FALSE; + if (!xdr_bool (xdrs, &objp->do_pmtu_discovery)) + return FALSE; + if (!xdr_int (xdrs, &objp->mtu)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->peer_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->session_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ppp_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->secret)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->host_name)) + return FALSE; + return TRUE; + } + + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_int (xdrs, &objp->hide_avps)) + return FALSE; + if (!xdr_l2tp_api_tunnel_auth_mode (xdrs, &objp->auth_mode)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_cap_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_cap_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_cap_analog)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_tiebreaker)) + return FALSE; + if (!xdr_bool (xdrs, &objp->allow_ppp_proxy)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_udp_checksums)) + return FALSE; + if (!xdr_int (xdrs, &objp->hello_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_retries)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->rx_window_size)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tx_window_size)) + return FALSE; + if (!xdr_int (xdrs, &objp->retry_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->idle_timeout)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_sessions)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->our_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->peer_addr)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->our_udp_port)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_udp_port)) + return FALSE; + if (!xdr_bool (xdrs, &objp->do_pmtu_discovery)) + return FALSE; + if (!xdr_int (xdrs, &objp->mtu)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->peer_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->session_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ppp_profile_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->secret)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->host_name)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_tunnel_profile_list_entry (XDR *xdrs, l2tp_api_tunnel_profile_list_entry *objp) +{ + register int32_t *buf; + + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + if (!xdr_pointer (xdrs, (char **)&objp->next, sizeof (l2tp_api_tunnel_profile_list_entry), (xdrproc_t) xdr_l2tp_api_tunnel_profile_list_entry)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_tunnel_profile_list_msg_data (XDR *xdrs, l2tp_api_tunnel_profile_list_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_int (xdrs, &objp->result)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_profiles)) + return FALSE; + if (!xdr_pointer (xdrs, (char **)&objp->profiles, sizeof (l2tp_api_tunnel_profile_list_entry), (xdrproc_t) xdr_l2tp_api_tunnel_profile_list_entry)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_tunnel_profile_unset_msg_data (XDR *xdrs, l2tp_api_tunnel_profile_unset_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_session_proxy_auth_type (XDR *xdrs, l2tp_api_session_proxy_auth_type *objp) +{ + register int32_t *buf; + + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_session_call_errors (XDR *xdrs, l2tp_api_session_call_errors *objp) +{ + register int32_t *buf; + + if (!xdr_uint32_t (xdrs, &objp->crc_errors)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->framing_errors)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->hardware_overruns)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->buffer_overruns)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->timeout_errors)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->alignment_errors)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_session_stats (XDR *xdrs, l2tp_api_session_stats *objp) +{ + register int32_t *buf; + + if (!xdr_uint64_t (xdrs, &objp->data_rx_packets)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_rx_bytes)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_rx_errors)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_rx_oos_packets)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_rx_oos_discards)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_tx_packets)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_tx_bytes)) + return FALSE; + if (!xdr_uint64_t (xdrs, &objp->data_tx_errors)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_session_peer_info (XDR *xdrs, l2tp_api_session_peer_info *objp) +{ + register int32_t *buf; + + + if (xdrs->x_op == XDR_ENCODE) { + if (!xdr_uint16_t (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->error_code)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->error_message)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->minimum_bps)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->maximum_bps)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->connect_speed)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->rx_connect_speed)) + return FALSE; + if (!xdr_l2tp_api_session_proxy_auth_type (xdrs, &objp->proxy_auth_type)) + return FALSE; + if (!xdr_uint8_t (xdrs, &objp->proxy_auth_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->proxy_auth_name)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->proxy_auth_challenge.proxy_auth_challenge_val, (u_int *) &objp->proxy_auth_challenge.proxy_auth_challenge_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->proxy_auth_response.proxy_auth_response_val, (u_int *) &objp->proxy_auth_response.proxy_auth_response_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->private_group_id)) + return FALSE; + buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->framing_type_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_type_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_analog)) + return FALSE; + if (!xdr_bool (xdrs, &objp->sequencing_required)) + return FALSE; + + } else { + IXDR_PUT_BOOL(buf, objp->framing_type_sync); + IXDR_PUT_BOOL(buf, objp->framing_type_async); + IXDR_PUT_BOOL(buf, objp->bearer_type_digital); + IXDR_PUT_BOOL(buf, objp->bearer_type_analog); + IXDR_PUT_BOOL(buf, objp->sequencing_required); + } + if (!xdr_uint32_t (xdrs, &objp->call_serial_number)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->physical_channel_id)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_val, (u_int *) &objp->initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->last_sent_lcp_confreq.last_sent_lcp_confreq_val, (u_int *) &objp->last_sent_lcp_confreq.last_sent_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_val, (u_int *) &objp->last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->calling_number)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->called_number)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->sub_address)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->q931_cause_code)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->q931_cause_msg)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->q931_advisory_msg)) + return FALSE; + if (!xdr_l2tp_api_session_call_errors (xdrs, &objp->call_errors)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->send_accm)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->recv_accm)) + return FALSE; + return TRUE; + } else if (xdrs->x_op == XDR_DECODE) { + if (!xdr_uint16_t (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->error_code)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->error_message)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->minimum_bps)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->maximum_bps)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->connect_speed)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->rx_connect_speed)) + return FALSE; + if (!xdr_l2tp_api_session_proxy_auth_type (xdrs, &objp->proxy_auth_type)) + return FALSE; + if (!xdr_uint8_t (xdrs, &objp->proxy_auth_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->proxy_auth_name)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->proxy_auth_challenge.proxy_auth_challenge_val, (u_int *) &objp->proxy_auth_challenge.proxy_auth_challenge_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->proxy_auth_response.proxy_auth_response_val, (u_int *) &objp->proxy_auth_response.proxy_auth_response_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->private_group_id)) + return FALSE; + buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->framing_type_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_type_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_analog)) + return FALSE; + if (!xdr_bool (xdrs, &objp->sequencing_required)) + return FALSE; + + } else { + objp->framing_type_sync = IXDR_GET_BOOL(buf); + objp->framing_type_async = IXDR_GET_BOOL(buf); + objp->bearer_type_digital = IXDR_GET_BOOL(buf); + objp->bearer_type_analog = IXDR_GET_BOOL(buf); + objp->sequencing_required = IXDR_GET_BOOL(buf); + } + if (!xdr_uint32_t (xdrs, &objp->call_serial_number)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->physical_channel_id)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_val, (u_int *) &objp->initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->last_sent_lcp_confreq.last_sent_lcp_confreq_val, (u_int *) &objp->last_sent_lcp_confreq.last_sent_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_val, (u_int *) &objp->last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->calling_number)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->called_number)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->sub_address)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->q931_cause_code)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->q931_cause_msg)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->q931_advisory_msg)) + return FALSE; + if (!xdr_l2tp_api_session_call_errors (xdrs, &objp->call_errors)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->send_accm)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->recv_accm)) + return FALSE; + return TRUE; + } + + if (!xdr_uint16_t (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->error_code)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->error_message)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->minimum_bps)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->maximum_bps)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->connect_speed)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->rx_connect_speed)) + return FALSE; + if (!xdr_l2tp_api_session_proxy_auth_type (xdrs, &objp->proxy_auth_type)) + return FALSE; + if (!xdr_uint8_t (xdrs, &objp->proxy_auth_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->proxy_auth_name)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->proxy_auth_challenge.proxy_auth_challenge_val, (u_int *) &objp->proxy_auth_challenge.proxy_auth_challenge_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->proxy_auth_response.proxy_auth_response_val, (u_int *) &objp->proxy_auth_response.proxy_auth_response_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->private_group_id)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_type_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_type_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_analog)) + return FALSE; + if (!xdr_bool (xdrs, &objp->sequencing_required)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->call_serial_number)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->physical_channel_id)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_val, (u_int *) &objp->initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->last_sent_lcp_confreq.last_sent_lcp_confreq_val, (u_int *) &objp->last_sent_lcp_confreq.last_sent_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_val, (u_int *) &objp->last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->calling_number)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->called_number)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->sub_address)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->q931_cause_code)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->q931_cause_msg)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->q931_advisory_msg)) + return FALSE; + if (!xdr_l2tp_api_session_call_errors (xdrs, &objp->call_errors)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->send_accm)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->recv_accm)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_session_type (XDR *xdrs, l2tp_api_session_type *objp) +{ + register int32_t *buf; + + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_session_msg_data (XDR *xdrs, l2tp_api_session_msg_data *objp) +{ + register int32_t *buf; + + + if (xdrs->x_op == XDR_ENCODE) { + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->session_id)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->tunnel_name)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_session_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->state)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->session_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->interface_name)) + return FALSE; + if (!xdr_l2tp_api_session_type (xdrs, &objp->session_type)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->user_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->user_password)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->priv_group_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->profile_name)) + return FALSE; + if (!xdr_bool (xdrs, &objp->created_by_admin)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->create_time)) + return FALSE; + buf = XDR_INLINE (xdrs, 8 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->no_ppp)) + return FALSE; + if (!xdr_bool (xdrs, &objp->sequencing_required)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_sequence_numbers)) + return FALSE; + if (!xdr_int (xdrs, &objp->reorder_timeout)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_type_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_type_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_analog)) + return FALSE; + + } else { + IXDR_PUT_BOOL(buf, objp->no_ppp); + IXDR_PUT_BOOL(buf, objp->sequencing_required); + IXDR_PUT_BOOL(buf, objp->use_sequence_numbers); + IXDR_PUT_LONG(buf, objp->reorder_timeout); + IXDR_PUT_BOOL(buf, objp->framing_type_sync); + IXDR_PUT_BOOL(buf, objp->framing_type_async); + IXDR_PUT_BOOL(buf, objp->bearer_type_digital); + IXDR_PUT_BOOL(buf, objp->bearer_type_analog); + } + if (!xdr_uint32_t (xdrs, &objp->call_serial_number)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->physical_channel_id)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->minimum_bps)) + return FALSE; + if (!xdr_int (xdrs, &objp->maximum_bps)) + return FALSE; + if (!xdr_int (xdrs, &objp->tx_connect_speed)) + return FALSE; + if (!xdr_int (xdrs, &objp->rx_connect_speed)) + return FALSE; + + } else { + IXDR_PUT_LONG(buf, objp->minimum_bps); + IXDR_PUT_LONG(buf, objp->maximum_bps); + IXDR_PUT_LONG(buf, objp->tx_connect_speed); + IXDR_PUT_LONG(buf, objp->rx_connect_speed); + } + if (!xdr_l2tp_api_session_peer_info (xdrs, &objp->peer)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ppp_profile_name)) + return FALSE; + if (!xdr_l2tp_api_session_stats (xdrs, &objp->stats)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_ppp_proxy)) + return FALSE; + if (!xdr_l2tp_api_session_proxy_auth_type (xdrs, &objp->proxy_auth_type)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->proxy_auth_name)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->proxy_auth_challenge.proxy_auth_challenge_val, (u_int *) &objp->proxy_auth_challenge.proxy_auth_challenge_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->proxy_auth_response.proxy_auth_response_val, (u_int *) &objp->proxy_auth_response.proxy_auth_response_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->calling_number)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->called_number)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->sub_address)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_val, (u_int *) &objp->initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->last_sent_lcp_confreq.last_sent_lcp_confreq_val, (u_int *) &objp->last_sent_lcp_confreq.last_sent_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_val, (u_int *) &objp->last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + return TRUE; + } else if (xdrs->x_op == XDR_DECODE) { + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->session_id)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->tunnel_name)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_session_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->state)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->session_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->interface_name)) + return FALSE; + if (!xdr_l2tp_api_session_type (xdrs, &objp->session_type)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->user_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->user_password)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->priv_group_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->profile_name)) + return FALSE; + if (!xdr_bool (xdrs, &objp->created_by_admin)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->create_time)) + return FALSE; + buf = XDR_INLINE (xdrs, 8 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->no_ppp)) + return FALSE; + if (!xdr_bool (xdrs, &objp->sequencing_required)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_sequence_numbers)) + return FALSE; + if (!xdr_int (xdrs, &objp->reorder_timeout)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_type_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_type_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_analog)) + return FALSE; + + } else { + objp->no_ppp = IXDR_GET_BOOL(buf); + objp->sequencing_required = IXDR_GET_BOOL(buf); + objp->use_sequence_numbers = IXDR_GET_BOOL(buf); + objp->reorder_timeout = IXDR_GET_LONG(buf); + objp->framing_type_sync = IXDR_GET_BOOL(buf); + objp->framing_type_async = IXDR_GET_BOOL(buf); + objp->bearer_type_digital = IXDR_GET_BOOL(buf); + objp->bearer_type_analog = IXDR_GET_BOOL(buf); + } + if (!xdr_uint32_t (xdrs, &objp->call_serial_number)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->physical_channel_id)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->minimum_bps)) + return FALSE; + if (!xdr_int (xdrs, &objp->maximum_bps)) + return FALSE; + if (!xdr_int (xdrs, &objp->tx_connect_speed)) + return FALSE; + if (!xdr_int (xdrs, &objp->rx_connect_speed)) + return FALSE; + + } else { + objp->minimum_bps = IXDR_GET_LONG(buf); + objp->maximum_bps = IXDR_GET_LONG(buf); + objp->tx_connect_speed = IXDR_GET_LONG(buf); + objp->rx_connect_speed = IXDR_GET_LONG(buf); + } + if (!xdr_l2tp_api_session_peer_info (xdrs, &objp->peer)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ppp_profile_name)) + return FALSE; + if (!xdr_l2tp_api_session_stats (xdrs, &objp->stats)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_ppp_proxy)) + return FALSE; + if (!xdr_l2tp_api_session_proxy_auth_type (xdrs, &objp->proxy_auth_type)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->proxy_auth_name)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->proxy_auth_challenge.proxy_auth_challenge_val, (u_int *) &objp->proxy_auth_challenge.proxy_auth_challenge_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->proxy_auth_response.proxy_auth_response_val, (u_int *) &objp->proxy_auth_response.proxy_auth_response_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->calling_number)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->called_number)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->sub_address)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_val, (u_int *) &objp->initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->last_sent_lcp_confreq.last_sent_lcp_confreq_val, (u_int *) &objp->last_sent_lcp_confreq.last_sent_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_val, (u_int *) &objp->last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + return TRUE; + } + + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->session_id)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->tunnel_name)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->peer_session_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->state)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->session_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->interface_name)) + return FALSE; + if (!xdr_l2tp_api_session_type (xdrs, &objp->session_type)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->user_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->user_password)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->priv_group_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->profile_name)) + return FALSE; + if (!xdr_bool (xdrs, &objp->created_by_admin)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->create_time)) + return FALSE; + if (!xdr_bool (xdrs, &objp->no_ppp)) + return FALSE; + if (!xdr_bool (xdrs, &objp->sequencing_required)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_sequence_numbers)) + return FALSE; + if (!xdr_int (xdrs, &objp->reorder_timeout)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_type_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_type_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_analog)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->call_serial_number)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->physical_channel_id)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + if (!xdr_int (xdrs, &objp->minimum_bps)) + return FALSE; + if (!xdr_int (xdrs, &objp->maximum_bps)) + return FALSE; + if (!xdr_int (xdrs, &objp->tx_connect_speed)) + return FALSE; + if (!xdr_int (xdrs, &objp->rx_connect_speed)) + return FALSE; + if (!xdr_l2tp_api_session_peer_info (xdrs, &objp->peer)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ppp_profile_name)) + return FALSE; + if (!xdr_l2tp_api_session_stats (xdrs, &objp->stats)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_ppp_proxy)) + return FALSE; + if (!xdr_l2tp_api_session_proxy_auth_type (xdrs, &objp->proxy_auth_type)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->proxy_auth_name)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->proxy_auth_challenge.proxy_auth_challenge_val, (u_int *) &objp->proxy_auth_challenge.proxy_auth_challenge_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->proxy_auth_response.proxy_auth_response_val, (u_int *) &objp->proxy_auth_response.proxy_auth_response_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->calling_number)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->called_number)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->sub_address)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_val, (u_int *) &objp->initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->last_sent_lcp_confreq.last_sent_lcp_confreq_val, (u_int *) &objp->last_sent_lcp_confreq.last_sent_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_val, (u_int *) &objp->last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_len, ~0, + sizeof (uint8_t), (xdrproc_t) xdr_uint8_t)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_session_list_msg_data (XDR *xdrs, l2tp_api_session_list_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_int (xdrs, &objp->result)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->session_ids.session_ids_val, (u_int *) &objp->session_ids.session_ids_len, ~0, + sizeof (uint16_t), (xdrproc_t) xdr_uint16_t)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_session_incall_msg_data (XDR *xdrs, l2tp_api_session_incall_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_int (xdrs, &objp->ppp_unit)) + return FALSE; + if (!xdr_string (xdrs, &objp->tunnel_profile_name, ~0)) + return FALSE; + if (!xdr_l2tp_api_session_msg_data (xdrs, &objp->session)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_session_profile_msg_data (XDR *xdrs, l2tp_api_session_profile_msg_data *objp) +{ + register int32_t *buf; + + + if (xdrs->x_op == XDR_ENCODE) { + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + buf = XDR_INLINE (xdrs, 7 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->sequencing_required)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_sequence_numbers)) + return FALSE; + if (!xdr_bool (xdrs, &objp->no_ppp)) + return FALSE; + if (!xdr_int (xdrs, &objp->reorder_timeout)) + return FALSE; + if (!xdr_bool (xdrs, &objp->do_pmtu_discovery)) + return FALSE; + if (!xdr_int (xdrs, &objp->mtu)) + return FALSE; + if (!xdr_int (xdrs, &objp->mru)) + return FALSE; + + } else { + IXDR_PUT_BOOL(buf, objp->sequencing_required); + IXDR_PUT_BOOL(buf, objp->use_sequence_numbers); + IXDR_PUT_BOOL(buf, objp->no_ppp); + IXDR_PUT_LONG(buf, objp->reorder_timeout); + IXDR_PUT_BOOL(buf, objp->do_pmtu_discovery); + IXDR_PUT_LONG(buf, objp->mtu); + IXDR_PUT_LONG(buf, objp->mru); + } + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ppp_profile_name)) + return FALSE; + if (!xdr_l2tp_api_session_type (xdrs, &objp->session_type)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->priv_group_id)) + return FALSE; + buf = XDR_INLINE (xdrs, 9 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->framing_type_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_type_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_analog)) + return FALSE; + if (!xdr_int (xdrs, &objp->minimum_bps)) + return FALSE; + if (!xdr_int (xdrs, &objp->maximum_bps)) + return FALSE; + if (!xdr_int (xdrs, &objp->tx_connect_speed)) + return FALSE; + if (!xdr_int (xdrs, &objp->rx_connect_speed)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_ppp_proxy)) + return FALSE; + } else { + IXDR_PUT_BOOL(buf, objp->framing_type_sync); + IXDR_PUT_BOOL(buf, objp->framing_type_async); + IXDR_PUT_BOOL(buf, objp->bearer_type_digital); + IXDR_PUT_BOOL(buf, objp->bearer_type_analog); + IXDR_PUT_LONG(buf, objp->minimum_bps); + IXDR_PUT_LONG(buf, objp->maximum_bps); + IXDR_PUT_LONG(buf, objp->tx_connect_speed); + IXDR_PUT_LONG(buf, objp->rx_connect_speed); + IXDR_PUT_BOOL(buf, objp->use_ppp_proxy); + } + return TRUE; + } else if (xdrs->x_op == XDR_DECODE) { + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + buf = XDR_INLINE (xdrs, 7 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->sequencing_required)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_sequence_numbers)) + return FALSE; + if (!xdr_bool (xdrs, &objp->no_ppp)) + return FALSE; + if (!xdr_int (xdrs, &objp->reorder_timeout)) + return FALSE; + if (!xdr_bool (xdrs, &objp->do_pmtu_discovery)) + return FALSE; + if (!xdr_int (xdrs, &objp->mtu)) + return FALSE; + if (!xdr_int (xdrs, &objp->mru)) + return FALSE; + + } else { + objp->sequencing_required = IXDR_GET_BOOL(buf); + objp->use_sequence_numbers = IXDR_GET_BOOL(buf); + objp->no_ppp = IXDR_GET_BOOL(buf); + objp->reorder_timeout = IXDR_GET_LONG(buf); + objp->do_pmtu_discovery = IXDR_GET_BOOL(buf); + objp->mtu = IXDR_GET_LONG(buf); + objp->mru = IXDR_GET_LONG(buf); + } + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ppp_profile_name)) + return FALSE; + if (!xdr_l2tp_api_session_type (xdrs, &objp->session_type)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->priv_group_id)) + return FALSE; + buf = XDR_INLINE (xdrs, 9 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->framing_type_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_type_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_analog)) + return FALSE; + if (!xdr_int (xdrs, &objp->minimum_bps)) + return FALSE; + if (!xdr_int (xdrs, &objp->maximum_bps)) + return FALSE; + if (!xdr_int (xdrs, &objp->tx_connect_speed)) + return FALSE; + if (!xdr_int (xdrs, &objp->rx_connect_speed)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_ppp_proxy)) + return FALSE; + } else { + objp->framing_type_sync = IXDR_GET_BOOL(buf); + objp->framing_type_async = IXDR_GET_BOOL(buf); + objp->bearer_type_digital = IXDR_GET_BOOL(buf); + objp->bearer_type_analog = IXDR_GET_BOOL(buf); + objp->minimum_bps = IXDR_GET_LONG(buf); + objp->maximum_bps = IXDR_GET_LONG(buf); + objp->tx_connect_speed = IXDR_GET_LONG(buf); + objp->rx_connect_speed = IXDR_GET_LONG(buf); + objp->use_ppp_proxy = IXDR_GET_BOOL(buf); + } + return TRUE; + } + + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + if (!xdr_bool (xdrs, &objp->sequencing_required)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_sequence_numbers)) + return FALSE; + if (!xdr_bool (xdrs, &objp->no_ppp)) + return FALSE; + if (!xdr_int (xdrs, &objp->reorder_timeout)) + return FALSE; + if (!xdr_bool (xdrs, &objp->do_pmtu_discovery)) + return FALSE; + if (!xdr_int (xdrs, &objp->mtu)) + return FALSE; + if (!xdr_int (xdrs, &objp->mru)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ppp_profile_name)) + return FALSE; + if (!xdr_l2tp_api_session_type (xdrs, &objp->session_type)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->priv_group_id)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_type_sync)) + return FALSE; + if (!xdr_bool (xdrs, &objp->framing_type_async)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_digital)) + return FALSE; + if (!xdr_bool (xdrs, &objp->bearer_type_analog)) + return FALSE; + if (!xdr_int (xdrs, &objp->minimum_bps)) + return FALSE; + if (!xdr_int (xdrs, &objp->maximum_bps)) + return FALSE; + if (!xdr_int (xdrs, &objp->tx_connect_speed)) + return FALSE; + if (!xdr_int (xdrs, &objp->rx_connect_speed)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_ppp_proxy)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_session_profile_list_entry (XDR *xdrs, l2tp_api_session_profile_list_entry *objp) +{ + register int32_t *buf; + + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + if (!xdr_pointer (xdrs, (char **)&objp->next, sizeof (l2tp_api_session_profile_list_entry), (xdrproc_t) xdr_l2tp_api_session_profile_list_entry)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_session_profile_list_msg_data (XDR *xdrs, l2tp_api_session_profile_list_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_int (xdrs, &objp->result)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_profiles)) + return FALSE; + if (!xdr_pointer (xdrs, (char **)&objp->profiles, sizeof (l2tp_api_session_profile_list_entry), (xdrproc_t) xdr_l2tp_api_session_profile_list_entry)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_session_profile_unset_msg_data (XDR *xdrs, l2tp_api_session_profile_unset_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_ppp_sync_mode (XDR *xdrs, l2tp_api_ppp_sync_mode *objp) +{ + register int32_t *buf; + + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_ppp_profile_msg_data (XDR *xdrs, l2tp_api_ppp_profile_msg_data *objp) +{ + register int32_t *buf; + + + if (xdrs->x_op == XDR_ENCODE) { + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->flags2)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->asyncmap)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->mru)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->mtu)) + return FALSE; + buf = XDR_INLINE (xdrs, 7 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->auth_none)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_peer)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_pap)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_chap)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_mschap)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_mschapv2)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_eap)) + return FALSE; + + } else { + IXDR_PUT_BOOL(buf, objp->auth_none); + IXDR_PUT_BOOL(buf, objp->auth_peer); + IXDR_PUT_BOOL(buf, objp->auth_refuse_pap); + IXDR_PUT_BOOL(buf, objp->auth_refuse_chap); + IXDR_PUT_BOOL(buf, objp->auth_refuse_mschap); + IXDR_PUT_BOOL(buf, objp->auth_refuse_mschapv2); + IXDR_PUT_BOOL(buf, objp->auth_refuse_eap); + } + if (!xdr_l2tp_api_ppp_sync_mode (xdrs, &objp->sync_mode)) + return FALSE; + buf = XDR_INLINE (xdrs, 19 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->chap_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->chap_max_challenge)) + return FALSE; + if (!xdr_int (xdrs, &objp->chap_restart)) + return FALSE; + if (!xdr_int (xdrs, &objp->pap_max_auth_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->pap_restart_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->pap_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->idle_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->ipcp_max_config_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->ipcp_max_config_naks)) + return FALSE; + if (!xdr_int (xdrs, &objp->ipcp_max_terminate_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->ipcp_retransmit_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_echo_failure_count)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_echo_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_max_config_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_max_config_naks)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_max_terminate_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_retransmit_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_connect_time)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_failure_count)) + return FALSE; + + } else { + IXDR_PUT_LONG(buf, objp->chap_interval); + IXDR_PUT_LONG(buf, objp->chap_max_challenge); + IXDR_PUT_LONG(buf, objp->chap_restart); + IXDR_PUT_LONG(buf, objp->pap_max_auth_requests); + IXDR_PUT_LONG(buf, objp->pap_restart_interval); + IXDR_PUT_LONG(buf, objp->pap_timeout); + IXDR_PUT_LONG(buf, objp->idle_timeout); + IXDR_PUT_LONG(buf, objp->ipcp_max_config_requests); + IXDR_PUT_LONG(buf, objp->ipcp_max_config_naks); + IXDR_PUT_LONG(buf, objp->ipcp_max_terminate_requests); + IXDR_PUT_LONG(buf, objp->ipcp_retransmit_interval); + IXDR_PUT_LONG(buf, objp->lcp_echo_failure_count); + IXDR_PUT_LONG(buf, objp->lcp_echo_interval); + IXDR_PUT_LONG(buf, objp->lcp_max_config_requests); + IXDR_PUT_LONG(buf, objp->lcp_max_config_naks); + IXDR_PUT_LONG(buf, objp->lcp_max_terminate_requests); + IXDR_PUT_LONG(buf, objp->lcp_retransmit_interval); + IXDR_PUT_LONG(buf, objp->max_connect_time); + IXDR_PUT_LONG(buf, objp->max_failure_count); + } + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->local_ip_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->peer_ip_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->dns_addr_1)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->dns_addr_2)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->wins_addr_1)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->wins_addr_2)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ip_pool_name)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_radius)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->radius_hint)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_as_default_route)) + return FALSE; + if (!xdr_bool (xdrs, &objp->multilink)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->local_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->remote_name)) + return FALSE; + if (!xdr_bool (xdrs, &objp->proxy_arp)) + return FALSE; + return TRUE; + } else if (xdrs->x_op == XDR_DECODE) { + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->flags2)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->asyncmap)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->mru)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->mtu)) + return FALSE; + buf = XDR_INLINE (xdrs, 7 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->auth_none)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_peer)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_pap)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_chap)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_mschap)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_mschapv2)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_eap)) + return FALSE; + + } else { + objp->auth_none = IXDR_GET_BOOL(buf); + objp->auth_peer = IXDR_GET_BOOL(buf); + objp->auth_refuse_pap = IXDR_GET_BOOL(buf); + objp->auth_refuse_chap = IXDR_GET_BOOL(buf); + objp->auth_refuse_mschap = IXDR_GET_BOOL(buf); + objp->auth_refuse_mschapv2 = IXDR_GET_BOOL(buf); + objp->auth_refuse_eap = IXDR_GET_BOOL(buf); + } + if (!xdr_l2tp_api_ppp_sync_mode (xdrs, &objp->sync_mode)) + return FALSE; + buf = XDR_INLINE (xdrs, 19 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->chap_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->chap_max_challenge)) + return FALSE; + if (!xdr_int (xdrs, &objp->chap_restart)) + return FALSE; + if (!xdr_int (xdrs, &objp->pap_max_auth_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->pap_restart_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->pap_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->idle_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->ipcp_max_config_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->ipcp_max_config_naks)) + return FALSE; + if (!xdr_int (xdrs, &objp->ipcp_max_terminate_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->ipcp_retransmit_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_echo_failure_count)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_echo_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_max_config_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_max_config_naks)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_max_terminate_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_retransmit_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_connect_time)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_failure_count)) + return FALSE; + + } else { + objp->chap_interval = IXDR_GET_LONG(buf); + objp->chap_max_challenge = IXDR_GET_LONG(buf); + objp->chap_restart = IXDR_GET_LONG(buf); + objp->pap_max_auth_requests = IXDR_GET_LONG(buf); + objp->pap_restart_interval = IXDR_GET_LONG(buf); + objp->pap_timeout = IXDR_GET_LONG(buf); + objp->idle_timeout = IXDR_GET_LONG(buf); + objp->ipcp_max_config_requests = IXDR_GET_LONG(buf); + objp->ipcp_max_config_naks = IXDR_GET_LONG(buf); + objp->ipcp_max_terminate_requests = IXDR_GET_LONG(buf); + objp->ipcp_retransmit_interval = IXDR_GET_LONG(buf); + objp->lcp_echo_failure_count = IXDR_GET_LONG(buf); + objp->lcp_echo_interval = IXDR_GET_LONG(buf); + objp->lcp_max_config_requests = IXDR_GET_LONG(buf); + objp->lcp_max_config_naks = IXDR_GET_LONG(buf); + objp->lcp_max_terminate_requests = IXDR_GET_LONG(buf); + objp->lcp_retransmit_interval = IXDR_GET_LONG(buf); + objp->max_connect_time = IXDR_GET_LONG(buf); + objp->max_failure_count = IXDR_GET_LONG(buf); + } + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->local_ip_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->peer_ip_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->dns_addr_1)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->dns_addr_2)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->wins_addr_1)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->wins_addr_2)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ip_pool_name)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_radius)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->radius_hint)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_as_default_route)) + return FALSE; + if (!xdr_bool (xdrs, &objp->multilink)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->local_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->remote_name)) + return FALSE; + if (!xdr_bool (xdrs, &objp->proxy_arp)) + return FALSE; + return TRUE; + } + + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->flags2)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->trace_flags_mask)) + return FALSE; + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->asyncmap)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->mru)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->mtu)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_none)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_peer)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_pap)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_chap)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_mschap)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_mschapv2)) + return FALSE; + if (!xdr_bool (xdrs, &objp->auth_refuse_eap)) + return FALSE; + if (!xdr_l2tp_api_ppp_sync_mode (xdrs, &objp->sync_mode)) + return FALSE; + if (!xdr_int (xdrs, &objp->chap_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->chap_max_challenge)) + return FALSE; + if (!xdr_int (xdrs, &objp->chap_restart)) + return FALSE; + if (!xdr_int (xdrs, &objp->pap_max_auth_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->pap_restart_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->pap_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->idle_timeout)) + return FALSE; + if (!xdr_int (xdrs, &objp->ipcp_max_config_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->ipcp_max_config_naks)) + return FALSE; + if (!xdr_int (xdrs, &objp->ipcp_max_terminate_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->ipcp_retransmit_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_echo_failure_count)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_echo_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_max_config_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_max_config_naks)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_max_terminate_requests)) + return FALSE; + if (!xdr_int (xdrs, &objp->lcp_retransmit_interval)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_connect_time)) + return FALSE; + if (!xdr_int (xdrs, &objp->max_failure_count)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->local_ip_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->peer_ip_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->dns_addr_1)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->dns_addr_2)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->wins_addr_1)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->wins_addr_2)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->ip_pool_name)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_radius)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->radius_hint)) + return FALSE; + if (!xdr_bool (xdrs, &objp->use_as_default_route)) + return FALSE; + if (!xdr_bool (xdrs, &objp->multilink)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->local_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->remote_name)) + return FALSE; + if (!xdr_bool (xdrs, &objp->proxy_arp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_ppp_profile_list_entry (XDR *xdrs, l2tp_api_ppp_profile_list_entry *objp) +{ + register int32_t *buf; + + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + if (!xdr_pointer (xdrs, (char **)&objp->next, sizeof (l2tp_api_ppp_profile_list_entry), (xdrproc_t) xdr_l2tp_api_ppp_profile_list_entry)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_ppp_profile_list_msg_data (XDR *xdrs, l2tp_api_ppp_profile_list_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_int (xdrs, &objp->result)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_profiles)) + return FALSE; + if (!xdr_pointer (xdrs, (char **)&objp->profiles, sizeof (l2tp_api_ppp_profile_list_entry), (xdrproc_t) xdr_l2tp_api_ppp_profile_list_entry)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_ppp_profile_unset_msg_data (XDR *xdrs, l2tp_api_ppp_profile_unset_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_uint32_t (xdrs, &objp->flags2)) + return FALSE; + if (!xdr_int (xdrs, &objp->result_code)) + return FALSE; + if (!xdr_string (xdrs, &objp->profile_name, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_user_list_entry (XDR *xdrs, l2tp_api_user_list_entry *objp) +{ + register int32_t *buf; + + if (!xdr_string (xdrs, &objp->user_name, ~0)) + return FALSE; + if (!xdr_string (xdrs, &objp->create_time, ~0)) + return FALSE; + if (!xdr_bool (xdrs, &objp->created_by_admin)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->session_id)) + return FALSE; + if (!xdr_pointer (xdrs, (char **)&objp->next, sizeof (l2tp_api_user_list_entry), (xdrproc_t) xdr_l2tp_api_user_list_entry)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_user_list_msg_data (XDR *xdrs, l2tp_api_user_list_msg_data *objp) +{ + register int32_t *buf; + + if (!xdr_int (xdrs, &objp->result)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_users)) + return FALSE; + if (!xdr_pointer (xdrs, (char **)&objp->users, sizeof (l2tp_api_user_list_entry), (xdrproc_t) xdr_l2tp_api_user_list_entry)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_test_trigger_type (XDR *xdrs, l2tp_api_test_trigger_type *objp) +{ + register int32_t *buf; + + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_api_test_msg_data (XDR *xdrs, l2tp_api_test_msg_data *objp) +{ + register int32_t *buf; + + + if (xdrs->x_op == XDR_ENCODE) { + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + buf = XDR_INLINE (xdrs, 9 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->fake_rx_drop)) + return FALSE; + if (!xdr_bool (xdrs, &objp->fake_tx_drop)) + return FALSE; + if (!xdr_bool (xdrs, &objp->fake_trigger_fired)) + return FALSE; + if (!xdr_bool (xdrs, &objp->hold_tunnels)) + return FALSE; + if (!xdr_bool (xdrs, &objp->hold_sessions)) + return FALSE; + if (!xdr_bool (xdrs, &objp->no_random_ids)) + return FALSE; + if (!xdr_bool (xdrs, &objp->show_profile_usage)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_rx_drops)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_tx_drops)) + return FALSE; + + } else { + IXDR_PUT_BOOL(buf, objp->fake_rx_drop); + IXDR_PUT_BOOL(buf, objp->fake_tx_drop); + IXDR_PUT_BOOL(buf, objp->fake_trigger_fired); + IXDR_PUT_BOOL(buf, objp->hold_tunnels); + IXDR_PUT_BOOL(buf, objp->hold_sessions); + IXDR_PUT_BOOL(buf, objp->no_random_ids); + IXDR_PUT_BOOL(buf, objp->show_profile_usage); + IXDR_PUT_LONG(buf, objp->num_rx_drops); + IXDR_PUT_LONG(buf, objp->num_tx_drops); + } + if (!xdr_l2tp_api_test_trigger_type (xdrs, &objp->fake_trigger_type)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->session_id)) + return FALSE; + buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->num_tunnel_id_hash_hits)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_tunnel_id_hash_misses)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_tunnel_name_hash_hits)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_tunnel_name_hash_misses)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_session_id_hash_hits)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_session_id_hash_misses)) + return FALSE; + } else { + IXDR_PUT_LONG(buf, objp->num_tunnel_id_hash_hits); + IXDR_PUT_LONG(buf, objp->num_tunnel_id_hash_misses); + IXDR_PUT_LONG(buf, objp->num_tunnel_name_hash_hits); + IXDR_PUT_LONG(buf, objp->num_tunnel_name_hash_misses); + IXDR_PUT_LONG(buf, objp->num_session_id_hash_hits); + IXDR_PUT_LONG(buf, objp->num_session_id_hash_misses); + } + return TRUE; + } else if (xdrs->x_op == XDR_DECODE) { + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + buf = XDR_INLINE (xdrs, 9 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_bool (xdrs, &objp->fake_rx_drop)) + return FALSE; + if (!xdr_bool (xdrs, &objp->fake_tx_drop)) + return FALSE; + if (!xdr_bool (xdrs, &objp->fake_trigger_fired)) + return FALSE; + if (!xdr_bool (xdrs, &objp->hold_tunnels)) + return FALSE; + if (!xdr_bool (xdrs, &objp->hold_sessions)) + return FALSE; + if (!xdr_bool (xdrs, &objp->no_random_ids)) + return FALSE; + if (!xdr_bool (xdrs, &objp->show_profile_usage)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_rx_drops)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_tx_drops)) + return FALSE; + + } else { + objp->fake_rx_drop = IXDR_GET_BOOL(buf); + objp->fake_tx_drop = IXDR_GET_BOOL(buf); + objp->fake_trigger_fired = IXDR_GET_BOOL(buf); + objp->hold_tunnels = IXDR_GET_BOOL(buf); + objp->hold_sessions = IXDR_GET_BOOL(buf); + objp->no_random_ids = IXDR_GET_BOOL(buf); + objp->show_profile_usage = IXDR_GET_BOOL(buf); + objp->num_rx_drops = IXDR_GET_LONG(buf); + objp->num_tx_drops = IXDR_GET_LONG(buf); + } + if (!xdr_l2tp_api_test_trigger_type (xdrs, &objp->fake_trigger_type)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->session_id)) + return FALSE; + buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->num_tunnel_id_hash_hits)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_tunnel_id_hash_misses)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_tunnel_name_hash_hits)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_tunnel_name_hash_misses)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_session_id_hash_hits)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_session_id_hash_misses)) + return FALSE; + } else { + objp->num_tunnel_id_hash_hits = IXDR_GET_LONG(buf); + objp->num_tunnel_id_hash_misses = IXDR_GET_LONG(buf); + objp->num_tunnel_name_hash_hits = IXDR_GET_LONG(buf); + objp->num_tunnel_name_hash_misses = IXDR_GET_LONG(buf); + objp->num_session_id_hash_hits = IXDR_GET_LONG(buf); + objp->num_session_id_hash_misses = IXDR_GET_LONG(buf); + } + return TRUE; + } + + if (!xdr_uint32_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_bool (xdrs, &objp->fake_rx_drop)) + return FALSE; + if (!xdr_bool (xdrs, &objp->fake_tx_drop)) + return FALSE; + if (!xdr_bool (xdrs, &objp->fake_trigger_fired)) + return FALSE; + if (!xdr_bool (xdrs, &objp->hold_tunnels)) + return FALSE; + if (!xdr_bool (xdrs, &objp->hold_sessions)) + return FALSE; + if (!xdr_bool (xdrs, &objp->no_random_ids)) + return FALSE; + if (!xdr_bool (xdrs, &objp->show_profile_usage)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_rx_drops)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_tx_drops)) + return FALSE; + if (!xdr_l2tp_api_test_trigger_type (xdrs, &objp->fake_trigger_type)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->session_id)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_tunnel_id_hash_hits)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_tunnel_id_hash_misses)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_tunnel_name_hash_hits)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_tunnel_name_hash_misses)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_session_id_hash_hits)) + return FALSE; + if (!xdr_int (xdrs, &objp->num_session_id_hash_misses)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_tunnel_delete_1_argument (XDR *xdrs, l2tp_tunnel_delete_1_argument *objp) +{ + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->tunnel_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->reason)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_tunnel_get_1_argument (XDR *xdrs, l2tp_tunnel_get_1_argument *objp) +{ + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->tunnel_name)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_session_delete_1_argument (XDR *xdrs, l2tp_session_delete_1_argument *objp) +{ + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->tunnel_name)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->session_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->session_name)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->reason)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_session_get_1_argument (XDR *xdrs, l2tp_session_get_1_argument *objp) +{ + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->tunnel_name)) + return FALSE; + if (!xdr_uint16_t (xdrs, &objp->session_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->session_name)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_session_list_1_argument (XDR *xdrs, l2tp_session_list_1_argument *objp) +{ + if (!xdr_uint16_t (xdrs, &objp->tunnel_id)) + return FALSE; + if (!xdr_optstring (xdrs, &objp->tunnel_name)) + return FALSE; + return TRUE; +} + +bool_t +xdr_l2tp_peer_get_1_argument (XDR *xdrs, l2tp_peer_get_1_argument *objp) +{ + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->local_addr)) + return FALSE; + if (!xdr_l2tp_api_ip_addr (xdrs, &objp->peer_addr)) + return FALSE; + return TRUE; +} diff --git a/net/opennhrp/Makefile b/net/opennhrp/Makefile new file mode 100644 index 0000000..b086f65 --- /dev/null +++ b/net/opennhrp/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2009-2011 OpenWrt.org +# Copyright (C) 2009 Jakob Pfeiffer +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=opennhrp +PKG_VERSION:=0.12.3 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/opennhrp +PKG_MD5SUM:=4d0ec7c0282e181ecca4d78e52067da3 + +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/opennhrp + SECTION:=net + CATEGORY:=Network + SUBMENU:=VPN + DEPENDS:=+libcares +ipsec-tools +ip +kmod-gre + KCONFIG:=CONFIG_ARPD=y + TITLE:=NBMA Next Hop Resolution Protocol + URL:=http://opennhrp.sourceforge.net/ +endef + +define Package/opennhrp/description + OpenNHRP implements NBMA Next Hop Resolution Protocol (as defined in RFC 2332). + It makes it possible to create dynamic multipoint VPN Linux router using NHRP, + GRE and IPsec. It aims to be Cisco DMVPN compatible. +endef + +define Package/opennhrp/conffiles +/etc/opennhrp/opennhrp.conf +endef + +define Package/opennhrp/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/opennhrp{,ctl} $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/opennhrp + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/opennhrp/opennhrp.conf $(1)/etc/opennhrp/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/opennhrp/opennhrp-script $(1)/etc/opennhrp/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/opennhrp/racoon-ph1down.sh $(1)/etc/opennhrp/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/opennhrp/racoon-ph1dead.sh $(1)/etc/opennhrp/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/opennhrp.init $(1)/etc/init.d/opennhrp +endef + +$(eval $(call BuildPackage,opennhrp)) diff --git a/net/opennhrp/files/opennhrp.init b/net/opennhrp/files/opennhrp.init new file mode 100755 index 0000000..8831287 --- /dev/null +++ b/net/opennhrp/files/opennhrp.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2011 OpenWrt.org +# Copyright (C) 2009 Jakob Pfeiffer + +START=50 + +SERVICE_USE_PID=1 + +start() { + service_start /usr/sbin/opennhrp -d +} + +stop() { + service_stop /usr/sbin/opennhrp +} diff --git a/net/openntpd/Makefile b/net/openntpd/Makefile new file mode 100644 index 0000000..d6c139c --- /dev/null +++ b/net/openntpd/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2006-2011 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:=openntpd +PKG_VERSION:=3.9p1 +PKG_RELEASE:=5 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/ \ + ftp://ftp.de.openbsd.org/pub/unix/OpenBSD/OpenNTPD/ \ + ftp://ftp.fr.openbsd.org/pub/OpenBSD/OpenNTPD/ \ + ftp://ftp.sunet.se/pub/OpenBSD/OpenNTPD/ +PKG_MD5SUM:=afc34175f38d08867c1403d9008600b3 + +include $(INCLUDE_DIR)/package.mk + +define Package/openntpd + SUBMENU:=Time Synchronization + SECTION:=net + CATEGORY:=Network + TITLE:=NTP server + URL:=http://www.openntpd.org/ +endef + +define Package/openntpd/description + A free and easy to use NTP (Network Time Protocol) implementation. +endef + +define Package/openntpd/conffiles +/etc/ntpd.conf +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --with-builtin-arc4random \ + --with-privsep-user=network \ + --with-adjtimex \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CFLAGS="$(TARGET_CFLAGS) -DUSE_ADJTIMEX" +endef + +define Package/openntpd/install + $(INSTALL_DIR) $(1)/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpd $(1)/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/ntpd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/ntpd.init $(1)/etc/init.d/ntpd + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_BIN) ./files/ntpd.hotplug $(1)/etc/hotplug.d/iface/20-ntpd +endef + +define Package/openntpd/postinst +#!/bin/sh +[ -L "$${IPKG_INSTROOT}/usr/sbin/ntpd" ] && rm -f "$${IPKG_INSTROOT}/usr/sbin/ntpd" +exit 0 +endef + +define Package/openntpd/postrm +#!/bin/sh +/bin/busybox ntpd -h 2>&1 | grep -q BusyBox && ln -sf ../../bin/busybox /usr/sbin/ntpd +exit 0 +endef + +$(eval $(call BuildPackage,openntpd)) diff --git a/net/openntpd/files/ntpd.conf b/net/openntpd/files/ntpd.conf new file mode 100644 index 0000000..4569c39 --- /dev/null +++ b/net/openntpd/files/ntpd.conf @@ -0,0 +1,6 @@ +# use a random selection of 8 public stratum 2 servers +# see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers +server 0.openwrt.pool.ntp.org +server 1.openwrt.pool.ntp.org +server 2.openwrt.pool.ntp.org +server 3.openwrt.pool.ntp.org diff --git a/net/openntpd/files/ntpd.config b/net/openntpd/files/ntpd.config new file mode 100644 index 0000000..192ae7b --- /dev/null +++ b/net/openntpd/files/ntpd.config @@ -0,0 +1,3 @@ +config timezone + option posixtz "CET-1CEST,M3.5.0,M10.5.0/3" + option zoneinfo "Europe/Paris" diff --git a/net/openntpd/files/ntpd.hotplug b/net/openntpd/files/ntpd.hotplug new file mode 100644 index 0000000..dfd58d4 --- /dev/null +++ b/net/openntpd/files/ntpd.hotplug @@ -0,0 +1,12 @@ +case "${ACTION:-ifup}" in + ifup) + ps | grep -v 'grep' | grep -v '20-ntpd' | grep -q 'ntpd' || { + route -n 2>/dev/null | grep -q '^0.0.0.0' && { + /etc/init.d/ntpd enabled && /etc/init.d/ntpd start 2>/dev/null >/dev/null + } + } + ;; + ifdown) + route -n 2>/dev/null | grep -q '^0.0.0.0' || /etc/init.d/ntpd stop 2>/dev/null >/dev/null + ;; +esac diff --git a/net/openntpd/files/ntpd.init b/net/openntpd/files/ntpd.init new file mode 100644 index 0000000..ea5fc3b --- /dev/null +++ b/net/openntpd/files/ntpd.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=60 + +boot() { + return 0 +} + +start() { + mkdir -p `awk -F: '/^network:/{print $6}' /etc/passwd` + mkdir -p /var/db/ + /sbin/ntpd -s +} + +stop() { + service_kill ntpd +} diff --git a/net/openntpd/patches/001-adjtimex_linux.patch b/net/openntpd/patches/001-adjtimex_linux.patch new file mode 100644 index 0000000..3a02775 --- /dev/null +++ b/net/openntpd/patches/001-adjtimex_linux.patch @@ -0,0 +1,178 @@ +diff -urN openntpd-3.9p1/client.c openntpd-3.9p1.new/client.c +--- openntpd-3.9p1/client.c 2006-05-14 07:29:21.000000000 +0200 ++++ openntpd-3.9p1.new/client.c 2006-11-03 11:05:18.000000000 +0100 +@@ -321,7 +321,7 @@ + priv_adjtime(); + + for (i = 0; i < OFFSET_ARRAY_SIZE; i++) +- if (p->reply[i].rcvd <= p->reply[best].rcvd) ++ /* if (p->reply[i].rcvd <= p->reply[best].rcvd) */ + p->reply[i].good = 0; + + return (0); +diff -urN openntpd-3.9p1/configure.ac openntpd-3.9p1.new/configure.ac +--- openntpd-3.9p1/configure.ac 2006-05-14 07:29:23.000000000 +0200 ++++ openntpd-3.9p1.new/configure.ac 2006-11-03 11:06:26.000000000 +0100 +@@ -583,6 +583,12 @@ + [ builtin_arc4random=$withval ] + ) + ++AC_ARG_WITH(adjtimex, ++ [ --with-adjtimex Use adjtimex to adjust kernel skew], ++ [ AC_DEFINE(USE_ADJTIMEX, [], [Use adjust skew with adjtimex (experimental)]) ] ++) ++ ++ + AC_ARG_WITH(mantype, + [ --with-mantype=man|cat|doc Set man page type], + [ +diff -urN openntpd-3.9p1/defines.h openntpd-3.9p1.new/defines.h +--- openntpd-3.9p1/defines.h 2006-05-14 07:29:21.000000000 +0200 ++++ openntpd-3.9p1.new/defines.h 2006-11-03 11:06:56.000000000 +0100 +@@ -20,6 +20,10 @@ + # define setproctitle(x) + #endif + ++#ifdef USE_ADJTIMEX ++# define adjtime(a,b) (_compat_adjtime((a),(b))) ++#endif ++ + #if !defined(SA_LEN) + # if defined(HAVE_STRUCT_SOCKADDR_SA_LEN) + # define SA_LEN(x) ((x)->sa_len) +diff -urN openntpd-3.9p1/openbsd-compat/Makefile.in openntpd-3.9p1.new/openbsd-compat/Makefile.in +--- openntpd-3.9p1/openbsd-compat/Makefile.in 2006-05-14 07:29:19.000000000 +0200 ++++ openntpd-3.9p1.new/openbsd-compat/Makefile.in 2006-11-03 11:07:20.000000000 +0100 +@@ -9,7 +9,7 @@ + COMPAT= atomicio.o bsd-arc4random.o bsd-misc.o bsd-poll.o \ + bsd-snprintf.o bsd-getifaddrs.o bsd-setresuid.o \ + bsd-setresgid.o fake-rfc2553.o +-PORT= port-qnx.o ++PORT= port-linux.o port-qnx.o + + VPATH=@srcdir@ + CC=@CC@ +diff -urN openntpd-3.9p1/openbsd-compat/openbsd-compat.h openntpd-3.9p1.new/openbsd-compat/openbsd-compat.h +--- openntpd-3.9p1/openbsd-compat/openbsd-compat.h 2006-05-14 07:29:19.000000000 +0200 ++++ openntpd-3.9p1.new/openbsd-compat/openbsd-compat.h 2006-11-03 11:07:55.000000000 +0100 +@@ -46,6 +46,11 @@ + __attribute__((__format__ (printf, 2, 3))); + #endif + ++#ifdef USE_ADJTIMEX ++# include ++int _compat_adjtime(const struct timeval *, struct timeval *); ++#endif ++ + #ifndef HAVE_INET_PTON + int inet_pton(int, const char *, void *); + #endif +diff -urN openntpd-3.9p1/openbsd-compat/port-linux.c openntpd-3.9p1.new/openbsd-compat/port-linux.c +--- openntpd-3.9p1/openbsd-compat/port-linux.c 1970-01-01 01:00:00.000000000 +0100 ++++ openntpd-3.9p1.new/openbsd-compat/port-linux.c 2006-11-03 11:08:57.000000000 +0100 +@@ -0,0 +1,105 @@ ++/* $Id$ */ ++ ++/* ++ * Copyright (c) 2004 Darren Tucker ++ * ++ * Permission to use, copy, modify, and distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ */ ++ ++#include "includes.h" ++ ++#ifdef USE_ADJTIMEX ++#include ++#include ++#ifdef adjtime ++# undef adjtime ++#endif ++ ++#include "ntpd.h" ++ ++/* scale factor used by adjtimex freq param. 1 ppm = 65536 */ ++#define ADJTIMEX_FREQ_SCALE 65536 ++ ++/* maximum change to skew per adjustment, in PPM */ ++#define MAX_SKEW_DELTA 5.0 ++ ++int ++_compat_adjtime(const struct timeval *delta, struct timeval *olddelta) ++{ ++ static struct timeval tlast = {0,0}; ++ static double tskew = 0; ++ static int synced = -1; ++ struct timeval tnow, tdelta; ++ double skew = 0, newskew, deltaskew, adjust, interval = 0; ++ struct timex tmx; ++ int result, saved_errno; ++ ++ gettimeofday(&tnow, NULL); ++ adjust = (double)delta->tv_sec; ++ adjust += (double)delta->tv_usec / 1000000; ++ ++ /* Even if the caller doesn't care about the olddelta, we do */ ++ if (olddelta == NULL) ++ olddelta = &tdelta; ++ ++ result = adjtime(delta, olddelta); ++ saved_errno = errno; ++ ++ if (olddelta->tv_sec == 0 && olddelta->tv_usec == 0 && ++ synced != INT_MAX) ++ synced++; ++ else ++ synced = 0; ++ ++ /* ++ * do skew calculations if we have synced ++ */ ++ if (synced == 0 ) { ++ tmx.modes = 0; ++ if (adjtimex(&tmx) == -1) ++ log_warn("adjtimex get failed"); ++ else ++ tskew = (double)tmx.freq / ADJTIMEX_FREQ_SCALE; ++ } else if (synced >= 1) { ++ interval = (double)(tnow.tv_sec - tlast.tv_sec); ++ interval += (double)(tnow.tv_usec - tlast.tv_usec) / 1000000; ++ ++ skew = (adjust * 1000000) / interval; ++ newskew = ((tskew * synced) + skew) / synced; ++ deltaskew = newskew - tskew; ++ ++ if (deltaskew > MAX_SKEW_DELTA) { ++ log_info("skew change %0.3lf exceeds limit", deltaskew); ++ tskew += MAX_SKEW_DELTA; ++ } else if (deltaskew < -MAX_SKEW_DELTA) { ++ log_info("skew change %0.3lf exceeds limit", deltaskew); ++ tskew -= MAX_SKEW_DELTA; ++ } else { ++ tskew = newskew; ++ } ++ ++ /* Adjust the kernel skew. */ ++ tmx.freq = (long)(tskew * ADJTIMEX_FREQ_SCALE); ++ tmx.modes = ADJ_FREQUENCY; ++ if (adjtimex(&tmx) == -1) ++ log_warn("adjtimex set freq failed"); ++ } ++ ++ log_debug("interval %0.3lf skew %0.3lf total skew %0.3lf", interval, ++ skew, tskew); ++ ++ tlast = tnow; ++ errno = saved_errno; ++ return result; ++} ++#endif diff --git a/net/openntpd/patches/002-save_freq_drift.patch b/net/openntpd/patches/002-save_freq_drift.patch new file mode 100644 index 0000000..2bc5bb2 --- /dev/null +++ b/net/openntpd/patches/002-save_freq_drift.patch @@ -0,0 +1,92 @@ +--- openntpd-3.9p1/ntpd.h 2006-05-14 07:29:21.000000000 +0200 ++++ openntpd-3.9p1new/ntpd.h 2007-02-03 23:51:56.000000000 +0100 +@@ -34,6 +34,7 @@ + #define NTPD_USER "_ntp" + #endif + #define CONFFILE SYSCONFDIR "/ntpd.conf" ++#define DRIFTFILE "/var/db/ntpd.drift" + + #define READ_BUF_SIZE 4096 + +--- openntpd-3.9p1/ntpd.c 2006-05-14 07:29:23.000000000 +0200 ++++ openntpd-3.9p1new/ntpd.c 2007-02-04 00:00:36.000000000 +0100 +@@ -45,6 +45,7 @@ + int dispatch_imsg(struct ntpd_conf *); + int ntpd_adjtime(double); + void ntpd_settime(double); ++void readfreq(void); + + volatile sig_atomic_t quit = 0; + volatile sig_atomic_t reconfig = 0; +@@ -153,7 +154,8 @@ + chld_pid = ntp_main(pipe_chld, &conf); + + setproctitle("[priv]"); +- ++ readfreq(); ++ + signal(SIGTERM, sighdlr); + signal(SIGINT, sighdlr); + signal(SIGCHLD, sighdlr); + +--- openntpd-3.9p1/openbsd-compat/port-linux.c 2007-02-03 20:52:20.000000000 +0100 ++++ openntpd-3.9p1new/openbsd-compat/port-linux.c 2007-02-04 01:02:16.000000000 +0100 +@@ -33,6 +33,49 @@ + /* maximum change to skew per adjustment, in PPM */ + #define MAX_SKEW_DELTA 5.0 + ++void ++writefreq(double d) ++{ ++ int r; ++ FILE *fp; ++ ++ fp = fopen(DRIFTFILE, "w"); ++ if (fp == NULL) ++ { ++ log_warn("opening drift file for writing failed"); ++ return; ++ } ++ ++ fprintf(fp, "%e\n", d); ++ r = ferror(fp); ++ if (fclose(fp) != 0 || r != 0) ++ { ++ unlink(DRIFTFILE); ++ log_warn("saving freq drift failed"); ++ } ++} ++ ++void ++readfreq(void) ++{ ++ FILE *fp; ++ double d; ++ struct timex tmx; ++ ++ fp = fopen(DRIFTFILE, "r"); ++ if (fp == NULL) ++ return; ++ ++ if (fscanf(fp, "%le", &d) == 1) ++ { ++ tmx.freq = (long)(d * ADJTIMEX_FREQ_SCALE); ++ tmx.modes = ADJ_FREQUENCY; ++ if (adjtimex(&tmx) == -1) ++ log_warn("adjtimex set freq failed"); ++ } ++ fclose(fp); ++} ++ + int + _compat_adjtime(const struct timeval *delta, struct timeval *olddelta) + { +@@ -93,6 +136,8 @@ + tmx.modes = ADJ_FREQUENCY; + if (adjtimex(&tmx) == -1) + log_warn("adjtimex set freq failed"); ++ ++ writefreq( tskew ); + } + + log_debug("interval %0.3lf skew %0.3lf total skew %0.3lf", interval, diff --git a/net/openntpd/patches/003-no_permission_check.patch b/net/openntpd/patches/003-no_permission_check.patch new file mode 100644 index 0000000..4391a30 --- /dev/null +++ b/net/openntpd/patches/003-no_permission_check.patch @@ -0,0 +1,11 @@ +--- a/ntp.c ++++ b/ntp.c +@@ -111,8 +111,6 @@ ntp_main(int pipe_prnt[2], struct ntpd_c + + if (stat(chrootdir, &stb) == -1) + fatal("stat"); +- if (stb.st_uid != 0 || (stb.st_mode & (S_IWGRP|S_IWOTH)) != 0) +- fatal("bad privsep dir permissions"); + if (chroot(chrootdir) == -1) + fatal("chroot"); + if (chdir("/") == -1) diff --git a/net/openrrcp/Makefile b/net/openrrcp/Makefile new file mode 100644 index 0000000..dad1f1f --- /dev/null +++ b/net/openrrcp/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2008 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:=openrrcp +PKG_VERSION:=0.2.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://nording.ru/projects/download/openrrcp/stable +PKG_MD5SUM:=e3d6097732af812b03dbbbedeced34d2 + +include $(INCLUDE_DIR)/package.mk + +define Package/openrrcp + SECTION:=net + CATEGORY:=Network + TITLE:=OpenRRCP toolset for managing RRCP-capable Ethernet switches + URL:=http://openrrcp.org.ru/ +endef + +define Package/openrrcp/description + OpenRRCP toolset for managing RRCP-capable Ethernet switches +endef + +define Build/Compile + $(call Build/Compile/Default, \ + PREFIX="/usr" \ + ) +endef + +define Package/openrrcp/install + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(1)" \ + PREFIX="/usr" \ + install +endef + +$(eval $(call BuildPackage,openrrcp)) diff --git a/net/openser/Makefile b/net/openser/Makefile new file mode 100644 index 0000000..889e472 --- /dev/null +++ b/net/openser/Makefile @@ -0,0 +1,339 @@ +# +# 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:=openser +PKG_VERSION:=1.0.1 +PKG_RELEASE:=1 +PKG_MD5SUM:=eebc16665003ee92daf96b216d6f9563 +# PKG_VARIANT:=-tls # for tls version +PKG_VARIANT:= + +PKG_SOURCE_URL:=http://openser.org/pub/openser/$(PKG_VERSION)/src +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_VARIANT)_src.tar.gz + +include $(INCLUDE_DIR)/package.mk + +define Package/openser + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + TITLE:=Configurable, free SIP server + URL:=http://www.openser.org + MENU:=1 +endef + +define Package/openser/conffiles +/etc/openser/openser.cfg +endef + +define Package/openser-mod-acc + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser +libradiusclient-ng + TITLE:=Accounting support + SUBMENU:=Telephony +endef + +define Package/openser-mod-auth + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=Authentication support + SUBMENU:=Telephony +endef + +define Package/openser-mod-auth-db + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=Authentication with database support + SUBMENU:=Telephony +endef + +define Package/openser-mod-auth-radius + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser +libradiusclient-ng + TITLE:=Authentication with RADIUS support + SUBMENU:=Telephony +endef + +define Package/openser-mod-avp-radius + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser +libradiusclient-ng + TITLE:=AVP with RADIUS support + SUBMENU:=Telephony +endef + +define Package/openser-mod-avpops + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=AVP options support + SUBMENU:=Telephony +endef + +define Package/openser-mod-dispatcher + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=Dispatcher support + SUBMENU:=Telephony +endef + +define Package/openser-mod-diversion + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=Diversion support + SUBMENU:=Telephony +endef + +define Package/openser-mod-flatstore + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=Flatstore support + SUBMENU:=Telephony +endef + +define Package/openser-mod-gflags + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=Gflags support + SUBMENU:=Telephony +endef + +define Package/openser-mod-group + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=Group support + SUBMENU:=Telephony +endef + +define Package/openser-mod-group-radius + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser +libradiusclient-ng + TITLE:=Group with RADIUS support + SUBMENU:=Telephony +endef + +define Package/openser-mod-lcr + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser openser-mod-mysql + TITLE:=Least Cost Routing support + SUBMENU:=Telephony +endef + +define Package/openser-mod-mediaproxy + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=Mediaproxy support + SUBMENU:=Telephony +endef + +define Package/openser-mod-msilo + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=MSilo support + SUBMENU:=Telephony +endef + +define Package/openser-mod-mysql + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser +libmysqlclient + TITLE:=MySQL support + SUBMENU:=Telephony +endef + +define Package/openser-mod-nathelper + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=NAT helper support + SUBMENU:=Telephony +endef + +define Package/openser-mod-options + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=Options support + SUBMENU:=Telephony +endef + +define Package/openser-mod-pdt + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=PDT support + SUBMENU:=Telephony +endef + +define Package/openser-mod-permissions + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=Permissions support + SUBMENU:=Telephony +endef + +define Package/openser-mod-pike + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=PIKE support + SUBMENU:=Telephony +endef + +define Package/openser-mod-sms + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=SMS support + SUBMENU:=Telephony +endef + +define Package/openser-mod-speeddial + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=Speeddial supporte + SUBMENU:=Telephony +endef + +define Package/openser-mod-uac + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=UAC support + SUBMENU:=Telephony +endef + +define Package/openser-mod-uac-redirect + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=UAC with redirect support + SUBMENU:=Telephony +endef + +define Package/openser-mod-uri + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=URI support + SUBMENU:=Telephony +endef + +define Package/openser-mod-uri-db + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser +openser-mod-mysql + TITLE:=URI with database support + SUBMENU:=Telephony +endef + +define Package/openser-mod-uri-radius + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser +libradiusclient-ng + TITLE:=URI with RADIUS support + SUBMENU:=Telephony +endef + +define Package/openser-mod-xlog + SECTION:=net + CATEGORY:=Network + DEPENDS:=openser + TITLE:=Advanced logging support + SUBMENU:=Telephony +endef + +# Select here the modules for the ipk package +OPENSER_MODULES := sl tm rr maxfwd usrloc registrar dbtext textops exec + +OPENSER_MODULE_FILES := $(foreach module,$(OPENSER_MODULES),modules/$(module)/$(module).so) +OPENSER_MODULES := $(patsubst %,modules/%,$(OPENSER_MODULES)) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + prefix=/ \ + extra_defs="-DUSE_PTHREAD_MUTEX " \ + CC="$(TARGET_CC)" \ + ARCH="$(ARCH)" \ + CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \ + LOCALBASE="$(STAGING_DIR)/usr" \ + all utils/gen_ha1/gen_ha1 +endef + +define Package/openser/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ + $(CP) $(PKG_BUILD_DIR)/utils/gen_ha1/gen_ha1 $(1)/usr/sbin/openser_gen_ha1 + $(CP) $(PKG_BUILD_DIR)/scripts/sc $(1)/usr/sbin/openserctl + chmod 744 $(1)/usr/sbin/openserctl + $(CP) $(PKG_BUILD_DIR)/scripts/sc.dbtext $(1)/usr/sbin/dbtextctl + chmod 744 $(1)/usr/sbin/dbtextctl + $(INSTALL_DIR) $(1)/usr/lib/openser/modules + (cd $(PKG_BUILD_DIR);\ + $(CP) $(OPENSER_MODULE_FILES) $(1)/usr/lib/openser/modules/; \ + ) + $(INSTALL_DIR) $(1)/etc/openser + $(CP) $(PKG_BUILD_DIR)/etc/openser.cfg $(1)/etc/openser/ +endef + +define BuildPlugin + define Package/$(1)/install + [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/openser/modules/ + $(CP) $(PKG_BUILD_DIR)/modules/$(2)/$(2).so \ + $$(1)/usr/lib/openser/modules/ ; + endef + + $$(eval $$(call BuildPackage,$(1))) +endef + +$(eval $(call BuildPackage,openser)) +$(eval $(call BuildPlugin,openser-mod-acc,acc)) +$(eval $(call BuildPlugin,openser-mod-auth,auth)) +$(eval $(call BuildPlugin,openser-mod-auth-db,auth_db)) +$(eval $(call BuildPlugin,openser-mod-auth-radius,auth_radius)) +$(eval $(call BuildPlugin,openser-mod-avp-radius,avp_radius)) +$(eval $(call BuildPlugin,openser-mod-avpops,avpops)) +$(eval $(call BuildPlugin,openser-mod-dispatcher,dispatcher)) +$(eval $(call BuildPlugin,openser-mod-diversion,diversion)) +$(eval $(call BuildPlugin,openser-mod-flatstore,flatstore)) +$(eval $(call BuildPlugin,openser-mod-gflags,gflags)) +$(eval $(call BuildPlugin,openser-mod-group,group)) +$(eval $(call BuildPlugin,openser-mod-group-radius,group_radius)) +$(eval $(call BuildPlugin,openser-mod-lcr,lcr)) +$(eval $(call BuildPlugin,openser-mod-mediaproxy,mediaproxy)) +$(eval $(call BuildPlugin,openser-mod-msilo,msilo)) +$(eval $(call BuildPlugin,openser-mod-mysql,mysql)) +$(eval $(call BuildPlugin,openser-mod-nathelper,nathelper)) +$(eval $(call BuildPlugin,openser-mod-options,options)) +$(eval $(call BuildPlugin,openser-mod-pdt,pdt)) +$(eval $(call BuildPlugin,openser-mod-permissions,permissions)) +$(eval $(call BuildPlugin,openser-mod-pike,pike)) +$(eval $(call BuildPlugin,openser-mod-sms,sms)) +$(eval $(call BuildPlugin,openser-mod-speeddial,speeddial)) +$(eval $(call BuildPlugin,openser-mod-uac,uac)) +$(eval $(call BuildPlugin,openser-mod-uac-redirect,uac_redirect)) +$(eval $(call BuildPlugin,openser-mod-uri,uri)) +$(eval $(call BuildPlugin,openser-mod-uri-db,uri_db)) +$(eval $(call BuildPlugin,openser-mod-uri-radius,uri_radius)) +$(eval $(call BuildPlugin,openser-mod-xlog,xlog)) diff --git a/net/openser/patches/001-openser_cfg.patch b/net/openser/patches/001-openser_cfg.patch new file mode 100644 index 0000000..f26e79e --- /dev/null +++ b/net/openser/patches/001-openser_cfg.patch @@ -0,0 +1,33 @@ +--- openser-1.0.0-tls.orig/etc/openser.cfg 2005-10-28 21:45:33.000000000 +0200 ++++ openser-1.0.0-tls/etc/openser.cfg 2006-01-07 01:39:01.077134312 +0100 +@@ -36,20 +36,20 @@ + # ------------------ module loading ---------------------------------- + + # Uncomment this if you want to use SQL database +-#loadmodule "/usr/local/lib/openser/modules/mysql.so" ++#loadmodule "/usr/lib/openser/modules/mysql.so" + +-loadmodule "/usr/local/lib/openser/modules/sl.so" +-loadmodule "/usr/local/lib/openser/modules/tm.so" +-loadmodule "/usr/local/lib/openser/modules/rr.so" +-loadmodule "/usr/local/lib/openser/modules/maxfwd.so" +-loadmodule "/usr/local/lib/openser/modules/usrloc.so" +-loadmodule "/usr/local/lib/openser/modules/registrar.so" +-loadmodule "/usr/local/lib/openser/modules/textops.so" ++loadmodule "/usr/lib/openser/modules/sl.so" ++loadmodule "/usr/lib/openser/modules/tm.so" ++loadmodule "/usr/lib/openser/modules/rr.so" ++loadmodule "/usr/lib/openser/modules/maxfwd.so" ++loadmodule "/usr/lib/openser/modules/usrloc.so" ++loadmodule "/usr/lib/openser/modules/registrar.so" ++loadmodule "/usr/lib/openser/modules/textops.so" + + # Uncomment this if you want digest authentication + # mysql.so must be loaded ! +-#loadmodule "/usr/local/lib/openser/modules/auth.so" +-#loadmodule "/usr/local/lib/openser/modules/auth_db.so" ++#loadmodule "/usr/lib/openser/modules/auth.so" ++#loadmodule "/usr/lib/openser/modules/auth_db.so" + + # ----------------- setting module-specific parameters --------------- + diff --git a/net/openser/patches/002-sc.patch b/net/openser/patches/002-sc.patch new file mode 100644 index 0000000..52ef9a6 --- /dev/null +++ b/net/openser/patches/002-sc.patch @@ -0,0 +1,41 @@ +--- openser-1.0.0-tls.orig/scripts/sc 2005-08-11 14:08:02.000000000 +0200 ++++ openser-1.0.0-tls/scripts/sc 2006-01-29 02:18:43.319054456 +0100 +@@ -48,11 +48,15 @@ + STARTOPTIONS= # for example -dddd + fi + if [ -z "$DIR" ] ; then +- DIR=`dirname $0` ++ DIR=/usr/sbin + fi + if [ -z "$SERBIN" ] ; then + SERBIN=$DIR/openser + fi ++if [ -z "$SIP_DOMAIN" ] ; then ++ SIP_DOMAIN=$(nvram get sip_domain) ++fi ++ + + ##### ----------------------------------------------- ##### + ### openser's FIFO server +@@ -415,7 +419,7 @@ + fi + + if [ -z "$SERDOMAIN" ] ; then +- echo "domain unknown: use usernames with domain or set default domain in SIP_DOMAIN" ++ echo "domain unknown: use usernames with domain or set default domain in SIP_DOMAIN (with 'nvram set sip_domain=YOUR_SIP_DOMAIN')" + exit 1 + fi + } +@@ -671,11 +675,7 @@ + set_user $2 + fifo_cmd ul_show_contact $USRLOC_TABLE "$SERUSER@$SERDOMAIN" + elif [ $# -eq 1 ] ; then +- printf "Dumping all contacts may take long: are you sure you want to proceed? [Y|N] " > /dev/stderr +- read answer +- if [ "$answer" = "y" -o "$answer" = "Y" ] ; then +- fifo_cmd ul_dump +- fi ++ fifo_cmd ul_dump + else + echo "wrong number of params for usrloc show" + usage diff --git a/net/openser/patches/003-makefile_defs.patch b/net/openser/patches/003-makefile_defs.patch new file mode 100644 index 0000000..a7275bd --- /dev/null +++ b/net/openser/patches/003-makefile_defs.patch @@ -0,0 +1,71 @@ +--- openser-1.0.0-tls.orig/Makefile.defs 2005-10-28 18:32:39.000000000 +0200 ++++ openser-1.0.0-tls/Makefile.defs 2006-01-15 23:40:18.391547040 +0100 +@@ -917,7 +917,7 @@ + endif + YACC_FLAGS=-d -b cfg + # on solaris add -lxnet (e.g. LIBS= -lxnet) +-LIBS= -lfl -ldl -lresolv ++LIBS= -ldl -lresolv + + + #os specific stuff +@@ -955,7 +955,7 @@ + endif + OLD_SOLARIS= $(shell echo "$(OSREL)" | \ + sed -e 's/^5\.[0-6][^0-9]*$$/yes/' ) +- LIBS+= -L$(LOCALBASE)/lib -lfl -lxnet -lnsl ++ LIBS+= -L$(LOCALBASE)/lib -lxnet -lnsl + ifeq ($(OLD_SOLARIS), yes) + LIBS+=-lposix4 + else +@@ -970,9 +970,9 @@ + ifneq ($(found_lock_method), yes) + DEFS+= -DUSE_PTHREAD_MUTEX # try pthread sems + found_lock_method=yes +- LIBS= -pthread -lfl #dlopen is in libc ++ LIBS= -pthread #dlopen is in libc + else +- LIBS= -lfl #dlopen is in libc ++ LIBS= #dlopen is in libc + endif + YACC=yacc + endif +@@ -987,7 +987,7 @@ + # (symbols on openbsd are prefixed by "_") + YACC=yacc + # no sched_yield on openbsd unless linking with c_r (not recommended) +- LIBS= -lfl ++ LIBS= + OPENBSD_IS_AOUT= $(shell echo "$(OSREL)" | \ + sed -e 's/^3\.[0-3][^0-9]*$$/yes/' |sed -e 's/^[0-2]\..*/yes/') + # exception: on sparc openbsd 3.2 is elf and not aout +@@ -1014,7 +1014,7 @@ + found_lock_method=yes + endif + YACC=yacc +- LIBS= -lfl ++ LIBS= + endif + + # OS X support, same as freebsd +@@ -1028,9 +1028,9 @@ + ifneq ($(found_lock_method), yes) + DEFS+= -DUSE_PTHREAD_MUTEX # try pthread sems + found_lock_method=yes +- LIBS= -pthread -lfl -lresolv #dlopen is in libc ++ LIBS= -pthread -lresolv #dlopen is in libc + else +- LIBS= -lfl -lresolv #dlopen is in libc ++ LIBS= -lresolv #dlopen is in libc + endif + LDFLAGS= # darwin doesn't like -O2 or -E + MOD_LDFLAGS= -bundle -bundle_loader ../../$(MAIN_NAME) +@@ -1047,7 +1047,7 @@ + + #add libssl if needed + ifneq ($(TLS),) +-DEFS+= -I$(LOCALBASE)/ssl/include ++DEFS+= -I$(LOCALBASE)/include + LIBS+= -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib -lssl -lcrypto + endif + diff --git a/net/openser/patches/004-cfg_lex.patch b/net/openser/patches/004-cfg_lex.patch new file mode 100644 index 0000000..39eacb2 --- /dev/null +++ b/net/openser/patches/004-cfg_lex.patch @@ -0,0 +1,13 @@ +--- openser-1.0.0-tls.orig/cfg.lex 2005-09-02 17:34:41.000000000 +0200 ++++ openser-1.0.0-tls/cfg.lex 2006-01-05 01:34:50.279630928 +0100 +@@ -85,6 +85,10 @@ + static char* addstr(struct str_buf *, char*, int); + static void count(); + ++ int yywrap(void) ++ { ++ return 1; ++ } + + %} + diff --git a/net/openser/patches/005-config_h.patch b/net/openser/patches/005-config_h.patch new file mode 100644 index 0000000..45af8f1 --- /dev/null +++ b/net/openser/patches/005-config_h.patch @@ -0,0 +1,33 @@ +--- openser-1.0.0-tls.orig/config.h 2005-08-23 19:31:12.000000000 +0200 ++++ openser-1.0.0-tls/config.h 2006-01-05 01:42:14.101159800 +0100 +@@ -48,7 +48,7 @@ + #define MAX_LISTEN 16 + + /* default number of child processes started */ +-#define CHILD_NO 8 ++#define CHILD_NO 4 + + #define RT_NO 40 /* routing tables number */ + #define FAILURE_RT_NO RT_NO /* on_failure routing tables number */ +@@ -68,10 +68,10 @@ + #define CONTENT_LENGTH "Content-Length: " + #define CONTENT_LENGTH_LEN (sizeof(CONTENT_LENGTH)-1) + +-#define USER_AGENT "User-Agent: OpenSer (" VERSION " (" ARCH "/" OS"))" ++#define USER_AGENT "User-Agent: OpenSer " VERSION " (boozy.milkfish.org)" + #define USER_AGENT_LEN (sizeof(USER_AGENT)-1) + +-#define SERVER_HDR "Server: OpenSer (" VERSION " (" ARCH "/" OS"))" ++#define SERVER_HDR "Server: OpenSer " VERSION " (boozy.milkfish.org)" + #define SERVER_HDR_LEN (sizeof(SERVER_HDR)-1) + + #define MAX_WARNING_LEN 256 +@@ -113,7 +113,7 @@ + #define PKG_MEM_POOL_SIZE 1024*1024 + + /*used if SH_MEM is defined*/ +-#define SHM_MEM_SIZE 32 ++#define SHM_MEM_SIZE 8 + + #define TIMER_TICK 1 + diff --git a/net/openser/patches/006-sc_dbtext.patch b/net/openser/patches/006-sc_dbtext.patch new file mode 100644 index 0000000..2a1b7ea --- /dev/null +++ b/net/openser/patches/006-sc_dbtext.patch @@ -0,0 +1,22 @@ +--- openser-1.0.0-tls.orig/scripts/sc.dbtext 2005-07-29 21:05:36.000000000 +0200 ++++ openser-1.0.0-tls/scripts/sc.dbtext 2006-01-29 02:30:31.795349688 +0100 +@@ -62,6 +62,10 @@ + ##### ----------------------------------------------- ##### + #### table names + ++if [ -z "$SIP_DOMAIN" ] ; then ++ SIP_DOMAIN=$(nvram get sip_domain) ++fi ++ + # UsrLoc Table + if [ -z "$UL_TABLE" ] ; then + UL_TABLE=location +@@ -247,7 +251,7 @@ + fi + + if [ -z "$SERDOMAIN" ] ; then +- echo -e "\nDomain unknown: use usernames with domain or set default domain in SIP_DOMAIN\n" ++ echo -e "\nDomain unknown: use usernames with domain or set default domain in SIP_DOMAIN (with 'nvram set sip_domain=YOUR_SIP_DOMAIN')\n" + exit 1 + fi + } diff --git a/net/openser/patches/007-modules_build.patch b/net/openser/patches/007-modules_build.patch new file mode 100644 index 0000000..bdc9f65 --- /dev/null +++ b/net/openser/patches/007-modules_build.patch @@ -0,0 +1,57 @@ +--- openser-1.0.1/Makefile 2006-02-15 20:52:21.000000000 +0100 ++++ openser-1.0.1.new/Makefile 2006-03-17 11:01:27.417488936 +0100 +@@ -46,8 +46,7 @@ + skip_modules?= + + # if not set on the cmd. line or the env, exclude this modules: +-exclude_modules?= jabber cpl-c pa postgres mysql \ +- avp_radius auth_radius group_radius uri_radius ++exclude_modules?= jabber cpl-c pa postgres + # always exclude the CVS dir + override exclude_modules+= CVS $(skip_modules) + +diff -urN openser-1.0.1/modules/acc/Makefile openser-1.0.1.new/modules/acc/Makefile +--- openser-1.0.1/modules/acc/Makefile 2005-09-05 21:32:02.000000000 +0200 ++++ openser-1.0.1.new/modules/acc/Makefile 2006-03-17 10:38:14.333269928 +0100 +@@ -14,8 +14,8 @@ + DEFS+=-DSQL_ACC + + # uncomment the next two lines if you wish to enable RADIUS accounting +-#DEFS+=-DRAD_ACC -I$(LOCALBASE)/include +-#LIBS=-L$(LOCALBASE)/lib -lradiusclient-ng ++DEFS+=-DRAD_ACC -I$(LOCALBASE)/include ++LIBS=-L$(LOCALBASE)/lib -lradiusclient-ng + + # uncomment the next two lines if you wish to enable DIAMETER accounting + #DEFS+=-DDIAM_ACC +diff -urN openser-1.0.1/modules/mysql/Makefile openser-1.0.1.new/modules/mysql/Makefile +--- openser-1.0.1/modules/mysql/Makefile 2005-06-13 18:47:40.000000000 +0200 ++++ openser-1.0.1.new/modules/mysql/Makefile 2006-03-17 11:12:16.218856136 +0100 +@@ -9,14 +9,12 @@ + # mysql.h locations (freebsd,openbsd solaris) + DEFS +=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/mysql \ + -I$(LOCALBASE)/mysql/include \ +- -I/usr/include/mysql + + # libmysqlclient locations on RH/Suse, Solaris /OpenBSD, FreeBSD + # (Debian does the right thing and puts it in /usr/lib) + LIBS=-L/usr/lib/mysql -L$(LOCALBASE)/lib -L$(LOCALBASE)/lib/mysql \ + -L$(LOCALBASE)/mysql/lib/mysql/ \ + -L$(LOCALBASE)/mysql/lib \ +- -L/usr/lib64/mysql \ + -lmysqlclient -lz + + include ../../Makefile.modules +diff -urN openser-1.0.1/modules/postgres/Makefile openser-1.0.1.new/modules/postgres/Makefile +--- openser-1.0.1/modules/postgres/Makefile 2005-07-01 16:52:34.000000000 +0200 ++++ openser-1.0.1.new/modules/postgres/Makefile 2006-03-17 11:13:22.150832952 +0100 +@@ -7,8 +7,7 @@ + NAME=postgres.so + + # libpq-fe.h locations +-DEFS +=-I$(LOCALBASE)/include -I$(LOCALBASE)/pgsql/include \ +- -I/usr/include/postgresql -I/usr/include/postgresql/8.0 ++DEFS +=-I$(LOCALBASE)/include -I$(LOCALBASE)/pgsql/include -I$(LOCALBASE)/include/postgresql + LIBS=-L$(LOCALBASE)/lib -L$(LOCALBASE)/pgsql/lib -L$(LOCALBASE)/lib/pgsql \ + -lpq + diff --git a/net/opensips/Makefile b/net/opensips/Makefile new file mode 100644 index 0000000..c90abf7 --- /dev/null +++ b/net/opensips/Makefile @@ -0,0 +1,272 @@ +# +# Copyright (C) 2009 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:=opensips +PKG_VERSION:=1.5.3 +PKG_RELEASE:=1 +PKG_VARIANT:=-tls + +PKG_SOURCE_URL:=http://opensips.org/pub/opensips/$(PKG_VERSION)/src +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_VARIANT)_src.tar.gz +PKG_MD5SUM:=8a03167420c31da15405bed7630ed3e2 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)$(PKG_VARIANT) + +PKG_BUILD_DEPENDS:=curl expat libxml2 mysql openldap openssl pcre postgresql radiusclient-ng + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(FPIC) + +define Package/opensips/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + URL:=http://www.opensips.org/ +endef + + +define Package/opensips +$(call Package/opensips/Default) + TITLE:=Open SIP Server + MENU:=1 +endef + +define Package/opensips-example +$(call Package/opensips/Default) + TITLE:=OpenSIPS example config + DEPENDS:=opensips \ + +opensips-mod-acc \ + +opensips-mod-maxfwd \ + +opensips-mod-mi-fifo \ + +opensips-mod-registrar \ + +opensips-mod-rr \ + +opensips-mod-signaling \ + +opensips-mod-sl \ + +opensips-mod-textops \ + +opensips-mod-tm \ + +opensips-mod-uri \ + +opensips-mod-uri-db \ + +opensips-mod-usrloc \ + +opensips-mod-xlog +endef + +define Package/opensips-example/conffiles +/etc/default/opensips +/etc/opensips/opensips.cfg +endef + + +define Package/opensips-tools +$(call Package/opensips/Default) + TITLE:=OpenSIPS control tools + DEPENDS:=opensips +endef + +define Package/opensips-tools/conffiles +/etc/opensips/opensipsctlrc +endef + + +PKG_EXCL_MODULES:= \ + auth_diameter \ + carrierroute \ + db_berkeley \ + db_oracle \ + db_unixodbc \ + mediaproxy \ + mi_xmlrpc \ + mmgeoip \ + osp \ + perl \ + perlvdb \ + snmpstats \ + +PKG_MAKE_ARGS:= \ + cfg-dir="etc/opensips/" \ + bin-dir="usr/sbin/" \ + data-dir="var/lib/opensips/" \ + lib-dir="usr/lib/opensips/" \ + modules-dir="usr/lib/opensips/modules/" \ + exclude_modules="$(PKG_EXCL_MODULES)" \ + + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) $(PKG_MAKE_ARGS) \ + prefix=/ \ + extra_defs="-DUSE_PTHREAD_MUTEX " \ + CC="$(TARGET_CC)" \ + ARCH="$(ARCH)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + ISSMP="no" \ + LOCALBASE="$(STAGING_DIR)/usr" \ + SYSBASE="$(STAGING_DIR)/usr" \ + PCRECFG= \ + all + $(MAKE) -C $(PKG_BUILD_DIR) $(PKG_MAKE_ARGS) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install +endef + +define Package/opensips/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/sbin/opensips \ + $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/opensips/modules +endef + +define Package/opensips-example/install + $(INSTALL_DIR) $(1)/etc/opensips + $(CP) \ + $(PKG_INSTALL_DIR)/etc/opensips/opensips.cfg \ + $(1)/etc/opensips/ + $(SED) 's,$(PKG_INSTALL_DIR),,g' \ + $(1)/etc/opensips/opensips.cfg + $(INSTALL_DIR) $(1)/etc/default + $(INSTALL_DATA) ./files/opensips.default $(1)/etc/default/opensips + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/opensips.init $(1)/etc/init.d/opensips +endef + +define Package/opensips-tools/install + $(INSTALL_DIR) $(1)/etc/opensips + $(CP) \ + $(PKG_INSTALL_DIR)/etc/opensips/opensipsctlrc \ + $(1)/etc/opensips/ + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/sbin/opensips{ctl,dbctl,unix} \ + $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/opensips + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/opensips/opensipsctl \ + $(1)/usr/lib/opensips/ + $(SED) 's,/bin/bash,/bin/sh,g' \ + -e 's,$(PKG_INSTALL_DIR),,g' \ + $(1)/usr/sbin/opensips{ctl,dbctl} +endef + +define BuildPlugin + define Package/opensips-mod-$(1) + $$(call Package/opensips/Default) + TITLE:= OpenSIPS $(3) module + DEPENDS:=opensips $$(foreach m,$(4),+opensips-mod-$$m) $(5) + endef + + define Package/opensips-mod-$(1)/install + [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/opensips/modules/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/opensips/modules/$(2).so \ + $$(1)/usr/lib/opensips/modules/ ; + endef + + $$(eval $$(call BuildPackage,opensips-mod-$(1))) +endef + +$(eval $(call BuildPackage,opensips)) +$(eval $(call BuildPackage,opensips-example)) +$(eval $(call BuildPackage,opensips-tools)) +$(eval $(call BuildPlugin,acc,acc,Accounting,tm,)) +$(eval $(call BuildPlugin,alias-db,alias_db,Database-backend aliases,,)) +$(eval $(call BuildPlugin,auth,auth,Authentication Framework,signaling,)) +$(eval $(call BuildPlugin,auth-db,auth_db,Database-backend authentication,auth,)) +$(eval $(call BuildPlugin,auth-radius,auth_radius,RADIUS-backend authentication,auth,+libradiusclient-ng)) +$(eval $(call BuildPlugin,avp-radius,avp_radius,RADIUS-backend for AVP loading,,+libradiusclient-ng)) +$(eval $(call BuildPlugin,avpops,avpops,AVP operation,,)) +$(eval $(call BuildPlugin,benchmark,benchmark,Config benchmark,,)) +$(eval $(call BuildPlugin,call-control,call_control,Prepair application,dialog,)) +#$(eval $(call BuildPlugin,carrierroute,carrierroute,Carrier Routing,,+libconfuse)) +$(eval $(call BuildPlugin,cfgutils,cfgutils,Config utilities,,)) +$(eval $(call BuildPlugin,closeddial,closeddial,PBX-like features,,)) +$(eval $(call BuildPlugin,cpl-c,cpl-c,Call Processing language interpreter,tm sl usrloc,+libxml2)) +#$(eval $(call BuildPlugin,db-berkeley,db_berkeley,Berkeley DB Database-backend,,)) +$(eval $(call BuildPlugin,db-flatstore,db_flatstore,Fast writing-only text database-backed,,)) +$(eval $(call BuildPlugin,db-mysql,db_mysql,MySQL database-backend,,+libmysqlclient)) +#$(eval $(call BuildPlugin,db-oracle,db_oracle,Oracle Database-backend,,)) +$(eval $(call BuildPlugin,db-postgres,db_postgres,PostgreSQL Database-backend,,+libpq)) +$(eval $(call BuildPlugin,db-text,db_text,Text database-backend,,)) +#$(eval $(call BuildPlugin,db-unixodbc,db_unixodbc,UnixODBC Database-backend,,)) +$(eval $(call BuildPlugin,dialog,dialog,Dialog support,rr tm,)) +$(eval $(call BuildPlugin,dialplan,dialplan,Dialplan management,,)) +$(eval $(call BuildPlugin,dispatcher,dispatcher,Dispatcher,,)) +$(eval $(call BuildPlugin,diversion,diversion,Diversion header insertion,,)) +$(eval $(call BuildPlugin,domain,domain,Multi-domain support,,)) +$(eval $(call BuildPlugin,domainpolicy,domainpolicy,Domain policy,,)) +$(eval $(call BuildPlugin,drouting,drouting,Dynaming routing,,)) +$(eval $(call BuildPlugin,enum,enum,ENUM lookup,,)) +$(eval $(call BuildPlugin,exec,exec,External exec,,)) +$(eval $(call BuildPlugin,gflags,gflags,Global shared flags,,)) +$(eval $(call BuildPlugin,group,group,Database-backend user-groups,,)) +$(eval $(call BuildPlugin,group-radius,group_radius,RADIUS-backend user-groups,,+libradiusclient-ng)) +$(eval $(call BuildPlugin,h350,h350,H.350,ldap,+libopenldap)) +$(eval $(call BuildPlugin,identity,identity,Identity,,+libopenssl)) +$(eval $(call BuildPlugin,imc,imc,IM conferencing,db-mysql tm,)) +$(eval $(call BuildPlugin,jabber,jabber,Jabber,tm,+libexpat)) +$(eval $(call BuildPlugin,lcr,lcr,Least Cost Routing,tm,)) +$(eval $(call BuildPlugin,ldap,ldap,LDAP connector,,+libopenldap)) +$(eval $(call BuildPlugin,load_balancer,load_balancer,Load balancer,dialog,)) +$(eval $(call BuildPlugin,localcache,localcache,Local cache,,)) +$(eval $(call BuildPlugin,mangler,mangler,SIP mangler,,)) +$(eval $(call BuildPlugin,maxfwd,maxfwd,Max-Forward processor,,)) +$(eval $(call BuildPlugin,mi-datagram,mi_datagram,Datagram support for Management Interface,,)) +$(eval $(call BuildPlugin,mi-fifo,mi_fifo,FIFO support for Management Interface,,)) +#$(eval $(call BuildPlugin,mi-xmlrpc,mi_xmlrpc,XML-RPC support for Management Interface,,+xmlrpc-c)) +#$(eval $(call BuildPlugin,mediaproxy,mediaproxy,NAT traversal,,+mediaproxy)) +#$(eval $(call BuildPlugin,mmgeoip,mmgeoip,MaxMind GeoIP,,+libgeoip)) +$(eval $(call BuildPlugin,msilo,msilo,SIP message silo,tm,)) +$(eval $(call BuildPlugin,nat_traversal,nat_traversal,NAT traversal,dialog sl tm,)) +$(eval $(call BuildPlugin,nathelper,nathelper,NAT traversal helper,,+rtpproxy)) +$(eval $(call BuildPlugin,options,options,OPTIONS server replier,sl,)) +#$(eval $(call BuildPlugin,osp,osp,OSP peering,auth rr sl tm textops,+libosp)) +$(eval $(call BuildPlugin,path,path,SIP path insertion,rr,)) +$(eval $(call BuildPlugin,pdt,pdt,Prefix-to-Domain translator,,)) +$(eval $(call BuildPlugin,peering,peering,Perring,,+libradiusclient-ng)) +#$(eval $(call BuildPlugin,perl,perl,Perl,sl,+perl)) +#$(eval $(call BuildPlugin,perlvdb,perlvdb,Perl Virtual DB,perl,)) +$(eval $(call BuildPlugin,permissions,permissions,Permissions control,,)) +$(eval $(call BuildPlugin,pike,pike,Flood detector,,)) +$(eval $(call BuildPlugin,presence,presence,Presence server,signaling,+libxml2)) +$(eval $(call BuildPlugin,presence-dialoginfo,presence_dialoginfo,Dialog Event presence,presence,)) +$(eval $(call BuildPlugin,presence-mwi,presence_mwi,Message Waiting Indication presence,presence,)) +$(eval $(call BuildPlugin,presence-xcapdiff,presence_xcapdiff,XCAP-Diff presence,presence pua,)) +$(eval $(call BuildPlugin,presence-xml,presence_xml,XCAP presence,presence xcap-client,)) +$(eval $(call BuildPlugin,pua,pua,Presence User Agent,tm,+libxml2)) +$(eval $(call BuildPlugin,pua-bla,pua_bla,Bridged Line Appearence PUA,presence pua usrloc,)) +$(eval $(call BuildPlugin,pua-dialoginfo,pua_dialoginfo,Dialog Event PUA,dialog pua,)) +$(eval $(call BuildPlugin,pua-mi,pua_mi,PUA Management Interface,pua,)) +$(eval $(call BuildPlugin,pua-usrloc,pua_usrloc,PUA User Location,pua usrloc,)) +$(eval $(call BuildPlugin,pua-xmpp,pua_xmpp,PUA XMPP,presence pua xmpp,)) +$(eval $(call BuildPlugin,qos,qos,QoS control,dialog,)) +$(eval $(call BuildPlugin,ratelimit,ratelimit,Traffic shapping,,)) +$(eval $(call BuildPlugin,regex,regex,Regular Expression,,+libpcre)) +$(eval $(call BuildPlugin,registrar,registrar,SIP Registrar,signaling usrloc,)) +$(eval $(call BuildPlugin,rls,rls,Resource List Server,presence pua signaling tm,+libxml2)) +$(eval $(call BuildPlugin,rr,rr,Record-Route and Route,,)) +$(eval $(call BuildPlugin,seas,seas,SIP Express Application Server,tm,)) +$(eval $(call BuildPlugin,signaling,signaling,Signaling,sl tm,)) +$(eval $(call BuildPlugin,siptrace,siptrace,SIP trace,,)) +$(eval $(call BuildPlugin,sl,sl,Stateless replier,,)) +$(eval $(call BuildPlugin,sms,sms,SIP-to-SMS IM gateway,tm,)) +#$(eval $(call BuildPlugin,snmpstats,snmpstats,SNMP,presence usrloc,+libnetsnmp)) +$(eval $(call BuildPlugin,speeddial,speeddial,Per-user speed-dial controller,,)) +$(eval $(call BuildPlugin,statistics,statistics,Script statistics,,)) +$(eval $(call BuildPlugin,sst,sst,SIP Session Timer,dialog sl,)) +$(eval $(call BuildPlugin,textops,textops,Text operations,,)) +$(eval $(call BuildPlugin,tlsops,tlsops,TLS operations,,+libopenssl)) +$(eval $(call BuildPlugin,tm,tm,Transaction,,)) +$(eval $(call BuildPlugin,uac,uac,User Agent Client,tm,)) +$(eval $(call BuildPlugin,uac-redirect,uac_redirect,User Agent Client redirection,tm,)) +$(eval $(call BuildPlugin,uri,uri,Generic URI operation,,)) +$(eval $(call BuildPlugin,uri-db,uri_db,Database-backend SIP URI checking,,)) +$(eval $(call BuildPlugin,uri-radius,uri_radius,RADIUS-backend SIP URI checking,,+libradiusclient-ng)) +$(eval $(call BuildPlugin,userblacklist,userblacklist,User blacklists,,)) +$(eval $(call BuildPlugin,usrloc,usrloc,User location,,)) +$(eval $(call BuildPlugin,xcap-client,xcap_client,XCAP Client,,+libcurl +libxml2)) +$(eval $(call BuildPlugin,xlog,xlog,Advanced logger,,)) +$(eval $(call BuildPlugin,xmpp,xmpp,SIP-to-XMPP Gateway,tm,+libexpat)) diff --git a/net/opensips/files/opensips.default b/net/opensips/files/opensips.default new file mode 100644 index 0000000..a61617b --- /dev/null +++ b/net/opensips/files/opensips.default @@ -0,0 +1,13 @@ +# OPTIONS +# -n COUNT +# Specifies the number of children processes forked per interface +# -N COUNT +# Specifies the number of children processes forked to handle tcp incoming connections +# -m SIZE +# Size of the shared memory which will be allocated (in Megabytes). +# -u UID +# Changes the user id under which +# -g GID +# Changes the group id under which + +OPTIONS="-n 4 -m 4 - m 8" diff --git a/net/opensips/files/opensips.init b/net/opensips/files/opensips.init new file mode 100755 index 0000000..32654da --- /dev/null +++ b/net/opensips/files/opensips.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009 OpenWrt.org +START=50 + +BIN=opensips +DEFAULT=/etc/default/$BIN +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid + +start() { + [ -f $DEFAULT ] && . $DEFAULT + mkdir -p $RUN_D + $BIN -P $PID_F $OPTIONS >/dev/null 2>&1 +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) +} + diff --git a/net/opensips/patches/001-no_rej.patch b/net/opensips/patches/001-no_rej.patch new file mode 100644 index 0000000..066249a --- /dev/null +++ b/net/opensips/patches/001-no_rej.patch @@ -0,0 +1,21 @@ +--- a/pvar.c.rej ++++ /dev/null +@@ -1,18 +0,0 @@ +-*************** +-*** 2409,2415 **** +- LM_ERR("invalid socket specification\n"); +- return -1; +- } +-- si = grep_sock_info(&host, (unsigned short)port, +- (unsigned short)proto); +- if (si==NULL) +- return -1; +---- 2409,2416 ---- +- LM_ERR("invalid socket specification\n"); +- return -1; +- } +-+ set_sip_defaults( port, proto); +-+ si = grep_sock_info(&host, (unsigned short)port, +- (unsigned short)proto); +- if (si==NULL) +- return -1; diff --git a/net/opensips/patches/005-config_h.patch b/net/opensips/patches/005-config_h.patch new file mode 100644 index 0000000..abd40d6 --- /dev/null +++ b/net/opensips/patches/005-config_h.patch @@ -0,0 +1,20 @@ +--- a/config.h ++++ b/config.h +@@ -48,7 +48,7 @@ + + #define MAX_LISTEN 16 /*!< maximum number of addresses on which we will listen */ + +-#define CHILD_NO 8 /*!< default number of child processes started */ ++#define CHILD_NO 4 /*!< default number of child processes started */ + + #define RT_NO 100 /*!< routing tables number */ + #define FAILURE_RT_NO RT_NO /*!< on_failure routing tables number */ +@@ -114,7 +114,7 @@ + #define SRV_MAX_PREFIX_LEN SRV_TLS_PREFIX_LEN + + #define PKG_MEM_POOL_SIZE 1024*1024 /*!< Used only if PKG_MALLOC is defined*/ +-#define SHM_MEM_SIZE 32 /*!< Used if SH_MEM is defined*/ ++#define SHM_MEM_SIZE 8 /*!< Used if SH_MEM is defined*/ + + #define TIMER_TICK 1 /*!< one second */ + #define UTIMER_TICK 100*1000 /*!< 100 miliseconds*/ diff --git a/net/opensips/patches/007-modules_build.patch b/net/opensips/patches/007-modules_build.patch new file mode 100644 index 0000000..178b6e9 --- /dev/null +++ b/net/opensips/patches/007-modules_build.patch @@ -0,0 +1,102 @@ +--- a/modules/carrierroute/Makefile ++++ b/modules/carrierroute/Makefile +@@ -12,10 +12,8 @@ NAME=carrierroute.so + BUILDER = $(shell which confuse-config) + + ifeq ($(BUILDER),) +- CONFUSEDEFS=-I$(LOCALBASE)/include -I/usr/local/include -I/opt/include \ +- -I/usr/sfw/include +- CONFUSELIBS=-L$(LOCALBASE)/lib -L/usr/local/lib -L/usr/sfw/lib \ +- -L/opt/lib -lconfuse ++ CONFUSEDEFS=-I$(LOCALBASE)/include ++ CONFUSELIBS=-L$(LOCALBASE)/lib + else + CONFUSEDEFS = $(shell confuse-config --cflags) + CONFUSELIBS = $(shell confuse-config --libs) +--- a/modules/h350/Makefile ++++ b/modules/h350/Makefile +@@ -9,6 +9,8 @@ include ../../Makefile.defs + + auto_gen= + NAME=h350.so +-LIBS= ++ ++DEFS+=-I$(LOCALBASE)/include ++LIBS=-L$(LOCALBASE)/lib -lldap + + include ../../Makefile.modules +--- a/modules/identity/Makefile ++++ b/modules/identity/Makefile +@@ -9,7 +9,7 @@ include ../../Makefile.defs + auto_gen= + NAME=identity.so + +-DEFS+= -I$(LOCALBASE)/ssl/include -I$(LOCALBASE)/include -I/usr/sfw/include -I/usr/local/ssl/include +-LIBS= -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib -L/usr/sfw/lib -L/usr/local/ssl/lib -lssl -lcrypto ++DEFS+= -I$(LOCALBASE)/include ++LIBS= -L$(LOCALBASE)/lib -lssl -lcrypto + + include ../../Makefile.modules +--- a/modules/ldap/Makefile ++++ b/modules/ldap/Makefile +@@ -12,7 +12,8 @@ include ../../Makefile.defs + auto_gen= + NAME=ldap.so + +-LIBS=-lldap ++DEFS+=-I$(LOCALBASE)/include ++LIBS=-L$(LOCALBASE)/lib -lldap + + ifeq ($(OS),solaris) + DEFS+=-I$(LOCALBASE)/include -I/usr/sfw/include -I/usr/local/include -I/opt/sfw/include -I/opt/csw/include +--- a/modules/pua_bla/Makefile ++++ b/modules/pua_bla/Makefile +@@ -9,8 +9,8 @@ include ../../Makefile.defs + auto_gen= + NAME=pua_bla.so + LIBS= +-DEFS+=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 -I$(LOCALBASE)/include +-LIBS+=-L/usr/include/lib -L$(LOCALBASE)/lib -lxml2 ++DEFS+=-I$(LOCALBASE)/include/libxml2 -I$(LOCALBASE)/include ++LIBS+=-L$(LOCALBASE)/lib -lxml2 + + include ../../Makefile.modules + +--- a/modules/pua_xmpp/Makefile ++++ b/modules/pua_xmpp/Makefile +@@ -10,7 +10,7 @@ auto_gen= + NAME= pua_xmpp.so + LIBS= + +-DEFS+=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 -I$(LOCALBASE)/include +-LIBS+=-L/usr/include/lib -L$(LOCALBASE)/lib -lxml2 ++DEFS+=-I$(LOCALBASE)/include/libxml2 -I$(LOCALBASE)/include ++LIBS+=-L$(LOCALBASE)/lib -lxml2 + + include ../../Makefile.modules +--- a/modules/regex/Makefile ++++ b/modules/regex/Makefile +@@ -20,8 +20,8 @@ ifneq ($(PCRECFG),) + + else + +- DEFS+=-I/usr/include -I/usr/sfw/include -I/usr/local/include -I/opt/csw/include -I$(LOCALBASE)/include +- LIBS=-I/usr/lib -I/usr/sfw/lib -I/usr/local/lib -I/opt/csw/lib -I$(LOCALBASE)/lib -lpcre ++ DEFS+=-I$(LOCALBASE)/include ++ LIBS=-L$(LOCALBASE)/lib -lpcre + + endif + +--- a/modules/tlsops/Makefile ++++ b/modules/tlsops/Makefile +@@ -7,8 +7,8 @@ auto_gen= + NAME=tlsops.so + LIBS= + +-DEFS+= -I$(LOCALBASE)/ssl/include -I$(LOCALBASE)/include -I/usr/sfw/include -I/usr/local/ssl/include +-LIBS+= -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib -L/usr/sfw/lib -L/usr/local/ssl/lib -lssl -lcrypto ++DEFS+= -I$(LOCALBASE)/include ++LIBS+= -L$(LOCALBASE)/lib -lssl -lcrypto + + include ../../Makefile.modules + diff --git a/net/openslp/Makefile b/net/openslp/Makefile new file mode 100644 index 0000000..1dbe738 --- /dev/null +++ b/net/openslp/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2008-2011 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:=openslp +PKG_VERSION:=1.2.1 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/openslp +PKG_MD5SUM:=ff9999d1b44017281dd00ed2c4d32330 + +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/openslp + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libopenssl + TITLE:=openslp + URL:=http://www.openslp.org/ +endef + +#CONFIGURE_ARGS += \ +# --disable-libwrap + +#MAKE_FLAGS += \ +# CFLAGS="$(TARGET_CFLAGS) -Wall -D_REENTRANT" \ +# all + +define Package/openslp/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libslp.so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/slptool $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/slpd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/etc/slp.* $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/etc/init.d/* $(1)/etc/init.d/ +endef + +define Package/openslp/conffiles +/etc/slp.* +endef + +$(eval $(call BuildPackage,openslp)) diff --git a/net/openslp/files/etc/init.d/slpd b/net/openslp/files/etc/init.d/slpd new file mode 100644 index 0000000..2b5e727 --- /dev/null +++ b/net/openslp/files/etc/init.d/slpd @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008 OpenWrt.org +START=50 + +start() { + cp /etc/slp* /var + IP=`ifconfig br-lan | grep inet | cut -d" " -f12 | cut -d: -f2` + sed -i "s/IPADDR/${IP}/g" /var/slp.reg + slpd -r /var/slp.reg -c /var/slp.conf +} + +stop() { + killall slpd +} diff --git a/net/openslp/files/etc/slp.conf b/net/openslp/files/etc/slp.conf new file mode 100644 index 0000000..ca434ea --- /dev/null +++ b/net/openslp/files/etc/slp.conf @@ -0,0 +1,28 @@ +;net.slp.useScopes = myScope1, myScope2, myScope3 +;net.slp.DAAddresses = myDa1,myDa2,myDa3 +;net.slp.isDA = true +;net.slp.DAHeartBeat = 10800 +;net.slp.watchRegistrationPID = false +;net.slp.maxResults = 256 +;net.slp.isBroadcastOnly = true +;net.slp.passiveDADetection = false +;net.slp.activeDADetection = false +;net.slp.DAActiveDiscoveryInterval = 1 +;net.slp.multicastTTL = 255 +;net.slp.DADiscoveryMaximumWait = 2000 +;net.slp.DADiscoveryTimeouts = 500,750,1000,1500,2000,3000 +;net.slp.multicastMaximumWait = 5000 +;net.slp.multicastTimeouts = 500,750,1000,1500,2000,3000 +;net.slp.unicastMaximumWait = 5000 +;net.slp.unicastTimeouts = 500,750,1000,1500,2000,3000 +;net.slp.datagramTimeouts = IGNORED +;net.slp.randomWaitBound = 5000 +;net.slp.MTU = 1400 +;net.slp.interfaces = 1.2.3.4,1.2.3.5,1.2.3.6 +;net.slp.securityEnabled=true +;net.slp.checkSourceAddr=false + +;net.slp.traceDATraffic = true +;net.slp.traceReg = true +;net.slp.traceDrop = true +;net.slp.traceMsg = true diff --git a/net/openslp/files/etc/slp.reg b/net/openslp/files/etc/slp.reg new file mode 100644 index 0000000..44fdae3 --- /dev/null +++ b/net/openslp/files/etc/slp.reg @@ -0,0 +1,2 @@ +service:device.AP://IPADDR,en,65535 +use default scopes diff --git a/net/openslp/files/etc/slp.spi b/net/openslp/files/etc/slp.spi new file mode 100644 index 0000000..e69de29 diff --git a/net/openssh/Makefile b/net/openssh/Makefile new file mode 100644 index 0000000..6b390ce --- /dev/null +++ b/net/openssh/Makefile @@ -0,0 +1,206 @@ +# +# Copyright (C) 2006-2011 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:=openssh +PKG_VERSION:=6.1p1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \ + ftp://openbsd.wiretapped.net/pub/OpenBSD/OpenSSH/portable/ \ + ftp://ftp.belnet.be/packages/openbsd/OpenSSH/portable/ \ + ftp://ftp.de.openbsd.org/pub/unix/OpenBSD/OpenSSH/portable/ +PKG_MD5SUM:=3345cbf4efe90ffb06a78670ab2d05d5 + +PKG_BUILD_DEPENDS:=libopenssl + +include $(INCLUDE_DIR)/package.mk + +define Package/openssh/Default + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libopenssl +zlib +SSP_SUPPORT:libssp + TITLE:=OpenSSH + MAINTAINER:=Peter Wagner + URL:=http://www.openssh.com/ + SUBMENU:=SSH +endef + +define Package/openssh-moduli + $(call Package/openssh/Default) + DEPENDS+= +openssh-server + TITLE+= moduli file +endef + +define Package/openssh-moduli/description +OpenSSH server moduli file. +endef + + +define Package/openssh-client + $(call Package/openssh/Default) + TITLE+= client +endef + +define Package/openssh-client/description +OpenSSH client. +endef + +define Package/openssh-client/conffiles +/etc/ssh/ssh_config +endef + +define Package/openssh-client-utils + $(call Package/openssh/Default) + DEPENDS+= +openssh-client +openssh-keygen + TITLE+= client utilities +endef + +define Package/openssh-client-utils/description +OpenSSH client utilities. +endef + +define Package/openssh-keygen + $(call Package/openssh/Default) + TITLE+= keygen +endef + +define Package/openssh-keygen/description +OpenSSH keygen. +endef + +define Package/openssh-server + $(call Package/openssh/Default) + DEPENDS+= +openssh-keygen + TITLE+= server +endef + +define Package/openssh-server/description +OpenSSH server. +endef + +define Package/openssh-server/conffiles +/etc/ssh/sshd_config +endef + +define Package/openssh-sftp-client + $(call Package/openssh/Default) + TITLE+= SFTP client +endef + +define Package/openssh-sftp-client/description +OpenSSH SFTP client. +endef + +define Package/openssh-sftp-server + $(call Package/openssh/Default) + TITLE+= SFTP server +endef + +define Package/openssh-sftp-server/description +OpenSSH SFTP server. +endef + +CONFIGURE_ARGS+= \ + $(DISABLE_NLS) \ + --sysconfdir=/etc/ssh \ + --with-privsep-user=sshd \ + --with-privsep-path=/var/empty \ + --enable-shared \ + --disable-static \ + --disable-debug \ + --disable-strip \ + --disable-etc-default-login \ + --disable-lastlog \ + --disable-utmp \ + --disable-utmpx \ + --disable-wtmp \ + --disable-wtmpx \ + --without-bsd-auth \ + --without-kerberos5 \ + --without-pam \ + --without-x + +ifeq ($(CONFIG_OPENSSL_ENGINE),y) +CONFIGURE_ARGS+= \ + --with-ssl-engine +endif + +ifneq ($(CONFIG_SSP_SUPPORT),y) +CONFIGURE_ARGS += \ + --without-stackprotect +endif + +CONFIGURE_VARS += LD="$(TARGET_CC)" + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + LIBS="" \ + sftp-server + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + STRIP_OPT="" \ + all install +endef + +define Package/openssh-moduli/install + $(INSTALL_DIR) $(1)/etc/ssh + $(CP) $(PKG_INSTALL_DIR)/etc/ssh/moduli $(1)/etc/ssh/ +endef + +define Package/openssh-client/install + $(INSTALL_DIR) $(1)/etc/ssh + chmod 0700 $(1)/etc/ssh + $(CP) $(PKG_INSTALL_DIR)/etc/ssh/ssh_config $(1)/etc/ssh/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/scp $(1)/usr/bin/ +endef + +define Package/openssh-client-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(foreach bin,add agent keyscan keysign,$(PKG_BUILD_DIR)/ssh-$(bin)) $(1)/usr/bin/ +endef + +define Package/openssh-keygen/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh-keygen $(1)/usr/bin/ +endef + + +define Package/openssh-server/install + $(INSTALL_DIR) $(1)/etc/ssh + chmod 0700 $(1)/etc/ssh + $(CP) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/sshd.init $(1)/etc/init.d/sshd + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sshd $(1)/usr/sbin/ +endef + +define Package/openssh-sftp-client/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sftp $(1)/usr/bin/ +endef + +define Package/openssh-sftp-server/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/sftp-server $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/libexec + ln -sf ../lib/sftp-server $(1)/usr/libexec/sftp-server +endef + +$(eval $(call BuildPackage,openssh-client)) +$(eval $(call BuildPackage,openssh-moduli)) +$(eval $(call BuildPackage,openssh-client-utils)) +$(eval $(call BuildPackage,openssh-keygen)) +$(eval $(call BuildPackage,openssh-server)) +$(eval $(call BuildPackage,openssh-sftp-client)) +$(eval $(call BuildPackage,openssh-sftp-server)) diff --git a/net/openssh/files/sshd.init b/net/openssh/files/sshd.init new file mode 100644 index 0000000..ecc44c3 --- /dev/null +++ b/net/openssh/files/sshd.init @@ -0,0 +1,44 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 +STOP=50 + +SERVICE_USE_PID=1 + +start() { + for type in rsa dsa; do { + # check for keys + key=/etc/ssh/ssh_host_${type}_key + [ ! -f $key ] && { + # generate missing keys + [ -x /usr/bin/ssh-keygen ] && { + /usr/bin/ssh-keygen -N '' -t $type -f $key 2>&- >&- + } + } + }; done + user_exists sshd 22 || user_add sshd 22 22 sshd /var/empty + group_exists sshd 22 || group_add sshd 22 + mkdir -m 0700 -p /var/empty + service_start /usr/sbin/sshd +} + +stop() { + service_stop /usr/sbin/sshd +} + +shutdown() { + local pid + local pids + local pid_mine + + stop + + # kill active clients + pid_mine="$$" + pids="$(pidof sshd)" + for pid in $pids; do + [ "$pid" = "$pid_mine" ] && continue + [ -e "/proc/$pid/stat" ] && kill $pid + done +} diff --git a/net/openssh/patches/100-no_cast_fix.patch b/net/openssh/patches/100-no_cast_fix.patch new file mode 100644 index 0000000..dfcf0d0 --- /dev/null +++ b/net/openssh/patches/100-no_cast_fix.patch @@ -0,0 +1,12 @@ +--- a/cipher.c ++++ b/cipher.c +@@ -73,7 +73,9 @@ struct Cipher { + + { "3des-cbc", SSH_CIPHER_SSH2, 8, 24, 0, 1, EVP_des_ede3_cbc }, + { "blowfish-cbc", SSH_CIPHER_SSH2, 8, 16, 0, 1, EVP_bf_cbc }, ++#ifndef OPENSSL_NO_CAST + { "cast128-cbc", SSH_CIPHER_SSH2, 8, 16, 0, 1, EVP_cast5_cbc }, ++#endif + { "arcfour", SSH_CIPHER_SSH2, 8, 16, 0, 0, EVP_rc4 }, + { "arcfour128", SSH_CIPHER_SSH2, 8, 16, 1536, 0, EVP_rc4 }, + { "arcfour256", SSH_CIPHER_SSH2, 8, 32, 1536, 0, EVP_rc4 }, diff --git a/net/openssh/patches/110-no_ripemd_fix.patch b/net/openssh/patches/110-no_ripemd_fix.patch new file mode 100644 index 0000000..463a9a6 --- /dev/null +++ b/net/openssh/patches/110-no_ripemd_fix.patch @@ -0,0 +1,13 @@ +--- a/mac.c ++++ b/mac.c +@@ -67,8 +67,10 @@ struct { + #endif + { "hmac-md5", SSH_EVP, EVP_md5, 0, -1, -1 }, + { "hmac-md5-96", SSH_EVP, EVP_md5, 96, -1, -1 }, ++#ifndef OPENSSL_NO_RIPEMD + { "hmac-ripemd160", SSH_EVP, EVP_ripemd160, 0, -1, -1 }, + { "hmac-ripemd160@openssh.com", SSH_EVP, EVP_ripemd160, 0, -1, -1 }, ++#endif + { "umac-64@openssh.com", SSH_UMAC, NULL, 0, 128, 64 }, + { NULL, 0, NULL, 0, -1, -1 } + }; diff --git a/net/openssh/patches/130-implicit_memset_decl_fix.patch b/net/openssh/patches/130-implicit_memset_decl_fix.patch new file mode 100644 index 0000000..a2229ee --- /dev/null +++ b/net/openssh/patches/130-implicit_memset_decl_fix.patch @@ -0,0 +1,12 @@ +--- a/includes.h ++++ b/includes.h +@@ -57,6 +57,9 @@ + /* + *-*-nto-qnx needs these headers for strcasecmp and LASTLOG_FILE respectively + */ ++#ifdef HAVE_STRING_H ++# include ++#endif + #ifdef HAVE_STRINGS_H + # include + #endif diff --git a/net/openssh/patches/140-pam_uclibc_pthreads_fix.patch b/net/openssh/patches/140-pam_uclibc_pthreads_fix.patch new file mode 100644 index 0000000..8018de0 --- /dev/null +++ b/net/openssh/patches/140-pam_uclibc_pthreads_fix.patch @@ -0,0 +1,84 @@ +--- a/auth-pam.c ++++ b/auth-pam.c +@@ -159,7 +159,7 @@ sshpam_sigchld_handler(int sig) + } + if (WIFSIGNALED(sshpam_thread_status) && + WTERMSIG(sshpam_thread_status) == SIGTERM) +- return; /* terminated by pthread_cancel */ ++ return; /* terminated by pthread2_cancel */ + if (!WIFEXITED(sshpam_thread_status)) + sigdie("PAM: authentication thread exited unexpectedly"); + if (WEXITSTATUS(sshpam_thread_status) != 0) +@@ -168,14 +168,14 @@ sshpam_sigchld_handler(int sig) + + /* ARGSUSED */ + static void +-pthread_exit(void *value) ++pthread2_exit(void *value) + { + _exit(0); + } + + /* ARGSUSED */ + static int +-pthread_create(sp_pthread_t *thread, const void *attr, ++pthread2_create(sp_pthread_t *thread, const void *attr, + void *(*thread_start)(void *), void *arg) + { + pid_t pid; +@@ -201,7 +201,7 @@ pthread_create(sp_pthread_t *thread, con + } + + static int +-pthread_cancel(sp_pthread_t thread) ++pthread2_cancel(sp_pthread_t thread) + { + signal(SIGCHLD, sshpam_oldsig); + return (kill(thread, SIGTERM)); +@@ -209,7 +209,7 @@ pthread_cancel(sp_pthread_t thread) + + /* ARGSUSED */ + static int +-pthread_join(sp_pthread_t thread, void **value) ++pthread2_join(sp_pthread_t thread, void **value) + { + int status; + +@@ -509,7 +509,7 @@ sshpam_thread(void *ctxtp) + /* XXX - can't do much about an error here */ + ssh_msg_send(ctxt->pam_csock, sshpam_err, &buffer); + buffer_free(&buffer); +- pthread_exit(NULL); ++ pthread2_exit(NULL); + + auth_fail: + buffer_put_cstring(&buffer, +@@ -520,7 +520,7 @@ sshpam_thread(void *ctxtp) + else + ssh_msg_send(ctxt->pam_csock, PAM_AUTH_ERR, &buffer); + buffer_free(&buffer); +- pthread_exit(NULL); ++ pthread2_exit(NULL); + + return (NULL); /* Avoid warning for non-pthread case */ + } +@@ -532,8 +532,8 @@ sshpam_thread_cleanup(void) + + debug3("PAM: %s entering", __func__); + if (ctxt != NULL && ctxt->pam_thread != 0) { +- pthread_cancel(ctxt->pam_thread); +- pthread_join(ctxt->pam_thread, NULL); ++ pthread2_cancel(ctxt->pam_thread); ++ pthread2_join(ctxt->pam_thread, NULL); + close(ctxt->pam_psock); + close(ctxt->pam_csock); + memset(ctxt, 0, sizeof(*ctxt)); +@@ -698,7 +698,7 @@ sshpam_init_ctx(Authctxt *authctxt) + } + ctxt->pam_psock = socks[0]; + ctxt->pam_csock = socks[1]; +- if (pthread_create(&ctxt->pam_thread, NULL, sshpam_thread, ctxt) == -1) { ++ if (pthread2_create(&ctxt->pam_thread, NULL, sshpam_thread, ctxt) == -1) { + error("PAM: failed to start authentication thread: %s", + strerror(errno)); + close(socks[0]); diff --git a/net/openssh/patches/200-dscp-qos.patch b/net/openssh/patches/200-dscp-qos.patch new file mode 100644 index 0000000..0d2fa59 --- /dev/null +++ b/net/openssh/patches/200-dscp-qos.patch @@ -0,0 +1,21 @@ +--- a/ssh_config ++++ b/ssh_config +@@ -45,3 +45,6 @@ + # PermitLocalCommand no + # VisualHostKey no + # ProxyCommand ssh -q -W %h:%p gateway.example.com ++ ++# enable DSCP QoS values (per RFC-4594) ++#IPQoS AF21 AF11 +--- a/sshd_config ++++ b/sshd_config +@@ -111,6 +111,9 @@ AuthorizedKeysFile .ssh/authorized_keys + # no default banner path + #Banner none + ++# enable DSCP QoS values (per RFC-4594) ++#IPQoS AF21 AF11 ++ + # override default of no subsystems + Subsystem sftp /usr/libexec/sftp-server + diff --git a/net/openswan/Makefile b/net/openswan/Makefile new file mode 100644 index 0000000..78c4589 --- /dev/null +++ b/net/openswan/Makefile @@ -0,0 +1,109 @@ +# +# Copyright (C) 2006-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=openswan +PKG_VERSION:=2.6.38 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.openswan.org/download +PKG_MD5SUM:=13073eb5314b83a31be88e4117e8bbcd + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/openswan/Default + TITLE:=Openswan + URL:=http://www.openswan.org/ +endef + +define Package/openswan/Default/description + Openswan is an IPsec implementation for Linux. +endef + +define Package/openswan +$(call Package/openswan/Default) + SUBMENU:=VPN + SECTION:=net + CATEGORY:=Network + TITLE+= (daemon) + DEPENDS+= +libgmp +ip +endef + +define Package/openswan/description +$(call Package/openswan/Default/description) + This package contains the Openswan user-land daemon. +endef + +define KernelPackage/openswan +$(call Package/openswan/Default) + SUBMENU:=Network Support + TITLE+= (kernel module) + DEPENDS+=+IPV6:kmod-ipv6 + FILES:=$(PKG_BUILD_DIR)/modobj*/ipsec.$(LINUX_KMOD_SUFFIX) +endef + +define KernelPackage/openswan/description +$(call Package/openswan/Default/description) + This package contains the Openswan kernel module. +endef + +TARGET_CPPFLAGS += -I$(LINUX_DIR)/include -D__EXPORTED_HEADERS__ + +OPENSWAN_MAKEFLAGS:= \ + -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + LINUX_RELEASE="$(LINUX_RELEASE)" \ + KERNELSRC="$(LINUX_DIR)" \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + USERCOMPILE="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/ports/linux/include -I$(PKG_BUILD_DIR)/linux/include -I$(PKG_BUILD_DIR)/include $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)" \ + IPSECDIR="/usr/lib/ipsec" \ + INC_USRLOCAL="/usr" \ + INC_RCDEFAULT="/etc/init.d" \ + MODPROBE="/sbin/insmod" \ + DESTDIR="$(PKG_INSTALL_DIR)" + +define Build/Compile + +$(MAKE) $(PKG_JOBS) $(OPENSWAN_MAKEFLAGS) programs + +$(MAKE) $(PKG_JOBS) $(OPENSWAN_MAKEFLAGS) module +endef + +define Build/Install + $(MAKE) $(OPENSWAN_MAKEFLAGS) install +endef + +define Package/openswan/conffiles +/etc/ipsec.conf +/etc/ipsec.secrets +/etc/config/ipsec +endef + +define Package/openswan/install + $(CP) $(PKG_INSTALL_DIR)/* $(1) + $(INSTALL_DIR) $(1)/etc/init.d + $(CP) ./files/ipsec.init $(1)/etc/init.d/ipsec + $(CP) ./files/ipsec.conf $(1)/etc/ipsec.conf + $(CP) ./files/ipsec.secrets $(1)/etc/ipsec.secrets + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/ipsec.config $(1)/etc/config/ipsec + rm -rf $(1)/usr/share + rm -rf $(1)/usr/man + rm -rf $(1)/var + rm -rf $(1)/etc/rc.d + find $(1) -name \*.old | xargs rm -rf + $(INSTALL_DIR) $(1)/lib/upgrade/keep.d + $(INSTALL_DATA) files/ipsec.upgrade $(1)/lib/upgrade/keep.d/ipsec +endef + +$(eval $(call BuildPackage,openswan)) +$(eval $(call KernelPackage,openswan)) diff --git a/net/openswan/files/ipsec.conf b/net/openswan/files/ipsec.conf new file mode 100644 index 0000000..b214bac --- /dev/null +++ b/net/openswan/files/ipsec.conf @@ -0,0 +1,8 @@ +# /etc/ipsec.conf - IPsec configuration file + +version 2.0 + +include /etc/ipsec.uci.conf + +# Include non-UCI connections here +# They will be preserved across restarts/upgrades diff --git a/net/openswan/files/ipsec.config b/net/openswan/files/ipsec.config new file mode 100644 index 0000000..6469e98 --- /dev/null +++ b/net/openswan/files/ipsec.config @@ -0,0 +1,2 @@ +config ipsec_config setup + option nat_traversal yes diff --git a/net/openswan/files/ipsec.init b/net/openswan/files/ipsec.init new file mode 100755 index 0000000..b0961b3 --- /dev/null +++ b/net/openswan/files/ipsec.init @@ -0,0 +1,393 @@ +#!/bin/sh /etc/rc.common +# IPsec startup and shutdown script +# Copyright (C) 1998, 1999, 2001 Henry Spencer. +# Copyright (C) 2002 Michael Richardson +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. See . +# +# 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. +# +# +# ipsec init.d script for starting and stopping +# the IPsec security subsystem (KLIPS and Pluto). +# +# This script becomes /etc/rc.d/init.d/ipsec (or possibly /etc/init.d/ipsec) +# and is also accessible as "ipsec setup" (the preferred route for human +# invocation). +# +# The startup and shutdown times are a difficult compromise (in particular, +# it is almost impossible to reconcile them with the insanely early/late +# times of NFS filesystem startup/shutdown). Startup is after startup of +# syslog and pcmcia support; shutdown is just before shutdown of syslog. +# +# chkconfig: 2345 47 76 +# description: IPsec provides encrypted and authenticated communications; \ +# KLIPS is the kernel half of it, Pluto is the user-level management daemon. + +START=60 +EXTRA_COMMANDS=status +EXTRA_HELP=" status Show the status of the service" + +# Format a list into a delimited string and print it +config_list_delimit() { + local SECTION="$1" + local OPTION="$2" + local DELIMITER="${3:- }" + + config_list_foreach "$SECTION" "$OPTION" "printf \"%s%s\"" "$DELIMITER" | sed "s/.\{${#DELIMITER}\}$//" +} + +# Callback for each ipsec configuration section +# Converts list options from UCI to ipsec format and writes ipsec section headers +CUR_SECTION_NAME= +CUR_SECTION_TYPE= +config_cb() { + local TYPE="$1" + local NAME="$2" + + # Handle list options from previous section + if [ "$CUR_SECTION_TYPE" = "ipsec_conn" ] ; then + local IKE="$(config_list_delimit "$CUR_SECTION_NAME" "ike" ", ")" + if [ -n "$IKE" ] ; then + printf "\tike=\"%s\"\n" "$IKE" >> "$IPSEC_UCI_CONF" + fi + + local SUBNETS + local SPACE_PAT="* *" + config_get "SUBNETS" "$CUR_SECTION_NAME" "leftsubnets" + case "$SUBNETS" in + $SPACE_PAT) + printf "\tleftsubnets={ %s }\n" "$SUBNETS" >> "$IPSEC_UCI_CONF" + ;; + ?*) + printf "\tleftsubnet=%s\n" "$SUBNETS" >> "$IPSEC_UCI_CONF" + ;; + esac + + config_get "SUBNETS" "$CUR_SECTION_NAME" "rightsubnets" + case "$SUBNETS" in + $SPACE_PAT) + printf "\trightsubnets={ %s }\n" "$SUBNETS" >> "$IPSEC_UCI_CONF" + ;; + ?*) + printf "\trightsubnet=%s\n" "$SUBNETS" >> "$IPSEC_UCI_CONF" + ;; + esac + elif [ "$CUR_SECTION_TYPE" = "ipsec_config" ] ; then + local VPRIV="$(config_list_delimit "$CUR_SECTION_NAME" "virtual_private" ",")" + if [ -n "$VPRIV" ] ; then + printf "\tvirtual_private=%s\n" "$VPRIV" >> "$IPSEC_UCI_CONF" + fi + fi + + CUR_SECTION_NAME="$NAME" + CUR_SECTION_TYPE="$TYPE" + + case "$CUR_SECTION_TYPE" in + ipsec_config|ipsec_conn) + # Handled in option_cb + echo >> "$IPSEC_UCI_CONF" + echo "${TYPE#ipsec_} $NAME" >> "$IPSEC_UCI_CONF" + ;; + *) + # Not handled in option_cb + ;; + esac + + return 0 +} + +# Callback for each ipsec configuration option +# Prints each UCI option to $IPSEC_UCI_CONF in ipsec.conf format +option_cb() { + local NAME="$1" + local VALUE="$2" + + case "$CUR_SECTION_TYPE" in + ipsec_config|ipsec_conn) + # Handle option in these sections + ;; + *) + # Ignore options in all other sections + return 0 + ;; + esac + + case "$NAME" in + modecfgdns_ITEM[0-9]*) + printf "\tmodecfgdns%d=%s\n" "${NAME##modecfgdns_ITEM}" "$VALUE" >> "$IPSEC_UCI_CONF" + ;; + modecfgwins_ITEM[0-9]*) + printf "\tmodecfgwins%d=%s\n" "${NAME##modecfgwins_ITEM}" "$VALUE" >> "$IPSEC_UCI_CONF" + ;; + *_ITEM[0-9]*|*_LENGTH) + # Ignore list items and length updates + ;; + [!a-zA-Z]*) + # Ignore non-ipsec.conf parameters + ;; + *) + # Quote values with characers which require quoting + if echo "$VALUE" | grep -q '^[[:alnum:]_%.]*$' ; then + printf "\t%s=%s\n" "$NAME" "$VALUE" >> "$IPSEC_UCI_CONF" + else + printf "\t%s=\"%s\"\n" "$NAME" "$VALUE" >> "$IPSEC_UCI_CONF" + fi + ;; + esac + + return 0 +} + +ipsec_config_convert() { + IPSEC_UCI_CONF="${IPSEC_UCI_CONF:-${IPSEC_CONFS:-/etc}/ipsec.uci.conf}" + ipsec_config_print_header + config_load "ipsec" + # Conversion for $IPSEC_UCI_CONF handled in section_cb and option_cb + + IPSEC_SEC_UCI_CONF="${IPSEC_SEC_UCI_CONF:-${IPSEC_CONFS:-/etc}/ipsec.uci.secrets}" + ipsec_config_print_header_secret + echo >> "$IPSEC_SEC_UCI_CONF" + echo "# Certificate Secrets" >> "$IPSEC_SEC_UCI_CONF" + config_foreach "ipsec_config_add_secret_cs" "ipsec_secret_cs" + echo >> "$IPSEC_SEC_UCI_CONF" + echo "# Shared Secrets" >> "$IPSEC_SEC_UCI_CONF" + config_foreach "ipsec_config_add_secret_ss" "ipsec_secret_ss" + echo >> "$IPSEC_SEC_UCI_CONF" + echo "# XAUTH Secrets" >> "$IPSEC_SEC_UCI_CONF" + config_foreach "ipsec_config_add_secret_xs" "ipsec_secret_xs" +} + +ipsec_config_print_header() { + cat > "$IPSEC_UCI_CONF" < "$IPSEC_SEC_UCI_CONF" <> "$IPSEC_SEC_UCI_CONF" +} + +ipsec_config_add_secret_ss() { + local SECTNAME="$1" + + config_get "INDICES" "$SECTNAME" "indices" + config_get "SECRET" "$SECTNAME" "secret" + + echo "$INDICES : PSK \"$SECRET\"" >> "$IPSEC_SEC_UCI_CONF" +} + +ipsec_config_add_secret_xs() { + local SECTNAME="$1" + + config_get "USERNAME" "$SECTNAME" "username" + config_get "SECRET" "$SECTNAME" "secret" + + echo "@$USERNAME : XAUTH \"$SECRET\"" >> "$IPSEC_SEC_UCI_CONF" +} + +script_init() { + me='ipsec setup' # for messages + + # where the private directory and the config files are + IPSEC_EXECDIR="${IPSEC_EXECDIR-/usr/libexec/ipsec}" + IPSEC_LIBDIR="${IPSEC_LIBDIR-/usr/lib/ipsec}" + IPSEC_SBINDIR="${IPSEC_SBINDIR-/usr/sbin}" + IPSEC_CONFS="${IPSEC_CONFS-/etc}" + + if test " $IPSEC_DIR" = " " # if we were not called by the ipsec command + then + # we must establish a suitable PATH ourselves + PATH="${IPSEC_SBINDIR}":/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin + export PATH + + IPSEC_DIR="$IPSEC_LIBDIR" + export IPSEC_DIR IPSEC_CONFS IPSEC_LIBDIR IPSEC_EXECDIR + fi + + # Check that the ipsec command is available. + found= + for dir in `echo $PATH | tr ':' ' '` + do + if test -f $dir/ipsec -a -x $dir/ipsec + then + found=yes + break # NOTE BREAK OUT + fi + done + if ! test "$found" + then + echo "cannot find ipsec command -- \`$1' aborted" | + logger -s -p daemon.error -t ipsec_setup + exit 1 + fi + + # accept a few flags + + export IPSEC_setupflags + IPSEC_setupflags="" + + config="" + + for dummy + do + case "$1" in + --showonly|--show) IPSEC_setupflags="$1" ;; + --config) config="--config $2" ; shift ;; + *) break ;; + esac + shift + done + + + # Pick up IPsec configuration (until we have done this, successfully, we + # do not know where errors should go, hence the explicit "daemon.error"s.) + # Note the "--export", which exports the variables created. + variables=`ipsec addconn $config --varprefix IPSEC --configsetup` + if [ $? != 0 ] + then + echo "Failed to parse config setup portion of ipsec.conf" + exit $? + fi + eval $variables + + if test " $IPSEC_confreadstatus" != " " + then + case $1 in + stop|--stop|_autostop) + echo "$IPSEC_confreadstatus -- \`$1' may not work" | + logger -s -p daemon.error -t ipsec_setup;; + + *) echo "$IPSEC_confreadstatus -- \`$1' aborted" | + logger -s -p daemon.error -t ipsec_setup; + exit 1;; + esac + fi + + IPSEC_confreadsection=${IPSEC_confreadsection:-setup} + export IPSEC_confreadsection + + IPSECsyslog=${IPSECsyslog-daemon.error} + export IPSECsyslog + + # misc setup + umask 022 + + mkdir -p /var/run/pluto +} + +script_command() { + # do it + case "$1" in + start|--start|stop|--stop|_autostop|_autostart) + # remove for: @cygwin_START@ + # portable way for checking for root + if [ ! -w / ] + then + + echo "permission denied (must be superuser)" | + logger -s -p $IPSECsyslog -t ipsec_setup 2>&1 + exit 1 + fi + # remove for: @cygwin_END@ + tmp=/var/run/pluto/ipsec_setup.st + outtmp=/var/run/pluto/ipsec_setup.out + ( + ipsec _realsetup $1 + echo "$?" >$tmp + ) > ${outtmp} 2>&1 + st=$? + if test -f $tmp + then + st=`cat $tmp` + rm -f $tmp + fi + if [ -f ${outtmp} ]; then + cat ${outtmp} | logger -s -p $IPSECsyslog -t ipsec_setup 2>&1 + rm -f ${outtmp} + fi + ;; + + restart|--restart|force-reload) + $0 $IPSEC_setupflags stop + $0 $IPSEC_setupflags start + ;; + + _autorestart) # for internal use only + $0 $IPSEC_setupflags _autostop + $0 $IPSEC_setupflags _autostart + ;; + + status|--status) + ipsec _realsetup $1 + exit + ;; + + --version) + echo "$me $IPSEC_VERSION" + exit 0 + ;; + + --help) + echo "Usage: $me [ --showonly ] {--start|--stop|--restart}" + echo " $me --status" + exit 0 + ;; + + *) + echo "Usage: $me [ --showonly ] {--start|--stop|--restart}" + echo " $me --status" + exit 2 + esac +} +start() { + ipsec_config_convert + script_init start "$@" + script_command start "$@" +} + +stop() { + script_init stop "$@" + script_command stop "$@" +} + +restart() { + ipsec_config_convert + script_init stop "$@" + script_command stop "$@" + script_command start "$@" +} + +status() { + script_init status "$@" + ipsec _realsetup status +} + diff --git a/net/openswan/files/ipsec.secrets b/net/openswan/files/ipsec.secrets new file mode 100644 index 0000000..1384683 --- /dev/null +++ b/net/openswan/files/ipsec.secrets @@ -0,0 +1,7 @@ +# /etc/ipsec.secrets - IPsec sensitive configuration file + +# Include configuration information from UCI +include /etc/ipsec.uci.secrets + +# Add non-UCI secrets below +# This file will be preserved across restarts/upgrades diff --git a/net/openswan/files/ipsec.upgrade b/net/openswan/files/ipsec.upgrade new file mode 100644 index 0000000..36ba0c5 --- /dev/null +++ b/net/openswan/files/ipsec.upgrade @@ -0,0 +1,3 @@ +/etc/ipsec.conf +/etc/ipsec.d/ +/etc/ipsec.secrets diff --git a/net/openswan/patches/100-cross_compile.patch b/net/openswan/patches/100-cross_compile.patch new file mode 100644 index 0000000..63085d0 --- /dev/null +++ b/net/openswan/patches/100-cross_compile.patch @@ -0,0 +1,30 @@ +Index: openswan-2.6.38/programs/pluto/Makefile +=================================================================== +--- openswan-2.6.38.orig/programs/pluto/Makefile 2012-03-23 22:33:43.000000000 +0100 ++++ openswan-2.6.38/programs/pluto/Makefile 2012-08-14 15:17:29.000000000 +0200 +@@ -58,10 +58,6 @@ + + ALLFLAGS = $(CPPFLAGS) $(CFLAGS) ${CROSSFLAGS} + +-ifneq ($(LD_LIBRARY_PATH),) +-LDFLAGS+=-L$(LD_LIBRARY_PATH) +-endif +- + LIBSADNS = $(OPENSWANLIB) + LIBSADNS += -lresolv # -lefence + +Index: openswan-2.6.38/programs/Makefile.program +=================================================================== +--- openswan-2.6.38.orig/programs/Makefile.program 2012-08-14 15:17:32.000000000 +0200 ++++ openswan-2.6.38/programs/Makefile.program 2012-08-14 15:17:38.000000000 +0200 +@@ -55,10 +55,6 @@ + + CFLAGS+= ${WERROR} + +-ifneq ($(LD_LIBRARY_PATH),) +-LDFLAGS=-L$(LD_LIBRARY_PATH) +-endif +- + ifeq ($(USE_DMALLOC),true) + CFLAGS+=-DDMALLOC + LIBS+= -ldmalloc diff --git a/net/openswan/patches/120-no_manpages.patch b/net/openswan/patches/120-no_manpages.patch new file mode 100644 index 0000000..3cac7ce --- /dev/null +++ b/net/openswan/patches/120-no_manpages.patch @@ -0,0 +1,60 @@ +--- a/programs/_confread/Makefile ++++ b/programs/_confread/Makefile +@@ -14,7 +14,6 @@ + OPENSWANSRCDIR?=$(shell cd ../..; pwd) + include ${OPENSWANSRCDIR}/Makefile.inc + +-EXTRA5MAN=ipsec.conf.5 + CONFFILES=ipsec.conf + EXCONFILES=ipsec.win2k.conf + SOURCEDIR=_confread +@@ -24,11 +23,3 @@ CONFDFILES=clear clear-or-private privat + + include ${srcdir}../Makefile.program + +-ipsec.conf.5: ${srcdir}ipsec.conf.5.xml +- +-${srcdir}ipsec.conf.5.xml: $(wildcard d.ipsec.conf/*.xml) ${srcdir}d.ipsec.conf/order.txt +- cd ${srcdir} && cat `cat ${srcdir}d.ipsec.conf/order.txt` >ipsec.conf.5.xml +- +-diff: ipsec.conf.5.xml +- diff -B -w -u ipsec.conf.5.xml ipsec.conf.5.xml-ref +- +--- a/programs/pluto/Makefile ++++ b/programs/pluto/Makefile +@@ -196,35 +196,11 @@ doinstall: all + $(INSTALL) $(INSTBINFLAGS) $(BINNAMEPLUTO) $(BINNAMEWHACK) $(LIBEXECDIR) + #$(INSTALL) $(INSTSUIDFLAGS) $(BINNAMEWHACKINIT) $(LIBEXECDIR) + if $(USE_ADNS) ; then $(INSTALL) $(INSTBINFLAGS) $(BINNAMEADNS) $(LIBEXECDIR) ; fi +- $(INSTALL) $(INSTMANFLAGS) ${srcdir}pluto.8 $(PMANDIR)/ipsec_pluto.8 +- sh ${OPENSWANSRCDIR}/packaging/utils/manlink ${srcdir}pluto.8 | \ +- while read from to ; \ +- do \ +- ln -s -f ipsec_$$from $(PMANDIR)/$$to; \ +- done +- $(INSTALL) $(INSTMANFLAGS) ${srcdir}ipsec.secrets.5 $(FMANDIR) +- sh ${OPENSWANSRCDIR}/packaging/utils/manlink ${srcdir}ipsec.secrets.5 | \ +- while read from to ; \ +- do \ +- ln -s -f $$from $(FMANDIR)/$$to; \ +- done + + install_file_list: + @echo $(LIBEXECDIR)/$(BINNAMEPLUTO) + @if $(USE_ADNS) ; then echo $(LIBDIR)/$(BINNAMEADNS) ; fi + @echo $(LIBEXECDIR)/$(BINNAMEWHACK) +- @echo $(PMANDIR)/ipsec_pluto.8 +- @sh ${OPENSWANSRCDIR}/packaging/utils/manlink pluto.8 | \ +- while read from to; \ +- do\ +- echo $(PMANDIR)/$$to; \ +- done +- @echo $(FMANDIR)/ipsec.secrets.5 +- @sh ${OPENSWANSRCDIR}/packaging/utils/manlink ipsec.secrets.5 | \ +- while read from to; \ +- do \ +- echo $(FMANDIR)/$$to; \ +- done + + alg_info_test: alg_info_test.o ike_alg.o constants.o defs.o log.o db_ops.o crypto.o $(LIBDESLITE) $(OPENSWANLIB) + $(CC) -o $@ $^ $(LDFLAGS) $(LIBSPLUTO) diff --git a/net/openswan/patches/140-generated_autoconf.patch b/net/openswan/patches/140-generated_autoconf.patch new file mode 100644 index 0000000..11ddcc5 --- /dev/null +++ b/net/openswan/patches/140-generated_autoconf.patch @@ -0,0 +1,365 @@ +--- a/linux/include/ocf-compat.h ++++ b/linux/include/ocf-compat.h +@@ -35,10 +35,11 @@ + /****************************************************************************/ + #ifdef __KERNEL__ + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif +- + /* + * fake some BSD driver interface stuff specifically for OCF use + */ +--- a/linux/include/openswan/ipsec_kversion.h ++++ b/linux/include/openswan/ipsec_kversion.h +@@ -57,8 +57,10 @@ + * We use a lot of config defines, on older kernels that means we + * need to include config.h + */ +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-# include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif + + #if !defined(RHEL_RELEASE_CODE) +--- a/linux/net/ipsec/aes/ipsec_alg_aes.c ++++ b/linux/net/ipsec/aes/ipsec_alg_aes.c +@@ -22,8 +22,10 @@ + * + */ + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif + #include + +--- a/linux/net/ipsec/des/ipsec_alg_3des.c ++++ b/linux/net/ipsec/des/ipsec_alg_3des.c +@@ -19,8 +19,10 @@ + * + */ + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif + #include + +--- a/linux/net/ipsec/ipcomp.c ++++ b/linux/net/ipsec/ipcomp.c +@@ -19,10 +19,11 @@ + /* SSS */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif +- + #define __NO_VERSION__ + #include + #include /* printk() */ +--- a/linux/net/ipsec/ipsec_ah.c ++++ b/linux/net/ipsec/ipsec_ah.c +@@ -14,10 +14,11 @@ + */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif +- + #define __NO_VERSION__ + #include + #include /* printk() */ +--- a/linux/net/ipsec/ipsec_alg.c ++++ b/linux/net/ipsec/ipsec_alg.c +@@ -19,10 +19,11 @@ + * + */ + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif +- + #define __NO_VERSION__ + #include + #include /* printk() */ +--- a/linux/net/ipsec/ipsec_alg_cryptoapi.c ++++ b/linux/net/ipsec/ipsec_alg_cryptoapi.c +@@ -26,10 +26,11 @@ + * modprobe ipsec_cryptoapi des_ede3=0 (everything but 3DES) + */ + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif +- + /* + * special case: ipsec core modular with this static algo inside: + * must avoid MODULE magic for this file +--- a/linux/net/ipsec/ipsec_esp.c ++++ b/linux/net/ipsec/ipsec_esp.c +@@ -14,10 +14,11 @@ + */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif +- + #define __NO_VERSION__ + #include + #include /* printk() */ +--- a/linux/net/ipsec/ipsec_init.c ++++ b/linux/net/ipsec/ipsec_init.c +@@ -19,8 +19,10 @@ + */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif + #include + #include /* printk() */ +--- a/linux/net/ipsec/ipsec_ipcomp.c ++++ b/linux/net/ipsec/ipsec_ipcomp.c +@@ -14,10 +14,11 @@ + */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif +- + #define __NO_VERSION__ + #include + #include /* printk() */ +--- a/linux/net/ipsec/ipsec_ipip.c ++++ b/linux/net/ipsec/ipsec_ipip.c +@@ -14,10 +14,11 @@ + */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif +- + #define __NO_VERSION__ + #include + #include /* printk() */ +--- a/linux/net/ipsec/ipsec_ocf.c ++++ b/linux/net/ipsec/ipsec_ocf.c +@@ -16,10 +16,11 @@ + */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif +- + #define __NO_VERSION__ + #include + #include /* printk() */ +--- a/linux/net/ipsec/ipsec_ocf.h ++++ b/linux/net/ipsec/ipsec_ocf.h +@@ -19,8 +19,10 @@ + */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif + #include + +--- a/linux/net/ipsec/ipsec_radij.c ++++ b/linux/net/ipsec/ipsec_radij.c +@@ -21,8 +21,10 @@ + */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif + #include /* printk() */ + +--- a/linux/net/ipsec/ipsec_rcv.c ++++ b/linux/net/ipsec/ipsec_rcv.c +@@ -21,10 +21,11 @@ + */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif +- + #define __NO_VERSION__ + #include + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,26) +--- a/linux/net/ipsec/ipsec_sa.c ++++ b/linux/net/ipsec/ipsec_sa.c +@@ -19,8 +19,10 @@ + */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif + #include /* printk() */ + +--- a/linux/net/ipsec/ipsec_snprintf.c ++++ b/linux/net/ipsec/ipsec_snprintf.c +@@ -19,8 +19,10 @@ + */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif + #define __NO_VERSION__ + #include +--- a/linux/net/ipsec/ipsec_tunnel.c ++++ b/linux/net/ipsec/ipsec_tunnel.c +@@ -24,8 +24,10 @@ + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,26) + # include + #endif +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif + #include /* printk() */ + +--- a/linux/net/ipsec/ipsec_xform.c ++++ b/linux/net/ipsec/ipsec_xform.c +@@ -15,8 +15,10 @@ + */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif + #include /* printk() */ + +--- a/linux/net/ipsec/pfkey_v2_ext_process.c ++++ b/linux/net/ipsec/pfkey_v2_ext_process.c +@@ -20,8 +20,10 @@ + */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif + #include /* printk() */ + +--- a/linux/net/ipsec/pfkey_v2_parser.c ++++ b/linux/net/ipsec/pfkey_v2_parser.c +@@ -23,8 +23,10 @@ + + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif + #include /* printk() */ + +--- a/linux/net/ipsec/radij.c ++++ b/linux/net/ipsec/radij.c +@@ -54,8 +54,10 @@ + */ + + #include +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +-#include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) ++#include ++#else ++#include + #endif + #include /* printk() */ + diff --git a/net/openvpn-devel/Config-nossl.in b/net/openvpn-devel/Config-nossl.in new file mode 100644 index 0000000..94d2349 --- /dev/null +++ b/net/openvpn-devel/Config-nossl.in @@ -0,0 +1,68 @@ +menu "Configuration" + depends on PACKAGE_openvpn-devel-nossl + +config OPENVPN_DEVEL_nossl_ENABLE_LZO + bool "Enable LZO compression support" + default y + +#config OPENVPN_DEVEL_nossl_ENABLE_CRYPTO +# bool "Enable crypto support" +# default y + +#config OPENVPN_DEVEL_nossl_ENABLE_SSL +# bool "Enable SSL support for TLS-based key exchange" +# default y + +config OPENVPN_DEVEL_nossl_ENABLE_X509_ALT_USERNAME + bool "Enable the --x509-username-field feature" + default n + +config OPENVPN_DEVEL_nossl_ENABLE_SERVER + bool "Enable server support (otherwise only client mode is support)" + default y + +#config OPENVPN_DEVEL_nossl_ENABLE_EUREPHIA +# bool "Enable support for the eurephia plug-in" +# default n + +config OPENVPN_DEVEL_nossl_ENABLE_MANAGEMENT + bool "Enable management server support" + default n + +#config OPENVPN_DEVEL_nossl_ENABLE_PKCS11 +# bool "Enable pkcs11 support" +# default n + +config OPENVPN_DEVEL_nossl_ENABLE_HTTP + bool "Enable HTTP proxy support" + default y + +config OPENVPN_DEVEL_nossl_ENABLE_SOCKS + bool "Enable SOCKS proxy support" + default y + +config OPENVPN_DEVEL_nossl_ENABLE_FRAGMENT + bool "Enable internal fragmentation support (--fragment)" + default y + +config OPENVPN_DEVEL_nossl_ENABLE_MULTIHOME + bool "Enable multi-homed UDP server support (--multihome)" + default y + +config OPENVPN_DEVEL_nossl_ENABLE_PORT_SHARE + bool "Enable TCP server port-share support (--port-share)" + default y + +config OPENVPN_DEVEL_nossl_ENABLE_DEF_AUTH + bool "Enable deferred authentication" + default y + +config OPENVPN_DEVEL_nossl_ENABLE_PF + bool "Enable internal packet filter" + default y + +config OPENVPN_DEVEL_nossl_ENABLE_IPROUTE2 + bool "Enable support for iproute2" + default n + +endmenu diff --git a/net/openvpn-devel/Config-openssl.in b/net/openvpn-devel/Config-openssl.in new file mode 100644 index 0000000..0c01a91 --- /dev/null +++ b/net/openvpn-devel/Config-openssl.in @@ -0,0 +1,68 @@ +menu "Configuration" + depends on PACKAGE_openvpn-devel-openssl + +config OPENVPN_DEVEL_openssl_ENABLE_LZO + bool "Enable LZO compression support" + default y + +#config OPENVPN_DEVEL_openssl_ENABLE_CRYPTO +# bool "Enable crypto support" +# default y + +#config OPENVPN_DEVEL_openssl_ENABLE_SSL +# bool "Enable SSL support for TLS-based key exchange" +# default y + +config OPENVPN_DEVEL_openssl_ENABLE_X509_ALT_USERNAME + bool "Enable the --x509-username-field feature" + default n + +config OPENVPN_DEVEL_openssl_ENABLE_SERVER + bool "Enable server support (otherwise only client mode is support)" + default y + +#config OPENVPN_DEVEL_openssl_ENABLE_EUREPHIA +# bool "Enable support for the eurephia plug-in" +# default n + +config OPENVPN_DEVEL_openssl_ENABLE_MANAGEMENT + bool "Enable management server support" + default n + +#config OPENVPN_DEVEL_openssl_ENABLE_PKCS11 +# bool "Enable pkcs11 support" +# default n + +config OPENVPN_DEVEL_openssl_ENABLE_HTTP + bool "Enable HTTP proxy support" + default y + +config OPENVPN_DEVEL_openssl_ENABLE_SOCKS + bool "Enable SOCKS proxy support" + default y + +config OPENVPN_DEVEL_openssl_ENABLE_FRAGMENT + bool "Enable internal fragmentation support (--fragment)" + default y + +config OPENVPN_DEVEL_openssl_ENABLE_MULTIHOME + bool "Enable multi-homed UDP server support (--multihome)" + default y + +config OPENVPN_DEVEL_openssl_ENABLE_PORT_SHARE + bool "Enable TCP server port-share support (--port-share)" + default y + +config OPENVPN_DEVEL_openssl_ENABLE_DEF_AUTH + bool "Enable deferred authentication" + default y + +config OPENVPN_DEVEL_openssl_ENABLE_PF + bool "Enable internal packet filter" + default y + +config OPENVPN_DEVEL_openssl_ENABLE_IPROUTE2 + bool "Enable support for iproute2" + default n + +endmenu diff --git a/net/openvpn-devel/Config-polarssl.in b/net/openvpn-devel/Config-polarssl.in new file mode 100644 index 0000000..e66e1aa --- /dev/null +++ b/net/openvpn-devel/Config-polarssl.in @@ -0,0 +1,68 @@ +menu "Configuration" + depends on PACKAGE_openvpn-devel-polarssl + +config OPENVPN_DEVEL_polarssl_ENABLE_LZO + bool "Enable LZO compression support" + default y + +#config OPENVPN_DEVEL_polarssl_ENABLE_CRYPTO +# bool "Enable crypto support" +# default y + +#config OPENVPN_DEVEL_polarssl_ENABLE_SSL +# bool "Enable SSL support for TLS-based key exchange" +# default y + +config OPENVPN_DEVEL_polarssl_ENABLE_X509_ALT_USERNAME + bool "Enable the --x509-username-field feature" + default n + +config OPENVPN_DEVEL_polarssl_ENABLE_SERVER + bool "Enable server support (otherwise only client mode is support)" + default y + +#config OPENVPN_DEVEL_polarssl_ENABLE_EUREPHIA +# bool "Enable support for the eurephia plug-in" +# default n + +config OPENVPN_DEVEL_polarssl_ENABLE_MANAGEMENT + bool "Enable management server support" + default n + +#config OPENVPN_DEVEL_polarssl_ENABLE_PKCS11 +# bool "Enable pkcs11 support" +# default n + +config OPENVPN_DEVEL_polarssl_ENABLE_HTTP + bool "Enable HTTP proxy support" + default y + +config OPENVPN_DEVEL_polarssl_ENABLE_SOCKS + bool "Enable SOCKS proxy support" + default y + +config OPENVPN_DEVEL_polarssl_ENABLE_FRAGMENT + bool "Enable internal fragmentation support (--fragment)" + default y + +config OPENVPN_DEVEL_polarssl_ENABLE_MULTIHOME + bool "Enable multi-homed UDP server support (--multihome)" + default y + +config OPENVPN_DEVEL_polarssl_ENABLE_PORT_SHARE + bool "Enable TCP server port-share support (--port-share)" + default y + +config OPENVPN_DEVEL_polarssl_ENABLE_DEF_AUTH + bool "Enable deferred authentication" + default y + +config OPENVPN_DEVEL_polarssl_ENABLE_PF + bool "Enable internal packet filter" + default y + +config OPENVPN_DEVEL_polarssl_ENABLE_IPROUTE2 + bool "Enable support for iproute2" + default n + +endmenu diff --git a/net/openvpn-devel/Makefile b/net/openvpn-devel/Makefile new file mode 100644 index 0000000..3aa207b --- /dev/null +++ b/net/openvpn-devel/Makefile @@ -0,0 +1,152 @@ +# +# Copyright (C) 2010-2012 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:=openvpn-devel + +PKG_REV:=5d4f5435a421299ed047485d8d99bdf9a0d22fd1 +PKG_VERSION:=r$(PKG_REV) +PKG_RELEASE=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://openvpn.git.sourceforge.net/gitroot/openvpn/openvpn.git +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE:=openvpn-$(PKG_VERSION).tar.gz +PKG_SOURCE_SUBDIR:=openvpn-$(PKG_VERSION) + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/openvpn-$(PKG_VERSION) + +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/openvpn-devel/Default + TITLE:=Open source VPN solution using $(2) + SECTION:=net + CATEGORY:=Network + URL:=http://openvpn.net + SUBMENU:=VPN + MENU:=1 + DEPENDS:=+kmod-tun +OPENVPN_DEVEL_$(1)_ENABLE_LZO:liblzo +OPENVPN_DEVEL_$(1)_ENABLE_IPROUTE2:ip $(3) + VARIANT:=$(1) + MAINTAINER:=Mirko Vogt +endef + +Package/openvpn-devel-openssl=$(call Package/openvpn-devel/Default,openssl,OpenSSL,+libopenssl) +Package/openvpn-devel-polarssl=$(call Package/openvpn-devel/Default,polarssl,PolarSSL,+libpolarssl) +Package/openvpn-devel-nossl=$(call Package/openvpn-devel/Default,nossl,plaintext (no SSL)) + +define Package/openvpn-devel/config/Default + source "$(SOURCE)/Config-$(1).in" +endef + +Package/openvpn-devel-openssl/config=$(call Package/openvpn-devel/config/Default,openssl) +Package/openvpn-devel-polarssl/config=$(call Package/openvpn-devel/config/Default,polarssl) +Package/openvpn-devel-nossl/config=$(call Package/openvpn-devel/config/Default,nossl) + +#define Package/openvpn-devel-easy-rsa +# $(call Package/openvpn-devel-openssl) +# DEPENDS:=+openssl-util +# TITLE:=Simple shell scripts to manage a Certificate Authority +#endef + +#define Package/openvpn-devel-easy-rsa/conffiles +#/etc/easy-rsa/keys/serial +#/etc/easy-rsa/keys/index.txt +#/etc/easy-rsa/vars +#endef + + +ifeq ($(BUILD_VARIANT),polarssl) +CONFIG_OPENVPN_DEVEL_POLARSSL:=y +endif +ifeq ($(BUILD_VARIANT),openssl) +CONFIG_OPENVPN_DEVEL_OPENSSL:=y +endif +ifeq ($(BUILD_VARIANT),nossl) +CONFIG_OPENVPN_DEVEL_NOSSL:=y +endif + +CONFIGURE_VARS += \ + IFCONFIG=/sbin/ifconfig \ + ROUTE=/sbin/route \ + IPROUTE=/usr/sbin/ip \ + NETSTAT=/sbin/netstat + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-small \ + --disable-selinux \ + --disable-systemd \ + --disable-plugins \ + --disable-debug \ + --disable-eurephia \ + --disable-pkcs11 \ + $(if $(CONFIG_OPENVPN_DEVEL_$(BUILD_VARIANT)_ENABLE_LZO),--enable,--disable)-lzo \ + $(if $(CONFIG_OPENVPN_DEVEL_$(BUILD_VARIANT)_ENABLE_CRYPTO),--enable,--disable)-crypto \ + $(if $(CONFIG_OPENVPN_DEVEL_$(BUILD_VARIANT)_ENABLE_X509_ALT_USERNAME),enable,disable-x509-alt-username)-ssl \ + $(if $(CONFIG_OPENVPN_DEVEL_$(BUILD_VARIANT)_ENABLE_SERVER),--enable,--disable)-server \ + $(if $(CONFIG_OPENVPN_DEVEL_$(BUILD_VARIANT)_ENABLE_MANAGEMENT),--enable,--disable)-management \ + $(if $(CONFIG_OPENVPN_DEVEL_$(BUILD_VARIANT)_ENABLE_SOCKS),--enable,--disable)-socks \ + $(if $(CONFIG_OPENVPN_DEVEL_$(BUILD_VARIANT)_ENABLE_HTTP),--enable,--disable)-http \ + $(if $(CONFIG_OPENVPN_DEVEL_$(BUILD_VARIANT)_ENABLE_FRAGMENT),--enable,--disable)-fragment \ + $(if $(CONFIG_OPENVPN_DEVEL_$(BUILD_VARIANT)_ENABLE_MULTIHOME),--enable,--disable)-multihome \ + $(if $(CONFIG_OPENVPN_DEVEL_$(BUILD_VARIANT)_ENABLE_IPROUTE2),--enable,--disable)-iproute2 \ + $(if $(CONFIG_OPENVPN_DEVEL_$(BUILD_VARIANT)_ENABLE_DEF_AUTH),--enable,--disable)-def-auth \ + $(if $(CONFIG_OPENVPN_DEVEL_$(BUILD_VARIANT)_ENABLE_PF),--enable,--disable)-pf \ + $(if $(CONFIG_OPENVPN_DEVEL_NOSSL),--disable-ssl --disable-crypto,--enable-ssl --enable-crypto) \ + $(if $(CONFIG_OPENVPN_DEVEL_OPENSSL),--with-crypto-library=openssl) \ + $(if $(CONFIG_OPENVPN_DEVEL_POLARSSL),--with-crypto-library=polarssl) \ + ) +endef + +define Package/openvpn-devel-$(BUILD_VARIANT)/conffiles +/etc/config/openvpn +endef + +define Package/openvpn-devel-$(BUILD_VARIANT)/install + $(INSTALL_DIR) \ + $(1)/usr/sbin \ + $(1)/etc/init.d \ + $(1)/etc/config \ + $(1)/etc/openvpn \ + $(1)/lib/upgrade/keep.d + + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/sbin/openvpn \ + $(1)/usr/sbin/ + + $(INSTALL_BIN) \ + files/openvpn.init \ + $(1)/etc/init.d/openvpn + + $(INSTALL_CONF) files/openvpn.config \ + $(1)/etc/config/openvpn + + $(INSTALL_DATA) \ + files/openvpn.upgrade \ + $(1)/lib/upgrade/keep.d/openvpn +endef + +#define Package/openvpn-devel-easy-rsa/install +# $(INSTALL_DIR) $(1)/usr/sbin +# $(CP) $(PKG_BUILD_DIR)/easy-rsa/2.0/{build-*,clean-all,inherit-inter,list-crl,pkitool,revoke-full,sign-req,whichopensslcnf} $(1)/usr/sbin/ +# $(INSTALL_DIR) $(1)/etc/easy-rsa +# $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/openssl-1.0.0.cnf $(1)/etc/easy-rsa/openssl-1.0.0.cnf +# $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/vars $(1)/etc/easy-rsa/vars +# $(INSTALL_DIR) $(1)/etc/easy-rsa/keys +# $(INSTALL_DATA) files/easy-rsa.index $(1)/etc/easy-rsa/keys/index.txt +# $(INSTALL_DATA) files/easy-rsa.serial $(1)/etc/easy-rsa/keys/serial +#endef + +$(eval $(call BuildPackage,openvpn-devel-openssl)) +$(eval $(call BuildPackage,openvpn-devel-polarssl)) +$(eval $(call BuildPackage,openvpn-devel-nossl)) +#$(eval $(call BuildPackage,openvpn-devel-easy-rsa)) diff --git a/net/openvpn-devel/files b/net/openvpn-devel/files new file mode 120000 index 0000000..aba90e9 --- /dev/null +++ b/net/openvpn-devel/files @@ -0,0 +1 @@ +../openvpn/files \ No newline at end of file diff --git a/net/openvpn/Config.in b/net/openvpn/Config.in new file mode 100644 index 0000000..82a85c5 --- /dev/null +++ b/net/openvpn/Config.in @@ -0,0 +1,79 @@ +menu "Configuration" + depends on PACKAGE_openvpn + +config OPENVPN_DISABLE_LZO + bool "Disable LZO compression support" + depends on PACKAGE_openvpn + default n + +config OPENVPN_DISABLE_CRYPTO + bool "Disable OpenSSL crypto support" + depends on PACKAGE_openvpn + default n + +config OPENVPN_DISABLE_SSL + bool "Disable OpenSSL SSL support for TLS-based key exchange" + depends on PACKAGE_openvpn + default n + +config OPENVPN_X509_ALT_USERNAME + bool "Enable the --x509-username-field feature" + depends on PACKAGE_openvpn + default n + +config OPENVPN_DISABLE_MULTI + bool "Disable client/server support (--mode server + client mode)" + depends on PACKAGE_openvpn + default n + +config OPENVPN_DISABLE_SERVER + bool "Disable server support only (but retain client support)" + depends on PACKAGE_openvpn + default n + +config OPENVPN_DISABLE_EUREPHIA + bool "Disable support for the eurephia plug-in" + depends on PACKAGE_openvpn + default y + +config OPENVPN_DISABLE_MANAGEMENT + bool "Disable management server support" + depends on PACKAGE_openvpn + default y + +config OPENVPN_DISABLE_PKCS11 + bool "Disable pkcs11 support" + depends on PACKAGE_openvpn + default n + +config OPENVPN_DISABLE_HTTP + bool "Disable HTTP proxy support" + depends on PACKAGE_openvpn + default n + +config OPENVPN_DISABLE_FRAGMENT + bool "Disable internal fragmentation support (--fragment)" + depends on PACKAGE_openvpn + default n + +config OPENVPN_DISABLE_MULTIHOME + bool "Disable multi-homed UDP server support (--multihome)" + depends on PACKAGE_openvpn + default n + +config OPENVPN_DISABLE_PORT_SHARE + bool "Disable TCP server port-share support (--port-share)" + depends on PACKAGE_openvpn + default n + +config OPENVPN_DISABLE_DEF_AUTH + bool "Disable deferred authentication" + depends on PACKAGE_openvpn + default n + +config OPENVPN_DISABLE_PF + bool "Disable internal packet filter" + depends on PACKAGE_openvpn + default n + +endmenu diff --git a/net/openvpn/Makefile b/net/openvpn/Makefile new file mode 100644 index 0000000..31e0b1e --- /dev/null +++ b/net/openvpn/Makefile @@ -0,0 +1,169 @@ +# +# Copyright (C) 2006-2012 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:=openvpn +PKG_VERSION:=2.2.2 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://swupdate.openvpn.net/community/releases @SF/openvpn +PKG_MD5SUM:=c5181e27b7945fa6276d21873329c5c7 + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/openvpn + SECTION:=net + CATEGORY:=Network + SUBMENU:=VPN + DEPENDS:=+kmod-tun +libopenssl +!OPENVPN_DISABLE_LZO:liblzo + TITLE:=Open source VPN solution using SSL + URL:=http://openvpn.net + MENU:=1 +endef + +define Package/openvpn/description + Open source VPN solution using SSL +endef + +define Package/openvpn/config + source "$(SOURCE)/Config.in" +endef + + +define Package/openvpn-easy-rsa + $(call Package/openvpn) + DEPENDS:=+openssl-util + TITLE:=Simple shell scripts to manage a Certificate Authority +endef + +define Package/openvpn-easy-rsa/conffiles +/etc/easy-rsa/keys/serial +/etc/easy-rsa/keys/index.txt +/etc/easy-rsa/vars +endef + +CONFIGURE_ARGS+= \ + --with-ifconfig-path=/sbin/ifconfig \ + --with-iproute-path=/usr/sbin/ip \ + --with-route-path=/sbin/route \ + --enable-password-save \ + --disable-debug \ + --disable-plugins \ + --disable-pthread \ + --disable-selinux \ + --disable-socks \ + --enable-small + +ifeq ($(CONFIG_OPENVPN_DISABLE_LZO),y) +CONFIGURE_ARGS += \ + --disable-lzo +endif + +ifeq ($(CONFIG_OPENVPN_DISABLE_CRYPTO),y) +CONFIGURE_ARGS += \ + --disable-crypto +endif + +ifeq ($(CONFIG_OPENVPN_DISABLE_SSL),y) +CONFIGURE_ARGS += \ + --disable-ssl +endif + +ifeq ($(CONFIG_OPENVPN_X509_ALT_USERNAME),y) +CONFIGURE_ARGS += \ + --enable-x509-alt-username +endif + +ifeq ($(CONFIG_OPENVPN_DISABLE_MULTI),y) +CONFIGURE_ARGS += \ + --disable-multi +endif + +ifeq ($(CONFIG_OPENVPN_DISABLE_SERVER),y) +CONFIGURE_ARGS += \ + --disable-server +endif + +ifeq ($(CONFIG_OPENVPN_DISABLE_EUREPHIA),y) +CONFIGURE_ARGS += \ + --disable-eurephia +endif + +ifeq ($(CONFIG_OPENVPN_DISABLE_MANAGEMENT),y) +CONFIGURE_ARGS += \ + --disable-management +endif + +ifeq ($(CONFIG_OPENVPN_DISABLE_PKCS11),y) +CONFIGURE_ARGS += \ + --disable-pkcs11 +endif + +ifeq ($(CONFIG_OPENVPN_DISABLE_HTTP),y) +CONFIGURE_ARGS += \ + --disable-http +endif + +ifeq ($(CONFIG_OPENVPN_DISABLE_FRAGMENT),y) +CONFIGURE_ARGS += \ + --disable-fragment +endif + +ifeq ($(CONFIG_OPENVPN_DISABLE_MULTIHOME),y) +CONFIGURE_ARGS += \ + --disable-multihome +endif + +ifeq ($(CONFIG_OPENVPN_DISABLE_PORT_SHARE),y) +CONFIGURE_ARGS += \ + --disable-port-share +endif + +ifeq ($(CONFIG_OPENVPN_DISABLE_DEF_AUTH),y) +CONFIGURE_ARGS += \ + --disable-def-auth +endif + +ifeq ($(CONFIG_OPENVPN_DISABLE_PF),y) +CONFIGURE_ARGS += \ + --disable-pf +endif + +define Package/openvpn/conffiles +/etc/config/openvpn +endef + +define Package/openvpn/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/openvpn $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/openvpn + $(INSTALL_DIR) $(1)/lib/upgrade/keep.d + $(INSTALL_DATA) files/openvpn.upgrade $(1)/lib/upgrade/keep.d/openvpn +endef + +define Package/openvpn-easy-rsa/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/easy-rsa/2.0/{build-*,clean-all,inherit-inter,list-crl,pkitool,revoke-full,sign-req,whichopensslcnf} $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/easy-rsa + $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/openssl-1.0.0.cnf $(1)/etc/easy-rsa/openssl-1.0.0.cnf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/vars $(1)/etc/easy-rsa/vars + $(INSTALL_DIR) $(1)/etc/easy-rsa/keys + $(INSTALL_DATA) files/easy-rsa.index $(1)/etc/easy-rsa/keys/index.txt + $(INSTALL_DATA) files/easy-rsa.serial $(1)/etc/easy-rsa/keys/serial +endef + +$(eval $(call BuildPackage,openvpn)) +$(eval $(call BuildPackage,openvpn-easy-rsa)) diff --git a/net/openvpn/files/easy-rsa.index b/net/openvpn/files/easy-rsa.index new file mode 100644 index 0000000..e69de29 diff --git a/net/openvpn/files/easy-rsa.serial b/net/openvpn/files/easy-rsa.serial new file mode 100644 index 0000000..8a0f05e --- /dev/null +++ b/net/openvpn/files/easy-rsa.serial @@ -0,0 +1 @@ +01 diff --git a/net/openvpn/files/openvpn.config b/net/openvpn/files/openvpn.config new file mode 100644 index 0000000..4a1f667 --- /dev/null +++ b/net/openvpn/files/openvpn.config @@ -0,0 +1,398 @@ +package openvpn + +################################################# +# Sample to include a custom config file. # +################################################# + +config openvpn custom_config + + # Set to 1 to enable this instance: + option enabled 0 + + # Include OpenVPN configuration + option config /etc/openvpn/my-vpn.conf + + +################################################# +# Sample OpenVPN 2.0 uci config for # +# multi-client server. # +################################################# + +config openvpn sample_server + + # Set to 1 to enable this instance: + option enabled 0 + + # Which local IP address should OpenVPN + # listen on? (optional) +# option local 0.0.0.0 + + # Which TCP/UDP port should OpenVPN listen on? + # If you want to run multiple OpenVPN instances + # on the same machine, use a different port + # number for each one. You will need to + # open up this port on your firewall. + option port 1194 + + # TCP or UDP server? +# option proto tcp + option proto udp + + # "dev tun" will create a routed IP tunnel, + # "dev tap" will create an ethernet tunnel. + # Use "dev tap0" if you are ethernet bridging + # and have precreated a tap0 virtual interface + # and bridged it with your ethernet interface. + # If you want to control access policies + # over the VPN, you must create firewall + # rules for the the TUN/TAP interface. + # On non-Windows systems, you can give + # an explicit unit number, such as tun0. + # On Windows, use "dev-node" for this. + # On most systems, the VPN will not function + # unless you partially or fully disable + # the firewall for the TUN/TAP interface. +# option dev tap + option dev tun + + # SSL/TLS root certificate (ca), certificate + # (cert), and private key (key). Each client + # and the server must have their own cert and + # key file. The server and all clients will + # use the same ca file. + # + # See the "easy-rsa" directory for a series + # of scripts for generating RSA certificates + # and private keys. Remember to use + # a unique Common Name for the server + # and each of the client certificates. + # + # Any X509 key management system can be used. + # OpenVPN can also use a PKCS #12 formatted key file + # (see "pkcs12" directive in man page). + option ca /etc/openvpn/ca.crt + option cert /etc/openvpn/server.crt + # This file should be kept secret: + option key /etc/openvpn/server.key + + # Diffie hellman parameters. + # Generate your own with: + # openssl dhparam -out dh1024.pem 1024 + # Substitute 2048 for 1024 if you are using + # 2048 bit keys. + option dh /etc/openvpn/dh1024.pem + + # Configure server mode and supply a VPN subnet + # for OpenVPN to draw client addresses from. + # The server will take 10.8.0.1 for itself, + # the rest will be made available to clients. + # Each client will be able to reach the server + # on 10.8.0.1. Comment this line out if you are + # ethernet bridging. See the man page for more info. + option server "10.8.0.0 255.255.255.0" + + # Maintain a record of client <-> virtual IP address + # associations in this file. If OpenVPN goes down or + # is restarted, reconnecting clients can be assigned + # the same virtual IP address from the pool that was + # previously assigned. + option ifconfig_pool_persist /tmp/ipp.txt + + # Configure server mode for ethernet bridging. + # You must first use your OS's bridging capability + # to bridge the TAP interface with the ethernet + # NIC interface. Then you must manually set the + # IP/netmask on the bridge interface, here we + # assume 10.8.0.4/255.255.255.0. Finally we + # must set aside an IP range in this subnet + # (start=10.8.0.50 end=10.8.0.100) to allocate + # to connecting clients. Leave this line commented + # out unless you are ethernet bridging. +# option server_bridge "10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100" + + # Push routes to the client to allow it + # to reach other private subnets behind + # the server. Remember that these + # private subnets will also need + # to know to route the OpenVPN client + # address pool (10.8.0.0/255.255.255.0) + # back to the OpenVPN server. +# list push "route 192.168.10.0 255.255.255.0" +# list push "route 192.168.20.0 255.255.255.0" + + # To assign specific IP addresses to specific + # clients or if a connecting client has a private + # subnet behind it that should also have VPN access, + # use the subdirectory "ccd" for client-specific + # configuration files (see man page for more info). + + # EXAMPLE: Suppose the client + # having the certificate common name "Thelonious" + # also has a small subnet behind his connecting + # machine, such as 192.168.40.128/255.255.255.248. + # First, uncomment out these lines: +# option client_config_dir /etc/openvpn/ccd +# list route "192.168.40.128 255.255.255.248" + # Then create a file ccd/Thelonious with this line: + # iroute 192.168.40.128 255.255.255.248 + # This will allow Thelonious' private subnet to + # access the VPN. This example will only work + # if you are routing, not bridging, i.e. you are + # using "dev tun" and "server" directives. + + # EXAMPLE: Suppose you want to give + # Thelonious a fixed VPN IP address of 10.9.0.1. + # First uncomment out these lines: +# option client_config_dir /etc/openvpn/ccd +# list route "10.9.0.0 255.255.255.252" +# list route "192.168.100.0 255.255.255.0" + # Then add this line to ccd/Thelonious: + # ifconfig-push "10.9.0.1 10.9.0.2" + + # Suppose that you want to enable different + # firewall access policies for different groups + # of clients. There are two methods: + # (1) Run multiple OpenVPN daemons, one for each + # group, and firewall the TUN/TAP interface + # for each group/daemon appropriately. + # (2) (Advanced) Create a script to dynamically + # modify the firewall in response to access + # from different clients. See man + # page for more info on learn-address script. +# option learn_address /etc/openvpn/script + + # If enabled, this directive will configure + # all clients to redirect their default + # network gateway through the VPN, causing + # all IP traffic such as web browsing and + # and DNS lookups to go through the VPN + # (The OpenVPN server machine may need to NAT + # the TUN/TAP interface to the internet in + # order for this to work properly). + # CAVEAT: May break client's network config if + # client's local DHCP server packets get routed + # through the tunnel. Solution: make sure + # client's local DHCP server is reachable via + # a more specific route than the default route + # of 0.0.0.0/0.0.0.0. +# list push "redirect-gateway" + + # Certain Windows-specific network settings + # can be pushed to clients, such as DNS + # or WINS server addresses. CAVEAT: + # http://openvpn.net/faq.html#dhcpcaveats +# list push "dhcp-option DNS 10.8.0.1" +# list push "dhcp-option WINS 10.8.0.1" + + # Uncomment this directive to allow different + # clients to be able to "see" each other. + # By default, clients will only see the server. + # To force clients to only see the server, you + # will also need to appropriately firewall the + # server's TUN/TAP interface. +# option client_to_client 1 + + # Uncomment this directive if multiple clients + # might connect with the same certificate/key + # files or common names. This is recommended + # only for testing purposes. For production use, + # each client should have its own certificate/key + # pair. + # + # IF YOU HAVE NOT GENERATED INDIVIDUAL + # CERTIFICATE/KEY PAIRS FOR EACH CLIENT, + # EACH HAVING ITS OWN UNIQUE "COMMON NAME", + # UNCOMMENT THIS LINE OUT. +# option duplicate_cn 1 + + # The keepalive directive causes ping-like + # messages to be sent back and forth over + # the link so that each side knows when + # the other side has gone down. + # Ping every 10 seconds, assume that remote + # peer is down if no ping received during + # a 120 second time period. + option keepalive "10 120" + + # For extra security beyond that provided + # by SSL/TLS, create an "HMAC firewall" + # to help block DoS attacks and UDP port flooding. + # + # Generate with: + # openvpn --genkey --secret ta.key + # + # The server and each client must have + # a copy of this key. + # The second parameter should be '0' + # on the server and '1' on the clients. + # This file is secret: +# option tls_auth "/etc/openvpn/ta.key 0" + + # Select a cryptographic cipher. + # This config item must be copied to + # the client config file as well. + # Blowfish (default): +# option cipher BF-CBC + # AES: +# option cipher AES-128-CBC + # Triple-DES: +# option cipher DES-EDE3-CBC + + # Enable compression on the VPN link. + # If you enable it here, you must also + # enable it in the client config file. + option comp_lzo 1 + + # The maximum number of concurrently connected + # clients we want to allow. +# option max_clients 100 + + # The persist options will try to avoid + # accessing certain resources on restart + # that may no longer be accessible because + # of the privilege downgrade. + option persist_key 1 + option persist_tun 1 + + # Output a short status file showing + # current connections, truncated + # and rewritten every minute. + option status /tmp/openvpn-status.log + + # By default, log messages will go to the syslog (or + # on Windows, if running as a service, they will go to + # the "\Program Files\OpenVPN\log" directory). + # Use log or log-append to override this default. + # "log" will truncate the log file on OpenVPN startup, + # while "log-append" will append to it. Use one + # or the other (but not both). +# option log /tmp/openvpn.log +# option log_append /tmp/openvpn.log + + # Set the appropriate level of log + # file verbosity. + # + # 0 is silent, except for fatal errors + # 4 is reasonable for general usage + # 5 and 6 can help to debug connection problems + # 9 is extremely verbose + option verb 3 + + # Silence repeating messages. At most 20 + # sequential messages of the same message + # category will be output to the log. +# option mute 20 + + +############################################## +# Sample client-side OpenVPN 2.0 uci config # +# for connecting to multi-client server. # +############################################## + +config openvpn sample_client + + # Set to 1 to enable this instance: + option enabled 0 + + # Specify that we are a client and that we + # will be pulling certain config file directives + # from the server. + option client 1 + + # Use the same setting as you are using on + # the server. + # On most systems, the VPN will not function + # unless you partially or fully disable + # the firewall for the TUN/TAP interface. +# option dev tap + option dev tun + + # Are we connecting to a TCP or + # UDP server? Use the same setting as + # on the server. +# option proto tcp + option proto udp + + # The hostname/IP and port of the server. + # You can have multiple remote entries + # to load balance between the servers. + list remote "my_server_1 1194" +# list remote "my_server_2 1194" + + # Choose a random host from the remote + # list for load_balancing. Otherwise + # try hosts in the order specified. +# option remote_random 1 + + # Keep trying indefinitely to resolve the + # host name of the OpenVPN server. Very useful + # on machines which are not permanently connected + # to the internet such as laptops. + option resolv_retry infinite + + # Most clients don't need to bind to + # a specific local port number. + option nobind 1 + + # Try to preserve some state across restarts. + option persist_key 1 + option persist_tun 1 + + # If you are connecting through an + # HTTP proxy to reach the actual OpenVPN + # server, put the proxy server/IP and + # port number here. See the man page + # if your proxy server requires + # authentication. + # retry on connection failures: +# option http_proxy_retry 1 + # specify http proxy address and port: +# option http_proxy "192.168.1.100 8080" + + # Wireless networks often produce a lot + # of duplicate packets. Set this flag + # to silence duplicate packet warnings. +# option mute_replay_warnings 1 + + # SSL/TLS parms. + # See the server config file for more + # description. It's best to use + # a separate .crt/.key file pair + # for each client. A single ca + # file can be used for all clients. + option ca /etc/openvpn/ca.crt + option cert /etc/openvpn/client.crt + option key /etc/openvpn/client.key + + # Verify server certificate by checking + # that the certicate has the nsCertType + # field set to "server". This is an + # important precaution to protect against + # a potential attack discussed here: + # http://openvpn.net/howto.html#mitm + # + # To use this feature, you will need to generate + # your server certificates with the nsCertType + # field set to "server". The build_key_server + # script in the easy_rsa folder will do this. +# option ns_cert_type server + + # If a tls_auth key is used on the server + # then every client must also have the key. +# option tls_auth "/etc/openvpn/ta.key 1" + + # Select a cryptographic cipher. + # If the cipher option is used on the server + # then you must also specify it here. +# option cipher x + + # Enable compression on the VPN link. + # Don't enable this unless it is also + # enabled in the server config file. + option comp_lzo 1 + + # Set log file verbosity. + option verb 3 + + # Silence repeating messages +# option mute 20 diff --git a/net/openvpn/files/openvpn.init b/net/openvpn/files/openvpn.init new file mode 100644 index 0000000..c58f005 --- /dev/null +++ b/net/openvpn/files/openvpn.init @@ -0,0 +1,154 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2011 OpenWrt.org +# Copyright (C) 2008 Jo-Philipp Wich +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +START=95 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +EXTRA_COMMANDS="up down" + +LIST_SEP=" +" + +append_param() { + local v="$1" + case "$v" in + *_*_*_*) v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_} ;; + *_*_*) v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_} ;; + *_*) v=${v%%_*}-${v#*_} ;; + esac + ARGS="$ARGS --$v" + return 0 +} + +append_bools() { + local p; local v; local s="$1"; shift + for p in $*; do + config_get_bool v "$s" "$p" + [ "$v" == 1 ] && append_param "$p" + done +} + +append_params() { + local p; local v; local s="$1"; shift + for p in $*; do + config_get v "$s" "$p" + IFS="$LIST_SEP" + for v in $v; do + [ -n "$v" ] && append_param "$p" && ARGS="$ARGS $v" + done + unset IFS + done +} + +section_enabled() { + config_get_bool enable "$1" 'enable' 0 + config_get_bool enabled "$1" 'enabled' 0 + [ $enable -gt 0 ] || [ $enabled -gt 0 ] +} + +start_instance() { + local s="$1" + + section_enabled "$s" || return 1 + + ARGS="" + + # append flags + append_bools "$s" \ + auth_nocache auth_retry auth_user_pass_optional bind ccd_exclusive client client_cert_not_required \ + client_to_client comp_lzo comp_noadapt disable \ + disable_occ down_pre duplicate_cn fast_io float http_proxy_retry \ + ifconfig_noexec ifconfig_nowarn ifconfig_pool_linear management_forget_disconnect management_hold \ + management_query_passwords management_signal mktun mlock mtu_test multihome mute_replay_warnings \ + nobind no_iv no_name_remapping no_replay opt_verify passtos persist_key persist_local_ip \ + persist_remote_ip persist_tun ping_timer_rem pull push_reset \ + remote_random rmtun route_noexec route_nopull single_session socks_proxy_retry \ + suppress_timestamps tcp_nodelay test_crypto tls_client tls_exit tls_server \ + tun_ipv6 up_delay up_restart username_as_common_name + + # append params + append_params "$s" \ + cd askpass auth auth_user_pass auth_user_pass_verify bcast_buffers ca cert \ + chroot cipher client_config_dir client_connect client_disconnect config connect_freq \ + connect_retry connect_timeout connect_retry_max crl_verify dev dev_node dev_type dh \ + echo engine explicit_exit_notify fragment group hand_window hash_size \ + http_proxy http_proxy_option http_proxy_timeout ifconfig ifconfig_pool \ + ifconfig_pool_persist ifconfig_push inactive ipchange iroute keepalive \ + key key_method keysize learn_address link_mtu lladdr local log log_append \ + lport management management_log_cache max_clients \ + max_routes_per_client mode mssfix mtu_disc mute nice ns_cert_type ping \ + ping_exit ping_restart pkcs12 plugin port port_share prng proto rcvbuf \ + redirect_gateway remap_usr1 remote remote_cert_eku remote_cert_ku remote_cert_tls \ + reneg_bytes reneg_pkts reneg_sec \ + replay_persist replay_window resolv_retry route route_delay route_gateway \ + route_metric route_up rport script_security secret server server_bridge setenv shaper sndbuf \ + socks_proxy status status_version syslog tcp_queue_limit tls_auth \ + tls_cipher tls_remote tls_timeout tls_verify tmp_dir topology tran_window \ + tun_mtu tun_mtu_extra txqueuelen user verb down push up + + + SERVICE_PID_FILE="/var/run/openvpn-$s.pid" + service_start /usr/sbin/openvpn --syslog "openvpn($s)" --writepid "$SERVICE_PID_FILE" $ARGS +} + +stop_instance() { + local s="$1" + + section_enabled "$s" || return 1 + + SERVICE_PID_FILE="/var/run/openvpn-$s.pid" + service_stop /usr/sbin/openvpn +} + +reload_instance() { + local s="$1" + + section_enabled "$s" || return 1 + + SERVICE_PID_FILE="/var/run/openvpn-$s.pid" + service_reload /usr/sbin/openvpn +} + +start() { + config_load 'openvpn' + config_foreach start_instance 'openvpn' +} + +stop() { + config_load 'openvpn' + config_foreach stop_instance 'openvpn' +} + +reload() { + config_load 'openvpn' + config_foreach reload_instance 'openvpn' +} + +up() { + local exists + local instance + config_load 'openvpn' + for instance in "$@"; do + config_get exists "$instance" 'TYPE' + if [ "$exists" == "openvpn" ]; then + start_instance "$instance" + fi + done +} + +down() { + local exists + local instance + config_load 'openvpn' + for instance in "$@"; do + config_get exists "$instance" 'TYPE' + if [ "$exists" == "openvpn" ]; then + stop_instance "$instance" + fi + done +} diff --git a/net/openvpn/files/openvpn.upgrade b/net/openvpn/files/openvpn.upgrade new file mode 100644 index 0000000..6ae49d2 --- /dev/null +++ b/net/openvpn/files/openvpn.upgrade @@ -0,0 +1 @@ +/etc/openvpn/ diff --git a/net/openvpn/patches/001-easy_rsa.patch b/net/openvpn/patches/001-easy_rsa.patch new file mode 100644 index 0000000..6b1d0b7 --- /dev/null +++ b/net/openvpn/patches/001-easy_rsa.patch @@ -0,0 +1,152 @@ +--- a/easy-rsa/2.0/build-ca ++++ b/easy-rsa/2.0/build-ca +@@ -5,4 +5,4 @@ + # + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --initca $* ++"/usr/sbin/pkitool" --interact --initca $* +--- a/easy-rsa/2.0/build-dh ++++ b/easy-rsa/2.0/build-dh +@@ -1,5 +1,7 @@ + #!/bin/sh + ++. /etc/easy-rsa/vars ++ + # Build Diffie-Hellman parameters for the server side + # of an SSL/TLS connection. + +--- a/easy-rsa/2.0/build-inter ++++ b/easy-rsa/2.0/build-inter +@@ -4,4 +4,4 @@ + # root certificate. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --inter $* ++"/usr/sbin/pkitool" --interact --inter $* +--- a/easy-rsa/2.0/build-key ++++ b/easy-rsa/2.0/build-key +@@ -4,4 +4,4 @@ + # root certificate. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact $* ++"/usr/sbin/pkitool" --interact $* +--- a/easy-rsa/2.0/build-key-pass ++++ b/easy-rsa/2.0/build-key-pass +@@ -4,4 +4,4 @@ + # with a password. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --pass $* ++"/usr/sbin/pkitool" --interact --pass $* +--- a/easy-rsa/2.0/build-key-pkcs12 ++++ b/easy-rsa/2.0/build-key-pkcs12 +@@ -5,4 +5,4 @@ + # the CA certificate as well. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --pkcs12 $* ++"/usr/sbin/pkitool" --interact --pkcs12 $* +--- a/easy-rsa/2.0/build-key-server ++++ b/easy-rsa/2.0/build-key-server +@@ -7,4 +7,4 @@ + # extension in the openssl.cnf file. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --server $* ++"/usr/sbin/pkitool" --interact --server $* +--- a/easy-rsa/2.0/build-req ++++ b/easy-rsa/2.0/build-req +@@ -4,4 +4,4 @@ + # when your root certificate and key is not available locally. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --csr $* ++"/usr/sbin/pkitool" --interact --csr $* +--- a/easy-rsa/2.0/build-req-pass ++++ b/easy-rsa/2.0/build-req-pass +@@ -4,4 +4,4 @@ + # with a password. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --csr --pass $* ++"/usr/sbin/pkitool" --interact --csr --pass $* +--- a/easy-rsa/2.0/clean-all ++++ b/easy-rsa/2.0/clean-all +@@ -1,5 +1,7 @@ + #!/bin/sh + ++. /etc/easy-rsa/vars ++ + # Initialize the $KEY_DIR directory. + # Note that this script does a + # rm -rf on $KEY_DIR so be careful! +--- a/easy-rsa/2.0/inherit-inter ++++ b/easy-rsa/2.0/inherit-inter +@@ -1,5 +1,7 @@ + #!/bin/sh + ++. /etc/easy-rsa/vars ++ + # Build a new PKI which is rooted on an intermediate certificate generated + # by ./build-inter or ./pkitool --inter from a parent PKI. The new PKI should + # have independent vars settings, and must use a different KEY_DIR directory +--- a/easy-rsa/2.0/list-crl ++++ b/easy-rsa/2.0/list-crl +@@ -1,5 +1,7 @@ + #!/bin/sh + ++. /etc/easy-rsa/vars ++ + # list revoked certificates + + CRL="${1:-crl.pem}" +--- a/easy-rsa/2.0/pkitool ++++ b/easy-rsa/2.0/pkitool +@@ -1,5 +1,7 @@ + #!/bin/sh + ++. /etc/easy-rsa/vars ++ + # OpenVPN -- An application to securely tunnel IP networks + # over a single TCP/UDP port, with support for SSL/TLS-based + # session authentication and key exchange, +--- a/easy-rsa/2.0/revoke-full ++++ b/easy-rsa/2.0/revoke-full +@@ -1,5 +1,7 @@ + #!/bin/sh + ++. /etc/easy-rsa/vars ++ + # revoke a certificate, regenerate CRL, + # and verify revocation + +--- a/easy-rsa/2.0/sign-req ++++ b/easy-rsa/2.0/sign-req +@@ -4,4 +4,4 @@ + # with a local root certificate and key. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --sign $* ++"/usr/sbin/pkitool" --interact --sign $* +--- a/easy-rsa/2.0/vars ++++ b/easy-rsa/2.0/vars +@@ -12,7 +12,7 @@ + # This variable should point to + # the top level of the easy-rsa + # tree. +-export EASY_RSA="`pwd`" ++export EASY_RSA="/etc/easy-rsa" + + # + # This variable should point to +@@ -26,7 +26,7 @@ export GREP="grep" + # This variable should point to + # the openssl.cnf file included + # with easy-rsa. +-export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA` ++export KEY_CONFIG=`/usr/sbin/whichopensslcnf $EASY_RSA` + + # Edit this variable to point to + # your soon-to-be-created key diff --git a/net/p910nd/Makefile b/net/p910nd/Makefile new file mode 100644 index 0000000..7b0b957 --- /dev/null +++ b/net/p910nd/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2009-2011 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:=p910nd +PKG_VERSION:=0.95 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/p910nd +PKG_MD5SUM:=c7ac6afdf7730ac8387a8e87198d4491 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/p910nd + SECTION:=net + CATEGORY:=Network + TITLE:=A small non-spooling printer server + URL:=http://p910nd.sourceforge.net +endef + +define Package/p910nd/conffiles +/etc/config/p910nd +endef + +define Package/p910nd/description + p910nd is a small daemon that copies any data received on + the port it is listening on to the corresponding printer + port. It is primarily intended for diskless Linux hosts + running as printer drivers but there is no reason why it + could not be used on diskful hosts. Port 9100 is copied + to /dev/lp0, 9101 to /dev/lp1 and 9102 to /dev/lp2. The + default is port 9100 to /dev/lp0. +endef + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) -DLOCKFILE_DIR=\"\\\"/tmp\"\\\"" + +define Package/p910nd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/p910nd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/p910nd.config $(1)/etc/config/p910nd + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/p910nd.init $(1)/etc/init.d/p910nd +endef + +$(eval $(call BuildPackage,p910nd)) diff --git a/net/p910nd/files/p910nd.config b/net/p910nd/files/p910nd.config new file mode 100644 index 0000000..57a3058 --- /dev/null +++ b/net/p910nd/files/p910nd.config @@ -0,0 +1,5 @@ +config p910nd + option device /dev/lp0 + option port 0 + option bidirectional 1 + option enabled 0 diff --git a/net/p910nd/files/p910nd.init b/net/p910nd/files/p910nd.init new file mode 100644 index 0000000..1850c66 --- /dev/null +++ b/net/p910nd/files/p910nd.init @@ -0,0 +1,50 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007 OpenWrt.org +START=50 + +append_bool() { + local section="$1" + local option="$2" + local value="$3" + local _val + config_get_bool _val "$section" "$option" '0' + [ "$_val" -gt 0 ] && append args "$3" +} + +append_string() { + local section="$1" + local option="$2" + local value="$3" + local _val + config_get _val "$section" "$option" + [ -n "$_val" ] && append args "$3$_val" +} + +start_service() { + local section="$1" + args="" + + append_bool "$section" bidirectional "-b" + append_string "$section" device "-f " + append_string "$section" port "" + config_get_bool "enabled" "$section" "enabled" '1' + [ "$enabled" -gt 0 ] && /usr/sbin/p910nd $args +} + +stop_service() { + local section="$1" + config_get port "$section" port + + PID_F=/var/run/p910${port}d.pid + [ -f $PID_F ] && kill $(cat $PID_F) +} + +start() { + config_load "p910nd" + config_foreach start_service p910nd +} + +stop() { + config_load "p910nd" + config_foreach stop_service p910nd +} diff --git a/net/paris-traceroute/Makefile b/net/paris-traceroute/Makefile new file mode 100644 index 0000000..01d90ad --- /dev/null +++ b/net/paris-traceroute/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2011 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:=paris-traceroute +PKG_VERSION:=0.92 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-dev.tar.gz +PKG_SOURCE_URL:=http://www.paris-traceroute.net/downloads +PKG_MD5SUM:=18643a62fdcabd038cdeb14b5cbedb8b + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-current +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/paris-traceroute + SECTION:=net + CATEGORY:=Network + TITLE:=Paris Traceroute + URL:=http://www.paris-traceroute.net/ + DEPENDS:=+libpthread $(CXX_DEPENDS) +endef + +define Package/paris-traceroute/description + Paris traceroute is a new version of the well-known network diagnosis and + measurement tool. It addresses problems caused by load balancers with the + initial implementation of traceroute. +endef + +TARGET_LDFLAGS += -lm + +define Package/paris-traceroute/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/paris-traceroute \ + $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,paris-traceroute)) diff --git a/net/parprouted/Makefile b/net/parprouted/Makefile new file mode 100644 index 0000000..6ada5db --- /dev/null +++ b/net/parprouted/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2006-2012 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:=parprouted +PKG_VERSION:=0.64 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.hazard.maks.net/parprouted/ +PKG_MD5SUM:=14133c9cb8dd9c9a90ff37648ae7b31a + +include $(INCLUDE_DIR)/package.mk + +define Package/parprouted + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + DEPENDS:=+libpthread + TITLE:=Proxy ARP daemon + URL:=http://www.hazard.maks.net/parprouted/ +endef + +define Package/parprouted/description + parprouted is a daemon for transparent IP (Layer 3) proxy ARP bridging. + This is useful for creation of transparent firewalls and bridging networks + with different MAC protocols. Also, unlike standard bridging, proxy ARP + bridging allows to bridge Ethernet networks behind wireless nodes without + using WDS or layer 2 bridging. + +endef + +define Build/Compile + $(call Build/Compile/Default, \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="" \ + all \ + ) +endef + +define Package/parprouted/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/parprouted $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_BIN) ./files/parprouted.config $(1)/etc/config/parprouted + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/parprouted.init $(1)/etc/init.d/parprouted +endef + +define Package/parprouted/conffiles +/etc/config/parprouted +endef + +$(eval $(call BuildPackage,parprouted)) diff --git a/net/parprouted/files/parprouted.config b/net/parprouted/files/parprouted.config new file mode 100755 index 0000000..cf726ce --- /dev/null +++ b/net/parprouted/files/parprouted.config @@ -0,0 +1,11 @@ +package 'parprouted' + +config 'parprouted' + option enabled 0 + + # make all ARP entries to be permanent + option permanent 0 + + # list interfaces to do bridging on + list interfaces 'lan' + list interfaces 'wan' diff --git a/net/parprouted/files/parprouted.init b/net/parprouted/files/parprouted.init new file mode 100644 index 0000000..7c5a90d --- /dev/null +++ b/net/parprouted/files/parprouted.init @@ -0,0 +1,44 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2012 OpenWrt.org + +START=50 + +section_enabled() { + local enabled + config_get_bool enabled "$1" 'enabled' 0 + [ $enabled -gt 0 ] +} + +append_interface() { + local name="$1" + local device + network_get_device device "$name" + append args "${device:-$name}" +} + +start_instance() { + local section="$1" + local permanent + local interfaces + local args="" + + section_enabled "$section" || return 1 + + config_get_bool permanent "$section" 'permanent' 0 + [ $permanent -eq 0 ] || append args "-p" + + config_list_foreach "$section" 'interfaces' append_interface + + service_start /usr/sbin/parprouted $args +} + +start() { + . /lib/network/functions.sh + + config_load 'parprouted' + config_foreach start_instance 'parprouted' +} + +stop() { + service_stop /usr/sbin/parprouted +} diff --git a/net/parprouted/patches/001-parprouted.patch b/net/parprouted/patches/001-parprouted.patch new file mode 100644 index 0000000..17fbdec --- /dev/null +++ b/net/parprouted/patches/001-parprouted.patch @@ -0,0 +1,33 @@ +diff -rupw parprouted-0.63/arp.c parprouted-0.63-1/arp.c +--- parprouted-0.63/arp.c 2004-05-23 14:06:31.000000000 +0200 ++++ parprouted-0.63-1/arp.c 2005-03-13 16:10:18.000000000 +0100 +@@ -366,7 +366,7 @@ void *arp(char *ifname) + do { + pthread_testcancel(); + /* Sleep a bit in order not to overload the system */ +- usleep(300); ++ usleep(3000); + + if (arp_recv(sock, &frame) <= 0) + continue; +diff -rupw parprouted-0.63/parprouted.c parprouted-0.63-1/parprouted.c +--- parprouted-0.63/parprouted.c 2004-01-30 02:45:43.000000000 +0100 ++++ parprouted-0.63-1/parprouted.c 2005-03-20 09:14:35.000000000 +0100 +@@ -93,7 +93,7 @@ void processarp(int cleanup) + + /* added route to the kernel */ + if (snprintf(routecmd_str, ROUTE_CMD_LEN-1, +- "/sbin/ip route add %s/32 metric 50 dev %s scope link", ++ "/sbin/route add -host %s metric 50 dev %s", + inet_ntoa(cur_entry->ipaddr_ia), cur_entry->ifname) > ROUTE_CMD_LEN-1) + { + syslog(LOG_INFO, "ip route command too large to fit in buffer!"); +@@ -112,7 +112,7 @@ void processarp(int cleanup) + + /* remove entry from arp table and remove route from kernel */ + if (snprintf(routecmd_str, ROUTE_CMD_LEN-1, +- "/sbin/ip route del %s/32 metric 50 dev %s scope link", ++ "/sbin/route del -host %s metric 50 dev %s", + inet_ntoa(cur_entry->ipaddr_ia), cur_entry->ifname) > ROUTE_CMD_LEN-1) + { + syslog(LOG_INFO, "ip route command too large to fit in buffer!"); diff --git a/net/pcapsipdump/Makefile b/net/pcapsipdump/Makefile new file mode 100644 index 0000000..ad07746 --- /dev/null +++ b/net/pcapsipdump/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=pcapsipdump +PKG_VERSION:=0.1.4 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/psipdump +PKG_MD5SUM:=95ed26caf66237a654cae2cacdaa3386 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/pcapsipdump + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + DEPENDS:=+libpcap $(CXX_DEPENDS) + TITLE:=SIP sessions dumping tool + URL:=http://sourceforge.net/projects/pcapsipdump/ +endef + +define Package/pcapsipdump/description + pcapsipdump is a tool for dumping SIP sessions (+RTP traffic, if available) to disk in a + fashion similar to "tcpdump -w" (format is exactly the same), but one file per sip session + (even if there is thousands of concurrect SIP sessions). +endef + +TARGET_CC=$(TARGET_CXX) + +define Build/Compile + $(TARGET_CONFIGURE_OPTS) \ + $(MAKE) -C $(PKG_BUILD_DIR) \ + CPPFLAGS="$(TARGET_CXXFLAGS) -fno-rtti" \ + LIBS="-lpcap" +endef + +define Package/pcapsipdump/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/pcapsipdump $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,pcapsipdump)) diff --git a/net/pcapsipdump/patches/001-cross_compile.patch b/net/pcapsipdump/patches/001-cross_compile.patch new file mode 100644 index 0000000..db4bead --- /dev/null +++ b/net/pcapsipdump/patches/001-cross_compile.patch @@ -0,0 +1,16 @@ +diff -urN pcapsipdump-0.1.4/Makefile pcapsipdump-0.1.4.new/Makefile +--- pcapsipdump-0.1.4/Makefile 2007-02-09 12:33:48.000000000 +0100 ++++ pcapsipdump-0.1.4.new/Makefile 2009-05-12 12:01:02.000000000 +0200 +@@ -1,10 +1,10 @@ + all: pcapsipdump + + pcapsipdump: pcapsipdump.cpp calltable.cpp calltable.h +- $(CC) $(CPPFLAGS) $(LDFLAGS) pcapsipdump.cpp calltable.cpp -o pcapsipdump -lpcap -lstdc++ ++ $(CC) $(CPPFLAGS) $(LDFLAGS) pcapsipdump.cpp calltable.cpp -o pcapsipdump $(LIBS) + + pcapsipdump-debug: pcapsipdump.cpp calltable.cpp calltable.h +- $(CC) $(CPPFLAGS) $(LDFLAGS) -ggdb pcapsipdump.cpp calltable.cpp -o pcapsipdump-debug -lpcap -lstdc++ ++ $(CC) $(CPPFLAGS) $(LDFLAGS) -ggdb pcapsipdump.cpp calltable.cpp -o pcapsipdump-debug $(LIBS) + + clean: + rm -f pcapsipdump diff --git a/net/pcapsipdump/patches/002-elif_else_replacement.patch b/net/pcapsipdump/patches/002-elif_else_replacement.patch new file mode 100644 index 0000000..bb217b7 --- /dev/null +++ b/net/pcapsipdump/patches/002-elif_else_replacement.patch @@ -0,0 +1,12 @@ +diff -urN pcapsipdump-0.1.4/pcapsipdump.h pcapsipdump-0.1.4.new/pcapsipdump.h +--- pcapsipdump-0.1.4/pcapsipdump.h 2007-05-11 20:40:49.000000000 +0200 ++++ pcapsipdump-0.1.4.new/pcapsipdump.h 2010-03-29 09:52:20.000000000 +0200 +@@ -35,7 +35,7 @@ + #elif defined (__BIG_ENDIAN) + uint8_t version:4, + ihl:4; +-#elif ++#else + #error Endian not defined + #endif + uint8_t tos; diff --git a/net/pdnsd/Makefile b/net/pdnsd/Makefile new file mode 100644 index 0000000..3d75aa1 --- /dev/null +++ b/net/pdnsd/Makefile @@ -0,0 +1,55 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=pdnsd +PKG_VERSION:=1.2.9a-par +PKG_RELEASE=$(PKG_SOURCE_VERSION) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://gitorious.org/pdnsd/pdnsd.git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=a8e46ccba7b0fa2230d6c42ab6dcd92926f6c21d +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz +# PKG_MIRROR_MD5SUM:= +# CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/pdnsd + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + DEPENDS:=+libpthread + TITLE:=Proxy DNS Server +endef + +define Package/pdnsd/description + pdnsd, is an IPv6 capable proxy DNS server with permanent caching (the cache + contents are written to hard disk on exit) that is designed to cope with + unreachable or down DNS servers (for example in dial-in networking). + + pdnsd can be used with applications that do dns lookups, eg on startup, and + can't be configured to change that behaviour, to prevent the often + minute-long hangs (or even crashes) that result from stalled dns queries. +endef + +TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include +#TARGET_CFLAGS += -ggdb3 + +CMAKE_OPTIONS += -DDEBUG=1 + +CONFIGURE_ARGS += \ + --with-cachedir=/var/pdnsd + +define Package/pdnsd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pdnsd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pdnsd-ctl/pdnsd-ctl $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/pdnsd.init $(1)/etc/init.d/pdnsd + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/pdnsd.conf $(1)/etc/ +endef + +$(eval $(call BuildPackage,pdnsd)) diff --git a/net/pdnsd/files/pdnsd.init b/net/pdnsd/files/pdnsd.init new file mode 100644 index 0000000..e678d8d --- /dev/null +++ b/net/pdnsd/files/pdnsd.init @@ -0,0 +1,46 @@ +#!/bin/sh /etc/rc.common + +START=65 +NAME=pdnsd +DESC="proxy DNS server" + +DAEMON=/usr/sbin/pdnsd +PID_FILE=/var/run/$NAME.pid +CACHEDIR=/var/pdnsd +CACHE=$CACHEDIR/pdnsd.cache + +USER=nobody +GROUP=nogroup + +start() { + echo -n "Starting $DESC: $NAME" + + gen_cache + + $DAEMON --daemon -p $PID_FILE + echo " ." +} + +stop() { + echo -n "Stopping $DESC: $NAME" + kill `cat $PID_FILE` > /dev/null 2>&1 + rm -rf $PID_FILE + echo " ." +} + +restart() { + echo "Restarting $DESC: $NAME... " + stop + sleep 2 + start +} + +gen_cache() +{ + if ! test -f "$CACHE"; then + mkdir -p `dirname $CACHE` + dd if=/dev/zero of="$CACHE" bs=1 count=4 2> /dev/null + chown -R $USER.$GROUP $CACHEDIR + fi +} + diff --git a/net/peerguardian/Makefile b/net/peerguardian/Makefile new file mode 100644 index 0000000..4c5c0a2 --- /dev/null +++ b/net/peerguardian/Makefile @@ -0,0 +1,65 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=peerguardian +PKG_VERSION:=1.5beta +PKG_RELEASE:=3 + +PKG_SOURCE:=pglinux-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/peerguardian +PKG_MD5SUM:=0fb2bc5501b031604fc56eec3bd35fa4 + +PKG_BUILD_DIR:=$(BUILD_DIR)/pglinux-$(PKG_VERSION) +PKG_BUILD_PARALLEL:=1 + +PKG_BUILD_DEPENDS:=iptables + +include $(INCLUDE_DIR)/package.mk + +define Package/peerguardian + SECTION:=net + CATEGORY:=Network + SUBMENU:=P2P + DEPENDS:= +libncurses +libpthread +libnetfilter-queue +libipq +libstdcpp + TITLE:=PeerGuardian for Linux + URL:=http://phoenixlabs.org/ +endef + +define Package/peerguardian/description + PeerGuardian helps protect your privacy by blocking many ranges of aggressive + IPs while you use P2P. +endef + +define Package/peerguardian/conffiles +/etc/PG.conf +/etc/p2p.p2b.p2p +endef + +EXTRA_CFLAGS:=-fno-rtti -I$(STAGING_DIR)/usr/include/libnetfilter_queue/ + +CONFIGURE_VARS+= \ + LIBS="-lm" + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CXXLD="$(TARGET_CXX)" +endef + +define Package/peerguardian/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/PG.conf $(1)/etc/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/p2p.p2b.p2p $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/peerguardnf $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/pgtext $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/peerguardian.init $(1)/etc/init.d/peerguardian +endef + +$(eval $(call BuildPackage,peerguardian)) diff --git a/net/peerguardian/files/peerguardian.init b/net/peerguardian/files/peerguardian.init new file mode 100644 index 0000000..c0cb8be --- /dev/null +++ b/net/peerguardian/files/peerguardian.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 + +BIN=peerguardnf +CFG_F=/etc/PG.conf +OPTIONS="-c $CFG_F -d" + +start() { + $BIN $OPTIONS +} + diff --git a/net/peerguardian/patches/001-no_host_includes.patch b/net/peerguardian/patches/001-no_host_includes.patch new file mode 100644 index 0000000..11a63f0 --- /dev/null +++ b/net/peerguardian/patches/001-no_host_includes.patch @@ -0,0 +1,13 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -74,8 +74,8 @@ peerguardnf_SOURCES = Main.cpp PeerGuard + pgtext_SOURCES = pgtext.cpp + peerguardnf_LDADD = -lipq -lpthread + pgtext_LDADD = -lncurses -lpthread +-peerguardnf_LDFLAGS = $(all_includes) -I/usr/include/libipq +-AM_CPPFLAGS = $(ALL_INCLUDES) -I/usr/include/libipq ++peerguardnf_LDFLAGS = $(all_includes) ++AM_CPPFLAGS = $(ALL_INCLUDES) + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs + CONFIG_HEADER = config.h diff --git a/net/peerguardian/patches/002-new_libipq.patch b/net/peerguardian/patches/002-new_libipq.patch new file mode 100644 index 0000000..c7ca959 --- /dev/null +++ b/net/peerguardian/patches/002-new_libipq.patch @@ -0,0 +1,32 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -3,7 +3,7 @@ man_MANS=peerguardnf.1 + mybin_PROGRAMS = peerguardnf pgtext + peerguardnf_SOURCES=Main.cpp PeerGuard.cpp BlockList.cpp Blocker_Linux.cpp Blocker_BSD.cpp HttpServer.cpp HttpRequest.cpp sha1.cpp + pgtext_SOURCES=pgtext.cpp +-peerguardnf_LDADD=-lipq -lpthread ++peerguardnf_LDADD=-lipq -lnetfilter_queue -lnfnetlink -lpthread + pgtext_LDADD=-lncurses -lpthread + peerguardnf_LDFLAGS=$(all_includes) -I/usr/include/libipq + AM_CPPFLAGS=$(ALL_INCLUDES) -I/usr/include/libipq +--- a/Makefile.in ++++ b/Makefile.in +@@ -72,7 +72,7 @@ man_MANS = peerguardnf.1 + mybin_PROGRAMS = peerguardnf pgtext + peerguardnf_SOURCES = Main.cpp PeerGuard.cpp BlockList.cpp Blocker_Linux.cpp Blocker_BSD.cpp HttpServer.cpp HttpRequest.cpp sha1.cpp + pgtext_SOURCES = pgtext.cpp +-peerguardnf_LDADD = -lipq -lpthread ++peerguardnf_LDADD = -lipq -lnetfilter_queue -lnfnetlink -lpthread + pgtext_LDADD = -lncurses -lpthread + peerguardnf_LDFLAGS = $(all_includes) + AM_CPPFLAGS = $(ALL_INCLUDES) +--- a/Blocker_Linux.cpp ++++ b/Blocker_Linux.cpp +@@ -22,6 +22,7 @@ + + #include "PeerGuard.h" + ++#include + #include + extern "C" { + #include diff --git a/net/peerguardian/patches/003-gcc_4_3-compile-fix.patch b/net/peerguardian/patches/003-gcc_4_3-compile-fix.patch new file mode 100644 index 0000000..aaa72c3 --- /dev/null +++ b/net/peerguardian/patches/003-gcc_4_3-compile-fix.patch @@ -0,0 +1,20 @@ +--- a/Main.cpp ++++ b/Main.cpp +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + using namespace PG; + using namespace std; +--- a/PeerGuard.h ++++ b/PeerGuard.h +@@ -24,6 +24,7 @@ + #include "BlockList.h" + + #include ++#include + + namespace PG { + diff --git a/net/peervpn/Makefile b/net/peervpn/Makefile new file mode 100644 index 0000000..695191c --- /dev/null +++ b/net/peervpn/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2007-2011 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:=peervpn +PKG_VERSION:=0-023 +PKG_RELEASE:=1 + +PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL :=http://www.peervpn.net/files + +include $(INCLUDE_DIR)/package.mk + +define Package/peervpn + SECTION:=net + CATEGORY:=Network + TITLE:=PeerVPN the open source peer-to-peer VPN + URL:=http://www.peervpn.net/ + DEPENDS:=+libopenssl +ip +endef + +define Package/peervpn/description + PeerVPN is software that builds virtual ethernet networks between multiple + computers. Adding a new node to an existing network doesn't require the + existing nodes to alter their configuration, because its IP address is + automatically distributed across the whole virtual network. +endef + +define Package/peervpn/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/peervpn $(1)/sbin/ + $(INSTALL_DIR) $(1)/etc/peervpn + $(INSTALL_CONF) $(PKG_BUILD_DIR)/peervpn.conf $(1)/etc/peervpn +endef + +$(eval $(call BuildPackage,peervpn)) diff --git a/net/pen/Makefile b/net/pen/Makefile new file mode 100644 index 0000000..161abbc --- /dev/null +++ b/net/pen/Makefile @@ -0,0 +1,58 @@ +# +# 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:=pen +PKG_VERSION:=0.18.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://siag.nu/pub/pen/ +PKG_MD5SUM:=96f6d39e7e7cca11a647e795550f3829 + +include $(INCLUDE_DIR)/package.mk + +define Package/pen + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libopenssl + TITLE:=Simple tcp load balancer + URL:=http://siag.nu/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 + +define Build/Configure + $(call Build/Configure/Default, \ + --with-poll \ + --with-experimental-only-ssl="$(STAGING_DIR)/usr" \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +define Package/pen/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mergelogs $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/pen $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/penctl $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/penctl.cgi $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/penlog $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/penlogd $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/penstats $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,pen)) diff --git a/net/pepperspot/Makefile b/net/pepperspot/Makefile new file mode 100644 index 0000000..4f420f4 --- /dev/null +++ b/net/pepperspot/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2008-2012 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:=pepperspot +PKG_VERSION:=0.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/pepperspot +PKG_MD5SUM:=977ad2d376190daadd863509110acf09 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/pepperspot + SUBMENU:=Captive Portals + SECTION:=net + CATEGORY:=Network + TITLE:=Wireless LAN HotSpot controller + URL:=http://pepperspot.sourceforge.net/ + DEPENDS:=+kmod-tun +kmod-ipv6 +endef + +define Package/pepperspot/description + PepperSpot is a captive portal or wireless LAN access point controller + which support the IPv6 protocol. It supports web based login and it + supports Wireless Protected Access (WPA). Authentication is handled by + your favorite radius server (over IPv4/IPv6). +endef + +define Package/pepperspot/conffiles +/etc/pepper.conf +endef + +# uses GNU configure + +define Build/Prepare +$(call Build/Prepare/Default) + # prevent autoconf invocation, since one the patches touched + # configure + (cd $(PKG_BUILD_DIR); \ + touch -r Makefile.am configure.in; \ + touch -r Makefile.in configure; \ + ) +endef + +define Package/pepperspot/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/pepper + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/extra/pepper.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pepper $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,pepperspot)) diff --git a/net/pepperspot/files/pepperspot.init b/net/pepperspot/files/pepperspot.init new file mode 100644 index 0000000..a1d57a8 --- /dev/null +++ b/net/pepperspot/files/pepperspot.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2012 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 +SERVICE_PID_FILE=/var/run/pepper.pid + +start() { + . /lib/functions/network.sh + + local ipaddr + network_get_ipaddr ipaddr lan && \ + service_start /usr/sbin/pepper --dns1="$ipaddr" +} + +stop() { + service_stop /usr/sbin/pepper +} diff --git a/net/pepperspot/patches/101-cflags.patch b/net/pepperspot/patches/101-cflags.patch new file mode 100644 index 0000000..2840eff --- /dev/null +++ b/net/pepperspot/patches/101-cflags.patch @@ -0,0 +1,22 @@ +--- a/configure ++++ b/configure +@@ -2815,8 +2815,6 @@ am__tar='${AMTAR} chof - "$$tardir"'; am + ac_config_headers="$ac_config_headers config.h" + + +-CFLAGS="" +- + # Checks for programs. + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' +--- a/configure.in ++++ b/configure.in +@@ -9,8 +9,6 @@ AM_INIT_AUTOMAKE + + AM_CONFIG_HEADER([config.h]) + +-CFLAGS="" +- + # Checks for programs. + AC_PROG_CC + diff --git a/net/pepperspot/patches/102-no_warnings.patch b/net/pepperspot/patches/102-no_warnings.patch new file mode 100644 index 0000000..2767ae0 --- /dev/null +++ b/net/pepperspot/patches/102-no_warnings.patch @@ -0,0 +1,134 @@ +--- a/src/pepper.c ++++ b/src/pepper.c +@@ -389,7 +389,7 @@ static int set_env(char *name, char *val + } + else if(mac != NULL) + { +- (void) snprintf(s, sizeof(s) - 1, "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", ++ (void) snprintf(s, sizeof(s) - 1, "%.2hX-%.2hX-%.2hX-%.2hX-%.2hX-%.2hX", + mac[0], mac[1], + mac[2], mac[3], + mac[4], mac[5]); +@@ -447,7 +447,7 @@ static int set_envv6(char *name, char *v + } + else if(mac != NULL) + { +- (void) snprintf(s, sizeof(s) - 1, "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", ++ (void) snprintf(s, sizeof(s) - 1, "%.2hX-%.2hX-%.2hX-%.2hX-%.2hX-%.2hX", + mac[0], mac[1], + mac[2], mac[3], + mac[4], mac[5]); +@@ -958,7 +958,7 @@ static int set_macallowed(char *macallow + for(i = 0; i < strlen(p1); i++) + if(!isxdigit(p1[i])) p1[i] = 0x20; + +- if(sscanf(p1, "%2x %2x %2x %2x %2x %2x", ++ if(sscanf(p1, "%2hhx %2hhx %2hhx %2hhx %2hhx %2hhx", + &options.macok[options.macoklen][0], + &options.macok[options.macoklen][1], + &options.macok[options.macoklen][2], +@@ -973,7 +973,7 @@ static int set_macallowed(char *macallow + } + if(options.debug & DEBUG_CONF) + { +- printf("Macallowed address #%d: %.2X-%.2X-%.2X-%.2X-%.2X-%.2X\n", ++ printf("Macallowed address #%d: %.2hhX-%.2hhX-%.2hhX-%.2hhX-%.2hhX-%.2hhX\n", + options.macoklen, + options.macok[options.macoklen][0], + options.macok[options.macoklen][1], +--- a/src/redir.c ++++ b/src/redir.c +@@ -178,7 +178,7 @@ static int redir_hextochar(char *src, in + { + char x[3]; + int n = 0; +- int y = 0; ++ unsigned int y = 0; + int nb = len / 2; + + for(n = 0 ; n < nb ; n++) +--- a/src/radius.c ++++ b/src/radius.c +@@ -971,7 +971,7 @@ int radius_getattr(struct radius_packet_ + } + offset += t->l; + } +- while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */ ++ while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */ + } + else /* Need to check pack -> length */ + { +@@ -992,7 +992,7 @@ int radius_getattr(struct radius_packet_ + } + offset += t->l; + } +- while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */ ++ while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */ + } + + return -1; /* Not found */ +@@ -1040,7 +1040,7 @@ int radius_getattrv6(struct radius_packe + } + offset += t->l; + } +- while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */ ++ while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */ + } + else /* Need to check pack -> length */ + { +@@ -1061,7 +1061,7 @@ int radius_getattrv6(struct radius_packe + } + offset += t->l; + } +- while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */ ++ while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */ + } + + return -1; /* Not found */ +@@ -1090,7 +1090,7 @@ int radius_getattrv6(struct radius_packe + } + offset += 2 + t->l; + } +- while(offset < ntohs(pack->length)); ++ while(offset < (int)ntohs(pack->length)); + + if(0) printf("Count %d\n", count); + return count; +@@ -1903,7 +1903,7 @@ int radius_decaps(struct radius_t *this) + return -1; + } + +- if(ntohs(pack.length) != status) ++ if((int)ntohs(pack.length) != status) + { + sys_err(LOG_WARNING, __FILE__, __LINE__, errno, + "Received radius packet with wrong length field %d != %d!", +@@ -2107,7 +2107,7 @@ int radius_proxy_ind(struct radius_t *th + return -1; + } + +- if(ntohs(pack.length) != status) ++ if((int)ntohs(pack.length) != status) + { + sys_err(LOG_WARNING, __FILE__, __LINE__, 0, + "Received radius packet with wrong length field %d != %d!", +--- a/src/dhcp.c ++++ b/src/dhcp.c +@@ -240,7 +240,7 @@ static int dhcp_tcp_checkv6(struct dhcp_ + struct dhcp_tcphdr_t *tcph = NULL; + int tcp_len = 0; + +- if(ntohs(pack->ip6h.payload_length) > (length - DHCP_ETH_HLEN)) ++ if((int)ntohs(pack->ip6h.payload_length) > (length - DHCP_ETH_HLEN)) + return -1; /* Wrong length of packet */ + + tcp_len = ntohs(pack->ip6h.payload_length); +@@ -347,7 +347,7 @@ static int dhcp_tcp_check(struct dhcp_ip + struct dhcp_tcphdr_t *tcph; + int tcp_len = 0; + +- if(ntohs(pack->iph.tot_len) > (length - DHCP_ETH_HLEN)) ++ if((int)ntohs(pack->iph.tot_len) > (length - DHCP_ETH_HLEN)) + return -1; /* Wrong length of packet */ + + tcp_len = ntohs(pack->iph.tot_len) - pack->iph.ihl * 4; diff --git a/net/pepperspot/patches/110-fix-compile.patch b/net/pepperspot/patches/110-fix-compile.patch new file mode 100644 index 0000000..6606f6b --- /dev/null +++ b/net/pepperspot/patches/110-fix-compile.patch @@ -0,0 +1,247 @@ +--- a/src/cmdline.c ++++ b/src/cmdline.c +@@ -1335,7 +1335,7 @@ cmdline_parser_required (struct gengetop + #endif + + int +-cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required, const char *additional_error) ++cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required __attribute__((__unused__)), const char *additional_error) + { + int c; /* Character of the parsed option. */ + char *multi_token, *multi_next; /* for multiple options */ +--- a/src/ippool.c ++++ b/src/ippool.c +@@ -267,7 +267,7 @@ void ippool_getv6suffix(struct in6_addr + + /* Get IP address and mask */ + int ippool_aton(struct in_addr *addr, struct in_addr *mask, +- char *pool, int number) ++ char *pool, int number __attribute__((__unused__))) + { + /* Parse only first instance of network for now */ + /* Eventually "number" will indicate the token which we want to parse */ +--- a/src/pepper.c ++++ b/src/pepper.c +@@ -3305,7 +3305,7 @@ static int dnprot_accept(struct app_conn + * \return 0 + * \author Sebastien Vincent + */ +-static int cb_tun6_ind(struct tun6_t* tun_obj, void* pack, unsigned len) ++static int cb_tun6_ind(struct tun6_t* tun_obj __attribute__((__unused__)), void* pack, unsigned len) + { + struct ippoolm_t* ipm = NULL; + struct in6_addr dst; +@@ -3377,7 +3377,7 @@ static int cb_tun6_ind(struct tun6_t* tu + * \param len data length + * \return 0 + */ +-int cb_tun_ind(struct tun_t *tun_obj, void *pack, unsigned len) ++int cb_tun_ind(struct tun_t *tun_obj __attribute__((__unused__)), void *pack, unsigned len) + { + struct ippoolm_t *ipm = NULL; + struct in_addr dst; +@@ -3459,7 +3459,7 @@ int cb_tun_ind(struct tun_t *tun_obj, vo + * \param conn redir connection that we will filled up up-to-date value + * \return 0 if success, -1 otherwise + */ +-static int cb_redir_getstate(struct redir_t *redir_obj, struct in_addr *addr, ++static int cb_redir_getstate(struct redir_t *redir_obj __attribute__((__unused__)), struct in_addr *addr, + struct redir_conn_t *conn) + { + struct ippoolm_t *ipm = NULL; +@@ -3524,7 +3524,7 @@ static int cb_redir_getstate(struct redi + * \param conn redir connection that we will filled up up-to-date value + * \return 0 if success, -1 otherwise + */ +-static int cb_redir_getstatev6(struct redir_t* redir_obj, struct in6_addr* addr, struct redir_conn_t* conn) ++static int cb_redir_getstatev6(struct redir_t* redir_obj __attribute__((__unused__)), struct in6_addr* addr, struct redir_conn_t* conn) + { + struct ippoolm_t *ipm = NULL; + struct app_conn_t *appconn = NULL; +@@ -4354,9 +4354,9 @@ int upprot_getipv6(struct app_conn_t *ap + * \param pack_req packet for request + * \return 0 if success, -1 otherwise + */ +-int radius_conf(struct radius_t *radius_obj, ++int radius_conf(struct radius_t *radius_obj __attribute__((__unused__)), + struct radius_packet_t *pack, +- struct radius_packet_t *pack_req) ++ struct radius_packet_t *pack_req __attribute__((__unused__))) + { + struct radius_attr_t *attr = NULL; + +--- a/src/tun.c ++++ b/src/tun.c +@@ -226,7 +226,7 @@ int tun_addaddr(struct tun_t *this, + struct sockaddr_nl local; + int addr_len = 0; + int fd = -1; +- int status = 0; ++ int status __attribute__((__unused__)) = 0; + + struct sockaddr_nl nladdr; + struct iovec iov; +@@ -507,7 +507,7 @@ int tun_setaddr(struct tun_t *this, + * \param delete 1 = delete route, 0 = add route + * \return 0 if success, -1 otherwise + */ +-static int tun_route(struct tun_t *this, ++static int tun_route(struct tun_t *this __attribute__((__unused__)), + struct in_addr *dst, + struct in_addr *gateway, + struct in_addr *mask, +--- a/src/dhcp.c ++++ b/src/dhcp.c +@@ -2111,7 +2111,7 @@ int dhcp_timeout(struct dhcp_t *this) + return 0; + } + +-struct timeval* dhcp_timeleft(struct dhcp_t *this, struct timeval *tvp) ++struct timeval* dhcp_timeleft(struct dhcp_t *this __attribute__((__unused__)), struct timeval *tvp) + { + /* To avoid unused parameter warning */ + this = NULL; +@@ -2640,7 +2640,7 @@ static int dhcp_gettag(struct dhcp_packe + * \return 0 if success, -1 otherwise4 + */ + static int dhcp_sendOFFER(struct dhcp_conn_t *conn, +- struct dhcp_fullpacket_t *pack, int len) ++ struct dhcp_fullpacket_t *pack, int len __attribute__((__unused__))) + { + struct dhcp_t *this = conn->parent; + struct dhcp_fullpacket_t packet; +@@ -2762,7 +2762,7 @@ static int dhcp_sendOFFER(struct dhcp_co + * \return 0 if success, -1 otherwise + */ + static int dhcp_sendACK(struct dhcp_conn_t *conn, +- struct dhcp_fullpacket_t *pack, int len) ++ struct dhcp_fullpacket_t *pack, int len __attribute__((__unused__))) + { + struct dhcp_t *this = conn->parent; + struct dhcp_fullpacket_t packet; +@@ -2895,7 +2895,7 @@ static int dhcp_sendACK(struct dhcp_conn + * \return 0 if success, -1 otherwise + */ + static int dhcp_sendNAK(struct dhcp_conn_t *conn, +- struct dhcp_fullpacket_t *pack, int len) ++ struct dhcp_fullpacket_t *pack, int len __attribute__((__unused__))) + { + struct dhcp_t *this = conn->parent; + struct dhcp_fullpacket_t packet; +@@ -3496,7 +3496,7 @@ int dhcp_data_req(struct dhcp_conn_t *co + * \return 0 + */ + static int dhcp_sendARP(struct dhcp_conn_t *conn, +- struct dhcp_arp_fullpacket_t *pack, int len) ++ struct dhcp_arp_fullpacket_t *pack, int len __attribute__((__unused__))) + { + struct dhcp_t *this = conn->parent; + struct dhcp_arp_fullpacket_t packet; +--- a/src/radius.c ++++ b/src/radius.c +@@ -210,7 +210,7 @@ static int radius_acctreq_authenticator( + * \param secretlen length of secret + * \return 0 + */ +-static int radius_authresp_authenticator(struct radius_t *this, ++static int radius_authresp_authenticator(struct radius_t *this __attribute__((__unused__)), + struct radius_packet_t *pack, + uint8_t *req_auth, + char *secret, int secretlen) +@@ -801,7 +801,7 @@ int radius_addattr(struct radius_t *this + return 0; + } + +-int radius_addattrv6(struct radius_t *this, struct radius_packet_t *pack, ++int radius_addattrv6(struct radius_t *this __attribute__((__unused__)), struct radius_packet_t *pack, + uint8_t type, uint32_t vendor_id, uint8_t vendor_type, + struct in6_addr value, uint8_t *data, uint16_t dlen) + { +@@ -1124,7 +1124,7 @@ int radius_getattrv6(struct radius_packe + return 0; + } + +-int radius_keydecode(struct radius_t *this, uint8_t *dst, int dstsize, ++int radius_keydecode(struct radius_t *this __attribute__((__unused__)), uint8_t *dst, int dstsize, + int *dstlen, uint8_t *src, int srclen, + uint8_t *authenticator, char *secret, int secretlen) + { +@@ -1346,7 +1346,7 @@ int radius_pwdecode(struct radius_t *thi + return 0; + } + +-int radius_pwencode(struct radius_t *this, uint8_t *dst, int dstsize, ++int radius_pwencode(struct radius_t *this __attribute__((__unused__)), uint8_t *dst, int dstsize, + int *dstlen, uint8_t *src, int srclen, + uint8_t *authenticator, char *secret, int secretlen) + { +--- a/src/redir.c ++++ b/src/redir.c +@@ -974,7 +974,7 @@ void redir_set(struct redir_t *redir, in + * \param dstsize size of dst + * \return 0 if success, -1 otherwise + */ +-static int redir_getpath(struct redir_t *redir, char *src, char *dst, int dstsize) ++static int redir_getpath(struct redir_t *redir __attribute__((__unused__)), char *src, char *dst, int dstsize) + { + char *p1 = NULL; + char *p2 = NULL; +@@ -1045,7 +1045,7 @@ static int redir_getpath(struct redir_t + /** + * \brief Get the url of an HTTP request. + */ +-static int redir_geturl(struct redir_t *redir, char *src, char *dst, int dstsize) ++static int redir_geturl(struct redir_t *redir __attribute__((__unused__)), char *src, char *dst, int dstsize) + { + char *p1 = NULL; + char *p3 = NULL; +@@ -1128,7 +1128,7 @@ static int redir_geturl(struct redir_t * + * \return 0 if found, -1 otherwise (not found, malformed HTTP response) + */ + /* TODO: Should be merged with other parsers */ +-static int redir_getparam(struct redir_t *redir, char *src, ++static int redir_getparam(struct redir_t *redir __attribute__((__unused__)), char *src, + char *param, + char *dst, int dstsize) + { +@@ -1362,9 +1362,9 @@ static int redir_getreq(struct redir_t * + * \param cbp pointer for callback + * \return 0 + */ +-static int redir_cb_radius_auth_conf(struct radius_t *radius, ++static int redir_cb_radius_auth_conf(struct radius_t *radius __attribute__((__unused__)), + struct radius_packet_t *pack, +- struct radius_packet_t *pack_req, void *cbp) ++ struct radius_packet_t *pack_req __attribute__((__unused__)), void *cbp) + { + struct radius_attr_t *interimattr = NULL; + struct radius_attr_t *stateattr = NULL; +@@ -1696,7 +1696,7 @@ static int redir_cb_radius_auth_conf(str + * \param conn redir connection + * \return 0 if success, -1 otherwise + */ +-static int redir_radius(struct redir_t *redir, struct sockaddr_storage *addr, ++static int redir_radius(struct redir_t *redir, struct sockaddr_storage *addr __attribute__((__unused__)), + struct redir_conn_t *conn) + { + struct radius_t *radius = NULL; /* Radius client instance */ +--- a/src/tun6.c ++++ b/src/tun6.c +@@ -1080,7 +1080,7 @@ int tun6_setaddr(struct tun6_t *this, st + return code; + } + +-int tun6_addroute(struct tun6_t *this, struct in6_addr *dst, struct in6_addr *gateway, uint8_t prefixlen) ++int tun6_addroute(struct tun6_t *this __attribute__((__unused__)), struct in6_addr *dst __attribute__((__unused__)), struct in6_addr *gateway __attribute__((__unused__)), uint8_t prefixlen __attribute__((__unused__))) + { + /* TODO : use _iface_route */ + this = NULL; +@@ -1096,7 +1096,7 @@ int tun6_set_cb_ind(struct tun6_t *this, + return 0; + } + +-int tun6_runscript(struct tun6_t *tun, char* script) ++int tun6_runscript(struct tun6_t *tun __attribute__((__unused__)), char* script __attribute__((__unused__))) + { + /* TODO */ + tun = NULL; diff --git a/net/pepsal/Makefile b/net/pepsal/Makefile new file mode 100644 index 0000000..6c68e20 --- /dev/null +++ b/net/pepsal/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=pepsal +PKG_VERSION:=1.2.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=5107f0b922716276e8493b26b80fb4b6 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/pepsal + TITLE:=Performance Enhancing Proxy + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + URL:=http://pepsal.sourceforge.net/ + DEPENDS:=+libnetfilter-queue +endef + +define Package/pepsal/description + PEPsal is an integrated, multi-layer, transparent TCP Performance Enhancing + Proxy which splits the connection into two parts, making use of Linux TCP + enhancements when sending data, and largely improving performance in + links with different characteristics +endef + + +define Package/pepsal/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/pepsal $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,pepsal)) diff --git a/net/polipo/Makefile b/net/polipo/Makefile new file mode 100644 index 0000000..8099e65 --- /dev/null +++ b/net/polipo/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2007-2011 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:=polipo +PKG_VERSION:=1.0.4.1 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://freehaven.net/~chrisd/polipo/ +PKG_MD5SUM:=bfc5c85289519658280e093a270d6703 + +include $(INCLUDE_DIR)/package.mk + +define Package/polipo + SUBMENU:=Web Servers/Proxies + SECTION:=net + CATEGORY:=Network + TITLE:=A caching web proxy + URL:=http://www.pps.jussieu.fr/~jch/software/polipo/ + MAINTAINER:=Gabriel Kerneis +endef + +define Package/polipo/description + Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, + a proxy server). While Polipo was designed to be used by one person or a + small group of people, there is nothing that prevents it from being used + by a larger group. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + polipo +endef + +define Package/polipo/conffiles +/etc/config/polipo +/etc/polipo/config +endef + +define Package/polipo/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/polipo $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/polipo + $(INSTALL_CONF) $(PKG_BUILD_DIR)/config.sample $(1)/etc/polipo/config + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/polipo.config $(1)/etc/config/polipo + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/polipo.init $(1)/etc/init.d/polipo +endef + +$(eval $(call BuildPackage,polipo)) diff --git a/net/polipo/files/polipo.config b/net/polipo/files/polipo.config new file mode 100644 index 0000000..8f85331 --- /dev/null +++ b/net/polipo/files/polipo.config @@ -0,0 +1,42 @@ +# polipo daemon configuration +config 'polipo' 'daemon' + # daemonise polipo (fork in background) + option 'daemonise' '1' + # where polipo will store its process pid + option 'pidFile' '/var/run/polipo.pid' + +config 'polipo' 'general' + option 'enabled' '1' + # adress on which polipo will listen, 0.0.0.0 means all addresses + option 'proxyAddress' '0.0.0.0' + # port on which polipo will listen, default is 8123 + #option 'proxyPort' '8123' + # list of allowed clients to connect + list 'allowedClients' '192.168.1.0/24' + #list 'allowedClients' '127.0.0.1' + #list 'allowedClients' '192.168.2.1' + # how much RAM memory should Polipo use (in bytes). + option 'chunkHighMark' '1048576' + # enable disk cache index and serverlist of integrated polipo web interface + #option 'disableIndexing' '0' + #option 'disableServersList' '0' + # disable loging to syslog + option 'logSyslog' '0' + # set log file location (disabled when not set) + #option 'logFile' '/mnt/usbdrive/polipo/log' + +config 'polipo' 'cache' + # disk cache location, you should always use external storage device + # (disabled when not set) + #option 'diskCacheRoot' '/mnt/usbdrive-p2/polipo/cache' + # disk cache cleanup settings + #option 'diskCacheUnlinkTime' '20d' + #option 'diskCacheTruncateTime' '5d' + #option 'diskCacheTruncateSize' '3145728' + # set to 1 if proxy is used by multiple users + #option 'cacheIsShared' '1' + +config 'polipo' 'pmm' + # poor man's multiplexing semgnet size to fetch + #option 'pmmSize' '8192' + diff --git a/net/polipo/files/polipo.init b/net/polipo/files/polipo.init new file mode 100644 index 0000000..3cd73d4 --- /dev/null +++ b/net/polipo/files/polipo.init @@ -0,0 +1,150 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2011 OpenWrt.org + +START=99 + +CFGFILE=/var/etc/polipo.conf + +start() { + config_load 'polipo' + + config_get_bool enabled "general" 'enabled' '0' + [ $enabled -gt 0 ] || return 1 + + mkdir -m 0755 -p /var/etc/ + echo '### AUTOGENERATED CONFIGURATION' > $CFGFILE + echo '### DO NOT EDIT' >> $CFGFILE + echo '### SEE /etc/config/polipo INSTEAD' >> $CFGFILE + echo '' >> $CFGFILE + + config_foreach polipo_config 'polipo' + + # handle values that are disabled when not defined or empty + echo "### VALUES THAT ARE DISABLED WHEN EMPTY" >> $CFGFILE + polipo_atom "cache" "diskCacheRoot" '"' "1" >> $CFGFILE + polipo_atom "general" "logFile" '"' "1" >> $CFGFILE + polipo_atom "general" "localDocumentRoot" '"' "1" >> $CFGFILE + + service_start /usr/sbin/polipo -c "$CFGFILE" +} + +stop() { + service_stop /usr/sbin/polipo -c "$CFGFILE" +} + +polipo_config() { + echo "### SECTION $1" >> $CFGFILE + + string_options='authCredentials authRealm dnsNameServer forbiddenFile + forbiddenUrl logFacility pidFile parentAuthCredentials parentProxy + proxyAddress proxyName redirector socksParentProxy socksProxyType + socksUserName uncachableFile' + + number_options='bigBufferSize chunkCriticalMark chunkHighMark chunkLowMark + diskCacheDirectoryPermissions diskCacheFilePermissions + diskCacheTruncateSize diskCacheWriteoutOnClose forbiddenRedirectCode + logFilePermissions logLevel maxDiskCacheEntrySize maxDiskEntries + maxObjectsWhenIdle maxPipelineTrain maxSideBuffering maxWriteoutWhenIdle + objectHashTableSize objectHighMark pmmFirstSize pmmSize proxyPort + publicObjectLowMark redirectorRedirectCode replyUnpipelineSize + serverMaxSlots serverSlots serverSlots1 maxAgeFraction' + + time_options='clientTimeout diskCacheTruncateTime diskCacheUnlinkTime + dnsGethostbynameTtl dnsMaxTimeout dnsNegativeTtl idleTime maxAge + maxConnectionAge maxConnectionRequests maxExpiresAge maxNoModifiedAge + replyUnpipelineTime serverExpireTime serverIdleTimeout serverTimeout + smallRequestTime' + + multistate_options='censorReferer dnsQueryIPv6 dnsUseGethostbyname + dontTrustVaryETag expectContinue pipelineAdditionalRequests + useTemporarySourceAddress relaxTransparency' + + boolean_options='cacheIsShared daemonise disableConfiguration disableIndexing + disableLocalInterface disableProxy disableServersList disableVia + dontCacheCookies dontCacheRedirects logSyslog mindlesslyCacheVary + preciseExpiry proxyOffline scrubLogs laxHttpParser' + + string_list_options='allowedClients censoredHeaders' + + number_list_options='allowedPorts tunnelAllowedPorts' + + for option in $string_options; do + polipo_atom "$1" "$option" '"' >> $CFGFILE + done + + for option in $number_options; do + polipo_atom "$1" "$option" >> $CFGFILE + done + + for option in $time_options; do + polipo_atom "$1" "$option" >> $CFGFILE + done + + for option in $multistate_options; do + polipo_atom "$1" "$option" >> $CFGFILE + done + + for option in $boolean_options; do + polipo_boolean "$1" "$option" >> $CFGFILE + done + + for option in $string_list_options; do + polipo_list "$1" "$option" '"' >> $CFGFILE + done + + for option in $number_list_options; do + polipo_list "$1" "$option" >> $CFGFILE + done +} + +polipo_atom() { + local SECTION=$1 + local OPTION=$2 + local QUOTE=$3 + local EMPTY_DISABLED=${4:-0} + + config_get _value "$SECTION" "$OPTION" + [ -n "$_value" -o "$EMPTY_DISABLED" -eq "1" ] && { + echo "$OPTION = ${QUOTE}${_value}${QUOTE}" + } +} + +polipo_boolean() { + local SECTION=$1 + local OPTION=$2 + + config_get_bool _value "$SECTION" "$OPTION" + [ -n "$_value" ] && { + [ "$_value" -eq "1" ] && _value="true" || _value="false" + echo "$OPTION = $_value" + } +} + +polipo_list() { + local SECTION=$1 + local OPTION=$2 + local QUOTE=$3 + + config_get _value "$SECTION" "$OPTION" + + [ "$SECTION" = general ] && [ "$OPTION" = allowedClients ] && { + case "$_value" in + *127.0.0.1*) : ;; + *) _value="127.0.0.1 $_value" ;; + esac + } + + [ -n "$_value" ] && { + echo -n "$OPTION = " + + local FIRST=1 + for entry in $_value; do + [ "$FIRST" -ne "1" ] && echo -n ", " || FIRST=0 + + echo -n "${QUOTE}${entry}${QUOTE}" + done + + echo '' + } +} + diff --git a/net/portmap/Makefile b/net/portmap/Makefile new file mode 100644 index 0000000..70499aa --- /dev/null +++ b/net/portmap/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2006-2011 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:=portmap +PKG_VERSION:=6.0 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://neil.brown.name/portmap/ +PKG_MD5SUM:=ac108ab68bf0f34477f8317791aaf1ff + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/portmap + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libwrap $(LIBRPC_DEPENDS) + TITLE:=The RPC Portmapper + URL:=http://neil.brown.name/portmap/ +endef + +define Package/portmap/description + Portmap is a server that converts RPC (Remote Procedure Call) program + numbers into DARPA protocol port numbers. +endef + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -DHOSTS_ACCESS -DFACILITY=LOG_DAEMON -DIGNORE_SIGCHLD" \ + RPCUSER="nobody" \ + LDLIBS="$(TARGET_LDFLAGS) -lwrap $(LIBRPC)" \ + all + +define Package/portmap/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/portmap $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/portmap.init $(1)/etc/init.d/portmap +endef + +$(eval $(call BuildPackage,portmap)) diff --git a/net/portmap/files/portmap.init b/net/portmap/files/portmap.init new file mode 100644 index 0000000..e73701c --- /dev/null +++ b/net/portmap/files/portmap.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=19 +STOP=19 + +start() { + service_start /usr/sbin/portmap +} + +stop() { + service_stop /usr/sbin/portmap +} diff --git a/net/portmap/patches/101-no_pie.patch b/net/portmap/patches/101-no_pie.patch new file mode 100644 index 0000000..6cbdece --- /dev/null +++ b/net/portmap/patches/101-no_pie.patch @@ -0,0 +1,12 @@ +diff -ur portmap_6.0.org/Makefile portmap_6.0/Makefile +--- portmap_6.0.org/Makefile 2008-04-19 22:44:35.000000000 +0200 ++++ portmap_6.0/Makefile 2008-04-19 00:02:01.000000000 +0200 +@@ -127,7 +127,7 @@ + CPPFLAGS += $(HOSTS_ACCESS) + portmap: CFLAGS += -fpie + portmap: LDLIBS += $(WRAP_LIB) +-portmap: LDFLAGS += -pie ++#portmap: LDFLAGS += -pie + portmap: portmap.o pmap_check.o from_local.o + + from_local: CPPFLAGS += -DTEST diff --git a/net/portsentry/Makefile b/net/portsentry/Makefile new file mode 100644 index 0000000..ed0cf15 --- /dev/null +++ b/net/portsentry/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2007-2011 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:=portsentry +PKG_VERSION:=1.2 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-1.2.tar.gz +PKG_SOURCE_URL:=@SF/sentrytools +PKG_MD5SUM:=3ebd3618ba9abfea2525e236bd44cebd + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_beta + +include $(INCLUDE_DIR)/package.mk + +define Package/portsentry + SECTION:=net + CATEGORY:=Network + SUBMENU:=Firewall + TITLE:=Portscan protection utility + URL:=http://sourceforge.net/projects/sentrytools +endef + +define Package/portsentry/conffiles +/etc/portsentry.conf +endef + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) -DNODAEMON" \ + linux \ + +define Package/portsentry/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/portsentry $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/portsentry.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/portsentry.init $(1)/etc/init.d/portsentry + $(SED) 's|^\(.*_FILE\)="/usr/local/psionic/\(portsentry/.*\)"|\1="/var/run/\2"|g' \ + $(1)/etc/portsentry.conf +endef + +$(eval $(call BuildPackage,portsentry)) diff --git a/net/portsentry/files/portsentry.init b/net/portsentry/files/portsentry.init new file mode 100644 index 0000000..03e8835 --- /dev/null +++ b/net/portsentry/files/portsentry.init @@ -0,0 +1,22 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=99 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +start() { + mkdir -m 0755 -p /var/run/portsentry + SERVICE_PID_FILE="/var/run/portsentry-atcp.pid" \ + service_start /usr/bin/portsentry -atcp + SERVICE_PID_FILE="/var/run/portsentry-audp.pid" \ + service_start /usr/bin/portsentry -audp +} + +stop() { + SERVICE_PID_FILE="/var/run/portsentry-atcp.pid" \ + service_stop /usr/bin/portsentry + SERVICE_PID_FILE="/var/run/portsentry-audp.pid" \ + service_stop /usr/bin/portsentry +} diff --git a/net/portsentry/patches/100-conf_location.patch b/net/portsentry/patches/100-conf_location.patch new file mode 100644 index 0000000..d644825 --- /dev/null +++ b/net/portsentry/patches/100-conf_location.patch @@ -0,0 +1,13 @@ +Index: portsentry_beta/portsentry_config.h +=================================================================== +--- portsentry_beta.orig/portsentry_config.h 2007-09-20 17:30:32.000000000 +0200 ++++ portsentry_beta/portsentry_config.h 2007-09-20 17:30:32.000000000 +0200 +@@ -22,7 +22,7 @@ + + /* These are probably ok. Be sure you change the Makefile if you */ + /* change the path */ +-#define CONFIG_FILE "/usr/local/psionic/portsentry/portsentry.conf" ++#define CONFIG_FILE "/etc/portsentry.conf" + + /* The location of Wietse Venema's TCP Wrapper hosts.deny file */ + #define WRAPPER_HOSTS_DENY "/etc/hosts.deny" diff --git a/net/portsentry/patches/101-postsentry_c.patch b/net/portsentry/patches/101-postsentry_c.patch new file mode 100644 index 0000000..51374bd --- /dev/null +++ b/net/portsentry/patches/101-postsentry_c.patch @@ -0,0 +1,14 @@ +Index: portsentry_beta/portsentry.c +=================================================================== +--- portsentry_beta.orig/portsentry.c 2007-09-20 17:30:32.000000000 +0200 ++++ portsentry_beta/portsentry.c 2007-09-20 17:30:32.000000000 +0200 +@@ -1581,8 +1581,7 @@ + Usage (void) + { + printf ("PortSentry - Port Scan Detector.\n"); +- printf ("Copyright 1997-2003 Craig H. Rowland \n"); ++ printf ("Copyright 1997-2003 Craig H. Rowland \n"); + printf ("Licensing restrictions apply. Please see documentation\n"); + printf ("Version: %s\n\n", VERSION); + #ifdef SUPPORT_STEALTH diff --git a/net/pptpd/Makefile b/net/pptpd/Makefile new file mode 100644 index 0000000..e79e0a7 --- /dev/null +++ b/net/pptpd/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=pptpd +PKG_VERSION:=1.3.4 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/poptop +PKG_MD5SUM:=b38df9c431041922c997c1148bedf591 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/pptpd + SECTION:=net + CATEGORY:=Network + DEPENDS:=+kmod-ppp +kmod-gre +ppp + TITLE:=PopTop pptp server + URL:=http://www.poptop.org/ + SUBMENU:=VPN +endef + +CONFIGURE_ARGS += \ + --enable-bcrelay \ + +CONFIGURE_VARS += \ + ac_cv_header_libintl_h=no \ + +MAKE_FLAGS += \ + COPTS="$(TARGET_CFLAGS)" \ + INSTALL="install" \ + +define Package/pptpd/conffiles +/etc/pptpd.conf +/etc/ppp/options.pptpd +endef + +define Package/pptpd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/sbin/bcrelay \ + $(PKG_INSTALL_DIR)/usr/sbin/pptpctrl \ + $(PKG_INSTALL_DIR)/usr/sbin/pptpd \ + $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/pptpd + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pptpd/* $(1)/usr/lib/pptpd/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/pptpd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/pptpd.init $(1)/etc/init.d/pptpd + $(INSTALL_DIR) $(1)/etc/ppp + $(INSTALL_DATA) ./files/options.pptpd $(1)/etc/ppp/ +endef + +$(eval $(call BuildPackage,pptpd)) diff --git a/net/pptpd/files/options.pptpd b/net/pptpd/files/options.pptpd new file mode 100644 index 0000000..5dd2daf --- /dev/null +++ b/net/pptpd/files/options.pptpd @@ -0,0 +1,23 @@ +#debug +#logfile /tmp/pptp-server.log +172.16.1.1: +auth +name "pptp-server" +lcp-echo-failure 3 +lcp-echo-interval 60 +default-asyncmap +mtu 1482 +mru 1482 +nobsdcomp +nodeflate +#noproxyarp +#nomppc +mppe required,no40,no56,stateless +require-mschap-v2 +refuse-chap +refuse-mschap +refuse-eap +refuse-pap +#ms-dns 172.16.1.1 +#plugin radius.so +#radius-config-file /etc/radius.conf diff --git a/net/pptpd/files/pptpd.conf b/net/pptpd/files/pptpd.conf new file mode 100644 index 0000000..354745f --- /dev/null +++ b/net/pptpd/files/pptpd.conf @@ -0,0 +1,5 @@ +#debug +option /etc/ppp/options.pptpd +speed 115200 +stimeout 10 +#localip & remoteip are not needed, ip management is done by pppd diff --git a/net/pptpd/files/pptpd.init b/net/pptpd/files/pptpd.init new file mode 100644 index 0000000..a74973c --- /dev/null +++ b/net/pptpd/files/pptpd.init @@ -0,0 +1,21 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +START=60 +BIN=pptpd +DEFAULT=/etc/default/$BIN +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid + +start() { + [ -f $DEFAULT ] && . $DEFAULT + mkdir -p $RUN_D + for m in arc4 sha1 slhc crc-ccitt ppp_generic ppp_async ppp_mppe_mppc; do + insmod $m >/dev/null 2>&1 + done + $BIN $OPTIONS +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) +} diff --git a/net/pptpd/patches/001-bad_pqueue_debug.patch b/net/pptpd/patches/001-bad_pqueue_debug.patch new file mode 100644 index 0000000..8e8f5a5 --- /dev/null +++ b/net/pptpd/patches/001-bad_pqueue_debug.patch @@ -0,0 +1,18 @@ +--- pptpd-1.3.4.orig/pqueue.c 2005-08-03 10:53:22.000000000 +0200 ++++ pptpd-1.3.4/pqueue.c 2009-12-03 17:47:26.976174000 +0100 +@@ -7,13 +7,11 @@ + #include "pqueue.h" + + #ifdef DEBUG_PQUEUE +-#define DEBUG_ON 1 ++#define DEBUG_CMD(_a) { _a } + #else +-#define DEBUG_ON 0 ++#define DEBUG_CMD(_a) + #endif + +-#define DEBUG_CMD(_a) if (DEBUG_ON) { _a } +- + #define MIN_CAPACITY 128 /* min allocated buffer for a packet */ + + static int pqueue_alloc (int seq, unsigned char *packet, int packlen, pqueue_t **new); diff --git a/net/pptpd/patches/002-makefile_fix.patch b/net/pptpd/patches/002-makefile_fix.patch new file mode 100644 index 0000000..554b0a1 --- /dev/null +++ b/net/pptpd/patches/002-makefile_fix.patch @@ -0,0 +1,11 @@ +--- pptpd-1.3.4.orig/plugins/Makefile 2006-08-03 04:02:01.000000000 +0200 ++++ pptpd-1.3.4/plugins/Makefile 2009-12-03 21:18:09.678467590 +0100 +@@ -18,7 +18,7 @@ all: $(PLUGINS) + %.so: %.c + $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^ $(LDADD) + +-LIBDIR ?= $(DESTDIR)$(prefix)/lib/pptpd ++LIBDIR = $(DESTDIR)$(prefix)/lib/pptpd + + install: $(PLUGINS) + $(INSTALL) -d $(LIBDIR) diff --git a/net/pptpd/patches/003-opt_flags.patch b/net/pptpd/patches/003-opt_flags.patch new file mode 100644 index 0000000..213fb03 --- /dev/null +++ b/net/pptpd/patches/003-opt_flags.patch @@ -0,0 +1,12 @@ +diff -ruN pptpd-1.3.0-old/Makefile.in pptpd-1.3.0-new/Makefile.in +--- pptpd-1.3.0-old/Makefile.in 2005-08-03 09:47:42.000000000 +0200 ++++ pptpd-1.3.0-new/Makefile.in 2006-10-27 18:22:00.000000000 +0200 +@@ -106,7 +106,7 @@ + AWK = @AWK@ + CC = @CC@ + CCDEPMODE = @CCDEPMODE@ +-CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' ++CFLAGS = $(COPTS) -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' + CPP = @CPP@ + CPPFLAGS = @CPPFLAGS@ + CYGPATH_W = @CYGPATH_W@ diff --git a/net/privoxy/Makefile b/net/privoxy/Makefile new file mode 100644 index 0000000..8539ed7 --- /dev/null +++ b/net/privoxy/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2006-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=privoxy +PKG_VERSION:=3.0.19 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-stable-src.tar.gz +PKG_SOURCE_URL:=@SF/ijbswa +PKG_MD5SUM:=57acc79059565cc42eda67982842785d + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-stable +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/privoxy + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + DEPENDS:=+libpcre +libpthread +zlib + TITLE:=web proxy with advanced filtering capabilities + URL:=http://www.privoxy.org/ +endef + +define Package/privoxy/description + Privoxy is a web proxy with advanced filtering capabilities for + protecting privacy, modifying web page content, managing cookies, + controlling access, and removing ads, banners, pop-ups and other + obnoxious Internet junk. Privoxy has a very flexible configuration + and can be customized to suit individual needs and tastes. Privoxy + has application for both stand-alone systems and multi-user networks. +endef + +CONFIGURE_ARGS += \ + --sysconfdir=/etc/privoxy \ + +MAKE_FLAGS := + +define Package/privoxy/conffiles +/etc/privoxy/config +endef + +define Package/privoxy/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/privoxy $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/privoxy + $(CP) $(PKG_INSTALL_DIR)/etc/privoxy/* $(1)/etc/privoxy/ + $(INSTALL_CONF) ./files/privoxy.config $(1)/etc/privoxy/config + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/privoxy.init $(1)/etc/init.d/privoxy +endef + +$(eval $(call BuildPackage,privoxy)) diff --git a/net/privoxy/files/privoxy.config b/net/privoxy/files/privoxy.config new file mode 100644 index 0000000..7f0b8af --- /dev/null +++ b/net/privoxy/files/privoxy.config @@ -0,0 +1,27 @@ +confdir /etc/privoxy +logdir /var/log +filterfile default.filter +logfile privoxy +actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on. +actionsfile default.action # Main actions file +#actionsfile user.action # User customizations +listen-address 127.0.0.1:8118 +toggle 1 +enable-remote-toggle 1 +enable-remote-http-toggle 0 +enable-edit-actions 1 +enforce-blocks 0 +buffer-limit 4096 +forwarded-connect-retries 0 +accept-intercepted-requests 0 +allow-cgi-request-crunching 0 +split-large-forms 0 +keep-alive-timeout 300 +socket-timeout 300 +permit-access 192.168.1.0/24 +debug 1 # show each GET/POST/CONNECT request +debug 4096 # Startup banner and warnings +debug 8192 # Errors - *we highly recommended enabling this* +#admin-address privoxy-admin@example.com +#proxy-info-url http://www.example.com/proxy-service.html + diff --git a/net/privoxy/files/privoxy.init b/net/privoxy/files/privoxy.init new file mode 100644 index 0000000..78c29b4 --- /dev/null +++ b/net/privoxy/files/privoxy.init @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=80 +STOP=80 + +SERVICE_USE_PID=1 + +start() { + service_start /usr/sbin/privoxy --pidfile /var/run/privoxy.pid \ + /etc/privoxy/config +} + +stop() { + service_stop /usr/sbin/privoxy +} diff --git a/net/proftpd/Makefile b/net/proftpd/Makefile new file mode 100644 index 0000000..a173b52 --- /dev/null +++ b/net/proftpd/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2009-2012 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:=proftpd +PKG_VERSION:=1.3.4b +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.proftpd.org/distrib/source +PKG_MD5SUM:=0871e0b93c9c3c88ca950b6d9a04aed2 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/proftpd + SUBMENU:=File Transfer + SECTION:=net + CATEGORY:=Network + TITLE:=ProFTPD FTP server + URL:=http://www.proftpd.org/ + MAINTAINER:=Cezary Jackiewicz +endef + +define Package/proftpd/conffiles +/etc/proftpd.conf +endef + +TARGET_CPPFLAGS += \ + -I$(LINUX_DIR)/include + +MAKE_FLAGS += \ + INSTALL_USER=$(shell id -u) \ + INSTALL_GROUP=$(shell id -g) + +CONFIGURE_ARGS += \ + --disable-cap \ + --enable-devel \ + ac_cv_header_curses_h=no \ + ac_cv_header_ncurses_h=no + +define Package/proftpd/install + $(INSTALL_DIR) $(1)/etc + $(if $(CONFIG_IPV6),,$(SED) 's/^UseIPv6/#UseIPv6/' $(PKG_INSTALL_DIR)/etc/proftpd.conf) + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/proftpd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/proftpd.init $(1)/etc/init.d/proftpd + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ftp{count,top,who} $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{ftpshut,proftpd} $(1)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/in.proftpd $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,proftpd)) diff --git a/net/proftpd/files/proftpd.init b/net/proftpd/files/proftpd.init new file mode 100644 index 0000000..b92dc38 --- /dev/null +++ b/net/proftpd/files/proftpd.init @@ -0,0 +1,41 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010 OpenWrt.org + +START=50 + +BIN=/usr/sbin/proftpd +HOME=/home/ftp +RUN_D=/var +PID_F=$RUN_D/proftpd.pid +RUN_USER=ftp +RUN_GROUP=$RUN_USER + +EXTRA_COMMANDS="suspend resume" +EXTRA_HELP=" suspend Suspend the service + resume Resume the service" + +start() { + [ -d $HOME ] || ( mkdir -p $HOME && chown $RUN_USER:$RUN_GROUP $HOME ) + + [ ! -f $PID_F ] && $BIN +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) +} + +reload() { + [ -f $PID_F ] && kill -HUP $(cat $PID_F) +} + +suspend() { + echo "Suspending NOW" + ftpshut now "Maintenance in progress" +} + +resume() { + [ -f /etc/shutmsg ] && { + echo "Allowing sessions again" + ftpshut -R > /dev/null + } +} diff --git a/net/proftpd/patches/001-automake-compat.patch b/net/proftpd/patches/001-automake-compat.patch new file mode 100644 index 0000000..df01bdf --- /dev/null +++ b/net/proftpd/patches/001-automake-compat.patch @@ -0,0 +1,145 @@ +--- a/configure.in ++++ b/configure.in +@@ -40,8 +40,8 @@ if test "$OSTYPE" = "$OSREL" ; then + platform="\"$ostype\"" + fi + +-AC_DEFINE_UNQUOTED(PR_BUILD_OPTS, "`echo "$ac_configure_args"`") +-AC_DEFINE_UNQUOTED(PR_PLATFORM, $platform) ++AC_DEFINE_UNQUOTED(PR_BUILD_OPTS, "`echo "$ac_configure_args"`", [.]) ++AC_DEFINE_UNQUOTED(PR_PLATFORM, $platform, [.]) + AC_SUBST(OSREL) + AC_SUBST(OSTYPE) + +@@ -278,7 +278,7 @@ AC_ARG_WITH(lastlog, + fi + + if test -n "$pr_lastlog_path" ; then +- AC_DEFINE_UNQUOTED(PR_LASTLOG_PATH, "`eval echo "$pr_lastlog_path"`") ++ AC_DEFINE_UNQUOTED(PR_LASTLOG_PATH, "`eval echo "$pr_lastlog_path"`", [.]) + fi + fi + ]) +@@ -657,15 +657,6 @@ AC_ARG_ENABLE(dso, + LIB_DEPS="libltdl" + MODULE_DEPS="libltdl" + AC_DEFINE(PR_USE_DSO, 1, [Define if using DSO support.]) +- +- dnl Run configure scripts in subdirectories +- LT_CONFIG_LTDL_DIR([lib/libltdl]) +- LTDL_INIT([convenience]) +- +- dnl Even though this macro is deprecated, we need to use it to +- dnl specifically tell ltdl that it is NOT to use any system directories, +- dnl and ONLY to use this bundled location. +- LTDL_CONVENIENCE([lib/libltdl]) + fi + ]) + +@@ -1029,9 +1020,9 @@ AC_ARG_ENABLE(scoreboard-updates, + [ + if test x"$enableval" = xyes || test x"$enableval" = xno ; then + AC_MSG_WARN(scoreboard updates defaulting to 10) +- AC_DEFINE_UNQUOTED(PR_TUNABLE_XFER_SCOREBOARD_UPDATES, 10) ++ AC_DEFINE_UNQUOTED(PR_TUNABLE_XFER_SCOREBOARD_UPDATES, 10, [.]) + else +- AC_DEFINE_UNQUOTED(PR_TUNABLE_XFER_SCOREBOARD_UPDATES, $enableval) ++ AC_DEFINE_UNQUOTED(PR_TUNABLE_XFER_SCOREBOARD_UPDATES, $enableval, [.]) + fi + ]) + +@@ -1267,13 +1258,13 @@ if test x"$force_shadow" != xno ; then + AC_DEFINE(PR_USE_SHADOW, 1, [Define if using shadow password support.]) + + AC_CHECK_MEMBER(struct spwd.sp_warn, +- [AC_DEFINE(HAVE_SPWD_SP_WARN)],, ++ [AC_DEFINE(HAVE_SPWD_SP_WARN, 1, [.])],, + [#include ]) + AC_CHECK_MEMBER(struct spwd.sp_inact, +- [AC_DEFINE(HAVE_SPWD_SP_INACT)],, ++ [AC_DEFINE(HAVE_SPWD_SP_INACT, 1, [.])],, + [#include ]) + AC_CHECK_MEMBER(struct spwd.sp_expire, +- [AC_DEFINE(HAVE_SPWD_SP_EXPIRE)],, ++ [AC_DEFINE(HAVE_SPWD_SP_EXPIRE, 1, [.])],, + [#include ]) + + fi ]) +@@ -2696,19 +2687,19 @@ pr_saved_exec_prefix="$exec_prefix" + test "x$prefix" = xNONE && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +-AC_DEFINE_UNQUOTED(PR_CONFIG_DIR, "`eval echo "${sysconfdir}"`") +-AC_DEFINE_UNQUOTED(PR_INCLUDE_DIR, "`eval echo "${includedir}"`") +-AC_DEFINE_UNQUOTED(PR_LIBEXEC_DIR, "`eval echo "${libexecdir}"`") ++AC_DEFINE_UNQUOTED(PR_CONFIG_DIR, "`eval echo "${sysconfdir}"`", [.]) ++AC_DEFINE_UNQUOTED(PR_INCLUDE_DIR, "`eval echo "${includedir}"`", [.]) ++AC_DEFINE_UNQUOTED(PR_LIBEXEC_DIR, "`eval echo "${libexecdir}"`", [.]) + + dnl We evaluate the string twice. Once to go from $datadir to $prefix/share, + dnl and once more to substitute in the $prefix value. What a pain. + locale_dir="`eval echo ${localedir}`" + locale_dir="`eval echo ${locale_dir}`" +-AC_DEFINE_UNQUOTED(PR_LOCALE_DIR, "`eval echo "${locale_dir}"`") ++AC_DEFINE_UNQUOTED(PR_LOCALE_DIR, "`eval echo "${locale_dir}"`", [.]) + +-AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}"`") +-AC_DEFINE_UNQUOTED(PR_CONFIG_FILE_PATH, "`eval echo "${sysconfdir}/proftpd.conf"`") +-AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/proftpd.pid"`") ++AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}"`", [.]) ++AC_DEFINE_UNQUOTED(PR_CONFIG_FILE_PATH, "`eval echo "${sysconfdir}/proftpd.conf"`", [.]) ++AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/proftpd.pid"`", [.]) + + prefix="$pr_saved_prefix" + exec_prefix="$pr_saved_exec_prefix" +@@ -2764,11 +2755,11 @@ if test "$OSTYPE" = "-DDARWIN6" -o "$OST + fi + + my_cflags="\"$CFLAGS\"" +-AC_DEFINE_UNQUOTED(PR_BUILD_CFLAGS, $my_cflags) ++AC_DEFINE_UNQUOTED(PR_BUILD_CFLAGS, $my_cflags, [.]) + my_ldflags="\"$LDFLAGS $LIBDIRS\"" +-AC_DEFINE_UNQUOTED(PR_BUILD_LDFLAGS, $my_ldflags) ++AC_DEFINE_UNQUOTED(PR_BUILD_LDFLAGS, $my_ldflags, [.]) + my_libs="\"$LIBRARIES $LIBS\"" +-AC_DEFINE_UNQUOTED(PR_BUILD_LIBS, $my_libs) ++AC_DEFINE_UNQUOTED(PR_BUILD_LIBS, $my_libs, [.]) + + dnl And finally, generate the appropriate Make* and config.h + AC_SUBST(ENABLE_NLS) +--- /dev/null ++++ b/acinclude.m4 +@@ -0,0 +1 @@ ++sinclude(m4/proftpd.m4) +--- /dev/null ++++ b/lib/libltdl/acinclude.m4 +@@ -0,0 +1,7 @@ ++sinclude(m4/argz.m4) ++sinclude(m4/libtool.m4) ++sinclude(m4/ltversion.m4) ++sinclude(m4/ltsugar.m4) ++sinclude(m4/ltoptions.m4) ++sinclude(m4/ltdl.m4) ++sinclude(m4/lt~obsolete.m4) +--- a/lib/libltdl/Makefile.am ++++ b/lib/libltdl/Makefile.am +@@ -50,19 +50,7 @@ AM_LDFLAGS += -no-undefined + LTDL_VERSION_INFO = -version-info 9:0:2 + + noinst_LTLIBRARIES += $(LT_DLLOADERS) +- +-if INSTALL_LTDL +-ltdlincludedir = $(includedir)/libltdl +-ltdlinclude_HEADERS = libltdl/lt_system.h \ +- libltdl/lt_error.h \ +- libltdl/lt_dlloader.h +-include_HEADERS += ltdl.h +-lib_LTLIBRARIES += libltdl.la +-endif +- +-if CONVENIENCE_LTDL + noinst_LTLIBRARIES += libltdlc.la +-endif + + libltdl_la_SOURCES = libltdl/lt__alloc.h \ + libltdl/lt__dirent.h \ diff --git a/net/proftpd/patches/002-mempcpy_def.patch b/net/proftpd/patches/002-mempcpy_def.patch new file mode 100644 index 0000000..d5aa346 --- /dev/null +++ b/net/proftpd/patches/002-mempcpy_def.patch @@ -0,0 +1,12 @@ +--- a/include/options.h ++++ b/include/options.h +@@ -238,3 +238,9 @@ + #endif + + #endif /* PR_OPTIONS_H */ ++ ++#ifndef _LIBC ++#ifndef __mempcpy ++#define __mempcpy mempcpy ++#endif ++#endif diff --git a/net/prosody/Makefile b/net/prosody/Makefile new file mode 100644 index 0000000..025a3e4 --- /dev/null +++ b/net/prosody/Makefile @@ -0,0 +1,87 @@ +# +# Copyright (C) 2009-2011 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:=prosody +PKG_VERSION:=0.6.2 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://prosody.im/downloads/source +PKG_MD5SUM:=5da59bc906419ad3b4faa21516a6ca18 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/prosody + SECTION:=net + CATEGORY:=Network + SUBMENU:=Instant Messaging + DEPENDS:=+luafilesystem +libidn +luaexpat +luasec + TITLE:=XMPP server + URL:=http://prosody.im/ +endef + +define Package/prosody/description + Prosody is an exciting new server for Jabber/XMPP + written in Lua. It aims to be easy to use, and light + on resources +endef + +define Package/prosody/conffiles +/etc/prosody/prosody.cfg.lua +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Configure + # this is *NOT* GNU autoconf stuff + (cd $(PKG_BUILD_DIR); ./configure \ + --prefix=/usr \ + --with-lua="$(STAGING_DIR)/host/bin" \ + --with-lua-include="$(STAGING_DIR)/usr/include" \ + --with-lua-lib="$(STAGING_DIR)/usr/lib" \ + --cflags="$(TARGET_CFLAGS)" \ + --datadir="/etc/prosody/data" \ + ) +endef + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -std=gnu99" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + PREFIX="/usr" \ + +define Package/prosody/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/prosody.init $(1)/etc/init.d/prosody + $(INSTALL_DIR) $(1)/etc/prosody + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/prosody/prosody.cfg.lua $(1)/etc/prosody/ + $(INSTALL_DIR) $(1)/etc/prosody/certs + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/prosody/certs/localhost.{cert,key} $(1)/etc/prosody/certs/ + $(INSTALL_DIR) $(1)/etc/prosody/data + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/prosody{,ctl} $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/prosody + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/prosody/prosody.version $(1)/usr/lib/prosody/ + $(INSTALL_DIR) $(1)/usr/lib/prosody/core + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/core/*.lua $(1)/usr/lib/prosody/core/ + $(INSTALL_DIR) $(1)/usr/lib/prosody/fallbacks + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/fallbacks/*.lua $(1)/usr/lib/prosody/fallbacks/ + $(INSTALL_DIR) $(1)/usr/lib/prosody/modules + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/modules/*.lua $(1)/usr/lib/prosody/modules/ + $(INSTALL_DIR) $(1)/usr/lib/prosody/modules/muc + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/modules/muc/*.lua $(1)/usr/lib/prosody/modules/muc/ + $(INSTALL_DIR) $(1)/usr/lib/prosody/net + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/net/*.lua $(1)/usr/lib/prosody/net/ + $(INSTALL_DIR) $(1)/usr/lib/prosody/util + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/util/*.lua $(1)/usr/lib/prosody/util/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/prosody/util/*.so $(1)/usr/lib/prosody/util/ +endef + +$(eval $(call BuildPackage,prosody)) diff --git a/net/prosody/files/prosody.init b/net/prosody/files/prosody.init new file mode 100644 index 0000000..af1614d --- /dev/null +++ b/net/prosody/files/prosody.init @@ -0,0 +1,41 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org + +START=99 + +EXTRA_COMMANDS="status" +EXTRA_HELP=" status Print the status of the service" + +BIN=/usr/bin/prosodyctl +LOG_D=/var/log/prosody +RUN_D=/var/run/prosody +PID_F=$RUN_D/prosody.pid +RUN_USER=prosody +RUN_GROUP=prosody + +start() { + user_exists prosody 54 || user_add prosody 54 + group_exists prosody 54 || group_add prosody 54 + [ -d /var/run/prosody ] || { + mkdir -m 0755 -p /var/run/prosody + chown prosody:prosody /var/run/prosody + } + [ -d /var/log/prosody ] || { + mkdir -m 0755 -p /var/log/prosody + chown prosody:prosody /var/log/prosody + } + + $BIN start +} + +stop() { + $BIN stop +} + +reload() { + [ -f $PID_F ] && kill -HUP $(cat $PID_F) +} + +status() { + $BIN status +} diff --git a/net/prosody/patches/001-conf.patch b/net/prosody/patches/001-conf.patch new file mode 100644 index 0000000..4b23f9a --- /dev/null +++ b/net/prosody/patches/001-conf.patch @@ -0,0 +1,37 @@ +--- a/prosody.cfg.lua.dist ++++ b/prosody.cfg.lua.dist +@@ -47,7 +47,7 @@ modules_enabled = { + "register"; -- Allow users to register on this server using a client and change passwords + + -- Other specific functionality +- --"posix"; -- POSIX functionality, sends server to background, enables syslog, etc. ++ "posix"; -- POSIX functionality, sends server to background, enables syslog, etc. + --"console"; -- Opens admin telnet interface on localhost port 5582 + --"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP" + --"httpserver"; -- Serve static files from a directory over HTTP +@@ -65,6 +65,9 @@ modules_disabled = { + -- Disable account creation by default, for security + -- For more information see http://prosody.im/doc/creating_accounts + allow_registration = false; ++ ++-- File to write pid in ++pidfile = "/var/run/prosody/prosody.pid"; + + -- These are the SSL/TLS-related settings. If you don't want + -- to use SSL/TLS, you may comment or remove this +@@ -73,6 +76,15 @@ ssl = { + certificate = "certs/localhost.cert"; + } + ++-- Errors to syslog ++-- All to /var/log/prosody/ ++log = { ++ { levels = { "error" }; to = "syslog"; }; ++ { levels = { "error" }; to = "file"; filename = "/var/log/prosody/prosody.err"; }; ++ -- Change "info" to "debug" for more verbose logging ++ { levels = { min = "info" }; to = "file"; filename = "/var/log/prosody/prosody.log"; }; ++} ++ + ----------- Virtual hosts ----------- + -- You need to add a VirtualHost entry for each domain you wish Prosody to serve. + -- Settings under each VirtualHost entry apply *only* to that host. diff --git a/net/psybnc/Makefile b/net/psybnc/Makefile new file mode 100644 index 0000000..f264971 --- /dev/null +++ b/net/psybnc/Makefile @@ -0,0 +1,68 @@ +# +# 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:=psybnc +PKG_VERSION:=2.3.2-7 +PKG_RELEASE:=2 + +PKG_SOURCE:=psyBNC-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.psybnc.at/download/beta/ +PKG_MD5SUM:=4b893a92f914813450e0921b2894ad6c + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/psybnc + SUBMENU:=Instant Messaging + SECTION:=net + CATEGORY:=Network + TITLE:=An IRC-Bouncer with many features + URL:=http://www.psybnc.at/ +endef + +define Package/psybnc/description + psyBNC is an easy-to-use, multi-user, permanent + IRC-Bouncer with many features. Some of its features + vhost- and relay support to connected bouncers and an + extensive online help system. Many other helpful + functions are included. +endef + +ifneq ($(SDK)$(CONFIG_BIG_ENDIAN),) + ENDIANESS:=1 +else + ENDIANESS:=0 +endif + +define Build/Compile + $(call Build/Compile/Default, \ + CFLAGS="$(TARGET_CFLAGS)" \ + HOSTCC="$(HOSTCC)" \ + all \ + ) +endef + +define Package/psybnc/conffiles +/etc/psybnc.conf +endef + +define Package/psybnc/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/psybnc.sh $(1)/usr/sbin/psybnc + $(INSTALL_DIR) $(1)/usr/share/psybnc + $(INSTALL_BIN) $(PKG_BUILD_DIR)/psybnc $(1)/usr/share/psybnc/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/psybnc.conf $(1)/usr/share/psybnc/ + $(INSTALL_DIR) $(1)/usr/share/psybnc/lang + $(INSTALL_DATA) $(PKG_BUILD_DIR)/lang/english.lng $(1)/usr/share/psybnc/lang/ + $(INSTALL_DIR) $(1)/etc/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/psybnc.conf $(1)/etc +endef + +$(eval $(call BuildPackage,psybnc)) diff --git a/net/psybnc/patches/001-makefile.patch b/net/psybnc/patches/001-makefile.patch new file mode 100644 index 0000000..2db9560 --- /dev/null +++ b/net/psybnc/patches/001-makefile.patch @@ -0,0 +1,59 @@ +--- psybnc/Makefile 2005-06-04 20:22:45.000000000 +0200 ++++ psybnc_patched/Makefile 2005-11-04 11:50:28.879157626 +0100 +@@ -1,16 +1,16 @@ +-CC = gcc ++HOSTCC = gcc + CCFLAGS = + + all: $(OBJS) + @echo Initializing bouncer compilation + @echo [*] Running Conversion Tool for older psyBNC Data. +- @$(CC) tools/convconf.c -o tools/convconf ++ @$(HOSTCC) tools/convconf.c -o tools/convconf + @tools/convconf + @echo [*] Running Autoconfig. +- @$(CC) -I. tools/autoconf.c -o tools/autoconf ++ @$(HOSTCC) -I. tools/autoconf.c -o tools/autoconf + @tools/autoconf + @echo [*] Compiling MakeSalt for Encryption.. +- @$(CC) -I. -o makesalt tools/makesalt.c ++ @$(HOSTCC) -I. -o makesalt tools/makesalt.c + @./makesalt + @echo [*] Compiling Bouncer.. + @make -f makefile.out +@@ -20,14 +20,14 @@ + menuconfig: + @echo Initializing Menu-Configuration + @echo [*] Running Conversion Tool for older psyBNC Data. +- @$(CC) tools/convconf.c -o tools/convconf ++ @$(HOSTCC) tools/convconf.c -o tools/convconf + @tools/convconf + @echo [*] Running Autoconfig. +- @$(CC) -I. tools/autoconf.c -o tools/autoconf ++ @$(HOSTCC) -I. tools/autoconf.c -o tools/autoconf + @tools/autoconf + @echo [*] Creating Menu, please wait. + @echo This needs the 'ncurses' library. If it is not available, menuconf wont work. If you are using 'curses', use make menuconfig-curses instead. +- @$(CC) menuconf/menuconf.c menuconf/inputbox.c menuconf/util.c menuconf/checklist.c menuconf/menubox.c menuconf/textbox.c src/snprintf.c -I. -lncurses -lm -o menuconf/menuconf 2>/dev/null ++ @$(HOSTCC) menuconf/menuconf.c menuconf/inputbox.c menuconf/util.c menuconf/checklist.c menuconf/menubox.c menuconf/textbox.c src/snprintf.c -I. -lncurses -lm -o menuconf/menuconf 2>/dev/null + @menuconf/menuconf + @clear + @echo Now compile psyBNC using make, if not yet compiled, or if Options were changed. +@@ -36,14 +36,14 @@ + menuconfig-curses: + @echo Initializing Menu-Configuration using Curses + @echo [*] Running Conversion Tool for older psyBNC Data. +- @$(CC) tools/convconf.c -o tools/convconf ++ @$(HOSTCC) tools/convconf.c -o tools/convconf + @tools/convconf + @echo [*] Running Autoconfig. +- @$(CC) -I. tools/autoconf.c -o tools/autoconf ++ @$(HOSTCC) -I. tools/autoconf.c -o tools/autoconf + @tools/autoconf + @echo [*] Creating Menu, please wait. + @echo This needs the 'curses' library. If it is not available, menuconf wont work. +- @$(CC) menuconf/menuconf.c menuconf/inputbox.c menuconf/util.c menuconf/checklist.c menuconf/menubox.c menuconf/textbox.c src/snprintf.c -DNONCURSES -I. -lcurses -lm -o menuconf/menuconf 2>/dev/null ++ @$(HOSTCC) menuconf/menuconf.c menuconf/inputbox.c menuconf/util.c menuconf/checklist.c menuconf/menubox.c menuconf/textbox.c src/snprintf.c -DNONCURSES -I. -lcurses -lm -o menuconf/menuconf 2>/dev/null + @menuconf/menuconf + @clear + @echo Now compile psyBNC using make, if not yet compiled, or if Options were changed. diff --git a/net/psybnc/patches/002-conf.patch b/net/psybnc/patches/002-conf.patch new file mode 100644 index 0000000..98e9ad5 --- /dev/null +++ b/net/psybnc/patches/002-conf.patch @@ -0,0 +1,14 @@ +diff -Naur psybnc/psybnc.conf psybnc_finish/psybnc.conf +--- psybnc/psybnc.conf 1970-01-01 01:00:00.000000000 +0100 ++++ psybnc_finish/psybnc.conf 2005-11-03 18:27:44.726264185 +0100 +@@ -0,0 +1,10 @@ ++PSYBNC.SYSTEM.PORT1=50001 ++PSYBNC.SYSTEM.ME=psybnc_mipsel ++PSYBNC.SYSTEM.HOST1=* ++PSYBNC.HOSTALLOWS.ENTRY0=*;* ++USER1.USER.NICK=change_me ++USER1.USER.USER=psybnc_admin ++USER1.USER.PASS=change_me ++USER1.USER.RIGHTS=1 ++USER1.USER.VLINK=0 ++USER1.USER.LOGIN=psybnc_admin diff --git a/net/psybnc/patches/003-psybnc.patch b/net/psybnc/patches/003-psybnc.patch new file mode 100644 index 0000000..32f2165 --- /dev/null +++ b/net/psybnc/patches/003-psybnc.patch @@ -0,0 +1,105 @@ +diff -ur psybnc/config.h psybnc_finish/config.h +--- psybnc/config.h 2005-06-04 20:22:45.000000000 +0200 ++++ psybnc_finish/config.h 2005-11-03 17:05:40.802998216 +0100 +@@ -1,40 +1,7 @@ +-/* $Id: config.h,v 1.2 2005/06/04 18:05:33 hisi Exp $ */ + /* + * Configuration file for psyBNC, created by menuconf + */ + +-/* Encryption */ +- +-#define CRYPT +- +-/* Encryption Type*/ +- +-#define BLOWFISH +- +-/* Allow Translation */ +- +-#define TRANSLATE +- +-/* Allow internal network */ +- +-#define INTNET +- +-/* Allow traffic logging */ +- +-#define TRAFFICLOG +- +-/* Allow linkage of bouncers */ +- +-#define LINKAGE +- +-/* Allow the dcc File-Functions */ +- +-#define DCCFILES +- +-/* Pipe dcc Chats */ +- +-#define DCCCHAT +- + /* Allow to add more users */ + + #define MULTIUSER +@@ -47,28 +14,27 @@ + + #define MAXCONN 99 + +-/* Allow the usage of scripts */ ++/* Use blocking DNS */ + +-#define SCRIPTING ++#define BLOCKDNS + + /* Allow multiple irc connections per user */ + + #define NETWORK + +-/* Allow Proxy Support */ ++/* The logging level */ + +-#define PROXYS ++#define LOGLEVEL 2 + +-/* The logging level */ ++/* The ctcp Version reply */ + +-#define LOGLEVEL 0 ++#define CTCPVERSION "psyBNC 2.3.2-7 running on mipsel, ported by piie visit www.linuX-gamers.net" + +-/* SSL-Security */ ++/* The Path to SSL */ + +-#define SSLSEC 2 ++#define SSLPATH "/tmp/" + +-/* Blocking DNS is preferred. Non Blocking DNS is experimental */ ++/* SSL-Security */ ++ ++#define SSLSEC 0 + +-#ifndef BLOCKDNS +-#define BLOCKDNS +-#endif +diff -ur psybnc/tools/autoconf.c psybnc_finish/tools/autoconf.c +--- psybnc/tools/autoconf.c 2005-06-04 20:22:45.000000000 +0200 ++++ psybnc_finish/tools/autoconf.c 2005-10-29 14:46:49.000000000 +0200 +@@ -425,7 +425,7 @@ + printf("Can't create makefile.out .. aborting\n"); + exit(0x1); + } +- fprintf(makefile,"CC = gcc\n"); ++ fprintf(makefile,"CC = mipsel-linux-gcc\n"); + fprintf(makefile,"SRC = src/\n"); + #ifdef BOUNDCHECK + fprintf(makefile,"CFLAGS = -O -fbounds-checking -fno-builtin\n"); +@@ -450,7 +450,7 @@ + fprintf(makefile,"\n"); + fprintf(makefile,"all: $(OBJS)\n"); + fprintf(makefile," $(CC) -o $(TARGET) $(CFLAGS) $(OBJS) $(LIBS)\n"); +- fprintf(makefile," @strip $(TARGET)\n"); ++ /*fprintf(makefile," @strip $(TARGET)\n");*/ + if(ssl==0) + { + if(!fexists("key/psybnc.cert.pem")) /* only create, if not exist */ diff --git a/net/psybnc/patches/004-start_script.patch b/net/psybnc/patches/004-start_script.patch new file mode 100644 index 0000000..635213d --- /dev/null +++ b/net/psybnc/patches/004-start_script.patch @@ -0,0 +1,16 @@ +diff -Naur psybnc/psybnc.sh psybnc_patched/psybnc.sh +--- psybnc/psybnc.sh 1970-01-01 01:00:00.000000000 +0100 ++++ psybnc_finish/psybnc.sh 2005-11-04 12:51:26.478557377 +0100 +@@ -0,0 +1,12 @@ ++#!/bin/sh ++ ++PDIR=$(pwd); ++cd /usr/share/psybnc; ++./psybnc "$@"; ++cd "$PDIR"; ++ ++echo; ++echo; ++echo "Configuration is located at /usr/share/psybnc/psybnc.conf"; ++echo "everything can be configured within your chatclient,"; ++echo "after logging in as psybnc_admin ( /bhelp shows bnc help )"; diff --git a/net/psybnc/patches/005-fix_endianess_detection.patch b/net/psybnc/patches/005-fix_endianess_detection.patch new file mode 100644 index 0000000..7783f84 --- /dev/null +++ b/net/psybnc/patches/005-fix_endianess_detection.patch @@ -0,0 +1,31 @@ +--- a/tools/autoconf.c ++++ b/tools/autoconf.c +@@ -222,6 +222,9 @@ + + int checkendian() + { ++#ifdef ENDIANESS ++ return ENDIANESS; ++#else + char xyz[]="\x01\x02\x03\x04"; + unsigned long *lp; + unsigned long result; +@@ -229,6 +232,7 @@ + result=*lp; + if(result==67305985) return 0x1; + return 0x0; ++#endif + } + + int main() +--- a/Makefile ++++ b/Makefile +@@ -7,7 +7,7 @@ + @$(HOSTCC) tools/convconf.c -o tools/convconf + @tools/convconf + @echo [*] Running Autoconfig. +- @$(HOSTCC) -I. tools/autoconf.c -o tools/autoconf ++ @$(HOSTCC) -I. -DENDIANESS=$(ENDIANESS) tools/autoconf.c -o tools/autoconf + @tools/autoconf + @echo [*] Compiling MakeSalt for Encryption.. + @$(HOSTCC) -I. -o makesalt tools/makesalt.c diff --git a/net/ptpd/Makefile b/net/ptpd/Makefile new file mode 100644 index 0000000..50a7682 --- /dev/null +++ b/net/ptpd/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2010-2011 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:=ptpd +PKG_VERSION:=2.1.0 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/ptpd +PKG_MD5SUM:=9748f031ed9ebb5c600de354dae53046 + +include $(INCLUDE_DIR)/package.mk + +MAKE_PATH:=src + +define Package/ptpd + SECTION:=net + CATEGORY:=Network + SUBMENU:=Time Synchronization + TITLE:=Precision Time Protocol (PTP) daemon + URL:=http://ptpd.sourceforge.net/ + DEPENDS:=+libpthread +librt +endef + +define Package/ptpd/description + The PTP daemon (PTPd) implements version 2 of the Precision Time Protocol (PTP) + as defined by the IEEE 1588-2008 standard. + PTP was developed to provide very precise time coordination of LAN connected + computers. +endef + +define Package/ptpd/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ptpd2 $(1)/usr/sbin/ptpd + $(INSTALL_BIN) ./files/ptpd.init $(1)/etc/init.d/ptpd +endef + +$(eval $(call BuildPackage,ptpd)) diff --git a/net/ptpd/files/ptpd.init b/net/ptpd/files/ptpd.init new file mode 100644 index 0000000..9cce55c --- /dev/null +++ b/net/ptpd/files/ptpd.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2011 OpenWrt.org + +START=50 + +start() { + service_start /usr/sbin/ptpd +} + +stop() { + service_stop /usr/sbin/ptpd +} diff --git a/net/ptunnel/Makefile b/net/ptunnel/Makefile new file mode 100644 index 0000000..d140d4a --- /dev/null +++ b/net/ptunnel/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2006-2012 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:=ptunnel +PKG_VERSION:=0.71 +PKG_RELEASE:=4 + +PKG_SOURCE:=PingTunnel-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.cs.uit.no/~daniels/PingTunnel +PKG_MD5SUM:=9b04771d4fa50abc15a6af690b81c71a + +PKG_BUILD_DIR:=$(BUILD_DIR)/PingTunnel + +include $(INCLUDE_DIR)/package.mk + +define Package/ptunnel + SECTION:=net + CATEGORY:=Network + SUBMENU:=Firewall Tunnel + DEPENDS:=+libpthread +libpcap + TITLE:=Tunnel TCP connections over ICMP packets + URL:=http://www.cs.uit.no/~daniels/PingTunnel/ +endef + +define Package/ptunnel/description + ptunnel is an application that allows you to reliably tunnel TCP connections to + a remote host using ICMP echo request and reply packets, commonly known as ping + requests and replies. It acts as a proxy and can handle sockets and secured + identification. +endef + +define Package/ptunnel/conffiles +/etc/config/ptunnel +endef + +# uses GNU configure + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -Wall -g -I$(STAGING_DIR)/usr/include" \ + LDOPTS="$(TARGET_LDFLAGS) -lpthread -lpcap" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/ptunnel/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ptunnel $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/ptunnel.init $(1)/etc/init.d/ptunnel + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/ptunnel.config $(1)/etc/config/ptunnel +endef + +$(eval $(call BuildPackage,ptunnel)) diff --git a/net/ptunnel/files/ptunnel.config b/net/ptunnel/files/ptunnel.config new file mode 100644 index 0000000..bfc7495 --- /dev/null +++ b/net/ptunnel/files/ptunnel.config @@ -0,0 +1,2 @@ +config ptunnel + option interface 'lan' diff --git a/net/ptunnel/files/ptunnel.init b/net/ptunnel/files/ptunnel.init new file mode 100644 index 0000000..3b10d41 --- /dev/null +++ b/net/ptunnel/files/ptunnel.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2012 OpenWrt.org + +START=70 + +start_instance() { + local section="$1" + + config_get interface "$section" interface + network_get_device ifname "$interface" || { + echo "${initscript}: Error: Interface '$interface' not found" 1>&2 + return 1 + } + + SERVICE_PID_FILE="/var/run/ptunnel.$ifname.pid" + service_start /usr/sbin/ptunnel -c "$ifname" -daemon $SERVICE_PID_FILE +} + +start() { + . /lib/functions/network.sh + + config_load 'ptunnel' + config_foreach start_instance 'ptunnel' + iptables -I OUTPUT 1 -p icmp -j ACCEPT 2>/dev/null +} + +stop() { + service_stop /usr/sbin/ptunnel + iptables -D OUTPUT -p icmp -j ACCEPT 2>/dev/null +} diff --git a/net/ptunnel/patches/001-prefix.patch b/net/ptunnel/patches/001-prefix.patch new file mode 100644 index 0000000..c640670 --- /dev/null +++ b/net/ptunnel/patches/001-prefix.patch @@ -0,0 +1,13 @@ +--- a/Makefile ++++ b/Makefile +@@ -12,8 +12,8 @@ WIN32_CFLAGS = -g -Wall -DWIN32 -I"c:\Pr + WIN32_LDOPTS = -lwpcap -lwsock32 -L"c:\Program Files\WpdPack\Lib" + WIN32_PT_OBJS = ptunnel.obj md5.obj + +-prefix = /usr +-bindir = $(prefix)/bin ++prefix = $(DESTDIR)/usr ++bindir = $(prefix)/sbin + mandir = $(prefix)/share/man/man8 + + all: ptunnel diff --git a/net/ptunnel/patches/002-no_selinux.patch b/net/ptunnel/patches/002-no_selinux.patch new file mode 100644 index 0000000..2dcf8c4 --- /dev/null +++ b/net/ptunnel/patches/002-no_selinux.patch @@ -0,0 +1,20 @@ +--- a/Makefile ++++ b/Makefile +@@ -32,7 +32,7 @@ install: ptunnel + install ./ptunnel.8 $(mandir)/ptunnel.8 + + ptunnel: $(PT_OBJS) +- $(CC) -o $@ $^ $(LDOPTS) `[ -e /usr/include/selinux/selinux.h ] && echo -lselinux` ++ $(CC) -o $@ $^ $(LDOPTS) + + ptunnel.exe: $(WIN32_PT_OBJS) + $(CC) -o $@ $^ $(WIN32_LDOPTS) +@@ -47,7 +47,7 @@ depend: .depend + $(CC) $(CFLAGS) -MM *.c > $@ + + %.o:%.c +- $(CC) $(CFLAGS) `[ -e /usr/include/selinux/selinux.h ] && echo -DHAVE_SELINUX` -c -o $@ $< ++ $(CC) $(CFLAGS) -c -o $@ $< + + %.obj:%.c + $(WIN32_CC) $(WIN32_CFLAGS) -c -o $@ $< diff --git a/net/pure-ftpd/Makefile b/net/pure-ftpd/Makefile new file mode 100644 index 0000000..07cf9e2 --- /dev/null +++ b/net/pure-ftpd/Makefile @@ -0,0 +1,92 @@ +# +# Copyright (C) 2007-2011 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:=pure-ftpd +PKG_VERSION:=1.0.32 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://download.pureftpd.org/pub/pure-ftpd/releases +PKG_MD5SUM:=065211a4319e2089bd16b44c003eb0f8 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/pure-ftpd/Default + SUBMENU:=File Transfer + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libelf + TITLE:=Secure FTP made easy! + URL:=http://www.pureftpd.org/project/pure-ftpd +endef + +define Package/pure-ftpd + $(call Package/pure-ftpd/Default) + TITLE+= (no TLS) + VARIANT:=notls +endef + +define Package/pure-ftpd-tls + $(call Package/pure-ftpd/Default) + TITLE+= (TLS) + VARIANT:=tls + DEPENDS+=+libopenssl +endef + +define Package/pure-ftpd/description + Pure-FTPd is a free (BSD), secure, production-quality and standard-conformant + FTP server. It doesn't provide useless bells and whistles, but focuses on + efficiency and ease of use. + It provides simple answers to common needs, plus unique useful features for + personal users as well as hosting providers. +endef + +Package/pure-ftpd-tls/description=$(Package/pure-ftpd/description) + +define Package/pure-ftpd/conffiles +/etc/config/pure-ftpd +endef + +Package/pure-ftpd-tls/conffiles=$(Package/pure-ftpd/conffiles) + +CONFIGURE_ARGS += \ + --with-everything \ + --with-virtualchroot \ + --without-capabilities \ + +ifeq ($(BUILD_VARIANT),tls) +CONFIGURE_ARGS += \ + --with-certfile=/etc/ssl/private/pure-ftpd.pem \ + --with-tls +endif + +define Package/pure-ftpd/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/pure-{pw,pwconvert,statsdecode} \ + $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ptracetest $(1)/usr/sbin/ + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/sbin/pure-{authd,ftpd,ftpwho,mrtginfo,quotacheck,uploadscript} \ + $(1)/usr/sbin/ +endef + +Package/pure-ftpd-tls/install=$(Package/pure-ftpd/install) + +$(eval $(call BuildPackage,pure-ftpd)) +$(eval $(call BuildPackage,pure-ftpd-tls)) diff --git a/net/pure-ftpd/files/pure-ftpd.config b/net/pure-ftpd/files/pure-ftpd.config new file mode 100644 index 0000000..69aa734 --- /dev/null +++ b/net/pure-ftpd/files/pure-ftpd.config @@ -0,0 +1,10 @@ +config pure-ftpd + option port '21' + option noanonymous '1' + option chrooteveryone '1' + option maxclientsperip '10' + option maxclientsnumber '4' + option peruserlimits '3:4' + option umask '133:022' + option authentication 'unix' + option enabled '0' diff --git a/net/pure-ftpd/files/pure-ftpd.init b/net/pure-ftpd/files/pure-ftpd.init new file mode 100644 index 0000000..9c9d332 --- /dev/null +++ b/net/pure-ftpd/files/pure-ftpd.init @@ -0,0 +1,107 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +# TODO: allow multiple instance to run with different pid-files + +# XXX: pure-ftpd changes it's name to 'pure-ftpd (SERVER) ...' +SERVICE_MATCH_EXEC= +SERVICE_MATCH_NAME=1 +SERVICE_USE_PID=1 + +append_bool() { + local section="$1" + local option="$2" + local value="$3" + local _val + config_get_bool _val "$section" "$option" '0' + [ "$_val" -gt 0 ] && append args "$3" +} + +append_string() { + local section="$1" + local option="$2" + local value="$3" + local _val + config_get _val "$section" "$option" + [ -n "$_val" ] && append args "$3 $_val" +} + +start_instance() { + local section="$1" + + config_get_bool enabled "$section" 'enabled' '1' + [ $enabled -gt 0 ] || return 1 + + args="" + append_string "$section" trustedgid "-a" + append_string "$section" syslogfacility "-f" + append_string "$section" fortunesfile "-F" + append_string "$section" maxidletime "-I" + append_string "$section" maxdiskusagepct "-k" + append_string "$section" limitrecursion "-L" + append_string "$section" anonymouscancreate "-M" + append_string "$section" maxload "-m" + append_string "$section" quota "-n" + append_string "$section" altlog "-O" + append_string "$section" passiveportrange "-p" + append_string "$section" forcepassiveip "-P" + append_string "$section" anonymousratio "-q" + append_string "$section" userratio "-Q" + append_string "$section" anonymousbandwidth "-t" + append_string "$section" userbandwidth "-T" + append_string "$section" minuid "-u" + append_string "$section" trustedip "-V" + append_string "$section" tls "-Y" + append_string "$section" tlsciphersuite "-J" + + append_bool "$section" uploadscript "-o" + append_bool "$section" natmode "-N" + append_bool "$section" autorename "-r" + append_bool "$section" nochmod "-R" + append_bool "$section" antiwarez "-s" + append_bool "$section" allowuserfxp "-w" + append_bool "$section" allowanonymousfxp "-W" + append_bool "$section" prohibitdotfileswrite "-x" + append_bool "$section" prohibitdotfilesread "-X" + append_bool "$section" allowdotfiles "-z" + append_bool "$section" customerproof "-Z" + append_bool "$section" anonymouscantupload "-i" + append_bool "$section" createhomedir "-j" + append_bool "$section" keepallfiles "-K" + append_bool "$section" norename "-G" + append_bool "$section" dontresolve "-H" + append_bool "$section" verboselog "-d" + append_bool "$section" displaydotfiles "-D" + append_bool "$section" anonymousonly "-e" + append_bool "$section" brokenclientscompatibility "-b" + append_bool "$section" notruncate "-0" + append_bool "$section" logpid "-1" + append_bool "$section" ipv4only "-4" + append_bool "$section" ipv6only "-6" + + append_string "$section" bind "-S" + append_string "$section" login "-l" + + append_bool "$section" noanonymous "-E" + append_bool "$section" chrooteveryone "-A" + append_string "$section" maxclientsperip "-c" + append_string "$section" maxclientsnumber "-C" + append_string "$section" peruserlimits "-y" + append_string "$section" umask "-U" + + append_string "$section" port "-S" + append_string "$section" authentication "-l" + + service_start /usr/sbin/pure-ftpd -B $args +} + +start() { + config_load "pure-ftpd" + config_foreach start_instance "pure-ftpd" +} + +stop() { + service_stop /usr/sbin/pure-ftpd +} diff --git a/net/pure-ftpd/patches/010-dont-add-host-paths.patch b/net/pure-ftpd/patches/010-dont-add-host-paths.patch new file mode 100644 index 0000000..42a9189 --- /dev/null +++ b/net/pure-ftpd/patches/010-dont-add-host-paths.patch @@ -0,0 +1,29 @@ +--- a/configure ++++ b/configure +@@ -4825,18 +4825,6 @@ fi + + + +-if test -d /usr/local/include; then +- CPPFLAGS="$CPPFLAGS -I/usr/local/include" +-fi +- +-if test -d /usr/kerberos/include; then +- CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" +-fi +- +-if test -d /usr/local/lib; then +- LDFLAGS="$LDFLAGS -L/usr/local/lib" +-fi +- + if uname | fgrep SunOS > /dev/null 2> /dev/null ; then + CPPFLAGS="$CPPFLAGS -D_XPG4_2=1" + fi +@@ -9222,7 +9210,6 @@ if test $ac_have_func = no; then + # There is a commonly available library for RS/6000 AIX. + # Since it is not a standard part of AIX, it might be installed locally. + ac_getloadavg_LIBS=$LIBS +- LIBS="-L/usr/local/lib $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lgetloadavg" >&5 + $as_echo_n "checking for getloadavg in -lgetloadavg... " >&6; } + if test "${ac_cv_lib_getloadavg_getloadavg+set}" = set; then : diff --git a/net/pyload/Makefile b/net/pyload/Makefile new file mode 100644 index 0000000..4a5d9e4 --- /dev/null +++ b/net/pyload/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2011 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:=pyload +PKG_VERSION:=0.4.8 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-src-v$(PKG_VERSION).zip +PKG_SOURCE_URL:=http://download.pyload.org/ +PKG_MD5SUM:=5bcf8411ef9e48ef6e9ade55bc697900 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/ + +include $(INCLUDE_DIR)/package.mk + +PKG_UNPACK=unzip -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE) + +define Package/pyload + SECTION:=net + CATEGORY:=Network + DEPENDS:=+python +pyopenssl +python-curl +python-crypto +python-django \ + +python-expat +python-imaging-library +python-sqlite3 +js \ + +tesseract +unrar + TITLE:=A fast, lightweight and full featured download manager + URL:=http://pyload.org +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/pyload/install + $(INSTALL_DIR) $(1)/usr/share/python + $(CP) $(PKG_BUILD_DIR)/pyload $(1)/usr/share/python/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/pyload.init $(1)/etc/init.d/pyload + $(INSTALL_DIR) $(1)/usr/bin + $(LN) ../share/python/pyload/pyLoadCore.py $(1)/usr/bin/pyload +endef + +$(eval $(call BuildPackage,pyload)) diff --git a/net/pyload/files/pyload.init b/net/pyload/files/pyload.init new file mode 100644 index 0000000..cd0e270 --- /dev/null +++ b/net/pyload/files/pyload.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2011 OpenWrt.org + +START=94 + +start() { + /usr/bin/python /usr/share/python/pyload/pyLoadCore.py --configdir=/etc/pyload --daemon +} + +stop() { + /usr/bin/python /usr/share/python/pyload/pyLoadCore.py --configdir=/etc/pyload --quit +} diff --git a/net/pyrit/Makefile b/net/pyrit/Makefile new file mode 100644 index 0000000..9385be6 --- /dev/null +++ b/net/pyrit/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2011 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:=pyrit +PKG_VERSION:=0.4.0 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=http://pyrit.googlecode.com/files +PKG_SOURCE:=pyrit-0.4.0.tar.gz +PKG_MD5SUM:=7258b6f3dacfb09736ddeed2a379df2d + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/pyrit + SECTION:=net + CATEGORY:=Network + DEPENDS:=+python +libopenssl +libpcap + TITLE:=A GPGPU-driven WPA/WPA2-PSK key cracker + URL:=http://code.google.com/p/pyrit/ +endef + +define Package/pyrit/description + A GPGPU-driven WPA/WPA2-PSK key cracker + Pyrit exploits the computational power of many-core- and GPGPU- + -platforms to create massive databases, pre-computing part of the + WPA/WPA2-PSK authentication phase in a space-time tradeoff. + It is a powerful attack against one of the world's most used security + protocols +endef + +define Build/Compile + $(call Build/Compile/PyMod,., \ + install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \ + ) +endef + +define Package/pyrit/install + $(INSTALL_DIR) $(1) + $(CP) $(PKG_INSTALL_DIR)/* $(1)/ +endef + +$(eval $(call BuildPackage,pyrit)) diff --git a/net/qolyester/Makefile b/net/qolyester/Makefile new file mode 100644 index 0000000..3b7f25f --- /dev/null +++ b/net/qolyester/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2007-2009 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:=qolyester +PKG_VERSION:=20090302 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://qolsr.lri.fr/code/ +PKG_MD5SUM:=650286fc2ea3e13c246d233aaa46f2a4 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/qolyester + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpthread +libstdcpp @!TARGET_avr32 @!powerpc + TITLE:=OLSR implementation with QoS + URL:=http://qolsr.lri.fr/code/ +endef + +define Package/qolyester/description + This is an implementation from scratch of the OLSR protocol. + It is written in the C++ programming language and its goals + are modularity, efficiency and conformance to RFC 3626 (OLSR). +endef + +# uses GNU configure + +define Package/qolyester/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/qolsrd $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,qolyester)) diff --git a/net/quagga/Makefile b/net/quagga/Makefile new file mode 100644 index 0000000..9474a9e --- /dev/null +++ b/net/quagga/Makefile @@ -0,0 +1,306 @@ +# +# Copyright (C) 2006-2012 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:=quagga +PKG_VERSION:=0.99.21 +PKG_RELEASE:=5 +PKG_MD5SUM:=99840adbe57047c90dfba6b6ed9aec7f + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.quagga.net/download/ \ + http://www.de.quagga.net/download/ \ + http://www.uk.quagga.net/download/ +PKG_CONFIG_DEPENDS:= \ + CONFIG_IPV6 \ + CONFIG_PACKAGE_quagga-watchquagga \ + CONFIG_PACKAGE_quagga-zebra \ + CONFIG_PACKAGE_quagga-libzebra \ + CONFIG_PACKAGE_quagga-libospf \ + CONFIG_PACKAGE_quagga-bgpd \ + CONFIG_PACKAGE_quagga-isisd \ + CONFIG_PACKAGE_quagga-ospf6d \ + CONFIG_PACKAGE_quagga-ripd \ + CONFIG_PACKAGE_quagga-ripngd \ + CONFIG_PACKAGE_quagga-babeld \ + CONFIG_PACKAGE_quagga-vtysh +PKG_BUILD_PARALLEL:=1 +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/quagga/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + DEPENDS:=quagga + TITLE:=The Quagga Software Routing Suite + URL:=http://www.quagga.net + MAINTAINER:=Vasilis Tsiligiannis +endef + +define Package/quagga + $(call Package/quagga/Default) + DEPENDS:=+librt + MENU:=1 +endef + +define Package/quagga/description + A routing software package that provides TCP/IP based routing services + with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2, + OSPFv3, BGP-4, and BGP-4+ +endef + +define Package/quagga-watchquagga + $(call Package/quagga/Default) + TITLE:=Quagga watchdog + DEPENDS+=+quagga-libzebra + DEFAULT:=y if PACKAGE_quagga +endef + +define Package/quagga-zebra + $(call Package/quagga/Default) + TITLE:=Zebra daemon + DEPENDS+=+quagga-libzebra + DEFAULT:=y if PACKAGE_quagga +endef + +define Package/quagga-libzebra + $(call Package/quagga/Default) + TITLE:=zebra library +endef + +define Package/quagga-libospf + $(call Package/quagga/Default) + TITLE:=OSPF library +endef + +define Package/quagga-bgpd + $(call Package/quagga/Default) + DEPENDS+=+quagga-libzebra + TITLE:=BGPv4, BGPv4+, BGPv4- routing engine +endef + +define Package/quagga-isisd + $(call Package/quagga/Default) + DEPENDS+=+quagga-libzebra + TITLE:=IS-IS routing engine +endef + +define Package/quagga-ospfd + $(call Package/quagga/Default) + DEPENDS+=+quagga-libospf +quagga-libzebra + TITLE:=OSPFv2 routing engine +endef + +define Package/quagga-ospf6d + $(call Package/quagga/Default) + DEPENDS+=+quagga-libospf +quagga-libzebra @IPV6 + TITLE:=OSPFv3 routing engine +endef + +define Package/quagga-ripd + $(call Package/quagga/Default) + DEPENDS+=+quagga-libzebra + TITLE:=RIP routing engine +endef + +define Package/quagga-ripngd + $(call Package/quagga/Default) + DEPENDS+=+quagga-libzebra @IPV6 + TITLE:=RIPNG routing engine +endef + +define Package/quagga-babeld + $(call Package/quagga/Default) + DEPENDS+=+quagga-libzebra @IPV6 + TITLE:=Babel routing engine +endef + +define Package/quagga-vtysh + $(call Package/quagga/Default) + DEPENDS+=+quagga-libzebra +libreadline +libncurses + TITLE:=integrated shell for Quagga routing software +endef + +define Package/quagga-zebra/conffiles +/etc/quagga/zebra.conf +endef + +define Package/quagga-bgpd/conffiles +/etc/quagga/bgpd.conf +endef + +define Package/quagga-isisd/conffiles +/etc/quagga/isisd.conf +endef + +define Package/quagga-ospfd/conffiles +/etc/quagga/ospfd.conf +endef + +define Package/quagga-ospf6d/conffiles +/etc/quagga/ospf6d.conf +endef + +define Package/quagga-ripd/conffiles +/etc/quagga/ripd.conf +endef + +define Package/quagga-ripngd/conffiles +/etc/quagga/ripngd.conf +endef + +define Package/quagga-babeld/conffiles +/etc/quagga/babeld.conf +endef + +ifneq ($(SDK),) +CONFIG_PACKAGE_quagga-libzebra:=m +CONFIG_PACKAGE_quagga-libospf:=m +CONFIG_PACKAGE_quagga-watchquagga:=m +CONFIG_PACKAGE_quagga-zebra:=m +CONFIG_PACKAGE_quagga-bgpd:=m +CONFIG_PACKAGE_quagga-isisd:=m +CONFIG_PACKAGE_quagga-ospf6d:=m +CONFIG_PACKAGE_quagga-ripd:=m +CONFIG_PACKAGE_quagga-ripngd:=m +CONFIG_PACKAGE_quagga-babeld:=m +CONFIG_PACKAGE_quagga-vtysh:=m +endif + +CONFIGURE_ARGS+= \ + --localstatedir=/var/run/quagga \ + --sysconfdir=/etc/quagga/ \ + --enable-shared \ + --disable-static \ + --enable-user=network \ + --enable-group=network \ + --enable-pie=no \ + --enable-multipath=8 \ + --disable-ospfclient \ + --disable-capabilities \ + --disable-doc \ + $(call autoconf_bool,CONFIG_PACKAGE_quagga-libzebra,zebra) \ + $(call autoconf_bool,CONFIG_PACKAGE_quagga-libospf,ospfd) \ + $(call autoconf_bool,CONFIG_PACKAGE_quagga-bgpd,bgpd) \ + $(call autoconf_bool,CONFIG_PACKAGE_quagga-isisd,isisd) \ + $(call autoconf_bool,CONFIG_PACKAGE_quagga-ospf6d,ospf6d) \ + $(call autoconf_bool,CONFIG_PACKAGE_quagga-ripd,ripd) \ + $(call autoconf_bool,CONFIG_PACKAGE_quagga-ripngd,ripngd) \ + $(call autoconf_bool,CONFIG_PACKAGE_quagga-babeld,babeld) \ + $(call autoconf_bool,CONFIG_PACKAGE_quagga-vtysh,vtysh) \ + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) -std=gnu99" + +define Package/quagga/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) ./files/quagga $(1)/usr/sbin/quagga.init + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/quagga.init $(1)/etc/init.d/quagga +endef + +define Package/quagga-watchquagga/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/watchquagga $(1)/usr/sbin/ +endef + +define Package/quagga-zebra/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zebra $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/quagga + chmod 0750 $(1)/etc/quagga + $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/zebra.conf +endef + +define Package/quagga-bgpd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bgpd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/quagga + chmod 0750 $(1)/etc/quagga + $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/bgpd.conf +endef + +define Package/quagga-isisd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/isisd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/quagga + chmod 0750 $(1)/etc/quagga + $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/isisd.conf +endef + +define Package/quagga-ospfd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/quagga + chmod 0750 $(1)/etc/quagga + $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospfd.conf +endef + +define Package/quagga-ospf6d/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospf6d $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/quagga + chmod 0750 $(1)/etc/quagga + $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospf6d.conf +endef + +define Package/quagga-ripd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/quagga + chmod 0750 $(1)/etc/quagga + $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripd.conf +endef + +define Package/quagga-ripngd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripngd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/quagga + chmod 0750 $(1)/etc/quagga + $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripngd.conf +endef + +define Package/quagga-babeld/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/babeld $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/quagga + chmod 0750 $(1)/etc/quagga + $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/babeld.conf +endef + +define Package/quagga-vtysh/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/ +endef + +define Package/quagga-libospf/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(1)/usr/lib/ +endef + +define Package/quagga-libzebra/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,quagga)) +$(eval $(call BuildPackage,quagga-libzebra)) +$(eval $(call BuildPackage,quagga-libospf)) +$(eval $(call BuildPackage,quagga-watchquagga)) +$(eval $(call BuildPackage,quagga-zebra)) +$(eval $(call BuildPackage,quagga-bgpd)) +$(eval $(call BuildPackage,quagga-isisd)) +$(eval $(call BuildPackage,quagga-ospfd)) +$(eval $(call BuildPackage,quagga-ospf6d)) +$(eval $(call BuildPackage,quagga-ripd)) +$(eval $(call BuildPackage,quagga-ripngd)) +$(eval $(call BuildPackage,quagga-babeld)) +$(eval $(call BuildPackage,quagga-vtysh)) diff --git a/net/quagga/files/quagga b/net/quagga/files/quagga new file mode 100644 index 0000000..b172090 --- /dev/null +++ b/net/quagga/files/quagga @@ -0,0 +1,335 @@ +#!/bin/sh +# +# quagga Starts/stops quagga daemons and watchquagga. +# Create a daemon.conf file to have that routing daemon +# started/stopped automagically when using this script +# without any daemon names as args. +# If watchquagga is available, it will also be +# started/stopped if the script is called without +# any daemon names. +# + +ME=$(basename $0) + +usage() { + echo "Usage: ${ME} {start|stop|restart} [daemon ...]" + exit 2 +} + +if [ -z "$1" ] +then + usage +else + COMMAND=$1 +fi +shift +ARG_DAEMONS=$* +BINDIR=/usr/sbin +CONFDIR=/etc/quagga +STATEDIR=/var/run/quagga +RUNUSER=network +RUNGROUP=$RUNUSER +DAEMONS="zebra ripd ripngd ospfd ospf6d bgpd" +DAEMON_FLAGS=-d +WATCHQUAGGA_FLAGS="-d -z -T 60 -R" +WATCHQUAGGA_CMD="$0 watchrestart" +if [ ${COMMAND} != "watchrestart" -a -x "${BINDIR}/watchquagga" ] +then + DAEMONS="${DAEMONS} watchquagga" +fi +DAEMONS_STARTSEQ=${DAEMONS} + +reverse() +{ + local revlist r + revlist= + for r + do + revlist="$r $revlist" + done + echo $revlist +} + +DAEMONS_STOPSEQ=$(reverse ${DAEMONS_STARTSEQ}) + +#pidof() { +# ps ax | awk 'match($5, "(^|/)'"$1"'$") > 0 { printf " %s", $1 }' +#} + +quit() { + echo "${ME}: $1" + exit 0 +} + +die() { + echo "${ME}: $1" + exit 1 +} + +is_in() { + local i + for i in $2 + do + [ "$1" = "$i" ] && return 0 + done + return 1 +} + +select_subset() { + local unknown i j + unknown= + RESULT= + for i in $1 + do + is_in $i "$2" || unknown="$unknown $i" + done + if [ -n "$unknown" ] + then + RESULT=$unknown + return 1 + else + for j in $2 + do + is_in $j "$1" && RESULT="$RESULT $j" + done + return 0 + fi +} + +# check command + +case ${COMMAND} +in + start|stop|restart) + ;; + watchrestart) + if [ -n "$ARG_DAEMONS" ] + then + echo "${ME}: watchrestart mode is only for use by watchquagga" + exit 2 + fi + ;; + *) + usage + ;; +esac + +# select daemons to start + +case ${COMMAND} +in + start|restart|watchrestart) + START_DAEMONS= + for d in ${DAEMONS_STARTSEQ} + do + [ -x "${BINDIR}/${d}" -a -f "${CONFDIR}/${d}.conf" ] \ + && START_DAEMONS="${START_DAEMONS}${d} " + done + WATCHQUAGGA_DAEMONS=${START_DAEMONS} + if is_in watchquagga "${DAEMONS_STARTSEQ}" + then + START_DAEMONS="${START_DAEMONS} watchquagga" + fi + if [ -n "${ARG_DAEMONS}" ] + then + if select_subset "${ARG_DAEMONS}" "${DAEMONS}" + then + if select_subset "${ARG_DAEMONS}" "${START_DAEMONS}" + then + START_DAEMONS=${RESULT} + else + die "these daemons are not startable:${RESULT}." + fi + else + die "unknown daemons:${RESULT}; choose from: ${DAEMONS}." + fi + fi + ;; +esac + +# select daemons to stop + +case ${COMMAND} +in + stop|restart|watchrestart) + STOP_DAEMONS=${DAEMONS_STOPSEQ} + if [ -n "${ARG_DAEMONS}" ] + then + if select_subset "${ARG_DAEMONS}" "${STOP_DAEMONS}" + then + STOP_DAEMONS=${RESULT} + else + die "unknown daemons:${RESULT}; choose from: ${DAEMONS}." + fi + fi + stop_daemons= + for d in ${STOP_DAEMONS} + do + pidfile=${STATEDIR}/${d}.pid + if [ -f "${pidfile}" -o -n "$(pidof ${d})" ] + then + stop_daemons="${stop_daemons}${d} " + elif [ -n "${ARG_DAEMONS}" ] + then + echo "${ME}: found no ${d} process running." + fi + done + STOP_DAEMONS=${stop_daemons} + ;; +esac + +# stop daemons + +for d in $STOP_DAEMONS +do + echo -n "${ME}: Stopping ${d} ... " + pidfile=${STATEDIR}/${d}.pid + if [ -f "${pidfile}" ] + then + file_pid=$(cat ${pidfile}) + if [ -z "${file_pid}" ] + then + echo -n "no pid file entry found ... " + fi + else + file_pid= + echo -n "no pid file found ... " + fi + proc_pid=$(pidof ${d}) + if [ -z "${proc_pid}" ] + then + echo -n "found no ${d} process running ... " + else + count=0 + notinpidfile= + for p in ${proc_pid} + do + count=$((${count}+1)) + if kill ${p} + then + echo -n "killed ${p} ... " + else + echo -n "failed to kill ${p} ... " + fi + [ "${p}" = "${file_pid}" ] \ + || notinpidfile="${notinpidfile} ${p}" + done + [ ${count} -le 1 ] \ + || echo -n "WARNING: ${count} ${d} processes were found running ... " + for n in ${notinpidfile} + do + echo -n "WARNING: process ${n} was not in pid file ... " + done + fi + count=0 + survivors=$(pidof ${d}) + while [ -n "${survivors}" ] + do + sleep 1 + count=$((${count}+1)) + survivors=$(pidof ${d}) + [ -z "${survivors}" -o ${count} -gt 5 ] && break + for p in ${survivors} + do + sleep 1 + echo -n "${p} " + kill ${p} + done + done + survivors=$(pidof ${d}) + [ -n "${survivors}" ] && \ + if kill -KILL ${survivors} + then + echo -n "KILLed ${survivors} ... " + else + echo -n "failed to KILL ${survivors} ... " + fi + sleep 1 + survivors=$(pidof ${d}) + if [ -z "${survivors}" ] + then + echo -n "done." + if [ -f "${pidfile}" ] + then + rm -f ${pidfile} \ + || echo -n " Failed to remove pidfile." + fi + else + echo -n "failed to stop ${survivors} - giving up." + if [ "${survivors}" != "${file_pid}" ] + then + if echo "${survivors}" > ${pidfile} + then + chown ${RUNUSER}:${RUNGROUP} ${pidfile} + echo -n " Wrote ${survivors} to pidfile." + else + echo -n " Failed to write ${survivors} to pidfile." + fi + fi + fi + echo +done + +# start daemons + +if [ -n "$START_DAEMONS" ] +then + [ -d ${CONFDIR} ] \ + || quit "${ME}: no config directory ${CONFDIR} - exiting." + chown -R ${RUNUSER}:${RUNGROUP} ${CONFDIR} + [ -d ${STATEDIR} ] || mkdir -p ${STATEDIR} \ + || die "${ME}: could not create state directory ${STATEDIR} - exiting." + chown -R ${RUNUSER}:${RUNGROUP} ${STATEDIR} + + for d in $START_DAEMONS + do + echo -n "${ME}: Starting ${d} ... " + proc_pid=$(pidof ${d}) + pidfile=${STATEDIR}/${d}.pid + file_pid= + if [ -f "${pidfile}" ] + then + file_pid=$(cat ${pidfile}) + if [ -n "${file_pid}" ] + then + echo -n "found old pid file entry ${file_pid} ... " + fi + fi + if [ -n "${proc_pid}" ] + then + echo -n "found ${d} running (${proc_pid}) - skipping ${d}." + if [ "${proc_pid}" != "${file_pid}" ] + then + if echo "${proc_pid}" > ${pidfile} + then + chown ${RUNUSER}:${RUNGROUP} ${pidfile} + echo -n " Wrote ${proc_pid} to pidfile." + else + echo -n " Failed to write ${proc_pid} to pidfile." + fi + fi + elif rm -f "${pidfile}" + then + if [ "${d}" = "watchquagga" ] + then + "${BINDIR}/${d}" \ + ${WATCHQUAGGA_FLAGS} \ + "${WATCHQUAGGA_CMD}" \ + ${WATCHQUAGGA_DAEMONS} + status=$? + else + "${BINDIR}/${d}" ${DAEMON_FLAGS} + status=$? + fi + if [ $status -eq 0 ] + then + echo -n "done." + else + echo -n "failed." + fi + else + echo -n " failed to remove pidfile." + fi + echo + done +fi diff --git a/net/quagga/files/quagga.conf b/net/quagga/files/quagga.conf new file mode 100644 index 0000000..fb7a54e --- /dev/null +++ b/net/quagga/files/quagga.conf @@ -0,0 +1,7 @@ +password zebra +! +access-list vty permit 127.0.0.0/8 +access-list vty deny any +! +line vty + access-class vty diff --git a/net/quagga/files/quagga.init b/net/quagga/files/quagga.init new file mode 100644 index 0000000..21fbf2c --- /dev/null +++ b/net/quagga/files/quagga.init @@ -0,0 +1,11 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +START=60 +start() { + /usr/sbin/quagga.init start +} + +stop() { + /usr/sbin/quagga.init stop +} diff --git a/net/quagga/patches/001-bgpd-fix-args-consolidation.patch b/net/quagga/patches/001-bgpd-fix-args-consolidation.patch new file mode 100644 index 0000000..30de1b5 --- /dev/null +++ b/net/quagga/patches/001-bgpd-fix-args-consolidation.patch @@ -0,0 +1,11 @@ +--- a/bgpd/bgp_attr.c ++++ b/bgpd/bgp_attr.c +@@ -1646,7 +1646,7 @@ bgp_attr_ext_communities (struct bgp_att + static bgp_attr_parse_ret_t + bgp_attr_unknown (struct bgp_attr_parser_args *args) + { +- bgp_size_t total; ++ bgp_size_t total = args->total; + struct transit *transit; + struct attr_extra *attre; + struct peer *const peer = args->peer; diff --git a/net/quagga/patches/002-fix-metric-output.patch b/net/quagga/patches/002-fix-metric-output.patch new file mode 100644 index 0000000..a92fc19 --- /dev/null +++ b/net/quagga/patches/002-fix-metric-output.patch @@ -0,0 +1,58 @@ +--- a/bgpd/bgp_debug.c ++++ b/bgpd/bgp_debug.c +@@ -194,11 +194,11 @@ bgp_dump_attr (struct peer *peer, struct + #endif /* HAVE_IPV6 */ + + if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_LOCAL_PREF))) +- snprintf (buf + strlen (buf), size - strlen (buf), ", localpref %d", ++ snprintf (buf + strlen (buf), size - strlen (buf), ", localpref %u", + attr->local_pref); + + if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC))) +- snprintf (buf + strlen (buf), size - strlen (buf), ", metric %d", ++ snprintf (buf + strlen (buf), size - strlen (buf), ", metric %u", + attr->med); + + if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_COMMUNITIES))) +--- a/bgpd/bgp_route.c ++++ b/bgpd/bgp_route.c +@@ -5954,7 +5954,7 @@ route_vty_out_detail (struct vty *vty, s + if (! CHECK_FLAG (binfo->flags, BGP_INFO_VALID)) + vty_out (vty, " (inaccessible)"); + else if (binfo->extra && binfo->extra->igpmetric) +- vty_out (vty, " (metric %d)", binfo->extra->igpmetric); ++ vty_out (vty, " (metric %u)", binfo->extra->igpmetric); + vty_out (vty, " from %s", sockunion2str (&binfo->peer->su, buf, SU_ADDRSTRLEN)); + if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID)) + vty_out (vty, " (%s)", inet_ntoa (attr->extra->originator_id)); +--- a/bgpd/bgp_vty.c ++++ b/bgpd/bgp_vty.c +@@ -8966,7 +8966,7 @@ bgp_config_write_redistribute (struct vt + vty_out (vty, " redistribute %s", zebra_route_string(i)); + + if (bgp->redist_metric_flag[afi][i]) +- vty_out (vty, " metric %d", bgp->redist_metric[afi][i]); ++ vty_out (vty, " metric %u", bgp->redist_metric[afi][i]); + + if (bgp->rmap[afi][i].name) + vty_out (vty, " route-map %s", bgp->rmap[afi][i].name); +--- a/zebra/zebra_vty.c ++++ b/zebra/zebra_vty.c +@@ -541,7 +541,7 @@ vty_show_ip_route_detail (struct vty *vt + inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen, + VTY_NEWLINE); + vty_out (vty, " Known via \"%s\"", zebra_route_string (rib->type)); +- vty_out (vty, ", distance %d, metric %d", rib->distance, rib->metric); ++ vty_out (vty, ", distance %u, metric %u", rib->distance, rib->metric); + if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED)) + vty_out (vty, ", best"); + if (rib->refcnt) +@@ -1519,7 +1519,7 @@ vty_show_ipv6_route_detail (struct vty * + rn->p.prefixlen, + VTY_NEWLINE); + vty_out (vty, " Known via \"%s\"", zebra_route_string (rib->type)); +- vty_out (vty, ", distance %d, metric %d", rib->distance, rib->metric); ++ vty_out (vty, ", distance %u, metric %u", rib->distance, rib->metric); + if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED)) + vty_out (vty, ", best"); + if (rib->refcnt) diff --git a/net/quagga/patches/003-bgpd-fix-route-map-match-peer-local.patch b/net/quagga/patches/003-bgpd-fix-route-map-match-peer-local.patch new file mode 100644 index 0000000..597ab73 --- /dev/null +++ b/net/quagga/patches/003-bgpd-fix-route-map-match-peer-local.patch @@ -0,0 +1,20 @@ +--- a/bgpd/bgp_routemap.c ++++ b/bgpd/bgp_routemap.c +@@ -172,7 +172,7 @@ route_match_peer_compile (const char *ar + + su = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (union sockunion)); + +- ret = str2sockunion ( (arg)? arg : "0.0.0.0", su); ++ ret = str2sockunion (strcmp(arg, "local") ? arg : "0.0.0.0", su); + if (ret < 0) { + XFREE (MTYPE_ROUTE_MAP_COMPILED, su); + return NULL; +@@ -2430,7 +2430,7 @@ DEFUN (match_peer_local, + "Match peer address\n" + "Static or Redistributed routes\n") + { +- return bgp_route_match_add (vty, vty->index, "peer", NULL); ++ return bgp_route_match_add (vty, vty->index, "peer", "local"); + } + + DEFUN (no_match_peer, diff --git a/net/quagga/patches/004-fix-sockunion-memleaks.patch b/net/quagga/patches/004-fix-sockunion-memleaks.patch new file mode 100644 index 0000000..92f0dfc --- /dev/null +++ b/net/quagga/patches/004-fix-sockunion-memleaks.patch @@ -0,0 +1,539 @@ +--- a/bgpd/bgp_routemap.c ++++ b/bgpd/bgp_routemap.c +@@ -111,7 +111,8 @@ route_match_peer (void *rule, struct pre + void *object) + { + union sockunion *su; +- union sockunion *su2; ++ union sockunion su_def = { .sa.sa_family = AF_INET, ++ .sin.sin_addr.s_addr = INADDR_ANY }; + struct peer_group *group; + struct peer *peer; + struct listnode *node, *nnode; +@@ -127,8 +128,7 @@ route_match_peer (void *rule, struct pre + + /* If su='0.0.0.0' (command 'match peer local'), and it's a NETWORK, + REDISTRIBUTE or DEFAULT_GENERATED route => return RMAP_MATCH */ +- su2 = sockunion_str2su ("0.0.0.0"); +- if ( sockunion_same (su, su2) ) ++ if (sockunion_same (su, &su_def)) + { + int ret; + if ( CHECK_FLAG (peer->rmap_type, PEER_RMAP_TYPE_NETWORK) || +@@ -137,12 +137,9 @@ route_match_peer (void *rule, struct pre + ret = RMAP_MATCH; + else + ret = RMAP_NOMATCH; +- +- sockunion_free (su2); + return ret; + } +- sockunion_free (su2); +- ++ + if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP)) + { + if (sockunion_same (su, &peer->su)) +@@ -878,7 +875,6 @@ route_set_ip_nexthop (void *rule, struct + route_map_object_t type, void *object) + { + struct rmap_ip_nexthop_set *rins = rule; +- struct in_addr peer_address; + struct bgp_info *bgp_info; + struct peer *peer; + +@@ -894,16 +890,14 @@ route_set_ip_nexthop (void *rule, struct + && peer->su_remote + && sockunion_family (peer->su_remote) == AF_INET) + { +- inet_aton (sockunion_su2str (peer->su_remote), &peer_address); +- bgp_info->attr->nexthop = peer_address; ++ bgp_info->attr->nexthop.s_addr = sockunion2ip (peer->su_remote); + bgp_info->attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_NEXT_HOP); + } + else if (CHECK_FLAG (peer->rmap_type, PEER_RMAP_TYPE_OUT) + && peer->su_local + && sockunion_family (peer->su_local) == AF_INET) + { +- inet_aton (sockunion_su2str (peer->su_local), &peer_address); +- bgp_info->attr->nexthop = peer_address; ++ bgp_info->attr->nexthop.s_addr = sockunion2ip (peer->su_local); + bgp_info->attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_NEXT_HOP); + } + } +--- a/lib/sockunion.h ++++ b/lib/sockunion.h +@@ -78,23 +78,17 @@ enum connect_result + #define SET_IN6_LINKLOCAL_IFINDEX(a, i) + #endif /* KAME */ + +-/* shortcut macro to specify address field of struct sockaddr */ +-#define sock2ip(X) (((struct sockaddr_in *)(X))->sin_addr.s_addr) +-#ifdef HAVE_IPV6 +-#define sock2ip6(X) (((struct sockaddr_in6 *)(X))->sin6_addr.s6_addr) +-#endif /* HAVE_IPV6 */ +- + #define sockunion_family(X) (X)->sa.sa_family + ++#define sockunion2ip(X) (X)->sin.sin_addr.s_addr ++ + /* Prototypes. */ + extern int str2sockunion (const char *, union sockunion *); + extern const char *sockunion2str (union sockunion *, char *, size_t); + extern int sockunion_cmp (union sockunion *, union sockunion *); + extern int sockunion_same (union sockunion *, union sockunion *); + +-extern char *sockunion_su2str (union sockunion *su); + extern union sockunion *sockunion_str2su (const char *str); +-extern struct in_addr sockunion_get_in_addr (union sockunion *su); + extern int sockunion_accept (int sock, union sockunion *); + extern int sockunion_stream_socket (union sockunion *); + extern int sockopt_reuseaddr (int); +--- a/bgpd/bgp_fsm.c ++++ b/bgpd/bgp_fsm.c +@@ -597,8 +597,6 @@ bgp_stop_with_error (struct peer *peer) + static int + bgp_connect_success (struct peer *peer) + { +- char buf1[BUFSIZ]; +- + if (peer->fd < 0) + { + zlog_err ("bgp_connect_success peer's fd is negative value %d", +@@ -612,6 +610,8 @@ bgp_connect_success (struct peer *peer) + + if (BGP_DEBUG (normal, NORMAL)) + { ++ char buf1[SU_ADDRSTRLEN]; ++ + if (! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER)) + zlog_debug ("%s open active, local address %s", peer->host, + sockunion2str (peer->su_local, buf1, SU_ADDRSTRLEN)); +--- a/bgpd/bgp_mplsvpn.c ++++ b/bgpd/bgp_mplsvpn.c +@@ -581,24 +581,25 @@ DEFUN (show_ip_bgp_vpnv4_all_neighbor_ro + "Neighbor to display information about\n" + "Display routes learned from neighbor\n") + { +- union sockunion *su; ++ union sockunion su; + struct peer *peer; +- +- su = sockunion_str2su (argv[0]); +- if (su == NULL) ++ int ret; ++ ++ ret = str2sockunion (argv[0], &su); ++ if (ret < 0) + { + vty_out (vty, "Malformed address: %s%s", argv[0], VTY_NEWLINE); +- return CMD_WARNING; ++ return CMD_WARNING; + } + +- peer = peer_lookup (NULL, su); ++ peer = peer_lookup (NULL, &su); + if (! peer || ! peer->afc[AFI_IP][SAFI_MPLS_VPN]) + { + vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE); + return CMD_WARNING; + } + +- return bgp_show_mpls_vpn (vty, NULL, bgp_show_type_neighbor, su, 0); ++ return bgp_show_mpls_vpn (vty, NULL, bgp_show_type_neighbor, &su, 0); + } + + DEFUN (show_ip_bgp_vpnv4_rd_neighbor_routes, +@@ -615,7 +616,7 @@ DEFUN (show_ip_bgp_vpnv4_rd_neighbor_rou + "Display routes learned from neighbor\n") + { + int ret; +- union sockunion *su; ++ union sockunion su; + struct peer *peer; + struct prefix_rd prd; + +@@ -626,21 +627,21 @@ DEFUN (show_ip_bgp_vpnv4_rd_neighbor_rou + return CMD_WARNING; + } + +- su = sockunion_str2su (argv[1]); +- if (su == NULL) ++ ret = str2sockunion (argv[1], &su); ++ if (ret < 0) + { + vty_out (vty, "Malformed address: %s%s", argv[0], VTY_NEWLINE); +- return CMD_WARNING; ++ return CMD_WARNING; + } + +- peer = peer_lookup (NULL, su); ++ peer = peer_lookup (NULL, &su); + if (! peer || ! peer->afc[AFI_IP][SAFI_MPLS_VPN]) + { + vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE); + return CMD_WARNING; + } + +- return bgp_show_mpls_vpn (vty, &prd, bgp_show_type_neighbor, su, 0); ++ return bgp_show_mpls_vpn (vty, &prd, bgp_show_type_neighbor, &su, 0); + } + + DEFUN (show_ip_bgp_vpnv4_all_neighbor_advertised_routes, +--- a/bgpd/bgp_network.c ++++ b/bgpd/bgp_network.c +@@ -185,7 +185,7 @@ bgp_accept (struct thread *thread) + zlog_debug ("[Event] Make dummy peer structure until read Open packet"); + + { +- char buf[SU_ADDRSTRLEN + 1]; ++ char buf[SU_ADDRSTRLEN]; + + peer = peer_create_accept (peer1->bgp); + SET_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER); +--- a/bgpd/bgp_route.c ++++ b/bgpd/bgp_route.c +@@ -10202,15 +10202,18 @@ DEFUN (show_ip_bgp_neighbor_received_pre + "Display the prefixlist filter\n") + { + char name[BUFSIZ]; +- union sockunion *su; ++ union sockunion su; + struct peer *peer; +- int count; ++ int count, ret; + +- su = sockunion_str2su (argv[0]); +- if (su == NULL) +- return CMD_WARNING; ++ ret = str2sockunion (argv[0], &su); ++ if (ret < 0) ++ { ++ vty_out (vty, "Malformed address: %s%s", argv[0], VTY_NEWLINE); ++ return CMD_WARNING; ++ } + +- peer = peer_lookup (NULL, su); ++ peer = peer_lookup (NULL, &su); + if (! peer) + return CMD_WARNING; + +@@ -10241,15 +10244,18 @@ DEFUN (show_ip_bgp_ipv4_neighbor_receive + "Display the prefixlist filter\n") + { + char name[BUFSIZ]; +- union sockunion *su; ++ union sockunion su; + struct peer *peer; +- int count; ++ int count, ret; + +- su = sockunion_str2su (argv[1]); +- if (su == NULL) +- return CMD_WARNING; ++ ret = str2sockunion (argv[1], &su); ++ if (ret < 0) ++ { ++ vty_out (vty, "Malformed address: %s%s", argv[1], VTY_NEWLINE); ++ return CMD_WARNING; ++ } + +- peer = peer_lookup (NULL, su); ++ peer = peer_lookup (NULL, &su); + if (! peer) + return CMD_WARNING; + +@@ -10312,15 +10318,18 @@ DEFUN (show_bgp_neighbor_received_prefix + "Display the prefixlist filter\n") + { + char name[BUFSIZ]; +- union sockunion *su; ++ union sockunion su; + struct peer *peer; +- int count; ++ int count, ret; + +- su = sockunion_str2su (argv[0]); +- if (su == NULL) +- return CMD_WARNING; ++ ret = str2sockunion (argv[0], &su); ++ if (ret < 0) ++ { ++ vty_out (vty, "Malformed address: %s%s", argv[0], VTY_NEWLINE); ++ return CMD_WARNING; ++ } + +- peer = peer_lookup (NULL, su); ++ peer = peer_lookup (NULL, &su); + if (! peer) + return CMD_WARNING; + +@@ -10394,10 +10403,10 @@ DEFUN (show_bgp_view_neighbor_received_p + "Display the prefixlist filter\n") + { + char name[BUFSIZ]; +- union sockunion *su; ++ union sockunion su; + struct peer *peer; + struct bgp *bgp; +- int count; ++ int count, ret; + + /* BGP structure lookup. */ + bgp = bgp_lookup_by_name (argv[0]); +@@ -10407,11 +10416,14 @@ DEFUN (show_bgp_view_neighbor_received_p + return CMD_WARNING; + } + +- su = sockunion_str2su (argv[1]); +- if (su == NULL) +- return CMD_WARNING; ++ ret = str2sockunion (argv[1], &su); ++ if (ret < 0) ++ { ++ vty_out (vty, "Malformed address: %s%s", argv[1], VTY_NEWLINE); ++ return CMD_WARNING; ++ } + +- peer = peer_lookup (bgp, su); ++ peer = peer_lookup (bgp, &su); + if (! peer) + return CMD_WARNING; + +--- a/bgpd/bgp_vty.c ++++ b/bgpd/bgp_vty.c +@@ -2943,7 +2943,6 @@ peer_update_source_vty (struct vty *vty, + const char *source_str) + { + struct peer *peer; +- union sockunion *su; + + peer = peer_and_group_lookup_vty (vty, peer_str); + if (! peer) +@@ -2951,12 +2950,11 @@ peer_update_source_vty (struct vty *vty, + + if (source_str) + { +- su = sockunion_str2su (source_str); +- if (su) +- { +- peer_update_source_addr_set (peer, su); +- sockunion_free (su); +- } ++ union sockunion su; ++ int ret = str2sockunion (source_str, &su); ++ ++ if (ret == 0) ++ peer_update_source_addr_set (peer, &su); + else + peer_update_source_if_set (peer, source_str); + } +--- a/lib/sockunion.c ++++ b/lib/sockunion.c +@@ -177,55 +177,15 @@ sockunion2str (union sockunion *su, char + union sockunion * + sockunion_str2su (const char *str) + { +- int ret; +- union sockunion *su; +- +- su = XCALLOC (MTYPE_SOCKUNION, sizeof (union sockunion)); +- +- ret = inet_pton (AF_INET, str, &su->sin.sin_addr); +- if (ret > 0) /* Valid IPv4 address format. */ +- { +- su->sin.sin_family = AF_INET; +-#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN +- su->sin.sin_len = sizeof(struct sockaddr_in); +-#endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ +- return su; +- } +-#ifdef HAVE_IPV6 +- ret = inet_pton (AF_INET6, str, &su->sin6.sin6_addr); +- if (ret > 0) /* Valid IPv6 address format. */ +- { +- su->sin6.sin6_family = AF_INET6; +-#ifdef SIN6_LEN +- su->sin6.sin6_len = sizeof(struct sockaddr_in6); +-#endif /* SIN6_LEN */ +- return su; +- } +-#endif /* HAVE_IPV6 */ +- ++ union sockunion *su = XCALLOC (MTYPE_SOCKUNION, sizeof (union sockunion)); ++ ++ if (!str2sockunion (str, su)) ++ return su; ++ + XFREE (MTYPE_SOCKUNION, su); + return NULL; + } + +-char * +-sockunion_su2str (union sockunion *su) +-{ +- char str[SU_ADDRSTRLEN]; +- +- switch (su->sa.sa_family) +- { +- case AF_INET: +- inet_ntop (AF_INET, &su->sin.sin_addr, str, sizeof (str)); +- break; +-#ifdef HAVE_IPV6 +- case AF_INET6: +- inet_ntop (AF_INET6, &su->sin6.sin6_addr, str, sizeof (str)); +- break; +-#endif /* HAVE_IPV6 */ +- } +- return XSTRDUP (MTYPE_TMP, str); +-} +- + /* Convert IPv4 compatible IPv6 address to IPv4 address. */ + static void + sockunion_normalise_mapped (union sockunion *su) +@@ -422,7 +382,7 @@ sockunion_bind (int sock, union sockunio + su->sin.sin_len = size; + #endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ + if (su_addr == NULL) +- su->sin.sin_addr.s_addr = htonl (INADDR_ANY); ++ sockunion2ip (su) = htonl (INADDR_ANY); + } + #ifdef HAVE_IPV6 + else if (su->sa.sa_family == AF_INET6) +@@ -779,9 +739,9 @@ sockunion_cmp (union sockunion *su1, uni + + if (su1->sa.sa_family == AF_INET) + { +- if (ntohl (su1->sin.sin_addr.s_addr) == ntohl (su2->sin.sin_addr.s_addr)) ++ if (ntohl (sockunion2ip (su1)) == ntohl (sockunion2ip (su2))) + return 0; +- if (ntohl (su1->sin.sin_addr.s_addr) > ntohl (su2->sin.sin_addr.s_addr)) ++ if (ntohl (sockunion2ip (su1)) > ntohl (sockunion2ip (su2))) + return 1; + else + return -1; +--- a/lib/vty.c ++++ b/lib/vty.c +@@ -1612,13 +1612,16 @@ vty_flush (struct thread *thread) + static struct vty * + vty_create (int vty_sock, union sockunion *su) + { ++ char buf[SU_ADDRSTRLEN]; + struct vty *vty; + ++ sockunion2str(su, buf, SU_ADDRSTRLEN); ++ + /* Allocate new vty structure and set up default values. */ + vty = vty_new (); + vty->fd = vty_sock; + vty->type = VTY_TERM; +- vty->address = sockunion_su2str (su); ++ strcpy (vty->address, buf); + if (no_password_check) + { + if (restricted_mode) +@@ -1693,7 +1696,7 @@ vty_accept (struct thread *thread) + int accept_sock; + struct prefix *p = NULL; + struct access_list *acl = NULL; +- char *bufp; ++ char buf[SU_ADDRSTRLEN]; + + accept_sock = THREAD_FD (thread); + +@@ -1719,10 +1722,8 @@ vty_accept (struct thread *thread) + if ((acl = access_list_lookup (AFI_IP, vty_accesslist_name)) && + (access_list_apply (acl, p) == FILTER_DENY)) + { +- char *buf; + zlog (NULL, LOG_INFO, "Vty connection refused from %s", +- (buf = sockunion_su2str (&su))); +- free (buf); ++ sockunion2str (&su, buf, SU_ADDRSTRLEN)); + close (vty_sock); + + /* continue accepting connections */ +@@ -1741,10 +1742,8 @@ vty_accept (struct thread *thread) + if ((acl = access_list_lookup (AFI_IP6, vty_ipv6_accesslist_name)) && + (access_list_apply (acl, p) == FILTER_DENY)) + { +- char *buf; + zlog (NULL, LOG_INFO, "Vty connection refused from %s", +- (buf = sockunion_su2str (&su))); +- free (buf); ++ sockunion2str (&su, buf, SU_ADDRSTRLEN)); + close (vty_sock); + + /* continue accepting connections */ +@@ -1767,9 +1766,7 @@ vty_accept (struct thread *thread) + safe_strerror (errno)); + + zlog (NULL, LOG_INFO, "Vty connection from %s", +- (bufp = sockunion_su2str (&su))); +- if (bufp) +- XFREE (MTYPE_TMP, bufp); ++ sockunion2str (&su, buf, SU_ADDRSTRLEN)); + + vty_create (vty_sock, &su); + +@@ -2193,8 +2190,6 @@ vty_close (struct vty *vty) + if (vty->fd > 0) + close (vty->fd); + +- if (vty->address) +- XFREE (MTYPE_TMP, vty->address); + if (vty->buf) + XFREE (MTYPE_VTY, vty->buf); + +--- a/lib/vty.h ++++ b/lib/vty.h +@@ -23,6 +23,7 @@ Software Foundation, Inc., 59 Temple Pla + + #include "thread.h" + #include "log.h" ++#include "sockunion.h" + + #define VTY_BUFSIZ 512 + #define VTY_MAXHIST 20 +@@ -39,9 +40,6 @@ struct vty + /* Node status of this vty */ + int node; + +- /* What address is this vty comming from. */ +- char *address; +- + /* Failure count */ + int fail; + +@@ -118,6 +116,9 @@ struct vty + /* Timeout seconds and thread. */ + unsigned long v_timeout; + struct thread *t_timeout; ++ ++ /* What address is this vty comming from. */ ++ char address[SU_ADDRSTRLEN]; + }; + + /* Integrated configuration file. */ +--- a/zebra/zebra_rib.c ++++ b/zebra/zebra_rib.c +@@ -678,8 +678,8 @@ rib_lookup_ipv4_route (struct prefix_ipv + if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)) + { + /* We are happy with either direct or recursive hexthop */ +- if (nexthop->gate.ipv4.s_addr == qgate->sin.sin_addr.s_addr || +- nexthop->rgate.ipv4.s_addr == qgate->sin.sin_addr.s_addr) ++ if (nexthop->gate.ipv4.s_addr == sockunion2ip (qgate) || ++ nexthop->rgate.ipv4.s_addr == sockunion2ip (qgate)) + return ZEBRA_RIB_FOUND_EXACT; + else + { +@@ -688,7 +688,7 @@ rib_lookup_ipv4_route (struct prefix_ipv + char gate_buf[INET_ADDRSTRLEN], rgate_buf[INET_ADDRSTRLEN], qgate_buf[INET_ADDRSTRLEN]; + inet_ntop (AF_INET, &nexthop->gate.ipv4.s_addr, gate_buf, INET_ADDRSTRLEN); + inet_ntop (AF_INET, &nexthop->rgate.ipv4.s_addr, rgate_buf, INET_ADDRSTRLEN); +- inet_ntop (AF_INET, &qgate->sin.sin_addr.s_addr, qgate_buf, INET_ADDRSTRLEN); ++ inet_ntop (AF_INET, &sockunion2ip (qgate), qgate_buf, INET_ADDRSTRLEN); + zlog_debug ("%s: qgate == %s, gate == %s, rgate == %s", __func__, qgate_buf, gate_buf, rgate_buf); + } + return ZEBRA_RIB_FOUND_NOGATE; diff --git a/net/quagga/patches/005-zebra-connected-in-mrib.patch b/net/quagga/patches/005-zebra-connected-in-mrib.patch new file mode 100644 index 0000000..6d0a868 --- /dev/null +++ b/net/quagga/patches/005-zebra-connected-in-mrib.patch @@ -0,0 +1,21 @@ +--- a/zebra/connected.c ++++ b/zebra/connected.c +@@ -191,6 +191,9 @@ connected_up_ipv4 (struct interface *ifp + rib_add_ipv4 (ZEBRA_ROUTE_CONNECT, 0, &p, NULL, NULL, ifp->ifindex, + RT_TABLE_MAIN, ifp->metric, 0, SAFI_UNICAST); + ++ rib_add_ipv4 (ZEBRA_ROUTE_CONNECT, 0, &p, NULL, NULL, ifp->ifindex, ++ RT_TABLE_MAIN, ifp->metric, 0, SAFI_MULTICAST); ++ + rib_update (); + } + +@@ -297,6 +300,8 @@ connected_down_ipv4 (struct interface *i + /* Same logic as for connected_up_ipv4(): push the changes into the head. */ + rib_delete_ipv4 (ZEBRA_ROUTE_CONNECT, 0, &p, NULL, ifp->ifindex, 0, SAFI_UNICAST); + ++ rib_delete_ipv4 (ZEBRA_ROUTE_CONNECT, 0, &p, NULL, ifp->ifindex, 0, SAFI_MULTICAST); ++ + rib_update (); + } + diff --git a/net/quagga/patches/006-fix-no-ipv6.patch b/net/quagga/patches/006-fix-no-ipv6.patch new file mode 100644 index 0000000..f39c453 --- /dev/null +++ b/net/quagga/patches/006-fix-no-ipv6.patch @@ -0,0 +1,127 @@ +--- a/zebra/main.c ++++ b/zebra/main.c +@@ -327,7 +327,9 @@ main (int argc, char **argv) + zebra_vty_init (); + access_list_init (); + prefix_list_init (); ++#ifdef RTADV + rtadv_init (); ++#endif + #ifdef HAVE_IRDP + irdp_init(); + #endif +--- a/zebra/rtadv.h ++++ b/zebra/rtadv.h +@@ -26,6 +26,9 @@ + #include "vty.h" + #include "zebra/interface.h" + ++/* NB: RTADV is defined in zebra/interface.h above */ ++#ifdef RTADV ++ + /* Router advertisement prefix. */ + struct rtadv_prefix + { +@@ -96,4 +99,6 @@ struct nd_opt_homeagent_info { /* Home + + extern const char *rtadv_pref_strs[]; + ++#endif /* RTADV */ ++ + #endif /* _ZEBRA_RTADV_H */ +--- a/zebra/zebra_vty.c ++++ b/zebra/zebra_vty.c +@@ -1197,6 +1197,40 @@ DEFUN (show_ip_protocol, + return CMD_SUCCESS; + } + ++/* ++ * Show IP mroute command to dump the BGP Multicast ++ * routing table ++ */ ++DEFUN (show_ip_mroute, ++ show_ip_mroute_cmd, ++ "show ip mroute", ++ SHOW_STR ++ IP_STR ++ "IP Multicast routing table\n") ++{ ++ struct route_table *table; ++ struct route_node *rn; ++ struct rib *rib; ++ int first = 1; ++ ++ table = vrf_table (AFI_IP, SAFI_MULTICAST, 0); ++ if (! table) ++ return CMD_SUCCESS; ++ ++ /* Show all IPv4 routes. */ ++ for (rn = route_top (table); rn; rn = route_next (rn)) ++ for (rib = rn->info; rib; rib = rib->next) ++ { ++ if (first) ++ { ++ vty_out (vty, SHOW_ROUTE_V4_HEADER); ++ first = 0; ++ } ++ vty_show_ip_route (vty, rn, rib); ++ } ++ return CMD_SUCCESS; ++} ++ + + #ifdef HAVE_IPV6 + /* General fucntion for IPv6 static route. */ +@@ -1952,40 +1986,6 @@ DEFUN (show_ipv6_route_summary, + } + + /* +- * Show IP mroute command to dump the BGP Multicast +- * routing table +- */ +-DEFUN (show_ip_mroute, +- show_ip_mroute_cmd, +- "show ip mroute", +- SHOW_STR +- IP_STR +- "IP Multicast routing table\n") +-{ +- struct route_table *table; +- struct route_node *rn; +- struct rib *rib; +- int first = 1; +- +- table = vrf_table (AFI_IP, SAFI_MULTICAST, 0); +- if (! table) +- return CMD_SUCCESS; +- +- /* Show all IPv4 routes. */ +- for (rn = route_top (table); rn; rn = route_next (rn)) +- for (rib = rn->info; rib; rib = rib->next) +- { +- if (first) +- { +- vty_out (vty, SHOW_ROUTE_V4_HEADER); +- first = 0; +- } +- vty_show_ip_route (vty, rn, rib); +- } +- return CMD_SUCCESS; +-} +- +-/* + * Show IPv6 mroute command.Used to dump + * the Multicast routing table. + */ +@@ -2020,11 +2020,6 @@ DEFUN (show_ipv6_mroute, + return CMD_SUCCESS; + } + +- +- +- +- +- + /* Write IPv6 static route configuration. */ + static int + static_config_ipv6 (struct vty *vty) diff --git a/net/quagga/patches/007-drop-heuristic-ipv6-recognition.patch b/net/quagga/patches/007-drop-heuristic-ipv6-recognition.patch new file mode 100644 index 0000000..1b49d7b --- /dev/null +++ b/net/quagga/patches/007-drop-heuristic-ipv6-recognition.patch @@ -0,0 +1,90 @@ +--- a/lib/command.c ++++ b/lib/command.c +@@ -868,86 +868,7 @@ cmd_ipv6_match (const char *str) + if (ret == 1) + return exact_match; + +- while (*str != '\0') +- { +- switch (state) +- { +- case STATE_START: +- if (*str == ':') +- { +- if (*(str + 1) != ':' && *(str + 1) != '\0') +- return no_match; +- colons--; +- state = STATE_COLON; +- } +- else +- { +- sp = str; +- state = STATE_ADDR; +- } +- +- continue; +- case STATE_COLON: +- colons++; +- if (*(str + 1) == ':') +- state = STATE_DOUBLE; +- else +- { +- sp = str + 1; +- state = STATE_ADDR; +- } +- break; +- case STATE_DOUBLE: +- if (double_colon) +- return no_match; +- +- if (*(str + 1) == ':') +- return no_match; +- else +- { +- if (*(str + 1) != '\0') +- colons++; +- sp = str + 1; +- state = STATE_ADDR; +- } +- +- double_colon++; +- nums++; +- break; +- case STATE_ADDR: +- if (*(str + 1) == ':' || *(str + 1) == '\0') +- { +- if (str - sp > 3) +- return no_match; +- +- nums++; +- state = STATE_COLON; +- } +- if (*(str + 1) == '.') +- state = STATE_DOT; +- break; +- case STATE_DOT: +- state = STATE_ADDR; +- break; +- default: +- break; +- } +- +- if (nums > 8) +- return no_match; +- +- if (colons > 7) +- return no_match; +- +- str++; +- } +- +-#if 0 +- if (nums < 11) +- return partly_match; +-#endif /* 0 */ +- +- return exact_match; ++ return no_match; + } + + static enum match_type diff --git a/net/quagga/patches/008-fix-thread_cancel_event.patch b/net/quagga/patches/008-fix-thread_cancel_event.patch new file mode 100644 index 0000000..3dcb9f5 --- /dev/null +++ b/net/quagga/patches/008-fix-thread_cancel_event.patch @@ -0,0 +1,27 @@ +--- a/lib/thread.c ++++ b/lib/thread.c +@@ -916,6 +916,24 @@ thread_cancel_event (struct thread_maste + thread_add_unuse (m, t); + } + } ++ ++ /* thread can be on the ready list too */ ++ thread = m->ready.head; ++ while (thread) ++ { ++ struct thread *t; ++ ++ t = thread; ++ thread = t->next; ++ ++ if (t->arg == arg) ++ { ++ ret++; ++ thread_list_delete (&m->ready, t); ++ t->type = THREAD_UNUSED; ++ thread_add_unuse (m, t); ++ } ++ } + return ret; + } + diff --git a/net/quagga/patches/009-bgpd-fix-vpn4-soft-reconfiguration.patch b/net/quagga/patches/009-bgpd-fix-vpn4-soft-reconfiguration.patch new file mode 100644 index 0000000..d8efa72 --- /dev/null +++ b/net/quagga/patches/009-bgpd-fix-vpn4-soft-reconfiguration.patch @@ -0,0 +1,89 @@ +--- a/bgpd/bgp_route.c ++++ b/bgpd/bgp_route.c +@@ -2616,7 +2616,7 @@ bgp_announce_route_all (struct peer *pee + + static void + bgp_soft_reconfig_table_rsclient (struct peer *rsclient, afi_t afi, +- safi_t safi, struct bgp_table *table) ++ safi_t safi, struct bgp_table *table, struct prefix_rd *prd) + { + struct bgp_node *rn; + struct bgp_adj_in *ain; +@@ -2627,8 +2627,11 @@ bgp_soft_reconfig_table_rsclient (struct + for (rn = bgp_table_top (table); rn; rn = bgp_route_next (rn)) + for (ain = rn->adj_in; ain; ain = ain->next) + { ++ struct bgp_info *ri = rn->info; ++ + bgp_update_rsclient (rsclient, afi, safi, ain->attr, ain->peer, +- &rn->p, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL, NULL); ++ &rn->p, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, prd, ++ (bgp_info_extra_get (ri))->tag); + } + } + +@@ -2639,18 +2642,25 @@ bgp_soft_reconfig_rsclient (struct peer + struct bgp_node *rn; + + if (safi != SAFI_MPLS_VPN) +- bgp_soft_reconfig_table_rsclient (rsclient, afi, safi, NULL); ++ bgp_soft_reconfig_table_rsclient (rsclient, afi, safi, NULL, NULL); + + else + for (rn = bgp_table_top (rsclient->bgp->rib[afi][safi]); rn; + rn = bgp_route_next (rn)) + if ((table = rn->info) != NULL) +- bgp_soft_reconfig_table_rsclient (rsclient, afi, safi, table); ++ { ++ struct prefix_rd prd; ++ prd.family = AF_UNSPEC; ++ prd.prefixlen = 64; ++ memcpy(&prd.val, rn->p.u.val, 8); ++ ++ bgp_soft_reconfig_table_rsclient (rsclient, afi, safi, table, &prd); ++ } + } + + static void + bgp_soft_reconfig_table (struct peer *peer, afi_t afi, safi_t safi, +- struct bgp_table *table) ++ struct bgp_table *table, struct prefix_rd *prd) + { + int ret; + struct bgp_node *rn; +@@ -2664,9 +2674,12 @@ bgp_soft_reconfig_table (struct peer *pe + { + if (ain->peer == peer) + { ++ struct bgp_info *ri = rn->info; ++ + ret = bgp_update (peer, &rn->p, ain->attr, afi, safi, + ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, +- NULL, NULL, 1); ++ prd, (bgp_info_extra_get (ri))->tag, 1); ++ + if (ret < 0) + { + bgp_unlock_node (rn); +@@ -2687,12 +2700,19 @@ bgp_soft_reconfig_in (struct peer *peer, + return; + + if (safi != SAFI_MPLS_VPN) +- bgp_soft_reconfig_table (peer, afi, safi, NULL); ++ bgp_soft_reconfig_table (peer, afi, safi, NULL, NULL); + else + for (rn = bgp_table_top (peer->bgp->rib[afi][safi]); rn; + rn = bgp_route_next (rn)) + if ((table = rn->info) != NULL) +- bgp_soft_reconfig_table (peer, afi, safi, table); ++ { ++ struct prefix_rd prd; ++ prd.family = AF_UNSPEC; ++ prd.prefixlen = 64; ++ memcpy(&prd.val, rn->p.u.val, 8); ++ ++ bgp_soft_reconfig_table (peer, afi, safi, table, &prd); ++ } + } + + diff --git a/net/quagga/patches/010-bgpd-fix-struct-attr_extra-leak.patch b/net/quagga/patches/010-bgpd-fix-struct-attr_extra-leak.patch new file mode 100644 index 0000000..8f824bf --- /dev/null +++ b/net/quagga/patches/010-bgpd-fix-struct-attr_extra-leak.patch @@ -0,0 +1,17 @@ +--- a/bgpd/bgp_route.c ++++ b/bgpd/bgp_route.c +@@ -2485,12 +2485,8 @@ bgp_default_originate (struct peer *peer + #ifdef HAVE_IPV6 + else if (afi == AFI_IP6) + { +- struct attr_extra *ae; +- attr.extra = NULL; +- +- ae = bgp_attr_extra_get (&attr); +- attr.extra = ae; +- ++ struct attr_extra *ae = attr.extra; ++ + str2prefix ("::/0", &p); + + /* IPv6 global nexthop must be included. */ diff --git a/net/quagga/patches/011-isisd-fix-typo.patch b/net/quagga/patches/011-isisd-fix-typo.patch new file mode 100644 index 0000000..142c8af --- /dev/null +++ b/net/quagga/patches/011-isisd-fix-typo.patch @@ -0,0 +1,11 @@ +--- a/isisd/isis_lsp.c ++++ b/isisd/isis_lsp.c +@@ -2413,7 +2413,7 @@ top_lsp_refresh (struct thread *thread) + isis_dynhn_insert (lsp->lsp_header->lsp_id, lsp->tlv_data.hostname, + IS_LEVEL_1); + +- lsp->lsp_header->lsp_bits = lsp_bits_generate (level, ++ lsp->lsp_header->lsp_bits = lsp_bits_generate (lsp->level, + lsp->area->overload_bit); + rem_lifetime = lsp_rem_lifetime (lsp->area, IS_LEVEL_1); + lsp->lsp_header->rem_lifetime = htons (rem_lifetime); diff --git a/net/quagga/patches/110-fix_ipctl_forwarding.patch b/net/quagga/patches/110-fix_ipctl_forwarding.patch new file mode 100644 index 0000000..d757312 --- /dev/null +++ b/net/quagga/patches/110-fix_ipctl_forwarding.patch @@ -0,0 +1,25 @@ +Add definitions for IPCTL_FORWARDING and IP6CTL_FORWARDING. + +Inspired from +http://svn.gnumonks.org/trunk/grouter/build/src/quagga/quagga/quagga-0.99.1-forward_sysctl-2.6.14.patch + +Signed-off-by: Thomas Petazzoni + +--- a/zebra/ipforward_sysctl.c ++++ b/zebra/ipforward_sysctl.c +@@ -31,6 +31,15 @@ + + #define MIB_SIZ 4 + ++/* Fix for recent (2.6.14) kernel headers */ ++#ifndef IPCTL_FORWARDING ++#define IPCTL_FORWARDING NET_IPV4_FORWARD ++#endif ++ ++#ifndef IP6CTL_FORWARDING ++#define IP6CTL_FORWARDING NET_IPV6_FORWARDING ++#endif ++ + extern struct zebra_privs_t zserv_privs; + + /* IPv4 forwarding control MIB. */ diff --git a/net/quagga/patches/120-quagga_manet.patch b/net/quagga/patches/120-quagga_manet.patch new file mode 100644 index 0000000..99e3cc7 --- /dev/null +++ b/net/quagga/patches/120-quagga_manet.patch @@ -0,0 +1,243 @@ +--- a/lib/log.c ++++ b/lib/log.c +@@ -929,13 +929,19 @@ proto_redistnum(int afi, const char *s) + return ZEBRA_ROUTE_STATIC; + else if (strncmp (s, "r", 1) == 0) + return ZEBRA_ROUTE_RIP; +- else if (strncmp (s, "o", 1) == 0) ++ else if (strncmp (s, "os", 2) == 0) + return ZEBRA_ROUTE_OSPF; + else if (strncmp (s, "i", 1) == 0) + return ZEBRA_ROUTE_ISIS; + else if (strncmp (s, "bg", 2) == 0) + return ZEBRA_ROUTE_BGP; +- else if (strncmp (s, "ba", 2) == 0) ++ else if (strncmp (s, "h", 1) == 0) ++ return ZEBRA_ROUTE_HSLS; ++ else if (strncmp (s, "ol", 2) == 0) ++ return ZEBRA_ROUTE_OLSR; ++ else if (strncmp (s, "bat", 3) == 0) ++ return ZEBRA_ROUTE_BATMAN; ++ else if (strncmp (s, "bab", 3) == 0) + return ZEBRA_ROUTE_BABEL; + } + if (afi == AFI_IP6) +@@ -948,13 +954,19 @@ proto_redistnum(int afi, const char *s) + return ZEBRA_ROUTE_STATIC; + else if (strncmp (s, "r", 1) == 0) + return ZEBRA_ROUTE_RIPNG; +- else if (strncmp (s, "o", 1) == 0) ++ else if (strncmp (s, "os", 2) == 0) + return ZEBRA_ROUTE_OSPF6; + else if (strncmp (s, "i", 1) == 0) + return ZEBRA_ROUTE_ISIS; + else if (strncmp (s, "bg", 2) == 0) + return ZEBRA_ROUTE_BGP; +- else if (strncmp (s, "ba", 2) == 0) ++ else if (strncmp (s, "h", 1) == 0) ++ return ZEBRA_ROUTE_HSLS; ++ else if (strncmp (s, "ol", 2) == 0) ++ return ZEBRA_ROUTE_OLSR; ++ else if (strncmp (s, "bat", 3) == 0) ++ return ZEBRA_ROUTE_BATMAN; ++ else if (strncmp (s, "bab", 3) == 0) + return ZEBRA_ROUTE_BABEL; + } + return -1; +--- a/lib/route_types.txt ++++ b/lib/route_types.txt +@@ -51,13 +51,9 @@ ZEBRA_ROUTE_OSPF, ospf, ospfd + ZEBRA_ROUTE_OSPF6, ospf6, ospf6d, 'O', 0, 1, "OSPFv6" + ZEBRA_ROUTE_ISIS, isis, isisd, 'I', 1, 1, "IS-IS" + ZEBRA_ROUTE_BGP, bgp, bgpd, 'B', 1, 1, "BGP" +-# HSLS and OLSR both are AFI independent (so: 1, 1), however +-# we want to disable for them for general Quagga distribution. +-# This at least makes it trivial for users of these protocols +-# to 'switch on' redist support (direct numeric entry remaining +-# possible). +-ZEBRA_ROUTE_HSLS, hsls, hslsd, 'H', 0, 0, "HSLS" +-ZEBRA_ROUTE_OLSR, olsr, olsrd, 'o', 0, 0, "OLSR" ++ZEBRA_ROUTE_HSLS, hsls, hslsd, 'H', 1, 1, "HSLS" ++ZEBRA_ROUTE_OLSR, olsr, olsrd, 'o', 1, 1, "OLSR" ++ZEBRA_ROUTE_BATMAN, batman, batmand,'b', 1, 1, "BATMAN" + ZEBRA_ROUTE_BABEL, babel, babeld, 'A', 1, 1, "Babel" + + ## help strings +@@ -72,5 +68,6 @@ ZEBRA_ROUTE_OSPF6, "Open Shortest Path + ZEBRA_ROUTE_ISIS, "Intermediate System to Intermediate System (IS-IS)" + ZEBRA_ROUTE_BGP, "Border Gateway Protocol (BGP)" + ZEBRA_ROUTE_HSLS, "Hazy-Sighted Link State Protocol (HSLS)" +-ZEBRA_ROUTE_OLSR, "Optimised Link State Routing (OLSR)" ++ZEBRA_ROUTE_OLSR, "Optimized Link State Routing (OLSR)" ++ZEBRA_ROUTE_BATMAN, "Better Approach to Mobile Ad-Hoc Networking (BATMAN)" + ZEBRA_ROUTE_BABEL, "Babel routing protocol (Babel)" +--- a/ripd/rip_zebra.c ++++ b/ripd/rip_zebra.c +@@ -206,9 +206,12 @@ static struct { + {ZEBRA_ROUTE_KERNEL, 1, "kernel"}, + {ZEBRA_ROUTE_CONNECT, 1, "connected"}, + {ZEBRA_ROUTE_STATIC, 1, "static"}, +- {ZEBRA_ROUTE_OSPF, 1, "ospf"}, ++ {ZEBRA_ROUTE_OSPF, 2, "ospf"}, + {ZEBRA_ROUTE_BGP, 2, "bgp"}, +- {ZEBRA_ROUTE_BABEL, 2, "babel"}, ++ {ZEBRA_ROUTE_HSLS, 1, "hsls"}, ++ {ZEBRA_ROUTE_OLSR, 2, "olsr"}, ++ {ZEBRA_ROUTE_BATMAN, 3, "batman"}, ++ {ZEBRA_ROUTE_BABEL, 3, "babel"}, + {0, 0, NULL} + }; + +--- a/ripngd/ripng_zebra.c ++++ b/ripngd/ripng_zebra.c +@@ -216,9 +216,12 @@ static struct { + {ZEBRA_ROUTE_KERNEL, 1, "kernel"}, + {ZEBRA_ROUTE_CONNECT, 1, "connected"}, + {ZEBRA_ROUTE_STATIC, 1, "static"}, +- {ZEBRA_ROUTE_OSPF6, 1, "ospf6"}, ++ {ZEBRA_ROUTE_OSPF6, 2, "ospf6"}, + {ZEBRA_ROUTE_BGP, 2, "bgp"}, +- {ZEBRA_ROUTE_BABEL, 2, "babel"}, ++ {ZEBRA_ROUTE_HSLS, 1, "hsls"}, ++ {ZEBRA_ROUTE_OLSR, 2, "olsr"}, ++ {ZEBRA_ROUTE_BATMAN, 3, "batman"}, ++ {ZEBRA_ROUTE_BABEL, 3, "babel"}, + {0, 0, NULL} + }; + +--- a/zebra/rt_netlink.c ++++ b/zebra/rt_netlink.c +@@ -1623,6 +1623,9 @@ netlink_route_multipath (int cmd, struct + addattr_l (&req.n, sizeof req, RTA_PREFSRC, + &nexthop->src.ipv4, bytelen); + ++ if (rib->type == ZEBRA_ROUTE_OLSR) ++ req.r.rtm_scope = RT_SCOPE_LINK; ++ + if (IS_ZEBRA_DEBUG_KERNEL) + zlog_debug("netlink_route_multipath() (single hop): " + "nexthop via if %u", nexthop->ifindex); +--- a/zebra/zebra_rib.c ++++ b/zebra/zebra_rib.c +@@ -67,6 +67,9 @@ static const struct + [ZEBRA_ROUTE_OSPF6] = {ZEBRA_ROUTE_OSPF6, 110}, + [ZEBRA_ROUTE_ISIS] = {ZEBRA_ROUTE_ISIS, 115}, + [ZEBRA_ROUTE_BGP] = {ZEBRA_ROUTE_BGP, 20 /* IBGP is 200. */}, ++ [ZEBRA_ROUTE_HSLS] = {ZEBRA_ROUTE_HSLS, 0}, ++ [ZEBRA_ROUTE_OLSR] = {ZEBRA_ROUTE_OLSR, 0}, ++ [ZEBRA_ROUTE_BATMAN] = {ZEBRA_ROUTE_BATMAN, 0}, + [ZEBRA_ROUTE_BABEL] = {ZEBRA_ROUTE_BABEL, 95}, + /* no entry/default: 150 */ + }; +@@ -403,6 +406,18 @@ nexthop_active_ipv4 (struct rib *rib, st + } + return 0; + } ++ else if (match->type == ZEBRA_ROUTE_OLSR) ++ { ++ for (newhop = match->nexthop; newhop; newhop = newhop->next) ++ if (CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_FIB) ++ && newhop->type == NEXTHOP_TYPE_IFINDEX) ++ { ++ if (nexthop->type == NEXTHOP_TYPE_IPV4) ++ nexthop->ifindex = newhop->ifindex; ++ return 1; ++ } ++ return 0; ++ } + else + { + return 0; +@@ -507,6 +522,18 @@ nexthop_active_ipv6 (struct rib *rib, st + } + return 0; + } ++ else if (match->type == ZEBRA_ROUTE_OLSR) ++ { ++ for (newhop = match->nexthop; newhop; newhop = newhop->next) ++ if (CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_FIB) ++ && newhop->type == NEXTHOP_TYPE_IFINDEX) ++ { ++ if (nexthop->type == NEXTHOP_TYPE_IPV6) ++ nexthop->ifindex = newhop->ifindex; ++ return 1; ++ } ++ return 0; ++ } + else + { + return 0; +@@ -1236,6 +1263,8 @@ static const u_char meta_queue_map[ZEBRA + [ZEBRA_ROUTE_ISIS] = 2, + [ZEBRA_ROUTE_BGP] = 3, + [ZEBRA_ROUTE_HSLS] = 4, ++ [ZEBRA_ROUTE_OLSR] = 4, ++ [ZEBRA_ROUTE_BATMAN] = 4, + [ZEBRA_ROUTE_BABEL] = 2, + }; + +--- a/zebra/zebra_snmp.c ++++ b/zebra/zebra_snmp.c +@@ -251,6 +251,12 @@ proto_trans(int type) + return 1; /* shouldn't happen */ + case ZEBRA_ROUTE_BGP: + return 14; /* bgp */ ++ case ZEBRA_ROUTE_HSLS: ++ return 1; /* other */ ++ case ZEBRA_ROUTE_OLSR: ++ return 1; /* other */ ++ case ZEBRA_ROUTE_BATMAN: ++ return 1; /* other */ + default: + return 1; /* other */ + } +--- a/zebra/zebra_vty.c ++++ b/zebra/zebra_vty.c +@@ -558,7 +558,10 @@ vty_show_ip_route_detail (struct vty *vt + || rib->type == ZEBRA_ROUTE_OSPF + || rib->type == ZEBRA_ROUTE_BABEL + || rib->type == ZEBRA_ROUTE_ISIS +- || rib->type == ZEBRA_ROUTE_BGP) ++ || rib->type == ZEBRA_ROUTE_BGP ++ || rib->type == ZEBRA_ROUTE_HSLS ++ || rib->type == ZEBRA_ROUTE_OLSR ++ || rib->type == ZEBRA_ROUTE_BATMAN) + { + time_t uptime; + struct tm *tm; +@@ -777,7 +780,10 @@ vty_show_ip_route (struct vty *vty, stru + || rib->type == ZEBRA_ROUTE_OSPF + || rib->type == ZEBRA_ROUTE_BABEL + || rib->type == ZEBRA_ROUTE_ISIS +- || rib->type == ZEBRA_ROUTE_BGP) ++ || rib->type == ZEBRA_ROUTE_BGP ++ || rib->type == ZEBRA_ROUTE_HSLS ++ || rib->type == ZEBRA_ROUTE_OLSR ++ || rib->type == ZEBRA_ROUTE_BATMAN) + { + time_t uptime; + struct tm *tm; +@@ -1570,7 +1576,10 @@ vty_show_ipv6_route_detail (struct vty * + || rib->type == ZEBRA_ROUTE_OSPF6 + || rib->type == ZEBRA_ROUTE_BABEL + || rib->type == ZEBRA_ROUTE_ISIS +- || rib->type == ZEBRA_ROUTE_BGP) ++ || rib->type == ZEBRA_ROUTE_BGP ++ || rib->type == ZEBRA_ROUTE_HSLS ++ || rib->type == ZEBRA_ROUTE_OLSR ++ || rib->type == ZEBRA_ROUTE_BATMAN) + { + time_t uptime; + struct tm *tm; +@@ -1750,7 +1759,10 @@ vty_show_ipv6_route (struct vty *vty, st + || rib->type == ZEBRA_ROUTE_OSPF6 + || rib->type == ZEBRA_ROUTE_BABEL + || rib->type == ZEBRA_ROUTE_ISIS +- || rib->type == ZEBRA_ROUTE_BGP) ++ || rib->type == ZEBRA_ROUTE_BGP ++ || rib->type == ZEBRA_ROUTE_HSLS ++ || rib->type == ZEBRA_ROUTE_OLSR ++ || rib->type == ZEBRA_ROUTE_BATMAN) + { + time_t uptime; + struct tm *tm; diff --git a/net/quagga/patches/130-fix_cpp.patch b/net/quagga/patches/130-fix_cpp.patch new file mode 100644 index 0000000..23991c3 --- /dev/null +++ b/net/quagga/patches/130-fix_cpp.patch @@ -0,0 +1,11 @@ +--- a/vtysh/extract.pl.in ++++ b/vtysh/extract.pl.in +@@ -63,7 +63,7 @@ $ignore{'"show history"'} = "ignore"; + foreach (@ARGV) { + $file = $_; + +- open (FH, "cpp -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -DHAVE_IPV6 -I@top_builddir@ -I@srcdir@/ -I@srcdir@/.. -I@top_srcdir@/lib -I@top_srcdir@/isisd/topology @SNMP_INCLUDES@ @CPPFLAGS@ $file |"); ++ open (FH, "@CPP@ -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -DHAVE_IPV6 -I@top_builddir@ -I@srcdir@/ -I@srcdir@/.. -I@top_srcdir@/lib -I@top_srcdir@/isisd/topology @SNMP_INCLUDES@ @CPPFLAGS@ $file |"); + local $/; undef $/; + $line = ; + close (FH); diff --git a/net/quagga/patches/140-holdtimer-set.patch b/net/quagga/patches/140-holdtimer-set.patch new file mode 100644 index 0000000..6f0d79a --- /dev/null +++ b/net/quagga/patches/140-holdtimer-set.patch @@ -0,0 +1,22 @@ +--- a/bgpd/bgp_network.c ++++ b/bgpd/bgp_network.c +@@ -193,8 +193,7 @@ bgp_accept (struct thread *thread) + peer->fd = bgp_sock; + peer->status = Active; + peer->local_id = peer1->local_id; +- peer->v_holdtime = peer1->v_holdtime; +- peer->v_keepalive = peer1->v_keepalive; ++ peer->v_holdtime = BGP_LARGE_HOLDTIME; + + /* Make peer's address string. */ + sockunion2str (&su, buf, SU_ADDRSTRLEN); +--- a/bgpd/bgpd.h ++++ b/bgpd/bgpd.h +@@ -718,6 +718,7 @@ struct bgp_nlri + /* BGP timers default value. */ + #define BGP_INIT_START_TIMER 5 + #define BGP_ERROR_START_TIMER 30 ++#define BGP_LARGE_HOLDTIME 240 + #define BGP_DEFAULT_HOLDTIME 180 + #define BGP_DEFAULT_KEEPALIVE 60 + #define BGP_DEFAULT_ASORIGINATE 15 diff --git a/net/quagga/patches/150-no-cross-fs-link.patch b/net/quagga/patches/150-no-cross-fs-link.patch new file mode 100644 index 0000000..2b84031 --- /dev/null +++ b/net/quagga/patches/150-no-cross-fs-link.patch @@ -0,0 +1,40 @@ +--- a/lib/command.c ++++ b/lib/command.c +@@ -2522,6 +2522,13 @@ DEFUN (config_write_file, + VTY_NEWLINE); + goto finished; + } ++ ++#if 0 ++ /* This code fails on UNION MOUNTs and similar filesystems if the ++ * config file is still on the RO layer. Hardlinks across layers ++ * will not work and cause quagga to fail saving the configuration... ++ * should use rename() to move files around... ++ */ + if (link (config_file, config_file_sav) != 0) + { + vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav, +@@ -2535,7 +2542,23 @@ DEFUN (config_write_file, + VTY_NEWLINE); + goto finished; + } ++#else ++ /* And this is the code that hopefully does work */ ++ if (rename (config_file, config_file_sav) != 0) ++ { ++ vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav, ++ VTY_NEWLINE); ++ goto finished; ++ } ++ sync (); ++#endif ++ ++#if 0 ++ /* same here. Please no cross-filesystem hardlinks... */ + if (link (config_file_tmp, config_file) != 0) ++#else ++ if (rename (config_file_tmp, config_file) != 0) ++#endif + { + vty_out (vty, "Can't save configuration file %s.%s", config_file, + VTY_NEWLINE); diff --git a/net/quagga/patches/160-pgbgp.patch b/net/quagga/patches/160-pgbgp.patch new file mode 100644 index 0000000..a8273ab --- /dev/null +++ b/net/quagga/patches/160-pgbgp.patch @@ -0,0 +1,3104 @@ +From: Josh Karlin +Date: Mon, 18 Aug 2008 13:17:21 +0000 (+0100) +Subject: [bgp] Add support for Pretty-Good BGP +X-Git-Url: http://git.ozo.com/?p=quagga-pgbg.git;a=commitdiff_plain;h=c2ee55705cad607f4b86ff143f7af92d538dc946 + +[bgp] Add support for Pretty-Good BGP + +2008-7-7 Josh Karlin + + * bgpd/bgp_pgbgp.c: Added file + * bgpd/bgp_pgbgp.h: Added file + * bgpd/Makefile.am: Added bgp_pgbgp.h and bgp_pgbgp.c + * bgpd/bgp_aspath.h: Externed the hash of as paths (ashash) + * bgpd/bgp_route.c: . Added PGBGP depref check to decision process. + . Informs PGBGP of new updates and selected routes + . Added anomaly status for show ip bgp + . Added PGBGP commands + * bgpd/bgp_route.h: Added suspicious route flags + * bgpd/bgp_table.h: Added PGBGP history pointer to struct bgp_node + * bgpd/bgpd.h: Defined BGP_CONFIG_PGBGP + * lib/hash.c: Added "hash_iterate_until" to be able to break out + * lib/hash.h: Definition for "hash_iterate_until" + * lib/memtypes.c: Added PGBGP memory types +--- + +--- a/bgpd/Makefile.am ++++ b/bgpd/Makefile.am +@@ -15,14 +15,14 @@ libbgp_a_SOURCES = \ + bgp_debug.c bgp_route.c bgp_zebra.c bgp_open.c bgp_routemap.c \ + bgp_packet.c bgp_network.c bgp_filter.c bgp_regex.c bgp_clist.c \ + bgp_dump.c bgp_snmp.c bgp_ecommunity.c bgp_mplsvpn.c bgp_nexthop.c \ +- bgp_damp.c bgp_table.c bgp_advertise.c bgp_vty.c bgp_mpath.c ++ bgp_damp.c bgp_table.c bgp_advertise.c bgp_vty.c bgp_mpath.c bgp_pgbgp.c + + noinst_HEADERS = \ + bgp_aspath.h bgp_attr.h bgp_community.h bgp_debug.h bgp_fsm.h \ + bgp_network.h bgp_open.h bgp_packet.h bgp_regex.h bgp_route.h \ + bgpd.h bgp_filter.h bgp_clist.h bgp_dump.h bgp_zebra.h \ + bgp_ecommunity.h bgp_mplsvpn.h bgp_nexthop.h bgp_damp.h bgp_table.h \ +- bgp_advertise.h bgp_snmp.h bgp_vty.h bgp_mpath.h ++ bgp_advertise.h bgp_snmp.h bgp_vty.h bgp_mpath.h bgp_pgbgp.h + + bgpd_SOURCES = bgp_main.c + bgpd_LDADD = libbgp.a ../lib/libzebra.la @LIBCAP@ @LIBM@ +--- /dev/null ++++ b/bgpd/bgp_pgbgp.c +@@ -0,0 +1,2401 @@ ++/* ++ BGP Pretty Good BGP ++ Copyright (C) 2008 University of New Mexico (Josh Karlin) ++ ++This file is part of GNU Zebra. ++ ++GNU Zebra is free software; you can redistribute it and/or modify it ++under the terms of the GNU General Public License as published by the ++Free Software Foundation; either version 2, or (at your option) any ++later version. ++ ++GNU Zebra 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 GNU Zebra; see the file COPYING. If not, write to the Free ++Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ++02111-1307, USA. ++*/ ++ ++/* ++ Quagga based Pretty Good BGP: ++ ++ Summary ++ ------- ++ Pretty Good BGP (PGBGP) is a soft security enhancement to BGP. ++ It uses independently collected (therefore completely distributed) ++ historical routing information to determine network topology and ++ prefix ownership. Abberations to the historical database are considered ++ anomalous and avoided when possible. ++ ++ What PGBGP can protect against: prefix hijacks, sub-prefix hijacks, and ++ spoofed edges. ++ ++ Further reading is available at http://cs.unm.edu/~karlinjf/pgbgp/ ++ ++ Route updates are forwarded to PGBGP, which determines if the route ++ is anomalous. Anomalous routes are flagged as suspicious and ++ avoided where feasible for 24 hours. If the anomalous ++ characteristic is still in the RIB after 24 hours, consider it valid ++ and enter it into the normal database. ++ ++ Cases for anomalous routes ++ -------------------------- ++ case 1) New origin AS - prefix pair (one not recently seen in the RIB): ++ response) label the route with BGP_INFO_SUSPICIOUS_O and avoid for 24 hours if possible ++ ++ case 2) New edge in path (one not recently seen in the RIB): ++ response) label the route with BGP_INFO_SUSPICIOUS_E and avoid for 24 hours ++ if possible ++ ++ case 3) New prefix that is a sub-prefix of a prefix in recent history ++ and that path differs from the current less-specific's path ++ response) label the sub-prefix routes with BGP_INFO_IGNORED_P and ++ prevent it from entering FIB for 24 hours ++ response) label the super-net routes from the same next-hop as BGP_INFO_SUSPICIOUS_P ++ and try to avoid it for 24 hours if possible ++ response) while no super-net route is selected, remove the BGP_INFO_IGNORED_P flags ++ ++ ++ Normal Database (history) ++ ------------------------- ++ Recently Seen) A route characteristic (edge, prefix/origin pair, prefix) ++ that has resided within the RIB within the last X hours ++ where X is user defined for each characteristic. ++ Storage) Prefix and Origin history are stored in bgp_node structs with the ++ "hist" pointer. ++ Edge information is stored in a separate hash table, where the edge ++ is the key to the hash. ++ Updates) The history's primary function is the keep track of when each route ++ characteristic was last seen. For each route announcement, update ++ the history's 'last seen' time. Periodically run the garbage collector ++ which updates 'last seen' times for objects currently in the RIB. ++ ++ Garbage Collection ++ ------------------ ++ Periodically the garbage collector (gc) is called to remove stale history ++ information and update the lastSeen time of objects that reside in the RIB ++ at the time of collection. This is relatively expensive as it walks ++ the RIB as well as the list of AS paths. ++ ++ What is removed) Objects that have not been seen in the RIB within a user-defined ++ time. ++ Suspicious objcets that are 24 hours old that have not been in the RIB ++ since the last collection. ++ ++ Reuse Priority Queue ++ -------------------- ++ After 24 hours, routes that are flagged as suspicious have the flags removed. ++ This is not run on a timer. Instead, for each update that PGBGP is informed of, ++ it checks the reuse queue to determine if any routes need to be updated. ++ ++*/ ++ ++ ++/* ++ Things that must be ensured: ++ . GC updates lastSeen so it must be called at least twice as often as the lowest BUFFER_TIME ++ . GC should be called at least twice per day ++ . Delay times must be shorter than history window lengths ++*/ ++ ++ ++/* ++ Changes made to original PGBGP thinking ++ . Don't check for things in the RIB all of the time, periodically ++ update the lastSeen values and just use lastSeen ++*/ ++ ++/* ++ Changes made to original protocol ++ . sub-prefixes are only ignored while the super-net has a selected ++ route and it's non-anomalous (not to a neighbor that announced ++ the sub-prefix) ++ ++ . At point of reuse, don't delete the item if it's not in the RIB. ++ delete it if it hasn't been in the RIB since the last storage. ++ This saves a lot of processing time for new edges ++ ++ . Changed heuristic from "if new sub-prefix and trusted AS on path ++ then it's okay" to "if new sub-prefix and same path is used to reach ++ super-prefix, then it's okay". Might be better to change to "if old ++ path is prefix of new path, then okay" ++*/ ++ ++#include ++#include ++ ++#include "prefix.h" ++#include "memory.h" ++#include "command.h" ++#include "log.h" ++#include "pqueue.h" ++#include "table.h" ++#include "hash.h" ++#include "str.h" ++ ++#include "bgpd/bgpd.h" ++#include "bgpd/bgp_aspath.h" ++#include "bgpd/bgp_pgbgp.h" ++#include "bgpd/bgp_table.h" ++#include "bgpd/bgp_route.h" ++#include "bgpd/bgp_attr.h" ++#include "bgpd/bgp_advertise.h" ++ ++ ++#define true 1 ++#define false 0 ++ ++struct hash * ashash; ++ ++static void *edge_hash_alloc (void *arg); ++static unsigned int edge_key_make (void *p); ++static int edge_cmp (const void *arg1, const void *args); ++ ++// Helper Functions ++static struct bgp_pgbgp_pathSet bgp_pgbgp_pathOrigin (struct aspath *); ++static int bgp_pgbgp_pathLength (struct aspath *asp); ++static int bgp_pgbgp_gc (struct bgp_table *); ++static int bgp_pgbgp_clean (struct bgp_table *); ++static int bgp_pgbgp_reuse (time_t); ++static struct bgp_node *findSuper (struct bgp_table *table, struct prefix *p, ++ time_t t_now); ++static int bgp_pgbgp_store (struct bgp_table *table); ++static int bgp_pgbgp_restore (void); ++static struct bgp_info *bgp_pgbgp_selected (struct bgp_node *node); ++static int originInRIB (struct bgp_node *node, struct bgp_pgbgp_origin *origin); ++static int prefixInRIB (struct bgp_node *node, struct bgp_pgbgp_prefix *prefix); ++static int edgeInRIB (struct bgp_pgbgp_edge *e); ++ ++// MOAS Functions ++static void bgp_pgbgp_logOriginAnomaly (as_t asn, struct bgp_node *rn, ++ struct attr *); ++static int bgp_pgbgp_reuseOrigin (struct bgp_pgbgp_r_origin); ++static void bgp_pgbgp_cleanHistTable (struct bgp_table *); ++static int bgp_pgbgp_garbageCollectHistTable (struct bgp_table *); ++static void bgp_pgbgp_storeHistTable (struct bgp_table *table, FILE * file); ++static int bgp_pgbgp_updateOrigin (struct bgp_pgbgp_hist *, struct bgp_info *, ++ struct attr *, struct bgp_node *, time_t, int); ++ ++ ++// Sub-Prefix Hijack Detector Functions ++static int bgp_pgbgp_shouldIgnore (struct bgp_node *super, struct bgp_info *selected); ++static void bgp_pgbgp_logSubprefixAnomaly (as_t asn, struct bgp_node *rn, ++ struct attr *, struct bgp_node *super); ++static int bgp_pgbgp_reusePrefix (struct bgp_pgbgp_r_prefix); ++static int bgp_pgbgp_updatePrefix (struct bgp_pgbgp_hist *hist, struct bgp_node *, ++ struct bgp_info *, struct attr *, ++ struct bgp_node *, time_t, int); ++ ++ ++// Spoofed Edge Detector Functions ++static void bgp_pgbgp_cleanEdges (void); ++static void bgp_pgbgp_logEdgeAnomaly (struct bgp_node *rn, struct attr *, ++ struct edge *edge); ++static int bgp_pgbgp_reuseEdge (struct bgp_pgbgp_r_edge); ++static void bgp_pgbgp_storeEdges (struct bgp_table *, FILE *); ++static int bgp_pgbgp_garbageCollectEdges (struct bgp_table *); ++static int bgp_pgbgp_updateEdge (struct bgp_pgbgp_hist *hist, struct bgp_info *, ++ struct attr *, struct bgp_node *, time_t, int); ++static int bgp_pgbgp_restoreEdge (FILE * file); ++static void bgp_pgbgp_storeEdges (struct bgp_table *table, FILE * file); ++ ++ ++ ++// New Peer Detector Functions ++static int bgp_pgbgp_updatePeer (struct bgp_info *binfo, time_t now); ++ ++ ++/* --------------- Global Variables ------------------ */ ++struct bgp_pgbgp_config bgp_pgbgp_cfg; ++struct bgp_pgbgp_config *pgbgp = &bgp_pgbgp_cfg; ++/*! --------------- Global Variables ------------------ !*/ ++ ++/* --------------- VTY (others exist in bgp_route.c) ------------------ */ ++ ++struct nsearch ++{ ++ struct vty *pvty; ++ time_t time; ++ as_t asn; ++}; ++ ++static void ++edge_neighbor_iterator (struct hash_backet *backet, struct nsearch *pns) ++{ ++ struct bgp_pgbgp_edge *hedge = backet->data; ++ if ((hedge->e.a == pns->asn || hedge->e.b == pns->asn) ++ && hedge->e.a != hedge->e.b) ++ { ++ struct vty *vty = pns->pvty; ++ if (hedge->deprefUntil > pns->time) ++ vty_out (pns->pvty, "Untrusted: %d -- %d%s", hedge->e.a, hedge->e.b, ++ VTY_NEWLINE); ++ else ++ vty_out (pns->pvty, "Trusted: %d -- %d%s", hedge->e.a, hedge->e.b, ++ VTY_NEWLINE); ++ } ++} ++ ++static int ++bgp_pgbgp_stats_neighbors (struct vty *vty, afi_t afi, safi_t safi, as_t asn) ++{ ++ struct nsearch ns; ++ ns.pvty = vty; ++ ns.time = time (NULL); ++ ns.asn = asn; ++ ++ hash_iterate (pgbgp->edgeT, ++ (void (*)(struct hash_backet *, void *)) ++ edge_neighbor_iterator, &ns); ++ return CMD_SUCCESS; ++} ++ ++static int ++bgp_pgbgp_stats_origins (struct vty *vty, afi_t afi, safi_t safi, ++ const char *prefix) ++{ ++ struct bgp *bgp; ++ struct bgp_table *table; ++ time_t t_now = time (NULL); ++ bgp = bgp_get_default (); ++ if (bgp == NULL) ++ return CMD_WARNING; ++ if (bgp->rib == NULL) ++ return CMD_WARNING; ++ table = bgp->rib[afi][safi]; ++ if (table == NULL) ++ return CMD_WARNING; ++ ++ struct prefix p; ++ str2prefix (prefix, &p); ++ struct bgp_node *rn = bgp_node_match (table, &p); ++ vty_out (vty, "%s%s", prefix, VTY_NEWLINE); ++ if (rn) ++ { ++ if (rn->hist) ++ { ++ for (struct bgp_pgbgp_origin * cur = rn->hist->o; cur != NULL; ++ cur = cur->next) ++ { ++ if (cur->deprefUntil > t_now) ++ vty_out (vty, "Untrusted Origin AS: %d%s", cur->originAS, ++ VTY_NEWLINE); ++ else ++ vty_out (vty, "Trusted Origin AS: %d%s", cur->originAS, ++ VTY_NEWLINE); ++ } ++ } ++ bgp_unlock_node (rn); ++ } ++ return CMD_SUCCESS; ++} ++ ++static int ++bgp_pgbgp_stats (struct vty *vty, afi_t afi, safi_t safi) ++{ ++ struct bgp *bgp; ++ struct bgp_table *table; ++ ++ ++ bgp = bgp_get_default (); ++ if (bgp == NULL) ++ return CMD_WARNING; ++ if (bgp->rib == NULL) ++ return CMD_WARNING; ++ table = bgp->rib[afi][safi]; ++ if (table == NULL) ++ return CMD_WARNING; ++ ++ // bgp_pgbgp_store(table); ++ ++ // Print out the number of anomalous routes ++ int anomalous = 0; ++ int routes = 0; ++ int num_selected = 0; ++ int num_origin = 0; ++ int num_super = 0; ++ int num_ignored = 0; ++ int num_edge = 0; ++ ++ for (struct bgp_node * rn = bgp_table_top (table); rn; ++ rn = bgp_route_next (rn)) ++ { ++ for (struct bgp_info * ri = rn->info; ri; ri = ri->next) ++ { ++ routes += 1; ++ if (ANOMALOUS (ri->flags)) ++ { ++ anomalous += 1; ++ if (CHECK_FLAG (ri->flags, BGP_INFO_SELECTED)) ++ num_selected += 1; ++ ++ if (CHECK_FLAG (ri->flags, BGP_INFO_SUSPICIOUS_O)) ++ num_origin += 1; ++ if (CHECK_FLAG (ri->flags, BGP_INFO_SUSPICIOUS_E)) ++ num_edge += 1; ++ if (CHECK_FLAG (ri->flags, BGP_INFO_SUSPICIOUS_P)) ++ num_super += 1; ++ if (CHECK_FLAG (ri->flags, BGP_INFO_IGNORED_P)) ++ num_ignored += 1; ++ } ++ } ++ } ++ ++ vty_out (vty, "%-30s: %10d%s", "Routes in the RIB", routes, VTY_NEWLINE); ++ vty_out (vty, "%-30s: %10d%s", "Anomalous routes in RIB", anomalous, ++ VTY_NEWLINE); ++ vty_out (vty, "%-30s: %10d%s", "Selected anomalous routes", num_selected, ++ VTY_NEWLINE); ++ vty_out (vty, "-----------------------------%s", VTY_NEWLINE); ++ vty_out (vty, "%-30s: %10d%s", "Routes with anomalous origins", num_origin, ++ VTY_NEWLINE); ++ vty_out (vty, "%-30s: %10d%s", "Routes with anomalous edges", num_edge, ++ VTY_NEWLINE); ++ vty_out (vty, "%-30s: %10d%s", "Routes ignored for sub-prefix", num_ignored, ++ VTY_NEWLINE); ++ vty_out (vty, "%-30s: %10d%s", "Less specific routes to avoid", num_super, ++ VTY_NEWLINE); ++ /* ++ vty_out (vty, "There are %d routes in the RIB.%s", routes, VTY_NEWLINE); ++ vty_out (vty, "%d are anomalous.%s", anomalous, VTY_NEWLINE); ++ vty_out (vty, "%d anomalous routes are selected.%s", num_selected, VTY_NEWLINE); ++ vty_out (vty, "%s", VTY_NEWLINE); ++ vty_out (vty, "Anomaly breakdown:%s", VTY_NEWLINE); ++ vty_out (vty, "%d contain anomalous origins%s", num_origin, VTY_NEWLINE); ++ vty_out (vty, "%d contain anomalous edges.%s", num_edge, VTY_NEWLINE); ++ vty_out (vty, "%d are for ignored sub-prefixes.%s", num_ignored, VTY_NEWLINE); ++ vty_out (vty, "%d are super-net routes through peers that announced anomalous sub-prefixes.%s", num_super, VTY_NEWLINE); ++ */ ++ return CMD_SUCCESS; ++} ++ ++ ++DEFUN (show_ip_bgp_pgbgp, ++ show_ip_bgp_pgbgp_cmd, ++ "show ip bgp pgbgp", ++ SHOW_STR IP_STR BGP_STR "Display PGBGP statistics\n") ++{ ++ return bgp_pgbgp_stats (vty, AFI_IP, SAFI_UNICAST); ++} ++ ++DEFUN (show_ip_bgp_pgbgp_neighbors, ++ show_ip_bgp_pgbgp_neighbors_cmd, ++ "show ip bgp pgbgp neighbors WORD", ++ SHOW_STR ++ IP_STR ++ BGP_STR ++ "BGP pgbgp\n" ++ "BGP pgbgp neighbors\n" "ASN whos neighbors should be displayed\n") ++{ ++ return bgp_pgbgp_stats_neighbors (vty, AFI_IP, SAFI_UNICAST, ++ atoi (argv[0])); ++} ++ ++DEFUN (show_ip_bgp_pgbgp_origins, ++ show_ip_bgp_pgbgp_origins_cmd, ++ "show ip bgp pgbgp origins A.B.C.D/M", ++ SHOW_STR ++ IP_STR ++ BGP_STR ++ "BGP pgbgp\n" ++ "BGP pgbgp neighbors\n" "Prefix to look up origin ASes of\n") ++{ ++ return bgp_pgbgp_stats_origins (vty, AFI_IP, SAFI_UNICAST, argv[0]); ++} ++ ++ ++ ++ ++/*! --------------- VTY (others exist in bgp_route.c) ------------------ !*/ ++ ++ ++ ++ ++ ++ ++ ++/* --------------- Helper Functions ------------------ */ ++/* ++ If the origin hasn't been seen/verified lately, look for it in the RIB ++*/ ++int ++originInRIB (struct bgp_node *node, struct bgp_pgbgp_origin *origin) ++{ ++ for (struct bgp_info * ri = node->info; ri; ri = ri->next) ++ { ++ struct bgp_pgbgp_pathSet pathOrigins; ++ pathOrigins = bgp_pgbgp_pathOrigin (ri->attr->aspath); ++ for (int i = 0; i < pathOrigins.length; ++i) ++ { ++ if (pathOrigins.ases[i] == origin->originAS) ++ { ++ return true; ++ } ++ } ++ } ++ return false; ++} ++ ++ ++/* ++ If the prefix hasn't been seen/verified lately, look for it in the RIB ++*/ ++int ++prefixInRIB (struct bgp_node *node, struct bgp_pgbgp_prefix *prefix) ++{ ++ if (node->info) ++ return true; ++ return false; ++} ++ ++static int ++edge_inRIB_iterator (struct hash_backet *backet, struct bgp_pgbgp_edge *hedge) ++{ ++ struct aspath *p = backet->data; ++ char first = true; ++ struct edge curEdge; ++ curEdge.a = 0; ++ curEdge.b = 0; ++ ++ struct assegment *seg; ++ ++ for (seg = p->segments; seg; seg = seg->next) ++ { ++ for (int i = 0; i < seg->length; i++) ++ { ++ curEdge.a = curEdge.b; ++ curEdge.b = seg->as[i]; ++ if (first) ++ { ++ first = false; ++ continue; ++ } ++ // Is this the edge we're looking for? ++ if (curEdge.a == hedge->e.a && curEdge.b == hedge->e.b) ++ { ++ hedge->lastSeen = time (NULL); ++ return false; ++ } ++ } ++ } ++ ++ return true; ++} ++ ++/* ++ If the edge hasn't been seen/verified lately, look for it in the AS path list ++ This function is expensive, use sparingly ++*/ ++int ++edgeInRIB (struct bgp_pgbgp_edge *e) ++{ ++ int completed; ++ completed = hash_iterate_until (ashash, ++ (int (*)(struct hash_backet *, void *)) ++ edge_inRIB_iterator, e); ++ if (completed) ++ return false; ++ ++ return true; ++} ++ ++ ++ ++/* ++ Return the selected route for the given route node ++ */ ++ ++struct bgp_info * ++bgp_pgbgp_selected (struct bgp_node *node) ++{ ++ for (struct bgp_info * ri = node->info; ri; ri = ri->next) ++ { ++ if (CHECK_FLAG (ri->flags, BGP_INFO_SELECTED)) ++ return ri; ++ } ++ return NULL; ++} ++ ++static int ++reuse_cmp (void *node1, void *node2) ++{ ++ struct bgp_pgbgp_reuse *a; ++ struct bgp_pgbgp_reuse *b; ++ a = (struct bgp_pgbgp_reuse *) node1; ++ b = (struct bgp_pgbgp_reuse *) node2; ++ return a->deprefUntil - b->deprefUntil; ++} ++ ++int ++bgp_pgbgp_pathLength (struct aspath *asp) ++{ ++ struct assegment *seg; ++ if ((asp == NULL) || (asp->segments == NULL)) ++ return 0; ++ int count = 0; ++ seg = asp->segments; ++ while (seg->next != NULL) ++ { ++ count += seg->length; ++ seg = seg->next; ++ } ++ return count; ++} ++ ++ ++ ++/* Find the origin(s) of the path ++ All ASes in the final set are considered origins */ ++static struct bgp_pgbgp_pathSet ++bgp_pgbgp_pathOrigin (struct aspath *asp) ++{ ++ struct assegment *seg, *last; ++ struct bgp_pgbgp_pathSet tmp; ++ tmp.length = 0; ++ tmp.ases = NULL; ++ ++ assert (asp != NULL && asp->segments != NULL); ++ ++ /* if ( (asp == NULL) || (asp->segments == NULL) ) ++ return tmp; ++ */ ++ seg = asp->segments; ++ last = NULL; ++ while (seg->next != NULL) ++ { ++ if (seg->type != AS_SET && seg->type != AS_CONFED_SET) ++ last = seg; ++ seg = seg->next; ++ } ++ ++ if (seg->type == AS_SET || seg->type == AS_CONFED_SET) ++ seg = last; ++ ++ assert (seg); ++ tmp.length = 1; ++ tmp.ases = &seg->as[seg->length - 1]; ++ ++ /* ++ if (seg->type == AS_SET || seg->type == AS_CONFED_SET) ++ { ++ tmp.length = seg->length; ++ tmp.ases = seg->as; ++ } ++ else ++ { ++ tmp.length = 1; ++ tmp.ases = &seg->as[seg->length - 1]; ++ } ++ */ ++ assert (tmp.length >= 1); ++ return tmp; ++ // return seg->as[seg->length-1]; ++} ++ ++int ++bgp_pgbgp_reuse (time_t t_now) ++{ ++ ++ struct bgp_pgbgp_reuse *cur = NULL; ++ ++ while (pgbgp->rq_size > 0) ++ { ++ cur = pqueue_dequeue (pgbgp->reuse_q); ++ pgbgp->rq_size -= 1; ++ ++ // Is the next item ready to be reused? ++ if (t_now < cur->deprefUntil) ++ { ++ pqueue_enqueue (cur, pgbgp->reuse_q); ++ pgbgp->rq_size += 1; ++ break; ++ } ++ ++ // Okay, it needs to be reused now ++ if (cur->type == PGBGP_REUSE_ORIGIN) ++ bgp_pgbgp_reuseOrigin (cur->data.origin); ++ ++ else if (cur->type == PGBGP_REUSE_PREFIX) ++ bgp_pgbgp_reusePrefix (cur->data.prefix); ++ ++ else if (cur->type == PGBGP_REUSE_EDGE) ++ bgp_pgbgp_reuseEdge (cur->data.edge); ++ ++ ++ XFREE (MTYPE_BGP_PGBGP_REUSE, cur); ++ } ++ return 0; ++} ++ ++/* Check bit of the prefix. */ ++static int ++check_bit (u_char * prefix, u_char prefixlen) ++{ ++ int offset; ++ int shift; ++ u_char *p = (u_char *) prefix; ++ ++ assert (prefixlen <= 128); ++ ++ offset = prefixlen / 8; ++ shift = 7 - (prefixlen % 8); ++ ++ return (p[offset] >> shift & 1); ++} ++ ++/* ++ Find a super-net in the tree that's not currently anomalous if one exists ++*/ ++struct bgp_node * ++findSuper (struct bgp_table *table, struct prefix *p, time_t t_now) ++{ ++ struct bgp_node *node; ++ struct bgp_node *matched; ++ ++ matched = NULL; ++ node = table->top; ++ ++ while (node && node->p.prefixlen < p->prefixlen && ++ prefix_match (&node->p, p)) ++ { ++ // Node may not yet have its info set when reading in from pgbgp log files ++ if (node->hist && node->p.prefixlen >= 8) ++ { ++ if (node->hist->p != NULL && node->hist->p->ignoreUntil < t_now) ++ //if (node->hist->p != NULL && prefixInRIB (node, NULL)) ++ //if (node->hist->p != NULL) ++ matched = node; ++ } ++ node = node->link[check_bit (&p->u.prefix, node->p.prefixlen)]; ++ } ++ if (matched) ++ return bgp_lock_node (matched); ++ return NULL; ++} ++ ++ ++ ++ ++ ++/*! --------------- Helper Functions ------------------ !*/ ++ ++ ++ ++ ++ ++ ++ ++/* --------------- Public PGBGP Interface ------------------ */ ++int ++bgp_pgbgp_enable (struct bgp *bgp, afi_t afi, safi_t safi, ++ int ost, int est, int sst, int oht, int pht, int eht, ++ const char *file, const char *anoms) ++{ ++ ++ if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_PGBGP)) ++ { ++ if (pgbgp->storage && pgbgp->anomalies) ++ { ++ if (pgbgp->origin_sus_time == ost ++ && pgbgp->edge_sus_time == est ++ && pgbgp->sub_sus_time == sst ++ && pgbgp->origin_hist_time == oht ++ && pgbgp->prefix_hist_time == pht ++ && pgbgp->edge_hist_time == eht ++ && strcmp (pgbgp->storage, file) == 0 ++ && strcmp (pgbgp->anomalies, anoms) == 0) ++ ++ return 0; ++ } ++ } ++ ++ SET_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_PGBGP); ++ ++#ifndef PGBGP_DEBUG ++ time_t hour = 3600; ++ time_t day = 86400; ++#endif ++#ifdef PGBGP_DEBUG ++ time_t hour = 2; ++ time_t day = 5; ++#endif ++ ++ pgbgp->origin_sus_time = ost * hour; ++ pgbgp->edge_sus_time = est * hour; ++ pgbgp->sub_sus_time = sst * hour; ++ pgbgp->origin_hist_time = oht * day; ++ pgbgp->prefix_hist_time = pht * day; ++ pgbgp->edge_hist_time = eht * day; ++ pgbgp->peer_hist_time = DEFAULT_ORIGIN_HIST; ++ ++ if (file != NULL) ++ pgbgp->storage = strdup (file); ++ else ++ pgbgp->storage = NULL; ++ ++ if (anoms != NULL) ++ pgbgp->anomalies = strdup (anoms); ++ else ++ pgbgp->anomalies = NULL; ++ ++ ++ pgbgp->reuse_q = pqueue_create (); ++ pgbgp->reuse_q->cmp = reuse_cmp; ++ pgbgp->rq_size = 0; ++ pgbgp->lastgc = time (NULL); ++ pgbgp->lastStore = time (NULL); ++ pgbgp->startTime = time (NULL); ++ install_element (VIEW_NODE, &show_ip_bgp_pgbgp_cmd); ++ install_element (ENABLE_NODE, &show_ip_bgp_pgbgp_cmd); ++ install_element (VIEW_NODE, &show_ip_bgp_pgbgp_neighbors_cmd); ++ install_element (ENABLE_NODE, &show_ip_bgp_pgbgp_neighbors_cmd); ++ install_element (VIEW_NODE, &show_ip_bgp_pgbgp_origins_cmd); ++ install_element (ENABLE_NODE, &show_ip_bgp_pgbgp_origins_cmd); ++ pgbgp->edgeT = hash_create_size (131072, edge_key_make, edge_cmp); ++ bgp_pgbgp_restore (); ++ return 0; ++} ++ ++int ++bgp_pgbgp_disable (struct bgp *bgp, afi_t afi, safi_t safi) ++{ ++ UNSET_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_PGBGP); ++ ++ // Clean the tables ++ if (bgp->rib[afi][safi] != NULL) ++ bgp_pgbgp_clean (bgp->rib[afi][safi]); ++ ++ bgp_pgbgp_cleanEdges (); ++ ++ if (pgbgp->storage != NULL) ++ free (pgbgp->storage); ++ ++ if (pgbgp->anomalies != NULL) ++ free (pgbgp->anomalies); ++ ++ struct bgp_pgbgp_peerTime *pr = pgbgp->peerLast; ++ while (pr) ++ { ++ struct bgp_pgbgp_peerTime *cur = pr; ++ pr = pr->next; ++ XFREE (MTYPE_BGP_PGBGP_PEER, cur); ++ } ++ ++ return 0; ++} ++ ++int ++bgp_pgbgp_clean (struct bgp_table *table) ++{ ++ struct bgp_pgbgp_reuse *rnode = NULL; ++ ++ while (pgbgp->rq_size > 0) ++ { ++ rnode = (struct bgp_pgbgp_reuse *) pqueue_dequeue (pgbgp->reuse_q); ++ pgbgp->rq_size -= 1; ++ XFREE (MTYPE_BGP_PGBGP_REUSE, rnode); ++ } ++ pqueue_delete (pgbgp->reuse_q); ++ ++ if (table == NULL) ++ return 0; ++ ++ // Clean the detectors ++ bgp_pgbgp_cleanHistTable (table); ++ ++ bgp_pgbgp_cleanEdges (); ++ ++ ++ // Clean up the RIB nodes ++ for (struct bgp_node * rn = bgp_table_top (table); rn; ++ rn = bgp_route_next (rn)) ++ { ++ int changed = 0; ++ for (struct bgp_info * ri = rn->info; ri; ri = ri->next) ++ { ++ if (CHECK_FLAG (ri->flags, BGP_INFO_SUSPICIOUS_O ++ | BGP_INFO_SUSPICIOUS_P | BGP_INFO_SUSPICIOUS_E ++ | BGP_INFO_IGNORED_P)) ++ { ++ changed = 1; ++ UNSET_FLAG (ri->flags, BGP_INFO_SUSPICIOUS_O ++ | BGP_INFO_SUSPICIOUS_P | BGP_INFO_SUSPICIOUS_E ++ | BGP_INFO_IGNORED_P); ++ } ++ } ++ if (changed && rn->info) ++ { ++ struct bgp_info *ri = rn->info; ++ bgp_process (ri->peer->bgp, rn, rn->table->afi, rn->table->safi); ++ } ++ } ++ ++ hash_free (pgbgp->edgeT); ++ return 0; ++} ++ ++ ++int ++bgp_pgbgp_gc (struct bgp_table *table) ++{ ++ struct bgp *bgp = bgp_get_default (); ++ if (!bgp) ++ return 0; ++ ++ // Collect each AFI/SAFI RIB ++ for (afi_t afi = AFI_IP; afi < AFI_MAX; afi++) ++ for (safi_t safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) ++ { ++ if (!CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_PGBGP)) ++ continue; ++ struct bgp_table *curTable = bgp->rib[afi][safi]; ++ if (!curTable) ++ continue; ++ bgp_pgbgp_garbageCollectHistTable (curTable); ++ } ++ ++ bgp_pgbgp_garbageCollectEdges (table); ++ ++ return 0; ++} ++ ++int ++bgp_pgbgp_restore (void) ++{ ++ ++ if (pgbgp->storage == NULL) ++ return 0; ++ FILE *file = fopen (pgbgp->storage, "r"); ++ if (!file) ++ return 0; ++ ++ int type = 0; ++ struct prefix p; ++ struct bgp *bgp = bgp_get_default (); ++ struct bgp_node *curNode = NULL; ++ ++ // Get the log store time ++ long long int writetime; ++ fscanf (file, "%lld", &writetime); ++ time_t swtime = writetime; ++ ++ // If it's too old (more than 1 week old), start fresh ++ if (time (NULL) - swtime > 86400 * 7) ++ { ++ fclose (file); ++ return 0; ++ } ++ ++ ++ // Get the PGBGP init time ++ long long int stime; ++ fscanf (file, "%lld", &stime); ++ pgbgp->startTime = stime; ++ ++ while (fscanf (file, "%d", &type) != EOF) ++ { ++ ++ if (type == PREFIX_ID) ++ { ++ char pre[128]; ++ unsigned int afi; ++ unsigned int safi; ++ long long int time; ++ fscanf (file, "%s %u %u %lld", pre, &afi, &safi, &time); ++ str2prefix (pre, &p); ++ struct bgp_table *curTable = bgp->rib[afi][safi]; ++ assert (curTable != NULL); ++ ++ // Create and lock the node ++ curNode = bgp_node_get (curTable, &p); ++ assert (curNode->hist == NULL); ++ ++ // bgp_lock_node(curNode); ++ ++ curNode->hist = ++ XCALLOC (MTYPE_BGP_PGBGP_HIST, sizeof (struct bgp_pgbgp_hist)); ++ assert (curNode->hist != NULL); ++ ++ curNode->hist->p = ++ XCALLOC (MTYPE_BGP_PGBGP_PREFIX, ++ sizeof (struct bgp_pgbgp_prefix)); ++ assert (curNode->hist->p != NULL); ++ ++ curNode->hist->p->lastSeen = time; ++ } ++ else if (type == ORIGIN_ID) ++ { ++ unsigned int ASN; ++ long long int time; ++ fscanf (file, "%u %lld", &ASN, &time); ++ struct bgp_pgbgp_origin *or = XCALLOC (MTYPE_BGP_PGBGP_ORIGIN, ++ sizeof (struct ++ bgp_pgbgp_origin)); ++ or->lastSeen = time; ++ or->originAS = ASN; ++ or->next = curNode->hist->o; ++ curNode->hist->o = or; ++ } ++ else if (type == EDGE_ID) ++ { ++ bgp_pgbgp_restoreEdge (file); ++ } ++ else if (type == PEER_ID) ++ { ++ struct bgp_pgbgp_peerTime *pr; ++ long long int time; ++ union sockunion su; ++ char szsu[128]; ++ fscanf (file, "%s %lld", szsu, &time); ++ str2sockunion (szsu, &su); ++ pr = ++ XCALLOC (MTYPE_BGP_PGBGP_PEER, ++ sizeof (struct bgp_pgbgp_peerTime)); ++ pr->su = su; ++ pr->lastSeen = time; ++ pr->next = pgbgp->peerLast; ++ pgbgp->peerLast = pr; ++ } ++ } ++ ++ fclose (file); ++ return 0; ++} ++ ++int ++bgp_pgbgp_store (struct bgp_table *table) ++{ ++ if (pgbgp->storage == NULL) ++ return 0; ++ char *tmpname = malloc (sizeof (char) * (1 + 4 + strlen (pgbgp->storage))); ++ strcpy (tmpname, pgbgp->storage); ++ strcat (tmpname, ".tmp"); ++ FILE *file = fopen (tmpname, "w"); ++ ++ if (!file) ++ { ++ free (tmpname); ++ return 0; ++ } ++ ++ // Store the current time ++ fprintf (file, "%lld\n", (long long int) time (NULL)); ++ ++ // Store the init time ++ fprintf (file, "%lld\n", (long long int) pgbgp->startTime); ++ ++ // Store the peer times ++ for (struct bgp_pgbgp_peerTime * pr = pgbgp->peerLast; pr; pr = pr->next) ++ { ++ char strSock[128]; ++ sockunion2str (&pr->su, strSock, sizeof (strSock)); ++ ++ if (pr->deprefUntil < time (NULL)) ++ { ++ fprintf (file, "%d %s %lld\n", PEER_ID, strSock, ++ (long long int) pr->lastSeen); ++ } ++ } ++ ++ // Store the tables ++ bgp_pgbgp_storeHistTable (table, file); ++ bgp_pgbgp_storeEdges (table, file); ++ ++ fclose (file); ++ ++ rename (tmpname, pgbgp->storage); ++ ++ free (tmpname); ++ return 0; ++} ++ ++/* ++ Check to see if we've seen the peer recently ++ If not, then we need to return true and not delay routes ++ for awhile ++*/ ++int ++bgp_pgbgp_updatePeer (struct bgp_info *binfo, time_t now) ++{ ++ int status = false; ++ // Find the peer ++ struct bgp_pgbgp_peerTime *pr = pgbgp->peerLast; ++ for (; pr; pr = pr->next) ++ if (sockunion_same (&pr->su, &binfo->peer->su)) ++ break; ++ ++ // If this is a new peer, create it ++ if (pr == NULL) ++ { ++ pr = XCALLOC (MTYPE_BGP_PGBGP_PEER, sizeof (struct bgp_pgbgp_peerTime)); ++ pr->su = binfo->peer->su; ++ pr->next = pgbgp->peerLast; ++ pgbgp->peerLast = pr; ++ ++ } ++ // Is it currently marked as new? ++ if (pr->deprefUntil > now) ++ goto UPPEER_DEPREF; ++ ++ // Have we seen the peer recently? ++ if (pr->lastSeen + pgbgp->peer_hist_time > now) ++ goto UPPEER_CLEAN; ++ ++ // It must not have been seen lately, depref it ++ pr->deprefUntil = now + PGBGP_PEER_GRACE; ++ ++ ++UPPEER_DEPREF: ++ status = true; ++ ++UPPEER_CLEAN: ++ pr->lastSeen = now; ++ ++ return status; ++} ++ ++ ++/* ++ Returns whether or not the sub-prefix should be ignored ++*/ ++int ++bgp_pgbgp_shouldIgnore (struct bgp_node *super, struct bgp_info *selected) ++{ ++ if (!selected || CHECK_FLAG (selected->flags, BGP_INFO_SUSPICIOUS_P)) ++ return false; ++ return true; ++} ++ ++/* ++ This is a special case function for smoothly handling sub-prefix hijacks. ++ ++ It handles the following 2 events: ++ ++ Event 1: The super-prefix of an anomalous prefix has a route through a non-anomalous ++ ++ Event 1: An anomalous sub-prefix is ignored, but no best route for the super-prefix exists ++ Response: Announce the sub-prefix until the super-prefix comes back ++ ++ Event 2: A super-prefix comes back to the RIB and its anomalous sub-prefix is in use ++ Response: Ignore the sub-prefix again ++ */ ++ ++ ++int ++bgp_pgbgp_rib_updated (struct bgp_node *rn, struct bgp_info *old_best, ++ struct bgp_info *new_best) ++{ ++ // return 0; ++ struct bgp_pgbgp_hist *hist = rn->hist; ++ if (!hist) ++ return 0; ++ if (!hist->p) ++ return 0; ++ time_t t_now = time (NULL); ++ ++ /* ++ If we can't avoid the sub-prefix by routing to the super-prefix, ++ then route as normal to the sub-prefix ++ */ ++ if (!bgp_pgbgp_shouldIgnore (rn, new_best)) ++ { ++ for (struct bgp_pgbgp_avoid * cur = hist->p->avoid; cur; ++ cur = cur->next) ++ { ++ if (cur->avoidUntil > t_now) ++ { ++ int changed = false; ++ for (struct bgp_info * ri = cur->sub->info; ri; ri = ri->next) ++ { ++ if (CHECK_FLAG (ri->flags, BGP_INFO_IGNORED_P)) ++ { ++ changed = true; ++ UNSET_FLAG (ri->flags, BGP_INFO_IGNORED_P); ++ } ++ } ++ if (changed) ++ { ++ struct bgp_info *ri = cur->sub->info; ++ if (ri && ri->peer && ri->peer->bgp) ++ bgp_process (ri->peer->bgp, cur->sub, ++ cur->sub->table->afi, cur->sub->table->safi); ++ ++ } ++ ++ } ++ } ++ } ++ ++ /* ++ If we can avoid the sub-prefix by routing to the super-prefix, ++ then do so ++ */ ++ ++ else ++ { ++ for (struct bgp_pgbgp_avoid * cur = hist->p->avoid; cur; ++ cur = cur->next) ++ { ++ if (cur->avoidUntil > t_now) ++ { ++ int changed = false; ++ for (struct bgp_info * ri = cur->sub->info; ri; ri = ri->next) ++ { ++ if (!CHECK_FLAG (ri->flags, BGP_INFO_IGNORED_P)) ++ { ++ changed = true; ++ SET_FLAG (ri->flags, BGP_INFO_IGNORED_P); ++ } ++ } ++ if (changed) ++ { ++ struct bgp_info *ri = cur->sub->info; ++ if (ri && ri->peer && ri->peer->bgp) ++ bgp_process (ri->peer->bgp, cur->sub, ++ cur->sub->table->afi, cur->sub->table->safi); ++ } ++ } ++ } ++ } ++ ++ /* ++ if (old_best && !new_best) ++ { ++ time_t t_now = time(NULL); ++ for (struct bgp_pgbgp_avoid * cur = hist->p->avoid; cur; ++ cur = cur->next) ++ { ++ if (cur->avoidUntil > t_now) ++ { ++ for (struct bgp_info * ri = cur->sub->info; ri; ri = ri->next) ++ UNSET_FLAG (ri->flags, BGP_INFO_IGNORED_P); ++ ++ struct bgp_info *ri = cur->sub->info; ++ if (ri && ri->peer && ri->peer->bgp) ++ bgp_process (ri->peer->bgp, cur->sub, cur->sub->table->afi, ++ cur->sub->table->safi); ++ } ++ } ++ } ++ ++ ++ else if (!old_best && new_best) ++ { ++ time_t t_now = time(NULL); ++ for (struct bgp_pgbgp_avoid * av = hist->p->avoid; av; av = av->next) ++ { ++ struct bgp_info * ri = av->sub->info; ++ if (av->avoidUntil > t_now && ri && !CHECK_FLAG(ri->flags, BGP_INFO_IGNORED_P)) ++ { ++ for (; ri; ri = ri->next) ++ SET_FLAG (ri->flags, BGP_INFO_IGNORED_P); ++ ri = av->sub->info; ++ if (ri && ri->peer && ri->peer->bgp) ++ bgp_process (ri->peer->bgp, av->sub, ++ av->sub->table->afi, av->sub->table->safi); ++ ++ } ++ } ++ } ++ */ ++ return 0; ++} ++ ++int ++bgp_pgbgp_update (struct bgp_info *binfo, struct attr *at, ++ struct bgp_node *rn) ++{ ++ time_t t_now = time (NULL); ++ ++ // Clean up the reuse list ++ bgp_pgbgp_reuse (t_now); ++ ++ ++ if (!rn->hist) ++ { ++ rn->hist = ++ XCALLOC (MTYPE_BGP_PGBGP_HIST, sizeof (struct bgp_pgbgp_hist)); ++ // Get the PGBGP history lock on rn ++ bgp_lock_node (rn); ++ } ++ ++ struct bgp_node *superhn = NULL; ++ ++ // implicit lock from node_get ++ superhn = findSuper (rn->table, &rn->p, t_now); ++ ++ int newPeer = bgp_pgbgp_updatePeer (binfo, t_now); ++ bgp_pgbgp_updateOrigin (rn->hist, binfo, at, rn, t_now, newPeer); ++ bgp_pgbgp_updatePrefix (rn->hist, superhn, binfo, at, rn, t_now, newPeer); ++ bgp_pgbgp_updateEdge (rn->hist, binfo, at, rn, t_now, newPeer); ++ ++ if (superhn != NULL) ++ bgp_unlock_node (superhn); ++ ++ ++ ++ // GC and storage must be last, as they update lastSeen values of objects ++ // which would cause new routes to be recently seen, which is undesired behavior ++ // Make sure you don't collect anything that might be in use! ++ if (t_now >= pgbgp->lastgc + PGBGP_GC_DELTA) ++ { ++ bgp_pgbgp_gc (rn->table); ++ pgbgp->lastgc = t_now; ++ } ++ ++ if (t_now >= pgbgp->lastStore + PGBGP_STORE_DELTA) ++ { ++ bgp_pgbgp_store (rn->table); ++ pgbgp->lastStore = t_now; ++ } ++ ++ ++ ++ return 0; ++} ++ ++ ++ ++ ++/*! --------------- Public PGBGP Interface ------------------ !*/ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/* --------------- MOAS Detection ------------------ */ ++void ++bgp_pgbgp_storeHistTable (struct bgp_table *table, FILE * file) ++{ ++ time_t t_now; ++ t_now = time (NULL); ++ ++ struct bgp *bgp = bgp_get_default (); ++ if (!bgp) ++ return; ++ ++ // Store each AFI/SAFI RIB ++ for (afi_t afi = AFI_IP; afi < AFI_MAX; afi++) ++ for (safi_t safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) ++ { ++ if (!CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_PGBGP)) ++ continue; ++ struct bgp_table *curTable = bgp->rib[afi][safi]; ++ if (!curTable) ++ continue; ++ ++ for (struct bgp_node * rn = bgp_table_top (curTable); rn; ++ rn = bgp_route_next (rn)) ++ { ++ struct bgp_pgbgp_hist *hist = rn->hist; ++ if (hist == NULL) ++ continue; ++ char szPrefix[128]; ++ prefix2str (&rn->p, szPrefix, sizeof (szPrefix)); ++ ++ ++ struct bgp_pgbgp_prefix *pre = hist->p; ++ if (pre && pre->ignoreUntil <= t_now) ++ { ++ if (pre->lastSeen + pgbgp->prefix_hist_time > t_now) ++ fprintf (file, "%d %s %u %u %lld\n", PREFIX_ID, szPrefix, ++ (unsigned int) afi, (unsigned int) safi, ++ (long long int) pre->lastSeen); ++ else ++ continue; ++ } ++ /* Need a prefix in the file before the origins, ++ if no prefix.. skip origins */ ++ else ++ continue; ++ ++ for (struct bgp_pgbgp_origin * cur = hist->o; cur; ++ cur = cur->next) ++ { ++ if (cur->deprefUntil > t_now) ++ continue; ++ ++ if (cur->lastSeen + pgbgp->origin_hist_time > t_now) ++ fprintf (file, "%d %u %lld\n", ORIGIN_ID, cur->originAS, ++ (long long int) cur->lastSeen); ++ } ++ ++ } ++ } ++} ++ ++ ++int ++bgp_pgbgp_garbageCollectHistTable (struct bgp_table *table) ++{ ++ time_t t_now; ++ t_now = time (NULL); ++ ++ ++ for (struct bgp_node * rn = bgp_table_top (table); rn; ++ rn = bgp_route_next (rn)) ++ { ++ int collect = false; ++ struct bgp_pgbgp_hist *hist = rn->hist; ++ if (hist == NULL) ++ continue; ++ ++ struct bgp_pgbgp_origin *cur = hist->o; ++ struct bgp_pgbgp_prefix *pre = hist->p; ++ struct bgp_pgbgp_origin *parent = NULL; ++ ++ int used = false; ++ if (cur != NULL || pre != NULL) ++ used = true; ++ ++ while (cur != NULL) ++ { ++ // Update the lastSeen time w/ originInRIB ++ if (originInRIB (rn, cur)) ++ cur->lastSeen = t_now; ++ ++ collect = false; ++ ++ // Collect if old ++ if (cur->lastSeen + pgbgp->origin_hist_time <= t_now) ++ collect = true; ++ ++ // Collect if anomaly just became okay but not seen since last collection ++ if (cur->deprefUntil != 0 && cur->deprefUntil < t_now) ++ { ++ if (cur->lastSeen < pgbgp->lastgc) ++ collect = true; ++ cur->deprefUntil = 0; ++ } ++ ++ if (collect) ++ { ++ if (parent == NULL) ++ hist->o = cur->next; ++ else ++ parent->next = cur->next; ++ ++ // Delete cur, parent doesn't change ++ struct bgp_pgbgp_origin *del = cur; ++ cur = cur->next; ++ XFREE (MTYPE_BGP_PGBGP_ORIGIN, del); ++ } ++ else ++ { ++ parent = cur; ++ cur = cur->next; ++ } ++ } ++ ++ // Update the lastSeen time w/ prefixInRIB ++ if (pre && prefixInRIB (rn, pre)) ++ pre->lastSeen = t_now; ++ ++ collect = false; ++ ++ // Collect if old ++ if (pre && pre->lastSeen + pgbgp->prefix_hist_time <= t_now) ++ collect = true; ++ ++ // Collect if anomaly just became okay but not seen since last collection ++ if (pre && pre->ignoreUntil != 0 && pre->ignoreUntil < t_now) ++ { ++ if (pre->lastSeen < pgbgp->lastgc) ++ collect = true; ++ pre->ignoreUntil = 0; ++ } ++ ++ if (collect) ++ { ++ for (struct bgp_pgbgp_avoid * av = pre->avoid; av;) ++ { ++ struct bgp_pgbgp_avoid *del = av; ++ av = av->next; ++ bgp_unlock_node (del->sub); ++ XFREE (MTYPE_BGP_PGBGP_AVOID, del); ++ } ++ ++ XFREE (MTYPE_BGP_PGBGP_PREFIX, pre); ++ hist->p = NULL; ++ } ++ ++ // If the node isn't in use, remove it ++ if (used && hist->o == NULL && hist->p == NULL) ++ { ++ XFREE (MTYPE_BGP_PGBGP_HIST, hist); ++ rn->hist = NULL; ++ bgp_unlock_node (rn); ++ } ++ } ++ ++ return 0; ++} ++ ++void ++bgp_pgbgp_cleanHistTable (struct bgp_table *table) ++{ ++ // Clean up the RIB nodes ++ for (struct bgp_node * rn = bgp_table_top (table); rn; ++ rn = bgp_route_next (rn)) ++ { ++ struct bgp_pgbgp_hist *hist = rn->hist; ++ if (hist == NULL) ++ continue; ++ ++ if (hist->p) ++ { ++ for (struct bgp_pgbgp_avoid * av = hist->p->avoid; av;) ++ { ++ struct bgp_pgbgp_avoid *del = av; ++ av = av->next; ++ bgp_unlock_node (del->sub); ++ XFREE (MTYPE_BGP_PGBGP_AVOID, del); ++ } ++ hist->p->avoid = NULL; ++ XFREE (MTYPE_BGP_PGBGP_PREFIX, hist->p); ++ hist->p = NULL; ++ } ++ ++ for (struct bgp_pgbgp_origin * cur = hist->o; cur;) ++ { ++ struct bgp_pgbgp_origin *next = cur->next; ++ XFREE (MTYPE_BGP_PGBGP_ORIGIN, cur); ++ cur = next; ++ } ++ hist->o = NULL; ++ XFREE (MTYPE_BGP_PGBGP_HIST, hist); ++ rn->hist = NULL; ++ bgp_unlock_node (rn); ++ } ++} ++ ++void ++bgp_pgbgp_logOriginAnomaly (as_t asn, struct bgp_node *rn, struct attr *at) ++{ ++ assert (pgbgp); ++ if (!pgbgp->anomalies) ++ return; ++ FILE *file = fopen (pgbgp->anomalies, "a"); ++ if (!file) ++ return; ++ ++ char pre[256]; ++ prefix2str (&rn->p, pre, sizeof (pre)); ++ ++ // MOAS | TIME | NEXTHOP | PREFIX | SUSPICIOUS_ORIGIN | TRUSTED_ORIGINS | PATH ++ fprintf (file, "%d|%lld|%s|%s|%d|", MOAS, (long long int) time (NULL), ++ inet_ntoa (at->nexthop), pre, asn); ++ ++ ++ // Print the trusted origins ++ assert (rn->hist); ++ assert (rn->hist->o); ++ ++ struct bgp_pgbgp_hist *hist = rn->hist; ++ ++ for (struct bgp_pgbgp_origin * cur = hist->o; cur != NULL; cur = cur->next) ++ { ++ if (cur->deprefUntil > time (NULL)) ++ continue; ++ fprintf (file, "%d", cur->originAS); ++ if (cur->next != NULL) ++ fprintf (file, " "); ++ } ++ ++ fprintf (file, " |%s\n", aspath_print (at->aspath)); ++ fclose (file); ++} ++ ++int ++bgp_pgbgp_updateOrigin (struct bgp_pgbgp_hist *hist, struct bgp_info *binfo, ++ struct attr *at, struct bgp_node *rn, time_t t_now, ++ int newPeer) ++{ ++ struct bgp_pgbgp_pathSet pathOrigins; ++ struct bgp_pgbgp_origin *pi = NULL; ++ int status = 0; ++ struct bgp_pgbgp_reuse *r; ++ pathOrigins = bgp_pgbgp_pathOrigin (at->aspath); ++ ++ ++ for (int i = 0; i < pathOrigins.length; i++) ++ { ++ as_t pathOrigin = pathOrigins.ases[i]; ++ ++ /* Is the Origin AS in the history? */ ++ for (pi = hist->o; pi; pi = pi->next) ++ if (pi->originAS == pathOrigin) ++ break; ++ ++ if (pi == NULL) ++ { ++ pi = ++ XCALLOC (MTYPE_BGP_PGBGP_ORIGIN, ++ sizeof (struct bgp_pgbgp_origin)); ++ pi->next = hist->o; ++ pi->originAS = pathOrigin; ++ hist->o = pi; ++ } ++ ++ // If this is our first origin for the prefix, let the sub-prefix ++ // check take care of it ++ if (pi->next == NULL) ++ goto UPO_CLEAN; ++ ++ /* Is the origin currently marked as suspicious? */ ++ if (pi->deprefUntil > t_now) ++ goto UPO_DEPREF; ++ ++ /* Have we seen the origin recently? */ ++ if (pi->lastSeen + pgbgp->origin_hist_time > t_now) ++ goto UPO_CLEAN; ++ ++#ifndef PGBGP_DEBUG ++ /* Are we within the initial grace period? */ ++ if (newPeer) ++ goto UPO_CLEAN; ++#endif ++ ++ /* It must not be in recent history, depref origin for first time */ ++ pi->deprefUntil = t_now + pgbgp->origin_sus_time; ++ bgp_pgbgp_logOriginAnomaly (pathOrigin, rn, at); ++ ++ r = XCALLOC (MTYPE_BGP_PGBGP_REUSE, sizeof (struct bgp_pgbgp_reuse)); ++ r->type = PGBGP_REUSE_ORIGIN; ++ r->deprefUntil = pi->deprefUntil; ++ r->data.origin.originAS = pathOrigin; ++ r->data.origin.rn = rn; ++ bgp_lock_node (rn); ++ pqueue_enqueue (r, pgbgp->reuse_q); ++ pgbgp->rq_size += 1; ++ ++ ++ UPO_DEPREF: ++ SET_FLAG (binfo->flags, BGP_INFO_SUSPICIOUS_O); ++ status = BGP_INFO_SUSPICIOUS_O; ++ ++ UPO_CLEAN: ++ pi->lastSeen = t_now; ++ } ++ return status; ++} ++ ++int ++bgp_pgbgp_reuseOrigin (struct bgp_pgbgp_r_origin data) ++{ ++ struct bgp_info *ri; ++ int numChanged = 0; ++ time_t t_now = time (NULL); ++ assert (data.rn->hist != NULL); ++ ++ // Repreference paths for this prefix that are now okay ++ for (ri = data.rn->info; ri; ri = ri->next) ++ { ++ if (CHECK_FLAG (ri->flags, BGP_INFO_SUSPICIOUS_O)) ++ { ++ struct bgp_pgbgp_pathSet pathOrigins; ++ pathOrigins = bgp_pgbgp_pathOrigin (ri->attr->aspath); ++ int numOkay = 0; ++ for (int i = 0; i < pathOrigins.length; i++) ++ { ++ as_t pathOrigin = pathOrigins.ases[i]; ++ // Find the origin ++ struct bgp_pgbgp_origin *o = NULL; ++ for (o = data.rn->hist->o; o != NULL; o = o->next) ++ if (o->originAS == pathOrigin) ++ break; ++ /* ++ if (o == NULL) { ++ for(struct bgp_pgbgp_origin * z = data.rn->hist->o; z != NULL; z = z->next) ++ printf("Known origin: %d\n", z->originAS); ++ char pre[128]; ++ prefix2str(&data.rn->p, pre, 128); ++ printf("%s : %s : %d\n", pre, ri->attr->aspath->str, pathOrigin); ++ } ++ */ ++ assert (o != NULL); ++ ++ if (o->deprefUntil <= t_now) ++ numOkay += 1; ++ } ++ if (numOkay == pathOrigins.length) ++ { ++ UNSET_FLAG (ri->flags, BGP_INFO_SUSPICIOUS_O); ++ numChanged += 1; ++ } ++ } ++ } ++ ++ ri = data.rn->info; ++ ++ // Rerun the decision process? ++ if (numChanged > 0) ++ bgp_process (ri->peer->bgp, data.rn, data.rn->table->afi, ++ data.rn->table->safi); ++ ++ ++ /* ++ // Remove this (origin,prefix) pair from the normal database ++ // if it's not still in the RIB ++ struct bgp_pgbgp_hist *hist = rn->hist; ++ struct bgp_pgbgp_origin * cur = hist->o; ++ struct bgp_pgbgp_origin * parent = NULL; ++ ++ // Find the origin AS node ++ while(cur != NULL) ++ { ++ if (cur->originAS == data.originAS) ++ { ++ // Delete the node if it hasn't been seen ++ // since the last storage run ++ if (cur->lastSeen < pgbgp->lastStore) { ++ // Delete this node ++ if (parent == NULL) ++ hist->o = cur->next; ++ else ++ parent->next = cur->next; ++ ++ XFREE(MTYPE_BGP_PGBGP_ORIGIN, cur); ++ } ++ break; ++ } ++ parent = cur; ++ cur = cur->next; ++ } ++ */ ++ ++ bgp_unlock_node (data.rn); ++ return 0; ++} ++ ++/*! --------------- MOAS Detection ------------------ !*/ ++ ++ ++/* --------------- Sub-Prefix Detection ------------------ */ ++ ++ ++ ++ ++ ++void ++bgp_pgbgp_logSubprefixAnomaly (as_t asn, struct bgp_node *rn, struct attr *at, ++ struct bgp_node *super) ++{ ++ assert (pgbgp); ++ if (!pgbgp->anomalies) ++ return; ++ FILE *file = fopen (pgbgp->anomalies, "a"); ++ if (!file) ++ return; ++ ++ char pre[256]; ++ prefix2str (&rn->p, pre, sizeof (pre)); ++ ++ char superpre[256]; ++ prefix2str (&super->p, superpre, sizeof (superpre)); ++ ++ // SUBPREFIX | TIME | NEXTHOP | PREFIX | SUPER-PREFIX | SUSPICIOUS_ORIGIN | TRUSTED_ORIGINS | PATH ++ fprintf (file, "%d|%lld|%s|%s|%s|%d|", SUBPREFIX, ++ (long long int) time (NULL), inet_ntoa (at->nexthop), pre, ++ superpre, asn); ++ ++ // Print the trusted origins ++ assert (super->hist); ++ assert (super->hist->o); ++ ++ struct bgp_pgbgp_hist *hist = super->hist; ++ ++ for (struct bgp_pgbgp_origin * cur = hist->o; cur != NULL; cur = cur->next) ++ { ++ if (cur->deprefUntil > time (NULL)) ++ continue; ++ fprintf (file, "%d", cur->originAS); ++ if (cur->next != NULL) ++ fprintf (file, " "); ++ } ++ ++ fprintf (file, " |%s\n", aspath_print (at->aspath)); ++ fclose (file); ++} ++ ++/* ++ If the first path is a prefix of the second, then return true ++ */ ++ ++static int ++bgp_pgbgp_pathIsPrefix(struct aspath *trusted, struct aspath * new) ++{ ++ if (trusted == new) ++ return true; ++ ++ struct assegment *seg1 = trusted->segments; ++ struct assegment *seg2 = new->segments; ++ ++ while (seg1 || seg2) ++ { ++ if ((!seg1 && seg2) || (seg1 && !seg2)) ++ return false; ++ if (seg1->type != seg2->type) ++ return false; ++ ++ if (seg1->length > seg2->length) ++ return false; ++ ++ for(int i = 0; i < seg1->length; i++) ++ if (seg1->as[i] != seg2->as[i]) ++ return false; ++ ++ seg1 = seg1->next; ++ seg2 = seg2->next; ++ } ++ ++ return true; ++} ++ ++int ++bgp_pgbgp_updatePrefix (struct bgp_pgbgp_hist *hist, ++ struct bgp_node *supernode, struct bgp_info *binfo, ++ struct attr *at, struct bgp_node *rn, time_t t_now, ++ int newPeer) ++{ ++ struct bgp_pgbgp_prefix *pre = NULL; ++ struct bgp_pgbgp_reuse *r = NULL; ++ int status = 0; ++ int changed = false; ++ ++ pre = hist->p; ++ ++ ++ /* Do we have this prefix? */ ++ if (pre == NULL) ++ { ++ pre = ++ XCALLOC (MTYPE_BGP_PGBGP_PREFIX, sizeof (struct bgp_pgbgp_prefix)); ++ hist->p = pre; ++ } ++ ++ /* Is the prefix currently marked as suspicious? */ ++ if (pre->ignoreUntil > t_now) ++ { ++ goto UPP_IGNORE; ++ } ++ ++ /* Should this neighbor be avoided for this prefix because it ++ sent us info. about a suspicious sub-prefix? */ ++ for (struct bgp_pgbgp_avoid * av = hist->p->avoid; av; av = av->next) ++ { ++ if (binfo->peer->as == av->peerASN && av->avoidUntil > t_now) ++ { ++ SET_FLAG (binfo->flags, BGP_INFO_SUSPICIOUS_P); ++ status = BGP_INFO_SUSPICIOUS_P; ++ goto UPP_DONE; ++ } ++ } ++ ++ /* Have we seen the prefix recently? */ ++ if (pre->lastSeen + pgbgp->prefix_hist_time > t_now) ++ goto UPP_DONE; ++ ++#ifndef PGBGP_DEBUG ++ /* Are we within the initial grace period? */ ++ if (newPeer) ++ goto UPP_DONE; ++#endif ++ ++ /* Is there a less specific *in recent history* that this could be hijacking? */ ++ if (supernode == NULL) ++ goto UPP_DONE; ++ ++ /* Does this path the super-net's non-anomalous path from this peer? If so it's okay */ ++ int found = false; ++ for (struct bgp_info * ri = supernode->info; ri; ri = ri->next) ++ { ++ if (ri->peer->as == binfo->peer->as) ++ { ++ if (!ANOMALOUS(ri->flags) && bgp_pgbgp_pathIsPrefix(ri->attr->aspath, at->aspath)) ++ found = true; ++ break; ++ } ++ } ++ ++ if (found) ++ goto UPP_DONE; ++ ++ /* ++ It's not in recent history, and there is a less specific currently in use ++ Response: ++ . Ignore this prefix ++ . Make the less specific's route for this neighbor suspicious ++ */ ++ ++ ++ pre->ignoreUntil = t_now + pgbgp->sub_sus_time; ++ ++ struct bgp_pgbgp_pathSet pathOrigins; ++ pathOrigins = bgp_pgbgp_pathOrigin (at->aspath); ++ for (int i = 0; i < pathOrigins.length; i++) ++ bgp_pgbgp_logSubprefixAnomaly (pathOrigins.ases[i], rn, at, supernode); ++ ++ ++ ++ r = XCALLOC (MTYPE_BGP_PGBGP_REUSE, sizeof (struct bgp_pgbgp_reuse)); ++ r->type = PGBGP_REUSE_PREFIX; ++ r->deprefUntil = pre->ignoreUntil; ++ r->data.prefix.rn = rn; ++ r->data.prefix.rnsuper = supernode; ++ bgp_lock_node (rn); ++ bgp_lock_node (supernode); ++ pqueue_enqueue (r, pgbgp->reuse_q); ++ pgbgp->rq_size += 1; ++ ++UPP_IGNORE: ++ // Sanity check ++ if (supernode == NULL) ++ goto UPP_DONE; ++ ++ /* Set the less specific's route from this peer to suspicious */ ++ changed = false; ++ ++ for (struct bgp_info * ri = supernode->info; ri; ri = ri->next) ++ { ++ if (ri->peer->as == binfo->peer->as) ++ { ++ if (!CHECK_FLAG (ri->flags, BGP_INFO_SUSPICIOUS_P)) ++ { ++ SET_FLAG (ri->flags, BGP_INFO_SUSPICIOUS_P); ++ changed = true; ++ } ++ break; ++ } ++ } ++ ++ // Make note of it in the less specific's history information ++ found = false; ++ struct bgp_pgbgp_hist *superhist = supernode->hist; ++ ++ if (superhist && superhist->p) ++ { ++ for (struct bgp_pgbgp_avoid * av = superhist->p->avoid; av; ++ av = av->next) ++ { ++ if (av->peerASN == binfo->peer->as) ++ { ++ if (av->avoidUntil < pre->ignoreUntil) ++ av->avoidUntil = pre->ignoreUntil; ++ found = true; ++ break; ++ } ++ } ++ if (!found) ++ { ++ struct bgp_pgbgp_avoid *newavoid = ++ XCALLOC (MTYPE_BGP_PGBGP_AVOID, sizeof (struct bgp_pgbgp_avoid)); ++ newavoid->peerASN = binfo->peer->as; ++ newavoid->avoidUntil = pre->ignoreUntil; ++ newavoid->next = superhist->p->avoid; ++ newavoid->sub = rn; ++ bgp_lock_node (rn); ++ superhist->p->avoid = newavoid; ++ } ++ } ++ /* ++ ignore this route unless the supernet's node ++ is only a placeholder from loaded pgbgp data ++ */ ++ if (bgp_pgbgp_shouldIgnore (supernode, bgp_pgbgp_selected (supernode))) ++ { ++ SET_FLAG (binfo->flags, BGP_INFO_IGNORED_P); ++ status = BGP_INFO_IGNORED_P; ++ } ++ if (changed) ++ { ++ struct bgp_info *ri = supernode->info; ++ bgp_process (ri->peer->bgp, supernode, supernode->table->afi, ++ supernode->table->safi); ++ } ++ ++UPP_DONE: ++ pre->lastSeen = t_now; ++ ++ return status; ++} ++ ++int ++bgp_pgbgp_reusePrefix (struct bgp_pgbgp_r_prefix data) ++{ ++ struct bgp_info *ri = NULL; ++ ++ time_t t_now = time (NULL); ++ ++ // Repreference all routes for this node ++ for (ri = data.rn->info; ri; ri = ri->next) ++ UNSET_FLAG (ri->flags, BGP_INFO_IGNORED_P); ++ ri = data.rn->info; ++ ++ // Rerun the decision process ++ if (ri != NULL) ++ bgp_process (ri->peer->bgp, data.rn, data.rn->table->afi, ++ data.rn->table->safi); ++ ++ ++ // Remove the avoid nodes from the super ++ struct bgp_pgbgp_hist *superhist = data.rnsuper->hist; ++ if (superhist != NULL && superhist->p != NULL) ++ { ++ struct bgp_pgbgp_avoid *parent = NULL; ++ for (struct bgp_pgbgp_avoid * av = superhist->p->avoid; av;) ++ { ++ int numChanged = 0; ++ if (av->avoidUntil <= t_now) ++ { ++ struct bgp_pgbgp_avoid *del = av; ++ av = av->next; ++ if (parent == NULL) ++ superhist->p->avoid = av; ++ else ++ parent->next = av; ++ ++ // Repreference any routes ++ for (ri = data.rnsuper->info; ri; ri = ri->next) ++ { ++ if (ri->peer->as == del->peerASN) ++ { ++ UNSET_FLAG (ri->flags, BGP_INFO_SUSPICIOUS_P); ++ numChanged += 1; ++ break; ++ } ++ } ++ ri = data.rnsuper->info; ++ ++ if (numChanged > 0 && ri != NULL) ++ bgp_process (ri->peer->bgp, data.rnsuper, ++ data.rnsuper->table->afi, ++ data.rnsuper->table->safi); ++ bgp_unlock_node (del->sub); ++ XFREE (MTYPE_BGP_PGBGP_AVOID, del); ++ } ++ else ++ { ++ parent = av; ++ av = av->next; ++ } ++ } ++ } ++ ++ // Remove this prefix from the normal database ++ // if it hasn't been seen in the RIB since the last ++ // storage run ++ /* ++ struct bgp_pgbgp_hist *hist = rn->hist; ++ struct bgp_pgbgp_prefix * pre = hist->p; ++ ++ if (pre && pre->lastSeen < pgbgp->lastStore) ++ { ++ // Delete this node ++ for(struct bgp_pgbgp_avoid * av = hist->p->avoid; av;) ++ { ++ struct bgp_pgbgp_avoid *del = av; ++ av = av->next; ++ bgp_unlock_node(del->sub); ++ XFREE (MTYPE_BGP_PGBGP_AVOID, del); ++ } ++ XFREE(MTYPE_BGP_PGBGP_PREFIX, pre); ++ hist->p = NULL; ++ } ++ */ ++ bgp_unlock_node (data.rn); ++ bgp_unlock_node (data.rnsuper); ++ return 0; ++} ++ ++/*! --------------- Sub-Prefix Detection ------------------ !*/ ++ ++ ++ ++ ++ ++/* --------------- Edge Detection ------------------ */ ++ ++static void ++edge_store_clear_iterator (struct hash_backet *backet, void *file) ++{ ++ struct bgp_pgbgp_edge *hedge = backet->data; ++} ++ ++static void ++edge_store_iterator (struct hash_backet *backet, FILE * file) ++{ ++ struct bgp_pgbgp_edge *hedge = backet->data; ++ time_t t_now = time (NULL); ++ if (hedge->deprefUntil > t_now) ++ return; ++ if (hedge->lastSeen + pgbgp->edge_hist_time > t_now) ++ { ++ fprintf (file, "%d %u %u %lld\n", EDGE_ID, hedge->e.a, hedge->e.b, ++ (long long int) hedge->lastSeen); ++ } ++} ++ ++ ++void ++bgp_pgbgp_storeEdges (struct bgp_table *table, FILE * file) ++{ ++ hash_iterate (pgbgp->edgeT, ++ (void (*)(struct hash_backet *, void *)) ++ edge_store_iterator, file); ++ return; ++} ++ ++ ++int ++bgp_pgbgp_restoreEdge (FILE * file) ++{ ++ unsigned int a, b; ++ long long int lastSeen; ++ fscanf (file, "%u %u %lld", &a, &b, &lastSeen); ++ struct bgp_pgbgp_edge finder; ++ finder.e.a = a; ++ finder.e.b = b; ++ finder.lastSeen = lastSeen; ++ struct bgp_pgbgp_edge *hedge = ++ hash_get (pgbgp->edgeT, &finder, edge_hash_alloc); ++ hedge->lastSeen = finder.lastSeen; ++ return 0; ++} ++ ++unsigned int ++edge_key_make (void *p) ++{ ++ struct bgp_pgbgp_edge *pe = p; ++ struct edge *e = &pe->e; ++ return (e->a << 16) + e->b; ++} ++ ++static int ++edge_cmp (const void *arg1, const void *arg2) ++{ ++ ++ const struct edge *e1 = &((const struct bgp_pgbgp_edge *) arg1)->e; ++ const struct edge *e2 = &((const struct bgp_pgbgp_edge *) arg2)->e; ++ if (e1->a == e2->a && e1->b == e2->b) ++ return 1; ++ return 0; ++} ++ ++static void * ++edge_hash_alloc (void *arg) ++{ ++ struct bgp_pgbgp_edge *hedge = ++ XCALLOC (MTYPE_BGP_PGBGP_EDGE, sizeof (struct bgp_pgbgp_edge)); ++ struct bgp_pgbgp_edge *lookup = arg; ++ if (hedge == NULL) ++ return NULL; ++ hedge->e = lookup->e; ++ return hedge; ++} ++ ++ ++static void ++edge_gc_iterator (struct hash_backet *backet, time_t * time) ++{ ++ time_t t_now = *time; ++ struct bgp_pgbgp_edge *hedge = backet->data; ++ ++ int collect = false; ++ ++ // Collect if we haven't seen it in awhile ++ if (hedge->lastSeen + pgbgp->edge_hist_time <= t_now) ++ collect = true; ++ ++ // Collect if it has just gotten out of anomaly stage ++ // but hasn't been in the RIB since the last GC ++ if (hedge->deprefUntil != 0 && hedge->deprefUntil < t_now) ++ { ++ if (hedge->lastSeen < pgbgp->lastgc) ++ collect = true; ++ hedge->deprefUntil = 0; ++ } ++ ++ if (collect) ++ { ++ struct bgp_pgbgp_edge *ret = hash_release (pgbgp->edgeT, hedge); ++ assert (ret != NULL); ++ XFREE (MTYPE_BGP_PGBGP_EDGE, hedge); ++ } ++} ++ ++ ++ ++static void ++edge_update_iterator (struct hash_backet *backet, void *v) ++{ ++ struct aspath *p = backet->data; ++ time_t t_now = time (NULL); ++ int first = true; ++ ++ struct edge cur; ++ cur.a = 0; ++ cur.b = 0; ++ struct assegment *seg; ++ struct bgp_pgbgp_edge *hedge = NULL; ++ for (seg = p->segments; seg; seg = seg->next) ++ { ++ for (int i = 0; i < seg->length; i++) ++ { ++ cur.a = cur.b; ++ cur.b = seg->as[i]; ++ if (first) ++ { ++ first = false; ++ continue; ++ } ++ if (cur.a == cur.b) ++ continue; ++ // printf("%d -- %d\n", cur.a, cur.b); ++ struct bgp_pgbgp_edge finder; ++ finder.e = cur; ++ hedge = hash_lookup (pgbgp->edgeT, &finder); ++ ++ if (!hedge) ++ continue; ++ hedge->lastSeen = t_now; ++ } ++ } ++} ++ ++int ++bgp_pgbgp_garbageCollectEdges (struct bgp_table *table) ++{ ++ // Update the timings ++ hash_iterate (ashash, ++ (void (*)(struct hash_backet *, void *)) ++ edge_update_iterator, NULL); ++ ++ // Perform the collection ++ time_t t_now = time (NULL); ++ hash_iterate (pgbgp->edgeT, ++ (void (*)(struct hash_backet *, void *)) ++ edge_gc_iterator, &t_now); ++ return 0; ++} ++ ++static void ++edge_clean_iterator (struct hash_backet *backet, void *a1) ++{ ++ struct bgp_pgbgp_edge *hedge = backet->data; ++ struct bgp_pgbgp_edge *ret = hash_release (pgbgp->edgeT, hedge); ++ assert (ret != NULL); ++ XFREE (MTYPE_BGP_PGBGP_EDGE, hedge); ++} ++ ++static void ++bgp_pgbgp_cleanEdges (void) ++{ ++ if (pgbgp->edgeT != NULL) ++ { ++ hash_iterate (pgbgp->edgeT, ++ (void (*)(struct hash_backet *, void *)) ++ edge_clean_iterator, NULL); ++ hash_free (pgbgp->edgeT); ++ } ++ return; ++} ++ ++void ++bgp_pgbgp_logEdgeAnomaly (struct bgp_node *rn, struct attr *at, ++ struct edge *edge) ++{ ++ assert (pgbgp); ++ if (!pgbgp->anomalies) ++ return; ++ FILE *file = fopen (pgbgp->anomalies, "a"); ++ if (!file) ++ return; ++ ++ char pre[256]; ++ prefix2str (&rn->p, pre, sizeof (pre)); ++ ++ // EDGE | TIME | NEXTHOP | PREFIX | PATH | Edge.a | Edge.b ++ ++ fprintf (file, "%d|%lld|%s|%s|%s|%d|%d\n", EDGE, ++ (long long int) time (NULL), inet_ntoa (at->nexthop), pre, ++ aspath_print (at->aspath), edge->a, edge->b); ++ ++ fclose (file); ++} ++ ++ ++int ++bgp_pgbgp_updateEdge (struct bgp_pgbgp_hist *hist, struct bgp_info *binfo, ++ struct attr *at, struct bgp_node *rn, time_t t_now, ++ int newPeer) ++{ ++ ++ char first = true; ++ struct edge curEdge; ++ curEdge.a = 0; ++ curEdge.b = 0; ++ ++ ++ if (at->aspath == NULL) ++ return 0; ++ struct assegment *seg = at->aspath->segments; ++ if (seg == NULL) ++ return 0; ++ time_t max_depref = 0; ++ for (seg = at->aspath->segments; seg; seg = seg->next) ++ { ++ for (int i = 0; i < seg->length; i++) ++ { ++ curEdge.a = curEdge.b; ++ curEdge.b = seg->as[i]; ++ if (first) ++ { ++ first = false; ++ continue; ++ } ++ if (curEdge.a == curEdge.b) ++ continue; ++ ++ // We have an edge to consider ++ struct bgp_pgbgp_edge finder; ++ finder.e = curEdge; ++ struct bgp_pgbgp_edge *hedge = ++ hash_get (pgbgp->edgeT, &finder, edge_hash_alloc); ++ ++ // Is this edge marked as suspicious? ++ if (hedge->deprefUntil > t_now) ++ goto UPE_DEPREF; ++ ++ // Have we seen the edge recently? ++ if (hedge->lastSeen + pgbgp->edge_hist_time > t_now) ++ goto UPE_CLEAN; ++#ifndef PGBGP_DEBUG ++ /* Are we within the initial grace period? */ ++ if (newPeer) ++ goto UPE_CLEAN; ++#endif ++ // It must not be in recent history, depref edge for first time ++ hedge->deprefUntil = t_now + pgbgp->edge_sus_time; ++ bgp_pgbgp_logEdgeAnomaly (rn, at, &curEdge); ++ ++ ++ UPE_DEPREF: ++ if (hedge->deprefUntil > max_depref) ++ max_depref = hedge->deprefUntil; ++ UPE_CLEAN: ++ hedge->lastSeen = t_now; ++ } ++ } ++ if (max_depref) ++ { ++ SET_FLAG (binfo->flags, BGP_INFO_SUSPICIOUS_E); ++ if (!hist->pEdgeReuse) ++ { ++ struct bgp_pgbgp_reuse *r; ++ r = ++ XCALLOC (MTYPE_BGP_PGBGP_REUSE, sizeof (struct bgp_pgbgp_reuse)); ++ r->type = PGBGP_REUSE_EDGE; ++ r->deprefUntil = max_depref; ++ r->data.edge.rn = rn; ++ bgp_lock_node (rn); ++ pqueue_enqueue (r, pgbgp->reuse_q); ++ pgbgp->rq_size += 1; ++ hist->pEdgeReuse = r; ++ } ++ return BGP_INFO_SUSPICIOUS_E; ++ } ++ ++ return 0; ++} ++ ++int ++bgp_pgbgp_reuseEdge (struct bgp_pgbgp_r_edge data) ++{ ++ ++ // Okay, go through all of the paths for the prefix ++ // and find the path that needs to be updated next and ++ // enqueue it ++ time_t minMax = 0; ++ int numChanged = 0; ++ time_t t_now = time (NULL); ++ ++ for (struct bgp_info * ri = data.rn->info; ri; ri = ri->next) ++ { ++ char first = true; ++ struct edge curEdge = { 0, 0 }; ++ struct assegment *seg; ++ time_t max_depref = 0; ++ ++ for (seg = ri->attr->aspath->segments; seg; seg = seg->next) ++ { ++ for (int i = 0; i < seg->length; i++) ++ { ++ curEdge.a = curEdge.b; ++ curEdge.b = seg->as[i]; ++ if (first) ++ { ++ first = false; ++ continue; ++ } ++ struct bgp_pgbgp_edge finder; ++ finder.e = curEdge; ++ struct bgp_pgbgp_edge *hedge = ++ hash_lookup (pgbgp->edgeT, &finder); ++ if (!hedge) ++ continue; ++ // Is this edge suspicious? ++ if (hedge->deprefUntil > t_now ++ && hedge->deprefUntil > max_depref) ++ max_depref = hedge->deprefUntil; ++ } ++ } ++ ++ if (max_depref) ++ { ++ if (!minMax || max_depref < minMax) ++ minMax = max_depref; ++ } ++ else ++ { ++ if (CHECK_FLAG (ri->flags, BGP_INFO_SUSPICIOUS_E)) ++ { ++ UNSET_FLAG (ri->flags, BGP_INFO_SUSPICIOUS_E); ++ numChanged += 1; ++ } ++ } ++ } ++ struct bgp_info *ri = data.rn->info; ++ if (numChanged > 0 && ri) ++ bgp_process (ri->peer->bgp, data.rn, data.rn->table->afi, ++ data.rn->table->safi); ++ ++ struct bgp_pgbgp_hist *hist = data.rn->hist; ++ hist->pEdgeReuse = NULL; ++ ++ if (minMax) ++ { ++ struct bgp_pgbgp_reuse *r; ++ r = XCALLOC (MTYPE_BGP_PGBGP_REUSE, sizeof (struct bgp_pgbgp_reuse)); ++ r->type = PGBGP_REUSE_EDGE; ++ r->deprefUntil = minMax; ++ r->data.edge.rn = data.rn; ++ pqueue_enqueue (r, pgbgp->reuse_q); ++ pgbgp->rq_size += 1; ++ hist->pEdgeReuse = r; ++ } ++ else ++ { ++ bgp_unlock_node (data.rn); ++ } ++ ++ return 0; ++} +--- /dev/null ++++ b/bgpd/bgp_pgbgp.h +@@ -0,0 +1,286 @@ ++/* BGP Pretty Good BGP ++ Copyright (C) 2008 University of New Mexico (Josh Karlin) ++ ++This file is part of GNU Zebra. ++ ++GNU Zebra is free software; you can redistribute it and/or modify it ++under the terms of the GNU General Public License as published by the ++Free Software Foundation; either version 2, or (at your option) any ++later version. ++ ++GNU Zebra 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 GNU Zebra; see the file COPYING. If not, write to the Free ++Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ++02111-1307, USA. */ ++ ++#ifndef _QUAGGA_BGP_PGBGP_H ++#define _QUAGGA_BGP_PGBGP_H ++ ++#include "bgpd.h" ++#include "bgp_route.h" ++#include "table.h" ++ ++#define MOAS 0 ++#define SUBPREFIX 1 ++#define EDGE 2 ++ ++/* Global PGBGP data */ ++struct bgp_pgbgp_config ++{ ++ /* Depref time for a new origin AS */ ++ time_t origin_sus_time; ++ ++ /* Depref time for a new edge */ ++ time_t edge_sus_time; ++ ++ /* Depref time for a new sub-prefix */ ++ time_t sub_sus_time; ++ ++ /* Origin AS Mapping History Length */ ++ time_t origin_hist_time; ++ ++ /* Prefix Mapping History Length */ ++ time_t prefix_hist_time; ++ ++ /* Edge Mapping History Length */ ++ time_t edge_hist_time; ++ ++ /* Peer Mapping History Length */ ++ time_t peer_hist_time; ++ ++ /* The list of depreferenced routes */ ++ struct pqueue *reuse_q; ++ int rq_size; ++ ++ /* Time that the last garbage collection (gc) took place */ ++ time_t lastgc; ++ ++ /* History table */ ++ // struct route_table *histT; ++ ++ /* Edge Hash Table */ ++ struct hash *edgeT; ++ ++ /* File path for history storage */ ++ char *storage; ++ ++ /* File path for dump of anomalous routes */ ++ char *anomalies; ++ ++ /* The time that we last stored to disk */ ++ time_t lastStore; ++ ++ /* The time that PGBGP started counting */ ++ time_t startTime; ++ ++ /* Last time each peer was seen */ ++ struct bgp_pgbgp_peerTime *peerLast; ++ ++}; ++ ++ ++struct bgp_pgbgp_peerTime ++{ ++ struct bgp_pgbgp_peerTime *next; ++ time_t lastSeen; ++ union sockunion su; ++ time_t deprefUntil; ++}; ++ ++struct edge ++{ ++ as_t a; ++ as_t b; ++}; ++ ++/* ++ Avoid the neighbors for the less specific that told you about ++ the more specific ++ */ ++struct bgp_pgbgp_avoid ++{ ++ struct bgp_pgbgp_avoid *next; ++ time_t avoidUntil; ++ as_t peerASN; ++ struct bgp_node *sub; ++}; ++ ++/* A list of origin ASes for a path ++ Usually it's only one but if the last AS ++ in the path is an AS set, then the whole ++ set must be returned ++*/ ++struct bgp_pgbgp_pathSet ++{ ++ int length; ++ as_t *ases; ++}; ++ ++/* ++ Avoid paths with suspicious origins ++ */ ++struct bgp_pgbgp_origin ++{ ++ struct bgp_pgbgp_origin *next; ++ time_t lastSeen; ++ time_t deprefUntil; ++ as_t originAS; ++}; ++ ++/* ++ Ignore routes for this prefix ++ */ ++struct bgp_pgbgp_prefix ++{ ++ time_t lastSeen; ++ time_t ignoreUntil; ++ struct bgp_pgbgp_avoid *avoid; ++}; ++ ++struct bgp_pgbgp_edge ++{ ++ time_t lastSeen; ++ time_t deprefUntil; ++ struct edge e; ++}; ++ ++struct bgp_pgbgp_hist ++{ ++ struct bgp_pgbgp_origin *o; ++ struct bgp_pgbgp_prefix *p; ++ struct bgp_pgbgp_reuse *pEdgeReuse; ++}; ++ ++struct bgp_pgbgp_r_origin ++{ ++ as_t originAS; ++ struct bgp_node *rn; ++}; ++ ++struct bgp_pgbgp_r_prefix ++{ ++ struct bgp_node *rn; ++ struct bgp_node *rnsuper; ++}; ++ ++/* ++ This node contained a route with a bad edge, check ++ it again for bad edges in 24 hours ++*/ ++struct bgp_pgbgp_r_edge ++{ ++ struct bgp_node *rn; ++}; ++ ++ ++union reuseTypes ++{ ++ struct bgp_pgbgp_r_origin origin; ++ struct bgp_pgbgp_r_prefix prefix; ++ struct bgp_pgbgp_r_edge edge; ++}; ++ ++struct bgp_pgbgp_reuse ++{ ++ union reuseTypes data; ++ short type; ++ time_t deprefUntil; ++}; ++ ++#define ANOMALOUS(V) \ ++(CHECK_FLAG(V, BGP_INFO_SUSPICIOUS_O | BGP_INFO_SUSPICIOUS_P \ ++ | BGP_INFO_SUSPICIOUS_E | BGP_INFO_IGNORED_P)) ++ ++#define PGBGP_REUSE_ORIGIN 0 ++#define PGBGP_REUSE_PREFIX 1 ++#define PGBGP_REUSE_EDGE 2 ++ ++#define BGP_PGBGP_NONE 0 ++#define BGP_PGBGP_DEPREFFED 1 ++ ++// For storage ++#define ORIGIN_ID 0 ++#define PREFIX_ID 1 ++#define EDGE_ID 2 ++#define PEER_ID 3 ++ ++/* Default timing values */ ++#define DEFAULT_ORIGIN_SUS (86400 * 1) ++#define DEFAULT_EDGE_SUS (86400 * 1) ++#define DEFAULT_SUB_SUS (86400 * 1) ++#define DEFAULT_ORIGIN_HIST (86400 * 30) ++#define DEFAULT_PREFIX_HIST (86400 * 10) ++#define DEFAULT_EDGE_HIST (86400 * 60) ++// Time between garbage collections ++#define PGBGP_GC_DELTA (3600) ++// Time between file stores ++#define PGBGP_STORE_DELTA (28800) ++// Time that a new peer's routes are not considered suspicious ++#define PGBGP_PEER_GRACE (86400 * 1) ++ ++ ++ ++///////// PUBLIC PGBGP FUNCTIONS ///////// ++ ++/* ++ bgp_pgbgp_enable: ++ Enable PGBGP depreferencing / history tracking for this afi/safi ++ ++ Arguments: ++ . ost: Depref. time of new prefix origins (in hours) ++ . est: Depref. time of new edges (in hours) ++ . sst: Depref. time of new sub-prefixes (in hours) ++ . oht: Storage time of known origins for prefixes (in days) ++ . pht: Storage time of known prefixes (in days) ++ . eht: Storage time of known edges (in days) ++ . storage: File to periodically store history in (can be /dev/null) ++ . anoms: File to store history of depreferenced routes (can be /dev/null) ++ ++ Caution: ++ It is important that the storage times are longer than the depreference times ++*/ ++extern int bgp_pgbgp_enable (struct bgp *, afi_t afi, safi_t safi, int ost, ++ int est, int sst, int oht, int pht, int eht, ++ const char *storage, const char *anoms); ++extern int bgp_pgbgp_disable (struct bgp *, afi_t afi, safi_t safi); ++ ++/* ++ bgp_pgbgp_update: ++ Call on the event of an announcement update ++ ++ Arguments: ++ bgp_info: The route ++ at: The new route's attributes ++*/ ++extern int bgp_pgbgp_update (struct bgp_info *, struct attr *at, ++ struct bgp_node *); ++ ++/* ++ bgp_pgbgp_rib_updated: ++ Call upon discovery of a new best path (or lack thereof) ++ ++ This is a special case function for smoothly handling sub-prefix hijacks. ++ ++ It handles the following 2 events: ++ ++ Event 1: An anomalous sub-prefix is ignored, but no best route for the super-prefix exists ++ Response: Announce the sub-prefix until the super-prefix comes back ++ ++ Event 2: A super-prefix comes back to the RIB and its anomalous sub-prefix is in use ++ Response: Ignore the sub-prefix again ++ ++ Arguments: ++ rn: The route node that a new best path was found for ++ old_best: The old best route (NULL if one did not exist) ++ new_best: The current best route (NULL if one does not exist) ++ */ ++extern int ++bgp_pgbgp_rib_updated (struct bgp_node *rn, struct bgp_info *old_best, ++ struct bgp_info *new_best); ++ ++#endif +--- a/bgpd/bgp_route.c ++++ b/bgpd/bgp_route.c +@@ -51,6 +51,7 @@ Software Foundation, Inc., 59 Temple Pla + #include "bgpd/bgp_mplsvpn.h" + #include "bgpd/bgp_nexthop.h" + #include "bgpd/bgp_damp.h" ++#include "bgpd/bgp_pgbgp.h" + #include "bgpd/bgp_advertise.h" + #include "bgpd/bgp_zebra.h" + #include "bgpd/bgp_vty.h" +@@ -339,12 +340,19 @@ bgp_info_cmp (struct bgp *bgp, struct bg + + *paths_eq = 0; + ++ + /* 0. Null check. */ + if (new == NULL) + return 0; + if (exist == NULL) + return 1; + ++ /* 0.5 PGBGP Depref. Check */ ++ if (ANOMALOUS(exist->flags) && !ANOMALOUS(new->flags)) ++ return 1; ++ if (!ANOMALOUS(exist->flags) && ANOMALOUS(new->flags)) ++ return 0; ++ + /* 1. Weight check. */ + if (new->attr->extra) + new_weight = new->attr->extra->weight; +@@ -1583,6 +1591,10 @@ bgp_process_main (struct work_queue *wq, + UNSET_FLAG (new_select->flags, BGP_INFO_MULTIPATH_CHG); + } + ++ /* PGBGP needs to know about selected routes */ ++ if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_PGBGP)) ++ bgp_pgbgp_rib_updated(rn, old_select, new_select); ++ + + /* Check each BGP peer. */ + for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) +@@ -1906,6 +1918,11 @@ bgp_update_rsclient (struct peer *rsclie + /* If the update is implicit withdraw. */ + if (ri) + { ++ /* Update PGBGP state, and mark the route as anomalous if necessary */ ++ if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_PGBGP) ++ && peer_sort(peer) == BGP_PEER_EBGP) ++ bgp_pgbgp_update(ri, attr_new, rn); ++ + ri->uptime = bgp_clock (); + + /* Same attribute comes in. */ +@@ -2337,6 +2354,11 @@ bgp_update_main (struct peer *peer, stru + /* Increment prefix */ + bgp_aggregate_increment (bgp, p, new, afi, safi); + ++ /* Update PGBGP state, and mark the route as anomalous if necessary */ ++ if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_PGBGP) ++ && peer_sort(peer) == BGP_PEER_EBGP) ++ bgp_pgbgp_update(new, attr_new, rn); ++ + /* Register new BGP information. */ + bgp_info_add (rn, new); + +@@ -5575,6 +5597,20 @@ enum bgp_display_type + static void + route_vty_short_status_out (struct vty *vty, struct bgp_info *binfo) + { ++ if (ANOMALOUS(binfo->flags)) ++ { ++ vty_out(vty, "a["); ++ if (CHECK_FLAG(binfo->flags, BGP_INFO_SUSPICIOUS_P)) ++ vty_out(vty, "i"); ++ if (CHECK_FLAG(binfo->flags, BGP_INFO_SUSPICIOUS_O)) ++ vty_out(vty, "p"); ++ if (CHECK_FLAG(binfo->flags, BGP_INFO_SUSPICIOUS_E)) ++ vty_out(vty, "e"); ++ if (CHECK_FLAG(binfo->flags, BGP_INFO_IGNORED_P)) ++ vty_out(vty, "s"); ++ vty_out(vty, "] "); ++ } ++ + /* Route status display. */ + if (CHECK_FLAG (binfo->flags, BGP_INFO_REMOVED)) + vty_out (vty, "R"); +@@ -6080,6 +6116,7 @@ route_vty_out_detail (struct vty *vty, s + } + + #define BGP_SHOW_SCODE_HEADER "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,%s r RIB-failure, S Stale, R Removed%s" ++#define BGP_SHOW_PCODE_HEADER "Status code: a (anomalous) of: [p] prefix hijack, [s] sub-prefix hijack,%s [i] informant of sub-prefix [e] new edge%s" + #define BGP_SHOW_OCODE_HEADER "Origin codes: i - IGP, e - EGP, ? - incomplete%s%s" + #define BGP_SHOW_HEADER " Network Next Hop Metric LocPrf Weight Path%s" + #define BGP_SHOW_DAMP_HEADER " Network From Reuse Path%s" +@@ -6111,7 +6148,8 @@ enum bgp_show_type + bgp_show_type_flap_route_map, + bgp_show_type_flap_neighbor, + bgp_show_type_dampend_paths, +- bgp_show_type_damp_neighbor ++ bgp_show_type_damp_neighbor, ++ bgp_show_type_anomalous_paths + }; + + static int +@@ -6278,11 +6316,17 @@ bgp_show_table (struct vty *vty, struct + || CHECK_FLAG (ri->flags, BGP_INFO_HISTORY)) + continue; + } ++ if (type == bgp_show_type_anomalous_paths) ++ { ++ if (! ANOMALOUS(ri->flags)) ++ continue; ++ } + + if (header) + { + vty_out (vty, "BGP table version is 0, local router ID is %s%s", inet_ntoa (*router_id), VTY_NEWLINE); + vty_out (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE); ++ vty_out (vty, BGP_SHOW_PCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE); + vty_out (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE); + if (type == bgp_show_type_dampend_paths + || type == bgp_show_type_damp_neighbor) +@@ -6360,6 +6404,7 @@ bgp_show (struct vty *vty, struct bgp *b + return bgp_show_table (vty, table, &bgp->router_id, type, output_arg); + } + ++ + /* Header of detailed BGP route information */ + static void + route_vty_out_detail_header (struct vty *vty, struct bgp *bgp, +@@ -11932,6 +11977,64 @@ DEFUN (bgp_damp_set, + half, reuse, suppress, max); + } + ++DEFUN (bgp_pgbgp_arg, ++ bgp_pgbgp_arg_cmd, ++ "bgp pgbgp <1-100> <1-100> <1-100> <1-365> <1-365> <1-365> WORD WORD", ++ "BGP Specific commands\n" ++ "Enable Pretty Good BGP\n" ++ "New origin depref time (in hours)\n" ++ "New edge depref time (in hours)\n" ++ "New sub-prefix depref time (in hours)\n" ++ "Origin history time (in days)\n" ++ "Prefix history time (in days)\n" ++ "Edge history time (in days)\n" ++ "Log file for history data\n" ++ "Log file of anomalies\n") ++{ ++ struct bgp *bgp; ++ ++ int ost = DEFAULT_ORIGIN_SUS; ++ int est = DEFAULT_EDGE_SUS; ++ int sst = DEFAULT_SUB_SUS; ++ int oht = DEFAULT_ORIGIN_HIST; ++ int pht = DEFAULT_PREFIX_HIST; ++ int eht = DEFAULT_EDGE_HIST; ++ const char* path = "/var/log/quagga/pgbgp_hist"; ++ const char* anoms = "/var/log/quagga/pgbgp_anomalies"; ++ ++ if (argc == 8) ++ { ++ VTY_GET_INTEGER("origin depref time", ost, argv[0]); ++ VTY_GET_INTEGER("edge depref time", est, argv[1]); ++ VTY_GET_INTEGER("sub-prefix depref time", sst, argv[2]); ++ VTY_GET_INTEGER("origin history time", oht, argv[3]); ++ VTY_GET_INTEGER("prefix history time", pht, argv[4]); ++ VTY_GET_INTEGER("edge history time", eht, argv[5]); ++ path = argv[6]; ++ anoms = argv[7]; ++ } ++ ++ bgp = vty->index; ++ return bgp_pgbgp_enable(bgp, bgp_node_afi (vty), bgp_node_safi (vty), ++ ost, est, sst, oht, pht, eht, path, anoms); ++} ++ ++ALIAS (bgp_pgbgp_arg, ++ bgp_pgbgp_cmd, ++ "bgp pgbgp", ++ "BGP specific commands\n" ++ "Enable Pretty Good BGP\n") ++ ++DEFUN (bgp_pgbgp_unset, ++ bgp_pgbgp_unset_cmd, ++ "no bgp pgbgp\n", ++ "BGP specific commands\n") ++{ ++ struct bgp *bgp; ++ bgp = vty->index; ++ return bgp_pgbgp_disable (bgp, bgp_node_afi (vty), bgp_node_safi (vty)); ++} ++ + ALIAS (bgp_damp_set, + bgp_damp_set2_cmd, + "bgp dampening <1-45>", +@@ -11981,6 +12084,19 @@ DEFUN (show_ip_bgp_dampened_paths, + NULL); + } + ++DEFUN (show_ip_bgp_anomalous_paths, ++ show_ip_bgp_anomalous_paths_cmd, ++ "show ip bgp anomalous-paths", ++ SHOW_STR ++ IP_STR ++ BGP_STR ++ "Display anomalous paths (less likely to be used)\n") ++{ ++ return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST, bgp_show_type_anomalous_paths, ++ NULL); ++} ++ ++ + DEFUN (show_ip_bgp_flap_statistics, + show_ip_bgp_flap_statistics_cmd, + "show ip bgp flap-statistics", +@@ -12507,6 +12623,7 @@ bgp_route_init (void) + install_element (VIEW_NODE, &show_ip_bgp_neighbor_received_prefix_filter_cmd); + install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_received_prefix_filter_cmd); + install_element (VIEW_NODE, &show_ip_bgp_dampened_paths_cmd); ++ install_element (VIEW_NODE, &show_ip_bgp_anomalous_paths_cmd); + install_element (VIEW_NODE, &show_ip_bgp_flap_statistics_cmd); + install_element (VIEW_NODE, &show_ip_bgp_flap_address_cmd); + install_element (VIEW_NODE, &show_ip_bgp_flap_prefix_cmd); +@@ -12640,6 +12757,7 @@ bgp_route_init (void) + install_element (ENABLE_NODE, &show_ip_bgp_neighbor_received_prefix_filter_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_received_prefix_filter_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_dampened_paths_cmd); ++ install_element (ENABLE_NODE, &show_ip_bgp_anomalous_paths_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_flap_statistics_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_flap_address_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_flap_prefix_cmd); +@@ -13030,6 +13148,10 @@ bgp_route_init (void) + install_element (BGP_IPV4_NODE, &bgp_damp_unset_cmd); + install_element (BGP_IPV4_NODE, &bgp_damp_unset2_cmd); + ++ install_element (BGP_NODE, &bgp_pgbgp_cmd); ++ install_element (BGP_NODE, &bgp_pgbgp_arg_cmd); ++ install_element (BGP_NODE, &bgp_pgbgp_unset_cmd); ++ + /* Deprecated AS-Pathlimit commands */ + install_element (BGP_NODE, &bgp_network_ttl_cmd); + install_element (BGP_NODE, &bgp_network_mask_ttl_cmd); +--- a/bgpd/bgp_route.h ++++ b/bgpd/bgp_route.h +@@ -1,3 +1,4 @@ ++ + /* BGP routing information base + Copyright (C) 1996, 97, 98, 2000 Kunihiro Ishiguro + +@@ -68,7 +69,7 @@ struct bgp_info + int lock; + + /* BGP information status. */ +- u_int16_t flags; ++ u_int32_t flags; + #define BGP_INFO_IGP_CHANGED (1 << 0) + #define BGP_INFO_DAMPED (1 << 1) + #define BGP_INFO_HISTORY (1 << 2) +@@ -82,6 +83,10 @@ struct bgp_info + #define BGP_INFO_COUNTED (1 << 10) + #define BGP_INFO_MULTIPATH (1 << 11) + #define BGP_INFO_MULTIPATH_CHG (1 << 12) ++#define BGP_INFO_SUSPICIOUS_O (1 << 13) ++#define BGP_INFO_SUSPICIOUS_P (1 << 14) ++#define BGP_INFO_IGNORED_P (1 << 15) ++#define BGP_INFO_SUSPICIOUS_E (1 << 16) + + /* BGP route type. This can be static, RIP, OSPF, BGP etc. */ + u_char type; +@@ -126,7 +131,7 @@ struct bgp_static + + /* Flags which indicate a route is unuseable in some form */ + #define BGP_INFO_UNUSEABLE \ +- (BGP_INFO_HISTORY|BGP_INFO_DAMPED|BGP_INFO_REMOVED) ++ (BGP_INFO_HISTORY|BGP_INFO_DAMPED|BGP_INFO_REMOVED|BGP_INFO_IGNORED_P) + /* Macro to check BGP information is alive or not. Sadly, + * not equivalent to just checking previous, because of the + * sense of the additional VALID flag. +--- a/bgpd/bgp_table.h ++++ b/bgpd/bgp_table.h +@@ -65,6 +65,8 @@ struct bgp_node + + int lock; + ++ struct bgp_pgbgp_hist *hist; ++ + u_char flags; + #define BGP_NODE_PROCESS_SCHEDULED (1 << 0) + }; +--- a/bgpd/bgpd.h ++++ b/bgpd/bgpd.h +@@ -123,6 +123,7 @@ struct bgp + /* BGP Per AF flags */ + u_int16_t af_flags[AFI_MAX][SAFI_MAX]; + #define BGP_CONFIG_DAMPENING (1 << 0) ++#define BGP_CONFIG_PGBGP (1 << 1) + + /* Static route configuration. */ + struct bgp_table *route[AFI_MAX][SAFI_MAX]; +--- a/lib/hash.c ++++ b/lib/hash.c +@@ -166,6 +166,35 @@ hash_iterate (struct hash *hash, + } + } + ++/* ++ Iterates until 0 is returned or until completion ++ Return: 1 if iteration completed ++ Return: 0 if iteration was interrupted ++*/ ++ ++int ++hash_iterate_until(struct hash *hash, ++ int (*func) (struct hash_backet *, void *), void *arg) ++{ ++ unsigned int i; ++ struct hash_backet *hb; ++ struct hash_backet *hbnext; ++ int ret; ++ ++ for (i = 0; i < hash->size; i++) ++ for (hb = hash->index[i]; hb; hb = hbnext) ++ { ++ /* get pointer to next hash backet here, in case (*func) ++ * decides to delete hb by calling hash_release ++ */ ++ hbnext = hb->next; ++ ret = (*func) (hb, arg); ++ if (!ret) ++ return 0; ++ } ++ return 1; ++} ++ + /* Clean up hash. */ + void + hash_clean (struct hash *hash, void (*free_func) (void *)) +--- a/lib/hash.h ++++ b/lib/hash.h +@@ -66,7 +66,8 @@ extern void *hash_release (struct hash * + + extern void hash_iterate (struct hash *, + void (*) (struct hash_backet *, void *), void *); +- ++extern int hash_iterate_until(struct hash *, ++ int (*) (struct hash_backet *, void *), void *); + extern void hash_clean (struct hash *, void (*) (void *)); + extern void hash_free (struct hash *); + +--- a/lib/memtypes.c ++++ b/lib/memtypes.c +@@ -148,6 +148,15 @@ struct memory_list memory_list_bgp[] = + { MTYPE_PEER_UPDATE_SOURCE, "BGP peer update interface" }, + { MTYPE_BGP_DAMP_INFO, "Dampening info" }, + { MTYPE_BGP_DAMP_ARRAY, "BGP Dampening array" }, ++ { 0, NULL }, ++ { MTYPE_BGP_PGBGP_ORIGIN, "BGP PGBGP Origin AS Node" }, ++ { MTYPE_BGP_PGBGP_PREFIX, "BGP PGBGP Prefix AS Node" }, ++ { MTYPE_BGP_PGBGP_EDGE, "BGP PGBGP Edge Node" }, ++ { MTYPE_BGP_PGBGP_REUSE, "BGP PGBGP Reuse Node" }, ++ { MTYPE_BGP_PGBGP_HIST, "BGP PGBGP History Node" }, ++ { MTYPE_BGP_PGBGP_AVOID, "BGP PGBGP Avoid Peer Node" }, ++ { MTYPE_BGP_PGBGP_PEER, "BGP PGBGP Peer Timing" }, ++ { 0, NULL }, + { MTYPE_BGP_REGEXP, "BGP regexp" }, + { MTYPE_BGP_AGGREGATE, "BGP aggregate" }, + { -1, NULL } diff --git a/net/quagga/patches/161-pgbgp-addon.patch b/net/quagga/patches/161-pgbgp-addon.patch new file mode 100644 index 0000000..5bcd907 --- /dev/null +++ b/net/quagga/patches/161-pgbgp-addon.patch @@ -0,0 +1,318 @@ +From: Paul Jakma +Date: Thu, 4 Sep 2008 22:27:13 +0000 (+0100) +Subject: [bgp/pgbgp] Add some pgbgp commands to restricted-mode and other command tweaks +X-Git-Url: http://git.ozo.com/?p=quagga-pgbg.git;a=commitdiff_plain;h=06ac72f9f6021635e9e1e5105c3e22bf7eb0d6c3 + +[bgp/pgbgp] Add some pgbgp commands to restricted-mode and other command tweaks + +* bgp_pgbgp.c: + (edge_neighbor_iterator) make ASN==0 mean 'iterate over all ASNs' + (bgp_pgbgp_stats_origin_one) new function, to display one origin AS status. + (bgp_pgbgp_stats_origins) adapt to use previous. + Adapt to iterate over all stats if no prefix was giving. + (show_ip_bgp_pgbgp_neighbors_cmd) recognise no ASN argument case + (show_ip_bgp_pgbgp_neighbors_all_cmd) Iterate over all + (show_ip_bgp_pgbgp_origins_cmd) similar + (show_ip_bgp_pgbgp_origins_all_cmd) + (bgp_pgbgp_enable) install the lookup commands to ther new RESTRICTED_NODE +* bgp_route.c: + (route_vty_short_status_out) only allowed to print one char for anomalous + status. + (route_vty_out_detail) Add support for printing out more detail on + PG-BGP status +--- + +--- a/bgpd/bgp_pgbgp.c ++++ b/bgpd/bgp_pgbgp.c +@@ -227,7 +227,7 @@ static void + edge_neighbor_iterator (struct hash_backet *backet, struct nsearch *pns) + { + struct bgp_pgbgp_edge *hedge = backet->data; +- if ((hedge->e.a == pns->asn || hedge->e.b == pns->asn) ++ if ((!pns->asn || hedge->e.a == pns->asn || hedge->e.b == pns->asn) + && hedge->e.a != hedge->e.b) + { + struct vty *vty = pns->pvty; +@@ -254,13 +254,39 @@ bgp_pgbgp_stats_neighbors (struct vty *v + return CMD_SUCCESS; + } + ++static void ++bgp_pgbgp_stats_origin_one (struct vty *vty, struct bgp_node *rn, ++ time_t t_now) ++{ ++ char str[INET6_BUFSIZ]; ++ ++ if (!rn->hist) ++ return; ++ ++ prefix2str (&rn->p, str, sizeof(str)); ++ vty_out (vty, "%s%s", str, VTY_NEWLINE); ++ ++ for (struct bgp_pgbgp_origin * cur = rn->hist->o; cur != NULL; ++ cur = cur->next) ++ { ++ if (cur->deprefUntil > t_now) ++ vty_out (vty, "Untrusted Origin AS: %d%s", cur->originAS, ++ VTY_NEWLINE); ++ else ++ vty_out (vty, "Trusted Origin AS: %d%s", cur->originAS, ++ VTY_NEWLINE); ++ } ++} ++ + static int + bgp_pgbgp_stats_origins (struct vty *vty, afi_t afi, safi_t safi, + const char *prefix) + { + struct bgp *bgp; + struct bgp_table *table; ++ struct bgp_node *rn; + time_t t_now = time (NULL); ++ + bgp = bgp_get_default (); + if (bgp == NULL) + return CMD_WARNING; +@@ -269,28 +295,22 @@ bgp_pgbgp_stats_origins (struct vty *vty + table = bgp->rib[afi][safi]; + if (table == NULL) + return CMD_WARNING; +- +- struct prefix p; +- str2prefix (prefix, &p); +- struct bgp_node *rn = bgp_node_match (table, &p); +- vty_out (vty, "%s%s", prefix, VTY_NEWLINE); +- if (rn) ++ ++ if (prefix) + { ++ struct prefix p; ++ str2prefix (prefix, &p); ++ rn = bgp_node_match (table, &p); + if (rn->hist) +- { +- for (struct bgp_pgbgp_origin * cur = rn->hist->o; cur != NULL; +- cur = cur->next) +- { +- if (cur->deprefUntil > t_now) +- vty_out (vty, "Untrusted Origin AS: %d%s", cur->originAS, +- VTY_NEWLINE); +- else +- vty_out (vty, "Trusted Origin AS: %d%s", cur->originAS, +- VTY_NEWLINE); +- } +- } ++ bgp_pgbgp_stats_origin_one (vty, rn, t_now); + bgp_unlock_node (rn); ++ return CMD_SUCCESS; + } ++ ++ for (rn = bgp_table_top (table); rn; rn = bgp_route_next (rn)) ++ if (rn->hist) ++ bgp_pgbgp_stats_origin_one (vty, rn, t_now); ++ + return CMD_SUCCESS; + } + +@@ -377,7 +397,7 @@ bgp_pgbgp_stats (struct vty *vty, afi_t + DEFUN (show_ip_bgp_pgbgp, + show_ip_bgp_pgbgp_cmd, + "show ip bgp pgbgp", +- SHOW_STR IP_STR BGP_STR "Display PGBGP statistics\n") ++ SHOW_STR IP_STR BGP_STR "Pretty-Good BGP statistics\n") + { + return bgp_pgbgp_stats (vty, AFI_IP, SAFI_UNICAST); + } +@@ -385,29 +405,46 @@ DEFUN (show_ip_bgp_pgbgp, + DEFUN (show_ip_bgp_pgbgp_neighbors, + show_ip_bgp_pgbgp_neighbors_cmd, + "show ip bgp pgbgp neighbors WORD", +- SHOW_STR +- IP_STR +- BGP_STR +- "BGP pgbgp\n" +- "BGP pgbgp neighbors\n" "ASN whos neighbors should be displayed\n") ++ SHOW_STR IP_STR BGP_STR ++ "Pretty-Good BGP statistics\n" ++ "PG-BGP neighbor information\n" ++ "AS to show neighbors of\n") + { + return bgp_pgbgp_stats_neighbors (vty, AFI_IP, SAFI_UNICAST, +- atoi (argv[0])); ++ argc == 1 ? atoi (argv[0]) : 0); + } + ++ALIAS (show_ip_bgp_pgbgp_neighbors, ++ show_ip_bgp_pgbgp_neighbors_all_cmd, ++ "show ip bgp pgbgp neighbors", ++ SHOW_STR ++ IP_STR ++ BGP_STR ++ "Pretty-Good BGP statistics\n" ++ "PG-BGP neighbors information\n") ++ + DEFUN (show_ip_bgp_pgbgp_origins, + show_ip_bgp_pgbgp_origins_cmd, + "show ip bgp pgbgp origins A.B.C.D/M", + SHOW_STR + IP_STR + BGP_STR +- "BGP pgbgp\n" +- "BGP pgbgp neighbors\n" "Prefix to look up origin ASes of\n") ++ "Pretty-Good BGP statistics\n" ++ "PG-BGP prefix origin information\n" ++ "Prefix to look up origin ASes of\n") + { +- return bgp_pgbgp_stats_origins (vty, AFI_IP, SAFI_UNICAST, argv[0]); ++ return bgp_pgbgp_stats_origins (vty, AFI_IP, SAFI_UNICAST, ++ argc == 1 ? argv[0] : NULL); + } + +- ++ALIAS (show_ip_bgp_pgbgp_origins, ++ show_ip_bgp_pgbgp_origins_all_cmd, ++ "show ip bgp pgbgp origins", ++ SHOW_STR ++ IP_STR ++ BGP_STR ++ "Pretty-Good BGP statistics\n" ++ "PG-BGP prefixes origin information") + + + /*! --------------- VTY (others exist in bgp_route.c) ------------------ !*/ +@@ -749,12 +786,19 @@ bgp_pgbgp_enable (struct bgp *bgp, afi_t + pgbgp->lastgc = time (NULL); + pgbgp->lastStore = time (NULL); + pgbgp->startTime = time (NULL); ++ install_element (RESTRICTED_NODE, &show_ip_bgp_pgbgp_cmd); ++ install_element (RESTRICTED_NODE, &show_ip_bgp_pgbgp_neighbors_cmd); ++ install_element (RESTRICTED_NODE, &show_ip_bgp_pgbgp_origins_cmd); + install_element (VIEW_NODE, &show_ip_bgp_pgbgp_cmd); +- install_element (ENABLE_NODE, &show_ip_bgp_pgbgp_cmd); + install_element (VIEW_NODE, &show_ip_bgp_pgbgp_neighbors_cmd); +- install_element (ENABLE_NODE, &show_ip_bgp_pgbgp_neighbors_cmd); + install_element (VIEW_NODE, &show_ip_bgp_pgbgp_origins_cmd); ++ install_element (VIEW_NODE, &show_ip_bgp_pgbgp_neighbors_all_cmd); ++ install_element (VIEW_NODE, &show_ip_bgp_pgbgp_origins_all_cmd); ++ install_element (ENABLE_NODE, &show_ip_bgp_pgbgp_cmd); ++ install_element (ENABLE_NODE, &show_ip_bgp_pgbgp_neighbors_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_pgbgp_origins_cmd); ++ install_element (ENABLE_NODE, &show_ip_bgp_pgbgp_neighbors_all_cmd); ++ install_element (ENABLE_NODE, &show_ip_bgp_pgbgp_origins_all_cmd); + pgbgp->edgeT = hash_create_size (131072, edge_key_make, edge_cmp); + bgp_pgbgp_restore (); + return 0; +--- a/bgpd/bgp_route.c ++++ b/bgpd/bgp_route.c +@@ -5597,20 +5597,6 @@ enum bgp_display_type + static void + route_vty_short_status_out (struct vty *vty, struct bgp_info *binfo) + { +- if (ANOMALOUS(binfo->flags)) +- { +- vty_out(vty, "a["); +- if (CHECK_FLAG(binfo->flags, BGP_INFO_SUSPICIOUS_P)) +- vty_out(vty, "i"); +- if (CHECK_FLAG(binfo->flags, BGP_INFO_SUSPICIOUS_O)) +- vty_out(vty, "p"); +- if (CHECK_FLAG(binfo->flags, BGP_INFO_SUSPICIOUS_E)) +- vty_out(vty, "e"); +- if (CHECK_FLAG(binfo->flags, BGP_INFO_IGNORED_P)) +- vty_out(vty, "s"); +- vty_out(vty, "] "); +- } +- + /* Route status display. */ + if (CHECK_FLAG (binfo->flags, BGP_INFO_REMOVED)) + vty_out (vty, "R"); +@@ -5626,6 +5612,17 @@ route_vty_short_status_out (struct vty * + /* Selected */ + if (CHECK_FLAG (binfo->flags, BGP_INFO_HISTORY)) + vty_out (vty, "h"); ++ else if (ANOMALOUS(binfo->flags)) ++ { ++ if (CHECK_FLAG(binfo->flags, BGP_INFO_SUSPICIOUS_O)) ++ vty_out(vty, "p"); ++ else if (CHECK_FLAG(binfo->flags, BGP_INFO_IGNORED_P)) ++ vty_out(vty, "P"); ++ else if (CHECK_FLAG(binfo->flags, BGP_INFO_SUSPICIOUS_P)) ++ vty_out(vty, "a"); ++ if (CHECK_FLAG(binfo->flags, BGP_INFO_SUSPICIOUS_E)) ++ vty_out(vty, "a"); ++ } + else if (CHECK_FLAG (binfo->flags, BGP_INFO_DAMPED)) + vty_out (vty, "d"); + else if (CHECK_FLAG (binfo->flags, BGP_INFO_SELECTED)) +@@ -6104,7 +6101,22 @@ route_vty_out_detail (struct vty *vty, s + if (binfo->extra && binfo->extra->damp_info) + bgp_damp_info_vty (vty, binfo); + +- /* Line 7 display Uptime */ ++ /* 8: PGBGP status */ ++ if (ANOMALOUS(binfo->flags)) ++ { ++ vty_out (vty, " Anomalous:"); ++ if (CHECK_FLAG(binfo->flags, BGP_INFO_SUSPICIOUS_P)) ++ vty_out (vty, " divergent sub-prefixes,"); ++ if (CHECK_FLAG(binfo->flags, BGP_INFO_SUSPICIOUS_O)) ++ vty_out (vty, " origin AS (prefix hijack?),"); ++ if (CHECK_FLAG(binfo->flags, BGP_INFO_SUSPICIOUS_E)) ++ vty_out (vty, " new edge in path,"); ++ if (CHECK_FLAG(binfo->flags, BGP_INFO_IGNORED_P)) ++ vty_out (vty, " origin AS (sub-prefix hijack?),"); ++ vty_out (vty, "%s", VTY_NEWLINE); ++ } ++ ++ /* Line 9 display Uptime */ + #ifdef HAVE_CLOCK_MONOTONIC + tbuf = time(NULL) - (bgp_clock() - binfo->uptime); + vty_out (vty, " Last update: %s", ctime(&tbuf)); +@@ -6115,8 +6127,9 @@ route_vty_out_detail (struct vty *vty, s + vty_out (vty, "%s", VTY_NEWLINE); + } + +-#define BGP_SHOW_SCODE_HEADER "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,%s r RIB-failure, S Stale, R Removed%s" +-#define BGP_SHOW_PCODE_HEADER "Status code: a (anomalous) of: [p] prefix hijack, [s] sub-prefix hijack,%s [i] informant of sub-prefix [e] new edge%s" ++#define BGP_SHOW_SCODE_HEADER "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,%s" \ ++ " r RIB-failure, S Stale, R Removed, %s" \ ++ " p prefix hijack, P sub-prefix hijack, a other anomaly%s" + #define BGP_SHOW_OCODE_HEADER "Origin codes: i - IGP, e - EGP, ? - incomplete%s%s" + #define BGP_SHOW_HEADER " Network Next Hop Metric LocPrf Weight Path%s" + #define BGP_SHOW_DAMP_HEADER " Network From Reuse Path%s" +@@ -6325,8 +6338,7 @@ bgp_show_table (struct vty *vty, struct + if (header) + { + vty_out (vty, "BGP table version is 0, local router ID is %s%s", inet_ntoa (*router_id), VTY_NEWLINE); +- vty_out (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE); +- vty_out (vty, BGP_SHOW_PCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE); ++ vty_out (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE); + vty_out (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE); + if (type == bgp_show_type_dampend_paths + || type == bgp_show_type_damp_neighbor) +@@ -9858,7 +9870,7 @@ show_adj_route (struct vty *vty, struct + PEER_STATUS_DEFAULT_ORIGINATE)) + { + vty_out (vty, "BGP table version is 0, local router ID is %s%s", inet_ntoa (bgp->router_id), VTY_NEWLINE); +- vty_out (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE); ++ vty_out (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE); + vty_out (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE); + + vty_out (vty, "Originating default network 0.0.0.0%s%s", +@@ -9875,7 +9887,7 @@ show_adj_route (struct vty *vty, struct + if (header1) + { + vty_out (vty, "BGP table version is 0, local router ID is %s%s", inet_ntoa (bgp->router_id), VTY_NEWLINE); +- vty_out (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE); ++ vty_out (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE); + vty_out (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE); + header1 = 0; + } +@@ -9899,7 +9911,7 @@ show_adj_route (struct vty *vty, struct + if (header1) + { + vty_out (vty, "BGP table version is 0, local router ID is %s%s", inet_ntoa (bgp->router_id), VTY_NEWLINE); +- vty_out (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE); ++ vty_out (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE); + vty_out (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE); + header1 = 0; + } diff --git a/net/quagga/patches/170-use-supported-pagers.patch b/net/quagga/patches/170-use-supported-pagers.patch new file mode 100644 index 0000000..d42e145 --- /dev/null +++ b/net/quagga/patches/170-use-supported-pagers.patch @@ -0,0 +1,29 @@ +--- a/vtysh/vtysh.c ++++ b/vtysh/vtysh.c +@@ -269,7 +269,7 @@ vtysh_pager_init (void) + if (pager_defined) + vtysh_pager_name = strdup (pager_defined); + else +- vtysh_pager_name = strdup ("more"); ++ vtysh_pager_name = strdup ("cat"); + } + + /* Command execution over the vty interface. */ +@@ -1885,7 +1885,7 @@ DEFUN (vtysh_terminal_length, + { + int lines; + char *endptr = NULL; +- char default_pager[10]; ++ char default_pager[12]; + + lines = strtol (argv[0], &endptr, 10); + if (lines < 0 || lines > 512 || *endptr != '\0') +@@ -1902,7 +1902,7 @@ DEFUN (vtysh_terminal_length, + + if (lines != 0) + { +- snprintf(default_pager, 10, "more -%i", lines); ++ snprintf(default_pager, 12, "head -n %i", lines); + vtysh_pager_name = strdup (default_pager); + } + diff --git a/net/quicktun/Makefile b/net/quicktun/Makefile new file mode 100644 index 0000000..c4d9bd0 --- /dev/null +++ b/net/quicktun/Makefile @@ -0,0 +1,69 @@ +# +# Copyright (C) 2011 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:=quicktun +PKG_VERSION:=2.1.7 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://oss.ucis.nl/quicktun/src +PKG_MD5SUM:=6cf38b17218deb8c908cc17d91f9cbd7 + +PKG_BUILD_DEPENDS:=nacl + +include $(INCLUDE_DIR)/package.mk + +define Package/quicktun + SECTION:=net + CATEGORY:=Network + DEPENDS:=+kmod-tun + TITLE:=QuickTun is a simple and secure VPN software + URL:=http://wiki.ucis.nl/QuickTun + SUBMENU:=VPN +endef + +define Package/quicktun/description + QuickTun is a simple and secure VPN software +endef + +define Package/quicktun/conffiles +/etc/config/quicktun +endef + +define Build/Compile + ( \ + cd $(PKG_BUILD_DIR); \ + mkdir -p obj out; \ + \ + export CPATH=$(STAGING_DIR)/usr/include/nacl; \ + \ + $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -c -DCOMBINED_BINARY src/proto.raw.c -o obj/proto.raw.o; \ + $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -c -DCOMBINED_BINARY src/proto.nacl0.c -o obj/proto.nacl0.o; \ + $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -c -DCOMBINED_BINARY src/proto.nacltai.c -o obj/proto.nacltai.o; \ + $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -c -DCOMBINED_BINARY src/run.combined.c -o obj/run.combined.o; \ + $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -c src/common.c -o obj/common.o; \ + $(TARGET_CC) $(TARGET_LDFLAGS) -o out/quicktun.combined obj/common.o obj/run.combined.o obj/proto.raw.o obj/proto.nacl0.o obj/proto.nacltai.o \ + -lnacl; \ + \ + $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) -o out/quicktun.keypair src/keypair.c -lnacl \ + ) +endef + +define Package/quicktun/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/quicktun.{combined,keypair} $(1)/usr/sbin/ + $(LN) quicktun.combined $(1)/usr/sbin/quicktun + + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) +endef + +$(eval $(call BuildPackage,quicktun)) diff --git a/net/quicktun/files/quicktun.config b/net/quicktun/files/quicktun.config new file mode 100644 index 0000000..e5cc6f3 --- /dev/null +++ b/net/quicktun/files/quicktun.config @@ -0,0 +1,55 @@ +package quicktun + +config quicktun sample_config + + # Set to 1 to enable this instance: + option enabled 0 + + # IP address or hostname of the local end, optional +# option local_address 0.0.0.0 + + # Local UDP port + option local_port 2998 + + # IP address or hostname of the remote end + # Use 0.0.0.0 for a floating/dynamic endpoint + option remote_address 0.0.0.0 + + # Remote UDP port + option remote_port 2998 + + # Allows the remote address and port to change when properly + # encrypted packets are received even when a remote address + # is set + option remote_float 0 + + # "proto raw" uses no encryption + # "proto nacl0" uses NaCl encryption without nonce + # "proto nacltai" uses NaCl encryption with nonce + option protocol raw + + # "tun_mode 0" will create an ethernet tunnel (tap device), + # "tun_mode 1" will create an IP tunnel (tun device). + option tun_mode 0 + + # Set the name of the tunnel interface to use + option interface "tap0" +# option interface "tun0" +# option interface "qt0" + + # The local private key and the remote public key + # A keypair can be generated with quicktun.keygen + # (nacl0 and nacltai protocols only) + #option private_key 0000000000000000000000000000000000000000000000000000000000000000 + #option public_key 0000000000000000000000000000000000000000000000000000000000000000 + + # allowed time window for first received packet in seconds, + # positive number allows packets from history + # (nacltai protocol only) + #option time_window 0 + + # command to configure IP addresses etc. after the tunnel is up; $1 will be the interface name (optional) +# option up "" + + # command to execute before the tunnel is set down; $1 will be the interface name (optional) +# option down "" diff --git a/net/quicktun/files/quicktun.init b/net/quicktun/files/quicktun.init new file mode 100644 index 0000000..e6192d6 --- /dev/null +++ b/net/quicktun/files/quicktun.init @@ -0,0 +1,141 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org + +# Partly taken the OpenVPN init script (Copyright (C) 2008 Jo-Philipp Wich) +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +START=95 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +EXTRA_COMMANDS="up down" + +LIST_SEP=" +" + +append_opt() { + local p="$1"; local v="$2"; local p_uc + + p_uc=$(echo "$p" | tr '[a-z]' '[A-Z]') + OPTS="$OPTS \"$p_uc=$v\"" +} + +append_opts() { + local p; local v; local s="$1"; shift + for p in $*; do + config_get v "$s" "$p" + [ -n "$v" ] && append_opt "$p" "$v" + done +} + +section_enabled() { + config_get_bool enabled "$1" 'enabled' 0 + [ $enabled -gt 0 ] +} + +error() { + echo "${initscript}:" "$@" 1>&2 +} + +start_instance() { + local s="$1" + + section_enabled "$s" || return 1 + + SERVICE_PID_FILE="/var/run/quicktun-$s.pid" + OPTS="" + + config_get interface "$s" interface + if [ -z "$interface" ]; then + error "$s: interface '$interface' is not set" + return 1 + fi + + if ifconfig "$interface" &>/dev/null; then + error "$s: interface '$interface' is already in use" + return 1 + fi + + append_opts "$s" interface local_address local_port remote_address remote_port \ + protocol private_key public_key time_window + + config_get_bool tun_mode "$s" tun_mode 0 + [ "$tun_mode" == 1 ] && append_opt tun_mode 1 + + config_get_bool remote_float "$s" remote_float 0 + [ "$remote_float" == 1 ] && append_opt remote_float 1 + + eval env $OPTS service_start /usr/sbin/quicktun + + while ! ifconfig "$interface" >/dev/null 2>&1; do + if ! service_check /usr/sbin/quicktun; then + error "$s: startup failed" + return 1 + fi + + sleep 1 + done + + config_get up "$s" up + [ -n "$up" ] && sh -c "$up" - "$interface" +} + +stop_instance() { + local s="$1" + + section_enabled "$s" || return 1 + + SERVICE_PID_FILE="/var/run/quicktun-$s.pid" + + config_get interface "$s" interface + if [ -z "$interface" ]; then + error "$s: interface '$interface' is not set" + return 1 + fi + + if ! ifconfig "$interface" &>/dev/null; then + error "$s: interface '$interface' does not exist" + return 1 + fi + + config_get down "$s" down + [ -n "$down" ] && sh -c "$down" - "$interface" + + service_stop /usr/sbin/quicktun +} + +start() { + config_load 'quicktun' + config_foreach start_instance 'quicktun' +} + +stop() { + config_load 'quicktun' + config_foreach stop_instance 'quicktun' +} + +up() { + local exists + local instance + config_load 'quicktun' + for instance in "$@"; do + config_get exists "$instance" 'TYPE' + if [ "$exists" == "quicktun" ]; then + start_instance "$instance" + fi + done +} + +down() { + local exists + local instance + config_load 'quicktun' + for instance in "$@"; do + config_get exists "$instance" 'TYPE' + if [ "$exists" == "quicktun" ]; then + stop_instance "$instance" + fi + done +} diff --git a/net/raddump/Makefile b/net/raddump/Makefile new file mode 100644 index 0000000..e5346d6 --- /dev/null +++ b/net/raddump/Makefile @@ -0,0 +1,44 @@ +# +# 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:=raddump +PKG_VERSION:=0.3.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/raddump +PKG_MD5SUM:=f8c29c67141ea78bb6ae8b97d5149480 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/raddump + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +libopenssl + TITLE:=raddump interprets captured RADIUS packets. + URL:=http://sourceforge.net/projects/raddump +endef + +define Package/raddump/description + raddump interprets captured RADIUS packets to print a + timestamp, packet length, RADIUS packet type, source and + destination hosts and ports, and included attribute names and + values for each packet. +endef + +# uses GNU configure + +define Package/raddump/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/raddump $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,raddump)) diff --git a/net/radsecproxy/Makefile b/net/radsecproxy/Makefile new file mode 100644 index 0000000..2e46e9e --- /dev/null +++ b/net/radsecproxy/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2008-2012 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:=radsecproxy +PKG_VERSION:=1.5 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://software.uninett.no/radsecproxy/ +PKG_MD5SUM:=c65742a1b471c572ca7f6d11000d41f5 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/radsecproxy + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libopenssl +libpthread + TITLE:=radsecproxy + URL:=http://software.uninett.no/radsecproxy +endef + +define Package/radsecproxy/description + A generic radius proxy for UDP/TLS (RadSec) +endef + +CONFIGURE_ARGS+= \ + --with-ssl="$(STAGING_DIR)/usr" + +#TARGET_CFLAGS += -ansi +#TARGET_CFLAGS += -std=c99 +TARGET_CFLAGS += -Wno-long-long + + +define Package/radsecproxy/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radsecproxy $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/ + $(CP) $(PKG_BUILD_DIR)/radsecproxy.conf-example $(1)/etc/radsecproxy.conf + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/radsecproxy.init $(1)/etc/init.d/radsecproxy +endef + +define Package/radsecproxy/conffiles +/etc/radsecproxy.conf +endef + +$(eval $(call BuildPackage,radsecproxy)) + diff --git a/net/radsecproxy/files/radsecproxy.init b/net/radsecproxy/files/radsecproxy.init new file mode 100644 index 0000000..b1b4f8e --- /dev/null +++ b/net/radsecproxy/files/radsecproxy.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +start() { + service_start /usr/sbin/radsecproxy +} + +stop() { + service_stop /usr/sbin/radsecproxy +} diff --git a/net/radsecproxy/patches/100-missing-return.patch b/net/radsecproxy/patches/100-missing-return.patch new file mode 100644 index 0000000..871fc6e --- /dev/null +++ b/net/radsecproxy/patches/100-missing-return.patch @@ -0,0 +1,58 @@ +--- a/dtls.c ++++ b/dtls.c +@@ -523,6 +523,7 @@ void *udpdtlsserverrd(void *arg) { + free(params); + cacheexpire(sessioncache, &lastexpiry); + } ++ return NULL; + } + + int dtlsconnect(struct server *server, struct timeval *when, int timeout, char *text) { +@@ -642,6 +643,7 @@ void *udpdtlsclientrd(void *arg) { + if (udp2bio(s, conf->servers->rbios, cnt)) + debug(DBG_DBG, "radudpget: got DTLS in UDP from %s", addr2string((struct sockaddr *)&from)); + } ++ return NULL; + } + + void *dtlsclientrd(void *arg) { +--- a/radsecproxy.c ++++ b/radsecproxy.c +@@ -3203,6 +3203,8 @@ void *sighandler(void *arg) { + debug(DBG_WARN, "sighandler: ignoring signal %d", sig); + } + } ++ ++ return NULL; + } + + int createpidfile(const char *pidfile) { +@@ -3289,6 +3291,8 @@ int radsecproxy_main(int argc, char **ar + /* just hang around doing nothing, anything to do here? */ + for (;;) + sleep(1000); ++ ++ return 0; + } + + /* Local Variables: */ +--- a/udp.c ++++ b/udp.c +@@ -266,6 +266,8 @@ void *udpclientrd(void *arg) { + buf = radudpget(*s, NULL, &server, NULL); + replyh(server, buf); + } ++ ++ return NULL; + } + + void *udpserverrd(void *arg) { +@@ -310,6 +312,8 @@ void *udpserverwr(void *arg) { + debug(DBG_DBG, "udpserverwr: refcount %d", reply->refcount); + freerq(reply); + } ++ ++ return NULL; + } + + void addclientudp(struct client *client) { diff --git a/net/rarpd/Makefile b/net/rarpd/Makefile new file mode 100644 index 0000000..25a98a8 --- /dev/null +++ b/net/rarpd/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2006-2012 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:=rarpd +PKG_VERSION:=1.1 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.dementia.org/pub/net-tools +PKG_MD5SUM:=04e2ca849e758d0b88c8281775ec3b58 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/rarpd + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + DEPENDS:=+libnet0 + TITLE:=Reverse ARP Daemon + URL:=ftp://ftp.dementia.org/pub/net-tools/ +endef + +define Package/rarpd/description + Rarpd is a daemon which responds to RARP requests. + RARP is used by some machines at boot time to discover their + IP address. They provide their Ethernet address and rarpd + responds with their IP address if it finds it in the ethers + database. +endef + +CONFIGURE_ARGS+= \ + --with-libnet="$(STAGING_DIR)/usr/lib/libnet-1.0.x" \ + --with-pcap="$(STAGING_DIR)/usr" \ + +CONFIGURE_VARS+= \ + CFLAGS="$$$$CFLAGS -DNEW_LIBNET_INTERFACE" \ + +define Package/rarpd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rarpd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/rarpd.config $(1)/etc/config/rarpd + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/rarpd.init $(1)/etc/init.d/rarpd +endef + +define Package/rarpd/conffiles +/etc/config/rarpd +endef + +$(eval $(call BuildPackage,rarpd)) diff --git a/net/rarpd/files/rarpd.config b/net/rarpd/files/rarpd.config new file mode 100644 index 0000000..297a869 --- /dev/null +++ b/net/rarpd/files/rarpd.config @@ -0,0 +1,13 @@ +package 'rarpd' + +config 'rarpd' + option enabled 0 + + # listen on the specified interface (default: lan) +# option interface 'lan' + + # use the specified 'ethers' file (default: /etc/ethers) +# option ethers '/etc/ethers' + + # be verbose (default: false) +# option verbose 0 diff --git a/net/rarpd/files/rarpd.init b/net/rarpd/files/rarpd.init new file mode 100644 index 0000000..68feb32 --- /dev/null +++ b/net/rarpd/files/rarpd.init @@ -0,0 +1,79 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2012 OpenWrt.org + +START=50 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +append_bool() { + local var="$1" + local section="$2" + local option="$3" + local value="$4" + local _val + config_get_bool _val "$section" "$option" 0 + [ $_val -gt 0 ] && append "$var" "$value" +} + +append_string() { + local var="$1" + local section="$2" + local option="$3" + local val="$4" + local _val + config_get _val "$section" "$option" + [ -n "$_val" ] && append "$var" "$val $_val" +} + +section_enabled() { + local enabled + config_get_bool enabled "$1" 'enabled' 0 + [ $enabled -gt 0 ] +} + +start_instance() { + local section="$1" + local if + local dev + local args + + section_enabled "$section" || return 1 + + config_get if "$section" 'interface' 'lan' + network_get_device dev "$if" && { + args="-n -i $if" + append_string args "$section" 'ethers' '-e' + append_bool args "$section" 'verbose' '-v' + + SERVICE_PID_FILE="/var/run/rarpd-${if}.pid" + service_start /usr/sbin/rarpd $args + } +} + +stop_instance() { + local section="$1" + local id + local if + local dev + + section_enabled "$section" || return 1 + + config_get if "$section" 'interface' 'lan' + network_get_device dev "$if" + + SERVICE_PID_FILE="/var/run/rarpd-${if}.pid" + service_stop /usr/sbin/rarpd +} + +start() { + . /lib/functions/network.sh + config_load 'rarpd' + config_foreach start_instance 'rarpd' +} + +stop() { + . /lib/functions/network.sh + config_load 'rarpd' + config_foreach stop_instance 'rarpd' +} diff --git a/net/reaim/Makefile b/net/reaim/Makefile new file mode 100644 index 0000000..b3fa5d1 --- /dev/null +++ b/net/reaim/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2006-2012 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:=reaim +PKG_VERSION:=0.8 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/reaim +PKG_MD5SUM:=647d2ab72ec454f89294accfb3182c09 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/reaim + SUBMENU:=Instant Messaging + SECTION:=net + CATEGORY:=Network + DEPENDS:=+iptables + TITLE:=A transparent AIM / MSN proxy + URL:=http://reaim.sourceforge.net/ +endef + +define Package/reaim/description +ReAIM is a proxy for file transfers with MSN/AIM. +endef + +define Package/reaim/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/reaim $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/reaim.init $(1)/etc/init.d/reaim +endef + +$(eval $(call BuildPackage,reaim)) diff --git a/net/reaim/files/reaim.init b/net/reaim/files/reaim.init new file mode 100644 index 0000000..d848d9f --- /dev/null +++ b/net/reaim/files/reaim.init @@ -0,0 +1,26 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2012 OpenWrt.org + +START=60 + +IPT=/usr/sbin/iptables + +set_rules() { + . /lib/functions/network.sh + + local device + network_get_device device wan && { + $IPT $1 input_rule -i $device -p tcp --dport 1863:1864 -j ACCEPT + $IPT $1 input_rule -i $device -p tcp --dport 4443 -j ACCEPT + $IPT $1 input_rule -i $device -p tcp --dport 5566 -j ACCEPT + $IPT $1 input_rule -i $device -p tcp --dport 40000:40099 -j ACCEPT + } +} + +start() { + service_start /usr/sbin/reaim && set_rules -A +} + +stop() { + service_stop /usr/sbin/reaim && set_rules -D +} diff --git a/net/reaim/patches/501-cross_compile-install.patch b/net/reaim/patches/501-cross_compile-install.patch new file mode 100644 index 0000000..9e88f61 --- /dev/null +++ b/net/reaim/patches/501-cross_compile-install.patch @@ -0,0 +1,16 @@ +diff -urN reaim-0.8/Makefile reaim-0.8/Makefile +--- reaim-0.8/Makefile 2002-11-28 06:10:38.000000000 +0100 ++++ reaim-0.8/Makefile 2005-10-07 12:07:43.000000000 +0200 +@@ -11,7 +11,10 @@ + endif + + reaim: reaim.c +- gcc -o reaim reaim.c -g -Wall $(FW_FLAGS) +- ++ $(CC) $(CFLAGS) -o reaim reaim.c -Wall $(FW_FLAGS) + clean: + -rm reaim ++ ++install: ++ install -d -m 0755 $(DESTDIR)/usr/sbin ++ install -m 0755 reaim $(DESTDIR)/usr/sbin/ diff --git a/net/reaver/Makefile b/net/reaver/Makefile new file mode 100644 index 0000000..3534744 --- /dev/null +++ b/net/reaver/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2012 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:=reaver +PKG_REV:=113 +PKG_VERSION:=r$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://reaver-wps.googlecode.com/svn/trunk +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=svn + +include $(INCLUDE_DIR)/package.mk + +define Package/reaver + SECTION:=net + CATEGORY:=Network + SUBMENU:=wireless + TITLE:=Efficient brute force attack against Wifi Protected Setup + URL:=https://code.google.com/p/reaver-wps/ + DEPENDS:=+libpcap +libsqlite3 +endef + +define Package/reaver/description + Reaver targets the external registrar functionality mandated by the WiFi + Protected Setup specification. + Access points will provide authenticated registrars with their current + wireless configuration (including the WPA PSK), and also accept a new + configuration from the registrar. +endef + +CONFIGURE_PATH:=src + +MAKE_PATH:=src + +TARGET_CFLAGS+=$(TARGET_CPPFLAGS) + +define Package/reaver/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/{reaver,wash} $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/reaver + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/reaver.db $(1)/etc/reaver/ +endef + +$(eval $(call BuildPackage,reaver)) diff --git a/net/reaver/patches/0001-wpscrack-big-endian-fixes.patch b/net/reaver/patches/0001-wpscrack-big-endian-fixes.patch new file mode 100644 index 0000000..da76c2e --- /dev/null +++ b/net/reaver/patches/0001-wpscrack-big-endian-fixes.patch @@ -0,0 +1,565 @@ +From 4e7af9f022996cb0a03b30f6af265b757807dfa2 Mon Sep 17 00:00:00 2001 +From: Paul Fertser +Date: Wed, 27 Jun 2012 17:44:55 +0400 +Subject: [PATCH 1/3] wpscrack: big-endian fixes + +This should fix access to the radiotap, 802.11, LLC/SNAP and WFA +headers' fields. Run-time tested on an ar71xx BE system. + +Signed-off-by: Paul Fertser +--- + src/80211.c | 65 +++++++++++++++++++------------ + src/builder.c | 23 +++++------ + src/defs.h | 116 +++++++++++++++++++++++++++++++++++++++----------------- + src/exchange.c | 23 ++++++----- + src/wpsmon.c | 13 ++++-- + 5 files changed, 151 insertions(+), 89 deletions(-) + +diff --git a/src/80211.c b/src/80211.c +index c2aff59..19f1e92 100644 +--- a/src/80211.c ++++ b/src/80211.c +@@ -90,17 +90,19 @@ void read_ap_beacon() + if(header.len >= MIN_BEACON_SIZE) + { + rt_header = (struct radio_tap_header *) radio_header(packet, header.len); +- frame_header = (struct dot11_frame_header *) (packet + rt_header->len); +- ++ size_t rt_header_len = __le16_to_cpu(rt_header->len); ++ frame_header = (struct dot11_frame_header *) (packet + rt_header_len); ++ + if(is_target(frame_header)) + { +- if(frame_header->fc.type == MANAGEMENT_FRAME && frame_header->fc.sub_type == SUBTYPE_BEACON) ++ if((frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == ++ __cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON)) + { +- beacon = (struct beacon_management_frame *) (packet + rt_header->len + sizeof(struct dot11_frame_header)); ++ beacon = (struct beacon_management_frame *) (packet + rt_header_len + sizeof(struct dot11_frame_header)); + set_ap_capability(beacon->capability); + + /* Obtain the SSID and channel number from the beacon packet */ +- tag_offset = rt_header->len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame); ++ tag_offset = rt_header_len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame); + channel = parse_beacon_tags(packet, header.len); + + /* If no channel was manually specified, switch to the AP's current channel */ +@@ -135,29 +137,31 @@ int8_t signal_strength(const u_char *packet, size_t len) + { + header = (struct radio_tap_header *) packet; + +- if((header->flags & SSI_FLAG) == SSI_FLAG) ++ uint32_t flags = __le32_to_cpu(header->flags); ++ ++ if((flags & SSI_FLAG) == SSI_FLAG) + { +- if((header->flags & TSFT_FLAG) == TSFT_FLAG) ++ if((flags & TSFT_FLAG) == TSFT_FLAG) + { + offset += TSFT_SIZE; + } + +- if((header->flags & FLAGS_FLAG) == FLAGS_FLAG) ++ if((flags & FLAGS_FLAG) == FLAGS_FLAG) + { + offset += FLAGS_SIZE; + } + +- if((header->flags & RATE_FLAG) == RATE_FLAG) ++ if((flags & RATE_FLAG) == RATE_FLAG) + { + offset += RATE_SIZE; + } + +- if((header->flags & CHANNEL_FLAG) == CHANNEL_FLAG) ++ if((flags & CHANNEL_FLAG) == CHANNEL_FLAG) + { + offset += CHANNEL_SIZE; + } + +- if((header->flags & FHSS_FLAG) == FHSS_FLAG) ++ if((flags & FHSS_FLAG) == FHSS_FLAG) + { + offset += FHSS_FLAG; + } +@@ -196,11 +200,13 @@ int is_wps_locked() + if(header.len >= MIN_BEACON_SIZE) + { + rt_header = (struct radio_tap_header *) radio_header(packet, header.len); +- frame_header = (struct dot11_frame_header *) (packet + rt_header->len); ++ size_t rt_header_len = __le16_to_cpu(rt_header->len); ++ frame_header = (struct dot11_frame_header *) (packet + rt_header_len); + + if(memcmp(frame_header->addr3, get_bssid(), MAC_ADDR_LEN) == 0) + { +- if(frame_header->fc.type == MANAGEMENT_FRAME && frame_header->fc.sub_type == SUBTYPE_BEACON) ++ if((frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == ++ __cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON)) + { + if(parse_wps_parameters(packet, header.len, &wps)) + { +@@ -411,24 +417,30 @@ int associate_recv_loop() + if(header.len >= MIN_AUTH_SIZE) + { + rt_header = (struct radio_tap_header *) radio_header(packet, header.len); +- dot11_frame = (struct dot11_frame_header *) (packet + rt_header->len); ++ size_t rt_header_len = __le16_to_cpu(rt_header->len); ++ dot11_frame = (struct dot11_frame_header *) (packet + rt_header_len); + + if((memcmp(dot11_frame->addr3, get_bssid(), MAC_ADDR_LEN) == 0) && + (memcmp(dot11_frame->addr1, get_mac(), MAC_ADDR_LEN) == 0)) + { +- if(dot11_frame->fc.type == MANAGEMENT_FRAME) ++ if((dot11_frame->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE)) == ++ __cpu_to_le16(IEEE80211_FTYPE_MGMT)) + { +- auth_frame = (struct authentication_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header->len); +- assoc_frame = (struct association_response_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header->len); ++ auth_frame = (struct authentication_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header_len); ++ assoc_frame = (struct association_response_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header_len); + + /* Did we get an authentication packet with a successful status? */ +- if((dot11_frame->fc.sub_type == SUBTYPE_AUTHENTICATION) && (auth_frame->status == AUTHENTICATION_SUCCESS)) ++ if((dot11_frame->fc & __cpu_to_le16(IEEE80211_FCTL_STYPE)) == ++ __cpu_to_le16(IEEE80211_STYPE_AUTH) ++ && (auth_frame->status == __cpu_to_le16(AUTHENTICATION_SUCCESS))) + { + ret_val = AUTH_OK; + break; + } + /* Did we get an association packet with a successful status? */ +- else if((dot11_frame->fc.sub_type == SUBTYPE_ASSOCIATION) && (assoc_frame->status == ASSOCIATION_SUCCESS)) ++ else if((dot11_frame->fc & __cpu_to_le16(IEEE80211_FCTL_STYPE)) == ++ __cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP) ++ && (assoc_frame->status == __cpu_to_le16(ASSOCIATION_SUCCESS))) + { + ret_val = ASSOCIATE_OK; + break; +@@ -455,13 +467,14 @@ enum encryption_type supported_encryption(const u_char *packet, size_t len) + if(len > MIN_BEACON_SIZE) + { + rt_header = (struct radio_tap_header *) radio_header(packet, len); +- beacon = (struct beacon_management_frame *) (packet + rt_header->len + sizeof(struct dot11_frame_header)); +- offset = tag_offset = rt_header->len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame); ++ size_t rt_header_len = __le16_to_cpu(rt_header->len); ++ beacon = (struct beacon_management_frame *) (packet + rt_header_len + sizeof(struct dot11_frame_header)); ++ offset = tag_offset = rt_header_len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame); + + tag_len = len - tag_offset; + tag_data = (const u_char *) (packet + tag_offset); + +- if((beacon->capability & CAPABILITY_WEP) == CAPABILITY_WEP) ++ if((__le16_to_cpu(beacon->capability) & CAPABILITY_WEP) == CAPABILITY_WEP) + { + enc = WEP; + +@@ -509,7 +522,7 @@ int parse_beacon_tags(const u_char *packet, size_t len) + struct radio_tap_header *rt_header = NULL; + + rt_header = (struct radio_tap_header *) radio_header(packet, len); +- tag_offset = rt_header->len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame); ++ tag_offset = __le16_to_cpu(rt_header->len) + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame); + + if(tag_offset < len) + { +@@ -548,7 +561,7 @@ int parse_beacon_tags(const u_char *packet, size_t len) + { + if(ie_len == 1) + { +- memcpy((int *) &channel, channel_data, ie_len); ++ channel = *(uint8_t*)channel_data; + } + free(channel_data); + } +@@ -603,13 +616,13 @@ int check_fcs(const u_char *packet, size_t len) + if(len > 4) + { + /* Get the packet's reported FCS (last 4 bytes of the packet) */ +- memcpy((uint32_t *) &fcs, (packet + (len-4)), 4); ++ fcs = __le32_to_cpu(*(uint32_t*)(packet + (len-4))); + + /* FCS is not calculated over the radio tap header */ + if(has_rt_header()) + { + rt_header = (struct radio_tap_header *) packet; +- offset += rt_header->len; ++ offset += __le16_to_cpu(rt_header->len); + } + + if(len > offset) +diff --git a/src/builder.c b/src/builder.c +index 37f2de7..6bf89e7 100644 +--- a/src/builder.c ++++ b/src/builder.c +@@ -44,9 +44,8 @@ const void *build_radio_tap_header(size_t *len) + memset((void *) buf, 0, sizeof(struct radio_tap_header)); + rt_header = (struct radio_tap_header *) buf; + +- rt_header->len = sizeof(struct radio_tap_header); +- +- *len = rt_header->len; ++ *len = sizeof(struct radio_tap_header); ++ rt_header->len = __cpu_to_le16(*len); + } + + return buf; +@@ -67,9 +66,9 @@ const void *build_dot11_frame_header(uint16_t fc, size_t *len) + + frag_seq += SEQ_MASK; + +- header->duration = DEFAULT_DURATION; +- memcpy((void *) &header->fc, (void *) &fc, sizeof(struct frame_control)); +- header->frag_seq = frag_seq; ++ header->duration = __cpu_to_le16(DEFAULT_DURATION); ++ header->fc = __cpu_to_le16(fc); ++ header->frag_seq = __cpu_to_le16(frag_seq); + + memcpy((void *) header->addr1, get_bssid(), MAC_ADDR_LEN); + memcpy((void *) header->addr2, get_mac(), MAC_ADDR_LEN); +@@ -91,8 +90,8 @@ const void *build_authentication_management_frame(size_t *len) + memset((void *) buf, 0, *len); + frame = (struct authentication_management_frame *) buf; + +- frame->algorithm = OPEN_SYSTEM; +- frame->sequence = 1; ++ frame->algorithm = __cpu_to_le16(OPEN_SYSTEM); ++ frame->sequence = __cpu_to_le16(1); + frame->status = 0; + } + +@@ -111,8 +110,8 @@ const void *build_association_management_frame(size_t *len) + memset((void *) buf, 0, *len); + frame = (struct association_request_management_frame *) buf; + +- frame->capability = get_ap_capability(); +- frame->listen_interval = LISTEN_INTERVAL; ++ frame->capability = __cpu_to_le16(get_ap_capability()); ++ frame->listen_interval = __cpu_to_le16(LISTEN_INTERVAL); + } + + return buf; +@@ -133,7 +132,7 @@ const void *build_llc_header(size_t *len) + header->dsap = LLC_SNAP; + header->ssap = LLC_SNAP; + header->control_field = UNNUMBERED_FRAME; +- header->type = DOT1X_AUTHENTICATION; ++ header->type = __cpu_to_be16(DOT1X_AUTHENTICATION); + + } + +@@ -279,7 +278,7 @@ const void *build_wfa_header(uint8_t op_code, size_t *len) + header = (struct wfa_expanded_header *) buf; + + memcpy(header->id, WFA_VENDOR_ID, sizeof(header->id)); +- header->type = SIMPLE_CONFIG; ++ header->type = __cpu_to_be32(SIMPLE_CONFIG); + header->opcode = op_code; + } + +diff --git a/src/defs.h b/src/defs.h +index b2f45ea..0c628e7 100644 +--- a/src/defs.h ++++ b/src/defs.h +@@ -41,6 +41,7 @@ + #include + #include + #include ++#include + + #include "wps.h" + +@@ -65,10 +66,10 @@ + #define MANAGEMENT_FRAME 0x00 + #define SUBTYPE_BEACON 0x08 + +-#define DOT1X_AUTHENTICATION 0x8E88 ++#define DOT1X_AUTHENTICATION 0x888E + #define DOT1X_EAP_PACKET 0x00 + +-#define SIMPLE_CONFIG 0x01000000 ++#define SIMPLE_CONFIG 0x00000001 + + #define P1_SIZE 10000 + #define P2_SIZE 1000 +@@ -282,66 +283,111 @@ enum wfa_elements + WEP_TRANSMIT_KEY = 0x10064 + }; + ++#define IEEE80211_FCTL_VERS 0x0003 ++#define IEEE80211_FCTL_FTYPE 0x000c ++#define IEEE80211_FCTL_STYPE 0x00f0 ++#define IEEE80211_FCTL_TODS 0x0100 ++#define IEEE80211_FCTL_FROMDS 0x0200 ++#define IEEE80211_FCTL_MOREFRAGS 0x0400 ++#define IEEE80211_FCTL_RETRY 0x0800 ++#define IEEE80211_FCTL_PM 0x1000 ++#define IEEE80211_FCTL_MOREDATA 0x2000 ++#define IEEE80211_FCTL_PROTECTED 0x4000 ++#define IEEE80211_FCTL_ORDER 0x8000 ++ ++#define IEEE80211_SCTL_FRAG 0x000F ++#define IEEE80211_SCTL_SEQ 0xFFF0 ++ ++#define IEEE80211_FTYPE_MGMT 0x0000 ++#define IEEE80211_FTYPE_CTL 0x0004 ++#define IEEE80211_FTYPE_DATA 0x0008 ++ ++/* management */ ++#define IEEE80211_STYPE_ASSOC_REQ 0x0000 ++#define IEEE80211_STYPE_ASSOC_RESP 0x0010 ++#define IEEE80211_STYPE_REASSOC_REQ 0x0020 ++#define IEEE80211_STYPE_REASSOC_RESP 0x0030 ++#define IEEE80211_STYPE_PROBE_REQ 0x0040 ++#define IEEE80211_STYPE_PROBE_RESP 0x0050 ++#define IEEE80211_STYPE_BEACON 0x0080 ++#define IEEE80211_STYPE_ATIM 0x0090 ++#define IEEE80211_STYPE_DISASSOC 0x00A0 ++#define IEEE80211_STYPE_AUTH 0x00B0 ++#define IEEE80211_STYPE_DEAUTH 0x00C0 ++#define IEEE80211_STYPE_ACTION 0x00D0 ++ ++/* control */ ++#define IEEE80211_STYPE_BACK_REQ 0x0080 ++#define IEEE80211_STYPE_BACK 0x0090 ++#define IEEE80211_STYPE_PSPOLL 0x00A0 ++#define IEEE80211_STYPE_RTS 0x00B0 ++#define IEEE80211_STYPE_CTS 0x00C0 ++#define IEEE80211_STYPE_ACK 0x00D0 ++#define IEEE80211_STYPE_CFEND 0x00E0 ++#define IEEE80211_STYPE_CFENDACK 0x00F0 ++ ++/* data */ ++#define IEEE80211_STYPE_DATA 0x0000 ++#define IEEE80211_STYPE_DATA_CFACK 0x0010 ++#define IEEE80211_STYPE_DATA_CFPOLL 0x0020 ++#define IEEE80211_STYPE_DATA_CFACKPOLL 0x0030 ++#define IEEE80211_STYPE_NULLFUNC 0x0040 ++#define IEEE80211_STYPE_CFACK 0x0050 ++#define IEEE80211_STYPE_CFPOLL 0x0060 ++#define IEEE80211_STYPE_CFACKPOLL 0x0070 ++#define IEEE80211_STYPE_QOS_DATA 0x0080 ++#define IEEE80211_STYPE_QOS_DATA_CFACK 0x0090 ++#define IEEE80211_STYPE_QOS_DATA_CFPOLL 0x00A0 ++#define IEEE80211_STYPE_QOS_DATA_CFACKPOLL 0x00B0 ++#define IEEE80211_STYPE_QOS_NULLFUNC 0x00C0 ++#define IEEE80211_STYPE_QOS_CFACK 0x00D0 ++#define IEEE80211_STYPE_QOS_CFPOLL 0x00E0 ++#define IEEE80211_STYPE_QOS_CFACKPOLL 0x00F0 ++ + #pragma pack(1) + struct radio_tap_header + { + uint8_t revision; + uint8_t pad; +- uint16_t len; +- uint32_t flags; +-}; +- +-struct frame_control +-{ +- unsigned version : 2; +- unsigned type : 2; +- unsigned sub_type : 4; +- +- unsigned to_ds : 1; +- unsigned from_ds : 1; +- unsigned more_frag : 1; +- unsigned retry : 1; +- unsigned pwr_mgt : 1; +- unsigned more_data : 1; +- unsigned protected_frame : 1; +- unsigned order : 1; ++ __le16 len; ++ __le32 flags; + }; + + struct dot11_frame_header + { +- struct frame_control fc; +- uint16_t duration; ++ __le16 fc; ++ __le16 duration; + unsigned char addr1[MAC_ADDR_LEN]; + unsigned char addr2[MAC_ADDR_LEN]; + unsigned char addr3[MAC_ADDR_LEN]; +- uint16_t frag_seq; ++ __le16 frag_seq; + }; + + struct authentication_management_frame + { +- uint16_t algorithm; +- uint16_t sequence; +- uint16_t status; ++ __le16 algorithm; ++ __le16 sequence; ++ __le16 status; + }; + + struct association_request_management_frame + { +- uint16_t capability; +- uint16_t listen_interval; ++ __le16 capability; ++ __le16 listen_interval; + }; + + struct association_response_management_frame + { +- uint16_t capability; +- uint16_t status; +- uint16_t id; ++ __le16 capability; ++ __le16 status; ++ __le16 id; + }; + + struct beacon_management_frame + { + unsigned char timestamp[TIMESTAMP_LEN]; +- uint16_t beacon_interval; +- uint16_t capability; ++ __le16 beacon_interval; ++ __le16 capability; + }; + + struct llc_header +@@ -350,7 +396,7 @@ struct llc_header + uint8_t ssap; + uint8_t control_field; + unsigned char org_code[3]; +- uint16_t type; ++ __be16 type; + }; + + struct dot1X_header +@@ -371,7 +417,7 @@ struct eap_header + struct wfa_expanded_header + { + unsigned char id[3]; +- uint32_t type; ++ __be32 type; + uint8_t opcode; + uint8_t flags; + }; +diff --git a/src/exchange.c b/src/exchange.c +index 23c87e9..4f9a82b 100644 +--- a/src/exchange.c ++++ b/src/exchange.c +@@ -306,26 +306,27 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header) + + /* Cast the radio tap and 802.11 frame headers and parse out the Frame Control field */ + rt_header = (struct radio_tap_header *) packet; +- frame_header = (struct dot11_frame_header *) (packet+rt_header->len); ++ size_t rt_header_len = __le16_to_cpu(rt_header->len); ++ frame_header = (struct dot11_frame_header *) (packet+rt_header_len); + + /* Does the BSSID/source address match our target BSSID? */ + if(memcmp(frame_header->addr3, get_bssid(), MAC_ADDR_LEN) == 0) + { + /* Is this a data packet sent to our MAC address? */ +- if(frame_header->fc.type == DATA_FRAME && +- frame_header->fc.sub_type == SUBTYPE_DATA && +- (memcmp(frame_header->addr1, get_mac(), MAC_ADDR_LEN) == 0)) ++ if (((frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == ++ __cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)) && ++ (memcmp(frame_header->addr1, get_mac(), MAC_ADDR_LEN) == 0)) + { + llc = (struct llc_header *) (packet + +- rt_header->len + ++ rt_header_len + + sizeof(struct dot11_frame_header) + ); + + /* All packets in our exchanges will be 802.1x */ +- if(llc->type == DOT1X_AUTHENTICATION) ++ if(llc->type == __cpu_to_be16(DOT1X_AUTHENTICATION)) + { + dot1x = (struct dot1X_header *) (packet + +- rt_header->len + ++ rt_header_len + + sizeof(struct dot11_frame_header) + + sizeof(struct llc_header) + ); +@@ -334,7 +335,7 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header) + if(dot1x->type == DOT1X_EAP_PACKET && (header->len >= EAP_PACKET_SIZE)) + { + eap = (struct eap_header *) (packet + +- rt_header->len + ++ rt_header_len + + sizeof(struct dot11_frame_header) + + sizeof(struct llc_header) + + sizeof(struct dot1X_header) +@@ -366,7 +367,7 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header) + else if((eap->type == EAP_EXPANDED) && (header->len > WFA_PACKET_SIZE)) + { + wfa = (struct wfa_expanded_header *) (packet + +- rt_header->len + ++ rt_header_len + + sizeof(struct dot11_frame_header) + + sizeof(struct llc_header) + + sizeof(struct dot1X_header) + +@@ -374,14 +375,14 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header) + ); + + /* Verify that this is a WPS message */ +- if(wfa->type == SIMPLE_CONFIG) ++ if(wfa->type == __cpu_to_be32(SIMPLE_CONFIG)) + { + wps_msg_len = (size_t) ntohs(eap->len) - + sizeof(struct eap_header) - + sizeof(struct wfa_expanded_header); + + wps_msg = (const void *) (packet + +- rt_header->len + ++ rt_header_len + + sizeof(struct dot11_frame_header) + + sizeof(struct llc_header) + + sizeof(struct dot1X_header) + +diff --git a/src/wpsmon.c b/src/wpsmon.c +index d976924..22a394f 100644 +--- a/src/wpsmon.c ++++ b/src/wpsmon.c +@@ -295,7 +295,8 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char * + } + + rt_header = (struct radio_tap_header *) radio_header(packet, header->len); +- frame_header = (struct dot11_frame_header *) (packet + rt_header->len); ++ size_t rt_header_len = __le16_to_cpu(rt_header->len); ++ frame_header = (struct dot11_frame_header *) (packet + rt_header_len); + + /* If a specific BSSID was specified, only parse packets from that BSSID */ + if(!is_target(frame_header)) +@@ -323,15 +324,17 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char * + channel_changed = 1; + } + +- if(frame_header->fc.sub_type == PROBE_RESPONSE || +- frame_header->fc.sub_type == SUBTYPE_BEACON) ++ unsigned fsub_type = frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_STYPE); ++ ++ if(fsub_type == __cpu_to_le16(IEEE80211_STYPE_PROBE_RESP) || ++ fsub_type == __cpu_to_le16(IEEE80211_STYPE_BEACON)) + { + wps_parsed = parse_wps_parameters(packet, header->len, wps); + } + + if(!is_done(bssid) && (get_channel() == channel || source == PCAP_FILE)) + { +- if(frame_header->fc.sub_type == SUBTYPE_BEACON && ++ if(fsub_type == __cpu_to_le16(IEEE80211_STYPE_BEACON) && + mode == SCAN && + !passive && + should_probe(bssid)) +@@ -369,7 +372,7 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char * + * If there was no WPS information, then the AP does not support WPS and we should ignore it from here on. + * If this was a probe response, then we've gotten all WPS info we can get from this AP and should ignore it from here on. + */ +- if(!wps_parsed || frame_header->fc.sub_type == PROBE_RESPONSE) ++ if(!wps_parsed || fsub_type == __cpu_to_le16(IEEE80211_STYPE_PROBE_RESP)) + { + mark_ap_complete(bssid); + } +-- +1.7.7 + diff --git a/net/reaver/patches/0002-Use-the-current-directory-for-storing-and-loading-se.patch b/net/reaver/patches/0002-Use-the-current-directory-for-storing-and-loading-se.patch new file mode 100644 index 0000000..dd1bb42 --- /dev/null +++ b/net/reaver/patches/0002-Use-the-current-directory-for-storing-and-loading-se.patch @@ -0,0 +1,53 @@ +From cd444949f3176790101b8bdc9656831a03d8c01d Mon Sep 17 00:00:00 2001 +From: Paul Fertser +Date: Tue, 10 Jul 2012 11:13:29 +0400 +Subject: [PATCH 2/3] Use the current directory for storing and loading + sessions + +This allows the user to always explicitely choose (by changing the +current directory before launching the program) where the session +files should go. Useful e.g. to avoid hogging the precious space on +embedded devices, just cd /tmp before starting the app. + +Signed-off-by: Paul Fertser +--- + src/session.c | 16 +++------------- + 1 files changed, 3 insertions(+), 13 deletions(-) + +diff --git a/src/session.c b/src/session.c +index d3af0c3..308f213 100644 +--- a/src/session.c ++++ b/src/session.c +@@ -62,7 +62,7 @@ int restore_session() + memset(file, 0, FILENAME_MAX); + + bssid = mac2str(get_bssid(), '\0'); +- snprintf(file, FILENAME_MAX, "%s/%s.%s", CONF_DIR, bssid, CONF_EXT); ++ snprintf(file, FILENAME_MAX, "%s.%s", bssid, CONF_EXT); + free(bssid); + } + +@@ -199,18 +199,8 @@ int save_session() + } + else + { +- /* +- * If the configuration directory exists, save the session file there; else, save it to the +- * current working directory. +- */ +- if(configuration_directory_exists()) +- { +- snprintf((char *) &file_name, FILENAME_MAX, "%s/%s.%s", CONF_DIR, bssid, CONF_EXT); +- } +- else +- { +- snprintf((char *) &file_name, FILENAME_MAX, "%s.%s", bssid, CONF_EXT); +- } ++ /* save session to the current directory */ ++ snprintf((char *) &file_name, FILENAME_MAX, "%s.%s", bssid, CONF_EXT); + } + + /* Don't bother saving anything if nothing has been done */ +-- +1.7.7 + diff --git a/net/reaver/patches/0003-wash-wpsmon-use-less-useless-spaces-in-output-to-fit.patch b/net/reaver/patches/0003-wash-wpsmon-use-less-useless-spaces-in-output-to-fit.patch new file mode 100644 index 0000000..64b290b --- /dev/null +++ b/net/reaver/patches/0003-wash-wpsmon-use-less-useless-spaces-in-output-to-fit.patch @@ -0,0 +1,38 @@ +From 638bb8d70d6c7e5dc99975e0bf57d8ce0455e2cc Mon Sep 17 00:00:00 2001 +From: Paul Fertser +Date: Tue, 10 Jul 2012 11:25:00 +0400 +Subject: [PATCH 3/3] wash/wpsmon: use less useless spaces in output to fit + narrow terminals + +Signed-off-by: Paul Fertser +--- + src/wpsmon.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/wpsmon.c b/src/wpsmon.c +index 22a394f..e0948b3 100644 +--- a/src/wpsmon.c ++++ b/src/wpsmon.c +@@ -262,8 +262,8 @@ void monitor(char *bssid, int passive, int source, int channel, int mode) + + if(!header_printed) + { +- cprintf(INFO, "BSSID Channel RSSI WPS Version WPS Locked ESSID\n"); +- cprintf(INFO, "---------------------------------------------------------------------------------------------------------------\n"); ++ cprintf(INFO, "BSSID Channel RSSI WPS Version WPS Locked ESSID\n"); ++ cprintf(INFO, "--------------------------------------------------------------------------------------\n"); + header_printed = 1; + } + +@@ -360,7 +360,7 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char * + break; + } + +- cprintf(INFO, "%17s %2d %.2d %d.%d %s %s\n", bssid, channel, rssi, (wps->version >> 4), (wps->version & 0x0F), lock_display, ssid); ++ cprintf(INFO, "%17s %2d %.2d %d.%d %s %s\n", bssid, channel, rssi, (wps->version >> 4), (wps->version & 0x0F), lock_display, ssid); + } + + if(probe_sent) +-- +1.7.7 + diff --git a/net/redir/Makefile b/net/redir/Makefile new file mode 100644 index 0000000..c822b8c --- /dev/null +++ b/net/redir/Makefile @@ -0,0 +1,36 @@ +# Copyright (C) 2009 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:=redir +PKG_VERSION:=2.2.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://sammy.net/~sammy/hacks +PKG_MD5SUM:=4342fadac30504c86c8db7beefe01995 + +include $(INCLUDE_DIR)/package.mk + +define Package/redir + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE=Redirect TCP connections + URL:=http://sammy.net/~sammy/hacks +endef + +define Package/redir/description + A port redirector, used to forward incoming connections to somewhere else. +endef + +define Package/redir/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/redir $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,redir)) diff --git a/net/redir/patches/00_honor_copts.patch b/net/redir/patches/00_honor_copts.patch new file mode 100644 index 0000000..dfd6b46 --- /dev/null +++ b/net/redir/patches/00_honor_copts.patch @@ -0,0 +1,12 @@ +diff -ruN a/Makefile b/Makefile +--- a/Makefile 2009-05-07 14:31:14.000000000 +0100 ++++ b/Makefile 2009-05-07 14:31:47.000000000 +0100 +@@ -32,7 +32,7 @@ + # if your system lacks getopt_long, remove the comment from this line + OBJS = redir.o $(GETOPT_OBJS) + +-CFLAGS = -O2 -Wall $(STR_CFLAGS) $(WRAP_CFLAGS) $(EXTRA_CFLAGS) ++CFLAGS += -Wall $(STR_CFLAGS) $(WRAP_CFLAGS) $(EXTRA_CFLAGS) + LDFLAGS = -s + + # solaris, and others, may also need these libraries to link diff --git a/net/redir/patches/01_fix_max_bandwidth_docs.patch b/net/redir/patches/01_fix_max_bandwidth_docs.patch new file mode 100644 index 0000000..378061c --- /dev/null +++ b/net/redir/patches/01_fix_max_bandwidth_docs.patch @@ -0,0 +1,54 @@ +diff -Nur a/redir.c b/redir.c +--- a/redir.c 1999-12-26 15:50:06.000000000 -0500 ++++ b/redir.c 2005-10-22 21:21:56.849499952 -0400 +@@ -233,7 +233,7 @@ + #ifndef NO_SHAPER + /* options for bandwidth */ + fprintf(stderr, "\t\t--bufsize=\tsize of the buffer\n"); +- fprintf(stderr, "\t\t--maxbandwidth=\tlimit the bandwidth\n"); ++ fprintf(stderr, "\t\t--max_bandwidth=\tlimit the bandwidth\n"); + fprintf(stderr, "\t\t--random_wait=\twait before each packet\n"); + fprintf(stderr, "\t\t--wait_in_out=\t1 wait for in, 2 out, 3 in&out\n"); + /* end options for bandwidth */ +diff -urNad redir-2.2.1~/redir.man redir-2.2.1/redir.man +--- redir-2.2.1~/redir.man 1999-12-26 15:52:24.000000000 -0500 ++++ redir-2.2.1/redir.man 2005-10-22 21:22:28.882630176 -0400 +@@ -18,7 +18,7 @@ + .I --lport=port + .I --cport=port + .RB [ \--bufsize=n ] +-.RB [ \--maxbandwidth=n ] ++.RB [ \--max_bandwidth=n ] + .RB [ \--random_wait=n ] + .RB [ \--wait_in_out=n ] + .ll -8 +@@ -35,7 +35,7 @@ + .RB [ \--connect=host:port ] + .I --cport=port + .RB [ \--bufsize=n ] +-.RB [ \--maxbandwidth=n ] ++.RB [ \--max_bandwidth=n ] + .RB [ \--random_wait=n ] + .RB [ \--wait_in_out=n ] + .ll -8 +@@ -102,9 +102,9 @@ + .TP + .B \--bufsize n + Set the bufsize (defaut 4096) in bytes. Can be used combined with +---maxbandwidth or --random_wait to simulate a slow connection. ++--max_bandwidth or --random_wait to simulate a slow connection. + .TP +-.B \--maxbandwidth n ++.B \--max_bandwidth n + Reduce the bandwidth to be no more than n bits/sec. The algorithme is + basic, the goal is to simulate a slow connection, so there is no pic + acceptance. +@@ -115,7 +115,7 @@ + than the bufsize (see also --bufsize). + .TP + .B \--wait_in_out n +-Apply --maxbandwidth and --random_wait for input if n=1, output if n=2 and ++Apply --max_bandwidth and --random_wait for input if n=1, output if n=2 and + both if n=3. + .SH "SEE ALSO" + inetd(1) diff --git a/net/redir/patches/02_use_ntohs.patch b/net/redir/patches/02_use_ntohs.patch new file mode 100644 index 0000000..a6b9f0f --- /dev/null +++ b/net/redir/patches/02_use_ntohs.patch @@ -0,0 +1,43 @@ +diff -Nur a/redir.c b/redir.c +--- a/redir.c 1999-12-26 15:50:06.000000000 -0500 ++++ b/redir.c 2005-10-22 21:29:55.491735272 -0400 +@@ -745,7 +745,7 @@ + } + + debug1("peer IP is %s\n", inet_ntoa(client.sin_addr)); +- debug1("peer socket is %d\n", client.sin_port); ++ debug1("peer socket is %d\n", ntohs(client.sin_port)); + + /* + * Double fork here so we don't have to wait later +@@ -871,8 +871,8 @@ + strcpy(tmp2, inet_ntoa(target->sin_addr)); + + syslog(LOG_NOTICE, "connecting %s/%d to %s/%d", +- tmp1, client.sin_port, +- tmp2, target->sin_port); ++ tmp1, ntohs(client.sin_port), ++ tmp2, ntohs(target->sin_port)); + } + + /* do proxy stuff */ +@@ -1066,7 +1066,7 @@ + + if (!getpeername(0, (struct sockaddr *) &client, &client_size)) { + debug1("peer IP is %s\n", inet_ntoa(client.sin_addr)); +- debug1("peer socket is %d\n", client.sin_port); ++ debug1("peer socket is %d\n", ntohs(client.sin_port)); + } + if ((targetsock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { + perror("target: socket"); +@@ -1109,8 +1109,8 @@ + + if (dosyslog) { + syslog(LOG_NOTICE, "connecting %s/%d to %s/%d", +- inet_ntoa(client.sin_addr), client.sin_port, +- target_ip, target.sin_port); ++ inet_ntoa(client.sin_addr), ntohs(client.sin_port), ++ target_ip, ntohs(target.sin_port)); + } + + /* Just start copying - one side of the loop is stdin - 0 */ diff --git a/net/redir/patches/03_fix_tcp_wrappers.patch b/net/redir/patches/03_fix_tcp_wrappers.patch new file mode 100644 index 0000000..3718c65 --- /dev/null +++ b/net/redir/patches/03_fix_tcp_wrappers.patch @@ -0,0 +1,25 @@ +diff -Nur a/redir.c b/redir.c +--- a/redir.c 2005-10-22 22:10:11.439455392 -0400 ++++ b/redir.c 2005-10-22 22:10:51.625346208 -0400 +@@ -802,8 +802,8 @@ + #ifdef USE_TCP_WRAPPERS + request_init(&request, RQ_DAEMON, ident, RQ_FILE, clisock, 0); + sock_host(&request); +- sock_hostname(&request); +- sock_hostaddr(&request); ++ sock_hostname(request.client); ++ sock_hostaddr(request.client); + + if (!hosts_access(&request)) { + refuse(&request); +@@ -1057,8 +1057,8 @@ + #ifdef USE_TCP_WRAPPERS + request_init(&request, RQ_DAEMON, ident, RQ_FILE, 0, 0); + sock_host(&request); +- sock_hostname(&request); +- sock_hostaddr(&request); ++ sock_hostname(request.client); ++ sock_hostaddr(request.client); + + if (!hosts_access(&request)) + refuse(&request); diff --git a/net/redir/patches/04_fix_timeouts.patch b/net/redir/patches/04_fix_timeouts.patch new file mode 100644 index 0000000..45bba9b --- /dev/null +++ b/net/redir/patches/04_fix_timeouts.patch @@ -0,0 +1,38 @@ +diff -Nur a/redir.c b/redir.c +--- a/redir.c 2005-10-22 22:44:39.504061784 -0400 ++++ b/redir.c 2005-10-22 22:47:14.746461352 -0400 +@@ -598,10 +598,6 @@ + /* Record start time */ + start_time = (unsigned int) time(NULL); + +- /* Set up timeout */ +- timeout.tv_sec = timeout_secs; +- timeout.tv_usec = 0; +- + /* file descriptor bits */ + FD_ZERO(&iofds); + FD_SET(insock, &iofds); +@@ -618,14 +614,21 @@ + while(1) { + (void) memcpy(&c_iofds, &iofds, sizeof(iofds)); + ++ /* Set up timeout, Linux returns seconds left in this structure ++ * so we have to reset it before each select(). */ ++ timeout.tv_sec = timeout_secs; ++ timeout.tv_usec = 0; ++ + + if (select(max_fd + 1, + &c_iofds, + (fd_set *)0, + (fd_set *)0, + (timeout_secs ? &timeout : NULL)) <= 0) { +- /* syslog(LLEV,"connection timeout: %d sec",timeout.tv_sec);*/ +- break; ++ if (dosyslog) { ++ syslog(LOG_NOTICE,"connection timeout: %d sec",timeout_secs); ++ } ++ break; + } + + if(FD_ISSET(insock, &c_iofds)) { diff --git a/net/redir/patches/06_fix_shaper_buffer.patch b/net/redir/patches/06_fix_shaper_buffer.patch new file mode 100644 index 0000000..8cbe723 --- /dev/null +++ b/net/redir/patches/06_fix_shaper_buffer.patch @@ -0,0 +1,56 @@ +diff -Nur a/redir.c b/redir.c +--- a/redir.c 2005-10-22 23:20:05.235901424 -0400 ++++ b/redir.c 2005-10-22 23:22:20.198384008 -0400 +@@ -259,7 +259,7 @@ + #endif + int *transproxy, + #ifndef NO_SHAPER +- unsigned int * bufsize, ++ unsigned int * bufsizeout, + int * max_bandwidth, + int * random_wait, + int * wait_in_out, +@@ -366,7 +366,7 @@ + + #ifndef NO_SHAPER + case 'z': +- *bufsize = (unsigned int)atol(optarg); ++ *bufsizeout = (unsigned int)atol(optarg); + break; + + case 'm': +@@ -593,7 +593,7 @@ + unsigned long bytes_in = 0; + unsigned long bytes_out = 0; + unsigned int start_time, end_time; +- char buf[bufsize]; ++ char* buf = malloc(bufsize); + + /* Record start time */ + start_time = (unsigned int) time(NULL); +@@ -632,7 +632,7 @@ + } + + if(FD_ISSET(insock, &c_iofds)) { +- if((bytes = read(insock, buf, sizeof(buf))) <= 0) ++ if((bytes = read(insock, buf, bufsize)) <= 0) + break; + #ifndef NO_FTP + if (ftp & FTP_PORT) +@@ -647,7 +647,7 @@ + bytes_out += bytes; + } + if(FD_ISSET(outsock, &c_iofds)) { +- if((bytes = read(outsock, buf, sizeof(buf))) <= 0) ++ if((bytes = read(outsock, buf, bufsize)) <= 0) + break; + /* if we're correcting for PASV on ftp redirections, then + fix buf and bytes to have the new address, among other +@@ -684,6 +684,7 @@ + syslog(LOG_NOTICE, "disconnect %d secs, %ld in %ld out", + (end_time - start_time), bytes_in, bytes_out); + } ++ free(buf); + return; + } + diff --git a/net/remotefs/Makefile b/net/remotefs/Makefile new file mode 100644 index 0000000..2930074 --- /dev/null +++ b/net/remotefs/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2006-2012 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:=remotefs +PKG_REV:=1297 +PKG_VERSION:=$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=svn +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=remotefs-$(PKG_VERSION) +PKG_SOURCE_URL:=http://remotefs.svn.sourceforge.net/svnroot/remotefs/trunk +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +include $(INCLUDE_DIR)/package.mk + +define Package/remotefs + TITLE:=RemoteFS + SECTION:=net + CATEGORY:=Network + SUBMENU:=Filesystem + DEPENDS:=+libfuse +libpthread + URL:=http://remotefs.sourceforge.net +endef + +define Package/remotefs/description + remotefs is a network file system designed for use with home NAS. + Simple to use, few dependencies, reasonable security, completely + in user space. Provided remotefs-server package contains server + components. +endef + +define Package/remotefs-server + $(call Package/remotefs) + TITLE:=RemoteFS server +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + INSTALL_DIR="$(PKG_INSTALL_DIR)" \ + HOST_CPU="$(ARCH)" \ + CFLAGS_RELEASE="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \ + LDFLAGS_RELEASE="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \ + server client install_client install_server +endef + +define Package/remotefs/install + $(INSTALL_DIR) $(1)/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/rfs $(1)/bin/rfs + $(INSTALL_DIR) $(1)/lib + $(CP) $(PKG_INSTALL_DIR)/lib/librfs.so.* $(1)/lib +endef + +define Package/remotefs-server/install + $(INSTALL_DIR) $(1)/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/rfsd $(1)/bin/rfsd + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/rfspasswd $(1)/bin/rfspasswd + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/build/etc/rfs-exports $(1)/etc/rfs-exports + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/rfsd $(1)/etc/init.d/rfsd +endef + +define Package/remotefs-server/conffiles +/etc/rfs-exports +endef + +$(eval $(call BuildPackage,remotefs)) +$(eval $(call BuildPackage,remotefs-server)) diff --git a/net/remotefs/files/rfsd b/net/remotefs/files/rfsd new file mode 100755 index 0000000..67ffef1 --- /dev/null +++ b/net/remotefs/files/rfsd @@ -0,0 +1,25 @@ +#!/bin/sh /etc/rc.common + +START=50 + +LISTEN=$(ifconfig br-lan | sed -n 's/.*dr:\(.*\)Bc.*/\1/p') +PORT="5001" +RFSD_USER="root" +RFSD_GROUP="root" +PIDFILE="/var/run/rfsd.pid" + +start() +{ + rfsd -a ${LISTEN} -p ${PORT} -u ${RFSD_USER} -g ${RFSD_GROUP} -r ${PIDFILE} +} + +stop() +{ + killall rfsd +} + +reload() +{ + kill -s HUP `cat ${PIDFILE}` + start +} diff --git a/net/restund/Makefile b/net/restund/Makefile new file mode 100644 index 0000000..32dd04e --- /dev/null +++ b/net/restund/Makefile @@ -0,0 +1,117 @@ +# +# Copyright (C) 2010-2011 OpenWrt.org +# Copyright (C) 2010 Alfred E. Heggestad +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=restund +PKG_VERSION:=0.4.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.creytiv.com/pub/ +PKG_MD5SUM:=e11da0acd10af42ce6101f3106cd34dc + +restund-mods:= \ + mysql \ + +PKG_CONFIG_DEPENDS:= \ + $(patsubst %,CONFIG_PACKAGE_restund-mod-%,$(restund-mods)) \ + +include $(INCLUDE_DIR)/package.mk + +define Package/restund/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + URL:=http://www.creytiv.com/ +endef + +define Package/restund +$(call Package/restund/Default) + TITLE:=Modular STUN/TURN server + DEPENDS:=+libre +libpthread +endef + + +restund-mod-mysql := USE_MYSQL + +RESTUND_MOD_OPTIONS:= \ + $(foreach m,$(restund-mods),$(restund-mod-$(m))=$(if $(CONFIG_PACKAGE_restund-mod-$(m)),1)) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + LIBRE_MK="$(STAGING_DIR)/usr/share/re/re.mk" \ + LIBRE_INC="$(STAGING_DIR)/usr/include/re" \ + LIBRE_SO="$(STAGING_DIR)/usr/lib" \ + CC="$(TARGET_CC)" \ + EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + SYSROOT="$$$$($(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s#/include/pthread.h##p')" \ + SYSROOT_ALT="$(STAGING_DIR)/usr" \ + RELEASE=1 \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + OS="linux" \ + $(RESTUND_MOD_OPTIONS) \ + all install +endef + +define Package/restund/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/restund $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/restund/modules + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/restund/modules/auth.so \ + $(PKG_INSTALL_DIR)/usr/lib/restund/modules/binding.so \ + $(PKG_INSTALL_DIR)/usr/lib/restund/modules/stat.so \ + $(PKG_INSTALL_DIR)/usr/lib/restund/modules/status.so \ + $(PKG_INSTALL_DIR)/usr/lib/restund/modules/syslog.so \ + $(PKG_INSTALL_DIR)/usr/lib/restund/modules/turn.so \ + $(1)/usr/lib/restund/modules/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/etc/restund.conf $(1)/etc/ + $(SED) \ + 's|^\(module_path\)\([ \t]\+\).*$$$$|\1\2/usr/lib/restund/modules|g' \ + $(1)/etc/restund.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/restund.init $(1)/etc/init.d/restund +endef + +define Package/restund/conffiles +/etc/restund.conf +endef + +# +# 1. Name +# 2. Title +# 3. Files +# 4. Depends +# +define BuildPlugin + + define Package/restund-mod-$(1) + $$(call Package/restund/Default) + TITLE:= restund $(2) module + DEPENDS:= restund $(4) + endef + + define Package/restund-mod-$(1)/install + [ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/usr/lib/restund/modules + for f in $(3); do \ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/restund/modules/$$$$$$$${f}.so \ + $$(1)/usr/lib/restund/modules/ ; \ + done + endef + + $$(eval $$(call BuildPackage,restund-mod-$(1))) +endef + + +$(eval $(call BuildPackage,restund)) + +$(eval $(call BuildPlugin,mysql,MySQL database backend,mysql_ser,+PACKAGE_restund-mod-mysql:libmysqlclient)) diff --git a/net/restund/files/restund.init b/net/restund/files/restund.init new file mode 100644 index 0000000..d6360ff --- /dev/null +++ b/net/restund/files/restund.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# +# Copyright (C) 2010-2011 OpenWrt.org +# Copyright (C) 2010 Alfred E. Heggestad +# + +START=60 + +start() { + service_start /usr/sbin/restund +} + +stop() { + service_stop /usr/sbin/restund +} diff --git a/net/rinetd/Makefile b/net/rinetd/Makefile new file mode 100755 index 0000000..9fbb000 --- /dev/null +++ b/net/rinetd/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2009-2011 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:=rinetd +PKG_VERSION:=0.62 +PKG_RELEASE:=2 + +PKG_SOURCE:=rinetd.tar.gz +PKG_SOURCE_URL:=http://www.boutell.com/rinetd/http +PKG_MD5SUM:=28c78bac648971724c46f1a921154c4f +PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE) + +include $(INCLUDE_DIR)/package.mk + +define Package/rinetd + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE:=rinetd - Internet Redirection Server + URL:=http://www.boutell.com/rinetd/ +endef + +define Package/rinetd/conffiles +/etc/config/rinetd +endef + +define Package/rinetd/description + Rinetd redirects TCP connections from one IP address and port to another. + Rinetd is a single-process server which handles any number of connections + to the address/port pairs specified in the configuration. + Since rinetd runs as a single process using nonblocking I/O, it is able to + redirect a large number of connections without a severe impact on the + machine. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + rinetd +endef + +define Package/rinetd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/rinetd $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/rinetd.config $(1)/etc/config/rinetd + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/rinetd.init $(1)/etc/init.d/rinetd + +endef + +$(eval $(call BuildPackage,rinetd)) diff --git a/net/rinetd/files/rinetd.config b/net/rinetd/files/rinetd.config new file mode 100644 index 0000000..eb543af --- /dev/null +++ b/net/rinetd/files/rinetd.config @@ -0,0 +1,33 @@ +# This section defines common settings for the rinetd process. +config common + # Remove the comment from the line below to enable logging. + #option logfile /var/log/rinetd.log + + # Enable the option below to use a web server style + # common log format. + #option logcommon 1 + + # Define allow and deny rules below, you may use "?" and "*" + # as wildcards, "?" matches exactly one and "*" matches zero + # or more characters. + # + #list deny "88.*.*.*" + #list deny "89.123.12?.*" + # + #list allow "192.168.*.*" + #list allow "172.16.*.*" + #list allow "10.*.*.*" + +# Forwarding sections define forwarding rules for rinetd, +# there may be multiple sections of this type to define +# any number of forwardings. +config forwarding + # IP and port rinetd should listen to for connections. + # Use the address "0.0.0.0" to listen on any interface. + option bindaddress "0.0.0.0" + option bindport "123" + + # IP and port to forward accepted connections to. + option connectaddress "10.0.0.1" + option connectport "123" + diff --git a/net/rinetd/files/rinetd.init b/net/rinetd/files/rinetd.init new file mode 100755 index 0000000..9e1c0b9 --- /dev/null +++ b/net/rinetd/files/rinetd.init @@ -0,0 +1,64 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2011 OpenWrt.org + +START=80 + +CFG=/var/etc/rinetd.conf + +common_add() { + local cfg="$1" + local logfile logcommon allow deny match + + config_get logfile "$cfg" logfile + config_get_bool logcommon "$cfg" logcommon 0 + + [ -n "$logfile" ] && { + echo "logfile $logfile" >> $CFG + [ "$logcommon" -gt 0 ] && echo "logcommon" >> $CFG + } + + config_get allow "$cfg" allow + config_get deny "$cfg" deny + + for match in $allow; do + echo "allow $match" >> $CFG + done + + for match in $deny; do + echo "deny $match" >> $CFG + done +} + +forward_add() { + local cfg="$1" + local bindaddr bindport connaddr connport + + config_get bindaddr "$cfg" bindaddress + config_get bindport "$cfg" bindport + config_get connaddr "$cfg" connectaddress + config_get connport "$cfg" connectport + + [ -n "$bindaddr" ] && [ -n "$connaddr" ] && \ + [ -n "$bindport" ] && [ -n "$connport" ] && \ + echo "$bindaddr $bindport $connaddr $connport" >> $CFG +} + +start() { + mkdir -m 0755 -p /var/etc + mkdir -m 0755 -p /var/run + + echo "# This file is autogenerated, check /etc/config/rinetd" > $CFG + config_load 'rinetd' + config_foreach common_add 'common' + config_foreach forward_add 'forwarding' + + service_start /usr/sbin/rinetd -c $CFG +} + +stop() { + service_stop /usr/sbin/rinetd +} + +reload() { + service_reload /usr/sbin/rinetd +} diff --git a/net/rinetd/patches/001-crosscompile.patch b/net/rinetd/patches/001-crosscompile.patch new file mode 100644 index 0000000..0024306 --- /dev/null +++ b/net/rinetd/patches/001-crosscompile.patch @@ -0,0 +1,12 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,8 @@ ++CC=gcc + CFLAGS=-DLINUX -g + + rinetd: rinetd.o match.o +- gcc rinetd.o match.o -o rinetd ++ $(CC) rinetd.o match.o -o rinetd + + install: rinetd + install -m 700 rinetd /usr/sbin diff --git a/net/rp-l2tp/Makefile b/net/rp-l2tp/Makefile new file mode 100644 index 0000000..d7942fa --- /dev/null +++ b/net/rp-l2tp/Makefile @@ -0,0 +1,68 @@ +# +# Copyright (C) 2006-2011 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:=rp-l2tp +PKG_VERSION:=0.4 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/rp-l2tp +PKG_MD5SUM:=0e45d11cb4fa6c56cce6b1d119733ed9 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/rp-l2tpd + SECTION:=net + CATEGORY:=Network + TITLE:=Roaring Penguin L2TP + URL:=http://sourceforge.net/projects/rp-l2tp/ + TITLE+= daemon + SUBMENU:=dial-in/up +endef + +define Package/rp-l2tpd/description + Roaring Penguin L2TP (Layer 2 Tunneling Protocol) implementation. +endef + +TARGET_CFLAGS := -I$(PKG_BUILD_DIR)/libevent $(TARGET_CFLAGS) + +define Package/rp-l2tpd/install + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/l2tp.conf.example $(1)/etc/l2tp.conf + $(INSTALL_DIR) $(1)/usr/lib/l2tp + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/l2tpd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/rp-l2tpd.init $(1)/etc/init.d/rp-l2tpd + $(CP) $(PKG_INSTALL_DIR)/usr/lib/l2tp/cmd.so $(1)/usr/lib/l2tp/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/l2tp/sync-pppd.so $(1)/usr/lib/l2tp/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/l2tp-control $(1)/usr/sbin/ +endef + +define Package/rp-l2tpd/conffiles +/etc/l2tp.conf +endef + +#define Package/rp-l2tpd-mod-cmd/install +# $(INSTALL_DIR) $(1)/usr/lib/l2tp +# $(CP) $(PKG_INSTALL_DIR)/usr/lib/l2tp/cmd.so $(1)/usr/lib/l2tp/ +# $(INSTALL_DIR) $(1)/usr/sbin +# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/l2tp-control $(1)/usr/sbin/ +#endef + +#define Package/rp-l2tpd-mod-ppp/install +# $(INSTALL_DIR) $(1)/usr/lib/l2tp +# $(CP) $(PKG_INSTALL_DIR)/usr/lib/l2tp/sync-pppd.so $(1)/usr/lib/l2tp/ +#endef + +$(eval $(call BuildPackage,rp-l2tpd)) +#$(eval $(call BuildPackage,rp-l2tpd-mod-cmd)) +#$(eval $(call BuildPackage,rp-l2tpd-mod-ppp)) diff --git a/net/rp-l2tp/files/rp-l2tpd.init b/net/rp-l2tp/files/rp-l2tpd.init new file mode 100644 index 0000000..cff1f15 --- /dev/null +++ b/net/rp-l2tp/files/rp-l2tpd.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=60 + +start() { + service_start /usr/sbin/l2tpd +} + +stop() { + service_stop /usr/sbin/l2tpd +} + diff --git a/net/rp-l2tp/patches/001-cross.patch b/net/rp-l2tp/patches/001-cross.patch new file mode 100644 index 0000000..654402e --- /dev/null +++ b/net/rp-l2tp/patches/001-cross.patch @@ -0,0 +1,235 @@ +diff -ruN rp-l2tp-0.4-orig/Makefile.in rp-l2tp-0.4-4/Makefile.in +--- rp-l2tp-0.4-orig/Makefile.in 2004-07-01 17:17:11.000000000 +0200 ++++ rp-l2tp-0.4-4/Makefile.in 2005-03-09 16:26:49.000000000 +0100 +@@ -27,10 +27,10 @@ + sbindir=@sbindir@ + + OBJS=auth.o debug.o dgram.o main.o md5.o network.o options.o peer.o session.o tunnel.o utils.o +-EXTRA_LIBS=@LIBEVENT@/*.o -ldl ++EXTRA_LIBS=@LIBEVENT@/*.o -lc -ldl + + SRCS=$(OBJS:.o=.c) +-CFLAGS=-g -I.. -I@LIBEVENT@ -Wall -Wstrict-prototypes -ansi -pedantic -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" -DPREFIX=\"$(prefix)\" ++CFLAGS=@CFLAGS@ -I@LIBEVENT@ -Wall -Wstrict-prototypes -ansi -pedantic -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" -DPREFIX=\"$(prefix)\" + + TARGETS=l2tpd libl2tp.a handlers + +@@ -38,12 +38,12 @@ + + libl2tp.a: $(OBJS) + rm -f $@ +- ar -rc $@ $^ +- ranlib $@ || true ++ $(AR) -rc $@ $^ ++ @RANLIB@ $@ || true + + l2tpd: libl2tp.a libevent/libevent.a + $(MAKE) -C handlers +- @CC@ -o l2tpd -rdynamic $(OBJS) $(EXTRA_LIBS) ++ @CC@ $(CFLAGS) -o l2tpd -rdynamic $(OBJS) $(EXTRA_LIBS) + + libevent/libevent.a: + test -d libevent || ln -s ../libevent . +@@ -72,18 +72,20 @@ + rm -f *.o *.a *~ + rm -f l2tpd + $(MAKE) -C handlers clean ++ $(MAKE) -C libevent clean + + distclean: clean +- rm -f Makefile config.cache ++ rm -f Makefile config.cache config.log config.status .depend + $(MAKE) -C handlers distclean ++ $(MAKE) -C libevent distclean + + -include .depend + + install: all + -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir) +- $(install) -m 755 -s l2tpd $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir) ++ $(install) -m 755 l2tpd $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir) + -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/l2tp +- $(install) -m 644 l2tp.conf $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/l2tp/l2tp.conf.example ++ $(install) -m 644 l2tp.conf $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/l2tp.conf.example + -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8 + -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man5 + $(install) -m 644 man/l2tpd.8 $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8 +diff -ruN rp-l2tp-0.4-orig/handlers/Makefile.in rp-l2tp-0.4-4/handlers/Makefile.in +--- rp-l2tp-0.4-orig/handlers/Makefile.in 2002-09-30 21:45:00.000000000 +0200 ++++ rp-l2tp-0.4-4/handlers/Makefile.in 2005-03-09 16:26:49.000000000 +0100 +@@ -14,32 +14,34 @@ + + OBJS=pty.o sync-pppd.o dstring.o + SRCS=$(OBJS:.o=.c) +-CFLAGS=-g -O2 -I.. -I../libevent -I../../libevent -Wall ++CFLAGS=@CFLAGS@ -I.. -I../libevent -I../../libevent -Wall + + all: $(HANDLERS) l2tp-control + + l2tp-control: cmd-control.o +- gcc -o l2tp-control cmd-control.o ++ $(CC) $(CFLAGS) -o l2tp-control cmd-control.o + + cmd-control.o: cmd-control.c +- gcc -c -o $@ $^ ++ $(CC) $(CFLAGS) -c -o $@ $^ + + %.o: %.c +- gcc $(CFLAGS) -fPIC -c -o $@ $< ++ $(CC) $(CFLAGS) -fPIC -c -o $@ $< + + sync-pppd.so: pty.o sync-pppd.o +- gcc -shared -o $@ $^ ++ $(CC) $(CFLAGS) -shared -o $@ $^ + + cmd.so: cmd.o dstring.o +- gcc -shared -o $@ $^ ++ $(CC) $(CFLAGS) -shared -o $@ $^ + + clean: + rm -f *.so *.o *~ + rm -f l2tp-control + + install: all +- -mkdir -p $(RPM_INSTALL_ROOT)$(sbindir) +- -mkdir -p $(RPM_INSTALL_ROOT)$(prefix)/lib/l2tp/plugins +- $(install) -m 755 -s l2tp-control $(RPM_INSTALL_ROOT)$(sbindir) +- $(install) -m 755 $(HANDLERS) $(RPM_INSTALL_ROOT)$(prefix)/lib/l2tp/plugins ++ -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir) ++ -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(prefix)/lib/l2tp ++ $(install) -m 755 l2tp-control $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir) ++ $(install) -m 755 $(HANDLERS) $(RPM_INSTALL_ROOT)$(DESTDIR)$(prefix)/lib/l2tp ++ + distclean: clean ++ rm -f Makefile +diff -ruN rp-l2tp-0.4-orig/handlers/cmd-control.c rp-l2tp-0.4-4/handlers/cmd-control.c +--- rp-l2tp-0.4-orig/handlers/cmd-control.c 2002-09-30 21:45:00.000000000 +0200 ++++ rp-l2tp-0.4-4/handlers/cmd-control.c 2005-03-09 16:26:49.000000000 +0100 +@@ -52,7 +52,7 @@ + + memset(&addr, 0, sizeof(addr)); + addr.sun_family = AF_LOCAL; +- strncpy(addr.sun_path, "/var/run/l2tpctrl", sizeof(addr.sun_path) - 1); ++ strncpy(addr.sun_path, "/var/run/l2tp.sock", sizeof(addr.sun_path) - 1); + + fd = socket(AF_LOCAL, SOCK_STREAM, 0); + if (fd < 0) { +diff -ruN rp-l2tp-0.4-orig/handlers/cmd.c rp-l2tp-0.4-4/handlers/cmd.c +--- rp-l2tp-0.4-orig/handlers/cmd.c 2004-07-01 16:58:56.000000000 +0200 ++++ rp-l2tp-0.4-4/handlers/cmd.c 2005-03-09 16:26:49.000000000 +0100 +@@ -162,7 +162,7 @@ + + /* We have hit the end of our options. Open command socket */ + if (!sockname) { +- sockname = "/var/run/l2tpctrl"; ++ sockname = "/var/run/l2tp.sock"; + } + + (void) remove(sockname); +diff -ruN rp-l2tp-0.4-orig/libevent/Makefile.in rp-l2tp-0.4-4/libevent/Makefile.in +--- rp-l2tp-0.4-orig/libevent/Makefile.in 2002-09-30 21:45:00.000000000 +0200 ++++ rp-l2tp-0.4-4/libevent/Makefile.in 2005-03-09 16:26:49.000000000 +0100 +@@ -18,24 +18,27 @@ + + libevent.a: $(OBJS) + rm -f libevent.a +- ar -cq libevent.a $(OBJS) ++ $(AR) r libevent.a $(OBJS) + @RANLIB@ libevent.a + + event.o: event.c $(HDRS) +- gcc $(CFLAGS) -c -o event.o event.c ++ $(CC) $(CFLAGS) -c -o event.o event.c + + hash.o: hash.c $(HDRS) +- gcc $(CFLAGS) -c -o hash.o hash.c ++ $(CC) $(CFLAGS) -c -o hash.o hash.c + + event_sig.o: event_sig.c $(HDRS) +- gcc $(CFLAGS) -c -o event_sig.o event_sig.c ++ $(CC) $(CFLAGS) -c -o event_sig.o event_sig.c + + event_tcp.o: event_tcp.c $(HDRS) +- gcc $(CFLAGS) -c -o event_tcp.o event_tcp.c ++ $(CC) $(CFLAGS) -c -o event_tcp.o event_tcp.c + + clean: FORCE + rm -f *.a *.o *~ + ++distclean: clean ++ rm -f Makefile ++ + FORCE: + +-.phony: FORCE +\ No newline at end of file ++.phony: FORCE +diff -ruN rp-l2tp-0.4-orig/main.c rp-l2tp-0.4-4/main.c +--- rp-l2tp-0.4-orig/main.c 2002-09-30 21:45:00.000000000 +0200 ++++ rp-l2tp-0.4-4/main.c 2005-03-09 16:26:49.000000000 +0100 +@@ -68,7 +68,7 @@ + l2tp_peer_init(); + l2tp_debug_set_bitmask(debugmask); + +- if (l2tp_parse_config_file(es, "/etc/l2tp/l2tp.conf") < 0) { ++ if (l2tp_parse_config_file(es, "/etc/l2tp.conf") < 0) { + l2tp_die(); + } + +diff -ruN rp-l2tp-0.4-orig/man/l2tp.conf.5 rp-l2tp-0.4-4/man/l2tp.conf.5 +--- rp-l2tp-0.4-orig/man/l2tp.conf.5 2004-07-01 16:58:56.000000000 +0200 ++++ rp-l2tp-0.4-4/man/l2tp.conf.5 2005-03-09 16:26:49.000000000 +0100 +@@ -155,7 +155,7 @@ + in the global section. The only option available is: + .IP "\fBsocket-path\fP \fIpathname\fR" + Specifies the path name of the UNIX-domain socket for controlling the +-daemon. Defaults to \fI/var/run/l2tpctrl\fR. ++daemon. Defaults to \fI/var/run/l2tp.sock\fR. + .PP + Even if you do not supply any options to cmd, you \fImust\fR have + a \fBsection cmd\fR line to activate the handler. +diff -ruN rp-l2tp-0.4-orig/man/l2tpd.8 rp-l2tp-0.4-4/man/l2tpd.8 +--- rp-l2tp-0.4-orig/man/l2tpd.8 2002-09-30 21:45:00.000000000 +0200 ++++ rp-l2tp-0.4-4/man/l2tpd.8 2005-03-09 16:26:49.000000000 +0100 +@@ -47,17 +47,17 @@ + fairly lightweight and efficient. + + .SH L2TPD CONFIGURATION +-On startup, \fBl2tpd\fR reads the configuration file \fB/etc/l2tp/l2tp.conf\fR. ++On startup, \fBl2tpd\fR reads the configuration file \fB/etc/l2tp.conf\fR. + This configuration file sets operating parameters, describes peers and loads + and configures handlers. See \fBl2tp.conf\fR(5) for configuration + file details. + + .SH FILES + .TP +-.B /etc/l2tp/l2tp.conf ++.B /etc/l2tp.conf + Main configuration file. + .TP +-.B /var/run/l2tpctrl ++.B /var/run/l2tp.sock + Control socket for \fBcmd.so\fR handler. + + .SH AUTHORS +diff -ruN rp-l2tp-0.4-orig/utils.c rp-l2tp-0.4-4/utils.c +--- rp-l2tp-0.4-orig/utils.c 2002-09-30 21:45:00.000000000 +0200 ++++ rp-l2tp-0.4-4/utils.c 2005-03-09 16:26:49.000000000 +0100 +@@ -182,7 +182,7 @@ + * -1 on error, 0 if OK + * %DESCRIPTION: + * Dynamically-loads a handler and initializes it. If fname is not +-* an absolute path name, we load the handler from /usr/lib/l2tp/plugins ++* an absolute path name, we load the handler from /usr/lib/l2tp + ***********************************************************************/ + int + l2tp_load_handler(EventSelector *es, +@@ -196,7 +196,7 @@ + if (*fname == '/') { + handle = dlopen(fname, RTLD_NOW); + } else { +- snprintf(buf, sizeof(buf), "%s/lib/l2tp/plugins/%s", PREFIX, fname); ++ snprintf(buf, sizeof(buf), "%s/lib/l2tp/%s", PREFIX, fname); + buf[sizeof(buf)-1] = 0; + handle = dlopen(buf, RTLD_NOW); + } diff --git a/net/rp-pppoe/Makefile b/net/rp-pppoe/Makefile new file mode 100644 index 0000000..9f96f90 --- /dev/null +++ b/net/rp-pppoe/Makefile @@ -0,0 +1,135 @@ +# +# Copyright (C) 2006-2011 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:=rp-pppoe +PKG_VERSION:=3.10 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://roaringpenguin.com/files/download +PKG_MD5SUM:=d58a13cc4185bca6121a606ff456dec0 + +PKG_BUILD_DEPENDS:=ppp + +include $(INCLUDE_DIR)/package.mk + +define Package/rp-pppoe/Default + SECTION:=net + CATEGORY:=Network + DEPENDS:=+ppp + TITLE:=PPPoE (PPP over Ethernet) + URL:=http://roaringpenguin.com/products/pppoe + SUBMENU:=dial-in/up +endef + +define Package/rp-pppoe/Default/description + Dubbed RP-PPPoE, this open-source product is ideal for Linux users with + a DSL "modem" whose Internet service provider uses PPPoE. +endef + +define Package/rp-pppoe-client + $(call Package/rp-pppoe/Default) + DEPENDS += @BROKEN + TITLE+= client +endef + +define Package/rp-pppoe-client/description +$(call Package/rp-pppoe/Default/description) + . + This package contains pppoe-connect. +endef + +define Package/rp-pppoe-relay + $(call Package/rp-pppoe/Default) + TITLE+= relay +endef + +define Package/rp-pppoe-relay/description +$(call Package/rp-pppoe/Default/description) + . + This package contains pppoe-relay. +endef + +define Package/rp-pppoe-server + $(call Package/rp-pppoe/Default) + TITLE+= server +endef + +define Package/rp-pppoe-server/conffiles +/etc/ppp/pppoe-server-options +/etc/default/pppoe-server +endef + +define Package/rp-pppoe-server/description +$(call Package/rp-pppoe/Default/description) + . + This package contains pppoe-server. +endef + +define Package/rp-pppoe-sniff + $(call Package/rp-pppoe/Default) + TITLE+= sniffer +endef + +define Package/rp-pppoe-sniff/description +$(call Package/rp-pppoe/Default/description) + . + This package contains pppoe-sniff. +endef + +TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/src/libevent +CONFIGURE_PATH := ./src +CONFIGURE_ARGS += ac_cv_path_PPPD=/usr/sbin/pppd --enable-plugin=$(STAGING_DIR)/usr/include/ +MAKE_FLAGS := DESTDIR="$(PKG_INSTALL_DIR)" install +MAKE_PATH := ./src + +define Package/rp-pppoe-client/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/pppoe-client.init $(1)/etc/init.d/pppoe-client + $(INSTALL_DIR) $(1)/etc/ppp + $(CP) $(PKG_INSTALL_DIR)/etc/ppp/pppoe.conf $(1)/etc/ppp/ + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/pppoe-connect $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/pppoe-start $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/pppoe-stop $(1)/usr/sbin/ + $(SED) 's,modprobe,insmod,g' $(1)/usr/sbin/pppoe-connect +endef + +define Package/rp-pppoe-relay/install + $(INSTALL_DIR) $(1)/etc/default + $(INSTALL_BIN) ./files/pppoe-relay.default $(1)/etc/default/pppoe-relay + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/pppoe-relay.init $(1)/etc/init.d/pppoe-relay + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-relay $(1)/usr/sbin/ +endef + +define Package/rp-pppoe-server/install + $(INSTALL_DIR) $(1)/etc/default + $(INSTALL_BIN) ./files/pppoe-server.default $(1)/etc/default/pppoe-server + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/pppoe-server.init $(1)/etc/init.d/pppoe-server + $(INSTALL_DIR) $(1)/etc/ppp + $(INSTALL_DIR) $(1)/etc/ppp/plugins + $(CP) $(PKG_INSTALL_DIR)/etc/ppp/pppoe-server-options $(1)/etc/ppp/ + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-server $(1)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/etc/ppp/plugins/rp-pppoe.so $(1)/etc/ppp/plugins/ +endef + +define Package/rp-pppoe-sniff/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-sniff $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,rp-pppoe-client)) +$(eval $(call BuildPackage,rp-pppoe-relay)) +$(eval $(call BuildPackage,rp-pppoe-server)) +$(eval $(call BuildPackage,rp-pppoe-sniff)) diff --git a/net/rp-pppoe/files/pppoe-client.init b/net/rp-pppoe/files/pppoe-client.init new file mode 100644 index 0000000..93654dd --- /dev/null +++ b/net/rp-pppoe/files/pppoe-client.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 + +start() { + pppoe-start +} + +stop() { + pppoe-stop +} + diff --git a/net/rp-pppoe/files/pppoe-relay.default b/net/rp-pppoe/files/pppoe-relay.default new file mode 100644 index 0000000..47a3892 --- /dev/null +++ b/net/rp-pppoe/files/pppoe-relay.default @@ -0,0 +1 @@ +OPTIONS="-C eth2 -S vlan1" diff --git a/net/rp-pppoe/files/pppoe-relay.init b/net/rp-pppoe/files/pppoe-relay.init new file mode 100644 index 0000000..965aa74 --- /dev/null +++ b/net/rp-pppoe/files/pppoe-relay.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +DEFAULT=/etc/default/pppoe-relay + +start() { + [ -f $DEFAULT ] && . $DEFAULT + service_start /usr/sbin/pppoe-relay $OPTIONS +} + +stop() { + service_stop /usr/sbin/pppoe-relay +} diff --git a/net/rp-pppoe/files/pppoe-server.default b/net/rp-pppoe/files/pppoe-server.default new file mode 100644 index 0000000..72a8c01 --- /dev/null +++ b/net/rp-pppoe/files/pppoe-server.default @@ -0,0 +1 @@ +OPTIONS="-C MyRouter -I eth2" diff --git a/net/rp-pppoe/files/pppoe-server.init b/net/rp-pppoe/files/pppoe-server.init new file mode 100644 index 0000000..16be3bf --- /dev/null +++ b/net/rp-pppoe/files/pppoe-server.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +DEFAULT=/etc/default/pppoe-server + +start() { + [ -f $DEFAULT ] && . $DEFAULT + service_start /usr/sbin/pppoe-server $OPTIONS +} + +stop() { + service_stop /usr/sbin/pppoe-server +} diff --git a/net/rp-pppoe/patches/100-configure.patch b/net/rp-pppoe/patches/100-configure.patch new file mode 100644 index 0000000..d8af0c3 --- /dev/null +++ b/net/rp-pppoe/patches/100-configure.patch @@ -0,0 +1,11 @@ +--- a/src/configure ++++ b/src/configure +@@ -6303,7 +6303,7 @@ + { echo "$as_me:$LINENO: checking packing order of bit fields" >&5 + echo $ECHO_N "checking packing order of bit fields... $ECHO_C" >&6; } + if test "$cross_compiling" = yes; then +- $ECHO "no defaults for cross-compiling"; exit 0 ++ rpppoe_cv_pack_bitfields="$ac_cv_pack_bitfields" + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ diff --git a/net/rrs/Makefile b/net/rrs/Makefile new file mode 100644 index 0000000..e7d032c --- /dev/null +++ b/net/rrs/Makefile @@ -0,0 +1,89 @@ +# +# 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:=rrs +PKG_VERSION:=1.70 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.cycom.se/uploads/36/19 +PKG_MD5SUM:=b400d03c0e39e3e78a7327ba78f789f0 + +include $(INCLUDE_DIR)/package.mk + +define Package/rrs/Default + SECTION:=net + CATEGORY:=Network + DEPENDS:=+uclibcxx + TITLE:=A reverse (connecting) remote shell + URL:=http://www.cycom.se/dl/rrs/ +endef + +define Package/rrs +$(call Package/rrs/Default) + SECTION:=net + CATEGORY:=Network + DEPENDS+= +libopenssl + TITLE+= (with SSL support) + URL:=http://www.cycom.se/dl/rrs/ +endef + +define Package/rrs-nossl +$(call Package/rrs/Default) + SECTION:=net + CATEGORY:=Network + TITLE+= (without SSL support) +endef + + +define Build/Template + +$(STAMP_BUILT)-$(2): $(STAMP_PREPARED) + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/uClibc++ -fno-builtin -fno-rtti -nostdinc++" \ + LDFLAGS="$(TARGET_LDFLAGS) -nodefaultlibs -lc $(4) -luClibc++ -lm -lutil $(LIBGCC_S)" \ + LDFLAGSNOSSL="$(TARGET_LDFLAGS) -nodefaultlibs -lc $(4) -luClibc++ -lm -lutil $(LIBGCC_S)" \ + $(3) + ( cd $(PKG_BUILD_DIR); mv -f rrs rrs-$(2); ) + touch $$@ + +$(STAMP_BUILT): $(STAMP_BUILT)-$(2) + +define Package/$(1)/install + $(INSTALL_DIR) $$(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/rrs-$(2) $$(1)/usr/bin/rrs +endef + +endef + + +define Build/Configure +endef + +define Build/Compile +endef + +ifneq ($(SDK)$(CONFIG_PACKAGE_rrs),) + define Build/with-ssl + $(call Build/Template,rrs,with-ssl,generic,-lcrypto -lssl) + endef +endif +$(eval $(Build/with-ssl)) + +ifneq ($(SDK)$(CONFIG_PACKAGE_rrs-nossl),) + define Build/without-ssl + $(call Build/Template,rrs-nossl,without-ssl,generic-nossl,) + endef +endif +$(eval $(Build/without-ssl)) + + +$(eval $(call BuildPackage,rrs)) +$(eval $(call BuildPackage,rrs-nossl)) diff --git a/net/rrs/patches/001-shell.patch b/net/rrs/patches/001-shell.patch new file mode 100644 index 0000000..13520fc --- /dev/null +++ b/net/rrs/patches/001-shell.patch @@ -0,0 +1,13 @@ +Index: rrs-1.70/rrs.c +=================================================================== +--- rrs-1.70.orig/rrs.c 2007-07-30 14:30:24.000000000 +0200 ++++ rrs-1.70/rrs.c 2007-07-30 14:30:24.000000000 +0200 +@@ -920,7 +920,7 @@ + close(slave_fd); + signal(SIGHUP, SIG_DFL); + signal(SIGCHLD, SIG_DFL); +- execl("/bin/sh", "", NULL); ++ execl("/bin/sh", "/bin/sh", NULL); + /* should not return */ + exit(1); + } else if (pid > 0) { diff --git a/net/rrs/patches/002-no_sslv2.patch b/net/rrs/patches/002-no_sslv2.patch new file mode 100644 index 0000000..1f7c35d --- /dev/null +++ b/net/rrs/patches/002-no_sslv2.patch @@ -0,0 +1,46 @@ +Index: rrs-1.70/rrs.c +=================================================================== +--- rrs-1.70.orig/rrs.c 2007-07-30 14:30:24.000000000 +0200 ++++ rrs-1.70/rrs.c 2007-07-30 14:30:25.000000000 +0200 +@@ -1826,9 +1826,12 @@ + } + rrs_ssl = TLSv1; + if (optarg) { ++#ifndef OPENSSL_NO_SSL2 + if (!strcasecmp(optarg, "SSLv2")) { + rrs_ssl = SSLv2; +- } else if (!strcasecmp(optarg, "SSLv3")) { ++ } else ++#endif ++ if (!strcasecmp(optarg, "SSLv3")) { + rrs_ssl = SSLv3; + } else if (!strcasecmp(optarg, "TLSv1")) { + rrs_ssl = TLSv1; +@@ -1981,9 +1984,12 @@ + SSL_load_error_strings(); + + if (rrs_listen) { ++#ifndef OPENSSL_NO_SSL2 + if (rrs_ssl == SSLv2) { + sslmethod = SSLv2_server_method(); +- } else if (rrs_ssl == SSLv3) { ++ } else ++#endif ++ if (rrs_ssl == SSLv3) { + sslmethod = SSLv3_server_method(); + } else if (rrs_ssl == TLSv1) { + sslmethod = TLSv1_server_method(); +@@ -1992,9 +1998,12 @@ + return err_generic; + } + } else { ++#ifndef OPENSSL_NO_SSL2 + if (rrs_ssl == SSLv2) { + sslmethod = SSLv2_client_method(); +- } else if (rrs_ssl == SSLv3) { ++ } else ++#endif ++ if (rrs_ssl == SSLv3) { + sslmethod = SSLv3_client_method(); + } else if (rrs_ssl == TLSv1) { + sslmethod = TLSv1_client_method(); diff --git a/net/rrs/patches/003-honour_copts.patch b/net/rrs/patches/003-honour_copts.patch new file mode 100644 index 0000000..b089329 --- /dev/null +++ b/net/rrs/patches/003-honour_copts.patch @@ -0,0 +1,12 @@ +diff -ruN rrs-1.70-old/Makefile rrs-1.70-new/Makefile +--- rrs-1.70-old/Makefile 2004-05-30 02:14:14.000000000 +0200 ++++ rrs-1.70-new/Makefile 2007-09-01 16:26:09.000000000 +0200 +@@ -50,7 +50,7 @@ + $(CC) $(CFLAGS) $(LDFLAGS) $(LDEXTRA) -o $(out) rrs.c md5.c sha1.c farm9crypt.cc twofish2.cc + + compile-generic-nossl: +- $(CC) -DWITHOUT_SSL $(CFLAGS) $$CFLAGS $(LDFLAGSNOSSL) $(LDEXTRA) -o $(out) rrs.c md5.c sha1.c farm9crypt.cc twofish2.cc ++ $(CC) -DWITHOUT_SSL $(CFLAGS) $(LDFLAGSNOSSL) $(LDEXTRA) -o $(out) rrs.c md5.c sha1.c farm9crypt.cc twofish2.cc + + ## qnx + compile-qnx: diff --git a/net/rssh/Makefile b/net/rssh/Makefile new file mode 100644 index 0000000..8e7e9f1 --- /dev/null +++ b/net/rssh/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=rssh +PKG_VERSION:=2.3.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/rssh +PKG_MD5SUM:=b0c147602fcc95737ed50573b92fc468 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/rssh + SECTION:=net + CATEGORY:=Network + SUBMENU:=SSH + TITLE:=restricted shell for use with OpenSSH + URL:=http://www.pizzashack.org/rssh/index.shtml +endef + +define Package/rssh/description + rssh is a restricted shell for use with OpenSSH, allowing only scp and/or sftp. + It now also includes support for rdist, rsync, and cvs. For example, if you have + a server which you only want to allow users to copy files off of via scp, without + providing shell access, you can use rssh to do that. +endef + +define Package/rssh/conffiles +/etc/rssh.conf +endef + +CONFIGURE_ARGS += \ + --with-sftp-server="/usr/libexec/sftp-server" \ + +CONFIGURE_VARS += \ + ac_cv_func_malloc_0_nonnull=yes \ + +define Package/rssh/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/$(PKG_NAME).conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/rssh_chroot_helper $(1)/usr/lib/ +endef + +define Package/rssh/postinst +#!/bin/sh +grep rssh $${IPKG_INSTROOT}/etc/shells || \ + echo "/usr/bin/rssh" >> $${IPKG_INSTROOT}/etc/shells +endef + +$(eval $(call BuildPackage,rssh)) diff --git a/net/rssh/patches/001-destdir.patch b/net/rssh/patches/001-destdir.patch new file mode 100644 index 0000000..96184a0 --- /dev/null +++ b/net/rssh/patches/001-destdir.patch @@ -0,0 +1,22 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -16,7 +16,7 @@ base=`echo @PACKAGE_STRING@|tr " " "-"` + $(CC) -c $(DEFS) $(ourdefs) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< + + install-exec-hook: +- chmod u+s $(libexecdir)/rssh_chroot_helper ++ chmod u+s $(DESTDIR)$(libexecdir)/rssh_chroot_helper + + rpm: dist + rpmbuild -ta --sign $(base).tar.gz +--- a/Makefile.in ++++ b/Makefile.in +@@ -830,7 +830,7 @@ uninstall-man: uninstall-man1 uninstall- + $(CC) -c $(DEFS) $(ourdefs) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< + + install-exec-hook: +- chmod u+s $(libexecdir)/rssh_chroot_helper ++ chmod u+s $(DESTDIR)$(libexecdir)/rssh_chroot_helper + + rpm: dist + rpmbuild -ta --sign $(base).tar.gz diff --git a/net/rsync/Makefile b/net/rsync/Makefile new file mode 100644 index 0000000..650b661 --- /dev/null +++ b/net/rsync/Makefile @@ -0,0 +1,82 @@ +# +# Copyright (C) 2007-2011 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:=rsync +PKG_VERSION:=3.0.9 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://rsync.samba.org/ftp/rsync/src +PKG_MD5SUM:=5ee72266fe2c1822333c407e1761b92b + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/rsync + SECTION:=net + CATEGORY:=Network + SUBMENU:=File Transfer + TITLE:=Fast remote file copy program (like rcp) + DEPENDS:=+libpopt + URL:=http://rsync.samba.org/ +endef + +define Package/rsyncd + SECTION:=net + CATEGORY:=Network + SUBMENU:=File Transfer + TITLE:=Rsync daemon + DEPENDS:=+rsync +endef + +define Package/rsync/description + rsync is a program that allows files to be copied to + and from remote machines in much the same way as rcp. + It has many more options than rcp, and uses the rsync + remote-update protocol to greatly speed up file + transfers when the destination file already exists. + + The rsync remote-update protocol allows rsync to + transfer just the differences between two sets of files + across the network link. +endef + +CONFIGURE_ARGS += \ + --with-included-popt=no \ + --disable-debug \ + --disable-locale \ + --disable-xattr-support \ + --disable-acl-support \ + +define Package/rsync/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/ +endef + +define Package/rsyncd/description + rsyncd is a configuration file and initscript to + utilize rsync as a daemon. It uses the same binary + as rsync. +endef + +define Package/rsyncd/conffiles +/etc/rsyncd.conf +endef + +define Package/rsyncd/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/rsyncd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/rsyncd.init $(1)/etc/init.d/rsyncd +endef + +$(eval $(call BuildPackage,rsync)) +$(eval $(call BuildPackage,rsyncd)) diff --git a/net/rsync/files/rsyncd.conf b/net/rsync/files/rsyncd.conf new file mode 100644 index 0000000..896f368 --- /dev/null +++ b/net/rsync/files/rsyncd.conf @@ -0,0 +1,15 @@ +# /etc/rsyncd.conf +# Minimal configuration for rsync daemon + +# Next line required for init script +pid file = /var/run/rsyncd.pid +use chroot = yes +uid = nobody +gid = nogroup +read only = yes + +# Simple example to configure server +#[openwrt-etc] +#path = /etc +#comment = OpenWrt Configuration Files +#exclude = /init.d diff --git a/net/rsync/files/rsyncd.init b/net/rsync/files/rsyncd.init new file mode 100644 index 0000000..fdbc016 --- /dev/null +++ b/net/rsync/files/rsyncd.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2011 OpenWrt.org + +START=50 + +SERVICE_PID_FILE=/var/run/rsyncd.pid + +start() { + service_start /usr/bin/rsync --daemon +} + +stop() { + service_stop /usr/bin/rsync +} diff --git a/net/rtorrent/Makefile b/net/rtorrent/Makefile new file mode 100644 index 0000000..7dad009 --- /dev/null +++ b/net/rtorrent/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2007-2011 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:=rtorrent +PKG_VERSION:=0.8.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://libtorrent.rakshasa.no/downloads +PKG_MD5SUM:=b804c45c01c40312926bcea6b55bb084 + +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/rtorrent + SUBMENU:=BitTorrent + SECTION:=net + CATEGORY:=Network + TITLE:=BitTorrent client for ncurses + URL:=http://libtorrent.rakshasa.no/ + DEPENDS:=+libcurl +libtorrent +libncursesw +libsigcxx +xmlrpc-c-server +libpthread + MAINTAINER:=Luka Perkov +endef + +define Package/rtorrent/description + rTorrent is a BitTorrent client for ncurses, using the libtorrent library. + The client and library is written in C++ with emphasis on speed and + efficiency, while delivering equivalent features to those found in GUI based + clients in an ncurses client. +endef + +TARGET_CPPFLAGS += -fno-strict-aliasing -fno-inline +TARGET_LDFLAGS += -lpthread -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +CONFIGURE_ARGS+= \ + --enable-shared \ + --disable-static \ + --disable-debug \ + --with-xmlrpc-c + +define Build/Configure + ( cd $(PKG_BUILD_DIR); ./autogen.sh ); + $(call Build/Configure/Default) +endef + +define Package/rtorrent/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rtorrent $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,rtorrent)) diff --git a/net/rtorrent/patches/100-fix-cross_compile.patch b/net/rtorrent/patches/100-fix-cross_compile.patch new file mode 100644 index 0000000..b52a952 --- /dev/null +++ b/net/rtorrent/patches/100-fix-cross_compile.patch @@ -0,0 +1,22 @@ +Index: rtorrent-0.8.6/scripts/common.m4 +=================================================================== +--- rtorrent-0.8.6.orig/scripts/common.m4 ++++ rtorrent-0.8.6/scripts/common.m4 +@@ -184,7 +184,7 @@ AC_DEFUN([TORRENT_CHECK_MADVISE], [ + AC_DEFUN([TORRENT_CHECK_EXECINFO], [ + AC_MSG_CHECKING(for execinfo.h) + +- AC_RUN_IFELSE( ++ AC_LINK_IFELSE( + [[#include + int main() { backtrace((void**)0, 0); backtrace_symbols((char**)0, 0); return 0;} + ]], +@@ -199,7 +199,7 @@ AC_DEFUN([TORRENT_CHECK_EXECINFO], [ + AC_DEFUN([TORRENT_CHECK_ALIGNED], [ + AC_MSG_CHECKING(the byte alignment) + +- AC_RUN_IFELSE( ++ AC_LINK_IFELSE( + [[#include + int main() { + char buf[8] = { 0, 0, 0, 0, 1, 0, 0, 0 }; diff --git a/net/rtorrent/patches/120-fix-ncurses.patch b/net/rtorrent/patches/120-fix-ncurses.patch new file mode 100644 index 0000000..e460927 --- /dev/null +++ b/net/rtorrent/patches/120-fix-ncurses.patch @@ -0,0 +1,13 @@ +Index: rtorrent-0.8.6/src/display/canvas.h +=================================================================== +--- rtorrent-0.8.6.orig/src/display/canvas.h ++++ rtorrent-0.8.6/src/display/canvas.h +@@ -48,7 +48,7 @@ class Canvas { + public: + typedef std::vector attributes_list; + +- Canvas(int x = 0, int y = 0, int width = 0, int height = 0) : ++ Canvas(int x = 0, int y = 0, int width = 1, int height = 1) : + m_window(newwin(height, width, y, x)) {} + ~Canvas() { delwin(m_window); } + diff --git a/net/rtpproxy/Makefile b/net/rtpproxy/Makefile new file mode 100644 index 0000000..b841a8f --- /dev/null +++ b/net/rtpproxy/Makefile @@ -0,0 +1,38 @@ +# +# Copyright (C) 2009 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:=rtpproxy +PKG_VERSION:=1.2.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://b2bua.org/chrome/site/ +PKG_MD5SUM:=b0b5d6cdce3f17cdbbac473c11a2d0e5 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/rtpproxy + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + DEPENDS:=+libpthread + TITLE:=RTP (Realtime Transport Protocol) proxy + URL:=http://www.rtpproxy.org/ +endef + +# uses GNU configure + +define Package/rtpproxy/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rtpproxy $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,rtpproxy)) diff --git a/net/samba36/Makefile b/net/samba36/Makefile new file mode 100644 index 0000000..2a6b6b6 --- /dev/null +++ b/net/samba36/Makefile @@ -0,0 +1,140 @@ +# +# Copyright (C) 2007-2012 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:=samba +PKG_VERSION:=3.6.5 +PKG_RELEASE:=2 + +PKG_SOURCE_URL:=http://ftp.samba.org/pub/samba \ + http://ftp.samba.org/pub/samba/old-versions +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=2f0c14547333c1b48fd4728b031e7040 + +include $(INCLUDE_DIR)/package.mk + +MAKE_PATH:=source3 +CONFIGURE_PATH:=source3 + +PKG_BUILD_BIN:=$(PKG_BUILD_DIR)/$(MAKE_PATH)/bin + +define Package/samba36-server + SECTION:=net + CATEGORY:=Network + TITLE:=Samba 3.6 SMB/CIFS server + URL:=http://www.samba.org/ + DEPENDS:=+USE_EGLIBC:librt +endef + +define Package/samba36-client + SECTION:=net + CATEGORY:=Network + TITLE:=Samba 3.6 SMB/CIFS client + URL:=http://www.samba.org/ + DEPENDS:=+libreadline +libncurses +endef + +define Package/samba36-server/config + config PACKAGE_SAMBA_MAX_DEBUG_LEVEL + int "Maximum level of compiled-in debug messages" + depends PACKAGE_samba36-server || PACKAGE_samba36-client + default -1 + +endef + +define Package/samba36-server/description + The Samba software suite is a collection of programs that implements the + SMB protocol for UNIX systems, allowing you to serve files and printers to + Windows, NT, OS/2 and DOS clients. This protocol is sometimes also referred + to as the LanManager or Netbios protocol. +endef + +TARGET_CFLAGS += -DMAX_DEBUG_LEVEL=$(CONFIG_PACKAGE_SAMBA_MAX_DEBUG_LEVEL) -D__location__=\\\"\\\" -ffunction-sections -fdata-sections +TARGET_LDFLAGS += -Wl,--gc-sections + +CONFIGURE_VARS += \ + ac_cv_file__proc_sys_kernel_core_pattern=yes \ + libreplace_cv_HAVE_C99_VSNPRINTF=yes \ + libreplace_cv_HAVE_GETADDRINFO=yes \ + libreplace_cv_HAVE_IFACE_IFCONF=yes \ + LINUX_LFS_SUPPORT=yes \ + samba_cv_CC_NEGATIVE_ENUM_VALUES=yes \ + samba_cv_HAVE_GETTIMEOFDAY_TZ=yes \ + samba_cv_HAVE_IFACE_IFCONF=yes \ + samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes \ + samba_cv_HAVE_SECURE_MKSTEMP=yes \ + samba_cv_HAVE_WRFILE_KEYTAB=no \ + samba_cv_USE_SETREUID=yes \ + samba_cv_USE_SETRESUID=yes \ + samba_cv_have_setreuid=yes \ + samba_cv_have_setresuid=yes \ + ac_cv_header_zlib_h=no \ + samba_cv_zlib_1_2_3=no + +CONFIGURE_ARGS += \ + --exec-prefix=/usr \ + --prefix=/ \ + --disable-avahi \ + --disable-cups \ + --disable-pie \ + --disable-relro \ + --disable-static \ + --disable-swat \ + --disable-shared-libs \ + --with-codepagedir=/etc/samba \ + --with-configdir=/etc/samba \ + --with-included-iniparser \ + --with-included-popt \ + --with-lockdir=/var/lock \ + --with-logfilebase=/var/log \ + --with-nmbdsocketdir=/var/nmbd \ + --with-piddir=/var/run \ + --with-privatedir=/etc/samba \ + --with-sendfile-support \ + --without-cluster-support \ + --without-ads \ + --without-krb5 \ + --without-ldap \ + --without-pam \ + --without-winbind \ + --without-libtdb \ + --without-libtalloc \ + --without-libnetapi \ + --without-libsmbclient \ + --without-libsmbsharemodes \ + --without-libaddns \ + --with-shared-modules=pdb_tdbsam,pdb_wbc_sam,idmap_nss,nss_info_template,auth_winbind,auth_wbc,auth_domain + +MAKE_FLAGS += DYNEXP= PICFLAG= MODULES= + +define Package/samba36-server/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/samba.config $(1)/etc/config/samba + $(INSTALL_DIR) $(1)/etc/samba + $(INSTALL_DATA) ./files/smb.conf.template $(1)/etc/samba + $(INSTALL_DATA) $(PKG_BUILD_DIR)/codepages/lowcase.dat $(1)/etc/samba + $(INSTALL_DATA) $(PKG_BUILD_DIR)/codepages/upcase.dat $(1)/etc/samba + $(INSTALL_DATA) $(PKG_BUILD_DIR)/codepages/valid.dat $(1)/etc/samba + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/samba.init $(1)/etc/init.d/samba + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_BIN)/samba_multicall $(1)/usr/sbin + ln -sf samba_multicall $(1)/usr/sbin/smbd + ln -sf samba_multicall $(1)/usr/sbin/nmbd + ln -sf samba_multicall $(1)/usr/sbin/smbpasswd +endef + +define Package/samba36-client/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_BIN)/smbclient $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_BIN)/nmblookup $(1)/usr/sbin +endef + +$(eval $(call BuildPackage,samba36-client)) +$(eval $(call BuildPackage,samba36-server)) + diff --git a/net/samba36/files/samba.config b/net/samba36/files/samba.config new file mode 100644 index 0000000..c79db0d --- /dev/null +++ b/net/samba36/files/samba.config @@ -0,0 +1,6 @@ +config samba + option 'name' 'OpenWrt' + option 'workgroup' 'WORKGROUP' + option 'description' 'OpenWrt' + option 'homes' '1' + diff --git a/net/samba36/files/samba.init b/net/samba36/files/samba.init new file mode 100755 index 0000000..61398d8 --- /dev/null +++ b/net/samba36/files/samba.init @@ -0,0 +1,97 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2012 OpenWrt.org + +START=60 + +smb_header() { + local interface + config_get interface $1 interface "loopback lan" + + # resolve interfaces + local interfaces=$( + . /lib/functions/network.sh + + local net + for net in $interface; do + local device + network_get_device device "$net" && { + local subnet + network_get_subnet subnet "$net" && echo -n "$subnet " + network_get_subnet6 subnet "$net" && echo -n "$subnet " + } + + echo -n "${device:-$net} " + done + ) + + local name workgroup description charset + local hostname="$(uci_get system.@system[0].hostname)" + + config_get name $1 name "${hostname:-OpenWrt}" + config_get workgroup $1 workgroup "${hostname:-OpenWrt}" + config_get description $1 description "Samba on ${hostname:-OpenWrt}" + config_get charset $1 charset "UTF-8" + + mkdir -p /var/etc + sed -e "s#|NAME|#$name#g" \ + -e "s#|WORKGROUP|#$workgroup#g" \ + -e "s#|DESCRIPTION|#$description#g" \ + -e "s#|INTERFACES|#$interfaces#g" \ + -e "s#|CHARSET|#$charset#g" \ + /etc/samba/smb.conf.template > /var/etc/smb.conf + + local homes + config_get_bool homes $1 homes 0 + [ $homes -gt 0 ] && { + cat <> /var/etc/smb.conf + +[homes] + comment = Home Directories + browsable = no + read only = no + create mode = 0750 +EOT + } + + [ -L /etc/samba/smb.conf ] || ln -nsf /var/etc/smb.conf /etc/samba/smb.conf +} + +smb_add_share() { + local name + local path + local users + local read_only + local guest_ok + local create_mask + local dir_mask + + config_get name $1 name + config_get path $1 path + config_get users $1 users + config_get read_only $1 read_only + config_get guest_ok $1 guest_ok + config_get create_mask $1 create_mask + config_get dir_mask $1 dir_mask + + [ -z "$name" -o -z "$path" ] && return + + echo -e "\n[$name]\n\tpath = $path" >> /var/etc/smb.conf + [ -n "$users" ] && echo -e "\tvalid users = $users" >> /var/etc/smb.conf + [ -n "$read_only" ] && echo -e "\tread only = $read_only" >> /var/etc/smb.conf + [ -n "$guest_ok" ] && echo -e "\tguest ok = $guest_ok" >> /var/etc/smb.conf + [ -n "$create_mask" ] && echo -e "\tcreate mask = $create_mask" >> /var/etc/smb.conf + [ -n "$dir_mask" ] && echo -e "\tdirectory mask = $dir_mask" >> /var/etc/smb.conf +} + +start() { + config_load samba + config_foreach smb_header samba + config_foreach smb_add_share sambashare + service_start /usr/sbin/smbd -D + service_start /usr/sbin/nmbd -D +} + +stop() { + service_stop /usr/sbin/smbd + service_stop /usr/sbin/nmbd +} diff --git a/net/samba36/files/smb.conf.template b/net/samba36/files/smb.conf.template new file mode 100644 index 0000000..38a3855 --- /dev/null +++ b/net/samba36/files/smb.conf.template @@ -0,0 +1,34 @@ +[global] + netbios name = |NAME| + display charset = |CHARSET| + interfaces = |INTERFACES| + server string = |DESCRIPTION| + unix charset = |CHARSET| + workgroup = |WORKGROUP| + browseable = yes + deadtime = 30 + domain master = yes + encrypt passwords = true + enable core files = no + guest account = nobody + guest ok = yes + invalid users = root + local master = yes + load printers = no + map to guest = Bad User + max protocol = SMB2 + min receivefile size = 16384 + null passwords = yes + obey pam restrictions = yes + os level = 20 + passdb backend = smbpasswd + preferred master = yes + printable = no + security = user + smb encrypt = disabled + smb passwd file = /etc/samba/smbpasswd + socket options = TCP_NODELAY IPTOS_LOWDELAY + syslog = 2 + use sendfile = yes + writeable = yes + diff --git a/net/samba36/patches/100-configure_fixes.patch b/net/samba36/patches/100-configure_fixes.patch new file mode 100644 index 0000000..0f20bbb --- /dev/null +++ b/net/samba36/patches/100-configure_fixes.patch @@ -0,0 +1,14 @@ +--- a/source3/configure ++++ b/source3/configure +@@ -13285,10 +13285,7 @@ if test x"$libreplace_cv_HAVE_GETADDRINF + # see bug 5910, use our replacements if we detect + # a broken system. + if test "$cross_compiling" = yes; then : +- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error "cannot run test program while cross compiling +-See \`config.log' for more details." "$LINENO" 5; } ++ $as_echo "assuming valid getaddrinfo without bug 5910" >&2 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ diff --git a/net/samba36/patches/110-multicall.patch b/net/samba36/patches/110-multicall.patch new file mode 100644 index 0000000..e667f06 --- /dev/null +++ b/net/samba36/patches/110-multicall.patch @@ -0,0 +1,117 @@ +--- a/source3/Makefile.in ++++ b/source3/Makefile.in +@@ -73,20 +73,20 @@ LDAP_LIBS=@LDAP_LIBS@ + NSCD_LIBS=@NSCD_LIBS@ + UUID_LIBS=@UUID_LIBS@ + LIBWBCLIENT=@LIBWBCLIENT_STATIC@ @LIBWBCLIENT_SHARED@ +-LIBWBCLIENT_LIBS=@LIBWBCLIENT_LIBS@ ++LIBWBCLIENT_LIBS=@LIBWBCLIENT_STATIC@ + PTHREAD_LDFLAGS=@PTHREAD_LDFLAGS@ + PTHREAD_CFLAGS=@PTHREAD_CFLAGS@ + DNSSD_LIBS=@DNSSD_LIBS@ + AVAHI_LIBS=@AVAHI_LIBS@ + POPT_LIBS=@POPTLIBS@ + LIBTALLOC=@LIBTALLOC_STATIC@ @LIBTALLOC_SHARED@ +-LIBTALLOC_LIBS=@LIBTALLOC_LIBS@ ++LIBTALLOC_LIBS=@LIBTALLOC_STATIC@ + LIBREPLACE_LIBS=@LIBREPLACE_LIBS@ + LIBTDB=@LIBTDB_STATIC@ @LIBTDB_SHARED@ +-LIBTDB_LIBS=@LIBTDB_LIBS@ ++LIBTDB_LIBS=@LIBTDB_STATIC@ + TDB_DEPS=@TDB_DEPS@ + LIBNETAPI=@LIBNETAPI_STATIC@ @LIBNETAPI_SHARED@ +-LIBNETAPI_LIBS=@LIBNETAPI_LIBS@ ++LIBNETAPI_LIBS=@LIBNETAPI_STATIC@ + LIBSMBCLIENT_LIBS=@LIBSMBCLIENT_LIBS@ + LIBSMBSHAREMODES_LIBS=@LIBSMBSHAREMODES_LIBS@ + +@@ -214,7 +214,7 @@ PATH_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_P + + # Note that all executable programs now provide for an optional executable suffix. + +-SBIN_PROGS = bin/smbd@EXEEXT@ bin/nmbd@EXEEXT@ @SWAT_SBIN_TARGETS@ @EXTRA_SBIN_PROGS@ ++SBIN_PROGS = bin/samba_multicall@EXEEXT@ bin/smbd@EXEEXT@ bin/nmbd@EXEEXT@ @SWAT_SBIN_TARGETS@ @EXTRA_SBIN_PROGS@ + + BIN_PROGS1 = bin/smbclient@EXEEXT@ bin/net@EXEEXT@ bin/smbspool@EXEEXT@ \ + bin/testparm@EXEEXT@ bin/smbstatus@EXEEXT@ bin/smbget@EXEEXT@ \ +@@ -1774,6 +1774,42 @@ bin/.dummy: + dir=bin $(MAKEDIR); fi + @: >> $@ || : > $@ # what a fancy emoticon! + ++smbd/server_multicall.o: smbd/server.c smbd/server.o ++ @echo Compiling $<.c ++ @$(COMPILE_CC_PATH) -Dmain=smbd_main && exit 0;\ ++ echo "The following command failed:" 1>&2;\ ++ echo "$(COMPILE_CC_PATH)" 1>&2;\ ++ $(COMPILE_CC_PATH) >/dev/null 2>&1 ++ ++nmbd/nmbd_multicall.o: nmbd/nmbd.c nmbd/nmbd.o ++ @echo Compiling $<.c ++ @$(COMPILE_CC_PATH) -Dmain=nmbd_main && exit 0;\ ++ echo "The following command failed:" 1>&2;\ ++ echo "$(COMPILE_CC_PATH)" 1>&2;\ ++ $(COMPILE_CC_PATH) >/dev/null 2>&1 ++ ++utils/smbpasswd_multicall.o: utils/smbpasswd.c utils/smbpasswd.o ++ @echo Compiling $<.c ++ @$(COMPILE_CC_PATH) -Dmain=smbpasswd_main && exit 0;\ ++ echo "The following command failed:" 1>&2;\ ++ echo "$(COMPILE_CC_PATH)" 1>&2;\ ++ $(COMPILE_CC_PATH) >/dev/null 2>&1 ++ ++SMBD_MULTI_O = $(patsubst smbd/server.o,smbd/server_multicall.o,$(SMBD_OBJ)) ++NMBD_MULTI_O = $(patsubst nmbd/nmbd.o,nmbd/nmbd_multicall.o,$(filter-out $(LIB_DUMMY_OBJ),$(NMBD_OBJ))) ++SMBPASSWD_MULTI_O = $(patsubst utils/smbpasswd.o,utils/smbpasswd_multicall.o,$(filter-out $(LIB_DUMMY_OBJ),$(SMBPASSWD_OBJ))) ++MULTI_O = multi.o ++ ++MULTICALL_O = $(sort $(SMBD_MULTI_O) $(NMBD_MULTI_O) $(SMBPASSWD_MULTI_O) $(MULTI_O)) ++ ++bin/samba_multicall@EXEEXT@: $(BINARY_PREREQS) $(MULTICALL_O) $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) @BUILD_POPT@ ++ @echo Linking $@ ++ @$(CC) -o $@ $(MULTICALL_O) $(LDFLAGS) $(LDAP_LIBS) @SMBD_FAM_LIBS@ \ ++ $(KRB5LIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) \ ++ $(ACL_LIBS) $(PASSDB_LIBS) $(LIBS) $(DNSSD_LIBS) $(AVAHI_LIBS) \ ++ $(POPT_LIBS) @SMBD_LIBS@ $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) \ ++ $(LIBWBCLIENT_LIBS) $(ZLIB_LIBS) ++ + bin/smbd@EXEEXT@: $(BINARY_PREREQS) $(SMBD_OBJ) $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) @BUILD_POPT@ + @echo Linking $@ + @$(CC) -o $@ $(SMBD_OBJ) $(LDFLAGS) $(LDAP_LIBS) @SMBD_FAM_LIBS@ \ +--- /dev/null ++++ b/source3/multi.c +@@ -0,0 +1,35 @@ ++#include ++#include ++ ++extern int smbd_main(int argc, char **argv); ++extern int nmbd_main(int argc, char **argv); ++extern int smbpasswd_main(int argc, char **argv); ++ ++static struct { ++ const char *name; ++ int (*func)(int argc, char **argv); ++} multicall[] = { ++ { "smbd", smbd_main }, ++ { "nmbd", nmbd_main }, ++ { "smbpasswd", smbpasswd_main }, ++}; ++ ++#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) ++ ++int main(int argc, char **argv) ++{ ++ int i; ++ ++ for (i = 0; i < ARRAY_SIZE(multicall); i++) { ++ if (strstr(argv[0], multicall[i].name)) ++ return multicall[i].func(argc, argv); ++ } ++ ++ fprintf(stderr, "Invalid multicall command, available commands:"); ++ for (i = 0; i < ARRAY_SIZE(multicall); i++) ++ fprintf(stderr, " %s", multicall[i].name); ++ ++ fprintf(stderr, "\n"); ++ ++ return 1; ++} diff --git a/net/samba36/patches/111-owrt_smbpasswd.patch b/net/samba36/patches/111-owrt_smbpasswd.patch new file mode 100644 index 0000000..d8089a3 --- /dev/null +++ b/net/samba36/patches/111-owrt_smbpasswd.patch @@ -0,0 +1,277 @@ +--- a/source3/Makefile.in ++++ b/source3/Makefile.in +@@ -1016,7 +1016,7 @@ TEST_LP_LOAD_OBJ = param/test_lp_load.o + + PASSWD_UTIL_OBJ = utils/passwd_util.o + +-SMBPASSWD_OBJ = utils/smbpasswd.o $(PASSWD_UTIL_OBJ) $(PASSCHANGE_OBJ) \ ++SMBPASSWD_OBJ = utils/owrt_smbpasswd.o $(PASSWD_UTIL_OBJ) $(PASSCHANGE_OBJ) \ + $(PARAM_OBJ) $(LIBSMB_OBJ) $(PASSDB_OBJ) \ + $(GROUPDB_OBJ) $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) \ + $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) \ +@@ -1788,7 +1788,7 @@ nmbd/nmbd_multicall.o: nmbd/nmbd.c nmbd/ + echo "$(COMPILE_CC_PATH)" 1>&2;\ + $(COMPILE_CC_PATH) >/dev/null 2>&1 + +-utils/smbpasswd_multicall.o: utils/smbpasswd.c utils/smbpasswd.o ++utils/smbpasswd_multicall.o: utils/owrt_smbpasswd.c utils/owrt_smbpasswd.o + @echo Compiling $<.c + @$(COMPILE_CC_PATH) -Dmain=smbpasswd_main && exit 0;\ + echo "The following command failed:" 1>&2;\ +@@ -1797,7 +1797,7 @@ utils/smbpasswd_multicall.o: utils/smbpa + + SMBD_MULTI_O = $(patsubst smbd/server.o,smbd/server_multicall.o,$(SMBD_OBJ)) + NMBD_MULTI_O = $(patsubst nmbd/nmbd.o,nmbd/nmbd_multicall.o,$(filter-out $(LIB_DUMMY_OBJ),$(NMBD_OBJ))) +-SMBPASSWD_MULTI_O = $(patsubst utils/smbpasswd.o,utils/smbpasswd_multicall.o,$(filter-out $(LIB_DUMMY_OBJ),$(SMBPASSWD_OBJ))) ++SMBPASSWD_MULTI_O = $(patsubst utils/owrt_smbpasswd.o,utils/smbpasswd_multicall.o,$(filter-out $(LIB_DUMMY_OBJ),$(SMBPASSWD_OBJ))) + MULTI_O = multi.o + + MULTICALL_O = $(sort $(SMBD_MULTI_O) $(NMBD_MULTI_O) $(SMBPASSWD_MULTI_O) $(MULTI_O)) +--- /dev/null ++++ b/source3/utils/owrt_smbpasswd.c +@@ -0,0 +1,245 @@ ++/* ++ * Copyright (C) 2012 Felix Fietkau ++ * Copyright (C) 2008 John Crispin ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License as published by the ++ * Free Software Foundation; either version 2 of the License, or (at your ++ * option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ++ * more details. ++ * ++ * You should have received a copy of the GNU General Public License along with ++ * this program; if not, write to the Free Software Foundation, Inc., 675 ++ * Mass Ave, Cambridge, MA 02139, USA. */ ++ ++#include "includes.h" ++#include ++#include ++ ++static char buf[256]; ++ ++static void md4hash(const char *passwd, uchar p16[16]) ++{ ++ int len; ++ smb_ucs2_t wpwd[129]; ++ int i; ++ ++ len = strlen(passwd); ++ for (i = 0; i < len; i++) { ++#if __BYTE_ORDER == __LITTLE_ENDIAN ++ wpwd[i] = (unsigned char)passwd[i]; ++#else ++ wpwd[i] = (unsigned char)passwd[i] << 8; ++#endif ++ } ++ wpwd[i] = 0; ++ ++ len = len * sizeof(int16); ++ mdfour(p16, (unsigned char *)wpwd, len); ++ ZERO_STRUCT(wpwd); ++} ++ ++ ++static bool find_passwd_line(FILE *fp, const char *user, char **next) ++{ ++ char *p1; ++ ++ while (!feof(fp)) { ++ if(!fgets(buf, sizeof(buf) - 1, fp)) ++ continue; ++ ++ p1 = strchr(buf, ':'); ++ ++ if (p1 - buf != strlen(user)) ++ continue; ++ ++ if (strncmp(buf, user, p1 - buf) != 0) ++ continue; ++ ++ if (next) ++ *next = p1; ++ return true; ++ } ++ return false; ++} ++ ++/* returns -1 if user is not present in /etc/passwd*/ ++static int find_uid_for_user(const char *user) ++{ ++ FILE *fp; ++ char *p1, *p2, *p3; ++ int ret = -1; ++ ++ fp = fopen("/etc/passwd", "r"); ++ if (!fp) { ++ printf("failed to open /etc/passwd"); ++ goto out; ++ } ++ ++ if (!find_passwd_line(fp, user, &p1)) { ++ printf("User %s not found or invalid in /etc/passwd\n"); ++ goto out; ++ } ++ ++ p2 = strchr(p1 + 1, ':'); ++ if (!p2) ++ goto out; ++ ++ p2++; ++ p3 = strchr(p2, ':'); ++ if (!p1) ++ goto out; ++ ++ *p3 = '\0'; ++ ret = atoi(p2); ++ ++out: ++ if(fp) ++ fclose(fp); ++ return ret; ++} ++ ++static void smbpasswd_write_user(FILE *fp, const char *user, int uid, const char *password) ++{ ++ static uchar nt_p16[NT_HASH_LEN]; ++ int len = 0; ++ int i; ++ ++ md4hash(strdup(password), nt_p16); ++ ++ len += snprintf(buf + len, sizeof(buf) - len, "%s:%u:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:", user, uid); ++ for(i = 0; i < NT_HASH_LEN; i++) ++ len += snprintf(buf + len, sizeof(buf) - len, "%02X", nt_p16[i]); ++ ++ snprintf(buf + len, sizeof(buf) - len, ":[U ]:LCT-00000001:\n"); ++ fputs(buf, fp); ++} ++ ++static void smbpasswd_delete_user(FILE *fp) ++{ ++ fpos_t r_pos, w_pos; ++ int len = strlen(buf); ++ ++ fgetpos(fp, &r_pos); ++ w_pos = r_pos; ++ w_pos.__pos -= len; ++ ++ while (fgets(buf, sizeof(buf) - 1, fp)) { ++ int cur_len = strlen(buf); ++ ++ fsetpos(fp, &w_pos); ++ fputs(buf, fp); ++ r_pos.__pos += cur_len; ++ w_pos.__pos += cur_len; ++ fsetpos(fp, &r_pos); ++ } ++ ++ ftruncate(fileno(fp), w_pos.__pos); ++} ++ ++static int usage(const char *progname) ++{ ++ fprintf(stderr, ++ "Usage: %s [options] \n" ++ "\n" ++ "Options:\n" ++ " -s read password from stdin\n" ++ " -a add user\n" ++ " -x delete user\n", ++ progname); ++ return 1; ++} ++ ++int main(int argc, char **argv) ++{ ++ const char *prog = argv[0]; ++ const char *user; ++ char *pw1, *pw2; ++ FILE *fp; ++ bool add = false, delete = false, get_stdin = false, found; ++ int ch; ++ int uid; ++ ++ TALLOC_CTX *frame = talloc_stackframe(); ++ ++ while ((ch = getopt(argc, argv, "asx")) != EOF) { ++ switch (ch) { ++ case 's': ++ get_stdin = true; ++ break; ++ case 'a': ++ add = true; ++ break; ++ case 'x': ++ delete = true; ++ break; ++ default: ++ return usage(prog); ++ } ++ } ++ ++ if (add && delete) ++ return usage(prog); ++ ++ argc -= optind; ++ argv += optind; ++ ++ if (!argc) ++ return usage(prog); ++ ++ user = argv[0]; ++ if (!delete) { ++ uid = find_uid_for_user(user); ++ if (uid < 0) { ++ fprintf(stderr, "Could not find user '%s' in /etc/passwd\n", user); ++ return 2; ++ } ++ } ++ ++ fp = fopen("/etc/samba/smbpasswd", "r+"); ++ if(!fp) { ++ fprintf(stderr, "Failed to open /etc/samba/smbpasswd"); ++ return 3; ++ } ++ ++ found = find_passwd_line(fp, user, NULL); ++ if (!add && !found) { ++ fprintf(stderr, "Could not find user '%s' in /etc/samba/smbpasswd\n", user); ++ return 3; ++ } ++ ++ if (delete) { ++ smbpasswd_delete_user(fp); ++ goto out; ++ } ++ ++ pw1 = get_pass("New SMB password:", get_stdin); ++ if (!pw1) ++ pw1 = strdup(""); ++ ++ pw2 = get_pass("Retype SMB password:", get_stdin); ++ if (!pw2) ++ pw2 = strdup(""); ++ ++ if (strcmp(pw1, pw2) != 0) { ++ fprintf(stderr, "Mismatch - password unchanged.\n"); ++ goto out_free; ++ } ++ ++ if (found) ++ fseek(fp, -strlen(buf), SEEK_CUR); ++ smbpasswd_write_user(fp, user, uid, pw2); ++ ++out_free: ++ free(pw1); ++ free(pw2); ++out: ++ fclose(fp); ++ TALLOC_FREE(frame); ++ ++ return 0; ++} diff --git a/net/samba36/patches/120-add_missing_ifdef.patch b/net/samba36/patches/120-add_missing_ifdef.patch new file mode 100644 index 0000000..dbd9adc --- /dev/null +++ b/net/samba36/patches/120-add_missing_ifdef.patch @@ -0,0 +1,26 @@ +--- a/source3/librpc/rpc/rpc_common.c ++++ b/source3/librpc/rpc/rpc_common.c +@@ -119,9 +119,11 @@ static bool initialize_interfaces(void) + if (!smb_register_ndr_interface(&ndr_table_netdfs)) { + return false; + } ++#ifdef DEVELOPER + if (!smb_register_ndr_interface(&ndr_table_rpcecho)) { + return false; + } ++#endif + if (!smb_register_ndr_interface(&ndr_table_initshutdown)) { + return false; + } +--- a/source3/rpcclient/rpcclient.c ++++ b/source3/rpcclient/rpcclient.c +@@ -628,7 +628,9 @@ static struct cmd_set *rpcclient_command + netlogon_commands, + srvsvc_commands, + dfs_commands, ++#ifdef DEVELOPER + echo_commands, ++#endif + epmapper_commands, + shutdown_commands, + test_commands, diff --git a/net/samba36/patches/200-remove_printer_support.patch b/net/samba36/patches/200-remove_printer_support.patch new file mode 100644 index 0000000..46254ba --- /dev/null +++ b/net/samba36/patches/200-remove_printer_support.patch @@ -0,0 +1,356 @@ +--- a/source3/rpc_server/rpc_ep_setup.c ++++ b/source3/rpc_server/rpc_ep_setup.c +@@ -1110,6 +1110,10 @@ bool dcesrv_ep_setup(struct tevent_conte + "rpc_server", + "spoolss", + "embedded"); ++#ifndef PRINTER_SUPPORT ++ if (1) { ++ } else ++#endif + if (StrCaseCmp(rpcsrv_type, "embedded") == 0) { + spoolss_cb.init = spoolss_init_cb; + spoolss_cb.shutdown = spoolss_shutdown_cb; +--- a/source3/rpcclient/rpcclient.c ++++ b/source3/rpcclient/rpcclient.c +@@ -624,7 +624,9 @@ static struct cmd_set *rpcclient_command + lsarpc_commands, + ds_commands, + samr_commands, ++#ifdef PRINTER_SUPPORT + spoolss_commands, ++#endif + netlogon_commands, + srvsvc_commands, + dfs_commands, +--- a/source3/printing/spoolssd.c ++++ b/source3/printing/spoolssd.c +@@ -153,6 +153,10 @@ void start_spoolssd(struct tevent_contex + NTSTATUS status; + int ret; + ++#ifndef PRINTER_SUPPORT ++ return; ++#endif ++ + DEBUG(1, ("Forking SPOOLSS Daemon\n")); + + pid = sys_fork(); +--- a/source3/utils/net_rpc.c ++++ b/source3/utils/net_rpc.c +@@ -7791,6 +7791,10 @@ int net_rpc_printer(struct net_context * + {NULL, NULL, 0, NULL, NULL} + }; + ++#ifndef PRINTER_SUPPORT ++ return 0; ++#endif ++ + if (argc == 0) { + if (c->display_usage) { + d_printf(_("Usage:\n")); +--- a/source3/smbd/reply.c ++++ b/source3/smbd/reply.c +@@ -5194,7 +5194,11 @@ void reply_printopen(struct smb_request + return; + } + +- if (!CAN_PRINT(conn)) { ++ ++#ifdef PRINTER_SUPPORT ++ if (!CAN_PRINT(conn)) ++#endif ++ { + reply_nterror(req, NT_STATUS_ACCESS_DENIED); + END_PROFILE(SMBsplopen); + return; +@@ -5300,7 +5304,10 @@ void reply_printqueue(struct smb_request + is really quite gross and only worked when there was only + one printer - I think we should now only accept it if they + get it right (tridge) */ +- if (!CAN_PRINT(conn)) { ++#ifdef PRINTER_SUPPORT ++ if (!CAN_PRINT(conn)) ++#endif ++ { + reply_nterror(req, NT_STATUS_ACCESS_DENIED); + END_PROFILE(SMBsplretq); + return; +--- a/source3/smbd/lanman.c ++++ b/source3/smbd/lanman.c +@@ -784,6 +784,10 @@ static bool api_DosPrintQGetInfo(struct + union spoolss_JobInfo *job_info = NULL; + union spoolss_PrinterInfo printer_info; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -999,6 +1003,10 @@ static bool api_DosPrintQEnum(struct smb + union spoolss_DriverInfo *driver_info; + union spoolss_JobInfo **job_info; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!param_format || !output_format1 || !p) { + return False; + } +@@ -3350,6 +3358,10 @@ static bool api_RDosPrintJobDel(struct s + struct spoolss_DevmodeContainer devmode_ctr; + enum spoolss_JobControl command; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -3483,6 +3495,10 @@ static bool api_WPrintQueueCtrl(struct s + struct sec_desc_buf secdesc_ctr; + enum spoolss_PrinterControl command; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !QueueName) { + return False; + } +@@ -3649,6 +3665,10 @@ static bool api_PrintJobInfo(struct smbd + union spoolss_JobInfo info; + struct spoolss_SetJobInfo1 info1; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -4792,6 +4812,10 @@ static bool api_WPrintJobGetInfo(struct + struct spoolss_DevmodeContainer devmode_ctr; + union spoolss_JobInfo info; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -4930,6 +4954,10 @@ static bool api_WPrintJobEnumerate(struc + uint32_t count = 0; + union spoolss_JobInfo *info; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -5135,6 +5163,10 @@ static bool api_WPrintDestGetInfo(struct + struct spoolss_DevmodeContainer devmode_ctr; + union spoolss_PrinterInfo info; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -5271,6 +5303,10 @@ static bool api_WPrintDestEnum(struct sm + union spoolss_PrinterInfo *info; + uint32_t count; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -5374,6 +5410,10 @@ static bool api_WPrintDriverEnum(struct + int succnt; + struct pack_desc desc; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -5438,6 +5478,10 @@ static bool api_WPrintQProcEnum(struct s + int succnt; + struct pack_desc desc; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -5502,6 +5546,10 @@ static bool api_WPrintPortEnum(struct sm + int succnt; + struct pack_desc desc; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +--- a/source3/smbd/server_exit.c ++++ b/source3/smbd/server_exit.c +@@ -142,7 +142,9 @@ static void exit_server_common(enum serv + rpc_eventlog_shutdown(); + rpc_ntsvcs_shutdown(); + rpc_svcctl_shutdown(); ++#ifdef PRINTER_SUPPORT + rpc_spoolss_shutdown(); ++#endif + + rpc_srvsvc_shutdown(); + rpc_winreg_shutdown(); +--- a/source3/smbd/open.c ++++ b/source3/smbd/open.c +@@ -1556,6 +1556,9 @@ static NTSTATUS open_file_ntcreate(conne + * Most of the passed parameters are ignored. + */ + ++#ifndef PRINTER_SUPPORT ++ return NT_STATUS_ACCESS_DENIED; ++#endif + if (pinfo) { + *pinfo = FILE_WAS_CREATED; + } +--- a/source3/smbd/close.c ++++ b/source3/smbd/close.c +@@ -638,6 +638,9 @@ static NTSTATUS close_normal_file(struct + status = ntstatus_keeperror(status, tmp); + + if (fsp->print_file) { ++#ifndef PRINTER_SUPPORT ++ return NT_STATUS_OK; ++#endif + /* FIXME: return spool errors */ + print_spool_end(fsp, close_type); + file_free(req, fsp); +--- a/source3/smbd/fileio.c ++++ b/source3/smbd/fileio.c +@@ -298,6 +298,10 @@ ssize_t write_file(struct smb_request *r + uint32_t t; + int ret; + ++#ifndef PRINTER_SUPPORT ++ return -1; ++#endif ++ + ret = print_spool_write(fsp, data, n, pos, &t); + if (ret) { + errno = ret; +--- a/source3/smbd/smb2_create.c ++++ b/source3/smbd/smb2_create.c +@@ -485,7 +485,10 @@ static struct tevent_req *smbd_smb2_crea + info = FILE_WAS_OPENED; + } else if (CAN_PRINT(smb1req->conn)) { + status = file_new(smb1req, smb1req->conn, &result); +- if(!NT_STATUS_IS_OK(status)) { ++#ifdef PRINTER_SUPPORT ++ if(!NT_STATUS_IS_OK(status)) ++#endif ++ { + tevent_req_nterror(req, status); + return tevent_req_post(req, ev); + } +--- a/source3/rpc_server/svcctl/srv_svcctl_nt.c ++++ b/source3/rpc_server/svcctl/srv_svcctl_nt.c +@@ -85,9 +85,11 @@ bool init_service_op_table( void ) + + /* add builtin services */ + ++#ifdef PRINTER_SUPPORT + svcctl_ops[i].name = talloc_strdup( svcctl_ops, "Spooler" ); + svcctl_ops[i].ops = &spoolss_svc_ops; + i++; ++#endif + + svcctl_ops[i].name = talloc_strdup( svcctl_ops, "NETLOGON" ); + svcctl_ops[i].ops = &netlogon_svc_ops; +--- a/source3/librpc/rpc/rpc_common.c ++++ b/source3/librpc/rpc/rpc_common.c +@@ -113,9 +113,11 @@ static bool initialize_interfaces(void) + if (!smb_register_ndr_interface(&ndr_table_winreg)) { + return false; + } ++#ifdef PRINTER_SUPPORT + if (!smb_register_ndr_interface(&ndr_table_spoolss)) { + return false; + } ++#endif + if (!smb_register_ndr_interface(&ndr_table_netdfs)) { + return false; + } +--- a/source3/smbd/process.c ++++ b/source3/smbd/process.c +@@ -2475,8 +2475,10 @@ static bool housekeeping_fn(const struct + + change_to_root_user(); + ++#ifdef PRINTER_SUPPORT + /* update printer queue caches if necessary */ + update_monitored_printq_cache(sconn->msg_ctx); ++#endif + + /* check if we need to reload services */ + check_reload(sconn, time_mono(NULL)); +--- a/source3/smbd/server.c ++++ b/source3/smbd/server.c +@@ -126,7 +126,9 @@ static void smb_pcap_updated(struct mess + { + struct tevent_context *ev_ctx = + talloc_get_type_abort(private_data, struct tevent_context); +- ++#ifndef PRINTER_SUPPORT ++ return; ++#endif + DEBUG(10,("Got message saying pcap was updated. Reloading.\n")); + change_to_root_user(); + reload_printers(ev_ctx, msg); +@@ -1211,8 +1213,10 @@ extern void build_options(bool screen); + if (!W_ERROR_IS_OK(registry_init_full())) + exit(1); + ++#ifdef PRINTER_SUPPORT + if (!print_backend_init(smbd_messaging_context())) + exit(1); ++#endif + + /* Open the share_info.tdb here, so we don't have to open + after the fork on every single connection. This is a small +@@ -1256,6 +1260,7 @@ extern void build_options(bool screen); + exit(1); + } + ++#ifdef PRINTER_SUPPORT + /* Publish nt printers, this requires a working winreg pipe */ + pcap_cache_reload(server_event_context(), smbd_messaging_context(), + &reload_printers); +@@ -1284,6 +1289,7 @@ extern void build_options(bool screen); + smbd_messaging_context()); + } + } ++#endif + + if (!is_daemon) { + /* inetd mode */ diff --git a/net/samba36/patches/210-remove_ad_support.patch b/net/samba36/patches/210-remove_ad_support.patch new file mode 100644 index 0000000..d6b8a7e --- /dev/null +++ b/net/samba36/patches/210-remove_ad_support.patch @@ -0,0 +1,88 @@ +--- a/source3/librpc/rpc/rpc_common.c ++++ b/source3/librpc/rpc/rpc_common.c +@@ -95,9 +95,11 @@ static bool initialize_interfaces(void) + if (!smb_register_ndr_interface(&ndr_table_lsarpc)) { + return false; + } ++#ifdef ACTIVE_DIRECTORY + if (!smb_register_ndr_interface(&ndr_table_dssetup)) { + return false; + } ++#endif + if (!smb_register_ndr_interface(&ndr_table_samr)) { + return false; + } +@@ -141,9 +143,11 @@ static bool initialize_interfaces(void) + if (!smb_register_ndr_interface(&ndr_table_epmapper)) { + return false; + } ++#ifdef ACTIVE_DIRECTORY + if (!smb_register_ndr_interface(&ndr_table_drsuapi)) { + return false; + } ++#endif + return true; + } + +--- a/source3/rpc_server/rpc_ep_setup.c ++++ b/source3/rpc_server/rpc_ep_setup.c +@@ -918,6 +918,7 @@ static bool netdfs_init_cb(void *ptr) + return true; + } + ++#ifdef ACTIVE_DIRECTORY + static bool dssetup_init_cb(void *ptr) + { + struct dcesrv_ep_context *ep_ctx = +@@ -966,6 +967,7 @@ static bool dssetup_init_cb(void *ptr) + + return true; + } ++#endif + + static bool wkssvc_init_cb(void *ptr) + { +@@ -1172,12 +1174,14 @@ bool dcesrv_ep_setup(struct tevent_conte + } + #endif + ++#ifdef ACTIVE_DIRECTORY + dssetup_cb.init = dssetup_init_cb; + dssetup_cb.shutdown = NULL; + dssetup_cb.private_data = ep_ctx; + if (!NT_STATUS_IS_OK(rpc_dssetup_init(&dssetup_cb))) { + return false; + } ++#endif + + wkssvc_cb.init = wkssvc_init_cb; + wkssvc_cb.shutdown = NULL; +--- a/source3/smbd/server_exit.c ++++ b/source3/smbd/server_exit.c +@@ -133,7 +133,9 @@ static void exit_server_common(enum serv + + if (am_parent) { + rpc_wkssvc_shutdown(); ++#ifdef ACTIVE_DIRECTORY + rpc_dssetup_shutdown(); ++#endif + #ifdef DEVELOPER + rpc_rpcecho_shutdown(); + #endif +--- a/source3/rpc_client/cli_pipe.c ++++ b/source3/rpc_client/cli_pipe.c +@@ -2874,12 +2874,14 @@ NTSTATUS cli_rpc_pipe_open_noauth_transp + status = rpc_pipe_bind(result, auth); + if (!NT_STATUS_IS_OK(status)) { + int lvl = 0; ++#ifdef ACTIVE_DIRECTORY + if (ndr_syntax_id_equal(interface, + &ndr_table_dssetup.syntax_id)) { + /* non AD domains just don't have this pipe, avoid + * level 0 statement in that case - gd */ + lvl = 3; + } ++#endif + DEBUG(lvl, ("cli_rpc_pipe_open_noauth: rpc_pipe_bind for pipe " + "%s failed with error %s\n", + get_pipe_name_from_syntax(talloc_tos(), interface), diff --git a/net/samba36/patches/220-remove_services.patch b/net/samba36/patches/220-remove_services.patch new file mode 100644 index 0000000..c09721a --- /dev/null +++ b/net/samba36/patches/220-remove_services.patch @@ -0,0 +1,98 @@ +--- a/source3/librpc/rpc/rpc_common.c ++++ b/source3/librpc/rpc/rpc_common.c +@@ -131,6 +131,7 @@ static bool initialize_interfaces(void) + if (!smb_register_ndr_interface(&ndr_table_initshutdown)) { + return false; + } ++#ifdef EXTRA_SERVICES + if (!smb_register_ndr_interface(&ndr_table_svcctl)) { + return false; + } +@@ -140,6 +141,7 @@ static bool initialize_interfaces(void) + if (!smb_register_ndr_interface(&ndr_table_ntsvcs)) { + return false; + } ++#endif + if (!smb_register_ndr_interface(&ndr_table_epmapper)) { + return false; + } +--- a/source3/rpc_server/rpc_ep_setup.c ++++ b/source3/rpc_server/rpc_ep_setup.c +@@ -697,6 +697,7 @@ static bool spoolss_shutdown_cb(void *pt + return true; + } + ++#ifdef EXTRA_SERVICES + static bool svcctl_init_cb(void *ptr) + { + struct dcesrv_ep_context *ep_ctx = +@@ -733,6 +734,7 @@ static bool svcctl_init_cb(void *ptr) + + return true; + } ++#endif + + static bool svcctl_shutdown_cb(void *ptr) + { +@@ -741,6 +743,8 @@ static bool svcctl_shutdown_cb(void *ptr + return true; + } + ++#ifdef EXTRA_SERVICES ++ + static bool ntsvcs_init_cb(void *ptr) + { + struct dcesrv_ep_context *ep_ctx = +@@ -802,6 +806,7 @@ static bool eventlog_init_cb(void *ptr) + + return true; + } ++#endif + + static bool initshutdown_init_cb(void *ptr) + { +@@ -1130,6 +1135,7 @@ bool dcesrv_ep_setup(struct tevent_conte + } + } + ++#ifdef EXTRA_SERVICES + svcctl_cb.init = svcctl_init_cb; + svcctl_cb.shutdown = svcctl_shutdown_cb; + svcctl_cb.private_data = ep_ctx; +@@ -1150,6 +1156,7 @@ bool dcesrv_ep_setup(struct tevent_conte + if (!NT_STATUS_IS_OK(rpc_eventlog_init(&eventlog_cb))) { + return false; + } ++#endif + + initshutdown_cb.init = initshutdown_init_cb; + initshutdown_cb.shutdown = NULL; +--- a/source3/smbd/server_exit.c ++++ b/source3/smbd/server_exit.c +@@ -141,9 +141,11 @@ static void exit_server_common(enum serv + #endif + rpc_netdfs_shutdown(); + rpc_initshutdown_shutdown(); ++#ifdef EXTRA_SERVICES + rpc_eventlog_shutdown(); +- rpc_ntsvcs_shutdown(); + rpc_svcctl_shutdown(); ++ rpc_ntsvcs_shutdown(); ++#endif + #ifdef PRINTER_SUPPORT + rpc_spoolss_shutdown(); + #endif +--- a/source3/rpcclient/rpcclient.c ++++ b/source3/rpcclient/rpcclient.c +@@ -637,9 +637,11 @@ static struct cmd_set *rpcclient_command + shutdown_commands, + test_commands, + wkssvc_commands, ++#ifdef EXTRA_SERVICES + ntsvcs_commands, + drsuapi_commands, + eventlog_commands, ++#endif + winreg_commands, + NULL + }; diff --git a/net/samba36/patches/230-remove_winreg_support.patch b/net/samba36/patches/230-remove_winreg_support.patch new file mode 100644 index 0000000..5a4f656 --- /dev/null +++ b/net/samba36/patches/230-remove_winreg_support.patch @@ -0,0 +1,146 @@ +--- a/source3/rpc_server/rpc_ep_setup.c ++++ b/source3/rpc_server/rpc_ep_setup.c +@@ -409,6 +409,7 @@ static bool epmapper_shutdown_cb(void *p + return true; + } + ++#ifdef WINREG_SUPPORT + static bool winreg_init_cb(void *ptr) + { + struct dcesrv_ep_context *ep_ctx = +@@ -456,6 +457,7 @@ static bool winreg_init_cb(void *ptr) + + return true; + } ++#endif + + static bool srvsvc_init_cb(void *ptr) + { +@@ -710,10 +712,12 @@ static bool svcctl_init_cb(void *ptr) + "epmapper", + "none"); + ++#ifdef WINREG_SUPPORT + ok = svcctl_init_winreg(ep_ctx->msg_ctx); + if (!ok) { + return false; + } ++#endif + + /* initialize the control hooks */ + init_service_op_table(); +@@ -785,10 +789,12 @@ static bool eventlog_init_cb(void *ptr) + "epmapper", + "none"); + ++#ifdef WINREG_SUPPORT + ok = eventlog_init_winreg(ep_ctx->msg_ctx); + if (!ok) { + return false; + } ++#endif + + if (StrCaseCmp(rpcsrv_type, "embedded") == 0 || + StrCaseCmp(rpcsrv_type, "daemon") == 0) { +@@ -1077,12 +1083,14 @@ bool dcesrv_ep_setup(struct tevent_conte + } + } + ++#ifdef WINREG_SUPPORT + winreg_cb.init = winreg_init_cb; + winreg_cb.shutdown = NULL; + winreg_cb.private_data = ep_ctx; + if (!NT_STATUS_IS_OK(rpc_winreg_init(&winreg_cb))) { + return false; + } ++#endif + + srvsvc_cb.init = srvsvc_init_cb; + srvsvc_cb.shutdown = NULL; +--- a/source3/smbd/server_exit.c ++++ b/source3/smbd/server_exit.c +@@ -151,7 +151,9 @@ static void exit_server_common(enum serv + #endif + + rpc_srvsvc_shutdown(); ++#ifdef WINREG_SUPPORT + rpc_winreg_shutdown(); ++#endif + + rpc_netlogon_shutdown(); + rpc_samr_shutdown(); +--- a/source3/librpc/rpc/rpc_common.c ++++ b/source3/librpc/rpc/rpc_common.c +@@ -112,9 +112,11 @@ static bool initialize_interfaces(void) + if (!smb_register_ndr_interface(&ndr_table_wkssvc)) { + return false; + } ++#ifdef WINREG_SUPPORT + if (!smb_register_ndr_interface(&ndr_table_winreg)) { + return false; + } ++#endif + #ifdef PRINTER_SUPPORT + if (!smb_register_ndr_interface(&ndr_table_spoolss)) { + return false; +--- a/source3/rpc_server/svcctl/srv_svcctl_nt.c ++++ b/source3/rpc_server/svcctl/srv_svcctl_nt.c +@@ -95,9 +95,11 @@ bool init_service_op_table( void ) + svcctl_ops[i].ops = &netlogon_svc_ops; + i++; + ++#ifdef WINREG_SUPPORT + svcctl_ops[i].name = talloc_strdup( svcctl_ops, "RemoteRegistry" ); + svcctl_ops[i].ops = &winreg_svc_ops; + i++; ++#endif + + svcctl_ops[i].name = talloc_strdup( svcctl_ops, "WINS" ); + svcctl_ops[i].ops = &wins_svc_ops; +--- a/source3/services/svc_winreg_glue.c ++++ b/source3/services/svc_winreg_glue.c +@@ -88,6 +88,10 @@ struct security_descriptor *svcctl_get_s + NTSTATUS status; + WERROR result = WERR_OK; + ++#ifndef WINREG_SUPPORT ++ return NULL; ++#endif ++ + key = talloc_asprintf(mem_ctx, + "%s\\%s\\Security", + TOP_LEVEL_SERVICES_KEY, name); +@@ -161,6 +165,10 @@ bool svcctl_set_secdesc(struct messaging + NTSTATUS status; + WERROR result = WERR_OK; + ++#ifndef WINREG_SUPPORT ++ return false; ++#endif ++ + tmp_ctx = talloc_stackframe(); + if (tmp_ctx == NULL) { + return false; +@@ -272,6 +280,10 @@ const char *svcctl_get_string_value(TALL + NTSTATUS status; + WERROR result = WERR_OK; + ++#ifndef WINREG_SUPPORT ++ return NULL; ++#endif ++ + tmp_ctx = talloc_stackframe(); + if (tmp_ctx == NULL) { + return NULL; +--- a/source3/rpcclient/rpcclient.c ++++ b/source3/rpcclient/rpcclient.c +@@ -642,7 +642,9 @@ static struct cmd_set *rpcclient_command + drsuapi_commands, + eventlog_commands, + #endif ++#ifdef WINREG_SUPPORT + winreg_commands, ++#endif + NULL + }; + diff --git a/net/samba36/patches/240-remove_dfs_api.patch b/net/samba36/patches/240-remove_dfs_api.patch new file mode 100644 index 0000000..30882c2 --- /dev/null +++ b/net/samba36/patches/240-remove_dfs_api.patch @@ -0,0 +1,71 @@ +--- a/source3/rpc_server/rpc_ep_setup.c ++++ b/source3/rpc_server/rpc_ep_setup.c +@@ -881,6 +881,7 @@ static bool rpcecho_init_cb(void *ptr) { + + #endif + ++#ifdef DFS_SUPPORT + static bool netdfs_init_cb(void *ptr) + { + struct dcesrv_ep_context *ep_ctx = +@@ -928,6 +929,7 @@ static bool netdfs_init_cb(void *ptr) + + return true; + } ++#endif + + #ifdef ACTIVE_DIRECTORY + static bool dssetup_init_cb(void *ptr) +@@ -1173,12 +1175,14 @@ bool dcesrv_ep_setup(struct tevent_conte + return false; + } + ++#ifdef DFS_SUPPORT + netdfs_cb.init = netdfs_init_cb; + netdfs_cb.shutdown = NULL; + netdfs_cb.private_data = ep_ctx; + if (!NT_STATUS_IS_OK(rpc_netdfs_init(&netdfs_cb))) { + return false; + } ++#endif + + #ifdef DEVELOPER + rpcecho_cb.init = rpcecho_init_cb; +--- a/source3/librpc/rpc/rpc_common.c ++++ b/source3/librpc/rpc/rpc_common.c +@@ -122,9 +122,11 @@ static bool initialize_interfaces(void) + return false; + } + #endif ++#ifdef DFS_SUPPORT + if (!smb_register_ndr_interface(&ndr_table_netdfs)) { + return false; + } ++#endif + #ifdef DEVELOPER + if (!smb_register_ndr_interface(&ndr_table_rpcecho)) { + return false; +--- a/source3/smbd/server_exit.c ++++ b/source3/smbd/server_exit.c +@@ -139,7 +139,9 @@ static void exit_server_common(enum serv + #ifdef DEVELOPER + rpc_rpcecho_shutdown(); + #endif ++#ifdef DFS_SUPPORT + rpc_netdfs_shutdown(); ++#endif + rpc_initshutdown_shutdown(); + #ifdef EXTRA_SERVICES + rpc_eventlog_shutdown(); +--- a/source3/rpcclient/rpcclient.c ++++ b/source3/rpcclient/rpcclient.c +@@ -629,7 +629,9 @@ static struct cmd_set *rpcclient_command + #endif + netlogon_commands, + srvsvc_commands, ++#ifdef DFS_SUPPORT + dfs_commands, ++#endif + #ifdef DEVELOPER + echo_commands, + #endif diff --git a/net/samba36/patches/250-remove_domain_logon.patch b/net/samba36/patches/250-remove_domain_logon.patch new file mode 100644 index 0000000..2db6524 --- /dev/null +++ b/net/samba36/patches/250-remove_domain_logon.patch @@ -0,0 +1,185 @@ +--- a/source3/rpc_server/rpc_ep_setup.c ++++ b/source3/rpc_server/rpc_ep_setup.c +@@ -606,6 +606,7 @@ static bool samr_init_cb(void *ptr) + return true; + } + ++#ifdef NETLOGON_SUPPORT + static bool netlogon_init_cb(void *ptr) + { + struct dcesrv_ep_context *ep_ctx = +@@ -654,6 +655,7 @@ static bool netlogon_init_cb(void *ptr) + + return true; + } ++#endif + + static bool spoolss_init_cb(void *ptr) + { +@@ -1116,12 +1118,15 @@ bool dcesrv_ep_setup(struct tevent_conte + return false; + } + ++#ifdef NETLOGON_SUPPORT + netlogon_cb.init = netlogon_init_cb; + netlogon_cb.shutdown = NULL; + netlogon_cb.private_data = ep_ctx; + if (!NT_STATUS_IS_OK(rpc_netlogon_init(&netlogon_cb))) { + return false; + } ++#endif ++ + + rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM, + "rpc_server", +--- a/source3/librpc/rpc/rpc_common.c ++++ b/source3/librpc/rpc/rpc_common.c +@@ -103,9 +103,11 @@ static bool initialize_interfaces(void) + if (!smb_register_ndr_interface(&ndr_table_samr)) { + return false; + } ++#ifdef NETLOGON_SUPPORT + if (!smb_register_ndr_interface(&ndr_table_netlogon)) { + return false; + } ++#endif + if (!smb_register_ndr_interface(&ndr_table_srvsvc)) { + return false; + } +--- a/source3/smbd/server_exit.c ++++ b/source3/smbd/server_exit.c +@@ -157,7 +157,9 @@ static void exit_server_common(enum serv + rpc_winreg_shutdown(); + #endif + ++#ifdef NETLOGON_SUPPORT + rpc_netlogon_shutdown(); ++#endif + rpc_samr_shutdown(); + rpc_lsarpc_shutdown(); + } +--- a/source3/rpc_server/svcctl/srv_svcctl_nt.c ++++ b/source3/rpc_server/svcctl/srv_svcctl_nt.c +@@ -91,9 +91,11 @@ bool init_service_op_table( void ) + i++; + #endif + ++#ifdef NETLOGON_SUPPORT + svcctl_ops[i].name = talloc_strdup( svcctl_ops, "NETLOGON" ); + svcctl_ops[i].ops = &netlogon_svc_ops; + i++; ++#endif + + #ifdef WINREG_SUPPORT + svcctl_ops[i].name = talloc_strdup( svcctl_ops, "RemoteRegistry" ); +--- a/source3/nmbd/nmbd_processlogon.c ++++ b/source3/nmbd/nmbd_processlogon.c +@@ -320,6 +320,10 @@ void process_logon_packet(struct packet_ + NTSTATUS status; + const char *pdc_name; + ++#ifndef NETLOGON_SUPPORT ++ return; ++#endif ++ + in_addr_to_sockaddr_storage(&ss, p->ip); + pss = iface_ip((struct sockaddr *)&ss); + if (!pss) { +--- a/source3/rpcclient/rpcclient.c ++++ b/source3/rpcclient/rpcclient.c +@@ -627,7 +627,9 @@ static struct cmd_set *rpcclient_command + #ifdef PRINTER_SUPPORT + spoolss_commands, + #endif ++#ifdef NETLOGON_SUPPORT + netlogon_commands, ++#endif + srvsvc_commands, + #ifdef DFS_SUPPORT + dfs_commands, +--- a/source3/rpc_server/wkssvc/srv_wkssvc_nt.c ++++ b/source3/rpc_server/wkssvc/srv_wkssvc_nt.c +@@ -820,6 +820,10 @@ WERROR _wkssvc_NetrJoinDomain2(struct pi + WERROR werr; + struct security_token *token = p->session_info->security_token; + ++#ifndef NETLOGON_SUPPORT ++ return WERR_NOT_SUPPORTED; ++#endif ++ + if (!r->in.domain_name) { + return WERR_INVALID_PARAM; + } +@@ -897,6 +901,10 @@ WERROR _wkssvc_NetrUnjoinDomain2(struct + WERROR werr; + struct security_token *token = p->session_info->security_token; + ++#ifndef NETLOGON_SUPPORT ++ return WERR_NOT_SUPPORTED; ++#endif ++ + if (!r->in.account || !r->in.encrypted_password) { + return WERR_INVALID_PARAM; + } +--- a/source3/libsmb/trusts_util.c ++++ b/source3/libsmb/trusts_util.c +@@ -46,9 +46,11 @@ NTSTATUS trust_pw_change_and_store_it(st + NTSTATUS nt_status; + + switch (sec_channel_type) { ++#ifdef NETLOGON_SUPPORT + case SEC_CHAN_WKSTA: + case SEC_CHAN_DOMAIN: + break; ++#endif + default: + return NT_STATUS_NOT_SUPPORTED; + } +@@ -159,6 +161,11 @@ bool enumerate_domain_trusts( TALLOC_CTX + *num_domains = 0; + *sids = NULL; + ++#ifndef NETLOGON_SUPPORT ++ return False; ++#endif ++ ++ + /* lookup a DC first */ + + if ( !get_dc_name(domain, NULL, dc_name, &dc_ss) ) { +@@ -243,6 +250,10 @@ NTSTATUS change_trust_account_password( + struct cli_state *cli = NULL; + struct rpc_pipe_client *netlogon_pipe = NULL; + ++#ifndef NETLOGON_SUPPORT ++ return NT_STATUS_UNSUCCESSFUL; ++#endif ++ + DEBUG(5,("change_trust_account_password: Attempting to change trust account password in domain %s....\n", + domain)); + +--- a/source3/auth/auth_domain.c ++++ b/source3/auth/auth_domain.c +@@ -538,7 +538,9 @@ static NTSTATUS auth_init_trustdomain(st + + NTSTATUS auth_domain_init(void) + { ++#ifdef NETLOGON_SUPPORT + smb_register_auth(AUTH_INTERFACE_VERSION, "trustdomain", auth_init_trustdomain); + smb_register_auth(AUTH_INTERFACE_VERSION, "ntdomain", auth_init_ntdomain); ++#endif + return NT_STATUS_OK; + } +--- a/source3/smbd/process.c ++++ b/source3/smbd/process.c +@@ -2483,8 +2483,10 @@ static bool housekeeping_fn(const struct + /* check if we need to reload services */ + check_reload(sconn, time_mono(NULL)); + ++#ifdef NETLOGON_SUPPORT + /* Change machine password if neccessary. */ + attempt_machine_password_change(); ++#endif + + /* + * Force a log file check. diff --git a/net/samba36/patches/260-remove_samr.patch b/net/samba36/patches/260-remove_samr.patch new file mode 100644 index 0000000..b170077 --- /dev/null +++ b/net/samba36/patches/260-remove_samr.patch @@ -0,0 +1,155 @@ +--- a/source3/rpc_server/rpc_handles.c ++++ b/source3/rpc_server/rpc_handles.c +@@ -59,8 +59,11 @@ struct handle_list { + + static bool is_samr_lsa_pipe(const struct ndr_syntax_id *syntax) + { +- return (ndr_syntax_id_equal(syntax, &ndr_table_samr.syntax_id) +- || ndr_syntax_id_equal(syntax, &ndr_table_lsarpc.syntax_id)); ++ return ++#ifdef SAMR_SUPPORT ++ ndr_syntax_id_equal(syntax, &ndr_table_samr.syntax_id) || ++#endif ++ ndr_syntax_id_equal(syntax, &ndr_table_lsarpc.syntax_id); + } + + size_t num_pipe_handles(struct pipes_struct *p) +--- a/source3/librpc/rpc/rpc_common.c ++++ b/source3/librpc/rpc/rpc_common.c +@@ -100,9 +100,11 @@ static bool initialize_interfaces(void) + return false; + } + #endif ++#ifdef SAMR_SUPPORT + if (!smb_register_ndr_interface(&ndr_table_samr)) { + return false; + } ++#endif + #ifdef NETLOGON_SUPPORT + if (!smb_register_ndr_interface(&ndr_table_netlogon)) { + return false; +--- a/source3/rpc_server/rpc_ep_setup.c ++++ b/source3/rpc_server/rpc_ep_setup.c +@@ -557,6 +557,7 @@ static bool lsarpc_init_cb(void *ptr) + return true; + } + ++#ifdef SAMR_SUPPORT + static bool samr_init_cb(void *ptr) + { + struct dcesrv_ep_context *ep_ctx = +@@ -605,6 +606,7 @@ static bool samr_init_cb(void *ptr) + + return true; + } ++#endif + + #ifdef NETLOGON_SUPPORT + static bool netlogon_init_cb(void *ptr) +@@ -1111,12 +1113,14 @@ bool dcesrv_ep_setup(struct tevent_conte + return false; + } + ++#ifdef SAMR_SUPPORT + samr_cb.init = samr_init_cb; + samr_cb.shutdown = NULL; + samr_cb.private_data = ep_ctx; + if (!NT_STATUS_IS_OK(rpc_samr_init(&samr_cb))) { + return false; + } ++#endif + + #ifdef NETLOGON_SUPPORT + netlogon_cb.init = netlogon_init_cb; +--- a/source3/smbd/server_exit.c ++++ b/source3/smbd/server_exit.c +@@ -160,7 +160,9 @@ static void exit_server_common(enum serv + #ifdef NETLOGON_SUPPORT + rpc_netlogon_shutdown(); + #endif ++#ifdef SAMR_SUPPORT + rpc_samr_shutdown(); ++#endif + rpc_lsarpc_shutdown(); + } + +--- a/source3/rpcclient/rpcclient.c ++++ b/source3/rpcclient/rpcclient.c +@@ -623,7 +623,9 @@ static struct cmd_set *rpcclient_command + rpcclient_commands, + lsarpc_commands, + ds_commands, ++#ifdef SAMR_SUPPORT + samr_commands, ++#endif + #ifdef PRINTER_SUPPORT + spoolss_commands, + #endif +--- a/source3/smbd/lanman.c ++++ b/source3/smbd/lanman.c +@@ -2353,6 +2353,10 @@ static bool api_RNetGroupEnum(struct smb + NTSTATUS status, result; + struct dcerpc_binding_handle *b; + ++#ifndef SAMR_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -2541,6 +2545,10 @@ static bool api_NetUserGetGroups(struct + NTSTATUS status, result; + struct dcerpc_binding_handle *b; + ++#ifndef SAMR_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !UserName || !p) { + return False; + } +@@ -2733,6 +2741,10 @@ static bool api_RNetUserEnum(struct smbd + + struct dcerpc_binding_handle *b; + ++#ifndef SAMR_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -2979,6 +2991,10 @@ static bool api_SetUserPassword(struct s + int min_pwd_length; + struct dcerpc_binding_handle *b = NULL; + ++#ifndef SAMR_SUPPORT ++ return False; ++#endif ++ + /* Skip 2 strings. */ + p = skip_string(param,tpscnt,np); + p = skip_string(param,tpscnt,p); +@@ -3224,6 +3240,10 @@ static bool api_SamOEMChangePassword(str + int bufsize; + struct dcerpc_binding_handle *b; + ++#ifndef SAMR_SUPPORT ++ return False; ++#endif ++ + *rparam_len = 4; + *rparam = smb_realloc_limit(*rparam,*rparam_len); + if (!*rparam) { +@@ -4265,6 +4285,10 @@ static bool api_RNetUserGetInfo(struct s + union samr_UserInfo *info; + struct dcerpc_binding_handle *b = NULL; + ++#ifndef SAMR_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !UserName || !p) { + return False; + } diff --git a/net/samba36/patches/270-remove_registry_backend.patch b/net/samba36/patches/270-remove_registry_backend.patch new file mode 100644 index 0000000..a1cc877 --- /dev/null +++ b/net/samba36/patches/270-remove_registry_backend.patch @@ -0,0 +1,43 @@ +--- a/source3/lib/smbconf/smbconf_init.c ++++ b/source3/lib/smbconf/smbconf_init.c +@@ -68,9 +68,12 @@ sbcErr smbconf_init(TALLOC_CTX *mem_ctx, + } + } + ++#ifdef REGISTRY_BACKEND + if (strequal(backend, "registry") || strequal(backend, "reg")) { + err = smbconf_init_reg(mem_ctx, conf_ctx, path); +- } else if (strequal(backend, "file") || strequal(backend, "txt")) { ++ } else ++#endif ++ if (strequal(backend, "file") || strequal(backend, "txt")) { + err = smbconf_init_txt(mem_ctx, conf_ctx, path); + } else if (sep == NULL) { + /* +--- a/source3/lib/netapi/serverinfo.c ++++ b/source3/lib/netapi/serverinfo.c +@@ -557,7 +557,10 @@ static WERROR NetServerSetInfo_l_1005(st + return WERR_INVALID_PARAM; + } + +- if (!lp_config_backend_is_registry()) { ++#ifdef REGISTRY_BACKEND ++ if (!lp_config_backend_is_registry()) ++#endif ++ { + libnetapi_set_error_string(ctx, + "Configuration manipulation requested but not " + "supported by backend"); +--- a/source3/smbd/server.c ++++ b/source3/smbd/server.c +@@ -1210,8 +1210,10 @@ extern void build_options(bool screen); + exit(1); + } + ++#ifdef REGISTRY_BACKEND + if (!W_ERROR_IS_OK(registry_init_full())) + exit(1); ++#endif + + #ifdef PRINTER_SUPPORT + if (!print_backend_init(smbd_messaging_context())) diff --git a/net/samba36/patches/280-strip_srvsvc.patch b/net/samba36/patches/280-strip_srvsvc.patch new file mode 100644 index 0000000..b93e3fc --- /dev/null +++ b/net/samba36/patches/280-strip_srvsvc.patch @@ -0,0 +1,143 @@ +--- a/source3/smbd/lanman.c ++++ b/source3/smbd/lanman.c +@@ -2197,6 +2197,10 @@ static bool api_RNetShareAdd(struct smbd + struct srvsvc_NetShareInfo2 info2; + struct dcerpc_binding_handle *b; + ++#ifndef SRVSVC_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -3838,10 +3842,7 @@ static bool api_RNetServerGetInfo(struct + NTSTATUS status; + WERROR werr; + TALLOC_CTX *mem_ctx = talloc_tos(); +- struct rpc_pipe_client *cli = NULL; +- union srvsvc_NetSrvInfo info; + int errcode; +- struct dcerpc_binding_handle *b; + + if (!str1 || !str2 || !p) { + return False; +@@ -3904,66 +3905,16 @@ static bool api_RNetServerGetInfo(struct + p = *rdata; + p2 = p + struct_len; + +- status = rpc_pipe_open_interface(mem_ctx, &ndr_table_srvsvc.syntax_id, +- conn->session_info, +- &conn->sconn->client_id, +- conn->sconn->msg_ctx, +- &cli); +- if (!NT_STATUS_IS_OK(status)) { +- DEBUG(0,("api_RNetServerGetInfo: could not connect to srvsvc: %s\n", +- nt_errstr(status))); +- errcode = W_ERROR_V(ntstatus_to_werror(status)); +- goto out; +- } +- +- b = cli->binding_handle; +- +- status = dcerpc_srvsvc_NetSrvGetInfo(b, mem_ctx, +- NULL, +- 101, +- &info, +- &werr); +- if (!NT_STATUS_IS_OK(status)) { +- errcode = W_ERROR_V(ntstatus_to_werror(status)); +- goto out; +- } +- if (!W_ERROR_IS_OK(werr)) { +- errcode = W_ERROR_V(werr); +- goto out; +- } +- +- if (info.info101 == NULL) { +- errcode = W_ERROR_V(WERR_INVALID_PARAM); +- goto out; +- } +- + if (uLevel != 20) { +- srvstr_push(NULL, 0, p, info.info101->server_name, 16, ++ srvstr_push(NULL, 0, p, global_myname(), 16, + STR_ASCII|STR_UPPER|STR_TERMINATE); +- } ++ } + p += 16; + if (uLevel > 0) { +- SCVAL(p,0,info.info101->version_major); +- SCVAL(p,1,info.info101->version_minor); +- SIVAL(p,2,info.info101->server_type); +- +- if (mdrcnt == struct_len) { +- SIVAL(p,6,0); +- } else { +- SIVAL(p,6,PTR_DIFF(p2,*rdata)); +- if (mdrcnt - struct_len <= 0) { +- return false; +- } +- push_ascii(p2, +- info.info101->comment, +- MIN(mdrcnt - struct_len, +- MAX_SERVER_STRING_LENGTH), +- STR_TERMINATE); +- p2 = skip_string(*rdata,*rdata_len,p2); +- if (!p2) { +- return False; +- } +- } ++ SCVAL(p,0,lp_major_announce_version()); ++ SCVAL(p,1,lp_minor_announce_version()); ++ SIVAL(p,2,lp_default_server_announce()); ++ SIVAL(p,6,0); + } + + if (uLevel > 1) { +@@ -5654,6 +5605,10 @@ static bool api_RNetSessionEnum(struct s + uint32_t totalentries, resume_handle = 0; + uint32_t count = 0; + ++#ifndef SRVSVC_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +--- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c ++++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c +@@ -1533,6 +1533,10 @@ WERROR _srvsvc_NetShareSetInfo(struct pi + TALLOC_CTX *ctx = p->mem_ctx; + union srvsvc_NetShareInfo *info = r->in.info; + ++#ifndef FULL_SRVSVC ++ return WERR_ACCESS_DENIED; ++#endif ++ + DEBUG(5,("_srvsvc_NetShareSetInfo: %d\n", __LINE__)); + + if (!r->in.share_name) { +@@ -1763,6 +1767,10 @@ WERROR _srvsvc_NetShareAdd(struct pipes_ + int max_connections = 0; + TALLOC_CTX *ctx = p->mem_ctx; + ++#ifndef FULL_SRVSVC ++ return WERR_ACCESS_DENIED; ++#endif ++ + DEBUG(5,("_srvsvc_NetShareAdd: %d\n", __LINE__)); + + if (r->out.parm_error) { +@@ -1945,6 +1953,10 @@ WERROR _srvsvc_NetShareDel(struct pipes_ + struct share_params *params; + TALLOC_CTX *ctx = p->mem_ctx; + ++#ifndef FULL_SRVSVC ++ return WERR_ACCESS_DENIED; ++#endif ++ + DEBUG(5,("_srvsvc_NetShareDel: %d\n", __LINE__)); + + if (!r->in.share_name) { diff --git a/net/samba36/patches/290-remove_lsa.patch b/net/samba36/patches/290-remove_lsa.patch new file mode 100644 index 0000000..8fd48c4 --- /dev/null +++ b/net/samba36/patches/290-remove_lsa.patch @@ -0,0 +1,73 @@ +--- a/source3/librpc/rpc/rpc_common.c ++++ b/source3/librpc/rpc/rpc_common.c +@@ -92,9 +92,11 @@ bool smb_register_ndr_interface(const st + + static bool initialize_interfaces(void) + { ++#ifdef LSA_SUPPORT + if (!smb_register_ndr_interface(&ndr_table_lsarpc)) { + return false; + } ++#endif + #ifdef ACTIVE_DIRECTORY + if (!smb_register_ndr_interface(&ndr_table_dssetup)) { + return false; +--- a/source3/smbd/server_exit.c ++++ b/source3/smbd/server_exit.c +@@ -163,7 +163,9 @@ static void exit_server_common(enum serv + #ifdef SAMR_SUPPORT + rpc_samr_shutdown(); + #endif ++#ifdef LSA_SUPPORT + rpc_lsarpc_shutdown(); ++#endif + } + + /* +--- a/source3/rpc_server/rpc_ep_setup.c ++++ b/source3/rpc_server/rpc_ep_setup.c +@@ -508,6 +508,7 @@ static bool srvsvc_init_cb(void *ptr) + return true; + } + ++#ifdef LSA_SUPPORT + static bool lsarpc_init_cb(void *ptr) + { + struct dcesrv_ep_context *ep_ctx = +@@ -556,6 +557,7 @@ static bool lsarpc_init_cb(void *ptr) + + return true; + } ++#endif + + #ifdef SAMR_SUPPORT + static bool samr_init_cb(void *ptr) +@@ -1106,12 +1108,14 @@ bool dcesrv_ep_setup(struct tevent_conte + } + + ++#ifdef LSA_SUPPORT + lsarpc_cb.init = lsarpc_init_cb; + lsarpc_cb.shutdown = NULL; + lsarpc_cb.private_data = ep_ctx; + if (!NT_STATUS_IS_OK(rpc_lsarpc_init(&lsarpc_cb))) { + return false; + } ++#endif + + #ifdef SAMR_SUPPORT + samr_cb.init = samr_init_cb; +--- a/source3/rpc_server/rpc_handles.c ++++ b/source3/rpc_server/rpc_handles.c +@@ -63,7 +63,10 @@ static bool is_samr_lsa_pipe(const struc + #ifdef SAMR_SUPPORT + ndr_syntax_id_equal(syntax, &ndr_table_samr.syntax_id) || + #endif +- ndr_syntax_id_equal(syntax, &ndr_table_lsarpc.syntax_id); ++#ifdef LSA_SUPPORT ++ ndr_syntax_id_equal(syntax, &ndr_table_lsarpc.syntax_id) || ++#endif ++ false; + } + + size_t num_pipe_handles(struct pipes_struct *p) diff --git a/net/samba36/patches/300-assert_debug_level.patch b/net/samba36/patches/300-assert_debug_level.patch new file mode 100644 index 0000000..c5b0716 --- /dev/null +++ b/net/samba36/patches/300-assert_debug_level.patch @@ -0,0 +1,11 @@ +--- a/lib/util/util.h ++++ b/lib/util/util.h +@@ -53,7 +53,7 @@ extern const char *panic_action; + #else + /* redefine the assert macro for non-developer builds */ + #define SMB_ASSERT(b) do { if (!(b)) { \ +- DEBUG(0,("PANIC: assert failed at %s(%d): %s\n", \ ++ DEBUG(3,("PANIC: assert failed at %s(%d): %s\n", \ + __FILE__, __LINE__, #b)); }} while (0) + #endif + diff --git a/net/samba36/patches/310-remove_error_strings.patch b/net/samba36/patches/310-remove_error_strings.patch new file mode 100644 index 0000000..2adbc08 --- /dev/null +++ b/net/samba36/patches/310-remove_error_strings.patch @@ -0,0 +1,253 @@ +--- a/libcli/util/doserr.c ++++ b/libcli/util/doserr.c +@@ -28,6 +28,7 @@ struct werror_code_struct { + + static const struct werror_code_struct dos_errs[] = + { ++#ifdef VERBOSE_ERROR + { "WERR_OK", WERR_OK }, + { "WERR_BADFILE", WERR_BADFILE }, + { "WERR_ACCESS_DENIED", WERR_ACCESS_DENIED }, +@@ -2668,6 +2669,7 @@ static const struct werror_code_struct d + { "WERR_AMBIGUOUS_SYSTEM_DEVICE", WERR_AMBIGUOUS_SYSTEM_DEVICE }, + { "WERR_SYSTEM_DEVICE_NOT_FOUND", WERR_SYSTEM_DEVICE_NOT_FOUND }, + /* END GENERATED-WIN32-ERROR-CODES */ ++#endif + { NULL, W_ERROR(0) } + }; + +@@ -2684,12 +2686,14 @@ const char *win_errstr(WERROR werror) + static char msg[40]; + int idx = 0; + ++#ifdef VERBOSE_ERROR + while (dos_errs[idx].dos_errstr != NULL) { + if (W_ERROR_V(dos_errs[idx].werror) == + W_ERROR_V(werror)) + return dos_errs[idx].dos_errstr; + idx++; + } ++#endif + + slprintf(msg, sizeof(msg), "DOS code 0x%08x", W_ERROR_V(werror)); + +@@ -2702,6 +2706,7 @@ struct werror_str_struct { + }; + + const struct werror_str_struct dos_err_strs[] = { ++#ifdef VERBOSE_ERROR + { WERR_OK, "Success" }, + { WERR_ACCESS_DENIED, "Access is denied" }, + { WERR_INVALID_PARAM, "Invalid parameter" }, +@@ -5324,6 +5329,7 @@ const struct werror_str_struct dos_err_s + { WERR_AMBIGUOUS_SYSTEM_DEVICE, "The requested system device cannot be identified due to multiple indistinguishable devices potentially matching the identification criteria." }, + { WERR_SYSTEM_DEVICE_NOT_FOUND, "The requested system device cannot be found." }, + /* END GENERATED-WIN32-ERROR-CODES-DESC */ ++#endif + }; + + +@@ -5334,6 +5340,7 @@ const struct werror_str_struct dos_err_s + + const char *get_friendly_werror_msg(WERROR werror) + { ++#ifdef VERBOSE_ERROR + int i = 0; + + for (i = 0; i < ARRAY_SIZE(dos_err_strs); i++) { +@@ -5342,6 +5349,7 @@ const char *get_friendly_werror_msg(WERR + return dos_err_strs[i].friendly_errstr; + } + } ++#endif + + return win_errstr(werror); + } +--- a/librpc/ndr/libndr.h ++++ b/librpc/ndr/libndr.h +@@ -598,4 +598,20 @@ _PUBLIC_ enum ndr_err_code ndr_push_enum + + _PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b); + ++#ifndef VERBOSE_ERROR ++#define ndr_print_bool(...) do {} while (0) ++#define ndr_print_struct(...) do {} while (0) ++#define ndr_print_null(...) do {} while (0) ++#define ndr_print_enum(...) do {} while (0) ++#define ndr_print_bitmap_flag(...) do {} while (0) ++#define ndr_print_ptr(...) do {} while (0) ++#define ndr_print_union(...) do {} while (0) ++#define ndr_print_bad_level(...) do {} while (0) ++#define ndr_print_array_uint8(...) do {} while (0) ++#define ndr_print_string_array(...) do {} while (0) ++#define ndr_print_string_array(...) do {} while (0) ++#define ndr_print_NTSTATUS(...) do {} while (0) ++#define ndr_print_WERROR(...) do {} while (0) ++#endif ++ + #endif /* __LIBNDR_H__ */ +--- a/librpc/ndr/ndr_basic.c ++++ b/librpc/ndr/ndr_basic.c +@@ -31,6 +31,19 @@ + #define NDR_SIVAL(ndr, ofs, v) do { if (NDR_BE(ndr)) { RSIVAL(ndr->data,ofs,v); } else SIVAL(ndr->data,ofs,v); } while (0) + #define NDR_SIVALS(ndr, ofs, v) do { if (NDR_BE(ndr)) { RSIVALS(ndr->data,ofs,v); } else SIVALS(ndr->data,ofs,v); } while (0) + ++#undef ndr_print_bool ++#undef ndr_print_struct ++#undef ndr_print_null ++#undef ndr_print_enum ++#undef ndr_print_bitmap_flag ++#undef ndr_print_ptr ++#undef ndr_print_union ++#undef ndr_print_bad_level ++#undef ndr_print_array_uint8 ++#undef ndr_print_string_array ++#undef ndr_print_string_array ++#undef ndr_print_NTSTATUS ++#undef ndr_print_WERROR + + /* + check for data leaks from the server by looking for non-zero pad bytes +--- a/librpc/ndr/ndr_string.c ++++ b/librpc/ndr/ndr_string.c +@@ -588,6 +588,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_stri + return NDR_ERR_SUCCESS; + } + ++#undef ndr_print_string_array + _PUBLIC_ void ndr_print_string_array(struct ndr_print *ndr, const char *name, const char **a) + { + uint32_t count; +--- a/librpc/rpc/dcerpc_error.c ++++ b/librpc/rpc/dcerpc_error.c +@@ -31,6 +31,7 @@ struct dcerpc_fault_table { + static const struct dcerpc_fault_table dcerpc_faults[] = + { + #define _FAULT_STR(x) { #x , x } ++#ifdef VERBOSE_ERROR + _FAULT_STR(DCERPC_NCA_S_COMM_FAILURE), + _FAULT_STR(DCERPC_NCA_S_OP_RNG_ERROR), + _FAULT_STR(DCERPC_NCA_S_UNKNOWN_IF), +@@ -78,6 +79,7 @@ static const struct dcerpc_fault_table d + _FAULT_STR(DCERPC_NCA_S_FAULT_CODESET_CONV_ERROR), + _FAULT_STR(DCERPC_NCA_S_FAULT_OBJECT_NOT_FOUND), + _FAULT_STR(DCERPC_NCA_S_FAULT_NO_CLIENT_STUB), ++#endif + { NULL, 0 } + #undef _FAULT_STR + }; +@@ -87,12 +89,14 @@ _PUBLIC_ const char *dcerpc_errstr(TALLO + int idx = 0; + WERROR werr = W_ERROR(fault_code); + ++#ifdef VERBOSE_ERROR + while (dcerpc_faults[idx].errstr != NULL) { + if (dcerpc_faults[idx].faultcode == fault_code) { + return dcerpc_faults[idx].errstr; + } + idx++; + } ++#endif + + return win_errstr(werr); + } +--- a/source3/libsmb/nterr.c ++++ b/source3/libsmb/nterr.c +@@ -702,6 +702,7 @@ const char *nt_errstr(NTSTATUS nt_code) + NT_STATUS_DOS_CODE(nt_code)); + } + ++#ifdef VERBOSE_ERROR + while (nt_errs[idx].nt_errstr != NULL) { + if (NT_STATUS_V(nt_errs[idx].nt_errcode) == + NT_STATUS_V(nt_code)) { +@@ -709,6 +710,7 @@ const char *nt_errstr(NTSTATUS nt_code) + } + idx++; + } ++#endif + + result = talloc_asprintf(talloc_tos(), "NT code 0x%08x", + NT_STATUS_V(nt_code)); +@@ -724,12 +726,14 @@ const char *get_friendly_nt_error_msg(NT + { + int idx = 0; + ++#ifdef VERBOSE_ERROR + while (nt_err_desc[idx].nt_errstr != NULL) { + if (NT_STATUS_V(nt_err_desc[idx].nt_errcode) == NT_STATUS_V(nt_code)) { + return nt_err_desc[idx].nt_errstr; + } + idx++; + } ++#endif + + /* fall back to NT_STATUS_XXX string */ + +@@ -745,6 +749,7 @@ const char *get_nt_error_c_code(NTSTATUS + char *result; + int idx = 0; + ++#ifdef VERBOSE_ERROR + while (nt_errs[idx].nt_errstr != NULL) { + if (NT_STATUS_V(nt_errs[idx].nt_errcode) == + NT_STATUS_V(nt_code)) { +@@ -752,6 +757,7 @@ const char *get_nt_error_c_code(NTSTATUS + } + idx++; + } ++#endif + + result = talloc_asprintf(talloc_tos(), "NT_STATUS(0x%08x)", + NT_STATUS_V(nt_code)); +@@ -767,12 +773,14 @@ NTSTATUS nt_status_string_to_code(const + { + int idx = 0; + ++#ifdef VERBOSE_ERROR + while (nt_errs[idx].nt_errstr != NULL) { + if (strcasecmp(nt_errs[idx].nt_errstr, nt_status_str) == 0) { + return nt_errs[idx].nt_errcode; + } + idx++; + } ++#endif + return NT_STATUS_UNSUCCESSFUL; + } + +--- a/lib/tdb/common/tdb_private.h ++++ b/lib/tdb/common/tdb_private.h +@@ -69,7 +69,11 @@ typedef uint32_t tdb_off_t; + /* NB assumes there is a local variable called "tdb" that is the + * current context, also takes doubly-parenthesized print-style + * argument. */ ++#ifdef VERBOSE_DEBUG + #define TDB_LOG(x) tdb->log.log_fn x ++#else ++#define TDB_LOG(x) do {} while(0) ++#endif + + #ifdef TDB_TRACE + void tdb_trace(struct tdb_context *tdb, const char *op); +--- a/source3/script/mkbuildoptions.awk ++++ b/source3/script/mkbuildoptions.awk +@@ -55,7 +55,7 @@ BEGIN { + print "****************************************************************************/"; + print "void build_options(bool screen)"; + print "{"; +- print " if ((DEBUGLEVEL < 4) && (!screen)) {"; ++ print " if ((DEBUGLEVEL < 4) || (!screen)) {"; + print " return;"; + print " }"; + print ""; +--- a/source3/script/mkbuildoptions-waf.awk ++++ b/source3/script/mkbuildoptions-waf.awk +@@ -55,7 +55,7 @@ BEGIN { + print "****************************************************************************/"; + print "void build_options(bool screen)"; + print "{"; +- print " if ((DEBUGLEVEL < 4) && (!screen)) {"; ++ print " if ((DEBUGLEVEL < 4) || (!screen)) {"; + print " return;"; + print " }"; + print ""; diff --git a/net/samba36/patches/320-debug_level_checks.patch b/net/samba36/patches/320-debug_level_checks.patch new file mode 100644 index 0000000..c6f2e6e --- /dev/null +++ b/net/samba36/patches/320-debug_level_checks.patch @@ -0,0 +1,22 @@ +--- a/lib/util/debug.h ++++ b/lib/util/debug.h +@@ -45,7 +45,7 @@ bool dbghdr( int level, const char *loca + * Redefine DEBUGLEVEL because so we don't have to change every source file + * that *unnecessarily* references it. + */ +-#define DEBUGLEVEL DEBUGLEVEL_CLASS[DBGC_ALL] ++#define DEBUGLEVEL 0 + + /* + * Define all new debug classes here. A class is represented by an entry in +--- a/source3/nmbd/asyncdns.c ++++ b/source3/nmbd/asyncdns.c +@@ -85,7 +85,7 @@ static void asyncdns_process(void) + struct query_record r; + unstring qname; + +- DEBUGLEVEL = -1; ++ DEBUGLEVEL_CLASS[DBGC_ALL] = -1; + + while (1) { + NTSTATUS status; diff --git a/net/samba36/patches/330-librpc_default_print.patch b/net/samba36/patches/330-librpc_default_print.patch new file mode 100644 index 0000000..f17b1e2 --- /dev/null +++ b/net/samba36/patches/330-librpc_default_print.patch @@ -0,0 +1,8854 @@ +--- a/source3/librpc/ndr/util.c ++++ b/source3/librpc/ndr/util.c +@@ -28,3 +28,7 @@ _PUBLIC_ void ndr_print_sockaddr_storage + char addr[INET6_ADDRSTRLEN]; + ndr->print(ndr, "%-25s: %s", name, print_sockaddr(addr, sizeof(addr), ss)); + } ++ ++_PUBLIC_ void ndr_print_disabled(struct ndr_print *ndr, const char *name, int flags, void *r) ++{ ++} +--- a/source3/librpc/gen_ndr/ndr_atsvc.c ++++ b/source3/librpc/gen_ndr/ndr_atsvc.c +@@ -867,7 +867,7 @@ static const struct ndr_interface_call a + sizeof(struct atsvc_JobAdd), + (ndr_push_flags_fn_t) ndr_push_atsvc_JobAdd, + (ndr_pull_flags_fn_t) ndr_pull_atsvc_JobAdd, +- (ndr_print_function_t) ndr_print_atsvc_JobAdd, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -876,7 +876,7 @@ static const struct ndr_interface_call a + sizeof(struct atsvc_JobDel), + (ndr_push_flags_fn_t) ndr_push_atsvc_JobDel, + (ndr_pull_flags_fn_t) ndr_pull_atsvc_JobDel, +- (ndr_print_function_t) ndr_print_atsvc_JobDel, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -885,7 +885,7 @@ static const struct ndr_interface_call a + sizeof(struct atsvc_JobEnum), + (ndr_push_flags_fn_t) ndr_push_atsvc_JobEnum, + (ndr_pull_flags_fn_t) ndr_pull_atsvc_JobEnum, +- (ndr_print_function_t) ndr_print_atsvc_JobEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -894,7 +894,7 @@ static const struct ndr_interface_call a + sizeof(struct atsvc_JobGetInfo), + (ndr_push_flags_fn_t) ndr_push_atsvc_JobGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_atsvc_JobGetInfo, +- (ndr_print_function_t) ndr_print_atsvc_JobGetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_audiosrv.c ++++ b/source3/librpc/gen_ndr/ndr_audiosrv.c +@@ -594,7 +594,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_CreatezoneFactoriesList), + (ndr_push_flags_fn_t) ndr_push_audiosrv_CreatezoneFactoriesList, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_CreatezoneFactoriesList, +- (ndr_print_function_t) ndr_print_audiosrv_CreatezoneFactoriesList, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -603,7 +603,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_CreateGfxFactoriesList), + (ndr_push_flags_fn_t) ndr_push_audiosrv_CreateGfxFactoriesList, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_CreateGfxFactoriesList, +- (ndr_print_function_t) ndr_print_audiosrv_CreateGfxFactoriesList, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -612,7 +612,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_CreateGfxList), + (ndr_push_flags_fn_t) ndr_push_audiosrv_CreateGfxList, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_CreateGfxList, +- (ndr_print_function_t) ndr_print_audiosrv_CreateGfxList, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -621,7 +621,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_RemoveGfx), + (ndr_push_flags_fn_t) ndr_push_audiosrv_RemoveGfx, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_RemoveGfx, +- (ndr_print_function_t) ndr_print_audiosrv_RemoveGfx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -630,7 +630,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_AddGfx), + (ndr_push_flags_fn_t) ndr_push_audiosrv_AddGfx, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_AddGfx, +- (ndr_print_function_t) ndr_print_audiosrv_AddGfx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -639,7 +639,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_ModifyGfx), + (ndr_push_flags_fn_t) ndr_push_audiosrv_ModifyGfx, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_ModifyGfx, +- (ndr_print_function_t) ndr_print_audiosrv_ModifyGfx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -648,7 +648,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_OpenGfx), + (ndr_push_flags_fn_t) ndr_push_audiosrv_OpenGfx, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_OpenGfx, +- (ndr_print_function_t) ndr_print_audiosrv_OpenGfx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -657,7 +657,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_Logon), + (ndr_push_flags_fn_t) ndr_push_audiosrv_Logon, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_Logon, +- (ndr_print_function_t) ndr_print_audiosrv_Logon, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -666,7 +666,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_Logoff), + (ndr_push_flags_fn_t) ndr_push_audiosrv_Logoff, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_Logoff, +- (ndr_print_function_t) ndr_print_audiosrv_Logoff, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -675,7 +675,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_RegisterSessionNotificationEvent), + (ndr_push_flags_fn_t) ndr_push_audiosrv_RegisterSessionNotificationEvent, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_RegisterSessionNotificationEvent, +- (ndr_print_function_t) ndr_print_audiosrv_RegisterSessionNotificationEvent, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -684,7 +684,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_UnregisterSessionNotificationEvent), + (ndr_push_flags_fn_t) ndr_push_audiosrv_UnregisterSessionNotificationEvent, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_UnregisterSessionNotificationEvent, +- (ndr_print_function_t) ndr_print_audiosrv_UnregisterSessionNotificationEvent, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -693,7 +693,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_SessionConnectState), + (ndr_push_flags_fn_t) ndr_push_audiosrv_SessionConnectState, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_SessionConnectState, +- (ndr_print_function_t) ndr_print_audiosrv_SessionConnectState, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -702,7 +702,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_DriverOpenDrvRegKey), + (ndr_push_flags_fn_t) ndr_push_audiosrv_DriverOpenDrvRegKey, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_DriverOpenDrvRegKey, +- (ndr_print_function_t) ndr_print_audiosrv_DriverOpenDrvRegKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -711,7 +711,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_AdvisePreferredDeviceChange), + (ndr_push_flags_fn_t) ndr_push_audiosrv_AdvisePreferredDeviceChange, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_AdvisePreferredDeviceChange, +- (ndr_print_function_t) ndr_print_audiosrv_AdvisePreferredDeviceChange, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -720,7 +720,7 @@ static const struct ndr_interface_call a + sizeof(struct audiosrv_GetPnpInfo), + (ndr_push_flags_fn_t) ndr_push_audiosrv_GetPnpInfo, + (ndr_pull_flags_fn_t) ndr_pull_audiosrv_GetPnpInfo, +- (ndr_print_function_t) ndr_print_audiosrv_GetPnpInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_backupkey.c ++++ b/source3/librpc/gen_ndr/ndr_backupkey.c +@@ -740,7 +740,7 @@ static const struct ndr_interface_call b + sizeof(struct bkrp_BackupKey), + (ndr_push_flags_fn_t) ndr_push_bkrp_BackupKey, + (ndr_pull_flags_fn_t) ndr_pull_bkrp_BackupKey, +- (ndr_print_function_t) ndr_print_bkrp_BackupKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_browser.c ++++ b/source3/librpc/gen_ndr/ndr_browser.c +@@ -928,7 +928,7 @@ static const struct ndr_interface_call b + sizeof(struct BrowserrServerEnum), + (ndr_push_flags_fn_t) ndr_push_BrowserrServerEnum, + (ndr_pull_flags_fn_t) ndr_pull_BrowserrServerEnum, +- (ndr_print_function_t) ndr_print_BrowserrServerEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -937,7 +937,7 @@ static const struct ndr_interface_call b + sizeof(struct BrowserrDebugCall), + (ndr_push_flags_fn_t) ndr_push_BrowserrDebugCall, + (ndr_pull_flags_fn_t) ndr_pull_BrowserrDebugCall, +- (ndr_print_function_t) ndr_print_BrowserrDebugCall, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -946,7 +946,7 @@ static const struct ndr_interface_call b + sizeof(struct BrowserrQueryOtherDomains), + (ndr_push_flags_fn_t) ndr_push_BrowserrQueryOtherDomains, + (ndr_pull_flags_fn_t) ndr_pull_BrowserrQueryOtherDomains, +- (ndr_print_function_t) ndr_print_BrowserrQueryOtherDomains, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -955,7 +955,7 @@ static const struct ndr_interface_call b + sizeof(struct BrowserrResetNetlogonState), + (ndr_push_flags_fn_t) ndr_push_BrowserrResetNetlogonState, + (ndr_pull_flags_fn_t) ndr_pull_BrowserrResetNetlogonState, +- (ndr_print_function_t) ndr_print_BrowserrResetNetlogonState, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -964,7 +964,7 @@ static const struct ndr_interface_call b + sizeof(struct BrowserrDebugTrace), + (ndr_push_flags_fn_t) ndr_push_BrowserrDebugTrace, + (ndr_pull_flags_fn_t) ndr_pull_BrowserrDebugTrace, +- (ndr_print_function_t) ndr_print_BrowserrDebugTrace, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -973,7 +973,7 @@ static const struct ndr_interface_call b + sizeof(struct BrowserrQueryStatistics), + (ndr_push_flags_fn_t) ndr_push_BrowserrQueryStatistics, + (ndr_pull_flags_fn_t) ndr_pull_BrowserrQueryStatistics, +- (ndr_print_function_t) ndr_print_BrowserrQueryStatistics, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -982,7 +982,7 @@ static const struct ndr_interface_call b + sizeof(struct BrowserResetStatistics), + (ndr_push_flags_fn_t) ndr_push_BrowserResetStatistics, + (ndr_pull_flags_fn_t) ndr_pull_BrowserResetStatistics, +- (ndr_print_function_t) ndr_print_BrowserResetStatistics, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -991,7 +991,7 @@ static const struct ndr_interface_call b + sizeof(struct NetrBrowserStatisticsClear), + (ndr_push_flags_fn_t) ndr_push_NetrBrowserStatisticsClear, + (ndr_pull_flags_fn_t) ndr_pull_NetrBrowserStatisticsClear, +- (ndr_print_function_t) ndr_print_NetrBrowserStatisticsClear, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1000,7 +1000,7 @@ static const struct ndr_interface_call b + sizeof(struct NetrBrowserStatisticsGet), + (ndr_push_flags_fn_t) ndr_push_NetrBrowserStatisticsGet, + (ndr_pull_flags_fn_t) ndr_pull_NetrBrowserStatisticsGet, +- (ndr_print_function_t) ndr_print_NetrBrowserStatisticsGet, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1009,7 +1009,7 @@ static const struct ndr_interface_call b + sizeof(struct BrowserrSetNetlogonState), + (ndr_push_flags_fn_t) ndr_push_BrowserrSetNetlogonState, + (ndr_pull_flags_fn_t) ndr_pull_BrowserrSetNetlogonState, +- (ndr_print_function_t) ndr_print_BrowserrSetNetlogonState, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1018,7 +1018,7 @@ static const struct ndr_interface_call b + sizeof(struct BrowserrQueryEmulatedDomains), + (ndr_push_flags_fn_t) ndr_push_BrowserrQueryEmulatedDomains, + (ndr_pull_flags_fn_t) ndr_pull_BrowserrQueryEmulatedDomains, +- (ndr_print_function_t) ndr_print_BrowserrQueryEmulatedDomains, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1027,7 +1027,7 @@ static const struct ndr_interface_call b + sizeof(struct BrowserrServerEnumEx), + (ndr_push_flags_fn_t) ndr_push_BrowserrServerEnumEx, + (ndr_pull_flags_fn_t) ndr_pull_BrowserrServerEnumEx, +- (ndr_print_function_t) ndr_print_BrowserrServerEnumEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_dbgidl.c ++++ b/source3/librpc/gen_ndr/ndr_dbgidl.c +@@ -48,7 +48,7 @@ static const struct ndr_interface_call d + sizeof(struct dummy_dbgidl), + (ndr_push_flags_fn_t) ndr_push_dummy_dbgidl, + (ndr_pull_flags_fn_t) ndr_pull_dummy_dbgidl, +- (ndr_print_function_t) ndr_print_dummy_dbgidl, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_dcom.c ++++ b/source3/librpc/gen_ndr/ndr_dcom.c +@@ -128,7 +128,7 @@ static const struct ndr_interface_call d + sizeof(struct UseProtSeq), + (ndr_push_flags_fn_t) ndr_push_UseProtSeq, + (ndr_pull_flags_fn_t) ndr_pull_UseProtSeq, +- (ndr_print_function_t) ndr_print_UseProtSeq, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -137,7 +137,7 @@ static const struct ndr_interface_call d + sizeof(struct GetCustomProtseqInfo), + (ndr_push_flags_fn_t) ndr_push_GetCustomProtseqInfo, + (ndr_pull_flags_fn_t) ndr_pull_GetCustomProtseqInfo, +- (ndr_print_function_t) ndr_print_GetCustomProtseqInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -146,7 +146,7 @@ static const struct ndr_interface_call d + sizeof(struct UpdateResolverBindings), + (ndr_push_flags_fn_t) ndr_push_UpdateResolverBindings, + (ndr_pull_flags_fn_t) ndr_pull_UpdateResolverBindings, +- (ndr_print_function_t) ndr_print_UpdateResolverBindings, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -450,7 +450,7 @@ static const struct ndr_interface_call I + sizeof(struct QueryInterface), + (ndr_push_flags_fn_t) ndr_push_QueryInterface, + (ndr_pull_flags_fn_t) ndr_pull_QueryInterface, +- (ndr_print_function_t) ndr_print_QueryInterface, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -459,7 +459,7 @@ static const struct ndr_interface_call I + sizeof(struct AddRef), + (ndr_push_flags_fn_t) ndr_push_AddRef, + (ndr_pull_flags_fn_t) ndr_pull_AddRef, +- (ndr_print_function_t) ndr_print_AddRef, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -468,7 +468,7 @@ static const struct ndr_interface_call I + sizeof(struct Release), + (ndr_push_flags_fn_t) ndr_push_Release, + (ndr_pull_flags_fn_t) ndr_pull_Release, +- (ndr_print_function_t) ndr_print_Release, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -849,7 +849,7 @@ static const struct ndr_interface_call I + sizeof(struct CreateInstance), + (ndr_push_flags_fn_t) ndr_push_CreateInstance, + (ndr_pull_flags_fn_t) ndr_pull_CreateInstance, +- (ndr_print_function_t) ndr_print_CreateInstance, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -858,7 +858,7 @@ static const struct ndr_interface_call I + sizeof(struct RemoteCreateInstance), + (ndr_push_flags_fn_t) ndr_push_RemoteCreateInstance, + (ndr_pull_flags_fn_t) ndr_pull_RemoteCreateInstance, +- (ndr_print_function_t) ndr_print_RemoteCreateInstance, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -867,7 +867,7 @@ static const struct ndr_interface_call I + sizeof(struct LockServer), + (ndr_push_flags_fn_t) ndr_push_LockServer, + (ndr_pull_flags_fn_t) ndr_pull_LockServer, +- (ndr_print_function_t) ndr_print_LockServer, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -876,7 +876,7 @@ static const struct ndr_interface_call I + sizeof(struct RemoteLockServer), + (ndr_push_flags_fn_t) ndr_push_RemoteLockServer, + (ndr_pull_flags_fn_t) ndr_pull_RemoteLockServer, +- (ndr_print_function_t) ndr_print_RemoteLockServer, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1434,7 +1434,7 @@ static const struct ndr_interface_call I + sizeof(struct RemQueryInterface), + (ndr_push_flags_fn_t) ndr_push_RemQueryInterface, + (ndr_pull_flags_fn_t) ndr_pull_RemQueryInterface, +- (ndr_print_function_t) ndr_print_RemQueryInterface, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1443,7 +1443,7 @@ static const struct ndr_interface_call I + sizeof(struct RemAddRef), + (ndr_push_flags_fn_t) ndr_push_RemAddRef, + (ndr_pull_flags_fn_t) ndr_pull_RemAddRef, +- (ndr_print_function_t) ndr_print_RemAddRef, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1452,7 +1452,7 @@ static const struct ndr_interface_call I + sizeof(struct RemRelease), + (ndr_push_flags_fn_t) ndr_push_RemRelease, + (ndr_pull_flags_fn_t) ndr_pull_RemRelease, +- (ndr_print_function_t) ndr_print_RemRelease, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1590,7 +1590,7 @@ static const struct ndr_interface_call I + sizeof(struct GetClassObject), + (ndr_push_flags_fn_t) ndr_push_GetClassObject, + (ndr_pull_flags_fn_t) ndr_pull_GetClassObject, +- (ndr_print_function_t) ndr_print_GetClassObject, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1701,7 +1701,7 @@ static const struct ndr_interface_call I + sizeof(struct ISCMLocalActivator_CreateInstance), + (ndr_push_flags_fn_t) ndr_push_ISCMLocalActivator_CreateInstance, + (ndr_pull_flags_fn_t) ndr_pull_ISCMLocalActivator_CreateInstance, +- (ndr_print_function_t) ndr_print_ISCMLocalActivator_CreateInstance, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1788,7 +1788,7 @@ static const struct ndr_interface_call I + sizeof(struct IMachineLocalActivator_foo), + (ndr_push_flags_fn_t) ndr_push_IMachineLocalActivator_foo, + (ndr_pull_flags_fn_t) ndr_pull_IMachineLocalActivator_foo, +- (ndr_print_function_t) ndr_print_IMachineLocalActivator_foo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1875,7 +1875,7 @@ static const struct ndr_interface_call I + sizeof(struct ILocalObjectExporter_Foo), + (ndr_push_flags_fn_t) ndr_push_ILocalObjectExporter_Foo, + (ndr_pull_flags_fn_t) ndr_pull_ILocalObjectExporter_Foo, +- (ndr_print_function_t) ndr_print_ILocalObjectExporter_Foo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2031,7 +2031,7 @@ static const struct ndr_interface_call I + sizeof(struct ISystemActivatorRemoteCreateInstance), + (ndr_push_flags_fn_t) ndr_push_ISystemActivatorRemoteCreateInstance, + (ndr_pull_flags_fn_t) ndr_pull_ISystemActivatorRemoteCreateInstance, +- (ndr_print_function_t) ndr_print_ISystemActivatorRemoteCreateInstance, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2319,7 +2319,7 @@ static const struct ndr_interface_call I + sizeof(struct RemQueryInterface2), + (ndr_push_flags_fn_t) ndr_push_RemQueryInterface2, + (ndr_pull_flags_fn_t) ndr_pull_RemQueryInterface2, +- (ndr_print_function_t) ndr_print_RemQueryInterface2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3040,7 +3040,7 @@ static const struct ndr_interface_call I + sizeof(struct GetTypeInfoCount), + (ndr_push_flags_fn_t) ndr_push_GetTypeInfoCount, + (ndr_pull_flags_fn_t) ndr_pull_GetTypeInfoCount, +- (ndr_print_function_t) ndr_print_GetTypeInfoCount, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3049,7 +3049,7 @@ static const struct ndr_interface_call I + sizeof(struct GetTypeInfo), + (ndr_push_flags_fn_t) ndr_push_GetTypeInfo, + (ndr_pull_flags_fn_t) ndr_pull_GetTypeInfo, +- (ndr_print_function_t) ndr_print_GetTypeInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3058,7 +3058,7 @@ static const struct ndr_interface_call I + sizeof(struct GetIDsOfNames), + (ndr_push_flags_fn_t) ndr_push_GetIDsOfNames, + (ndr_pull_flags_fn_t) ndr_pull_GetIDsOfNames, +- (ndr_print_function_t) ndr_print_GetIDsOfNames, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3067,7 +3067,7 @@ static const struct ndr_interface_call I + sizeof(struct Invoke), + (ndr_push_flags_fn_t) ndr_push_Invoke, + (ndr_pull_flags_fn_t) ndr_pull_Invoke, +- (ndr_print_function_t) ndr_print_Invoke, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3243,7 +3243,7 @@ static const struct ndr_interface_call I + sizeof(struct MarshalInterface), + (ndr_push_flags_fn_t) ndr_push_MarshalInterface, + (ndr_pull_flags_fn_t) ndr_pull_MarshalInterface, +- (ndr_print_function_t) ndr_print_MarshalInterface, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3252,7 +3252,7 @@ static const struct ndr_interface_call I + sizeof(struct UnMarshalInterface), + (ndr_push_flags_fn_t) ndr_push_UnMarshalInterface, + (ndr_pull_flags_fn_t) ndr_pull_UnMarshalInterface, +- (ndr_print_function_t) ndr_print_UnMarshalInterface, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3385,7 +3385,7 @@ static const struct ndr_interface_call I + sizeof(struct MakeCoffee), + (ndr_push_flags_fn_t) ndr_push_MakeCoffee, + (ndr_pull_flags_fn_t) ndr_pull_MakeCoffee, +- (ndr_print_function_t) ndr_print_MakeCoffee, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3681,7 +3681,7 @@ static const struct ndr_interface_call I + sizeof(struct Read), + (ndr_push_flags_fn_t) ndr_push_Read, + (ndr_pull_flags_fn_t) ndr_pull_Read, +- (ndr_print_function_t) ndr_print_Read, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3690,7 +3690,7 @@ static const struct ndr_interface_call I + sizeof(struct Write), + (ndr_push_flags_fn_t) ndr_push_Write, + (ndr_pull_flags_fn_t) ndr_pull_Write, +- (ndr_print_function_t) ndr_print_Write, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_dfs.c ++++ b/source3/librpc/gen_ndr/ndr_dfs.c +@@ -5910,7 +5910,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_GetManagerVersion), + (ndr_push_flags_fn_t) ndr_push_dfs_GetManagerVersion, + (ndr_pull_flags_fn_t) ndr_pull_dfs_GetManagerVersion, +- (ndr_print_function_t) ndr_print_dfs_GetManagerVersion, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5919,7 +5919,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_Add), + (ndr_push_flags_fn_t) ndr_push_dfs_Add, + (ndr_pull_flags_fn_t) ndr_pull_dfs_Add, +- (ndr_print_function_t) ndr_print_dfs_Add, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5928,7 +5928,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_Remove), + (ndr_push_flags_fn_t) ndr_push_dfs_Remove, + (ndr_pull_flags_fn_t) ndr_pull_dfs_Remove, +- (ndr_print_function_t) ndr_print_dfs_Remove, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5937,7 +5937,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_SetInfo), + (ndr_push_flags_fn_t) ndr_push_dfs_SetInfo, + (ndr_pull_flags_fn_t) ndr_pull_dfs_SetInfo, +- (ndr_print_function_t) ndr_print_dfs_SetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5946,7 +5946,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_GetInfo), + (ndr_push_flags_fn_t) ndr_push_dfs_GetInfo, + (ndr_pull_flags_fn_t) ndr_pull_dfs_GetInfo, +- (ndr_print_function_t) ndr_print_dfs_GetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5955,7 +5955,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_Enum), + (ndr_push_flags_fn_t) ndr_push_dfs_Enum, + (ndr_pull_flags_fn_t) ndr_pull_dfs_Enum, +- (ndr_print_function_t) ndr_print_dfs_Enum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5964,7 +5964,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_Rename), + (ndr_push_flags_fn_t) ndr_push_dfs_Rename, + (ndr_pull_flags_fn_t) ndr_pull_dfs_Rename, +- (ndr_print_function_t) ndr_print_dfs_Rename, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5973,7 +5973,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_Move), + (ndr_push_flags_fn_t) ndr_push_dfs_Move, + (ndr_pull_flags_fn_t) ndr_pull_dfs_Move, +- (ndr_print_function_t) ndr_print_dfs_Move, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5982,7 +5982,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_ManagerGetConfigInfo), + (ndr_push_flags_fn_t) ndr_push_dfs_ManagerGetConfigInfo, + (ndr_pull_flags_fn_t) ndr_pull_dfs_ManagerGetConfigInfo, +- (ndr_print_function_t) ndr_print_dfs_ManagerGetConfigInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5991,7 +5991,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_ManagerSendSiteInfo), + (ndr_push_flags_fn_t) ndr_push_dfs_ManagerSendSiteInfo, + (ndr_pull_flags_fn_t) ndr_pull_dfs_ManagerSendSiteInfo, +- (ndr_print_function_t) ndr_print_dfs_ManagerSendSiteInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6000,7 +6000,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_AddFtRoot), + (ndr_push_flags_fn_t) ndr_push_dfs_AddFtRoot, + (ndr_pull_flags_fn_t) ndr_pull_dfs_AddFtRoot, +- (ndr_print_function_t) ndr_print_dfs_AddFtRoot, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6009,7 +6009,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_RemoveFtRoot), + (ndr_push_flags_fn_t) ndr_push_dfs_RemoveFtRoot, + (ndr_pull_flags_fn_t) ndr_pull_dfs_RemoveFtRoot, +- (ndr_print_function_t) ndr_print_dfs_RemoveFtRoot, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6018,7 +6018,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_AddStdRoot), + (ndr_push_flags_fn_t) ndr_push_dfs_AddStdRoot, + (ndr_pull_flags_fn_t) ndr_pull_dfs_AddStdRoot, +- (ndr_print_function_t) ndr_print_dfs_AddStdRoot, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6027,7 +6027,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_RemoveStdRoot), + (ndr_push_flags_fn_t) ndr_push_dfs_RemoveStdRoot, + (ndr_pull_flags_fn_t) ndr_pull_dfs_RemoveStdRoot, +- (ndr_print_function_t) ndr_print_dfs_RemoveStdRoot, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6036,7 +6036,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_ManagerInitialize), + (ndr_push_flags_fn_t) ndr_push_dfs_ManagerInitialize, + (ndr_pull_flags_fn_t) ndr_pull_dfs_ManagerInitialize, +- (ndr_print_function_t) ndr_print_dfs_ManagerInitialize, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6045,7 +6045,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_AddStdRootForced), + (ndr_push_flags_fn_t) ndr_push_dfs_AddStdRootForced, + (ndr_pull_flags_fn_t) ndr_pull_dfs_AddStdRootForced, +- (ndr_print_function_t) ndr_print_dfs_AddStdRootForced, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6054,7 +6054,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_GetDcAddress), + (ndr_push_flags_fn_t) ndr_push_dfs_GetDcAddress, + (ndr_pull_flags_fn_t) ndr_pull_dfs_GetDcAddress, +- (ndr_print_function_t) ndr_print_dfs_GetDcAddress, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6063,7 +6063,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_SetDcAddress), + (ndr_push_flags_fn_t) ndr_push_dfs_SetDcAddress, + (ndr_pull_flags_fn_t) ndr_pull_dfs_SetDcAddress, +- (ndr_print_function_t) ndr_print_dfs_SetDcAddress, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6072,7 +6072,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_FlushFtTable), + (ndr_push_flags_fn_t) ndr_push_dfs_FlushFtTable, + (ndr_pull_flags_fn_t) ndr_pull_dfs_FlushFtTable, +- (ndr_print_function_t) ndr_print_dfs_FlushFtTable, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6081,7 +6081,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_Add2), + (ndr_push_flags_fn_t) ndr_push_dfs_Add2, + (ndr_pull_flags_fn_t) ndr_pull_dfs_Add2, +- (ndr_print_function_t) ndr_print_dfs_Add2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6090,7 +6090,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_Remove2), + (ndr_push_flags_fn_t) ndr_push_dfs_Remove2, + (ndr_pull_flags_fn_t) ndr_pull_dfs_Remove2, +- (ndr_print_function_t) ndr_print_dfs_Remove2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6099,7 +6099,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_EnumEx), + (ndr_push_flags_fn_t) ndr_push_dfs_EnumEx, + (ndr_pull_flags_fn_t) ndr_pull_dfs_EnumEx, +- (ndr_print_function_t) ndr_print_dfs_EnumEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6108,7 +6108,7 @@ static const struct ndr_interface_call n + sizeof(struct dfs_SetInfo2), + (ndr_push_flags_fn_t) ndr_push_dfs_SetInfo2, + (ndr_pull_flags_fn_t) ndr_pull_dfs_SetInfo2, +- (ndr_print_function_t) ndr_print_dfs_SetInfo2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_dfsblobs.c ++++ b/source3/librpc/gen_ndr/ndr_dfsblobs.c +@@ -1398,7 +1398,7 @@ static const struct ndr_interface_call d + sizeof(struct dfs_GetDFSReferral), + (ndr_push_flags_fn_t) ndr_push_dfs_GetDFSReferral, + (ndr_pull_flags_fn_t) ndr_pull_dfs_GetDFSReferral, +- (ndr_print_function_t) ndr_print_dfs_GetDFSReferral, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_dns.c ++++ b/source3/librpc/gen_ndr/ndr_dns.c +@@ -860,7 +860,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_dns_name_packet), + (ndr_push_flags_fn_t) ndr_push_decode_dns_name_packet, + (ndr_pull_flags_fn_t) ndr_pull_decode_dns_name_packet, +- (ndr_print_function_t) ndr_print_decode_dns_name_packet, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_dnsp.c ++++ b/source3/librpc/gen_ndr/ndr_dnsp.c +@@ -700,7 +700,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_DnssrvRpcRecord), + (ndr_push_flags_fn_t) ndr_push_decode_DnssrvRpcRecord, + (ndr_pull_flags_fn_t) ndr_pull_decode_DnssrvRpcRecord, +- (ndr_print_function_t) ndr_print_decode_DnssrvRpcRecord, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_dnsserver.c ++++ b/source3/librpc/gen_ndr/ndr_dnsserver.c +@@ -48,7 +48,7 @@ static const struct ndr_interface_call d + sizeof(struct dnsserver_foo), + (ndr_push_flags_fn_t) ndr_push_dnsserver_foo, + (ndr_pull_flags_fn_t) ndr_pull_dnsserver_foo, +- (ndr_print_function_t) ndr_print_dnsserver_foo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_drsblobs.c ++++ b/source3/librpc/gen_ndr/ndr_drsblobs.c +@@ -5275,7 +5275,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_replPropertyMetaData), + (ndr_push_flags_fn_t) ndr_push_decode_replPropertyMetaData, + (ndr_pull_flags_fn_t) ndr_pull_decode_replPropertyMetaData, +- (ndr_print_function_t) ndr_print_decode_replPropertyMetaData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5284,7 +5284,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_replUpToDateVector), + (ndr_push_flags_fn_t) ndr_push_decode_replUpToDateVector, + (ndr_pull_flags_fn_t) ndr_pull_decode_replUpToDateVector, +- (ndr_print_function_t) ndr_print_decode_replUpToDateVector, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5293,7 +5293,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_repsFromTo), + (ndr_push_flags_fn_t) ndr_push_decode_repsFromTo, + (ndr_pull_flags_fn_t) ndr_pull_decode_repsFromTo, +- (ndr_print_function_t) ndr_print_decode_repsFromTo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5302,7 +5302,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_partialAttributeSet), + (ndr_push_flags_fn_t) ndr_push_decode_partialAttributeSet, + (ndr_pull_flags_fn_t) ndr_pull_decode_partialAttributeSet, +- (ndr_print_function_t) ndr_print_decode_partialAttributeSet, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5311,7 +5311,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_prefixMap), + (ndr_push_flags_fn_t) ndr_push_decode_prefixMap, + (ndr_pull_flags_fn_t) ndr_pull_decode_prefixMap, +- (ndr_print_function_t) ndr_print_decode_prefixMap, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5320,7 +5320,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_ldapControlDirSync), + (ndr_push_flags_fn_t) ndr_push_decode_ldapControlDirSync, + (ndr_pull_flags_fn_t) ndr_pull_decode_ldapControlDirSync, +- (ndr_print_function_t) ndr_print_decode_ldapControlDirSync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5329,7 +5329,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_supplementalCredentials), + (ndr_push_flags_fn_t) ndr_push_decode_supplementalCredentials, + (ndr_pull_flags_fn_t) ndr_pull_decode_supplementalCredentials, +- (ndr_print_function_t) ndr_print_decode_supplementalCredentials, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5338,7 +5338,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_Packages), + (ndr_push_flags_fn_t) ndr_push_decode_Packages, + (ndr_pull_flags_fn_t) ndr_pull_decode_Packages, +- (ndr_print_function_t) ndr_print_decode_Packages, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5347,7 +5347,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_PrimaryKerberos), + (ndr_push_flags_fn_t) ndr_push_decode_PrimaryKerberos, + (ndr_pull_flags_fn_t) ndr_pull_decode_PrimaryKerberos, +- (ndr_print_function_t) ndr_print_decode_PrimaryKerberos, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5356,7 +5356,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_PrimaryCLEARTEXT), + (ndr_push_flags_fn_t) ndr_push_decode_PrimaryCLEARTEXT, + (ndr_pull_flags_fn_t) ndr_pull_decode_PrimaryCLEARTEXT, +- (ndr_print_function_t) ndr_print_decode_PrimaryCLEARTEXT, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5365,7 +5365,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_PrimaryWDigest), + (ndr_push_flags_fn_t) ndr_push_decode_PrimaryWDigest, + (ndr_pull_flags_fn_t) ndr_pull_decode_PrimaryWDigest, +- (ndr_print_function_t) ndr_print_decode_PrimaryWDigest, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5374,7 +5374,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_trustAuthInOut), + (ndr_push_flags_fn_t) ndr_push_decode_trustAuthInOut, + (ndr_pull_flags_fn_t) ndr_pull_decode_trustAuthInOut, +- (ndr_print_function_t) ndr_print_decode_trustAuthInOut, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5383,7 +5383,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_trustDomainPasswords), + (ndr_push_flags_fn_t) ndr_push_decode_trustDomainPasswords, + (ndr_pull_flags_fn_t) ndr_pull_decode_trustDomainPasswords, +- (ndr_print_function_t) ndr_print_decode_trustDomainPasswords, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5392,7 +5392,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_ExtendedErrorInfo), + (ndr_push_flags_fn_t) ndr_push_decode_ExtendedErrorInfo, + (ndr_pull_flags_fn_t) ndr_pull_decode_ExtendedErrorInfo, +- (ndr_print_function_t) ndr_print_decode_ExtendedErrorInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5401,7 +5401,7 @@ static const struct ndr_interface_call d + sizeof(struct decode_ForestTrustInfo), + (ndr_push_flags_fn_t) ndr_push_decode_ForestTrustInfo, + (ndr_pull_flags_fn_t) ndr_pull_decode_ForestTrustInfo, +- (ndr_print_function_t) ndr_print_decode_ForestTrustInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_drsuapi.c ++++ b/source3/librpc/gen_ndr/ndr_drsuapi.c +@@ -16500,7 +16500,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsBind), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsBind, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsBind, +- (ndr_print_function_t) ndr_print_drsuapi_DsBind, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16509,7 +16509,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsUnbind), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsUnbind, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsUnbind, +- (ndr_print_function_t) ndr_print_drsuapi_DsUnbind, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16518,7 +16518,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsReplicaSync), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaSync, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaSync, +- (ndr_print_function_t) ndr_print_drsuapi_DsReplicaSync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16527,7 +16527,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsGetNCChanges), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetNCChanges, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetNCChanges, +- (ndr_print_function_t) ndr_print_drsuapi_DsGetNCChanges, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16536,7 +16536,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsReplicaUpdateRefs), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaUpdateRefs, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaUpdateRefs, +- (ndr_print_function_t) ndr_print_drsuapi_DsReplicaUpdateRefs, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16545,7 +16545,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsReplicaAdd), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaAdd, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaAdd, +- (ndr_print_function_t) ndr_print_drsuapi_DsReplicaAdd, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16554,7 +16554,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsReplicaDel), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaDel, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaDel, +- (ndr_print_function_t) ndr_print_drsuapi_DsReplicaDel, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16563,7 +16563,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsReplicaMod), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaMod, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaMod, +- (ndr_print_function_t) ndr_print_drsuapi_DsReplicaMod, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16572,7 +16572,7 @@ static const struct ndr_interface_call d + sizeof(struct DRSUAPI_VERIFY_NAMES), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_VERIFY_NAMES, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_VERIFY_NAMES, +- (ndr_print_function_t) ndr_print_DRSUAPI_VERIFY_NAMES, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16581,7 +16581,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsGetMemberships), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetMemberships, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetMemberships, +- (ndr_print_function_t) ndr_print_drsuapi_DsGetMemberships, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16590,7 +16590,7 @@ static const struct ndr_interface_call d + sizeof(struct DRSUAPI_INTER_DOMAIN_MOVE), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_INTER_DOMAIN_MOVE, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_INTER_DOMAIN_MOVE, +- (ndr_print_function_t) ndr_print_DRSUAPI_INTER_DOMAIN_MOVE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16599,7 +16599,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsGetNT4ChangeLog), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetNT4ChangeLog, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetNT4ChangeLog, +- (ndr_print_function_t) ndr_print_drsuapi_DsGetNT4ChangeLog, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16608,7 +16608,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsCrackNames), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsCrackNames, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsCrackNames, +- (ndr_print_function_t) ndr_print_drsuapi_DsCrackNames, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16617,7 +16617,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsWriteAccountSpn), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsWriteAccountSpn, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsWriteAccountSpn, +- (ndr_print_function_t) ndr_print_drsuapi_DsWriteAccountSpn, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16626,7 +16626,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsRemoveDSServer), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsRemoveDSServer, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsRemoveDSServer, +- (ndr_print_function_t) ndr_print_drsuapi_DsRemoveDSServer, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16635,7 +16635,7 @@ static const struct ndr_interface_call d + sizeof(struct DRSUAPI_REMOVE_DS_DOMAIN), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REMOVE_DS_DOMAIN, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REMOVE_DS_DOMAIN, +- (ndr_print_function_t) ndr_print_DRSUAPI_REMOVE_DS_DOMAIN, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16644,7 +16644,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsGetDomainControllerInfo), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetDomainControllerInfo, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetDomainControllerInfo, +- (ndr_print_function_t) ndr_print_drsuapi_DsGetDomainControllerInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16653,7 +16653,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsAddEntry), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsAddEntry, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsAddEntry, +- (ndr_print_function_t) ndr_print_drsuapi_DsAddEntry, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16662,7 +16662,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsExecuteKCC), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsExecuteKCC, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsExecuteKCC, +- (ndr_print_function_t) ndr_print_drsuapi_DsExecuteKCC, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16671,7 +16671,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsReplicaGetInfo), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaGetInfo, +- (ndr_print_function_t) ndr_print_drsuapi_DsReplicaGetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16680,7 +16680,7 @@ static const struct ndr_interface_call d + sizeof(struct DRSUAPI_ADD_SID_HISTORY), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_ADD_SID_HISTORY, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_ADD_SID_HISTORY, +- (ndr_print_function_t) ndr_print_DRSUAPI_ADD_SID_HISTORY, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16689,7 +16689,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_DsGetMemberships2), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetMemberships2, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetMemberships2, +- (ndr_print_function_t) ndr_print_drsuapi_DsGetMemberships2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16698,7 +16698,7 @@ static const struct ndr_interface_call d + sizeof(struct DRSUAPI_REPLICA_VERIFY_OBJECTS), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REPLICA_VERIFY_OBJECTS, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REPLICA_VERIFY_OBJECTS, +- (ndr_print_function_t) ndr_print_DRSUAPI_REPLICA_VERIFY_OBJECTS, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16707,7 +16707,7 @@ static const struct ndr_interface_call d + sizeof(struct DRSUAPI_GET_OBJECT_EXISTENCE), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_GET_OBJECT_EXISTENCE, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_GET_OBJECT_EXISTENCE, +- (ndr_print_function_t) ndr_print_DRSUAPI_GET_OBJECT_EXISTENCE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -16716,7 +16716,7 @@ static const struct ndr_interface_call d + sizeof(struct drsuapi_QuerySitesByCost), + (ndr_push_flags_fn_t) ndr_push_drsuapi_QuerySitesByCost, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_QuerySitesByCost, +- (ndr_print_function_t) ndr_print_drsuapi_QuerySitesByCost, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_dsbackup.c ++++ b/source3/librpc/gen_ndr/ndr_dsbackup.c +@@ -360,7 +360,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRBackupPrepare), + (ndr_push_flags_fn_t) ndr_push_HrRBackupPrepare, + (ndr_pull_flags_fn_t) ndr_pull_HrRBackupPrepare, +- (ndr_print_function_t) ndr_print_HrRBackupPrepare, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -369,7 +369,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRBackupEnd), + (ndr_push_flags_fn_t) ndr_push_HrRBackupEnd, + (ndr_pull_flags_fn_t) ndr_pull_HrRBackupEnd, +- (ndr_print_function_t) ndr_print_HrRBackupEnd, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -378,7 +378,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRBackupGetAttachmentInformation), + (ndr_push_flags_fn_t) ndr_push_HrRBackupGetAttachmentInformation, + (ndr_pull_flags_fn_t) ndr_pull_HrRBackupGetAttachmentInformation, +- (ndr_print_function_t) ndr_print_HrRBackupGetAttachmentInformation, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -387,7 +387,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRBackupOpenFile), + (ndr_push_flags_fn_t) ndr_push_HrRBackupOpenFile, + (ndr_pull_flags_fn_t) ndr_pull_HrRBackupOpenFile, +- (ndr_print_function_t) ndr_print_HrRBackupOpenFile, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -396,7 +396,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRBackupRead), + (ndr_push_flags_fn_t) ndr_push_HrRBackupRead, + (ndr_pull_flags_fn_t) ndr_pull_HrRBackupRead, +- (ndr_print_function_t) ndr_print_HrRBackupRead, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -405,7 +405,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRBackupClose), + (ndr_push_flags_fn_t) ndr_push_HrRBackupClose, + (ndr_pull_flags_fn_t) ndr_pull_HrRBackupClose, +- (ndr_print_function_t) ndr_print_HrRBackupClose, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -414,7 +414,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRBackupGetBackupLogs), + (ndr_push_flags_fn_t) ndr_push_HrRBackupGetBackupLogs, + (ndr_pull_flags_fn_t) ndr_pull_HrRBackupGetBackupLogs, +- (ndr_print_function_t) ndr_print_HrRBackupGetBackupLogs, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -423,7 +423,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRBackupTruncateLogs), + (ndr_push_flags_fn_t) ndr_push_HrRBackupTruncateLogs, + (ndr_pull_flags_fn_t) ndr_pull_HrRBackupTruncateLogs, +- (ndr_print_function_t) ndr_print_HrRBackupTruncateLogs, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -432,7 +432,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRBackupPing), + (ndr_push_flags_fn_t) ndr_push_HrRBackupPing, + (ndr_pull_flags_fn_t) ndr_pull_HrRBackupPing, +- (ndr_print_function_t) ndr_print_HrRBackupPing, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -789,7 +789,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRIsNTDSOnline), + (ndr_push_flags_fn_t) ndr_push_HrRIsNTDSOnline, + (ndr_pull_flags_fn_t) ndr_pull_HrRIsNTDSOnline, +- (ndr_print_function_t) ndr_print_HrRIsNTDSOnline, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -798,7 +798,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRRestorePrepare), + (ndr_push_flags_fn_t) ndr_push_HrRRestorePrepare, + (ndr_pull_flags_fn_t) ndr_pull_HrRRestorePrepare, +- (ndr_print_function_t) ndr_print_HrRRestorePrepare, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -807,7 +807,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRRestoreRegister), + (ndr_push_flags_fn_t) ndr_push_HrRRestoreRegister, + (ndr_pull_flags_fn_t) ndr_pull_HrRRestoreRegister, +- (ndr_print_function_t) ndr_print_HrRRestoreRegister, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -816,7 +816,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRRestoreRegisterComplete), + (ndr_push_flags_fn_t) ndr_push_HrRRestoreRegisterComplete, + (ndr_pull_flags_fn_t) ndr_pull_HrRRestoreRegisterComplete, +- (ndr_print_function_t) ndr_print_HrRRestoreRegisterComplete, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -825,7 +825,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRRestoreGetDatabaseLocations), + (ndr_push_flags_fn_t) ndr_push_HrRRestoreGetDatabaseLocations, + (ndr_pull_flags_fn_t) ndr_pull_HrRRestoreGetDatabaseLocations, +- (ndr_print_function_t) ndr_print_HrRRestoreGetDatabaseLocations, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -834,7 +834,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRRestoreEnd), + (ndr_push_flags_fn_t) ndr_push_HrRRestoreEnd, + (ndr_pull_flags_fn_t) ndr_pull_HrRRestoreEnd, +- (ndr_print_function_t) ndr_print_HrRRestoreEnd, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -843,7 +843,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRRestoreSetCurrentLogNumber), + (ndr_push_flags_fn_t) ndr_push_HrRRestoreSetCurrentLogNumber, + (ndr_pull_flags_fn_t) ndr_pull_HrRRestoreSetCurrentLogNumber, +- (ndr_print_function_t) ndr_print_HrRRestoreSetCurrentLogNumber, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -852,7 +852,7 @@ static const struct ndr_interface_call a + sizeof(struct HrRRestoreCheckLogsForBackup), + (ndr_push_flags_fn_t) ndr_push_HrRRestoreCheckLogsForBackup, + (ndr_pull_flags_fn_t) ndr_pull_HrRRestoreCheckLogsForBackup, +- (ndr_print_function_t) ndr_print_HrRRestoreCheckLogsForBackup, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_dssetup.c ++++ b/source3/librpc/gen_ndr/ndr_dssetup.c +@@ -995,7 +995,7 @@ static const struct ndr_interface_call d + sizeof(struct dssetup_DsRoleGetPrimaryDomainInformation), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetPrimaryDomainInformation, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetPrimaryDomainInformation, +- (ndr_print_function_t) ndr_print_dssetup_DsRoleGetPrimaryDomainInformation, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1004,7 +1004,7 @@ static const struct ndr_interface_call d + sizeof(struct dssetup_DsRoleDnsNameToFlatName), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDnsNameToFlatName, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDnsNameToFlatName, +- (ndr_print_function_t) ndr_print_dssetup_DsRoleDnsNameToFlatName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1013,7 +1013,7 @@ static const struct ndr_interface_call d + sizeof(struct dssetup_DsRoleDcAsDc), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDcAsDc, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDcAsDc, +- (ndr_print_function_t) ndr_print_dssetup_DsRoleDcAsDc, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1022,7 +1022,7 @@ static const struct ndr_interface_call d + sizeof(struct dssetup_DsRoleDcAsReplica), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDcAsReplica, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDcAsReplica, +- (ndr_print_function_t) ndr_print_dssetup_DsRoleDcAsReplica, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1031,7 +1031,7 @@ static const struct ndr_interface_call d + sizeof(struct dssetup_DsRoleDemoteDc), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDemoteDc, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDemoteDc, +- (ndr_print_function_t) ndr_print_dssetup_DsRoleDemoteDc, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1040,7 +1040,7 @@ static const struct ndr_interface_call d + sizeof(struct dssetup_DsRoleGetDcOperationProgress), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetDcOperationProgress, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetDcOperationProgress, +- (ndr_print_function_t) ndr_print_dssetup_DsRoleGetDcOperationProgress, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1049,7 +1049,7 @@ static const struct ndr_interface_call d + sizeof(struct dssetup_DsRoleGetDcOperationResults), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetDcOperationResults, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetDcOperationResults, +- (ndr_print_function_t) ndr_print_dssetup_DsRoleGetDcOperationResults, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1058,7 +1058,7 @@ static const struct ndr_interface_call d + sizeof(struct dssetup_DsRoleCancel), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleCancel, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleCancel, +- (ndr_print_function_t) ndr_print_dssetup_DsRoleCancel, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1067,7 +1067,7 @@ static const struct ndr_interface_call d + sizeof(struct dssetup_DsRoleServerSaveStateForUpgrade), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleServerSaveStateForUpgrade, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleServerSaveStateForUpgrade, +- (ndr_print_function_t) ndr_print_dssetup_DsRoleServerSaveStateForUpgrade, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1076,7 +1076,7 @@ static const struct ndr_interface_call d + sizeof(struct dssetup_DsRoleUpgradeDownlevelServer), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleUpgradeDownlevelServer, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleUpgradeDownlevelServer, +- (ndr_print_function_t) ndr_print_dssetup_DsRoleUpgradeDownlevelServer, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1085,7 +1085,7 @@ static const struct ndr_interface_call d + sizeof(struct dssetup_DsRoleAbortDownlevelServerUpgrade), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleAbortDownlevelServerUpgrade, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleAbortDownlevelServerUpgrade, +- (ndr_print_function_t) ndr_print_dssetup_DsRoleAbortDownlevelServerUpgrade, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_echo.c ++++ b/source3/librpc/gen_ndr/ndr_echo.c +@@ -1458,7 +1458,7 @@ static const struct ndr_interface_call r + sizeof(struct echo_AddOne), + (ndr_push_flags_fn_t) ndr_push_echo_AddOne, + (ndr_pull_flags_fn_t) ndr_pull_echo_AddOne, +- (ndr_print_function_t) ndr_print_echo_AddOne, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1467,7 +1467,7 @@ static const struct ndr_interface_call r + sizeof(struct echo_EchoData), + (ndr_push_flags_fn_t) ndr_push_echo_EchoData, + (ndr_pull_flags_fn_t) ndr_pull_echo_EchoData, +- (ndr_print_function_t) ndr_print_echo_EchoData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1476,7 +1476,7 @@ static const struct ndr_interface_call r + sizeof(struct echo_SinkData), + (ndr_push_flags_fn_t) ndr_push_echo_SinkData, + (ndr_pull_flags_fn_t) ndr_pull_echo_SinkData, +- (ndr_print_function_t) ndr_print_echo_SinkData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1485,7 +1485,7 @@ static const struct ndr_interface_call r + sizeof(struct echo_SourceData), + (ndr_push_flags_fn_t) ndr_push_echo_SourceData, + (ndr_pull_flags_fn_t) ndr_pull_echo_SourceData, +- (ndr_print_function_t) ndr_print_echo_SourceData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1494,7 +1494,7 @@ static const struct ndr_interface_call r + sizeof(struct echo_TestCall), + (ndr_push_flags_fn_t) ndr_push_echo_TestCall, + (ndr_pull_flags_fn_t) ndr_pull_echo_TestCall, +- (ndr_print_function_t) ndr_print_echo_TestCall, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1503,7 +1503,7 @@ static const struct ndr_interface_call r + sizeof(struct echo_TestCall2), + (ndr_push_flags_fn_t) ndr_push_echo_TestCall2, + (ndr_pull_flags_fn_t) ndr_pull_echo_TestCall2, +- (ndr_print_function_t) ndr_print_echo_TestCall2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1512,7 +1512,7 @@ static const struct ndr_interface_call r + sizeof(struct echo_TestSleep), + (ndr_push_flags_fn_t) ndr_push_echo_TestSleep, + (ndr_pull_flags_fn_t) ndr_pull_echo_TestSleep, +- (ndr_print_function_t) ndr_print_echo_TestSleep, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1521,7 +1521,7 @@ static const struct ndr_interface_call r + sizeof(struct echo_TestEnum), + (ndr_push_flags_fn_t) ndr_push_echo_TestEnum, + (ndr_pull_flags_fn_t) ndr_pull_echo_TestEnum, +- (ndr_print_function_t) ndr_print_echo_TestEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1530,7 +1530,7 @@ static const struct ndr_interface_call r + sizeof(struct echo_TestSurrounding), + (ndr_push_flags_fn_t) ndr_push_echo_TestSurrounding, + (ndr_pull_flags_fn_t) ndr_pull_echo_TestSurrounding, +- (ndr_print_function_t) ndr_print_echo_TestSurrounding, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1539,7 +1539,7 @@ static const struct ndr_interface_call r + sizeof(struct echo_TestDoublePointer), + (ndr_push_flags_fn_t) ndr_push_echo_TestDoublePointer, + (ndr_pull_flags_fn_t) ndr_pull_echo_TestDoublePointer, +- (ndr_print_function_t) ndr_print_echo_TestDoublePointer, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_efs.c ++++ b/source3/librpc/gen_ndr/ndr_efs.c +@@ -1327,7 +1327,7 @@ static const struct ndr_interface_call e + sizeof(struct EfsRpcOpenFileRaw), + (ndr_push_flags_fn_t) ndr_push_EfsRpcOpenFileRaw, + (ndr_pull_flags_fn_t) ndr_pull_EfsRpcOpenFileRaw, +- (ndr_print_function_t) ndr_print_EfsRpcOpenFileRaw, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1336,7 +1336,7 @@ static const struct ndr_interface_call e + sizeof(struct EfsRpcReadFileRaw), + (ndr_push_flags_fn_t) ndr_push_EfsRpcReadFileRaw, + (ndr_pull_flags_fn_t) ndr_pull_EfsRpcReadFileRaw, +- (ndr_print_function_t) ndr_print_EfsRpcReadFileRaw, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1345,7 +1345,7 @@ static const struct ndr_interface_call e + sizeof(struct EfsRpcWriteFileRaw), + (ndr_push_flags_fn_t) ndr_push_EfsRpcWriteFileRaw, + (ndr_pull_flags_fn_t) ndr_pull_EfsRpcWriteFileRaw, +- (ndr_print_function_t) ndr_print_EfsRpcWriteFileRaw, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1354,7 +1354,7 @@ static const struct ndr_interface_call e + sizeof(struct EfsRpcCloseRaw), + (ndr_push_flags_fn_t) ndr_push_EfsRpcCloseRaw, + (ndr_pull_flags_fn_t) ndr_pull_EfsRpcCloseRaw, +- (ndr_print_function_t) ndr_print_EfsRpcCloseRaw, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1363,7 +1363,7 @@ static const struct ndr_interface_call e + sizeof(struct EfsRpcEncryptFileSrv), + (ndr_push_flags_fn_t) ndr_push_EfsRpcEncryptFileSrv, + (ndr_pull_flags_fn_t) ndr_pull_EfsRpcEncryptFileSrv, +- (ndr_print_function_t) ndr_print_EfsRpcEncryptFileSrv, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1372,7 +1372,7 @@ static const struct ndr_interface_call e + sizeof(struct EfsRpcDecryptFileSrv), + (ndr_push_flags_fn_t) ndr_push_EfsRpcDecryptFileSrv, + (ndr_pull_flags_fn_t) ndr_pull_EfsRpcDecryptFileSrv, +- (ndr_print_function_t) ndr_print_EfsRpcDecryptFileSrv, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1381,7 +1381,7 @@ static const struct ndr_interface_call e + sizeof(struct EfsRpcQueryUsersOnFile), + (ndr_push_flags_fn_t) ndr_push_EfsRpcQueryUsersOnFile, + (ndr_pull_flags_fn_t) ndr_pull_EfsRpcQueryUsersOnFile, +- (ndr_print_function_t) ndr_print_EfsRpcQueryUsersOnFile, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1390,7 +1390,7 @@ static const struct ndr_interface_call e + sizeof(struct EfsRpcQueryRecoveryAgents), + (ndr_push_flags_fn_t) ndr_push_EfsRpcQueryRecoveryAgents, + (ndr_pull_flags_fn_t) ndr_pull_EfsRpcQueryRecoveryAgents, +- (ndr_print_function_t) ndr_print_EfsRpcQueryRecoveryAgents, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1399,7 +1399,7 @@ static const struct ndr_interface_call e + sizeof(struct EfsRpcRemoveUsersFromFile), + (ndr_push_flags_fn_t) ndr_push_EfsRpcRemoveUsersFromFile, + (ndr_pull_flags_fn_t) ndr_pull_EfsRpcRemoveUsersFromFile, +- (ndr_print_function_t) ndr_print_EfsRpcRemoveUsersFromFile, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1408,7 +1408,7 @@ static const struct ndr_interface_call e + sizeof(struct EfsRpcAddUsersToFile), + (ndr_push_flags_fn_t) ndr_push_EfsRpcAddUsersToFile, + (ndr_pull_flags_fn_t) ndr_pull_EfsRpcAddUsersToFile, +- (ndr_print_function_t) ndr_print_EfsRpcAddUsersToFile, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1417,7 +1417,7 @@ static const struct ndr_interface_call e + sizeof(struct EfsRpcSetFileEncryptionKey), + (ndr_push_flags_fn_t) ndr_push_EfsRpcSetFileEncryptionKey, + (ndr_pull_flags_fn_t) ndr_pull_EfsRpcSetFileEncryptionKey, +- (ndr_print_function_t) ndr_print_EfsRpcSetFileEncryptionKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1426,7 +1426,7 @@ static const struct ndr_interface_call e + sizeof(struct EfsRpcNotSupported), + (ndr_push_flags_fn_t) ndr_push_EfsRpcNotSupported, + (ndr_pull_flags_fn_t) ndr_pull_EfsRpcNotSupported, +- (ndr_print_function_t) ndr_print_EfsRpcNotSupported, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1435,7 +1435,7 @@ static const struct ndr_interface_call e + sizeof(struct EfsRpcFileKeyInfo), + (ndr_push_flags_fn_t) ndr_push_EfsRpcFileKeyInfo, + (ndr_pull_flags_fn_t) ndr_pull_EfsRpcFileKeyInfo, +- (ndr_print_function_t) ndr_print_EfsRpcFileKeyInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1444,7 +1444,7 @@ static const struct ndr_interface_call e + sizeof(struct EfsRpcDuplicateEncryptionInfoFile), + (ndr_push_flags_fn_t) ndr_push_EfsRpcDuplicateEncryptionInfoFile, + (ndr_pull_flags_fn_t) ndr_pull_EfsRpcDuplicateEncryptionInfoFile, +- (ndr_print_function_t) ndr_print_EfsRpcDuplicateEncryptionInfoFile, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_epmapper.c ++++ b/source3/librpc/gen_ndr/ndr_epmapper.c +@@ -2754,7 +2754,7 @@ static const struct ndr_interface_call e + sizeof(struct epm_Insert), + (ndr_push_flags_fn_t) ndr_push_epm_Insert, + (ndr_pull_flags_fn_t) ndr_pull_epm_Insert, +- (ndr_print_function_t) ndr_print_epm_Insert, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2763,7 +2763,7 @@ static const struct ndr_interface_call e + sizeof(struct epm_Delete), + (ndr_push_flags_fn_t) ndr_push_epm_Delete, + (ndr_pull_flags_fn_t) ndr_pull_epm_Delete, +- (ndr_print_function_t) ndr_print_epm_Delete, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2772,7 +2772,7 @@ static const struct ndr_interface_call e + sizeof(struct epm_Lookup), + (ndr_push_flags_fn_t) ndr_push_epm_Lookup, + (ndr_pull_flags_fn_t) ndr_pull_epm_Lookup, +- (ndr_print_function_t) ndr_print_epm_Lookup, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2781,7 +2781,7 @@ static const struct ndr_interface_call e + sizeof(struct epm_Map), + (ndr_push_flags_fn_t) ndr_push_epm_Map, + (ndr_pull_flags_fn_t) ndr_pull_epm_Map, +- (ndr_print_function_t) ndr_print_epm_Map, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2790,7 +2790,7 @@ static const struct ndr_interface_call e + sizeof(struct epm_LookupHandleFree), + (ndr_push_flags_fn_t) ndr_push_epm_LookupHandleFree, + (ndr_pull_flags_fn_t) ndr_pull_epm_LookupHandleFree, +- (ndr_print_function_t) ndr_print_epm_LookupHandleFree, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2799,7 +2799,7 @@ static const struct ndr_interface_call e + sizeof(struct epm_InqObject), + (ndr_push_flags_fn_t) ndr_push_epm_InqObject, + (ndr_pull_flags_fn_t) ndr_pull_epm_InqObject, +- (ndr_print_function_t) ndr_print_epm_InqObject, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2808,7 +2808,7 @@ static const struct ndr_interface_call e + sizeof(struct epm_MgmtDelete), + (ndr_push_flags_fn_t) ndr_push_epm_MgmtDelete, + (ndr_pull_flags_fn_t) ndr_pull_epm_MgmtDelete, +- (ndr_print_function_t) ndr_print_epm_MgmtDelete, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2817,7 +2817,7 @@ static const struct ndr_interface_call e + sizeof(struct epm_MapAuth), + (ndr_push_flags_fn_t) ndr_push_epm_MapAuth, + (ndr_pull_flags_fn_t) ndr_pull_epm_MapAuth, +- (ndr_print_function_t) ndr_print_epm_MapAuth, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_eventlog.c ++++ b/source3/librpc/gen_ndr/ndr_eventlog.c +@@ -2983,7 +2983,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_ClearEventLogW), + (ndr_push_flags_fn_t) ndr_push_eventlog_ClearEventLogW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ClearEventLogW, +- (ndr_print_function_t) ndr_print_eventlog_ClearEventLogW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2992,7 +2992,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_BackupEventLogW), + (ndr_push_flags_fn_t) ndr_push_eventlog_BackupEventLogW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_BackupEventLogW, +- (ndr_print_function_t) ndr_print_eventlog_BackupEventLogW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3001,7 +3001,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_CloseEventLog), + (ndr_push_flags_fn_t) ndr_push_eventlog_CloseEventLog, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_CloseEventLog, +- (ndr_print_function_t) ndr_print_eventlog_CloseEventLog, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3010,7 +3010,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_DeregisterEventSource), + (ndr_push_flags_fn_t) ndr_push_eventlog_DeregisterEventSource, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_DeregisterEventSource, +- (ndr_print_function_t) ndr_print_eventlog_DeregisterEventSource, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3019,7 +3019,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_GetNumRecords), + (ndr_push_flags_fn_t) ndr_push_eventlog_GetNumRecords, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_GetNumRecords, +- (ndr_print_function_t) ndr_print_eventlog_GetNumRecords, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3028,7 +3028,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_GetOldestRecord), + (ndr_push_flags_fn_t) ndr_push_eventlog_GetOldestRecord, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_GetOldestRecord, +- (ndr_print_function_t) ndr_print_eventlog_GetOldestRecord, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3037,7 +3037,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_ChangeNotify), + (ndr_push_flags_fn_t) ndr_push_eventlog_ChangeNotify, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ChangeNotify, +- (ndr_print_function_t) ndr_print_eventlog_ChangeNotify, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3046,7 +3046,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_OpenEventLogW), + (ndr_push_flags_fn_t) ndr_push_eventlog_OpenEventLogW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_OpenEventLogW, +- (ndr_print_function_t) ndr_print_eventlog_OpenEventLogW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3055,7 +3055,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_RegisterEventSourceW), + (ndr_push_flags_fn_t) ndr_push_eventlog_RegisterEventSourceW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_RegisterEventSourceW, +- (ndr_print_function_t) ndr_print_eventlog_RegisterEventSourceW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3064,7 +3064,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_OpenBackupEventLogW), + (ndr_push_flags_fn_t) ndr_push_eventlog_OpenBackupEventLogW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_OpenBackupEventLogW, +- (ndr_print_function_t) ndr_print_eventlog_OpenBackupEventLogW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3073,7 +3073,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_ReadEventLogW), + (ndr_push_flags_fn_t) ndr_push_eventlog_ReadEventLogW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ReadEventLogW, +- (ndr_print_function_t) ndr_print_eventlog_ReadEventLogW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3082,7 +3082,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_ReportEventW), + (ndr_push_flags_fn_t) ndr_push_eventlog_ReportEventW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ReportEventW, +- (ndr_print_function_t) ndr_print_eventlog_ReportEventW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3091,7 +3091,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_ClearEventLogA), + (ndr_push_flags_fn_t) ndr_push_eventlog_ClearEventLogA, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ClearEventLogA, +- (ndr_print_function_t) ndr_print_eventlog_ClearEventLogA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3100,7 +3100,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_BackupEventLogA), + (ndr_push_flags_fn_t) ndr_push_eventlog_BackupEventLogA, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_BackupEventLogA, +- (ndr_print_function_t) ndr_print_eventlog_BackupEventLogA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3109,7 +3109,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_OpenEventLogA), + (ndr_push_flags_fn_t) ndr_push_eventlog_OpenEventLogA, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_OpenEventLogA, +- (ndr_print_function_t) ndr_print_eventlog_OpenEventLogA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3118,7 +3118,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_RegisterEventSourceA), + (ndr_push_flags_fn_t) ndr_push_eventlog_RegisterEventSourceA, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_RegisterEventSourceA, +- (ndr_print_function_t) ndr_print_eventlog_RegisterEventSourceA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3127,7 +3127,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_OpenBackupEventLogA), + (ndr_push_flags_fn_t) ndr_push_eventlog_OpenBackupEventLogA, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_OpenBackupEventLogA, +- (ndr_print_function_t) ndr_print_eventlog_OpenBackupEventLogA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3136,7 +3136,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_ReadEventLogA), + (ndr_push_flags_fn_t) ndr_push_eventlog_ReadEventLogA, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ReadEventLogA, +- (ndr_print_function_t) ndr_print_eventlog_ReadEventLogA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3145,7 +3145,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_ReportEventA), + (ndr_push_flags_fn_t) ndr_push_eventlog_ReportEventA, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ReportEventA, +- (ndr_print_function_t) ndr_print_eventlog_ReportEventA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3154,7 +3154,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_RegisterClusterSvc), + (ndr_push_flags_fn_t) ndr_push_eventlog_RegisterClusterSvc, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_RegisterClusterSvc, +- (ndr_print_function_t) ndr_print_eventlog_RegisterClusterSvc, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3163,7 +3163,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_DeregisterClusterSvc), + (ndr_push_flags_fn_t) ndr_push_eventlog_DeregisterClusterSvc, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_DeregisterClusterSvc, +- (ndr_print_function_t) ndr_print_eventlog_DeregisterClusterSvc, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3172,7 +3172,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_WriteClusterEvents), + (ndr_push_flags_fn_t) ndr_push_eventlog_WriteClusterEvents, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_WriteClusterEvents, +- (ndr_print_function_t) ndr_print_eventlog_WriteClusterEvents, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3181,7 +3181,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_GetLogInformation), + (ndr_push_flags_fn_t) ndr_push_eventlog_GetLogInformation, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_GetLogInformation, +- (ndr_print_function_t) ndr_print_eventlog_GetLogInformation, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3190,7 +3190,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_FlushEventLog), + (ndr_push_flags_fn_t) ndr_push_eventlog_FlushEventLog, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_FlushEventLog, +- (ndr_print_function_t) ndr_print_eventlog_FlushEventLog, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3199,7 +3199,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog_ReportEventAndSourceW), + (ndr_push_flags_fn_t) ndr_push_eventlog_ReportEventAndSourceW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ReportEventAndSourceW, +- (ndr_print_function_t) ndr_print_eventlog_ReportEventAndSourceW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_eventlog6.c ++++ b/source3/librpc/gen_ndr/ndr_eventlog6.c +@@ -5482,7 +5482,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcRegisterRemoteSubscription), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcRegisterRemoteSubscription, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcRegisterRemoteSubscription, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcRegisterRemoteSubscription, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5491,7 +5491,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcRemoteSubscriptionNextAsync), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcRemoteSubscriptionNextAsync, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcRemoteSubscriptionNextAsync, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcRemoteSubscriptionNextAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5500,7 +5500,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcRemoteSubscriptionNext), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcRemoteSubscriptionNext, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcRemoteSubscriptionNext, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcRemoteSubscriptionNext, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5509,7 +5509,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcRemoteSubscriptionWaitAsync), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcRemoteSubscriptionWaitAsync, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcRemoteSubscriptionWaitAsync, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcRemoteSubscriptionWaitAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5518,7 +5518,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcRegisterControllableOperation), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcRegisterControllableOperation, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcRegisterControllableOperation, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcRegisterControllableOperation, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5527,7 +5527,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcRegisterLogQuery), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcRegisterLogQuery, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcRegisterLogQuery, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcRegisterLogQuery, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5536,7 +5536,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcClearLog), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcClearLog, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcClearLog, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcClearLog, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5545,7 +5545,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcExportLog), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcExportLog, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcExportLog, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcExportLog, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5554,7 +5554,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcLocalizeExportLog), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcLocalizeExportLog, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcLocalizeExportLog, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcLocalizeExportLog, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5563,7 +5563,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcMessageRender), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcMessageRender, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcMessageRender, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcMessageRender, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5572,7 +5572,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcMessageRenderDefault), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcMessageRenderDefault, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcMessageRenderDefault, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcMessageRenderDefault, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5581,7 +5581,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcQueryNext), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcQueryNext, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcQueryNext, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcQueryNext, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5590,7 +5590,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcQuerySeek), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcQuerySeek, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcQuerySeek, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcQuerySeek, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5599,7 +5599,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcClose), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcClose, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcClose, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcClose, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5608,7 +5608,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcCancel), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcCancel, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcCancel, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcCancel, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5617,7 +5617,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcAssertConfig), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcAssertConfig, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcAssertConfig, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcAssertConfig, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5626,7 +5626,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcRetractConfig), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcRetractConfig, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcRetractConfig, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcRetractConfig, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5635,7 +5635,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcOpenLogHandle), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcOpenLogHandle, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcOpenLogHandle, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcOpenLogHandle, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5644,7 +5644,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcGetLogFileInfo), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcGetLogFileInfo, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcGetLogFileInfo, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcGetLogFileInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5653,7 +5653,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcGetChannelList), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcGetChannelList, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcGetChannelList, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcGetChannelList, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5662,7 +5662,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcGetChannelConfig), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcGetChannelConfig, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcGetChannelConfig, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcGetChannelConfig, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5671,7 +5671,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcPutChannelConfig), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcPutChannelConfig, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcPutChannelConfig, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcPutChannelConfig, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5680,7 +5680,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcGetPublisherList), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcGetPublisherList, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcGetPublisherList, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcGetPublisherList, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5689,7 +5689,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcGetPublisherListForChannel), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcGetPublisherListForChannel, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcGetPublisherListForChannel, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcGetPublisherListForChannel, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5698,7 +5698,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcGetPublisherMetadata), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcGetPublisherMetadata, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcGetPublisherMetadata, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcGetPublisherMetadata, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5707,7 +5707,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcGetPublisherResourceMetadata), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcGetPublisherResourceMetadata, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcGetPublisherResourceMetadata, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcGetPublisherResourceMetadata, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5716,7 +5716,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcGetEventMetadataEnum), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcGetEventMetadataEnum, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcGetEventMetadataEnum, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcGetEventMetadataEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5725,7 +5725,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcGetNextEventMetadata), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcGetNextEventMetadata, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcGetNextEventMetadata, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcGetNextEventMetadata, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5734,7 +5734,7 @@ static const struct ndr_interface_call e + sizeof(struct eventlog6_EvtRpcGetClassicLogDisplayName), + (ndr_push_flags_fn_t) ndr_push_eventlog6_EvtRpcGetClassicLogDisplayName, + (ndr_pull_flags_fn_t) ndr_pull_eventlog6_EvtRpcGetClassicLogDisplayName, +- (ndr_print_function_t) ndr_print_eventlog6_EvtRpcGetClassicLogDisplayName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_frsapi.c ++++ b/source3/librpc/gen_ndr/ndr_frsapi.c +@@ -979,7 +979,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSAPI_VERIFY_PROMOTION), + (ndr_push_flags_fn_t) ndr_push_FRSAPI_VERIFY_PROMOTION, + (ndr_pull_flags_fn_t) ndr_pull_FRSAPI_VERIFY_PROMOTION, +- (ndr_print_function_t) ndr_print_FRSAPI_VERIFY_PROMOTION, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -988,7 +988,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSAPI_PROMOTION_STATUS), + (ndr_push_flags_fn_t) ndr_push_FRSAPI_PROMOTION_STATUS, + (ndr_pull_flags_fn_t) ndr_pull_FRSAPI_PROMOTION_STATUS, +- (ndr_print_function_t) ndr_print_FRSAPI_PROMOTION_STATUS, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -997,7 +997,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSAPI_START_DEMOTION), + (ndr_push_flags_fn_t) ndr_push_FRSAPI_START_DEMOTION, + (ndr_pull_flags_fn_t) ndr_pull_FRSAPI_START_DEMOTION, +- (ndr_print_function_t) ndr_print_FRSAPI_START_DEMOTION, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1006,7 +1006,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSAPI_COMMIT_DEMOTION), + (ndr_push_flags_fn_t) ndr_push_FRSAPI_COMMIT_DEMOTION, + (ndr_pull_flags_fn_t) ndr_pull_FRSAPI_COMMIT_DEMOTION, +- (ndr_print_function_t) ndr_print_FRSAPI_COMMIT_DEMOTION, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1015,7 +1015,7 @@ static const struct ndr_interface_call f + sizeof(struct frsapi_SetDsPollingIntervalW), + (ndr_push_flags_fn_t) ndr_push_frsapi_SetDsPollingIntervalW, + (ndr_pull_flags_fn_t) ndr_pull_frsapi_SetDsPollingIntervalW, +- (ndr_print_function_t) ndr_print_frsapi_SetDsPollingIntervalW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1024,7 +1024,7 @@ static const struct ndr_interface_call f + sizeof(struct frsapi_GetDsPollingIntervalW), + (ndr_push_flags_fn_t) ndr_push_frsapi_GetDsPollingIntervalW, + (ndr_pull_flags_fn_t) ndr_pull_frsapi_GetDsPollingIntervalW, +- (ndr_print_function_t) ndr_print_frsapi_GetDsPollingIntervalW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1033,7 +1033,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSAPI_VERIFY_PROMOTION_W), + (ndr_push_flags_fn_t) ndr_push_FRSAPI_VERIFY_PROMOTION_W, + (ndr_pull_flags_fn_t) ndr_pull_FRSAPI_VERIFY_PROMOTION_W, +- (ndr_print_function_t) ndr_print_FRSAPI_VERIFY_PROMOTION_W, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1042,7 +1042,7 @@ static const struct ndr_interface_call f + sizeof(struct frsapi_InfoW), + (ndr_push_flags_fn_t) ndr_push_frsapi_InfoW, + (ndr_pull_flags_fn_t) ndr_pull_frsapi_InfoW, +- (ndr_print_function_t) ndr_print_frsapi_InfoW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1051,7 +1051,7 @@ static const struct ndr_interface_call f + sizeof(struct frsapi_IsPathReplicated), + (ndr_push_flags_fn_t) ndr_push_frsapi_IsPathReplicated, + (ndr_pull_flags_fn_t) ndr_pull_frsapi_IsPathReplicated, +- (ndr_print_function_t) ndr_print_frsapi_IsPathReplicated, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1060,7 +1060,7 @@ static const struct ndr_interface_call f + sizeof(struct frsapi_WriterCommand), + (ndr_push_flags_fn_t) ndr_push_frsapi_WriterCommand, + (ndr_pull_flags_fn_t) ndr_pull_frsapi_WriterCommand, +- (ndr_print_function_t) ndr_print_frsapi_WriterCommand, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1069,7 +1069,7 @@ static const struct ndr_interface_call f + sizeof(struct frsapi_ForceReplication), + (ndr_push_flags_fn_t) ndr_push_frsapi_ForceReplication, + (ndr_pull_flags_fn_t) ndr_pull_frsapi_ForceReplication, +- (ndr_print_function_t) ndr_print_frsapi_ForceReplication, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_frsrpc.c ++++ b/source3/librpc/gen_ndr/ndr_frsrpc.c +@@ -2781,7 +2781,7 @@ static const struct ndr_interface_call f + sizeof(struct frsrpc_FrsSendCommPkt), + (ndr_push_flags_fn_t) ndr_push_frsrpc_FrsSendCommPkt, + (ndr_pull_flags_fn_t) ndr_pull_frsrpc_FrsSendCommPkt, +- (ndr_print_function_t) ndr_print_frsrpc_FrsSendCommPkt, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2790,7 +2790,7 @@ static const struct ndr_interface_call f + sizeof(struct frsrpc_FrsVerifyPromotionParent), + (ndr_push_flags_fn_t) ndr_push_frsrpc_FrsVerifyPromotionParent, + (ndr_pull_flags_fn_t) ndr_pull_frsrpc_FrsVerifyPromotionParent, +- (ndr_print_function_t) ndr_print_frsrpc_FrsVerifyPromotionParent, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2799,7 +2799,7 @@ static const struct ndr_interface_call f + sizeof(struct frsrpc_FrsStartPromotionParent), + (ndr_push_flags_fn_t) ndr_push_frsrpc_FrsStartPromotionParent, + (ndr_pull_flags_fn_t) ndr_pull_frsrpc_FrsStartPromotionParent, +- (ndr_print_function_t) ndr_print_frsrpc_FrsStartPromotionParent, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2808,7 +2808,7 @@ static const struct ndr_interface_call f + sizeof(struct frsrpc_FrsNOP), + (ndr_push_flags_fn_t) ndr_push_frsrpc_FrsNOP, + (ndr_pull_flags_fn_t) ndr_pull_frsrpc_FrsNOP, +- (ndr_print_function_t) ndr_print_frsrpc_FrsNOP, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2817,7 +2817,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSRPC_BACKUP_COMPLETE), + (ndr_push_flags_fn_t) ndr_push_FRSRPC_BACKUP_COMPLETE, + (ndr_pull_flags_fn_t) ndr_pull_FRSRPC_BACKUP_COMPLETE, +- (ndr_print_function_t) ndr_print_FRSRPC_BACKUP_COMPLETE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2826,7 +2826,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSRPC_BACKUP_COMPLETE_5), + (ndr_push_flags_fn_t) ndr_push_FRSRPC_BACKUP_COMPLETE_5, + (ndr_pull_flags_fn_t) ndr_pull_FRSRPC_BACKUP_COMPLETE_5, +- (ndr_print_function_t) ndr_print_FRSRPC_BACKUP_COMPLETE_5, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2835,7 +2835,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSRPC_BACKUP_COMPLETE_6), + (ndr_push_flags_fn_t) ndr_push_FRSRPC_BACKUP_COMPLETE_6, + (ndr_pull_flags_fn_t) ndr_pull_FRSRPC_BACKUP_COMPLETE_6, +- (ndr_print_function_t) ndr_print_FRSRPC_BACKUP_COMPLETE_6, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2844,7 +2844,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSRPC_BACKUP_COMPLETE_7), + (ndr_push_flags_fn_t) ndr_push_FRSRPC_BACKUP_COMPLETE_7, + (ndr_pull_flags_fn_t) ndr_pull_FRSRPC_BACKUP_COMPLETE_7, +- (ndr_print_function_t) ndr_print_FRSRPC_BACKUP_COMPLETE_7, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2853,7 +2853,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSRPC_BACKUP_COMPLETE_8), + (ndr_push_flags_fn_t) ndr_push_FRSRPC_BACKUP_COMPLETE_8, + (ndr_pull_flags_fn_t) ndr_pull_FRSRPC_BACKUP_COMPLETE_8, +- (ndr_print_function_t) ndr_print_FRSRPC_BACKUP_COMPLETE_8, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2862,7 +2862,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSRPC_BACKUP_COMPLETE_9), + (ndr_push_flags_fn_t) ndr_push_FRSRPC_BACKUP_COMPLETE_9, + (ndr_pull_flags_fn_t) ndr_pull_FRSRPC_BACKUP_COMPLETE_9, +- (ndr_print_function_t) ndr_print_FRSRPC_BACKUP_COMPLETE_9, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2871,7 +2871,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSRPC_VERIFY_PROMOTION_PARENT_EX), + (ndr_push_flags_fn_t) ndr_push_FRSRPC_VERIFY_PROMOTION_PARENT_EX, + (ndr_pull_flags_fn_t) ndr_pull_FRSRPC_VERIFY_PROMOTION_PARENT_EX, +- (ndr_print_function_t) ndr_print_FRSRPC_VERIFY_PROMOTION_PARENT_EX, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_frstrans.c ++++ b/source3/librpc/gen_ndr/ndr_frstrans.c +@@ -2331,7 +2331,7 @@ static const struct ndr_interface_call f + sizeof(struct frstrans_CheckConnectivity), + (ndr_push_flags_fn_t) ndr_push_frstrans_CheckConnectivity, + (ndr_pull_flags_fn_t) ndr_pull_frstrans_CheckConnectivity, +- (ndr_print_function_t) ndr_print_frstrans_CheckConnectivity, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2340,7 +2340,7 @@ static const struct ndr_interface_call f + sizeof(struct frstrans_EstablishConnection), + (ndr_push_flags_fn_t) ndr_push_frstrans_EstablishConnection, + (ndr_pull_flags_fn_t) ndr_pull_frstrans_EstablishConnection, +- (ndr_print_function_t) ndr_print_frstrans_EstablishConnection, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2349,7 +2349,7 @@ static const struct ndr_interface_call f + sizeof(struct frstrans_EstablishSession), + (ndr_push_flags_fn_t) ndr_push_frstrans_EstablishSession, + (ndr_pull_flags_fn_t) ndr_pull_frstrans_EstablishSession, +- (ndr_print_function_t) ndr_print_frstrans_EstablishSession, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2358,7 +2358,7 @@ static const struct ndr_interface_call f + sizeof(struct frstrans_RequestUpdates), + (ndr_push_flags_fn_t) ndr_push_frstrans_RequestUpdates, + (ndr_pull_flags_fn_t) ndr_pull_frstrans_RequestUpdates, +- (ndr_print_function_t) ndr_print_frstrans_RequestUpdates, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2367,7 +2367,7 @@ static const struct ndr_interface_call f + sizeof(struct frstrans_RequestVersionVector), + (ndr_push_flags_fn_t) ndr_push_frstrans_RequestVersionVector, + (ndr_pull_flags_fn_t) ndr_pull_frstrans_RequestVersionVector, +- (ndr_print_function_t) ndr_print_frstrans_RequestVersionVector, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2376,7 +2376,7 @@ static const struct ndr_interface_call f + sizeof(struct frstrans_AsyncPoll), + (ndr_push_flags_fn_t) ndr_push_frstrans_AsyncPoll, + (ndr_pull_flags_fn_t) ndr_pull_frstrans_AsyncPoll, +- (ndr_print_function_t) ndr_print_frstrans_AsyncPoll, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2385,7 +2385,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSTRANS_REQUEST_RECORDS), + (ndr_push_flags_fn_t) ndr_push_FRSTRANS_REQUEST_RECORDS, + (ndr_pull_flags_fn_t) ndr_pull_FRSTRANS_REQUEST_RECORDS, +- (ndr_print_function_t) ndr_print_FRSTRANS_REQUEST_RECORDS, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2394,7 +2394,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSTRANS_UPDATE_CANCEL), + (ndr_push_flags_fn_t) ndr_push_FRSTRANS_UPDATE_CANCEL, + (ndr_pull_flags_fn_t) ndr_pull_FRSTRANS_UPDATE_CANCEL, +- (ndr_print_function_t) ndr_print_FRSTRANS_UPDATE_CANCEL, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2403,7 +2403,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSTRANS_RAW_GET_FILE_DATA), + (ndr_push_flags_fn_t) ndr_push_FRSTRANS_RAW_GET_FILE_DATA, + (ndr_pull_flags_fn_t) ndr_pull_FRSTRANS_RAW_GET_FILE_DATA, +- (ndr_print_function_t) ndr_print_FRSTRANS_RAW_GET_FILE_DATA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2412,7 +2412,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSTRANS_RDC_GET_SIGNATURES), + (ndr_push_flags_fn_t) ndr_push_FRSTRANS_RDC_GET_SIGNATURES, + (ndr_pull_flags_fn_t) ndr_pull_FRSTRANS_RDC_GET_SIGNATURES, +- (ndr_print_function_t) ndr_print_FRSTRANS_RDC_GET_SIGNATURES, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2421,7 +2421,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSTRANS_RDC_PUSH_SOURCE_NEEDS), + (ndr_push_flags_fn_t) ndr_push_FRSTRANS_RDC_PUSH_SOURCE_NEEDS, + (ndr_pull_flags_fn_t) ndr_pull_FRSTRANS_RDC_PUSH_SOURCE_NEEDS, +- (ndr_print_function_t) ndr_print_FRSTRANS_RDC_PUSH_SOURCE_NEEDS, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2430,7 +2430,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSTRANS_RDC_GET_FILE_DATA), + (ndr_push_flags_fn_t) ndr_push_FRSTRANS_RDC_GET_FILE_DATA, + (ndr_pull_flags_fn_t) ndr_pull_FRSTRANS_RDC_GET_FILE_DATA, +- (ndr_print_function_t) ndr_print_FRSTRANS_RDC_GET_FILE_DATA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2439,7 +2439,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSTRANS_RDC_CLOSE), + (ndr_push_flags_fn_t) ndr_push_FRSTRANS_RDC_CLOSE, + (ndr_pull_flags_fn_t) ndr_pull_FRSTRANS_RDC_CLOSE, +- (ndr_print_function_t) ndr_print_FRSTRANS_RDC_CLOSE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2448,7 +2448,7 @@ static const struct ndr_interface_call f + sizeof(struct frstrans_InitializeFileTransferAsync), + (ndr_push_flags_fn_t) ndr_push_frstrans_InitializeFileTransferAsync, + (ndr_pull_flags_fn_t) ndr_pull_frstrans_InitializeFileTransferAsync, +- (ndr_print_function_t) ndr_print_frstrans_InitializeFileTransferAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2457,7 +2457,7 @@ static const struct ndr_interface_call f + sizeof(struct FRSTRANS_OPNUM_0E_NOT_USED_ON_THE_WIRE), + (ndr_push_flags_fn_t) ndr_push_FRSTRANS_OPNUM_0E_NOT_USED_ON_THE_WIRE, + (ndr_pull_flags_fn_t) ndr_pull_FRSTRANS_OPNUM_0E_NOT_USED_ON_THE_WIRE, +- (ndr_print_function_t) ndr_print_FRSTRANS_OPNUM_0E_NOT_USED_ON_THE_WIRE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2466,7 +2466,7 @@ static const struct ndr_interface_call f + sizeof(struct frstrans_RawGetFileDataAsync), + (ndr_push_flags_fn_t) ndr_push_frstrans_RawGetFileDataAsync, + (ndr_pull_flags_fn_t) ndr_pull_frstrans_RawGetFileDataAsync, +- (ndr_print_function_t) ndr_print_frstrans_RawGetFileDataAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 1, frstrans_RawGetFileDataAsync_out_pipes }, + }, +@@ -2475,7 +2475,7 @@ static const struct ndr_interface_call f + sizeof(struct frstrans_RdcGetFileDataAsync), + (ndr_push_flags_fn_t) ndr_push_frstrans_RdcGetFileDataAsync, + (ndr_pull_flags_fn_t) ndr_pull_frstrans_RdcGetFileDataAsync, +- (ndr_print_function_t) ndr_print_frstrans_RdcGetFileDataAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 1, frstrans_RdcGetFileDataAsync_out_pipes }, + }, +--- a/source3/librpc/gen_ndr/ndr_initshutdown.c ++++ b/source3/librpc/gen_ndr/ndr_initshutdown.c +@@ -277,7 +277,7 @@ static const struct ndr_interface_call i + sizeof(struct initshutdown_Init), + (ndr_push_flags_fn_t) ndr_push_initshutdown_Init, + (ndr_pull_flags_fn_t) ndr_pull_initshutdown_Init, +- (ndr_print_function_t) ndr_print_initshutdown_Init, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -286,7 +286,7 @@ static const struct ndr_interface_call i + sizeof(struct initshutdown_Abort), + (ndr_push_flags_fn_t) ndr_push_initshutdown_Abort, + (ndr_pull_flags_fn_t) ndr_pull_initshutdown_Abort, +- (ndr_print_function_t) ndr_print_initshutdown_Abort, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -295,7 +295,7 @@ static const struct ndr_interface_call i + sizeof(struct initshutdown_InitEx), + (ndr_push_flags_fn_t) ndr_push_initshutdown_InitEx, + (ndr_pull_flags_fn_t) ndr_pull_initshutdown_InitEx, +- (ndr_print_function_t) ndr_print_initshutdown_InitEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_keysvc.c ++++ b/source3/librpc/gen_ndr/ndr_keysvc.c +@@ -51,7 +51,7 @@ static const struct ndr_interface_call k + sizeof(struct keysvc_Unknown0), + (ndr_push_flags_fn_t) ndr_push_keysvc_Unknown0, + (ndr_pull_flags_fn_t) ndr_pull_keysvc_Unknown0, +- (ndr_print_function_t) ndr_print_keysvc_Unknown0, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_krb5pac.c ++++ b/source3/librpc/gen_ndr/ndr_krb5pac.c +@@ -1002,7 +1002,7 @@ static const struct ndr_interface_call k + sizeof(struct decode_pac), + (ndr_push_flags_fn_t) ndr_push_decode_pac, + (ndr_pull_flags_fn_t) ndr_pull_decode_pac, +- (ndr_print_function_t) ndr_print_decode_pac, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1011,7 +1011,7 @@ static const struct ndr_interface_call k + sizeof(struct decode_pac_raw), + (ndr_push_flags_fn_t) ndr_push_decode_pac_raw, + (ndr_pull_flags_fn_t) ndr_pull_decode_pac_raw, +- (ndr_print_function_t) ndr_print_decode_pac_raw, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1020,7 +1020,7 @@ static const struct ndr_interface_call k + sizeof(struct decode_login_info), + (ndr_push_flags_fn_t) ndr_push_decode_login_info, + (ndr_pull_flags_fn_t) ndr_pull_decode_login_info, +- (ndr_print_function_t) ndr_print_decode_login_info, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1029,7 +1029,7 @@ static const struct ndr_interface_call k + sizeof(struct decode_login_info_ctr), + (ndr_push_flags_fn_t) ndr_push_decode_login_info_ctr, + (ndr_pull_flags_fn_t) ndr_pull_decode_login_info_ctr, +- (ndr_print_function_t) ndr_print_decode_login_info_ctr, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -1038,7 +1038,7 @@ static const struct ndr_interface_call k + sizeof(struct decode_pac_validate), + (ndr_push_flags_fn_t) ndr_push_decode_pac_validate, + (ndr_pull_flags_fn_t) ndr_pull_decode_pac_validate, +- (ndr_print_function_t) ndr_print_decode_pac_validate, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_lsa.c ++++ b/source3/librpc/gen_ndr/ndr_lsa.c +@@ -13565,7 +13565,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_Close), + (ndr_push_flags_fn_t) ndr_push_lsa_Close, + (ndr_pull_flags_fn_t) ndr_pull_lsa_Close, +- (ndr_print_function_t) ndr_print_lsa_Close, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13574,7 +13574,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_Delete), + (ndr_push_flags_fn_t) ndr_push_lsa_Delete, + (ndr_pull_flags_fn_t) ndr_pull_lsa_Delete, +- (ndr_print_function_t) ndr_print_lsa_Delete, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13583,7 +13583,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_EnumPrivs), + (ndr_push_flags_fn_t) ndr_push_lsa_EnumPrivs, + (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumPrivs, +- (ndr_print_function_t) ndr_print_lsa_EnumPrivs, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13592,7 +13592,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_QuerySecurity), + (ndr_push_flags_fn_t) ndr_push_lsa_QuerySecurity, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QuerySecurity, +- (ndr_print_function_t) ndr_print_lsa_QuerySecurity, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13601,7 +13601,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_SetSecObj), + (ndr_push_flags_fn_t) ndr_push_lsa_SetSecObj, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetSecObj, +- (ndr_print_function_t) ndr_print_lsa_SetSecObj, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13610,7 +13610,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_ChangePassword), + (ndr_push_flags_fn_t) ndr_push_lsa_ChangePassword, + (ndr_pull_flags_fn_t) ndr_pull_lsa_ChangePassword, +- (ndr_print_function_t) ndr_print_lsa_ChangePassword, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13619,7 +13619,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_OpenPolicy), + (ndr_push_flags_fn_t) ndr_push_lsa_OpenPolicy, + (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenPolicy, +- (ndr_print_function_t) ndr_print_lsa_OpenPolicy, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13628,7 +13628,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_QueryInfoPolicy), + (ndr_push_flags_fn_t) ndr_push_lsa_QueryInfoPolicy, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryInfoPolicy, +- (ndr_print_function_t) ndr_print_lsa_QueryInfoPolicy, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13637,7 +13637,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_SetInfoPolicy), + (ndr_push_flags_fn_t) ndr_push_lsa_SetInfoPolicy, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetInfoPolicy, +- (ndr_print_function_t) ndr_print_lsa_SetInfoPolicy, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13646,7 +13646,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_ClearAuditLog), + (ndr_push_flags_fn_t) ndr_push_lsa_ClearAuditLog, + (ndr_pull_flags_fn_t) ndr_pull_lsa_ClearAuditLog, +- (ndr_print_function_t) ndr_print_lsa_ClearAuditLog, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13655,7 +13655,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CreateAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_CreateAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateAccount, +- (ndr_print_function_t) ndr_print_lsa_CreateAccount, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13664,7 +13664,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_EnumAccounts), + (ndr_push_flags_fn_t) ndr_push_lsa_EnumAccounts, + (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumAccounts, +- (ndr_print_function_t) ndr_print_lsa_EnumAccounts, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13673,7 +13673,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CreateTrustedDomain), + (ndr_push_flags_fn_t) ndr_push_lsa_CreateTrustedDomain, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateTrustedDomain, +- (ndr_print_function_t) ndr_print_lsa_CreateTrustedDomain, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13682,7 +13682,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_EnumTrustDom), + (ndr_push_flags_fn_t) ndr_push_lsa_EnumTrustDom, + (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumTrustDom, +- (ndr_print_function_t) ndr_print_lsa_EnumTrustDom, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13691,7 +13691,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LookupNames), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupNames, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupNames, +- (ndr_print_function_t) ndr_print_lsa_LookupNames, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13700,7 +13700,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LookupSids), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupSids, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupSids, +- (ndr_print_function_t) ndr_print_lsa_LookupSids, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13709,7 +13709,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CreateSecret), + (ndr_push_flags_fn_t) ndr_push_lsa_CreateSecret, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateSecret, +- (ndr_print_function_t) ndr_print_lsa_CreateSecret, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13718,7 +13718,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_OpenAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_OpenAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenAccount, +- (ndr_print_function_t) ndr_print_lsa_OpenAccount, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13727,7 +13727,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_EnumPrivsAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_EnumPrivsAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumPrivsAccount, +- (ndr_print_function_t) ndr_print_lsa_EnumPrivsAccount, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13736,7 +13736,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_AddPrivilegesToAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_AddPrivilegesToAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_AddPrivilegesToAccount, +- (ndr_print_function_t) ndr_print_lsa_AddPrivilegesToAccount, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13745,7 +13745,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_RemovePrivilegesFromAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_RemovePrivilegesFromAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_RemovePrivilegesFromAccount, +- (ndr_print_function_t) ndr_print_lsa_RemovePrivilegesFromAccount, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13754,7 +13754,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_GetQuotasForAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_GetQuotasForAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_GetQuotasForAccount, +- (ndr_print_function_t) ndr_print_lsa_GetQuotasForAccount, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13763,7 +13763,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_SetQuotasForAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_SetQuotasForAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetQuotasForAccount, +- (ndr_print_function_t) ndr_print_lsa_SetQuotasForAccount, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13772,7 +13772,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_GetSystemAccessAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_GetSystemAccessAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_GetSystemAccessAccount, +- (ndr_print_function_t) ndr_print_lsa_GetSystemAccessAccount, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13781,7 +13781,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_SetSystemAccessAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_SetSystemAccessAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetSystemAccessAccount, +- (ndr_print_function_t) ndr_print_lsa_SetSystemAccessAccount, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13790,7 +13790,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_OpenTrustedDomain), + (ndr_push_flags_fn_t) ndr_push_lsa_OpenTrustedDomain, + (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenTrustedDomain, +- (ndr_print_function_t) ndr_print_lsa_OpenTrustedDomain, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13799,7 +13799,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_QueryTrustedDomainInfo), + (ndr_push_flags_fn_t) ndr_push_lsa_QueryTrustedDomainInfo, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryTrustedDomainInfo, +- (ndr_print_function_t) ndr_print_lsa_QueryTrustedDomainInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13808,7 +13808,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_SetInformationTrustedDomain), + (ndr_push_flags_fn_t) ndr_push_lsa_SetInformationTrustedDomain, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetInformationTrustedDomain, +- (ndr_print_function_t) ndr_print_lsa_SetInformationTrustedDomain, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13817,7 +13817,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_OpenSecret), + (ndr_push_flags_fn_t) ndr_push_lsa_OpenSecret, + (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenSecret, +- (ndr_print_function_t) ndr_print_lsa_OpenSecret, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13826,7 +13826,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_SetSecret), + (ndr_push_flags_fn_t) ndr_push_lsa_SetSecret, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetSecret, +- (ndr_print_function_t) ndr_print_lsa_SetSecret, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13835,7 +13835,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_QuerySecret), + (ndr_push_flags_fn_t) ndr_push_lsa_QuerySecret, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QuerySecret, +- (ndr_print_function_t) ndr_print_lsa_QuerySecret, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13844,7 +13844,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LookupPrivValue), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupPrivValue, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupPrivValue, +- (ndr_print_function_t) ndr_print_lsa_LookupPrivValue, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13853,7 +13853,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LookupPrivName), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupPrivName, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupPrivName, +- (ndr_print_function_t) ndr_print_lsa_LookupPrivName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13862,7 +13862,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LookupPrivDisplayName), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupPrivDisplayName, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupPrivDisplayName, +- (ndr_print_function_t) ndr_print_lsa_LookupPrivDisplayName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13871,7 +13871,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_DeleteObject), + (ndr_push_flags_fn_t) ndr_push_lsa_DeleteObject, + (ndr_pull_flags_fn_t) ndr_pull_lsa_DeleteObject, +- (ndr_print_function_t) ndr_print_lsa_DeleteObject, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13880,7 +13880,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_EnumAccountsWithUserRight), + (ndr_push_flags_fn_t) ndr_push_lsa_EnumAccountsWithUserRight, + (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumAccountsWithUserRight, +- (ndr_print_function_t) ndr_print_lsa_EnumAccountsWithUserRight, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13889,7 +13889,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_EnumAccountRights), + (ndr_push_flags_fn_t) ndr_push_lsa_EnumAccountRights, + (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumAccountRights, +- (ndr_print_function_t) ndr_print_lsa_EnumAccountRights, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13898,7 +13898,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_AddAccountRights), + (ndr_push_flags_fn_t) ndr_push_lsa_AddAccountRights, + (ndr_pull_flags_fn_t) ndr_pull_lsa_AddAccountRights, +- (ndr_print_function_t) ndr_print_lsa_AddAccountRights, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13907,7 +13907,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_RemoveAccountRights), + (ndr_push_flags_fn_t) ndr_push_lsa_RemoveAccountRights, + (ndr_pull_flags_fn_t) ndr_pull_lsa_RemoveAccountRights, +- (ndr_print_function_t) ndr_print_lsa_RemoveAccountRights, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13916,7 +13916,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_QueryTrustedDomainInfoBySid), + (ndr_push_flags_fn_t) ndr_push_lsa_QueryTrustedDomainInfoBySid, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryTrustedDomainInfoBySid, +- (ndr_print_function_t) ndr_print_lsa_QueryTrustedDomainInfoBySid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13925,7 +13925,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_SetTrustedDomainInfo), + (ndr_push_flags_fn_t) ndr_push_lsa_SetTrustedDomainInfo, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetTrustedDomainInfo, +- (ndr_print_function_t) ndr_print_lsa_SetTrustedDomainInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13934,7 +13934,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_DeleteTrustedDomain), + (ndr_push_flags_fn_t) ndr_push_lsa_DeleteTrustedDomain, + (ndr_pull_flags_fn_t) ndr_pull_lsa_DeleteTrustedDomain, +- (ndr_print_function_t) ndr_print_lsa_DeleteTrustedDomain, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13943,7 +13943,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_StorePrivateData), + (ndr_push_flags_fn_t) ndr_push_lsa_StorePrivateData, + (ndr_pull_flags_fn_t) ndr_pull_lsa_StorePrivateData, +- (ndr_print_function_t) ndr_print_lsa_StorePrivateData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13952,7 +13952,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_RetrievePrivateData), + (ndr_push_flags_fn_t) ndr_push_lsa_RetrievePrivateData, + (ndr_pull_flags_fn_t) ndr_pull_lsa_RetrievePrivateData, +- (ndr_print_function_t) ndr_print_lsa_RetrievePrivateData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13961,7 +13961,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_OpenPolicy2), + (ndr_push_flags_fn_t) ndr_push_lsa_OpenPolicy2, + (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenPolicy2, +- (ndr_print_function_t) ndr_print_lsa_OpenPolicy2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13970,7 +13970,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_GetUserName), + (ndr_push_flags_fn_t) ndr_push_lsa_GetUserName, + (ndr_pull_flags_fn_t) ndr_pull_lsa_GetUserName, +- (ndr_print_function_t) ndr_print_lsa_GetUserName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13979,7 +13979,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_QueryInfoPolicy2), + (ndr_push_flags_fn_t) ndr_push_lsa_QueryInfoPolicy2, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryInfoPolicy2, +- (ndr_print_function_t) ndr_print_lsa_QueryInfoPolicy2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13988,7 +13988,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_SetInfoPolicy2), + (ndr_push_flags_fn_t) ndr_push_lsa_SetInfoPolicy2, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetInfoPolicy2, +- (ndr_print_function_t) ndr_print_lsa_SetInfoPolicy2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13997,7 +13997,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_QueryTrustedDomainInfoByName), + (ndr_push_flags_fn_t) ndr_push_lsa_QueryTrustedDomainInfoByName, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryTrustedDomainInfoByName, +- (ndr_print_function_t) ndr_print_lsa_QueryTrustedDomainInfoByName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14006,7 +14006,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_SetTrustedDomainInfoByName), + (ndr_push_flags_fn_t) ndr_push_lsa_SetTrustedDomainInfoByName, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetTrustedDomainInfoByName, +- (ndr_print_function_t) ndr_print_lsa_SetTrustedDomainInfoByName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14015,7 +14015,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_EnumTrustedDomainsEx), + (ndr_push_flags_fn_t) ndr_push_lsa_EnumTrustedDomainsEx, + (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumTrustedDomainsEx, +- (ndr_print_function_t) ndr_print_lsa_EnumTrustedDomainsEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14024,7 +14024,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CreateTrustedDomainEx), + (ndr_push_flags_fn_t) ndr_push_lsa_CreateTrustedDomainEx, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateTrustedDomainEx, +- (ndr_print_function_t) ndr_print_lsa_CreateTrustedDomainEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14033,7 +14033,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CloseTrustedDomainEx), + (ndr_push_flags_fn_t) ndr_push_lsa_CloseTrustedDomainEx, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CloseTrustedDomainEx, +- (ndr_print_function_t) ndr_print_lsa_CloseTrustedDomainEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14042,7 +14042,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_QueryDomainInformationPolicy), + (ndr_push_flags_fn_t) ndr_push_lsa_QueryDomainInformationPolicy, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryDomainInformationPolicy, +- (ndr_print_function_t) ndr_print_lsa_QueryDomainInformationPolicy, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14051,7 +14051,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_SetDomainInformationPolicy), + (ndr_push_flags_fn_t) ndr_push_lsa_SetDomainInformationPolicy, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetDomainInformationPolicy, +- (ndr_print_function_t) ndr_print_lsa_SetDomainInformationPolicy, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14060,7 +14060,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_OpenTrustedDomainByName), + (ndr_push_flags_fn_t) ndr_push_lsa_OpenTrustedDomainByName, + (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenTrustedDomainByName, +- (ndr_print_function_t) ndr_print_lsa_OpenTrustedDomainByName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14069,7 +14069,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_TestCall), + (ndr_push_flags_fn_t) ndr_push_lsa_TestCall, + (ndr_pull_flags_fn_t) ndr_pull_lsa_TestCall, +- (ndr_print_function_t) ndr_print_lsa_TestCall, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14078,7 +14078,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LookupSids2), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupSids2, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupSids2, +- (ndr_print_function_t) ndr_print_lsa_LookupSids2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14087,7 +14087,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LookupNames2), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupNames2, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupNames2, +- (ndr_print_function_t) ndr_print_lsa_LookupNames2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14096,7 +14096,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CreateTrustedDomainEx2), + (ndr_push_flags_fn_t) ndr_push_lsa_CreateTrustedDomainEx2, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateTrustedDomainEx2, +- (ndr_print_function_t) ndr_print_lsa_CreateTrustedDomainEx2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14105,7 +14105,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CREDRWRITE), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRWRITE, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRWRITE, +- (ndr_print_function_t) ndr_print_lsa_CREDRWRITE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14114,7 +14114,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CREDRREAD), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRREAD, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRREAD, +- (ndr_print_function_t) ndr_print_lsa_CREDRREAD, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14123,7 +14123,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CREDRENUMERATE), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRENUMERATE, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRENUMERATE, +- (ndr_print_function_t) ndr_print_lsa_CREDRENUMERATE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14132,7 +14132,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CREDRWRITEDOMAINCREDENTIALS), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRWRITEDOMAINCREDENTIALS, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRWRITEDOMAINCREDENTIALS, +- (ndr_print_function_t) ndr_print_lsa_CREDRWRITEDOMAINCREDENTIALS, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14141,7 +14141,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CREDRREADDOMAINCREDENTIALS), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRREADDOMAINCREDENTIALS, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRREADDOMAINCREDENTIALS, +- (ndr_print_function_t) ndr_print_lsa_CREDRREADDOMAINCREDENTIALS, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14150,7 +14150,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CREDRDELETE), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRDELETE, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRDELETE, +- (ndr_print_function_t) ndr_print_lsa_CREDRDELETE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14159,7 +14159,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CREDRGETTARGETINFO), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRGETTARGETINFO, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRGETTARGETINFO, +- (ndr_print_function_t) ndr_print_lsa_CREDRGETTARGETINFO, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14168,7 +14168,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CREDRPROFILELOADED), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRPROFILELOADED, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRPROFILELOADED, +- (ndr_print_function_t) ndr_print_lsa_CREDRPROFILELOADED, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14177,7 +14177,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LookupNames3), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupNames3, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupNames3, +- (ndr_print_function_t) ndr_print_lsa_LookupNames3, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14186,7 +14186,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CREDRGETSESSIONTYPES), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRGETSESSIONTYPES, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRGETSESSIONTYPES, +- (ndr_print_function_t) ndr_print_lsa_CREDRGETSESSIONTYPES, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14195,7 +14195,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LSARREGISTERAUDITEVENT), + (ndr_push_flags_fn_t) ndr_push_lsa_LSARREGISTERAUDITEVENT, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARREGISTERAUDITEVENT, +- (ndr_print_function_t) ndr_print_lsa_LSARREGISTERAUDITEVENT, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14204,7 +14204,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LSARGENAUDITEVENT), + (ndr_push_flags_fn_t) ndr_push_lsa_LSARGENAUDITEVENT, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARGENAUDITEVENT, +- (ndr_print_function_t) ndr_print_lsa_LSARGENAUDITEVENT, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14213,7 +14213,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LSARUNREGISTERAUDITEVENT), + (ndr_push_flags_fn_t) ndr_push_lsa_LSARUNREGISTERAUDITEVENT, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARUNREGISTERAUDITEVENT, +- (ndr_print_function_t) ndr_print_lsa_LSARUNREGISTERAUDITEVENT, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14222,7 +14222,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_lsaRQueryForestTrustInformation), + (ndr_push_flags_fn_t) ndr_push_lsa_lsaRQueryForestTrustInformation, + (ndr_pull_flags_fn_t) ndr_pull_lsa_lsaRQueryForestTrustInformation, +- (ndr_print_function_t) ndr_print_lsa_lsaRQueryForestTrustInformation, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14231,7 +14231,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_lsaRSetForestTrustInformation), + (ndr_push_flags_fn_t) ndr_push_lsa_lsaRSetForestTrustInformation, + (ndr_pull_flags_fn_t) ndr_pull_lsa_lsaRSetForestTrustInformation, +- (ndr_print_function_t) ndr_print_lsa_lsaRSetForestTrustInformation, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14240,7 +14240,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_CREDRRENAME), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRRENAME, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRRENAME, +- (ndr_print_function_t) ndr_print_lsa_CREDRRENAME, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14249,7 +14249,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LookupSids3), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupSids3, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupSids3, +- (ndr_print_function_t) ndr_print_lsa_LookupSids3, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14258,7 +14258,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LookupNames4), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupNames4, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupNames4, +- (ndr_print_function_t) ndr_print_lsa_LookupNames4, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14267,7 +14267,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LSAROPENPOLICYSCE), + (ndr_push_flags_fn_t) ndr_push_lsa_LSAROPENPOLICYSCE, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSAROPENPOLICYSCE, +- (ndr_print_function_t) ndr_print_lsa_LSAROPENPOLICYSCE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14276,7 +14276,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE), + (ndr_push_flags_fn_t) ndr_push_lsa_LSARADTREGISTERSECURITYEVENTSOURCE, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARADTREGISTERSECURITYEVENTSOURCE, +- (ndr_print_function_t) ndr_print_lsa_LSARADTREGISTERSECURITYEVENTSOURCE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14285,7 +14285,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE), + (ndr_push_flags_fn_t) ndr_push_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, +- (ndr_print_function_t) ndr_print_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -14294,7 +14294,7 @@ static const struct ndr_interface_call l + sizeof(struct lsa_LSARADTREPORTSECURITYEVENT), + (ndr_push_flags_fn_t) ndr_push_lsa_LSARADTREPORTSECURITYEVENT, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARADTREPORTSECURITYEVENT, +- (ndr_print_function_t) ndr_print_lsa_LSARADTREPORTSECURITYEVENT, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_mgmt.c ++++ b/source3/librpc/gen_ndr/ndr_mgmt.c +@@ -515,7 +515,7 @@ static const struct ndr_interface_call m + sizeof(struct mgmt_inq_if_ids), + (ndr_push_flags_fn_t) ndr_push_mgmt_inq_if_ids, + (ndr_pull_flags_fn_t) ndr_pull_mgmt_inq_if_ids, +- (ndr_print_function_t) ndr_print_mgmt_inq_if_ids, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -524,7 +524,7 @@ static const struct ndr_interface_call m + sizeof(struct mgmt_inq_stats), + (ndr_push_flags_fn_t) ndr_push_mgmt_inq_stats, + (ndr_pull_flags_fn_t) ndr_pull_mgmt_inq_stats, +- (ndr_print_function_t) ndr_print_mgmt_inq_stats, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -533,7 +533,7 @@ static const struct ndr_interface_call m + sizeof(struct mgmt_is_server_listening), + (ndr_push_flags_fn_t) ndr_push_mgmt_is_server_listening, + (ndr_pull_flags_fn_t) ndr_pull_mgmt_is_server_listening, +- (ndr_print_function_t) ndr_print_mgmt_is_server_listening, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -542,7 +542,7 @@ static const struct ndr_interface_call m + sizeof(struct mgmt_stop_server_listening), + (ndr_push_flags_fn_t) ndr_push_mgmt_stop_server_listening, + (ndr_pull_flags_fn_t) ndr_pull_mgmt_stop_server_listening, +- (ndr_print_function_t) ndr_print_mgmt_stop_server_listening, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -551,7 +551,7 @@ static const struct ndr_interface_call m + sizeof(struct mgmt_inq_princ_name), + (ndr_push_flags_fn_t) ndr_push_mgmt_inq_princ_name, + (ndr_pull_flags_fn_t) ndr_pull_mgmt_inq_princ_name, +- (ndr_print_function_t) ndr_print_mgmt_inq_princ_name, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_msgsvc.c ++++ b/source3/librpc/gen_ndr/ndr_msgsvc.c +@@ -165,7 +165,7 @@ static const struct ndr_interface_call m + sizeof(struct NetrMessageNameAdd), + (ndr_push_flags_fn_t) ndr_push_NetrMessageNameAdd, + (ndr_pull_flags_fn_t) ndr_pull_NetrMessageNameAdd, +- (ndr_print_function_t) ndr_print_NetrMessageNameAdd, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -174,7 +174,7 @@ static const struct ndr_interface_call m + sizeof(struct NetrMessageNameEnum), + (ndr_push_flags_fn_t) ndr_push_NetrMessageNameEnum, + (ndr_pull_flags_fn_t) ndr_pull_NetrMessageNameEnum, +- (ndr_print_function_t) ndr_print_NetrMessageNameEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -183,7 +183,7 @@ static const struct ndr_interface_call m + sizeof(struct NetrMessageNameGetInfo), + (ndr_push_flags_fn_t) ndr_push_NetrMessageNameGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_NetrMessageNameGetInfo, +- (ndr_print_function_t) ndr_print_NetrMessageNameGetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -192,7 +192,7 @@ static const struct ndr_interface_call m + sizeof(struct NetrMessageNameDel), + (ndr_push_flags_fn_t) ndr_push_NetrMessageNameDel, + (ndr_pull_flags_fn_t) ndr_pull_NetrMessageNameDel, +- (ndr_print_function_t) ndr_print_NetrMessageNameDel, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -276,7 +276,7 @@ static const struct ndr_interface_call m + sizeof(struct NetrSendMessage), + (ndr_push_flags_fn_t) ndr_push_NetrSendMessage, + (ndr_pull_flags_fn_t) ndr_pull_NetrSendMessage, +- (ndr_print_function_t) ndr_print_NetrSendMessage, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_nbt.c ++++ b/source3/librpc/gen_ndr/ndr_nbt.c +@@ -3671,7 +3671,7 @@ static const struct ndr_interface_call n + sizeof(struct decode_nbt_netlogon_packet), + (ndr_push_flags_fn_t) ndr_push_decode_nbt_netlogon_packet, + (ndr_pull_flags_fn_t) ndr_pull_decode_nbt_netlogon_packet, +- (ndr_print_function_t) ndr_print_decode_nbt_netlogon_packet, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_netlogon.c ++++ b/source3/librpc/gen_ndr/ndr_netlogon.c +@@ -17827,7 +17827,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_LogonUasLogon), + (ndr_push_flags_fn_t) ndr_push_netr_LogonUasLogon, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonUasLogon, +- (ndr_print_function_t) ndr_print_netr_LogonUasLogon, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17836,7 +17836,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_LogonUasLogoff), + (ndr_push_flags_fn_t) ndr_push_netr_LogonUasLogoff, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonUasLogoff, +- (ndr_print_function_t) ndr_print_netr_LogonUasLogoff, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17845,7 +17845,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_LogonSamLogon), + (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogon, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogon, +- (ndr_print_function_t) ndr_print_netr_LogonSamLogon, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17854,7 +17854,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_LogonSamLogoff), + (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogoff, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogoff, +- (ndr_print_function_t) ndr_print_netr_LogonSamLogoff, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17863,7 +17863,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_ServerReqChallenge), + (ndr_push_flags_fn_t) ndr_push_netr_ServerReqChallenge, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerReqChallenge, +- (ndr_print_function_t) ndr_print_netr_ServerReqChallenge, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17872,7 +17872,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_ServerAuthenticate), + (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate, +- (ndr_print_function_t) ndr_print_netr_ServerAuthenticate, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17881,7 +17881,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_ServerPasswordSet), + (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordSet, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordSet, +- (ndr_print_function_t) ndr_print_netr_ServerPasswordSet, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17890,7 +17890,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DatabaseDeltas), + (ndr_push_flags_fn_t) ndr_push_netr_DatabaseDeltas, + (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseDeltas, +- (ndr_print_function_t) ndr_print_netr_DatabaseDeltas, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17899,7 +17899,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DatabaseSync), + (ndr_push_flags_fn_t) ndr_push_netr_DatabaseSync, + (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseSync, +- (ndr_print_function_t) ndr_print_netr_DatabaseSync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17908,7 +17908,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_AccountDeltas), + (ndr_push_flags_fn_t) ndr_push_netr_AccountDeltas, + (ndr_pull_flags_fn_t) ndr_pull_netr_AccountDeltas, +- (ndr_print_function_t) ndr_print_netr_AccountDeltas, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17917,7 +17917,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_AccountSync), + (ndr_push_flags_fn_t) ndr_push_netr_AccountSync, + (ndr_pull_flags_fn_t) ndr_pull_netr_AccountSync, +- (ndr_print_function_t) ndr_print_netr_AccountSync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17926,7 +17926,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_GetDcName), + (ndr_push_flags_fn_t) ndr_push_netr_GetDcName, + (ndr_pull_flags_fn_t) ndr_pull_netr_GetDcName, +- (ndr_print_function_t) ndr_print_netr_GetDcName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17935,7 +17935,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_LogonControl), + (ndr_push_flags_fn_t) ndr_push_netr_LogonControl, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl, +- (ndr_print_function_t) ndr_print_netr_LogonControl, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17944,7 +17944,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_GetAnyDCName), + (ndr_push_flags_fn_t) ndr_push_netr_GetAnyDCName, + (ndr_pull_flags_fn_t) ndr_pull_netr_GetAnyDCName, +- (ndr_print_function_t) ndr_print_netr_GetAnyDCName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17953,7 +17953,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_LogonControl2), + (ndr_push_flags_fn_t) ndr_push_netr_LogonControl2, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl2, +- (ndr_print_function_t) ndr_print_netr_LogonControl2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17962,7 +17962,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_ServerAuthenticate2), + (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate2, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate2, +- (ndr_print_function_t) ndr_print_netr_ServerAuthenticate2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17971,7 +17971,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DatabaseSync2), + (ndr_push_flags_fn_t) ndr_push_netr_DatabaseSync2, + (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseSync2, +- (ndr_print_function_t) ndr_print_netr_DatabaseSync2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17980,7 +17980,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DatabaseRedo), + (ndr_push_flags_fn_t) ndr_push_netr_DatabaseRedo, + (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseRedo, +- (ndr_print_function_t) ndr_print_netr_DatabaseRedo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17989,7 +17989,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_LogonControl2Ex), + (ndr_push_flags_fn_t) ndr_push_netr_LogonControl2Ex, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl2Ex, +- (ndr_print_function_t) ndr_print_netr_LogonControl2Ex, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -17998,7 +17998,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_NetrEnumerateTrustedDomains), + (ndr_push_flags_fn_t) ndr_push_netr_NetrEnumerateTrustedDomains, + (ndr_pull_flags_fn_t) ndr_pull_netr_NetrEnumerateTrustedDomains, +- (ndr_print_function_t) ndr_print_netr_NetrEnumerateTrustedDomains, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18007,7 +18007,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DsRGetDCName), + (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCName, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCName, +- (ndr_print_function_t) ndr_print_netr_DsRGetDCName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18016,7 +18016,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_LogonGetCapabilities), + (ndr_push_flags_fn_t) ndr_push_netr_LogonGetCapabilities, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetCapabilities, +- (ndr_print_function_t) ndr_print_netr_LogonGetCapabilities, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18025,7 +18025,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_NETRLOGONSETSERVICEBITS), + (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONSETSERVICEBITS, + (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONSETSERVICEBITS, +- (ndr_print_function_t) ndr_print_netr_NETRLOGONSETSERVICEBITS, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18034,7 +18034,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_LogonGetTrustRid), + (ndr_push_flags_fn_t) ndr_push_netr_LogonGetTrustRid, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetTrustRid, +- (ndr_print_function_t) ndr_print_netr_LogonGetTrustRid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18043,7 +18043,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_NETRLOGONCOMPUTESERVERDIGEST), + (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST, + (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST, +- (ndr_print_function_t) ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18052,7 +18052,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_NETRLOGONCOMPUTECLIENTDIGEST), + (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST, + (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST, +- (ndr_print_function_t) ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18061,7 +18061,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_ServerAuthenticate3), + (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate3, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate3, +- (ndr_print_function_t) ndr_print_netr_ServerAuthenticate3, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18070,7 +18070,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DsRGetDCNameEx), + (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCNameEx, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCNameEx, +- (ndr_print_function_t) ndr_print_netr_DsRGetDCNameEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18079,7 +18079,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DsRGetSiteName), + (ndr_push_flags_fn_t) ndr_push_netr_DsRGetSiteName, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetSiteName, +- (ndr_print_function_t) ndr_print_netr_DsRGetSiteName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18088,7 +18088,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_LogonGetDomainInfo), + (ndr_push_flags_fn_t) ndr_push_netr_LogonGetDomainInfo, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetDomainInfo, +- (ndr_print_function_t) ndr_print_netr_LogonGetDomainInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18097,7 +18097,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_ServerPasswordSet2), + (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordSet2, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordSet2, +- (ndr_print_function_t) ndr_print_netr_ServerPasswordSet2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18106,7 +18106,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_ServerPasswordGet), + (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordGet, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordGet, +- (ndr_print_function_t) ndr_print_netr_ServerPasswordGet, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18115,7 +18115,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_NETRLOGONSENDTOSAM), + (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONSENDTOSAM, + (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONSENDTOSAM, +- (ndr_print_function_t) ndr_print_netr_NETRLOGONSENDTOSAM, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18124,7 +18124,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DsRAddressToSitenamesW), + (ndr_push_flags_fn_t) ndr_push_netr_DsRAddressToSitenamesW, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRAddressToSitenamesW, +- (ndr_print_function_t) ndr_print_netr_DsRAddressToSitenamesW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18133,7 +18133,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DsRGetDCNameEx2), + (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCNameEx2, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCNameEx2, +- (ndr_print_function_t) ndr_print_netr_DsRGetDCNameEx2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18142,7 +18142,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN), + (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, + (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, +- (ndr_print_function_t) ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18151,7 +18151,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_NetrEnumerateTrustedDomainsEx), + (ndr_push_flags_fn_t) ndr_push_netr_NetrEnumerateTrustedDomainsEx, + (ndr_pull_flags_fn_t) ndr_pull_netr_NetrEnumerateTrustedDomainsEx, +- (ndr_print_function_t) ndr_print_netr_NetrEnumerateTrustedDomainsEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18160,7 +18160,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DsRAddressToSitenamesExW), + (ndr_push_flags_fn_t) ndr_push_netr_DsRAddressToSitenamesExW, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRAddressToSitenamesExW, +- (ndr_print_function_t) ndr_print_netr_DsRAddressToSitenamesExW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18169,7 +18169,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DsrGetDcSiteCoverageW), + (ndr_push_flags_fn_t) ndr_push_netr_DsrGetDcSiteCoverageW, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsrGetDcSiteCoverageW, +- (ndr_print_function_t) ndr_print_netr_DsrGetDcSiteCoverageW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18178,7 +18178,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_LogonSamLogonEx), + (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogonEx, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogonEx, +- (ndr_print_function_t) ndr_print_netr_LogonSamLogonEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18187,7 +18187,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DsrEnumerateDomainTrusts), + (ndr_push_flags_fn_t) ndr_push_netr_DsrEnumerateDomainTrusts, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsrEnumerateDomainTrusts, +- (ndr_print_function_t) ndr_print_netr_DsrEnumerateDomainTrusts, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18196,7 +18196,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DsrDeregisterDNSHostRecords), + (ndr_push_flags_fn_t) ndr_push_netr_DsrDeregisterDNSHostRecords, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsrDeregisterDNSHostRecords, +- (ndr_print_function_t) ndr_print_netr_DsrDeregisterDNSHostRecords, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18205,7 +18205,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_ServerTrustPasswordsGet), + (ndr_push_flags_fn_t) ndr_push_netr_ServerTrustPasswordsGet, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerTrustPasswordsGet, +- (ndr_print_function_t) ndr_print_netr_ServerTrustPasswordsGet, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18214,7 +18214,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DsRGetForestTrustInformation), + (ndr_push_flags_fn_t) ndr_push_netr_DsRGetForestTrustInformation, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetForestTrustInformation, +- (ndr_print_function_t) ndr_print_netr_DsRGetForestTrustInformation, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18223,7 +18223,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_GetForestTrustInformation), + (ndr_push_flags_fn_t) ndr_push_netr_GetForestTrustInformation, + (ndr_pull_flags_fn_t) ndr_pull_netr_GetForestTrustInformation, +- (ndr_print_function_t) ndr_print_netr_GetForestTrustInformation, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18232,7 +18232,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_LogonSamLogonWithFlags), + (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogonWithFlags, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogonWithFlags, +- (ndr_print_function_t) ndr_print_netr_LogonSamLogonWithFlags, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18241,7 +18241,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_ServerGetTrustInfo), + (ndr_push_flags_fn_t) ndr_push_netr_ServerGetTrustInfo, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerGetTrustInfo, +- (ndr_print_function_t) ndr_print_netr_ServerGetTrustInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18250,7 +18250,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_Unused47), + (ndr_push_flags_fn_t) ndr_push_netr_Unused47, + (ndr_pull_flags_fn_t) ndr_pull_netr_Unused47, +- (ndr_print_function_t) ndr_print_netr_Unused47, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -18259,7 +18259,7 @@ static const struct ndr_interface_call n + sizeof(struct netr_DsrUpdateReadOnlyServerDnsRecords), + (ndr_push_flags_fn_t) ndr_push_netr_DsrUpdateReadOnlyServerDnsRecords, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsrUpdateReadOnlyServerDnsRecords, +- (ndr_print_function_t) ndr_print_netr_DsrUpdateReadOnlyServerDnsRecords, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_ntlmssp.c ++++ b/source3/librpc/gen_ndr/ndr_ntlmssp.c +@@ -2408,7 +2408,7 @@ static const struct ndr_interface_call n + sizeof(struct decode_NEGOTIATE_MESSAGE), + (ndr_push_flags_fn_t) ndr_push_decode_NEGOTIATE_MESSAGE, + (ndr_pull_flags_fn_t) ndr_pull_decode_NEGOTIATE_MESSAGE, +- (ndr_print_function_t) ndr_print_decode_NEGOTIATE_MESSAGE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2417,7 +2417,7 @@ static const struct ndr_interface_call n + sizeof(struct decode_CHALLENGE_MESSAGE), + (ndr_push_flags_fn_t) ndr_push_decode_CHALLENGE_MESSAGE, + (ndr_pull_flags_fn_t) ndr_pull_decode_CHALLENGE_MESSAGE, +- (ndr_print_function_t) ndr_print_decode_CHALLENGE_MESSAGE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2426,7 +2426,7 @@ static const struct ndr_interface_call n + sizeof(struct decode_AUTHENTICATE_MESSAGE), + (ndr_push_flags_fn_t) ndr_push_decode_AUTHENTICATE_MESSAGE, + (ndr_pull_flags_fn_t) ndr_pull_decode_AUTHENTICATE_MESSAGE, +- (ndr_print_function_t) ndr_print_decode_AUTHENTICATE_MESSAGE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2435,7 +2435,7 @@ static const struct ndr_interface_call n + sizeof(struct decode_NTLMv2_CLIENT_CHALLENGE), + (ndr_push_flags_fn_t) ndr_push_decode_NTLMv2_CLIENT_CHALLENGE, + (ndr_pull_flags_fn_t) ndr_pull_decode_NTLMv2_CLIENT_CHALLENGE, +- (ndr_print_function_t) ndr_print_decode_NTLMv2_CLIENT_CHALLENGE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2444,7 +2444,7 @@ static const struct ndr_interface_call n + sizeof(struct decode_NTLMv2_RESPONSE), + (ndr_push_flags_fn_t) ndr_push_decode_NTLMv2_RESPONSE, + (ndr_pull_flags_fn_t) ndr_pull_decode_NTLMv2_RESPONSE, +- (ndr_print_function_t) ndr_print_decode_NTLMv2_RESPONSE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_ntprinting.c ++++ b/source3/librpc/gen_ndr/ndr_ntprinting.c +@@ -902,7 +902,7 @@ static const struct ndr_interface_call n + sizeof(struct decode_ntprinting_form), + (ndr_push_flags_fn_t) ndr_push_decode_ntprinting_form, + (ndr_pull_flags_fn_t) ndr_pull_decode_ntprinting_form, +- (ndr_print_function_t) ndr_print_decode_ntprinting_form, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -911,7 +911,7 @@ static const struct ndr_interface_call n + sizeof(struct decode_ntprinting_driver), + (ndr_push_flags_fn_t) ndr_push_decode_ntprinting_driver, + (ndr_pull_flags_fn_t) ndr_pull_decode_ntprinting_driver, +- (ndr_print_function_t) ndr_print_decode_ntprinting_driver, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -920,7 +920,7 @@ static const struct ndr_interface_call n + sizeof(struct decode_ntprinting_printer), + (ndr_push_flags_fn_t) ndr_push_decode_ntprinting_printer, + (ndr_pull_flags_fn_t) ndr_pull_decode_ntprinting_printer, +- (ndr_print_function_t) ndr_print_decode_ntprinting_printer, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_ntsvcs.c ++++ b/source3/librpc/gen_ndr/ndr_ntsvcs.c +@@ -3466,7 +3466,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_Disconnect), + (ndr_push_flags_fn_t) ndr_push_PNP_Disconnect, + (ndr_pull_flags_fn_t) ndr_pull_PNP_Disconnect, +- (ndr_print_function_t) ndr_print_PNP_Disconnect, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3475,7 +3475,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_Connect), + (ndr_push_flags_fn_t) ndr_push_PNP_Connect, + (ndr_pull_flags_fn_t) ndr_pull_PNP_Connect, +- (ndr_print_function_t) ndr_print_PNP_Connect, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3484,7 +3484,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetVersion), + (ndr_push_flags_fn_t) ndr_push_PNP_GetVersion, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetVersion, +- (ndr_print_function_t) ndr_print_PNP_GetVersion, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3493,7 +3493,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetGlobalState), + (ndr_push_flags_fn_t) ndr_push_PNP_GetGlobalState, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetGlobalState, +- (ndr_print_function_t) ndr_print_PNP_GetGlobalState, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3502,7 +3502,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_InitDetection), + (ndr_push_flags_fn_t) ndr_push_PNP_InitDetection, + (ndr_pull_flags_fn_t) ndr_pull_PNP_InitDetection, +- (ndr_print_function_t) ndr_print_PNP_InitDetection, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3511,7 +3511,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_ReportLogOn), + (ndr_push_flags_fn_t) ndr_push_PNP_ReportLogOn, + (ndr_pull_flags_fn_t) ndr_pull_PNP_ReportLogOn, +- (ndr_print_function_t) ndr_print_PNP_ReportLogOn, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3520,7 +3520,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_ValidateDeviceInstance), + (ndr_push_flags_fn_t) ndr_push_PNP_ValidateDeviceInstance, + (ndr_pull_flags_fn_t) ndr_pull_PNP_ValidateDeviceInstance, +- (ndr_print_function_t) ndr_print_PNP_ValidateDeviceInstance, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3529,7 +3529,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetRootDeviceInstance), + (ndr_push_flags_fn_t) ndr_push_PNP_GetRootDeviceInstance, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetRootDeviceInstance, +- (ndr_print_function_t) ndr_print_PNP_GetRootDeviceInstance, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3538,7 +3538,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetRelatedDeviceInstance), + (ndr_push_flags_fn_t) ndr_push_PNP_GetRelatedDeviceInstance, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetRelatedDeviceInstance, +- (ndr_print_function_t) ndr_print_PNP_GetRelatedDeviceInstance, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3547,7 +3547,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_EnumerateSubKeys), + (ndr_push_flags_fn_t) ndr_push_PNP_EnumerateSubKeys, + (ndr_pull_flags_fn_t) ndr_pull_PNP_EnumerateSubKeys, +- (ndr_print_function_t) ndr_print_PNP_EnumerateSubKeys, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3556,7 +3556,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetDeviceList), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceList, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceList, +- (ndr_print_function_t) ndr_print_PNP_GetDeviceList, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3565,7 +3565,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetDeviceListSize), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceListSize, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceListSize, +- (ndr_print_function_t) ndr_print_PNP_GetDeviceListSize, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3574,7 +3574,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetDepth), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDepth, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDepth, +- (ndr_print_function_t) ndr_print_PNP_GetDepth, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3583,7 +3583,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetDeviceRegProp), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceRegProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceRegProp, +- (ndr_print_function_t) ndr_print_PNP_GetDeviceRegProp, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3592,7 +3592,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_SetDeviceRegProp), + (ndr_push_flags_fn_t) ndr_push_PNP_SetDeviceRegProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_SetDeviceRegProp, +- (ndr_print_function_t) ndr_print_PNP_SetDeviceRegProp, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3601,7 +3601,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetClassInstance), + (ndr_push_flags_fn_t) ndr_push_PNP_GetClassInstance, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassInstance, +- (ndr_print_function_t) ndr_print_PNP_GetClassInstance, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3610,7 +3610,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_CreateKey), + (ndr_push_flags_fn_t) ndr_push_PNP_CreateKey, + (ndr_pull_flags_fn_t) ndr_pull_PNP_CreateKey, +- (ndr_print_function_t) ndr_print_PNP_CreateKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3619,7 +3619,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_DeleteRegistryKey), + (ndr_push_flags_fn_t) ndr_push_PNP_DeleteRegistryKey, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DeleteRegistryKey, +- (ndr_print_function_t) ndr_print_PNP_DeleteRegistryKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3628,7 +3628,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetClassCount), + (ndr_push_flags_fn_t) ndr_push_PNP_GetClassCount, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassCount, +- (ndr_print_function_t) ndr_print_PNP_GetClassCount, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3637,7 +3637,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetClassName), + (ndr_push_flags_fn_t) ndr_push_PNP_GetClassName, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassName, +- (ndr_print_function_t) ndr_print_PNP_GetClassName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3646,7 +3646,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_DeleteClassKey), + (ndr_push_flags_fn_t) ndr_push_PNP_DeleteClassKey, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DeleteClassKey, +- (ndr_print_function_t) ndr_print_PNP_DeleteClassKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3655,7 +3655,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetInterfaceDeviceAlias), + (ndr_push_flags_fn_t) ndr_push_PNP_GetInterfaceDeviceAlias, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetInterfaceDeviceAlias, +- (ndr_print_function_t) ndr_print_PNP_GetInterfaceDeviceAlias, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3664,7 +3664,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetInterfaceDeviceList), + (ndr_push_flags_fn_t) ndr_push_PNP_GetInterfaceDeviceList, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetInterfaceDeviceList, +- (ndr_print_function_t) ndr_print_PNP_GetInterfaceDeviceList, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3673,7 +3673,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetInterfaceDeviceListSize), + (ndr_push_flags_fn_t) ndr_push_PNP_GetInterfaceDeviceListSize, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetInterfaceDeviceListSize, +- (ndr_print_function_t) ndr_print_PNP_GetInterfaceDeviceListSize, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3682,7 +3682,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_RegisterDeviceClassAssociation), + (ndr_push_flags_fn_t) ndr_push_PNP_RegisterDeviceClassAssociation, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RegisterDeviceClassAssociation, +- (ndr_print_function_t) ndr_print_PNP_RegisterDeviceClassAssociation, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3691,7 +3691,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_UnregisterDeviceClassAssociation), + (ndr_push_flags_fn_t) ndr_push_PNP_UnregisterDeviceClassAssociation, + (ndr_pull_flags_fn_t) ndr_pull_PNP_UnregisterDeviceClassAssociation, +- (ndr_print_function_t) ndr_print_PNP_UnregisterDeviceClassAssociation, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3700,7 +3700,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetClassRegProp), + (ndr_push_flags_fn_t) ndr_push_PNP_GetClassRegProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassRegProp, +- (ndr_print_function_t) ndr_print_PNP_GetClassRegProp, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3709,7 +3709,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_SetClassRegProp), + (ndr_push_flags_fn_t) ndr_push_PNP_SetClassRegProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_SetClassRegProp, +- (ndr_print_function_t) ndr_print_PNP_SetClassRegProp, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3718,7 +3718,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_CreateDevInst), + (ndr_push_flags_fn_t) ndr_push_PNP_CreateDevInst, + (ndr_pull_flags_fn_t) ndr_pull_PNP_CreateDevInst, +- (ndr_print_function_t) ndr_print_PNP_CreateDevInst, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3727,7 +3727,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_DeviceInstanceAction), + (ndr_push_flags_fn_t) ndr_push_PNP_DeviceInstanceAction, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DeviceInstanceAction, +- (ndr_print_function_t) ndr_print_PNP_DeviceInstanceAction, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3736,7 +3736,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetDeviceStatus), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceStatus, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceStatus, +- (ndr_print_function_t) ndr_print_PNP_GetDeviceStatus, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3745,7 +3745,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_SetDeviceProblem), + (ndr_push_flags_fn_t) ndr_push_PNP_SetDeviceProblem, + (ndr_pull_flags_fn_t) ndr_pull_PNP_SetDeviceProblem, +- (ndr_print_function_t) ndr_print_PNP_SetDeviceProblem, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3754,7 +3754,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_DisableDevInst), + (ndr_push_flags_fn_t) ndr_push_PNP_DisableDevInst, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DisableDevInst, +- (ndr_print_function_t) ndr_print_PNP_DisableDevInst, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3763,7 +3763,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_UninstallDevInst), + (ndr_push_flags_fn_t) ndr_push_PNP_UninstallDevInst, + (ndr_pull_flags_fn_t) ndr_pull_PNP_UninstallDevInst, +- (ndr_print_function_t) ndr_print_PNP_UninstallDevInst, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3772,7 +3772,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_AddID), + (ndr_push_flags_fn_t) ndr_push_PNP_AddID, + (ndr_pull_flags_fn_t) ndr_pull_PNP_AddID, +- (ndr_print_function_t) ndr_print_PNP_AddID, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3781,7 +3781,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_RegisterDriver), + (ndr_push_flags_fn_t) ndr_push_PNP_RegisterDriver, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RegisterDriver, +- (ndr_print_function_t) ndr_print_PNP_RegisterDriver, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3790,7 +3790,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_QueryRemove), + (ndr_push_flags_fn_t) ndr_push_PNP_QueryRemove, + (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryRemove, +- (ndr_print_function_t) ndr_print_PNP_QueryRemove, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3799,7 +3799,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_RequestDeviceEject), + (ndr_push_flags_fn_t) ndr_push_PNP_RequestDeviceEject, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RequestDeviceEject, +- (ndr_print_function_t) ndr_print_PNP_RequestDeviceEject, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3808,7 +3808,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_IsDockStationPresent), + (ndr_push_flags_fn_t) ndr_push_PNP_IsDockStationPresent, + (ndr_pull_flags_fn_t) ndr_pull_PNP_IsDockStationPresent, +- (ndr_print_function_t) ndr_print_PNP_IsDockStationPresent, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3817,7 +3817,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_RequestEjectPC), + (ndr_push_flags_fn_t) ndr_push_PNP_RequestEjectPC, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RequestEjectPC, +- (ndr_print_function_t) ndr_print_PNP_RequestEjectPC, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3826,7 +3826,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_HwProfFlags), + (ndr_push_flags_fn_t) ndr_push_PNP_HwProfFlags, + (ndr_pull_flags_fn_t) ndr_pull_PNP_HwProfFlags, +- (ndr_print_function_t) ndr_print_PNP_HwProfFlags, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3835,7 +3835,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetHwProfInfo), + (ndr_push_flags_fn_t) ndr_push_PNP_GetHwProfInfo, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetHwProfInfo, +- (ndr_print_function_t) ndr_print_PNP_GetHwProfInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3844,7 +3844,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_AddEmptyLogConf), + (ndr_push_flags_fn_t) ndr_push_PNP_AddEmptyLogConf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_AddEmptyLogConf, +- (ndr_print_function_t) ndr_print_PNP_AddEmptyLogConf, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3853,7 +3853,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_FreeLogConf), + (ndr_push_flags_fn_t) ndr_push_PNP_FreeLogConf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_FreeLogConf, +- (ndr_print_function_t) ndr_print_PNP_FreeLogConf, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3862,7 +3862,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetFirstLogConf), + (ndr_push_flags_fn_t) ndr_push_PNP_GetFirstLogConf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetFirstLogConf, +- (ndr_print_function_t) ndr_print_PNP_GetFirstLogConf, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3871,7 +3871,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetNextLogConf), + (ndr_push_flags_fn_t) ndr_push_PNP_GetNextLogConf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetNextLogConf, +- (ndr_print_function_t) ndr_print_PNP_GetNextLogConf, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3880,7 +3880,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetLogConfPriority), + (ndr_push_flags_fn_t) ndr_push_PNP_GetLogConfPriority, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetLogConfPriority, +- (ndr_print_function_t) ndr_print_PNP_GetLogConfPriority, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3889,7 +3889,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_AddResDes), + (ndr_push_flags_fn_t) ndr_push_PNP_AddResDes, + (ndr_pull_flags_fn_t) ndr_pull_PNP_AddResDes, +- (ndr_print_function_t) ndr_print_PNP_AddResDes, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3898,7 +3898,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_FreeResDes), + (ndr_push_flags_fn_t) ndr_push_PNP_FreeResDes, + (ndr_pull_flags_fn_t) ndr_pull_PNP_FreeResDes, +- (ndr_print_function_t) ndr_print_PNP_FreeResDes, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3907,7 +3907,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetNextResDes), + (ndr_push_flags_fn_t) ndr_push_PNP_GetNextResDes, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetNextResDes, +- (ndr_print_function_t) ndr_print_PNP_GetNextResDes, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3916,7 +3916,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetResDesData), + (ndr_push_flags_fn_t) ndr_push_PNP_GetResDesData, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetResDesData, +- (ndr_print_function_t) ndr_print_PNP_GetResDesData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3925,7 +3925,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetResDesDataSize), + (ndr_push_flags_fn_t) ndr_push_PNP_GetResDesDataSize, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetResDesDataSize, +- (ndr_print_function_t) ndr_print_PNP_GetResDesDataSize, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3934,7 +3934,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_ModifyResDes), + (ndr_push_flags_fn_t) ndr_push_PNP_ModifyResDes, + (ndr_pull_flags_fn_t) ndr_pull_PNP_ModifyResDes, +- (ndr_print_function_t) ndr_print_PNP_ModifyResDes, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3943,7 +3943,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_DetectResourceLimit), + (ndr_push_flags_fn_t) ndr_push_PNP_DetectResourceLimit, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DetectResourceLimit, +- (ndr_print_function_t) ndr_print_PNP_DetectResourceLimit, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3952,7 +3952,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_QueryResConfList), + (ndr_push_flags_fn_t) ndr_push_PNP_QueryResConfList, + (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryResConfList, +- (ndr_print_function_t) ndr_print_PNP_QueryResConfList, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3961,7 +3961,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_SetHwProf), + (ndr_push_flags_fn_t) ndr_push_PNP_SetHwProf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_SetHwProf, +- (ndr_print_function_t) ndr_print_PNP_SetHwProf, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3970,7 +3970,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_QueryArbitratorFreeData), + (ndr_push_flags_fn_t) ndr_push_PNP_QueryArbitratorFreeData, + (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryArbitratorFreeData, +- (ndr_print_function_t) ndr_print_PNP_QueryArbitratorFreeData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3979,7 +3979,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_QueryArbitratorFreeSize), + (ndr_push_flags_fn_t) ndr_push_PNP_QueryArbitratorFreeSize, + (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryArbitratorFreeSize, +- (ndr_print_function_t) ndr_print_PNP_QueryArbitratorFreeSize, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3988,7 +3988,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_RunDetection), + (ndr_push_flags_fn_t) ndr_push_PNP_RunDetection, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RunDetection, +- (ndr_print_function_t) ndr_print_PNP_RunDetection, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3997,7 +3997,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_RegisterNotification), + (ndr_push_flags_fn_t) ndr_push_PNP_RegisterNotification, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RegisterNotification, +- (ndr_print_function_t) ndr_print_PNP_RegisterNotification, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4006,7 +4006,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_UnregisterNotification), + (ndr_push_flags_fn_t) ndr_push_PNP_UnregisterNotification, + (ndr_pull_flags_fn_t) ndr_pull_PNP_UnregisterNotification, +- (ndr_print_function_t) ndr_print_PNP_UnregisterNotification, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4015,7 +4015,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetCustomDevProp), + (ndr_push_flags_fn_t) ndr_push_PNP_GetCustomDevProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetCustomDevProp, +- (ndr_print_function_t) ndr_print_PNP_GetCustomDevProp, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4024,7 +4024,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetVersionInternal), + (ndr_push_flags_fn_t) ndr_push_PNP_GetVersionInternal, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetVersionInternal, +- (ndr_print_function_t) ndr_print_PNP_GetVersionInternal, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4033,7 +4033,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetBlockedDriverInfo), + (ndr_push_flags_fn_t) ndr_push_PNP_GetBlockedDriverInfo, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetBlockedDriverInfo, +- (ndr_print_function_t) ndr_print_PNP_GetBlockedDriverInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4042,7 +4042,7 @@ static const struct ndr_interface_call n + sizeof(struct PNP_GetServerSideDeviceInstallFlags), + (ndr_push_flags_fn_t) ndr_push_PNP_GetServerSideDeviceInstallFlags, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetServerSideDeviceInstallFlags, +- (ndr_print_function_t) ndr_print_PNP_GetServerSideDeviceInstallFlags, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_oxidresolver.c ++++ b/source3/librpc/gen_ndr/ndr_oxidresolver.c +@@ -761,7 +761,7 @@ static const struct ndr_interface_call I + sizeof(struct ResolveOxid), + (ndr_push_flags_fn_t) ndr_push_ResolveOxid, + (ndr_pull_flags_fn_t) ndr_pull_ResolveOxid, +- (ndr_print_function_t) ndr_print_ResolveOxid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -770,7 +770,7 @@ static const struct ndr_interface_call I + sizeof(struct SimplePing), + (ndr_push_flags_fn_t) ndr_push_SimplePing, + (ndr_pull_flags_fn_t) ndr_pull_SimplePing, +- (ndr_print_function_t) ndr_print_SimplePing, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -779,7 +779,7 @@ static const struct ndr_interface_call I + sizeof(struct ComplexPing), + (ndr_push_flags_fn_t) ndr_push_ComplexPing, + (ndr_pull_flags_fn_t) ndr_pull_ComplexPing, +- (ndr_print_function_t) ndr_print_ComplexPing, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -788,7 +788,7 @@ static const struct ndr_interface_call I + sizeof(struct ServerAlive), + (ndr_push_flags_fn_t) ndr_push_ServerAlive, + (ndr_pull_flags_fn_t) ndr_pull_ServerAlive, +- (ndr_print_function_t) ndr_print_ServerAlive, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -797,7 +797,7 @@ static const struct ndr_interface_call I + sizeof(struct ResolveOxid2), + (ndr_push_flags_fn_t) ndr_push_ResolveOxid2, + (ndr_pull_flags_fn_t) ndr_pull_ResolveOxid2, +- (ndr_print_function_t) ndr_print_ResolveOxid2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -806,7 +806,7 @@ static const struct ndr_interface_call I + sizeof(struct ServerAlive2), + (ndr_push_flags_fn_t) ndr_push_ServerAlive2, + (ndr_pull_flags_fn_t) ndr_pull_ServerAlive2, +- (ndr_print_function_t) ndr_print_ServerAlive2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_policyagent.c ++++ b/source3/librpc/gen_ndr/ndr_policyagent.c +@@ -51,7 +51,7 @@ static const struct ndr_interface_call p + sizeof(struct policyagent_Dummy), + (ndr_push_flags_fn_t) ndr_push_policyagent_Dummy, + (ndr_pull_flags_fn_t) ndr_pull_policyagent_Dummy, +- (ndr_print_function_t) ndr_print_policyagent_Dummy, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_preg.c ++++ b/source3/librpc/gen_ndr/ndr_preg.c +@@ -204,7 +204,7 @@ static const struct ndr_interface_call p + sizeof(struct decode_preg_file), + (ndr_push_flags_fn_t) ndr_push_decode_preg_file, + (ndr_pull_flags_fn_t) ndr_pull_decode_preg_file, +- (ndr_print_function_t) ndr_print_decode_preg_file, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_remact.c ++++ b/source3/librpc/gen_ndr/ndr_remact.c +@@ -373,7 +373,7 @@ static const struct ndr_interface_call I + sizeof(struct RemoteActivation), + (ndr_push_flags_fn_t) ndr_push_RemoteActivation, + (ndr_pull_flags_fn_t) ndr_pull_RemoteActivation, +- (ndr_print_function_t) ndr_print_RemoteActivation, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_rot.c ++++ b/source3/librpc/gen_ndr/ndr_rot.c +@@ -489,7 +489,7 @@ static const struct ndr_interface_call r + sizeof(struct rot_add), + (ndr_push_flags_fn_t) ndr_push_rot_add, + (ndr_pull_flags_fn_t) ndr_pull_rot_add, +- (ndr_print_function_t) ndr_print_rot_add, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -498,7 +498,7 @@ static const struct ndr_interface_call r + sizeof(struct rot_remove), + (ndr_push_flags_fn_t) ndr_push_rot_remove, + (ndr_pull_flags_fn_t) ndr_pull_rot_remove, +- (ndr_print_function_t) ndr_print_rot_remove, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -507,7 +507,7 @@ static const struct ndr_interface_call r + sizeof(struct rot_is_listed), + (ndr_push_flags_fn_t) ndr_push_rot_is_listed, + (ndr_pull_flags_fn_t) ndr_pull_rot_is_listed, +- (ndr_print_function_t) ndr_print_rot_is_listed, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -516,7 +516,7 @@ static const struct ndr_interface_call r + sizeof(struct rot_get_interface_pointer), + (ndr_push_flags_fn_t) ndr_push_rot_get_interface_pointer, + (ndr_pull_flags_fn_t) ndr_pull_rot_get_interface_pointer, +- (ndr_print_function_t) ndr_print_rot_get_interface_pointer, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -525,7 +525,7 @@ static const struct ndr_interface_call r + sizeof(struct rot_set_modification_time), + (ndr_push_flags_fn_t) ndr_push_rot_set_modification_time, + (ndr_pull_flags_fn_t) ndr_pull_rot_set_modification_time, +- (ndr_print_function_t) ndr_print_rot_set_modification_time, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -534,7 +534,7 @@ static const struct ndr_interface_call r + sizeof(struct rot_get_modification_time), + (ndr_push_flags_fn_t) ndr_push_rot_get_modification_time, + (ndr_pull_flags_fn_t) ndr_pull_rot_get_modification_time, +- (ndr_print_function_t) ndr_print_rot_get_modification_time, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -543,7 +543,7 @@ static const struct ndr_interface_call r + sizeof(struct rot_enum), + (ndr_push_flags_fn_t) ndr_push_rot_enum, + (ndr_pull_flags_fn_t) ndr_pull_rot_enum, +- (ndr_print_function_t) ndr_print_rot_enum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_samr.c ++++ b/source3/librpc/gen_ndr/ndr_samr.c +@@ -12674,7 +12674,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_Connect), + (ndr_push_flags_fn_t) ndr_push_samr_Connect, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect, +- (ndr_print_function_t) ndr_print_samr_Connect, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12683,7 +12683,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_Close), + (ndr_push_flags_fn_t) ndr_push_samr_Close, + (ndr_pull_flags_fn_t) ndr_pull_samr_Close, +- (ndr_print_function_t) ndr_print_samr_Close, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12692,7 +12692,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_SetSecurity), + (ndr_push_flags_fn_t) ndr_push_samr_SetSecurity, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetSecurity, +- (ndr_print_function_t) ndr_print_samr_SetSecurity, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12701,7 +12701,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_QuerySecurity), + (ndr_push_flags_fn_t) ndr_push_samr_QuerySecurity, + (ndr_pull_flags_fn_t) ndr_pull_samr_QuerySecurity, +- (ndr_print_function_t) ndr_print_samr_QuerySecurity, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12710,7 +12710,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_Shutdown), + (ndr_push_flags_fn_t) ndr_push_samr_Shutdown, + (ndr_pull_flags_fn_t) ndr_pull_samr_Shutdown, +- (ndr_print_function_t) ndr_print_samr_Shutdown, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12719,7 +12719,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_LookupDomain), + (ndr_push_flags_fn_t) ndr_push_samr_LookupDomain, + (ndr_pull_flags_fn_t) ndr_pull_samr_LookupDomain, +- (ndr_print_function_t) ndr_print_samr_LookupDomain, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12728,7 +12728,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_EnumDomains), + (ndr_push_flags_fn_t) ndr_push_samr_EnumDomains, + (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomains, +- (ndr_print_function_t) ndr_print_samr_EnumDomains, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12737,7 +12737,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_OpenDomain), + (ndr_push_flags_fn_t) ndr_push_samr_OpenDomain, + (ndr_pull_flags_fn_t) ndr_pull_samr_OpenDomain, +- (ndr_print_function_t) ndr_print_samr_OpenDomain, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12746,7 +12746,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_QueryDomainInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDomainInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDomainInfo, +- (ndr_print_function_t) ndr_print_samr_QueryDomainInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12755,7 +12755,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_SetDomainInfo), + (ndr_push_flags_fn_t) ndr_push_samr_SetDomainInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetDomainInfo, +- (ndr_print_function_t) ndr_print_samr_SetDomainInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12764,7 +12764,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_CreateDomainGroup), + (ndr_push_flags_fn_t) ndr_push_samr_CreateDomainGroup, + (ndr_pull_flags_fn_t) ndr_pull_samr_CreateDomainGroup, +- (ndr_print_function_t) ndr_print_samr_CreateDomainGroup, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12773,7 +12773,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_EnumDomainGroups), + (ndr_push_flags_fn_t) ndr_push_samr_EnumDomainGroups, + (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomainGroups, +- (ndr_print_function_t) ndr_print_samr_EnumDomainGroups, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12782,7 +12782,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_CreateUser), + (ndr_push_flags_fn_t) ndr_push_samr_CreateUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_CreateUser, +- (ndr_print_function_t) ndr_print_samr_CreateUser, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12791,7 +12791,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_EnumDomainUsers), + (ndr_push_flags_fn_t) ndr_push_samr_EnumDomainUsers, + (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomainUsers, +- (ndr_print_function_t) ndr_print_samr_EnumDomainUsers, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12800,7 +12800,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_CreateDomAlias), + (ndr_push_flags_fn_t) ndr_push_samr_CreateDomAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_CreateDomAlias, +- (ndr_print_function_t) ndr_print_samr_CreateDomAlias, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12809,7 +12809,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_EnumDomainAliases), + (ndr_push_flags_fn_t) ndr_push_samr_EnumDomainAliases, + (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomainAliases, +- (ndr_print_function_t) ndr_print_samr_EnumDomainAliases, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12818,7 +12818,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_GetAliasMembership), + (ndr_push_flags_fn_t) ndr_push_samr_GetAliasMembership, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetAliasMembership, +- (ndr_print_function_t) ndr_print_samr_GetAliasMembership, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12827,7 +12827,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_LookupNames), + (ndr_push_flags_fn_t) ndr_push_samr_LookupNames, + (ndr_pull_flags_fn_t) ndr_pull_samr_LookupNames, +- (ndr_print_function_t) ndr_print_samr_LookupNames, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12836,7 +12836,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_LookupRids), + (ndr_push_flags_fn_t) ndr_push_samr_LookupRids, + (ndr_pull_flags_fn_t) ndr_pull_samr_LookupRids, +- (ndr_print_function_t) ndr_print_samr_LookupRids, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12845,7 +12845,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_OpenGroup), + (ndr_push_flags_fn_t) ndr_push_samr_OpenGroup, + (ndr_pull_flags_fn_t) ndr_pull_samr_OpenGroup, +- (ndr_print_function_t) ndr_print_samr_OpenGroup, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12854,7 +12854,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_QueryGroupInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryGroupInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryGroupInfo, +- (ndr_print_function_t) ndr_print_samr_QueryGroupInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12863,7 +12863,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_SetGroupInfo), + (ndr_push_flags_fn_t) ndr_push_samr_SetGroupInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetGroupInfo, +- (ndr_print_function_t) ndr_print_samr_SetGroupInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12872,7 +12872,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_AddGroupMember), + (ndr_push_flags_fn_t) ndr_push_samr_AddGroupMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_AddGroupMember, +- (ndr_print_function_t) ndr_print_samr_AddGroupMember, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12881,7 +12881,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_DeleteDomainGroup), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteDomainGroup, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteDomainGroup, +- (ndr_print_function_t) ndr_print_samr_DeleteDomainGroup, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12890,7 +12890,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_DeleteGroupMember), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteGroupMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteGroupMember, +- (ndr_print_function_t) ndr_print_samr_DeleteGroupMember, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12899,7 +12899,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_QueryGroupMember), + (ndr_push_flags_fn_t) ndr_push_samr_QueryGroupMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryGroupMember, +- (ndr_print_function_t) ndr_print_samr_QueryGroupMember, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12908,7 +12908,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_SetMemberAttributesOfGroup), + (ndr_push_flags_fn_t) ndr_push_samr_SetMemberAttributesOfGroup, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetMemberAttributesOfGroup, +- (ndr_print_function_t) ndr_print_samr_SetMemberAttributesOfGroup, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12917,7 +12917,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_OpenAlias), + (ndr_push_flags_fn_t) ndr_push_samr_OpenAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_OpenAlias, +- (ndr_print_function_t) ndr_print_samr_OpenAlias, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12926,7 +12926,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_QueryAliasInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryAliasInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryAliasInfo, +- (ndr_print_function_t) ndr_print_samr_QueryAliasInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12935,7 +12935,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_SetAliasInfo), + (ndr_push_flags_fn_t) ndr_push_samr_SetAliasInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetAliasInfo, +- (ndr_print_function_t) ndr_print_samr_SetAliasInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12944,7 +12944,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_DeleteDomAlias), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteDomAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteDomAlias, +- (ndr_print_function_t) ndr_print_samr_DeleteDomAlias, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12953,7 +12953,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_AddAliasMember), + (ndr_push_flags_fn_t) ndr_push_samr_AddAliasMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_AddAliasMember, +- (ndr_print_function_t) ndr_print_samr_AddAliasMember, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12962,7 +12962,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_DeleteAliasMember), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteAliasMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteAliasMember, +- (ndr_print_function_t) ndr_print_samr_DeleteAliasMember, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12971,7 +12971,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_GetMembersInAlias), + (ndr_push_flags_fn_t) ndr_push_samr_GetMembersInAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetMembersInAlias, +- (ndr_print_function_t) ndr_print_samr_GetMembersInAlias, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12980,7 +12980,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_OpenUser), + (ndr_push_flags_fn_t) ndr_push_samr_OpenUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_OpenUser, +- (ndr_print_function_t) ndr_print_samr_OpenUser, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12989,7 +12989,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_DeleteUser), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteUser, +- (ndr_print_function_t) ndr_print_samr_DeleteUser, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -12998,7 +12998,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_QueryUserInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryUserInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryUserInfo, +- (ndr_print_function_t) ndr_print_samr_QueryUserInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13007,7 +13007,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_SetUserInfo), + (ndr_push_flags_fn_t) ndr_push_samr_SetUserInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetUserInfo, +- (ndr_print_function_t) ndr_print_samr_SetUserInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13016,7 +13016,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_ChangePasswordUser), + (ndr_push_flags_fn_t) ndr_push_samr_ChangePasswordUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_ChangePasswordUser, +- (ndr_print_function_t) ndr_print_samr_ChangePasswordUser, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13025,7 +13025,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_GetGroupsForUser), + (ndr_push_flags_fn_t) ndr_push_samr_GetGroupsForUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetGroupsForUser, +- (ndr_print_function_t) ndr_print_samr_GetGroupsForUser, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13034,7 +13034,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_QueryDisplayInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDisplayInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDisplayInfo, +- (ndr_print_function_t) ndr_print_samr_QueryDisplayInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13043,7 +13043,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_GetDisplayEnumerationIndex), + (ndr_push_flags_fn_t) ndr_push_samr_GetDisplayEnumerationIndex, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetDisplayEnumerationIndex, +- (ndr_print_function_t) ndr_print_samr_GetDisplayEnumerationIndex, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13052,7 +13052,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_TestPrivateFunctionsDomain), + (ndr_push_flags_fn_t) ndr_push_samr_TestPrivateFunctionsDomain, + (ndr_pull_flags_fn_t) ndr_pull_samr_TestPrivateFunctionsDomain, +- (ndr_print_function_t) ndr_print_samr_TestPrivateFunctionsDomain, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13061,7 +13061,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_TestPrivateFunctionsUser), + (ndr_push_flags_fn_t) ndr_push_samr_TestPrivateFunctionsUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_TestPrivateFunctionsUser, +- (ndr_print_function_t) ndr_print_samr_TestPrivateFunctionsUser, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13070,7 +13070,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_GetUserPwInfo), + (ndr_push_flags_fn_t) ndr_push_samr_GetUserPwInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetUserPwInfo, +- (ndr_print_function_t) ndr_print_samr_GetUserPwInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13079,7 +13079,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_RemoveMemberFromForeignDomain), + (ndr_push_flags_fn_t) ndr_push_samr_RemoveMemberFromForeignDomain, + (ndr_pull_flags_fn_t) ndr_pull_samr_RemoveMemberFromForeignDomain, +- (ndr_print_function_t) ndr_print_samr_RemoveMemberFromForeignDomain, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13088,7 +13088,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_QueryDomainInfo2), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDomainInfo2, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDomainInfo2, +- (ndr_print_function_t) ndr_print_samr_QueryDomainInfo2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13097,7 +13097,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_QueryUserInfo2), + (ndr_push_flags_fn_t) ndr_push_samr_QueryUserInfo2, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryUserInfo2, +- (ndr_print_function_t) ndr_print_samr_QueryUserInfo2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13106,7 +13106,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_QueryDisplayInfo2), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDisplayInfo2, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDisplayInfo2, +- (ndr_print_function_t) ndr_print_samr_QueryDisplayInfo2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13115,7 +13115,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_GetDisplayEnumerationIndex2), + (ndr_push_flags_fn_t) ndr_push_samr_GetDisplayEnumerationIndex2, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetDisplayEnumerationIndex2, +- (ndr_print_function_t) ndr_print_samr_GetDisplayEnumerationIndex2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13124,7 +13124,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_CreateUser2), + (ndr_push_flags_fn_t) ndr_push_samr_CreateUser2, + (ndr_pull_flags_fn_t) ndr_pull_samr_CreateUser2, +- (ndr_print_function_t) ndr_print_samr_CreateUser2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13133,7 +13133,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_QueryDisplayInfo3), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDisplayInfo3, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDisplayInfo3, +- (ndr_print_function_t) ndr_print_samr_QueryDisplayInfo3, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13142,7 +13142,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_AddMultipleMembersToAlias), + (ndr_push_flags_fn_t) ndr_push_samr_AddMultipleMembersToAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_AddMultipleMembersToAlias, +- (ndr_print_function_t) ndr_print_samr_AddMultipleMembersToAlias, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13151,7 +13151,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_RemoveMultipleMembersFromAlias), + (ndr_push_flags_fn_t) ndr_push_samr_RemoveMultipleMembersFromAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_RemoveMultipleMembersFromAlias, +- (ndr_print_function_t) ndr_print_samr_RemoveMultipleMembersFromAlias, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13160,7 +13160,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_OemChangePasswordUser2), + (ndr_push_flags_fn_t) ndr_push_samr_OemChangePasswordUser2, + (ndr_pull_flags_fn_t) ndr_pull_samr_OemChangePasswordUser2, +- (ndr_print_function_t) ndr_print_samr_OemChangePasswordUser2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13169,7 +13169,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_ChangePasswordUser2), + (ndr_push_flags_fn_t) ndr_push_samr_ChangePasswordUser2, + (ndr_pull_flags_fn_t) ndr_pull_samr_ChangePasswordUser2, +- (ndr_print_function_t) ndr_print_samr_ChangePasswordUser2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13178,7 +13178,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_GetDomPwInfo), + (ndr_push_flags_fn_t) ndr_push_samr_GetDomPwInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetDomPwInfo, +- (ndr_print_function_t) ndr_print_samr_GetDomPwInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13187,7 +13187,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_Connect2), + (ndr_push_flags_fn_t) ndr_push_samr_Connect2, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect2, +- (ndr_print_function_t) ndr_print_samr_Connect2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13196,7 +13196,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_SetUserInfo2), + (ndr_push_flags_fn_t) ndr_push_samr_SetUserInfo2, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetUserInfo2, +- (ndr_print_function_t) ndr_print_samr_SetUserInfo2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13205,7 +13205,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_SetBootKeyInformation), + (ndr_push_flags_fn_t) ndr_push_samr_SetBootKeyInformation, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetBootKeyInformation, +- (ndr_print_function_t) ndr_print_samr_SetBootKeyInformation, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13214,7 +13214,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_GetBootKeyInformation), + (ndr_push_flags_fn_t) ndr_push_samr_GetBootKeyInformation, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetBootKeyInformation, +- (ndr_print_function_t) ndr_print_samr_GetBootKeyInformation, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13223,7 +13223,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_Connect3), + (ndr_push_flags_fn_t) ndr_push_samr_Connect3, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect3, +- (ndr_print_function_t) ndr_print_samr_Connect3, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13232,7 +13232,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_Connect4), + (ndr_push_flags_fn_t) ndr_push_samr_Connect4, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect4, +- (ndr_print_function_t) ndr_print_samr_Connect4, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13241,7 +13241,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_ChangePasswordUser3), + (ndr_push_flags_fn_t) ndr_push_samr_ChangePasswordUser3, + (ndr_pull_flags_fn_t) ndr_pull_samr_ChangePasswordUser3, +- (ndr_print_function_t) ndr_print_samr_ChangePasswordUser3, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13250,7 +13250,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_Connect5), + (ndr_push_flags_fn_t) ndr_push_samr_Connect5, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect5, +- (ndr_print_function_t) ndr_print_samr_Connect5, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13259,7 +13259,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_RidToSid), + (ndr_push_flags_fn_t) ndr_push_samr_RidToSid, + (ndr_pull_flags_fn_t) ndr_pull_samr_RidToSid, +- (ndr_print_function_t) ndr_print_samr_RidToSid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13268,7 +13268,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_SetDsrmPassword), + (ndr_push_flags_fn_t) ndr_push_samr_SetDsrmPassword, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetDsrmPassword, +- (ndr_print_function_t) ndr_print_samr_SetDsrmPassword, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -13277,7 +13277,7 @@ static const struct ndr_interface_call s + sizeof(struct samr_ValidatePassword), + (ndr_push_flags_fn_t) ndr_push_samr_ValidatePassword, + (ndr_pull_flags_fn_t) ndr_pull_samr_ValidatePassword, +- (ndr_print_function_t) ndr_print_samr_ValidatePassword, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_scerpc.c ++++ b/source3/librpc/gen_ndr/ndr_scerpc.c +@@ -51,7 +51,7 @@ static const struct ndr_interface_call s + sizeof(struct scerpc_Unknown0), + (ndr_push_flags_fn_t) ndr_push_scerpc_Unknown0, + (ndr_pull_flags_fn_t) ndr_pull_scerpc_Unknown0, +- (ndr_print_function_t) ndr_print_scerpc_Unknown0, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_spoolss.c ++++ b/source3/librpc/gen_ndr/ndr_spoolss.c +@@ -32660,7 +32660,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_EnumPrinters), + (ndr_push_flags_fn_t) ndr_push_spoolss_EnumPrinters, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_EnumPrinters, +- (ndr_print_function_t) ndr_print_spoolss_EnumPrinters, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32669,7 +32669,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_OpenPrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_OpenPrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_OpenPrinter, +- (ndr_print_function_t) ndr_print_spoolss_OpenPrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32678,7 +32678,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_SetJob), + (ndr_push_flags_fn_t) ndr_push_spoolss_SetJob, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_SetJob, +- (ndr_print_function_t) ndr_print_spoolss_SetJob, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32687,7 +32687,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_GetJob), + (ndr_push_flags_fn_t) ndr_push_spoolss_GetJob, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_GetJob, +- (ndr_print_function_t) ndr_print_spoolss_GetJob, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32696,7 +32696,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_EnumJobs), + (ndr_push_flags_fn_t) ndr_push_spoolss_EnumJobs, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_EnumJobs, +- (ndr_print_function_t) ndr_print_spoolss_EnumJobs, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32705,7 +32705,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_AddPrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_AddPrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_AddPrinter, +- (ndr_print_function_t) ndr_print_spoolss_AddPrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32714,7 +32714,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_DeletePrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_DeletePrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_DeletePrinter, +- (ndr_print_function_t) ndr_print_spoolss_DeletePrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32723,7 +32723,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_SetPrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_SetPrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_SetPrinter, +- (ndr_print_function_t) ndr_print_spoolss_SetPrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32732,7 +32732,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_GetPrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_GetPrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_GetPrinter, +- (ndr_print_function_t) ndr_print_spoolss_GetPrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32741,7 +32741,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_AddPrinterDriver), + (ndr_push_flags_fn_t) ndr_push_spoolss_AddPrinterDriver, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_AddPrinterDriver, +- (ndr_print_function_t) ndr_print_spoolss_AddPrinterDriver, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32750,7 +32750,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_EnumPrinterDrivers), + (ndr_push_flags_fn_t) ndr_push_spoolss_EnumPrinterDrivers, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_EnumPrinterDrivers, +- (ndr_print_function_t) ndr_print_spoolss_EnumPrinterDrivers, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32759,7 +32759,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_GetPrinterDriver), + (ndr_push_flags_fn_t) ndr_push_spoolss_GetPrinterDriver, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_GetPrinterDriver, +- (ndr_print_function_t) ndr_print_spoolss_GetPrinterDriver, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32768,7 +32768,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_GetPrinterDriverDirectory), + (ndr_push_flags_fn_t) ndr_push_spoolss_GetPrinterDriverDirectory, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_GetPrinterDriverDirectory, +- (ndr_print_function_t) ndr_print_spoolss_GetPrinterDriverDirectory, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32777,7 +32777,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_DeletePrinterDriver), + (ndr_push_flags_fn_t) ndr_push_spoolss_DeletePrinterDriver, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_DeletePrinterDriver, +- (ndr_print_function_t) ndr_print_spoolss_DeletePrinterDriver, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32786,7 +32786,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_AddPrintProcessor), + (ndr_push_flags_fn_t) ndr_push_spoolss_AddPrintProcessor, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_AddPrintProcessor, +- (ndr_print_function_t) ndr_print_spoolss_AddPrintProcessor, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32795,7 +32795,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_EnumPrintProcessors), + (ndr_push_flags_fn_t) ndr_push_spoolss_EnumPrintProcessors, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_EnumPrintProcessors, +- (ndr_print_function_t) ndr_print_spoolss_EnumPrintProcessors, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32804,7 +32804,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_GetPrintProcessorDirectory), + (ndr_push_flags_fn_t) ndr_push_spoolss_GetPrintProcessorDirectory, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_GetPrintProcessorDirectory, +- (ndr_print_function_t) ndr_print_spoolss_GetPrintProcessorDirectory, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32813,7 +32813,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_StartDocPrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_StartDocPrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_StartDocPrinter, +- (ndr_print_function_t) ndr_print_spoolss_StartDocPrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32822,7 +32822,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_StartPagePrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_StartPagePrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_StartPagePrinter, +- (ndr_print_function_t) ndr_print_spoolss_StartPagePrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32831,7 +32831,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_WritePrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_WritePrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_WritePrinter, +- (ndr_print_function_t) ndr_print_spoolss_WritePrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32840,7 +32840,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_EndPagePrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_EndPagePrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_EndPagePrinter, +- (ndr_print_function_t) ndr_print_spoolss_EndPagePrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32849,7 +32849,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_AbortPrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_AbortPrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_AbortPrinter, +- (ndr_print_function_t) ndr_print_spoolss_AbortPrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32858,7 +32858,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_ReadPrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_ReadPrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_ReadPrinter, +- (ndr_print_function_t) ndr_print_spoolss_ReadPrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32867,7 +32867,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_EndDocPrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_EndDocPrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_EndDocPrinter, +- (ndr_print_function_t) ndr_print_spoolss_EndDocPrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32876,7 +32876,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_AddJob), + (ndr_push_flags_fn_t) ndr_push_spoolss_AddJob, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_AddJob, +- (ndr_print_function_t) ndr_print_spoolss_AddJob, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32885,7 +32885,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_ScheduleJob), + (ndr_push_flags_fn_t) ndr_push_spoolss_ScheduleJob, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_ScheduleJob, +- (ndr_print_function_t) ndr_print_spoolss_ScheduleJob, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32894,7 +32894,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_GetPrinterData), + (ndr_push_flags_fn_t) ndr_push_spoolss_GetPrinterData, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_GetPrinterData, +- (ndr_print_function_t) ndr_print_spoolss_GetPrinterData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32903,7 +32903,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_SetPrinterData), + (ndr_push_flags_fn_t) ndr_push_spoolss_SetPrinterData, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_SetPrinterData, +- (ndr_print_function_t) ndr_print_spoolss_SetPrinterData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32912,7 +32912,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_WaitForPrinterChange), + (ndr_push_flags_fn_t) ndr_push_spoolss_WaitForPrinterChange, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_WaitForPrinterChange, +- (ndr_print_function_t) ndr_print_spoolss_WaitForPrinterChange, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32921,7 +32921,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_ClosePrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_ClosePrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_ClosePrinter, +- (ndr_print_function_t) ndr_print_spoolss_ClosePrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32930,7 +32930,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_AddForm), + (ndr_push_flags_fn_t) ndr_push_spoolss_AddForm, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_AddForm, +- (ndr_print_function_t) ndr_print_spoolss_AddForm, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32939,7 +32939,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_DeleteForm), + (ndr_push_flags_fn_t) ndr_push_spoolss_DeleteForm, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_DeleteForm, +- (ndr_print_function_t) ndr_print_spoolss_DeleteForm, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32948,7 +32948,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_GetForm), + (ndr_push_flags_fn_t) ndr_push_spoolss_GetForm, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_GetForm, +- (ndr_print_function_t) ndr_print_spoolss_GetForm, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32957,7 +32957,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_SetForm), + (ndr_push_flags_fn_t) ndr_push_spoolss_SetForm, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_SetForm, +- (ndr_print_function_t) ndr_print_spoolss_SetForm, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32966,7 +32966,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_EnumForms), + (ndr_push_flags_fn_t) ndr_push_spoolss_EnumForms, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_EnumForms, +- (ndr_print_function_t) ndr_print_spoolss_EnumForms, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32975,7 +32975,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_EnumPorts), + (ndr_push_flags_fn_t) ndr_push_spoolss_EnumPorts, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_EnumPorts, +- (ndr_print_function_t) ndr_print_spoolss_EnumPorts, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32984,7 +32984,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_EnumMonitors), + (ndr_push_flags_fn_t) ndr_push_spoolss_EnumMonitors, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_EnumMonitors, +- (ndr_print_function_t) ndr_print_spoolss_EnumMonitors, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -32993,7 +32993,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_AddPort), + (ndr_push_flags_fn_t) ndr_push_spoolss_AddPort, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_AddPort, +- (ndr_print_function_t) ndr_print_spoolss_AddPort, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33002,7 +33002,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_ConfigurePort), + (ndr_push_flags_fn_t) ndr_push_spoolss_ConfigurePort, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_ConfigurePort, +- (ndr_print_function_t) ndr_print_spoolss_ConfigurePort, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33011,7 +33011,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_DeletePort), + (ndr_push_flags_fn_t) ndr_push_spoolss_DeletePort, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_DeletePort, +- (ndr_print_function_t) ndr_print_spoolss_DeletePort, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33020,7 +33020,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_CreatePrinterIC), + (ndr_push_flags_fn_t) ndr_push_spoolss_CreatePrinterIC, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_CreatePrinterIC, +- (ndr_print_function_t) ndr_print_spoolss_CreatePrinterIC, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33029,7 +33029,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_PlayGDIScriptOnPrinterIC), + (ndr_push_flags_fn_t) ndr_push_spoolss_PlayGDIScriptOnPrinterIC, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_PlayGDIScriptOnPrinterIC, +- (ndr_print_function_t) ndr_print_spoolss_PlayGDIScriptOnPrinterIC, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33038,7 +33038,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_DeletePrinterIC), + (ndr_push_flags_fn_t) ndr_push_spoolss_DeletePrinterIC, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_DeletePrinterIC, +- (ndr_print_function_t) ndr_print_spoolss_DeletePrinterIC, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33047,7 +33047,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_AddPrinterConnection), + (ndr_push_flags_fn_t) ndr_push_spoolss_AddPrinterConnection, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_AddPrinterConnection, +- (ndr_print_function_t) ndr_print_spoolss_AddPrinterConnection, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33056,7 +33056,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_DeletePrinterConnection), + (ndr_push_flags_fn_t) ndr_push_spoolss_DeletePrinterConnection, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_DeletePrinterConnection, +- (ndr_print_function_t) ndr_print_spoolss_DeletePrinterConnection, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33065,7 +33065,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_PrinterMessageBox), + (ndr_push_flags_fn_t) ndr_push_spoolss_PrinterMessageBox, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_PrinterMessageBox, +- (ndr_print_function_t) ndr_print_spoolss_PrinterMessageBox, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33074,7 +33074,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_AddMonitor), + (ndr_push_flags_fn_t) ndr_push_spoolss_AddMonitor, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_AddMonitor, +- (ndr_print_function_t) ndr_print_spoolss_AddMonitor, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33083,7 +33083,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_DeleteMonitor), + (ndr_push_flags_fn_t) ndr_push_spoolss_DeleteMonitor, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_DeleteMonitor, +- (ndr_print_function_t) ndr_print_spoolss_DeleteMonitor, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33092,7 +33092,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_DeletePrintProcessor), + (ndr_push_flags_fn_t) ndr_push_spoolss_DeletePrintProcessor, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_DeletePrintProcessor, +- (ndr_print_function_t) ndr_print_spoolss_DeletePrintProcessor, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33101,7 +33101,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_AddPrintProvidor), + (ndr_push_flags_fn_t) ndr_push_spoolss_AddPrintProvidor, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_AddPrintProvidor, +- (ndr_print_function_t) ndr_print_spoolss_AddPrintProvidor, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33110,7 +33110,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_DeletePrintProvidor), + (ndr_push_flags_fn_t) ndr_push_spoolss_DeletePrintProvidor, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_DeletePrintProvidor, +- (ndr_print_function_t) ndr_print_spoolss_DeletePrintProvidor, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33119,7 +33119,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_EnumPrintProcDataTypes), + (ndr_push_flags_fn_t) ndr_push_spoolss_EnumPrintProcDataTypes, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_EnumPrintProcDataTypes, +- (ndr_print_function_t) ndr_print_spoolss_EnumPrintProcDataTypes, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33128,7 +33128,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_ResetPrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_ResetPrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_ResetPrinter, +- (ndr_print_function_t) ndr_print_spoolss_ResetPrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33137,7 +33137,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_GetPrinterDriver2), + (ndr_push_flags_fn_t) ndr_push_spoolss_GetPrinterDriver2, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_GetPrinterDriver2, +- (ndr_print_function_t) ndr_print_spoolss_GetPrinterDriver2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33146,7 +33146,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_FindFirstPrinterChangeNotification), + (ndr_push_flags_fn_t) ndr_push_spoolss_FindFirstPrinterChangeNotification, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_FindFirstPrinterChangeNotification, +- (ndr_print_function_t) ndr_print_spoolss_FindFirstPrinterChangeNotification, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33155,7 +33155,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_FindNextPrinterChangeNotification), + (ndr_push_flags_fn_t) ndr_push_spoolss_FindNextPrinterChangeNotification, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_FindNextPrinterChangeNotification, +- (ndr_print_function_t) ndr_print_spoolss_FindNextPrinterChangeNotification, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33164,7 +33164,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_FindClosePrinterNotify), + (ndr_push_flags_fn_t) ndr_push_spoolss_FindClosePrinterNotify, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_FindClosePrinterNotify, +- (ndr_print_function_t) ndr_print_spoolss_FindClosePrinterNotify, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33173,7 +33173,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_RouterFindFirstPrinterChangeNotificationOld), + (ndr_push_flags_fn_t) ndr_push_spoolss_RouterFindFirstPrinterChangeNotificationOld, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_RouterFindFirstPrinterChangeNotificationOld, +- (ndr_print_function_t) ndr_print_spoolss_RouterFindFirstPrinterChangeNotificationOld, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33182,7 +33182,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_ReplyOpenPrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_ReplyOpenPrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_ReplyOpenPrinter, +- (ndr_print_function_t) ndr_print_spoolss_ReplyOpenPrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33191,7 +33191,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_RouterReplyPrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_RouterReplyPrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_RouterReplyPrinter, +- (ndr_print_function_t) ndr_print_spoolss_RouterReplyPrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33200,7 +33200,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_ReplyClosePrinter), + (ndr_push_flags_fn_t) ndr_push_spoolss_ReplyClosePrinter, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_ReplyClosePrinter, +- (ndr_print_function_t) ndr_print_spoolss_ReplyClosePrinter, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33209,7 +33209,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_AddPortEx), + (ndr_push_flags_fn_t) ndr_push_spoolss_AddPortEx, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_AddPortEx, +- (ndr_print_function_t) ndr_print_spoolss_AddPortEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33218,7 +33218,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_RouterFindFirstPrinterChangeNotification), + (ndr_push_flags_fn_t) ndr_push_spoolss_RouterFindFirstPrinterChangeNotification, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_RouterFindFirstPrinterChangeNotification, +- (ndr_print_function_t) ndr_print_spoolss_RouterFindFirstPrinterChangeNotification, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33227,7 +33227,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_SpoolerInit), + (ndr_push_flags_fn_t) ndr_push_spoolss_SpoolerInit, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_SpoolerInit, +- (ndr_print_function_t) ndr_print_spoolss_SpoolerInit, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33236,7 +33236,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_ResetPrinterEx), + (ndr_push_flags_fn_t) ndr_push_spoolss_ResetPrinterEx, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_ResetPrinterEx, +- (ndr_print_function_t) ndr_print_spoolss_ResetPrinterEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33245,7 +33245,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_RemoteFindFirstPrinterChangeNotifyEx), + (ndr_push_flags_fn_t) ndr_push_spoolss_RemoteFindFirstPrinterChangeNotifyEx, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_RemoteFindFirstPrinterChangeNotifyEx, +- (ndr_print_function_t) ndr_print_spoolss_RemoteFindFirstPrinterChangeNotifyEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33254,7 +33254,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_RouterReplyPrinterEx), + (ndr_push_flags_fn_t) ndr_push_spoolss_RouterReplyPrinterEx, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_RouterReplyPrinterEx, +- (ndr_print_function_t) ndr_print_spoolss_RouterReplyPrinterEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33263,7 +33263,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_RouterRefreshPrinterChangeNotify), + (ndr_push_flags_fn_t) ndr_push_spoolss_RouterRefreshPrinterChangeNotify, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_RouterRefreshPrinterChangeNotify, +- (ndr_print_function_t) ndr_print_spoolss_RouterRefreshPrinterChangeNotify, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33272,7 +33272,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_44), + (ndr_push_flags_fn_t) ndr_push_spoolss_44, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_44, +- (ndr_print_function_t) ndr_print_spoolss_44, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33281,7 +33281,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_OpenPrinterEx), + (ndr_push_flags_fn_t) ndr_push_spoolss_OpenPrinterEx, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_OpenPrinterEx, +- (ndr_print_function_t) ndr_print_spoolss_OpenPrinterEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33290,7 +33290,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_AddPrinterEx), + (ndr_push_flags_fn_t) ndr_push_spoolss_AddPrinterEx, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_AddPrinterEx, +- (ndr_print_function_t) ndr_print_spoolss_AddPrinterEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33299,7 +33299,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_SetPort), + (ndr_push_flags_fn_t) ndr_push_spoolss_SetPort, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_SetPort, +- (ndr_print_function_t) ndr_print_spoolss_SetPort, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33308,7 +33308,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_EnumPrinterData), + (ndr_push_flags_fn_t) ndr_push_spoolss_EnumPrinterData, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_EnumPrinterData, +- (ndr_print_function_t) ndr_print_spoolss_EnumPrinterData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33317,7 +33317,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_DeletePrinterData), + (ndr_push_flags_fn_t) ndr_push_spoolss_DeletePrinterData, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_DeletePrinterData, +- (ndr_print_function_t) ndr_print_spoolss_DeletePrinterData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33326,7 +33326,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_4a), + (ndr_push_flags_fn_t) ndr_push_spoolss_4a, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_4a, +- (ndr_print_function_t) ndr_print_spoolss_4a, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33335,7 +33335,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_4b), + (ndr_push_flags_fn_t) ndr_push_spoolss_4b, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_4b, +- (ndr_print_function_t) ndr_print_spoolss_4b, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33344,7 +33344,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_4c), + (ndr_push_flags_fn_t) ndr_push_spoolss_4c, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_4c, +- (ndr_print_function_t) ndr_print_spoolss_4c, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33353,7 +33353,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_SetPrinterDataEx), + (ndr_push_flags_fn_t) ndr_push_spoolss_SetPrinterDataEx, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_SetPrinterDataEx, +- (ndr_print_function_t) ndr_print_spoolss_SetPrinterDataEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33362,7 +33362,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_GetPrinterDataEx), + (ndr_push_flags_fn_t) ndr_push_spoolss_GetPrinterDataEx, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_GetPrinterDataEx, +- (ndr_print_function_t) ndr_print_spoolss_GetPrinterDataEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33371,7 +33371,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_EnumPrinterDataEx), + (ndr_push_flags_fn_t) ndr_push_spoolss_EnumPrinterDataEx, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_EnumPrinterDataEx, +- (ndr_print_function_t) ndr_print_spoolss_EnumPrinterDataEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33380,7 +33380,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_EnumPrinterKey), + (ndr_push_flags_fn_t) ndr_push_spoolss_EnumPrinterKey, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_EnumPrinterKey, +- (ndr_print_function_t) ndr_print_spoolss_EnumPrinterKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33389,7 +33389,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_DeletePrinterDataEx), + (ndr_push_flags_fn_t) ndr_push_spoolss_DeletePrinterDataEx, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_DeletePrinterDataEx, +- (ndr_print_function_t) ndr_print_spoolss_DeletePrinterDataEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33398,7 +33398,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_DeletePrinterKey), + (ndr_push_flags_fn_t) ndr_push_spoolss_DeletePrinterKey, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_DeletePrinterKey, +- (ndr_print_function_t) ndr_print_spoolss_DeletePrinterKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33407,7 +33407,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_53), + (ndr_push_flags_fn_t) ndr_push_spoolss_53, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_53, +- (ndr_print_function_t) ndr_print_spoolss_53, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33416,7 +33416,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_DeletePrinterDriverEx), + (ndr_push_flags_fn_t) ndr_push_spoolss_DeletePrinterDriverEx, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_DeletePrinterDriverEx, +- (ndr_print_function_t) ndr_print_spoolss_DeletePrinterDriverEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33425,7 +33425,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_AddPerMachineConnection), + (ndr_push_flags_fn_t) ndr_push_spoolss_AddPerMachineConnection, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_AddPerMachineConnection, +- (ndr_print_function_t) ndr_print_spoolss_AddPerMachineConnection, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33434,7 +33434,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_DeletePerMachineConnection), + (ndr_push_flags_fn_t) ndr_push_spoolss_DeletePerMachineConnection, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_DeletePerMachineConnection, +- (ndr_print_function_t) ndr_print_spoolss_DeletePerMachineConnection, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33443,7 +33443,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_EnumPerMachineConnections), + (ndr_push_flags_fn_t) ndr_push_spoolss_EnumPerMachineConnections, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_EnumPerMachineConnections, +- (ndr_print_function_t) ndr_print_spoolss_EnumPerMachineConnections, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33452,7 +33452,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_XcvData), + (ndr_push_flags_fn_t) ndr_push_spoolss_XcvData, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_XcvData, +- (ndr_print_function_t) ndr_print_spoolss_XcvData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33461,7 +33461,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_AddPrinterDriverEx), + (ndr_push_flags_fn_t) ndr_push_spoolss_AddPrinterDriverEx, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_AddPrinterDriverEx, +- (ndr_print_function_t) ndr_print_spoolss_AddPrinterDriverEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33470,7 +33470,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_5a), + (ndr_push_flags_fn_t) ndr_push_spoolss_5a, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_5a, +- (ndr_print_function_t) ndr_print_spoolss_5a, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33479,7 +33479,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_5b), + (ndr_push_flags_fn_t) ndr_push_spoolss_5b, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_5b, +- (ndr_print_function_t) ndr_print_spoolss_5b, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33488,7 +33488,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_5c), + (ndr_push_flags_fn_t) ndr_push_spoolss_5c, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_5c, +- (ndr_print_function_t) ndr_print_spoolss_5c, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33497,7 +33497,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_5d), + (ndr_push_flags_fn_t) ndr_push_spoolss_5d, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_5d, +- (ndr_print_function_t) ndr_print_spoolss_5d, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33506,7 +33506,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_5e), + (ndr_push_flags_fn_t) ndr_push_spoolss_5e, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_5e, +- (ndr_print_function_t) ndr_print_spoolss_5e, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33515,7 +33515,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_5f), + (ndr_push_flags_fn_t) ndr_push_spoolss_5f, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_5f, +- (ndr_print_function_t) ndr_print_spoolss_5f, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33524,7 +33524,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_60), + (ndr_push_flags_fn_t) ndr_push_spoolss_60, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_60, +- (ndr_print_function_t) ndr_print_spoolss_60, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33533,7 +33533,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_61), + (ndr_push_flags_fn_t) ndr_push_spoolss_61, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_61, +- (ndr_print_function_t) ndr_print_spoolss_61, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33542,7 +33542,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_62), + (ndr_push_flags_fn_t) ndr_push_spoolss_62, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_62, +- (ndr_print_function_t) ndr_print_spoolss_62, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33551,7 +33551,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_63), + (ndr_push_flags_fn_t) ndr_push_spoolss_63, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_63, +- (ndr_print_function_t) ndr_print_spoolss_63, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33560,7 +33560,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_64), + (ndr_push_flags_fn_t) ndr_push_spoolss_64, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_64, +- (ndr_print_function_t) ndr_print_spoolss_64, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33569,7 +33569,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_65), + (ndr_push_flags_fn_t) ndr_push_spoolss_65, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_65, +- (ndr_print_function_t) ndr_print_spoolss_65, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33578,7 +33578,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_GetCorePrinterDrivers), + (ndr_push_flags_fn_t) ndr_push_spoolss_GetCorePrinterDrivers, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_GetCorePrinterDrivers, +- (ndr_print_function_t) ndr_print_spoolss_GetCorePrinterDrivers, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33587,7 +33587,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_67), + (ndr_push_flags_fn_t) ndr_push_spoolss_67, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_67, +- (ndr_print_function_t) ndr_print_spoolss_67, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33596,7 +33596,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_GetPrinterDriverPackagePath), + (ndr_push_flags_fn_t) ndr_push_spoolss_GetPrinterDriverPackagePath, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_GetPrinterDriverPackagePath, +- (ndr_print_function_t) ndr_print_spoolss_GetPrinterDriverPackagePath, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33605,7 +33605,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_69), + (ndr_push_flags_fn_t) ndr_push_spoolss_69, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_69, +- (ndr_print_function_t) ndr_print_spoolss_69, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33614,7 +33614,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_6a), + (ndr_push_flags_fn_t) ndr_push_spoolss_6a, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_6a, +- (ndr_print_function_t) ndr_print_spoolss_6a, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33623,7 +33623,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_6b), + (ndr_push_flags_fn_t) ndr_push_spoolss_6b, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_6b, +- (ndr_print_function_t) ndr_print_spoolss_6b, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33632,7 +33632,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_6c), + (ndr_push_flags_fn_t) ndr_push_spoolss_6c, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_6c, +- (ndr_print_function_t) ndr_print_spoolss_6c, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -33641,7 +33641,7 @@ static const struct ndr_interface_call s + sizeof(struct spoolss_6d), + (ndr_push_flags_fn_t) ndr_push_spoolss_6d, + (ndr_pull_flags_fn_t) ndr_pull_spoolss_6d, +- (ndr_print_function_t) ndr_print_spoolss_6d, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_srvsvc.c ++++ b/source3/librpc/gen_ndr/ndr_srvsvc.c +@@ -20229,7 +20229,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetCharDevEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevEnum, +- (ndr_print_function_t) ndr_print_srvsvc_NetCharDevEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20238,7 +20238,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetCharDevGetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevGetInfo, +- (ndr_print_function_t) ndr_print_srvsvc_NetCharDevGetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20247,7 +20247,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetCharDevControl), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevControl, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevControl, +- (ndr_print_function_t) ndr_print_srvsvc_NetCharDevControl, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20256,7 +20256,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetCharDevQEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQEnum, +- (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20265,7 +20265,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetCharDevQGetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQGetInfo, +- (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQGetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20274,7 +20274,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetCharDevQSetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQSetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQSetInfo, +- (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQSetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20283,7 +20283,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetCharDevQPurge), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQPurge, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQPurge, +- (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQPurge, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20292,7 +20292,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetCharDevQPurgeSelf), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQPurgeSelf, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQPurgeSelf, +- (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQPurgeSelf, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20301,7 +20301,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetConnEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetConnEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetConnEnum, +- (ndr_print_function_t) ndr_print_srvsvc_NetConnEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20310,7 +20310,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetFileEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetFileEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetFileEnum, +- (ndr_print_function_t) ndr_print_srvsvc_NetFileEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20319,7 +20319,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetFileGetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetFileGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetFileGetInfo, +- (ndr_print_function_t) ndr_print_srvsvc_NetFileGetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20328,7 +20328,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetFileClose), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetFileClose, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetFileClose, +- (ndr_print_function_t) ndr_print_srvsvc_NetFileClose, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20337,7 +20337,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetSessEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSessEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSessEnum, +- (ndr_print_function_t) ndr_print_srvsvc_NetSessEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20346,7 +20346,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetSessDel), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSessDel, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSessDel, +- (ndr_print_function_t) ndr_print_srvsvc_NetSessDel, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20355,7 +20355,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetShareAdd), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareAdd, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareAdd, +- (ndr_print_function_t) ndr_print_srvsvc_NetShareAdd, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20364,7 +20364,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetShareEnumAll), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareEnumAll, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareEnumAll, +- (ndr_print_function_t) ndr_print_srvsvc_NetShareEnumAll, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20373,7 +20373,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetShareGetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareGetInfo, +- (ndr_print_function_t) ndr_print_srvsvc_NetShareGetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20382,7 +20382,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetShareSetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareSetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareSetInfo, +- (ndr_print_function_t) ndr_print_srvsvc_NetShareSetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20391,7 +20391,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetShareDel), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareDel, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareDel, +- (ndr_print_function_t) ndr_print_srvsvc_NetShareDel, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20400,7 +20400,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetShareDelSticky), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareDelSticky, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareDelSticky, +- (ndr_print_function_t) ndr_print_srvsvc_NetShareDelSticky, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20409,7 +20409,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetShareCheck), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareCheck, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareCheck, +- (ndr_print_function_t) ndr_print_srvsvc_NetShareCheck, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20418,7 +20418,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetSrvGetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSrvGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSrvGetInfo, +- (ndr_print_function_t) ndr_print_srvsvc_NetSrvGetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20427,7 +20427,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetSrvSetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSrvSetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSrvSetInfo, +- (ndr_print_function_t) ndr_print_srvsvc_NetSrvSetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20436,7 +20436,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetDiskEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetDiskEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetDiskEnum, +- (ndr_print_function_t) ndr_print_srvsvc_NetDiskEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20445,7 +20445,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetServerStatisticsGet), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetServerStatisticsGet, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetServerStatisticsGet, +- (ndr_print_function_t) ndr_print_srvsvc_NetServerStatisticsGet, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20454,7 +20454,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetTransportAdd), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetTransportAdd, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetTransportAdd, +- (ndr_print_function_t) ndr_print_srvsvc_NetTransportAdd, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20463,7 +20463,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetTransportEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetTransportEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetTransportEnum, +- (ndr_print_function_t) ndr_print_srvsvc_NetTransportEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20472,7 +20472,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetTransportDel), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetTransportDel, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetTransportDel, +- (ndr_print_function_t) ndr_print_srvsvc_NetTransportDel, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20481,7 +20481,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetRemoteTOD), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetRemoteTOD, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetRemoteTOD, +- (ndr_print_function_t) ndr_print_srvsvc_NetRemoteTOD, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20490,7 +20490,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetSetServiceBits), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSetServiceBits, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSetServiceBits, +- (ndr_print_function_t) ndr_print_srvsvc_NetSetServiceBits, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20499,7 +20499,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetPathType), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetPathType, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetPathType, +- (ndr_print_function_t) ndr_print_srvsvc_NetPathType, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20508,7 +20508,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetPathCanonicalize), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetPathCanonicalize, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetPathCanonicalize, +- (ndr_print_function_t) ndr_print_srvsvc_NetPathCanonicalize, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20517,7 +20517,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetPathCompare), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetPathCompare, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetPathCompare, +- (ndr_print_function_t) ndr_print_srvsvc_NetPathCompare, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20526,7 +20526,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetNameValidate), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetNameValidate, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetNameValidate, +- (ndr_print_function_t) ndr_print_srvsvc_NetNameValidate, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20535,7 +20535,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NETRPRNAMECANONICALIZE), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRPRNAMECANONICALIZE, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRPRNAMECANONICALIZE, +- (ndr_print_function_t) ndr_print_srvsvc_NETRPRNAMECANONICALIZE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20544,7 +20544,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetPRNameCompare), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetPRNameCompare, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetPRNameCompare, +- (ndr_print_function_t) ndr_print_srvsvc_NetPRNameCompare, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20553,7 +20553,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetShareEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareEnum, +- (ndr_print_function_t) ndr_print_srvsvc_NetShareEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20562,7 +20562,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetShareDelStart), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareDelStart, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareDelStart, +- (ndr_print_function_t) ndr_print_srvsvc_NetShareDelStart, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20571,7 +20571,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetShareDelCommit), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareDelCommit, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareDelCommit, +- (ndr_print_function_t) ndr_print_srvsvc_NetShareDelCommit, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20580,7 +20580,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetGetFileSecurity), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetGetFileSecurity, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetGetFileSecurity, +- (ndr_print_function_t) ndr_print_srvsvc_NetGetFileSecurity, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20589,7 +20589,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetSetFileSecurity), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSetFileSecurity, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSetFileSecurity, +- (ndr_print_function_t) ndr_print_srvsvc_NetSetFileSecurity, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20598,7 +20598,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetServerTransportAddEx), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetServerTransportAddEx, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetServerTransportAddEx, +- (ndr_print_function_t) ndr_print_srvsvc_NetServerTransportAddEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20607,7 +20607,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NetServerSetServiceBitsEx), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetServerSetServiceBitsEx, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetServerSetServiceBitsEx, +- (ndr_print_function_t) ndr_print_srvsvc_NetServerSetServiceBitsEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20616,7 +20616,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NETRDFSGETVERSION), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSGETVERSION, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSGETVERSION, +- (ndr_print_function_t) ndr_print_srvsvc_NETRDFSGETVERSION, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20625,7 +20625,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NETRDFSCREATELOCALPARTITION), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSCREATELOCALPARTITION, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSCREATELOCALPARTITION, +- (ndr_print_function_t) ndr_print_srvsvc_NETRDFSCREATELOCALPARTITION, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20634,7 +20634,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NETRDFSDELETELOCALPARTITION), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSDELETELOCALPARTITION, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSDELETELOCALPARTITION, +- (ndr_print_function_t) ndr_print_srvsvc_NETRDFSDELETELOCALPARTITION, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20643,7 +20643,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NETRDFSSETLOCALVOLUMESTATE), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSSETLOCALVOLUMESTATE, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSSETLOCALVOLUMESTATE, +- (ndr_print_function_t) ndr_print_srvsvc_NETRDFSSETLOCALVOLUMESTATE, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20652,7 +20652,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NETRDFSSETSERVERINFO), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSSETSERVERINFO, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSSETSERVERINFO, +- (ndr_print_function_t) ndr_print_srvsvc_NETRDFSSETSERVERINFO, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20661,7 +20661,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NETRDFSCREATEEXITPOINT), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSCREATEEXITPOINT, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSCREATEEXITPOINT, +- (ndr_print_function_t) ndr_print_srvsvc_NETRDFSCREATEEXITPOINT, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20670,7 +20670,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NETRDFSDELETEEXITPOINT), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSDELETEEXITPOINT, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSDELETEEXITPOINT, +- (ndr_print_function_t) ndr_print_srvsvc_NETRDFSDELETEEXITPOINT, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20679,7 +20679,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NETRDFSMODIFYPREFIX), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSMODIFYPREFIX, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSMODIFYPREFIX, +- (ndr_print_function_t) ndr_print_srvsvc_NETRDFSMODIFYPREFIX, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20688,7 +20688,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NETRDFSFIXLOCALVOLUME), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSFIXLOCALVOLUME, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSFIXLOCALVOLUME, +- (ndr_print_function_t) ndr_print_srvsvc_NETRDFSFIXLOCALVOLUME, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20697,7 +20697,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NETRDFSMANAGERREPORTSITEINFO), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSMANAGERREPORTSITEINFO, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSMANAGERREPORTSITEINFO, +- (ndr_print_function_t) ndr_print_srvsvc_NETRDFSMANAGERREPORTSITEINFO, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -20706,7 +20706,7 @@ static const struct ndr_interface_call s + sizeof(struct srvsvc_NETRSERVERTRANSPORTDELEX), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRSERVERTRANSPORTDELEX, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRSERVERTRANSPORTDELEX, +- (ndr_print_function_t) ndr_print_srvsvc_NETRSERVERTRANSPORTDELEX, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_svcctl.c ++++ b/source3/librpc/gen_ndr/ndr_svcctl.c +@@ -7175,7 +7175,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_CloseServiceHandle), + (ndr_push_flags_fn_t) ndr_push_svcctl_CloseServiceHandle, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_CloseServiceHandle, +- (ndr_print_function_t) ndr_print_svcctl_CloseServiceHandle, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7184,7 +7184,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_ControlService), + (ndr_push_flags_fn_t) ndr_push_svcctl_ControlService, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_ControlService, +- (ndr_print_function_t) ndr_print_svcctl_ControlService, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7193,7 +7193,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_DeleteService), + (ndr_push_flags_fn_t) ndr_push_svcctl_DeleteService, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_DeleteService, +- (ndr_print_function_t) ndr_print_svcctl_DeleteService, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7202,7 +7202,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_LockServiceDatabase), + (ndr_push_flags_fn_t) ndr_push_svcctl_LockServiceDatabase, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_LockServiceDatabase, +- (ndr_print_function_t) ndr_print_svcctl_LockServiceDatabase, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7211,7 +7211,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_QueryServiceObjectSecurity), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceObjectSecurity, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceObjectSecurity, +- (ndr_print_function_t) ndr_print_svcctl_QueryServiceObjectSecurity, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7220,7 +7220,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_SetServiceObjectSecurity), + (ndr_push_flags_fn_t) ndr_push_svcctl_SetServiceObjectSecurity, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_SetServiceObjectSecurity, +- (ndr_print_function_t) ndr_print_svcctl_SetServiceObjectSecurity, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7229,7 +7229,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_QueryServiceStatus), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceStatus, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceStatus, +- (ndr_print_function_t) ndr_print_svcctl_QueryServiceStatus, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7238,7 +7238,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_SetServiceStatus), + (ndr_push_flags_fn_t) ndr_push_svcctl_SetServiceStatus, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_SetServiceStatus, +- (ndr_print_function_t) ndr_print_svcctl_SetServiceStatus, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7247,7 +7247,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_UnlockServiceDatabase), + (ndr_push_flags_fn_t) ndr_push_svcctl_UnlockServiceDatabase, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_UnlockServiceDatabase, +- (ndr_print_function_t) ndr_print_svcctl_UnlockServiceDatabase, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7256,7 +7256,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_NotifyBootConfigStatus), + (ndr_push_flags_fn_t) ndr_push_svcctl_NotifyBootConfigStatus, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_NotifyBootConfigStatus, +- (ndr_print_function_t) ndr_print_svcctl_NotifyBootConfigStatus, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7265,7 +7265,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_SCSetServiceBitsW), + (ndr_push_flags_fn_t) ndr_push_svcctl_SCSetServiceBitsW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_SCSetServiceBitsW, +- (ndr_print_function_t) ndr_print_svcctl_SCSetServiceBitsW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7274,7 +7274,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_ChangeServiceConfigW), + (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfigW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfigW, +- (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfigW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7283,7 +7283,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_CreateServiceW), + (ndr_push_flags_fn_t) ndr_push_svcctl_CreateServiceW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_CreateServiceW, +- (ndr_print_function_t) ndr_print_svcctl_CreateServiceW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7292,7 +7292,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_EnumDependentServicesW), + (ndr_push_flags_fn_t) ndr_push_svcctl_EnumDependentServicesW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumDependentServicesW, +- (ndr_print_function_t) ndr_print_svcctl_EnumDependentServicesW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7301,7 +7301,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_EnumServicesStatusW), + (ndr_push_flags_fn_t) ndr_push_svcctl_EnumServicesStatusW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumServicesStatusW, +- (ndr_print_function_t) ndr_print_svcctl_EnumServicesStatusW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7310,7 +7310,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_OpenSCManagerW), + (ndr_push_flags_fn_t) ndr_push_svcctl_OpenSCManagerW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenSCManagerW, +- (ndr_print_function_t) ndr_print_svcctl_OpenSCManagerW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7319,7 +7319,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_OpenServiceW), + (ndr_push_flags_fn_t) ndr_push_svcctl_OpenServiceW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenServiceW, +- (ndr_print_function_t) ndr_print_svcctl_OpenServiceW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7328,7 +7328,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_QueryServiceConfigW), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfigW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfigW, +- (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfigW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7337,7 +7337,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_QueryServiceLockStatusW), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceLockStatusW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceLockStatusW, +- (ndr_print_function_t) ndr_print_svcctl_QueryServiceLockStatusW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7346,7 +7346,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_StartServiceW), + (ndr_push_flags_fn_t) ndr_push_svcctl_StartServiceW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_StartServiceW, +- (ndr_print_function_t) ndr_print_svcctl_StartServiceW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7355,7 +7355,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_GetServiceDisplayNameW), + (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceDisplayNameW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceDisplayNameW, +- (ndr_print_function_t) ndr_print_svcctl_GetServiceDisplayNameW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7364,7 +7364,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_GetServiceKeyNameW), + (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceKeyNameW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceKeyNameW, +- (ndr_print_function_t) ndr_print_svcctl_GetServiceKeyNameW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7373,7 +7373,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_SCSetServiceBitsA), + (ndr_push_flags_fn_t) ndr_push_svcctl_SCSetServiceBitsA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_SCSetServiceBitsA, +- (ndr_print_function_t) ndr_print_svcctl_SCSetServiceBitsA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7382,7 +7382,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_ChangeServiceConfigA), + (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfigA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfigA, +- (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfigA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7391,7 +7391,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_CreateServiceA), + (ndr_push_flags_fn_t) ndr_push_svcctl_CreateServiceA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_CreateServiceA, +- (ndr_print_function_t) ndr_print_svcctl_CreateServiceA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7400,7 +7400,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_EnumDependentServicesA), + (ndr_push_flags_fn_t) ndr_push_svcctl_EnumDependentServicesA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumDependentServicesA, +- (ndr_print_function_t) ndr_print_svcctl_EnumDependentServicesA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7409,7 +7409,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_EnumServicesStatusA), + (ndr_push_flags_fn_t) ndr_push_svcctl_EnumServicesStatusA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumServicesStatusA, +- (ndr_print_function_t) ndr_print_svcctl_EnumServicesStatusA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7418,7 +7418,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_OpenSCManagerA), + (ndr_push_flags_fn_t) ndr_push_svcctl_OpenSCManagerA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenSCManagerA, +- (ndr_print_function_t) ndr_print_svcctl_OpenSCManagerA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7427,7 +7427,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_OpenServiceA), + (ndr_push_flags_fn_t) ndr_push_svcctl_OpenServiceA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenServiceA, +- (ndr_print_function_t) ndr_print_svcctl_OpenServiceA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7436,7 +7436,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_QueryServiceConfigA), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfigA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfigA, +- (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfigA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7445,7 +7445,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_QueryServiceLockStatusA), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceLockStatusA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceLockStatusA, +- (ndr_print_function_t) ndr_print_svcctl_QueryServiceLockStatusA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7454,7 +7454,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_StartServiceA), + (ndr_push_flags_fn_t) ndr_push_svcctl_StartServiceA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_StartServiceA, +- (ndr_print_function_t) ndr_print_svcctl_StartServiceA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7463,7 +7463,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_GetServiceDisplayNameA), + (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceDisplayNameA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceDisplayNameA, +- (ndr_print_function_t) ndr_print_svcctl_GetServiceDisplayNameA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7472,7 +7472,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_GetServiceKeyNameA), + (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceKeyNameA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceKeyNameA, +- (ndr_print_function_t) ndr_print_svcctl_GetServiceKeyNameA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7481,7 +7481,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_GetCurrentGroupeStateW), + (ndr_push_flags_fn_t) ndr_push_svcctl_GetCurrentGroupeStateW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetCurrentGroupeStateW, +- (ndr_print_function_t) ndr_print_svcctl_GetCurrentGroupeStateW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7490,7 +7490,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_EnumServiceGroupW), + (ndr_push_flags_fn_t) ndr_push_svcctl_EnumServiceGroupW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumServiceGroupW, +- (ndr_print_function_t) ndr_print_svcctl_EnumServiceGroupW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7499,7 +7499,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_ChangeServiceConfig2A), + (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfig2A, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfig2A, +- (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfig2A, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7508,7 +7508,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_ChangeServiceConfig2W), + (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfig2W, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfig2W, +- (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfig2W, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7517,7 +7517,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_QueryServiceConfig2A), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfig2A, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfig2A, +- (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfig2A, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7526,7 +7526,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_QueryServiceConfig2W), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfig2W, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfig2W, +- (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfig2W, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7535,7 +7535,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_QueryServiceStatusEx), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceStatusEx, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceStatusEx, +- (ndr_print_function_t) ndr_print_svcctl_QueryServiceStatusEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7544,7 +7544,7 @@ static const struct ndr_interface_call s + sizeof(struct EnumServicesStatusExA), + (ndr_push_flags_fn_t) ndr_push_EnumServicesStatusExA, + (ndr_pull_flags_fn_t) ndr_pull_EnumServicesStatusExA, +- (ndr_print_function_t) ndr_print_EnumServicesStatusExA, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7553,7 +7553,7 @@ static const struct ndr_interface_call s + sizeof(struct EnumServicesStatusExW), + (ndr_push_flags_fn_t) ndr_push_EnumServicesStatusExW, + (ndr_pull_flags_fn_t) ndr_pull_EnumServicesStatusExW, +- (ndr_print_function_t) ndr_print_EnumServicesStatusExW, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7562,7 +7562,7 @@ static const struct ndr_interface_call s + sizeof(struct svcctl_SCSendTSMessage), + (ndr_push_flags_fn_t) ndr_push_svcctl_SCSendTSMessage, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_SCSendTSMessage, +- (ndr_print_function_t) ndr_print_svcctl_SCSendTSMessage, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_trkwks.c ++++ b/source3/librpc/gen_ndr/ndr_trkwks.c +@@ -51,7 +51,7 @@ static const struct ndr_interface_call t + sizeof(struct trkwks_Unknown0), + (ndr_push_flags_fn_t) ndr_push_trkwks_Unknown0, + (ndr_pull_flags_fn_t) ndr_pull_trkwks_Unknown0, +- (ndr_print_function_t) ndr_print_trkwks_Unknown0, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_unixinfo.c ++++ b/source3/librpc/gen_ndr/ndr_unixinfo.c +@@ -472,7 +472,7 @@ static const struct ndr_interface_call u + sizeof(struct unixinfo_SidToUid), + (ndr_push_flags_fn_t) ndr_push_unixinfo_SidToUid, + (ndr_pull_flags_fn_t) ndr_pull_unixinfo_SidToUid, +- (ndr_print_function_t) ndr_print_unixinfo_SidToUid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -481,7 +481,7 @@ static const struct ndr_interface_call u + sizeof(struct unixinfo_UidToSid), + (ndr_push_flags_fn_t) ndr_push_unixinfo_UidToSid, + (ndr_pull_flags_fn_t) ndr_pull_unixinfo_UidToSid, +- (ndr_print_function_t) ndr_print_unixinfo_UidToSid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -490,7 +490,7 @@ static const struct ndr_interface_call u + sizeof(struct unixinfo_SidToGid), + (ndr_push_flags_fn_t) ndr_push_unixinfo_SidToGid, + (ndr_pull_flags_fn_t) ndr_pull_unixinfo_SidToGid, +- (ndr_print_function_t) ndr_print_unixinfo_SidToGid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -499,7 +499,7 @@ static const struct ndr_interface_call u + sizeof(struct unixinfo_GidToSid), + (ndr_push_flags_fn_t) ndr_push_unixinfo_GidToSid, + (ndr_pull_flags_fn_t) ndr_pull_unixinfo_GidToSid, +- (ndr_print_function_t) ndr_print_unixinfo_GidToSid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -508,7 +508,7 @@ static const struct ndr_interface_call u + sizeof(struct unixinfo_GetPWUid), + (ndr_push_flags_fn_t) ndr_push_unixinfo_GetPWUid, + (ndr_pull_flags_fn_t) ndr_pull_unixinfo_GetPWUid, +- (ndr_print_function_t) ndr_print_unixinfo_GetPWUid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_w32time.c ++++ b/source3/librpc/gen_ndr/ndr_w32time.c +@@ -135,7 +135,7 @@ static const struct ndr_interface_call w + sizeof(struct w32time_SyncTime), + (ndr_push_flags_fn_t) ndr_push_w32time_SyncTime, + (ndr_pull_flags_fn_t) ndr_pull_w32time_SyncTime, +- (ndr_print_function_t) ndr_print_w32time_SyncTime, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -144,7 +144,7 @@ static const struct ndr_interface_call w + sizeof(struct w32time_GetNetLogonServiceBits), + (ndr_push_flags_fn_t) ndr_push_w32time_GetNetLogonServiceBits, + (ndr_pull_flags_fn_t) ndr_pull_w32time_GetNetLogonServiceBits, +- (ndr_print_function_t) ndr_print_w32time_GetNetLogonServiceBits, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -153,7 +153,7 @@ static const struct ndr_interface_call w + sizeof(struct w32time_QueryProviderStatus), + (ndr_push_flags_fn_t) ndr_push_w32time_QueryProviderStatus, + (ndr_pull_flags_fn_t) ndr_pull_w32time_QueryProviderStatus, +- (ndr_print_function_t) ndr_print_w32time_QueryProviderStatus, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_wbint.c ++++ b/source3/librpc/gen_ndr/ndr_wbint.c +@@ -2696,7 +2696,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_Ping), + (ndr_push_flags_fn_t) ndr_push_wbint_Ping, + (ndr_pull_flags_fn_t) ndr_pull_wbint_Ping, +- (ndr_print_function_t) ndr_print_wbint_Ping, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2705,7 +2705,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_LookupSid), + (ndr_push_flags_fn_t) ndr_push_wbint_LookupSid, + (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupSid, +- (ndr_print_function_t) ndr_print_wbint_LookupSid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2714,7 +2714,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_LookupSids), + (ndr_push_flags_fn_t) ndr_push_wbint_LookupSids, + (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupSids, +- (ndr_print_function_t) ndr_print_wbint_LookupSids, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2723,7 +2723,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_LookupName), + (ndr_push_flags_fn_t) ndr_push_wbint_LookupName, + (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupName, +- (ndr_print_function_t) ndr_print_wbint_LookupName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2732,7 +2732,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_Sid2Uid), + (ndr_push_flags_fn_t) ndr_push_wbint_Sid2Uid, + (ndr_pull_flags_fn_t) ndr_pull_wbint_Sid2Uid, +- (ndr_print_function_t) ndr_print_wbint_Sid2Uid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2741,7 +2741,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_Sid2Gid), + (ndr_push_flags_fn_t) ndr_push_wbint_Sid2Gid, + (ndr_pull_flags_fn_t) ndr_pull_wbint_Sid2Gid, +- (ndr_print_function_t) ndr_print_wbint_Sid2Gid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2750,7 +2750,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_Sids2UnixIDs), + (ndr_push_flags_fn_t) ndr_push_wbint_Sids2UnixIDs, + (ndr_pull_flags_fn_t) ndr_pull_wbint_Sids2UnixIDs, +- (ndr_print_function_t) ndr_print_wbint_Sids2UnixIDs, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2759,7 +2759,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_Uid2Sid), + (ndr_push_flags_fn_t) ndr_push_wbint_Uid2Sid, + (ndr_pull_flags_fn_t) ndr_pull_wbint_Uid2Sid, +- (ndr_print_function_t) ndr_print_wbint_Uid2Sid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2768,7 +2768,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_Gid2Sid), + (ndr_push_flags_fn_t) ndr_push_wbint_Gid2Sid, + (ndr_pull_flags_fn_t) ndr_pull_wbint_Gid2Sid, +- (ndr_print_function_t) ndr_print_wbint_Gid2Sid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2777,7 +2777,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_AllocateUid), + (ndr_push_flags_fn_t) ndr_push_wbint_AllocateUid, + (ndr_pull_flags_fn_t) ndr_pull_wbint_AllocateUid, +- (ndr_print_function_t) ndr_print_wbint_AllocateUid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2786,7 +2786,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_AllocateGid), + (ndr_push_flags_fn_t) ndr_push_wbint_AllocateGid, + (ndr_pull_flags_fn_t) ndr_pull_wbint_AllocateGid, +- (ndr_print_function_t) ndr_print_wbint_AllocateGid, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2795,7 +2795,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_QueryUser), + (ndr_push_flags_fn_t) ndr_push_wbint_QueryUser, + (ndr_pull_flags_fn_t) ndr_pull_wbint_QueryUser, +- (ndr_print_function_t) ndr_print_wbint_QueryUser, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2804,7 +2804,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_LookupUserAliases), + (ndr_push_flags_fn_t) ndr_push_wbint_LookupUserAliases, + (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupUserAliases, +- (ndr_print_function_t) ndr_print_wbint_LookupUserAliases, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2813,7 +2813,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_LookupUserGroups), + (ndr_push_flags_fn_t) ndr_push_wbint_LookupUserGroups, + (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupUserGroups, +- (ndr_print_function_t) ndr_print_wbint_LookupUserGroups, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2822,7 +2822,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_QuerySequenceNumber), + (ndr_push_flags_fn_t) ndr_push_wbint_QuerySequenceNumber, + (ndr_pull_flags_fn_t) ndr_pull_wbint_QuerySequenceNumber, +- (ndr_print_function_t) ndr_print_wbint_QuerySequenceNumber, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2831,7 +2831,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_LookupGroupMembers), + (ndr_push_flags_fn_t) ndr_push_wbint_LookupGroupMembers, + (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupGroupMembers, +- (ndr_print_function_t) ndr_print_wbint_LookupGroupMembers, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2840,7 +2840,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_QueryUserList), + (ndr_push_flags_fn_t) ndr_push_wbint_QueryUserList, + (ndr_pull_flags_fn_t) ndr_pull_wbint_QueryUserList, +- (ndr_print_function_t) ndr_print_wbint_QueryUserList, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2849,7 +2849,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_QueryGroupList), + (ndr_push_flags_fn_t) ndr_push_wbint_QueryGroupList, + (ndr_pull_flags_fn_t) ndr_pull_wbint_QueryGroupList, +- (ndr_print_function_t) ndr_print_wbint_QueryGroupList, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2858,7 +2858,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_DsGetDcName), + (ndr_push_flags_fn_t) ndr_push_wbint_DsGetDcName, + (ndr_pull_flags_fn_t) ndr_pull_wbint_DsGetDcName, +- (ndr_print_function_t) ndr_print_wbint_DsGetDcName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2867,7 +2867,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_LookupRids), + (ndr_push_flags_fn_t) ndr_push_wbint_LookupRids, + (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupRids, +- (ndr_print_function_t) ndr_print_wbint_LookupRids, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2876,7 +2876,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_CheckMachineAccount), + (ndr_push_flags_fn_t) ndr_push_wbint_CheckMachineAccount, + (ndr_pull_flags_fn_t) ndr_pull_wbint_CheckMachineAccount, +- (ndr_print_function_t) ndr_print_wbint_CheckMachineAccount, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2885,7 +2885,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_ChangeMachineAccount), + (ndr_push_flags_fn_t) ndr_push_wbint_ChangeMachineAccount, + (ndr_pull_flags_fn_t) ndr_pull_wbint_ChangeMachineAccount, +- (ndr_print_function_t) ndr_print_wbint_ChangeMachineAccount, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -2894,7 +2894,7 @@ static const struct ndr_interface_call w + sizeof(struct wbint_PingDc), + (ndr_push_flags_fn_t) ndr_push_wbint_PingDc, + (ndr_pull_flags_fn_t) ndr_pull_wbint_PingDc, +- (ndr_print_function_t) ndr_print_wbint_PingDc, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_winreg.c ++++ b/source3/librpc/gen_ndr/ndr_winreg.c +@@ -4864,7 +4864,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_OpenHKCR), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKCR, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKCR, +- (ndr_print_function_t) ndr_print_winreg_OpenHKCR, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4873,7 +4873,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_OpenHKCU), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKCU, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKCU, +- (ndr_print_function_t) ndr_print_winreg_OpenHKCU, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4882,7 +4882,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_OpenHKLM), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKLM, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKLM, +- (ndr_print_function_t) ndr_print_winreg_OpenHKLM, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4891,7 +4891,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_OpenHKPD), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKPD, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKPD, +- (ndr_print_function_t) ndr_print_winreg_OpenHKPD, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4900,7 +4900,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_OpenHKU), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKU, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKU, +- (ndr_print_function_t) ndr_print_winreg_OpenHKU, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4909,7 +4909,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_CloseKey), + (ndr_push_flags_fn_t) ndr_push_winreg_CloseKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_CloseKey, +- (ndr_print_function_t) ndr_print_winreg_CloseKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4918,7 +4918,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_CreateKey), + (ndr_push_flags_fn_t) ndr_push_winreg_CreateKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_CreateKey, +- (ndr_print_function_t) ndr_print_winreg_CreateKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4927,7 +4927,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_DeleteKey), + (ndr_push_flags_fn_t) ndr_push_winreg_DeleteKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_DeleteKey, +- (ndr_print_function_t) ndr_print_winreg_DeleteKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4936,7 +4936,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_DeleteValue), + (ndr_push_flags_fn_t) ndr_push_winreg_DeleteValue, + (ndr_pull_flags_fn_t) ndr_pull_winreg_DeleteValue, +- (ndr_print_function_t) ndr_print_winreg_DeleteValue, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4945,7 +4945,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_EnumKey), + (ndr_push_flags_fn_t) ndr_push_winreg_EnumKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_EnumKey, +- (ndr_print_function_t) ndr_print_winreg_EnumKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4954,7 +4954,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_EnumValue), + (ndr_push_flags_fn_t) ndr_push_winreg_EnumValue, + (ndr_pull_flags_fn_t) ndr_pull_winreg_EnumValue, +- (ndr_print_function_t) ndr_print_winreg_EnumValue, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4963,7 +4963,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_FlushKey), + (ndr_push_flags_fn_t) ndr_push_winreg_FlushKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_FlushKey, +- (ndr_print_function_t) ndr_print_winreg_FlushKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4972,7 +4972,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_GetKeySecurity), + (ndr_push_flags_fn_t) ndr_push_winreg_GetKeySecurity, + (ndr_pull_flags_fn_t) ndr_pull_winreg_GetKeySecurity, +- (ndr_print_function_t) ndr_print_winreg_GetKeySecurity, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4981,7 +4981,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_LoadKey), + (ndr_push_flags_fn_t) ndr_push_winreg_LoadKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_LoadKey, +- (ndr_print_function_t) ndr_print_winreg_LoadKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4990,7 +4990,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_NotifyChangeKeyValue), + (ndr_push_flags_fn_t) ndr_push_winreg_NotifyChangeKeyValue, + (ndr_pull_flags_fn_t) ndr_pull_winreg_NotifyChangeKeyValue, +- (ndr_print_function_t) ndr_print_winreg_NotifyChangeKeyValue, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4999,7 +4999,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_OpenKey), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenKey, +- (ndr_print_function_t) ndr_print_winreg_OpenKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5008,7 +5008,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_QueryInfoKey), + (ndr_push_flags_fn_t) ndr_push_winreg_QueryInfoKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryInfoKey, +- (ndr_print_function_t) ndr_print_winreg_QueryInfoKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5017,7 +5017,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_QueryValue), + (ndr_push_flags_fn_t) ndr_push_winreg_QueryValue, + (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryValue, +- (ndr_print_function_t) ndr_print_winreg_QueryValue, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5026,7 +5026,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_ReplaceKey), + (ndr_push_flags_fn_t) ndr_push_winreg_ReplaceKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_ReplaceKey, +- (ndr_print_function_t) ndr_print_winreg_ReplaceKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5035,7 +5035,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_RestoreKey), + (ndr_push_flags_fn_t) ndr_push_winreg_RestoreKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_RestoreKey, +- (ndr_print_function_t) ndr_print_winreg_RestoreKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5044,7 +5044,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_SaveKey), + (ndr_push_flags_fn_t) ndr_push_winreg_SaveKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_SaveKey, +- (ndr_print_function_t) ndr_print_winreg_SaveKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5053,7 +5053,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_SetKeySecurity), + (ndr_push_flags_fn_t) ndr_push_winreg_SetKeySecurity, + (ndr_pull_flags_fn_t) ndr_pull_winreg_SetKeySecurity, +- (ndr_print_function_t) ndr_print_winreg_SetKeySecurity, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5062,7 +5062,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_SetValue), + (ndr_push_flags_fn_t) ndr_push_winreg_SetValue, + (ndr_pull_flags_fn_t) ndr_pull_winreg_SetValue, +- (ndr_print_function_t) ndr_print_winreg_SetValue, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5071,7 +5071,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_UnLoadKey), + (ndr_push_flags_fn_t) ndr_push_winreg_UnLoadKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_UnLoadKey, +- (ndr_print_function_t) ndr_print_winreg_UnLoadKey, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5080,7 +5080,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_InitiateSystemShutdown), + (ndr_push_flags_fn_t) ndr_push_winreg_InitiateSystemShutdown, + (ndr_pull_flags_fn_t) ndr_pull_winreg_InitiateSystemShutdown, +- (ndr_print_function_t) ndr_print_winreg_InitiateSystemShutdown, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5089,7 +5089,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_AbortSystemShutdown), + (ndr_push_flags_fn_t) ndr_push_winreg_AbortSystemShutdown, + (ndr_pull_flags_fn_t) ndr_pull_winreg_AbortSystemShutdown, +- (ndr_print_function_t) ndr_print_winreg_AbortSystemShutdown, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5098,7 +5098,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_GetVersion), + (ndr_push_flags_fn_t) ndr_push_winreg_GetVersion, + (ndr_pull_flags_fn_t) ndr_pull_winreg_GetVersion, +- (ndr_print_function_t) ndr_print_winreg_GetVersion, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5107,7 +5107,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_OpenHKCC), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKCC, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKCC, +- (ndr_print_function_t) ndr_print_winreg_OpenHKCC, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5116,7 +5116,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_OpenHKDD), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKDD, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKDD, +- (ndr_print_function_t) ndr_print_winreg_OpenHKDD, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5125,7 +5125,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_QueryMultipleValues), + (ndr_push_flags_fn_t) ndr_push_winreg_QueryMultipleValues, + (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryMultipleValues, +- (ndr_print_function_t) ndr_print_winreg_QueryMultipleValues, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5134,7 +5134,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_InitiateSystemShutdownEx), + (ndr_push_flags_fn_t) ndr_push_winreg_InitiateSystemShutdownEx, + (ndr_pull_flags_fn_t) ndr_pull_winreg_InitiateSystemShutdownEx, +- (ndr_print_function_t) ndr_print_winreg_InitiateSystemShutdownEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5143,7 +5143,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_SaveKeyEx), + (ndr_push_flags_fn_t) ndr_push_winreg_SaveKeyEx, + (ndr_pull_flags_fn_t) ndr_pull_winreg_SaveKeyEx, +- (ndr_print_function_t) ndr_print_winreg_SaveKeyEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5152,7 +5152,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_OpenHKPT), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKPT, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKPT, +- (ndr_print_function_t) ndr_print_winreg_OpenHKPT, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5161,7 +5161,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_OpenHKPN), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKPN, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKPN, +- (ndr_print_function_t) ndr_print_winreg_OpenHKPN, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5170,7 +5170,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_QueryMultipleValues2), + (ndr_push_flags_fn_t) ndr_push_winreg_QueryMultipleValues2, + (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryMultipleValues2, +- (ndr_print_function_t) ndr_print_winreg_QueryMultipleValues2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5179,7 +5179,7 @@ static const struct ndr_interface_call w + sizeof(struct winreg_DeleteKeyEx), + (ndr_push_flags_fn_t) ndr_push_winreg_DeleteKeyEx, + (ndr_pull_flags_fn_t) ndr_pull_winreg_DeleteKeyEx, +- (ndr_print_function_t) ndr_print_winreg_DeleteKeyEx, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_wkssvc.c ++++ b/source3/librpc/gen_ndr/ndr_wkssvc.c +@@ -11005,7 +11005,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetWkstaGetInfo), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetWkstaGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetWkstaGetInfo, +- (ndr_print_function_t) ndr_print_wkssvc_NetWkstaGetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11014,7 +11014,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetWkstaSetInfo), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetWkstaSetInfo, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetWkstaSetInfo, +- (ndr_print_function_t) ndr_print_wkssvc_NetWkstaSetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11023,7 +11023,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetWkstaEnumUsers), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetWkstaEnumUsers, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetWkstaEnumUsers, +- (ndr_print_function_t) ndr_print_wkssvc_NetWkstaEnumUsers, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11032,7 +11032,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrWkstaUserGetInfo), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWkstaUserGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWkstaUserGetInfo, +- (ndr_print_function_t) ndr_print_wkssvc_NetrWkstaUserGetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11041,7 +11041,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrWkstaUserSetInfo), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWkstaUserSetInfo, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWkstaUserSetInfo, +- (ndr_print_function_t) ndr_print_wkssvc_NetrWkstaUserSetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11050,7 +11050,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetWkstaTransportEnum), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetWkstaTransportEnum, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetWkstaTransportEnum, +- (ndr_print_function_t) ndr_print_wkssvc_NetWkstaTransportEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11059,7 +11059,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrWkstaTransportAdd), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWkstaTransportAdd, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWkstaTransportAdd, +- (ndr_print_function_t) ndr_print_wkssvc_NetrWkstaTransportAdd, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11068,7 +11068,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrWkstaTransportDel), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWkstaTransportDel, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWkstaTransportDel, +- (ndr_print_function_t) ndr_print_wkssvc_NetrWkstaTransportDel, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11077,7 +11077,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrUseAdd), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUseAdd, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUseAdd, +- (ndr_print_function_t) ndr_print_wkssvc_NetrUseAdd, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11086,7 +11086,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrUseGetInfo), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUseGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUseGetInfo, +- (ndr_print_function_t) ndr_print_wkssvc_NetrUseGetInfo, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11095,7 +11095,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrUseDel), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUseDel, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUseDel, +- (ndr_print_function_t) ndr_print_wkssvc_NetrUseDel, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11104,7 +11104,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrUseEnum), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUseEnum, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUseEnum, +- (ndr_print_function_t) ndr_print_wkssvc_NetrUseEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11113,7 +11113,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrMessageBufferSend), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrMessageBufferSend, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrMessageBufferSend, +- (ndr_print_function_t) ndr_print_wkssvc_NetrMessageBufferSend, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11122,7 +11122,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrWorkstationStatisticsGet), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWorkstationStatisticsGet, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWorkstationStatisticsGet, +- (ndr_print_function_t) ndr_print_wkssvc_NetrWorkstationStatisticsGet, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11131,7 +11131,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrLogonDomainNameAdd), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrLogonDomainNameAdd, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrLogonDomainNameAdd, +- (ndr_print_function_t) ndr_print_wkssvc_NetrLogonDomainNameAdd, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11140,7 +11140,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrLogonDomainNameDel), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrLogonDomainNameDel, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrLogonDomainNameDel, +- (ndr_print_function_t) ndr_print_wkssvc_NetrLogonDomainNameDel, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11149,7 +11149,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrJoinDomain), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrJoinDomain, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrJoinDomain, +- (ndr_print_function_t) ndr_print_wkssvc_NetrJoinDomain, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11158,7 +11158,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrUnjoinDomain), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUnjoinDomain, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUnjoinDomain, +- (ndr_print_function_t) ndr_print_wkssvc_NetrUnjoinDomain, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11167,7 +11167,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrRenameMachineInDomain), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrRenameMachineInDomain, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrRenameMachineInDomain, +- (ndr_print_function_t) ndr_print_wkssvc_NetrRenameMachineInDomain, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11176,7 +11176,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrValidateName), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrValidateName, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrValidateName, +- (ndr_print_function_t) ndr_print_wkssvc_NetrValidateName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11185,7 +11185,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrGetJoinInformation), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrGetJoinInformation, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrGetJoinInformation, +- (ndr_print_function_t) ndr_print_wkssvc_NetrGetJoinInformation, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11194,7 +11194,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrGetJoinableOus), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrGetJoinableOus, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrGetJoinableOus, +- (ndr_print_function_t) ndr_print_wkssvc_NetrGetJoinableOus, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11203,7 +11203,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrJoinDomain2), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrJoinDomain2, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrJoinDomain2, +- (ndr_print_function_t) ndr_print_wkssvc_NetrJoinDomain2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11212,7 +11212,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrUnjoinDomain2), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUnjoinDomain2, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUnjoinDomain2, +- (ndr_print_function_t) ndr_print_wkssvc_NetrUnjoinDomain2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11221,7 +11221,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrRenameMachineInDomain2), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrRenameMachineInDomain2, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrRenameMachineInDomain2, +- (ndr_print_function_t) ndr_print_wkssvc_NetrRenameMachineInDomain2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11230,7 +11230,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrValidateName2), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrValidateName2, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrValidateName2, +- (ndr_print_function_t) ndr_print_wkssvc_NetrValidateName2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11239,7 +11239,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrGetJoinableOus2), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrGetJoinableOus2, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrGetJoinableOus2, +- (ndr_print_function_t) ndr_print_wkssvc_NetrGetJoinableOus2, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11248,7 +11248,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrAddAlternateComputerName), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrAddAlternateComputerName, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrAddAlternateComputerName, +- (ndr_print_function_t) ndr_print_wkssvc_NetrAddAlternateComputerName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11257,7 +11257,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrRemoveAlternateComputerName), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrRemoveAlternateComputerName, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrRemoveAlternateComputerName, +- (ndr_print_function_t) ndr_print_wkssvc_NetrRemoveAlternateComputerName, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11266,7 +11266,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrSetPrimaryComputername), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrSetPrimaryComputername, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrSetPrimaryComputername, +- (ndr_print_function_t) ndr_print_wkssvc_NetrSetPrimaryComputername, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -11275,7 +11275,7 @@ static const struct ndr_interface_call w + sizeof(struct wkssvc_NetrEnumerateComputerNames), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrEnumerateComputerNames, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrEnumerateComputerNames, +- (ndr_print_function_t) ndr_print_wkssvc_NetrEnumerateComputerNames, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_wmi.c ++++ b/source3/librpc/gen_ndr/ndr_wmi.c +@@ -139,7 +139,7 @@ static const struct ndr_interface_call I + sizeof(struct Delete), + (ndr_push_flags_fn_t) ndr_push_Delete, + (ndr_pull_flags_fn_t) ndr_pull_Delete, +- (ndr_print_function_t) ndr_print_Delete, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3704,7 +3704,7 @@ static const struct ndr_interface_call I + sizeof(struct OpenNamespace), + (ndr_push_flags_fn_t) ndr_push_OpenNamespace, + (ndr_pull_flags_fn_t) ndr_pull_OpenNamespace, +- (ndr_print_function_t) ndr_print_OpenNamespace, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3713,7 +3713,7 @@ static const struct ndr_interface_call I + sizeof(struct CancelAsyncCall), + (ndr_push_flags_fn_t) ndr_push_CancelAsyncCall, + (ndr_pull_flags_fn_t) ndr_pull_CancelAsyncCall, +- (ndr_print_function_t) ndr_print_CancelAsyncCall, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3722,7 +3722,7 @@ static const struct ndr_interface_call I + sizeof(struct QueryObjectSink), + (ndr_push_flags_fn_t) ndr_push_QueryObjectSink, + (ndr_pull_flags_fn_t) ndr_pull_QueryObjectSink, +- (ndr_print_function_t) ndr_print_QueryObjectSink, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3731,7 +3731,7 @@ static const struct ndr_interface_call I + sizeof(struct GetObject), + (ndr_push_flags_fn_t) ndr_push_GetObject, + (ndr_pull_flags_fn_t) ndr_pull_GetObject, +- (ndr_print_function_t) ndr_print_GetObject, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3740,7 +3740,7 @@ static const struct ndr_interface_call I + sizeof(struct GetObjectAsync), + (ndr_push_flags_fn_t) ndr_push_GetObjectAsync, + (ndr_pull_flags_fn_t) ndr_pull_GetObjectAsync, +- (ndr_print_function_t) ndr_print_GetObjectAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3749,7 +3749,7 @@ static const struct ndr_interface_call I + sizeof(struct PutClass), + (ndr_push_flags_fn_t) ndr_push_PutClass, + (ndr_pull_flags_fn_t) ndr_pull_PutClass, +- (ndr_print_function_t) ndr_print_PutClass, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3758,7 +3758,7 @@ static const struct ndr_interface_call I + sizeof(struct PutClassAsync), + (ndr_push_flags_fn_t) ndr_push_PutClassAsync, + (ndr_pull_flags_fn_t) ndr_pull_PutClassAsync, +- (ndr_print_function_t) ndr_print_PutClassAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3767,7 +3767,7 @@ static const struct ndr_interface_call I + sizeof(struct DeleteClass), + (ndr_push_flags_fn_t) ndr_push_DeleteClass, + (ndr_pull_flags_fn_t) ndr_pull_DeleteClass, +- (ndr_print_function_t) ndr_print_DeleteClass, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3776,7 +3776,7 @@ static const struct ndr_interface_call I + sizeof(struct DeleteClassAsync), + (ndr_push_flags_fn_t) ndr_push_DeleteClassAsync, + (ndr_pull_flags_fn_t) ndr_pull_DeleteClassAsync, +- (ndr_print_function_t) ndr_print_DeleteClassAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3785,7 +3785,7 @@ static const struct ndr_interface_call I + sizeof(struct CreateClassEnum), + (ndr_push_flags_fn_t) ndr_push_CreateClassEnum, + (ndr_pull_flags_fn_t) ndr_pull_CreateClassEnum, +- (ndr_print_function_t) ndr_print_CreateClassEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3794,7 +3794,7 @@ static const struct ndr_interface_call I + sizeof(struct CreateClassEnumAsync), + (ndr_push_flags_fn_t) ndr_push_CreateClassEnumAsync, + (ndr_pull_flags_fn_t) ndr_pull_CreateClassEnumAsync, +- (ndr_print_function_t) ndr_print_CreateClassEnumAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3803,7 +3803,7 @@ static const struct ndr_interface_call I + sizeof(struct PutInstance), + (ndr_push_flags_fn_t) ndr_push_PutInstance, + (ndr_pull_flags_fn_t) ndr_pull_PutInstance, +- (ndr_print_function_t) ndr_print_PutInstance, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3812,7 +3812,7 @@ static const struct ndr_interface_call I + sizeof(struct PutInstanceAsync), + (ndr_push_flags_fn_t) ndr_push_PutInstanceAsync, + (ndr_pull_flags_fn_t) ndr_pull_PutInstanceAsync, +- (ndr_print_function_t) ndr_print_PutInstanceAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3821,7 +3821,7 @@ static const struct ndr_interface_call I + sizeof(struct DeleteInstance), + (ndr_push_flags_fn_t) ndr_push_DeleteInstance, + (ndr_pull_flags_fn_t) ndr_pull_DeleteInstance, +- (ndr_print_function_t) ndr_print_DeleteInstance, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3830,7 +3830,7 @@ static const struct ndr_interface_call I + sizeof(struct DeleteInstanceAsync), + (ndr_push_flags_fn_t) ndr_push_DeleteInstanceAsync, + (ndr_pull_flags_fn_t) ndr_pull_DeleteInstanceAsync, +- (ndr_print_function_t) ndr_print_DeleteInstanceAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3839,7 +3839,7 @@ static const struct ndr_interface_call I + sizeof(struct CreateInstanceEnum), + (ndr_push_flags_fn_t) ndr_push_CreateInstanceEnum, + (ndr_pull_flags_fn_t) ndr_pull_CreateInstanceEnum, +- (ndr_print_function_t) ndr_print_CreateInstanceEnum, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3848,7 +3848,7 @@ static const struct ndr_interface_call I + sizeof(struct CreateInstanceEnumAsync), + (ndr_push_flags_fn_t) ndr_push_CreateInstanceEnumAsync, + (ndr_pull_flags_fn_t) ndr_pull_CreateInstanceEnumAsync, +- (ndr_print_function_t) ndr_print_CreateInstanceEnumAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3857,7 +3857,7 @@ static const struct ndr_interface_call I + sizeof(struct ExecQuery), + (ndr_push_flags_fn_t) ndr_push_ExecQuery, + (ndr_pull_flags_fn_t) ndr_pull_ExecQuery, +- (ndr_print_function_t) ndr_print_ExecQuery, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3866,7 +3866,7 @@ static const struct ndr_interface_call I + sizeof(struct ExecQueryAsync), + (ndr_push_flags_fn_t) ndr_push_ExecQueryAsync, + (ndr_pull_flags_fn_t) ndr_pull_ExecQueryAsync, +- (ndr_print_function_t) ndr_print_ExecQueryAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3875,7 +3875,7 @@ static const struct ndr_interface_call I + sizeof(struct ExecNotificationQuery), + (ndr_push_flags_fn_t) ndr_push_ExecNotificationQuery, + (ndr_pull_flags_fn_t) ndr_pull_ExecNotificationQuery, +- (ndr_print_function_t) ndr_print_ExecNotificationQuery, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3884,7 +3884,7 @@ static const struct ndr_interface_call I + sizeof(struct ExecNotificationQueryAsync), + (ndr_push_flags_fn_t) ndr_push_ExecNotificationQueryAsync, + (ndr_pull_flags_fn_t) ndr_pull_ExecNotificationQueryAsync, +- (ndr_print_function_t) ndr_print_ExecNotificationQueryAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3893,7 +3893,7 @@ static const struct ndr_interface_call I + sizeof(struct ExecMethod), + (ndr_push_flags_fn_t) ndr_push_ExecMethod, + (ndr_pull_flags_fn_t) ndr_pull_ExecMethod, +- (ndr_print_function_t) ndr_print_ExecMethod, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -3902,7 +3902,7 @@ static const struct ndr_interface_call I + sizeof(struct ExecMethodAsync), + (ndr_push_flags_fn_t) ndr_push_ExecMethodAsync, + (ndr_pull_flags_fn_t) ndr_pull_ExecMethodAsync, +- (ndr_print_function_t) ndr_print_ExecMethodAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4434,7 +4434,7 @@ static const struct ndr_interface_call I + sizeof(struct Reset), + (ndr_push_flags_fn_t) ndr_push_Reset, + (ndr_pull_flags_fn_t) ndr_pull_Reset, +- (ndr_print_function_t) ndr_print_Reset, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4443,7 +4443,7 @@ static const struct ndr_interface_call I + sizeof(struct IEnumWbemClassObject_Next), + (ndr_push_flags_fn_t) ndr_push_IEnumWbemClassObject_Next, + (ndr_pull_flags_fn_t) ndr_pull_IEnumWbemClassObject_Next, +- (ndr_print_function_t) ndr_print_IEnumWbemClassObject_Next, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4452,7 +4452,7 @@ static const struct ndr_interface_call I + sizeof(struct NextAsync), + (ndr_push_flags_fn_t) ndr_push_NextAsync, + (ndr_pull_flags_fn_t) ndr_pull_NextAsync, +- (ndr_print_function_t) ndr_print_NextAsync, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4461,7 +4461,7 @@ static const struct ndr_interface_call I + sizeof(struct IEnumWbemClassObject_Clone), + (ndr_push_flags_fn_t) ndr_push_IEnumWbemClassObject_Clone, + (ndr_pull_flags_fn_t) ndr_pull_IEnumWbemClassObject_Clone, +- (ndr_print_function_t) ndr_print_IEnumWbemClassObject_Clone, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -4470,7 +4470,7 @@ static const struct ndr_interface_call I + sizeof(struct Skip), + (ndr_push_flags_fn_t) ndr_push_Skip, + (ndr_pull_flags_fn_t) ndr_pull_Skip, +- (ndr_print_function_t) ndr_print_Skip, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5143,7 +5143,7 @@ static const struct ndr_interface_call I + sizeof(struct Clone), + (ndr_push_flags_fn_t) ndr_push_Clone, + (ndr_pull_flags_fn_t) ndr_pull_Clone, +- (ndr_print_function_t) ndr_print_Clone, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5152,7 +5152,7 @@ static const struct ndr_interface_call I + sizeof(struct GetNames), + (ndr_push_flags_fn_t) ndr_push_GetNames, + (ndr_pull_flags_fn_t) ndr_pull_GetNames, +- (ndr_print_function_t) ndr_print_GetNames, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5161,7 +5161,7 @@ static const struct ndr_interface_call I + sizeof(struct BeginEnumeration), + (ndr_push_flags_fn_t) ndr_push_BeginEnumeration, + (ndr_pull_flags_fn_t) ndr_pull_BeginEnumeration, +- (ndr_print_function_t) ndr_print_BeginEnumeration, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5170,7 +5170,7 @@ static const struct ndr_interface_call I + sizeof(struct Next), + (ndr_push_flags_fn_t) ndr_push_Next, + (ndr_pull_flags_fn_t) ndr_pull_Next, +- (ndr_print_function_t) ndr_print_Next, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5179,7 +5179,7 @@ static const struct ndr_interface_call I + sizeof(struct EndEnumeration), + (ndr_push_flags_fn_t) ndr_push_EndEnumeration, + (ndr_pull_flags_fn_t) ndr_pull_EndEnumeration, +- (ndr_print_function_t) ndr_print_EndEnumeration, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5188,7 +5188,7 @@ static const struct ndr_interface_call I + sizeof(struct SetValue), + (ndr_push_flags_fn_t) ndr_push_SetValue, + (ndr_pull_flags_fn_t) ndr_pull_SetValue, +- (ndr_print_function_t) ndr_print_SetValue, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5197,7 +5197,7 @@ static const struct ndr_interface_call I + sizeof(struct GetValue), + (ndr_push_flags_fn_t) ndr_push_GetValue, + (ndr_pull_flags_fn_t) ndr_pull_GetValue, +- (ndr_print_function_t) ndr_print_GetValue, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5206,7 +5206,7 @@ static const struct ndr_interface_call I + sizeof(struct DeleteValue), + (ndr_push_flags_fn_t) ndr_push_DeleteValue, + (ndr_pull_flags_fn_t) ndr_pull_DeleteValue, +- (ndr_print_function_t) ndr_print_DeleteValue, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5215,7 +5215,7 @@ static const struct ndr_interface_call I + sizeof(struct DeleteAll), + (ndr_push_flags_fn_t) ndr_push_DeleteAll, + (ndr_pull_flags_fn_t) ndr_pull_DeleteAll, +- (ndr_print_function_t) ndr_print_DeleteAll, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5963,7 +5963,7 @@ static const struct ndr_interface_call I + sizeof(struct EstablishPosition), + (ndr_push_flags_fn_t) ndr_push_EstablishPosition, + (ndr_pull_flags_fn_t) ndr_pull_EstablishPosition, +- (ndr_print_function_t) ndr_print_EstablishPosition, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5972,7 +5972,7 @@ static const struct ndr_interface_call I + sizeof(struct RequestChallenge), + (ndr_push_flags_fn_t) ndr_push_RequestChallenge, + (ndr_pull_flags_fn_t) ndr_pull_RequestChallenge, +- (ndr_print_function_t) ndr_print_RequestChallenge, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5981,7 +5981,7 @@ static const struct ndr_interface_call I + sizeof(struct WBEMLogin), + (ndr_push_flags_fn_t) ndr_push_WBEMLogin, + (ndr_pull_flags_fn_t) ndr_pull_WBEMLogin, +- (ndr_print_function_t) ndr_print_WBEMLogin, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -5990,7 +5990,7 @@ static const struct ndr_interface_call I + sizeof(struct NTLMLogin), + (ndr_push_flags_fn_t) ndr_push_NTLMLogin, + (ndr_pull_flags_fn_t) ndr_pull_NTLMLogin, +- (ndr_print_function_t) ndr_print_NTLMLogin, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6225,7 +6225,7 @@ static const struct ndr_interface_call I + sizeof(struct IWbemWCOSmartEnum_Next), + (ndr_push_flags_fn_t) ndr_push_IWbemWCOSmartEnum_Next, + (ndr_pull_flags_fn_t) ndr_pull_IWbemWCOSmartEnum_Next, +- (ndr_print_function_t) ndr_print_IWbemWCOSmartEnum_Next, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6479,7 +6479,7 @@ static const struct ndr_interface_call I + sizeof(struct Fetch), + (ndr_push_flags_fn_t) ndr_push_Fetch, + (ndr_pull_flags_fn_t) ndr_pull_Fetch, +- (ndr_print_function_t) ndr_print_Fetch, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6488,7 +6488,7 @@ static const struct ndr_interface_call I + sizeof(struct Test), + (ndr_push_flags_fn_t) ndr_push_Test, + (ndr_pull_flags_fn_t) ndr_pull_Test, +- (ndr_print_function_t) ndr_print_Test, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6920,7 +6920,7 @@ static const struct ndr_interface_call I + sizeof(struct GetResultObject), + (ndr_push_flags_fn_t) ndr_push_GetResultObject, + (ndr_pull_flags_fn_t) ndr_pull_GetResultObject, +- (ndr_print_function_t) ndr_print_GetResultObject, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6929,7 +6929,7 @@ static const struct ndr_interface_call I + sizeof(struct GetResultString), + (ndr_push_flags_fn_t) ndr_push_GetResultString, + (ndr_pull_flags_fn_t) ndr_pull_GetResultString, +- (ndr_print_function_t) ndr_print_GetResultString, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6938,7 +6938,7 @@ static const struct ndr_interface_call I + sizeof(struct GetResultServices), + (ndr_push_flags_fn_t) ndr_push_GetResultServices, + (ndr_pull_flags_fn_t) ndr_pull_GetResultServices, +- (ndr_print_function_t) ndr_print_GetResultServices, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -6947,7 +6947,7 @@ static const struct ndr_interface_call I + sizeof(struct GetCallStatus), + (ndr_push_flags_fn_t) ndr_push_GetCallStatus, + (ndr_pull_flags_fn_t) ndr_pull_GetCallStatus, +- (ndr_print_function_t) ndr_print_GetCallStatus, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7211,7 +7211,7 @@ static const struct ndr_interface_call I + sizeof(struct SetStatus), + (ndr_push_flags_fn_t) ndr_push_SetStatus, + (ndr_pull_flags_fn_t) ndr_pull_SetStatus, +- (ndr_print_function_t) ndr_print_SetStatus, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -7220,7 +7220,7 @@ static const struct ndr_interface_call I + sizeof(struct Indicate), + (ndr_push_flags_fn_t) ndr_push_Indicate, + (ndr_pull_flags_fn_t) ndr_pull_Indicate, +- (ndr_print_function_t) ndr_print_Indicate, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_wzcsvc.c ++++ b/source3/librpc/gen_ndr/ndr_wzcsvc.c +@@ -711,7 +711,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_EnumInterfaces), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_EnumInterfaces, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_EnumInterfaces, +- (ndr_print_function_t) ndr_print_wzcsvc_EnumInterfaces, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -720,7 +720,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_QueryInterface), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_QueryInterface, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_QueryInterface, +- (ndr_print_function_t) ndr_print_wzcsvc_QueryInterface, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -729,7 +729,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_SetInterface), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_SetInterface, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_SetInterface, +- (ndr_print_function_t) ndr_print_wzcsvc_SetInterface, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -738,7 +738,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_RefreshInterface), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_RefreshInterface, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_RefreshInterface, +- (ndr_print_function_t) ndr_print_wzcsvc_RefreshInterface, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -747,7 +747,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_QueryContext), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_QueryContext, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_QueryContext, +- (ndr_print_function_t) ndr_print_wzcsvc_QueryContext, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -756,7 +756,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_SetContext), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_SetContext, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_SetContext, +- (ndr_print_function_t) ndr_print_wzcsvc_SetContext, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -765,7 +765,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_EapolUIResponse), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_EapolUIResponse, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_EapolUIResponse, +- (ndr_print_function_t) ndr_print_wzcsvc_EapolUIResponse, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -774,7 +774,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_EapolGetCustomAuthData), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_EapolGetCustomAuthData, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_EapolGetCustomAuthData, +- (ndr_print_function_t) ndr_print_wzcsvc_EapolGetCustomAuthData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -783,7 +783,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_EapolSetCustomAuthData), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_EapolSetCustomAuthData, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_EapolSetCustomAuthData, +- (ndr_print_function_t) ndr_print_wzcsvc_EapolSetCustomAuthData, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -792,7 +792,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_EapolGetInterfaceParams), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_EapolGetInterfaceParams, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_EapolGetInterfaceParams, +- (ndr_print_function_t) ndr_print_wzcsvc_EapolGetInterfaceParams, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -801,7 +801,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_EapolSetInterfaceParams), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_EapolSetInterfaceParams, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_EapolSetInterfaceParams, +- (ndr_print_function_t) ndr_print_wzcsvc_EapolSetInterfaceParams, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -810,7 +810,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_EapolReAuthenticateInterface), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_EapolReAuthenticateInterface, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_EapolReAuthenticateInterface, +- (ndr_print_function_t) ndr_print_wzcsvc_EapolReAuthenticateInterface, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -819,7 +819,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_EapolQueryInterfaceState), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_EapolQueryInterfaceState, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_EapolQueryInterfaceState, +- (ndr_print_function_t) ndr_print_wzcsvc_EapolQueryInterfaceState, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -828,7 +828,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_OpenWZCDbLogSession), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_OpenWZCDbLogSession, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_OpenWZCDbLogSession, +- (ndr_print_function_t) ndr_print_wzcsvc_OpenWZCDbLogSession, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -837,7 +837,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_CloseWZCDbLogSession), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_CloseWZCDbLogSession, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_CloseWZCDbLogSession, +- (ndr_print_function_t) ndr_print_wzcsvc_CloseWZCDbLogSession, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -846,7 +846,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_EnumWZCDbLogRecords), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_EnumWZCDbLogRecords, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_EnumWZCDbLogRecords, +- (ndr_print_function_t) ndr_print_wzcsvc_EnumWZCDbLogRecords, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -855,7 +855,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_FlushWZCdbLog), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_FlushWZCdbLog, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_FlushWZCdbLog, +- (ndr_print_function_t) ndr_print_wzcsvc_FlushWZCdbLog, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +@@ -864,7 +864,7 @@ static const struct ndr_interface_call w + sizeof(struct wzcsvc_GetWZCDbLogRecord), + (ndr_push_flags_fn_t) ndr_push_wzcsvc_GetWZCDbLogRecord, + (ndr_pull_flags_fn_t) ndr_pull_wzcsvc_GetWZCDbLogRecord, +- (ndr_print_function_t) ndr_print_wzcsvc_GetWZCDbLogRecord, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- a/source3/librpc/gen_ndr/ndr_xattr.c ++++ b/source3/librpc/gen_ndr/ndr_xattr.c +@@ -1101,7 +1101,7 @@ static const struct ndr_interface_call x + sizeof(struct xattr_parse_DOSATTRIB), + (ndr_push_flags_fn_t) ndr_push_xattr_parse_DOSATTRIB, + (ndr_pull_flags_fn_t) ndr_pull_xattr_parse_DOSATTRIB, +- (ndr_print_function_t) ndr_print_xattr_parse_DOSATTRIB, ++ (ndr_print_function_t) ndr_print_disabled, + { 0, NULL }, + { 0, NULL }, + }, +--- /dev/null ++++ b/source3/remove-librpc-print-calls.sh +@@ -0,0 +1,22 @@ ++#!/usr/bin/env bash ++set -e ++for file in ${1:-librpc/gen_ndr/ndr_*.c}; do ++ quilt add "$file" || true ++ awk ' ++$0 ~ /^static const struct ndr_interface_call .* = {$/ { ++ replace = 1 ++} ++ ++$0 ~ /^}$/ { ++ replace = 0; ++} ++ ++replace == 1 { ++ gsub(/.ndr_print_function_t. .*,/, "(ndr_print_function_t) ndr_print_disabled,", $0) ++} ++{ ++ print $0 ++} ++ ' < "$file" > "$file.new" ++ mv "$file.new" "$file" ++done +--- a/librpc/ndr/libndr.h ++++ b/librpc/ndr/libndr.h +@@ -597,6 +597,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_enum + _PUBLIC_ enum ndr_err_code ndr_push_enum_uint1632(struct ndr_push *ndr, int ndr_flags, uint16_t v); + + _PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b); ++_PUBLIC_ void ndr_print_disabled(struct ndr_print *ndr, const char *name, int flags, void *r); + + #ifndef VERBOSE_ERROR + #define ndr_print_bool(...) do {} while (0) diff --git a/net/scanlogd/Makefile b/net/scanlogd/Makefile new file mode 100644 index 0000000..6b7305e --- /dev/null +++ b/net/scanlogd/Makefile @@ -0,0 +1,64 @@ +# +# Copyright (C) 2006-2011 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:=scanlogd +PKG_VERSION:=2.2.6 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.openwall.com/scanlogd/ \ + ftp://ftp.wiretapped.net/pub/openwall/ \ + http://distro.ibiblio.org/pub/linux/distributions/openwall/ +PKG_MD5SUM:=7b8187ea718ebe47f22805b921b909ab + +PKG_INIT_PRIO:=60 + +include $(INCLUDE_DIR)/package.mk + +define Package/scanlogd + SECTION:=net + CATEGORY:=Network + SUBMENU:=Firewall + DEPENDS:=+libpcap +libnet0 +libnids + TITLE:=Port scan detection tool + URL:=http://www.openwall.com/scanlogd +endef + +define Package/scanlogd/description + Scanlogd is a TCP port scan detection tool, originally designed + to illustrate various attacks an IDS developer has to deal with. + Thus, unlike some of the other port scan detection tools out there, + scanlogd is designed to be totally safe to use. +endef + +define Build/Configure + $(SED) 's,^#define \(SCANLOGD_CHROOT\).*,#define \1 "/var/run/scanlogd",' \ + -e 's,^#undef \(SCANLOGD_DEVICE\),#define \1 "all",' \ + $(PKG_BUILD_DIR)/params.h +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CC="$(TARGET_CC)" LD="$(TARGET_CC)" CFLAGS="-c $(TARGET_CFLAGS)" \ + LDFLAGS= \ + PCAP_H="$(TARGET_CPPFLAGS)" \ + NIDS_H="$(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/lib/libnet-1.0.x/include" \ + NIDS_L="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib/libnet-1.0.x/lib -lnids -lnet -lpcap" \ + libnids +endef + +define Package/scanlogd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/scanlogd.init $(1)/etc/init.d/scanlogd +endef + +$(eval $(call BuildPackage,scanlogd)) diff --git a/net/scanlogd/files/scanlogd.init b/net/scanlogd/files/scanlogd.init new file mode 100644 index 0000000..cfe5825 --- /dev/null +++ b/net/scanlogd/files/scanlogd.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +START=50 + +start() { + user_exists scanlogd 51 || user_add scanlogd 51 + group_exists scanlogd 51 || group_add scanlogd + [ -d /var/run/scanlogd ] || { + mkdir -m 0755 -p /var/run/scanlogd + chmod 0755 /var/run/scanlogd + chown scanlogd:scanlogd /var/run/scanlogd + } + service_start /usr/sbin/scanlogd +} + +stop() { + service_stop /usr/sbin/scanlogd +} diff --git a/net/scdp/Makefile b/net/scdp/Makefile new file mode 100644 index 0000000..8c80131 --- /dev/null +++ b/net/scdp/Makefile @@ -0,0 +1,50 @@ +# +# 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:=scdp +PKG_VERSION:=1.0b +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/scdp +PKG_MD5SUM:=7eafaf5a422e37d04715613993ed5d95 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/scdp + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libnet0 + TITLE:=An utility to send CDP (Cisco Discovery Protocol) packets + URL:=http://sourceforge.net/projects/scdp +endef + +define Package/scdp/description + This program sends CDP (Cisco Discovery Protocol) packets out on + selected interfaces and tells the connected switch (cisco only) + where the host is connected. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + , \ + CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/lib/libnet-1.0.x/include" \ + LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/libnet-1.0.x/lib" \ + PATH="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH" \ + ) +endef + +define Package/scdp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/scdp $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,scdp)) diff --git a/net/seeks/Makefile b/net/seeks/Makefile new file mode 100644 index 0000000..b676648 --- /dev/null +++ b/net/seeks/Makefile @@ -0,0 +1,115 @@ +# +# Copyright (C) 2011 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:=seeks +PKG_VERSION:=0.3.4 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_URL:=git://seeks.git.sourceforge.net/gitroot/seeks/seeks +PKG_SOURCE_PROTO:=git +PKG_REV:=e8565b98cfe40fba644f587536f15f1a8665d230 +PKG_SOURCE_VERSION:=$(PKG_REV) + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/seeks + SUBMENU:=Web Servers/Proxies + SECTION:=net + CATEGORY:=Network + TITLE:=An open P2P design for websearch + URL:=http://www.seeks-project.info/site/ + DEPENDS:=+libpthread +libevent2 +libstdcpp +libcurl +libpcre +libxml2 $(ICONV_DEPENDS) +zlib +protobuf +tokyocabinet + MAINTAINER:=Obinou +endef + +define Package/seeks/description + Seeks is a free and open P2P design and application for enabling social + websearch. Its specific purpose is to regroup users whose queries + are similar so they can share both the query results and their + experience on these results. On this basis, Seeks allows for true + real-time, decentralized, websearch to emerge. + + In the long term, there is no need for web crawlers and third-party + web indexes as users can push content directly to search groups. + By hashing queries, Seeks offers a unique solution that allows to + issue queries and get answers while not revealing the true query itself. + + Seeks is currently under development. Code is available from our git + repository. Help on any of the social, technical and software matters + is greatly encouraged and appreciated, see the dedicated page. +endef + + +CONFIGURE_VARS:= \ + CXXFLAGS="-I$(STAGING_DIR)/usr/include $(ICONV_CFLAGS)" \ + LDFLAGS="-L$(STAGING_DIR)/usr/lib $(ICONV_LDFLAGS)" \ + +CONFIGURE_ARGS += \ + --prefix=/usr \ + --enable-httpserv-plugin \ + --enable-keepalive \ + --disable-image-websearch-plugin \ + --disable-icu + +define Build/Configure + (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \ + ./autogen.sh \ + ); + $(call Build/Configure/Default) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CXXFLAGS="-I$(STAGING_DIR)/usr/include $(ICONV_CFLAGS)" + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install +endef + +define Package/seeks/conffiles +/etc/config/seeks +/etc/seeks/config +endef + +define Package/seeks/install +# Binary program + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/seeks $(1)/usr/bin/ +# Config files + $(INSTALL_DIR) $(1)/etc/seeks + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/seeks/* $(1)/etc/seeks/ +# Libs + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/lib/seeks/plugins/blocker + $(INSTALL_DIR) $(1)/usr/lib/seeks/plugins/httpserv + $(INSTALL_DIR) $(1)/usr/lib/seeks/plugins/websearch + $(INSTALL_DIR) $(1)/usr/lib/seeks/plugins/query_capture + $(INSTALL_DIR) $(1)/usr/lib/seeks/plugins/uri_capture + $(INSTALL_DIR) $(1)/usr/lib/seeks/plugins/cf + $(INSTALL_DIR) $(1)/usr/lib/seeks/plugins/udb_service + $(CP) $(PKG_INSTALL_DIR)/usr/lib/seeks/plugins/blocker/lib*.so* $(1)/usr/lib/seeks/plugins/blocker + $(CP) $(PKG_INSTALL_DIR)/usr/lib/seeks/plugins/httpserv/lib*.so* $(1)/usr/lib/seeks/plugins/httpserv + $(CP) $(PKG_INSTALL_DIR)/usr/lib/seeks/plugins/websearch/lib*.so* $(1)/usr/lib/seeks/plugins/websearch + $(CP) $(PKG_INSTALL_DIR)/usr/lib/seeks/plugins/query_capture/lib*.so* $(1)/usr/lib/seeks/plugins/query_capture + $(CP) $(PKG_INSTALL_DIR)/usr/lib/seeks/plugins/uri_capture/lib*.so* $(1)/usr/lib/seeks/plugins/uri_capture + $(CP) $(PKG_INSTALL_DIR)/usr/lib/seeks/plugins/cf/lib*.so* $(1)/usr/lib/seeks/plugins/cf + $(CP) $(PKG_INSTALL_DIR)/usr/lib/seeks/plugins/udb_service/lib*.so* $(1)/usr/lib/seeks/plugins/udb_service +#Share + $(INSTALL_DIR) $(1)/usr/share/seeks + $(CP) -r $(PKG_INSTALL_DIR)/usr/share/seeks/* $(1)/usr/share/seeks/ +# This is OpenWRT specific config & scripts + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/seeks.init $(1)/etc/init.d/seeks +endef + +$(eval $(call BuildPackage,seeks)) diff --git a/net/seeks/files/seeks.init b/net/seeks/files/seeks.init new file mode 100644 index 0000000..eb4c5e4 --- /dev/null +++ b/net/seeks/files/seeks.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2011 OpenWrt.org + +START=99 + +start() { + service_start /usr/bin/seeks --daemon +} + +stop() { + service_stop /usr/bin/seeks +} diff --git a/net/seeks/patches/050-better_icu_detection.patch b/net/seeks/patches/050-better_icu_detection.patch new file mode 100644 index 0000000..7d2fa63 --- /dev/null +++ b/net/seeks/patches/050-better_icu_detection.patch @@ -0,0 +1,39 @@ +diff -ru seeks-0.3.3/configure.in seeks-0.3.3-new/configure.in +--- seeks-0.3.3/configure.in 2011-04-30 10:16:57.000000000 +0200 ++++ seeks-0.3.3-new/configure.in 2011-05-28 14:44:13.094516755 +0200 +@@ -351,17 +351,25 @@ + #========================================================================== + # Finding icu + #========================================================================== +-# First, check for the icu-config tool +-AC_PATH_PROGS(ICU_CONFIG, icu-config, no) +-if test x$ICU_CONFIG = xno; then +- AM_CONDITIONAL(HAVE_ICU,false) ++AC_ARG_ENABLE(icu, ++AC_HELP_STRING([--disable-icu], [Don't use icu to detect and convert non-UTF8 strings (default is NO)]), ++[enableval2=$enableval], ++[enableval2=yes]) ++if test $enableval2 = yes; then ++ # First, check for the icu-config tool ++ AC_PATH_PROGS(ICU_CONFIG, icu-config, no) ++ if test x$ICU_CONFIG = xno; then ++ AM_CONDITIONAL(HAVE_ICU,false) ++ else ++ AC_DEFINE(FEATURE_ICU,1,"ICU library is there") ++ AM_CONDITIONAL(HAVE_ICU,true) ++ ICU_LDADD=`$ICU_CONFIG --ldflags` ++ AC_SUBST(ICU_LDADD) ++ ICU_CFLAGS=`$ICU_CONFIG --cppflags` ++ AC_SUBST(ICU_CFLAGS) ++ fi + else +- AC_DEFINE(FEATURE_ICU,1,"ICU library is there") +- AM_CONDITIONAL(HAVE_ICU,true) +- ICU_LDADD=`$ICU_CONFIG --ldflags` +- AC_SUBST(ICU_LDADD) +- ICU_CFLAGS=`$ICU_CONFIG --cppflags` +- AC_SUBST(ICU_CFLAGS) ++ AM_CONDITIONAL(HAVE_ICU,false) + fi + + #ICU_LDADD=`$ICU_CONFIG --ldflags` diff --git a/net/seeks/patches/100-no_tests-and-add-iconv-link.patch b/net/seeks/patches/100-no_tests-and-add-iconv-link.patch new file mode 100644 index 0000000..0dd28ae --- /dev/null +++ b/net/seeks/patches/100-no_tests-and-add-iconv-link.patch @@ -0,0 +1,34 @@ +diff -ru seeks-0.3.3/src/Makefile.am seeks-0.3.3-new/src/Makefile.am +--- seeks-0.3.3/src/Makefile.am 2011-04-30 10:16:57.000000000 +0200 ++++ seeks-0.3.3-new/src/Makefile.am 2011-05-27 10:56:09.648313435 +0200 +@@ -57,12 +57,12 @@ + LDADD += -lseeksuserdb -lseeksuserdbfix + endif + endif +-LDADD += -lpcre -lpcreposix -lseekslsh -lseeksdht -lrmd160 -lpthread -lz @CURL_LDADD@ ++LDADD += -lpcre -lpcreposix -lseekslsh -lseeksdht -lrmd160 -lpthread -lz -liconv @CURL_LDADD@ + if !HAVE_BSD + LDADD += -ldl + endif + +-SUBDIRS=utils proxy lsh dht plugins proxy/tests lsh/tests . ++SUBDIRS=utils proxy lsh dht plugins . + + configdir=$(sysconfdir)/seeks + dist_config_DATA=config \ +diff -rU5 seeks-0.3.3/src/plugins/websearch/Makefile.am seeks-0.3.3-new/src/plugins/websearch/Makefile.am +--- seeks-0.3.3/src/plugins/websearch/Makefile.am 2011-04-30 10:16:57.000000000 +0200 ++++ seeks-0.3.3-new/src/plugins/websearch/Makefile.am 2011-05-24 00:42:34.836033228 +0200 +@@ -42,11 +42,11 @@ + + if USE_PERL + libseekswebsearchplugin_la_CXXFLAGS += `perl -MExtUtils::Embed -e ccopts` + endif + +-SUBDIRS=. tests ++SUBDIRS=. + + websearchconfigdir=$(sysconfdir)/seeks + dist_websearchconfig_DATA=websearch-config + + nobase_dist_websearchplugindata_DATA= \ diff --git a/net/seeks/patches/200-add_pcre_headers_to_plugins.patch b/net/seeks/patches/200-add_pcre_headers_to_plugins.patch new file mode 100644 index 0000000..0e21b97 --- /dev/null +++ b/net/seeks/patches/200-add_pcre_headers_to_plugins.patch @@ -0,0 +1,32 @@ +diff -rU5 seeks-0.3.3/src/plugins/blocker/Makefile.am seeks-0.3.3-new/src/plugins/blocker/Makefile.am +--- seeks-0.3.3/src/plugins/blocker/Makefile.am 2010-12-05 09:33:05.000000000 +0100 ++++ seeks-0.3.3-new/src/plugins/blocker/Makefile.am 2011-05-24 01:13:09.994085964 +0200 +@@ -4,11 +4,11 @@ + blockerplugindatadir = $(datadir)/seeks/plugins/blocker + + AM_CXXFLAGS=-Wall -g -pipe + AM_CPPFLAGS= -I${srcdir} -I${srcdir}/../../utils -I${srcdir}/../../proxy -I${srcdir}/../../lsh \ + -DSEEKS_CONFIGDIR='"$(sysconfdir)/seeks/"' `pkg-config --cflags protobuf` `pkg-config --cflags tokyocabinet` \ +- -I../../proxy ++ -I../../proxy @PCRE_CFLAGS@ + ACLOCAL_AMFLAGS=-I m4 + + blockerpluginlib_LTLIBRARIES=libblockerplugin.la + libblockerplugin_la_SOURCES=blocker.cpp blocker.h + +diff -rU5 seeks-0.3.3/src/plugins/httpserv/Makefile.am seeks-0.3.3-new/src/plugins/httpserv/Makefile.am +--- seeks-0.3.3/src/plugins/httpserv/Makefile.am 2011-02-18 15:44:02.000000000 +0100 ++++ seeks-0.3.3-new/src/plugins/httpserv/Makefile.am 2011-05-24 01:27:13.413787987 +0200 +@@ -4,11 +4,11 @@ + httpservplugindatadir = $(datadir)/seeks/plugins/httpserv + + + AM_CPPFLAGS=-Wno-deprecated -Wall -g -pipe \ + -I${srcdir} -I${srcdir}/../websearch -I${srcdir}/../../utils -I${srcdir}/../../lsh -I${srcdir}/../../proxy \ +- -I${srcdir}/../../dht ++ -I${srcdir}/../../dht @PCRE_CFLAGS@ + + + if HAVE_TC + if HAVE_PROTOBUF + AM_CPPFLAGS+=-I${srcdir}/../query_capture -I${srcdir}/../cf `pkg-config --cflags protobuf` `pkg-config --cflags tokyocabinet` diff --git a/net/ser2net/Makefile b/net/ser2net/Makefile new file mode 100644 index 0000000..88500ad --- /dev/null +++ b/net/ser2net/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ser2net +PKG_VERSION:=2.7 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/ser2net +PKG_MD5SUM:=22977477789868923a5de09a85e847dd + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ser2net + SECTION:=net + CATEGORY:=Network + TITLE:=Serial port TCP/IP redirector + URL:=http://sourceforge.net/projects/ser2net/ +endef + +define Package/ser2net/description + This is ser2net, a program for allowing network connections to serial ports. + See the man page for information about using the program. Note that ser2net + supports RFC 2217 (remote control of serial port parameters), but you must + have a complient client. +endef + +define Package/ser2net/conffiles +/etc/ser2net.conf +endef + +# uses GNU configure + +define Package/ser2net/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ser2net $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/ser2net.conf $(1)/etc/ +endef + +$(eval $(call BuildPackage,ser2net)) diff --git a/net/serialoverip/Makefile b/net/serialoverip/Makefile new file mode 100644 index 0000000..c1ed9fa --- /dev/null +++ b/net/serialoverip/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2009 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:=serialoverip +PKG_VERSION:=1.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME).tgz +PKG_SOURCE_URL:=@SF/serialoverip +PKG_MD5SUM:=0931cca65b8f9d32079fa3e55130ee1e + +include $(INCLUDE_DIR)/package.mk + +define Package/serialoverip + SECTION:=net + CATEGORY:=Network + TITLE:=SerialOverIP + URL:=http://sourceforge.net/projects/serialoverip/ +endef + +define Package/serialoverip/description + Tool for transport of serial interfaces over UDP/IP. + Usefull for accessing a distant serial device by a local program. +endef + +define Build/Configure +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) \ + -o $(PKG_BUILD_DIR)/serialoverip $(PKG_BUILD_DIR)/serialoverip.c +endef + +define Package/serialoverip/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/serialoverip $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,serialoverip)) diff --git a/net/serialoverip/patches/001-compile-fixes.patch b/net/serialoverip/patches/001-compile-fixes.patch new file mode 100644 index 0000000..f487e24 --- /dev/null +++ b/net/serialoverip/patches/001-compile-fixes.patch @@ -0,0 +1,76 @@ +diff -ur serialoverip-1.0.orig/serialoverip.c serialoverip-1.0/serialoverip.c +--- serialoverip-1.0.orig/serialoverip.c 2009-09-24 19:32:40.000000000 +0200 ++++ serialoverip-1.0/serialoverip.c 2009-09-24 19:43:18.000000000 +0200 +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #define MAXMESG 2048 + +@@ -42,20 +43,19 @@ + int s[2],st[2]; + + void help(){ +- fprintf(stderr,"\ +-SerialOverIP version 1.0, Copyright (C) 2002 Stefan-Florin Nicola +-SerialOverIP comes with ABSOLUTELY NO WARRANTY. This is free software, and you +-are welcome to redistribute it under GNU General Public License. +- Usage: %s +- where and are one of the folowing: +- -s UDP server on IP:port +- -c UDP client for server IP:port +- -d sss-dps local serial device +- sss is speed (50,..,230400) +- d is data bits (5,6,7,8) +- p is parity type (N,E,O) +- s is stop bits (1,2) +-",pname); ++ fprintf(stderr, ++"SerialOverIP version 1.0, Copyright (C) 2002 Stefan-Florin Nicola \n" ++"SerialOverIP comes with ABSOLUTELY NO WARRANTY. This is free software, and you\n" ++"are welcome to redistribute it under GNU General Public License.\n" ++" Usage: %s \n" ++" where and are one of the folowing:\n" ++" -s UDP server on IP:port\n" ++" -c UDP client for server IP:port\n" ++" -d sss-dps local serial device\n" ++" sss is speed (50,..,230400)\n" ++" d is data bits (5,6,7,8)\n" ++" p is parity type (N,E,O)\n" ++" s is stop bits (1,2)\n", pname); + return; + } + +@@ -113,10 +113,9 @@ + + int main(int argc,char**argv){ + int i,n,w,clen[2],nonblock[2],speed,data,stopb; +- unsigned char c,buf[MAXMESG],*p,parity; ++ unsigned char buf[MAXMESG],*p,parity; + struct termios cfg; + struct sockaddr_in addr[4][4]; +- struct sigaction newact,oldact; + + pname=argv[0]; + if(argc!=7){ +@@ -156,7 +155,7 @@ + n=sscanf(argv[3*i+3],"%d-%d%c%d",&speed,&data,&parity,&stopb); + if(n<4){ + fprintf(stderr,"%s: invalid argument %1d from %s\n", +- pname,read+1,argv[3*i+3]); ++ pname,(int)(read+1),argv[3*i+3]); + return 3; + } + if(setserial(s[i],&cfg,speed,data,parity,stopb)<0){ +@@ -177,7 +176,7 @@ + if(st[i]&2)n=read(s[i],buf,MAXMESG); + else{ + n=recvfrom(s[i],buf,MAXMESG,nonblock[i]*MSG_DONTWAIT, +- (struct sockaddr*)&addr[i][st[i]],&clen[i]); ++ (struct sockaddr*)&addr[i][st[i]],(socklen_t *)&clen[i]); + nonblock[i]=1; + } + p=buf; +Only in serialoverip-1.0: serialoverip.new diff --git a/net/shat/Makefile b/net/shat/Makefile new file mode 100644 index 0000000..7412f53 --- /dev/null +++ b/net/shat/Makefile @@ -0,0 +1,45 @@ +# +# 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:=shat +PKG_VERSION:=0.9.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/shat +PKG_MD5SUM:=da06846f35838b14d1513523dad84d24 + +include $(INCLUDE_DIR)/package.mk + +define Package/shat + SECTION:=net + CATEGORY:=Network + TITLE:=Source Hardware Address Translation + URL:=http://sourceforge.net/projects/shat/ +endef + +define Package/shat/description + A tool which allows hosts with arbitrary IP configuration + to connect to the internet over a SHAT gateway. + +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/src \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -Wall -I$(PKG_BUILD_DIR)/include/linux/include -I$(PKG_BUILD_DIR)/include -DVERSION=\\\"$(PKG_VERSION)\\\" -DDROP_NETBIOS" +endef + +define Package/shat/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/shatd $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/shatc $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,shat)) diff --git a/net/shorewall-lite/Makefile b/net/shorewall-lite/Makefile new file mode 100644 index 0000000..3611624 --- /dev/null +++ b/net/shorewall-lite/Makefile @@ -0,0 +1,66 @@ +# +# Copyright (C) 2008-2011 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:=shorewall-lite +PKG_VERSION:=4.4.27.3 +PKG_DIRECTORY:=4.4.27 +PKG_RELEASE:=4 + +PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/4.4/shorewall-$(PKG_DIRECTORY)/ \ + http://www1.shorewall.net/pub/shorewall/4.4/shorewall-$(PKG_DIRECTORY)/ \ + http://slovakia.shorewall.net/pub/shorewall/4.4/shorewall-$(PKG_DIRECTORY)/ \ + http://shorewall.de/pub/shorewall/4.4/shorewall-$(PKG_DIRECTORY)/ \ + http://www.shorewall.com.au/4.4/shorewall-$(PKG_DIRECTORY)/ \ + http://shorewall.infohiiway.com/pub/shorewall/4.4/shorewall-$(PKG_DIRECTORY)/ \ + http://www.shorewall.com.ar/pub/shorewall/shorewall/4.4/shorewall-$(PKG_DIRECTORY)/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_MD5SUM:=40be496c0d512d885b7b0f64204bc235 + +include $(INCLUDE_DIR)/package.mk + +define Package/shorewall-lite + SECTION:=net + CATEGORY:=Network + DEPENDS:=+ip +iptables + TITLE:=Shorewall Lite + URL:=http://www.shorewall.net/ + SUBMENU:=Firewall +endef + +define Package/shorewall-lite/description + Shoreline Firewall Lite is an iptables-based firewall for Linux systems. +endef + +define Package/shorewall-lite/conffiles +/etc/shorewall-lite/shorewall-lite.conf +/etc/shorewall-lite/vardir +endef + +define Build/Compile + PREFIX=$(PKG_INSTALL_DIR) $(PKG_BUILD_DIR)/install.sh +endef + +define Package/shorewall-lite/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/lsm/script.d + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_DIR) $(1)/etc/shorewall-lite + $(INSTALL_DIR) $(1)/usr/share + $(INSTALL_BIN) ./files/shorewall-lite.init $(1)/etc/init.d/shorewall-lite + $(INSTALL_BIN) ./files/hotplug_iface $(1)/etc/hotplug.d/iface/05-shorewall-lite + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/shorewall-lite $(1)/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/share/shorewall-lite $(1)/usr/share + $(INSTALL_BIN) ./files/hostname $(1)/usr/share/shorewall-lite + $(INSTALL_BIN) ./files/lsm_script $(1)/etc/lsm/script.d/45_shorewall-lite + $(CP) $(PKG_INSTALL_DIR)/etc/shorewall-lite $(1)/etc + $(CP) ./files/vardir $(1)/etc/shorewall-lite +endef + +$(eval $(call BuildPackage,shorewall-lite)) diff --git a/net/shorewall-lite/files/hostname b/net/shorewall-lite/files/hostname new file mode 100644 index 0000000..42e1643 --- /dev/null +++ b/net/shorewall-lite/files/hostname @@ -0,0 +1,2 @@ +#!/bin/sh +cat /proc/sys/kernel/hostname diff --git a/net/shorewall-lite/files/hotplug_iface b/net/shorewall-lite/files/hotplug_iface new file mode 100644 index 0000000..acb9950 --- /dev/null +++ b/net/shorewall-lite/files/hotplug_iface @@ -0,0 +1,12 @@ +#!/bin/sh + +# should restart shorewall when an interface comes up + +[ ifup = "$ACTION" ] && { + /etc/init.d/shorewall-lite restart +} + +[ ifdown = "$ACTION" ] && { + # might need to restore some routing + /etc/init.d/shorewall-lite restart +} diff --git a/net/shorewall-lite/files/lsm_script b/net/shorewall-lite/files/lsm_script new file mode 100644 index 0000000..e8310a3 --- /dev/null +++ b/net/shorewall-lite/files/lsm_script @@ -0,0 +1,43 @@ +#!/bin/sh +# +# (C) 2009 Mika Ilmaranta +# (C) 2009 Tom Eastep +# +# License: GPLv2 +# + +STATE=${1} +NAME=${2} +CHECKIP=${3} +DEVICE=${4} +WARN_EMAIL=${5} +REPLIED=${6} +WAITING=${7} +TIMEOUT=${8} +REPLY_LATE=${9} +CONS_RCVD=${10} +CONS_WAIT=${11} +CONS_MISS=${12} +AVG_RTT=${13} + +if [ -f /usr/share/shorewall-lite/lib.base ]; then + VARDIR=/var/lib/shorewall-lite + STATEDIR=/etc/shorewall-lite +else + VARDIR=/var/lib/shorewall + STATEDIR=/etc/shorewall +fi + +[ -f ${STATEDIR}/vardir ] && . ${STATEDIR}/vardir + +if [ ${STATE} = up ]; then + echo 0 > ${VARDIR}/${DEVICE}.status # Uncomment this line if you are running Shorewall 4.4.x or earlier + ${VARDIR}/firewall enable ${DEVICE} +else + echo 1 > ${VARDIR}/${DEVICE}.status # Uncomment this line if you are running Shorewall 4.4.x or earlier + ${VARDIR}/firewall disable ${DEVICE} +fi + +/sbin/shorewall-lite show routing >> /var/log/lsm + +exit 0 diff --git a/net/shorewall-lite/files/shorewall-lite.init b/net/shorewall-lite/files/shorewall-lite.init new file mode 100644 index 0000000..777683a --- /dev/null +++ b/net/shorewall-lite/files/shorewall-lite.init @@ -0,0 +1,20 @@ +#!/bin/sh /etc/rc.common + +START=46 +start() { + touch /var/log/messages + mkdir -p /var/lock/subsys + /sbin/shorewall-lite -qq start +} + +stop() { + /sbin/shorewall-lite -qq stop +} + +restart() { + if [ -f /etc/shorewall-lite/state/restore ] ; then + /sbin/shorewall-lite -qq restore + else + /sbin/shorewall-lite -qq restart + fi +} diff --git a/net/shorewall-lite/files/vardir b/net/shorewall-lite/files/vardir new file mode 100644 index 0000000..3afdabb --- /dev/null +++ b/net/shorewall-lite/files/vardir @@ -0,0 +1,2 @@ +# move state dir out of ram +VARDIR=/etc/shorewall-lite/state diff --git a/net/shorewall-lite/patches/110-MODULESDIR.patch b/net/shorewall-lite/patches/110-MODULESDIR.patch new file mode 100644 index 0000000..e499d1c --- /dev/null +++ b/net/shorewall-lite/patches/110-MODULESDIR.patch @@ -0,0 +1,20 @@ +--- a/lib.common 2012-01-21 14:21:50.000000000 +0100 ++++ b/lib.common 2012-06-03 11:52:35.115967105 +0200 +@@ -328,7 +328,7 @@ + + [ -z "$MODULESDIR" ] && \ + uname=$(uname -r) && \ +- MODULESDIR=/lib/modules/$uname/kernel/net/ipv${g_family}/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/kernel/net/sched:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset ++ MODULESDIR=/lib/modules/$uname/kernel/net/ipv${g_family}/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/kernel/net/sched:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset:/lib/modules/$uname + + [ -d /sys/module/ ] || MODULES=$(lsmod | cut -d ' ' -f1) + +@@ -367,7 +367,7 @@ + + [ -z "$MODULESDIR" ] && \ + uname=$(uname -r) && \ +- MODULESDIR=/lib/modules/$uname/kernel/net/ipv${g_family}/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/kernel/net/sched:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset ++ MODULESDIR=/lib/modules/$uname/kernel/net/ipv${g_family}/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/kernel/net/sched:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset:/lib/modules/$uname + + for directory in $(split $MODULESDIR); do + [ -d $directory ] && moduledirectories="$moduledirectories $directory" diff --git a/net/shorewall-lite/patches/120-LOGFILE.patch b/net/shorewall-lite/patches/120-LOGFILE.patch new file mode 100644 index 0000000..70c6256 --- /dev/null +++ b/net/shorewall-lite/patches/120-LOGFILE.patch @@ -0,0 +1,11 @@ +--- a/shorewall-lite.conf 2012-01-20 16:30:06.000000000 +0100 ++++ b/shorewall-lite.conf 2012-06-03 11:46:48.389503776 +0200 +@@ -28,7 +28,7 @@ + # L O G G I N G + ############################################################################### + +-LOGFILE= ++LOGFILE=/dev/null + + ############################################################################### + # L O C A T I O N O F F I L E S A N D D I R E C T O R I E S diff --git a/net/sipp/Makefile b/net/sipp/Makefile new file mode 100644 index 0000000..18aebe6 --- /dev/null +++ b/net/sipp/Makefile @@ -0,0 +1,60 @@ +# +# 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:=sipp +PKG_VERSION:=3.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).src.tar.gz +PKG_SOURCE_URL:=@SF/sipp +PKG_MD5SUM:=452a6f88f2d314dbb2f44e318a60982b + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/sipp + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + DEPENDS:= +libncurses +libpthread $(CXX_DEPENDS) + TITLE:=test tool / traffic generator for the SIP protocol + URL:=http://sipp.sourceforge.net/ +endef + +define Package/sipp/description + SIPp is a free Open Source test tool / traffic generator for the SIP + protocol. It includes a few basic SipStone user agent scenarios (UAC and + UAS) and establishes and releases multiple calls with the INVITE and BYE + methods. +endef + +TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components 1 $(TAR_OPTIONS) + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CC_linux="$(TARGET_CXX)" \ + CPP_linux="$(TARGET_CXX)" \ + CCLINK_linux="$(TARGET_CXX)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS_linux="$(TARGET_CPPFLAGS) -fno-rtti" \ + LFLAGS_linux="$(TARGET_LDFLAGS)" \ + LIBS="-lncurses -ldl -lpthread -lm" \ + all +endef + +define Package/sipp/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/sipp $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,sipp)) diff --git a/net/siproxd/Makefile b/net/siproxd/Makefile new file mode 100644 index 0000000..6b08d05 --- /dev/null +++ b/net/siproxd/Makefile @@ -0,0 +1,86 @@ +# +# Copyright (C) 2006-2011 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:=siproxd +PKG_VERSION:=0.8.1 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/siproxd +PKG_MD5SUM:=1a6f9d13aeb2d650375c9a346ac6cbaf + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/siproxd/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + URL:=http://siproxd.sourceforge.net/ +endef + +define Package/siproxd + $(call Package/siproxd/Default) + DEPENDS:=+libltdl +libpthread +libosip2 + TITLE:=SIP (Session Initiation Protocol) proxy + MENU:=1 +endef + +define Package/siproxd/description + Siproxd is a proxy/masquerading daemon for the SIP protocol. +endef + +define Package/siproxd/conffiles +/etc/config/siproxd +endef + +CONFIGURE_ARGS+= \ + --with-libosip-prefix="$(STAGING_DIR)/usr" \ + --disable-doc + +MAKE_FLAGS+= \ + SUBDIRS="src scripts contrib" \ + LIBLTDL="$(STAGING_DIR)/usr/lib/libltdl.la" \ + +define Package/siproxd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/siproxd $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/siproxd.config $(1)/etc/config/siproxd + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/siproxd.init $(1)/etc/init.d/siproxd +endef + +define BuildPlugin + define Package/siproxd-mod-$(1) + $$(call Package/siproxd/Default) + TITLE:= siproxd $(1) plugin + DEPENDS:=siproxd + endef + + define Package/siproxd-mod-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/siproxd + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/siproxd/plugin_$(1)*.so* $$(1)/usr/lib/siproxd + endef + + $$(eval $$(call BuildPackage,siproxd-mod-$(1))) +endef + +$(eval $(call BuildPackage,siproxd)) +$(eval $(call BuildPlugin,defaulttarget)) +$(eval $(call BuildPlugin,demo)) +$(eval $(call BuildPlugin,fix_bogus_via)) +$(eval $(call BuildPlugin,logcall)) +$(eval $(call BuildPlugin,prefix)) +$(eval $(call BuildPlugin,regex)) +$(eval $(call BuildPlugin,shortdial)) +$(eval $(call BuildPlugin,stun)) diff --git a/net/siproxd/files/siproxd.config b/net/siproxd/files/siproxd.config new file mode 100644 index 0000000..b65148c --- /dev/null +++ b/net/siproxd/files/siproxd.config @@ -0,0 +1,3 @@ +config siproxd general + option if_inbound lan + option if_outbound wan diff --git a/net/siproxd/files/siproxd.init b/net/siproxd/files/siproxd.init new file mode 100644 index 0000000..4ecdfbb --- /dev/null +++ b/net/siproxd/files/siproxd.init @@ -0,0 +1,235 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008 Alina Friedrichsen +# Copyright (C) 2011 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +siproxd_bin="/usr/sbin/siproxd" +siproxd_conf_dir="/var/etc" +siproxd_conf_prefix="$siproxd_conf_dir/siproxd-" +siproxd_registration_dir="/var/lib/siproxd" +siproxd_pid_dir="/var/run/siproxd" + +deal_with_lists () { + echo "$2" = "$1" >> "$siproxd_conf_prefix$cfg" +} + +start_instance() { + local cfg="$1" + + config_get if_inbound "$cfg" if_inbound + config_get if_outbound "$cfg" if_outbound + config_get host_outbound "$cfg" host_outbound + config_get hosts_allow_reg "$cfg" hosts_allow_reg + config_get hosts_allow_sip "$cfg" hosts_allow_sip + config_get hosts_deny_sip "$cfg" hosts_deny_sip + config_get sip_listen_port "$cfg" sip_listen_port 5060 + config_get_bool daemonize "$cfg" daemonize 1 + config_get silence_log "$cfg" silence_log 4 + config_get user "$cfg" user nobody + config_get chrootjail "$cfg" chrootjail + config_get registration_file "$cfg" registration_file "$siproxd_registration_dir/siproxd_registrations-$cfg" + config_get autosave_registrations "$cfg" autosave_registrations 300 + config_get pid_file "$cfg" pid_file "$siproxd_pid_dir/siproxd-$cfg.pid" + config_get_bool rtp_proxy_enable "$cfg" rtp_proxy_enable 1 + config_get rtp_port_low "$cfg" rtp_port_low 7070 + config_get rtp_port_high "$cfg" rtp_port_high 7089 + config_get rtp_timeout "$cfg" rtp_timeout 300 + config_get rtp_dscp "$cfg" rtp_dscp 46 + config_get sip_dscp "$cfg" sip_dscp 0 + config_get rtp_input_dejitter "$cfg" rtp_input_dejitter 0 + config_get rtp_output_dejitter "$cfg" rtp_output_dejitter 0 + config_get tcp_timeout "$cfg" tcp_timeout 600 + config_get tcp_connect_timeout "$cfg" tcp_connect_timeout 500 + config_get tcp_keepalive "$cfg" tcp_keepalive 20 + config_get default_expires "$cfg" default_expires 600 + config_get proxy_auth_realm "$cfg" proxy_auth_realm + config_get proxy_auth_passwd "$cfg" proxy_auth_passwd + config_get proxy_auth_pwfile "$cfg" proxy_auth_pwfile + config_get debug_level "$cfg" debug_level 0x00000000 + config_get debug_port "$cfg" debug_port 0 + config_get mask_host "$cfg" mask_host + config_get masked_host "$cfg" masked_host + config_get ua_string "$cfg" ua_string Siproxd-UA + config_get use_rport "$cfg" use_rport 0 + config_get outbound_proxy_host "$cfg" outbound_proxy_host + config_get outbound_proxy_port "$cfg" outbound_proxy_port + config_get outbound_domain_name "$cfg" outbound_domain_name + config_get outbound_domain_host "$cfg" outbound_domain_host + config_get outbound_domain_port "$cfg" outbound_domain_port + + if [ -f "$siproxd_conf_prefix$cfg" ]; then + rm "$siproxd_conf_prefix$cfg" + fi + if [ -n "$if_inbound" ]; then + echo if_inbound = "$if_inbound" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$if_outbound" ]; then + echo if_outbound = "$if_outbound" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$host_outbound" ]; then + echo host_outbound = "$host_outbound" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$hosts_allow_reg" ]; then + echo hosts_allow_reg = "$hosts_allow_reg" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$hosts_allow_sip" ]; then + echo hosts_allow_sip = "$hosts_allow_sip" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$hosts_deny_sip" ]; then + echo hosts_deny_sip = "$hosts_deny_sip" >> "$siproxd_conf_prefix$cfg" + fi + echo sip_listen_port = "$sip_listen_port" >> "$siproxd_conf_prefix$cfg" + echo daemonize = "$daemonize" >> "$siproxd_conf_prefix$cfg" + echo silence_log = "$silence_log" >> "$siproxd_conf_prefix$cfg" + echo user = "$user" >> "$siproxd_conf_prefix$cfg" + if [ -n "$chrootjail" ]; then + if [ ! -d "$chrootjail" ]; then + mkdir -p "$chrootjail" + chmod 0755 "$chrootjail" + fi + echo chrootjail = "$chrootjail" >> "$siproxd_conf_prefix$cfg" + fi + echo registration_file = "$registration_file" >> "$siproxd_conf_prefix$cfg" + echo autosave_registrations = "$autosave_registrations" >> "$siproxd_conf_prefix$cfg" + + echo pid_file = "$pid_file" >> "$siproxd_conf_prefix$cfg" + echo rtp_proxy_enable = "$rtp_proxy_enable" >> "$siproxd_conf_prefix$cfg" + echo rtp_port_low = "$rtp_port_low" >> "$siproxd_conf_prefix$cfg" + echo rtp_port_high = "$rtp_port_high" >> "$siproxd_conf_prefix$cfg" + echo rtp_timeout = "$rtp_timeout" >> "$siproxd_conf_prefix$cfg" + echo rtp_dscp = "$rtp_dscp" >> "$siproxd_conf_prefix$cfg" + echo sip_dscp = "$sip_dscp" >> "$siproxd_conf_prefix$cfg" + echo rtp_input_dejitter = "$rtp_input_dejitter" >> "$siproxd_conf_prefix$cfg" + echo rtp_output_dejitter = "$rtp_output_dejitter" >> "$siproxd_conf_prefix$cfg" + echo tcp_timeout = "$tcp_timeout" >> "$siproxd_conf_prefix$cfg" + echo tcp_connect_timeout = "$tcp_connect_timeout" >> "$siproxd_conf_prefix$cfg" + echo tcp_keepalive = "$tcp_keepalive" >> "$siproxd_conf_prefix$cfg" + echo default_expires = "$default_expires" >> "$siproxd_conf_prefix$cfg" + if [ -n "$proxy_auth_realm" ]; then + echo proxy_auth_realm = "$proxy_auth_realm" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$proxy_auth_passwd" ]; then + echo proxy_auth_passwd = "$proxy_auth_passwd" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$proxy_auth_pwfile" ]; then + echo proxy_auth_pwfile = "$proxy_auth_pwfile" >> "$siproxd_conf_prefix$cfg" + fi + echo debug_level = "$debug_level" >> "$siproxd_conf_prefix$cfg" + echo debug_port = "$debug_port" >> "$siproxd_conf_prefix$cfg" + if [ -n "$mask_host" ]; then + echo mask_host = "$mask_host" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$masked_host" ]; then + echo masked_host = "$masked_host" >> "$siproxd_conf_prefix$cfg" + fi + echo ua_string = "$ua_string" >> "$siproxd_conf_prefix$cfg" + echo use_rport = "$use_rport" >> "$siproxd_conf_prefix$cfg" + if [ -n "$outbound_proxy_host" ]; then + echo oubound_proxy_host = "$outbound_proxy_host" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$outbound_proxy_port" ]; then + echo outbound_proxy_port = "$outbound_proxy_port" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$outbound_domain_name" ]; then + echo outbound_domain_name = "$outbound_domain_name" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$outbound_domain_host" ]; then + echo outbound_domain_host = "$outbound_domain_host" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$outbound_domain_port" ]; then + echo outbound_domain_port = "$outbound_domain_port" >> "$siproxd_conf_prefix$cfg" + fi + + # handle plugins + config_get plugindir "$cfg" plugindir "/usr/lib/siproxd/" + echo plugindir = "$plugindir" >> "$siproxd_conf_prefix$cfg" + + config_list_foreach "$cfg" 'load_plugin' deal_with_lists "load_plugin" + + # plugin_demo.so + config_get plugin_demo_string "$cfg" plugin_demo_string + if [ -n "$plugin_demo_string" ]; then + echo plugin_demo_string = "$plugin_demo_string" >> "$siproxd_conf_prefix$cfg" + fi + + # plugin_shortdial.so + config_get plugin_shortdial_akey "$cfg" plugin_shortdial_akey + if [ -n "$plugin_shortdial_akey" ]; then + echo plugin_shortdial_akey = "$plugin_shortdial_akey" >> "$siproxd_conf_prefix$cfg" + fi + config_list_foreach "$cfg" 'plugin_shortdial_entry' deal_with_lists "plugin_shortdial_entry" + + # plugin_defaulttarget.so + config_get_bool plugin_defaulttarget_log "$cfg" plugin_defaulttarget_log + if [ -n "$plugin_defaulttarget_log" ]; then + echo plugin_defaulttarget_log = "$plugin_defaulttarget_log" >> "$siproxd_conf_prefix$cfg" + fi + config_get plugin_defaulttarget_target "$cfg" plugin_defaulttarget_target + if [ -n "$plugin_defaulttarget_target" ]; then + echo plugin_defaulttarget_target = "$plugin_defaulttarget_target" >> "$siproxd_conf_prefix$cfg" + fi + + # plugin_fix_bogus_via.so + config_get plugin_fix_bogus_via_networks "$cfg" plugin_fix_bogus_via_networks + if [ -n "$plugin_fix_bogus_via_networks" ]; then + echo plugin_fix_bogus_via_networks = "$plugin_fix_bogus_via_networks" >> "$siproxd_conf_prefix$cfg" + fi + + # plugin_stun.so + config_get plugin_stun_server "$cfg" plugin_stun_server + if [ -n "$plugin_stun_server" ]; then + echo plugin_stun_server = "$plugin_stun_server" >> "$siproxd_conf_prefix$cfg" + fi + config_get plugin_stun_port "$cfg" plugin_stun_port + if [ -n "$plugin_stun_port" ]; then + echo plugin_stun_port = "$plugin_stun_port" >> "$siproxd_conf_prefix$cfg" + fi + config_get plugin_stun_period "$cfg" plugin_stun_period + if [ -n "$plugin_stun_period" ]; then + echo plugin_stun_period = "$plugin_stun_period" >> "$siproxd_conf_prefix$cfg" + fi + + # plugin_prefix.so + config_get plugin_prefix_akey "$cfg" plugin_prefix_akey + if [ -n "$plugin_prefix_akey" ]; then + echo plugin_prefix_akey = "$plugin_prefix_akey" >> "$siproxd_conf_prefix$cfg" + fi + + # plugin_regex.so + config_list_foreach "$cfg" 'plugin_regex_desc' deal_with_lists "plugin_regex_desc" + config_list_foreach "$cfg" 'plugin_regex_pattern' deal_with_lists "plugin_regex_pattern" + config_list_foreach "$cfg" 'plugin_regex_replace' deal_with_lists "plugin_regex_replace" + + SERVICE_PID_FILE="$pid_file" \ + service_start $siproxd_bin --config "$siproxd_conf_prefix$cfg" +} + +stop_instance() { + local cfg="$1" + + config_get pid_file "$cfg" pid_file "$siproxd_pid_dir/siproxd-$cfg.pid" + + SERVICE_PID_FILE="$pid_file" \ + service_stop $siproxd_bin +} + +start() { + mkdir -m 0755 -p "$siproxd_conf_dir" + mkdir -m 0755 -p "$siproxd_registration_dir" + [ -d "$siproxd_pid_dir" ] || { + mkdir -m 0755 -p "$siproxd_pid_dir" + chmod 0750 "$siproxd_pid_dir" + chown nobody:nogroup "$siproxd_pid_dir" + } + + config_load 'siproxd' + config_foreach start_instance 'siproxd' +} + +stop() { + config_load 'siproxd' + config_foreach stop_instance 'siproxd' +} diff --git a/net/siproxd/patches/010-fix-bogus-libltdl-dependency.patch b/net/siproxd/patches/010-fix-bogus-libltdl-dependency.patch new file mode 100644 index 0000000..20f3b6b --- /dev/null +++ b/net/siproxd/patches/010-fix-bogus-libltdl-dependency.patch @@ -0,0 +1,26 @@ +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -77,8 +77,8 @@ plugin_regex_la_LDFLAGS = -module -avoid + # else Cygwin goes beserk when building...) + # + sbin_PROGRAMS = siproxd +-siproxd_LDFLAGS=-export-dynamic +-siproxd_LDADD = $(LIBLTDL) $(DLOPENPLUGINS) ++siproxd_LDFLAGS=-export-dynamic -lltdl ++siproxd_LDADD = $(DLOPENPLUGINS) + siproxd_SOURCES = siproxd.c proxy.c register.c sock.c utils.c \ + sip_utils.c sip_layer.c log.c readconf.c rtpproxy.c \ + rtpproxy_relay.c accessctl.c route_processing.c \ +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -326,8 +326,8 @@ plugin_prefix_la_LDFLAGS = -module -avoi + # + plugin_regex_la_SOURCES = plugin_regex.c + plugin_regex_la_LDFLAGS = -module -avoid-version -shrext '.so' +-siproxd_LDFLAGS = -export-dynamic +-siproxd_LDADD = $(LIBLTDL) $(DLOPENPLUGINS) ++siproxd_LDFLAGS = -export-dynamic -lltdl ++siproxd_LDADD = $(DLOPENPLUGINS) + siproxd_SOURCES = siproxd.c proxy.c register.c sock.c utils.c \ + sip_utils.c sip_layer.c log.c readconf.c rtpproxy.c \ + rtpproxy_relay.c accessctl.c route_processing.c \ diff --git a/net/sipsak/Makefile b/net/sipsak/Makefile new file mode 100644 index 0000000..24cebd3 --- /dev/null +++ b/net/sipsak/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2006-2009 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:=sipsak +PKG_VERSION:=0.9.6 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.berlios.de/sipsak/ \ + http://ftp.iptel.org/pub/sipsak/ +PKG_MD5SUM:=c4eb8e282902e75f4f040f09ea9d99d5 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/sipsak + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + DEPENDS:=+libopenssl + TITLE:=SIP (Session Initiation Protocol) stress and diagnostics utility + URL:=http://www.sipsak.org/ +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-gnutls \ + ) +endef + +define Package/sipsak/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sipsak $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,sipsak)) diff --git a/net/sipsak/patches/001-ssp.patch b/net/sipsak/patches/001-ssp.patch new file mode 100644 index 0000000..1dda867 --- /dev/null +++ b/net/sipsak/patches/001-ssp.patch @@ -0,0 +1,22 @@ +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -363,7 +363,7 @@ AC_DEFUN([SIPSAK_GCC_STACK_PROTECT_CC],[ + AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector]) + ssp_old_cflags="$CFLAGS" + CFLAGS="$CFLAGS -fstack-protector" +- AC_TRY_COMPILE(,,, ssp_cc=no) ++ AC_TRY_LINK(,,, ssp_cc=no) + echo $ssp_cc + if test "X$ssp_cc" = "Xno"; then + CFLAGS="$ssp_old_cflags" +--- a/configure ++++ b/configure +@@ -2923,7 +2923,7 @@ main () + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 diff --git a/net/sipsak/patches/002-no_cares_ruli.patch b/net/sipsak/patches/002-no_cares_ruli.patch new file mode 100644 index 0000000..759ec94 --- /dev/null +++ b/net/sipsak/patches/002-no_cares_ruli.patch @@ -0,0 +1,276 @@ +diff -urN sipsak-0.9.6/configure sipsak-0.9.6.new/configure +--- sipsak-0.9.6/configure 2006-01-28 22:11:34.000000000 +0100 ++++ sipsak-0.9.6.new/configure 2012-08-06 16:45:07.051588486 +0200 +@@ -5954,264 +5954,6 @@ + + + +- echo "$as_me:$LINENO: checking for ares_version.h" >&5 +-echo $ECHO_N "checking for ares_version.h... $ECHO_C" >&6 +- +- ares_incdir=NONE +- ares_libdir=NONE +- ares_libcall=NONE +- ares_incdirs="/usr/include /usr/local/include /sw/include" +- ares_libdirs="/usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /sw/lib" +- ares_libexten=".so .dylib .a" +- +- for dir in $ares_incdirs; do +- try="$dir/ares_version.h" +- if test -f $try; then +- ares_incdir=$dir; +- break; +- fi +- done +- +- if test "$ares_incdir" = "NONE"; then +- echo "$as_me:$LINENO: result: not found" >&5 +-echo "${ECHO_T}not found" >&6 +- else +- echo "$as_me:$LINENO: result: found at $ares_incdir" >&5 +-echo "${ECHO_T}found at $ares_incdir" >&6 +- +- echo "$as_me:$LINENO: checking for c-ares lib" >&5 +-echo $ECHO_N "checking for c-ares lib... $ECHO_C" >&6 +- +- for dir in $ares_libdirs; do +- for extension in $ares_libexten; do +- try="$dir/libcares$extension" +- if test -f $try; then +- ares_libdir=$dir; +- ares_libcall=cares; +- break; +- fi +- done +- if test "$ares_libdir" != "NONE"; then +- break; +- fi +- done +- +- if test "$ares_libdir" = "NONE"; then +- echo "$as_me:$LINENO: result: not found" >&5 +-echo "${ECHO_T}not found" >&6 +- else +- echo "$as_me:$LINENO: result: found at $ares_libdir" >&5 +-echo "${ECHO_T}found at $ares_libdir" >&6 +- fi +- +- echo "$as_me:$LINENO: checking for ares_version in -lcares" >&5 +-echo $ECHO_N "checking for ares_version in -lcares... $ECHO_C" >&6 +-if test "${ac_cv_lib_cares_ares_version+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- ac_check_lib_save_LIBS=$LIBS +-LIBS="-lcares $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-/* Override any gcc2 internal prototype to avoid an error. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char ares_version (); +-int +-main () +-{ +-ares_version (); +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext conftest$ac_exeext +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest$ac_exeext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_lib_cares_ares_version=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-ac_cv_lib_cares_ares_version=no +-fi +-rm -f conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-LIBS=$ac_check_lib_save_LIBS +-fi +-echo "$as_me:$LINENO: result: $ac_cv_lib_cares_ares_version" >&5 +-echo "${ECHO_T}$ac_cv_lib_cares_ares_version" >&6 +-if test $ac_cv_lib_cares_ares_version = yes; then +- +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_CARES_H 1 +-_ACEOF +- +- LIBS="$LIBS -L$ares_libdir -l$ares_libcall" +- CFLAGS="$CFLAGS -I$ares_incdir" +- SIPSAK_HAVE_ARES="1" +- +- +-fi +- +- fi +- +-if test "X$SIPSAK_HAVE_ARES" == "X"; then +- +- echo "$as_me:$LINENO: checking for ruli.h" >&5 +-echo $ECHO_N "checking for ruli.h... $ECHO_C" >&6 +- +- ruli_incdir=NONE +- ruli_libdir=NONE +- ruli_incdirs="/usr/include /usr/local/include /sw/include" +- ruli_libdirs="/usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /sw/lib" +- ruli_libexten=".so .dylib .a" +- +- for dir in $ruli_incdirs; do +- try="$dir/ruli.h" +- if test -f $try; then +- ruli_incdir=$dir; +- break; +- fi +- done +- +- if test "$ruli_incdir" = "NONE"; then +- echo "$as_me:$LINENO: result: not found" >&5 +-echo "${ECHO_T}not found" >&6 +- else +- echo "$as_me:$LINENO: result: found at $ruli_incdir" >&5 +-echo "${ECHO_T}found at $ruli_incdir" >&6 +- +- echo "$as_me:$LINENO: checking for libruli" >&5 +-echo $ECHO_N "checking for libruli... $ECHO_C" >&6 +- +- for dir in $ruli_libdirs; do +- for extension in $ruli_libexten; do +- try="$dir/libruli$extension" +- if test -f $try; then +- ruli_libdir=$dir; +- break; +- fi +- done +- if test "$ruli_libdir" != "NONE"; then +- break; +- fi +- done +- +- if test "$ruli_libdir" = "NONE"; then +- echo "$as_me:$LINENO: result: not found" >&5 +-echo "${ECHO_T}not found" >&6 +- else +- echo "$as_me:$LINENO: result: found at $ruli_libdir" >&5 +-echo "${ECHO_T}found at $ruli_libdir" >&6 +- fi +- +- echo "$as_me:$LINENO: checking for ruli_sync_query in -lruli" >&5 +-echo $ECHO_N "checking for ruli_sync_query in -lruli... $ECHO_C" >&6 +-if test "${ac_cv_lib_ruli_ruli_sync_query+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- ac_check_lib_save_LIBS=$LIBS +-LIBS="-lruli $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-/* Override any gcc2 internal prototype to avoid an error. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char ruli_sync_query (); +-int +-main () +-{ +-ruli_sync_query (); +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext conftest$ac_exeext +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest$ac_exeext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_lib_ruli_ruli_sync_query=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-ac_cv_lib_ruli_ruli_sync_query=no +-fi +-rm -f conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-LIBS=$ac_check_lib_save_LIBS +-fi +-echo "$as_me:$LINENO: result: $ac_cv_lib_ruli_ruli_sync_query" >&5 +-echo "${ECHO_T}$ac_cv_lib_ruli_ruli_sync_query" >&6 +-if test $ac_cv_lib_ruli_ruli_sync_query = yes; then +- +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_RULI_H 1 +-_ACEOF +- +- LIBS="$LIBS -L$ruli_libdir -lruli" +- CFLAGS="$CFLAGS -I$ruli_incdir" +- +-fi +- +- fi +- +-else +- + for ac_header in arpa/nameser.h + do + as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +@@ -6361,7 +6103,6 @@ + + done + +-fi + + + # Check for T1 timer value diff --git a/net/slurm/Makefile b/net/slurm/Makefile new file mode 100644 index 0000000..53096f0 --- /dev/null +++ b/net/slurm/Makefile @@ -0,0 +1,59 @@ +# +# 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:=slurm +PKG_VERSION:=0.3.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.wormulon.net/slurm/ +PKG_MD5SUM:=e68d09202b835c644f7f6b7f070f29a2 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/slurm + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libncurses + TITLE:=A realtime network interface monitor + URL:=http://www.wormulon.net/slurm/ +endef + +define Package/slurm/description + A realtime network interface monitor with the following features: + - realtime traffic statistics divided into incoming and outgoing ; + - optional combined view ; + - can monitor any kind of network interface ; + - shows detailed statistics about the interface ; + - it's themeable. +endef + +define Build/Configure + (cd $(PKG_BUILD_DIR); touch \ + configure.in \ + aclocal.m4 \ + Makefile.in \ + config.h.in \ + configure \ + ); + $(call Build/Configure/Default, \ + , \ + LIBS="-lncurses" \ + ac_cv_lib_ncurses_use_default_colors=yes \ + ) +endef + +define Package/slurm/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/slurm $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,slurm)) diff --git a/net/slurm/patches/001-no_host_curses.patch b/net/slurm/patches/001-no_host_curses.patch new file mode 100644 index 0000000..ce97478 --- /dev/null +++ b/net/slurm/patches/001-no_host_curses.patch @@ -0,0 +1,67 @@ +diff -ruN slurm-0.3.3-old/configure slurm-0.3.3-new/configure +--- slurm-0.3.3-old/configure 2004-09-28 16:34:56.000000000 +0200 ++++ slurm-0.3.3-new/configure 2005-11-06 22:08:53.000000000 +0100 +@@ -4762,35 +4762,35 @@ + _ACEOF + + +-for cursespath in /usr/include/ncurses.h /usr/local/include/ncurses.h /usr/local/include/ncurses/ncurses.h /opt/include/ncurses.h /opt/include/curses.h /usr/include/curses.h /usr/local/include/curses.h /dev/null +-do +- test -f "${cursespath}" && break +-done +-case ${cursespath} in +- /usr/include/*) +- CFLAGS="$CFLAGS -I/usr/include" +- LDFLAGS="" +- ;; +- /usr/local/include/ncurses/*) +- CFLAGS="${CFLAGS} -I/usr/local/include/ncurses" +- LDFLAGS="-L/usr/local/lib" +- SOLLDFLAGS="-R/usr/local/lib" +- ;; +- /usr/local/include/*) +- CFLAGS="${CFLAGS} -I/usr/local/include" +- LDFLAGS="-L/usr/local/lib" +- SOLLDFLAGS="-R/usr/local/lib" +- ;; +- /opt/include/*) +- CFLAGS="${CFLAGS} -I/opt/include" +- LDFLAGS="-L/opt/lib" +- SOLLDFLAGS="-R/opt/lib" +- ;; +-esac ++#for cursespath in /usr/include/ncurses.h /usr/local/include/ncurses.h /usr/local/include/ncurses/ncurses.h /opt/include/ncurses.h /opt/include/curses.h /usr/include/curses.h /usr/local/include/curses.h /dev/null ++#do ++# test -f "${cursespath}" && break ++#done ++#case ${cursespath} in ++# /usr/include/*) ++# CFLAGS="$CFLAGS -I/usr/include" ++# LDFLAGS="" ++# ;; ++# /usr/local/include/ncurses/*) ++# CFLAGS="${CFLAGS} -I/usr/local/include/ncurses" ++# LDFLAGS="-L/usr/local/lib" ++# SOLLDFLAGS="-R/usr/local/lib" ++# ;; ++# /usr/local/include/*) ++# CFLAGS="${CFLAGS} -I/usr/local/include" ++# LDFLAGS="-L/usr/local/lib" ++# SOLLDFLAGS="-R/usr/local/lib" ++# ;; ++# /opt/include/*) ++# CFLAGS="${CFLAGS} -I/opt/include" ++# LDFLAGS="-L/opt/lib" ++# SOLLDFLAGS="-R/opt/lib" ++# ;; ++#esac + # add Slowlaris -R and libraries to LDFLAGS +-if test ${OSTYPE} = "solaris" ; then +- LDFLAGS="${LDFLAGS} ${SOLLDFLAGS} -lnsl -lsocket -lkstat" +-fi ++#if test ${OSTYPE} = "solaris" ; then ++# LDFLAGS="${LDFLAGS} ${SOLLDFLAGS} -lnsl -lsocket -lkstat" ++#fi + + echo "$as_me:$LINENO: checking for vanilla_coke in -lfridge" >&5 + echo $ECHO_N "checking for vanilla_coke in -lfridge... $ECHO_C" >&6 diff --git a/net/smap/Makefile b/net/smap/Makefile new file mode 100644 index 0000000..f6a1a07 --- /dev/null +++ b/net/smap/Makefile @@ -0,0 +1,64 @@ +# +# Copyright (C) 2009 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:=smap +PKG_VERSION:=0.6.0 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-20081016.tar.gz +PKG_SOURCE_URL:=http://www.wormulon.net/smap/ +PKG_MD5SUM:=814456ccc8fea5688382b7ec55fe44eb + +PKG_BUILD_DIR:=$(BUILD_DIR)/smap-$(PKG_VERSION)/smap +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +LIBTOOL="$(STAGING_DIR)/host/bin/libtool" + +define Package/smap + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + TITLE:=A SIP network discovery tool + MAINTAINER:=Daniel Dickinson + URL:=http://www.wormulon.net/smap/ + DEPENDS:=+libpthread +endef + +define Package/smap/description + Discovers and identifies SIP devices on the network including hardware + phones, softphones, PBX software, and PBX equipment. +endef + +# define Package/smap/conffiles +# /etc/config/smap +# endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + LD="$(TARGET_LD)" \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -DRAW_SOCKET -DHAVE_RANDOM -DSMAP_OS=linux" \ + LDFLAGS="$(TARGET_LDFLAGS) -lm -lpthread" \ + LIBTOOL="$(LIBTOOL)" \ + smap +endef + +define Package/smap/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/smap $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/share/smap + $(CP) $(PKG_BUILD_DIR)/fingerprint.db $(1)/usr/share/smap +endef + +$(eval $(call BuildPackage,smap)) diff --git a/net/smap/patches/00-fix-broadcast.patch b/net/smap/patches/00-fix-broadcast.patch new file mode 100644 index 0000000..c47b89e --- /dev/null +++ b/net/smap/patches/00-fix-broadcast.patch @@ -0,0 +1,62 @@ +diff -Naur smap.orig/icmpping.c smap/icmpping.c +--- smap.orig/icmpping.c 2007-10-07 06:15:11.000000000 -0400 ++++ smap/icmpping.c 2009-06-13 11:57:28.000000000 -0400 +@@ -182,6 +182,7 @@ + struct sockaddr_in sin; + #define ICMP_PKT_LEN (sizeof(struct icmp) + ICMP_PAYLOAD_LEN) + char icmpbuf[ICMP_PKT_LEN]; ++ socklen_t socklen; + + /* prepare ICMP packet */ + memset(&icmpbuf, 'A', ICMP_PKT_LEN); +@@ -207,6 +208,8 @@ + if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one)) != 0) + perror("setsockopt"); + #endif ++ if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &one, sizeof(one)) != 0) ++ perror("setsockopt"); + icmp->icmp_cksum = icmp_in_cksum((unsigned short *) &icmpbuf, ICMP_PKT_LEN); + + /* send data */ +diff -Naur smap.orig/smap.c smap/smap.c +--- smap.orig/smap.c 2007-11-03 14:14:52.000000000 -0400 ++++ smap/smap.c 2009-06-13 10:49:15.000000000 -0400 +@@ -244,11 +244,11 @@ + break; + case 't': /* TCP transport */ + /* UDP is default so TCP would override it */ +- config.flags ^= FLAG_UDP_TRANSPORT; ++ config.flags &= ~FLAG_UDP_TRANSPORT; + config.flags |= FLAG_TCP_TRANSPORT; + break; + case 'u': /* UDP transport */ +- config.flags ^= FLAG_TCP_TRANSPORT; ++ config.flags &= ~FLAG_TCP_TRANSPORT; + config.flags |= FLAG_UDP_TRANSPORT; + break; + case 'r': /* ratelimit messages/sec */ +diff -Naur smap.orig/transport_udp.c smap/transport_udp.c +--- smap.orig/transport_udp.c 2008-08-20 09:02:57.000000000 -0400 ++++ smap/transport_udp.c 2009-06-13 11:56:15.000000000 -0400 +@@ -52,6 +52,7 @@ + extern int udp_sendsock; + extern struct sockaddr_in udp_sendsock_sockaddr; + int sockaddrlen; ++ int one; + + /* is 5060 (DEFAULT_SIP_PORT) available? + * if yes, we'll use it since some clients send responses to +@@ -116,6 +117,13 @@ + error(ERR_DEBUG, "bind() successful"); + } + } ++ one = 1; ++ if (setsockopt(udp_sendsock, SOL_SOCKET, SO_BROADCAST, &one, sizeof(one)) != 0) { ++ perror("setsockopt"); ++ error(ERR_ERROR, "unable to set socket to broadcast"); ++ return 0; ++ } ++ + if (getsockname(udp_sendsock, (struct sockaddr *) &udp_sendsock_sockaddr, + (socklen_t *) &sockaddrlen) != 0) + if (DEBUG) perror("getsocknameudp_sendsock"); diff --git a/net/smap/patches/01-add-tecom-supported-header.patch b/net/smap/patches/01-add-tecom-supported-header.patch new file mode 100644 index 0000000..699a635 --- /dev/null +++ b/net/smap/patches/01-add-tecom-supported-header.patch @@ -0,0 +1,12 @@ +diff -Naur smap.broadcast/test_supported.c smap/test_supported.c +--- smap.broadcast/test_supported.c 2009-06-14 21:41:49.000000000 -0400 ++++ smap/test_supported.c 2009-06-14 21:51:17.000000000 -0400 +@@ -49,6 +49,8 @@ + {"Supported: timer, 100rel, replaces, callerid", 13}, + /* Cisco 79x0 */ + {"Supported: replaces,join,norefersub", 14}, ++ /* Tecom IP2007 */ ++ {"Supported: 100rel,replaces", 15 }, + {"", 0} + }; + diff --git a/net/smap/patches/02-segfault-and-toofast-bugfixes.patch b/net/smap/patches/02-segfault-and-toofast-bugfixes.patch new file mode 100644 index 0000000..1f14786 --- /dev/null +++ b/net/smap/patches/02-segfault-and-toofast-bugfixes.patch @@ -0,0 +1,63 @@ +diff -Naur smap.supported/config.h smap/config.h +--- smap.supported/config.h 2009-06-14 22:18:57.000000000 -0400 ++++ smap/config.h 2009-06-24 16:36:50.000000000 -0400 +@@ -113,6 +113,7 @@ + + #define DEFAULT_SIP_PORT 5060 + #define DEFAULT_TIMEOUT 500 /* in ms */ ++#define DEFAULT_RATELIMIT 25 + + /* randomizer related ********************************************************/ + enum { RAND_CALLID = 1, RAND_TAG, RAND_CSEQ, RAND_BRANCH }; +diff -Naur smap.supported/listener.c smap/listener.c +--- smap.supported/listener.c 2009-06-14 22:18:57.000000000 -0400 ++++ smap/listener.c 2009-06-15 04:36:40.000000000 -0400 +@@ -130,7 +130,7 @@ + /* use Call-ID to match response to requests */ + callid = response_getcallid(msg); + if (callid == 0) { +- error(ERR_NOTICE, "could not parse Call-ID"); ++ error(ERR_DEBUG, "could not parse Call-ID"); + goto nextmsg; + } + state = state_lookup_by_callid(callid); +diff -Naur smap.supported/results.c smap/results.c +--- smap.supported/results.c 2009-06-14 22:18:57.000000000 -0400 ++++ smap/results.c 2009-06-24 16:38:00.000000000 -0400 +@@ -39,6 +39,7 @@ + (task->results & RES_ICMP_REACH) ? "reachable" : "unreachable", + (task->results & RES_SIP_ENABLED) ? "enabled" : "disabled"); + if (task->results & RES_SIP_ENABLED) ++ error(ERR_DEBUG, "Looking up fingerprint"); + fingerprint_lookup(*task->fp); + break; + default: +diff -Naur smap.supported/smap.c smap/smap.c +--- smap.supported/smap.c 2009-06-14 22:18:57.000000000 -0400 ++++ smap/smap.c 2009-06-24 17:09:39.000000000 -0400 +@@ -197,7 +197,7 @@ + config.sip_port = DEFAULT_SIP_PORT; + config.sip_domain = NULL; + config.timeout = DEFAULT_TIMEOUT; +- config.ratelimit = 0; ++ config.ratelimit = DEFAULT_RATELIMIT; + + printf("\nsmap %s " + "http://www.wormulon.net/\n\n", SMAP_VERSION); +@@ -338,12 +338,15 @@ + break; /* make gcc happy */ + } + error_while_scanning: +- + pthread_join(pth_worker, NULL); + pthread_kill(pth_worker, SIGINT); + pthread_kill(pth_listener, SIGINT); + stats_dump(); + ++ signal(SIGINT, SIG_DFL); ++ signal(SIGTERM, SIG_DFL); ++ signal(SIGKILL, SIG_DFL); ++ + /* clean up */ + pthread_mutex_destroy(&scrlock); + pthread_mutex_destroy(&tasklock); diff --git a/net/smcroute/Makefile b/net/smcroute/Makefile new file mode 100644 index 0000000..8626b66 --- /dev/null +++ b/net/smcroute/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=smcroute +PKG_VERSION:=0.92 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://www.cschill.de/smcroute +PKG_MD5SUM:=2b50e7166606ec90e09682399e69c4a6 + +include $(INCLUDE_DIR)/package.mk + +define Package/smcroute + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE:=Static multicast routing daemon + URL:=http://www.cschill.de/smcroute/ +endef + +define Package/smcroute/description + SMCRoute is a command line tool to manipulate the multicast routes of the Linux kernel. +endef + + +ifeq ($(HOST_OS),FreeBSD) + TARGET_CFLAGS += -fno-builtin-log + TARGET_LDFLAGS += -fno-builtin-log +endif + +define Build/Compile + $(MAKE) CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS)" -C $(PKG_BUILD_DIR)/src all +endef + +define Package/smcroute/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/smcroute $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mcsender $(1)/usr/bin/ + $(INSTALL_BIN) ./files/smcroute.init $(1)/etc/init.d/smcroute +endef + +$(eval $(call BuildPackage,smcroute)) diff --git a/net/smcroute/files/smcroute.init b/net/smcroute/files/smcroute.init new file mode 100644 index 0000000..3e36272 --- /dev/null +++ b/net/smcroute/files/smcroute.init @@ -0,0 +1,11 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2010 OpenWrt.org +START=50 + +start() { + smcroute -d +} + +stop() { + smcroute -k +} diff --git a/net/smcroute/patches/001-socket_path.patch b/net/smcroute/patches/001-socket_path.patch new file mode 100644 index 0000000..4b6eda0 --- /dev/null +++ b/net/smcroute/patches/001-socket_path.patch @@ -0,0 +1,11 @@ +--- a/src/ipc.c 2002-07-07 19:38:49.000000000 +0200 ++++ b/src/ipc.c 2010-10-01 21:44:26.000000000 +0200 +@@ -24,7 +24,7 @@ + + #include "mclab.h" + +-#define SOCKET_PATH "/var/lib/smcroute" ++#define SOCKET_PATH "/tmp/smcroute" + + // server's listen socket + static int ListenSock; diff --git a/net/smcroute/patches/002-optimize_size.patch b/net/smcroute/patches/002-optimize_size.patch new file mode 100644 index 0000000..23059fa --- /dev/null +++ b/net/smcroute/patches/002-optimize_size.patch @@ -0,0 +1,12 @@ +--- a/src/Makefile ++++ b/src/Makefile +@@ -1,9 +1,6 @@ + + BINDIR=../bin + +-# CFLAGS=-g +-CFLAGS=-O +- + default : build.h smcroute + + all : smcroute mcsender diff --git a/net/smtptrapd/Makefile b/net/smtptrapd/Makefile new file mode 100644 index 0000000..5cfd700 --- /dev/null +++ b/net/smtptrapd/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2008-2011 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:=smtptrapd +PKG_VERSION:=1.5 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=edc5f2f3ea9f9bdd9e0f479a58903bf1 + +include $(INCLUDE_DIR)/package.mk + +define Package/smtptrapd + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpthread + TITLE:=SMTP Trap Daemon + URL:=http://smtptrapd.sourceforge.net/ +endef + +define Package/smtptrapd/description + The smtptrapd program is a multi-threaded daemon that provides + a RFC 2821 compliant SMTP service that always returns a 4xx soft + error to the RCPT TO verb. +endef + +define Build/Compile + $(TARGET_CC) \ + $(TARGET_CFLAGS) \ + $(TARGET_CPPFLAGS) \ + -D_REENTRANT \ + $(PKG_BUILD_DIR)/smtptrapd.c \ + -o $(PKG_BUILD_DIR)/smtptrapd \ + $(TARGET_LDFLAGS) \ + -lpthread +endef + +define Package/smtptrapd/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/smtptrapd.init $(1)/etc/init.d/smtptrapd + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/smtptrapd $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,smtptrapd)) diff --git a/net/smtptrapd/files/smtptrapd.init b/net/smtptrapd/files/smtptrapd.init new file mode 100644 index 0000000..53aba97 --- /dev/null +++ b/net/smtptrapd/files/smtptrapd.init @@ -0,0 +1,125 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2011 OpenWrt.org + +SERVICE_USE_PID=1 + +START=90 +STOP=10 + +EXTRA_COMMANDS="list status exconf" +EXTRA_HELP=" list Lists available configurations + status Prints status of the service + exconf Shows an example config file + +The actions start, stop, restart, reload, status operate +globally on all configurations unless the particular +configuration has been provided as the next parameter. +" + +check_section() { + echo "$1" | grep -vq '^cfg[[:xdigit:]]\{6\}$' +} + +start_instance() { + local section="$1" + local instance="$2" + + check_section "$section" || return 1 + [ -n "$instance" -a "$section" != "$instance" ] && return 0 + + local args listen_ip banner_host username num_threads listen_port accept_queue_len + + config_get listen_ip "$section" 'listen_ip' + [ -n "$listen_ip" ] && append args "-l $listen_ip" + + config_get listen_port "$section" 'listen_port' + [ -n "$listen_port" ] && append args "-p $listen_port" + + config_get username "$section" 'username' + [ -n "$username" ] && append args "-u $username" + + config_get banner_host "$section" 'banner_host' + [ -n "$banner_host" ] && append args "-b '$banner_host'" + + config_get num_threads "$section" 'num_threads' + [ -n "$num_threads" ] && append args "-t $num_threads" + + config_get accept_queue_len "$section" 'accept_queue_len' + [ -n "$accept_queue_len" ] && append args "-m $accept_queue_len" + + SERVICE_PID_FILE="/var/run/smtptrapd-${section}.pid + service_start /usr/sbin/smtptrapd -f $SERVICE_PID_FILE $args +} + +stop_instance() { + local section="$1" + local instance="$2" + + check_section "$section" || return 1 + [ -n "$instance" -a "$section" != "$instance" ] && return 0 + + SERVICE_PID_FILE="/var/run/smtptrapd-${section}.pid" + service_stop /usr/sbin/smtptrapd +} + +check_instance() { + local section="$1" + local instance="$2" + + check_section "$section" || return 1 + [ -n "$instance" -a "$section" != "$instance" ] && return 0 + + SERVICE_PID_FILE="/var/run/smtptrapd-${section}.pid" + service_check /usr/sbin/smtptrapd && { + echo "${initscript}: configuration instance '$section' is running" + } || { + echo "${initscript}: configuration instance '$section' is not running" + } +} + +list_instance() { + local section="$1" + check_section "$section" || return 1 + echo " $section" +} + +start() { + config_load 'smtptrapd' + config_foreach start_instance 'smtptrapd' "$@" +} + +stop() { + config_load 'smtptrapd' + config_foreach stop_instance 'smtptrapd' "$@" +} + +status() { + config_load 'smtptrapd' + config_foreach check_instance 'smtptrapd' "$@" +} + +list() { + config_load 'smtptrapd' + echo "${initscript}: available configuration instances:" + config_foreach list_instance 'smtptrapd' +} + +exconf() { + cat <' +# option 'username' 'nobody' +# option 'listen_ip' '' +# option 'listen_port' '25' +# option 'num_threads' '10' +# option 'accept_queue_len' '100' +EOF +} diff --git a/net/smtptrapd/patches/200-missing_opt.patch b/net/smtptrapd/patches/200-missing_opt.patch new file mode 100644 index 0000000..c989b01 --- /dev/null +++ b/net/smtptrapd/patches/200-missing_opt.patch @@ -0,0 +1,12 @@ +diff -urN smtptrapd-1.5.orig/smtptrapd.c smtptrapd-1.5.dev/smtptrapd.c +--- smtptrapd-1.5.orig/smtptrapd.c 2008-04-15 12:56:20.000000000 +0200 ++++ smtptrapd-1.5.dev/smtptrapd.c 2008-04-16 18:23:03.000000000 +0200 +@@ -545,7 +545,7 @@ + config.threads = NUM_CONSUMER; + config.max_queue_len = MAX_QUEUE_LEN; + +- while ((c = getopt(argc, argv, "hc:l:p:b:u:m:t:")) != -1) { ++ while ((c = getopt(argc, argv, "hc:l:p:b:u:m:t:f:")) != -1) { + switch (c) { + case 'h': + diff --git a/net/snort-wireless/Makefile b/net/snort-wireless/Makefile new file mode 100644 index 0000000..32c404e --- /dev/null +++ b/net/snort-wireless/Makefile @@ -0,0 +1,147 @@ +# +# 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:=snort-wireless +PKG_VERSION:=2.4.3-alpha04 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.snort-wireless.org/files/ +PKG_MD5SUM:=1aa699ae279bf7a1140cf6cca02f9999 + +include $(INCLUDE_DIR)/package.mk + +define Package/snort-wireless/Default + SUBMENU:=wireless + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libnet0 +libpcap +libpcre + TITLE:=Lightweight Network Intrusion Detection System + URL:=http://www.snort-wireless.org/ +endef + +define Package/snort-wireless + $(call Package/snort-wireless/Default) +endef + +define Package/snort-wireless-mysql + $(call Package/snort-wireless/Default) + DEPENDS+= +libmysqlclient + TITLE+= (MySQL) +endef + +define Package/snort-wireless-pgsql + $(call Package/snort-wireless/Default) + DEPENDS+= +libpq + TITLE+= (PostgreSQL) +endef + + +define Compile/Template + +$(PKG_BUILD_DIR)/snort$(1): $(STAMP_CONFIGURED) + touch -r $(PKG_BUILD_DIR)/Makefile.am $(PKG_BUILD_DIR)/configure.in + touch -r $(PKG_BUILD_DIR)/Makefile.in $(PKG_BUILD_DIR)/configure + -$(MAKE) -C $(PKG_BUILD_DIR) distclean + $(call Build/Configure/Default, \ + --enable-flexresp \ + --with-libnet-includes="$(STAGING_DIR)/usr/lib/libnet-1.0.x/include" \ + --with-libnet-libraries="$(STAGING_DIR)/usr/lib/libnet-1.0.x/lib" \ + --with-libpcap-includes="$(STAGING_DIR)/usr/include" \ + --with-libpcap-libraries="$(STAGING_DIR)/usr/lib" \ + --with-libpcre-includes="$(STAGING_DIR)/usr/include" \ + --with-libpcre-libraries="$(STAGING_DIR)/usr/lib" \ + $(2) \ + , \ + CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \ + LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \ + PATH="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH" \ + $(3) \ + ); + $(MAKE) -C $(PKG_BUILD_DIR) \ + extra_incl="" \ + all + mv $(PKG_BUILD_DIR)/src/snort $(PKG_BUILD_DIR)/snort$(1) + +$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/snort$(1) + +endef + + +define Install/Template + +define Package/snort-wireless$(1)/conffiles +/etc/default/snort +/etc/snort/snort.conf +/etc/snort/threshold.conf +endef + +define Package/snort-wireless$(1)/install + $(INSTALL_DIR) $$(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/snort$(1) $$(1)/usr/sbin/snort + $(INSTALL_DIR) $$(1)/etc/snort + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/snort.conf $$(1)/etc/snort/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/classification.config $$(1)/etc/snort/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/gen-msg.map $$(1)/etc/snort/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/reference.config $$(1)/etc/snort/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/sid-msg.map $$(1)/etc/snort/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/threshold.conf $$(1)/etc/snort/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/unicode.map $$(1)/etc/snort/ + $(INSTALL_DIR) $$(1)/etc/default + $(INSTALL_DATA) ./files/snort-wireless.default $$(1)/etc/default/snort + $(INSTALL_DIR) $$(1)/etc/init.d + $(INSTALL_BIN) ./files/snort-wireless.init $$(1)/etc/init.d/snort +endef + +endef + + +ifneq ($(SDK)$(CONFIG_PACKAGE_snort-wireless),) + define Compile/snort-wireless + $(call Compile/Template,, \ + --without-mysql \ + --without-postgresql \ + ) + $(call Install/Template,) + endef +endif +$(eval $(Compile/snort-wireless)) + + +ifneq ($(SDK)$(CONFIG_PACKAGE_snort-wireless-mysql),) + define Compile/snort-wireless-mysql + $(call Compile/Template,-mysql, \ + --with-mysql="$(STAGING_DIR)/usr" \ + --without-postgresql \ + ) + $(call Install/Template,-mysql) + endef +endif +$(eval $(Compile/snort-wireless-mysql)) + +ifneq ($(SDK)$(CONFIG_PACKAGE_snort-wireless-pgsql),) + define Compile/snort-wireless-pgsql + $(call Compile/Template,-pgsql, \ + --without-mysql \ + --with-postgresql="$(STAGING_DIR)/usr" \ + ) + $(call Install/Template,-pgsql) + endef +endif +$(eval $(Compile/snort-wireless-pgsql)) + +define Build/Configure +endef + +define Build/Compile +endef + +$(eval $(call BuildPackage,snort-wireless)) +$(eval $(call BuildPackage,snort-wireless-mysql)) +$(eval $(call BuildPackage,snort-wireless-pgsql)) diff --git a/net/snort-wireless/files/snort-wireless.default b/net/snort-wireless/files/snort-wireless.default new file mode 100644 index 0000000..796a893 --- /dev/null +++ b/net/snort-wireless/files/snort-wireless.default @@ -0,0 +1,2 @@ +INTERFACE="vlan1" # WAN +OPTIONS="-i $INTERFACE -c /etc/snort/snort.conf -D -N -q -s" diff --git a/net/snort-wireless/files/snort-wireless.init b/net/snort-wireless/files/snort-wireless.init new file mode 100644 index 0000000..8c019c4 --- /dev/null +++ b/net/snort-wireless/files/snort-wireless.init @@ -0,0 +1,23 @@ +#!/bin/sh + +DEFAULT=/etc/default/snort +LOG_D=/var/log/snort +RUN_D=/var/run +[ -f $DEFAULT ] && . $DEFAULT +PID_F=$RUN_D/snort_$INTERFACE.pid + +case $1 in + start) + [ -d $LOG_D ] || mkdir -p $LOG_D + [ -d $RUN_D ] || mkdir -p $RUN_D + snort $OPTIONS + ;; + stop) + [ -f $PID_F ] && kill $(cat $PID_F) + ;; + *) + echo "usage: $0 (start|stop)" + exit 1 +esac + +exit $? diff --git a/net/snort-wireless/patches/500-no-config-search.patch b/net/snort-wireless/patches/500-no-config-search.patch new file mode 100644 index 0000000..d674ba6 --- /dev/null +++ b/net/snort-wireless/patches/500-no-config-search.patch @@ -0,0 +1,35 @@ +--- snort-2.3.2-orig/src/snort.c 2005-01-13 21:36:20.000000000 +0100 ++++ snort-2.3.2-1/src/snort.c 2005-04-04 20:03:34.000000000 +0200 +@@ -1949,7 +1949,7 @@ + { + struct stat st; + int i; +- char *conf_files[]={"/etc/snort.conf", "./snort.conf", NULL}; ++ char *conf_files[]={"/etc/snort/snort.conf", NULL}; + char *fname = NULL; + char *home_dir = NULL; + char *rval = NULL; +@@ -1970,23 +1970,6 @@ + i++; + } + +- /* search for .snortrc in the HOMEDIR */ +- if(!rval) +- { +- if((home_dir = getenv("HOME"))) +- { +- /* create the full path */ +- fname = (char *)malloc(strlen(home_dir) + strlen("/.snortrc") + 1); +- if(!fname) +- FatalError("Out of memory searching for config file\n"); +- +- if(stat(fname, &st) != -1) +- rval = fname; +- else +- free(fname); +- } +- } +- + return rval; + } + diff --git a/net/snort-wireless/patches/750-lightweight-config.patch b/net/snort-wireless/patches/750-lightweight-config.patch new file mode 100644 index 0000000..daea3be --- /dev/null +++ b/net/snort-wireless/patches/750-lightweight-config.patch @@ -0,0 +1,178 @@ +--- snort-wireless-2.4.3-alpha04/etc/snort.conf 2005-10-21 09:41:01.000000000 +0200 ++++ /Users/florian/telechargements/snort.conf 2005-10-30 13:20:17.000000000 +0100 +@@ -6,6 +6,7 @@ + # + ################################################### + # This file contains a sample snort configuration. ++# Most preprocessors and rules were disabled to save memory. + # You can take the following steps to create your own custom configuration: + # + # 1) Set the variables for your network +@@ -42,10 +43,10 @@ + # or you can specify the variable to be any IP address + # like this: + +-var HOME_NET any ++var HOME_NET 192.168.1.0/24 + + # Set up the external network addresses as well. A good start may be "any" +-var EXTERNAL_NET any ++var EXTERNAL_NET !$HOME_NET + + # Configure your wireless AP lists. This allows snort to look for attacks + # against your wireless network, such as rogue access points or adhoc wireless +@@ -137,7 +138,7 @@ + # Path to your rules files (this can be a relative path) + # Note for Windows users: You are advised to make this an absolute path, + # such as: c:\snort\rules +-var RULE_PATH ../rules ++var RULE_PATH /etc/snort/rules + + # Configure the snort decoder + # ============================ +@@ -413,11 +414,11 @@ + # lots of options available here. See doc/README.http_inspect. + # unicode.map should be wherever your snort.conf lives, or given + # a full path to where snort can find it. +-preprocessor http_inspect: global \ +- iis_unicode_map unicode.map 1252 ++#preprocessor http_inspect: global \ ++# iis_unicode_map unicode.map 1252 + +-preprocessor http_inspect_server: server default \ +- profile all ports { 80 8080 8180 } oversize_dir_length 500 ++#preprocessor http_inspect_server: server default \ ++# profile all ports { 80 8080 8180 } oversize_dir_length 500 + + # + # Example unique server configuration +@@ -451,7 +452,7 @@ + # no_alert_incomplete - don't alert when a single segment + # exceeds the current packet size + +-preprocessor rpc_decode: 111 32771 ++#preprocessor rpc_decode: 111 32771 + + # bo: Back Orifice detector + # ------------------------- +@@ -474,7 +475,7 @@ + # 3 Back Orifice Server Traffic Detected + # 4 Back Orifice Snort Buffer Attack + +-preprocessor bo ++#preprocessor bo + + # telnet_decode: Telnet negotiation string normalizer + # --------------------------------------------------- +@@ -486,7 +487,7 @@ + # This preprocessor requires no arguments. + # Portscan uses Generator ID 109 and does not generate any SID currently. + +-preprocessor telnet_decode ++#preprocessor telnet_decode + + # sfPortscan + # ---------- +@@ -537,9 +538,9 @@ + # are still watched as scanner hosts. The 'ignore_scanned' option is + # used to tune alerts from very active hosts such as syslog servers, etc. + # +-preprocessor sfportscan: proto { all } \ +- memcap { 10000000 } \ +- sense_level { low } ++#preprocessor sfportscan: proto { all } \ ++# memcap { 10000000 } \ ++# sense_level { low } + + # arpspoof + #---------------------------------------- +@@ -814,41 +815,41 @@ + include $RULE_PATH/bad-traffic.rules + include $RULE_PATH/exploit.rules + include $RULE_PATH/scan.rules +-include $RULE_PATH/finger.rules +-include $RULE_PATH/ftp.rules +-include $RULE_PATH/telnet.rules +-include $RULE_PATH/rpc.rules +-include $RULE_PATH/rservices.rules +-include $RULE_PATH/dos.rules +-include $RULE_PATH/ddos.rules +-include $RULE_PATH/dns.rules +-include $RULE_PATH/tftp.rules +- +-include $RULE_PATH/web-cgi.rules +-include $RULE_PATH/web-coldfusion.rules +-include $RULE_PATH/web-iis.rules +-include $RULE_PATH/web-frontpage.rules +-include $RULE_PATH/web-misc.rules +-include $RULE_PATH/web-client.rules +-include $RULE_PATH/web-php.rules +- +-include $RULE_PATH/sql.rules +-include $RULE_PATH/x11.rules +-include $RULE_PATH/icmp.rules +-include $RULE_PATH/netbios.rules +-include $RULE_PATH/misc.rules +-include $RULE_PATH/attack-responses.rules +-include $RULE_PATH/oracle.rules +-include $RULE_PATH/mysql.rules +-include $RULE_PATH/snmp.rules +- +-include $RULE_PATH/smtp.rules +-include $RULE_PATH/imap.rules +-include $RULE_PATH/pop2.rules +-include $RULE_PATH/pop3.rules ++#include $RULE_PATH/finger.rules ++#include $RULE_PATH/ftp.rules ++#include $RULE_PATH/telnet.rules ++#include $RULE_PATH/rpc.rules ++#include $RULE_PATH/rservices.rules ++#include $RULE_PATH/dos.rules ++#include $RULE_PATH/ddos.rules ++#include $RULE_PATH/dns.rules ++#include $RULE_PATH/tftp.rules ++ ++#include $RULE_PATH/web-cgi.rules ++#include $RULE_PATH/web-coldfusion.rules ++#include $RULE_PATH/web-iis.rules ++#include $RULE_PATH/web-frontpage.rules ++#include $RULE_PATH/web-misc.rules ++#include $RULE_PATH/web-client.rules ++#include $RULE_PATH/web-php.rules ++ ++#include $RULE_PATH/sql.rules ++#include $RULE_PATH/x11.rules ++#include $RULE_PATH/icmp.rules ++#include $RULE_PATH/netbios.rules ++#include $RULE_PATH/misc.rules ++#include $RULE_PATH/attack-responses.rules ++#include $RULE_PATH/oracle.rules ++#include $RULE_PATH/mysql.rules ++#include $RULE_PATH/snmp.rules ++ ++#include $RULE_PATH/smtp.rules ++#include $RULE_PATH/imap.rules ++#include $RULE_PATH/pop2.rules ++#include $RULE_PATH/pop3.rules + +-include $RULE_PATH/nntp.rules +-include $RULE_PATH/other-ids.rules ++#include $RULE_PATH/nntp.rules ++#include $RULE_PATH/other-ids.rules + # include $RULE_PATH/web-attacks.rules + # include $RULE_PATH/backdoor.rules + # include $RULE_PATH/shellcode.rules +@@ -856,11 +857,11 @@ + # include $RULE_PATH/porn.rules + # include $RULE_PATH/info.rules + # include $RULE_PATH/icmp-info.rules +- include $RULE_PATH/virus.rules ++# include $RULE_PATH/virus.rules + # include $RULE_PATH/chat.rules + # include $RULE_PATH/multimedia.rules + # include $RULE_PATH/p2p.rules +-include $RULE_PATH/experimental.rules ++#include $RULE_PATH/experimental.rules + #include $RULE_PATH/wifi.rules + + # Include any thresholding or suppression commands. See threshold.conf in the diff --git a/net/snort/Makefile b/net/snort/Makefile new file mode 100644 index 0000000..eb16ccc --- /dev/null +++ b/net/snort/Makefile @@ -0,0 +1,181 @@ + +# Copyright (C) 2006-2012 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:=snort +PKG_VERSION:=2.9.2.2 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://snort.org/dl/snort-current/ +PKG_MD5SUM:=4254389550e3be31afebc70e64e6002f + +PKG_BUILD_DEPENDS:=librpc +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/snort/Default + SUBMENU:=Firewall + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +libpcre +libdnet +libdaq +libpthread +zlib + TITLE:=Lightweight Network Intrusion Detection System + URL:=http://www.snort.org/ +endef + +define Package/snort/Default/description + Snort is an open source network intrusion detection and prevention system. + It is capable of performing real-time traffic analysis, alerting, blocking + and packet logging on IP networks. It utilizes a combination of protocol + analysis and pattern matching in order to detect anomalies, misuse and + attacks. +endef + +define Package/snort + $(call Package/snort/Default) + VARIANT:=basic +endef + +define Package/snort/description + $(call Package/snort/Default/description) +endef + +define Package/snort-mysql + $(call Package/snort/Default) + DEPENDS+= +libmysqlclient + TITLE+= (MySQL) + VARIANT:=mysql +endef + +define Package/snort-mysql/description + $(call Package/snort/Default/description) + This package contains snort with support for logging to a MySQL database. +endef + +define Package/snort-pgsql + $(call Package/snort/Default) + DEPENDS+= +libpq + TITLE+= (PostgreSQL) + VARIANT:=pgsql +endef + +define Package/snort-pgsql/description + $(call Package/snort/Default/description) + This package contains snort with support for logging to a PostgreSQL database. +endef + + +CONFIGURE_ARGS += \ + --prefix="/usr" \ + --enable-flexresp \ + --with-dnet-includes="$(STAGING_DIR)/usr/include" \ + --with-dnet-libraries="$(STAGING_DIR)/usr/lib" \ + --with-libpcap-includes="$(STAGING_DIR)/usr/include" \ + --with-libpcap-libraries="$(STAGING_DIR)/usr/lib" \ + --with-libpcre-includes="$(STAGING_DIR)/usr/include" \ + --with-libpcre-libraries="$(STAGING_DIR)/usr/lib" \ + --with-daq-includes="$(STAGING_DIR)/usr/include" \ + --with-daq-libraries="$(STAGING_DIR)/usr/lib" \ + --disable-static-daq + +CONFIGURE_VARS += \ + CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \ + LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \ + PATH="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH" \ + +MAKE_FLAGS += \ + extra_incl="" \ + +ifeq ($(BUILD_VARIANT),basic) + + CONFIGURE_ARGS += \ + --without-mysql \ + --without-postgresql \ + +endif +ifeq ($(BUILD_VARIANT),mysql) + CONFIGURE_VARS += \ + mysql_has_reconnect=yes + + CONFIGURE_ARGS += \ + --with-mysql="$(STAGING_DIR)/usr" \ + --without-postgresql \ + +endif +ifeq ($(BUILD_VARIANT),pgsql) + + CONFIGURE_ARGS += \ + --without-mysql \ + --with-postgresql="$(STAGING_DIR)/usr" \ + +endif + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/snort/dynamic_preproc/* \ + $(STAGING_DIR)/usr/include/snort/dynamic_preproc/ + $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort/dynamic_preproc + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/snort/dynamic_preproc/* \ + $(STAGING_DIR)/usr/lib/snort/dynamic_preproc/ + $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicengine + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/* \ + $(STAGING_DIR)/usr/lib/snort_dynamicengine/ + $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/* \ + $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor/ +endef + +define Package/snort/conffiles +/etc/default/snort +/etc/snort/snort.conf +/etc/snort/threshold.conf +endef + +define Package/snort/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/snort $(1)/usr/bin/snort.bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/u2{boat,spewfoo} $(1)/usr/bin + $(INSTALL_BIN) ./files/snort.bin $(1)/usr/bin/snort + $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicengine + $(CP) $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/libsf_engine.so* $(1)/usr/lib/snort_dynamicengine/ + $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicpreprocessor + $(CP) $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/libsf*.so* $(1)/usr/lib/snort_dynamicpreprocessor/ + $(INSTALL_DIR) $(1)/etc/snort + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/snort.conf $(1)/etc/snort/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/attribute_table.dtd $(1)/etc/snort/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/classification.config $(1)/etc/snort/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/gen-msg.map $(1)/etc/snort/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/reference.config $(1)/etc/snort/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/threshold.conf $(1)/etc/snort/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/unicode.map $(1)/etc/snort/ + $(INSTALL_DIR) $(1)/etc/snort/preproc_rules + $(INSTALL_DATA) $(PKG_BUILD_DIR)/preproc_rules/*.rules $(1)/etc/snort/preproc_rules/ + $(INSTALL_DIR) $(1)/etc/snort/rules + $(INSTALL_DATA) ./files/snort.local.rules $(1)/etc/snort/rules/local.rules + $(INSTALL_DIR) $(1)/etc/default + $(INSTALL_DATA) ./files/snort.default $(1)/etc/default/snort + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/snort.init $(1)/etc/init.d/snort +endef + +Package/snort-mysql/conffiles = $(Package/snort/conffiles) +Package/snort-mysql/install = $(Package/snort/install) + +Package/snort-pgsql/conffiles = $(Package/snort/conffiles) +Package/snort-pgsql/install = $(Package/snort/install) + +$(eval $(call BuildPackage,snort)) +$(eval $(call BuildPackage,snort-mysql)) +$(eval $(call BuildPackage,snort-pgsql)) diff --git a/net/snort/files/snort.bin b/net/snort/files/snort.bin new file mode 100644 index 0000000..dd6b222 --- /dev/null +++ b/net/snort/files/snort.bin @@ -0,0 +1,3 @@ +#!/bin/sh + +exec snort.bin --daq-dir /usr/lib/daq/ $* diff --git a/net/snort/files/snort.default b/net/snort/files/snort.default new file mode 100644 index 0000000..dd50613 --- /dev/null +++ b/net/snort/files/snort.default @@ -0,0 +1,2 @@ +INTERFACE="lo" +OPTIONS="-i $INTERFACE -c /etc/snort/snort.conf -D -N -q -s" diff --git a/net/snort/files/snort.init b/net/snort/files/snort.init new file mode 100644 index 0000000..820ef11 --- /dev/null +++ b/net/snort/files/snort.init @@ -0,0 +1,20 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2012 OpenWrt.org + +START=99 +APP=snort +BIN_FILE="/usr/bin/"$APP +PID_FILE="/var/run/"$APP"_"$INTERFACE".pid" +OPTIONS= +DEFAULT=/etc/default/snort +LOG_D=/var/log/snort + +start() { + [ -d $LOG_D ] || mkdir -p $LOG_D + start-stop-daemon -S -x $BIN_FILE -p $PID_FILE -b -m -- $OPTIONS +} + +stop() { + start-stop-daemon -K -x $BIN_FILE -p $PID_FILE -q + rm -rf $PID_FILE +} diff --git a/net/snort/files/snort.local.rules b/net/snort/files/snort.local.rules new file mode 100644 index 0000000..13e9684 --- /dev/null +++ b/net/snort/files/snort.local.rules @@ -0,0 +1,5 @@ +# ---------------- +# LOCAL RULES +# ---------------- +# This file intentionally does not come with signatures. Put your local +# additions here. diff --git a/net/snort/patches/001-automake-compat.patch b/net/snort/patches/001-automake-compat.patch new file mode 100644 index 0000000..023c510 --- /dev/null +++ b/net/snort/patches/001-automake-compat.patch @@ -0,0 +1,4 @@ +--- /dev/null ++++ b/acinclude.m4 +@@ -0,0 +1 @@ ++sinclude(m4/libprelude.m4) diff --git a/net/snort/patches/100-INADDR_NONE.patch b/net/snort/patches/100-INADDR_NONE.patch new file mode 100644 index 0000000..cae11fc --- /dev/null +++ b/net/snort/patches/100-INADDR_NONE.patch @@ -0,0 +1,40 @@ +--- a/configure.in ++++ b/configure.in +@@ -283,21 +283,22 @@ AC_CHECK_TYPES([int8_t,int16_t,int32_t,i + AC_CHECK_TYPES([boolean]) + + # In case INADDR_NONE is not defined (like on Solaris) +-have_inaddr_none="no" +-AC_MSG_CHECKING([for INADDR_NONE]) +-AC_RUN_IFELSE( +-[AC_LANG_PROGRAM( +-[[ +-#include +-#include +-#include +-]], +-[[ +- if (inet_addr("10,5,2") == INADDR_NONE); +- return 0; +-]])], +-[have_inaddr_none="yes"], +-[have_inaddr_none="no"]) ++have_inaddr_none="yes" ++#AC_MSG_CHECKING([for INADDR_NONE]) ++#AC_RUN_IFELSE( ++#[AC_LANG_PROGRAM( ++#[[ ++##include ++##include ++##include ++#]], ++#[[ ++# if (inet_addr("10,5,2") == INADDR_NONE); ++# return 0; ++#]])], ++#[have_inaddr_none="yes"], ++#[have_inaddr_none="yes"]) ++ + AC_MSG_RESULT($have_inaddr_none) + if test "x$have_inaddr_none" = "xno"; then + AC_DEFINE([INADDR_NONE],[-1],[For INADDR_NONE definition]) diff --git a/net/snort/patches/101-PCAP.patch b/net/snort/patches/101-PCAP.patch new file mode 100644 index 0000000..5ffc165 --- /dev/null +++ b/net/snort/patches/101-PCAP.patch @@ -0,0 +1,31 @@ +--- a/configure.in ++++ b/configure.in +@@ -401,16 +401,18 @@ if test "x$LPCAP" = "xno"; then + fi + + AC_MSG_CHECKING([for pcap_lex_destroy]) +-AC_RUN_IFELSE( +-[AC_LANG_PROGRAM( +-[[ +-#include +-]], +-[[ +- pcap_lex_destroy(); +-]])], +-[have_pcap_lex_destroy="yes"], +-[have_pcap_lex_destroy="no"]) ++have_pcap_lex_destroy="yes" ++#AC_RUN_IFELSE( ++#[AC_LANG_PROGRAM( ++#[[ ++##include ++#]], ++#[[ ++# pcap_lex_destroy(); ++#]])], ++#[have_pcap_lex_destroy="yes"], ++#[have_pcap_lex_destroy="no"]) ++ + AC_MSG_RESULT($have_pcap_lex_destroy) + if test "x$have_pcap_lex_destroy" = "xyes"; then + AC_DEFINE([HAVE_PCAP_LEX_DESTROY],[1],[Can cleanup lex buffer stack created by pcap bpf filter]) diff --git a/net/snort/patches/150-config-preprocessors-disable.patch b/net/snort/patches/150-config-preprocessors-disable.patch new file mode 100644 index 0000000..c9d71cb --- /dev/null +++ b/net/snort/patches/150-config-preprocessors-disable.patch @@ -0,0 +1,491 @@ +--- a/etc/snort.conf ++++ b/etc/snort.conf +@@ -20,6 +20,13 @@ + # test mode -T you are required to supply an interface -i + # or test mode will fail to fully validate the configuration and + # exit with a FATAL error ++#! ++#! OpenWrt: ++#! Some options in this config were changed to adapt snort for OpenWrt. Any changes ++#! made to the original default configuration will start with '#! ' so you can track ++#! the changes. ++#! ++#! Most preprocessors and rules were disabled to save memory. + #-------------------------------------------------- + + ################################################### +@@ -42,10 +49,12 @@ + ################################################### + + # Setup the network addresses you are protecting +-ipvar HOME_NET any ++#! ipvar HOME_NET any ++ipvar HOME_NET 192.168.1.0/24 + + # Set up the external network addresses. Leave as "any" in most situations +-ipvar EXTERNAL_NET any ++#! ipvar EXTERNAL_NET any ++ipvar EXTERNAL_NET !$HOME_NET + + # List of DNS servers on your network + ipvar DNS_SERVERS $HOME_NET +@@ -101,17 +110,23 @@ ipvar AIM_SERVERS [64.12.24.0/23,64.12.2 + # Path to your rules files (this can be a relative path) + # Note for Windows users: You are advised to make this an absolute path, + # such as: c:\snort\rules +-var RULE_PATH ../rules +-var SO_RULE_PATH ../so_rules +-var PREPROC_RULE_PATH ../preproc_rules ++#! Those paths are relative to this snort.conf file. ++#! var RULE_PATH ../rules ++#! var SO_RULE_PATH ../so_rules ++#! var PREPROC_RULE_PATH ../preproc_rules ++var RULE_PATH ./rules ++var SO_RULE_PATH ./so_rules ++var PREPROC_RULE_PATH ./preproc_rules + + # If you are using reputation preprocessor set these + # Currently there is a bug with relative paths, they are relative to where snort is + # not relative to snort.conf like the above variables + # This is completely inconsistent with how other vars work, BUG 89986 + # Set the absolute path appropriately +-var WHITE_LIST_PATH ../rules +-var BLACK_LIST_PATH ../rules ++#! var WHITE_LIST_PATH ../rules ++#! var BLACK_LIST_PATH ../rules ++var WHITE_LIST_PATH ./rules ++var BLACK_LIST_PATH ./rules + + ################################################### + # Step #2: Configure the decoder. For more information, see README.decode +@@ -244,13 +259,16 @@ config paf_max: 16000 + ################################################### + + # path to dynamic preprocessor libraries +-dynamicpreprocessor directory /usr/local/lib/snort_dynamicpreprocessor/ ++#! dynamicpreprocessor directory /usr/local/lib/snort_dynamicpreprocessor/ ++dynamicpreprocessor directory /usr/lib/snort_dynamicpreprocessor/ + + # path to base preprocessor engine +-dynamicengine /usr/local/lib/snort_dynamicengine/libsf_engine.so ++#! dynamicengine /usr/local/lib/snort_dynamicengine/libsf_engine.so ++#! dynamicengine /usr/lib/snort_dynamicengine/libsf_engine.so #! disabled for performance reasons + + # path to dynamic rules libraries +-dynamicdetection directory /usr/local/lib/snort_dynamicrules ++#! dynamicdetection directory /usr/local/lib/snort_dynamicrules ++#! dynamicdetection directory /usr/lib/snort_dynamicrules #! disabled for performance reasons + + ################################################### + # Step #5: Configure preprocessors +@@ -294,124 +312,128 @@ preprocessor stream5_udp: timeout 180 + # preprocessor perfmonitor: time 300 file /var/snort/snort.stats pktcnt 10000 + + # HTTP normalization and anomaly detection. For more information, see README.http_inspect +-preprocessor http_inspect: global iis_unicode_map unicode.map 1252 compress_depth 65535 decompress_depth 65535 +-preprocessor http_inspect_server: server default \ +- http_methods { GET POST PUT SEARCH MKCOL COPY MOVE LOCK UNLOCK NOTIFY POLL BCOPY BDELETE BMOVE LINK UNLINK OPTIONS HEAD DELETE TRACE TRACK CONNECT SOURCE SUBSCRIBE UNSUBSCRIBE PROPFIND PROPPATCH BPROPFIND BPROPPATCH RPC_CONNECT PROXY_SUCCESS BITS_POST CCM_POST SMS_POST RPC_IN_DATA RPC_OUT_DATA RPC_ECHO_DATA } \ +- chunk_length 500000 \ +- server_flow_depth 0 \ +- client_flow_depth 0 \ +- post_depth 65495 \ +- oversize_dir_length 500 \ +- max_header_length 750 \ +- max_headers 100 \ +- max_spaces 0 \ +- small_chunk_length { 10 5 } \ +- ports { 80 81 311 591 593 901 1220 1414 1830 2301 2381 2809 3128 3702 4343 5250 7001 7145 7510 7777 7779 8000 8008 8014 8028 8080 8088 8118 8123 8180 8181 8243 8280 8800 8888 8899 9080 9090 9091 9443 9999 11371 55555 } \ +- non_rfc_char { 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 } \ +- enable_cookie \ +- extended_response_inspection \ +- inspect_gzip \ +- normalize_utf \ +- unlimited_decompress \ +- normalize_javascript \ +- apache_whitespace no \ +- ascii no \ +- bare_byte no \ +- directory no \ +- double_decode no \ +- iis_backslash no \ +- iis_delimiter no \ +- iis_unicode no \ +- multi_slash no \ +- utf_8 no \ +- u_encode yes \ +- webroot no ++#! disabled for performance reasons: ++#! preprocessor http_inspect: global iis_unicode_map unicode.map 1252 compress_depth 65535 decompress_depth 65535 ++#! preprocessor http_inspect_server: server default \ ++#! http_methods { GET POST PUT SEARCH MKCOL COPY MOVE LOCK UNLOCK NOTIFY POLL BCOPY BDELETE BMOVE LINK UNLINK OPTIONS HEAD DELETE TRACE TRACK CONNECT SOURCE SUBSCRIBE UNSUBSCRIBE PROPFIND PROPPATCH BPROPFIND BPROPPATCH RPC_CONNECT PROXY_SUCCESS BITS_POST CCM_POST SMS_POST RPC_IN_DATA RPC_OUT_DATA RPC_ECHO_DATA } \ ++#! chunk_length 500000 \ ++#! server_flow_depth 0 \ ++#! client_flow_depth 0 \ ++#! post_depth 65495 \ ++#! oversize_dir_length 500 \ ++#! max_header_length 750 \ ++#! max_headers 100 \ ++#! max_spaces 0 \ ++#! small_chunk_length { 10 5 } \ ++#! ports { 80 81 311 591 593 901 1220 1414 1830 2301 2381 2809 3128 3702 4343 5250 7001 7145 7510 7777 7779 8000 8008 8014 8028 8080 8088 8118 8123 8180 8181 8243 8280 8800 8888 8899 9080 9090 9091 9443 9999 11371 55555 } \ ++#! non_rfc_char { 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 } \ ++#! enable_cookie \ ++#! extended_response_inspection \ ++#! inspect_gzip \ ++#! normalize_utf \ ++#! unlimited_decompress \ ++#! normalize_javascript \ ++#! apache_whitespace no \ ++#! ascii no \ ++#! bare_byte no \ ++#! directory no \ ++#! double_decode no \ ++#! iis_backslash no \ ++#! iis_delimiter no \ ++#! iis_unicode no \ ++#! multi_slash no \ ++#! utf_8 no \ ++#! u_encode yes \ ++#! webroot no + + # ONC-RPC normalization and anomaly detection. For more information, see the Snort Manual, Configuring Snort - Preprocessors - RPC Decode +-preprocessor rpc_decode: 111 32770 32771 32772 32773 32774 32775 32776 32777 32778 32779 no_alert_multiple_requests no_alert_large_fragments no_alert_incomplete ++#! disabled for performance reasons: ++#! preprocessor rpc_decode: 111 32770 32771 32772 32773 32774 32775 32776 32777 32778 32779 no_alert_multiple_requests no_alert_large_fragments no_alert_incomplete + + # Back Orifice detection. +-preprocessor bo ++#! preprocessor bo #! disabled for performance reasons + + # FTP / Telnet normalization and anomaly detection. For more information, see README.ftptelnet +-preprocessor ftp_telnet: global inspection_type stateful encrypted_traffic no +-preprocessor ftp_telnet_protocol: telnet \ +- ayt_attack_thresh 20 \ +- normalize ports { 23 } \ +- detect_anomalies +-preprocessor ftp_telnet_protocol: ftp server default \ +- def_max_param_len 100 \ +- ports { 21 2100 3535 } \ +- telnet_cmds yes \ +- ignore_telnet_erase_cmds yes \ +- ftp_cmds { ABOR ACCT ADAT ALLO APPE AUTH CCC CDUP } \ +- ftp_cmds { CEL CLNT CMD CONF CWD DELE ENC EPRT } \ +- ftp_cmds { EPSV ESTA ESTP FEAT HELP LANG LIST LPRT } \ +- ftp_cmds { LPSV MACB MAIL MDTM MIC MKD MLSD MLST } \ +- ftp_cmds { MODE NLST NOOP OPTS PASS PASV PBSZ PORT } \ +- ftp_cmds { PROT PWD QUIT REIN REST RETR RMD RNFR } \ +- ftp_cmds { RNTO SDUP SITE SIZE SMNT STAT STOR STOU } \ +- ftp_cmds { STRU SYST TEST TYPE USER XCUP XCRC XCWD } \ +- ftp_cmds { XMAS XMD5 XMKD XPWD XRCP XRMD XRSQ XSEM } \ +- ftp_cmds { XSEN XSHA1 XSHA256 } \ +- alt_max_param_len 0 { ABOR CCC CDUP ESTA FEAT LPSV NOOP PASV PWD QUIT REIN STOU SYST XCUP XPWD } \ +- alt_max_param_len 200 { ALLO APPE CMD HELP NLST RETR RNFR STOR STOU XMKD } \ +- alt_max_param_len 256 { CWD RNTO } \ +- alt_max_param_len 400 { PORT } \ +- alt_max_param_len 512 { SIZE } \ +- chk_str_fmt { ACCT ADAT ALLO APPE AUTH CEL CLNT CMD } \ +- chk_str_fmt { CONF CWD DELE ENC EPRT EPSV ESTP HELP } \ +- chk_str_fmt { LANG LIST LPRT MACB MAIL MDTM MIC MKD } \ +- chk_str_fmt { MLSD MLST MODE NLST OPTS PASS PBSZ PORT } \ +- chk_str_fmt { PROT REST RETR RMD RNFR RNTO SDUP SITE } \ +- chk_str_fmt { SIZE SMNT STAT STOR STRU TEST TYPE USER } \ +- chk_str_fmt { XCRC XCWD XMAS XMD5 XMKD XRCP XRMD XRSQ } \ +- chk_str_fmt { XSEM XSEN XSHA1 XSHA256 } \ +- cmd_validity ALLO < int [ char R int ] > \ +- cmd_validity EPSV < [ { char 12 | char A char L char L } ] > \ +- cmd_validity MACB < string > \ +- cmd_validity MDTM < [ date nnnnnnnnnnnnnn[.n[n[n]]] ] string > \ +- cmd_validity MODE < char ASBCZ > \ +- cmd_validity PORT < host_port > \ +- cmd_validity PROT < char CSEP > \ +- cmd_validity STRU < char FRPO [ string ] > \ +- cmd_validity TYPE < { char AE [ char NTC ] | char I | char L [ number ] } > +-preprocessor ftp_telnet_protocol: ftp client default \ +- max_resp_len 256 \ +- bounce yes \ +- ignore_telnet_erase_cmds yes \ +- telnet_cmds yes ++#! disabled for performance reasons: ++#! preprocessor ftp_telnet: global inspection_type stateful encrypted_traffic no check_encrypted ++#! preprocessor ftp_telnet_protocol: telnet \ ++#! ayt_attack_thresh 20 \ ++#! normalize ports { 23 } \ ++#! detect_anomalies ++#! preprocessor ftp_telnet_protocol: ftp server default \ ++#! def_max_param_len 100 \ ++#! ports { 21 2100 3535 } \ ++#! telnet_cmds yes \ ++#! ignore_telnet_erase_cmds yes \ ++#! ftp_cmds { ABOR ACCT ADAT ALLO APPE AUTH CCC CDUP } \ ++#! ftp_cmds { CEL CLNT CMD CONF CWD DELE ENC EPRT } \ ++#! ftp_cmds { EPSV ESTA ESTP FEAT HELP LANG LIST LPRT } \ ++#! ftp_cmds { LPSV MACB MAIL MDTM MIC MKD MLSD MLST } \ ++#! ftp_cmds { MODE NLST NOOP OPTS PASS PASV PBSZ PORT } \ ++#! ftp_cmds { PROT PWD QUIT REIN REST RETR RMD RNFR } \ ++#! ftp_cmds { RNTO SDUP SITE SIZE SMNT STAT STOR STOU } \ ++#! ftp_cmds { STRU SYST TEST TYPE USER XCUP XCRC XCWD } \ ++#! ftp_cmds { XMAS XMD5 XMKD XPWD XRCP XRMD XRSQ XSEM } \ ++#! ftp_cmds { XSEN XSHA1 XSHA256 } \ ++#! alt_max_param_len 0 { ABOR CCC CDUP ESTA FEAT LPSV NOOP PASV PWD QUIT REIN STOU SYST XCUP XPWD } \ ++#! alt_max_param_len 200 { ALLO APPE CMD HELP NLST RETR RNFR STOR STOU XMKD } \ ++#! alt_max_param_len 256 { CWD RNTO } \ ++#! alt_max_param_len 400 { PORT } \ ++#! alt_max_param_len 512 { SIZE } \ ++#! chk_str_fmt { ACCT ADAT ALLO APPE AUTH CEL CLNT CMD } \ ++#! chk_str_fmt { CONF CWD DELE ENC EPRT EPSV ESTP HELP } \ ++#! chk_str_fmt { LANG LIST LPRT MACB MAIL MDTM MIC MKD } \ ++#! chk_str_fmt { MLSD MLST MODE NLST OPTS PASS PBSZ PORT } \ ++#! chk_str_fmt { PROT REST RETR RMD RNFR RNTO SDUP SITE } \ ++#! chk_str_fmt { SIZE SMNT STAT STOR STRU TEST TYPE USER } \ ++#! chk_str_fmt { XCRC XCWD XMAS XMD5 XMKD XRCP XRMD XRSQ } \ ++#! chk_str_fmt { XSEM XSEN XSHA1 XSHA256 } \ ++#! cmd_validity ALLO < int [ char R int ] > \ ++#! cmd_validity EPSV < [ { char 12 | char A char L char L } ] > \ ++#! cmd_validity MACB < string > \ ++#! cmd_validity MDTM < [ date nnnnnnnnnnnnnn[.n[n[n]]] ] string > \ ++#! cmd_validity MODE < char ASBCZ > \ ++#! cmd_validity PORT < host_port > \ ++#! cmd_validity PROT < char CSEP > \ ++#! cmd_validity STRU < char FRPO [ string ] > \ ++#! cmd_validity TYPE < { char AE [ char NTC ] | char I | char L [ number ] } > ++#! preprocessor ftp_telnet_protocol: ftp client default \ ++#! max_resp_len 256 \ ++#! bounce yes \ ++#! ignore_telnet_erase_cmds yes \ ++#! telnet_cmds yes + + + # SMTP normalization and anomaly detection. For more information, see README.SMTP +-preprocessor smtp: ports { 25 465 587 691 } \ +- inspection_type stateful \ +- b64_decode_depth 0 \ +- qp_decode_depth 0 \ +- bitenc_decode_depth 0 \ +- uu_decode_depth 0 \ +- log_mailfrom \ +- log_rcptto \ +- log_filename \ +- log_email_hdrs \ +- normalize cmds \ +- normalize_cmds { ATRN AUTH BDAT CHUNKING DATA DEBUG EHLO EMAL ESAM ESND ESOM ETRN EVFY } \ +- normalize_cmds { EXPN HELO HELP IDENT MAIL NOOP ONEX QUEU QUIT RCPT RSET SAML SEND SOML } \ +- normalize_cmds { STARTTLS TICK TIME TURN TURNME VERB VRFY X-ADAT X-DRCP X-ERCP X-EXCH50 } \ +- normalize_cmds { X-EXPS X-LINK2STATE XADR XAUTH XCIR XEXCH50 XGEN XLICENSE XQUE XSTA XTRN XUSR } \ +- max_command_line_len 512 \ +- max_header_line_len 1000 \ +- max_response_line_len 512 \ +- alt_max_command_line_len 260 { MAIL } \ +- alt_max_command_line_len 300 { RCPT } \ +- alt_max_command_line_len 500 { HELP HELO ETRN EHLO } \ +- alt_max_command_line_len 255 { EXPN VRFY ATRN SIZE BDAT DEBUG EMAL ESAM ESND ESOM EVFY IDENT NOOP RSET } \ +- alt_max_command_line_len 246 { SEND SAML SOML AUTH TURN ETRN DATA RSET QUIT ONEX QUEU STARTTLS TICK TIME TURNME VERB X-EXPS X-LINK2STATE XADR XAUTH XCIR XEXCH50 XGEN XLICENSE XQUE XSTA XTRN XUSR } \ +- valid_cmds { ATRN AUTH BDAT CHUNKING DATA DEBUG EHLO EMAL ESAM ESND ESOM ETRN EVFY } \ +- valid_cmds { EXPN HELO HELP IDENT MAIL NOOP ONEX QUEU QUIT RCPT RSET SAML SEND SOML } \ +- valid_cmds { STARTTLS TICK TIME TURN TURNME VERB VRFY X-ADAT X-DRCP X-ERCP X-EXCH50 } \ +- valid_cmds { X-EXPS X-LINK2STATE XADR XAUTH XCIR XEXCH50 XGEN XLICENSE XQUE XSTA XTRN XUSR } \ +- xlink2state { enabled } ++#! disabled for performance reasons: ++#! preprocessor smtp: ports { 25 465 587 691 } \ ++#! inspection_type stateful \ ++#! b64_decode_depth 0 \ ++#! qp_decode_depth 0 \ ++#! bitenc_decode_depth 0 \ ++#! uu_decode_depth 0 \ ++#! log_mailfrom \ ++#! log_rcptto \ ++#! log_filename \ ++#! log_email_hdrs \ ++#! normalize cmds \ ++#! normalize_cmds { ATRN AUTH BDAT CHUNKING DATA DEBUG EHLO EMAL ESAM ESND ESOM ETRN EVFY } \ ++#! normalize_cmds { EXPN HELO HELP IDENT MAIL NOOP ONEX QUEU QUIT RCPT RSET SAML SEND SOML } \ ++#! normalize_cmds { STARTTLS TICK TIME TURN TURNME VERB VRFY X-ADAT X-DRCP X-ERCP X-EXCH50 } \ ++#! normalize_cmds { X-EXPS X-LINK2STATE XADR XAUTH XCIR XEXCH50 XGEN XLICENSE XQUE XSTA XTRN XUSR } \ ++#! max_command_line_len 512 \ ++#! max_header_line_len 1000 \ ++#! max_response_line_len 512 \ ++#! alt_max_command_line_len 260 { MAIL } \ ++#! alt_max_command_line_len 300 { RCPT } \ ++#! alt_max_command_line_len 500 { HELP HELO ETRN EHLO } \ ++#! alt_max_command_line_len 255 { EXPN VRFY ATRN SIZE BDAT DEBUG EMAL ESAM ESND ESOM EVFY IDENT NOOP RSET } \ ++#! alt_max_command_line_len 246 { SEND SAML SOML AUTH TURN ETRN DATA RSET QUIT ONEX QUEU STARTTLS TICK TIME TURNME VERB X-EXPS X-LINK2STATE XADR XAUTH XCIR XEXCH50 XGEN XLICENSE XQUE XSTA XTRN XUSR } \ ++#! valid_cmds { ATRN AUTH BDAT CHUNKING DATA DEBUG EHLO EMAL ESAM ESND ESOM ETRN EVFY } \ ++#! valid_cmds { EXPN HELO HELP IDENT MAIL NOOP ONEX QUEU QUIT RCPT RSET SAML SEND SOML } \ ++#! valid_cmds { STARTTLS TICK TIME TURN TURNME VERB VRFY X-ADAT X-DRCP X-ERCP X-EXCH50 } \ ++#! valid_cmds { X-EXPS X-LINK2STATE XADR XAUTH XCIR XEXCH50 XGEN XLICENSE XQUE XSTA XTRN XUSR } \ ++#! xlink2state { enabled } + + # Portscan detection. For more information, see README.sfportscan + # preprocessor sfportscan: proto { all } memcap { 10000000 } sense_level { low } +@@ -430,17 +452,19 @@ preprocessor ssh: server_ports { 22 } \ + enable_srvoverflow enable_protomismatch + + # SMB / DCE-RPC normalization and anomaly detection. For more information, see README.dcerpc2 +-preprocessor dcerpc2: memcap 102400, events [co ] +-preprocessor dcerpc2_server: default, policy WinXP, \ +- detect [smb [139,445], tcp 135, udp 135, rpc-over-http-server 593], \ +- autodetect [tcp 1025:, udp 1025:, rpc-over-http-server 1025:], \ +- smb_max_chain 3, smb_invalid_shares ["C$", "D$", "ADMIN$"] ++#! disabled for performance reasons: ++#! preprocessor dcerpc2: memcap 102400, events [co ] ++#! preprocessor dcerpc2_server: default, policy WinXP, \ ++#! detect [smb [139,445], tcp 135, udp 135, rpc-over-http-server 593], \ ++#! autodetect [tcp 1025:, udp 1025:, rpc-over-http-server 1025:], \ ++#! smb_max_chain 3, smb_invalid_shares ["C$", "D$", "ADMIN$"] + + # DNS anomaly detection. For more information, see README.dns +-preprocessor dns: ports { 53 } enable_rdata_overflow ++#! preprocessor dns: ports { 53 } enable_rdata_overflow #! disabled for performance reasons + + # SSL anomaly detection and traffic bypass. For more information, see README.ssl +-preprocessor ssl: ports { 443 465 563 636 989 992 993 994 995 7801 7802 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 }, trustservers, noinspect_encrypted ++#! disabled for performance reasons: ++#! preprocessor ssl: ports { 443 465 563 636 989 992 993 994 995 7801 7802 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 }, trustservers, noinspect_encrypted + + # SDF sensitive data preprocessor. For more information see README.sensitive_data + preprocessor sensitive_data: alert_threshold 25 +@@ -503,12 +527,13 @@ preprocessor dnp3: ports { 20000 } \ + check_crc + + # Reputation preprocessor. For more information see README.reputation +-preprocessor reputation: \ +- memcap 500, \ +- priority whitelist, \ +- nested_ip inner, \ +- whitelist $WHITE_LIST_PATH/white_list.rules, \ +- blacklist $BLACK_LIST_PATH/black_list.rules ++#! disabled for performance reasons: ++#! preprocessor reputation: \ ++#! memcap 500, \ ++#! priority whitelist, \ ++#! nested_ip inner, \ ++#! whitelist $WHITE_LIST_PATH/white_list.rules, \ ++#! blacklist $BLACK_LIST_PATH/black_list.rules + + ################################################### + # Step #6: Configure output plugins +@@ -551,60 +576,71 @@ include reference.config + # site specific rules + include $RULE_PATH/local.rules + +-include $RULE_PATH/attack-responses.rules +-include $RULE_PATH/backdoor.rules +-include $RULE_PATH/bad-traffic.rules +-include $RULE_PATH/blacklist.rules +-include $RULE_PATH/botnet-cnc.rules +-include $RULE_PATH/chat.rules +-include $RULE_PATH/content-replace.rules +-include $RULE_PATH/ddos.rules +-include $RULE_PATH/dns.rules +-include $RULE_PATH/dos.rules +-include $RULE_PATH/exploit.rules +-include $RULE_PATH/file-identify.rules +-include $RULE_PATH/finger.rules +-include $RULE_PATH/ftp.rules +-include $RULE_PATH/icmp.rules +-include $RULE_PATH/icmp-info.rules +-include $RULE_PATH/imap.rules +-include $RULE_PATH/info.rules +-include $RULE_PATH/misc.rules +-include $RULE_PATH/multimedia.rules +-include $RULE_PATH/mysql.rules +-include $RULE_PATH/netbios.rules +-include $RULE_PATH/nntp.rules +-include $RULE_PATH/oracle.rules +-include $RULE_PATH/other-ids.rules +-include $RULE_PATH/p2p.rules +-include $RULE_PATH/phishing-spam.rules +-include $RULE_PATH/policy.rules +-include $RULE_PATH/pop2.rules +-include $RULE_PATH/pop3.rules +-include $RULE_PATH/rpc.rules +-include $RULE_PATH/rservices.rules +-include $RULE_PATH/scada.rules +-include $RULE_PATH/scan.rules +-include $RULE_PATH/shellcode.rules +-include $RULE_PATH/smtp.rules +-include $RULE_PATH/snmp.rules +-include $RULE_PATH/specific-threats.rules +-include $RULE_PATH/spyware-put.rules +-include $RULE_PATH/sql.rules +-include $RULE_PATH/telnet.rules +-include $RULE_PATH/tftp.rules +-include $RULE_PATH/virus.rules +-include $RULE_PATH/voip.rules +-include $RULE_PATH/web-activex.rules +-include $RULE_PATH/web-attacks.rules +-include $RULE_PATH/web-cgi.rules +-include $RULE_PATH/web-client.rules +-include $RULE_PATH/web-coldfusion.rules +-include $RULE_PATH/web-frontpage.rules +-include $RULE_PATH/web-iis.rules +-include $RULE_PATH/web-misc.rules +-include $RULE_PATH/web-php.rules +-include $RULE_PATH/x11.rules ++#! include $RULE_PATH/attack-responses.rules ++#! include $RULE_PATH/backdoor.rules ++#! include $RULE_PATH/bad-traffic.rules ++#! include $RULE_PATH/blacklist.rules ++#! include $RULE_PATH/botnet-cnc.rules ++#! include $RULE_PATH/chat.rules ++#! include $RULE_PATH/content-replace.rules ++#! include $RULE_PATH/ddos.rules ++#! include $RULE_PATH/dns.rules ++#! include $RULE_PATH/dos.rules ++#! include $RULE_PATH/exploit.rules ++#! include $RULE_PATH/file-identify.rules ++#! include $RULE_PATH/file-office.rules ++#! include $RULE_PATH/file-other.rules ++#! include $RULE_PATH/file-pdf.rules ++#! include $RULE_PATH/finger.rules ++#! include $RULE_PATH/ftp.rules ++#! include $RULE_PATH/icmp.rules ++#! include $RULE_PATH/icmp-info.rules ++#! include $RULE_PATH/imap.rules ++#! include $RULE_PATH/indicator-compromise.rules ++#! include $RULE_PATH/indicator-obfuscation.rules ++#! include $RULE_PATH/info.rules ++#! include $RULE_PATH/misc.rules ++#! include $RULE_PATH/multimedia.rules ++#! include $RULE_PATH/mysql.rules ++#! include $RULE_PATH/netbios.rules ++#! include $RULE_PATH/nntp.rules ++#! include $RULE_PATH/oracle.rules ++#! include $RULE_PATH/other-ids.rules ++#! include $RULE_PATH/p2p.rules ++#! include $RULE_PATH/phishing-spam.rules ++#! include $RULE_PATH/policy.rules ++#! include $RULE_PATH/policy-multimedia.rules ++#! include $RULE_PATH/policy-other.rules ++#! include $RULE_PATH/policy-social.rules ++#! include $RULE_PATH/pop2.rules ++#! include $RULE_PATH/pop3.rules ++#! include $RULE_PATH/pua-p2p.rules ++#! include $RULE_PATH/pua-toolbars.rules ++#! include $RULE_PATH/rpc.rules ++#! include $RULE_PATH/rservices.rules ++#! include $RULE_PATH/scada.rules ++#! include $RULE_PATH/scan.rules ++#! include $RULE_PATH/server-mail.rules ++#! include $RULE_PATH/shellcode.rules ++#! include $RULE_PATH/smtp.rules ++#! include $RULE_PATH/snmp.rules ++#! include $RULE_PATH/specific-threats.rules ++#! include $RULE_PATH/spyware-put.rules ++#! include $RULE_PATH/sql.rules ++#! include $RULE_PATH/telnet.rules ++#! include $RULE_PATH/tftp.rules ++#! include $RULE_PATH/virus.rules ++#! include $RULE_PATH/voip.rules ++#! include $RULE_PATH/web-activex.rules ++#! include $RULE_PATH/web-attacks.rules ++#! include $RULE_PATH/web-cgi.rules ++#! include $RULE_PATH/web-client.rules ++#! include $RULE_PATH/web-coldfusion.rules ++#! include $RULE_PATH/web-frontpage.rules ++#! include $RULE_PATH/web-iis.rules ++#! include $RULE_PATH/web-misc.rules ++#! include $RULE_PATH/web-php.rules ++#! include $RULE_PATH/x11.rules + + ################################################### + # Step #8: Customize your preprocessor and decoder alerts diff --git a/net/snort/patches/160-mysql_cross_compiling_checks.patch b/net/snort/patches/160-mysql_cross_compiling_checks.patch new file mode 100644 index 0000000..4ad5355 --- /dev/null +++ b/net/snort/patches/160-mysql_cross_compiling_checks.patch @@ -0,0 +1,66 @@ +--- a/configure.in ++++ b/configure.in +@@ -1128,63 +1128,6 @@ if test "x$with_mysql" != "xno"; then + fi + fi + +- AC_MSG_CHECKING([for mysql default client reconnect]) +- +- AC_RUN_IFELSE( +- [AC_LANG_PROGRAM( +- [[ +- #include +- ]], +- [[ +- if (mysql_get_client_version() < 50003) +- return 1; +- ]])], +- [mysql_default_reconnect="no"], +- [mysql_default_reconnect="yes"]) +- +- AC_MSG_RESULT($mysql_default_reconnect) +- +- if test "x$mysql_default_reconnect" = "xno"; then +- AC_MSG_CHECKING([for mysql reconnect option]) +- +- AC_RUN_IFELSE( +- [AC_LANG_PROGRAM( +- [[ +- #include +- ]], +- [[ +- if (mysql_get_client_version() < 50013) +- return 1; +- ]])], +- [mysql_has_reconnect="yes"], +- [mysql_has_reconnect="no"]) +- +- AC_MSG_RESULT($mysql_has_reconnect) +- +- if test "x$mysql_has_reconnect" = "xyes"; then +- AC_DEFINE([MYSQL_HAS_OPT_RECONNECT],[1],[For MySQL versions 5.0.13 and greater]) +- +- AC_MSG_CHECKING([for mysql setting of reconnect option before connect bug]) +- +- AC_RUN_IFELSE( +- [AC_LANG_PROGRAM( +- [[ +- #include +- ]], +- [[ +- if (mysql_get_client_version() < 50019) +- return 1; +- ]])], +- [mysql_has_reconnect_bug="no"], +- [mysql_has_reconnect_bug="yes"]) +- +- AC_MSG_RESULT($mysql_has_reconnect_bug) +- +- if test "x$mysql_has_reconnect_bug" = "xyes"; then +- AC_DEFINE([MYSQL_HAS_OPT_RECONNECT_BUG],[1],[For MySQL versions 5.0.13 to 5.0.18]) +- fi +- fi +- fi + fi + + AC_ARG_WITH(odbc, diff --git a/net/snort/patches/200-snortsam.patch b/net/snort/patches/200-snortsam.patch new file mode 100644 index 0000000..d767d86 --- /dev/null +++ b/net/snort/patches/200-snortsam.patch @@ -0,0 +1,3016 @@ +diff -ruN snort-2.9.2.2/autojunk.sh snort-2.9.2.2_bkup/autojunk.sh +--- snort-2.9.2.2/autojunk.sh 1969-12-31 16:00:00.000000000 -0800 ++++ snort-2.9.2.2_bkup/autojunk.sh 2012-04-08 20:34:57.385687022 -0700 +@@ -0,0 +1,7 @@ ++#!/bin/sh ++# the list of commands that need to run before we do a compile ++libtoolize --automake --copy ++aclocal -I m4 ++autoheader ++automake --add-missing --copy ++autoconf +diff -ruN snort-2.9.2.2/etc/snort.conf snort-2.9.2.2_bkup/etc/snort.conf +--- snort-2.9.2.2/etc/snort.conf 2012-03-19 15:57:09.000000000 -0700 ++++ snort-2.9.2.2_bkup/etc/snort.conf 2012-04-08 20:34:57.385687022 -0700 +@@ -536,11 +536,38 @@ + # prelude + # output alert_prelude + ++################################################### ++# snortsam ++################################################### ++# In order to cause Snort to send a blocking request to the SnortSam agent, ++# that agent has to be listed, including the port it listens on, ++# and the encryption key it is using. The statement for that is: ++# ++# output alert_fwsam: {SnortSam Station}:{port}/{password} ++# ++# {SnortSam Station}: IP address or host name of the host where SnortSam is running. ++# {port}: The port the remote SnortSam agent listens on. ++# {password}: The password, or key, used for encryption of the ++# communication to the remote agent. ++# ++# At the very least, the IP address or host name of the host running SnortSam ++# needs to be specified. If the port is omitted, it defaults to TCP port 898. ++# If the password is omitted, it defaults to a preset password. ++# (In which case it needs to be omitted on the SnortSam agent as well) ++# ++# More than one host can be specified, but has to be done on the same line. ++# Just separate them with one or more spaces. ++# ++# Examples: ++# ++# output alert_fwsam: firewall/idspassword ++# output alert_fwsam: fw1.domain.tld:898/mykey ++# output alert_fwsam: 192.168.0.1/borderfw 192.168.1.254/wanfw ++ + # metadata reference data. do not modify these lines + include classification.config + include reference.config + +- + ################################################### + # Step #7: Customize your rule set + # For more information, see Snort Manual, Writing Snort Rules +diff -ruN snort-2.9.2.2/src/fatal.h snort-2.9.2.2_bkup/src/fatal.h +--- snort-2.9.2.2/src/fatal.h 1969-12-31 16:00:00.000000000 -0800 ++++ snort-2.9.2.2_bkup/src/fatal.h 2012-04-08 20:34:57.385687022 -0700 +@@ -0,0 +1,40 @@ ++/* $Id$ */ ++/* ++** Copyright (C) 2002-2008 Sourcefire, Inc. ++** Copyright (C) 1998-2002 Martin Roesch ++** ++** 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. You may not use, modify or ++** distribute this program under any other version of the GNU General ++** Public License. ++** ++** This program is distributed in the hope that it will be useful, ++** but WITHOUT ANY WARRANTY; without even the implied warranty of ++** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++** GNU General Public License for more details. ++** ++** You should have received a copy of the GNU General Public License ++** along with this program; if not, write to the Free Software ++** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++*/ ++ ++#ifndef __FATAL_H__ ++#define __FATAL_H__ ++ ++ ++/* ++ * in debugging mode print out the filename and the line number where the ++ * failure have occured ++ */ ++ ++ ++#ifdef DEBUG ++ #define FATAL(msg) { printf("%s:%d: ", __FILE__, __LINE__); FatalError( (char *) msg); } ++#else ++ #define FATAL(msg) FatalError( (char *) msg) ++#endif ++ ++ ++ ++#endif /* __FATAL_H__ */ +diff -ruN snort-2.9.2.2/src/Makefile.am snort-2.9.2.2_bkup/src/Makefile.am +--- snort-2.9.2.2/src/Makefile.am 2011-10-26 11:28:52.000000000 -0700 ++++ snort-2.9.2.2_bkup/src/Makefile.am 2012-04-08 20:34:57.385687022 -0700 +@@ -59,6 +59,7 @@ + rate_filter.c rate_filter.h \ + obfuscation.c obfuscation.h \ + rule_option_types.h \ ++twofish.c twofish.h \ + sfdaq.c sfdaq.h \ + idle_processing.c idle_processing.h idle_processing_funcs.h + +diff -ruN snort-2.9.2.2/src/output-plugins/Makefile.am snort-2.9.2.2_bkup/src/output-plugins/Makefile.am +--- snort-2.9.2.2/src/output-plugins/Makefile.am 2010-06-09 15:05:17.000000000 -0700 ++++ snort-2.9.2.2_bkup/src/output-plugins/Makefile.am 2012-04-08 20:34:57.385687022 -0700 +@@ -15,6 +15,7 @@ + spo_log_tcpdump.h spo_unified.c spo_unified2.c spo_unified.h spo_unified2.h \ + spo_log_ascii.c spo_log_ascii.h spo_alert_sf_socket.h spo_alert_sf_socket.c \ + $(PRELUDE_CODE) spo_alert_arubaaction.c spo_alert_arubaaction.h \ ++spo_alert_fwsam.c spo_alert_fwsam.h \ + spo_alert_test.c spo_alert_test.h + + INCLUDES = @INCLUDES@ +diff -ruN snort-2.9.2.2/src/output-plugins/spo_alert_fwsam.c snort-2.9.2.2_bkup/src/output-plugins/spo_alert_fwsam.c +--- snort-2.9.2.2/src/output-plugins/spo_alert_fwsam.c 1969-12-31 16:00:00.000000000 -0800 ++++ snort-2.9.2.2_bkup/src/output-plugins/spo_alert_fwsam.c 2012-04-08 23:40:57.676343063 -0700 +@@ -0,0 +1,1387 @@ ++/* $id: snortpatchb,v 1.2 2002/10/26 03:32:35 fknobbe Exp $ ++** ++** spo_alert_fwsam.c ++** ++** Copyright (c) 2001-2004 Frank Knobbe ++** ++** This program is free software; you can redistribute it and/or modify ++** it under the terms of the GNU General Public License as published by ++** the Free Software Foundation; either version 2 of the License, or ++** (at your option) any later version. ++** ++** This program is distributed in the hope that it will be useful, ++** but WITHOUT ANY WARRANTY; without even the implied warranty of ++** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++** GNU General Public License for more details. ++** ++** You should have received a copy of the GNU General Public License ++** along with this program; if not, write to the Free Software ++** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++*/ ++ ++/* ++ * Purpose: ++ * ++ * This module sends alerts to a remote service on a host running SnortSam ++ * (the agent) which will block the intruding IP address on a variety of ++ * host and network firewalls. ++ * ++ * SnortSam also performs checks against a white-list of never-to-be-blocked IP addresses, ++ * can override block durations (for example for known proxies), and can detect attack conditions ++ * where too many blocks are received within a defined interval. If an attack is detected ++ * it will unblock the last x blocks and wait for the attack to end. ++ * ++ * See the SnortSam documentation for more information. ++ * ++ * ++ * Output Plugin Parameters: ++ *************************** ++ * ++ * output alert_fwsam: :/ ++ * ++ * : The IP address or host name of the host running SnortSam. ++ * : The port the remote SnortSam service listens on (default 898). ++ * : The key used for authentication (encryption really) ++ * of the communication to the remote service. ++ * ++ * Examples: ++ * ++ * output alert_fwsam: snortsambox/idspassword ++ * output alert_fwsam: fw1.domain.tld:898/mykey ++ * output alert_fwsam: 192.168.0.1/borderfw 192.168.1.254/wanfw ++ * ++ * ++ * Rule Options: ++ *************** ++ * ++ * fwsam: who[how],time; ++ * ++ * who: src, source, dst, dest, destination ++ * IP address to be blocked according to snort rule (some rules ++ * are reversed, i.e. homenet -> any [and you want to block any]). ++ * src denotes IP to the left of -> and dst denotes IP to the right ++ * ++ * how: Optional. In, out, src, dest, either, both, this, conn, connection ++ * Tells FW-1 to block packets INcoming from host, OUTgoing to host, ++ * EITHERway, or only THIS connection (IP/Service pair). ++ * See 'fw sam' for more information. May be ignored by other plugins. ++ * ++ * time: Duration of block in seconds. (Accepts 'days', 'months', 'weeks', ++ * 'years', 'minutes', 'seconds', 'hours'. Alternatively, a value of ++ * 0, or the keyword PERManent, INFinite, or ALWAYS, will block the ++ * host permanently. Be careful with this! ++ * Tells FW-1 (and others) how long to inhibit packets from the host. ++ * ++ * Examples: ++ * ++ * fwsam: src[either],15min; ++ * or dst[in], 2 days 4 hours ++ * or src, 1 hour ++ * ++ * (default: src[either],5min) ++ * ++ * ++ * Effect: ++ * ++ * Alerts are sent to the remote SnortSam services on Firewall-1 Management Stations ++ * or other hosts running SnortSam (as required for Cisco Routers and PIX). ++ * The remote services will invoke the SAM configuration via the fw sam ++ * command line, or by sending a packet to the SAM port 18183, or by using the official ++ * OPSEC API calls, or by telnetting into Cisco routers or PIX firewalls. ++ * The communication over the network is encrypted using two-fish. ++ * (Implementation ripped from CryptCat by Farm9 with permission.) ++ * ++ * Future Plans: ++ * ++ * - Custom alert trigger per rule (x alerts in y secs) --> Seems to exist in Snort 1.9 now. ++ * - Enable/Allow tagged fwsam: arguments to provide different values to ++ * different stations. --> Seems to be accomplished with custom rule-types ++ * ++ * ++ * Comments: ++ * ++ * It seem that above wishes can be implemented with todays setup. Feedback concerning ++ * these is greatly appreciated. ++ * ++*/ ++ ++ ++#include "spo_alert_fwsam.h" ++#include "twofish.h" ++/* external globals from rules.c */ ++extern char *file_name; ++extern int file_line; ++extern OptTreeNode *otn_tmp; ++extern char *snort_conf_dir; /* extern PV pv; */ ++ ++ ++/* my globals */ ++ ++FWsamList *FWsamStationList=NULL; /* Global (for all alert-types) list of snortsam stations */ ++FWsamOptions *FWsamOptionField=NULL; ++unsigned long FWsamMaxOptions=0; ++ ++ ++/* ++ * Function: AlertFWsamSetup() ++ * ++ * Purpose: Registers the output plugin keyword and initialization ++ * function into the output plugin list. This is the function that ++ * gets called from InitOutputPlugins() in plugbase.c. ++ * It also registers itself as a plugin in order to parse every rule ++ * and to set the appropiate flags from fwsam: option. ++ * ++ * Arguments: None. ++ * ++ * Returns: void function ++ * ++*/ ++void AlertFWsamSetup(void) ++{ ++ /* link the preprocessor keyword to the init function in the preproc list */ ++ RegisterOutputPlugin("alert_fwsam", OUTPUT_TYPE_FLAG__ALERT, AlertFWsamInit); ++ RegisterRuleOption("fwsam", AlertFWsamOptionInit, NULL, OPT_TYPE_ACTION, NULL); ++ ++#ifdef FWSAMDEBUG /* This allows debugging of fwsam only */ ++ LogMessage("DEBUG => [Alert_FWsam](AlertFWsamSetup) Output plugin is plugged in...\n"); ++#endif ++} ++ ++ ++/* This function checks if a given snortsam station is already in ++ * a given list. ++*/ ++int FWsamStationExists(FWsamStation *who,FWsamList *list) ++{ ++ while(list) ++ { ++ if(list->station) { ++// if( who->stationip.s_addr==list->station->stationip.s_addr && ++ if(IP_EQUALITY(&who->stationip, &list->station->stationip) && ++ who->stationport==list->station->stationport) ++ return TRUE; ++ } ++ list=list->next; ++ } ++ return FALSE; ++} ++ ++/* ++ * Function: AlertFWsamInit(char *args) ++ * ++ * Purpose: Calls the argument parsing function, performs final setup on data ++ * structs, links the preproc function into the function list. ++ * ++ * Arguments: args => ptr to argument string ++ * ++ * Returns: void function ++ * ++*/ ++void AlertFWsamInit(char *args) ++{ char *ap; ++ unsigned long statip,cnt,again,i; ++ char *stathost,*statport,*statpass; ++ FWsamStation *station; ++ FWsamList *fwsamlist=NULL; /* alert-type dependent list of snortsam stations */ ++ FWsamList *listp,*newlistp; ++ struct hostent *hoste; ++ char buf[1024]=""; ++ FILE *fp; ++ FWsamOptions tempopt; ++ ++#ifdef FWSAMDEBUG ++ unsigned long hostcnt=0; ++ ++ ++ ++ LogMessage("DEBUG => [Alert_FWsam](AlertFWsamInit) Output plugin initializing...\n"); ++#endif ++ ++ /* pv.alert_plugin_active = 1; */ ++ ++ /* parse the argument list from the rules file */ ++ ++ if(args == NULL) ++ FatalError("ERROR %s (%d) => [Alert_FWsam](AlertFWsamInit) No arguments to alert_fwsam preprocessor!\n", file_name, file_line); ++ ++ if(!FWsamOptionField && !FWsamMaxOptions) ++ { strncpy(buf,snort_conf_dir,sizeof(buf)-1); ++ strncpy(buf+strlen(buf),SID_MAPFILE,sizeof(buf)-strlen(buf)-1); ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam](AlertFWsamSetup) Using file: %s\n",buf); ++#endif ++ fp=fopen(buf,"rt"); ++ if(!fp) ++ { strncpy(buf,snort_conf_dir,sizeof(buf)-1); ++ strncpy(buf+strlen(buf),SID_ALT_MAPFILE,sizeof(buf)-strlen(buf)-1); ++ fp=fopen(buf,"rt"); ++ } ++ if(fp) /* Check for presence of map file and read those in, sorted. */ ++ { LogMessage("INFO => [Alert_FWsam](AlertFWsamSetup) Using sid-map file: %s\n",buf); ++ ++ while(FWsamReadLine(buf,sizeof(buf),fp)) ++ if(*buf) ++ FWsamMaxOptions++; ++ if(FWsamMaxOptions) ++ { if((FWsamOptionField=(FWsamOptions *)malloc(sizeof(FWsamOptions)*FWsamMaxOptions))==NULL) ++ FatalError("ERROR => [Alert_FWsam](AlertFWsamSetup) malloc failed for OptionField!\n"); ++ fseek(fp,0,SEEK_SET); ++ for(cnt=0;cnt1) ++ { for(again=TRUE,cnt=FWsamMaxOptions-1;cnt>=1 && again;cnt--) ++ { for(again=FALSE,i=0;iFWsamOptionField[i+1].sid) ++ { memcpy(&tempopt,&(FWsamOptionField[i]),sizeof(FWsamOptions)); ++ memcpy(&(FWsamOptionField[i]),&(FWsamOptionField[i+1]),sizeof(FWsamOptions)); ++ memcpy(&(FWsamOptionField[i+1]),&tempopt,sizeof(FWsamOptions)); ++ again=TRUE; ++ } ++ } ++ } ++ } ++ } ++ else ++ FWsamMaxOptions=1; ++ fclose(fp); ++ } ++ else ++ FWsamMaxOptions=1; ++ } ++ ++ ++ ap=args; /* start at the beginning of the argument */ ++ while(*ap && isspace(*ap)) ap++; ++ while(*ap) ++ { stathost=ap; /* first argument should be host */ ++ statport=NULL; ++ statpass=NULL; ++ while(*ap && *ap!=':' && *ap!='/' && !isspace(*ap)) ap++; /* find token */ ++ switch(*ap) ++ { case ':': *ap++=0; /* grab the port */ ++ statport=ap; ++ while(*ap && *ap!='/' && !isspace(*ap)) ap++; ++ if(*ap!='/') ++ break; ++ case '/': *ap++=0; /* grab the key */ ++ statpass=ap; ++ while(*ap && !isspace(*ap)) ap++; ++ default: break; ++ } ++ if(*ap) ++ { *ap++=0; ++ while(isspace(*ap)) ap++; ++ } ++ /* now we have the first host with port and password (key) */ ++ /* next we check for valid/blank password/port */ ++ if(statpass!=NULL) ++ if(!*statpass) ++ statpass=NULL; ++ if(statport!=NULL) ++ if(!*statport) ++ statport=NULL; ++ statip=0; ++ /* now we check if a valid host was specified */ ++ if(inet_addr(stathost)==INADDR_NONE) ++ { hoste=gethostbyname(stathost); ++ if (!hoste) ++ LogMessage("WARNING %s (%d) => [Alert_FWsam](AlertFWsamInit) Unable to resolve host '%s'!\n",file_name,file_line,stathost); ++ else ++ statip=*(unsigned long *)hoste->h_addr; ++ } ++ else ++ { statip=inet_addr(stathost); ++ if(!statip) ++ LogMessage("WARNING %s (%d) => [Alert_FWsam](AlertFWsamInit) Invalid host address '%s'!\n",file_name,file_line,stathost); ++ } ++ if(statip) ++ { /* groovie, a valid host. Let's alloc and assemble the structure for it. */ ++ if((station=(FWsamStation *)malloc(sizeof(FWsamStation)))==NULL) ++ FatalError("ERROR => [Alert_FWsam](AlertFWsamInit) malloc failed for station!\n"); ++ ++// station->stationip.s_addr=statip; /* the IP address */ ++ station->stationip.ip32[0] = statip; /* the IP address */ ++ if(statport!=NULL && atoi(statport)>0) /* if the user specified one */ ++ station->stationport=atoi(statport); /* use users setting */ ++ else ++ station->stationport=FWSAM_DEFAULTPORT; /* set the default port */ ++ ++ if(statpass!=NULL) /* if specified by user */ ++ strncpy(station->stationkey,statpass,TwoFish_KEY_LENGTH); /* use defined key */ ++ else ++ station->stationkey[0]=0; ++ station->stationkey[TwoFish_KEY_LENGTH]=0; /* make sure it's terminated. (damn strncpy...) */ ++ ++ strcpy(station->initialkey,station->stationkey); ++ station->stationfish=TwoFishInit(station->stationkey); ++ ++ station->localsocketaddr.sin_port=htons(0); /* let's use dynamic ports for now */ ++ station->localsocketaddr.sin_addr.s_addr=0; ++ station->localsocketaddr.sin_family=AF_INET; ++ station->stationsocketaddr.sin_port=htons(station->stationport); ++ //station->stationsocketaddr.sin_addr=station->stationip; ++ station->stationsocketaddr.sin_addr.s_addr=station->stationip.ip32[0]; ++ station->stationsocketaddr.sin_family=AF_INET; /* load all socket crap and keep for later */ ++ ++ do ++ station->myseqno=rand(); /* the seqno this host will use */ ++ while(station->myseqno<20 || station->myseqno>65500); ++ station->mykeymod[0]=rand(); ++ station->mykeymod[1]=rand(); ++ station->mykeymod[2]=rand(); ++ station->mykeymod[3]=rand(); ++ station->stationseqno=0; /* peer hasn't answered yet. */ ++ ++ ++ if(!FWsamStationExists(station,FWsamStationList)) /* If we don't have the station already in global list....*/ ++ { if(FWsamCheckIn(station)) /* ...and we can talk to the agent... */ ++ { if((newlistp=(FWsamList *)malloc(sizeof(FWsamList)))==NULL) ++ FatalError("ERROR => [Alert_FWsam](AlertFWsamInit) malloc failed for global newlistp!\n"); ++ newlistp->station=station; ++ newlistp->next=NULL; ++ ++ if(!FWsamStationList) /* ... add it to the global list/ */ ++ FWsamStationList=newlistp; ++ else ++ { listp=FWsamStationList; ++ while(listp->next) ++ listp=listp->next; ++ listp->next=newlistp; ++ } ++ } ++ else ++ { TwoFishDestroy(station->stationfish); /* if not, we trash it. */ ++ free(station); ++ station=NULL; ++ } ++ } ++#ifdef FWSAMDEBUG ++ else ++ LogMessage("DEBUG => [Alert_FWsam](AlertFWsamInit) Host %s:%i already in global list, skipping CheckIn.\n", sfip_ntoa(&station->stationip),station->stationport); ++#endif ++ ++ if(station) ++ { if(!FWsamStationExists(station,fwsamlist)) /* If we don't have the station already in local list....*/ ++ { if((newlistp=(FWsamList *)malloc(sizeof(FWsamList)))==NULL) ++ FatalError("ERROR => [Alert_FWsam](AlertFWsamInit) malloc failed for local newlistp!\n"); ++ newlistp->station=station; ++ newlistp->next=NULL; ++ ++ if(!fwsamlist) /* ... add it to the local list/ */ ++ fwsamlist=newlistp; ++ else ++ { listp=fwsamlist; ++ while(listp->next) ++ listp=listp->next; ++ listp->next=newlistp; ++ } ++ } ++ ++#ifdef FWSAMDEBUG ++ else ++ LogMessage("DEBUG => [Alert_FWsam](AlertFWsamInit) Host %s:%i already in local list, skipping.\n",sfip_ntoa(&station->stationip),station->stationport); ++ LogMessage("DEBUG => [Alert_FWsam](AlertFWsamInit) #%i: Host %s [%s] port %i password %s\n",++hostcnt,stathost,sfip_ntoa(&station->stationip),station->stationport,station->stationkey); ++#endif ++ } ++ ++ } ++ } /* next one */ ++ ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam](AlertFWsamInit) Linking fwsam alert function to call list...\n"); ++#endif ++ ++ /* Set the preprocessor function into the function list */ ++ AddFuncToOutputList(AlertFWsam, OUTPUT_TYPE_FLAG__ALERT, fwsamlist); ++ AddFuncToCleanExitList(AlertFWsamCleanExitFunc, fwsamlist); ++ ++/* ++* This ifdef function reloads snortsam config/list on SIG HUP ++* 04082012 RZ ++*/ ++#ifdef SNORT_RELOAD ++ AddFuncToReloadList(AlertFWsamRestartFunc, fwsamlist); ++#endif ++ ++} ++ ++ ++/* This routine reads in a str from a file, snips white-spaces ++ * off the front and back, removes comments, and pretties the ++ * string. Returns true or false if a line was read or not. ++*/ ++int FWsamReadLine(char *buf,unsigned long bufsize,FILE *fp) ++{ char *p; ++ ++ if(fgets(buf,bufsize-1,fp)) ++ { buf[bufsize-1]=0; ++ ++#ifdef FWSAMDEBUG_off ++ LogMessage("DEBUG => [Alert_FWsam](AlertFWsamReadLine) Line: %s\n",buf); ++#endif ++ ++ p=buf; ++ while(isspace(*p)) ++ p++; ++ if(p>buf); ++ strcpy(buf,p); ++ if(*buf) ++ { p=buf+strlen(buf)-1; /* remove leading and trailing spaces */ ++ while(isspace(*p)) ++ *p-- =0; ++ } ++ p=buf; ++ if(*p=='#' || *p==';') ++ *p=0; ++ else ++ p++; ++ while(*p) /* remove inline comments (except escaped #'s and ;'s) */ ++ { if(*p=='#' || *p==';') ++ { if(*(p-1)=='\\') ++ strcpy(p-1,p); ++ else ++ *p=0; ++ } ++ else ++ p++; ++ } ++ return TRUE; ++ } ++ return FALSE; ++} ++ ++ ++/* Parses the duration of the argument, recognizing minutes, hours, etc.. ++*/ ++unsigned long FWsamParseDuration(char *p) ++{ unsigned long dur=0,tdu; ++ char *tok,c1,c2; ++ ++ while(*p) ++ { tok=p; ++ while(*p && isdigit(*p)) ++ p++; ++ if(*p) ++ { c1=tolower(*p); ++ *p=0; ++ p++; ++ if(*p && !isdigit(*p)) ++ { c2=tolower(*p++); ++ while(*p && !isdigit(*p)) ++ p++; ++ } ++ else ++ c2=0; ++ tdu=atol(tok); ++ switch(c1) ++ { case 'm': if(c2=='o') /* month */ ++ tdu*=(60*60*24*30); /* use 30 days */ ++ else ++ tdu*=60; /* minutes */ ++ case 's': break; /* seconds */ ++ case 'h': tdu*=(60*60); /* hours */ ++ break; ++ case 'd': tdu*=(60*60*24); /* days */ ++ break; ++ case 'w': tdu*=(60*60*24*7); /* week */ ++ break; ++ case 'y': tdu*=(60*60*24*365); /* year */ ++ break; ++ } ++ dur+=tdu; ++ } ++ else ++ dur+=atol(tok); ++ } ++ ++ return dur; ++} ++ ++ ++/* This routine parses an option line. It is called by FWsamParseLine, ++ * which parses the sid-block.map file, and also by AlertFWsamOptionInit, ++ * which is called by Snort when processing fwsam: options in rules. ++ * It returns TRUE it there is a possible option problem, otherwise FALSE. ++*/ ++int FWsamParseOption(FWsamOptions *optp,char *ap) ++{ int possprob=FALSE; ++ ++ /* set defaults */ ++ ++ optp->duration=300; /* default of 5 minute block */ ++ optp->how=FWSAM_HOW_INOUT; /* inbound and outbound block */ ++ optp->who=FWSAM_WHO_SRC; /* the source */ ++ optp->loglevel=FWSAM_LOG_LONGALERT; /* the log level default */ ++ /* parse the fwsam keywords */ ++ ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam](AlertFWamOptionInit) Parse Options Args: %s\n",ap); ++#endif ++ ++ if(*ap) /* should be dst/src (the WHO) or duration */ ++ { if(isdigit(*ap)) ++ optp->duration=FWsamParseDuration(ap); ++ else ++ { switch(*ap) /* yeah, we're lazy and check only the first character */ ++ { case 'p': ; /* permanent, perm */ ++ case 'f': ; /* forever */ ++ case 'i': optp->duration=0; /* infinite, inf */ ++ break; ++ case 'd': optp->who=FWSAM_WHO_DST; /* destination, dest, dst */ ++ break; ++ case 's': optp->who=FWSAM_WHO_SRC; /* source, src */ ++ break; ++ default: possprob=TRUE; ++ } ++ while(*ap && *ap!=',' && *ap!='[') ++ ap++; ++ if(*ap=='[') ++ { ap++; /* now we have the HOW */ ++ switch(*ap) ++ { case 'i': ; /* in */ ++ case 's': optp->how=FWSAM_HOW_IN; /* source, src */ ++ break; ++ case 'o': ; /* out */ ++ case 'd': optp->how=FWSAM_HOW_OUT; /* destination, dest, dst */ ++ break; ++ case 'b': ; /* both */ ++ case 'e': optp->how=FWSAM_HOW_INOUT; /* either */ ++ break; ++ case 't': ; /* this */ ++ case 'c': optp->how=FWSAM_HOW_THIS; /* connection, conn */ ++ break; ++ default: possprob=TRUE; ++ } ++ while(*ap && *ap!=',') ++ ap++; ++ } ++ if(*ap==',') ++ { ap++; ++ if(isdigit(*ap)) /* and figure out how long to block */ ++ optp->duration=FWsamParseDuration(ap); ++ else if(*ap=='p' || *ap=='f' || *ap=='i') ++ optp->duration=0; ++ else ++ possprob=TRUE; ++ } ++ else if(!*ap) ++ possprob=TRUE; ++ } ++ } ++ else ++ possprob=TRUE; ++ ++ return possprob; ++} ++ ++ ++/* This goes through the lines of sid-block.map and sets the ++ * options for fwsam if the file is being used. ++*/ ++void FWsamParseLine(FWsamOptions *optp,char *buf) ++{ char *ap; ++ ++ ap=buf; /* start at the beginning of the argument */ ++ ++ while(*ap) ++ { if(isspace(*ap)) /* normalize spaces (tabs into space, etc) */ ++ *ap=' '; ++ if(isupper(*ap)) /* and set to lower case */ ++ *ap=tolower(*ap); ++ ap++; ++ } ++ while((ap=strrchr(buf,' '))!=NULL) /* remove spaces */ ++ strcpy(ap,ap+1); ++ ++ ap=buf; ++ if(*ap) ++ { while(*ap && *ap!=':' && *ap!='|') ++ ap++; ++ *ap++ =0; ++ while(*ap && (*ap==':' || *ap=='|')) ++ ap++; ++ ++ optp->sid=(unsigned long)atol(buf); ++ ++ if(FWsamParseOption(optp,ap)) ++ LogMessage("WARNING %s (%d) => [Alert_FWsam](AlertFWamOptionInit) Possible option problem. Using %s[%s],%lu.\n",file_name,file_line,(optp->who==FWSAM_WHO_SRC)?"src":"dst",(optp->how==FWSAM_HOW_IN)?"in":((optp->how==FWSAM_HOW_OUT)?"out":"either"),optp->duration); ++ } ++ else ++ optp->sid=0; ++} ++ ++ ++ ++/* ++ * Function: AlertFWsamOptionInit(char *data, OptTreeNode *otn, int protocol) ++ * ++ * Purpose: Parses each rule and sets the option flags in the tree. ++ * ++ * Arguments: args => ptr to argument string ++ * ++ * Returns: void function ++ * ++*/ ++void AlertFWsamOptionInit(char *args,OptTreeNode *otn,int protocol) ++{ ++ FWsamOptions *optp; ++ char *ap; ++ ++ ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam](AlertFWamOptionInit) FWsamOptionInit is parsing...\n"); ++#endif ++ ++ if((optp=(FWsamOptions *)malloc(sizeof(FWsamOptions)))==NULL) ++ FatalError("ERROR => [Alert_FWsam](AlertFWamOptionInit) malloc failed for opt!\n"); ++ ++ ++ ap=args; /* start at the beginning of the argument */ ++ ++ while(*ap) ++ { if(isspace(*ap)) /* normalize spaces (tabs into space, etc) */ ++ *ap=' '; ++ if(isupper(*ap)) /* and set to lower case */ ++ *ap=tolower(*ap); ++ ap++; ++ } ++ while((ap=strrchr(args,' '))!=NULL) /* remove spaces */ ++ strcpy(ap,ap+1); ++ ++ ++ if(FWsamParseOption(optp,args)) ++ LogMessage("WARNING %s (%d) => [Alert_FWsam](AlertFWamOptionInit) Possible option problem. Using %s[%s],%lu.\n",file_name,file_line,(optp->who==FWSAM_WHO_SRC)?"src":"dst",(optp->how==FWSAM_HOW_IN)?"in":((optp->how==FWSAM_HOW_OUT)?"out":"either"),optp->duration); ++ ++ otn->ds_list[PLUGIN_FWSAM]=(FWsamOptions *)optp; ++} ++ ++ ++/* Generates a new encryption key for TwoFish based on seq numbers and a random that ++ * the SnortSam agents send on checkin (in protocol) ++*/ ++void FWsamNewStationKey(FWsamStation *station,FWsamPacket *packet) ++{ ++ //unsigned char newkey[TwoFish_KEY_LENGTH+2]; ++ char newkey[TwoFish_KEY_LENGTH+2]; ++ int i; ++ ++ newkey[0]=packet->snortseqno[0]; /* current snort seq # (which both know) */ ++ newkey[1]=packet->snortseqno[1]; ++ newkey[2]=packet->fwseqno[0]; /* current SnortSam seq # (which both know) */ ++ newkey[3]=packet->fwseqno[1]; ++ newkey[4]=packet->protocol[0]; /* the random SnortSam chose */ ++ newkey[5]=packet->protocol[1]; ++ ++ strncpy(newkey+6,station->stationkey,TwoFish_KEY_LENGTH-6); /* append old key */ ++ newkey[TwoFish_KEY_LENGTH]=0; ++ ++ newkey[0]^=station->mykeymod[0]; /* modify key with key modifiers which were */ ++ newkey[1]^=station->mykeymod[1]; /* exchanged during the check-in handshake. */ ++ newkey[2]^=station->mykeymod[2]; ++ newkey[3]^=station->mykeymod[3]; ++ newkey[4]^=station->fwkeymod[0]; ++ newkey[5]^=station->fwkeymod[1]; ++ newkey[6]^=station->fwkeymod[2]; ++ newkey[7]^=station->fwkeymod[3]; ++ ++ for(i=0;i<=7;i++) ++ if(newkey[i]==0) ++ newkey[i]++; ++ ++ strcpy(station->stationkey,newkey); ++ TwoFishDestroy(station->stationfish); ++ station->stationfish=TwoFishInit(newkey); ++} ++ ++ ++/* This routine will search the option list as defined ++ * by the sid-block.map file and return a pointer ++ * to the matching record. ++*/ ++FWsamOptions *FWsamGetOption(unsigned long sid) ++{ signed long i,step,diff,o,o2; ++ ++#ifdef FWSAM_FANCYFETCH /* Fancy-fetch jumps in decreasing n/2 steps and takes much less lookups */ ++ o=o2= -1; ++ i=step=FWsamMaxOptions>>1; ++ while(i>=0 && i1) ++ step=step>>1; ++ o2=o; ++ o=i; ++ if(diff>0) ++ i+=step; ++ else ++ i-=step; ++ } ++#else /* This is just a sequential list lookup */ ++ for(i=0;i pointer to the packet data struct ++ * msg => the message to print in the alert ++ * ++ * Returns: void function ++ * ++ ***************************************************************************/ ++void AlertFWsam(Packet *p, char *msg, void *arg, Event *event) ++{ FWsamOptions *optp; ++ FWsamPacket sampacket; ++ FWsamStation *station=NULL; ++ FWsamList *fwsamlist; ++ SOCKET stationsocket; ++ int i,len,deletestation,stationtry=0; ++ //unsigned char *encbuf,*decbuf; ++ char *encbuf,*decbuf; ++ static unsigned long lastbsip[FWSAM_REPET_BLOCKS],lastbdip[FWSAM_REPET_BLOCKS], ++ lastbduration[FWSAM_REPET_BLOCKS],lastbtime[FWSAM_REPET_BLOCKS]; ++ static unsigned short lastbsp[FWSAM_REPET_BLOCKS],lastbdp[FWSAM_REPET_BLOCKS], ++ lastbproto[FWSAM_REPET_BLOCKS],lastbpointer; ++ static unsigned char lastbmode[FWSAM_REPET_BLOCKS]; ++ static unsigned long btime=0; ++ ++ ++ if(otn_tmp==NULL) ++ { ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam] NULL otn_tmp!\n"); ++#endif ++ return; ++ } ++ if(p == NULL) ++ { ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam] NULL packet!\n"); ++#endif ++ return; ++ } ++ if(arg == NULL) ++ { ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam] NULL arg!\n"); ++#endif ++ return; ++ } ++ ++ /* SnortSam does no IPv6 */ ++ if (!IS_IP4(p)) { ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam] not acting on non-IP4 packet!\n"); ++#endif ++ return; ++ } ++ ++ optp=NULL; ++ ++ if(FWsamOptionField) /* If using the file (field present), let's use that */ ++ optp=FWsamGetOption(event->sig_id); ++ ++ if(!optp) /* If file not present, check if an fwsam option was defined on the triggering rule */ ++ optp=otn_tmp->ds_list[PLUGIN_FWSAM]; ++ ++ if(optp) /* if options specified for this rule */ ++ { if(!btime) /* if this is the first time this function is */ ++ { for(i=0;i [Alert_FWsam] Alert -> Msg=\"%s\"\n",msg); ++ ++ LogMessage("DEBUG => [Alert_FWsam] Alert -> Option: %s[%s],%lu.\n",(optp->who==FWSAM_WHO_SRC)?"src":"dst",(optp->how==FWSAM_HOW_IN)?"in":((optp->how==FWSAM_HOW_OUT)?"out":"either"),optp->duration); ++#endif ++ ++ len=TRUE; ++ btime=(unsigned long)time(NULL); /* get current time */ ++ /* This is a cheap check to see if the blocking request matches any of the previous requests. */ ++ for(i=0;ihow==FWSAM_HOW_THIS)? /* if blocking mode SERVICE, check for src and dst */ ++ ( lastbsip[i]==p->iph->ip_src.s_addr && lastbdip[i]==p->iph->ip_dst.s_addr &&lastbproto[i]==p->iph->ip_proto && ++ ((p->iph->ip_proto==IPPROTO_TCP || p->iph->ip_proto==IPPROTO_UDP)? /* check port only of TCP or UDP */ ++/* ((optp->who==FWSAM_WHO_SRC)?(lastbsp[i]==p->sp):(lastbdp[i]==p->dp)):TRUE) ): */ ++ lastbdp[i]==p->dp:TRUE) ): ++ ((optp->who==FWSAM_WHO_SRC)?(lastbsip[i]==p->iph->ip_src.s_addr):(lastbdip[i]==p->iph->ip_dst.s_addr))) && /* otherwise if we block source, only compare source. Same for dest. */ ++ lastbduration[i]==optp->duration && ++ (lastbmode[i]&(FWSAM_HOW|FWSAM_WHO))==(optp->how|optp->who) && ++ (btime-lastbtime[i]<((optp->duration>FWSAM_REPET_TIME)?FWSAM_REPET_TIME:optp->duration))) ++ { len=FALSE; /* If so, we don't need to block again. */ ++ } ++ } ++ if(len) ++ { if(++lastbpointer>=FWSAM_REPET_BLOCKS) /* increase repetitive check pointer */ ++ lastbpointer=0; ++ lastbsip[lastbpointer]=p->iph->ip_src.s_addr; /* and note packet details */ ++ lastbdip[lastbpointer]=p->iph->ip_dst.s_addr; ++ lastbduration[lastbpointer]=optp->duration; ++ lastbmode[lastbpointer]=optp->how|optp->who|optp->loglevel; ++ lastbproto[lastbpointer]=p->iph->ip_proto; ++ if(p->iph->ip_proto==IPPROTO_TCP || p->iph->ip_proto==IPPROTO_UDP) ++ { lastbsp[lastbpointer]=p->sp; /* set ports if TCP or UDP */ ++ lastbdp[lastbpointer]=p->dp; ++ } ++ lastbtime[lastbpointer]=btime; ++ ++ ++ while(fwsamlist!=NULL) ++ { station=fwsamlist->station; ++ //if(station->stationip.s_addr) ++ if(station->stationip.ip32[0]) ++ { deletestation=FALSE; ++ stationtry++; /* first try */ ++ /* create a socket for the station */ ++ stationsocket=socket(PF_INET,SOCK_STREAM,IPPROTO_TCP); ++ if(stationsocket==INVALID_SOCKET) ++ FatalError("ERROR => [Alert_FWsam] Funky socket error (socket)!\n"); ++ if(bind(stationsocket,(struct sockaddr *)&(station->localsocketaddr),sizeof(struct sockaddr))) ++ FatalError("ERROR => [Alert_FWsam] Could not bind socket!\n"); ++ ++ /* let's connect to the agent */ ++ if(connect(stationsocket,(struct sockaddr *)&station->stationsocketaddr,sizeof(struct sockaddr))) ++ { ++ LogMessage("WARNING => [Alert_FWsam] Could not send block to host %s. Will try later.\n",sfip_ntoa(&station->stationip)); ++#ifdef WIN32 ++ closesocket(stationsocket); ++#else ++ close(stationsocket); ++#endif ++ stationtry=0; ++ } ++ else ++ { ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam] Connected to host %s.\n",sfip_ntoa(&station->stationip)); ++#endif ++ /* now build the packet */ ++ station->myseqno+=station->stationseqno; /* increase my seqno by adding agent seq no */ ++ sampacket.endiancheck=1; /* This is an endian indicator for Snortsam */ ++ sampacket.snortseqno[0]=(char)station->myseqno; ++ sampacket.snortseqno[1]=(char)(station->myseqno>>8); ++ sampacket.fwseqno[0]=(char)station->stationseqno;/* fill station seqno */ ++ sampacket.fwseqno[1]=(char)(station->stationseqno>>8); ++ sampacket.status=FWSAM_STATUS_BLOCK; /* set block mode */ ++ sampacket.version=FWSAM_PACKETVERSION; /* set packet version */ ++ sampacket.duration[0]=(char)optp->duration; /* set duration */ ++ sampacket.duration[1]=(char)(optp->duration>>8); ++ sampacket.duration[2]=(char)(optp->duration>>16); ++ sampacket.duration[3]=(char)(optp->duration>>24); ++ sampacket.fwmode=optp->how|optp->who|optp->loglevel; /* set the mode */ ++ sampacket.dstip[0]=(char)p->iph->ip_dst.s_addr; /* destination IP */ ++ sampacket.dstip[1]=(char)(p->iph->ip_dst.s_addr>>8); ++ sampacket.dstip[2]=(char)(p->iph->ip_dst.s_addr>>16); ++ sampacket.dstip[3]=(char)(p->iph->ip_dst.s_addr>>24); ++ sampacket.srcip[0]=(char)p->iph->ip_src.s_addr; /* source IP */ ++ sampacket.srcip[1]=(char)(p->iph->ip_src.s_addr>>8); ++ sampacket.srcip[2]=(char)(p->iph->ip_src.s_addr>>16); ++ sampacket.srcip[3]=(char)(p->iph->ip_src.s_addr>>24); ++ sampacket.protocol[0]=(char)p->iph->ip_proto; /* protocol */ ++ sampacket.protocol[1]=(char)(p->iph->ip_proto>>8);/* protocol */ ++ ++ if(p->iph->ip_proto==IPPROTO_TCP || p->iph->ip_proto==IPPROTO_UDP) ++ { sampacket.srcport[0]=(char)p->sp; /* set ports */ ++ sampacket.srcport[1]=(char)(p->sp>>8); ++ sampacket.dstport[0]=(char)p->dp; ++ sampacket.dstport[1]=(char)(p->dp>>8); ++ } ++ else ++ sampacket.srcport[0]=sampacket.srcport[1]=sampacket.dstport[0]=sampacket.dstport[1]=0; ++ ++ sampacket.sig_id[0]=(char)event->sig_id; /* set signature ID */ ++ sampacket.sig_id[1]=(char)(event->sig_id>>8); ++ sampacket.sig_id[2]=(char)(event->sig_id>>16); ++ sampacket.sig_id[3]=(char)(event->sig_id>>24); ++ ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam] Sending BLOCK\n"); ++ LogMessage("DEBUG => [Alert_FWsam] Snort SeqNo: %x\n",station->myseqno); ++ LogMessage("DEBUG => [Alert_FWsam] Mgmt SeqNo : %x\n",station->stationseqno); ++ LogMessage("DEBUG => [Alert_FWsam] Status : %i\n",FWSAM_STATUS_BLOCK); ++ LogMessage("DEBUG => [Alert_FWsam] Mode : %i\n",optp->how|optp->who|optp->loglevel); ++ LogMessage("DEBUG => [Alert_FWsam] Duration : %li\n",optp->duration); ++ LogMessage("DEBUG => [Alert_FWsam] Protocol : %i\n",GET_IPH_PROTO(p)); ++#ifdef SUP_IP6 ++ LogMessage("DEBUG => [Alert_FWsam] Src IP : %s\n",sfip_ntoa(GET_SRC_IP(p))); ++ LogMessage("DEBUG => [Alert_FWsam] Dest IP : %s\n",sfip_ntoa(GET_DST_IP(p))); ++#else ++ LogMessage("DEBUG => [Alert_FWsam] Src IP : %s\n",inet_ntoa(p->iph->ip_src)); ++ LogMessage("DEBUG => [Alert_FWsam] Dest IP : %s\n",inet_ntoa(p->iph->ip_dst)); ++#endif ++ LogMessage("DEBUG => [Alert_FWsam] Src Port : %i\n",p->sp); ++ LogMessage("DEBUG => [Alert_FWsam] Dest Port : %i\n",p->dp); ++ LogMessage("DEBUG => [Alert_FWsam] Sig_ID : %lu\n",event->sig_id); ++ ++#endif ++ ++ encbuf=TwoFishAlloc(sizeof(FWsamPacket),FALSE,FALSE,station->stationfish); /* get the encryption buffer */ ++ len=TwoFishEncrypt((char *)&sampacket,&encbuf,sizeof(FWsamPacket),FALSE,station->stationfish); /* encrypt the packet with current key */ ++ ++ if(send(stationsocket,encbuf,len,0)!=len) /* weird...could not send */ ++ { LogMessage("WARNING => [Alert_FWsam] Could not send to host %s. Will try again later.\n",sfip_ntoa(&station->stationip)); ++#ifdef WIN32 ++ closesocket(stationsocket); ++#else ++ close(stationsocket); ++#endif ++ stationtry=0; ++ } ++ else ++ { i=FWSAM_NETWAIT; ++#ifdef WIN32 ++ ioctlsocket(stationsocket,FIONBIO,&i); /* set non blocking and wait for */ ++#else ++ ioctl(stationsocket,FIONBIO,&i); /* set non blocking and wait for */ ++#endif ++ while(i-- >1) /* the response packet */ ++ { waitms(10); /* wait for response (default maximum 3 secs */ ++ if(recv(stationsocket,encbuf,len,0)==len) ++ i=0; /* if we received packet we set the counter to 0. */ ++ /* by the time we check with if, it's already dec'ed to -1 */ ++ } ++ if(!i) /* id we timed out (i was one, then dec'ed)... */ ++ { LogMessage("WARNING => [Alert_FWsam] Did not receive response from host %s. Will try again later.\n",sfip_ntoa(&station->stationip)); ++#ifdef WIN32 ++ closesocket(stationsocket); ++#else ++ close(stationsocket); ++#endif ++ stationtry=0; ++ } ++ else /* got a packet */ ++ { decbuf=(char *)&sampacket; /* get the pointer to the packet struct */ ++ len=TwoFishDecrypt(encbuf,&decbuf,sizeof(FWsamPacket)+TwoFish_BLOCK_SIZE,FALSE,station->stationfish); /* try to decrypt the packet with current key */ ++ ++ if(len!=sizeof(FWsamPacket)) /* invalid decryption */ ++ { strcpy(station->stationkey,station->initialkey); /* try the intial key */ ++ TwoFishDestroy(station->stationfish); ++ station->stationfish=TwoFishInit(station->stationkey); /* re-initialize the TwoFish with the intial key */ ++ len=TwoFishDecrypt(encbuf,&decbuf,sizeof(FWsamPacket)+TwoFish_BLOCK_SIZE,FALSE,station->stationfish); /* try again to decrypt */ ++ LogMessage("INFO => [Alert_FWsam] Had to use initial key!\n"); ++ } ++ if(len==sizeof(FWsamPacket)) /* valid decryption */ ++ { if(sampacket.version==FWSAM_PACKETVERSION)/* master speaks my language */ ++ { if(sampacket.status==FWSAM_STATUS_OK || sampacket.status==FWSAM_STATUS_NEWKEY ++ || sampacket.status==FWSAM_STATUS_RESYNC || sampacket.status==FWSAM_STATUS_HOLD) ++ { station->stationseqno=sampacket.fwseqno[0] | (sampacket.fwseqno[1]<<8); /* get stations seqno */ ++ station->lastcontact=(unsigned long)time(NULL); /* set the last contact time (not used yet) */ ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam] Received %s\n",sampacket.status==FWSAM_STATUS_OK?"OK": ++ sampacket.status==FWSAM_STATUS_NEWKEY?"NEWKEY": ++ sampacket.status==FWSAM_STATUS_RESYNC?"RESYNC": ++ sampacket.status==FWSAM_STATUS_HOLD?"HOLD":"ERROR"); ++ LogMessage("DEBUG => [Alert_FWsam] Snort SeqNo: %x\n",sampacket.snortseqno[0]|(sampacket.snortseqno[1]<<8)); ++ LogMessage("DEBUG => [Alert_FWsam] Mgmt SeqNo : %x\n",station->stationseqno); ++ LogMessage("DEBUG => [Alert_FWsam] Status : %i\n",sampacket.status); ++ LogMessage("DEBUG => [Alert_FWsam] Version : %i\n",sampacket.version); ++#endif ++ if(sampacket.status==FWSAM_STATUS_HOLD) ++ { i=FWSAM_NETHOLD; /* Stay on hold for a maximum of 60 secs (default) */ ++ while(i-- >1) /* the response packet */ ++ { waitms(10); /* wait for response */ ++ if(recv(stationsocket,encbuf,sizeof(FWsamPacket)+TwoFish_BLOCK_SIZE,0)==sizeof(FWsamPacket)+TwoFish_BLOCK_SIZE) ++ i=0; /* if we received packet we set the counter to 0. */ ++ } ++ if(!i) /* id we timed out (i was one, then dec'ed)... */ ++ { LogMessage("WARNING => [Alert_FWsam] Did not receive response from host %s. Will try again later.\n",sfip_ntoa(&station->stationip)); ++ stationtry=0; ++ sampacket.status=FWSAM_STATUS_ERROR; ++ } ++ else /* got a packet */ ++ { decbuf=(char *)&sampacket; /* get the pointer to the packet struct */ ++ len=TwoFishDecrypt(encbuf,&decbuf,sizeof(FWsamPacket)+TwoFish_BLOCK_SIZE,FALSE,station->stationfish); /* try to decrypt the packet with current key */ ++ ++ if(len!=sizeof(FWsamPacket)) /* invalid decryption */ ++ { strcpy(station->stationkey,station->initialkey); /* try the intial key */ ++ TwoFishDestroy(station->stationfish); ++ station->stationfish=TwoFishInit(station->stationkey); /* re-initialize the TwoFish with the intial key */ ++ len=TwoFishDecrypt(encbuf,&decbuf,sizeof(FWsamPacket)+TwoFish_BLOCK_SIZE,FALSE,station->stationfish); /* try again to decrypt */ ++ LogMessage("INFO => [Alert_FWsam] Had to use initial key again!\n"); ++ } ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam] Received %s\n",sampacket.status==FWSAM_STATUS_OK?"OK": ++ sampacket.status==FWSAM_STATUS_NEWKEY?"NEWKEY": ++ sampacket.status==FWSAM_STATUS_RESYNC?"RESYNC": ++ sampacket.status==FWSAM_STATUS_HOLD?"HOLD":"ERROR"); ++ LogMessage("DEBUG => [Alert_FWsam] Snort SeqNo: %x\n",sampacket.snortseqno[0]|(sampacket.snortseqno[1]<<8)); ++ LogMessage("DEBUG => [Alert_FWsam] Mgmt SeqNo : %x\n",station->stationseqno); ++ LogMessage("DEBUG => [Alert_FWsam] Status : %i\n",sampacket.status); ++ LogMessage("DEBUG => [Alert_FWsam] Version : %i\n",sampacket.version); ++#endif ++ if(len!=sizeof(FWsamPacket)) /* invalid decryption */ ++ { ErrorMessage("ERROR => [Alert_FWsam] Password mismatch! Ignoring host %s.\n",sfip_ntoa(&station->stationip)); ++ deletestation=TRUE; ++ sampacket.status=FWSAM_STATUS_ERROR; ++ } ++ else if(sampacket.version!=FWSAM_PACKETVERSION) /* invalid protocol version */ ++ { ErrorMessage("ERROR => [Alert_FWsam] Protocol version error! Ignoring host %s.\n",sfip_ntoa(&station->stationip)); ++ deletestation=TRUE; ++ sampacket.status=FWSAM_STATUS_ERROR; ++ } ++ else if(sampacket.status!=FWSAM_STATUS_OK && sampacket.status!=FWSAM_STATUS_NEWKEY && sampacket.status!=FWSAM_STATUS_RESYNC) ++ { ErrorMessage("ERROR => [Alert_FWsam] Funky handshake error! Ignoring host %s.\n",sfip_ntoa(&station->stationip)); ++ deletestation=TRUE; ++ sampacket.status=FWSAM_STATUS_ERROR; ++ } ++ } ++ } ++ if(sampacket.status==FWSAM_STATUS_RESYNC) /* if station want's to resync... */ ++ { strcpy(station->stationkey,station->initialkey); /* ...we use the intial key... */ ++ memcpy(station->fwkeymod,sampacket.duration,4); /* and note the random key modifier */ ++ } ++ if(sampacket.status==FWSAM_STATUS_NEWKEY || sampacket.status==FWSAM_STATUS_RESYNC) ++ { ++ FWsamNewStationKey(station,&sampacket); /* generate new TwoFish keys */ ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam] Generated new encryption key...\n"); ++#endif ++ } ++#ifdef WIN32 ++ closesocket(stationsocket); ++#else ++ close(stationsocket); ++#endif ++ stationtry=0; ++ } ++ else if(sampacket.status==FWSAM_STATUS_ERROR) /* if SnortSam reports an error on second try, */ ++ { ++#ifdef WIN32 ++ closesocket(stationsocket); /* something is messed up and ... */ ++#else ++ close(stationsocket); ++#endif ++ if(stationtry>1) /* we ignore that station. */ ++ { deletestation=TRUE; /* flag for deletion */ ++ ErrorMessage("ERROR => [Alert_FWsam] Could not renegotiate key! Ignoring host %s.\n",sfip_ntoa(&station->stationip)); ++ } ++ else /* if we get an error on the first try, */ ++ { if(!FWsamCheckIn(station)) /* we first try to check in again. */ ++ { deletestation=TRUE; ++ ErrorMessage("ERROR => [Alert_FWsam] Password mismatch! Ignoring host %s.\n",sfip_ntoa(&station->stationip)); ++ } ++ } ++ } ++ else /* an unknown status means trouble... */ ++ { ErrorMessage("ERROR => [Alert_FWsam] Funky handshake error! Ignoring host %s.\n",sfip_ntoa(&station->stationip)); ++#ifdef WIN32 ++ closesocket(stationsocket); ++#else ++ close(stationsocket); ++#endif ++ deletestation=TRUE; ++ } ++ } ++ else /* if the SnortSam agent uses a different packet version, we have no choice but to ignore it. */ ++ { ErrorMessage("ERROR => [Alert_FWsam] Protocol version error! Ignoring host %s.\n",sfip_ntoa(&station->stationip)); ++#ifdef WIN32 ++ closesocket(stationsocket); ++#else ++ close(stationsocket); ++#endif ++ deletestation=TRUE; ++ } ++ } ++ else /* if the intial key failed to decrypt as well, the keys are not configured the same, and we ignore that SnortSam station. */ ++ { ErrorMessage("ERROR => [Alert_FWsam] Password mismatch! Ignoring host %s.\n",sfip_ntoa(&station->stationip)); ++#ifdef WIN32 ++ closesocket(stationsocket); ++#else ++ close(stationsocket); ++#endif ++ deletestation=TRUE; ++ } ++ } ++ } ++ free(encbuf); /* release of the TwoFishAlloc'ed encryption buffer */ ++ } ++ if(stationtry==0 || deletestation) /* if everything went real well, or real bad... */ ++ { if(deletestation){ /* If it went bad, we remove the station from the list by marking the IP */ ++// station->stationip.s_addr=0; ++ station->stationip.ip32[0]=0; ++ } ++ fwsamlist=fwsamlist->next; ++ } ++ } ++ else ++ fwsamlist=fwsamlist->next; ++ } ++ } ++ else ++ { ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam] Skipping repetitive block.\n"); ++#endif ++ } ++ } ++} ++ ++/* FWsamCheckOut will be called when Snort exists. It de-registeres this snort sensor ++ * from the list of sensor that the SnortSam agent keeps. ++ */ ++void FWsamCheckOut(FWsamStation *station) ++{ FWsamPacket sampacket; ++ SOCKET stationsocket; ++ int i,len; ++ char *encbuf,*decbuf; ++ //unsigned char *encbuf,*decbuf; ++ ++ ++ stationsocket=socket(PF_INET,SOCK_STREAM,IPPROTO_TCP); ++ if(stationsocket==INVALID_SOCKET) ++ FatalError("ERROR => [Alert_FWsam](FWsamCheckOut) Funky socket error (socket)!\n"); ++ if(bind(stationsocket,(struct sockaddr *)&(station->localsocketaddr),sizeof(struct sockaddr))) ++ FatalError("ERROR => [Alert_FWsam](FWsamCheckOut) Could not bind socket!\n"); ++ ++ /* let's connect to the agent */ ++ if(!connect(stationsocket,(struct sockaddr *)&station->stationsocketaddr,sizeof(struct sockaddr))) ++ { LogMessage("INFO => [Alert_FWsam](FWsamCheckOut) Disconnecting from host %s.\n",sfip_ntoa(&station->stationip)); ++ /* now build the packet */ ++ station->myseqno+=station->stationseqno; /* increase my seqno */ ++ sampacket.endiancheck=1; ++ sampacket.snortseqno[0]=(char)station->myseqno; ++ sampacket.snortseqno[1]=(char)(station->myseqno>>8); ++ sampacket.fwseqno[0]=(char)station->stationseqno; /* fill station seqno */ ++ sampacket.fwseqno[1]=(char)(station->stationseqno>>8); ++ sampacket.status=FWSAM_STATUS_CHECKOUT; /* checking out... */ ++ sampacket.version=FWSAM_PACKETVERSION; ++ ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam](FWsamCheckOut) Sending CHECKOUT\n"); ++ LogMessage("DEBUG => [Alert_FWsam](FWsamCheckOut) Snort SeqNo: %x\n",station->myseqno); ++ LogMessage("DEBUG => [Alert_FWsam](FWsamCheckOut) Mgmt SeqNo : %x\n",station->stationseqno); ++ LogMessage("DEBUG => [Alert_FWsam](FWsamCheckOut) Status : %i\n",sampacket.status); ++ ++#endif ++ ++ encbuf=TwoFishAlloc(sizeof(FWsamPacket),FALSE,FALSE,station->stationfish); /* get encryption buffer */ ++ len=TwoFishEncrypt((char *)&sampacket,&encbuf,sizeof(FWsamPacket),FALSE,station->stationfish); /* encrypt packet with current key */ ++ ++ if(send(stationsocket,encbuf,len,0)==len) ++ { i=FWSAM_NETWAIT; ++#ifdef WIN32 ++ ioctlsocket(stationsocket,FIONBIO,&i); /* set non blocking and wait for */ ++#else ++ ioctl(stationsocket,FIONBIO,&i); /* set non blocking and wait for */ ++#endif ++ while(i-- >1) ++ { waitms(10); /* ...wait a maximum of 3 secs for response... */ ++ if(recv(stationsocket,encbuf,len,0)==len) /* ... for the status packet */ ++ i=0; ++ } ++ if(i) /* if we got the packet */ ++ { decbuf=(char *)&sampacket; ++ len=TwoFishDecrypt(encbuf,&decbuf,sizeof(FWsamPacket)+TwoFish_BLOCK_SIZE,FALSE,station->stationfish); ++ ++ if(len!=sizeof(FWsamPacket)) /* invalid decryption */ ++ { strcpy(station->stationkey,station->initialkey); /* try initial key */ ++ TwoFishDestroy(station->stationfish); /* toss this fish */ ++ station->stationfish=TwoFishInit(station->stationkey); /* re-initialze TwoFish with initial key */ ++ len=TwoFishDecrypt(encbuf,&decbuf,sizeof(FWsamPacket)+TwoFish_BLOCK_SIZE,FALSE,station->stationfish); /* and try to decrypt again */ ++ LogMessage("INFO => [Alert_FWsam](FWsamCheckOut) Had to use initial key!\n"); ++ } ++ if(len==sizeof(FWsamPacket)) /* valid decryption */ ++ { if(sampacket.version!=FWSAM_PACKETVERSION) /* but don't really care since we are on the way out */ ++ ErrorMessage("WARNING => [Alert_FWsam](FWsamCheckOut) Protocol version error! What the hell, we're quitting anyway! :)\n"); ++ } ++ else ++ ErrorMessage("WARNING => [Alert_FWsam](FWsamCheckOut) Password mismatch! What the hell, we're quitting anyway! :)\n"); ++ } ++ } ++ free(encbuf); /* release TwoFishAlloc'ed buffer */ ++ } ++ else ++ LogMessage("WARNING => [Alert_FWsam] Could not connect to host %s for CheckOut. What the hell, we're quitting anyway! :)\n",sfip_ntoa(&station->stationip)); ++#ifdef WIN32 ++ closesocket(stationsocket); ++#else ++ close(stationsocket); ++#endif ++} ++ ++ ++/* FWSamFree: Disconnects all FW-1 management stations, ++ * closes sockets, and frees the structures. ++ */ ++void FWsamFree(FWsamList *list) ++{ ++ FWsamList *next; ++ ++ while(list) /* Free pointer list for rule type */ ++ { ++ next=list->next; ++ free(list); ++ list=next; ++ } ++ list=FWsamStationList; ++ ++ while(list) /* Free global pointer list and stations */ ++ { ++ next=list->next; ++ if (list->station) ++ { ++ if(list->station->stationip.ip32[0]) ++ //if(list->station->stationip.s_addr) ++ FWsamCheckOut(list->station); /* Send a Check-Out to SnortSam, */ ++ ++ TwoFishDestroy(list->station->stationfish); /* toss the fish, */ ++ free(list->station); /* free station, */ ++ } ++ free(list); /* free pointer, */ ++ list=next; /* and move to next. */ ++ } ++ FWsamStationList=NULL; ++ if(FWsamOptionField) ++ free(FWsamOptionField); ++} ++ ++void AlertFWsamCleanExitFunc(int signal, void *arg) ++{ FWsamList *fwsamlist; ++ ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam](AlertFWsamCleanExitFunc) Exiting...\n"); ++#endif ++ ++ fwsamlist=(FWsamList *)arg; ++ FWsamFree(fwsamlist); /* Free all elements */ ++} ++ ++void AlertFWsamRestartFunc(int signal, void *arg) ++{ FWsamList *fwsamlist; ++ ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam](AlertFWsamRestartFunc) Restarting...\n"); ++#endif ++ ++ fwsamlist=(FWsamList *)arg; ++ FWsamFree(fwsamlist); /* Free all elements */ ++} ++ ++/* This routine registers this Snort sensor with SnortSam. ++ * It will also change the encryption key based on some variables. ++ */ ++int FWsamCheckIn(FWsamStation *station) ++{ int i,len,stationok=TRUE; ++ FWsamPacket sampacket; ++ char *encbuf,*decbuf; ++ //unsigned char *encbuf,*decbuf; ++ SOCKET stationsocket; ++ ++ ++ /* create a socket for the station */ ++ stationsocket=socket(PF_INET,SOCK_STREAM,IPPROTO_TCP); ++ if(stationsocket==INVALID_SOCKET) ++ FatalError("ERROR => [Alert_FWsam](FWsamCheckIn) Funky socket error (socket)!\n"); ++ if(bind(stationsocket,(struct sockaddr *)&(station->localsocketaddr),sizeof(struct sockaddr))) ++ FatalError("ERROR => [Alert_FWsam](FWsamCheckIn) Could not bind socket!\n"); ++ ++ i=TRUE; ++ /* let's connect to the agent */ ++ if(connect(stationsocket,(struct sockaddr *)&station->stationsocketaddr,sizeof(struct sockaddr))) ++ LogMessage("WARNING => [Alert_FWsam](FWsamCheckIn) Could not connect to host %s. Will try later.\n",sfip_ntoa(&station->stationip)); ++ else ++ { LogMessage("INFO => [Alert_FWsam](FWsamCheckIn) Connected to host %s.\n",sfip_ntoa(&station->stationip)); ++ /* now build the packet */ ++ sampacket.endiancheck=1; ++ sampacket.snortseqno[0]=(char)station->myseqno; /* fill my sequence number number */ ++ sampacket.snortseqno[1]=(char)(station->myseqno>>8); /* fill my sequence number number */ ++ sampacket.status=FWSAM_STATUS_CHECKIN; /* let's check in */ ++ sampacket.version=FWSAM_PACKETVERSION; /* set the packet version */ ++ memcpy(sampacket.duration,station->mykeymod,4); /* we'll send SnortSam our key modifier in the duration slot */ ++ /* (the checkin packet is just the plain initial key) */ ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam](FWsamCheckIn) Sending CheckIn\n"); ++ LogMessage("DEBUG => [Alert_FWsam](FWsamCheckIn) Snort SeqNo: %x\n",station->myseqno); ++ LogMessage("DEBUG => [Alert_FWsam](FWsamCheckIn) Mode : %i\n",sampacket.status); ++ LogMessage("DEBUG => [Alert_FWsam](FWsamCheckIn) Version : %i\n",sampacket.version); ++#endif ++ encbuf=TwoFishAlloc(sizeof(FWsamPacket),FALSE,FALSE,station->stationfish); /* get buffer for encryption */ ++ len=TwoFishEncrypt((char *)&sampacket,&encbuf,sizeof(FWsamPacket),FALSE,station->stationfish); /* encrypt with initial key */ ++ if(send(stationsocket,encbuf,len,0)!=len) /* weird...could not send */ ++ LogMessage("WARNING => [Alert_FWsam](FWsamCheckIn) Could not send to host %s. Will try again later.\n",sfip_ntoa(&station->stationip)); ++ else ++ { i=FWSAM_NETWAIT; ++#ifdef WIN32 ++ ioctlsocket(stationsocket,FIONBIO,&i); /* set non blocking and wait for */ ++#else ++ ioctl(stationsocket,FIONBIO,&i); /* set non blocking and wait for */ ++#endif ++ while(i-- >1) ++ { waitms(10); /* wait a maximum of 3 secs for response */ ++ if(recv(stationsocket,encbuf,len,0)==len) ++ i=0; ++ } ++ if(!i) /* time up? */ ++ LogMessage("WARNING => [Alert_FWsam](FWsamCheckIn) Did not receive response from host %s. Will try again later.\n",sfip_ntoa(&station->stationip)); ++ else ++ { decbuf=(char *)&sampacket; /* got status packet */ ++ len=TwoFishDecrypt(encbuf,&decbuf,sizeof(FWsamPacket)+TwoFish_BLOCK_SIZE,FALSE,station->stationfish); /* try to decrypt with initial key */ ++ if(len==sizeof(FWsamPacket)) /* valid decryption */ ++ { ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam](FWsamCheckIn) Received %s\n",sampacket.status==FWSAM_STATUS_OK?"OK": ++ sampacket.status==FWSAM_STATUS_NEWKEY?"NEWKEY": ++ sampacket.status==FWSAM_STATUS_RESYNC?"RESYNC": ++ sampacket.status==FWSAM_STATUS_HOLD?"HOLD":"ERROR"); ++ LogMessage("DEBUG => [Alert_FWsam](FWsamCheckIn) Snort SeqNo: %x\n",sampacket.snortseqno[0]|(sampacket.snortseqno[1]<<8)); ++ LogMessage("DEBUG => [Alert_FWsam](FWsamCheckIn) Mgmt SeqNo : %x\n",sampacket.fwseqno[0]|(sampacket.fwseqno[1]<<8)); ++ LogMessage("DEBUG => [Alert_FWsam](FWsamCheckIn) Status : %i\n",sampacket.status); ++ LogMessage("DEBUG => [Alert_FWsam](FWsamCheckIn) Version : %i\n",sampacket.version); ++#endif ++ if(sampacket.version==FWSAM_PACKETVERSION) /* master speaks my language */ ++ { if(sampacket.status==FWSAM_STATUS_OK || sampacket.status==FWSAM_STATUS_NEWKEY || sampacket.status==FWSAM_STATUS_RESYNC) ++ { station->stationseqno=sampacket.fwseqno[0]|(sampacket.fwseqno[1]<<8); /* get stations seqno */ ++ station->lastcontact=(unsigned long)time(NULL); ++ ++ if(sampacket.status==FWSAM_STATUS_NEWKEY || sampacket.status==FWSAM_STATUS_RESYNC) /* generate new keys */ ++ { memcpy(station->fwkeymod,sampacket.duration,4); /* note the key modifier */ ++ FWsamNewStationKey(station,&sampacket); /* and generate new TwoFish keys (with key modifiers) */ ++#ifdef FWSAMDEBUG ++ LogMessage("DEBUG => [Alert_FWsam](FWsamCheckIn) Generated new encryption key...\n"); ++#endif ++ } ++ } ++ else /* weird, got a strange status back */ ++ { ErrorMessage("ERROR => [Alert_FWsam](FWsamCheckIn) Funky handshake error! Ignoring host %s.\n",sfip_ntoa(&station->stationip)); ++ stationok=FALSE; ++ } ++ } ++ else /* packet version does not match */ ++ { ErrorMessage("ERROR =>[Alert_FWsam](FWsamCheckIn) Protocol version error! Ignoring host %s.\n",sfip_ntoa(&station->stationip)); ++ stationok=FALSE; ++ } ++ } ++ else /* key does not match */ ++ { ErrorMessage("ERROR => [Alert_FWsam](FWsamCheckIn) Password mismatch! Ignoring host %s.\n",sfip_ntoa(&station->stationip)); ++ stationok=FALSE; ++ } ++ } ++ } ++ free(encbuf); /* release TwoFishAlloc'ed buffer */ ++ } ++#ifdef WIN32 ++ closesocket(stationsocket); ++#else ++ close(stationsocket); ++#endif ++ return stationok; ++} ++#undef FWSAMDEBUG ++ +diff -ruN snort-2.9.2.2/src/output-plugins/spo_alert_fwsam.h snort-2.9.2.2_bkup/src/output-plugins/spo_alert_fwsam.h +--- snort-2.9.2.2/src/output-plugins/spo_alert_fwsam.h 1969-12-31 16:00:00.000000000 -0800 ++++ snort-2.9.2.2_bkup/src/output-plugins/spo_alert_fwsam.h 2012-04-08 20:34:57.389687124 -0700 +@@ -0,0 +1,216 @@ ++/* $Id: snortpatchb,v 1.5 2005/10/06 08:50:39 fknobbe Exp $ ++** ++** spo_alert_fwsam.h ++** ++** Copyright (c) 2001-2004 Frank Knobbe ++** ++** This program is free software; you can redistribute it and/or modify ++** it under the terms of the GNU General Public License as published by ++** the Free Software Foundation; either version 2 of the License, or ++** (at your option) any later version. ++** ++** This program is distributed in the hope that it will be useful, ++** but WITHOUT ANY WARRANTY; without even the implied warranty of ++** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++** GNU General Public License for more details. ++** ++** You should have received a copy of the GNU General Public License ++** along with this program; if not, write to the Free Software ++** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++*/ ++ ++/* This file gets included in plugbase.c when it is integrated into the rest ++ * of the program. ++ * ++ * For more info, see the beginning of spo_alert_fwsam.c ++ * ++ */ ++ ++#ifndef __SPO_FWSAM_H__ ++#define __SPO_FWSAM_H__ ++ ++#include "snort.h" ++#include "rules.h" ++#include "plugbase.h" ++#include "plugin_enum.h" ++#include "fatal.h" ++#include "util.h" ++#include "twofish.h" ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++/* just some compatibility stuff */ ++#ifdef WIN32 ++#if !defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_) ++#include ++#endif ++#define waitms(x) Sleep(x) ++ ++#else ++ ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef SOLARIS ++#include ++#endif ++ ++typedef int SOCKET; ++ ++#ifndef INVALID_SOCKET ++#define INVALID_SOCKET -1 ++#endif ++ ++#define waitms(x) usleep((x)*1000) ++ ++#endif ++ ++#ifndef FALSE ++#define FALSE 0 ++#endif ++#ifndef TRUE ++#define TRUE !FALSE ++#endif ++#ifndef bool ++#define bool int ++#endif ++ ++ ++#if defined(_DEBUG) || defined(DEBUG) ++#ifndef FWSAMDEBUG ++#define FWSAMDEBUG ++#endif ++#else ++#endif ++ ++ ++/* Official Snort PlugIn Number has been moved into plugin_enum.h */ ++ ++ ++/* fixed defines */ ++ ++#define FWSAM_DEFAULTPORT 898 /* Default port if user does not specify one in snort.conf */ ++ /* (Was unused last time I checked...) */ ++#define FWSAM_PACKETVERSION 14 /* version of the packet. Will increase with enhancements. */ ++ ++#define FWSAM_STATUS_CHECKIN 1 /* snort to fw */ ++#define FWSAM_STATUS_CHECKOUT 2 ++#define FWSAM_STATUS_BLOCK 3 ++#define FWSAM_STATUS_UNBLOCK 9 ++ ++#define FWSAM_STATUS_OK 4 /* fw to snort */ ++#define FWSAM_STATUS_ERROR 5 ++#define FWSAM_STATUS_NEWKEY 6 ++#define FWSAM_STATUS_RESYNC 7 ++#define FWSAM_STATUS_HOLD 8 ++ ++#define FWSAM_LOG_NONE 0 ++#define FWSAM_LOG_SHORTLOG 1 ++#define FWSAM_LOG_SHORTALERT 2 ++#define FWSAM_LOG_LONGLOG 3 ++#define FWSAM_LOG_LONGALERT 4 ++#define FWSAM_LOG (FWSAM_LOG_SHORTLOG|FWSAM_LOG_SHORTALERT|FWSAM_LOG_LONGLOG|FWSAM_LOG_LONGALERT) ++#define FWSAM_WHO_DST 8 ++#define FWSAM_WHO_SRC 16 ++#define FWSAM_WHO (FWSAM_WHO_DST|FWSAM_WHO_SRC) ++#define FWSAM_HOW_IN 32 ++#define FWSAM_HOW_OUT 64 ++#define FWSAM_HOW_INOUT (FWSAM_HOW_IN|FWSAM_HOW_OUT) ++#define FWSAM_HOW_THIS 128 ++#define FWSAM_HOW (FWSAM_HOW_IN|FWSAM_HOW_OUT|FWSAM_HOW_THIS) ++ ++ ++/* user adjustable defines */ ++ ++#define FWSAM_REPET_BLOCKS 10 /* Snort remembers this amount of last blocks and... */ ++#define FWSAM_REPET_TIME 20 /* ...checks if they fall within this time. If so,... */ ++ /* ...the blocking request is not send. */ ++ ++#define FWSAM_NETWAIT 300 /* 100th of a second. 3 sec timeout for network connections */ ++#define FWSAM_NETHOLD 6000 /* 100th of a second. 60 sec timeout for holding */ ++ ++#define SID_MAPFILE "sid-block.map" ++#define SID_ALT_MAPFILE "sid-fwsam.map" ++ ++#define FWSAM_FANCYFETCH /* This will invoke a fast sid lookup routine */ ++ ++ ++/* vars */ ++ ++typedef struct _FWsamstation /* structure of a mgmt station */ ++{ unsigned short myseqno; ++ unsigned short stationseqno; ++ unsigned char mykeymod[4]; ++ unsigned char fwkeymod[4]; ++ unsigned short stationport; ++ //struct in_addr stationip; ++ sfip_t stationip; ++ struct sockaddr_in localsocketaddr; ++ struct sockaddr_in stationsocketaddr; ++ TWOFISH *stationfish; ++ char initialkey[TwoFish_KEY_LENGTH+2]; ++ char stationkey[TwoFish_KEY_LENGTH+2]; ++ time_t lastcontact; ++/* time_t sleepstart; */ ++} FWsamStation; ++ ++typedef struct _FWsampacket /* 2 blocks (3rd block is header from TwoFish) */ ++{ unsigned short endiancheck; /* 0 */ ++ unsigned char srcip[4]; /* 2 */ ++ unsigned char dstip[4]; /* 6 */ ++ unsigned char duration[4]; /* 10 */ ++ unsigned char snortseqno[2]; /* 14 */ ++ unsigned char fwseqno[2]; /* 16 */ ++ unsigned char srcport[2]; /* 18 */ ++ unsigned char dstport[2]; /* 20 */ ++ unsigned char protocol[2]; /* 22 */ ++ unsigned char fwmode; /* 24 */ ++ unsigned char version; /* 25 */ ++ unsigned char status; /* 26 */ ++ unsigned char sig_id[4]; /* 27 */ ++ unsigned char fluff; /* 31 */ ++} FWsamPacket; /* 32 bytes in size */ ++ ++typedef struct _FWsamoptions /* snort rule options */ ++{ unsigned long sid; ++ unsigned long duration; ++ unsigned char who; ++ unsigned char how; ++ unsigned char loglevel; ++} FWsamOptions; ++ ++typedef struct _FWsamlistpointer ++{ FWsamStation *station; ++ struct _FWsamlistpointer *next; ++} FWsamList; ++ ++ ++/* functions */ ++void AlertFWsamSetup(void); ++void AlertFWsamInit(char *args); ++void AlertFWsamOptionInit(char *args,OptTreeNode *otn,int protocol); ++void AlertFWsamCleanExitFunc(int signal, void *arg); ++void AlertFWsamRestartFunc(int signal, void *arg); ++void AlertFWsam(Packet *p, char *msg, void *arg, Event *event); ++int FWsamCheckIn(FWsamStation *station); ++void FWsamCheckOut(FWsamStation *station); ++void FWsamNewStationKey(FWsamStation *station,FWsamPacket *packet); ++void FWsamFixPacketEndian(FWsamPacket *p); ++unsigned long FWsamParseDuration(char *p); ++void FWsamFree(FWsamList *fwsamlist); ++int FWsamStationExists(FWsamStation *who,FWsamList *list); ++int FWsamReadLine(char *,unsigned long,FILE *); ++void FWsamParseLine(FWsamOptions *,char *); ++FWsamOptions *FWsamGetOption(unsigned long); ++int FWsamParseOption(FWsamOptions *,char *); ++ ++#endif /* __SPO_FWSAM_H__ */ +diff -ruN snort-2.9.2.2/src/plugbase.c snort-2.9.2.2_bkup/src/plugbase.c +--- snort-2.9.2.2/src/plugbase.c 2012-03-17 14:40:16.000000000 -0700 ++++ snort-2.9.2.2_bkup/src/plugbase.c 2012-04-08 20:34:57.389687124 -0700 +@@ -130,6 +130,7 @@ + #endif + + #include "output-plugins/spo_alert_test.h" ++#include "output-plugins/spo_alert_fwsam.h" + + extern ListHead *head_tmp; + extern PreprocConfigFuncNode *preproc_config_funcs; +@@ -1520,6 +1521,7 @@ + #endif + + AlertTestSetup(); ++ AlertFWsamSetup(); + } + + /**************************************************************************** +diff -ruN snort-2.9.2.2/src/plugin_enum.h snort-2.9.2.2_bkup/src/plugin_enum.h +--- snort-2.9.2.2/src/plugin_enum.h 2012-01-12 14:11:40.000000000 -0800 ++++ snort-2.9.2.2_bkup/src/plugin_enum.h 2012-04-08 20:34:57.389687124 -0700 +@@ -60,6 +60,7 @@ + PLUGIN_URILEN_CHECK, + PLUGIN_DYNAMIC, + PLUGIN_FLOWBIT, ++ PLUGIN_FWSAM, + PLUGIN_FILE_DATA, + PLUGIN_BASE64_DECODE, + PLUGIN_MAX /* sentinel value */ +diff -ruN snort-2.9.2.2/src/twofish.c snort-2.9.2.2_bkup/src/twofish.c +--- snort-2.9.2.2/src/twofish.c 1969-12-31 16:00:00.000000000 -0800 ++++ snort-2.9.2.2_bkup/src/twofish.c 2012-04-08 20:34:57.389687124 -0700 +@@ -0,0 +1,971 @@ ++/* $Id: twofish.c,v 2.1 2008/12/15 20:36:05 fknobbe Exp $ ++ * ++ * ++ * Copyright (C) 1997-2000 The Cryptix Foundation Limited. ++ * Copyright (C) 2000 Farm9. ++ * Copyright (C) 2001 Frank Knobbe. ++ * All rights reserved. ++ * ++ * For Cryptix code: ++ * Use, modification, copying and distribution of this software is subject ++ * the terms and conditions of the Cryptix General Licence. You should have ++ * received a copy of the Cryptix General Licence along with this library; ++ * if not, you can download a copy from http://www.cryptix.org/ . ++ * ++ * For Farm9: ++ * --- jojo@farm9.com, August 2000, converted from Java to C++, added CBC mode and ++ * ciphertext stealing technique, added AsciiTwofish class for easy encryption ++ * decryption of text strings ++ * ++ * Frank Knobbe : ++ * --- April 2001, converted from C++ to C, prefixed global variables ++ * with TwoFish, substituted some defines, changed functions to make use of ++ * variables supplied in a struct, modified and added routines for modular calls. ++ * Cleaned up the code so that defines are used instead of fixed 16's and 32's. ++ * Created two general purpose crypt routines for one block and multiple block ++ * encryption using Joh's CBC code. ++ * Added crypt routines that use a header (with a magic and data length). ++ * (Basically a major rewrite). ++ * ++ * Note: Routines labeled _TwoFish are private and should not be used ++ * (or with extreme caution). ++ * ++ */ ++ ++#ifndef __TWOFISH_LIBRARY_SOURCE__ ++#define __TWOFISH_LIBRARY_SOURCE__ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef WIN32 ++ ++#ifndef u_long ++typedef unsigned long u_long; ++#endif ++#ifndef u_int32_t ++typedef unsigned long u_int32_t; ++#endif ++#ifndef u_word ++typedef unsigned short u_word; ++#endif ++#ifndef u_int16_t ++typedef unsigned short u_int16_t; ++#endif ++#ifndef u_char ++typedef unsigned char u_char; ++#endif ++#ifndef u_int8_t ++typedef unsigned char u_int8_t; ++#endif ++ ++#endif /* WIN32 */ ++ ++#include "twofish.h" ++ ++ ++bool TwoFish_srand=TRUE; /* if TRUE, first call of TwoFishInit will seed rand(); */ ++ /* of TwoFishInit */ ++ ++/* Fixed 8x8 permutation S-boxes */ ++static const u_int8_t TwoFish_P[2][256] = ++{ ++ { /* p0 */ ++ 0xA9, 0x67, 0xB3, 0xE8, 0x04, 0xFD, 0xA3, 0x76, 0x9A, 0x92, 0x80, 0x78, ++ 0xE4, 0xDD, 0xD1, 0x38, 0x0D, 0xC6, 0x35, 0x98, 0x18, 0xF7, 0xEC, 0x6C, ++ 0x43, 0x75, 0x37, 0x26, 0xFA, 0x13, 0x94, 0x48, 0xF2, 0xD0, 0x8B, 0x30, ++ 0x84, 0x54, 0xDF, 0x23, 0x19, 0x5B, 0x3D, 0x59, 0xF3, 0xAE, 0xA2, 0x82, ++ 0x63, 0x01, 0x83, 0x2E, 0xD9, 0x51, 0x9B, 0x7C, 0xA6, 0xEB, 0xA5, 0xBE, ++ 0x16, 0x0C, 0xE3, 0x61, 0xC0, 0x8C, 0x3A, 0xF5, 0x73, 0x2C, 0x25, 0x0B, ++ 0xBB, 0x4E, 0x89, 0x6B, 0x53, 0x6A, 0xB4, 0xF1, 0xE1, 0xE6, 0xBD, 0x45, ++ 0xE2, 0xF4, 0xB6, 0x66, 0xCC, 0x95, 0x03, 0x56, 0xD4, 0x1C, 0x1E, 0xD7, ++ 0xFB, 0xC3, 0x8E, 0xB5, 0xE9, 0xCF, 0xBF, 0xBA, 0xEA, 0x77, 0x39, 0xAF, ++ 0x33, 0xC9, 0x62, 0x71, 0x81, 0x79, 0x09, 0xAD, 0x24, 0xCD, 0xF9, 0xD8, ++ 0xE5, 0xC5, 0xB9, 0x4D, 0x44, 0x08, 0x86, 0xE7, 0xA1, 0x1D, 0xAA, 0xED, ++ 0x06, 0x70, 0xB2, 0xD2, 0x41, 0x7B, 0xA0, 0x11, 0x31, 0xC2, 0x27, 0x90, ++ 0x20, 0xF6, 0x60, 0xFF, 0x96, 0x5C, 0xB1, 0xAB, 0x9E, 0x9C, 0x52, 0x1B, ++ 0x5F, 0x93, 0x0A, 0xEF, 0x91, 0x85, 0x49, 0xEE, 0x2D, 0x4F, 0x8F, 0x3B, ++ 0x47, 0x87, 0x6D, 0x46, 0xD6, 0x3E, 0x69, 0x64, 0x2A, 0xCE, 0xCB, 0x2F, ++ 0xFC, 0x97, 0x05, 0x7A, 0xAC, 0x7F, 0xD5, 0x1A, 0x4B, 0x0E, 0xA7, 0x5A, ++ 0x28, 0x14, 0x3F, 0x29, 0x88, 0x3C, 0x4C, 0x02, 0xB8, 0xDA, 0xB0, 0x17, ++ 0x55, 0x1F, 0x8A, 0x7D, 0x57, 0xC7, 0x8D, 0x74, 0xB7, 0xC4, 0x9F, 0x72, ++ 0x7E, 0x15, 0x22, 0x12, 0x58, 0x07, 0x99, 0x34, 0x6E, 0x50, 0xDE, 0x68, ++ 0x65, 0xBC, 0xDB, 0xF8, 0xC8, 0xA8, 0x2B, 0x40, 0xDC, 0xFE, 0x32, 0xA4, ++ 0xCA, 0x10, 0x21, 0xF0, 0xD3, 0x5D, 0x0F, 0x00, 0x6F, 0x9D, 0x36, 0x42, ++ 0x4A, 0x5E, 0xC1, 0xE0 ++ }, ++ { /* p1 */ ++ 0x75, 0xF3, 0xC6, 0xF4, 0xDB, 0x7B, 0xFB, 0xC8, 0x4A, 0xD3, 0xE6, 0x6B, ++ 0x45, 0x7D, 0xE8, 0x4B, 0xD6, 0x32, 0xD8, 0xFD, 0x37, 0x71, 0xF1, 0xE1, ++ 0x30, 0x0F, 0xF8, 0x1B, 0x87, 0xFA, 0x06, 0x3F, 0x5E, 0xBA, 0xAE, 0x5B, ++ 0x8A, 0x00, 0xBC, 0x9D, 0x6D, 0xC1, 0xB1, 0x0E, 0x80, 0x5D, 0xD2, 0xD5, ++ 0xA0, 0x84, 0x07, 0x14, 0xB5, 0x90, 0x2C, 0xA3, 0xB2, 0x73, 0x4C, 0x54, ++ 0x92, 0x74, 0x36, 0x51, 0x38, 0xB0, 0xBD, 0x5A, 0xFC, 0x60, 0x62, 0x96, ++ 0x6C, 0x42, 0xF7, 0x10, 0x7C, 0x28, 0x27, 0x8C, 0x13, 0x95, 0x9C, 0xC7, ++ 0x24, 0x46, 0x3B, 0x70, 0xCA, 0xE3, 0x85, 0xCB, 0x11, 0xD0, 0x93, 0xB8, ++ 0xA6, 0x83, 0x20, 0xFF, 0x9F, 0x77, 0xC3, 0xCC, 0x03, 0x6F, 0x08, 0xBF, ++ 0x40, 0xE7, 0x2B, 0xE2, 0x79, 0x0C, 0xAA, 0x82, 0x41, 0x3A, 0xEA, 0xB9, ++ 0xE4, 0x9A, 0xA4, 0x97, 0x7E, 0xDA, 0x7A, 0x17, 0x66, 0x94, 0xA1, 0x1D, ++ 0x3D, 0xF0, 0xDE, 0xB3, 0x0B, 0x72, 0xA7, 0x1C, 0xEF, 0xD1, 0x53, 0x3E, ++ 0x8F, 0x33, 0x26, 0x5F, 0xEC, 0x76, 0x2A, 0x49, 0x81, 0x88, 0xEE, 0x21, ++ 0xC4, 0x1A, 0xEB, 0xD9, 0xC5, 0x39, 0x99, 0xCD, 0xAD, 0x31, 0x8B, 0x01, ++ 0x18, 0x23, 0xDD, 0x1F, 0x4E, 0x2D, 0xF9, 0x48, 0x4F, 0xF2, 0x65, 0x8E, ++ 0x78, 0x5C, 0x58, 0x19, 0x8D, 0xE5, 0x98, 0x57, 0x67, 0x7F, 0x05, 0x64, ++ 0xAF, 0x63, 0xB6, 0xFE, 0xF5, 0xB7, 0x3C, 0xA5, 0xCE, 0xE9, 0x68, 0x44, ++ 0xE0, 0x4D, 0x43, 0x69, 0x29, 0x2E, 0xAC, 0x15, 0x59, 0xA8, 0x0A, 0x9E, ++ 0x6E, 0x47, 0xDF, 0x34, 0x35, 0x6A, 0xCF, 0xDC, 0x22, 0xC9, 0xC0, 0x9B, ++ 0x89, 0xD4, 0xED, 0xAB, 0x12, 0xA2, 0x0D, 0x52, 0xBB, 0x02, 0x2F, 0xA9, ++ 0xD7, 0x61, 0x1E, 0xB4, 0x50, 0x04, 0xF6, 0xC2, 0x16, 0x25, 0x86, 0x56, ++ 0x55, 0x09, 0xBE, 0x91 ++ } ++}; ++ ++static bool TwoFish_MDSready=FALSE; ++static u_int32_t TwoFish_MDS[4][256]; /* TwoFish_MDS matrix */ ++ ++ ++#define TwoFish_LFSR1(x) (((x)>>1)^(((x)&0x01)?TwoFish_MDS_GF_FDBK/2:0)) ++#define TwoFish_LFSR2(x) (((x)>>2)^(((x)&0x02)?TwoFish_MDS_GF_FDBK/2:0)^(((x)&0x01)?TwoFish_MDS_GF_FDBK/4:0)) ++ ++#define TwoFish_Mx_1(x) ((u_int32_t)(x)) /* force result to dword so << will work */ ++#define TwoFish_Mx_X(x) ((u_int32_t)((x)^TwoFish_LFSR2(x))) /* 5B */ ++#define TwoFish_Mx_Y(x) ((u_int32_t)((x)^TwoFish_LFSR1(x)^TwoFish_LFSR2(x))) /* EF */ ++#define TwoFish_RS_rem(x) { u_int8_t b=(u_int8_t)(x>>24); u_int32_t g2=((b<<1)^((b&0x80)?TwoFish_RS_GF_FDBK:0))&0xFF; u_int32_t g3=((b>>1)&0x7F)^((b&1)?TwoFish_RS_GF_FDBK>>1:0)^g2; x=(x<<8)^(g3<<24)^(g2<<16)^(g3<<8)^b; } ++ ++/*#define TwoFish__b(x,N) (((u_int8_t *)&x)[((N)&3)^TwoFish_ADDR_XOR])*/ /* pick bytes out of a dword */ ++ ++#define TwoFish_b0(x) TwoFish__b(x,0) /* extract LSB of u_int32_t */ ++#define TwoFish_b1(x) TwoFish__b(x,1) ++#define TwoFish_b2(x) TwoFish__b(x,2) ++#define TwoFish_b3(x) TwoFish__b(x,3) /* extract MSB of u_int32_t */ ++ ++u_int8_t TwoFish__b(u_int32_t x,int n) ++{ n&=3; ++ while(n-->0) ++ x>>=8; ++ return (u_int8_t)x; ++} ++ ++ ++/* TwoFish Initialization ++ * ++ * This routine generates a global data structure for use with TwoFish, ++ * initializes important values (such as subkeys, sBoxes), generates subkeys ++ * and precomputes the MDS matrix if not already done. ++ * ++ * Input: User supplied password (will be appended by default password of 'SnortHas2FishEncryptionRoutines!') ++ * ++ * Output: Pointer to TWOFISH structure. This data structure contains key dependent data. ++ * This pointer is used with all other crypt functions. ++ */ ++ ++TWOFISH *TwoFishInit(char *userkey) ++{ TWOFISH *tfdata; ++ int i,x,m; ++ char tkey[TwoFish_KEY_LENGTH+40]; ++ ++ tfdata=malloc(sizeof(TWOFISH)); /* allocate the TwoFish structure */ ++ if(tfdata!=NULL) ++ { if(*userkey) ++ { strncpy(tkey,userkey,TwoFish_KEY_LENGTH); /* use first 32 chars of user supplied password */ ++ tkey[TwoFish_KEY_LENGTH]=0; /* make sure it wasn't more */ ++ } ++ else ++ strcpy(tkey,TwoFish_DEFAULT_PW); /* if no key defined, use default password */ ++ for(i=0,x=0,m=strlen(tkey);ikey[i]=tkey[x++]; /* fill the whole keyspace with repeating key. */ ++ if(x==m) ++ x=0; ++ } ++ ++ if(!TwoFish_MDSready) ++ _TwoFish_PrecomputeMDSmatrix(); /* "Wake Up, Neo" */ ++ _TwoFish_MakeSubKeys(tfdata); /* generate subkeys */ ++ _TwoFish_ResetCBC(tfdata); /* reset the CBC */ ++ tfdata->output=NULL; /* nothing to output yet */ ++ tfdata->dontflush=FALSE; /* reset decrypt skip block flag */ ++ if(TwoFish_srand) ++ { TwoFish_srand=FALSE; ++ srand(time(NULL)); ++ } ++ } ++ return tfdata; /* return the data pointer */ ++} ++ ++ ++void TwoFishDestroy(TWOFISH *tfdata) ++{ if(tfdata!=NULL) ++ free(tfdata); ++} ++ ++ ++/* en/decryption with CBC mode */ ++unsigned long _TwoFish_CryptRawCBC(char *in,char *out,unsigned long len,bool decrypt,TWOFISH *tfdata) ++{ unsigned long rl; ++ ++ rl=len; /* remember how much data to crypt. */ ++ while(len>TwoFish_BLOCK_SIZE) /* and now we process block by block. */ ++ { _TwoFish_BlockCrypt(in,out,TwoFish_BLOCK_SIZE,decrypt,tfdata); /* de/encrypt it. */ ++ in+=TwoFish_BLOCK_SIZE; /* adjust pointers. */ ++ out+=TwoFish_BLOCK_SIZE; ++ len-=TwoFish_BLOCK_SIZE; ++ } ++ if(len>0) /* if we have less than a block left... */ ++ _TwoFish_BlockCrypt(in,out,len,decrypt,tfdata); /* ...then we de/encrypt that too. */ ++ if(tfdata->qBlockDefined && !tfdata->dontflush) /* in case len was exactly one block... */ ++ _TwoFish_FlushOutput(tfdata->qBlockCrypt,TwoFish_BLOCK_SIZE,tfdata); /* ...we need to write the... */ ++ /* ...remaining bytes of the buffer */ ++ return rl; ++} ++ ++/* en/decryption on one block only */ ++unsigned long _TwoFish_CryptRaw16(char *in,char *out,unsigned long len,bool decrypt,TWOFISH *tfdata) ++{ /* qBlockPlain already zero'ed through ResetCBC */ ++ memcpy(tfdata->qBlockPlain,in,len); /* toss the data into it. */ ++ _TwoFish_BlockCrypt16(tfdata->qBlockPlain,tfdata->qBlockCrypt,decrypt,tfdata); /* encrypt just that block without CBC. */ ++ memcpy(out,tfdata->qBlockCrypt,TwoFish_BLOCK_SIZE); /* and return what we got */ ++ return TwoFish_BLOCK_SIZE; ++} ++ ++/* en/decryption without reset of CBC and output assignment */ ++unsigned long _TwoFish_CryptRaw(char *in,char *out,unsigned long len,bool decrypt,TWOFISH *tfdata) ++{ ++ if(in!=NULL && out!=NULL && len>0 && tfdata!=NULL) /* if we have valid data, then... */ ++ { if(len>TwoFish_BLOCK_SIZE) /* ...check if we have more than one block. */ ++ return _TwoFish_CryptRawCBC(in,out,len,decrypt,tfdata); /* if so, use the CBC routines... */ ++ else ++ return _TwoFish_CryptRaw16(in,out,len,decrypt,tfdata); /* ...otherwise just do one block. */ ++ } ++ return 0; ++} ++ ++ ++/* TwoFish Raw Encryption ++ * ++ * Does not use header, but does use CBC (if more than one block has to be encrypted). ++ * ++ * Input: Pointer to the buffer of the plaintext to be encrypted. ++ * Pointer to the buffer receiving the ciphertext. ++ * The length of the plaintext buffer. ++ * The TwoFish structure. ++ * ++ * Output: The amount of bytes encrypted if successful, otherwise 0. ++ */ ++ ++unsigned long TwoFishEncryptRaw(char *in, ++ char *out, ++ unsigned long len, ++ TWOFISH *tfdata) ++{ _TwoFish_ResetCBC(tfdata); /* reset CBC flag. */ ++ tfdata->output=out; /* output straight into output buffer. */ ++ return _TwoFish_CryptRaw(in,out,len,FALSE,tfdata); /* and go for it. */ ++} ++ ++/* TwoFish Raw Decryption ++ * ++ * Does not use header, but does use CBC (if more than one block has to be decrypted). ++ * ++ * Input: Pointer to the buffer of the ciphertext to be decrypted. ++ * Pointer to the buffer receiving the plaintext. ++ * The length of the ciphertext buffer (at least one cipher block). ++ * The TwoFish structure. ++ * ++ * Output: The amount of bytes decrypted if successful, otherwise 0. ++ */ ++ ++unsigned long TwoFishDecryptRaw(char *in, ++ char *out, ++ unsigned long len, ++ TWOFISH *tfdata) ++{ _TwoFish_ResetCBC(tfdata); /* reset CBC flag. */ ++ tfdata->output=out; /* output straight into output buffer. */ ++ return _TwoFish_CryptRaw(in,out,len,TRUE,tfdata); /* and go for it. */ ++} ++ ++/* TwoFish Free ++ * ++ * Free's the allocated buffer. ++ * ++ * Input: Pointer to the TwoFish structure ++ * ++ * Output: (none) ++ */ ++ ++void TwoFishFree(TWOFISH *tfdata) ++{ if(tfdata->output!=NULL) /* if a valid buffer is present... */ ++ { free(tfdata->output); /* ...then we free it for you... */ ++ tfdata->output=NULL; /* ...and mark as such. */ ++ } ++} ++ ++/* TwoFish Set Output ++ * ++ * If you want to allocate the output buffer yourself, ++ * then you can set it with this function. ++ * ++ * Input: Pointer to your output buffer ++ * Pointer to the TwoFish structure ++ * ++ * Output: (none) ++ */ ++ ++void TwoFishSetOutput(char *outp,TWOFISH *tfdata) ++{ tfdata->output=outp; /* (do we really need a function for this?) */ ++} ++ ++/* TwoFish Alloc ++ * ++ * Allocates enough memory for the output buffer that would be required ++ * ++ * Input: Length of the plaintext. ++ * Boolean flag for BinHex Output. ++ * Pointer to the TwoFish structure. ++ * ++ * Output: Returns a pointer to the memory allocated. ++ */ ++ ++void *TwoFishAlloc(unsigned long len,bool binhex,bool decrypt,TWOFISH *tfdata) ++{ ++/* TwoFishFree(tfdata); */ /* (don't for now) discard whatever was allocated earlier. */ ++ if(decrypt) /* if decrypting... */ ++ { if(binhex) /* ...and input is binhex encoded... */ ++ len/=2; /* ...use half as much for output. */ ++ len-=TwoFish_BLOCK_SIZE; /* Also, subtract the size of the header. */ ++ } ++ else ++ { len+=TwoFish_BLOCK_SIZE; /* the size is just increased by the header... */ ++ if(binhex) ++ len*=2; /* ...and doubled if output is to be binhexed. */ ++ } ++ tfdata->output=malloc(len+TwoFish_BLOCK_SIZE);/* grab some memory...plus some extra (it's running over somewhere, crashes without extra padding) */ ++ ++ return tfdata->output; /* ...and return to caller. */ ++} ++ ++/* bin2hex and hex2bin conversion */ ++void _TwoFish_BinHex(u_int8_t *buf,unsigned long len,bool bintohex) ++{ u_int8_t *pi,*po,c; ++ ++ if(bintohex) ++ { for(pi=buf+len-1,po=buf+(2*len)-1;len>0;pi--,po--,len--) /* let's start from the end of the bin block. */ ++ { c=*pi; /* grab value. */ ++ c&=15; /* use lower 4 bits. */ ++ if(c>9) /* convert to ascii. */ ++ c+=('a'-10); ++ else ++ c+='0'; ++ *po--=c; /* set the lower nibble. */ ++ c=*pi; /* grab value again. */ ++ c>>=4; /* right shift 4 bits. */ ++ c&=15; /* make sure we only have 4 bits. */ ++ if(c>9) /* convert to ascii. */ ++ c+=('a'-10); ++ else ++ c+='0'; ++ *po=c; /* set the higher nibble. */ ++ } /* and keep going. */ ++ } ++ else ++ { for(pi=buf,po=buf;len>0;pi++,po++,len-=2) /* let's start from the beginning of the hex block. */ ++ { c=tolower(*pi++)-'0'; /* grab higher nibble. */ ++ if(c>9) /* convert to value. */ ++ c-=('0'-9); ++ *po=c<<4; /* left shit 4 bits. */ ++ c=tolower(*pi)-'0'; /* grab lower nibble. */ ++ if(c>9) /* convert to value. */ ++ c-=('0'-9); ++ *po|=c; /* and add to value. */ ++ } ++ } ++} ++ ++ ++/* TwoFish Encryption ++ * ++ * Uses header and CBC. If the output area has not been intialized with TwoFishAlloc, ++ * this routine will alloc the memory. In addition, it will include a small 'header' ++ * containing the magic and some salt. That way the decrypt routine can check if the ++ * packet got decrypted successfully, and return 0 instead of garbage. ++ * ++ * Input: Pointer to the buffer of the plaintext to be encrypted. ++ * Pointer to the pointer to the buffer receiving the ciphertext. ++ * The pointer either points to user allocated output buffer space, or to NULL, in which case ++ * this routine will set the pointer to the buffer allocated through the struct. ++ * The length of the plaintext buffer. ++ * Can be -1 if the input is a null terminated string, in which case we'll count for you. ++ * Boolean flag for BinHex Output (if used, output will be twice as large as input). ++ * Note: BinHex conversion overwrites (converts) input buffer! ++ * The TwoFish structure. ++ * ++ * Output: The amount of bytes encrypted if successful, otherwise 0. ++ */ ++ ++unsigned long TwoFishEncrypt(char *in, ++ char **out, ++ signed long len, ++ bool binhex, ++ TWOFISH *tfdata) ++{ unsigned long ilen,olen; ++ ++ ++ if(len== -1) /* if we got -1 for len, we'll assume IN is a... */ ++ ilen=strlen(in); /* ...\0 terminated string and figure len out ourselves... */ ++ else ++ ilen=len; /* ...otherwise we trust you supply a correct length. */ ++ ++ if(in!=NULL && out!=NULL && ilen>0 && tfdata!=NULL) /* if we got usable stuff, we'll do it. */ ++ { if(*out==NULL) /* if OUT points to a NULL pointer... */ ++ *out=TwoFishAlloc(ilen,binhex,FALSE,tfdata); /* ...we'll (re-)allocate buffer space. */ ++ if(*out!=NULL) ++ { tfdata->output=*out; /* set output buffer. */ ++ tfdata->header.salt=rand()*65536+rand(); /* toss in some salt. */ ++ tfdata->header.length[0]= (u_int8_t)(ilen); ++ tfdata->header.length[1]= (u_int8_t)(ilen>>8); ++ tfdata->header.length[2]= (u_int8_t)(ilen>>16); ++ tfdata->header.length[3]= (u_int8_t)(ilen>>24); ++ memcpy(tfdata->header.magic,TwoFish_MAGIC,TwoFish_MAGIC_LEN); /* set the magic. */ ++ olen=TwoFish_BLOCK_SIZE; /* set output counter. */ ++ _TwoFish_ResetCBC(tfdata); /* reset the CBC flag */ ++ _TwoFish_BlockCrypt((u_int8_t *)&(tfdata->header),*out,olen,FALSE,tfdata); /* encrypt first block (without flush on 16 byte boundary). */ ++ olen+=_TwoFish_CryptRawCBC(in,*out+TwoFish_BLOCK_SIZE,ilen,FALSE,tfdata); /* and encrypt the rest (we do not reset the CBC flag). */ ++ if(binhex) /* if binhex... */ ++ { _TwoFish_BinHex(*out,olen,TRUE); /* ...convert output to binhex... */ ++ olen*=2; /* ...and size twice as large. */ ++ } ++ tfdata->output=*out; ++ return olen; ++ } ++ } ++ return 0; ++} ++ ++/* TwoFish Decryption ++ * ++ * Uses header and CBC. If the output area has not been intialized with TwoFishAlloc, ++ * this routine will alloc the memory. In addition, it will check the small 'header' ++ * containing the magic. If magic does not match we return 0. Otherwise we return the ++ * amount of bytes decrypted (should be the same as the length in the header). ++ * ++ * Input: Pointer to the buffer of the ciphertext to be decrypted. ++ * Pointer to the pointer to the buffer receiving the plaintext. ++ * The pointer either points to user allocated output buffer space, or to NULL, in which case ++ * this routine will set the pointer to the buffer allocated through the struct. ++ * The length of the ciphertext buffer. ++ * Can be -1 if the input is a null terminated binhex string, in which case we'll count for you. ++ * Boolean flag for BinHex Input (if used, plaintext will be half as large as input). ++ * Note: BinHex conversion overwrites (converts) input buffer! ++ * The TwoFish structure. ++ * ++ * Output: The amount of bytes decrypted if successful, otherwise 0. ++ */ ++ ++unsigned long TwoFishDecrypt(char *in, ++ char **out, ++ signed long len, ++ bool binhex, ++ TWOFISH *tfdata) ++{ unsigned long ilen,elen,olen; ++ const u_int8_t cmagic[TwoFish_MAGIC_LEN]=TwoFish_MAGIC; ++ u_int8_t *tbuf; ++ ++ ++ ++ if(len== -1) /* if we got -1 for len, we'll assume IN is... */ ++ ilen=strlen(in); /* ...\0 terminated binhex and figure len out ourselves... */ ++ else ++ ilen=len; /* ...otherwise we trust you supply a correct length. */ ++ ++ if(in!=NULL && out!=NULL && ilen>0 && tfdata!=NULL) /* if we got usable stuff, we'll do it. */ ++ { if(*out==NULL) /* if OUT points to a NULL pointer... */ ++ *out=TwoFishAlloc(ilen,binhex,TRUE,tfdata); /* ...we'll (re-)allocate buffer space. */ ++ if(*out!=NULL) ++ { if(binhex) /* if binhex... */ ++ { _TwoFish_BinHex(in,ilen,FALSE); /* ...convert input to values... */ ++ ilen/=2; /* ...and size half as much. */ ++ } ++ _TwoFish_ResetCBC(tfdata); /* reset the CBC flag. */ ++ ++ tbuf=(u_int8_t *)malloc(ilen+TwoFish_BLOCK_SIZE); /* get memory for data and header. */ ++ if(tbuf==NULL) ++ return 0; ++ tfdata->output=tbuf; /* set output to temp buffer. */ ++ ++ olen=_TwoFish_CryptRawCBC(in,tbuf,ilen,TRUE,tfdata)-TwoFish_BLOCK_SIZE; /* decrypt the whole thing. */ ++ memcpy(&(tfdata->header),tbuf,TwoFish_BLOCK_SIZE); /* copy first block into header. */ ++ tfdata->output=*out; ++ for(elen=0;elenheader.magic[elen]!=cmagic[elen]) ++ break; ++ if(elen==TwoFish_MAGIC_LEN) /* if magic matches then... */ ++ { elen=(tfdata->header.length[0]) | ++ (tfdata->header.length[1])<<8 | ++ (tfdata->header.length[2])<<16 | ++ (tfdata->header.length[3])<<24; /* .. we know how much to expect. */ ++ if(elen>olen) /* adjust if necessary. */ ++ elen=olen; ++ memcpy(*out,tbuf+TwoFish_BLOCK_SIZE,elen); /* copy data into intended output. */ ++ free(tbuf); ++ return elen; ++ } ++ free(tbuf); ++ } ++ } ++ return 0; ++} ++ ++void _TwoFish_PrecomputeMDSmatrix(void) /* precompute the TwoFish_MDS matrix */ ++{ u_int32_t m1[2]; ++ u_int32_t mX[2]; ++ u_int32_t mY[2]; ++ u_int32_t i, j; ++ ++ for (i = 0; i < 256; i++) ++ { j = TwoFish_P[0][i] & 0xFF; /* compute all the matrix elements */ ++ m1[0] = j; ++ mX[0] = TwoFish_Mx_X( j ) & 0xFF; ++ mY[0] = TwoFish_Mx_Y( j ) & 0xFF; ++ ++ j = TwoFish_P[1][i] & 0xFF; ++ m1[1] = j; ++ mX[1] = TwoFish_Mx_X( j ) & 0xFF; ++ mY[1] = TwoFish_Mx_Y( j ) & 0xFF; ++ ++ TwoFish_MDS[0][i] = m1[TwoFish_P_00] | /* fill matrix w/ above elements */ ++ mX[TwoFish_P_00] << 8 | ++ mY[TwoFish_P_00] << 16 | ++ mY[TwoFish_P_00] << 24; ++ TwoFish_MDS[1][i] = mY[TwoFish_P_10] | ++ mY[TwoFish_P_10] << 8 | ++ mX[TwoFish_P_10] << 16 | ++ m1[TwoFish_P_10] << 24; ++ TwoFish_MDS[2][i] = mX[TwoFish_P_20] | ++ mY[TwoFish_P_20] << 8 | ++ m1[TwoFish_P_20] << 16 | ++ mY[TwoFish_P_20] << 24; ++ TwoFish_MDS[3][i] = mX[TwoFish_P_30] | ++ m1[TwoFish_P_30] << 8 | ++ mY[TwoFish_P_30] << 16 | ++ mX[TwoFish_P_30] << 24; ++ } ++ TwoFish_MDSready=TRUE; ++} ++ ++ ++void _TwoFish_MakeSubKeys(TWOFISH *tfdata) /* Expand a user-supplied key material into a session key. */ ++{ u_int32_t k64Cnt = TwoFish_KEY_LENGTH / 8; ++ u_int32_t k32e[4]; /* even 32-bit entities */ ++ u_int32_t k32o[4]; /* odd 32-bit entities */ ++ u_int32_t sBoxKey[4]; ++ u_int32_t offset,i,j; ++ u_int32_t A, B, q=0; ++ u_int32_t k0,k1,k2,k3; ++ u_int32_t b0,b1,b2,b3; ++ ++ /* split user key material into even and odd 32-bit entities and */ ++ /* compute S-box keys using (12, 8) Reed-Solomon code over GF(256) */ ++ ++ ++ for (offset=0,i=0,j=k64Cnt-1;i<4 && offsetkey[offset++]; ++ k32e[i]|= tfdata->key[offset++]<<8; ++ k32e[i]|= tfdata->key[offset++]<<16; ++ k32e[i]|= tfdata->key[offset++]<<24; ++ k32o[i] = tfdata->key[offset++]; ++ k32o[i]|= tfdata->key[offset++]<<8; ++ k32o[i]|= tfdata->key[offset++]<<16; ++ k32o[i]|= tfdata->key[offset++]<<24; ++ sBoxKey[j] = _TwoFish_RS_MDS_Encode( k32e[i], k32o[i] ); /* reverse order */ ++ } ++ ++ /* compute the round decryption subkeys for PHT. these same subkeys */ ++ /* will be used in encryption but will be applied in reverse order. */ ++ i=0; ++ while(i < TwoFish_TOTAL_SUBKEYS) ++ { A = _TwoFish_F32( k64Cnt, q, k32e ); /* A uses even key entities */ ++ q += TwoFish_SK_BUMP; ++ ++ B = _TwoFish_F32( k64Cnt, q, k32o ); /* B uses odd key entities */ ++ q += TwoFish_SK_BUMP; ++ ++ B = B << 8 | B >> 24; ++ ++ A += B; ++ tfdata->subKeys[i++] = A; /* combine with a PHT */ ++ ++ A += B; ++ tfdata->subKeys[i++] = A << TwoFish_SK_ROTL | A >> (32-TwoFish_SK_ROTL); ++ } ++ ++ /* fully expand the table for speed */ ++ k0 = sBoxKey[0]; ++ k1 = sBoxKey[1]; ++ k2 = sBoxKey[2]; ++ k3 = sBoxKey[3]; ++ ++ for (i = 0; i < 256; i++) ++ { b0 = b1 = b2 = b3 = i; ++ switch (k64Cnt & 3) ++ { case 1: /* 64-bit keys */ ++ tfdata->sBox[ 2*i ] = TwoFish_MDS[0][(TwoFish_P[TwoFish_P_01][b0]) ^ TwoFish_b0(k0)]; ++ tfdata->sBox[ 2*i+1] = TwoFish_MDS[1][(TwoFish_P[TwoFish_P_11][b1]) ^ TwoFish_b1(k0)]; ++ tfdata->sBox[0x200+2*i ] = TwoFish_MDS[2][(TwoFish_P[TwoFish_P_21][b2]) ^ TwoFish_b2(k0)]; ++ tfdata->sBox[0x200+2*i+1] = TwoFish_MDS[3][(TwoFish_P[TwoFish_P_31][b3]) ^ TwoFish_b3(k0)]; ++ break; ++ case 0: /* 256-bit keys (same as 4) */ ++ b0 = (TwoFish_P[TwoFish_P_04][b0]) ^ TwoFish_b0(k3); ++ b1 = (TwoFish_P[TwoFish_P_14][b1]) ^ TwoFish_b1(k3); ++ b2 = (TwoFish_P[TwoFish_P_24][b2]) ^ TwoFish_b2(k3); ++ b3 = (TwoFish_P[TwoFish_P_34][b3]) ^ TwoFish_b3(k3); ++ case 3: /* 192-bit keys */ ++ b0 = (TwoFish_P[TwoFish_P_03][b0]) ^ TwoFish_b0(k2); ++ b1 = (TwoFish_P[TwoFish_P_13][b1]) ^ TwoFish_b1(k2); ++ b2 = (TwoFish_P[TwoFish_P_23][b2]) ^ TwoFish_b2(k2); ++ b3 = (TwoFish_P[TwoFish_P_33][b3]) ^ TwoFish_b3(k2); ++ case 2: /* 128-bit keys */ ++ tfdata->sBox[ 2*i ]= ++ TwoFish_MDS[0][(TwoFish_P[TwoFish_P_01][(TwoFish_P[TwoFish_P_02][b0]) ^ ++ TwoFish_b0(k1)]) ^ TwoFish_b0(k0)]; ++ ++ tfdata->sBox[ 2*i+1]= ++ TwoFish_MDS[1][(TwoFish_P[TwoFish_P_11][(TwoFish_P[TwoFish_P_12][b1]) ^ ++ TwoFish_b1(k1)]) ^ TwoFish_b1(k0)]; ++ ++ tfdata->sBox[0x200+2*i ]= ++ TwoFish_MDS[2][(TwoFish_P[TwoFish_P_21][(TwoFish_P[TwoFish_P_22][b2]) ^ ++ TwoFish_b2(k1)]) ^ TwoFish_b2(k0)]; ++ ++ tfdata->sBox[0x200+2*i+1]= ++ TwoFish_MDS[3][(TwoFish_P[TwoFish_P_31][(TwoFish_P[TwoFish_P_32][b3]) ^ ++ TwoFish_b3(k1)]) ^ TwoFish_b3(k0)]; ++ } ++ } ++} ++ ++ ++/** ++ * Encrypt or decrypt exactly one block of plaintext in CBC mode. ++ * Use "ciphertext stealing" technique described on pg. 196 ++ * of "Applied Cryptography" to encrypt the final partial ++ * (i.e. <16 byte) block if necessary. ++ * ++ * jojo: the "ciphertext stealing" requires we read ahead and have ++ * special handling for the last two blocks. Because of this, the ++ * output from the TwoFish algorithm is handled internally here. ++ * It would be better to have a higher level handle this as well as ++ * CBC mode. Unfortunately, I've mixed the two together, which is ++ * pretty crappy... The Java version separates these out correctly. ++ * ++ * fknobbe: I have reduced the CBC mode to work on memory buffer only. ++ * Higher routines should use an intermediate buffer and handle ++ * their output seperately (mainly so the data can be flushed ++ * in one chunk, not seperate 16 byte blocks...) ++ * ++ * @param in The plaintext. ++ * @param out The ciphertext ++ * @param size how much to encrypt ++ * @param tfdata: Pointer to the global data structure containing session keys. ++ * @return none ++ */ ++void _TwoFish_BlockCrypt(u_int8_t *in,u_int8_t *out,unsigned long size,int decrypt,TWOFISH *tfdata) ++{ u_int8_t PnMinusOne[TwoFish_BLOCK_SIZE]; ++ u_int8_t CnMinusOne[TwoFish_BLOCK_SIZE]; ++ u_int8_t CBCplusCprime[TwoFish_BLOCK_SIZE]; ++ u_int8_t Pn[TwoFish_BLOCK_SIZE]; ++ u_int8_t *p,*pout; ++ unsigned long i; ++ ++ /* here is where we implement CBC mode and cipher block stealing */ ++ if(size==TwoFish_BLOCK_SIZE) ++ { /* if we are encrypting, CBC means we XOR the plain text block with the */ ++ /* previous cipher text block before encrypting */ ++ if(!decrypt && tfdata->qBlockDefined) ++ { for(p=in,i=0;iqBlockCrypt[i]; /* FK: I'm copying the xor'ed input into Pn... */ ++ } ++ else ++ memcpy(Pn,in,TwoFish_BLOCK_SIZE); /* FK: same here. we work of Pn all the time. */ ++ ++ /* TwoFish block level encryption or decryption */ ++ _TwoFish_BlockCrypt16(Pn,out,decrypt,tfdata); ++ ++ /* if we are decrypting, CBC means we XOR the result of the decryption */ ++ /* with the previous cipher text block to get the resulting plain text */ ++ if(decrypt && tfdata->qBlockDefined) ++ { for (p=out,i=0;iqBlockPlain[i]; ++ } ++ ++ /* save the input and output blocks, since CBC needs these for XOR */ ++ /* operations */ ++ _TwoFish_qBlockPush(Pn,out,tfdata); ++ } ++ else ++ { /* cipher block stealing, we are at Pn, */ ++ /* but since Cn-1 must now be replaced with CnC' */ ++ /* we pop it off, and recalculate Cn-1 */ ++ ++ if(decrypt) ++ { /* We are on an odd block, and had to do cipher block stealing, */ ++ /* so the PnMinusOne has to be derived differently. */ ++ ++ /* First we decrypt it into CBC and C' */ ++ _TwoFish_qBlockPop(CnMinusOne,PnMinusOne,tfdata); ++ _TwoFish_BlockCrypt16(CnMinusOne,CBCplusCprime,decrypt,tfdata); ++ ++ /* we then xor the first few bytes with the "in" bytes (Cn) */ ++ /* to recover Pn, which we put in out */ ++ for(p=in,pout=out,i=0;iprevCipher[i]; ++ ++ /* So at this point, out has PnMinusOne */ ++ _TwoFish_qBlockPush(CnMinusOne,PnMinusOne,tfdata); ++ _TwoFish_FlushOutput(tfdata->qBlockCrypt,TwoFish_BLOCK_SIZE,tfdata); ++ _TwoFish_FlushOutput(out,size,tfdata); ++ } ++ else ++ { _TwoFish_qBlockPop(PnMinusOne,CnMinusOne,tfdata); ++ memset(Pn,0,TwoFish_BLOCK_SIZE); ++ memcpy(Pn,in,size); ++ for(i=0;iqBlockCrypt,TwoFish_BLOCK_SIZE,tfdata); ++ _TwoFish_FlushOutput(CnMinusOne,size,tfdata); /* old Cn-1 becomes new partial Cn */ ++ } ++ tfdata->qBlockDefined=FALSE; ++ } ++} ++ ++void _TwoFish_qBlockPush(u_int8_t *p,u_int8_t *c,TWOFISH *tfdata) ++{ if(tfdata->qBlockDefined) ++ _TwoFish_FlushOutput(tfdata->qBlockCrypt,TwoFish_BLOCK_SIZE,tfdata); ++ memcpy(tfdata->prevCipher,tfdata->qBlockPlain,TwoFish_BLOCK_SIZE); ++ memcpy(tfdata->qBlockPlain,p,TwoFish_BLOCK_SIZE); ++ memcpy(tfdata->qBlockCrypt,c,TwoFish_BLOCK_SIZE); ++ tfdata->qBlockDefined=TRUE; ++} ++ ++void _TwoFish_qBlockPop(u_int8_t *p,u_int8_t *c,TWOFISH *tfdata) ++{ memcpy(p,tfdata->qBlockPlain,TwoFish_BLOCK_SIZE ); ++ memcpy(c,tfdata->qBlockCrypt,TwoFish_BLOCK_SIZE ); ++ tfdata->qBlockDefined=FALSE; ++} ++ ++/* Reset's the CBC flag and zero's PrevCipher (through qBlockPlain) (important) */ ++void _TwoFish_ResetCBC(TWOFISH *tfdata) ++{ tfdata->qBlockDefined=FALSE; ++ memset(tfdata->qBlockPlain,0,TwoFish_BLOCK_SIZE); ++} ++ ++void _TwoFish_FlushOutput(u_int8_t *b,unsigned long len,TWOFISH *tfdata) ++{ unsigned long i; ++ ++ for(i=0;idontflush;i++) ++ *tfdata->output++ = *b++; ++ tfdata->dontflush=FALSE; ++} ++ ++void _TwoFish_BlockCrypt16(u_int8_t *in,u_int8_t *out,bool decrypt,TWOFISH *tfdata) ++{ u_int32_t x0,x1,x2,x3; ++ u_int32_t k,t0,t1,R; ++ ++ ++ x0=*in++; ++ x0|=(*in++ << 8 ); ++ x0|=(*in++ << 16); ++ x0|=(*in++ << 24); ++ x1=*in++; ++ x1|=(*in++ << 8 ); ++ x1|=(*in++ << 16); ++ x1|=(*in++ << 24); ++ x2=*in++; ++ x2|=(*in++ << 8 ); ++ x2|=(*in++ << 16); ++ x2|=(*in++ << 24); ++ x3=*in++; ++ x3|=(*in++ << 8 ); ++ x3|=(*in++ << 16); ++ x3|=(*in++ << 24); ++ ++ if(decrypt) ++ { x0 ^= tfdata->subKeys[4]; /* swap input and output whitening keys when decrypting */ ++ x1 ^= tfdata->subKeys[5]; ++ x2 ^= tfdata->subKeys[6]; ++ x3 ^= tfdata->subKeys[7]; ++ ++ k = 7+(TwoFish_ROUNDS*2); ++ for (R = 0; R < TwoFish_ROUNDS; R += 2) ++ { t0 = _TwoFish_Fe320( tfdata->sBox, x0); ++ t1 = _TwoFish_Fe323( tfdata->sBox, x1); ++ x3 ^= t0 + (t1<<1) + tfdata->subKeys[k--]; ++ x3 = x3 >> 1 | x3 << 31; ++ x2 = x2 << 1 | x2 >> 31; ++ x2 ^= t0 + t1 + tfdata->subKeys[k--]; ++ ++ t0 = _TwoFish_Fe320( tfdata->sBox, x2); ++ t1 = _TwoFish_Fe323( tfdata->sBox, x3); ++ x1 ^= t0 + (t1<<1) + tfdata->subKeys[k--]; ++ x1 = x1 >> 1 | x1 << 31; ++ x0 = x0 << 1 | x0 >> 31; ++ x0 ^= t0 + t1 + tfdata->subKeys[k--]; ++ } ++ ++ x2 ^= tfdata->subKeys[0]; ++ x3 ^= tfdata->subKeys[1]; ++ x0 ^= tfdata->subKeys[2]; ++ x1 ^= tfdata->subKeys[3]; ++ } ++ else ++ { x0 ^= tfdata->subKeys[0]; ++ x1 ^= tfdata->subKeys[1]; ++ x2 ^= tfdata->subKeys[2]; ++ x3 ^= tfdata->subKeys[3]; ++ ++ k = 8; ++ for (R = 0; R < TwoFish_ROUNDS; R += 2) ++ { t0 = _TwoFish_Fe320( tfdata->sBox, x0); ++ t1 = _TwoFish_Fe323( tfdata->sBox, x1); ++ x2 ^= t0 + t1 + tfdata->subKeys[k++]; ++ x2 = x2 >> 1 | x2 << 31; ++ x3 = x3 << 1 | x3 >> 31; ++ x3 ^= t0 + (t1<<1) + tfdata->subKeys[k++]; ++ ++ t0 = _TwoFish_Fe320( tfdata->sBox, x2); ++ t1 = _TwoFish_Fe323( tfdata->sBox, x3); ++ x0 ^= t0 + t1 + tfdata->subKeys[k++]; ++ x0 = x0 >> 1 | x0 << 31; ++ x1 = x1 << 1 | x1 >> 31; ++ x1 ^= t0 + (t1<<1) + tfdata->subKeys[k++]; ++ } ++ ++ x2 ^= tfdata->subKeys[4]; ++ x3 ^= tfdata->subKeys[5]; ++ x0 ^= tfdata->subKeys[6]; ++ x1 ^= tfdata->subKeys[7]; ++ } ++ ++ *out++ = (u_int8_t)(x2 ); ++ *out++ = (u_int8_t)(x2 >> 8); ++ *out++ = (u_int8_t)(x2 >> 16); ++ *out++ = (u_int8_t)(x2 >> 24); ++ ++ *out++ = (u_int8_t)(x3 ); ++ *out++ = (u_int8_t)(x3 >> 8); ++ *out++ = (u_int8_t)(x3 >> 16); ++ *out++ = (u_int8_t)(x3 >> 24); ++ ++ *out++ = (u_int8_t)(x0 ); ++ *out++ = (u_int8_t)(x0 >> 8); ++ *out++ = (u_int8_t)(x0 >> 16); ++ *out++ = (u_int8_t)(x0 >> 24); ++ ++ *out++ = (u_int8_t)(x1 ); ++ *out++ = (u_int8_t)(x1 >> 8); ++ *out++ = (u_int8_t)(x1 >> 16); ++ *out++ = (u_int8_t)(x1 >> 24); ++} ++ ++/** ++ * Use (12, 8) Reed-Solomon code over GF(256) to produce a key S-box ++ * 32-bit entity from two key material 32-bit entities. ++ * ++ * @param k0 1st 32-bit entity. ++ * @param k1 2nd 32-bit entity. ++ * @return Remainder polynomial generated using RS code ++ */ ++u_int32_t _TwoFish_RS_MDS_Encode(u_int32_t k0,u_int32_t k1) ++{ u_int32_t i,r; ++ ++ for(r=k1,i=0;i<4;i++) /* shift 1 byte at a time */ ++ TwoFish_RS_rem(r); ++ r ^= k0; ++ for(i=0;i<4;i++) ++ TwoFish_RS_rem(r); ++ ++ return r; ++} ++ ++u_int32_t _TwoFish_F32(u_int32_t k64Cnt,u_int32_t x,u_int32_t *k32) ++{ u_int8_t b0,b1,b2,b3; ++ u_int32_t k0,k1,k2,k3,result = 0; ++ ++ b0=TwoFish_b0(x); ++ b1=TwoFish_b1(x); ++ b2=TwoFish_b2(x); ++ b3=TwoFish_b3(x); ++ k0=k32[0]; ++ k1=k32[1]; ++ k2=k32[2]; ++ k3=k32[3]; ++ ++ switch (k64Cnt & 3) ++ { case 1: /* 64-bit keys */ ++ result = ++ TwoFish_MDS[0][(TwoFish_P[TwoFish_P_01][b0] & 0xFF) ^ TwoFish_b0(k0)] ^ ++ TwoFish_MDS[1][(TwoFish_P[TwoFish_P_11][b1] & 0xFF) ^ TwoFish_b1(k0)] ^ ++ TwoFish_MDS[2][(TwoFish_P[TwoFish_P_21][b2] & 0xFF) ^ TwoFish_b2(k0)] ^ ++ TwoFish_MDS[3][(TwoFish_P[TwoFish_P_31][b3] & 0xFF) ^ TwoFish_b3(k0)]; ++ break; ++ case 0: /* 256-bit keys (same as 4) */ ++ b0 = (TwoFish_P[TwoFish_P_04][b0] & 0xFF) ^ TwoFish_b0(k3); ++ b1 = (TwoFish_P[TwoFish_P_14][b1] & 0xFF) ^ TwoFish_b1(k3); ++ b2 = (TwoFish_P[TwoFish_P_24][b2] & 0xFF) ^ TwoFish_b2(k3); ++ b3 = (TwoFish_P[TwoFish_P_34][b3] & 0xFF) ^ TwoFish_b3(k3); ++ ++ case 3: /* 192-bit keys */ ++ b0 = (TwoFish_P[TwoFish_P_03][b0] & 0xFF) ^ TwoFish_b0(k2); ++ b1 = (TwoFish_P[TwoFish_P_13][b1] & 0xFF) ^ TwoFish_b1(k2); ++ b2 = (TwoFish_P[TwoFish_P_23][b2] & 0xFF) ^ TwoFish_b2(k2); ++ b3 = (TwoFish_P[TwoFish_P_33][b3] & 0xFF) ^ TwoFish_b3(k2); ++ case 2: /* 128-bit keys (optimize for this case) */ ++ result = ++ TwoFish_MDS[0][(TwoFish_P[TwoFish_P_01][(TwoFish_P[TwoFish_P_02][b0] & 0xFF) ^ TwoFish_b0(k1)] & 0xFF) ^ TwoFish_b0(k0)] ^ ++ TwoFish_MDS[1][(TwoFish_P[TwoFish_P_11][(TwoFish_P[TwoFish_P_12][b1] & 0xFF) ^ TwoFish_b1(k1)] & 0xFF) ^ TwoFish_b1(k0)] ^ ++ TwoFish_MDS[2][(TwoFish_P[TwoFish_P_21][(TwoFish_P[TwoFish_P_22][b2] & 0xFF) ^ TwoFish_b2(k1)] & 0xFF) ^ TwoFish_b2(k0)] ^ ++ TwoFish_MDS[3][(TwoFish_P[TwoFish_P_31][(TwoFish_P[TwoFish_P_32][b3] & 0xFF) ^ TwoFish_b3(k1)] & 0xFF) ^ TwoFish_b3(k0)]; ++ break; ++ } ++ return result; ++} ++ ++u_int32_t _TwoFish_Fe320(u_int32_t *lsBox,u_int32_t x) ++{ return lsBox[ TwoFish_b0(x)<<1 ]^ ++ lsBox[ ((TwoFish_b1(x)<<1)|1)]^ ++ lsBox[0x200+ (TwoFish_b2(x)<<1) ]^ ++ lsBox[0x200+((TwoFish_b3(x)<<1)|1)]; ++} ++ ++u_int32_t _TwoFish_Fe323(u_int32_t *lsBox,u_int32_t x) ++{ return lsBox[ (TwoFish_b3(x)<<1) ]^ ++ lsBox[ ((TwoFish_b0(x)<<1)|1)]^ ++ lsBox[0x200+ (TwoFish_b1(x)<<1) ]^ ++ lsBox[0x200+((TwoFish_b2(x)<<1)|1)]; ++} ++ ++u_int32_t _TwoFish_Fe32(u_int32_t *lsBox,u_int32_t x,u_int32_t R) ++{ return lsBox[ 2*TwoFish__b(x,R ) ]^ ++ lsBox[ 2*TwoFish__b(x,R+1)+1]^ ++ lsBox[0x200+2*TwoFish__b(x,R+2) ]^ ++ lsBox[0x200+2*TwoFish__b(x,R+3)+1]; ++} ++ ++ ++#endif +diff -ruN snort-2.9.2.2/src/twofish.h snort-2.9.2.2_bkup/src/twofish.h +--- snort-2.9.2.2/src/twofish.h 1969-12-31 16:00:00.000000000 -0800 ++++ snort-2.9.2.2_bkup/src/twofish.h 2012-04-08 20:34:57.389687124 -0700 +@@ -0,0 +1,276 @@ ++/* $Id: twofish.h,v 2.1 2008/12/15 20:36:05 fknobbe Exp $ ++ * ++ * ++ * Copyright (C) 1997-2000 The Cryptix Foundation Limited. ++ * Copyright (C) 2000 Farm9. ++ * Copyright (C) 2001 Frank Knobbe. ++ * All rights reserved. ++ * ++ * For Cryptix code: ++ * Use, modification, copying and distribution of this software is subject ++ * the terms and conditions of the Cryptix General Licence. You should have ++ * received a copy of the Cryptix General Licence along with this library; ++ * if not, you can download a copy from http://www.cryptix.org/ . ++ * ++ * For Farm9: ++ * --- jojo@farm9.com, August 2000, converted from Java to C++, added CBC mode and ++ * ciphertext stealing technique, added AsciiTwofish class for easy encryption ++ * decryption of text strings ++ * ++ * Frank Knobbe : ++ * --- April 2001, converted from C++ to C, prefixed global variables ++ * with TwoFish, substituted some defines, changed functions to make use of ++ * variables supplied in a struct, modified and added routines for modular calls. ++ * Cleaned up the code so that defines are used instead of fixed 16's and 32's. ++ * Created two general purpose crypt routines for one block and multiple block ++ * encryption using Joh's CBC code. ++ * Added crypt routines that use a header (with a magic and data length). ++ * (Basically a major rewrite). ++ * ++ * Note: Routines labeled _TwoFish are private and should not be used ++ * (or with extreme caution). ++ * ++ */ ++ ++#ifndef __TWOFISH_LIBRARY_HEADER__ ++#define __TWOFISH_LIBRARY_HEADER__ ++ ++#ifndef FALSE ++#define FALSE 0 ++#endif ++#ifndef TRUE ++#define TRUE !FALSE ++#endif ++#ifndef bool ++#define bool int ++#endif ++ ++ ++/* Constants */ ++ ++#define TwoFish_DEFAULT_PW "SnortHas2FishEncryptionRoutines!" /* default password (not more than 32 chars) */ ++#define TwoFish_MAGIC "TwoFish" /* to indentify a successful decryption */ ++ ++enum ++{ TwoFish_KEY_SIZE = 256, /* Valid values: 64, 128, 192, 256 */ ++ /* User 256, other key sizes have not been tested. */ ++ /* (But should work. I substituted as much as */ ++ /* I could with this define.) */ ++ TwoFish_ROUNDS = 16, ++ TwoFish_BLOCK_SIZE = 16, /* bytes in a data-block */ ++ TwoFish_KEY_LENGTH = TwoFish_KEY_SIZE/8, /* 32= 256-bit key */ ++ TwoFish_TOTAL_SUBKEYS = 4+4+2*TwoFish_ROUNDS, ++ TwoFish_MAGIC_LEN = TwoFish_BLOCK_SIZE-8, ++ TwoFish_SK_BUMP = 0x01010101, ++ TwoFish_SK_ROTL = 9, ++ TwoFish_P_00 = 1, ++ TwoFish_P_01 = 0, ++ TwoFish_P_02 = 0, ++ TwoFish_P_03 = TwoFish_P_01 ^ 1, ++ TwoFish_P_04 = 1, ++ TwoFish_P_10 = 0, ++ TwoFish_P_11 = 0, ++ TwoFish_P_12 = 1, ++ TwoFish_P_13 = TwoFish_P_11 ^ 1, ++ TwoFish_P_14 = 0, ++ TwoFish_P_20 = 1, ++ TwoFish_P_21 = 1, ++ TwoFish_P_22 = 0, ++ TwoFish_P_23 = TwoFish_P_21 ^ 1, ++ TwoFish_P_24 = 0, ++ TwoFish_P_30 = 0, ++ TwoFish_P_31 = 1, ++ TwoFish_P_32 = 1, ++ TwoFish_P_33 = TwoFish_P_31 ^ 1, ++ TwoFish_P_34 = 1, ++ TwoFish_GF256_FDBK = 0x169, ++ TwoFish_GF256_FDBK_2 = 0x169 / 2, ++ TwoFish_GF256_FDBK_4 = 0x169 / 4, ++ TwoFish_RS_GF_FDBK = 0x14D, /* field generator */ ++ TwoFish_MDS_GF_FDBK = 0x169 /* primitive polynomial for GF(256) */ ++}; ++ ++ ++/* Global data structure for callers */ ++ ++typedef struct ++{ u_int32_t sBox[4 * 256]; /* Key dependent S-box */ ++ u_int32_t subKeys[TwoFish_TOTAL_SUBKEYS]; /* Subkeys */ ++ u_int8_t key[TwoFish_KEY_LENGTH]; /* Encryption Key */ ++ u_int8_t *output; /* Pointer to output buffer */ ++ u_int8_t qBlockPlain[TwoFish_BLOCK_SIZE]; /* Used by CBC */ ++ u_int8_t qBlockCrypt[TwoFish_BLOCK_SIZE]; ++ u_int8_t prevCipher[TwoFish_BLOCK_SIZE]; ++ struct /* Header for crypt functions. Has to be at least one block long. */ ++ { u_int32_t salt; /* Random salt in first block (will salt the rest through CBC) */ ++ u_int8_t length[4]; /* The amount of data following the header */ ++ u_int8_t magic[TwoFish_MAGIC_LEN]; /* Magic to identify successful decryption */ ++ } header; ++ bool qBlockDefined; ++ bool dontflush; ++} TWOFISH; ++ ++#ifndef __TWOFISH_LIBRARY_SOURCE__ ++ ++extern bool TwoFish_srand; /* if set to TRUE (default), first call of TwoFishInit will seed rand(); */ ++ /* call of TwoFishInit */ ++#endif ++ ++ ++/**** Public Functions ****/ ++ ++/* TwoFish Initialization ++ * ++ * This routine generates a global data structure for use with TwoFish, ++ * initializes important values (such as subkeys, sBoxes), generates subkeys ++ * and precomputes the MDS matrix if not already done. ++ * ++ * Input: User supplied password (will be appended by default password of 'SnortHas2FishEncryptionRoutines!') ++ * ++ * Output: Pointer to TWOFISH structure. This data structure contains key dependent data. ++ * This pointer is used with all other crypt functions. ++ */ ++TWOFISH *TwoFishInit(char *userkey); ++ ++ ++/* TwoFish Destroy ++ * ++ * Nothing else but a free... ++ * ++ * Input: Pointer to the TwoFish structure. ++ * ++ */ ++void TwoFishDestroy(TWOFISH *tfdata); ++ ++ ++/* TwoFish Alloc ++ * ++ * Allocates enough memory for the output buffer as required. ++ * ++ * Input: Length of the plaintext. ++ * Boolean flag for BinHex Output. ++ * Pointer to the TwoFish structure. ++ * ++ * Output: Returns a pointer to the memory allocated. ++ */ ++void *TwoFishAlloc(unsigned long len,bool binhex,bool decrypt,TWOFISH *tfdata); ++ ++ ++/* TwoFish Free ++ * ++ * Free's the allocated buffer. ++ * ++ * Input: Pointer to the TwoFish structure ++ * ++ * Output: (none) ++ */ ++void TwoFishFree(TWOFISH *tfdata); ++ ++ ++/* TwoFish Set Output ++ * ++ * If you want to allocate the output buffer yourself, ++ * then you can set it with this function. ++ * ++ * Input: Pointer to your output buffer ++ * Pointer to the TwoFish structure ++ * ++ * Output: (none) ++ */ ++void TwoFishSetOutput(char *outp,TWOFISH *tfdata); ++ ++ ++/* TwoFish Raw Encryption ++ * ++ * Does not use header, but does use CBC (if more than one block has to be encrypted). ++ * ++ * Input: Pointer to the buffer of the plaintext to be encrypted. ++ * Pointer to the buffer receiving the ciphertext. ++ * The length of the plaintext buffer. ++ * The TwoFish structure. ++ * ++ * Output: The amount of bytes encrypted if successful, otherwise 0. ++ */ ++unsigned long TwoFishEncryptRaw(char *in,char *out,unsigned long len,TWOFISH *tfdata); ++ ++/* TwoFish Raw Decryption ++ * ++ * Does not use header, but does use CBC (if more than one block has to be decrypted). ++ * ++ * Input: Pointer to the buffer of the ciphertext to be decrypted. ++ * Pointer to the buffer receiving the plaintext. ++ * The length of the ciphertext buffer (at least one cipher block). ++ * The TwoFish structure. ++ * ++ * Output: The amount of bytes decrypted if successful, otherwise 0. ++ */ ++unsigned long TwoFishDecryptRaw(char *in,char *out,unsigned long len,TWOFISH *tfdata); ++ ++ ++/* TwoFish Encryption ++ * ++ * Uses header and CBC. If the output area has not been intialized with TwoFishAlloc, ++ * this routine will alloc the memory. In addition, it will include a small 'header' ++ * containing the magic and some salt. That way the decrypt routine can check if the ++ * packet got decrypted successfully, and return 0 instead of garbage. ++ * ++ * Input: Pointer to the buffer of the plaintext to be encrypted. ++ * Pointer to the pointer to the buffer receiving the ciphertext. ++ * The pointer either points to user allocated output buffer space, or to NULL, in which case ++ * this routine will set the pointer to the buffer allocated through the struct. ++ * The length of the plaintext buffer. ++ * Can be -1 if the input is a null terminated string, in which case we'll count for you. ++ * Boolean flag for BinHex Output (if used, output will be twice as large as input). ++ * Note: BinHex conversion overwrites (converts) input buffer! ++ * The TwoFish structure. ++ * ++ * Output: The amount of bytes encrypted if successful, otherwise 0. ++ */ ++unsigned long TwoFishEncrypt(char *in,char **out,signed long len,bool binhex,TWOFISH *tfdata); ++ ++ ++/* TwoFish Decryption ++ * ++ * Uses header and CBC. If the output area has not been intialized with TwoFishAlloc, ++ * this routine will alloc the memory. In addition, it will check the small 'header' ++ * containing the magic. If magic does not match we return 0. Otherwise we return the ++ * amount of bytes decrypted (should be the same as the length in the header). ++ * ++ * Input: Pointer to the buffer of the ciphertext to be decrypted. ++ * Pointer to the pointer to the buffer receiving the plaintext. ++ * The pointer either points to user allocated output buffer space, or to NULL, in which case ++ * this routine will set the pointer to the buffer allocated through the struct. ++ * The length of the ciphertext buffer. ++ * Can be -1 if the input is a null terminated binhex string, in which case we'll count for you. ++ * Boolean flag for BinHex Input (if used, plaintext will be half as large as input). ++ * Note: BinHex conversion overwrites (converts) input buffer! ++ * The TwoFish structure. ++ * ++ * Output: The amount of bytes decrypted if successful, otherwise 0. ++ */ ++unsigned long TwoFishDecrypt(char *in,char **out,signed long len,bool binhex,TWOFISH *tfdata); ++ ++ ++/**** Private Functions ****/ ++ ++u_int8_t TwoFish__b(u_int32_t x,int n); ++void _TwoFish_BinHex(u_int8_t *buf,unsigned long len,bool bintohex); ++unsigned long _TwoFish_CryptRawCBC(char *in,char *out,unsigned long len,bool decrypt,TWOFISH *tfdata); ++unsigned long _TwoFish_CryptRaw16(char *in,char *out,unsigned long len,bool decrypt,TWOFISH *tfdata); ++unsigned long _TwoFish_CryptRaw(char *in,char *out,unsigned long len,bool decrypt,TWOFISH *tfdata); ++void _TwoFish_PrecomputeMDSmatrix(void); ++void _TwoFish_MakeSubKeys(TWOFISH *tfdata); ++void _TwoFish_qBlockPush(u_int8_t *p,u_int8_t *c,TWOFISH *tfdata); ++void _TwoFish_qBlockPop(u_int8_t *p,u_int8_t *c,TWOFISH *tfdata); ++void _TwoFish_ResetCBC(TWOFISH *tfdata); ++void _TwoFish_FlushOutput(u_int8_t *b,unsigned long len,TWOFISH *tfdata); ++void _TwoFish_BlockCrypt(u_int8_t *in,u_int8_t *out,unsigned long size,int decrypt,TWOFISH *tfdata); ++void _TwoFish_BlockCrypt16(u_int8_t *in,u_int8_t *out,bool decrypt,TWOFISH *tfdata); ++u_int32_t _TwoFish_RS_MDS_Encode(u_int32_t k0,u_int32_t k1); ++u_int32_t _TwoFish_F32(u_int32_t k64Cnt,u_int32_t x,u_int32_t *k32); ++u_int32_t _TwoFish_Fe320(u_int32_t *lsBox,u_int32_t x); ++u_int32_t _TwoFish_Fe323(u_int32_t *lsBox,u_int32_t x); ++u_int32_t _TwoFish_Fe32(u_int32_t *lsBox,u_int32_t x,u_int32_t R); ++ ++ ++#endif diff --git a/net/socat/Makefile b/net/socat/Makefile new file mode 100644 index 0000000..ae8d55b --- /dev/null +++ b/net/socat/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2006-2012 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:=socat +PKG_VERSION:=1.7.2.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.dest-unreach.org/socat/download +PKG_MD5SUM:=7ddfea7e9e85f868670f94d3ea08358b + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/socat + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpthread + TITLE:=A multipurpose relay (SOcket CAT) + URL:=http://www.dest-unreach.org/socat/ +endef + +define Package/socat/description + SoCat (for SOcket CAT) establishes two bidirectional byte streams and + transfers data between them. + Data channels may be files, pipes, devices (terminal or modem, etc.), or + sockets (Unix, IPv4, IPv6, raw, UDP, TCP, SSL). It provides forking, + logging and tracing, different modes for interprocess communication and + many more options. +endef + +CONFIGURE_ARGS += \ + --disable-libwrap \ + --disable-readline \ + --disable-openssl \ + --enable-termios + +CONFIGURE_VARS += \ + sc_cv_termios_ispeed="no" \ + sc_cv_sys_crdly_shift=9 \ + sc_cv_sys_tabdly_shift=11 \ + sc_cv_sys_csize_shift=4 + +define Package/socat/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/socat $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,socat)) diff --git a/net/socat/patches/501-honor_ldflags.patch b/net/socat/patches/501-honor_ldflags.patch new file mode 100644 index 0000000..0dbc773 --- /dev/null +++ b/net/socat/patches/501-honor_ldflags.patch @@ -0,0 +1,12 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -38,7 +38,8 @@ INSTALL = @INSTALL@ + + #0 CFLAGS = @CFLAGS@ $(CCOPTS) $(DEFS) $(INCLS) + CFLAGS = @CFLAGS@ $(CCOPTS) $(DEFS) $(CPPFLAGS) +-CLIBS = $(LIBS) ++LDFLAGS = @LDFLAGS@ ++CLIBS = $(LDFLAGS) $(LIBS) + #CLIBS = $(LIBS) -lm -lefence + XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \ + xiosignal.c xiosigchld.c xioread.c xiowrite.c \ diff --git a/net/softflowd/Makefile b/net/softflowd/Makefile new file mode 100644 index 0000000..8c97143 --- /dev/null +++ b/net/softflowd/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2007-2011 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:=softflowd +PKG_VERSION:=0.9.8 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.mindrot.org/files/softflowd/ +PKG_MD5SUM:=0054d1c80494396cc15edb0a1c7748b1 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/softflowd + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap + TITLE:=softflowd + URL:=http://www.mindrot.org/projects/softflowd/ +endef + +define Package/softflowd/description + Software netflow exporter +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" softflowd softflowctl +endef + +define Package/softflowd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/softflowd $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/softflowctl $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) +endef + +define Package/softflowd/conffiles +/etc/config/softflowd +endef + +$(eval $(call BuildPackage,softflowd)) diff --git a/net/softflowd/files/softflowd.config b/net/softflowd/files/softflowd.config new file mode 100644 index 0000000..6fe5a3e --- /dev/null +++ b/net/softflowd/files/softflowd.config @@ -0,0 +1,13 @@ +config softflowd + option enabled '0' + option interface 'br-lan' + option pcap_file '' + option timeout '' + option max_flows '8192' + option host_port '' + option pid_file '/var/run/softflowd.pid' + option control_socket '/var/run/softflowd.ctl' + option export_version '5' + option hoplimit '' + option tracking_level 'full' + option track_ipv6 '0' diff --git a/net/softflowd/files/softflowd.init b/net/softflowd/files/softflowd.init new file mode 100644 index 0000000..4beddc0 --- /dev/null +++ b/net/softflowd/files/softflowd.init @@ -0,0 +1,73 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=50 + +append_bool() { + local section="$1" + local option="$2" + local value="$3" + local _val + config_get_bool _val "$section" "$option" '0' + [ "$_val" -gt 0 ] && append args "$3" +} + +append_string() { + local section="$1" + local option="$2" + local value="$3" + local _val + config_get _val "$section" "$option" + [ -n "$_val" ] && append args "$3 $_val" +} + +start_instance() { + local section="$1" + + config_get_bool enabled "$section" 'enabled' '0' + [ $enabled -gt 0 ] || return 1 + + config_get pid_file "$section" 'pid_file' + + args="" + append_string "$section" 'interface' '-i' + append_string "$section" 'pcap_file' '-r' + append_string "$section" 'timeout' '-t' + append_string "$section" 'max_flows' '-m' + append_string "$section" 'host_port' '-n' + append_string "$section" 'pid_file' '-p' + append_string "$section" 'control_socket' '-c' + append_string "$section" 'export_version' '-v' + append_string "$section" 'hoplimit' '-L' + append_string "$section" 'tracking_level' '-T' + append_bool "$section" track_ipv6 '-6' + + SERVICE_PID_FILE="$pid_file" \ + service_start /usr/sbin/softflowd $args${pid_file:+ -p $pid_file} +} + +stop_instance() { + local section="$1" + + config_get_bool enabled "$section" 'enabled' '0' + [ $enabled -gt 0 ] || return 1 + + config_get control_socket "$section" 'control_socket' + + [ -n "control_socket" -a -S $control_socket ] && { + /usr/sbin/softflowctl -c $control_socket exit + } +} + +start() { + mkdir -m 0755 -p /var/empty + + config_load 'softflowd' + config_foreach start_instance 'softflowd' +} + +stop() { + config_load 'softflowd' + config_foreach stop_instance 'softflowd' + service_stop /usr/sbin/softflowd +} diff --git a/net/spawn-fcgi/Makefile b/net/spawn-fcgi/Makefile new file mode 100644 index 0000000..560f3be --- /dev/null +++ b/net/spawn-fcgi/Makefile @@ -0,0 +1,39 @@ +# +# Copyright (C) 2006-2009 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:=spawn-fcgi +PKG_VERSION:=1.6.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.lighttpd.net/download/ +PKG_MD5SUM:=787ed2f88d2204bf1fe4fbd6e509d1d7 + +PKG_INSTALL = 1 + +include $(INCLUDE_DIR)/package.mk + +define Package/spawn-fcgi + SUBMENU:=Web Servers/Proxies + SECTION:=net + CATEGORY:=Network + TITLE:=Tool to spawn fastcgi applications + URL:=http://redmine.lighttpd.net/projects/spawn-fcgi +endef + +define Package/spawn-fcgi/description + spawn-fcgi is used to spawn fastcgi applications +endef + +define Package/spawn-fcgi/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/spawn-fcgi $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,spawn-fcgi)) diff --git a/net/speedtouch-usb-firmware/Makefile b/net/speedtouch-usb-firmware/Makefile new file mode 100644 index 0000000..f2a4afd --- /dev/null +++ b/net/speedtouch-usb-firmware/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2008 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:=speedtouch-usb-firmware +PKG_VERSION:=3 +PKG_RELEASE:=012 + +PKG_BUILD_DIR:=$(BUILD_DIR)/speedtouch-usb-firmware-$(PKG_VERSION) +PKG_SOURCE:=SpeedTouch330_firmware_$(PKG_VERSION)$(PKG_RELEASE).zip +PKG_SOURCE_URL:=http://www.speedtouch.com/download/drivers/USB/ +PKG_MD5SUM:=2551ce46ef785642f2c6768511f70ff3 + +include $(INCLUDE_DIR)/package.mk + +define Package/speedtouch-usb-firmware + SUBMENU:=firmware + SECTION:=net + CATEGORY:=Network + TITLE:=SpeedTouch 330 ADSL USB firmware + DEPENDS:=+kmod-usb-atm +kmod-usb-atm-speedtouch + PKGARCH:=all +endef + +define Package/speedtouch-usb-firmware/description + This package add the firmware for SpeedTouch330 ADSL USB modem. +endef + +define Build/Configure +endef + +define Build/Compile + mv $(PKG_BUILD_DIR)/../KQD6_$(PKG_VERSION).$(PKG_RELEASE) $(PKG_BUILD_DIR)/ + mv $(PKG_BUILD_DIR)/../ZZZL_$(PKG_VERSION).$(PKG_RELEASE) $(PKG_BUILD_DIR)/ + # next lines from Gentoo ebuild + # Extract the "stage 1" portion of the firmware + dd if=$(PKG_BUILD_DIR)/KQD6_$(PKG_VERSION).$(PKG_RELEASE) \ + of=$(PKG_BUILD_DIR)/speedtch-1.bin.2 ibs=1 obs=991 count=991 skip=36 + dd if=$(PKG_BUILD_DIR)/ZZZL_$(PKG_VERSION).$(PKG_RELEASE) \ + of=$(PKG_BUILD_DIR)/speedtch-1.bin.4 ibs=1 obs=935 count=935 skip=32 + # Extract the "stage 2" portion of the firmware + dd if=$(PKG_BUILD_DIR)/KQD6_$(PKG_VERSION).$(PKG_RELEASE) \ + of=$(PKG_BUILD_DIR)/speedtch-2.bin.2 ibs=1 obs=762650 count=762650 skip=1027 + dd if=$(PKG_BUILD_DIR)/ZZZL_$(PKG_VERSION).$(PKG_RELEASE) \ + of=$(PKG_BUILD_DIR)/speedtch-2.bin.4 ibs=1 obs=775545 count=775545 skip=967 +endef + +define Package/speedtouch-usb-firmware/install + $(INSTALL_DIR) -d $(1)/lib/firmware + $(INSTALL_CONF) $(PKG_BUILD_DIR)/speedtch-1.bin.2 $(1)/lib/firmware + $(INSTALL_CONF) $(PKG_BUILD_DIR)/speedtch-1.bin.4 $(1)/lib/firmware + $(INSTALL_CONF) $(PKG_BUILD_DIR)/speedtch-2.bin.2 $(1)/lib/firmware + $(INSTALL_CONF) $(PKG_BUILD_DIR)/speedtch-2.bin.4 $(1)/lib/firmware +endef + +define Package/speedtouch-usb-firmware/postinst +#!/bin/sh +# Symlinks for other revisions of the modem +cd "$${IPKG_INSTROOT}/lib/firmware" +for n in 1 2 ; do + for rev in 0 1 ; do + ln -sfn speedtch-$${n}.bin.2 speedtch-$${n}.bin.$${rev} + done + # Seems like a reasonable guess, for revision 3 + ln -sfn speedtch-$${stub}$${n}.bin.4 speedtch-$${n}.bin.3 +done +endef + +$(eval $(call BuildPackage,speedtouch-usb-firmware)) diff --git a/net/squid/Makefile b/net/squid/Makefile new file mode 100644 index 0000000..04d2d7b --- /dev/null +++ b/net/squid/Makefile @@ -0,0 +1,189 @@ +# +# Copyright (C) 2006-2012 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:=squid +PKG_VERSION:=2.7.STABLE9 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.squid-cache.org/Versions/v2/2.7/ +PKG_MD5SUM:=3c6642c85470b1079207d43bba25a819 + +include $(INCLUDE_DIR)/package.mk + +define Package/squid/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + URL:=http://www.squid-cache.org/ +endef + +define Package/squid + $(call Package/squid/Default) + MENU:=1 + DEPENDS:=+libopenssl +libpthread + TITLE:=full-featured Web proxy cache +endef + +define Package/squid/description + Squid is a high-performance proxy caching server for web clients, + supporting FTP, gopher, and HTTP data objects. Unlike traditional + caching software, Squid handles all requests in a single, + non-blocking, I/O-driven process. +endef + +define Package/squid/conffiles +/etc/squid/mime.conf +/etc/squid/squid.conf +endef + +define Package/squid-mod-cachemgr + $(call Package/squid/Default) + DEPENDS:=squid + TITLE:=Web based proxy manager and reporting tool +endef + +define Package/squid-mod-basic-auth-getpwnam + $(call Package/squid/Default) + DEPENDS:=squid + TITLE:=getpwnam basic authentication helper +endef + +define Package/squid-mod-basic-auth-ncsa + $(call Package/squid/Default) + DEPENDS:=squid + TITLE:=NCSA basic authentication helper +endef + +define Package/squid-mod-basic-auth-smb + $(call Package/squid/Default) + DEPENDS:=squid + TITLE:=Samba basic authentication helper +endef + +define Package/squid-mod-digest-auth-password + $(call Package/squid/Default) + DEPENDS:=squid + TITLE:=Password digest authentication helper +endef + +define Package/squid-mod-external-acl-ip-user + $(call Package/squid/Default) + DEPENDS:=squid + TITLE:=IP user external ACL helper +endef + +define Package/squid-mod-external-acl-unix-group + $(call Package/squid/Default) + DEPENDS:=squid + TITLE:=Unix group external ACL helper +endef + +define Package/squid-mod-ntlm-auth-fakeauth + $(call Package/squid/Default) + DEPENDS:=squid + TITLE:=Fakeauth NTLM authentication helper +endef + +define Package/squid-mod-ntlm-auth-smb-auth + $(call Package/squid/Default) + DEPENDS:=squid + TITLE:=Samba NTLM authentication helper +endef + +CONFIGURE_ARGS += \ + --datadir=/usr/share/squid \ + --libexecdir=/usr/lib/squid \ + --sysconfdir=/etc/squid \ + --enable-shared \ + --enable-static \ + --enable-x-accelerator-vary \ + --with-pthreads \ + --with-dl \ + --enable-icmp \ + --enable-kill-parent-hack \ + --enable-arp-acl \ + --enable-ssl \ + --enable-htcp \ + --enable-err-languages=English \ + --enable-default-err-language=English \ + --enable-linux-netfilter \ + --enable-icmp \ + --enable-external-acl-helpers="" \ + --enable-underscores \ + --enable-cache-digests \ + --enable-referer-log \ + --enable-delay-pools \ + --enable-useragent-log \ + --with-openssl=$(STAGING_DIR)/usr \ + --enable-auth="basic digest ntlm" \ + --enable-basic-auth-helpers="getpwnam NCSA SMB" \ + --enable-ntlm-auth-helpers="fakeauth SMB" \ + --enable-digest-auth-helpers="password" \ + --enable-external-acl-helpers="ip_user unix_group" \ + --enable-storeio=null,ufs \ + --enable-epoll \ + --with-maxfd=4096 \ + --without-libcap + +CONFIGURE_VARS += \ + ac_cv_header_linux_netfilter_ipv4_h=yes \ + ac_cv_epoll_works=yes \ + +define Build/Compile + # pass INCLUDES to compile host sources against our OpenSSL, not the host one + $(MAKE) -C $(PKG_BUILD_DIR)/lib \ + all + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install +endef + +define BuildPlugin + define Package/$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/squid + $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/$(2) $$(1)/usr/lib/squid/ + endef + + $$(eval $$(call BuildPackage,$(1))) +endef + +define Package/squid/install + $(INSTALL_DIR) $(1)/etc/squid + $(CP) $(PKG_INSTALL_DIR)/etc/squid/mime.conf $(1)/etc/squid/ + $(CP) $(PKG_INSTALL_DIR)/etc/squid/squid.conf $(1)/etc/squid/ + $(INSTALL_DIR) $(1)/usr/share/squid + $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/* $(1)/usr/share/squid/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/squid + $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/{unlinkd,pinger,logfile-daemon} $(1)/usr/lib/squid/ +endef + +define Package/squid-mod-cachemgr/install + $(INSTALL_DIR) $(1)/www/cgi-bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/cachemgr.cgi $(1)/www/cgi-bin/ +endef + +$(eval $(call RequireHeader,/usr/include/openssl/ssl.h, \ + $(PKG_NAME) requires the openssl development (named like libssl-dev, \ + depending of your package manager) package be installed on the host-system. \ +)) + +$(eval $(call BuildPackage,squid)) +$(eval $(call BuildPackage,squid-mod-cachemgr)) +$(eval $(call BuildPlugin,squid-mod-basic-auth-getpwnam,getpwname_auth)) +$(eval $(call BuildPlugin,squid-mod-basic-auth-ncsa,ncsa_auth)) +$(eval $(call BuildPlugin,squid-mod-basic-auth-smb,smb_auth)) +$(eval $(call BuildPlugin,squid-mod-digest-auth-password,digest_pw_auth)) +$(eval $(call BuildPlugin,squid-mod-external-acl-ip-user,ip_user_check)) +$(eval $(call BuildPlugin,squid-mod-external-acl-unix-group,squid_unix_group)) +$(eval $(call BuildPlugin,squid-mod-ntlm-auth-fakeauth,fakeauth_auth)) +$(eval $(call BuildPlugin,squid-mod-ntlm-auth-smb-auth,ntlm_auth)) + diff --git a/net/squid/patches/001-cross_compile.patch b/net/squid/patches/001-cross_compile.patch new file mode 100644 index 0000000..f2648d9 --- /dev/null +++ b/net/squid/patches/001-cross_compile.patch @@ -0,0 +1,561 @@ +--- /dev/null ++++ b/src/ctype.c +@@ -0,0 +1,546 @@ ++/* ++ Static ctype data for IFC-7.1 / RedHat-9 workaround. ++ This is taken from the GLIBC source code. ++ Hack by Joe Krahn ++ ++ To use, compile with gcc (ifc should work as well): ++ ++ gcc -c ctype.c ++ ++ Next, include the resulting ctype.o when creating executables. ++ Do this automatically using a ~/.ifcrc file with a line like this: ++ ++ -Wl,/some/path/ctype.o ++ ++ That's all. ++ ++ My .ifcrc also turns off the typically excessive warnings: ++ -cm -w90 -w95 -Wl,/home/krahn/Prog/ctype/ctype.o ++ ++ To IFC maintainters: it would be nice to flag on/off specific ++ warning types, like -woff=22,33,44 ++ ++*/ ++ ++/* ++ file: ctype.c ++ ++ Derived from C-ctype.c and ctype-info.c in the GLIBC 2.3 source. ++ ++ To compile: (either gcc or icc is OK) ++ icc -c ctype.c ++ ++ To use, just add the object file ctype.o at link stage. Example: ++ ifc -o hello hello.f ctype.o ++ ++*/ ++ ++ ++/* Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 1995. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++ ++/* This table's entries are taken from POSIX.2 Table 2-6 ++ ``LC_CTYPE Category Definition in the POSIX Locale''. ++ ++ The `_nl_C_LC_CTYPE_width' array is a GNU extension. ++ ++ In the `_nl_C_LC_CTYPE_class' array the value for EOF (== -1) ++ is set to always return 0 and the conversion arrays return EOF. */ ++ ++const char _nl_C_LC_CTYPE_class[768] = ++ /* 0x80 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0x86 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0x8c */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0x92 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0x98 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0x9e */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xa4 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xaa */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xb0 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xb6 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xbc */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xc2 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xc8 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xce */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xd4 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xda */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xe0 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xe6 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xec */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xf2 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xf8 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xfe */ "\000\000" "\000\000" "\002\000" "\002\000" "\002\000" "\002\000" ++ /* 0x04 */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\003\040" ++ /* 0x0a */ "\002\040" "\002\040" "\002\040" "\002\040" "\002\000" "\002\000" ++ /* 0x10 */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" ++ /* 0x16 */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" ++ /* 0x1c */ "\002\000" "\002\000" "\002\000" "\002\000" "\001\140" "\004\300" ++ /* 0x22 */ "\004\300" "\004\300" "\004\300" "\004\300" "\004\300" "\004\300" ++ /* 0x28 */ "\004\300" "\004\300" "\004\300" "\004\300" "\004\300" "\004\300" ++ /* 0x2e */ "\004\300" "\004\300" "\010\330" "\010\330" "\010\330" "\010\330" ++ /* 0x34 */ "\010\330" "\010\330" "\010\330" "\010\330" "\010\330" "\010\330" ++ /* 0x3a */ "\004\300" "\004\300" "\004\300" "\004\300" "\004\300" "\004\300" ++ /* 0x40 */ "\004\300" "\010\325" "\010\325" "\010\325" "\010\325" "\010\325" ++ /* 0x46 */ "\010\325" "\010\305" "\010\305" "\010\305" "\010\305" "\010\305" ++ /* 0x4c */ "\010\305" "\010\305" "\010\305" "\010\305" "\010\305" "\010\305" ++ /* 0x52 */ "\010\305" "\010\305" "\010\305" "\010\305" "\010\305" "\010\305" ++ /* 0x58 */ "\010\305" "\010\305" "\010\305" "\004\300" "\004\300" "\004\300" ++ /* 0x5e */ "\004\300" "\004\300" "\004\300" "\010\326" "\010\326" "\010\326" ++ /* 0x64 */ "\010\326" "\010\326" "\010\326" "\010\306" "\010\306" "\010\306" ++ /* 0x6a */ "\010\306" "\010\306" "\010\306" "\010\306" "\010\306" "\010\306" ++ /* 0x70 */ "\010\306" "\010\306" "\010\306" "\010\306" "\010\306" "\010\306" ++ /* 0x76 */ "\010\306" "\010\306" "\010\306" "\010\306" "\010\306" "\004\300" ++ /* 0x7c */ "\004\300" "\004\300" "\004\300" "\002\000" "\000\000" "\000\000" ++ /* 0x82 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0x88 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0x8e */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0x94 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0x9a */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xa0 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xa6 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xac */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xb2 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xb8 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xbe */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xc4 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xca */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xd0 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xd6 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xdc */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xe2 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xe8 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xee */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xf4 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++ /* 0xfa */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" ++; ++const char _nl_C_LC_CTYPE_class32[1024] = ++ /* 0x00 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000" ++ /* 0x03 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000" ++ /* 0x06 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000" ++ /* 0x09 */ "\000\000\003\040" "\000\000\002\040" "\000\000\002\040" ++ /* 0x0c */ "\000\000\002\040" "\000\000\002\040" "\000\000\002\000" ++ /* 0x0f */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000" ++ /* 0x12 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000" ++ /* 0x15 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000" ++ /* 0x18 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000" ++ /* 0x1b */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000" ++ /* 0x1e */ "\000\000\002\000" "\000\000\002\000" "\000\000\001\140" ++ /* 0x21 */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300" ++ /* 0x24 */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300" ++ /* 0x27 */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300" ++ /* 0x2a */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300" ++ /* 0x2d */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300" ++ /* 0x30 */ "\000\000\010\330" "\000\000\010\330" "\000\000\010\330" ++ /* 0x33 */ "\000\000\010\330" "\000\000\010\330" "\000\000\010\330" ++ /* 0x36 */ "\000\000\010\330" "\000\000\010\330" "\000\000\010\330" ++ /* 0x39 */ "\000\000\010\330" "\000\000\004\300" "\000\000\004\300" ++ /* 0x3c */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300" ++ /* 0x3f */ "\000\000\004\300" "\000\000\004\300" "\000\000\010\325" ++ /* 0x42 */ "\000\000\010\325" "\000\000\010\325" "\000\000\010\325" ++ /* 0x45 */ "\000\000\010\325" "\000\000\010\325" "\000\000\010\305" ++ /* 0x48 */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305" ++ /* 0x4b */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305" ++ /* 0x4e */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305" ++ /* 0x51 */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305" ++ /* 0x54 */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305" ++ /* 0x57 */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305" ++ /* 0x5a */ "\000\000\010\305" "\000\000\004\300" "\000\000\004\300" ++ /* 0x5d */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300" ++ /* 0x60 */ "\000\000\004\300" "\000\000\010\326" "\000\000\010\326" ++ /* 0x63 */ "\000\000\010\326" "\000\000\010\326" "\000\000\010\326" ++ /* 0x66 */ "\000\000\010\326" "\000\000\010\306" "\000\000\010\306" ++ /* 0x69 */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306" ++ /* 0x6c */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306" ++ /* 0x6f */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306" ++ /* 0x72 */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306" ++ /* 0x75 */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306" ++ /* 0x78 */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306" ++ /* 0x7b */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300" ++ /* 0x7e */ "\000\000\004\300" "\000\000\002\000" "\000\000\000\000" ++ /* 0x81 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0x84 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0x87 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0x8a */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0x8d */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0x90 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0x93 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0x96 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0x99 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0x9c */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0x9f */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xa2 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xa5 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xa8 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xab */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xae */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xb1 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xb4 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xb7 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xba */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xbd */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xc0 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xc3 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xc6 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xc9 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xcc */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xcf */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xd2 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xd5 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xd8 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xdb */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xde */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xe1 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xe4 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xe7 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xea */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xed */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xf0 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xf3 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xf6 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xf9 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xfc */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000" ++ /* 0xff */ "\000\000\000\000" ++; ++const uint32_t _nl_C_LC_CTYPE_toupper[384] = ++{ ++ /* 0x80 */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, ++ /* 0x88 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, ++ /* 0x90 */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, ++ /* 0x98 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, ++ /* 0xa0 */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, ++ /* 0xa8 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, ++ /* 0xb0 */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, ++ /* 0xb8 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, ++ /* 0xc0 */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, ++ /* 0xc8 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, ++ /* 0xd0 */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, ++ /* 0xd8 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, ++ /* 0xe0 */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, ++ /* 0xe8 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, ++ /* 0xf0 */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, ++ /* 0xf8 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xffffffff, ++ /* 0x00 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, ++ /* 0x08 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, ++ /* 0x10 */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, ++ /* 0x18 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, ++ /* 0x20 */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, ++ /* 0x28 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, ++ /* 0x30 */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, ++ /* 0x38 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, ++ /* 0x40 */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, ++ /* 0x48 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, ++ /* 0x50 */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, ++ /* 0x58 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, ++ /* 0x60 */ 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, ++ /* 0x68 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, ++ /* 0x70 */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, ++ /* 0x78 */ 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, ++ /* 0x80 */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, ++ /* 0x88 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, ++ /* 0x90 */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, ++ /* 0x98 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, ++ /* 0xa0 */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, ++ /* 0xa8 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, ++ /* 0xb0 */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, ++ /* 0xb8 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, ++ /* 0xc0 */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, ++ /* 0xc8 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, ++ /* 0xd0 */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, ++ /* 0xd8 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, ++ /* 0xe0 */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, ++ /* 0xe8 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, ++ /* 0xf0 */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, ++ /* 0xf8 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff ++}; ++const uint32_t _nl_C_LC_CTYPE_tolower[384] = ++{ ++ /* 0x80 */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, ++ /* 0x88 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, ++ /* 0x90 */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, ++ /* 0x98 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, ++ /* 0xa0 */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, ++ /* 0xa8 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, ++ /* 0xb0 */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, ++ /* 0xb8 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, ++ /* 0xc0 */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, ++ /* 0xc8 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, ++ /* 0xd0 */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, ++ /* 0xd8 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, ++ /* 0xe0 */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, ++ /* 0xe8 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, ++ /* 0xf0 */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, ++ /* 0xf8 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xffffffff, ++ /* 0x00 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, ++ /* 0x08 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, ++ /* 0x10 */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, ++ /* 0x18 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, ++ /* 0x20 */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, ++ /* 0x28 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, ++ /* 0x30 */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, ++ /* 0x38 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, ++ /* 0x40 */ 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, ++ /* 0x48 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, ++ /* 0x50 */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, ++ /* 0x58 */ 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, ++ /* 0x60 */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, ++ /* 0x68 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, ++ /* 0x70 */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, ++ /* 0x78 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, ++ /* 0x80 */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, ++ /* 0x88 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, ++ /* 0x90 */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, ++ /* 0x98 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, ++ /* 0xa0 */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, ++ /* 0xa8 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, ++ /* 0xb0 */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, ++ /* 0xb8 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, ++ /* 0xc0 */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, ++ /* 0xc8 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, ++ /* 0xd0 */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, ++ /* 0xd8 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, ++ /* 0xe0 */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, ++ /* 0xe8 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, ++ /* 0xf0 */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, ++ /* 0xf8 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff ++}; ++ ++#define STRUCT_CTYPE_CLASS(p, q) \ ++ struct \ ++ { \ ++ uint32_t isctype_data[8]; \ ++ uint32_t header[5]; \ ++ uint32_t level1[1]; \ ++ uint32_t level2[1 << q]; \ ++ uint32_t level3[1 << p]; \ ++ } ++ ++const STRUCT_CTYPE_CLASS(1, 1) _nl_C_LC_CTYPE_class_upper = ++{ ++ { 0x00000000, 0x00000000, 0x07fffffe, 0x00000000, ++ 0x00000000, 0x00000000, 0x00000000, 0x00000000 ++ }, ++ { 7, 1, 6, 1, 1 }, ++ /* 1st-level table */ ++ { 6 * sizeof (uint32_t) }, ++ /* 2nd-level table */ ++ { 0, 8 * sizeof (uint32_t) }, ++ /* 3rd-level table */ ++ { 0x07fffffe, 0x00000000 } ++}; ++const STRUCT_CTYPE_CLASS(1, 1) _nl_C_LC_CTYPE_class_lower = ++{ ++ { 0x00000000, 0x00000000, 0x00000000, 0x07fffffe, ++ 0x00000000, 0x00000000, 0x00000000, 0x00000000 ++ }, ++ { 7, 1, 6, 1, 1 }, ++ /* 1st-level table */ ++ { 6 * sizeof (uint32_t) }, ++ /* 2nd-level table */ ++ { 0, 8 * sizeof (uint32_t) }, ++ /* 3rd-level table */ ++ { 0x00000000, 0x07fffffe } ++}; ++const STRUCT_CTYPE_CLASS(1, 1) _nl_C_LC_CTYPE_class_alpha = ++{ ++ { 0x00000000, 0x00000000, 0x07fffffe, 0x07fffffe, ++ 0x00000000, 0x00000000, 0x00000000, 0x00000000 ++ }, ++ { 7, 1, 6, 1, 1 }, ++ /* 1st-level table */ ++ { 6 * sizeof (uint32_t) }, ++ /* 2nd-level table */ ++ { 0, 8 * sizeof (uint32_t) }, ++ /* 3rd-level table */ ++ { 0x07fffffe, 0x07fffffe } ++}; ++const STRUCT_CTYPE_CLASS(1, 0) _nl_C_LC_CTYPE_class_digit = ++{ ++ { 0x00000000, 0x03ff0000, 0x00000000, 0x00000000, ++ 0x00000000, 0x00000000, 0x00000000, 0x00000000 ++ }, ++ { 6, 1, 6, 0, 1 }, ++ /* 1st-level table */ ++ { 6 * sizeof (uint32_t) }, ++ /* 2nd-level table */ ++ { 7 * sizeof (uint32_t) }, ++ /* 3rd-level table */ ++ { 0x00000000, 0x03ff0000 } ++}; ++const STRUCT_CTYPE_CLASS(2, 0) _nl_C_LC_CTYPE_class_xdigit = ++{ ++ { 0x00000000, 0x03ff0000, 0x0000007e, 0x0000007e, ++ 0x00000000, 0x00000000, 0x00000000, 0x00000000 ++ }, ++ { 7, 1, 7, 0, 3 }, ++ /* 1st-level table */ ++ { 6 * sizeof (uint32_t) }, ++ /* 2nd-level table */ ++ { 7 * sizeof (uint32_t) }, ++ /* 3rd-level table */ ++ { 0x00000000, 0x03ff0000, 0x0000007e, 0x0000007e } ++}; ++const STRUCT_CTYPE_CLASS(1, 0) _nl_C_LC_CTYPE_class_space = ++{ ++ { 0x00003e00, 0x00000001, 0x00000000, 0x00000000, ++ 0x00000000, 0x00000000, 0x00000000, 0x00000000 ++ }, ++ { 6, 1, 6, 0, 1 }, ++ /* 1st-level table */ ++ { 6 * sizeof (uint32_t) }, ++ /* 2nd-level table */ ++ { 7 * sizeof (uint32_t) }, ++ /* 3rd-level table */ ++ { 0x00003e00, 0x00000001 } ++}; ++const STRUCT_CTYPE_CLASS(2, 0) _nl_C_LC_CTYPE_class_print = ++{ ++ { 0x00000000, 0xffffffff, 0xffffffff, 0x7fffffff, ++ 0x00000000, 0x00000000, 0x00000000, 0x00000000 ++ }, ++ { 7, 1, 7, 0, 3 }, ++ /* 1st-level table */ ++ { 6 * sizeof (uint32_t) }, ++ /* 2nd-level table */ ++ { 7 * sizeof (uint32_t) }, ++ /* 3rd-level table */ ++ { 0x00000000, 0xffffffff, 0xffffffff, 0x7fffffff } ++}; ++const STRUCT_CTYPE_CLASS(2, 0) _nl_C_LC_CTYPE_class_graph = ++{ ++ { 0x00000000, 0xfffffffe, 0xffffffff, 0x7fffffff, ++ 0x00000000, 0x00000000, 0x00000000, 0x00000000 ++ }, ++ { 7, 1, 7, 0, 3 }, ++ /* 1st-level table */ ++ { 6 * sizeof (uint32_t) }, ++ /* 2nd-level table */ ++ { 7 * sizeof (uint32_t) }, ++ /* 3rd-level table */ ++ { 0x00000000, 0xfffffffe, 0xffffffff, 0x7fffffff } ++}; ++const STRUCT_CTYPE_CLASS(1, 0) _nl_C_LC_CTYPE_class_blank = ++{ ++ { 0x00000200, 0x00000001, 0x00000000, 0x00000000, ++ 0x00000000, 0x00000000, 0x00000000, 0x00000000 ++ }, ++ { 6, 1, 6, 0, 1 }, ++ /* 1st-level table */ ++ { 6 * sizeof (uint32_t) }, ++ /* 2nd-level table */ ++ { 7 * sizeof (uint32_t) }, ++ /* 3rd-level table */ ++ { 0x00000200, 0x00000001 } ++}; ++const STRUCT_CTYPE_CLASS(2, 0) _nl_C_LC_CTYPE_class_cntrl = ++{ ++ { 0xffffffff, 0x00000000, 0x00000000, 0x80000000, ++ 0x00000000, 0x00000000, 0x00000000, 0x00000000 ++ }, ++ { 7, 1, 7, 0, 3 }, ++ /* 1st-level table */ ++ { 6 * sizeof (uint32_t) }, ++ /* 2nd-level table */ ++ { 7 * sizeof (uint32_t) }, ++ /* 3rd-level table */ ++ { 0xffffffff, 0x00000000, 0x00000000, 0x80000000 } ++}; ++const STRUCT_CTYPE_CLASS(2, 0) _nl_C_LC_CTYPE_class_punct = ++{ ++ { 0x00000000, 0xfc00fffe, 0xf8000001, 0x78000001, ++ 0x00000000, 0x00000000, 0x00000000, 0x00000000 ++ }, ++ { 7, 1, 7, 0, 3 }, ++ /* 1st-level table */ ++ { 6 * sizeof (uint32_t) }, ++ /* 2nd-level table */ ++ { 7 * sizeof (uint32_t) }, ++ /* 3rd-level table */ ++ { 0x00000000, 0xfc00fffe, 0xf8000001, 0x78000001 } ++}; ++const STRUCT_CTYPE_CLASS(2, 0) _nl_C_LC_CTYPE_class_alnum = ++{ ++ { 0x00000000, 0x03ff0000, 0x07fffffe, 0x07fffffe, ++ 0x00000000, 0x00000000, 0x00000000, 0x00000000 ++ }, ++ { 7, 1, 7, 0, 3 }, ++ /* 1st-level table */ ++ { 6 * sizeof (uint32_t) }, ++ /* 2nd-level table */ ++ { 7 * sizeof (uint32_t) }, ++ /* 3rd-level table */ ++ { 0x00000000, 0x03ff0000, 0x07fffffe, 0x07fffffe } ++}; ++ ++const struct ++{ ++ uint32_t header[5]; ++ uint32_t level1[1]; ++ uint32_t level2[4]; ++ int32_t level3[32]; ++} ++_nl_C_LC_CTYPE_map_toupper = ++{ ++ { 7, 1, 5, 3, 31 }, ++ /* 1st-level table */ ++ { 6 * sizeof (uint32_t) }, ++ /* 2nd-level table */ ++ { 0, 0, 0, 10 * sizeof (uint32_t) }, ++ /* 3rd-level table */ ++ { ++ 0x00000000, 0xffffffe0, 0xffffffe0, 0xffffffe0, ++ 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, ++ 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, ++ 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, ++ 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, ++ 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, ++ 0xffffffe0, 0xffffffe0, 0xffffffe0, 0x00000000, ++ 0x00000000, 0x00000000, 0x00000000, 0x00000000 ++ } ++}, ++_nl_C_LC_CTYPE_map_tolower = ++{ ++ { 7, 1, 5, 3, 31 }, ++ /* 1st-level table */ ++ { 6 * sizeof (uint32_t) }, ++ /* 2nd-level table */ ++ { 0, 0, 10 * sizeof (uint32_t), 0 }, ++ /* 3rd-level table */ ++ { ++ 0x00000000, 0x00000020, 0x00000020, 0x00000020, ++ 0x00000020, 0x00000020, 0x00000020, 0x00000020, ++ 0x00000020, 0x00000020, 0x00000020, 0x00000020, ++ 0x00000020, 0x00000020, 0x00000020, 0x00000020, ++ 0x00000020, 0x00000020, 0x00000020, 0x00000020, ++ 0x00000020, 0x00000020, 0x00000020, 0x00000020, ++ 0x00000020, 0x00000020, 0x00000020, 0x00000000, ++ 0x00000000, 0x00000000, 0x00000000, 0x00000000 ++ } ++}; ++ ++#define b(t,x,o) (((const t *) _nl_C_LC_CTYPE_##x) + o) ++ ++const uint16_t *__ctype_b = b (uint16_t, class, 128); ++const uint32_t *__ctype32_b = b (uint32_t, class32, 0); ++const int32_t *__ctype_tolower = b (int32_t, tolower, 128); ++const int32_t *__ctype_toupper = b (int32_t, toupper, 128); ++const uint32_t *__ctype32_tolower = b (uint32_t, tolower, 128); ++const uint32_t *__ctype32_toupper = b (uint32_t, toupper, 128); ++ +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -1234,6 +1234,9 @@ squid.conf.default: cf_parser.h + true + + cf_parser.h: cf.data cf_gen$(EXEEXT) ++ rm -f cf_gen ++ gcc -c ctype.c ++ gcc -o cf_gen cf_gen.c -DNODEBUG=1 -I./ -I../ -I../include/ -L../lib -lmiscutil$(shell uname -m) -lm -lnsl -Wl,ctype.o + ./cf_gen cf.data $(srcdir)/cf.data.depend + + cf_gen_defines.h: $(srcdir)/cf_gen_defines $(srcdir)/cf.data.pre diff --git a/net/squid/patches/002-no_sslv2.patch b/net/squid/patches/002-no_sslv2.patch new file mode 100644 index 0000000..c5c0f0e --- /dev/null +++ b/net/squid/patches/002-no_sslv2.patch @@ -0,0 +1,15 @@ +--- a/src/ssl_support.c ++++ b/src/ssl_support.c +@@ -446,10 +446,12 @@ sslCreateServerContext(const char *certf + ERR_clear_error(); + debug(83, 1) ("Initialising SSL.\n"); + switch (version) { ++#ifndef OPENSSL_NO_SSL2 + case 2: + debug(83, 5) ("Using SSLv2.\n"); + method = SSLv2_server_method(); + break; ++#endif + case 3: + debug(83, 5) ("Using SSLv3.\n"); + method = SSLv3_server_method(); diff --git a/net/squid/patches/003-configure.patch b/net/squid/patches/003-configure.patch new file mode 100644 index 0000000..c58b29e --- /dev/null +++ b/net/squid/patches/003-configure.patch @@ -0,0 +1,50 @@ +--- a/configure ++++ b/configure +@@ -5059,10 +5059,6 @@ _ACEOF + if test -z "$SSLLIB"; then + SSLLIB="-lcrypto" # for MD5 routines + fi +- if $PKGCONFIG --exists openssl; then +- SSLLIB="`$PKGCONFIG --libs openssl`" +- SSLFLAGS="`$PKGCONFIG --cflags openssl`" +- fi + CPPFLAGS="${SSLFLAGS} $CPPFLAGS" + fi + +@@ -27318,7 +27314,7 @@ else + See \`config.log' for more details." >&5 + $as_echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ { (true); true; }; } + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +@@ -27481,8 +27477,7 @@ else + { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling + See \`config.log' for more details." >&5 + $as_echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++See \`config.log' for more details." >&2;} } + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +@@ -27733,7 +27728,7 @@ else + See \`config.log' for more details." >&5 + $as_echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ { (true); true; }; } + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +@@ -27815,7 +27810,7 @@ else + See \`config.log' for more details." >&5 + $as_echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ { (true); true; }; } + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ diff --git a/net/squid/patches/004-include-autoconf.patch b/net/squid/patches/004-include-autoconf.patch new file mode 100644 index 0000000..9ed4360 --- /dev/null +++ b/net/squid/patches/004-include-autoconf.patch @@ -0,0 +1,15 @@ +--- a/include/autoconf.h.in ++++ b/include/autoconf.h.in +@@ -313,10 +313,10 @@ + #undef HAVE_OPENSSL_ERR_H + + /* Define to 1 if you have the header file. */ +-#undef HAVE_OPENSSL_MD5_H ++#define HAVE_OPENSSL_MD5_H 1 + + /* Define to 1 if you have the header file. */ +-#undef HAVE_OPENSSL_SSL_H ++#define HAVE_OPENSSL_SSL_H 1 + + /* Define to 1 if you have the header file. */ + #undef HAVE_PATHS_H diff --git a/net/squid/patches/005-lib-makefile.patch b/net/squid/patches/005-lib-makefile.patch new file mode 100644 index 0000000..06b7955 --- /dev/null +++ b/net/squid/patches/005-lib-makefile.patch @@ -0,0 +1,179 @@ +--- a/lib/Makefile.in ++++ b/lib/Makefile.in +@@ -60,8 +60,10 @@ am__libmiscutil_a_SOURCES_DIST = Array.c + rfc1123.c rfc1738.c rfc2617.c safe_inet_addr.c snprintf.c \ + splay.c Stack.c strsep.c stub_memaccount.c util.c uudecode.c \ + win32lib.c ++@NEED_OWN_MD5_TRUE@am__host_objects_1 = md5.$(HOST_OBJEXT) + @NEED_OWN_SNPRINTF_TRUE@am__objects_1 = snprintf.$(OBJEXT) + @NEED_OWN_STRSEP_TRUE@am__objects_2 = strsep.$(OBJEXT) ++@NEED_OWN_SNPRINTF_TRUE@am__host_objects_2 = snprintf.$(HOST_OBJEXT) + @ENABLE_MINGW32SPECIFIC_TRUE@am__objects_3 = win32lib.$(OBJEXT) + am_libmiscutil_a_OBJECTS = Array.$(OBJEXT) base64.$(OBJEXT) \ + getfullhostname.$(OBJEXT) hash.$(OBJEXT) heap.$(OBJEXT) \ +@@ -71,7 +73,19 @@ am_libmiscutil_a_OBJECTS = Array.$(OBJEX + $(am__objects_1) splay.$(OBJEXT) Stack.$(OBJEXT) \ + $(am__objects_2) stub_memaccount.$(OBJEXT) util.$(OBJEXT) \ + uudecode.$(OBJEXT) $(am__objects_3) ++am_libmiscutil_a_HOST_OBJECTS = Array.$(HOST_OBJEXT) \ ++ base64.$(HOST_OBJEXT) getfullhostname.$(HOST_OBJEXT) \ ++ hash.$(HOST_OBJEXT) heap.$(HOST_OBJEXT) \ ++ html_quote.$(HOST_OBJEXT) iso3307.$(HOST_OBJEXT) \ ++ $(am__host_objects_1) radix.$(HOST_OBJEXT) \ ++ rfc1035.$(HOST_OBJEXT) rfc1123.$(HOST_OBJEXT) \ ++ rfc1738.$(HOST_OBJEXT) rfc2617.$(HOST_OBJEXT) \ ++ safe_inet_addr.$(HOST_OBJEXT) $(am__host_objects_2) \ ++ splay.$(HOST_OBJEXT) Stack.$(HOST_OBJEXT) \ ++ stub_memaccount.$(HOST_OBJEXT) util.$(HOST_OBJEXT) \ ++ uudecode.$(HOST_OBJEXT) + libmiscutil_a_OBJECTS = $(am_libmiscutil_a_OBJECTS) ++libmiscutil_a_HOST_OBJECTS = $(am_libmiscutil_a_HOST_OBJECTS) + libntlmauth_a_AR = $(AR) $(ARFLAGS) + libntlmauth_a_DEPENDENCIES = @LIBOBJS@ + am_libntlmauth_a_OBJECTS = ntlmauth.$(OBJEXT) +@@ -89,15 +103,19 @@ depcomp = $(SHELL) $(top_srcdir)/cfgaux/ + am__depfiles_maybe = depfiles + COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) ++HOST_COMPILE = $(HOST_CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ ++ $(AM_CFLAGS) + CCLD = $(CC) ++HOST_CCLD = ld + LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +-SOURCES = $(libdlmalloc_a_SOURCES) $(libmiscutil_a_SOURCES) \ ++HOST_LINK = $(HOST_CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ ++SOURCES = $(libdlmalloc_a_SOURCES) $(libmiscutil_a_SOURCES) $(libmiscutil_a_HOST_SOURCES) \ + $(EXTRA_libmiscutil_a_SOURCES) $(libntlmauth_a_SOURCES) \ + $(libregex_a_SOURCES) $(libsspwin32_a_SOURCES) + DIST_SOURCES = $(libdlmalloc_a_SOURCES) \ + $(am__libmiscutil_a_SOURCES_DIST) \ + $(EXTRA_libmiscutil_a_SOURCES) $(libntlmauth_a_SOURCES) \ +- $(libregex_a_SOURCES) $(libsspwin32_a_SOURCES) ++ $(libregex_a_SOURCES) $(libsspwin32_a_SOURCES) $(libmiscutil_a_HOST_SOURCES) + ETAGS = etags + CTAGS = ctags + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +@@ -105,6 +123,7 @@ ACLOCAL = @ACLOCAL@ + ALLOCA = @ALLOCA@ + AMTAR = @AMTAR@ + AR = @AR@ ++HOST_AR = ar + AR_R = @AR_R@ + AUTH_LIBS = @AUTH_LIBS@ + AUTH_MODULES = @AUTH_MODULES@ +@@ -117,6 +136,7 @@ BASIC_AUTH_HELPERS = @BASIC_AUTH_HELPERS + CACHE_HTTP_PORT = @CACHE_HTTP_PORT@ + CACHE_ICP_PORT = @CACHE_ICP_PORT@ + CC = @CC@ ++HOST_CC = gcc + CCDEPMODE = @CCDEPMODE@ + CFLAGS = @CFLAGS@ + CGIEXT = @CGIEXT@ +@@ -164,6 +184,8 @@ NEGOTIATE_AUTH_HELPERS = @NEGOTIATE_AUTH + NIS_LIBS = @NIS_LIBS@ + NTLM_AUTH_HELPERS = @NTLM_AUTH_HELPERS@ + OBJEXT = @OBJEXT@ ++HOST_OBJEXT = @OBJEXT@.$(shell uname -m) ++HOST_DEPEXT = .$(shell uname -m) + OPT_DEFAULT_HOSTS = @OPT_DEFAULT_HOSTS@ + PACKAGE = @PACKAGE@ + PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +@@ -261,6 +283,7 @@ EXTRA_LIBRARIES = \ + noinst_LIBRARIES = \ + @LIBDLMALLOC@ \ + libmiscutil.a \ ++ libmiscutil$(shell uname -m).a \ + libntlmauth.a \ + @LIBREGEX@ \ + $(LIBSSPWIN32) +@@ -300,9 +323,34 @@ libmiscutil_a_SOURCES = \ + uudecode.c \ + $(WIN32SRC) + ++libmiscutil_a_HOST_SOURCES = \ ++ Array.c \ ++ base64.c \ ++ getfullhostname.c \ ++ hash.c \ ++ heap.c \ ++ html_quote.c \ ++ iso3307.c \ ++ $(MD5SOURCE) \ ++ radix.c \ ++ rfc1035.c \ ++ rfc1123.c \ ++ rfc1738.c \ ++ rfc2617.c \ ++ safe_inet_addr.c \ ++ $(SNPRINTFSOURCE) \ ++ splay.c \ ++ Stack.c \ ++ stub_memaccount.c \ ++ util.c \ ++ uudecode.c ++ + libmiscutil_a_LIBADD = \ + @LIBOBJS@ + ++libmiscutil_a_HOST_LIBADD = \ ++ @LIBOBJS@ ++ + # $(top_srcdir)/include/version.h should be a dependency + libregex_a_SOURCES = \ + GNUregex.c +@@ -323,7 +371,7 @@ INCLUDES = -I$(top_builddir)/include -I$ + all: all-am + + .SUFFIXES: +-.SUFFIXES: .c .o .obj ++.SUFFIXES: .c .o .obj .o.$(shell uname -m) + $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ +@@ -360,10 +408,13 @@ libdlmalloc.a: $(libdlmalloc_a_OBJECTS) + -rm -f libdlmalloc.a + $(libdlmalloc_a_AR) libdlmalloc.a $(libdlmalloc_a_OBJECTS) $(libdlmalloc_a_LIBADD) + $(RANLIB) libdlmalloc.a +-libmiscutil.a: $(libmiscutil_a_OBJECTS) $(libmiscutil_a_DEPENDENCIES) ++libmiscutil.a: $(libmiscutil_a_OBJECTS) $(libmiscutil_a_HOST_OBJECTS) $(libmiscutil_a_DEPENDENCIES) + -rm -f libmiscutil.a ++ -rm -f libmiscutil$(shell uname -m).a + $(libmiscutil_a_AR) libmiscutil.a $(libmiscutil_a_OBJECTS) $(libmiscutil_a_LIBADD) ++ ar rcu libmiscutil$(shell uname -m).a $(libmiscutil_a_HOST_OBJECTS) $(libmiscutil_a_HOST_LIBADD) + $(RANLIB) libmiscutil.a ++ ranlib libmiscutil$(shell uname -m).a + libntlmauth.a: $(libntlmauth_a_OBJECTS) $(libntlmauth_a_DEPENDENCIES) + -rm -f libntlmauth.a + $(libntlmauth_a_AR) libntlmauth.a $(libntlmauth_a_OBJECTS) $(libntlmauth_a_LIBADD) +@@ -417,6 +468,21 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uudecode.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/win32lib.Po@am__quote@ ++@AMDEP_TRUE@DEP_HOST_FILES = $(DEPDIR)/Array.Po.$(HOST_DEPEXT) $(DEPDIR)/GNUregex.Po.$(HOST_DEPEXT) \ ++@AMDEP_TRUE@ $(DEPDIR)/Stack.Po.$(HOST_DEPEXT) $(DEPDIR)/base64.Po.$(HOST_DEPEXT) \ ++@AMDEP_TRUE@ $(DEPDIR)/dlmalloc.Po.$(HOST_DEPEXT) $(DEPDIR)/drand48.Po.$(HOST_DEPEXT) \ ++@AMDEP_TRUE@ $(DEPDIR)/getfullhostname.Po.$(HOST_DEPEXT) $(DEPDIR)/hash.Po.$(HOST_DEPEXT) \ ++@AMDEP_TRUE@ $(DEPDIR)/heap.Po.$(HOST_DEPEXT) $(DEPDIR)/html_quote.Po.$(HOST_DEPEXT) \ ++@AMDEP_TRUE@ $(DEPDIR)/inet_ntoa.Po.$(HOST_DEPEXT) $(DEPDIR)/initgroups.Po.$(HOST_DEPEXT) \ ++@AMDEP_TRUE@ $(DEPDIR)/iso3307.Po.$(HOST_DEPEXT) $(DEPDIR)/md5.Po.$(HOST_DEPEXT) \ ++@AMDEP_TRUE@ $(DEPDIR)/ntlmauth.Po.$(HOST_DEPEXT) $(DEPDIR)/radix.Po.$(HOST_DEPEXT) \ ++@AMDEP_TRUE@ $(DEPDIR)/rfc1035.Po.$(HOST_DEPEXT) $(DEPDIR)/rfc1123.Po.$(HOST_DEPEXT) \ ++@AMDEP_TRUE@ $(DEPDIR)/rfc1738.Po.$(HOST_DEPEXT) $(DEPDIR)/rfc2617.Po.$(HOST_DEPEXT) \ ++@AMDEP_TRUE@ $(DEPDIR)/safe_inet_addr.Po.$(HOST_DEPEXT) $(DEPDIR)/snprintf.Po.$(HOST_DEPEXT) \ ++@AMDEP_TRUE@ $(DEPDIR)/splay.Po.$(HOST_DEPEXT) $(DEPDIR)/strerror.Po.$(HOST_DEPEXT) \ ++@AMDEP_TRUE@ $(DEPDIR)/stub_memaccount.Po.$(HOST_DEPEXT) $(DEPDIR)/tempnam.Po.$(HOST_DEPEXT) \ ++@AMDEP_TRUE@ $(DEPDIR)/util.Po.$(HOST_DEPEXT) $(DEPDIR)/uudecode.Po.$(HOST_DEPEXT) ++ + + .c.o: + @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@@ -425,6 +491,9 @@ distclean-compile: + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCC_FALSE@ $(COMPILE) -c $< + ++.c.o.$(shell uname -m): ++ $(HOST_COMPILE) -o $(shell basename $< .c).o.$(shell uname -m) -c $< ++ + .c.obj: + @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po diff --git a/net/srelay/Makefile b/net/srelay/Makefile new file mode 100644 index 0000000..d579d1d --- /dev/null +++ b/net/srelay/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2006-2011 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:=srelay +PKG_VERSION:=0.4.8b3 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/socks-relay +PKG_MD5SUM:=a6d9521594172710ffa308d6b5dbece4 + +include $(INCLUDE_DIR)/package.mk + +define Package/srelay + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libwrap + SUBMENU:=Web Servers/Proxies + TITLE:=A socks 4/5 proxy server + URL:=http://www.c-wind.com/srelay/ +endef + +define Package/srelay/conffiles +/etc/srelay.conf +endef + +CONFIGURE_ARGS += \ + --disable-thread \ + --with-libwrap="$(STAGING_DIR)/usr" \ + +CONFIGURE_VARS += \ + CPPFLAGS="-DLINUX $$$$CPPFLAGS" \ + +define Package/srelay/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) files/$(PKG_NAME).conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) +endef + +$(eval $(call BuildPackage,srelay)) diff --git a/net/srelay/files/srelay.conf b/net/srelay/files/srelay.conf new file mode 100644 index 0000000..e5d53ec --- /dev/null +++ b/net/srelay/files/srelay.conf @@ -0,0 +1,2 @@ +# allow local subnet to access socks proxy +192.168.1.0/24 any - diff --git a/net/srelay/files/srelay.init b/net/srelay/files/srelay.init new file mode 100644 index 0000000..95d1d81 --- /dev/null +++ b/net/srelay/files/srelay.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +start() { + service_start /usr/bin/srelay -c /etc/srelay.conf -r -s +} + +stop() { + service_stop /usr/bin/srelay +} diff --git a/net/sscep/Makefile b/net/sscep/Makefile new file mode 100644 index 0000000..8dd037e --- /dev/null +++ b/net/sscep/Makefile @@ -0,0 +1,52 @@ +# +# 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:=sscep +PKG_VERSION:=20040325+ng2 +PKG_RELEASE:=1 + +PKG_SOURCE:=${PKG_NAME}.tgz +PKG_SOURCE_URL:=http://www.klake.org/~jt/sscep/ +PKG_MD5SUM:=b509cdf0de952841471e77499aa6e4ca + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/sscep + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libopenssl + TITLE:=A Simple SCEP (Simple Certificate Enrollment Protocol) client + URL:=http://www.klake.org/~jt/sscep/ +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" +endef + +define Package/sscep/conffiles +/etc/sscep.conf +endef + +define Package/sscep/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/sscep.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/sscep $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,sscep)) diff --git a/net/sscep/patches/001-certnanny.patch b/net/sscep/patches/001-certnanny.patch new file mode 100644 index 0000000..6a37352 --- /dev/null +++ b/net/sscep/patches/001-certnanny.patch @@ -0,0 +1,3009 @@ +This patch adds support for signing requests with an existing key. +It was taken from CertNanny + +diff -uN sscep/Makefile sscep-ng2/Makefile +--- sscep/Makefile 2003-01-22 06:23:18.000000000 +0100 ++++ sscep-ng2/Makefile 2006-04-25 19:38:49.000000000 +0200 +@@ -7,13 +7,14 @@ + + CC = gcc + CFLAGS = -Wall -O ++LDLIBS = -lcrypto + + MAN = sscep.8 + PROG = sscep + OBJS = sscep.o init.o net.o sceputils.o pkcs7.o ias.o fileutils.o + + $(PROG): $(OBJS) +- $(CC) $(CFLAGS) -lcrypto -o $(PROG) $(OBJS) ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(PROG) $(OBJS) $(LDLIBS) + + clean: + rm -f $(PROG) $(OBJS) $(MAN) core +diff -uN sscep/README sscep-ng2/README +--- sscep/README 2003-04-17 07:49:46.000000000 +0200 ++++ sscep-ng2/README 2006-04-28 10:27:44.000000000 +0200 +@@ -51,11 +51,13 @@ + o iPlanet CMS (getca and enroll works)* + o VeriSign Onsite (getca and enroll works)** + o Entrust VPN Connect (getca and enroll works)*** ++o OpenCA (getca, enroll, getcrl and automatic approval works)**** + + (*) by default, subjectAltName extensions are dropped from certificate + (**) only DNS subjectAltName allowed (demo mode) + (***) demo requires to use /C=US/O=Entrust +- ++(****) automatic approval according to newer SCEP drafts requires ++ OpenCA 0.9.2.4 or higher + + HOW TO COMPILE + ============== +@@ -76,7 +78,7 @@ + + $ ./sscep + +-sscep version 20030131 ++sscep version 2005XXXX + + Usage: ./sscep OPERATION [OPTIONS] + +@@ -103,6 +105,8 @@ + OPTIONS for OPERATION enroll are + -k Private key file + -r Certificate request file ++ -K Signature private key file ++ -O Signature certificate (used instead of self-signed) + -l Write enrolled certificate in file + -e Use different CA cert for encryption + -L Write selfsigned certificate in file +@@ -152,6 +156,16 @@ + CAIdentifier Some CAs require you to define this. Example: mydomain.com + Command line option: -i + ++CheckSubjectName ++ Check subject DN in the certificate return by the CA. The ++ default is to match on the public key only. Up to version ++ 20040325 sscep checked on the subject DN only, which is a ++ problem e.g. if the CA adds a SER attribute, enforces a ++ naming policy or fixes encoding errors (e.g. with Java keytool ++ and DC). ++ Example: yes ++ Command line option: -C ++ + CertReqFile Certificate request file created with mkrequest. + Example: ./local.csr + Command line option: -r +@@ -171,6 +185,21 @@ + the signature. Example: ./enc.crt + Command line option: -e + ++SignCertFile Instead of creating a self-signed certificate from the ++ new key pair use an already existing certficate/key to ++ sign the SCEP request. If the "old" certificate and ++ key is used, the CA can verify that the holder of the ++ private key for an existing certificate re-enrolls for ++ a renewal certificate, allowing for automatic approval ++ of the request. Requires specification of the corresponding ++ signature private key file (-K, SignKeyFile). ++ Example: ./sig.crt ++ Command line option: -O ++ ++SignKeyFile See SignCertFile. Specifies the corresponding private key. ++ Example: ./sig.key ++ Command line option: -K ++ + FingerPrint Display fingerprint algorithm. Available algorithms are md5 + and sha1. Default is md5. + Command line option: -F +@@ -367,6 +396,23 @@ + the challenge password), it returns SUCCESS as a first reply. Otherwise, the + enrollment requires manual signing and authentication (perhaps a phone call). + ++Newer SCEP draft versions allow to use the existing certificate (issued ++by the CA) to authenticate a renewal request. In this context, the SCEP ++request with the new public key is signed with the old certificate and ++key (instead of using a self-signed certificate created from the new ++key pair). ++To use this feature, use the command line options -O and -K to specify ++the old certificate and private key (SignCertFile and SignCertKey ++in the configuration file). ++The actual behaviour of the SCEP server depends on the CA policy and ++on the capabilities of the SCEP server (not all servers implement ++this feature, using the existing certificate with an older SCEP server ++may or may not work, depending on implementation). ++ ++Note: Newer versions of OpenCA (http://www.openca.info/) support ++an SCEP server that is capable of automatically approving SCEP requests ++signed with the already existing key pair. ++ + + STEP 5 - Use certificate + ======================== +diff -uN sscep/cmd.h sscep-ng2/cmd.h +--- sscep/cmd.h 2003-01-30 08:57:34.000000000 +0100 ++++ sscep-ng2/cmd.h 2006-04-28 10:01:10.000000000 +0200 +@@ -16,6 +16,9 @@ + int c_flag; + char *c_char; + ++/* Check subject DN */ ++int C_flag; ++ + /* Debug? */ + int d_flag; + +@@ -51,10 +54,18 @@ + char *k_char; + int k_flag; + ++/* Private key of already existing certificate */ ++char *K_char; ++int K_flag; ++ + /* Request count */ + int n_flag; + int n_num; + ++/* Already existing certificate (to be renewed) */ ++char *O_char; ++int O_flag; ++ + /* Proxy */ + char *p_char; + int p_flag; +diff -uN sscep/draft-nourse-scep-11.txt sscep-ng2/draft-nourse-scep-11.txt +--- sscep/draft-nourse-scep-11.txt 1970-01-01 01:00:00.000000000 +0100 ++++ sscep-ng2/draft-nourse-scep-11.txt 2006-04-25 16:27:03.000000000 +0200 +@@ -0,0 +1,2367 @@ ++ ++INTERNET DRAFT Xiaoyi Liu ++draft-nourse-scep-11.txt Cheryl Madson ++expires 11 Aug 2005 David McGrew ++(revised 11 Feb 2005) Andrew Nourse ++ Cisco Systems ++ ++Category: Informational 11 Feb 2005 ++ ++ ++Cisco Systems' Simple Certificate Enrollment Protocol(SCEP): ++ ++Status of this Memo ++ ++This document is an Internet-Draft and is NOT offered in accordance ++with Section 10 of RFC2026, and the author does not provide the IETF ++with any rights other than to publish as an Internet-Draft ++ ++Internet-Drafts are working documents of the Internet Engineering Task ++Force (IETF), its areas, and its working groups. Note that other ++groups may also distribute working documents as Internet-Drafts. ++ ++Internet-Drafts are draft documents valid for a maximum of six months ++and may be updated, replaced, or obsoleted by other documents at any ++time. It is inappropriate to use Internet- Drafts as reference ++material or to cite them other than as "work in progress." ++ ++The list of current Internet-Drafts can be accessed at ++http://www.ietf.org/ietf/1id-abstracts.txt ++ ++The list of Internet-Draft Shadow Directories can be accessed at ++http://www.ietf.org/shadow.html. ++ ++This memo provides information for the Internet community. This memo ++does not specify an Internet standard of any kind. Distribution of ++this memo is unlimited. ++ ++By submitting this Internet-Draft, I certify that any applicable patent ++or other IPR claims of which I am aware have been disclosed, or will be ++disclosed, and any of which I become aware will be disclosed, in accordance ++with RFC 3668. ++ ++Abstract ++ ++This document specifies the Simple Certificate Enrollment Protocol, ++a PKI communication protocol which leverages existing technology by ++using PKCS#7 and PKCS#10. SCEP is the evolution of the enrollment ++protocol developed by Verisign, Inc. for Cisco Systems, Inc. ++It now enjoys wide support in both client and CA implementations. ++ ++ ++Table of Contents ++ ++ 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . 2 ++ 2. The Goal of SCEP . . . . . . . . . . . . . . . . . . . . . 3 ++ 2.1 SCEP Entity types . . . . . . . . . . . . . . . . . . . . 3 ++ 2.2 SCEP Operations Overview . . . . . . . . . . . . . . . . . 7 ++ 2.3 PKI Operation Transactional Behavior . . . . . . . . . . . 10 ++ 2.4 Security . . . . . . . . . . . . . . . . . . . . . . . . . 12 ++ 3. Transport Protocol . . . . . . . . . . . . . . . . . . . . 13 ++ 4. Secure Transportation: PKCS #7 . . . . . . . . . . . . . . 14 ++ 4.1 SCEP Message Format . . . . . . . . . . . . . . . . . . . 14 ++ ++ Liu/Madson/McGrew/Nourse [Page 2] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ 4.2 Signed Transaction Attributes . . . . . . . . . . . . . . 15 ++ 5. SCEP Transaction Specification . . . . . . . . . . . . . . 16 ++ 5.1 Certificate Enrollment . . . . . . . . . . . . . . . . . . 16 ++ 5.2 Poll for Requester Initial Certificate . . . . . . . . . . 22 ++ 5.3 Certificate Access . . . . . . . . . . . . . . . . . . . . 26 ++ 5.4 CRL Access . . . . . . . . . . . . . . . . . . . . . . . 27 ++ 5.5 Get Certificate Authority Certificate . . . . . . . . . . 31 ++ 5.6 Get Certificate Authority Certificate Chain . . . . . . . 33 ++ 6. Security Considerations . . . . . . . . . . . . . . . . . 33 ++ 7. Intellectual Propoerty . . . . . . . . . . . . . . . . . . 33 ++ 8. References . . . . . . . . . . . . . . . . . . . . . . . . 33 ++ Appendix A. Cisco Requester Subject Name Definition . . . . . . 34 ++ Appendix B. IPSEC Client Enrollment Certificate Request . . . . 35 ++ Appendix C. Private OID Definitions . . . . . . . . . . . . . 36 ++ Appendix D. Obtaining CRL by LDAP Query . . . . . . . . . . . . 36 ++ Appendix E. SCEP State Transitions . . . . . . . . . . . . . . 37 ++ Appendix F. CA Capabilities . . . . . . . . . . . . . . . . . . 40 ++ Appendix G. Certificate Renewal and CA Key Rollover . . . . . . 41 ++ Appendix H. PKIOperation via HTTP POST Message. . . . . . . . . 42 ++ Appendix Y. Author Contact Information. . . . . . . . . . . . . 43 ++ Appendix Z. Copyright Section . . . . . . . . . . . . . . . . . 43 ++ ++Section 1. Introduction ++ ++Public key technology is becoming more widely deployed and is becoming ++the basis for standards based security, such as the Internet Engineering ++Task Force's IPSEC and IKE protocols. With the use of public key ++certificates in network security protocols comes the need for a ++certificate management protocol that Public Key Infrastructure (PKI) ++clients and Certificate Authority servers can use to support certificate ++life cycle operations such as certificate enrollment and revocation, and ++certificate and CRL access. ++ ++In the following, Section 2 gives an overview of the PKI operations, ++and Section 2.4 describes the security goals of the protocol and the ++mechanisms used to achieve them. The transport protocol and the ++security protocol PKCS#7 are described at Section 3 and Section 4, ++respectively. The last section, Section 5, specifies each PKI ++operation in terms of the message formats and the data structures of ++each operation. ++ ++The appendices provide detailed specifications and examples. Requester ++subject names are specified in Appendix A, attribute OIDs are ++specified in Appendix C , and the SCEP state transitions are described ++in Appendix E. An example of a certificate enrollment request is ++provided in Appendix B, and an example LDAP query URL encoding is ++provided in Appendix D. ++ ++The authors would like to thank Peter William of ValiCert, Inc. ++(formerly of Verisign, Inc) and Alex Deacon of Verisign, Inc. and ++Christopher Welles of IRE, Inc. for their contributions to this protocol ++and to this document. ++ ++ Liu/Madson/McGrew/Nourse [Page 3] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++2.0 The Goal of SCEP ++The goal of SCEP is to support the secure issuance of certificates to ++network devices in a scalable manner, using existing technology whenever ++possible. The protocol supports the following operations: ++ ++ CA and RA public key distribution ++ Certificate enrollment ++ Certificate revocation ++ Certificate query ++ CRL query ++ ++Certificate and CRL access can be achieved by using the LDAP protocol ++(as specified in Appendix D), or by using the query messages defined in ++SCEP. The use of HTTP certificate and CRL access, and the support of ++CDP as specified in RFC2459, will be specified in a future version of ++this document. In Section 2.1, we first define PKI entity types as well ++as the properties of each entity type. In Section 2.2, the PKI ++operations are described at functional level. Section 2.3 describes the ++transaction behavior of each PKI operations. The complete PKI messages ++are covered in Section 5. ++ ++2.1 SCEP Entity types ++ ++The entity types defined in SCEP are the "requester" type (i.e., IPSEC ++clients), the Certificate Authority (CA) entity type, and the ++Registration Authority entity type (RA). A requester is sometimes ++called a "SCEP client" in the following. ++ ++2.1.1 Requesters ++ ++A requester is an entity whose name is defined in a certificate ++subject name field and optionally, in SubjectAltName, a X.509 ++certificate V3 extension. As a requester, a SCEP client is identified ++by a subject name consisting of the following naming attributes: ++ ++ Fully qualified domain name, for example, router.cisco.com ++ IP address, Serial number, and/or x.500 distinguished name ++ ++The fully qualified domain name is required for a requester that intends ++to use the certificate for ISAKMP. The IP address, serial number, and ++x.500 distinguished name are optional name attributes. In the ++certificate enrollment request, the PKCS#10 subject field contains the ++required and optional name attributes. The distinguished name, if any, ++should be the subject name field, while any domain name, serial number, ++or IP address supplied should be in the subjectAltName field. The ++subject name field may be empty (if there is no distinguished name) ++or the subjectAltName may be omitted, but not both. ++ ++It is important to note that a client named as Alice.cisco.com is ++different than a client named as Alice.cisco.com plus the IP address ++name attribute 117.96.1.219. From CA point of view, the Distinguished ++names assigned in these two cases are distinct names. ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 4] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++Entity names which are specified as in the IPSEC profile (i.e., FQDN, IP ++address and User FQDN) must be presented in certificate's SubjectAltName ++extension. Multiple IPSEC entity names, (if any) are encoded as multiple ++values of a single SubjectAltName extension. The CA has the authority ++to assign a distinguished name to a requester, whether or not one was ++included in the request. The assigned DN should contain the SCEP client ++names as the relative DN. ++ ++The attribute identifiers and an example of SCEP client subject name are ++specified in Appendix A. Appendix B has an example from Cisco VPN Client ++enrollment request. ++ ++2.1.1.1 Local Key/Certificate/CRL Storage and Certificate-name uniqueness ++ ++A requester is required to generate asymmetric key pairs and to provide ++storage to store its private keys. If the requester does not have enough ++permanent memory to save its certificate, then it should be able to query ++its own certificate from the CA or an LDAP server, once the certificate ++has been issued. The public key pairs can be generated with a specific ++key usage. The key usage is conveyed to the CA through the certificate ++enrollment request. All current SCEP client implementations expect that ++there will be only one pair of keys for a given subject name ++and key usage combination and CA, at any time. This property is called ++the certificate-name uniqueness property, and it implies that a CA that ++implements SCEP will enforce the unique mapping between a SCEP client ++subject name and its key pairs with a given key usage. At any time, if ++the subject name is changed, or if the key is updated, the existing ++certificate would have to be revoked before a new one could be issued. ++ ++It is desirable that the CA enforce certificate-name uniqueness, but ++it is not mandatory. However a CA that does not enforce uniqueness ++must provide some other mechanism to prevent the re-transmission of an ++enrollment request by a SCEP client from creating a second certificate ++or certificate request, nor can the second request merely be rejected. ++If a client times out from polling for a pending request it can ++resynchronize by reissuing the original request with the original ++subject name, key, and transaction ID. This should return the status of ++the original transaction, including the certificate if it was granted. ++It should not create a new transaction unless the original cert has been ++revoked, or the transaction arrives more than halfway through the ++validity time of the original certificate. ++ ++An enrollment request that occurs more than halfway through the validity ++time of an existing certificate for the same subject name and key usage ++MAY be interpreted as a re-enrollment or renewal request and accepted. ++A new certificate with new validity dates may be issued, even though ++the old one is still valid, if the CA policy permits, as described in ++2.1.1.3. See also appendix G. ++ ++2.1.1.2 Requester authentication ++ ++As with every protocol that uses public-key cryptography, the ++association between the public keys used in the protocol and the ++identities with which they are associated must be authenticated in a ++ Liu/Madson/McGrew/Nourse [Page 5] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++cryptographically secure manner. This requirement is needed to ++prevent a "man in the middle" attack, in which an adversary that can ++manipulate the data as it travels between the protocol participants ++can subvert the security of the protocol. To satisfy this ++requirement, SCEP provides two authentication methods: manual ++authentication, and authentication based on pre-shared secret. In the ++manual mode, the requester is required to wait until its identity can ++be verified by the CA operator using any reliable out-of-band ++method. To prevent a "man-in-the-middle" attack, a SHA-1 or MD5 ++`fingerprint' generated on the PKCS#10 (before PKCS #7 enveloping and ++signing) must be compared out-of-band between the server and the ++requester. SCEP clients and CAs (or RAs, if appropriate) must display ++this fingerprint to the operator to enable this verification if manual ++mode is used. Failing to provide this information leaves the protocol ++vulnerable to attack by sophisticated adversaries. When utilizing a ++pre-shared secret scheme, the server should distribute a shared secret ++to the requester which can uniquely associate the enrollment request ++with the given end entity. The distribution of the secret must be ++private: only the end entity should know this secret. The actual ++binding mechanism between the requester and the secret is subject to ++the server policy and implementation. When creating the enrollment ++request, the requester is asked to provide a challenge password. When ++using the pre-shared secret scheme, the requester must enter the ++re-distributed secret as the password. In the manual authentication ++case, the challenge password only used to authenticate a request for ++the certificate's revokation. This challenge password is included as ++a PKCS#10 attribute, and is sent to the server as encrypted data. The ++PKCS#7 envelope protects the privacy of the challenge password with ++DES encryption. ++ ++2.1.1.3 Requester Uses Existing CA-Issued or Self-Signed Certificates ++ ++In this protocol, the communication between the requester and the ++certificate authority is secured by using PKCS#7 as the messaging ++protocol. PKCS#7, however, is a protocol which assumes the ++communicating entities already possess the peer's certificates and ++requires both parties use the issuer names and issuer assigned ++certificate serial numbers to identify the certificate in order to ++verify the signature and decrypt the message. If the requesting ++system already has a certificate issued by the CA, that certificate ++may be presented as credentials for the renewal of that certificate if ++the CA supports the "Renewal" capability and the CA policy permits the ++certificate to be renewed. If the requester has no certificate issued ++by the CA, or if the CA does not support and permit renewal, the ++requestor must generate a self-signed certificate with the requester ++subject name (the same name later used in the PKCS#10) as both issuer ++and subject name. During the certificate enrollment, the requester ++will first post itself as the signing authority by attaching the ++self-signed certificate to the signed certificate request. When the ++Certificate Authority makes the envelope on the issued certificate ++using the public key included in the self-signed certificate, it ++should use the same issuer name and serial number as conveyed in the ++self-signed certificate to inform the end entity on which private key ++should be used to open the envelope. ++ Liu/Madson/McGrew/Nourse [Page 6] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++Note that when a client enrolls for separate encryption and signature ++certificates, it may use the signature certificate to sign both ++requests, and then expect its signature key to be used to encrypt ++both responses. In any case, the recipientinfo on the envelope should ++reflect the key used to encrypt the request. ++ ++2.1.1.4 Trusted CA Store ++ ++To support interoperability between IPSEC peers whose certificates are ++issued by different CA, SCEP allows the users to configure multiple ++trusted certificates. Trusted certificates are have been configured as ++such in the client, based on some out-of-band means such as a "fingerprint". ++These trusted certificates are used to verify certificate chains that end ++in those certificates. ++ ++2.1.2 Certificate Authority ++ ++A Certificate Authority(CA) is an entity whose name is defined in the ++certificate issuer name field. Before any PKI operations can begin, ++the CA generates its own public key pair and creates a self-signed CA ++certificate, or causes another CA to issue a certificate to it. ++Associated with the CA certificate is a fingerprint which will be used ++by the requester to authenticate the received CA certificate if it is ++self-signed. The fingerprint is created by calculating a SHA-1 or MD5 ++hash on the whole CA certificate. Before any requester can start its ++enrollment, this CA certificate has to be configured at the entity ++side securely. For IPSEC clients, the client certificates must have ++SubjectAltName extension. To utilize LDAP as a CRL query protocol, ++the certificates must have a CRL Distribution Point. Key usage is ++optional. Without key usage, the public key is assumed as a general ++purpose public key and it can be used for all the purposes. ++ ++A Certificate Authority may enforce certain name policy. When using ++X.500 directory name as the subject name, all the name attributes ++specified in the PKCS#10 request should be included as Relative DN. All ++the name attributes as defined in RFC2459 should be specified in the ++SubjectAltName. An example is provided in Appendix A. ++ ++ If there is no LDAP query protocol support, the Certificate Authority ++should answer certificate and CRL queries, and to this end it should be ++online all the time. ++ ++The updating of the CA's public key is addressed in Appendix G. ++ ++2.1.3 Registration Authorities ++ ++In an environment where an RA is present, a requester performs ++enrollment through the RA. In order to setup a secure channel with an RA ++using PKCS#7, the RA certificate(s) have to be obtained by the client ++in addition to the CA certificate(s). ++ ++In the following, the CA and RA are specified as one entity in the ++context of PKI operation definitions. ++ Liu/Madson/McGrew/Nourse [Page 7] ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++2.2 SCEP Operations Overview ++ ++In this section, we give a high level overview of the PKI operations as ++defined in SCEP. ++ ++2.2.1 Requester Initialization ++ ++The requester initialization includes the key pair generation and the ++configuring of the required information to communicate with the ++certificate authority. ++ ++2.2.1.1 Key Pairs ++ ++Before a requester can start PKI transaction, it must have at least one ++asymmetric key pair, using the selected algorithm (the RSA algorithm is ++required in SCEP, and is the only algorithm in current implementations). ++ ++Key pairs may be intended for particular purposes, such as encryption only, ++or signing only. The usage of any associated certificate can be restricted ++by adding key usage and extended key usage attributes to the PKCS#10. ++ ++2.2.1.2 Required Information ++ ++A requester is required to have the following information configured ++before starting any PKI operations: ++ ++1. the certificate authority IP address or fully-qualified domain name, ++2. the certificate authority HTTP CGI script path, and ++ the HTTP proxy information in case there is no direct Internet ++ connection to the server, ++3. If CRLs are being published by the CA to an LDAP directory server, ++ and there is a CRL Distribution Point containing only an X.500 directory ++ name, then the client will need to know the LDAP server fully-qualified ++ domain name or IP address. CRL Distribution Points are discussed in ++ more detail in RFC 2459. ++ ++ ++2.2.2 CA/RA Certificate Distribution ++ ++Before any PKI operation can be started, the requester needs to get ++the CA/RA certificates. At this time, since no public key has been ++ ++ Liu/Madson/McGrew/Nourse [Page 8] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++exchanged between the requester and the CA/RA, the message to get the ++CA/RA certificate can not be secured using PKCS#7 protocol. Instead, the ++CA/RA certificate distribution is implemented as a clear HTTP Get ++operation. After the requester gets the CA certificate, it has to ++authenticate the CA certificate by comparing the finger print with the ++CA/RA operator. Since the RA certificates are signed by the CA, there is ++no need to authenticate the RA certificates. ++ ++This operation is defined as a transaction consisting of one HTTP Get ++message and one HTTP Response message: ++ ++ REQUESTER CA SERVER ++ Get CA/RA Cert: HTTP Get message ++ -----------------------------> ++ CA/RA Cert download: HTTP Response message ++ <--------------------------------------- ++ Compute finger print and ++ call CA operator. ++ Receive call and check finger print ++ ++If an RA is in use, a degenerated PKCS#7 with a certificate chain ++consisting of both RA and CA certificates is sent back to the end ++entity. Otherwise the CA certificate is directly sent back as the ++HTTP response payload. ++ ++ ++2.2.3 Certificate Enrollment ++ ++A requester starts an enrollment transaction by creating a certificate ++request using PKCS#10 and sends it to the CA/RA enveloped using the ++PKCS#7. After the CA/RA receives the request, it will either ++automatically approve the request and send the certificate back, or it ++will require the requester to wait until the operator can manually ++authenticate the identity of the requester. Two attributes are ++included in the PKCS#10 certificate request - a Challenge Password ++attribute and an optional ExtensionReq attribute which will be a ++sequence of extensions the requester would like to be included in its ++V3 certificate extensions. The Challenge Password may be used to ++authenticate either the enrollment request itself, or a verbal ++revocation request for the issued certificate in the event of key ++compromise or other reason. ++ ++In the automatic mode, the transaction consists of one PKCSReq PKI ++Message, and one CertRep PKI message. In the manual mode, the requester ++enters into polling mode by periodically sending a GetCertInitial PKI ++message to the server, until the server operator completes the manual ++authentication, after which the CA will respond to GetCertInitial by ++returning the issued certificate. A CA MAY run in automatic mode for ++preapproved requests, and manual mode for the rest. A request with a ++non-null password is not necessarily a pre-approved request. It is up ++to the CA server to decide. Polling mode is entered whenever the ++server returns a PENDING response. ++ ++ Liu/Madson/McGrew/Nourse [Page 9] ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ ++The transaction in automatic mode: ++ ++ REQUESTER CA SERVER ++ ++PKCSReq: PKI cert. enrollment msg ++ --------------------------------> CertRep: pkiStatus = SUCCESS ++ certificate attached ++ <------------------------------ ++ Receive issued certificate. ++ ++The transaction in manual mode: ++ ++ REQUESTER CA SERVER ++ PKCSReq: PKI cert. enrollment msg ++ --------------------------------> CertRep: pkiStatus = PENDING ++ <------------------------------ ++ GetCertInitial: polling msg ++ --------------------------------> CertRep: pkiStatus = PENDING ++ <------------------------------ ++ ................. CertRep: pkiStatus = SUCCESS ++ certificate attached ++ <------------------------------ ++ Receive issued certificate. ++ ++2.2.4 Requester Certificate Revocation ++ ++A requester should be able to revoke its own certificate. Currently ++the revocation is implemented as a manual process. In order to revoke a ++certificate, the requester makes a phone call to the CA server ++operator. The operator will come back asking the ChallengePassword ++(which has been sent to the server as an attribute of the PKCS#10 ++certificate request). If the ChallengePassword matches, the certificate ++is revoked. The reason of the revocation is documented by CA/RA. ++ ++2.2.5 Certificate Access ++ ++There are two methods to query certificates. The first method is to use ++LDAP as a query protocol. Using LDAP to query assumes the client ++understand the LDAP scheme supported by the CA. The SCEP client assumes ++that the subject DN name in the certificate is used as the URL to query the ++certificate. The standard attributes (userCertificate and caCertificate) ++are used as filter. ++ ++For the environment where LDAP is not available, a certificate query ++message is defined to retrieve the certificates from the CA. ++ ++To query a certificate from the certificate authority, a requester ++sends a request consisting of the certificate's issuer name and the ++serial number. This assumes that the requester has saved the issuer ++ ++ Liu/Madson/McGrew/Nourse [Page 10] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++name and the serial number of the issued certificate from the previous ++enrollment transaction. The transaction to query a certificate consists ++of one GetCert PKI message and one CertRep PKI message: ++ ++ REQUESTER CA SERVER ++ GetCert: PKI cert query msg ++ -------------------------------> CertRep: pkiStatus = SUCCESS ++ certificate ++attached ++ <----------------------------- ++ Receive the certificate. ++ ++2.2.6 CRL Distribution ++ ++The CA/RA will not "push" the CRL to the end entities. The query of the ++CRL can only be initialized by the requester. ++ ++There are three methods to query CRL. ++ ++The CRL may be retrieved by a simple HTTP GET. If the CA supports this ++method, it should encode the URL into a CRL Distribution Point extension ++in the certificates it issues. Support for this method should be ++incorporated in new and updated clients, but may not be in older ++versions. ++ ++The second method is to query CRL using LDAP. This assumes the CA server ++supports CRL LDAP publishing and issues the CRL Distribution Point in ++the certificate. The CRL Distribution Point is encoded as a DN. Please ++refer to Appendix D for the examples of CRL Distribution Point. ++ ++The third method is implemented for the CA which does not support LDAP ++CRL publishing or does not implement the CRL Distribution Point. In this ++case, a CRL query is composed by creating a message consists of the CA ++issuer name and the CA's certificate serial number. This method is ++deprecated because it does not scale well and requires the CA to be a ++high-availability service. ++ ++The message is sent to the CA in the same way as the other SCEP ++requests: The transaction to query CRL consists of one GetCRL PKI ++message and one CertRep PKI message which have no certificates but CRL. ++ ++ REQUESTER CA SERVER ++ GetCRL: PKI CRL query msg ++ ----------------------------------> CertRep: CRL attached ++ <-------------------------------- ++ ++2.3 PKI Operation Transactional Behavior ++ ++As described before, a PKI operation is a transaction consisting of the ++messages exchanged between a requester and the CA/RA. This section ++will specify the transaction behavior on both the requester and the ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 11] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++certificate authority server. Because the protocol is basically a two ++way communication protocol without a confirmation message from the ++initiating side, state and state resynchronization rules have to be ++defined, in case any error happens at either side. Before the state ++transition can be defined, the notion of transaction identifier has to ++be defined first. ++ ++2.3.1 Transaction Identifier ++ ++A transaction identifier is a string generated by the entity when ++starting a transaction. Since all the PKI operations defined in this ++protocol are initiated by the requester, it is the responsibility of ++the requester to generate a unique string as the transaction ++identifier. All the PKI messages exchanged for a given PKI transaction ++must carry the same transaction identifier. The transaction identifier ++is generated as a SHA-1 or MD5 hash on the public key value for which the ++enrollment request is made. This allows the SCEP client to reuse the ++same transaction identifier if it is reissuing a request for the same ++certificate (i.e. a certificate with the same subject, issuer, and key). ++The SCEP protocol requires that transaction identifiers be unique, so ++that queries can be matched up with transactions. For this reason, in ++those cases in which separate signing and encryption certificates are ++issued to the same requester, the keys must be different. ++ ++2.3.2 State Transitions in Certificate Enrollment ++ ++The requester state transitions during enrollment operation are ++indicated in the diagram below: ++ +-<------+ ++ | | ++ GetCertInitial triggered by timeout or ++ | | manual authentication ++ | | ++ [CERT-NONEXISTANT] ------> [CERT-REQ-PENDING] ---> [CERT-ISSUED] ++ | PKCSReq | CertRep with SUCCESS ++ | | ++ | | ++ +--------<-------------------+ ++ request rejected, timeout, or error ++ ++As described in the section 2.2.3, certificate enrollment starts at the ++state CERT-NONEXISTANT. Sending PKCSReq changes the state to ++CERT-REQ-PENDING. Receiving CertRep with SUCCESS status changes the ++state to CERT-ISSUED. In the case the server sending back the response ++with pending status, the requester will keep polling certificate ++response by sending GetCertInitial to the server, until either a CertRep ++with SUCCESS status is received, or the maximum polling number has been ++exceeded. ++ ++If an error or timeout occurs in the CERT-REQ-PENDING state, the end ++entity will transition to the CERT-NONEXISTANT state. ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 12] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ ++The client administrator will, eventually, start up another enrollment ++request. It is important to note that, as long as the requester does ++not change its subject name or keys, the same transaction id will be ++used in the "new" transaction. This is important because based on this ++transaction id, the certificate authority server can recognize this as ++an existing transaction instead of a new one. ++ ++ ++2.3.3 Transaction Behavior of Certificate/CRL Access ++ ++There is no state maintained during certificate access and CRL access ++transaction. When using the certificate query and CRL query messages ++defined in this protocol, the transaction identifier is still required ++so that the requester can match the response message with the ++upstanding request message. When using LDAP to query the certificate and ++the CRL, the behavior is specified by the LDAP protocol. ++ ++2.4 Security ++ ++The security goals of SCEP are that no adversary can: ++ ++o subvert the public key/identity binding from that intended, ++o discover the identity information in the enrollment requests and ++ issued certificates, ++o cause the revocation of certificates with any non-negligible ++ probability. ++ ++Here an adversary is any entity other than the requester and the CA ++(and optionally the RA) participating in the protocol that is ++computationally limited, but that can manipulate data during ++transmission (that is, a man-in-the-middle). The precise meaning of ++'computationally limited' depends on the implementer's choice of ++cryptographic hash functions and ciphers. The required algorithms are ++RSA, DES, and either SHA-1 or MD5, depending on the "SHA-1" CA Capability. ++[See Appendix F]. ++ ++The first and second goals are met through the use of PKCS#7 and PKCS#10 ++encryption and digital signatures using authenticated public keys. The ++CA's public key is authenticated via the checking of the CA fingerprint, ++as specified in Section 2.1.2, and the SCEP client's public key is ++authenticated through the manual authentication or pre-shared secret ++authentication, as specified in Section 2.1.1.2. The third goal is met ++through the use of a Challenge Password for revocation, that is chosen ++by the SCEP client and communicated to the CA protected by the PKCS#7 ++encryption, as specified in Section 2.2.4. ++ ++The motivation of the first security goal is straightforward. The ++motivation for the second security goal is to protect the identity ++information in the enrollment requests and certificates. For example, ++two IPSEC hosts behind a firewall may need to exchange certificates, and ++may need to enroll certificates with a CA that is outside of a firewall. ++Most networks with firewalls seek to prevent IP addresses and DNS ++ ++ Liu/Madson/McGrew/Nourse [Page 13] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++information from the trusted network leaving that network. The second ++goal enables the hosts in this example to enroll with a CA outside the ++firewall without revealing this information. The motivation for the ++third security goal is to protect the SCEP clients from denial of ++service attacks. ++ ++Section 3 Transport Protocol ++ ++In the SCEP protocol, HTTP is used as the transport protocol for the PKI ++messages. ++ ++3.1 HTTP "GET" and "POST" Message Format ++ ++The following is the syntax definition of a HTTP GET message sent from ++a requester to a certificate authority server: ++ ++Request = "GET " CGI-PATH CGI-PROG "?operation=" OPERATION "&message=" MESSAGE ++where: ++ CGI-PATH defines the actual CGI path to invoke the CGI program which ++ parses the request. ++ CGI-PROG is set to be the string "pkiclient.exe". This is intended ++ to be the program that the CA will use to handle the SCEP transactions, ++ though the CA may ignore CGI-PROG and use only the CGI-PATH. ++ OPERATION is set to be the string "PKIOperation" when the GET message ++ carries a PKI message to request certificates or CRL; OPERATION is set ++ to be the string "GetCACaps", "GetCACert", "GetNextCACert" or ++ "GetCACertChain" when the GET operation is used to get CA capabilities, ++ CA/RA certificate, the replacement CA/RA certificates for when the ++ current ones expire, or the CA Cert chain (respectively). ++ ++ When OPERATION is "PKIOperation", MESSAGE is a base64-encoded PKI message, ++ When OPERATION is GetCACert, MESSAGE is a CRL distribution ++ point in URI format, otherwise, MESSAGE is a string which represents ++ the certificate authority issuer identifier. ++ ++SCEP uses the HTTP "GET" and "POST" messages to request information from the CA. ++Requests for CA certificates or capabilities are sent in the clear, using "GET", ++with the OPERATION and MESSAGE fields identifying the requested data. ++CRLs may also be requested in the clear if the CA supports it. ++ ++Other types of requests are sent using the PKCS#7 secure protocol. ++These may be issued by means of a GET operation with ++OPERATION and MESSAGE parameters in the Request-URL. OPERATION ++identifies the type of GET operation, and MESSAGE is actually the PKCS#7 ++message Base64-Encoded. ++ ++For example. a requester may submit a message via HTTP to the server ++as follows: ++ ++GET /cgi-bin/pkiclient.exe?operation=PKIOperation&message=MIAGCSqGSIb3D ++QEHA6CAMIACAQAxgDCBzAIBADB2MGIxETAPBgNVBAcTCE ......AAAAAA== ++ Liu/Madson/McGrew/Nourse [Page 13a] ++ ++If supported by the CA, the message may also be sent via HTTP POST: ++ ++POST /cgi-bin/pkiclient.exe?operation=PKIOperation ++ ++This is further described in Appendix H. ++To determine if the CA supports POST, use the GetCACaps message described ++in Appendix F. ++ ++ ++3.2 Response Message Format ++ ++For each GET operation, the CA/RA server will return a MIME object via ++HTTP. For a GET operation with PKIOperation as its type, the response is ++tagged as having a Content Type of application/x-pki-message. The body ++of this message is a BER encoded binary PKI message. The following is an ++example of the response: ++ ++"Content-Type:application/x-pki-message\n\n" ++ ++In the case of GET operation with a type of GetCACert the MIME content ++type returned will depend on whether or not an RA is in use. If there ++is no RA, only the CA certificate is sent back in the response, and ++the response has the content type tagged as ++application/x-x509-ca-cert. the body of the response is a DER encoded ++binary X.509 certificate. For example: ++ ++"Content-Type:application/x-x509-ca-cert\n\n" ++ ++If there is an RA, the RA certificates are sent back together with the ++CA certificates, a certificate-only PKCS#7 SignedData is sent back in ++the response where the SignerInfo is empty. Section 5 has the detailed ++definition of the message format in this case. The content type is ++application/x-x509-ca-ra-cert. ++ ++The response to GetNextCACert is always a certificates-only PKCS#7 ++SignedData with a content type of application/x-x509-ca-ra-cert. ++If there is an RA, The signer is the current RA certificate. Otherwise, ++the signer is the current CA certificate. ++ ++If the CA supports it, PKIOperation may also be done via an HTTP POST. ++This is described in Appendix H. ++ ++ Liu/Madson/McGrew/Nourse [Page 14] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++Section 4 Secure Transportation: PKCS#7 ++ ++PKCS#7 is a general enveloping mechanism that enables both signed and ++encrypted transmission of arbitrary data. It is widely implemented and ++included in the RSA tool kit. In this section, the general PKCS#7 ++enveloped PKI message format is specified. The complete PKCS#7 message ++format for each PKI transaction will be covered in Section 5. ++ ++4.1 SCEP Message Format ++ ++As a transaction message, a SCEP message has a set of transaction ++specific attributes and an information portion. Employing PKCS#7 ++protocol, the transaction specific attributes are encoded as a set of ++authenticated attributes of the SignedData. The information portion will ++first be encrypted to become Enveloped Data, and then the digest of the ++enveloped information portion is included as one of the message digest ++attributes and being signed together with the other transaction specific ++attributes. ++ ++By applying both enveloping and signing transformations, a SCEP message ++is protected both for the integrity of its end-end-transition ++information and the confidentiality of its information portion. The ++advantage of this technique over the conventional transaction message ++format is that, the signed transaction type information and the status ++of the transaction can be determined prior to invoke security handling ++procedures specific to the information portion being processed. ++ ++The following is an example of a SCEP message with its enveloped and ++signed data portion represented by pkcsPKISigned and ++pkcsPKIEnveloped. The out-most of any PKI message is a blob of ++ContentInfo, with its content type set to SignedData and the actual ++signed data as the content. ++ ++ Liu/Madson/McGrew/Nourse [Page 15] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ pkiMessage ContentInfo ::= { ++ contentType {pkcs-7 signedData(2)} ++ content pkcsPKISigned ++ } ++ pkcsPKISigned SignedData ::= { ++ version 1 ++ digestAlgorithm { iso(1) member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ contentInfo { ++ contentType {pkcs-7 1} -- data content identifier ++ content pkcsPKIEnvelope -- enveloped information portion ++ } ++ certificates -- signer certificate chain ++ signerInfo -- including signed transaction info and the digest ++ -- of the enveloped information portion as the ++ -- authenticated attributes ++ } ++ pkcsPKIEnveloped EnvelopedData ::= { ++ version 0 ++ recipientInfos -- information required to open the envelop ++ encryptedContentInfo { ++ contentType {pkcs-7 1} -- data content identifier ++ contentEncryptionAlgorithm ++ encryptedContent -- encrypted information portion ++ } ++ } ++ ++4.2 Signed Transaction Attributes ++ ++The following transaction attributes are encoded as authenticated ++attributes. Please refer to Appendix B for the OID definitions. ++ ++transactionID PrintableString -- Decimal value as a string ++ messageType PrintableString -- Decimal value as a string ++ pkiStatus PrintableString -- Decimal value as a string ++ failinfo PrintableString -- Decimal value as a string ++ senderNonce Octet String ++ recipientNonce Octet String ++ ++where: ++ ++ The transactionID is an attribute which uniquely identify a ++ transaction. This attribute is required in all PKI messages. ++ ++ The messageType attribute specify the type of operation performed by the ++ transaction. This attribute is required in all PKI ++ messages. Currently, the following message types are defined: ++ ++ PKCSReq (19) -- Permits use of PKCS#10 certificate request ++ CertRep (3) -- Response to certificate or CRL request ++ GetCertInitial (20) -- Certificate polling in manual enrollment ++ GetCert (21) -- Retrieve a certificate ++ GetCRL (22) -- Retrieve a CRL ++ ++ Liu/Madson/McGrew/Nourse [Page 16] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ ++ All response message will include transaction status information which ++ is defined as pkiStatus attribute: ++ ++ SUCCESS (0) -- request granted ++ FAILURE (2) -- request rejected ++ PENDING (3) -- request pending for manual approval. ++ ++ If the status in the response is FAILURE, the failinfo attribute will ++ contain one of the following failure reasons: ++ ++ badAlg (0) -- Unrecognized or unsupported algorithm ident ++ badMessageCheck (1) -- integrity check failed ++ badRequest (2) -- transaction not permitted or supported ++ badTime (3) -- Message time field was not sufficiently close ++ to the system time ++ badCertId (4) -- No certificate could be identified matching ++ the provided criteria ++ ++ The attributes of senderNonce and recipientNonce are the 16 byte ++ random numbers generated for each transaction to prevent the replay ++ attack. ++ ++When a requester sends a PKI message to the server, a senderNonce is ++included in the message. After the server processes the request, it will ++send back the requester senderNonce as the recipientNonce and generates ++another nonce as the senderNonce in the response message. Because the ++proposed pki protocol is a two-way communication protocol, it is clear ++that the nonce can only be used by the requester to prevent the ++replay. The server has to employ extra state related information to ++prevent a replay attack. ++ ++Section 5. SCEP Transaction Specification ++ ++In this section each SCEP transaction is specified in terms of the ++complete messages exchanged during the transaction. ++ ++5.1 Certificate Enrollment ++ ++The certificate enrollment transaction consists of one PKCSReq message ++sent to the certificate authority from a requester, and one CertRep ++message sent back from the server. The pkiStatus returned in the ++response message is either SUCCESS, or FAILURE, or PENDING. The ++information portion of a PKCSReq message is a PKCS#10 certificate ++request, which contains the subject Distinguished Name, the subject ++public key, and two attributes, a ChallengePassword attribute to be used ++for revocation, and an optional ExtensionReq attribute which will be a ++sequence of extensions the requester expects to be included in its V3 ++certificate extensions. One of the extension attribute specifies the key ++usage. If the request is granted, the pkiStatus is set to SUCCESS, and ++the certificate is returned in CertRep; if the request is rejected, the ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 17] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++pkiStatus is set to FAILURE; if the server requires manual approval of ++the request, the pkiStatus is set to PENDING. The messages exchanged ++in the manual authentication mode is further specified in Section 5.2. ++ ++Precondition: ++ Both the requester and the certificate authority have completed their ++ initialization process. The requester has already been configured ++ with the CA/RA certificate. ++ ++Postcondition: ++ Either the certificate is received by the requester, or the end ++ entity is notified to do the manual authentication, or the request ++ is rejected. ++ ++5.1.1 PKCSReq Message Format ++ ++A PKCSReq message is created by following the steps defined below: ++ ++1. Create a PKCS#10 certificate request which is signed by the end ++ entity's private key, corresponding to the public key included in ++ the PKCS#10 certificate request. This constitutes the information ++ portion of PKCSReq. ++ ++2. Encrypt the PKCS#10 certificate request using a randomly generated ++ content-encryption key. This content-encryption key is then ++ encrypted by the CA's* public key and included in the recipientInfo. ++ This step completes the "envelope" for the PKCS#10 certificate ++ request. ++ ++3. Generate a unique string as the transaction id. ++ ++4. Generate a 16 byte random number as senderNonce. ++ ++5. Generate message digest on the enveloped PKCS#10 certificate request ++ using the selected digest algorithm. ++ ++6. Create SignedData by adding the requester's self- or CA-certificate ++ as the signer's public key certificate. Include the message type, ++ transaction id, the senderNonce and the message digest as the ++ authenticated attributes and sign the attributes using the end ++ entity's private key. This completes the SignedData. ++ ++7. The SignedData is prepended with the ContenInfo blob which indicates ++ a SignedData object. This final step completes the create of a ++ complete PKCSReq PKI message. ++ ++In the following, the PKCSReq message is defined following the ASN.1 ++notation. ++ ++For readability, the values of a field is either represented by a quoted ++string which specifies the intended value, or a constant when the value ++is known. ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 18] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ -- PKCSReq information portion ++ pkcsCertReq CertificationRequest ::= { -- PKCS#10 ++ version 0 ++ subject "the requester's subject name" ++ subjectPublicKeyInfo { ++ algorithm {pkcs-1 1} -- rsa encryption ++ subjectPublicKey "DER encoding of the requester's public key" ++ } ++ attributes { ++ challengePassword {{pkcs-9 7} "password string" } ++ extensions ++ } ++ signatureAlgorithm {pkcs-1 4} -- MD5WithRSAEncryption ++ signature "bit string which is created by signing inner content ++ of the defined pkcsCertReq using requester's private ++ key, corresponding to the public key included in ++ subjectPublicKeyInfo." ++ } ++ -- Enveloped information portion ++ pkcsCertReqEnvelope EnvelopeData ::= { -- PKCS#7 ++ version 0 ++ recipientInfo { ++ version 0 ++ issuerAndSerialNumber { ++ issuer "the CA issuer name" ++ serialNumber "the CA certificate serial number" ++ } ++ keyEncryptionAlgorithm {pkcs-1 1} -- rsa encryption ++ encryptedKey "content-encryption key ++ encrypted by CA public key" ++ } ++ encryptedContentInfo { ++ contentType {pkcs-7 1} -- data content ++ contentEncryptionAlgorithm "object identifier ++ for DES encryption" ++ encryptedContent "encrypted pkcsCertReq using the content- ++ encryption key" ++ } ++ } ++ -- Signed PKCSReq ++ pkcsCertReqSigned SignedData ::= { -- PKCS#7 ++ version 1 ++ digestAlgorithm {iso(1) member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ contentInfo { ++ contentType {pkcs-7 1} -- data content identifier ++ content pkcsCertReqEnvelope ++ } ++ certificate { -- requester self-signed or CA-issued certificate ++ version 3 ++ serialNumber "the transaction id associated with enrollment" ++ signature {pkcs-1 4} -- md5WithRSAEncryption ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 19] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ issuer " the requester's subject name" ++ validity { ++ notBefore "a UTC time" ++ notAfter "a UTC time" ++ } ++ subject "the requester's subject name" ++ subjectPublicKeyInfo { ++ algorithm {pkcs-1 1} ++ subjectPublicKey "DER encoding of requester's public key" ++ } ++ signatureAlgorithm {pkcs-1 4} ++ signature "the signature generated by using the requester's ++ private key corresponding to the public key in ++ this certificate." ++ } ++ signerInfo { ++ version 1 ++ issuerAndSerialNumber { ++ issuer "the requester's subject name" ++ serialNumber "the transaction id associated ++ with the enrollment" ++ } ++ digestAlgorithm {iso(0) member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ authenticateAttributes { ++ contentType {{pkcs-9 3} {pkcs-7 1}} ++ messageDigest {{pkcs-9 4} "an octet string"} ++ transaction-id {{id-attributes transId(7)} "printable ++ string"} ++ -- this transaction id will be used ++ -- together with the subject name as ++ -- the identifier of the requester's key ++ -- pair during enrollment ++ messageType {{id-attributes messageType(2)} "PKCSReq"} ++ senderNonce {{id-attributes senderNonce(5)} ++ "a random number encoded as a string"} ++ } ++ digestEncryptionAlgorithm {pkcs-1 1} -- rsa encryption ++ encryptedDigest "encrypted digest of the authenticated ++ attributes using requester's private key" ++ } ++ } ++ pkcsReq PKIMessage ::= { ++ contentType {pkcs-7 2} ++ content pkcsCertRepSigned ++ } ++ ++ ++ ++ ++ ++ ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 20] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++5.1.2 CertRep Message Format ++ ++The response to an SCEP enrollment request is a CertRep message. ++ ++5.1.2.1 PENDING Response ++ ++When the CA is configured to manually authenticate the requester, ++the CertRep is returned with the attribute pkiStatus set to PENDING. ++The data portion for this message is null. Only the transaction ++required attributes are sent back. ++ ++CertRepSigned SignedData ::= { -- PKCS#7 ++ version 1 ++ digestAlgorithm {iso(1) member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ contentInfo {contentType {pkcs-7 1} -- empty content ++ } ++ signerInfo { ++ version 1 ++ issuerAndSerialNumber { ++ issuer "name of CA that issued the CA [RA] cert" ++ serialNumber "the serial number of the CA [RA] cert" ++ } ++ digestAlgorithm (iso(1) member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ authenticateAttributes { ++ contentType {{pkcs-9 3} {pkcs-7 1}} ++ messageDigest {{pkcs-9 4} NULL} ++ messageType {{id-attribute messageType(0)} "CertRep"} ++ transaction-id {{id-attributes transid(7)} "printablestring"} ++ --- same transaction id used in PKCSReq ++ pkiStatus {{id-attributes pkiStatus(3)} "PENDING"} ++ recipientNonce {{id-attributes recipientNonce(6)}<16 bytes>} ++ senderNonce {{id-attributes senderNonce(5)} <16 bytes>} ++ } ++ digestEncrytionAlgorithm {pkcs-1 1} ++ encryptedDigest "encrypted message digest of the authenticated ++ attributes using the CA's [RA's] private key" ++ } ++} ++CertRep PKIMessage ::= { ++ contentType {pkcs-7 2} ++ content CertRepSigned ++} ++ ++5.1.2.2 Failure Response ++ ++In this case, the CertRep sent back to the requester is same as in ++the PENDING case, except that the pkiStatus attribute is set to FAILURE, ++and the failInfo attribute should be included: ++ ++ pkistatus {{id-attributes pkiStatus(3)} "FAILURE"} ++ failInfo {{id-attributes failInfo(4)} "the reason to reject"} ++ ++ Liu/Madson/McGrew/Nourse [Page 21] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++5.1.2.3 SUCCESS response ++ ++In this case, the information portion of CertRep will be a degenerated ++PKCS#7 which contains the requester's certificate. It is then enveloped ++and signed as below: ++ ++pkcsCertRep SignedData ::= { -- PKCS#7 ++ version 1 ++ digestAlgorithm {iso(1) member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ contentInfo { -- empty content since this is degenerated PKCS#7 ++ contentType {pkcs-7 1} ++ } ++ certificates { ++ certificate { -- issued requester's certificate // must be first ++ version 3 ++ serialNumber "issued requester's certificate serial number" ++ signature {pkcs-1 4} -- md5WithRSAEncryption ++ issuer "the certificate authority issuer name" ++ validity { ++ notBefore "UTC time" ++ notAfter "UTC time" ++ } ++ subject "the requester subject name as given in PKCS#10" ++ subjectPublicKeyInfo { ++ algorithm {pkcs-1 1} ++ subjectPublicKey "a DER encoding of requester public ++ key as given in PKCS#10" ++ } ++ extensions " the extensions as given in PKCS#10" ++ signatureAlgorithm {pkcs-1 4} ++ signature " the certificate authority signature" ++ } ++ certificate "the certificate authority certificate" (optional) ++ certificate "the registration authority certificate(s)" (optional) ++ } ++} ++pkcsCertRepEnvelope EnvelopedData ::= { -- PKCS#7 ++ version 0 ++ recipientInfo { ++ version 0 ++ issuerAndSerialNumber { -- use issuer name and serial number as ++ -- conveyed in requester's self-signed ++ -- certificate, included in the PKCSReq ++ issuer "the requester's subject name" ++ serialNumber "the serial number defined by the requester in ++ its self-signed certificate" ++ } ++ keyEncryptionAlgorithm {pkcs-1 1} ++ encryptedKey "content-encrypt key encrypted by the requester's ++ public key which is same key as authenticated in ++ the requester's certificate" ++ } ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 22] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ encryptedContentInfo { ++ contentType {pkcs-7 1} -- data content identifier ++ contentEncryptionAlgorithm "OID for DES encryption" ++ encryptedContent "encrypted pkcsCertRep using content encryption ++ key" ++ } ++} ++pkcsCertRepSigned SignedData ::= { -- PKCS#7 ++ version 1 ++ digestAlgorithm {iso(1) member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ contentInfo { ++ contentType {pkcs-7 1} ++ content pkcsCertRepEnvelope ++ } ++ signerInfo { ++ version 1 ++ issuerAndSerialNumber { ++ issuer "the certificate authority issuer name" ++ serialNumber "the CA certificate's serial number" ++ } ++ digestAlgorithm {iso(1), member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ authenticateAttributes { ++ contentType {{pkcs-9 3} {pkcs-7 1}} ++ messageDigest {{pkcs-9 4} "a octet string"} ++ messageType {{id-attribute messageType(2)} "CertRep"} ++ transaction-id {{id-attributes transId(7)} "printable ++ string"} ++ -- same transaction id as given in PKCSReq ++ pkiStatus {{id-attributes pkiStatus(3) "SUCCESS"} ++ recipientNonce {{id-attribute recipientNonce(6)}<16 bytes>} ++ senderNonce {{ id-attributes senderNonce(5) <16 bytes>} ++ } ++ digestEncryptionAlgorithm {pkcs-1 1} ++ encryptedDigest "encrypted digest of authenticate attributes ++ using CA's private key " ++ } ++} ++CertRep PKIMessage ::= { ++ contentType {pkcs-7 2} ++ content pkcsCertRepSigned ++} ++ ++5.2 Poll for Requester Initial Certificate ++ ++Either triggered by the PENDING status received from the CertRep, or by ++the non-response timeout for the previous PKCSReq, a requester will ++enter the polling state by periodically sending GetCertInitial to the ++server, until either the request is granted and the certificate is sent ++back, or the request is rejected, or the configured time limit for ++polling is exceeded. ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 23] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ ++Since GetCertInitial is part of the enrollment, the messages exchanged ++during the polling period should carry the same transaction identifier ++as the previous PKCSReq. ++ ++PreCondition ++ Either the requester has received a CertRep with pkiStatus set to be ++ PENDING, or the previous PKCSReq has timed out. ++ ++PostContition ++ The requester has either received the certificate, or be rejected of ++ its request, or the polling period ended as a failure. ++ ++5.2.1 GetCertInitial Message Format ++ ++Since at this time the certificate has not been issued, the requester ++can only use the requester's subject name, combined with the ++transaction identifier, to identify the polled certificate request. ++ ++The certificate authority server must be able to uniquely identify the ++polled certificate request. A subject name can have more than one ++outstanding certificate request (with different key usage attributes). ++ ++-- Information portion ++ ++pkcsGetCertInitial issuerAndSubject ::= { ++ issuer "the certificate authority issuer name" ++ subject "the requester subject name as given in PKCS#10" ++} ++pkcsGetCertInitialEnvelope EnvelopedData ::= { ++ version 0 ++ recipientInfo { ++ version 0 ++ issuerAndSerialNumber { ++ issuer "the CA issuer name" ++ serialNumber "the CA certificate serial number" ++ } ++ keyEncryptionAlgorithm {pkcs-1 1} ++ encryptedKey "content-encrypt key encrypted by CA's public key" ++ } ++ encryptedContentInfo { ++ contentType {pkcs-7 1} -- data content ++ contentEncryptionAlgorithm "OID for DES encryption" ++ encryptedContent "encrypted getCertInital" ++ } ++} ++pkcsGetCertInitialSigned SignedData ::= { -- PKCS#7 ++ version 1 ++ digestAlgorithm {iso(1) member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ contentInfo { ++ contentType {pkcs-7 1} ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 24] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ content pkcsGetCertIntialEnvelope ++ } ++ certificate { -- the requester's self-signed certificate ++ version 3 ++ serialNumber "the transaction id associated with enrollment" ++ signature {pkcs-1 4} -- md5WithRSAEncryption ++ issuer " the requester's subject name" ++ validity { ++ notBefore "a UTC time" ++ notAfter "a UTC time" ++ } ++ subject "the requester's subject name" ++ subjectPublicKeyInfo { ++ algorithm {pkcs-1 1} ++ subjectPublicKey "DER encoding of requester's public key" ++ } ++ signatureAlgorithm {pkcs-1 4} ++ signature "the signature generated by using the requester's ++ private key corresponding to the public key in ++ this certificate." ++ } ++ signerInfo { ++ version 1 ++ issuerAndSerialNumber { ++ issuer "requester's subject name" ++ serialNumber "the transaction id used in previous PKCSReq" ++ } ++ digestAlgorithm {iso(1), member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ authenticateAttributes { ++ contentType {{pkcs-9 3} {pkcs-7 1}} ++ messageDigest {{pkcs-9 4} "an octet string"} ++ -- digest of getCertInitial ++ messageType {{id-attribute messageType(2)} "GetCertInitial"} ++ transaction-id {{id-attributes transId(7)} "printable ++ string"} ++ -- same transaction idused in previous PKCSReq ++ senderNonce {{id-attribute senderNonce(3)} 0x<16 bytes>} ++ } ++ digestEncryptionAlgorithm {pkcs-1 1} ++ encryptedDigest "encrypted digest of authenticateAttributes" ++ } ++} ++GetCertInitial PKIMessage ::= { ++ contentType {pkcs-7 2} ++ content pkcsGetCertInitialSigned ++} ++ ++ ++ ++5.2.2 GetCertInitial Response Message Format ++ ++The response messages for GetCertInitial are the same as for PKCSReq. ++ ++ Liu/Madson/McGrew/Nourse [Page 25] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++5.3 Certificate Access ++ ++The certificate query message defined in this section is an option when ++the LDAP server is not available to provide the certificate query. A ++requester should be able to query an issued certificate from the ++certificate authority, as long as the issuer name and the issuer ++assigned certificate serial number is known to the requesting end ++entity. This transaction is not intended to provide the service as a ++certificate directory service. A more complicated query mechanism would ++have to be defined in order to allow a requester to query a certificate ++using various different fields. ++ ++This transaction consists of one GetCert message sent to the server by ++a requester, and one CertRep message sent back from the server. ++ ++PreCondition ++ The queried certificate have been issued by the certificate authority ++ and the issuer assigned serial number is known. ++ ++PostCondition ++ Either the certificate is sent back or the request is rejected. ++ ++ ++5.3.1 GetCert Message Format ++ ++The queried certificate is identified by its issuer name and the issuer ++assigned serial number. If this is a query for an arbitrary requester's ++certificate, the requesting requester should includes its own CA issued ++certificate in the signed envelope. If this is a query for its own ++certificate (assume the requester lost the issued certificate, or does ++not have enough non-volatile memory to save the certificate), then the ++self-signed certificate has to be included in the signed envelope. ++ ++ pkcsGetCert issuerAndSerialNumber ::= { ++ issuer "the certificate issuer name" ++ serialNumber "the certificate serial number" ++ } ++ pkcsGetCertEnvelope EnvelopedData ::= { ++ version 0 ++ recipientInfo { ++ version 0 ++ issuerAndSerialNumber { ++ issuer "the CA [RA] issuer name" ++ serialNumber "the CA [RA] certificate serial number" ++ } ++ keyEncryptionAlgorithm {pkcs-1 1} ++ encryptedKey "content-encrypt key encrypted ++ by CA [RA] public key" ++ } ++ ++ ++ ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 26] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ ++ encryptedContentInfo { ++ contentType {pkcs-7 1} -- data content ++ contentEncryptionAlgorithm "OID for DES encryption" ++ encryptedContent "encrypted pkcsGetCert using the content ++ encryption key" ++ } ++ } ++ pkcsGetCertSigned SignedData ::= { ++ version 1 ++ digestAlgorithm {iso(1) member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ contentInfo { ++ contentType {pkcs-7 1} ++ content pkcsGetCertEnvelope ++ } ++ certificates { ++ certificate "CA issued certificate" ++ or "self-signed certificate" ++ } ++ signerInfo { ++ version 1 ++ issuerAndSerialNumber { ++ issuer "the requester's subject name" ++ serialNumber "requester's certificate serial number" ++ } ++ digestAlgorithm {iso(1), member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ authenticateAttributes { ++ contentType {{pkcs-9 3} {pkcs-7 1}} ++ messageDigest {{pkcs-9 4} "an octet string"} ++ -- digest of pkcsGetCertEnvelope ++ messageType {{id-attribute messageType(2)} "GetCert"} ++ transaction-id {{id-attributes transId(7)} "printable ++ string"} ++ senderNonce {{id-attribute senderNonce(3)} <16 bytes>} ++ } ++ digestEncryptionAlgorithm {pkcs-1 1} ++ encryptedDigest "encrypted digest of authenticateAttributes" ++ } ++ } ++ GetCert PKIMessage ::= { ++ contentType {pkcs-7 2} ++ content pkcsGetCertSigned ++ } ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 27] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ ++5.3.2 CertRep Message Format ++ ++In this case, the CertRep from the server is same as the CertRep for the ++PKCSReq, except that the server will only either grant the request or ++reject the request. Also, the recipientInfo should use the CA issuer ++name and CA assigned serial number to identify the requester's key pair ++since at this time, the requester has received its own certificate. ++ ++5.4 CRL Access ++ ++The CRL query message defined in this section is an option when the LDAP ++server is not available to provide the CRL query. In the PKI protocol ++proposed here, only the requester can initiate the transaction to ++download CRL. A requester sends GetCRL request to the server and the ++server sends back CertRep whose information portion is a degenerated ++PKCS#7 which contains only the most recent CRL. The size of CRL included ++in the CertRep should be determined by the implementation. ++ ++PreCondition ++ The certificate authority certificate has been downloaded to the end ++ entity. ++ ++PostCondition ++ CRL sent back to the requester. ++ ++5.4.1 GetCRL Message format ++ ++The CRL is identified by using both CA's issuer name and the CA ++certificate's serial number: ++ ++ pkcsGetCRL issuerAndSerialNumber { ++ issuer "the certificate authority issuer name" ++ serialNumber "certificate authority certificate's serial number" ++ } ++ ++When the CRLDistributionPoint is supported, the pkcsGetCRL is defined as ++the following: ++ ++ pkcsGetCRL SEQUENCE { ++ crlIssuer issuerAndSerialNumber ++ distributionPoint CE-CRLDistPoints ++ } ++ ++where CE-CRLDisPoints is defined in X.509, but must contain only one ++CRL distribution point. ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 28] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ pkcsGetCRLEnvelope EnvelopedData ::= { ++ version 0 ++ recipientInfo { ++ version 0 ++ issuerAndSerialNumber { ++ issuer "the certificate authority (or RA) issuer name" ++ serialNumber "the CA (RA) certificate's serial number" ++ } ++ keyEncryptionAlgorithm {pkcs-1 1} ++ encryptedKey "content-encrypt key encrypted by CA (RA) public key" ++ } ++ encryptedContentInfo { ++ contentType {pkcs-7 1} -- data content ++ contentEncryptionAlgorithm "OID for DES encryption" ++ encryptedContent "encrypted pkcsGetCRL" ++ } ++ } ++ pkcsGetCRLSigned SignedData ::= { ++ version 1 ++ digestAlgorithm {iso(1) member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ contentInfo { ++ contentType {pkcs-7 1} ++ content pkcsGetCRLEnvelope ++ } ++ certificates { ++ certificate "CA-issued or self-signed requester's certificate" ++ } ++ signerInfo { ++ version 1 ++ issuerAndSerialNumber { ++ issuer "the requester's issuer name" ++ serialNumber "the requester's certificate serial number" ++ } ++ digestAlgorithm {iso(1), member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ authenticateAttributes { ++ contentType {{pkcs-9 3} {pkcs-7 1}} ++ messageDigest {{pkcs-9 4} 0x<16/20 bytes>} ++ -- digest of pkcsGetCRLEnvelope ++ messageType {{id-attribute messageType(2)} "CertCRL"} ++ transaction-id {{id-attributes transId(7)} "printable ++ string"} ++ senderNonce {{id-attribute senderNonce(3)} <16 bytes>} ++ } ++ digestEncryptionAlgorithm {pkcs-1 1} ++ encryptedDigest "encrypted digest of authenticateAttributes" ++ } ++ } ++ GetCRL PKIMessage ::= { ++ contentType {pkcs-7 2} ++ content pkcsGetCRLSigned ++ } ++ ++ Liu/Madson/McGrew/Nourse [Page 29] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ ++5.4.2 CertRep Message Format ++ ++The CRL is sent back to the requester through CertRep message. The ++information portion of this message is a degenerated PKCS#7 SignedData ++which contains only a CRL. ++ ++ pkcsCertRep SignedData ::= { ++ version 1 ++ digestAlgorithm {iso(1) member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ contentInfo { ++ contentType {pkcs-7 1} ++ } ++ crl { ++ signature {pkcs-1 4} ++ issuer "the certificate authority issuer name" ++ lastUpdate "UTC time" ++ nextUpdate "UTC time" ++ revokedCertificate { ++ -- the first entry ++ userCertificate "certificate serial number" ++ revocationData "UTC time" ++ .... ++ -- last entry ++ userCertificate "certificate serial number" ++ revocationData "UTC time" ++ } ++ } ++ pkcsCertRepEnvelope EnvelopedData ::= { ++ version 0 ++ recipientInfo { ++ version 0 ++ issuerAndSerialNumber { ++ issuer "the requester's issuer name" ++ serialNumber "the requester certificate serial number" ++ } ++ keyEncryptionAlgorithm {pkcs-1 1} ++ encryptedKey "content-encrypt key encrypted by requester's ++ public key " ++ } ++ encryptedContentInfo { ++ contentType {pkcs-7 1} -- data content ++ contentEncryptionAlgorithm "OID for DES encryption" ++ encryptedContent "encrypted pkcsCertRep using requester's ++ public key" ++ } ++ } ++ ++ ++ ++ ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 30] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ ++ pkcsCertRepSigned SignedData ::= { -- PKCS#7 ++ version 1 ++ digestAlgorithm {iso(1) member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ contentInfo { ++ contentType {pkcs-7 1} ++ content pkcsCertRepEnvelope ++ } ++ signerInfo { ++ version 1 ++ issuerAndSerialNumber { ++ issuer "the certificate authority issuer name" ++ serialNumber "the CA certificate's serial number" ++ } ++ digestAlgorithm {iso(1), member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ authenticateAttributes { ++ contentType {{pkcs-9 3} {pkcs-7 1}} ++ messageDigest {{pkcs-9 4} "an octet string"} ++ -- digest of pkcsCertRepEnvelope ++ messageType {{id-attribute messageType(2)} "CertRep"} ++ transaction-id {{id-attributes transId(7)} "printable ++ string"} ++ -- same transaction id as given in PKCSReq ++ pkiStatus {{id-attributes pkiStatus(3) "SUCCESS"} ++ recipientNonce{{id-attribute recipientNonce(6)}<16 bytes>} ++ senderNonce {{id-attribute senderNonce (5) 0x<16 bytes>} ++ } ++ digestEncryptionAlgorithm {pkcs-1 1} ++ encryptedDigest "encrypted digest of authenticatedAttributes ++ using CA private key" ++ } ++ } ++ ++ ++NOTE:The PKCS#7 EncryptedContent is specified as an octet string, but ++SCEP entities must also accept a sequence of octet strings as a valid ++alternate encoding. ++ ++This alternate encoding must be accepted wherever PKCS #7 Enveloped ++Data is specified in this document. ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 31] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++5.5 Get Certificate Authority Certificate ++ ++Before any transaction begins, end entities have to get the CA (and ++possibly RA) certificate(s) first. Since the requester may have no CA ++certificates or CA public keys at all, this message can not be ++encrypted and the response must be authenticated by out-of-band means. ++These certs are obtained by means of an HTTP GET message. To get the ++CA certificate, the requester does a "HTTP GET" with a URL that ++identifies a CGI script on the server and an optional CA issuer ++identifier as the parameter to the CGI script. The response is either ++a single X.509 CA certificate ("CA mode"), or a PKCS7 message ++containing the CA certificate and RA certificates ("RA mode"). The ++client can determine which mode the CA operates in by which response ++it gets. Once the CA certificate is received by the requester, a ++fingerprint is generated using either the SHA-1 or the MD5 hash ++algorithm on the whole CA certificate. If the requester does not have ++a certificate path to a trusted CA certificate, this fingerprint may ++be used to verify the certificate, by some positive out-of-band means, ++such as a phone call. ++ ++5.5.1 GetCACert HTTP Message Format ++ "GET" CGI-PATH CGI-PROG "?operation=GetCACert" "&message=" CA-IDENT ++ where: ++ CGI-PATH defines the actual CGI path to invoke the CGI program ++ which parses the request. ++ CGI-PROG is set to be the string "pkiclient.exe" and this is ++ expected to be the program that the CA will use to handle the ++ SCEP transactions. ++ CA-IDENT is any string which is understood by the CA. ++ For example, it could be a domain name like ietf.org. ++ If a certificate authority has multiple CA certificates ++ this field can be used to distinguish which is required. ++ Otherwise it may be ignored. ++ ++5.5.2 Response ++ ++The response for GetCACert is different between the case where the CA ++directly communicated with the requester during the enrollment, and the ++case where a RA exists and the requester communicates with the RA ++during the enrollment. ++ ++5.5.2.1 CA Certificate Only Response ++ ++A binary X.509 CA certificate is sent back as a MIME object with a ++Content-Type of application/x-x509-ca-cert. ++ ++5.5.2.2 CA and RA Certificates Response ++ ++When an RA exists, both CA and RA certificates must be sent back in ++the response to the GetCACert request. The RA certificate(s) must be ++signed by the CA. A certificates-only PKCS#7 SignedData is used to ++carry the certificates to the requester, with a Content-Type of ++application/x-x509-ca-ra-cert. ++ ++ Liu/Madson/McGrew/Nourse [Page 32] ++ ++5.5.3 Get Next Certificate Authority Certificate ++ ++5.5.3.1 GetNextCACert HTTP Message Format ++ "GET" CGI-PATH CGI-PROG "?operation=GetNextCACert" "&message=" CA-IDENT ++ ++The response to this message is a PKCS#7 certificates-only message containing ++a CA certificate (and possibly RA certificates) to be used when the current CA ++certificate expires, signed with the current CA cert (or RA certificate, if ++the CA is in RA mode. Note that a PKCS#7 is returned even in CA mode. ++ ++5.5.3.2 GetCACaps HTTP Message Format ++ "GET" CGI-PATH CGI-PROG "?operation=GetCACaps" "&message=" CA-IDENT ++ ++This message requests capabilities from CA. The response is a list of ++text capabilities, as defined in Appendix F. Support for this message ++is optional, but if it is not supported, the client should assume that ++none of the capabilities in Appendix F are supported. ++ ++5.6 Get Certificate Authority Certificate Chain ++ ++GetCACertChain provides a way to get the entire certificate chain. ++ ++5.6.1 GetCACertChain HTTP Message Format ++ ++ "GET" CGI-SCRIPT "?" "operation=GetCACertChain" "&" "message" CA-IDENT ++ where CGI-SCRIPT and CA-IDENT are as described for GetCACert. ++ ++5.6.2 Response ++ ++The response for GetCACertChain is a certificates-only PKCS#7 SignedData ++to carry the certificates to the requester, with a Content-Type of ++application/x-x509-ca-ra-cert-chain. ++ ++5.6.3 Backwards Compatability ++ ++Versions of SCEP prior to revision 3 do not support GetCACertChain. ++Certificate Authorities written to these prior versions will not be ++able to process the message and may return an HTML error. ++ ++To avoid this, clients should send the GetCACert message first. If the ++returned certificate is self-signed or is signed by a Certificate ++Authority that is trusted by the client, then it is not necessary to ++send the GetCACertChain message and it should not be sent. ++ ++If a Certificate Authority is configured with a certificate that is ++not either self-signed or has a self-signed issuer, then it should ++support this message. In other words, it should be supported if the ++CA hierarchy is more than two-deep. ++ ++An old CA in a two-deep hierarchy might still get this message from ++a client if the client did not trust either that CA or its issuer. ++In that event, the certificate cannot be trusted anyway. In any case ++the CA must not crash or hang upon the receipt of the message and the ++client must be able to handle whatever error is returned by the CA, ++including an HTML error or an ungraceful disconnect. ++ ++ Liu/Madson/McGrew/Nourse [Page 33] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++The following is the ASN.1 definition of Cert-Only PKCS#7: ++ ++ certOnly SignedData ::= { ++ version 1 ++ digestAlgorithm {iso(1) member-body(2) US(840) rsadsi(113549) ++ digestAlgorithm(2) 5} ++ ++contentInfo { ++ contentType {pkcs-7 1} -- data content identifier ++ content -- NULL ++ } ++ certificates -- the RA and CA certificates. ++ } ++ ++ CARACerts PKIMessage ::= { -- special pki message sent in the clear ++ contentType {pkcs-7 2} ++ content certOnly ++ } ++ ++ ++6.0 Security Considerations ++ ++This entire document is about security. Common security considerations ++such as keeping private keys truly private and using adequate lengths ++for symmetric and asymmetric keys must be followed in order to maintain ++the security of this protocol. ++ ++ ++7.0 Intellectual Property ++ ++This protcol includes the optional use of Certificate Revocation List ++Distribution Point (CRLDP) technology, which is a patented technology ++of Entrust Technologies, Inc. (Method for Efficient Management of ++Certificate Revocation Lists and Update Information (U.S. Patent ++5,699,431)). Please contact Entrust Technologies, Inc. ++(www.entrust.com) for more information on licensing CRLDP technology. ++ ++ ++8.0 References ++ ++[PKCS7] Kaliski, B., "PKCS #7: Cryptographic Message Syntax Version ++1.5", RFC 2315, March 1998. ++ ++[PKCS10] Kaliski, B., "PKCS #10: Certification Request Syntax Version ++1.5", RFC 2314, March 1998. ++ ++[RFC2459] Housley, R., ec. al., "Internet X.509 Public Key ++Infrastructure Certificate and CRL Profile", RFC 2459, January 1999. ++ ++ ++ ++ ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 34] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++Appendix A: Cisco Requester Subject Name Definition ++ ++The ip address and the FQDN of a SCEP client should be included in the ++V3 extension subjectAltName. When the subjectAltName extension attribute ++is present, both the subjectAltName fields and the subjectName field could ++have the IP address and the FQDN information. ++ ++When the X.500 directory is used by the CA to define the name space, the ++subject name defined above become a RDN which is part of DN binded to ++the requester's public key in the certificate. ++ ++ ++A sample of DN assigned by Entrust CA is given below (assume the same ++ciscoRouterAlice is used as the requester defined subject name): ++ ++ OU = InteropTesting, O = Entrust Technologies, C = CA ++ RDN = {"alice.cisco.com", "172.21.114.67", "22334455"} ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 35] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++Appendix B: IPSEC Client Enrollment Certificate Request ++ ++The following is the certificate enrollment request (PKCS#10) as created ++by Cisco VPN Client: ++ ++-----END NEW CERTIFICATE REQUEST----- ++ 0 30 439: SEQUENCE { ++ 4 30 288: SEQUENCE { ++ 8 02 1: INTEGER 0 ++ 11 30 57: SEQUENCE { ++ 13 31 55: SET { ++ 15 30 53: SEQUENCE { ++ 17 06 3: OBJECT IDENTIFIER commonName (2 5 4 3) ++ 22 13 46: PrintableString ++ : 'For Xiaoyi, IPSEC attrs in alternate name ++ extn' ++ : } ++ : } ++ : } ++ 70 30 158: SEQUENCE { ++ 73 30 13: SEQUENCE { ++ 75 06 9: OBJECT IDENTIFIER rsaEncryption (1 2 840 113549 1 ++ 1 1) ++ 86 05 0: NULL ++ : } ++ 88 03 140: BIT STRING 0 unused bits ++ : 30 81 88 02 81 80 73 DB 1D D5 65 AA EF C7 D4 8E ++ : AA 6E EB 46 AC 91 2A 0F 50 51 17 AD 50 A2 2A F2 ++ : CE BE F1 E4 22 8C D7 61 A1 6C 87 61 62 92 CB A6 ++ : 80 EA B4 0F 09 9D 18 5F 39 A3 02 0E DB 38 4C E4 ++ : 8A 63 2E 72 8B DC BE 9E ED 6C 1A 47 DE 13 1B 0F ++ : 83 29 4D 3E 08 86 FF 08 2B 43 09 EF 67 A7 6B EA ++ : 77 62 30 35 4D A9 0F 0F DF CC 44 F5 4D 2C 2E 19 ++ : E8 63 94 AC 84 A4 D0 01 E1 E3 97 16 CD 86 64 18 ++ : [ Another 11 bytes skipped ] ++ : } ++ 231 A0 63: [0] { ++ 233 30 61: SEQUENCE { ++ 235 06 9: OBJECT IDENTIFIER extensionReq (1 2 840 113549 1 9 ++ 14) ++ 246 31 48: SET { ++ 248 30 46: SEQUENCE { ++ 250 30 44: SEQUENCE { ++ 252 06 3: OBJECT IDENTIFIER subjectAltName (2 5 29 17) ++ 257 04 37: OCTET STRING ++ 30 23 87 04 01 02 03 04 81 0D 65 6D 61 69 ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 36] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ 6C 40 69 72 65 2E 63 6F 6D 82 0C 66 71 64 ++ 6E 2E 69 72 65 2E 63 6F 6D ++ : } ++ : } ++ : } ++ : } ++ : } ++ : } ++ ++ 296 30 13: SEQUENCE { ++ 298 06 9: OBJECT IDENTIFIER md5withRSAEncryption (1 2 840 113549 ++ 1 1 4) ++ 309 05 0: NULL ++ : } ++ 311 03 129: BIT STRING 0 unused bits ++ : 19 60 55 45 7F 72 FD 4E E5 3F D2 66 B0 77 13 9A ++ : 87 86 75 6A E1 36 C6 B6 21 71 68 BD 96 F0 B4 60 ++ : 95 8F 12 F1 65 33 16 FD 46 8A 63 19 90 40 B4 B7 ++ : 2C B5 AC 63 17 50 28 F0 CD A4 F0 00 4E D2 DE 6D ++ : C3 4F F5 CB 03 4D C8 D8 31 5A 7C 01 47 D2 2B 91 ++ : B5 48 55 C8 A7 0B DD 45 D3 4A 8D 94 04 3A 6C B0 ++ : A7 1D 64 74 AB 8A F7 FF 82 C7 22 0A 2A 95 FB 24 ++ : 88 AA B6 27 83 C1 EC 5E A0 BA 0C BA 2E 6D 50 C7 ++ : } ++ ++ ++Appendix C: Private OID Definitions ++ ++The OIDs used in defining pkiStatus are VeriSign self-maintained ++OIDs. Please note, work is in progress to replace the VeriSign owned ++object identifiers with the standard object identifiers. Once the ++standarlization is completed, this documentation will be updated. ++ ++id-VeriSign OBJECT_IDENTIFIER ::= {2 16 US(840) 1 VeriSign(113733)} ++id-pki OBJECT_IDENTIFIER ::= {id-VeriSign pki(1)} ++id-attributes OBJECT_IDENTIFIER ::= {id-pki attributes(9)} ++id-messageType OBJECT_IDENTIFIER ::= {id-attributes messageType(2)} ++id-pkiStatus OBJECT_IDENTIFIER ::= {id-attributes pkiStatus(3)} ++id-failInfo OBJECT_IDENTIFIER ::= {id-attributes failInfo(4)} ++id-senderNonce OBJECT_IDENTIFIER ::= {id-attributes senderNonce(5)} ++id-recipientNonce OBJECT_IDENTIFIER ::= {id-attributes recipientNonce(6)} ++id-transId OBJECT_IDENTIFIER ::= {id-attributes transId(7)} ++id-extensionReq OBJECT_IDENTIFIER ::= {id-attributes extensionReq(8)} ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 37] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ Appendix D: CRL Query by means of LDAP ++ ++ In order to retrieve the CRL by means of LDAP, the client needs to know ++ where in the directory it is stored. The certificate must contain a ++ CRL Distribution Point extension encoded as a DN or as an LDAP URI. ++ ++For example, the certificate issued by Entrust VPN contains ++the following DN as the CRL distribution point: ++ ++ ++ ++CN = CRL1, O = cisco, C = US. ++ ++ The asn.1 encoding of this distribution point is: ++ ++ 30 2C 31 0B 30 09 06 03 55 04 06 13 02 55 53 31 0E 30 0C 06 ++ 03 55 04 0A 13 05 63 69 73 63 6F 31 0D 30 0B 06 03 55 04 03 ++ 13 04 43 52 4C 31 ++ ++ ++The ldap form would be: ++ ++ldap://servername/CN=CRL1,O=cisco,C=US ++ ++ ++ ++Appendix E: SCEP State Transitions ++ ++SCEP state transitions are based on transaction identifier. The design ++goal is to ensure the synchronization between the CA and the requester ++under various error situations. ++ ++ ++An identity is defined by the combination of FQDN, the IP address and ++the client serial number. FQDN is the required name attribute. It is ++important to notice that, a client named as Alice.cisco.com is different ++from the client named as Alice.cisco.com plus IPAddress 117.96.1.219. ++ ++Each enrollment transaction is uniquely associated with a transaction ++identifier. Because the enrollment transaction could be interrupted by ++various errors, including network connection errors or client reboot, ++the SCEP client generates a transaction identifier by calculating a ++hash on the public key value for which the enrollment is requested. This ++retains the same transaction identifier throughout the enrollment ++transaction, even if the client has rebooted or timed out, and issues a ++new enrollment request for the same key pair. It also provides the way ++for the CA to uniquely identify a transaction in its database. At the ++requester side, it generates a transaction identifier which is included ++in PKCSReq. If the CA returns a response of PENDING, the requester ++will poll by periodically sending out GetCertInitial with the same ++transaction identifier until either a response other than PENDING is ++obtained, or the configured maximum time has elapsed. ++ ++If the client times out or the client reboots, the client administrator ++will start another enrollment transaction with the same key pair. The ++second enrollment will have the transaction idenifier. At the server ++side, instead of accepting the PKCSReq as a new enrollment request, it ++should respond as if another GetCertInitial message had been sent with ++that transaction ID. In another word, the second PKCSReq should be ++taken as a resynchronization message to allow the enrollment resume as ++the same transaction. ++ ++It is important to keep the transaction id unique since SCEP requires the ++same policy and same identity be applied to the same subject name and ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 38] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++key pair binding. In the current implementation, an SCEP client can ++only assume one identity. At any time, only one key pair, with a given ++key usage, can be associated with the same identity. ++ ++The following gives several examples of client to CA transactions. ++ ++Client actions are indicated in the left column, CA actions are ++indicated in the right column. A blank action signifies that no message ++was received. Note that these examples assume that the CA enforces the ++certificate-name uniqueness property defined in Section 2.1.1.1. ++ ++The first transaction, for example, would read like this: ++ "Client Sends PKCSReq message with transaction ID 1 to the ++ CA. The CA signs the certificate and constructs a CertRep Message ++ containing the signed certificate with a transaction ID 1. The client ++ receives the message and installs the cert locally." ++ ++Successful Enrollment Case: no manual authentication ++PKCSReq (1) ----------> CA Signs Cert ++Client Installs Cert <---------- CertRep (1) SIGNED CERT ++ ++ ++ ++Successful Enrollment Case: manual authentication required ++PKCSReq (10) ----------> Cert Request goes into Queue ++Client Polls <---------- CertRep (10) PENDING ++GetCertInitial (10) ----------> Still pending ++Client Polls <---------- CertRep (10) PENDING ++GetCertInitial (10) ----------> Still pending ++Client Polls <---------- CertRep (10) PENDING ++GetCertInitial (10) ----------> Still pending ++Client Polls <---------- CertRep (10) PENDING ++GetCertInitial (10) ----------> Cert has been signed ++Client Installs Cert <---------- CertRep (10) SIGNED CERT ++ ++ ++ ++Resync Case - CA Receive and Signs PKCSReq, Client Did not receive ++CertRep: ++ ++PKCSReq (3) ----------> Cert Request goes into queue ++ <---------- CertRep (3) PENDING ++GetCertInitial (3) ----------> ++ <---------- CertRep (3) PENDING ++GetCertInitial (3) -----------> ++ <----------- CA signed Cert and sent back ++ CertRep(3) ++(Time Out) ++PKCSReq (3) ----------> Cert already signed, sent back to ++ client ++Client Installs Cert <---------- CertRep (3) SIGNED CERT ++ ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 39] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++ ++Case when NVRAM is lost and client has to generate a new key pair, there ++is no change of name information: ++ ++PKCSReq (4) ----------> CA Signs Cert ++Client Installs Cert <---------- CertRep (4) SIGNED CERT ++(Client looses Cert) ++PKCSReq (5) ----------> There is already a valid cert with ++ this DN. ++Client Admin Revokes <---------- CertRep (5) OVERLAPPING CERT ERROR ++PKCSReq (5) ----------> CA Signs Cert ++Client Installs Cert <---------- CertRep (5) SIGNED CERT ++ ++ ++Case when client admin resync the enrollment using a different PKCS#10: ++PKCSReq (6) ----------> CA Signs Cert ++ <---------- CertRep (6) SIGNED CERT ++(Client timeout and admin starts another enrollment with a different ++ PKCS#10, but the same transaction id) ++PKCSReq (6) with different PKCS#10 ++ ----------> There is already a valid cert with ++ this entity (by checking FQDN). ++ <---------- CertRep (6) INVALID PKCS#10 CERT ++ ERROR ++Client admin either revokes the existing cert ++or corrects the error by enrolling with ++the same PKCS#10 as the first PKCSReq(6) ++PKCSReq (6) ----------> CA find the existing Cert ++Client Installs Cert <---------- CertRep (6) SIGNED CERT ++ ++ ++Resync case when server is slow in response: ++PKCSReq (13) ----------> Cert Request goes into Queue ++ <---------- CertRep (13) PENDING ++GetCertInitial ----------> Still pending ++ <---------- CertRep (13) PENDING ++GetCertInitial ----------> Still pending ++ <---------- CertRep (13) PENDING ++GetCertInitial ----------> Still pending ++ <---------- CertRep (13) PENDING ++GetCertInitial ----------> Still pending ++(TimeOut) <---------- CertRep (13) PENDING ++* Case 1 ++PKCSReq (13) ----------> Still pending ++Client polls <---------- CertRep (13) PENDING ++CertCertInitial ----------> Cert has been signed ++Client Installs Cert <---------- CertRep (13) SIGNED CERT ++* Case 2 ++PKCSReq (13) ----------> Cert has been signed ++Client Installs Cert <---------- CertRep (13) SIGNED CERT ++ ++ ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 40] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++Appendix F. CA Capabilities ++ ++The response for a GetCACaps message is a list of CA capabilities, in ++plain text, separated by characters, as follows (quotation marks ++are NOT sent): ++ ++Keyword Description ++ ++"GetNextCACert" CA Supports the GetNextCACert message. ++"POSTPKIOperation" PKIOPeration messages may be sent via HTTP POST. ++"SHA-1" CA Supports the SHA-1 hashing algorithm in ++ signatures and fingerprints. If present, the ++ client SHOULD use SHA-1. If absent, the client ++ MUST use MD5 to maintain backward compatability. ++"Renewal" Clients may use current certificate and key to ++ authenticate an enrollment request for a new ++ certificate. ++ ++A client must be able to accept and ignore any unknown keywords that ++might be sent back by a CA that implements a future version of SCEP. ++ ++Example: ++ ++GET /cgi-bin/pkiclient.exe?operation=GetCACaps&message=myca ++ ++returns: ++ ++GetNextCACert ++POSTPKIOperation ++ ++This means that the CA supports the GetNextCACert message and allows ++PKIOperation messages (PKCSreq, GetCert, GetCertInitial...) to be sent ++using HTTP POST. ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 41] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++Appendix G. Certificate Renewal and CA Key Rollover ++ ++To renew a client certificate, use the PKCSreq message and sign it with ++the existing client certificate instead of a self-signed certificate. ++ ++To obtain the new CA certificate prior to the expiration of the current ++one, use the GetNextCACert message if the CA supports it. ++ ++To obtain a new client certificate signed by the new CA certificate, ++use the new CA or RA certificate in the message envelope. ++ ++ ++Example: ++ ++GetNextCACert ----------> ++ <---------- CertRep (3) New CA certificate ++ ++PKCSReq* (1) ----------> CA Signs certificate with NEW key ++Client Stores Cert <---------- CertRep (3) Certificate issued ++for installation when from NEW CA certificate and keypair. ++existing cert expires. ++ ++ ++*enveloped for new CA or RA cert and keypair. The CA will use the ++envelope to determine which key and certificate to use to issue the ++client certificate. ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 42] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++Appendix H. PKIOperation via HTTP POST Message ++ ++If the remote CA supports it, any of the PKCS#7-encoded SCEP messages ++may be sent via HTTP POST instead of HTTP GET. This is allowed for ++any SCEP message except GetCACert, GetCACertChain, GetNextCACert, ++or GetCACaps. In this form of the message, Base 64 encoding is not ++used. ++ ++POST /cgi-bin/pkiclient.exe?operation=PKIOperation ++ ++ ++The client can verify that the CA supports SCEP messages via POST by ++looking for the "POSTPKIOperation" capability (See Appendix F). ++ ++ ++ ++ ++ ++ ++ Liu/Madson/McGrew/Nourse [Page 43] ++ ++Cisco Systems' Simple Certificate Enrollment Protocol Feb 2005 ++ ++Appendix Y. Author Contact Information ++ ++Xiaoyi Liu Cheryl Madson ++Cisco Cisco ++510 McCarthy Drive 510 McCarthy Drive ++Milpitas, CA Milpitas, CA. ++xliu@cisco.com cmadson@cisco.com ++ ++ ++David McGrew Andrew Nourse ++Cisco Cisco ++170 West Tasman Drive 510 McCarthy Drive ++San Jose, CA 94134 Milpitas, CA. ++mcgrew@cisco.com nourse@cisco.com ++ ++ ++ ++ ++Appendix Z. Copyright Section ++ ++Copyright (C) The Internet Society (2005). This document is subject ++to the rights, licenses and restrictions contained in BCP 78, and ++except as set forth therein, the authors retain all their rights. ++ ++This document and the information contained herein are provided on an ++"AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS ++OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ++ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, ++INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE ++INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED ++WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ++ ++ ++ ++ ++This draft expires 11 Aug 2005 ++ ++[End of draft-nourse-scep-11.txt] ++ +diff -uN sscep/fileutils.c sscep-ng2/fileutils.c +--- sscep/fileutils.c 2003-04-15 12:53:45.000000000 +0200 ++++ sscep-ng2/fileutils.c 2006-04-28 10:03:24.000000000 +0200 +@@ -55,8 +55,11 @@ + PKCS7 *p7; + STACK_OF(X509) *certs; + X509 *cert = NULL; ++ ASN1_BIT_STRING *cert_pubkey = NULL; + FILE *fp; + int i; ++ ASN1_BIT_STRING *request_pubkey = ++ request->req_info->pubkey->public_key; + + localcert = NULL; + +@@ -66,29 +69,44 @@ + + /* Find cert */ + for (i = 0; i < sk_X509_num(certs); i++) { +- char buffer[1024]; +- + cert = sk_X509_value(certs, i); ++ cert_pubkey = X509_get_X509_PUBKEY(cert)->public_key; ++#define fu_print_name(n) \ ++ X509_NAME_print_ex_fp(stdout,(n),0,XN_FLAG_RFC2253|ASN1_STRFLGS_SHOW_TYPE) + if (v_flag) { +- printf("%s: found certificate with\n" +- " subject: %s\n", pname, +- X509_NAME_oneline(X509_get_subject_name(cert), +- buffer, sizeof(buffer))); +- printf(" issuer: %s\n", +- X509_NAME_oneline(X509_get_issuer_name(cert), +- buffer, sizeof(buffer))); ++ printf("%s: found certificate with\n subject: ", pname); ++ fu_print_name(X509_get_subject_name(cert)); ++ printf("\n issuer: "); ++ fu_print_name(X509_get_issuer_name(cert)); ++ printf("\n"); + } +- /* The subject has to match that of our request */ +- if (!X509_NAME_cmp(X509_get_subject_name(cert), ++ /* The public keys of the request and certificate must match */ ++ if (M_ASN1_BIT_STRING_cmp(request_pubkey,cert_pubkey) != 0) { ++ if (v_flag) ++ printf(" public keys of request and certificate don't match\n"); ++ continue; ++ } ++ /* The subject has to match that of our request, ++ if the "Compare subject DN" flag is set */ ++ if (C_flag && X509_NAME_cmp(X509_get_subject_name(cert), + X509_REQ_get_subject_name(request))) { +- +- /* The subject cannot be the issuer (selfsigned) */ +- if (X509_NAME_cmp(X509_get_subject_name(cert), +- X509_get_issuer_name(cert))) { +- localcert = cert; +- break; ++ if (v_flag) { ++ printf(" certificate subject names doesn't match request subject name:\n "); ++ fu_print_name(X509_REQ_get_subject_name(request)); ++ printf("\n"); + } +- } ++ continue; ++ } ++#undef fu_print_name ++ /* The subject cannot be the issuer (selfsigned) */ ++ if (!X509_NAME_cmp(X509_get_subject_name(cert), ++ X509_get_issuer_name(cert))) { ++ if (v_flag) ++ printf(" certificate is self signed\n"); ++ continue; ++ } ++ localcert = cert; ++ break; + } + if (localcert == NULL) { + fprintf(stderr, "%s: cannot find requested certificate\n", +@@ -320,34 +338,36 @@ + /* Read local certificate (GetCert and GetCrl) */ + + void +-read_local_cert(void) { +- if (!l_flag || !(localfile = fopen(l_char, "r"))) { +- fprintf(stderr, "%s: cannot open local cert file\n", pname); ++read_cert(X509** cert, char* filename) { ++ FILE *file; ++ if (!(file = fopen(filename, "r"))) { ++ fprintf(stderr, "%s: cannot open cert file %s\n", pname, filename); + exit (SCEP_PKISTATUS_FILE); + } +- if (!PEM_read_X509(localfile, &localcert, NULL, NULL)) { +- fprintf(stderr, "%s: error while reading local cert\n", pname); ++ if (!PEM_read_X509(file, cert, NULL, NULL)) { ++ fprintf(stderr, "%s: error while reading cert %s\n", pname, filename); + ERR_print_errors_fp(stderr); + exit (SCEP_PKISTATUS_FILE); + } +- fclose(localfile); ++ fclose(file); + } + + /* Read private key */ + + void +-read_key(void) { ++read_key(EVP_PKEY** key, char* filename) { ++ FILE *file; + /* Read private key file */ +- if (!k_flag || !(keyfile = fopen(k_char, "r"))) { +- fprintf(stderr, "%s: cannot open private key file\n", pname); ++ if (!(file = fopen(filename, "r"))) { ++ fprintf(stderr, "%s: cannot open private key file %s\n", pname, filename); + exit (SCEP_PKISTATUS_FILE); + } +- if (!PEM_read_PrivateKey(keyfile, &rsa, NULL, NULL)) { +- fprintf(stderr, "%s: error while reading private key\n", pname); ++ if (!PEM_read_PrivateKey(file, key, NULL, NULL)) { ++ fprintf(stderr, "%s: error while reading private key %s\n", pname, filename); + ERR_print_errors_fp(stderr); + exit (SCEP_PKISTATUS_FILE); + } +- fclose(keyfile); ++ fclose(file); + } + + /* Read PKCS#10 request */ +diff -uN sscep/init.c sscep-ng2/init.c +--- sscep/init.c 2003-01-31 10:07:16.000000000 +0100 ++++ sscep-ng2/init.c 2006-04-28 10:11:40.000000000 +0200 +@@ -61,6 +61,9 @@ + if (!(i_char = strdup(str2))) + error_memory(); + } ++ } else if (!strncmp(str1, "CheckSubjectName", 16)) { ++ if (!strncmp(str2, "yes", 3) && !C_flag) ++ C_flag = 1; + } else if (!strncmp(str1, "CertReqFile", 11)) { + if (!r_flag) { + r_flag = 1; +@@ -114,6 +117,12 @@ + if (!(l_char = strdup(str2))) + error_memory(); + } ++ } else if (!strncmp(str1, "SignCertFile", 12)) { ++ if (!O_flag) { ++ O_flag = 1; ++ if (!(O_char = strdup(str2))) ++ error_memory(); ++ } + } else if (!strncmp(str1, "MaxPollCount", 12)) { + if (!n_flag) { + n_flag = 1; +@@ -130,6 +139,12 @@ + if (!(k_char = strdup(str2))) + error_memory(); + } ++ } else if (!strncmp(str1, "SignKeyFile", 11)) { ++ if (!K_flag) { ++ K_flag = 1; ++ if (!(K_char = strdup(str2))) ++ error_memory(); ++ } + } else if (!strncmp(str1, "SelfSignedFile", 15)) { + if (!L_flag) { + L_flag = 1; +diff -uN sscep/pkcs7.c sscep-ng2/pkcs7.c +--- sscep/pkcs7.c 2003-02-10 06:04:48.000000000 +0100 ++++ sscep-ng2/pkcs7.c 2006-04-26 13:40:34.000000000 +0200 +@@ -28,7 +28,8 @@ + PKCS7 *p7enc; + PKCS7_SIGNER_INFO *si; + STACK_OF(X509_ATTRIBUTE) *attributes; +- X509 *signer = NULL; ++ X509 *signercert = NULL; ++ EVP_PKEY *signerkey = NULL; + + /* Create a new sender nonce for all messages + * XXXXXXXXXXXXXX should it be per transaction? */ +@@ -47,7 +48,8 @@ + s->request_type_str = SCEP_REQUEST_PKCSREQ_STR; + + /* Signer cert */ +- signer = s->selfsigned; ++ signercert = s->signercert; ++ signerkey = s->signerkey; + + /* Create inner PKCS#7 */ + if (v_flag) +@@ -71,7 +73,8 @@ + s->request_type_str = SCEP_REQUEST_GETCERTINIT_STR; + + /* Signer cert */ +- signer = s->selfsigned; ++ signercert = s->signercert; ++ signerkey = s->signerkey; + + /* Create inner PKCS#7 */ + if (v_flag) +@@ -95,7 +98,8 @@ + s->request_type_str = SCEP_REQUEST_GETCERT_STR; + + /* Signer cert */ +- signer = localcert; ++ signercert = localcert; ++ signerkey = rsa; + + /* Read data in memory bio */ + databio = BIO_new(BIO_s_mem()); +@@ -115,7 +119,8 @@ + s->request_type_str = SCEP_REQUEST_GETCRL_STR; + + /* Signer cert */ +- signer = localcert; ++ signercert = localcert; ++ signerkey = rsa; + + /* Read data in memory bio */ + databio = BIO_new(BIO_s_mem()); +@@ -217,9 +222,9 @@ + } + + /* Add signer certificate and signature */ +- PKCS7_add_certificate(s->request_p7, signer); ++ PKCS7_add_certificate(s->request_p7, signercert); + if ((si = PKCS7_add_signature(s->request_p7, +- signer, rsa, sig_alg)) == NULL) { ++ signercert, signerkey, sig_alg)) == NULL) { + fprintf(stderr, "%s: error adding PKCS#7 signature\n", pname); + ERR_print_errors_fp(stderr); + exit (SCEP_PKISTATUS_P7); +@@ -317,7 +322,8 @@ + STACK_OF(X509_ATTRIBUTE) *attribs; + char *p; + unsigned char buffer[1024]; +- X509 *recipient; ++ X509 *recipientcert; ++ EVP_PKEY *recipientkey; + + /* Create new memory BIO for outer PKCS#7 */ + memorybio = BIO_new(BIO_s_mem()); +@@ -547,10 +553,14 @@ + + /* Decrypt the inner PKCS#7 */ + if ((s->request_type == SCEP_REQUEST_PKCSREQ) || +- (s->request_type == SCEP_REQUEST_GETCERTINIT)) +- recipient = s->selfsigned; +- else +- recipient = localcert; ++ (s->request_type == SCEP_REQUEST_GETCERTINIT)) { ++ recipientcert = s->signercert; ++ recipientkey = s->signerkey; ++ } ++ else { ++ recipientcert = localcert; ++ recipientkey = rsa; ++ } + if (v_flag) + printf("%s: reading inner PKCS#7\n",pname); + p7enc = d2i_PKCS7_bio(outbio, NULL); +@@ -568,7 +578,7 @@ + outbio = BIO_new(BIO_s_mem()); + if (v_flag) + printf("%s: decrypting inner PKCS#7\n",pname); +- if (PKCS7_decrypt(p7enc, rsa, recipient, outbio, 0) == 0) { ++ if (PKCS7_decrypt(p7enc, recipientkey, recipientcert, outbio, 0) == 0) { + fprintf(stderr, "%s: error decrypting inner PKCS#7\n", pname); + ERR_print_errors_fp(stderr); + exit (SCEP_PKISTATUS_P7); +diff -uN sscep/sceputils.c sscep-ng2/sceputils.c +--- sscep/sceputils.c 2003-02-09 14:18:23.000000000 +0100 ++++ sscep-ng2/sceputils.c 2006-04-25 16:27:03.000000000 +0200 +@@ -156,7 +156,8 @@ + } + + /* Copy the pointer and return */ +- s->selfsigned = cert; ++ s->signercert = cert; ++ s->signerkey = rsa; + return (0); + } + +diff -uN sscep/sscep.c sscep-ng2/sscep.c +--- sscep/sscep.c 2003-04-17 07:47:04.000000000 +0200 ++++ sscep-ng2/sscep.c 2006-04-28 11:06:16.000000000 +0200 +@@ -53,12 +53,15 @@ + } + /* Skip first parameter and parse the rest of the command */ + optind++; +- while ((c = getopt(argc, argv, "c:de:E:f:F:i:k:l:L:n:p:r:Rs:S:t:T:u:vw:")) != -1) ++ while ((c = getopt(argc, argv, "c:Cde:E:f:F:i:k:K:l:L:n:O:p:r:Rs:S:t:T:u:vw:")) != -1) + switch(c) { + case 'c': + c_flag = 1; + c_char = optarg; + break; ++ case 'C': ++ C_flag = 1; ++ break; + case 'd': + d_flag = 1; + break; +@@ -86,6 +89,10 @@ + k_flag = 1; + k_char = optarg; + break; ++ case 'K': ++ K_flag = 1; ++ K_char = optarg; ++ break; + case 'l': + l_flag = 1; + l_char = optarg; +@@ -98,6 +105,10 @@ + n_flag = 1; + n_num = atoi(optarg); + break; ++ case 'O': ++ O_flag = 1; ++ O_char = optarg; ++ break; + case 'p': + p_flag = 1; + p_char = optarg; +@@ -137,6 +148,7 @@ + w_char = optarg; + break; + default: ++ printf("argv: %s\n", argv[optind]); + usage(); + } + argc -= optind; +@@ -402,15 +414,38 @@ + case SCEP_OPERATION_GETCERT: + case SCEP_OPERATION_GETCRL: + /* Read local certificate */ +- read_local_cert(); ++ if (!l_flag) { ++ fprintf(stderr, "%s: missing local cert (-l)\n", pname); ++ exit (SCEP_PKISTATUS_FILE); ++ } ++ read_cert(&localcert, l_char); + + case SCEP_OPERATION_ENROLL: + /* + * Read in CA cert, private key and certificate + * request in global variables. + */ +- read_ca_cert(); +- read_key(); ++ read_ca_cert(); ++ ++ if (!k_flag) { ++ fprintf(stderr, "%s: missing private key (-k)\n", pname); ++ exit (SCEP_PKISTATUS_FILE); ++ } ++ read_key(&rsa, k_char); ++ ++ if ((K_flag && !O_flag) || (!K_flag && O_flag)) { ++ fprintf(stderr, "%s: -O also requires -K (and vice-versa)\n", pname); ++ exit (SCEP_PKISTATUS_FILE); ++ } ++ ++ if (K_flag) { ++ read_key(&renewal_key, K_char); ++ } ++ ++ if (O_flag) { ++ read_cert(&renewal_cert, O_char); ++ } ++ + if (operation_flag == SCEP_OPERATION_ENROLL) + read_request(); + +@@ -426,7 +461,14 @@ + if (v_flag) + fprintf(stdout, "%s: generating selfsigned " + "certificate\n", pname); +- new_selfsigned(&scep_t); ++ ++ if (! O_flag) ++ new_selfsigned(&scep_t); ++ else { ++ /* Use existing certificate */ ++ scep_t.signercert = renewal_cert; ++ scep_t.signerkey = renewal_key; ++ } + + /* Write the selfsigned certificate if requested */ + if (L_flag) { +@@ -436,7 +478,7 @@ + "file for writing\n", pname); + exit (SCEP_PKISTATUS_ERROR); + } +- if (PEM_write_X509(fp,scep_t.selfsigned) != 1) { ++ if (PEM_write_X509(fp,scep_t.signercert) != 1) { + fprintf(stderr, "%s: error while " + "writing certificate file\n", pname); + ERR_print_errors_fp(stderr); +@@ -643,7 +685,8 @@ + + void + usage() { +- fprintf(stdout, "\nsscep version %s\n\n" , VERSION); ++ fprintf(stdout, "\nsscep version %s using %s\n\n" , ++ VERSION,SSLeay_version(SSLEAY_VERSION)); + fprintf(stdout, "Usage: %s OPERATION [OPTIONS]\n" + "\nAvailable OPERATIONs are\n" + " getca Get CA/RA certificate(s)\n" +@@ -665,6 +708,8 @@ + "\nOPTIONS for OPERATION enroll are\n" + " -k Private key file\n" + " -r Certificate request file\n" ++ " -K Signature private key file, use with -O\n" ++ " -O Signature certificate (used instead of self-signed)\n" + " -l Write enrolled certificate in file\n" + " -e Use different CA cert for encryption\n" + " -L Write selfsigned certificate in file\n" +@@ -672,6 +717,8 @@ + " -T Max polling time in seconds\n" + " -n Max number of GetCertInitial requests\n" + " -R Resume interrupted enrollment\n" ++ " -C Check subject DN in the certificate return by the\n" ++ " CA (default is to match on the public key only)\n" + "\nOPTIONS for OPERATION getcert are\n" + " -k Private key file\n" + " -l Local certificate file\n" +diff -uN sscep/sscep.h sscep-ng2/sscep.h +--- sscep/sscep.h 2003-04-17 07:50:04.000000000 +0200 ++++ sscep-ng2/sscep.h 2006-04-28 10:46:49.000000000 +0200 +@@ -36,10 +36,9 @@ + #include + #include + +- + /* Global defines */ + +-#define VERSION "20030417" ++#define VERSION "20060428" + + /* SCEP operations */ + int operation_flag; +@@ -128,13 +127,13 @@ + X509 *encert; + X509 *localcert; + X509 *othercert; ++X509 *renewal_cert; + X509_REQ *request; + EVP_PKEY *rsa; ++EVP_PKEY *renewal_key; + X509_CRL *crl; + FILE *cafile; + FILE *reqfile; +-FILE *keyfile; +-FILE *localfile; + FILE *otherfile; + FILE *crlfile; + +@@ -207,7 +206,9 @@ + int recipient_nonce_len; + + /* Certificates */ +- X509 *selfsigned; ++ X509 *signercert; ++ EVP_PKEY *signerkey; ++ + EVP_PKEY *pkey; + + /* Request */ +@@ -251,13 +252,13 @@ + int init_scep(void); + + /* Read RSA private key file */ +-void read_key(void); ++void read_key(EVP_PKEY** key, char* filename); + + /* Read CA certificate file */ + void read_ca_cert(void); + + /* Read local certificate file */ +-void read_local_cert(void); ++void read_cert(X509** cert, char* filename); + + /* Read certificate request and private key */ + void read_request(void); diff --git a/net/sshfs/Makefile b/net/sshfs/Makefile new file mode 100644 index 0000000..43dd8e1 --- /dev/null +++ b/net/sshfs/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2007 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:=sshfs +PKG_VERSION:=2.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-fuse-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/fuse +PKG_MD5SUM:=26e9206eb5169e87e6f95f54bc005a4f + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-fuse-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/sshfs + TITLE:=SSHFS + DEPENDS:=+libfuse +fuse-utils +glib2 +libpthread + SECTION:=net + CATEGORY:=Network + SUBMENU:=Filesystem + URL:=http://fuse.sourceforge.net/ +endef + +define Package/sshfs/description + Mount remote system over sftp. +endef + +CONFIGURE_VARS += \ + SSHFS_CFLAGS=" \ + -D_FILE_OFFSET_BITS=64 \ + -I$(STAGING_DIR)/usr/include/glib-2.0 \ + -I$(STAGING_DIR)/usr/lib/glib-2.0/include \ + -I$(STAGING_DIR)/usr/include/fuse" \ + SSHFS_LIBS=" \ + -lglib-2.0 -liconv $(if $(INTL_FULL),-lintl) -lfuse -pthread -lgthread-2.0 \ + -L$(STAGING_DIR)/usr/lib" + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/sshfs/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sshfs $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,sshfs)) diff --git a/net/sshtunnel/Makefile b/net/sshtunnel/Makefile new file mode 100644 index 0000000..2d82aba --- /dev/null +++ b/net/sshtunnel/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2010-2011 OpenWrt.org +# Copyright (C) 2010 segal.di.ubi.pt +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sshtunnel +PKG_VERSION:=3 +PKG_RELEASE:=3 + +include $(INCLUDE_DIR)/package.mk + +define Package/sshtunnel + SECTION:=net + CATEGORY:=Network + SUBMENU:=SSH + TITLE:=Manages Local and Remote openssh ssh(1) tunnels + MAINTAINER:=Nuno Goncalves + DEPENDS:=+openssh-client +endef + +define Package/sshtunnel/description +Creates openssh ssh(1) Local and Remote tunnels configured in UCI file. Can be used to allow remote connections, possibly over NATed connections or without public IP/DNS +endef + +define Package/sshtunnel/conffiles +/etc/config/sshtunnel +endef + +define Build/Compile +endef + +define Package/sshtunnel/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/sshtunnel.init $(1)/etc/init.d/sshtunnel + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/sshtunnel.sh $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/uci_sshtunnel $(1)/etc/config/sshtunnel +endef + +$(eval $(call BuildPackage,sshtunnel)) diff --git a/net/sshtunnel/files/sshtunnel.init b/net/sshtunnel/files/sshtunnel.init new file mode 100644 index 0000000..3355e02 --- /dev/null +++ b/net/sshtunnel/files/sshtunnel.init @@ -0,0 +1,184 @@ +#!/bin/sh /etc/rc.common + +START=99 +STOP=01 + +PIDFILE="/tmp/run/sshtunnel" + + +append_params() { + local p; local v; local args; + for p in $*; do + eval "v=\$$p" + [ -n "$v" ] && args="$args -o $p=$v" + done + + ARGS_options="${args# *}" +} + +append_string() { + local varname="$1"; local add="$2"; local separator="${3:- }"; local actual + eval "actual=\$$varname" + + new="${actual:+$actual$separator}$add" + eval "$varname=\$new" +} + +load_tunnelR() { + config_get section_server $1 server + [ "$server" = "$section_server" ] || return 0 # continue to read next section if this is not for the current server + let count++ # count nr of valid sections to make sure there are at least one + + config_get remoteaddress $1 remoteaddress "*" + config_get remoteport $1 remoteport + config_get localaddress $1 localaddress + config_get localport $1 localport + + [ "$remoteport" -gt 0 ] || append_string "error" "[tunnelR: $1]remoteport must be a positive integer" "; " + [ "$localport" -gt 0 ] || append_string "error" "[tunnelR: $1]localport must be a positive integer" "; " + [ -n "$error" ] && return 1 + + append_string "ARGS_tunnels" "-R $remoteaddress:$remoteport:$localaddress:$localport" +} + +load_tunnelL() { + config_get section_server $1 server + [ "$server" = "$section_server" ] || return 0 # continue to read next section if this is not for the current server + let count++ # count nr of valid sections to make sure there are at least one + + config_get localaddress $1 localaddress "*" + config_get localport $1 localport + config_get remoteaddress $1 remoteaddress + config_get remoteport $1 remoteport + + [ "$remoteport" -gt 0 ] || append_string "error" "[tunnelL: $1]remoteport must be a positive integer" "; " + [ "$localport" -gt 0 ] || append_string "error" "[tunnelL: $1]localport must be a positive integer" "; " + [ -n "$error" ] && return 1 + + append_string "ARGS_tunnels" "-L $localaddress:$localport:$remoteaddress:$remoteport" +} + +load_tunnelD() { + config_get section_server $1 server + [ "$server" = "$section_server" ] || return 0 # continue to read next section if this is not for the current server + let count++ # count nr of valid sections to make sure there are at least one + + config_get localaddress $1 localaddress "*" + config_get localport $1 localport + + [ "$remoteport" -gt 0 ] || append_string "error" "[tunnelD: $1]remoteport must be a positive integer" "; " + [ "$localport" -gt 0 ] || append_string "error" "[tunnelD: $1]localport must be a positive integer" "; " + [ -n "$error" ] && return 1 + + append_string "ARGS_tunnels" "-D $localaddress:$localport" +} + +load_server() { + server="$1" + + config_get user $1 user + config_get hostname $1 hostname + config_get retrydelay $1 retrydelay "60" + config_get PKCS11Provider $1 PKCS11Provider + config_get CheckHostIP $1 CheckHostIP + config_get Compression $1 Compression + config_get CompressionLevel $1 CompressionLevel + config_get IdentityFile $1 IdentityFile + config_get LogLevel $1 LogLevel + config_get ServerAliveCountMax $1 ServerAliveCountMax + config_get ServerAliveInterval $1 ServerAliveInterval + config_get StrictHostKeyChecking $1 StrictHostKeyChecking + config_get TCPKeepAlive $1 TCPKeepAlive + config_get VerifyHostKeyDNS $1 VerifyHostKeyDNS + + error="" + [ -n "$user" ] \ + || append_string "error" "user is not set" "; " + [ -n "$hostname" ] \ + || append_string "error" "hostname is not set" "; " + [ "$retrydelay" -ge 1 ] \ + || append_string "error" "retrydelay must be a positive integer" "; " + [ -z "$PKCS11Provider" -o -f "$PKCS11Provider" ] \ + || append_string "error" "PKCS11Provider must be a pkcs11 shared library accessible" "; " + [ -z "$CheckHostIP" -o "$CheckHostIP"="yes" -o "$CheckHostIP"="no" ] \ + || append_string "error" "CheckHostIP must be 'yes' or 'no'" "; " + [ -z "$Compression" -o "$Compression"="yes" -o "$Compression"="no" ] \ + || append_string "error" "Compression must be 'yes' or 'no'" "; " + [ -z "$CompressionLevel" ] || [ "$CompressionLevel" -ge 1 -a "$CompressionLevel" -le 9 ] \ + || append_string "error" "CompressionLevel must be between 1 and 9" "; " + [ -z "$IdentityFile" -o -f "$IdentityFile" ] \ + || append_string "error" "IdentityFile $IdentityFile not accessible" "; " + [ -z "$LogLevel" -o "$LogLevel" = "QUIET" -o "$LogLevel" = "FATAL" -o "$LogLevel" = "ERROR" -o \ + "$LogLevel" = "INFO" -o "$LogLevel" = "VERBOSE" -o "$LogLevel" = "DEBUG" -o \ + "$LogLevel" = "DEBUG1" -o "$LogLevel" = "DEBUG2" -o "$LogLevel" = "DEBUG3" ] \ + || append_string "error" "LogLevel is invalid" "; " + [ -z "$ServerAliveCountMax" ] || [ "$ServerAliveCountMax" -ge 1 ] \ + || append_string "error" "ServerAliveCountMax must be greater or equal than 1" "; " + [ -z "$ServerAliveInterval" ] || [ "$ServerAliveInterval" -ge 0 ] \ + || append_string "error" "ServerAliveInterval must be greater or equal than 0" "; " + [ -z "$StrictHostKeyChecking" -o "$StrictHostKeyChecking" = "yes" -o "$StrictHostKeyChecking" = "ask" -o "$StrictHostKeyChecking" = "no" ] \ + || append_string "error" "StrictHostKeyChecking must be 'yes', 'ask' or 'no'" "; " + [ -z "$TCPKeepAlive" -o "$TCPKeepAlive" = "yes" -o "$TCPKeepAlive" = "no" ] \ + || append_string "error" "TCPKeepAlive must be 'yes' or 'no'" "; " + [ -z "$VerifyHostKeyDNS" -o "$VerifyHostKeyDNS" = "yes" -o "$VerifyHostKeyDNS" = "no" ] \ + || append_string "error" "VerifyHostKeyDNS must be 'yes' or 'no'" "; " + + [ -n "$error" ] && { logger -p user.err -t "sshtunnel" "tunnels to $server not started - $error"; return; } + + + ARGS="" + ARGS_options="" + ARGS_tunnels="" + + count=0 + config_foreach load_tunnelR tunnelR && config_foreach load_tunnelL tunnelL && config_foreach load_tunnelD tunnelD + [ -n "$error" ] && { logger -p user.err -t "sshtunnel" "tunnels to $server not started - $error"; return; } + [ "$count" -eq 0 ] && { logger -p user.err -t "sshtunnel" "tunnels to $server not started - no tunnels defined"; return; } + + append_params CheckHostIP Compression CompressionLevel IdentityFile LogLevel PKCS11Provider ServerAliveCountMax ServerAliveInterval StrictHostKeyChecking TCPKeepAlive VerifyHostKeyDNS + ARGS="$ARGS_options -o ExitOnForwardFailure=yes -o BatchMode=yes -nN $ARGS_tunnels $user@$hostname" + + /usr/bin/sshtunnel.sh "$ARGS" "$retrydelay" "$server" & + echo $! >> "${PIDFILE}.pids" + logger -p user.info -t "sshtunnel" "started tunnels to $server (pid=$!;retrydelay=$retrydelay)" +} + +stop() { + if [ -f "$PIDFILE".pids ] + then + logger -p user.info -t "sshtunnel" "stopping all tunnels" + + while read pid + do + kill "$pid" # kill mother process first + + [ -f "${PIDFILE}_${pid}.pid" ] && { # if ssh was running, kill it also (mother process could be in retry wait) + start-stop-daemon -K -p "${PIDFILE}_${pid}.pid" + rm "${PIDFILE}_${pid}.pid" + } + + logger -p daemon.info -t "sshtunnel[$pid]" "tunnel stopped" + + done < "${PIDFILE}.pids" + + rm "${PIDFILE}.pids" + + logger -p user.info -t "sshtunnel" "all tunnels stopped" + else + logger -p user.info -t "sshtunnel" "no tunnels running" + fi +} + +start() { + [ -f "${PIDFILE}.pids" ] && stop + + config_load sshtunnel + if [ -n "$(uci show sshtunnel.@server[0])" ] # at least one server section exists + then + logger -p user.info -t "sshtunnel" "starting all tunnels" + config_foreach load_server server + logger -p user.info -t "sshtunnel" "all tunnels started" + else + logger -p user.info -t "sshtunnel" "no servers defined" + fi +} diff --git a/net/sshtunnel/files/sshtunnel.sh b/net/sshtunnel/files/sshtunnel.sh new file mode 100644 index 0000000..0ff18a6 --- /dev/null +++ b/net/sshtunnel/files/sshtunnel.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +PIDFILE="/tmp/run/sshtunnel" + +args="$1" +retrydelay="$2" +server="$3" + +while true +do + logger -p daemon.info -t "sshtunnel[$$][$server]" "connection started" + + start-stop-daemon -S -p "${PIDFILE}_${$}.pid" -mx ssh -- $args &>/tmp/log/sshtunnel_$$ + + logger -p daemon.err -t "sshtunnel[$$][$server]" < /tmp/log/sshtunnel_$$ + rm /tmp/log/sshtunnel_$$ + logger -p daemon.info -t "sshtunnel[$$][$server]" "ssh exited with code $?, retrying in $retrydelay seconds" + rm "${PIDFILE}_${$}.pid" + + sleep "$retrydelay" & wait +done diff --git a/net/sshtunnel/files/uci_sshtunnel b/net/sshtunnel/files/uci_sshtunnel new file mode 100644 index 0000000..573bbe9 --- /dev/null +++ b/net/sshtunnel/files/uci_sshtunnel @@ -0,0 +1,51 @@ +# +# password authentication is not possible, public key authentication must be used. +# set "option IdentityFile" to he file from which the identity (private key) for RSA or DSA authentication is read. +# The default is ~/.ssh/identity for protocol version 1, and ~/.ssh/id_rsa and ~/.ssh/id_dsa for protocol version 2. +# ssh will also try to load certificate information from the filename obtained by appending -cert.pub to identity filenames. +# + +#config server disney +# option user mourinho +# option hostname server.disney.com +# option port 22 +# option retrydelay 1 +# option CheckHostIP yes +# option Compression no +# option CompressionLevel 6 +# option IdentityFile ~/.ssh/id_rsa +# option LogLevel INFO +# option PKCS11Provider /lib/pteidpkcs11.so +# option ServerAliveCountMax 3 +# option ServerAliveInterval 0 +# option StrictHostKeyChecking ask +# option TCPKeepAlive yes +# option VerifyHostKeyDNS yes + +# tunnelR(emote) - when the connection will be initiated to the R(emote) endpoint at +# remoteaddress:remoteport and then forwarded to localaddress:localport +# +#config tunnelR http +# option server disney +# option remoteaddress * +# option remoteport 9009 +# option localaddress 192.168.1.13 +# option localport 80 + +# tunnelL(ocal) - when the connection will be initiated to the L(ocal) endpoint at +# localaddress:localport and then forwarded to remoteaddress:remoteport +# +#config tunnelL test +# option server disney +# option localaddress * +# option localport 1022 +# option remoteaddress secretserver.disney.com +# option remoteport 22 + +# tunnelD(ynamic) - when the connection will be initiated with the SOCKS4 or SOCKS5 protocol +# to the local endpoint at localaddress:localport and then forwarded over the remote host +# +#config tunnelD proxy +# option server disney +# option localaddress * +# option localport 4055 diff --git a/net/sslcat/Makefile b/net/sslcat/Makefile new file mode 100644 index 0000000..eb7fcc0 --- /dev/null +++ b/net/sslcat/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sslcat +PKG_VERSION:=0.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME).tgz +PKG_SOURCE_URL:=http://www.bindshell.net/tools/sslcat/ +PKG_MD5SUM:=27a88e2143cbfe216e13e9493bacd32e + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/sslcat + SECTION:=net + CATEGORY:=Network + TITLE:=A netcat like utility with SSL support + URL:=http://www.bindshell.net/tools/sslcat + DEPENDS:= +libopenssl +endef + +define Package/sslcat/description + SSLCat is a simple Unix utility that reads and writes data across an + SSL enable network connection. +endef + +CONFIGURE_ARGS+= \ + --with-openssl=$(STAGING_DIR)/usr \ + +define Package/sslcat/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/sslcat $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,sslcat)) diff --git a/net/sslh/Makefile b/net/sslh/Makefile new file mode 100644 index 0000000..fd07014 --- /dev/null +++ b/net/sslh/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2009-2012 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:=sslh +PKG_VERSION:=1.10 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://rutschle.net/tech/ +PKG_MD5SUM:=bc34e9a4770d634633e70589c72708cc + +include $(INCLUDE_DIR)/package.mk + +define Package/sslh + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE:=SSL/SSH multiplexer + URL:=http://rutschle.net/tech/sslh.shtml + MAINTAINER:=Matthias Buecher +endef + +define Package/sslh/conffiles +/etc/config/sslh +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + USELIBWRAP= \ + all +endef + +define Package/sslh/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/sslh-fork $(1)/usr/sbin/sslh + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) +endef + +$(eval $(call BuildPackage,sslh)) diff --git a/net/sslh/files/sslh.config b/net/sslh/files/sslh.config new file mode 100644 index 0000000..07ed02b --- /dev/null +++ b/net/sslh/files/sslh.config @@ -0,0 +1,30 @@ +package 'sslh' + +config 'sslh' 'default' + # disable or enable + option 'enable' '1' + # listen defaults to '0.0.0.0:443' (all interfaces) + # multiple -p arguments may be supplied using a uci list + # -p : + option 'listen' '' + # ssh defaults to 'localhost:22' + # --ssh : + option 'ssh' '' + # ssl defaults to 'localhost:443' + # --ssl : + option 'ssl' '' + # openvpn defaults to 'localhost:1194' + # --openvpn : + option 'openvpn' '' + # tinc defaults to 'localhost:655' + # --tinc : + option 'tinc' '' + # xmpp defaults to 'localhost:5222' + # --xmpp : + option 'xmpp' '' + # timeout (for ssh, then ssl is assumed) defaults to 2 + # -t + option 'timeout' '' + # verbose defaults to off + # -v + option 'verbose' '0' diff --git a/net/sslh/files/sslh.init b/net/sslh/files/sslh.init new file mode 100644 index 0000000..0265656 --- /dev/null +++ b/net/sslh/files/sslh.init @@ -0,0 +1,57 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2012 OpenWrt.org + +START=95 + +# XXX: pid-files are useless because sslh forks after creating them +SERVICE_USE_PID= + +start_instance() { + local section="$1" + + # check if section is enabled (default) + local enable + config_get_bool enable "${section}" 'enable' '0' + [ ${enable} -gt 0 ] || return 1 + + local args="" + local val + # A) listen parameter + config_get vals "${section}" listen + [ -n "${vals}" ] && for val in $vals; do append args "-p ${val}"; done + # B) ssh parameter + config_get val "${section}" ssh + [ -n "${val}" ] && append args "--ssh ${val}" + # C) ssl parameter + config_get val "${section}" ssl + [ -n "${val}" ] && append args "--ssl ${val}" + # D) openvpn parameter + config_get val "${section}" openvpn + [ -n "${val}" ] && append args "--openvpn ${val}" + # E) tinc parameter + config_get val "${section}" tinc + [ -n "${val}" ] && append args "--tinc ${val}" + # F) xmpp parameter + config_get val "${section}" xmpp + [ -n "${val}" ] && append args "--xmpp ${val}" + # G) timeout (before a connection is considered to be SSH) + config_get val "${section}" timeout + [ -n "${val}" ] && append args "-t ${val}" + # H) verbose parameter + local verbosed + config_get_bool verbosed "${section}" verbose 0 + [ "${verbosed}" -ne 0 ] && append args "-v" + + # XXX: allow more that one instance to run simultaneously + SERVICE_MATCH_NAME=1 SERVICE_NAME="sslh-dummy-$$" \ + service_start /usr/sbin/sslh ${args} +} + +start() { + config_load 'sslh' + config_foreach start_instance 'sslh' +} + +stop() { + service_stop /usr/sbin/sslh +} diff --git a/net/sslh/patches/001-no_sslh_select.patch b/net/sslh/patches/001-no_sslh_select.patch new file mode 100644 index 0000000..a7ba881 --- /dev/null +++ b/net/sslh/patches/001-no_sslh_select.patch @@ -0,0 +1,29 @@ +--- a/Makefile ++++ b/Makefile +@@ -32,16 +32,12 @@ all: sslh $(MAN) echosrv + $(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -c $< + + +-sslh: $(OBJS) sslh-fork sslh-select ++sslh: $(OBJS) sslh-fork + + sslh-fork: $(OBJS) sslh-fork.o Makefile common.h + $(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -o sslh-fork sslh-fork.o $(OBJS) $(LIBS) + #strip sslh-fork + +-sslh-select: $(OBJS) sslh-select.o Makefile common.h +- $(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -o sslh-select sslh-select.o $(OBJS) $(LIBS) +- #strip sslh-select +- + echosrv: $(OBJS) echosrv.o + $(CC) $(CFLAGS) -o echosrv echosrv.o common.o $(LIBS) + +@@ -65,7 +61,7 @@ uninstall: + update-rc.d sslh remove + + clean: +- rm -f sslh-fork sslh-select echosrv $(MAN) *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info ++ rm -f sslh-fork echosrv $(MAN) *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info + + tags: + ctags -T *.[ch] diff --git a/net/sslsniff/Makefile b/net/sslsniff/Makefile new file mode 100644 index 0000000..6f80fdd --- /dev/null +++ b/net/sslsniff/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2009 David Cooper +# Copyright (C) 2009 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:=sslsniff +PKG_VERSION:=0.5 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://www.thoughtcrime.org/software/sslsniff +PKG_MD5SUM:=24653e2c4f1ca94328520667eb756369 + +include $(INCLUDE_DIR)/package.mk + +define Package/sslsniff + SECTION:=net + CATEGORY:=Network + TITLE:=SSL man-in-the-middle attack + URL:=http://www.thoughtcrime.org/software/sslsniff/index.html + DEPENDS:=+libopenssl +endef + +define Package/sslsniff/description + sslsniff is designed to MITM all SSL connections on a LAN, + and dynamically generates certs for the domains that are + being accessed on the fly. The new certificates are constructed + in a certificate chain that is signed by any certificate that + you provide. +endef + +# Take this opportunity to remove the pre-packaged x86 binary +define Build/Prepare +$(call Build/Prepare/Default) + $(RM) $(PKG_BUILD_DIR)/sslsniff +endef + +MAKE_FLAGS += CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)" + +define Package/sslsniff/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/sslsniff $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,sslsniff)) + diff --git a/net/sslsniff/patches/01-cross-compile.patch b/net/sslsniff/patches/01-cross-compile.patch new file mode 100644 index 0000000..48bee83 --- /dev/null +++ b/net/sslsniff/patches/01-cross-compile.patch @@ -0,0 +1,24 @@ +diff -ruN sslsniff-0.5.orig/Makefile sslsniff-0.5/Makefile +--- sslsniff-0.5.orig/Makefile 2009-02-16 12:00:36.000000000 -0500 ++++ sslsniff-0.5/Makefile 2009-02-23 11:14:22.000000000 -0500 +@@ -1,4 +1,7 @@ ++CC := gcc ++CFLAGS := -g -Wall ++ + all: +- gcc -g -Wall -o sslsniff cache.c sslsniff.c network.c mx509.c mssl.c log.c -lcrypto -lssl ++ $(CC) $(CFLAGS) -o sslsniff cache.c sslsniff.c network.c mx509.c mssl.c log.c -lcrypto -lssl + clean: + rm sslsniff +\ No newline at end of file +diff -ruN sslsniff-0.5.orig/network.c sslsniff-0.5/network.c +--- sslsniff-0.5.orig/network.c 2009-02-16 12:00:36.000000000 -0500 ++++ sslsniff-0.5/network.c 2009-02-23 10:45:37.000000000 -0500 +@@ -27,6 +27,7 @@ + * SUCH DAMAGE. + */ + ++#include + #include + #include + #include diff --git a/net/sslstrip/Makefile b/net/sslstrip/Makefile new file mode 100644 index 0000000..5b2bab2 --- /dev/null +++ b/net/sslstrip/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sslstrip +PKG_VERSION:=0.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.thoughtcrime.org/software/sslstrip +PKG_MD5SUM:=7fedb46e682c2d8ef3fbc52da5e002da + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/sslstrip + SECTION:=net + CATEGORY:=Network + TITLE:=sslstrip + URL:=http://www.thoughtcrime.org/software/sslstrip/index.html + DEPENDS:=+python +twisted +twisted-web +pyopenssl +endef + +define Package/sslstrip/description + sslstrip will transparently hijack HTTP traffic on a network, + watch for HTTPS links and redirects, then map those links + into either look-alike HTTP links or homograph-similar HTTPS + links. It also supports modes for supplying a favicon which + looks like a lock icon, selective logging, and session denial. +endef + +define Build/Compile + $(call Build/Compile/PyMod,,install --prefix="$(PKG_INSTALL_DIR)/usr") +endef + +define Package/sslstrip/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/bin/sslstrip \ + $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/share/sslstrip + $(CP) \ + $(PKG_INSTALL_DIR)/usr/share/sslstrip/* \ + $(1)/usr/share/sslstrip + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR) + $(CP) \ + $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \ + $(1)$(PYTHON_PKG_DIR) +endef + +$(eval $(call BuildPackage,sslstrip)) diff --git a/net/ssltunnel/Makefile b/net/ssltunnel/Makefile new file mode 100644 index 0000000..84ddadb --- /dev/null +++ b/net/ssltunnel/Makefile @@ -0,0 +1,57 @@ +# +# 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:=ssltunnel +PKG_VERSION:=1.16 +PKG_RELEASE:=1 + +PKG_SOURCE:=${PKG_NAME}-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.hsc.fr/ressources/outils/ssltunnel/download +PKG_MD5SUM:=4039b50566a33a4077883ea974e476d5 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ssltunnel + SECTION:=net + CATEGORY:=Network + DEPENDS:=+ppp +libopenssl + TITLE:=A PPP over SSL VPN tool + URL:=http://www.hsc.fr/ressources/outils/ssltunnel/index.html + SUBMENU:=VPN +endef + +define Package/ssltunnel/description + SSLTunnel is a client/server program to create a PPP connection over a + SSL/TLS session. + Client and server are mutually authenticated using a X509 certificate, + PPP packets are then encrypted/decrypted realtime on each side. + It's possible to use ssltunnel to connect a machine to another, a + machine with a network or two networks sets. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + , \ + BUILD_CC="$(TARGET_CC)" \ + HOSTCC="$(HOSTCC)" \ + ) +endef + +define Package/ssltunnel/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pppclient $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pppwho $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/pppserver $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,ssltunnel)) diff --git a/net/strongswan/Config.in b/net/strongswan/Config.in new file mode 100644 index 0000000..10b4ec6 --- /dev/null +++ b/net/strongswan/Config.in @@ -0,0 +1,28 @@ +menu "Configuration" + depends on PACKAGE_strongswan + +# --with-random-device +config STRONGSWAN_DEVICE_RANDOM + string + prompt "Set the device to read real random data from" + default "/dev/random" + +# --with-urandom-device +config STRONGSWAN_DEVICE_URANDOM + string + prompt "Set the device to read pseudo random data from" + default "/dev/urandom" + +# --with-routing-table +config STRONGSWAN_ROUTING_TABLE + string + prompt "Set the IPsec routing table ID" + default "220" + +# --with-routing-table-prio +config STRONGSWAN_ROUTING_TABLE_PRIO + string + prompt "Set the IPsec routing table priority" + default "220" + +endmenu diff --git a/net/strongswan/Makefile b/net/strongswan/Makefile new file mode 100644 index 0000000..cb8f95f --- /dev/null +++ b/net/strongswan/Makefile @@ -0,0 +1,498 @@ +# +# Copyright (C) 2012 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:=strongswan +PKG_VERSION:=5.0.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://download.strongswan.org/ +PKG_MD5SUM:=c8b861305def7c0abae04f7bbefec212 + +PKG_MOD_AVAILABLE:= \ + addrblock \ + aes \ + af-alg \ + agent \ + attr \ + attr-sql \ + blowfish \ + ccm \ + cmac \ + constraints \ + coupling \ + ctr \ + curl \ + des \ + dhcp \ + dnskey \ + duplicheck \ + eap-identity \ + eap-md5 \ + eap-mschapv2 \ + farp \ + fips-prf \ + gcm \ + gcrypt \ + gmp \ + ha \ + hmac \ + kernel-klips \ + kernel-netlink \ + kernel-pfkey \ + ldap \ + led \ + load-tester \ + nonce \ + md4 \ + md5 \ + mysql \ + openssl \ + padlock \ + pem \ + pgp \ + pkcs1 \ + pkcs8 \ + pkcs11 \ + pubkey \ + random \ + resolve \ + revocation \ + sha1 \ + sha2 \ + smp \ + socket-default \ + socket-dynamic \ + socket-raw \ + sql \ + sqlite \ + stroke \ + test-vectors \ + uci \ + updown \ + whitelist \ + x509 \ + xauth-eap \ + xauth-generic \ + xcbc \ + +PKG_CONFIG_DEPENDS:= \ + CONFIG_STRONGSWAN_DEVICE_RANDOM \ + CONFIG_STRONGSWAN_DEVICE_URANDOM \ + CONFIG_STRONGSWAN_ROUTING_TABLE \ + CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO \ + $(patsubst %,CONFIG_PACKAGE_strongswan-mod-%,$(PKG_MOD_AVAILABLE)) \ + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/strongswan/Default + SUBMENU:=VPN + SECTION:=net + CATEGORY:=Network + TITLE:=StrongSwan + URL:=http://www.strongswan.org/ +endef + +define Package/strongswan/description/Default + StrongSwan is an OpenSource IPsec implementation for the Linux operating system. +endef + +define Package/strongswan +$(call Package/strongswan/Default) + DEPENDS:= +libpthread +ip \ + +kmod-crypto-authenc \ + +kmod-ipsec +kmod-ipsec4 +kmod-ipsec6 \ + +kmod-ipt-ipsec +iptables-mod-ipsec +endef + +define Package/strongswan/config + source "$(SOURCE)/Config.in" +endef + +define Package/strongswan/description +$(call Package/strongswan/description/Default) + This package contains shared libraries and scripts. +endef + +define Package/strongswan-full +$(call Package/strongswan/Default) + TITLE+= (full) + DEPENDS:= +strongswan \ + +strongswan-charon \ + +strongswan-libfast \ + +strongswan-mod-addrblock \ + +strongswan-mod-aes \ + +strongswan-mod-af-alg \ + +strongswan-mod-agent \ + +strongswan-mod-attr \ + +strongswan-mod-attr-sql \ + +strongswan-mod-blowfish \ + +strongswan-mod-ccm \ + +strongswan-mod-cmac \ + +strongswan-mod-constraints \ + +strongswan-mod-coupling \ + +strongswan-mod-ctr \ + +strongswan-mod-curl \ + +strongswan-mod-des \ + +strongswan-mod-dhcp \ + +strongswan-mod-dnskey \ + +strongswan-mod-duplicheck \ + +strongswan-mod-eap-identity \ + +strongswan-mod-eap-md5 \ + +strongswan-mod-eap-mschapv2 \ + +strongswan-mod-farp \ + +strongswan-mod-fips-prf \ + +strongswan-mod-gcm \ + +strongswan-mod-gcrypt \ + +strongswan-mod-gmp \ + +strongswan-mod-ha \ + +strongswan-mod-hmac \ + +strongswan-mod-kernel-netlink \ + +strongswan-mod-ldap \ + +strongswan-mod-led \ + +strongswan-mod-load-tester \ + +strongswan-mod-nonce \ + +strongswan-mod-md4 \ + +strongswan-mod-md5 \ + +strongswan-mod-mysql \ + +strongswan-mod-openssl \ + +TARGET_x86:strongswan-mod-padlock \ + +strongswan-mod-pem \ + +strongswan-mod-pgp \ + +strongswan-mod-pkcs1 \ + +strongswan-mod-pkcs8 \ + +strongswan-mod-pkcs11 \ + +strongswan-mod-pubkey \ + +strongswan-mod-random \ + +strongswan-mod-resolve \ + +strongswan-mod-revocation \ + +strongswan-mod-sha1 \ + +strongswan-mod-sha2 \ + +strongswan-mod-smp \ + +strongswan-mod-socket-default \ + +strongswan-mod-sql \ + +strongswan-mod-sqlite \ + +strongswan-mod-stroke \ + +strongswan-mod-test-vectors \ + +strongswan-mod-uci \ + +strongswan-mod-updown \ + +strongswan-mod-whitelist \ + +strongswan-mod-x509 \ + +strongswan-mod-xauth-eap \ + +strongswan-mod-xauth-generic \ + +strongswan-mod-xcbc \ + +strongswan-utils \ + @DEVEL +endef + +define Package/strongswan-full/description +$(call Package/strongswan/description/Default) + This meta-package contains dependencies for all of the strongswan plugins + except kernel-klips, kernel-pfkey, socket-dynamic and socket-raw which are + ommitted in favor of the kernel-netlink and socket-default plugins. +endef + + +define Package/strongswan-default +$(call Package/strongswan/Default) + TITLE+= (default) + DEPENDS:= +strongswan \ + +strongswan-charon \ + +strongswan-mod-aes \ + +strongswan-mod-attr \ + +strongswan-mod-constraints \ + +strongswan-mod-des \ + +strongswan-mod-dnskey \ + +strongswan-mod-fips-prf \ + +strongswan-mod-gmp \ + +strongswan-mod-hmac \ + +strongswan-mod-kernel-netlink \ + +strongswan-mod-md5 \ + +strongswan-mod-nonce \ + +strongswan-mod-pem \ + +strongswan-mod-pgp \ + +strongswan-mod-pkcs1 \ + +strongswan-mod-pubkey \ + +strongswan-mod-random \ + +strongswan-mod-resolve \ + +strongswan-mod-revocation \ + +strongswan-mod-sha1 \ + +strongswan-mod-sha2 \ + +strongswan-mod-socket-default \ + +strongswan-mod-stroke \ + +strongswan-mod-updown \ + +strongswan-mod-x509 \ + +strongswan-mod-xauth-generic \ + +strongswan-mod-xcbc \ + +strongswan-utils +endef + +define Package/strongswan-default/description +$(call Package/strongswan/description/Default) + This meta-package contains only dependencies to match upstream defaults. +endef + +define Package/strongswan-minimal +$(call Package/strongswan/Default) + TITLE+= (minimal) + DEPENDS:= +strongswan \ + +strongswan-charon \ + +strongswan-mod-aes \ + +strongswan-mod-gmp \ + +strongswan-mod-hmac \ + +strongswan-mod-kernel-netlink \ + +strongswan-mod-nonce \ + +strongswan-mod-pubkey \ + +strongswan-mod-random \ + +strongswan-mod-sha1 \ + +strongswan-mod-socket-default \ + +strongswan-mod-stroke \ + +strongswan-mod-updown \ + +strongswan-mod-x509 \ + +strongswan-mod-xcbc +endef + +define Package/strongswan-minimal/description +$(call Package/strongswan/description/Default) + This meta-package contains only dependencies for a minimal IKEv2 setup. +endef + +define Package/strongswan-charon +$(call Package/strongswan/Default) + TITLE+= IKEv1/IKEv2 keying daemon + DEPENDS:= +strongswan +endef + +define Package/strongswan-charon/description +$(call Package/strongswan/description/Default) + This package contains charon, an IKEv2 keying daemon. +endef + +define Package/strongswan-libfast +$(call Package/strongswan/Default) + TITLE+= libfast + DEPENDS:= +strongswan \ + +PACKAGE_strongswan-libfast:zlib \ + +PACKAGE_strongswan-libfast:fcgi \ + +PACKAGE_strongswan-libfast:clearsilver +endef + +define Package/strongswan-libfast/description +$(call Package/strongswan/description/Default) + This package contains libfast, a lightweight framework to build native web + applications using ClearSilver and FastCGI. +endef + +define Package/strongswan-utils +$(call Package/strongswan/Default) + TITLE+= utilities + DEPENDS:= +strongswan +endef + +define Package/strongswan-utils/description +$(call Package/strongswan/description/Default) + This package contains the openac, pki & scepclient utilities. +endef + +define BuildPlugin + define Package/strongswan-mod-$(1) + $$(call Package/strongswan/Default) + TITLE:= StrongSwan $(2) plugin + DEPENDS:= +strongswan $(3) + endef + + define Package/strongswan-mod-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/ipsec/plugins + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-$(1).so \ + $$(1)/usr/lib/ipsec/plugins/ + $(call Plugin/$(1)/install,$$(1)) + endef + + $$(eval $$(call BuildPackage,strongswan-mod-$(1))) +endef + +CONFIGURE_ARGS+= \ + --disable-scripts \ + --disable-static \ + $(if $(CONFIG_PACKAGE_strongswan-libfast),--enable-fast,--disable-fast) \ + $(if $(CONFIG_PACKAGE_strongswan-utils),--enable-tools,--disable-tools) \ + --with-random-device="$(call qstrip,$(CONFIG_STRONGSWAN_DEVICE_RANDOM))" \ + --with-urandom-device="$(call qstrip,$(CONFIG_STRONGSWAN_DEVICE_URANDOM))" \ + --with-routing-table="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE))" \ + --with-routing-table-prio="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO))" \ + $(foreach m,$(PKG_MOD_AVAILABLE), \ + $(if $(CONFIG_PACKAGE_strongswan-mod-$(m)),--enable-$(m),--disable-$(m)) \ + ) + +ifneq ($(CONFIG_PACKAGE_strongswan-libfast),) + EXTRA_CPPFLAGS+= -I$(STAGING_DIR)/usr/include/ClearSilver +endif + +EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib + +define Package/strongswan/conffiles +/etc/ipsec.conf +/etc/ipsec.secrets +/etc/strongswan.conf +endef + +define Package/strongswan/install + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/strongswan.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/lib/ipsec + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{libstrongswan.so.*,libhydra.so.*} $(1)/usr/lib/ipsec/ + $(INSTALL_CONF) ./files/ipsec.secrets $(1)/etc/ +endef + +define Package/strongswan-default/install + true +endef + +define Package/strongswan-full/install + true +endef + +define Package/strongswan-minimal/install + true +endef + +define Package/strongswan-charon/install + $(INSTALL_DIR) $(1)/usr/lib/ipsec + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/charon $(1)/usr/lib/ipsec/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libcharon.so.* $(1)/usr/lib/ipsec/ +endef + +define Package/strongswan-libfast/install + $(INSTALL_DIR) $(1)/usr/lib/ipsec + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libfast.so.* $(1)/usr/lib/ipsec/ +endef + +define Package/strongswan-utils/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipsec $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/ipsec + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{openac,pki,scepclient} $(1)/usr/lib/ipsec/ +endef + +define Plugin/duplicheck/install + $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/duplicheck $(1)/usr/lib/ipsec/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-duplicheck.so $(1)/usr/lib/ipsec/plugins/ +endef + +define Plugin/attr-sql/install + $(INSTALL_DIR) $(1)/usr/lib/ipsec + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/pool $(1)/usr/lib/ipsec/ +endef + +define Plugin/stroke/install + $(INSTALL_DIR) $(1)/etc/ipsec.d/aacerts + $(INSTALL_DIR) $(1)/etc/ipsec.d/acerts + $(INSTALL_DIR) $(1)/etc/ipsec.d/cacerts + $(INSTALL_DIR) $(1)/etc/ipsec.d/certs + $(INSTALL_DIR) $(1)/etc/ipsec.d/crls + $(INSTALL_DIR) $(1)/etc/ipsec.d/ocspcerts + $(INSTALL_DIR) $(1)/etc/ipsec.d/private + $(INSTALL_DIR) $(1)/etc/ipsec.d/reqs + + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/ipsec.conf $(1)/etc/ + + $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{starter,stroke} $(1)/usr/lib/ipsec/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-stroke.so $(1)/usr/lib/ipsec/plugins/ +endef + +define Plugin/updown/install + $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{_updown,_updown_espmark} $(1)/usr/lib/ipsec/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-updown.so $(1)/usr/lib/ipsec/plugins/ +endef + +define Plugin/whitelist/install + $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/whitelist $(1)/usr/lib/ipsec/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-whitelist.so $(1)/usr/lib/ipsec/plugins/ +endef + +$(eval $(call BuildPackage,strongswan)) +$(eval $(call BuildPackage,strongswan-default)) +$(eval $(call BuildPackage,strongswan-full)) +$(eval $(call BuildPackage,strongswan-minimal)) +$(eval $(call BuildPackage,strongswan-charon)) +$(eval $(call BuildPackage,strongswan-libfast)) +$(eval $(call BuildPackage,strongswan-utils)) +$(eval $(call BuildPlugin,addrblock,RFC 3779 address block constraint support,)) +$(eval $(call BuildPlugin,aes,AES crypto,)) +$(eval $(call BuildPlugin,af-alg,AF_ALG crypto interface to Linux Crypto API,+kmod-crypto-user)) +$(eval $(call BuildPlugin,agent,SSH agent signing,)) +$(eval $(call BuildPlugin,attr,file based config,)) +$(eval $(call BuildPlugin,attr-sql,SQL based config,+strongswan-mod-sql)) +$(eval $(call BuildPlugin,blowfish,Blowfish crypto,)) +$(eval $(call BuildPlugin,ccm,CCM AEAD wrapper crypto,)) +$(eval $(call BuildPlugin,cmac,CMAC crypto,)) +$(eval $(call BuildPlugin,constraints,advanced X509 constraint checking,)) +$(eval $(call BuildPlugin,coupling,IKEv2 plugin to couple peer certificates permanently to authentication,)) +$(eval $(call BuildPlugin,ctr,Counter Mode wrapper crypto,)) +$(eval $(call BuildPlugin,curl,cURL fetcher plugin,+PACKAGE_strongswan-mod-curl:libcurl)) +$(eval $(call BuildPlugin,des,DES crypto,)) +$(eval $(call BuildPlugin,dhcp,DHCP based attribute provider,)) +$(eval $(call BuildPlugin,dnskey,DNS RR key decoding,)) +$(eval $(call BuildPlugin,duplicheck,advanced duplicate checking,)) +$(eval $(call BuildPlugin,eap-identity,EAP identity helper,)) +$(eval $(call BuildPlugin,eap-md5,EAP MD5 (CHAP) EAP auth,)) +$(eval $(call BuildPlugin,eap-mschapv2,EAP MS-CHAPv2 EAP auth,)) +$(eval $(call BuildPlugin,farp,fake arp respsonses,)) +$(eval $(call BuildPlugin,fips-prf,FIPS PRF crypto,+strongswan-mod-sha1)) +$(eval $(call BuildPlugin,gcm,GCM AEAD wrapper crypto,)) +$(eval $(call BuildPlugin,gcrypt,libgcrypt,+PACKAGE_strongswan-mod-gcrypt:libgcrypt)) +$(eval $(call BuildPlugin,gmp,libgmp,+PACKAGE_strongswan-mod-gmp:libgmp)) +$(eval $(call BuildPlugin,ha,high availability cluster,)) +$(eval $(call BuildPlugin,hmac,HMAC crypto,)) +$(eval $(call BuildPlugin,kernel-klips,KLIPS kernel interface,)) +$(eval $(call BuildPlugin,kernel-netlink,netlink kernel interface,)) +$(eval $(call BuildPlugin,kernel-pfkey,PK_KEY kernel interface,)) +$(eval $(call BuildPlugin,ldap,LDAP,+PACKAGE_strongswan-mod-ldap:libopenldap)) +$(eval $(call BuildPlugin,led,LED blink on IKE activity,)) +$(eval $(call BuildPlugin,load-tester,load testing,)) +$(eval $(call BuildPlugin,nonce,nonce genereation,)) +$(eval $(call BuildPlugin,md4,MD4 crypto,)) +$(eval $(call BuildPlugin,md5,MD5 crypto,)) +$(eval $(call BuildPlugin,mysql,MySQL database interface,+strongswan-mod-sql +PACKAGE_strongswan-mod-mysql:libmysqlclient-r)) +$(eval $(call BuildPlugin,openssl,OpenSSL crypto,+PACKAGE_strongswan-mod-openssl:libopenssl)) +$(eval $(call BuildPlugin,padlock,VIA PadLock crypto,@TARGET_x86)) +$(eval $(call BuildPlugin,pem,PEM decoding,)) +$(eval $(call BuildPlugin,pgp,PGP key decoding,)) +$(eval $(call BuildPlugin,pkcs1,PKCS1 key decoding,)) +$(eval $(call BuildPlugin,pkcs8,PKCS8 key decoding,)) +$(eval $(call BuildPlugin,pkcs11,PKCS11 key decoding,)) +$(eval $(call BuildPlugin,pubkey,raw public key,)) +$(eval $(call BuildPlugin,random,RNG,)) +$(eval $(call BuildPlugin,resolve,DNS resolver,)) +$(eval $(call BuildPlugin,revocation,X509 CRL/OCSP revocation,)) +$(eval $(call BuildPlugin,sha1,SHA1 crypto,)) +$(eval $(call BuildPlugin,sha2,SHA2 crypto,)) +$(eval $(call BuildPlugin,smp,SMP configuration and control interface,+PACKAGE_strongswan-mod-smp:libxml2)) +$(eval $(call BuildPlugin,socket-default,default socket implementation for charon,)) +$(eval $(call BuildPlugin,socket-dynamic,dynamic socket implementation for charon,)) +$(eval $(call BuildPlugin,socket-raw,raw socket implementation for charon,)) +$(eval $(call BuildPlugin,sql,SQL database interface,)) +$(eval $(call BuildPlugin,sqlite,SQLite database interface,+strongswan-mod-sql +PACKAGE_strongswan-mod-sqlite:libsqlite3)) +$(eval $(call BuildPlugin,stroke,Stroke,+strongswan-utils)) +$(eval $(call BuildPlugin,test-vectors,crypto test vectors,)) +$(eval $(call BuildPlugin,uci,UCI config interface,+PACKAGE_strongswan-mod-uci:libuci)) +$(eval $(call BuildPlugin,updown,updown firewall,)) +$(eval $(call BuildPlugin,whitelist,peer identity whitelisting,)) +$(eval $(call BuildPlugin,x509,x509 certificate,)) +$(eval $(call BuildPlugin,xauth-eap,EAP XAuth backend,)) +$(eval $(call BuildPlugin,xauth-generic,generic XAuth backend,)) +$(eval $(call BuildPlugin,xcbc,xcbc crypto,)) diff --git a/net/strongswan/files/ipsec.secrets b/net/strongswan/files/ipsec.secrets new file mode 100644 index 0000000..ddd4956 --- /dev/null +++ b/net/strongswan/files/ipsec.secrets @@ -0,0 +1 @@ +# /etc/ipsec.secrets - strongSwan IPsec secrets file diff --git a/net/strongswan/patches/201-no-modprobe.patch b/net/strongswan/patches/201-no-modprobe.patch new file mode 100644 index 0000000..5dee45e --- /dev/null +++ b/net/strongswan/patches/201-no-modprobe.patch @@ -0,0 +1,28 @@ +--- a/src/starter/netkey.c ++++ b/src/starter/netkey.c +@@ -31,7 +31,7 @@ bool starter_netkey_init(void) + /* af_key module makes the netkey proc interface visible */ + if (stat(PROC_MODULES, &stb) == 0) + { +- ignore_result(system("modprobe -qv af_key")); ++ ignore_result(system("insmod -qv af_key")); + } + + /* now test again */ +@@ -45,11 +45,11 @@ bool starter_netkey_init(void) + /* make sure that all required IPsec modules are loaded */ + if (stat(PROC_MODULES, &stb) == 0) + { +- ignore_result(system("modprobe -qv ah4")); +- ignore_result(system("modprobe -qv esp4")); +- ignore_result(system("modprobe -qv ipcomp")); +- ignore_result(system("modprobe -qv xfrm4_tunnel")); +- ignore_result(system("modprobe -qv xfrm_user")); ++ ignore_result(system("insmod -qv ah4")); ++ ignore_result(system("insmod -qv esp4")); ++ ignore_result(system("insmod -qv ipcomp")); ++ ignore_result(system("insmod -qv xfrm4_tunnel")); ++ ignore_result(system("insmod -qv xfrm_user")); + } + + DBG2(DBG_APP, "found netkey IPsec stack"); diff --git a/net/strongswan/patches/203-uci.patch b/net/strongswan/patches/203-uci.patch new file mode 100644 index 0000000..274ea86 --- /dev/null +++ b/net/strongswan/patches/203-uci.patch @@ -0,0 +1,20 @@ +--- a/src/libcharon/plugins/uci/uci_parser.c ++++ b/src/libcharon/plugins/uci/uci_parser.c +@@ -78,7 +78,7 @@ METHOD(enumerator_t, section_enumerator_ + if (uci_lookup(this->ctx, &element, this->package, + this->current->name, "name") == UCI_OK) + { /* use "name" attribute as config name if available ... */ +- *value = uci_to_option(element)->value; ++ *value = uci_to_option(element)->v.string; + } + else + { /* ... or the section name becomes config name */ +@@ -93,7 +93,7 @@ METHOD(enumerator_t, section_enumerator_ + if (value && uci_lookup(this->ctx, &element, this->package, + this->current->name, this->keywords[i]) == UCI_OK) + { +- *value = uci_to_option(element)->value; ++ *value = uci_to_option(element)->v.string; + } + } + va_end(args); diff --git a/net/stun/Makefile b/net/stun/Makefile new file mode 100644 index 0000000..43c885f --- /dev/null +++ b/net/stun/Makefile @@ -0,0 +1,87 @@ +# +# Copyright (C) 2008-2011 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:=stund +PKG_VERSION:=0.96 +PKG_RELEASE:=6 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION)_Aug13.tgz +PKG_SOURCE_URL:=@SF/stun +PKG_MD5SUM:=3273abb1a6f299f4e611b658304faefa + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/stun/Default + SECTION:=net + CATEGORY:=Network + DEPENDS:=$(CXX_DEPENDS) + URL:=http://sourceforge.net/projects/stun +endef + +define Package/stun/Default/description + The STUN protocol (Simple Traversal of UDP through NATs) is described in the + IETF RFC 3489, available at http://www.ietf.org/rfc/rfc3489.txt. It's used to + help clients behind NAT to tunnel incoming calls through. This server is the + counterpart to help the client identify the NAT and have it open the proper + ports for it. +endef + +define Package/stund +$(call Package/stun/Default) + TITLE:=STUN server +endef + +define Package/stund/description +$(call Package/stun/Default/description) +endef + +define Package/stun-client +$(call Package/stun/Default) + TITLE:=STUN test client +endef + +define Package/stun-client/description +$(call Package/stun/Default/description) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CXX="$(TARGET_CXX)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \ + CPPFLAGS="$$$$CPPFLAGS $(TARGET_CPPFLAGS)" \ + LDFLAGS="$$$$LDFLAGS $(TARGET_LDFLAGS)" \ + all +endef + + +define Package/stund/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/server $(1)/usr/sbin/stund + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/stund.init $(1)/etc/init.d/stund + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/stund.config $(1)/etc/config/stund +endef + +define Package/stund/conffiles +/etc/config/stund +endef + +define Package/stun-client/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/client $(1)/usr/sbin/stun-client +endef + +$(eval $(call BuildPackage,stund)) +$(eval $(call BuildPackage,stun-client)) diff --git a/net/stun/files/stund.config b/net/stun/files/stund.config new file mode 100644 index 0000000..0a0bc07 --- /dev/null +++ b/net/stun/files/stund.config @@ -0,0 +1,5 @@ +config stund + option primaryip '' + option secondaryip '' + option primaryport '3478' + option secondaryport '3479' diff --git a/net/stun/files/stund.init b/net/stun/files/stund.init new file mode 100644 index 0000000..1deada4 --- /dev/null +++ b/net/stun/files/stund.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2011 OpenWrt.org + +START=70 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +start() { + local pri_ip sec_ip pri_port sec_port + + parse_opts() { + local cfg="$1" + config_get pri_ip "$cfg" 'primaryip' + config_get sec_ip "$cfg" 'secondaryip' + config_get pri_port "$cfg" 'primaryport' + config_get sec_port "$cfg" 'secondaryport' + } + + config_load 'stund' + config_foreach parse_opts + + service_start /usr/sbin/stund \ + ${pri_ip:+-h $pri_ip} ${sec_ip:+-a $sec_ip} \ + ${pri_port:+-p $pri_port} ${sec_port:+-o $sec_port} +} + +stop() { + service_stop /usr/sbin/stund +} diff --git a/net/stun/patches/001-fix_non_i386.patch b/net/stun/patches/001-fix_non_i386.patch new file mode 100644 index 0000000..070b551 --- /dev/null +++ b/net/stun/patches/001-fix_non_i386.patch @@ -0,0 +1,27 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## fix_non_i386.dpatch by Kilian Krause +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Remove i386-only code analogous to twinkle +@DPATCH@ +diff -urNad stun-0.96~/stun.cxx stun-0.96/stun.cxx +--- stun-0.96~/stun.cxx 2005-08-14 00:39:03.000000000 +0000 ++++ stun-0.96/stun.cxx 2006-01-03 00:54:33.000000000 +0000 +@@ -669,16 +669,8 @@ + tick = hightick; + tick <<= 32; + tick |= lowtick; +-#elif defined(__GNUC__) && ( defined(__i686__) || defined(__i386__) ) +- asm("rdtsc" : "=A" (tick)); +-#elif defined (__SUNPRO_CC) || defined( __sparc__ ) +- tick = gethrtime(); +-#elif defined(__MACH__) +- int fd=open("/dev/random",O_RDONLY); +- read(fd,&tick,sizeof(tick)); +- closesocket(fd); + #else +-# error Need some way to seed the random number generator ++ tick = time(NULL); + #endif + int seed = int(tick); + #ifdef WIN32 diff --git a/net/stun/patches/002-linking_order.patch b/net/stun/patches/002-linking_order.patch new file mode 100644 index 0000000..c9a23f1 --- /dev/null +++ b/net/stun/patches/002-linking_order.patch @@ -0,0 +1,19 @@ +--- a/Makefile ++++ b/Makefile +@@ -37,13 +37,13 @@ + $(addprefix stund/, $(TARS)) + + server: server.o stun.o udp.o +- $(CXX) $(LDFLAGS) -o $@ $^ ++ $(CXX) -o $@ $^ $(LDFLAGS) + + tlsServer: tlsServer.o stun.o udp.o +- $(CXX) $(LDFLAGS) -o $@ $^ ++ $(CXX) -o $@ $^ $(LDFLAGS) + + client: client.o stun.o udp.o +- $(CXX) $(LDFLAGS) -o $@ $^ ++ $(CXX) -o $@ $^ $(LDFLAGS) + + %.o:%.cxx + $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ diff --git a/net/stunnel/Makefile b/net/stunnel/Makefile new file mode 100644 index 0000000..f124b35 --- /dev/null +++ b/net/stunnel/Makefile @@ -0,0 +1,65 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=stunnel +PKG_VERSION:=4.33 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=http://www.stunnel.org/download/stunnel/src/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=559a864066d8cc4afd8a97682c90d41c + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/stunnel + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libopenssl +libwrap + TITLE:=SSL TCP Wrapper + URL:=http://www.stunnel.org/ +endef + +define Package/stunnel/description + Stunnel is a program that allows you to encrypt arbitrary TCP + connections inside SSL (Secure Sockets Layer) available on both Unix + and Windows. Stunnel can allow you to secure non-SSL aware daemons and + protocols (like POP, IMAP, LDAP, etc) by having Stunnel provide the + encryption, requiring no changes to the daemon's code. +endef + +define Package/stunnel/conffiles +/etc/stunnel/stunnel.conf +endef + +CONFIGURE_ARGS+= \ + --with-random=/dev/urandom \ + --with-threads=fork \ + --with-ssl=$(STAGING_DIR)/usr \ + +define Build/Compile + mkdir -p $(PKG_INSTALL_DIR)/etc/stunnel + echo '#dummy' > $(PKG_INSTALL_DIR)/etc/stunnel/stunnel.pem + $(call Build/Compile/Default) +endef + +define Package/stunnel/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/stunnel $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/stunnel + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/stunnel/libstunnel.so $(1)/usr/lib/stunnel/ + $(INSTALL_DIR) $(1)/etc/stunnel + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/stunnel/stunnel.conf-sample $(1)/etc/stunnel/stunnel.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/stunnel.init $(1)/etc/init.d/stunnel +endef + +$(eval $(call BuildPackage,stunnel)) diff --git a/net/stunnel/files/stunnel.init b/net/stunnel/files/stunnel.init new file mode 100644 index 0000000..a3ea103 --- /dev/null +++ b/net/stunnel/files/stunnel.init @@ -0,0 +1,34 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2008 OpenWrt.org + +START=90 +RUN_D=/var +PID_F=$RUN_D/stunnel.pid + +start() { + if [ -s "/etc/stunnel/stunnel.pem" ]; then + chmod og-rwx /etc/stunnel/stunnel.pem + [ ! -f $PID_F ] && stunnel + else + [ -e /etc/stunnel/config ] && \ + . /etc/stunnel/config + + X509_CN=${X509_CN:-"router"} + X509_O=${X509_O:-"openwrt.org"} + X509_OU=${X509_OU:-"open-source firmware"} + + [ -x /sbin/keygen ] && { + (keygen "$X509_CN" "$X509_O" "$X509_OU" > /etc/stunnel/stunnel.pem; + chmod og-rwx /etc/stunnel/stunnel.pem; + stunnel) & + } + fi +} + +stop() { + [ -f $PID_F ] && { + kill $(cat $PID_F) + kill -9 $(cat $PID_F) + rm -f $PID_F + } +} diff --git a/net/stunnel/patches/001-remove-libtool.patch b/net/stunnel/patches/001-remove-libtool.patch new file mode 100644 index 0000000..5bd9a75 --- /dev/null +++ b/net/stunnel/patches/001-remove-libtool.patch @@ -0,0 +1,6661 @@ +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -19,6658 +19,6 @@ You have another version of autoconf. I + If you have problems, you may need to regenerate the build system entirely. + To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +- +-# serial 52 Debian 1.5.26-4+lenny1 AC_PROG_LIBTOOL +- +- +-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +-# ----------------------------------------------------------- +-# If this macro is not defined by Autoconf, define it here. +-m4_ifdef([AC_PROVIDE_IFELSE], +- [], +- [m4_define([AC_PROVIDE_IFELSE], +- [m4_ifdef([AC_PROVIDE_$1], +- [$2], [$3])])]) +- +- +-# AC_PROG_LIBTOOL +-# --------------- +-AC_DEFUN([AC_PROG_LIBTOOL], +-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. +- AC_PROVIDE_IFELSE([AC_PROG_CXX], +- [AC_LIBTOOL_CXX], +- [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX +- ])]) +-dnl And a similar setup for Fortran 77 support +- AC_PROVIDE_IFELSE([AC_PROG_F77], +- [AC_LIBTOOL_F77], +- [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +-])]) +- +-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. +- AC_PROVIDE_IFELSE([AC_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], +- [AC_LIBTOOL_GCJ], +- [ifdef([AC_PROG_GCJ], +- [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) +- ifdef([A][M_PROG_GCJ], +- [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) +- ifdef([LT_AC_PROG_GCJ], +- [define([LT_AC_PROG_GCJ], +- defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +-])])# AC_PROG_LIBTOOL +- +- +-# _AC_PROG_LIBTOOL +-# ---------------- +-AC_DEFUN([_AC_PROG_LIBTOOL], +-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl +- +-# This can be used to rebuild libtool when needed +-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" +- +-# Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' +-AC_SUBST(LIBTOOL)dnl +- +-# Prevent multiple expansion +-define([AC_PROG_LIBTOOL], []) +-])# _AC_PROG_LIBTOOL +- +- +-# AC_LIBTOOL_SETUP +-# ---------------- +-AC_DEFUN([AC_LIBTOOL_SETUP], +-[AC_PREREQ(2.50)dnl +-AC_REQUIRE([AC_ENABLE_SHARED])dnl +-AC_REQUIRE([AC_ENABLE_STATIC])dnl +-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +-AC_REQUIRE([AC_CANONICAL_HOST])dnl +-AC_REQUIRE([AC_CANONICAL_BUILD])dnl +-AC_REQUIRE([AC_PROG_CC])dnl +-AC_REQUIRE([AC_PROG_LD])dnl +-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +-AC_REQUIRE([AC_PROG_NM])dnl +- +-AC_REQUIRE([AC_PROG_LN_S])dnl +-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +-AC_REQUIRE([AC_OBJEXT])dnl +-AC_REQUIRE([AC_EXEEXT])dnl +-dnl +-AC_LIBTOOL_SYS_MAX_CMD_LEN +-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +-AC_LIBTOOL_OBJDIR +- +-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +-_LT_AC_PROG_ECHO_BACKSLASH +- +-case $host_os in +-aix3*) +- # AIX sometimes has problems with the GCC collect2 program. For some +- # reason, if we set the COLLECT_NAMES environment variable, the problems +- # vanish in a puff of smoke. +- if test "X${COLLECT_NAMES+set}" != Xset; then +- COLLECT_NAMES= +- export COLLECT_NAMES +- fi +- ;; +-esac +- +-# Sed substitution that helps us do robust quoting. It backslashifies +-# metacharacters that are still active within double-quoted strings. +-Xsed='sed -e 1s/^X//' +-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] +- +-# Same as above, but do not quote variable references. +-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] +- +-# Sed substitution to delay expansion of an escaped shell variable in a +-# double_quote_subst'ed string. +-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' +- +-# Sed substitution to avoid accidental globbing in evaled expressions +-no_glob_subst='s/\*/\\\*/g' +- +-# Constants: +-rm="rm -f" +- +-# Global variables: +-default_ofile=libtool +-can_build_shared=yes +- +-# All known linkers require a `.a' archive for static linking (except MSVC, +-# which needs '.lib'). +-libext=a +-ltmain="$ac_aux_dir/ltmain.sh" +-ofile="$default_ofile" +-with_gnu_ld="$lt_cv_prog_gnu_ld" +- +-AC_CHECK_TOOL(AR, ar, false) +-AC_CHECK_TOOL(RANLIB, ranlib, :) +-AC_CHECK_TOOL(STRIP, strip, :) +- +-old_CC="$CC" +-old_CFLAGS="$CFLAGS" +- +-# Set sane defaults for various variables +-test -z "$AR" && AR=ar +-test -z "$AR_FLAGS" && AR_FLAGS=cru +-test -z "$AS" && AS=as +-test -z "$CC" && CC=cc +-test -z "$LTCC" && LTCC=$CC +-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +-test -z "$DLLTOOL" && DLLTOOL=dlltool +-test -z "$LD" && LD=ld +-test -z "$LN_S" && LN_S="ln -s" +-test -z "$MAGIC_CMD" && MAGIC_CMD=file +-test -z "$NM" && NM=nm +-test -z "$SED" && SED=sed +-test -z "$OBJDUMP" && OBJDUMP=objdump +-test -z "$RANLIB" && RANLIB=: +-test -z "$STRIP" && STRIP=: +-test -z "$ac_objext" && ac_objext=o +- +-# Determine commands to create old-style static archives. +-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +-old_postinstall_cmds='chmod 644 $oldlib' +-old_postuninstall_cmds= +- +-if test -n "$RANLIB"; then +- case $host_os in +- openbsd*) +- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" +- ;; +- *) +- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" +- ;; +- esac +- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +-fi +- +-_LT_CC_BASENAME([$compiler]) +- +-# Only perform the check for file, if the check method requires it +-case $deplibs_check_method in +-file_magic*) +- if test "$file_magic_cmd" = '$MAGIC_CMD'; then +- AC_PATH_MAGIC +- fi +- ;; +-esac +- +-_LT_REQUIRED_DARWIN_CHECKS +- +-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +-enable_win32_dll=yes, enable_win32_dll=no) +- +-AC_ARG_ENABLE([libtool-lock], +- [AC_HELP_STRING([--disable-libtool-lock], +- [avoid locking (might break parallel builds)])]) +-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +- +-AC_ARG_WITH([pic], +- [AC_HELP_STRING([--with-pic], +- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], +- [pic_mode="$withval"], +- [pic_mode=default]) +-test -z "$pic_mode" && pic_mode=default +- +-# Use C for the default configuration in the libtool script +-tagname= +-AC_LIBTOOL_LANG_C_CONFIG +-_LT_AC_TAGCONFIG +-])# AC_LIBTOOL_SETUP +- +- +-# _LT_AC_SYS_COMPILER +-# ------------------- +-AC_DEFUN([_LT_AC_SYS_COMPILER], +-[AC_REQUIRE([AC_PROG_CC])dnl +- +-# If no C compiler was specified, use CC. +-LTCC=${LTCC-"$CC"} +- +-# If no C compiler flags were specified, use CFLAGS. +-LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +- +-# Allow CC to be a program name with arguments. +-compiler=$CC +-])# _LT_AC_SYS_COMPILER +- +- +-# _LT_CC_BASENAME(CC) +-# ------------------- +-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +-AC_DEFUN([_LT_CC_BASENAME], +-[for cc_temp in $1""; do +- case $cc_temp in +- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; +- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; +- \-*) ;; +- *) break;; +- esac +-done +-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +-]) +- +- +-# _LT_COMPILER_BOILERPLATE +-# ------------------------ +-# Check for compiler boilerplate output or warnings with +-# the simple compiler test code. +-AC_DEFUN([_LT_COMPILER_BOILERPLATE], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-ac_outfile=conftest.$ac_objext +-echo "$lt_simple_compile_test_code" >conftest.$ac_ext +-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +-_lt_compiler_boilerplate=`cat conftest.err` +-$rm conftest* +-])# _LT_COMPILER_BOILERPLATE +- +- +-# _LT_LINKER_BOILERPLATE +-# ---------------------- +-# Check for linker boilerplate output or warnings with +-# the simple link test code. +-AC_DEFUN([_LT_LINKER_BOILERPLATE], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-ac_outfile=conftest.$ac_objext +-echo "$lt_simple_link_test_code" >conftest.$ac_ext +-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +-_lt_linker_boilerplate=`cat conftest.err` +-$rm -r conftest* +-])# _LT_LINKER_BOILERPLATE +- +-# _LT_REQUIRED_DARWIN_CHECKS +-# -------------------------- +-# Check for some things on darwin +-AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[ +- case $host_os in +- rhapsody* | darwin*) +- AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) +- AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) +- +- AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], +- [lt_cv_apple_cc_single_mod=no +- if test -z "${LT_MULTI_MODULE}"; then +- # By default we will add the -single_module flag. You can override +- # by either setting the environment variable LT_MULTI_MODULE +- # non-empty at configure time, or by adding -multi_module to the +- # link flags. +- echo "int foo(void){return 1;}" > conftest.c +- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +- -dynamiclib ${wl}-single_module conftest.c +- if test -f libconftest.dylib; then +- lt_cv_apple_cc_single_mod=yes +- rm -rf libconftest.dylib* +- fi +- rm conftest.c +- fi]) +- AC_CACHE_CHECK([for -exported_symbols_list linker flag], +- [lt_cv_ld_exported_symbols_list], +- [lt_cv_ld_exported_symbols_list=no +- save_LDFLAGS=$LDFLAGS +- echo "_main" > conftest.sym +- LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" +- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], +- [lt_cv_ld_exported_symbols_list=yes], +- [lt_cv_ld_exported_symbols_list=no]) +- LDFLAGS="$save_LDFLAGS" +- ]) +- case $host_os in +- rhapsody* | darwin1.[[0123]]) +- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; +- darwin1.*) +- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; +- darwin*) +- # if running on 10.5 or later, the deployment target defaults +- # to the OS version, if on x86, and 10.4, the deployment +- # target defaults to 10.4. Don't you love it? +- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in +- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) +- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; +- 10.[[012]]*) +- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; +- 10.*) +- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; +- esac +- ;; +- esac +- if test "$lt_cv_apple_cc_single_mod" = "yes"; then +- _lt_dar_single_mod='$single_module' +- fi +- if test "$lt_cv_ld_exported_symbols_list" = "yes"; then +- _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' +- else +- _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" +- fi +- if test "$DSYMUTIL" != ":"; then +- _lt_dsymutil="~$DSYMUTIL \$lib || :" +- else +- _lt_dsymutil= +- fi +- ;; +- esac +-]) +- +-# _LT_AC_SYS_LIBPATH_AIX +-# ---------------------- +-# Links a minimal program and checks the executable +-# for the system default hardcoded library path. In most cases, +-# this is /usr/lib:/lib, but when the MPI compilers are used +-# the location of the communication and MPI libs are included too. +-# If we don't find anything, use the default library path according +-# to the aix ld manual. +-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi],[]) +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +-])# _LT_AC_SYS_LIBPATH_AIX +- +- +-# _LT_AC_SHELL_INIT(ARG) +-# ---------------------- +-AC_DEFUN([_LT_AC_SHELL_INIT], +-[ifdef([AC_DIVERSION_NOTICE], +- [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], +- [AC_DIVERT_PUSH(NOTICE)]) +-$1 +-AC_DIVERT_POP +-])# _LT_AC_SHELL_INIT +- +- +-# _LT_AC_PROG_ECHO_BACKSLASH +-# -------------------------- +-# Add some code to the start of the generated configure script which +-# will find an echo command which doesn't interpret backslashes. +-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +-[_LT_AC_SHELL_INIT([ +-# Check that we are running under the correct shell. +-SHELL=${CONFIG_SHELL-/bin/sh} +- +-case X$ECHO in +-X*--fallback-echo) +- # Remove one level of quotation (which was required for Make). +- ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` +- ;; +-esac +- +-echo=${ECHO-echo} +-if test "X[$]1" = X--no-reexec; then +- # Discard the --no-reexec flag, and continue. +- shift +-elif test "X[$]1" = X--fallback-echo; then +- # Avoid inline document here, it may be left over +- : +-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then +- # Yippee, $echo works! +- : +-else +- # Restart under the correct shell. +- exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +-fi +- +-if test "X[$]1" = X--fallback-echo; then +- # used as fallback echo +- shift +- cat </dev/null 2>&1 && unset CDPATH +- +-if test -z "$ECHO"; then +-if test "X${echo_test_string+set}" != Xset; then +-# find a string as large as possible, as long as the shell can cope with it +- for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do +- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... +- if (echo_test_string=`eval $cmd`) 2>/dev/null && +- echo_test_string=`eval $cmd` && +- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null +- then +- break +- fi +- done +-fi +- +-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- : +-else +- # The Solaris, AIX, and Digital Unix default echo programs unquote +- # backslashes. This makes it impossible to quote backslashes using +- # echo "$something" | sed 's/\\/\\\\/g' +- # +- # So, first we look for a working echo in the user's PATH. +- +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for dir in $PATH /usr/ucb; do +- IFS="$lt_save_ifs" +- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && +- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- echo="$dir/echo" +- break +- fi +- done +- IFS="$lt_save_ifs" +- +- if test "X$echo" = Xecho; then +- # We didn't find a better echo, so look for alternatives. +- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- # This shell has a builtin print -r that does the trick. +- echo='print -r' +- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && +- test "X$CONFIG_SHELL" != X/bin/ksh; then +- # If we have ksh, try running configure again with it. +- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} +- export ORIGINAL_CONFIG_SHELL +- CONFIG_SHELL=/bin/ksh +- export CONFIG_SHELL +- exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} +- else +- # Try using printf. +- echo='printf %s\n' +- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && +- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- # Cool, printf works +- : +- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && +- test "X$echo_testing_string" = 'X\t' && +- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL +- export CONFIG_SHELL +- SHELL="$CONFIG_SHELL" +- export SHELL +- echo="$CONFIG_SHELL [$]0 --fallback-echo" +- elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && +- test "X$echo_testing_string" = 'X\t' && +- echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && +- test "X$echo_testing_string" = "X$echo_test_string"; then +- echo="$CONFIG_SHELL [$]0 --fallback-echo" +- else +- # maybe with a smaller string... +- prev=: +- +- for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do +- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null +- then +- break +- fi +- prev="$cmd" +- done +- +- if test "$prev" != 'sed 50q "[$]0"'; then +- echo_test_string=`eval $prev` +- export echo_test_string +- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} +- else +- # Oops. We lost completely, so just stick with echo. +- echo=echo +- fi +- fi +- fi +- fi +-fi +-fi +- +-# Copy echo and quote the copy suitably for passing to libtool from +-# the Makefile, instead of quoting the original, which is used later. +-ECHO=$echo +-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then +- ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +-fi +- +-AC_SUBST(ECHO) +-])])# _LT_AC_PROG_ECHO_BACKSLASH +- +- +-# _LT_AC_LOCK +-# ----------- +-AC_DEFUN([_LT_AC_LOCK], +-[AC_ARG_ENABLE([libtool-lock], +- [AC_HELP_STRING([--disable-libtool-lock], +- [avoid locking (might break parallel builds)])]) +-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +- +-# Some flags need to be propagated to the compiler or linker for good +-# libtool support. +-case $host in +-ia64-*-hpux*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.$ac_objext` in +- *ELF-32*) +- HPUX_IA64_MODE="32" +- ;; +- *ELF-64*) +- HPUX_IA64_MODE="64" +- ;; +- esac +- fi +- rm -rf conftest* +- ;; +-*-*-irix6*) +- # Find out which ABI we are using. +- echo '[#]line __oline__ "configure"' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- if test "$lt_cv_prog_gnu_ld" = yes; then +- case `/usr/bin/file conftest.$ac_objext` in +- *32-bit*) +- LD="${LD-ld} -melf32bsmip" +- ;; +- *N32*) +- LD="${LD-ld} -melf32bmipn32" +- ;; +- *64-bit*) +- LD="${LD-ld} -melf64bmip" +- ;; +- esac +- else +- case `/usr/bin/file conftest.$ac_objext` in +- *32-bit*) +- LD="${LD-ld} -32" +- ;; +- *N32*) +- LD="${LD-ld} -n32" +- ;; +- *64-bit*) +- LD="${LD-ld} -64" +- ;; +- esac +- fi +- fi +- rm -rf conftest* +- ;; +- +-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +-s390*-*linux*|sparc*-*linux*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.o` in +- *32-bit*) +- case $host in +- x86_64-*kfreebsd*-gnu) +- LD="${LD-ld} -m elf_i386_fbsd" +- ;; +- x86_64-*linux*) +- LD="${LD-ld} -m elf_i386" +- ;; +- ppc64-*linux*|powerpc64-*linux*) +- LD="${LD-ld} -m elf32ppclinux" +- ;; +- s390x-*linux*) +- LD="${LD-ld} -m elf_s390" +- ;; +- sparc64-*linux*) +- LD="${LD-ld} -m elf32_sparc" +- ;; +- esac +- ;; +- *64-bit*) +- case $host in +- x86_64-*kfreebsd*-gnu) +- LD="${LD-ld} -m elf_x86_64_fbsd" +- ;; +- x86_64-*linux*) +- LD="${LD-ld} -m elf_x86_64" +- ;; +- ppc*-*linux*|powerpc*-*linux*) +- LD="${LD-ld} -m elf64ppc" +- ;; +- s390*-*linux*) +- LD="${LD-ld} -m elf64_s390" +- ;; +- sparc*-*linux*) +- LD="${LD-ld} -m elf64_sparc" +- ;; +- esac +- ;; +- esac +- fi +- rm -rf conftest* +- ;; +- +-*-*-sco3.2v5*) +- # On SCO OpenServer 5, we need -belf to get full-featured binaries. +- SAVE_CFLAGS="$CFLAGS" +- CFLAGS="$CFLAGS -belf" +- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, +- [AC_LANG_PUSH(C) +- AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) +- AC_LANG_POP]) +- if test x"$lt_cv_cc_needs_belf" != x"yes"; then +- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf +- CFLAGS="$SAVE_CFLAGS" +- fi +- ;; +-sparc*-*solaris*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if AC_TRY_EVAL(ac_compile); then +- case `/usr/bin/file conftest.o` in +- *64-bit*) +- case $lt_cv_prog_gnu_ld in +- yes*) LD="${LD-ld} -m elf64_sparc" ;; +- *) +- if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then +- LD="${LD-ld} -64" +- fi +- ;; +- esac +- ;; +- esac +- fi +- rm -rf conftest* +- ;; +- +-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +-[*-*-cygwin* | *-*-mingw* | *-*-pw32*) +- AC_CHECK_TOOL(DLLTOOL, dlltool, false) +- AC_CHECK_TOOL(AS, as, false) +- AC_CHECK_TOOL(OBJDUMP, objdump, false) +- ;; +- ]) +-esac +- +-need_locks="$enable_libtool_lock" +- +-])# _LT_AC_LOCK +- +- +-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +-# ---------------------------------------------------------------- +-# Check whether the given compiler option works +-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +-[AC_REQUIRE([LT_AC_PROG_SED]) +-AC_CACHE_CHECK([$1], [$2], +- [$2=no +- ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) +- echo "$lt_simple_compile_test_code" > conftest.$ac_ext +- lt_compiler_flag="$3" +- # Insert the option either (1) after the last *FLAGS variable, or +- # (2) before a word containing "conftest.", or (3) at the end. +- # Note that $ac_compile itself does not contain backslashes and begins +- # with a dollar sign (not a hyphen), so the echo should work correctly. +- # The option is referenced via a variable to avoid confusing sed. +- lt_compile=`echo "$ac_compile" | $SED \ +- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ +- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ +- -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) +- (eval "$lt_compile" 2>conftest.err) +- ac_status=$? +- cat conftest.err >&AS_MESSAGE_LOG_FD +- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD +- if (exit $ac_status) && test -s "$ac_outfile"; then +- # The compiler can only warn and ignore the option if not recognized +- # So say no if there are warnings other than the usual output. +- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp +- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 +- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then +- $2=yes +- fi +- fi +- $rm conftest* +-]) +- +-if test x"[$]$2" = xyes; then +- ifelse([$5], , :, [$5]) +-else +- ifelse([$6], , :, [$6]) +-fi +-])# AC_LIBTOOL_COMPILER_OPTION +- +- +-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +-# [ACTION-SUCCESS], [ACTION-FAILURE]) +-# ------------------------------------------------------------ +-# Check whether the given compiler option works +-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_CACHE_CHECK([$1], [$2], +- [$2=no +- save_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS $3" +- echo "$lt_simple_link_test_code" > conftest.$ac_ext +- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then +- # The linker can only warn and ignore the option if not recognized +- # So say no if there are warnings +- if test -s conftest.err; then +- # Append any errors to the config.log. +- cat conftest.err 1>&AS_MESSAGE_LOG_FD +- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp +- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 +- if diff conftest.exp conftest.er2 >/dev/null; then +- $2=yes +- fi +- else +- $2=yes +- fi +- fi +- $rm -r conftest* +- LDFLAGS="$save_LDFLAGS" +-]) +- +-if test x"[$]$2" = xyes; then +- ifelse([$4], , :, [$4]) +-else +- ifelse([$5], , :, [$5]) +-fi +-])# AC_LIBTOOL_LINKER_OPTION +- +- +-# AC_LIBTOOL_SYS_MAX_CMD_LEN +-# -------------------------- +-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +-[# find the maximum length of command line arguments +-AC_MSG_CHECKING([the maximum length of command line arguments]) +-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl +- i=0 +- teststring="ABCD" +- +- case $build_os in +- msdosdjgpp*) +- # On DJGPP, this test can blow up pretty badly due to problems in libc +- # (any single argument exceeding 2000 bytes causes a buffer overrun +- # during glob expansion). Even if it were fixed, the result of this +- # check would be larger than it should be. +- lt_cv_sys_max_cmd_len=12288; # 12K is about right +- ;; +- +- gnu*) +- # Under GNU Hurd, this test is not required because there is +- # no limit to the length of command line arguments. +- # Libtool will interpret -1 as no limit whatsoever +- lt_cv_sys_max_cmd_len=-1; +- ;; +- +- cygwin* | mingw*) +- # On Win9x/ME, this test blows up -- it succeeds, but takes +- # about 5 minutes as the teststring grows exponentially. +- # Worse, since 9x/ME are not pre-emptively multitasking, +- # you end up with a "frozen" computer, even though with patience +- # the test eventually succeeds (with a max line length of 256k). +- # Instead, let's just punt: use the minimum linelength reported by +- # all of the supported platforms: 8192 (on NT/2K/XP). +- lt_cv_sys_max_cmd_len=8192; +- ;; +- +- amigaos*) +- # On AmigaOS with pdksh, this test takes hours, literally. +- # So we just punt and use a minimum line length of 8192. +- lt_cv_sys_max_cmd_len=8192; +- ;; +- +- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) +- # This has been around since 386BSD, at least. Likely further. +- if test -x /sbin/sysctl; then +- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` +- elif test -x /usr/sbin/sysctl; then +- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` +- else +- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs +- fi +- # And add a safety zone +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` +- ;; +- +- interix*) +- # We know the value 262144 and hardcode it with a safety zone (like BSD) +- lt_cv_sys_max_cmd_len=196608 +- ;; +- +- osf*) +- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure +- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not +- # nice to cause kernel panics so lets avoid the loop below. +- # First set a reasonable default. +- lt_cv_sys_max_cmd_len=16384 +- # +- if test -x /sbin/sysconfig; then +- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in +- *1*) lt_cv_sys_max_cmd_len=-1 ;; +- esac +- fi +- ;; +- sco3.2v5*) +- lt_cv_sys_max_cmd_len=102400 +- ;; +- sysv5* | sco5v6* | sysv4.2uw2*) +- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` +- if test -n "$kargmax"; then +- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` +- else +- lt_cv_sys_max_cmd_len=32768 +- fi +- ;; +- *) +- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` +- if test -n "$lt_cv_sys_max_cmd_len"; then +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` +- else +- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} +- while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ +- = "XX$teststring") >/dev/null 2>&1 && +- new_result=`expr "X$teststring" : ".*" 2>&1` && +- lt_cv_sys_max_cmd_len=$new_result && +- test $i != 17 # 1/2 MB should be enough +- do +- i=`expr $i + 1` +- teststring=$teststring$teststring +- done +- teststring= +- # Add a significant safety factor because C++ compilers can tack on massive +- # amounts of additional arguments before passing them to the linker. +- # It appears as though 1/2 is a usable value. +- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` +- fi +- ;; +- esac +-]) +-if test -n $lt_cv_sys_max_cmd_len ; then +- AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +-else +- AC_MSG_RESULT(none) +-fi +-])# AC_LIBTOOL_SYS_MAX_CMD_LEN +- +- +-# _LT_AC_CHECK_DLFCN +-# ------------------ +-AC_DEFUN([_LT_AC_CHECK_DLFCN], +-[AC_CHECK_HEADERS(dlfcn.h)dnl +-])# _LT_AC_CHECK_DLFCN +- +- +-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +-# --------------------------------------------------------------------- +-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +-if test "$cross_compiling" = yes; then : +- [$4] +-else +- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 +- lt_status=$lt_dlunknown +- cat > conftest.$ac_ext < +-#endif +- +-#include +- +-#ifdef RTLD_GLOBAL +-# define LT_DLGLOBAL RTLD_GLOBAL +-#else +-# ifdef DL_GLOBAL +-# define LT_DLGLOBAL DL_GLOBAL +-# else +-# define LT_DLGLOBAL 0 +-# endif +-#endif +- +-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we +- find out it does not work in some platform. */ +-#ifndef LT_DLLAZY_OR_NOW +-# ifdef RTLD_LAZY +-# define LT_DLLAZY_OR_NOW RTLD_LAZY +-# else +-# ifdef DL_LAZY +-# define LT_DLLAZY_OR_NOW DL_LAZY +-# else +-# ifdef RTLD_NOW +-# define LT_DLLAZY_OR_NOW RTLD_NOW +-# else +-# ifdef DL_NOW +-# define LT_DLLAZY_OR_NOW DL_NOW +-# else +-# define LT_DLLAZY_OR_NOW 0 +-# endif +-# endif +-# endif +-# endif +-#endif +- +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif +- +-void fnord() { int i=42;} +-int main () +-{ +- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +- int status = $lt_dlunknown; +- +- if (self) +- { +- if (dlsym (self,"fnord")) status = $lt_dlno_uscore; +- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; +- /* dlclose (self); */ +- } +- else +- puts (dlerror ()); +- +- exit (status); +-}] +-EOF +- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then +- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null +- lt_status=$? +- case x$lt_status in +- x$lt_dlno_uscore) $1 ;; +- x$lt_dlneed_uscore) $2 ;; +- x$lt_dlunknown|x*) $3 ;; +- esac +- else : +- # compilation failed +- $3 +- fi +-fi +-rm -fr conftest* +-])# _LT_AC_TRY_DLOPEN_SELF +- +- +-# AC_LIBTOOL_DLOPEN_SELF +-# ---------------------- +-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +-if test "x$enable_dlopen" != xyes; then +- enable_dlopen=unknown +- enable_dlopen_self=unknown +- enable_dlopen_self_static=unknown +-else +- lt_cv_dlopen=no +- lt_cv_dlopen_libs= +- +- case $host_os in +- beos*) +- lt_cv_dlopen="load_add_on" +- lt_cv_dlopen_libs= +- lt_cv_dlopen_self=yes +- ;; +- +- mingw* | pw32*) +- lt_cv_dlopen="LoadLibrary" +- lt_cv_dlopen_libs= +- ;; +- +- cygwin*) +- lt_cv_dlopen="dlopen" +- lt_cv_dlopen_libs= +- ;; +- +- darwin*) +- # if libdl is installed we need to link against it +- AC_CHECK_LIB([dl], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ +- lt_cv_dlopen="dyld" +- lt_cv_dlopen_libs= +- lt_cv_dlopen_self=yes +- ]) +- ;; +- +- *) +- AC_CHECK_FUNC([shl_load], +- [lt_cv_dlopen="shl_load"], +- [AC_CHECK_LIB([dld], [shl_load], +- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], +- [AC_CHECK_FUNC([dlopen], +- [lt_cv_dlopen="dlopen"], +- [AC_CHECK_LIB([dl], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], +- [AC_CHECK_LIB([svld], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], +- [AC_CHECK_LIB([dld], [dld_link], +- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) +- ]) +- ]) +- ]) +- ]) +- ]) +- ;; +- esac +- +- if test "x$lt_cv_dlopen" != xno; then +- enable_dlopen=yes +- else +- enable_dlopen=no +- fi +- +- case $lt_cv_dlopen in +- dlopen) +- save_CPPFLAGS="$CPPFLAGS" +- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" +- +- save_LDFLAGS="$LDFLAGS" +- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" +- +- save_LIBS="$LIBS" +- LIBS="$lt_cv_dlopen_libs $LIBS" +- +- AC_CACHE_CHECK([whether a program can dlopen itself], +- lt_cv_dlopen_self, [dnl +- _LT_AC_TRY_DLOPEN_SELF( +- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, +- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) +- ]) +- +- if test "x$lt_cv_dlopen_self" = xyes; then +- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" +- AC_CACHE_CHECK([whether a statically linked program can dlopen itself], +- lt_cv_dlopen_self_static, [dnl +- _LT_AC_TRY_DLOPEN_SELF( +- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, +- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) +- ]) +- fi +- +- CPPFLAGS="$save_CPPFLAGS" +- LDFLAGS="$save_LDFLAGS" +- LIBS="$save_LIBS" +- ;; +- esac +- +- case $lt_cv_dlopen_self in +- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; +- *) enable_dlopen_self=unknown ;; +- esac +- +- case $lt_cv_dlopen_self_static in +- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; +- *) enable_dlopen_self_static=unknown ;; +- esac +-fi +-])# AC_LIBTOOL_DLOPEN_SELF +- +- +-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +-# --------------------------------- +-# Check to see if options -c and -o are simultaneously supported by compiler +-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], +- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], +- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no +- $rm -r conftest 2>/dev/null +- mkdir conftest +- cd conftest +- mkdir out +- echo "$lt_simple_compile_test_code" > conftest.$ac_ext +- +- lt_compiler_flag="-o out/conftest2.$ac_objext" +- # Insert the option either (1) after the last *FLAGS variable, or +- # (2) before a word containing "conftest.", or (3) at the end. +- # Note that $ac_compile itself does not contain backslashes and begins +- # with a dollar sign (not a hyphen), so the echo should work correctly. +- lt_compile=`echo "$ac_compile" | $SED \ +- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ +- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ +- -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) +- (eval "$lt_compile" 2>out/conftest.err) +- ac_status=$? +- cat out/conftest.err >&AS_MESSAGE_LOG_FD +- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD +- if (exit $ac_status) && test -s out/conftest2.$ac_objext +- then +- # The compiler can only warn and ignore the option if not recognized +- # So say no if there are warnings +- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp +- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 +- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then +- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes +- fi +- fi +- chmod u+w . 2>&AS_MESSAGE_LOG_FD +- $rm conftest* +- # SGI C++ compiler will create directory out/ii_files/ for +- # template instantiation +- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files +- $rm out/* && rmdir out +- cd .. +- rmdir conftest +- $rm conftest* +-]) +-])# AC_LIBTOOL_PROG_CC_C_O +- +- +-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +-# ----------------------------------------- +-# Check to see if we can do hard links to lock some files if needed +-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +-[AC_REQUIRE([_LT_AC_LOCK])dnl +- +-hard_links="nottested" +-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then +- # do not overwrite the value of need_locks provided by the user +- AC_MSG_CHECKING([if we can lock with hard links]) +- hard_links=yes +- $rm conftest* +- ln conftest.a conftest.b 2>/dev/null && hard_links=no +- touch conftest.a +- ln conftest.a conftest.b 2>&5 || hard_links=no +- ln conftest.a conftest.b 2>/dev/null && hard_links=no +- AC_MSG_RESULT([$hard_links]) +- if test "$hard_links" = no; then +- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) +- need_locks=warn +- fi +-else +- need_locks=no +-fi +-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS +- +- +-# AC_LIBTOOL_OBJDIR +-# ----------------- +-AC_DEFUN([AC_LIBTOOL_OBJDIR], +-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +-[rm -f .libs 2>/dev/null +-mkdir .libs 2>/dev/null +-if test -d .libs; then +- lt_cv_objdir=.libs +-else +- # MS-DOS does not allow filenames that begin with a dot. +- lt_cv_objdir=_libs +-fi +-rmdir .libs 2>/dev/null]) +-objdir=$lt_cv_objdir +-])# AC_LIBTOOL_OBJDIR +- +- +-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +-# ---------------------------------------------- +-# Check hardcoding attributes. +-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +-[AC_MSG_CHECKING([how to hardcode library paths into programs]) +-_LT_AC_TAGVAR(hardcode_action, $1)= +-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ +- test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ +- test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then +- +- # We can hardcode non-existant directories. +- if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && +- # If the only mechanism to avoid hardcoding is shlibpath_var, we +- # have to relink, otherwise we might link with an installed library +- # when we should be linking with a yet-to-be-installed one +- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && +- test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then +- # Linking always hardcodes the temporary library directory. +- _LT_AC_TAGVAR(hardcode_action, $1)=relink +- else +- # We can link without hardcoding, and we can hardcode nonexisting dirs. +- _LT_AC_TAGVAR(hardcode_action, $1)=immediate +- fi +-else +- # We cannot hardcode anything, or else we can only hardcode existing +- # directories. +- _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +-fi +-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) +- +-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then +- # Fast installation is not supported +- enable_fast_install=no +-elif test "$shlibpath_overrides_runpath" = yes || +- test "$enable_shared" = no; then +- # Fast installation is not necessary +- enable_fast_install=needless +-fi +-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH +- +- +-# AC_LIBTOOL_SYS_LIB_STRIP +-# ------------------------ +-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +-[striplib= +-old_striplib= +-AC_MSG_CHECKING([whether stripping libraries is possible]) +-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then +- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" +- test -z "$striplib" && striplib="$STRIP --strip-unneeded" +- AC_MSG_RESULT([yes]) +-else +-# FIXME - insert some real tests, host_os isn't really good enough +- case $host_os in +- darwin*) +- if test -n "$STRIP" ; then +- striplib="$STRIP -x" +- old_striplib="$STRIP -S" +- AC_MSG_RESULT([yes]) +- else +- AC_MSG_RESULT([no]) +-fi +- ;; +- *) +- AC_MSG_RESULT([no]) +- ;; +- esac +-fi +-])# AC_LIBTOOL_SYS_LIB_STRIP +- +- +-# AC_LIBTOOL_SYS_DYNAMIC_LINKER +-# ----------------------------- +-# PORTME Fill in your ld.so characteristics +-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_MSG_CHECKING([dynamic linker characteristics]) +-library_names_spec= +-libname_spec='lib$name' +-soname_spec= +-shrext_cmds=".so" +-postinstall_cmds= +-postuninstall_cmds= +-finish_cmds= +-finish_eval= +-shlibpath_var= +-shlibpath_overrides_runpath=unknown +-version_type=none +-dynamic_linker="$host_os ld.so" +-sys_lib_dlsearch_path_spec="/lib /usr/lib" +-m4_if($1,[],[ +-if test "$GCC" = yes; then +- case $host_os in +- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; +- *) lt_awk_arg="/^libraries:/" ;; +- esac +- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` +- if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then +- # if the path contains ";" then we assume it to be the separator +- # otherwise default to the standard path separator (i.e. ":") - it is +- # assumed that no part of a normal pathname contains ";" but that should +- # okay in the real world where ";" in dirpaths is itself problematic. +- lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` +- else +- lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` +- fi +- # Ok, now we have the path, separated by spaces, we can step through it +- # and add multilib dir if necessary. +- lt_tmp_lt_search_path_spec= +- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` +- for lt_sys_path in $lt_search_path_spec; do +- if test -d "$lt_sys_path/$lt_multi_os_dir"; then +- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" +- else +- test -d "$lt_sys_path" && \ +- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" +- fi +- done +- lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' +-BEGIN {RS=" "; FS="/|\n";} { +- lt_foo=""; +- lt_count=0; +- for (lt_i = NF; lt_i > 0; lt_i--) { +- if ($lt_i != "" && $lt_i != ".") { +- if ($lt_i == "..") { +- lt_count++; +- } else { +- if (lt_count == 0) { +- lt_foo="/" $lt_i lt_foo; +- } else { +- lt_count--; +- } +- } +- } +- } +- if (lt_foo != "") { lt_freq[[lt_foo]]++; } +- if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +-}'` +- sys_lib_search_path_spec=`echo $lt_search_path_spec` +-else +- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +-fi]) +-need_lib_prefix=unknown +-hardcode_into_libs=no +- +-# when you set need_version to no, make sure it does not cause -set_version +-# flags to be left without arguments +-need_version=unknown +- +-case $host_os in +-aix3*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' +- shlibpath_var=LIBPATH +- +- # AIX 3 has no versioning support, so we append a major version to the name. +- soname_spec='${libname}${release}${shared_ext}$major' +- ;; +- +-aix[[4-9]]*) +- version_type=linux +- need_lib_prefix=no +- need_version=no +- hardcode_into_libs=yes +- if test "$host_cpu" = ia64; then +- # AIX 5 supports IA64 +- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- else +- # With GCC up to 2.95.x, collect2 would create an import file +- # for dependence libraries. The import file would start with +- # the line `#! .'. This would cause the generated library to +- # depend on `.', always an invalid library. This was fixed in +- # development snapshots of GCC prior to 3.0. +- case $host_os in +- aix4 | aix4.[[01]] | aix4.[[01]].*) +- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' +- echo ' yes ' +- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then +- : +- else +- can_build_shared=no +- fi +- ;; +- esac +- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct +- # soname into executable. Probably we can add versioning support to +- # collect2, so additional links can be useful in future. +- if test "$aix_use_runtimelinking" = yes; then +- # If using run time linking (on AIX 4.2 or later) use lib.so +- # instead of lib.a to let people know that these are not +- # typical AIX shared libraries. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- else +- # We preserve .a as extension for shared libraries through AIX4.2 +- # and later when we are not doing run time linking. +- library_names_spec='${libname}${release}.a $libname.a' +- soname_spec='${libname}${release}${shared_ext}$major' +- fi +- shlibpath_var=LIBPATH +- fi +- ;; +- +-amigaos*) +- library_names_spec='$libname.ixlibrary $libname.a' +- # Create ${libname}_ixlibrary.a entries in /sys/libs. +- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' +- ;; +- +-beos*) +- library_names_spec='${libname}${shared_ext}' +- dynamic_linker="$host_os ld.so" +- shlibpath_var=LIBRARY_PATH +- ;; +- +-bsdi[[45]]*) +- version_type=linux +- 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' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" +- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" +- # the default ld.so.conf also contains /usr/contrib/lib and +- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow +- # libtool to hard-code these into programs +- ;; +- +-cygwin* | mingw* | pw32*) +- version_type=windows +- shrext_cmds=".dll" +- need_version=no +- need_lib_prefix=no +- +- case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32*) +- library_names_spec='$libname.dll.a' +- # DLL is installed to $(libdir)/../bin by postinstall_cmds +- postinstall_cmds='base_file=`basename \${file}`~ +- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ +- dldir=$destdir/`dirname \$dlpath`~ +- test -d \$dldir || mkdir -p \$dldir~ +- $install_prog $dir/$dlname \$dldir/$dlname~ +- chmod a+x \$dldir/$dlname' +- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ +- dlpath=$dir/\$dldll~ +- $rm \$dlpath' +- shlibpath_overrides_runpath=yes +- +- case $host_os in +- cygwin*) +- # Cygwin DLLs use 'cyg' prefix rather than 'lib' +- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +- ;; +- mingw*) +- # MinGW DLLs use traditional 'lib' prefix +- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` +- if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then +- # It is most probably a Windows format PATH printed by +- # mingw gcc, but we are running on Cygwin. Gcc prints its search +- # path with ; separators, and with drive letters. We can handle the +- # drive letters (cygwin fileutils understands them), so leave them, +- # especially as we might pass files found there to a mingw objdump, +- # which wouldn't understand a cygwinified path. Ahh. +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` +- else +- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` +- fi +- ;; +- pw32*) +- # pw32 DLLs use 'pw' prefix rather than 'lib' +- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- ;; +- esac +- ;; +- +- *) +- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' +- ;; +- esac +- dynamic_linker='Win32 ld.exe' +- # FIXME: first we should search . and the directory the executable is in +- shlibpath_var=PATH +- ;; +- +-darwin* | rhapsody*) +- dynamic_linker="$host_os dyld" +- version_type=darwin +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' +- soname_spec='${libname}${release}${major}$shared_ext' +- shlibpath_overrides_runpath=yes +- shlibpath_var=DYLD_LIBRARY_PATH +- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +- m4_if([$1], [],[ +- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) +- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' +- ;; +- +-dgux*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- ;; +- +-freebsd1*) +- dynamic_linker=no +- ;; +- +-freebsd* | dragonfly*) +- # DragonFly does not have aout. When/if they implement a new +- # versioning mechanism, adjust this. +- if test -x /usr/bin/objformat; then +- objformat=`/usr/bin/objformat` +- else +- case $host_os in +- freebsd[[123]]*) objformat=aout ;; +- *) objformat=elf ;; +- esac +- fi +- version_type=freebsd-$objformat +- case $version_type in +- freebsd-elf*) +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' +- need_version=no +- need_lib_prefix=no +- ;; +- freebsd-*) +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' +- need_version=yes +- ;; +- esac +- shlibpath_var=LD_LIBRARY_PATH +- case $host_os in +- freebsd2*) +- shlibpath_overrides_runpath=yes +- ;; +- freebsd3.[[01]]* | freebsdelf3.[[01]]*) +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- ;; +- freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ +- freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- ;; +- *) # from 4.6 on, and DragonFly +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- ;; +- esac +- ;; +- +-gnu*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- hardcode_into_libs=yes +- ;; +- +-hpux9* | hpux10* | hpux11*) +- # Give a soname corresponding to the major version so that dld.sl refuses to +- # link against other versions. +- version_type=sunos +- need_lib_prefix=no +- need_version=no +- case $host_cpu in +- ia64*) +- shrext_cmds='.so' +- hardcode_into_libs=yes +- dynamic_linker="$host_os dld.so" +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- if test "X$HPUX_IA64_MODE" = X32; then +- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" +- else +- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" +- fi +- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec +- ;; +- hppa*64*) +- shrext_cmds='.sl' +- hardcode_into_libs=yes +- dynamic_linker="$host_os dld.sl" +- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH +- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" +- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec +- ;; +- *) +- shrext_cmds='.sl' +- dynamic_linker="$host_os dld.sl" +- shlibpath_var=SHLIB_PATH +- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- ;; +- esac +- # HP-UX runs *really* slowly unless shared libraries are mode 555. +- postinstall_cmds='chmod 555 $lib' +- ;; +- +-interix[[3-9]]*) +- version_type=linux +- need_lib_prefix=no +- 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' +- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- ;; +- +-irix5* | irix6* | nonstopux*) +- case $host_os in +- nonstopux*) version_type=nonstopux ;; +- *) +- if test "$lt_cv_prog_gnu_ld" = yes; then +- version_type=linux +- else +- version_type=irix +- fi ;; +- esac +- need_lib_prefix=no +- need_version=no +- soname_spec='${libname}${release}${shared_ext}$major' +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' +- case $host_os in +- irix5* | nonstopux*) +- libsuff= shlibsuff= +- ;; +- *) +- case $LD in # libtool.m4 will add one of these switches to LD +- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") +- libsuff= shlibsuff= libmagic=32-bit;; +- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") +- libsuff=32 shlibsuff=N32 libmagic=N32;; +- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") +- libsuff=64 shlibsuff=64 libmagic=64-bit;; +- *) libsuff= shlibsuff= libmagic=never-match;; +- esac +- ;; +- esac +- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH +- shlibpath_overrides_runpath=no +- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" +- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" +- hardcode_into_libs=yes +- ;; +- +-# No shared lib support for Linux oldld, aout, or coff. +-linux*oldld* | linux*aout* | linux*coff*) +- dynamic_linker=no +- ;; +- +-# This must be Linux ELF. +-linux* | k*bsd*-gnu) +- version_type=linux +- need_lib_prefix=no +- 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' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- # This implies no fast_install, which is unacceptable. +- # Some rework will be needed to allow for fast_install +- # before this can be enabled. +- hardcode_into_libs=yes +- +- # Append ld.so.conf contents to the search path +- if test -f /etc/ld.so.conf; then +- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" +- fi +- +- # We used to test for /lib/ld.so.1 and disable shared libraries on +- # powerpc, because MkLinux only supported shared libraries with the +- # GNU dynamic linker. Since this was broken with cross compilers, +- # most powerpc-linux boxes support dynamic linking these days and +- # people can always --disable-shared, the test was removed, and we +- # assume the GNU/Linux dynamic linker is in use. +- dynamic_linker='GNU/Linux ld.so' +- ;; +- +-netbsdelf*-gnu) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- dynamic_linker='NetBSD ld.elf_so' +- ;; +- +-netbsd*) +- version_type=sunos +- need_lib_prefix=no +- need_version=no +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' +- dynamic_linker='NetBSD (a.out) ld.so' +- else +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- dynamic_linker='NetBSD ld.elf_so' +- fi +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- ;; +- +-newsos6) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- ;; +- +-nto-qnx*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- ;; +- +-openbsd*) +- version_type=sunos +- sys_lib_dlsearch_path_spec="/usr/lib" +- need_lib_prefix=no +- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. +- case $host_os in +- openbsd3.3 | openbsd3.3.*) need_version=yes ;; +- *) need_version=no ;; +- esac +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- case $host_os in +- openbsd2.[[89]] | openbsd2.[[89]].*) +- shlibpath_overrides_runpath=no +- ;; +- *) +- shlibpath_overrides_runpath=yes +- ;; +- esac +- else +- shlibpath_overrides_runpath=yes +- fi +- ;; +- +-os2*) +- libname_spec='$name' +- shrext_cmds=".dll" +- need_lib_prefix=no +- library_names_spec='$libname${shared_ext} $libname.a' +- dynamic_linker='OS/2 ld.exe' +- shlibpath_var=LIBPATH +- ;; +- +-osf3* | osf4* | osf5*) +- version_type=osf +- need_lib_prefix=no +- need_version=no +- soname_spec='${libname}${release}${shared_ext}$major' +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" +- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" +- ;; +- +-rdos*) +- dynamic_linker=no +- ;; +- +-solaris*) +- version_type=linux +- need_lib_prefix=no +- 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' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes +- # ldd complains unless libraries are executable +- postinstall_cmds='chmod +x $lib' +- ;; +- +-sunos4*) +- version_type=sunos +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' +- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +- if test "$with_gnu_ld" = yes; then +- need_lib_prefix=no +- fi +- need_version=yes +- ;; +- +-sysv4 | sysv4.3*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- case $host_vendor in +- sni) +- shlibpath_overrides_runpath=no +- need_lib_prefix=no +- export_dynamic_flag_spec='${wl}-Blargedynsym' +- runpath_var=LD_RUN_PATH +- ;; +- siemens) +- need_lib_prefix=no +- ;; +- motorola) +- need_lib_prefix=no +- need_version=no +- shlibpath_overrides_runpath=no +- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' +- ;; +- esac +- ;; +- +-sysv4*MP*) +- if test -d /usr/nec ;then +- version_type=linux +- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' +- soname_spec='$libname${shared_ext}.$major' +- shlibpath_var=LD_LIBRARY_PATH +- fi +- ;; +- +-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) +- version_type=freebsd-elf +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- hardcode_into_libs=yes +- if test "$with_gnu_ld" = yes; then +- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' +- shlibpath_overrides_runpath=no +- else +- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' +- shlibpath_overrides_runpath=yes +- case $host_os in +- sco3.2v5*) +- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" +- ;; +- esac +- fi +- sys_lib_dlsearch_path_spec='/usr/lib' +- ;; +- +-uts4*) +- version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- ;; +- +-*) +- dynamic_linker=no +- ;; +-esac +-AC_MSG_RESULT([$dynamic_linker]) +-test "$dynamic_linker" = no && can_build_shared=no +- +-AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec], +-[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"]) +-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +-AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec], +-[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"]) +-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +- +-variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +-if test "$GCC" = yes; then +- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +-fi +-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER +- +- +-# _LT_AC_TAGCONFIG +-# ---------------- +-AC_DEFUN([_LT_AC_TAGCONFIG], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_ARG_WITH([tags], +- [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], +- [include additional configurations @<:@automatic@:>@])], +- [tagnames="$withval"]) +- +-if test -f "$ltmain" && test -n "$tagnames"; then +- if test ! -f "${ofile}"; then +- AC_MSG_WARN([output file `$ofile' does not exist]) +- fi +- +- if test -z "$LTCC"; then +- eval "`$SHELL ${ofile} --config | grep '^LTCC='`" +- if test -z "$LTCC"; then +- AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) +- else +- AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) +- fi +- fi +- if test -z "$LTCFLAGS"; then +- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" +- fi +- +- # Extract list of available tagged configurations in $ofile. +- # Note that this assumes the entire list is on one line. +- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` +- +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for tagname in $tagnames; do +- IFS="$lt_save_ifs" +- # Check whether tagname contains only valid characters +- case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in +- "") ;; +- *) AC_MSG_ERROR([invalid tag name: $tagname]) +- ;; +- esac +- +- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null +- then +- AC_MSG_ERROR([tag name \"$tagname\" already exists]) +- fi +- +- # Update the list of available tags. +- if test -n "$tagname"; then +- echo appending configuration tag \"$tagname\" to $ofile +- +- case $tagname in +- CXX) +- if test -n "$CXX" && ( test "X$CXX" != "Xno" && +- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || +- (test "X$CXX" != "Xg++"))) ; then +- AC_LIBTOOL_LANG_CXX_CONFIG +- else +- tagname="" +- fi +- ;; +- +- F77) +- if test -n "$F77" && test "X$F77" != "Xno"; then +- AC_LIBTOOL_LANG_F77_CONFIG +- else +- tagname="" +- fi +- ;; +- +- GCJ) +- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then +- AC_LIBTOOL_LANG_GCJ_CONFIG +- else +- tagname="" +- fi +- ;; +- +- RC) +- AC_LIBTOOL_LANG_RC_CONFIG +- ;; +- +- *) +- AC_MSG_ERROR([Unsupported tag name: $tagname]) +- ;; +- esac +- +- # Append the new tag name to the list of available tags. +- if test -n "$tagname" ; then +- available_tags="$available_tags $tagname" +- fi +- fi +- done +- IFS="$lt_save_ifs" +- +- # Now substitute the updated list of available tags. +- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then +- mv "${ofile}T" "$ofile" +- chmod +x "$ofile" +- else +- rm -f "${ofile}T" +- AC_MSG_ERROR([unable to update list of available tagged configurations.]) +- fi +-fi +-])# _LT_AC_TAGCONFIG +- +- +-# AC_LIBTOOL_DLOPEN +-# ----------------- +-# enable checks for dlopen support +-AC_DEFUN([AC_LIBTOOL_DLOPEN], +- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +-])# AC_LIBTOOL_DLOPEN +- +- +-# AC_LIBTOOL_WIN32_DLL +-# -------------------- +-# declare package support for building win32 DLLs +-AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +-])# AC_LIBTOOL_WIN32_DLL +- +- +-# AC_ENABLE_SHARED([DEFAULT]) +-# --------------------------- +-# implement the --enable-shared flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_SHARED], +-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([shared], +- [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], +- [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_shared=yes ;; +- no) enable_shared=no ;; +- *) +- enable_shared=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_shared=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +-])# AC_ENABLE_SHARED +- +- +-# AC_DISABLE_SHARED +-# ----------------- +-# set the default shared flag to --disable-shared +-AC_DEFUN([AC_DISABLE_SHARED], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_SHARED(no) +-])# AC_DISABLE_SHARED +- +- +-# AC_ENABLE_STATIC([DEFAULT]) +-# --------------------------- +-# implement the --enable-static flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_STATIC], +-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([static], +- [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], +- [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_static=yes ;; +- no) enable_static=no ;; +- *) +- enable_static=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_static=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_static=]AC_ENABLE_STATIC_DEFAULT) +-])# AC_ENABLE_STATIC +- +- +-# AC_DISABLE_STATIC +-# ----------------- +-# set the default static flag to --disable-static +-AC_DEFUN([AC_DISABLE_STATIC], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_STATIC(no) +-])# AC_DISABLE_STATIC +- +- +-# AC_ENABLE_FAST_INSTALL([DEFAULT]) +-# --------------------------------- +-# implement the --enable-fast-install flag +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +-AC_DEFUN([AC_ENABLE_FAST_INSTALL], +-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +-AC_ARG_ENABLE([fast-install], +- [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], +- [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], +- [p=${PACKAGE-default} +- case $enableval in +- yes) enable_fast_install=yes ;; +- no) enable_fast_install=no ;; +- *) +- enable_fast_install=no +- # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +- for pkg in $enableval; do +- IFS="$lt_save_ifs" +- if test "X$pkg" = "X$p"; then +- enable_fast_install=yes +- fi +- done +- IFS="$lt_save_ifs" +- ;; +- esac], +- [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +-])# AC_ENABLE_FAST_INSTALL +- +- +-# AC_DISABLE_FAST_INSTALL +-# ----------------------- +-# set the default to --disable-fast-install +-AC_DEFUN([AC_DISABLE_FAST_INSTALL], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-AC_ENABLE_FAST_INSTALL(no) +-])# AC_DISABLE_FAST_INSTALL +- +- +-# AC_LIBTOOL_PICMODE([MODE]) +-# -------------------------- +-# implement the --with-pic flag +-# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +-AC_DEFUN([AC_LIBTOOL_PICMODE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +-pic_mode=ifelse($#,1,$1,default) +-])# AC_LIBTOOL_PICMODE +- +- +-# AC_PROG_EGREP +-# ------------- +-# This is predefined starting with Autoconf 2.54, so this conditional +-# definition can be removed once we require Autoconf 2.54 or later. +-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], +- [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 +- then ac_cv_prog_egrep='grep -E' +- else ac_cv_prog_egrep='egrep' +- fi]) +- EGREP=$ac_cv_prog_egrep +- AC_SUBST([EGREP]) +-])]) +- +- +-# AC_PATH_TOOL_PREFIX +-# ------------------- +-# find a file program which can recognize shared library +-AC_DEFUN([AC_PATH_TOOL_PREFIX], +-[AC_REQUIRE([AC_PROG_EGREP])dnl +-AC_MSG_CHECKING([for $1]) +-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +-[case $MAGIC_CMD in +-[[\\/*] | ?:[\\/]*]) +- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. +- ;; +-*) +- lt_save_MAGIC_CMD="$MAGIC_CMD" +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +-dnl $ac_dummy forces splitting on constant user-supplied paths. +-dnl POSIX.2 word splitting is done only on the output of word expansions, +-dnl not every word. This closes a longstanding sh security hole. +- ac_dummy="ifelse([$2], , $PATH, [$2])" +- for ac_dir in $ac_dummy; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$1; then +- lt_cv_path_MAGIC_CMD="$ac_dir/$1" +- if test -n "$file_magic_test_file"; then +- case $deplibs_check_method in +- "file_magic "*) +- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` +- MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | +- $EGREP "$file_magic_regex" > /dev/null; then +- : +- else +- cat <&2 +- +-*** Warning: the command libtool uses to detect shared libraries, +-*** $file_magic_cmd, produces output that libtool cannot recognize. +-*** The result is that libtool may fail to recognize shared libraries +-*** as such. This will affect the creation of libtool libraries that +-*** depend on shared libraries, but programs linked with such libtool +-*** libraries will work regardless of this problem. Nevertheless, you +-*** may want to report the problem to your system manager and/or to +-*** bug-libtool@gnu.org +- +-EOF +- fi ;; +- esac +- fi +- break +- fi +- done +- IFS="$lt_save_ifs" +- MAGIC_CMD="$lt_save_MAGIC_CMD" +- ;; +-esac]) +-MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +-if test -n "$MAGIC_CMD"; then +- AC_MSG_RESULT($MAGIC_CMD) +-else +- AC_MSG_RESULT(no) +-fi +-])# AC_PATH_TOOL_PREFIX +- +- +-# AC_PATH_MAGIC +-# ------------- +-# find a file program which can recognize a shared library +-AC_DEFUN([AC_PATH_MAGIC], +-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +-if test -z "$lt_cv_path_MAGIC_CMD"; then +- if test -n "$ac_tool_prefix"; then +- AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) +- else +- MAGIC_CMD=: +- fi +-fi +-])# AC_PATH_MAGIC +- +- +-# AC_PROG_LD +-# ---------- +-# find the pathname to the GNU or non-GNU linker +-AC_DEFUN([AC_PROG_LD], +-[AC_ARG_WITH([gnu-ld], +- [AC_HELP_STRING([--with-gnu-ld], +- [assume the C compiler uses GNU ld @<:@default=no@:>@])], +- [test "$withval" = no || with_gnu_ld=yes], +- [with_gnu_ld=no]) +-AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_REQUIRE([AC_PROG_CC])dnl +-AC_REQUIRE([AC_CANONICAL_HOST])dnl +-AC_REQUIRE([AC_CANONICAL_BUILD])dnl +-ac_prog=ld +-if test "$GCC" = yes; then +- # Check if gcc -print-prog-name=ld gives a path. +- AC_MSG_CHECKING([for ld used by $CC]) +- case $host in +- *-*-mingw*) +- # gcc leaves a trailing carriage return which upsets mingw +- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; +- *) +- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; +- esac +- case $ac_prog in +- # Accept absolute paths. +- [[\\/]]* | ?:[[\\/]]*) +- re_direlt='/[[^/]][[^/]]*/\.\./' +- # Canonicalize the pathname of ld +- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` +- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do +- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` +- done +- test -z "$LD" && LD="$ac_prog" +- ;; +- "") +- # If it fails, then pretend we aren't using GCC. +- ac_prog=ld +- ;; +- *) +- # If it is relative, then search for the first ld in PATH. +- with_gnu_ld=unknown +- ;; +- esac +-elif test "$with_gnu_ld" = yes; then +- AC_MSG_CHECKING([for GNU ld]) +-else +- AC_MSG_CHECKING([for non-GNU ld]) +-fi +-AC_CACHE_VAL(lt_cv_path_LD, +-[if test -z "$LD"; then +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for ac_dir in $PATH; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then +- lt_cv_path_LD="$ac_dir/$ac_prog" +- # Check to see if the program is GNU ld. I'd rather use --version, +- # but apparently some variants of GNU ld only accept -v. +- # Break only if it was the GNU/non-GNU ld that we prefer. +- case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then +- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' +- lt_cv_file_magic_cmd='func_win32_libid' +- else +- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' +- lt_cv_file_magic_cmd='$OBJDUMP -f' +- fi +- ;; +- +-darwin* | rhapsody*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-freebsd* | dragonfly*) +- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then +- case $host_cpu in +- i*86 ) +- # Not sure whether the presence of OpenBSD here was a mistake. +- # Let's accept both of them until this is cleared up. +- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' +- lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` +- ;; +- esac +- else +- lt_cv_deplibs_check_method=pass_all +- fi +- ;; +- +-gnu*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-hpux10.20* | hpux11*) +- lt_cv_file_magic_cmd=/usr/bin/file +- case $host_cpu in +- ia64*) +- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' +- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so +- ;; +- hppa*64*) +- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] +- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl +- ;; +- *) +- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' +- lt_cv_file_magic_test_file=/usr/lib/libc.sl +- ;; +- esac +- ;; +- +-interix[[3-9]]*) +- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' +- ;; +- +-irix5* | irix6* | nonstopux*) +- case $LD in +- *-32|*"-32 ") libmagic=32-bit;; +- *-n32|*"-n32 ") libmagic=N32;; +- *-64|*"-64 ") libmagic=64-bit;; +- *) libmagic=never-match;; +- esac +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-# This must be Linux ELF. +-linux* | k*bsd*-gnu) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-netbsd* | netbsdelf*-gnu) +- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' +- else +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' +- fi +- ;; +- +-newos6*) +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' +- lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=/usr/lib/libnls.so +- ;; +- +-nto-qnx*) +- lt_cv_deplibs_check_method=unknown +- ;; +- +-openbsd*) +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' +- else +- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' +- fi +- ;; +- +-osf3* | osf4* | osf5*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-rdos*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-solaris*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +-sysv4 | sysv4.3*) +- case $host_vendor in +- motorola) +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' +- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` +- ;; +- ncr) +- lt_cv_deplibs_check_method=pass_all +- ;; +- sequent) +- lt_cv_file_magic_cmd='/bin/file' +- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' +- ;; +- sni) +- lt_cv_file_magic_cmd='/bin/file' +- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" +- lt_cv_file_magic_test_file=/lib/libc.so +- ;; +- siemens) +- lt_cv_deplibs_check_method=pass_all +- ;; +- pc) +- lt_cv_deplibs_check_method=pass_all +- ;; +- esac +- ;; +- +-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) +- lt_cv_deplibs_check_method=pass_all +- ;; +-esac +-]) +-file_magic_cmd=$lt_cv_file_magic_cmd +-deplibs_check_method=$lt_cv_deplibs_check_method +-test -z "$deplibs_check_method" && deplibs_check_method=unknown +-])# AC_DEPLIBS_CHECK_METHOD +- +- +-# AC_PROG_NM +-# ---------- +-# find the pathname to a BSD-compatible name lister +-AC_DEFUN([AC_PROG_NM], +-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +-[if test -n "$NM"; then +- # Let the user override the test. +- lt_cv_path_NM="$NM" +-else +- lt_nm_to_check="${ac_tool_prefix}nm" +- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then +- lt_nm_to_check="$lt_nm_to_check nm" +- fi +- for lt_tmp_nm in $lt_nm_to_check; do +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do +- IFS="$lt_save_ifs" +- test -z "$ac_dir" && ac_dir=. +- tmp_nm="$ac_dir/$lt_tmp_nm" +- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then +- # Check to see if the nm accepts a BSD-compat flag. +- # Adding the `sed 1q' prevents false positives on HP-UX, which says: +- # nm: unknown option "B" ignored +- # Tru64's nm complains that /dev/null is an invalid object file +- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in +- */dev/null* | *'Invalid file or object type'*) +- lt_cv_path_NM="$tmp_nm -B" +- break +- ;; +- *) +- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in +- */dev/null*) +- lt_cv_path_NM="$tmp_nm -p" +- break +- ;; +- *) +- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but +- continue # so that we can try to find one that supports BSD flags +- ;; +- esac +- ;; +- esac +- fi +- done +- IFS="$lt_save_ifs" +- done +- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +-fi]) +-NM="$lt_cv_path_NM" +-])# AC_PROG_NM +- +- +-# AC_CHECK_LIBM +-# ------------- +-# check for math library +-AC_DEFUN([AC_CHECK_LIBM], +-[AC_REQUIRE([AC_CANONICAL_HOST])dnl +-LIBM= +-case $host in +-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) +- # These system don't have libm, or don't need it +- ;; +-*-ncr-sysv4.3*) +- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") +- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") +- ;; +-*) +- AC_CHECK_LIB(m, cos, LIBM="-lm") +- ;; +-esac +-])# AC_CHECK_LIBM +- +- +-# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +-# ----------------------------------- +-# sets LIBLTDL to the link flags for the libltdl convenience library and +-# LTDLINCL to the include flags for the libltdl header and adds +-# --enable-ltdl-convenience to the configure arguments. Note that +-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +-# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +-# (note the single quotes!). If your package is not flat and you're not +-# using automake, define top_builddir and top_srcdir appropriately in +-# the Makefiles. +-AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +- case $enable_ltdl_convenience in +- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; +- "") enable_ltdl_convenience=yes +- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; +- esac +- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la +- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +- # For backwards non-gettext consistent compatibility... +- INCLTDL="$LTDLINCL" +-])# AC_LIBLTDL_CONVENIENCE +- +- +-# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +-# ----------------------------------- +-# sets LIBLTDL to the link flags for the libltdl installable library and +-# LTDLINCL to the include flags for the libltdl header and adds +-# --enable-ltdl-install to the configure arguments. Note that +-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +-# and an installed libltdl is not found, it is assumed to be `libltdl'. +-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +-# '${top_srcdir}/' (note the single quotes!). If your package is not +-# flat and you're not using automake, define top_builddir and top_srcdir +-# appropriately in the Makefiles. +-# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +-AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +- AC_CHECK_LIB(ltdl, lt_dlinit, +- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], +- [if test x"$enable_ltdl_install" = xno; then +- AC_MSG_WARN([libltdl not installed, but installation disabled]) +- else +- enable_ltdl_install=yes +- fi +- ]) +- if test x"$enable_ltdl_install" = x"yes"; then +- ac_configure_args="$ac_configure_args --enable-ltdl-install" +- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la +- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +- else +- ac_configure_args="$ac_configure_args --enable-ltdl-install=no" +- LIBLTDL="-lltdl" +- LTDLINCL= +- fi +- # For backwards non-gettext consistent compatibility... +- INCLTDL="$LTDLINCL" +-])# AC_LIBLTDL_INSTALLABLE +- +- +-# AC_LIBTOOL_CXX +-# -------------- +-# enable support for C++ libraries +-AC_DEFUN([AC_LIBTOOL_CXX], +-[AC_REQUIRE([_LT_AC_LANG_CXX]) +-])# AC_LIBTOOL_CXX +- +- +-# _LT_AC_LANG_CXX +-# --------------- +-AC_DEFUN([_LT_AC_LANG_CXX], +-[AC_REQUIRE([AC_PROG_CXX]) +-AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +-])# _LT_AC_LANG_CXX +- +-# _LT_AC_PROG_CXXCPP +-# ------------------ +-AC_DEFUN([_LT_AC_PROG_CXXCPP], +-[ +-AC_REQUIRE([AC_PROG_CXX]) +-if test -n "$CXX" && ( test "X$CXX" != "Xno" && +- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || +- (test "X$CXX" != "Xg++"))) ; then +- AC_PROG_CXXCPP +-fi +-])# _LT_AC_PROG_CXXCPP +- +-# AC_LIBTOOL_F77 +-# -------------- +-# enable support for Fortran 77 libraries +-AC_DEFUN([AC_LIBTOOL_F77], +-[AC_REQUIRE([_LT_AC_LANG_F77]) +-])# AC_LIBTOOL_F77 +- +- +-# _LT_AC_LANG_F77 +-# --------------- +-AC_DEFUN([_LT_AC_LANG_F77], +-[AC_REQUIRE([AC_PROG_F77]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +-])# _LT_AC_LANG_F77 +- +- +-# AC_LIBTOOL_GCJ +-# -------------- +-# enable support for GCJ libraries +-AC_DEFUN([AC_LIBTOOL_GCJ], +-[AC_REQUIRE([_LT_AC_LANG_GCJ]) +-])# AC_LIBTOOL_GCJ +- +- +-# _LT_AC_LANG_GCJ +-# --------------- +-AC_DEFUN([_LT_AC_LANG_GCJ], +-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], +- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], +- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], +- [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], +- [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], +- [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +-])# _LT_AC_LANG_GCJ +- +- +-# AC_LIBTOOL_RC +-# ------------- +-# enable support for Windows resource files +-AC_DEFUN([AC_LIBTOOL_RC], +-[AC_REQUIRE([LT_AC_PROG_RC]) +-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +-])# AC_LIBTOOL_RC +- +- +-# AC_LIBTOOL_LANG_C_CONFIG +-# ------------------------ +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +-AC_DEFUN([_LT_AC_LANG_C_CONFIG], +-[lt_save_CC="$CC" +-AC_LANG_PUSH(C) +- +-# Source file extension for C test sources. +-ac_ext=c +- +-# Object file extension for compiled C test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="int some_variable = 0;" +- +-# Code to be used in simple link tests +-lt_simple_link_test_code='int main(){return(0);}' +- +-_LT_AC_SYS_COMPILER +- +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE +- +-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +-AC_LIBTOOL_SYS_LIB_STRIP +-AC_LIBTOOL_DLOPEN_SELF +- +-# Report which library types will actually be built +-AC_MSG_CHECKING([if libtool supports shared libraries]) +-AC_MSG_RESULT([$can_build_shared]) +- +-AC_MSG_CHECKING([whether to build shared libraries]) +-test "$can_build_shared" = "no" && enable_shared=no +- +-# On AIX, shared libraries and static libraries use the same namespace, and +-# are all built from PIC. +-case $host_os in +-aix3*) +- test "$enable_shared" = yes && enable_static=no +- if test -n "$RANLIB"; then +- archive_cmds="$archive_cmds~\$RANLIB \$lib" +- postinstall_cmds='$RANLIB $lib' +- fi +- ;; +- +-aix[[4-9]]*) +- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then +- test "$enable_shared" = yes && enable_static=no +- fi +- ;; +-esac +-AC_MSG_RESULT([$enable_shared]) +- +-AC_MSG_CHECKING([whether to build static libraries]) +-# Make sure either enable_shared or enable_static is yes. +-test "$enable_shared" = yes || enable_static=yes +-AC_MSG_RESULT([$enable_static]) +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_POP +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_C_CONFIG +- +- +-# AC_LIBTOOL_LANG_CXX_CONFIG +-# -------------------------- +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +-[AC_LANG_PUSH(C++) +-AC_REQUIRE([AC_PROG_CXX]) +-AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +- +-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +-_LT_AC_TAGVAR(allow_undefined_flag, $1)= +-_LT_AC_TAGVAR(always_export_symbols, $1)=no +-_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_direct, $1)=no +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +-_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +-_LT_AC_TAGVAR(hardcode_automatic, $1)=no +-_LT_AC_TAGVAR(module_cmds, $1)= +-_LT_AC_TAGVAR(module_expsym_cmds, $1)= +-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +-_LT_AC_TAGVAR(no_undefined_flag, $1)= +-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +- +-# Dependencies to place before and after the object being linked: +-_LT_AC_TAGVAR(predep_objects, $1)= +-_LT_AC_TAGVAR(postdep_objects, $1)= +-_LT_AC_TAGVAR(predeps, $1)= +-_LT_AC_TAGVAR(postdeps, $1)= +-_LT_AC_TAGVAR(compiler_lib_search_path, $1)= +-_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)= +- +-# Source file extension for C++ test sources. +-ac_ext=cpp +- +-# Object file extension for compiled C++ test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="int some_variable = 0;" +- +-# Code to be used in simple link tests +-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' +- +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER +- +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE +- +-# Allow CC to be a program name with arguments. +-lt_save_CC=$CC +-lt_save_LD=$LD +-lt_save_GCC=$GCC +-GCC=$GXX +-lt_save_with_gnu_ld=$with_gnu_ld +-lt_save_path_LD=$lt_cv_path_LD +-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then +- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +-else +- $as_unset lt_cv_prog_gnu_ld +-fi +-if test -n "${lt_cv_path_LDCXX+set}"; then +- lt_cv_path_LD=$lt_cv_path_LDCXX +-else +- $as_unset lt_cv_path_LD +-fi +-test -z "${LDCXX+set}" || LD=$LDCXX +-CC=${CXX-"c++"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +- +-# We don't want -fno-exception wen compiling C++ code, so set the +-# no_builtin_flag separately +-if test "$GXX" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +-else +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +-fi +- +-if test "$GXX" = yes; then +- # Set up default GNU C++ configuration +- +- AC_PROG_LD +- +- # Check if GNU C++ uses GNU ld as the underlying linker, since the +- # archiving commands below assume that GNU ld is being used. +- if test "$with_gnu_ld" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- +- # If archive_cmds runs LD, not CC, wlarc should be empty +- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to +- # investigate it a little bit more. (MM) +- wlarc='${wl}' +- +- # ancient GNU ld didn't support --whole-archive et. al. +- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ +- grep 'no-whole-archive' > /dev/null; then +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' +- else +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- else +- with_gnu_ld=no +- wlarc= +- +- # A generic and very simple default shared library creation +- # command for GNU C++ for the case where it uses the native +- # linker, instead of GNU ld. If possible, this setting should +- # overridden to take advantage of the native linker features on +- # the platform it is being used on. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' +- fi +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +- +-else +- GXX=no +- with_gnu_ld=no +- wlarc= +-fi +- +-# PORTME: fill in a description of your system's C++ link characteristics +-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +-_LT_AC_TAGVAR(ld_shlibs, $1)=yes +-case $host_os in +- aix3*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aix[[4-9]]*) +- if test "$host_cpu" = ia64; then +- # On IA64, the linker does run time linking by default, so we don't +- # have to do anything special. +- aix_use_runtimelinking=no +- exp_sym_flag='-Bexport' +- no_entry_flag="" +- else +- aix_use_runtimelinking=no +- +- # Test if we are trying to use run time linking or normal +- # AIX style linking. If -brtl is somewhere in LDFLAGS, we +- # need to do runtime linking. +- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) +- for ld_flag in $LDFLAGS; do +- case $ld_flag in +- *-brtl*) +- aix_use_runtimelinking=yes +- break +- ;; +- esac +- done +- ;; +- esac +- +- exp_sym_flag='-bexport' +- no_entry_flag='-bnoentry' +- fi +- +- # When large executables or shared objects are built, AIX ld can +- # have problems creating the table of contents. If linking a library +- # or program results in "error TOC overflow" add -mminimal-toc to +- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not +- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. +- +- _LT_AC_TAGVAR(archive_cmds, $1)='' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- +- if test "$GXX" = yes; then +- case $host_os in aix4.[[012]]|aix4.[[012]].*) +- # We only want to do this on AIX 4.2 and lower, the check +- # below for broken collect2 doesn't work under 4.3+ +- collect2name=`${CC} -print-prog-name=collect2` +- if test -f "$collect2name" && \ +- strings "$collect2name" | grep resolve_lib_name >/dev/null +- then +- # We have reworked collect2 +- : +- else +- # We have old collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- # It fails to find uninstalled libraries when the uninstalled +- # path is not listed in the libpath. Setting hardcode_minus_L +- # to unsupported forces relinking +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- fi +- ;; +- esac +- shared_flag='-shared' +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag="$shared_flag "'${wl}-G' +- fi +- else +- # not using gcc +- if test "$host_cpu" = ia64; then +- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release +- # chokes on -Wl,-G. The following line is correct: +- shared_flag='-G' +- else +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag='${wl}-G' +- else +- shared_flag='${wl}-bM:SRE' +- fi +- fi +- fi +- +- # It seems that -bexpall does not export symbols beginning with +- # underscore (_), so it is better to generate a list of symbols to export. +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- if test "$aix_use_runtimelinking" = yes; then +- # Warning - without using the other runtime loading flags (-brtl), +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +- else +- if test "$host_cpu" = ia64; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" +- else +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- # Warning - without using the other run time loading flags, +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' +- # Exported symbols can be pulled into shared objects from archives +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- # This is similar to how AIX traditionally builds its shared libraries. +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' +- fi +- fi +- ;; +- +- beos*) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Joseph Beckenbach says some releases of gcc +- # support --undefined. This deserves some investigation. FIXME +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- chorus*) +- case $cc_basename in +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- +- cygwin* | mingw* | pw32*) +- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, +- # as there is no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- +- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- darwin* | rhapsody*) +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" +- if test "$GXX" = yes ; then +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" +- _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" +- _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" +- if test "$lt_cv_apple_cc_single_mod" != "yes"; then +- _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" +- fi +- else +- case $cc_basename in +- xlc*) +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- ;; +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +- ;; +- +- dgux*) +- case $cc_basename in +- ec++*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- ghcx*) +- # Green Hills C++ Compiler +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- freebsd[[12]]*) +- # C++ shared libraries reported to be fairly broken before switch to ELF +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- freebsd-elf*) +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- ;; +- freebsd* | dragonfly*) +- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF +- # conventions +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- ;; +- gnu*) +- ;; +- hpux9*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, +- # but as the default +- # location of the library. +- +- case $cc_basename in +- CC*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aCC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- hpux10*|hpux11*) +- if test $with_gnu_ld = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- case $host_cpu in +- hppa*64*|ia64*) ;; +- *) +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- ;; +- esac +- fi +- case $host_cpu in +- hppa*64*|ia64*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- *) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, +- # but as the default +- # location of the library. +- ;; +- esac +- +- case $cc_basename in +- CC*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- aCC*) +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- esac +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes; then +- if test $with_gnu_ld = no; then +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- ;; +- esac +- fi +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- interix[[3-9]]*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. +- # Instead, shared libraries are loaded at an image base (0x10000000 by +- # default) and relocated if they conflict, which is a slow very memory +- # consuming and fragmenting process. To avoid this, we pick a random, +- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link +- # time. Moving up from 0x10000000 also allows more sbrk(2) space. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- ;; +- irix5* | irix6*) +- case $cc_basename in +- CC*) +- # SGI C++ +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- +- # Archives containing C++ object files must be created using +- # "CC -ar", where "CC" is the IRIX C++ compiler. This is +- # necessary to make sure instantiated templates are included +- # in the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' +- ;; +- *) +- if test "$GXX" = yes; then +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' +- fi +- fi +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; +- esac +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- ;; +- linux* | k*bsd*-gnu) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- +- # Archives containing C++ object files must be created using +- # "CC -Bstatic", where "CC" is the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' +- ;; +- icpc*) +- # Intel C++ +- with_gnu_ld=yes +- # version 8.0 and above of icpc choke on multiply defined symbols +- # if we add $predep_objects and $postdep_objects, however 7.1 and +- # earlier do not add the objects themselves. +- case `$CC -V 2>&1` in +- *"Version 7."*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- ;; +- *) # Version 8.0 or newer +- tmp_idyn= +- case $host_cpu in +- ia64*) tmp_idyn=' -i_dynamic';; +- esac +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- ;; +- esac +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' +- ;; +- pgCC* | pgcpp*) +- # Portland Group C++ compiler +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- ;; +- cxx*) +- # Compaq C++ +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' +- +- runpath_var=LD_RUN_PATH +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) +- # Sun C++ 5.9 +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- +- # Not sure whether something based on +- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 +- # would be better. +- output_verbose_link_cmd='echo' +- +- # Archives containing C++ object files must be created using +- # "CC -xar", where "CC" is the Sun C++ compiler. This is +- # necessary to make sure instantiated templates are included +- # in the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' +- ;; +- esac +- ;; +- esac +- ;; +- lynxos*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- m88k*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- mvs*) +- case $cc_basename in +- cxx*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- netbsd* | netbsdelf*-gnu) +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' +- wlarc= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- fi +- # Workaround some broken pre-1.5 toolchains +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' +- ;; +- openbsd2*) +- # C++ shared libraries are fairly broken +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- openbsd*) +- if test -f /usr/libexec/ld.so; then +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' +- fi +- output_verbose_link_cmd='echo' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- osf3*) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Archives containing C++ object files must be created using +- # "CC -Bstatic", where "CC" is the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' +- +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- cxx*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +- +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- osf4* | osf5*) +- case $cc_basename in +- KCC*) +- # Kuck and Associates, Inc. (KAI) C++ Compiler +- +- # KCC will only create a shared library if the output file +- # ends with ".so" (or ".sl" for HP-UX), so rename the library +- # to its proper name (with version) after linking. +- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Archives containing C++ object files must be created using +- # the KAI C++ compiler. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- cxx*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ +- echo "-hidden">> $lib.exp~ +- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ +- $rm $lib.exp' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- # +- # There doesn't appear to be a way to prevent this compiler from +- # explicitly linking system object files so we need to strip them +- # from the output so that they don't get included in the library +- # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +- ;; +- *) +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +- +- else +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- psos*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- sunos4*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.x +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- lcc*) +- # Lucid +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- solaris*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.2, 5.x and Centerline C++ +- _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- case $host_os in +- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; +- *) +- # The compiler driver will combine and reorder linker options, +- # but understands `-z linker_flag'. +- # Supported since Solaris 2.6 (maybe 2.5.1?) +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' +- ;; +- esac +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- +- output_verbose_link_cmd='echo' +- +- # Archives containing C++ object files must be created using +- # "CC -xar", where "CC" is the Sun C++ compiler. This is +- # necessary to make sure instantiated templates are included +- # in the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' +- ;; +- gcx*) +- # Green Hills C++ Compiler +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +- +- # The C++ compiler must be used to create the archive. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' +- ;; +- *) +- # GNU C++ compiler with Solaris linker +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' +- if $CC --version | grep -v '^2\.7' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" +- else +- # g++ 2.7 appears to require `-G' NOT `-shared' on this +- # platform. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' +- +- # Commands to make compiler produce verbose output that lists +- # what "hidden" libraries, object files and flags are used when +- # linking a shared library. +- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" +- fi +- +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' +- case $host_os in +- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; +- *) +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' +- ;; +- esac +- fi +- ;; +- esac +- ;; +- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var='LD_RUN_PATH' +- +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- ;; +- sysv5* | sco3.2v5* | sco5v6*) +- # Note: We can NOT use -z defs as we might desire, because we do not +- # link with -lc, and that would cause any symbols used from libc to +- # always be unresolved, which means just about no library would +- # ever link correctly. If we're not using GNU ld we use -z text +- # though, which does catch some bad symbols but isn't as heavy-handed +- # as -z defs. +- # For security reasons, it is highly recommended that you always +- # use absolute paths for naming shared libraries, and exclude the +- # DT_RUNPATH tag from executables and libraries. But doing so +- # requires that you compile everything twice, which is a pain. +- # So that behaviour is only enabled if SCOABSPATH is set to a +- # non-empty value in the environment. Most likely only useful for +- # creating official distributions of packages. +- # This is a hack until libtool officially supports absolute path +- # names for shared libraries. +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' +- runpath_var='LD_RUN_PATH' +- +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- ;; +- tandem*) +- case $cc_basename in +- NCC*) +- # NonStop-UX NCC 3.20 +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- ;; +- vxworks*) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- *) +- # FIXME: insert proper C++ library support +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +-esac +-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no +- +-_LT_AC_TAGVAR(GCC, $1)="$GXX" +-_LT_AC_TAGVAR(LD, $1)="$LD" +- +-AC_LIBTOOL_POSTDEP_PREDEP($1) +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_POP +-CC=$lt_save_CC +-LDCXX=$LD +-LD=$lt_save_LD +-GCC=$lt_save_GCC +-with_gnu_ldcxx=$with_gnu_ld +-with_gnu_ld=$lt_save_with_gnu_ld +-lt_cv_path_LDCXX=$lt_cv_path_LD +-lt_cv_path_LD=$lt_save_path_LD +-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +-])# AC_LIBTOOL_LANG_CXX_CONFIG +- +-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +-# ------------------------------------ +-# Figure out "hidden" library dependencies from verbose +-# compiler output when linking a shared library. +-# Parse the compiler output and extract the necessary +-# objects, libraries and library flags. +-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-dnl we can't use the lt_simple_compile_test_code here, +-dnl because it contains code intended for an executable, +-dnl not a library. It's possible we should let each +-dnl tag define a new lt_????_link_test_code variable, +-dnl but it's only used here... +-ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&1 | sed 5q` in +- *Sun\ C*) +- # Sun C++ 5.9 +- # +- # The more standards-conforming stlport4 library is +- # incompatible with the Cstd library. Avoid specifying +- # it if it's in CXXFLAGS. Ignore libCrun as +- # -library=stlport4 depends on it. +- case " $CXX $CXXFLAGS " in +- *" -library=stlport4 "*) +- solaris_use_stlport4=yes +- ;; +- esac +- if test "$solaris_use_stlport4" != yes; then +- _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' +- fi +- ;; +- esac +- ;; +- +-solaris*) +- case $cc_basename in +- CC*) +- # The more standards-conforming stlport4 library is +- # incompatible with the Cstd library. Avoid specifying +- # it if it's in CXXFLAGS. Ignore libCrun as +- # -library=stlport4 depends on it. +- case " $CXX $CXXFLAGS " in +- *" -library=stlport4 "*) +- solaris_use_stlport4=yes +- ;; +- esac +- +- # Adding this requires a known-good setup of shared libraries for +- # Sun compiler versions before 5.6, else PIC objects from an old +- # archive will be linked into the output, leading to subtle bugs. +- if test "$solaris_use_stlport4" != yes; then +- _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' +- fi +- ;; +- esac +- ;; +-esac +-]) +-case " $_LT_AC_TAGVAR(postdeps, $1) " in +-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; +-esac +-])# AC_LIBTOOL_POSTDEP_PREDEP +- +-# AC_LIBTOOL_LANG_F77_CONFIG +-# -------------------------- +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) +-AC_DEFUN([_LT_AC_LANG_F77_CONFIG], +-[AC_REQUIRE([AC_PROG_F77]) +-AC_LANG_PUSH(Fortran 77) +- +-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +-_LT_AC_TAGVAR(allow_undefined_flag, $1)= +-_LT_AC_TAGVAR(always_export_symbols, $1)=no +-_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_direct, $1)=no +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +-_LT_AC_TAGVAR(hardcode_automatic, $1)=no +-_LT_AC_TAGVAR(module_cmds, $1)= +-_LT_AC_TAGVAR(module_expsym_cmds, $1)= +-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +-_LT_AC_TAGVAR(no_undefined_flag, $1)= +-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +- +-# Source file extension for f77 test sources. +-ac_ext=f +- +-# Object file extension for compiled f77 test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="\ +- subroutine t +- return +- end +-" +- +-# Code to be used in simple link tests +-lt_simple_link_test_code="\ +- program t +- end +-" +- +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER +- +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE +- +-# Allow CC to be a program name with arguments. +-lt_save_CC="$CC" +-CC=${F77-"f77"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +- +-AC_MSG_CHECKING([if libtool supports shared libraries]) +-AC_MSG_RESULT([$can_build_shared]) +- +-AC_MSG_CHECKING([whether to build shared libraries]) +-test "$can_build_shared" = "no" && enable_shared=no +- +-# On AIX, shared libraries and static libraries use the same namespace, and +-# are all built from PIC. +-case $host_os in +-aix3*) +- test "$enable_shared" = yes && enable_static=no +- if test -n "$RANLIB"; then +- archive_cmds="$archive_cmds~\$RANLIB \$lib" +- postinstall_cmds='$RANLIB $lib' +- fi +- ;; +-aix[[4-9]]*) +- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then +- test "$enable_shared" = yes && enable_static=no +- fi +- ;; +-esac +-AC_MSG_RESULT([$enable_shared]) +- +-AC_MSG_CHECKING([whether to build static libraries]) +-# Make sure either enable_shared or enable_static is yes. +-test "$enable_shared" = yes || enable_static=yes +-AC_MSG_RESULT([$enable_static]) +- +-_LT_AC_TAGVAR(GCC, $1)="$G77" +-_LT_AC_TAGVAR(LD, $1)="$LD" +- +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_POP +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_F77_CONFIG +- +- +-# AC_LIBTOOL_LANG_GCJ_CONFIG +-# -------------------------- +-# Ensure that the configuration vars for the C compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) +-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], +-[AC_LANG_SAVE +- +-# Source file extension for Java test sources. +-ac_ext=java +- +-# Object file extension for compiled Java test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code="class foo {}" +- +-# Code to be used in simple link tests +-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' +- +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER +- +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE +- +-# Allow CC to be a program name with arguments. +-lt_save_CC="$CC" +-CC=${GCJ-"gcj"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +- +-# GCJ did not exist at the time GCC didn't implicitly link libc in. +-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- +-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +- +-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +-AC_LIBTOOL_PROG_COMPILER_PIC($1) +-AC_LIBTOOL_PROG_CC_C_O($1) +-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +-AC_LIBTOOL_PROG_LD_SHLIBS($1) +-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_RESTORE +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_GCJ_CONFIG +- +- +-# AC_LIBTOOL_LANG_RC_CONFIG +-# ------------------------- +-# Ensure that the configuration vars for the Windows resource compiler are +-# suitably defined. Those variables are subsequently used by +-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) +-AC_DEFUN([_LT_AC_LANG_RC_CONFIG], +-[AC_LANG_SAVE +- +-# Source file extension for RC test sources. +-ac_ext=rc +- +-# Object file extension for compiled RC test sources. +-objext=o +-_LT_AC_TAGVAR(objext, $1)=$objext +- +-# Code to be used in simple compile tests +-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' +- +-# Code to be used in simple link tests +-lt_simple_link_test_code="$lt_simple_compile_test_code" +- +-# ltmain only uses $CC for tagged configurations so make sure $CC is set. +-_LT_AC_SYS_COMPILER +- +-# save warnings/boilerplate of simple test code +-_LT_COMPILER_BOILERPLATE +-_LT_LINKER_BOILERPLATE +- +-# Allow CC to be a program name with arguments. +-lt_save_CC="$CC" +-CC=${RC-"windres"} +-compiler=$CC +-_LT_AC_TAGVAR(compiler, $1)=$CC +-_LT_CC_BASENAME([$compiler]) +-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes +- +-AC_LIBTOOL_CONFIG($1) +- +-AC_LANG_RESTORE +-CC="$lt_save_CC" +-])# AC_LIBTOOL_LANG_RC_CONFIG +- +- +-# AC_LIBTOOL_CONFIG([TAGNAME]) +-# ---------------------------- +-# If TAGNAME is not passed, then create an initial libtool script +-# with a default configuration from the untagged config vars. Otherwise +-# add code to config.status for appending the configuration named by +-# TAGNAME from the matching tagged config vars. +-AC_DEFUN([AC_LIBTOOL_CONFIG], +-[# The else clause should only fire when bootstrapping the +-# libtool distribution, otherwise you forgot to ship ltmain.sh +-# with your package, and you will get complaints that there are +-# no rules to generate ltmain.sh. +-if test -f "$ltmain"; then +- # See if we are running on zsh, and set the options which allow our commands through +- # without removal of \ escapes. +- if test -n "${ZSH_VERSION+set}" ; then +- setopt NO_GLOB_SUBST +- fi +- # Now quote all the things that may contain metacharacters while being +- # careful not to overquote the AC_SUBSTed values. We take copies of the +- # variables and quote the copies for generation of the libtool script. +- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ +- SED SHELL STRIP \ +- libname_spec library_names_spec soname_spec extract_expsyms_cmds \ +- old_striplib striplib file_magic_cmd finish_cmds finish_eval \ +- deplibs_check_method reload_flag reload_cmds need_locks \ +- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ +- lt_cv_sys_global_symbol_to_c_name_address \ +- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ +- old_postinstall_cmds old_postuninstall_cmds \ +- _LT_AC_TAGVAR(compiler, $1) \ +- _LT_AC_TAGVAR(CC, $1) \ +- _LT_AC_TAGVAR(LD, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ +- _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ +- _LT_AC_TAGVAR(old_archive_cmds, $1) \ +- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ +- _LT_AC_TAGVAR(predep_objects, $1) \ +- _LT_AC_TAGVAR(postdep_objects, $1) \ +- _LT_AC_TAGVAR(predeps, $1) \ +- _LT_AC_TAGVAR(postdeps, $1) \ +- _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ +- _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \ +- _LT_AC_TAGVAR(archive_cmds, $1) \ +- _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ +- _LT_AC_TAGVAR(postinstall_cmds, $1) \ +- _LT_AC_TAGVAR(postuninstall_cmds, $1) \ +- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ +- _LT_AC_TAGVAR(allow_undefined_flag, $1) \ +- _LT_AC_TAGVAR(no_undefined_flag, $1) \ +- _LT_AC_TAGVAR(export_symbols_cmds, $1) \ +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ +- _LT_AC_TAGVAR(hardcode_automatic, $1) \ +- _LT_AC_TAGVAR(module_cmds, $1) \ +- _LT_AC_TAGVAR(module_expsym_cmds, $1) \ +- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ +- _LT_AC_TAGVAR(fix_srcfile_path, $1) \ +- _LT_AC_TAGVAR(exclude_expsyms, $1) \ +- _LT_AC_TAGVAR(include_expsyms, $1); do +- +- case $var in +- _LT_AC_TAGVAR(old_archive_cmds, $1) | \ +- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ +- _LT_AC_TAGVAR(archive_cmds, $1) | \ +- _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ +- _LT_AC_TAGVAR(module_cmds, $1) | \ +- _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ +- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ +- _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ +- extract_expsyms_cmds | reload_cmds | finish_cmds | \ +- postinstall_cmds | postuninstall_cmds | \ +- old_postinstall_cmds | old_postuninstall_cmds | \ +- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) +- # Double-quote double-evaled strings. +- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" +- ;; +- *) +- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" +- ;; +- esac +- done +- +- case $lt_echo in +- *'\[$]0 --fallback-echo"') +- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` +- ;; +- esac +- +-ifelse([$1], [], +- [cfgfile="${ofile}T" +- trap "$rm \"$cfgfile\"; exit 1" 1 2 15 +- $rm -f "$cfgfile" +- AC_MSG_NOTICE([creating $ofile])], +- [cfgfile="$ofile"]) +- +- cat <<__EOF__ >> "$cfgfile" +-ifelse([$1], [], +-[#! $SHELL +- +-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +-# NOTE: Changes made to this file will be lost: look at ltmain.sh. +-# +-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +-# Free Software Foundation, Inc. +-# +-# This file is part of GNU Libtool: +-# Originally by Gordon Matzigkeit , 1996 +-# +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2 of the License, or +-# (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, but +-# WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-# General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-# As a special exception to the GNU General Public License, if you +-# distribute this file as part of a program that contains a +-# configuration script generated by Autoconf, you may include it under +-# the same distribution terms that you use for the rest of that program. +- +-# A sed program that does not truncate output. +-SED=$lt_SED +- +-# Sed that helps us avoid accidentally triggering echo(1) options like -n. +-Xsed="$SED -e 1s/^X//" +- +-# The HP-UX ksh and POSIX shell print the target directory to stdout +-# if CDPATH is set. +-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +- +-# The names of the tagged configurations supported by this script. +-available_tags= +- +-# ### BEGIN LIBTOOL CONFIG], +-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) +- +-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +- +-# Shell to use when invoking shell scripts. +-SHELL=$lt_SHELL +- +-# Whether or not to build shared libraries. +-build_libtool_libs=$enable_shared +- +-# Whether or not to build static libraries. +-build_old_libs=$enable_static +- +-# Whether or not to add -lc for building shared libraries. +-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) +- +-# Whether or not to disallow shared libs when runtime libs are static +-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) +- +-# Whether or not to optimize for fast installation. +-fast_install=$enable_fast_install +- +-# The host system. +-host_alias=$host_alias +-host=$host +-host_os=$host_os +- +-# The build system. +-build_alias=$build_alias +-build=$build +-build_os=$build_os +- +-# An echo program that does not interpret backslashes. +-echo=$lt_echo +- +-# The archiver. +-AR=$lt_AR +-AR_FLAGS=$lt_AR_FLAGS +- +-# A C compiler. +-LTCC=$lt_LTCC +- +-# LTCC compiler flags. +-LTCFLAGS=$lt_LTCFLAGS +- +-# A language-specific compiler. +-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) +- +-# Is the compiler the GNU C compiler? +-with_gcc=$_LT_AC_TAGVAR(GCC, $1) +- +-# An ERE matcher. +-EGREP=$lt_EGREP +- +-# The linker used to build libraries. +-LD=$lt_[]_LT_AC_TAGVAR(LD, $1) +- +-# Whether we need hard or soft links. +-LN_S=$lt_LN_S +- +-# A BSD-compatible nm program. +-NM=$lt_NM +- +-# A symbol stripping program +-STRIP=$lt_STRIP +- +-# Used to examine libraries when file_magic_cmd begins "file" +-MAGIC_CMD=$MAGIC_CMD +- +-# Used on cygwin: DLL creation program. +-DLLTOOL="$DLLTOOL" +- +-# Used on cygwin: object dumper. +-OBJDUMP="$OBJDUMP" +- +-# Used on cygwin: assembler. +-AS="$AS" +- +-# The name of the directory that contains temporary libtool files. +-objdir=$objdir +- +-# How to create reloadable object files. +-reload_flag=$lt_reload_flag +-reload_cmds=$lt_reload_cmds +- +-# How to pass a linker flag through the compiler. +-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) +- +-# Object file suffix (normally "o"). +-objext="$ac_objext" +- +-# Old archive suffix (normally "a"). +-libext="$libext" +- +-# Shared library suffix (normally ".so"). +-shrext_cmds='$shrext_cmds' +- +-# Executable file suffix (normally ""). +-exeext="$exeext" +- +-# Additional compiler flags for building library objects. +-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +-pic_mode=$pic_mode +- +-# What is the maximum length of a command? +-max_cmd_len=$lt_cv_sys_max_cmd_len +- +-# Does compiler simultaneously support -c and -o options? +-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) +- +-# Must we lock files when doing compilation? +-need_locks=$lt_need_locks +- +-# Do we need the lib prefix for modules? +-need_lib_prefix=$need_lib_prefix +- +-# Do we need a version for libraries? +-need_version=$need_version +- +-# Whether dlopen is supported. +-dlopen_support=$enable_dlopen +- +-# Whether dlopen of programs is supported. +-dlopen_self=$enable_dlopen_self +- +-# Whether dlopen of statically linked programs is supported. +-dlopen_self_static=$enable_dlopen_self_static +- +-# Compiler flag to prevent dynamic linking. +-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) +- +-# Compiler flag to turn off builtin functions. +-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) +- +-# Compiler flag to allow reflexive dlopens. +-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) +- +-# Compiler flag to generate shared objects directly from archives. +-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) +- +-# Compiler flag to generate thread-safe objects. +-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) +- +-# Library versioning type. +-version_type=$version_type +- +-# Format of library name prefix. +-libname_spec=$lt_libname_spec +- +-# List of archive names. First name is the real one, the rest are links. +-# The last name is the one that the linker finds with -lNAME. +-library_names_spec=$lt_library_names_spec +- +-# The coded name of the library, if different from the real name. +-soname_spec=$lt_soname_spec +- +-# Commands used to build and install an old-style archive. +-RANLIB=$lt_RANLIB +-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +-old_postinstall_cmds=$lt_old_postinstall_cmds +-old_postuninstall_cmds=$lt_old_postuninstall_cmds +- +-# Create an old-style archive from a shared archive. +-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) +- +-# Create a temporary old-style archive to link instead of a shared archive. +-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) +- +-# Commands used to build and install a shared archive. +-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +-postinstall_cmds=$lt_postinstall_cmds +-postuninstall_cmds=$lt_postuninstall_cmds +- +-# Commands used to build a loadable module (assumed same as above if empty) +-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) +- +-# Commands to strip libraries. +-old_striplib=$lt_old_striplib +-striplib=$lt_striplib +- +-# Dependencies to place before the objects being linked to create a +-# shared library. +-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) +- +-# Dependencies to place after the objects being linked to create a +-# shared library. +-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) +- +-# Dependencies to place before the objects being linked to create a +-# shared library. +-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) +- +-# Dependencies to place after the objects being linked to create a +-# shared library. +-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) +- +-# The directories searched by this compiler when creating a shared +-# library +-compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1) +- +-# The library search path used internally by the compiler when linking +-# a shared library. +-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) +- +-# Method to check whether dependent libraries are shared objects. +-deplibs_check_method=$lt_deplibs_check_method +- +-# Command to use when deplibs_check_method == file_magic. +-file_magic_cmd=$lt_file_magic_cmd +- +-# Flag that allows shared libraries with undefined symbols to be built. +-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) +- +-# Flag that forces no undefined symbols. +-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) +- +-# Commands used to finish a libtool library installation in a directory. +-finish_cmds=$lt_finish_cmds +- +-# Same as above, but a single script fragment to be evaled but not shown. +-finish_eval=$lt_finish_eval +- +-# Take the output of nm and produce a listing of raw symbols and C names. +-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe +- +-# Transform the output of nm in a proper C declaration +-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +- +-# Transform the output of nm in a C name address pair +-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address +- +-# This is the shared library runtime path variable. +-runpath_var=$runpath_var +- +-# This is the shared library path variable. +-shlibpath_var=$shlibpath_var +- +-# Is shlibpath searched before the hard-coded library search path? +-shlibpath_overrides_runpath=$shlibpath_overrides_runpath +- +-# How to hardcode a shared library path into an executable. +-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) +- +-# Whether we should hardcode library paths into libraries. +-hardcode_into_libs=$hardcode_into_libs +- +-# Flag to hardcode \$libdir into a binary during linking. +-# This must work even if \$libdir does not exist. +-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) +- +-# If ld is used when linking, flag to hardcode \$libdir into +-# a binary during linking. This must work even if \$libdir does +-# not exist. +-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) +- +-# Whether we need a single -rpath flag with a separated argument. +-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) +- +-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +-# resulting binary. +-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) +- +-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +-# resulting binary. +-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) +- +-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +-# the resulting binary. +-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) +- +-# Set to yes if building a shared library automatically hardcodes DIR into the library +-# and all subsequent libraries and executables linked against it. +-hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) +- +-# Variables whose values should be saved in libtool wrapper scripts and +-# restored at relink time. +-variables_saved_for_relink="$variables_saved_for_relink" +- +-# Whether libtool must link a program against all its dependency libraries. +-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) +- +-# Compile-time system search path for libraries +-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +- +-# Run-time system search path for libraries +-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +- +-# Fix the shell variable \$srcfile for the compiler. +-fix_srcfile_path=$lt_fix_srcfile_path +- +-# Set to yes if exported symbols are required. +-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) +- +-# The commands to list exported symbols. +-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) +- +-# The commands to extract the exported symbol list from a shared archive. +-extract_expsyms_cmds=$lt_extract_expsyms_cmds +- +-# Symbols that should not be listed in the preloaded symbols. +-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) +- +-# Symbols that must always be exported. +-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) +- +-ifelse([$1],[], +-[# ### END LIBTOOL CONFIG], +-[# ### END LIBTOOL TAG CONFIG: $tagname]) +- +-__EOF__ +- +-ifelse([$1],[], [ +- case $host_os in +- aix3*) +- cat <<\EOF >> "$cfgfile" +- +-# AIX sometimes has problems with the GCC collect2 program. For some +-# reason, if we set the COLLECT_NAMES environment variable, the problems +-# vanish in a puff of smoke. +-if test "X${COLLECT_NAMES+set}" != Xset; then +- COLLECT_NAMES= +- export COLLECT_NAMES +-fi +-EOF +- ;; +- esac +- +- # We use sed instead of cat because bash on DJGPP gets confused if +- # if finds mixed CR/LF and LF-only lines. Since sed operates in +- # text mode, it properly converts lines to CR/LF. This bash problem +- # is reportedly fixed, but why not run on old versions too? +- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) +- +- mv -f "$cfgfile" "$ofile" || \ +- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") +- chmod +x "$ofile" +-]) +-else +- # If there is no Makefile yet, we rely on a make rule to execute +- # `config.status --recheck' to rerun these tests and create the +- # libtool script then. +- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` +- if test -f "$ltmain_in"; then +- test -f Makefile && make "$ltmain" +- fi +-fi +-])# AC_LIBTOOL_CONFIG +- +- +-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +-# ------------------------------------------- +-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +- +-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +- +-if test "$GCC" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +- +- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], +- lt_cv_prog_compiler_rtti_exceptions, +- [-fno-rtti -fno-exceptions], [], +- [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +-fi +-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI +- +- +-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +-# --------------------------------- +-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +-[AC_REQUIRE([AC_CANONICAL_HOST]) +-AC_REQUIRE([LT_AC_PROG_SED]) +-AC_REQUIRE([AC_PROG_NM]) +-AC_REQUIRE([AC_OBJEXT]) +-# Check for command to grab the raw symbol name followed by C symbol from nm. +-AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +-[ +-# These are sane defaults that work on at least a few old systems. +-# [They come from Ultrix. What could be older than Ultrix?!! ;)] +- +-# Character class describing NM global symbol codes. +-symcode='[[BCDEGRST]]' +- +-# Regexp to match symbols that can be accessed directly from C. +-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' +- +-# Transform an extracted symbol line into a proper C declaration +-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" +- +-# Transform an extracted symbol line into symbol name and symbol address +-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" +- +-# Define system-specific variables. +-case $host_os in +-aix*) +- symcode='[[BCDT]]' +- ;; +-cygwin* | mingw* | pw32*) +- symcode='[[ABCDGISTW]]' +- ;; +-hpux*) # Its linker distinguishes data from code symbols +- if test "$host_cpu" = ia64; then +- symcode='[[ABCDEGRST]]' +- fi +- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" +- ;; +-linux* | k*bsd*-gnu) +- if test "$host_cpu" = ia64; then +- symcode='[[ABCDGIRSTW]]' +- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" +- fi +- ;; +-irix* | nonstopux*) +- symcode='[[BCDEGRST]]' +- ;; +-osf*) +- symcode='[[BCDEGQRST]]' +- ;; +-solaris*) +- symcode='[[BDRT]]' +- ;; +-sco3.2v5*) +- symcode='[[DT]]' +- ;; +-sysv4.2uw2*) +- symcode='[[DT]]' +- ;; +-sysv5* | sco5v6* | unixware* | OpenUNIX*) +- symcode='[[ABDT]]' +- ;; +-sysv4) +- symcode='[[DFNSTU]]' +- ;; +-esac +- +-# Handle CRLF in mingw tool chain +-opt_cr= +-case $build_os in +-mingw*) +- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp +- ;; +-esac +- +-# If we're using GNU nm, then use its standard symbol codes. +-case `$NM -V 2>&1` in +-*GNU* | *'with BFD'*) +- symcode='[[ABCDGIRSTW]]' ;; +-esac +- +-# Try without a prefix undercore, then with it. +-for ac_symprfx in "" "_"; do +- +- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. +- symxfrm="\\1 $ac_symprfx\\2 \\2" +- +- # Write the raw and C identifiers. +- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" +- +- # Check to see that the pipe works correctly. +- pipe_works=no +- +- rm -f conftest* +- cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then +- # Try sorting and uniquifying the output. +- if sort "$nlist" | uniq > "$nlist"T; then +- mv -f "$nlist"T "$nlist" +- else +- rm -f "$nlist"T +- fi +- +- # Make sure that we snagged all the symbols we need. +- if grep ' nm_test_var$' "$nlist" >/dev/null; then +- if grep ' nm_test_func$' "$nlist" >/dev/null; then +- cat < conftest.$ac_ext +-#ifdef __cplusplus +-extern "C" { +-#endif +- +-EOF +- # Now generate the symbol file. +- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' +- +- cat <> conftest.$ac_ext +-#if defined (__STDC__) && __STDC__ +-# define lt_ptr_t void * +-#else +-# define lt_ptr_t char * +-# define const +-#endif +- +-/* The mapping between symbol names and symbols. */ +-const struct { +- const char *name; +- lt_ptr_t address; +-} +-lt_preloaded_symbols[[]] = +-{ +-EOF +- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext +- cat <<\EOF >> conftest.$ac_ext +- {0, (lt_ptr_t) 0} +-}; +- +-#ifdef __cplusplus +-} +-#endif +-EOF +- # Now try linking the two files. +- mv conftest.$ac_objext conftstm.$ac_objext +- lt_save_LIBS="$LIBS" +- lt_save_CFLAGS="$CFLAGS" +- LIBS="conftstm.$ac_objext" +- CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" +- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then +- pipe_works=yes +- fi +- LIBS="$lt_save_LIBS" +- CFLAGS="$lt_save_CFLAGS" +- else +- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD +- fi +- else +- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD +- fi +- else +- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD +- fi +- else +- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD +- cat conftest.$ac_ext >&5 +- fi +- rm -rf conftest* conftst* +- +- # Do not use the global_symbol_pipe unless it works. +- if test "$pipe_works" = yes; then +- break +- else +- lt_cv_sys_global_symbol_pipe= +- fi +-done +-]) +-if test -z "$lt_cv_sys_global_symbol_pipe"; then +- lt_cv_sys_global_symbol_to_cdecl= +-fi +-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then +- AC_MSG_RESULT(failed) +-else +- AC_MSG_RESULT(ok) +-fi +-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +- +- +-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +-# --------------------------------------- +-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= +- +-AC_MSG_CHECKING([for $compiler option to produce PIC]) +- ifelse([$1],[CXX],[ +- # C++ specific cases for pic, static, wl, etc. +- if test "$GXX" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- +- case $host_os in +- aix*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; +- amigaos*) +- # FIXME: we need at least 68020 code to build shared libraries, but +- # adding the `-m68020' flag to GCC prevents building anything better, +- # like `-m68040'. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' +- ;; +- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) +- # PIC is the default for these OSes. +- ;; +- mingw* | cygwin* | os2* | pw32*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- # Although the cygwin gcc ignores -fPIC, still need this for old-style +- # (--disable-auto-import) libraries +- m4_if([$1], [GCJ], [], +- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) +- ;; +- darwin* | rhapsody*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' +- ;; +- *djgpp*) +- # DJGPP does not support shared libraries at all +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- ;; +- interix[[3-9]]*) +- # Interix 3.x gcc -fpic/-fPIC options generate broken code. +- # Instead, we relocate shared libraries at runtime. +- ;; +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic +- fi +- ;; +- hpux*) +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- else +- case $host_os in +- aix[[4-9]]*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- else +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' +- fi +- ;; +- chorus*) +- case $cc_basename in +- cxch68*) +- # Green Hills C++ Compiler +- # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" +- ;; +- esac +- ;; +- darwin*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- case $cc_basename in +- xlc*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- ;; +- esac +- ;; +- dgux*) +- case $cc_basename in +- ec++*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- ;; +- ghcx*) +- # Green Hills C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- ;; +- *) +- ;; +- esac +- ;; +- freebsd* | dragonfly*) +- # FreeBSD uses GNU C++ +- ;; +- hpux9* | hpux10* | hpux11*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' +- if test "$host_cpu" != ia64; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- fi +- ;; +- aCC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' +- case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- ;; +- esac +- ;; +- *) +- ;; +- esac +- ;; +- interix*) +- # This is c89, which is MS Visual C++ (no shared libs) +- # Anyone wants to do a port? +- ;; +- irix5* | irix6* | nonstopux*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- # CC pic flag -KPIC is the default. +- ;; +- *) +- ;; +- esac +- ;; +- linux* | k*bsd*-gnu) +- case $cc_basename in +- KCC*) +- # KAI C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- icpc* | ecpc*) +- # Intel C++ +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- ;; +- pgCC* | pgcpp*) +- # Portland Group C++ compiler. +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- cxx*) +- # Compaq C++ +- # Make sure the PIC flag is empty. It appears that all Alpha +- # Linux and Compaq Tru64 Unix objects are PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- *) +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) +- # Sun C++ 5.9 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' +- ;; +- esac +- ;; +- esac +- ;; +- lynxos*) +- ;; +- m88k*) +- ;; +- mvs*) +- case $cc_basename in +- cxx*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' +- ;; +- *) +- ;; +- esac +- ;; +- netbsd* | netbsdelf*-gnu) +- ;; +- osf3* | osf4* | osf5*) +- case $cc_basename in +- KCC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' +- ;; +- RCC*) +- # Rational C++ 2.4.1 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- ;; +- cxx*) +- # Digital/Compaq C++ +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # Make sure the PIC flag is empty. It appears that all Alpha +- # Linux and Compaq Tru64 Unix objects are PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- *) +- ;; +- esac +- ;; +- psos*) +- ;; +- solaris*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.2, 5.x and Centerline C++ +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' +- ;; +- gcx*) +- # Green Hills C++ Compiler +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' +- ;; +- *) +- ;; +- esac +- ;; +- sunos4*) +- case $cc_basename in +- CC*) +- # Sun C++ 4.x +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- lcc*) +- # Lucid +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- ;; +- *) +- ;; +- esac +- ;; +- tandem*) +- case $cc_basename in +- NCC*) +- # NonStop-UX NCC 3.20 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- ;; +- *) +- ;; +- esac +- ;; +- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) +- case $cc_basename in +- CC*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- esac +- ;; +- vxworks*) +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- ;; +- esac +- fi +-], +-[ +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- +- case $host_os in +- aix*) +- # All AIX code is PIC. +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; +- +- amigaos*) +- # FIXME: we need at least 68020 code to build shared libraries, but +- # adding the `-m68020' flag to GCC prevents building anything better, +- # like `-m68040'. +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' +- ;; +- +- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) +- # PIC is the default for these OSes. +- ;; +- +- mingw* | cygwin* | pw32* | os2*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- # Although the cygwin gcc ignores -fPIC, still need this for old-style +- # (--disable-auto-import) libraries +- m4_if([$1], [GCJ], [], +- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) +- ;; +- +- darwin* | rhapsody*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' +- ;; +- +- interix[[3-9]]*) +- # Interix 3.x gcc -fpic/-fPIC options generate broken code. +- # Instead, we relocate shared libraries at runtime. +- ;; +- +- msdosdjgpp*) +- # Just because we use GCC doesn't mean we suddenly get shared libraries +- # on systems that don't support them. +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- enable_shared=no +- ;; +- +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic +- fi +- ;; +- +- hpux*) +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- ;; +- +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' +- ;; +- esac +- else +- # PORTME Check for flag to pass linker flags through the system compiler. +- case $host_os in +- aix*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- if test "$host_cpu" = ia64; then +- # AIX 5 now supports IA64 processor +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- else +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' +- fi +- ;; +- darwin*) +- # PIC is the default on this platform +- # Common symbols not allowed in MH_DYLIB files +- case $cc_basename in +- xlc*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- ;; +- esac +- ;; +- +- mingw* | cygwin* | pw32* | os2*) +- # This hack is so that the source file can tell whether it is being +- # built for inclusion in a dll (and should export symbols for example). +- m4_if([$1], [GCJ], [], +- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) +- ;; +- +- hpux9* | hpux10* | hpux11*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but +- # not for PA HP-UX. +- case $host_cpu in +- hppa*64*|ia64*) +- # +Z the default +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' +- ;; +- esac +- # Is there a better lt_prog_compiler_static that works with the bundled CC? +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' +- ;; +- +- irix5* | irix6* | nonstopux*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # PIC (with -KPIC) is the default. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- +- newsos6) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- linux* | k*bsd*-gnu) +- case $cc_basename in +- icc* | ecc*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +- ;; +- pgcc* | pgf77* | pgf90* | pgf95*) +- # Portland Group compilers (*not* the Pentium gcc compiler, +- # which looks to be a dead project) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- ccc*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # All Alpha code is PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- *) +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) +- # Sun C 5.9 +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- ;; +- *Sun\ F*) +- # Sun Fortran 8.3 passes all unrecognized flags to the linker +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' +- ;; +- esac +- ;; +- esac +- ;; +- +- osf3* | osf4* | osf5*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- # All OSF/1 code is PIC. +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- +- rdos*) +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' +- ;; +- +- solaris*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- case $cc_basename in +- f77* | f90* | f95*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; +- esac +- ;; +- +- sunos4*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- sysv4 | sysv4.2uw2* | sysv4.3*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- sysv4*MP*) +- if test -d /usr/nec ;then +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- fi +- ;; +- +- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- unicos*) +- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- ;; +- +- uts4*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' +- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +- ;; +- +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +- ;; +- esac +- fi +-]) +-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) +- +-# +-# Check to make sure the PIC flag actually works. +-# +-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then +- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], +- _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1), +- [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], +- [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in +- "" | " "*) ;; +- *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; +- esac], +- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +-fi +-case $host_os in +- # For platforms which do not support PIC, -DPIC is meaningless: +- *djgpp*) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +- ;; +- *) +- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" +- ;; +-esac +- +-# +-# Check to make sure the static flag actually works. +-# +-wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], +- _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1), +- $lt_tmp_static_flag, +- [], +- [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +-]) +- +- +-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +-# ------------------------------------ +-# See if the linker supports building shared libraries. +-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +-[AC_REQUIRE([LT_AC_PROG_SED])dnl +-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +-ifelse([$1],[CXX],[ +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- case $host_os in +- aix[[4-9]]*) +- # If we're using GNU nm, then we don't want the "-C" option. +- # -C means demangle to AIX nm, but means don't demangle with GNU nm +- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- else +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- fi +- ;; +- pw32*) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" +- ;; +- cygwin* | mingw*) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' +- ;; +- linux* | k*bsd*-gnu) +- _LT_AC_TAGVAR(link_all_deplibs, $1)=no +- ;; +- *) +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- ;; +- esac +- _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +-],[ +- runpath_var= +- _LT_AC_TAGVAR(allow_undefined_flag, $1)= +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +- _LT_AC_TAGVAR(archive_cmds, $1)= +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)= +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= +- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +- _LT_AC_TAGVAR(hardcode_automatic, $1)=no +- _LT_AC_TAGVAR(module_cmds, $1)= +- _LT_AC_TAGVAR(module_expsym_cmds, $1)= +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- # include_expsyms should be a list of space-separated symbols to be *always* +- # included in the symbol list +- _LT_AC_TAGVAR(include_expsyms, $1)= +- # exclude_expsyms can be an extended regexp of symbols to exclude +- # it will be wrapped by ` (' and `)$', so one must not match beginning or +- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', +- # as well as any symbol that contains `d'. +- _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out +- # platforms (ab)use it in PIC code, but their linkers get confused if +- # the symbol is explicitly referenced. Since portable code cannot +- # rely on this symbol name, it's probably fine to never include it in +- # preloaded symbol tables. +- # Exclude shared library initialization/finalization symbols. +-dnl Note also adjust exclude_expsyms for C++ above. +- extract_expsyms_cmds= +- # Just being paranoid about ensuring that cc_basename is set. +- _LT_CC_BASENAME([$compiler]) +- case $host_os in +- cygwin* | mingw* | pw32*) +- # FIXME: the MSVC++ port hasn't been tested in a loooong time +- # When not using gcc, we currently assume that we are using +- # Microsoft Visual C++. +- if test "$GCC" != yes; then +- with_gnu_ld=no +- fi +- ;; +- interix*) +- # we just hope/assume this is gcc and not c89 (= MSVC++) +- with_gnu_ld=yes +- ;; +- openbsd*) +- with_gnu_ld=no +- ;; +- esac +- +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- if test "$with_gnu_ld" = yes; then +- # If archive_cmds runs LD, not CC, wlarc should be empty +- wlarc='${wl}' +- +- # Set some defaults for GNU ld with shared library support. These +- # are reset later if shared libraries are not supported. Putting them +- # here allows them to be overridden if necessary. +- runpath_var=LD_RUN_PATH +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- # ancient GNU ld didn't support --whole-archive et. al. +- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' +- else +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- supports_anon_versioning=no +- case `$LD -v 2>/dev/null` in +- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 +- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... +- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... +- *\ 2.11.*) ;; # other 2.11 versions +- *) supports_anon_versioning=yes ;; +- esac +- +- # See if GNU ld supports shared libraries. +- case $host_os in +- aix[[3-9]]*) +- # On AIX/PPC, the GNU linker is very broken +- if test "$host_cpu" != ia64; then +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <&2 +- +-*** Warning: the GNU linker, at least up to release 2.9.1, is reported +-*** to be unable to reliably create shared libraries on AIX. +-*** Therefore, libtool is disabling shared libraries support. If you +-*** really care for shared libraries, you may want to modify your PATH +-*** so that a non-GNU linker is found, and then restart. +- +-EOF +- fi +- ;; +- +- amigaos*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- +- # Samuel A. Falvo II reports +- # that the semantics of dynamic libraries on AmigaOS, at least up +- # to version 4, is to share data among multiple programs linked +- # with the same dynamic library. Since this doesn't match the +- # behavior of shared libraries on other platforms, we can't use +- # them. +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- +- beos*) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Joseph Beckenbach says some releases of gcc +- # support --undefined. This deserves some investigation. FIXME +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- cygwin* | mingw* | pw32*) +- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, +- # as there is no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=no +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' +- +- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- interix[[3-9]]*) +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. +- # Instead, shared libraries are loaded at an image base (0x10000000 by +- # default) and relocated if they conflict, which is a slow very memory +- # consuming and fragmenting process. To avoid this, we pick a random, +- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link +- # time. Moving up from 0x10000000 also allows more sbrk(2) space. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- ;; +- +- gnu* | linux* | k*bsd*-gnu) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- tmp_addflag= +- case $cc_basename,$host_cpu in +- pgcc*) # Portland Group C compiler +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- tmp_addflag=' $pic_flag' +- ;; +- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- tmp_addflag=' $pic_flag -Mnomain' ;; +- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 +- tmp_addflag=' -i_dynamic' ;; +- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 +- tmp_addflag=' -i_dynamic -nofor_main' ;; +- ifc* | ifort*) # Intel Fortran compiler +- tmp_addflag=' -nofor_main' ;; +- esac +- case `$CC -V 2>&1 | sed 5q` in +- *Sun\ C*) # Sun C 5.9 +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' +- tmp_sharedflag='-G' ;; +- *Sun\ F*) # Sun Fortran 8.3 +- tmp_sharedflag='-G' ;; +- *) +- tmp_sharedflag='-shared' ;; +- esac +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- +- if test $supports_anon_versioning = yes; then +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ +- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +- $echo "local: *; };" >> $output_objdir/$libname.ver~ +- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' +- fi +- _LT_AC_TAGVAR(link_all_deplibs, $1)=no +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- netbsd* | netbsdelf*-gnu) +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' +- wlarc= +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- fi +- ;; +- +- solaris*) +- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <&2 +- +-*** Warning: The releases 2.8.* of the GNU linker cannot reliably +-*** create shared libraries on Solaris systems. Therefore, libtool +-*** is disabling shared libraries support. We urge you to upgrade GNU +-*** binutils to release 2.9.1 or newer. Another option is to modify +-*** your PATH or compiler configuration so that the native linker is +-*** used, and then restart. +- +-EOF +- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) +- case `$LD -v 2>&1` in +- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- cat <<_LT_EOF 1>&2 +- +-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +-*** reliably create shared libraries on SCO systems. Therefore, libtool +-*** is disabling shared libraries support. We urge you to upgrade GNU +-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +-*** your PATH or compiler configuration so that the native linker is +-*** used, and then restart. +- +-_LT_EOF +- ;; +- *) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- ;; +- +- sunos4*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- wlarc= +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- *) +- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- esac +- +- if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then +- runpath_var= +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +- fi +- else +- # PORTME fill in a description of your system's linker (not GNU ld) +- case $host_os in +- aix3*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' +- # Note: this linker hardcodes the directories in LIBPATH if there +- # are no directories specified by -L. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then +- # Neither direct hardcoding nor static linking is supported with a +- # broken collect2. +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- fi +- ;; +- +- aix[[4-9]]*) +- if test "$host_cpu" = ia64; then +- # On IA64, the linker does run time linking by default, so we don't +- # have to do anything special. +- aix_use_runtimelinking=no +- exp_sym_flag='-Bexport' +- no_entry_flag="" +- else +- # If we're using GNU nm, then we don't want the "-C" option. +- # -C means demangle to AIX nm, but means don't demangle with GNU nm +- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- else +- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' +- fi +- aix_use_runtimelinking=no +- +- # Test if we are trying to use run time linking or normal +- # AIX style linking. If -brtl is somewhere in LDFLAGS, we +- # need to do runtime linking. +- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) +- for ld_flag in $LDFLAGS; do +- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then +- aix_use_runtimelinking=yes +- break +- fi +- done +- ;; +- esac +- +- exp_sym_flag='-bexport' +- no_entry_flag='-bnoentry' +- fi +- +- # When large executables or shared objects are built, AIX ld can +- # have problems creating the table of contents. If linking a library +- # or program results in "error TOC overflow" add -mminimal-toc to +- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not +- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. +- +- _LT_AC_TAGVAR(archive_cmds, $1)='' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- +- if test "$GCC" = yes; then +- case $host_os in aix4.[[012]]|aix4.[[012]].*) +- # We only want to do this on AIX 4.2 and lower, the check +- # below for broken collect2 doesn't work under 4.3+ +- collect2name=`${CC} -print-prog-name=collect2` +- if test -f "$collect2name" && \ +- strings "$collect2name" | grep resolve_lib_name >/dev/null +- then +- # We have reworked collect2 +- : +- else +- # We have old collect2 +- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported +- # It fails to find uninstalled libraries when the uninstalled +- # path is not listed in the libpath. Setting hardcode_minus_L +- # to unsupported forces relinking +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +- fi +- ;; +- esac +- shared_flag='-shared' +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag="$shared_flag "'${wl}-G' +- fi +- else +- # not using gcc +- if test "$host_cpu" = ia64; then +- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release +- # chokes on -Wl,-G. The following line is correct: +- shared_flag='-G' +- else +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag='${wl}-G' +- else +- shared_flag='${wl}-bM:SRE' +- fi +- fi +- fi +- +- # It seems that -bexpall does not export symbols beginning with +- # underscore (_), so it is better to generate a list of symbols to export. +- _LT_AC_TAGVAR(always_export_symbols, $1)=yes +- if test "$aix_use_runtimelinking" = yes; then +- # Warning - without using the other runtime loading flags (-brtl), +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +- else +- if test "$host_cpu" = ia64; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" +- else +- # Determine the default libpath from the value encoded in an empty executable. +- _LT_AC_SYS_LIBPATH_AIX +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- # Warning - without using the other run time loading flags, +- # -berok will link without error, but may produce a broken library. +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' +- # Exported symbols can be pulled into shared objects from archives +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- # This is similar to how AIX traditionally builds its shared libraries. +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' +- fi +- fi +- ;; +- +- amigaos*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- # see comment about different semantics on the GNU ld section +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- +- bsdi[[45]]*) +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic +- ;; +- +- cygwin* | mingw* | pw32*) +- # When not using gcc, we currently assume that we are using +- # Microsoft Visual C++. +- # hardcode_libdir_flag_spec is actually meaningless, as there is +- # no search path for DLLs. +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Tell ltmain to make .lib files, not .a files. +- libext=lib +- # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" +- # FIXME: Setting linknames here is a bad hack. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' +- # The linker will automatically build a .lib file if we build a DLL. +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' +- # FIXME: Should let the user specify the lib program. +- _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' +- _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' +- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- ;; +- +- darwin* | rhapsody*) +- case $host_os in +- rhapsody* | darwin1.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' +- ;; +- *) # Darwin 1.3 on +- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- else +- case ${MACOSX_DEPLOYMENT_TARGET} in +- 10.[[012]]) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' +- ;; +- 10.*) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' +- ;; +- esac +- fi +- ;; +- esac +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- if test "$GCC" = yes ; then +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" +- _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" +- _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" +- else +- case $cc_basename in +- xlc*) +- output_verbose_link_cmd='echo' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' +- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' +- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' +- ;; +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +- ;; +- +- dgux*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- freebsd1*) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- +- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor +- # support. Future versions do this automatically, but an explicit c++rt0.o +- # does not break anything, and helps significantly (at the cost of a little +- # extra space). +- freebsd2.2*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- # Unfortunately, older versions of FreeBSD 2 do not have this feature. +- freebsd2*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- # FreeBSD 3 and greater uses gcc -shared to do shared libraries. +- freebsd* | dragonfly*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- hpux9*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- ;; +- +- hpux10*) +- if test "$GCC" = yes -a "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +- fi +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- fi +- ;; +- +- hpux11*) +- if test "$GCC" = yes -a "$with_gnu_ld" = no; then +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- else +- case $host_cpu in +- hppa*64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- ia64*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +- ;; +- esac +- fi +- if test "$with_gnu_ld" = no; then +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- +- case $host_cpu in +- hppa*64*|ia64*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- *) +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- +- # hardcode_minus_L: Not really in the search PATH, +- # but as the default location of the library. +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- ;; +- esac +- fi +- ;; +- +- irix5* | irix6* | nonstopux*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; +- +- netbsd* | netbsdelf*-gnu) +- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- newsos6) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- openbsd*) +- if test -f /usr/libexec/ld.so; then +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- else +- case $host_os in +- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- ;; +- *) +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- ;; +- esac +- fi +- else +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; +- +- os2*) +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' +- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' +- ;; +- +- osf3*) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- else +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- ;; +- +- osf4* | osf5*) # as osf3* with the addition of -msym flag +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- else +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ +- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' +- +- # Both c and cxx compiler support -rpath directly +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: +- ;; +- +- solaris*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' +- if test "$GCC" = yes; then +- wlarc='${wl}' +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' +- else +- wlarc='' +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ +- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- case $host_os in +- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; +- *) +- # The compiler driver will combine and reorder linker options, +- # but understands `-z linker_flag'. GCC discards it without `$wl', +- # but is careful enough not to reorder. +- # Supported since Solaris 2.6 (maybe 2.5.1?) +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' +- else +- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' +- fi +- ;; +- esac +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- ;; +- +- sunos4*) +- if test "x$host_vendor" = xsequent; then +- # Use $CC to link under sequent, because it throws in some extra .o +- # files that make .init and .fini sections work. +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' +- fi +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes +- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- sysv4) +- case $host_vendor in +- sni) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? +- ;; +- siemens) +- ## LD is ld it makes a PLAMLIB +- ## CC just makes a GrossModule. +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no +- ;; +- motorola) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie +- ;; +- esac +- runpath_var='LD_RUN_PATH' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- sysv4.3*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' +- ;; +- +- sysv4*MP*) +- if test -d /usr/nec; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var=LD_RUN_PATH +- hardcode_runpath_var=yes +- _LT_AC_TAGVAR(ld_shlibs, $1)=yes +- fi +- ;; +- +- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- runpath_var='LD_RUN_PATH' +- +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- fi +- ;; +- +- sysv5* | sco3.2v5* | sco5v6*) +- # Note: We can NOT use -z defs as we might desire, because we do not +- # link with -lc, and that would cause any symbols used from libc to +- # always be unresolved, which means just about no library would +- # ever link correctly. If we're not using GNU ld we use -z text +- # though, which does catch some bad symbols but isn't as heavy-handed +- # as -z defs. +- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' +- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' +- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' +- runpath_var='LD_RUN_PATH' +- +- if test "$GCC" = yes; then +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- else +- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' +- fi +- ;; +- +- uts4*) +- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +- ;; +- +- *) +- _LT_AC_TAGVAR(ld_shlibs, $1)=no +- ;; +- esac +- fi +-]) +-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no +- +-# +-# Do we need to explicitly link libc? +-# +-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +-x|xyes) +- # Assume -lc should be added +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- +- if test "$enable_shared" = yes && test "$GCC" = yes; then +- case $_LT_AC_TAGVAR(archive_cmds, $1) in +- *'~'*) +- # FIXME: we may have to deal with multi-command sequences. +- ;; +- '$CC '*) +- # Test whether the compiler implicitly links with -lc since on some +- # systems, -lgcc has to come before -lc. If gcc already passes -lc +- # to ld, don't add -lc before -lgcc. +- AC_MSG_CHECKING([whether -lc should be explicitly linked in]) +- $rm conftest* +- echo "$lt_simple_compile_test_code" > conftest.$ac_ext +- +- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then +- soname=conftest +- lib=conftest +- libobjs=conftest.$ac_objext +- deplibs= +- wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) +- pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +- compiler_flags=-v +- linker_flags=-v +- verstring= +- output_objdir=. +- libname=conftest +- lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) +- _LT_AC_TAGVAR(allow_undefined_flag, $1)= +- if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) +- then +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +- else +- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +- fi +- _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag +- else +- cat conftest.err 1>&5 +- fi +- $rm conftest* +- AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) +- ;; +- esac +- fi +- ;; +-esac +-])# AC_LIBTOOL_PROG_LD_SHLIBS +- +- +-# _LT_AC_FILE_LTDLL_C +-# ------------------- +-# Be careful that the start marker always follows a newline. +-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +-# /* ltdll.c starts here */ +-# #define WIN32_LEAN_AND_MEAN +-# #include +-# #undef WIN32_LEAN_AND_MEAN +-# #include +-# +-# #ifndef __CYGWIN__ +-# # ifdef __CYGWIN32__ +-# # define __CYGWIN__ __CYGWIN32__ +-# # endif +-# #endif +-# +-# #ifdef __cplusplus +-# extern "C" { +-# #endif +-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +-# #ifdef __cplusplus +-# } +-# #endif +-# +-# #ifdef __CYGWIN__ +-# #include +-# DECLARE_CYGWIN_DLL( DllMain ); +-# #endif +-# HINSTANCE __hDllInstance_base; +-# +-# BOOL APIENTRY +-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +-# { +-# __hDllInstance_base = hInst; +-# return TRUE; +-# } +-# /* ltdll.c ends here */ +-])# _LT_AC_FILE_LTDLL_C +- +- +-# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +-# --------------------------------- +-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) +- +- +-# old names +-AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +-AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +-AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +-AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +-AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) +- +-# This is just to silence aclocal about the macro not being used +-ifelse([AC_DISABLE_FAST_INSTALL]) +- +-AC_DEFUN([LT_AC_PROG_GCJ], +-[AC_CHECK_TOOL(GCJ, gcj, no) +- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" +- AC_SUBST(GCJFLAGS) +-]) +- +-AC_DEFUN([LT_AC_PROG_RC], +-[AC_CHECK_TOOL(RC, windres, no) +-]) +- +- +-# Cheap backport of AS_EXECUTABLE_P and required macros +-# from Autoconf 2.59; we should not use $as_executable_p directly. +- +-# _AS_TEST_PREPARE +-# ---------------- +-m4_ifndef([_AS_TEST_PREPARE], +-[m4_defun([_AS_TEST_PREPARE], +-[if test -x / >/dev/null 2>&1; then +- as_executable_p='test -x' +-else +- as_executable_p='test -f' +-fi +-])])# _AS_TEST_PREPARE +- +-# AS_EXECUTABLE_P +-# --------------- +-# Check whether a file is executable. +-m4_ifndef([AS_EXECUTABLE_P], +-[m4_defun([AS_EXECUTABLE_P], +-[AS_REQUIRE([_AS_TEST_PREPARE])dnl +-$as_executable_p $1[]dnl +-])])# AS_EXECUTABLE_P +- +-# NOTE: This macro has been submitted for inclusion into # +-# GNU Autoconf as AC_PROG_SED. When it is available in # +-# a released version of Autoconf we should remove this # +-# macro and use it instead. # +-# LT_AC_PROG_SED +-# -------------- +-# Check for a fully-functional sed program, that truncates +-# as few characters as possible. Prefer GNU sed if found. +-AC_DEFUN([LT_AC_PROG_SED], +-[AC_MSG_CHECKING([for a sed that does not truncate output]) +-AC_CACHE_VAL(lt_cv_path_SED, +-[# Loop through the user's path and test for sed and gsed. +-# Then use that list of sed's as ones to test for truncation. +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for lt_ac_prog in sed gsed; do +- for ac_exec_ext in '' $ac_executable_extensions; do +- if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then +- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" +- fi +- done +- done +-done +-IFS=$as_save_IFS +-lt_ac_max=0 +-lt_ac_count=0 +-# Add /usr/xpg4/bin/sed as it is typically found on Solaris +-# along with /bin/sed that truncates output. +-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do +- test ! -f $lt_ac_sed && continue +- cat /dev/null > conftest.in +- lt_ac_count=0 +- echo $ECHO_N "0123456789$ECHO_C" >conftest.in +- # Check for GNU sed and select it if it is found. +- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then +- lt_cv_path_SED=$lt_ac_sed +- break +- fi +- while true; do +- cat conftest.in conftest.in >conftest.tmp +- mv conftest.tmp conftest.in +- cp conftest.in conftest.nl +- echo >>conftest.nl +- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break +- cmp -s conftest.out conftest.nl || break +- # 10000 chars as input seems more than enough +- test $lt_ac_count -gt 10 && break +- lt_ac_count=`expr $lt_ac_count + 1` +- if test $lt_ac_count -gt $lt_ac_max; then +- lt_ac_max=$lt_ac_count +- lt_cv_path_SED=$lt_ac_sed +- fi +- done +-done +-]) +-SED=$lt_cv_path_SED +-AC_SUBST([SED]) +-AC_MSG_RESULT([$SED]) +-]) +- + # Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation diff --git a/net/stunnel/patches/100-cross-compile.patch b/net/stunnel/patches/100-cross-compile.patch new file mode 100644 index 0000000..5ce3c35 --- /dev/null +++ b/net/stunnel/patches/100-cross-compile.patch @@ -0,0 +1,126 @@ +--- a/configure ++++ b/configure +@@ -21552,56 +21552,56 @@ _ACEOF + fi + rm -f conftest* + +- +-{ echo "$as_me:$LINENO: **************************************** PTY device files" >&5 +-echo "$as_me: **************************************** PTY device files" >&6;} +-{ echo "$as_me:$LINENO: checking for \"/dev/ptmx\"" >&5 +-echo $ECHO_N "checking for \"/dev/ptmx\"... $ECHO_C" >&6; } +-if test "${ac_cv_file___dev_ptmx_+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- test "$cross_compiling" = yes && +- { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} +- { (exit 1); exit 1; }; } +-if test -r ""/dev/ptmx""; then +- ac_cv_file___dev_ptmx_=yes +-else +- ac_cv_file___dev_ptmx_=no +-fi +-fi +-{ echo "$as_me:$LINENO: result: $ac_cv_file___dev_ptmx_" >&5 +-echo "${ECHO_T}$ac_cv_file___dev_ptmx_" >&6; } +-if test $ac_cv_file___dev_ptmx_ = yes; then ++# ++#{ echo "$as_me:$LINENO: **************************************** PTY device files" >&5 ++#echo "$as_me: **************************************** PTY device files" >&6;} ++#{ echo "$as_me:$LINENO: checking for \"/dev/ptmx\"" >&5 ++#echo $ECHO_N "checking for \"/dev/ptmx\"... $ECHO_C" >&6; } ++#if test "${ac_cv_file___dev_ptmx_+set}" = set; then ++# echo $ECHO_N "(cached) $ECHO_C" >&6 ++#else ++# test "$cross_compiling" = yes && ++# { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 ++#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} ++# { (exit 1); exit 1; }; } ++#if test -r ""/dev/ptmx""; then ++# ac_cv_file___dev_ptmx_=yes ++#else ++# ac_cv_file___dev_ptmx_=no ++#fi ++#fi ++#{ echo "$as_me:$LINENO: result: $ac_cv_file___dev_ptmx_" >&5 ++#echo "${ECHO_T}$ac_cv_file___dev_ptmx_" >&6; } ++#if test $ac_cv_file___dev_ptmx_ = yes; then + cat >>confdefs.h <<\_ACEOF +-#define HAVE_DEV_PTMX 1 ++#define HAVE_DEV_PTMX 0 + _ACEOF + +-fi ++#fi + +-{ echo "$as_me:$LINENO: checking for \"/dev/ptc\"" >&5 +-echo $ECHO_N "checking for \"/dev/ptc\"... $ECHO_C" >&6; } +-if test "${ac_cv_file___dev_ptc_+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- test "$cross_compiling" = yes && +- { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} +- { (exit 1); exit 1; }; } +-if test -r ""/dev/ptc""; then +- ac_cv_file___dev_ptc_=yes +-else +- ac_cv_file___dev_ptc_=no +-fi +-fi +-{ echo "$as_me:$LINENO: result: $ac_cv_file___dev_ptc_" >&5 +-echo "${ECHO_T}$ac_cv_file___dev_ptc_" >&6; } +-if test $ac_cv_file___dev_ptc_ = yes; then ++#{ echo "$as_me:$LINENO: checking for \"/dev/ptc\"" >&5 ++#echo $ECHO_N "checking for \"/dev/ptc\"... $ECHO_C" >&6; } ++#if test "${ac_cv_file___dev_ptc_+set}" = set; then ++# echo $ECHO_N "(cached) $ECHO_C" >&6 ++#else ++# test "$cross_compiling" = yes && ++# { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 ++#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} ++# { (exit 1); exit 1; }; } ++#if test -r ""/dev/ptc""; then ++# ac_cv_file___dev_ptc_=yes ++#else ++# ac_cv_file___dev_ptc_=no ++#fi ++#fi ++#{ echo "$as_me:$LINENO: result: $ac_cv_file___dev_ptc_" >&5 ++#echo "${ECHO_T}$ac_cv_file___dev_ptc_" >&6; } ++#if test $ac_cv_file___dev_ptc_ = yes; then + cat >>confdefs.h <<\_ACEOF +-#define HAVE_DEV_PTS_AND_PTC 1 ++#define HAVE_DEV_PTS_AND_PTC 0 + _ACEOF + +-fi ++#fi + + + { echo "$as_me:$LINENO: **************************************** entropy" >&5 +@@ -24049,8 +24049,8 @@ _ACEOF + + + # Add SSL includes and libraries +-CFLAGS="$CFLAGS -I$ssldir/include" +-LIBS="$LIBS -L$ssldir/lib -lssl -lcrypto" ++CFLAGS="$CFLAGS" ++LIBS="$LIBS -lssl -lcrypto" + + # Check for obsolete RSAref library + { echo "$as_me:$LINENO: checking for obsolete RSAref library" >&5 +--- a/configure.ac ++++ b/configure.ac +@@ -44,10 +44,6 @@ AC_EGREP_HEADER(socklen_t, sys/socket.h, + AC_MSG_RESULT([no (defined as int)]) + AC_DEFINE(socklen_t, int)) + +-AC_MSG_NOTICE([**************************************** PTY device files]) +-AC_CHECK_FILE("/dev/ptmx", AC_DEFINE(HAVE_DEV_PTMX)) +-AC_CHECK_FILE("/dev/ptc", AC_DEFINE(HAVE_DEV_PTS_AND_PTC)) +- + AC_MSG_NOTICE([**************************************** entropy]) + + AC_ARG_WITH(egd-socket, diff --git a/net/stunnel/patches/101-no-comp.patch b/net/stunnel/patches/101-no-comp.patch new file mode 100644 index 0000000..9fbe22c --- /dev/null +++ b/net/stunnel/patches/101-no-comp.patch @@ -0,0 +1,28 @@ +--- a/src/ssl.c ++++ b/src/ssl.c +@@ -72,14 +72,17 @@ int ssl_configure(void) { /* configure g + s_log(LOG_NOTICE, "FIPS mode %s", + global_options.option.fips ? "enabled" : "disabled"); + #endif /* USE_FIPS */ ++#ifndef OPENSSL_NO_COMP + if(global_options.compression!=COMP_NONE && !init_compression()) + return 0; ++#endif + if(!init_prng()) + return 0; + s_log(LOG_DEBUG, "PRNG seeded successfully"); + return 1; /* SUCCESS */ + } + ++#ifndef OPENSSL_NO_COMP + static int init_compression(void) { + int id=0; + COMP_METHOD *cm=NULL; +@@ -111,6 +114,7 @@ static int init_compression(void) { + s_log(LOG_INFO, "Compression enabled using %s method", name); + return 1; + } ++#endif + + static int init_prng(void) { + int totbytes=0; diff --git a/net/stunnel/patches/102-no-ssl2.patch b/net/stunnel/patches/102-no-ssl2.patch new file mode 100644 index 0000000..e94184b --- /dev/null +++ b/net/stunnel/patches/102-no-ssl2.patch @@ -0,0 +1,13 @@ +--- a/src/options.c ++++ b/src/options.c +@@ -1234,8 +1234,10 @@ static char *parse_service_option(CMD cm + section->client_method=(SSL_METHOD *)SSLv23_client_method(); + section->server_method=(SSL_METHOD *)SSLv23_server_method(); + } else if(!strcasecmp(arg, "SSLv2")) { ++#ifndef OPENSSL_NO_SSL2 + section->client_method=(SSL_METHOD *)SSLv2_client_method(); + section->server_method=(SSL_METHOD *)SSLv2_server_method(); ++#endif + } else if(!strcasecmp(arg, "SSLv3")) { + section->client_method=(SSL_METHOD *)SSLv3_client_method(); + section->server_method=(SSL_METHOD *)SSLv3_server_method(); diff --git a/net/stunnel/patches/103-no-zlib-link.patch b/net/stunnel/patches/103-no-zlib-link.patch new file mode 100644 index 0000000..f627c53 --- /dev/null +++ b/net/stunnel/patches/103-no-zlib-link.patch @@ -0,0 +1,12 @@ +Avoid linking with zlib, which is a dependency of openssl, not ours. +--- a/configure ++++ b/configure +@@ -23017,7 +23017,7 @@ if test $ac_cv_lib_z_inflateEnd = yes; t + #define HAVE_LIBZ 1 + _ACEOF + +- LIBS="-lz $LIBS" ++# LIBS="-lz $LIBS" + + fi + diff --git a/net/stunnel/patches/104-fix-paths.patch b/net/stunnel/patches/104-fix-paths.patch new file mode 100644 index 0000000..aad310b --- /dev/null +++ b/net/stunnel/patches/104-fix-paths.patch @@ -0,0 +1,42 @@ +## Do several path fixups, removing unneeded @prefix@s +--- a/tools/stunnel.conf-sample.in ++++ b/tools/stunnel.conf-sample.in +@@ -4,15 +4,15 @@ + ; please read the manual and make sure you understand them + + ; certificate/key is needed in server mode and optional in client mode +-cert = @prefix@/etc/stunnel/mail.pem +-;key = @prefix@/etc/stunnel/mail.pem ++cert = @sysconfdir@/stunnel/stunnel.pem ++;key = @sysconfdir@/stunnel/stunnel.pem + + ; protocol version (all, SSLv2, SSLv3, TLSv1) + sslVersion = SSLv3 + + ; security enhancements for UNIX systems - comment them out on Win32 + ; for chroot a copy of some devices and files is needed within the jail +-chroot = @prefix@/var/lib/stunnel/ ++chroot = @localstatedir@ + setuid = nobody + setgid = @DEFAULT_GROUP@ + ; PID is created inside the chroot jail +@@ -33,16 +33,16 @@ socket = r:TCP_NODELAY=1 + ; CApath is located inside chroot jail + ;CApath = /certs + ; it's often easier to use CAfile +-;CAfile = @prefix@/etc/stunnel/certs.pem ++;CAfile = @sysconfdir@/stunnel/certs.pem + ; don't forget to c_rehash CRLpath + ; CRLpath is located inside chroot jail + ;CRLpath = /crls + ; alternatively CRLfile can be used +-;CRLfile = @prefix@/etc/stunnel/crls.pem ++;CRLfile = @sysconfdir@/stunnel/crls.pem + + ; debugging stuff (may useful for troubleshooting) + ;debug = 7 +-;output = stunnel.log ++;output = @localstatedir@/log/stunnel.log + + ; SSL client mode + ;client = yes diff --git a/net/stunnel/patches/105-stunnel-conf.patch b/net/stunnel/patches/105-stunnel-conf.patch new file mode 100644 index 0000000..c22e0b4 --- /dev/null +++ b/net/stunnel/patches/105-stunnel-conf.patch @@ -0,0 +1,54 @@ +--- a/tools/stunnel.conf-sample.in ++++ b/tools/stunnel.conf-sample.in +@@ -8,7 +8,7 @@ cert = @sysconfdir@/stunnel/stunnel.pem + ;key = @sysconfdir@/stunnel/stunnel.pem + + ; protocol version (all, SSLv2, SSLv3, TLSv1) +-sslVersion = SSLv3 ++sslVersion = all + + ; security enhancements for UNIX systems - comment them out on Win32 + ; for chroot a copy of some devices and files is needed within the jail +@@ -49,21 +49,26 @@ socket = r:TCP_NODELAY=1 + + ; service-level configuration + +-[pop3s] +-accept = 995 +-connect = 110 +- +-[imaps] +-accept = 993 +-connect = 143 +- +-[ssmtp] +-accept = 465 +-connect = 25 +- +-;[https] +-;accept = 443 +-;connect = 80 +-;TIMEOUTclose = 0 ++;[pop3s] ++;accept = 995 ++;connect = 110 ++ ++;[imaps] ++;accept = 993 ++;connect = 143 ++ ++;[ssmtp] ++;accept = 465 ++;connect = 25 ++ ++[https] ++accept = 443 ++connect = 80 ++TIMEOUTclose = 0 ++ ++[chilli] ++accept = 3443 ++connect = 3442 ++TIMEOUTclose = 0 + + ; vim:ft=dosini diff --git a/net/stunnel/patches/106-stunnel-xforwardedfor.patch b/net/stunnel/patches/106-stunnel-xforwardedfor.patch new file mode 100644 index 0000000..497ff6d --- /dev/null +++ b/net/stunnel/patches/106-stunnel-xforwardedfor.patch @@ -0,0 +1,248 @@ +--- a/doc/stunnel.8 ++++ b/doc/stunnel.8 +@@ -504,7 +504,10 @@ time to keep an idle connection + .IP "\fBtransparent\fR = yes | no (Unix only)" 4 + .IX Item "transparent = yes | no (Unix only)" + transparent proxy mode +-.Sp ++.IP "\fBxforwardedfor\fR = yes | no" 4 ++.IX Item "xforwardedfor = yes | no" ++append an 'X-Forwarded-For:' HTTP request header providing the ++client's IP address to the server. + Re-write address to appear as if wrapped daemon is connecting + from the \s-1SSL\s0 client machine instead of the machine running \fBstunnel\fR. + .Sp +--- a/doc/stunnel.fr.8 ++++ b/doc/stunnel.fr.8 +@@ -445,6 +445,10 @@ Cette option permet de relier une adress + Négocie avec \s-1SSL\s0 selon le protocole indiqué + .Sp + Actuellement gérés\ : cifs, nntp, pop3, smtp ++.IP "\fBxforwardedfor\fR = yes | no" 4 ++.IX Item "xforwardedfor = yes | no" ++Ajoute un en-tête 'X-Forwarded-For:' dans la requête HTTP fournissant ++au serveur l'adresse IP du client. + .IP "\fBpty\fR = yes | no (Unix seulement)" 4 + .IX Item "pty = yes | no (Unix seulement)" + Alloue un pseudo-terminal pour l'option «\ exec\ » +--- a/src/client.c ++++ b/src/client.c +@@ -86,6 +86,12 @@ CLI *alloc_client_session(SERVICE_OPTION + return NULL; + } + c->opt=opt; ++ /* some options need space to add some information */ ++ if (c->opt->option.xforwardedfor) ++ c->buffsize = BUFFSIZE - BUFF_RESERVED; ++ else ++ c->buffsize = BUFFSIZE; ++ c->crlf_seen=0; + c->local_rfd.fd=rfd; + c->local_wfd.fd=wfd; + return c; +@@ -376,6 +382,29 @@ static void init_ssl(CLI *c) { + } + } + ++/* Moves all data from the buffer between positions and ++ * to insert of length . and are updated to their ++ * new respective values, and the number of characters inserted is returned. ++ * If is too long, nothing is done and -1 is returned. ++ * Note that neither nor can be NULL. ++*/ ++static int buffer_insert_with_len(char *buffer, int *start, int *stop, int limit, char *string, int len) { ++ if (len > limit - *stop) ++ return -1; ++ if (*start > *stop) ++ return -1; ++ memmove(buffer + *start + len, buffer + *start, *stop - *start); ++ memcpy(buffer + *start, string, len); ++ *start += len; ++ *stop += len; ++ return len; ++} ++ ++static int buffer_insert(char *buffer, int *start, int *stop, int limit, char *string) { ++ return buffer_insert_with_len(buffer, start, stop, limit, string, strlen(string)); ++} ++ ++ + /****************************** some defines for transfer() */ + /* is socket/SSL open for read/write? */ + #define sock_rd (c->sock_rfd->rd) +@@ -410,13 +439,16 @@ static void transfer(CLI *c) { + check_SSL_pending=0; + + SSL_read_wants_read= +- ssl_rd && c->ssl_ptrssl_ptrssl_ptrbuffsize && !SSL_read_wants_write; ++ + SSL_write_wants_write= + ssl_wr && c->sock_ptr && !SSL_write_wants_read; + + /****************************** setup c->fds structure */ + s_poll_init(&c->fds); /* initialize the structure */ +- if(sock_rd && c->sock_ptrsock_ptrsock_ptrbuffsize) + s_poll_add(&c->fds, c->sock_rfd->fd, 1, 0); + if(SSL_read_wants_read || + SSL_write_wants_read || +@@ -515,7 +547,8 @@ static void transfer(CLI *c) { + break; + default: + memmove(c->ssl_buff, c->ssl_buff+num, c->ssl_ptr-num); +- if(c->ssl_ptr==BUFFSIZE) /* buffer was previously full */ ++ //if(c->ssl_ptr==BUFFSIZE) /* buffer was previously full */ ++ if(c->ssl_ptr>=c->buffsize) /* buffer was previously full */ + check_SSL_pending=1; /* check for data buffered by SSL */ + c->ssl_ptr-=num; + c->sock_bytes+=num; +@@ -577,7 +610,8 @@ static void transfer(CLI *c) { + /****************************** read from socket */ + if(sock_rd && sock_can_rd) { + num=readsocket(c->sock_rfd->fd, +- c->sock_buff+c->sock_ptr, BUFFSIZE-c->sock_ptr); ++ //c->sock_buff+c->sock_ptr, BUFFSIZE-c->sock_ptr); ++ c->sock_buff+c->sock_ptr, c->buffsize-c->sock_ptr); + switch(num) { + case -1: + parse_socket_error(c, "readsocket"); +@@ -597,10 +631,73 @@ static void transfer(CLI *c) { + (SSL_read_wants_write && ssl_can_wr) || + (check_SSL_pending && SSL_pending(c->ssl))) { + SSL_read_wants_write=0; +- num=SSL_read(c->ssl, c->ssl_buff+c->ssl_ptr, BUFFSIZE-c->ssl_ptr); ++ //num=SSL_read(c->ssl, c->ssl_buff+c->ssl_ptr, BUFFSIZE-c->ssl_ptr); ++ num=SSL_read(c->ssl, c->ssl_buff+c->ssl_ptr, c->buffsize-c->ssl_ptr); + switch(err=SSL_get_error(c->ssl, num)) { + case SSL_ERROR_NONE: ++ //c->ssl_ptr+=num; ++ if (c->buffsize != BUFFSIZE && c->opt->option.xforwardedfor) { /* some work left to do */ ++ int last = c->ssl_ptr; ++ c->ssl_ptr += num; ++ ++ /* Look for end of HTTP headers between last and ssl_ptr. ++ * To achieve this reliably, we have to count the number of ++ * successive [CR]LF and to memorize it in case it's spread ++ * over multiple segments. --WT. ++ */ ++ while (last < c->ssl_ptr) { ++ if (c->ssl_buff[last] == '\n') { ++ if (++c->crlf_seen == 2) ++ break; ++ } else if (last < c->ssl_ptr - 1 && ++ c->ssl_buff[last] == '\r' && ++ c->ssl_buff[last+1] == '\n') { ++ if (++c->crlf_seen == 2) ++ break; ++ last++; ++ } else if (c->ssl_buff[last] != '\r') ++ /* don't refuse '\r' because we may get a '\n' on next read */ ++ c->crlf_seen = 0; ++ last++; ++ } ++ if (c->crlf_seen >= 2) { ++ /* We have all the HTTP headers now. We don't need to ++ * reserve any space anymore. points to the ++ * first byte of unread data, and points to the ++ * exact location where we want to insert our headers, ++ * which is right before the empty line. ++ */ ++ c->buffsize = BUFFSIZE; ++ ++ if (c->opt->option.xforwardedfor) { ++ /* X-Forwarded-For: xxxx \r\n\0 */ ++ char xforw[17 + IPLEN + 3]; ++ ++ /* We will insert our X-Forwarded-For: header here. ++ * We need to write the IP address, but if we use ++ * sprintf, it will pad with the terminating 0. ++ * So we will pass via a temporary buffer allocated ++ * on the stack. ++ */ ++ memcpy(xforw, "X-Forwarded-For: ", 17); ++ if (getnameinfo(&c->peer_addr.addr[0].sa, ++ addr_len(c->peer_addr.addr[0]), ++ xforw + 17, IPLEN, NULL, 0, ++ NI_NUMERICHOST) == 0) { ++ strcat(xforw + 17, "\r\n"); ++ buffer_insert(c->ssl_buff, &last, &c->ssl_ptr, ++ c->buffsize, xforw); ++ } ++ /* last still points to the \r\n and ssl_ptr to the ++ * end of the buffer, so we may add as many headers ++ * as wee need to. ++ */ ++ } ++ } ++ } ++ else + c->ssl_ptr+=num; ++ + watchdog=0; /* reset watchdog */ + break; + case SSL_ERROR_WANT_WRITE: +--- a/src/common.h ++++ b/src/common.h +@@ -53,6 +53,9 @@ + /* I/O buffer size */ + #define BUFFSIZE 16384 + ++/* maximum space reserved for header insertion in BUFFSIZE */ ++#define BUFF_RESERVED 1024 ++ + /* length of strings (including the terminating '\0' character) */ + /* it can't be lower than 256 bytes or NTLM authentication will break */ + #define STRLEN 256 +--- a/src/options.c ++++ b/src/options.c +@@ -792,6 +792,28 @@ static char *parse_service_option(CMD cm + } + #endif + ++ /* xforwardedfor */ ++ switch(cmd) { ++ case CMD_INIT: ++ section->option.xforwardedfor=0; ++ break; ++ case CMD_EXEC: ++ if(strcasecmp(opt, "xforwardedfor")) ++ break; ++ if(!strcasecmp(arg, "yes")) ++ section->option.xforwardedfor=1; ++ else if(!strcasecmp(arg, "no")) ++ section->option.xforwardedfor=0; ++ else ++ return "argument should be either 'yes' or 'no'"; ++ return NULL; /* OK */ ++ case CMD_DEFAULT: ++ break; ++ case CMD_HELP: ++ s_log("%-15s = yes|no append an HTTP X-Forwarded-For header","xforwardedfor"); ++ break; ++ } ++ + /* exec */ + switch(cmd) { + case CMD_INIT: +--- a/src/prototypes.h ++++ b/src/prototypes.h +@@ -177,6 +177,7 @@ typedef struct service_options_struct { + unsigned int remote:1; + unsigned int retry:1; /* loop remote+program */ + unsigned int sessiond:1; ++ unsigned int xforwardedfor:1; + unsigned int program:1; + #ifndef USE_WIN32 + unsigned int pty:1; +@@ -351,6 +352,8 @@ typedef struct { + FD *ssl_rfd, *ssl_wfd; /* read and write SSL descriptors */ + int sock_bytes, ssl_bytes; /* bytes written to socket and ssl */ + s_poll_set fds; /* file descriptors */ ++ int buffsize; /* current buffer size, may be lower than BUFFSIZE */ ++ int crlf_seen; /* the number of successive CRLF seen */ + } CLI; + + extern int max_fds, max_clients; diff --git a/net/subversion/Makefile b/net/subversion/Makefile new file mode 100644 index 0000000..d7523cc --- /dev/null +++ b/net/subversion/Makefile @@ -0,0 +1,129 @@ +# +# Copyright (C) 2007-2011 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_VERSION:=1.6.17 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://subversion.tigris.org/downloads +PKG_MD5SUM:=81e5dc5beee4b3fc025ac70c0b6caa14 + +PKG_FIXUP:=autoreconf +PKG_MACRO_PATHS:=build/ac-macros + +include $(INCLUDE_DIR)/package.mk + +define Package/subversion/Default + SECTION:=net + CATEGORY:=Network + TITLE:=A compelling replacement for CVS + DEPENDS:=+zlib +libneon +libaprutil + URL:=http://subversion.apache.org/ + SUBMENU:=Version Control Systems +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) + DEPENDS+=+unixodbc + 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 + +CONFIGURE_ARGS += \ + --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \ + --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \ + --with-neon="$(STAGING_DIR)/usr" \ + --disable-mod-activation \ + --without-ruby-sitedir \ + --without-swig \ + --with-jikes=no \ + --without-junit \ + --without-berkeley-db \ + --with-ssl \ + --disable-neon-version-check \ + --with-apxs=no \ + --without-sasl \ + +CONFIGURE_VARS += \ + svn_lib_neon=yes \ + LDFLAGS="$(TARGET_LDFLAGS) -lcrypt -lm \ + -lz -lpthread -L$(TOOLCHAIN_DIR)/usr/lib \ + -L$(TOOLCHAIN_DIR)/lib" \ + 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 + +$(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 index 0000000..3297c8d --- /dev/null +++ b/net/subversion/files/subversion.config @@ -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 index 0000000..c2bcc07 --- /dev/null +++ b/net/subversion/files/subversion.init @@ -0,0 +1,37 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 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 /srv" + echo " svnadmin create --fs-type fsfs /srv/svn" + 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/synce-dccm/Makefile b/net/synce-dccm/Makefile new file mode 100644 index 0000000..d8e25f4 --- /dev/null +++ b/net/synce-dccm/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=synce-dccm +PKG_VERSION:=0.9.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/synce +PKG_MD5SUM:=8818b71133049fe9c739166225aebe0c + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/synce-dccm + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libsynce $(ICONV_DEPENDS) + TITLE:=dccm for mobiles + URL:=http://sourceforge.net/projects/synce/ +endef + +define Package/synce-dccm/description +Description TBD +endef + +CONFIGURE_VARS+= \ + CPPFLAGS="$$$$CPPFLAGS -I$(ICONV_PREFIX)/include" \ + CPPFLAGS="$$$$CPPFLAGS -I$(INTL_PREFIX)/include" \ + CPPFLAGS="$$$$CPPFLAGS -Wl,-rpath-link,$(STAGING_DIR)/usr/lib:$(ICONV_PREFIX)/lib:$(INTL_PREFIX)/lib" + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + LDFLAGS="$(TARGET_LDFLAGS) -L$(ICONV_PREFIX)/lib" \ + LIBS="-lsynce -liconv" \ + all install +endef + +define Package/synce-dccm/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dccm $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,synce-dccm)) +#LIBS="-Wl,-Bstatic,-lsynce,-Bdynamic,-liconv" \ diff --git a/net/tcpdump/Makefile b/net/tcpdump/Makefile new file mode 100644 index 0000000..fa3e51a --- /dev/null +++ b/net/tcpdump/Makefile @@ -0,0 +1,84 @@ +# +# Copyright (C) 2007-2011 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:=tcpdump +PKG_VERSION:=4.2.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.tcpdump.org/release/ \ + http://ftp.gwdg.de/pub/misc/tcpdump/ \ + http://www.at.tcpdump.org/ \ + http://www.br.tcpdump.org/ +PKG_MD5SUM:=c202878c6db054767b52651041b9e60e + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_PARALLEL:=1 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/tcpdump/default + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap + TITLE:=Network monitoring and data acquisition tool + URL:=http://www.tcpdump.org/ +endef + +define Package/tcpdump + $(Package/tcpdump/default) + VARIANT:=full +endef + +define Package/tcpdump-mini + $(Package/tcpdump/default) + TITLE+= (minimal version) + VARIANT:=mini +endef + +CONFIGURE_ARGS += \ + --without-crypto + +ifeq ($(CONFIG_IPV6),y) +CONFIGURE_ARGS += \ + --enable-ipv6 +endif + +CONFIGURE_VARS += \ + BUILD_CC="$(TARGET_CC)" \ + HOSTCC="$(HOSTCC)" \ + td_cv_buggygetaddrinfo="no" \ + ac_cv_linux_vers=$(LINUX_VERSION) \ + ac_cv_header_rpc_rpcent_h=no \ + ac_cv_lib_rpc_main=no \ + ac_cv_path_PCAP_CONFIG="" + +MAKE_FLAGS := + +ifeq ($(BUILD_VARIANT),mini) + TARGET_CFLAGS += -DTCPDUMP_MINI + CONFIGURE_ARGS += --disable-smb + MAKE_FLAGS += TCPDUMP_MINI=1 +endif + +MAKE_FLAGS += \ + CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)" + + +define Package/tcpdump/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tcpdump $(1)/usr/sbin/ +endef + +Package/tcpdump-mini/install = $(Package/tcpdump/install) + +$(eval $(call BuildPackage,tcpdump)) +$(eval $(call BuildPackage,tcpdump-mini)) diff --git a/net/tcpdump/patches/001-remove_pcap_debug.patch b/net/tcpdump/patches/001-remove_pcap_debug.patch new file mode 100644 index 0000000..14d1b84 --- /dev/null +++ b/net/tcpdump/patches/001-remove_pcap_debug.patch @@ -0,0 +1,23 @@ +--- a/tcpdump.c ++++ b/tcpdump.c +@@ -982,20 +982,6 @@ main(int argc, char **argv) + error("invalid data link type %s", gndo->ndo_dltname); + break; + +-#if defined(HAVE_PCAP_DEBUG) || defined(HAVE_YYDEBUG) +- case 'Y': +- { +- /* Undocumented flag */ +-#ifdef HAVE_PCAP_DEBUG +- extern int pcap_debug; +- pcap_debug = 1; +-#else +- extern int yydebug; +- yydebug = 1; +-#endif +- } +- break; +-#endif + case 'z': + if (optarg) { + zflag = strdup(optarg); diff --git a/net/tcpdump/patches/002-remove_static_libpcap_check.patch b/net/tcpdump/patches/002-remove_static_libpcap_check.patch new file mode 100644 index 0000000..8ab54aa --- /dev/null +++ b/net/tcpdump/patches/002-remove_static_libpcap_check.patch @@ -0,0 +1,77 @@ +--- a/configure ++++ b/configure +@@ -7130,28 +7130,6 @@ echo "${ECHO_T}Using $pfopen" >&6; } + LIBS="$LIBS $pfopen" + fi + fi +- { echo "$as_me:$LINENO: checking for local pcap library" >&5 +-echo $ECHO_N "checking for local pcap library... $ECHO_C" >&6; } +- libpcap=FAIL +- lastdir=FAIL +- places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ +- egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'` +- for dir in $places $srcdir/../libpcap $srcdir/libpcap ; do +- basedir=`echo $dir | sed -e 's/[ab][0-9]*$//' | \ +- sed -e 's/-PRE-GIT$//' ` +- if test $lastdir = $basedir ; then +- continue; +- fi +- lastdir=$dir +- if test -r $dir/libpcap.a ; then +- libpcap=$dir/libpcap.a +- d=$dir +- fi +- done +- if test $libpcap = FAIL ; then +- { echo "$as_me:$LINENO: result: not found" >&5 +-echo "${ECHO_T}not found" >&6; } +- + # + # Look for pcap-config. + # +@@ -7335,45 +7313,6 @@ if test $ac_cv_lib_pcap_main = yes; then + libpcap="-lpcap" + fi + +- if test $libpcap = FAIL ; then +- { { echo "$as_me:$LINENO: error: see the INSTALL doc for more info" >&5 +-echo "$as_me: error: see the INSTALL doc for more info" >&2;} +- { (exit 1); exit 1; }; } +- fi +- { echo "$as_me:$LINENO: checking for extraneous pcap header directories" >&5 +-echo $ECHO_N "checking for extraneous pcap header directories... $ECHO_C" >&6; } +- if test \( ! -r /usr/local/include/pcap.h \) -a \ +- \( ! -r /usr/include/pcap.h \); then +- if test -r /usr/local/include/pcap/pcap.h; then +- d="/usr/local/include/pcap" +- elif test -r /usr/include/pcap/pcap.h; then +- d="/usr/include/pcap" +- fi +- fi +- if test -z "$d" ; then +- { echo "$as_me:$LINENO: result: not found" >&5 +-echo "${ECHO_T}not found" >&6; } +- else +- V_INCLS="-I$d $V_INCLS" +- { echo "$as_me:$LINENO: result: found -- -I$d added" >&5 +-echo "${ECHO_T}found -- -I$d added" >&6; } +- fi +- fi +- else +- V_PCAPDEP=$libpcap +- places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ +- egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'` +- if test -r $d/pcap.h; then +- V_INCLS="-I$d $V_INCLS" +- elif test -r $places/pcap.h; then +- V_INCLS="-I$places $V_INCLS" +- else +- { { echo "$as_me:$LINENO: error: cannot find pcap.h" >&5 +-echo "$as_me: error: cannot find pcap.h" >&2;} +- { (exit see INSTALL); exit see INSTALL; }; } +- fi +- { echo "$as_me:$LINENO: result: $libpcap" >&5 +-echo "${ECHO_T}$libpcap" >&6; } + # Extract the first word of "pcap-config", so it can be a program name with args. + set dummy pcap-config; ac_word=$2 + { echo "$as_me:$LINENO: checking for $ac_word" >&5 diff --git a/net/tcpdump/patches/004-fix_3g_iface.patch b/net/tcpdump/patches/004-fix_3g_iface.patch new file mode 100644 index 0000000..35d105f --- /dev/null +++ b/net/tcpdump/patches/004-fix_3g_iface.patch @@ -0,0 +1,28 @@ +--- a/tcpdump.c ++++ b/tcpdump.c +@@ -66,6 +66,7 @@ extern int SIZE_BUF; + #include + #include + #include ++#include + #ifndef WIN32 + #include + #include +@@ -625,6 +626,7 @@ main(int argc, char **argv) + #ifdef HAVE_PCAP_FINDALLDEVS + pcap_if_t *devpointer; + int devnum; ++ char *devp; + #endif + int status; + #ifdef WIN32 +@@ -775,7 +777,8 @@ main(int argc, char **argv) + * It can be useful on Windows, where more than + * one interface can have the same name. + */ +- if ((devnum = atoi(optarg)) != 0) { ++ for (devp = optarg; *devp && isdigit(*devp); devp++); ++ if ((!*devp || isspace(*devp)) && (devnum = atoi(optarg)) != 0) { + if (devnum < 0) + error("Invalid adapter index"); + diff --git a/net/tcpdump/patches/100-tcpdump_mini.patch b/net/tcpdump/patches/100-tcpdump_mini.patch new file mode 100644 index 0000000..d9537c4 --- /dev/null +++ b/net/tcpdump/patches/100-tcpdump_mini.patch @@ -0,0 +1,748 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -68,6 +68,22 @@ RANLIB = @RANLIB@ + @rm -f $@ + $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c + ++ifdef TCPDUMP_MINI ++ ++CSRC = addrtoname.c af.c checksum.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \ ++ nlpid.c l2vpn.c machdep.c parsenfsfh.c in_cksum.c \ ++ print-802_11.c print-aodv.c print-arp.c print-ascii.c \ ++ print-bgp.c print-bootp.c print-cdp.c print-domain.c print-eap.c print-ether.c \ ++ print-gre.c print-icmp.c print-igmp.c print-ip.c \ ++ print-l2tp.c print-lldp.c print-llc.c \ ++ print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \ ++ print-ppp.c print-pppoe.c print-pptp.c print-radius.c print-raw.c print-rsvp.c \ ++ print-sctp.c print-sip.c print-snmp.c print-stp.c print-sunrpc.c \ ++ print-syslog.c print-tcp.c print-telnet.c print-tftp.c print-udp.c \ ++ setsignal.c tcpdump.c util.c signature.c print-ipnet.c print-forces.c ++ ++else ++ + CSRC = addrtoname.c af.c checksum.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \ + nlpid.c l2vpn.c machdep.c parsenfsfh.c in_cksum.c \ + print-802_11.c print-802_15_4.c print-ap1394.c print-ah.c \ +@@ -99,6 +115,8 @@ LIBNETDISSECT_SRC=print-isakmp.c + LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) + LIBNETDISSECT=libnetdissect.a + ++endif ++ + LOCALSRC = @LOCALSRC@ + GENSRC = version.c + LIBOBJS = @LIBOBJS@ +@@ -361,10 +379,12 @@ $(PROG): $(OBJ) @V_PCAPDEP@ + @rm -f $@ + $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) + ++ifndef TCPDUMP_MINI + $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ) + @rm -f $@ + $(AR) cr $@ $(LIBNETDISSECT_OBJ) + $(RANLIB) $@ ++endif + + datalinks.o: $(srcdir)/missing/datalinks.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c +--- a/addrtoname.c ++++ b/addrtoname.c +@@ -547,10 +547,10 @@ linkaddr_string(const u_char *ep, const unsigned int type, const unsigned int le + + if (type == LINKADDR_ETHER && len == ETHER_ADDR_LEN) + return (etheraddr_string(ep)); +- ++#ifndef TCPDUMP_MINI + if (type == LINKADDR_FRELAY) + return (q922_string(ep)); +- ++#endif + tp = lookup_bytestring(ep, len); + if (tp->e_name) + return (tp->e_name); +@@ -1150,6 +1150,7 @@ init_addrtoname(u_int32_t localnet, u_int32_t mask) + init_ipxsaparray(); + } + ++#ifndef TCPDUMP_MINI + const char * + dnaddr_string(u_short dnaddr) + { +@@ -1169,6 +1170,7 @@ dnaddr_string(u_short dnaddr) + + return(tp->name); + } ++#endif + + /* Return a zero'ed hnamemem struct and cuts down on calloc() overhead */ + struct hnamemem * +--- a/print-ether.c ++++ b/print-ether.c +@@ -338,6 +338,7 @@ ethertype_print(netdissect_options *ndo, + arp_print(ndo, p, length, caplen); + return (1); + ++#ifndef TCPDUMP_MINI + case ETHERTYPE_DN: + decnet_print(/*ndo,*/p, length, caplen); + return (1); +@@ -356,10 +357,13 @@ ethertype_print(netdissect_options *ndo, + ND_PRINT((ndo, "(NOV-ETHII) ")); + ipx_print(/*ndo,*/p, length); + return (1); ++#endif + ++#ifndef TCPDUMP_MINI + case ETHERTYPE_ISO: + isoclns_print(/*ndo,*/p+1, length-1, length-1); + return(1); ++#endif + + case ETHERTYPE_PPPOED: + case ETHERTYPE_PPPOES: +@@ -372,9 +376,11 @@ ethertype_print(netdissect_options *ndo, + eap_print(ndo, p, length); + return (1); + ++#ifndef TCPDUMP_MINI + case ETHERTYPE_RRCP: + rrcp_print(ndo, p - 14 , length + 14); + return (1); ++#endif + + case ETHERTYPE_PPP: + if (length) { +@@ -383,6 +389,7 @@ ethertype_print(netdissect_options *ndo, + } + return (1); + ++#ifndef TCPDUMP_MINI + case ETHERTYPE_MPCP: + mpcp_print(/*ndo,*/p, length); + return (1); +@@ -395,7 +402,7 @@ ethertype_print(netdissect_options *ndo, + case ETHERTYPE_CFM_OLD: + cfm_print(/*ndo,*/p, length); + return (1); +- ++#endif + case ETHERTYPE_LLDP: + lldp_print(/*ndo,*/p, length); + return (1); +@@ -403,10 +410,12 @@ ethertype_print(netdissect_options *ndo, + case ETHERTYPE_LOOPBACK: + return (1); + ++#ifndef TCPDUMP_MINI + case ETHERTYPE_MPLS: + case ETHERTYPE_MPLS_MULTI: + mpls_print(/*ndo,*/p, length); + return (1); ++#endif + + case ETHERTYPE_LAT: + case ETHERTYPE_SCA: +--- a/print-gre.c ++++ b/print-gre.c +@@ -213,6 +213,7 @@ gre_print_0(const u_char *bp, u_int length) + ip6_print(gndo, bp, len); + break; + #endif ++#ifndef TCPDUMP_MINI + case ETHERTYPE_MPLS: + mpls_print(bp, len); + break; +@@ -228,6 +229,7 @@ gre_print_0(const u_char *bp, u_int length) + case ETHERTYPE_TEB: + ether_print(gndo, bp, len, len, NULL, NULL); + break; ++#endif + default: + printf("gre-proto-0x%x", prot); + } +--- a/print-igmp.c ++++ b/print-igmp.c +@@ -305,6 +305,7 @@ igmp_print(register const u_char *bp, register u_int len) + TCHECK2(bp[4], 4); + (void)printf("igmp leave %s", ipaddr_string(&bp[4])); + break; ++#ifndef TCPDUMP_MINI + case 0x13: + (void)printf("igmp dvmrp"); + if (len < 8) +@@ -316,6 +317,7 @@ igmp_print(register const u_char *bp, register u_int len) + (void)printf("igmp pimv1"); + pimv1_print(bp, len); + break; ++#endif + case 0x1e: + print_mresp(bp, len); + break; +--- a/print-ip.c ++++ b/print-ip.c +@@ -328,6 +328,7 @@ ip_print_demux(netdissect_options *ndo, + again: + switch (ipds->nh) { + ++#ifndef TCPDUMP_MINI + case IPPROTO_AH: + ipds->nh = *ipds->cp; + ipds->advance = ah_print(ipds->cp); +@@ -362,14 +363,16 @@ again: + ipds->nh = enh & 0xff; + goto again; + } +- ++#endif + case IPPROTO_SCTP: + sctp_print(ipds->cp, (const u_char *)ipds->ip, ipds->len); + break; + ++#ifndef TCPDUMP_MINI + case IPPROTO_DCCP: + dccp_print(ipds->cp, (const u_char *)ipds->ip, ipds->len); + break; ++#endif + + case IPPROTO_TCP: + /* pass on the MF bit plus the offset to detect fragments */ +@@ -389,6 +392,7 @@ again: + ipds->off & (IP_MF|IP_OFFMASK)); + break; + ++#ifndef TCPDUMP_MINI + case IPPROTO_PIGP: + /* + * XXX - the current IANA protocol number assignments +@@ -409,15 +413,16 @@ again: + case IPPROTO_EIGRP: + eigrp_print(ipds->cp, ipds->len); + break; +- ++#endif + case IPPROTO_ND: + ND_PRINT((ndo, " nd %d", ipds->len)); + break; + ++#ifndef TCPDUMP_MINI + case IPPROTO_EGP: + egp_print(ipds->cp, ipds->len); + break; +- ++#endif + case IPPROTO_OSPF: + ospf_print(ipds->cp, ipds->len, (const u_char *)ipds->ip); + break; +@@ -451,10 +456,10 @@ again: + gre_print(ipds->cp, ipds->len); + break; + ++#ifndef TCPDUMP_MINI + case IPPROTO_MOBILE: + mobile_print(ipds->cp, ipds->len); + break; +- + case IPPROTO_PIM: + vec[0].ptr = ipds->cp; + vec[0].len = ipds->len; +@@ -480,7 +485,7 @@ again: + case IPPROTO_PGM: + pgm_print(ipds->cp, ipds->len, (const u_char *)ipds->ip); + break; +- ++#endif + default: + if ((proto = getprotobynumber(ipds->nh)) != NULL) + ND_PRINT((ndo, " %s", proto->p_name)); +--- a/print-ip6.c ++++ b/print-ip6.c +@@ -192,9 +192,11 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length) + case IPPROTO_SCTP: + sctp_print(cp, (const u_char *)ip6, len); + return; ++#ifndef TCPDUMP_MINI + case IPPROTO_DCCP: + dccp_print(cp, (const u_char *)ip6, len); + return; ++#endif + case IPPROTO_TCP: + tcp_print(cp, len, (const u_char *)ip6, fragmented); + return; +@@ -204,6 +206,7 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length) + case IPPROTO_ICMPV6: + icmp6_print(ndo, cp, len, (const u_char *)ip6, fragmented); + return; ++#ifndef TCPDUMP_MINI + case IPPROTO_AH: + advance = ah_print(cp); + nh = *cp; +@@ -228,7 +231,7 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length) + pim_print(cp, len, nextproto6_cksum(ip6, cp, len, + IPPROTO_PIM)); + return; +- ++#endif + case IPPROTO_OSPF: + ospf6_print(cp, len); + return; +@@ -240,11 +243,11 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length) + case IPPROTO_IPV4: + ip_print(ndo, cp, len); + return; +- ++#ifndef TCPDUMP_MINI + case IPPROTO_PGM: + pgm_print(cp, len, (const u_char *)ip6); + return; +- ++#endif + case IPPROTO_GRE: + gre_print(cp, len); + return; +--- a/print-llc.c ++++ b/print-llc.c +@@ -195,7 +195,7 @@ llc_print(const u_char *p, u_int length, u_int caplen, + control = EXTRACT_LE_16BITS(p + 2); + is_u = 0; + } +- ++#ifndef TCPDUMP_MINI + if (ssap_field == LLCSAP_GLOBAL && dsap_field == LLCSAP_GLOBAL) { + /* + * This is an Ethernet_802.3 IPX frame; it has an +@@ -218,6 +218,7 @@ llc_print(const u_char *p, u_int length, u_int caplen, + ipx_print(p, length); + return (1); + } ++#endif + + dsap = dsap_field & ~LLC_IG; + ssap = ssap_field & ~LLC_GSAP; +@@ -250,6 +251,7 @@ llc_print(const u_char *p, u_int length, u_int caplen, + return (1); + } + ++#ifndef TCPDUMP_MINI + if (ssap == LLCSAP_IPX && dsap == LLCSAP_IPX && + control == LLC_UI) { + /* +@@ -265,6 +267,7 @@ llc_print(const u_char *p, u_int length, u_int caplen, + ipx_print(p+3, length-3); + return (1); + } ++#endif + + #ifdef TCPDUMP_DO_SMB + if (ssap == LLCSAP_NETBEUI && dsap == LLCSAP_NETBEUI +@@ -296,11 +299,13 @@ llc_print(const u_char *p, u_int length, u_int caplen, + return (1); + } + #endif ++#ifndef TCPDUMP_MINI + if (ssap == LLCSAP_ISONS && dsap == LLCSAP_ISONS + && control == LLC_UI) { + isoclns_print(p + 3, length - 3, caplen - 3); + return (1); + } ++#endif + + if (ssap == LLCSAP_SNAP && dsap == LLCSAP_SNAP + && control == LLC_UI) { +@@ -443,6 +448,7 @@ snap_print(const u_char *p, u_int length, u_int caplen, u_int bridge_pad) + case PID_CISCO_CDP: + cdp_print(p, length, caplen); + return (1); ++#ifndef TCPDUMP_MINI + case PID_CISCO_DTP: + dtp_print(p, length); + return (1); +@@ -452,6 +458,7 @@ snap_print(const u_char *p, u_int length, u_int caplen, u_int bridge_pad) + case PID_CISCO_VTP: + vtp_print(p, length); + return (1); ++#endif + case PID_CISCO_PVST: + stp_print(p, length); + return (1); +@@ -482,6 +489,7 @@ snap_print(const u_char *p, u_int length, u_int caplen, u_int bridge_pad) + ether_print(gndo, p, length, caplen, NULL, NULL); + return (1); + ++#ifndef TCPDUMP_MINI + case PID_RFC2684_802_5_FCS: + case PID_RFC2684_802_5_NOFCS: + /* +@@ -523,6 +531,7 @@ snap_print(const u_char *p, u_int length, u_int caplen, u_int bridge_pad) + */ + fddi_print(p, length, caplen); + return (1); ++#endif + + case PID_RFC2684_BPDU: + stp_print(p, length); +--- a/print-null.c ++++ b/print-null.c +@@ -128,7 +128,7 @@ null_if_print(const struct pcap_pkthdr *h, const u_char *p) + ip6_print(gndo, p, length); + break; + #endif +- ++#ifndef TCPDUMP_MINI + case BSD_AFNUM_ISO: + isoclns_print(p, length, caplen); + break; +@@ -140,7 +140,7 @@ null_if_print(const struct pcap_pkthdr *h, const u_char *p) + case BSD_AFNUM_IPX: + ipx_print(p, length); + break; +- ++#endif + default: + /* unknown AF_ value */ + if (!eflag) +--- a/print-ppp.c ++++ b/print-ppp.c +@@ -1262,7 +1262,7 @@ trunc: + return 0; + } + +- ++#ifndef TCPDUMP_MINI + static void + ppp_hdlc(const u_char *p, int length) + { +@@ -1327,17 +1327,19 @@ cleanup: + free(b); + return; + } ++#endif + + + /* PPP */ + static void + handle_ppp(u_int proto, const u_char *p, int length) + { ++#ifndef TCPDUMP_MINI + if ((proto & 0xff00) == 0x7e00) {/* is this an escape code ? */ + ppp_hdlc(p-1, length); + return; + } +- ++#endif + switch (proto) { + case PPP_LCP: /* fall through */ + case PPP_IPCP: +@@ -1371,6 +1373,7 @@ handle_ppp(u_int proto, const u_char *p, int length) + ip6_print(gndo, p, length); + break; + #endif ++#ifndef TCPDUMP_MINI + case ETHERTYPE_IPX: /*XXX*/ + case PPP_IPX: + ipx_print(p, length); +@@ -1382,6 +1385,7 @@ handle_ppp(u_int proto, const u_char *p, int length) + case PPP_MPLS_MCAST: + mpls_print(p, length); + break; ++#endif + case PPP_COMP: + printf("compressed PPP data"); + break; +@@ -1520,6 +1524,7 @@ ppp_if_print(const struct pcap_pkthdr *h, register const u_char *p) + return (0); + } + ++#ifndef TCPDUMP_MINI + /* + * PPP I/F printer to use if we know that RFC 1662-style PPP in HDLC-like + * framing, or Cisco PPP with HDLC framing as per section 4.3.1 of RFC 1547, +@@ -1747,7 +1752,7 @@ printx: + #endif /* __bsdi__ */ + return (hdrlength); + } +- ++#endif + + /* + * Local Variables: +--- a/print-tcp.c ++++ b/print-tcp.c +@@ -652,8 +652,10 @@ tcp_print(register const u_char *bp, register u_int length, + else if (sport == SMB_PORT || dport == SMB_PORT) + smb_tcp_print(bp, length); + #endif ++#ifndef TCPDUMP_MINI + else if (sport == BEEP_PORT || dport == BEEP_PORT) + beep_print(bp, length); ++#endif + else if (length > 2 && + (sport == NAMESERVER_PORT || dport == NAMESERVER_PORT || + sport == MULTICASTDNS_PORT || dport == MULTICASTDNS_PORT)) { +@@ -662,6 +664,7 @@ tcp_print(register const u_char *bp, register u_int length, + * XXX packet could be unaligned, it can go strange + */ + ns_print(bp + 2, length - 2, 0); ++#ifndef TCPDUMP_MINI + } else if (sport == MSDP_PORT || dport == MSDP_PORT) { + msdp_print(bp, length); + } else if (sport == RPKI_RTR_PORT || dport == RPKI_RTR_PORT) { +@@ -669,6 +672,7 @@ tcp_print(register const u_char *bp, register u_int length, + } + else if (length > 0 && (sport == LDP_PORT || dport == LDP_PORT)) { + ldp_print(bp, length); ++#endif + } + + return; +--- a/print-udp.c ++++ b/print-udp.c +@@ -418,11 +418,12 @@ udp_print(register const u_char *bp, u_int length, + vat_print((void *)(up + 1), up); + break; + ++#ifndef TCPDUMP_MINI + case PT_WB: + udpipaddr_print(ip, sport, dport); + wb_print((void *)(up + 1), length); + break; +- ++#endif + case PT_RPC: + rp = (struct sunrpc_msg *)(up + 1); + direction = (enum sunrpc_msg_type)EXTRACT_32BITS(&rp->rm_direction); +@@ -450,11 +451,12 @@ udp_print(register const u_char *bp, u_int length, + snmp_print((const u_char *)(up + 1), length); + break; + ++#ifndef TCPDUMP_MINI + case PT_CNFP: + udpipaddr_print(ip, sport, dport); + cnfp_print(cp, (const u_char *)ip); + break; +- ++#endif + case PT_TFTP: + udpipaddr_print(ip, sport, dport); + tftp_print(cp, length); +@@ -497,6 +499,7 @@ udp_print(register const u_char *bp, u_int length, + } + #endif + } ++#ifndef TCPDUMP_MINI + if (TTEST(((struct LAP *)cp)->type) && + ((struct LAP *)cp)->type == lapDDP && + (atalk_port(sport) || atalk_port(dport))) { +@@ -505,6 +508,7 @@ udp_print(register const u_char *bp, u_int length, + llap_print(cp, length); + return; + } ++#endif + } + udpipaddr_print(ip, sport, dport); + +@@ -555,14 +559,18 @@ udp_print(register const u_char *bp, u_int length, + ns_print((const u_char *)(up + 1), length, 0); + else if (ISPORT(MULTICASTDNS_PORT)) + ns_print((const u_char *)(up + 1), length, 1); ++#ifndef TCPDUMP_MINI + else if (ISPORT(TIMED_PORT)) + timed_print((const u_char *)(up + 1)); ++#endif + else if (ISPORT(TFTP_PORT)) + tftp_print((const u_char *)(up + 1), length); + else if (ISPORT(IPPORT_BOOTPC) || ISPORT(IPPORT_BOOTPS)) + bootp_print((const u_char *)(up + 1), length); ++#ifndef TCPDUMP_MINI + else if (ISPORT(RIP_PORT)) + rip_print((const u_char *)(up + 1), length); ++#endif + else if (ISPORT(AODV_PORT)) + aodv_print((const u_char *)(up + 1), length, + #ifdef INET6 +@@ -570,6 +578,7 @@ udp_print(register const u_char *bp, u_int length, + #else + 0); + #endif ++#ifndef TCPDUMP_MINI + else if (ISPORT(ISAKMP_PORT)) + isakmp_print(gndo, (const u_char *)(up + 1), length, bp2); + else if (ISPORT(ISAKMP_PORT_NATT)) +@@ -578,12 +587,15 @@ udp_print(register const u_char *bp, u_int length, + else if (ISPORT(ISAKMP_PORT_USER1) || ISPORT(ISAKMP_PORT_USER2)) + isakmp_print(gndo, (const u_char *)(up + 1), length, bp2); + #endif ++#endif + else if (ISPORT(SNMP_PORT) || ISPORT(SNMPTRAP_PORT)) + snmp_print((const u_char *)(up + 1), length); + else if (ISPORT(NTP_PORT)) + ntp_print((const u_char *)(up + 1), length); ++#ifndef TCPDUMP_MINI + else if (ISPORT(KERBEROS_PORT) || ISPORT(KERBEROS_SEC_PORT)) + krb_print((const void *)(up + 1)); ++#endif + else if (ISPORT(L2TP_PORT)) + l2tp_print((const u_char *)(up + 1), length); + #ifdef TCPDUMP_DO_SMB +@@ -594,6 +606,7 @@ udp_print(register const u_char *bp, u_int length, + #endif + else if (dport == 3456) + vat_print((const void *)(up + 1), up); ++#ifndef TCPDUMP_MINI + else if (ISPORT(ZEPHYR_SRV_PORT) || ISPORT(ZEPHYR_CLT_PORT)) + zephyr_print((const void *)(up + 1), length); + /* +@@ -604,6 +617,7 @@ udp_print(register const u_char *bp, u_int length, + (dport >= RX_PORT_LOW && dport <= RX_PORT_HIGH)) + rx_print((const void *)(up + 1), length, sport, dport, + (u_char *) ip); ++#endif + #ifdef INET6 + else if (ISPORT(RIPNG_PORT)) + ripng_print((const u_char *)(up + 1), length); +@@ -615,21 +629,25 @@ udp_print(register const u_char *bp, u_int length, + /* + * Kludge in test for whiteboard packets. + */ ++#ifndef TCPDUMP_MINI + else if (dport == 4567) + wb_print((const void *)(up + 1), length); + else if (ISPORT(CISCO_AUTORP_PORT)) + cisco_autorp_print((const void *)(up + 1), length); ++#endif + else if (ISPORT(RADIUS_PORT) || + ISPORT(RADIUS_NEW_PORT) || + ISPORT(RADIUS_ACCOUNTING_PORT) || + ISPORT(RADIUS_NEW_ACCOUNTING_PORT) ) + radius_print((const u_char *)(up+1), length); ++#ifndef TCPDUMP_MINI + else if (dport == HSRP_PORT) + hsrp_print((const u_char *)(up + 1), length); + else if (ISPORT(LWRES_PORT)) + lwres_print((const u_char *)(up + 1), length); + else if (ISPORT(LDP_PORT)) + ldp_print((const u_char *)(up + 1), length); ++#endif + else if (ISPORT(OLSR_PORT)) + olsr_print((const u_char *)(up + 1), length, + #if INET6 +@@ -637,6 +655,7 @@ udp_print(register const u_char *bp, u_int length, + #else + 0); + #endif ++#ifndef TCPDUMP_MINI + else if (ISPORT(MPLS_LSP_PING_PORT)) + lspping_print((const u_char *)(up + 1), length); + else if (dport == BFD_CONTROL_PORT || +@@ -654,6 +673,7 @@ udp_print(register const u_char *bp, u_int length, + lwapp_control_print((const u_char *)(up + 1), length, 0); + else if (ISPORT(LWAPP_DATA_PORT)) + lwapp_data_print((const u_char *)(up + 1), length); ++#endif + else if (ISPORT(SIP_PORT)) + sip_print((const u_char *)(up + 1), length); + else if (ISPORT(SYSLOG_PORT)) +--- a/tcpdump.c ++++ b/tcpdump.c +@@ -148,6 +148,7 @@ struct ndo_printer { + + + static struct printer printers[] = { ++#ifndef TCPDUMP_MINI + { arcnet_if_print, DLT_ARCNET }, + #ifdef DLT_ARCNET_LINUX + { arcnet_linux_if_print, DLT_ARCNET_LINUX }, +@@ -166,19 +167,23 @@ static struct printer printers[] = { + #ifdef DLT_SLIP_BSDOS + { sl_bsdos_if_print, DLT_SLIP_BSDOS }, + #endif ++#endif + { ppp_if_print, DLT_PPP }, + #ifdef DLT_PPP_WITHDIRECTION + { ppp_if_print, DLT_PPP_WITHDIRECTION }, + #endif ++#ifndef TCPDUMP_MINI + #ifdef DLT_PPP_BSDOS + { ppp_bsdos_if_print, DLT_PPP_BSDOS }, + #endif + { fddi_if_print, DLT_FDDI }, ++#endif + { null_if_print, DLT_NULL }, + #ifdef DLT_LOOP + { null_if_print, DLT_LOOP }, + #endif + { raw_if_print, DLT_RAW }, ++#ifndef TCPDUMP_MINI + { atm_if_print, DLT_ATM_RFC1483 }, + #ifdef DLT_C_HDLC + { chdlc_if_print, DLT_C_HDLC }, +@@ -189,15 +194,19 @@ static struct printer printers[] = { + #ifdef DLT_PPP_SERIAL + { ppp_hdlc_if_print, DLT_PPP_SERIAL }, + #endif ++#endif + #ifdef DLT_PPP_ETHER + { pppoe_if_print, DLT_PPP_ETHER }, + #endif ++#ifndef TCPDUMP_MINI + #ifdef DLT_LINUX_SLL + { sll_if_print, DLT_LINUX_SLL }, + #endif ++#endif + #ifdef DLT_IEEE802_11 + { ieee802_11_if_print, DLT_IEEE802_11}, + #endif ++#ifndef TCPDUMP_MINI + #ifdef DLT_LTALK + { ltalk_if_print, DLT_LTALK }, + #endif +@@ -216,12 +225,14 @@ static struct printer printers[] = { + #ifdef DLT_IP_OVER_FC + { ipfc_if_print, DLT_IP_OVER_FC }, + #endif ++#endif + #ifdef DLT_PRISM_HEADER + { prism_if_print, DLT_PRISM_HEADER }, + #endif + #ifdef DLT_IEEE802_11_RADIO + { ieee802_11_radio_if_print, DLT_IEEE802_11_RADIO }, + #endif ++#ifndef TCPDUMP_MINI + #ifdef DLT_ENC + { enc_if_print, DLT_ENC }, + #endif +@@ -231,9 +242,11 @@ static struct printer printers[] = { + #ifdef DLT_APPLE_IP_OVER_IEEE1394 + { ap1394_if_print, DLT_APPLE_IP_OVER_IEEE1394 }, + #endif ++#endif + #ifdef DLT_IEEE802_11_RADIO_AVS + { ieee802_11_radio_avs_if_print, DLT_IEEE802_11_RADIO_AVS }, + #endif ++#ifndef TCPDUMP_MINI + #ifdef DLT_JUNIPER_ATM1 + { juniper_atm1_print, DLT_JUNIPER_ATM1 }, + #endif +@@ -299,6 +312,7 @@ static struct printer printers[] = { + #ifdef DLT_IPV6 + { raw_if_print, DLT_IPV6 }, + #endif ++#endif + { NULL, 0 }, + }; + +@@ -307,6 +321,7 @@ static struct ndo_printer ndo_printers[] = { + #ifdef DLT_IPNET + { ipnet_if_print, DLT_IPNET }, + #endif ++#ifndef TCPDUMP_MINI + #ifdef DLT_IEEE802_15_4 + { ieee802_15_4_if_print, DLT_IEEE802_15_4 }, + #endif +@@ -316,6 +331,7 @@ static struct ndo_printer ndo_printers[] = { + #ifdef DLT_PPI + { ppi_if_print, DLT_PPI }, + #endif ++#endif + #ifdef DLT_NETANALYZER + { netanalyzer_if_print, DLT_NETANALYZER }, + #endif diff --git a/net/tcptraceroute/Makefile b/net/tcptraceroute/Makefile new file mode 100644 index 0000000..33119e9 --- /dev/null +++ b/net/tcptraceroute/Makefile @@ -0,0 +1,46 @@ +# +# 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:=tcptraceroute +PKG_VERSION:=1.5beta7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://michael.toren.net/code/tcptraceroute +PKG_MD5SUM:=65d1001509f971ea986fcbc2dd009643 + +include $(INCLUDE_DIR)/package.mk + +define Package/tcptraceroute + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +libnet1 + TITLE:=A traceroute implementation using TCP packets. + URL:=http://michael.toren.net/code/tcptraceroute/ +endef + +define Build/Configure + $(call Build/Configure/Default, \ + , \ + CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/lib/libnet-1.1.x/include" \ + LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/libnet-1.1.x/lib" \ + PATH="$(STAGING_DIR)/usr/lib/libnet-1.1.x/bin:$$$$PATH" \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +define Package/tcptraceroute/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tcptraceroute $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,tcptraceroute)) diff --git a/net/tcptraceroute/patches/001-configure_cross_compile.patch b/net/tcptraceroute/patches/001-configure_cross_compile.patch new file mode 100644 index 0000000..5690a23 --- /dev/null +++ b/net/tcptraceroute/patches/001-configure_cross_compile.patch @@ -0,0 +1,62 @@ +--- tcptraceroute-1.5beta7.orig/configure 2006-03-29 02:49:55.000000000 +0100 ++++ tcptraceroute-1.5beta7/configure 2007-03-19 19:13:31.644193395 +0000 +@@ -5484,11 +5484,11 @@ + echo "$as_me:$LINENO: checking for Solaris" >&5 + echo $ECHO_N "checking for Solaris... $ECHO_C" >&6 + if test "$cross_compiling" = yes; then +- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling ++ { { echo "$as_me:$LINENO: warning: cannot run test program while cross compiling + See \`config.log' for more details." >&5 +-echo "$as_me: error: cannot run test program while cross compiling ++echo "$as_me: warning: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +@@ -5551,11 +5551,11 @@ + echo "$as_me:$LINENO: checking for BSDI" >&5 + echo $ECHO_N "checking for BSDI... $ECHO_C" >&6 + if test "$cross_compiling" = yes; then +- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling ++ { { echo "$as_me:$LINENO: warning: cannot run test program while cross compiling + See \`config.log' for more details." >&5 +-echo "$as_me: error: cannot run test program while cross compiling ++echo "$as_me: warning: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +@@ -5618,11 +5618,11 @@ + echo "$as_me:$LINENO: checking for NetBSD" >&5 + echo $ECHO_N "checking for NetBSD... $ECHO_C" >&6 + if test "$cross_compiling" = yes; then +- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling ++ { { echo "$as_me:$LINENO: warning: cannot run test program while cross compiling + See \`config.log' for more details." >&5 +-echo "$as_me: error: cannot run test program while cross compiling ++echo "$as_me: warning: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +@@ -5685,11 +5685,11 @@ + echo "$as_me:$LINENO: checking for MacOS X" >&5 + echo $ECHO_N "checking for MacOS X... $ECHO_C" >&6 + if test "$cross_compiling" = yes; then +- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling ++ { { echo "$as_me:$LINENO: warning: cannot run test program while cross compiling + See \`config.log' for more details." >&5 +-echo "$as_me: error: cannot run test program while cross compiling ++echo "$as_me: warning: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ diff --git a/net/tctool/Makefile b/net/tctool/Makefile new file mode 100644 index 0000000..af0ed56 --- /dev/null +++ b/net/tctool/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2008-2011 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:=tctool +PKG_VERSION:=0.9.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip +PKG_SOURCE_URL:=http://download2.berlios.de/speedmodem50b +PKG_MD5SUM:=df38334206d4cad106e58bd71c6f1d9a + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/tctool + SECTION:=net + CATEGORY:=Network + TITLE:=TrendChip-Modem-Utility + URL:=http://speedmodem50b.berlios.de/ + DEPENDS:=+libstdcpp +endef + +define Package/tctool/description + tcTool provides access to the console-service of TrendChip-based + ADSL-Modems. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/src $(TARGET_CONFIGURE_OPTS) tctool +endef + +define Package/tctool/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/tctool $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,tctool)) diff --git a/net/tctool/patches/001_Makefile_fix.diff b/net/tctool/patches/001_Makefile_fix.diff new file mode 100644 index 0000000..ee7c4f5 --- /dev/null +++ b/net/tctool/patches/001_Makefile_fix.diff @@ -0,0 +1,30 @@ +diff -ur tctool.old/src/Makefile tctool/src/Makefile +--- tctool.old/src/Makefile 2007-01-03 02:32:24.000000000 +0100 ++++ tctool/src/Makefile 2007-09-18 19:15:03.068155702 +0200 +@@ -31,16 +31,16 @@ + EXAMPLE := example + EXOBJ := if.o interface.o etherStream.o etherStreambuf.o tcStream.o tcStreambuf.o tcRtsDump.o tcRtsDumpbuf.o + +-CXX := g++ +-CXXFLAGS := -march=i386 -O2 +-LDFLAGS := --strip-unneeded +-LIBS := +-LDSTATIC := -L. -static-libgcc +-STATICLIBS := stdc++ m +-COUNTRY := "C" +-LANG := "C" +-LANGUAGE := "C" +-LC_ALL := "C" ++#CXX := g++ ++#CXXFLAGS := -march=i386 -O2 ++#LDFLAGS := --strip-unneeded ++#LIBS := ++#LDSTATIC := -L. -static-libgcc ++#STATICLIBS := stdc++ m ++#COUNTRY := "C" ++#LANG := "C" ++#LANGUAGE := "C" ++#LC_ALL := "C" + + default: install + diff --git a/net/tctool/patches/005-fix-gcc_4_3-compile.patch b/net/tctool/patches/005-fix-gcc_4_3-compile.patch new file mode 100644 index 0000000..76008b9 --- /dev/null +++ b/net/tctool/patches/005-fix-gcc_4_3-compile.patch @@ -0,0 +1,12 @@ +diff --git a/src/tctool.cpp b/src/tctool.cpp +index bbab13f..9ce8e5c 100644 +--- a/src/tctool.cpp ++++ b/src/tctool.cpp +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + + std::string options = "I:m:i:r:t:p:c:MUdsSCRh"; + std::string ethDev = "eth0"; diff --git a/net/tftp-hpa/Makefile b/net/tftp-hpa/Makefile new file mode 100644 index 0000000..45f246f --- /dev/null +++ b/net/tftp-hpa/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2006-2011 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:=tftp-hpa +PKG_VERSION:=0.48 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@KERNEL/software/network/tftp +PKG_MD5SUM:=73dd29dfa9062a174163f6a267e0b5f7 + +include $(INCLUDE_DIR)/package.mk + +define Package/tftp-hpa/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=File Transfer + DEPENDS:=+libreadline + URL:=http://www.kernel.org/pub/software/network/tftp +endef + +define Package/tftp-hpa + $(call Package/tftp-hpa/Default) + TITLE:=An enhanced version of the BSD TFTP client +endef + +define Package/tftpd-hpa + $(call Package/tftp-hpa/Default) + TITLE:=An enhanced version of the BSD TFTP server +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --without-tcpwrappers, \ + CFLAGS="$$$$CFLAGS $$$$CPPFLAGS" \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +define Package/tftp-hpa/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tftp/tftp $(1)/usr/bin/tftp-hpa +endef + +define Package/tftpd-hpa/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tftpd/tftpd $(1)/usr/sbin/tftpd-hpa + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/tftpd-hpa.init $(1)/etc/init.d/tftpd-hpa +endef + +$(eval $(call BuildPackage,tftp-hpa)) +$(eval $(call BuildPackage,tftpd-hpa)) diff --git a/net/tftp-hpa/files/tftpd-hpa.init b/net/tftp-hpa/files/tftpd-hpa.init new file mode 100644 index 0000000..c3432ed --- /dev/null +++ b/net/tftp-hpa/files/tftpd-hpa.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +start() { + mkdir -m 0755 -p /var/tftpd-hpa + service_start /usr/sbin/tftpd-hpa -l -s /var/tftpd-hpa +} + +stop() { + service_stop /usr/sbin/tftpd-hpa +} diff --git a/net/tig/Makefile b/net/tig/Makefile new file mode 100644 index 0000000..a9e8d59 --- /dev/null +++ b/net/tig/Makefile @@ -0,0 +1,43 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=tig +PKG_VERSION:=0.18 +PKG_RELEASE:=1 + +PKG_SOURCE:=tig-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://jonas.nitro.dk/tig/releases/ +PKG_MD5SUM:=4fa9e33c5daa76b6fed11e068405356f +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/tig-$(PKG_VERSION) +PKG_BUILD_DEPENDS:=libncurses libiconv + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/tig + SECTION:=devel + CATEGORY:=Development + TITLE:=Console Git repository viewer + DEPENDS:=+git +libncursesw + URL:=http://jonas.nitro.dk/tig/releases/ +endef + +define Package/tig/description + Command line launcher for search engines and other Internet services. +endef + +CONFIGURE_ARGS+= \ + --with-libiconv="$(ICONV_PREFIX)" + +define Package/tig/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tig $(1)/usr/bin/tig +endef + +$(eval $(call BuildPackage,tig)) diff --git a/net/tinc/Makefile b/net/tinc/Makefile new file mode 100644 index 0000000..53f270f --- /dev/null +++ b/net/tinc/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2007-2011 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:=tinc +PKG_VERSION:=1.0.19 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.tinc-vpn.org/packages +PKG_MD5SUM:=5d97ee0f1ccf8fea5b492f6b54d5ac32 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/tinc + SECTION:=net + CATEGORY:=Network + DEPENDS:=+liblzo +libopenssl +kmod-tun + TITLE:=VPN tunneling daemon + URL:=http://www.tinc-vpn.org/ + SUBMENU:=VPN +endef + +define Package/tinc/description + tinc is a Virtual Private Network (VPN) daemon that uses tunnelling and + encryption to create a secure private network between hosts on the Internet. +endef + +TARGET_CFLAGS += -std=gnu99 + +CONFIGURE_ARGS += \ + --with-kernel="$(LINUX_DIR)" \ + --with-zlib="$(STAGING_DIR)/usr" \ + --with-lzo-include="$(STAGING_DIR)/usr/include/lzo" + +define Package/tinc/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tincd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/openvpn + $(INSTALL_DIR) $(1)/lib/upgrade/keep.d + $(INSTALL_DATA) files/tinc.upgrade $(1)/lib/upgrade/keep.d/tinc +endef + +define Package/tinc/conffiles +/etc/config/tinc +endef + +$(eval $(call BuildPackage,tinc)) diff --git a/net/tinc/files/tinc.config b/net/tinc/files/tinc.config new file mode 100644 index 0000000..f9f2b53 --- /dev/null +++ b/net/tinc/files/tinc.config @@ -0,0 +1,56 @@ +config tinc-net NETNAME + option enabled 0 + + ## Daemon Configuration (cmd arguments) + #option generate_keys 0 + #option key_size 2048 + #option log /tmp/log/tinc.NETNAME.log + #option debug 3 + + ## Server Configuration (tinc.conf) + #option AddressFamily any + #option BindToAddress 127.0.0.1 + #option BindToInterface lo + + #list ConnectTo peer1 + + #option DirectOnly 0 + #option Forwarding internal + #option GraphDumpFile /tmp/log/tinc.NETNAME.dot + #option Hostnames 0 + #option IffOneQueue 0 + #option Interface NETNAME + #option KeyExpire 3600 + #option MACExpire 600 + #option MaxTimeout 900 + #option Mode router + + option Name NODENAME + + #option PingInterval 60 + #option PingTimeout 5 + #option PriorityInheritance 0 + #option PrivateKeyFile /etc/tinc/NETNAME/rsa_key.priv + #option ProcessPriority normal + #option ReplayWindow 16 + #option StrictSubnets 0 + #option TunnelServer 0 + #option UDPRcvBuf x + #option UDPSndBuf x + +config tinc-host NODENAME + option enabled 0 + + option net NETNAME + + #list Address example.com + #option Cipher blowfish + #option ClampMSS yes + #option Compression 0 + #option Digest sha1 + #option IndirectData 0 + #option MACLength 4 + #option PMTU 1514 + #option PMTUDiscovery yes + #option Port 655 + #option Subnet 192.168.1.0/24 diff --git a/net/tinc/files/tinc.init b/net/tinc/files/tinc.init new file mode 100644 index 0000000..55a86a1 --- /dev/null +++ b/net/tinc/files/tinc.init @@ -0,0 +1,236 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2011 OpenWrt.org +# Copyright (C) 2011 Linus Lüssing +# Based on Jo-Philipp Wich's OpenVPN init script +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +START=42 + +SERVICE_USE_PID=1 + +BIN=/usr/sbin/tincd +EXTRA_COMMANDS="up down" + +LIST_SEP=" +" +TMP_TINC="/tmp/tinc" + +append_param() { + local v="$1" + case "$v" in + *_*_*_*) v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_} ;; + *_*_*) v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_} ;; + *_*) v=${v%%_*}-${v#*_} ;; + esac + ARGS="$ARGS --$v" + return 0 +} + +append_conf_bools() { + local p; local v; local s="$1"; local f="$2"; shift; shift + for p in $*; do + config_get_bool v "$s" "$p" + [ "$v" == 1 ] && echo "$p = yes" >> "$f" + [ "$v" == 0 ] && echo "$p = no" >> "$f" + done +} + +append_params() { + local p; local v; local s="$1"; shift + for p in $*; do + config_get v "$s" "$p" + IFS="$LIST_SEP" + for v in $v; do + [ -n "$v" ] && append_param "$p" && ARGS="$ARGS $v" + done + unset IFS + done +} + +append_conf_params() { + local p; local v; local s="$1"; local f="$2"; shift; shift + for p in $*; do + config_get v "$s" "$p" + IFS="$LIST_SEP" + for v in $v; do + # Look up OpenWRT interface names + [ "$p" = "BindToInterface" ] && { + local ifname=$(uci -P /var/state get network.$v.ifname 2>&-) + [ -n "$ifname" ] && v="$ifname" + } + + [ -n "$v" ] && echo "$p = $v" >> "$f" + done + unset IFS + done +} + +section_enabled() { + config_get_bool enabled "$1" 'enabled' 0 + [ $enabled -gt 0 ] +} + +prepare_host() { + local s="$1" + local n + + # net disabled? + config_get n "$s" net + section_enabled "$n" || return 1 + + if [ "$#" = "2" ]; then + [ "$2" != "$n" ] && return 1 + fi + + # host disabled? + section_enabled "$s" || { + [ -f "$TMP_TINC/$n/hosts/$s" ] && rm "$TMP_TINC/$n/hosts/$s" + return 1 + } + + [ ! -f "/etc/tinc/$n/hosts/$s" ] && { + echo -n "tinc: Warning, public key for $s for network $n " + echo -n "missing in /etc/tinc/$n/hosts/$s, " + echo "skipping configuration of $s" + return 1 + } + + # append flags + append_conf_bools "$s" "$TMP_TINC/$n/hosts/$s" \ + ClampMSS IndirectData PMTUDiscovery TCPOnly + + # append params + append_conf_params "$s" "$TMP_TINC/$n/hosts/$s" \ + Address Cipher Compression Digest MACLength PMTU \ + Port PublicKey PublicKeyFile Subnet +} + +check_gen_own_key() { + local s="$1"; local n; local k + + config_get n "$s" Name + config_get_bool k "$s" generate_keys 0 + [ "$k" == 0 ] && return 0 + + ([ -z "$n" ] || [ -f "$TMP_TINC/$s/hosts/$n" ] || [ -f "$TMP_TINC/$s/rsa_key.priv" ]) && \ + return 0 + [ ! -d "$TMP_TINC/$s/hosts" ] && mkdir -p "$TMP_TINC/$s/hosts" + + config_get k "$s" key_size + if [ -z "$k" ]; then + $BIN -c "$TMP_TINC/$s" --generate-keys $CFGFILE + echo '### DO NOT EDIT' >> $CFGFILE + echo '### SEE /etc/config/tinyproxy INSTEAD' >> $CFGFILE + echo '' >> $CFGFILE + + proxy_atom "$1" User >> $CFGFILE + proxy_atom "$1" Group >> $CFGFILE + proxy_atom "$1" Port 8888 >> $CFGFILE + proxy_atom "$1" Listen >> $CFGFILE + proxy_atom "$1" Bind >> $CFGFILE + proxy_atom "$1" Timeout >> $CFGFILE + + proxy_string "$1" ErrorFile_400 "ErrorFile 400" >> $CFGFILE + proxy_string "$1" ErrorFile_403 "ErrorFile 403" >> $CFGFILE + proxy_string "$1" ErrorFile_404 "ErrorFile 404" >> $CFGFILE + proxy_string "$1" ErrorFile_408 "ErrorFile 408" >> $CFGFILE + proxy_string "$1" ErrorFile_503 "ErrorFile 503" >> $CFGFILE + + proxy_string "$1" DefaultErrorFile >> $CFGFILE + proxy_string "$1" StatHost StatHost 127.0.0.1 >> $CFGFILE + proxy_string "$1" StatFile >> $CFGFILE + proxy_string "$1" LogFile >> $CFGFILE + + proxy_flag "$1" SysLog >> $CFGFILE + + proxy_atom "$1" LogLevel >> $CFGFILE + + proxy_list "$1" XTinyproxy >> $CFGFILE + + proxy_atom "$1" MaxClients >> $CFGFILE + proxy_atom "$1" MinSpareServers >> $CFGFILE + proxy_atom "$1" MaxSpareServers >> $CFGFILE + proxy_atom "$1" StartServers >> $CFGFILE + proxy_atom "$1" MaxRequestsPerChild >> $CFGFILE + proxy_list "$1" Allow >> $CFGFILE + + proxy_string "$1" ViaProxyName >> $CFGFILE + proxy_string "$1" Filter >> $CFGFILE + + proxy_flag "$1" FilterURLs >> $CFGFILE + proxy_flag "$1" FilterExtended >> $CFGFILE + proxy_flag "$1" FilterCaseSensitive >> $CFGFILE + proxy_flag "$1" FilterDefaultDeny Yes No >> $CFGFILE + + proxy_list "$1" Anonymous '"' >> $CFGFILE + proxy_list "$1" ConnectPort >> $CFGFILE + + config_foreach write_upstream upstream + + service_start /usr/sbin/tinyproxy -c "$CFGFILE" +} + +write_upstream() { + local type + local via + local target + + config_get "type" "$1" "type" + config_get via "$1" via + config_get target "$1" target + [ -n "$target" ] && target=' "'"$target"'"' + + [ "$type" == "proxy" -a -n "$via" ] && \ + echo "upstream $via$target" >> $CFGFILE + + [ "$type" == "reject" -a -n "$target" ] && \ + echo "no upstream$target" >> $CFGFILE +} + +proxy_atom() { + local SECTION=$1 + local OPTION=$2 + local DEFAULT=$3 + + config_get _value "$SECTION" "$OPTION" + [ -z "$_value" ] && _value="$DEFAULT" + [ -n "$_value" ] && echo "$OPTION $_value" +} + +proxy_string() { + local SECTION=$1 + local OPTION=$2 + local ALIAS=$3 + local DEFAULT=$4 + + config_get _value "$SECTION" "$OPTION" + [ -z "$_value" ] && _value="$DEFAULT" + [ -n "$_value" ] && echo "${ALIAS:-${OPTION}} "'"'"$_value"'"' +} + +proxy_flag() { + local SECTION=$1 + local OPTION=$2 + local TRUE="${3:-On}" + local FALSE="${4:-Off}" + + config_get_bool _value "$SECTION" "$OPTION" 0 + [ "$_value" -eq "1" ] && _value="$TRUE" || _value="$FALSE" + echo "$OPTION $_value" +} + +proxy_list() { + local SECTION=$1 + local OPTION=$2 + local ENCLOSE=$3 + + config_get _value "$SECTION" "$OPTION" + [ -n "$_value" ] && { + for entry in $_value; do + echo "$OPTION ${ENCLOSE}${entry}${ENCLOSE}" + done + } +} diff --git a/net/tinyproxy/patches/010-no-docs-and-tests.patch b/net/tinyproxy/patches/010-no-docs-and-tests.patch new file mode 100644 index 0000000..9845c35 --- /dev/null +++ b/net/tinyproxy/patches/010-no-docs-and-tests.patch @@ -0,0 +1,86 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -2,9 +2,7 @@ SUBDIRS = \ + src \ + data \ + etc \ +- docs \ + m4macros \ +- tests + + # tools want this on a single line + ACLOCAL_AMFLAGS = -I m4macros +--- a/Makefile.in ++++ b/Makefile.in +@@ -222,9 +222,7 @@ SUBDIRS = \ + src \ + data \ + etc \ +- docs \ + m4macros \ +- tests + + + # tools want this on a single line +--- a/configure ++++ b/configure +@@ -6816,59 +6816,8 @@ fi + + + +-# Check for asciidoc +-# Extract the first word of "a2x", so it can be a program name with args. +-set dummy a2x; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if test "${ac_cv_path_A2X+set}" = set; then : +- $as_echo_n "(cached) " >&6 +-else +- case $A2X in +- [\\/]* | ?:[\\/]*) +- ac_cv_path_A2X="$A2X" # Let the user override the test with a path. +- ;; +- *) +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- 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_path_A2X="$as_dir/$ac_word$ac_exec_ext" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +- done +-IFS=$as_save_IFS +- +- test -z "$ac_cv_path_A2X" && ac_cv_path_A2X="no" +- ;; +-esac +-fi +-A2X=$ac_cv_path_A2X +-if test -n "$A2X"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $A2X" >&5 +-$as_echo "$A2X" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +- +- +- if test "x$A2X" != "xno"; then +- HAVE_A2X_TRUE= +- HAVE_A2X_FALSE='#' +-else + HAVE_A2X_TRUE='#' + HAVE_A2X_FALSE= +-fi +- +-if test x"$A2X" = x"no"; then +- as_fn_error "Test for asciidoc failed. See the file 'INSTALL' for help." "$LINENO" 5 +-fi + + ac_config_files="$ac_config_files Makefile src/Makefile data/Makefile data/templates/Makefile etc/Makefile docs/Makefile docs/man5/Makefile docs/man5/tinyproxy.conf.txt docs/man8/Makefile docs/man8/tinyproxy.txt m4macros/Makefile tests/Makefile tests/scripts/Makefile" + diff --git a/net/tinyproxy/patches/020-config_and_pid-path.patch b/net/tinyproxy/patches/020-config_and_pid-path.patch new file mode 100644 index 0000000..3ab7482 --- /dev/null +++ b/net/tinyproxy/patches/020-config_and_pid-path.patch @@ -0,0 +1,13 @@ +--- a/src/main.c ++++ b/src/main.c +@@ -326,8 +326,8 @@ static void initialize_config_defaults ( + conf->errorpages = NULL; + conf->stathost = safestrdup (TINYPROXY_STATHOST); + conf->idletimeout = MAX_IDLE_TIME; +- conf->logf_name = safestrdup (LOCALSTATEDIR "/log/tinyproxy/tinyproxy.log"); +- conf->pidpath = safestrdup (LOCALSTATEDIR "/run/tinyproxy/tinyproxy.pid"); ++ conf->logf_name = safestrdup (LOCALSTATEDIR "/log/tinyproxy.log"); ++ conf->pidpath = safestrdup (LOCALSTATEDIR "/tinyproxy.pid"); + } + + /** diff --git a/net/tinyproxy/patches/030-allow_bind_in_transparent_mode.patch b/net/tinyproxy/patches/030-allow_bind_in_transparent_mode.patch new file mode 100644 index 0000000..7d6decd --- /dev/null +++ b/net/tinyproxy/patches/030-allow_bind_in_transparent_mode.patch @@ -0,0 +1,22 @@ +--- a/src/conf.c ++++ b/src/conf.c +@@ -857,7 +857,6 @@ static HANDLE_FUNC (handle_deny) + + static HANDLE_FUNC (handle_bind) + { +-#ifndef TRANSPARENT_PROXY + int r = set_string_arg (&conf->bind_address, line, &match[2]); + + if (r) +@@ -865,11 +864,6 @@ static HANDLE_FUNC (handle_bind) + log_message (LOG_INFO, + "Outgoing connections bound to IP %s", conf->bind_address); + return 0; +-#else +- fprintf (stderr, +- "\"Bind\" cannot be used with transparent support enabled.\n"); +- return 1; +-#endif + } + + static HANDLE_FUNC (handle_listen) diff --git a/net/tinyproxy/patches/040-fix_url_filter_in_transparent_mode.patch b/net/tinyproxy/patches/040-fix_url_filter_in_transparent_mode.patch new file mode 100644 index 0000000..ab3118b --- /dev/null +++ b/net/tinyproxy/patches/040-fix_url_filter_in_transparent_mode.patch @@ -0,0 +1,110 @@ +From e0cf6d4b0c84da6273c127a8c87076aac3b51588 Mon Sep 17 00:00:00 2001 +From: Daniel Egger +Date: Mon, 16 Aug 2010 22:36:20 +0200 +Subject: [PATCH 3/3] Pass a pointer to a char pointer to do_transparent_proxy so the reassembled URL + will actually end up back in the caller where it is needed for filtering + decisions. This fixes the problem that a tinyproxy configured with the + transparent proxy functionality and "FilterURLs Yes" would filter on everything + but the domain. + +Signed-off-by: daniel.egger@sphairon.com +--- + src/reqs.c | 2 +- + src/transparent-proxy.c | 20 ++++++++++---------- + src/transparent-proxy.h | 2 +- + 3 files changed, 12 insertions(+), 12 deletions(-) + +--- a/src/reqs.c ++++ b/src/reqs.c +@@ -418,7 +418,7 @@ BAD_REQUEST_ERROR: + } else { + #ifdef TRANSPARENT_PROXY + if (!do_transparent_proxy +- (connptr, hashofheaders, request, &config, url)) { ++ (connptr, hashofheaders, request, &config, &url)) { + goto fail; + } + #else +--- a/src/transparent-proxy.c ++++ b/src/transparent-proxy.c +@@ -55,11 +55,11 @@ static int build_url (char **url, const + int + do_transparent_proxy (struct conn_s *connptr, hashmap_t hashofheaders, + struct request_s *request, struct config_s *conf, +- char *url) ++ char **url) + { + socklen_t length; + char *data; +- size_t ulen = strlen (url); ++ size_t ulen = strlen (*url); + + length = hashmap_entry_by_key (hashofheaders, "host", (void **) &data); + if (length <= 0) { +@@ -73,7 +73,7 @@ do_transparent_proxy (struct conn_s *con + connptr->client_fd); + indicate_http_error (connptr, 400, "Bad Request", + "detail", "Unknown destination", +- "url", url, NULL); ++ "url", *url, NULL); + return 0; + } + +@@ -83,15 +83,15 @@ do_transparent_proxy (struct conn_s *con + request->port = ntohs (dest_addr.sin_port); + + request->path = (char *) safemalloc (ulen + 1); +- strlcpy (request->path, url, ulen + 1); ++ strlcpy (request->path, *url, ulen + 1); + + /* url overwritten by the call below is the url passed + * to this function, and is not the url variable in the + * caller. */ +- build_url (&url, request->host, request->port, request->path); ++ build_url (url, request->host, request->port, request->path); + log_message (LOG_INFO, + "process_request: trans IP %s %s for %d", +- request->method, url, connptr->client_fd); ++ request->method, *url, connptr->client_fd); + } else { + request->host = (char *) safemalloc (length + 1); + if (sscanf (data, "%[^:]:%hu", request->host, &request->port) != +@@ -101,15 +101,15 @@ do_transparent_proxy (struct conn_s *con + } + + request->path = (char *) safemalloc (ulen + 1); +- strlcpy (request->path, url, ulen + 1); ++ strlcpy (request->path, *url, ulen + 1); + + /* url overwritten by the call below is the url passed + * to this function, and is not the url variable in the + * caller. */ +- build_url (&url, request->host, request->port, request->path); ++ build_url (url, request->host, request->port, request->path); + log_message (LOG_INFO, + "process_request: trans Host %s %s for %d", +- request->method, url, connptr->client_fd); ++ request->method, *url, connptr->client_fd); + } + if (conf->ipAddr && strcmp (request->host, conf->ipAddr) == 0) { + log_message (LOG_ERR, +@@ -118,7 +118,7 @@ do_transparent_proxy (struct conn_s *con + indicate_http_error (connptr, 400, "Bad Request", + "detail", + "You tried to connect to the machine " +- "the proxy is running on", "url", url, ++ "the proxy is running on", "url", *url, + NULL); + return 0; + } +--- a/src/transparent-proxy.h ++++ b/src/transparent-proxy.h +@@ -32,7 +32,7 @@ + extern int do_transparent_proxy (struct conn_s *connptr, + hashmap_t hashofheaders, + struct request_s *request, +- struct config_s *config, char *url); ++ struct config_s *config, char **url); + + #endif + diff --git a/net/tinyproxy/patches/120-fix_INET6.patch b/net/tinyproxy/patches/120-fix_INET6.patch new file mode 100644 index 0000000..1c26835 --- /dev/null +++ b/net/tinyproxy/patches/120-fix_INET6.patch @@ -0,0 +1,38 @@ +--- a/src/sock.c ++++ b/src/sock.c +@@ -39,8 +39,7 @@ + * returned if the bind succeeded. Otherwise, -1 is returned + * to indicate an error. + */ +-static int +-bind_socket (int sockfd, const char *addr, int family) ++static int bind_socket (int sockfd, const char *addr) + { + struct addrinfo hints, *res, *ressave; + +@@ -48,7 +47,7 @@ bind_socket (int sockfd, const char *add + assert (addr != NULL && strlen (addr) != 0); + + memset (&hints, 0, sizeof (struct addrinfo)); +- hints.ai_family = family; ++ hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + + /* The local port it not important */ +@@ -106,14 +105,12 @@ int opensock (const char *host, int port + + /* Bind to the specified address */ + if (bind_to) { +- if (bind_socket (sockfd, bind_to, +- res->ai_family) < 0) { ++ if (bind_socket (sockfd, bind_to) < 0) { + close (sockfd); + continue; /* can't bind, so try again */ + } + } else if (config.bind_address) { +- if (bind_socket (sockfd, config.bind_address, +- res->ai_family) < 0) { ++ if (bind_socket (sockfd, config.bind_address) < 0) { + close (sockfd); + continue; /* can't bind, so try again */ + } diff --git a/net/tmsnc/Makefile b/net/tmsnc/Makefile new file mode 100644 index 0000000..b7b25fc --- /dev/null +++ b/net/tmsnc/Makefile @@ -0,0 +1,49 @@ +# +# 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:=tmsnc +PKG_VERSION:=0.3.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/tmsnc +PKG_MD5SUM:=337dae91d4775e03b6681f61db56d2a7 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/tmsnc + SUBMENU:=Instant Messaging + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libncurses +libopenssl +libpthread + TITLE:=text-based MSN client + URL:=http://tmsnc.sourceforge.net +endef + +define Package/tmsnc/description + TMSNC is a textbased (console) MSN client written in C. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-rpath \ + --with-openssl="$(STAGING_DIR)/usr" \ + --with-ncurses="$(STAGING_DIR)/usr" \ + --without-libiconv-prefix \ + ) +endef + +define Package/tmsnc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tmsnc $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,tmsnc)) diff --git a/net/tor-alpha/Makefile b/net/tor-alpha/Makefile new file mode 100644 index 0000000..d369fd8 --- /dev/null +++ b/net/tor-alpha/Makefile @@ -0,0 +1,118 @@ +# +# Copyright (C) 2008-2012 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:=tor-alpha +PKG_VERSION:=0.2.3.22-rc +PKG_RELEASE:=1 + +PKG_SOURCE:=tor-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://www.torproject.org/dist \ + https://archive.torproject.org/tor-package-archive +PKG_MD5SUM:=c07431ee40a0e16dc1b4d1e8d266680c + +PKG_BUILD_DEPENDS:=libminiupnpc libnatpmp +PKG_BUILD_DIR:=$(BUILD_DIR)/tor-$(PKG_VERSION) +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/tor-alpha/Default + SECTION:=net + CATEGORY:=Network + URL:=https://www.torproject.org/ +endef + +define Package/tor-alpha/Default/description + Tor is a toolset for a wide range of organizations and people that want to + improve their safety and security on the Internet. Using Tor can help you + anonymize web browsing and publishing, instant messaging, IRC, SSH, and + more. Tor also provides a platform on which software developers can build + new applications with built-in anonymity, safety, and privacy features. +endef + +define Package/tor-alpha +$(call Package/tor-alpha/Default) + TITLE:=An anonymous Internet communication system + DEPENDS:=+libevent2 +libevent2-openssl +libpthread +librt +endef + +define Package/tor-alpha/description +$(call Package/tor-alpha/Default/description) + This package contains the tor daemon. +endef + +define Package/tor-alpha-fw-helper +$(call Package/tor-alpha/Default) + TITLE:=Firewall helper for tor + DEPENDS:=+tor-alpha +libminiupnpc +libnatpmp +endef + +define Package/tor-alpha-fw-helper/description +$(call Package/tor-alpha/Default/description) + This package contains a helper for automatically configuring port forwarding. +endef + +define Package/tor-alpha-geoip +$(call Package/tor-alpha/Default) + TITLE:=GeoIP db for tor + DEPENDS:=+tor-alpha +endef + +define Package/tor-alpha-geoip/description +$(call Package/tor-alpha/Default/description) + This package contains a GeoIP database mapping IP addresses to countries. +endef + +define Package/tor-alpha/conffiles +/etc/tor/torrc +endef + +CONFIGURE_ARGS += \ + --with-libevent-dir="$(STAGING_DIR)/usr" \ + --with-ssl-dir="$(STAGING_DIR)/usr" \ + --enable-upnp \ + --with-libminiupnpc-dir="$(STAGING_DIR)/usr" \ + --enable-nat-pmp \ + --with-libnatpmp-dir="$(STAGING_DIR)/usr" \ + --disable-asciidoc + +ifneq ($(CONFIG_SSP_SUPPORT),y) + CONFIGURE_ARGS += \ + --disable-gcc-hardening +endif + +CONFIGURE_VARS += \ + CROSS_COMPILE="yes" + +# pass CFLAGS again to override -O2 set by configure +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS)" + +define Package/tor-alpha/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(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-alpha-fw-helper/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-fw-helper $(1)/usr/bin/ +endef + +define Package/tor-alpha-geoip/install + $(INSTALL_DIR) $(1)/usr/share/tor + $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/ +endef + +$(eval $(call BuildPackage,tor-alpha)) +$(eval $(call BuildPackage,tor-alpha-fw-helper)) +$(eval $(call BuildPackage,tor-alpha-geoip)) diff --git a/net/tor-alpha/files/tor.init b/net/tor-alpha/files/tor.init new file mode 100644 index 0000000..8d11089 --- /dev/null +++ b/net/tor-alpha/files/tor.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 +STOP=50 + +SERVICE_USE_PID=1 + +start() { + user_exists tor 52 || user_add tor 52 52 /var/lib/tor + group_exists tor 52 || group_add tor 52 + [ -f /var/run/tor.pid ] || { + touch /var/run/tor.pid + chown tor:tor /var/run/tor.pid + } + [ -d /var/lib/tor ] || { + mkdir -m 0755 -p /var/lib/tor + chmod 0700 /var/lib/tor + chown tor:tor /var/lib/tor + } + [ -d /var/log/tor ] || { + mkdir -m 0755 -p /var/log/tor + chown tor:tor /var/log/tor + } + service_start /usr/sbin/tor --PidFile /var/run/tor.pid +} + +stop() { + service_stop /usr/sbin/tor +} diff --git a/net/tor-alpha/patches/001-torrc.patch b/net/tor-alpha/patches/001-torrc.patch new file mode 100644 index 0000000..988cb8e --- /dev/null +++ b/net/tor-alpha/patches/001-torrc.patch @@ -0,0 +1,21 @@ +--- 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 + + ## 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. +-#DataDirectory @LOCALSTATEDIR@/lib/tor ++DataDirectory @LOCALSTATEDIR@/lib/tor + + ## The port on which Tor will listen for local connections from Tor + ## controller applications, as documented in control-spec.txt. +@@ -187,3 +187,4 @@ + ## address manually to your friends, uncomment this line: + #PublishServerDescriptor 0 + ++User tor diff --git a/net/tor/Makefile b/net/tor/Makefile new file mode 100644 index 0000000..04c5055 --- /dev/null +++ b/net/tor/Makefile @@ -0,0 +1,80 @@ +# +# Copyright (C) 2008-2012 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:=tor +PKG_VERSION:=0.2.2.39 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://www.torproject.org/dist \ + https://archive.torproject.org/tor-package-archive +PKG_MD5SUM:=9157a1f02fcda9d7d2c5744176373abd + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/tor/Default + SECTION:=net + CATEGORY:=Network + URL:=https://www.torproject.org/ +endef + +define Package/tor/Default/description + Tor is a toolset for a wide range of organizations and people that want to + improve their safety and security on the Internet. Using Tor can help you + anonymize web browsing and publishing, instant messaging, IRC, SSH, and + more. Tor also provides a platform on which software developers can build + new applications with built-in anonymity, safety, and privacy features. +endef + +define Package/tor +$(call Package/tor/Default) + TITLE:=An anonymous Internet communication system + DEPENDS:=+libevent2 +libopenssl +libpthread +librt +endef + +define Package/tor-geoip +$(call Package/tor/Default) + TITLE:=GeoIP db for tor + DEPENDS:=+tor +endef + +define Package/tor/conffiles +/etc/tor/torrc +endef + +CONFIGURE_ARGS += \ + --with-libevent-dir="$(STAGING_DIR)/usr" \ + --with-ssl-dir="$(STAGING_DIR)/usr" \ + --disable-asciidoc + +CONFIGURE_VARS += \ + CROSS_COMPILE="yes" + +# pass CFLAGS again to override -O2 set by configure +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS)" + +define Package/tor/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(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-geoip/install + $(INSTALL_DIR) $(1)/usr/share/tor + $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/ +endef + +$(eval $(call BuildPackage,tor)) +$(eval $(call BuildPackage,tor-geoip)) diff --git a/net/tor/files/tor.init b/net/tor/files/tor.init new file mode 100644 index 0000000..8d11089 --- /dev/null +++ b/net/tor/files/tor.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 +STOP=50 + +SERVICE_USE_PID=1 + +start() { + user_exists tor 52 || user_add tor 52 52 /var/lib/tor + group_exists tor 52 || group_add tor 52 + [ -f /var/run/tor.pid ] || { + touch /var/run/tor.pid + chown tor:tor /var/run/tor.pid + } + [ -d /var/lib/tor ] || { + mkdir -m 0755 -p /var/lib/tor + chmod 0700 /var/lib/tor + chown tor:tor /var/lib/tor + } + [ -d /var/log/tor ] || { + mkdir -m 0755 -p /var/log/tor + chown tor:tor /var/log/tor + } + service_start /usr/sbin/tor --PidFile /var/run/tor.pid +} + +stop() { + service_stop /usr/sbin/tor +} diff --git a/net/tor/patches/001-torrc.patch b/net/tor/patches/001-torrc.patch new file mode 100644 index 0000000..c788dd0 --- /dev/null +++ b/net/tor/patches/001-torrc.patch @@ -0,0 +1,21 @@ +--- a/src/config/torrc.sample.in ++++ b/src/config/torrc.sample.in +@@ -44,11 +44,11 @@ SocksListenAddress 127.0.0.1 # accept co + ## 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 + + ## 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. +-#DataDirectory @LOCALSTATEDIR@/lib/tor ++DataDirectory @LOCALSTATEDIR@/lib/tor + + ## The port on which Tor will listen for local connections from Tor + ## controller applications, as documented in control-spec.txt. +@@ -168,3 +168,4 @@ SocksListenAddress 127.0.0.1 # accept co + #BridgeRelay 1 + #ExitPolicy reject *:* + ++User tor diff --git a/net/transmission/Makefile b/net/transmission/Makefile new file mode 100644 index 0000000..bd96d24 --- /dev/null +++ b/net/transmission/Makefile @@ -0,0 +1,122 @@ +# +# Copyright (C) 2009-2012 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:=transmission +PKG_VERSION:=2.71 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://mirrors.m0k.org/transmission/files +PKG_MD5SUM:=902393c5a054b4ed4953f7a16d13801a + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/transmission/template + SUBMENU:=BitTorrent + SECTION:=net + CATEGORY:=Network + TITLE:=A free, lightweight BitTorrent client + URL:=http://www.transmissionbt.com + MAINTAINER:=Cezary Jackiewicz +endef + +define Package/transmission-daemon + $(call Package/transmission/template) + DEPENDS:=+libcurl +libopenssl +libpthread +libevent2 +librt +libminiupnpc + MENU:=1 +endef + +define Package/transmission-cli + $(call Package/transmission/template) + DEPENDS:=transmission-daemon +endef + +define Package/transmission-remote + $(call Package/transmission/template) + DEPENDS:=+libcurl +libopenssl +libpthread +libevent2 +librt +libminiupnpc +endef + +define Package/transmission-web + $(call Package/transmission/template) + DEPENDS:=transmission-daemon +endef + + +define Package/transmission-daemon/description + Transmission is a simple BitTorrent client. + It features a very simple, intuitive interface + on top on an efficient, cross-platform back-end. + This package contains the daemon itself. +endef + +define Package/transmission-cli/description + CLI utilities for transmission. +endef + +define Package/transmission-remote/description + CLI remote interface for transmission. +endef + +define Package/transmission-web/description + Webinterface resources for transmission. +endef + +define Package/transmission-daemon/conffiles +/etc/config/transmission +endef + +CONFIGURE_VARS += \ + LIBEVENT_LIBS="$(STAGING_DIR)/usr/lib/libevent-2.0.so.5" + +CONFIGURE_ARGS += \ + --enable-daemon \ + --enable-cli \ + --disable-gtk \ + --enable-largefile \ + --enable-lightweight + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE" + +define Package/transmission-daemon/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-daemon $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) files/transmission.init $(1)/etc/init.d/transmission + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) files/transmission.config $(1)/etc/config/transmission +endef + +define Package/transmission-cli/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-cli \ + $(PKG_INSTALL_DIR)/usr/bin/transmission-create \ + $(PKG_INSTALL_DIR)/usr/bin/transmission-edit \ + $(PKG_INSTALL_DIR)/usr/bin/transmission-show \ + $(1)/usr/bin/ +endef + +define Package/transmission-remote/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-remote $(1)/usr/bin/ +endef + +define Package/transmission-web/install + $(INSTALL_DIR) $(1)/usr/share/transmission + $(CP) $(PKG_INSTALL_DIR)/usr/share/transmission/web $(1)/usr/share/transmission/ +endef + +$(eval $(call BuildPackage,transmission-daemon)) +$(eval $(call BuildPackage,transmission-cli)) +$(eval $(call BuildPackage,transmission-remote)) +$(eval $(call BuildPackage,transmission-web)) diff --git a/net/transmission/files/transmission.config b/net/transmission/files/transmission.config new file mode 100644 index 0000000..a8fd56d --- /dev/null +++ b/net/transmission/files/transmission.config @@ -0,0 +1,71 @@ +config transmission + option enabled 0 + option config_dir '/tmp/transmission' + #option user 'nobody' + option alt_speed_down 50 + option alt_speed_enabled false + option alt_speed_time_begin 540 + option alt_speed_time_day 127 + option alt_speed_time_enabled false + option alt_speed_time_end 1020 + option alt_speed_up 50 + option bind_address_ipv4 '0.0.0.0' + option bind_address_ipv6 '::' + option blocklist_enabled false + option blocklist_url '' + option cache_size_mb 2 + option dht_enabled true + option download_dir '/tmp/transmission/done' + option download_queue_enabled true + option download_queue_size 4 + option encryption 1 + option idle_seeding_limit 30 + option idle_seeding_limit_enabled false + option incomplete_dir '/tmp/transmission/incomplete' + option incomplete_dir_enabled false + option lazy_bitfield_enabled true + option lpd_enabled false + option message_level 1 + option peer_congestion_algorithm '' + option peer_limit_global 240 + option peer_limit_per_torrent 60 + option peer_port 51413 + option peer_port_random_high 65535 + option peer_port_random_low 49152 + option peer_port_random_on_start false + option peer_socket_tos 'default' + option pex_enabled true + option port_forwarding_enabled true + option preallocation 1 + option prefetch_enabled true + option queue_stalled_enabled true + option queue_stalled_minutes 30 + option ratio_limit 2.0000 + option ratio_limit_enabled false + option rename_partial_files true + option rpc_authentication_required false + option rpc_bind_address '0.0.0.0' + option rpc_enabled true + option rpc_password '' + option rpc_port 9091 + option rpc_url '/transmission/' + option rpc_username '' + option rpc_whitelist '127.0.0.1,192.168.1.*' + option rpc_whitelist_enabled true + option scrape_paused_torrents_enabled true + option script_torrent_done_enabled false + option script_torrent_done_filename '' + option seed_queue_enabled false + option seed_queue_size 10 + option speed_limit_down 100 + option speed_limit_down_enabled false + option speed_limit_up 20 + option speed_limit_up_enabled false + option start_added_torrents true + option trash_original_torrent_files false + option umask 18 + option upload_slots_per_torrent 14 + option utp_enabled true + option scrape_paused_torrents true + option watch_dir_enabled false + option watch_dir '' diff --git a/net/transmission/files/transmission.init b/net/transmission/files/transmission.init new file mode 100644 index 0000000..669e710 --- /dev/null +++ b/net/transmission/files/transmission.init @@ -0,0 +1,111 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2012 OpenWrt.org + +START=99 + +LIST_SEP=" +" + +append_params() { + local p; local v; local s="$1"; shift + for p in $*; do + config_get v "$s" "$p" + IFS="$LIST_SEP" + for v in $v; do + [ -n "$v" ] && ( + echo "\""$p"\": "$v"," | sed -e 's|_|-|g' >> $config_file + ) + done + unset IFS + done +} + +append_params_quotes() { + local p; local v; local s="$1"; shift + for p in $*; do + config_get v "$s" "$p" + IFS="$LIST_SEP" + for v in $v; do + [ -n "$v" ] && ( + echo -n "\""$p | sed -e 's|/|\\/|g;s|_|-|g' >> $config_file; \ + echo "\": \""$v"\"," >> $config_file + ) + done + unset IFS + done +} + +section_enabled() { + config_get_bool enabled "$1" 'enabled' 0 + [ $enabled -gt 0 ] +} + +start_instance() { + local s="$1" + local user + + section_enabled "$section" || return 1 + + config_get config_dir "$s" 'config_dir' '/var/etc/transmission' + config_get user "$s" 'user' + + config_file="$config_dir/settings.json" + [ -d $config_dir ] || { + mkdir -m 0755 -p "$config_dir" + touch $config_file + [ -z "$user" ] || chown -R $user $config_dir + } + + echo "{" > $config_file + + append_params "$s" \ + alt_speed_down alt_speed_enabled alt_speed_time_begin alt_speed_time_day \ + alt_speed_time_enabled alt_speed_time_end alt_speed_up blocklist_enabled \ + cache_size_mb download_queue_enabled download_queue_size \ + dht_enabled encryption idle_seeding_limit idle_seeding_limit_enabled \ + incomplete_dir_enabled lazy_bitfield_enabled lpd_enabled message_level \ + peer_limit_global peer_limit_per_torrent peer_port \ + peer_port_random_high peer_port_random_low peer_port_random_on_start \ + pex_enabled port_forwarding_enabled preallocation prefetch_enabled \ + ratio_limit ratio_limit_enabled rename_partial_files rpc_authentication_required \ + rpc_enabled rpc_port rpc_whitelist_enabled queue_stalled_enabled \ + queue_stalled_minutes scrape_paused_torrents_enabled script_torrent_done_enabled \ + seed_queue_enabled seed_queue_size \ + speed_limit_down speed_limit_down_enabled speed_limit_up \ + speed_limit_up_enabled start_added_torrents trash_original_torrent_files \ + umask upload_slots_per_torrent utp_enabled scrape_paused_torrents \ + watch_dir_enabled + + append_params_quotes "$s" \ + blocklist_url bind_address_ipv4 bind_address_ipv6 download_dir incomplete_dir \ + peer_congestion_algorithm peer_socket_tos rpc_bind_address rpc_password rpc_url \ + rpc_username rpc_whitelist script_torrent_done_filename watch_dir + + echo "\""invalid-key"\": false" >> $config_file + echo "}" >> $config_file + + SERVICE_UID="$user" \ + service_start /usr/bin/transmission-daemon -g $config_dir +} + +stop_instance() { + local s="$1" + local user + + section_enabled "$section" || return 1 + + config_get user "$s" 'user' + + SERVICE_UID="$user" \ + service_stop /usr/bin/transmission-daemon +} + +start() { + config_load 'transmission' + config_foreach start_instance 'transmission' +} + +stop() { + config_load 'transmission' + config_foreach stop_instance 'transmission' +} diff --git a/net/transmission/patches/010_libtransmission_fallocate64_eglibc.patch b/net/transmission/patches/010_libtransmission_fallocate64_eglibc.patch new file mode 100644 index 0000000..15ae518 --- /dev/null +++ b/net/transmission/patches/010_libtransmission_fallocate64_eglibc.patch @@ -0,0 +1,13 @@ +diff -Naur transmission-2.61/libtransmission/fdlimit.c transmission-2.61-new/libtransmission/fdlimit.c +--- transmission-2.61/libtransmission/fdlimit.c 2012-07-24 04:59:03.429474697 +0300 ++++ transmission-2.61-new/libtransmission/fdlimit.c 2012-07-31 14:40:23.999860054 +0300 +@@ -25,7 +25,8 @@ + #include + #endif + +-#ifdef HAVE_FALLOCATE64 ++/* no need to define fallocate64 in glibc/eglibc case */ ++#if defined(__UCLIBC__) && (HAVE_FALLOCATE64) + /* FIXME can't find the right #include voodoo to pick up the declaration.. */ + extern int fallocate64( int fd, int mode, uint64_t offset, uint64_t len ); + #endif diff --git a/net/transocks/Makefile b/net/transocks/Makefile new file mode 100644 index 0000000..6e2cf14 --- /dev/null +++ b/net/transocks/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2011 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:=transocks +PKG_VERSION:=1.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=:pserver:anonymous@transocks.cvs.sourceforge.net:/cvsroot/transocks +PKG_SOURCE_SUBDIR:=transocks +PKG_SOURCE_VERSION:=-DNOW +PKG_SOURCE_PROTO:=cvs + +include $(INCLUDE_DIR)/package.mk + +PKG_UNPACK:=gzip -dc $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xf - + +define Build/Compile + $(TARGET_CC) \ + -I$(STAGING_DIR)/usr/include \ + $(TARGET_CFLAGS) $(TARGET_LDFLAGS) \ + $(LIBRPC) -lsocks -o \ + $(PKG_BUILD_DIR)/transocks \ + $(PKG_BUILD_DIR)/transocks.c +endef + +define Package/transocks + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=Transparent SOCKSifying proxy + DEPENDS:=+libsocks $(LIBRPC_DEPENDS) +endef + +define Package/transocks/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/transocks $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,transocks)) diff --git a/net/tsocks/Makefile b/net/tsocks/Makefile new file mode 100644 index 0000000..305fc36 --- /dev/null +++ b/net/tsocks/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2007 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:=tsocks +PKG_VERSION:=1.8 +PKG_RELEASE:=1 +PKG_MD5SUM:=51caefd77e5d440d0bbd6443db4fc0f8 + +PKG_SOURCE_URL:=@SF/tsocks +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)beta5.tar.gz + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/tsocks + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=Transparent SOCKS v4 proxying library + URL:=http://tsocks.sourceforge.net/ +endef + +define Package/tsocks/description +Transparent SOCKS v4 proxying library +endef + +define Build/Configure + $(call Build/Configure/Default,\ + --with-conf=/etc/tsocks.conf \ + ) +endef + +define Package/tsocks/install + $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tsocks $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/lib/libtsocks.so{,*} $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,tsocks)) diff --git a/net/tsocks/patches/100-no_static.patch b/net/tsocks/patches/100-no_static.patch new file mode 100644 index 0000000..1a9afb4 --- /dev/null +++ b/net/tsocks/patches/100-no_static.patch @@ -0,0 +1,11 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -47,7 +47,7 @@ + ${SHCC} ${CFLAGS} ${INCLUDES} -o ${INSPECT} ${INSPECT}.c ${COMMON}.o ${LIBS} + + ${SAVE}: ${SAVE}.c +- ${SHCC} ${CFLAGS} ${INCLUDES} -static -o ${SAVE} ${SAVE}.c ++ ${SHCC} ${CFLAGS} ${INCLUDES} -o ${SAVE} ${SAVE}.c + + ${SHLIB}: ${OBJS} ${COMMON}.o ${PARSER}.o + ${SHCC} ${CFLAGS} ${INCLUDES} -nostdlib -shared -o ${SHLIB} ${OBJS} ${COMMON}.o ${PARSER}.o ${DYNLIB_FLAGS} ${SPECIALLIBS} ${LIBS} diff --git a/net/ttcp/Makefile b/net/ttcp/Makefile new file mode 100644 index 0000000..3badab6 --- /dev/null +++ b/net/ttcp/Makefile @@ -0,0 +1,38 @@ +# +# 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:=ttcp +PKG_VERSION:=3.8 +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/ttcp + +include $(INCLUDE_DIR)/package.mk + +define Package/ttcp + SECTION:=net + CATEGORY:=Network + TITLE:=A TCP connection performance tester + URL:=https://dev.openwrt.org/browser/packages/net/ttcp/ +endef + +define Package/ttcp/description + A small utility to test TCP connection performance. +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/ttcp ttcp.c +endef + +define Package/ttcp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ttcp $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,ttcp)) diff --git a/net/ttcp/ttcp.c b/net/ttcp/ttcp.c new file mode 100644 index 0000000..7233ace --- /dev/null +++ b/net/ttcp/ttcp.c @@ -0,0 +1,2374 @@ +/* + * T T C P . C + * + * Test TCP connection. Makes a connection on port 5010 + * and transfers fabricated buffers or data copied from stdin. + * + * Usable on 4.2, 4.3, and 4.1a systems by defining one of + * BSD42 BSD43 (BSD41a) + * Machines using System V with BSD sockets should define SYSV. + * + * Modified for operation under 4.2BSD, 18 Dec 84 + * T.C. Slattery, USNA + * Minor improvements, Mike Muuss and Terry Slattery, 16-Oct-85. + * Modified in 1989 at Silicon Graphics, Inc. + * catch SIGPIPE to be able to print stats when receiver has died + * for tcp, don't look for sentinel during reads to allow small transfers + * increased default buffer size to 8K, nbuf to 2K to transfer 16MB + * moved default port to 5001, beyond IPPORT_USERRESERVED + * make sinkmode default because it is more popular, + * -s now means don't sink/source + * count number of read/write system calls to see effects of + * blocking from full socket buffers + * for tcp, -D option turns off buffered writes (sets TCP_NODELAY sockopt) + * buffer alignment options, -A and -O + * print stats in a format that's a bit easier to use with grep & awk + * for SYSV, mimic BSD routines to use most of the existing timing code + * Modified by Steve Miller of the University of Maryland, College Park + * -b sets the socket buffer size (SO_SNDBUF/SO_RCVBUF) + * Modified Sept. 1989 at Silicon Graphics, Inc. + * restored -s sense at request of tcs@brl + * Modified Oct. 1991 at Silicon Graphics, Inc. + * use getopt(3) for option processing, add -f and -T options. + * SGI IRIX 3.3 and 4.0 releases don't need #define SYSV. + * + * Modified --> Nov 1996 at CERN (Daniel DAVIDS) + * printout of the Socket-Buffer-Sizes + * configured for HP-UX 9000 OS + * configured for Windows NT OS + * Modified Dec 1996 at CERN (Jacques ROCHEZ) + * severe cleanup + * addaptation to the gcc compiler (ANSI) + * configured for Lynx OS + * automatic format for the rate display (G/M/K/)bytes/sec + * added log (L) and more help (h) options. + * Modified May 1997 at CERN (Jacques ROCHEZ) + * removed the mes() function following err() function. + * changed the default port to 5010 + * Modified jul 1997 at CERN (Jacques ROCHEZ) + * adapted the timing calculation in microseconds + * addapted the code for Vsisual C++ under NT4.0 + * Modified aug 1997 at CERN (Jacques ROCHEZ) + * initialise to 0 the variables nbytes, numcalls + * moved the buffer pre-load outside the measured timed area + * Distribution Status - + * Public Domain. Distribution Unlimited. + * Modified jun 1998 at Epigram + * - print hash marks to indicate prograss on transmitting side + * - sleep between bursts of buffers + * - set number of buffers/burst + * Modified jul 1998 at Epigram + * - send random size buffers + * Modified jan 1999 at Epigram (WES) + * - added start and end patterns to UDP start and end packets + * - added handling of missed start, end, or data packets for UDP tests + */ +#ifndef lint +static char RCSid[] = "ttcp.c $- CERN Revision: 3.8 (dev level) -$"; +#endif + +static char VersDate[] = "Epigram 15-jul-98"; + +/* system dependent setting + * ------------------------ + * uname -a,gcc -v a.c are the tools used + * + * Platform/OS #define MACRO predefined + * ----------- ------- --------------------------------------------------- + * SunOS OS BSD43 __unix__ __sun__ __sparc__ + * SUN Solaris SYSV __unix__ __sun__ __sparc__ __svr4__ + * SGI-IRIX < 3.3 SYSV set as #define sgi + * HP-UX 9000 SYSV __unix__ __hpux__ __hp9k8__ + * OSF/1 V3.2 SYSV __unix__ __osf__ __alpha__ + * OSF/1 V4.0 SYSV __unix__ __osf__ __alpha__ _CFE + * LynxOS SYSV __unix__ __lynx__ __powerpc__ + * Windows NT SYSV __WINNT__ __i386__ __M_COFF__ + * AIX SYSV _AIX _AIX32 _POWER _IBMR2 _ARCH_PWR + + + * Micosoft Visual C++ compiler under WindowNT 4.0 + * Windows NT _WINDOWS WIN32 + + * Unix BSD 41a BSD41a + * 42 BSD42 + * 43 BSD43 + + * Machines using System V with BSD sockets should define SYSV. + * + * Compiler commands + * ----------------- + * LynxOS : gcc -c ttcp.c -o ttcp.o | gcc -o ttcp -O ttcp.o -lnetinet -lc_p -lc + */ + +/* -------------attempt to set an automatic UNIX OS family detection -------*/ + +#if defined(__hp9k8__) || defined(__osf__) || defined(__srv4__) +#define SYSV +#endif +#if defined(__lynx__) +#define SYSV +#endif +/* for solaris (__srv4__) the parameters SYSV is already set */ + +/* version A.09.01 'key words' differs from A.09.05 A */ +#if defined(__hpux) +#define __hpux__ +#endif + +#if defined(__sun__)&&!defined(__srv4__) +#define BSD43 /* changed by BSD42 if necessary */ +#endif + +#if defined(_WIN32) /* Window NT 4.0 compiled with VisualC++ 4 */ +#define __NTVIS__ +#define SYSV +#endif + +#if defined(__FreeBSD__) +#define BSD43 +#endif + +#if defined(__linux__) +#define BSD43 +#endif +/*--------------------------------------------------------------------------*/ + +#if !defined(UNDER_CE) +#include +#include +#include +#include +#endif + +#if defined(SYSV) + +#if defined(__osf__) +#include +#include +#include +#include +#include +#include /* struct timeval */ +#include /* definition of struct rusage */ + +#else /* else of __osf__ */ +#if defined(__NTVIS__) +#include +#include /* required for all Windows applications */ +#include +#include +#include +#if !defined(UNDER_CE) +#include +#include +#endif +#include +#include +struct rusage { struct timeval ru_utime, ru_stime; }; +#define RUSAGE_SELF 0 +#else /* else of __NTVIS__ */ +#if defined(__lynx__) +#include /* located in /usr/include/..... */ +#include +#include +#include +#include +#include +#include /* definition of struct rusage */ +#include +#define RUSAGE_SELF 0 +#include /* definition of TICKSPERSEC (HZ) */ +#include + +#else /* else of __Lynx__ */ +#if defined(__svr4__) +#include +#include +#include +#include +#include +#include +#include /* struct timeval */ +#include /* definition of struct rusage */ +#include +#define RUSAGE_SELF 0 +#include + +#else /* else of __svr4__ all SYSV cases except those mentionned before */ +#include +#include +#include +#include +#include +#include /* struct timeval */ +#include /* definition of struct rusage */ +#include +#define RUSAGE_SELF 0 +#include + +#endif /* __svr4__ */ +#endif /* __lynx__ */ +#endif /* __NTVIS__ */ +#endif /* __osf__ */ + +#else /* else of SYSV it is a BSD OS */ +#include +#include +#include +#include +#include +#include +#include +#if defined(__linux__) +#include /* struct timeval */ +#else +#include /* struct timeval */ +#endif +#include /* definition of struct rusage */ +#include /* for usleep() - henry */ +#define SOCKET_ERROR -1 + +#endif /* SYSV */ + +#if defined(__NTVIS__) + +#if defined(_DEBUG) /* usual debug symbol for VC++ */ +#define DEBUG 1 +#endif + +void usleep(unsigned int microseconds); + +#define bcopy(a,b,n) memcpy((b), (a), (n)) +#define bzero(a,n) memset((a), 0, (n)) + +#ifndef _GETOPT_ +#define _GETOPT_ +int getopt(int argc, char **argv, char *optstring); + +extern char *optarg; // returned arg to go with this option +extern int optind; // index to next argv element to process +extern int opterr; // should error messages be printed? +extern int optopt; // + +#define BADCH ('?') +#endif // _GETOPT + +/* get option letter from argument vector */ +int + opterr = 1, // should error messages be printed? + optind = 1, // index into parent argv vector + optopt; // character checked for validity +char *optarg; // argument associated with option + +#define EMSG "" +char *progname; // may also be defined elsewhere +#endif /*__NTVIS__*/ + +/* sockaddr_in == file server address structure + * + * Socket address, internet style. declared in : /netinet/in.h + * struct sockaddr_in {short sin_family; + * u_short sin_port; + * struct in_addr sin_addr; + * char sin_zero[8]; + * }; + * + * Structure used by kernel to store most addresses. declared in ./sys/socket.h + * struct sockaddr{u_short sa_family; address family + * char sa_data[14]; up to 14 bytes of direct address + * }; + * PS : sin stand for "socket internet number" + */ + +#ifndef __NTVIS__ +#define FAR +#endif + +#if defined(__CONST_SOCKADDR_ARG) +#define SOCKADDR_CAST (__CONST_SOCKADDR_ARG) +#elif defined(__lynx__) || defined(__sun__) || defined(_AIX) || defined(__FreeBSD__) || defined(__NTVIS__) +#define SOCKADDR_CAST (struct sockaddr FAR *) +#else +#define SOCKADDR_CAST +#endif + +#if defined(__sun__) +struct sockaddr_in sockaddr; /* done in ./X11/Xdmcp.h */ +#endif + +struct sockaddr_in sinme; /* is the socket struct. in the local host */ +struct sockaddr_in sinhim; /* is the socket struc. in the remote host */ + +#if defined(__lynx__) || defined(__svr4__) || defined(_AIX) +struct sockaddr frominet; +#else +struct sockaddr_in frominet; +#endif /* __lynx__ */ + +int domain, fromlen; + +#if !defined(__NTVIS__) +#define SOCKET int +#endif /* __NTVIS__ */ +SOCKET fd; /* fd of network socket */ + +#if !defined(__lynx__) +extern int errno; +#endif + +#include + +FILE *fplog = NULL; /* file pointer for the log file */ +char logfile[100]; /* file name for the log */ +static char logfile_head[] ="ttcp_log"; /* header name for the log */ +int buflen = 8 * 1024; /* length of buffer */ +char *buf; /* ptr to dynamic buffer */ +int nbuf = 2 * 1024; /* number of buffers to send in sinkmode */ + +#define START_PKT_LEN 4 +#define START_PATTERN_LEN 4 +#define END_PKT_LEN 8 +#define END_PATTERN_LEN 4 +#define MIN_UDP_LEN 5 + +char start_pattern[START_PATTERN_LEN] = {1, 2, 3, 4}; +char end_pattern[END_PATTERN_LEN] = {2, 2, 2, 2}; + +int bufoffset = 0; /* align buffer to this */ +int bufalign = 16*1024; /* modulo this */ + +int udp = 0; /* 0 = tcp, !0 = udp */ +int options = 0; /* socket options */ +int one = 1; /* for 4.3 BSD style setsockopt() */ +short port = 5010; /* TCP port number */ +char *host; /* ptr to name of host */ +int rndm = 0; /* 0="normal", !0=random data */ +int trans; /* 0=receive, !0=transmit mode */ +int timeout; /* read timeout in millisec */ +int debug = 0; /* 0=No-Debug, 1=Debug-Set-On */ +int sinkmode = 0; /* 0=normal I/O, !0=sink/source mode */ +int verbose = 0; /* 0=print basic info, 1=print cpu rate, + * proc resource usage. */ +int nodelay = 0; /* set TCP_NODELAY socket option */ +int pri = 0; /* link layer priority */ +int b_flag = 0; /* use mread() */ +int log_cnt = 0; /* append result to a log */ +int sockbufsize = 0; /* socket buffer size to use */ +char fmt = 'A'; /* output format: + * b = bits, B = bytes, + * k = kilobits, K = kilobytes, + * m = megabits, M = megabytes, + * g = gigabits, G = gigabytes, + * A = automatic Xbytes (default) */ +int touchdata = 0; /* access data after reading */ +int seq_info = 0; /* report out of order seq nums */ + +int hash = 0; /* print hash marks for each buffer */ +int udpsleep = 0; /* sleep in between udp buffers */ +int burstn = 1; /* number of buffers per burst */ +int bufmin = -1; /* minimum buffer size to use when + sending random-size buffers */ +unsigned int seed = 1; /* seed for random number generator + used for random buffer lengths */ +int no_start = 0; /* skip the start frames for UDP */ +int no_data = 0; /* skip all data frames for UDP */ +int no_end = 0; /* skip the end frames for UDP */ + +double nbytes; /* bytes on net */ +unsigned long numCalls; /* # of I/O system calls */ + +struct hostent *addr; +extern int optind; +extern char *optarg; + +#if defined(UNDER_CE) +static int errno; +static char *weekday[] ={"Sun", "Mon","Tues", "Wed", "Thurs", "Fri", "Sat"}; +static char *month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "July", "Aug", "Sep", "Oct", "Nov", "Dec"}; +#define perror printf +#endif + +/*--------------------------------------------------------------------------*/ +static struct timeval time0; /* Time at which timing started */ +static struct timeval time1; +static struct rusage ru0; /* Resource utilization at the start */ +static struct rusage ru1; +static struct tm *tms; /* system time structure */ + + +/*-----------Prototype functions definitions -------------------------------*/ +/*--------------------------------------------------------------------------*/ + + /* ANSI input/output functions (stdio.h) */ + +#if defined(__lynx__) +int getopt(int, char**, char*); +int gettimeofday(struct timeval *tp, struct timezone *tzp); + +#else +#if defined(__svr4__) + +#else +#if defined(_AIX) + +#else +#if defined(__hpux__) +#else +#if defined(__NTVIS__) +#else +#if defined(BSD42) || defined(BSD43) +#else + +int printf( char*, ...); +int fprintf(FILE*,char*, ...); +void perror(char*); +int getopt(int, char**, char*); +int gettimeofday(struct timeval *tp, struct timezone *tzp); +#endif /* BSD42 || BSD43 */ +#endif /* __NTVIS__ */ +#endif /* __hpux__ */ +#endif /* _AIX */ +#endif /* __svr4__ */ +#endif /* __lynx__ */ + +int main(int argc, char* argv[]); +#if ( (!(defined(BSD42))) && (!(defined(BSD43))) && (!(defined(__NTVIS__))) ) +int read(int, char*, int); +int write(int, char*, int); +int close(int); +#endif /* !(BSD42) && !(BSD43) */ +int fclose(FILE *stream); + +#if !defined(BSD43) && !defined(__NTVIS__) +void bzero(char*,int); +void bcopy(char*, char*, int); +char strncpy(char *s1,char *s2,size_t n); +int atoi(char*); +int malloc(int); +#endif + + + /* ANSI socket functions prototype /sys/socket.h */ +#if defined(__lynx__) +int select(int, fd_set*, fd_set*, fd_set*, struct timeval*); + +#else +#if defined(__svr4__) && !defined(sparc) + +/* informations in : /usr/include/sys/socket.h */ +int socket(int, int, int); +int connect(int, struct sockaddr *, int); +int bind(int, struct sockaddr *, int); +int listen(int, int); +int accept(int, struct sockaddr *, int *); +int sendto(int, const char *, int, int, const struct sockaddr *, int); +int recvfrom(int, char *, int, int, struct sockaddr *, int *); +int getpeername(int, struct sockaddr *, int *); +int getsockopt(int, int, int, char *, int *); +int select(int, fd_set*, fd_set*, fd_set*, struct timeval*); + +#else +#if defined(_AIX) +int select(unsigned long, void *, void *, void *, struct timeval *); + +#else +#if defined(__hpux__) +int getrusage(int who,struct rusage *rusage); + +#else +#if defined(__NTVIS__) + +#else +#if defined(BSD42) || defined(BSD43) + +#else + +int socket(int, int, int); +int connect(int s,struct sockaddr_in *name, int namelen); +int bind(int s,struct sockaddr *name,int namelen); +int listen(int, int); +int accept(int, struct sockaddr_in *, int *); +int sendto(int, char *, int, int, struct sockaddr_in *, int); +int recvfrom(int, char *, int, int, struct sockaddr_in *, int *); +int getpeername(int, struct sockaddr *, int *); +int setsockopt(int, int, int, char *, int); + +int getsockopt(int, int, int, char*, int*); +int select(int, fd_set*, fd_set*, fd_set*, struct timeval*); + +#endif /* BSD42 || BSD43 */ +#endif /* __hpux__ */ +#endif /* _AIX */ +#endif /* __svr4__ */ +#endif /* __lynx__ */ +#endif /* __NTVIS__ */ + +/* ttcp prototype functions */ +void udp_rcv_test(void); +double calc_cpu_time(struct rusage *r0, struct rusage *r1); +double calc_real_time(struct timeval *t0, struct timeval *t1); +int getrusage(int who,struct rusage *rusage); +void sockets_err(char*); +void err(char *); +void mes(char *); +void pattern(char *, int); +int Nread(SOCKET, void *, int); +int Nwrite(int, void *, int); +void delay(int); +int mread(int, char *,unsigned); +char *outfmt(char format, double b); +void prep_timer(void); +void read_timer(void); +void result_summary(void); +void prusage(struct rusage*, struct rusage*, + struct timeval*, struct timeval*); +void tvadd(struct timeval *tsum, struct timeval *t0,struct timeval *t1); +void tvsub(struct timeval *tdiff, struct timeval *t1, struct timeval *t0); +void psecs(int); +void open_log(void); +void close_log(void); +void do_Usage(void); +void do_help(void); + +/*--------------------------------------------------------------------------*/ +#if !defined(__NTVIS__) +void +sigpipe() +{; +} +#endif +/*--------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------*/ +int +main(int argc, char **argv) +{ + unsigned long addr_tmp; + int c,k; + int sockbufsndsize,sockbufrcvsize; + int sockbuflen; + struct sockaddr_in peer; + int peerlen = sizeof(peer); + +#if defined(__NTVIS__) + extern char *optarg; + WSADATA WSAData; + WSAStartup(MAKEWORD(1,1), &WSAData); +#endif /* __NTVIS__ */ + + if (argc < 2) { do_Usage(); exit(1); } + + while (1) { + while ((c=getopt(argc, argv, "hidrstuvxHVBDTLb:f:l:n:p:A:O:S:N:P:R:I:w:")) != -1) { + switch (c) { + case 'w': + timeout = atoi(optarg); + break; + case 'I': + seed = atoi(optarg); + break; + case 'N': + burstn = atoi(optarg); + break; + case 'P': +#if defined(__linux__) + pri = atoi(optarg); + break; +#else + fprintf(stderr, "ttcp: -P option not supported on this OS\n"); + exit(1); +#endif + case 'R': + bufmin = atoi(optarg); + break; + case 'S': + udpsleep = atoi(optarg); + if (udpsleep < 0) udpsleep = 0; + /* convert msec arg to usec for usleep, minimum 10ms */ + udpsleep = udpsleep * 1000; + break; + case 'H': + hash = 1; + break; + case 'V': + fprintf(stdout,"%s %s\n" , RCSid , VersDate ); + exit(0); + case 'B': + b_flag = 1; + break; + case 'L': + log_cnt = 1; + break; + case 'h': + do_help(); + exit(1); + break; + case 't': + trans = 1; + break; + case 'r': + trans = 0; + break; + case 'x': + rndm = 1; + break; + case 'd': + options |= SO_DEBUG; + break; + case 'D': +#ifdef TCP_NODELAY + nodelay = 1; +#else + fprintf(stderr, + "ttcp: -D option ignored: TCP_NODELAY socket option not supported\n"); +#endif + break; + case 'n': + nbuf = atoi(optarg); + break; + case 'l': + buflen = atoi(optarg); + break; + case 's': + sinkmode = !sinkmode; + break; + case 'p': + port = atoi(optarg); + break; + case 'u': + udp = 1; + break; + case 'v': + verbose = 1; + break; + case 'A': + bufalign = atoi(optarg); + break; + case 'O': + bufoffset = atoi(optarg); + break; + case 'b': +#if defined(SO_SNDBUF) || defined(SO_RCVBUF) + sockbufsize = atoi(optarg); +#else + fprintf(stderr, +"ttcp: -b option ignored: SO_SNDBUF/SO_RCVBUF socket options not supported\n"); +#endif + break; + case 'f': + fmt = *optarg; + break; + case 'T': + touchdata = 1; + break; + case 'i': + seq_info = 1; + break; + + default: + {do_Usage(); exit(1);} + }/*switch */ + }/* while getopt() */ + + argc -= optind; + argv += optind; + optind = 0; + + /* check for '--' args */ + if (argc == 0) { + /* no more args */ + break; /* while (1) */ +#if defined(DEBUG) + } else if (!strcmp(argv[0], "--nostart")) { + no_start = 1; + argc--; argv++; + } else if (!strcmp(argv[0], "--nodata")) { + no_data = 1; + argc--; argv++; + } else if (!strcmp(argv[0], "--noend")) { + no_end = 1; + argc--; argv++; + } else if (!strcmp(argv[0], "--debug")) { + debug = 1; + argc--; argv++; +#endif /* DEBUG */ + } else if (!strncmp(argv[0], "--", 2)) { + fprintf(stderr, "ttcp: illegal option: %s\n", argv[0]); + do_Usage(); exit(1); + } else { + /* the arg was not a '--' arg */ + break; /* while (1) */ + } + } /* while (1) */ + + + /* ----------------------- main part ----------------------- */ + +#if defined(__NTVIS__) && !defined(UNDER_CE) + /* Set "stdin" to have binary mode: */ + if (_setmode(_fileno(stdin), _O_BINARY) == -1) + perror("%s: Error setting stdin to binary mode"); + /* Set "stdout" to have binary mode: */ + if (_setmode(_fileno(stdout), _O_BINARY) == -1) + perror("%s: Error setting stdout to binary mode"); +#endif /* __NTVIS__ */ + +if (log_cnt) open_log(); + +/* input error checking */ +if (burstn > nbuf) { + fprintf(stderr, "ttcp: buffers per burst must be less than or equal to " + "total number of buffers\n"); + exit(1); +} +if (bufmin < -1) { + fprintf(stderr, "ttcp: minimum buffer size specified with -R option must " + "be non-negative\n"); + exit(1); +} +if (buflen > 65535) { + fprintf(stderr, "ttcp: maximum buffer size specified with -l option must " + "be <= 65536\n"); + exit(1); +} +if (bufmin > buflen) { + fprintf(stderr, "ttcp: minimum buffer size specified with -R option must " + "be less than or equal to (maximum) buffer size specified with -l\n"); + exit(1); +} + +/* buffer allocation */ + + if (udp && buflen < MIN_UDP_LEN) + buflen = MIN_UDP_LEN; /* send more than the sentinel size */ + + if ( (buf = (char *)malloc(buflen+bufalign)) == (char *)NULL) + err("malloc"); + if (bufalign != 0) + buf +=(bufalign - ((int)buf % bufalign) + bufoffset) % bufalign; + + fprintf(stderr,"ttcp%s: buflen=%d, nbuf=%d, align=%d/%d, port=%d\n", + trans?"-t":"-r",buflen, nbuf, bufalign, bufoffset, port); + if (log_cnt)fprintf(fplog," %6d %6d %6d %6d %4d", + buflen, nbuf, bufalign, bufoffset, port); + + /* preload the buffer for the transmit condition */ + pattern( buf, buflen ); + + /* seed the random number generator */ + if ((bufmin != -1) || (rndm != 0)) { +#if defined(__NTVIS__) + srand(seed); +#else /* ! __NTVIS__ */ + srandom(seed); +#endif /* __NTVIS__ */ + } + + if(trans) + {/* xmitr */ + if (argc == 0) { + fprintf(stderr, "ttcp: missing destination host arg\n"); + do_Usage(); exit(1); + } + + bzero((char *)&sinhim, sizeof(sinhim)); + host = argv[0]; + if (atoi(host) > 0 ) + {/* Numeric */ + sinhim.sin_family = AF_INET; + sinhim.sin_addr.s_addr = inet_addr(host); + } + else + {if ((addr=gethostbyname(host)) == NULL) sockets_err("bad hostname"); + sinhim.sin_family = addr->h_addrtype; + bcopy(addr->h_addr,(char*)&addr_tmp, addr->h_length); + sinhim.sin_addr.s_addr = addr_tmp; + } + sinhim.sin_port = htons(port); + sinme.sin_port = 0; /* free choice */ + } + else + {/* rcvr */ + sinme.sin_port = htons(port); + } +#if defined(__NTVIS__) + sinme.sin_family = AF_INET; +#endif + + fd = socket(AF_INET, udp?SOCK_DGRAM:SOCK_STREAM, 0); + +#if defined(__NTVIS__) + if (fd == INVALID_SOCKET) sockets_err("socket"); +#else + if (fd < 0) sockets_err("socket"); +#endif + + if (verbose) { + char *label = trans?"ttcp-t":"ttcp-r"; +#if defined(UNDER_CE) + SYSTEMTIME SystemTime; + char time_str[30]; + + GetLocalTime(&SystemTime); + sprintf(time_str, "%s %s %d %02d:%02d:%02d %d\n", weekday[SystemTime.wDayOfWeek], month[SystemTime.wMonth - 1], + SystemTime.wDay, SystemTime.wHour, SystemTime.wMinute, SystemTime.wSecond, SystemTime.wYear); +#else + time_t now; + char *time_str; + + time(&now); + time_str = ctime(&now); +#endif + fprintf(stdout,"%s: start time %s", label, time_str); + fprintf(stdout,"%s: File-Descriptor 0x%x Opened\n", label, fd ); + } + +#if defined(__NTVIS__) + if (bind(fd, (struct sockaddr FAR *)&sinme, sizeof(sinme)) == SOCKET_ERROR) + sockets_err("bind"); +#else + if (bind(fd, SOCKADDR_CAST &sinme, sizeof(sinme)) < 0) + sockets_err("bind"); +#endif /* __NTVIS__ */ + + +#if defined(SO_SNDBUF) || defined(SO_RCVBUF) + if (sockbufsize) + { +#if defined(__lynx__) || defined(__sun__) || defined(__NTVIS__) + if (trans) + {if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&sockbufsize, + sizeof sockbufsize) < 0) + sockets_err("setsockopt: sndbuf"); + } + else + {if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&sockbufsize, + sizeof sockbufsize) < 0) + sockets_err("setsockopt: rcvbuf"); + } + +#else + if (trans) + + {if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sockbufsize, + sizeof sockbufsize) < 0) + sockets_err("setsockopt: sndbuf"); + } + else + {if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &sockbufsize, + sizeof sockbufsize) < 0) + sockets_err("setsockopt: rcvbuf"); + } +#endif /* __lynx__ __sun__ __NTVIS__ */ + } + else + {/* + ** Added by Daniel Davids to Know Socket-Buffer-Sizes + */ + sockbuflen = sizeof sockbufsndsize; +#if defined(__lynx__) || defined(__sun__) || defined(__NTVIS__) + getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&sockbufsndsize, + &sockbuflen); + sockbuflen = sizeof sockbufrcvsize; + getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&sockbufrcvsize, + &sockbuflen); +#else + getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sockbufsndsize, &sockbuflen); + sockbuflen = sizeof sockbufrcvsize; + getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &sockbufrcvsize, &sockbuflen); +#endif /* __lynx__ __sun__ __NTVIS__ */ + sockbufsize = ( sockbufsndsize + sockbufrcvsize ) / 2; + + if ( sockbufsndsize != sockbufrcvsize ) + {fprintf(stderr, "sockbufsndsize=%d, ", sockbufsndsize ); + fprintf(stderr, "sockbufrcvsize=%d, ", sockbufrcvsize ); + } + } +#endif /* defined(SO_SNDBUF) || defined(SO_RCVBUF) */ + + if (sockbufsize) fprintf(stderr, "sockbufsize=%d, \n", sockbufsize); + + if (log_cnt) + {if (sockbufsize)fprintf(fplog," %6d",sockbufsize); + else fprintf(fplog," 0"); + } + +#if defined(__linux__) + if (setsockopt(fd, SOL_SOCKET, SO_PRIORITY, (char *)&pri, sizeof pri) < 0) + sockets_err("setsockopt: priority"); +#endif + + + if (trans) fprintf(stderr, "# %s sender -> %s #\n", udp?"udp":"tcp", host); + else fprintf(stderr, "# %s receiver #\n", udp?"udp":"tcp"); + + if (!udp) + { +#if !defined(__NTVIS__) + signal(SIGPIPE, sigpipe); +#endif /* !__NTVIS__ */ + + if (trans) + {/* We are the client if transmitting */ + if (options) + { +#if defined(BSD42) + if( setsockopt(fd, SOL_SOCKET, options, 0, 0) < 0) +#else /* BSD43 */ + if( setsockopt(fd, SOL_SOCKET, options, (char *)&one, sizeof(one)) < 0) +#endif /* BDS42 */ + sockets_err("setsockopt"); + } +#ifdef TCP_NODELAY + if (nodelay) + {struct protoent *p; + p = getprotobyname("tcp"); +#if defined(__lynx__) || defined(__sun__) || defined(__NTVIS__) + if( p && setsockopt(fd, p->p_proto, TCP_NODELAY, + (char *) &one, sizeof(one)) < 0) +#else + if( p && setsockopt(fd, p->p_proto, TCP_NODELAY, + &one, sizeof(one)) < 0) +#endif /* __lynx__ __sun__ __NTVIS__ */ + sockets_err("setsockopt: nodelay"); + } +#endif /* TCP_NODELAY */ + if (connect(fd, SOCKADDR_CAST &sinhim, sizeof(sinhim) ) < 0) + sockets_err("connect"); + }/* if (trans) */ + else + {/* otherwise, we are the server and should listen for connections */ + +errno = 0; + +#if defined(sgi) || ( defined(__osf__) && !defined(_CFE) ) + if( listen(fd,1) <0 ) +#else + if( listen(fd,0) <0 ) /* allow a queue of 0 */ +#endif + sockets_err("listen"); + + if(options) { + int err; +#if defined(BSD42) + err = setsockopt(fd, SOL_SOCKET, options, 0, 0); +#elif defined(__lynx__) || defined(__sun__) || defined(__NTVIS__) + err = setsockopt(fd, SOL_SOCKET, options, (char *) &one, sizeof(one)); +#else + err = setsockopt(fd, SOL_SOCKET, options, &one, sizeof(one)); +#endif /* BSD42 */ + if (err < 0) + sockets_err("setsockopt"); + } + fromlen = sizeof(frominet); + domain = AF_INET; + if (timeout > 0) { + fd_set readfds, exceptfds; + struct timeval tv_timeout; + int n; + + tv_timeout.tv_sec = timeout/1000; + tv_timeout.tv_usec = (timeout%1000)*1000; + + FD_ZERO(&readfds); + FD_ZERO(&exceptfds); + FD_SET(fd, &readfds); + FD_SET(fd, &exceptfds); + + n = select( fd+1, &readfds, NULL, &exceptfds, &tv_timeout ); + if (n == 0 || n == SOCKET_ERROR) { + sockets_err("select listen"); + return 0; + } + } + if((fd=accept(fd, SOCKADDR_CAST &frominet, &fromlen) ) < 0) + sockets_err("accept"); + + if (getpeername(fd, SOCKADDR_CAST &peer, &peerlen) < 0) + sockets_err("getpeername"); + + fprintf(stderr,"ttcp-r: accept from %s\n",inet_ntoa(peer.sin_addr)); + + } /* otherwise we are ... */ + } + + prep_timer(); + errno = 0; + nbytes = 0.0; + numCalls = 0; + + { + register int cnt,multi; + char *pb; + int nb = 0; + unsigned long rbuflen = 0; + multi = nbuf; + + if (trans) { +#if !defined(BSD43) + if(udp) { + int err; + int nochecksum_opt = 0; + err = setsockopt(fd, IPPROTO_UDP, UDP_NOCHECKSUM, + (char *)&nochecksum_opt, sizeof(nochecksum_opt)); + if (err < 0) + sockets_err("setsockopt"); + } +#endif + + if(udp && !no_start) { + int start_count = 2; + char start_pkt[START_PKT_LEN]; + memset(start_pkt, 0, START_PKT_LEN); + memcpy(start_pkt, start_pattern, START_PATTERN_LEN); + + while (start_count-- > 0) { + (void)Nwrite( fd, start_pkt, START_PKT_LEN ); /* rcvr start */ + if (udpsleep) { + usleep(udpsleep); + /* clear errno (see man page for errno(3), definition of + EINTR. usleep() uses SIGCONT? ) */ + if (errno == EINTR) errno = 0; + } /* udpsleep */ + } + } + + /* initial seqence num for UDP */ + if (udp) buf[0] = 0; + k = burstn; + + if (sinkmode) { + while (multi-- > 0 && !no_data) { + + if (bufmin == -1) { + rbuflen = buflen; + } else { + /* set rbuflen to a random value evenly distributed in + [bufmin, buflen]. As long as buflen is < 2^16, we can + fit the calculation in 32 bits */ +#if defined(__NTVIS__) + rbuflen = (( (unsigned long)rand() * + ((unsigned long)(buflen-bufmin+1)) ) >> 15) + bufmin; +#else /* ! __NTVIS__ */ + rbuflen = (( ((unsigned long)random() >> 15) * + ((unsigned long)(buflen-bufmin+1)) ) >> 16) + bufmin; +#endif /* __NTVIS__ */ + } + + if (rndm) { + unsigned int i, j, l; + unsigned long data; + + if (udp) + l = 1; + else + l = 0; + + for (i = l; i < rbuflen; /* null */) { +#if defined(__NTVIS__) + data = (unsigned long)rand(); +#else /* ! __NTVIS__ */ + data = (unsigned long)random(); +#endif /* __NTVIS__ */ + /*fprintf(stderr, "%08x\n",data);*/ /* DEBUG */ + /* The NT rand() function returns only 16 useful bits! */ + for (j = 0; (j < 2/*4*/) && (i < rbuflen) ; j++) { + buf[i++] = (unsigned char)(data & 0xff); + data >>= 8; + } + } + } + + if ((cnt=Nwrite(fd,buf,rbuflen)) != (int)rbuflen) + sockets_err("error from the socket write"); + /* increment sequence num if UDP */ + if (udp) buf[0] = (char)(((unsigned char)(buf[0])+1) & 0xFF); + + if (debug) + fprintf(stdout,"ttcp-t: %5d | %d Bytes Written in %d write commands \n", + ++nb, cnt, nbuf ); + + nbytes += rbuflen; + + /* hashes */ + if (hash) { + fprintf(stderr,"#"); + } + + /* Check for the end of a burst */ + if (--k <= 0) { + k = burstn; + + /* sleep to avoid overrunning slower receivers - henry */ + if (udpsleep) { + usleep(udpsleep); + /* clear errno (see man page for errno(3), definition of + EINTR. usleep() uses SIGCONT? ) */ + if (errno == EINTR) errno = 0; + } /* udpsleep */ + } + } /* while */ + + } /* if (sinkmode) */ + else + { + + nbuf = 0; + + if (bufmin == -1) { + rbuflen = buflen; + } else { + /* set rbuflen to a random value evenly distributed in + [bufmin, buflen]. As long as buflen is < 2^16, we can + fit the calculation in 32 bits */ +#if defined(__NTVIS__) + rbuflen = (( (unsigned long)rand() * + ((unsigned long)(buflen-bufmin+1)) ) >> 15) + bufmin; +#else /* ! __NTVIS__ */ + rbuflen = (( ((unsigned long)random() >> 15) * + ((unsigned long)(buflen-bufmin+1)) ) >> 16) + bufmin; +#endif /* __NTVIS__ */ + } + + if (udp) + pb = &(buf[1]); + else + pb = &(buf[0]); + +#if !defined(__NTVIS__) /* else case specific to WINNT */ + while((cnt=read(0,pb,rbuflen)) > 0) +#else /* __NTVIS__ */ + while((cnt=(int)fread(pb,1,rbuflen,stdin)) > 0) +#endif /* __NTVIS__ */ + { + + if (udp) + multi = cnt+1; /* don't include seq. num. in count of data */ + else + multi = cnt; + if ((cnt=Nwrite(fd,buf,multi)) != (int)multi) + sockets_err("error from the socket write"); + /* increment seqence num if UDP */ + if (udp) buf[0] = (char)(((unsigned char)(buf[0])+1) & 0xFF); + nbuf++; + + if (debug) + fprintf(stdout,"ttcp-t: %5d | %d Bytes Written in %d write commands \n", + ++nb, cnt, nbuf ); + + nbytes += multi; + + /* hashes */ + if (hash) { + fprintf(stderr,"#"); + } + + /* Check for the end of a burst */ + if (--k <= 0) { + k = burstn; + + /* sleep to avoid overrunning slower receivers - henry */ + if (udpsleep) { + usleep(udpsleep); + /* clear errno (see man page for errno(3), definition of + EINTR. usleep() uses SIGCONT? ) */ + if (errno == EINTR) errno = 0; + } /* udpsleep */ + } + + if (bufmin == -1) { + rbuflen = buflen; + } else { + /* set rbuflen to a random value evenly distributed in + [bufmin, buflen]. As long as buflen is < 2^16, we can + fit the calculation in 32 bits */ +#if defined(__NTVIS__) + rbuflen = (( (unsigned long)rand() * + ((unsigned long)(buflen-bufmin+1)) ) >> 15) + bufmin; +#else /* ! __NTVIS__ */ + rbuflen = (( ((unsigned long)random() >> 15) * + ((unsigned long)(buflen-bufmin+1)) ) >> 16) + bufmin; +#endif /* __NTVIS__ */ + } + + } /* while */ + + } /* if (sinkmode) */ + + if (hash) { + fprintf(stderr,"\n"); + fflush(stderr); + } + +#if defined(UNDER_CE) + errno = WSAGetLastError(); +#endif + if (!errno) { + read_timer(); + if(udp && !no_end) { + int end_count = 4; + int data_count = nbuf; + char end_pkt[END_PKT_LEN]; + unsigned char* net_byte = &end_pkt[END_PATTERN_LEN]; + memset(end_pkt, 0, END_PKT_LEN); + memcpy(end_pkt, end_pattern, END_PATTERN_LEN); + net_byte[3] = data_count & 0xFF; data_count >>= 8; + net_byte[2] = data_count & 0xFF; data_count >>= 8; + net_byte[1] = data_count & 0xFF; data_count >>= 8; + net_byte[0] = data_count & 0xFF; + + while (end_count-- > 0) { + Nwrite( fd, end_pkt, END_PKT_LEN ); /* rcvr end */ + if (udpsleep && end_count>0) usleep(udpsleep); + } + } + result_summary(); + } + } /* trans */ + else + { + if (udp) { + udp_rcv_test(); + } + else + {/* not udp received transfer */ + while ((cnt=Nread(fd,buf,buflen)) > 0) + {if(debug)fprintf(stdout, + "ttcp%s: %5d | %d Bytes Read\n", + trans?"-t":"-r", ++nb, cnt ); + nbytes += cnt; + if (!sinkmode) { +#if !defined(__NTVIS__) /* else case specific to WINNT */ + if (write(1,buf,cnt) != cnt) err("write"); +#else /* __NTVIS__ */ + if ((int)fwrite(buf,1,cnt,stdout) != cnt) err("fwrite"); +#endif /* __NTVIS__ */ + } + } +#if defined(UNDER_CE) + errno = WSAGetLastError(); +#endif + if (!errno) { + read_timer(); + result_summary(); + } + } + } + } + + if(errno) err("IO"); + +#if defined(__NTVIS__) + closesocket ( fd ); +#else + close ( fd ); +#endif /* __NTVIS__ */ + + if (verbose) fprintf(stdout,"ttcp%s: File-Descriptor fd 0x%x Closed\n" , + trans?"-t":"-r", fd ); + + if (log_cnt) close_log(); + + fprintf(stderr,"ttcp done.\n"); + fflush(stdout); + + exit(0); +} +/*--------------------------------------------------------------------------*/ +void +udp_rcv_test(void) +{ + enum {START_WAIT, DATA_WAIT, DATA_RCV, END_TEST} rcv_state; + enum {START_PKT_TYPE, END_PKT_TYPE, DATA_PKT_TYPE} pkt_type; + int cnt; + int nbuffers = 0; + unsigned int start_pkt_cnt = 0; + unsigned int end_pkt_cnt = 0; + unsigned int data_pkt_cnt = 0; + unsigned int expected_pkt_cnt = 0; + unsigned char seq = 0; + unsigned char buf_seq; + + rcv_state = START_WAIT; + while (rcv_state != END_TEST && (cnt=Nread(fd,buf,buflen)) > 0) { + /* Determine the type of packet received */ + if (!memcmp(buf, start_pattern, START_PATTERN_LEN)) { + pkt_type = START_PKT_TYPE; + start_pkt_cnt++; + } else if (!memcmp(buf, end_pattern, END_PATTERN_LEN)) { + /* read the expected data packet count from the end packet */ + unsigned char* net_byte = buf; + net_byte += END_PATTERN_LEN; + expected_pkt_cnt = ((net_byte[0] << 24) + (net_byte[1] << 16) + + (net_byte[2] << 8) + net_byte[3]); + pkt_type = END_PKT_TYPE; + end_pkt_cnt++; + } else { + data_pkt_cnt++; + pkt_type = DATA_PKT_TYPE; + } + + if (rcv_state == START_WAIT) { + /* Wait until we see a vaild start packet */ + if (pkt_type == START_PKT_TYPE) { + prep_timer(); + rcv_state = DATA_WAIT; + } else if (pkt_type == DATA_PKT_TYPE) { + fprintf(stderr, "ERROR: Missed UDP start packet.\n"); + prep_timer(); + rcv_state = DATA_RCV; + } else if (pkt_type == END_PKT_TYPE) { + fprintf(stderr, "ERROR: Found UDP end packet before start packet or data.\n"); + rcv_state = END_TEST; + } + } else if (rcv_state == DATA_WAIT) { + /* Skip any extra start packets until we see data */ + if (pkt_type == START_PKT_TYPE) { + prep_timer(); + } else if (pkt_type == DATA_PKT_TYPE) { + rcv_state = DATA_RCV; + } else if (pkt_type == END_PKT_TYPE) { + fprintf(stderr, "ERROR: Found UDP end packet without receiving " + "any data packets.\n"); + rcv_state = END_TEST; + } + } else { /* DATA_RCV */ + /* Collect data packets until we see a vaild end packet */ + if (pkt_type == START_PKT_TYPE) { + /* We missed the end packets and now a new test is + * starting. Report the results of this test then start + * another. */ + read_timer(); + result_summary(); + fprintf(stderr, "ERROR: Found UDP start packet while receiving data.\n" + "ERROR: Expected more data packets or an end packet.\n"); + nbytes = 0.0; + nbuffers = 0; + numCalls = 0; + prep_timer(); + rcv_state = DATA_WAIT; + } else if (pkt_type == DATA_PKT_TYPE) { + /* loop in this state */ + } else if (pkt_type == END_PKT_TYPE) { + /* we used to print results here but now we do when the loop ends */ + rcv_state = END_TEST; + } + } + + /* tally data packets the same way from whatever state we are in */ + if (pkt_type == DATA_PKT_TYPE) { + if (debug) + fprintf(stderr, "ttcp-r: %5d | %d Bytes Read\n", ++nbuffers, cnt); + nbytes += cnt; + if (seq_info) { + /* check seqence num */ + buf_seq = (unsigned char)(buf[0]); + if (buf_seq != seq) { + fprintf(stderr, "ERROR: Out of sequence. " + "Buffer %u, seq %u, expected %u\n", + data_pkt_cnt, buf_seq, seq); + seq = buf_seq; + } + seq++; + } + if (!sinkmode) { +#if !defined(__NTVIS__) /* else case specific to WINNT */ + if (write(1,&(buf[1]),cnt-1) != cnt-1) err("write"); +#else /* __NTVIS__ */ + if ((int)fwrite(&(buf[1]),1,cnt-1,stdout) != cnt-1) err("fwrite"); +#endif /* __NTVIS__ */ + } + } + } /* end-while */ + + /* normal end of test */ + read_timer(); + result_summary(); + fprintf(stderr, "ttcp-r: packets %u data, %u start, %u end\n", + data_pkt_cnt, start_pkt_cnt, end_pkt_cnt); + if (expected_pkt_cnt != 0) { + int lost_cnt = expected_pkt_cnt - data_pkt_cnt; + + fprintf(stderr, "ttcp-r: %g%% (%u/%u) packet loss\n", + 100.0 * (double)lost_cnt/(double)expected_pkt_cnt, + lost_cnt, expected_pkt_cnt); + } +} + +/*--------------------------------------------------------------------------*/ +/* calc_cpu_time(): Time difference, in usecs, of the combined user and + * sys times of the given start and end usage info */ +double +calc_cpu_time( + struct rusage *r0, + struct rusage *r1 +) +{ + double time; + time_t ms; + struct timeval tdiff, tend, tstart; + + /* total user delta time + total system delta time */ + tvadd( &tend, &r1->ru_utime, &r1->ru_stime ); /* user + sys time @ end */ + tvadd( &tstart, &r0->ru_utime, &r0->ru_stime ); /* user + sys time @ start*/ + tvsub( &tdiff, &tend, &tstart ); + + /* useconds */ + time = ((double)tdiff.tv_sec)*1e6 + (double)tdiff.tv_usec; + + /* debug mseconds */ + ms = tdiff.tv_sec*(time_t)1000 + tdiff.tv_usec/(time_t)1000; + if (ms != (time_t)(time/1000.0)) { + fprintf(stderr, "ERROR: time calc mismatch of msec (%d) to usec (%f)\n", + (int)ms, time/1000.0); + } + + return time; +} + +/*--------------------------------------------------------------------------*/ +/* calc_real_time(): Time difference in usecs of the given times */ +double +calc_real_time( + struct timeval *t0, + struct timeval *t1 +) +{ + double time; + time_t ms; + struct timeval tdiff; + + tvsub(&tdiff, t1 ,t0); + + /* useconds */ + time = ((double)tdiff.tv_sec)*1e6 + (double)tdiff.tv_usec; + + /* debug mseconds */ + ms = tdiff.tv_sec*(time_t)1000 + tdiff.tv_usec/(time_t)1000; + if (ms != (time_t)(time/1000.0)) { + fprintf(stderr, "ERROR: time calc mismatch of msec (%d) to usec (%f)\n", + (int)ms, time/1000.0); + } + + return time; +} +/*--------------------------------------------------------------------------*/ +void +result_summary(void) +{ + char* label = trans ? "ttcp-t" : "ttcp-r"; + double cput = calc_cpu_time(&ru0, &ru1); + double realt = calc_real_time(&time0, &time1); + double t_min; + double bytes_per_sec; + + /* lower end boundary conditions */ + t_min = 10.0; /* 10 usec */ +#if defined(__NTVIS__) + t_min = 1000.0; /* 1 msec */ +#endif + if (cput <= t_min) { /* value in usec */ + cput = t_min; + fprintf(stderr,"%s: cpu time too short set at %.0f usec, NOT accurate result.\n", + label,t_min); + } + if (realt <= t_min) { /* value in usec */ + realt = t_min; + fprintf(stderr,"%s: real time too short, set at %.0f usec, NOT accurate result.\n", + label,t_min); + } + + bytes_per_sec = (nbytes/realt)*1e6; + + fprintf(stderr,"%s: %.0f bytes in %.06f real seconds = %s/sec +++\n", + label, nbytes, realt/1e6, outfmt(fmt, bytes_per_sec)); + + if (verbose) + fprintf(stderr,"%s: %.0f bytes in %.06f cpu seconds = %s/cpu sec\n", + label, nbytes,cput/1e6, outfmt(fmt, (nbytes/cput)*1e6)); + + fprintf(stderr,"%s: %ld I/O calls, %.3f msec(real)/call, %.3f msec(cpu)/call\n", + label, numCalls, + (numCalls>0)?(realt/(double)numCalls)/1000.0:0.0, + (numCalls>0)?(cput /(double)numCalls)/1000.0:0.0); + + fprintf(stderr,"%s: ", label); + prusage(&ru0, &ru1, &time0, &time1); + fprintf(stderr,"\n"); + + if (verbose) + printf("%s: buffer address %#x\n", label, (unsigned int)buf); + + if (fplog) { + struct timeval tdiff; + /* User time */ + tvsub(&tdiff, &ru1.ru_utime, &ru0.ru_utime); + fprintf(fplog," %ld.%06ld", (long)tdiff.tv_sec, (long)tdiff.tv_usec); + /* System time */ + tvsub(&tdiff, &ru1.ru_stime, &ru0.ru_stime); + fprintf(fplog," %ld.%06ld", (long)tdiff.tv_sec, (long)tdiff.tv_usec); + /* Percent of cput usage */ + fprintf(fplog," %.1f", 100.0 * (cput/realt)); + /* validity of real time mesurment */ + fprintf(fplog, (realt == t_min)?" 0":" 1"); + /* bytes, seconds, MBytes/sec, IO calls */ + fprintf(fplog," %10.0f %4.06f %4.3f %6ld", + nbytes, realt/1e6, bytes_per_sec/(1024.0*1024.0), numCalls); + } +} +/*--------------------------------------------------------------------------*/ +void +sockets_err(char* s) +{ +#if defined(__NTVIS__) + int err = WSAGetLastError(); + char* prefix = trans?"ttcp-t":"ttcp-r"; + fprintf(stderr,"%s: %s\n", prefix, s); + fprintf(stderr,"%s: errno=%d\n", prefix, err); + exit(1); +#else + err(s); +#endif /* __NTVIS__ */ +} + +/*--------------------------------------------------------------------------*/ +void +err(char *s) +{ + char* prefix = trans?"ttcp-t":"ttcp-r"; + fprintf(stderr,"%s: ", prefix); + perror(s); + fprintf(stderr,"%s: errno=%d\n", prefix, errno); + exit(1); +} +/*--------------------------------------------------------------------------*/ +void +mes(char *s) +{ + fprintf(stderr,"ttcp%s: %s\n", trans?"-t":"-r", s); +} +/*--------------------------------------------------------------------------*/ +void +pattern( char *cp, int cnt ) +{ + register char c; + register int cnt1; + cnt1 = cnt; + c = 0; + while( cnt1-- > 0 ) { + while( !isprint((c&0x7F)) ) c++; + *cp++ = (c++&0x7F); + } +} +/*--------------------------------------------------------------------------*/ +char * +outfmt(char format, double b) +{ + static char obuf[50]; + double giga = 1024.0 * 1024.0 * 1024.0; + double mega = 1024.0 * 1024.0; + double kilo = 1024.0; + + if (format == 'A') { + if (b >= giga) + format = 'G'; + else if (b >= mega) + format = 'M'; + else if (b >= kilo) + format = 'K'; + else + format = 'B'; + } + + switch (format) { + case 'G': + sprintf(obuf, "%.3f GB", b / giga); + break; + case 'M': + sprintf(obuf, "%.3f MB", b / mega); + break; + case 'K': + sprintf(obuf, "%.3f KB", b / kilo); + break; + case 'B': + sprintf(obuf, "%4f B", b); + break; + case 'g': + sprintf(obuf, "%.3f Gbit", b * 8.0 / giga); + break; + case 'm': + sprintf(obuf, "%.3f Mbit", b * 8.0 / mega); + break; + case 'k': + sprintf(obuf, "%.3f Kbit", b * 8.0 / kilo); + break; + case 'b': + sprintf(obuf, "%4f b", b * 8.0); + break; + default: + sprintf(obuf, "default.........."); + } + return obuf; +} +/*--------------------------------------------------------------------------*/ +#if defined(SYSV) + +/*ARGSUSED*/ + +#if defined(__osf__) +/* getrusage defined in the system lib */ +#else +#if defined(__lynx__) +/* getrusage defined in the system lib */ +#else +#if defined(__sun__) +/* getrusage defined in the system lib */ +#else + +int +getrusage(ignored, ru) + int ignored; + register struct rusage *ru; +{ + + +#if defined(__NTVIS__) + HANDLE phd; + FILETIME CreateTime, ExitTime, KernelTime, UserTime; + SYSTEMTIME SysTime; +#if defined(UNDER_CE) + phd = GetCurrentThread(); + if( GetThreadTimes(phd, &CreateTime, &ExitTime, &KernelTime, &UserTime) + != TRUE) +#else + phd = GetCurrentProcess(); + if( GetProcessTimes(phd, &CreateTime, &ExitTime, &KernelTime, &UserTime) + != TRUE) +#endif + {ru->ru_stime.tv_sec = 0; + ru->ru_stime.tv_usec = 0; + ru->ru_utime.tv_sec = 0; + ru->ru_utime.tv_usec = 0; + } + else + { + (void) FileTimeToSystemTime(&KernelTime, &SysTime); + /* + * fprintf(stdout, + * "System sec=%d, msec=%d\n", SysTime.wSecond, SysTime.wMilliseconds); + */ + ru->ru_stime.tv_sec = SysTime.wSecond; + ru->ru_stime.tv_usec = SysTime.wMilliseconds * 1000; + (void) FileTimeToSystemTime(&UserTime, &SysTime); + /* + * fprintf(stdout, + * " User sec=%d, msec=%d\n", SysTime.wSecond, SysTime.wMilliseconds); + */ + ru->ru_utime.tv_sec = SysTime.wSecond; + ru->ru_utime.tv_usec = SysTime.wMilliseconds * 1000; + } + +#else /* __NTVIS__ */ + + struct tms buftime; + times(&buftime); + /* Assumption: HZ <= 2147 (LONG_MAX/1000000) */ + /* info : in lynxOS HZ is called TICKSPERSEC () */ + + ru->ru_stime.tv_sec = buftime.tms_stime / HZ; + ru->ru_stime.tv_usec = ((buftime.tms_stime % HZ) * 1000000) / HZ; + ru->ru_utime.tv_sec = buftime.tms_utime / HZ; + ru->ru_utime.tv_usec = ((buftime.tms_utime % HZ) * 1000000) / HZ; +#endif /* __NTVIS__ */ +return(0); + +} /* static getrusage */ + +#endif /* __sun__ */ +#endif /* __lynx__ */ +#endif /* __osf__ */ +#endif /* SYSV */ +/*--------------------------------------------------------------------------*/ +#if defined(SYSV) +#if defined(__hpux__) || defined(_AIX) || defined(__sun__) +/* gettimeofday defined in the system lib */ +#else +# if defined (__osf__) ||defined (__lynx__) +/* gettimeofday defined in the system lib */ +#else +/*ARGSUSED*/ +static +gettimeofday(tp, zp) +struct timeval *tp; +struct timezone *zp; +{ +#if defined(__NTVIS__) +#if defined(UNDER_CE) + SYSTEMTIME SystemTime; + + GetLocalTime(&SystemTime); + tp->tv_sec = SystemTime.wSecond; + tp->tv_usec = SystemTime.wMilliseconds * 1000; +#else + struct _timeb timeptr; + + _ftime(&timeptr); + tp->tv_sec = timeptr.time; + tp->tv_usec = timeptr.millitm * 1000; +#endif +#else /* all cases */ + tp->tv_sec = time(0); + tp->tv_usec = 0; +#endif /* __NTVIS__ */ +return(1); +} /* static gettimeofday */ + +#endif /*__osf__ || __lynx__ */ +#endif /* __hpux__ || _AIX || __sun__ || __osf__*/ +#endif /* SYSV */ +/*--------------------------------------------------------------------------*/ +/* + * P R E P _ T I M E R + */ +void +prep_timer(void) +{ + gettimeofday(&time0, (struct timezone *)0); + getrusage(RUSAGE_SELF, &ru0); +} +/*--------------------------------------------------------------------------*/ +/* + * R E A D _ T I M E R + * + */ +void +read_timer(void) +{ + getrusage(RUSAGE_SELF, &ru1); + gettimeofday(&time1, (struct timezone *)0); +} +/*--------------------------------------------------------------------------*/ +/* Print the process usage calculated from timers values extracted + * before and after the transfer execution. + */ +void +prusage( + struct rusage *r0, struct rusage *r1, + struct timeval *t0, struct timeval *t1 +) +{ + struct timeval tdiff; + int t, ms; + register char *cp; + double cput = calc_cpu_time(r0, r1); + double realt = calc_real_time(t0, t1); + + /* t == total user delta time + total system delta time */ + if (debug) + { + printf("timers : end startup\n"); + printf("user (sec) : %9ld %9ld\n",r1->ru_utime.tv_sec, + r0->ru_utime.tv_sec); + printf("user (usec): %9ld %9ld\n",r1->ru_utime.tv_usec, + r0->ru_utime.tv_usec); + printf("sys (sec) : %9ld %9ld\n",r1->ru_stime.tv_sec, + r0->ru_stime.tv_sec); + printf("sys (usec): %9ld %9ld\n",r1->ru_stime.tv_usec, + r0->ru_stime.tv_usec); + printf("time (sec) : %9ld %9ld\n",t1->tv_sec,t0->tv_sec); + printf("time (usec): %9ld %9ld\n",t1->tv_usec,t0->tv_usec); + } + /* for the AIX debug, most counters are outside a good range + printf(" r0 r1\n"); + printf("ru_ixrss %20ld %20ld \n", r0->ru_ixrss ,r1->ru_ixrss ); + printf("ru_idrss %20ld %20ld \n", r0->ru_idrss ,r1->ru_idrss ); + printf("ru_isrss %20ld %20ld \n", r0->ru_isrss ,r1->ru_isrss ); + printf("ru_minflt %20ld %20ld \n", r0->ru_minflt ,r1->ru_minflt ); + printf("ru_majflt %20ld %20ld \n", r0->ru_majflt ,r1->ru_majflt ); + printf("ru_nswap %20ld %20ld \n", r0->ru_nswap ,r1->ru_nswap ); + printf("ru_inblock %20ld %20ld \n", r0->ru_inblock ,r1->ru_inblock ); + printf("ru_oublock %20ld %20ld \n", r0->ru_oublock ,r1->ru_oublock ); + printf("ru_msgsnd %20ld %20ld \n", r0->ru_msgsnd ,r1->ru_msgsnd ); + printf("ru_msgrcv %20ld %20ld \n", r0->ru_msgrcv ,r1->ru_msgrcv ); + printf("ru_nsignals %20ld %20ld \n", r0->ru_nsignals ,r1->ru_nsignals); + printf("ru_nvcsw %20ld %20ld \n", r0->ru_nvcsw ,r1->ru_nvcsw ); + printf("ru_nivcsw %20ld %20ld \n", r0->ru_nivcsw ,r1->ru_nivcsw ); + */ + + /* cpu time in mseconds */ + t = (int)(cput / 1000.0); + + /* ms == value of the internal clock at the end of the xfer */ + /* also called real time. */ + /* real time in mseconds */ + ms = (int)(realt / 1000.0); + + /* The display is based on variables provided by the function getrusage + Info located in : /usr/include/sys/resource.h + */ +#if defined(SYSV) + +#if defined(_AIX) + /* with AIX cernsp most counters are wrong + * cp = "%Uuser %Ssys %Ereal %P %Xi+%Dd %Mmaxrss %F+%Rpf %Ccsw\0"; + */ + cp = "%Uuser %Ssys %Ereal %P\0"; + +#else +#if defined(__osf__) + cp = "%Uuser %Ssys %Ereal %P %Xi+%Dd %Mmaxrss %F+%Rpf %Ccsw\0"; +#else +#if defined(sgi) /* IRIX 3.3 will show 0 for %M,%F,%R,%C */ + cp = "%Uuser %Ssys %Ereal %P %Mmaxrss %F+%Rpf %Ccsw\0"; +#else +#if defined(__Lynx__) + cp = "%Uuser %Ssys %Ereal %P\0"; +#else + cp = "%Uuser %Ssys %Ereal %P\0"; /* all SYSV except those mentionned */ +#endif /*__lynx__ */ +#endif /* sgi */ +#endif /*__osf__ */ +#endif /* _AIX */ + +#else /* BSD system */ + cp = "%Uuser %Ssys %Ereal %P %Xi+%Dd %Mmaxrss %F+%Rpf %Ccsw\0"; + +#endif /* SYSV */ + + for (; *cp; cp++) { + if (*cp != '%') { + putc(*cp, stderr); + /* *outp++ = *cp; */ + } else if (cp[1]) + switch(*++cp) { + case 'U': + tvsub(&tdiff, &r1->ru_utime, &r0->ru_utime); + fprintf(stderr,"%ld.%06ld", (long)tdiff.tv_sec, (long)tdiff.tv_usec); + break; + + case 'S': + tvsub(&tdiff, &r1->ru_stime, &r0->ru_stime); + fprintf(stderr,"%ld.%06ld", (long)tdiff.tv_sec, (long)tdiff.tv_usec); + break; + + case 'E': + psecs( ms / 1000); + break; + + case 'P': + fprintf(stderr,"%.1f%%", (cput*100.0 / (realt ? realt : 1.0)) ); + break; + +#if !defined(SYSV) || defined(__osf__) || defined(_AIX) + case 'W': + { + int i = r1->ru_nswap - r0->ru_nswap; + fprintf(stderr,"%d", i); + break; + } + + case 'X': + fprintf(stderr,"%ld", t == 0 ? 0 : (r1->ru_ixrss-r0->ru_ixrss)/t); + break; + + case 'D': + fprintf(stderr,"%ld", t == 0 ? 0 : + (r1->ru_idrss+r1->ru_isrss - (r0->ru_idrss+r0->ru_isrss))/t); + break; + + case 'K': + fprintf(stderr,"%ld", t == 0 ? 0 : + ((r1->ru_ixrss+r1->ru_isrss+r1->ru_idrss) - + (r0->ru_ixrss+r0->ru_idrss+r0->ru_isrss))/t); + break; + + case 'M': + fprintf(stderr,"%ld", r1->ru_maxrss/2); + break; + + case 'F': + fprintf(stderr,"%ld", r1->ru_majflt-r0->ru_majflt); + break; + + case 'R': + fprintf(stderr,"%ld", r1->ru_minflt-r0->ru_minflt); + break; + + case 'I': + fprintf(stderr,"%ld", r1->ru_inblock-r0->ru_inblock); + break; + + case 'O': + fprintf(stderr,"%ld", r1->ru_oublock-r0->ru_oublock); + break; + + case 'C': + fprintf(stderr,"%ld+%ld", + r1->ru_nvcsw-r0->ru_nvcsw, r1->ru_nivcsw-r0->ru_nivcsw); + break; +#endif /* !SYSV || __osf__ */ + default: + putc(*cp, stderr); + break; + } /* switch */ + } /* for */ +} +/*--------------------------------------------------------------------------*/ +/* add 2 times structure and move usec bigger than 1000000 to sec */ +void +tvadd(tsum, t0, t1) + struct timeval *tsum, *t0, *t1; +{ + tsum->tv_sec = t0->tv_sec + t1->tv_sec; + tsum->tv_usec = t0->tv_usec + t1->tv_usec; + if (tsum->tv_usec > 1000000) tsum->tv_sec++, tsum->tv_usec -= 1000000; +} +/*--------------------------------------------------------------------------*/ +/* substract 2 time structure (t1 > t0) */ +void +tvsub(tdiff, t1, t0) + struct timeval *tdiff, *t1, *t0; +{ + tdiff->tv_sec = t1->tv_sec - t0->tv_sec; + tdiff->tv_usec = t1->tv_usec - t0->tv_usec; + if (tdiff->tv_usec < 0) tdiff->tv_sec--, tdiff->tv_usec += 1000000; +} + +/*--------------------------------------------------------------------------*/ +void +psecs(int l) +{ + int i = (int)l/3600; + + if (i) { + /* hours:min:sec */ + fprintf(stderr,"%d:", i); + i = (int)l % 3600; + fprintf(stderr,"%.2d:%.2d", i/60, i%60); + } else { + /* min:sec */ + i = (int)l; + fprintf(stderr,"%d:%.2d", i/60, i%60); + } +} +/*--------------------------------------------------------------------------*/ +/* N R E A D */ + +int +Nread(SOCKET s, void* bufp, int count ) +{ +#if defined(__lynx__) || defined(__svr4__) || defined(_AIX) || defined(__NTVIS__) || defined(__FreeBSD__) + struct sockaddr from; +#else + struct sockaddr_in from; +#endif + int len = sizeof(from); + register int cnt; + + if (timeout > 0) { + fd_set readfds, exceptfds; + struct timeval tv_timeout; + int n; + + tv_timeout.tv_sec = timeout/1000; + tv_timeout.tv_usec = (timeout%1000)*1000; + + FD_ZERO(&readfds); + FD_ZERO(&exceptfds); + FD_SET(s, &readfds); + FD_SET(s, &exceptfds); + + n = select( s+1, &readfds, NULL, &exceptfds, &tv_timeout ); + if (n == SOCKET_ERROR) { + sockets_err("select read"); + } else if (n == 0) { + return (0); + } + + } + + if( udp ) + {cnt = recvfrom( s, bufp, count, 0, SOCKADDR_CAST &from, &len ); + numCalls++; + } + else + {if( b_flag ) cnt = mread( s, bufp, count ); /* fill bufp */ + else + { +#if defined(__NTVIS__) + cnt = recv( s, bufp, count, 0 ); +#else + cnt = read( s, bufp, count ); +#endif /* __NTVIS__ */ + numCalls++; + } + if (touchdata && cnt > 0) + {register int c = cnt, sum = 0; + register char *b = bufp; + while (c--) sum += *b++; + } + } + /* rchrch printf (" numcall %d read buffer %d bytes \n",numCalls,cnt); */ + return(cnt); +} +/*--------------------------------------------------------------------------*/ +/* N W R I T E */ + +int +Nwrite( int s, void* bufp, int count ) +{ + register int cnt; + if( udp ) + { + again: + cnt = sendto( s, bufp, count, 0, SOCKADDR_CAST &sinhim, + sizeof(sinhim) ); + + numCalls++; + +#if defined(__NTVIS__) + if( cnt<0 && WSAENOBUFS == WSAGetLastError()) +#else + if( cnt<0 && errno == ENOBUFS ) +#endif /* __NTVIS__ */ + + { delay(18000); errno = 0; goto again; } + } else /* if (udp) */ + { + +#if defined(__NTVIS__) + cnt = send( s, bufp, count, 0 ); + numCalls++; +#else + cnt = write( s, bufp, count ); + numCalls++; +#endif /* __NTVIS__ */ + } + return(cnt); +} +/*--------------------------------------------------------------------------*/ +void +delay(us) +int us; +{ + struct timeval tv; + + tv.tv_sec = 0; + tv.tv_usec = (time_t)us; + +#if defined(__hpux__) + select(1, 0, 0, 0, &tv); +#else + select(1, (fd_set *)0, (fd_set *)0, (fd_set *)0, &tv); +#endif +} +/*--------------------------------------------------------------------------*/ +/* M R E A D + * + * This function performs the function of a read(II) but will + * call read(II) multiple times in order to get the requested + * number of characters. This can be necessary because + * network connections don't deliver data with the same + * grouping as it is written with. Written by Robert S. Miles, BRL. + */ +int +mread(int s, char* bufp, unsigned n) +{ + register unsigned count = 0; + register int nread; + + do + { +#if defined(__NTVIS__) + nread = recv(s, bufp, n-count, 0); +#else + nread = read(s, bufp, n-count); +#endif /* __NTVIS__ */ + numCalls++; + if(nread < 0) {perror("ttcp_mread"); return(-1); } + if(nread == 0) return((int)count); + count += (unsigned)nread; + bufp += nread; + }while(count < n); + return((int)count); +} + +/*--------------------------------------------------------------------------*/ +void +open_log() +{static long sysTicks; +#if defined(UNDER_CE) + SYSTEMTIME SystemTime; +#endif + sprintf(logfile,"%s_%s",logfile_head,trans?"t":"r"); + + fprintf(stderr,"open the log file >%s<\n",logfile); + if ((fplog = fopen(logfile,"r")) == NULL) + + {if ((fplog = fopen(logfile,"a+")) == NULL) + {fprintf(stderr,"Failure : creation of the file >%s< \n",logfile ); + exit(1); + } + else + {fprintf(fplog," creation date : "); + /* get date */ +#if defined(UNDER_CE) + GetLocalTime(&SystemTime); + sprintf(fplog,"%02d-%02d-%02d %02d:%02d\n", SystemTime.wDay, month[SystemTime.wMonth - 1], + SystemTime.wYear, SystemTime.wHour, SystemTime.wMinute); +#else + time(&sysTicks); + tms = localtime(&sysTicks); + fprintf(fplog,"%02d-%02d-%02d %02d:%02d\n", + tms->tm_mday, tms->tm_mon, tms->tm_year,tms->tm_hour, tms->tm_min); +#endif + + /* An other version will produce : Mon Aug 4 16:32:16 1997 + * long lDxcomsTicks; char *pDateTime; + * time(&lDxcomsTicks); + * pDateTime = ctime(&lDxcomsTicks); *(pDateTime+24) = '\0'; + * fprintf(fplog," ttcp called : %s", pDateTime); + */ + fprintf(fplog,"format\n"); + fprintf(fplog,",buflen, nbuf(byte), bufalign(byte), bufoffset(byte)"); + fprintf(fplog,", port, sockbufsize(byte), UserTime(sec), SysTime(sec)\n"); + fprintf(fplog,", CPUusage(%%), Validity, nbytes(byte), realt(sec)"); + fprintf(fplog,", rate(MB/sec), I/O call, hours*3600+min*60+sec\n\n"); + /* day-month-year, hour:minute\n\n"); */ + } + } /* file already exist */ + else + {fclose (fplog); + if ((fplog = fopen(logfile,"a+")) == NULL) + {fprintf(stderr,"Failure : access of the file >%s< \n",logfile ); + exit(1); + } + } +} +/*--------------------------------------------------------------------------*/ +void +close_log() +{ +#if defined(UNDER_CE) + SYSTEMTIME SystemTime; + + GetLocalTime(&SystemTime); + fprintf(fplog," %d\n", SystemTime.wHour * 3600 + SystemTime.wMinute * 60 + SystemTime.wSecond); +#else + static long sysTicks; + time(&sysTicks); + tms = localtime(&sysTicks); + fprintf(fplog," %d\n",((tms->tm_hour)*3600 + (tms->tm_min)*60 + tms->tm_sec)); +#endif + fclose(fplog); + fflush(fplog); +} +/*--------------------------------------------------------------------------*/ +/* routine emulating UNIX function under NT */ +#if defined(__NTVIS__) + +/*---------------------------------------------------------------------------*/ +static void +error(char *pch) +{ + if (!opterr) { + return; // without printing + } + fprintf(stderr, "%s: %s: %c\n", + (NULL != progname) ? progname : "getopt", pch, optopt); +} +/*---------------------------------------------------------------------------*/ +int +getopt(int argc, char **argv, char *ostr) +{ + static char *place = EMSG; /* option letter processing */ + register char *oli; /* option letter list index */ + + if (!*place) { + // update scanning pointer + if (optind >= argc || *(place = argv[optind]) != '-' || !*++place) { + place = EMSG; + return -1; + } + // place now points to the first char past the initial '-' + if (place[0] == '-') { + // found "--" + // Was the word just a '--'? + if (place[1] == '\0') + ++optind; // yes, so consume the word + // otherwise, the '--' was the start of a longer word, + // so do not consume it. + place = EMSG; + return -1; + } + } + + /* option letter okay? */ + if ((optopt = (int)*place++) == (int)':' + || !(oli = strchr(ostr, optopt))) { + if (!*place) { + ++optind; + } + error("illegal option"); + return BADCH; + } + if (*++oli != ':') { + /* don't need argument */ + optarg = NULL; + if (!*place) + ++optind; + } else { + /* need an argument */ + if (*place) { + optarg = place; /* no white space */ + } else if (argc <= ++optind) { + /* no arg */ + place = EMSG; + error("option requires an argument"); + return BADCH; + } else { + optarg = argv[optind]; /* white space */ + } + place = EMSG; + ++optind; + } + return optopt; // return option letter +} + +void +usleep(unsigned int microseconds) +{ + Sleep(microseconds/1000); +} +#endif /* __NTVIS__ */ +/*--------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------*/ +void +do_help() +{ +char More_help[] = +" Details about the reply: \n" +" Example: \n" +" ttcp-t: buflen=8192, nbuf=100, align=16384/0, port=5010\n" +" ttcp-t: File-Descriptor 0x4 Opened\n" +" # tcp sender -> #\n" +" ttcp-t: 819200 bytes in 1.152557 real seconds = 694.109 KB/sec +++\n" +" ttcp-t: 100 I/O calls, 11.526 msec(real)/call, 0.213 msec(cpu)/call\n" +" ttcp-t: 0.001914user 0.019388sys 0:01real 1% 9i+58d 190maxrss 1+2pf 177+180csw\n" +" ttcp-t: buffer address 0x28000\n" +" ttcp-t: File-Descriptor fd 0x4 Closed\n" +" ttcp done.\n\n" +"cpu seconds == (sec) elapse ru_utime + elapse ru_stime.\n" +" ru_utime == The total amount of time running in user mode.\n" +" ru_stime == The total amount of time spent in the system.\n" +" executing on behalf of the process.\n" +"real seconds == elapse time calculated by the system timer (date).\n" +"I/O calls == I/O call to the driver.\n" +"msec/call == average elapse time (Real seconds) between each I/O.\n" +"calls/sec == invert of msec/call.\n" +"user == (sec.msec) elaspe ru_utime.\n" +"sys == (sec.msec) elapse ru_stime.\n" +"real == (min:sec) CPU seconds.\n" +"%% == Real seconds / CPU seconds.\n" +"(ru_ixrss)i+(ru_idrss)d\n" +" ru_ixrss == An integral value indicating the amount of memory \n" +" used by the text segment that was also shared among\n" +" other processes. This value is expressed in units of\n" +" kilobytes * seconds-of-execution and is calculated \n" +" by adding the number of shared memory pages in use \n" +" each time the internal system clock ticks, and then\n" +" averaging over one-second intervals.\n" +" ru_idrss == An integral value of the amount of unshared memory \n" +" in the data segment of a process (expressed in \n" +" units of kilobytes * seconds-of-execution).\n"; + +char More_help1[] = +" (ru_maxrss/2)maxrss.\n" +" ru_maxrss == The maximum size, in kilobytes, of the used\n" +" resident set size. \n" +" (ru_majflt)+(ru_minflt)pf : Page fault\n" +" ru_majflt == The number of page faults serviced that required\n" +" I/O activity.\n" +" ru_minflt == The number of page faults serviced without any\n" +" I/O activity. In this case, I/O activity is \n" +" avoided by reclaiming a page frame from the list \n" +" of pages awaiting reallocation. \n" +"(ru_nvcsw)+(ru_nivcsw)csw : context switch\n" +" ru_nvcsw == The number of times a context switch resulted \n" +" because a process voluntarily gave up the \n" +" processor before its time slice was completed. \n" +" This usually occurs while the process waits \n" +" for availability of a resource.\n" +" ru_nivcsw == The number of times a context switch resulted \n" +" because a higher priority process ran or because\n" +" the current process exceeded its time slice.\n\n"; + +char More_help2[] = +"log file format :\n" +" buflen, nbuf(byte), bufalign(byte), bufoffset(byte)\n" +" port, sockbufsize(byte), UserTime(sec), SysTime(sec), CPUusage(%)\n" +" nbytes(byte), realt(sec), rate(MB/sec), I/O call,\n" +" hours*3600+min*60+sec\n\n"; + + fprintf(stderr,More_help); + fprintf(stderr,More_help1); + fprintf(stderr,More_help2); +} +/*---------------------------------------------------------------------------*/ +void +do_Usage() +{ +char Usage[] = +" Usage: ttcp -t [-options] host [ < in ] ttcp -r [-options > out]\n" +"Example: ttcp -t -s -v -n100 host ttcp -r -s -v -n100\n" +"Common options:\n" +" -V prints version number and date of last modification\n" +" -L create and append all results to a file named ttcp_log\n" +" -h more help\n" +" -l ## length of bufs read from or written to network (default 8192,\n" +" max 65535)\n" +" -u use UDP instead of TCP\n" +" -p ## port number to send to or listen at (default 5010)\n" +#if defined(__linux__) +" -P ## link-layer priority (default 0)\n" +#endif +" -s (ttcp -t) : source a pattern to network\n" +" (ttcp -r) : sink (discard) all data from network\n" +" -A ## align the start of buffers to this modulus (default 16384)\n" +" -O ## start buffers at this offset from the modulus (default 0)\n" +" -v verbose: print more statistics\n" +" -d set SO_DEBUG socket option\n" +" -b ## set socket buffer size (if supported)\n" +" -f X format for rate: b,B = bits, bytes k,K = kilo{bits,bytes};\n" +" m,M = mega{bits,bytes}; g,G = giga{bits,bytes}\n" +" -w ## set timeout value (in milliseconds) to exit if no receive data or tcp connect\n" +"Options specific to (ttcp -t) :\n" +" -n ## number of source bufs written to network (default 2048)\n" +" -x use random data in tcp/udp frames (-I provides seed)\n" +" -D don't buffer TCP writes (sets TCP_NODELAY socket option)\n" +" -H print hash marks to indicate progress, one per buffer\n" +" -I init/seed value for RNG when sending random size bufs (default 1)\n" +" -N ## number of source bufs per burst, i.e between sleeps (default 1)\n" +" -R ## send random size buffers with minimum size specified, max size\n" +" is value of -l option\n" +" -S ## millisecs between bursts (only used for udp, 10ms resolution)\n" +"Options specific to (ttcp -r) :\n" +" -B for -s, only output full blocks as specified by -l (for TAR)\n" +" -T \"touch\": access each byte as it's read\n" +" -i report information on out of order sequence numbers\n" +#if defined(DEBUG) +"Options for debug:\n" +" --nostart do not send UDP start packets\n" +" --noend do not send UDP end packets\n" +" --nodata do not send UDP data packets\n" +" --debug print extra debug outputs\n" +#endif /* DEBUG */ +; + + fprintf(stderr,Usage); +} + +/* Define automatic Emacs variables for consistent code formatting */ +/* Local Variables: */ +/* c-basic-offset:2 */ +/* indent-tabs-mode:nil */ +/* End: */ diff --git a/net/uanytun/Makefile b/net/uanytun/Makefile new file mode 100644 index 0000000..6121865 --- /dev/null +++ b/net/uanytun/Makefile @@ -0,0 +1,207 @@ +# +# Copyright (C) 2008 Christian Pointner, +# +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# This Makefile builds uAnytun Package for OpenWRT +# +# $Id: $ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=uanytun +PKG_VERSION:=0.3.3 +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.anytun.org/download/ +PKG_MD5SUM:=ca39dab02e91b0737e2b3f0839e74f6a + +include $(INCLUDE_DIR)/package.mk + + +define Package/uanytun/template + SECTION:=net + CATEGORY:=Network + TITLE:=micro anycast tunneling daemon + URL:=http://www.anytun.org/ + MAINTAINER:=Christian Pointner + SUBMENU:=VPN +endef + +define Package/uanytun/desc-template +uAnytun is a tiny implementation of SATP the secure anycast tunneling protocol. + SATP defines a protocol used for communication between any combination of + unicast and anycast tunnel endpoints. It has less protocol overhead than + IPSec in Tunnel mode and allows tunneling of every ETHER TYPE protocol (e.g. + ethernet, ip, arp ...). SATP directly includes cryptography and message + authentication based on the methodes used by SRTP. It is intended to deliver + a generic, scaleable and secure solution for tunneling and relaying of packets + of any protocol. + Unlike Anytun which is a full featured implementation uAnytun has no support + for multiple connections or synchronisation. It is a small single threaded + implementation intended to act as a client on small platforms. +endef + + +define Package/uanytun + $(call Package/uanytun/template) + DEPENDS:=+kmod-tun +libgcrypt +endef + +define Package/uanytun/conffiles +/etc/config/uanytun +endef + +define Package/uanytun/description + $(call Package/uanytun/desc-template) +endef + + +define Package/uanytun-sslcrypt + $(call Package/uanytun/template) + DEPENDS:=+kmod-tun +libopenssl +endef + +define Package/uanytun-sslcrypt/conffiles +/etc/config/uanytun-sslcrypt +endef + +define Package/uanytun-sslcrypt/description + $(call Package/uanytun/desc-template) +endef + + +define Package/uanytun-nocrypt + $(call Package/uanytun/template) + DEPENDS:=+kmod-tun +endef + +define Package/uanytun-nocrypt/conffiles +/etc/config/uanytun-nocrypt +endef + +define Package/uanytun-nocrypt/description + $(call Package/uanytun/desc-template) +endef + +define Package/uanytun/configure + (cd $(1)/$(2)/src; \ + touch include.mk; \ + ln -s linux/tun.c .; \ + echo '#ifndef UANYTUN_version_h_INCLUDED' > version.h; \ + echo '#define UANYTUN_version_h_INCLUDED' >> version.h; \ + echo '' >> version.h; \ + echo '#define VERSION_STRING_0 "uanytun version '`cat $(1)/version`'"' >> version.h; \ + echo '#define VERSION_STRING_1 "built on '`hostname`', '`date +"%d.%m.%Y %H:%M:%S %Z"`'"' >> version.h; \ + echo '' >> version.h; \ + echo '#endif' >> version.h \ + ) +endef + +ifneq ($(CONFIG_PACKAGE_uanytun-nocrypt),) + define Build/Configure/uanytun-nocrypt + rm -rf $(PKG_BUILD_DIR)/uanytun-nocrypt + mkdir -p $(PKG_BUILD_DIR)/uanytun-nocrypt + $(CP) -r $(PKG_BUILD_DIR)/src $(PKG_BUILD_DIR)/uanytun-nocrypt + $(call Package/uanytun/configure,$(PKG_BUILD_DIR),uanytun-nocrypt) + endef + + define Build/Compile/uanytun-nocrypt + $(MAKE) -C $(PKG_BUILD_DIR)/uanytun-nocrypt/src \ + $(TARGET_CONFIGURE_OPTS) \ + NO_CRYPT_OBJ=1 \ + TARGET=Linux \ + CFLAGS="$(TARGET_CFLAGS) -DNO_CRYPT" \ + LDFLAGS="$(TARGET_LDFLAGS) -ldl" + $(STRIP) $(PKG_BUILD_DIR)/uanytun-nocrypt/src/uanytun + endef +endif + +ifneq ($(CONFIG_PACKAGE_uanytun-sslcrypt),) + define Build/Configure/uanytun-sslcrypt + rm -rf $(PKG_BUILD_DIR)/uanytun-sslcrypt + mkdir -p $(PKG_BUILD_DIR)/uanytun-sslcrypt + $(CP) -r $(PKG_BUILD_DIR)/src $(PKG_BUILD_DIR)/uanytun-sslcrypt + $(call Package/uanytun/configure,$(PKG_BUILD_DIR),uanytun-sslcrypt) + endef + + define Build/Compile/uanytun-sslcrypt + $(MAKE) -C $(PKG_BUILD_DIR)/uanytun-sslcrypt/src \ + $(TARGET_CONFIGURE_OPTS) \ + TARGET=Linux \ + CFLAGS="$(TARGET_CFLAGS) -DUSE_SSL_CRYPTO -I$(STAGING_DIR)/usr/include" \ + LDFLAGS="$(TARGET_LDFLAGS) -ldl -lcrypto" + $(STRIP) $(PKG_BUILD_DIR)/uanytun-sslcrypt/src/uanytun + endef +endif + +ifneq ($(CONFIG_PACKAGE_uanytun),) + define Build/Configure/uanytun-default + rm -rf $(PKG_BUILD_DIR)/uanytun + mkdir -p $(PKG_BUILD_DIR)/uanytun + $(CP) -r $(PKG_BUILD_DIR)/src $(PKG_BUILD_DIR)/uanytun + $(call Package/uanytun/configure,$(PKG_BUILD_DIR),uanytun) + endef + + define Build/Compile/uanytun-default + $(MAKE) -C $(PKG_BUILD_DIR)/uanytun/src \ + $(TARGET_CONFIGURE_OPTS) \ + TARGET=Linux \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \ + LDFLAGS="$(TARGET_LDFLAGS) -ldl -lgcrypt -lgpg-error" + $(STRIP) $(PKG_BUILD_DIR)/uanytun/src/uanytun + endef +endif + + +define Build/Configure + $(call Build/Configure/uanytun-nocrypt) + $(call Build/Configure/uanytun-sslcrypt) + $(call Build/Configure/uanytun-default) +endef + +define Build/Compile + $(call Build/Compile/uanytun-nocrypt) + $(call Build/Compile/uanytun-sslcrypt) + $(call Build/Compile/uanytun-default) +endef + +define Build/Clean + rm -rf $(PKG_BUILD_DIR)/uanytun-nocrypt + rm -rf $(PKG_BUILD_DIR)/uanytun-sslcrypt + rm -rf $(PKG_BUILD_DIR)/uanytun +endef + + + +define Package/uanytun/install-generic + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/$(3) $(1)/etc/config/$(2) + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(2)/src/uanytun $(1)/usr/sbin/$(2) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/uanytun.init $(1)/etc/init.d/$(2) + @sed -e 's/BIN=uanytun/BIN=$(2)/' -i $(1)/etc/init.d/$(2) +endef + +define Package/uanytun/install + $(call Package/uanytun/install-generic,$(1),uanytun,uanytun.config) +endef + +define Package/uanytun-sslcrypt/install + $(call Package/uanytun/install-generic,$(1),uanytun-sslcrypt,uanytun.config) +endef + +define Package/uanytun-nocrypt/install + $(call Package/uanytun/install-generic,$(1),uanytun-nocrypt,uanytun-nocrypt.config) +endef + + + +$(eval $(call BuildPackage,uanytun)) +$(eval $(call BuildPackage,uanytun-sslcrypt)) +$(eval $(call BuildPackage,uanytun-nocrypt)) diff --git a/net/uanytun/files/uanytun-nocrypt.config b/net/uanytun/files/uanytun-nocrypt.config new file mode 100644 index 0000000..9792d1f --- /dev/null +++ b/net/uanytun/files/uanytun-nocrypt.config @@ -0,0 +1,88 @@ +config "client1" + option disabled 0 + option username 'nobody' + option groupname 'nogroup' +# option chroot "/var/run/uanytun" + +# option interface '' +# option port '4444' +# option sender_id '1' + +# option dev 'anytun0' + option type 'tun' + option ifconfig '192.168.123.1/24' +# option post-up-script '/etc/uanytun/client1-post-up.sh' + + option remote_host 'example.com' + option remote_port '4444' + + option window_size 0 + option mux 1 + + option log 'syslog:3,anytun-client1,daemon' + + +config "client2" + option disabled 1 + option username 'nobody' + option groupname 'nogroup' + + option type 'tun' + option ifconfig '192.168.123.2/24' + + option remote_host 'example.com' + option remote_port '4444' + + option window_size 0 + option mux 2 + + option log 'syslog:3,anytun-client2,daemon' + + +config "client3" + option disabled 1 + option username 'nobody' + option groupname 'nogroup' + + option type 'tun' + option ifconfig '192.168.123.3/24' + + option remote_host 'example.com' + option remote_port '4444' + + option window_size 0 + option mux 3 + + option log 'syslog:3,anytun-client3,daemon' + + +config "p2p-a" + option disabled 1 + option username 'nobody' + option groupname 'nogroup' + + option type 'tun' + option ifconfig '192.168.223.1/24' + + option remote_host 'p2p-b.example.com' + option remote_port '4444' + + option window_size 0 + + option log 'syslog:3,anytun-p2p-a,daemon' + + +config "p2p-b" + option disabled 1 + option username 'nobody' + option groupname 'nogroup' + + option type 'tun' + option ifconfig '192.168.223.2/24' + + option remote_host 'p2p-a.example.com' + option remote_port '4444' + + option window_size 0 + + option log 'syslog:3,anytun-p2p-b,daemon' diff --git a/net/uanytun/files/uanytun.config b/net/uanytun/files/uanytun.config new file mode 100644 index 0000000..c53db37 --- /dev/null +++ b/net/uanytun/files/uanytun.config @@ -0,0 +1,116 @@ +config "client1" + option disabled 0 +# option username 'nobody' +# option groupname 'nogroup' +# option chroot "/var/run/uanytun" + +# option interface '' +# option port '4444' +# option sender_id '1' + + option cipher 'aes-ctr' +# option cipher 'null' +# option cipher 'aes-ctr-128' +# option cipher 'aes-ctr-192' +# option cipher 'aes-ctr-256' + option auth_algo 'sha1' +# option auth_algo 'null' +# option auth_tag_length 10 + +# option dev 'anytun0' + option type 'tun' + option ifconfig '192.168.123.1/24' +# option post-up-script '/etc/uanytun/client1-post-up.sh' + + option remote_host 'example.com' + option remote_port '4444' + + option window_size 0 + option mux 1 + + option role 'client' +# option kd_prf 'null' +# option kd_prf 'aes-ctr' +# option kd_prf 'aes-ctr-128' +# option kd_prf 'aes-ctr-192' +# option kd_prf 'aes-ctr-256' +# option ld_kdr '0' +# option key '0123456789ABCDEF0123456789ABCDEF' +# option salt '0123456789ABCD0123456789ABCD' + option passphrase 'Creating_VPN_Tunnels_With_Anytun_Is_Easy' + + option log 'syslog:3,anytun-client1,daemon' + + +config "client2" + option disabled 1 + + option cipher 'aes-ctr' + option auth_algo 'sha1' + option type 'tun' + option ifconfig '192.168.123.2/24' + + option remote_host 'example.com' + option remote_port '4444' + + option window_size 0 + option mux 2 + option role 'client' + option passphrase 'Creating_VPN_Tunnels_With_Anytun_Is_Easy' + + option log 'syslog:3,anytun-client2,daemon' + + +config "client3" + option disabled 1 + + option cipher 'aes-ctr' + option auth_algo 'sha1' + option type 'tun' + option ifconfig '192.168.123.3/24' + + option remote_host 'example.com' + option remote_port '4444' + + option window_size 0 + option mux 3 + option role 'client' + option passphrase 'Creating_VPN_Tunnels_With_Anytun_Is_Easy' + + option log 'syslog:3,anytun-client3,daemon' + + +config "p2p-a" + option disabled 1 + + option cipher 'aes-ctr' + option auth_algo 'sha1' + option type 'tun' + option ifconfig '192.168.223.1/24' + + option remote_host 'p2p-b.example.com' + option remote_port '4444' + + option window_size 0 + option role 'alice' + option passphrase 'Creating_P2P_VPN_Tunnels_With_Anytun_Is_Easy' + + option log 'syslog:3,anytun-p2p-a,daemon' + + +config "p2p-b" + option disabled 1 + + option cipher 'aes-ctr' + option auth_algo 'sha1' + option type 'tun' + option ifconfig '192.168.223.2/24' + + option remote_host 'p2p-a.example.com' + option remote_port '4444' + + option window_size 0 + option role 'bob' + option passphrase 'Creating_P2P_VPN_Tunnels_With_Anytun_Is_Easy' + + option log 'syslog:3,anytun-p2p-b,daemon' diff --git a/net/uanytun/files/uanytun.init b/net/uanytun/files/uanytun.init new file mode 100644 index 0000000..59e1c23 --- /dev/null +++ b/net/uanytun/files/uanytun.init @@ -0,0 +1,104 @@ +#!/bin/sh /etc/rc.common +START=50 + +BIN=uanytun +DAEMON=/usr/sbin/$BIN +DESC=$BIN +RUN_D=/var/run + + +option_cb() { + local varname="$1" + local value="$2" + + if ! echo "$CONFIG_OPTIONS" | grep " $varname " > /dev/null; then + CONFIG_OPTIONS="$CONFIG_OPTIONS $varname " + fi +} + +foreach_config_forced() { + foreach_config $1 "forced" +} + +foreach_config() { + local cfg="$1" + local name + local option + local value + local args="" + local forced=0 + + if [ -n "$2" ] && [ "x$2" == "xforced" ]; then + forced=1 + fi + + config_get name "$cfg" TYPE + for option in $CONFIG_OPTIONS + do + config_get value "$cfg" "$option" + if [ "x$option" == "xdisabled" ]; then + if [ $forced -eq 0 ] && [ $value -eq 1 ]; then + echo -n " $name(disabled)" + return + fi + continue + fi + + option=`echo $option | tr '_' '-'` + if [ -n "$value" ]; then + args="$args --$option $value" + fi + done + echo -n " $name" + local status="OK" + $DAEMON --write-pid "$RUN_D/$BIN.$name.pid" $args || status="failed" + echo -n "($status)" +} + +stop_vpn() { + local name=$1 + local pidfile=$RUN_D/$BIN.$name.pid + echo -n " $name" + local status="OK" + if [ ! -f "$pidfile" ]; then + status="tunnel not active" + else + kill `cat $pidfile` > /dev/null 2>&1 || status="failed" + rm -f $pidfile + fi + echo -n "($status)" +} + +start() { + echo -n "Starting $DESC:" + config_load $BIN + if [ $# -gt 0 ]; then + while [ $# -gt 0 ]; do + config_foreach foreach_config_forced "$1" + shift + done + else + config_foreach foreach_config "" + fi + echo "." +} + +stop() { + echo -n "Stopping $DESC:" + local name + local pidfile + + if [ $# -gt 0 ]; then + while [ $# -gt 0 ]; do + stop_vpn $1 + shift + done + else + for pidfile in `ls $RUN_D/$BIN.*.pid 2> /dev/null`; do + name=${pidfile%%.pid} + name=${name##$RUN_D/$BIN.} + stop_vpn $name + done + fi + echo "." +} diff --git a/net/ucarp/Makefile b/net/ucarp/Makefile new file mode 100644 index 0000000..67afdfc --- /dev/null +++ b/net/ucarp/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ucarp +PKG_VERSION:=1.5.2 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://download.pureftpd.org/pub/ucarp +PKG_MD5SUM:=723636dbf79fc6abd329a71ec4ddf79d + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ucarp + SECTION:=net + CATEGORY:=Network + TITLE:=Lets several hosts share one IP + DEPENDS:=+ip +libpcap + URL:=http://www.ucarp.org/project/ucarp +endef + +define Package/ucarp/description + ucarp allows a couple of hosts to share common virtual IP addresses in order + to provide automatic failover. It is a portable userland implementation of the + secure and patent-free Common Address Redundancy Protocol +endef + +define Package/ucarp/conffiles +/etc/ucarp.conf +endef + +define Package/ucarp/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/ucarp.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/ucarp.init $(1)/etc/init.d/ucarp + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ucarp $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,ucarp)) diff --git a/net/ucarp/files/ucarp.conf b/net/ucarp/files/ucarp.conf new file mode 100644 index 0000000..86480f5 --- /dev/null +++ b/net/ucarp/files/ucarp.conf @@ -0,0 +1,22 @@ +# Run in background +BACKGROUND=1 + +# Interface to run CARP on +IF=br-lan + +# Virtual IP shared with the other system +VIP=10.0.0.117 + +# Size of the network mask for the virtual IP +VMASK=24 + +# Real, static IP of this host +MYIP=192.168.1.20 + +# Password shared with the other system +PASSWORD=love + +# IP addresses to arping after taking over the shared IP, +# you should list all known systems, those not listed can +# take up to a minute to notice the change. +PINGIP="10.0.0.1 10.0.0.20" diff --git a/net/ucarp/files/ucarp.init b/net/ucarp/files/ucarp.init new file mode 100644 index 0000000..c00baf4 --- /dev/null +++ b/net/ucarp/files/ucarp.init @@ -0,0 +1,43 @@ +#!/bin/sh /etc/rc.common + +START=50 +CONF=/etc/ucarp.conf +IP=$(which ip) +UCARP=$(which ucarp) +ARPING=$(which arping) + +start() { + . ${CONF} + + [ ${BACKGROUND} = 1 ] && daemon="--daemonize" + + cat > /var/run/ucarp-vip-up <> /var/run/ucarp-vip-up < /var/run/ucarp-vip-down <&5 +-$as_echo_n "checking whether snprintf is C99 conformant... " >&6; } +-if test "$cross_compiling" = yes; then +- { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&5 +-$as_echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-#include +-#ifdef STDC_HEADERS +-# include +-# include +-#else +-# if HAVE_STDLIB_H +-# include +-# endif +-#endif +-#ifdef HAVE_UNISTD_H +-# include +-#endif +- +-int main(void) +-{ +- char buf[4]; +- +- (void) fprintf(fopen("conftestval", "w"), "%d\n", +- (int) snprintf(buf, sizeof buf, "12345678")); +- return 0; +-} +- +-_ACEOF +-rm -f 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>&5 +- ac_status=$? +- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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_try") 2>&5 +- ac_status=$? +- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- CONF_SNPRINTF_TYPE=`cat conftestval` +- +-else +- $as_echo "$as_me: program exited with status $ac_status" >&5 +-$as_echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-fi +-rm -rf conftest.dSYM +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +- +- +-{ $as_echo "$as_me:$LINENO: result: done" >&5 +-$as_echo "done" >&6; } +-if test "x$CONF_SNPRINTF_TYPE" = "x" ; then +- { $as_echo "$as_me:$LINENO: WARNING: your operating system doesn't implement snprintf" >&5 +-$as_echo "$as_me: WARNING: your operating system doesn't implement snprintf" >&2;} +-else +- + cat >>confdefs.h <<_ACEOF +-#define CONF_SNPRINTF_TYPE $CONF_SNPRINTF_TYPE +-_ACEOF +- +-fi +- +-{ $as_echo "$as_me:$LINENO: checking whether you already have a standard SHA1 implementation" >&5 +-$as_echo_n "checking whether you already have a standard SHA1 implementation... " >&6; } +-if test "$cross_compiling" = yes; then +- { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&5 +-$as_echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-#include +-#include +-#include +-#include +- +-int main(void) +-{ +- SHA1_CTX ctx; +- char b[41]; +- +- SHA1Init(&ctx); +- SHA1Update(&ctx, (const unsigned char *) "test", 4U); +- SHA1End(&ctx, b); +- b[40] = 0; +- +- return strcasecmp(b, "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"); +-} +- +-_ACEOF +-rm -f 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>&5 +- ac_status=$? +- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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_try") 2>&5 +- ac_status=$? +- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- +-{ $as_echo "$as_me:$LINENO: result: yes" >&5 +-$as_echo "yes" >&6; } +- +-cat >>confdefs.h <<\_ACEOF +-#define USE_SYSTEM_CRYPT_SHA1 /**/ ++#define CONF_SNPRINTF_TYPE 1 + _ACEOF + + +-else +- $as_echo "$as_me: program exited with status $ac_status" >&5 +-$as_echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-{ $as_echo "$as_me:$LINENO: result: no" >&5 +-$as_echo "no" >&6; } +- +-fi +-rm -rf conftest.dSYM +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +- +- + + { $as_echo "$as_me:$LINENO: checking whether syslog names are available" >&5 + $as_echo_n "checking whether syslog names are available... " >&6; } diff --git a/net/ucspi-tcp/Makefile b/net/ucspi-tcp/Makefile new file mode 100644 index 0000000..b9ad9cf --- /dev/null +++ b/net/ucspi-tcp/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2007 OpenWrt.org +# Original port by FreeWRT project. +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# Alexander Tsvyashchenko Created OpenWRT package as per Trac ticket 2497 +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ucspi-tcp +PKG_VERSION:=0.88 +PKG_RELEASE:=1 + +PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz +PKG_SOURCE_URL:=http://cr.yp.to/ucspi-tcp/ +PKG_MD5SUM:=39b619147db54687c4a583a7a94c9163 + +include $(INCLUDE_DIR)/package.mk + +define Package/ucspi-tcp + SECTION:=net + CATEGORY:=Network + DEPENDS:= + TITLE:=UNIX Client-Server Program Interface for TCP + URL:=http://cr.yp.to/ucspi-tcp.html +endef + +define Package/PKG_NAME/description. + tcpserver and tcpclient are command-line tools for building + TCP client-server applications. +endef + +define Build/Compile + TARGET_CC="$(TARGET_CC)" \ + TARGET_CFLAGS="$(TARGET_CFLAGS)" \ + TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \ + TARGET_RANLIB="$(TARGET_CROSS)ranlib" \ + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +define Package/ucspi-tcp/install + $(INSTALL_DIR) $(1)/usr/bin + (cd $(PKG_BUILD_DIR); \ + $(INSTALL_BIN) tcpserver tcprules tcprulescheck argv0 recordio \ + tcpclient who@ date@ finger@ http@ tcpcat mconnect mconnect-io \ + addcr delcr fixcrio rblsmtpd \ + $(1)/usr/bin) +endef + +$(eval $(call BuildPackage,ucspi-tcp)) + diff --git a/net/ucspi-tcp/patches/100-cross_compile.patch b/net/ucspi-tcp/patches/100-cross_compile.patch new file mode 100644 index 0000000..a688ea9 --- /dev/null +++ b/net/ucspi-tcp/patches/100-cross_compile.patch @@ -0,0 +1,196 @@ +--- a/Makefile ++++ b/Makefile +@@ -36,10 +36,6 @@ auto-str.o: \ + compile auto-str.c buffer.h readwrite.h exit.h + ./compile auto-str.c + +-auto_home.c: \ +-auto-str conf-home +- ./auto-str auto_home `head -1 conf-home` > auto_home.c +- + auto_home.o: \ + compile auto_home.c + ./compile auto_home.c +@@ -305,10 +301,6 @@ fmt_ulong.o: \ + compile fmt_ulong.c fmt.h + ./compile fmt_ulong.c + +-fork.h: \ +-choose compile load tryvfork.c fork.h1 fork.h2 +- ./choose cl tryvfork fork.h1 fork.h2 > fork.h +- + getln.o: \ + compile getln.c byte.h getln.h buffer.h stralloc.h gen_alloc.h + ./compile getln.c +@@ -317,24 +309,6 @@ getln2.o: \ + compile getln2.c byte.h getln.h buffer.h stralloc.h gen_alloc.h + ./compile getln2.c + +-hassgact.h: \ +-choose compile load trysgact.c hassgact.h1 hassgact.h2 +- ./choose cl trysgact hassgact.h1 hassgact.h2 > hassgact.h +- +-hassgprm.h: \ +-choose compile load trysgprm.c hassgprm.h1 hassgprm.h2 +- ./choose cl trysgprm hassgprm.h1 hassgprm.h2 > hassgprm.h +- +-hasshsgr.h: \ +-choose compile load tryshsgr.c hasshsgr.h1 hasshsgr.h2 chkshsgr \ +-warn-shsgr +- ./chkshsgr || ( cat warn-shsgr; exit 1 ) +- ./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h +- +-haswaitp.h: \ +-choose compile load trywaitp.c haswaitp.h1 haswaitp.h2 +- ./choose cl trywaitp haswaitp.h1 haswaitp.h2 > haswaitp.h +- + hier.o: \ + compile hier.c auto_home.h + ./compile hier.c +@@ -362,10 +336,6 @@ instcheck.o: \ + compile instcheck.c strerr.h error.h readwrite.h exit.h + ./compile instcheck.c + +-iopause.h: \ +-choose compile trypoll.c iopause.h1 iopause.h2 +- ./choose clr trypoll iopause.h1 iopause.h2 > iopause.h +- + iopause.o: \ + compile iopause.c taia.h tai.h uint64.h select.h iopause.h taia.h + ./compile iopause.c +@@ -404,7 +374,7 @@ warn-auto.sh systype + dgux-*) ;; \ + hp-ux-*) ;; \ + sco*) ;; \ +- *) echo 'ranlib "$$main"' ;; \ ++ *) echo '$(if $(TARGET_RANLIB),$(TARGET_RANLIB),ranlib) "$$main"' ;; \ + esac \ + ) > makelib + chmod 755 makelib +@@ -521,10 +491,6 @@ seek_set.o: \ + compile seek_set.c seek.h + ./compile seek_set.c + +-select.h: \ +-choose compile trysysel.c select.h1 select.h2 +- ./choose c trysysel select.h1 select.h2 > select.h +- + setup: \ + it install + ./install +@@ -791,10 +757,6 @@ uint32_unpack.o: \ + compile uint32_unpack.c uint32.h + ./compile uint32_unpack.c + +-uint64.h: \ +-choose compile load tryulong64.c uint64.h1 uint64.h2 +- ./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h +- + unix.a: \ + makelib alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o buffer_2.o \ + buffer_copy.o buffer_get.o buffer_put.o env.o error.o error_str.o \ +--- /dev/null ++++ b/auto_home.c +@@ -0,0 +1,3 @@ ++const char auto_home[] = "\ ++\057\165\163\162\ ++"; +--- a/conf-cc ++++ b/conf-cc +@@ -1,3 +1,3 @@ +-gcc -O2 ++$TARGET_CC $TARGET_CFLAGS -include errno.h + + This will be used to compile .c files. +--- a/conf-home ++++ b/conf-home +@@ -1,4 +1,4 @@ +-/usr/local ++/usr + + This is the ucspi-tcp home directory. Programs will be installed in + .../bin. +--- a/conf-ld ++++ b/conf-ld +@@ -1,3 +1,3 @@ +-gcc -s ++$TARGET_CC -s $TARGET_LDFLAGS + + This will be used to link .o files into an executable. +--- /dev/null ++++ b/fork.h +@@ -0,0 +1,9 @@ ++#ifndef FORK_H ++#define FORK_H ++ ++/* sysdep: +vfork */ ++ ++extern int fork(); ++extern int vfork(); ++ ++#endif +--- /dev/null ++++ b/hassgact.h +@@ -0,0 +1,2 @@ ++/* sysdep: +sigaction */ ++#define HASSIGACTION 1 +--- /dev/null ++++ b/hassgprm.h +@@ -0,0 +1,2 @@ ++/* sysdep: +sigprocmask */ ++#define HASSIGPROCMASK 1 +--- /dev/null ++++ b/hasshsgr.h +@@ -0,0 +1 @@ ++/* sysdep: -shortsetgroups */ +--- /dev/null ++++ b/haswaitp.h +@@ -0,0 +1,2 @@ ++/* sysdep: +waitpid */ ++#define HASWAITPID 1 +--- /dev/null ++++ b/iopause.h +@@ -0,0 +1,18 @@ ++#ifndef IOPAUSE_H ++#define IOPAUSE_H ++ ++/* sysdep: +poll */ ++#define IOPAUSE_POLL ++ ++#include ++#include ++ ++typedef struct pollfd iopause_fd; ++#define IOPAUSE_READ POLLIN ++#define IOPAUSE_WRITE POLLOUT ++ ++#include "taia.h" ++ ++extern void iopause(iopause_fd *,unsigned int,struct taia *,struct taia *); ++ ++#endif +--- /dev/null ++++ b/select.h +@@ -0,0 +1,11 @@ ++#ifndef SELECT_H ++#define SELECT_H ++ ++/* sysdep: +sysselect */ ++ ++#include ++#include ++#include ++extern int select(); ++ ++#endif +--- /dev/null ++++ b/uint64.h +@@ -0,0 +1,8 @@ ++#ifndef UINT64_H ++#define UINT64_H ++ ++/* sysdep: -ulong64 */ ++ ++typedef unsigned long long uint64; ++ ++#endif diff --git a/net/udp-broadcast-relay/Makefile b/net/udp-broadcast-relay/Makefile new file mode 100644 index 0000000..9fcdd6c --- /dev/null +++ b/net/udp-broadcast-relay/Makefile @@ -0,0 +1,48 @@ +# +# 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:=udp-broadcast-relay +PKG_VERSION:=0.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.joachim-breitner.de/udp-broadcast-relay/files/ +PKG_MD5SUM:=a32f983b7063d6ac670e6b22be9b9d24 + +include $(INCLUDE_DIR)/package.mk + +define Package/udp-broadcast-relay + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE:=listens for packets on a specified UDP broadcast port + URL:=http://www.joachim-breitner.de/udp-broadcast-relay/ +endef + +define Package/udp-broadcast-relay/description + This program listens for packets on a specified UDP broadcast port. + When a packet is received, it sends that packet to all specified interfaces but + the one it came from as though it originated from the original sender. + The primary purpose of this is to allow games on machines on separated + local networks (Ethernet, WLAN) that use udp broadcasts to find each other to do so. + It also works on ppp links, so you can log in from windows boxes (e.g. using pptp) + and play LAN-based games together. Currently, you have to care about upcoming or + downgoing interfaces yourself. +endef + +define Build/Compile + $(TARGET_CC) $(PKG_BUILD_DIR)/main.c -o $(PKG_BUILD_DIR)/$(PKG_NAME) +endef + +define Package/udp-broadcast-relay/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,udp-broadcast-relay)) diff --git a/net/udpcast/Makefile b/net/udpcast/Makefile new file mode 100644 index 0000000..5ad15c9 --- /dev/null +++ b/net/udpcast/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2011 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:=udpcast +PKG_RELEASE:=1 +PKG_VERSION:=20100130 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://udpcast.linux.lu/download/ +PKG_MD5SUM:=f9ad942dfe3ecbd2da5d91479957e5a9 + +include $(INCLUDE_DIR)/package.mk + +define Package/udpcast + SECTION:=net + CATEGORY:=Network + TITLE:=UDP Cast + URL:=http://udpcast.linux.lu/ + DEPENDS:=+libpthread +endef + +define Package/udpcast/description + UDPcast is a file transfer tool that can send data simultaneously to many destinations on a LAN. +endef + +define Package/udpcast/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) \ + $(PKG_BUILD_DIR)/udp-receiver \ + $(1)/usr/sbin/ + $(INSTALL_BIN) \ + $(PKG_BUILD_DIR)/udp-sender \ + $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,udpcast)) diff --git a/net/udpxy/Makefile b/net/udpxy/Makefile new file mode 100644 index 0000000..71e1332 --- /dev/null +++ b/net/udpxy/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2006-2011 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:=udpxy +PKG_REV:=1.0.21 +PKG_TAG:=2 +PKG_VERSION:=$(PKG_REV)-$(PKG_TAG) +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME).$(PKG_REV)-$(patsubst %,%-prod,$(PKG_TAG)).tgz +PKG_SOURCE_URL:=@SF/udpxy +PKG_MD5SUM:=d969fc34604b3abcc8ef62510967f2b0 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/udpxy + SECTION:=net + CATEGORY:=Network + TITLE:=convert UDP IPTV streams into http stream + URL:=http://sourceforge.net/projects/udpxy +endef + +define Package/udpxy/description + udproxy makes it possible to convert UDP IPTV streams into http + streams which can be viewed even over wlans. http streams do + not generate huge amounts of multicast traffic, so a sd stream + only takes about 300k. interesting for peoply who have IPTV at + home and do not want to rent multiple decoders from their + provider but just use their own streaming client for example + popcornhour/mediatomb/vlc/etc. +endef + +MAKE_FLAGS += \ + INSTALLROOT="$(PKG_INSTALL_DIR)/usr" + +define Package/udpxy/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/udpxy.init $(1)/etc/init.d/udpxy + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/udpxy $(1)/usr/bin/ + ln -sf udpxy $(1)/usr/bin/udpxrec +endef + +$(eval $(call BuildPackage,udpxy)) diff --git a/net/udpxy/files/udpxy.init b/net/udpxy/files/udpxy.init new file mode 100644 index 0000000..41d7481 --- /dev/null +++ b/net/udpxy/files/udpxy.init @@ -0,0 +1,27 @@ +#!/bin/sh /etc/rc.common + +# To open multicast traffic, add the following rule at the end of +# /etc/config/firewall file: +# +# config 'rule' +# option 'target' 'ACCEPT' +# option '_name' 'multicast' +# option 'src' 'wan' +# option 'proto' 'all' +# option 'dest_ip' '224.0.0.0/4' + +START=99 +STOP=10 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +OPTIONS="-T -S -p 4022" + +start() { + service_start /usr/bin/udpxy $OPTIONS +} + +stop() { + service_stop /usr/bin/udpxy +} diff --git a/net/uftp/Makefile b/net/uftp/Makefile new file mode 100644 index 0000000..290b5d5 --- /dev/null +++ b/net/uftp/Makefile @@ -0,0 +1,163 @@ +# +# Copyright (C) 2011-2012 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:=uftp +PKG_VERSION:=3.6.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar +PKG_SOURCE_URL:=https://www.tcnj.edu/~bush/downloads +PKG_MD5SUM:=7a0d41a728cd9e36ad396d7c2adeed5c + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/uftp/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=File Transfer + TITLE:=Multicast UDP FTP + URL:=https://www.tcnj.edu/~bush/uftp.html +endef + +define Package/uftp/Default/description + UFTP is an encrypted multicast file transfer program, designed to securely, + reliably, and efficiently transfer files to multiple receivers + simultaneously. +endef + +define Package/uftp + $(call Package/uftp/Default) + TITLE+= server with TLS support + VARIANT:=tls + DEPENDS:=+libopenssl +endef + +define Package/uftp/description + $(call Package/uftp/Default/description) + This package contains the server built with TLS support. +endef + +define Package/uftp-notls + $(call Package/uftp/Default) + TITLE+= server without TLS support + VARIANT:=notls +endef + +define Package/uftp-notls/description + $(call Package/uftp/Default/description) + This package contains the server built without TLS support. +endef + +define Package/uftpd + $(call Package/uftp/Default) + TITLE+= client daemon with TLS support + VARIANT:=tls + DEPENDS:=+libopenssl +endef + +define Package/uftpd/description + $(call Package/uftp/Default/description) + This package contains the client daemon built with TLS support. +endef + +define Package/uftpd-notls + $(call Package/uftp/Default) + TITLE+= client daemon without TLS support + VARIANT:=notls +endef + +define Package/uftpd-notls/description + $(call Package/uftp/Default/description) + This package contains the client daemon built without TLS support. +endef + +define Package/uftpproxyd + $(call Package/uftp/Default) + TITLE+= proxy daemon with TLS support + VARIANT:=tls + DEPENDS:=+libopenssl +endef + +define Package/uftpproxyd/description + $(call Package/uftp/Default/description) + This package contains the proxy daemon built with TLS support. +endef + +define Package/uftpproxyd-notls + $(call Package/uftp/Default) + TITLE+= proxy daemon without TLS support + VARIANT:=notls +endef + +define Package/uftpproxyd-notls/description + $(call Package/uftp/Default/description) + This package contains the proxy daemon built without TLS support. +endef + +define Package/uftp-keymgt + $(call Package/uftp/Default) + TITLE+= key management utility + VARIANT:=tls + DEPENDS:=+libopenssl +endef + +define Package/uftp-keymgt/description + $(call Package/uftp/Default/description) + This package contains the key management utility. +endef + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + UNAME_S="Linux" + +ifeq ($(BUILD_VARIANT),tls) + MAKE_FLAGS += \ + OPENSSL="$(STAGING_DIR)/usr" +endif + +ifeq ($(BUILD_VARIANT),notls) + MAKE_FLAGS += \ + NO_ENCRYPTION="1" +endif + +define Package/uftp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/uftp $(1)/usr/bin/ +endef + +define Package/uftpd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/uftpd $(1)/usr/sbin/ +endef + +define Package/uftpproxyd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/uftpproxyd $(1)/usr/sbin/ +endef + +Package/uftp-notls/install=$(Package/uftp/install) +Package/uftpd-notls/install=$(Package/uftpd/install) +Package/uftpproxyd-notls/install=$(Package/uftpproxyd/install) + +define Package/uftp-keymgt/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/uftp_keymgt $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,uftp)) +$(eval $(call BuildPackage,uftp-notls)) +$(eval $(call BuildPackage,uftpd)) +$(eval $(call BuildPackage,uftpd-notls)) +$(eval $(call BuildPackage,uftpproxyd)) +$(eval $(call BuildPackage,uftpproxyd-notls)) +$(eval $(call BuildPackage,uftp-keymgt)) diff --git a/net/uhub/Makefile b/net/uhub/Makefile new file mode 100644 index 0000000..9b5bcb0 --- /dev/null +++ b/net/uhub/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2009-2012 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:=uhub +PKG_VERSION:=0.2.8 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.gz +PKG_SOURCE_URL:=http://www.extatic.org/downloads/uhub/ +PKG_MD5SUM:=45d35d9757bc0a84297dec51520f725b + +include $(INCLUDE_DIR)/package.mk + +define Package/uhub + SUBMENU:=P2P + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libevent + TITLE:=High performance ADC hub + URL:=http://www.extatic.org/uhub/ +endef + +define Package/uhub/description + uhub is a high performance peer-to-peer hub for the ADC network. + Its low memory footprint allows it to handle several thousand users + on high-end servers, or a small private hub on embedded hardware. +endef + +TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/libevent +TARGET_LDFLAGS = -L$(STAGING_DIR)/usr/lib/libevent -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib + +ifdef CONFIG_USE_EGLIBC +TARGET_LDFLAGS += -lrt +endif + +define Package/uhub/install + $(INSTALL_DIR) $(1)/usr/local/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhub $(1)/usr/local/bin/ + $(INSTALL_DIR) $(1)/etc/uhub/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/uhub.conf $(1)/etc/uhub/ +endef + +define Package/uhub/conffiles +/etc/uhub/uhub.conf +endef + +$(eval $(call BuildPackage,uhub)) diff --git a/net/uhub/patches/100-user_struct.patch b/net/uhub/patches/100-user_struct.patch new file mode 100644 index 0000000..62fb992 --- /dev/null +++ b/net/uhub/patches/100-user_struct.patch @@ -0,0 +1,1664 @@ +--- a/src/auth.c ++++ b/src/auth.c +@@ -70,7 +70,7 @@ + { + char* data; + char* data_extra; +- struct user_access_info* info = 0; ++ struct uhub_user_access_info* info = 0; + + if (!strncmp(line, cmd, strlen(cmd))) + { +@@ -86,7 +86,7 @@ + return -1; + } + +- info = hub_malloc_zero(sizeof(struct user_access_info)); ++ info = hub_malloc_zero(sizeof(struct uhub_user_access_info)); + + if (!info) + { +@@ -340,7 +340,7 @@ + + static void acl_free_access_info(void* ptr) + { +- struct user_access_info* info = (struct user_access_info*) ptr; ++ struct uhub_user_access_info* info = (struct uhub_user_access_info*) ptr; + if (info) + { + hub_free(info->username); +@@ -404,16 +404,16 @@ + } + + +-struct user_access_info* acl_get_access_info(struct acl_handle* handle, const char* name) ++struct uhub_user_access_info* acl_get_access_info(struct acl_handle* handle, const char* name) + { +- struct user_access_info* info = (struct user_access_info*) list_get_first(handle->users); ++ struct uhub_user_access_info* info = (struct uhub_user_access_info*) list_get_first(handle->users); + while (info) + { + if (strcasecmp(info->username, name) == 0) + { + return info; + } +- info = (struct user_access_info*) list_get_next(handle->users); ++ info = (struct uhub_user_access_info*) list_get_next(handle->users); + } + return NULL; + } +@@ -492,7 +492,7 @@ + * seconds since the unix epoch (modulus 1 million) + * and the SID of the user (0-1 million). + */ +-const char* password_generate_challenge(struct user* user) ++const char* password_generate_challenge(struct uhub_user* user) + { + char buf[32]; + uint64_t tiger_res[3]; +@@ -511,10 +511,10 @@ + } + + +-int password_verify(struct user* user, const char* password) ++int password_verify(struct uhub_user* user, const char* password) + { + char buf[1024]; +- struct user_access_info* access; ++ struct uhub_user_access_info* access; + const char* challenge; + char raw_challenge[64]; + char password_calc[64]; +--- a/src/auth.h ++++ b/src/auth.h +@@ -21,7 +21,7 @@ + #define HAVE_UHUB_ACL_H + + struct hub_config; +-struct user; ++struct uhub_user; + struct ip_addr_encap; + + enum password_status +@@ -50,7 +50,7 @@ + + const char* get_user_credential_string(enum user_credentials cred); + +-struct user_access_info ++struct uhub_user_access_info + { + char* username; /* name of user, cid or IP range */ + char* password; /* password */ +@@ -77,7 +77,7 @@ + extern int acl_initialize(struct hub_config* config, struct acl_handle* handle); + extern int acl_shutdown(struct acl_handle* handle); + +-extern struct user_access_info* acl_get_access_info(struct acl_handle* handle, const char* name); ++extern struct uhub_user_access_info* acl_get_access_info(struct acl_handle* handle, const char* name); + extern int acl_is_cid_banned(struct acl_handle* handle, const char* cid); + extern int acl_is_ip_banned(struct acl_handle* handle, const char* ip_address); + extern int acl_is_ip_nat_override(struct acl_handle* handle, const char* ip_address); +@@ -87,7 +87,7 @@ + + extern int acl_check_ip_range(struct ip_addr_encap* addr, struct ip_ban_record* info); + +-extern const char* password_generate_challenge(struct user* user); +-extern int password_verify(struct user* user, const char* password); ++extern const char* password_generate_challenge(struct uhub_user* user); ++extern int password_verify(struct uhub_user* user, const char* password); + + #endif /* HAVE_UHUB_ACL_H */ +--- a/src/commands.c ++++ b/src/commands.c +@@ -19,7 +19,7 @@ + + #include "uhub.h" + +-typedef int (*command_handler)(struct user* user, const char* message); ++typedef int (*command_handler)(struct uhub_user* user, const char* message); + + struct commands_handler + { +@@ -32,7 +32,7 @@ + + static struct commands_handler command_handlers[]; + +-static void send_message(struct user* user, const char* message) ++static void send_message(struct uhub_user* user, const char* message) + { + char* buffer = adc_msg_escape(message); + struct adc_message* command = adc_msg_construct(ADC_CMD_IMSG, strlen(buffer) + 6); +@@ -42,7 +42,7 @@ + hub_free(buffer); + } + +-static int command_access_denied(struct user* user, const char* command) ++static int command_access_denied(struct uhub_user* user, const char* command) + { + char temp[64]; + snprintf(temp, 64, "*** Access denied: \"%s\"", command); +@@ -51,7 +51,7 @@ + } + + +-static int command_stats(struct user* user, const char* message) ++static int command_stats(struct uhub_user* user, const char* message) + { + char temp[128]; + snprintf(temp, 128, "*** Stats: %zu users, peak: %zu. Network (up/down): %d/%d KB/s, peak: %d/%d KB/s", +@@ -67,7 +67,7 @@ + } + + +-static int command_help(struct user* user, const char* message) ++static int command_help(struct uhub_user* user, const char* message) + { + #define MAX_HELP_MSG 1024 + size_t n; +@@ -89,7 +89,7 @@ + return 0; + } + +-static int command_uptime(struct user* user, const char* message) ++static int command_uptime(struct uhub_user* user, const char* message) + { + char tmp[128]; + size_t d; +@@ -124,20 +124,20 @@ + return 0; + } + +-static int command_kick(struct user* user, const char* message) ++static int command_kick(struct uhub_user* user, const char* message) + { + send_message(user, "*** Kick not implemented!"); + return 0; + } + +-static int command_reload(struct user* user, const char* message) ++static int command_reload(struct uhub_user* user, const char* message) + { + send_message(user, "*** Reloading configuration"); + user->hub->status = hub_status_restart; + return 0; + } + +-static int command_shutdown(struct user* user, const char* message) ++static int command_shutdown(struct uhub_user* user, const char* message) + { + send_message(user, "*** Hub shuting down..."); + user->hub->status = hub_status_shutdown; +@@ -145,13 +145,13 @@ + } + + +-static int command_version(struct user* user, const char* message) ++static int command_version(struct uhub_user* user, const char* message) + { + send_message(user, "*** Powered by " PRODUCT "/" VERSION); + return 0; + } + +-static int command_myip(struct user* user, const char* message) ++static int command_myip(struct uhub_user* user, const char* message) + { + char tmp[128]; + snprintf(tmp, 128, "*** Your IP: %s", ip_convert_to_string(&user->ipaddr)); +@@ -159,7 +159,7 @@ + return 0; + } + +-int command_dipatcher(struct user* user, const char* message) ++int command_dipatcher(struct uhub_user* user, const char* message) + { + size_t n = 0; + for (n = 0; command_handlers[n].prefix; n++) +--- a/src/commands.h ++++ b/src/commands.h +@@ -23,7 +23,7 @@ + #define CHAT_MSG_IGNORED 0 + #define CHAT_MSG_INVALID -1 + +-typedef int (*plugin_event_chat_message)(struct hub_info*, struct user*, struct adc_message*); ++typedef int (*plugin_event_chat_message)(struct hub_info*, struct uhub_user*, struct adc_message*); + + struct command_info + { +@@ -32,4 +32,4 @@ + plugin_event_chat_message function; + }; + +-int command_dipatcher(struct user* user, const char* message); ++int command_dipatcher(struct uhub_user* user, const char* message); +--- a/src/hub.c ++++ b/src/hub.c +@@ -19,7 +19,7 @@ + + #include "uhub.h" + +-int hub_handle_message(struct user* u, const char* line, size_t length) ++int hub_handle_message(struct uhub_user* u, const char* line, size_t length) + { + int ret = 0; + struct adc_message* cmd = 0; +@@ -96,7 +96,7 @@ + } + + +-int hub_handle_support(struct user* u, struct adc_message* cmd) ++int hub_handle_support(struct uhub_user* u, struct adc_message* cmd) + { + int ret = 0; + int index = 0; +@@ -161,7 +161,7 @@ + } + + +-int hub_handle_password(struct user* u, struct adc_message* cmd) ++int hub_handle_password(struct uhub_user* u, struct adc_message* cmd) + { + char* password = adc_msg_get_argument(cmd, 0); + int ret = 0; +@@ -184,7 +184,7 @@ + } + + +-int hub_handle_chat_message(struct user* u, struct adc_message* cmd) ++int hub_handle_chat_message(struct uhub_user* u, struct adc_message* cmd) + { + char* message = adc_msg_get_argument(cmd, 0); + int ret = 0; +@@ -206,14 +206,14 @@ + return ret; + } + +-int on_kick(struct user* u, struct adc_message* cmd) ++int on_kick(struct uhub_user* u, struct adc_message* cmd) + { + hub_log(log_error, "on_kick() not implemented"); + return -1; + } + + #ifdef ADC_UDP_OPERATION +-int hub_handle_autocheck(struct user* u, struct adc_message* cmd) ++int hub_handle_autocheck(struct uhub_user* u, struct adc_message* cmd) + { + char* port_str = adc_msg_get_argument(cmd, 0); + char* token = adc_msg_get_argument(cmd, 1); +@@ -245,13 +245,13 @@ + #endif + + +-void hub_send_autocheck(struct user* u, uint16_t port, const char* token) ++void hub_send_autocheck(struct uhub_user* u, uint16_t port, const char* token) + { + + } + + +-void hub_send_support(struct user* u) ++void hub_send_support(struct uhub_user* u) + { + if (user_is_connecting(u) || user_is_logged_in(u)) + { +@@ -260,7 +260,7 @@ + } + + +-void hub_send_sid(struct user* u) ++void hub_send_sid(struct uhub_user* u) + { + struct adc_message* command; + if (user_is_connecting(u)) +@@ -274,7 +274,7 @@ + } + + +-void hub_send_ping(struct user* user) ++void hub_send_ping(struct uhub_user* user) + { + /* This will just send a newline, despite appearing to do more below. */ + struct adc_message* ping = adc_msg_construct(0, 0); +@@ -287,7 +287,7 @@ + } + + +-void hub_send_hubinfo(struct user* u) ++void hub_send_hubinfo(struct uhub_user* u) + { + struct adc_message* info = adc_msg_copy(u->hub->command_info); + int value = 0; +@@ -356,7 +356,7 @@ + } + + +-void hub_send_handshake(struct user* u) ++void hub_send_handshake(struct uhub_user* u) + { + hub_send_support(u); + hub_send_sid(u); +@@ -369,7 +369,7 @@ + } + + +-void hub_send_motd(struct user* u) ++void hub_send_motd(struct uhub_user* u) + { + if (u->hub->command_motd) + { +@@ -378,7 +378,7 @@ + } + + +-void hub_send_password_challenge(struct user* u) ++void hub_send_password_challenge(struct uhub_user* u) + { + struct adc_message* igpa; + igpa = adc_msg_construct(ADC_CMD_IGPA, 38); +@@ -399,33 +399,33 @@ + { + case UHUB_EVENT_USER_JOIN: + { +- if (user_is_disconnecting((struct user*) message->ptr)) ++ if (user_is_disconnecting((struct uhub_user*) message->ptr)) + break; + + if (message->flags) + { +- hub_send_password_challenge((struct user*) message->ptr); ++ hub_send_password_challenge((struct uhub_user*) message->ptr); + } + else + { +- on_login_success((struct user*) message->ptr); ++ on_login_success((struct uhub_user*) message->ptr); + } + break; + } + + case UHUB_EVENT_USER_QUIT: + { +- user_manager_remove((struct user*) message->ptr); +- send_quit_message((struct user*) message->ptr); +- on_logout_user((struct user*) message->ptr); +- user_schedule_destroy((struct user*) message->ptr); ++ user_manager_remove((struct uhub_user*) message->ptr); ++ send_quit_message((struct uhub_user*) message->ptr); ++ on_logout_user((struct uhub_user*) message->ptr); ++ user_schedule_destroy((struct uhub_user*) message->ptr); + break; + } + + case UHUB_EVENT_USER_DESTROY: + { + hub_log(log_trace, "hub_event_dispatcher: UHUB_EVENT_USER_DESTROY (ptr=%p)", message->ptr); +- user_destroy((struct user*) message->ptr); ++ user_destroy((struct uhub_user*) message->ptr); + break; + } + +@@ -757,7 +757,7 @@ + */ + static inline int is_nick_in_use(struct hub_info* hub, const char* nick) + { +- struct user* lookup = get_user_by_nick(hub, nick); ++ struct uhub_user* lookup = get_user_by_nick(hub, nick); + if (lookup) + { + return 1; +@@ -771,7 +771,7 @@ + */ + static inline int is_cid_in_use(struct hub_info* hub, const char* cid) + { +- struct user* lookup = get_user_by_cid(hub, cid); ++ struct uhub_user* lookup = get_user_by_cid(hub, cid); + if (lookup) + { + return 1; +@@ -796,7 +796,7 @@ + * @param msg See enum status_message + * @param level See enum status_level + */ +-void hub_send_status(struct user* user, enum status_message msg, enum msg_status_level level) ++void hub_send_status(struct uhub_user* user, enum status_message msg, enum msg_status_level level) + { + struct hub_config* cfg = user->hub->config; + struct adc_message* cmd = adc_msg_construct(ADC_CMD_ISTA, 6); +--- a/src/hubevent.c ++++ b/src/hubevent.c +@@ -19,27 +19,27 @@ + + #include "uhub.h" + +-static void log_user_login(struct user* u) ++static void log_user_login(struct uhub_user* u) + { + const char* cred = get_user_credential_string(u->credentials); + const char* addr = ip_convert_to_string(&u->ipaddr); + hub_log(log_user, "LoginOK %s/%s %s \"%s\" (%s) \"%s\"", sid_to_string(u->id.sid), u->id.cid, addr, u->id.nick, cred, u->user_agent); + } + +-static void log_user_login_error(struct user* u, enum status_message msg) ++static void log_user_login_error(struct uhub_user* u, enum status_message msg) + { + const char* addr = ip_convert_to_string(&u->ipaddr); + const char* message = hub_get_status_message_log(u->hub, msg); + hub_log(log_user, "LoginError %s/%s %s \"%s\" (%s) \"%s\"", sid_to_string(u->id.sid), u->id.cid, addr, u->id.nick, message, u->user_agent); + } + +-static void log_user_logout(struct user* u, const char* message) ++static void log_user_logout(struct uhub_user* u, const char* message) + { + const char* addr = ip_convert_to_string(&u->ipaddr); + hub_log(log_user, "Logout %s/%s %s \"%s\" (%s)", sid_to_string(u->id.sid), u->id.cid, addr, u->id.nick, message); + } + +-static void log_user_nick_change(struct user* u, const char* nick) ++static void log_user_nick_change(struct uhub_user* u, const char* nick) + { + const char* addr = ip_convert_to_string(&u->ipaddr); + hub_log(log_user, "NickChange %s/%s %s \"%s\" -> \"%s\"", sid_to_string(u->id.sid), u->id.cid, addr, u->id.nick, nick); +@@ -47,7 +47,7 @@ + + + /* Send MOTD, do logging etc */ +-void on_login_success(struct user* u) ++void on_login_success(struct uhub_user* u) + { + struct timeval timeout = { TIMEOUT_IDLE, 0 }; + +@@ -75,14 +75,14 @@ + event_add(u->ev_read, &timeout); + } + +-void on_login_failure(struct user* u, enum status_message msg) ++void on_login_failure(struct uhub_user* u, enum status_message msg) + { + log_user_login_error(u, msg); + hub_send_status(u, msg, status_level_fatal); + user_disconnect(u, quit_logon_error); + } + +-void on_nick_change(struct user* u, const char* nick) ++void on_nick_change(struct uhub_user* u, const char* nick) + { + if (user_is_logged_in(u)) + { +@@ -90,7 +90,7 @@ + } + } + +-void on_logout_user(struct user* user) ++void on_logout_user(struct uhub_user* user) + { + const char* reason = ""; + +--- a/src/hubevent.h ++++ b/src/hubevent.h +@@ -23,22 +23,22 @@ + /** + * This event is triggered whenever a user successfully logs in to the hub. + */ +-extern void on_login_success(struct user* u); ++extern void on_login_success(struct uhub_user* u); + + /** + * This event is triggered whenever a user failed to log in to the hub. + */ +-extern void on_login_failure(struct user* u, enum status_message msg); ++extern void on_login_failure(struct uhub_user* u, enum status_message msg); + + /** + * This event is triggered whenever a previously logged in user leaves the hub. + */ +-extern void on_logout_user(struct user* u); ++extern void on_logout_user(struct uhub_user* u); + + /** + * This event is triggered whenever a user changes his/her nickname. + */ +-extern void on_nick_change(struct user* u, const char* nick); ++extern void on_nick_change(struct uhub_user* u, const char* nick); + + + #endif /* HAVE_UHUB_HUB_EVENT_H */ +--- a/src/hub.h ++++ b/src/hub.h +@@ -94,7 +94,7 @@ + struct event_queue* queue; + struct event_base* evbase; + struct hub_config* config; +- struct user_manager* users; ++ struct uhub_user_manager* users; + struct acl_handle* acl; + struct adc_message* command_info; /* The hub's INF command */ + struct adc_message* command_support; /* The hub's SUP command */ +@@ -116,103 +116,103 @@ + * + * @return 0 on success, -1 on error + */ +-extern int hub_handle_message(struct user* u, const char* message, size_t length); ++extern int hub_handle_message(struct uhub_user* u, const char* message, size_t length); + + /** + * Handle protocol support/subscription messages received clients. + * + * @return 0 on success, -1 on error + */ +-extern int hub_handle_support(struct user* u, struct adc_message* cmd); ++extern int hub_handle_support(struct uhub_user* u, struct adc_message* cmd); + + /** + * Handle password messages received from clients. + * + * @return 0 on success, -1 on error + */ +-extern int hub_handle_password(struct user* u, struct adc_message* cmd); ++extern int hub_handle_password(struct uhub_user* u, struct adc_message* cmd); + + /** + * Handle chat messages received from clients. + * @return 0 on success, -1 on error. + */ +-extern int hub_handle_chat_message(struct user* u, struct adc_message* cmd); ++extern int hub_handle_chat_message(struct uhub_user* u, struct adc_message* cmd); + + /** + * Used internally by hub_handle_info + * @return 1 if nickname is OK, or 0 if nickname is not accepted. + */ +-extern int hub_handle_info_check_nick(struct user* u, struct adc_message* cmd); ++extern int hub_handle_info_check_nick(struct uhub_user* u, struct adc_message* cmd); + + /** + * Used internally by hub_handle_info + * @return 1 if CID/PID is OK, or 0 if not valid. + */ +-extern int hub_handle_info_check_cid(struct user* u, struct adc_message* cmd); ++extern int hub_handle_info_check_cid(struct uhub_user* u, struct adc_message* cmd); + + /** + * Can only be used by administrators or operators. + * + * @return 0 on success, -1 on error + */ +-extern int hub_handle_kick(struct user* u, struct adc_message* cmd); ++extern int hub_handle_kick(struct uhub_user* u, struct adc_message* cmd); + + #ifdef ADC_UDP_OPERATION + /** + * Handle incoming autocheck message. + */ +-extern int hub_handle_autocheck(struct user* u, struct adc_message* cmd); ++extern int hub_handle_autocheck(struct uhub_user* u, struct adc_message* cmd); + #endif + + /** + * Send the support line for the hub to a particular user. + * Only used during the initial handshake. + */ +-extern void hub_send_support(struct user* u); ++extern void hub_send_support(struct uhub_user* u); + + /** + * Send a message assigning a SID for a user. + * This is only sent after hub_send_support() during initial handshake. + */ +-extern void hub_send_sid(struct user* u); ++extern void hub_send_sid(struct uhub_user* u); + + /** + * Send a 'ping' message to user. + */ +-extern void hub_send_ping(struct user* user); ++extern void hub_send_ping(struct uhub_user* user); + + /** + * Send a message containing hub information to a particular user. + * This is sent during user connection, but can safely be sent at any + * point later. + */ +-extern void hub_send_hubinfo(struct user* u); ++extern void hub_send_hubinfo(struct uhub_user* u); + + /** + * Send handshake. This basically calls + * hub_send_support() and hub_send_sid() + */ +-extern void hub_send_handshake(struct user* u); ++extern void hub_send_handshake(struct uhub_user* u); + + /** + * Send a welcome message containing the message of the day to + * one particular user. This can be sent in any point in time. + */ +-extern void hub_send_motd(struct user* u); ++extern void hub_send_motd(struct uhub_user* u); + + /** + * Send a password challenge to a user. + * This is only used if the user tries to access the hub using a + * password protected nick name. + */ +-extern void hub_send_password_challenge(struct user* u); ++extern void hub_send_password_challenge(struct uhub_user* u); + + /** + * Send an autocheck message to a user. + * This is basically a UDP message. The user's client can then determine + * if UDP communication works by either hole punching or configuring UPnP. + */ +-extern void hub_send_autocheck(struct user* u, uint16_t port, const char* token); ++extern void hub_send_autocheck(struct uhub_user* u, uint16_t port, const char* token); + + /** + * This starts the hub. +@@ -244,7 +244,7 @@ + /** + * Sends a status_message to a user. + */ +-extern void hub_send_status(struct user* user, enum status_message msg, enum msg_status_level level); ++extern void hub_send_status(struct uhub_user* user, enum status_message msg, enum msg_status_level level); + + /** + * Returns the number of logged in users on the hub. +--- a/src/inf.c ++++ b/src/inf.c +@@ -39,9 +39,9 @@ + adc_msg_remove_named_argument(cmd, ADC_INF_FLAG_REFERER); + } + +-static int user_is_protected(struct user* user); ++static int user_is_protected(struct uhub_user* user); + +-static int set_feature_cast_supports(struct user* u, struct adc_message* cmd) ++static int set_feature_cast_supports(struct uhub_user* u, struct adc_message* cmd) + { + char *it, *tmp; + +@@ -89,7 +89,7 @@ + /* + * FIXME: Only works for tiger hash. If a client doesnt support tiger we cannot let it in! + */ +-static int check_cid(struct user* user, struct adc_message* cmd) ++static int check_cid(struct uhub_user* user, struct adc_message* cmd) + { + size_t pos; + char* cid = adc_msg_get_named_argument(cmd, ADC_INF_FLAG_CLIENT_ID); +@@ -150,7 +150,7 @@ + } + + +-static int check_required_login_flags(struct user* user, struct adc_message* cmd) ++static int check_required_login_flags(struct uhub_user* user, struct adc_message* cmd) + { + int num = 0; + +@@ -186,7 +186,7 @@ + * remove any wrong address, and replace it with the correct one + * as seen by the hub. + */ +-int check_network(struct user* user, struct adc_message* cmd) ++int check_network(struct uhub_user* user, struct adc_message* cmd) + { + const char* address = ip_convert_to_string(&user->ipaddr); + +@@ -269,7 +269,7 @@ + } + + +-static int check_nick(struct user* user, struct adc_message* cmd) ++static int check_nick(struct uhub_user* user, struct adc_message* cmd) + { + char* nick; + char* tmp; +@@ -317,10 +317,10 @@ + } + + +-static int check_logged_in(struct user* user, struct adc_message* cmd) ++static int check_logged_in(struct uhub_user* user, struct adc_message* cmd) + { +- struct user* lookup1 = get_user_by_nick(user->hub, user->id.nick); +- struct user* lookup2 = get_user_by_cid(user->hub, user->id.cid); ++ struct uhub_user* lookup1 = get_user_by_nick(user->hub, user->id.nick); ++ struct uhub_user* lookup2 = get_user_by_cid(user->hub, user->id.cid); + + if (lookup1 == user) + { +@@ -358,7 +358,7 @@ + * But this is not something we want to do, and is deprecated in the ADC specification. + * One should rather look at capabilities/features. + */ +-static int check_user_agent(struct user* user, struct adc_message* cmd) ++static int check_user_agent(struct uhub_user* user, struct adc_message* cmd) + { + char* ua_encoded = 0; + char* ua = 0; +@@ -379,7 +379,7 @@ + } + + +-static int check_acl(struct user* user, struct adc_message* cmd) ++static int check_acl(struct uhub_user* user, struct adc_message* cmd) + { + if (acl_is_cid_banned(user->hub->acl, user->id.cid)) + { +@@ -399,7 +399,7 @@ + return 0; + } + +-static int check_limits(struct user* user, struct adc_message* cmd) ++static int check_limits(struct uhub_user* user, struct adc_message* cmd) + { + char* arg = adc_msg_get_named_argument(cmd, ADC_INF_FLAG_SHARED_SIZE); + if (arg) +@@ -525,10 +525,10 @@ + * If the hub is configured to allow only registered users and the user + * is not recognized this will return 1. + */ +-static int set_credentials(struct user* user, struct adc_message* cmd) ++static int set_credentials(struct uhub_user* user, struct adc_message* cmd) + { + int ret = 0; +- struct user_access_info* info = acl_get_access_info(user->hub->acl, user->id.nick); ++ struct uhub_user_access_info* info = acl_get_access_info(user->hub->acl, user->id.nick); + + if (info) + { +@@ -580,7 +580,7 @@ + /** + * Determines if a user is to be let into the hub even if the hub is "full". + */ +-static int user_is_protected(struct user* user) ++static int user_is_protected(struct uhub_user* user) + { + switch (user->credentials) + { +@@ -601,7 +601,7 @@ + * Only registered users will be let in if the hub is configured for registered + * users only. + */ +-static int user_is_registered(struct user* user) ++static int user_is_registered(struct uhub_user* user) + { + switch (user->credentials) + { +@@ -619,7 +619,7 @@ + } + + +-void update_user_info(struct user* u, struct adc_message* cmd) ++void update_user_info(struct uhub_user* u, struct adc_message* cmd) + { + char prefix[2]; + char* argument; +@@ -649,7 +649,7 @@ + } + + +-static int check_is_hub_full(struct user* user) ++static int check_is_hub_full(struct uhub_user* user) + { + /* + * If hub is full, don't let users in, but we still want to allow +@@ -663,7 +663,7 @@ + } + + +-static int check_registered_users_only(struct user* user) ++static int check_registered_users_only(struct uhub_user* user) + { + if (user->hub->config->registered_users_only && !user_is_registered(user)) + { +@@ -679,7 +679,7 @@ + return ret; \ + } while(0) + +-static int hub_handle_info_common(struct user* user, struct adc_message* cmd) ++static int hub_handle_info_common(struct uhub_user* user, struct adc_message* cmd) + { + /* Remove server restricted flags */ + remove_server_restricted_flags(cmd); +@@ -690,7 +690,7 @@ + return 0; + } + +-static int hub_handle_info_low_bandwidth(struct user* user, struct adc_message* cmd) ++static int hub_handle_info_low_bandwidth(struct uhub_user* user, struct adc_message* cmd) + { + if (user->hub->config->low_bandwidth_mode) + { +@@ -711,7 +711,7 @@ + return 0; + } + +-int hub_handle_info_login(struct user* user, struct adc_message* cmd) ++int hub_handle_info_login(struct uhub_user* user, struct adc_message* cmd) + { + int need_auth = 0; + +@@ -765,7 +765,7 @@ + * - CID/PID (valid, not taken, etc). + * - IP addresses (IPv4 and IPv6) + */ +-int hub_handle_info(struct user* user, const struct adc_message* cmd_unmodified) ++int hub_handle_info(struct uhub_user* user, const struct adc_message* cmd_unmodified) + { + struct adc_message* cmd = adc_msg_copy(cmd_unmodified); + if (!cmd) return -1; /* OOM */ +--- a/src/inf.h ++++ b/src/inf.h +@@ -47,7 +47,7 @@ + * + * @return 0 on success, -1 on error + */ +-extern int hub_handle_info(struct user* u, const struct adc_message* cmd); ++extern int hub_handle_info(struct uhub_user* u, const struct adc_message* cmd); + + + #endif /* HAVE_UHUB_INF_PARSER_H */ +--- a/src/message.c ++++ b/src/message.c +@@ -234,7 +234,7 @@ + } + + +-struct adc_message* adc_msg_parse_verify(struct user* u, const char* line, size_t length) ++struct adc_message* adc_msg_parse_verify(struct uhub_user* u, const char* line, size_t length) + { + struct adc_message* command = adc_msg_parse(line, length); + +--- a/src/message.h ++++ b/src/message.h +@@ -20,7 +20,7 @@ + #ifndef HAVE_UHUB_COMMAND_H + #define HAVE_UHUB_COMMAND_H + +-struct user; ++struct uhub_user; + + struct adc_message + { +@@ -70,7 +70,7 @@ + * The message is only considered valid if the user who sent it + * is the rightful origin of the message. + */ +-extern struct adc_message* adc_msg_parse_verify(struct user* u, const char* string, size_t length); ++extern struct adc_message* adc_msg_parse_verify(struct uhub_user* u, const char* string, size_t length); + + /** + * This will parse 'string' and return it as a adc_message struct, or +--- a/src/netevent.c ++++ b/src/netevent.c +@@ -23,7 +23,7 @@ + void net_on_read(int fd, short ev, void *arg) + { + static char buf[MAX_RECV_BUF]; +- struct user* user = (struct user*) arg; ++ struct uhub_user* user = (struct uhub_user*) arg; + char* pos; + size_t offset; + size_t buflen; +@@ -168,7 +168,7 @@ + + void net_on_write(int fd, short ev, void *arg) + { +- struct user* user = (struct user*) arg; ++ struct uhub_user* user = (struct uhub_user*) arg; + struct adc_message* msg; + int ret; + int length; +@@ -259,7 +259,7 @@ + void net_on_accept(int server_fd, short ev, void *arg) + { + struct hub_info* hub = (struct hub_info*) arg; +- struct user* user = 0; ++ struct uhub_user* user = 0; + struct ip_addr_encap ipaddr; + const char* addr; + struct timeval timeout = { TIMEOUT_CONNECTED, 0 }; +@@ -320,7 +320,7 @@ + { + static char buffer[1024] = {0,}; + // struct hub_info* hub = (struct hub_info*) arg; +- // struct user* user = 0; ++ // struct uhub_user* user = 0; + ssize_t size; + struct sockaddr_storage from; + socklen_t fromlen; +--- a/src/plugin.h ++++ b/src/plugin.h +@@ -19,12 +19,12 @@ + + typedef void (*plugin_event_startup)(struct hub*); + typedef void (*plugin_event_shutdown)(struct hub*); +-typedef void (*plugin_event_user_login)(struct hub*, struct user*); +-typedef void (*plugin_event_user_logout)(struct hub*, struct user*); ++typedef void (*plugin_event_user_login)(struct hub*, struct uhub_user*); ++typedef void (*plugin_event_user_logout)(struct hub*, struct uhub_user*); + typedef int (*plugin_event_connect)(struct hub*, struct ip_addr_encap); +-typedef void (*plugin_event_disconnect)(struct hub*, struct user*); +-typedef int (*plugin_event_message)(struct hub*, struct user*, struct adc_message*); +-typedef void (*plugin_event_support)(struct hub*, struct user*, int); ++typedef void (*plugin_event_disconnect)(struct hub*, struct uhub_user*); ++typedef int (*plugin_event_message)(struct hub*, struct uhub_user*, struct adc_message*); ++typedef void (*plugin_event_support)(struct hub*, struct uhub_user*, int); + + struct uhub_plugin + { +--- a/src/route.c ++++ b/src/route.c +@@ -20,9 +20,9 @@ + #include "uhub.h" + + +-int route_message(struct user* u, struct adc_message* msg) ++int route_message(struct uhub_user* u, struct adc_message* msg) + { +- struct user* target = NULL; ++ struct uhub_user* target = NULL; + + switch (msg->cache[0]) + { +@@ -59,7 +59,7 @@ + } + + +-static void queue_command(struct user* user, struct adc_message* msg__, int offset) ++static void queue_command(struct uhub_user* user, struct adc_message* msg__, int offset) + { + struct adc_message* msg = adc_msg_incref(msg__); + list_append(user->send_queue, msg); +@@ -97,7 +97,7 @@ + * -1 if send queue is overflowed + * 0 if soft send queue is overflowed (not implemented at the moment) + */ +-static int check_send_queue(struct user* user, struct adc_message* msg) ++static int check_send_queue(struct uhub_user* user, struct adc_message* msg) + { + if (user_flag_get(user, flag_user_list)) + return 1; +@@ -111,7 +111,7 @@ + return 1; + } + +-int route_to_user(struct user* user, struct adc_message* msg) ++int route_to_user(struct uhub_user* user, struct adc_message* msg) + { + int ret; + +@@ -174,11 +174,11 @@ + + int route_to_all(struct hub_info* hub, struct adc_message* command) /* iterate users */ + { +- struct user* user = (struct user*) list_get_first(hub->users->list); ++ struct uhub_user* user = (struct uhub_user*) list_get_first(hub->users->list); + while (user) + { + route_to_user(user, command); +- user = (struct user*) list_get_next(hub->users->list); ++ user = (struct uhub_user*) list_get_next(hub->users->list); + } + + return 0; +@@ -190,7 +190,7 @@ + int do_send; + char* tmp; + +- struct user* user = (struct user*) list_get_first(hub->users->list); ++ struct uhub_user* user = (struct uhub_user*) list_get_first(hub->users->list); + while (user) + { + if (user->feature_cast) +@@ -209,7 +209,7 @@ + } + + if (!do_send) { +- user = (struct user*) list_get_next(hub->users->list); ++ user = (struct uhub_user*) list_get_next(hub->users->list); + continue; + } + +@@ -229,13 +229,13 @@ + route_to_user(user, command); + } + } +- user = (struct user*) list_get_next(hub->users->list); ++ user = (struct uhub_user*) list_get_next(hub->users->list); + } + + return 0; + } + +-int route_info_message(struct user* u) ++int route_info_message(struct uhub_user* u) + { + if (!user_is_nat_override(u)) + { +@@ -245,12 +245,12 @@ + { + struct adc_message* cmd = adc_msg_copy(u->info); + const char* address = ip_convert_to_string(&u->ipaddr); +- struct user* user = 0; ++ struct uhub_user* user = 0; + + adc_msg_remove_named_argument(cmd, ADC_INF_FLAG_IPV4_ADDR); + adc_msg_add_named_argument(cmd, ADC_INF_FLAG_IPV4_ADDR, address); + +- user = (struct user*) list_get_first(u->hub->users->list); ++ user = (struct uhub_user*) list_get_first(u->hub->users->list); + while (user) + { + if (user_is_nat_override(user)) +@@ -258,7 +258,7 @@ + else + route_to_user(user, u->info); + +- user = (struct user*) list_get_next(u->hub->users->list); ++ user = (struct uhub_user*) list_get_next(u->hub->users->list); + } + adc_msg_free(cmd); + } +--- a/src/route.h ++++ b/src/route.h +@@ -23,12 +23,12 @@ + /** + * Route a message by sending it to it's final destination. + */ +-extern int route_message(struct user* u, struct adc_message* msg); ++extern int route_message(struct uhub_user* u, struct adc_message* msg); + + /** + * Transmit message directly to one user. + */ +-extern int route_to_user(struct user*, struct adc_message* command); ++extern int route_to_user(struct uhub_user*, struct adc_message* command); + + /** + * Broadcast message to all users. +@@ -45,7 +45,7 @@ + * This will ensure the correct IP is seen by other users + * in case nat override is in use. + */ +-extern int route_info_message(struct user* user); ++extern int route_info_message(struct uhub_user* user); + + + #endif /* HAVE_UHUB_ROUTE_H */ +--- a/src/sid.h ++++ b/src/sid.h +@@ -28,7 +28,7 @@ + + struct sid_map + { +- struct user* ptr; ++ struct uhub_user* ptr; + struct sid_map* next; + }; + +@@ -58,7 +58,7 @@ + + + extern void sid_initialize(struct sid_pool*); +-extern sid_t sid_alloc(struct sid_pool*, struct user*); ++extern sid_t sid_alloc(struct sid_pool*, struct uhub_user*); + extern void sid_free(struct sid_pool*, sid_t); + + +--- a/src/user.c ++++ b/src/user.c +@@ -19,13 +19,13 @@ + + #include "uhub.h" + +-struct user* user_create(struct hub_info* hub, int sd) ++struct uhub_user* user_create(struct hub_info* hub, int sd) + { +- struct user* user = NULL; ++ struct uhub_user* user = NULL; + + hub_log(log_trace, "user_create(), hub=%p, sd=%d", hub, sd); + +- user = (struct user*) hub_malloc_zero(sizeof(struct user)); ++ user = (struct uhub_user*) hub_malloc_zero(sizeof(struct uhub_user)); + + if (user == NULL) + return NULL; /* OOM */ +@@ -61,7 +61,7 @@ + adc_msg_free((struct adc_message*) ptr); + } + +-void user_destroy(struct user* user) ++void user_destroy(struct uhub_user* user) + { + hub_log(log_trace, "user_destroy(), user=%p", user); + +@@ -98,7 +98,7 @@ + hub_free(user); + } + +-void user_set_state(struct user* user, enum user_state state) ++void user_set_state(struct uhub_user* user, enum user_state state) + { + if ((user->state == state_cleanup && state != state_disconnected) || (user->state == state_disconnected)) + { +@@ -109,7 +109,7 @@ + user->state = state; + } + +-void user_set_info(struct user* user, struct adc_message* cmd) ++void user_set_info(struct uhub_user* user, struct adc_message* cmd) + { + adc_msg_free(user->info); + user->info = adc_msg_incref(cmd); +@@ -156,44 +156,44 @@ + } + } + +-void user_support_add(struct user* user, int fourcc) ++void user_support_add(struct uhub_user* user, int fourcc) + { + int feature_mask = convert_support_fourcc(fourcc); + user->flags |= feature_mask; + } + +-int user_flag_get(struct user* user, enum user_flags flag) ++int user_flag_get(struct uhub_user* user, enum user_flags flag) + { + return user->flags & flag; + } + +-void user_flag_set(struct user* user, enum user_flags flag) ++void user_flag_set(struct uhub_user* user, enum user_flags flag) + { + user->flags |= flag; + } + +-void user_flag_unset(struct user* user, enum user_flags flag) ++void user_flag_unset(struct uhub_user* user, enum user_flags flag) + { + user->flags &= ~flag; + } + +-void user_set_nat_override(struct user* user) ++void user_set_nat_override(struct uhub_user* user) + { + user_flag_set(user, flag_nat); + } + +-int user_is_nat_override(struct user* user) ++int user_is_nat_override(struct uhub_user* user) + { + return user_flag_get(user, flag_nat); + } + +-void user_support_remove(struct user* user, int fourcc) ++void user_support_remove(struct uhub_user* user, int fourcc) + { + int feature_mask = convert_support_fourcc(fourcc); + user->flags &= ~feature_mask; + } + +-void user_schedule_destroy(struct user* user) ++void user_schedule_destroy(struct uhub_user* user) + { + struct event_data post; + memset(&post, 0, sizeof(post)); +@@ -202,7 +202,7 @@ + event_queue_post(user->hub->queue, &post); + } + +-void user_disconnect(struct user* user, int reason) ++void user_disconnect(struct uhub_user* user, int reason) + { + struct event_data post; + int need_notify = 0; +@@ -242,7 +242,7 @@ + + } + +-int user_have_feature_cast_support(struct user* user, char feature[4]) ++int user_have_feature_cast_support(struct uhub_user* user, char feature[4]) + { + char* tmp = list_get_first(user->feature_cast); + while (tmp) +@@ -256,7 +256,7 @@ + return 0; + } + +-int user_set_feature_cast_support(struct user* u, char feature[4]) ++int user_set_feature_cast_support(struct uhub_user* u, char feature[4]) + { + if (!u->feature_cast) + { +@@ -272,7 +272,7 @@ + return 1; + } + +-void user_clear_feature_cast_support(struct user* u) ++void user_clear_feature_cast_support(struct uhub_user* u) + { + if (u->feature_cast) + { +@@ -282,21 +282,21 @@ + } + } + +-int user_is_logged_in(struct user* user) ++int user_is_logged_in(struct uhub_user* user) + { + if (user->state == state_normal) + return 1; + return 0; + } + +-int user_is_connecting(struct user* user) ++int user_is_connecting(struct uhub_user* user) + { + if (user->state == state_protocol || user->state == state_identify || user->state == state_verify) + return 1; + return 0; + } + +-int user_is_disconnecting(struct user* user) ++int user_is_disconnecting(struct uhub_user* user) + { + if (user->state == state_cleanup || user->state == state_disconnected) + return 1; +--- a/src/user.h ++++ b/src/user.h +@@ -73,7 +73,7 @@ + }; + + +-struct user_info ++struct uhub_user_info + { + sid_t sid; /** session ID */ + char cid[MAX_CID_LEN+1]; /** global client ID */ +@@ -85,7 +85,7 @@ + * as the number of bytes and files shared, and the number of hubs the + * user is connected to, etc. + */ +-struct user_counts ++struct uhub_user_counts + { + uint64_t shared_size; /** Shared size in bytes */ + size_t shared_files; /** The number of shared files */ +@@ -96,14 +96,14 @@ + size_t hub_count_total; /** The number of hubs connected to in total */ + }; + +-struct user ++struct uhub_user + { + int sd; /** socket descriptor */ + struct event* ev_read; /** libevent struct for read events */ + struct event* ev_write; /** libevent struct for write events */ + enum user_state state; /** see enum user_state */ + enum user_credentials credentials; /** see enum user_credentials */ +- struct user_info id; /** Contains nick name and CID */ ++ struct uhub_user_info id; /** Contains nick name and CID */ + int flags; /** see enum user_features */ + char user_agent[MAX_UA_LEN+1];/** User agent string */ + time_t tm_connected; /** time when user connected */ +@@ -120,7 +120,7 @@ + struct hub_info* hub; /** The hub instance this user belong to */ + int quit_reason; /** Quit reason (see user_quit_reason) */ + struct ip_addr_encap ipaddr; /** IP address of connected user */ +- struct user_counts limits; /** Data used for limitation */ ++ struct uhub_user_counts limits; /** Data used for limitation */ + #ifdef SSL_SUPPORT + SSL* ssl; /** SSL handle */ + #endif /* SSL_SUPPORT */ +@@ -137,19 +137,19 @@ + * @param sd socket descriptor associated with the user + * @return User object or NULL if not enough memory is available. + */ +-extern struct user* user_create(struct hub_info* hub, int sd); ++extern struct uhub_user* user_create(struct hub_info* hub, int sd); + + /** + * Delete a user. + * + * !WRONG! If the user is logged in a quit message is issued. + */ +-extern void user_destroy(struct user* user); ++extern void user_destroy(struct uhub_user* user); + + /** + * Will post a message that will delete the user later. + */ +-extern void user_schedule_destroy(struct user* user); ++extern void user_schedule_destroy(struct uhub_user* user); + + /** + * Disconnect a user. +@@ -165,36 +165,36 @@ + * @param user User to disconnect + * @param reason See enum user_quit_reason + */ +-extern void user_disconnect(struct user* user, int reason); ++extern void user_disconnect(struct uhub_user* user, int reason); + + /** + * This associates a INF message to the user. + * If the user already has a INF message associated, then this is + * released before setting the new one. + */ +-extern void user_set_info(struct user* user, struct adc_message* info); ++extern void user_set_info(struct uhub_user* user, struct adc_message* info); + + /** + * Specify a user's state. + * NOTE: DON'T, unless you know what you are doing. + */ +-extern void user_set_state(struct user* user, enum user_state); ++extern void user_set_state(struct uhub_user* user, enum user_state); + + /** + * Returns 1 if the user is in state state_normal, or 0 otherwise. + */ +-extern int user_is_logged_in(struct user* user); ++extern int user_is_logged_in(struct uhub_user* user); + + /** + * Returns 1 if the user is in state_protocol, state_identify or state_verify. + * Returns 0 otherwise. + */ +-extern int user_is_connecting(struct user* user); ++extern int user_is_connecting(struct uhub_user* user); + + /** + * Returns 1 only if the user is in state_cleanup or state_disconnected. + */ +-extern int user_is_disconnecting(struct user* user); ++extern int user_is_disconnecting(struct uhub_user* user); + + /** + * User supports the protocol extension as given in fourcc. +@@ -204,7 +204,7 @@ + * + * @see enum user_flags + */ +-extern void user_support_add(struct user* user, int fourcc); ++extern void user_support_add(struct uhub_user* user, int fourcc); + + /** + * User no longer supports the protocol extension as given in fourcc. +@@ -212,26 +212,26 @@ + * the hub. + * @see enum user_flags + */ +-extern void user_support_remove(struct user* user, int fourcc); ++extern void user_support_remove(struct uhub_user* user, int fourcc); + + /** + * Sets the nat override flag for a user, this allows users on the same + * subnet as a natted hub to spoof their IP in order to use active mode + * on a natted hub. + */ +-extern void user_set_nat_override(struct user* user); +-extern int user_is_nat_override(struct user* user); ++extern void user_set_nat_override(struct uhub_user* user); ++extern int user_is_nat_override(struct uhub_user* user); + + /** + * Set a flag. @see enum user_flags + */ +-extern void user_flag_set(struct user* user, enum user_flags flag); +-extern void user_flag_unset(struct user* user, enum user_flags flag); ++extern void user_flag_set(struct uhub_user* user, enum user_flags flag); ++extern void user_flag_unset(struct uhub_user* user, enum user_flags flag); + + /** + * Get a flag. @see enum user_flags + */ +-extern int user_flag_get(struct user* user, enum user_flags flag); ++extern int user_flag_get(struct uhub_user* user, enum user_flags flag); + + /** + * Check if a user supports 'feature' for feature casting (basis for 'Fxxx' messages) +@@ -241,7 +241,7 @@ + * @param feature a feature to lookup (example: 'TCP4' or 'UDP4') + * @return 1 if 'feature' supported, or 0 otherwise + */ +-extern int user_have_feature_cast_support(struct user* user, char feature[4]); ++extern int user_have_feature_cast_support(struct uhub_user* user, char feature[4]); + + /** + * Set feature cast support for feature. +@@ -249,12 +249,12 @@ + * @param feature a feature to lookup (example: 'TCP4' or 'UDP4') + * @return 1 if 'feature' supported, or 0 otherwise + */ +-extern int user_set_feature_cast_support(struct user* u, char feature[4]); ++extern int user_set_feature_cast_support(struct uhub_user* u, char feature[4]); + + /** + * Remove all feature cast support features. + */ +-extern void user_clear_feature_cast_support(struct user* u); ++extern void user_clear_feature_cast_support(struct uhub_user* u); + + + +--- a/src/usermanager.c ++++ b/src/usermanager.c +@@ -27,7 +27,7 @@ + { + if (ptr) + { +- struct user* u = (struct user*) ptr; ++ struct uhub_user* u = (struct uhub_user*) ptr; + + /* Mark the user as already being disconnected. + * This prevents the hub from trying to send +@@ -81,10 +81,10 @@ + + int user_manager_init(struct hub_info* hub) + { +- struct user_manager* users = NULL; ++ struct uhub_user_manager* users = NULL; + struct timeval timeout = { TIMEOUT_STATS, 0 }; + +- users = (struct user_manager*) hub_malloc_zero(sizeof(struct user_manager)); ++ users = (struct uhub_user_manager*) hub_malloc_zero(sizeof(struct uhub_user_manager)); + + users->list = list_create(); + users->free_sid = 1; +@@ -106,7 +106,7 @@ + + void user_manager_shutdown(struct hub_info* hub) + { +- struct user_manager* users = hub->users; ++ struct uhub_user_manager* users = hub->users; + event_del(&hub->ev_timer); + + list_clear(users->list, &clear_user_list_callback); +@@ -115,7 +115,7 @@ + } + + +-void user_manager_add(struct user* user) ++void user_manager_add(struct uhub_user* user) + { + list_append(user->hub->users->list, user); + user->hub->users->count++; +@@ -125,7 +125,7 @@ + user->hub->users->shared_files += user->limits.shared_files; + } + +-void user_manager_remove(struct user* user) ++void user_manager_remove(struct uhub_user* user) + { + list_remove(user->hub->users->list, user); + user->hub->users->count--; +@@ -135,50 +135,50 @@ + } + + +-struct user* get_user_by_sid(struct hub_info* hub, sid_t sid) ++struct uhub_user* get_user_by_sid(struct hub_info* hub, sid_t sid) + { +- struct user* user = (struct user*) list_get_first(hub->users->list); /* iterate users */ ++ struct uhub_user* user = (struct uhub_user*) list_get_first(hub->users->list); /* iterate users */ + while (user) + { + if (user->id.sid == sid) + return user; +- user = (struct user*) list_get_next(hub->users->list); ++ user = (struct uhub_user*) list_get_next(hub->users->list); + } + return NULL; + } + + +-struct user* get_user_by_cid(struct hub_info* hub, const char* cid) ++struct uhub_user* get_user_by_cid(struct hub_info* hub, const char* cid) + { +- struct user* user = (struct user*) list_get_first(hub->users->list); /* iterate users - only on incoming INF msg */ ++ struct uhub_user* user = (struct uhub_user*) list_get_first(hub->users->list); /* iterate users - only on incoming INF msg */ + while (user) + { + if (strcmp(user->id.cid, cid) == 0) + return user; +- user = (struct user*) list_get_next(hub->users->list); ++ user = (struct uhub_user*) list_get_next(hub->users->list); + } + return NULL; + } + + +-struct user* get_user_by_nick(struct hub_info* hub, const char* nick) ++struct uhub_user* get_user_by_nick(struct hub_info* hub, const char* nick) + { +- struct user* user = (struct user*) list_get_first(hub->users->list); /* iterate users - only on incoming INF msg */ ++ struct uhub_user* user = (struct uhub_user*) list_get_first(hub->users->list); /* iterate users - only on incoming INF msg */ + while (user) + { + if (strcmp(user->id.nick, nick) == 0) + return user; +- user = (struct user*) list_get_next(hub->users->list); ++ user = (struct uhub_user*) list_get_next(hub->users->list); + } + return NULL; + } + + +-int send_user_list(struct user* target) ++int send_user_list(struct uhub_user* target) + { + int ret = 1; + user_flag_set(target, flag_user_list); +- struct user* user = (struct user*) list_get_first(target->hub->users->list); /* iterate users - only on INF or PAS msg */ ++ struct uhub_user* user = (struct uhub_user*) list_get_first(target->hub->users->list); /* iterate users - only on INF or PAS msg */ + while (user) + { + if (user_is_logged_in(user)) +@@ -187,7 +187,7 @@ + if (!ret) + break; + } +- user = (struct user*) list_get_next(user->hub->users->list); ++ user = (struct uhub_user*) list_get_next(user->hub->users->list); + } + + if (!target->send_queue_size) +@@ -198,7 +198,7 @@ + } + + +-void send_quit_message(struct user* leaving) ++void send_quit_message(struct uhub_user* leaving) + { + struct adc_message* command = adc_msg_construct(ADC_CMD_IQUI, 6); + adc_msg_add_argument(command, (const char*) sid_to_string(leaving->id.sid)); +@@ -216,8 +216,8 @@ + sid_t user_manager_get_free_sid(struct hub_info* hub) + { + #if 0 +- struct user* user; +- user = (struct user*) list_get_first(hub->users->list); /* iterate normal users */ ++ struct uhub_user* user; ++ user = (struct uhub_user*) list_get_first(hub->users->list); /* iterate normal users */ + while (user) + { + if (user->sid == hub->users->free_sid) +@@ -226,7 +226,7 @@ + if (hub->users->free_sid >= SID_MAX) hub->users->free_sid = 1; + break; + } +- user = (struct user*) list_get_next(hub->users->list); ++ user = (struct uhub_user*) list_get_next(hub->users->list); + } + #endif + return hub->users->free_sid++; +--- a/src/usermanager.h ++++ b/src/usermanager.h +@@ -20,7 +20,7 @@ + #ifndef HAVE_UHUB_USER_MANAGER_H + #define HAVE_UHUB_USER_MANAGER_H + +-struct user_manager ++struct uhub_user_manager + { + size_t count; /**<< "Number of all fully connected and logged in users" */ + size_t count_peak; /**<< "Peak number of users" */ +@@ -51,14 +51,14 @@ + /** + * Add a new user to the user manager. + */ +-extern void user_manager_add(struct user* user); ++extern void user_manager_add(struct uhub_user* user); + + /** + * Remove a user from the user manager. + * This user is connected, and will be moved to the leaving queue, pending + * all messages in the message queue, and resource cleanup. + */ +-extern void user_manager_remove(struct user* user); ++extern void user_manager_remove(struct uhub_user* user); + + /** + * Returns a free sid for a new user. +@@ -70,19 +70,19 @@ + * NOTE: This will only search connected users. + * @return a user if found, or NULL if not found + */ +-extern struct user* get_user_by_sid(struct hub_info* hub, sid_t sid); ++extern struct uhub_user* get_user_by_sid(struct hub_info* hub, sid_t sid); + + /** + * Lookup a user based on the client ID (cid). + * @return a user if found, or NULL if not found + */ +-extern struct user* get_user_by_cid(struct hub_info* hub, const char* cid); ++extern struct uhub_user* get_user_by_cid(struct hub_info* hub, const char* cid); + + /** + * Lookup a user based on the nick name. + * @return a user if found, or NULL if not found + */ +-extern struct user* get_user_by_nick(struct hub_info* hub, const char* nick); ++extern struct uhub_user* get_user_by_nick(struct hub_info* hub, const char* nick); + + /** + * Send the user list of connected clients to 'user'. +@@ -90,13 +90,13 @@ + * + * @return 1 if sending the user list succeeded, 0 otherwise. + */ +-extern int send_user_list(struct user* user); ++extern int send_user_list(struct uhub_user* user); + + /** + * Send a quit message to all connected users when 'user' is + * leaving the hub (for whatever reason). + */ +-extern void send_quit_message(struct user* user); ++extern void send_quit_message(struct uhub_user* user); + + + #endif /* HAVE_UHUB_USER_MANAGER_H */ diff --git a/net/ulogd/Makefile b/net/ulogd/Makefile new file mode 100644 index 0000000..83ae37e --- /dev/null +++ b/net/ulogd/Makefile @@ -0,0 +1,146 @@ +# +# Copyright (C) 2006-2011 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:=ulogd +PKG_VERSION:=1.24 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.netfilter.org/pub/ulogd/ \ + ftp://ftp.be.netfilter.org/pub/netfilter/ulogd/ \ + ftp://ftp.de.netfilter.org/pub/netfilter/ulogd/ \ + ftp://ftp.no.netfilter.org/pub/netfilter/ulogd/ +PKG_MD5SUM:=05b4ed2926b9a22aaeaf642917bbf8ff + +define Package/ulogd/Default + SECTION:=net + CATEGORY:=Network + URL:=http://www.netfilter.org/projects/ulogd/index.html +endef + +define Package/ulogd + $(call Package/ulogd/Default) + DEPENDS:=+iptables-mod-ulog + TITLE:=Netfilter userspace logging daemon + MENU:=1 +endef + +define Package/ulogd/conffiles +/etc/default/ulogd +/etc/ulogd.conf +endef + +define Package/ulogd-mod-mysql + $(call Package/ulogd/Default) + DEPENDS:=ulogd +libmysqlclient + TITLE:=Output plugin for logging to a MySQL database +endef + +define Package/ulogd-mod-pcap + $(call Package/ulogd/Default) + DEPENDS:=ulogd +libpcap + TITLE:=Output plugin for logging in pcap format +endef + +define Package/ulogd-mod-pgsql + $(call Package/ulogd/Default) + DEPENDS:=ulogd +libpq + TITLE:=Output plugin for logging to a PostgreSQL database +endef + +define Package/ulogd-mod-sqlite + $(call Package/ulogd/Default) + DEPENDS:=ulogd +libsqlite3 + TITLE:=Output plugin for logging to an SQLite database +endef + +define Package/ulogd-mod-extra + $(call Package/ulogd/Default) + DEPENDS:=ulogd + TITLE:=Extra plugins +endef + +define Package/ulogd-mod-extra/description + This package contains the LOCAL, LOGEMU, OPRINT, PWSNIFF and SYSLOG plugins. +endef + +include $(INCLUDE_DIR)/package.mk + +ifneq ($(Package/ulogd-mod-mysql),) + ULOGD_MYSQL_OPTION:= --with-mysql="$(STAGING_DIR)/usr" +endif + +ifneq ($(Package/ulogd-mod-pcap),) + ULOGD_PCAP_HEADER:=yes +else + ULOGD_PCAP_HEADER:=no +endif + +ifneq ($(Package/ulogd-mod-pgsql),) + ULOGD_PGSQL_OPTION:= --with-pgsql="$(STAGING_DIR)/usr" +endif + +ifneq ($(Package/ulogd-mod-sqlite),) + ULOGD_SQLITE_OPTION:= --with-sqlite3="$(STAGING_DIR)/usr" +endif + +define Build/Configure + $(call Build/Configure/Default, \ + $(ULOGD_MYSQL_OPTION) \ + $(ULOGD_PGSQL_OPTION) \ + $(ULOGD_SQLITE_OPTION) \ + , \ + ac_cv_header_pcap_h=$(ULOGD_PCAP_HEADER) \ + ) + $(SED) 's/-lgcc_s//g' $(PKG_BUILD_DIR)/Rules.make +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + CFLAGS="$(TARGET_CFLAGS) \ + -Iinclude \ + -I$(PKG_BUILD_DIR)/include/ulogd \ + -I$(PKG_BUILD_DIR)/include \ + -I$(PKG_BUILD_DIR)/libipulog/include \ + -Wl,--export-dynamic \ + $(TARGET_CPPFLAGS)" \ + all install +endef + +define Package/ulogd/install + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/ulogd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ulogd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/ulogd + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ulogd/ulogd_BASE.so $(1)/usr/lib/ulogd/ + $(INSTALL_DIR) $(1)/etc/default + $(INSTALL_DATA) ./files/ulogd.default $(1)/etc/default/ulogd + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/ulogd.init $(1)/etc/init.d/ulogd +endef + +define BuildPlugin + define Package/$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/ulogd + for m in $(2); do \ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ulogd/ulogd_$$$$$$$${m}.so $$(1)/usr/lib/ulogd/ ; \ + done + endef + + $$(eval $$(call BuildPackage,$(1))) +endef + +$(eval $(call BuildPackage,ulogd)) +$(eval $(call BuildPlugin,ulogd-mod-mysql,MYSQL)) +$(eval $(call BuildPlugin,ulogd-mod-pcap,PCAP)) +$(eval $(call BuildPlugin,ulogd-mod-pgsql,PGSQL)) +$(eval $(call BuildPlugin,ulogd-mod-sqlite,SQLITE3)) +$(eval $(call BuildPlugin,ulogd-mod-extra,LOCAL LOGEMU OPRINT PWSNIFF SYSLOG)) diff --git a/net/ulogd/files/ulogd.default b/net/ulogd/files/ulogd.default new file mode 100644 index 0000000..86bf444 --- /dev/null +++ b/net/ulogd/files/ulogd.default @@ -0,0 +1 @@ +OPTIONS="-d" \ No newline at end of file diff --git a/net/ulogd/files/ulogd.init b/net/ulogd/files/ulogd.init new file mode 100644 index 0000000..1e13bdb --- /dev/null +++ b/net/ulogd/files/ulogd.init @@ -0,0 +1,17 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +PROG="ulogd" +COMMAND="/usr/sbin/$PROG" +DEFAULT="/etc/default/$PROG" + +start() { + [ -f $DEFAULT ] && . $DEFAULT + service_start $COMMAND $OPTIONS +} + +stop() { + service_stop $COMMAND +} diff --git a/net/ulogd/patches/001-pcap_flags.patch b/net/ulogd/patches/001-pcap_flags.patch new file mode 100644 index 0000000..c97d879 --- /dev/null +++ b/net/ulogd/patches/001-pcap_flags.patch @@ -0,0 +1,12 @@ +diff -urN ulogd-1.23/pcap/Makefile.in ulogd-1.23.new/pcap/Makefile.in +--- ulogd-1.23/pcap/Makefile.in 2004-03-23 23:36:04.000000000 +0100 ++++ ulogd-1.23.new/pcap/Makefile.in 2006-04-19 11:30:45.000000000 +0200 +@@ -14,7 +14,7 @@ + distrib: + + $(SHARED_LIBS): %.so: %_sh.o +- $(LD) -shared -o $@ $< -lc -lpcap ++ $(LD) -shared -o $@ $< @LDFLAGS@ -lc -lpcap + + %_sh.o: %.c + $(CC) $(SH_CFLAGS) -o $@ -c $< diff --git a/net/ulogd/patches/002-inc.patch b/net/ulogd/patches/002-inc.patch new file mode 100644 index 0000000..b472112 --- /dev/null +++ b/net/ulogd/patches/002-inc.patch @@ -0,0 +1,24 @@ +diff -ruN ulogd-1.23-old/Rules.make.in ulogd-1.23-new/Rules.make.in +--- ulogd-1.23-old/Rules.make.in 2005-02-19 22:32:40.000000000 +0100 ++++ ulogd-1.23-new/Rules.make.in 2005-05-27 07:45:18.000000000 +0200 +@@ -22,7 +22,7 @@ + CFLAGS+=-DULOGD_CONFIGFILE=\"$(ULOGD_CONFIGFILE)\" + # doesn't work for subdirs + #CFLAGS+=$(INCIPULOG) $(INCCONFFILE) +-CFLAGS+=-I/lib/modules/`uname -r`/build/include ++#CFLAGS+=-I/lib/modules/`uname -r`/build/include + #CFLAGS+=@DEFS@ + #CFLAGS+=-g -DDEBUG -DDEBUG_MYSQL -DDEBUG_PGSQL + +diff -ruN ulogd-1.23-old/libipulog/Makefile.in ulogd-1.23-new/libipulog/Makefile.in +--- ulogd-1.23-old/libipulog/Makefile.in 2004-03-23 23:36:06.000000000 +0100 ++++ ulogd-1.23-new/libipulog/Makefile.in 2005-05-27 07:44:21.000000000 +0200 +@@ -1,7 +1,7 @@ + # + + include @top_srcdir@/Rules.make +-CFLAGS+=-Iinclude -I/usr/src/linux/include ++CFLAGS+=-Iinclude + + libipulog.a: libipulog.o + $(LD) -i $< -o $@ diff --git a/net/ulogd/patches/003-fix-bad-rpath.patch b/net/ulogd/patches/003-fix-bad-rpath.patch new file mode 100644 index 0000000..0a2e646 --- /dev/null +++ b/net/ulogd/patches/003-fix-bad-rpath.patch @@ -0,0 +1,33 @@ +--- a/configure ++++ b/configure +@@ -1728,7 +1728,7 @@ else + EOF + + MYSQLINCLUDES=`$d/mysql_config --include` +- MYSQLLIBS=`$d/mysql_config --libs` ++ MYSQLLIBS=`$d/mysql_config --libs | sed 's/-rdynamic//'` + + DATABASE_DIR="${DATABASE_DIR} mysql" + +--- a/configure.in ++++ b/configure.in +@@ -60,7 +60,7 @@ then + else + AC_DEFINE(HAVE_MYSQL) + MYSQLINCLUDES=`$d/mysql_config --include` +- MYSQLLIBS=`$d/mysql_config --libs` ++ MYSQLLIBS=`$d/mysql_config --libs | $(SED) 's/-rdynamic//'` + + DATABASE_DIR="${DATABASE_DIR} mysql" + +--- a/Makefile.in ++++ b/Makefile.in +@@ -63,7 +63,7 @@ recurse: + @for d in $(SUBDIRS); do if ! make -C $$d; then exit 1; fi; done + + ulogd: ulogd.c $(LIBIPULOG) include/ulogd/ulogd.h conffile/conffile.o $(LIBIPULOG)/libipulog.a ulogd.conf +- $(CC) $(CFLAGS) -rdynamic $< conffile/conffile.o $(LIBIPULOG)/libipulog.a -o $@ $(LIBS) ++ $(CC) $(CFLAGS) $< conffile/conffile.o $(LIBIPULOG)/libipulog.a -o $@ $(LIBS) + + edit = sed -e 's,@libdir\@,$(ULOGD_LIB_PATH),g' + diff --git a/net/umurmur/Makefile b/net/umurmur/Makefile new file mode 100644 index 0000000..8c82e6d --- /dev/null +++ b/net/umurmur/Makefile @@ -0,0 +1,95 @@ +# +# Copyright (C) 2009-2012 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.10 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://umurmur.googlecode.com/files +PKG_MD5SUM:=4d71a699bddce3df0996b5dd0a279b47 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/umurmur/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Instant Messaging + TITLE:=uMurmur + DEPENDS:=+libconfig +libprotobuf-c + URL:=http://code.google.com/p/umurmur + MAINTAINER:=Martin Johansson +endef + +define Package/umurmur/Default/description + Minimalistic Mumble server daemon. +endef + +define Package/umurmur-openssl + $(call Package/umurmur/Default) + TITLE+= (with OpenSSL support) + DEPENDS+= +libopenssl + VARIANT:=openssl +endef + +define Package/umurmur-openssl/description + $(call Package/umurmur/Default/description) + Uses OpenSSL library for SSL and crypto. +endef + +define Package/umurmur-polarssl + $(call Package/umurmur/Default) + TITLE+= (with PolarSSL support) + DEPENDS+= +libpolarssl + VARIANT:=polarssl +endef + +define Package/umurmur-polarssl/description + $(call Package/umurmur/Default/description) + Uses the PolarSSL library for SSL and crypto. +endef + +define Build/Compile + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + $(MAKE) -C $(PKG_BUILD_DIR)/src all +endef + +define Package/umurmur-openssl/conffiles +/etc/umurmur.conf +endef + +Package/umurmur-polarssl/conffiles = $(Package/umurmur-openssl/conffiles) + +define Package/umurmur-openssl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/umurmurd $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/openwrt/files/umurmur.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt/files/umurmur.init $(1)/etc/init.d/umurmur + $(INSTALL_DIR) $(1)/etc/umurmur +endef + +Package/umurmur-polarssl/install = $(Package/umurmur-openssl/install) + +ifeq ($(BUILD_VARIANT),openssl) + CONFIGURE_ARGS += \ + --with-ssl=openssl +endif + +ifeq ($(BUILD_VARIANT),polarssl) + CONFIGURE_ARGS += \ + --with-ssl=polarssl +endif + +$(eval $(call BuildPackage,umurmur-openssl)) +$(eval $(call BuildPackage,umurmur-polarssl)) diff --git a/net/unbound/Makefile b/net/unbound/Makefile new file mode 100644 index 0000000..a58e585 --- /dev/null +++ b/net/unbound/Makefile @@ -0,0 +1,173 @@ +# +# Copyright (C) 2010-2012 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:=unbound +PKG_VERSION:=1.4.17 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.unbound.net/downloads +PKG_MD5SUM:=812d49064a78c92765970a1364736da7 + +PKG_BUILD_DEPENDS:=libexpat +PKG_BUILD_PARALLEL:=1 +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/unbound/Default + TITLE:=A validating, recursive & caching DNS resolver + URL:=http://www.unbound.net/ + DEPENDS:=+libldns +endef + +define Package/unbound + $(call Package/unbound/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE+= (daemon) + DEPENDS+= +libunbound +endef + +define Package/unbound/description + This package contains the Unbound daemon. +endef + +define Package/unbound-anchor + $(call Package/unbound/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE+= (anchor utility) + DEPENDS+= +unbound +libexpat +endef + +define Package/unbound-anchor/description + This package contains the Unbound anchor utility. +endef + +define Package/unbound-control + $(call Package/unbound/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE+= (control utility) + DEPENDS+= +unbound +endef + +define Package/unbound-control/description + This package contains the Unbound control utility. +endef + +define Package/unbound-control-setup + $(call Package/unbound/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE+= (control setup utility) + DEPENDS+= +unbound-control +openssl-util +endef + +define Package/unbound-control-setup/description + This package contains the Unbound control setup utility. +endef + +define Package/unbound-host + $(call Package/unbound/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE+= (DNS lookup utility) + DEPENDS+= +libunbound +endef + +define Package/unbound-host/description + This package contains the Unbound DNS lookup utility. +endef + +define Package/libunbound + $(call Package/unbound/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= (library) +endef + +define Package/libunbound/description + This package contains the Unbound shared library. +endef + +CONFIGURE_ARGS += \ + --disable-ecdsa \ + --disable-gost \ + --enable-allsymbols \ + --with-ldns="$(STAGING_DIR)/usr" \ + --with-libexpat="$(STAGING_DIR)/usr" \ + --with-ssl="$(STAGING_DIR)/usr" \ + --without-pthreads + +define Package/unbound/conffiles +/etc/unbound/unbound.conf +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/unbound.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunbound.{so*,a,la} $(1)/usr/lib/ +endef + +define Package/unbound/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/sbin/unbound \ + $(PKG_INSTALL_DIR)/usr/sbin/unbound-checkconf \ + $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/unbound + $(INSTALL_CONF) \ + $(PKG_INSTALL_DIR)/etc/unbound/unbound.conf \ + $(1)/etc/unbound/ + $(INSTALL_CONF) ./files/root.key $(1)/etc/unbound/ + $(INSTALL_CONF) ./files/named.cache $(1)/etc/unbound/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/unbound.init $(1)/etc/init.d/unbound +endef + +define Package/unbound-anchor/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/unbound-anchor $(1)/usr/sbin/ +endef + +define Package/unbound-control/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control $(1)/usr/sbin/ +endef + +define Package/unbound-control-setup/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control-setup $(1)/usr/sbin/ +endef + +define Package/unbound-host/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/unbound-host $(1)/usr/sbin/ +endef + +define Package/libunbound/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunbound.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,unbound)) +$(eval $(call BuildPackage,unbound-anchor)) +$(eval $(call BuildPackage,unbound-control)) +$(eval $(call BuildPackage,unbound-control-setup)) +$(eval $(call BuildPackage,unbound-host)) +$(eval $(call BuildPackage,libunbound)) diff --git a/net/unbound/files/named.cache b/net/unbound/files/named.cache new file mode 100644 index 0000000..8fbbb65 --- /dev/null +++ b/net/unbound/files/named.cache @@ -0,0 +1,88 @@ +; This file holds the information on root name servers needed to +; initialize cache of Internet domain name servers +; (e.g. reference this file in the "cache . " +; configuration file of BIND domain name servers). +; +; This file is made available by InterNIC +; under anonymous FTP as +; file /domain/named.cache +; on server FTP.INTERNIC.NET +; -OR- RS.INTERNIC.NET +; +; last update: Jun 8, 2011 +; related version of root zone: 2011060800 +; +; formerly NS.INTERNIC.NET +; +. 3600000 IN NS A.ROOT-SERVERS.NET. +A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4 +A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:BA3E::2:30 +; +; FORMERLY NS1.ISI.EDU +; +. 3600000 NS B.ROOT-SERVERS.NET. +B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201 +; +; FORMERLY C.PSI.NET +; +. 3600000 NS C.ROOT-SERVERS.NET. +C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12 +; +; FORMERLY TERP.UMD.EDU +; +. 3600000 NS D.ROOT-SERVERS.NET. +D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90 +D.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2D::D +; +; FORMERLY NS.NASA.GOV +; +. 3600000 NS E.ROOT-SERVERS.NET. +E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10 +; +; FORMERLY NS.ISC.ORG +; +. 3600000 NS F.ROOT-SERVERS.NET. +F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241 +F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2F::F +; +; FORMERLY NS.NIC.DDN.MIL +; +. 3600000 NS G.ROOT-SERVERS.NET. +G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4 +; +; FORMERLY AOS.ARL.ARMY.MIL +; +. 3600000 NS H.ROOT-SERVERS.NET. +H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53 +H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803F:235 +; +; FORMERLY NIC.NORDU.NET +; +. 3600000 NS I.ROOT-SERVERS.NET. +I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 +I.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FE::53 +; +; OPERATED BY VERISIGN, INC. +; +. 3600000 NS J.ROOT-SERVERS.NET. +J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30 +J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:C27::2:30 +; +; OPERATED BY RIPE NCC +; +. 3600000 NS K.ROOT-SERVERS.NET. +K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129 +K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FD::1 +; +; OPERATED BY ICANN +; +. 3600000 NS L.ROOT-SERVERS.NET. +L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42 +L.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:3::42 +; +; OPERATED BY WIDE +; +. 3600000 NS M.ROOT-SERVERS.NET. +M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33 +M.ROOT-SERVERS.NET. 3600000 AAAA 2001:DC3::35 +; End of File diff --git a/net/unbound/files/root.key b/net/unbound/files/root.key new file mode 100644 index 0000000..2ad6641 --- /dev/null +++ b/net/unbound/files/root.key @@ -0,0 +1 @@ +. IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5 diff --git a/net/unbound/files/unbound.init b/net/unbound/files/unbound.init new file mode 100755 index 0000000..4e700e4 --- /dev/null +++ b/net/unbound/files/unbound.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +#Copyright (C) 2010 Ondrej Caletka +START=61 + +start () { + unbound +} + +stop () { + PIDFILE='/var/run/unbound.pid' + if [ -f $PIDFILE ] ; then + kill $(cat $PIDFILE) + fi +} diff --git a/net/unbound/patches/001-conf.patch b/net/unbound/patches/001-conf.patch new file mode 100644 index 0000000..4ada6e0 --- /dev/null +++ b/net/unbound/patches/001-conf.patch @@ -0,0 +1,154 @@ +--- a/doc/example.conf.in ++++ b/doc/example.conf.in +@@ -38,6 +38,8 @@ server: + # interface: 192.0.2.154 + # interface: 192.0.2.154@5003 + # interface: 2001:DB8::5 ++ interface: 0.0.0.0 ++ interface: ::0 + + # enable this feature to copy the source address of queries to reply. + # Socket options are not supported on all platforms. experimental. +@@ -57,6 +59,7 @@ server: + # port range that can be open simultaneously. About double the + # num-queries-per-thread, or, use as many as the OS will allow you. + # outgoing-range: 4096 ++ outgoing-range: 60 + + # permit unbound to use this port number or port range for + # making outgoing queries, using an outgoing interface. +@@ -71,9 +74,11 @@ server: + + # number of outgoing simultaneous tcp buffers to hold per thread. + # outgoing-num-tcp: 10 ++ outgoing-num-tcp: 1 + + # number of incoming simultaneous tcp buffers to hold per thread. + # incoming-num-tcp: 10 ++ incoming-num-tcp: 1 + + # buffer size for UDP port 53 incoming (SO_RCVBUF socket option). + # 0 is system default. Use 4m to catch query spikes for busy servers. +@@ -90,18 +95,22 @@ server: + # buffer size for handling DNS data. No messages larger than this + # size can be sent or received, by UDP or TCP. In bytes. + # msg-buffer-size: 65552 ++ msg-buffer-size: 8192 + + # the amount of memory to use for the message cache. + # plain value in bytes or you can append k, m or G. default is "4Mb". + # msg-cache-size: 4m ++ msg-cache-size: 100k + + # the number of slabs to use for the message cache. + # the number of slabs must be a power of 2. + # more slabs reduce lock contention, but fragment memory usage. + # msg-cache-slabs: 4 ++ msg-cache-slabs: 1 + + # the number of queries that a thread gets to service. + # num-queries-per-thread: 1024 ++ num-queries-per-thread: 30 + + # if very busy, 50% queries run to completion, 50% get timeout in msec + # jostle-timeout: 200 +@@ -109,11 +118,13 @@ server: + # the amount of memory to use for the RRset cache. + # plain value in bytes or you can append k, m or G. default is "4Mb". + # rrset-cache-size: 4m ++ rrset-cache-size: 100k + + # the number of slabs to use for the RRset cache. + # the number of slabs must be a power of 2. + # more slabs reduce lock contention, but fragment memory usage. + # rrset-cache-slabs: 4 ++ rrset-cache-slabs: 1 + + # the time to live (TTL) value lower bound, in seconds. Default 0. + # If more than an hour could easily give trouble due to stale data. +@@ -131,9 +142,11 @@ server: + # the number of slabs must be a power of 2. + # more slabs reduce lock contention, but fragment memory usage. + # infra-cache-slabs: 4 ++ infra-cache-slabs: 1 + + # the maximum number of hosts that are cached (roundtrip, EDNS, lame). + # infra-cache-numhosts: 10000 ++ infra-cache-numhosts: 200 + + # Enable IPv4, "yes" or "no". + # do-ip4: yes +@@ -164,6 +177,8 @@ server: + # access-control: ::0/0 refuse + # access-control: ::1 allow + # access-control: ::ffff:127.0.0.1 allow ++ access-control: 0.0.0.0/0 allow ++ access-control: ::0/0 allow + + # if given, a chroot(2) is done to the given directory. + # i.e. you can chroot to the working directory, for example, +@@ -194,6 +209,7 @@ server: + # and the given username is assumed. Default is user "unbound". + # If you give "" no privileges are dropped. + # username: "@UNBOUND_USERNAME@" ++ username: "" + + # the working directory. The relative files in this config are + # relative to this directory. If you give "" the working directory +@@ -216,10 +232,12 @@ server: + + # the pid file. Can be an absolute path outside of chroot/work dir. + # pidfile: "@UNBOUND_PIDFILE@" ++ pidfile: "/var/run/unbound.pid" + + # file to read root hints from. + # get one from ftp://FTP.INTERNIC.NET/domain/named.cache + # root-hints: "" ++ root-hints: "/etc/unbound/named.cache" + + # enable to not answer id.server and hostname.bind queries. + # hide-identity: no +@@ -242,12 +260,15 @@ server: + # positive value: fetch that many targets opportunistically. + # Enclose the list of numbers between quotes (""). + # target-fetch-policy: "3 2 1 0 0" ++ target-fetch-policy: "2 1 0 0 0 0" + + # Harden against very small EDNS buffer sizes. + # harden-short-bufsize: no ++ harden-short-bufsize: yes + + # Harden against unseemly large queries. + # harden-large-queries: no ++ harden-large-queries: yes + + # Harden against out of zone rrsets, to avoid spoofing attempts. + # harden-glue: yes +@@ -328,7 +349,7 @@ server: + # you start unbound (i.e. in the system boot scripts). And enable: + # Please note usage of unbound-anchor root anchor is at your own risk + # and under the terms of our LICENSE (see that file in the source). +- # auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@" ++ auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@" + + # File with DLV trusted keys. Same format as trust-anchor-file. + # There can be only one DLV configured, it is trusted from root down. +@@ -414,15 +435,18 @@ server: + # the amount of memory to use for the key cache. + # plain value in bytes or you can append k, m or G. default is "4Mb". + # key-cache-size: 4m ++ key-cache-size: 100k + + # the number of slabs to use for the key cache. + # the number of slabs must be a power of 2. + # more slabs reduce lock contention, but fragment memory usage. + # key-cache-slabs: 4 ++ key-cache-slabs: 1 + + # the amount of memory to use for the negative cache (used for DLV). + # plain value in bytes or you can append k, m or G. default is "1Mb". + # neg-cache-size: 1m ++ neg-cache-size: 10k + + # a number of locally served zones can be configured. + # local-zone: diff --git a/net/unfs3/Makefile b/net/unfs3/Makefile new file mode 100644 index 0000000..3764aae --- /dev/null +++ b/net/unfs3/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2006-2011 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:=unfs3 +PKG_VERSION:=0.9.22 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=ddf679a5d4d80096a59f3affc64f16e5 + +PKG_BUILD_PARALLEL:=0 + +include $(INCLUDE_DIR)/package.mk + +define Package/unfs3 + SECTION:=net + CATEGORY:=Network + SUBMENU:=Filesystem + DEPENDS:=+portmap $(LIBRPC_DEPENDS) + TITLE:=User-space NFSv3 Server + URL:=http://unfs3.sourceforge.net/ +endef + +define Package/unfs3/description + UNFS3 is a user-space implementation of the NFSv3 server + specification. It provides a daemon for the MOUNT and NFS + protocols, which are used by NFS clients for accessing files + on the server. +endef + +TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include +TARGET_LDFLAGS += $(LIBRPC) + +define Package/unfs3/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/$(PKG_NAME).exports $(1)/etc/exports + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/unfsd $(1)/usr/sbin +endef + +define Package/unfs3/conffiles +/etc/exports +endef + +$(eval $(call BuildPackage,unfs3)) diff --git a/net/unfs3/files/unfs3.exports b/net/unfs3/files/unfs3.exports new file mode 100644 index 0000000..a730f77 --- /dev/null +++ b/net/unfs3/files/unfs3.exports @@ -0,0 +1 @@ +/mnt (ro,all_squash,insecure) diff --git a/net/unfs3/files/unfs3.init b/net/unfs3/files/unfs3.init new file mode 100644 index 0000000..4a5965a --- /dev/null +++ b/net/unfs3/files/unfs3.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +start() { + service_start /usr/sbin/unfsd +} + +stop() { + service_stop /usr/sbin/unfsd +} diff --git a/net/unfs3/patches/100-no_lfl.patch b/net/unfs3/patches/100-no_lfl.patch new file mode 100644 index 0000000..c4a971f --- /dev/null +++ b/net/unfs3/patches/100-no_lfl.patch @@ -0,0 +1,43 @@ +--- a/Config/lex.yy.c ++++ b/Config/lex.yy.c +@@ -445,9 +445,15 @@ static void copy_text(const char *from, + + #ifndef YY_SKIP_YYWRAP + #ifdef __cplusplus +-extern "C" int yywrap YY_PROTO(( void )); +-#else +-extern int yywrap YY_PROTO(( void )); ++/* extern "C" int yywrap YY_PROTO(( void )); */ ++int yywrap (void ) { ++ return 1; ++} ++#else ++/* extern int yywrap YY_PROTO(( void )); */ ++int yywrap (void ) { ++ return 1; ++} + #endif + #endif + +--- a/Makefile.in ++++ b/Makefile.in +@@ -12,7 +12,7 @@ OBJS = attr.o daemon.o error.o fd_cache. + md5.o mount.o nfs.o password.o readdir.o user.o xdr.o winsupport.o + CONFOBJ = Config/lib.a + EXTRAOBJ = @EXTRAOBJ@ +-LDFLAGS = @LDFLAGS@ @LIBS@ @LEXLIB@ ++LDFLAGS = @LDFLAGS@ @LIBS@ + EXEEXT = @EXEEXT@ + + prefix = @prefix@ +--- a/configure ++++ b/configure +@@ -2604,7 +2604,7 @@ else + + ac_save_LIBS=$LIBS + ac_cv_lib_lex='none needed' +- for ac_lib in '' -lfl -ll; do ++ for ac_lib in '' -ll; do + LIBS="$ac_lib $ac_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF + `cat $LEX_OUTPUT_ROOT.c` diff --git a/net/uob-nomad/Makefile b/net/uob-nomad/Makefile new file mode 100644 index 0000000..937b2d5 --- /dev/null +++ b/net/uob-nomad/Makefile @@ -0,0 +1,65 @@ +# +# Copyright (C) 2006-2011 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:=uob-nomad +PKG_VERSION:=0.11 +PKG_RELEASE:=2 + +PKG_SOURCE_URL:=http://www.comnets.uni-bremen.de/~mab/openwrt/source/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=9c7445cefaf8d6160017aef606f2e558 + +PKG_BUILD_PARALLEL:=0 + +include $(INCLUDE_DIR)/package.mk + +define Package/uob-nomad + SECTION:=net + CATEGORY:=Network + DEPENDS:=+kmod-iptunnel4 +libpthread + TITLE:=UoB Nomad + URL:=http://www.comnets.uni-bremen.de/~mab/openwrt/source/ +endef + +define Package/uob-nomad/description +This is an implementation of NOMADv4 (Filters for + Mobile IP, IETF Draft + draft-mobileip-nomad-filters-05.txt) for Linux, + based on the Sun Labs Mobile IP software. It is + released under the Sun Public License (SPL). + + This version (0.11) has been modified to provide + status information to the UoB-NOMAD-GUI (ver 0.1). +endef + +TARGET_CFLAGS += -include stddef.h -include string.h + +MAKE_FLAGS = \ + CC="$(TARGET_CC) $(TARGET_CFLAGS)" + +define Build/Compile +$(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/Agent clean mipagent) +$(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/Client/net-tools clean) +$(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/Client/net-tools/lib clean) +$(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/Client/net-tools all) +$(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/Client clean mipmn) +endef + +define Package/uob-nomad/install + $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib $(1)/etc/ + $(CP) $(PKG_BUILD_DIR)/Agent/mipagent $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/Client/mipmn $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/conf/mip{agent,mn,mn-filters}.conf $(1)/etc/ +endef + +define Package/uob-nomad/conffiles +/etc/mip{agent,mn,mn-filters}.conf +endef + +$(eval $(call BuildPackage,uob-nomad)) diff --git a/net/uob-nomad/patches/001-inet_sr.patch b/net/uob-nomad/patches/001-inet_sr.patch new file mode 100644 index 0000000..21c940b --- /dev/null +++ b/net/uob-nomad/patches/001-inet_sr.patch @@ -0,0 +1,11 @@ +diff -urN uob-nomad-0.11/Client/net-tools/lib/inet_sr.c uob-nomad-0.11.new/Client/net-tools/lib/inet_sr.c +--- uob-nomad-0.11/Client/net-tools/lib/inet_sr.c 2003-09-05 10:21:52.000000000 +0200 ++++ uob-nomad-0.11.new/Client/net-tools/lib/inet_sr.c 2006-10-09 20:36:50.000000000 +0200 +@@ -105,6 +105,7 @@ + case 2: + isnet = 0; break; + default: ++ break; + } + + /* Fill in the other fields. */ diff --git a/net/uob-nomad/patches/002-hostname.patch b/net/uob-nomad/patches/002-hostname.patch new file mode 100644 index 0000000..7882c15 --- /dev/null +++ b/net/uob-nomad/patches/002-hostname.patch @@ -0,0 +1,34 @@ +--- uob-nomad-0.11/Client/net-tools/hostname.c 2003-09-05 10:21:54.000000000 +0200 ++++ uob-nomad-0.11.new/Client/net-tools/hostname.c 2006-10-09 20:38:25.000000000 +0200 +@@ -77,6 +77,7 @@ + fprintf(stderr, _("%s: name too long\n"), program_name); + break; + default: ++ break; + } + exit(1); + } +@@ -97,6 +98,7 @@ + fprintf(stderr, _("%s: name too long\n"), program_name); + break; + default: ++ break; + } + exit(1); + }; +@@ -116,6 +118,7 @@ + fprintf(stderr, _("%s: name too long\n"), program_name); + break; + default: ++ break; + } + exit(1); + }; +@@ -173,6 +176,7 @@ + printf("%s\n", hp->h_name); + break; + default: ++ break; + } + } + diff --git a/net/uob-nomad/patches/003-conf.patch b/net/uob-nomad/patches/003-conf.patch new file mode 100644 index 0000000..7927a05 --- /dev/null +++ b/net/uob-nomad/patches/003-conf.patch @@ -0,0 +1,21 @@ +diff -ruN package/uobnomad.orig/patches/003-conf.patch package/uobnomad/patches/003-conf.patch +--- package/uobnomad.orig/patches/003-conf.patch 1970-01-01 01:00:00.000000000 +0100 ++++ package/uobnomad/patches/003-conf.patch 2006-05-08 16:54:36.000000000 +0200 +@@ -0,0 +1,17 @@ ++--- uob-nomad-0.11-orig/Client/mobile.h 2003-10-20 16:07:09.000000000 +0200 +++++ uob-nomad-0.11/Client/mobile.h 2006-05-08 16:53:31.000000000 +0200 ++@@ -83,10 +83,10 @@ ++ /* Destination port for registration requests */ ++ #define MIP_PORT 434 ++ ++-//#define CONF_FILE_NAME "/etc/mipmn.conf" ++-//#define FILTER_FILE_NAME "/etc/mipmn-filters.conf" ++-#define CONF_FILE_NAME "/home/adu/mipmn.conf" ++-#define FILTER_FILE_NAME "/home/adu/mipmn-filters.conf" +++#define CONF_FILE_NAME "/etc/mipmn.conf" +++#define FILTER_FILE_NAME "/etc/mipmn-filters.conf" +++//#define CONF_FILE_NAME "/home/adu/mipmn.conf" +++//#define FILTER_FILE_NAME "/home/adu/mipmn-filters.conf" ++ #define ROUTE_PATH "/sbin/route" ++ ++ /* Maximum number of mobility agents a MN keeps track of */ diff --git a/net/uob-nomad/patches/004-linux26_header_fix.patch b/net/uob-nomad/patches/004-linux26_header_fix.patch new file mode 100644 index 0000000..98a1791 --- /dev/null +++ b/net/uob-nomad/patches/004-linux26_header_fix.patch @@ -0,0 +1,14 @@ +diff -ur nomad.old/Client/net-tools/lib/x25_sr.c nomad.dev/Client/net-tools/lib/x25_sr.c +--- nomad.old/Client/net-tools/lib/x25_sr.c 2003-09-05 10:21:52.000000000 +0200 ++++ nomad.dev/Client/net-tools/lib/x25_sr.c 2006-12-09 00:19:50.036574096 +0100 +@@ -41,6 +41,10 @@ + + #include "net-features.h" + ++#ifdef X25_MASK_CALLING_AE ++typedef struct x25_address x25_address; ++#endif ++ + extern struct aftype x25_aftype; + + static int skfd = -1; diff --git a/net/updatedd/Makefile b/net/updatedd/Makefile new file mode 100644 index 0000000..3e05d30 --- /dev/null +++ b/net/updatedd/Makefile @@ -0,0 +1,155 @@ +# +# Copyright (C) 2007-2012 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:=updatedd +PKG_VERSION:=2.6 +PKG_RELEASE:=9 + +PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/ +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.bz2 +PKG_MD5SUM:=f03446105ed043cd5dbd1ab95484d27f + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/updatedd + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + MENU:=1 + TITLE:=A tool to update dynamic dns services + URL:=http://savannah.nongnu.org/projects/updatedd/ +endef + +define Package/updatedd/description +Updatedd is a small tool that will update one of many dynamic + dns services on boot. + Please look at the /etc/init.d/ddns script for more info. + +endef + +define Package/updatedd/conffiles +/etc/config/updatedd +endef + +define Package/updatedd-mod-changeip + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + DEPENDS:=updatedd + TITLE:=changeip.com +endef + +define Package/updatedd-mod-dyndns + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + DEPENDS:=updatedd + TITLE:=dyndns.org +endef + +define Package/updatedd-mod-eurodyndns + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + DEPENDS:=updatedd + TITLE:=eurodyndns.org +endef + +define Package/updatedd-mod-hn + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + DEPENDS:=updatedd + TITLE:=hn.org +endef + +define Package/updatedd-mod-noip + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + DEPENDS:=updatedd + TITLE:=no-ip.com +endef + +define Package/updatedd-mod-ods + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + DEPENDS:=updatedd + TITLE:=ods.org +endef + +define Package/updatedd-mod-ovh + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + DEPENDS:=updatedd + TITLE:=ovh.com +endef + +define Package/updatedd-mod-regfish + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + DEPENDS:=updatedd + TITLE:=regfish.com +endef + +define Package/updatedd-mod-tzo + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + DEPENDS:=updatedd + TITLE:=tzo.com +endef + +define Package/updatedd-mod-zoneedit + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + DEPENDS:=updatedd + TITLE:=zoneedit.com +endef + +define BuildPlugin + define Package/$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/updatedd + $(CP) $(PKG_INSTALL_DIR)/usr/lib/updatedd/$(2).so* $$(1)/usr/lib/updatedd/ + endef + + $$(eval $$(call BuildPackage,$(1))) +endef + +define Package/updatedd/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/updatedd.init $(1)/etc/init.d/updatedd + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/updatedd.config $(1)/etc/config/updatedd + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/updatedd $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/updatedd + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_DATA) ./files/updatedd.hotplug $(1)/etc/hotplug.d/iface/30-updatedd +endef + +$(eval $(call BuildPackage,updatedd)) +$(eval $(call BuildPlugin,updatedd-mod-changeip,libchangeip)) +$(eval $(call BuildPlugin,updatedd-mod-dyndns,libdyndns)) +$(eval $(call BuildPlugin,updatedd-mod-eurodyndns,libeurodyndns)) +$(eval $(call BuildPlugin,updatedd-mod-hn,libhn)) +$(eval $(call BuildPlugin,updatedd-mod-noip,libnoip)) +$(eval $(call BuildPlugin,updatedd-mod-ods,libods)) +$(eval $(call BuildPlugin,updatedd-mod-ovh,libovh)) +$(eval $(call BuildPlugin,updatedd-mod-regfish,libregfish)) +$(eval $(call BuildPlugin,updatedd-mod-tzo,libtzo)) +$(eval $(call BuildPlugin,updatedd-mod-zoneedit,libzoneedit)) diff --git a/net/updatedd/files/updatedd.config b/net/updatedd/files/updatedd.config new file mode 100644 index 0000000..f2e9e91 --- /dev/null +++ b/net/updatedd/files/updatedd.config @@ -0,0 +1,6 @@ +config updatedd + option service '' + option username '' + option password '' + option host '' + option update '0' diff --git a/net/updatedd/files/updatedd.hotplug b/net/updatedd/files/updatedd.hotplug new file mode 100644 index 0000000..a918025 --- /dev/null +++ b/net/updatedd/files/updatedd.hotplug @@ -0,0 +1,14 @@ +NAME=updatedd +CONFIG=/etc/config/$NAME +COMMAND=/usr/bin/$NAME + +[ "$ACTION" = "ifup" ] && { + [ -x $COMMAND ] && [ -r $CONFIG ] && { + . /lib/functions/network.sh + + local device + network_get_device device wan && { + /etc/init.d/updatedd restart + } + } & +} diff --git a/net/updatedd/files/updatedd.init b/net/updatedd/files/updatedd.init new file mode 100644 index 0000000..5ae4545 --- /dev/null +++ b/net/updatedd/files/updatedd.init @@ -0,0 +1,38 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +start_instance () { + local section="$1" + config_get service "$section" 'service' + config_get username "$section" 'username' + config_get password "$section" 'password' + config_get host "$section" 'host' + config_get update "$section" 'update' + + [ "$update" = 1 ] && { + if [ "$service" = "dyndns" ]; then + wget http://checkip.dyndns.org -O /tmp/updatedd_ip_check + current_ip=`cat /tmp/updatedd_ip_check |cut -d':' -f2|cut -d'<' -f1 |cut -d' ' -f2` + rm /tmp/updatedd_ip_check + old_ip=`nslookup "$host" |grep "$host" -A 1 |grep Address |cut -d' ' -f3` + if [ "$current_ip" = "$old_ip" ]; then + echo "Preventing abusive update" + abusive=1 + fi + fi + if [ "$abusive" != "1" ]; then + service_start /usr/bin/updatedd -Y $service -- $username:$password $host + fi + } +} + +start() { + config_load 'updatedd' + config_foreach start_instance 'updatedd' +} + +stop() { + service_stop /usr/bin/updatedd +} diff --git a/net/updatedd/patches/001-service_libname.patch b/net/updatedd/patches/001-service_libname.patch new file mode 100644 index 0000000..0003a6e --- /dev/null +++ b/net/updatedd/patches/001-service_libname.patch @@ -0,0 +1,84 @@ +--- a/src/updatedd.c ++++ b/src/updatedd.c +@@ -36,7 +36,8 @@ + #include /* PATH_MAX */ + #include "updatedd.h" + +-#define PLUGIN_ENDING ".so" ++#define LIBPREFIX "lib" ++#define LIBSUFFIX ".so" + + void + print_usage(char *pname, FILE *fp) +@@ -92,23 +93,7 @@ + void + get_plugin_path(char *service, char *buffer, size_t len) + { +- FILE *pipe; +- char la_path[PATH_MAX]; +- char lib_name[256]; +- char command[1024]; +- +- (void)snprintf(la_path, PATH_MAX-1, LIBPATH "/lib%s.la", service); +- +- snprintf(command, 1023, ". %s; echo $dlname", la_path); +- if((pipe = popen(command, "r")) == NULL) +- err(PERR, "popen() failed"); +- fscanf(pipe, "%255s", lib_name); +- +- if(fclose(pipe) == EOF) +- err(PERR, "fclose() failed"); +- +- (void)memset(buffer, 0, len); +- snprintf(buffer, len-1, LIBPATH"/%s", lib_name); ++ snprintf(buffer, len-1, LIBPATH "/" LIBPREFIX "%s" LIBSUFFIX, service); + } + + void * +@@ -139,6 +124,7 @@ + + } + ++#define SERVICE_MAXLEN 20 + int + get_service(DIR *dir, char *buf, size_t size) + { +@@ -146,26 +132,19 @@ + struct dirent *dir_info; + + while( (dir_info = readdir(dir)) ) { ++ char *p = dir_info->d_name; + int n; +- char *ptr = strstr(dir_info->d_name, ".la"); +- +- if(strlen(dir_info->d_name) < 6) +- continue; +- +- if(ptr != NULL) { +- if(!dir_info->d_name[0] == 'l') +- continue; +- if(!dir_info->d_name[1] == 'i') +- continue; +- if(!dir_info->d_name[2] == 'b') +- continue; +- +- for(n = 0; dir_info->d_name+n+3 != ptr; n++) { +- buf[n] = dir_info->d_name[n+3]; +- } +- buf[n] = '\0'; +- return 1; +- } ++ if( strlen(p) <= strlen(LIBPREFIX LIBSUFFIX) ) ++ continue; ++ if( strstr(p, LIBPREFIX) != p ) ++ continue; ++ p += strlen(LIBPREFIX); ++ n = strlen(p) - strlen(LIBSUFFIX); ++ if( strstr(p + n, LIBSUFFIX) != p + n ) ++ continue; ++ p[n] = 0; ++ strncpy(buf, p, size); ++ return 1; + } + + return 0; diff --git a/net/updatedd/patches/002-ovh-dyndnshost.patch b/net/updatedd/patches/002-ovh-dyndnshost.patch new file mode 100644 index 0000000..0e617d9 --- /dev/null +++ b/net/updatedd/patches/002-ovh-dyndnshost.patch @@ -0,0 +1,12 @@ +diff -pruN updatedd-2.6-ori/src/plugins/libovh.h updatedd-2.6/src/plugins/libovh.h +--- updatedd-2.6-ori/src/plugins/libovh.h 2006-09-07 22:32:59.000000000 +0200 ++++ updatedd-2.6/src/plugins/libovh.h 2008-06-08 13:12:17.000000000 +0200 +@@ -21,7 +21,7 @@ + + #include + +-#define DYNDNSHOST "ovh.com" ++#define DYNDNSHOST "www.ovh.com" + #define PORT 80 + + #define BUFSIZE 512 diff --git a/net/updatedd/patches/003-zoneedit-url-fix.patch b/net/updatedd/patches/003-zoneedit-url-fix.patch new file mode 100644 index 0000000..9e40001 --- /dev/null +++ b/net/updatedd/patches/003-zoneedit-url-fix.patch @@ -0,0 +1,11 @@ +--- a/src/plugins/libzoneedit.h ++++ b/src/plugins/libzoneedit.h +@@ -21,7 +21,7 @@ + + #include + +-#define DYNDNSHOST "www.zoneedit.com" ++#define DYNDNSHOST "dynamic.zoneedit.com" + #define PORT 80 + + #define BUFSIZE 4096 diff --git a/net/updatedd/patches/004-fix_liberty_dep.patch b/net/updatedd/patches/004-fix_liberty_dep.patch new file mode 100644 index 0000000..9085a32 --- /dev/null +++ b/net/updatedd/patches/004-fix_liberty_dep.patch @@ -0,0 +1,122 @@ +diff -Nur updatedd-2.6/config.h.in updatedd-2.6.lx2/config.h.in +--- updatedd-2.6/config.h.in 2006-09-15 18:19:37.000000000 +0400 ++++ updatedd-2.6.lx2/config.h.in 2009-11-25 11:00:14.000000000 +0300 +@@ -36,9 +36,6 @@ + /* Define to 1 if you have the `dl' library (-ldl). */ + #undef HAVE_LIBDL + +-/* Define to 1 if you have the `iberty' library (-liberty). */ +-#undef HAVE_LIBIBERTY +- + /* Define to 1 if you have the `nsl' library (-lnsl). */ + #undef HAVE_LIBNSL + +diff -Nur updatedd-2.6/configure updatedd-2.6.lx2/configure +--- updatedd-2.6/configure 2006-09-15 18:19:10.000000000 +0400 ++++ updatedd-2.6.lx2/configure 2009-11-25 11:02:02.000000000 +0300 +@@ -20596,93 +20596,6 @@ + fi + + +-{ echo "$as_me:$LINENO: checking for vasprintf in -liberty" >&5 +-echo $ECHO_N "checking for vasprintf in -liberty... $ECHO_C" >&6; } +-if test "${ac_cv_lib_iberty_vasprintf+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- ac_check_lib_save_LIBS=$LIBS +-LIBS="-liberty $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-/* Override any GCC internal prototype to avoid an error. +- Use char because int might match the return type of a GCC +- builtin and then its argument prototype would still apply. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-char vasprintf (); +-int +-main () +-{ +-return vasprintf (); +- ; +- 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 "echo \"\$as_me:$LINENO: $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 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' +- { (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") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest$ac_exeext' +- { (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") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_lib_iberty_vasprintf=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_lib_iberty_vasprintf=no +-fi +- +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-LIBS=$ac_check_lib_save_LIBS +-fi +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_iberty_vasprintf" >&5 +-echo "${ECHO_T}$ac_cv_lib_iberty_vasprintf" >&6; } +-if test $ac_cv_lib_iberty_vasprintf = yes; then +- cat >>confdefs.h <<_ACEOF +-#define HAVE_LIBIBERTY 1 +-_ACEOF +- +- LIBS="-liberty $LIBS" +- +-fi +- +- + # ------------------] GETOPT_LONG [ + + +diff -Nur updatedd-2.6/configure.ac updatedd-2.6.lx2/configure.ac +--- updatedd-2.6/configure.ac 2006-09-15 18:18:44.000000000 +0400 ++++ updatedd-2.6.lx2/configure.ac 2009-11-25 11:00:33.000000000 +0300 +@@ -74,8 +74,6 @@ + AC_CHECK_LIB([c], [dlopen]) + dnl Linux distributes dlopen() in libdl. + AC_CHECK_LIB([dl], [dlopen]) +-dnl Tru64 distributes vasprintf() in -liberty +-AC_CHECK_LIB([iberty], [vasprintf]) + + # ------------------] GETOPT_LONG [ + diff --git a/net/usbip/Makefile b/net/usbip/Makefile new file mode 100644 index 0000000..e1111b0 --- /dev/null +++ b/net/usbip/Makefile @@ -0,0 +1,105 @@ +# +# Copyright (C) 2010-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=usbip +PKG_RELEASE:=2 + +# Since kernel 2.6.39.1 userspace tools are inside the kernel tree +# Package Automatic match version in kernel +# MD5SUM is not useful kernel package already check it +PKG_VERSION:=$(shell sed -n -e '/^AC_INIT/s/.*\[\([[:digit:]\.]*\)\].*/\1/gp' $(LINUX_DIR)/drivers/staging/usbip/userspace/configure.ac) +PKG_SOURCE:= +PKG_SOURCE_URL:= +PKG_MD5SUM:=unknown +PATCH_DIR:=./patches-$(PKG_VERSION) + +define prepare_source_directory + rm -rf $(PKG_BUILD_DIR) + $(CP) $(LINUX_DIR)/drivers/staging/usbip/userspace $(PKG_BUILD_DIR) +endef +Hooks/Prepare/Pre += prepare_source_directory + +PKG_BUILD_DEPENDS:=glib2 sysfsutils +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/usbip/Common + TITLE:=USB-over-IP + URL:=http://usbip.sourceforge.net/ + DEPENDS:=@USB_SUPPORT @LINUX_3_3 + MAINTAINER:=Nuno Goncalves +endef + +define Package/usbip/Default + $(call Package/usbip/Common) + SECTION:=net + CATEGORY:=Network +endef + +define Package/usbip + $(call Package/usbip/Default) + TITLE+= (common) + DEPENDS+= +libsysfs +libwrap +kmod-usbip +endef + +define Package/usbip-client + $(call Package/usbip/Default) + TITLE+= (client) + DEPENDS+= usbip +glib2 +kmod-usbip-client +endef + +define Package/usbip-server + $(call Package/usbip/Default) + TITLE+= (server) + DEPENDS+= usbip usbip-client +glib2 +kmod-usbip-server +endef + +CONFIGURE_PATH:=. +MAKE_PATH:=. +LIBTOOL_PATHS:=. +MAKE_FLAGS+=CFLAGS="-Wno-implicit-function-declaration" + +define Build/Configure + (cd $(PKG_BUILD_DIR); ./autogen.sh ); + $(call Build/Configure/Default) +endef + +CFLAGS+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" + +define Download/usb.ids + URL:=http://www.linux-usb.org/ + FILE:=usb.ids + MD5SUM:= +endef + +define Package/usbip/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/share/hwdata + $(CP) $(DL_DIR)/usb.ids $(1)/usr/share/hwdata/ +endef + +define Package/usbip-client/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbip $(1)/usr/sbin/ +endef + +define Package/usbip-server/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbipd $(1)/usr/sbin/ +endef + +$(eval $(call Download,usb.ids)) +$(eval $(call BuildPackage,usbip)) +$(eval $(call BuildPackage,usbip-client)) +$(eval $(call BuildPackage,usbip-server)) diff --git a/net/usbip/patches/001-upstream_svn_r99.diff b/net/usbip/patches/001-upstream_svn_r99.diff new file mode 100644 index 0000000..aa193e1 --- /dev/null +++ b/net/usbip/patches/001-upstream_svn_r99.diff @@ -0,0 +1,11 @@ +Index: trunk/src/cmd/Makefile.am +=================================================================== +--- trunk/src/cmd/Makefile.am (revision 98) ++++ trunk/src/cmd/Makefile.am (revision 99) +@@ -17,5 +17,5 @@ + INCLUDES = -I$(top_srcdir)/lib + LDADD = ../lib/libusbip.la @PACKAGE_LIBS@ + EXTRA_CFLAGS = @EXTRA_CFLAGS@ +-AM_CFLAGS = -Wall -W -Wstrict-prototypes -std=gnu99 $(EXTRA_CFLAGS) @PACKAGE_CFLAGS@ ++AM_CFLAGS = -Wall -W -Wstrict-prototypes -std=gnu99 $(EXTRA_CFLAGS) @PACKAGE_CFLAGS@ -DUSBIDS_FILE='"@USBIDS_DIR@/usb.ids"' + diff --git a/net/usbip/patches/002-upstream_svn_r152.patch b/net/usbip/patches/002-upstream_svn_r152.patch new file mode 100644 index 0000000..e7135a6 --- /dev/null +++ b/net/usbip/patches/002-upstream_svn_r152.patch @@ -0,0 +1,229 @@ +--- a/drivers/head/stub_dev.c ++++ b/drivers/head/stub_dev.c +@@ -398,7 +398,11 @@ static int stub_probe(struct usb_interfa + { + struct usb_device *udev = interface_to_usbdev(interface); + struct stub_device *sdev = NULL; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) + char *udev_busid = interface->dev.parent->bus_id; ++#else ++ char *udev_busid = dev_name(interface->dev.parent); ++#endif + int err = 0; + + udbg("Enter\n"); +--- a/drivers/head/stub_main.c ++++ b/drivers/head/stub_main.c +@@ -252,18 +252,17 @@ static int __init usb_stub_init(void) + return -ENOMEM; + } + ++ info(DRIVER_DESC "" DRIVER_VERSION); ++ ++ memset(busid_table, 0, sizeof(busid_table)); ++ spin_lock_init(&busid_table_lock); ++ + ret = usb_register(&stub_driver); + if (ret) { + uerr("usb_register failed %d\n", ret); + return ret; + } + +- +- info(DRIVER_DESC "" DRIVER_VERSION); +- +- memset(busid_table, 0, sizeof(busid_table)); +- spin_lock_init(&busid_table_lock); +- + ret = driver_create_file(&stub_driver.drvwrap.driver, &driver_attr_match_busid); + + if (ret) { +--- a/drivers/head/stub_rx.c ++++ b/drivers/head/stub_rx.c +@@ -159,7 +159,11 @@ static int tweak_set_configuration_cmd(s + * A user may need to set a special configuration value before + * exporting the device. + */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) + uinfo("set_configuration (%d) to %s\n", config, urb->dev->dev.bus_id); ++#else ++ uinfo("set_configuration (%d) to %s\n", config, dev_name(&urb->dev->dev)); ++#endif + uinfo("but, skip!\n"); + + return 0; +@@ -177,7 +181,11 @@ static int tweak_reset_device_cmd(struct + value = le16_to_cpu(req->wValue); + index = le16_to_cpu(req->wIndex); + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) + uinfo("reset_device (port %d) to %s\n", index, urb->dev->dev.bus_id); ++#else ++ uinfo("reset_device (port %d) to %s\n", index, dev_name(&urb->dev->dev)); ++#endif + + /* all interfaces should be owned by usbip driver, so just reset it. */ + ret = usb_lock_device_for_reset(urb->dev, NULL); +@@ -187,7 +195,11 @@ static int tweak_reset_device_cmd(struct + } + + /* try to reset the device */ +- ret = usb_reset_composite_device(urb->dev, NULL); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) ++ ret = usb_reset_composite_device(urb->dev, NULL); ++#else ++ ret = usb_reset_device(urb->dev); ++#endif + if (ret < 0) + uerr("device reset\n"); + +--- a/drivers/head/usbip_common.c ++++ b/drivers/head/usbip_common.c +@@ -55,10 +55,7 @@ static ssize_t show_flag(struct device * + static ssize_t store_flag(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) + { +- unsigned long flag; +- +- sscanf(buf, "%lx", &flag); +- usbip_debug_flag = flag; ++ sscanf(buf, "%lx", &usbip_debug_flag); + + return count; + } +@@ -390,7 +387,7 @@ int usbip_thread(void *param) + unlock_kernel(); + + /* srv.rb must wait for rx_thread starting */ +- complete(&ut->thread_done); ++ complete(&ut->thread_started); + + /* start of while loop */ + ut->loop_ops(ut); +@@ -403,15 +400,21 @@ int usbip_thread(void *param) + + void usbip_start_threads(struct usbip_device *ud) + { ++ + /* + * threads are invoked per one device (per one connection). + */ ++ INIT_COMPLETION(ud->tcp_rx.thread_started); ++ INIT_COMPLETION(ud->tcp_tx.thread_started); ++ INIT_COMPLETION(ud->tcp_rx.thread_done); ++ INIT_COMPLETION(ud->tcp_tx.thread_done); ++ + kernel_thread((int(*)(void *))usbip_thread, (void *)&ud->tcp_rx, 0); + kernel_thread((int(*)(void *))usbip_thread, (void *)&ud->tcp_tx, 0); + + /* confirm threads are starting */ +- wait_for_completion(&ud->tcp_rx.thread_done); +- wait_for_completion(&ud->tcp_tx.thread_done); ++ wait_for_completion(&ud->tcp_rx.thread_started); ++ wait_for_completion(&ud->tcp_tx.thread_started); + } + EXPORT_SYMBOL(usbip_start_threads); + +@@ -436,6 +439,7 @@ void usbip_task_init(struct usbip_task * + void (*loop_ops)(struct usbip_task *)) + { + ut->thread = NULL; ++ init_completion(&ut->thread_started); + init_completion(&ut->thread_done); + ut->name = name; + ut->loop_ops = loop_ops; +--- a/drivers/head/usbip_event.c ++++ b/drivers/head/usbip_event.c +@@ -38,7 +38,7 @@ void usbip_start_eh(struct usbip_device + + kernel_thread((int(*)(void *)) usbip_thread, (void *) eh, 0); + +- wait_for_completion(&eh->thread_done); ++ wait_for_completion(&eh->thread_started); + } + EXPORT_SYMBOL(usbip_start_eh); + +--- a/drivers/head/vhci_hcd.c ++++ b/drivers/head/vhci_hcd.c +@@ -58,7 +58,7 @@ static void vhci_stop(struct usb_hcd *hc + static int vhci_get_frame_number(struct usb_hcd *hcd); + + static const char driver_name[] = "vhci_hcd"; +-static const char driver_desc[] = "USB/IP Virtual Host Contoroller"; ++static const char driver_desc[] = "USB/IP Virtual Host Controller"; + + + +@@ -416,14 +416,6 @@ static int vhci_hub_control(struct usb_h + case USB_PORT_FEAT_SUSPEND: + dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_SUSPEND\n"); + uerr(" not yet\n"); +-#if 0 +- dum->port_status[rhport] |= (1 << USB_PORT_FEAT_SUSPEND); +- if (dum->driver->suspend) { +- spin_unlock (&dum->lock); +- dum->driver->suspend (&dum->gadget); +- spin_lock (&dum->lock); +- } +-#endif + break; + case USB_PORT_FEAT_RESET: + dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_RESET\n"); +@@ -432,12 +424,6 @@ static int vhci_hub_control(struct usb_h + dum->port_status[rhport] &= ~(USB_PORT_STAT_ENABLE + | USB_PORT_STAT_LOW_SPEED + | USB_PORT_STAT_HIGH_SPEED); +-#if 0 +- if (dum->driver) { +- dev_dbg (hardware, "disconnect\n"); +- stop_activity (dum, dum->driver); +- } +-#endif + + /* FIXME test that code path! */ + } +@@ -1060,7 +1046,7 @@ static int vhci_hcd_probe(struct platfor + struct usb_hcd *hcd; + int ret; + +- uinfo("proving...\n"); ++ uinfo("probing...\n"); + + dbg_vhci_hc("name %s id %d\n", pdev->name, pdev->id); + +@@ -1076,7 +1062,11 @@ static int vhci_hcd_probe(struct platfor + * Allocate and initialize hcd. + * Our private data is also allocated automatically. + */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) + hcd = usb_create_hcd(&vhci_hc_driver, &pdev->dev, pdev->dev.bus_id); ++#else ++ hcd = usb_create_hcd(&vhci_hc_driver, &pdev->dev, dev_name(&pdev->dev)); ++#endif + if (!hcd) { + uerr("create hcd failed\n"); + return -ENOMEM; +--- a/drivers/head/vhci_sysfs.c ++++ b/drivers/head/vhci_sysfs.c +@@ -123,7 +123,11 @@ static ssize_t show_status(struct device + out += sprintf(out, "%03u %08x ", + vdev->speed, vdev->devid); + out += sprintf(out, "%16p ", vdev->ud.tcp_socket); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) + out += sprintf(out, "%s", vdev->udev->dev.bus_id); ++#else ++ out += sprintf(out, "%s", dev_name(&vdev->udev->dev)); ++#endif + + } else + out += sprintf(out, "000 000 000 0000000000000000 0-0"); +--- a/drivers/head/usbip_common.h ++++ b/drivers/head/usbip_common.h +@@ -300,6 +300,7 @@ struct usbip_device; + + struct usbip_task { + struct task_struct *thread; ++ struct completion thread_started; + struct completion thread_done; + char *name; + void (*loop_ops)(struct usbip_task *); diff --git a/net/uucp/Makefile b/net/uucp/Makefile new file mode 100644 index 0000000..73a6cd7 --- /dev/null +++ b/net/uucp/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=uucp +PKG_VERSION:=1.07 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/u/uucp/ +PKG_MD5SUM:=64c54d43787339a7cced48390eb3e1d0 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/uucp + SECTION:=net + CATEGORY:=Network + SUBMENU:=File Transfer + TITLE:=copy files to or from another (usually *nix) system + URL:=http://packages.debian.org/etch/uucp +endef + +define Package/uucp/description + UUCP is used to transfer mail, news and random files between systems which are not + connected by more modern networks. The communication can be made via modems, direct + (hard-wired) serial connections or via an IP connection. +endef + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared + +define Package/uucp/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/{cu,tstuu,uu{chk,cico,conv,cp,log,name,pick,sched,stat,to,x,xqt}} $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,uucp)) diff --git a/net/vblade/Makefile b/net/vblade/Makefile new file mode 100644 index 0000000..ca5f371 --- /dev/null +++ b/net/vblade/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=vblade +PKG_VERSION:=20 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/aoetools/vblade +PKG_MD5SUM:=3c80e4a6bc7d66ae0c235b88cb44bd59 + +include $(INCLUDE_DIR)/package.mk + +define Package/vblade + SECTION:=net + CATEGORY:=Network + TITLE:=Vblade AoE Target + URL:=http://aoetools.sourceforge.net/ +endef + +define Package/$(PKG_NAME)/conffiles +/etc/config/vblade +endef + + +define Package/vblade/description + The vblade is the virtual EtherDrive (R) blade, a program that makes a + seekable file available over an ethernet local area network (LAN) via + the ATA over Ethernet (AoE) protocol. +endef + +CONFIGURE_ARGS += NPERSHELF=16 + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/vblade $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/vbladed $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/net/vblade/files/vblade.config b/net/vblade/files/vblade.config new file mode 100644 index 0000000..455988a --- /dev/null +++ b/net/vblade/files/vblade.config @@ -0,0 +1,14 @@ +#config vblade +# option shelf '1' +# option slot '1' +# option netif 'eth0' +# option device '/dev/sda' +# option options '-r' +# +#config vblade +# option shelf '1' +# option slot '2' +# option netif 'eth0' +# option device '/dev/sdb' +# option options '-r' +# diff --git a/net/vblade/files/vblade.init b/net/vblade/files/vblade.init new file mode 100644 index 0000000..afed46b --- /dev/null +++ b/net/vblade/files/vblade.init @@ -0,0 +1,24 @@ +#!/bin/sh /etc/rc.common +# Startup init script for vblade for Openwrt +START=95 +STOP=10 + +start_service() { + local section="$1" + config_get shelf "$section" shelf + config_get slot "$section" slot + config_get netif "$section" netif + config_get device "$section" device + config_get options "$section" options + vbladed $options $shelf $slot $netif $device +} + +start() { + config_load vblade + config_foreach start_service vblade +} + +stop() { + /usr/bin/pkill -f /usr/sbin/vblade +} + diff --git a/net/veth/Makefile b/net/veth/Makefile new file mode 100644 index 0000000..e2c89e2 --- /dev/null +++ b/net/veth/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=veth +PKG_VERSION:=1.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://w3.epca.com.ve/projects/veth +PKG_MD5SUM:=11536388d9c76552a4b736638a458361 + +include $(INCLUDE_DIR)/package.mk + +define Package/veth + SECTION:=net + CATEGORY:=Network + DEPENDS:=+kmod-tun + TITLE:=Virtual Ethernet Device for Linux + URL:=http://w3.epca.com.ve/projects/veth/ +endef + +define Package/veth/description + VETH is a daemon that virtualizes a ethernet card in Linux. + The virtualization is done via Universal TUN/TAP Driver. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/veth \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" +endef + +define Package/veth/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/veth/vethd $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,veth)) diff --git a/net/veth/patches/100-veth-makefile-cflags.patch b/net/veth/patches/100-veth-makefile-cflags.patch new file mode 100644 index 0000000..c9a1d74 --- /dev/null +++ b/net/veth/patches/100-veth-makefile-cflags.patch @@ -0,0 +1,14 @@ +Index: veth-1.0/veth/Makefile +=================================================================== +--- veth-1.0.orig/veth/Makefile 2008-10-29 16:11:33.000000000 +0100 ++++ veth-1.0/veth/Makefile 2008-10-31 18:01:33.000000000 +0100 +@@ -4,8 +4,7 @@ + rm -f vethd + + vethd: vethd.c +- $(CC) -O6 -Wall -pedantic -o vethd vethd.c +- strip vethd ++ $(CC) $(CFLAGS) -o vethd vethd.c + + install: all + install -s -m 750 ./vethd $(INSTALL_DIR) diff --git a/net/veth/patches/200-drop-multicast.patch b/net/veth/patches/200-drop-multicast.patch new file mode 100644 index 0000000..438b0d3 --- /dev/null +++ b/net/veth/patches/200-drop-multicast.patch @@ -0,0 +1,32 @@ +diff -pNur veth-1.0/veth/vethd.c veth-1.0/veth/vethd.c +--- veth-1.0/veth/vethd.c 2008-11-14 10:59:50.000000000 +0100 ++++ veth-1.0/veth/vethd.c 2008-11-24 11:24:45.000000000 +0100 +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + + #define max(a,b) ((a)>(b) ? (a):(b)) + +@@ -223,6 +224,7 @@ int main(int argc, char **argv) + + int vfd, nfd, leidos, opc, foreground = 0; + fd_set fds; ++ struct ether_header const* const ether_hdr = (struct ether_header const *)buffer; + + set_locale(); + show_copyright(); +@@ -356,7 +358,11 @@ int main(int argc, char **argv) + perror("Error reading from ethernet interface"); + return 2; + } +- write(vfd, buffer, leidos); ++ /* drop multicast and ppp session */ ++ if (!(ether_hdr->ether_dhost[0] == 0x01) ++ && (ether_hdr->ether_type != htons(ETH_P_PPP_SES))) { ++ write(vfd, buffer, leidos); ++ } + } + FD_ZERO(&fds); + FD_SET(nfd, &fds); diff --git a/net/vgp/Makefile b/net/vgp/Makefile new file mode 100644 index 0000000..46f3c85 --- /dev/null +++ b/net/vgp/Makefile @@ -0,0 +1,44 @@ +# +# 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:=vgp +PKG_VERSION:=0.2.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://vgpd.freaknet.org/files/ +PKG_MD5SUM:=b8c25b5dfcb944f78bbc584be9c230c7 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/vgp + SECTION:=net + CATEGORY:=Network + TITLE:=A daemon working like Cisco(c) HSRP + URL:=http://vgpd.freaknet.org/ +endef + +define Package/vgp/description + VGP (Virtual Gateway Protocol)is a very simple protocol able to + work in a way similar to Cisco(c) HSRP. It implements the idea + of Virtual Gateway to provide fault tollerance (and load + balancing) on your net. Each client on your net has as its + default gateway set to the virtual gateway and not the real router. +endef + +# uses GNU configure + +define Package/vgp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vgpd $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,vgp)) diff --git a/net/vnc-reflector/Makefile b/net/vnc-reflector/Makefile new file mode 100644 index 0000000..f6538c8 --- /dev/null +++ b/net/vnc-reflector/Makefile @@ -0,0 +1,51 @@ +# +# 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:=vnc-reflector +PKG_VERSION:=1.2.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=vnc_reflector-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/vnc-reflector +PKG_MD5SUM:=c3f88bc62f228b335c25c07f9744ab0c + +PKG_BUILD_DIR:=$(BUILD_DIR)/vnc_reflector + +include $(INCLUDE_DIR)/package.mk + +define Package/vnc-reflector + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libjpeg +zlib + TITLE:=VNC proxy for multiple clients + URL:=http://sourceforge.net/projects/vnc-reflector +endef + +define Package/vnc-reflector/description + VNC Reflector is a specialized VNC server which acts as + a proxy sitting between real VNC server (a host) and a + number of VNC clients. It was designed to work efficiently + with large number of clients. +endef + +define Build/Compile + $(call Build/Compile/Default, \ + CC="$(TARGET_CC)" \ + OFLAGS="$(TARGET_CFLAGS)" \ + STAGING_DIR="$(STAGING_DIR)" \ + default \ + ) +endef + +define Package/vnc-reflector/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/vncreflector $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,vnc-reflector)) diff --git a/net/vnc-reflector/patches/001-honor_include_lib_path.patch b/net/vnc-reflector/patches/001-honor_include_lib_path.patch new file mode 100644 index 0000000..fb409ac --- /dev/null +++ b/net/vnc-reflector/patches/001-honor_include_lib_path.patch @@ -0,0 +1,25 @@ +--- vnc_reflector/Makefile.orig 2005-12-14 01:25:53.000000000 +0100 ++++ vnc_reflector/Makefile 2005-12-14 01:28:05.000000000 +0100 +@@ -14,10 +14,11 @@ + # + # Variables you might want to edit: CFLAGS, CONFFLAGS + +-IFLAGS = -I. ++IFLAGS = -I. -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include ++OFLAGS = -O2 + + # Production +-CFLAGS = -O2 $(IFLAGS) ++CFLAGS = $(OFLAGS) $(IFLAGS) + # Debug (strict) + #CFLAGS = -g -pedantic -Wall $(IFLAGS) + # Debug (profiling) +@@ -29,7 +30,7 @@ + CONFFLAGS = -DUSE_POLL + + # Link with zlib and JPEG libraries +-LDFLAGS = -L/usr/local/lib -lz -ljpeg ++LDFLAGS = -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -lz -ljpeg + + PROG = vncreflector + diff --git a/net/vncrepeater/Makefile b/net/vncrepeater/Makefile new file mode 100644 index 0000000..e1f89ff --- /dev/null +++ b/net/vncrepeater/Makefile @@ -0,0 +1,59 @@ +# +# 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:=vncrepeater +PKG_VERSION:=0.12 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.rit.edu/~reh5586/openwrt/packages/vncrepeater/src +PKG_MD5SUM:=5951740a8a103d7d9668558b3639c6c4 + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/vncrepeater + SECTION:=net + CATEGORY:=Network + DEPENDS:=$(CXX_DEPENDS) + TITLE:=UltraVNC repeater for Linux + URL:=http://www.uvnc.com/addons/repeater.html +endef + +define Package/vncrepeater/conffiles +/etc/vncrepeater.conf +endef + +define Package/vncrepeater/description + Viewer can be behind Nat router or directly connected to the internet + instead of forwarding serveral ports, you only need to forward 1 port. + If the PC that runs the Repeater has access to the local DNS server, + you can use your local DNS names instead of 10.10.10.12. + This could be handy when you have a dynamic DHCP server allocating + ip adresses for your PC. +endef + +define Build/Compile + $(call Build/Compile/Default, \ + CC="$(TARGET_CXX)" \ + CFLAGS="$(TARGET_CPPFLAGS) -fno-rtti" \ + repeater \ + ) +endef + +define Package/vncrepeater/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc + $(CP) $(PKG_BUILD_DIR)/repeater $(1)/usr/sbin/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_BUILD_DIR)/uvncrepeater.ini $(1)/etc/vncrepeater.conf +endef + +$(eval $(call BuildPackage,vncrepeater)) diff --git a/net/vncrepeater/patches/001-uclibcxx_linking.patch b/net/vncrepeater/patches/001-uclibcxx_linking.patch new file mode 100644 index 0000000..a9d05bc --- /dev/null +++ b/net/vncrepeater/patches/001-uclibcxx_linking.patch @@ -0,0 +1,32 @@ +diff -urN vncrepeater-0.12/Makefile vncrepeater-0.12.new/Makefile +--- vncrepeater-0.12/Makefile 2006-03-31 07:40:14.000000000 +0200 ++++ vncrepeater-0.12.new/Makefile 2006-04-11 10:26:06.345879104 +0200 +@@ -1,21 +1,21 @@ +-CFLAGS=-Wall ++CFLAGS=-Wall + repeater: repeater.o repeaterproc.o openbsd_stringfuncs.o iniparser.o readini.o +- g++ $(CFLAGS) -o repeater repeater.o repeaterproc.o openbsd_stringfuncs.o iniparser.o readini.o ++ $(CC) $(CFLAGS) -o repeater repeater.o repeaterproc.o openbsd_stringfuncs.o iniparser.o readini.o $(LDFLAGS) + + repeater.o: repeater.cpp +- g++ $(CFLAGS) -c repeater.cpp ++ $(CC) $(CFLAGS) -c repeater.cpp + + repeaterproc.o: repeaterproc.cpp +- g++ $(CFLAGS) -c repeaterproc.cpp ++ $(CC) $(CFLAGS) -c repeaterproc.cpp + + openbsd_stringfuncs.o: openbsd_stringfuncs.cpp +- g++ $(CFLAGS) -c openbsd_stringfuncs.cpp ++ $(CC) $(CFLAGS) -c openbsd_stringfuncs.cpp + + iniparser.o: iniparser.cpp +- g++ $(CFLAGS) -c iniparser.cpp ++ $(CC) $(CFLAGS) -c iniparser.cpp + + readini.o: readini.cpp +- g++ $(CFLAGS) -c readini.cpp ++ $(CC) $(CFLAGS) -c readini.cpp + + clean: + rm -f *.o repeater diff --git a/net/vnstat/Makefile b/net/vnstat/Makefile new file mode 100644 index 0000000..577a314 --- /dev/null +++ b/net/vnstat/Makefile @@ -0,0 +1,108 @@ +# +# Copyright (C) 2006-2011 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:=vnstat +PKG_VERSION:=1.11 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://humdi.net/vnstat +PKG_MD5SUM:=a5a113f9176cd61fb954f2ba297f5fdb + +PKG_INSTALL:=1 + +PKG_BUILD_DEPENDS:=libgd +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/vnstat/Default + SECTION:=net + CATEGORY:=Network + URL:=http://humdi.net/vnstat/ +endef + +define Package/vnstat +$(call Package/vnstat/Default) + TITLE:=Console-based network traffic monitor +endef + +define Package/vnstat/description + vnStat is a network traffic monitor for Linux that keeps a log of daily + network traffic for the selected interface(s). vnStat isn't a packet + sniffer. The traffic information is analyzed from the /proc -filesystem, + so vnStat can be used without root permissions. +endef + +define Package/vnstati +$(call Package/vnstat/Default) + DEPENDS+=vnstat +libgd + TITLE:=PNG image output support for vnStat +endef + +define Package/vnstati/description + The purpose of vnstati is to provide image output support for statistics + collected using vnstat(1). However, the image file format is limited to + png. All basic outputs of vnStat are supported excluding live traffic + features. The image can be outputted either to a file or to standard + output. +endef + +define Package/vnstat/conffiles +/etc/vnstat.conf +/etc/config/vnstat +endef + +define Build/Compile/vnstat + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" +endef + +define Build/Compile/vnstati + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \ + LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath-link,$(STAGING_DIR)/usr/lib" \ + all +endef + +define Build/Compile +$(call Build/Compile/vnstat) +$(call Build/Compile/vnstati) +endef + +define Package/vnstat/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/vnstat $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/vnstatd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/vnstat.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/vnstat.config $(1)/etc/config/vnstat + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/vnstat.init $(1)/etc/init.d/vnstat + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/vnstat.defaults $(1)/etc/uci-defaults/vnstat +endef + +define Package/vnstati/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/vnstati $(1)/usr/bin/ +endef + +define Package/vnstat/postinst +#!/bin/sh +[ -n "$${IPKG_INSTROOT}" ] || (. /etc/uci-defaults/vnstat) && rm -f /etc/uci-defaults/vnstat +exit 0 +endef + +$(eval $(call BuildPackage,vnstat)) +$(eval $(call BuildPackage,vnstati)) diff --git a/net/vnstat/files/vnstat.config b/net/vnstat/files/vnstat.config new file mode 100644 index 0000000..9da71ed --- /dev/null +++ b/net/vnstat/files/vnstat.config @@ -0,0 +1,5 @@ +config vnstat + list interface br-lan +# list interface eth0.1 +# option remote http://example.org/vnstat/ +# option symlink /www/vnstat diff --git a/net/vnstat/files/vnstat.defaults b/net/vnstat/files/vnstat.defaults new file mode 100644 index 0000000..a2d353f --- /dev/null +++ b/net/vnstat/files/vnstat.defaults @@ -0,0 +1,12 @@ +#!/bin/sh + +wan="$(uci -P/var/state get network.wan.ifname)" + +if [ -n "$wan" ]; then + uci -q batch <<-EOF >/dev/null + add_list vnstat.@vnstat[-1].interface=$wan + commit vnstat + EOF +fi + +exit 0 diff --git a/net/vnstat/files/vnstat.init b/net/vnstat/files/vnstat.init new file mode 100644 index 0000000..fab1f34 --- /dev/null +++ b/net/vnstat/files/vnstat.init @@ -0,0 +1,77 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2011 OpenWrt.org + +START=99 + +vnstat_option() { + sed -ne "s/^[[:space:]]*$1[[:space:]]*['\"]\([^'\"]*\)['\"].*/\1/p" \ + /etc/vnstat.conf +} + +start() { + local lib="$(vnstat_option DatabaseDir)" + local pid="$(vnstat_option PidFile)" + + [ -n "$lib" ] || { + echo "Error: No DatabaseDir set in vnstat.conf" >&2 + exit 1 + } + + [ -n "$pid" ] || { + echo "Error: No PidFile set in vnstat.conf" >&2 + exit 1 + } + + mkdir -p "$lib" + + init_ifaces() { + local cfg="$1" + local url lnk + + init_iface() { + local ifn="$1" + + [ -n "$url" ] && { + local try=0 + local max=3 + local hostname="$(cat /proc/sys/kernel/hostname)" + + while [ $((++try)) -le $max ]; do + if wget -q -O "$lib/$ifn" "$url/${hostname}_$ifn" 2>/dev/null && [ -e "$lib/$ifn" ]; then + logger -t "vnstat" "Downloaded backup for database $ifn" + break + else + logger -t "vnstat" "Download try $try/$max for database $ifn failed" + sleep 30 + fi + done + } + + /usr/bin/vnstat -u -i "$ifn" >/dev/null + + [ -n "$lnk" ] && { + mkdir -p "$lnk" + [ -L "$lnk/$ifn" ] || ln -s "$lib/$ifn" "$lnk/$ifn" + } + } + + config_get url "$cfg" remote + config_get lnk "$cfg" symlink + config_list_foreach "$cfg" interface init_iface + + return 1 + } + + config_load vnstat + config_foreach init_ifaces vnstat + + /usr/sbin/vnstatd -d +} + +stop() { + local pid="$(vnstat_option PidFile)" + [ -n "$pid" ] && { + service_kill vnstatd "$pid" + rm -f "$pid" + } +} diff --git a/net/vnstat/patches/001-conf.patch b/net/vnstat/patches/001-conf.patch new file mode 100644 index 0000000..d41ef00 --- /dev/null +++ b/net/vnstat/patches/001-conf.patch @@ -0,0 +1,19 @@ +--- a/cfg/vnstat.conf ++++ b/cfg/vnstat.conf +@@ -72,13 +72,13 @@ TrafficlessDays 1 + ## + + # how often (in seconds) interface data is updated +-UpdateInterval 30 ++UpdateInterval 60 + + # how often (in seconds) interface status changes are checked +-PollInterval 5 ++PollInterval 30 + + # how often (in minutes) data is saved to file +-SaveInterval 5 ++SaveInterval 30 + + # how often (in minutes) data is saved when all interface are offline + OfflineSaveInterval 30 diff --git a/net/vnstat/patches/002-no_install_strip.patch b/net/vnstat/patches/002-no_install_strip.patch new file mode 100644 index 0000000..2a0ca85 --- /dev/null +++ b/net/vnstat/patches/002-no_install_strip.patch @@ -0,0 +1,35 @@ +--- a/Makefile ++++ b/Makefile +@@ -54,11 +54,11 @@ install: + + # install everything else + install -d -m 755 $(BIN) $(SBIN) $(MAN)/man1 $(MAN)/man5 $(DESTDIR)/var/lib/vnstat +- install -s -m 755 src/vnstat $(BIN) +- install -s -m 755 src/vnstatd $(SBIN) ++ install -m 755 src/vnstat $(BIN) ++ install -m 755 src/vnstatd $(SBIN) + @if [ -f "src/vnstati" ]; \ +- then echo install -s -m 755 src/vnstati $(BIN); \ +- install -s -m 755 src/vnstati $(BIN); \ ++ then echo install -m 755 src/vnstati $(BIN); \ ++ install -m 755 src/vnstati $(BIN); \ + fi + + # update man pages, gzip it if previous version was done so +@@ -127,12 +127,12 @@ bsdinstall: + + # install binaries + install -d -m 755 $(DESTDIR)/var/db/vnstat +- install -s -m 755 src/vnstat $(BIN_BSD) +- install -s -m 755 src/vnstatd $(SBIN_BSD) ++ install -m 755 src/vnstat $(BIN_BSD) ++ install -m 755 src/vnstatd $(SBIN_BSD) + + @if [ -f "src/vnstati" ]; \ +- then echo install -s -m 755 src/vnstati $(BIN_BSD); \ +- install -s -m 755 src/vnstati $(BIN_BSD); \ ++ then echo install -m 755 src/vnstati $(BIN_BSD); \ ++ install -m 755 src/vnstati $(BIN_BSD); \ + fi + + # install default config if such doesn't exist diff --git a/net/vnstat/patches/003-no_install_uname.patch b/net/vnstat/patches/003-no_install_uname.patch new file mode 100644 index 0000000..2c7859b --- /dev/null +++ b/net/vnstat/patches/003-no_install_uname.patch @@ -0,0 +1,15 @@ +--- a/Makefile ++++ b/Makefile +@@ -22,12 +22,6 @@ clean: + install: + @echo "Installing vnStat..." + +-# check that system is really Linux +- @if [ `uname` != "Linux" ]; \ +- then echo "This isn't a Linux system. Maybe 'make bsdinstall' is what you need?"; \ +- false; \ +- fi +- + # check that there's something to install + @if [ ! -f "src/vnstat" ] || [ ! -f "src/vnstatd" ]; \ + then echo "Nothing to install, run make first."; \ diff --git a/net/vnstat/patches/004-install_bsd_fix.patch b/net/vnstat/patches/004-install_bsd_fix.patch new file mode 100644 index 0000000..6b2a792 --- /dev/null +++ b/net/vnstat/patches/004-install_bsd_fix.patch @@ -0,0 +1,21 @@ +--- a/Makefile ++++ b/Makefile +@@ -43,7 +43,8 @@ install: + # install default config if such doesn't exist + @if [ ! -f "$(DESTDIR)/etc/vnstat.conf" ]; \ + then echo "Installing config to $(DESTDIR)/etc/vnstat.conf"; \ +- install -D -m 644 cfg/vnstat.conf $(DESTDIR)/etc/vnstat.conf; \ ++ install -d -m 755 $(DESTDIR)/etc; \ ++ install -m 644 cfg/vnstat.conf $(DESTDIR)/etc/vnstat.conf; \ + fi + + # install everything else +@@ -63,7 +64,7 @@ install: + then echo install -m 644 man/vnstati.1 $(MAN)/man1; \ + install -m 644 man/vnstati.1 $(MAN)/man1; \ + fi +- ++ + @if [ -f $(MAN)/man1/vnstat.1.gz ]; \ + then gzip -f9 $(MAN)/man1/vnstat.1; \ + gzip -f9 $(MAN)/man1/vnstatd.1; \ diff --git a/net/vpnc-scripts/Makefile b/net/vpnc-scripts/Makefile new file mode 100644 index 0000000..7481dea --- /dev/null +++ b/net/vpnc-scripts/Makefile @@ -0,0 +1,56 @@ +# +# 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:=vpnc-scripts +PKG_VERSION:=20120423 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/vpnc-scripts/ +PKG_MD5SUM:=3265dc7fe57ae9b4c905961a28699c4c + +include $(INCLUDE_DIR)/package.mk + +define Package/vpnc-scripts + SECTION:=net + CATEGORY:=Network + DEPENDS:=+ip + TITLE:=VPN configuration script for vpnc and OpenConnect + URL:=http://www.infradead.org/openconnect/vpnc-script.html + SUBMENU:=VPN +endef + +define Package/vpnc/vpnc-scripts + This package contains the vpnc-script which is used by vpnc + and OpenConnect to configure the tunnel interface. +endef + +define Package/vpnc-scripts/conffiles +/etc/vpnc/connect.d/ +/etc/vpnc/post-connect.d/ +/etc/vpnc/disconnect.d/ +/etc/vpnc/post-connect.d/ +/etc/vpnc/reconnect.d/ +endef + +define Build/Compile +endef + +define Package/vpnc-scripts/install + $(INSTALL_DIR) $(1)/etc/vpnc + $(INSTALL_DIR) $(1)/etc/vpnc/connect.d + $(INSTALL_DIR) $(1)/etc/vpnc/post-connect.d + $(INSTALL_DIR) $(1)/etc/vpnc/disconnect.d + $(INSTALL_DIR) $(1)/etc/vpnc/post-disconnect.d + $(INSTALL_DIR) $(1)/etc/vpnc/reconnect.d + $(INSTALL_BIN) ./files/etc/vpnc/connect.d/ifstate $(1)/etc/vpnc/connect.d/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/vpnc-script $(1)/etc/vpnc/ +endef + +$(eval $(call BuildPackage,vpnc-scripts)) diff --git a/net/vpnc-scripts/files/etc/vpnc/connect.d/ifstate b/net/vpnc-scripts/files/etc/vpnc/connect.d/ifstate new file mode 100644 index 0000000..8d2a157 --- /dev/null +++ b/net/vpnc-scripts/files/etc/vpnc/connect.d/ifstate @@ -0,0 +1,7 @@ +if [ -r /etc/openwrt_release ] && [ -n "$OPENWRT_INTERFACE" ]; then + uci_set_state network "$OPENWRT_INTERFACE" banner "$CISCO_BANNER" + uci_set_state network "$OPENWRT_INTERFACE" ifname "$TUNDEV" + [ -n "$INTERNAL_IP4_ADDRESS" ] && uci_set_state network "$OPENWRT_INTERFACE" ipaddr "$INTERNAL_IP4_ADDRESS" + [ -n "$INTERNAL_IP6_NETMASK" ] && uci_set_state network "$OPENWRT_INTERFACE" ip6addr "$INTERNAL_IP6_NETMASK" + env -i ACTION="ifup" INTERFACE="$OPENWRT_INTERFACE" DEVICE="$TUNDEV" PROTO=openconnect /sbin/hotplug-call "iface" +fi diff --git a/net/vpnc/Makefile b/net/vpnc/Makefile new file mode 100644 index 0000000..58af207 --- /dev/null +++ b/net/vpnc/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2006-2012 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:=vpnc +PKG_VERSION:=0.5.3 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.unix-ag.uni-kl.de/~massar/vpnc/ +PKG_MD5SUM:=4378f9551d5b077e1770bbe09995afb3 + +include $(INCLUDE_DIR)/package.mk + +define Package/vpnc + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libgpg-error +libgcrypt +kmod-tun +vpnc-scripts + TITLE:=VPN client for Cisco EasyVPN + URL:=http://www.unix-ag.uni-kl.de/~massar/vpnc/ + SUBMENU:=VPN +endef + +define Package/vpnc/description + A VPN client compatible with Cisco's EasyVPN equipment. + + Supports IPSec (ESP) with Mode Configuration and Xauth. Supports only + shared-secret IPSec authentication with Xauth, AES (256, 192, 128), + 3DES, 1DES, MD5, SHA1, DH1/2/5 and IP tunneling. +endef + +define Package/vpnc/conffiles +/etc/vpnc/default.conf +endef + +define Build/Compile + $(call Build/Compile/Default, \ + OFLAGS="$(TARGET_CFLAGS)" \ + OS="Linux" \ + STAGING_DIR="$(STAGING_DIR)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + PREFIX=/usr \ + all install \ + ) +endef + +define Package/vpnc/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/vpnc \ + $(PKG_INSTALL_DIR)/usr/sbin/vpnc-disconnect \ + $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/vpnc + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/vpnc/default.conf $(1)/etc/vpnc/ +endef + +$(eval $(call BuildPackage,vpnc)) diff --git a/net/vpnc/patches/001-cross.patch b/net/vpnc/patches/001-cross.patch new file mode 100644 index 0000000..fda17b1 --- /dev/null +++ b/net/vpnc/patches/001-cross.patch @@ -0,0 +1,29 @@ +--- a/Makefile ++++ b/Makefile +@@ -20,7 +20,7 @@ + # $Id: Makefile 312 2008-06-15 18:09:42Z Joerg Mayer $ + + DESTDIR= +-PREFIX=/usr/local ++PREFIX=/usr + ETCDIR=/etc/vpnc + BINDIR=$(PREFIX)/bin + SBINDIR=$(PREFIX)/sbin +@@ -51,14 +51,11 @@ RELEASE_VERSION := $(shell cat VERSION) + #OPENSSLLIBS = -lcrypto + + CC=gcc +-CFLAGS ?= -O3 -g +-CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings +-CFLAGS += $(shell libgcrypt-config --cflags) ++CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include $(OFLAGS) '-DVERSION="$(shell cat VERSION)"' + CPPFLAGS += -DVERSION=\"$(VERSION)\" $(OPENSSL_GPL_VIOLATION) +-LDFLAGS ?= -g +-LDFLAGS += $(shell libgcrypt-config --libs) $(OPENSSLLIBS) ++LDFLAGS = -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -lgcrypt -lgpg-error + +-ifeq ($(shell uname -s), SunOS) ++ifeq ($(OS), SunOS) + LDFLAGS += -lnsl -lresolv -lsocket + endif + ifneq (,$(findstring Apple,$(shell $(CC) --version))) diff --git a/net/vpnc/patches/002-vpn_script.patch b/net/vpnc/patches/002-vpn_script.patch new file mode 100644 index 0000000..5a0ebce --- /dev/null +++ b/net/vpnc/patches/002-vpn_script.patch @@ -0,0 +1,41 @@ +--- a/vpnc-script.in ++++ b/vpnc-script.in +@@ -97,7 +97,7 @@ do_ifconfig() { + fi + + # Point to point interface require a netmask of 255.255.255.255 on some systems +- ifconfig "$TUNDEV" inet "$INTERNAL_IP4_ADDRESS" $ifconfig_syntax_ptp "$INTERNAL_IP4_ADDRESS" netmask 255.255.255.255 mtu ${MTU} up ++ ifconfig "$TUNDEV" "$INTERNAL_IP4_ADDRESS" $ifconfig_syntax_ptp "$INTERNAL_IP4_ADDRESS" netmask 255.255.255.255 mtu ${MTU} up + + if [ -n "$INTERNAL_IP4_NETMASK" ]; then + set_network_route $INTERNAL_IP4_NETADDR $INTERNAL_IP4_NETMASK $INTERNAL_IP4_NETMASKLEN +@@ -503,6 +503,18 @@ do_disconnect() { + destroy_tun_device + } + ++start_vpn_nat() { ++ iptables -A forwarding_rule -o $TUNDEV -j ACCEPT ++ iptables -A forwarding_rule -i $TUNDEV -j ACCEPT ++ iptables -t nat -A postrouting_rule -o $TUNDEV -j MASQUERADE ++} ++ ++stop_vpn_nat() { ++ iptables -t nat -D postrouting_rule -o $TUNDEV -j MASQUERADE ++ iptables -D forwarding_rule -i $TUNDEV -j ACCEPT ++ iptables -D forwarding_rule -o $TUNDEV -j ACCEPT ++} ++ + #### Main + + if [ -z "$reason" ]; then +@@ -516,8 +528,10 @@ case "$reason" in + ;; + connect) + do_connect ++ start_vpn_nat + ;; + disconnect) ++ stop_vpn_nat + do_disconnect + ;; + *) diff --git a/net/vpnc/patches/003-no_makeman.patch b/net/vpnc/patches/003-no_makeman.patch new file mode 100644 index 0000000..ef01643 --- /dev/null +++ b/net/vpnc/patches/003-no_makeman.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -69,7 +69,7 @@ vpnc : $(OBJS) vpnc.o + $(CC) -o $@ $^ $(LDFLAGS) + + vpnc.8 : vpnc.8.template makeman.pl vpnc +- ./makeman.pl ++ touch vpnc.8 + + vpnc-script : vpnc-script.in + sed -e 's,@''PREFIX''@,$(PREFIX),g' $< > $@ && chmod 755 $@ diff --git a/net/vpzone/Makefile b/net/vpzone/Makefile new file mode 100644 index 0000000..f8185bf --- /dev/null +++ b/net/vpzone/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2010-2011 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:=vpzone +PKG_VERSION:=0.1.2 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/vpzone +PKG_MD5SUM:=9b8a142a217f69ece0163b2026dc8585 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/vpzone + CATEGORY:=Network + SECTION:=net + SUBMENU:=VPN + TITLE:=A flexible multipurpose layer 3 VPN daemon + URL:=http://vpzone.sourceforge.net/ + DEPENDS:=+libcares +libevent2 +libgnutls +kmod-ipv6 +kmod-tun +endef + +define Package/vpzone/conffiles +/etc/vpzone/vpzone.conf +endef + +define Package/vpzone/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/vpzone $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/vpzone + $(CP) $(PKG_INSTALL_DIR)/usr/lib/vpzone/*.so $(1)/usr/lib/vpzone/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/vpzone.init $(1)/etc/init.d/vpzone + $(INSTALL_DIR) $(1)/etc/vpzone + $(INSTALL_CONF) ./files/vpzone.conf $(1)/etc/vpzone/ +endef + +$(eval $(call BuildPackage,vpzone)) diff --git a/net/vpzone/files/vpzone.conf b/net/vpzone/files/vpzone.conf new file mode 100644 index 0000000..9a7940b --- /dev/null +++ b/net/vpzone/files/vpzone.conf @@ -0,0 +1,28 @@ +# vpzone.conf - vpzone configuration file + +log-file /var/log/vpzone.log +log-level 3 + +load tcp # mandatory +#load udp +#load gnutls +#load babeld +#load simple_vp +#load manage + +device vpz0 + +dev-ip fe80::8c7:3280:8ae3:6882/64 # mandatory link-local ip address +dev-ip 2001:218:420::45/64 # mandatory VPN ip address + +group nogroup +user nobody + +#server tcp:ssl:0.0.0.0 + +#manage secret + +#cafile /etc/vpzone/ca.crt +#crlfile /etc/vpzone/crl.pem +#dhfile /etc/vpzone/dh.pem +#certnkey-files /etc/vpzone/cert.crt /etc/vpzone/keyfile diff --git a/net/vpzone/files/vpzone.init b/net/vpzone/files/vpzone.init new file mode 100644 index 0000000..e78a0b7 --- /dev/null +++ b/net/vpzone/files/vpzone.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org + +START=50 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +start() { + service_start /usr/bin/vpzone +} + +stop() { + service_stop /usr/bin/vpzone +} diff --git a/net/vpzone/patches/001-no_werror.patch b/net/vpzone/patches/001-no_werror.patch new file mode 100644 index 0000000..514bc79 --- /dev/null +++ b/net/vpzone/patches/001-no_werror.patch @@ -0,0 +1,22 @@ +--- a/configure ++++ b/configure +@@ -14776,7 +14776,7 @@ fi + + + +-VPZONE_CFLAGS="-std=gnu99 -Wall -Werror -Wextra -fdiagnostics-show-option ${DEV_CFLAGS}" ++VPZONE_CFLAGS="-std=gnu99 -Wall -Wextra -fdiagnostics-show-option ${DEV_CFLAGS}" + + VPZONE_LDFLAGS="-ldl -levent -lcares" + +--- a/configure.ac ++++ b/configure.ac +@@ -65,7 +65,7 @@ dnl # ####################### + dnl Compiler and Linker flags + dnl # ####################### + +-VPZONE_CFLAGS="-std=gnu99 -Wall -Werror -Wextra -fdiagnostics-show-option ${DEV_CFLAGS}" ++VPZONE_CFLAGS="-std=gnu99 -Wall -Wextra -fdiagnostics-show-option ${DEV_CFLAGS}" + AC_SUBST(VPZONE_CFLAGS) + VPZONE_LDFLAGS="-ldl -levent -lcares" + AC_SUBST(VPZONE_LDFLAGS) diff --git a/net/vpzone/patches/002-ipv6_inc_fix.patch b/net/vpzone/patches/002-ipv6_inc_fix.patch new file mode 100644 index 0000000..d062bcf --- /dev/null +++ b/net/vpzone/patches/002-ipv6_inc_fix.patch @@ -0,0 +1,11 @@ +--- a/src/include/iface.h ++++ b/src/include/iface.h +@@ -36,7 +36,7 @@ + /*A temporary and *dirty* fix against bad headers + on some system ( conflicting with )...*/ + #include +-#include ++/*#include */ + struct in6_ifreq + { + struct in6_addr ifr6_addr; diff --git a/net/vrrpd/Makefile b/net/vrrpd/Makefile new file mode 100644 index 0000000..adc23a4 --- /dev/null +++ b/net/vrrpd/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2006-2012 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:=vrrpd +PKG_VERSION:=1.0 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/vrrpd +PKG_MD5SUM:=6d5066ea1a6ced817376ca0f54765447 + +include $(INCLUDE_DIR)/package.mk + +define Package/vrrpd + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE:=Virtual Router Redundancy Protocol daemon + URL:=http://www.sourceforge.net/projects/vrrpd +endef + +define Package/vrrpd/description + VRRPd is an implementation of Virtual Router Redundancy + Protocol as specified in rfc2338. VRRPd is interoperable with + other RFC-based VRRP implementations, including Cisco and + Juniper, and is included as a standard feature on ImageStream + routers. +endef + +define Build/Compile + $(call Build/Compile/Default, \ + DBG_OPT="" \ + MAIN_OPT="$(TARGET_CFLAGS)" \ + vrrpd \ + ) +endef + +define Package/vrrpd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/vrrpd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/vrrpd.config $(1)/etc/config/vrrpd + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/vrrpd.init $(1)/etc/init.d/vrrpd +endef + +define Package/vrrpd/conffiles +/etc/config/vrrpd +endef + +$(eval $(call BuildPackage,vrrpd)) diff --git a/net/vrrpd/files/vrrpd.config b/net/vrrpd/files/vrrpd.config new file mode 100644 index 0000000..624bdc4 --- /dev/null +++ b/net/vrrpd/files/vrrpd.config @@ -0,0 +1,29 @@ +package 'vrrpd' + +config 'vrrpd' 'vid1' + option enabled 0 + + # set the interface to run on + # (default: lan) +# option interface 'lan' + + # set the ID of the virtual server (1-255) + # (default: 1) +# option virtual_id '1' + + # set the IP address(es) of the virtual server + list virtual_ip '192.168.1.253' +# list virtual_ip '192.168.1.252' +# list virtual_ip '192.168.1.251' + + # set the priority of this host in the virtual server + # (default: 100) +# option priority '100' + + # set the advertisement interval (in seconds) + # (default: 1) +# option delay '1' + + # don't handle the virtual MAC address + # (default: false) +# option no_virtual_mac '0' diff --git a/net/vrrpd/files/vrrpd.init b/net/vrrpd/files/vrrpd.init new file mode 100644 index 0000000..71e5967 --- /dev/null +++ b/net/vrrpd/files/vrrpd.init @@ -0,0 +1,87 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2012 OpenWrt.org + +START=50 + +append_list_item() { + local val="$1" + local var="$2" + append "$var" "$val" +} + +append_bool() { + local var="$1" + local section="$2" + local option="$3" + local value="$4" + local _val + config_get_bool _val "$section" "$option" 0 + [ $_val -gt 0 ] && append "$var" "$value" +} + +append_string() { + local var="$1" + local section="$2" + local option="$3" + local val="$4" + local _val + config_get _val "$section" "$option" + [ -n "$_val" ] && append "$var" "$val $_val" +} + +section_enabled() { + local enabled + config_get_bool enabled "$1" 'enabled' 0 + [ $enabled -gt 0 ] +} + +start_instance() { + local section="$1" + local id + local if + local dev + local args + + section_enabled "$section" || return 1 + + config_get id "$section" 'virtual_id' '1' + config_get if "$section" 'interface' 'lan' + network_get_device dev "$if" && { + args="-v $id -i $dev" + append_string args "$section" 'delay' '-d' + append_string args "$section" 'priority' '-p' + append_bool args "$section" 'no_virtual_mac' '-n' + config_list_foreach "$section" 'virtual_ip' append_list_item args + + SERVICE_PID_FILE="/var/run/vrrpd_${dev}_${id}.pid" + service_start /usr/sbin/vrrpd $args + } +} + +stop_instance() { + local section="$1" + local id + local if + local dev + + section_enabled "$section" || return 1 + + config_get id "$section" 'virtual_id' '1' + config_get if "$section" 'interface' 'lan' + network_get_device dev "$if" + + SERVICE_PID_FILE="/var/run/vrrpd_${dev}_${id}.pid" + service_stop /usr/sbin/vrrpd +} + +start() { + . /lib/functions/network.sh + config_load 'vrrpd' + config_foreach start_instance 'vrrpd' +} + +stop() { + . /lib/functions/network.sh + config_load 'vrrpd' + config_foreach stop_instance 'vrrpd' +} diff --git a/net/vsftpd/Makefile b/net/vsftpd/Makefile new file mode 100644 index 0000000..8d155b2 --- /dev/null +++ b/net/vsftpd/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2006-2012 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:=vsftpd +PKG_VERSION:=3.0.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://security.appspot.com/downloads/ +PKG_MD5SUM:=8b00c749719089401315bd3c44dddbb2 + +include $(INCLUDE_DIR)/package.mk + +define Package/vsftpd + SUBMENU:=File Transfer + SECTION:=net + CATEGORY:=Network + TITLE:=A fast and secure FTP server + URL:=http://vsftpd.beasts.org/ + MAINTAINER:=Cezary Jackiewicz +endef + +define Package/vsftpd/conffiles +/etc/vsftpd.conf +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + vsftpd +endef + +define Package/vsftpd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(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) +endef + +$(eval $(call BuildPackage,vsftpd)) diff --git a/net/vsftpd/files/vsftpd.conf b/net/vsftpd/files/vsftpd.conf new file mode 100644 index 0000000..f3ba34f --- /dev/null +++ b/net/vsftpd/files/vsftpd.conf @@ -0,0 +1,17 @@ +background=YES +listen=YES +anonymous_enable=NO +local_enable=YES +write_enable=YES +local_umask=022 +check_shell=NO +#dirmessage_enable=YES +#ftpd_banner=Welcome to blah FTP service. +session_support=NO +#syslog_enable=YES +#userlist_enable=YES +#userlist_deny=NO +#userlist_file=/etc/vsftpd.users +#xferlog_enable=YES +#xferlog_file=/var/log/vsftpd.log +#xferlog_std_format=YES diff --git a/net/vsftpd/files/vsftpd.init b/net/vsftpd/files/vsftpd.init new file mode 100644 index 0000000..ad3e23d --- /dev/null +++ b/net/vsftpd/files/vsftpd.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +start() { + mkdir -m 0755 -p /var/run/vsftpd + service_start /usr/sbin/vsftpd +} + +stop() { + service_stop /usr/sbin/vsftpd +} diff --git a/net/vsftpd/patches/001-destdir.patch b/net/vsftpd/patches/001-destdir.patch new file mode 100644 index 0000000..70d9592 --- /dev/null +++ b/net/vsftpd/patches/001-destdir.patch @@ -0,0 +1,47 @@ +--- a/Makefile ++++ b/Makefile +@@ -22,6 +22,8 @@ OBJS = main.o utility.o prelogin.o ftpcm + seccompsandbox.o + + ++DESTDIR = ++ + .c.o: + $(CC) -c $*.c $(CFLAGS) $(IFLAGS) + +@@ -29,21 +31,20 @@ vsftpd: $(OBJS) + $(CC) -o vsftpd $(OBJS) $(LINK) $(LDFLAGS) $(LIBS) + + install: +- if [ -x /usr/local/sbin ]; then \ +- $(INSTALL) -m 755 vsftpd /usr/local/sbin/vsftpd; \ +- else \ +- $(INSTALL) -m 755 vsftpd /usr/sbin/vsftpd; fi +- if [ -x /usr/local/man ]; then \ +- $(INSTALL) -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \ +- $(INSTALL) -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \ +- elif [ -x /usr/share/man ]; then \ +- $(INSTALL) -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \ +- $(INSTALL) -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \ +- else \ +- $(INSTALL) -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \ +- $(INSTALL) -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi +- if [ -x /etc/xinetd.d ]; then \ +- $(INSTALL) -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd; fi ++ mkdir -p $(DESTDIR)/usr/sbin ++ $(INSTALL) -m 755 vsftpd $(DESTDIR)/usr/sbin/ ++ mkdir -p $(DESTDIR)/usr/share/man/man8 ++ $(INSTALL) -m 644 vsftpd.8 $(DESTDIR)/usr/share/man/man8/ ++ mkdir -p $(DESTDIR)/usr/share/man/man5 ++ $(INSTALL) -m 644 vsftpd.conf.5 $(DESTDIR)/usr/share/man/man5/ ++ mkdir -p $(DESTDIR)/etc/xinetd.d ++ $(INSTALL) -m 644 xinetd.d/vsftpd $(DESTDIR)/etc/xinetd.d/ ++ ++uninstall: ++ rm -f $(DESTDIR)/usr/sbin/vsftpd ++ rm -f $(DESTDIR)/usr/share/man/man8/vsftpd.8 ++ rm -f $(DESTDIR)/usr/share/man/man5/vsftpd.conf.5 ++ rm -f $(DESTDIR)/etc/xinetd.d/vsftpd + + clean: + rm -f *.o *.swp vsftpd diff --git a/net/vsftpd/patches/002-find_libs.patch b/net/vsftpd/patches/002-find_libs.patch new file mode 100644 index 0000000..daf83ef --- /dev/null +++ b/net/vsftpd/patches/002-find_libs.patch @@ -0,0 +1,13 @@ +--- a/Makefile ++++ b/Makefile +@@ -8,8 +8,8 @@ CFLAGS = -O2 -fPIE -fstack-protector --p + -D_FORTIFY_SOURCE=2 \ + #-pedantic -Wconversion + +-LIBS = `./vsf_findlibs.sh` +-LINK = -Wl,-s ++LIBS = -lcrypt -lnsl ++LINK = + LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now + + OBJS = main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \ diff --git a/net/vsftpd/patches/003-chroot.patch b/net/vsftpd/patches/003-chroot.patch new file mode 100644 index 0000000..8965da4 --- /dev/null +++ b/net/vsftpd/patches/003-chroot.patch @@ -0,0 +1,11 @@ +--- a/tunables.c ++++ b/tunables.c +@@ -254,7 +254,7 @@ tunables_load_defaults() + /* -rw------- */ + tunable_chown_upload_mode = 0600; + +- install_str_setting("/usr/share/empty", &tunable_secure_chroot_dir); ++ install_str_setting("/var/run/vsftpd", &tunable_secure_chroot_dir); + install_str_setting("ftp", &tunable_ftp_username); + install_str_setting("root", &tunable_chown_username); + install_str_setting("/var/log/xferlog", &tunable_xferlog_file); diff --git a/net/vsftpd/patches/004-disable-capabilities.patch b/net/vsftpd/patches/004-disable-capabilities.patch new file mode 100644 index 0000000..7aa6330 --- /dev/null +++ b/net/vsftpd/patches/004-disable-capabilities.patch @@ -0,0 +1,12 @@ +--- a/sysdeputil.c ++++ b/sysdeputil.c +@@ -165,6 +165,9 @@ + #endif + /* END config */ + ++#undef VSF_SYSDEP_HAVE_CAPABILITIES ++#undef VSF_SYSDEP_HAVE_LIBCAP ++ + /* PAM support - we include our own dummy version if the system lacks this */ + #include + diff --git a/net/vtun/Makefile b/net/vtun/Makefile new file mode 100644 index 0000000..e8d4422 --- /dev/null +++ b/net/vtun/Makefile @@ -0,0 +1,78 @@ +# +# Copyright (C) 2006-2009 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:=vtun +PKG_VERSION:=3.0.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/vtun +PKG_MD5SUM:=d3d8bc4d58886498a1c338670eab9315 + +include $(INCLUDE_DIR)/package.mk + +define Package/vtun + SECTION:=net + CATEGORY:=Network + DEPENDS:=+kmod-tun +VTUN_LZO:liblzo +VTUN_LZO:zlib +VTUN_SSL:libopenssl + TITLE:=VPN tunneling daemon + URL:=http://vtun.sourceforge.net + SUBMENU:=VPN + MENU:=1 +endef + +define Package/vtun/config +menu "Configuration" + depends on PACKAGE_vtun + +config VTUN_config + bool + + depends on PACKAGE_vtun + config VTUN_LZO + bool "enable vtun compression" + help + vtun tunnels will be compressed + default y + + config VTUN_SSL + bool "enable vtun ssl encryption" + help + vtun tunnels will be encrypted + default y +endmenu +endef + +define Package/vtun/conffiles +/etc/vtund.conf +endef + +CONFIGURE_ARGS += \ + $(if $(CONFIG_VTUN_LZO),--with-lzo-lib="$(STAGING_DIR)/usr/lib/",--disable-zlib) \ + $(if $(CONFIG_VTUN_LZO),--with-lzo-headers="$(STAGING_DIR)/usr/include/lzo",--disable-lzo) \ + $(if $(CONFIG_VTUN_SSL),--with-ssl-headers="$(STAGING_DIR)/usr/lib/",--disable-ssl) \ + +CONFIGURE_VARS += \ + LIBS="$(TARGET_LDFLAGS)" \ + $(if $(CONFIG_VTUN_LZO),LZO_HDR_DIR="$(STAGING_DIR)/usr/include/lzo") \ + $(if $(CONFIG_VTUN_SSL),BLOWFISH_HDR_DIR="$(STAGING_DIR)/usr/include/openssl") \ + $(if $(CONFIG_VTUN_SSL),SSL_HDR_DIR="$(STAGING_DIR)/usr/include/openssl") \ + +define Build/Compile + $(call Build/Compile/Default,vtund) +endef + +define Package/vtun/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/vtund.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/vtund $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,vtun)) diff --git a/net/vtun/patches/100-lzo2.patch b/net/vtun/patches/100-lzo2.patch new file mode 100644 index 0000000..fa9ba8b --- /dev/null +++ b/net/vtun/patches/100-lzo2.patch @@ -0,0 +1,37 @@ +--- a/configure ++++ b/configure +@@ -5459,7 +5459,7 @@ echo $ECHO_N "checking \"for lzo_asm.h\" + fi + echo "$as_me:$LINENO: result: ($dir) yes " >&5 + echo "${ECHO_T}($dir) yes " >&6 +- LZOCHK="lzo2 lzo" ++ LZOCHK="lzo2" + else + echo "$as_me:$LINENO: result: \"no\"" >&5 + echo "${ECHO_T}\"no\"" >&6 +@@ -5504,8 +5504,7 @@ echo "${ECHO_T}($dir) yes " >&6 + echo "$as_me:$LINENO: result: \"no\"" >&5 + echo "${ECHO_T}\"no\"" >&6 + { { echo "$as_me:$LINENO: error: LZO library not found. " >&5 +-echo "$as_me: error: LZO library not found. " >&2;} +- { (exit 1); exit 1; }; } ++echo "$as_me: error: LZO library not found. " >&2;} } + + fi + +@@ -5598,13 +5597,11 @@ fi + done + if test $havelzo = 0; then + { { echo "$as_me:$LINENO: error: LZO library not found. " >&5 +-echo "$as_me: error: LZO library not found. " >&2;} +- { (exit 1); exit 1; }; } ++echo "$as_me: error: LZO library not found. " >&2;} } + fi + else + { { echo "$as_me:$LINENO: error: LZO headers not found. " >&5 +-echo "$as_me: error: LZO headers not found. " >&2;} +- { (exit 1); exit 1; }; } ++echo "$as_me: error: LZO headers not found. " >&2;} } + fi + fi + diff --git a/net/wavemon/Makefile b/net/wavemon/Makefile new file mode 100644 index 0000000..1344ecd --- /dev/null +++ b/net/wavemon/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2008-2012 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:=wavemon +PKG_VERSION:=0.7.5 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://eden-feed.erg.abdn.ac.uk/wavemon/stable-releases +PKG_MD5SUM:=77d4a0f099ca98cf98a915adc70694ba + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/wavemon + SECTION:=net + CATEGORY:=Network + TITLE:=N-curses based wireless network devices monitor + DEPENDS:=+libncurses + SUBMENU:=wireless + URL:=http://eden-feed.erg.abdn.ac.uk/wavemon/ +endef + +define Package/wavemon/description + wavemon is a ncurses-based monitoring application for wireless network + devices. It currently works under Linux with devices that are supported + by the wireless extensions by Jean Tourrilhes (included in Kernel 2.4 + and higher), e.g. the Lucent Orinoco cards. +endef + +CONFIGURE_VARS += \ + ac_cv_lib_cap_cap_get_flag=no + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) -L$(STAGING_DIR)/usr/lib -I$(STAGING_DIR)/usr/include" + +define Package/wavemon/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/wavemon $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,wavemon)) diff --git a/net/wccpd/Makefile b/net/wccpd/Makefile new file mode 100644 index 0000000..67b0153 --- /dev/null +++ b/net/wccpd/Makefile @@ -0,0 +1,42 @@ +# +# 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:=wccpd +PKG_VERSION:=0.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/wccpd +PKG_MD5SUM:=5f15c274de61dfb88e0dbfc1ccbe6b67 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/wccpd + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=a Web Cache Coordination daemon + URL:=http://wccpd.sourceforge.net/ +endef + +define Package/wccpd/description + wccpd is a WCCP (Web Cache Coordination Protocol) server daemon + It allows a router (running Linux) to redirect web traffic to a + group of Squid servers using WCCP as the monitoring/controling + protocol. +endef + +define Package/wccpd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/wccpd $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,wccpd)) diff --git a/net/wdiag/Makefile b/net/wdiag/Makefile new file mode 100644 index 0000000..2d6e497 --- /dev/null +++ b/net/wdiag/Makefile @@ -0,0 +1,44 @@ +# +# 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:=wdiag +PKG_VERSION:=0.10 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/wdiag +PKG_MD5SUM:=83a4e5610ec8fa0166c57b9a25f0b069 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/wdiag + SECTION:=net + CATEGORY:=Network + TITLE:=Westell DSL Modem Diagnostics for Linux + URL:=http://sourceforge.net/projects/wdiag/ +endef + +define Package/wdiag/description +A collection of utilities to get DSL stats from Westell DSL modems. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/src \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" +endef + +define Package/wdiag/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/src/w{start,stop,estell} $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,wdiag)) diff --git a/net/weechat/Makefile b/net/weechat/Makefile new file mode 100644 index 0000000..63fc16b --- /dev/null +++ b/net/weechat/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2006-2012 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:=weechat +PKG_VERSION:=0.3.8 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.weechat.org/files/src +PKG_MD5SUM:=c07047eca33c176df25e94964bdec7bf + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/weechat + SUBMENU:=Instant Messaging + SECTION:=net + CATEGORY:=Network + TITLE:=Lightweight IRC client + URL:=http://www.weechat.org/ + DEPENDS:=+libcurl +libgnutls +libncursesw $(ICONV_DEPENDS) +endef + +define Package/weechat/description + Weechat is fast, light & extensible IRC client. +endef + +CMAKE_OPTIONS+= \ + -DENABLE_PYTHON=OFF \ + -DENABLE_PERL=OFF \ + -DENABLE_LUA=OFF \ + -DENABLE_GUILE=OFF \ + -DENABLE_RUBY=OFF \ + -DENABLE_TCL=OFF + +TARGET_LDFLAGS += \ + -L$(ICONV_PREFIX)/lib -ldl \ + -Wl,-rpath-link,$(STAGING_DIR)/usr/lib + +define Package/weechat/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/weechat-curses $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/weechat/plugins + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/weechat/plugins/* \ + $(1)/usr/lib/weechat/plugins/ +endef + +$(eval $(call BuildPackage,weechat)) diff --git a/net/wget/Makefile b/net/wget/Makefile new file mode 100644 index 0000000..3246652 --- /dev/null +++ b/net/wget/Makefile @@ -0,0 +1,124 @@ +# +# Copyright (C) 2007-2011 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:=wget +PKG_VERSION:=1.13.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@GNU/$(PKG_NAME) +PKG_MD5SUM:=12115c3750a4d92f9c6ac62bac372e85 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/wget/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=File Transfer + TITLE:=Non-interactive network downloader + URL:=http://www.gnu.org/software/wget/index.html +endef + +define Package/wget/Default/description + Wget is a network utility to retrieve files from the Web using http + and ftp, the two most widely used Internet protocols. It works + non-interactively, so it will work in the background, after having + logged off. The program supports recursive retrieval of web-authoring + pages as well as ftp sites -- you can use wget to make mirrors of + archives and home pages or to travel the Web like a WWW robot. +endef + +define Package/wget +$(call Package/wget/Default) + DEPENDS+= +libopenssl +librt + TITLE+= (with SSL support) + VARIANT:=ssl +endef + +define Package/wget/description +$(call Package/wget/Default/description) + This package is built with SSL support. +endef + +define Package/wget-nossl +$(call Package/wget/Default) + TITLE+= (without SSL support) + VARIANT:=nossl +endef + +define Package/wget-nossl/description +$(call Package/wget/Default/description) + This package is built without SSL support. +endef + +CONFIGURE_ARGS+= \ + --disable-rpath \ + --disable-iri + +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS+= \ + --with-ssl=openssl \ + --with-libssl-prefix="$(STAGING_DIR)/usr" +endif + +ifeq ($(BUILD_VARIANT),nossl) + CONFIGURE_ARGS+= \ + --without-ssl +endif + +define Package/wget/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wget $(1)/usr/bin/wget-ssl +endef + +define Package/wget-nossl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wget $(1)/usr/bin/wget-nossl +endef + +define Package/wget/postinst +#!/bin/sh +if [ -e $${IPKG_INSTROOT}/usr/bin/wget ]; then + rm -rf $${IPKG_INSTROOT}/usr/bin/wget; +fi +ln -sf ./wget-ssl $${IPKG_INSTROOT}/usr/bin/wget +endef + +define Package/wget/postrm +#!/bin/sh +rm $${IPKG_INSTROOT}/usr/bin/wget +[ -x $${IPKG_INSTROOT}/usr/bin/wget-nossl ] && ln -s ./wget-nossl $${IPKG_INSTROOT}/usr/bin/wget || { + ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/wget + $${IPKG_INSTROOT}/usr/bin/wget 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/wget +} +exit 0 +endef + +define Package/wget-nossl/postinst +#!/bin/sh +if [ -e $${IPKG_INSTROOT}/usr/bin/wget ]; then + rm -rf $${IPKG_INSTROOT}/usr/bin/wget; +fi +ln -s ./wget-nossl $${IPKG_INSTROOT}/usr/bin/wget +endef + +define Package/wget-nossl/postrm +#!/bin/sh +rm $${IPKG_INSTROOT}/usr/bin/wget +[ -x $${IPKG_INSTROOT}/usr/bin/wget-ssl ] && ln -s ./wget-ssl $${IPKG_INSTROOT}/usr/bin/wget || { + ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/wget + $${IPKG_INSTROOT}/usr/bin/wget 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/wget +} +exit 0 +endef + +$(eval $(call BuildPackage,wget)) +$(eval $(call BuildPackage,wget-nossl)) diff --git a/net/wifidog/Makefile b/net/wifidog/Makefile new file mode 100644 index 0000000..72bf1a6 --- /dev/null +++ b/net/wifidog/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2006,2008 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:=wifidog +PKG_VERSION:=20090925 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:= @SF/$(PKG_NAME) +PKG_MD5SUM:=e3ecacba67a91b6ea3c1072ba6c5a0b4 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/wifidog + SUBMENU:=Captive Portals + SECTION:=net + CATEGORY:=Network + DEPENDS:=+iptables-mod-extra +iptables-mod-ipopt +kmod-ipt-nat +iptables-mod-nat-extra +libpthread + TITLE:=A wireless captive portal solution + URL:=http://www.wifidog.org +endef + +define Package/wifidog/description + The Wifidog project is a complete and embeddable captive + portal solution for wireless community groups or individuals + who wish to open a free Hotspot while still preventing abuse + of their Internet connection. +endef + +define Package/wifidog/conffiles +/etc/wifidog.conf +endef + +define Package/wifidog/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/init.d/wifidog $(1)/usr/bin/wifidog-init + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wifidog $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wdctl $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhttpd.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/wifidog.conf $(1)/etc/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/wifidog-msg.html $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/wifidog +endef + +$(eval $(call BuildPackage,wifidog)) diff --git a/net/wifidog/files/wifidog.conf b/net/wifidog/files/wifidog.conf new file mode 100644 index 0000000..cdf939a --- /dev/null +++ b/net/wifidog/files/wifidog.conf @@ -0,0 +1,193 @@ +# WiFiDog Configuration file + +# Parameter: GatewayID +# Default: default +# Optional +# +# Set this to the node ID on the auth server +# this is used to give a customized login page to the clients and for +# monitoring/statistics purpose +# If none is supplied, the mac address of the GatewayInterface interface will be used, +# without the : separators + +GatewayID default + +# Parameter: ExternalInterface +# Default: NONE +# Optional +# +# Set this to the external interface (the one going out to the Inernet or your larger LAN). +# Typically vlan1 for OpenWrt, and eth0 or ppp0 otherwise, +# Normally autodetected + +# ExternalInterface eth0 + +# Parameter: GatewayInterface +# Default: NONE +# Mandatory +# +# Set this to the internal interface (typically your wifi interface). +# Typically br-lan for OpenWrt, and eth1, wlan0, ath0, etc. otherwise + +GatewayInterface br-lan + +# Parameter: GatewayAddress +# Default: Find it from GatewayInterface +# Optional +# +# Set this to the internal IP address of the gateway. Not normally required. + +# GatewayAddress 192.168.1.1 + +# Parameter: AuthServer +# Default: NONE +# Mandatory, repeatable +# +# This allows you to configure your auth server(s). Each one will be tried in order, untill one responds. +# Set this to the hostname or IP of your auth server(s), the path where +# WiFiDog-auth resides in and the port it listens on. +#AuthServer { +# Hostname (Mandatory; Default: NONE) +# SSLAvailable (Optional; Default: no; Possible values: yes, no) +# SSLPort (Optional; Default: 443) +# HTTPPort (Optional; Default: 80) +# Path (Optional; Default: /wifidog/ Note: The path must be both prefixed and suffixed by /. Use a single / for server root.) +# LoginScriptPathFragment (Optional; Default: login/? Note: This is the script the user will be sent to for login.) +# PortalScriptPathFragment (Optional; Default: portal/? Note: This is the script the user will be sent to after a successfull login.) +# MsgScriptPathFragment (Optional; Default: gw_message.php? Note: This is the script the user will be sent to upon error to read a readable message.) +# PingScriptPathFragment (Optional; Default: ping/? Note: This is the script the user will be sent to upon error to read a readable message.) +# AuthScriptPathFragment (Optional; Default: auth/? Note: This is the script the user will be sent to upon error to read a readable message.) +#} + +#AuthServer { +# Hostname auth.ilesansfil.org +# SSLAvailable yes +# Path / +#} + +#AuthServer { +# Hostname auth2.ilesansfil.org +# SSLAvailable yes +# Path / +#} + +# Parameter: Daemon +# Default: 1 +# Optional +# +# Set this to true if you want to run as a daemon +# Daemon 1 + +# Parameter: GatewayPort +# Default: 2060 +# Optional +# +# Listen on this port +# GatewayPort 2060 + +# Parameter: HTTPDName +# Default: WiFiDog +# Optional +# +# Define what name the HTTPD server will respond +# HTTPDName WiFiDog + +# Parameter: HTTPDMaxConn +# Default: 10 +# Optional +# +# How many sockets to listen to +# HTTPDMaxConn 10 + +# Parameter: CheckInterval +# Default: 60 +# Optional +# +# How many seconds should we wait between timeout checks. This is also +# how often the gateway will ping the auth server and how often it will +# update the traffic counters on the auth server. Setting this too low +# wastes bandwidth, setting this too high will cause the gateway to take +# a long time to switch to it's backup auth server(s). + +CheckInterval 60 + +# Parameter: ClientTimeout +# Default: 5 +# Optional +# +# Set this to the desired of number of CheckInterval of inactivity before a client is logged out +# The timeout will be INTERVAL * TIMEOUT +ClientTimeout 5 + +# Parameter: TrustedMACList +# Default: none +# Optional +# +# Comma separated list of MAC addresses who are allowed to pass +# through without authentication +#TrustedMACList 00:00:DE:AD:BE:AF,00:00:C0:1D:F0:0D + +# Parameter: FirewallRuleSet +# Default: none +# Mandatory +# +# Groups a number of FirewallRule statements together. + +# Parameter: FirewallRule +# Default: none +# +# Define one firewall rule in a rule set. + +# Rule Set: global +# +# Used for rules to be applied to all other rulesets except locked. +FirewallRuleSet global { + ## To block SMTP out, as it's a tech support nightmare, and a legal liability + #FirewallRule block tcp port 25 + + ## Use the following if you don't want clients to be able to access machines on + ## the private LAN that gives internet access to wifidog. Note that this is not + ## client isolation; The laptops will still be able to talk to one another, as + ## well as to any machine bridged to the wifi of the router. + # FirewallRule block to 192.168.0.0/16 + # FirewallRule block to 172.16.0.0/12 + # FirewallRule block to 10.0.0.0/8 + + ## This is an example ruleset for the Teliphone service. + #FirewallRule allow udp to 69.90.89.192/27 + #FirewallRule allow udp to 69.90.85.0/27 + #FirewallRule allow tcp port 80 to 69.90.89.205 +} + +# Rule Set: validating-users +# +# Used for new users validating their account +FirewallRuleSet validating-users { + FirewallRule allow to 0.0.0.0/0 +} + +# Rule Set: known-users +# +# Used for normal validated users. +FirewallRuleSet known-users { + FirewallRule allow to 0.0.0.0/0 +} + +# Rule Set: unknown-users +# +# Used for unvalidated users, this is the ruleset that gets redirected. +# +# XXX The redirect code adds the Default DROP clause. +FirewallRuleSet unknown-users { + FirewallRule allow udp port 53 + FirewallRule allow tcp port 53 + FirewallRule allow udp port 67 + FirewallRule allow tcp port 67 +} + +# Rule Set: locked-users +# +# Not currently used +FirewallRuleSet locked-users { + FirewallRule block to 0.0.0.0/0 +} diff --git a/net/wifidog/files/wifidog.init b/net/wifidog/files/wifidog.init new file mode 100644 index 0000000..9db075d --- /dev/null +++ b/net/wifidog/files/wifidog.init @@ -0,0 +1,17 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=65 +EXTRA_COMMANDS="status" +EXTRA_HELP=" status Print the status of the service" + +start() { + /usr/bin/wifidog-init start +} + +stop() { + /usr/bin/wifidog-init stop +} + +status() { + /usr/bin/wifidog-init status +} \ No newline at end of file diff --git a/net/wing/Makefile b/net/wing/Makefile new file mode 100644 index 0000000..2e3b354 --- /dev/null +++ b/net/wing/Makefile @@ -0,0 +1,94 @@ +# +# Copyright (C) 2006-2012 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:=wing +PKG_VERSION:=20120805 +PKG_RELEASE:=1 +PKG_REV:=d189e36d111788a647cd784536137acbe7a92e17 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=git://github.com/rriggio/click.git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=git + +PKG_BUILD_DEPENDS:=wing/host + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk + +define Package/wing + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE:=Wireless mesh networking toolkit + MAINTAINER:=Roberto Riggio + DEPENDS:=+kmod-tun +libpcap +libstdcpp + URL:=http://www.wing-project.org/ +endef + +define Package/wing/Description + Wing is a wireless mesh routing software. The routing protocol + is derived from Roofnet. It supports multiple radio interfaces + and link quality routing using the ETX, ETT, or WCETT metric. +endef + +EXTRA_CFLAGS=-MD + +CONFIGURE_ARGS += \ + --enable-tools=host \ + --enable-userlevel \ + --enable-wifi \ + --enable-wing \ + --enable-diffserv \ + --disable-linuxmodule \ + --disable-dynamic-linking \ + +HOST_CONFIGURE_ARGS += \ + --enable-userlevel \ + --enable-wifi \ + --enable-wing \ + --enable-diffserv \ + --disable-linuxmodule \ + +define Host/Compile + $(call Host/Install/Default, tools elementmap.xml install) +endef + +define Build/Compile + (cd $(PKG_BUILD_DIR)/userlevel; \ + $(STAGING_DIR_HOST)/bin/click-mkmindriver -p $(PKG_NAME) -C $(STAGING_DIR_HOST) \ + -f $(PKG_BUILD_DIR)/conf/wing/sample.click \ + -A --all -E Discard -E Print -E PrintWifi -E Strip -E Null \ + -E InfiniteSource -E RatedSource -E EtherEncap -E UDPIPEncap \ + -E SetTXRateHT \ + -E WINGETTMetric -E WINGETXMetric -E WINGHopCountMetric \ + -E ProbeTXRate -E MadwifiRate -E AutoRateFallback -E Minstrel \ + -E FairBuffer -E DeAggregator -E DWRRSched -E WFQSched -E WRRSched; \ + ); + $(call Build/Install/Default, MINDRIVER=$(PKG_NAME) install) +endef + +define Package/wing/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/etc/wing + $(INSTALL_DIR) $(1)/usr/share/click + $(CP) ./files/* $(1)/ + $(CP) $(PKG_BUILD_DIR)/conf/wing/click_config $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/conf/wing/write_handler $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/conf/wing/read_handler $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)click $(1)/usr/bin/click + $(CP) $(PKG_INSTALL_DIR)/usr/bin/click-align $(1)/usr/bin/click-align + $(CP) $(PKG_BUILD_DIR)/conf/wing/*click $(1)/etc/wing/ + $(CP) $(PKG_INSTALL_DIR)/usr/share/click/elementmap.xml $(1)/usr/share/click/elementmap.xml +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,wing)) + diff --git a/net/wing/files/etc/uci-defaults/wing b/net/wing/files/etc/uci-defaults/wing new file mode 100644 index 0000000..2a8c35e --- /dev/null +++ b/net/wing/files/etc/uci-defaults/wing @@ -0,0 +1,24 @@ +uci delete network.mesh +uci set network.mesh=interface +uci set network.mesh.proto=wing + +uci delete firewall.zone_mesh +uci set firewall.zone_mesh=zone +uci set firewall.zone_mesh.name="mesh" +uci set firewall.zone_mesh.input="ACCEPT" +uci set firewall.zone_mesh.output="ACCEPT" +uci set firewall.zone_mesh.forward="REJECT" +uci set firewall.zone_mesh.masq="1" + +uci delete firewall.fwd_lan_mesh +uci set firewall.fwd_lan_mesh=forwarding +uci set firewall.fwd_lan_mesh.src="lan" +uci set firewall.fwd_lan_mesh.dest="mesh" + +uci delete firewall.fwd_mesh_wan +uci set firewall.fwd_mesh_wan=forwarding +uci set firewall.fwd_mesh_wan.src="mesh" +uci set firewall.fwd_mesh_wan.dest="wan" + +uci commit + diff --git a/net/wing/files/lib/netifd/proto/wing.sh b/net/wing/files/lib/netifd/proto/wing.sh new file mode 100644 index 0000000..f490422 --- /dev/null +++ b/net/wing/files/lib/netifd/proto/wing.sh @@ -0,0 +1,169 @@ +#!/bin/sh + +. /etc/functions.sh +. ../netifd-proto.sh +init_proto "$@" + +proto_wing_init_config() { + no_device=1 + available=1 + proto_config_add_string "ipaddr" + proto_config_add_string "netmask" +} + +proto_wing_teardown() { + local config="$1" + local link="wing-$config" + [ -f "/var/run/$link.pid" ] && { + kill -9 $(cat /var/run/$link.pid) + rm /var/run/$link.pid + } + env -i ACTION="ifdown" INTERFACE="$config" DEVICE="$link" PROTO=wing /sbin/hotplug-call "link" & +} + +proto_wing_setup() { + + local iface="$2" + local config="$1" + local link="wing-$config" + + local hwmodes="" + local freqs="" + local ifnames="" + local hwaddrs="" + + # temporary hack waiting for a way to delay wing interfaces until the + # wifi sub-system has been brought up + sleep 15 + + config_load wireless + config_foreach wing_list_interfaces wifi-iface + + # start click router + if [ "$hwmodes" = "" -o "$freqs" = "" -o "$ifnames" = "" -o "$hwaddrs" = "" ]; then + logger -t "$config" "No raw interfaces available. Exiting." + exit 1 + fi + + local profile rc ls metric prefix period tau debug + + config_load network + config_get profile $config profile "bulk" + config_get rc $config rc "minstrel" + config_get ls $config ls "fcfs" + config_get metric $config metric "wcett" + config_get prefix $config prefix "6" + config_get period $config period "10000" + config_get tau $config tau "100000" + config_get_bool debug $config debug "false" + + local hwaddr=$(echo $hwaddrs | sed 's/ .*//'); + local ipaddr=$(printf "$prefix.%d.%d.%d" $(echo $hwaddr | awk -F: '{printf "0x%s 0x%s 0x%s",$4,$5,$6}')) + local bcast="$prefix.255.255.255" + local netmask=255.0.0.0 + + if ! wing_template_available "profile" "$profile"; then + logger -t "$config" "Unable to configure router. Exiting." + exit 1 + fi + + if ! wing_template_available "rc" "$rc"; then + logger -t "$config" "Unable to configure rate control. Exiting." + exit 1 + fi + + if ! wing_template_available "ls" "$ls"; then + logger -t "$config" "Unable to configure link scheduler. Exiting." + exit 1 + fi + + if [ "$profile" = "" -o "$rc" = "" ]; then + logger -t "$config" "Unable to generate template. Exiting." + exit 1 + fi + + [ "$debug" == 0 ] && dbg="" || dbg="-d" + + export CLICK_BACKTRACE=1 + + /usr/bin/click_config -p $profile -r $rc -s $ls -l $metric \ + -m "$hwmodes" -c "$freqs" -n "$ifnames" -a "$hwaddrs" $dbg \ + | sed -e "s/__XR_IFNAME__/$link/g" \ + | sed -e "s/__XR_IP__/$ipaddr/g" \ + | sed -e "s/__XR_BCAST__/$bcast/g" \ + | sed -e "s/__XR_NM__/$netmask/g" \ + | sed -e "s/__XR_PERIOD__/$period/g" \ + | sed -e "s/__XR_TAU__/$tau/g" > /tmp/$link.click + + /usr/bin/click-align /tmp/$link.click > /tmp/$link-aligned.click 2>/var/log/$link.log + [ ! -c /dev/net/tun ] && { + mkdir -p /dev/net/ + mknod /dev/net/tun c 10 200 + if [ ! -c /dev/net/tun ]; then + logger -t "$config" "Device not available (/dev/net/tun). Exiting." + exit 1 + fi + } + + (/usr/bin/click /tmp/$link-aligned.click >> /var/log/$link.log 2>&1 &) & + sleep 2 + ps | grep /usr/bin/click | grep -q -v grep || { + logger -t "$config" "Unable to start click. Exiting." + exit 1 + } + + ps | grep /usr/bin/click | grep -v grep | awk '{print $1}' > /var/run/$link.pid + + uci_set_state network $config ifname "$iface" + uci_set_state network $config ipaddr "$ipaddr" + uci_set_state network $config netmask "$netmask" + uci_set_state network $config gateway "0.0.0.0" + + env -i ACTION="ifup" INTERFACE="$config" DEVICE="$link" PROTO=wing /sbin/hotplug-call "link" & + + proto_init_update "$link" 1 + proto_add_ipv4_address "$ipaddr" "$netmask" + proto_add_ipv4_route "$prefix.0.0.0" "255.0.0.0" "$iface" + + route -n | grep -q '^0.0.0.0' || { + proto_add_ipv4_route "0.0.0.0" "0" "$iface" + } + + proto_send_update "$config" + +} + +wing_template_available() { # prefix, template, default + local template="/etc/wing/$1.$2.click" + [ ! -f $template ] && { + return 1 + } + return 0 +} + +wing_list_interfaces() { + local channel freq hwmode hwaddr ifname mode + config_get mode $1 mode + config_get_bool up $1 up + [ "$up" = "1" -a "$mode" = "monitor" ] || return 0 + config_get ifname $1 ifname + config_get device $1 device + config_get hwmode $device hwmode "11bg" + config_get channel $device channel "0" + [ "$channel" = "0" -o "$channel" = "auto" ] && { + logger -t "$device" "Channel not specified. Ignoring." + return 0 + } + freq=$(iwlist $ifname freq | sed -n "s/^.*Channel 0*$channel : \([0-9.]*\).*/\1/p" | awk '{print $1*1000}') + hwaddr=$(/sbin/ifconfig $ifname 2>&1 | sed -n 's/^.*HWaddr \([0-9A-Za-z\-]*\).*/\1/p' | sed -e 's/\-/:/g' | cut -c1-17) + freqs=${freqs:+"$freqs "}$freq + hwmodes=${hwmodes:+"$hwmodes "}$hwmode + hwaddrs=${hwaddrs:+"$hwaddrs "}$hwaddr + ifnames=${ifnames:+"$ifnames "}$ifname + /sbin/ifconfig $ifname mtu 1900 + /sbin/ifconfig $ifname txqueuelen 5 + /sbin/ifconfig $ifname up +} + +add_protocol wing + diff --git a/net/wing/files/usr/bin/wing_status b/net/wing/files/usr/bin/wing_status new file mode 100755 index 0000000..eaddb99 --- /dev/null +++ b/net/wing/files/usr/bin/wing_status @@ -0,0 +1,135 @@ +#!/bin/sh + +# Copyright (c) 2012, Roberto Riggio +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of the CREATE-NET nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ROUTES=0 +STATIC=0 +HOSTS=0 +LINKS=0 +ARP=0 +GATEWAY=0 +PROBES=0 +INTERFACES=0 + +show_status() { + + [ $ROUTES = 1 ] && { + printf "Routes:\n" + write_handler lt.dijkstra true + read_handler lt.routes + } + + [ $STATIC = 1 ] && { + printf "\nStatic Routes:\n" + read_handler wr/querier.static_routes + } + + [ $HOSTS = 1 ] && { + printf "\nIP:\n" + read_handler lt.ip + printf "\nHosts:\n" + read_handler lt.hosts + } + + [ $INTERFACES = 1 ] && { + printf "\nInterfaces:\n" + read_handler lt.interfaces + } + + [ $LINKS = 1 ] && { + printf "\nLinks:\n" + read_handler lt.links + } + + [ $ARP = 1 ] && { + printf "\nARP Table:\n" + read_handler arp.table + } + + [ $GATEWAY = 1 ] && { + printf "\nBest gateway:\n" + read_handler wr/set_gateway.gateway + printf "\nGateways:\n" + read_handler wr/gw.gateway_stats + printf "\nHNAs:\n" + read_handler wr/gw.hnas + } + + [ $PROBES = 1 ] && { + interfaces=$(read_handler lt.interfaces) + for interface in $interfaces; do + printf "\nBroadcast statistics ($interface):\n" + read_handler wr/es/es_$interface.bcast_stats + printf "\nBroadcast statistics HT ($interface):\n" + read_handler wr/es/es_$interface.bcast_stats_ht + done + } + + exit 0 + +} + +if [ $# -eq 0 ]; then + ROUTES=1 + STATIC=1 + HOSTS=1 + LINKS=1 + ARP=1 + GATEWAY=1 + PROBES=1 + INTERFACES=1 +fi + +while getopts "rshlagpi" OPTVAL +do + case $OPTVAL in + r) ROUTES=1 + ;; + r) STATIC=1 + ;; + h) HOSTS=1 + ;; + l) LINKS=1 + ;; + i) INTERFACES=1 + ;; + a) ARP=1 + ;; + g) GATEWAY=1 + ;; + p) PROBES=1 + ;; + *) ROUTES=1; STATIC=1; HOSTS=1; LINKS=1; ARP=1; GATEWAY=1; PROBES=1 + ;; + esac +done + +show_status diff --git a/net/wiviz/Makefile b/net/wiviz/Makefile new file mode 100644 index 0000000..053517f --- /dev/null +++ b/net/wiviz/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2006-2009 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:=wiviz +PKG_VERSION:=1.0 +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/wiviz + SECTION:=net + CATEGORY:=Network + SUMENU:=wireless + DEPENDS:=+libpcap + TITLE:=Wireless Network Visualization + URL:=http://devices.natetrue.com/wiviz/ +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +EXTRA_CFLAGS += $(TARGET_CPPFLAGS) +EXTRA_LDFLAGS += $(TARGET_LDFLAGS) + +define Build/Compile + $(call Build/Compile/Default, \ + CCOPTS="$(TARGET_CFLAGS)" \ + INCLUDE="$(EXTRA_CFLAGS)" \ + LDFLAGS="$(EXTRA_LDFLAGS)" \ + ) +endef + +define Package/wiviz/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ + $(CP) ./files/* $(1) + find $(1) -name CVS | xargs rm -rf + find $(1) -name .svn | xargs rm -rf +endef + +$(eval $(call BuildPackage,wiviz)) diff --git a/net/wiviz/files/www/cgi-bin/wiviz/get.cgi b/net/wiviz/files/www/cgi-bin/wiviz/get.cgi new file mode 100755 index 0000000..161fc75 --- /dev/null +++ b/net/wiviz/files/www/cgi-bin/wiviz/get.cgi @@ -0,0 +1,15 @@ +#!/bin/sh + +WIVIZ_PATH=wiviz + +echo Content-type: text/html +echo +killall -USR1 wiviz >/dev/null 2>&1 +if [ 0 -ne $? ] + then #### Wi-Viz daemon not running, start it + $WIVIZ_PATH >/dev/null &1 & + killall -USR1 wiviz > /dev/null + fi +echo "" diff --git a/net/wiviz/files/www/cgi-bin/wiviz/set.cgi b/net/wiviz/files/www/cgi-bin/wiviz/set.cgi new file mode 100755 index 0000000..17b4787 --- /dev/null +++ b/net/wiviz/files/www/cgi-bin/wiviz/set.cgi @@ -0,0 +1,3 @@ +#!/bin/sh +httpd -d $QUERY_STRING > /tmp/wiviz-cfg +killall -USR2 wiviz diff --git a/net/wiviz/files/www/wiviz/adhoc-idle.gif b/net/wiviz/files/www/wiviz/adhoc-idle.gif new file mode 100755 index 0000000000000000000000000000000000000000..05e479f78bed9f924ccdc093afe0ee94158d44ed GIT binary patch literal 332 zcmV-S0ki%`Nk%w1VKM+R0K@hY%Z-IFWY}8JstsRTLJYHejSl z7!#;At4a?Y5U(|{Nfa2iHL8&h91?JWqz@XWSW2~25*!!2l?@Ob9U2wa6&f26&^k{K e6WA5p-EmaIP3h|E?CtLF@bU8V^!4^SApkpU)sKz< literal 0 HcmV?d00001 diff --git a/net/wiviz/files/www/wiviz/adhoc-idle.png b/net/wiviz/files/www/wiviz/adhoc-idle.png new file mode 100755 index 0000000000000000000000000000000000000000..b10b102ec9fc7e6ad2fadb6de7a27e4ca51064ac GIT binary patch literal 730 zcmV<00ww*4P)l&H6vzLsVoa1uW=R$^WlEH;u#}06DnR(!O z-Zzu^OA+Gx{sj?Du(6FC$3d-DOWR=>B97y2ZaO9_V=N>Hf+J?W%Wfyvb!0_>v$>UoBmdR$aRreDn*Pm&(F`DY`b2suk}AYJwXV8D2jIW$;=%9Kk~+6 zv?9#h)X$FNpjxe_eNsw{$KzZggb*O2TEE|S^TuK%gov8@St$jjRN8lce~-mtk;|V> z1WA(A^2TDcwX)3Ta}0;WH03@%KIXEQQsUs?pz!>q3DLxH{MNf-D^kk8X1ZN5O}{fk z`;<72)AXDqNp8QUhyBjPKFf4EO@(-#_dBn>>5AMM+5=c7iYSV3a&l7Gr;(6KrBaHJ zhldBauB*?;zZY_Kbrmu5z{H1A3PK2+pPz%7!=i<{!KdS)NGR=E+)pR<=Xf%T3IJ!RT6glLY(k@onJBgGMqtOV!>pKasyq74Y z&}y|%tyX8u+%ypZ?B}Z6)1`}23Sk&xKA*3Rb6r>0Wp~VMv=W-Ve0;dMx%te@*8rM$ z{qX^-Gu0!a!D?$7vlk(nAPA0#=u`H$BuQpvtboO0u~;k?i^Y!|NnnuV`Cu6Km(xolZBCiL771ZWH!i83~Ub$Of2xwk?KFO zr08Uh)%*)9O1#!at-rCR?DX5J{SP)&_~`kwH#SPy8gMhd{vqYicKZFRk5P#)TmDHG zF(zgUD%5w#mN&V4}hN;6Q85e*+th2Wc%0CWU^cb38UK WI@&E^oOS2K#>L0`6=nndYYhO(uccxD literal 0 HcmV?d00001 diff --git a/net/wiviz/files/www/wiviz/adhoc.png b/net/wiviz/files/www/wiviz/adhoc.png new file mode 100755 index 0000000000000000000000000000000000000000..57db25c28a95ebefeaebb9ffe5c44bd081caf14d GIT binary patch literal 714 zcmV;*0yX`KP)W7!zoT&%kg+*%f7VJ4Bq?RAmq zg&L1Uv=l&NhLT0w2T=)WXMMjX6{yu2km*DJxXIpZy^;6+anaeJ=k@4x+|Q=F{m z&cjHEE7keVjr|VK#2vugq^wTq7~U`&SBgn=&fr`aP67J>_=Fd`YDTahq1tZ0kE{9K@xQ(J~*}iWm_cwL^>1TUsu( zh3u%;1D`Ax62zw(ZdTj3>59}Z@6rc;7?*AiIuh(4m~g!pyHih?v{|19qRhLb^FPK4^ocp*@wpC;oE^{G24 zl?er#s&SBKc{@&WNq*?W$-s;QPsi)0>D$GB>Z#jF9BNV&RN?%e4-miA6{-wunyy5` wl?X|2r8?GqZ%T!_uRx2%VzF2(7K_D*UmNVr>*VI!-v9sr07*qoM6N<$f|Dp!RR910 literal 0 HcmV?d00001 diff --git a/net/wiviz/files/www/wiviz/ap-idle.gif b/net/wiviz/files/www/wiviz/ap-idle.gif new file mode 100755 index 0000000000000000000000000000000000000000..a9296961126dba336d6d7497a0046391ce7bc904 GIT binary patch literal 812 zcmZ?wbhEHbG-5Dfc*ejmefsoi)22;H#N7kwzYS3c6Imk_VrJg zIBD{fsne#WQeCvTU73%Ajg^g)S4do5OLu*%Iv+bT z0|O%qC!eUa(w==y+Jc;ij~rp;7Lrg<)79ChD|e9T$`NKRfnBP1_Gybge9Z9lx%^9m zed=QTm)>8yaZA^5uiMlE3W<%4na3uCUQl2<$}M%*ZSI2v#zRajtXX$YJ#B31lCV%J z^I~*rZsp(;(@9wHiiurNJ?6p<#Yw{4Lh@!YD-0GcXXTM`+A^u}u=@c&osbC}7ZaP? zc%&?91QL^2d8BPBDvB3AV&N22Jk+Pr*u>f+W!-S1;2M)#x2Q&^-yDaDO-H#U&C34V zc<2+*EoqdnM?xmqtyjjj;f=+s*Oz%^%yMk5U3~05VL~nE#*T@H+xz7m>Rwb#{3)#v^|v%C2Hg@fMW{&V+~KAOVB$Y2cs(m)5Y literal 0 HcmV?d00001 diff --git a/net/wiviz/files/www/wiviz/ap-idle.png b/net/wiviz/files/www/wiviz/ap-idle.png new file mode 100755 index 0000000000000000000000000000000000000000..a6e6fb3202556994679a960597c983ac8d135397 GIT binary patch literal 814 zcmV+}1JV46P)3`ER47LQ(Iu)V)D2;GiA5r8j7S z43hZQp`l_29*R&wgn}-Em!IL7YoF5)Ao|^*!CvZ%ZaE-kD5*f?-jIk5O7_`<+ zQc6K7)zq=pLP`mxR8z+RxumrQ5uN#X@!o#j8R6D|d#AN-K(y8yFfMl>>)7vDSX`@#3{cT)b4* z^+u|y3T0VtK^G2!#A7rtD~jT$kB?TO-;0Zj4@9)A>l#GVoZe3B zTkZOk5<(zN(?wAfAALQv5;Wf3-TfGiM*C3|y(`NSN~vZ#ts8fvptVMlBuLZrswj$2 zZFp$)K9XhGB@taoDN&Xsq?7=#5%CHku(!8&Pejw3o13p~_1*dnG0*e9wRQ|(OhhNo z%dNFjB3iU{p>leatFBX?=XSMPHP5G~r;H#N7kwzYS3c6Imk_VrJg zIBD{fsne#WQeCvTU73%Ajg^g)S4do5OLu*%Iv+bT z0|O%qC!eUa(w==y+Jc;ij~rp;7Lrg<)79ChD|e9T$`NKRfnBP1_Gybge9Z9lx%^9m zed=QTm)>8yaZA^5uiMlE3W<%4na3uCUQl2<$}M%*ZSI2v#zRajtXX$YJ#B31lCV%J z^I~*rZsp(;(@9wHiiurNJ?6p<#Yw{4Lh@!YD-0GcXXTM`+A^u}u=@c&osbC}7ZaP? zc%&?91QL^2d8BPBDvB3AV&N22Jk+Pr*u>f+W!-S1;2M)#x2Q&^-yDaDO-H#U&C34V zc<2+*EoqdnM?xmqtyjjj;f=+s*Oz%^%yMk5U3~05VL~nE#*T@H+xz7m>Rwb#{3)#v^|v%C2Hg@fMW{&V+~KAOVB$Y2cs(m)5Y literal 0 HcmV?d00001 diff --git a/net/wiviz/files/www/wiviz/ap-wep-idle.png b/net/wiviz/files/www/wiviz/ap-wep-idle.png new file mode 100755 index 0000000000000000000000000000000000000000..a6e6fb3202556994679a960597c983ac8d135397 GIT binary patch literal 814 zcmV+}1JV46P)3`ER47LQ(Iu)V)D2;GiA5r8j7S z43hZQp`l_29*R&wgn}-Em!IL7YoF5)Ao|^*!CvZ%ZaE-kD5*f?-jIk5O7_`<+ zQc6K7)zq=pLP`mxR8z+RxumrQ5uN#X@!o#j8R6D|d#AN-K(y8yFfMl>>)7vDSX`@#3{cT)b4* z^+u|y3T0VtK^G2!#A7rtD~jT$kB?TO-;0Zj4@9)A>l#GVoZe3B zTkZOk5<(zN(?wAfAALQv5;Wf3-TfGiM*C3|y(`NSN~vZ#ts8fvptVMlBuLZrswj$2 zZFp$)K9XhGB@taoDN&Xsq?7=#5%CHku(!8&Pejw3o13p~_1*dnG0*e9wRQ|(OhhNo z%dNFjB3iU{p>leatFBX?=XSMPHP5G~rLh1t?N)UMJavJmaWw_xnyinl#J9Rgm{TI z(IVbX2yMzjl4BPmBa%i+5wEk%lyD;iVWmxPH(URS{j|?N@Z3Gmea>Hq2n2>>G4--~?vHrn#;;-)ETdn@M6n{NyTidam3 z|6aDRApB$S!k8o`^V>TXi)DX*e{XMZcXxMZXJ>nRduwZJb92*VGHq;Z7>&lYwYAmN z)s>Z%<>h6A!LYQnw79tV`t|FDg$2D{KQ}iwJ3Bi)Jv}uwH90vsF)^Xj>Bh&$$HvA+ zM@L`1dNndKGCVx2)oO=^hBO+DTCG;8R7$0?zrSChQ1tcn_4fAm^z_K(^6u{LuC6Yb zOeU2|B@#(zXJ_Uzfyr%zj3TU%OMghF9+b8}NulRzM7 zY;0_3XsEBRudA!8t*x!8sp0ea)z#HiRaKRhm5(1kuBfQs@pz9OJ$m@?VR?Buhr=l= zD=R4}DK0K%v)L>bD?dM<$z(DZjJ&+O2M-?5>Ga&(+?<>o8jY5not>4Hm6@5Dk&%&} zo=&AwQ&Uq@Qc@@s3YknMkw`=$@#M*q2M7OF`G5a~0h|Q}0e}sBKEOVF0w4~64bq(; z5hx1~cK9T%q)Ej_AB(IHv;{8;9WghP(rj@<9Moz28qF+JmBT_JV1h|6%{g}~87GL# z9jyyEf+y(WAtTkth#m;MIo8cLG-*H-5_SN%X(%c^mneFuH0s#`+}|0Y9(|6mm&pmse0(7igJE`ArD= z^QnS}vfe=I`iVhxsp~xT;_6qCpS*nXJB|!^=TN?)U@aVd${Y;0MW?InZWKeXSD~(2 zJ{_v?W7!00&4+M~fjR)Szaob@Bt4Nfk*^_HSJR+-_tfYwOblo#UgoXD#ND+$>{jqA zVVQb^>5ax+!^VZ76K``3rS{Q_haGS69%y6~}+qj-0$CO`M332Fk>UGGRJW#uXA0gVeZ4Sc!Q9fc!P6yBN=%ej?N&t#TbL%+}T%zN;i^0B#YlnjO0Be zlF#^nD2trrz1PQb6Nqw(D7TQDLh>b&?yu)aavjMTqFhJiT%E1^>pN~b-$s8?ZlQ9< z=F$Y7mpDBE1UW+v2mtAk8h!KrACy4`blI(TZ27w%ZCc{4nI&G?|b}NdK*|lp|sK39TJ$v@Bd-rat)hd-r zg@uI$?%cV$1@(M~oE@ktB!24`epj{zL)DIYf-? z+_^J8IyxHg`~4`2LPtjj9UUFCx3{Ax3azcJ_FeHAnlk_EyDvKwrFG5<5So5$mcA3l88-`3V<6ST-)xpIZ8 zSFdvI+BK%9r@49aCLWImkH>=$0wDzZ_wNUYjg5^Bnv4=an1ac{2}zcDLcnajt&xx* z|00LLPt763xLN(CkPH~f?eqB}LqkLMFd>Yz%jfgt^LY*(I>gztXYu>}JbwIm!(@u0 zuw%y#JRXlhY@FLbj=$N9x(;JugJA!CsSrOoGqjVglObd}2w0KQbv@MI-;b{A_EW7^ zsaC7_d_Dm7?b}DST4iWxi23<>dz_Tgep*{w-J~U1J|pK?KWZZJ;^*w#d6SPnUbMy6YBk#1+Z)or$b}%7mt&G5s?E=ZdLah+Uf|#E z(9s~Ax~|WbN+p*FDJ9iv6@YK|R%mZ;L6@K?l5cf&Q!X37wZvP3n!t~9L9KGA*TL0< zJ4XaY*>D69?qtGR9l3r0c)i}-!omWYrco-DD3waAuCB7Wy4s8w`Mg9?6f{k<#gs}V zq?GQhyq?(W@1@D@7i|%1Yir!SdzY@( z#;g4K=aPYe0W?iR(=^KEGA~}dKnRg>3=8tEz2Z5CxPZ;0E+UO`B+J|QkreO}0=qoP z0s%(Ik|hpCp(v$H-@ku9GCVwNZZ6TVbkZ%=o>kpLpRV^+n$hhR4bsYx|W-CFbYnSzKI9 zr&6i&j%bAW9kXB-juw8!2LOBs7?E zwOTE4@7_J0J$vRN-blpK(h_rXa})}NL@Je9?=2)521u}n1V#Z_bj)oy}iA3b#>Xdx324~tgNuSyv*|Q za;{pf#wI2voXyh+f&k-$FbmX@__n$Z?Vak{~IEW25q% z#pvWNIe(_AYPXa!0z`xm^+z~T%9s!$Z8uczInQCN_&QNzyXBBXNRgnvPkAM*FDMTf zu|EK~?XT?BRaKP-4<581RaNCC=5_mxa-Ap_?Jp@!(EQ_rkxVhZOPY7g4*<@4r7pCu z4Nku*CjdXcB@JeI-vo_ot#zm8k%ak(2!fv1!}Kd4$t5HijH5PQe^NQoJR<8bI>tAP zSLVgbBLY^a&%biqe+!$Oe=`yJpTM?|t%hwOTMgSnwi>pDY&C2P*=pDpvemFHWUFCY f$X3JujgbEUE)R2=gkRs*00000NkvXXu0mjf(9*hj literal 0 HcmV?d00001 diff --git a/net/wiviz/files/www/wiviz/ap.gif b/net/wiviz/files/www/wiviz/ap.gif new file mode 100755 index 0000000000000000000000000000000000000000..7eb5b3a6bb5234b9822b2a01e0eddb3169cd1cf4 GIT binary patch literal 1468 zcmeH`c{AI20EfQ_rA0#Psw<&ut!itvW7%yrLC{ub!y0y4x~Z8MmKkx3?FuH5#4(bV zsyf2>MZ|r@vF?&Y4p+sI4pntm)RmZVuBqL=iT!IoZ{V4Ep85FP^LBN6>I|I0ApqbE z03`ss0LTFl0MG(J1puW0&;UpSARGV!I6XZ*IXO8#K0Z1+Iy^i)I5^nf-{0HYQ>j!+ zrE+(7cV}m3dwY9pYio0Jb7Nyep-`-^udl7Gt*)-FtgI|AFE1@EEiNuDEG&Hd_;G%I zer|5={rmT`v$HcZGwuYfDQDkH>3nZfPD|>N9J}A#%>$5NHBDCWM^%U;0>_k_ zUAaZR#`1M~Tqhmt4vorYeOqM}am)C=|uCFLA42Op&GVgEhWgaCZyWG!c{1#~Qe zPu06oPgXzwT{BWc|1MGmGsZ(~c0`a4O-|HMv0(;x7I9Qv=TSUWA8j$=WfYpD660Ma zO+$jL&)>>4eqdohgWuj75W+o?OE9CynYm(1^+&-gq)-u7YWd4;Hq6l5G}g<|5ACmM z@)S~OAvJ0a=Zah$(1DTZ2!Yrr&`V8J9uSyIHwlB5(yg|6A`}H@Y>z`mKjYDjp*R)R zG`w1sZsk`SjD#X8FL6;W{31-cX&3_|Hv7E|t3T%z8s5sZPN?U5o5xJ^GLXTR z;##JX`zHeBy78%&JDxZrL(&tX8hrZgDr-DGB#q!Yvj|rS9rWbvobHSHbJy=#4sBlV zgU@E)z@F?}_3!`U0V59R>-jl(YFYbT?>Tfx#tHQAjuHp8fA&)eK0PTx3|?+x#Y(hd TKk%fN^OAW(mpJt}H2CQswVNTv literal 0 HcmV?d00001 diff --git a/net/wiviz/files/www/wiviz/ap.png b/net/wiviz/files/www/wiviz/ap.png new file mode 100755 index 0000000000000000000000000000000000000000..ccfc86431c5669cdf583f9be708d23b37a5384c9 GIT binary patch literal 1825 zcmV++2j2LJP) z|DJo!J!fEuA>JS)*WcjWlSpQdLeUbEd(1QQ{gr)7XiOrRL9+S%$VlErBKd;%NV3TS z?;f3%hd`1=lH5bGh~z6Iliy8|WEII0NmkLg(IcDu?urM_w^v`1duS{M0<577S8IQhZ4PNF)1iaWPP_)0X{)7{8?iL=ZeZ43Sl!!~zM6$ZeObMwLGi z1LEYl1CUH67cXACn3|iLi%d*R;PrYDLLj9?*LB+MHqB;}Mx#NkR^#s7yR5CPmGk-h zFBGpVA&HSA0u&JZ)#Vkyl9gOC`o)O3;xTemkc5Ha9@!^Ufr>(6_SC6U>AAVNNH`oO z6bdmmHpbZ47^9=3ghC;L!61P^fIuL?*w`3XuU_TSrAyIdGI>kWG&{~R2x9z`5|HSz ztN_G$MX`^pZ?MOKGXEh46v)-F`(Ql>qjKYf2kk{V<<$-lQnD+DS{c?fj}T};lc&yF(HKO_aKBq zAx@k)fyd)94a;&LsPGSK;Z&Fl8wKZgUm{^DmTOmBnIUE=h}fR$cDu3Z>1n#%t}{BF zjx%&!$1n^!oeqX!xSo?zIwKeix{a2U_=1XcJ*)g*0U|&ZEF1e0v0wTZASv%52vr0z zOCcVQCptMf=`!5TPOVmpR;%S)x7%%WU3W;?#0OpmsSlrP$h+ zh~PdFxC(sk4kpaii6M6rfY(`BBFwr^T`6VZ(W6H+ z8V!epJ=8eqN5)PF8yg!{!!Qbf-Au)J->M$eno2rnh@FBDAYvYd1=N&iDlGDQE1M+E z4A<>;)6btjuReSB%n9;-B>ItQwOYJ-^@?`8onBd4u?On!AcU))5zC?;Z zgkM{yr@P@*V*11E!~3ZNOe4=E|4&9Z@T=Q;O^kQ04(6p%)^HddGX?f z%kX|AwzjrdTU(=At!DE1{BCa{De_}7oF#)D}#i+1c4)dwZMh?d?jZ(@8BaFRRVd zEP@DGVwg$gSB^~MI+6?@k>(_6ORg5P`*w({K!pXWNTTEw#b)JM#_Z&7tFLLAHYue{ z00|*PZwg0BnG!-2oQBFh=MBsi-!;_SZWSa6@?_}kQx1gv1?4fb&IbUu{J>sa(=>Vc z@?~denkEl1uUl`DRg&CtzN8Gm;ExYxFs1kz1>Uwk0I26mk86(%s$PxjK$s6HfK}cP zKyQiCtMn$4I3JKe@S~%#^jjduZ6rmoPWhfprDCv0c42mmZx#o}#r_@v+toJ@eC~(B zA?H7gNB$=;By!v^By!v^By!v^By!v^By!v^By!v^By!v^By!yFe?#OOx4X)2eI!jG P00000NkvXXu0mjf4Ax%f literal 0 HcmV?d00001 diff --git a/net/wiviz/files/www/wiviz/pip-idle.gif b/net/wiviz/files/www/wiviz/pip-idle.gif new file mode 100755 index 0000000000000000000000000000000000000000..fa923bdf162888c0df687cfd53cc96ef0b9ba2a4 GIT binary patch literal 190 zcmZ?wbhEHbnkfO%gf74OG}H2it_XGb8>PrGc*7H z|IdH~6o0ZXGB8Lp=zzpPb~3P9KTzvSIjQsF&=id%8O@y{jS5E|6*06-T+r+8XXvm* kY=ZZ@8MAz*ondt|>hdx&Vn3RB(Zy?a*Jn<>ZYKt70J>FCssI20 literal 0 HcmV?d00001 diff --git a/net/wiviz/files/www/wiviz/pip-idle.png b/net/wiviz/files/www/wiviz/pip-idle.png new file mode 100755 index 0000000000000000000000000000000000000000..3fe25fe333553b289a11a54d04a9a4c7f5b51e78 GIT binary patch literal 331 zcmV-R0kr;!P)aCk08sqFf1hxm`?9 zNCN$)^XEI~eCHhaC&bZ6lH|@9vl2qQPYK4DjSwRAeg7BWc9Po&AzmEEK}w0%n!2tT z8{7l0rwK`tya5}}^RR6jtu+8?nocK$K@fc1jDG04F0SjMl%gz4@;pD0hhab|6;35R zDy3+ehN`OA@AtDs`@W|v%ZJ$xUDuIi+1bmqZHsN&030Q4&oW0eO@owjdnz!-#Fxms z-43laj^o5I|HJ3ua0siaLP`mMQi`tYST2{VD2hI21pw>y`l%?2*s`qWG4!)oEMnjH dzpqKYia)m{a|fqo=sf@c002ovPDHLkV1lhjlN0~| literal 0 HcmV?d00001 diff --git a/net/wiviz/files/www/wiviz/pip.gif b/net/wiviz/files/www/wiviz/pip.gif new file mode 100755 index 0000000000000000000000000000000000000000..1c566e9aa2d2085ed1c5f71a544fe470c39e19ef GIT binary patch literal 190 zcmZ?wbhEHb-|G|I(2`K(# zVPs&CX3znNf$U^pwSJ)1mm-Gv$S`kff80i(xBdH?_b literal 0 HcmV?d00001 diff --git a/net/wiviz/files/www/wiviz/pip.png b/net/wiviz/files/www/wiviz/pip.png new file mode 100755 index 0000000000000000000000000000000000000000..5c05a737ae4ac87ecadf78df815281fc6663e270 GIT binary patch literal 323 zcmV-J0lfZ+P)(3`2IR2+|(_KcIi$E=$0ys;V_C zfm}mF#zoMUE*Sz|b@SfmocEl2;g6E);F_RqFhfDSCSWk3Aik2`8^CJgE)?YCkPbF2 zGBl4Qlnpk3(>lR5!37ZBbB2QjK!)assF~#}xxB3s{ByQ(ueNY-CiV36bar;Owzf7kHPzSGS5{V*mX;P373JsW=j7yMW@e_P zr6naL#mC1-Mn(n&1^M{+czSxexw+Zf+gn;%8XFrM85#Zm|DS;xK=CIFBLjm5gAT|r zke?XX{yR)5@X(R!Ke43fWRBJR3oA;z)<&(rv8L?w+p7H!HdOfN&EC0u^2;2PsdiI^ zqG!k@DoOFC=a$v0iOQ=rixnl8mP@HL_b65;)-^QsOi^o%>!|3SI#oqNJ$ho}oF&Z? zDp6_*0?U`Ko3|iRRX}y!HklQXYE|3TsY-2(P}#C~sf==zy2Rw8bLK}W3Z7jeuXu9t z<*DZ*6+~~|y0%MD@%}1N0r{+hA?osCH{}Hdn-s-GrQ{T6*92_-y;RlWgz%T;huHX} z3_=zNG&-^JUCrW+N@`+m3zty{QTTqGiJg^|iASS=;UE*AjGRTp%LPsDogQ8m6Fg2% zX69C8^7}9&!J*;*dN^PBjt4`jmNcj)0F@wmzJq(7tAo&HQD*| z^NY)~<0BhcIM3+1pGh;SvpxOk`9kmeKeC^;2z)jzbmEXJNSIOkq>`nHQ?9|ZzbM4O niK&t8(Dr*3ovbrXDRk9t;GfUD`-)M!z?2M&N1YMCLQ zH`#^W(yqLzvWZr&?aO%M0n-V&Xi}lcbs`~0(~PDI+Y^7uaa`4KLBEYg8qGQHb3R_3 z8Npa%jWyO-V~sV|SYwU#Gm|nZL*;ULPEnLa;E|#z8&b-ulgUg@PU8Fi$eehd$E{npa9wxa zvaCOQp4T6l@qHc62#TUCJC1`8V$^={JP*sVGEo#Qj@&rMK!9h>W^5$LoN9xFN zoCBMS`#-oN)e#UW<$GY+w(XIF9O(a*m5JjY%*@QVA3l6o6hh$p{z$gsY&OfCJ9n@w zi&m?J@B8zXW&PGP&3VhRels&ObHy}G-oAbN{-QokowX{J%3lhF!joJs$Li|pg#q&U zeB5tRN*u?*G)-n_XGx_}_`Xl4(}`dAgSG+eL{U^%6vZ7325use*x0X@uLCKU%X3$* zT-jJySm4Er7hjbXRaGgKN^xl(0Oa%ec=TztT7+SUs;a1}il%8yOiYkUrReo~gkgy1 zd2~9R7&Hh1fcie<#$YhmP!wh7;5K3C7%znQrx2o+PN&Z`Z>7^|3WWm2ViDi>ky7G$ zUJTIfcJY0mow=+0``$0<7Btj$AJq@goDLJckkpSoG-oepb8~Y{PEH>2(QGyef&kz5 zv2FVRZbM30KG7ownwgn#-@SYH0W)hc)I-X#bE8jS{u-b z$L8iH0JU0;?d|Ou&-4Cx=8aXQQu$Y{R?Bs}U8Iyp&Y7l3sZ=7D%dxe!6`wB@3S_g{ zz37L#_*I?Oz0Zq3F8x&-^B*2sXRj=SARr7wW@l$fCO==(>2!GY>J^^nQ7V<<-dkB& zK}xAio@#wxilQt@DW5%l{5Vc!Hk+kXDxvE-j^ptB`Evk-5a_y&=Xq?mex!A8n%2GR zgsIbAoB$xePX>68O{U)LqBgdEmHm&>uRun+^b+wIS5JqrY&QmOp( z@ZrOZs;VTDNmNyh4ePqj_3PJ}o}S)oP7S=@nfSMjq4rM8!13#*-t;K_$zf`03MnO; zrXhsDvaBQ7ab0%@SYBIOJG->@LB6#tYpGVNVcRy2q(M+KL#*O6T>iYUH8+7!%Uwf{{K|+W~2tm8uj<-==*GZ?-7={raCzDCS zFr?S(5d;DK{@#$Q>pF%pJX^4L-y)^NG)->bzKy170P#lB?RM*f!C-0FhGCG)2%_8CW@jZMNyW&G+%u+NV#0j0=YyYF&{-yMp2X+kOAh?=`@
    `t$z}fiFxF-1zv-!< UzT-5&xc~qF07*qoM6N<$f;oeKE&u=k literal 0 HcmV?d00001 diff --git a/net/wiviz/files/www/wiviz/station.gif b/net/wiviz/files/www/wiviz/station.gif new file mode 100755 index 0000000000000000000000000000000000000000..c8a075f4200ea05bbffbe1ebddfb65ab61c4227e GIT binary patch literal 929 zcmV;S177?`Nk%w1VKM+R0M!5h05kssGx7#ARlatt%f4>P|RGnpJS zj2|<9CNpL!Gg&M%OfNG(VsB|P|Cu)Rl{xE@KiG^$#f40=e^01`2^ASJ`d%mV0E&nPj58EIW01K4+Lxk~uFZF)=fgk3^!Gn<^|eJPZ#lo_!ugid3biF**+l0ssj(tArtk zB%?~2HnOw~1OV0m0k^rlhp$b)sKUh8g=XyM@G0Rud2pg=(jhYJ=lYT(epqpp;OI^xYkz+lIWwX~wKkTE013l=L- ztY9&t=Z?CplJJ=EqO3du4s^^o!2(BG6)k3Dpb%jK1q&B6%$Q-KgzFM4LO%w}u*8l7 z)&eBR{Gvn)9DYI1z%U_#@#7UZ#8C12HH#cNT0}0=FrXoOq4mhF{myi;#Sb^hB_8Dq=veAfdc@07HHQ`u87t8A^b@0cASiz=CV-(N=^_HB`vLU>j7RVFc&7AfSs8SO5VHIqcBe zfwY)dL|r<>;93hW5T-!}7F0mNdCY~j+G;U)w%LIRI>^rqH{`%W4mZruf`lo=_QDIy zHTPN!JKTVRYxYxx)DGyZcu&5W1RcJ$@CGdb|ri=&y84shjD(kF81OWg$ DNjHN2 literal 0 HcmV?d00001 diff --git a/net/wiviz/files/www/wiviz/station.png b/net/wiviz/files/www/wiviz/station.png new file mode 100755 index 0000000000000000000000000000000000000000..8daf8df35abb3d9d3fa957748a0846dafb6e93cf GIT binary patch literal 2476 zcmV;d2~+loP)?{99XTghf$3_ZV-oV zZ!7g+538UgeOLm6Qg_LdVT-Z{>t)w*kjJnf%?%B@t)?40k+7?~N@ovNR4bDI#ctAv zd|xczd+zW2KEL1jo%=f%p6j`u>)Ais$rECX-;e;UDrG;6Y^z@o!o?U0SpbHZ<{kV% z7C48(Cr`zXebpPBCBq#ixz4|sK(dVF{Ihneza%3_LR*f>aGpt)`6F*3xryZBQ}S*X zlDya6tz^5%PxKx424|UMncsF`-g?TOZlet6$uQC0vEFJ!UGJNvHyL4)Wj^UFv;NTA z$hBvuHhjJ#nO zC;J+hEo!XnocH@C;Dauruc#x9x%foS>VEkdoxrRV||A^fkMCMd$esvwu*kSSY)LRHfN|X zj)P8+93prXUDvnHN`{XSm}E$!knCJv@5>g*aS2#K>4Mx;eKWGt=-a%F&6%!eD~$7* zb(wfvLsivuB9S<|u&~gtDV)Jz3P*~54cN)6&5jxk=_YJ56GkFODTJzKRY|S zA^Ly7LGNp@i4Thmb8|UHM@Px$^V86$yKR!k#Wauy63_+#keK`%h!NfuNHUo`;c~gA zcN_i9RN?0g)vo~H^ZCL;hzY|mKI|Iw0e6|i#K4ar(FLopz(4TwGZMQ3ak*UCP$-m0 zr_;NN{#LTcU>NTrgdm^KPXQnH8MZ))a2sT!R(3m|3!v3%O-A1ndIl+&JOsesbv?%ga$JC&*GOmA5<*-b9UVYh(9&saPx$i^b5?B8OPoi(LTf2y7>g<2VEY zfp997>OBc6JlHD)z`&y)mSx@2H0_+<@An@#aDe-^#e|ehR5T9jtTN`+>#iK?oo zs*2C&V_;wakH^F6>MG4<6U(xw)oLA3$8li2FI$mPF0@*$1w~O-9zkx}#tR{?3n9{8 zub0^yrA@Py{pK3>s7B?~*UtB3bgoM9nuV_hs;c5R4$WqhW51#2dDK-DWy&y&ORvBFI>q7@e9lh@g+j#RX*5lvR4Q@#@?`*o5NMi)Wm(*= z+@o@8h{~y>G(G*N=mEgNb~{+F2RZcF8fxJ-FTeaUjYfmT#YKw6BH?hD@$vBvV6|HP z+Sjc>+F4mXbLNa+RaM+>H>#?33~QRk(W6Hh8X8(JP9Io54q_h-BuA)tcJm^U|)qYjyp<5o&2^X-mMZAj;)3`FtLL)2B~&>Y!XMQz#Uu zR;y-v)9H6q-aW|U3IqZK0s+F|@Dl;5s)}J4*tU%jqO)A9)hdNTfpWRrDde5_v!kVz zN~M-{UH5C6hTH8X7!0DS>bA>eGr(%K%H6wniN#_FA#l6h)M~X(J0qo>QWRx+yZ&m| zAjxDh1cY5KS3*kZR}>}9`UiuA*XzaS^RW>U=q!=Vl*{GFWHMca+-Ni|NhzluFXVj# z*-D#00;E+{Mbk8VK3@k`RaJCdCzo6QfM*y6j^k`u$WH}iD+wV6Tdh{Y<#L6klwn0t q60B!34Irg7rIhFP0`OelR{bBXvzd#1Uw6p>0000 + + +Wi-viz wireless network environment visualization + + + + +

    OpenWRT Wi-viz network visualization

    +
    +Status: Monitoring
    + +

    +Channel setting: +
    + +

    +
    +
    +
    OperationMilliseconds/Operation" << (g_hertz ? "Megacycles/Operation" : "") << endl; + + cout << "\n
    + + +
    + + + + + + + diff --git a/net/wiviz/files/www/wiviz/wiviz.js b/net/wiviz/files/www/wiviz/wiviz.js new file mode 100755 index 0000000..dc67d8f --- /dev/null +++ b/net/wiviz/files/www/wiviz/wiviz.js @@ -0,0 +1,291 @@ +/* +This file is part of Wi-viz (http://wiviz.natetrue.com). + +Wi-viz is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License v2 as published by +the Free Software Foundation. + +Wi-viz 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 Wi-viz; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +var mv = 353; +var stupid = eval('window.attachEvent') ? 1 : 0; +var hosts; +var idle_timeout = 20; +var erase_timeout = 35; +var skew_x = 0; skew_y = 0; +var listening = 1; +var wiviz_cgi_url = "/cgi-bin/wiviz/get.cgi"; + +//What? You mean the POSIX thread API hasn't been ported to Javascript? Bugger. +function scan_thread() { + var loc = document.getElementById('wivizGetFrame').contentWindow.location; + if (!listening) return; + if (loc.href != wiviz_cgi_url) { + loc.replace(wiviz_cgi_url); + } + else { + loc.reload(true); + } + setTimeout("scan_thread()", 5000); +} + +function toggleListen() { + statusel = document.getElementById('status'); + statusbutton = document.getElementById('togglelisten'); + listening = 1 - listening; + if (listening) { + statusel.innerHTML = "Monitoring"; + statusbutton.value = "Stop monitoring"; + document.getElementById('content').innerHTML = ''; + scan_thread(); + } + else { + statusel.innerHTML = "Stopped"; + statusbutton.value = "Start monitoring"; + } +} + +function channelSet() { + channelset = document.getElementById('channelsel').value; + if (channelset == 'hop') { + document.getElementById('hopoptions').style.display = 'inline'; + } + else { + document.getElementById('hopoptions').style.display = 'none'; + if (channelset != 'nochange') document.forms[0].submit(); + } +} + +function mousenter(e) { + if (stupid) e = event; + el = stupid ? e.srcElement : e.currentTarget; + el.parentNode.parentNode.className = 'hostdiv_hov'; + el.nextSibling.nextSibling.nextSibling.style.visibility = 'visible'; +} + +function mouseout(e) { + if (stupid) e = event; + el = stupid ? e.srcElement : e.currentTarget; + el.parentNode.parentNode.className = 'hostdiv'; + el.nextSibling.nextSibling.nextSibling.style.visibility = 'hidden'; +} + +function generate_mnemonic(hash) { + c = new Array('b','c','d','f','g','h','j','k','l','m','n','p','qu','r','s', + 't','v','w','y','z','th','ch','sh','cc','rr'); + v = new Array('a','e','i','o','u','ae','ai','ao','au','eo','ei','eu','iu','oa','oe'); + var i, a; + var p = hash & 1; + var n = ''; + for (i = 0; i < 4; i++) { + a = p ? c : v; + n += a[hash % a.length]; + hash += a.length << 3 + a.length / 2; + hash *= hash; + p = 1 - p; + } + return n; +} + +function mkhash(mac) { + var macarr = mac.split(/:/); + var hash = 0; + for (j = 0; j < 6; j++) { + hash += parseInt(macarr[j]) * j << j; + hash += 11; + } + if (hash < 0) hash = -hash; + return hash; +} + +function wiviz_callback(mhosts, cfgstring) { + var nh = ''; + hosts = mhosts; + for (i = 0; i < hosts.length; i++) { + hs = hosts[i]; + if (hs.length == 0) break; + hs.mac = hs[0]; + hs.rssi = hs[1]; + hs.desc = hs[2]; + hs.descarr = hs.desc.split(/-/) + hs.age = hs[3]; + hs.hash = mkhash(hs.mac); + hs.mnem = generate_mnemonic(hs.hash) + hs.name = hs.mnem; + el = document.getElementById(hs.mnem); + if (el) { + if (hs.age > erase_timeout) { + el.parentNode.removeChild(el); + continue; + } + el.innerHTML = genHTML(hs); + } + else { + if (hs.age > erase_timeout) continue; + hs.x = Math.sin(hs.hash / mv) * hs.rssi * 2 - 67; + hs.y = Math.cos(hs.hash / mv) * hs.rssi * 2; + nh += "
    "; + nh += genHTML(hs) + "
    "; + } + } + document.getElementById('content').innerHTML += nh; + + cfgarr = cfgstring.split(/-/); + if (cfgarr[1]) { + if (cfgarr[1] == 'hopping') cfgarr[1] = 'hop'; + document.getElementById('channelsel').value = cfgarr[1]; + if (cfgarr[1] == 'hop') channelSet(); + } + + //repip(); + setTimeout("declump(); repip();", 250); +} + +function repip() { + var nh = ""; + if (!hosts) return; + for (i = 0; i < hosts.length; i++) { + hs = hosts[i]; + if (hs.length == 0) break; + mac = hs[0]; + rssi = hs[1]; + desc = hs[2].split(/-/); + if (desc[0] == 'sta' && desc[1] == 'assoc') { + bss = desc[2]; + hs.apmnem = generate_mnemonic(mkhash(bss)); + ap = document.getElementById(hs.apmnem); + sta = document.getElementById(hs.mnem); + if (ap && sta) { + x = parseInt(sta.style.left); + y = parseInt(sta.style.top); + dx = parseInt(ap.style.left) - x; + dy = parseInt(ap.style.top) - y; + x += 67; + y += 10; + d = Math.sqrt(dx*dx+dy*dy); + for (j = 0; j < d; j += 15) { + nh += ""; + } + } + } + } + document.getElementById('pips').innerHTML = nh; +} + +function declump() { + var c = 0; + var top = 30000,left = 30000,right = -30000,bottom = -30000; + for (i = 0; i < hosts.length; i++) { + for (j = 0; j < hosts.length; j++) { + if (i == j) continue; + e1 = document.getElementById(hosts[i].mnem); + e2 = document.getElementById(hosts[j].mnem); + if (!e1 || !e2) continue; + x1 = parseInt(e1.style.left); + x2 = parseInt(e2.style.left); + y1 = parseInt(e1.style.top); + y2 = parseInt(e2.style.top); + if (x1 < left) left = x1; + if (y1 < top) top = y1; + if (x1 > right) right = x1; + if (y1 > bottom) bottom = y1; + ox = x2; + oy = y2; + dist = Math.sqrt(Math.pow((x1-x2), 2) + Math.pow((y1-y2), 2)); + if (dist == 0) { + x2 += Math.random() * 5; + y2 += Math.random() * 5; + dist = 10; + } + if (dist < 100) { + cx = (x1-x2) * 5 / (dist / 3); + cy = (y1-y2) * 5 / (dist / 3); + x2 -= cx; + y2 -= cy; + } + if (hosts[j].apmnem == hosts[i].mnem + || hosts[i].apmnem == hosts[j].mnem) { + cx = (x1-x2) * 5 / (dist / 3); + cy = (y1-y2) * 5 / (dist / 3); + if (dist > 150) { + x2 += cx; + y2 += cy; + } + } + if (Math.abs(ox-x2) > 2 || Math.abs(oy-y2) > 2) { + e2.style.left = parseInt(x2); + e2.style.top = parseInt(y2); + c++; + } + } + } + if (top < bottom && left < right) { + document.getElementById('debug').innerHTML = left + "," + right + "," + top + "," +bottom; + document.getElementById('content').style.left = + document.getElementById('pips').style.left = + -(right - left) / 2 - left - 67; + document.getElementById('content').style.top = + document.getElementById('pips').style.top = + -(bottom - top) / 2 - top - 25; + } + repip(); + if (c) setTimeout("declump()", 100); +} + +function genHTML(hs) { + var nh = ''; + nh += "

    " + hs.mac + "
    '" + hs.name; + nh += "'"; + if (hs.channel) { + nh += " ch" + hs.channel; + } + nh += "

    "; + if (a[0] == 'ap') nh += "Access point"; + if (a[0] == 'sta') nh += "Station"; + if (a[0] == 'adhoc') nh += "Logical ad-hoc entity"; + if (a[0] == 'ap' || a[0] == 'adhoc') { + nh += "
    "; + if (a[5] == '?enc') nh += "Encryption unknown"; + if (a[5] == 'enc') nh += "Encrypted"; + if (a[5] == 'unenc') nh += "Unencrypted"; + if (a[6] == 'wep') nh += "-WEP"; + if (a[6] == 'wpa') nh += "-WPA"; + } + nh += "
    RSSI: " + hs.rssi + " dBm
    " + + "Seen " + hs.age + " seconds ago
    "; + nh += "
    "; + return nh; +} diff --git a/net/wiviz/src/Makefile b/net/wiviz/src/Makefile new file mode 100644 index 0000000..6f23035 --- /dev/null +++ b/net/wiviz/src/Makefile @@ -0,0 +1,25 @@ +## Wi-viz makefile +# Supply your own C cross-compiler; I recommend the one from the OpenWRT buildroot +# Also requires a libpcap to link with, use libpcap.a for static, .so for shared +CC=~/buildroot/staging_dir_mipsel/bin/mipsel-linux-gcc +LDFLAGS=-L~/buildroot/staging_dir_mipsel/lib +LIBS=-lpcap + +CCOPTS=-O2 -Os -pipe -mips32 -mtune=mips32 +INCLUDE=-I~/buildroot/staging_dir_mipsel/include +SOURCES=wiviz.c wl_access.c channelhopper.c +OBJS=wiviz.o wl_access.o channelhopper.o +TARGET=wiviz + +wiviz: ${OBJS} + ${CC} ${CCOPTS} ${INCLUDE} -o ${TARGET} ${OBJS} ${LDFLAGS} ${LIBS} + +wiviz.o: wiviz.c + ${CC} ${CCOPTS} ${INCLUDE} -c ${SOURCES} +wl_access.o: wl_access.c + ${CC} ${CCOPTS} ${INCLUDE} -c ${SOURCES} +channelhopper.o: channelhopper.c + ${CC} ${CCOPTS} ${INCLUDE} -c ${SOURCES} + +remake: + touch wiviz.c wl_access.c channelhopper.c diff --git a/net/wiviz/src/channelhopper.c b/net/wiviz/src/channelhopper.c new file mode 100644 index 0000000..0a3e6fe --- /dev/null +++ b/net/wiviz/src/channelhopper.c @@ -0,0 +1,48 @@ +/* +This file is part of Wi-viz (http://wiviz.natetrue.com). + +Wi-viz is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License v2 as published by +the Free Software Foundation. + +Wi-viz 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 Wi-viz; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#include +#include +#include +#include +#include "wl_access.h" +#include "channelhopper.h" +#include "structs.h" + +void ch_sig_handler(int i) { + + } + +void channelHopper(wiviz_cfg * cfg) { + int hopPos; + int nc; + + //Turn off signal handling from parent process + signal(SIGUSR1, &ch_sig_handler); + signal(SIGUSR2, &ch_sig_handler); + + //Start hoppin'! + hopPos = 0; + while (1) { + nc = cfg->channelHopSeq[hopPos]; + hopPos = (hopPos + 1) % cfg->channelHopSeqLen; + //Set the channel + fprintf(stderr, "It sets the channel to %i\n", nc); + wl_ioctl(WL_DEVICE, WLC_SET_CHANNEL, &nc, 4); + //Sleep + usleep(cfg->channelDwellTime * 1000); + } + } diff --git a/net/wiviz/src/channelhopper.h b/net/wiviz/src/channelhopper.h new file mode 100644 index 0000000..6ab63af --- /dev/null +++ b/net/wiviz/src/channelhopper.h @@ -0,0 +1,19 @@ +/* +This file is part of Wi-viz (http://wiviz.natetrue.com). + +Wi-viz is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License v2 as published by +the Free Software Foundation. + +Wi-viz 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 Wi-viz; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +// Channel hopper definition + +void channelHopper(); diff --git a/net/wiviz/src/structs.h b/net/wiviz/src/structs.h new file mode 100644 index 0000000..10f80f3 --- /dev/null +++ b/net/wiviz/src/structs.h @@ -0,0 +1,169 @@ +/* +This file is part of Wi-viz (http://wiviz.natetrue.com). + +Wi-viz is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License v2 as published by +the Free Software Foundation. + +Wi-viz 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 Wi-viz; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +//Structure definitions for wireless packets + +#define MAX_HOSTS 257 + +#ifdef DEFINE_TYPES +typedef unsigned short u_short; +typedef unsigned char u_char; +typedef unsigned int u_int; +#endif + +typedef enum { + mgt_assocRequest = 0, + mgt_assocResponse = 1, + mgt_reassocRequest = 2, + mgt_reassocResponse = 3, + mgt_probeRequest = 4, + mgt_probeResponse = 5, + mgt_beacon = 8, + mgt_disassoc = 10, + mgt_auth = 11, + mgt_deauth = 12 + } wifi_frametype; + +typedef struct ieee802_11_hdr { + u_char frame_control; + u_char flags; +#define IEEE80211_TO_DS 0x01 +#define IEEE80211_FROM_DS 0x02 +#define IEEE80211_MORE_FRAG 0x04 +#define IEEE80211_RETRY 0x08 +#define IEEE80211_PWR_MGT 0x10 +#define IEEE80211_MORE_DATA 0x20 +#define IEEE80211_WEP_FLAG 0x40 +#define IEEE80211_ORDER_FLAG 0x80 + u_short duration; + u_char addr1[6]; + u_char addr2[6]; + u_char addr3[6]; + u_short frag_and_seq; + } ieee802_11_hdr; + +typedef struct { + u_char timestamp[8]; + u_short bcn_interval; + u_short caps; +#define MGT_CAPS_AP 0x1 +#define MGT_CAPS_IBSS 0x2 +#define MGT_CAPS_WEP 0x10 + } ieee_802_11_mgt_frame; + +typedef struct { + u_char tag; + u_char length; + } ieee_802_11_tag; + +typedef enum { + tagSSID = 0, + tagRates = 1, + tagChannel = 3, + tagVendorSpecific = 0xDD + } i81tag; + +typedef struct prism_hdr { + u_int msg_code; + u_int msg_length; + char cap_device[16]; + //char dids[0]; + } prism_hdr; + +typedef struct prism_did { + u_short did; + u_short status1; + u_short status2; + u_short length; + //int value[0]; + } prism_did; + +typedef enum prism_did_num { + pdn_host_time = 0x1041, + pdn_mac_time = 0x2041, + pdn_rssi = 0x4041, + pdn_sq = 0x5041, + pdn_datarate = 0x8041, + pdn_framelen = 0xa041 + } prism_did_num; + + + +//Structure definitions for data collection + +typedef enum { + typeUnknown, + typeAP, + typeSta, + typeAdhocHub + } host_type; + +typedef enum { + ssUnknown, + ssUnassociated, + ssAssociated + } sta_state; + +typedef enum { + aetUnknown, + aetUnencrypted, + aetEncUnknown, + aetEncWEP, + aetEncWPA + } ap_enc_type; + +typedef struct { + u_char bssid[6]; + char * ssid[32]; + u_char ssidlen; + u_char channel; + u_short flags; + ap_enc_type encryption; + } ap_info; + +typedef struct { + sta_state state; + u_char connectedBSSID[6]; + } sta_info; + +typedef struct { + u_char occupied; + u_char mac[6]; + host_type type; + time_t lastSeen; + int RSSI; + ap_info * apInfo; + sta_info * staInfo; + } wiviz_host; + +//Primary config struct +typedef struct { + wiviz_host hosts[MAX_HOSTS]; + int numHosts; + int readFromWl; + time_t lastKeepAlive; + int channelHopping; + int channelDwellTime; + int channelHopSeq[14]; + int channelHopSeqLen; + int curChannel; + int channelHopperPID; + } wiviz_cfg; + + + + + diff --git a/net/wiviz/src/wiviz.c b/net/wiviz/src/wiviz.c new file mode 100644 index 0000000..d2ad9f2 --- /dev/null +++ b/net/wiviz/src/wiviz.c @@ -0,0 +1,572 @@ +/* +This file is part of Wi-viz (http://wiviz.natetrue.com). + +Wi-viz is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License v2 as published by +the Free Software Foundation. + +Wi-viz 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 Wi-viz; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#include +#include +#include + +#define HOST_TIMEOUT 300 + +#include "wl_access.h" +#include "structs.h" +#include "channelhopper.h" + +#ifdef WIN32 +#define OFFLINE +#endif +#ifndef __cplusplus +#define __cdecl +#endif + +#define nonzeromac(x) memcmp(x, "\0\0\0\0\0\0", 6) + +void dealWithPacket(wiviz_cfg * cfg, struct pcap_pkthdr * header, const u_char * packet); +wiviz_host * gotHost(wiviz_cfg * cfg, u_char * mac, host_type type); +void fprint_mac(FILE * outf, u_char * mac, char * extra); +void print_mac(u_char * mac, char * extra); +void print_host(FILE * outf, wiviz_host * host); +void __cdecl signal_handler(int); +void readWL(wiviz_cfg * cfg); +void reloadConfig(); + +wiviz_cfg * global_cfg; + +//////////////////////////////////////////////////////////////////////////////// +int main(int argc, char * * argv) { + pcap_t *handle; + char *dev; + char errbuf[PCAP_ERRBUF_SIZE]; + int stop = 0; + int oldMonitor, newMonitor; + struct pcap_pkthdr header; + const u_char *packet; + wiviz_cfg cfg; + int i; + int defaultHopSeq[] = { 1, 3, 6, 8, 11 }; + + global_cfg = &cfg; + signal(SIGUSR1, &signal_handler); + signal(SIGUSR2, &signal_handler); + + fprintf(stderr, "Wi-Viz infogathering daemon by Nathan True\n"); + + memset(&cfg, 0, sizeof(wiviz_cfg)); + cfg.numHosts = 0; + cfg.lastKeepAlive = time(NULL); + cfg.channelHopping = 0; + cfg.channelDwellTime = 1000; + cfg.channelHopSeqLen = 5; + memcpy(cfg.channelHopSeq, defaultHopSeq, sizeof(defaultHopSeq)); + + wl_ioctl(WL_DEVICE, WLC_GET_MAGIC, &i, 4); + if (i != WLC_IOCTL_MAGIC) { + fprintf(stderr, "Wireless magic not correct, not querying wl for info\n"); + cfg.readFromWl = 0; + } + else { + cfg.readFromWl = 1; + wl_ioctl(WL_DEVICE, WLC_GET_MONITOR, &oldMonitor, 4); + newMonitor = 1; + wl_ioctl(WL_DEVICE, WLC_SET_MONITOR, &newMonitor, 4); + } + + reloadConfig(); + +#ifndef OFFLINE + dev = "prism0"; + handle = pcap_open_live(dev, BUFSIZ, 1, 0, errbuf); +#else + dev = "c:\\cifsroot\\wdump2.pcap"; + handle = pcap_open_offline(dev, errbuf); +#endif + + if (cfg.readFromWl) { + readWL(&cfg); + } + + if (!handle) { + fprintf(stderr, "Failure to open pcap!\nErr=%s\n", errbuf); + return -1; + } + while (!stop) { + packet = pcap_next(handle, &header); + if (!packet) break; + dealWithPacket(&cfg, &header, packet); + if (time(NULL) - cfg.lastKeepAlive > 30) stop = 1; + } + + signal_handler(SIGUSR1); + + if (cfg.channelHopperPID) kill(cfg.channelHopperPID, SIGKILL); + + for (i = 0; i < MAX_HOSTS; i++) { + print_host(stderr, cfg.hosts + i); + if (cfg.hosts[i].occupied) printf("\n"); + if (cfg.hosts[i].apInfo) free(cfg.hosts[i].apInfo); + if (cfg.hosts[i].staInfo) free(cfg.hosts[i].staInfo); + } + + wl_ioctl(WL_DEVICE, WLC_SET_MONITOR, &oldMonitor, 4); + + pcap_close(handle); + return 0; + } + +//////////////////////////////////////////////////////////////////////////////// +void writeJavascript() { + int i; + FILE * outf; + wiviz_host * h; + + outf = fopen("/tmp/wiviz-pipe", "w"); + if (!outf) { + fprintf(stderr, "Failure to open output file\n"); + return; + } + + global_cfg->lastKeepAlive = time(NULL); + + if(global_cfg->readFromWl) readWL(global_cfg); + + fprintf(outf, "top.hosts = new Array(\n"); + for (i = 0; i < MAX_HOSTS; i++) { + h = global_cfg->hosts + i; + if (h->occupied == 0) continue; + if (time(NULL) - h->lastSeen > HOST_TIMEOUT) { + h->occupied = 0; + } + fprintf(outf, " new Array("); + print_host(outf, h); + fprintf(outf, "),\n"); + } + fprintf(outf, "new Array());\n"); + fprintf(outf, "var cfg_string = 'channel-"); + if (global_cfg->channelHopping) { + fprintf(outf, "hopping"); + } + else { + fprintf(outf, "%i", global_cfg->curChannel); + } + fprintf(outf, "';\ntop.wiviz_callback(top.hosts, cfg_string);\n"); + fclose(outf); + } + +//////////////////////////////////////////////////////////////////////////////// +void reloadConfig() { + FILE * cnf; + wiviz_cfg * cfg = global_cfg; + char filebuffer[512]; + char * fbptr, * p, * v, * vv; + int fblen, val; + int hopCfgChanged = 0; + int newHopSeq[12]; + int newHopSeqLen = 0; + + fprintf(stderr, "Loading config file\n"); + + cnf = fopen("/tmp/wiviz-cfg", "r"); + if (!cnf) { + fprintf(stderr, "Wiviz: No config file (/tmp/wiviz-cfg) present, using defaults\n"); + return; + } + + fblen = fread(filebuffer, 1, 512, cnf); + fclose(cnf); + if (fblen >= 512) { + fprintf(stderr, "Error reading config file\n"); + return; + } + filebuffer[fblen] = 0; + fprintf(stderr, "Read %i bytes from config file\n", fblen); + + fbptr = filebuffer; + + while (fbptr < filebuffer + fblen && *fbptr != 0) { + p = fbptr; + //Find end of parameter + for (; *fbptr != '=' && *fbptr != 0; fbptr++); + *fbptr = 0; + v = ++fbptr; + //Find end of value + for (; *fbptr != '&' && *fbptr != 0; fbptr++); + *(fbptr++) = 0; + fprintf(stderr, "Config: %s=%s\n", p, v); + //Apply configuration + if (!strcmp(p, "channelsel")) { + //Channel selector + cfg->channelHopping = 0; + if (!strcmp(v, "hop")) { + //Set channel hopping + cfg->channelHopping = 1; + hopCfgChanged = 1; + } + else if (!strcmp(v, "nochange")) { + //Don't change anything, read channel from wireless card + readWL(cfg); + } + else { + val = atoi(v); + if (val < 1 || val > 14) { + fprintf(stderr, "Channel setting in config file invalid (%i)\n", cfg->curChannel); + } + else { + cfg->curChannel = val; + if (cfg->readFromWl) { + if (wl_ioctl(WL_DEVICE, WLC_SET_CHANNEL, &cfg->curChannel, 4) < 0) { + fprintf(stderr, "Channel set to %i failed\n", cfg->curChannel); + } + } + else { + fprintf(stderr, "Can't set channel, no Broadcom wireless device present\n"); + } + } + } + } + if (!strcmp(p, "hopdwell")) { + val = atoi(v); + if (val < 100) val = 100; + if (val > 30000) val = 30000; + if (cfg->channelDwellTime != val) hopCfgChanged = 1; + cfg->channelDwellTime = val; + } + if (!strcmp(p, "hopseq")) { + cfg->channelHopSeqLen = 0; + while (v < fbptr) { + for (vv = v; *vv != ',' && *vv != 0; vv++); + if (*vv == 0) { + cfg->channelHopSeq[cfg->channelHopSeqLen++] = atoi(v); + break; + } + *vv = 0; + cfg->channelHopSeq[cfg->channelHopSeqLen++] = atoi(v); + v = vv + 1; + } + } + /* + if (!strcmp(p, "")) { + } + */ + } + //Apply channel hopper settings + if (cfg->channelHopping == 0 && cfg->channelHopperPID) { + kill(cfg->channelHopperPID, SIGKILL); + cfg->channelHopperPID = 0; + } + if (cfg->channelHopping == 1 && hopCfgChanged) { + if (cfg->channelHopperPID) kill(cfg->channelHopperPID, SIGKILL); + if ((cfg->channelHopperPID = fork()) == 0) { + channelHopper(cfg); + } + } + } + +//////////////////////////////////////////////////////////////////////////////// +void __cdecl signal_handler(int signum) { + if (signum == SIGUSR1) writeJavascript(); + if (signum == SIGUSR2) reloadConfig(); + } + +//////////////////////////////////////////////////////////////////////////////// +void dealWithPacket(wiviz_cfg * cfg, struct pcap_pkthdr * header, const u_char * packet) { + ieee802_11_hdr * hWifi; + prism_hdr * hPrism; + wiviz_host * host; + wiviz_host * emergebss; + host_type type = typeUnknown; + int wfType; + int rssi = 0; + int to_ds, from_ds; + prism_did * i; + ieee_802_11_tag * e; + ieee_802_11_mgt_frame * m; + char * src = "\0\0\0\0\0\0"; + char * dst = "\0\0\0\0\0\0"; + char * bss = "\0\0\0\0\0\0"; + char * ssid = ""; + int channel = 0; + int adhocbeacon = 0; + u_char ssidlen = 0; + ap_enc_type encType = aetUnknown; + + if (!packet) return; + if (header->len < sizeof(prism_hdr) + sizeof(ieee802_11_hdr)) return; + hPrism = (prism_hdr *) packet; + hWifi = (ieee802_11_hdr *) (packet + (hPrism->msg_length)); + + //Parse the prism DIDs + i = (prism_did *)((char *)hPrism + sizeof(prism_hdr)); + while ((int)i < (int)hWifi) { + if (i->did == pdn_rssi) rssi = *(int *)(i+1); + i = (prism_did *) ((int)(i+1) + i->length); + } + + //Establish the frame type + wfType = ((hWifi->frame_control & 0xF0) >> 4) + ((hWifi->frame_control & 0xC) << 2); + switch (wfType) { + case mgt_assocRequest: + case mgt_reassocRequest: + case mgt_probeRequest: + type = typeSta; + src=hWifi->addr2; + dst=hWifi->addr1; + break; + case mgt_assocResponse: + case mgt_reassocResponse: + case mgt_probeResponse: + case mgt_beacon: + src=hWifi->addr2; + dst=hWifi->addr1; + bss=hWifi->addr3; + type = typeAP; + break; + } + to_ds = hWifi->flags & IEEE80211_TO_DS; + from_ds = hWifi->flags & IEEE80211_FROM_DS; + if ((wfType & 0xF0) == 0x20 && (wfType & 0xF) < 4) { + //Data frame + src=hWifi->addr2; + dst=hWifi->addr1; + if (!from_ds) type = typeSta; + else type = typeAP; + if (!to_ds && !from_ds) bss = hWifi->addr3; + if (to_ds && !from_ds) bss = hWifi->addr1; + if (!to_ds && from_ds) bss = hWifi->addr2; + } + if (type == typeUnknown) return; + + //Parse the 802.11 tags + if (wfType == mgt_probeResponse || wfType == mgt_beacon) { + m = (ieee_802_11_mgt_frame *) (hWifi + 1); + if (m->caps & MGT_CAPS_IBSS) { + type = typeSta; + adhocbeacon = 1; + } + if (m->caps & MGT_CAPS_WEP) encType = aetEncWEP; + else encType = aetUnencrypted; + e = (ieee_802_11_tag *) ((int) m + sizeof(ieee_802_11_mgt_frame)); + while ((u_int)e < (u_int)packet + header->len) { + if (e->tag == tagSSID) { + ssidlen = e->length; + ssid = (char *)(e + 1); + } + if (e->tag == tagChannel) { + channel = *(char *)(e + 1); + } + if (e->tag == tagVendorSpecific) { + if (e->length >= 4 && memcmp(e + 1, "\x00\x50\xf2\x01", 4) == 0) { + //WPA encryption + encType = aetEncWPA; + } + } + e = (ieee_802_11_tag *) ((int)(e + 1) + e->length); + } + } + + //Look up the host in the hash table + host = gotHost(cfg, src, type); + + //Add any info we received + if (host->RSSI) { + host->RSSI = host->RSSI * 9 / 10 + (-rssi * 10); + } + else { + host->RSSI = -rssi * 100; + } + if (type == typeSta) { + if (nonzeromac(bss)) { + memcpy(host->staInfo->connectedBSSID, bss, 6); + host->staInfo->state = ssAssociated; + emergebss = gotHost(cfg, bss, typeAP); + if (emergebss->RSSI == 0) emergebss->RSSI = 10000; + memcpy(emergebss->apInfo->bssid, bss, 6); + if (adhocbeacon) { + emergebss->type = typeAdhocHub; + if (ssidlen > 0 && ssidlen <= 32) { + memcpy(emergebss->apInfo->ssid, ssid, ssidlen); + emergebss->apInfo->ssidlen = ssidlen; + } + if (channel) emergebss->apInfo->channel = channel; + emergebss->apInfo->flags = hWifi->flags; + emergebss->RSSI = host->RSSI; + if (encType != aetUnknown) emergebss->apInfo->encryption = encType; + } + } + if (wfType == mgt_probeRequest && host->staInfo->state == ssUnknown) host->staInfo->state = ssUnassociated; + } + if (type == typeAP) { + if (nonzeromac(bss)) { + memcpy(host->apInfo->bssid, bss, 6); + } + if (ssidlen > 0 && ssidlen <= 32) { + memcpy(host->apInfo->ssid, ssid, ssidlen); + host->apInfo->ssidlen = ssidlen; + } + if (channel) host->apInfo->channel = channel; + host->apInfo->flags = hWifi->flags; + if (encType != aetUnknown) host->apInfo->encryption = encType; + } + } + +//////////////////////////////////////////////////////////////////////////////// +void print_mac(u_char * mac, char * extra) { + fprint_mac(stdout, mac, extra); + } + +//////////////////////////////////////////////////////////////////////////////// +void fprint_mac(FILE * outf, u_char * mac, char * extra) { + fprintf(outf, "%02X:%02X:%02X:%02X:%02X:%02X%s", + mac[0] & 0xFF, + mac[1] & 0xFF, + mac[2] & 0xFF, + mac[3] & 0xFF, + mac[4] & 0xFF, + mac[5] & 0xFF, + extra); + } + +//////////////////////////////////////////////////////////////////////////////// +#define MAX_PROBES MAX_HOSTS/2 +wiviz_host * gotHost(wiviz_cfg * cfg, u_char * mac, host_type type) { + int i = (mac[5] + (mac[4] << 8)) % MAX_HOSTS; + int c = 0; + wiviz_host * h = cfg->hosts + i; + while (h->occupied && memcmp(h->mac, mac, 6)) { + i++; h++; c++; + if (i >= MAX_HOSTS) { + i = 0; + h = cfg->hosts; + } + if (c > MAX_PROBES) break; + } + if (!h->occupied) { + fprintf(stderr, "New host, "); + fprint_mac(stderr, mac, ", type="); + fprintf(stderr, "%s\n", (type==typeAP) ? "AP" : ((type==typeSta) ? "Sta" : "Unk")); + } + h->occupied = 1; + h->lastSeen = time(NULL); + h->type = type; + memcpy(h->mac, mac, 6); + if (h->type == typeAP && !h->apInfo) { + h->apInfo = (ap_info *) malloc(sizeof(ap_info)); + memset(h->apInfo, 0, sizeof(ap_info)); + } + if (h->type == typeSta && !h->staInfo) { + h->staInfo = (sta_info *) malloc(sizeof(sta_info)); + memset(h->staInfo, 0, sizeof(sta_info)); + } + return h; + } + +//////////////////////////////////////////////////////////////////////////////// +void print_host(FILE * outf, wiviz_host * host) { + int i; + + if (!host->occupied) return; + fprintf(outf, "'"); + fprint_mac(outf, host->mac, "'"); + fprintf(outf, ", -%i, '", host->RSSI / 100); + switch (host->type) { + case typeAP: fprintf(outf, "ap"); break; + case typeSta: fprintf(outf, "sta"); break; + case typeAdhocHub: fprintf(outf, "adhoc"); break; + } + if (host->type == typeSta) { + switch(host->staInfo->state) { + case ssAssociated: + fprintf(outf, "-assoc-"); + fprint_mac(outf, host->staInfo->connectedBSSID, ""); + break; + case ssUnassociated: + fprintf(outf, "-unassoc"); + } + } + if (host->type == typeAP || host->type == typeAdhocHub) { + fprintf(outf, "-channel-%i-ssid-", host->apInfo->channel & 0xFF); + for (i = 0; i < host->apInfo->ssidlen; i++) { + fprintf(outf, "\\x%02X", *((char *)host->apInfo->ssid + i) & 0xFF); + } + switch (host->apInfo->encryption) { + case aetUnknown: fprintf(outf, "-?enc-?alg"); break; + case aetUnencrypted: fprintf(outf, "-unenc-na"); break; + case aetEncUnknown: fprintf(outf, "-enc-unknown"); break; + case aetEncWEP: fprintf(outf, "-enc-wep"); break; + case aetEncWPA: fprintf(outf, "-enc-wpa"); break; + } + } + fprintf(outf, "', %i", time(0) - host->lastSeen); + } + +//////////////////////////////////////////////////////////////////////////////// +#define MAX_STA_COUNT 64 +void readWL(wiviz_cfg * cfg) { + int ap, i; + wiviz_host * host, * sta; + uchar mac[6]; + wlc_ssid_t ssid; + channel_info_t channel; + maclist_t * macs; + sta_rssi_t starssi; + + get_mac(WL_DEVICE, mac); + printf("AP mac: "); + print_mac(mac, "\n"); + if (!nonzeromac(mac)) return; + wl_ioctl(WL_DEVICE, WLC_GET_AP, &ap, 4); + if (ap) { + host = gotHost(cfg, mac, typeAP); + wl_ioctl(WL_DEVICE, WLC_GET_BSSID, host->apInfo->bssid, 6); + wl_ioctl(WL_DEVICE, WLC_GET_SSID, &ssid, sizeof(wlc_ssid_t)); + memcpy(host->apInfo->ssid, ssid.SSID, 32); + host->apInfo->ssidlen = ssid.SSID_len; + host->RSSI = 0; + wl_ioctl(WL_DEVICE, WLC_GET_CHANNEL, &channel, sizeof(channel_info_t)); + host->apInfo->channel = channel.hw_channel; + macs = (maclist_t *) malloc(4 + MAX_STA_COUNT * sizeof(ether_addr_t)); + macs->count = MAX_STA_COUNT; + if (wl_ioctl(WL_DEVICE, WLC_GET_ASSOCLIST, macs, 4 + MAX_STA_COUNT * sizeof(ether_addr_t)) > -1) { + for (i = 0; i < macs->count; i++) { + sta = gotHost(cfg, (char *)&macs->ea[i], typeSta); + memcpy(starssi.mac, &macs->ea[i], 6); + starssi.RSSI = 3000; + starssi.zero_ex_forty_one = 0x41; + if (wl_ioctl(WL_DEVICE, WLC_GET_RSSI, &starssi, 12) < 0) printf("rssifail\n"); + sta->RSSI = -starssi.RSSI * 100; + sta->staInfo->state = ssAssociated; + memcpy(sta->staInfo->connectedBSSID, host->apInfo->bssid, 6); + } + } + } + else { + host = gotHost(cfg, mac, typeSta); + host->RSSI = 0; + if (wl_ioctl(WL_DEVICE, WLC_GET_BSSID, &host->staInfo->connectedBSSID, 6) < 0) { + host->staInfo->state = ssUnassociated; + } + else { + host->staInfo->state = ssAssociated; + } + } + if (wl_ioctl(WL_DEVICE, WLC_GET_CHANNEL, &channel, sizeof(channel_info_t)) >= 0) { + cfg->curChannel = channel.hw_channel; + fprintf(stderr, "Current channel is %i\n", cfg->curChannel); + } +} + + + + + diff --git a/net/wiviz/src/wl_access.c b/net/wiviz/src/wl_access.c new file mode 100644 index 0000000..a5172c3 --- /dev/null +++ b/net/wiviz/src/wl_access.c @@ -0,0 +1,73 @@ +/* +This file is part of Wi-viz (http://wiviz.natetrue.com). + +Wi-viz is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License v2 as published by +the Free Software Foundation. + +Wi-viz 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 Wi-viz; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#include +#include +#include +#include +#include +#include + +#include "wl_access.h" + +int wl_ioctl(char *name, int cmd, void *buf, int len) +{ + struct ifreq ifr; + wl_ioctl_t ioc; + int ret = 0; + int s; + + /* open socket to kernel */ + if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + perror("socket"); + return errno; + } + + /* do it */ + ioc.cmd = cmd; + ioc.buf = buf; + ioc.len = len; + strncpy(ifr.ifr_name, name, IFNAMSIZ); + ifr.ifr_data = (caddr_t) &ioc; + ret = ioctl(s, SIOCDEVPRIVATE, &ifr); + + /* cleanup */ + close(s); + return ret; +} + +int get_mac(char *name, void *buf) +{ + struct ifreq ifr; + int ret = 0; + int s; + + /* open socket to kernel */ + if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + perror("socket"); + return errno; + } + + strncpy(ifr.ifr_name, name, IFNAMSIZ); + //ifr.ifr_data = (caddr_t) buf; + if ((ret = ioctl(s, SIOCGIFHWADDR, &ifr)) < 0) + perror(ifr.ifr_name); + + /* cleanup */ + close(s); + memcpy(buf, &ifr.ifr_hwaddr.sa_data, 6); + return ret; +} diff --git a/net/wiviz/src/wl_access.h b/net/wiviz/src/wl_access.h new file mode 100644 index 0000000..96f239d --- /dev/null +++ b/net/wiviz/src/wl_access.h @@ -0,0 +1,77 @@ +/* +This file is part of Wi-viz (http://wiviz.natetrue.com). + +Wi-viz is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License v2 as published by +the Free Software Foundation. + +Wi-viz 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 Wi-viz; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +//wl_access.h - functions for accessing broadcom crap + +#define WL_DEVICE "eth1" + +typedef unsigned int uint32; +typedef unsigned char uchar; +typedef int bool; + +typedef struct ether_addr { + uchar addr[6]; +} ether_addr_t; + +typedef struct wlc_ssid { + uint32 SSID_len; + uchar SSID[32]; +} wlc_ssid_t; +/* For ioctls that take a list of MAC addresses */ +typedef struct maclist { + uint count; /* number of MAC addresses */ + struct ether_addr ea[1]; /* variable length array of MAC addresses */ +} maclist_t; +/* Linux network driver ioctl encoding */ +typedef struct wl_ioctl { + uint cmd; /* common ioctl definition */ + void *buf; /* pointer to user buffer */ + uint len; /* length of user buffer */ + bool set; /* get or set request (optional) */ + uint used; /* bytes read or written (optional) */ + uint needed; /* bytes needed (optional) */ +} wl_ioctl_t; +/* channel encoding */ +typedef struct channel_info { + int hw_channel; + int target_channel; + int scan_channel; +} channel_info_t; +/* RSSI info for sta */ +typedef struct sta_rssi { + int RSSI; + char mac[6]; + u_short zero_ex_forty_one; + } sta_rssi_t; +/* check this magic number */ +#define WLC_IOCTL_MAGIC 0x14e46c77 + +#define WLC_GET_MAGIC 0 +#define WLC_GET_BSSID 23 +#define WLC_SET_BSSID 24 +#define WLC_GET_SSID 25 +#define WLC_SET_SSID 26 +#define WLC_GET_CHANNEL 29 +#define WLC_SET_CHANNEL 30 +#define WLC_GET_MONITOR 107 /* discovered by nbd */ +#define WLC_SET_MONITOR 108 /* discovered by nbd */ +#define WLC_GET_AP 117 +#define WLC_SET_AP 118 +#define WLC_GET_RSSI 127 +#define WLC_GET_ASSOCLIST 159 + + +int wl_ioctl(char *name, int cmd, void *buf, int len); diff --git a/net/wknock/Makefile b/net/wknock/Makefile new file mode 100644 index 0000000..96cd269 --- /dev/null +++ b/net/wknock/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2006-2009 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:=wknock +PKG_VERSION:=1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME).tar.gz +PKG_SOURCE_URL:=http://blackhat.com/presentations/bh-europe-05/BH_EU_05-Oudot/ +PKG_MD5SUM:=6b7a1f3cbb0af88da02e5d30cefd8e7f + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/wknock + SECTION:=net + CATEGORY:=Network + DEPENDS:=kmod-brcm-wl +libpcap + TITLE:=A tool to hide your Access Point against opportunistic attackers. + URL:=http://www.rstack.org/oudot/wknock/ +endef + +define Package/wknock/description +tool to hide your Access Point against opportunistic attackers. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS) -lpcap" \ + all +endef + +define Package/wknock/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/wknock $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/wknock-ng $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,wknock)) diff --git a/net/wol/Makefile b/net/wol/Makefile new file mode 100644 index 0000000..286442c --- /dev/null +++ b/net/wol/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2007-2011 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:=wol +PKG_VERSION:=0.7.1 +PKG_RELEASE:=3 + +PKG_SOURCE_URL:=@SF/ahh +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=c2fa9d7e771134ac8c89d56b8197d4ca + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/wol + SECTION:=net + CATEGORY:=Network + TITLE:=Wake On LAN client + URL:=http://ahh.sourceforge.net/wol/ +endef + +define Package/wol/description + wol implements Wake On LAN functionality in a small program. + It wakes up hardware that is Magic Packet compliant. +endef + +CONFIGURE_VARS += \ + ac_cv_func_malloc_0_nonnull=yes \ + ac_cv_func_realloc_0_nonnull=yes \ + ac_cv_func_mmap_fixed_mapped=yes \ + jm_cv_func_working_malloc=yes \ + ac_cv_func_alloca_works=yes \ + +define Package/wol/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) +endef + +define Package/wol/conffiles +/etc/config/wol +endef + +$(eval $(call BuildPackage,wol)) diff --git a/net/wol/files/wol.config b/net/wol/files/wol.config new file mode 100644 index 0000000..f49c96f --- /dev/null +++ b/net/wol/files/wol.config @@ -0,0 +1,3 @@ +config wol-target + option mac '' + option enabled '0' diff --git a/net/wol/files/wol.init b/net/wol/files/wol.init new file mode 100644 index 0000000..18be829 --- /dev/null +++ b/net/wol/files/wol.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007 OpenWrt.org + +START=60 + +append_string() { + local section="$1" + local option="$2" + local value="$3" + local _val + config_get _val "$section" "$option" + [ -n "$_val" ] && append args "$3$_val" +} + +start_service() { + local cfg="$1" + args="" + + append_string "$cfg" broadcast "--host=" + append_string "$cfg" port "--port=" + append_string "$cfg" password "--passwd=" + append_string "$cfg" mac "" + config_get_bool enabled "$cfg" "enabled" '1' + [ "$enabled" -gt 0 ] && /usr/bin/wol $args +} + +start() { + config_load wol + config_foreach start_service wol-target +} diff --git a/net/wput/Makefile b/net/wput/Makefile new file mode 100644 index 0000000..d25dd74 --- /dev/null +++ b/net/wput/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2007-2008 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:=wput +PKG_VERSION:=0.6.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/wput +PKG_MD5SUM:=a14c4c13d91d04d6119bdc977e8a8bdf + +include $(INCLUDE_DIR)/package.mk + +define Package/wput + SUBMENU:=File Transfer + SECTION:=net + CATEGORY:=Network + TITLE:=A tiny wget-like ftp-client for uploading files + URL:=http://wput.sourceforge.net/ +endef + +define Package/wput/description + Wput is a tiny ftp-client, that uploads files or directories + to a remote ftp-server. Main features are: resuming, + time-stamping, wget-like interface, proxy-support and + speed-limit. +endef + +CONFIGURE_ARGS += \ + --disable-g-switch \ + --without-ssl \ + +define Package/wput/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/wput $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,wput)) diff --git a/net/wput/patches/100-socketlib.diff b/net/wput/patches/100-socketlib.diff new file mode 100644 index 0000000..b5acafe --- /dev/null +++ b/net/wput/patches/100-socketlib.diff @@ -0,0 +1,22 @@ +--- a/src/socketlib.c ++++ b/src/socketlib.c +@@ -392,17 +392,15 @@ int socket_is_data_readable(int s, int t + wput_socket * socket_timeout_connect(wput_socket * sock, struct sockaddr *remote_addr, size_t size, int timeout) { + int c = 0; + printout(vDEBUG, "initiating timeout connect (%d)\n", timeout); +-#ifdef WIN32 + /* reset errno before connecting. otherwise connection might "fail" for: + * no such file or directory ;) */ + errno = 0; +-#endif +- socket_set_blocking(sock->fd, 0); ++ socket_set_blocking(sock->fd, 1); + c = connect(sock->fd,remote_addr,size); + /* here was a check also for errno != 36 (FILENAMETOOLONG) + * maybe this was EINPROGRESS on another system? */ + if(errno > 0 && errno != EINPROGRESS) { +- printout(vMORE, "[%s]", strerror(errno)); ++ printout(vMORE, "[%d:%s] ", errno, strerror(errno)); + return NULL; + } + /* DEBUG if(c == -1) perror("connect"); */ diff --git a/net/wput/patches/102-wput.diff b/net/wput/patches/102-wput.diff new file mode 100644 index 0000000..19629b5 --- /dev/null +++ b/net/wput/patches/102-wput.diff @@ -0,0 +1,48 @@ +--- a/src/wput.c ++++ b/src/wput.c +@@ -621,8 +621,8 @@ void commandlineoptions(int argc, char * + {"output-file", 1, 0, 'o'}, + {"port-mode", 0, 0, 'p'}, + {"proxy", 1, 0, 'Y'}, +- {"proxy-user", 1, 0, 0}, +- {"proxy-pass", 1, 0, 0}, //20 ++ {"proxy_user", 1, 0, 0}, ++ {"proxy_pass", 1, 0, 0}, //20 + {"quiet", 0, 0, 'q'}, + {"random-wait", 0, 0, 0}, + {"remove-source-files", 0, 0, 'R'}, +@@ -642,7 +642,9 @@ void commandlineoptions(int argc, char * + {"waitretry", 1, 0, 0}, + {"chmod", 1, 0, 'm'}, + {"disable-tls", 0, 0, 0}, +- {0, 0, 0, 0} //40 ++ {"proxy_host", 1, 0, 0}, //40 ++ {"proxy_port", 1, 0, 0}, ++ {0, 0, 0, 0} + }; + while (1) + { +@@ -699,6 +701,10 @@ void commandlineoptions(int argc, char * + opt.retry_interval = atoi(optarg); break; + case 39: //disable-tls + opt.tls = 2; break; ++ case 40: //proxy_host ++ set_option("proxy_host", optarg); break; ++ case 41: //proxy_port ++ set_option("proxy_port", optarg); break; + default: + fprintf(stderr, _("Option %s should not appear here :|\n"), long_options[option_index].name); + } +@@ -806,8 +812,10 @@ void commandlineoptions(int argc, char * + " -l, --limit-rate=RATE limit upload rate to RATE\n" + " -nd, --no-directories do not create any directories\n" + " -Y, --proxy=http/socks/off set proxy type or turn off\n" +-" --proxy-user=NAME set the proxy-username to NAME\n" +-" --proxy-pass=PASS set the proxy-password to PASS\n" ++" --proxy_user=NAME set the proxy-username to NAME\n" ++" --proxy_pass=PASS set the proxy-password to PASS\n" ++" --proxy_port=PORT set the proxy port to PORT\n" ++" --proxy_host=HOST set the proxy host to HOST\n" + "\n")); + fprintf(stderr, _( + "FTP-Options:\n" diff --git a/net/wrt-radauth/Makefile b/net/wrt-radauth/Makefile new file mode 100644 index 0000000..57b5781 --- /dev/null +++ b/net/wrt-radauth/Makefile @@ -0,0 +1,50 @@ +# +# 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:=wrt-radauth +PKG_VERSION:=0.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.zerfleddert.de/wrt54g/ +PKG_MD5SUM:=1713b96a157f9e209cf7986f38ef57d9 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/wrt-radauth + SECTION:=net + CATEGORY:=Network + DEPENDS:=+kmod-brcm-wl +nvram + TITLE:=A Radius MAC authenticator for Broadcom based access points + URL:=http://www.zerfleddert.de/wrt54g/ +endef + +define Package/wrt-radauth/description + This software watches the stations associating to a broadcom based + AccessPoint (e.g. Linksys WRT54G) and sends an authentication request + to the radius-server specified in nvram. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) clean + $(call Build/Compile/Default, \ + CFLAGS="$(EXTRA_CFLAGS)" \ + LDFLAGS="$(EXTRA_LDFLAGS)" \ + ) +endef + +define Package/wrt-radauth/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/radius-client $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/wrt-radauth $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,wrt-radauth)) diff --git a/net/wrt-radauth/patches/001-ldpath.patch b/net/wrt-radauth/patches/001-ldpath.patch new file mode 100644 index 0000000..c740c3f --- /dev/null +++ b/net/wrt-radauth/patches/001-ldpath.patch @@ -0,0 +1,12 @@ +diff -urN wrt-radauth/Makefile wrt-radauth.new/Makefile +--- wrt-radauth/Makefile 2007-01-07 20:05:21.000000000 +0100 ++++ wrt-radauth.new/Makefile 2008-04-01 22:50:09.000000000 +0200 +@@ -7,7 +7,7 @@ + all: wrt-radauth radius-client + + wrt-radauth: wrt-radauth.o md5.o wireless.o radius.o +- $(CC) $(LDFLAGS) -L$(WRT_BUILDROOT)/build_mipsel/root/usr/lib -lshared -lnvram $^ -o $@ ++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L$(STAGING_DIR)/usr/lib -lnvram $(STAGING_DIR)/usr/lib/libshared.a + + + radius-client: radius-client.o md5.o radius.o diff --git a/net/wshaper/Makefile b/net/wshaper/Makefile new file mode 100644 index 0000000..2c73705 --- /dev/null +++ b/net/wshaper/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2007-2011 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:=wshaper +PKG_VERSION:=0.2 +PKG_RELEASE:=2 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/wshaper + SECTION:=net + CATEGORY:=Network + DEPENDS:=+kmod-sched +tc + TITLE:=wshaper + URL:=http://lartc.org/wondershaper/ + PKGARCH:=all +endef + +define Package/wshaper/description + A script to do traffing shaping with the HTB algorithm. + Wshaper attempts to: + * Maintain low latency for interfactive traffic at all times + * Allow 'surfing' at reasonable speeds while up or downloading + * Make sure uploads don't harm downloads, and the other way around +endef + +define Build/Prepare +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/wshaper/install + $(INSTALL_DIR) $(1)/usr/sbin/ $(1)/etc/init.d $(1)/etc/config + $(INSTALL_BIN) ./files/wshaper.htb $(1)/usr/sbin/ + $(INSTALL_BIN) ./files/wshaper.init $(1)/etc/init.d/wshaper + $(INSTALL_DATA) ./files/wshaper.config $(1)/etc/config/wshaper +endef + +define Package/wshaper/conffiles +/etc/config/wshaper +endef + +$(eval $(call BuildPackage,wshaper)) diff --git a/net/wshaper/files/wshaper.config b/net/wshaper/files/wshaper.config new file mode 100644 index 0000000..ed857c5 --- /dev/null +++ b/net/wshaper/files/wshaper.config @@ -0,0 +1,4 @@ +config 'wshaper' 'settings' + option 'network' 'wan' + option 'downlink' '2000' + option 'uplink' '240' diff --git a/net/wshaper/files/wshaper.htb b/net/wshaper/files/wshaper.htb new file mode 100755 index 0000000..0729fb7 --- /dev/null +++ b/net/wshaper/files/wshaper.htb @@ -0,0 +1,161 @@ +#!/bin/sh +# Wonder Shaper +# please read the README before filling out these values +# +# Set the following values to somewhat less than your actual download +# and uplink speed. In kilobits. Also set the device that is to be shaped. + +# All config needs to be done in /etc/config/wshaper + +. /lib/functions.sh +config_load wshaper +for s in downlink uplink network nopriohostdst nopriohostsrc noprioportdst noprioportsrc; do + config_get $s settings $s +done + +device=$(uci_get_state network "$network" ifname "$network") +[ -z "$device" ] && logger -t wondershaper "Error: Could not find the device for network $network, aborting." && exit 1 +[ -z "$downlink" ] && logger -t wondershaper "Error: Downlink speed not set, aborting." && exit 1 +[ -z "$uplink" ] && logger -t wondershaper "Error: Uplink speed not set, aborting." && exit 1 + +MODULES='sch_ingress sch_sfq sch_htb cls_u32 act_police' +DOWNLINK="$downlink" +UPLINK="$uplink" +DEV="$device" + +# low priority OUTGOING traffic - you can leave this blank if you want +# low priority source netmasks +NOPRIOHOSTSRC="$nopriohostsrc" + +# low priority destination netmasks +NOPRIOHOSTDST="$nopriohostdst" + +# low priority source ports +NOPRIOPORTSRC="$noprioportsrc" + +# low priority destination ports +NOPRIOPORTDST="$noprioportdst" + +if [ "$1" = "status" ] +then + tc -s qdisc ls dev $DEV + tc -s class ls dev $DEV + exit +fi + + +# clean existing down- and uplink qdiscs, hide errors +tc qdisc del dev $DEV root 2> /dev/null > /dev/null +tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null + +if [ "$1" = "stop" ] +then + for i in $MODULES ; do + rmmod $i + done + exit +fi + +for i in $MODULES ; do + insmod $i +done + +###### uplink + +# install root HTB, point default traffic to 1:20: + +tc qdisc add dev $DEV root handle 1: htb default 20 + +# shape everything at $UPLINK speed - this prevents huge queues in your +# DSL modem which destroy latency: + +tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit burst 6k + +# high prio class 1:10: + +tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit \ + burst 6k prio 1 + +# bulk & default class 1:20 - gets slightly less traffic, +# and a lower priority: + +tc class add dev $DEV parent 1:1 classid 1:20 htb rate $((9*$UPLINK/10))kbit \ + burst 6k prio 2 + +tc class add dev $DEV parent 1:1 classid 1:30 htb rate $((8*$UPLINK/10))kbit \ + burst 6k prio 2 + +# all get Stochastic Fairness: +tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10 +tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10 +tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10 + +# TOS Minimum Delay (ssh, NOT scp) in 1:10: + +tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \ + match ip tos 0x10 0xff flowid 1:10 + +# ICMP (ip protocol 1) in the interactive class 1:10 so we +# can do measurements & impress our friends: +tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \ + match ip protocol 1 0xff flowid 1:10 + +# To speed up downloads while an upload is going on, put ACK packets in +# the interactive class: + +tc filter add dev $DEV parent 1: protocol ip prio 10 u32 \ + match ip protocol 6 0xff \ + match u8 0x05 0x0f at 0 \ + match u16 0x0000 0xffc0 at 2 \ + match u8 0x10 0xff at 33 \ + flowid 1:10 + +# rest is 'non-interactive' ie 'bulk' and ends up in 1:20 + +# some traffic however suffers a worse fate +for a in $NOPRIOPORTDST +do + tc filter add dev $DEV parent 1: protocol ip prio 14 u32 \ + match ip dport $a 0xffff flowid 1:30 +done + +for a in $NOPRIOPORTSRC +do + tc filter add dev $DEV parent 1: protocol ip prio 15 u32 \ + match ip sport $a 0xffff flowid 1:30 +done + +for a in $NOPRIOHOSTSRC +do + tc filter add dev $DEV parent 1: protocol ip prio 16 u32 \ + match ip src $a flowid 1:30 +done + +for a in $NOPRIOHOSTDST +do + tc filter add dev $DEV parent 1: protocol ip prio 17 u32 \ + match ip dst $a flowid 1:30 +done + +# rest is 'non-interactive' ie 'bulk' and ends up in 1:20 + +tc filter add dev $DEV parent 1: protocol ip prio 18 u32 \ + match ip dst 0.0.0.0/0 flowid 1:20 + + +########## downlink ############# +# slow downloads down to somewhat less than the real speed to prevent +# queuing at our ISP. Tune to see how high you can set it. +# ISPs tend to have *huge* queues to make sure big downloads are fast +# +# attach ingress policer: + +tc qdisc add dev $DEV handle ffff: ingress + +# filter *everything* to it (0.0.0.0/0), drop everything that's +# coming in too fast: + +tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \ + 0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1 + +logger -t wondershaper "Wondershaper was started on device $device." diff --git a/net/wshaper/files/wshaper.init b/net/wshaper/files/wshaper.init new file mode 100644 index 0000000..638cef2 --- /dev/null +++ b/net/wshaper/files/wshaper.init @@ -0,0 +1,10 @@ +#!/bin/sh /etc/rc.common + +START=45 +start() { + wshaper.htb +} + +stop() { + wshaper.htb stop +} diff --git a/net/xinetd/Makefile b/net/xinetd/Makefile new file mode 100644 index 0000000..c2bd6e0 --- /dev/null +++ b/net/xinetd/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2006-2012 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:=xinetd +PKG_VERSION:=2.3.15 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.xinetd.org +PKG_MD5SUM:=77358478fd58efa6366accae99b8b04c + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/xinetd + SECTION:=net + CATEGORY:=Network + TITLE:=A powerful and secure super-server + URL:=http://www.xinetd.org/ +endef + +define Package/xinetd/description + xinetd has access control mechanisms, extensive logging capabilities, + the ability to make services available based on time, can place limits + on the number of servers that can be started, and has deployable + defence mechanisms to protect against port scanners, among other + things. +endef + +define Package/xinetd/conffiles +/etc/xinetd.conf +endef + +TARGET_CFLAGS += -DNO_RPC + +CONFIGURE_ARGS += \ + --without-libwrap \ + --with-loadavg + +CONFIGURE_VARS += \ + ac_cv_header_rpc_pmap_clnt_h=no \ + ac_cv_header_rpc_rpc_h=no \ + ac_cv_header_rpc_rpcent_h=no + +define Package/xinetd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/xinetd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/xinetd.conf $(1)/etc/xinetd.conf + $(INSTALL_DIR) $(1)/etc/xinetd.d + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/xinetd.init $(1)/etc/init.d/xinetd +endef + +$(eval $(call BuildPackage,xinetd)) diff --git a/net/xinetd/files/xinetd.conf b/net/xinetd/files/xinetd.conf new file mode 100644 index 0000000..bd473ed --- /dev/null +++ b/net/xinetd/files/xinetd.conf @@ -0,0 +1,6 @@ +defaults +{ + +} + +includedir /etc/xinetd.d diff --git a/net/xinetd/files/xinetd.init b/net/xinetd/files/xinetd.init new file mode 100644 index 0000000..1437f58 --- /dev/null +++ b/net/xinetd/files/xinetd.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +start() { + service_start /usr/sbin/xinetd -pidfile /var/run/xinetd.pid +} + +stop() { + service_stop /usr/sbin/xinetd +} + diff --git a/net/xinetd/patches/001-ar.patch b/net/xinetd/patches/001-ar.patch new file mode 100644 index 0000000..4d961ba --- /dev/null +++ b/net/xinetd/patches/001-ar.patch @@ -0,0 +1,66 @@ +--- a/libs/src/misc/Makefile.in ++++ b/libs/src/misc/Makefile.in +@@ -62,7 +62,7 @@ libopt: clean + + + $(LIBNAME): $(OBJECTS) +- ar r $@ $? ++ $(AR) r $@ $? + $(RANLIB) $@ + + install: $(LIBNAME) +--- a/libs/src/portable/Makefile.in ++++ b/libs/src/portable/Makefile.in +@@ -57,7 +57,7 @@ libopt: clean + + + $(LIBNAME): $(OBJECTS) +- ar r $@ $? ++ $(AR) r $@ $? + $(RANLIB) $@ + + install: $(LIBNAME) +--- a/libs/src/pset/Makefile.in ++++ b/libs/src/pset/Makefile.in +@@ -53,7 +53,7 @@ libopt: clean + mv $(LIBNAME) $(LIBDIR)/optimized + + $(LIBNAME): $(OBJECTS) +- ar r $@ $? ++ $(AR) r $@ $? + $(RANLIB) $@ + + install: $(LIBNAME) +--- a/libs/src/sio/Makefile.in ++++ b/libs/src/sio/Makefile.in +@@ -52,7 +52,7 @@ libopt: clean + $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)/optimized + + $(LIBNAME): $(OBJECTS) +- ar r $@ $? ++ $(AR) r $@ $? + $(RANLIB) $@ + + install: $(LIBNAME) +--- a/libs/src/str/Makefile.in ++++ b/libs/src/str/Makefile.in +@@ -63,7 +63,7 @@ libopt: clean + $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)-O + + $(LIBNAME): $(OBJECTS) +- ar r $@ $? ++ $(AR) r $@ $? + $(RANLIB) $@ + + LINT_IGNORE=possible pointer alignment|RCSid unused +--- a/libs/src/xlog/Makefile.in ++++ b/libs/src/xlog/Makefile.in +@@ -58,7 +58,7 @@ libopt: clean + $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)/optimized + + $(LIBNAME): $(OBJECTS) +- ar r $@ $? ++ $(AR) r $@ $? + $(RANLIB) $@ + + install: $(LIBNAME) diff --git a/net/xinetd/patches/002-destdir.patch b/net/xinetd/patches/002-destdir.patch new file mode 100644 index 0000000..89075c8 --- /dev/null +++ b/net/xinetd/patches/002-destdir.patch @@ -0,0 +1,27 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -75,15 +75,15 @@ dlibxlog: dlibsio dlibstr + + install: build + for i in $(DAEMONDIR) $(BINDIR) $(MANDIR)/man5 $(MANDIR)/man8 ; do \ +- test -d $$i || mkdir -p $$i ; done +- $(INSTALL_CMD) -m 755 xinetd/xinetd $(DAEMONDIR) +- $(INSTALL_CMD) -m 755 xinetd/itox $(DAEMONDIR) +- $(INSTALL_CMD) -m 755 $(SRCDIR)/xinetd/xconv.pl $(DAEMONDIR) +- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.conf.man $(MANDIR)/man5/xinetd.conf.5 +- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.log.man $(MANDIR)/man8/xinetd.log.8 +- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.man $(MANDIR)/man8/xinetd.8 +- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/itox.8 $(MANDIR)/man8/itox.8 +- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xconv.pl.8 $(MANDIR)/man8/xconv.pl.8 ++ test -d $(DESTDIR)$$i || mkdir -p $(DESTDIR)$$i ; done ++ $(INSTALL_CMD) -m 755 xinetd/xinetd $(DESTDIR)$(DAEMONDIR) ++ $(INSTALL_CMD) -m 755 xinetd/itox $(DESTDIR)$(DAEMONDIR) ++ $(INSTALL_CMD) -m 755 $(SRCDIR)/xinetd/xconv.pl $(DESTDIR)$(DAEMONDIR) ++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.conf.man $(DESTDIR)$(MANDIR)/man5/xinetd.conf.5 ++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.log.man $(DESTDIR)$(MANDIR)/man8/xinetd.log.8 ++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.man $(DESTDIR)$(MANDIR)/man8/xinetd.8 ++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/itox.8 $(DESTDIR)$(MANDIR)/man8/itox.8 ++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xconv.pl.8 $(DESTDIR)$(MANDIR)/man8/xconv.pl.8 + @echo "You must put your xinetd.conf in /etc/xinetd.conf" + @echo "There is a sample config file in xinetd/sample.conf and you can" + @echo "use xconv.pl to convert your old inetd.conf file to an xinetd format" diff --git a/net/xinetd/patches/003-rpc_fix.patch b/net/xinetd/patches/003-rpc_fix.patch new file mode 100644 index 0000000..11f47e7 --- /dev/null +++ b/net/xinetd/patches/003-rpc_fix.patch @@ -0,0 +1,19 @@ +--- a/xinetd/confparse.c ++++ b/xinetd/confparse.c +@@ -745,7 +745,7 @@ static status_e check_entry( struct serv + } + } + +-/* #ifndef NO_RPC */ ++#ifndef NO_RPC + #if defined(HAVE_RPC_RPCENT_H) || defined(HAVE_NETDB_H) + if ( SC_IS_RPC( scp ) && !SC_IS_UNLISTED( scp ) ) + { +@@ -759,6 +759,7 @@ static status_e check_entry( struct serv + SC_RPCDATA( scp )->rd_program_number = rep->r_number ; + } + else ++#endif + #endif /* ! NO_RPC */ + { + if ( !SC_IS_UNLISTED( scp ) ) diff --git a/net/xl2tpd/Makefile b/net/xl2tpd/Makefile new file mode 100644 index 0000000..6d197d6 --- /dev/null +++ b/net/xl2tpd/Makefile @@ -0,0 +1,68 @@ +# +# Copyright (C) 2006-2011 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:=xl2tpd +PKG_VERSION:=1.3.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +# Host seems to be down. +#PKG_SOURCE_URL:=ftp://ftp.xelerance.com/xl2tpd/ +PKG_MD5SUM:=cf61576fef5c2d6c68279a408ec1f0d5 +PKG_SOURCE_URL:=http://pkgs.fedoraproject.org/lookaside/pkgs/xl2tpd/xl2tpd-$(PKG_VERSION).tar.gz/$(PKG_MD5SUM)/ + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/xl2tpd + SECTION:=net + CATEGORY:=Network + TITLE:=An L2TP (Layer 2 Tunneling Protocol) daemon + URL:=http://www.xelerance.com/software/xl2tpd/ + SUBMENU:=VPN + DEPENDS:=+ppp-mod-pppol2tp +ip +resolveip +endef + +define Package/xl2tpd/description +l2tpd is the open source implementation of the L2TP tunneling protocol (RFC2661). +It does implement both LAC and LNS role in a L2TP networking architecture. The +main goal of this protocol is to tunnel PPP frame trough an IP network. +endef + +# XXX: CFLAGS are already set by Build/Compile/Default +MAKE_FLAGS+= \ + OFLAGS="" + +define Package/xl2tpd/conffiles +/etc/xl2tpd/xl2tpd.conf +/etc/xl2tpd/xl2tp-secrets +/etc/ppp/options.xl2tpd +endef + +define Package/xl2tpd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/sbin/xl2tpd $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/sbin/xl2tpd-control $(1)/usr/sbin/ + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/xl2tpd.init $(1)/etc/init.d/xl2tpd + + $(INSTALL_DIR) $(1)/etc/xl2tpd + $(INSTALL_DATA) ./files/xl2tpd.conf $(1)/etc/xl2tpd/ + $(INSTALL_CONF) ./files/xl2tp-secrets $(1)/etc/xl2tpd/ + + $(INSTALL_DIR) $(1)/etc/ppp + $(INSTALL_DATA) ./files/options.xl2tpd $(1)/etc/ppp/ + + $(INSTALL_DIR) $(1)/lib/netifd/proto + $(INSTALL_BIN) ./files/l2tp.sh $(1)/lib/netifd/proto +endef + +$(eval $(call BuildPackage,xl2tpd)) diff --git a/net/xl2tpd/README b/net/xl2tpd/README new file mode 100644 index 0000000..aadc26e --- /dev/null +++ b/net/xl2tpd/README @@ -0,0 +1,23 @@ +OpenWRT Package for xl2tpd + +xl2tpd is a development from the original l2tpd package originally written by +Mark Spencer, subsequently forked by Scott Balmos and David Stipp, inherited +by Jeff McAdams, modified substantially by Jacco de Leeuw and then forked +again by Xelerance (after it was abandoned by l2tpd.org). + +Rationale for inclusion in OpenWRT: + +l2tpd has some serious alignment problems on RISC platforms. It also runs +purely in userspace. + +Some of the features added in this fork include: + +1. IPSec SA reference tracking inconjunction with openswan's IPSec transport + mode, which adds support for multiple clients behind the same NAT router + and multiple clients on the same internal IP behind different NAT routers. + +2. Support for the pppol2tp kernel mode L2TP. + +3. Alignment and endian problems resolved. + +hcg diff --git a/net/xl2tpd/files/l2tp.sh b/net/xl2tpd/files/l2tp.sh new file mode 100644 index 0000000..b0d5d4c --- /dev/null +++ b/net/xl2tpd/files/l2tp.sh @@ -0,0 +1,115 @@ +#!/bin/sh + +[ -x /usr/sbin/xl2tpd ] || exit 0 + +[ -n "$INCLUDE_ONLY" ] || { + . /lib/functions.sh + . ../netifd-proto.sh + init_proto "$@" +} + +proto_l2tp_init_config() { + proto_config_add_string "username" + proto_config_add_string "password" + proto_config_add_string "keepalive" + proto_config_add_string "pppd_options" + proto_config_add_boolean "defaultroute" + proto_config_add_boolean "peerdns" + proto_config_add_boolean "ipv6" + proto_config_add_int "mtu" + proto_config_add_string "server" + available=1 + no_device=1 +} + +proto_l2tp_setup() { + local config="$1" + local iface="$2" + local optfile="/tmp/l2tp/options.${config}" + + local ip serv_addr server + json_get_var server server && { + for ip in $(resolveip -t 5 "$server"); do + ( proto_add_host_dependency "$config" "$ip" ) + serv_addr=1 + done + } + [ -n "$serv_addr" ] || { + echo "Could not resolve server address" + sleep 5 + proto_setup_failed "$config" + exit 1 + } + + if [ ! -p /var/run/xl2tpd/l2tp-control ]; then + /etc/init.d/xl2tpd start + fi + + json_get_vars ipv6 peerdns defaultroute demand keepalive username password pppd_options + [ "$ipv6" = 1 ] || ipv6="" + [ "$peerdns" = 0 ] && peerdns="" || peerdns="1" + if [ "$defaultroute" = 1 ]; then + defaultroute="defaultroute replacedefaultroute"; + else + defaultroute="nodefaultroute" + fi + if [ "${demand:-0}" -gt 0 ]; then + demand="precompiled-active-filter /etc/ppp/filter demand idle $demand" + else + demand="persist" + fi + + [ -n "$mtu" ] || json_get_var mtu mtu + + local interval="${keepalive##*[, ]}" + [ "$interval" != "$keepalive" ] || interval=5 + + mkdir -p /tmp/l2tp + + echo "${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive%%[, ]*}}" > "${optfile}" + echo "${peerdns:+usepeerdns}" >> "${optfile}" + echo "$defaultroute" >> "${optfile}" + echo "${username:+user \"$username\" password \"$password\"}" >> "${optfile}" + echo "ipparam \"$config\"" >> "${optfile}" + echo "ifname \"l2tp-$config\"" >> "${optfile}" + echo "ip-up-script /lib/netifd/ppp-up" >> "${optfile}" + echo "ipv6-up-script /lib/netifd/ppp-up" >> "${optfile}" + echo "ip-down-script /lib/netifd/ppp-down" >> "${optfile}" + echo "ipv6-down-script /lib/netifd/ppp-down" >> "${optfile}" + # Don't wait for LCP term responses; exit immediately when killed. + echo "lcp-max-terminate 0" >> "${optfile}" + echo "${ipv6:++ipv6} ${pppd_options}" >> "${optfile}" + echo "${mtu:+mtu $mtu mru $mtu}" >> "${optfile}" + + xl2tpd-control add l2tp-${config} pppoptfile=${optfile} lns=${server} redial=yes redial timeout=20 + xl2tpd-control connect l2tp-${config} +} + +proto_l2tp_teardown() { + local interface="$1" + local optfile="/tmp/l2tp/options.${interface}" + + case "$ERROR" in + 11|19) + proto_notify_error "$interface" AUTH_FAILED + proto_block_restart "$interface" + ;; + 2) + proto_notify_error "$interface" INVALID_OPTIONS + proto_block_restart "$interface" + ;; + esac + + xl2tpd-control disconnect l2tp-${interface} + # Wait for interface to go down + while [ -d /sys/class/net/l2tp-${interface} ]; do + sleep 1 + done + + xl2tpd-control remove l2tp-${interface} + rm -f ${optfile} +} + +[ -n "$INCLUDE_ONLY" ] || { + add_protocol l2tp +} diff --git a/net/xl2tpd/files/options.xl2tpd b/net/xl2tpd/files/options.xl2tpd new file mode 100644 index 0000000..f0fc4f4 --- /dev/null +++ b/net/xl2tpd/files/options.xl2tpd @@ -0,0 +1,13 @@ +# + +lock +noauth +debug +dump +logfd 2 +logfile /var/log/xl2tpd.log +noccp +novj +novjccomp +nopcomp +noaccomp diff --git a/net/xl2tpd/files/xl2tp-secrets b/net/xl2tpd/files/xl2tp-secrets new file mode 100644 index 0000000..0fb513f --- /dev/null +++ b/net/xl2tpd/files/xl2tp-secrets @@ -0,0 +1,5 @@ +# Secrets for authenticating l2tp tunnels +# us them secret +# * marko blah2 +# zeus marko blah +# * * interop diff --git a/net/xl2tpd/files/xl2tpd.conf b/net/xl2tpd/files/xl2tpd.conf new file mode 100644 index 0000000..2423ff6 --- /dev/null +++ b/net/xl2tpd/files/xl2tpd.conf @@ -0,0 +1,23 @@ +[global] +port = 1701 +auth file = /etc/xl2tpd/xl2tp-secrets +access control = no + +;[lns default] +;exclusive = yes +;ip range = 192.168.254.202-192.168.254.210 +;lac = 10.0.1.2 +;hidden bit = no +;local ip = 192.168.254.200 +;length bit = yes +;refuse authentication = yes +;name = VersaLink +;ppp debug = yes +;pppoptfile = /etc/ppp/options.xl2tpd + +;[lac left] +;lns = 10.0.1.2 +;refuse authentication = yes +;name = VersaLink +;ppp debug = yes +;pppoptfile = /etc/ppp/options.xl2tpd diff --git a/net/xl2tpd/files/xl2tpd.conf.sample b/net/xl2tpd/files/xl2tpd.conf.sample new file mode 100644 index 0000000..477afa5 --- /dev/null +++ b/net/xl2tpd/files/xl2tpd.conf.sample @@ -0,0 +1,73 @@ +; +; Sample l2tpd configuration file +; +; This example file should give you some idea of how the options for l2tpd +; should work. The best place to look for a list of all options is in +; the source code itself, until I have the time to write better documetation :) +; Specifically, the file "file.c" contains a list of commands at the end. +; +; You most definitely don't have to spell out everything as it is done here +; +; [global] ; Global parameters: +; port = 1701 ; * Bind to port 1701 +; auth file = /etc/xl2tpd/xl2tp-secrets ; * Where our challenge secrets are +; access control = yes ; * Refuse connections without IP match +; rand source = dev ; Source for entropy for random +; ; numbers, options are: +; ; dev - reads of /dev/urandom +; ; sys - uses rand() +; ; egd - reads from egd socket +; ; egd is not yet implemented +; +; [lns default] ; Our fallthrough LNS definition +; exclusive = no ; * Only permit one tunnel per host +; ip range = 192.168.0.1-192.168.0.20 ; * Allocate from this IP range +; no ip range = 192.168.0.3-192.168.0.9 ; * Except these hosts +; ip range = 192.168.0.5 ; * But this one is okay +; ip range = lac1-lac2 ; * And anything from lac1 to lac2's IP +; lac = 192.168.1.4 - 192.168.1.8 ; * These can connect as LAC's +; no lac = untrusted.marko.net ; * This guy can't connect +; hidden bit = no ; * Use hidden AVP's? +; local ip = 192.168.1.2 ; * Our local IP to use +; length bit = yes ; * Use length bit in payload? +; require chap = yes ; * Require CHAP auth. by peer +; refuse pap = yes ; * Refuse PAP authentication +; refuse chap = no ; * Refuse CHAP authentication +; refuse authentication = no ; * Refuse authentication altogether +; require authentication = yes ; * Require peer to authenticate +; unix authentication = no ; * Use /etc/passwd for auth. +; name = myhostname ; * Report this as our hostname +; ppp debug = no ; * Turn on PPP debugging +; pppoptfile = /etc/ppp/options.xl2tpd.lns ; * ppp options file +; call rws = 10 ; * RWS for call (-1 is valid) +; tunnel rws = 4 ; * RWS for tunnel (must be > 0) +; flow bit = yes ; * Include sequence numbers +; challenge = yes ; * Challenge authenticate peer ; +; +; [lac marko] ; Example VPN LAC definition +; lns = lns.marko.net ; * Who is our LNS? +; lns = lns2.marko.net ; * A backup LNS (not yet used) +; redial = yes ; * Redial if disconnected? +; redial timeout = 15 ; * Wait n seconds between redials +; max redials = 5 ; * Give up after n consecutive failures +; hidden bit = yes ; * User hidden AVP's? +; local ip = 192.168.1.1 ; * Force peer to use this IP for us +; remote ip = 192.168.1.2 ; * Force peer to use this as their IP +; length bit = no ; * Use length bit in payload? +; require pap = no ; * Require PAP auth. by peer +; require chap = yes ; * Require CHAP auth. by peer +; refuse pap = yes ; * Refuse PAP authentication +; refuse chap = no ; * Refuse CHAP authentication +; refuse authentication = no ; * Refuse authentication altogether +; require authentication = yes ; * Require peer to authenticate +; name = marko ; * Report this as our hostname +; ppp debug = no ; * Turn on PPP debugging +; pppoptfile = /etc/ppp/options.xl2tpd.marko ; * ppp options file for this lac +; call rws = 10 ; * RWS for call (-1 is valid) +; tunnel rws = 4 ; * RWS for tunnel (must be > 0) +; flow bit = yes ; * Include sequence numbers +; challenge = yes ; * Challenge authenticate peer +; +; [lac cisco] ; Another quick LAC +; lns = cisco.marko.net ; * Required, but can take from default +; require authentication = yes diff --git a/net/xl2tpd/files/xl2tpd.init b/net/xl2tpd/files/xl2tpd.init new file mode 100644 index 0000000..22e8459 --- /dev/null +++ b/net/xl2tpd/files/xl2tpd.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2010 OpenWrt.org + +START=60 +BIN=xl2tpd +DEFAULT=/etc/default/$BIN +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid + +start() { + mkdir -p $RUN_D/$BIN + [ -f $DEFAULT ] && . $DEFAULT + $BIN $OPTIONS +} + +stop() { + [ -f $PID_F ] && kill $(cat $PID_F) +} diff --git a/net/xl2tpd/patches/100-makefile_opt_flags.patch b/net/xl2tpd/patches/100-makefile_opt_flags.patch new file mode 100644 index 0000000..400bdf1 --- /dev/null +++ b/net/xl2tpd/patches/100-makefile_opt_flags.patch @@ -0,0 +1,12 @@ +--- a/Makefile ++++ b/Makefile +@@ -90,7 +90,8 @@ OSFLAGS?= -DLINUX -I$(KERNELSRC)/include + + IPFLAGS?= -DIP_ALLOCATION + +-CFLAGS+= $(DFLAGS) -O2 -fno-builtin -Wall -DSANITY $(OSFLAGS) $(IPFLAGS) ++OFLAGS=-O2 ++CFLAGS+= $(DFLAGS) $(OFLAGS) -fno-builtin -Wall -DSANITY $(OSFLAGS) $(IPFLAGS) + HDRS=l2tp.h avp.h misc.h control.h call.h scheduler.h file.h aaa.h md5.h + OBJS=xl2tpd.o pty.o misc.o control.o avp.o call.o network.o avpsend.o scheduler.o file.o aaa.o md5.o + SRCS=${OBJS:.o=.c} ${HDRS} diff --git a/net/xl2tpd/patches/110-makefile_dont_build_pfc.patch b/net/xl2tpd/patches/110-makefile_dont_build_pfc.patch new file mode 100644 index 0000000..90b320f --- /dev/null +++ b/net/xl2tpd/patches/110-makefile_dont_build_pfc.patch @@ -0,0 +1,43 @@ +--- a/Makefile 2011-08-16 20:28:19.968069040 +0200 ++++ b/Makefile 2011-08-16 20:27:57.968069032 +0200 +@@ -106,10 +106,10 @@ + MANDIR?=$(DESTDIR)${PREFIX}/share/man + + +-all: $(EXEC) pfc $(CONTROL_EXEC) ++all: $(EXEC) $(CONTROL_EXEC) + + clean: +- rm -f $(OBJS) $(EXEC) pfc.o pfc $(CONTROL_EXEC) ++ rm -f $(OBJS) $(EXEC) $(CONTROL_EXEC) + + $(EXEC): $(OBJS) $(HDRS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS) +@@ -117,14 +117,10 @@ + $(CONTROL_EXEC): $(CONTROL_SRCS) + $(CC) $(CONTROL_SRCS) -o $@ + +-pfc: +- $(CC) $(CFLAGS) -c contrib/pfc.c +- $(CC) $(LDFLAGS) -o pfc pfc.o -lpcap $(LDLIBS) +- + romfs: + $(ROMFSINST) /bin/$(EXEC) + +-install: ${EXEC} pfc ${CONTROL_EXEC} ++install: ${EXEC} ${CONTROL_EXEC} + install -d -m 0755 ${SBINDIR} + install -m 0755 $(EXEC) ${SBINDIR}/$(EXEC) + install -d -m 0755 ${MANDIR}/man5 +@@ -132,11 +128,6 @@ + install -m 0644 doc/xl2tpd.8 ${MANDIR}/man8/ + install -m 0644 doc/xl2tpd.conf.5 doc/l2tp-secrets.5 \ + ${MANDIR}/man5/ +- # pfc +- install -d -m 0755 ${BINDIR} +- install -m 0755 pfc ${BINDIR}/pfc +- install -d -m 0755 ${MANDIR}/man1 +- install -m 0644 contrib/pfc.1 ${MANDIR}/man1/ + # control exec + install -d -m 0755 ${SBINDIR} + install -m 0755 $(CONTROL_EXEC) ${SBINDIR}/$(CONTROL_EXEC) diff --git a/net/xl2tpd/patches/120-kernel-mode-l2tp.patch b/net/xl2tpd/patches/120-kernel-mode-l2tp.patch new file mode 100644 index 0000000..272c31a --- /dev/null +++ b/net/xl2tpd/patches/120-kernel-mode-l2tp.patch @@ -0,0 +1,368 @@ +diff --git a/Makefile b/Makefile +index 6f6481f..778f38d 100644 +--- a/Makefile ++++ b/Makefile +@@ -62,8 +62,8 @@ + # are packages seperately (eg kernel-headers on Fedora) + # Note: 2.6.23+ support still needs some changes in the xl2tpd source + # +-#OSFLAGS+= -DUSE_KERNEL +-# ++# Kernel mode fixed by sigwall ++OSFLAGS+= -DUSE_KERNEL + # + # Uncomment the next line for FreeBSD + # +diff --git a/call.c b/call.c +index d1b1858..b672f91 100644 +--- a/call.c ++++ b/call.c +@@ -680,6 +680,8 @@ struct call *get_call (int tunnel, int call, struct in_addr addr, int port, + st->peer.sin_port = port; + st->refme = refme; + st->refhim = refhim; ++ st->udp_fd = -1; ++ st->pppox_fd = -1; + bcopy (&addr, &st->peer.sin_addr, sizeof (addr)); + st->next = tunnels.head; + tunnels.head = st; +diff --git a/control.c b/control.c +index 0892df9..9362ffd 100644 +--- a/control.c ++++ b/control.c +@@ -596,6 +596,9 @@ int control_finish (struct tunnel *t, struct call *c) + if (gconfig.debug_state) + l2tp_log (LOG_DEBUG, "%s: sending SCCCN\n", __FUNCTION__); + control_xmit (buf); ++ ++ connect_pppol2tp(t); ++ + /* Schedule a HELLO */ + tv.tv_sec = HELLO_DELAY; + tv.tv_usec = 0; +@@ -608,6 +611,7 @@ int control_finish (struct tunnel *t, struct call *c) + "Connection established to %s, %d. Local: %d, Remote: %d (ref=%u/%u).\n", + IPADDY (t->peer.sin_addr), + ntohs (t->peer.sin_port), t->ourtid, t->tid, t->refme, t->refhim); ++ + if (t->lac) + { + /* This is part of a LAC, so we want to go ahead +@@ -635,6 +639,9 @@ int control_finish (struct tunnel *t, struct call *c) + IPADDY (t->peer.sin_addr), + ntohs (t->peer.sin_port), t->ourtid, t->tid, t->refme, t->refhim, + t->lns->entname); ++ ++ connect_pppol2tp(t); ++ + /* Schedule a HELLO */ + tv.tv_sec = HELLO_DELAY; + tv.tv_usec = 0; +diff --git a/l2tp.h b/l2tp.h +index 2724fff..856423f 100644 +--- a/l2tp.h ++++ b/l2tp.h +@@ -167,6 +167,8 @@ struct tunnel + int ourrws; /* Receive Window Size */ + int rxspeed; /* Receive bps */ + int txspeed; /* Transmit bps */ ++ int udp_fd; /* UDP fd */ ++ int pppox_fd; /* PPPOX tunnel fd */ + struct call *self; + struct lns *lns; /* LNS that owns us */ + struct lac *lac; /* LAC that owns us */ +@@ -220,6 +222,7 @@ extern void control_xmit (void *); + extern int ppd; + extern int switch_io; /* jz */ + extern int control_fd; ++extern int connect_pppol2tp(struct tunnel *t); + extern int start_pppd (struct call *c, struct ppp_opts *); + extern void magic_lac_dial (void *); + extern int get_entropy (unsigned char *, int); +diff --git a/linux/include/linux/if_pppol2tp.h b/linux/include/linux/if_pppol2tp.h +index a7d6a22..0795e4a 100644 +--- a/linux/include/linux/if_pppol2tp.h ++++ b/linux/include/linux/if_pppol2tp.h +@@ -36,6 +36,20 @@ struct pppol2tp_addr + __u16 d_tunnel, d_session; /* For sending outgoing packets */ + }; + ++/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 ++ * bits. So we need a different sockaddr structure. ++ */ ++struct pppol2tpv3_addr { ++ pid_t pid; /* pid that owns the fd. ++ * 0 => current */ ++ int fd; /* FD of UDP or IP socket to use */ ++ ++ struct sockaddr_in addr; /* IP address and port to send to */ ++ ++ __u32 s_tunnel, s_session; /* For matching incoming packets */ ++ __u32 d_tunnel, d_session; /* For sending outgoing packets */ ++}; ++ + /* Socket options: + * DEBUG - bitmask of debug message categories + * SENDSEQ - 0 => don't send packets with sequence numbers +diff --git a/network.c b/network.c +index 241bd82..fde250e 100644 +--- a/network.c ++++ b/network.c +@@ -45,6 +91,7 @@ int init_network (void) + server.sin_family = AF_INET; + server.sin_addr.s_addr = gconfig.listenaddr; + server.sin_port = htons (gconfig.port); ++ int flags; + if ((server_socket = socket (PF_INET, SOCK_DGRAM, 0)) < 0) + { + l2tp_log (LOG_CRIT, "%s: Unable to allocate socket. Terminating.\n", +@@ -52,6 +99,10 @@ int init_network (void) + return -EINVAL; + }; + ++ flags = 1; ++ setsockopt(server_socket, SOL_SOCKET, SO_REUSEADDR, &flags, sizeof(flags)); ++ setsockopt(server_socket, SOL_SOCKET, SO_NO_CHECK, &flags, sizeof(flags)); ++ + if (bind (server_socket, (struct sockaddr *) &server, sizeof (server))) + { + close (server_socket); +@@ -321,6 +373,11 @@ int build_fdset (fd_set *readfds) + + while (tun) + { ++ if (tun->udp_fd > -1) { ++ if (tun->udp_fd > max) ++ max = tun->udp_fd; ++ FD_SET (tun->udp_fd, readfds); ++ } + call = tun->call_head; + while (call) + { +@@ -390,6 +447,8 @@ void network_thread () + struct iovec iov; + char cbuf[256]; + unsigned int refme, refhim; ++ int * currentfd; ++ int server_socket_processed; + + /* This one buffer can be recycled for everything except control packets */ + buf = new_buf (MAX_RECV_SIZE); +@@ -428,7 +487,21 @@ void network_thread () + { + do_control (); + } +- if (FD_ISSET (server_socket, &readfds)) ++ server_socket_processed = 0; ++ currentfd = NULL; ++ st = tunnels.head; ++ while (st || !server_socket_processed) { ++ if (st && (st->udp_fd == -1)) { ++ st=st->next; ++ continue; ++ } ++ if (st) { ++ currentfd = &st->udp_fd; ++ } else { ++ currentfd = &server_socket; ++ server_socket_processed = 1; ++ } ++ if (FD_ISSET (*currentfd, &readfds)) + { + /* + * Okay, now we're ready for reading and processing new data. +@@ -457,12 +530,19 @@ void network_thread () + msgh.msg_flags = 0; + + /* Receive one packet. */ +- recvsize = recvmsg(server_socket, &msgh, 0); ++ recvsize = recvmsg(*currentfd, &msgh, 0); + + if (recvsize < MIN_PAYLOAD_HDR_LEN) + { + if (recvsize < 0) + { ++ if (errno == ECONNREFUSED) { ++ close(*currentfd); ++ } ++ if ((errno == ECONNREFUSED) || ++ (errno == EBADF)) { ++ *currentfd = -1; ++ } + if (errno != EAGAIN) + l2tp_log (LOG_WARNING, + "%s: recvfrom returned error %d (%s)\n", +@@ -567,6 +647,8 @@ void network_thread () + } + }; + } ++ if (st) st=st->next; ++ } + + /* + * finished obvious sources, look for data from PPP connections. +@@ -639,3 +721,82 @@ void network_thread () + } + + } ++ ++int connect_pppol2tp(struct tunnel *t) { ++#ifdef USE_KERNEL ++ if (kernel_support) { ++ int ufd = -1, fd2 = -1; ++ int flags; ++ struct sockaddr_pppol2tp sax; ++ ++ struct sockaddr_in server; ++ server.sin_family = AF_INET; ++ server.sin_addr.s_addr = gconfig.listenaddr; ++ server.sin_port = htons (gconfig.port); ++ if ((ufd = socket (PF_INET, SOCK_DGRAM, 0)) < 0) ++ { ++ l2tp_log (LOG_CRIT, "%s: Unable to allocate UDP socket. Terminating.\n", ++ __FUNCTION__); ++ return -EINVAL; ++ }; ++ ++ flags=1; ++ setsockopt(ufd, SOL_SOCKET, SO_REUSEADDR, &flags, sizeof(flags)); ++ setsockopt(ufd, SOL_SOCKET, SO_NO_CHECK, &flags, sizeof(flags)); ++ ++ if (bind (ufd, (struct sockaddr *) &server, sizeof (server))) ++ { ++ close (ufd); ++ l2tp_log (LOG_CRIT, "%s: Unable to bind UDP socket: %s. Terminating.\n", ++ __FUNCTION__, strerror(errno), errno); ++ return -EINVAL; ++ }; ++ server = t->peer; ++ flags = fcntl(ufd, F_GETFL); ++ if (flags == -1 || fcntl(ufd, F_SETFL, flags | O_NONBLOCK) == -1) { ++ l2tp_log (LOG_WARNING, "%s: Unable to set UDP socket nonblock.\n", ++ __FUNCTION__); ++ return -EINVAL; ++ } ++ if (connect (ufd, (struct sockaddr *) &server, sizeof(server)) < 0) { ++ l2tp_log (LOG_CRIT, "%s: Unable to connect UDP peer. Terminating.\n", ++ __FUNCTION__); ++ return -EINVAL; ++ } ++ ++ t->udp_fd=ufd; ++ ++ fd2 = socket(AF_PPPOX, SOCK_DGRAM, PX_PROTO_OL2TP); ++ if (fd2 < 0) { ++ l2tp_log (LOG_WARNING, "%s: Unable to allocate PPPoL2TP socket.\n", ++ __FUNCTION__); ++ return -EINVAL; ++ } ++ flags = fcntl(fd2, F_GETFL); ++ if (flags == -1 || fcntl(fd2, F_SETFL, flags | O_NONBLOCK) == -1) { ++ l2tp_log (LOG_WARNING, "%s: Unable to set PPPoL2TP socket nonblock.\n", ++ __FUNCTION__); ++ return -EINVAL; ++ } ++ sax.sa_family = AF_PPPOX; ++ sax.sa_protocol = PX_PROTO_OL2TP; ++ sax.pppol2tp.pid = 0; ++ sax.pppol2tp.fd = t->udp_fd; ++ sax.pppol2tp.addr.sin_addr.s_addr = t->peer.sin_addr.s_addr; ++ sax.pppol2tp.addr.sin_port = t->peer.sin_port; ++ sax.pppol2tp.addr.sin_family = AF_INET; ++ sax.pppol2tp.s_tunnel = t->ourtid; ++ sax.pppol2tp.s_session = 0; ++ sax.pppol2tp.d_tunnel = t->tid; ++ sax.pppol2tp.d_session = 0; ++ if ((connect(fd2, (struct sockaddr *)&sax, sizeof(sax))) < 0) { ++ l2tp_log (LOG_WARNING, "%s: Unable to connect PPPoL2TP socket. %d %s\n", ++ __FUNCTION__, errno, strerror(errno)); ++ close(fd2); ++ return -EINVAL; ++ } ++ t->pppox_fd = fd2; ++ } ++#endif ++ return 0; ++} +diff --git a/xl2tpd.c b/xl2tpd.c +index 307ac2e..3fb6dd7 100644 +--- a/xl2tpd.c ++++ b/xl2tpd.c +@@ -278,7 +278,11 @@ void death_handler (int signal) + struct tunnel *st, *st2; + int sec; + l2tp_log (LOG_CRIT, "%s: Fatal signal %d received\n", __FUNCTION__, signal); ++#ifdef USE_KERNEL ++ if (kernel_support || signal != SIGTERM) { ++#else + if (signal != SIGTERM) { ++#endif + st = tunnels.head; + while (st) + { +@@ -349,7 +353,7 @@ int start_pppd (struct call *c, struct ppp_opts *opts) + int flags; + #endif + int pos = 1; +- int fd2; ++ int fd2 = -1; + #ifdef DEBUG_PPPD + int x; + #endif +@@ -397,7 +401,7 @@ int start_pppd (struct call *c, struct ppp_opts *opts) + sax.sa_family = AF_PPPOX; + sax.sa_protocol = PX_PROTO_OL2TP; + sax.pppol2tp.pid = 0; +- sax.pppol2tp.fd = server_socket; ++ sax.pppol2tp.fd = c->container->udp_fd; + sax.pppol2tp.addr.sin_addr.s_addr = c->container->peer.sin_addr.s_addr; + sax.pppol2tp.addr.sin_port = c->container->peer.sin_port; + sax.pppol2tp.addr.sin_family = AF_INET; +@@ -408,6 +412,7 @@ int start_pppd (struct call *c, struct ppp_opts *opts) + if (connect(fd2, (struct sockaddr *)&sax, sizeof(sax)) < 0) { + l2tp_log (LOG_WARNING, "%s: Unable to connect PPPoL2TP socket.\n", + __FUNCTION__); ++ close(fd2); + return -EINVAL; + } + stropt[pos++] = strdup ("plugin"); +@@ -484,7 +489,7 @@ int start_pppd (struct call *c, struct ppp_opts *opts) + dup2 (fd2, 0); + dup2 (fd2, 1); + close(fd2); +- ++ } + /* close all the calls pty fds */ + st = tunnels.head; + while (st) +@@ -492,12 +497,17 @@ int start_pppd (struct call *c, struct ppp_opts *opts) + sc = st->call_head; + while (sc) + { +- close (sc->fd); ++#ifdef USE_KERNEL ++ if (kernel_support) { ++ close(st->udp_fd); /* tunnel UDP fd */ ++ close(st->pppox_fd); /* tunnel PPPoX fd */ ++ } else ++#endif ++ close (sc->fd); /* call pty fd */ + sc = sc->next; + } + st = st->next; + } +- } + + /* close the UDP socket fd */ + close (server_socket); +@@ -615,6 +625,10 @@ void destroy_tunnel (struct tunnel *t) + the memory pointed to by t->chal_us.vector at some other place */ + if (t->chal_them.vector) + free (t->chal_them.vector); ++ if (t->pppox_fd > -1 ) ++ close (t->pppox_fd); ++ if (t->udp_fd > -1 ) ++ close (t->udp_fd); + free (t); + free (me); + } diff --git a/net/xl2tpd/patches/130-no-kill-ipparam.patch b/net/xl2tpd/patches/130-no-kill-ipparam.patch new file mode 100644 index 0000000..896d391 --- /dev/null +++ b/net/xl2tpd/patches/130-no-kill-ipparam.patch @@ -0,0 +1,11 @@ +--- xl2tpd-1.3.1/control.c.orig 2012-04-25 12:59:28.718825985 +0100 ++++ xl2tpd-1.3.1/control.c 2012-04-25 12:59:37.063916785 +0100 +@@ -905,8 +905,6 @@ int control_finish (struct tunnel *t, st + po = add_opt (po, c->lac->pppoptfile); + } + }; +- po = add_opt (po, "ipparam"); +- po = add_opt (po, IPADDY (t->peer.sin_addr)); + start_pppd (c, po); + opt_destroy (po); + if (c->lac) diff --git a/net/xsupplicant/Makefile b/net/xsupplicant/Makefile new file mode 100644 index 0000000..e9efc2b --- /dev/null +++ b/net/xsupplicant/Makefile @@ -0,0 +1,70 @@ +# +# Copyright (C) 2006-2009 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:=xsupplicant +PKG_VERSION:=1.2.8 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/open1x +PKG_MD5SUM:=75f89731b905eb8d36a52621661e1226 + +PKG_BUILD_DEPENDS:=PACKAGE_kmod-madwifi:madwifi +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=0 + +include $(INCLUDE_DIR)/package.mk + +define Package/xsupplicant + SECTION:=net + CATEGORY:=Network + SUBMENU:=wireless + DEPENDS:=+libopenssl +libiw + TITLE:=A fully compliant 802.1x authenticator + URL:=http://open1x.sourceforge.net/ +endef + +define Package/xsupplicant/description + This software allows a GNU/Linux or BSD workstation to authenticate with + a RADIUS server using 802.1x and various EAP protocols. +endef + +define Package/xsupplicant/conffiles +/etc/xsupplicant.conf +endef + +TARGET_CFLAGS += --std=gnu99 + +CONFIGURE_ARGS+= \ + --with-openssl="$(STAGING_DIR)/usr" \ + --with-madwifi-path="$(STAGING_DIR)/usr/include/madwifi" \ + +CONFIGURE_VARS+= \ + CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/madwifi" \ + +define Build/Prepare + $(call Build/Prepare/Default) + (cd $(PKG_BUILD_DIR); touch \ + configure.in \ + aclocal.m4 \ + Makefile.in \ + configure \ + ); +endef + +define Package/xsupplicant/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/xsupplicant.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xsup_* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/xsupplicant $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,xsupplicant)) diff --git a/net/xsupplicant/patches/001-no-lfl.patch b/net/xsupplicant/patches/001-no-lfl.patch new file mode 100644 index 0000000..7110814 --- /dev/null +++ b/net/xsupplicant/patches/001-no-lfl.patch @@ -0,0 +1,22 @@ +--- a/configure ++++ b/configure +@@ -3259,7 +3259,7 @@ if test "$LEX" = :; then + fi + if test -n "$LEX"; then + LFLAGS="$LFLAGS -i" +- MORELIBS="${MORELIBS} -lfl" ++ + fi + + ac_ext=c +--- a/configure.in ++++ b/configure.in +@@ -18,7 +18,7 @@ AC_PROG_YACC + AM_PROG_LEX + if test -n "$LEX"; then + LFLAGS="$LFLAGS -i" +- MORELIBS="${MORELIBS} -lfl" ++ + fi + + AC_HEADER_STDC diff --git a/net/xsupplicant/patches/002-disable-procfs-check.patch b/net/xsupplicant/patches/002-disable-procfs-check.patch new file mode 100644 index 0000000..2c7177a --- /dev/null +++ b/net/xsupplicant/patches/002-disable-procfs-check.patch @@ -0,0 +1,22 @@ +--- a/configure ++++ b/configure +@@ -5362,19 +5362,6 @@ _ACEOF + FRAMER="generic" + fi + +-if test $FRAMER = "linux"; then +- echo "$as_me:$LINENO: checking for procfs support" >&5 +-echo $ECHO_N "checking for procfs support... $ECHO_C" >&6 +- if test -r /proc/net/dev; then +- echo "$as_me:$LINENO: result: okay" >&5 +-echo "${ECHO_T}okay" >&6 +- else +- { { echo "$as_me:$LINENO: error: You must have ProcFS enabled in your kernel!" >&5 +-echo "$as_me: error: You must have ProcFS enabled in your kernel!" >&2;} +- { (exit 1); exit 1; }; }; +- fi +-fi +- + CFLAGS="$GGDBFLAGS $CFLAGS" + + touch Makefile.in diff --git a/net/xsupplicant/patches/003-compile_fix.patch b/net/xsupplicant/patches/003-compile_fix.patch new file mode 100644 index 0000000..30fe2c6 --- /dev/null +++ b/net/xsupplicant/patches/003-compile_fix.patch @@ -0,0 +1,11 @@ +--- a/lib/libxsupgui/Makefile.in ++++ b/lib/libxsupgui/Makefile.in +@@ -91,7 +91,7 @@ install_sh = @install_sh@ + with_openssl_libs = @with_openssl_libs@ + AUTOMAKE_OPTIONS = foreign no-dependencies + +-INCLUDES = ${top_srcdir}/src ++INCLUDES = -I${top_srcdir}/src + + include_HEADERS = xsupgui.h + lib_LIBRARIES = libxsupgui.a diff --git a/net/xsupplicant/patches/005-no_private_linux_header_includes.patch b/net/xsupplicant/patches/005-no_private_linux_header_includes.patch new file mode 100644 index 0000000..3caf928 --- /dev/null +++ b/net/xsupplicant/patches/005-no_private_linux_header_includes.patch @@ -0,0 +1,48 @@ +Index: xsupplicant-1.2.8/src/cardif/linux/cardif_atmel_driver.c +=================================================================== +--- xsupplicant-1.2.8.orig/src/cardif/linux/cardif_atmel_driver.c 2006-10-08 05:42:53.000000000 +0200 ++++ xsupplicant-1.2.8/src/cardif/linux/cardif_atmel_driver.c 2009-01-11 02:59:46.998587770 +0100 +@@ -103,7 +103,6 @@ + #include + #include + #include +-#include + #include + #include + #include +Index: xsupplicant-1.2.8/src/cardif/linux/cardif_linux.c +=================================================================== +--- xsupplicant-1.2.8.orig/src/cardif/linux/cardif_linux.c 2006-10-08 05:42:53.000000000 +0200 ++++ xsupplicant-1.2.8/src/cardif/linux/cardif_linux.c 2009-01-11 03:00:04.496300396 +0100 +@@ -174,7 +174,6 @@ + #include + #include + #include +-#include + #include + #include + #include +Index: xsupplicant-1.2.8/src/cardif/linux/cardif_linux_rtnetlink.c +=================================================================== +--- xsupplicant-1.2.8.orig/src/cardif/linux/cardif_linux_rtnetlink.c 2006-10-08 05:42:53.000000000 +0200 ++++ xsupplicant-1.2.8/src/cardif/linux/cardif_linux_rtnetlink.c 2009-01-11 03:00:14.997328194 +0100 +@@ -203,7 +203,6 @@ + + #include + #include +-#include + #include + #include + #include "netlink.h" +Index: xsupplicant-1.2.8/src/cardif/linux/cardif_linux_wext.c +=================================================================== +--- xsupplicant-1.2.8.orig/src/cardif/linux/cardif_linux_wext.c 2009-01-11 02:58:02.000000000 +0100 ++++ xsupplicant-1.2.8/src/cardif/linux/cardif_linux_wext.c 2009-01-11 03:00:26.230427636 +0100 +@@ -203,7 +203,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/net/xsupplicant/patches/006-no_wireless_h.patch b/net/xsupplicant/patches/006-no_wireless_h.patch new file mode 100644 index 0000000..378e21f --- /dev/null +++ b/net/xsupplicant/patches/006-no_wireless_h.patch @@ -0,0 +1,61 @@ +--- a/src/cardif/linux/cardif_atmel_driver.c ++++ b/src/cardif/linux/cardif_atmel_driver.c +@@ -109,7 +109,6 @@ + #include + #include + #include +-#include + + #ifdef USE_EFENCE + #include +--- a/src/cardif/linux/cardif_linux.c ++++ b/src/cardif/linux/cardif_linux.c +@@ -180,7 +180,6 @@ + #include + #include + #include +-#include + + #include "xsupconfig.h" + #include "profile.h" +--- a/src/cardif/linux/cardif_linux_rtnetlink.c ++++ b/src/cardif/linux/cardif_linux_rtnetlink.c +@@ -207,10 +207,8 @@ + #include + #include "netlink.h" + #include "rtnetlink.h" +-#include + #include + #include +-#include + + #include "profile.h" + #include "xsupconfig.h" +--- a/src/cardif/linux/cardif_linux_wext.c ++++ b/src/cardif/linux/cardif_linux_wext.c +@@ -203,7 +203,6 @@ + #include + #include + #include +-#include + #include + #include + #include +--- a/configure ++++ b/configure +@@ -4759,7 +4759,6 @@ cat >>conftest.$ac_ext <<_ACEOF + #ifndef __user + #define __user + #endif +- #include + + #include <$ac_header> + _ACEOF +@@ -4823,7 +4822,6 @@ cat >>conftest.$ac_ext <<_ACEOF + #ifndef __user + #define __user + #endif +- #include + #include + int + main () diff --git a/net/xtables-addons/Makefile b/net/xtables-addons/Makefile new file mode 100644 index 0000000..8e04e27 --- /dev/null +++ b/net/xtables-addons/Makefile @@ -0,0 +1,151 @@ +# +# Copyright (C) 2009-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=xtables-addons +PKG_VERSION:=1.42 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_MD5SUM:=7c996a0400667b57ab4fb53a013ae742 +PKG_SOURCE_URL:=@SF/xtables-addons +PKG_BUILD_DEPENDS:=iptables +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/xtables-addons + SECTION:=net + CATEGORY:=Network + SUBMENU:=Firewall + TITLE:=Extensions not distributed in the main Xtables + URL:=http://xtables-addons.sourceforge.net/ +endef + +# uses GNU configure + +CONFIGURE_ARGS+= \ + --with-kbuild="$(LINUX_DIR)" \ + --with-xtables="$(STAGING_DIR)/usr" \ + --with-xtlibdir="/usr/lib/iptables" \ + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + DEPMOD="/bin/true" \ + all +endef + +define Build/Install + $(MAKE) -C $(PKG_BUILD_DIR) \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + DEPMOD="/bin/true" \ + install +endef + +# 1: extension/module suffix used in package name +# 2: extension/module display name used in package title/description +# 3: list of extensions to package +# 4: list of modules to package +# 5: module load priority +# 6: module depends +define BuildTemplate + + ifneq ($(3),) + define Package/iptables-mod-$(1) + $$(call Package/xtables-addons) + CATEGORY:=Network + TITLE:=$(2) iptables extension + DEPENDS:=iptables $(if $(4),+kmod-ipt-$(1)) + endef + + define Package/iptables-mod-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/iptables + for m in $(3); do \ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so \ + $$(1)/usr/lib/iptables/ ; \ + done + endef + + $$(eval $$(call BuildPackage,iptables-mod-$(1))) + endif + + ifneq ($(4),) + define KernelPackage/ipt-$(1) + SUBMENU:=Netfilter Extensions + TITLE:=$(2) netfilter module + DEPENDS:=kmod-ipt-core $(6) + KCONFIG:=$(7) + FILES:=$(foreach mod,$(4),$(PKG_BUILD_DIR)/extensions/$(mod).$(LINUX_KMOD_SUFFIX)) + AUTOLOAD:=$(call AutoLoad,$(5),$(notdir $(4))) + endef + + $$(eval $$(call KernelPackage,ipt-$(1))) + endif + +endef + + +define Package/iptaccount + $(call Package/xtables-addons) + CATEGORY:=Network + TITLE:=iptables-mod-account control utility + DEPENDS:=iptables +iptables-mod-account +endef + +define Package/iptaccount/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libxt_ACCOUNT_cl.so* \ + $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/sbin/iptaccount \ + $(1)/usr/sbin/ +endef + + +#$(eval $(call BuildTemplate,SUFFIX,DESCRIPTION,EXTENSION,MODULE,PRIORITY,DEPENDS)) + +$(eval $(call BuildTemplate,compat-xtables,API compatibilty layer,,compat_xtables,45,,CONFIG_NF_CONNTRACK_MARK=y)) +$(eval $(call BuildTemplate,rawpost,RAWPOST,,iptable_rawpost $(if $(CONFIG_IPV6),ip6table_rawpost),50,+kmod-ipt-compat-xtables)) +$(eval $(call BuildTemplate,nathelper-rtsp,RTSP Conntrack and NAT,,rtsp/nf_conntrack_rtsp rtsp/nf_nat_rtsp,46,+kmod-ipt-conntrack-extra)) + +$(eval $(call BuildTemplate,account,ACCOUNT,xt_ACCOUNT,ACCOUNT/xt_ACCOUNT,46,+kmod-ipt-compat-xtables)) +$(eval $(call BuildTemplate,chaos,CHAOS,xt_CHAOS,xt_CHAOS,47,+kmod-ipt-compat-xtables +kmod-ipt-delude +kmod-ipt-tarpit)) +$(eval $(call BuildTemplate,condition,Condition,xt_condition,xt_condition,46,)) +$(eval $(call BuildTemplate,delude,DELUDE,xt_DELUDE,xt_DELUDE,46,+kmod-ipt-compat-xtables)) +$(eval $(call BuildTemplate,dhcpmac,DHCPMAC,xt_DHCPMAC,xt_DHCPMAC,46,+kmod-ipt-compat-xtables)) +$(eval $(call BuildTemplate,dnetmap,DNETMAP,xt_DNETMAP,xt_DNETMAP,46,+kmod-ipt-compat-xtables)) +$(eval $(call BuildTemplate,fuzzy,fuzzy,xt_fuzzy,xt_fuzzy,46,)) +$(eval $(call BuildTemplate,geoip,geoip,xt_geoip,xt_geoip,46,)) +$(eval $(call BuildTemplate,iface,iface,xt_iface,xt_iface,46,)) +$(eval $(call BuildTemplate,ipmark,IPMARK,xt_IPMARK,xt_IPMARK,46,+kmod-ipt-compat-xtables)) +$(eval $(call BuildTemplate,ipp2p,IPP2P,xt_ipp2p,xt_ipp2p,46,+kmod-ipt-compat-xtables)) +$(eval $(call BuildTemplate,ipv4options,ipv4options,xt_ipv4options,xt_ipv4options,46,)) +$(eval $(call BuildTemplate,length2,length2,xt_length2,xt_length2,46,)) +$(eval $(call BuildTemplate,logmark,LOGMARK,xt_LOGMARK,xt_LOGMARK,46,+kmod-ipt-compat-xtables)) +$(eval $(call BuildTemplate,lscan,lscan,xt_lscan,xt_lscan,46,)) +$(eval $(call BuildTemplate,lua,Lua PacketScript,xt_LUA,LUA/xt_LUA,46,+kmod-ipt-conntrack-extra)) +$(eval $(call BuildTemplate,psd,psd,xt_psd,xt_psd,46,)) +$(eval $(call BuildTemplate,quota2,quota2,xt_quota2,xt_quota2,46,)) +$(eval $(call BuildTemplate,rawnat,RAWNAT,xt_RAWDNAT xt_RAWSNAT,xt_RAWNAT,46,+kmod-ipt-compat-xtables)) +$(eval $(call BuildTemplate,steal,STEAL,xt_STEAL,xt_STEAL,46,+kmod-ipt-compat-xtables)) +$(eval $(call BuildTemplate,sysrq,SYSRQ,xt_SYSRQ,xt_SYSRQ,46,+kmod-ipt-compat-xtables)) +$(eval $(call BuildTemplate,tarpit,TARPIT,xt_TARPIT,xt_TARPIT,46,+kmod-ipt-compat-xtables)) + +$(eval $(call BuildPackage,iptaccount)) diff --git a/net/xtables-addons/patches/001-no_depmod.patch b/net/xtables-addons/patches/001-no_depmod.patch new file mode 100644 index 0000000..9905af1 --- /dev/null +++ b/net/xtables-addons/patches/001-no_depmod.patch @@ -0,0 +1,16 @@ +--- + Makefile.in | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/Makefile.am ++++ b/Makefile.am +@@ -11,9 +11,6 @@ FORCE: + xtables-addons.8: FORCE + ${MAKE} -f Makefile.mans all; + +-install-exec-hook: +- depmod -a || :; +- + config.status: Makefile.iptrules.in + + tmpdir := $(shell mktemp -dtu) diff --git a/net/xtables-addons/patches/002-fix-kernel-version-detection.patch b/net/xtables-addons/patches/002-fix-kernel-version-detection.patch new file mode 100644 index 0000000..87385fd --- /dev/null +++ b/net/xtables-addons/patches/002-fix-kernel-version-detection.patch @@ -0,0 +1,22 @@ +--- a/configure ++++ b/configure +@@ -11617,7 +11617,7 @@ regular_CFLAGS="-Wall -Waggregate-return + if test -n "$kbuilddir"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel version that we will build against" >&5 + $as_echo_n "checking kernel version that we will build against... " >&6; } +- krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease)"; ++ krel="$(make -sC "$kbuilddir" M=$PWD kernelversion)"; + kmajor="${krel%%[^0-9]*}"; + kmajor="$(($kmajor+0))"; + krel="${krel:${#kmajor}}"; +--- a/configure.ac ++++ b/configure.ac +@@ -43,7 +43,7 @@ regular_CFLAGS="-Wall -Waggregate-return + + if test -n "$kbuilddir"; then + AC_MSG_CHECKING([kernel version that we will build against]) +- krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease)"; ++ krel="$(make -sC "$kbuilddir" M=$PWD kernelversion)"; + kmajor="${krel%%[[^0-9]]*}"; + kmajor="$(($kmajor+0))"; + krel="${krel:${#kmajor}}"; diff --git a/net/xtables-addons/patches/003-redundant-bracket.patch b/net/xtables-addons/patches/003-redundant-bracket.patch new file mode 100644 index 0000000..d35c430 --- /dev/null +++ b/net/xtables-addons/patches/003-redundant-bracket.patch @@ -0,0 +1,11 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -30,7 +30,7 @@ xtlibdir="$(pkg-config --variable=xtlibd + + AC_ARG_WITH([xtlibdir], + AS_HELP_STRING([--with-xtlibdir=PATH], +- [Path where to install Xtables extensions [[autodetect]]]]), ++ [Path where to install Xtables extensions [[autodetect]]]), + [xtlibdir="$withval"]) + AC_MSG_CHECKING([Xtables module directory]) + AC_MSG_RESULT([$xtlibdir]) diff --git a/net/xtables-addons/patches/004-linux_3_3_compat.patch b/net/xtables-addons/patches/004-linux_3_3_compat.patch new file mode 100644 index 0000000..1259617 --- /dev/null +++ b/net/xtables-addons/patches/004-linux_3_3_compat.patch @@ -0,0 +1,11 @@ +--- a/extensions/compat_xtables.h ++++ b/extensions/compat_xtables.h +@@ -102,6 +102,8 @@ + # define nf_nat_ipv4_multi_range_compat nf_nat_multi_range_compat + # define nf_nat_ipv4_range nf_nat_range + # define NF_NAT_RANGE_MAP_IPS IP_NAT_RANGE_MAP_IPS ++# define NF_NAT_MANIP_SRC IP_NAT_MANIP_SRC ++# define NF_NAT_MANIP_DST IP_NAT_MANIP_DST + #endif + + #if !defined(NIP6) && !defined(NIP6_FMT) diff --git a/net/xtables-addons/patches/005-powerpc_includes.patch b/net/xtables-addons/patches/005-powerpc_includes.patch new file mode 100644 index 0000000..0c16d97 --- /dev/null +++ b/net/xtables-addons/patches/005-powerpc_includes.patch @@ -0,0 +1,12 @@ +Index: xtables-addons-1.42/extensions/xt_ECHO.c +=================================================================== +--- xtables-addons-1.42.orig/extensions/xt_ECHO.c 2012-08-12 20:33:11.000000000 +0200 ++++ xtables-addons-1.42/extensions/xt_ECHO.c 2012-08-12 20:33:24.000000000 +0200 +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include "compat_xtables.h" + + static unsigned int diff --git a/net/xtables-addons/patches/100-add-rtsp-conntrack.patch b/net/xtables-addons/patches/100-add-rtsp-conntrack.patch new file mode 100644 index 0000000..1e155ce --- /dev/null +++ b/net/xtables-addons/patches/100-add-rtsp-conntrack.patch @@ -0,0 +1,1334 @@ +--- /dev/null ++++ b/extensions/rtsp/Kbuild +@@ -0,0 +1,4 @@ ++# -*- Makefile -*- ++ ++obj-m += nf_nat_rtsp.o ++obj-m += nf_conntrack_rtsp.o +--- /dev/null ++++ b/extensions/rtsp/netfilter_helpers.h +@@ -0,0 +1,133 @@ ++/* ++ * Helpers for netfiler modules. This file provides implementations for basic ++ * functions such as strncasecmp(), etc. ++ * ++ * gcc will warn for defined but unused functions, so we only include the ++ * functions requested. The following macros are used: ++ * NF_NEED_STRNCASECMP nf_strncasecmp() ++ * NF_NEED_STRTOU16 nf_strtou16() ++ * NF_NEED_STRTOU32 nf_strtou32() ++ */ ++#ifndef _NETFILTER_HELPERS_H ++#define _NETFILTER_HELPERS_H ++ ++/* Only include these functions for kernel code. */ ++#ifdef __KERNEL__ ++ ++#include ++#define iseol(c) ( (c) == '\r' || (c) == '\n' ) ++ ++/* ++ * The standard strncasecmp() ++ */ ++#ifdef NF_NEED_STRNCASECMP ++static int ++nf_strncasecmp(const char* s1, const char* s2, u_int32_t len) ++{ ++ if (s1 == NULL || s2 == NULL) ++ { ++ if (s1 == NULL && s2 == NULL) ++ { ++ return 0; ++ } ++ return (s1 == NULL) ? -1 : 1; ++ } ++ while (len > 0 && tolower(*s1) == tolower(*s2)) ++ { ++ len--; ++ s1++; ++ s2++; ++ } ++ return ( (len == 0) ? 0 : (tolower(*s1) - tolower(*s2)) ); ++} ++#endif /* NF_NEED_STRNCASECMP */ ++ ++/* ++ * Parse a string containing a 16-bit unsigned integer. ++ * Returns the number of chars used, or zero if no number is found. ++ */ ++#ifdef NF_NEED_STRTOU16 ++static int ++nf_strtou16(const char* pbuf, u_int16_t* pval) ++{ ++ int n = 0; ++ ++ *pval = 0; ++ while (isdigit(pbuf[n])) ++ { ++ *pval = (*pval * 10) + (pbuf[n] - '0'); ++ n++; ++ } ++ ++ return n; ++} ++#endif /* NF_NEED_STRTOU16 */ ++ ++/* ++ * Parse a string containing a 32-bit unsigned integer. ++ * Returns the number of chars used, or zero if no number is found. ++ */ ++#ifdef NF_NEED_STRTOU32 ++static int ++nf_strtou32(const char* pbuf, u_int32_t* pval) ++{ ++ int n = 0; ++ ++ *pval = 0; ++ while (pbuf[n] >= '0' && pbuf[n] <= '9') ++ { ++ *pval = (*pval * 10) + (pbuf[n] - '0'); ++ n++; ++ } ++ ++ return n; ++} ++#endif /* NF_NEED_STRTOU32 */ ++ ++/* ++ * Given a buffer and length, advance to the next line and mark the current ++ * line. ++ */ ++#ifdef NF_NEED_NEXTLINE ++static int ++nf_nextline(char* p, uint len, uint* poff, uint* plineoff, uint* plinelen) ++{ ++ uint off = *poff; ++ uint physlen = 0; ++ ++ if (off >= len) ++ { ++ return 0; ++ } ++ ++ while (p[off] != '\n') ++ { ++ if (len-off <= 1) ++ { ++ return 0; ++ } ++ ++ physlen++; ++ off++; ++ } ++ ++ /* if we saw a crlf, physlen needs adjusted */ ++ if (physlen > 0 && p[off] == '\n' && p[off-1] == '\r') ++ { ++ physlen--; ++ } ++ ++ /* advance past the newline */ ++ off++; ++ ++ *plineoff = *poff; ++ *plinelen = physlen; ++ *poff = off; ++ ++ return 1; ++} ++#endif /* NF_NEED_NEXTLINE */ ++ ++#endif /* __KERNEL__ */ ++ ++#endif /* _NETFILTER_HELPERS_H */ +--- /dev/null ++++ b/extensions/rtsp/netfilter_mime.h +@@ -0,0 +1,89 @@ ++/* ++ * MIME functions for netfilter modules. This file provides implementations ++ * for basic MIME parsing. MIME headers are used in many protocols, such as ++ * HTTP, RTSP, SIP, etc. ++ * ++ * gcc will warn for defined but unused functions, so we only include the ++ * functions requested. The following macros are used: ++ * NF_NEED_MIME_NEXTLINE nf_mime_nextline() ++ */ ++#ifndef _NETFILTER_MIME_H ++#define _NETFILTER_MIME_H ++ ++/* Only include these functions for kernel code. */ ++#ifdef __KERNEL__ ++ ++#include ++ ++/* ++ * Given a buffer and length, advance to the next line and mark the current ++ * line. If the current line is empty, *plinelen will be set to zero. If ++ * not, it will be set to the actual line length (including CRLF). ++ * ++ * 'line' in this context means logical line (includes LWS continuations). ++ * Returns 1 on success, 0 on failure. ++ */ ++#ifdef NF_NEED_MIME_NEXTLINE ++static int ++nf_mime_nextline(char* p, uint len, uint* poff, uint* plineoff, uint* plinelen) ++{ ++ uint off = *poff; ++ uint physlen = 0; ++ int is_first_line = 1; ++ ++ if (off >= len) ++ { ++ return 0; ++ } ++ ++ do ++ { ++ while (p[off] != '\n') ++ { ++ if (len-off <= 1) ++ { ++ return 0; ++ } ++ ++ physlen++; ++ off++; ++ } ++ ++ /* if we saw a crlf, physlen needs adjusted */ ++ if (physlen > 0 && p[off] == '\n' && p[off-1] == '\r') ++ { ++ physlen--; ++ } ++ ++ /* advance past the newline */ ++ off++; ++ ++ /* check for an empty line */ ++ if (physlen == 0) ++ { ++ break; ++ } ++ ++ /* check for colon on the first physical line */ ++ if (is_first_line) ++ { ++ is_first_line = 0; ++ if (memchr(p+(*poff), ':', physlen) == NULL) ++ { ++ return 0; ++ } ++ } ++ } ++ while (p[off] == ' ' || p[off] == '\t'); ++ ++ *plineoff = *poff; ++ *plinelen = (physlen == 0) ? 0 : (off - *poff); ++ *poff = off; ++ ++ return 1; ++} ++#endif /* NF_NEED_MIME_NEXTLINE */ ++ ++#endif /* __KERNEL__ */ ++ ++#endif /* _NETFILTER_MIME_H */ +--- /dev/null ++++ b/extensions/rtsp/nf_conntrack_rtsp.c +@@ -0,0 +1,519 @@ ++/* ++ * RTSP extension for IP connection tracking ++ * (C) 2003 by Tom Marshall ++ * based on ip_conntrack_irc.c ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version ++ * 2 of the License, or (at your option) any later version. ++ * ++ * Module load syntax: ++ * insmod nf_conntrack_rtsp.o ports=port1,port2,...port ++ * max_outstanding=n setup_timeout=secs ++ * ++ * If no ports are specified, the default will be port 554. ++ * ++ * With max_outstanding you can define the maximum number of not yet ++ * answered SETUP requests per RTSP session (default 8). ++ * With setup_timeout you can specify how long the system waits for ++ * an expected data channel (default 300 seconds). ++ * ++ * 2005-02-13: Harald Welte ++ * - port to 2.6 ++ * - update to recent post-2.6.11 api changes ++ * 2006-09-14: Steven Van Acker ++ * - removed calls to NAT code from conntrack helper: NAT no longer needed to use rtsp-conntrack ++ * 2007-04-18: Michael Guntsche ++ * - Port to new NF API ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include "nf_conntrack_rtsp.h" ++ ++#define NF_NEED_STRNCASECMP ++#define NF_NEED_STRTOU16 ++#define NF_NEED_STRTOU32 ++#define NF_NEED_NEXTLINE ++#include "netfilter_helpers.h" ++#define NF_NEED_MIME_NEXTLINE ++#include "netfilter_mime.h" ++ ++#include ++#define MAX_SIMUL_SETUP 8 /* XXX: use max_outstanding */ ++ ++#define MAX_PORTS 8 ++static int ports[MAX_PORTS]; ++static int num_ports = 0; ++static int max_outstanding = 8; ++static unsigned int setup_timeout = 300; ++ ++MODULE_AUTHOR("Tom Marshall "); ++MODULE_DESCRIPTION("RTSP connection tracking module"); ++MODULE_LICENSE("GPL"); ++module_param_array(ports, int, &num_ports, 0400); ++MODULE_PARM_DESC(ports, "port numbers of RTSP servers"); ++module_param(max_outstanding, int, 0400); ++MODULE_PARM_DESC(max_outstanding, "max number of outstanding SETUP requests per RTSP session"); ++module_param(setup_timeout, int, 0400); ++MODULE_PARM_DESC(setup_timeout, "timeout on for unestablished data channels"); ++ ++static char *rtsp_buffer; ++static DEFINE_SPINLOCK(rtsp_buffer_lock); ++ ++static struct nf_conntrack_expect_policy rtsp_exp_policy; ++ ++unsigned int (*nf_nat_rtsp_hook)(struct sk_buff *skb, ++ enum ip_conntrack_info ctinfo, ++ unsigned int matchoff, unsigned int matchlen,struct ip_ct_rtsp_expect* prtspexp, ++ struct nf_conntrack_expect *exp); ++void (*nf_nat_rtsp_hook_expectfn)(struct nf_conn *ct, struct nf_conntrack_expect *exp); ++ ++EXPORT_SYMBOL_GPL(nf_nat_rtsp_hook); ++ ++/* ++ * Max mappings we will allow for one RTSP connection (for RTP, the number ++ * of allocated ports is twice this value). Note that SMIL burns a lot of ++ * ports so keep this reasonably high. If this is too low, you will see a ++ * lot of "no free client map entries" messages. ++ */ ++#define MAX_PORT_MAPS 16 ++ ++/*** default port list was here in the masq code: 554, 3030, 4040 ***/ ++ ++#define SKIP_WSPACE(ptr,len,off) while(off < len && isspace(*(ptr+off))) { off++; } ++ ++/* ++ * Parse an RTSP packet. ++ * ++ * Returns zero if parsing failed. ++ * ++ * Parameters: ++ * IN ptcp tcp data pointer ++ * IN tcplen tcp data len ++ * IN/OUT ptcpoff points to current tcp offset ++ * OUT phdrsoff set to offset of rtsp headers ++ * OUT phdrslen set to length of rtsp headers ++ * OUT pcseqoff set to offset of CSeq header ++ * OUT pcseqlen set to length of CSeq header ++ */ ++static int ++rtsp_parse_message(char* ptcp, uint tcplen, uint* ptcpoff, ++ uint* phdrsoff, uint* phdrslen, ++ uint* pcseqoff, uint* pcseqlen, ++ uint* transoff, uint* translen) ++{ ++ uint entitylen = 0; ++ uint lineoff; ++ uint linelen; ++ ++ if (!nf_nextline(ptcp, tcplen, ptcpoff, &lineoff, &linelen)) ++ return 0; ++ ++ *phdrsoff = *ptcpoff; ++ while (nf_mime_nextline(ptcp, tcplen, ptcpoff, &lineoff, &linelen)) { ++ if (linelen == 0) { ++ if (entitylen > 0) ++ *ptcpoff += min(entitylen, tcplen - *ptcpoff); ++ break; ++ } ++ if (lineoff+linelen > tcplen) { ++ pr_info("!! overrun !!\n"); ++ break; ++ } ++ ++ if (nf_strncasecmp(ptcp+lineoff, "CSeq:", 5) == 0) { ++ *pcseqoff = lineoff; ++ *pcseqlen = linelen; ++ } ++ ++ if (nf_strncasecmp(ptcp+lineoff, "Transport:", 10) == 0) { ++ *transoff = lineoff; ++ *translen = linelen; ++ } ++ ++ if (nf_strncasecmp(ptcp+lineoff, "Content-Length:", 15) == 0) { ++ uint off = lineoff+15; ++ SKIP_WSPACE(ptcp+lineoff, linelen, off); ++ nf_strtou32(ptcp+off, &entitylen); ++ } ++ } ++ *phdrslen = (*ptcpoff) - (*phdrsoff); ++ ++ return 1; ++} ++ ++/* ++ * Find lo/hi client ports (if any) in transport header ++ * In: ++ * ptcp, tcplen = packet ++ * tranoff, tranlen = buffer to search ++ * ++ * Out: ++ * pport_lo, pport_hi = lo/hi ports (host endian) ++ * ++ * Returns nonzero if any client ports found ++ * ++ * Note: it is valid (and expected) for the client to request multiple ++ * transports, so we need to parse the entire line. ++ */ ++static int ++rtsp_parse_transport(char* ptran, uint tranlen, ++ struct ip_ct_rtsp_expect* prtspexp) ++{ ++ int rc = 0; ++ uint off = 0; ++ ++ if (tranlen < 10 || !iseol(ptran[tranlen-1]) || ++ nf_strncasecmp(ptran, "Transport:", 10) != 0) { ++ pr_info("sanity check failed\n"); ++ return 0; ++ } ++ ++ pr_debug("tran='%.*s'\n", (int)tranlen, ptran); ++ off += 10; ++ SKIP_WSPACE(ptran, tranlen, off); ++ ++ /* Transport: tran;field;field=val,tran;field;field=val,... */ ++ while (off < tranlen) { ++ const char* pparamend; ++ uint nextparamoff; ++ ++ pparamend = memchr(ptran+off, ',', tranlen-off); ++ pparamend = (pparamend == NULL) ? ptran+tranlen : pparamend+1; ++ nextparamoff = pparamend-ptran; ++ ++ while (off < nextparamoff) { ++ const char* pfieldend; ++ uint nextfieldoff; ++ ++ pfieldend = memchr(ptran+off, ';', nextparamoff-off); ++ nextfieldoff = (pfieldend == NULL) ? nextparamoff : pfieldend-ptran+1; ++ ++ if (strncmp(ptran+off, "client_port=", 12) == 0) { ++ u_int16_t port; ++ uint numlen; ++ ++ off += 12; ++ numlen = nf_strtou16(ptran+off, &port); ++ off += numlen; ++ if (prtspexp->loport != 0 && prtspexp->loport != port) ++ pr_debug("multiple ports found, port %hu ignored\n", port); ++ else { ++ pr_debug("lo port found : %hu\n", port); ++ prtspexp->loport = prtspexp->hiport = port; ++ if (ptran[off] == '-') { ++ off++; ++ numlen = nf_strtou16(ptran+off, &port); ++ off += numlen; ++ prtspexp->pbtype = pb_range; ++ prtspexp->hiport = port; ++ ++ // If we have a range, assume rtp: ++ // loport must be even, hiport must be loport+1 ++ if ((prtspexp->loport & 0x0001) != 0 || ++ prtspexp->hiport != prtspexp->loport+1) { ++ pr_debug("incorrect range: %hu-%hu, correcting\n", ++ prtspexp->loport, prtspexp->hiport); ++ prtspexp->loport &= 0xfffe; ++ prtspexp->hiport = prtspexp->loport+1; ++ } ++ } else if (ptran[off] == '/') { ++ off++; ++ numlen = nf_strtou16(ptran+off, &port); ++ off += numlen; ++ prtspexp->pbtype = pb_discon; ++ prtspexp->hiport = port; ++ } ++ rc = 1; ++ } ++ } ++ ++ /* ++ * Note we don't look for the destination parameter here. ++ * If we are using NAT, the NAT module will handle it. If not, ++ * and the client is sending packets elsewhere, the expectation ++ * will quietly time out. ++ */ ++ ++ off = nextfieldoff; ++ } ++ ++ off = nextparamoff; ++ } ++ ++ return rc; ++} ++ ++void expected(struct nf_conn *ct, struct nf_conntrack_expect *exp) ++{ ++ typeof(nf_nat_rtsp_hook_expectfn) nf_nat_rtsp_expectfn; ++ nf_nat_rtsp_expectfn = rcu_dereference(nf_nat_rtsp_hook_expectfn); ++ if(nf_nat_rtsp_expectfn && ct->master->status & IPS_NAT_MASK) { ++ nf_nat_rtsp_expectfn(ct,exp); ++ } ++} ++ ++/*** conntrack functions ***/ ++ ++/* outbound packet: client->server */ ++ ++static inline int ++help_out(struct sk_buff *skb, unsigned char *rb_ptr, unsigned int datalen, ++ struct nf_conn *ct, enum ip_conntrack_info ctinfo) ++{ ++ struct ip_ct_rtsp_expect expinfo; ++ ++ int dir = CTINFO2DIR(ctinfo); /* = IP_CT_DIR_ORIGINAL */ ++ //struct tcphdr* tcph = (void*)iph + iph->ihl * 4; ++ //uint tcplen = pktlen - iph->ihl * 4; ++ char* pdata = rb_ptr; ++ //uint datalen = tcplen - tcph->doff * 4; ++ uint dataoff = 0; ++ int ret = NF_ACCEPT; ++ ++ struct nf_conntrack_expect *exp; ++ ++ __be16 be_loport; ++ ++ typeof(nf_nat_rtsp_hook) nf_nat_rtsp; ++ ++ memset(&expinfo, 0, sizeof(expinfo)); ++ ++ while (dataoff < datalen) { ++ uint cmdoff = dataoff; ++ uint hdrsoff = 0; ++ uint hdrslen = 0; ++ uint cseqoff = 0; ++ uint cseqlen = 0; ++ uint transoff = 0; ++ uint translen = 0; ++ uint off; ++ ++ if (!rtsp_parse_message(pdata, datalen, &dataoff, ++ &hdrsoff, &hdrslen, ++ &cseqoff, &cseqlen, ++ &transoff, &translen)) ++ break; /* not a valid message */ ++ ++ if (strncmp(pdata+cmdoff, "SETUP ", 6) != 0) ++ continue; /* not a SETUP message */ ++ pr_debug("found a setup message\n"); ++ ++ off = 0; ++ if(translen) { ++ rtsp_parse_transport(pdata+transoff, translen, &expinfo); ++ } ++ ++ if (expinfo.loport == 0) { ++ pr_debug("no udp transports found\n"); ++ continue; /* no udp transports found */ ++ } ++ ++ pr_debug("udp transport found, ports=(%d,%hu,%hu)\n", ++ (int)expinfo.pbtype, expinfo.loport, expinfo.hiport); ++ ++ exp = nf_ct_expect_alloc(ct); ++ if (!exp) { ++ ret = NF_DROP; ++ goto out; ++ } ++ ++ be_loport = htons(expinfo.loport); ++ ++ nf_ct_expect_init(exp, NF_CT_EXPECT_CLASS_DEFAULT, nf_ct_l3num(ct), ++ &ct->tuplehash[!dir].tuple.src.u3, &ct->tuplehash[!dir].tuple.dst.u3, ++ IPPROTO_UDP, NULL, &be_loport); ++ ++ exp->master = ct; ++ ++ exp->expectfn = expected; ++ exp->flags = 0; ++ ++ if (expinfo.pbtype == pb_range) { ++ pr_debug("Changing expectation mask to handle multiple ports\n"); ++ //exp->mask.dst.u.udp.port = 0xfffe; ++ } ++ ++ pr_debug("expect_related %pI4:%u-%pI4:%u\n", ++ &exp->tuple.src.u3.ip, ++ ntohs(exp->tuple.src.u.udp.port), ++ &exp->tuple.dst.u3.ip, ++ ntohs(exp->tuple.dst.u.udp.port)); ++ ++ nf_nat_rtsp = rcu_dereference(nf_nat_rtsp_hook); ++ if (nf_nat_rtsp && ct->status & IPS_NAT_MASK) ++ /* pass the request off to the nat helper */ ++ ret = nf_nat_rtsp(skb, ctinfo, hdrsoff, hdrslen, &expinfo, exp); ++ else if (nf_ct_expect_related(exp) != 0) { ++ pr_info("nf_conntrack_expect_related failed\n"); ++ ret = NF_DROP; ++ } ++ nf_ct_expect_put(exp); ++ goto out; ++ } ++out: ++ ++ return ret; ++} ++ ++ ++static inline int ++help_in(struct sk_buff *skb, size_t pktlen, ++ struct nf_conn* ct, enum ip_conntrack_info ctinfo) ++{ ++ return NF_ACCEPT; ++} ++ ++static int help(struct sk_buff *skb, unsigned int protoff, ++ struct nf_conn *ct, enum ip_conntrack_info ctinfo) ++{ ++ struct tcphdr _tcph, *th; ++ unsigned int dataoff, datalen; ++ char *rb_ptr; ++ int ret = NF_DROP; ++ ++ /* Until there's been traffic both ways, don't look in packets. */ ++ if (ctinfo != IP_CT_ESTABLISHED && ++ ctinfo != IP_CT_ESTABLISHED + IP_CT_IS_REPLY) { ++ pr_debug("conntrackinfo = %u\n", ctinfo); ++ return NF_ACCEPT; ++ } ++ ++ /* Not whole TCP header? */ ++ th = skb_header_pointer(skb,protoff, sizeof(_tcph), &_tcph); ++ ++ if (!th) ++ return NF_ACCEPT; ++ ++ /* No data ? */ ++ dataoff = protoff + th->doff*4; ++ datalen = skb->len - dataoff; ++ if (dataoff >= skb->len) ++ return NF_ACCEPT; ++ ++ spin_lock_bh(&rtsp_buffer_lock); ++ rb_ptr = skb_header_pointer(skb, dataoff, ++ skb->len - dataoff, rtsp_buffer); ++ BUG_ON(rb_ptr == NULL); ++ ++#if 0 ++ /* Checksum invalid? Ignore. */ ++ /* FIXME: Source route IP option packets --RR */ ++ if (tcp_v4_check(tcph, tcplen, iph->saddr, iph->daddr, ++ csum_partial((char*)tcph, tcplen, 0))) ++ { ++ DEBUGP("bad csum: %p %u %u.%u.%u.%u %u.%u.%u.%u\n", ++ tcph, tcplen, NIPQUAD(iph->saddr), NIPQUAD(iph->daddr)); ++ return NF_ACCEPT; ++ } ++#endif ++ ++ switch (CTINFO2DIR(ctinfo)) { ++ case IP_CT_DIR_ORIGINAL: ++ ret = help_out(skb, rb_ptr, datalen, ct, ctinfo); ++ break; ++ case IP_CT_DIR_REPLY: ++ pr_debug("IP_CT_DIR_REPLY\n"); ++ /* inbound packet: server->client */ ++ ret = NF_ACCEPT; ++ break; ++ } ++ ++ spin_unlock_bh(&rtsp_buffer_lock); ++ ++ return ret; ++} ++ ++static struct nf_conntrack_helper rtsp_helpers[MAX_PORTS]; ++static char rtsp_names[MAX_PORTS][10]; ++ ++/* This function is intentionally _NOT_ defined as __exit */ ++static void ++fini(void) ++{ ++ int i; ++ for (i = 0; i < num_ports; i++) { ++ pr_debug("unregistering port %d\n", ports[i]); ++ nf_conntrack_helper_unregister(&rtsp_helpers[i]); ++ } ++ kfree(rtsp_buffer); ++} ++ ++static int __init ++init(void) ++{ ++ int i, ret; ++ struct nf_conntrack_helper *hlpr; ++ char *tmpname; ++ ++ printk("nf_conntrack_rtsp v" IP_NF_RTSP_VERSION " loading\n"); ++ ++ if (max_outstanding < 1) { ++ printk("nf_conntrack_rtsp: max_outstanding must be a positive integer\n"); ++ return -EBUSY; ++ } ++ if (setup_timeout < 0) { ++ printk("nf_conntrack_rtsp: setup_timeout must be a positive integer\n"); ++ return -EBUSY; ++ } ++ ++ rtsp_exp_policy.max_expected = max_outstanding; ++ rtsp_exp_policy.timeout = setup_timeout; ++ ++ rtsp_buffer = kmalloc(65536, GFP_KERNEL); ++ if (!rtsp_buffer) ++ return -ENOMEM; ++ ++ /* If no port given, default to standard rtsp port */ ++ if (ports[0] == 0) { ++ ports[0] = RTSP_PORT; ++ } ++ ++ for (i = 0; (i < MAX_PORTS) && ports[i]; i++) { ++ hlpr = &rtsp_helpers[i]; ++ memset(hlpr, 0, sizeof(struct nf_conntrack_helper)); ++ hlpr->tuple.src.l3num = AF_INET; ++ hlpr->tuple.src.u.tcp.port = htons(ports[i]); ++ hlpr->tuple.dst.protonum = IPPROTO_TCP; ++ //hlpr->mask.src.u.tcp.port = 0xFFFF; ++ //hlpr->mask.dst.protonum = 0xFF; ++ hlpr->expect_policy = &rtsp_exp_policy; ++ hlpr->me = THIS_MODULE; ++ hlpr->help = help; ++ ++ tmpname = &rtsp_names[i][0]; ++ if (ports[i] == RTSP_PORT) { ++ sprintf(tmpname, "rtsp"); ++ } else { ++ sprintf(tmpname, "rtsp-%d", i); ++ } ++ hlpr->name = tmpname; ++ ++ pr_debug("port #%d: %d\n", i, ports[i]); ++ ++ ret = nf_conntrack_helper_register(hlpr); ++ ++ if (ret) { ++ printk("nf_conntrack_rtsp: ERROR registering port %d\n", ports[i]); ++ fini(); ++ return -EBUSY; ++ } ++ num_ports++; ++ } ++ return 0; ++} ++ ++module_init(init); ++module_exit(fini); ++ ++EXPORT_SYMBOL(nf_nat_rtsp_hook_expectfn); ++ +--- /dev/null ++++ b/extensions/rtsp/nf_conntrack_rtsp.h +@@ -0,0 +1,63 @@ ++/* ++ * RTSP extension for IP connection tracking. ++ * (C) 2003 by Tom Marshall ++ * based on ip_conntrack_irc.h ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version ++ * 2 of the License, or (at your option) any later version. ++ */ ++#ifndef _IP_CONNTRACK_RTSP_H ++#define _IP_CONNTRACK_RTSP_H ++ ++//#define IP_NF_RTSP_DEBUG 1 ++#define IP_NF_RTSP_VERSION "0.6.21" ++ ++#ifdef __KERNEL__ ++/* port block types */ ++typedef enum { ++ pb_single, /* client_port=x */ ++ pb_range, /* client_port=x-y */ ++ pb_discon /* client_port=x/y (rtspbis) */ ++} portblock_t; ++ ++/* We record seq number and length of rtsp headers here, all in host order. */ ++ ++/* ++ * This structure is per expected connection. It is a member of struct ++ * ip_conntrack_expect. The TCP SEQ for the conntrack expect is stored ++ * there and we are expected to only store the length of the data which ++ * needs replaced. If a packet contains multiple RTSP messages, we create ++ * one expected connection per message. ++ * ++ * We use these variables to mark the entire header block. This may seem ++ * like overkill, but the nature of RTSP requires it. A header may appear ++ * multiple times in a message. We must treat two Transport headers the ++ * same as one Transport header with two entries. ++ */ ++struct ip_ct_rtsp_expect ++{ ++ u_int32_t len; /* length of header block */ ++ portblock_t pbtype; /* Type of port block that was requested */ ++ u_int16_t loport; /* Port that was requested, low or first */ ++ u_int16_t hiport; /* Port that was requested, high or second */ ++#if 0 ++ uint method; /* RTSP method */ ++ uint cseq; /* CSeq from request */ ++#endif ++}; ++ ++extern unsigned int (*nf_nat_rtsp_hook)(struct sk_buff *skb, ++ enum ip_conntrack_info ctinfo, ++ unsigned int matchoff, unsigned int matchlen, ++ struct ip_ct_rtsp_expect *prtspexp, ++ struct nf_conntrack_expect *exp); ++ ++extern void (*nf_nat_rtsp_hook_expectfn)(struct nf_conn *ct, struct nf_conntrack_expect *exp); ++ ++#define RTSP_PORT 554 ++ ++#endif /* __KERNEL__ */ ++ ++#endif /* _IP_CONNTRACK_RTSP_H */ +--- /dev/null ++++ b/extensions/rtsp/nf_nat_rtsp.c +@@ -0,0 +1,491 @@ ++/* ++ * RTSP extension for TCP NAT alteration ++ * (C) 2003 by Tom Marshall ++ * based on ip_nat_irc.c ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version ++ * 2 of the License, or (at your option) any later version. ++ * ++ * Module load syntax: ++ * insmod nf_nat_rtsp.o ports=port1,port2,...port ++ * stunaddr=
    ++ * destaction=[auto|strip|none] ++ * ++ * If no ports are specified, the default will be port 554 only. ++ * ++ * stunaddr specifies the address used to detect that a client is using STUN. ++ * If this address is seen in the destination parameter, it is assumed that ++ * the client has already punched a UDP hole in the firewall, so we don't ++ * mangle the client_port. If none is specified, it is autodetected. It ++ * only needs to be set if you have multiple levels of NAT. It should be ++ * set to the external address that the STUN clients detect. Note that in ++ * this case, it will not be possible for clients to use UDP with servers ++ * between the NATs. ++ * ++ * If no destaction is specified, auto is used. ++ * destaction=auto: strip destination parameter if it is not stunaddr. ++ * destaction=strip: always strip destination parameter (not recommended). ++ * destaction=none: do not touch destination parameter (not recommended). ++ */ ++ ++#include ++#include ++#include ++#include ++#include "nf_conntrack_rtsp.h" ++#include ++ ++#include ++#include ++#define NF_NEED_STRNCASECMP ++#define NF_NEED_STRTOU16 ++#include "netfilter_helpers.h" ++#define NF_NEED_MIME_NEXTLINE ++#include "netfilter_mime.h" ++ ++#include "../compat_xtables.h" ++ ++#define MAX_PORTS 8 ++#define DSTACT_AUTO 0 ++#define DSTACT_STRIP 1 ++#define DSTACT_NONE 2 ++ ++static char* stunaddr = NULL; ++static char* destaction = NULL; ++ ++static u_int32_t extip = 0; ++static int dstact = 0; ++ ++MODULE_AUTHOR("Tom Marshall "); ++MODULE_DESCRIPTION("RTSP network address translation module"); ++MODULE_LICENSE("GPL"); ++module_param(stunaddr, charp, 0644); ++MODULE_PARM_DESC(stunaddr, "Address for detecting STUN"); ++module_param(destaction, charp, 0644); ++MODULE_PARM_DESC(destaction, "Action for destination parameter (auto/strip/none)"); ++ ++#define SKIP_WSPACE(ptr,len,off) while(off < len && isspace(*(ptr+off))) { off++; } ++ ++/*** helper functions ***/ ++ ++static void ++get_skb_tcpdata(struct sk_buff* skb, char** pptcpdata, uint* ptcpdatalen) ++{ ++ struct iphdr* iph = ip_hdr(skb); ++ struct tcphdr* tcph = (void *)iph + ip_hdrlen(skb); ++ ++ *pptcpdata = (char*)tcph + tcph->doff*4; ++ *ptcpdatalen = ((char*)skb_transport_header(skb) + skb->len) - *pptcpdata; ++} ++ ++/*** nat functions ***/ ++ ++/* ++ * Mangle the "Transport:" header: ++ * - Replace all occurences of "client_port=" ++ * - Handle destination parameter ++ * ++ * In: ++ * ct, ctinfo = conntrack context ++ * skb = packet ++ * tranoff = Transport header offset from TCP data ++ * tranlen = Transport header length (incl. CRLF) ++ * rport_lo = replacement low port (host endian) ++ * rport_hi = replacement high port (host endian) ++ * ++ * Returns packet size difference. ++ * ++ * Assumes that a complete transport header is present, ending with CR or LF ++ */ ++static int ++rtsp_mangle_tran(enum ip_conntrack_info ctinfo, ++ struct nf_conntrack_expect* exp, ++ struct ip_ct_rtsp_expect* prtspexp, ++ struct sk_buff* skb, uint tranoff, uint tranlen) ++{ ++ char* ptcp; ++ uint tcplen; ++ char* ptran; ++ char rbuf1[16]; /* Replacement buffer (one port) */ ++ uint rbuf1len; /* Replacement len (one port) */ ++ char rbufa[16]; /* Replacement buffer (all ports) */ ++ uint rbufalen; /* Replacement len (all ports) */ ++ u_int32_t newip; ++ u_int16_t loport, hiport; ++ uint off = 0; ++ uint diff; /* Number of bytes we removed */ ++ ++ struct nf_conn *ct = exp->master; ++ struct nf_conntrack_tuple *t; ++ ++ char szextaddr[15+1]; ++ uint extaddrlen; ++ int is_stun; ++ ++ get_skb_tcpdata(skb, &ptcp, &tcplen); ++ ptran = ptcp+tranoff; ++ ++ if (tranoff+tranlen > tcplen || tcplen-tranoff < tranlen || ++ tranlen < 10 || !iseol(ptran[tranlen-1]) || ++ nf_strncasecmp(ptran, "Transport:", 10) != 0) ++ { ++ pr_info("sanity check failed\n"); ++ return 0; ++ } ++ off += 10; ++ SKIP_WSPACE(ptcp+tranoff, tranlen, off); ++ ++ newip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip; ++ t = &exp->tuple; ++ t->dst.u3.ip = newip; ++ ++ extaddrlen = extip ? sprintf(szextaddr, "%pI4", &extip) ++ : sprintf(szextaddr, "%pI4", &newip); ++ pr_debug("stunaddr=%s (%s)\n", szextaddr, (extip?"forced":"auto")); ++ ++ rbuf1len = rbufalen = 0; ++ switch (prtspexp->pbtype) ++ { ++ case pb_single: ++ for (loport = prtspexp->loport; loport != 0; loport++) /* XXX: improper wrap? */ ++ { ++ t->dst.u.udp.port = htons(loport); ++ if (nf_ct_expect_related(exp) == 0) ++ { ++ pr_debug("using port %hu\n", loport); ++ break; ++ } ++ } ++ if (loport != 0) ++ { ++ rbuf1len = sprintf(rbuf1, "%hu", loport); ++ rbufalen = sprintf(rbufa, "%hu", loport); ++ } ++ break; ++ case pb_range: ++ for (loport = prtspexp->loport; loport != 0; loport += 2) /* XXX: improper wrap? */ ++ { ++ t->dst.u.udp.port = htons(loport); ++ if (nf_ct_expect_related(exp) == 0) ++ { ++ hiport = loport + 1; //~exp->mask.dst.u.udp.port; ++ pr_debug("using ports %hu-%hu\n", loport, hiport); ++ break; ++ } ++ } ++ if (loport != 0) ++ { ++ rbuf1len = sprintf(rbuf1, "%hu", loport); ++ rbufalen = sprintf(rbufa, "%hu-%hu", loport, loport+1); ++ } ++ break; ++ case pb_discon: ++ for (loport = prtspexp->loport; loport != 0; loport++) /* XXX: improper wrap? */ ++ { ++ t->dst.u.udp.port = htons(loport); ++ if (nf_ct_expect_related(exp) == 0) ++ { ++ pr_debug("using port %hu (1 of 2)\n", loport); ++ break; ++ } ++ } ++ for (hiport = prtspexp->hiport; hiport != 0; hiport++) /* XXX: improper wrap? */ ++ { ++ t->dst.u.udp.port = htons(hiport); ++ if (nf_ct_expect_related(exp) == 0) ++ { ++ pr_debug("using port %hu (2 of 2)\n", hiport); ++ break; ++ } ++ } ++ if (loport != 0 && hiport != 0) ++ { ++ rbuf1len = sprintf(rbuf1, "%hu", loport); ++ if (hiport == loport+1) ++ { ++ rbufalen = sprintf(rbufa, "%hu-%hu", loport, hiport); ++ } ++ else ++ { ++ rbufalen = sprintf(rbufa, "%hu/%hu", loport, hiport); ++ } ++ } ++ break; ++ } ++ ++ if (rbuf1len == 0) ++ { ++ return 0; /* cannot get replacement port(s) */ ++ } ++ ++ /* Transport: tran;field;field=val,tran;field;field=val,... */ ++ while (off < tranlen) ++ { ++ uint saveoff; ++ const char* pparamend; ++ uint nextparamoff; ++ ++ pparamend = memchr(ptran+off, ',', tranlen-off); ++ pparamend = (pparamend == NULL) ? ptran+tranlen : pparamend+1; ++ nextparamoff = pparamend-ptcp; ++ ++ /* ++ * We pass over each param twice. On the first pass, we look for a ++ * destination= field. It is handled by the security policy. If it ++ * is present, allowed, and equal to our external address, we assume ++ * that STUN is being used and we leave the client_port= field alone. ++ */ ++ is_stun = 0; ++ saveoff = off; ++ while (off < nextparamoff) ++ { ++ const char* pfieldend; ++ uint nextfieldoff; ++ ++ pfieldend = memchr(ptran+off, ';', nextparamoff-off); ++ nextfieldoff = (pfieldend == NULL) ? nextparamoff : pfieldend-ptran+1; ++ ++ if (dstact != DSTACT_NONE && strncmp(ptran+off, "destination=", 12) == 0) ++ { ++ if (strncmp(ptran+off+12, szextaddr, extaddrlen) == 0) ++ { ++ is_stun = 1; ++ } ++ if (dstact == DSTACT_STRIP || (dstact == DSTACT_AUTO && !is_stun)) ++ { ++ diff = nextfieldoff-off; ++ if (!nf_nat_mangle_tcp_packet(skb, ct, ctinfo, ++ off, diff, NULL, 0)) ++ { ++ /* mangle failed, all we can do is bail */ ++ nf_ct_unexpect_related(exp); ++ return 0; ++ } ++ get_skb_tcpdata(skb, &ptcp, &tcplen); ++ ptran = ptcp+tranoff; ++ tranlen -= diff; ++ nextparamoff -= diff; ++ nextfieldoff -= diff; ++ } ++ } ++ ++ off = nextfieldoff; ++ } ++ if (is_stun) ++ { ++ continue; ++ } ++ off = saveoff; ++ while (off < nextparamoff) ++ { ++ const char* pfieldend; ++ uint nextfieldoff; ++ ++ pfieldend = memchr(ptran+off, ';', nextparamoff-off); ++ nextfieldoff = (pfieldend == NULL) ? nextparamoff : pfieldend-ptran+1; ++ ++ if (strncmp(ptran+off, "client_port=", 12) == 0) ++ { ++ u_int16_t port; ++ uint numlen; ++ uint origoff; ++ uint origlen; ++ char* rbuf = rbuf1; ++ uint rbuflen = rbuf1len; ++ ++ off += 12; ++ origoff = (ptran-ptcp)+off; ++ origlen = 0; ++ numlen = nf_strtou16(ptran+off, &port); ++ off += numlen; ++ origlen += numlen; ++ if (port != prtspexp->loport) ++ { ++ pr_debug("multiple ports found, port %hu ignored\n", port); ++ } ++ else ++ { ++ if (ptran[off] == '-' || ptran[off] == '/') ++ { ++ off++; ++ origlen++; ++ numlen = nf_strtou16(ptran+off, &port); ++ off += numlen; ++ origlen += numlen; ++ rbuf = rbufa; ++ rbuflen = rbufalen; ++ } ++ ++ /* ++ * note we cannot just memcpy() if the sizes are the same. ++ * the mangle function does skb resizing, checks for a ++ * cloned skb, and updates the checksums. ++ * ++ * parameter 4 below is offset from start of tcp data. ++ */ ++ diff = origlen-rbuflen; ++ if (!nf_nat_mangle_tcp_packet(skb, ct, ctinfo, ++ origoff, origlen, rbuf, rbuflen)) ++ { ++ /* mangle failed, all we can do is bail */ ++ nf_ct_unexpect_related(exp); ++ return 0; ++ } ++ get_skb_tcpdata(skb, &ptcp, &tcplen); ++ ptran = ptcp+tranoff; ++ tranlen -= diff; ++ nextparamoff -= diff; ++ nextfieldoff -= diff; ++ } ++ } ++ ++ off = nextfieldoff; ++ } ++ ++ off = nextparamoff; ++ } ++ ++ return 1; ++} ++ ++static uint ++help_out(struct sk_buff *skb, enum ip_conntrack_info ctinfo, ++ unsigned int matchoff, unsigned int matchlen, struct ip_ct_rtsp_expect* prtspexp, ++ struct nf_conntrack_expect* exp) ++{ ++ char* ptcp; ++ uint tcplen; ++ uint hdrsoff; ++ uint hdrslen; ++ uint lineoff; ++ uint linelen; ++ uint off; ++ ++ //struct iphdr* iph = (struct iphdr*)(*pskb)->nh.iph; ++ //struct tcphdr* tcph = (struct tcphdr*)((void*)iph + iph->ihl*4); ++ ++ get_skb_tcpdata(skb, &ptcp, &tcplen); ++ hdrsoff = matchoff;//exp->seq - ntohl(tcph->seq); ++ hdrslen = matchlen; ++ off = hdrsoff; ++ pr_debug("NAT rtsp help_out\n"); ++ ++ while (nf_mime_nextline(ptcp, hdrsoff+hdrslen, &off, &lineoff, &linelen)) ++ { ++ if (linelen == 0) ++ { ++ break; ++ } ++ if (off > hdrsoff+hdrslen) ++ { ++ pr_info("!! overrun !!"); ++ break; ++ } ++ pr_debug("hdr: len=%u, %.*s", linelen, (int)linelen, ptcp+lineoff); ++ ++ if (nf_strncasecmp(ptcp+lineoff, "Transport:", 10) == 0) ++ { ++ uint oldtcplen = tcplen; ++ pr_debug("hdr: Transport\n"); ++ if (!rtsp_mangle_tran(ctinfo, exp, prtspexp, skb, lineoff, linelen)) ++ { ++ pr_debug("hdr: Transport mangle failed"); ++ break; ++ } ++ get_skb_tcpdata(skb, &ptcp, &tcplen); ++ hdrslen -= (oldtcplen-tcplen); ++ off -= (oldtcplen-tcplen); ++ lineoff -= (oldtcplen-tcplen); ++ linelen -= (oldtcplen-tcplen); ++ pr_debug("rep: len=%u, %.*s", linelen, (int)linelen, ptcp+lineoff); ++ } ++ } ++ ++ return NF_ACCEPT; ++} ++ ++static unsigned int ++help(struct sk_buff *skb, enum ip_conntrack_info ctinfo, ++ unsigned int matchoff, unsigned int matchlen, struct ip_ct_rtsp_expect* prtspexp, ++ struct nf_conntrack_expect* exp) ++{ ++ int dir = CTINFO2DIR(ctinfo); ++ int rc = NF_ACCEPT; ++ ++ switch (dir) ++ { ++ case IP_CT_DIR_ORIGINAL: ++ rc = help_out(skb, ctinfo, matchoff, matchlen, prtspexp, exp); ++ break; ++ case IP_CT_DIR_REPLY: ++ pr_debug("unmangle ! %u\n", ctinfo); ++ /* XXX: unmangle */ ++ rc = NF_ACCEPT; ++ break; ++ } ++ //UNLOCK_BH(&ip_rtsp_lock); ++ ++ return rc; ++} ++ ++static void expected(struct nf_conn* ct, struct nf_conntrack_expect *exp) ++{ ++ struct nf_nat_ipv4_multi_range_compat mr; ++ u_int32_t newdstip, newsrcip, newip; ++ ++ struct nf_conn *master = ct->master; ++ ++ newdstip = master->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip; ++ newsrcip = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip; ++ //FIXME (how to port that ?) ++ //code from 2.4 : newip = (HOOK2MANIP(hooknum) == NF_NAT_MANIP_SRC) ? newsrcip : newdstip; ++ newip = newdstip; ++ ++ pr_debug("newsrcip=%pI4, newdstip=%pI4, newip=%pI4\n", ++ &newsrcip, &newdstip, &newip); ++ ++ mr.rangesize = 1; ++ // We don't want to manip the per-protocol, just the IPs. ++ mr.range[0].flags = NF_NAT_RANGE_MAP_IPS; ++ mr.range[0].min_ip = mr.range[0].max_ip = newip; ++ ++ nf_nat_setup_info(ct, &mr.range[0], NF_NAT_MANIP_DST); ++} ++ ++ ++static void __exit fini(void) ++{ ++ nf_nat_rtsp_hook = NULL; ++ nf_nat_rtsp_hook_expectfn = NULL; ++ synchronize_net(); ++} ++ ++static int __init init(void) ++{ ++ printk("nf_nat_rtsp v" IP_NF_RTSP_VERSION " loading\n"); ++ ++ BUG_ON(nf_nat_rtsp_hook); ++ nf_nat_rtsp_hook = help; ++ nf_nat_rtsp_hook_expectfn = &expected; ++ ++ if (stunaddr != NULL) ++ extip = in_aton(stunaddr); ++ ++ if (destaction != NULL) { ++ if (strcmp(destaction, "auto") == 0) ++ dstact = DSTACT_AUTO; ++ ++ if (strcmp(destaction, "strip") == 0) ++ dstact = DSTACT_STRIP; ++ ++ if (strcmp(destaction, "none") == 0) ++ dstact = DSTACT_NONE; ++ } ++ ++ return 0; ++} ++ ++module_init(init); ++module_exit(fini); +--- a/extensions/Kbuild ++++ b/extensions/Kbuild +@@ -33,6 +33,7 @@ obj-${build_lscan} += xt_lscan.o + obj-${build_pknock} += pknock/ + obj-${build_psd} += xt_psd.o + obj-${build_quota2} += xt_quota2.o ++obj-${build_rtsp} += rtsp/ + + -include ${M}/*.Kbuild + -include ${M}/Kbuild.* +--- a/mconfig ++++ b/mconfig +@@ -26,3 +26,4 @@ build_lscan=m + build_pknock=m + build_psd=m + build_quota2=m ++build_rtsp=m diff --git a/net/xtables-addons/patches/200-add-lua-packetscript.patch b/net/xtables-addons/patches/200-add-lua-packetscript.patch new file mode 100644 index 0000000..03fe5fa --- /dev/null +++ b/net/xtables-addons/patches/200-add-lua-packetscript.patch @@ -0,0 +1,18230 @@ +--- /dev/null ++++ b/extensions/LUA/byte_array.c +@@ -0,0 +1,145 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++#include "controller.h" ++ ++/* Initialization helper function. This function should be used whenever ++ * a new byte array need to be initialized. Depending on the arguments it ++ * initializes the array in a different way. Have a look at the inline ++ * comments */ ++lua_packet_segment * init_byte_array(lua_State *L, unsigned char * start, int length, int do_copy) ++{ ++ lua_packet_segment *array; ++ ++ if (length < 0) ++ luaL_error(L, "init_byte_array, requested size < 0"); ++ ++ if (start && do_copy) { ++ /* we have a start address where we copy from */ ++ array = lua_newuserdata(L, sizeof(lua_packet_segment) + length); ++ array->start = (unsigned char *)array + sizeof(lua_packet_segment); /* aligning pointer */ ++ memcpy(array->start, start, length); ++ }else if (start && !do_copy) { ++ /* just link the start pointer, in this case you have to free the memory yourself */ ++ array = lua_newuserdata(L, sizeof(lua_packet_segment)); ++ array->start = start; ++ }else{ ++ /* create an empty array, fully managed by Lua */ ++ array = lua_newuserdata(L, sizeof(lua_packet_segment) + length); ++ array->start = (unsigned char *)array + sizeof(lua_packet_segment); /* aligning pointer */ ++ memset(array->start, 0, length); ++ } ++ ++ array->length = length; ++ array->offset = 0; ++ array->changes = NULL; ++ ++ luaL_getmetatable(L, LUA_BYTE_ARRAY); ++ lua_setmetatable(L, -2); ++ ++ return array; ++} ++ ++ ++ ++/* LUA_API: get one byte of the given byte array ++ * access-pattern: array[] */ ++static int32_t get_byte_array(lua_State *L) ++{ ++ lua_packet_segment * array = checkbytearray(L, 1); ++ int32_t index = luaL_checkinteger(L, 2); /* array starts with index 0 (not 1 as usual in Lua) */ ++ ++ luaL_argcheck(L, 0 <= index && index < array->length, 1, "index out of range"); ++ lua_pushinteger(L, (array->start + array->offset)[index]); ++ ++ return 1; ++} ++ ++/* LUA_API: set one byte of the given byte array ++ * access-pattern: array[]= 0xFF */ ++static int32_t set_byte_array(lua_State *L) ++{ ++ lua_packet_segment * array = checkbytearray(L, 1); ++ uint8_t byte; ++ int32_t index = luaL_checkinteger(L, 2); /* array starts with index 0 (not 1 as usual in Lua) */ ++ int32_t val = luaL_checkinteger(L, 3); ++ uint32_t nob = 1 << CHAR_BIT; /* we should use something like 1 << CHAR_BIT */ ++ ++ luaL_argcheck(L, 0 <= index && index < array->length, 1, "index out of range"); ++ luaL_argcheck(L, 0 <= val && val < nob, 2, "cannot cast value to char"); ++ ++ byte = (uint8_t)val; ++ ++ (array->start + array->offset)[index] = byte; ++ ++ return 0; ++} ++ ++/* LUA_API: get size of the given byte array ++ * access-pattern: #array (__length meta-method) */ ++static int32_t get_byte_array_size(lua_State *L) ++{ ++ lua_packet_segment * array = checkbytearray(L, 1); ++ ++ lua_pushnumber(L, array->length); ++ ++ return 1; ++} ++ ++ ++/* LUA_API: converts a given byte array to a string. ++ * access-pattern: implicit through functions calling the ++ * __to_string() metamethod , e.g. print32_t */ ++static int32_t byte_array_to_string(lua_State *L) ++{ ++ lua_packet_segment * array = checkbytearray(L, 1); ++ uint8_t buf[(array->length * 3) + 255]; ++ uint8_t hexval[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; ++ char res[255 + (array->length * 3)]; /* make sure the buffer is big enough*/ ++ int32_t i, n; ++ uint8_t *ptr = array->start + array->offset; ++ ++ for (i = 0; i < array->length; i++) { ++ buf[i * 3] = hexval[(ptr[i] >> 4) & 0xF]; ++ buf[(i * 3) + 1] = hexval[ptr[i] & 0x0F]; ++ buf[(i * 3) + 2] = ' '; /* seperator */ ++ } ++ ++ buf[array->length * 3] = '\0'; ++ n = sprintf(res, "byte_array: length: %d value: %s", array->length, buf); ++ ++ lua_pushlstring(L, res, n); ++ ++ return 1; ++} ++ ++static const struct luaL_Reg bytearray_lib_m [] = { ++ { "__len", get_byte_array_size }, ++ { "__newindex", set_byte_array }, ++ { "__index", get_byte_array }, ++ { "__tostring", byte_array_to_string }, ++ { NULL, NULL } ++}; ++ ++void luaopen_bytearraylib(lua_State *L) ++{ ++ luaL_newmetatable(L, LUA_BYTE_ARRAY); ++ luaL_register(L, NULL, bytearray_lib_m); ++ lua_pop(L, 1); ++} ++ ++ +--- /dev/null ++++ b/extensions/LUA/controller.c +@@ -0,0 +1,604 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++ ++#if defined(__KERNEL__) ++ #include ++#endif ++#include "controller.h" ++ ++/* the array 'supported_protocols' holds all pointers to the ++ * static and dynamic protocol buffers. It is filled by the ++ * call to register_protbuf */ ++static struct protocol_buf * supported_protocols[MAX_NR_OF_PROTOCOLS]; ++ ++/* C_API: the function 'get_protocol_buf' returns the pointer ++ * to the protocol buffer of a given protocol id. */ ++struct protocol_buf * get_protocol_buf(uint32_t protocol_id) ++{ ++ return (struct protocol_buf *)supported_protocols[protocol_id]; ++} ++ ++ ++/* LUA_INT: the function 'gc_packet_segment' is triggered by the ++ * garbage collector whenever a userdata annotated with one of ++ * the protocol buffer metatable should be collected. */ ++static int32_t gc_packet_segment(lua_State *L) ++{ ++ lua_packet_segment * seg = (lua_packet_segment *)lua_touserdata(L, 1); ++ if (seg && seg->changes) { ++ seg->changes->ref_count--; ++ if (seg->changes->ref_count <= 0) { ++ kfree(seg->changes->field_length_changes); ++ kfree(seg->changes->field_offset_changes); ++ kfree(seg->changes); ++ seg->changes = NULL; ++ } ++ } ++ return 0; ++} ++ ++ ++/* LUA_API: the function 'set_raw' is used to set the bytes of a segment ++ * in 'raw' mode. The function is per default available in each protocol ++ * buffer until it gets overridden by a specific setter function inside ++ * a protocol buffer. ++ * ++ * Parameters: ++ * 1. lua_packet_segment (implicit) ++ * 2. int32_t byte_value ++ * ++ * Upvalues: ++ * 1. struct protocol_buf* ++ * 2. int32_t field index, not used in this function ++ * ++ * Return: void ++ */ ++static int32_t set_raw(lua_State *L) ++{ ++ int32_t i; ++ uint32_t nob; ++ uint8_t byte; ++ uint8_t *ptr; ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ int32_t val = luaL_checkinteger(L, 2); ++ ++ nob = 1 << CHAR_BIT; ++ ++ luaL_argcheck(L, 0 <= val && val < nob, 2, "cannot cast value to char"); ++ ++ byte = (uint8_t)val; ++ ptr = seg->start + seg->offset; ++ ++ for (i = 0; i < seg->length; i++) ++ ptr[i] = byte; ++ ++ return 0; ++} ++ ++/* LUA_API: the function 'get_raw' is used to get the bytes of a segment ++ * in 'raw' mode. The function is per default available in each protocol ++ * buffer until it gets overridden by a specific getter function inside ++ * a protocol buffer. ++ * ++ * Parameters: ++ * 1. lua_packet_segment (implicit) ++ * 2. uint32_t offset ++ * 3. uint32_t length ++ * ++ * Upvalues: ++ * 1. struct protocol_buf* ++ * 2. int32_t field index, not used in this function ++ * ++ * Return: ++ * the byte array representing the given array ++ */ ++static int32_t get_raw(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ init_byte_array(L, seg->start + seg->offset, seg->length, 1); ++ ++ return 1; ++} ++/* LUA_API: The function 'get_segment' is used to get a new segment in 'raw' mode. ++ * Typically this function is applied on another raw segment in order ++ * to extract a part of the segment as new segment. ++ * ++ * Parameters: ++ * 1. lua_packet_segment, implicit through object oriented access seg:raw(..) ++ * 2. uint32_t offset, this indicates where to start the new segment, see e.g below. ++ * 3. uint32_t length, this indicates the size of the new segment ++ * ++ * Upvalues: ++ * 1. struct protocol_buf* ++ * 2. int32_t field index, not used in this function ++ * ++ * Return: ++ * 1. A lua_packet_segment annotated with the according metatable or False in ++ * case the input data is not valid ++ * ++ * Example: ++ * ++ * +------------------------+---------------------------------------+ ++ * | function call | resulting lua_packet_segment | ++ * +========================+===+===+===+===+===+===+===+===+===+===+ ++ * | seg = packet:raw(0,10) | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ++ * +------------------------+---+---+---+---+---+---+---+---+---+---+ ++ * | 1st_half = seg:raw(0,5)| 0 | 1 | 2 | 3 | 4 | | ++ * +------------------------+---+---+---+---+---+---+---+---+---+---+ ++ * | 2nd_half = seg:raw(5,5)| | 5 | 6 | 7 | 8 | 9 | ++ * +------------------------+-------------------+---+---+---+---+---+ ++ */ ++static int32_t get_segment(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ uint32_t offset = luaL_checkinteger(L, 2); ++ uint32_t length = luaL_checkinteger(L, 3); ++ lua_packet_segment * new = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment)); ++ ++ new->start = seg->start; ++ new->offset = seg->offset + offset; ++ new->changes = NULL; ++ /* we allow a seg->length == 0 , this enables processing packets where the packetsize is not fixed (0 = not fixed)*/ ++ if (seg->length != 0 && length > seg->length) { ++ lua_pushboolean(L, 0); ++ return 1; ++ } ++ ++ new->length = length; ++ luaL_getmetatable(L, prot_buf->name); ++ lua_setmetatable(L, -2); ++ ++ return 1; ++} ++ ++/* LUA_API: the function 'get_segment_size' is used to get the size of a segment. ++ * ++ * Parameters: ++ * 1. lua_packet_segment, implicit through object oriented access seg:raw(..) ++ * ++ * Upvalues: ++ * 1. struct protocol_buf* ++ * 2. int32_t field index, not used in this function ++ * ++ * Return: ++ * 1. Size as lua_Number ++ */ ++static int32_t get_segment_size(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ lua_pushnumber(L, seg->length); ++ return 1; ++} ++ ++/* LUA_API: the function 'get_segment_offset' is used to get the real offset ++ * of a segment. This function returns the offset of the segment to the start ++ * of the buffer. This means the following ++ * seg1 = packet:raw(2,10) ++ * seg2 = seg1:raw(3,5) ++ * offset = seg2:get_offset() ++ * ++ * will give an offset of 5, since the seg1 starts at offset 2, and seg2 starts ++ * at offset (seg1:get_offset() + 3). ++ * ++ * Parameters: ++ * 1. lua_packet_segment, implicit through object oriented access seg:raw(..) ++ * ++ * Upvalues: ++ * 1. struct protocol_buf* ++ * 2. int32_t field index, not used in this function ++ * ++ * Return: ++ * 1. Offset as lua_Number ++ */ ++static int32_t get_segment_offset(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ lua_pushnumber(L, seg->offset); ++ return 1; ++} ++ ++/* LUA_API: overwrites the __tostring function of a lua_packet_segment. ++ * this will print32_t a nicely formated string, including length, ++ * offset and name of the protocol buffer. ++ * ++ * Parameters: ++ * 1. lua_packet_segment (implicit) ++ * ++ * Returns: ++ * 1. the representing string ++ */ ++static int32_t packet_segment_tostring(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ int32_t n; ++ char buf[128]; ++ ++ n = sprintf(buf, "type: %s, offset: %d, length: %d", prot_buf->name, seg->offset, seg->length); ++ lua_pushlstring(L, buf, n); ++ ++ return 1; ++} ++ ++ ++static const struct luaL_Reg seg_access_functions [] = { ++ { "set", set_raw }, ++ { "get", get_raw }, ++ { "raw", get_segment }, ++ { "get_offset", get_segment_offset }, ++ { "get_size", get_segment_size }, ++ { "to_bytes", get_raw }, ++ { "__tostring", packet_segment_tostring }, ++ { "__gc", gc_packet_segment }, ++ { NULL, NULL } ++}; ++ ++/* C_API: the function 'get_metatable_from_protocol_type' is a helper ++ * used in controller.c as well as it may find usage in the static ++ * protocol buffers and byte array implementation. */ ++void get_metatable_from_protocol_type(lua_State *L, int32_t type) ++{ ++ char * table; ++ lua_getglobal(L, SUPPORTED_PROTOCOL_TABLE); ++ lua_rawgeti(L, -1, type); ++ table = (char *)luaL_checkstring(L, -1); ++ lua_pop(L, 2); /* pop the table SUPPORTED_PROTOCOL_TABLE and the string pushed by lua_gettable */ ++ luaL_getmetatable(L, table); ++ return; ++} ++ ++/* C_INT: the function 'payload_contains_protocol' is used internally. ++ * Depending if static or dynamic protocol buffer it calls the right ++ * validation function. */ ++static int32_t payload_contains_protocol(lua_State *L, struct protocol_buf *prot_buf, lua_packet_segment *seg, uint32_t prot_type) ++{ ++ if (prot_buf->is_dynamic) ++ return has_protocol_dynamic(L, prot_buf, seg, prot_type); ++ else ++ return prot_buf->has_protocol(L, prot_buf, seg, prot_type); ++} ++ ++/* C_INT: the function 'protocol_get_field_changes' is used interally. ++ * It requests the field_changes struct calling the protocol buffers ++ * 'get_field_changes' function. This funciton is called, whenever ++ * the payload field with a given protocol type is requested inside ++ * the function 'get_protocol_field' */ ++static struct field_changes * protocol_get_field_changes(lua_State *L, struct protocol_buf *prot_buf, lua_packet_segment * seg) ++{ ++ struct field_changes * changes = NULL; ++ ++ if (prot_buf->get_field_changes) { ++ if (prot_buf->is_dynamic) ++ changes = get_field_changes_dynamic(L, prot_buf, seg); ++ else ++ changes = prot_buf->get_field_changes(L, seg); ++ /* is already 1 when set by helper 'get_allocated_field_changes, ++ * since not every prot_buf may use this function we enforce it. */ ++ changes->ref_count = 1; ++ } ++ return changes; ++} ++ ++/* C_INT: the function 'get_field_offset_in_bytes' wrapps the logic of ++ * calculating the new length with considering the optional field_changes. */ ++static int32_t get_field_offset_in_bytes(struct protocol_field * field, lua_packet_segment * seg, int32_t field_index) ++{ ++ uint32_t nr_of_bits, nr_of_bytes, field_offset; ++ ++ field_offset = field->offset; ++ /* do we need to manipulate the default values stored inside the protocol buffer ?? */ ++ if (seg->changes) ++ field_offset += seg->changes->field_offset_changes[field_index]; ++ /* how many bits remain */ ++ nr_of_bits = field_offset & (CHAR_BIT - 1); ++ /* assuming CHAR_BIT == 2 ^ 3 */ ++ nr_of_bytes = (field_offset - nr_of_bits) >> 3; ++ ++ return seg->offset + nr_of_bytes; ++} ++ ++/* C_INT: the function 'get_field_length_in_bytes' wrapps the logic of ++ * calculating the new offset with considering the optional field_changes. */ ++static int32_t get_field_length_in_bytes(struct protocol_field * field, lua_packet_segment * seg, int32_t field_index) ++{ ++ uint32_t nr_of_bits, nr_of_bytes, field_length; ++ ++ field_length = field->length; ++ /* if the field length is smaller than 1 byte, we take the size of one byte ++ * we treat the case where field_length == 0 in a special way ...*/ ++ if (field_length < CHAR_BIT && field_length > 0) ++ field_length = CHAR_BIT; ++ ++ /* do we need to manipulate the default values stored inside the protocol buffer ?? */ ++ if (seg->changes) ++ field_length += seg->changes->field_length_changes[field_index]; ++ /* how many bits remain */ ++ nr_of_bits = field_length & (CHAR_BIT - 1); ++ /* assuming CHAR_BIT == 2 ^ 3 */ ++ nr_of_bytes = (field_length - nr_of_bits) >> 3; ++ return nr_of_bytes; ++} ++ ++/* C_INT: the function 'initialize_field_getter_and_setter' initializes ++ * the setter and getter function of the field, considering the optional ++ * field manipulator functions defined inside the protocol buffers. */ ++static void initialize_field_getter_and_setter(lua_State *L, struct protocol_buf *prot_buf, int32_t field_index) ++{ ++ /* lets check if there is a metatable on top of the stack */ ++ struct protocol_field * f = (struct protocol_field *)&prot_buf->protocol_fields[field_index]; ++ ++ if (!lua_istable(L, -1)) luaL_error(L, "cannot initialize getter and setter for field %s->%s, " ++ "not a table on top of the stack, is '%s'", prot_buf->name, f->name, lua_typename(L, lua_type(L, -1))); ++ ++ /* is there a 'getter' to initialize ? */ ++ lua_pushlightuserdata(L, prot_buf); /* push upvalue 1 */ ++ lua_pushinteger(L, field_index); /* push upvalue 2 */ ++ if (f->get) { ++ if (prot_buf->is_dynamic) ++ lua_pushcclosure(L, field_dynamic_getter, 2); ++ else ++ lua_pushcclosure(L, f->get, 2); ++ }else ++ /* there is no specific getter defined - fall back to 'get_raw' */ ++ lua_pushcclosure(L, get_raw, 2); ++ /* set the metatable field 'get' */ ++ lua_setfield(L, -2, "get"); ++ ++ /* is there a 'setter' to initialize ? */ ++ lua_pushlightuserdata(L, prot_buf); /* push upvalue 1 */ ++ lua_pushinteger(L, field_index); /* push upvalue 2 */ ++ if (f->set) { ++ if (prot_buf->is_dynamic) ++ lua_pushcclosure(L, field_dynamic_setter, 2); ++ else ++ lua_pushcclosure(L, f->set, 2); ++ }else ++ /* there is no specific setter defined - fall back to 'set_raw' */ ++ lua_pushcclosure(L, set_raw, 2); ++ /* set the metatable field 'set' */ ++ lua_setfield(L, -2, "set"); ++} ++ ++/* LUA_API: 'get_protocol_field' is used in Lua as a closure for each field of a protocol ++ * buffer. E.g a call to ip = packet:data(packet_ip) will go to this function, ++ * and trigger the conversion of the raw packet to a ip packet. Each call ++ * to a field function of an IP packet, like ip:daddr() uses this function ++ * to to return the right data. In each case you will end up either with a ++ * new packet segment (annotated with the proper metatable) or a boolean ++ * value (False) if something went wrong. In the case everything went fine, ++ * the newly created lua_packet_segment is annotated with the proper ++ * metatable where the fields get and set also contain the specific getter ++ * and setter functions given by the protocol buffer. E.g. the function call ++ * ip:daddr():get() or ip:daddr():set(...) will call the proper function ++ * defined inside the corresponding field definition. ++ * ++ * Parameters: ++ * 1. lua_packet_segment, implicit through object oriented access seg:raw(..) ++ * 2. type of the protocol buffer, optional, and only used if the accessed ++ * field is the payload field. If a type is provided for the access of the ++ * payload field, the function tries to convert the data pointed to by the ++ * payload field to the given type. To check if such a conversion is ++ * possible, it calls the function pointed to by the protocol buffer member ++ * has_protocol. If this function returns True, the conversion takes place. ++ * ++ * Upvalues: ++ * 1. struct protocol_buf* ++ * 2. int32_t field index ++ * ++ * Return: ++ * 1. A lua_packet_segment annotated with the according metatable or False in ++ * case the input data is not valid ++ */ ++static int32_t get_protocol_field(lua_State *L) ++{ ++ int32_t prot_type; ++ lua_packet_segment * seg, *new; ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ int32_t field_index = lua_tointeger(L, lua_upvalueindex(2)); ++ struct protocol_field * field = &prot_buf->protocol_fields[field_index]; ++ ++ /* get the current packet segment */ ++ seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ /* initialize the new packet segment */ ++ new = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment)); ++ new->start = seg->start; /* the start is unchanged */ ++ new->offset = get_field_offset_in_bytes(field, seg, field_index); ++ new->length = get_field_length_in_bytes(field, seg, field_index); ++ ++ /* if new->length == 0 then no configuration was done, we guess the size by subtracting the ++ * new offset from the packet length. since the old length is getting initialized by the ++ * netfilter extension this assumption holds for the very last field of the protocol. ++ * this 'feature' should be used by protocol buffers containing a payload, whereas the ++ * payload field is the last field of the buffer. However, at compile-time unknown field ++ * sizes (and offsets) of fields not being placed at the end of the protocol should be ++ * initialized using the 'get_field_changes' hook system. */ ++ if (new->length == 0) ++ new->length = (seg->length + seg->offset) - (new->offset); ++ /* ++ printf("%s->%s:: seg->offset %i, seg->length %i, new->offset %i, new->length %i\n", ++ prot_buf->name, field->name, seg->offset, seg->length, new->offset, new->length); ++ */ ++ /* special care for packet payload requests */ ++ if (prot_buf->payload_field != NULL && strcmp(prot_buf->payload_field, field->name) == 0) { ++ /* we know the payload field is requested */ ++ /* the requested payload can be delivered either as a common segment or as ++ * an other packet type, such a conversion needs an extra protocol parameter ++ * ... so lets check */ ++ ++ if (lua_isnumber(L, 2)) { ++ /* we have an extra parameter, ... lets see if it is a valid protocol ++ * the parameter is the index of the 'supported_protocols'-array member */ ++ prot_type = lua_tointeger(L, 2); ++ if (prot_type >= 0 && prot_type < PACKET_SENTINEL) { ++ /* we are sure the purpose of the request is to get the payload data, ++ * converted to the given protocol. lets check if the payload contains ++ * data of the given protocol */ ++ if (payload_contains_protocol(L, prot_buf, seg, prot_type)) { ++ /* success, we can push the metatable for the given protocol */ ++ get_metatable_from_protocol_type(L, prot_type); ++ if (!lua_isnil(L, -1)) /* check if the metatable was found */ ++ /* perhaps the field offsets and lengths of the containing protocol ++ * are not set correctly. request the optional 'field_changes' structure ++ * holding the changes for lengths and offsets. */ ++ new->changes = protocol_get_field_changes(L, get_protocol_buf(prot_type), new); ++ else{ ++ /* failed, the requested protocol is not available ++ * we push false and return */ ++ lua_pop(L, 1); /* pop the userdata */ ++ lua_pushboolean(L, 0); ++ return 1; ++ } ++ }else{ ++ /* payload does not carry the provided protocol */ ++ /* we push false and return */ ++ lua_pop(L, 1); /* pop the userdata */ ++ lua_pushboolean(L, 0); ++ return 1; ++ } ++ }else{ ++ /* unknown protocol */ ++ lua_pop(L, 1); /* pop the userdata */ ++ luaL_error(L, "provided protocol is unknown"); ++ } ++ } ++ } ++ ++ /* if there is still the 'new' userdata on the top, we push our own metatable */ ++ if (lua_isuserdata(L, -1)) { ++ luaL_getmetatable(L, prot_buf->name); ++ new->changes = seg->changes; ++ if (seg->changes) ++ new->changes->ref_count++; ++ } ++ ++ /* a new packet segment is at index -2 , and the proper metatable at index -1 of the stack ++ * lets set the propper setter and getter function for the requested field */ ++ initialize_field_getter_and_setter(L, prot_buf, field_index); ++ ++ lua_setmetatable(L, -2); ++ return 1; ++} ++ ++/* C_API: 'register_protbuf' is only used internally. This function takes a ++ * pointer to a fully initialized protocol buffer struct and registers it ++ * inside the Lua state. Registering means: ++ * ++ * 1. it creates a new metatable with the name of the protocol buffer. ++ * 2. it registers the default functions which are stored in the luaL_Reg ++ * array seg_access_functions. ++ * 3. it loops over the protocol fields stored at prot_buf->protocol_fields ++ * and registers a new function (using the field name) inside the ++ * metatable. Each field points to the function 'get_protocol_field' ++ * which acts as a closure taking a pointer to the protocol buffer as ++ * well as the index of the field as upvalues. ++ * 4. The protocol index, serves as numerical identifier of this protocol ++ * buffer or even of the protocol itself. This index is stored as a ++ * global value inside the Lua state as well as inside the Lua table ++ * 'supported_protocols'. Assuming the name of a procotol buffer is ++ * "packet_ip" the following statements are true: ++ * ++ * supported_protocols[protocol_index] == "packet_ip" ++ * packet_ip == protocol_index ++ * ++ * This allows you to get all registered protocols from within Lua. This ++ * is especially usefull for the dynamic protocol buffers where you have ++ * to provide your own "has_protocol"-function, which probably needs the ++ * information on which protocols it is able to contain. ++ */ ++void register_protbuf(lua_State *L, struct protocol_buf * prot_buf, uint32_t protocol_index) ++{ ++ int32_t field_index; ++ luaL_Reg *reg = (struct luaL_Reg *)seg_access_functions; ++ struct protocol_field * field = prot_buf->protocol_fields; ++ ++ luaL_newmetatable(L, prot_buf->name); ++ ++ /* metatable.__index = metatable */ ++ lua_pushvalue(L, -1); /* duplicates the metatable */ ++ lua_setfield(L, -2, "__index"); ++ ++ /* pushing default functions */ ++ for (; reg->name; reg++) { ++ lua_pushlightuserdata(L, (void *)prot_buf); ++ lua_pushcclosure(L, reg->func, 1); ++ lua_setfield(L, -2, reg->name); ++ } ++ ++ /* pushing functions specific to the protocol buffer */ ++ for (field_index = 0; field->name; field++, field_index++) { ++ lua_pushlightuserdata(L, (void *)prot_buf); /* upvalue: prot_buf */ ++ lua_pushinteger(L, field_index); /* upvalue: index of protocol field */ ++ lua_pushcclosure(L, get_protocol_field, 2); ++ lua_setfield(L, -2, field->name); ++ } ++ /* pop the metatable */ ++ lua_pop(L, 1); ++ ++ /* registering the array-index as the protocol_id*/ ++ lua_getglobal(L, "_G"); ++ lua_pushinteger(L, protocol_index); ++ lua_setfield(L, -2, prot_buf->name); ++ lua_pop(L, 1); /* pop _G */ ++ ++ lua_getglobal(L, SUPPORTED_PROTOCOL_TABLE); ++ lua_pushstring(L, prot_buf->name); ++ lua_rawseti(L, -2, protocol_index); ++ ++ lua_pop(L, 1); /* pop SUPPORTED_PROTOCOL_TABLE */ ++ ++ supported_protocols[protocol_index] = prot_buf; ++} ++ ++void luaopen_controller(lua_State *L) ++{ ++ /* registering a table inside the _G with table[protocol_index] = prot_buf->name */ ++ lua_getglobal(L, "_G"); ++ lua_newtable(L); ++ lua_setfield(L, -2, SUPPORTED_PROTOCOL_TABLE); ++ lua_pop(L, 1); /* pop _G */ ++ ++ luaopen_protbuf_raw(L); ++ luaopen_protbuf_eth(L); ++ luaopen_protbuf_ip(L); ++ luaopen_protbuf_icmp(L); ++ luaopen_protbuf_tcp(L); ++ luaopen_protbuf_tcp_options(L); ++ luaopen_protbuf_udp(L); ++ luaopen_protbuf_tftp(L); ++ luaopen_protbuf_dynamic(L); ++ /* should follow all other static buffers */ ++#if defined(__KERNEL__) ++ luaopen_nflib(L); ++#endif ++ ++ luaopen_bytearraylib(L); ++} ++ ++ ++ ++ +--- /dev/null ++++ b/extensions/LUA/controller.h +@@ -0,0 +1,264 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++ ++#ifndef CONTROLLER_H_ ++#define CONTROLLER_H_ ++ ++#include "stdlib.h" /* wrapper */ ++#include "string.h" /* wrapper */ ++#include "lua.h" ++#include "lualib.h" ++#include "lauxlib.h" ++ ++#if defined(__KERNEL__) ++#include ++#include ++#include ++#endif ++ ++ ++/* to compile the stuff in userspace (for testing)*/ ++#if !defined(__KERNEL__) ++#include ++#define pr_debug printf; ++ ++#define kmalloc(size, type) malloc(size) ++#define kfree(ptr) free(ptr) ++ ++#endif ++ ++ ++/**********************************************************************/ ++/* nf Lua configuration */ ++/**********************************************************************/ ++#define MAX_NR_OF_PROTOCOLS 16 ++#define SUPPORTED_PROTOCOL_TABLE "supported_protocols" ++ ++#define MAX_NR_OF_FIELDS_IN_DYN_PROT_BUF 32 ++ ++ ++/**********************************************************************/ ++/* Static Protocol Buffer configuration */ ++/**********************************************************************/ ++ ++/* the definitions of the stringified expression of the prot_bufs... ++ * make sure all static prot_bufs are listed and are unique */ ++#define LUA_PACKET_SEG_RAW "packet_raw" ++#define LUA_PACKET_SEG_ETH "packet_eth" ++#define LUA_PACKET_SEG_ICMP "packet_icmp" ++#define LUA_PACKET_SEG_IP "packet_ip" ++#define LUA_PACKET_SEG_TCP "packet_tcp" ++#define LUA_PACKET_SEG_TCP_OPT "packet_tcp_opt" ++#define LUA_PACKET_SEG_UDP "packet_udp" ++#define LUA_PACKET_SEG_TFTP "packet_tftp" ++ ++/* the enum holding all static prot_bufs... make sure it contains all ++ * static prot_bufs */ ++enum PROT_BUF { ++ PACKET_RAW, ++ PACKET_ETH, ++ PACKET_IP, ++ PACKET_ICMP, ++ PACKET_TCP, ++ PACKET_TCP_OPTIONS, ++ PACKET_UDP, ++ PACKET_TFTP, ++ PACKET_DYNAMIC, ++ PACKET_SENTINEL ++}; ++ ++/* the luaopen-function of the prot_bufs... make sure it is called ++ * inside luaopen_controller */ ++void luaopen_protbuf_raw(lua_State *L); ++void luaopen_protbuf_eth(lua_State *L); ++void luaopen_protbuf_ip(lua_State *L); ++void luaopen_protbuf_icmp(lua_State *L); ++void luaopen_protbuf_tcp(lua_State *L); ++void luaopen_protbuf_tcp_options(lua_State *L); ++void luaopen_protbuf_udp(lua_State *L); ++void luaopen_protbuf_tftp(lua_State *L); ++void luaopen_protbuf_dynamic(lua_State *L); ++ ++/**********************************************************************/ ++/* field changes */ ++/**********************************************************************/ ++struct field_changes { ++ int ref_count; ++ int *field_length_changes; ++ int *field_offset_changes; ++}; ++ ++/**********************************************************************/ ++/* lua packet segment */ ++/* ------------------ */ ++/* The struct lua_packet_segment is the integral part of a Lua packet.*/ ++/* At the very beginning, when a new packet arrives in `lua_tg`_ such */ ++/* a struct is initialized. The field start then points to the lowest */ ++/* available header inside the sk_buff structure. During packet */ ++/* processing the start pointer remains the same, only the offset and */ ++/* length value change. */ ++/**********************************************************************/ ++#define checkpacketseg(L, i, seg_type) \ ++ (lua_packet_segment *)luaL_checkudata(L, i, seg_type) ++ ++typedef struct lua_packet_segment { ++ unsigned int offset; ++ unsigned int length; ++ struct field_changes * changes; ++ unsigned char * start; /* need to be at the end because of the memory alignment */ ++} lua_packet_segment; ++ ++/**********************************************************************/ ++/* protocol field */ ++/* -------------- */ ++/* This structure is a container for the field definitions used by the*/ ++/* protocol buffer. Each protocol field is expressed using this struct*/ ++/* Have a look at the protocol buffers to see how the struct gets */ ++/* initialized. */ ++/* */ ++/* name: */ ++/* This member expresses the name of the field, ending */ ++/* in its own Lua function to access the field. */ ++/* offset / length: */ ++/* These members do specify the position inside the protocol header */ ++/* in bits (not bytes!). */ ++/* get / set: */ ++/* The get and set functions take a function pointer pointing to the*/ ++/* specific getter and setter function for this field. */ ++/**********************************************************************/ ++struct protocol_field { ++ const char * name; ++ uint32_t offset; ++ uint32_t length; ++ lua_CFunction get; ++ lua_CFunction set; ++}; ++#define PROT_FIELD_SENTINEL { NULL, 0, 0, NULL, NULL } ++ ++ ++/**********************************************************************/ ++/* protocol_buf */ ++/**********************************************************************/ ++/* This structure is a container for all the information needed for a ++ * protocol buffer. It gets initialized in each protocol buffer header ++ * file or for the dynamic protocol buffers on runtime using the ++ * 'register_dynamic_protocol_buffer' function. ++ * ++ * name: ++ * This member is used throughout the system. It is also exported ++ * to Lua as a variable name holding the index of the 'supported_protocols' ++ * array. The name is also used as the name of the generated Lua ++ * metatable, that is why inside the macro checkpacketseg_ it ++ * is always the name of a protocol buffer that is passed as the ++ * second parameter. ++ * payload_field: ++ * This member holds the string of the field responsible for payload ++ * data. The payload field of a protocol has an extra property, since ++ * it can be used to invoke another protocol buffer that is applied to ++ * the payload content. ++ * has_protocol: ++ * This member is used together with the payload_field. Since we must ++ * be sure that the payload content does really contain a protocol ++ * of type X. The function pointed to by has_protocol checks if the ++ * protocol buffer X can be applied on the payload_data. ++ * protocol_fields: ++ * This member points to the array of 'protocol_field' structures ++ * get_field_changes: ++ * This member is optional. It is used to return a pointer to an initialized ++ * field_changes struct. The function is called, whenever the payload field ++ * is requested with a given protocol type. Usually this function will ++ * initialize the field_changes struct depending on the content of the ++ * payload data. e.g. ++ * tcp = ip:data(packet_tcp) ++ * such a request will call the 'get_field_changes' function of the tcp ++ * protocol buffer. This enables, that the tcp options field have the proper ++ * length as well as the tcp data start at the right offset. ++ */ ++struct protocol_buf { ++ int is_dynamic; ++ const char * name; ++ char * payload_field; ++ int (*has_protocol)(lua_State *L, struct protocol_buf *prot_buf, lua_packet_segment * seg, int type); ++ struct protocol_field * protocol_fields; ++ struct field_changes * (*get_field_changes)(lua_State *L, lua_packet_segment * seg); ++}; ++ ++/**********************************************************************/ ++/* lua byte array library */ ++/**********************************************************************/ ++#define LUA_BYTE_ARRAY "byte_array" ++#define checkbytearray(L, i) \ ++ (lua_packet_segment *)luaL_checkudata(L, i, LUA_BYTE_ARRAY) ++lua_packet_segment * init_byte_array(lua_State *L, unsigned char * start, int length, int do_copy); ++void luaopen_bytearraylib(lua_State *L); ++ ++ ++/**********************************************************************/ ++/* lua netfilter environment library */ ++/**********************************************************************/ ++#define NETFILTER_LIB "nf" ++#if defined(__KERNEL__) ++ struct lua_env { ++ lua_State *L; ++ /* perhaps more to come here (e.g. a state per CPU) */ ++ }; ++ #define LUA_ENV "lua_env" ++ #define checkluaenv(L, i) \ ++ (struct lua_env *)luaL_checkudata(L, i, LUA_ENV) ++ ++ void luaopen_nflib(lua_State *L); ++#endif ++ ++void cleanup_dynamic_prot_bufs(void); /* freeing all dynamic prot bufs */ ++/**********************************************************************/ ++/* lua protbuf helpers */ ++/**********************************************************************/ ++int get_1_bit_generic(lua_State *L); ++int set_1_bit_generic(lua_State *L); ++int get_lower_4_bit_generic(lua_State *L); ++int set_lower_4_bit_generic(lua_State *L); ++int get_upper_4_bit_generic(lua_State *L); ++int set_upper_4_bit_generic(lua_State *L); ++int get_8_bit_generic(lua_State *L); ++int set_8_bit_generic(lua_State *L); ++int get_16_bit_generic(lua_State *L); ++int set_16_bit_generic(lua_State *L); ++int get_32_bit_generic(lua_State *L); ++int set_32_bit_generic(lua_State *L); ++int set_data_generic(lua_State *L); ++int get_string_generic(lua_State *L); ++int get_byte_generic_str(lua_State *L); ++struct field_changes * get_allocated_field_changes(lua_State *L, int nr_of_fields); ++ ++/* only used by the dynamic prot buf subsystem */ ++#define MAX_NR_OF_DYN_PROT_BUFS 16 ++int field_dynamic_setter(lua_State *L); ++int field_dynamic_getter(lua_State *L); ++int has_protocol_dynamic(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int type); ++struct field_changes * get_field_changes_dynamic(lua_State *L, struct protocol_buf *prot_buf, lua_packet_segment * seg); ++ ++/**********************************************************************/ ++/* lua controller API */ ++/**********************************************************************/ ++void luaopen_controller(lua_State *L); ++struct protocol_buf * get_protocol_buf(unsigned int protocol_id); ++void get_metatable_from_protocol_type(lua_State *L, int type); ++void register_protbuf(lua_State *L, struct protocol_buf * prot_buf, unsigned int protocol_index); ++ ++ ++#endif /* CONTROLLER_H_ */ +--- /dev/null ++++ b/extensions/LUA/Kbuild +@@ -0,0 +1,49 @@ ++# -*- Makefile -*- ++ ++# Adding debug options ++EXTRA_CFLAGS += -DDEBUG ++ ++obj-m += xt_LUA.o ++ ++EXTRA_CFLAGS += -I$(src)/prot_buf_new ++xt_LUA-y += xt_LUA_target.o \ ++ ++xt_LUA-y += nf_lua.o \ ++ prot_buf_helpers.o \ ++ byte_array.o \ ++ controller.o \ ++ prot_buf_ethernet.o \ ++ prot_buf_icmp.o \ ++ prot_buf_ip.o \ ++ prot_buf_raw.o \ ++ prot_buf_tcp.o \ ++ prot_buf_udp.o \ ++ prot_buf_tftp.o \ ++ prot_buf_dynamic.o \ ++ ++ ++# Adding Lua Support ++EXTRA_CFLAGS += -I$(src)/lua -I$(src)/lua/include ++xt_LUA-y += lua/lapi.o \ ++ lua/lbaselib.o \ ++ lua/lcode.o \ ++ lua/ldebug.o \ ++ lua/ldo.o \ ++ lua/ldump.o \ ++ lua/lfunc.o \ ++ lua/lgc.o \ ++ lua/llex.o \ ++ lua/lmem.o \ ++ lua/lobject.o \ ++ lua/lopcodes.o \ ++ lua/lparser.o \ ++ lua/lstate.o \ ++ lua/lstring.o \ ++ lua/lstrlib.o \ ++ lua/ltable.o \ ++ lua/ltablib.o \ ++ lua/ltm.o \ ++ lua/lundump.o \ ++ lua/lvm.o \ ++ lua/lzio.o \ ++ lua/lauxlib.o \ +--- /dev/null ++++ b/extensions/LUA/libxt_LUA.c +@@ -0,0 +1,191 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "xt_LUA.h" ++ ++enum { ++ FLAG_SCRIPT = 1 << 0, ++ FLAG_STATE = 1 << 1, ++ FLAG_FUNCTION = 1 << 2, ++}; ++ ++static const struct option lua_tg_opts[] = { ++ { .name = "script", .has_arg = true, .val = 's' }, ++ { .name = "state", .has_arg = true, .val = 'l' }, ++ { .name = "function", .has_arg = true, .val = 'f' }, ++ { NULL }, ++}; ++ ++ ++static void lua_tg_help(void) ++{ ++ printf( ++ "LUA target options:\n" ++ " --script SCRIPT Process packet with the Lua script given by SCRIPT\n" ++ " \n" ++ " --state ID Process packet within the Lua state given by ID.\n" ++ " Omitting --state infers the ID 0, which can be\n" ++ " refered to the 'global' state.\n" ++ " \n" ++ " --function FUNCTION Name of the function that processes the Lua packet\n" ++ "\n"); ++} ++ ++static void ++lua_tg_init(struct xt_entry_target *target) ++{ ++ struct xt_lua_tginfo *info = (void *)target->data; ++ ++ info->state_id = 0; ++ strncpy(info->function, "process_packet\0", sizeof("process_packet\0")); ++} ++ ++static int ++lua_tg_parse(int32_t c, char **argv, int32_t invert, uint32_t *flags, ++ const void *entry, struct xt_entry_target **target) ++{ ++ struct xt_lua_tginfo *info = (void *)(*target)->data; ++ char buf[MAX_SCRIPT_SIZE]; ++ long script_size; ++ uint32_t state_id; ++ FILE *file; ++ ++ switch (c) { ++ case 's': ++ if (*flags & FLAG_SCRIPT) ++ xtables_error(PARAMETER_PROBLEM, ++ "LUA: Cannot specify --script more than once"); ++ ++ if (strlen(optarg) > sizeof(info->filename)) ++ xtables_error(PARAMETER_PROBLEM, ++ "LUA: Maximum script length is %zu", ++ sizeof(info->filename)); ++ ++ if (strchr(optarg, '\n')) ++ xtables_error(PARAMETER_PROBLEM, ++ "LUA: Newlines not allowed in script name"); ++ file = fopen(optarg, "rb"); ++ if (file != NULL) { ++ fseek(file, 0, SEEK_END); ++ script_size = ftell(file); ++ if (script_size > MAX_SCRIPT_SIZE) ++ xtables_error(PARAMETER_PROBLEM, ++ "LUA: The size of the script is too big"); ++ ++ fseek(file, 0, SEEK_SET); ++ fread(buf, script_size, 1, file); ++ fclose(file); ++ } else ++ xtables_error(PARAMETER_PROBLEM, ++ "LUA: Cannot open script %s", optarg); ++ ++ strncpy(info->filename, optarg, sizeof(info->filename)); ++ strncpy(info->buf, buf, sizeof(info->buf)); ++ info->script_size = script_size; ++ ++ *flags |= FLAG_SCRIPT; ++ return true; ++ ++ case 'l': ++ if (*flags & FLAG_STATE) ++ xtables_error(PARAMETER_PROBLEM, ++ "LUA: Cannot specify --state more than once"); ++ ++ if (!xtables_strtoui(optarg, NULL, &state_id, 0, 8)) ++ xtables_error(PARAMETER_PROBLEM, ++ "LUA: Invalid --state %s", optarg); ++ ++ info->state_id = state_id; ++ *flags |= FLAG_STATE; ++ return true; ++ ++ case 'f': ++ if (*flags & FLAG_FUNCTION) ++ xtables_error(PARAMETER_PROBLEM, ++ "LUA: Cannot specify --function more than once"); ++ if (strlen(optarg) > sizeof(info->function)) ++ xtables_error(PARAMETER_PROBLEM, ++ "LUA: Maximum function length is %zu", ++ sizeof(info->function)); ++ ++ if (strchr(optarg, '\n')) ++ xtables_error(PARAMETER_PROBLEM, ++ "LUA: Newlines not allowed in function name"); ++ ++ strncpy(info->function, optarg, sizeof(info->function)); ++ ++ *flags |= FLAG_FUNCTION; ++ return true; ++ } ++ ++ return false; ++} ++ ++static void ++lua_tg_check(uint32_t flags) ++{ ++ if (flags == 0) ++ xtables_error(PARAMETER_PROBLEM, "LUA: --script parameter required"); ++} ++ ++static void ++lua_tg_print(const void *entry, const struct xt_entry_target *target, ++ int32_t numeric) ++{ ++ const struct xt_lua_tginfo *info = (const void *)target->data; ++ ++ printf("LUA script: %s ", info->filename); ++} ++ ++static void ++lua_tg_save(const void *entry, const struct xt_entry_target *target) ++{ ++ const struct xt_lua_tginfo *info = (const void *)target->data; ++ ++ printf("--script %s ", info->filename); ++} ++ ++static struct xtables_target lua_tg_reg = { ++ .name = "LUA", ++ .version = XTABLES_VERSION, ++ .revision = 0, ++ .family = NFPROTO_UNSPEC, ++ .size = XT_ALIGN(sizeof(struct xt_lua_tginfo)), ++ .userspacesize = XT_ALIGN(sizeof(struct xt_lua_tginfo)), ++ .help = lua_tg_help, ++ .init = lua_tg_init, ++ .parse = lua_tg_parse, ++ .final_check = lua_tg_check, ++ .print = lua_tg_print, ++ .save = lua_tg_save, ++ .extra_opts = lua_tg_opts, ++}; ++ ++static __attribute__((constructor)) void lua_tg_ldr(void) ++{ ++ xtables_register_target(&lua_tg_reg); ++} ++ +--- /dev/null ++++ b/extensions/LUA/libxt_LUA.man +@@ -0,0 +1 @@ ++Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +--- /dev/null ++++ b/extensions/LUA/lua/include/ctype.h +@@ -0,0 +1,11 @@ ++#include ++#undef isalnum ++#define isalnum(c) (((__ismask(c)&(_U|_L|_D)) != 0) && (c > 0)) ++#undef isalpha ++#define isalpha(c) (((__ismask(c)&(_U|_L)) != 0) && (c > 0)) ++#undef iscntrl ++#define iscntrl(c) (((__ismask(c)&(_C)) != 0) && (c > 0)) ++#undef isdigit ++#define isdigit(c) (((__ismask(c)&(_D)) != 0) && (c > 0)) ++#undef isspace ++#define isspace(c) (((__ismask(c)&(_S)) != 0) && (c > 0)) +--- /dev/null ++++ b/extensions/LUA/lua/include/errno.h +@@ -0,0 +1 @@ ++#include +--- /dev/null ++++ b/extensions/LUA/lua/include/locale.h +@@ -0,0 +1,5 @@ ++struct lconv { ++ char * decimal_point ; ++} ; ++ ++#define localeconv() NULL +--- /dev/null ++++ b/extensions/LUA/lua/include/setjmp.h +@@ -0,0 +1,26 @@ ++/* ++ * arch/um/include/sysdep-i386/archsetjmp.h ++ */ ++ ++#ifndef _KLIBC_ARCHSETJMP_H ++#define _KLIBC_ARCHSETJMP_H ++ ++struct __jmp_buf { ++ unsigned int __ebx; ++ unsigned int __esp; ++ unsigned int __ebp; ++ unsigned int __esi; ++ unsigned int __edi; ++ unsigned int __eip; ++}; ++ ++typedef struct __jmp_buf jmp_buf[1]; ++ ++#define JB_IP __eip ++#define JB_SP __esp ++ ++int setjmp(jmp_buf); ++void longjmp(jmp_buf, int); ++ ++#endif /* _SETJMP_H */ ++ +--- /dev/null ++++ b/extensions/LUA/lua/include/stdio.h +@@ -0,0 +1 @@ ++#include +--- /dev/null ++++ b/extensions/LUA/lua/include/stdlib.h +@@ -0,0 +1,7 @@ ++#include ++ ++#define exit(E) return ++#define strtoul simple_strtoul ++#define strcoll strcmp ++ ++#define CHAR_BIT 8 +--- /dev/null ++++ b/extensions/LUA/lua/include/string.h +@@ -0,0 +1 @@ ++#include +--- /dev/null ++++ b/extensions/LUA/lua/lapi.c +@@ -0,0 +1,1086 @@ ++/* ++** $Id: lapi.c,v 2.55.1.5 2008/07/04 18:41:18 roberto Exp $ ++** Lua API ++** See Copyright Notice in lua.h ++*/ ++ ++#include ++#include ++#include ++#include ++ ++#define lapi_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "lapi.h" ++#include "ldebug.h" ++#include "ldo.h" ++#include "lfunc.h" ++#include "lgc.h" ++#include "lmem.h" ++#include "lobject.h" ++#include "lstate.h" ++#include "lstring.h" ++#include "ltable.h" ++#include "ltm.h" ++#include "lundump.h" ++#include "lvm.h" ++ ++ ++ ++const char lua_ident[] = ++ "$Lua: " LUA_RELEASE " " LUA_COPYRIGHT " $\n" ++ "$Authors: " LUA_AUTHORS " $\n" ++ "$URL: www.lua.org $\n"; ++ ++ ++ ++#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->base)) ++ ++#define api_checkvalidindex(L, i) api_check(L, (i) != luaO_nilobject) ++ ++#define api_incr_top(L) {api_check(L, L->top < L->ci->top); L->top++;} ++ ++ ++ ++static TValue *index2adr (lua_State *L, int idx) { ++ if (idx > 0) { ++ TValue *o = L->base + (idx - 1); ++ api_check(L, idx <= L->ci->top - L->base); ++ if (o >= L->top) return cast(TValue *, luaO_nilobject); ++ else return o; ++ } ++ else if (idx > LUA_REGISTRYINDEX) { ++ api_check(L, idx != 0 && -idx <= L->top - L->base); ++ return L->top + idx; ++ } ++ else switch (idx) { /* pseudo-indices */ ++ case LUA_REGISTRYINDEX: return registry(L); ++ case LUA_ENVIRONINDEX: { ++ Closure *func = curr_func(L); ++ sethvalue(L, &L->env, func->c.env); ++ return &L->env; ++ } ++ case LUA_GLOBALSINDEX: return gt(L); ++ default: { ++ Closure *func = curr_func(L); ++ idx = LUA_GLOBALSINDEX - idx; ++ return (idx <= func->c.nupvalues) ++ ? &func->c.upvalue[idx-1] ++ : cast(TValue *, luaO_nilobject); ++ } ++ } ++} ++ ++ ++static Table *getcurrenv (lua_State *L) { ++ if (L->ci == L->base_ci) /* no enclosing function? */ ++ return hvalue(gt(L)); /* use global table as environment */ ++ else { ++ Closure *func = curr_func(L); ++ return func->c.env; ++ } ++} ++ ++ ++void luaA_pushobject (lua_State *L, const TValue *o) { ++ setobj2s(L, L->top, o); ++ api_incr_top(L); ++} ++ ++ ++LUA_API int lua_checkstack (lua_State *L, int size) { ++ int res = 1; ++ lua_lock(L); ++ if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK) ++ res = 0; /* stack overflow */ ++ else if (size > 0) { ++ luaD_checkstack(L, size); ++ if (L->ci->top < L->top + size) ++ L->ci->top = L->top + size; ++ } ++ lua_unlock(L); ++ return res; ++} ++ ++ ++LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) { ++ int i; ++ if (from == to) return; ++ lua_lock(to); ++ api_checknelems(from, n); ++ api_check(from, G(from) == G(to)); ++ api_check(from, to->ci->top - to->top >= n); ++ from->top -= n; ++ for (i = 0; i < n; i++) { ++ setobj2s(to, to->top++, from->top + i); ++ } ++ lua_unlock(to); ++} ++ ++ ++LUA_API void lua_setlevel (lua_State *from, lua_State *to) { ++ to->nCcalls = from->nCcalls; ++} ++ ++ ++LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) { ++ lua_CFunction old; ++ lua_lock(L); ++ old = G(L)->panic; ++ G(L)->panic = panicf; ++ lua_unlock(L); ++ return old; ++} ++ ++ ++LUA_API lua_State *lua_newthread (lua_State *L) { ++ lua_State *L1; ++ lua_lock(L); ++ luaC_checkGC(L); ++ L1 = luaE_newthread(L); ++ setthvalue(L, L->top, L1); ++ api_incr_top(L); ++ lua_unlock(L); ++ luai_userstatethread(L, L1); ++ return L1; ++} ++ ++ ++ ++/* ++** basic stack manipulation ++*/ ++ ++ ++LUA_API int lua_gettop (lua_State *L) { ++ return cast_int(L->top - L->base); ++} ++ ++ ++LUA_API void lua_settop (lua_State *L, int idx) { ++ lua_lock(L); ++ if (idx >= 0) { ++ api_check(L, idx <= L->stack_last - L->base); ++ while (L->top < L->base + idx) ++ setnilvalue(L->top++); ++ L->top = L->base + idx; ++ } ++ else { ++ api_check(L, -(idx+1) <= (L->top - L->base)); ++ L->top += idx+1; /* `subtract' index (index is negative) */ ++ } ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_remove (lua_State *L, int idx) { ++ StkId p; ++ lua_lock(L); ++ p = index2adr(L, idx); ++ api_checkvalidindex(L, p); ++ while (++p < L->top) setobjs2s(L, p-1, p); ++ L->top--; ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_insert (lua_State *L, int idx) { ++ StkId p; ++ StkId q; ++ lua_lock(L); ++ p = index2adr(L, idx); ++ api_checkvalidindex(L, p); ++ for (q = L->top; q>p; q--) setobjs2s(L, q, q-1); ++ setobjs2s(L, p, L->top); ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_replace (lua_State *L, int idx) { ++ StkId o; ++ lua_lock(L); ++ /* explicit test for incompatible code */ ++ if (idx == LUA_ENVIRONINDEX && L->ci == L->base_ci) ++ luaG_runerror(L, "no calling environment"); ++ api_checknelems(L, 1); ++ o = index2adr(L, idx); ++ api_checkvalidindex(L, o); ++ if (idx == LUA_ENVIRONINDEX) { ++ Closure *func = curr_func(L); ++ api_check(L, ttistable(L->top - 1)); ++ func->c.env = hvalue(L->top - 1); ++ luaC_barrier(L, func, L->top - 1); ++ } ++ else { ++ setobj(L, o, L->top - 1); ++ if (idx < LUA_GLOBALSINDEX) /* function upvalue? */ ++ luaC_barrier(L, curr_func(L), L->top - 1); ++ } ++ L->top--; ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_pushvalue (lua_State *L, int idx) { ++ lua_lock(L); ++ setobj2s(L, L->top, index2adr(L, idx)); ++ api_incr_top(L); ++ lua_unlock(L); ++} ++ ++ ++ ++/* ++** access functions (stack -> C) ++*/ ++ ++ ++LUA_API int lua_type (lua_State *L, int idx) { ++ StkId o = index2adr(L, idx); ++ return (o == luaO_nilobject) ? LUA_TNONE : ttype(o); ++} ++ ++ ++LUA_API const char *lua_typename (lua_State *L, int t) { ++ UNUSED(L); ++ return (t == LUA_TNONE) ? "no value" : luaT_typenames[t]; ++} ++ ++ ++LUA_API int lua_iscfunction (lua_State *L, int idx) { ++ StkId o = index2adr(L, idx); ++ return iscfunction(o); ++} ++ ++ ++LUA_API int lua_isnumber (lua_State *L, int idx) { ++ TValue n; ++ const TValue *o = index2adr(L, idx); ++ return tonumber(o, &n); ++} ++ ++ ++LUA_API int lua_isstring (lua_State *L, int idx) { ++ int t = lua_type(L, idx); ++ return (t == LUA_TSTRING || t == LUA_TNUMBER); ++} ++ ++ ++LUA_API int lua_isuserdata (lua_State *L, int idx) { ++ const TValue *o = index2adr(L, idx); ++ return (ttisuserdata(o) || ttislightuserdata(o)); ++} ++ ++ ++LUA_API int lua_rawequal (lua_State *L, int index1, int index2) { ++ StkId o1 = index2adr(L, index1); ++ StkId o2 = index2adr(L, index2); ++ return (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 ++ : luaO_rawequalObj(o1, o2); ++} ++ ++ ++LUA_API int lua_equal (lua_State *L, int index1, int index2) { ++ StkId o1, o2; ++ int i; ++ lua_lock(L); /* may call tag method */ ++ o1 = index2adr(L, index1); ++ o2 = index2adr(L, index2); ++ i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 : equalobj(L, o1, o2); ++ lua_unlock(L); ++ return i; ++} ++ ++ ++LUA_API int lua_lessthan (lua_State *L, int index1, int index2) { ++ StkId o1, o2; ++ int i; ++ lua_lock(L); /* may call tag method */ ++ o1 = index2adr(L, index1); ++ o2 = index2adr(L, index2); ++ i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 ++ : luaV_lessthan(L, o1, o2); ++ lua_unlock(L); ++ return i; ++} ++ ++ ++ ++LUA_API lua_Number lua_tonumber (lua_State *L, int idx) { ++ TValue n; ++ const TValue *o = index2adr(L, idx); ++ if (tonumber(o, &n)) ++ return nvalue(o); ++ else ++ return 0; ++} ++ ++ ++LUA_API lua_Integer lua_tointeger (lua_State *L, int idx) { ++ TValue n; ++ const TValue *o = index2adr(L, idx); ++ if (tonumber(o, &n)) { ++ lua_Integer res; ++ lua_Number num = nvalue(o); ++ lua_number2integer(res, num); ++ return res; ++ } ++ else ++ return 0; ++} ++ ++ ++LUA_API int lua_toboolean (lua_State *L, int idx) { ++ const TValue *o = index2adr(L, idx); ++ return !l_isfalse(o); ++} ++ ++ ++LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) { ++ StkId o = index2adr(L, idx); ++ if (!ttisstring(o)) { ++ lua_lock(L); /* `luaV_tostring' may create a new string */ ++ if (!luaV_tostring(L, o)) { /* conversion failed? */ ++ if (len != NULL) *len = 0; ++ lua_unlock(L); ++ return NULL; ++ } ++ luaC_checkGC(L); ++ o = index2adr(L, idx); /* previous call may reallocate the stack */ ++ lua_unlock(L); ++ } ++ if (len != NULL) *len = tsvalue(o)->len; ++ return svalue(o); ++} ++ ++ ++LUA_API size_t lua_objlen (lua_State *L, int idx) { ++ StkId o = index2adr(L, idx); ++ switch (ttype(o)) { ++ case LUA_TSTRING: return tsvalue(o)->len; ++ case LUA_TUSERDATA: return uvalue(o)->len; ++ case LUA_TTABLE: return luaH_getn(hvalue(o)); ++ case LUA_TNUMBER: { ++ size_t l; ++ lua_lock(L); /* `luaV_tostring' may create a new string */ ++ l = (luaV_tostring(L, o) ? tsvalue(o)->len : 0); ++ lua_unlock(L); ++ return l; ++ } ++ default: return 0; ++ } ++} ++ ++ ++LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) { ++ StkId o = index2adr(L, idx); ++ return (!iscfunction(o)) ? NULL : clvalue(o)->c.f; ++} ++ ++ ++LUA_API void *lua_touserdata (lua_State *L, int idx) { ++ StkId o = index2adr(L, idx); ++ switch (ttype(o)) { ++ case LUA_TUSERDATA: return (rawuvalue(o) + 1); ++ case LUA_TLIGHTUSERDATA: return pvalue(o); ++ default: return NULL; ++ } ++} ++ ++ ++LUA_API lua_State *lua_tothread (lua_State *L, int idx) { ++ StkId o = index2adr(L, idx); ++ return (!ttisthread(o)) ? NULL : thvalue(o); ++} ++ ++ ++LUA_API const void *lua_topointer (lua_State *L, int idx) { ++ StkId o = index2adr(L, idx); ++ switch (ttype(o)) { ++ case LUA_TTABLE: return hvalue(o); ++ case LUA_TFUNCTION: return clvalue(o); ++ case LUA_TTHREAD: return thvalue(o); ++ case LUA_TUSERDATA: ++ case LUA_TLIGHTUSERDATA: ++ return lua_touserdata(L, idx); ++ default: return NULL; ++ } ++} ++ ++ ++ ++/* ++** push functions (C -> stack) ++*/ ++ ++ ++LUA_API void lua_pushnil (lua_State *L) { ++ lua_lock(L); ++ setnilvalue(L->top); ++ api_incr_top(L); ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_pushnumber (lua_State *L, lua_Number n) { ++ lua_lock(L); ++ setnvalue(L->top, n); ++ api_incr_top(L); ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) { ++ lua_lock(L); ++ setnvalue(L->top, cast_num(n)); ++ api_incr_top(L); ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) { ++ lua_lock(L); ++ luaC_checkGC(L); ++ setsvalue2s(L, L->top, luaS_newlstr(L, s, len)); ++ api_incr_top(L); ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_pushstring (lua_State *L, const char *s) { ++ if (s == NULL) ++ lua_pushnil(L); ++ else ++ lua_pushlstring(L, s, strlen(s)); ++} ++ ++ ++LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt, ++ va_list argp) { ++ const char *ret; ++ lua_lock(L); ++ luaC_checkGC(L); ++ ret = luaO_pushvfstring(L, fmt, argp); ++ lua_unlock(L); ++ return ret; ++} ++ ++ ++LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) { ++ const char *ret; ++ va_list argp; ++ lua_lock(L); ++ luaC_checkGC(L); ++ va_start(argp, fmt); ++ ret = luaO_pushvfstring(L, fmt, argp); ++ va_end(argp); ++ lua_unlock(L); ++ return ret; ++} ++ ++ ++LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { ++ Closure *cl; ++ lua_lock(L); ++ luaC_checkGC(L); ++ api_checknelems(L, n); ++ cl = luaF_newCclosure(L, n, getcurrenv(L)); ++ cl->c.f = fn; ++ L->top -= n; ++ while (n--) ++ setobj2n(L, &cl->c.upvalue[n], L->top+n); ++ setclvalue(L, L->top, cl); ++ lua_assert(iswhite(obj2gco(cl))); ++ api_incr_top(L); ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_pushboolean (lua_State *L, int b) { ++ lua_lock(L); ++ setbvalue(L->top, (b != 0)); /* ensure that true is 1 */ ++ api_incr_top(L); ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_pushlightuserdata (lua_State *L, void *p) { ++ lua_lock(L); ++ setpvalue(L->top, p); ++ api_incr_top(L); ++ lua_unlock(L); ++} ++ ++ ++LUA_API int lua_pushthread (lua_State *L) { ++ lua_lock(L); ++ setthvalue(L, L->top, L); ++ api_incr_top(L); ++ lua_unlock(L); ++ return (G(L)->mainthread == L); ++} ++ ++ ++ ++/* ++** get functions (Lua -> stack) ++*/ ++ ++ ++LUA_API void lua_gettable (lua_State *L, int idx) { ++ StkId t; ++ lua_lock(L); ++ t = index2adr(L, idx); ++ api_checkvalidindex(L, t); ++ luaV_gettable(L, t, L->top - 1, L->top - 1); ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_getfield (lua_State *L, int idx, const char *k) { ++ StkId t; ++ TValue key; ++ lua_lock(L); ++ t = index2adr(L, idx); ++ api_checkvalidindex(L, t); ++ setsvalue(L, &key, luaS_new(L, k)); ++ luaV_gettable(L, t, &key, L->top); ++ api_incr_top(L); ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_rawget (lua_State *L, int idx) { ++ StkId t; ++ lua_lock(L); ++ t = index2adr(L, idx); ++ api_check(L, ttistable(t)); ++ setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1)); ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_rawgeti (lua_State *L, int idx, int n) { ++ StkId o; ++ lua_lock(L); ++ o = index2adr(L, idx); ++ api_check(L, ttistable(o)); ++ setobj2s(L, L->top, luaH_getnum(hvalue(o), n)); ++ api_incr_top(L); ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_createtable (lua_State *L, int narray, int nrec) { ++ lua_lock(L); ++ luaC_checkGC(L); ++ sethvalue(L, L->top, luaH_new(L, narray, nrec)); ++ api_incr_top(L); ++ lua_unlock(L); ++} ++ ++ ++LUA_API int lua_getmetatable (lua_State *L, int objindex) { ++ const TValue *obj; ++ Table *mt = NULL; ++ int res; ++ lua_lock(L); ++ obj = index2adr(L, objindex); ++ switch (ttype(obj)) { ++ case LUA_TTABLE: ++ mt = hvalue(obj)->metatable; ++ break; ++ case LUA_TUSERDATA: ++ mt = uvalue(obj)->metatable; ++ break; ++ default: ++ mt = G(L)->mt[ttype(obj)]; ++ break; ++ } ++ if (mt == NULL) ++ res = 0; ++ else { ++ sethvalue(L, L->top, mt); ++ api_incr_top(L); ++ res = 1; ++ } ++ lua_unlock(L); ++ return res; ++} ++ ++ ++LUA_API void lua_getfenv (lua_State *L, int idx) { ++ StkId o; ++ lua_lock(L); ++ o = index2adr(L, idx); ++ api_checkvalidindex(L, o); ++ switch (ttype(o)) { ++ case LUA_TFUNCTION: ++ sethvalue(L, L->top, clvalue(o)->c.env); ++ break; ++ case LUA_TUSERDATA: ++ sethvalue(L, L->top, uvalue(o)->env); ++ break; ++ case LUA_TTHREAD: ++ setobj2s(L, L->top, gt(thvalue(o))); ++ break; ++ default: ++ setnilvalue(L->top); ++ break; ++ } ++ api_incr_top(L); ++ lua_unlock(L); ++} ++ ++ ++/* ++** set functions (stack -> Lua) ++*/ ++ ++ ++LUA_API void lua_settable (lua_State *L, int idx) { ++ StkId t; ++ lua_lock(L); ++ api_checknelems(L, 2); ++ t = index2adr(L, idx); ++ api_checkvalidindex(L, t); ++ luaV_settable(L, t, L->top - 2, L->top - 1); ++ L->top -= 2; /* pop index and value */ ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_setfield (lua_State *L, int idx, const char *k) { ++ StkId t; ++ TValue key; ++ lua_lock(L); ++ api_checknelems(L, 1); ++ t = index2adr(L, idx); ++ api_checkvalidindex(L, t); ++ setsvalue(L, &key, luaS_new(L, k)); ++ luaV_settable(L, t, &key, L->top - 1); ++ L->top--; /* pop value */ ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_rawset (lua_State *L, int idx) { ++ StkId t; ++ lua_lock(L); ++ api_checknelems(L, 2); ++ t = index2adr(L, idx); ++ api_check(L, ttistable(t)); ++ setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1); ++ luaC_barriert(L, hvalue(t), L->top-1); ++ L->top -= 2; ++ lua_unlock(L); ++} ++ ++ ++LUA_API void lua_rawseti (lua_State *L, int idx, int n) { ++ StkId o; ++ lua_lock(L); ++ api_checknelems(L, 1); ++ o = index2adr(L, idx); ++ api_check(L, ttistable(o)); ++ setobj2t(L, luaH_setnum(L, hvalue(o), n), L->top-1); ++ luaC_barriert(L, hvalue(o), L->top-1); ++ L->top--; ++ lua_unlock(L); ++} ++ ++ ++LUA_API int lua_setmetatable (lua_State *L, int objindex) { ++ TValue *obj; ++ Table *mt; ++ lua_lock(L); ++ api_checknelems(L, 1); ++ obj = index2adr(L, objindex); ++ api_checkvalidindex(L, obj); ++ if (ttisnil(L->top - 1)) ++ mt = NULL; ++ else { ++ api_check(L, ttistable(L->top - 1)); ++ mt = hvalue(L->top - 1); ++ } ++ switch (ttype(obj)) { ++ case LUA_TTABLE: { ++ hvalue(obj)->metatable = mt; ++ if (mt) ++ luaC_objbarriert(L, hvalue(obj), mt); ++ break; ++ } ++ case LUA_TUSERDATA: { ++ uvalue(obj)->metatable = mt; ++ if (mt) ++ luaC_objbarrier(L, rawuvalue(obj), mt); ++ break; ++ } ++ default: { ++ G(L)->mt[ttype(obj)] = mt; ++ break; ++ } ++ } ++ L->top--; ++ lua_unlock(L); ++ return 1; ++} ++ ++ ++LUA_API int lua_setfenv (lua_State *L, int idx) { ++ StkId o; ++ int res = 1; ++ lua_lock(L); ++ api_checknelems(L, 1); ++ o = index2adr(L, idx); ++ api_checkvalidindex(L, o); ++ api_check(L, ttistable(L->top - 1)); ++ switch (ttype(o)) { ++ case LUA_TFUNCTION: ++ clvalue(o)->c.env = hvalue(L->top - 1); ++ break; ++ case LUA_TUSERDATA: ++ uvalue(o)->env = hvalue(L->top - 1); ++ break; ++ case LUA_TTHREAD: ++ sethvalue(L, gt(thvalue(o)), hvalue(L->top - 1)); ++ break; ++ default: ++ res = 0; ++ break; ++ } ++ if (res) luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1)); ++ L->top--; ++ lua_unlock(L); ++ return res; ++} ++ ++ ++/* ++** `load' and `call' functions (run Lua code) ++*/ ++ ++ ++#define adjustresults(L,nres) \ ++ { if (nres == LUA_MULTRET && L->top >= L->ci->top) L->ci->top = L->top; } ++ ++ ++#define checkresults(L,na,nr) \ ++ api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na))) ++ ++ ++LUA_API void lua_call (lua_State *L, int nargs, int nresults) { ++ StkId func; ++ lua_lock(L); ++ api_checknelems(L, nargs+1); ++ checkresults(L, nargs, nresults); ++ func = L->top - (nargs+1); ++ luaD_call(L, func, nresults); ++ adjustresults(L, nresults); ++ lua_unlock(L); ++} ++ ++ ++ ++/* ++** Execute a protected call. ++*/ ++struct CallS { /* data to `f_call' */ ++ StkId func; ++ int nresults; ++}; ++ ++ ++static void f_call (lua_State *L, void *ud) { ++ struct CallS *c = cast(struct CallS *, ud); ++ luaD_call(L, c->func, c->nresults); ++} ++ ++ ++ ++LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errfunc) { ++ struct CallS c; ++ int status; ++ ptrdiff_t func; ++ lua_lock(L); ++ api_checknelems(L, nargs+1); ++ checkresults(L, nargs, nresults); ++ if (errfunc == 0) ++ func = 0; ++ else { ++ StkId o = index2adr(L, errfunc); ++ api_checkvalidindex(L, o); ++ func = savestack(L, o); ++ } ++ c.func = L->top - (nargs+1); /* function to be called */ ++ c.nresults = nresults; ++ status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func); ++ adjustresults(L, nresults); ++ lua_unlock(L); ++ return status; ++} ++ ++ ++/* ++** Execute a protected C call. ++*/ ++struct CCallS { /* data to `f_Ccall' */ ++ lua_CFunction func; ++ void *ud; ++}; ++ ++ ++static void f_Ccall (lua_State *L, void *ud) { ++ struct CCallS *c = cast(struct CCallS *, ud); ++ Closure *cl; ++ cl = luaF_newCclosure(L, 0, getcurrenv(L)); ++ cl->c.f = c->func; ++ setclvalue(L, L->top, cl); /* push function */ ++ api_incr_top(L); ++ setpvalue(L->top, c->ud); /* push only argument */ ++ api_incr_top(L); ++ luaD_call(L, L->top - 2, 0); ++} ++ ++ ++LUA_API int lua_cpcall (lua_State *L, lua_CFunction func, void *ud) { ++ struct CCallS c; ++ int status; ++ lua_lock(L); ++ c.func = func; ++ c.ud = ud; ++ status = luaD_pcall(L, f_Ccall, &c, savestack(L, L->top), 0); ++ lua_unlock(L); ++ return status; ++} ++ ++ ++LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data, ++ const char *chunkname) { ++ ZIO z; ++ int status; ++ lua_lock(L); ++ if (!chunkname) chunkname = "?"; ++ luaZ_init(L, &z, reader, data); ++ status = luaD_protectedparser(L, &z, chunkname); ++ lua_unlock(L); ++ return status; ++} ++ ++ ++LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) { ++ int status; ++ TValue *o; ++ lua_lock(L); ++ api_checknelems(L, 1); ++ o = L->top - 1; ++ if (isLfunction(o)) ++ status = luaU_dump(L, clvalue(o)->l.p, writer, data, 0); ++ else ++ status = 1; ++ lua_unlock(L); ++ return status; ++} ++ ++ ++LUA_API int lua_status (lua_State *L) { ++ return L->status; ++} ++ ++ ++/* ++** Garbage-collection function ++*/ ++ ++LUA_API int lua_gc (lua_State *L, int what, int data) { ++ int res = 0; ++ global_State *g; ++ lua_lock(L); ++ g = G(L); ++ switch (what) { ++ case LUA_GCSTOP: { ++ g->GCthreshold = MAX_LUMEM; ++ break; ++ } ++ case LUA_GCRESTART: { ++ g->GCthreshold = g->totalbytes; ++ break; ++ } ++ case LUA_GCCOLLECT: { ++ luaC_fullgc(L); ++ break; ++ } ++ case LUA_GCCOUNT: { ++ /* GC values are expressed in Kbytes: #bytes/2^10 */ ++ res = cast_int(g->totalbytes >> 10); ++ break; ++ } ++ case LUA_GCCOUNTB: { ++ res = cast_int(g->totalbytes & 0x3ff); ++ break; ++ } ++ case LUA_GCSTEP: { ++ lu_mem a = (cast(lu_mem, data) << 10); ++ if (a <= g->totalbytes) ++ g->GCthreshold = g->totalbytes - a; ++ else ++ g->GCthreshold = 0; ++ while (g->GCthreshold <= g->totalbytes) { ++ luaC_step(L); ++ if (g->gcstate == GCSpause) { /* end of cycle? */ ++ res = 1; /* signal it */ ++ break; ++ } ++ } ++ break; ++ } ++ case LUA_GCSETPAUSE: { ++ res = g->gcpause; ++ g->gcpause = data; ++ break; ++ } ++ case LUA_GCSETSTEPMUL: { ++ res = g->gcstepmul; ++ g->gcstepmul = data; ++ break; ++ } ++ default: res = -1; /* invalid option */ ++ } ++ lua_unlock(L); ++ return res; ++} ++ ++ ++ ++/* ++** miscellaneous functions ++*/ ++ ++ ++LUA_API int lua_error (lua_State *L) { ++ lua_lock(L); ++ api_checknelems(L, 1); ++ luaG_errormsg(L); ++ lua_unlock(L); ++ return 0; /* to avoid warnings */ ++} ++ ++ ++LUA_API int lua_next (lua_State *L, int idx) { ++ StkId t; ++ int more; ++ lua_lock(L); ++ t = index2adr(L, idx); ++ api_check(L, ttistable(t)); ++ more = luaH_next(L, hvalue(t), L->top - 1); ++ if (more) { ++ api_incr_top(L); ++ } ++ else /* no more elements */ ++ L->top -= 1; /* remove key */ ++ lua_unlock(L); ++ return more; ++} ++ ++ ++LUA_API void lua_concat (lua_State *L, int n) { ++ lua_lock(L); ++ api_checknelems(L, n); ++ if (n >= 2) { ++ luaC_checkGC(L); ++ luaV_concat(L, n, cast_int(L->top - L->base) - 1); ++ L->top -= (n-1); ++ } ++ else if (n == 0) { /* push empty string */ ++ setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); ++ api_incr_top(L); ++ } ++ /* else n == 1; nothing to do */ ++ lua_unlock(L); ++} ++ ++ ++LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud) { ++ lua_Alloc f; ++ lua_lock(L); ++ if (ud) *ud = G(L)->ud; ++ f = G(L)->frealloc; ++ lua_unlock(L); ++ return f; ++} ++ ++ ++LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud) { ++ lua_lock(L); ++ G(L)->ud = ud; ++ G(L)->frealloc = f; ++ lua_unlock(L); ++} ++ ++ ++LUA_API void *lua_newuserdata (lua_State *L, size_t size) { ++ Udata *u; ++ lua_lock(L); ++ luaC_checkGC(L); ++ u = luaS_newudata(L, size, getcurrenv(L)); ++ setuvalue(L, L->top, u); ++ api_incr_top(L); ++ lua_unlock(L); ++ return u + 1; ++} ++ ++ ++ ++ ++static const char *aux_upvalue (StkId fi, int n, TValue **val) { ++ Closure *f; ++ if (!ttisfunction(fi)) return NULL; ++ f = clvalue(fi); ++ if (f->c.isC) { ++ if (!(1 <= n && n <= f->c.nupvalues)) return NULL; ++ *val = &f->c.upvalue[n-1]; ++ return ""; ++ } ++ else { ++ Proto *p = f->l.p; ++ if (!(1 <= n && n <= p->sizeupvalues)) return NULL; ++ *val = f->l.upvals[n-1]->v; ++ return getstr(p->upvalues[n-1]); ++ } ++} ++ ++ ++LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) { ++ const char *name; ++ TValue *val; ++ lua_lock(L); ++ name = aux_upvalue(index2adr(L, funcindex), n, &val); ++ if (name) { ++ setobj2s(L, L->top, val); ++ api_incr_top(L); ++ } ++ lua_unlock(L); ++ return name; ++} ++ ++ ++LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) { ++ const char *name; ++ TValue *val; ++ StkId fi; ++ lua_lock(L); ++ fi = index2adr(L, funcindex); ++ api_checknelems(L, 1); ++ name = aux_upvalue(fi, n, &val); ++ if (name) { ++ L->top--; ++ setobj(L, val, L->top); ++ luaC_barrier(L, clvalue(fi), L->top); ++ } ++ lua_unlock(L); ++ return name; ++} ++ +--- /dev/null ++++ b/extensions/LUA/lua/lapi.h +@@ -0,0 +1,16 @@ ++/* ++** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Auxiliary functions from Lua API ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef lapi_h ++#define lapi_h ++ ++ ++#include "lobject.h" ++ ++ ++LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o); ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/lauxlib.c +@@ -0,0 +1,674 @@ ++/* ++** $Id: lauxlib.c,v 1.159.1.3 2008/01/21 13:20:51 roberto Exp $ ++** Auxiliary functions for building Lua libraries ++** See Copyright Notice in lua.h ++*/ ++ ++#include ++ ++#if !defined(__KERNEL__) ++#include ++#include ++#include ++#include ++#include ++#else ++#include ++#include ++#include ++#include ++#include ++#endif ++ ++/* This file uses only the official API of Lua. ++** Any function declared here could be written as an application function. ++*/ ++ ++#define lauxlib_c ++#define LUA_LIB ++ ++#include "lua.h" ++ ++#include "lauxlib.h" ++ ++ ++#define FREELIST_REF 0 /* free list of references */ ++ ++ ++/* convert a stack index to positive */ ++#define abs_index(L, i) ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : \ ++ lua_gettop(L) + (i) + 1) ++ ++ ++/* ++** {====================================================== ++** Error-report functions ++** ======================================================= ++*/ ++ ++ ++LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) { ++ lua_Debug ar; ++ if (!lua_getstack(L, 0, &ar)) /* no stack frame? */ ++ return luaL_error(L, "bad argument #%d (%s)", narg, extramsg); ++ lua_getinfo(L, "n", &ar); ++ if (strcmp(ar.namewhat, "method") == 0) { ++ narg--; /* do not count `self' */ ++ if (narg == 0) /* error is in the self argument itself? */ ++ return luaL_error(L, "calling " LUA_QS " on bad self (%s)", ++ ar.name, extramsg); ++ } ++ if (ar.name == NULL) ++ ar.name = "?"; ++ return luaL_error(L, "bad argument #%d to " LUA_QS " (%s)", ++ narg, ar.name, extramsg); ++} ++ ++ ++LUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname) { ++ const char *msg = lua_pushfstring(L, "%s expected, got %s", ++ tname, luaL_typename(L, narg)); ++ return luaL_argerror(L, narg, msg); ++} ++ ++ ++static void tag_error (lua_State *L, int narg, int tag) { ++ luaL_typerror(L, narg, lua_typename(L, tag)); ++} ++ ++ ++LUALIB_API void luaL_where (lua_State *L, int level) { ++ lua_Debug ar; ++ if (lua_getstack(L, level, &ar)) { /* check function at level */ ++ lua_getinfo(L, "Sl", &ar); /* get info about it */ ++ if (ar.currentline > 0) { /* is there info? */ ++ lua_pushfstring(L, "%s:%d: ", ar.short_src, ar.currentline); ++ return; ++ } ++ } ++ lua_pushliteral(L, ""); /* else, no information available... */ ++} ++ ++ ++LUALIB_API int luaL_error (lua_State *L, const char *fmt, ...) { ++ va_list argp; ++ va_start(argp, fmt); ++ luaL_where(L, 1); ++ lua_pushvfstring(L, fmt, argp); ++ va_end(argp); ++ lua_concat(L, 2); ++ return lua_error(L); ++} ++ ++/* }====================================================== */ ++ ++ ++LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def, ++ const char *const lst[]) { ++ const char *name = (def) ? luaL_optstring(L, narg, def) : ++ luaL_checkstring(L, narg); ++ int i; ++ for (i=0; lst[i]; i++) ++ if (strcmp(lst[i], name) == 0) ++ return i; ++ return luaL_argerror(L, narg, ++ lua_pushfstring(L, "invalid option " LUA_QS, name)); ++} ++ ++ ++LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname) { ++ lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get registry.name */ ++ if (!lua_isnil(L, -1)) /* name already in use? */ ++ return 0; /* leave previous value on top, but return 0 */ ++ lua_pop(L, 1); ++ lua_newtable(L); /* create metatable */ ++ lua_pushvalue(L, -1); ++ lua_setfield(L, LUA_REGISTRYINDEX, tname); /* registry.name = metatable */ ++ return 1; ++} ++ ++ ++LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) { ++ void *p = lua_touserdata(L, ud); ++ if (p != NULL) { /* value is a userdata? */ ++ if (lua_getmetatable(L, ud)) { /* does it have a metatable? */ ++ lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get correct metatable */ ++ if (lua_rawequal(L, -1, -2)) { /* does it have the correct mt? */ ++ lua_pop(L, 2); /* remove both metatables */ ++ return p; ++ } ++ } ++ } ++ luaL_typerror(L, ud, tname); /* else error */ ++ return NULL; /* to avoid warnings */ ++} ++ ++ ++LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *mes) { ++ if (!lua_checkstack(L, space)) ++ luaL_error(L, "stack overflow (%s)", mes); ++} ++ ++ ++LUALIB_API void luaL_checktype (lua_State *L, int narg, int t) { ++ if (lua_type(L, narg) != t) ++ tag_error(L, narg, t); ++} ++ ++ ++LUALIB_API void luaL_checkany (lua_State *L, int narg) { ++ if (lua_type(L, narg) == LUA_TNONE) ++ luaL_argerror(L, narg, "value expected"); ++} ++ ++ ++LUALIB_API const char *luaL_checklstring (lua_State *L, int narg, size_t *len) { ++ const char *s = lua_tolstring(L, narg, len); ++ if (!s) tag_error(L, narg, LUA_TSTRING); ++ return s; ++} ++ ++ ++LUALIB_API const char *luaL_optlstring (lua_State *L, int narg, ++ const char *def, size_t *len) { ++ if (lua_isnoneornil(L, narg)) { ++ if (len) ++ *len = (def ? strlen(def) : 0); ++ return def; ++ } ++ else return luaL_checklstring(L, narg, len); ++} ++ ++ ++LUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) { ++ lua_Number d = lua_tonumber(L, narg); ++ if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */ ++ tag_error(L, narg, LUA_TNUMBER); ++ return d; ++} ++ ++ ++LUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) { ++ return luaL_opt(L, luaL_checknumber, narg, def); ++} ++ ++ ++LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int narg) { ++ lua_Integer d = lua_tointeger(L, narg); ++ if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */ ++ tag_error(L, narg, LUA_TNUMBER); ++ return d; ++} ++ ++ ++LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg, ++ lua_Integer def) { ++ return luaL_opt(L, luaL_checkinteger, narg, def); ++} ++ ++ ++LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) { ++ if (!lua_getmetatable(L, obj)) /* no metatable? */ ++ return 0; ++ lua_pushstring(L, event); ++ lua_rawget(L, -2); ++ if (lua_isnil(L, -1)) { ++ lua_pop(L, 2); /* remove metatable and metafield */ ++ return 0; ++ } ++ else { ++ lua_remove(L, -2); /* remove only metatable */ ++ return 1; ++ } ++} ++ ++ ++LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) { ++ obj = abs_index(L, obj); ++ if (!luaL_getmetafield(L, obj, event)) /* no metafield? */ ++ return 0; ++ lua_pushvalue(L, obj); ++ lua_call(L, 1, 1); ++ return 1; ++} ++ ++ ++LUALIB_API void (luaL_register) (lua_State *L, const char *libname, ++ const luaL_Reg *l) { ++ luaI_openlib(L, libname, l, 0); ++} ++ ++ ++static int libsize (const luaL_Reg *l) { ++ int size = 0; ++ for (; l->name; l++) size++; ++ return size; ++} ++ ++ ++LUALIB_API void luaI_openlib (lua_State *L, const char *libname, ++ const luaL_Reg *l, int nup) { ++ if (libname) { ++ int size = libsize(l); ++ /* check whether lib already exists */ ++ luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1); ++ lua_getfield(L, -1, libname); /* get _LOADED[libname] */ ++ if (!lua_istable(L, -1)) { /* not found? */ ++ lua_pop(L, 1); /* remove previous result */ ++ /* try global variable (and create one if it does not exist) */ ++ if (luaL_findtable(L, LUA_GLOBALSINDEX, libname, size) != NULL) ++ luaL_error(L, "name conflict for module " LUA_QS, libname); ++ lua_pushvalue(L, -1); ++ lua_setfield(L, -3, libname); /* _LOADED[libname] = new table */ ++ } ++ lua_remove(L, -2); /* remove _LOADED table */ ++ lua_insert(L, -(nup+1)); /* move library table to below upvalues */ ++ } ++ for (; l->name; l++) { ++ int i; ++ for (i=0; ifunc, nup); ++ lua_setfield(L, -(nup+2), l->name); ++ } ++ lua_pop(L, nup); /* remove upvalues */ ++} ++ ++ ++ ++/* ++** {====================================================== ++** getn-setn: size for arrays ++** ======================================================= ++*/ ++ ++#if defined(LUA_COMPAT_GETN) ++ ++static int checkint (lua_State *L, int topop) { ++ int n = (lua_type(L, -1) == LUA_TNUMBER) ? lua_tointeger(L, -1) : -1; ++ lua_pop(L, topop); ++ return n; ++} ++ ++ ++static void getsizes (lua_State *L) { ++ lua_getfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); ++ if (lua_isnil(L, -1)) { /* no `size' table? */ ++ lua_pop(L, 1); /* remove nil */ ++ lua_newtable(L); /* create it */ ++ lua_pushvalue(L, -1); /* `size' will be its own metatable */ ++ lua_setmetatable(L, -2); ++ lua_pushliteral(L, "kv"); ++ lua_setfield(L, -2, "__mode"); /* metatable(N).__mode = "kv" */ ++ lua_pushvalue(L, -1); ++ lua_setfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); /* store in register */ ++ } ++} ++ ++ ++LUALIB_API void luaL_setn (lua_State *L, int t, int n) { ++ t = abs_index(L, t); ++ lua_pushliteral(L, "n"); ++ lua_rawget(L, t); ++ if (checkint(L, 1) >= 0) { /* is there a numeric field `n'? */ ++ lua_pushliteral(L, "n"); /* use it */ ++ lua_pushinteger(L, n); ++ lua_rawset(L, t); ++ } ++ else { /* use `sizes' */ ++ getsizes(L); ++ lua_pushvalue(L, t); ++ lua_pushinteger(L, n); ++ lua_rawset(L, -3); /* sizes[t] = n */ ++ lua_pop(L, 1); /* remove `sizes' */ ++ } ++} ++ ++ ++LUALIB_API int luaL_getn (lua_State *L, int t) { ++ int n; ++ t = abs_index(L, t); ++ lua_pushliteral(L, "n"); /* try t.n */ ++ lua_rawget(L, t); ++ if ((n = checkint(L, 1)) >= 0) return n; ++ getsizes(L); /* else try sizes[t] */ ++ lua_pushvalue(L, t); ++ lua_rawget(L, -2); ++ if ((n = checkint(L, 2)) >= 0) return n; ++ return (int)lua_objlen(L, t); ++} ++ ++#endif ++ ++/* }====================================================== */ ++ ++ ++ ++LUALIB_API const char *luaL_gsub (lua_State *L, const char *s, const char *p, ++ const char *r) { ++ const char *wild; ++ size_t l = strlen(p); ++ luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC); ++ if(!b) luaL_error(L, "luaL_gsub: cannot allocate memory"); ++ luaL_buffinit(L, b); ++ while ((wild = strstr(s, p)) != NULL) { ++ luaL_addlstring(b, s, wild - s); /* push prefix */ ++ luaL_addstring(b, r); /* push replacement in place of pattern */ ++ s = wild + l; /* continue after `p' */ ++ } ++ luaL_addstring(b, s); /* push last suffix */ ++ luaL_pushresult(b); ++ kfree(b); ++ return lua_tostring(L, -1); ++} ++ ++ ++LUALIB_API const char *luaL_findtable (lua_State *L, int idx, ++ const char *fname, int szhint) { ++ const char *e; ++ lua_pushvalue(L, idx); ++ do { ++ e = strchr(fname, '.'); ++ if (e == NULL) e = fname + strlen(fname); ++ lua_pushlstring(L, fname, e - fname); ++ lua_rawget(L, -2); ++ if (lua_isnil(L, -1)) { /* no such field? */ ++ lua_pop(L, 1); /* remove this nil */ ++ lua_createtable(L, 0, (*e == '.' ? 1 : szhint)); /* new table for field */ ++ lua_pushlstring(L, fname, e - fname); ++ lua_pushvalue(L, -2); ++ lua_settable(L, -4); /* set new table into field */ ++ } ++ else if (!lua_istable(L, -1)) { /* field has a non-table value? */ ++ lua_pop(L, 2); /* remove table and value */ ++ return fname; /* return problematic part of the name */ ++ } ++ lua_remove(L, -2); /* remove previous table */ ++ fname = e + 1; ++ } while (*e == '.'); ++ return NULL; ++} ++ ++ ++ ++/* ++** {====================================================== ++** Generic Buffer manipulation ++** ======================================================= ++*/ ++ ++ ++#define bufflen(B) ((B)->p - (B)->buffer) ++#define bufffree(B) ((size_t)(LUAL_BUFFERSIZE - bufflen(B))) ++ ++#define LIMIT (LUA_MINSTACK/2) ++ ++ ++static int emptybuffer (luaL_Buffer *B) { ++ size_t l = bufflen(B); ++ if (l == 0) return 0; /* put nothing on stack */ ++ else { ++ lua_pushlstring(B->L, B->buffer, l); ++ B->p = B->buffer; ++ B->lvl++; ++ return 1; ++ } ++} ++ ++ ++static void adjuststack (luaL_Buffer *B) { ++ if (B->lvl > 1) { ++ lua_State *L = B->L; ++ int toget = 1; /* number of levels to concat */ ++ size_t toplen = lua_strlen(L, -1); ++ do { ++ size_t l = lua_strlen(L, -(toget+1)); ++ if (B->lvl - toget + 1 >= LIMIT || toplen > l) { ++ toplen += l; ++ toget++; ++ } ++ else break; ++ } while (toget < B->lvl); ++ lua_concat(L, toget); ++ B->lvl = B->lvl - toget + 1; ++ } ++} ++ ++ ++LUALIB_API char *luaL_prepbuffer (luaL_Buffer *B) { ++ if (emptybuffer(B)) ++ adjuststack(B); ++ return B->buffer; ++} ++ ++ ++LUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l) { ++ while (l--) ++ luaL_addchar(B, *s++); ++} ++ ++ ++LUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s) { ++ luaL_addlstring(B, s, strlen(s)); ++} ++ ++ ++LUALIB_API void luaL_pushresult (luaL_Buffer *B) { ++ emptybuffer(B); ++ lua_concat(B->L, B->lvl); ++ B->lvl = 1; ++} ++ ++ ++LUALIB_API void luaL_addvalue (luaL_Buffer *B) { ++ lua_State *L = B->L; ++ size_t vl; ++ const char *s = lua_tolstring(L, -1, &vl); ++ if (vl <= bufffree(B)) { /* fit into buffer? */ ++ memcpy(B->p, s, vl); /* put it there */ ++ B->p += vl; ++ lua_pop(L, 1); /* remove from stack */ ++ } ++ else { ++ if (emptybuffer(B)) ++ lua_insert(L, -2); /* put buffer before new value */ ++ B->lvl++; /* add new value into B stack */ ++ adjuststack(B); ++ } ++} ++ ++ ++LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B) { ++ B->L = L; ++ B->p = B->buffer; ++ B->lvl = 0; ++} ++ ++/* }====================================================== */ ++ ++ ++LUALIB_API int luaL_ref (lua_State *L, int t) { ++ int ref; ++ t = abs_index(L, t); ++ if (lua_isnil(L, -1)) { ++ lua_pop(L, 1); /* remove from stack */ ++ return LUA_REFNIL; /* `nil' has a unique fixed reference */ ++ } ++ lua_rawgeti(L, t, FREELIST_REF); /* get first free element */ ++ ref = (int)lua_tointeger(L, -1); /* ref = t[FREELIST_REF] */ ++ lua_pop(L, 1); /* remove it from stack */ ++ if (ref != 0) { /* any free element? */ ++ lua_rawgeti(L, t, ref); /* remove it from list */ ++ lua_rawseti(L, t, FREELIST_REF); /* (t[FREELIST_REF] = t[ref]) */ ++ } ++ else { /* no free elements */ ++ ref = (int)lua_objlen(L, t); ++ ref++; /* create new reference */ ++ } ++ lua_rawseti(L, t, ref); ++ return ref; ++} ++ ++ ++LUALIB_API void luaL_unref (lua_State *L, int t, int ref) { ++ if (ref >= 0) { ++ t = abs_index(L, t); ++ lua_rawgeti(L, t, FREELIST_REF); ++ lua_rawseti(L, t, ref); /* t[ref] = t[FREELIST_REF] */ ++ lua_pushinteger(L, ref); ++ lua_rawseti(L, t, FREELIST_REF); /* t[FREELIST_REF] = ref */ ++ } ++} ++ ++ ++ ++/* ++** {====================================================== ++** Load functions ++** ======================================================= ++*/ ++ ++#if !defined(__KERNEL__) ++typedef struct LoadF { ++ int extraline; ++ FILE *f; ++ char buff[LUAL_BUFFERSIZE]; ++} LoadF; ++ ++ ++static const char *getF (lua_State *L, void *ud, size_t *size) { ++ LoadF *lf = (LoadF *)ud; ++ (void)L; ++ if (lf->extraline) { ++ lf->extraline = 0; ++ *size = 1; ++ return "\n"; ++ } ++ if (feof(lf->f)) return NULL; ++ *size = fread(lf->buff, 1, sizeof(lf->buff), lf->f); ++ return (*size > 0) ? lf->buff : NULL; ++} ++ ++ ++static int errfile (lua_State *L, const char *what, int fnameindex) { ++ const char *serr = strerror(errno); ++ const char *filename = lua_tostring(L, fnameindex) + 1; ++ lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr); ++ lua_remove(L, fnameindex); ++ return LUA_ERRFILE; ++} ++ ++ ++LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) { ++ LoadF lf; ++ int status, readstatus; ++ int c; ++ int fnameindex = lua_gettop(L) + 1; /* index of filename on the stack */ ++ lf.extraline = 0; ++ if (filename == NULL) { ++ lua_pushliteral(L, "=stdin"); ++ lf.f = stdin; ++ } ++ else { ++ lua_pushfstring(L, "@%s", filename); ++ lf.f = fopen(filename, "r"); ++ if (lf.f == NULL) return errfile(L, "open", fnameindex); ++ } ++ c = getc(lf.f); ++ if (c == '#') { /* Unix exec. file? */ ++ lf.extraline = 1; ++ while ((c = getc(lf.f)) != EOF && c != '\n') ; /* skip first line */ ++ if (c == '\n') c = getc(lf.f); ++ } ++ if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ ++ lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ ++ if (lf.f == NULL) return errfile(L, "reopen", fnameindex); ++ /* skip eventual `#!...' */ ++ while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ; ++ lf.extraline = 0; ++ } ++ ungetc(c, lf.f); ++ status = lua_load(L, getF, &lf, lua_tostring(L, -1)); ++ readstatus = ferror(lf.f); ++ if (filename) fclose(lf.f); /* close file (even in case of errors) */ ++ if (readstatus) { ++ lua_settop(L, fnameindex); /* ignore results from `lua_load' */ ++ return errfile(L, "read", fnameindex); ++ } ++ lua_remove(L, fnameindex); ++ return status; ++} ++#endif ++ ++typedef struct LoadS { ++ const char *s; ++ size_t size; ++} LoadS; ++ ++ ++static const char *getS (lua_State *L, void *ud, size_t *size) { ++ LoadS *ls = (LoadS *)ud; ++ (void)L; ++ if (ls->size == 0) return NULL; ++ *size = ls->size; ++ ls->size = 0; ++ return ls->s; ++} ++ ++ ++LUALIB_API int luaL_loadbuffer (lua_State *L, const char *buff, size_t size, ++ const char *name) { ++ LoadS ls; ++ ls.s = buff; ++ ls.size = size; ++ return lua_load(L, getS, &ls, name); ++} ++ ++ ++LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s) { ++ return luaL_loadbuffer(L, s, strlen(s), s); ++} ++ ++ ++ ++/* }====================================================== */ ++ ++ ++static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { ++ (void)ud; ++ (void)osize; ++ if (nsize == 0) { ++#if !defined(__KERNEL__) ++ free(ptr); ++#else ++ kfree(ptr); ++#endif ++ return NULL; ++ } ++ else ++#if !defined(__KERNEL__) ++ return realloc(ptr, nsize); ++#else ++ return krealloc(ptr, nsize, GFP_ATOMIC); ++#endif ++} ++ ++ ++static int lpanic (lua_State *L) { ++ (void)L; /* to avoid warnings */ ++#if !defined(__KERNEL__) ++ fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n", ++#else ++ printk( "PANIC: unprotected error in call to Lua API (%s)\n", ++#endif ++ lua_tostring(L, -1)); ++ return 0; ++} ++ ++ ++LUALIB_API lua_State *luaL_newstate (void) { ++ lua_State *L = lua_newstate(l_alloc, NULL); ++ if (L) lua_atpanic(L, &lpanic); ++ return L; ++} ++ +--- /dev/null ++++ b/extensions/LUA/lua/lauxlib.h +@@ -0,0 +1,184 @@ ++/* ++** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Auxiliary functions for building Lua libraries ++** See Copyright Notice in lua.h ++*/ ++ ++ ++#ifndef lauxlib_h ++#define lauxlib_h ++ ++ ++#include ++#include /* for kmalloc and kfree when allocating luaL_Buffer */ ++ ++#if !defined(__KERNEL__) ++#include ++#endif ++ ++#include "lua.h" ++ ++ ++#if defined(LUA_COMPAT_GETN) ++LUALIB_API int (luaL_getn) (lua_State *L, int t); ++LUALIB_API void (luaL_setn) (lua_State *L, int t, int n); ++#else ++#define luaL_getn(L,i) ((int)lua_objlen(L, i)) ++#define luaL_setn(L,i,j) ((void)0) /* no op! */ ++#endif ++ ++#if defined(LUA_COMPAT_OPENLIB) ++#define luaI_openlib luaL_openlib ++#endif ++ ++ ++/* extra error code for `luaL_load' */ ++#define LUA_ERRFILE (LUA_ERRERR+1) ++ ++ ++typedef struct luaL_Reg { ++ const char *name; ++ lua_CFunction func; ++} luaL_Reg; ++ ++ ++ ++LUALIB_API void (luaI_openlib) (lua_State *L, const char *libname, ++ const luaL_Reg *l, int nup); ++LUALIB_API void (luaL_register) (lua_State *L, const char *libname, ++ const luaL_Reg *l); ++LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); ++LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); ++LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname); ++LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg); ++LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg, ++ size_t *l); ++LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg, ++ const char *def, size_t *l); ++LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg); ++LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def); ++ ++LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg); ++LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg, ++ lua_Integer def); ++ ++LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg); ++LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t); ++LUALIB_API void (luaL_checkany) (lua_State *L, int narg); ++ ++LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname); ++LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname); ++ ++LUALIB_API void (luaL_where) (lua_State *L, int lvl); ++LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); ++ ++LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def, ++ const char *const lst[]); ++ ++LUALIB_API int (luaL_ref) (lua_State *L, int t); ++LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); ++ ++#if !defined(__KERNEL__) ++LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename); ++#endif ++ ++LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz, ++ const char *name); ++LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); ++ ++LUALIB_API lua_State *(luaL_newstate) (void); ++ ++ ++LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, ++ const char *r); ++ ++LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx, ++ const char *fname, int szhint); ++ ++ ++ ++ ++/* ++** =============================================================== ++** some useful macros ++** =============================================================== ++*/ ++ ++#define luaL_argcheck(L, cond,numarg,extramsg) \ ++ ((void)((cond) || luaL_argerror(L, (numarg), (extramsg)))) ++#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) ++#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) ++#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) ++#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) ++#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n))) ++#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d))) ++ ++#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i))) ++ ++#if !defined(__KERNEL__) ++#define luaL_dofile(L, fn) \ ++ (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0)) ++#endif ++ ++#define luaL_dostring(L, s) \ ++ (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0)) ++ ++#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n))) ++ ++#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) ++ ++/* ++** {====================================================== ++** Generic Buffer manipulation ++** ======================================================= ++*/ ++ ++ ++ ++typedef struct luaL_Buffer { ++ char *p; /* current position in buffer */ ++ int lvl; /* number of strings in the stack (level) */ ++ lua_State *L; ++ char buffer[LUAL_BUFFERSIZE]; ++} luaL_Buffer; ++ ++#define luaL_addchar(B,c) \ ++ ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \ ++ (*(B)->p++ = (char)(c))) ++ ++/* compatibility only */ ++#define luaL_putchar(B,c) luaL_addchar(B,c) ++ ++#define luaL_addsize(B,n) ((B)->p += (n)) ++ ++ ++LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B); ++LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B); ++LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l); ++LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s); ++LUALIB_API void (luaL_addvalue) (luaL_Buffer *B); ++LUALIB_API void (luaL_pushresult) (luaL_Buffer *B); ++ ++ ++/* }====================================================== */ ++ ++ ++/* compatibility with ref system */ ++ ++/* pre-defined references */ ++#define LUA_NOREF (-2) ++#define LUA_REFNIL (-1) ++ ++#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ ++ (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0)) ++ ++#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) ++ ++#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref)) ++ ++ ++#define luaL_reg luaL_Reg ++ ++#endif ++ ++ +--- /dev/null ++++ b/extensions/LUA/lua/lbaselib.c +@@ -0,0 +1,647 @@ ++/* ++** $Id: lbaselib.c,v 1.191.1.6 2008/02/14 16:46:22 roberto Exp $ ++** Basic library ++** See Copyright Notice in lua.h ++*/ ++ ++ ++#include ++#include ++#include ++ ++#define lbaselib_c ++#define LUA_LIB ++ ++#include "lua.h" ++ ++#include "lauxlib.h" ++#include "lualib.h" ++ ++ ++ ++ ++/* ++** If your system does not support `stdout', you can just remove this function. ++** If you need, you can define your own `print' function, following this ++** model but changing `fputs' to put the strings at a proper place ++** (a console window or a log file, for instance). ++*/ ++static int luaB_print (lua_State *L) { ++ int n = lua_gettop(L); /* number of arguments */ ++ int i; ++ lua_getglobal(L, "tostring"); ++ for (i=1; i<=n; i++) { ++ const char *s; ++ lua_pushvalue(L, -1); /* function to be called */ ++ lua_pushvalue(L, i); /* value to print */ ++ lua_call(L, 1, 1); ++ s = lua_tostring(L, -1); /* get result */ ++ if (s == NULL) ++ return luaL_error(L, LUA_QL("tostring") " must return a string to " ++ LUA_QL("print")); ++ printk(KERN_INFO "LUA[print]: %s", s); ++ lua_pop(L, 1); /* pop result */ ++ } ++ return 0; ++} ++ ++ ++static int luaB_tonumber (lua_State *L) { ++ int base = luaL_optint(L, 2, 10); ++ if (base == 10) { /* standard conversion */ ++ luaL_checkany(L, 1); ++ if (lua_isnumber(L, 1)) { ++ lua_pushnumber(L, lua_tonumber(L, 1)); ++ return 1; ++ } ++ } ++ else { ++ const char *s1 = luaL_checkstring(L, 1); ++ char *s2; ++ unsigned long n; ++ luaL_argcheck(L, 2 <= base && base <= 36, 2, "base out of range"); ++ n = simple_strtoul(s1, &s2, base); ++ if (s1 != s2) { /* at least one valid digit? */ ++ while (isspace((unsigned char)(*s2))) s2++; /* skip trailing spaces */ ++ if (*s2 == '\0') { /* no invalid trailing characters? */ ++ lua_pushnumber(L, (lua_Number)n); ++ return 1; ++ } ++ } ++ } ++ lua_pushnil(L); /* else not a number */ ++ return 1; ++} ++ ++ ++static int luaB_error (lua_State *L) { ++ int level = luaL_optint(L, 2, 1); ++ lua_settop(L, 1); ++ if (lua_isstring(L, 1) && level > 0) { /* add extra information? */ ++ luaL_where(L, level); ++ lua_pushvalue(L, 1); ++ lua_concat(L, 2); ++ } ++ return lua_error(L); ++} ++ ++ ++static int luaB_getmetatable (lua_State *L) { ++ luaL_checkany(L, 1); ++ if (!lua_getmetatable(L, 1)) { ++ lua_pushnil(L); ++ return 1; /* no metatable */ ++ } ++ luaL_getmetafield(L, 1, "__metatable"); ++ return 1; /* returns either __metatable field (if present) or metatable */ ++} ++ ++ ++static int luaB_setmetatable (lua_State *L) { ++ int t = lua_type(L, 2); ++ luaL_checktype(L, 1, LUA_TTABLE); ++ luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, ++ "nil or table expected"); ++ if (luaL_getmetafield(L, 1, "__metatable")) ++ luaL_error(L, "cannot change a protected metatable"); ++ lua_settop(L, 2); ++ lua_setmetatable(L, 1); ++ return 1; ++} ++ ++ ++static void getfunc (lua_State *L, int opt) { ++ if (lua_isfunction(L, 1)) lua_pushvalue(L, 1); ++ else { ++ lua_Debug ar; ++ int level = opt ? luaL_optint(L, 1, 1) : luaL_checkint(L, 1); ++ luaL_argcheck(L, level >= 0, 1, "level must be non-negative"); ++ if (lua_getstack(L, level, &ar) == 0) ++ luaL_argerror(L, 1, "invalid level"); ++ lua_getinfo(L, "f", &ar); ++ if (lua_isnil(L, -1)) ++ luaL_error(L, "no function environment for tail call at level %d", ++ level); ++ } ++} ++ ++ ++static int luaB_getfenv (lua_State *L) { ++ getfunc(L, 1); ++ if (lua_iscfunction(L, -1)) /* is a C function? */ ++ lua_pushvalue(L, LUA_GLOBALSINDEX); /* return the thread's global env. */ ++ else ++ lua_getfenv(L, -1); ++ return 1; ++} ++ ++ ++static int luaB_setfenv (lua_State *L) { ++ luaL_checktype(L, 2, LUA_TTABLE); ++ getfunc(L, 0); ++ lua_pushvalue(L, 2); ++ if (lua_isnumber(L, 1) && lua_tonumber(L, 1) == 0) { ++ /* change environment of current thread */ ++ lua_pushthread(L); ++ lua_insert(L, -2); ++ lua_setfenv(L, -2); ++ return 0; ++ } ++ else if (lua_iscfunction(L, -2) || lua_setfenv(L, -2) == 0) ++ luaL_error(L, ++ LUA_QL("setfenv") " cannot change environment of given object"); ++ return 1; ++} ++ ++ ++static int luaB_rawequal (lua_State *L) { ++ luaL_checkany(L, 1); ++ luaL_checkany(L, 2); ++ lua_pushboolean(L, lua_rawequal(L, 1, 2)); ++ return 1; ++} ++ ++ ++static int luaB_rawget (lua_State *L) { ++ luaL_checktype(L, 1, LUA_TTABLE); ++ luaL_checkany(L, 2); ++ lua_settop(L, 2); ++ lua_rawget(L, 1); ++ return 1; ++} ++ ++static int luaB_rawset (lua_State *L) { ++ luaL_checktype(L, 1, LUA_TTABLE); ++ luaL_checkany(L, 2); ++ luaL_checkany(L, 3); ++ lua_settop(L, 3); ++ lua_rawset(L, 1); ++ return 1; ++} ++ ++ ++static int luaB_gcinfo (lua_State *L) { ++ lua_pushinteger(L, lua_getgccount(L)); ++ return 1; ++} ++ ++static int luaB_collectgarbage (lua_State *L) { ++ static const char *const opts[] = {"stop", "restart", "collect", ++ "count", "step", "setpause", "setstepmul", NULL}; ++ static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, ++ LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL}; ++ int o = luaL_checkoption(L, 1, "collect", opts); ++ int ex = luaL_optint(L, 2, 0); ++ int res = lua_gc(L, optsnum[o], ex); ++ switch (optsnum[o]) { ++ case LUA_GCCOUNT: { ++ int b = lua_gc(L, LUA_GCCOUNTB, 0); ++ lua_pushnumber(L, res + ((lua_Number)b/1024)); ++ return 1; ++ } ++ case LUA_GCSTEP: { ++ lua_pushboolean(L, res); ++ return 1; ++ } ++ default: { ++ lua_pushnumber(L, res); ++ return 1; ++ } ++ } ++} ++ ++ ++static int luaB_type (lua_State *L) { ++ luaL_checkany(L, 1); ++ lua_pushstring(L, luaL_typename(L, 1)); ++ return 1; ++} ++ ++ ++static int luaB_next (lua_State *L) { ++ luaL_checktype(L, 1, LUA_TTABLE); ++ lua_settop(L, 2); /* create a 2nd argument if there isn't one */ ++ if (lua_next(L, 1)) ++ return 2; ++ else { ++ lua_pushnil(L); ++ return 1; ++ } ++} ++ ++ ++static int luaB_pairs (lua_State *L) { ++ luaL_checktype(L, 1, LUA_TTABLE); ++ lua_pushvalue(L, lua_upvalueindex(1)); /* return generator, */ ++ lua_pushvalue(L, 1); /* state, */ ++ lua_pushnil(L); /* and initial value */ ++ return 3; ++} ++ ++ ++static int ipairsaux (lua_State *L) { ++ int i = luaL_checkint(L, 2); ++ luaL_checktype(L, 1, LUA_TTABLE); ++ i++; /* next value */ ++ lua_pushinteger(L, i); ++ lua_rawgeti(L, 1, i); ++ return (lua_isnil(L, -1)) ? 0 : 2; ++} ++ ++ ++static int luaB_ipairs (lua_State *L) { ++ luaL_checktype(L, 1, LUA_TTABLE); ++ lua_pushvalue(L, lua_upvalueindex(1)); /* return generator, */ ++ lua_pushvalue(L, 1); /* state, */ ++ lua_pushinteger(L, 0); /* and initial value */ ++ return 3; ++} ++ ++ ++static int load_aux (lua_State *L, int status) { ++ if (status == 0) /* OK? */ ++ return 1; ++ else { ++ lua_pushnil(L); ++ lua_insert(L, -2); /* put before error message */ ++ return 2; /* return nil plus error message */ ++ } ++} ++ ++ ++static int luaB_loadstring (lua_State *L) { ++ size_t l; ++ const char *s = luaL_checklstring(L, 1, &l); ++ const char *chunkname = luaL_optstring(L, 2, s); ++ return load_aux(L, luaL_loadbuffer(L, s, l, chunkname)); ++} ++ ++/* ++static int luaB_loadfile (lua_State *L) { ++ const char *fname = luaL_optstring(L, 1, NULL); ++ return load_aux(L, luaL_loadfile(L, fname)); ++} ++*/ ++ ++/* ++** Reader for generic `load' function: `lua_load' uses the ++** stack for internal stuff, so the reader cannot change the ++** stack top. Instead, it keeps its resulting string in a ++** reserved slot inside the stack. ++*/ ++static const char *generic_reader (lua_State *L, void *ud, size_t *size) { ++ (void)ud; /* to avoid warnings */ ++ luaL_checkstack(L, 2, "too many nested functions"); ++ lua_pushvalue(L, 1); /* get function */ ++ lua_call(L, 0, 1); /* call it */ ++ if (lua_isnil(L, -1)) { ++ *size = 0; ++ return NULL; ++ } ++ else if (lua_isstring(L, -1)) { ++ lua_replace(L, 3); /* save string in a reserved stack slot */ ++ return lua_tolstring(L, 3, size); ++ } ++ else luaL_error(L, "reader function must return a string"); ++ return NULL; /* to avoid warnings */ ++} ++ ++ ++static int luaB_load (lua_State *L) { ++ int status; ++ const char *cname = luaL_optstring(L, 2, "=(load)"); ++ luaL_checktype(L, 1, LUA_TFUNCTION); ++ lua_settop(L, 3); /* function, eventual name, plus one reserved slot */ ++ status = lua_load(L, generic_reader, NULL, cname); ++ return load_aux(L, status); ++} ++ ++/* ++static int luaB_dofile (lua_State *L) { ++ const char *fname = luaL_optstring(L, 1, NULL); ++ int n = lua_gettop(L); ++ if (luaL_loadfile(L, fname) != 0) lua_error(L); ++ lua_call(L, 0, LUA_MULTRET); ++ return lua_gettop(L) - n; ++} ++*/ ++ ++static int luaB_assert (lua_State *L) { ++ luaL_checkany(L, 1); ++ if (!lua_toboolean(L, 1)) ++ return luaL_error(L, "%s", luaL_optstring(L, 2, "assertion failed!")); ++ return lua_gettop(L); ++} ++ ++ ++static int luaB_unpack (lua_State *L) { ++ int i, e, n; ++ luaL_checktype(L, 1, LUA_TTABLE); ++ i = luaL_optint(L, 2, 1); ++ e = luaL_opt(L, luaL_checkint, 3, luaL_getn(L, 1)); ++ if (i > e) return 0; /* empty range */ ++ n = e - i + 1; /* number of elements */ ++ if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */ ++ return luaL_error(L, "too many results to unpack"); ++ lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */ ++ while (i++ < e) /* push arg[i + 1...e] */ ++ lua_rawgeti(L, 1, i); ++ return n; ++} ++ ++ ++static int luaB_select (lua_State *L) { ++ int n = lua_gettop(L); ++ if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') { ++ lua_pushinteger(L, n-1); ++ return 1; ++ } ++ else { ++ int i = luaL_checkint(L, 1); ++ if (i < 0) i = n + i; ++ else if (i > n) i = n; ++ luaL_argcheck(L, 1 <= i, 1, "index out of range"); ++ return n - i; ++ } ++} ++ ++ ++static int luaB_pcall (lua_State *L) { ++ int status; ++ luaL_checkany(L, 1); ++ status = lua_pcall(L, lua_gettop(L) - 1, LUA_MULTRET, 0); ++ lua_pushboolean(L, (status == 0)); ++ lua_insert(L, 1); ++ return lua_gettop(L); /* return status + all results */ ++} ++ ++ ++static int luaB_xpcall (lua_State *L) { ++ int status; ++ luaL_checkany(L, 2); ++ lua_settop(L, 2); ++ lua_insert(L, 1); /* put error function under function to be called */ ++ status = lua_pcall(L, 0, LUA_MULTRET, 1); ++ lua_pushboolean(L, (status == 0)); ++ lua_replace(L, 1); ++ return lua_gettop(L); /* return status + all results */ ++} ++ ++ ++static int luaB_tostring (lua_State *L) { ++ luaL_checkany(L, 1); ++ if (luaL_callmeta(L, 1, "__tostring")) /* is there a metafield? */ ++ return 1; /* use its value */ ++ switch (lua_type(L, 1)) { ++ case LUA_TNUMBER: ++ lua_pushstring(L, lua_tostring(L, 1)); ++ break; ++ case LUA_TSTRING: ++ lua_pushvalue(L, 1); ++ break; ++ case LUA_TBOOLEAN: ++ lua_pushstring(L, (lua_toboolean(L, 1) ? "true" : "false")); ++ break; ++ case LUA_TNIL: ++ lua_pushliteral(L, "nil"); ++ break; ++ default: ++ lua_pushfstring(L, "%s: %p", luaL_typename(L, 1), lua_topointer(L, 1)); ++ break; ++ } ++ return 1; ++} ++ ++ ++static int luaB_newproxy (lua_State *L) { ++ lua_settop(L, 1); ++ lua_newuserdata(L, 0); /* create proxy */ ++ if (lua_toboolean(L, 1) == 0) ++ return 1; /* no metatable */ ++ else if (lua_isboolean(L, 1)) { ++ lua_newtable(L); /* create a new metatable `m' ... */ ++ lua_pushvalue(L, -1); /* ... and mark `m' as a valid metatable */ ++ lua_pushboolean(L, 1); ++ lua_rawset(L, lua_upvalueindex(1)); /* weaktable[m] = true */ ++ } ++ else { ++ int validproxy = 0; /* to check if weaktable[metatable(u)] == true */ ++ if (lua_getmetatable(L, 1)) { ++ lua_rawget(L, lua_upvalueindex(1)); ++ validproxy = lua_toboolean(L, -1); ++ lua_pop(L, 1); /* remove value */ ++ } ++ luaL_argcheck(L, validproxy, 1, "boolean or proxy expected"); ++ lua_getmetatable(L, 1); /* metatable is valid; get it */ ++ } ++ lua_setmetatable(L, 2); ++ return 1; ++} ++ ++ ++static const luaL_Reg base_funcs[] = { ++ {"assert", luaB_assert}, ++ {"collectgarbage", luaB_collectgarbage}, ++// {"dofile", luaB_dofile}, ++ {"error", luaB_error}, ++ {"gcinfo", luaB_gcinfo}, ++ {"getfenv", luaB_getfenv}, ++ {"getmetatable", luaB_getmetatable}, ++// {"loadfile", luaB_loadfile}, ++ {"load", luaB_load}, ++ {"loadstring", luaB_loadstring}, ++ {"next", luaB_next}, ++ {"pcall", luaB_pcall}, ++ {"print", luaB_print}, ++ {"rawequal", luaB_rawequal}, ++ {"rawget", luaB_rawget}, ++ {"rawset", luaB_rawset}, ++ {"select", luaB_select}, ++ {"setfenv", luaB_setfenv}, ++ {"setmetatable", luaB_setmetatable}, ++ {"tonumber", luaB_tonumber}, ++ {"tostring", luaB_tostring}, ++ {"type", luaB_type}, ++ {"unpack", luaB_unpack}, ++ {"xpcall", luaB_xpcall}, ++ {NULL, NULL} ++}; ++ ++ ++/* ++** {====================================================== ++** Coroutine library ++** ======================================================= ++*/ ++ ++#define CO_RUN 0 /* running */ ++#define CO_SUS 1 /* suspended */ ++#define CO_NOR 2 /* 'normal' (it resumed another coroutine) */ ++#define CO_DEAD 3 ++ ++static const char *const statnames[] = ++ {"running", "suspended", "normal", "dead"}; ++ ++static int costatus (lua_State *L, lua_State *co) { ++ if (L == co) return CO_RUN; ++ switch (lua_status(co)) { ++ case LUA_YIELD: ++ return CO_SUS; ++ case 0: { ++ lua_Debug ar; ++ if (lua_getstack(co, 0, &ar) > 0) /* does it have frames? */ ++ return CO_NOR; /* it is running */ ++ else if (lua_gettop(co) == 0) ++ return CO_DEAD; ++ else ++ return CO_SUS; /* initial state */ ++ } ++ default: /* some error occured */ ++ return CO_DEAD; ++ } ++} ++ ++ ++static int luaB_costatus (lua_State *L) { ++ lua_State *co = lua_tothread(L, 1); ++ luaL_argcheck(L, co, 1, "coroutine expected"); ++ lua_pushstring(L, statnames[costatus(L, co)]); ++ return 1; ++} ++ ++ ++static int auxresume (lua_State *L, lua_State *co, int narg) { ++ int status = costatus(L, co); ++ if (!lua_checkstack(co, narg)) ++ luaL_error(L, "too many arguments to resume"); ++ if (status != CO_SUS) { ++ lua_pushfstring(L, "cannot resume %s coroutine", statnames[status]); ++ return -1; /* error flag */ ++ } ++ lua_xmove(L, co, narg); ++ lua_setlevel(L, co); ++ status = lua_resume(co, narg); ++ if (status == 0 || status == LUA_YIELD) { ++ int nres = lua_gettop(co); ++ if (!lua_checkstack(L, nres + 1)) ++ luaL_error(L, "too many results to resume"); ++ lua_xmove(co, L, nres); /* move yielded values */ ++ return nres; ++ } ++ else { ++ lua_xmove(co, L, 1); /* move error message */ ++ return -1; /* error flag */ ++ } ++} ++ ++ ++static int luaB_coresume (lua_State *L) { ++ lua_State *co = lua_tothread(L, 1); ++ int r; ++ luaL_argcheck(L, co, 1, "coroutine expected"); ++ r = auxresume(L, co, lua_gettop(L) - 1); ++ if (r < 0) { ++ lua_pushboolean(L, 0); ++ lua_insert(L, -2); ++ return 2; /* return false + error message */ ++ } ++ else { ++ lua_pushboolean(L, 1); ++ lua_insert(L, -(r + 1)); ++ return r + 1; /* return true + `resume' returns */ ++ } ++} ++ ++ ++static int luaB_auxwrap (lua_State *L) { ++ lua_State *co = lua_tothread(L, lua_upvalueindex(1)); ++ int r = auxresume(L, co, lua_gettop(L)); ++ if (r < 0) { ++ if (lua_isstring(L, -1)) { /* error object is a string? */ ++ luaL_where(L, 1); /* add extra info */ ++ lua_insert(L, -2); ++ lua_concat(L, 2); ++ } ++ lua_error(L); /* propagate error */ ++ } ++ return r; ++} ++ ++ ++static int luaB_cocreate (lua_State *L) { ++ lua_State *NL = lua_newthread(L); ++ luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1, ++ "Lua function expected"); ++ lua_pushvalue(L, 1); /* move function to top */ ++ lua_xmove(L, NL, 1); /* move function from L to NL */ ++ return 1; ++} ++ ++ ++static int luaB_cowrap (lua_State *L) { ++ luaB_cocreate(L); ++ lua_pushcclosure(L, luaB_auxwrap, 1); ++ return 1; ++} ++ ++ ++static int luaB_yield (lua_State *L) { ++ return lua_yield(L, lua_gettop(L)); ++} ++ ++ ++static int luaB_corunning (lua_State *L) { ++ if (lua_pushthread(L)) ++ lua_pushnil(L); /* main thread is not a coroutine */ ++ return 1; ++} ++ ++ ++static const luaL_Reg co_funcs[] = { ++ {"create", luaB_cocreate}, ++ {"resume", luaB_coresume}, ++ {"running", luaB_corunning}, ++ {"status", luaB_costatus}, ++ {"wrap", luaB_cowrap}, ++ {"yield", luaB_yield}, ++ {NULL, NULL} ++}; ++ ++/* }====================================================== */ ++ ++ ++static void auxopen (lua_State *L, const char *name, ++ lua_CFunction f, lua_CFunction u) { ++ lua_pushcfunction(L, u); ++ lua_pushcclosure(L, f, 1); ++ lua_setfield(L, -2, name); ++} ++ ++ ++static void base_open (lua_State *L) { ++ /* set global _G */ ++ lua_pushvalue(L, LUA_GLOBALSINDEX); ++ lua_setglobal(L, "_G"); ++ /* open lib into global table */ ++ luaL_register(L, "_G", base_funcs); ++ lua_pushliteral(L, LUA_VERSION); ++ lua_setglobal(L, "_VERSION"); /* set global _VERSION */ ++ /* `ipairs' and `pairs' need auxliliary functions as upvalues */ ++ auxopen(L, "ipairs", luaB_ipairs, ipairsaux); ++ auxopen(L, "pairs", luaB_pairs, luaB_next); ++ /* `newproxy' needs a weaktable as upvalue */ ++ lua_createtable(L, 0, 1); /* new table `w' */ ++ lua_pushvalue(L, -1); /* `w' will be its own metatable */ ++ lua_setmetatable(L, -2); ++ lua_pushliteral(L, "kv"); ++ lua_setfield(L, -2, "__mode"); /* metatable(w).__mode = "kv" */ ++ lua_pushcclosure(L, luaB_newproxy, 1); ++ lua_setglobal(L, "newproxy"); /* set global `newproxy' */ ++} ++ ++ ++LUALIB_API int luaopen_base (lua_State *L) { ++ base_open(L); ++ luaL_register(L, LUA_COLIBNAME, co_funcs); ++ return 2; ++} +--- /dev/null ++++ b/extensions/LUA/lua/lcode.c +@@ -0,0 +1,838 @@ ++/* ++** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $ ++** Code generator for Lua ++** See Copyright Notice in lua.h ++*/ ++ ++#include ++ ++#define lcode_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "lcode.h" ++#include "ldebug.h" ++#include "ldo.h" ++#include "lgc.h" ++#include "llex.h" ++#include "lmem.h" ++#include "lobject.h" ++#include "lopcodes.h" ++#include "lparser.h" ++#include "ltable.h" ++ ++ ++#define hasjumps(e) ((e)->t != (e)->f) ++ ++ ++static int isnumeral(expdesc *e) { ++ return (e->k == VKNUM && e->t == NO_JUMP && e->f == NO_JUMP); ++} ++ ++ ++void luaK_nil (FuncState *fs, int from, int n) { ++ Instruction *previous; ++ if (fs->pc > fs->lasttarget) { /* no jumps to current position? */ ++ if (fs->pc == 0) { /* function start? */ ++ if (from >= fs->nactvar) ++ return; /* positions are already clean */ ++ } ++ else { ++ previous = &fs->f->code[fs->pc-1]; ++ if (GET_OPCODE(*previous) == OP_LOADNIL) { ++ int pfrom = GETARG_A(*previous); ++ int pto = GETARG_B(*previous); ++ if (pfrom <= from && from <= pto+1) { /* can connect both? */ ++ if (from+n-1 > pto) ++ SETARG_B(*previous, from+n-1); ++ return; ++ } ++ } ++ } ++ } ++ luaK_codeABC(fs, OP_LOADNIL, from, from+n-1, 0); /* else no optimization */ ++} ++ ++ ++int luaK_jump (FuncState *fs) { ++ int jpc = fs->jpc; /* save list of jumps to here */ ++ int j; ++ fs->jpc = NO_JUMP; ++ j = luaK_codeAsBx(fs, OP_JMP, 0, NO_JUMP); ++ luaK_concat(fs, &j, jpc); /* keep them on hold */ ++ return j; ++} ++ ++ ++void luaK_ret (FuncState *fs, int first, int nret) { ++ luaK_codeABC(fs, OP_RETURN, first, nret+1, 0); ++} ++ ++ ++static int condjump (FuncState *fs, OpCode op, int A, int B, int C) { ++ luaK_codeABC(fs, op, A, B, C); ++ return luaK_jump(fs); ++} ++ ++ ++static void fixjump (FuncState *fs, int pc, int dest) { ++ Instruction *jmp = &fs->f->code[pc]; ++ int offset = dest-(pc+1); ++ lua_assert(dest != NO_JUMP); ++ if (abs(offset) > MAXARG_sBx) ++ luaX_syntaxerror(fs->ls, "control structure too long"); ++ SETARG_sBx(*jmp, offset); ++} ++ ++ ++/* ++** returns current `pc' and marks it as a jump target (to avoid wrong ++** optimizations with consecutive instructions not in the same basic block). ++*/ ++int luaK_getlabel (FuncState *fs) { ++ fs->lasttarget = fs->pc; ++ return fs->pc; ++} ++ ++ ++static int getjump (FuncState *fs, int pc) { ++ int offset = GETARG_sBx(fs->f->code[pc]); ++ if (offset == NO_JUMP) /* point to itself represents end of list */ ++ return NO_JUMP; /* end of list */ ++ else ++ return (pc+1)+offset; /* turn offset into absolute position */ ++} ++ ++ ++static Instruction *getjumpcontrol (FuncState *fs, int pc) { ++ Instruction *pi = &fs->f->code[pc]; ++ if (pc >= 1 && testTMode(GET_OPCODE(*(pi-1)))) ++ return pi-1; ++ else ++ return pi; ++} ++ ++ ++/* ++** check whether list has any jump that do not produce a value ++** (or produce an inverted value) ++*/ ++static int need_value (FuncState *fs, int list) { ++ for (; list != NO_JUMP; list = getjump(fs, list)) { ++ Instruction i = *getjumpcontrol(fs, list); ++ if (GET_OPCODE(i) != OP_TESTSET) return 1; ++ } ++ return 0; /* not found */ ++} ++ ++ ++static int patchtestreg (FuncState *fs, int node, int reg) { ++ Instruction *i = getjumpcontrol(fs, node); ++ if (GET_OPCODE(*i) != OP_TESTSET) ++ return 0; /* cannot patch other instructions */ ++ if (reg != NO_REG && reg != GETARG_B(*i)) ++ SETARG_A(*i, reg); ++ else /* no register to put value or register already has the value */ ++ *i = CREATE_ABC(OP_TEST, GETARG_B(*i), 0, GETARG_C(*i)); ++ ++ return 1; ++} ++ ++ ++static void removevalues (FuncState *fs, int list) { ++ for (; list != NO_JUMP; list = getjump(fs, list)) ++ patchtestreg(fs, list, NO_REG); ++} ++ ++ ++static void patchlistaux (FuncState *fs, int list, int vtarget, int reg, ++ int dtarget) { ++ while (list != NO_JUMP) { ++ int next = getjump(fs, list); ++ if (patchtestreg(fs, list, reg)) ++ fixjump(fs, list, vtarget); ++ else ++ fixjump(fs, list, dtarget); /* jump to default target */ ++ list = next; ++ } ++} ++ ++ ++static void dischargejpc (FuncState *fs) { ++ patchlistaux(fs, fs->jpc, fs->pc, NO_REG, fs->pc); ++ fs->jpc = NO_JUMP; ++} ++ ++ ++void luaK_patchlist (FuncState *fs, int list, int target) { ++ if (target == fs->pc) ++ luaK_patchtohere(fs, list); ++ else { ++ lua_assert(target < fs->pc); ++ patchlistaux(fs, list, target, NO_REG, target); ++ } ++} ++ ++ ++void luaK_patchtohere (FuncState *fs, int list) { ++ luaK_getlabel(fs); ++ luaK_concat(fs, &fs->jpc, list); ++} ++ ++ ++void luaK_concat (FuncState *fs, int *l1, int l2) { ++ if (l2 == NO_JUMP) return; ++ else if (*l1 == NO_JUMP) ++ *l1 = l2; ++ else { ++ int list = *l1; ++ int next; ++ while ((next = getjump(fs, list)) != NO_JUMP) /* find last element */ ++ list = next; ++ fixjump(fs, list, l2); ++ } ++} ++ ++ ++void luaK_checkstack (FuncState *fs, int n) { ++ int newstack = fs->freereg + n; ++ if (newstack > fs->f->maxstacksize) { ++ if (newstack >= MAXSTACK) ++ luaX_syntaxerror(fs->ls, "function or expression too complex"); ++ fs->f->maxstacksize = cast_byte(newstack); ++ } ++} ++ ++ ++void luaK_reserveregs (FuncState *fs, int n) { ++ luaK_checkstack(fs, n); ++ fs->freereg += n; ++} ++ ++ ++static void freereg (FuncState *fs, int reg) { ++ if (!ISK(reg) && reg >= fs->nactvar) { ++ fs->freereg--; ++ lua_assert(reg == fs->freereg); ++ } ++} ++ ++ ++static void freeexp (FuncState *fs, expdesc *e) { ++ if (e->k == VNONRELOC) ++ freereg(fs, e->u.s.info); ++} ++ ++ ++static int addk (FuncState *fs, TValue *k, TValue *v) { ++ lua_State *L = fs->L; ++ TValue *idx = luaH_set(L, fs->h, k); ++ Proto *f = fs->f; ++ int oldsize = f->sizek; ++ if (ttisnumber(idx)) { ++ lua_assert(luaO_rawequalObj(&fs->f->k[cast_int(nvalue(idx))], v)); ++ return cast_int(nvalue(idx)); ++ } ++ else { /* constant not found; create a new entry */ ++ setnvalue(idx, cast_num(fs->nk)); ++ luaM_growvector(L, f->k, fs->nk, f->sizek, TValue, ++ MAXARG_Bx, "constant table overflow"); ++ while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]); ++ setobj(L, &f->k[fs->nk], v); ++ luaC_barrier(L, f, v); ++ return fs->nk++; ++ } ++} ++ ++ ++int luaK_stringK (FuncState *fs, TString *s) { ++ TValue o; ++ setsvalue(fs->L, &o, s); ++ return addk(fs, &o, &o); ++} ++ ++ ++int luaK_numberK (FuncState *fs, lua_Number r) { ++ TValue o; ++ setnvalue(&o, r); ++ return addk(fs, &o, &o); ++} ++ ++ ++static int boolK (FuncState *fs, int b) { ++ TValue o; ++ setbvalue(&o, b); ++ return addk(fs, &o, &o); ++} ++ ++ ++static int nilK (FuncState *fs) { ++ TValue k, v; ++ setnilvalue(&v); ++ /* cannot use nil as key; instead use table itself to represent nil */ ++ sethvalue(fs->L, &k, fs->h); ++ return addk(fs, &k, &v); ++} ++ ++ ++void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) { ++ if (e->k == VCALL) { /* expression is an open function call? */ ++ SETARG_C(getcode(fs, e), nresults+1); ++ } ++ else if (e->k == VVARARG) { ++ SETARG_B(getcode(fs, e), nresults+1); ++ SETARG_A(getcode(fs, e), fs->freereg); ++ luaK_reserveregs(fs, 1); ++ } ++} ++ ++ ++void luaK_setoneret (FuncState *fs, expdesc *e) { ++ if (e->k == VCALL) { /* expression is an open function call? */ ++ e->k = VNONRELOC; ++ e->u.s.info = GETARG_A(getcode(fs, e)); ++ } ++ else if (e->k == VVARARG) { ++ SETARG_B(getcode(fs, e), 2); ++ e->k = VRELOCABLE; /* can relocate its simple result */ ++ } ++} ++ ++ ++void luaK_dischargevars (FuncState *fs, expdesc *e) { ++ switch (e->k) { ++ case VLOCAL: { ++ e->k = VNONRELOC; ++ break; ++ } ++ case VUPVAL: { ++ e->u.s.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.s.info, 0); ++ e->k = VRELOCABLE; ++ break; ++ } ++ case VGLOBAL: { ++ e->u.s.info = luaK_codeABx(fs, OP_GETGLOBAL, 0, e->u.s.info); ++ e->k = VRELOCABLE; ++ break; ++ } ++ case VINDEXED: { ++ freereg(fs, e->u.s.aux); ++ freereg(fs, e->u.s.info); ++ e->u.s.info = luaK_codeABC(fs, OP_GETTABLE, 0, e->u.s.info, e->u.s.aux); ++ e->k = VRELOCABLE; ++ break; ++ } ++ case VVARARG: ++ case VCALL: { ++ luaK_setoneret(fs, e); ++ break; ++ } ++ default: break; /* there is one value available (somewhere) */ ++ } ++} ++ ++ ++static int code_label (FuncState *fs, int A, int b, int jump) { ++ luaK_getlabel(fs); /* those instructions may be jump targets */ ++ return luaK_codeABC(fs, OP_LOADBOOL, A, b, jump); ++} ++ ++ ++static void discharge2reg (FuncState *fs, expdesc *e, int reg) { ++ luaK_dischargevars(fs, e); ++ switch (e->k) { ++ case VNIL: { ++ luaK_nil(fs, reg, 1); ++ break; ++ } ++ case VFALSE: case VTRUE: { ++ luaK_codeABC(fs, OP_LOADBOOL, reg, e->k == VTRUE, 0); ++ break; ++ } ++ case VK: { ++ luaK_codeABx(fs, OP_LOADK, reg, e->u.s.info); ++ break; ++ } ++ case VKNUM: { ++ luaK_codeABx(fs, OP_LOADK, reg, luaK_numberK(fs, e->u.nval)); ++ break; ++ } ++ case VRELOCABLE: { ++ Instruction *pc = &getcode(fs, e); ++ SETARG_A(*pc, reg); ++ break; ++ } ++ case VNONRELOC: { ++ if (reg != e->u.s.info) ++ luaK_codeABC(fs, OP_MOVE, reg, e->u.s.info, 0); ++ break; ++ } ++ default: { ++ lua_assert(e->k == VVOID || e->k == VJMP); ++ return; /* nothing to do... */ ++ } ++ } ++ e->u.s.info = reg; ++ e->k = VNONRELOC; ++} ++ ++ ++static void discharge2anyreg (FuncState *fs, expdesc *e) { ++ if (e->k != VNONRELOC) { ++ luaK_reserveregs(fs, 1); ++ discharge2reg(fs, e, fs->freereg-1); ++ } ++} ++ ++ ++static void exp2reg (FuncState *fs, expdesc *e, int reg) { ++ discharge2reg(fs, e, reg); ++ if (e->k == VJMP) ++ luaK_concat(fs, &e->t, e->u.s.info); /* put this jump in `t' list */ ++ if (hasjumps(e)) { ++ int final; /* position after whole expression */ ++ int p_f = NO_JUMP; /* position of an eventual LOAD false */ ++ int p_t = NO_JUMP; /* position of an eventual LOAD true */ ++ if (need_value(fs, e->t) || need_value(fs, e->f)) { ++ int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs); ++ p_f = code_label(fs, reg, 0, 1); ++ p_t = code_label(fs, reg, 1, 0); ++ luaK_patchtohere(fs, fj); ++ } ++ final = luaK_getlabel(fs); ++ patchlistaux(fs, e->f, final, reg, p_f); ++ patchlistaux(fs, e->t, final, reg, p_t); ++ } ++ e->f = e->t = NO_JUMP; ++ e->u.s.info = reg; ++ e->k = VNONRELOC; ++} ++ ++ ++void luaK_exp2nextreg (FuncState *fs, expdesc *e) { ++ luaK_dischargevars(fs, e); ++ freeexp(fs, e); ++ luaK_reserveregs(fs, 1); ++ exp2reg(fs, e, fs->freereg - 1); ++} ++ ++ ++int luaK_exp2anyreg (FuncState *fs, expdesc *e) { ++ luaK_dischargevars(fs, e); ++ if (e->k == VNONRELOC) { ++ if (!hasjumps(e)) return e->u.s.info; /* exp is already in a register */ ++ if (e->u.s.info >= fs->nactvar) { /* reg. is not a local? */ ++ exp2reg(fs, e, e->u.s.info); /* put value on it */ ++ return e->u.s.info; ++ } ++ } ++ luaK_exp2nextreg(fs, e); /* default */ ++ return e->u.s.info; ++} ++ ++ ++void luaK_exp2val (FuncState *fs, expdesc *e) { ++ if (hasjumps(e)) ++ luaK_exp2anyreg(fs, e); ++ else ++ luaK_dischargevars(fs, e); ++} ++ ++ ++int luaK_exp2RK (FuncState *fs, expdesc *e) { ++ luaK_exp2val(fs, e); ++ switch (e->k) { ++ case VKNUM: ++ case VTRUE: ++ case VFALSE: ++ case VNIL: { ++ if (fs->nk <= MAXINDEXRK) { /* constant fit in RK operand? */ ++ e->u.s.info = (e->k == VNIL) ? nilK(fs) : ++ (e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) : ++ boolK(fs, (e->k == VTRUE)); ++ e->k = VK; ++ return RKASK(e->u.s.info); ++ } ++ else break; ++ } ++ case VK: { ++ if (e->u.s.info <= MAXINDEXRK) /* constant fit in argC? */ ++ return RKASK(e->u.s.info); ++ else break; ++ } ++ default: break; ++ } ++ /* not a constant in the right range: put it in a register */ ++ return luaK_exp2anyreg(fs, e); ++} ++ ++ ++void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) { ++ switch (var->k) { ++ case VLOCAL: { ++ freeexp(fs, ex); ++ exp2reg(fs, ex, var->u.s.info); ++ return; ++ } ++ case VUPVAL: { ++ int e = luaK_exp2anyreg(fs, ex); ++ luaK_codeABC(fs, OP_SETUPVAL, e, var->u.s.info, 0); ++ break; ++ } ++ case VGLOBAL: { ++ int e = luaK_exp2anyreg(fs, ex); ++ luaK_codeABx(fs, OP_SETGLOBAL, e, var->u.s.info); ++ break; ++ } ++ case VINDEXED: { ++ int e = luaK_exp2RK(fs, ex); ++ luaK_codeABC(fs, OP_SETTABLE, var->u.s.info, var->u.s.aux, e); ++ break; ++ } ++ default: { ++ lua_assert(0); /* invalid var kind to store */ ++ break; ++ } ++ } ++ freeexp(fs, ex); ++} ++ ++ ++void luaK_self (FuncState *fs, expdesc *e, expdesc *key) { ++ int func; ++ luaK_exp2anyreg(fs, e); ++ freeexp(fs, e); ++ func = fs->freereg; ++ luaK_reserveregs(fs, 2); ++ luaK_codeABC(fs, OP_SELF, func, e->u.s.info, luaK_exp2RK(fs, key)); ++ freeexp(fs, key); ++ e->u.s.info = func; ++ e->k = VNONRELOC; ++} ++ ++ ++static void invertjump (FuncState *fs, expdesc *e) { ++ Instruction *pc = getjumpcontrol(fs, e->u.s.info); ++ lua_assert(testTMode(GET_OPCODE(*pc)) && GET_OPCODE(*pc) != OP_TESTSET && ++ GET_OPCODE(*pc) != OP_TEST); ++ SETARG_A(*pc, !(GETARG_A(*pc))); ++} ++ ++ ++static int jumponcond (FuncState *fs, expdesc *e, int cond) { ++ if (e->k == VRELOCABLE) { ++ Instruction ie = getcode(fs, e); ++ if (GET_OPCODE(ie) == OP_NOT) { ++ fs->pc--; /* remove previous OP_NOT */ ++ return condjump(fs, OP_TEST, GETARG_B(ie), 0, !cond); ++ } ++ /* else go through */ ++ } ++ discharge2anyreg(fs, e); ++ freeexp(fs, e); ++ return condjump(fs, OP_TESTSET, NO_REG, e->u.s.info, cond); ++} ++ ++ ++void luaK_goiftrue (FuncState *fs, expdesc *e) { ++ int pc; /* pc of last jump */ ++ luaK_dischargevars(fs, e); ++ switch (e->k) { ++ case VK: case VKNUM: case VTRUE: { ++ pc = NO_JUMP; /* always true; do nothing */ ++ break; ++ } ++ case VFALSE: { ++ pc = luaK_jump(fs); /* always jump */ ++ break; ++ } ++ case VJMP: { ++ invertjump(fs, e); ++ pc = e->u.s.info; ++ break; ++ } ++ default: { ++ pc = jumponcond(fs, e, 0); ++ break; ++ } ++ } ++ luaK_concat(fs, &e->f, pc); /* insert last jump in `f' list */ ++ luaK_patchtohere(fs, e->t); ++ e->t = NO_JUMP; ++} ++ ++ ++static void luaK_goiffalse (FuncState *fs, expdesc *e) { ++ int pc; /* pc of last jump */ ++ luaK_dischargevars(fs, e); ++ switch (e->k) { ++ case VNIL: case VFALSE: { ++ pc = NO_JUMP; /* always false; do nothing */ ++ break; ++ } ++ case VTRUE: { ++ pc = luaK_jump(fs); /* always jump */ ++ break; ++ } ++ case VJMP: { ++ pc = e->u.s.info; ++ break; ++ } ++ default: { ++ pc = jumponcond(fs, e, 1); ++ break; ++ } ++ } ++ luaK_concat(fs, &e->t, pc); /* insert last jump in `t' list */ ++ luaK_patchtohere(fs, e->f); ++ e->f = NO_JUMP; ++} ++ ++ ++static void codenot (FuncState *fs, expdesc *e) { ++ luaK_dischargevars(fs, e); ++ switch (e->k) { ++ case VNIL: case VFALSE: { ++ e->k = VTRUE; ++ break; ++ } ++ case VK: case VKNUM: case VTRUE: { ++ e->k = VFALSE; ++ break; ++ } ++ case VJMP: { ++ invertjump(fs, e); ++ break; ++ } ++ case VRELOCABLE: ++ case VNONRELOC: { ++ discharge2anyreg(fs, e); ++ freeexp(fs, e); ++ e->u.s.info = luaK_codeABC(fs, OP_NOT, 0, e->u.s.info, 0); ++ e->k = VRELOCABLE; ++ break; ++ } ++ default: { ++ lua_assert(0); /* cannot happen */ ++ break; ++ } ++ } ++ /* interchange true and false lists */ ++ { int temp = e->f; e->f = e->t; e->t = temp; } ++ removevalues(fs, e->f); ++ removevalues(fs, e->t); ++} ++ ++ ++void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { ++ t->u.s.aux = luaK_exp2RK(fs, k); ++ t->k = VINDEXED; ++} ++ ++ ++static int constfolding (OpCode op, expdesc *e1, expdesc *e2) { ++ lua_Number v1, v2, r; ++ if (!isnumeral(e1) || !isnumeral(e2)) return 0; ++ v1 = e1->u.nval; ++ v2 = e2->u.nval; ++ switch (op) { ++ case OP_ADD: r = luai_numadd(v1, v2); break; ++ case OP_SUB: r = luai_numsub(v1, v2); break; ++ case OP_MUL: r = luai_nummul(v1, v2); break; ++ case OP_DIV: ++ if (v2 == 0) return 0; /* do not attempt to divide by 0 */ ++ r = luai_numdiv(v1, v2); break; ++ case OP_MOD: ++ if (v2 == 0) return 0; /* do not attempt to divide by 0 */ ++ r = luai_nummod(v1, v2); break; ++ case OP_POW: r = luai_numpow(v1, v2); break; ++ case OP_UNM: r = luai_numunm(v1); break; ++ case OP_LEN: return 0; /* no constant folding for 'len' */ ++ default: lua_assert(0); r = 0; break; ++ } ++ if (luai_numisnan(r)) return 0; /* do not attempt to produce NaN */ ++ e1->u.nval = r; ++ return 1; ++} ++ ++ ++static void codearith (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) { ++ if (constfolding(op, e1, e2)) ++ return; ++ else { ++ int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0; ++ int o1 = luaK_exp2RK(fs, e1); ++ if (o1 > o2) { ++ freeexp(fs, e1); ++ freeexp(fs, e2); ++ } ++ else { ++ freeexp(fs, e2); ++ freeexp(fs, e1); ++ } ++ e1->u.s.info = luaK_codeABC(fs, op, 0, o1, o2); ++ e1->k = VRELOCABLE; ++ } ++} ++ ++ ++static void codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1, ++ expdesc *e2) { ++ int o1 = luaK_exp2RK(fs, e1); ++ int o2 = luaK_exp2RK(fs, e2); ++ freeexp(fs, e2); ++ freeexp(fs, e1); ++ if (cond == 0 && op != OP_EQ) { ++ int temp; /* exchange args to replace by `<' or `<=' */ ++ temp = o1; o1 = o2; o2 = temp; /* o1 <==> o2 */ ++ cond = 1; ++ } ++ e1->u.s.info = condjump(fs, op, cond, o1, o2); ++ e1->k = VJMP; ++} ++ ++ ++void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) { ++ expdesc e2; ++ e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0; ++ switch (op) { ++ case OPR_MINUS: { ++ if (!isnumeral(e)) ++ luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */ ++ codearith(fs, OP_UNM, e, &e2); ++ break; ++ } ++ case OPR_NOT: codenot(fs, e); break; ++ case OPR_LEN: { ++ luaK_exp2anyreg(fs, e); /* cannot operate on constants */ ++ codearith(fs, OP_LEN, e, &e2); ++ break; ++ } ++ default: lua_assert(0); ++ } ++} ++ ++ ++void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) { ++ switch (op) { ++ case OPR_AND: { ++ luaK_goiftrue(fs, v); ++ break; ++ } ++ case OPR_OR: { ++ luaK_goiffalse(fs, v); ++ break; ++ } ++ case OPR_CONCAT: { ++ luaK_exp2nextreg(fs, v); /* operand must be on the `stack' */ ++ break; ++ } ++ case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV: ++ case OPR_MOD: case OPR_POW: { ++ if (!isnumeral(v)) luaK_exp2RK(fs, v); ++ break; ++ } ++ default: { ++ luaK_exp2RK(fs, v); ++ break; ++ } ++ } ++} ++ ++ ++void luaK_posfix (FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2) { ++ switch (op) { ++ case OPR_AND: { ++ lua_assert(e1->t == NO_JUMP); /* list must be closed */ ++ luaK_dischargevars(fs, e2); ++ luaK_concat(fs, &e2->f, e1->f); ++ *e1 = *e2; ++ break; ++ } ++ case OPR_OR: { ++ lua_assert(e1->f == NO_JUMP); /* list must be closed */ ++ luaK_dischargevars(fs, e2); ++ luaK_concat(fs, &e2->t, e1->t); ++ *e1 = *e2; ++ break; ++ } ++ case OPR_CONCAT: { ++ luaK_exp2val(fs, e2); ++ if (e2->k == VRELOCABLE && GET_OPCODE(getcode(fs, e2)) == OP_CONCAT) { ++ lua_assert(e1->u.s.info == GETARG_B(getcode(fs, e2))-1); ++ freeexp(fs, e1); ++ SETARG_B(getcode(fs, e2), e1->u.s.info); ++ e1->k = VRELOCABLE; e1->u.s.info = e2->u.s.info; ++ } ++ else { ++ luaK_exp2nextreg(fs, e2); /* operand must be on the 'stack' */ ++ codearith(fs, OP_CONCAT, e1, e2); ++ } ++ break; ++ } ++ case OPR_ADD: codearith(fs, OP_ADD, e1, e2); break; ++ case OPR_SUB: codearith(fs, OP_SUB, e1, e2); break; ++ case OPR_MUL: codearith(fs, OP_MUL, e1, e2); break; ++ case OPR_DIV: codearith(fs, OP_DIV, e1, e2); break; ++ case OPR_MOD: codearith(fs, OP_MOD, e1, e2); break; ++ case OPR_POW: codearith(fs, OP_POW, e1, e2); break; ++ case OPR_EQ: codecomp(fs, OP_EQ, 1, e1, e2); break; ++ case OPR_NE: codecomp(fs, OP_EQ, 0, e1, e2); break; ++ case OPR_LT: codecomp(fs, OP_LT, 1, e1, e2); break; ++ case OPR_LE: codecomp(fs, OP_LE, 1, e1, e2); break; ++ case OPR_GT: codecomp(fs, OP_LT, 0, e1, e2); break; ++ case OPR_GE: codecomp(fs, OP_LE, 0, e1, e2); break; ++ default: lua_assert(0); ++ } ++} ++ ++ ++void luaK_fixline (FuncState *fs, int line) { ++ fs->f->lineinfo[fs->pc - 1] = line; ++} ++ ++ ++static int luaK_code (FuncState *fs, Instruction i, int line) { ++ Proto *f = fs->f; ++ dischargejpc(fs); /* `pc' will change */ ++ /* put new instruction in code array */ ++ luaM_growvector(fs->L, f->code, fs->pc, f->sizecode, Instruction, ++ MAX_INT, "code size overflow"); ++ f->code[fs->pc] = i; ++ /* save corresponding line information */ ++ luaM_growvector(fs->L, f->lineinfo, fs->pc, f->sizelineinfo, int, ++ MAX_INT, "code size overflow"); ++ f->lineinfo[fs->pc] = line; ++ return fs->pc++; ++} ++ ++ ++int luaK_codeABC (FuncState *fs, OpCode o, int a, int b, int c) { ++ lua_assert(getOpMode(o) == iABC); ++ lua_assert(getBMode(o) != OpArgN || b == 0); ++ lua_assert(getCMode(o) != OpArgN || c == 0); ++ return luaK_code(fs, CREATE_ABC(o, a, b, c), fs->ls->lastline); ++} ++ ++ ++int luaK_codeABx (FuncState *fs, OpCode o, int a, unsigned int bc) { ++ lua_assert(getOpMode(o) == iABx || getOpMode(o) == iAsBx); ++ lua_assert(getCMode(o) == OpArgN); ++ return luaK_code(fs, CREATE_ABx(o, a, bc), fs->ls->lastline); ++} ++ ++ ++void luaK_setlist (FuncState *fs, int base, int nelems, int tostore) { ++ int c = (nelems - 1)/LFIELDS_PER_FLUSH + 1; ++ int b = (tostore == LUA_MULTRET) ? 0 : tostore; ++ lua_assert(tostore != 0); ++ if (c <= MAXARG_C) ++ luaK_codeABC(fs, OP_SETLIST, base, b, c); ++ else { ++ luaK_codeABC(fs, OP_SETLIST, base, b, 0); ++ luaK_code(fs, cast(Instruction, c), fs->ls->lastline); ++ } ++ fs->freereg = base + 1; /* free registers with list values */ ++} ++ +--- /dev/null ++++ b/extensions/LUA/lua/lcode.h +@@ -0,0 +1,76 @@ ++/* ++** $Id: lcode.h,v 1.48.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Code generator for Lua ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef lcode_h ++#define lcode_h ++ ++#include "llex.h" ++#include "lobject.h" ++#include "lopcodes.h" ++#include "lparser.h" ++ ++ ++/* ++** Marks the end of a patch list. It is an invalid value both as an absolute ++** address, and as a list link (would link an element to itself). ++*/ ++#define NO_JUMP (-1) ++ ++ ++/* ++** grep "ORDER OPR" if you change these enums ++*/ ++typedef enum BinOpr { ++ OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW, ++ OPR_CONCAT, ++ OPR_NE, OPR_EQ, ++ OPR_LT, OPR_LE, OPR_GT, OPR_GE, ++ OPR_AND, OPR_OR, ++ OPR_NOBINOPR ++} BinOpr; ++ ++ ++typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; ++ ++ ++#define getcode(fs,e) ((fs)->f->code[(e)->u.s.info]) ++ ++#define luaK_codeAsBx(fs,o,A,sBx) luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx) ++ ++#define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET) ++ ++LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); ++LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C); ++LUAI_FUNC void luaK_fixline (FuncState *fs, int line); ++LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n); ++LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n); ++LUAI_FUNC void luaK_checkstack (FuncState *fs, int n); ++LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s); ++LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r); ++LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e); ++LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e); ++LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e); ++LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e); ++LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e); ++LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key); ++LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k); ++LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e); ++LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e); ++LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults); ++LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e); ++LUAI_FUNC int luaK_jump (FuncState *fs); ++LUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret); ++LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target); ++LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list); ++LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2); ++LUAI_FUNC int luaK_getlabel (FuncState *fs); ++LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v); ++LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v); ++LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2); ++LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore); ++ ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/ldebug.c +@@ -0,0 +1,637 @@ ++/* ++** $Id: ldebug.c,v 2.29.1.6 2008/05/08 16:56:26 roberto Exp $ ++** Debug Interface ++** See Copyright Notice in lua.h ++*/ ++ ++ ++#include ++#include ++#include ++ ++#define ldebug_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "lapi.h" ++#include "lcode.h" ++#include "ldebug.h" ++#include "ldo.h" ++#include "lfunc.h" ++#include "lobject.h" ++#include "lopcodes.h" ++#include "lstate.h" ++#include "lstring.h" ++#include "ltable.h" ++#include "ltm.h" ++#include "lvm.h" ++ ++ ++ ++static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name); ++ ++ ++static int currentpc (lua_State *L, CallInfo *ci) { ++ if (!isLua(ci)) return -1; /* function is not a Lua function? */ ++ if (ci == L->ci) ++ ci->savedpc = L->savedpc; ++ return pcRel(ci->savedpc, ci_func(ci)->l.p); ++} ++ ++ ++static int currentline (lua_State *L, CallInfo *ci) { ++ int pc = currentpc(L, ci); ++ if (pc < 0) ++ return -1; /* only active lua functions have current-line information */ ++ else ++ return getline(ci_func(ci)->l.p, pc); ++} ++ ++ ++/* ++** this function can be called asynchronous (e.g. during a signal) ++*/ ++LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { ++ if (func == NULL || mask == 0) { /* turn off hooks? */ ++ mask = 0; ++ func = NULL; ++ } ++ L->hook = func; ++ L->basehookcount = count; ++ resethookcount(L); ++ L->hookmask = cast_byte(mask); ++ return 1; ++} ++ ++ ++LUA_API lua_Hook lua_gethook (lua_State *L) { ++ return L->hook; ++} ++ ++ ++LUA_API int lua_gethookmask (lua_State *L) { ++ return L->hookmask; ++} ++ ++ ++LUA_API int lua_gethookcount (lua_State *L) { ++ return L->basehookcount; ++} ++ ++ ++LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) { ++ int status; ++ CallInfo *ci; ++ lua_lock(L); ++ for (ci = L->ci; level > 0 && ci > L->base_ci; ci--) { ++ level--; ++ if (f_isLua(ci)) /* Lua function? */ ++ level -= ci->tailcalls; /* skip lost tail calls */ ++ } ++ if (level == 0 && ci > L->base_ci) { /* level found? */ ++ status = 1; ++ ar->i_ci = cast_int(ci - L->base_ci); ++ } ++ else if (level < 0) { /* level is of a lost tail call? */ ++ status = 1; ++ ar->i_ci = 0; ++ } ++ else status = 0; /* no such level */ ++ lua_unlock(L); ++ return status; ++} ++ ++ ++static Proto *getluaproto (CallInfo *ci) { ++ return (isLua(ci) ? ci_func(ci)->l.p : NULL); ++} ++ ++ ++static const char *findlocal (lua_State *L, CallInfo *ci, int n) { ++ const char *name; ++ Proto *fp = getluaproto(ci); ++ if (fp && (name = luaF_getlocalname(fp, n, currentpc(L, ci))) != NULL) ++ return name; /* is a local variable in a Lua function */ ++ else { ++ StkId limit = (ci == L->ci) ? L->top : (ci+1)->func; ++ if (limit - ci->base >= n && n > 0) /* is 'n' inside 'ci' stack? */ ++ return "(*temporary)"; ++ else ++ return NULL; ++ } ++} ++ ++ ++LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) { ++ CallInfo *ci = L->base_ci + ar->i_ci; ++ const char *name = findlocal(L, ci, n); ++ lua_lock(L); ++ if (name) ++ luaA_pushobject(L, ci->base + (n - 1)); ++ lua_unlock(L); ++ return name; ++} ++ ++ ++LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { ++ CallInfo *ci = L->base_ci + ar->i_ci; ++ const char *name = findlocal(L, ci, n); ++ lua_lock(L); ++ if (name) ++ setobjs2s(L, ci->base + (n - 1), L->top - 1); ++ L->top--; /* pop value */ ++ lua_unlock(L); ++ return name; ++} ++ ++ ++static void funcinfo (lua_Debug *ar, Closure *cl) { ++ if (cl->c.isC) { ++ ar->source = "=[C]"; ++ ar->linedefined = -1; ++ ar->lastlinedefined = -1; ++ ar->what = "C"; ++ } ++ else { ++ ar->source = getstr(cl->l.p->source); ++ ar->linedefined = cl->l.p->linedefined; ++ ar->lastlinedefined = cl->l.p->lastlinedefined; ++ ar->what = (ar->linedefined == 0) ? "main" : "Lua"; ++ } ++ luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE); ++} ++ ++ ++static void info_tailcall (lua_Debug *ar) { ++ ar->name = ar->namewhat = ""; ++ ar->what = "tail"; ++ ar->lastlinedefined = ar->linedefined = ar->currentline = -1; ++ ar->source = "=(tail call)"; ++ luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE); ++ ar->nups = 0; ++} ++ ++ ++static void collectvalidlines (lua_State *L, Closure *f) { ++ if (f == NULL || f->c.isC) { ++ setnilvalue(L->top); ++ } ++ else { ++ Table *t = luaH_new(L, 0, 0); ++ int *lineinfo = f->l.p->lineinfo; ++ int i; ++ for (i=0; il.p->sizelineinfo; i++) ++ setbvalue(luaH_setnum(L, t, lineinfo[i]), 1); ++ sethvalue(L, L->top, t); ++ } ++ incr_top(L); ++} ++ ++ ++static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, ++ Closure *f, CallInfo *ci) { ++ int status = 1; ++ if (f == NULL) { ++ info_tailcall(ar); ++ return status; ++ } ++ for (; *what; what++) { ++ switch (*what) { ++ case 'S': { ++ funcinfo(ar, f); ++ break; ++ } ++ case 'l': { ++ ar->currentline = (ci) ? currentline(L, ci) : -1; ++ break; ++ } ++ case 'u': { ++ ar->nups = f->c.nupvalues; ++ break; ++ } ++ case 'n': { ++ ar->namewhat = (ci) ? getfuncname(L, ci, &ar->name) : NULL; ++ if (ar->namewhat == NULL) { ++ ar->namewhat = ""; /* not found */ ++ ar->name = NULL; ++ } ++ break; ++ } ++ case 'L': ++ case 'f': /* handled by lua_getinfo */ ++ break; ++ default: status = 0; /* invalid option */ ++ } ++ } ++ return status; ++} ++ ++ ++LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { ++ int status; ++ Closure *f = NULL; ++ CallInfo *ci = NULL; ++ lua_lock(L); ++ if (*what == '>') { ++ StkId func = L->top - 1; ++ luai_apicheck(L, ttisfunction(func)); ++ what++; /* skip the '>' */ ++ f = clvalue(func); ++ L->top--; /* pop function */ ++ } ++ else if (ar->i_ci != 0) { /* no tail call? */ ++ ci = L->base_ci + ar->i_ci; ++ lua_assert(ttisfunction(ci->func)); ++ f = clvalue(ci->func); ++ } ++ status = auxgetinfo(L, what, ar, f, ci); ++ if (strchr(what, 'f')) { ++ if (f == NULL) setnilvalue(L->top); ++ else setclvalue(L, L->top, f); ++ incr_top(L); ++ } ++ if (strchr(what, 'L')) ++ collectvalidlines(L, f); ++ lua_unlock(L); ++ return status; ++} ++ ++ ++/* ++** {====================================================== ++** Symbolic Execution and code checker ++** ======================================================= ++*/ ++ ++#define check(x) if (!(x)) return 0; ++ ++#define checkjump(pt,pc) check(0 <= pc && pc < pt->sizecode) ++ ++#define checkreg(pt,reg) check((reg) < (pt)->maxstacksize) ++ ++ ++ ++static int precheck (const Proto *pt) { ++ check(pt->maxstacksize <= MAXSTACK); ++ check(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize); ++ check(!(pt->is_vararg & VARARG_NEEDSARG) || ++ (pt->is_vararg & VARARG_HASARG)); ++ check(pt->sizeupvalues <= pt->nups); ++ check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0); ++ check(pt->sizecode > 0 && GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN); ++ return 1; ++} ++ ++ ++#define checkopenop(pt,pc) luaG_checkopenop((pt)->code[(pc)+1]) ++ ++int luaG_checkopenop (Instruction i) { ++ switch (GET_OPCODE(i)) { ++ case OP_CALL: ++ case OP_TAILCALL: ++ case OP_RETURN: ++ case OP_SETLIST: { ++ check(GETARG_B(i) == 0); ++ return 1; ++ } ++ default: return 0; /* invalid instruction after an open call */ ++ } ++} ++ ++ ++static int checkArgMode (const Proto *pt, int r, enum OpArgMask mode) { ++ switch (mode) { ++ case OpArgN: check(r == 0); break; ++ case OpArgU: break; ++ case OpArgR: checkreg(pt, r); break; ++ case OpArgK: ++ check(ISK(r) ? INDEXK(r) < pt->sizek : r < pt->maxstacksize); ++ break; ++ } ++ return 1; ++} ++ ++ ++static Instruction symbexec (const Proto *pt, int lastpc, int reg) { ++ int pc; ++ int last; /* stores position of last instruction that changed `reg' */ ++ last = pt->sizecode-1; /* points to final return (a `neutral' instruction) */ ++ check(precheck(pt)); ++ for (pc = 0; pc < lastpc; pc++) { ++ Instruction i = pt->code[pc]; ++ OpCode op = GET_OPCODE(i); ++ int a = GETARG_A(i); ++ int b = 0; ++ int c = 0; ++ check(op < NUM_OPCODES); ++ checkreg(pt, a); ++ switch (getOpMode(op)) { ++ case iABC: { ++ b = GETARG_B(i); ++ c = GETARG_C(i); ++ check(checkArgMode(pt, b, getBMode(op))); ++ check(checkArgMode(pt, c, getCMode(op))); ++ break; ++ } ++ case iABx: { ++ b = GETARG_Bx(i); ++ if (getBMode(op) == OpArgK) check(b < pt->sizek); ++ break; ++ } ++ case iAsBx: { ++ b = GETARG_sBx(i); ++ if (getBMode(op) == OpArgR) { ++ int dest = pc+1+b; ++ check(0 <= dest && dest < pt->sizecode); ++ if (dest > 0) { ++ int j; ++ /* check that it does not jump to a setlist count; this ++ is tricky, because the count from a previous setlist may ++ have the same value of an invalid setlist; so, we must ++ go all the way back to the first of them (if any) */ ++ for (j = 0; j < dest; j++) { ++ Instruction d = pt->code[dest-1-j]; ++ if (!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0)) break; ++ } ++ /* if 'j' is even, previous value is not a setlist (even if ++ it looks like one) */ ++ check((j&1) == 0); ++ } ++ } ++ break; ++ } ++ } ++ if (testAMode(op)) { ++ if (a == reg) last = pc; /* change register `a' */ ++ } ++ if (testTMode(op)) { ++ check(pc+2 < pt->sizecode); /* check skip */ ++ check(GET_OPCODE(pt->code[pc+1]) == OP_JMP); ++ } ++ switch (op) { ++ case OP_LOADBOOL: { ++ if (c == 1) { /* does it jump? */ ++ check(pc+2 < pt->sizecode); /* check its jump */ ++ check(GET_OPCODE(pt->code[pc+1]) != OP_SETLIST || ++ GETARG_C(pt->code[pc+1]) != 0); ++ } ++ break; ++ } ++ case OP_LOADNIL: { ++ if (a <= reg && reg <= b) ++ last = pc; /* set registers from `a' to `b' */ ++ break; ++ } ++ case OP_GETUPVAL: ++ case OP_SETUPVAL: { ++ check(b < pt->nups); ++ break; ++ } ++ case OP_GETGLOBAL: ++ case OP_SETGLOBAL: { ++ check(ttisstring(&pt->k[b])); ++ break; ++ } ++ case OP_SELF: { ++ checkreg(pt, a+1); ++ if (reg == a+1) last = pc; ++ break; ++ } ++ case OP_CONCAT: { ++ check(b < c); /* at least two operands */ ++ break; ++ } ++ case OP_TFORLOOP: { ++ check(c >= 1); /* at least one result (control variable) */ ++ checkreg(pt, a+2+c); /* space for results */ ++ if (reg >= a+2) last = pc; /* affect all regs above its base */ ++ break; ++ } ++ case OP_FORLOOP: ++ case OP_FORPREP: ++ checkreg(pt, a+3); ++ /* go through */ ++ case OP_JMP: { ++ int dest = pc+1+b; ++ /* not full check and jump is forward and do not skip `lastpc'? */ ++ if (reg != NO_REG && pc < dest && dest <= lastpc) ++ pc += b; /* do the jump */ ++ break; ++ } ++ case OP_CALL: ++ case OP_TAILCALL: { ++ if (b != 0) { ++ checkreg(pt, a+b-1); ++ } ++ c--; /* c = num. returns */ ++ if (c == LUA_MULTRET) { ++ check(checkopenop(pt, pc)); ++ } ++ else if (c != 0) ++ checkreg(pt, a+c-1); ++ if (reg >= a) last = pc; /* affect all registers above base */ ++ break; ++ } ++ case OP_RETURN: { ++ b--; /* b = num. returns */ ++ if (b > 0) checkreg(pt, a+b-1); ++ break; ++ } ++ case OP_SETLIST: { ++ if (b > 0) checkreg(pt, a + b); ++ if (c == 0) { ++ pc++; ++ check(pc < pt->sizecode - 1); ++ } ++ break; ++ } ++ case OP_CLOSURE: { ++ int nup, j; ++ check(b < pt->sizep); ++ nup = pt->p[b]->nups; ++ check(pc + nup < pt->sizecode); ++ for (j = 1; j <= nup; j++) { ++ OpCode op1 = GET_OPCODE(pt->code[pc + j]); ++ check(op1 == OP_GETUPVAL || op1 == OP_MOVE); ++ } ++ if (reg != NO_REG) /* tracing? */ ++ pc += nup; /* do not 'execute' these pseudo-instructions */ ++ break; ++ } ++ case OP_VARARG: { ++ check((pt->is_vararg & VARARG_ISVARARG) && ++ !(pt->is_vararg & VARARG_NEEDSARG)); ++ b--; ++ if (b == LUA_MULTRET) check(checkopenop(pt, pc)); ++ checkreg(pt, a+b-1); ++ break; ++ } ++ default: break; ++ } ++ } ++ return pt->code[last]; ++} ++ ++#undef check ++#undef checkjump ++#undef checkreg ++ ++/* }====================================================== */ ++ ++ ++int luaG_checkcode (const Proto *pt) { ++ return (symbexec(pt, pt->sizecode, NO_REG) != 0); ++} ++ ++ ++static const char *kname (Proto *p, int c) { ++ if (ISK(c) && ttisstring(&p->k[INDEXK(c)])) ++ return svalue(&p->k[INDEXK(c)]); ++ else ++ return "?"; ++} ++ ++ ++static const char *getobjname (lua_State *L, CallInfo *ci, int stackpos, ++ const char **name) { ++ if (isLua(ci)) { /* a Lua function? */ ++ Proto *p = ci_func(ci)->l.p; ++ int pc = currentpc(L, ci); ++ Instruction i; ++ *name = luaF_getlocalname(p, stackpos+1, pc); ++ if (*name) /* is a local? */ ++ return "local"; ++ i = symbexec(p, pc, stackpos); /* try symbolic execution */ ++ lua_assert(pc != -1); ++ switch (GET_OPCODE(i)) { ++ case OP_GETGLOBAL: { ++ int g = GETARG_Bx(i); /* global index */ ++ lua_assert(ttisstring(&p->k[g])); ++ *name = svalue(&p->k[g]); ++ return "global"; ++ } ++ case OP_MOVE: { ++ int a = GETARG_A(i); ++ int b = GETARG_B(i); /* move from `b' to `a' */ ++ if (b < a) ++ return getobjname(L, ci, b, name); /* get name for `b' */ ++ break; ++ } ++ case OP_GETTABLE: { ++ int k = GETARG_C(i); /* key index */ ++ *name = kname(p, k); ++ return "field"; ++ } ++ case OP_GETUPVAL: { ++ int u = GETARG_B(i); /* upvalue index */ ++ *name = p->upvalues ? getstr(p->upvalues[u]) : "?"; ++ return "upvalue"; ++ } ++ case OP_SELF: { ++ int k = GETARG_C(i); /* key index */ ++ *name = kname(p, k); ++ return "method"; ++ } ++ default: break; ++ } ++ } ++ return NULL; /* no useful name found */ ++} ++ ++ ++static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) { ++ Instruction i; ++ if ((isLua(ci) && ci->tailcalls > 0) || !isLua(ci - 1)) ++ return NULL; /* calling function is not Lua (or is unknown) */ ++ ci--; /* calling function */ ++ i = ci_func(ci)->l.p->code[currentpc(L, ci)]; ++ if (GET_OPCODE(i) == OP_CALL || GET_OPCODE(i) == OP_TAILCALL || ++ GET_OPCODE(i) == OP_TFORLOOP) ++ return getobjname(L, ci, GETARG_A(i), name); ++ else ++ return NULL; /* no useful name can be found */ ++} ++ ++ ++/* only ANSI way to check whether a pointer points to an array */ ++static int isinstack (CallInfo *ci, const TValue *o) { ++ StkId p; ++ for (p = ci->base; p < ci->top; p++) ++ if (o == p) return 1; ++ return 0; ++} ++ ++ ++void luaG_typeerror (lua_State *L, const TValue *o, const char *op) { ++ const char *name = NULL; ++ const char *t = luaT_typenames[ttype(o)]; ++ const char *kind = (isinstack(L->ci, o)) ? ++ getobjname(L, L->ci, cast_int(o - L->base), &name) : ++ NULL; ++ if (kind) ++ luaG_runerror(L, "attempt to %s %s " LUA_QS " (a %s value)", ++ op, kind, name, t); ++ else ++ luaG_runerror(L, "attempt to %s a %s value", op, t); ++} ++ ++ ++void luaG_concaterror (lua_State *L, StkId p1, StkId p2) { ++ if (ttisstring(p1) || ttisnumber(p1)) p1 = p2; ++ lua_assert(!ttisstring(p1) && !ttisnumber(p1)); ++ luaG_typeerror(L, p1, "concatenate"); ++} ++ ++ ++void luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2) { ++ TValue temp; ++ if (luaV_tonumber(p1, &temp) == NULL) ++ p2 = p1; /* first operand is wrong */ ++ luaG_typeerror(L, p2, "perform arithmetic on"); ++} ++ ++ ++int luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2) { ++ const char *t1 = luaT_typenames[ttype(p1)]; ++ const char *t2 = luaT_typenames[ttype(p2)]; ++ if (t1[2] == t2[2]) ++ luaG_runerror(L, "attempt to compare two %s values", t1); ++ else ++ luaG_runerror(L, "attempt to compare %s with %s", t1, t2); ++ return 0; ++} ++ ++ ++static void addinfo (lua_State *L, const char *msg) { ++ CallInfo *ci = L->ci; ++ if (isLua(ci)) { /* is Lua code? */ ++ char buff[LUA_IDSIZE]; /* add file:line information */ ++ int line = currentline(L, ci); ++ luaO_chunkid(buff, getstr(getluaproto(ci)->source), LUA_IDSIZE); ++ luaO_pushfstring(L, "%s:%d: %s", buff, line, msg); ++ } ++} ++ ++ ++void luaG_errormsg (lua_State *L) { ++ if (L->errfunc != 0) { /* is there an error handling function? */ ++ StkId errfunc = restorestack(L, L->errfunc); ++ if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR); ++ setobjs2s(L, L->top, L->top - 1); /* move argument */ ++ setobjs2s(L, L->top - 1, errfunc); /* push function */ ++ incr_top(L); ++ luaD_call(L, L->top - 2, 1); /* call it */ ++ } ++ luaD_throw(L, LUA_ERRRUN); ++} ++ ++ ++void luaG_runerror (lua_State *L, const char *fmt, ...) { ++ va_list argp; ++ va_start(argp, fmt); ++ addinfo(L, luaO_pushvfstring(L, fmt, argp)); ++ va_end(argp); ++ luaG_errormsg(L); ++} ++ +--- /dev/null ++++ b/extensions/LUA/lua/ldebug.h +@@ -0,0 +1,33 @@ ++/* ++** $Id: ldebug.h,v 2.3.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Auxiliary functions from Debug Interface module ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef ldebug_h ++#define ldebug_h ++ ++ ++#include "lstate.h" ++ ++ ++#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) ++ ++#define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0) ++ ++#define resethookcount(L) (L->hookcount = L->basehookcount) ++ ++ ++LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o, ++ const char *opname); ++LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2); ++LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1, ++ const TValue *p2); ++LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1, ++ const TValue *p2); ++LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...); ++LUAI_FUNC void luaG_errormsg (lua_State *L); ++LUAI_FUNC int luaG_checkcode (const Proto *pt); ++LUAI_FUNC int luaG_checkopenop (Instruction i); ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/ldo.c +@@ -0,0 +1,515 @@ ++/* ++** $Id: ldo.c,v 2.38.1.3 2008/01/18 22:31:22 roberto Exp $ ++** Stack and Call structure of Lua ++** See Copyright Notice in lua.h ++*/ ++ ++#include ++#include ++#include ++ ++#define ldo_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "ldebug.h" ++#include "ldo.h" ++#include "lfunc.h" ++#include "lgc.h" ++#include "lmem.h" ++#include "lobject.h" ++#include "lopcodes.h" ++#include "lparser.h" ++#include "lstate.h" ++#include "lstring.h" ++#include "ltable.h" ++#include "ltm.h" ++#include "lundump.h" ++#include "lvm.h" ++#include "lzio.h" ++ ++ ++ ++/* ++** {====================================================== ++** Error-recovery functions ++** ======================================================= ++*/ ++ ++ ++/* chain list of long jump buffers */ ++struct lua_longjmp { ++ struct lua_longjmp *previous; ++ luai_jmpbuf b; ++ volatile int status; /* error code */ ++}; ++ ++ ++void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) { ++ switch (errcode) { ++ case LUA_ERRMEM: { ++ setsvalue2s(L, oldtop, luaS_newliteral(L, MEMERRMSG)); ++ break; ++ } ++ case LUA_ERRERR: { ++ setsvalue2s(L, oldtop, luaS_newliteral(L, "error in error handling")); ++ break; ++ } ++ case LUA_ERRSYNTAX: ++ case LUA_ERRRUN: { ++ setobjs2s(L, oldtop, L->top - 1); /* error message on current top */ ++ break; ++ } ++ } ++ L->top = oldtop + 1; ++} ++ ++ ++static void restore_stack_limit (lua_State *L) { ++ lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1); ++ if (L->size_ci > LUAI_MAXCALLS) { /* there was an overflow? */ ++ int inuse = cast_int(L->ci - L->base_ci); ++ if (inuse + 1 < LUAI_MAXCALLS) /* can `undo' overflow? */ ++ luaD_reallocCI(L, LUAI_MAXCALLS); ++ } ++} ++ ++ ++static void resetstack (lua_State *L, int status) { ++ L->ci = L->base_ci; ++ L->base = L->ci->base; ++ luaF_close(L, L->base); /* close eventual pending closures */ ++ luaD_seterrorobj(L, status, L->base); ++ L->nCcalls = L->baseCcalls; ++ L->allowhook = 1; ++ restore_stack_limit(L); ++ L->errfunc = 0; ++ L->errorJmp = NULL; ++} ++ ++ ++void luaD_throw (lua_State *L, int errcode) { ++ if (L->errorJmp) { ++ L->errorJmp->status = errcode; ++ LUAI_THROW(L, L->errorJmp); ++ } ++ else { ++ L->status = cast_byte(errcode); ++ if (G(L)->panic) { ++ resetstack(L, errcode); ++ lua_unlock(L); ++ G(L)->panic(L); ++ } ++ exit(EXIT_FAILURE); ++ } ++} ++ ++ ++int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) { ++ struct lua_longjmp lj; ++ lj.status = 0; ++ lj.previous = L->errorJmp; /* chain new error handler */ ++ L->errorJmp = &lj; ++ LUAI_TRY(L, &lj, ++ (*f)(L, ud); ++ ); ++ L->errorJmp = lj.previous; /* restore old error handler */ ++ return lj.status; ++} ++ ++/* }====================================================== */ ++ ++ ++static void correctstack (lua_State *L, TValue *oldstack) { ++ CallInfo *ci; ++ GCObject *up; ++ L->top = (L->top - oldstack) + L->stack; ++ for (up = L->openupval; up != NULL; up = up->gch.next) ++ gco2uv(up)->v = (gco2uv(up)->v - oldstack) + L->stack; ++ for (ci = L->base_ci; ci <= L->ci; ci++) { ++ ci->top = (ci->top - oldstack) + L->stack; ++ ci->base = (ci->base - oldstack) + L->stack; ++ ci->func = (ci->func - oldstack) + L->stack; ++ } ++ L->base = (L->base - oldstack) + L->stack; ++} ++ ++ ++void luaD_reallocstack (lua_State *L, int newsize) { ++ TValue *oldstack = L->stack; ++ int realsize = newsize + 1 + EXTRA_STACK; ++ lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1); ++ luaM_reallocvector(L, L->stack, L->stacksize, realsize, TValue); ++ L->stacksize = realsize; ++ L->stack_last = L->stack+newsize; ++ correctstack(L, oldstack); ++} ++ ++ ++void luaD_reallocCI (lua_State *L, int newsize) { ++ CallInfo *oldci = L->base_ci; ++ luaM_reallocvector(L, L->base_ci, L->size_ci, newsize, CallInfo); ++ L->size_ci = newsize; ++ L->ci = (L->ci - oldci) + L->base_ci; ++ L->end_ci = L->base_ci + L->size_ci - 1; ++} ++ ++ ++void luaD_growstack (lua_State *L, int n) { ++ if (n <= L->stacksize) /* double size is enough? */ ++ luaD_reallocstack(L, 2*L->stacksize); ++ else ++ luaD_reallocstack(L, L->stacksize + n); ++} ++ ++ ++static CallInfo *growCI (lua_State *L) { ++ if (L->size_ci > LUAI_MAXCALLS) /* overflow while handling overflow? */ ++ luaD_throw(L, LUA_ERRERR); ++ else { ++ luaD_reallocCI(L, 2*L->size_ci); ++ if (L->size_ci > LUAI_MAXCALLS) ++ luaG_runerror(L, "stack overflow"); ++ } ++ return ++L->ci; ++} ++ ++ ++void luaD_callhook (lua_State *L, int event, int line) { ++ lua_Hook hook = L->hook; ++ if (hook && L->allowhook) { ++ ptrdiff_t top = savestack(L, L->top); ++ ptrdiff_t ci_top = savestack(L, L->ci->top); ++ lua_Debug ar; ++ ar.event = event; ++ ar.currentline = line; ++ if (event == LUA_HOOKTAILRET) ++ ar.i_ci = 0; /* tail call; no debug information about it */ ++ else ++ ar.i_ci = cast_int(L->ci - L->base_ci); ++ luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ ++ L->ci->top = L->top + LUA_MINSTACK; ++ lua_assert(L->ci->top <= L->stack_last); ++ L->allowhook = 0; /* cannot call hooks inside a hook */ ++ lua_unlock(L); ++ (*hook)(L, &ar); ++ lua_lock(L); ++ lua_assert(!L->allowhook); ++ L->allowhook = 1; ++ L->ci->top = restorestack(L, ci_top); ++ L->top = restorestack(L, top); ++ } ++} ++ ++ ++static StkId adjust_varargs (lua_State *L, Proto *p, int actual) { ++ int i; ++ int nfixargs = p->numparams; ++ Table *htab = NULL; ++ StkId base, fixed; ++ for (; actual < nfixargs; ++actual) ++ setnilvalue(L->top++); ++#if defined(LUA_COMPAT_VARARG) ++ if (p->is_vararg & VARARG_NEEDSARG) { /* compat. with old-style vararg? */ ++ int nvar = actual - nfixargs; /* number of extra arguments */ ++ lua_assert(p->is_vararg & VARARG_HASARG); ++ luaC_checkGC(L); ++ htab = luaH_new(L, nvar, 1); /* create `arg' table */ ++ for (i=0; itop - nvar + i); ++ /* store counter in field `n' */ ++ setnvalue(luaH_setstr(L, htab, luaS_newliteral(L, "n")), cast_num(nvar)); ++ } ++#endif ++ /* move fixed parameters to final position */ ++ fixed = L->top - actual; /* first fixed argument */ ++ base = L->top; /* final position of first argument */ ++ for (i=0; itop++, fixed+i); ++ setnilvalue(fixed+i); ++ } ++ /* add `arg' parameter */ ++ if (htab) { ++ sethvalue(L, L->top++, htab); ++ lua_assert(iswhite(obj2gco(htab))); ++ } ++ return base; ++} ++ ++ ++static StkId tryfuncTM (lua_State *L, StkId func) { ++ const TValue *tm = luaT_gettmbyobj(L, func, TM_CALL); ++ StkId p; ++ ptrdiff_t funcr = savestack(L, func); ++ if (!ttisfunction(tm)) ++ luaG_typeerror(L, func, "call"); ++ /* Open a hole inside the stack at `func' */ ++ for (p = L->top; p > func; p--) setobjs2s(L, p, p-1); ++ incr_top(L); ++ func = restorestack(L, funcr); /* previous call may change stack */ ++ setobj2s(L, func, tm); /* tag method is the new function to be called */ ++ return func; ++} ++ ++ ++ ++#define inc_ci(L) \ ++ ((L->ci == L->end_ci) ? growCI(L) : \ ++ (condhardstacktests(luaD_reallocCI(L, L->size_ci)), ++L->ci)) ++ ++ ++int luaD_precall (lua_State *L, StkId func, int nresults) { ++ LClosure *cl; ++ ptrdiff_t funcr; ++ if (!ttisfunction(func)) /* `func' is not a function? */ ++ func = tryfuncTM(L, func); /* check the `function' tag method */ ++ funcr = savestack(L, func); ++ cl = &clvalue(func)->l; ++ L->ci->savedpc = L->savedpc; ++ if (!cl->isC) { /* Lua function? prepare its call */ ++ CallInfo *ci; ++ StkId st, base; ++ Proto *p = cl->p; ++ luaD_checkstack(L, p->maxstacksize); ++ func = restorestack(L, funcr); ++ if (!p->is_vararg) { /* no varargs? */ ++ base = func + 1; ++ if (L->top > base + p->numparams) ++ L->top = base + p->numparams; ++ } ++ else { /* vararg function */ ++ int nargs = cast_int(L->top - func) - 1; ++ base = adjust_varargs(L, p, nargs); ++ func = restorestack(L, funcr); /* previous call may change the stack */ ++ } ++ ci = inc_ci(L); /* now `enter' new function */ ++ ci->func = func; ++ L->base = ci->base = base; ++ ci->top = L->base + p->maxstacksize; ++ lua_assert(ci->top <= L->stack_last); ++ L->savedpc = p->code; /* starting point */ ++ ci->tailcalls = 0; ++ ci->nresults = nresults; ++ for (st = L->top; st < ci->top; st++) ++ setnilvalue(st); ++ L->top = ci->top; ++ if (L->hookmask & LUA_MASKCALL) { ++ L->savedpc++; /* hooks assume 'pc' is already incremented */ ++ luaD_callhook(L, LUA_HOOKCALL, -1); ++ L->savedpc--; /* correct 'pc' */ ++ } ++ return PCRLUA; ++ } ++ else { /* if is a C function, call it */ ++ CallInfo *ci; ++ int n; ++ luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ ++ ci = inc_ci(L); /* now `enter' new function */ ++ ci->func = restorestack(L, funcr); ++ L->base = ci->base = ci->func + 1; ++ ci->top = L->top + LUA_MINSTACK; ++ lua_assert(ci->top <= L->stack_last); ++ ci->nresults = nresults; ++ if (L->hookmask & LUA_MASKCALL) ++ luaD_callhook(L, LUA_HOOKCALL, -1); ++ lua_unlock(L); ++ n = (*curr_func(L)->c.f)(L); /* do the actual call */ ++ lua_lock(L); ++ if (n < 0) /* yielding? */ ++ return PCRYIELD; ++ else { ++ luaD_poscall(L, L->top - n); ++ return PCRC; ++ } ++ } ++} ++ ++ ++static StkId callrethooks (lua_State *L, StkId firstResult) { ++ ptrdiff_t fr = savestack(L, firstResult); /* next call may change stack */ ++ luaD_callhook(L, LUA_HOOKRET, -1); ++ if (f_isLua(L->ci)) { /* Lua function? */ ++ while ((L->hookmask & LUA_MASKRET) && L->ci->tailcalls--) /* tail calls */ ++ luaD_callhook(L, LUA_HOOKTAILRET, -1); ++ } ++ return restorestack(L, fr); ++} ++ ++ ++int luaD_poscall (lua_State *L, StkId firstResult) { ++ StkId res; ++ int wanted, i; ++ CallInfo *ci; ++ if (L->hookmask & LUA_MASKRET) ++ firstResult = callrethooks(L, firstResult); ++ ci = L->ci--; ++ res = ci->func; /* res == final position of 1st result */ ++ wanted = ci->nresults; ++ L->base = (ci - 1)->base; /* restore base */ ++ L->savedpc = (ci - 1)->savedpc; /* restore savedpc */ ++ /* move results to correct place */ ++ for (i = wanted; i != 0 && firstResult < L->top; i--) ++ setobjs2s(L, res++, firstResult++); ++ while (i-- > 0) ++ setnilvalue(res++); ++ L->top = res; ++ return (wanted - LUA_MULTRET); /* 0 iff wanted == LUA_MULTRET */ ++} ++ ++ ++/* ++** Call a function (C or Lua). The function to be called is at *func. ++** The arguments are on the stack, right after the function. ++** When returns, all the results are on the stack, starting at the original ++** function position. ++*/ ++void luaD_call (lua_State *L, StkId func, int nResults) { ++ if (++L->nCcalls >= LUAI_MAXCCALLS) { ++ if (L->nCcalls == LUAI_MAXCCALLS) ++ luaG_runerror(L, "C stack overflow"); ++ else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3))) ++ luaD_throw(L, LUA_ERRERR); /* error while handing stack error */ ++ } ++ if (luaD_precall(L, func, nResults) == PCRLUA) /* is a Lua function? */ ++ luaV_execute(L, 1); /* call it */ ++ L->nCcalls--; ++ luaC_checkGC(L); ++} ++ ++ ++static void resume (lua_State *L, void *ud) { ++ StkId firstArg = cast(StkId, ud); ++ CallInfo *ci = L->ci; ++ if (L->status == 0) { /* start coroutine? */ ++ lua_assert(ci == L->base_ci && firstArg > L->base); ++ if (luaD_precall(L, firstArg - 1, LUA_MULTRET) != PCRLUA) ++ return; ++ } ++ else { /* resuming from previous yield */ ++ lua_assert(L->status == LUA_YIELD); ++ L->status = 0; ++ if (!f_isLua(ci)) { /* `common' yield? */ ++ /* finish interrupted execution of `OP_CALL' */ ++ lua_assert(GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_CALL || ++ GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_TAILCALL); ++ if (luaD_poscall(L, firstArg)) /* complete it... */ ++ L->top = L->ci->top; /* and correct top if not multiple results */ ++ } ++ else /* yielded inside a hook: just continue its execution */ ++ L->base = L->ci->base; ++ } ++ luaV_execute(L, cast_int(L->ci - L->base_ci)); ++} ++ ++ ++static int resume_error (lua_State *L, const char *msg) { ++ L->top = L->ci->base; ++ setsvalue2s(L, L->top, luaS_new(L, msg)); ++ incr_top(L); ++ lua_unlock(L); ++ return LUA_ERRRUN; ++} ++ ++ ++LUA_API int lua_resume (lua_State *L, int nargs) { ++ int status; ++ lua_lock(L); ++ if (L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci)) ++ return resume_error(L, "cannot resume non-suspended coroutine"); ++ if (L->nCcalls >= LUAI_MAXCCALLS) ++ return resume_error(L, "C stack overflow"); ++ luai_userstateresume(L, nargs); ++ lua_assert(L->errfunc == 0); ++ L->baseCcalls = ++L->nCcalls; ++ status = luaD_rawrunprotected(L, resume, L->top - nargs); ++ if (status != 0) { /* error? */ ++ L->status = cast_byte(status); /* mark thread as `dead' */ ++ luaD_seterrorobj(L, status, L->top); ++ L->ci->top = L->top; ++ } ++ else { ++ lua_assert(L->nCcalls == L->baseCcalls); ++ status = L->status; ++ } ++ --L->nCcalls; ++ lua_unlock(L); ++ return status; ++} ++ ++ ++LUA_API int lua_yield (lua_State *L, int nresults) { ++ luai_userstateyield(L, nresults); ++ lua_lock(L); ++ if (L->nCcalls > L->baseCcalls) ++ luaG_runerror(L, "attempt to yield across metamethod/C-call boundary"); ++ L->base = L->top - nresults; /* protect stack slots below */ ++ L->status = LUA_YIELD; ++ lua_unlock(L); ++ return -1; ++} ++ ++ ++int luaD_pcall (lua_State *L, Pfunc func, void *u, ++ ptrdiff_t old_top, ptrdiff_t ef) { ++ int status; ++ unsigned short oldnCcalls = L->nCcalls; ++ ptrdiff_t old_ci = saveci(L, L->ci); ++ lu_byte old_allowhooks = L->allowhook; ++ ptrdiff_t old_errfunc = L->errfunc; ++ L->errfunc = ef; ++ status = luaD_rawrunprotected(L, func, u); ++ if (status != 0) { /* an error occurred? */ ++ StkId oldtop = restorestack(L, old_top); ++ luaF_close(L, oldtop); /* close eventual pending closures */ ++ luaD_seterrorobj(L, status, oldtop); ++ L->nCcalls = oldnCcalls; ++ L->ci = restoreci(L, old_ci); ++ L->base = L->ci->base; ++ L->savedpc = L->ci->savedpc; ++ L->allowhook = old_allowhooks; ++ restore_stack_limit(L); ++ } ++ L->errfunc = old_errfunc; ++ return status; ++} ++ ++ ++ ++/* ++** Execute a protected parser. ++*/ ++struct SParser { /* data to `f_parser' */ ++ ZIO *z; ++ Mbuffer buff; /* buffer to be used by the scanner */ ++ const char *name; ++}; ++ ++static void f_parser (lua_State *L, void *ud) { ++ int i; ++ Proto *tf; ++ Closure *cl; ++ struct SParser *p = cast(struct SParser *, ud); ++ int c = luaZ_lookahead(p->z); ++ luaC_checkGC(L); ++ tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z, ++ &p->buff, p->name); ++ cl = luaF_newLclosure(L, tf->nups, hvalue(gt(L))); ++ cl->l.p = tf; ++ for (i = 0; i < tf->nups; i++) /* initialize eventual upvalues */ ++ cl->l.upvals[i] = luaF_newupval(L); ++ setclvalue(L, L->top, cl); ++ incr_top(L); ++} ++ ++ ++int luaD_protectedparser (lua_State *L, ZIO *z, const char *name) { ++ struct SParser p; ++ int status; ++ p.z = z; p.name = name; ++ luaZ_initbuffer(L, &p.buff); ++ status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc); ++ luaZ_freebuffer(L, &p.buff); ++ return status; ++} ++ +--- /dev/null ++++ b/extensions/LUA/lua/ldo.h +@@ -0,0 +1,57 @@ ++/* ++** $Id: ldo.h,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Stack and Call structure of Lua ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef ldo_h ++#define ldo_h ++ ++ ++#include "lobject.h" ++#include "lstate.h" ++#include "lzio.h" ++ ++ ++#define luaD_checkstack(L,n) \ ++ if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \ ++ luaD_growstack(L, n); \ ++ else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); ++ ++ ++#define incr_top(L) {luaD_checkstack(L,1); L->top++;} ++ ++#define savestack(L,p) ((char *)(p) - (char *)L->stack) ++#define restorestack(L,n) ((TValue *)((char *)L->stack + (n))) ++ ++#define saveci(L,p) ((char *)(p) - (char *)L->base_ci) ++#define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n))) ++ ++ ++/* results from luaD_precall */ ++#define PCRLUA 0 /* initiated a call to a Lua function */ ++#define PCRC 1 /* did a call to a C function */ ++#define PCRYIELD 2 /* C funtion yielded */ ++ ++ ++/* type of protected functions, to be ran by `runprotected' */ ++typedef void (*Pfunc) (lua_State *L, void *ud); ++ ++LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name); ++LUAI_FUNC void luaD_callhook (lua_State *L, int event, int line); ++LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults); ++LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); ++LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u, ++ ptrdiff_t oldtop, ptrdiff_t ef); ++LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult); ++LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize); ++LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); ++LUAI_FUNC void luaD_growstack (lua_State *L, int n); ++ ++LUAI_FUNC void luaD_throw (lua_State *L, int errcode); ++LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); ++ ++LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop); ++ ++#endif ++ +--- /dev/null ++++ b/extensions/LUA/lua/ldump.c +@@ -0,0 +1,164 @@ ++/* ++** $Id: ldump.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $ ++** save precompiled Lua chunks ++** See Copyright Notice in lua.h ++*/ ++ ++#include ++ ++#define ldump_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "lobject.h" ++#include "lstate.h" ++#include "lundump.h" ++ ++typedef struct { ++ lua_State* L; ++ lua_Writer writer; ++ void* data; ++ int strip; ++ int status; ++} DumpState; ++ ++#define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D) ++#define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D) ++ ++static void DumpBlock(const void* b, size_t size, DumpState* D) ++{ ++ if (D->status==0) ++ { ++ lua_unlock(D->L); ++ D->status=(*D->writer)(D->L,b,size,D->data); ++ lua_lock(D->L); ++ } ++} ++ ++static void DumpChar(int y, DumpState* D) ++{ ++ char x=(char)y; ++ DumpVar(x,D); ++} ++ ++static void DumpInt(int x, DumpState* D) ++{ ++ DumpVar(x,D); ++} ++ ++static void DumpNumber(lua_Number x, DumpState* D) ++{ ++ DumpVar(x,D); ++} ++ ++static void DumpVector(const void* b, int n, size_t size, DumpState* D) ++{ ++ DumpInt(n,D); ++ DumpMem(b,n,size,D); ++} ++ ++static void DumpString(const TString* s, DumpState* D) ++{ ++ if (s==NULL || getstr(s)==NULL) ++ { ++ size_t size=0; ++ DumpVar(size,D); ++ } ++ else ++ { ++ size_t size=s->tsv.len+1; /* include trailing '\0' */ ++ DumpVar(size,D); ++ DumpBlock(getstr(s),size,D); ++ } ++} ++ ++#define DumpCode(f,D) DumpVector(f->code,f->sizecode,sizeof(Instruction),D) ++ ++static void DumpFunction(const Proto* f, const TString* p, DumpState* D); ++ ++static void DumpConstants(const Proto* f, DumpState* D) ++{ ++ int i,n=f->sizek; ++ DumpInt(n,D); ++ for (i=0; ik[i]; ++ DumpChar(ttype(o),D); ++ switch (ttype(o)) ++ { ++ case LUA_TNIL: ++ break; ++ case LUA_TBOOLEAN: ++ DumpChar(bvalue(o),D); ++ break; ++ case LUA_TNUMBER: ++ DumpNumber(nvalue(o),D); ++ break; ++ case LUA_TSTRING: ++ DumpString(rawtsvalue(o),D); ++ break; ++ default: ++ lua_assert(0); /* cannot happen */ ++ break; ++ } ++ } ++ n=f->sizep; ++ DumpInt(n,D); ++ for (i=0; ip[i],f->source,D); ++} ++ ++static void DumpDebug(const Proto* f, DumpState* D) ++{ ++ int i,n; ++ n= (D->strip) ? 0 : f->sizelineinfo; ++ DumpVector(f->lineinfo,n,sizeof(int),D); ++ n= (D->strip) ? 0 : f->sizelocvars; ++ DumpInt(n,D); ++ for (i=0; ilocvars[i].varname,D); ++ DumpInt(f->locvars[i].startpc,D); ++ DumpInt(f->locvars[i].endpc,D); ++ } ++ n= (D->strip) ? 0 : f->sizeupvalues; ++ DumpInt(n,D); ++ for (i=0; iupvalues[i],D); ++} ++ ++static void DumpFunction(const Proto* f, const TString* p, DumpState* D) ++{ ++ DumpString((f->source==p || D->strip) ? NULL : f->source,D); ++ DumpInt(f->linedefined,D); ++ DumpInt(f->lastlinedefined,D); ++ DumpChar(f->nups,D); ++ DumpChar(f->numparams,D); ++ DumpChar(f->is_vararg,D); ++ DumpChar(f->maxstacksize,D); ++ DumpCode(f,D); ++ DumpConstants(f,D); ++ DumpDebug(f,D); ++} ++ ++static void DumpHeader(DumpState* D) ++{ ++ char h[LUAC_HEADERSIZE]; ++ luaU_header(h); ++ DumpBlock(h,LUAC_HEADERSIZE,D); ++} ++ ++/* ++** dump Lua function as precompiled chunk ++*/ ++int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) ++{ ++ DumpState D; ++ D.L=L; ++ D.writer=w; ++ D.data=data; ++ D.strip=strip; ++ D.status=0; ++ DumpHeader(&D); ++ DumpFunction(f,NULL,&D); ++ return D.status; ++} +--- /dev/null ++++ b/extensions/LUA/lua/lfunc.c +@@ -0,0 +1,174 @@ ++/* ++** $Id: lfunc.c,v 2.12.1.2 2007/12/28 14:58:43 roberto Exp $ ++** Auxiliary functions to manipulate prototypes and closures ++** See Copyright Notice in lua.h ++*/ ++ ++ ++#include ++ ++#define lfunc_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "lfunc.h" ++#include "lgc.h" ++#include "lmem.h" ++#include "lobject.h" ++#include "lstate.h" ++ ++ ++ ++Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e) { ++ Closure *c = cast(Closure *, luaM_malloc(L, sizeCclosure(nelems))); ++ luaC_link(L, obj2gco(c), LUA_TFUNCTION); ++ c->c.isC = 1; ++ c->c.env = e; ++ c->c.nupvalues = cast_byte(nelems); ++ return c; ++} ++ ++ ++Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e) { ++ Closure *c = cast(Closure *, luaM_malloc(L, sizeLclosure(nelems))); ++ luaC_link(L, obj2gco(c), LUA_TFUNCTION); ++ c->l.isC = 0; ++ c->l.env = e; ++ c->l.nupvalues = cast_byte(nelems); ++ while (nelems--) c->l.upvals[nelems] = NULL; ++ return c; ++} ++ ++ ++UpVal *luaF_newupval (lua_State *L) { ++ UpVal *uv = luaM_new(L, UpVal); ++ luaC_link(L, obj2gco(uv), LUA_TUPVAL); ++ uv->v = &uv->u.value; ++ setnilvalue(uv->v); ++ return uv; ++} ++ ++ ++UpVal *luaF_findupval (lua_State *L, StkId level) { ++ global_State *g = G(L); ++ GCObject **pp = &L->openupval; ++ UpVal *p; ++ UpVal *uv; ++ while (*pp != NULL && (p = ngcotouv(*pp))->v >= level) { ++ lua_assert(p->v != &p->u.value); ++ if (p->v == level) { /* found a corresponding upvalue? */ ++ if (isdead(g, obj2gco(p))) /* is it dead? */ ++ changewhite(obj2gco(p)); /* ressurect it */ ++ return p; ++ } ++ pp = &p->next; ++ } ++ uv = luaM_new(L, UpVal); /* not found: create a new one */ ++ uv->tt = LUA_TUPVAL; ++ uv->marked = luaC_white(g); ++ uv->v = level; /* current value lives in the stack */ ++ uv->next = *pp; /* chain it in the proper position */ ++ *pp = obj2gco(uv); ++ uv->u.l.prev = &g->uvhead; /* double link it in `uvhead' list */ ++ uv->u.l.next = g->uvhead.u.l.next; ++ uv->u.l.next->u.l.prev = uv; ++ g->uvhead.u.l.next = uv; ++ lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); ++ return uv; ++} ++ ++ ++static void unlinkupval (UpVal *uv) { ++ lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); ++ uv->u.l.next->u.l.prev = uv->u.l.prev; /* remove from `uvhead' list */ ++ uv->u.l.prev->u.l.next = uv->u.l.next; ++} ++ ++ ++void luaF_freeupval (lua_State *L, UpVal *uv) { ++ if (uv->v != &uv->u.value) /* is it open? */ ++ unlinkupval(uv); /* remove from open list */ ++ luaM_free(L, uv); /* free upvalue */ ++} ++ ++ ++void luaF_close (lua_State *L, StkId level) { ++ UpVal *uv; ++ global_State *g = G(L); ++ while (L->openupval != NULL && (uv = ngcotouv(L->openupval))->v >= level) { ++ GCObject *o = obj2gco(uv); ++ lua_assert(!isblack(o) && uv->v != &uv->u.value); ++ L->openupval = uv->next; /* remove from `open' list */ ++ if (isdead(g, o)) ++ luaF_freeupval(L, uv); /* free upvalue */ ++ else { ++ unlinkupval(uv); ++ setobj(L, &uv->u.value, uv->v); ++ uv->v = &uv->u.value; /* now current value lives here */ ++ luaC_linkupval(L, uv); /* link upvalue into `gcroot' list */ ++ } ++ } ++} ++ ++ ++Proto *luaF_newproto (lua_State *L) { ++ Proto *f = luaM_new(L, Proto); ++ luaC_link(L, obj2gco(f), LUA_TPROTO); ++ f->k = NULL; ++ f->sizek = 0; ++ f->p = NULL; ++ f->sizep = 0; ++ f->code = NULL; ++ f->sizecode = 0; ++ f->sizelineinfo = 0; ++ f->sizeupvalues = 0; ++ f->nups = 0; ++ f->upvalues = NULL; ++ f->numparams = 0; ++ f->is_vararg = 0; ++ f->maxstacksize = 0; ++ f->lineinfo = NULL; ++ f->sizelocvars = 0; ++ f->locvars = NULL; ++ f->linedefined = 0; ++ f->lastlinedefined = 0; ++ f->source = NULL; ++ return f; ++} ++ ++ ++void luaF_freeproto (lua_State *L, Proto *f) { ++ luaM_freearray(L, f->code, f->sizecode, Instruction); ++ luaM_freearray(L, f->p, f->sizep, Proto *); ++ luaM_freearray(L, f->k, f->sizek, TValue); ++ luaM_freearray(L, f->lineinfo, f->sizelineinfo, int); ++ luaM_freearray(L, f->locvars, f->sizelocvars, struct LocVar); ++ luaM_freearray(L, f->upvalues, f->sizeupvalues, TString *); ++ luaM_free(L, f); ++} ++ ++ ++void luaF_freeclosure (lua_State *L, Closure *c) { ++ int size = (c->c.isC) ? sizeCclosure(c->c.nupvalues) : ++ sizeLclosure(c->l.nupvalues); ++ luaM_freemem(L, c, size); ++} ++ ++ ++/* ++** Look for n-th local variable at line `line' in function `func'. ++** Returns NULL if not found. ++*/ ++const char *luaF_getlocalname (const Proto *f, int local_number, int pc) { ++ int i; ++ for (i = 0; isizelocvars && f->locvars[i].startpc <= pc; i++) { ++ if (pc < f->locvars[i].endpc) { /* is variable active? */ ++ local_number--; ++ if (local_number == 0) ++ return getstr(f->locvars[i].varname); ++ } ++ } ++ return NULL; /* not found */ ++} ++ +--- /dev/null ++++ b/extensions/LUA/lua/lfunc.h +@@ -0,0 +1,34 @@ ++/* ++** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Auxiliary functions to manipulate prototypes and closures ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef lfunc_h ++#define lfunc_h ++ ++ ++#include "lobject.h" ++ ++ ++#define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ ++ cast(int, sizeof(TValue)*((n)-1))) ++ ++#define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ ++ cast(int, sizeof(TValue *)*((n)-1))) ++ ++ ++LUAI_FUNC Proto *luaF_newproto (lua_State *L); ++LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e); ++LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e); ++LUAI_FUNC UpVal *luaF_newupval (lua_State *L); ++LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); ++LUAI_FUNC void luaF_close (lua_State *L, StkId level); ++LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); ++LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c); ++LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv); ++LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, ++ int pc); ++ ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/lgc.c +@@ -0,0 +1,711 @@ ++/* ++** $Id: lgc.c,v 2.38.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Garbage Collector ++** See Copyright Notice in lua.h ++*/ ++ ++#include ++ ++#define lgc_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "ldebug.h" ++#include "ldo.h" ++#include "lfunc.h" ++#include "lgc.h" ++#include "lmem.h" ++#include "lobject.h" ++#include "lstate.h" ++#include "lstring.h" ++#include "ltable.h" ++#include "ltm.h" ++ ++ ++#define GCSTEPSIZE 1024u ++#define GCSWEEPMAX 40 ++#define GCSWEEPCOST 10 ++#define GCFINALIZECOST 100 ++ ++ ++#define maskmarks cast_byte(~(bitmask(BLACKBIT)|WHITEBITS)) ++ ++#define makewhite(g,x) \ ++ ((x)->gch.marked = cast_byte(((x)->gch.marked & maskmarks) | luaC_white(g))) ++ ++#define white2gray(x) reset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT) ++#define black2gray(x) resetbit((x)->gch.marked, BLACKBIT) ++ ++#define stringmark(s) reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT) ++ ++ ++#define isfinalized(u) testbit((u)->marked, FINALIZEDBIT) ++#define markfinalized(u) l_setbit((u)->marked, FINALIZEDBIT) ++ ++ ++#define KEYWEAK bitmask(KEYWEAKBIT) ++#define VALUEWEAK bitmask(VALUEWEAKBIT) ++ ++ ++ ++#define markvalue(g,o) { checkconsistency(o); \ ++ if (iscollectable(o) && iswhite(gcvalue(o))) reallymarkobject(g,gcvalue(o)); } ++ ++#define markobject(g,t) { if (iswhite(obj2gco(t))) \ ++ reallymarkobject(g, obj2gco(t)); } ++ ++ ++#define setthreshold(g) (g->GCthreshold = (g->estimate/100) * g->gcpause) ++ ++ ++static void removeentry (Node *n) { ++ lua_assert(ttisnil(gval(n))); ++ if (iscollectable(gkey(n))) ++ setttype(gkey(n), LUA_TDEADKEY); /* dead key; remove it */ ++} ++ ++ ++static void reallymarkobject (global_State *g, GCObject *o) { ++ lua_assert(iswhite(o) && !isdead(g, o)); ++ white2gray(o); ++ switch (o->gch.tt) { ++ case LUA_TSTRING: { ++ return; ++ } ++ case LUA_TUSERDATA: { ++ Table *mt = gco2u(o)->metatable; ++ gray2black(o); /* udata are never gray */ ++ if (mt) markobject(g, mt); ++ markobject(g, gco2u(o)->env); ++ return; ++ } ++ case LUA_TUPVAL: { ++ UpVal *uv = gco2uv(o); ++ markvalue(g, uv->v); ++ if (uv->v == &uv->u.value) /* closed? */ ++ gray2black(o); /* open upvalues are never black */ ++ return; ++ } ++ case LUA_TFUNCTION: { ++ gco2cl(o)->c.gclist = g->gray; ++ g->gray = o; ++ break; ++ } ++ case LUA_TTABLE: { ++ gco2h(o)->gclist = g->gray; ++ g->gray = o; ++ break; ++ } ++ case LUA_TTHREAD: { ++ gco2th(o)->gclist = g->gray; ++ g->gray = o; ++ break; ++ } ++ case LUA_TPROTO: { ++ gco2p(o)->gclist = g->gray; ++ g->gray = o; ++ break; ++ } ++ default: lua_assert(0); ++ } ++} ++ ++ ++static void marktmu (global_State *g) { ++ GCObject *u = g->tmudata; ++ if (u) { ++ do { ++ u = u->gch.next; ++ makewhite(g, u); /* may be marked, if left from previous GC */ ++ reallymarkobject(g, u); ++ } while (u != g->tmudata); ++ } ++} ++ ++ ++/* move `dead' udata that need finalization to list `tmudata' */ ++size_t luaC_separateudata (lua_State *L, int all) { ++ global_State *g = G(L); ++ size_t deadmem = 0; ++ GCObject **p = &g->mainthread->next; ++ GCObject *curr; ++ while ((curr = *p) != NULL) { ++ if (!(iswhite(curr) || all) || isfinalized(gco2u(curr))) ++ p = &curr->gch.next; /* don't bother with them */ ++ else if (fasttm(L, gco2u(curr)->metatable, TM_GC) == NULL) { ++ markfinalized(gco2u(curr)); /* don't need finalization */ ++ p = &curr->gch.next; ++ } ++ else { /* must call its gc method */ ++ deadmem += sizeudata(gco2u(curr)); ++ markfinalized(gco2u(curr)); ++ *p = curr->gch.next; ++ /* link `curr' at the end of `tmudata' list */ ++ if (g->tmudata == NULL) /* list is empty? */ ++ g->tmudata = curr->gch.next = curr; /* creates a circular list */ ++ else { ++ curr->gch.next = g->tmudata->gch.next; ++ g->tmudata->gch.next = curr; ++ g->tmudata = curr; ++ } ++ } ++ } ++ return deadmem; ++} ++ ++ ++static int traversetable (global_State *g, Table *h) { ++ int i; ++ int weakkey = 0; ++ int weakvalue = 0; ++ const TValue *mode; ++ if (h->metatable) ++ markobject(g, h->metatable); ++ mode = gfasttm(g, h->metatable, TM_MODE); ++ if (mode && ttisstring(mode)) { /* is there a weak mode? */ ++ weakkey = (strchr(svalue(mode), 'k') != NULL); ++ weakvalue = (strchr(svalue(mode), 'v') != NULL); ++ if (weakkey || weakvalue) { /* is really weak? */ ++ h->marked &= ~(KEYWEAK | VALUEWEAK); /* clear bits */ ++ h->marked |= cast_byte((weakkey << KEYWEAKBIT) | ++ (weakvalue << VALUEWEAKBIT)); ++ h->gclist = g->weak; /* must be cleared after GC, ... */ ++ g->weak = obj2gco(h); /* ... so put in the appropriate list */ ++ } ++ } ++ if (weakkey && weakvalue) return 1; ++ if (!weakvalue) { ++ i = h->sizearray; ++ while (i--) ++ markvalue(g, &h->array[i]); ++ } ++ i = sizenode(h); ++ while (i--) { ++ Node *n = gnode(h, i); ++ lua_assert(ttype(gkey(n)) != LUA_TDEADKEY || ttisnil(gval(n))); ++ if (ttisnil(gval(n))) ++ removeentry(n); /* remove empty entries */ ++ else { ++ lua_assert(!ttisnil(gkey(n))); ++ if (!weakkey) markvalue(g, gkey(n)); ++ if (!weakvalue) markvalue(g, gval(n)); ++ } ++ } ++ return weakkey || weakvalue; ++} ++ ++ ++/* ++** All marks are conditional because a GC may happen while the ++** prototype is still being created ++*/ ++static void traverseproto (global_State *g, Proto *f) { ++ int i; ++ if (f->source) stringmark(f->source); ++ for (i=0; isizek; i++) /* mark literals */ ++ markvalue(g, &f->k[i]); ++ for (i=0; isizeupvalues; i++) { /* mark upvalue names */ ++ if (f->upvalues[i]) ++ stringmark(f->upvalues[i]); ++ } ++ for (i=0; isizep; i++) { /* mark nested protos */ ++ if (f->p[i]) ++ markobject(g, f->p[i]); ++ } ++ for (i=0; isizelocvars; i++) { /* mark local-variable names */ ++ if (f->locvars[i].varname) ++ stringmark(f->locvars[i].varname); ++ } ++} ++ ++ ++ ++static void traverseclosure (global_State *g, Closure *cl) { ++ markobject(g, cl->c.env); ++ if (cl->c.isC) { ++ int i; ++ for (i=0; ic.nupvalues; i++) /* mark its upvalues */ ++ markvalue(g, &cl->c.upvalue[i]); ++ } ++ else { ++ int i; ++ lua_assert(cl->l.nupvalues == cl->l.p->nups); ++ markobject(g, cl->l.p); ++ for (i=0; il.nupvalues; i++) /* mark its upvalues */ ++ markobject(g, cl->l.upvals[i]); ++ } ++} ++ ++ ++static void checkstacksizes (lua_State *L, StkId max) { ++ int ci_used = cast_int(L->ci - L->base_ci); /* number of `ci' in use */ ++ int s_used = cast_int(max - L->stack); /* part of stack in use */ ++ if (L->size_ci > LUAI_MAXCALLS) /* handling overflow? */ ++ return; /* do not touch the stacks */ ++ if (4*ci_used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci) ++ luaD_reallocCI(L, L->size_ci/2); /* still big enough... */ ++ condhardstacktests(luaD_reallocCI(L, ci_used + 1)); ++ if (4*s_used < L->stacksize && ++ 2*(BASIC_STACK_SIZE+EXTRA_STACK) < L->stacksize) ++ luaD_reallocstack(L, L->stacksize/2); /* still big enough... */ ++ condhardstacktests(luaD_reallocstack(L, s_used)); ++} ++ ++ ++static void traversestack (global_State *g, lua_State *l) { ++ StkId o, lim; ++ CallInfo *ci; ++ markvalue(g, gt(l)); ++ lim = l->top; ++ for (ci = l->base_ci; ci <= l->ci; ci++) { ++ lua_assert(ci->top <= l->stack_last); ++ if (lim < ci->top) lim = ci->top; ++ } ++ for (o = l->stack; o < l->top; o++) ++ markvalue(g, o); ++ for (; o <= lim; o++) ++ setnilvalue(o); ++ checkstacksizes(l, lim); ++} ++ ++ ++/* ++** traverse one gray object, turning it to black. ++** Returns `quantity' traversed. ++*/ ++static l_mem propagatemark (global_State *g) { ++ GCObject *o = g->gray; ++ lua_assert(isgray(o)); ++ gray2black(o); ++ switch (o->gch.tt) { ++ case LUA_TTABLE: { ++ Table *h = gco2h(o); ++ g->gray = h->gclist; ++ if (traversetable(g, h)) /* table is weak? */ ++ black2gray(o); /* keep it gray */ ++ return sizeof(Table) + sizeof(TValue) * h->sizearray + ++ sizeof(Node) * sizenode(h); ++ } ++ case LUA_TFUNCTION: { ++ Closure *cl = gco2cl(o); ++ g->gray = cl->c.gclist; ++ traverseclosure(g, cl); ++ return (cl->c.isC) ? sizeCclosure(cl->c.nupvalues) : ++ sizeLclosure(cl->l.nupvalues); ++ } ++ case LUA_TTHREAD: { ++ lua_State *th = gco2th(o); ++ g->gray = th->gclist; ++ th->gclist = g->grayagain; ++ g->grayagain = o; ++ black2gray(o); ++ traversestack(g, th); ++ return sizeof(lua_State) + sizeof(TValue) * th->stacksize + ++ sizeof(CallInfo) * th->size_ci; ++ } ++ case LUA_TPROTO: { ++ Proto *p = gco2p(o); ++ g->gray = p->gclist; ++ traverseproto(g, p); ++ return sizeof(Proto) + sizeof(Instruction) * p->sizecode + ++ sizeof(Proto *) * p->sizep + ++ sizeof(TValue) * p->sizek + ++ sizeof(int) * p->sizelineinfo + ++ sizeof(LocVar) * p->sizelocvars + ++ sizeof(TString *) * p->sizeupvalues; ++ } ++ default: lua_assert(0); return 0; ++ } ++} ++ ++ ++static size_t propagateall (global_State *g) { ++ size_t m = 0; ++ while (g->gray) m += propagatemark(g); ++ return m; ++} ++ ++ ++/* ++** The next function tells whether a key or value can be cleared from ++** a weak table. Non-collectable objects are never removed from weak ++** tables. Strings behave as `values', so are never removed too. for ++** other objects: if really collected, cannot keep them; for userdata ++** being finalized, keep them in keys, but not in values ++*/ ++static int iscleared (const TValue *o, int iskey) { ++ if (!iscollectable(o)) return 0; ++ if (ttisstring(o)) { ++ stringmark(rawtsvalue(o)); /* strings are `values', so are never weak */ ++ return 0; ++ } ++ return iswhite(gcvalue(o)) || ++ (ttisuserdata(o) && (!iskey && isfinalized(uvalue(o)))); ++} ++ ++ ++/* ++** clear collected entries from weaktables ++*/ ++static void cleartable (GCObject *l) { ++ while (l) { ++ Table *h = gco2h(l); ++ int i = h->sizearray; ++ lua_assert(testbit(h->marked, VALUEWEAKBIT) || ++ testbit(h->marked, KEYWEAKBIT)); ++ if (testbit(h->marked, VALUEWEAKBIT)) { ++ while (i--) { ++ TValue *o = &h->array[i]; ++ if (iscleared(o, 0)) /* value was collected? */ ++ setnilvalue(o); /* remove value */ ++ } ++ } ++ i = sizenode(h); ++ while (i--) { ++ Node *n = gnode(h, i); ++ if (!ttisnil(gval(n)) && /* non-empty entry? */ ++ (iscleared(key2tval(n), 1) || iscleared(gval(n), 0))) { ++ setnilvalue(gval(n)); /* remove value ... */ ++ removeentry(n); /* remove entry from table */ ++ } ++ } ++ l = h->gclist; ++ } ++} ++ ++ ++static void freeobj (lua_State *L, GCObject *o) { ++ switch (o->gch.tt) { ++ case LUA_TPROTO: luaF_freeproto(L, gco2p(o)); break; ++ case LUA_TFUNCTION: luaF_freeclosure(L, gco2cl(o)); break; ++ case LUA_TUPVAL: luaF_freeupval(L, gco2uv(o)); break; ++ case LUA_TTABLE: luaH_free(L, gco2h(o)); break; ++ case LUA_TTHREAD: { ++ lua_assert(gco2th(o) != L && gco2th(o) != G(L)->mainthread); ++ luaE_freethread(L, gco2th(o)); ++ break; ++ } ++ case LUA_TSTRING: { ++ G(L)->strt.nuse--; ++ luaM_freemem(L, o, sizestring(gco2ts(o))); ++ break; ++ } ++ case LUA_TUSERDATA: { ++ luaM_freemem(L, o, sizeudata(gco2u(o))); ++ break; ++ } ++ default: lua_assert(0); ++ } ++} ++ ++ ++ ++#define sweepwholelist(L,p) sweeplist(L,p,MAX_LUMEM) ++ ++ ++static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) { ++ GCObject *curr; ++ global_State *g = G(L); ++ int deadmask = otherwhite(g); ++ while ((curr = *p) != NULL && count-- > 0) { ++ if (curr->gch.tt == LUA_TTHREAD) /* sweep open upvalues of each thread */ ++ sweepwholelist(L, &gco2th(curr)->openupval); ++ if ((curr->gch.marked ^ WHITEBITS) & deadmask) { /* not dead? */ ++ lua_assert(!isdead(g, curr) || testbit(curr->gch.marked, FIXEDBIT)); ++ makewhite(g, curr); /* make it white (for next cycle) */ ++ p = &curr->gch.next; ++ } ++ else { /* must erase `curr' */ ++ lua_assert(isdead(g, curr) || deadmask == bitmask(SFIXEDBIT)); ++ *p = curr->gch.next; ++ if (curr == g->rootgc) /* is the first element of the list? */ ++ g->rootgc = curr->gch.next; /* adjust first */ ++ freeobj(L, curr); ++ } ++ } ++ return p; ++} ++ ++ ++static void checkSizes (lua_State *L) { ++ global_State *g = G(L); ++ /* check size of string hash */ ++ if (g->strt.nuse < cast(lu_int32, g->strt.size/4) && ++ g->strt.size > MINSTRTABSIZE*2) ++ luaS_resize(L, g->strt.size/2); /* table is too big */ ++ /* check size of buffer */ ++ if (luaZ_sizebuffer(&g->buff) > LUA_MINBUFFER*2) { /* buffer too big? */ ++ size_t newsize = luaZ_sizebuffer(&g->buff) / 2; ++ luaZ_resizebuffer(L, &g->buff, newsize); ++ } ++} ++ ++ ++static void GCTM (lua_State *L) { ++ global_State *g = G(L); ++ GCObject *o = g->tmudata->gch.next; /* get first element */ ++ Udata *udata = rawgco2u(o); ++ const TValue *tm; ++ /* remove udata from `tmudata' */ ++ if (o == g->tmudata) /* last element? */ ++ g->tmudata = NULL; ++ else ++ g->tmudata->gch.next = udata->uv.next; ++ udata->uv.next = g->mainthread->next; /* return it to `root' list */ ++ g->mainthread->next = o; ++ makewhite(g, o); ++ tm = fasttm(L, udata->uv.metatable, TM_GC); ++ if (tm != NULL) { ++ lu_byte oldah = L->allowhook; ++ lu_mem oldt = g->GCthreshold; ++ L->allowhook = 0; /* stop debug hooks during GC tag method */ ++ g->GCthreshold = 2*g->totalbytes; /* avoid GC steps */ ++ setobj2s(L, L->top, tm); ++ setuvalue(L, L->top+1, udata); ++ L->top += 2; ++ luaD_call(L, L->top - 2, 0); ++ L->allowhook = oldah; /* restore hooks */ ++ g->GCthreshold = oldt; /* restore threshold */ ++ } ++} ++ ++ ++/* ++** Call all GC tag methods ++*/ ++void luaC_callGCTM (lua_State *L) { ++ while (G(L)->tmudata) ++ GCTM(L); ++} ++ ++ ++void luaC_freeall (lua_State *L) { ++ global_State *g = G(L); ++ int i; ++ g->currentwhite = WHITEBITS | bitmask(SFIXEDBIT); /* mask to collect all elements */ ++ sweepwholelist(L, &g->rootgc); ++ for (i = 0; i < g->strt.size; i++) /* free all string lists */ ++ sweepwholelist(L, &g->strt.hash[i]); ++} ++ ++ ++static void markmt (global_State *g) { ++ int i; ++ for (i=0; imt[i]) markobject(g, g->mt[i]); ++} ++ ++ ++/* mark root set */ ++static void markroot (lua_State *L) { ++ global_State *g = G(L); ++ g->gray = NULL; ++ g->grayagain = NULL; ++ g->weak = NULL; ++ markobject(g, g->mainthread); ++ /* make global table be traversed before main stack */ ++ markvalue(g, gt(g->mainthread)); ++ markvalue(g, registry(L)); ++ markmt(g); ++ g->gcstate = GCSpropagate; ++} ++ ++ ++static void remarkupvals (global_State *g) { ++ UpVal *uv; ++ for (uv = g->uvhead.u.l.next; uv != &g->uvhead; uv = uv->u.l.next) { ++ lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); ++ if (isgray(obj2gco(uv))) ++ markvalue(g, uv->v); ++ } ++} ++ ++ ++static void atomic (lua_State *L) { ++ global_State *g = G(L); ++ size_t udsize; /* total size of userdata to be finalized */ ++ /* remark occasional upvalues of (maybe) dead threads */ ++ remarkupvals(g); ++ /* traverse objects cautch by write barrier and by 'remarkupvals' */ ++ propagateall(g); ++ /* remark weak tables */ ++ g->gray = g->weak; ++ g->weak = NULL; ++ lua_assert(!iswhite(obj2gco(g->mainthread))); ++ markobject(g, L); /* mark running thread */ ++ markmt(g); /* mark basic metatables (again) */ ++ propagateall(g); ++ /* remark gray again */ ++ g->gray = g->grayagain; ++ g->grayagain = NULL; ++ propagateall(g); ++ udsize = luaC_separateudata(L, 0); /* separate userdata to be finalized */ ++ marktmu(g); /* mark `preserved' userdata */ ++ udsize += propagateall(g); /* remark, to propagate `preserveness' */ ++ cleartable(g->weak); /* remove collected objects from weak tables */ ++ /* flip current white */ ++ g->currentwhite = cast_byte(otherwhite(g)); ++ g->sweepstrgc = 0; ++ g->sweepgc = &g->rootgc; ++ g->gcstate = GCSsweepstring; ++ g->estimate = g->totalbytes - udsize; /* first estimate */ ++} ++ ++ ++static l_mem singlestep (lua_State *L) { ++ global_State *g = G(L); ++ /*lua_checkmemory(L);*/ ++ switch (g->gcstate) { ++ case GCSpause: { ++ markroot(L); /* start a new collection */ ++ return 0; ++ } ++ case GCSpropagate: { ++ if (g->gray) ++ return propagatemark(g); ++ else { /* no more `gray' objects */ ++ atomic(L); /* finish mark phase */ ++ return 0; ++ } ++ } ++ case GCSsweepstring: { ++ lu_mem old = g->totalbytes; ++ sweepwholelist(L, &g->strt.hash[g->sweepstrgc++]); ++ if (g->sweepstrgc >= g->strt.size) /* nothing more to sweep? */ ++ g->gcstate = GCSsweep; /* end sweep-string phase */ ++ lua_assert(old >= g->totalbytes); ++ g->estimate -= old - g->totalbytes; ++ return GCSWEEPCOST; ++ } ++ case GCSsweep: { ++ lu_mem old = g->totalbytes; ++ g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX); ++ if (*g->sweepgc == NULL) { /* nothing more to sweep? */ ++ checkSizes(L); ++ g->gcstate = GCSfinalize; /* end sweep phase */ ++ } ++ lua_assert(old >= g->totalbytes); ++ g->estimate -= old - g->totalbytes; ++ return GCSWEEPMAX*GCSWEEPCOST; ++ } ++ case GCSfinalize: { ++ if (g->tmudata) { ++ GCTM(L); ++ if (g->estimate > GCFINALIZECOST) ++ g->estimate -= GCFINALIZECOST; ++ return GCFINALIZECOST; ++ } ++ else { ++ g->gcstate = GCSpause; /* end collection */ ++ g->gcdept = 0; ++ return 0; ++ } ++ } ++ default: lua_assert(0); return 0; ++ } ++} ++ ++ ++void luaC_step (lua_State *L) { ++ global_State *g = G(L); ++ l_mem lim = (GCSTEPSIZE/100) * g->gcstepmul; ++ if (lim == 0) ++ lim = (MAX_LUMEM-1)/2; /* no limit */ ++ g->gcdept += g->totalbytes - g->GCthreshold; ++ do { ++ lim -= singlestep(L); ++ if (g->gcstate == GCSpause) ++ break; ++ } while (lim > 0); ++ if (g->gcstate != GCSpause) { ++ if (g->gcdept < GCSTEPSIZE) ++ g->GCthreshold = g->totalbytes + GCSTEPSIZE; /* - lim/g->gcstepmul;*/ ++ else { ++ g->gcdept -= GCSTEPSIZE; ++ g->GCthreshold = g->totalbytes; ++ } ++ } ++ else { ++ lua_assert(g->totalbytes >= g->estimate); ++ setthreshold(g); ++ } ++} ++ ++ ++void luaC_fullgc (lua_State *L) { ++ global_State *g = G(L); ++ if (g->gcstate <= GCSpropagate) { ++ /* reset sweep marks to sweep all elements (returning them to white) */ ++ g->sweepstrgc = 0; ++ g->sweepgc = &g->rootgc; ++ /* reset other collector lists */ ++ g->gray = NULL; ++ g->grayagain = NULL; ++ g->weak = NULL; ++ g->gcstate = GCSsweepstring; ++ } ++ lua_assert(g->gcstate != GCSpause && g->gcstate != GCSpropagate); ++ /* finish any pending sweep phase */ ++ while (g->gcstate != GCSfinalize) { ++ lua_assert(g->gcstate == GCSsweepstring || g->gcstate == GCSsweep); ++ singlestep(L); ++ } ++ markroot(L); ++ while (g->gcstate != GCSpause) { ++ singlestep(L); ++ } ++ setthreshold(g); ++} ++ ++ ++void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v) { ++ global_State *g = G(L); ++ lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); ++ lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); ++ lua_assert(ttype(&o->gch) != LUA_TTABLE); ++ /* must keep invariant? */ ++ if (g->gcstate == GCSpropagate) ++ reallymarkobject(g, v); /* restore invariant */ ++ else /* don't mind */ ++ makewhite(g, o); /* mark as white just to avoid other barriers */ ++} ++ ++ ++void luaC_barrierback (lua_State *L, Table *t) { ++ global_State *g = G(L); ++ GCObject *o = obj2gco(t); ++ lua_assert(isblack(o) && !isdead(g, o)); ++ lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); ++ black2gray(o); /* make table gray (again) */ ++ t->gclist = g->grayagain; ++ g->grayagain = o; ++} ++ ++ ++void luaC_link (lua_State *L, GCObject *o, lu_byte tt) { ++ global_State *g = G(L); ++ o->gch.next = g->rootgc; ++ g->rootgc = o; ++ o->gch.marked = luaC_white(g); ++ o->gch.tt = tt; ++} ++ ++ ++void luaC_linkupval (lua_State *L, UpVal *uv) { ++ global_State *g = G(L); ++ GCObject *o = obj2gco(uv); ++ o->gch.next = g->rootgc; /* link upvalue into `rootgc' list */ ++ g->rootgc = o; ++ if (isgray(o)) { ++ if (g->gcstate == GCSpropagate) { ++ gray2black(o); /* closed upvalues need barrier */ ++ luaC_barrier(L, uv, uv->v); ++ } ++ else { /* sweep phase: sweep it (turning it into white) */ ++ makewhite(g, o); ++ lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); ++ } ++ } ++} ++ +--- /dev/null ++++ b/extensions/LUA/lua/lgc.h +@@ -0,0 +1,110 @@ ++/* ++** $Id: lgc.h,v 2.15.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Garbage Collector ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef lgc_h ++#define lgc_h ++ ++ ++#include "lobject.h" ++ ++ ++/* ++** Possible states of the Garbage Collector ++*/ ++#define GCSpause 0 ++#define GCSpropagate 1 ++#define GCSsweepstring 2 ++#define GCSsweep 3 ++#define GCSfinalize 4 ++ ++ ++/* ++** some userful bit tricks ++*/ ++#define resetbits(x,m) ((x) &= cast(lu_byte, ~(m))) ++#define setbits(x,m) ((x) |= (m)) ++#define testbits(x,m) ((x) & (m)) ++#define bitmask(b) (1<<(b)) ++#define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2)) ++#define l_setbit(x,b) setbits(x, bitmask(b)) ++#define resetbit(x,b) resetbits(x, bitmask(b)) ++#define testbit(x,b) testbits(x, bitmask(b)) ++#define set2bits(x,b1,b2) setbits(x, (bit2mask(b1, b2))) ++#define reset2bits(x,b1,b2) resetbits(x, (bit2mask(b1, b2))) ++#define test2bits(x,b1,b2) testbits(x, (bit2mask(b1, b2))) ++ ++ ++ ++/* ++** Layout for bit use in `marked' field: ++** bit 0 - object is white (type 0) ++** bit 1 - object is white (type 1) ++** bit 2 - object is black ++** bit 3 - for userdata: has been finalized ++** bit 3 - for tables: has weak keys ++** bit 4 - for tables: has weak values ++** bit 5 - object is fixed (should not be collected) ++** bit 6 - object is "super" fixed (only the main thread) ++*/ ++ ++ ++#define WHITE0BIT 0 ++#define WHITE1BIT 1 ++#define BLACKBIT 2 ++#define FINALIZEDBIT 3 ++#define KEYWEAKBIT 3 ++#define VALUEWEAKBIT 4 ++#define FIXEDBIT 5 ++#define SFIXEDBIT 6 ++#define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT) ++ ++ ++#define iswhite(x) test2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT) ++#define isblack(x) testbit((x)->gch.marked, BLACKBIT) ++#define isgray(x) (!isblack(x) && !iswhite(x)) ++ ++#define otherwhite(g) (g->currentwhite ^ WHITEBITS) ++#define isdead(g,v) ((v)->gch.marked & otherwhite(g) & WHITEBITS) ++ ++#define changewhite(x) ((x)->gch.marked ^= WHITEBITS) ++#define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT) ++ ++#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x))) ++ ++#define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) ++ ++ ++#define luaC_checkGC(L) { \ ++ condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); \ ++ if (G(L)->totalbytes >= G(L)->GCthreshold) \ ++ luaC_step(L); } ++ ++ ++#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \ ++ luaC_barrierf(L,obj2gco(p),gcvalue(v)); } ++ ++#define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t))) \ ++ luaC_barrierback(L,t); } ++ ++#define luaC_objbarrier(L,p,o) \ ++ { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \ ++ luaC_barrierf(L,obj2gco(p),obj2gco(o)); } ++ ++#define luaC_objbarriert(L,t,o) \ ++ { if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); } ++ ++LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all); ++LUAI_FUNC void luaC_callGCTM (lua_State *L); ++LUAI_FUNC void luaC_freeall (lua_State *L); ++LUAI_FUNC void luaC_step (lua_State *L); ++LUAI_FUNC void luaC_fullgc (lua_State *L); ++LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt); ++LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv); ++LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v); ++LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t); ++ ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/llex.c +@@ -0,0 +1,460 @@ ++/* ++** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Lexical Analyzer ++** See Copyright Notice in lua.h ++*/ ++ ++#include ++#include ++#include ++ ++#define llex_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "ldo.h" ++#include "llex.h" ++#include "lobject.h" ++#include "lparser.h" ++#include "lstate.h" ++#include "lstring.h" ++#include "ltable.h" ++#include "lzio.h" ++ ++ ++ ++#define next(ls) (ls->current = zgetc(ls->z)) ++ ++ ++ ++ ++#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r') ++ ++ ++/* ORDER RESERVED */ ++const char *const luaX_tokens [] = { ++ "and", "break", "do", "else", "elseif", ++ "end", "false", "for", "function", "if", ++ "in", "local", "nil", "not", "or", "repeat", ++ "return", "then", "true", "until", "while", ++ "..", "...", "==", ">=", "<=", "~=", ++ "", "", "", "", ++ NULL ++}; ++ ++ ++#define save_and_next(ls) (save(ls, ls->current), next(ls)) ++ ++ ++static void save (LexState *ls, int c) { ++ Mbuffer *b = ls->buff; ++ if (b->n + 1 > b->buffsize) { ++ size_t newsize; ++ if (b->buffsize >= MAX_SIZET/2) ++ luaX_lexerror(ls, "lexical element too long", 0); ++ newsize = b->buffsize * 2; ++ luaZ_resizebuffer(ls->L, b, newsize); ++ } ++ b->buffer[b->n++] = cast(char, c); ++} ++ ++ ++void luaX_init (lua_State *L) { ++ int i; ++ for (i=0; itsv.reserved = cast_byte(i+1); /* reserved word */ ++ } ++} ++ ++ ++#define MAXSRC 80 ++ ++ ++const char *luaX_token2str (LexState *ls, int token) { ++ if (token < FIRST_RESERVED) { ++ lua_assert(token == cast(unsigned char, token)); ++ return (iscntrl(token)) ? luaO_pushfstring(ls->L, "char(%d)", token) : ++ luaO_pushfstring(ls->L, "%c", token); ++ } ++ else ++ return luaX_tokens[token-FIRST_RESERVED]; ++} ++ ++ ++static const char *txtToken (LexState *ls, int token) { ++ switch (token) { ++ case TK_NAME: ++ case TK_STRING: ++ case TK_NUMBER: ++ save(ls, '\0'); ++ return luaZ_buffer(ls->buff); ++ default: ++ return luaX_token2str(ls, token); ++ } ++} ++ ++ ++void luaX_lexerror (LexState *ls, const char *msg, int token) { ++ char buff[MAXSRC]; ++ luaO_chunkid(buff, getstr(ls->source), MAXSRC); ++ msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg); ++ if (token) ++ luaO_pushfstring(ls->L, "%s near " LUA_QS, msg, txtToken(ls, token)); ++ luaD_throw(ls->L, LUA_ERRSYNTAX); ++} ++ ++ ++void luaX_syntaxerror (LexState *ls, const char *msg) { ++ luaX_lexerror(ls, msg, ls->t.token); ++} ++ ++ ++TString *luaX_newstring (LexState *ls, const char *str, size_t l) { ++ lua_State *L = ls->L; ++ TString *ts = luaS_newlstr(L, str, l); ++ TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */ ++ if (ttisnil(o)) ++ setbvalue(o, 1); /* make sure `str' will not be collected */ ++ return ts; ++} ++ ++ ++static void inclinenumber (LexState *ls) { ++ int old = ls->current; ++ lua_assert(currIsNewline(ls)); ++ next(ls); /* skip `\n' or `\r' */ ++ if (currIsNewline(ls) && ls->current != old) ++ next(ls); /* skip `\n\r' or `\r\n' */ ++ if (++ls->linenumber >= MAX_INT) ++ luaX_syntaxerror(ls, "chunk has too many lines"); ++} ++ ++ ++void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source) { ++ ls->decpoint = '.'; ++ ls->L = L; ++ ls->lookahead.token = TK_EOS; /* no look-ahead token */ ++ ls->z = z; ++ ls->fs = NULL; ++ ls->linenumber = 1; ++ ls->lastline = 1; ++ ls->source = source; ++ luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */ ++ next(ls); /* read first char */ ++} ++ ++ ++ ++/* ++** ======================================================= ++** LEXICAL ANALYZER ++** ======================================================= ++*/ ++ ++ ++ ++static int check_next (LexState *ls, const char *set) { ++ if (!strchr(set, ls->current)) ++ return 0; ++ save_and_next(ls); ++ return 1; ++} ++ ++ ++static void buffreplace (LexState *ls, char from, char to) { ++ size_t n = luaZ_bufflen(ls->buff); ++ char *p = luaZ_buffer(ls->buff); ++ while (n--) ++ if (p[n] == from) p[n] = to; ++} ++ ++ ++static void trydecpoint (LexState *ls, SemInfo *seminfo) { ++ /* format error: try to update decimal point separator */ ++ char old = ls->decpoint; ++ struct lconv *cv = localeconv(); ++ ls->decpoint = (cv ? cv->decimal_point[0] : '.'); ++ buffreplace(ls, old, ls->decpoint); /* try updated decimal separator */ ++ if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) { ++ /* format error with correct decimal point: no more options */ ++ buffreplace(ls, ls->decpoint, '.'); /* undo change (for error message) */ ++ luaX_lexerror(ls, "malformed number", TK_NUMBER); ++ } ++} ++ ++ ++/* LUA_NUMBER */ ++static void read_numeral (LexState *ls, SemInfo *seminfo) { ++ lua_assert(isdigit(ls->current)); ++ do { ++ save_and_next(ls); ++ } while (isdigit(ls->current) || ls->current == '.'); ++ if (check_next(ls, "Ee")) /* `E'? */ ++ check_next(ls, "+-"); /* optional exponent sign */ ++ while (isalnum(ls->current) || ls->current == '_') ++ save_and_next(ls); ++ save(ls, '\0'); ++ buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ ++ if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) /* format error? */ ++ trydecpoint(ls, seminfo); /* try to update decimal point separator */ ++} ++ ++ ++static int skip_sep (LexState *ls) { ++ int count = 0; ++ int s = ls->current; ++ lua_assert(s == '[' || s == ']'); ++ save_and_next(ls); ++ while (ls->current == '=') { ++ save_and_next(ls); ++ count++; ++ } ++ return (ls->current == s) ? count : (-count) - 1; ++} ++ ++ ++static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) { ++ int cont = 0; ++ (void)(cont); /* avoid warnings when `cont' is not used */ ++ save_and_next(ls); /* skip 2nd `[' */ ++ if (currIsNewline(ls)) /* string starts with a newline? */ ++ inclinenumber(ls); /* skip it */ ++ for (;;) { ++ switch (ls->current) { ++ case EOZ: ++ luaX_lexerror(ls, (seminfo) ? "unfinished long string" : ++ "unfinished long comment", TK_EOS); ++ break; /* to avoid warnings */ ++#if defined(LUA_COMPAT_LSTR) ++ case '[': { ++ if (skip_sep(ls) == sep) { ++ save_and_next(ls); /* skip 2nd `[' */ ++ cont++; ++#if LUA_COMPAT_LSTR == 1 ++ if (sep == 0) ++ luaX_lexerror(ls, "nesting of [[...]] is deprecated", '['); ++#endif ++ } ++ break; ++ } ++#endif ++ case ']': { ++ if (skip_sep(ls) == sep) { ++ save_and_next(ls); /* skip 2nd `]' */ ++#if defined(LUA_COMPAT_LSTR) && LUA_COMPAT_LSTR == 2 ++ cont--; ++ if (sep == 0 && cont >= 0) break; ++#endif ++ goto endloop; ++ } ++ break; ++ } ++ case '\n': ++ case '\r': { ++ save(ls, '\n'); ++ inclinenumber(ls); ++ if (!seminfo) luaZ_resetbuffer(ls->buff); /* avoid wasting space */ ++ break; ++ } ++ default: { ++ if (seminfo) save_and_next(ls); ++ else next(ls); ++ } ++ } ++ } endloop: ++ if (seminfo) ++ seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + (2 + sep), ++ luaZ_bufflen(ls->buff) - 2*(2 + sep)); ++} ++ ++ ++static void read_string (LexState *ls, int del, SemInfo *seminfo) { ++ save_and_next(ls); ++ while (ls->current != del) { ++ switch (ls->current) { ++ case EOZ: ++ luaX_lexerror(ls, "unfinished string", TK_EOS); ++ continue; /* to avoid warnings */ ++ case '\n': ++ case '\r': ++ luaX_lexerror(ls, "unfinished string", TK_STRING); ++ continue; /* to avoid warnings */ ++ case '\\': { ++ int c; ++ next(ls); /* do not save the `\' */ ++ switch (ls->current) { ++ case 'a': c = '\a'; break; ++ case 'b': c = '\b'; break; ++ case 'f': c = '\f'; break; ++ case 'n': c = '\n'; break; ++ case 'r': c = '\r'; break; ++ case 't': c = '\t'; break; ++ case 'v': c = '\v'; break; ++ case '\n': /* go through */ ++ case '\r': save(ls, '\n'); inclinenumber(ls); continue; ++ case EOZ: continue; /* will raise an error next loop */ ++ default: { ++ if (!isdigit(ls->current)) ++ save_and_next(ls); /* handles \\, \", \', and \? */ ++ else { /* \xxx */ ++ int i = 0; ++ c = 0; ++ do { ++ c = 10*c + (ls->current-'0'); ++ next(ls); ++ } while (++i<3 && isdigit(ls->current)); ++ if (c > UCHAR_MAX) ++ luaX_lexerror(ls, "escape sequence too large", TK_STRING); ++ save(ls, c); ++ } ++ continue; ++ } ++ } ++ save(ls, c); ++ next(ls); ++ continue; ++ } ++ default: ++ save_and_next(ls); ++ } ++ } ++ save_and_next(ls); /* skip delimiter */ ++ seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + 1, ++ luaZ_bufflen(ls->buff) - 2); ++} ++ ++ ++static int llex (LexState *ls, SemInfo *seminfo) { ++ luaZ_resetbuffer(ls->buff); ++ for (;;) { ++ switch (ls->current) { ++ case '\n': ++ case '\r': { ++ inclinenumber(ls); ++ continue; ++ } ++ case '-': { ++ next(ls); ++ if (ls->current != '-') return '-'; ++ /* else is a comment */ ++ next(ls); ++ if (ls->current == '[') { ++ int sep = skip_sep(ls); ++ luaZ_resetbuffer(ls->buff); /* `skip_sep' may dirty the buffer */ ++ if (sep >= 0) { ++ read_long_string(ls, NULL, sep); /* long comment */ ++ luaZ_resetbuffer(ls->buff); ++ continue; ++ } ++ } ++ /* else short comment */ ++ while (!currIsNewline(ls) && ls->current != EOZ) ++ next(ls); ++ continue; ++ } ++ case '[': { ++ int sep = skip_sep(ls); ++ if (sep >= 0) { ++ read_long_string(ls, seminfo, sep); ++ return TK_STRING; ++ } ++ else if (sep == -1) return '['; ++ else luaX_lexerror(ls, "invalid long string delimiter", TK_STRING); ++ } ++ case '=': { ++ next(ls); ++ if (ls->current != '=') return '='; ++ else { next(ls); return TK_EQ; } ++ } ++ case '<': { ++ next(ls); ++ if (ls->current != '=') return '<'; ++ else { next(ls); return TK_LE; } ++ } ++ case '>': { ++ next(ls); ++ if (ls->current != '=') return '>'; ++ else { next(ls); return TK_GE; } ++ } ++ case '~': { ++ next(ls); ++ if (ls->current != '=') return '~'; ++ else { next(ls); return TK_NE; } ++ } ++ case '"': ++ case '\'': { ++ read_string(ls, ls->current, seminfo); ++ return TK_STRING; ++ } ++ case '.': { ++ save_and_next(ls); ++ if (check_next(ls, ".")) { ++ if (check_next(ls, ".")) ++ return TK_DOTS; /* ... */ ++ else return TK_CONCAT; /* .. */ ++ } ++ else if (!isdigit(ls->current)) return '.'; ++ else { ++ read_numeral(ls, seminfo); ++ return TK_NUMBER; ++ } ++ } ++ case EOZ: { ++ return TK_EOS; ++ } ++ default: { ++ if (isspace(ls->current)) { ++ lua_assert(!currIsNewline(ls)); ++ next(ls); ++ continue; ++ } ++ else if (isdigit(ls->current)) { ++ read_numeral(ls, seminfo); ++ return TK_NUMBER; ++ } ++ else if (isalpha(ls->current) || ls->current == '_') { ++ /* identifier or reserved word */ ++ TString *ts; ++ do { ++ save_and_next(ls); ++ } while (isalnum(ls->current) || ls->current == '_'); ++ ts = luaX_newstring(ls, luaZ_buffer(ls->buff), ++ luaZ_bufflen(ls->buff)); ++ if (ts->tsv.reserved > 0) /* reserved word? */ ++ return ts->tsv.reserved - 1 + FIRST_RESERVED; ++ else { ++ seminfo->ts = ts; ++ return TK_NAME; ++ } ++ } ++ else { ++ int c = ls->current; ++ next(ls); ++ return c; /* single-char tokens (+ - / ...) */ ++ } ++ } ++ } ++ } ++} ++ ++ ++void luaX_next (LexState *ls) { ++ ls->lastline = ls->linenumber; ++ if (ls->lookahead.token != TK_EOS) { /* is there a look-ahead token? */ ++ ls->t = ls->lookahead; /* use this one */ ++ ls->lookahead.token = TK_EOS; /* and discharge it */ ++ } ++ else ++ ls->t.token = llex(ls, &ls->t.seminfo); /* read next token */ ++} ++ ++ ++void luaX_lookahead (LexState *ls) { ++ lua_assert(ls->lookahead.token == TK_EOS); ++ ls->lookahead.token = llex(ls, &ls->lookahead.seminfo); ++} ++ +--- /dev/null ++++ b/extensions/LUA/lua/llex.h +@@ -0,0 +1,81 @@ ++/* ++** $Id: llex.h,v 1.58.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Lexical Analyzer ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef llex_h ++#define llex_h ++ ++#include "lobject.h" ++#include "lzio.h" ++ ++ ++#define FIRST_RESERVED 257 ++ ++/* maximum length of a reserved word */ ++#define TOKEN_LEN (sizeof("function")/sizeof(char)) ++ ++ ++/* ++* WARNING: if you change the order of this enumeration, ++* grep "ORDER RESERVED" ++*/ ++enum RESERVED { ++ /* terminal symbols denoted by reserved words */ ++ TK_AND = FIRST_RESERVED, TK_BREAK, ++ TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION, ++ TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT, ++ TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE, ++ /* other terminal symbols */ ++ TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_NUMBER, ++ TK_NAME, TK_STRING, TK_EOS ++}; ++ ++/* number of reserved words */ ++#define NUM_RESERVED (cast(int, TK_WHILE-FIRST_RESERVED+1)) ++ ++ ++/* array with token `names' */ ++LUAI_DATA const char *const luaX_tokens []; ++ ++ ++typedef union { ++ lua_Number r; ++ TString *ts; ++} SemInfo; /* semantics information */ ++ ++ ++typedef struct Token { ++ int token; ++ SemInfo seminfo; ++} Token; ++ ++ ++typedef struct LexState { ++ int current; /* current character (charint) */ ++ int linenumber; /* input line counter */ ++ int lastline; /* line of last token `consumed' */ ++ Token t; /* current token */ ++ Token lookahead; /* look ahead token */ ++ struct FuncState *fs; /* `FuncState' is private to the parser */ ++ struct lua_State *L; ++ ZIO *z; /* input stream */ ++ Mbuffer *buff; /* buffer for tokens */ ++ TString *source; /* current source name */ ++ char decpoint; /* locale decimal point */ ++} LexState; ++ ++ ++LUAI_FUNC void luaX_init (lua_State *L); ++LUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, ++ TString *source); ++LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l); ++LUAI_FUNC void luaX_next (LexState *ls); ++LUAI_FUNC void luaX_lookahead (LexState *ls); ++LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token); ++LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s); ++LUAI_FUNC const char *luaX_token2str (LexState *ls, int token); ++ ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/llimits.h +@@ -0,0 +1,125 @@ ++/* ++** $Id: llimits.h,v 1.69.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Limits, basic types, and some other `installation-dependent' definitions ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef llimits_h ++#define llimits_h ++ ++#include ++#include ++ ++#include "lua.h" ++ ++typedef LUAI_UINT32 lu_int32; ++ ++typedef LUAI_UMEM lu_mem; ++ ++typedef LUAI_MEM l_mem; ++ ++ ++ ++/* chars used as small naturals (so that `char' is reserved for characters) */ ++typedef unsigned char lu_byte; ++ ++ ++#define MAX_SIZET ((size_t)(~(size_t)0)-2) ++ ++#define MAX_LUMEM ((lu_mem)(~(lu_mem)0)-2) ++ ++ ++#define MAX_INT (LUA_INT_MAX-2) /* maximum value of an int (-2 for safety) */ ++ ++/* ++** conversion of pointer to integer ++** this is for hashing only; there is no problem if the integer ++** cannot hold the whole pointer value ++*/ ++#define IntPoint(p) ((unsigned int)(lu_mem)(p)) ++ ++ ++ ++/* type to ensure maximum alignment */ ++typedef LUAI_USER_ALIGNMENT_T L_Umaxalign; ++ ++ ++/* result of a `usual argument conversion' over lua_Number */ ++typedef LUAI_UACNUMBER l_uacNumber; ++ ++ ++/* internal assertions for in-house debugging */ ++#ifdef lua_assert ++ ++#define check_exp(c,e) (lua_assert(c), (e)) ++#define api_check(l,e) lua_assert(e) ++ ++#else ++ ++#define lua_assert(c) ((void)0) ++#define check_exp(c,e) (e) ++#define api_check luai_apicheck ++ ++#endif ++ ++ ++#ifndef UNUSED ++#define UNUSED(x) ((void)(x)) /* to avoid warnings */ ++#endif ++ ++ ++#ifndef cast ++#define cast(t, exp) ((t)(exp)) ++#endif ++ ++#define cast_byte(i) cast(lu_byte, (i)) ++#define cast_num(i) cast(lua_Number, (i)) ++#define cast_int(i) cast(int, (i)) ++ ++ ++ ++/* ++** type for virtual-machine instructions ++** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) ++*/ ++typedef lu_int32 Instruction; ++ ++ ++ ++/* maximum stack for a Lua function */ ++#define MAXSTACK 250 ++ ++ ++ ++/* minimum size for the string table (must be power of 2) */ ++#ifndef MINSTRTABSIZE ++#define MINSTRTABSIZE 32 ++#endif ++ ++ ++/* minimum size for string buffer */ ++#ifndef LUA_MINBUFFER ++#define LUA_MINBUFFER 32 ++#endif ++ ++ ++#ifndef lua_lock ++#define lua_lock(L) ((void) 0) ++#define lua_unlock(L) ((void) 0) ++#endif ++ ++#ifndef luai_threadyield ++#define luai_threadyield(L) {lua_unlock(L); lua_lock(L);} ++#endif ++ ++ ++/* ++** macro to control inclusion of some hard tests on stack reallocation ++*/ ++#ifndef HARDSTACKTESTS ++#define condhardstacktests(x) ((void)0) ++#else ++#define condhardstacktests(x) x ++#endif ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/lmem.c +@@ -0,0 +1,86 @@ ++/* ++** $Id: lmem.c,v 1.70.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Interface to Memory Manager ++** See Copyright Notice in lua.h ++*/ ++ ++ ++#include ++ ++#define lmem_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "ldebug.h" ++#include "ldo.h" ++#include "lmem.h" ++#include "lobject.h" ++#include "lstate.h" ++ ++ ++ ++/* ++** About the realloc function: ++** void * frealloc (void *ud, void *ptr, size_t osize, size_t nsize); ++** (`osize' is the old size, `nsize' is the new size) ++** ++** Lua ensures that (ptr == NULL) iff (osize == 0). ++** ++** * frealloc(ud, NULL, 0, x) creates a new block of size `x' ++** ++** * frealloc(ud, p, x, 0) frees the block `p' ++** (in this specific case, frealloc must return NULL). ++** particularly, frealloc(ud, NULL, 0, 0) does nothing ++** (which is equivalent to free(NULL) in ANSI C) ++** ++** frealloc returns NULL if it cannot create or reallocate the area ++** (any reallocation to an equal or smaller size cannot fail!) ++*/ ++ ++ ++ ++#define MINSIZEARRAY 4 ++ ++ ++void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elems, ++ int limit, const char *errormsg) { ++ void *newblock; ++ int newsize; ++ if (*size >= limit/2) { /* cannot double it? */ ++ if (*size >= limit) /* cannot grow even a little? */ ++ luaG_runerror(L, errormsg); ++ newsize = limit; /* still have at least one free place */ ++ } ++ else { ++ newsize = (*size)*2; ++ if (newsize < MINSIZEARRAY) ++ newsize = MINSIZEARRAY; /* minimum size */ ++ } ++ newblock = luaM_reallocv(L, block, *size, newsize, size_elems); ++ *size = newsize; /* update only when everything else is OK */ ++ return newblock; ++} ++ ++ ++void *luaM_toobig (lua_State *L) { ++ luaG_runerror(L, "memory allocation error: block too big"); ++ return NULL; /* to avoid warnings */ ++} ++ ++ ++ ++/* ++** generic allocation routine. ++*/ ++void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) { ++ global_State *g = G(L); ++ lua_assert((osize == 0) == (block == NULL)); ++ block = (*g->frealloc)(g->ud, block, osize, nsize); ++ if (block == NULL && nsize > 0) ++ luaD_throw(L, LUA_ERRMEM); ++ lua_assert((nsize == 0) == (block == NULL)); ++ g->totalbytes = (g->totalbytes - osize) + nsize; ++ return block; ++} ++ +--- /dev/null ++++ b/extensions/LUA/lua/lmem.h +@@ -0,0 +1,49 @@ ++/* ++** $Id: lmem.h,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Interface to Memory Manager ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef lmem_h ++#define lmem_h ++ ++ ++#include ++ ++#include "llimits.h" ++#include "lua.h" ++ ++#define MEMERRMSG "not enough memory" ++ ++ ++#define luaM_reallocv(L,b,on,n,e) \ ++ ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \ ++ luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \ ++ luaM_toobig(L)) ++ ++#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) ++#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) ++#define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t)) ++ ++#define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t)) ++#define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t))) ++#define luaM_newvector(L,n,t) \ ++ cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t))) ++ ++#define luaM_growvector(L,v,nelems,size,t,limit,e) \ ++ if ((nelems)+1 > (size)) \ ++ ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e))) ++ ++#define luaM_reallocvector(L, v,oldn,n,t) \ ++ ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t)))) ++ ++ ++LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, ++ size_t size); ++LUAI_FUNC void *luaM_toobig (lua_State *L); ++LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size, ++ size_t size_elem, int limit, ++ const char *errormsg); ++ ++#endif ++ +--- /dev/null ++++ b/extensions/LUA/lua/lobject.c +@@ -0,0 +1,215 @@ ++/* ++** $Id: lobject.c,v 2.22.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Some generic functions over Lua objects ++** See Copyright Notice in lua.h ++*/ ++ ++#include ++ ++#include ++#include ++#include ++#include ++ ++#define lobject_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "ldo.h" ++#include "lmem.h" ++#include "lobject.h" ++#include "lstate.h" ++#include "lstring.h" ++#include "lvm.h" ++ ++ ++ ++const TValue luaO_nilobject_ = {{NULL}, LUA_TNIL}; ++ ++ ++/* ++** converts an integer to a "floating point byte", represented as ++** (eeeeexxx), where the real value is (1xxx) * 2^(eeeee - 1) if ++** eeeee != 0 and (xxx) otherwise. ++*/ ++int luaO_int2fb (unsigned int x) { ++ int e = 0; /* expoent */ ++ while (x >= 16) { ++ x = (x+1) >> 1; ++ e++; ++ } ++ if (x < 8) return x; ++ else return ((e+1) << 3) | (cast_int(x) - 8); ++} ++ ++ ++/* converts back */ ++int luaO_fb2int (int x) { ++ int e = (x >> 3) & 31; ++ if (e == 0) return x; ++ else return ((x & 7)+8) << (e - 1); ++} ++ ++ ++int luaO_log2 (unsigned int x) { ++ static const lu_byte log_2[256] = { ++ 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, ++ 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, ++ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, ++ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, ++ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, ++ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, ++ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, ++ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 ++ }; ++ int l = -1; ++ while (x >= 256) { l += 8; x >>= 8; } ++ return l + log_2[x]; ++ ++} ++ ++ ++int luaO_rawequalObj (const TValue *t1, const TValue *t2) { ++ if (ttype(t1) != ttype(t2)) return 0; ++ else switch (ttype(t1)) { ++ case LUA_TNIL: ++ return 1; ++ case LUA_TNUMBER: ++ return luai_numeq(nvalue(t1), nvalue(t2)); ++ case LUA_TBOOLEAN: ++ return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */ ++ case LUA_TLIGHTUSERDATA: ++ return pvalue(t1) == pvalue(t2); ++ default: ++ lua_assert(iscollectable(t1)); ++ return gcvalue(t1) == gcvalue(t2); ++ } ++} ++ ++ ++int luaO_str2d (const char *s, lua_Number *result) { ++ char *endptr; ++ *result = lua_str2number(s, &endptr); ++ if (endptr == s) return 0; /* conversion failed */ ++ if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */ ++ *result = cast_num(strtoul(s, &endptr, 16)); ++ if (*endptr == '\0') return 1; /* most common case */ ++ while (isspace(cast(unsigned char, *endptr))) endptr++; ++ if (*endptr != '\0') return 0; /* invalid trailing characters? */ ++ return 1; ++} ++ ++ ++ ++static void pushstr (lua_State *L, const char *str) { ++ setsvalue2s(L, L->top, luaS_new(L, str)); ++ incr_top(L); ++} ++ ++ ++/* this function handles only `%d', `%c', %f, %p, and `%s' formats */ ++const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { ++ int n = 1; ++ pushstr(L, ""); ++ for (;;) { ++ const char *e = strchr(fmt, '%'); ++ if (e == NULL) break; ++ setsvalue2s(L, L->top, luaS_newlstr(L, fmt, e-fmt)); ++ incr_top(L); ++ switch (*(e+1)) { ++ case 's': { ++ const char *s = va_arg(argp, char *); ++ if (s == NULL) s = "(null)"; ++ pushstr(L, s); ++ break; ++ } ++ case 'c': { ++ char buff[2]; ++ buff[0] = cast(char, va_arg(argp, int)); ++ buff[1] = '\0'; ++ pushstr(L, buff); ++ break; ++ } ++ case 'd': { ++ setnvalue(L->top, cast_num(va_arg(argp, int))); ++ incr_top(L); ++ break; ++ } ++ case 'f': { ++ setnvalue(L->top, cast_num(va_arg(argp, l_uacNumber))); ++ incr_top(L); ++ break; ++ } ++ case 'p': { ++ char buff[4*sizeof(void *) + 8]; /* should be enough space for a `%p' */ ++ sprintf(buff, "%p", va_arg(argp, void *)); ++ pushstr(L, buff); ++ break; ++ } ++ case '%': { ++ pushstr(L, "%"); ++ break; ++ } ++ default: { ++ char buff[3]; ++ buff[0] = '%'; ++ buff[1] = *(e+1); ++ buff[2] = '\0'; ++ pushstr(L, buff); ++ break; ++ } ++ } ++ n += 2; ++ fmt = e+2; ++ } ++ pushstr(L, fmt); ++ luaV_concat(L, n+1, cast_int(L->top - L->base) - 1); ++ L->top -= n; ++ return svalue(L->top - 1); ++} ++ ++ ++const char *luaO_pushfstring (lua_State *L, const char *fmt, ...) { ++ const char *msg; ++ va_list argp; ++ va_start(argp, fmt); ++ msg = luaO_pushvfstring(L, fmt, argp); ++ va_end(argp); ++ return msg; ++} ++ ++ ++void luaO_chunkid (char *out, const char *source, size_t bufflen) { ++ if (*source == '=') { ++ strncpy(out, source+1, bufflen); /* remove first char */ ++ out[bufflen-1] = '\0'; /* ensures null termination */ ++ } ++ else { /* out = "source", or "...source" */ ++ if (*source == '@') { ++ size_t l; ++ source++; /* skip the `@' */ ++ bufflen -= sizeof(" '...' "); ++ l = strlen(source); ++ strcpy(out, ""); ++ if (l > bufflen) { ++ source += (l-bufflen); /* get last part of file name */ ++ strcat(out, "..."); ++ } ++ strcat(out, source); ++ } ++ else { /* out = [string "string"] */ ++ size_t len = strcspn(source, "\n\r"); /* stop at first newline */ ++ bufflen -= sizeof(" [string \"...\"] "); ++ if (len > bufflen) len = bufflen; ++ strcpy(out, "[string \""); ++ if (source[len] != '\0') { /* must truncate? */ ++ strncat(out, source, len); ++ strcat(out, "..."); ++ } ++ else ++ strcat(out, source); ++ strcat(out, "\"]"); ++ } ++ } ++} +--- /dev/null ++++ b/extensions/LUA/lua/lobject.h +@@ -0,0 +1,381 @@ ++/* ++** $Id: lobject.h,v 2.20.1.2 2008/08/06 13:29:48 roberto Exp $ ++** Type definitions for Lua objects ++** See Copyright Notice in lua.h ++*/ ++ ++ ++#ifndef lobject_h ++#define lobject_h ++ ++ ++#include ++ ++ ++#include "llimits.h" ++#include "lua.h" ++ ++ ++/* tags for values visible from Lua */ ++#define LAST_TAG LUA_TTHREAD ++ ++#define NUM_TAGS (LAST_TAG+1) ++ ++ ++/* ++** Extra tags for non-values ++*/ ++#define LUA_TPROTO (LAST_TAG+1) ++#define LUA_TUPVAL (LAST_TAG+2) ++#define LUA_TDEADKEY (LAST_TAG+3) ++ ++ ++/* ++** Union of all collectable objects ++*/ ++typedef union GCObject GCObject; ++ ++ ++/* ++** Common Header for all collectable objects (in macro form, to be ++** included in other objects) ++*/ ++#define CommonHeader GCObject *next; lu_byte tt; lu_byte marked ++ ++ ++/* ++** Common header in struct form ++*/ ++typedef struct GCheader { ++ CommonHeader; ++} GCheader; ++ ++ ++ ++ ++/* ++** Union of all Lua values ++*/ ++typedef union { ++ GCObject *gc; ++ void *p; ++ lua_Number n; ++ int b; ++} Value; ++ ++ ++/* ++** Tagged Values ++*/ ++ ++#define TValuefields Value value; int tt ++ ++typedef struct lua_TValue { ++ TValuefields; ++} TValue; ++ ++ ++/* Macros to test type */ ++#define ttisnil(o) (ttype(o) == LUA_TNIL) ++#define ttisnumber(o) (ttype(o) == LUA_TNUMBER) ++#define ttisstring(o) (ttype(o) == LUA_TSTRING) ++#define ttistable(o) (ttype(o) == LUA_TTABLE) ++#define ttisfunction(o) (ttype(o) == LUA_TFUNCTION) ++#define ttisboolean(o) (ttype(o) == LUA_TBOOLEAN) ++#define ttisuserdata(o) (ttype(o) == LUA_TUSERDATA) ++#define ttisthread(o) (ttype(o) == LUA_TTHREAD) ++#define ttislightuserdata(o) (ttype(o) == LUA_TLIGHTUSERDATA) ++ ++/* Macros to access values */ ++#define ttype(o) ((o)->tt) ++#define gcvalue(o) check_exp(iscollectable(o), (o)->value.gc) ++#define pvalue(o) check_exp(ttislightuserdata(o), (o)->value.p) ++#define nvalue(o) check_exp(ttisnumber(o), (o)->value.n) ++#define rawtsvalue(o) check_exp(ttisstring(o), &(o)->value.gc->ts) ++#define tsvalue(o) (&rawtsvalue(o)->tsv) ++#define rawuvalue(o) check_exp(ttisuserdata(o), &(o)->value.gc->u) ++#define uvalue(o) (&rawuvalue(o)->uv) ++#define clvalue(o) check_exp(ttisfunction(o), &(o)->value.gc->cl) ++#define hvalue(o) check_exp(ttistable(o), &(o)->value.gc->h) ++#define bvalue(o) check_exp(ttisboolean(o), (o)->value.b) ++#define thvalue(o) check_exp(ttisthread(o), &(o)->value.gc->th) ++ ++#define l_isfalse(o) (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0)) ++ ++/* ++** for internal debug only ++*/ ++#define checkconsistency(obj) \ ++ lua_assert(!iscollectable(obj) || (ttype(obj) == (obj)->value.gc->gch.tt)) ++ ++#define checkliveness(g,obj) \ ++ lua_assert(!iscollectable(obj) || \ ++ ((ttype(obj) == (obj)->value.gc->gch.tt) && !isdead(g, (obj)->value.gc))) ++ ++ ++/* Macros to set values */ ++#define setnilvalue(obj) ((obj)->tt=LUA_TNIL) ++ ++#define setnvalue(obj,x) \ ++ { TValue *i_o=(obj); i_o->value.n=(x); i_o->tt=LUA_TNUMBER; } ++ ++#define setpvalue(obj,x) \ ++ { TValue *i_o=(obj); i_o->value.p=(x); i_o->tt=LUA_TLIGHTUSERDATA; } ++ ++#define setbvalue(obj,x) \ ++ { TValue *i_o=(obj); i_o->value.b=(x); i_o->tt=LUA_TBOOLEAN; } ++ ++#define setsvalue(L,obj,x) \ ++ { TValue *i_o=(obj); \ ++ i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TSTRING; \ ++ checkliveness(G(L),i_o); } ++ ++#define setuvalue(L,obj,x) \ ++ { TValue *i_o=(obj); \ ++ i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TUSERDATA; \ ++ checkliveness(G(L),i_o); } ++ ++#define setthvalue(L,obj,x) \ ++ { TValue *i_o=(obj); \ ++ i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTHREAD; \ ++ checkliveness(G(L),i_o); } ++ ++#define setclvalue(L,obj,x) \ ++ { TValue *i_o=(obj); \ ++ i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TFUNCTION; \ ++ checkliveness(G(L),i_o); } ++ ++#define sethvalue(L,obj,x) \ ++ { TValue *i_o=(obj); \ ++ i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTABLE; \ ++ checkliveness(G(L),i_o); } ++ ++#define setptvalue(L,obj,x) \ ++ { TValue *i_o=(obj); \ ++ i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TPROTO; \ ++ checkliveness(G(L),i_o); } ++ ++ ++ ++ ++#define setobj(L,obj1,obj2) \ ++ { const TValue *o2=(obj2); TValue *o1=(obj1); \ ++ o1->value = o2->value; o1->tt=o2->tt; \ ++ checkliveness(G(L),o1); } ++ ++ ++/* ++** different types of sets, according to destination ++*/ ++ ++/* from stack to (same) stack */ ++#define setobjs2s setobj ++/* to stack (not from same stack) */ ++#define setobj2s setobj ++#define setsvalue2s setsvalue ++#define sethvalue2s sethvalue ++#define setptvalue2s setptvalue ++/* from table to same table */ ++#define setobjt2t setobj ++/* to table */ ++#define setobj2t setobj ++/* to new object */ ++#define setobj2n setobj ++#define setsvalue2n setsvalue ++ ++#define setttype(obj, tt) (ttype(obj) = (tt)) ++ ++ ++#define iscollectable(o) (ttype(o) >= LUA_TSTRING) ++ ++ ++ ++typedef TValue *StkId; /* index to stack elements */ ++ ++ ++/* ++** String headers for string table ++*/ ++typedef union TString { ++ L_Umaxalign dummy; /* ensures maximum alignment for strings */ ++ struct { ++ CommonHeader; ++ lu_byte reserved; ++ unsigned int hash; ++ size_t len; ++ } tsv; ++} TString; ++ ++ ++#define getstr(ts) cast(const char *, (ts) + 1) ++#define svalue(o) getstr(rawtsvalue(o)) ++ ++ ++ ++typedef union Udata { ++ L_Umaxalign dummy; /* ensures maximum alignment for `local' udata */ ++ struct { ++ CommonHeader; ++ struct Table *metatable; ++ struct Table *env; ++ size_t len; ++ } uv; ++} Udata; ++ ++ ++ ++ ++/* ++** Function Prototypes ++*/ ++typedef struct Proto { ++ CommonHeader; ++ TValue *k; /* constants used by the function */ ++ Instruction *code; ++ struct Proto **p; /* functions defined inside the function */ ++ int *lineinfo; /* map from opcodes to source lines */ ++ struct LocVar *locvars; /* information about local variables */ ++ TString **upvalues; /* upvalue names */ ++ TString *source; ++ int sizeupvalues; ++ int sizek; /* size of `k' */ ++ int sizecode; ++ int sizelineinfo; ++ int sizep; /* size of `p' */ ++ int sizelocvars; ++ int linedefined; ++ int lastlinedefined; ++ GCObject *gclist; ++ lu_byte nups; /* number of upvalues */ ++ lu_byte numparams; ++ lu_byte is_vararg; ++ lu_byte maxstacksize; ++} Proto; ++ ++ ++/* masks for new-style vararg */ ++#define VARARG_HASARG 1 ++#define VARARG_ISVARARG 2 ++#define VARARG_NEEDSARG 4 ++ ++ ++typedef struct LocVar { ++ TString *varname; ++ int startpc; /* first point where variable is active */ ++ int endpc; /* first point where variable is dead */ ++} LocVar; ++ ++ ++ ++/* ++** Upvalues ++*/ ++ ++typedef struct UpVal { ++ CommonHeader; ++ TValue *v; /* points to stack or to its own value */ ++ union { ++ TValue value; /* the value (when closed) */ ++ struct { /* double linked list (when open) */ ++ struct UpVal *prev; ++ struct UpVal *next; ++ } l; ++ } u; ++} UpVal; ++ ++ ++/* ++** Closures ++*/ ++ ++#define ClosureHeader \ ++ CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist; \ ++ struct Table *env ++ ++typedef struct CClosure { ++ ClosureHeader; ++ lua_CFunction f; ++ TValue upvalue[1]; ++} CClosure; ++ ++ ++typedef struct LClosure { ++ ClosureHeader; ++ struct Proto *p; ++ UpVal *upvals[1]; ++} LClosure; ++ ++ ++typedef union Closure { ++ CClosure c; ++ LClosure l; ++} Closure; ++ ++ ++#define iscfunction(o) (ttype(o) == LUA_TFUNCTION && clvalue(o)->c.isC) ++#define isLfunction(o) (ttype(o) == LUA_TFUNCTION && !clvalue(o)->c.isC) ++ ++ ++/* ++** Tables ++*/ ++ ++typedef union TKey { ++ struct { ++ TValuefields; ++ struct Node *next; /* for chaining */ ++ } nk; ++ TValue tvk; ++} TKey; ++ ++ ++typedef struct Node { ++ TValue i_val; ++ TKey i_key; ++} Node; ++ ++ ++typedef struct Table { ++ CommonHeader; ++ lu_byte flags; /* 1<

    lsizenode)) ++ ++ ++#define luaO_nilobject (&luaO_nilobject_) ++ ++LUAI_DATA const TValue luaO_nilobject_; ++ ++#define ceillog2(x) (luaO_log2((x)-1) + 1) ++ ++LUAI_FUNC int luaO_log2 (unsigned int x); ++LUAI_FUNC int luaO_int2fb (unsigned int x); ++LUAI_FUNC int luaO_fb2int (int x); ++LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2); ++LUAI_FUNC int luaO_str2d (const char *s, lua_Number *result); ++LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt, ++ va_list argp); ++LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...); ++LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t len); ++ ++ ++#endif ++ +--- /dev/null ++++ b/extensions/LUA/lua/lopcodes.c +@@ -0,0 +1,102 @@ ++/* ++** $Id: lopcodes.c,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $ ++** See Copyright Notice in lua.h ++*/ ++ ++ ++#define lopcodes_c ++#define LUA_CORE ++ ++ ++#include "lopcodes.h" ++ ++ ++/* ORDER OP */ ++ ++const char *const luaP_opnames[NUM_OPCODES+1] = { ++ "MOVE", ++ "LOADK", ++ "LOADBOOL", ++ "LOADNIL", ++ "GETUPVAL", ++ "GETGLOBAL", ++ "GETTABLE", ++ "SETGLOBAL", ++ "SETUPVAL", ++ "SETTABLE", ++ "NEWTABLE", ++ "SELF", ++ "ADD", ++ "SUB", ++ "MUL", ++ "DIV", ++ "MOD", ++ "POW", ++ "UNM", ++ "NOT", ++ "LEN", ++ "CONCAT", ++ "JMP", ++ "EQ", ++ "LT", ++ "LE", ++ "TEST", ++ "TESTSET", ++ "CALL", ++ "TAILCALL", ++ "RETURN", ++ "FORLOOP", ++ "FORPREP", ++ "TFORLOOP", ++ "SETLIST", ++ "CLOSE", ++ "CLOSURE", ++ "VARARG", ++ NULL ++}; ++ ++ ++#define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m)) ++ ++const lu_byte luaP_opmodes[NUM_OPCODES] = { ++/* T A B C mode opcode */ ++ opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */ ++ ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */ ++ ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_LOADBOOL */ ++ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LOADNIL */ ++ ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_GETUPVAL */ ++ ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_GETGLOBAL */ ++ ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_GETTABLE */ ++ ,opmode(0, 0, OpArgK, OpArgN, iABx) /* OP_SETGLOBAL */ ++ ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_SETUPVAL */ ++ ,opmode(0, 0, OpArgK, OpArgK, iABC) /* OP_SETTABLE */ ++ ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_NEWTABLE */ ++ ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_SELF */ ++ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_ADD */ ++ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_SUB */ ++ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MUL */ ++ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_DIV */ ++ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MOD */ ++ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_POW */ ++ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_UNM */ ++ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_NOT */ ++ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LEN */ ++ ,opmode(0, 1, OpArgR, OpArgR, iABC) /* OP_CONCAT */ ++ ,opmode(0, 0, OpArgR, OpArgN, iAsBx) /* OP_JMP */ ++ ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_EQ */ ++ ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LT */ ++ ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LE */ ++ ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TEST */ ++ ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TESTSET */ ++ ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_CALL */ ++ ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_TAILCALL */ ++ ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RETURN */ ++ ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORLOOP */ ++ ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORPREP */ ++ ,opmode(1, 0, OpArgN, OpArgU, iABC) /* OP_TFORLOOP */ ++ ,opmode(0, 0, OpArgU, OpArgU, iABC) /* OP_SETLIST */ ++ ,opmode(0, 0, OpArgN, OpArgN, iABC) /* OP_CLOSE */ ++ ,opmode(0, 1, OpArgU, OpArgN, iABx) /* OP_CLOSURE */ ++ ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_VARARG */ ++}; ++ +--- /dev/null ++++ b/extensions/LUA/lua/lopcodes.h +@@ -0,0 +1,268 @@ ++/* ++** $Id: lopcodes.h,v 1.125.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Opcodes for Lua virtual machine ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef lopcodes_h ++#define lopcodes_h ++ ++#include "llimits.h" ++ ++ ++/*=========================================================================== ++ We assume that instructions are unsigned numbers. ++ All instructions have an opcode in the first 6 bits. ++ Instructions can have the following fields: ++ `A' : 8 bits ++ `B' : 9 bits ++ `C' : 9 bits ++ `Bx' : 18 bits (`B' and `C' together) ++ `sBx' : signed Bx ++ ++ A signed argument is represented in excess K; that is, the number ++ value is the unsigned value minus K. K is exactly the maximum value ++ for that argument (so that -max is represented by 0, and +max is ++ represented by 2*max), which is half the maximum for the corresponding ++ unsigned argument. ++===========================================================================*/ ++ ++ ++enum OpMode {iABC, iABx, iAsBx}; /* basic instruction format */ ++ ++ ++/* ++** size and position of opcode arguments. ++*/ ++#define SIZE_C 9 ++#define SIZE_B 9 ++#define SIZE_Bx (SIZE_C + SIZE_B) ++#define SIZE_A 8 ++ ++#define SIZE_OP 6 ++ ++#define POS_OP 0 ++#define POS_A (POS_OP + SIZE_OP) ++#define POS_C (POS_A + SIZE_A) ++#define POS_B (POS_C + SIZE_C) ++#define POS_Bx POS_C ++ ++ ++/* ++** limits for opcode arguments. ++** we use (signed) int to manipulate most arguments, ++** so they must fit in LUAI_BITSINT-1 bits (-1 for sign) ++*/ ++#if SIZE_Bx < LUAI_BITSINT-1 ++#define MAXARG_Bx ((1<>1) /* `sBx' is signed */ ++#else ++#define MAXARG_Bx MAX_INT ++#define MAXARG_sBx MAX_INT ++#endif ++ ++ ++#define MAXARG_A ((1<>POS_OP) & MASK1(SIZE_OP,0))) ++#define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \ ++ ((cast(Instruction, o)<>POS_A) & MASK1(SIZE_A,0))) ++#define SETARG_A(i,u) ((i) = (((i)&MASK0(SIZE_A,POS_A)) | \ ++ ((cast(Instruction, u)<>POS_B) & MASK1(SIZE_B,0))) ++#define SETARG_B(i,b) ((i) = (((i)&MASK0(SIZE_B,POS_B)) | \ ++ ((cast(Instruction, b)<>POS_C) & MASK1(SIZE_C,0))) ++#define SETARG_C(i,b) ((i) = (((i)&MASK0(SIZE_C,POS_C)) | \ ++ ((cast(Instruction, b)<>POS_Bx) & MASK1(SIZE_Bx,0))) ++#define SETARG_Bx(i,b) ((i) = (((i)&MASK0(SIZE_Bx,POS_Bx)) | \ ++ ((cast(Instruction, b)< C) then pc++ */ ++OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ ++ ++OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */ ++OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */ ++OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see note) */ ++ ++OP_FORLOOP,/* A sBx R(A)+=R(A+2); ++ if R(A) =) R(A)*/ ++OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */ ++ ++OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ ++} OpCode; ++ ++ ++#define NUM_OPCODES (cast(int, OP_VARARG) + 1) ++ ++ ++ ++/*=========================================================================== ++ Notes: ++ (*) In OP_CALL, if (B == 0) then B = top. C is the number of returns - 1, ++ and can be 0: OP_CALL then sets `top' to last_result+1, so ++ next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use `top'. ++ ++ (*) In OP_VARARG, if (B == 0) then use actual number of varargs and ++ set top (like in OP_CALL with C == 0). ++ ++ (*) In OP_RETURN, if (B == 0) then return up to `top' ++ ++ (*) In OP_SETLIST, if (B == 0) then B = `top'; ++ if (C == 0) then next `instruction' is real C ++ ++ (*) For comparisons, A specifies what condition the test should accept ++ (true or false). ++ ++ (*) All `skips' (pc++) assume that next instruction is a jump ++===========================================================================*/ ++ ++ ++/* ++** masks for instruction properties. The format is: ++** bits 0-1: op mode ++** bits 2-3: C arg mode ++** bits 4-5: B arg mode ++** bit 6: instruction set register A ++** bit 7: operator is a test ++*/ ++ ++enum OpArgMask { ++ OpArgN, /* argument is not used */ ++ OpArgU, /* argument is used */ ++ OpArgR, /* argument is a register or a jump offset */ ++ OpArgK /* argument is a constant or register/constant */ ++}; ++ ++LUAI_DATA const lu_byte luaP_opmodes[NUM_OPCODES]; ++ ++#define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3)) ++#define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3)) ++#define getCMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3)) ++#define testAMode(m) (luaP_opmodes[m] & (1 << 6)) ++#define testTMode(m) (luaP_opmodes[m] & (1 << 7)) ++ ++ ++LUAI_DATA const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ ++ ++ ++/* number of list items to accumulate before a SETLIST instruction */ ++#define LFIELDS_PER_FLUSH 50 ++ ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/lparser.c +@@ -0,0 +1,1339 @@ ++/* ++** $Id: lparser.c,v 2.42.1.3 2007/12/28 15:32:23 roberto Exp $ ++** Lua Parser ++** See Copyright Notice in lua.h ++*/ ++ ++ ++#include ++ ++#define lparser_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "lcode.h" ++#include "ldebug.h" ++#include "ldo.h" ++#include "lfunc.h" ++#include "llex.h" ++#include "lmem.h" ++#include "lobject.h" ++#include "lopcodes.h" ++#include "lparser.h" ++#include "lstate.h" ++#include "lstring.h" ++#include "ltable.h" ++ ++ ++ ++#define hasmultret(k) ((k) == VCALL || (k) == VVARARG) ++ ++#define getlocvar(fs, i) ((fs)->f->locvars[(fs)->actvar[i]]) ++ ++#define luaY_checklimit(fs,v,l,m) if ((v)>(l)) errorlimit(fs,l,m) ++ ++ ++/* ++** nodes for block list (list of active blocks) ++*/ ++typedef struct BlockCnt { ++ struct BlockCnt *previous; /* chain */ ++ int breaklist; /* list of jumps out of this loop */ ++ lu_byte nactvar; /* # active locals outside the breakable structure */ ++ lu_byte upval; /* true if some variable in the block is an upvalue */ ++ lu_byte isbreakable; /* true if `block' is a loop */ ++} BlockCnt; ++ ++ ++ ++/* ++** prototypes for recursive non-terminal functions ++*/ ++static void chunk (LexState *ls); ++static void expr (LexState *ls, expdesc *v); ++ ++ ++static void anchor_token (LexState *ls) { ++ if (ls->t.token == TK_NAME || ls->t.token == TK_STRING) { ++ TString *ts = ls->t.seminfo.ts; ++ luaX_newstring(ls, getstr(ts), ts->tsv.len); ++ } ++} ++ ++ ++static void error_expected (LexState *ls, int token) { ++ luaX_syntaxerror(ls, ++ luaO_pushfstring(ls->L, LUA_QS " expected", luaX_token2str(ls, token))); ++} ++ ++ ++static void errorlimit (FuncState *fs, int limit, const char *what) { ++ const char *msg = (fs->f->linedefined == 0) ? ++ luaO_pushfstring(fs->L, "main function has more than %d %s", limit, what) : ++ luaO_pushfstring(fs->L, "function at line %d has more than %d %s", ++ fs->f->linedefined, limit, what); ++ luaX_lexerror(fs->ls, msg, 0); ++} ++ ++ ++static int testnext (LexState *ls, int c) { ++ if (ls->t.token == c) { ++ luaX_next(ls); ++ return 1; ++ } ++ else return 0; ++} ++ ++ ++static void check (LexState *ls, int c) { ++ if (ls->t.token != c) ++ error_expected(ls, c); ++} ++ ++static void checknext (LexState *ls, int c) { ++ check(ls, c); ++ luaX_next(ls); ++} ++ ++ ++#define check_condition(ls,c,msg) { if (!(c)) luaX_syntaxerror(ls, msg); } ++ ++ ++ ++static void check_match (LexState *ls, int what, int who, int where) { ++ if (!testnext(ls, what)) { ++ if (where == ls->linenumber) ++ error_expected(ls, what); ++ else { ++ luaX_syntaxerror(ls, luaO_pushfstring(ls->L, ++ LUA_QS " expected (to close " LUA_QS " at line %d)", ++ luaX_token2str(ls, what), luaX_token2str(ls, who), where)); ++ } ++ } ++} ++ ++ ++static TString *str_checkname (LexState *ls) { ++ TString *ts; ++ check(ls, TK_NAME); ++ ts = ls->t.seminfo.ts; ++ luaX_next(ls); ++ return ts; ++} ++ ++ ++static void init_exp (expdesc *e, expkind k, int i) { ++ e->f = e->t = NO_JUMP; ++ e->k = k; ++ e->u.s.info = i; ++} ++ ++ ++static void codestring (LexState *ls, expdesc *e, TString *s) { ++ init_exp(e, VK, luaK_stringK(ls->fs, s)); ++} ++ ++ ++static void checkname(LexState *ls, expdesc *e) { ++ codestring(ls, e, str_checkname(ls)); ++} ++ ++ ++static int registerlocalvar (LexState *ls, TString *varname) { ++ FuncState *fs = ls->fs; ++ Proto *f = fs->f; ++ int oldsize = f->sizelocvars; ++ luaM_growvector(ls->L, f->locvars, fs->nlocvars, f->sizelocvars, ++ LocVar, SHRT_MAX, "too many local variables"); ++ while (oldsize < f->sizelocvars) f->locvars[oldsize++].varname = NULL; ++ f->locvars[fs->nlocvars].varname = varname; ++ luaC_objbarrier(ls->L, f, varname); ++ return fs->nlocvars++; ++} ++ ++ ++#define new_localvarliteral(ls,v,n) \ ++ new_localvar(ls, luaX_newstring(ls, "" v, (sizeof(v)/sizeof(char))-1), n) ++ ++ ++static void new_localvar (LexState *ls, TString *name, int n) { ++ FuncState *fs = ls->fs; ++ luaY_checklimit(fs, fs->nactvar+n+1, LUAI_MAXVARS, "local variables"); ++ fs->actvar[fs->nactvar+n] = cast(unsigned short, registerlocalvar(ls, name)); ++} ++ ++ ++static void adjustlocalvars (LexState *ls, int nvars) { ++ FuncState *fs = ls->fs; ++ fs->nactvar = cast_byte(fs->nactvar + nvars); ++ for (; nvars; nvars--) { ++ getlocvar(fs, fs->nactvar - nvars).startpc = fs->pc; ++ } ++} ++ ++ ++static void removevars (LexState *ls, int tolevel) { ++ FuncState *fs = ls->fs; ++ while (fs->nactvar > tolevel) ++ getlocvar(fs, --fs->nactvar).endpc = fs->pc; ++} ++ ++ ++static int indexupvalue (FuncState *fs, TString *name, expdesc *v) { ++ int i; ++ Proto *f = fs->f; ++ int oldsize = f->sizeupvalues; ++ for (i=0; inups; i++) { ++ if (fs->upvalues[i].k == v->k && fs->upvalues[i].info == v->u.s.info) { ++ lua_assert(f->upvalues[i] == name); ++ return i; ++ } ++ } ++ /* new one */ ++ luaY_checklimit(fs, f->nups + 1, LUAI_MAXUPVALUES, "upvalues"); ++ luaM_growvector(fs->L, f->upvalues, f->nups, f->sizeupvalues, ++ TString *, MAX_INT, ""); ++ while (oldsize < f->sizeupvalues) f->upvalues[oldsize++] = NULL; ++ f->upvalues[f->nups] = name; ++ luaC_objbarrier(fs->L, f, name); ++ lua_assert(v->k == VLOCAL || v->k == VUPVAL); ++ fs->upvalues[f->nups].k = cast_byte(v->k); ++ fs->upvalues[f->nups].info = cast_byte(v->u.s.info); ++ return f->nups++; ++} ++ ++ ++static int searchvar (FuncState *fs, TString *n) { ++ int i; ++ for (i=fs->nactvar-1; i >= 0; i--) { ++ if (n == getlocvar(fs, i).varname) ++ return i; ++ } ++ return -1; /* not found */ ++} ++ ++ ++static void markupval (FuncState *fs, int level) { ++ BlockCnt *bl = fs->bl; ++ while (bl && bl->nactvar > level) bl = bl->previous; ++ if (bl) bl->upval = 1; ++} ++ ++ ++static int singlevaraux (FuncState *fs, TString *n, expdesc *var, int base) { ++ if (fs == NULL) { /* no more levels? */ ++ init_exp(var, VGLOBAL, NO_REG); /* default is global variable */ ++ return VGLOBAL; ++ } ++ else { ++ int v = searchvar(fs, n); /* look up at current level */ ++ if (v >= 0) { ++ init_exp(var, VLOCAL, v); ++ if (!base) ++ markupval(fs, v); /* local will be used as an upval */ ++ return VLOCAL; ++ } ++ else { /* not found at current level; try upper one */ ++ if (singlevaraux(fs->prev, n, var, 0) == VGLOBAL) ++ return VGLOBAL; ++ var->u.s.info = indexupvalue(fs, n, var); /* else was LOCAL or UPVAL */ ++ var->k = VUPVAL; /* upvalue in this level */ ++ return VUPVAL; ++ } ++ } ++} ++ ++ ++static void singlevar (LexState *ls, expdesc *var) { ++ TString *varname = str_checkname(ls); ++ FuncState *fs = ls->fs; ++ if (singlevaraux(fs, varname, var, 1) == VGLOBAL) ++ var->u.s.info = luaK_stringK(fs, varname); /* info points to global name */ ++} ++ ++ ++static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) { ++ FuncState *fs = ls->fs; ++ int extra = nvars - nexps; ++ if (hasmultret(e->k)) { ++ extra++; /* includes call itself */ ++ if (extra < 0) extra = 0; ++ luaK_setreturns(fs, e, extra); /* last exp. provides the difference */ ++ if (extra > 1) luaK_reserveregs(fs, extra-1); ++ } ++ else { ++ if (e->k != VVOID) luaK_exp2nextreg(fs, e); /* close last expression */ ++ if (extra > 0) { ++ int reg = fs->freereg; ++ luaK_reserveregs(fs, extra); ++ luaK_nil(fs, reg, extra); ++ } ++ } ++} ++ ++ ++static void enterlevel (LexState *ls) { ++ if (++ls->L->nCcalls > LUAI_MAXCCALLS) ++ luaX_lexerror(ls, "chunk has too many syntax levels", 0); ++} ++ ++ ++#define leavelevel(ls) ((ls)->L->nCcalls--) ++ ++ ++static void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isbreakable) { ++ bl->breaklist = NO_JUMP; ++ bl->isbreakable = isbreakable; ++ bl->nactvar = fs->nactvar; ++ bl->upval = 0; ++ bl->previous = fs->bl; ++ fs->bl = bl; ++ lua_assert(fs->freereg == fs->nactvar); ++} ++ ++ ++static void leaveblock (FuncState *fs) { ++ BlockCnt *bl = fs->bl; ++ fs->bl = bl->previous; ++ removevars(fs->ls, bl->nactvar); ++ if (bl->upval) ++ luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0); ++ /* a block either controls scope or breaks (never both) */ ++ lua_assert(!bl->isbreakable || !bl->upval); ++ lua_assert(bl->nactvar == fs->nactvar); ++ fs->freereg = fs->nactvar; /* free registers */ ++ luaK_patchtohere(fs, bl->breaklist); ++} ++ ++ ++static void pushclosure (LexState *ls, FuncState *func, expdesc *v) { ++ FuncState *fs = ls->fs; ++ Proto *f = fs->f; ++ int oldsize = f->sizep; ++ int i; ++ luaM_growvector(ls->L, f->p, fs->np, f->sizep, Proto *, ++ MAXARG_Bx, "constant table overflow"); ++ while (oldsize < f->sizep) f->p[oldsize++] = NULL; ++ f->p[fs->np++] = func->f; ++ luaC_objbarrier(ls->L, f, func->f); ++ init_exp(v, VRELOCABLE, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np-1)); ++ for (i=0; if->nups; i++) { ++ OpCode o = (func->upvalues[i].k == VLOCAL) ? OP_MOVE : OP_GETUPVAL; ++ luaK_codeABC(fs, o, 0, func->upvalues[i].info, 0); ++ } ++} ++ ++ ++static void open_func (LexState *ls, FuncState *fs) { ++ lua_State *L = ls->L; ++ Proto *f = luaF_newproto(L); ++ fs->f = f; ++ fs->prev = ls->fs; /* linked list of funcstates */ ++ fs->ls = ls; ++ fs->L = L; ++ ls->fs = fs; ++ fs->pc = 0; ++ fs->lasttarget = -1; ++ fs->jpc = NO_JUMP; ++ fs->freereg = 0; ++ fs->nk = 0; ++ fs->np = 0; ++ fs->nlocvars = 0; ++ fs->nactvar = 0; ++ fs->bl = NULL; ++ f->source = ls->source; ++ f->maxstacksize = 2; /* registers 0/1 are always valid */ ++ fs->h = luaH_new(L, 0, 0); ++ /* anchor table of constants and prototype (to avoid being collected) */ ++ sethvalue2s(L, L->top, fs->h); ++ incr_top(L); ++ setptvalue2s(L, L->top, f); ++ incr_top(L); ++} ++ ++ ++static void close_func (LexState *ls) { ++ lua_State *L = ls->L; ++ FuncState *fs = ls->fs; ++ Proto *f = fs->f; ++ removevars(ls, 0); ++ luaK_ret(fs, 0, 0); /* final return */ ++ luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction); ++ f->sizecode = fs->pc; ++ luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int); ++ f->sizelineinfo = fs->pc; ++ luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue); ++ f->sizek = fs->nk; ++ luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *); ++ f->sizep = fs->np; ++ luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar); ++ f->sizelocvars = fs->nlocvars; ++ luaM_reallocvector(L, f->upvalues, f->sizeupvalues, f->nups, TString *); ++ f->sizeupvalues = f->nups; ++ lua_assert(luaG_checkcode(f)); ++ lua_assert(fs->bl == NULL); ++ ls->fs = fs->prev; ++ L->top -= 2; /* remove table and prototype from the stack */ ++ /* last token read was anchored in defunct function; must reanchor it */ ++ if (fs) anchor_token(ls); ++} ++ ++ ++Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) { ++ struct LexState lexstate; ++ struct FuncState funcstate; ++ lexstate.buff = buff; ++ luaX_setinput(L, &lexstate, z, luaS_new(L, name)); ++ open_func(&lexstate, &funcstate); ++ funcstate.f->is_vararg = VARARG_ISVARARG; /* main func. is always vararg */ ++ luaX_next(&lexstate); /* read first token */ ++ chunk(&lexstate); ++ check(&lexstate, TK_EOS); ++ close_func(&lexstate); ++ lua_assert(funcstate.prev == NULL); ++ lua_assert(funcstate.f->nups == 0); ++ lua_assert(lexstate.fs == NULL); ++ return funcstate.f; ++} ++ ++ ++ ++/*============================================================*/ ++/* GRAMMAR RULES */ ++/*============================================================*/ ++ ++ ++static void field (LexState *ls, expdesc *v) { ++ /* field -> ['.' | ':'] NAME */ ++ FuncState *fs = ls->fs; ++ expdesc key; ++ luaK_exp2anyreg(fs, v); ++ luaX_next(ls); /* skip the dot or colon */ ++ checkname(ls, &key); ++ luaK_indexed(fs, v, &key); ++} ++ ++ ++static void yindex (LexState *ls, expdesc *v) { ++ /* index -> '[' expr ']' */ ++ luaX_next(ls); /* skip the '[' */ ++ expr(ls, v); ++ luaK_exp2val(ls->fs, v); ++ checknext(ls, ']'); ++} ++ ++ ++/* ++** {====================================================================== ++** Rules for Constructors ++** ======================================================================= ++*/ ++ ++ ++struct ConsControl { ++ expdesc v; /* last list item read */ ++ expdesc *t; /* table descriptor */ ++ int nh; /* total number of `record' elements */ ++ int na; /* total number of array elements */ ++ int tostore; /* number of array elements pending to be stored */ ++}; ++ ++ ++static void recfield (LexState *ls, struct ConsControl *cc) { ++ /* recfield -> (NAME | `['exp1`]') = exp1 */ ++ FuncState *fs = ls->fs; ++ int reg = ls->fs->freereg; ++ expdesc key, val; ++ int rkkey; ++ if (ls->t.token == TK_NAME) { ++ luaY_checklimit(fs, cc->nh, MAX_INT, "items in a constructor"); ++ checkname(ls, &key); ++ } ++ else /* ls->t.token == '[' */ ++ yindex(ls, &key); ++ cc->nh++; ++ checknext(ls, '='); ++ rkkey = luaK_exp2RK(fs, &key); ++ expr(ls, &val); ++ luaK_codeABC(fs, OP_SETTABLE, cc->t->u.s.info, rkkey, luaK_exp2RK(fs, &val)); ++ fs->freereg = reg; /* free registers */ ++} ++ ++ ++static void closelistfield (FuncState *fs, struct ConsControl *cc) { ++ if (cc->v.k == VVOID) return; /* there is no list item */ ++ luaK_exp2nextreg(fs, &cc->v); ++ cc->v.k = VVOID; ++ if (cc->tostore == LFIELDS_PER_FLUSH) { ++ luaK_setlist(fs, cc->t->u.s.info, cc->na, cc->tostore); /* flush */ ++ cc->tostore = 0; /* no more items pending */ ++ } ++} ++ ++ ++static void lastlistfield (FuncState *fs, struct ConsControl *cc) { ++ if (cc->tostore == 0) return; ++ if (hasmultret(cc->v.k)) { ++ luaK_setmultret(fs, &cc->v); ++ luaK_setlist(fs, cc->t->u.s.info, cc->na, LUA_MULTRET); ++ cc->na--; /* do not count last expression (unknown number of elements) */ ++ } ++ else { ++ if (cc->v.k != VVOID) ++ luaK_exp2nextreg(fs, &cc->v); ++ luaK_setlist(fs, cc->t->u.s.info, cc->na, cc->tostore); ++ } ++} ++ ++ ++static void listfield (LexState *ls, struct ConsControl *cc) { ++ expr(ls, &cc->v); ++ luaY_checklimit(ls->fs, cc->na, MAX_INT, "items in a constructor"); ++ cc->na++; ++ cc->tostore++; ++} ++ ++ ++static void constructor (LexState *ls, expdesc *t) { ++ /* constructor -> ?? */ ++ FuncState *fs = ls->fs; ++ int line = ls->linenumber; ++ int pc = luaK_codeABC(fs, OP_NEWTABLE, 0, 0, 0); ++ struct ConsControl cc; ++ cc.na = cc.nh = cc.tostore = 0; ++ cc.t = t; ++ init_exp(t, VRELOCABLE, pc); ++ init_exp(&cc.v, VVOID, 0); /* no value (yet) */ ++ luaK_exp2nextreg(ls->fs, t); /* fix it at stack top (for gc) */ ++ checknext(ls, '{'); ++ do { ++ lua_assert(cc.v.k == VVOID || cc.tostore > 0); ++ if (ls->t.token == '}') break; ++ closelistfield(fs, &cc); ++ switch(ls->t.token) { ++ case TK_NAME: { /* may be listfields or recfields */ ++ luaX_lookahead(ls); ++ if (ls->lookahead.token != '=') /* expression? */ ++ listfield(ls, &cc); ++ else ++ recfield(ls, &cc); ++ break; ++ } ++ case '[': { /* constructor_item -> recfield */ ++ recfield(ls, &cc); ++ break; ++ } ++ default: { /* constructor_part -> listfield */ ++ listfield(ls, &cc); ++ break; ++ } ++ } ++ } while (testnext(ls, ',') || testnext(ls, ';')); ++ check_match(ls, '}', '{', line); ++ lastlistfield(fs, &cc); ++ SETARG_B(fs->f->code[pc], luaO_int2fb(cc.na)); /* set initial array size */ ++ SETARG_C(fs->f->code[pc], luaO_int2fb(cc.nh)); /* set initial table size */ ++} ++ ++/* }====================================================================== */ ++ ++ ++ ++static void parlist (LexState *ls) { ++ /* parlist -> [ param { `,' param } ] */ ++ FuncState *fs = ls->fs; ++ Proto *f = fs->f; ++ int nparams = 0; ++ f->is_vararg = 0; ++ if (ls->t.token != ')') { /* is `parlist' not empty? */ ++ do { ++ switch (ls->t.token) { ++ case TK_NAME: { /* param -> NAME */ ++ new_localvar(ls, str_checkname(ls), nparams++); ++ break; ++ } ++ case TK_DOTS: { /* param -> `...' */ ++ luaX_next(ls); ++#if defined(LUA_COMPAT_VARARG) ++ /* use `arg' as default name */ ++ new_localvarliteral(ls, "arg", nparams++); ++ f->is_vararg = VARARG_HASARG | VARARG_NEEDSARG; ++#endif ++ f->is_vararg |= VARARG_ISVARARG; ++ break; ++ } ++ default: luaX_syntaxerror(ls, " or " LUA_QL("...") " expected"); ++ } ++ } while (!f->is_vararg && testnext(ls, ',')); ++ } ++ adjustlocalvars(ls, nparams); ++ f->numparams = cast_byte(fs->nactvar - (f->is_vararg & VARARG_HASARG)); ++ luaK_reserveregs(fs, fs->nactvar); /* reserve register for parameters */ ++} ++ ++ ++static void body (LexState *ls, expdesc *e, int needself, int line) { ++ /* body -> `(' parlist `)' chunk END */ ++ FuncState new_fs; ++ open_func(ls, &new_fs); ++ new_fs.f->linedefined = line; ++ checknext(ls, '('); ++ if (needself) { ++ new_localvarliteral(ls, "self", 0); ++ adjustlocalvars(ls, 1); ++ } ++ parlist(ls); ++ checknext(ls, ')'); ++ chunk(ls); ++ new_fs.f->lastlinedefined = ls->linenumber; ++ check_match(ls, TK_END, TK_FUNCTION, line); ++ close_func(ls); ++ pushclosure(ls, &new_fs, e); ++} ++ ++ ++static int explist1 (LexState *ls, expdesc *v) { ++ /* explist1 -> expr { `,' expr } */ ++ int n = 1; /* at least one expression */ ++ expr(ls, v); ++ while (testnext(ls, ',')) { ++ luaK_exp2nextreg(ls->fs, v); ++ expr(ls, v); ++ n++; ++ } ++ return n; ++} ++ ++ ++static void funcargs (LexState *ls, expdesc *f) { ++ FuncState *fs = ls->fs; ++ expdesc args; ++ int base, nparams; ++ int line = ls->linenumber; ++ switch (ls->t.token) { ++ case '(': { /* funcargs -> `(' [ explist1 ] `)' */ ++ if (line != ls->lastline) ++ luaX_syntaxerror(ls,"ambiguous syntax (function call x new statement)"); ++ luaX_next(ls); ++ if (ls->t.token == ')') /* arg list is empty? */ ++ args.k = VVOID; ++ else { ++ explist1(ls, &args); ++ luaK_setmultret(fs, &args); ++ } ++ check_match(ls, ')', '(', line); ++ break; ++ } ++ case '{': { /* funcargs -> constructor */ ++ constructor(ls, &args); ++ break; ++ } ++ case TK_STRING: { /* funcargs -> STRING */ ++ codestring(ls, &args, ls->t.seminfo.ts); ++ luaX_next(ls); /* must use `seminfo' before `next' */ ++ break; ++ } ++ default: { ++ luaX_syntaxerror(ls, "function arguments expected"); ++ return; ++ } ++ } ++ lua_assert(f->k == VNONRELOC); ++ base = f->u.s.info; /* base register for call */ ++ if (hasmultret(args.k)) ++ nparams = LUA_MULTRET; /* open call */ ++ else { ++ if (args.k != VVOID) ++ luaK_exp2nextreg(fs, &args); /* close last argument */ ++ nparams = fs->freereg - (base+1); ++ } ++ init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2)); ++ luaK_fixline(fs, line); ++ fs->freereg = base+1; /* call remove function and arguments and leaves ++ (unless changed) one result */ ++} ++ ++ ++ ++ ++/* ++** {====================================================================== ++** Expression parsing ++** ======================================================================= ++*/ ++ ++ ++static void prefixexp (LexState *ls, expdesc *v) { ++ /* prefixexp -> NAME | '(' expr ')' */ ++ switch (ls->t.token) { ++ case '(': { ++ int line = ls->linenumber; ++ luaX_next(ls); ++ expr(ls, v); ++ check_match(ls, ')', '(', line); ++ luaK_dischargevars(ls->fs, v); ++ return; ++ } ++ case TK_NAME: { ++ singlevar(ls, v); ++ return; ++ } ++ default: { ++ luaX_syntaxerror(ls, "unexpected symbol"); ++ return; ++ } ++ } ++} ++ ++ ++static void primaryexp (LexState *ls, expdesc *v) { ++ /* primaryexp -> ++ prefixexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs } */ ++ FuncState *fs = ls->fs; ++ prefixexp(ls, v); ++ for (;;) { ++ switch (ls->t.token) { ++ case '.': { /* field */ ++ field(ls, v); ++ break; ++ } ++ case '[': { /* `[' exp1 `]' */ ++ expdesc key; ++ luaK_exp2anyreg(fs, v); ++ yindex(ls, &key); ++ luaK_indexed(fs, v, &key); ++ break; ++ } ++ case ':': { /* `:' NAME funcargs */ ++ expdesc key; ++ luaX_next(ls); ++ checkname(ls, &key); ++ luaK_self(fs, v, &key); ++ funcargs(ls, v); ++ break; ++ } ++ case '(': case TK_STRING: case '{': { /* funcargs */ ++ luaK_exp2nextreg(fs, v); ++ funcargs(ls, v); ++ break; ++ } ++ default: return; ++ } ++ } ++} ++ ++ ++static void simpleexp (LexState *ls, expdesc *v) { ++ /* simpleexp -> NUMBER | STRING | NIL | true | false | ... | ++ constructor | FUNCTION body | primaryexp */ ++ switch (ls->t.token) { ++ case TK_NUMBER: { ++ init_exp(v, VKNUM, 0); ++ v->u.nval = ls->t.seminfo.r; ++ break; ++ } ++ case TK_STRING: { ++ codestring(ls, v, ls->t.seminfo.ts); ++ break; ++ } ++ case TK_NIL: { ++ init_exp(v, VNIL, 0); ++ break; ++ } ++ case TK_TRUE: { ++ init_exp(v, VTRUE, 0); ++ break; ++ } ++ case TK_FALSE: { ++ init_exp(v, VFALSE, 0); ++ break; ++ } ++ case TK_DOTS: { /* vararg */ ++ FuncState *fs = ls->fs; ++ check_condition(ls, fs->f->is_vararg, ++ "cannot use " LUA_QL("...") " outside a vararg function"); ++ fs->f->is_vararg &= ~VARARG_NEEDSARG; /* don't need 'arg' */ ++ init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 1, 0)); ++ break; ++ } ++ case '{': { /* constructor */ ++ constructor(ls, v); ++ return; ++ } ++ case TK_FUNCTION: { ++ luaX_next(ls); ++ body(ls, v, 0, ls->linenumber); ++ return; ++ } ++ default: { ++ primaryexp(ls, v); ++ return; ++ } ++ } ++ luaX_next(ls); ++} ++ ++ ++static UnOpr getunopr (int op) { ++ switch (op) { ++ case TK_NOT: return OPR_NOT; ++ case '-': return OPR_MINUS; ++ case '#': return OPR_LEN; ++ default: return OPR_NOUNOPR; ++ } ++} ++ ++ ++static BinOpr getbinopr (int op) { ++ switch (op) { ++ case '+': return OPR_ADD; ++ case '-': return OPR_SUB; ++ case '*': return OPR_MUL; ++ case '/': return OPR_DIV; ++ case '%': return OPR_MOD; ++ case '^': return OPR_POW; ++ case TK_CONCAT: return OPR_CONCAT; ++ case TK_NE: return OPR_NE; ++ case TK_EQ: return OPR_EQ; ++ case '<': return OPR_LT; ++ case TK_LE: return OPR_LE; ++ case '>': return OPR_GT; ++ case TK_GE: return OPR_GE; ++ case TK_AND: return OPR_AND; ++ case TK_OR: return OPR_OR; ++ default: return OPR_NOBINOPR; ++ } ++} ++ ++ ++static const struct { ++ lu_byte left; /* left priority for each binary operator */ ++ lu_byte right; /* right priority */ ++} priority[] = { /* ORDER OPR */ ++ {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7}, /* `+' `-' `/' `%' */ ++ {10, 9}, {5, 4}, /* power and concat (right associative) */ ++ {3, 3}, {3, 3}, /* equality and inequality */ ++ {3, 3}, {3, 3}, {3, 3}, {3, 3}, /* order */ ++ {2, 2}, {1, 1} /* logical (and/or) */ ++}; ++ ++#define UNARY_PRIORITY 8 /* priority for unary operators */ ++ ++ ++/* ++** subexpr -> (simpleexp | unop subexpr) { binop subexpr } ++** where `binop' is any binary operator with a priority higher than `limit' ++*/ ++static BinOpr subexpr (LexState *ls, expdesc *v, unsigned int limit) { ++ BinOpr op; ++ UnOpr uop; ++ enterlevel(ls); ++ uop = getunopr(ls->t.token); ++ if (uop != OPR_NOUNOPR) { ++ luaX_next(ls); ++ subexpr(ls, v, UNARY_PRIORITY); ++ luaK_prefix(ls->fs, uop, v); ++ } ++ else simpleexp(ls, v); ++ /* expand while operators have priorities higher than `limit' */ ++ op = getbinopr(ls->t.token); ++ while (op != OPR_NOBINOPR && priority[op].left > limit) { ++ expdesc v2; ++ BinOpr nextop; ++ luaX_next(ls); ++ luaK_infix(ls->fs, op, v); ++ /* read sub-expression with higher priority */ ++ nextop = subexpr(ls, &v2, priority[op].right); ++ luaK_posfix(ls->fs, op, v, &v2); ++ op = nextop; ++ } ++ leavelevel(ls); ++ return op; /* return first untreated operator */ ++} ++ ++ ++static void expr (LexState *ls, expdesc *v) { ++ subexpr(ls, v, 0); ++} ++ ++/* }==================================================================== */ ++ ++ ++ ++/* ++** {====================================================================== ++** Rules for Statements ++** ======================================================================= ++*/ ++ ++ ++static int block_follow (int token) { ++ switch (token) { ++ case TK_ELSE: case TK_ELSEIF: case TK_END: ++ case TK_UNTIL: case TK_EOS: ++ return 1; ++ default: return 0; ++ } ++} ++ ++ ++static void block (LexState *ls) { ++ /* block -> chunk */ ++ FuncState *fs = ls->fs; ++ BlockCnt bl; ++ enterblock(fs, &bl, 0); ++ chunk(ls); ++ lua_assert(bl.breaklist == NO_JUMP); ++ leaveblock(fs); ++} ++ ++ ++/* ++** structure to chain all variables in the left-hand side of an ++** assignment ++*/ ++struct LHS_assign { ++ struct LHS_assign *prev; ++ expdesc v; /* variable (global, local, upvalue, or indexed) */ ++}; ++ ++ ++/* ++** check whether, in an assignment to a local variable, the local variable ++** is needed in a previous assignment (to a table). If so, save original ++** local value in a safe place and use this safe copy in the previous ++** assignment. ++*/ ++static void check_conflict (LexState *ls, struct LHS_assign *lh, expdesc *v) { ++ FuncState *fs = ls->fs; ++ int extra = fs->freereg; /* eventual position to save local variable */ ++ int conflict = 0; ++ for (; lh; lh = lh->prev) { ++ if (lh->v.k == VINDEXED) { ++ if (lh->v.u.s.info == v->u.s.info) { /* conflict? */ ++ conflict = 1; ++ lh->v.u.s.info = extra; /* previous assignment will use safe copy */ ++ } ++ if (lh->v.u.s.aux == v->u.s.info) { /* conflict? */ ++ conflict = 1; ++ lh->v.u.s.aux = extra; /* previous assignment will use safe copy */ ++ } ++ } ++ } ++ if (conflict) { ++ luaK_codeABC(fs, OP_MOVE, fs->freereg, v->u.s.info, 0); /* make copy */ ++ luaK_reserveregs(fs, 1); ++ } ++} ++ ++ ++static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) { ++ expdesc e; ++ check_condition(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED, ++ "syntax error"); ++ if (testnext(ls, ',')) { /* assignment -> `,' primaryexp assignment */ ++ struct LHS_assign nv; ++ nv.prev = lh; ++ primaryexp(ls, &nv.v); ++ if (nv.v.k == VLOCAL) ++ check_conflict(ls, lh, &nv.v); ++ luaY_checklimit(ls->fs, nvars, LUAI_MAXCCALLS - ls->L->nCcalls, ++ "variables in assignment"); ++ assignment(ls, &nv, nvars+1); ++ } ++ else { /* assignment -> `=' explist1 */ ++ int nexps; ++ checknext(ls, '='); ++ nexps = explist1(ls, &e); ++ if (nexps != nvars) { ++ adjust_assign(ls, nvars, nexps, &e); ++ if (nexps > nvars) ++ ls->fs->freereg -= nexps - nvars; /* remove extra values */ ++ } ++ else { ++ luaK_setoneret(ls->fs, &e); /* close last expression */ ++ luaK_storevar(ls->fs, &lh->v, &e); ++ return; /* avoid default */ ++ } ++ } ++ init_exp(&e, VNONRELOC, ls->fs->freereg-1); /* default assignment */ ++ luaK_storevar(ls->fs, &lh->v, &e); ++} ++ ++ ++static int cond (LexState *ls) { ++ /* cond -> exp */ ++ expdesc v; ++ expr(ls, &v); /* read condition */ ++ if (v.k == VNIL) v.k = VFALSE; /* `falses' are all equal here */ ++ luaK_goiftrue(ls->fs, &v); ++ return v.f; ++} ++ ++ ++static void breakstat (LexState *ls) { ++ FuncState *fs = ls->fs; ++ BlockCnt *bl = fs->bl; ++ int upval = 0; ++ while (bl && !bl->isbreakable) { ++ upval |= bl->upval; ++ bl = bl->previous; ++ } ++ if (!bl) ++ luaX_syntaxerror(ls, "no loop to break"); ++ if (upval) ++ luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0); ++ luaK_concat(fs, &bl->breaklist, luaK_jump(fs)); ++} ++ ++ ++static void whilestat (LexState *ls, int line) { ++ /* whilestat -> WHILE cond DO block END */ ++ FuncState *fs = ls->fs; ++ int whileinit; ++ int condexit; ++ BlockCnt bl; ++ luaX_next(ls); /* skip WHILE */ ++ whileinit = luaK_getlabel(fs); ++ condexit = cond(ls); ++ enterblock(fs, &bl, 1); ++ checknext(ls, TK_DO); ++ block(ls); ++ luaK_patchlist(fs, luaK_jump(fs), whileinit); ++ check_match(ls, TK_END, TK_WHILE, line); ++ leaveblock(fs); ++ luaK_patchtohere(fs, condexit); /* false conditions finish the loop */ ++} ++ ++ ++static void repeatstat (LexState *ls, int line) { ++ /* repeatstat -> REPEAT block UNTIL cond */ ++ int condexit; ++ FuncState *fs = ls->fs; ++ int repeat_init = luaK_getlabel(fs); ++ BlockCnt bl1, bl2; ++ enterblock(fs, &bl1, 1); /* loop block */ ++ enterblock(fs, &bl2, 0); /* scope block */ ++ luaX_next(ls); /* skip REPEAT */ ++ chunk(ls); ++ check_match(ls, TK_UNTIL, TK_REPEAT, line); ++ condexit = cond(ls); /* read condition (inside scope block) */ ++ if (!bl2.upval) { /* no upvalues? */ ++ leaveblock(fs); /* finish scope */ ++ luaK_patchlist(ls->fs, condexit, repeat_init); /* close the loop */ ++ } ++ else { /* complete semantics when there are upvalues */ ++ breakstat(ls); /* if condition then break */ ++ luaK_patchtohere(ls->fs, condexit); /* else... */ ++ leaveblock(fs); /* finish scope... */ ++ luaK_patchlist(ls->fs, luaK_jump(fs), repeat_init); /* and repeat */ ++ } ++ leaveblock(fs); /* finish loop */ ++} ++ ++ ++static int exp1 (LexState *ls) { ++ expdesc e; ++ int k; ++ expr(ls, &e); ++ k = e.k; ++ luaK_exp2nextreg(ls->fs, &e); ++ return k; ++} ++ ++ ++static void forbody (LexState *ls, int base, int line, int nvars, int isnum) { ++ /* forbody -> DO block */ ++ BlockCnt bl; ++ FuncState *fs = ls->fs; ++ int prep, endfor; ++ adjustlocalvars(ls, 3); /* control variables */ ++ checknext(ls, TK_DO); ++ prep = isnum ? luaK_codeAsBx(fs, OP_FORPREP, base, NO_JUMP) : luaK_jump(fs); ++ enterblock(fs, &bl, 0); /* scope for declared variables */ ++ adjustlocalvars(ls, nvars); ++ luaK_reserveregs(fs, nvars); ++ block(ls); ++ leaveblock(fs); /* end of scope for declared variables */ ++ luaK_patchtohere(fs, prep); ++ endfor = (isnum) ? luaK_codeAsBx(fs, OP_FORLOOP, base, NO_JUMP) : ++ luaK_codeABC(fs, OP_TFORLOOP, base, 0, nvars); ++ luaK_fixline(fs, line); /* pretend that `OP_FOR' starts the loop */ ++ luaK_patchlist(fs, (isnum ? endfor : luaK_jump(fs)), prep + 1); ++} ++ ++ ++static void fornum (LexState *ls, TString *varname, int line) { ++ /* fornum -> NAME = exp1,exp1[,exp1] forbody */ ++ FuncState *fs = ls->fs; ++ int base = fs->freereg; ++ new_localvarliteral(ls, "(for index)", 0); ++ new_localvarliteral(ls, "(for limit)", 1); ++ new_localvarliteral(ls, "(for step)", 2); ++ new_localvar(ls, varname, 3); ++ checknext(ls, '='); ++ exp1(ls); /* initial value */ ++ checknext(ls, ','); ++ exp1(ls); /* limit */ ++ if (testnext(ls, ',')) ++ exp1(ls); /* optional step */ ++ else { /* default step = 1 */ ++ luaK_codeABx(fs, OP_LOADK, fs->freereg, luaK_numberK(fs, 1)); ++ luaK_reserveregs(fs, 1); ++ } ++ forbody(ls, base, line, 1, 1); ++} ++ ++ ++static void forlist (LexState *ls, TString *indexname) { ++ /* forlist -> NAME {,NAME} IN explist1 forbody */ ++ FuncState *fs = ls->fs; ++ expdesc e; ++ int nvars = 0; ++ int line; ++ int base = fs->freereg; ++ /* create control variables */ ++ new_localvarliteral(ls, "(for generator)", nvars++); ++ new_localvarliteral(ls, "(for state)", nvars++); ++ new_localvarliteral(ls, "(for control)", nvars++); ++ /* create declared variables */ ++ new_localvar(ls, indexname, nvars++); ++ while (testnext(ls, ',')) ++ new_localvar(ls, str_checkname(ls), nvars++); ++ checknext(ls, TK_IN); ++ line = ls->linenumber; ++ adjust_assign(ls, 3, explist1(ls, &e), &e); ++ luaK_checkstack(fs, 3); /* extra space to call generator */ ++ forbody(ls, base, line, nvars - 3, 0); ++} ++ ++ ++static void forstat (LexState *ls, int line) { ++ /* forstat -> FOR (fornum | forlist) END */ ++ FuncState *fs = ls->fs; ++ TString *varname; ++ BlockCnt bl; ++ enterblock(fs, &bl, 1); /* scope for loop and control variables */ ++ luaX_next(ls); /* skip `for' */ ++ varname = str_checkname(ls); /* first variable name */ ++ switch (ls->t.token) { ++ case '=': fornum(ls, varname, line); break; ++ case ',': case TK_IN: forlist(ls, varname); break; ++ default: luaX_syntaxerror(ls, LUA_QL("=") " or " LUA_QL("in") " expected"); ++ } ++ check_match(ls, TK_END, TK_FOR, line); ++ leaveblock(fs); /* loop scope (`break' jumps to this point) */ ++} ++ ++ ++static int test_then_block (LexState *ls) { ++ /* test_then_block -> [IF | ELSEIF] cond THEN block */ ++ int condexit; ++ luaX_next(ls); /* skip IF or ELSEIF */ ++ condexit = cond(ls); ++ checknext(ls, TK_THEN); ++ block(ls); /* `then' part */ ++ return condexit; ++} ++ ++ ++static void ifstat (LexState *ls, int line) { ++ /* ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END */ ++ FuncState *fs = ls->fs; ++ int flist; ++ int escapelist = NO_JUMP; ++ flist = test_then_block(ls); /* IF cond THEN block */ ++ while (ls->t.token == TK_ELSEIF) { ++ luaK_concat(fs, &escapelist, luaK_jump(fs)); ++ luaK_patchtohere(fs, flist); ++ flist = test_then_block(ls); /* ELSEIF cond THEN block */ ++ } ++ if (ls->t.token == TK_ELSE) { ++ luaK_concat(fs, &escapelist, luaK_jump(fs)); ++ luaK_patchtohere(fs, flist); ++ luaX_next(ls); /* skip ELSE (after patch, for correct line info) */ ++ block(ls); /* `else' part */ ++ } ++ else ++ luaK_concat(fs, &escapelist, flist); ++ luaK_patchtohere(fs, escapelist); ++ check_match(ls, TK_END, TK_IF, line); ++} ++ ++ ++static void localfunc (LexState *ls) { ++ expdesc v, b; ++ FuncState *fs = ls->fs; ++ new_localvar(ls, str_checkname(ls), 0); ++ init_exp(&v, VLOCAL, fs->freereg); ++ luaK_reserveregs(fs, 1); ++ adjustlocalvars(ls, 1); ++ body(ls, &b, 0, ls->linenumber); ++ luaK_storevar(fs, &v, &b); ++ /* debug information will only see the variable after this point! */ ++ getlocvar(fs, fs->nactvar - 1).startpc = fs->pc; ++} ++ ++ ++static void localstat (LexState *ls) { ++ /* stat -> LOCAL NAME {`,' NAME} [`=' explist1] */ ++ int nvars = 0; ++ int nexps; ++ expdesc e; ++ do { ++ new_localvar(ls, str_checkname(ls), nvars++); ++ } while (testnext(ls, ',')); ++ if (testnext(ls, '=')) ++ nexps = explist1(ls, &e); ++ else { ++ e.k = VVOID; ++ nexps = 0; ++ } ++ adjust_assign(ls, nvars, nexps, &e); ++ adjustlocalvars(ls, nvars); ++} ++ ++ ++static int funcname (LexState *ls, expdesc *v) { ++ /* funcname -> NAME {field} [`:' NAME] */ ++ int needself = 0; ++ singlevar(ls, v); ++ while (ls->t.token == '.') ++ field(ls, v); ++ if (ls->t.token == ':') { ++ needself = 1; ++ field(ls, v); ++ } ++ return needself; ++} ++ ++ ++static void funcstat (LexState *ls, int line) { ++ /* funcstat -> FUNCTION funcname body */ ++ int needself; ++ expdesc v, b; ++ luaX_next(ls); /* skip FUNCTION */ ++ needself = funcname(ls, &v); ++ body(ls, &b, needself, line); ++ luaK_storevar(ls->fs, &v, &b); ++ luaK_fixline(ls->fs, line); /* definition `happens' in the first line */ ++} ++ ++ ++static void exprstat (LexState *ls) { ++ /* stat -> func | assignment */ ++ FuncState *fs = ls->fs; ++ struct LHS_assign v; ++ primaryexp(ls, &v.v); ++ if (v.v.k == VCALL) /* stat -> func */ ++ SETARG_C(getcode(fs, &v.v), 1); /* call statement uses no results */ ++ else { /* stat -> assignment */ ++ v.prev = NULL; ++ assignment(ls, &v, 1); ++ } ++} ++ ++ ++static void retstat (LexState *ls) { ++ /* stat -> RETURN explist */ ++ FuncState *fs = ls->fs; ++ expdesc e; ++ int first, nret; /* registers with returned values */ ++ luaX_next(ls); /* skip RETURN */ ++ if (block_follow(ls->t.token) || ls->t.token == ';') ++ first = nret = 0; /* return no values */ ++ else { ++ nret = explist1(ls, &e); /* optional return values */ ++ if (hasmultret(e.k)) { ++ luaK_setmultret(fs, &e); ++ if (e.k == VCALL && nret == 1) { /* tail call? */ ++ SET_OPCODE(getcode(fs,&e), OP_TAILCALL); ++ lua_assert(GETARG_A(getcode(fs,&e)) == fs->nactvar); ++ } ++ first = fs->nactvar; ++ nret = LUA_MULTRET; /* return all values */ ++ } ++ else { ++ if (nret == 1) /* only one single value? */ ++ first = luaK_exp2anyreg(fs, &e); ++ else { ++ luaK_exp2nextreg(fs, &e); /* values must go to the `stack' */ ++ first = fs->nactvar; /* return all `active' values */ ++ lua_assert(nret == fs->freereg - first); ++ } ++ } ++ } ++ luaK_ret(fs, first, nret); ++} ++ ++ ++static int statement (LexState *ls) { ++ int line = ls->linenumber; /* may be needed for error messages */ ++ switch (ls->t.token) { ++ case TK_IF: { /* stat -> ifstat */ ++ ifstat(ls, line); ++ return 0; ++ } ++ case TK_WHILE: { /* stat -> whilestat */ ++ whilestat(ls, line); ++ return 0; ++ } ++ case TK_DO: { /* stat -> DO block END */ ++ luaX_next(ls); /* skip DO */ ++ block(ls); ++ check_match(ls, TK_END, TK_DO, line); ++ return 0; ++ } ++ case TK_FOR: { /* stat -> forstat */ ++ forstat(ls, line); ++ return 0; ++ } ++ case TK_REPEAT: { /* stat -> repeatstat */ ++ repeatstat(ls, line); ++ return 0; ++ } ++ case TK_FUNCTION: { ++ funcstat(ls, line); /* stat -> funcstat */ ++ return 0; ++ } ++ case TK_LOCAL: { /* stat -> localstat */ ++ luaX_next(ls); /* skip LOCAL */ ++ if (testnext(ls, TK_FUNCTION)) /* local function? */ ++ localfunc(ls); ++ else ++ localstat(ls); ++ return 0; ++ } ++ case TK_RETURN: { /* stat -> retstat */ ++ retstat(ls); ++ return 1; /* must be last statement */ ++ } ++ case TK_BREAK: { /* stat -> breakstat */ ++ luaX_next(ls); /* skip BREAK */ ++ breakstat(ls); ++ return 1; /* must be last statement */ ++ } ++ default: { ++ exprstat(ls); ++ return 0; /* to avoid warnings */ ++ } ++ } ++} ++ ++ ++static void chunk (LexState *ls) { ++ /* chunk -> { stat [`;'] } */ ++ int islast = 0; ++ enterlevel(ls); ++ while (!islast && !block_follow(ls->t.token)) { ++ islast = statement(ls); ++ testnext(ls, ';'); ++ lua_assert(ls->fs->f->maxstacksize >= ls->fs->freereg && ++ ls->fs->freereg >= ls->fs->nactvar); ++ ls->fs->freereg = ls->fs->nactvar; /* free registers */ ++ } ++ leavelevel(ls); ++} ++ ++/* }====================================================================== */ +--- /dev/null ++++ b/extensions/LUA/lua/lparser.h +@@ -0,0 +1,82 @@ ++/* ++** $Id: lparser.h,v 1.57.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Lua Parser ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef lparser_h ++#define lparser_h ++ ++#include "llimits.h" ++#include "lobject.h" ++#include "lzio.h" ++ ++ ++/* ++** Expression descriptor ++*/ ++ ++typedef enum { ++ VVOID, /* no value */ ++ VNIL, ++ VTRUE, ++ VFALSE, ++ VK, /* info = index of constant in `k' */ ++ VKNUM, /* nval = numerical value */ ++ VLOCAL, /* info = local register */ ++ VUPVAL, /* info = index of upvalue in `upvalues' */ ++ VGLOBAL, /* info = index of table; aux = index of global name in `k' */ ++ VINDEXED, /* info = table register; aux = index register (or `k') */ ++ VJMP, /* info = instruction pc */ ++ VRELOCABLE, /* info = instruction pc */ ++ VNONRELOC, /* info = result register */ ++ VCALL, /* info = instruction pc */ ++ VVARARG /* info = instruction pc */ ++} expkind; ++ ++typedef struct expdesc { ++ expkind k; ++ union { ++ struct { int info, aux; } s; ++ lua_Number nval; ++ } u; ++ int t; /* patch list of `exit when true' */ ++ int f; /* patch list of `exit when false' */ ++} expdesc; ++ ++ ++typedef struct upvaldesc { ++ lu_byte k; ++ lu_byte info; ++} upvaldesc; ++ ++ ++struct BlockCnt; /* defined in lparser.c */ ++ ++ ++/* state needed to generate code for a given function */ ++typedef struct FuncState { ++ Proto *f; /* current function header */ ++ Table *h; /* table to find (and reuse) elements in `k' */ ++ struct FuncState *prev; /* enclosing function */ ++ struct LexState *ls; /* lexical state */ ++ struct lua_State *L; /* copy of the Lua state */ ++ struct BlockCnt *bl; /* chain of current blocks */ ++ int pc; /* next position to code (equivalent to `ncode') */ ++ int lasttarget; /* `pc' of last `jump target' */ ++ int jpc; /* list of pending jumps to `pc' */ ++ int freereg; /* first free register */ ++ int nk; /* number of elements in `k' */ ++ int np; /* number of elements in `p' */ ++ short nlocvars; /* number of elements in `locvars' */ ++ lu_byte nactvar; /* number of active local variables */ ++ upvaldesc upvalues[LUAI_MAXUPVALUES]; /* upvalues */ ++ unsigned short actvar[LUAI_MAXVARS]; /* declared-variable stack */ ++} FuncState; ++ ++ ++LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, ++ const char *name); ++ ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/lstate.c +@@ -0,0 +1,214 @@ ++/* ++** $Id: lstate.c,v 2.36.1.2 2008/01/03 15:20:39 roberto Exp $ ++** Global State ++** See Copyright Notice in lua.h ++*/ ++ ++ ++#include ++ ++#define lstate_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "ldebug.h" ++#include "ldo.h" ++#include "lfunc.h" ++#include "lgc.h" ++#include "llex.h" ++#include "lmem.h" ++#include "lstate.h" ++#include "lstring.h" ++#include "ltable.h" ++#include "ltm.h" ++ ++ ++#define state_size(x) (sizeof(x) + LUAI_EXTRASPACE) ++#define fromstate(l) (cast(lu_byte *, (l)) - LUAI_EXTRASPACE) ++#define tostate(l) (cast(lua_State *, cast(lu_byte *, l) + LUAI_EXTRASPACE)) ++ ++ ++/* ++** Main thread combines a thread state and the global state ++*/ ++typedef struct LG { ++ lua_State l; ++ global_State g; ++} LG; ++ ++ ++ ++static void stack_init (lua_State *L1, lua_State *L) { ++ /* initialize CallInfo array */ ++ L1->base_ci = luaM_newvector(L, BASIC_CI_SIZE, CallInfo); ++ L1->ci = L1->base_ci; ++ L1->size_ci = BASIC_CI_SIZE; ++ L1->end_ci = L1->base_ci + L1->size_ci - 1; ++ /* initialize stack array */ ++ L1->stack = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, TValue); ++ L1->stacksize = BASIC_STACK_SIZE + EXTRA_STACK; ++ L1->top = L1->stack; ++ L1->stack_last = L1->stack+(L1->stacksize - EXTRA_STACK)-1; ++ /* initialize first ci */ ++ L1->ci->func = L1->top; ++ setnilvalue(L1->top++); /* `function' entry for this `ci' */ ++ L1->base = L1->ci->base = L1->top; ++ L1->ci->top = L1->top + LUA_MINSTACK; ++} ++ ++ ++static void freestack (lua_State *L, lua_State *L1) { ++ luaM_freearray(L, L1->base_ci, L1->size_ci, CallInfo); ++ luaM_freearray(L, L1->stack, L1->stacksize, TValue); ++} ++ ++ ++/* ++** open parts that may cause memory-allocation errors ++*/ ++static void f_luaopen (lua_State *L, void *ud) { ++ global_State *g = G(L); ++ UNUSED(ud); ++ stack_init(L, L); /* init stack */ ++ sethvalue(L, gt(L), luaH_new(L, 0, 2)); /* table of globals */ ++ sethvalue(L, registry(L), luaH_new(L, 0, 2)); /* registry */ ++ luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ ++ luaT_init(L); ++ luaX_init(L); ++ luaS_fix(luaS_newliteral(L, MEMERRMSG)); ++ g->GCthreshold = 4*g->totalbytes; ++} ++ ++ ++static void preinit_state (lua_State *L, global_State *g) { ++ G(L) = g; ++ L->stack = NULL; ++ L->stacksize = 0; ++ L->errorJmp = NULL; ++ L->hook = NULL; ++ L->hookmask = 0; ++ L->basehookcount = 0; ++ L->allowhook = 1; ++ resethookcount(L); ++ L->openupval = NULL; ++ L->size_ci = 0; ++ L->nCcalls = L->baseCcalls = 0; ++ L->status = 0; ++ L->base_ci = L->ci = NULL; ++ L->savedpc = NULL; ++ L->errfunc = 0; ++ setnilvalue(gt(L)); ++} ++ ++ ++static void close_state (lua_State *L) { ++ global_State *g = G(L); ++ luaF_close(L, L->stack); /* close all upvalues for this thread */ ++ luaC_freeall(L); /* collect all objects */ ++ lua_assert(g->rootgc == obj2gco(L)); ++ lua_assert(g->strt.nuse == 0); ++ luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size, TString *); ++ luaZ_freebuffer(L, &g->buff); ++ freestack(L, L); ++ lua_assert(g->totalbytes == sizeof(LG)); ++ (*g->frealloc)(g->ud, fromstate(L), state_size(LG), 0); ++} ++ ++ ++lua_State *luaE_newthread (lua_State *L) { ++ lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State))); ++ luaC_link(L, obj2gco(L1), LUA_TTHREAD); ++ preinit_state(L1, G(L)); ++ stack_init(L1, L); /* init stack */ ++ setobj2n(L, gt(L1), gt(L)); /* share table of globals */ ++ L1->hookmask = L->hookmask; ++ L1->basehookcount = L->basehookcount; ++ L1->hook = L->hook; ++ resethookcount(L1); ++ lua_assert(iswhite(obj2gco(L1))); ++ return L1; ++} ++ ++ ++void luaE_freethread (lua_State *L, lua_State *L1) { ++ luaF_close(L1, L1->stack); /* close all upvalues for this thread */ ++ lua_assert(L1->openupval == NULL); ++ luai_userstatefree(L1); ++ freestack(L, L1); ++ luaM_freemem(L, fromstate(L1), state_size(lua_State)); ++} ++ ++ ++LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { ++ int i; ++ lua_State *L; ++ global_State *g; ++ void *l = (*f)(ud, NULL, 0, state_size(LG)); ++ if (l == NULL) return NULL; ++ L = tostate(l); ++ g = &((LG *)L)->g; ++ L->next = NULL; ++ L->tt = LUA_TTHREAD; ++ g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT); ++ L->marked = luaC_white(g); ++ set2bits(L->marked, FIXEDBIT, SFIXEDBIT); ++ preinit_state(L, g); ++ g->frealloc = f; ++ g->ud = ud; ++ g->mainthread = L; ++ g->uvhead.u.l.prev = &g->uvhead; ++ g->uvhead.u.l.next = &g->uvhead; ++ g->GCthreshold = 0; /* mark it as unfinished state */ ++ g->strt.size = 0; ++ g->strt.nuse = 0; ++ g->strt.hash = NULL; ++ setnilvalue(registry(L)); ++ luaZ_initbuffer(L, &g->buff); ++ g->panic = NULL; ++ g->gcstate = GCSpause; ++ g->rootgc = obj2gco(L); ++ g->sweepstrgc = 0; ++ g->sweepgc = &g->rootgc; ++ g->gray = NULL; ++ g->grayagain = NULL; ++ g->weak = NULL; ++ g->tmudata = NULL; ++ g->totalbytes = sizeof(LG); ++ g->gcpause = LUAI_GCPAUSE; ++ g->gcstepmul = LUAI_GCMUL; ++ g->gcdept = 0; ++ for (i=0; imt[i] = NULL; ++ if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0) { ++ /* memory allocation error: free partial state */ ++ close_state(L); ++ L = NULL; ++ } ++ else ++ luai_userstateopen(L); ++ return L; ++} ++ ++ ++static void callallgcTM (lua_State *L, void *ud) { ++ UNUSED(ud); ++ luaC_callGCTM(L); /* call GC metamethods for all udata */ ++} ++ ++ ++LUA_API void lua_close (lua_State *L) { ++ L = G(L)->mainthread; /* only the main thread can be closed */ ++ lua_lock(L); ++ luaF_close(L, L->stack); /* close all upvalues for this thread */ ++ luaC_separateudata(L, 1); /* separate udata that have GC metamethods */ ++ L->errfunc = 0; /* no error function during GC metamethods */ ++ do { /* repeat until no more errors */ ++ L->ci = L->base_ci; ++ L->base = L->top = L->ci->base; ++ L->nCcalls = L->baseCcalls = 0; ++ } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0); ++ lua_assert(G(L)->tmudata == NULL); ++ luai_userstateclose(L); ++ close_state(L); ++} ++ +--- /dev/null ++++ b/extensions/LUA/lua/lstate.h +@@ -0,0 +1,169 @@ ++/* ++** $Id: lstate.h,v 2.24.1.2 2008/01/03 15:20:39 roberto Exp $ ++** Global State ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef lstate_h ++#define lstate_h ++ ++#include "lua.h" ++ ++#include "lobject.h" ++#include "ltm.h" ++#include "lzio.h" ++ ++ ++ ++struct lua_longjmp; /* defined in ldo.c */ ++ ++ ++/* table of globals */ ++#define gt(L) (&L->l_gt) ++ ++/* registry */ ++#define registry(L) (&G(L)->l_registry) ++ ++ ++/* extra stack space to handle TM calls and some other extras */ ++#define EXTRA_STACK 5 ++ ++ ++#define BASIC_CI_SIZE 8 ++ ++#define BASIC_STACK_SIZE (2*LUA_MINSTACK) ++ ++ ++ ++typedef struct stringtable { ++ GCObject **hash; ++ lu_int32 nuse; /* number of elements */ ++ int size; ++} stringtable; ++ ++ ++/* ++** informations about a call ++*/ ++typedef struct CallInfo { ++ StkId base; /* base for this function */ ++ StkId func; /* function index in the stack */ ++ StkId top; /* top for this function */ ++ const Instruction *savedpc; ++ int nresults; /* expected number of results from this function */ ++ int tailcalls; /* number of tail calls lost under this entry */ ++} CallInfo; ++ ++ ++ ++#define curr_func(L) (clvalue(L->ci->func)) ++#define ci_func(ci) (clvalue((ci)->func)) ++#define f_isLua(ci) (!ci_func(ci)->c.isC) ++#define isLua(ci) (ttisfunction((ci)->func) && f_isLua(ci)) ++ ++ ++/* ++** `global state', shared by all threads of this state ++*/ ++typedef struct global_State { ++ stringtable strt; /* hash table for strings */ ++ lua_Alloc frealloc; /* function to reallocate memory */ ++ void *ud; /* auxiliary data to `frealloc' */ ++ lu_byte currentwhite; ++ lu_byte gcstate; /* state of garbage collector */ ++ int sweepstrgc; /* position of sweep in `strt' */ ++ GCObject *rootgc; /* list of all collectable objects */ ++ GCObject **sweepgc; /* position of sweep in `rootgc' */ ++ GCObject *gray; /* list of gray objects */ ++ GCObject *grayagain; /* list of objects to be traversed atomically */ ++ GCObject *weak; /* list of weak tables (to be cleared) */ ++ GCObject *tmudata; /* last element of list of userdata to be GC */ ++ Mbuffer buff; /* temporary buffer for string concatentation */ ++ lu_mem GCthreshold; ++ lu_mem totalbytes; /* number of bytes currently allocated */ ++ lu_mem estimate; /* an estimate of number of bytes actually in use */ ++ lu_mem gcdept; /* how much GC is `behind schedule' */ ++ int gcpause; /* size of pause between successive GCs */ ++ int gcstepmul; /* GC `granularity' */ ++ lua_CFunction panic; /* to be called in unprotected errors */ ++ TValue l_registry; ++ struct lua_State *mainthread; ++ UpVal uvhead; /* head of double-linked list of all open upvalues */ ++ struct Table *mt[NUM_TAGS]; /* metatables for basic types */ ++ TString *tmname[TM_N]; /* array with tag-method names */ ++} global_State; ++ ++ ++/* ++** `per thread' state ++*/ ++struct lua_State { ++ CommonHeader; ++ lu_byte status; ++ StkId top; /* first free slot in the stack */ ++ StkId base; /* base of current function */ ++ global_State *l_G; ++ CallInfo *ci; /* call info for current function */ ++ const Instruction *savedpc; /* `savedpc' of current function */ ++ StkId stack_last; /* last free slot in the stack */ ++ StkId stack; /* stack base */ ++ CallInfo *end_ci; /* points after end of ci array*/ ++ CallInfo *base_ci; /* array of CallInfo's */ ++ int stacksize; ++ int size_ci; /* size of array `base_ci' */ ++ unsigned short nCcalls; /* number of nested C calls */ ++ unsigned short baseCcalls; /* nested C calls when resuming coroutine */ ++ lu_byte hookmask; ++ lu_byte allowhook; ++ int basehookcount; ++ int hookcount; ++ lua_Hook hook; ++ TValue l_gt; /* table of globals */ ++ TValue env; /* temporary place for environments */ ++ GCObject *openupval; /* list of open upvalues in this stack */ ++ GCObject *gclist; ++ struct lua_longjmp *errorJmp; /* current error recover point */ ++ ptrdiff_t errfunc; /* current error handling function (stack index) */ ++}; ++ ++ ++#define G(L) (L->l_G) ++ ++ ++/* ++** Union of all collectable objects ++*/ ++union GCObject { ++ GCheader gch; ++ union TString ts; ++ union Udata u; ++ union Closure cl; ++ struct Table h; ++ struct Proto p; ++ struct UpVal uv; ++ struct lua_State th; /* thread */ ++}; ++ ++ ++/* macros to convert a GCObject into a specific value */ ++#define rawgco2ts(o) check_exp((o)->gch.tt == LUA_TSTRING, &((o)->ts)) ++#define gco2ts(o) (&rawgco2ts(o)->tsv) ++#define rawgco2u(o) check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u)) ++#define gco2u(o) (&rawgco2u(o)->uv) ++#define gco2cl(o) check_exp((o)->gch.tt == LUA_TFUNCTION, &((o)->cl)) ++#define gco2h(o) check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h)) ++#define gco2p(o) check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p)) ++#define gco2uv(o) check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv)) ++#define ngcotouv(o) \ ++ check_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv)) ++#define gco2th(o) check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th)) ++ ++/* macro to convert any Lua object into a GCObject */ ++#define obj2gco(v) (cast(GCObject *, (v))) ++ ++ ++LUAI_FUNC lua_State *luaE_newthread (lua_State *L); ++LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); ++ ++#endif ++ +--- /dev/null ++++ b/extensions/LUA/lua/lstring.c +@@ -0,0 +1,110 @@ ++/* ++** $Id: lstring.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $ ++** String table (keeps all strings handled by Lua) ++** See Copyright Notice in lua.h ++*/ ++ ++#include ++ ++#define lstring_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "lmem.h" ++#include "lobject.h" ++#include "lstate.h" ++#include "lstring.h" ++ ++ ++ ++void luaS_resize (lua_State *L, int newsize) { ++ GCObject **newhash; ++ stringtable *tb; ++ int i; ++ if (G(L)->gcstate == GCSsweepstring) ++ return; /* cannot resize during GC traverse */ ++ newhash = luaM_newvector(L, newsize, GCObject *); ++ tb = &G(L)->strt; ++ for (i=0; isize; i++) { ++ GCObject *p = tb->hash[i]; ++ while (p) { /* for each node in the list */ ++ GCObject *next = p->gch.next; /* save next */ ++ unsigned int h = gco2ts(p)->hash; ++ int h1 = lmod(h, newsize); /* new position */ ++ lua_assert(cast_int(h%newsize) == lmod(h, newsize)); ++ p->gch.next = newhash[h1]; /* chain it */ ++ newhash[h1] = p; ++ p = next; ++ } ++ } ++ luaM_freearray(L, tb->hash, tb->size, TString *); ++ tb->size = newsize; ++ tb->hash = newhash; ++} ++ ++ ++static TString *newlstr (lua_State *L, const char *str, size_t l, ++ unsigned int h) { ++ TString *ts; ++ stringtable *tb; ++ if (l+1 > (MAX_SIZET - sizeof(TString))/sizeof(char)) ++ luaM_toobig(L); ++ ts = cast(TString *, luaM_malloc(L, (l+1)*sizeof(char)+sizeof(TString))); ++ ts->tsv.len = l; ++ ts->tsv.hash = h; ++ ts->tsv.marked = luaC_white(G(L)); ++ ts->tsv.tt = LUA_TSTRING; ++ ts->tsv.reserved = 0; ++ memcpy(ts+1, str, l*sizeof(char)); ++ ((char *)(ts+1))[l] = '\0'; /* ending 0 */ ++ tb = &G(L)->strt; ++ h = lmod(h, tb->size); ++ ts->tsv.next = tb->hash[h]; /* chain new entry */ ++ tb->hash[h] = obj2gco(ts); ++ tb->nuse++; ++ if (tb->nuse > cast(lu_int32, tb->size) && tb->size <= MAX_INT/2) ++ luaS_resize(L, tb->size*2); /* too crowded */ ++ return ts; ++} ++ ++ ++TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { ++ GCObject *o; ++ unsigned int h = cast(unsigned int, l); /* seed */ ++ size_t step = (l>>5)+1; /* if string is too long, don't hash all its chars */ ++ size_t l1; ++ for (l1=l; l1>=step; l1-=step) /* compute hash */ ++ h = h ^ ((h<<5)+(h>>2)+cast(unsigned char, str[l1-1])); ++ for (o = G(L)->strt.hash[lmod(h, G(L)->strt.size)]; ++ o != NULL; ++ o = o->gch.next) { ++ TString *ts = rawgco2ts(o); ++ if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) { ++ /* string may be dead */ ++ if (isdead(G(L), o)) changewhite(o); ++ return ts; ++ } ++ } ++ return newlstr(L, str, l, h); /* not found */ ++} ++ ++ ++Udata *luaS_newudata (lua_State *L, size_t s, Table *e) { ++ Udata *u; ++ if (s > MAX_SIZET - sizeof(Udata)) ++ luaM_toobig(L); ++ u = cast(Udata *, luaM_malloc(L, s + sizeof(Udata))); ++ u->uv.marked = luaC_white(G(L)); /* is not finalized */ ++ u->uv.tt = LUA_TUSERDATA; ++ u->uv.len = s; ++ u->uv.metatable = NULL; ++ u->uv.env = e; ++ /* chain it on udata list (after main thread) */ ++ u->uv.next = G(L)->mainthread->next; ++ G(L)->mainthread->next = obj2gco(u); ++ return u; ++} ++ +--- /dev/null ++++ b/extensions/LUA/lua/lstring.h +@@ -0,0 +1,31 @@ ++/* ++** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $ ++** String table (keep all strings handled by Lua) ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef lstring_h ++#define lstring_h ++ ++ ++#include "lgc.h" ++#include "lobject.h" ++#include "lstate.h" ++ ++ ++#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char)) ++ ++#define sizeudata(u) (sizeof(union Udata)+(u)->len) ++ ++#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s))) ++#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ ++ (sizeof(s)/sizeof(char))-1)) ++ ++#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT) ++ ++LUAI_FUNC void luaS_resize (lua_State *L, int newsize); ++LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); ++LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); ++ ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/lstrlib.c +@@ -0,0 +1,883 @@ ++/* ++** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $ ++** Standard library for string operations and pattern-matching ++** See Copyright Notice in lua.h ++*/ ++ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#define lstrlib_c ++#define LUA_LIB ++ ++#include "lua.h" ++ ++#include "lauxlib.h" ++#include "lualib.h" ++ ++ ++/* macro to `unsign' a character */ ++#define uchar(c) ((unsigned char)(c)) ++ ++ ++ ++static int str_len (lua_State *L) { ++ size_t l; ++ luaL_checklstring(L, 1, &l); ++ lua_pushinteger(L, l); ++ return 1; ++} ++ ++ ++static ptrdiff_t posrelat (ptrdiff_t pos, size_t len) { ++ /* relative string position: negative means back from end */ ++ if (pos < 0) pos += (ptrdiff_t)len + 1; ++ return (pos >= 0) ? pos : 0; ++} ++ ++ ++static int str_sub (lua_State *L) { ++ size_t l; ++ const char *s = luaL_checklstring(L, 1, &l); ++ ptrdiff_t start = posrelat(luaL_checkinteger(L, 2), l); ++ ptrdiff_t end = posrelat(luaL_optinteger(L, 3, -1), l); ++ if (start < 1) start = 1; ++ if (end > (ptrdiff_t)l) end = (ptrdiff_t)l; ++ if (start <= end) ++ lua_pushlstring(L, s+start-1, end-start+1); ++ else lua_pushliteral(L, ""); ++ return 1; ++} ++ ++ ++static int str_reverse (lua_State *L) { ++ size_t l; ++ const char *s = luaL_checklstring(L, 1, &l); ++ luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC); ++ if(!b) luaL_error(L, "str_reverse: cannot allocate memory"); ++ luaL_buffinit(L, b); ++ while (l--) luaL_addchar(b, s[l]); ++ luaL_pushresult(b); ++ kfree(b); ++ return 1; ++} ++ ++ ++static int str_lower (lua_State *L) { ++ size_t l; ++ size_t i; ++ const char *s = luaL_checklstring(L, 1, &l); ++ luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC); ++ if(!b) luaL_error(L, "str_lower: cannot allocate memory"); ++ luaL_buffinit(L, b); ++ for (i=0; i 0) ++ luaL_addlstring(b, s, l); ++ luaL_pushresult(b); ++ kfree(b); ++ return 1; ++} ++ ++ ++static int str_byte (lua_State *L) { ++ size_t l; ++ const char *s = luaL_checklstring(L, 1, &l); ++ ptrdiff_t posi = posrelat(luaL_optinteger(L, 2, 1), l); ++ ptrdiff_t pose = posrelat(luaL_optinteger(L, 3, posi), l); ++ int n, i; ++ if (posi <= 0) posi = 1; ++ if ((size_t)pose > l) pose = l; ++ if (posi > pose) return 0; /* empty interval; return no values */ ++ n = (int)(pose - posi + 1); ++ if (posi + n <= pose) /* overflow? */ ++ luaL_error(L, "string slice too long"); ++ luaL_checkstack(L, n, "string slice too long"); ++ for (i=0; i= ms->level || ms->capture[l].len == CAP_UNFINISHED) ++ return luaL_error(ms->L, "invalid capture index"); ++ return l; ++} ++ ++ ++static int capture_to_close (MatchState *ms) { ++ int level = ms->level; ++ for (level--; level>=0; level--) ++ if (ms->capture[level].len == CAP_UNFINISHED) return level; ++ return luaL_error(ms->L, "invalid pattern capture"); ++} ++ ++ ++static const char *classend (MatchState *ms, const char *p) { ++ switch (*p++) { ++ case L_ESC: { ++ if (*p == '\0') ++ luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")"); ++ return p+1; ++ } ++ case '[': { ++ if (*p == '^') p++; ++ do { /* look for a `]' */ ++ if (*p == '\0') ++ luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")"); ++ if (*(p++) == L_ESC && *p != '\0') ++ p++; /* skip escapes (e.g. `%]') */ ++ } while (*p != ']'); ++ return p+1; ++ } ++ default: { ++ return p; ++ } ++ } ++} ++ ++ ++static int match_class (int c, int cl) { ++ int res; ++ switch (tolower(cl)) { ++ case 'a' : res = isalpha(c); break; ++ case 'c' : res = iscntrl(c); break; ++ case 'd' : res = isdigit(c); break; ++ case 'l' : res = islower(c); break; ++ case 'p' : res = ispunct(c); break; ++ case 's' : res = isspace(c); break; ++ case 'u' : res = isupper(c); break; ++ case 'w' : res = isalnum(c); break; ++ case 'x' : res = isxdigit(c); break; ++ case 'z' : res = (c == 0); break; ++ default: return (cl == c); ++ } ++ return (islower(cl) ? res : !res); ++} ++ ++ ++static int matchbracketclass (int c, const char *p, const char *ec) { ++ int sig = 1; ++ if (*(p+1) == '^') { ++ sig = 0; ++ p++; /* skip the `^' */ ++ } ++ while (++p < ec) { ++ if (*p == L_ESC) { ++ p++; ++ if (match_class(c, uchar(*p))) ++ return sig; ++ } ++ else if ((*(p+1) == '-') && (p+2 < ec)) { ++ p+=2; ++ if (uchar(*(p-2)) <= c && c <= uchar(*p)) ++ return sig; ++ } ++ else if (uchar(*p) == c) return sig; ++ } ++ return !sig; ++} ++ ++ ++static int singlematch (int c, const char *p, const char *ep) { ++ switch (*p) { ++ case '.': return 1; /* matches any char */ ++ case L_ESC: return match_class(c, uchar(*(p+1))); ++ case '[': return matchbracketclass(c, p, ep-1); ++ default: return (uchar(*p) == c); ++ } ++} ++ ++ ++static const char *match (MatchState *ms, const char *s, const char *p); ++ ++ ++static const char *matchbalance (MatchState *ms, const char *s, ++ const char *p) { ++ if (*p == 0 || *(p+1) == 0) ++ luaL_error(ms->L, "unbalanced pattern"); ++ if (*s != *p) return NULL; ++ else { ++ int b = *p; ++ int e = *(p+1); ++ int cont = 1; ++ while (++s < ms->src_end) { ++ if (*s == e) { ++ if (--cont == 0) return s+1; ++ } ++ else if (*s == b) cont++; ++ } ++ } ++ return NULL; /* string ends out of balance */ ++} ++ ++ ++static const char *max_expand (MatchState *ms, const char *s, ++ const char *p, const char *ep) { ++ ptrdiff_t i = 0; /* counts maximum expand for item */ ++ while ((s+i)src_end && singlematch(uchar(*(s+i)), p, ep)) ++ i++; ++ /* keeps trying to match with the maximum repetitions */ ++ while (i>=0) { ++ const char *res = match(ms, (s+i), ep+1); ++ if (res) return res; ++ i--; /* else didn't match; reduce 1 repetition to try again */ ++ } ++ return NULL; ++} ++ ++ ++static const char *min_expand (MatchState *ms, const char *s, ++ const char *p, const char *ep) { ++ for (;;) { ++ const char *res = match(ms, s, ep+1); ++ if (res != NULL) ++ return res; ++ else if (ssrc_end && singlematch(uchar(*s), p, ep)) ++ s++; /* try with one more repetition */ ++ else return NULL; ++ } ++} ++ ++ ++static const char *start_capture (MatchState *ms, const char *s, ++ const char *p, int what) { ++ const char *res; ++ int level = ms->level; ++ if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures"); ++ ms->capture[level].init = s; ++ ms->capture[level].len = what; ++ ms->level = level+1; ++ if ((res=match(ms, s, p)) == NULL) /* match failed? */ ++ ms->level--; /* undo capture */ ++ return res; ++} ++ ++ ++static const char *end_capture (MatchState *ms, const char *s, ++ const char *p) { ++ int l = capture_to_close(ms); ++ const char *res; ++ ms->capture[l].len = s - ms->capture[l].init; /* close capture */ ++ if ((res = match(ms, s, p)) == NULL) /* match failed? */ ++ ms->capture[l].len = CAP_UNFINISHED; /* undo capture */ ++ return res; ++} ++ ++ ++static const char *match_capture (MatchState *ms, const char *s, int l) { ++ size_t len; ++ l = check_capture(ms, l); ++ len = ms->capture[l].len; ++ if ((size_t)(ms->src_end-s) >= len && ++ memcmp(ms->capture[l].init, s, len) == 0) ++ return s+len; ++ else return NULL; ++} ++ ++ ++static const char *match (MatchState *ms, const char *s, const char *p) { ++ init: /* using goto's to optimize tail recursion */ ++ switch (*p) { ++ case '(': { /* start capture */ ++ if (*(p+1) == ')') /* position capture? */ ++ return start_capture(ms, s, p+2, CAP_POSITION); ++ else ++ return start_capture(ms, s, p+1, CAP_UNFINISHED); ++ } ++ case ')': { /* end capture */ ++ return end_capture(ms, s, p+1); ++ } ++ case L_ESC: { ++ switch (*(p+1)) { ++ case 'b': { /* balanced string? */ ++ s = matchbalance(ms, s, p+2); ++ if (s == NULL) return NULL; ++ p+=4; goto init; /* else return match(ms, s, p+4); */ ++ } ++ case 'f': { /* frontier? */ ++ const char *ep; char previous; ++ p += 2; ++ if (*p != '[') ++ luaL_error(ms->L, "missing " LUA_QL("[") " after " ++ LUA_QL("%%f") " in pattern"); ++ ep = classend(ms, p); /* points to what is next */ ++ previous = (s == ms->src_init) ? '\0' : *(s-1); ++ if (matchbracketclass(uchar(previous), p, ep-1) || ++ !matchbracketclass(uchar(*s), p, ep-1)) return NULL; ++ p=ep; goto init; /* else return match(ms, s, ep); */ ++ } ++ default: { ++ if (isdigit(uchar(*(p+1)))) { /* capture results (%0-%9)? */ ++ s = match_capture(ms, s, uchar(*(p+1))); ++ if (s == NULL) return NULL; ++ p+=2; goto init; /* else return match(ms, s, p+2) */ ++ } ++ goto dflt; /* case default */ ++ } ++ } ++ } ++ case '\0': { /* end of pattern */ ++ return s; /* match succeeded */ ++ } ++ case '$': { ++ if (*(p+1) == '\0') /* is the `$' the last char in pattern? */ ++ return (s == ms->src_end) ? s : NULL; /* check end of string */ ++ else goto dflt; ++ } ++ default: dflt: { /* it is a pattern item */ ++ const char *ep = classend(ms, p); /* points to what is next */ ++ int m = ssrc_end && singlematch(uchar(*s), p, ep); ++ switch (*ep) { ++ case '?': { /* optional */ ++ const char *res; ++ if (m && ((res=match(ms, s+1, ep+1)) != NULL)) ++ return res; ++ p=ep+1; goto init; /* else return match(ms, s, ep+1); */ ++ } ++ case '*': { /* 0 or more repetitions */ ++ return max_expand(ms, s, p, ep); ++ } ++ case '+': { /* 1 or more repetitions */ ++ return (m ? max_expand(ms, s+1, p, ep) : NULL); ++ } ++ case '-': { /* 0 or more repetitions (minimum) */ ++ return min_expand(ms, s, p, ep); ++ } ++ default: { ++ if (!m) return NULL; ++ s++; p=ep; goto init; /* else return match(ms, s+1, ep); */ ++ } ++ } ++ } ++ } ++} ++ ++ ++ ++static const char *lmemfind (const char *s1, size_t l1, ++ const char *s2, size_t l2) { ++ if (l2 == 0) return s1; /* empty strings are everywhere */ ++ else if (l2 > l1) return NULL; /* avoids a negative `l1' */ ++ else { ++ const char *init; /* to search for a `*s2' inside `s1' */ ++ l2--; /* 1st char will be checked by `memchr' */ ++ l1 = l1-l2; /* `s2' cannot be found after that */ ++ while (l1 > 0 && (init = (const char *)memchr(s1, *s2, l1)) != NULL) { ++ init++; /* 1st char is already checked */ ++ if (memcmp(init, s2+1, l2) == 0) ++ return init-1; ++ else { /* correct `l1' and `s1' to try again */ ++ l1 -= init-s1; ++ s1 = init; ++ } ++ } ++ return NULL; /* not found */ ++ } ++} ++ ++ ++static void push_onecapture (MatchState *ms, int i, const char *s, ++ const char *e) { ++ if (i >= ms->level) { ++ if (i == 0) /* ms->level == 0, too */ ++ lua_pushlstring(ms->L, s, e - s); /* add whole match */ ++ else ++ luaL_error(ms->L, "invalid capture index"); ++ } ++ else { ++ ptrdiff_t l = ms->capture[i].len; ++ if (l == CAP_UNFINISHED) luaL_error(ms->L, "unfinished capture"); ++ if (l == CAP_POSITION) ++ lua_pushinteger(ms->L, ms->capture[i].init - ms->src_init + 1); ++ else ++ lua_pushlstring(ms->L, ms->capture[i].init, l); ++ } ++} ++ ++ ++static int push_captures (MatchState *ms, const char *s, const char *e) { ++ int i; ++ int nlevels = (ms->level == 0 && s) ? 1 : ms->level; ++ luaL_checkstack(ms->L, nlevels, "too many captures"); ++ for (i = 0; i < nlevels; i++) ++ push_onecapture(ms, i, s, e); ++ return nlevels; /* number of strings pushed */ ++} ++ ++ ++static int str_find_aux (lua_State *L, int find) { ++ size_t l1, l2; ++ const char *s = luaL_checklstring(L, 1, &l1); ++ const char *p = luaL_checklstring(L, 2, &l2); ++ ptrdiff_t init = posrelat(luaL_optinteger(L, 3, 1), l1) - 1; ++ if (init < 0) init = 0; ++ else if ((size_t)(init) > l1) init = (ptrdiff_t)l1; ++ if (find && (lua_toboolean(L, 4) || /* explicit request? */ ++ strpbrk(p, SPECIALS) == NULL)) { /* or no special characters? */ ++ /* do a plain search */ ++ const char *s2 = lmemfind(s+init, l1-init, p, l2); ++ if (s2) { ++ lua_pushinteger(L, s2-s+1); ++ lua_pushinteger(L, s2-s+l2); ++ return 2; ++ } ++ } ++ else { ++ MatchState ms; ++ int anchor = (*p == '^') ? (p++, 1) : 0; ++ const char *s1=s+init; ++ ms.L = L; ++ ms.src_init = s; ++ ms.src_end = s+l1; ++ do { ++ const char *res; ++ ms.level = 0; ++ if ((res=match(&ms, s1, p)) != NULL) { ++ if (find) { ++ lua_pushinteger(L, s1-s+1); /* start */ ++ lua_pushinteger(L, res-s); /* end */ ++ return push_captures(&ms, NULL, 0) + 2; ++ } ++ else ++ return push_captures(&ms, s1, res); ++ } ++ } while (s1++ < ms.src_end && !anchor); ++ } ++ lua_pushnil(L); /* not found */ ++ return 1; ++} ++ ++ ++static int str_find (lua_State *L) { ++ return str_find_aux(L, 1); ++} ++ ++ ++static int str_match (lua_State *L) { ++ return str_find_aux(L, 0); ++} ++ ++ ++static int gmatch_aux (lua_State *L) { ++ MatchState ms; ++ size_t ls; ++ const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls); ++ const char *p = lua_tostring(L, lua_upvalueindex(2)); ++ const char *src; ++ ms.L = L; ++ ms.src_init = s; ++ ms.src_end = s+ls; ++ for (src = s + (size_t)lua_tointeger(L, lua_upvalueindex(3)); ++ src <= ms.src_end; ++ src++) { ++ const char *e; ++ ms.level = 0; ++ if ((e = match(&ms, src, p)) != NULL) { ++ lua_Integer newstart = e-s; ++ if (e == src) newstart++; /* empty match? go at least one position */ ++ lua_pushinteger(L, newstart); ++ lua_replace(L, lua_upvalueindex(3)); ++ return push_captures(&ms, src, e); ++ } ++ } ++ return 0; /* not found */ ++} ++ ++ ++static int gmatch (lua_State *L) { ++ luaL_checkstring(L, 1); ++ luaL_checkstring(L, 2); ++ lua_settop(L, 2); ++ lua_pushinteger(L, 0); ++ lua_pushcclosure(L, gmatch_aux, 3); ++ return 1; ++} ++ ++ ++static int gfind_nodef (lua_State *L) { ++ return luaL_error(L, LUA_QL("string.gfind") " was renamed to " ++ LUA_QL("string.gmatch")); ++} ++ ++ ++static void add_s (MatchState *ms, luaL_Buffer *b, const char *s, ++ const char *e) { ++ size_t l, i; ++ const char *news = lua_tolstring(ms->L, 3, &l); ++ for (i = 0; i < l; i++) { ++ if (news[i] != L_ESC) ++ luaL_addchar(b, news[i]); ++ else { ++ i++; /* skip ESC */ ++ if (!isdigit(uchar(news[i]))) ++ luaL_addchar(b, news[i]); ++ else if (news[i] == '0') ++ luaL_addlstring(b, s, e - s); ++ else { ++ push_onecapture(ms, news[i] - '1', s, e); ++ luaL_addvalue(b); /* add capture to accumulated result */ ++ } ++ } ++ } ++} ++ ++ ++static void add_value (MatchState *ms, luaL_Buffer *b, const char *s, ++ const char *e) { ++ lua_State *L = ms->L; ++ switch (lua_type(L, 3)) { ++ case LUA_TNUMBER: ++ case LUA_TSTRING: { ++ add_s(ms, b, s, e); ++ return; ++ } ++ case LUA_TFUNCTION: { ++ int n; ++ lua_pushvalue(L, 3); ++ n = push_captures(ms, s, e); ++ lua_call(L, n, 1); ++ break; ++ } ++ case LUA_TTABLE: { ++ push_onecapture(ms, 0, s, e); ++ lua_gettable(L, 3); ++ break; ++ } ++ } ++ if (!lua_toboolean(L, -1)) { /* nil or false? */ ++ lua_pop(L, 1); ++ lua_pushlstring(L, s, e - s); /* keep original text */ ++ } ++ else if (!lua_isstring(L, -1)) ++ luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1)); ++ luaL_addvalue(b); /* add result to accumulator */ ++} ++ ++ ++static int str_gsub (lua_State *L) { ++ size_t srcl; ++ const char *src = luaL_checklstring(L, 1, &srcl); ++ const char *p = luaL_checkstring(L, 2); ++ int tr = lua_type(L, 3); ++ int max_s = luaL_optint(L, 4, srcl+1); ++ int anchor = (*p == '^') ? (p++, 1) : 0; ++ int n = 0; ++ MatchState ms; ++ luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC); ++ if(!b) luaL_error(L, "str_gsub: cannot allocate memory"); ++ luaL_argcheck(L, tr == LUA_TNUMBER || tr == LUA_TSTRING || ++ tr == LUA_TFUNCTION || tr == LUA_TTABLE, 3, ++ "string/function/table expected"); ++ luaL_buffinit(L, b); ++ ms.L = L; ++ ms.src_init = src; ++ ms.src_end = src+srcl; ++ while (n < max_s) { ++ const char *e; ++ ms.level = 0; ++ e = match(&ms, src, p); ++ if (e) { ++ n++; ++ add_value(&ms, b, src, e); ++ } ++ if (e && e>src) /* non empty match? */ ++ src = e; /* skip it */ ++ else if (src < ms.src_end) ++ luaL_addchar(b, *src++); ++ else break; ++ if (anchor) break; ++ } ++ luaL_addlstring(b, src, ms.src_end-src); ++ luaL_pushresult(b); ++ lua_pushinteger(L, n); /* number of substitutions */ ++ kfree(b); ++ return 2; ++} ++ ++/* }====================================================== */ ++ ++ ++/* maximum size of each formatted item (> len(format('%99.99f', -1e308))) */ ++#define MAX_ITEM 512 ++/* valid flags in a format specification */ ++#define FLAGS "-+ #0" ++/* ++** maximum size of each format specification (such as '%-099.99d') ++** (+10 accounts for %99.99x plus margin of error) ++*/ ++#define MAX_FORMAT (sizeof(FLAGS) + sizeof(LUA_INTFRMLEN) + 10) ++ ++ ++static void addquoted (lua_State *L, luaL_Buffer *b, int arg) { ++ size_t l; ++ const char *s = luaL_checklstring(L, arg, &l); ++ luaL_addchar(b, '"'); ++ while (l--) { ++ switch (*s) { ++ case '"': case '\\': case '\n': { ++ luaL_addchar(b, '\\'); ++ luaL_addchar(b, *s); ++ break; ++ } ++ case '\r': { ++ luaL_addlstring(b, "\\r", 2); ++ break; ++ } ++ case '\0': { ++ luaL_addlstring(b, "\\000", 4); ++ break; ++ } ++ default: { ++ luaL_addchar(b, *s); ++ break; ++ } ++ } ++ s++; ++ } ++ luaL_addchar(b, '"'); ++} ++ ++static const char *scanformat (lua_State *L, const char *strfrmt, char *form) { ++ const char *p = strfrmt; ++ while (*p != '\0' && strchr(FLAGS, *p) != NULL) p++; /* skip flags */ ++ if ((size_t)(p - strfrmt) >= sizeof(FLAGS)) ++ luaL_error(L, "invalid format (repeated flags)"); ++ if (isdigit(uchar(*p))) p++; /* skip width */ ++ if (isdigit(uchar(*p))) p++; /* (2 digits at most) */ ++ if (*p == '.') { ++ p++; ++ if (isdigit(uchar(*p))) p++; /* skip precision */ ++ if (isdigit(uchar(*p))) p++; /* (2 digits at most) */ ++ } ++ if (isdigit(uchar(*p))) ++ luaL_error(L, "invalid format (width or precision too long)"); ++ *(form++) = '%'; ++ strncpy(form, strfrmt, p - strfrmt + 1); ++ form += p - strfrmt + 1; ++ *form = '\0'; ++ return p; ++} ++ ++ ++static void addintlen (char *form) { ++ size_t l = strlen(form); ++ char spec = form[l - 1]; ++ strcpy(form + l - 1, LUA_INTFRMLEN); ++ form[l + sizeof(LUA_INTFRMLEN) - 2] = spec; ++ form[l + sizeof(LUA_INTFRMLEN) - 1] = '\0'; ++} ++ ++ ++static int str_format (lua_State *L) { ++ int arg = 1; ++ size_t sfl; ++ const char *strfrmt = luaL_checklstring(L, arg, &sfl); ++ const char *strfrmt_end = strfrmt+sfl; ++ luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC); ++ if(!b) luaL_error(L, "str_format: cannot allocate memory"); ++ luaL_buffinit(L, b); ++ while (strfrmt < strfrmt_end) { ++ if (*strfrmt != L_ESC) ++ luaL_addchar(b, *strfrmt++); ++ else if (*++strfrmt == L_ESC) ++ luaL_addchar(b, *strfrmt++); /* %% */ ++ else { /* format item */ ++ char form[MAX_FORMAT]; /* to store the format (`%...') */ ++ char buff[MAX_ITEM]; /* to store the formatted item */ ++ arg++; ++ strfrmt = scanformat(L, strfrmt, form); ++ switch (*strfrmt++) { ++ case 'c': { ++ sprintf(buff, form, (int)luaL_checknumber(L, arg)); ++ break; ++ } ++ case 'd': case 'i': { ++ addintlen(form); ++ sprintf(buff, form, (LUA_INTFRM_T)luaL_checknumber(L, arg)); ++ break; ++ } ++ case 'o': case 'u': case 'x': case 'X': { ++ addintlen(form); ++ sprintf(buff, form, (unsigned LUA_INTFRM_T)luaL_checknumber(L, arg)); ++ break; ++ } ++ case 'q': { ++ addquoted(L, b, arg); ++ continue; /* skip the 'addsize' at the end */ ++ } ++ case 's': { ++ size_t l; ++ const char *s = luaL_checklstring(L, arg, &l); ++ if (!strchr(form, '.') && l >= 100) { ++ /* no precision and string is too long to be formatted; ++ keep original string */ ++ lua_pushvalue(L, arg); ++ luaL_addvalue(b); ++ continue; /* skip the `addsize' at the end */ ++ } ++ else { ++ sprintf(buff, form, s); ++ break; ++ } ++ } ++ default: { /* also treat cases `pnLlh' */ ++ kfree(b); ++ return luaL_error(L, "invalid option " LUA_QL("%%%c") " to " ++ LUA_QL("format"), *(strfrmt - 1)); ++ } ++ } ++ luaL_addlstring(b, buff, strlen(buff)); ++ } ++ } ++ luaL_pushresult(b); ++ kfree(b); ++ return 1; ++} ++ ++ ++static const luaL_Reg strlib[] = { ++ {"byte", str_byte}, ++ {"char", str_char}, ++ {"dump", str_dump}, ++ {"find", str_find}, ++ {"format", str_format}, ++ {"gfind", gfind_nodef}, ++ {"gmatch", gmatch}, ++ {"gsub", str_gsub}, ++ {"len", str_len}, ++ {"lower", str_lower}, ++ {"match", str_match}, ++ {"rep", str_rep}, ++ {"reverse", str_reverse}, ++ {"sub", str_sub}, ++ {"upper", str_upper}, ++ {NULL, NULL} ++}; ++ ++ ++static void createmetatable (lua_State *L) { ++ lua_createtable(L, 0, 1); /* create metatable for strings */ ++ lua_pushliteral(L, ""); /* dummy string */ ++ lua_pushvalue(L, -2); ++ lua_setmetatable(L, -2); /* set string metatable */ ++ lua_pop(L, 1); /* pop dummy string */ ++ lua_pushvalue(L, -2); /* string library... */ ++ lua_setfield(L, -2, "__index"); /* ...is the __index metamethod */ ++ lua_pop(L, 1); /* pop metatable */ ++} ++ ++ ++/* ++** Open string library ++*/ ++LUALIB_API int luaopen_string (lua_State *L) { ++ luaL_register(L, LUA_STRLIBNAME, strlib); ++#if defined(LUA_COMPAT_GFIND) ++ lua_getfield(L, -1, "gmatch"); ++ lua_setfield(L, -2, "gfind"); ++#endif ++ createmetatable(L); ++ return 1; ++} +--- /dev/null ++++ b/extensions/LUA/lua/ltable.c +@@ -0,0 +1,588 @@ ++/* ++** $Id: ltable.c,v 2.32.1.2 2007/12/28 15:32:23 roberto Exp $ ++** Lua tables (hash) ++** See Copyright Notice in lua.h ++*/ ++ ++ ++/* ++** Implementation of tables (aka arrays, objects, or hash tables). ++** Tables keep its elements in two parts: an array part and a hash part. ++** Non-negative integer keys are all candidates to be kept in the array ++** part. The actual size of the array is the largest `n' such that at ++** least half the slots between 0 and n are in use. ++** Hash uses a mix of chained scatter table with Brent's variation. ++** A main invariant of these tables is that, if an element is not ++** in its main position (i.e. the `original' position that its hash gives ++** to it), then the colliding element is in its own main position. ++** Hence even when the load factor reaches 100%, performance remains good. ++*/ ++ ++#include ++#include ++ ++#define ltable_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "ldebug.h" ++#include "ldo.h" ++#include "lgc.h" ++#include "lmem.h" ++#include "lobject.h" ++#include "lstate.h" ++#include "ltable.h" ++ ++ ++/* ++** max size of array part is 2^MAXBITS ++*/ ++#if LUAI_BITSINT > 26 ++#define MAXBITS 26 ++#else ++#define MAXBITS (LUAI_BITSINT-2) ++#endif ++ ++#define MAXASIZE (1 << MAXBITS) ++ ++ ++#define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t)))) ++ ++#define hashstr(t,str) hashpow2(t, (str)->tsv.hash) ++#define hashboolean(t,p) hashpow2(t, p) ++ ++ ++/* ++** for some types, it is better to avoid modulus by power of 2, as ++** they tend to have many 2 factors. ++*/ ++#define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1)))) ++ ++ ++#define hashpointer(t,p) hashmod(t, IntPoint(p)) ++ ++ ++/* ++** number of ints inside a lua_Number ++*/ ++#define numints cast_int(sizeof(lua_Number)/sizeof(int)) ++ ++ ++ ++#define dummynode (&dummynode_) ++ ++static const Node dummynode_ = { ++ {{NULL}, LUA_TNIL}, /* value */ ++ {{{NULL}, LUA_TNIL, NULL}} /* key */ ++}; ++ ++ ++/* ++** hash for lua_Numbers ++*/ ++static Node *hashnum (const Table *t, lua_Number n) { ++ unsigned int a[numints]; ++ int i; ++ if (luai_numeq(n, 0)) /* avoid problems with -0 */ ++ return gnode(t, 0); ++ memcpy(a, &n, sizeof(a)); ++ for (i = 1; i < numints; i++) a[0] += a[i]; ++ return hashmod(t, a[0]); ++} ++ ++ ++ ++/* ++** returns the `main' position of an element in a table (that is, the index ++** of its hash value) ++*/ ++static Node *mainposition (const Table *t, const TValue *key) { ++ switch (ttype(key)) { ++ case LUA_TNUMBER: ++ return hashnum(t, nvalue(key)); ++ case LUA_TSTRING: ++ return hashstr(t, rawtsvalue(key)); ++ case LUA_TBOOLEAN: ++ return hashboolean(t, bvalue(key)); ++ case LUA_TLIGHTUSERDATA: ++ return hashpointer(t, pvalue(key)); ++ default: ++ return hashpointer(t, gcvalue(key)); ++ } ++} ++ ++ ++/* ++** returns the index for `key' if `key' is an appropriate key to live in ++** the array part of the table, -1 otherwise. ++*/ ++static int arrayindex (const TValue *key) { ++ if (ttisnumber(key)) { ++ lua_Number n = nvalue(key); ++ int k; ++ lua_number2int(k, n); ++ if (luai_numeq(cast_num(k), n)) ++ return k; ++ } ++ return -1; /* `key' did not match some condition */ ++} ++ ++ ++/* ++** returns the index of a `key' for table traversals. First goes all ++** elements in the array part, then elements in the hash part. The ++** beginning of a traversal is signalled by -1. ++*/ ++static int findindex (lua_State *L, Table *t, StkId key) { ++ int i; ++ if (ttisnil(key)) return -1; /* first iteration */ ++ i = arrayindex(key); ++ if (0 < i && i <= t->sizearray) /* is `key' inside array part? */ ++ return i-1; /* yes; that's the index (corrected to C) */ ++ else { ++ Node *n = mainposition(t, key); ++ do { /* check whether `key' is somewhere in the chain */ ++ /* key may be dead already, but it is ok to use it in `next' */ ++ if (luaO_rawequalObj(key2tval(n), key) || ++ (ttype(gkey(n)) == LUA_TDEADKEY && iscollectable(key) && ++ gcvalue(gkey(n)) == gcvalue(key))) { ++ i = cast_int(n - gnode(t, 0)); /* key index in hash table */ ++ /* hash elements are numbered after array ones */ ++ return i + t->sizearray; ++ } ++ else n = gnext(n); ++ } while (n); ++ luaG_runerror(L, "invalid key to " LUA_QL("next")); /* key not found */ ++ return 0; /* to avoid warnings */ ++ } ++} ++ ++ ++int luaH_next (lua_State *L, Table *t, StkId key) { ++ int i = findindex(L, t, key); /* find original element */ ++ for (i++; i < t->sizearray; i++) { /* try first array part */ ++ if (!ttisnil(&t->array[i])) { /* a non-nil value? */ ++ setnvalue(key, cast_num(i+1)); ++ setobj2s(L, key+1, &t->array[i]); ++ return 1; ++ } ++ } ++ for (i -= t->sizearray; i < sizenode(t); i++) { /* then hash part */ ++ if (!ttisnil(gval(gnode(t, i)))) { /* a non-nil value? */ ++ setobj2s(L, key, key2tval(gnode(t, i))); ++ setobj2s(L, key+1, gval(gnode(t, i))); ++ return 1; ++ } ++ } ++ return 0; /* no more elements */ ++} ++ ++ ++/* ++** {============================================================= ++** Rehash ++** ============================================================== ++*/ ++ ++ ++static int computesizes (int nums[], int *narray) { ++ int i; ++ int twotoi; /* 2^i */ ++ int a = 0; /* number of elements smaller than 2^i */ ++ int na = 0; /* number of elements to go to array part */ ++ int n = 0; /* optimal size for array part */ ++ for (i = 0, twotoi = 1; twotoi/2 < *narray; i++, twotoi *= 2) { ++ if (nums[i] > 0) { ++ a += nums[i]; ++ if (a > twotoi/2) { /* more than half elements present? */ ++ n = twotoi; /* optimal size (till now) */ ++ na = a; /* all elements smaller than n will go to array part */ ++ } ++ } ++ if (a == *narray) break; /* all elements already counted */ ++ } ++ *narray = n; ++ lua_assert(*narray/2 <= na && na <= *narray); ++ return na; ++} ++ ++ ++static int countint (const TValue *key, int *nums) { ++ int k = arrayindex(key); ++ if (0 < k && k <= MAXASIZE) { /* is `key' an appropriate array index? */ ++ nums[ceillog2(k)]++; /* count as such */ ++ return 1; ++ } ++ else ++ return 0; ++} ++ ++ ++static int numusearray (const Table *t, int *nums) { ++ int lg; ++ int ttlg; /* 2^lg */ ++ int ause = 0; /* summation of `nums' */ ++ int i = 1; /* count to traverse all array keys */ ++ for (lg=0, ttlg=1; lg<=MAXBITS; lg++, ttlg*=2) { /* for each slice */ ++ int lc = 0; /* counter */ ++ int lim = ttlg; ++ if (lim > t->sizearray) { ++ lim = t->sizearray; /* adjust upper limit */ ++ if (i > lim) ++ break; /* no more elements to count */ ++ } ++ /* count elements in range (2^(lg-1), 2^lg] */ ++ for (; i <= lim; i++) { ++ if (!ttisnil(&t->array[i-1])) ++ lc++; ++ } ++ nums[lg] += lc; ++ ause += lc; ++ } ++ return ause; ++} ++ ++ ++static int numusehash (const Table *t, int *nums, int *pnasize) { ++ int totaluse = 0; /* total number of elements */ ++ int ause = 0; /* summation of `nums' */ ++ int i = sizenode(t); ++ while (i--) { ++ Node *n = &t->node[i]; ++ if (!ttisnil(gval(n))) { ++ ause += countint(key2tval(n), nums); ++ totaluse++; ++ } ++ } ++ *pnasize += ause; ++ return totaluse; ++} ++ ++ ++static void setarrayvector (lua_State *L, Table *t, int size) { ++ int i; ++ luaM_reallocvector(L, t->array, t->sizearray, size, TValue); ++ for (i=t->sizearray; iarray[i]); ++ t->sizearray = size; ++} ++ ++ ++static void setnodevector (lua_State *L, Table *t, int size) { ++ int lsize; ++ if (size == 0) { /* no elements to hash part? */ ++ t->node = cast(Node *, dummynode); /* use common `dummynode' */ ++ lsize = 0; ++ } ++ else { ++ int i; ++ lsize = ceillog2(size); ++ if (lsize > MAXBITS) ++ luaG_runerror(L, "table overflow"); ++ size = twoto(lsize); ++ t->node = luaM_newvector(L, size, Node); ++ for (i=0; ilsizenode = cast_byte(lsize); ++ t->lastfree = gnode(t, size); /* all positions are free */ ++} ++ ++ ++static void resize (lua_State *L, Table *t, int nasize, int nhsize) { ++ int i; ++ int oldasize = t->sizearray; ++ int oldhsize = t->lsizenode; ++ Node *nold = t->node; /* save old hash ... */ ++ if (nasize > oldasize) /* array part must grow? */ ++ setarrayvector(L, t, nasize); ++ /* create new hash part with appropriate size */ ++ setnodevector(L, t, nhsize); ++ if (nasize < oldasize) { /* array part must shrink? */ ++ t->sizearray = nasize; ++ /* re-insert elements from vanishing slice */ ++ for (i=nasize; iarray[i])) ++ setobjt2t(L, luaH_setnum(L, t, i+1), &t->array[i]); ++ } ++ /* shrink array */ ++ luaM_reallocvector(L, t->array, oldasize, nasize, TValue); ++ } ++ /* re-insert elements from hash part */ ++ for (i = twoto(oldhsize) - 1; i >= 0; i--) { ++ Node *old = nold+i; ++ if (!ttisnil(gval(old))) ++ setobjt2t(L, luaH_set(L, t, key2tval(old)), gval(old)); ++ } ++ if (nold != dummynode) ++ luaM_freearray(L, nold, twoto(oldhsize), Node); /* free old array */ ++} ++ ++ ++void luaH_resizearray (lua_State *L, Table *t, int nasize) { ++ int nsize = (t->node == dummynode) ? 0 : sizenode(t); ++ resize(L, t, nasize, nsize); ++} ++ ++ ++static void rehash (lua_State *L, Table *t, const TValue *ek) { ++ int nasize, na; ++ int nums[MAXBITS+1]; /* nums[i] = number of keys between 2^(i-1) and 2^i */ ++ int i; ++ int totaluse; ++ for (i=0; i<=MAXBITS; i++) nums[i] = 0; /* reset counts */ ++ nasize = numusearray(t, nums); /* count keys in array part */ ++ totaluse = nasize; /* all those keys are integer keys */ ++ totaluse += numusehash(t, nums, &nasize); /* count keys in hash part */ ++ /* count extra key */ ++ nasize += countint(ek, nums); ++ totaluse++; ++ /* compute new size for array part */ ++ na = computesizes(nums, &nasize); ++ /* resize the table to new computed sizes */ ++ resize(L, t, nasize, totaluse - na); ++} ++ ++ ++ ++/* ++** }============================================================= ++*/ ++ ++ ++Table *luaH_new (lua_State *L, int narray, int nhash) { ++ Table *t = luaM_new(L, Table); ++ luaC_link(L, obj2gco(t), LUA_TTABLE); ++ t->metatable = NULL; ++ t->flags = cast_byte(~0); ++ /* temporary values (kept only if some malloc fails) */ ++ t->array = NULL; ++ t->sizearray = 0; ++ t->lsizenode = 0; ++ t->node = cast(Node *, dummynode); ++ setarrayvector(L, t, narray); ++ setnodevector(L, t, nhash); ++ return t; ++} ++ ++ ++void luaH_free (lua_State *L, Table *t) { ++ if (t->node != dummynode) ++ luaM_freearray(L, t->node, sizenode(t), Node); ++ luaM_freearray(L, t->array, t->sizearray, TValue); ++ luaM_free(L, t); ++} ++ ++ ++static Node *getfreepos (Table *t) { ++ while (t->lastfree-- > t->node) { ++ if (ttisnil(gkey(t->lastfree))) ++ return t->lastfree; ++ } ++ return NULL; /* could not find a free place */ ++} ++ ++ ++ ++/* ++** inserts a new key into a hash table; first, check whether key's main ++** position is free. If not, check whether colliding node is in its main ++** position or not: if it is not, move colliding node to an empty place and ++** put new key in its main position; otherwise (colliding node is in its main ++** position), new key goes to an empty position. ++*/ ++static TValue *newkey (lua_State *L, Table *t, const TValue *key) { ++ Node *mp = mainposition(t, key); ++ if (!ttisnil(gval(mp)) || mp == dummynode) { ++ Node *othern; ++ Node *n = getfreepos(t); /* get a free place */ ++ if (n == NULL) { /* cannot find a free place? */ ++ rehash(L, t, key); /* grow table */ ++ return luaH_set(L, t, key); /* re-insert key into grown table */ ++ } ++ lua_assert(n != dummynode); ++ othern = mainposition(t, key2tval(mp)); ++ if (othern != mp) { /* is colliding node out of its main position? */ ++ /* yes; move colliding node into free position */ ++ while (gnext(othern) != mp) othern = gnext(othern); /* find previous */ ++ gnext(othern) = n; /* redo the chain with `n' in place of `mp' */ ++ *n = *mp; /* copy colliding node into free pos. (mp->next also goes) */ ++ gnext(mp) = NULL; /* now `mp' is free */ ++ setnilvalue(gval(mp)); ++ } ++ else { /* colliding node is in its own main position */ ++ /* new node will go into free position */ ++ gnext(n) = gnext(mp); /* chain new position */ ++ gnext(mp) = n; ++ mp = n; ++ } ++ } ++ gkey(mp)->value = key->value; gkey(mp)->tt = key->tt; ++ luaC_barriert(L, t, key); ++ lua_assert(ttisnil(gval(mp))); ++ return gval(mp); ++} ++ ++ ++/* ++** search function for integers ++*/ ++const TValue *luaH_getnum (Table *t, int key) { ++ /* (1 <= key && key <= t->sizearray) */ ++ if (cast(unsigned int, key-1) < cast(unsigned int, t->sizearray)) ++ return &t->array[key-1]; ++ else { ++ lua_Number nk = cast_num(key); ++ Node *n = hashnum(t, nk); ++ do { /* check whether `key' is somewhere in the chain */ ++ if (ttisnumber(gkey(n)) && luai_numeq(nvalue(gkey(n)), nk)) ++ return gval(n); /* that's it */ ++ else n = gnext(n); ++ } while (n); ++ return luaO_nilobject; ++ } ++} ++ ++ ++/* ++** search function for strings ++*/ ++const TValue *luaH_getstr (Table *t, TString *key) { ++ Node *n = hashstr(t, key); ++ do { /* check whether `key' is somewhere in the chain */ ++ if (ttisstring(gkey(n)) && rawtsvalue(gkey(n)) == key) ++ return gval(n); /* that's it */ ++ else n = gnext(n); ++ } while (n); ++ return luaO_nilobject; ++} ++ ++ ++/* ++** main search function ++*/ ++const TValue *luaH_get (Table *t, const TValue *key) { ++ switch (ttype(key)) { ++ case LUA_TNIL: return luaO_nilobject; ++ case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key)); ++ case LUA_TNUMBER: { ++ int k; ++ lua_Number n = nvalue(key); ++ lua_number2int(k, n); ++ if (luai_numeq(cast_num(k), nvalue(key))) /* index is int? */ ++ return luaH_getnum(t, k); /* use specialized version */ ++ /* else go through */ ++ } ++ default: { ++ Node *n = mainposition(t, key); ++ do { /* check whether `key' is somewhere in the chain */ ++ if (luaO_rawequalObj(key2tval(n), key)) ++ return gval(n); /* that's it */ ++ else n = gnext(n); ++ } while (n); ++ return luaO_nilobject; ++ } ++ } ++} ++ ++ ++TValue *luaH_set (lua_State *L, Table *t, const TValue *key) { ++ const TValue *p = luaH_get(t, key); ++ t->flags = 0; ++ if (p != luaO_nilobject) ++ return cast(TValue *, p); ++ else { ++ if (ttisnil(key)) luaG_runerror(L, "table index is nil"); ++ else if (ttisnumber(key) && luai_numisnan(nvalue(key))) ++ luaG_runerror(L, "table index is NaN"); ++ return newkey(L, t, key); ++ } ++} ++ ++ ++TValue *luaH_setnum (lua_State *L, Table *t, int key) { ++ const TValue *p = luaH_getnum(t, key); ++ if (p != luaO_nilobject) ++ return cast(TValue *, p); ++ else { ++ TValue k; ++ setnvalue(&k, cast_num(key)); ++ return newkey(L, t, &k); ++ } ++} ++ ++ ++TValue *luaH_setstr (lua_State *L, Table *t, TString *key) { ++ const TValue *p = luaH_getstr(t, key); ++ if (p != luaO_nilobject) ++ return cast(TValue *, p); ++ else { ++ TValue k; ++ setsvalue(L, &k, key); ++ return newkey(L, t, &k); ++ } ++} ++ ++ ++static int unbound_search (Table *t, unsigned int j) { ++ unsigned int i = j; /* i is zero or a present index */ ++ j++; ++ /* find `i' and `j' such that i is present and j is not */ ++ while (!ttisnil(luaH_getnum(t, j))) { ++ i = j; ++ j *= 2; ++ if (j > cast(unsigned int, MAX_INT)) { /* overflow? */ ++ /* table was built with bad purposes: resort to linear search */ ++ i = 1; ++ while (!ttisnil(luaH_getnum(t, i))) i++; ++ return i - 1; ++ } ++ } ++ /* now do a binary search between them */ ++ while (j - i > 1) { ++ unsigned int m = (i+j)/2; ++ if (ttisnil(luaH_getnum(t, m))) j = m; ++ else i = m; ++ } ++ return i; ++} ++ ++ ++/* ++** Try to find a boundary in table `t'. A `boundary' is an integer index ++** such that t[i] is non-nil and t[i+1] is nil (and 0 if t[1] is nil). ++*/ ++int luaH_getn (Table *t) { ++ unsigned int j = t->sizearray; ++ if (j > 0 && ttisnil(&t->array[j - 1])) { ++ /* there is a boundary in the array part: (binary) search for it */ ++ unsigned int i = 0; ++ while (j - i > 1) { ++ unsigned int m = (i+j)/2; ++ if (ttisnil(&t->array[m - 1])) j = m; ++ else i = m; ++ } ++ return i; ++ } ++ /* else must find a boundary in hash part */ ++ else if (t->node == dummynode) /* hash part is empty? */ ++ return j; /* that is easy... */ ++ else return unbound_search(t, j); ++} ++ ++ ++ ++#if defined(LUA_DEBUG) ++ ++Node *luaH_mainposition (const Table *t, const TValue *key) { ++ return mainposition(t, key); ++} ++ ++int luaH_isdummy (Node *n) { return n == dummynode; } ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/ltable.h +@@ -0,0 +1,40 @@ ++/* ++** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Lua tables (hash) ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef ltable_h ++#define ltable_h ++ ++#include "lobject.h" ++ ++ ++#define gnode(t,i) (&(t)->node[i]) ++#define gkey(n) (&(n)->i_key.nk) ++#define gval(n) (&(n)->i_val) ++#define gnext(n) ((n)->i_key.nk.next) ++ ++#define key2tval(n) (&(n)->i_key.tvk) ++ ++ ++LUAI_FUNC const TValue *luaH_getnum (Table *t, int key); ++LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key); ++LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); ++LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key); ++LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); ++LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); ++LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash); ++LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize); ++LUAI_FUNC void luaH_free (lua_State *L, Table *t); ++LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); ++LUAI_FUNC int luaH_getn (Table *t); ++ ++ ++#if defined(LUA_DEBUG) ++LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); ++LUAI_FUNC int luaH_isdummy (Node *n); ++#endif ++ ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/ltablib.c +@@ -0,0 +1,288 @@ ++/* ++** $Id: ltablib.c,v 1.38.1.3 2008/02/14 16:46:58 roberto Exp $ ++** Library for Table Manipulation ++** See Copyright Notice in lua.h ++*/ ++ ++ ++#include ++ ++#define ltablib_c ++#define LUA_LIB ++ ++#include "lua.h" ++ ++#include "lauxlib.h" ++#include "lualib.h" ++ ++ ++#define aux_getn(L,n) (luaL_checktype(L, n, LUA_TTABLE), luaL_getn(L, n)) ++ ++ ++static int foreachi (lua_State *L) { ++ int i; ++ int n = aux_getn(L, 1); ++ luaL_checktype(L, 2, LUA_TFUNCTION); ++ for (i=1; i <= n; i++) { ++ lua_pushvalue(L, 2); /* function */ ++ lua_pushinteger(L, i); /* 1st argument */ ++ lua_rawgeti(L, 1, i); /* 2nd argument */ ++ lua_call(L, 2, 1); ++ if (!lua_isnil(L, -1)) ++ return 1; ++ lua_pop(L, 1); /* remove nil result */ ++ } ++ return 0; ++} ++ ++ ++static int foreach (lua_State *L) { ++ luaL_checktype(L, 1, LUA_TTABLE); ++ luaL_checktype(L, 2, LUA_TFUNCTION); ++ lua_pushnil(L); /* first key */ ++ while (lua_next(L, 1)) { ++ lua_pushvalue(L, 2); /* function */ ++ lua_pushvalue(L, -3); /* key */ ++ lua_pushvalue(L, -3); /* value */ ++ lua_call(L, 2, 1); ++ if (!lua_isnil(L, -1)) ++ return 1; ++ lua_pop(L, 2); /* remove value and result */ ++ } ++ return 0; ++} ++ ++ ++static int maxn (lua_State *L) { ++ lua_Number max = 0; ++ luaL_checktype(L, 1, LUA_TTABLE); ++ lua_pushnil(L); /* first key */ ++ while (lua_next(L, 1)) { ++ lua_pop(L, 1); /* remove value */ ++ if (lua_type(L, -1) == LUA_TNUMBER) { ++ lua_Number v = lua_tonumber(L, -1); ++ if (v > max) max = v; ++ } ++ } ++ lua_pushnumber(L, max); ++ return 1; ++} ++ ++ ++static int getn (lua_State *L) { ++ lua_pushinteger(L, aux_getn(L, 1)); ++ return 1; ++} ++ ++ ++static int setn (lua_State *L) { ++ luaL_checktype(L, 1, LUA_TTABLE); ++#ifndef luaL_setn ++ luaL_setn(L, 1, luaL_checkint(L, 2)); ++#else ++ luaL_error(L, LUA_QL("setn") " is obsolete"); ++#endif ++ lua_pushvalue(L, 1); ++ return 1; ++} ++ ++ ++static int tinsert (lua_State *L) { ++ int e = aux_getn(L, 1) + 1; /* first empty element */ ++ int pos; /* where to insert new element */ ++ switch (lua_gettop(L)) { ++ case 2: { /* called with only 2 arguments */ ++ pos = e; /* insert new element at the end */ ++ break; ++ } ++ case 3: { ++ int i; ++ pos = luaL_checkint(L, 2); /* 2nd argument is the position */ ++ if (pos > e) e = pos; /* `grow' array if necessary */ ++ for (i = e; i > pos; i--) { /* move up elements */ ++ lua_rawgeti(L, 1, i-1); ++ lua_rawseti(L, 1, i); /* t[i] = t[i-1] */ ++ } ++ break; ++ } ++ default: { ++ return luaL_error(L, "wrong number of arguments to " LUA_QL("insert")); ++ } ++ } ++ luaL_setn(L, 1, e); /* new size */ ++ lua_rawseti(L, 1, pos); /* t[pos] = v */ ++ return 0; ++} ++ ++ ++static int tremove (lua_State *L) { ++ int e = aux_getn(L, 1); ++ int pos = luaL_optint(L, 2, e); ++ if (!(1 <= pos && pos <= e)) /* position is outside bounds? */ ++ return 0; /* nothing to remove */ ++ luaL_setn(L, 1, e - 1); /* t.n = n-1 */ ++ lua_rawgeti(L, 1, pos); /* result = t[pos] */ ++ for ( ;pos= P */ ++ while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) { ++ if (i>u) luaL_error(L, "invalid order function for sorting"); ++ lua_pop(L, 1); /* remove a[i] */ ++ } ++ /* repeat --j until a[j] <= P */ ++ while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) { ++ if (j ++ ++#define ltm_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "lobject.h" ++#include "lstate.h" ++#include "lstring.h" ++#include "ltable.h" ++#include "ltm.h" ++ ++ ++ ++const char *const luaT_typenames[] = { ++ "nil", "boolean", "userdata", "number", ++ "string", "table", "function", "userdata", "thread", ++ "proto", "upval" ++}; ++ ++ ++void luaT_init (lua_State *L) { ++ static const char *const luaT_eventname[] = { /* ORDER TM */ ++ "__index", "__newindex", ++ "__gc", "__mode", "__eq", ++ "__add", "__sub", "__mul", "__div", "__mod", ++ "__pow", "__unm", "__len", "__lt", "__le", ++ "__concat", "__call" ++ }; ++ int i; ++ for (i=0; itmname[i] = luaS_new(L, luaT_eventname[i]); ++ luaS_fix(G(L)->tmname[i]); /* never collect these names */ ++ } ++} ++ ++ ++/* ++** function to be used with macro "fasttm": optimized for absence of ++** tag methods ++*/ ++const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { ++ const TValue *tm = luaH_getstr(events, ename); ++ lua_assert(event <= TM_EQ); ++ if (ttisnil(tm)) { /* no tag method? */ ++ events->flags |= cast_byte(1u<metatable; ++ break; ++ case LUA_TUSERDATA: ++ mt = uvalue(o)->metatable; ++ break; ++ default: ++ mt = G(L)->mt[ttype(o)]; ++ } ++ return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); ++} ++ +--- /dev/null ++++ b/extensions/LUA/lua/ltm.h +@@ -0,0 +1,54 @@ ++/* ++** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Tag methods ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef ltm_h ++#define ltm_h ++ ++ ++#include "lobject.h" ++ ++ ++/* ++* WARNING: if you change the order of this enumeration, ++* grep "ORDER TM" ++*/ ++typedef enum { ++ TM_INDEX, ++ TM_NEWINDEX, ++ TM_GC, ++ TM_MODE, ++ TM_EQ, /* last tag method with `fast' access */ ++ TM_ADD, ++ TM_SUB, ++ TM_MUL, ++ TM_DIV, ++ TM_MOD, ++ TM_POW, ++ TM_UNM, ++ TM_LEN, ++ TM_LT, ++ TM_LE, ++ TM_CONCAT, ++ TM_CALL, ++ TM_N /* number of elements in the enum */ ++} TMS; ++ ++ ++ ++#define gfasttm(g,et,e) ((et) == NULL ? NULL : \ ++ ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) ++ ++#define fasttm(l,et,e) gfasttm(G(l), et, e) ++ ++LUAI_DATA const char *const luaT_typenames[]; ++ ++ ++LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); ++LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, ++ TMS event); ++LUAI_FUNC void luaT_init (lua_State *L); ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/luaconf.h +@@ -0,0 +1,797 @@ ++/* ++** $Id: luaconf.h,v 1.82.1.7 2008/02/11 16:25:08 roberto Exp $ ++** Configuration file for Lua ++** See Copyright Notice in lua.h ++*/ ++ ++ ++#ifndef lconfig_h ++#define lconfig_h ++ ++#include ++ ++#if !defined(__KERNEL__) ++#include ++#else ++#define UCHAR_MAX 255 ++#define SHRT_MAX 32767 ++#define BUFSIZ 8192 ++#define NO_FPU ++#endif ++ ++/* ++** ================================================================== ++** Search for "@@" to find all configurable definitions. ++** =================================================================== ++*/ ++ ++ ++/* ++@@ LUA_ANSI controls the use of non-ansi features. ++** CHANGE it (define it) if you want Lua to avoid the use of any ++** non-ansi feature or library. ++*/ ++#if defined(__STRICT_ANSI__) ++#define LUA_ANSI ++#endif ++ ++ ++#if !defined(LUA_ANSI) && defined(_WIN32) ++#define LUA_WIN ++#endif ++ ++#if defined(LUA_USE_LINUX) ++#define LUA_USE_POSIX ++#define LUA_USE_DLOPEN /* needs an extra library: -ldl */ ++#define LUA_USE_READLINE /* needs some extra libraries */ ++#endif ++ ++#if defined(LUA_USE_MACOSX) ++#define LUA_USE_POSIX ++#define LUA_DL_DYLD /* does not need extra library */ ++#endif ++ ++ ++ ++/* ++@@ LUA_USE_POSIX includes all functionallity listed as X/Open System ++@* Interfaces Extension (XSI). ++** CHANGE it (define it) if your system is XSI compatible. ++*/ ++#if defined(LUA_USE_POSIX) ++#define LUA_USE_MKSTEMP ++#define LUA_USE_ISATTY ++#define LUA_USE_POPEN ++#define LUA_USE_ULONGJMP ++#endif ++ ++ ++/* ++@@ LUA_PATH and LUA_CPATH are the names of the environment variables that ++@* Lua check to set its paths. ++@@ LUA_INIT is the name of the environment variable that Lua ++@* checks for initialization code. ++** CHANGE them if you want different names. ++*/ ++#define LUA_PATH "LUA_PATH" ++#define LUA_CPATH "LUA_CPATH" ++#define LUA_INIT "LUA_INIT" ++ ++ ++/* ++@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for ++@* Lua libraries. ++@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for ++@* C libraries. ++** CHANGE them if your machine has a non-conventional directory ++** hierarchy or if you want to install your libraries in ++** non-conventional directories. ++*/ ++#if defined(_WIN32) ++/* ++** In Windows, any exclamation mark ('!') in the path is replaced by the ++** path of the directory of the executable file of the current process. ++*/ ++#define LUA_LDIR "!\\lua\\" ++#define LUA_CDIR "!\\" ++#define LUA_PATH_DEFAULT \ ++ ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ ++ LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua" ++#define LUA_CPATH_DEFAULT \ ++ ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" ++ ++#else ++#define LUA_ROOT "/usr/local/" ++#define LUA_LDIR LUA_ROOT "share/lua/5.1/" ++#define LUA_CDIR LUA_ROOT "lib/lua/5.1/" ++#define LUA_PATH_DEFAULT \ ++ "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ ++ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua" ++#define LUA_CPATH_DEFAULT \ ++ "./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so" ++#endif ++ ++ ++/* ++@@ LUA_DIRSEP is the directory separator (for submodules). ++** CHANGE it if your machine does not use "/" as the directory separator ++** and is not Windows. (On Windows Lua automatically uses "\".) ++*/ ++#if defined(_WIN32) ++#define LUA_DIRSEP "\\" ++#else ++#define LUA_DIRSEP "/" ++#endif ++ ++ ++/* ++@@ LUA_PATHSEP is the character that separates templates in a path. ++@@ LUA_PATH_MARK is the string that marks the substitution points in a ++@* template. ++@@ LUA_EXECDIR in a Windows path is replaced by the executable's ++@* directory. ++@@ LUA_IGMARK is a mark to ignore all before it when bulding the ++@* luaopen_ function name. ++** CHANGE them if for some reason your system cannot use those ++** characters. (E.g., if one of those characters is a common character ++** in file/directory names.) Probably you do not need to change them. ++*/ ++#define LUA_PATHSEP ";" ++#define LUA_PATH_MARK "?" ++#define LUA_EXECDIR "!" ++#define LUA_IGMARK "-" ++ ++ ++/* ++@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger. ++** CHANGE that if ptrdiff_t is not adequate on your machine. (On most ++** machines, ptrdiff_t gives a good choice between int or long.) ++*/ ++#define LUA_INTEGER ptrdiff_t ++ ++ ++/* ++@@ LUA_API is a mark for all core API functions. ++@@ LUALIB_API is a mark for all standard library functions. ++** CHANGE them if you need to define those functions in some special way. ++** For instance, if you want to create one Windows DLL with the core and ++** the libraries, you may want to use the following definition (define ++** LUA_BUILD_AS_DLL to get it). ++*/ ++#if defined(LUA_BUILD_AS_DLL) ++ ++#if defined(LUA_CORE) || defined(LUA_LIB) ++#define LUA_API __declspec(dllexport) ++#else ++#define LUA_API __declspec(dllimport) ++#endif ++ ++#else ++ ++#define LUA_API extern ++ ++#endif ++ ++/* more often than not the libs go together with the core */ ++#define LUALIB_API LUA_API ++ ++ ++/* ++@@ LUAI_FUNC is a mark for all extern functions that are not to be ++@* exported to outside modules. ++@@ LUAI_DATA is a mark for all extern (const) variables that are not to ++@* be exported to outside modules. ++** CHANGE them if you need to mark them in some special way. Elf/gcc ++** (versions 3.2 and later) mark them as "hidden" to optimize access ++** when Lua is compiled as a shared library. ++*/ ++#if defined(luaall_c) ++#define LUAI_FUNC static ++#define LUAI_DATA /* empty */ ++ ++#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ ++ defined(__ELF__) ++#define LUAI_FUNC __attribute__((visibility("hidden"))) extern ++#define LUAI_DATA LUAI_FUNC ++ ++#else ++#define LUAI_FUNC extern ++#define LUAI_DATA extern ++#endif ++ ++ ++ ++/* ++@@ LUA_QL describes how error messages quote program elements. ++** CHANGE it if you want a different appearance. ++*/ ++#define LUA_QL(x) "'" x "'" ++#define LUA_QS LUA_QL("%s") ++ ++ ++/* ++@@ LUA_IDSIZE gives the maximum size for the description of the source ++@* of a function in debug information. ++** CHANGE it if you want a different size. ++*/ ++#define LUA_IDSIZE 60 ++ ++ ++/* ++** {================================================================== ++** Stand-alone configuration ++** =================================================================== ++*/ ++ ++#if defined(lua_c) || defined(luaall_c) ++ ++/* ++@@ lua_stdin_is_tty detects whether the standard input is a 'tty' (that ++@* is, whether we're running lua interactively). ++** CHANGE it if you have a better definition for non-POSIX/non-Windows ++** systems. ++*/ ++#if defined(LUA_USE_ISATTY) ++#include ++#define lua_stdin_is_tty() isatty(0) ++#elif defined(LUA_WIN) ++#include ++#include ++#define lua_stdin_is_tty() _isatty(_fileno(stdin)) ++#else ++#define lua_stdin_is_tty() 1 /* assume stdin is a tty */ ++#endif ++ ++ ++/* ++@@ LUA_PROMPT is the default prompt used by stand-alone Lua. ++@@ LUA_PROMPT2 is the default continuation prompt used by stand-alone Lua. ++** CHANGE them if you want different prompts. (You can also change the ++** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.) ++*/ ++#define LUA_PROMPT "> " ++#define LUA_PROMPT2 ">> " ++ ++ ++/* ++@@ LUA_PROGNAME is the default name for the stand-alone Lua program. ++** CHANGE it if your stand-alone interpreter has a different name and ++** your system is not able to detect that name automatically. ++*/ ++#define LUA_PROGNAME "lua" ++ ++ ++/* ++@@ LUA_MAXINPUT is the maximum length for an input line in the ++@* stand-alone interpreter. ++** CHANGE it if you need longer lines. ++*/ ++#define LUA_MAXINPUT 512 ++ ++ ++/* ++@@ lua_readline defines how to show a prompt and then read a line from ++@* the standard input. ++@@ lua_saveline defines how to "save" a read line in a "history". ++@@ lua_freeline defines how to free a line read by lua_readline. ++** CHANGE them if you want to improve this functionality (e.g., by using ++** GNU readline and history facilities). ++*/ ++#if defined(LUA_USE_READLINE) ++#include ++#include ++#include ++#define lua_readline(L,b,p) ((void)L, ((b)=readline(p)) != NULL) ++#define lua_saveline(L,idx) \ ++ if (lua_strlen(L,idx) > 0) /* non-empty line? */ \ ++ add_history(lua_tostring(L, idx)); /* add it to history */ ++#define lua_freeline(L,b) ((void)L, free(b)) ++#else ++#define lua_readline(L,b,p) \ ++ ((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \ ++ fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */ ++#define lua_saveline(L,idx) { (void)L; (void)idx; } ++#define lua_freeline(L,b) { (void)L; (void)b; } ++#endif ++ ++#endif ++ ++/* }================================================================== */ ++ ++ ++/* ++@@ LUAI_GCPAUSE defines the default pause between garbage-collector cycles ++@* as a percentage. ++** CHANGE it if you want the GC to run faster or slower (higher values ++** mean larger pauses which mean slower collection.) You can also change ++** this value dynamically. ++*/ ++#define LUAI_GCPAUSE 200 /* 200% (wait memory to double before next GC) */ ++ ++ ++/* ++@@ LUAI_GCMUL defines the default speed of garbage collection relative to ++@* memory allocation as a percentage. ++** CHANGE it if you want to change the granularity of the garbage ++** collection. (Higher values mean coarser collections. 0 represents ++** infinity, where each step performs a full collection.) You can also ++** change this value dynamically. ++*/ ++#define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */ ++ ++ ++ ++/* ++@@ LUA_COMPAT_GETN controls compatibility with old getn behavior. ++** CHANGE it (define it) if you want exact compatibility with the ++** behavior of setn/getn in Lua 5.0. ++*/ ++#undef LUA_COMPAT_GETN ++ ++/* ++@@ LUA_COMPAT_LOADLIB controls compatibility about global loadlib. ++** CHANGE it to undefined as soon as you do not need a global 'loadlib' ++** function (the function is still available as 'package.loadlib'). ++*/ ++#undef LUA_COMPAT_LOADLIB ++ ++/* ++@@ LUA_COMPAT_VARARG controls compatibility with old vararg feature. ++** CHANGE it to undefined as soon as your programs use only '...' to ++** access vararg parameters (instead of the old 'arg' table). ++*/ ++#define LUA_COMPAT_VARARG ++ ++/* ++@@ LUA_COMPAT_MOD controls compatibility with old math.mod function. ++** CHANGE it to undefined as soon as your programs use 'math.fmod' or ++** the new '%' operator instead of 'math.mod'. ++*/ ++#define LUA_COMPAT_MOD ++ ++/* ++@@ LUA_COMPAT_LSTR controls compatibility with old long string nesting ++@* facility. ++** CHANGE it to 2 if you want the old behaviour, or undefine it to turn ++** off the advisory error when nesting [[...]]. ++*/ ++#define LUA_COMPAT_LSTR 1 ++ ++/* ++@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name. ++** CHANGE it to undefined as soon as you rename 'string.gfind' to ++** 'string.gmatch'. ++*/ ++#define LUA_COMPAT_GFIND ++ ++/* ++@@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib' ++@* behavior. ++** CHANGE it to undefined as soon as you replace to 'luaL_register' ++** your uses of 'luaL_openlib' ++*/ ++#define LUA_COMPAT_OPENLIB ++ ++ ++ ++/* ++@@ luai_apicheck is the assert macro used by the Lua-C API. ++** CHANGE luai_apicheck if you want Lua to perform some checks in the ++** parameters it gets from API calls. This may slow down the interpreter ++** a bit, but may be quite useful when debugging C code that interfaces ++** with Lua. A useful redefinition is to use assert.h. ++*/ ++#if defined(LUA_USE_APICHECK) ++#include ++#define luai_apicheck(L,o) { (void)L; assert(o); } ++#else ++#define luai_apicheck(L,o) { (void)L; } ++#endif ++ ++ ++/* ++@@ LUAI_BITSINT defines the number of bits in an int. ++** CHANGE here if Lua cannot automatically detect the number of bits of ++** your machine. Probably you do not need to change this. ++*/ ++/* avoid overflows in comparison */ ++#if !defined(__KERNEL__) ++#include ++#define LUA_INT_MAX INT_MAX ++#else ++#define LUA_INT_MAX (~0U>>1) ++#endif ++ ++#if LUA_INT_MAX-20 < 32760 ++#define LUAI_BITSINT 16 ++#elif LUA_INT_MAX > 2147483640L ++/* int has at least 32 bits */ ++#define LUAI_BITSINT 32 ++#else ++#error "you must define LUA_BITSINT with number of bits in an integer" ++#endif ++ ++ ++/* ++@@ LUAI_UINT32 is an unsigned integer with at least 32 bits. ++@@ LUAI_INT32 is an signed integer with at least 32 bits. ++@@ LUAI_UMEM is an unsigned integer big enough to count the total ++@* memory used by Lua. ++@@ LUAI_MEM is a signed integer big enough to count the total memory ++@* used by Lua. ++** CHANGE here if for some weird reason the default definitions are not ++** good enough for your machine. (The definitions in the 'else' ++** part always works, but may waste space on machines with 64-bit ++** longs.) Probably you do not need to change this. ++*/ ++#if LUAI_BITSINT >= 32 ++#define LUAI_UINT32 unsigned int ++#define LUAI_INT32 int ++#define LUAI_MAXINT32 INT_MAX ++#define LUAI_UMEM size_t ++#define LUAI_MEM ptrdiff_t ++#else ++/* 16-bit ints */ ++#define LUAI_UINT32 unsigned long ++#define LUAI_INT32 long ++#define LUAI_MAXINT32 LONG_MAX ++#define LUAI_UMEM unsigned long ++#define LUAI_MEM long ++#endif ++ ++ ++/* ++@@ LUAI_MAXCALLS limits the number of nested calls. ++** CHANGE it if you need really deep recursive calls. This limit is ++** arbitrary; its only purpose is to stop infinite recursion before ++** exhausting memory. ++*/ ++#define LUAI_MAXCALLS 20000 ++ ++ ++/* ++@@ LUAI_MAXCSTACK limits the number of Lua stack slots that a C function ++@* can use. ++** CHANGE it if you need lots of (Lua) stack space for your C ++** functions. This limit is arbitrary; its only purpose is to stop C ++** functions to consume unlimited stack space. (must be smaller than ++** -LUA_REGISTRYINDEX) ++*/ ++#define LUAI_MAXCSTACK 8000 ++ ++ ++ ++/* ++** {================================================================== ++** CHANGE (to smaller values) the following definitions if your system ++** has a small C stack. (Or you may want to change them to larger ++** values if your system has a large C stack and these limits are ++** too rigid for you.) Some of these constants control the size of ++** stack-allocated arrays used by the compiler or the interpreter, while ++** others limit the maximum number of recursive calls that the compiler ++** or the interpreter can perform. Values too large may cause a C stack ++** overflow for some forms of deep constructs. ++** =================================================================== ++*/ ++ ++ ++/* ++@@ LUAI_MAXCCALLS is the maximum depth for nested C calls (short) and ++@* syntactical nested non-terminals in a program. ++*/ ++#define LUAI_MAXCCALLS 200 ++ ++ ++/* ++@@ LUAI_MAXVARS is the maximum number of local variables per function ++@* (must be smaller than 250). ++*/ ++#define LUAI_MAXVARS 200 ++ ++ ++/* ++@@ LUAI_MAXUPVALUES is the maximum number of upvalues per function ++@* (must be smaller than 250). ++*/ ++#define LUAI_MAXUPVALUES 60 ++ ++ ++/* ++@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. ++*/ ++#define LUAL_BUFFERSIZE BUFSIZ ++ ++/* }================================================================== */ ++ ++ ++ ++ ++/* ++** {================================================================== ++@@ LUA_NUMBER is the type of numbers in Lua. ++** CHANGE the following definitions only if you want to build Lua ++** with a number type different from double. You may also need to ++** change lua_number2int & lua_number2integer. ++** =================================================================== ++*/ ++#if !defined(NO_FPU) ++#define LUA_NUMBER_DOUBLE ++#define LUA_NUMBER double ++#else ++#define LUA_NUMBER long ++#endif ++ ++/* ++@@ LUAI_UACNUMBER is the result of an 'usual argument conversion' ++@* over a number. ++*/ ++#define LUAI_UACNUMBER LUA_NUMBER ++ ++ ++/* ++@@ LUA_NUMBER_SCAN is the format for reading numbers. ++@@ LUA_NUMBER_FMT is the format for writing numbers. ++@@ lua_number2str converts a number to a string. ++@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion. ++@@ lua_str2number converts a string to a number. ++*/ ++#if !defined(NO_FPU) ++#define LUA_NUMBER_SCAN "%lf" ++#define LUA_NUMBER_FMT "%.14g" ++#define lua_str2number(s,p) strtod((s), (p)) ++#else ++#define LUA_NUMBER_SCAN "%ld" ++#define LUA_NUMBER_FMT "%ld" ++#if !defined(__KERNEL__) ++#define lua_str2number(s,p) strtol((s), (p), 10) ++#else ++#define lua_str2number(s,p) simple_strtol((s), (p), 10) ++#endif ++#endif ++ ++#define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */ ++#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) ++ ++/* ++@@ The luai_num* macros define the primitive operations over numbers. ++*/ ++#if defined(LUA_CORE) ++#define luai_numadd(a,b) ((a)+(b)) ++#define luai_numsub(a,b) ((a)-(b)) ++#define luai_nummul(a,b) ((a)*(b)) ++#define luai_numdiv(a,b) ((a)/(b)) ++#define luai_numunm(a) (-(a)) ++#define luai_numeq(a,b) ((a)==(b)) ++#define luai_numlt(a,b) ((a)<(b)) ++#define luai_numle(a,b) ((a)<=(b)) ++#define luai_numisnan(a) (!luai_numeq((a), (a))) ++#if !defined(NO_FPU) ++#include ++#define luai_nummod(a,b) ((a) - floor((a)/(b))*(b)) ++#define luai_numpow(a,b) (pow(a,b)) ++#else ++#define luai_nummod(a,b) ((a)%(b)) ++#define luai_numpow(a,b) luai_nummul(a,b) ++#endif ++#endif ++ ++ ++/* ++@@ lua_number2int is a macro to convert lua_Number to int. ++@@ lua_number2integer is a macro to convert lua_Number to lua_Integer. ++** CHANGE them if you know a faster way to convert a lua_Number to ++** int (with any rounding method and without throwing errors) in your ++** system. In Pentium machines, a naive typecast from double to int ++** in C is extremely slow, so any alternative is worth trying. ++*/ ++ ++/* On a Pentium, resort to a trick */ ++#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \ ++ (defined(__i386) || defined (_M_IX86) || defined(__i386__)) ++ ++/* On a Microsoft compiler, use assembler */ ++#if defined(_MSC_VER) ++ ++#define lua_number2int(i,d) __asm fld d __asm fistp i ++#define lua_number2integer(i,n) lua_number2int(i, n) ++ ++/* the next trick should work on any Pentium, but sometimes clashes ++ with a DirectX idiosyncrasy */ ++#else ++ ++union luai_Cast { double l_d; long l_l; }; ++#define lua_number2int(i,d) \ ++ { volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; } ++#define lua_number2integer(i,n) lua_number2int(i, n) ++ ++#endif ++ ++ ++/* this option always works, but may be slow */ ++#else ++#define lua_number2int(i,d) ((i)=(int)(d)) ++#define lua_number2integer(i,d) ((i)=(lua_Integer)(d)) ++ ++#endif ++ ++/* }================================================================== */ ++ ++ ++/* ++@@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment. ++** CHANGE it if your system requires alignments larger than double. (For ++** instance, if your system supports long doubles and they must be ++** aligned in 16-byte boundaries, then you should add long double in the ++** union.) Probably you do not need to change this. ++*/ ++#define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; } ++ ++ ++/* ++@@ LUAI_THROW/LUAI_TRY define how Lua does exception handling. ++** CHANGE them if you prefer to use longjmp/setjmp even with C++ ++** or if want/don't to use _longjmp/_setjmp instead of regular ++** longjmp/setjmp. By default, Lua handles errors with exceptions when ++** compiling as C++ code, with _longjmp/_setjmp when asked to use them, ++** and with longjmp/setjmp otherwise. ++*/ ++#if defined(__KERNEL__) ++#undef LUA_USE_ULONGJMP ++#endif ++ ++#if defined(__cplusplus) ++/* C++ exceptions */ ++#define LUAI_THROW(L,c) throw(c) ++#define LUAI_TRY(L,c,a) try { a } catch(...) \ ++ { if ((c)->status == 0) (c)->status = -1; } ++#define luai_jmpbuf int /* dummy variable */ ++ ++#elif defined(LUA_USE_ULONGJMP) ++/* in Unix, try _longjmp/_setjmp (more efficient) */ ++#define LUAI_THROW(L,c) _longjmp((c)->b, 1) ++#define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a } ++#define luai_jmpbuf jmp_buf ++ ++#else ++/* default handling with long jumps */ ++#define LUAI_THROW(L,c) longjmp((c)->b, 1) ++#define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a } ++#define luai_jmpbuf jmp_buf ++ ++#endif ++ ++ ++/* ++@@ LUA_MAXCAPTURES is the maximum number of captures that a pattern ++@* can do during pattern-matching. ++** CHANGE it if you need more captures. This limit is arbitrary. ++*/ ++#define LUA_MAXCAPTURES 32 ++ ++ ++/* ++@@ lua_tmpnam is the function that the OS library uses to create a ++@* temporary name. ++@@ LUA_TMPNAMBUFSIZE is the maximum size of a name created by lua_tmpnam. ++** CHANGE them if you have an alternative to tmpnam (which is considered ++** insecure) or if you want the original tmpnam anyway. By default, Lua ++** uses tmpnam except when POSIX is available, where it uses mkstemp. ++*/ ++#if defined(loslib_c) || defined(luaall_c) ++ ++#if defined(LUA_USE_MKSTEMP) ++#include ++#define LUA_TMPNAMBUFSIZE 32 ++#define lua_tmpnam(b,e) { \ ++ strcpy(b, "/tmp/lua_XXXXXX"); \ ++ e = mkstemp(b); \ ++ if (e != -1) close(e); \ ++ e = (e == -1); } ++ ++#else ++#define LUA_TMPNAMBUFSIZE L_tmpnam ++#define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } ++#endif ++ ++#endif ++ ++ ++/* ++@@ lua_popen spawns a new process connected to the current one through ++@* the file streams. ++** CHANGE it if you have a way to implement it in your system. ++*/ ++#if defined(LUA_USE_POPEN) ++ ++#define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m)) ++#define lua_pclose(L,file) ((void)L, (pclose(file) != -1)) ++ ++#elif defined(LUA_WIN) ++ ++#define lua_popen(L,c,m) ((void)L, _popen(c,m)) ++#define lua_pclose(L,file) ((void)L, (_pclose(file) != -1)) ++ ++#else ++ ++#define lua_popen(L,c,m) ((void)((void)c, m), \ ++ luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0) ++#define lua_pclose(L,file) ((void)((void)L, file), 0) ++ ++#endif ++ ++/* ++@@ LUA_DL_* define which dynamic-library system Lua should use. ++** CHANGE here if Lua has problems choosing the appropriate ++** dynamic-library system for your platform (either Windows' DLL, Mac's ++** dyld, or Unix's dlopen). If your system is some kind of Unix, there ++** is a good chance that it has dlopen, so LUA_DL_DLOPEN will work for ++** it. To use dlopen you also need to adapt the src/Makefile (probably ++** adding -ldl to the linker options), so Lua does not select it ++** automatically. (When you change the makefile to add -ldl, you must ++** also add -DLUA_USE_DLOPEN.) ++** If you do not want any kind of dynamic library, undefine all these ++** options. ++** By default, _WIN32 gets LUA_DL_DLL and MAC OS X gets LUA_DL_DYLD. ++*/ ++#if defined(LUA_USE_DLOPEN) ++#define LUA_DL_DLOPEN ++#endif ++ ++#if defined(LUA_WIN) ++#define LUA_DL_DLL ++#endif ++ ++ ++/* ++@@ LUAI_EXTRASPACE allows you to add user-specific data in a lua_State ++@* (the data goes just *before* the lua_State pointer). ++** CHANGE (define) this if you really need that. This value must be ++** a multiple of the maximum alignment required for your machine. ++*/ ++#define LUAI_EXTRASPACE 0 ++ ++ ++/* ++@@ luai_userstate* allow user-specific actions on threads. ++** CHANGE them if you defined LUAI_EXTRASPACE and need to do something ++** extra when a thread is created/deleted/resumed/yielded. ++*/ ++#define luai_userstateopen(L) ((void)L) ++#define luai_userstateclose(L) ((void)L) ++#define luai_userstatethread(L,L1) ((void)L) ++#define luai_userstatefree(L) ((void)L) ++#define luai_userstateresume(L,n) ((void)L) ++#define luai_userstateyield(L,n) ((void)L) ++ ++ ++/* ++@@ LUA_INTFRMLEN is the length modifier for integer conversions ++@* in 'string.format'. ++@@ LUA_INTFRM_T is the integer type correspoding to the previous length ++@* modifier. ++** CHANGE them if your system supports long long or does not support long. ++*/ ++ ++#if defined(LUA_USELONGLONG) ++ ++#define LUA_INTFRMLEN "ll" ++#define LUA_INTFRM_T long long ++ ++#else ++ ++#define LUA_INTFRMLEN "l" ++#define LUA_INTFRM_T long ++ ++#endif ++ ++/* =================================================================== */ ++ ++/* ++** Local configuration. You can use this space to add your redefinitions ++** without modifying the main part of the file. ++*/ ++ ++ ++ ++#endif ++ +--- /dev/null ++++ b/extensions/LUA/lua/lua.h +@@ -0,0 +1,387 @@ ++/* ++** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $ ++** Lua - An Extensible Extension Language ++** Lua.org, PUC-Rio, Brazil (http://www.lua.org) ++** See Copyright Notice at the end of this file ++*/ ++ ++ ++#ifndef lua_h ++#define lua_h ++ ++#include ++#include ++ ++#include "luaconf.h" ++ ++ ++#define LUA_VERSION "Lua 5.1" ++#define LUA_RELEASE "Lua 5.1.4" ++#define LUA_VERSION_NUM 501 ++#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio" ++#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" ++ ++ ++/* mark for precompiled code (`Lua') */ ++#define LUA_SIGNATURE "\033Lua" ++ ++/* option for multiple returns in `lua_pcall' and `lua_call' */ ++#define LUA_MULTRET (-1) ++ ++ ++/* ++** pseudo-indices ++*/ ++#define LUA_REGISTRYINDEX (-10000) ++#define LUA_ENVIRONINDEX (-10001) ++#define LUA_GLOBALSINDEX (-10002) ++#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i)) ++ ++ ++/* thread status; 0 is OK */ ++#define LUA_YIELD 1 ++#define LUA_ERRRUN 2 ++#define LUA_ERRSYNTAX 3 ++#define LUA_ERRMEM 4 ++#define LUA_ERRERR 5 ++ ++ ++typedef struct lua_State lua_State; ++ ++typedef int (*lua_CFunction) (lua_State *L); ++ ++ ++/* ++** functions that read/write blocks when loading/dumping Lua chunks ++*/ ++typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz); ++ ++typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud); ++ ++ ++/* ++** prototype for memory-allocation functions ++*/ ++typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); ++ ++ ++/* ++** basic types ++*/ ++#define LUA_TNONE (-1) ++ ++#define LUA_TNIL 0 ++#define LUA_TBOOLEAN 1 ++#define LUA_TLIGHTUSERDATA 2 ++#define LUA_TNUMBER 3 ++#define LUA_TSTRING 4 ++#define LUA_TTABLE 5 ++#define LUA_TFUNCTION 6 ++#define LUA_TUSERDATA 7 ++#define LUA_TTHREAD 8 ++ ++ ++ ++/* minimum Lua stack available to a C function */ ++#define LUA_MINSTACK 20 ++ ++ ++/* ++** generic extra include file ++*/ ++#if defined(LUA_USER_H) ++#include LUA_USER_H ++#endif ++ ++ ++/* type of numbers in Lua */ ++typedef LUA_NUMBER lua_Number; ++ ++ ++/* type for integer functions */ ++typedef LUA_INTEGER lua_Integer; ++ ++ ++ ++/* ++** state manipulation ++*/ ++LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud); ++LUA_API void (lua_close) (lua_State *L); ++LUA_API lua_State *(lua_newthread) (lua_State *L); ++ ++LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); ++ ++ ++/* ++** basic stack manipulation ++*/ ++LUA_API int (lua_gettop) (lua_State *L); ++LUA_API void (lua_settop) (lua_State *L, int idx); ++LUA_API void (lua_pushvalue) (lua_State *L, int idx); ++LUA_API void (lua_remove) (lua_State *L, int idx); ++LUA_API void (lua_insert) (lua_State *L, int idx); ++LUA_API void (lua_replace) (lua_State *L, int idx); ++LUA_API int (lua_checkstack) (lua_State *L, int sz); ++ ++LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n); ++ ++ ++/* ++** access functions (stack -> C) ++*/ ++ ++LUA_API int (lua_isnumber) (lua_State *L, int idx); ++LUA_API int (lua_isstring) (lua_State *L, int idx); ++LUA_API int (lua_iscfunction) (lua_State *L, int idx); ++LUA_API int (lua_isuserdata) (lua_State *L, int idx); ++LUA_API int (lua_type) (lua_State *L, int idx); ++LUA_API const char *(lua_typename) (lua_State *L, int tp); ++ ++LUA_API int (lua_equal) (lua_State *L, int idx1, int idx2); ++LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2); ++LUA_API int (lua_lessthan) (lua_State *L, int idx1, int idx2); ++ ++LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx); ++LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx); ++LUA_API int (lua_toboolean) (lua_State *L, int idx); ++LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); ++LUA_API size_t (lua_objlen) (lua_State *L, int idx); ++LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); ++LUA_API void *(lua_touserdata) (lua_State *L, int idx); ++LUA_API lua_State *(lua_tothread) (lua_State *L, int idx); ++LUA_API const void *(lua_topointer) (lua_State *L, int idx); ++ ++ ++/* ++** push functions (C -> stack) ++*/ ++LUA_API void (lua_pushnil) (lua_State *L); ++LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n); ++LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n); ++LUA_API void (lua_pushlstring) (lua_State *L, const char *s, size_t l); ++LUA_API void (lua_pushstring) (lua_State *L, const char *s); ++LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt, ++ va_list argp); ++LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...); ++LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n); ++LUA_API void (lua_pushboolean) (lua_State *L, int b); ++LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p); ++LUA_API int (lua_pushthread) (lua_State *L); ++ ++ ++/* ++** get functions (Lua -> stack) ++*/ ++LUA_API void (lua_gettable) (lua_State *L, int idx); ++LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k); ++LUA_API void (lua_rawget) (lua_State *L, int idx); ++LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n); ++LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); ++LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); ++LUA_API int (lua_getmetatable) (lua_State *L, int objindex); ++LUA_API void (lua_getfenv) (lua_State *L, int idx); ++ ++ ++/* ++** set functions (stack -> Lua) ++*/ ++LUA_API void (lua_settable) (lua_State *L, int idx); ++LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k); ++LUA_API void (lua_rawset) (lua_State *L, int idx); ++LUA_API void (lua_rawseti) (lua_State *L, int idx, int n); ++LUA_API int (lua_setmetatable) (lua_State *L, int objindex); ++LUA_API int (lua_setfenv) (lua_State *L, int idx); ++ ++ ++/* ++** `load' and `call' functions (load and run Lua code) ++*/ ++LUA_API void (lua_call) (lua_State *L, int nargs, int nresults); ++LUA_API int (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc); ++LUA_API int (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud); ++LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt, ++ const char *chunkname); ++ ++LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data); ++ ++ ++/* ++** coroutine functions ++*/ ++LUA_API int (lua_yield) (lua_State *L, int nresults); ++LUA_API int (lua_resume) (lua_State *L, int narg); ++LUA_API int (lua_status) (lua_State *L); ++ ++/* ++** garbage-collection function and options ++*/ ++ ++#define LUA_GCSTOP 0 ++#define LUA_GCRESTART 1 ++#define LUA_GCCOLLECT 2 ++#define LUA_GCCOUNT 3 ++#define LUA_GCCOUNTB 4 ++#define LUA_GCSTEP 5 ++#define LUA_GCSETPAUSE 6 ++#define LUA_GCSETSTEPMUL 7 ++ ++LUA_API int (lua_gc) (lua_State *L, int what, int data); ++ ++ ++/* ++** miscellaneous functions ++*/ ++ ++LUA_API int (lua_error) (lua_State *L); ++ ++LUA_API int (lua_next) (lua_State *L, int idx); ++ ++LUA_API void (lua_concat) (lua_State *L, int n); ++ ++LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); ++LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); ++ ++ ++ ++/* ++** =============================================================== ++** some useful macros ++** =============================================================== ++*/ ++ ++#define lua_pop(L,n) lua_settop(L, -(n)-1) ++ ++#define lua_newtable(L) lua_createtable(L, 0, 0) ++ ++#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n))) ++ ++#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0) ++ ++#define lua_strlen(L,i) lua_objlen(L, (i)) ++ ++#define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION) ++#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE) ++#define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA) ++#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL) ++#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN) ++#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD) ++#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE) ++#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0) ++ ++#define lua_pushliteral(L, s) \ ++ lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1) ++ ++#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, (s)) ++#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, (s)) ++ ++#define lua_tostring(L,i) lua_tolstring(L, (i), NULL) ++ ++ ++ ++/* ++** compatibility macros and functions ++*/ ++ ++#define lua_open() luaL_newstate() ++ ++#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX) ++ ++#define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0) ++ ++#define lua_Chunkreader lua_Reader ++#define lua_Chunkwriter lua_Writer ++ ++ ++/* hack */ ++LUA_API void lua_setlevel (lua_State *from, lua_State *to); ++ ++ ++/* ++** {====================================================================== ++** Debug API ++** ======================================================================= ++*/ ++ ++ ++/* ++** Event codes ++*/ ++#define LUA_HOOKCALL 0 ++#define LUA_HOOKRET 1 ++#define LUA_HOOKLINE 2 ++#define LUA_HOOKCOUNT 3 ++#define LUA_HOOKTAILRET 4 ++ ++ ++/* ++** Event masks ++*/ ++#define LUA_MASKCALL (1 << LUA_HOOKCALL) ++#define LUA_MASKRET (1 << LUA_HOOKRET) ++#define LUA_MASKLINE (1 << LUA_HOOKLINE) ++#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT) ++ ++typedef struct lua_Debug lua_Debug; /* activation record */ ++ ++ ++/* Functions to be called by the debuger in specific events */ ++typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); ++ ++ ++LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar); ++LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); ++LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n); ++LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n); ++LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n); ++LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n); ++ ++LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count); ++LUA_API lua_Hook lua_gethook (lua_State *L); ++LUA_API int lua_gethookmask (lua_State *L); ++LUA_API int lua_gethookcount (lua_State *L); ++ ++ ++struct lua_Debug { ++ int event; ++ const char *name; /* (n) */ ++ const char *namewhat; /* (n) `global', `local', `field', `method' */ ++ const char *what; /* (S) `Lua', `C', `main', `tail' */ ++ const char *source; /* (S) */ ++ int currentline; /* (l) */ ++ int nups; /* (u) number of upvalues */ ++ int linedefined; /* (S) */ ++ int lastlinedefined; /* (S) */ ++ char short_src[LUA_IDSIZE]; /* (S) */ ++ /* private part */ ++ int i_ci; /* active function */ ++}; ++ ++/* }====================================================================== */ ++ ++ ++/****************************************************************************** ++* Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved. ++* ++* Permission is hereby granted, free of charge, to any person obtaining ++* a copy of this software and associated documentation files (the ++* "Software"), to deal in the Software without restriction, including ++* without limitation the rights to use, copy, modify, merge, publish, ++* distribute, sublicense, and/or sell copies of the Software, and to ++* permit persons to whom the Software is furnished to do so, subject to ++* the following conditions: ++* ++* The above copyright notice and this permission notice shall be ++* included in all copies or substantial portions of the Software. ++* ++* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ++* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ++* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++******************************************************************************/ ++ ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/lualib.h +@@ -0,0 +1,55 @@ ++/* ++** $Id: lualib.h,v 1.36.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Lua standard libraries ++** See Copyright Notice in lua.h ++*/ ++ ++ ++#ifndef lualib_h ++#define lualib_h ++ ++#include "lua.h" ++ ++ ++/* Key to file-handle type */ ++#define LUA_FILEHANDLE "FILE*" ++ ++ ++#define LUA_COLIBNAME "coroutine" ++LUALIB_API int (luaopen_base) (lua_State *L); ++ ++#define LUA_TABLIBNAME "table" ++LUALIB_API int (luaopen_table) (lua_State *L); ++/* ++#define LUA_IOLIBNAME "io" ++LUALIB_API int (luaopen_io) (lua_State *L); ++ ++#define LUA_OSLIBNAME "os" ++LUALIB_API int (luaopen_os) (lua_State *L); ++*/ ++ ++#define LUA_STRLIBNAME "string" ++LUALIB_API int (luaopen_string) (lua_State *L); ++ ++/* ++#define LUA_MATHLIBNAME "math" ++LUALIB_API int (luaopen_math) (lua_State *L); ++ ++#define LUA_DBLIBNAME "debug" ++LUALIB_API int (luaopen_debug) (lua_State *L); ++ ++#define LUA_LOADLIBNAME "package" ++LUALIB_API int (luaopen_package) (lua_State *L); ++*/ ++ ++/* open all previous libraries */ ++LUALIB_API void (luaL_openlibs) (lua_State *L); ++ ++ ++ ++#ifndef lua_assert ++#define lua_assert(x) ((void)0) ++#endif ++ ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/lundump.c +@@ -0,0 +1,227 @@ ++/* ++** $Id: lundump.c,v 2.7.1.4 2008/04/04 19:51:41 roberto Exp $ ++** load precompiled Lua chunks ++** See Copyright Notice in lua.h ++*/ ++ ++#include ++ ++#define lundump_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "ldebug.h" ++#include "ldo.h" ++#include "lfunc.h" ++#include "lmem.h" ++#include "lobject.h" ++#include "lstring.h" ++#include "lundump.h" ++#include "lzio.h" ++ ++typedef struct { ++ lua_State* L; ++ ZIO* Z; ++ Mbuffer* b; ++ const char* name; ++} LoadState; ++ ++#ifdef LUAC_TRUST_BINARIES ++#define IF(c,s) ++#define error(S,s) ++#else ++#define IF(c,s) if (c) error(S,s) ++ ++static void error(LoadState* S, const char* why) ++{ ++ luaO_pushfstring(S->L,"%s: %s in precompiled chunk",S->name,why); ++ luaD_throw(S->L,LUA_ERRSYNTAX); ++} ++#endif ++ ++#define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size)) ++#define LoadByte(S) (lu_byte)LoadChar(S) ++#define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x)) ++#define LoadVector(S,b,n,size) LoadMem(S,b,n,size) ++ ++static void LoadBlock(LoadState* S, void* b, size_t size) ++{ ++ size_t r=luaZ_read(S->Z,b,size); ++ IF (r!=0, "unexpected end"); ++} ++ ++static int LoadChar(LoadState* S) ++{ ++ char x; ++ LoadVar(S,x); ++ return x; ++} ++ ++static int LoadInt(LoadState* S) ++{ ++ int x; ++ LoadVar(S,x); ++ IF (x<0, "bad integer"); ++ return x; ++} ++ ++static lua_Number LoadNumber(LoadState* S) ++{ ++ lua_Number x; ++ LoadVar(S,x); ++ return x; ++} ++ ++static TString* LoadString(LoadState* S) ++{ ++ size_t size; ++ LoadVar(S,size); ++ if (size==0) ++ return NULL; ++ else ++ { ++ char* s=luaZ_openspace(S->L,S->b,size); ++ LoadBlock(S,s,size); ++ return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */ ++ } ++} ++ ++static void LoadCode(LoadState* S, Proto* f) ++{ ++ int n=LoadInt(S); ++ f->code=luaM_newvector(S->L,n,Instruction); ++ f->sizecode=n; ++ LoadVector(S,f->code,n,sizeof(Instruction)); ++} ++ ++static Proto* LoadFunction(LoadState* S, TString* p); ++ ++static void LoadConstants(LoadState* S, Proto* f) ++{ ++ int i,n; ++ n=LoadInt(S); ++ f->k=luaM_newvector(S->L,n,TValue); ++ f->sizek=n; ++ for (i=0; ik[i]); ++ for (i=0; ik[i]; ++ int t=LoadChar(S); ++ switch (t) ++ { ++ case LUA_TNIL: ++ setnilvalue(o); ++ break; ++ case LUA_TBOOLEAN: ++ setbvalue(o,LoadChar(S)!=0); ++ break; ++ case LUA_TNUMBER: ++ setnvalue(o,LoadNumber(S)); ++ break; ++ case LUA_TSTRING: ++ setsvalue2n(S->L,o,LoadString(S)); ++ break; ++ default: ++ error(S,"bad constant"); ++ break; ++ } ++ } ++ n=LoadInt(S); ++ f->p=luaM_newvector(S->L,n,Proto*); ++ f->sizep=n; ++ for (i=0; ip[i]=NULL; ++ for (i=0; ip[i]=LoadFunction(S,f->source); ++} ++ ++static void LoadDebug(LoadState* S, Proto* f) ++{ ++ int i,n; ++ n=LoadInt(S); ++ f->lineinfo=luaM_newvector(S->L,n,int); ++ f->sizelineinfo=n; ++ LoadVector(S,f->lineinfo,n,sizeof(int)); ++ n=LoadInt(S); ++ f->locvars=luaM_newvector(S->L,n,LocVar); ++ f->sizelocvars=n; ++ for (i=0; ilocvars[i].varname=NULL; ++ for (i=0; ilocvars[i].varname=LoadString(S); ++ f->locvars[i].startpc=LoadInt(S); ++ f->locvars[i].endpc=LoadInt(S); ++ } ++ n=LoadInt(S); ++ f->upvalues=luaM_newvector(S->L,n,TString*); ++ f->sizeupvalues=n; ++ for (i=0; iupvalues[i]=NULL; ++ for (i=0; iupvalues[i]=LoadString(S); ++} ++ ++static Proto* LoadFunction(LoadState* S, TString* p) ++{ ++ Proto* f; ++ if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep"); ++ f=luaF_newproto(S->L); ++ setptvalue2s(S->L,S->L->top,f); incr_top(S->L); ++ f->source=LoadString(S); if (f->source==NULL) f->source=p; ++ f->linedefined=LoadInt(S); ++ f->lastlinedefined=LoadInt(S); ++ f->nups=LoadByte(S); ++ f->numparams=LoadByte(S); ++ f->is_vararg=LoadByte(S); ++ f->maxstacksize=LoadByte(S); ++ LoadCode(S,f); ++ LoadConstants(S,f); ++ LoadDebug(S,f); ++ IF (!luaG_checkcode(f), "bad code"); ++ S->L->top--; ++ S->L->nCcalls--; ++ return f; ++} ++ ++static void LoadHeader(LoadState* S) ++{ ++ char h[LUAC_HEADERSIZE]; ++ char s[LUAC_HEADERSIZE]; ++ luaU_header(h); ++ LoadBlock(S,s,LUAC_HEADERSIZE); ++ IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header"); ++} ++ ++/* ++** load precompiled chunk ++*/ ++Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name) ++{ ++ LoadState S; ++ if (*name=='@' || *name=='=') ++ S.name=name+1; ++ else if (*name==LUA_SIGNATURE[0]) ++ S.name="binary string"; ++ else ++ S.name=name; ++ S.L=L; ++ S.Z=Z; ++ S.b=buff; ++ LoadHeader(&S); ++ return LoadFunction(&S,luaS_newliteral(L,"=?")); ++} ++ ++/* ++* make header ++*/ ++void luaU_header (char* h) ++{ ++ int x=1; ++ memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-1); ++ h+=sizeof(LUA_SIGNATURE)-1; ++ *h++=(char)LUAC_VERSION; ++ *h++=(char)LUAC_FORMAT; ++ *h++=(char)*(char*)&x; /* endianness */ ++ *h++=(char)sizeof(int); ++ *h++=(char)sizeof(size_t); ++ *h++=(char)sizeof(Instruction); ++ *h++=(char)sizeof(lua_Number); ++ *h++=(char)(((lua_Number)0.5)==0); /* is lua_Number integral? */ ++} +--- /dev/null ++++ b/extensions/LUA/lua/lundump.h +@@ -0,0 +1,36 @@ ++/* ++** $Id: lundump.h,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $ ++** load precompiled Lua chunks ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef lundump_h ++#define lundump_h ++ ++#include "lobject.h" ++#include "lzio.h" ++ ++/* load one chunk; from lundump.c */ ++LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name); ++ ++/* make header; from lundump.c */ ++LUAI_FUNC void luaU_header (char* h); ++ ++/* dump one chunk; from ldump.c */ ++LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); ++ ++#ifdef luac_c ++/* print one chunk; from print.c */ ++LUAI_FUNC void luaU_print (const Proto* f, int full); ++#endif ++ ++/* for header of binary files -- this is Lua 5.1 */ ++#define LUAC_VERSION 0x51 ++ ++/* for header of binary files -- this is the official format */ ++#define LUAC_FORMAT 0 ++ ++/* size of header of binary files */ ++#define LUAC_HEADERSIZE 12 ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/lvm.c +@@ -0,0 +1,762 @@ ++/* ++** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $ ++** Lua virtual machine ++** See Copyright Notice in lua.h ++*/ ++ ++#include ++#include ++#include ++ ++#define lvm_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "ldebug.h" ++#include "ldo.h" ++#include "lfunc.h" ++#include "lgc.h" ++#include "lobject.h" ++#include "lopcodes.h" ++#include "lstate.h" ++#include "lstring.h" ++#include "ltable.h" ++#include "ltm.h" ++#include "lvm.h" ++ ++ ++ ++/* limit for table tag-method chains (to avoid loops) */ ++#define MAXTAGLOOP 100 ++ ++ ++const TValue *luaV_tonumber (const TValue *obj, TValue *n) { ++ lua_Number num; ++ if (ttisnumber(obj)) return obj; ++ if (ttisstring(obj) && luaO_str2d(svalue(obj), &num)) { ++ setnvalue(n, num); ++ return n; ++ } ++ else ++ return NULL; ++} ++ ++ ++int luaV_tostring (lua_State *L, StkId obj) { ++ if (!ttisnumber(obj)) ++ return 0; ++ else { ++ char s[LUAI_MAXNUMBER2STR]; ++ lua_Number n = nvalue(obj); ++ lua_number2str(s, n); ++ setsvalue2s(L, obj, luaS_new(L, s)); ++ return 1; ++ } ++} ++ ++ ++static void traceexec (lua_State *L, const Instruction *pc) { ++ lu_byte mask = L->hookmask; ++ const Instruction *oldpc = L->savedpc; ++ L->savedpc = pc; ++ if ((mask & LUA_MASKCOUNT) && L->hookcount == 0) { ++ resethookcount(L); ++ luaD_callhook(L, LUA_HOOKCOUNT, -1); ++ } ++ if (mask & LUA_MASKLINE) { ++ Proto *p = ci_func(L->ci)->l.p; ++ int npc = pcRel(pc, p); ++ int newline = getline(p, npc); ++ /* call linehook when enter a new function, when jump back (loop), ++ or when enter a new line */ ++ if (npc == 0 || pc <= oldpc || newline != getline(p, pcRel(oldpc, p))) ++ luaD_callhook(L, LUA_HOOKLINE, newline); ++ } ++} ++ ++ ++static void callTMres (lua_State *L, StkId res, const TValue *f, ++ const TValue *p1, const TValue *p2) { ++ ptrdiff_t result = savestack(L, res); ++ setobj2s(L, L->top, f); /* push function */ ++ setobj2s(L, L->top+1, p1); /* 1st argument */ ++ setobj2s(L, L->top+2, p2); /* 2nd argument */ ++ luaD_checkstack(L, 3); ++ L->top += 3; ++ luaD_call(L, L->top - 3, 1); ++ res = restorestack(L, result); ++ L->top--; ++ setobjs2s(L, res, L->top); ++} ++ ++ ++ ++static void callTM (lua_State *L, const TValue *f, const TValue *p1, ++ const TValue *p2, const TValue *p3) { ++ setobj2s(L, L->top, f); /* push function */ ++ setobj2s(L, L->top+1, p1); /* 1st argument */ ++ setobj2s(L, L->top+2, p2); /* 2nd argument */ ++ setobj2s(L, L->top+3, p3); /* 3th argument */ ++ luaD_checkstack(L, 4); ++ L->top += 4; ++ luaD_call(L, L->top - 4, 0); ++} ++ ++ ++void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) { ++ int loop; ++ for (loop = 0; loop < MAXTAGLOOP; loop++) { ++ const TValue *tm; ++ if (ttistable(t)) { /* `t' is a table? */ ++ Table *h = hvalue(t); ++ const TValue *res = luaH_get(h, key); /* do a primitive get */ ++ if (!ttisnil(res) || /* result is no nil? */ ++ (tm = fasttm(L, h->metatable, TM_INDEX)) == NULL) { /* or no TM? */ ++ setobj2s(L, val, res); ++ return; ++ } ++ /* else will try the tag method */ ++ } ++ else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX))) ++ luaG_typeerror(L, t, "index"); ++ if (ttisfunction(tm)) { ++ callTMres(L, val, tm, t, key); ++ return; ++ } ++ t = tm; /* else repeat with `tm' */ ++ } ++ luaG_runerror(L, "loop in gettable"); ++} ++ ++ ++void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { ++ int loop; ++ for (loop = 0; loop < MAXTAGLOOP; loop++) { ++ const TValue *tm; ++ if (ttistable(t)) { /* `t' is a table? */ ++ Table *h = hvalue(t); ++ TValue *oldval = luaH_set(L, h, key); /* do a primitive set */ ++ if (!ttisnil(oldval) || /* result is no nil? */ ++ (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */ ++ setobj2t(L, oldval, val); ++ luaC_barriert(L, h, val); ++ return; ++ } ++ /* else will try the tag method */ ++ } ++ else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX))) ++ luaG_typeerror(L, t, "index"); ++ if (ttisfunction(tm)) { ++ callTM(L, tm, t, key, val); ++ return; ++ } ++ t = tm; /* else repeat with `tm' */ ++ } ++ luaG_runerror(L, "loop in settable"); ++} ++ ++ ++static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2, ++ StkId res, TMS event) { ++ const TValue *tm = luaT_gettmbyobj(L, p1, event); /* try first operand */ ++ if (ttisnil(tm)) ++ tm = luaT_gettmbyobj(L, p2, event); /* try second operand */ ++ if (ttisnil(tm)) return 0; ++ callTMres(L, res, tm, p1, p2); ++ return 1; ++} ++ ++ ++static const TValue *get_compTM (lua_State *L, Table *mt1, Table *mt2, ++ TMS event) { ++ const TValue *tm1 = fasttm(L, mt1, event); ++ const TValue *tm2; ++ if (tm1 == NULL) return NULL; /* no metamethod */ ++ if (mt1 == mt2) return tm1; /* same metatables => same metamethods */ ++ tm2 = fasttm(L, mt2, event); ++ if (tm2 == NULL) return NULL; /* no metamethod */ ++ if (luaO_rawequalObj(tm1, tm2)) /* same metamethods? */ ++ return tm1; ++ return NULL; ++} ++ ++ ++static int call_orderTM (lua_State *L, const TValue *p1, const TValue *p2, ++ TMS event) { ++ const TValue *tm1 = luaT_gettmbyobj(L, p1, event); ++ const TValue *tm2; ++ if (ttisnil(tm1)) return -1; /* no metamethod? */ ++ tm2 = luaT_gettmbyobj(L, p2, event); ++ if (!luaO_rawequalObj(tm1, tm2)) /* different metamethods? */ ++ return -1; ++ callTMres(L, L->top, tm1, p1, p2); ++ return !l_isfalse(L->top); ++} ++ ++ ++static int l_strcmp (const TString *ls, const TString *rs) { ++ const char *l = getstr(ls); ++ size_t ll = ls->tsv.len; ++ const char *r = getstr(rs); ++ size_t lr = rs->tsv.len; ++ for (;;) { ++ int temp = strcoll(l, r); ++ if (temp != 0) return temp; ++ else { /* strings are equal up to a `\0' */ ++ size_t len = strlen(l); /* index of first `\0' in both strings */ ++ if (len == lr) /* r is finished? */ ++ return (len == ll) ? 0 : 1; ++ else if (len == ll) /* l is finished? */ ++ return -1; /* l is smaller than r (because r is not finished) */ ++ /* both strings longer than `len'; go on comparing (after the `\0') */ ++ len++; ++ l += len; ll -= len; r += len; lr -= len; ++ } ++ } ++} ++ ++ ++int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) { ++ int res; ++ if (ttype(l) != ttype(r)) ++ return luaG_ordererror(L, l, r); ++ else if (ttisnumber(l)) ++ return luai_numlt(nvalue(l), nvalue(r)); ++ else if (ttisstring(l)) ++ return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; ++ else if ((res = call_orderTM(L, l, r, TM_LT)) != -1) ++ return res; ++ return luaG_ordererror(L, l, r); ++} ++ ++ ++static int lessequal (lua_State *L, const TValue *l, const TValue *r) { ++ int res; ++ if (ttype(l) != ttype(r)) ++ return luaG_ordererror(L, l, r); ++ else if (ttisnumber(l)) ++ return luai_numle(nvalue(l), nvalue(r)); ++ else if (ttisstring(l)) ++ return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; ++ else if ((res = call_orderTM(L, l, r, TM_LE)) != -1) /* first try `le' */ ++ return res; ++ else if ((res = call_orderTM(L, r, l, TM_LT)) != -1) /* else try `lt' */ ++ return !res; ++ return luaG_ordererror(L, l, r); ++} ++ ++ ++int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2) { ++ const TValue *tm; ++ lua_assert(ttype(t1) == ttype(t2)); ++ switch (ttype(t1)) { ++ case LUA_TNIL: return 1; ++ case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2)); ++ case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* true must be 1 !! */ ++ case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2); ++ case LUA_TUSERDATA: { ++ if (uvalue(t1) == uvalue(t2)) return 1; ++ tm = get_compTM(L, uvalue(t1)->metatable, uvalue(t2)->metatable, ++ TM_EQ); ++ break; /* will try TM */ ++ } ++ case LUA_TTABLE: { ++ if (hvalue(t1) == hvalue(t2)) return 1; ++ tm = get_compTM(L, hvalue(t1)->metatable, hvalue(t2)->metatable, TM_EQ); ++ break; /* will try TM */ ++ } ++ default: return gcvalue(t1) == gcvalue(t2); ++ } ++ if (tm == NULL) return 0; /* no TM? */ ++ callTMres(L, L->top, tm, t1, t2); /* call TM */ ++ return !l_isfalse(L->top); ++} ++ ++ ++void luaV_concat (lua_State *L, int total, int last) { ++ do { ++ StkId top = L->base + last + 1; ++ int n = 2; /* number of elements handled in this pass (at least 2) */ ++ if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) { ++ if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) ++ luaG_concaterror(L, top-2, top-1); ++ } else if (tsvalue(top-1)->len == 0) /* second op is empty? */ ++ (void)tostring(L, top - 2); /* result is first op (as string) */ ++ else { ++ /* at least two string values; get as many as possible */ ++ size_t tl = tsvalue(top-1)->len; ++ char *buffer; ++ int i; ++ /* collect total length */ ++ for (n = 1; n < total && tostring(L, top-n-1); n++) { ++ size_t l = tsvalue(top-n-1)->len; ++ if (l >= MAX_SIZET - tl) luaG_runerror(L, "string length overflow"); ++ tl += l; ++ } ++ buffer = luaZ_openspace(L, &G(L)->buff, tl); ++ tl = 0; ++ for (i=n; i>0; i--) { /* concat all strings */ ++ size_t l = tsvalue(top-i)->len; ++ memcpy(buffer+tl, svalue(top-i), l); ++ tl += l; ++ } ++ setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl)); ++ } ++ total -= n-1; /* got `n' strings to create 1 new */ ++ last -= n-1; ++ } while (total > 1); /* repeat until only 1 result left */ ++} ++ ++ ++static void Arith (lua_State *L, StkId ra, const TValue *rb, ++ const TValue *rc, TMS op) { ++ TValue tempb, tempc; ++ const TValue *b, *c; ++ if ((b = luaV_tonumber(rb, &tempb)) != NULL && ++ (c = luaV_tonumber(rc, &tempc)) != NULL) { ++ lua_Number nb = nvalue(b), nc = nvalue(c); ++ switch (op) { ++ case TM_ADD: setnvalue(ra, luai_numadd(nb, nc)); break; ++ case TM_SUB: setnvalue(ra, luai_numsub(nb, nc)); break; ++ case TM_MUL: setnvalue(ra, luai_nummul(nb, nc)); break; ++ case TM_DIV: setnvalue(ra, luai_numdiv(nb, nc)); break; ++ case TM_MOD: setnvalue(ra, luai_nummod(nb, nc)); break; ++ case TM_POW: setnvalue(ra, luai_numpow(nb, nc)); break; ++ case TM_UNM: setnvalue(ra, luai_numunm(nb)); break; ++ default: lua_assert(0); break; ++ } ++ } ++ else if (!call_binTM(L, rb, rc, ra, op)) ++ luaG_aritherror(L, rb, rc); ++} ++ ++ ++ ++/* ++** some macros for common tasks in `luaV_execute' ++*/ ++ ++#define runtime_check(L, c) { if (!(c)) break; } ++ ++#define RA(i) (base+GETARG_A(i)) ++/* to be used after possible stack reallocation */ ++#define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) ++#define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i)) ++#define RKB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \ ++ ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i)) ++#define RKC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \ ++ ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i)) ++#define KBx(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, k+GETARG_Bx(i)) ++ ++ ++#define dojump(L,pc,i) {(pc) += (i); luai_threadyield(L);} ++ ++ ++#define Protect(x) { L->savedpc = pc; {x;}; base = L->base; } ++ ++ ++#define arith_op(op,tm) { \ ++ TValue *rb = RKB(i); \ ++ TValue *rc = RKC(i); \ ++ if (ttisnumber(rb) && ttisnumber(rc)) { \ ++ lua_Number nb = nvalue(rb), nc = nvalue(rc); \ ++ setnvalue(ra, op(nb, nc)); \ ++ } \ ++ else \ ++ Protect(Arith(L, ra, rb, rc, tm)); \ ++ } ++ ++ ++ ++void luaV_execute (lua_State *L, int nexeccalls) { ++ LClosure *cl; ++ StkId base; ++ TValue *k; ++ const Instruction *pc; ++ reentry: /* entry point */ ++ lua_assert(isLua(L->ci)); ++ pc = L->savedpc; ++ cl = &clvalue(L->ci->func)->l; ++ base = L->base; ++ k = cl->p->k; ++ /* main loop of interpreter */ ++ for (;;) { ++ const Instruction i = *pc++; ++ StkId ra; ++ if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && ++ (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) { ++ traceexec(L, pc); ++ if (L->status == LUA_YIELD) { /* did hook yield? */ ++ L->savedpc = pc - 1; ++ return; ++ } ++ base = L->base; ++ } ++ /* warning!! several calls may realloc the stack and invalidate `ra' */ ++ ra = RA(i); ++ lua_assert(base == L->base && L->base == L->ci->base); ++ lua_assert(base <= L->top && L->top <= L->stack + L->stacksize); ++ lua_assert(L->top == L->ci->top || luaG_checkopenop(i)); ++ switch (GET_OPCODE(i)) { ++ case OP_MOVE: { ++ setobjs2s(L, ra, RB(i)); ++ continue; ++ } ++ case OP_LOADK: { ++ setobj2s(L, ra, KBx(i)); ++ continue; ++ } ++ case OP_LOADBOOL: { ++ setbvalue(ra, GETARG_B(i)); ++ if (GETARG_C(i)) pc++; /* skip next instruction (if C) */ ++ continue; ++ } ++ case OP_LOADNIL: { ++ TValue *rb = RB(i); ++ do { ++ setnilvalue(rb--); ++ } while (rb >= ra); ++ continue; ++ } ++ case OP_GETUPVAL: { ++ int b = GETARG_B(i); ++ setobj2s(L, ra, cl->upvals[b]->v); ++ continue; ++ } ++ case OP_GETGLOBAL: { ++ TValue g; ++ TValue *rb = KBx(i); ++ sethvalue(L, &g, cl->env); ++ lua_assert(ttisstring(rb)); ++ Protect(luaV_gettable(L, &g, rb, ra)); ++ continue; ++ } ++ case OP_GETTABLE: { ++ Protect(luaV_gettable(L, RB(i), RKC(i), ra)); ++ continue; ++ } ++ case OP_SETGLOBAL: { ++ TValue g; ++ sethvalue(L, &g, cl->env); ++ lua_assert(ttisstring(KBx(i))); ++ Protect(luaV_settable(L, &g, KBx(i), ra)); ++ continue; ++ } ++ case OP_SETUPVAL: { ++ UpVal *uv = cl->upvals[GETARG_B(i)]; ++ setobj(L, uv->v, ra); ++ luaC_barrier(L, uv, ra); ++ continue; ++ } ++ case OP_SETTABLE: { ++ Protect(luaV_settable(L, ra, RKB(i), RKC(i))); ++ continue; ++ } ++ case OP_NEWTABLE: { ++ int b = GETARG_B(i); ++ int c = GETARG_C(i); ++ sethvalue(L, ra, luaH_new(L, luaO_fb2int(b), luaO_fb2int(c))); ++ Protect(luaC_checkGC(L)); ++ continue; ++ } ++ case OP_SELF: { ++ StkId rb = RB(i); ++ setobjs2s(L, ra+1, rb); ++ Protect(luaV_gettable(L, rb, RKC(i), ra)); ++ continue; ++ } ++ case OP_ADD: { ++ arith_op(luai_numadd, TM_ADD); ++ continue; ++ } ++ case OP_SUB: { ++ arith_op(luai_numsub, TM_SUB); ++ continue; ++ } ++ case OP_MUL: { ++ arith_op(luai_nummul, TM_MUL); ++ continue; ++ } ++ case OP_DIV: { ++ arith_op(luai_numdiv, TM_DIV); ++ continue; ++ } ++ case OP_MOD: { ++ arith_op(luai_nummod, TM_MOD); ++ continue; ++ } ++ case OP_POW: { ++ arith_op(luai_numpow, TM_POW); ++ continue; ++ } ++ case OP_UNM: { ++ TValue *rb = RB(i); ++ if (ttisnumber(rb)) { ++ lua_Number nb = nvalue(rb); ++ setnvalue(ra, luai_numunm(nb)); ++ } ++ else { ++ Protect(Arith(L, ra, rb, rb, TM_UNM)); ++ } ++ continue; ++ } ++ case OP_NOT: { ++ int res = l_isfalse(RB(i)); /* next assignment may change this value */ ++ setbvalue(ra, res); ++ continue; ++ } ++ case OP_LEN: { ++ const TValue *rb = RB(i); ++ switch (ttype(rb)) { ++ case LUA_TTABLE: { ++ setnvalue(ra, cast_num(luaH_getn(hvalue(rb)))); ++ break; ++ } ++ case LUA_TSTRING: { ++ setnvalue(ra, cast_num(tsvalue(rb)->len)); ++ break; ++ } ++ default: { /* try metamethod */ ++ Protect( ++ if (!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN)) ++ luaG_typeerror(L, rb, "get length of"); ++ ) ++ } ++ } ++ continue; ++ } ++ case OP_CONCAT: { ++ int b = GETARG_B(i); ++ int c = GETARG_C(i); ++ Protect(luaV_concat(L, c-b+1, c); luaC_checkGC(L)); ++ setobjs2s(L, RA(i), base+b); ++ continue; ++ } ++ case OP_JMP: { ++ dojump(L, pc, GETARG_sBx(i)); ++ continue; ++ } ++ case OP_EQ: { ++ TValue *rb = RKB(i); ++ TValue *rc = RKC(i); ++ Protect( ++ if (equalobj(L, rb, rc) == GETARG_A(i)) ++ dojump(L, pc, GETARG_sBx(*pc)); ++ ) ++ pc++; ++ continue; ++ } ++ case OP_LT: { ++ Protect( ++ if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i)) ++ dojump(L, pc, GETARG_sBx(*pc)); ++ ) ++ pc++; ++ continue; ++ } ++ case OP_LE: { ++ Protect( ++ if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i)) ++ dojump(L, pc, GETARG_sBx(*pc)); ++ ) ++ pc++; ++ continue; ++ } ++ case OP_TEST: { ++ if (l_isfalse(ra) != GETARG_C(i)) ++ dojump(L, pc, GETARG_sBx(*pc)); ++ pc++; ++ continue; ++ } ++ case OP_TESTSET: { ++ TValue *rb = RB(i); ++ if (l_isfalse(rb) != GETARG_C(i)) { ++ setobjs2s(L, ra, rb); ++ dojump(L, pc, GETARG_sBx(*pc)); ++ } ++ pc++; ++ continue; ++ } ++ case OP_CALL: { ++ int b = GETARG_B(i); ++ int nresults = GETARG_C(i) - 1; ++ if (b != 0) L->top = ra+b; /* else previous instruction set top */ ++ L->savedpc = pc; ++ switch (luaD_precall(L, ra, nresults)) { ++ case PCRLUA: { ++ nexeccalls++; ++ goto reentry; /* restart luaV_execute over new Lua function */ ++ } ++ case PCRC: { ++ /* it was a C function (`precall' called it); adjust results */ ++ if (nresults >= 0) L->top = L->ci->top; ++ base = L->base; ++ continue; ++ } ++ default: { ++ return; /* yield */ ++ } ++ } ++ } ++ case OP_TAILCALL: { ++ int b = GETARG_B(i); ++ if (b != 0) L->top = ra+b; /* else previous instruction set top */ ++ L->savedpc = pc; ++ lua_assert(GETARG_C(i) - 1 == LUA_MULTRET); ++ switch (luaD_precall(L, ra, LUA_MULTRET)) { ++ case PCRLUA: { ++ /* tail call: put new frame in place of previous one */ ++ CallInfo *ci = L->ci - 1; /* previous frame */ ++ int aux; ++ StkId func = ci->func; ++ StkId pfunc = (ci+1)->func; /* previous function index */ ++ if (L->openupval) luaF_close(L, ci->base); ++ L->base = ci->base = ci->func + ((ci+1)->base - pfunc); ++ for (aux = 0; pfunc+aux < L->top; aux++) /* move frame down */ ++ setobjs2s(L, func+aux, pfunc+aux); ++ ci->top = L->top = func+aux; /* correct top */ ++ lua_assert(L->top == L->base + clvalue(func)->l.p->maxstacksize); ++ ci->savedpc = L->savedpc; ++ ci->tailcalls++; /* one more call lost */ ++ L->ci--; /* remove new frame */ ++ goto reentry; ++ } ++ case PCRC: { /* it was a C function (`precall' called it) */ ++ base = L->base; ++ continue; ++ } ++ default: { ++ return; /* yield */ ++ } ++ } ++ } ++ case OP_RETURN: { ++ int b = GETARG_B(i); ++ if (b != 0) L->top = ra+b-1; ++ if (L->openupval) luaF_close(L, base); ++ L->savedpc = pc; ++ b = luaD_poscall(L, ra); ++ if (--nexeccalls == 0) /* was previous function running `here'? */ ++ return; /* no: return */ ++ else { /* yes: continue its execution */ ++ if (b) L->top = L->ci->top; ++ lua_assert(isLua(L->ci)); ++ lua_assert(GET_OPCODE(*((L->ci)->savedpc - 1)) == OP_CALL); ++ goto reentry; ++ } ++ } ++ case OP_FORLOOP: { ++ lua_Number step = nvalue(ra+2); ++ lua_Number idx = luai_numadd(nvalue(ra), step); /* increment index */ ++ lua_Number limit = nvalue(ra+1); ++ if (luai_numlt(0, step) ? luai_numle(idx, limit) ++ : luai_numle(limit, idx)) { ++ dojump(L, pc, GETARG_sBx(i)); /* jump back */ ++ setnvalue(ra, idx); /* update internal index... */ ++ setnvalue(ra+3, idx); /* ...and external index */ ++ } ++ continue; ++ } ++ case OP_FORPREP: { ++ const TValue *init = ra; ++ const TValue *plimit = ra+1; ++ const TValue *pstep = ra+2; ++ L->savedpc = pc; /* next steps may throw errors */ ++ if (!tonumber(init, ra)) ++ luaG_runerror(L, LUA_QL("for") " initial value must be a number"); ++ else if (!tonumber(plimit, ra+1)) ++ luaG_runerror(L, LUA_QL("for") " limit must be a number"); ++ else if (!tonumber(pstep, ra+2)) ++ luaG_runerror(L, LUA_QL("for") " step must be a number"); ++ setnvalue(ra, luai_numsub(nvalue(ra), nvalue(pstep))); ++ dojump(L, pc, GETARG_sBx(i)); ++ continue; ++ } ++ case OP_TFORLOOP: { ++ StkId cb = ra + 3; /* call base */ ++ setobjs2s(L, cb+2, ra+2); ++ setobjs2s(L, cb+1, ra+1); ++ setobjs2s(L, cb, ra); ++ L->top = cb+3; /* func. + 2 args (state and index) */ ++ Protect(luaD_call(L, cb, GETARG_C(i))); ++ L->top = L->ci->top; ++ cb = RA(i) + 3; /* previous call may change the stack */ ++ if (!ttisnil(cb)) { /* continue loop? */ ++ setobjs2s(L, cb-1, cb); /* save control variable */ ++ dojump(L, pc, GETARG_sBx(*pc)); /* jump back */ ++ } ++ pc++; ++ continue; ++ } ++ case OP_SETLIST: { ++ int n = GETARG_B(i); ++ int c = GETARG_C(i); ++ int last; ++ Table *h; ++ if (n == 0) { ++ n = cast_int(L->top - ra) - 1; ++ L->top = L->ci->top; ++ } ++ if (c == 0) c = cast_int(*pc++); ++ runtime_check(L, ttistable(ra)); ++ h = hvalue(ra); ++ last = ((c-1)*LFIELDS_PER_FLUSH) + n; ++ if (last > h->sizearray) /* needs more space? */ ++ luaH_resizearray(L, h, last); /* pre-alloc it at once */ ++ for (; n > 0; n--) { ++ TValue *val = ra+n; ++ setobj2t(L, luaH_setnum(L, h, last--), val); ++ luaC_barriert(L, h, val); ++ } ++ continue; ++ } ++ case OP_CLOSE: { ++ luaF_close(L, ra); ++ continue; ++ } ++ case OP_CLOSURE: { ++ Proto *p; ++ Closure *ncl; ++ int nup, j; ++ p = cl->p->p[GETARG_Bx(i)]; ++ nup = p->nups; ++ ncl = luaF_newLclosure(L, nup, cl->env); ++ ncl->l.p = p; ++ for (j=0; jl.upvals[j] = cl->upvals[GETARG_B(*pc)]; ++ else { ++ lua_assert(GET_OPCODE(*pc) == OP_MOVE); ++ ncl->l.upvals[j] = luaF_findupval(L, base + GETARG_B(*pc)); ++ } ++ } ++ setclvalue(L, ra, ncl); ++ Protect(luaC_checkGC(L)); ++ continue; ++ } ++ case OP_VARARG: { ++ int b = GETARG_B(i) - 1; ++ int j; ++ CallInfo *ci = L->ci; ++ int n = cast_int(ci->base - ci->func) - cl->p->numparams - 1; ++ if (b == LUA_MULTRET) { ++ Protect(luaD_checkstack(L, n)); ++ ra = RA(i); /* previous call may change the stack */ ++ b = n; ++ L->top = ra + n; ++ } ++ for (j = 0; j < b; j++) { ++ if (j < n) { ++ setobjs2s(L, ra + j, ci->base - n + j); ++ } ++ else { ++ setnilvalue(ra + j); ++ } ++ } ++ continue; ++ } ++ } ++ } ++} ++ +--- /dev/null ++++ b/extensions/LUA/lua/lvm.h +@@ -0,0 +1,36 @@ ++/* ++** $Id: lvm.h,v 2.5.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Lua virtual machine ++** See Copyright Notice in lua.h ++*/ ++ ++#ifndef lvm_h ++#define lvm_h ++ ++ ++#include "ldo.h" ++#include "lobject.h" ++#include "ltm.h" ++ ++ ++#define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o))) ++ ++#define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \ ++ (((o) = luaV_tonumber(o,n)) != NULL)) ++ ++#define equalobj(L,o1,o2) \ ++ (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2)) ++ ++ ++LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); ++LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2); ++LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n); ++LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj); ++LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, ++ StkId val); ++LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, ++ StkId val); ++LUAI_FUNC void luaV_execute (lua_State *L, int nexeccalls); ++LUAI_FUNC void luaV_concat (lua_State *L, int total, int last); ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/lua/lzio.c +@@ -0,0 +1,81 @@ ++/* ++** $Id: lzio.c,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $ ++** a generic input stream interface ++** See Copyright Notice in lua.h ++*/ ++ ++#include ++ ++#define lzio_c ++#define LUA_CORE ++ ++#include "lua.h" ++ ++#include "llimits.h" ++#include "lmem.h" ++#include "lstate.h" ++#include "lzio.h" ++ ++ ++int luaZ_fill (ZIO *z) { ++ size_t size; ++ lua_State *L = z->L; ++ const char *buff; ++ lua_unlock(L); ++ buff = z->reader(L, z->data, &size); ++ lua_lock(L); ++ if (buff == NULL || size == 0) return EOZ; ++ z->n = size - 1; ++ z->p = buff; ++ return char2int(*(z->p++)); ++} ++ ++ ++int luaZ_lookahead (ZIO *z) { ++ if (z->n == 0) { ++ if (luaZ_fill(z) == EOZ) ++ return EOZ; ++ else { ++ z->n++; /* luaZ_fill removed first byte; put back it */ ++ z->p--; ++ } ++ } ++ return char2int(*z->p); ++} ++ ++ ++void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) { ++ z->L = L; ++ z->reader = reader; ++ z->data = data; ++ z->n = 0; ++ z->p = NULL; ++} ++ ++ ++/* --------------------------------------------------------------- read --- */ ++size_t luaZ_read (ZIO *z, void *b, size_t n) { ++ while (n) { ++ size_t m; ++ if (luaZ_lookahead(z) == EOZ) ++ return n; /* return number of missing bytes */ ++ m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ ++ memcpy(b, z->p, m); ++ z->n -= m; ++ z->p += m; ++ b = (char *)b + m; ++ n -= m; ++ } ++ return 0; ++} ++ ++/* ------------------------------------------------------------------------ */ ++char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) { ++ if (n > buff->buffsize) { ++ if (n < LUA_MINBUFFER) n = LUA_MINBUFFER; ++ luaZ_resizebuffer(L, buff, n); ++ } ++ return buff->buffer; ++} ++ ++ +--- /dev/null ++++ b/extensions/LUA/lua/lzio.h +@@ -0,0 +1,67 @@ ++/* ++** $Id: lzio.h,v 1.21.1.1 2007/12/27 13:02:25 roberto Exp $ ++** Buffered streams ++** See Copyright Notice in lua.h ++*/ ++ ++ ++#ifndef lzio_h ++#define lzio_h ++ ++#include "lua.h" ++ ++#include "lmem.h" ++ ++ ++#define EOZ (-1) /* end of stream */ ++ ++typedef struct Zio ZIO; ++ ++#define char2int(c) cast(int, cast(unsigned char, (c))) ++ ++#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z)) ++ ++typedef struct Mbuffer { ++ char *buffer; ++ size_t n; ++ size_t buffsize; ++} Mbuffer; ++ ++#define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0) ++ ++#define luaZ_buffer(buff) ((buff)->buffer) ++#define luaZ_sizebuffer(buff) ((buff)->buffsize) ++#define luaZ_bufflen(buff) ((buff)->n) ++ ++#define luaZ_resetbuffer(buff) ((buff)->n = 0) ++ ++ ++#define luaZ_resizebuffer(L, buff, size) \ ++ (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \ ++ (buff)->buffsize = size) ++ ++#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0) ++ ++ ++LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n); ++LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, ++ void *data); ++LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */ ++LUAI_FUNC int luaZ_lookahead (ZIO *z); ++ ++ ++ ++/* --------- Private Part ------------------ */ ++ ++struct Zio { ++ size_t n; /* bytes still unread */ ++ const char *p; /* current position in buffer */ ++ lua_Reader reader; ++ void* data; /* additional data */ ++ lua_State *L; /* Lua state (for reader) */ ++}; ++ ++ ++LUAI_FUNC int luaZ_fill (ZIO *z); ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/Makefile +@@ -0,0 +1,389 @@ ++# Makefile.in generated by automake 1.11.1 from Makefile.am. ++# extensions/LUA/Makefile. Generated from Makefile.in by configure. ++ ++# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, ++# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, ++# Inc. ++# This Makefile.in is free software; the Free Software Foundation ++# gives unlimited permission to copy and/or distribute it, ++# with or without modifications, as long as this notice is preserved. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY, to the extent permitted by law; without ++# even the implied warranty of MERCHANTABILITY or FITNESS FOR A ++# PARTICULAR PURPOSE. ++ ++ ++ ++# -*- Makefile -*- ++# AUTOMAKE ++ ++pkgdatadir = $(datadir)/xtables-addons ++pkgincludedir = $(includedir)/xtables-addons ++pkglibdir = $(libdir)/xtables-addons ++pkglibexecdir = $(libexecdir)/xtables-addons ++am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd ++install_sh_DATA = $(install_sh) -c -m 644 ++install_sh_PROGRAM = $(install_sh) -c ++install_sh_SCRIPT = $(install_sh) -c ++INSTALL_HEADER = $(INSTALL_DATA) ++transform = $(program_transform_name) ++NORMAL_INSTALL = : ++PRE_INSTALL = : ++POST_INSTALL = : ++NORMAL_UNINSTALL = : ++PRE_UNINSTALL = : ++POST_UNINSTALL = : ++build_triplet = i686-pc-linux-gnu ++host_triplet = i686-pc-linux-gnu ++DIST_COMMON = $(srcdir)/../../Makefile.extra $(srcdir)/Makefile.am \ ++ $(srcdir)/Makefile.in ++subdir = extensions/LUA ++ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ++am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ ++ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ ++ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ ++ $(top_srcdir)/configure.ac ++am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ ++ $(ACLOCAL_M4) ++mkinstalldirs = $(install_sh) -d ++CONFIG_HEADER = $(top_builddir)/config.h ++CONFIG_CLEAN_FILES = ++CONFIG_CLEAN_VPATH_FILES = ++SOURCES = ++DIST_SOURCES = ++DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ++ACLOCAL = ${SHELL} /home/andre/Dropbox/xtables-addons/missing --run aclocal-1.11 ++AMTAR = ${SHELL} /home/andre/Dropbox/xtables-addons/missing --run tar ++AR = ar ++AUTOCONF = ${SHELL} /home/andre/Dropbox/xtables-addons/missing --run autoconf ++AUTOHEADER = ${SHELL} /home/andre/Dropbox/xtables-addons/missing --run autoheader ++AUTOMAKE = ${SHELL} /home/andre/Dropbox/xtables-addons/missing --run automake-1.11 ++AWK = mawk ++CC = gcc ++CCDEPMODE = depmode=gcc3 ++CFLAGS = -g -O2 ++CPP = gcc -E ++CPPFLAGS = ++CYGPATH_W = echo ++DEFS = -DHAVE_CONFIG_H ++DEPDIR = .deps ++DSYMUTIL = ++DUMPBIN = ++ECHO_C = ++ECHO_N = -n ++ECHO_T = ++EGREP = /bin/grep -E ++EXEEXT = ++FGREP = /bin/grep -F ++GREP = /bin/grep ++INSTALL = /usr/bin/install -c ++INSTALL_DATA = ${INSTALL} -m 644 ++INSTALL_PROGRAM = ${INSTALL} ++INSTALL_SCRIPT = ${INSTALL} ++INSTALL_STRIP_PROGRAM = $(install_sh) -c -s ++LD = /usr/bin/ld ++LDFLAGS = ++LIBOBJS = ++LIBS = ++LIBTOOL = $(SHELL) $(top_builddir)/libtool ++LIPO = ++LN_S = ln -s ++LTLIBOBJS = ++MAKEINFO = ${SHELL} /home/andre/Dropbox/xtables-addons/missing --run makeinfo ++MKDIR_P = /bin/mkdir -p ++NM = /usr/bin/nm -B ++NMEDIT = ++OBJDUMP = objdump ++OBJEXT = o ++OTOOL = ++OTOOL64 = ++PACKAGE = xtables-addons ++PACKAGE_BUGREPORT = ++PACKAGE_NAME = xtables-addons ++PACKAGE_STRING = xtables-addons 1.21 ++PACKAGE_TARNAME = xtables-addons ++PACKAGE_URL = ++PACKAGE_VERSION = 1.21 ++PATH_SEPARATOR = : ++PKG_CONFIG = /usr/bin/pkg-config ++RANLIB = ranlib ++SED = /bin/sed ++SET_MAKE = ++SHELL = /bin/bash ++STRIP = strip ++VERSION = 1.21 ++abs_builddir = /home/andre/Dropbox/xtables-addons/extensions/LUA ++abs_srcdir = /home/andre/Dropbox/xtables-addons/extensions/LUA ++abs_top_builddir = /home/andre/Dropbox/xtables-addons ++abs_top_srcdir = /home/andre/Dropbox/xtables-addons ++ac_ct_CC = gcc ++ac_ct_DUMPBIN = ++am__include = include ++am__leading_dot = . ++am__quote = ++am__tar = ${AMTAR} chof - "$$tardir" ++am__untar = ${AMTAR} xf - ++bindir = ${exec_prefix}/bin ++build = i686-pc-linux-gnu ++build_alias = ++build_cpu = i686 ++build_os = linux-gnu ++build_vendor = pc ++builddir = . ++datadir = ${datarootdir} ++datarootdir = ${prefix}/share ++docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} ++dvidir = ${docdir} ++exec_prefix = ${prefix} ++host = i686-pc-linux-gnu ++host_alias = ++host_cpu = i686 ++host_os = linux-gnu ++host_vendor = pc ++htmldir = ${docdir} ++includedir = ${prefix}/include ++infodir = ${datarootdir}/info ++install_sh = ${SHELL} /home/andre/Dropbox/xtables-addons/install-sh ++kbuilddir = /lib/modules/2.6.33-020633-generic/build ++kinclude_CFLAGS = -I /lib/modules/2.6.33-020633-generic/build/include ++ksourcedir = ++libdir = ${exec_prefix}/lib ++libexecdir = ${exec_prefix}/libexec ++libxtables_CFLAGS = ++libxtables_LIBS = -L/lib -lxtables ++localedir = ${datarootdir}/locale ++localstatedir = ${prefix}/var ++lt_ECHO = echo ++mandir = ${datarootdir}/man ++mkdir_p = /bin/mkdir -p ++oldincludedir = /usr/include ++pdfdir = ${docdir} ++prefix = /usr/local ++program_transform_name = s,x,x, ++psdir = ${docdir} ++regular_CFLAGS = -D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes -Winline -pipe -DXTABLES_LIBDIR=\"${xtlibdir}\" ++sbindir = ${exec_prefix}/sbin ++sharedstatedir = ${prefix}/com ++srcdir = . ++sysconfdir = ${prefix}/etc ++target_alias = ++top_build_prefix = ../../ ++top_builddir = ../.. ++top_srcdir = ../.. ++xtlibdir = ${libexecdir}/xtables ++XA_SRCDIR = ${srcdir} ++XA_TOPSRCDIR = ${top_srcdir} ++XA_ABSTOPSRCDIR = ${abs_top_srcdir} ++_mcall = -f ${top_builddir}/Makefile.iptrules ++all: all-am ++ ++.SUFFIXES: ++$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../../Makefile.extra $(am__configure_deps) ++ @for dep in $?; do \ ++ case '$(am__configure_deps)' in \ ++ *$$dep*) \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ ++ exit 1;; \ ++ esac; \ ++ done; \ ++ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign extensions/LUA/Makefile'; \ ++ $(am__cd) $(top_srcdir) && \ ++ $(AUTOMAKE) --foreign extensions/LUA/Makefile ++.PRECIOUS: Makefile ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status ++ @case '$?' in \ ++ *config.status*) \ ++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ ++ *) \ ++ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ ++ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ ++ esac; ++ ++$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) ++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ++ ++$(top_srcdir)/configure: $(am__configure_deps) ++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ++$(ACLOCAL_M4): $(am__aclocal_m4_deps) ++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ++$(am__aclocal_m4_deps): ++ ++mostlyclean-libtool: ++ -rm -f *.lo ++ ++clean-libtool: ++ -rm -rf .libs _libs ++tags: TAGS ++TAGS: ++ ++ctags: CTAGS ++CTAGS: ++ ++ ++distdir: $(DISTFILES) ++ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ ++ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ ++ list='$(DISTFILES)'; \ ++ dist_files=`for file in $$list; do echo $$file; done | \ ++ sed -e "s|^$$srcdirstrip/||;t" \ ++ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ ++ case $$dist_files in \ ++ */*) $(MKDIR_P) `echo "$$dist_files" | \ ++ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ ++ sort -u` ;; \ ++ esac; \ ++ for file in $$dist_files; do \ ++ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ ++ if test -d $$d/$$file; then \ ++ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ ++ if test -d "$(distdir)/$$file"; then \ ++ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ ++ fi; \ ++ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ ++ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ ++ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ ++ fi; \ ++ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ ++ else \ ++ test -f "$(distdir)/$$file" \ ++ || cp -p $$d/$$file "$(distdir)/$$file" \ ++ || exit 1; \ ++ fi; \ ++ done ++check-am: all-am ++check: check-am ++all-am: Makefile all-local ++installdirs: ++install: install-am ++install-exec: install-exec-am ++install-data: install-data-am ++uninstall: uninstall-am ++ ++install-am: all-am ++ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am ++ ++installcheck: installcheck-am ++install-strip: ++ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ ++ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ ++ `test -z '$(STRIP)' || \ ++ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install ++mostlyclean-generic: ++ ++clean-generic: ++ ++distclean-generic: ++ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) ++ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) ++ ++maintainer-clean-generic: ++ @echo "This command is intended for maintainers to use" ++ @echo "it deletes files that may require special tools to rebuild." ++clean: clean-am ++ ++clean-am: clean-generic clean-libtool clean-local mostlyclean-am ++ ++distclean: distclean-am ++ -rm -f Makefile ++distclean-am: clean-am distclean-generic ++ ++dvi: dvi-am ++ ++dvi-am: ++ ++html: html-am ++ ++html-am: ++ ++info: info-am ++ ++info-am: ++ ++install-data-am: ++ ++install-dvi: install-dvi-am ++ ++install-dvi-am: ++ ++install-exec-am: install-exec-local ++ ++install-html: install-html-am ++ ++install-html-am: ++ ++install-info: install-info-am ++ ++install-info-am: ++ ++install-man: ++ ++install-pdf: install-pdf-am ++ ++install-pdf-am: ++ ++install-ps: install-ps-am ++ ++install-ps-am: ++ ++installcheck-am: ++ ++maintainer-clean: maintainer-clean-am ++ -rm -f Makefile ++maintainer-clean-am: distclean-am maintainer-clean-generic ++ ++mostlyclean: mostlyclean-am ++ ++mostlyclean-am: mostlyclean-generic mostlyclean-libtool ++ ++pdf: pdf-am ++ ++pdf-am: ++ ++ps: ps-am ++ ++ps-am: ++ ++uninstall-am: ++ ++.MAKE: install-am install-strip ++ ++.PHONY: all all-am all-local check check-am clean clean-generic \ ++ clean-libtool clean-local distclean distclean-generic \ ++ distclean-libtool distdir dvi dvi-am html html-am info info-am \ ++ install install-am install-data install-data-am install-dvi \ ++ install-dvi-am install-exec install-exec-am install-exec-local \ ++ install-html install-html-am install-info install-info-am \ ++ install-man install-pdf install-pdf-am install-ps \ ++ install-ps-am install-strip installcheck installcheck-am \ ++ installdirs maintainer-clean maintainer-clean-generic \ ++ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ++ ps ps-am uninstall uninstall-am ++ ++export XA_SRCDIR ++export XA_TOPSRCDIR ++export XA_ABSTOPSRCDIR ++ ++all-local: user-all-local ++ ++install-exec-local: user-install-local ++ ++clean-local: user-clean-local ++ ++user-all-local: ++ ${MAKE} ${_mcall} all; ++ ++# Have no user-install-data-local ATM ++user-install-local: user-install-exec-local ++ ++user-install-exec-local: ++ ${MAKE} ${_mcall} install; ++ ++user-clean-local: ++ ${MAKE} ${_mcall} clean; ++ ++# Tell versions [3.59,3.63) of GNU make to not export all variables. ++# Otherwise a system limit (for SysV at least) may be exceeded. ++.NOEXPORT: ++ +--- /dev/null ++++ b/extensions/LUA/Makefile.am +@@ -0,0 +1 @@ ++include ../../Makefile.extra +--- /dev/null ++++ b/extensions/LUA/Makefile.in +@@ -0,0 +1,389 @@ ++# Makefile.in generated by automake 1.11.1 from Makefile.am. ++# @configure_input@ ++ ++# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, ++# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, ++# Inc. ++# This Makefile.in is free software; the Free Software Foundation ++# gives unlimited permission to copy and/or distribute it, ++# with or without modifications, as long as this notice is preserved. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY, to the extent permitted by law; without ++# even the implied warranty of MERCHANTABILITY or FITNESS FOR A ++# PARTICULAR PURPOSE. ++ ++@SET_MAKE@ ++ ++# -*- Makefile -*- ++# AUTOMAKE ++VPATH = @srcdir@ ++pkgdatadir = $(datadir)/@PACKAGE@ ++pkgincludedir = $(includedir)/@PACKAGE@ ++pkglibdir = $(libdir)/@PACKAGE@ ++pkglibexecdir = $(libexecdir)/@PACKAGE@ ++am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd ++install_sh_DATA = $(install_sh) -c -m 644 ++install_sh_PROGRAM = $(install_sh) -c ++install_sh_SCRIPT = $(install_sh) -c ++INSTALL_HEADER = $(INSTALL_DATA) ++transform = $(program_transform_name) ++NORMAL_INSTALL = : ++PRE_INSTALL = : ++POST_INSTALL = : ++NORMAL_UNINSTALL = : ++PRE_UNINSTALL = : ++POST_UNINSTALL = : ++build_triplet = @build@ ++host_triplet = @host@ ++DIST_COMMON = $(srcdir)/../../Makefile.extra $(srcdir)/Makefile.am \ ++ $(srcdir)/Makefile.in ++subdir = extensions/LUA ++ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ++am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ ++ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ ++ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ ++ $(top_srcdir)/configure.ac ++am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ ++ $(ACLOCAL_M4) ++mkinstalldirs = $(install_sh) -d ++CONFIG_HEADER = $(top_builddir)/config.h ++CONFIG_CLEAN_FILES = ++CONFIG_CLEAN_VPATH_FILES = ++SOURCES = ++DIST_SOURCES = ++DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ++ACLOCAL = @ACLOCAL@ ++AMTAR = @AMTAR@ ++AR = @AR@ ++AUTOCONF = @AUTOCONF@ ++AUTOHEADER = @AUTOHEADER@ ++AUTOMAKE = @AUTOMAKE@ ++AWK = @AWK@ ++CC = @CC@ ++CCDEPMODE = @CCDEPMODE@ ++CFLAGS = @CFLAGS@ ++CPP = @CPP@ ++CPPFLAGS = @CPPFLAGS@ ++CYGPATH_W = @CYGPATH_W@ ++DEFS = @DEFS@ ++DEPDIR = @DEPDIR@ ++DSYMUTIL = @DSYMUTIL@ ++DUMPBIN = @DUMPBIN@ ++ECHO_C = @ECHO_C@ ++ECHO_N = @ECHO_N@ ++ECHO_T = @ECHO_T@ ++EGREP = @EGREP@ ++EXEEXT = @EXEEXT@ ++FGREP = @FGREP@ ++GREP = @GREP@ ++INSTALL = @INSTALL@ ++INSTALL_DATA = @INSTALL_DATA@ ++INSTALL_PROGRAM = @INSTALL_PROGRAM@ ++INSTALL_SCRIPT = @INSTALL_SCRIPT@ ++INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ++LD = @LD@ ++LDFLAGS = @LDFLAGS@ ++LIBOBJS = @LIBOBJS@ ++LIBS = @LIBS@ ++LIBTOOL = @LIBTOOL@ ++LIPO = @LIPO@ ++LN_S = @LN_S@ ++LTLIBOBJS = @LTLIBOBJS@ ++MAKEINFO = @MAKEINFO@ ++MKDIR_P = @MKDIR_P@ ++NM = @NM@ ++NMEDIT = @NMEDIT@ ++OBJDUMP = @OBJDUMP@ ++OBJEXT = @OBJEXT@ ++OTOOL = @OTOOL@ ++OTOOL64 = @OTOOL64@ ++PACKAGE = @PACKAGE@ ++PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ ++PACKAGE_NAME = @PACKAGE_NAME@ ++PACKAGE_STRING = @PACKAGE_STRING@ ++PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ ++PACKAGE_VERSION = @PACKAGE_VERSION@ ++PATH_SEPARATOR = @PATH_SEPARATOR@ ++PKG_CONFIG = @PKG_CONFIG@ ++RANLIB = @RANLIB@ ++SED = @SED@ ++SET_MAKE = @SET_MAKE@ ++SHELL = @SHELL@ ++STRIP = @STRIP@ ++VERSION = @VERSION@ ++abs_builddir = @abs_builddir@ ++abs_srcdir = @abs_srcdir@ ++abs_top_builddir = @abs_top_builddir@ ++abs_top_srcdir = @abs_top_srcdir@ ++ac_ct_CC = @ac_ct_CC@ ++ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ++am__include = @am__include@ ++am__leading_dot = @am__leading_dot@ ++am__quote = @am__quote@ ++am__tar = @am__tar@ ++am__untar = @am__untar@ ++bindir = @bindir@ ++build = @build@ ++build_alias = @build_alias@ ++build_cpu = @build_cpu@ ++build_os = @build_os@ ++build_vendor = @build_vendor@ ++builddir = @builddir@ ++datadir = @datadir@ ++datarootdir = @datarootdir@ ++docdir = @docdir@ ++dvidir = @dvidir@ ++exec_prefix = @exec_prefix@ ++host = @host@ ++host_alias = @host_alias@ ++host_cpu = @host_cpu@ ++host_os = @host_os@ ++host_vendor = @host_vendor@ ++htmldir = @htmldir@ ++includedir = @includedir@ ++infodir = @infodir@ ++install_sh = @install_sh@ ++kbuilddir = @kbuilddir@ ++kinclude_CFLAGS = @kinclude_CFLAGS@ ++ksourcedir = @ksourcedir@ ++libdir = @libdir@ ++libexecdir = @libexecdir@ ++libxtables_CFLAGS = @libxtables_CFLAGS@ ++libxtables_LIBS = @libxtables_LIBS@ ++localedir = @localedir@ ++localstatedir = @localstatedir@ ++lt_ECHO = @lt_ECHO@ ++mandir = @mandir@ ++mkdir_p = @mkdir_p@ ++oldincludedir = @oldincludedir@ ++pdfdir = @pdfdir@ ++prefix = @prefix@ ++program_transform_name = @program_transform_name@ ++psdir = @psdir@ ++regular_CFLAGS = @regular_CFLAGS@ ++sbindir = @sbindir@ ++sharedstatedir = @sharedstatedir@ ++srcdir = @srcdir@ ++sysconfdir = @sysconfdir@ ++target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ ++top_builddir = @top_builddir@ ++top_srcdir = @top_srcdir@ ++xtlibdir = @xtlibdir@ ++XA_SRCDIR = ${srcdir} ++XA_TOPSRCDIR = ${top_srcdir} ++XA_ABSTOPSRCDIR = ${abs_top_srcdir} ++_mcall = -f ${top_builddir}/Makefile.iptrules ++all: all-am ++ ++.SUFFIXES: ++$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../../Makefile.extra $(am__configure_deps) ++ @for dep in $?; do \ ++ case '$(am__configure_deps)' in \ ++ *$$dep*) \ ++ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ++ && { if test -f $@; then exit 0; else break; fi; }; \ ++ exit 1;; \ ++ esac; \ ++ done; \ ++ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign extensions/LUA/Makefile'; \ ++ $(am__cd) $(top_srcdir) && \ ++ $(AUTOMAKE) --foreign extensions/LUA/Makefile ++.PRECIOUS: Makefile ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status ++ @case '$?' in \ ++ *config.status*) \ ++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ ++ *) \ ++ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ ++ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ ++ esac; ++ ++$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) ++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ++ ++$(top_srcdir)/configure: $(am__configure_deps) ++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ++$(ACLOCAL_M4): $(am__aclocal_m4_deps) ++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ++$(am__aclocal_m4_deps): ++ ++mostlyclean-libtool: ++ -rm -f *.lo ++ ++clean-libtool: ++ -rm -rf .libs _libs ++tags: TAGS ++TAGS: ++ ++ctags: CTAGS ++CTAGS: ++ ++ ++distdir: $(DISTFILES) ++ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ ++ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ ++ list='$(DISTFILES)'; \ ++ dist_files=`for file in $$list; do echo $$file; done | \ ++ sed -e "s|^$$srcdirstrip/||;t" \ ++ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ ++ case $$dist_files in \ ++ */*) $(MKDIR_P) `echo "$$dist_files" | \ ++ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ ++ sort -u` ;; \ ++ esac; \ ++ for file in $$dist_files; do \ ++ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ ++ if test -d $$d/$$file; then \ ++ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ ++ if test -d "$(distdir)/$$file"; then \ ++ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ ++ fi; \ ++ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ ++ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ ++ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ ++ fi; \ ++ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ ++ else \ ++ test -f "$(distdir)/$$file" \ ++ || cp -p $$d/$$file "$(distdir)/$$file" \ ++ || exit 1; \ ++ fi; \ ++ done ++check-am: all-am ++check: check-am ++all-am: Makefile all-local ++installdirs: ++install: install-am ++install-exec: install-exec-am ++install-data: install-data-am ++uninstall: uninstall-am ++ ++install-am: all-am ++ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am ++ ++installcheck: installcheck-am ++install-strip: ++ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ ++ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ ++ `test -z '$(STRIP)' || \ ++ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install ++mostlyclean-generic: ++ ++clean-generic: ++ ++distclean-generic: ++ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) ++ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) ++ ++maintainer-clean-generic: ++ @echo "This command is intended for maintainers to use" ++ @echo "it deletes files that may require special tools to rebuild." ++clean: clean-am ++ ++clean-am: clean-generic clean-libtool clean-local mostlyclean-am ++ ++distclean: distclean-am ++ -rm -f Makefile ++distclean-am: clean-am distclean-generic ++ ++dvi: dvi-am ++ ++dvi-am: ++ ++html: html-am ++ ++html-am: ++ ++info: info-am ++ ++info-am: ++ ++install-data-am: ++ ++install-dvi: install-dvi-am ++ ++install-dvi-am: ++ ++install-exec-am: install-exec-local ++ ++install-html: install-html-am ++ ++install-html-am: ++ ++install-info: install-info-am ++ ++install-info-am: ++ ++install-man: ++ ++install-pdf: install-pdf-am ++ ++install-pdf-am: ++ ++install-ps: install-ps-am ++ ++install-ps-am: ++ ++installcheck-am: ++ ++maintainer-clean: maintainer-clean-am ++ -rm -f Makefile ++maintainer-clean-am: distclean-am maintainer-clean-generic ++ ++mostlyclean: mostlyclean-am ++ ++mostlyclean-am: mostlyclean-generic mostlyclean-libtool ++ ++pdf: pdf-am ++ ++pdf-am: ++ ++ps: ps-am ++ ++ps-am: ++ ++uninstall-am: ++ ++.MAKE: install-am install-strip ++ ++.PHONY: all all-am all-local check check-am clean clean-generic \ ++ clean-libtool clean-local distclean distclean-generic \ ++ distclean-libtool distdir dvi dvi-am html html-am info info-am \ ++ install install-am install-data install-data-am install-dvi \ ++ install-dvi-am install-exec install-exec-am install-exec-local \ ++ install-html install-html-am install-info install-info-am \ ++ install-man install-pdf install-pdf-am install-ps \ ++ install-ps-am install-strip installcheck installcheck-am \ ++ installdirs maintainer-clean maintainer-clean-generic \ ++ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ++ ps ps-am uninstall uninstall-am ++ ++export XA_SRCDIR ++export XA_TOPSRCDIR ++export XA_ABSTOPSRCDIR ++ ++all-local: user-all-local ++ ++install-exec-local: user-install-local ++ ++clean-local: user-clean-local ++ ++user-all-local: ++ ${MAKE} ${_mcall} all; ++ ++# Have no user-install-data-local ATM ++user-install-local: user-install-exec-local ++ ++user-install-exec-local: ++ ${MAKE} ${_mcall} install; ++ ++user-clean-local: ++ ${MAKE} ${_mcall} clean; ++ ++# Tell versions [3.59,3.63) of GNU make to not export all variables. ++# Otherwise a system limit (for SysV at least) may be exceeded. ++.NOEXPORT: ++ +--- /dev/null ++++ b/extensions/LUA/Mbuild +@@ -0,0 +1,3 @@ ++# -*- Makefile -*- ++ ++obj-${build_LUA} += libxt_LUA.so +--- /dev/null ++++ b/extensions/LUA/nf_lua.c +@@ -0,0 +1,64 @@ ++#if defined(__KERNEL__) ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#endif ++ ++#include "lua.h" ++#include "lobject.h" /*sizeof(udata) */ ++#include "lauxlib.h" ++#include "controller.h" ++ ++#if defined(__KERNEL__) /* reachs until luaopen_nflib */ ++ ++ ++static int32_t nf_get_random(lua_State *L) ++{ ++ uint32_t rand = 0; ++ ++ get_random_bytes(&rand, sizeof(uint32_t )); ++ lua_pushnumber(L, rand); ++ return 1; ++} ++ ++static int32_t nf_get_time(lua_State *L) ++{ ++ lua_pushnumber(L, jiffies_to_msecs(jiffies_64)); ++ return 1; ++} ++ ++static const struct luaL_Reg nf_lua_lib_f [] = { ++ { "get_random", nf_get_random }, ++ { "get_time", nf_get_time }, ++ { NULL, NULL } ++}; ++ ++void luaopen_nflib(lua_State *L) ++{ ++ int32_t top; ++ ++ luaL_register(L, NETFILTER_LIB, nf_lua_lib_f); ++ lua_pop(L, 1); ++ ++ /* registering verdicts inside the _G */ ++ lua_getglobal(L, "_G"); ++ top = lua_gettop(L); ++ ++ lua_pushinteger(L, XT_CONTINUE); ++ lua_setfield(L, top, "XT_CONTINUE"); /* continiue with next rule */ ++ ++ lua_pushinteger(L, NF_DROP); ++ lua_setfield(L, top, "NF_DROP"); /* stop traversal in the current table hook and drop packet */ ++ ++ lua_pushinteger(L, NF_ACCEPT); ++ lua_setfield(L, top, "NF_ACCEPT"); /* stop traversal in the current table hook and accept packet */ ++ ++ lua_pop(L, 1); /* pop _G */ ++} ++ ++#endif +--- /dev/null ++++ b/extensions/LUA/prot_buf_dynamic.c +@@ -0,0 +1,486 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++ ++#include "controller.h" ++ ++ ++ ++struct protocol_buf * dyn_prot_buf_array[MAX_NR_OF_DYN_PROT_BUFS] = { NULL }; ++ ++ ++/* LUA_API: the function 'field_dynamic_setter' acts as a wrapper around ++ * a given Lua field setter function of a dynamic protocol buffer. The ++ * string containing the lua function name was piggybacked in the 'set' ++ * member of the protocol_field. We call this function passing the actual ++ * segment as byte array and the set value. ++ * ++ * Paramters: ++ * 1. lua_packet_segment (implicit) ++ * 2. some lua value ++ * ++ * Upvalues: ++ * 1. pointer to the protocol buffer ++ * 2. field index ++ * ++ * Returns: ++ * 1. true or false if the 'set' was successful ++ */ ++int32_t field_dynamic_setter(lua_State *L) ++{ ++ size_t nbytes; ++ lua_packet_segment * array; ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ int32_t field_index = lua_tointeger(L, lua_upvalueindex(2)); ++ ++ /* the function name is piggybacked as a string */ ++ lua_getglobal(L, (char *)prot_buf->protocol_fields[field_index].set); ++ if (!lua_isfunction(L, -1)) { ++ lua_pushboolean(L, 0); ++ return 1; ++ } ++ ++ nbytes = sizeof(lua_packet_segment) + seg->length * sizeof(uint8_t); ++ array = (lua_packet_segment *)lua_newuserdata(L, nbytes); ++ array->length = seg->length; ++ array->start = seg->start + seg->offset; ++ array->changes = NULL; ++ ++ luaL_getmetatable(L, LUA_BYTE_ARRAY); ++ lua_setmetatable(L, -2); ++ lua_pushvalue(L, 2); /* push value to set */ ++ if (lua_pcall(L, 2, 1, 0) != 0) { ++ pr_debug("Error: %s \n", lua_tostring(L, -1)); ++ lua_pop(L, 1); ++ lua_pushboolean(L, 0); ++ } ++ return 1; ++} ++ ++/* LUA_API: the function 'field_dynamic_getter' acts as a wrapper around ++ * a given Lua field getter function of a dynamic protocol buffer. The ++ * string containing the lua function name was piggybacked in the 'get' ++ * member of the protocol_field. We call this function passing the actual ++ * segment as byte array. ++ * ++ * Paramters: ++ * 1. lua_packet_segment (implicit) ++ * ++ * Upvalues: ++ * 1. pointer to the protocol buffer ++ * 2. field index ++ * ++ * Returns: ++ * 1. true or false if the 'get' was successful ++ */ ++int32_t field_dynamic_getter(lua_State *L) ++{ ++ size_t nbytes; ++ lua_packet_segment * array; ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ int32_t field_index = lua_tointeger(L, lua_upvalueindex(2)); ++ ++ /* the function name is piggybacked as a string */ ++ lua_getglobal(L, (char *)prot_buf->protocol_fields[field_index].get); ++ if (!lua_isfunction(L, -1)) { ++ lua_pushboolean(L, 0); ++ return 1; ++ } ++ ++ nbytes = sizeof(lua_packet_segment) + seg->length * sizeof(uint8_t); ++ array = (lua_packet_segment *)lua_newuserdata(L, nbytes); ++ array->length = seg->length; ++ array->start = seg->start + seg->offset; ++ array->changes = NULL; ++ ++ luaL_getmetatable(L, LUA_BYTE_ARRAY); ++ lua_setmetatable(L, -2); ++ if (lua_pcall(L, 1, 1, 0) != 0) { ++ pr_debug("Error: %s \n", luaL_checkstring(L, -1)); ++ lua_pop(L, 1); ++ lua_pushboolean(L, 0); ++ } ++ return 1; ++} ++ ++/* LUA_API: the function 'has_protocol_dynamic' acts as a wrapper around ++ * a given lua has_protocol function of a dynamic protocol buffer. The ++ * string containing the lua function name was piggybacked in the 'has_protocol' ++ * member of the protocol_buffer. We call this function passing the actual ++ * segment. ++ * ++ * Paramters: ++ * 1. lua_packet_segment ++ * 2. protocol type ++ * ++ * Returns: ++ * 1. true or false if the payload field contains the given protocol ++ */ ++int32_t has_protocol_dynamic(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int32_t type) ++{ ++ lua_packet_segment *seg_new; ++ int32_t res = 0; ++ ++ /* the function name is piggybacked as a string */ ++ lua_getglobal(L, (char *)prot_buf->has_protocol); ++ seg_new = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment)); ++ seg_new->start = seg->start; ++ seg_new->offset = seg->offset; ++ seg_new->length = seg->length; ++ seg_new->changes = NULL; ++ luaL_getmetatable(L, prot_buf->name); ++ lua_setmetatable(L, -2); ++ lua_pushinteger(L, type); /* push the protocol type */ ++ if (lua_pcall(L, 2, 1, 0) != 0) { ++ pr_debug("Error: %s \n", luaL_checkstring(L, -1)); ++ lua_pop(L, 1); ++ return 0; ++ } ++ res = lua_toboolean(L, -1); ++ lua_pop(L, 1); ++ ++ return res; ++} ++ ++/* LUA_API: the function 'get_field_changes_dynamic' acts as a wrapper around ++ * a given lua get_field_changes function of a dynamic protocol buffer. The ++ * string containing the lua function name was piggybacked in the 'get_field_changes' ++ * member of the protocol_buffer. We call this function passing the actual ++ * segment. The lua function must return two lua table containing the offset ++ * and length changes (in bits). ++ * ++ * Paramters: ++ * 1. lua_packet_segment ++ * ++ * Returns: ++ * 1. new allocated field_changes struct ++ */ ++struct field_changes * get_field_changes_dynamic(lua_State *L, struct protocol_buf *prot_buf, lua_packet_segment * seg) ++{ ++ lua_packet_segment *seg_new; ++ struct field_changes * changes; ++ int32_t nr_of_changes, i; ++ ++ lua_getglobal(L, (char *)prot_buf->get_field_changes); ++ ++ seg_new = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment)); ++ seg_new->start = seg->start; ++ seg_new->offset = seg->offset; ++ seg_new->length = seg->length; ++ seg_new->changes = NULL; ++ luaL_getmetatable(L, prot_buf->name); ++ lua_setmetatable(L, -2); ++ ++ if (lua_pcall(L, 1, 2, 0) != 0) ++ luaL_error(L, "inside get_field_changes_dynamic. %s\n", lua_tostring(L, -1)); ++ ++ /* the function call must return a table containing length changes */ ++ luaL_checktype(L, -1, LUA_TTABLE); ++ /* the function call must return a table containing offset changes */ ++ luaL_checktype(L, -2, LUA_TTABLE); ++ /* both tables have to be of same size */ ++ if (lua_objlen(L, -1) != lua_objlen(L, -2)) ++ luaL_error(L, "the provided tables are not of equal size"); ++ ++ nr_of_changes = lua_objlen(L, -1); ++ changes = get_allocated_field_changes(L, nr_of_changes); ++ ++ /* loop over the tables */ ++ for (i = 1; i < nr_of_changes; i++) { ++ lua_rawgeti(L, -1, i); /* push length value of field at index i */ ++ changes->field_length_changes[i - 1] = luaL_checkinteger(L, -1); ++ lua_pop(L, 1); /* pop offset value */ ++ ++ lua_rawgeti(L, -2, i); /* push offset value of field at index i */ ++ changes->field_offset_changes[i - 1] = luaL_checkinteger(L, -1); ++ lua_pop(L, 1); /* pop length value */ ++ } ++ ++ /* pop both tables */ ++ lua_pop(L, 2); ++ ++ return changes; ++} ++ ++/* C_INT: 'get_free_protocol_index' is only used internally. This function ++ * gets a free slot inside the array holding all the protocol buffers. ++ * There are several ways to get to this information. In this case I take ++ * the way over the reflected array SUPPORTED_PROTOCOL_TABLE inside the ++ * Lua state. Since this function is called at laodtime, we do not have ++ * to care about performance. ++ */ ++static int32_t get_free_protocol_index(lua_State *L) ++{ ++ int32_t protocol_index; ++ ++ lua_getglobal(L, SUPPORTED_PROTOCOL_TABLE); ++ protocol_index = lua_objlen(L, -1) + 1; ++ lua_pop(L, 1); ++ return protocol_index; ++} ++ ++/* C_API: 'free_dynamic_prot_buf' frees the allocated memory of a given ++ * dynamic protocol buffer. this function is normally called inside a ++ * cleanup routine. Be aware, before running this function you must be ++ * sure that no references to the dynamic protocol buffers were available. ++ * It's recomended to close the Lua state before calling the function. */ ++void free_dynamic_prot_buf(struct protocol_buf * prot_buf) ++{ ++ struct protocol_field * field = prot_buf->protocol_fields; ++ ++ for (; field->name != NULL; field++) { ++ if (field->get) kfree(field->get); ++ if (field->set) kfree(field->set); ++ if (field->name) kfree((char *)field->name); ++ } ++ ++ if (prot_buf->payload_field) kfree(prot_buf->payload_field); ++ if (prot_buf->has_protocol) kfree(prot_buf->has_protocol); ++ ++ if (prot_buf->get_field_changes) kfree(prot_buf->get_field_changes); ++ kfree((char *)prot_buf->name); ++ kfree(prot_buf); ++ return; ++} ++ ++void cleanup_dynamic_prot_bufs(void) ++{ ++ int32_t i; ++ ++ for (i = 0; i < MAX_NR_OF_DYN_PROT_BUFS; i++) { ++ if (dyn_prot_buf_array[i]) { ++ free_dynamic_prot_buf(dyn_prot_buf_array[i]); ++ dyn_prot_buf_array[i] = NULL; ++ } ++ } ++ return; ++} ++ ++ ++/* C_INT: 'free_protocol_fields' is used internally as a helper function for ++ * 'register_dynamic_protbuf'. It is used when durin registration an error ++ * occurs and the afore allocated fields needed to be freed. */ ++static inline void free_protocol_fields(struct protocol_field * prot_fields, int32_t i) ++{ ++ struct protocol_field * f; ++ ++ while (i >= 0) { ++ f = &prot_fields[i]; ++ if (f->name) kfree((void *)f->name); ++ if (f->get) kfree((void *)f->get); ++ if (f->set) kfree((void *)f->set); ++ kfree((void *)f); ++ i--; ++ } ++} ++ ++/* LUA_API: 'register_dynamic_protbuf' is called from within the Lua script. ++ * it takes a Lua table representing the dynamic protocol buffer as parameter. ++ * e.g.: ++ * eth_prot_buf = { ++ * name = "packet_eth_dyn", ++ * payload_field = "data", ++ * protocol_fields = { ++ * {"dmac", 0, 48, nil, nil }, ++ * {"smac", 48, 48, nil, nil }, ++ * {"type", 96, 16, nil, nil }, ++ * {"data", 112, 0, nil, nil }, ++ * }, ++ * has_protocol = "eth_dyn_has_protocol", ++ * get_field_changes = "eth_dyn_get_field_changes" ++ * } ++ * register_dynamic_protbuf(eth_prot_buf) ++ * ++ * the table gets parsed and a new protocol_buf struct is allocated and ++ * initialized using 'register_protbuf', which is also used for the static ++ * protocol buffers. This enables an identical behavior like the static ++ * protocol buffers. The dynamic protocol buffers are not garbage collected, ++ * use 'free_dynamic_protbuf' to free them after closing the Lua state. ++ */ ++static int32_t register_dynamic_protbuf(lua_State *L) ++{ ++ struct protocol_buf *prot_buf; ++ struct protocol_field *field, sentinel = PROT_FIELD_SENTINEL; ++ int32_t nr_of_fields, i; ++ ++ prot_buf = (struct protocol_buf *)kmalloc(sizeof(struct protocol_buf), GFP_KERNEL); ++ prot_buf->is_dynamic = 1; ++ ++ /* check if parameter is a table */ ++ luaL_checktype(L, 1, LUA_TTABLE); ++ ++ /* initialize prot_buf.name */ ++ lua_getfield(L, 1, "name"); ++ prot_buf->name = kmalloc(lua_objlen(L, -1), GFP_KERNEL); ++ strcpy((char *)prot_buf->name, luaL_checkstring(L, -1)); ++ lua_pop(L, 1); /* pop res from lua_getfield */ ++ ++ /* check if protocol buffer is already registered */ ++ lua_getglobal(L, prot_buf->name); ++ if (!lua_isnil(L, -1)) { ++ lua_pop(L, 1); /* pop res from lua_getglobal */ ++ pr_debug("protocol_buf '%s' already registered.\n", prot_buf->name); ++ goto free_prot_buf; ++ } ++ lua_pop(L, 1); /* pop res from lua_getglobal */ ++ ++ /* initialize payload field */ ++ lua_getfield(L, 1, "payload_field"); ++ if (lua_isstring(L, -1)) { ++ prot_buf->payload_field = kmalloc(lua_objlen(L, -1), GFP_KERNEL); ++ strcpy(prot_buf->payload_field, lua_tostring(L, -1)); ++ }else ++ prot_buf->payload_field = NULL; ++ lua_pop(L, 1); /* pop res from lua_getfield */ ++ ++ /* initialize protocol_fields field*/ ++ lua_getfield(L, 1, "protocol_fields"); ++ if (!lua_istable(L, -1)) { ++ pr_debug("invalid protocol_fields table.\n"); ++ goto err2; ++ ++ } ++ ++ nr_of_fields = lua_objlen(L, -1); ++ prot_buf->protocol_fields = (struct protocol_field *)kmalloc((nr_of_fields + 1) * sizeof(struct protocol_field), GFP_KERNEL); ++ ++ for (i = 1; i <= nr_of_fields; i++) { ++ field = &prot_buf->protocol_fields[i - 1]; ++ /* initialize protocol field */ ++ lua_rawgeti(L, -1, i); /* push field-table */ ++ if (!lua_istable(L, -1)) { ++ free_protocol_fields(prot_buf->protocol_fields, i); ++ pr_debug("invalid protocol_field at %i.\n", i); ++ goto err; ++ } ++ ++ /* initialize protocol field name */ ++ lua_rawgeti(L, -1, 1); ++ if (!lua_isstring(L, -1)) { ++ free_protocol_fields(prot_buf->protocol_fields, i); ++ pr_debug("invalid protocol_field name at %i.\n", i); ++ goto err; ++ } ++ ++ field->name = kmalloc(lua_objlen(L, -1), GFP_KERNEL); ++ strcpy((char*)field->name, lua_tostring(L, -1)); ++ lua_pop(L, 1); /* pop field name */ ++ ++ /* initialize protocol field offset */ ++ lua_rawgeti(L, -1, 2); ++ if (!lua_isnumber(L, -1)) { ++ free_protocol_fields(prot_buf->protocol_fields, i); ++ pr_debug("invalid protocol_field offset at %i.\n", i); ++ goto err; ++ } ++ field->offset = lua_tointeger(L, -1); ++ lua_pop(L, 1); /* pop field offset */ ++ ++ /* initialize protocol field length */ ++ lua_rawgeti(L, -1, 3); ++ if (!lua_isnumber(L, -1)) { ++ free_protocol_fields(prot_buf->protocol_fields, i); ++ pr_debug("invalid protocol_field length at %i.\n", i); ++ goto err; ++ } ++ field->length = lua_tointeger(L, -1); ++ lua_pop(L, 1); /* pop field length */ ++ ++ /* initialize protocol field getter */ ++ lua_rawgeti(L, -1, 4); ++ if (lua_isstring(L, -1)) { ++ field->get = kmalloc(lua_objlen(L, -1), GFP_KERNEL); ++ strcpy((char *)field->get, lua_tostring(L, -1)); /* the get-wrapper knows about the piggybacked string */ ++ }else ++ field->get = NULL; ++ lua_pop(L, 1); /* pop field getter */ ++ ++ /* initialize protocol field setter */ ++ lua_rawgeti(L, -1, 5); ++ if (lua_isstring(L, -1)) { ++ field->set = kmalloc(lua_objlen(L, -1), GFP_KERNEL); ++ strcpy((char *)field->set, lua_tostring(L, -1)); /* the set-wrapper knows about the piggybacked string */ ++ }else ++ field->set = NULL; ++ lua_pop(L, 1); /* pop field setter */ ++ ++ /* field initialization completed */ ++ lua_pop(L, 1); /* pop field-table */ ++ } ++ ++ /* put sentinel at the end of protocol_fields */ ++ memcpy(&prot_buf->protocol_fields[nr_of_fields], &sentinel, sizeof(sentinel)); ++ lua_pop(L, 1); /* pop protocol-fields-table */ ++ ++ /* initialize has_protocol field */ ++ lua_getfield(L, 1, "has_protocol"); ++ if (lua_isstring(L, -1)) { ++ prot_buf->has_protocol = kmalloc(lua_objlen(L, -1), GFP_KERNEL); ++ strcpy((char *)prot_buf->has_protocol, lua_tostring(L, -1)); /* the has_protocol-wrapper knows about the piggybacked string */ ++ }else ++ prot_buf->has_protocol = NULL; ++ lua_pop(L, 1); /* pop has_protocol */ ++ ++ /* initialize get_field_changes field */ ++ lua_getfield(L, 1, "get_field_changes"); ++ if (lua_isstring(L, -1)) { ++ prot_buf->get_field_changes = kmalloc(lua_objlen(L, -1), GFP_KERNEL); ++ strcpy((char *)prot_buf->get_field_changes, lua_tostring(L, -1)); /* the get_field_changes-wrapper knows about the piggybacked string */ ++ }else ++ prot_buf->get_field_changes = NULL; ++ lua_pop(L, 1); /* pop get_field_changes */ ++ ++ /* Storing the pointer to the DYNAMIC protbuf within dyn_prot_buf_array, in order to free it at cleanup */ ++ for (i = 0; i < MAX_NR_OF_DYN_PROT_BUFS; i++) { ++ if (!dyn_prot_buf_array[i]) { ++ dyn_prot_buf_array[i] = prot_buf; ++ break; ++ }else ++ goto err; ++ } ++ ++ /* call the "common" register_protbuf */ ++ register_protbuf(L, prot_buf, get_free_protocol_index(L)); /* register prot_buf as it is done with the static ones */ ++ ++ return 0; ++ ++err: ++ kfree(prot_buf->protocol_fields); ++err2: ++ if (prot_buf->payload_field) kfree(prot_buf->payload_field); ++free_prot_buf: ++ kfree((void *)prot_buf->name); ++ kfree(prot_buf); ++ ++ luaL_error(L, "one or more error happend while registering a dynamic protocol buffer, please consult the debug log"); ++ ++ return 0; ++ ++} ++ ++void luaopen_protbuf_dynamic(lua_State *L) ++{ ++ lua_getglobal(L, "_G"); ++ lua_pushcclosure(L, register_dynamic_protbuf, 0); ++ lua_setfield(L, -2, "register_dynamic_protbuf"); ++ lua_pop(L, 1); /* pop _G */ ++ return; ++} +--- /dev/null ++++ b/extensions/LUA/prot_buf_ethernet.c +@@ -0,0 +1,60 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++ ++#include "controller.h" ++ ++ ++static int32_t eth_has_protocol(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int32_t protocol_type) ++{ ++ uint8_t *embedded_protocol = seg->start + seg->offset + 12 /*bytes*/; ++ unsigned short res = (unsigned short)((embedded_protocol[1] << CHAR_BIT) | (embedded_protocol[0] << CHAR_BIT)); ++ ++ switch (res) { ++ case 0x0800: /* 1: Internet Protocol (IP) */ ++ if (protocol_type == PACKET_IP) return 1; ++ break; ++ default: ++ return 0; ++ } ++ ++ return 0; ++} ++ ++static const struct protocol_field eth_protocol_fields[] = { ++ /* field name offset length getter setter */ ++ { "dmac", 0, 48, NULL, NULL }, ++ { "smac", 48, 48, NULL, NULL }, ++ { "type", 96, 16, NULL, NULL }, ++ { "data", 112, 0, NULL, NULL }, ++ PROT_FIELD_SENTINEL, ++}; ++ ++static const struct protocol_buf eth_protocol_buf = { ++ .is_dynamic = 0, ++ .name = LUA_PACKET_SEG_ETH, ++ .payload_field = "data", ++ .protocol_fields = (struct protocol_field *)ð_protocol_fields, ++ .has_protocol = ð_has_protocol, ++ .get_field_changes = NULL, ++}; ++ ++ ++void luaopen_protbuf_eth(lua_State *L) ++{ ++ register_protbuf(L, (struct protocol_buf *)ð_protocol_buf, PACKET_ETH); ++} +--- /dev/null ++++ b/extensions/LUA/prot_buf_helpers.c +@@ -0,0 +1,216 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++ ++#if defined(__KERNEL__) ++#include ++#include /* kmalloc */ ++#endif ++ ++#include "controller.h" ++ ++int32_t get_header_size(struct protocol_buf * prot_buf) ++{ ++ int32_t bit_counter = 0; ++ struct protocol_field * field = prot_buf->protocol_fields; ++ ++ for (; field->name; field++) ++ bit_counter += field->length; ++ ++ return bit_counter >> 3; ++} ++ ++ ++int32_t set_32_bit_generic(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ *(uint32_t *)(seg->start + seg->offset) = (uint32_t )htonl(luaL_checkinteger(L, 2)); ++ return 0; ++} ++int32_t get_32_bit_generic(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ lua_pushinteger(L, ntohl(*((uint32_t *)(seg->start + seg->offset)))); ++ return 1; ++} ++ ++int32_t set_16_bit_generic(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ *(uint16_t *)(seg->start + seg->offset) = (uint16_t)htons(luaL_checkinteger(L, 2)); ++ return 0; ++} ++int32_t get_16_bit_generic(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ lua_pushinteger(L, ntohs(*((uint16_t *)(seg->start + seg->offset)))); ++ return 1; ++} ++ ++int32_t set_lower_4_bit_generic(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ uint8_t b = (uint8_t)luaL_checkinteger(L, 2) << 4; ++ uint8_t * pos = (uint8_t *)(seg->start + seg->offset); ++ ++ *pos &= 0x0F; /* reset lower 4 bits*/ ++ *pos |= b; ++ ++ return 0; ++} ++ ++int32_t get_lower_4_bit_generic(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ lua_pushinteger(L, (*(uint8_t *)(seg->start + seg->offset)) >> 4); ++ return 1; ++} ++ ++int32_t set_upper_4_bit_generic(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ uint8_t b = (uint8_t)luaL_checkinteger(L, 2) << 4; ++ uint8_t * pos = (uint8_t *)(seg->start + seg->offset); ++ ++ *pos &= 0xF0; /* reset upper 4 bits*/ ++ *pos |= (b >> 4); ++ ++ return 0; ++} ++ ++int32_t get_upper_4_bit_generic(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ lua_pushinteger(L, (*(uint8_t *)(seg->start + seg->offset)) & 0x0F); ++ return 1; ++} ++ ++ ++int32_t set_8_bit_generic(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ *(uint8_t *)(seg->start + seg->offset) = (uint8_t)luaL_checkinteger(L, 2); ++ return 0; ++} ++ ++int32_t get_8_bit_generic(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ lua_pushinteger(L, *(uint8_t *)(seg->start + seg->offset)); ++ return 1; ++} ++ ++int32_t set_1_bit_generic(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ unsigned long l = 0; ++ ++ memcpy(&l, (seg->start + seg->offset), seg->length); ++ l |= (1 << ((CHAR_BIT * seg->length) - luaL_checkinteger(L, 2))); ++ memcpy((seg->start + seg->offset), &l, seg->length); ++ ++ return 0; ++} ++ ++int32_t get_1_bit_generic(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ unsigned long l = 0; ++ uint32_t bit = 0; ++ ++ memcpy(&l, (seg->start + seg->offset), seg->length); ++ bit = l & (1 << ((CHAR_BIT * seg->length) - luaL_checkinteger(L, 2))); ++ ++ lua_pushboolean(L, bit); ++ return 1; ++} ++ ++int32_t get_string_generic(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++ /* Warning we cast from uchar to char */ ++ lua_pushlstring(L, (char *)seg->start + seg->offset, seg->length); ++ return 1; ++} ++ ++int32_t set_data_generic(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ lua_packet_segment * data = checkbytearray(L, 2); ++ ++ pr_debug("seg->length %u, data->length %u\n", seg->length, data->length); ++ ++ if (seg->length >= data->length) ++ memcpy((seg->start + seg->offset), data->start, data->length); ++ else ++ luaL_error(L, "provided byte array too big for given packet segment"); ++ return 0; ++} ++ ++struct field_changes * get_allocated_field_changes(lua_State *L, int32_t nr_of_fields) ++{ ++ struct field_changes * changes; ++ ++ changes = kmalloc(sizeof(struct field_changes), GFP_ATOMIC); ++ ++ if (!changes) ++ goto failure; ++ ++ changes->field_length_changes = kmalloc(nr_of_fields * sizeof(int), GFP_ATOMIC); ++ if (!changes->field_length_changes) ++ goto free1; ++ ++ changes->field_offset_changes = kmalloc(nr_of_fields * sizeof(int), GFP_ATOMIC); ++ if (!changes->field_offset_changes) ++ goto free2; ++ ++ memset(changes->field_length_changes, 0, nr_of_fields * sizeof(int)); ++ memset(changes->field_offset_changes, 0, nr_of_fields * sizeof(int)); ++ ++ changes->ref_count = 1; ++ ++ return changes; ++ ++free2: kfree(changes->field_length_changes); ++free1: kfree(changes); ++failure: ++ if (!changes) luaL_error(L, "couldnt allocate memory inside 'get_allocated_field_changes'"); ++ return NULL; /* only to omit warnings */ ++} +\ No newline at end of file +--- /dev/null ++++ b/extensions/LUA/prot_buf_icmp.c +@@ -0,0 +1,49 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++ ++#include "controller.h" ++ ++static int32_t icmp_has_protocol(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int32_t protocol_type) ++{ ++ return 0; ++} ++ ++static const struct protocol_field icmp_protocol_fields[] = { ++ /* field name offset length getter setter */ ++ { "type", 0, 8, NULL, NULL }, ++ { "code", 8, 8, NULL, NULL }, ++ { "checksum", 16, 16, NULL, NULL }, ++ { "id", 32, 16, NULL, NULL }, ++ { "sequence", 48, 16, NULL, NULL }, ++ PROT_FIELD_SENTINEL, ++}; ++ ++static const struct protocol_buf icmp_protocol_buf = { ++ .is_dynamic = 0, ++ .name = LUA_PACKET_SEG_ICMP, ++ .payload_field = NULL, ++ .protocol_fields = (struct protocol_field *)&icmp_protocol_fields, ++ .has_protocol = &icmp_has_protocol, ++ .get_field_changes = NULL, ++}; ++ ++void luaopen_protbuf_icmp(lua_State *L) ++{ ++ register_protbuf(L, (struct protocol_buf *)&icmp_protocol_buf, PACKET_ICMP); ++} ++ +--- /dev/null ++++ b/extensions/LUA/prot_buf_ip.c +@@ -0,0 +1,209 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++ ++#if defined(__KERNEL__) ++ #include ++ #include ++#endif ++ ++#include "controller.h" ++ ++ ++#define IP_FMT "%u.%u.%u.%u" ++#define IP_ACC(buf) buf[0], buf[1], buf[2], buf[3] ++ ++ ++static int32_t ip_version_set(lua_State *L) ++{ ++ uint8_t version_checked; ++ lua_packet_segment * seg = checkpacketseg(L, 1, LUA_PACKET_SEG_IP); ++ uint8_t *version_seg = seg->start + seg->offset; ++ int32_t version = luaL_checkinteger(L, 2); ++ ++ luaL_argcheck(L, version >= 0 && version <= 15, 1, "version number invalid"); ++ ++ version_checked = (uint8_t)version; ++ ++ version_seg[0] &= (uint8_t)0x0F; /* reset version bits */ ++ version_seg[0] |= version_checked << 4; ++ ++ return 0; ++} ++static int32_t ip_version_get(lua_State *L) ++{ ++ lua_packet_segment * seg = checkpacketseg(L, 1, LUA_PACKET_SEG_IP); ++ uint8_t *version_seg = seg->start + seg->offset; ++ uint8_t v = version_seg[0] & 0xF0; ++ ++ v >>= 4; ++ ++ lua_pushinteger(L, v); ++ return 1; ++} ++ ++static int32_t ip_ihl_set(lua_State *L) ++{ ++ uint8_t ihl_checked; ++ lua_packet_segment * seg = checkpacketseg(L, 1, LUA_PACKET_SEG_IP); ++ uint8_t *ihl_seg = seg->start + seg->offset; ++ int32_t ihl = luaL_checkinteger(L, 2); ++ ++ luaL_argcheck(L, ihl >= 5 && ihl <= 15, 1, "ip header length invalid"); // RFC 791 5x32 = 160 bits ++ ++ ihl_checked = (uint8_t)ihl; ++ ++ ihl_seg[0] &= (uint8_t)0xF0; /* reset ihl bits */ ++ ihl_seg[0] |= ihl_checked; ++ ++ return 0; ++} ++static int32_t ip_ihl_get(lua_State *L) ++{ ++ lua_packet_segment * seg = checkpacketseg(L, 1, LUA_PACKET_SEG_IP); ++ uint8_t *ihl_seg = seg->start + seg->offset; ++ uint8_t v = ihl_seg[0] & 0x0F; ++ ++ lua_pushinteger(L, v); ++ return 1; ++} ++ ++static int32_t ip_addr_set(lua_State *L) ++{ ++ int32_t field_id = lua_tointeger(L, lua_upvalueindex(2)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, LUA_PACKET_SEG_IP); ++ uint8_t *addr_seg = seg->start + seg->offset; ++ uint32_t old_addr; ++ char *ip = (char *)luaL_checkstring(L, 2); ++ uint32_t a, b, c, d; ++ struct sk_buff * skb = (struct sk_buff *)lua_touserdata(L, 3); ++ ++ /* for tcp / udp checksumming*/ ++ uint32_t prot_offset; ++ uint8_t *check, *protocol_seg; ++ ++ /* end */ ++ ++ sscanf(ip, IP_FMT, &a, &b, &c, &d); ++ ++ luaL_argcheck(L, a < 256 && b < 256 && c < 256 && d < 256, 1, "invalid ip addr"); ++ ++ old_addr = *((uint32_t *)addr_seg); ++ addr_seg[0] = (uint8_t)a; ++ addr_seg[1] = (uint8_t)b; ++ addr_seg[2] = (uint8_t)c; ++ addr_seg[3] = (uint8_t)d; ++ ++#if defined(__KERNEL__) ++ if (old_addr != *(uint32_t *)addr_seg) { ++ int32_t offset = (field_id == 10) ? -2 : -6; /* offset from saddr or daddr */ ++ ++ csum_replace4((uint16_t *)(addr_seg + offset), old_addr, *(uint32_t *)addr_seg); ++ ++ prot_offset = (field_id == 10) ? -3 : -7; /* offset from saddr or daddr */ ++ protocol_seg = seg->start + seg->offset + prot_offset; ++ ++ if (skb && (protocol_seg[0] == 0x06 || protocol_seg[0] == 0x11)) { /* is payload TCP or UDP ? */ ++ ++ check = seg->start + seg->offset; /* tmp res */ ++ check += (field_id == 10) ? 8 : 16; /* the start of the payload, depending saddr or daddr */ ++ check += (protocol_seg[0] == 0x06) ? 16 : 6; /* the start of the checksum, depending on TCP or UDP */ ++ ++ inet_proto_csum_replace4((__sum16 *)check, skb, old_addr, *(uint32_t *)addr_seg, 1); ++ ++ lua_pop(L, 1); ++ } ++ } ++#endif ++ return 0; ++} ++ ++ ++ ++ ++ ++static int32_t ip_addr_get(lua_State *L) ++{ ++ lua_packet_segment * seg = checkpacketseg(L, 1, LUA_PACKET_SEG_IP); ++ uint8_t *addr_seg = seg->start + seg->offset; ++ ++ char buf[16]; /*max: 255.255.255.255\0 --> 16 chars */ ++ ++ sprintf(buf, IP_FMT, IP_ACC(addr_seg)); ++ lua_pushstring(L, buf); ++ return 1; ++} ++ ++static int32_t ip_has_protocol(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int32_t protocol_type) ++{ ++ uint8_t * embedded_protocol = seg->start + seg->offset + 9 /*bytes*/; ++ ++ switch (embedded_protocol[0]) { ++ case 0x01: /* 1: Internet Control Message Protocol (ICMP) */ ++ if (protocol_type == PACKET_ICMP) return 1; ++ break; ++ case 0x02: /* 2: Internet Group Management Protocol (IGMP) */ ++ break; ++ case 0x06: /* 6: Transmission Control Protocol (TCP) */ ++ if (protocol_type == PACKET_TCP) return 1; ++ break; ++ case 0x11: /* 17: User Datagram Protocol (UDP) */ ++ if (protocol_type == PACKET_UDP) return 1; ++ break; ++ case 0x59: /* 89: Open Shortest Path First (OSPF) */ ++ break; ++ case 0x84: /* 132: Stream Control Transmission Protocol (SCTP) */ ++ break; ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++static const struct protocol_field ip_protocol_fields[] = { ++ /* field name offset length getter setter */ ++ { "version", 0, 4, ip_version_get, ip_version_set }, ++ { "ihl", 4, 4, ip_ihl_get, ip_ihl_set }, ++ { "tos", 8, 8, get_8_bit_generic, set_8_bit_generic }, ++ { "tot_len", 16, 16, get_16_bit_generic, set_16_bit_generic }, ++ { "id", 32, 16, get_16_bit_generic, set_16_bit_generic }, ++ { "flags", 48, 3, get_1_bit_generic, set_1_bit_generic }, ++ { "frag_off", 51, 13, NULL, NULL }, ++ { "ttl", 64, 8, get_8_bit_generic, set_8_bit_generic }, ++ { "protocol", 72, 8, get_8_bit_generic, set_8_bit_generic }, ++ { "check", 80, 16, get_16_bit_generic, set_16_bit_generic }, ++ { "saddr", 96, 32, ip_addr_get, ip_addr_set }, ++ { "daddr", 128, 32, ip_addr_get, ip_addr_set }, ++ { "data", 160, 0, NULL, set_data_generic }, ++ PROT_FIELD_SENTINEL, ++}; ++ ++static const struct protocol_buf ip_protocol_buf = { ++ .is_dynamic = 0, ++ .name = LUA_PACKET_SEG_IP, ++ .payload_field = "data", ++ .protocol_fields = (struct protocol_field *)&ip_protocol_fields, ++ .has_protocol = &ip_has_protocol, ++ .get_field_changes = NULL, ++}; ++ ++void luaopen_protbuf_ip(lua_State *L) ++{ ++ register_protbuf(L, (struct protocol_buf *)&ip_protocol_buf, PACKET_IP); ++} ++ +--- /dev/null ++++ b/extensions/LUA/prot_buf_raw.c +@@ -0,0 +1,43 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++ ++#include "controller.h" ++static int32_t raw_has_protocol(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int32_t protocol_type) ++{ ++ return 1; ++} ++ ++static const struct protocol_field raw_protocol_fields[] = { ++ /* field name offset length getter setter */ ++ { "data", 0, 0, NULL, NULL }, ++ PROT_FIELD_SENTINEL, ++}; ++ ++static const struct protocol_buf raw_protocol_buf = { ++ .is_dynamic = 0, ++ .name = LUA_PACKET_SEG_RAW, ++ .payload_field = "data", ++ .protocol_fields = (struct protocol_field *)&raw_protocol_fields, ++ .has_protocol = &raw_has_protocol, ++ .get_field_changes = NULL, ++}; ++ ++void luaopen_protbuf_raw(lua_State *L) ++{ ++ register_protbuf(L, (struct protocol_buf *)&raw_protocol_buf, PACKET_RAW); ++} +--- /dev/null ++++ b/extensions/LUA/prot_buf_tcp.c +@@ -0,0 +1,188 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++ ++#if defined(__KERNEL__) ++ #include ++ #include ++#endif ++#include "controller.h" ++ ++ ++static int32_t tcp_has_protocol(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int32_t protocol_type) ++{ ++ return 1; ++} ++ ++static int32_t tcp_set_checksum(lua_State *L) ++{ ++ struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1)); ++ lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name); ++ ++#if defined(__KERNEL__) ++ uint8_t * check_seg = seg->start + seg->offset; ++ uint8_t * tcp_hdr = check_seg - 16; ++ uint8_t * saddr = tcp_hdr - 8; ++ uint8_t * daddr = saddr + 4; ++ uint32_t len = 20 + (seg->changes->field_length_changes[11] / 8) + (seg->changes->field_length_changes[10] / 8); ++ unsigned short checksum = tcp_v4_check(len, *(uint32_t *)saddr, *(uint32_t *)daddr, ++ csum_partial(tcp_hdr, len, 0)); ++ ++ memcpy(check_seg, &checksum, sizeof(unsigned short)); ++#endif ++ return 0; ++} ++ ++ ++static const struct protocol_field tcp_protocol_fields[] = { ++ /* field name offset length getter setter */ ++ { "sport", 0, 16, get_16_bit_generic, set_16_bit_generic }, ++ { "dport", 16, 16, get_16_bit_generic, set_16_bit_generic }, ++ { "seq", 32, 32, get_32_bit_generic, set_32_bit_generic }, ++ { "ack", 64, 32, get_32_bit_generic, set_32_bit_generic }, ++ { "data_off", 96, 4, get_lower_4_bit_generic, set_lower_4_bit_generic }, ++ { "reserved", 100, 4, get_upper_4_bit_generic, set_upper_4_bit_generic }, ++ { "flags", 104, 8, get_1_bit_generic, set_1_bit_generic }, ++ { "window_size", 112, 16, get_16_bit_generic, set_16_bit_generic }, ++ { "check", 128, 16, get_16_bit_generic, tcp_set_checksum }, ++ { "urgent", 144, 16, NULL, NULL }, ++ { "options", 160, 0, NULL, set_data_generic }, ++ { "data", 160, 0, NULL, set_data_generic }, /* begin of data depends on options */ ++ PROT_FIELD_SENTINEL, ++}; ++ ++ ++static const struct protocol_field tcp_options_and_data[] = { ++ /* field name offset length getter setter */ ++ { "MSS", 0, 16, get_16_bit_generic, set_16_bit_generic }, ++ { "WS", 0, 8, get_8_bit_generic, set_8_bit_generic }, ++ { "SACK", 0, 16, get_16_bit_generic, set_16_bit_generic }, ++ { "TSVAL", 0, 32, get_32_bit_generic, set_32_bit_generic }, ++ { "TSER", 0, 32, get_32_bit_generic, set_32_bit_generic }, ++ PROT_FIELD_SENTINEL, ++}; ++ ++ ++static struct field_changes * tcp_get_field_changes(lua_State *L, lua_packet_segment * seg); ++ ++static const struct protocol_buf tcp_protocol_buf = { ++ .is_dynamic = 0, ++ .name = LUA_PACKET_SEG_TCP, ++ .payload_field = "data", ++ .protocol_fields = (struct protocol_field *)&tcp_protocol_fields, ++ .has_protocol = &tcp_has_protocol, ++ .get_field_changes = &tcp_get_field_changes, ++}; ++ ++ ++static struct field_changes * tcp_options_get_field_changes(lua_State *L, lua_packet_segment * seg); ++ ++static const struct protocol_buf tcp_options_and_data_buf = { ++ .is_dynamic = 0, ++ .name = LUA_PACKET_SEG_TCP_OPT, ++ .payload_field = NULL, ++ .protocol_fields = (struct protocol_field *)&tcp_options_and_data, ++ .has_protocol = NULL, ++ .get_field_changes = &tcp_options_get_field_changes, ++}; ++ ++struct field_changes * tcp_get_field_changes(lua_State *L, lua_packet_segment * seg) ++{ ++ /* depending on the value stored inside the 'data_off'-field, the length of ++ * the 'options' field has to be changed, as well as the length and offset ++ * of the 'data' field */ ++ uint8_t *tcp_hdr = seg->start + seg->offset; ++ ++ /* get the pointer to the 'data_off' field */ ++ uint8_t * data_off_field = tcp_hdr + 12; /* 12 bytes offset */ ++ /* extract the stored header length in bits */ ++ uint32_t tcp_hdr_len = ((*(uint8_t *)data_off_field) >> 4) * 32; ++ ++ /* get an allocated 'field_changes' structure */ ++ struct field_changes * changes = get_allocated_field_changes(L, 12); ++ ++ /* depending on the tcp header length, change the length of the options*/ ++ changes->field_length_changes[10] = tcp_hdr_len - 160; ++ /* depending on the options length, change the offset of the data */ ++ changes->field_offset_changes[11] = changes->field_length_changes[10]; ++ changes->field_length_changes[11] = (seg->length * 8) - tcp_hdr_len; ++ ++ return changes; ++ ++} ++ ++struct field_changes * tcp_options_get_field_changes(lua_State *L, lua_packet_segment * seg) ++{ ++ /* depending on the value stored inside the 'data_off'-field, the length of ++ * the 'options' field has to be changed, as well as the length and offset ++ * of the 'data' field */ ++ uint8_t *tcp_opt_hdr = seg->start + seg->offset; ++ ++ /* get an allocated 'field_changes' structure */ ++ struct field_changes * changes = get_allocated_field_changes(L, 5); ++ ++ int32_t MSS = 0, WS = 0, SACK = 0, TS = 0, i; ++ ++ uint8_t b1, b2; ++ ++ for (i = 0; i < seg->length; i++) { ++ b1 = tcp_opt_hdr[i]; ++ b2 = tcp_opt_hdr[i + 1]; ++ ++ if (b1 == 0x00) ++ break; ++ ++ /* test for MSS */ ++ if (!MSS && (b1 == 0x02 && b2 == 0x04)) { ++ changes->field_offset_changes[0] = (i + 2) * CHAR_BIT; ++ MSS = 1; ++ } ++ ++ /* test for WS --- yet buggy somehow */ ++ if (!WS && (b1 == 0x03 && b2 == 0x03)) { ++ changes->field_offset_changes[1] = (i + 2) * CHAR_BIT; ++ WS = 1; ++ } ++ ++ /* test for SACK*/ ++ if (!SACK && (b1 == 0x04 && b2 == 0x02)) { ++ changes->field_offset_changes[2] = i * CHAR_BIT; /* has no value */ ++ SACK = 1; ++ } ++ ++ /* test for TS */ ++ if (!TS && (b1 == 0x08 && b2 == 0x0A)) { ++ changes->field_offset_changes[3] = (i + 2) * CHAR_BIT; ++ changes->field_offset_changes[4] = (i + 2 + 4) * CHAR_BIT; ++ TS = 1; ++ } ++ } ++ ++ return changes; ++ ++} ++ ++void luaopen_protbuf_tcp(lua_State *L) ++{ ++ register_protbuf(L, (struct protocol_buf *)&tcp_protocol_buf, PACKET_TCP); ++} ++void luaopen_protbuf_tcp_options(lua_State *L) ++{ ++ register_protbuf(L, (struct protocol_buf *)&tcp_options_and_data_buf, PACKET_TCP_OPTIONS); ++} ++ ++ +--- /dev/null ++++ b/extensions/LUA/prot_buf_tftp.c +@@ -0,0 +1,87 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++#include "controller.h" ++ ++static const struct protocol_field tftp_protocol_fields[] = { ++ /* field name offset length getter setter */ ++ { "opcode", 0, 16, get_16_bit_generic, NULL}, ++ { "filename", 0, 0, get_string_generic, NULL}, ++ { "mode", 0, 0, get_string_generic, NULL}, ++ { "block_nr", 0, 16, get_16_bit_generic, NULL}, ++ { "data", 0, 0, NULL, NULL}, ++ PROT_FIELD_SENTINEL, ++}; ++ ++struct field_changes * tftp_get_field_changes(lua_State *L, lua_packet_segment * seg) ++{ ++ /* depending on the value stored inside the 'opcode'-field we have to change ++ * offsets and lengths */ ++ uint8_t *tftp_hdr = seg->start + seg->offset; ++ short opcode = ntohs(*((uint16_t *)tftp_hdr)); ++ /* get an allocated 'field_changes' structure */ ++ struct field_changes * changes = get_allocated_field_changes(L, 5); ++ switch (opcode) { ++ case 1: /* Read Request (RRQ) */ ++ /* setting offset and length of field 'filename' */ ++ changes->field_offset_changes[1] = sizeof(unsigned short) << 3; ++ changes->field_length_changes[1] = strlen((char *)tftp_hdr + sizeof(unsigned short)) << 3; ++ /* setting offset and length of field 'mode' */ ++ changes->field_offset_changes[2] = changes->field_offset_changes[1] + changes->field_length_changes[1]; ++ changes->field_length_changes[2] = strlen((char *)tftp_hdr + (changes->field_offset_changes[2] >> 3)); ++ break; ++ case 2: /* Write Request (WRQ) */ ++ /* setting offset and length of field 'filename' */ ++ changes->field_offset_changes[1] = sizeof(unsigned short) << 3; ++ changes->field_length_changes[1] = strlen((char *)tftp_hdr + sizeof(unsigned short)) << 3; ++ /* setting offset and length of field 'mode' */ ++ changes->field_offset_changes[2] = changes->field_offset_changes[1] + changes->field_length_changes[1]; ++ changes->field_length_changes[2] = strlen((char *)tftp_hdr + (changes->field_offset_changes[2] >> 3)); ++ break; ++ case 3: /* Data (DATA) */ ++ /* setting offset of field 'block_nr' */ ++ changes->field_offset_changes[3] = sizeof(unsigned short) << 3; ++ /* setting offset of field 'data' */ ++ changes->field_offset_changes[4] = changes->field_offset_changes[3] + (sizeof(unsigned short) << 3); ++ break; ++ case 4: /* Acknowledgment (ACK) */ ++ /* setting offset of field 'block_nr' */ ++ changes->field_offset_changes[3] = sizeof(unsigned short) << 3; ++ break; ++ case 5: /* Error (ERROR) */ ++ /* we don't care ... yet */ ++ break; ++ default: ++ break; ++ } ++ ++ return changes; ++} ++ ++static const struct protocol_buf tftp_protocol_buf = { ++ .is_dynamic = 0, ++ .name = LUA_PACKET_SEG_TFTP, ++ .payload_field = NULL, ++ .protocol_fields = (struct protocol_field *)&tftp_protocol_fields, ++ .has_protocol = NULL, /* we don't need it, since we don't provide a payload field */ ++ .get_field_changes = tftp_get_field_changes, ++}; ++ ++void luaopen_protbuf_tftp(lua_State *L) ++{ ++ register_protbuf(L, (struct protocol_buf *)&tftp_protocol_buf, PACKET_TFTP); ++} +--- /dev/null ++++ b/extensions/LUA/prot_buf_udp.c +@@ -0,0 +1,53 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++ ++#if defined(__KERNEL__) ++ #include ++#endif ++ ++#include "controller.h" ++ ++ ++static int32_t udp_has_protocol(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int32_t protocol_type) ++{ ++ return 1; ++} ++ ++static const struct protocol_field udp_protocol_fields[] = { ++ /* field name offset length getter setter */ ++ { "sport", 0, 16, get_16_bit_generic, set_16_bit_generic }, ++ { "dport", 16, 16, get_16_bit_generic, set_16_bit_generic }, ++ { "length", 32, 16, get_16_bit_generic, set_16_bit_generic }, ++ { "check", 48, 16, get_16_bit_generic, set_16_bit_generic }, ++ { "data", 64, 0, NULL, NULL }, ++ PROT_FIELD_SENTINEL, ++}; ++ ++static const struct protocol_buf udp_protocol_buf = { ++ .is_dynamic = 0, ++ .name = LUA_PACKET_SEG_UDP, ++ .payload_field = "data", ++ .protocol_fields = (struct protocol_field *)&udp_protocol_fields, ++ .has_protocol = &udp_has_protocol, ++ .get_field_changes = NULL, ++}; ++ ++void luaopen_protbuf_udp(lua_State *L) ++{ ++ register_protbuf(L, (struct protocol_buf *)&udp_protocol_buf, PACKET_UDP); ++} +--- /dev/null ++++ b/extensions/LUA/xt_LUA.h +@@ -0,0 +1,36 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++ ++#ifndef XT_LUA_H_ ++#define XT_LUA_H_ ++ ++#define MAX_FILENAME_SIZE 256 ++#define MAX_FUNCTION_SIZE 256 ++#define MAX_SCRIPT_SIZE 32768 ++#define LUA_STATE_ARRAY_SIZE 128 ++ ++/* the targetsize is stored in a u16, so max size of the xt_lua_tginfo cannot exceed 64K*/ ++struct xt_lua_tginfo { ++ char buf[MAX_SCRIPT_SIZE]; ++ char filename[MAX_FILENAME_SIZE]; ++ char function[MAX_FUNCTION_SIZE]; ++ __u64 script_size; ++ __u32 state_id; ++}; ++ ++#endif /* XT_LUA_H_ */ +--- /dev/null ++++ b/extensions/LUA/xt_LUA.mod.c +@@ -0,0 +1,69 @@ ++#include ++#include ++#include ++ ++MODULE_INFO(vermagic, VERMAGIC_STRING); ++ ++struct module __this_module ++__attribute__((section(".gnu.linkonce.this_module"))) = { ++ .name = KBUILD_MODNAME, ++ .init = init_module, ++#ifdef CONFIG_MODULE_UNLOAD ++ .exit = cleanup_module, ++#endif ++ .arch = MODULE_ARCH_INIT, ++}; ++ ++static const struct modversion_info ____versions[] ++__used ++__attribute__((section("__versions"))) = { ++ { 0xa3379c4b, "module_layout" }, ++ { 0x5cf97727, "xt_unregister_target" }, ++ { 0x9a1dfd65, "strpbrk" }, ++ { 0x56fb5417, "kmalloc_caches" }, ++ { 0x12da5bb2, "__kmalloc" }, ++ { 0xb85f3bbe, "pv_lock_ops" }, ++ { 0x349cba85, "strchr" }, ++ { 0xd0d8621b, "strlen" }, ++ { 0x79aa04a2, "get_random_bytes" }, ++ { 0x20000329, "simple_strtoul" }, ++ { 0x105e2727, "__tracepoint_kmalloc" }, ++ { 0xbf7e1481, "inet_proto_csum_replace4" }, ++ { 0x6c1ce5ce, "strcspn" }, ++ { 0x3c2c5af5, "sprintf" }, ++ { 0xe2d5255a, "strcmp" }, ++ { 0xe24d3a97, "jiffies_64" }, ++ { 0x2bc95bd4, "memset" }, ++ { 0x87fc9bcc, "kmem_cache_alloc_notrace" }, ++ { 0x11089ac7, "_ctype" }, ++ { 0x37befc70, "jiffies_to_msecs" }, ++ { 0x70d1f8f3, "strncat" }, ++ { 0xb72397d5, "printk" }, ++ { 0x42224298, "sscanf" }, ++ { 0x5152e605, "memcmp" }, ++ { 0xb6ed1e53, "strncpy" }, ++ { 0x1e6d26a8, "strstr" }, ++ { 0xc3fa6a59, "memchr" }, ++ { 0x61651be, "strcat" }, ++ { 0x7d8c0d13, "xt_register_target" }, ++ { 0x8ff4079b, "pv_irq_ops" }, ++ { 0x93fca811, "__get_free_pages" }, ++ { 0xf0fdf6cb, "__stack_chk_fail" }, ++ { 0xbbe2391b, "kfree_skb" }, ++ { 0xf333a2fb, "_raw_spin_lock_irq" }, ++ { 0x37a0cba, "kfree" }, ++ { 0x2e60bace, "memcpy" }, ++ { 0x59e7cb79, "skb_make_writable" }, ++ { 0xb742fd7, "simple_strtol" }, ++ { 0x7d50a24, "csum_partial" }, ++ { 0xc2d711e1, "krealloc" }, ++ { 0xe914e41e, "strcpy" }, ++}; ++ ++static const char __module_depends[] ++__used ++__attribute__((section(".modinfo"))) = ++"depends=x_tables"; ++ ++ ++MODULE_INFO(srcversion, "33A1481C4AA71D1B5A8CA8A"); +--- /dev/null ++++ b/extensions/LUA/xt_LUA_target.c +@@ -0,0 +1,286 @@ ++/* ++ * Copyright (C) 2010 University of Basel ++ * by Andre Graf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include "xt_LUA.h" ++ ++#include "controller.h" ++ ++/*::* ++ * lua_envs ++ * ---------- ++ * This array holds a defined number of `lua_envs`_ structures. ++ * The used array index is also used as the Lua state identifier. ++ * The size of the array is defined in `LUA_STATE_ARRAY_SIZE`_. ++ */ ++struct lua_env * lua_envs[LUA_STATE_ARRAY_SIZE]; ++ ++/*::* ++ * lua_state_refs ++ * -------------- ++ * This array holds the reference counts of the several `lua_nf_state`_s ++ * which are stored inside the array `lua_states`_. ++ */ ++uint32_t lua_state_refs[LUA_STATE_ARRAY_SIZE] = { 0 }; ++ ++/*::* ++ * lua_tg ++ * ------ ++ * This function is called whenever a packet matches all matching conditions ++ * inside a rule. It is the target. It extracts the state identifier comming ++ * inside the *xt_target_param* structure and uses it to access the proper ++ * Lua state inside the `lua_states`_ array. ++ * ++ * It then constructs a new Lua userdata of type *lua_packet_segment* and ++ * initializes it with the lowest network header available. This userdata ++ * is annotated with the Lua metatable `LUA_PACKET_SEG_RAW`_ which converts ++ * the userdata to a raw lua packet having all raw functions available. ++ * This raw packet is the single parameter to the Lua function *process_packet* ++ * which must be defined inside the Lua script provided by the user. So far ++ * hardcoded, may be later configured by Lua - subject to change. ++ * ++ * The process_packet function must return an integer value, the verdict. For ++ * convenience reasons xt_LUA exports the verdicts NF_ACCEPT, NF_DROP and ++ * XT_CONTINUE inside the *register_lua_packet_lib* function. ++ */ ++ ++spinlock_t lock = SPIN_LOCK_UNLOCKED; ++ ++static uint32_t ++lua_tg(struct sk_buff *pskb, const struct xt_target_param *par) ++{ ++ uint32_t verdict; ++ lua_packet_segment *p; ++ const struct xt_lua_tginfo *info = par->targinfo; ++ lua_State * L; ++ ++ /* START critical section on SMP, PacketScript is on the sequential trail at the moment TODO*/ ++ spin_lock_irq(&lock); ++ ++ L = lua_envs[info->state_id]->L; ++ ++ if (!skb_make_writable(pskb, pskb->len)) ++ return NF_DROP; ++ ++ /* call the function provided by --function parameter or the default 'process_packet' defined in Lua */ ++ lua_getglobal(L, info->function); ++ ++ /* push the lua_packet_segment as a parameter */ ++ p = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment)); ++ if (pskb->mac_header) ++ p->start = pskb->mac_header; ++ else if (pskb->network_header) ++ p->start = pskb->network_header; ++ else if (pskb->transport_header) ++ p->start = pskb->transport_header; ++ p->offset = 0; ++ p->length = (unsigned long)pskb->tail - (unsigned long)p->start; ++ p->changes = NULL; ++ ++ /* marking userdata 'lua_packet_seg' with the corresponding metatable */ ++ luaL_getmetatable(L, LUA_PACKET_SEG_RAW); ++ lua_setmetatable(L, -2); ++ ++ /* push a reference to the skb as a parameter, needed at the moment for calculating TCP checksum, but I am not happy with it*/ ++ lua_pushlightuserdata(L, (void *)skb_get(pskb)); ++ ++ /* do the function call (2 argument, 1 result) */ ++ if (lua_pcall(L, 2, 1, 0) != 0) { ++ printk(KERN_ERR "LUA [%d]: pcall '%s' failed: %s\n", info->state_id, info->function, lua_tostring(L, -1)); ++ lua_pop(L, 1); ++ return NF_DROP; ++ } ++ ++ if (!lua_isnumber(L, -1)) { ++ printk(KERN_ERR "LUA [%d]: function '%s' must return a verdict\n", info->state_id, info->function); ++ lua_pop(L, 1); ++ return NF_DROP; ++ } ++ ++ verdict = lua_tonumber(L, -1); ++ lua_pop(L, 1); ++ ++ kfree_skb(pskb); ++ ++ /* END critical section on SMP */ ++ spin_unlock_irq(&lock); ++ ++ ++ return verdict; ++ ++} ++/* Helper for checkentry */ ++static bool load_script_into_state(uint32_t state_id, unsigned long script_size, char *script_buf) ++{ ++ char *buf = kmalloc(script_size, GFP_KERNEL); ++ int32_t ret; ++ struct lua_env * env = kmalloc(sizeof(struct lua_env), GFP_KERNEL); ++ ++ if (!script_size > 0) { ++ pr_debug("LUA [%d]: script_size %lu < 0\n", state_id, script_size); ++ return false; ++ } ++ ++ env->L = lua_open(); ++ luaopen_base(env->L); ++ luaopen_controller(env->L); ++ ++ lua_getglobal(env->L, "_G"); ++ lua_pushinteger(env->L, state_id); ++ lua_setfield(env->L, -2, "STATE_ID"); ++ lua_pop(env->L, 1); /* pop _G */ ++ ++ strncpy(buf, script_buf, script_size); ++ ret = luaL_loadbuffer(env->L, buf, script_size, "PacketScript, loadbuffer") || ++ lua_pcall(env->L, 0, 1, 0); ++ ++ if (ret != 0) { ++ printk(KERN_ERR "LUA [%d]: failure loading script, error %s \n", state_id, lua_tostring(env->L, -1)); ++ lua_pop(env->L, 1); ++ kfree(buf); ++ kfree(env); ++ return false; ++ } ++ ++ lua_envs[state_id] = env; ++ ++ kfree(buf); ++ ++ return true; ++} ++/*::* ++ * lua_tg_checkentry ++ * ----------------- ++ * This function is used as a kernel-side sanity check of the data comming ++ * from the iptables userspace program. Since this is the function which is ++ * called everytime a new rule (with -j xt_LUA) is injected, this function ++ * is used to do the bookkeeping work, such as counting the reference of ++ * several Lua states and the initialization of new states if needed. As an ++ * extra initialization step it loads the provided Lua script into the Lua ++ * state. ++ * ++ * Lua state initialization ++ * ~~~~~~~~~~~~~~~~~~~~~~~~ ++ * 1. If a new rule is inserted and there is no existing state for the given ++ * state identifier (default state identifier is 0) a new Lua state is ++ * initialized using *lua_open*. ++ * 2. The Lua base library is registered inside the newly initialized state. ++ * Have a look at *lua/lbaselib.c* to see what functions of the Lua base ++ * library are available inside Lua. ++ * 3. The Lua packet library is registered inside the Lua state using the ++ * function *register_lua_packet_lib*. So far this function only registers ++ * the Netfilter verdicts NF_ACCEPT, NF_DROP and XT_CONTINUE inside the ++ * global environment of the given Lua state. ++ * 4. All the protocol Buffers, and the functions for accessing the bytes are ++ * registered using *register_protocols*. ++ * ++ * Lua state reference counting ++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ * Bookkeeping of the Lua states inside the *lua_state_refs* array. The ++ * state identifier is mapped to the array index, which holds an integer ++ * counting the several initialized states. ++ * ++ * Loading the Lua script ++ * ~~~~~~~~~~~~~~~~~~~~~~ ++ * Copying the buffer which was initialized by the userspace program to a ++ * buffer with the proper size. The script is then loaded by the function ++ * xt_LUA_loadcode, which wrapps the *luaL_loadbuffer* function and does ++ * some workqueue initialization. So far this is done each time this function ++ * is called, subject to change. ++ */ ++static bool ++lua_tg_checkentry(const struct xt_tgchk_param *par) ++{ ++ const struct xt_lua_tginfo *info = par->targinfo; ++ ++ if (load_script_into_state(info->state_id, info->script_size, (char *)info->buf)) { ++ lua_state_refs[info->state_id]++; ++ return true; ++ } ++ return false; ++} ++ ++/*::* ++ * lua_tg_destroy ++ * -------------- ++ * This function is the counterpart of the `lua_tg_checkentry`_ function. It is ++ * responsible to free all the resources alocated inside the checkentry process. ++ * To be more specific it frees the Lua state using *lua_close* and kfree on all ++ * the dynamically allocated pointers to the registered dynamic protocol buffers. ++ * ++ * Additionally the function cares about decrementing the reference counters ++ * inside the array `lua_states`_. ++ */ ++static void ++lua_tg_destroy(const struct xt_tgdtor_param *par) ++{ ++ const struct xt_lua_tginfo *info = par->targinfo; ++ struct lua_env * env = lua_envs[info->state_id]; ++ ++ if (lua_state_refs[info->state_id] == 1) { ++ lua_close(env->L); ++ cleanup_dynamic_prot_bufs(); /* clean memory allocated by protocols defined in Lua */ ++ kfree(env); ++ pr_debug("LUA [%d]: Rule removed, close Lua state\n", info->state_id); ++ } else ++ pr_debug("LUA [%d]: Rule removed, Lua state stays open, referenced %d time(s)\n", ++ info->state_id, lua_state_refs[info->state_id] - 1); ++ ++ lua_state_refs[info->state_id]--; ++} ++ ++static struct xt_target lua_tg_reg __read_mostly = { ++ .name = "LUA", ++ .revision = 0, ++ .family = NFPROTO_UNSPEC, ++ .targetsize = XT_ALIGN(sizeof(struct xt_lua_tginfo)), ++ .target = lua_tg, ++ .checkentry = lua_tg_checkentry, ++ .destroy = lua_tg_destroy, ++ .me = THIS_MODULE, ++}; ++ ++ ++static int32_t lua_tg_init(void) ++{ ++ return xt_register_target(&lua_tg_reg); ++} ++ ++static void lua_tg_exit(void) ++{ ++ xt_unregister_target(&lua_tg_reg); ++} ++ ++module_init(lua_tg_init); ++module_exit(lua_tg_exit); ++ ++MODULE_AUTHOR("Andre Graf "); ++MODULE_DESCRIPTION("Xtables: Processing of matched packets using the Lua scripting environment"); ++MODULE_ALIAS("ipt_LUA"); ++MODULE_ALIAS("ipt6t_LUA"); ++MODULE_ALIAS("arpt_LUA"); ++MODULE_ALIAS("ebt_LUA"); ++MODULE_LICENSE("GPL"); ++ ++ ++ +--- a/extensions/Kbuild ++++ b/extensions/Kbuild +@@ -34,6 +34,7 @@ obj-${build_pknock} += pknock/ + obj-${build_psd} += xt_psd.o + obj-${build_quota2} += xt_quota2.o + obj-${build_rtsp} += rtsp/ ++obj-${build_LUA} += LUA/ + + -include ${M}/*.Kbuild + -include ${M}/Kbuild.* +--- a/extensions/Mbuild ++++ b/extensions/Mbuild +@@ -26,3 +26,4 @@ obj-${build_pknock} += pknock/ + obj-${build_psd} += libxt_psd.so + obj-${build_quota2} += libxt_quota2.so + obj-${build_gradm} += libxt_gradm.so ++obj-${build_LUA} += LUA/ +--- a/mconfig ++++ b/mconfig +@@ -27,3 +27,4 @@ build_pknock=m + build_psd=m + build_quota2=m + build_rtsp=m ++build_LUA=m diff --git a/net/xtables-addons/patches/201-fix-lua-packetscript.patch b/net/xtables-addons/patches/201-fix-lua-packetscript.patch new file mode 100644 index 0000000..06a4a17 --- /dev/null +++ b/net/xtables-addons/patches/201-fix-lua-packetscript.patch @@ -0,0 +1,89 @@ +--- a/extensions/LUA/xt_LUA_target.c ++++ b/extensions/LUA/xt_LUA_target.c +@@ -64,10 +64,10 @@ uint32_t lua_state_refs[LUA_STATE_ARRAY + * XT_CONTINUE inside the *register_lua_packet_lib* function. + */ + +-spinlock_t lock = SPIN_LOCK_UNLOCKED; ++DEFINE_SPINLOCK(lock); + + static uint32_t +-lua_tg(struct sk_buff *pskb, const struct xt_target_param *par) ++lua_tg(struct sk_buff *pskb, const struct xt_action_param *par) + { + uint32_t verdict; + lua_packet_segment *p; +@@ -208,16 +208,16 @@ static bool load_script_into_state(uint3 + * some workqueue initialization. So far this is done each time this function + * is called, subject to change. + */ +-static bool ++static int + lua_tg_checkentry(const struct xt_tgchk_param *par) + { + const struct xt_lua_tginfo *info = par->targinfo; + + if (load_script_into_state(info->state_id, info->script_size, (char *)info->buf)) { + lua_state_refs[info->state_id]++; +- return true; ++ return 0; + } +- return false; ++ return -EINVAL; + } + + /*::* +--- a/extensions/LUA/lua/llimits.h ++++ b/extensions/LUA/lua/llimits.h +@@ -8,7 +8,6 @@ + #define llimits_h + + #include +-#include + + #include "lua.h" + +--- a/extensions/LUA/lua/lapi.c ++++ b/extensions/LUA/lua/lapi.c +@@ -4,9 +4,6 @@ + ** See Copyright Notice in lua.h + */ + +-#include +-#include +-#include + #include + + #define lapi_c +--- a/extensions/LUA/lua/ltable.c ++++ b/extensions/LUA/lua/ltable.c +@@ -18,7 +18,6 @@ + ** Hence even when the load factor reaches 100%, performance remains good. + */ + +-#include + #include + + #define ltable_c +--- a/extensions/LUA/lua/luaconf.h ++++ b/extensions/LUA/lua/luaconf.h +@@ -13,6 +13,10 @@ + #if !defined(__KERNEL__) + #include + #else ++#undef UCHAR_MAX ++#undef SHRT_MAX ++#undef BUFSIZ ++#undef NO_FPU + #define UCHAR_MAX 255 + #define SHRT_MAX 32767 + #define BUFSIZ 8192 +@@ -637,6 +641,8 @@ union luai_Cast { double l_d; long l_l; + */ + #if defined(__KERNEL__) + #undef LUA_USE_ULONGJMP ++#define setjmp __builtin_setjmp ++#define longjmp __builtin_longjmp + #endif + + #if defined(__cplusplus) diff --git a/net/yaddns/Makefile b/net/yaddns/Makefile new file mode 100644 index 0000000..0f3d8b1 --- /dev/null +++ b/net/yaddns/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2006-2012 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:=yaddns +PKG_VERSION:=1.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.gna.org/yaddns/ +PKG_MD5SUM:=d8b6ed9bed61dabaa17188d831e352d1 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/yaddns + SECTION:=net + CATEGORY:=Network + DEPENDS:=+USE_EGLIBC:librt + SUBMENU:=IP Addresses and Names + TITLE:=Yet Another DDNS client + URL:=http://patatrac.info/yaddns +endef + +define Package/yaddns/description +Yaddns is a small ddns client with multiple ddns server supports (dyndns, ...) +and a high flexibility. Yaddns is particularly appropriate for embedded systems. +endef + +define Package/yaddns/conffiles +/etc/config/ddns +endef + +define Package/yaddns/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/yaddns $(1)/usr/bin/ + $(CP) ./files/* $(1)/ +endef + +$(eval $(call BuildPackage,yaddns)) diff --git a/net/yaddns/files/etc/config/ddns b/net/yaddns/files/etc/config/ddns new file mode 100644 index 0000000..2fac1de --- /dev/null +++ b/net/yaddns/files/etc/config/ddns @@ -0,0 +1,67 @@ +################################################################# +# In order to enable dynamic dns you need at least one section, and in that +# seciton the "enabled" option must be set to one +# +# Each section represents an update to a different service +# +# You specify your domain name, your username and your password with the optins +# "domain", "username" and "password" respectively +# +# Next you need to specify the name of the service you are connecting to "eg. +# dyndns". The list of the available dns services is specified in the +# /usr/lib/ddns/services file. +# +# We also need to specify the source of the ip address to associate with your +# domain. The "ip_source" option can be "network", "interface" or "web", with +# "network" as the default. +# +# If "ip_source" is "network" you specify a network section in your +# /etc/network config file (e.g. "wan", which is the default) with the +# "ip_network" option. If you specify "wan", you will update with whatever the +# ip for your wan is. +# +# If "ip_source" is "interface" you specify a hardware interface (e.g. "eth1") +# and whatever the current ip of this interface is will be associated with the +# domain when an update is performed. +# +# If "ip_source" is "script" you specify a script to obtain ip address. The +# "ip_script" option should contain path to your script. +# +# The last possibility is that "ip_source" is "web", which means that in order +# to obtain our ip address we will connect to a website, and the first valid ip +# address listed on that page will be assumed to be ours. If you are behind +# another firewall this is the best option since none of the local networks or +# interfaces will have the external ip. The website to connect to is specified +# by the "ip_url" option. +# +# Finally we need to specify how often to check whether we need to check +# whether the ip address has changed (and if so update it), this is only valid +# for the "web" method. Use the "check_interval" to specify how often to check +# whether an update is necessary. Specify the units for this value with the +# "check_unit" option. Units can be "days", "hours", "minutes" or "seconds". +# The default check_interval is 600 seconds, or ten minutes. +# +# For yaddns all ip_* options are system-wide and are taken from the first +# enabled section. +# +######################################################### + +config service "myddns" + option enabled "0" + + option service_name "dyndns" + option domain "mypersonaldomain.dyndns.org" + option username "myusername" + option password "mypassword" + + #option ip_source "network" + #option ip_network "wan" + + #option ip_source "interface" + #option ip_interface "eth0.1" + + option ip_source "web" + option ip_url "http://checkip.dyndns.org" + option check_interval "10" + option check_unit "minutes" + diff --git a/net/yaddns/files/etc/hotplug.d/iface/25-ddns b/net/yaddns/files/etc/hotplug.d/iface/25-ddns new file mode 100644 index 0000000..2aefc18 --- /dev/null +++ b/net/yaddns/files/etc/hotplug.d/iface/25-ddns @@ -0,0 +1,115 @@ +#!/bin/sh + +YADDNS_CONF=/tmp/yaddns.conf +YADDNS_PID=/var/run/yaddns.pid + +prepare_yaddns_conf () +{ + . /lib/functions.sh + . /lib/functions/network.sh + + > $YADDNS_CONF + + SECTIONS="" + config_cb() + { + SECTIONS="$SECTIONS $2" + } + config_load "ddns" + + for section in $SECTIONS; do + config_get enabled $section enabled + if [ "$enabled" = "1" ]; then + if [ -z "$header_filled" ]; then + config_get ip_source $section ip_source + #if ip source is not defined, assume we want to get ip from wan + if [ "$ip_source" != "interface" ] && [ "$ip_source" != "web" ]; then + ip_source="network" + fi + if [ "$ip_source" = "interface" ]; then + config_get ip_interface $section ip_interface + fi + if [ "$ip_source" = "network" ]; then + if [ -z "$ip_network" ]; then + ip_network="wan" + fi + network_get_device ip_interface $ip_network + fi + if [ "$ip_source" = "web" ]; then + config_get ip_url $section ip_url + config_get check_interval $section check_interval + config_get check_unit $section check_unit + if [ -z "$check_interval" ]; then + check_interval=600 + fi + if [ -z "$check_unit" ]; then + check_unit="seconds" + fi + if [ -z "$ip_url" ]; then + ip_url="http://checkip.dyndns.org/" + fi + case "$check_unit" in + "days" ) + check_interval_seconds=$(($check_interval*60*60*24)) + ;; + "hours" ) + check_interval_seconds=$(($check_interval*60*60)) + ;; + "minutes" ) + check_interval_seconds=$(($check_interval*60)) + ;; + "seconds" ) + check_interval_seconds=$check_interval + ;; + * ) + #default is hours + check_interval_seconds=$(($check_interval*60*60)) + ;; + esac + myip_host="`echo $ip_url | sed 's%.*//\([^:/]*\).*%\1%'`" + myip_port="`echo $ip_url | sed -n 's%.*//[^:]*:\([0-9]\+\).*%\1%; t m; b; :m p'`" + if [ -z "$myip_port" ]; then + myip_port=80 + fi + myip_path="`echo $ip_url | sed 's%.*//[^/]*\(.*\)%\1%'`" + if [ -z "$myip_path" ]; then + myip_path="/" + fi + echo mode = \"indirect\" >> $YADDNS_CONF + echo myip_host = \"$myip_host\" >> $YADDNS_CONF + echo myip_path = \"$myip_path\" >> $YADDNS_CONF + echo myip_port = \"$myip_port\" >> $YADDNS_CONF + echo myip_upint = \"$check_interval_seconds\" >> $YADDNS_CONF + else + echo mode = \"direct\" >> $YADDNS_CONF + echo wanifname = \"$ip_interface\" >> $YADDNS_CONF + fi + echo >> $YADDNS_CONF + header_filled=1 + fi + config_get service_name $section service_name + config_get domain $section domain + config_get username $section username + config_get password $section password + echo account \{ >> $YADDNS_CONF + echo -e '\tname = '\"$section\" >> $YADDNS_CONF + echo -e '\tservice = '\"$service_name\" >> $YADDNS_CONF + echo -e '\tusername = '\"$username\" >> $YADDNS_CONF + echo -e '\tpassword = '\"$password\" >> $YADDNS_CONF + echo -e '\thostname = '\"$domain\" >> $YADDNS_CONF + echo \} >> $YADDNS_CONF + fi + done +} + +if [ "$INTERFACE" = "wan" ] && [ "$ACTION" = "ifup" ] +then + prepare_yaddns_conf + pid=`pidof yaddns` + if [ -z "$pid" ]; then + yaddns -f $YADDNS_CONF -p $YADDNS_PID -D + else + kill -HUP $pid + fi +fi + diff --git a/net/yaddns/files/usr/lib/ddns/services b/net/yaddns/files/usr/lib/ddns/services new file mode 100644 index 0000000..0bed6e1 --- /dev/null +++ b/net/yaddns/files/usr/lib/ddns/services @@ -0,0 +1,5 @@ +"changeip" +"dyndns" +"dyndnsit" +"no-ip" +"ovh" diff --git a/net/yafc/Makefile b/net/yafc/Makefile new file mode 100644 index 0000000..f440f2b --- /dev/null +++ b/net/yafc/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=yafc +PKG_VERSION:=1.1.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=832d074183a36ee15b47553ed5962fce + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=autogen.sh aclocal.m4 + +include $(INCLUDE_DIR)/package.mk + +define Package/yafc + SUBMENU:=File Transfer + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libncurses +libreadline + TITLE:=Yafc is yet another ftp client. + URL:=http://yafc.sourceforge.net/ +endef + +# uses GNU configure +CONFIGURE_ARGS += \ + --with-socks=no \ + --with-socks5=no \ + --with-krb4=no \ + --with-krb5=no \ + --with-gssapi=no + +CONFIGURE_VARS += \ + bash_cv_func_sigsetjmp=missing + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +define Package/yafc/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/src/yafc $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,yafc)) diff --git a/net/yate/Makefile b/net/yate/Makefile new file mode 100644 index 0000000..5c74f29 --- /dev/null +++ b/net/yate/Makefile @@ -0,0 +1,276 @@ +# +# Copyright (C) 2006-2011 OpenWrt.org +# Copyright (C) 2006-2011 SMBPhone +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +RELEASEVER:=3.2.0 + +PKG_NAME:=yate +PKG_VERSION:=$(RELEASEVER)-1 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://yate.null.ro/tarballs/yate3/ +PKG_MD5SUM:=8ef5f0c420cb41ad2b5828fdba28c4ee +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/$(PKG_NAME)/Default + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + URL:=http://yate.null.ro/ + MAINTAINER:=Daniel Dickinson +endef + +define Package/$(PKG_NAME) + $(call Package/yate/Default) + DEPENDS:=+libpthread +uclibcxx + TITLE:=Yet Another Telphony Engine + MENU:=1 +endef + +define Package/$(PKG_NAME)/conffiles +/etc/yate/yate.conf +endef + +define Package/$(PKG_NAME)/Default/description + Is a next-generation telephony engine focused on the VoIP and PSTN. It does + SIP, H.323, IAX, PSTN, and more. +endef + +define Package/$(PKG_NAME)-scripts-php + $(call Package/yate/Default) + DEPENDS += $(PKG_NAME) $(PKG_NAME)-mod-extmodule +php5 +php5-cli + TITLE:= PHP Scripts and script libraries for Yate +endef + +define Package/$(PKG_NAME)-scripts-perl + $(call Package/yate/Default) + DEPENDS += $(PKG_NAME) $(PKG_NAME)-mod-extmodule +microperl + TITLE:= Perl module for Yate +endef + +define Package/$(PKG_NAME)-scripts-python + $(call Package/yate/Default) + DEPENDS += $(PKG_NAME) $(PKG_NAME)-mod-extmodule +python-mini + TITLE:= Python module for Yate +endef + +define Package/$(PKG_NAME)-sounds + $(call Package/yate/Default) + DEPENDS += $(PKG_NAME) + TITLE := Sounds for Yate +endef + +define Package/$(PKG_NAME)-collection-basic + $(call Package/yate/Default) + DEPENDS += $(PKG_NAME) \ + +$(PKG_NAME)-sounds \ + +$(PKG_NAME)-mod-dumbchan \ + +$(PKG_NAME)-mod-regfile \ + +$(PKG_NAME)-mod-regexroute \ + +$(PKG_NAME)-mod-rmanager \ + +$(PKG_NAME)-mod-tonegen \ + +$(PKG_NAME)-mod-yrtpchan \ + +$(PKG_NAME)-mod-ysipchan + TITLE := Basic Yate Server +endef + +TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include $(if $(CONFIG_BIG_ENDIAN),-DBIGENDIAN,) + +CONFIGURE_ARGS+= \ + --without-libqt4 \ + --without-qtstatic \ + --without-pwlib \ + --without-coredumper \ + --without-doxygen \ + --without-kdoc \ + --with-spandsp="$(STAGING_DIR)/usr/include" \ + --with-libgsm="$(STAGING_DIR)/usr/include/gsm" \ + --with-mysql="$(STAGING_DIR)/usr" \ + --with-openssl="$(STAGING_DIR)/usr" \ + --with-libpq="$(STAGING_DIR)/usr" \ + --with-libspeex="$(STAGING_DIR)/usr/include/speex" \ + --with-zaptel="$(STAGING_DIR)/usr/include" \ + --with-zlib="$(STAGING_DIR)/usr" + +CONFIGURE_VARS+= \ + CFLAGS="$$$$CFLAGS -nostdinc++" \ + LDFLAGS="$$$$LDFLAGS -nodefaultlibs" \ + LIBS="-lc -luClibc++ -lpthread -lresolv -ldl -lm -lc $(LIBGCC_S)" + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/lib + + for yatelib in "" sig mgcp jabber; do \ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyate$$$${yatelib}.so.$(RELEASEVER) $(1)/usr/lib ;\ + $(LN) ./libyate$$$${yatelib}.so.$(RELEASEVER) $(1)/usr/lib/libyate$$$${yatelib}.so ;\ + done + + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/yate $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/yate/yate.conf $(1)/etc/$(PKG_NAME)/yate.conf +endef + +define Package/$(PKG_NAME)-scripts-php/install + $(INSTALL_DIR) $(1)/usr/share/yate/scripts + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/leavemail.php $(1)/usr/share/yate/scripts/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/queue_in.php $(1)/usr/share/yate/scripts/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/queue_out.php $(1)/usr/share/yate/scripts/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/route.php $(1)/usr/share/yate/scripts/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/voicemail.php $(1)/usr/share/yate/scripts/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/libvoicemail.php $(1)/usr/share/yate/scripts/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/libyatechan.php $(1)/usr/share/yate/scripts/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/libyateivr.php $(1)/usr/share/yate/scripts/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/libyate.php $(1)/usr/share/yate/scripts/ +endef + +define Package/$(PKG_NAME)-scripts-perl/install + $(INSTALL_DIR) $(1)/usr/share/yate/scripts + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/Yate.pm $(1)/usr/share/yate/scripts/ +endef + +define Package/$(PKG_NAME)-scripts-python/install + $(INSTALL_DIR) $(1)/usr/share/yate/scripts + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/libyate.py $(1)/usr/share/yate/scripts/ +endef + +define Package/$(PKG_NAME)-sounds/install + $(INSTALL_DIR) $(1)/usr/share/yate/sounds + $(CP) $(PKG_INSTALL_DIR)/usr/share/yate/sounds/ $(1)/usr/share/yate/ +endef + +define Package/$(PKG_NAME)-collection-basic/install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(STAGING_DIR)/usr/include/ + $(INSTALL_DIR) $(STAGING_DIR)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(STAGING_DIR)/usr/lib/ +endef + +define BuildPlugin + define Package/$(PKG_NAME)-mod-$(1) + $(call Package/yate/Default) + DEPENDS:= $(PKG_NAME) $(4) + TITLE:=$(3) + endef + + $(if $(PKG_BUILD_DIR)/conf.d/$(1).conf.sample, + define Package/$(PKG_NAME)-mod-$(1)/conffiles + /etc/yate/$(1).conf + endef + ,) + + define Package/$(PKG_NAME)-mod-$(1)/description + $(3) module for $(PKG_NAME) + endef + + define Package/$(PKG_NAME)-mod-$(1)/install + $$(INSTALL_DIR) $$(1)/usr/lib/yate/$(2) + $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/lib/yate/$(2)/$(1).yate $$(1)/usr/lib/yate/$(2)/$(1).yate + if [ -f $$(PKG_INSTALL_DIR)/etc/yate/$(1).conf ]; then \ + $$(INSTALL_DIR) $$(1)/etc/yate ;\ + $$(INSTALL_DATA) $$(PKG_INSTALL_DIR)/etc/yate/$(1).conf $$(1)/etc/yate/ ;\ + fi + $(if $(5),$(foreach extra_file,$(5),\ + $(INSTALL_DIR) $$(1)$(dir $(extra_file)) ; \ + $(CP) $(PKG_INSTALL_DIR)$(extra_file) $$(1)$(extra_file) ; \ + ),) + endef + + $$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(1))) +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) +$(eval $(call BuildPackage,$(PKG_NAME)-collection-basic)) +$(eval $(call BuildPackage,$(PKG_NAME)-scripts-php)) +$(eval $(call BuildPackage,$(PKG_NAME)-scripts-perl)) +$(eval $(call BuildPackage,$(PKG_NAME)-scripts-python)) +$(eval $(call BuildPackage,$(PKG_NAME)-sounds)) +$(eval $(call BuildPlugin,accfile,server,SIP or H.323 client (from file),)) +$(eval $(call BuildPlugin,alsachan,client,ALSA Sound Channel,+alsa-lib)) +$(eval $(call BuildPlugin,amrnbcodec,,AMR-NB Codec,@BROKEN)) # Missing amr-nb library +$(eval $(call BuildPlugin,analog,server,Analog (e.g. POTS) Channel,)) +$(eval $(call BuildPlugin,analogdetect,server,Analog Data Detector,)) +$(eval $(call BuildPlugin,analyzer,,Test Call Generator and AQ Analyzer,)) +$(eval $(call BuildPlugin,callcounters,server,Count Active Call Legs,)) +$(eval $(call BuildPlugin,callfork,,Call Forker,)) +$(eval $(call BuildPlugin,callgen,,Call Generator,)) +$(eval $(call BuildPlugin,ccongestion,server,Accept Status from Installed Engine Monitors,)) +$(eval $(call BuildPlugin,cdrbuild,,Call Detail Record Builder,)) +$(eval $(call BuildPlugin,cdrfile,,Call Detail Record to File,)) +$(eval $(call BuildPlugin,ciscosm,server,SS7 Support,)) +$(eval $(call BuildPlugin,clustering,server,Clustering Server Support,)) +$(eval $(call BuildPlugin,conference,,Conference Room Mixer,)) +$(eval $(call BuildPlugin,cpuload,server,Monitor CPU load and Inform Yate,)) +$(eval $(call BuildPlugin,dbpbx,server,PBX IVR and Multi-routing from Database,)) +$(eval $(call BuildPlugin,dbwave,server,Wav Media for DB Storage,+$(PKG_NAME)-mod-wavefile)) +$(eval $(call BuildPlugin,dumbchan,,Dummy Channel,)) +$(eval $(call BuildPlugin,enumroute,,ENUM Routing,)) +$(eval $(call BuildPlugin,extmodule,,External Module Handler,)) +$(eval $(call BuildPlugin,faxchan,,Spandsp Fax Channel,+libspandsp)) +$(eval $(call BuildPlugin,filetransfer,,File Transfer Driver,)) +$(eval $(call BuildPlugin,gsmcodec,,GSM Codec,+libgsm)) +$(eval $(call BuildPlugin,h323chan,,Open H.323 Channel,+libopenh323 @BROKEN)) # libopenh323 doesn't create package or stagin_dir includes or libs +$(eval $(call BuildPlugin,heartbeat,server,Linux-HA compatible heartbeat,)) +$(eval $(call BuildPlugin,ilbccodec,,iLBC Codec,)) +$(eval $(call BuildPlugin,isupmangler,server,ISUP paramter mangling in a STP,)) +$(eval $(call BuildPlugin,jabberclient,client,Jabber Client,)) +$(eval $(call BuildPlugin,jabberserver,jabber,Jabber Server,)) +$(eval $(call BuildPlugin,jbfeatures,jabber,Jabber Server Features,)) +$(eval $(call BuildPlugin,lateroute,server,Last Chance Routing,)) +$(eval $(call BuildPlugin,lksctp,server,SCTP sockets using linux kernel,@BROKEN)) # Missing libraries/header files +$(eval $(call BuildPlugin,mgcpca,server,Media Gateway Control Protocol Agent,)) +$(eval $(call BuildPlugin,mgcpgw,server,Media Gateway Control Protocol Gateway,)) +$(eval $(call BuildPlugin,moh,,On Hold (music) Generator,)) +$(eval $(call BuildPlugin,monitoring,server,Monitoring/gathering Information,)) +$(eval $(call BuildPlugin,mrcpspeech,server,MRCP v2 Voice/Tone Detector and Synthesizer,)) +$(eval $(call BuildPlugin,msgsniff,,Sample Message Sniffer,)) +$(eval $(call BuildPlugin,mux,,Data Multiplexor,)) +$(eval $(call BuildPlugin,mysqldb,server,MySQL Backend DB,+libmysqlclient-r)) +$(eval $(call BuildPlugin,openssl,,Encrypted transport (OpenSSL),+libopenssl)) +$(eval $(call BuildPlugin,osschan,client,OSS Sound Channel,)) +$(eval $(call BuildPlugin,park,server,Call Parking,)) +$(eval $(call BuildPlugin,pbx,,PBX Message Handlers,)) +$(eval $(call BuildPlugin,pbxassist,server,Full featured PBX and IVR,)) +$(eval $(call BuildPlugin,pgsqldb,server,PostgrestSQL Backend DB,+libpq)) +$(eval $(call BuildPlugin,presence,server,Presence,)) +$(eval $(call BuildPlugin,regfile,server,Registration based on users in file,)) +$(eval $(call BuildPlugin,queues,server,Call Distribution and Queues from Database,)) +$(eval $(call BuildPlugin,queuesnotify,server,Notify when queued call status changes,)) +$(eval $(call BuildPlugin,regexroute,,Regular Expression Based Routing,)) +$(eval $(call BuildPlugin,rmanager,,Yate Remote Management,)) +$(eval $(call BuildPlugin,sip_cnam_lnp,sip,Query CNAM and LNP databases using SIP INVITE,)) +$(eval $(call BuildPlugin,sigtransport,server,SIGTRAN (SS7 over IP) connection provider,)) +$(eval $(call BuildPlugin,sipfeatures,server,SIP Features (SUBSCRIBE/NOTIFY),)) +$(eval $(call BuildPlugin,speexcodec,,Speex Codec,+libspeex)) +$(eval $(call BuildPlugin,subscription,server,Subcription handler and presence notifier,)) +$(eval $(call BuildPlugin,tdmcard,server,TDM Cards Signalling and Data Driver,@BROKEN)) # Missing TDM libraries +$(eval $(call BuildPlugin,tonedetect,,Detectors for Various Tones,)) +$(eval $(call BuildPlugin,tonegen,,Tones Generator,)) +$(eval $(call BuildPlugin,users,server,Users,)) +$(eval $(call BuildPlugin,wavefile,,Wav file Record and Playback,)) +$(eval $(call BuildPlugin,wpcard,server,Wanpipe PRI cards Signalling and Data Driver,@BROKEN)) # Mising wanpipe and PRI libraries +$(eval $(call BuildPlugin,yiaxchan,,IAX Channel,)) +$(eval $(call BuildPlugin,yjinglechan,,Jingle Channel,)) +$(eval $(call BuildPlugin,yrtpchan,,RTP Channel and Other Data Helper,)) +$(eval $(call BuildPlugin,yradius,server,RADIUS Client,)) +$(eval $(call BuildPlugin,ysigchan,server,SS7/ISDN Protocols - Yate Signalling Library,)) +$(eval $(call BuildPlugin,ysipchan,,SIP Channel,)) +$(eval $(call BuildPlugin,ysockschan,,SOCKS Channel,)) +$(eval $(call BuildPlugin,ysnmpagent,server,SNMP Protocol Agent,,/usr/share/yate/data/NULL-TEAM-MIB.txt /usr/share/yate/data/snmp_mib.conf /usr/share/yate/data/YATE-MIB.txt)) +$(eval $(call BuildPlugin,ystunchan,,STUN Support,)) +$(eval $(call BuildPlugin,zapcard,server,Zaptel Card Signalling and Data Driver,+zaptel14-libtonezone)) +$(eval $(call BuildPlugin,zlibcompress,,Zlib Compression,+zlib)) diff --git a/net/yate/patches/100-add_dn_skipname_missing_from_many_libresolv.patch b/net/yate/patches/100-add_dn_skipname_missing_from_many_libresolv.patch new file mode 100644 index 0000000..bc61df0 --- /dev/null +++ b/net/yate/patches/100-add_dn_skipname_missing_from_many_libresolv.patch @@ -0,0 +1,111 @@ +--- a/engine/Makefile.in ++++ b/engine/Makefile.in +@@ -31,8 +31,9 @@ CLSOBJS := TelEngine.o ObjList.o HashLis + ENGOBJS := Configuration.o Message.o Engine.o Plugin.o + TELOBJS := DataFormat.o Channel.o + CLIOBJS := Client.o ClientLogic.o ++MISCOBJS := dn_skipname.o + +-LIBOBJS := $(CLSOBJS) $(ENGOBJS) $(TELOBJS) $(CLIOBJS) ++LIBOBJS := $(CLSOBJS) $(ENGOBJS) $(TELOBJS) $(CLIOBJS) $(MISCOBJS) + CLEANS = $(LIBOBJS) core + CCOMPILE = $(CC) $(DEFS) $(DEBUG) $(INCLUDES) $(CFLAGS) + COMPILE = $(CXX) $(DEFS) $(DEBUG) $(INCLUDES) $(CPPFLAGS) +@@ -109,6 +110,9 @@ String.o: @srcdir@/String.cpp $(MKDEPS) + regex.o: @top_srcdir@/engine/regex/regex.c $(MKDEPS) + $(CCOMPILE) -DSTDC_HEADERS $(REGEX_INC) -c $< + ++dn_skipname.o: @srcdir@/dn_skipname.c $(MKDEPS) ++ $(CCOMPILE) -DSTDC_HEADERS -c $< ++ + %.o: @srcdir@/%.cpp $(MKDEPS) $(EINC) + $(COMPILE) -c $< + +--- /dev/null ++++ b/engine/dn_skipname.c +@@ -0,0 +1,85 @@ ++/* Taken from patch by Natanael Copa for uClibc in message ++ * http://lists.busybox.net/pipermail/uclibc/2009-September/042971.html ++ * Turned into yate patch by Daniel Dickinson , Mar 11, 2011 ++*/ ++#include ++#include ++ ++/* taken from OpenBSD source */ ++/* ++ * Copyright (c) 1985, 1993 ++ * The Regents of the University of California. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. 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. ++ * - ++ * Portions Copyright (c) 1993 by Digital Equipment Corporation. ++ * ++ * Permission to use, copy, modify, and distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies, and that ++ * the name of Digital Equipment Corporation not be used in advertising or ++ * publicity pertaining to distribution of the document or software without ++ * specific, written prior permission. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL ++ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT ++ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL ++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR ++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS ++ * SOFTWARE. ++ */ ++ ++/* ++ * Skip over a compressed domain name. Return the size or -1. ++ */ ++int ++__dn_skipname(const u_char *comp_dn, const u_char *eom) ++{ ++ const u_char *cp; ++ int n; ++ ++ cp = comp_dn; ++ while (cp < eom && (n = *cp++)) { ++ /* ++ * check for indirection ++ */ ++ switch (n & INDIR_MASK) { ++ case 0: /* normal case, n == len */ ++ cp += n; ++ continue; ++ case INDIR_MASK: /* indirection */ ++ cp++; ++ break; ++ default: /* illegal type */ ++ return (-1); ++ } ++ break; ++ } ++ if (cp > eom) ++ return (-1); ++ return (cp - comp_dn); ++} diff --git a/net/znc/Makefile b/net/znc/Makefile new file mode 100644 index 0000000..8a2bfa0 --- /dev/null +++ b/net/znc/Makefile @@ -0,0 +1,292 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=znc +PKG_VERSION:=0.206 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://znc.in/releases \ + http://znc.in/releases/archive +PKG_MD5SUM:=b7d3f21da81abaeb553066b0e10beb53 + +PKG_BUILD_PARALLEL:=1 + + +define Package/znc/default + SUBMENU:=Instant Messaging + SECTION:=net + CATEGORY:=Network + TITLE:=ZNC + URL:=http://en.znc.in/ + MAINTAINER:=Jonas Gorski +endef + +define Package/znc + $(Package/znc/default) + DEPENDS:=+libopenssl $(CXX_DEPENDS) + MENU:=1 +endef + +define Package/znc/description + ZNC is an IRC bouncer with many advanced features like detaching, + multiple users, per channel playback buffer, SSL, IPv6, transparent DCC + bouncing, and c++ module support to name a few. +endef + +define Package/znc/conffiles +/etc/config/znc +endef + + +define Package/znc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/znc $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/znc.init $(1)/etc/init.d/znc + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/znc.conf $(1)/etc/config/znc + $(INSTALL_DIR) $(1)/usr/lib/znc/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/extra/droproot.so $(1)/usr/lib/znc/ +endef + + +ZNC_MODULES := +ZNC_MODULE_TARGETS := extra/droproot.so + +define module + define Package/znc-mod-$(strip $(1)) + $(Package/znc/default) + TITLE+= ($(strip $(1)) plugin) + DEPENDS:=znc + endef + + define Package/znc-mod-$(strip $(1))/description + $(strip $(2)) + endef + + define Package/znc-mod-$(strip $(1))/install + $(INSTALL_DIR) $$(1)/usr/lib/znc/ + $(INSTALL_BIN) $$(PKG_BUILD_DIR)/modules/$(strip $(3))$(subst -,_,$(strip $(1))).so $$(1)/usr/lib/znc/ + # include webadmin page templates if existing + if [ -d $$(PKG_BUILD_DIR)/modules/$(strip $(3))data/$(subst -,_,$(strip $(1))) ]; then \ + $(INSTALL_DIR) $$(1)/usr/share/znc/modules ;\ + $(CP) -r $$(PKG_BUILD_DIR)/modules/$(strip $(3))data/$(subst -,_,$(strip $(1))) $$(1)/usr/share/znc/modules ;\ + fi + endef + + ZNC_MODULES += znc-mod-$(strip $(1)) + $(if $(CONFIG_PACKAGE_znc-mod-$(strip $(1))),ZNC_MODULE_TARGETS += $(strip $(3))$(subst -,_,$(strip $(1))).so) +endef + +define webadmin + define Package/znc-mod-webadmin + $(Package/znc/default) + TITLE+= (webadmin plugin) + DEPENDS:=znc + endef + + define Package/znc-mod-webadmin/description + Allows you to add/remove/edit users and settings on the fly via a web browser. + endef + + define Package/znc-mod-webadmin/install + $(INSTALL_DIR) $$(1)/usr/lib/znc/ + $(INSTALL_BIN) $$(PKG_BUILD_DIR)/modules/webadmin.so $$(1)/usr/lib/znc/ + $(INSTALL_DIR) $$(1)/usr/share/znc/modules + $(CP) -r $$(PKG_BUILD_DIR)/modules/data/webadmin $$(1)/usr/share/znc/modules + $(INSTALL_DIR) $$(1)/usr/share/znc/webskins/ + $(CP) -r $$(PKG_BUILD_DIR)/webskins/_default_ $$(1)/usr/share/znc/webskins/ + endef + + ZNC_MODULES += znc-mod-webadmin + $(if $(CONFIG_PACKAGE_znc-mod-webadmin),ZNC_MODULE_TARGETS += webadmin.so) +endef + +define webskin + define Package/znc-webskin-$(strip $(1)) + $(Package/znc/default) + TITLE+= ($(strip $(1)) webskin) + DEPENDS:=znc-mod-webadmin + endef + + define Package/znc-webskin-$(strip $(1))/description + $(strip $(1)) webskin for webadmin + endef + + define Package/znc-webskin-$(strip $(1))/install + $(INSTALL_DIR) $$(1)/usr/share/znc/webskins/ + $(CP) -r $$(PKG_BUILD_DIR)/webskins/$(strip $(1)) $$(1)/usr/share/znc/webskins/ + endef + ZNC_MODULES += znc-webskin-$(strip $(1)) +endef + +, := , + +$(eval $(call module,admin,Allows you to add/remove/edit users and settings on \ + the fly via IRC messages.)) + +$(eval $(call module,adminlog,Log user connects and disconnects and failed \ + logins to file or syslog.)) + +$(eval $(call module,autoattach,Reattaches you to channels on activity.)) + +$(eval $(call module,autoop,Auto op the good guys.)) + +$(eval $(call module,autoreply,Gives a automatic reply if someone messages you \ + if you are away.)) + +$(eval $(call module,awaynick,Change your nick while you are away.)) + +$(eval $(call module,blockuser,Blocks certain users from using ZNC saying \ + their account was disabled.)) + +$(eval $(call module,bouncedcc,Bounces dcc transfers through the znc server \ + instead of sending them directly to the user.)) + +$(eval $(call module,buffextras,Add nick changes$(,) joins$(,) parts$(,) topic \ + changes etc. to your playback buffer.)) + +$(eval $(call module,cert,Use a SSL certificate for connecting to a server.)) + +$(eval $(call module,certauth,This module allows users to log in to ZNC via \ + SSL client keys.)) + +$(eval $(call module,chansaver,Keeping config up to date when user joins and \ + parts.)) + +$(eval $(call module,clientnotify,Notify about new incoming connections to \ + your user.)) + +$(eval $(call module,crypt,Encryption for channel/private messages.)) + +$(eval $(call module,disconkick,This module will kick your client from all \ + channels where you are$(,) in case if ZNC disconnects from server.)) + +$(eval $(call module,fail2ban,Block IPs for some time after a failed login.)) + +$(eval $(call module,identfile,Places the ident of a user to a file when they \ + are trying to connect.)) + +$(eval $(call module,keepnick,Tries to get you your primary nick.)) + +$(eval $(call module,kickrejoin,Implements auto-rejoin-on-kick.)) + +$(eval $(call module,lastseen,Logs when a user last logged in to ZNC.)) + +$(eval $(call module,nickserv,Auths you with NickServ.)) + +$(eval $(call module,notes,This modules stores and displays short notes using \ + a key/note pairs and shows them to you on connect.)) + +$(eval $(call module,partyline,Allows ZNC users to join internal channels and \ + query other ZNC users on the same ZNC.)) + +$(eval $(call module,perform,Performs commands on connect.)) + +$(eval $(call module,q,Auths you with Q (and a little more).)) + +$(eval $(call module,raw,View all of the raw traffic.)) + +$(eval $(call module,route-replies,Routes back answers to the right client \ + when connected with multiple clients.)) + +$(eval $(call module,savebuff,Saves your channel buffers into an encrypted \ + file so they can survive restarts and reboots.)) + +$(eval $(call module,schat,SSL (encrypted) DCC chats.)) + +$(eval $(call module,simple-away,This module will automatically set you away \ + on IRC while you are disconnected from the bouncer.)) + +$(eval $(call module,stickychan,Keeps you sticked to specific channels.)) + +$(eval $(call module,watch,Monitor activity for specific text patterns from \ + specific users and have the text sent to a special query window.)) + +$(eval $(call module,antiidle,Hides your idle time.,extra/)) + +$(eval $(call module,autocycle,Cycles a channel when you are the only one in \ + there and you don't have op.,extra/)) + +$(eval $(call module,autovoice,Autovoices everyone who joins some channel., \ + extra/)) + +$(eval $(call module,away,Stores messages while away$(,) also auto away.,extra/)) + +$(eval $(call module,block-motd,This module blocks the server's Message of the \ + Day.,extra/)) + +$(eval $(call module,clearbufferonmsg,This module keeps the buffer until the \ + next message from the client.,extra/)) + +$(eval $(call module,ctcpflood,This module tries to block ctcp floods.,extra/)) + +$(eval $(call module,dcc,Allows you to transfer files to and from ZNC.,extra/)) + +$(eval $(call module,email,Watches a local mailbox for new mails.,extra/)) + +$(eval $(call module,fakeonline,This module fakes the online status of \ + ZNC-*users.,extra/)) + +$(eval $(call module,flooddetach,This module detaches you from channels which \ + are flooded.,extra/)) + +$(eval $(call module,listsockets,This module displays a list of all open \ + sockets in ZNC.,extra/)) + +$(eval $(call module,log,Log conversations to file.,extra/)) + +$(eval $(call module,motdfile,Reads a MOTD from a file and displays it to \ + users when they login.,extra/)) + +$(eval $(call module,notify-connect,Sends a notice to all admins when a user \ + logs in or out.,extra/)) + +$(eval $(call module,send-raw,Allows you to send raw traffic to IRC from \ + other users.,extra/)) + +$(eval $(call module,shell,Have your unix shell in a query window right inside \ + of your IRC client.,extra/)) + +$(eval $(call webadmin)) + +$(eval $(call webskin,dark-clouds)) +$(eval $(call webskin,forest)) +$(eval $(call webskin,ice)) + +PKG_CONFIG_DEPENDS := $(patsubst %,CONFIG_PACKAGE_%,$(ZNC_MODULES)) + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +CONFIGURE_VARS += \ + CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++" \ + CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \ + LDFLAGS="-nodefaultlibs -lc -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \ + LIBS="-luClibc++ -lm -lssl -lcrypto $(LIBGCC_S) -lc" + +CONFIGURE_ARGS += \ + --disable-c-ares \ + --enable-extra \ + --disable-perl + +define Build/Configure + $(call Build/Configure/Default,) + $(call libtool_disable_rpath) +endef + +define Build/Compile + $(call Build/Compile/Default,znc) + +$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/modules \ + $(MAKE_FLAGS) $(ZNC_MODULE_TARGETS) +endef + +$(eval $(call BuildPackage,znc)) +$(foreach m,$(ZNC_MODULES),$(eval $(call BuildPackage,$(m)))) diff --git a/net/znc/files/znc.conf b/net/znc/files/znc.conf new file mode 100644 index 0000000..b281f44 --- /dev/null +++ b/net/znc/files/znc.conf @@ -0,0 +1,26 @@ +config znc + # where to listen for connections + list listener '192.168.1.1 1234' + # If using SSL sockets, use the following certifcate: + # option znc_ssl_cert '/etc/znc.cert' + + # load global modules (You need to install them first): + # list module 'fail2ban' + +config user 'sampleUser' + # Use either a plain text password or use the full sha256#... line. + # You can generate one with 'znc -s'. + option password 'changeme' + option nick 'sampleUser' + option altnick 'userSample' + option ident 'openwrt' + option realname 'John Doe' + + # This adds support for channels in znc configuration: + # list channel '#chan optional_password' + + # list of allowed servers: + list server 'chat.freenode.net 6667' + + # load user modules (' [params...]'): + # list module 'simple_away -timer 10 disconnected' diff --git a/net/znc/files/znc.init b/net/znc/files/znc.init new file mode 100644 index 0000000..01af217 --- /dev/null +++ b/net/znc/files/znc.init @@ -0,0 +1,156 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010 Openwrt.org + +START=60 + +ZNC_CONFIG_PATH=/tmp/etc/znc +PID_FILE=${ZNC_CONFIG_PATH}/znc.pid +ZNC_CONFIG=${ZNC_CONFIG_PATH}/configs/znc.conf + +EXTERNAL_CONFIG=0 + +RUNAS_USER= +RUNAS_GROUP= + +add_param() { + echo "$1 = $2" >> $ZNC_CONFIG +} + +add_chan() { + chan=${1% *} + pass=${1#* } + echo " " >> $ZNC_CONFIG + [ "$chan" != "$pass" ] && echo " Key = $pass" >> $ZNC_CONFIG + echo " " >> $ZNC_CONFIG +} + +znc_global() { + local znc="$1" + local anoniplimit + local maxbuffersize + local connectdelay + local serverthrottle + local znc_config_path + local znc_pem_file + + config_get znc_config_path "$znc" znc_config_path + + config_get RUNAS_USER "$znc" runas_user + config_get RUNAS_GROUP "$znc" runas_group + + if [ "${znc_config_path}" ] + then + ZNC_CONFIG_PATH=$znc_config_path + EXTERNAL_CONFIG=1 + else + mkdir -p $ZNC_CONFIG_PATH/configs/ + [ ! -f "$ZNC_CONFIG" ] || rm "$ZNC_CONFIG" + + config_get anoniplimit "$znc" anoniplimit + config_get maxbuffersize "$znc" maxbuffersize + config_get connectdelay "$znc" connectdelay + config_get serverthrottle "$znc" serverthrottle + config_get znc_pem_file "$znc" znc_ssl_cert + + [ -z "$znc_pem_file" ] || ln -sf "$znc_pem_file" $ZNC_CONFIG_PATH/znc.pem + + [ -z $anoniplimit ] || echo "AnonIPLimit = $anoniplimit" >> $ZNC_CONFIG + [ -z $maxbuffersize ] || echo "MaxBufferSize = $maxbuffersize" >> $ZNC_CONFIG + [ -z $connectdelay ] || echo "ConnectDelay = $connectdelay" >> $ZNC_CONFIG + [ -z $serverthrottle ] || echo "ServerThrottle = $anoniplimit" >> $ZNC_CONFIG + + echo "PidFile = $PID_FILE" >> $ZNC_CONFIG + + config_list_foreach "$znc" listener "add_param Listener" + config_list_foreach "$znc" module "add_param LoadModule" + + add_param LoadModule "droproot ${RUNAS_USER:-nobody} ${RUNAS_GROUP:-nogroup}" + fi +} + +add_user() { + local user="$1" + local password + local nick + local altnick + local ident + local realname + local buffer + local quitmsg + local chanmodes + local vhost + + config_get password "$user" password + config_get nick "$user" nick + config_get altnick "$user" altnick + config_get ident "$user" ident + config_get realname "$user" realname + config_get buffer "$user" buffer + config_get quitmsg "$user" quitmsg + config_get chanmodes "$user" chanmodes + config_get vhost "$user" vhost + + echo "" >> $ZNC_CONFIG + + case "$password" in + "md5#"* | "sha256#"* | "plain#"*) + echo " Pass = $password" >> $ZNC_CONFIG + ;; + *) + echo " Pass = plain#$password" >> $ZNC_CONFIG + ;; + esac + + echo " Nick = $nick" >> $ZNC_CONFIG + echo " AltNick = ${altnick:-$nick"_"}" >> $ZNC_CONFIG + echo " Ident = ${ident:-$nick}" >> $ZNC_CONFIG + echo " RealName = ${realname:-$nick}" >> $ZNC_CONFIG + [ -z "$vhost" ] || echo " VHost = $vhost" >> $ZNC_CONFIG + echo " Buffer = ${buffer:-50}" >> $ZNC_CONFIG + echo " KeepBuffer = false" >> $ZNC_CONFIG + echo " ChanModes = ${chanmodes:-"+stn"}" >> $ZNC_CONFIG + [ -z "$quitmsg" ] || echo " QuitMsg = $quitmsg" >> $ZNC_CONFIG + + config_list_foreach "$user" server "add_param \" Server\"" + config_list_foreach "$user" module "add_param \" LoadModule\"" + config_list_foreach "$user" channel "add_chan" + echo "" >> $ZNC_CONFIG +} + + +start() { + config_load znc + config_foreach znc_global znc + + if [ "$EXTERNAL_CONFIG" -eq 0 ] + then + config_foreach add_listener listener + config_foreach add_user user + + chown -hR ${RUNAS_USER:-nobody}:${RUNAS_GROUP:-nogroup} /tmp/etc/znc + fi + + if [ "$EXTERNAL_CONFIG" -eq 1 -a "$RUNAS_USER" ] + then + local SU=$(which su) + if [ "$SU" ] + then + $SU -c "/usr/bin/znc -d$ZNC_CONFIG_PATH >/dev/null &" $RUNAS_USER + else + logger -s -t ZNC -p daemon.err "Could not run ZNC as user $RUNAS_USER: su not found." + exit 1 + fi + else + /usr/bin/znc -d$ZNC_CONFIG_PATH >/dev/null & + fi +} + +stop() { + if [ -f "$PID_FILE" ] + then + kill $(cat "$PID_FILE") + else + killall znc + fi +} + diff --git a/net/znc/patches/001-move_rootcheck_after_config.patch b/net/znc/patches/001-move_rootcheck_after_config.patch new file mode 100644 index 0000000..96ba8e3 --- /dev/null +++ b/net/znc/patches/001-move_rootcheck_after_config.patch @@ -0,0 +1,52 @@ +From 5f655f9a25a377c01cb15517859eb514628a43d4 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Wed, 6 Apr 2011 04:10:23 +0200 +Subject: [PATCH] Move the root check to after config parsing + +--- + main.cpp | 27 ++++++++++++++------------- + 1 files changed, 14 insertions(+), 13 deletions(-) + +--- a/main.cpp ++++ b/main.cpp +@@ -211,19 +211,6 @@ int main(int argc, char** argv) { + } + #endif + +- if (isRoot()) { +- CUtils::PrintError("You are running ZNC as root! Don't do that! There are not many valid"); +- CUtils::PrintError("reasons for this and it can, in theory, cause great damage!"); +- if (!bAllowRoot) { +- delete pZNC; +- return 1; +- } +- CUtils::PrintError("You have been warned."); +- CUtils::PrintError("Hit CTRL+C now if you don't want to run ZNC as root."); +- CUtils::PrintError("ZNC will start in 30 seconds."); +- sleep(30); +- } +- + if (bMakeConf) { + if (!pZNC->WriteNewConfig(sConfig)) { + delete pZNC; +@@ -244,6 +231,20 @@ int main(int argc, char** argv) { + return 1; + } + ++ if (isRoot()) { ++ CUtils::PrintError("You are running ZNC as root! Don't do that! There are not many valid"); ++ CUtils::PrintError("reasons for this and it can, in theory, cause great damage!"); ++ if (!bAllowRoot) { ++ delete pZNC; ++ return 1; ++ } ++ CUtils::PrintError("You have been warned."); ++ CUtils::PrintError("Hit CTRL+C now if you don't want to run ZNC as root."); ++ CUtils::PrintError("ZNC will start in 30 seconds."); ++ sleep(30); ++ } ++ ++ + if (bForeground) { + int iPid = getpid(); + CUtils::PrintMessage("Staying open for debugging [pid: " + CString(iPid) + "]"); diff --git a/net/znc/patches/002-Uclibcpp_build_fix.patch b/net/znc/patches/002-Uclibcpp_build_fix.patch new file mode 100644 index 0000000..1c48478 --- /dev/null +++ b/net/znc/patches/002-Uclibcpp_build_fix.patch @@ -0,0 +1,34 @@ +From fa14938321eda39f16bee6068296e6abc9df7b85 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Wed, 6 Apr 2011 04:11:48 +0200 +Subject: [PATCH] Add a uClibc++ build workaround + +--- + modules/webadmin.cpp | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +--- a/modules/webadmin.cpp ++++ b/modules/webadmin.cpp +@@ -15,11 +15,13 @@ + #include "WebModules.h" + #include "ZNCString.h" + #include "Listener.h" ++#include + #include + #include + + using std::stringstream; + using std::make_pair; ++using std::string; + + /* Stuff to be able to write this: + // i will be name of local variable, see below +@@ -55,7 +57,7 @@ class CWebAdminMod : public CGlobalModul + public: + GLOBALMODCONSTRUCTOR(CWebAdminMod) { + VPair vParams; +- vParams.push_back(make_pair("user", "")); ++ vParams.push_back(make_pair((string)"user", (string)"")); + AddSubPage(new CWebSubPage("settings", "Global Settings", CWebSubPage::F_ADMIN)); + AddSubPage(new CWebSubPage("edituser", "Your Settings", vParams)); + AddSubPage(new CWebSubPage("traffic", "Traffic Info", CWebSubPage::F_ADMIN)); diff --git a/net/znc/patches/003-Reduce_rebuild_time.patch b/net/znc/patches/003-Reduce_rebuild_time.patch new file mode 100644 index 0000000..5c6fcd9 --- /dev/null +++ b/net/znc/patches/003-Reduce_rebuild_time.patch @@ -0,0 +1,32 @@ +From 94aff4c3389111fc85054eb06b40bea26a216d0c Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sat, 16 Apr 2011 05:51:04 +0200 +Subject: [PATCH] Don't rebuild everything when the Makefile's timestamp changed + +--- + Makefile.in | 2 +- + modules/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/Makefile.in ++++ b/Makefile.in +@@ -96,7 +96,7 @@ clean: + distclean: clean + rm -rf $(DISTCLEAN) + +-%.o: %.cpp Makefile ++%.o: %.cpp + @mkdir -p .depend + $(E) Building $@... + $(Q)$(CXX) $(CXXFLAGS) -c -o $@ $< -MMD -MF .depend/$@.dep +--- a/modules/Makefile.in ++++ b/modules/Makefile.in +@@ -114,7 +114,7 @@ install_datadir: + clean: + rm -rf $(CLEAN) + +-%.so: %.cpp Makefile ++%.so: %.cpp + @mkdir -p .depend + @mkdir -p extra + $(E) Building $(if $(filter %extra/,$(dir $<)),extra )module $(notdir $(basename $@))... diff --git a/skels/Makefile.template b/skels/Makefile.template new file mode 100644 index 0000000..893fb54 --- /dev/null +++ b/skels/Makefile.template @@ -0,0 +1,52 @@ +# +# Copyright (C) 2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# This Makefile is a skeleton +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:= +PKG_VERSION:= + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= +PKG_MD5SUM:= + +include $(INCLUDE_DIR)/package.mk + +define Package/package + SECTION:=net + CATEGORY:=Network + TITLE:=package + URL:= +endef + +define Package/package/description +endef + +# add extra configure flags here +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared + +# add make variable overrides here +MAKE_FLAGS += + +define Build/InstallDev + $(CP) $(PKG_INSTALL_DIR)/* $(1)/ +endef + +define Package/package/install + $(INSTALL_DIR) $(1)/usr/package + $(CP) $(PKG_INSTALL_DIR)/usr/package/package.so.* $(1)/usr/package/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/package.init $(1)/etc/init.d/package + $(INSTALL_DIR) $(1)/etc/config/ + $(INSTALL_CONF) $(1)/etc/config/package +endef + +$(eval $(call BuildPackage,package)) diff --git a/skels/files/package.conf b/skels/files/package.conf new file mode 100644 index 0000000..db3bc4d --- /dev/null +++ b/skels/files/package.conf @@ -0,0 +1,4 @@ +# Sample configuration file +config package + option option1 'some default value' + option option2 '' diff --git a/skels/files/package.init b/skels/files/package.init new file mode 100755 index 0000000..b0de442 --- /dev/null +++ b/skels/files/package.init @@ -0,0 +1,40 @@ +#!/bin/sh /etc/rc.common +# Sample init script reading its +# configuration from /etc/config/package + +START=46 +STOP=46 + +start_service() { + local section="$1" + + . /lib/functions/network.sh + + network_get_device LAN lan ifname + config_get option1 "$section" option1 + config_get option2 "$section" option2 + + # Do some action with the variables + echo "option1 = $option1" +} + +stop_service() { + local section="$1" + + . /lib/functions/network.sh + + network_get_device LAN lan ifname + config_get option1 "$section" option1 + config_get option2 "$section" option2 +} +start() { + # Do some optionnal testing + # before starting the program + config_load "package" + config_foreach start_service package +} + +stop() { + config_load "package" + config_foreach stop_service package +} diff --git a/sound/cmus/Makefile b/sound/cmus/Makefile new file mode 100644 index 0000000..336bd80 --- /dev/null +++ b/sound/cmus/Makefile @@ -0,0 +1,96 @@ +# +# Copyright (C) 2011 Johannes Weißl +# Copyright (C) 2006-2011 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:=cmus +PKG_VERSION:=2.4.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/cmus +PKG_MD5SUM:=0c5a9f4032e632e5f6b6a49f53df1e7e + +PKG_INSTALL:=1 +PKG_BUILD_DIR:=$(BUILD_DIR)/cmus-v$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/cmus + SECTION:=sound + CATEGORY:=Sound + DEPENDS:= \ + +libpthread +librt +libncursesw $(ICONV_DEPENDS) \ + +AUDIO_SUPPORT:alsa-lib \ + +BUILD_PATENTED:libmad +libvorbisidec +libflac + TITLE:=C* Music Player + URL:=http://cmus.sourceforge.net/ +endef + +define Package/cmus/description + C* Music Player is a modular and very configurable ncurses-based + audio player. It has some interesting features like configurable + colorscheme, mp3 and ogg streaming, it can be controlled with an + UNIX socket, filters, album/artists sorting and a vi-like + configuration interface. +endef + +define Build/Configure + # this is *NOT* GNU configure + ( cd $(PKG_BUILD_DIR); \ + CROSS="$(TARGET_CROSS)" \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -I$(ICONV_PREFIX)/include" \ + LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -L$(ICONV_PREFIX)/lib" \ + PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \ + PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig" \ + ./configure \ + prefix="/usr" \ + CONFIG_FLAC=a \ + CONFIG_MAD=$(if $(CONFIG_BUILD_PATENTED),a,n) \ + CONFIG_MODPLUG=n \ + CONFIG_MIKMOD=n \ + CONFIG_MPC=n \ + CONFIG_VORBIS=a \ + CONFIG_TREMOR=y \ + CONFIG_WAVPACK=n \ + CONFIG_MP4=n \ + CONFIG_AAC=n \ + CONFIG_FFMPEG=n \ + CONFIG_ROAR=n \ + CONFIG_PULSE=n \ + CONFIG_ALSA=$(if $(CONFIG_AUDIO_SUPPORT),a,n) \ + CONFIG_AO=n \ + CONFIG_ARTS=n \ + CONFIG_OSS=y \ + CONFIG_SUN=n \ + CONFIG_WAVEOUT=n \ + DEBUG=0 \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + V=$(V) \ + install +endef + +define Package/cmus/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/lib/cmus/ip + $(INSTALL_DIR) $(1)/usr/lib/cmus/op + $(INSTALL_DIR) $(1)/usr/share/cmus + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cmus $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmus/ip/*.so $(1)/usr/lib/cmus/ip/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmus/op/*.so $(1)/usr/lib/cmus/op/ + $(CP) $(PKG_INSTALL_DIR)/usr/share/cmus/{rc,default.theme} $(1)/usr/share/cmus/ +endef + +$(eval $(call BuildPackage,cmus)) + diff --git a/sound/cmus/patches/010-do_not_use_ACS_VLINE.patch b/sound/cmus/patches/010-do_not_use_ACS_VLINE.patch new file mode 100644 index 0000000..aaeb34e --- /dev/null +++ b/sound/cmus/patches/010-do_not_use_ACS_VLINE.patch @@ -0,0 +1,11 @@ +--- a/ui_curses.c ++++ b/ui_curses.c +@@ -928,7 +928,7 @@ static void draw_separator(void) + (void) mvaddch(0, tree_win_w, ' '); + bkgdset(pairs[CURSED_SEPARATOR]); + for (row = 1; row < LINES - 3; row++) +- (void) mvaddch(row, tree_win_w, ACS_VLINE); ++ (void) mvaddch(row, tree_win_w, '|'); + } + + static void do_update_view(int full) diff --git a/sound/empcd/Makefile b/sound/empcd/Makefile new file mode 100644 index 0000000..8b0c15d --- /dev/null +++ b/sound/empcd/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2007 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:=empcd +PKG_VERSION:=2008.02.16 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://unfix.org/projects/empcd +PKG_MD5SUM:=c3209f6bf8eb6e8ea9638601e1cd04a4 + +include $(INCLUDE_DIR)/package.mk + +define Package/empcd + SECTION:=sound + CATEGORY:=Sound + TITLE:=EMPCd can control the MPD + URL:=http://unfix.org/projects/empcd +endef + +define Package/empcd/description + This is EMPCd which can use /dev/input/event0 or other event devices + to control MPD (Music Player Daemon), directly using libmpdclient + and other programs, currently using system(2). +endef + +define Package/empcd/conffiles +/etc/empcd.conf +endef + +define Build/Compile + $(call Build/Compile/Default,\ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all \ + ) +endef + +define Package/empcd/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/empcd $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/empcd.conf $(1)/etc/ +endef + +$(eval $(call BuildPackage,empcd)) diff --git a/sound/flite/Makefile b/sound/flite/Makefile new file mode 100644 index 0000000..4325e7f --- /dev/null +++ b/sound/flite/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=flite +PKG_VERSION:=1.3-release +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.speech.cs.cmu.edu/flite/packed/flite-1.3/ +PKG_MD5SUM:=ae0aca1cb7b4801f4372f3a75a9e52b5 + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/flite + SECTION:=sound + CATEGORY:=Sound + DEPENDS:=@!GCC_VERSION_3_4_6 + TITLE:=Text-to-speech for embedded systems + URL:=http://www.speech.cs.cmu.edu/flite/index.html +endef + +define Package/flite/description +Festival Lite is a stripped down version of Festival, + the well-developed text-to-speech program written in C++. + This program is written in C to keep memory usage low. +endef + +TARGET_LDFLAGS += -lm + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --with-audio="oss" \ + --with-vox="cmu_us_kal16" \ + --prefix="$(PKG_INSTALL_DIR)/usr" \ + --exec-prefix="$(PKG_INSTALL_DIR)/usr" \ + --bindir="$(PKG_INSTALL_DIR)/usr/bin" \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/flite + $(CP) $(PKG_INSTALL_DIR)/usr/include/flite/{cst,flite}*.h $(1)/usr/include/flite/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libflite*.so.* $(1)/usr/lib/ +endef + +define Package/flite/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/flite $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libflite*.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,flite)) diff --git a/sound/flite/patches/100-shared_libs b/sound/flite/patches/100-shared_libs new file mode 100644 index 0000000..47254b0 --- /dev/null +++ b/sound/flite/patches/100-shared_libs @@ -0,0 +1,182 @@ +--- + Makefile | 2 - + config/common_make_rules | 34 ++++++++++++-------- + lib/Makefile | 78 +++++++++++++++++++++++++++++++++++++++++++++++ + main/Makefile | 4 +- + 4 files changed, 102 insertions(+), 16 deletions(-) + +--- flite-1.3-release.orig/config/common_make_rules ++++ flite-1.3-release/config/common_make_rules +@@ -59,27 +59,35 @@ BUILDDIR=$(TOP)/build/$(TARGET_PLATFORM) + endif + OBJDIR=$(BUILDDIR)/obj/$(DIRNAME) + BINDIR=$(BUILDDIR)/bin ++LIBDIR=$(BUILDDIR)/lib + ifeq ($(HOST_PLATFORM),$(TARGET_PLATFORM)) + BINDIR=$(TOP)/bin ++LIBDIR=$(TOP)/lib + endif + +-LIBDIR=$(BUILDDIR)/lib + BUILDDIRS=$(OBJDIR) $(BINDIR) $(LIBDIR) + +-FLITELIBS = $(BUILDDIR)/lib/libflite.a +-LDFLAGS += -L$(BUILDDIR)/lib -lflite -lm $(AUDIOLIBS) $(OTHERLIBS) ++ifdef SHFLAGS ++FLITELIBS = $(LIBDIR)/libflite.so ++LDFLAGS += -L$(LIBDIR) -lflite $(OTHERLIBS) ++else ++FLITELIBS = $(LIBDIR)/libflite.a ++LDFLAGS += -L$(LIBDIR) -lflite -lm $(AUDIOLIBS) $(OTHERLIBS) ++endif + + FULLOBJS = $(OBJS:%=$(OBJDIR)/%) + ifdef SHFLAGS + SOOBJS = $(OBJS:.o=.os) +-FULLSHOBJS = $(SOOBJS:%=$(OBJDIR)/%) ++FULLSOOBJS = $(SOOBJS:%=$(OBJDIR)/%) + ifdef LIBNAME + ALL += $(OBJDIR)/.build_so + endif +-endif ++else + ifdef LIBNAME + ALL += $(OBJDIR)/.build_lib + endif ++endif ++ + # Only do some directories when you are not cross compiling + ifeq ($(HOST_PLATFORM),$(TARGET_PLATFORM)) + OTHER_BUILD_DIRS = $(HOST_ONLY_DIRS) +@@ -117,15 +125,15 @@ $(OBJDIR)/.build_so: $(FULLSOOBJS) + @ touch $(OBJDIR)/.build_so + + # Used in the lib/ directory and in building new voices +-$(OBJDIR)/%.so: %.shared.a ++%.so: %.shared.a + @ echo making $@ +- @ rm -rf shared_os && mkdir shared_os +- @ rm -f $@ $(LIBDIR)/$@.${PROJECT_VERSION} $(LIBDIR)/$@.${PROJECT_SHLIB_VERSION} +- @ (cd shared_os && ar x ../$<) +- @ (cd shared_os && $(CC) -shared -Wl,-soname,$@.${PROJECT_SHLIB_VERSION} -o ../$@.${PROJECT_VERSION} *.os) +- @ ln -s $(LIBDIR)/$@.${PROJECT_VERSION} $(LIBDIR)/$@.${PROJECT_SHLIB_VERSION} +- @ ln -s $(LIBDIR)/$@.${PROJECT_SHLIB_VERSION} $(LIBDIR)/$@ +- @ rm -rf shared_os ++ @ rm -rf shared_os-$@ && mkdir shared_os-$@ ++ @ rm -f $@ $@.${PROJECT_VERSION} $@.${PROJECT_SHLIB_VERSION} ++ @ (cd shared_os-$@ && ar x ../$<) ++ @ (cd shared_os-$@ && $(CC) -shared -Wl,-soname,$@.${PROJECT_SHLIB_VERSION} -o ../$@.${PROJECT_VERSION} *.os -L../ $($(@:%.so=%_LDLIBS))) ++ @ ln -s $@.${PROJECT_VERSION} $@.${PROJECT_SHLIB_VERSION} ++ @ ln -s $@.${PROJECT_SHLIB_VERSION} $@ ++ @ rm -rf shared_os-$@ + + $(OBJDIR)/.make_build_dirs: + @ echo making in $(DIRNAME) ... +--- /dev/null ++++ flite-1.3-release/lib/Makefile +@@ -0,0 +1,78 @@ ++########################################################################### ++## ## ++## Language Technologies Institute ## ++## Carnegie Mellon University ## ++## Copyright (c) 1999 ## ++## All Rights Reserved. ## ++## ## ++## Permission is hereby granted, free of charge, to use and distribute ## ++## this software and its documentation without restriction, including ## ++## without limitation the rights to use, copy, modify, merge, publish, ## ++## distribute, sublicense, and/or sell copies of this work, and to ## ++## permit persons to whom this work is furnished to do so, subject to ## ++## the following conditions: ## ++## 1. The code must retain the above copyright notice, this list of ## ++## conditions and the following disclaimer. ## ++## 2. Any modifications must be clearly marked as such. ## ++## 3. Original authors' names are not deleted. ## ++## 4. The authors' names are not used to endorse or promote products ## ++## derived from this software without specific prior written ## ++## permission. ## ++## ## ++## CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK ## ++## DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ## ++## ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT ## ++## SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE ## ++## FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ## ++## WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN ## ++## AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ## ++## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF ## ++## THIS SOFTWARE. ## ++## ## ++########################################################################### ++## ## ++## FLITE libraries ## ++## ## ++########################################################################### ++TOP=.. ++DIRNAME=lib ++BUILD_DIRS = ++ALL_DIRS= ++FILES = Makefile ++LIBNAMES = flite flite_cmulex flite_usenglish \ ++ flite_cmu_us_kal flite_cmu_us_kal16 flite_cmu_time_awb ++ ++STATICLIBS= $(LIBNAMES:%=lib%.a) ++SHAREDARLIBS= $(LIBNAMES:%=lib%.shared.a) ++#SHAREDLIBS = $(LIBNAMES:%=lib%.so) ++SHAREDLIBS = $(SHAREDARLIBS:%.shared.a=%.so) ++VERSIONSHAREDLIBS = $(SHAREDLIBS:%=%.${PROJECT_VERSION}) \ ++ $(SHAREDLIBS:%=%.${PROJECT_SHLIB_VERSION}) ++ALL_LIBS = $(SHAREDLIBS) $(VERSIONSHAREDLIBS) ++ ++ALL = shared_libs ++ ++LOCAL_CLEAN=*.a *.so *.so.${PROJECT_VERSION} *.so.${PROJECT_SHLIB_VERSION} ++ ++include $(TOP)/config/common_make_rules ++ ++ifdef SHFLAGS ++shared_libs: $(SHAREDLIBS) ++libflite_LDLIBS = -lm $(AUDIOLIBS) ++libflite_cmulex_LDLIBS = -lflite ++libflite_cmulex.so: libflite.so ++libflite_usenglish_LDLIBS = -lflite ++libflite_usenglish.so: libflite.so ++libflite_cmu_us_kal_LDLIBS = -lflite_cmulex -lflite_usenglish ++libflite_cmu_us_kal.so: libflite_cmulex.so libflite_usenglish.so ++libflite_cmu_us_kal16_LDLIBS = -lflite_cmulex -lflite_usenglish ++libflite_cmu_us_kal16.so: libflite_cmulex.so libflite_usenglish.so ++libflite_cmu_time_awb_LDLIBS = -lflite -lflite_cmulex -lflite_usenglish ++libflite_cmu_time_awb.so: libflite.so libflite_cmulex.so libflite_usenglish.so ++else ++shared_libs: nothing ++endif ++ ++install: ++ @ tar cvf - $(ALL_LIBS) | ( cd $(INSTALLLIBDIR) && tar xf -) ++ +--- flite-1.3-release.orig/main/Makefile ++++ flite-1.3-release/main/Makefile +@@ -50,11 +50,11 @@ ALL = $(BINDIR)/flite$(EXEEXT) $(BINDIR) + + flite_LIBS = flite_$(FL_VOX) flite_$(FL_LANG) flite_$(FL_LEX) + flite_LIBS_flags = -L$(LIBDIR) $(flite_LIBS:%=-l%) +-flite_LIBS_deps = $(flite_LIBS:%=$(LIBDIR)/lib%.a) ++flite_LIBS_deps = $(flite_LIBS:%=$(LIBDIR)/lib%.so) + + flite_time_LIBS = flite_cmu_time_awb flite_$(FL_LANG) flite_$(FL_LEX) + flite_time_LIBS_flags = -L$(LIBDIR) $(flite_time_LIBS:%=-l%) +-flite_time_LIBS_deps = $(flite_time_LIBS:%=$(LIBDIR)/lib%.a) ++flite_time_LIBS_deps = $(flite_time_LIBS:%=$(LIBDIR)/lib%.so) + + include $(TOP)/config/common_make_rules + +--- flite-1.3-release.orig/Makefile ++++ flite-1.3-release/Makefile +@@ -41,7 +41,7 @@ + ########################################################################### + TOP=. + DIRNAME= +-BUILD_DIRS = include src lang doc ++BUILD_DIRS = include src lang lib + ALL_DIRS=config $(BUILD_DIRS) testsuite sapi palm tools main + CONFIG=configure configure.in config.sub config.guess \ + missing install-sh mkinstalldirs diff --git a/sound/ices/Makefile b/sound/ices/Makefile new file mode 100644 index 0000000..4f375b7 --- /dev/null +++ b/sound/ices/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2009 Freifunk Leipzig +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ices +PKG_VERSION:=2.0.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.xiph.org/releases/ices/ +PKG_MD5SUM:=0d95ac34d59fed337028d5e7771076d8 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/ices + SECTION:=sound + CATEGORY:=Sound + TITLE:=ices client for Icecast media streaming servers + URL:=http://xiph.org/ + DEPENDS:=+libshout +libxml2 +zlib +libogg +libvorbis +alsa-lib +endef + +define Package/ices/description + ices is a command line source client for Icecast media streaming servers. + It began as the successor of the old "shout" utility, and has since gained a + lot of useful features. +endef + +define Package/ices/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(1)/usr/bin/ +endef + +CONFIGURE_ARGS+= \ + --with-ogg="$(STAGING_DIR)/usr/include" \ + --with-vorbis="$(STAGING_DIR)/usr/include" \ + +define Build/Configure + $(call Build/Configure/Default, \ + LDFLAGS="$(TARGET_LDFLAGS) -lz -lm" \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \ + LDFLAGS="$(TARGET_LDFLAGS) -lz -lm" +endef + +$(eval $(call BuildPackage,ices)) diff --git a/sound/lame/Makefile b/sound/lame/Makefile new file mode 100644 index 0000000..53b227c --- /dev/null +++ b/sound/lame/Makefile @@ -0,0 +1,79 @@ +# +# Copyright (C) 2007-2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# blogic@openwrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=lame +PKG_VERSION:=398-2 +PKG_RELEASE:=3 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/lame +PKG_MD5SUM:=719dae0ee675d0c16e0e89952930ed35 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +PKG_INSTALL=1 + +define Package/lame/Default + SECTION:=sound + CATEGORY:=Sound + URL:=http://sourceforge.net/projects/lame + DEPENDS:=@BUILD_PATENTED +endef + +define Package/lame +$(call Package/lame/Default) + TITLE:=lame + MENU:=1 + DEPENDS += +libncurses +endef + +define Package/lame/description +lame mp3 encoder +endef + +define Package/lame-lib +$(call Package/lame/Default) + TITLE:=lame-lib +endef + +define Package/lame-lib/description +lame mp3 encoder libs +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-nasm \ + ) +endef + + +define Package/lame/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lame $(1)/usr/bin/ +endef + +define Package/lame-lib/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*so* $(1)/usr/lib/ +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/lame + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/lame/*.h \ + $(1)/usr/include/lame/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.{la,so*} \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,lame-lib)) +$(eval $(call BuildPackage,lame)) diff --git a/sound/lame/patches/001-automake-compat.patch b/sound/lame/patches/001-automake-compat.patch new file mode 100644 index 0000000..a2ba61a --- /dev/null +++ b/sound/lame/patches/001-automake-compat.patch @@ -0,0 +1,33 @@ +--- a/configure.in ++++ b/configure.in +@@ -385,7 +385,7 @@ CONFIG_MATH_LIB="${USE_LIBM}" + + dnl configure use of features + +-AM_PATH_GTK(1.2.0, HAVE_GTK="yes", HAVE_GTK="no") ++HAVE_GTK="no" + + dnl ElectricFence malloc debugging + AC_MSG_CHECKING(use of ElectricFence malloc debugging) +--- a/frontend/Makefile.am ++++ b/frontend/Makefile.am +@@ -51,7 +51,7 @@ mp3rtp_SOURCES = mp3rtp.c rtp.c rtp.h $( + mp3x_SOURCES = mp3x.c gtkanal.c gpkplotting.c $(common_sources) + endif + +-CFLAGS = @CFLAGS@ @GTK_CFLAGS@ @FRONTEND_CFLAGS@ @SNDFILE_CFLAGS@ ++CFLAGS = @CFLAGS@ @FRONTEND_CFLAGS@ @SNDFILE_CFLAGS@ + LDFLAGS = @LDFLAGS@ @FRONTEND_LDFLAGS@ @SNDFILE_LIBS@ -static + + INCLUDES = -I$(top_srcdir)/libmp3lame -I$(top_srcdir)/include -I$(top_builddir) +--- a/frontend/Makefile.in ++++ b/frontend/Makefile.in +@@ -113,7 +113,7 @@ AUTOMAKE = @AUTOMAKE@ + AWK = @AWK@ + CC = @CC@ + CCDEPMODE = @CCDEPMODE@ +-CFLAGS = @CFLAGS@ @GTK_CFLAGS@ @FRONTEND_CFLAGS@ @SNDFILE_CFLAGS@ ++CFLAGS = @CFLAGS@ @FRONTEND_CFLAGS@ @SNDFILE_CFLAGS@ + CONFIG_DEFS = @CONFIG_DEFS@ + CONFIG_MATH_LIB = @CONFIG_MATH_LIB@ + CPP = @CPP@ diff --git a/sound/listener/Makefile b/sound/listener/Makefile new file mode 100644 index 0000000..7bb41a8 --- /dev/null +++ b/sound/listener/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2011 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:=listener +PKG_VERSION:=1.7.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://www.vanheusden.com/listener/ +PKG_MD5SUM:=8ad9c24c45c7d28aed606304a2bf80bf + +include $(INCLUDE_DIR)/package.mk + +define Package/listener + SECTION:=sound + CATEGORY:=Sound + DEPENDS:=+libncurses +libsndfile + TITLE:=Listener automatically records when sound is detected + URL:=http://www.vanheusden.com/listener/ +endef + +define Package/listener/description + This program listens for sound. If it detects any, it starts recording + automatically and also automatically stops when things become silent + again. +endef + +MAKE_FLAGS+= \ + INSTALL_PREFIX= \ + +define Package/listener/conffiles +/etc/listener.conf +endef + +define Package/listener/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/{listener,listenersoundpipe,setlistener} $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/listener.conf $(1)/etc/ +endef + +$(eval $(call BuildPackage,listener)) diff --git a/sound/listener/files/listener.conf b/sound/listener/files/listener.conf new file mode 100644 index 0000000..aeafd44 --- /dev/null +++ b/sound/listener/files/listener.conf @@ -0,0 +1,20 @@ +wav_path = /tmp/ +fname_template = listener-%h-%y%m%d-%H%M%S.wav +devname = /dev/dsp +detect_level = 1 +min_duration = 10 +rec_silence = 5 +max_duration = 60 +min_triggers = 2 +sample_rate = 8000 +channels = 1 +format=wav +amplify = off +start_amplify = 1.5 +max_amplify = 10.0 +fixed_amplify = no +safe_after_filter = no +one_shot = no + +#compression = a-law +#filter = ./my_filter2.so.0.1 0 3000.0 1.0 diff --git a/sound/listener/patches/100-makefile.patch b/sound/listener/patches/100-makefile.patch new file mode 100644 index 0000000..bd254b8 --- /dev/null +++ b/sound/listener/patches/100-makefile.patch @@ -0,0 +1,31 @@ +--- a/Makefile ++++ b/Makefile +@@ -2,7 +2,10 @@ VERSION=1.7.2 + + INSTALL_PREFIX=/usr/local + +-CFLAGS+=-g -O2 -Wall -DVERSION=\"$(VERSION)\" ++ifeq ($(CFLAGS),) ++ CFLAGS:=-g -O2 ++endif ++CFLAGS+=-Wall -DVERSION=\"$(VERSION)\" + + OBJSsl=sl.o snd_dev.o error.o utils.o + OBJSli=listener.o snd_dev.o error.o utils.o lib.o +@@ -11,13 +14,13 @@ OBJSsp=snd_dev.o lsp.o error.o utils.o + all: setlistener listener listenersoundpipe + + setlistener: $(OBJSsl) +- $(CC) -g -Wall -W $(OBJSsl) -ldl -lncurses -o setlistener ++ $(CC) $(CFLAGS) $(OBJSsl) $(LDFLAGS) -ldl -lncurses -o setlistener + + listener: $(OBJSli) +- $(CC) -g -Wall -W $(OBJSli) -ldl -lm -lsndfile -o listener -DCONFIGFILE=$(INSTALL_PREFIX)/etc/listener.conf ++ $(CC) $(CFLAGS) $(OBJSli) $(LDFLAGS) -ldl -lm -lsndfile -o listener -DCONFIGFILE=$(INSTALL_PREFIX)/etc/listener.conf + + listenersoundpipe: $(OBJSsp) +- $(CC) -g -Wall -W $(OBJSsp) -o listenersoundpipe ++ $(CC) $(CFLAGS) $(OBJSsp) -o listenersoundpipe + + install: setlistener listener listenersoundpipe + cp setlistener $(INSTALL_PREFIX)/bin diff --git a/sound/madplay/Makefile b/sound/madplay/Makefile new file mode 100644 index 0000000..bf0b93c --- /dev/null +++ b/sound/madplay/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=madplay +PKG_VERSION:=0.15.2b +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/mad \ + ftp://ftp.mars.org/pub/mpeg/ +PKG_MD5SUM:=6814b47ceaa99880c754c5195aa1aac1 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/madplay + SECTION:=sound + CATEGORY:=Sound + DEPENDS:=+libid3tag +libmad + TITLE:=MPEG audio player in fixed point + URL:=http://sourceforge.net/projects/mad +endef + +define Package/madplay/description + MAD is an MPEG audio decoder. It currently only supports the MPEG 1 + standard, but fully implements all three audio layers (Layer I, Layer II, + and Layer III, the latter often colloquially known as MP3.). There is also + full support for ID3 tags. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --disable-static \ + --disable-debugging \ + --disable-profiling \ + --disable-experimental \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + --without-alsa \ + --without-esd \ + , \ + LIBS="-lz" \ + ) +endef + +define Package/madplay/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/madplay $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,madplay)) diff --git a/sound/mocp/Makefile b/sound/mocp/Makefile new file mode 100644 index 0000000..8cb333c --- /dev/null +++ b/sound/mocp/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2011 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:=moc +PKG_VERSION:=2.4.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.daper.net/pub/soft/moc/stable/ +PKG_MD5SUM:=647c770a5542a4ae5437386807a89796 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/moc + SECTION:=sound + CATEGORY:=Sound + DEPENDS:=+libcurl +BUILD_PATENTED:libmad +libvorbis $(ICONV_DEPENDS) +alsa-utils +libid3tag +libflac +libsamplerate +PACKAGE_libncursesw:libncursesw +!PACKAGE_libncursesw:libncurses +libffmpeg +libltdl + TITLE:=Music On Console + URL:=http://moc.daper.net/ +endef + +define Package/moc/description + MOC (music on console) is a console audio player for LINUX/UNIX designed to be powerful and easy to use. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + $(if $(CONFIG_BUILD_PATENTED),,--without-mp3) \ + --enable-shared \ + --disable-static \ + --disable-debug \ + --without-speex \ + --without-samplerate \ + --without-curl \ + --without-flac \ + --without-musepack \ + --without-rcc \ + ) +endef + +define Package/moc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mocp $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/moc/decoder_plugins + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/moc/decoder_plugins/*.so $(1)/usr/lib/moc/decoder_plugins +endef + +$(eval $(call BuildPackage,moc)) diff --git a/sound/mocp/patches/001-moc-ffmpeg-update.patch b/sound/mocp/patches/001-moc-ffmpeg-update.patch new file mode 100644 index 0000000..a9c5615 --- /dev/null +++ b/sound/mocp/patches/001-moc-ffmpeg-update.patch @@ -0,0 +1,34 @@ +--- a/decoder_plugins/ffmpeg/ffmpeg.c ++++ b/decoder_plugins/ffmpeg/ffmpeg.c +@@ -81,14 +81,14 @@ static void ffmpeg_info (const char *fil + } + + if (tags_sel & TAGS_COMMENTS) { +- if (ic->track != 0) +- info->track = ic->track; +- if (ic->title[0] != 0) +- info->title = xstrdup (ic->title); +- if (ic->author[0] != 0) +- info->artist = xstrdup (ic->author); +- if (ic->album[0] != 0) +- info->album = xstrdup (ic->album); ++ if (av_metadata_get(ic->metadata, "track", NULL, 0) != NULL) ++ info->track = atoi(av_metadata_get(ic->metadata, "track", NULL, 0)->value); ++ if (av_metadata_get(ic->metadata, "title", NULL, 0) != NULL) ++ info->title = xstrdup (av_metadata_get(ic->metadata, "title", NULL, 0)->value); ++ if (av_metadata_get(ic->metadata, "author", NULL, 0) != NULL) ++ info->artist = xstrdup (av_metadata_get(ic->metadata, "author", NULL, 0)->value); ++ if (av_metadata_get(ic->metadata, "album", NULL, 0) != NULL) ++ info->album = xstrdup (av_metadata_get(ic->metadata, "album", NULL, 0)->value); + } + + if (tags_sel & TAGS_TIME) +@@ -127,7 +127,7 @@ static void *ffmpeg_open (const char *fi + av_read_play (data->ic); + for (i = 0; i < data->ic->nb_streams; i++) { + data->enc = data->ic->streams[i]->codec; +- if (data->enc->codec_type == CODEC_TYPE_AUDIO) { ++ if (data->enc->codec_type == AVMEDIA_TYPE_AUDIO) { + audio_index = i; + break; + } diff --git a/sound/mpc/Makefile b/sound/mpc/Makefile new file mode 100644 index 0000000..4bf7308 --- /dev/null +++ b/sound/mpc/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2006-2009 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:=mpc +PKG_VERSION:=0.20 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/musicpd +PKG_MD5SUM:=24c81ad6afe6099e8d7a6826ef4b7105 + +include $(INCLUDE_DIR)/package.mk + +define Package/mpc + SECTION:=sound + CATEGORY:=Sound + DEPENDS:=+libmpdclient + TITLE:=Music Player Daemon Console Client + URL:=http://www.musicpd.org/ +endef + +define Package/mpc/description + MPD is a music player supporting flac, mp3 and ogg files. + It is typically controlled over a network using one of it's many + clients including mpc(console), gmpc(gnome), phpmp(php) etc. + this is MPC +endef + +define Build/Configure +$(call Build/Configure/Default, \ + --disable-iconv \ +) +endef + +define Build/Compile +$(call Build/Compile/Default,\ + CFLAGS="$(TARGET_CFLAGS) -std=gnu99" \ + prefix="/usr" \ + all \ +) +endef + +define Package/mpc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mpc $(1)/usr/bin/ + $(INSTALL_BIN) ./files/pls-handler.sh $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,mpc)) diff --git a/sound/mpc/files/pls-handler.sh b/sound/mpc/files/pls-handler.sh new file mode 100644 index 0000000..9394417 --- /dev/null +++ b/sound/mpc/files/pls-handler.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo parameter: file.pls +mpc clear +grep '^File[0-9]*' $1 | sed -e 's/^File[0-9]*=//' | mpc add +mpc play \ No newline at end of file diff --git a/sound/mpd/Makefile b/sound/mpd/Makefile new file mode 100644 index 0000000..19f9b06 --- /dev/null +++ b/sound/mpd/Makefile @@ -0,0 +1,211 @@ +# +# Copyright (C) 2007-2011 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:=mpd +PKG_VERSION:=0.16.5 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/musicpd +PKG_MD5SUM:=f7564cff12035f6a1112cce770655df7 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_PARALLEL:=1 + +PKG_CONFIG_DEPENDS:= \ + CONFIG_IPV6 \ + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/mpd/Default + SECTION:=sound + CATEGORY:=Sound + TITLE:=Music Player Daemon + URL:=http://www.musicpd.org/ + DEPENDS:= +glib2 +libcurl +libpthread \ + +libflac +BUILD_PATENTED:libmad +libvorbisidec +endef + +define Package/mpd/Default/description + Music Player Daemon (MPD) is a flexible, powerful, server-side + application for playing music. It is typically controlled over a + network using one of it's many clients including mpc (console), + gmpc (gnome), phpmp (php), etc... +endef + + +define Package/mpd-full +$(call Package/mpd/Default) + TITLE+= (full) + DEPENDS+= \ + +AUDIO_SUPPORT:alsa-lib \ + +libaudiofile +BUILD_PATENTED:libfaad2 +libffmpeg +libid3tag \ + +libmms +libogg +libshout +libsndfile +libvorbis + PROVIDES:=mpd + VARIANT:=full +endef + +define Package/mpd-full/description +$(call Package/mpd/Default/description) + . + This package contains a full-blown Music Player Daemon. +endef + +define Package/mpd-full/conffiles +/etc/avahi/services/mpd.service +/etc/mpd.conf +endef + + +define Package/mpd-mini +$(call Package/mpd/Default) + TITLE+= (mini) + PROVIDES:=mpd + VARIANT:=mini +endef + +define Package/mpd-mini/description +$(call Package/mpd/Default/description) + . + This package contains a minimal Music Player Daemon, with support for + only Flac, MP3 & OGG media types & only file: & http: protocols. +endef + +define Package/mpd-mini/conffiles +/etc/mpd.conf +endef + + +CONFIGURE_ARGS += \ + $(call autoconf_bool,CONFIG_IPV6,ipv6) \ + --disable-debug \ + --disable-documentation \ + --disable-gprof \ + --disable-test \ + --disable-werror \ + \ + --disable-ao \ + --disable-bzip2 \ + --disable-cue \ + --disable-ffado \ + --disable-fluidsynth \ + --disable-gme \ + --disable-inotify \ + --disable-iso9660 \ + --disable-jack \ + --disable-lame-encoder \ + --disable-libwrap \ + --disable-lsr \ + --disable-mikmod \ + --disable-modplug \ + --disable-mpc \ + --disable-mpg123 \ + --disable-mvp \ + --disable-openal \ + --disable-pulse \ + --disable-sidplay \ + --disable-solaris-output \ + --disable-sqlite \ + --disable-twolame-encoder \ + --disable-wave-encoder \ + --disable-wavpack \ + --disable-wildmidi \ + --disable-zzip \ + --with-zeroconf=no \ + \ + --enable-curl \ + --enable-flac \ + --enable-httpd-output \ + $(call autoconf_bool,CONFIG_BUILD_PATENTED,mad) \ + $(call autoconf_bool,CONFIG_AUDIO_SUPPORT,oss) \ + --enable-tcp \ + --enable-un \ + +CONFIGURE_VARS += \ + FLAC_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/FLAC" \ + FLAC_LIBS="$(TARGET_LDFLAGS) -lFLAC" \ + $(if $(CONFIG_BUILD_PATENTED),MAD_CFLAGS="$(TARGET_CFLAGS)") \ + $(if $(CONFIG_BUILD_PATENTED),MAD_LIBS="$(TARGET_LDFLAGS) -lmad") \ + +TARGET_CFLAGS += -std=gnu99 +TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +# use gcc instead of g++ to avoid unnecessary linking against libstdc++ +TARGET_CXX:=$(TARGET_CC) + +ifeq ($(BUILD_VARIANT),full) + + CONFIGURE_ARGS += \ + $(call autoconf_bool,CONFIG_BUILD_PATENTED,aac) \ + $(call autoconf_bool,CONFIG_AUDIO_SUPPORT,alsa) \ + --enable-audiofile \ + --enable-fifo \ + --enable-ffmpeg \ + --enable-id3 \ + --enable-lastfm \ + --enable-mms \ + --enable-oggflac \ + --enable-pipe-output \ + --enable-recorder-output \ + --enable-shout \ + --enable-sndfile \ + --enable-vorbis \ + --enable-vorbis-encoder \ + --with-faad="$(STAGING_DIR)/usr" \ + --with-tremor=no \ + +endif + +ifeq ($(BUILD_VARIANT),mini) + + # oggflac is not compatible with tremor + CONFIGURE_ARGS += \ + --disable-aac \ + --disable-alsa \ + --disable-audiofile \ + --disable-fifo \ + --disable-ffmpeg \ + --disable-id3 \ + --disable-lastfm \ + --disable-mms \ + --disable-oggflac \ + --disable-pipe-output \ + --disable-recorder-output \ + --disable-shout \ + --disable-sndfile \ + --disable-vorbis \ + --disable-vorbis-encoder \ + --with-tremor=yes \ + +endif + +define Package/mpd/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/mpd $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_BUILD_DIR)/doc/mpdconf.example $(1)/etc/mpd.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mpd.init $(1)/etc/init.d/mpd +endef + +define Package/mpd-full/install +$(call Package/mpd/install,$1) + $(INSTALL_DIR) $(1)/etc/avahi/services + $(INSTALL_DATA) ./files/mpd.service $(1)/etc/avahi/services/ +endef + +define Package/mpd-mini/install +$(call Package/mpd/install,$1) +endef + +$(eval $(call BuildPackage,mpd-full)) +$(eval $(call BuildPackage,mpd-mini)) diff --git a/sound/mpd/files/mpd.init b/sound/mpd/files/mpd.init new file mode 100644 index 0000000..707564b --- /dev/null +++ b/sound/mpd/files/mpd.init @@ -0,0 +1,28 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=93 + +start() { + #create mpd directories + pld=`grep ^playlist_directory /etc/mpd.conf | cut -d "\"" -f 2 | sed "s/~/\/root/g"` + if [ ! -d $pld ]; then + mkdir -m 0755 -p $pld + fi + + # Set the initial volume to something manageable + [ -x /usr/bin/amixer ] && /usr/bin/amixer set PCM 40 + + if [ -x /bin/nice ]; then + # This has real-time constraints, so let's at least tell the OS + # that this should have higher priority to avoid skipping + # when doing other things in the background. + nice -n -10 + fi + + service_start /usr/bin/mpd +} + +stop() { + service_stop /usr/bin/mpd +} diff --git a/sound/mpd/files/mpd.service b/sound/mpd/files/mpd.service new file mode 100644 index 0000000..086a2bb --- /dev/null +++ b/sound/mpd/files/mpd.service @@ -0,0 +1,9 @@ + + + + Music Player Daemon on %h + + _mpd._tcp + 6600 + + diff --git a/sound/mpd/patches/100-compile-fixes.patch b/sound/mpd/patches/100-compile-fixes.patch new file mode 100644 index 0000000..cd05159 --- /dev/null +++ b/sound/mpd/patches/100-compile-fixes.patch @@ -0,0 +1,27 @@ +Index: mpd-0.16.1/configure +=================================================================== +--- mpd-0.16.1.orig/configure 2011-01-10 02:58:36.000000000 +0100 ++++ mpd-0.16.1/configure 2011-03-10 13:01:31.000000000 +0100 +@@ -8718,6 +8718,7 @@ + # Check whether --with-faad was given. + if test "${with_faad+set}" = set; then : + withval=$with_faad; ++ faad_prefix=$with_faad; + else + faad_prefix="" + fi +Index: mpd-0.16.1/src/input/file_input_plugin.c +=================================================================== +--- mpd-0.16.1.orig/src/input/file_input_plugin.c 2011-01-10 02:58:08.000000000 +0100 ++++ mpd-0.16.1/src/input/file_input_plugin.c 2011-03-10 13:02:15.000000000 +0100 +@@ -79,10 +79,6 @@ + return false; + } + +-#ifdef POSIX_FADV_SEQUENTIAL +- posix_fadvise(fd, (off_t)0, st.st_size, POSIX_FADV_SEQUENTIAL); +-#endif +- + fis = g_new(struct file_input_stream, 1); + input_stream_init(&fis->base, &input_plugin_file, filename); + diff --git a/sound/mpdas/Makefile b/sound/mpdas/Makefile new file mode 100644 index 0000000..b0b1f1f --- /dev/null +++ b/sound/mpdas/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2009-2011 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:=mpdas +PKG_VERSION:=0.3.0 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://50hz.ws/mpdas +PKG_MD5SUM:=d9f6e4d3b000d95835f39fb1aa3f4b28 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/mpdas + SECTION:=sound + CATEGORY:=Sound + TITLE:=A MPD client which submits your tracks to Last.Fm + DEPENDS:=+libcurl +libmpd +libstdcpp + URL:=http://50hz.ws/mpdas/ +endef + +define Package/mpdas/description + mpdas is an AudioScrobbler client for MPD written in C++. + It supports the latest AudioScrobbler protocol (2.0). + In case of a downtime or connectivity problems, mpdas will + cache the played songs to ~/.mpdascache. +endef + +define Package/mpdas/conffiles +/etc/mpdasrc +endef + +EXTRA_CPPFLAGS:=\ + -I$(ICONV_PREFIX)/include \ + -I$(INTL_PREFIX)/include \ + +EXTRA_LDFLAGS:=\ + -L$(ICONV_PREFIX)/lib \ + -L$(INTL_PREFIX)/lib \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +MAKE_FLAGS += \ + CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDPFLAGS) $(EXTRA_LDFLAGS)" + +define Package/mpdas/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/mpdasrc $(1)/etc/mpdasrc + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mpdas $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mpdas.init $(1)/etc/init.d/mpdas +endef + +$(eval $(call BuildPackage,mpdas)) diff --git a/sound/mpdas/files/mpdas.init b/sound/mpdas/files/mpdas.init new file mode 100644 index 0000000..ba64d95 --- /dev/null +++ b/sound/mpdas/files/mpdas.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2011 OpenWrt.org + +START=94 + +SERVICE_DAEMONIZE=1 + +start() { + HOME=/root \ + service_start /usr/bin/mpdas -c /etc/mpdasrc +} + +stop() { + service_stop /usr/bin/mpdas +} diff --git a/sound/mpdas/files/mpdasrc b/sound/mpdas/files/mpdasrc new file mode 100644 index 0000000..34af9a7 --- /dev/null +++ b/sound/mpdas/files/mpdasrc @@ -0,0 +1,5 @@ +username = username_here +# create md5 password: +# echo -n password | md5sum +password = md5_hash_here +debug = 0 diff --git a/sound/mpdas/patches/001-flags.patch b/sound/mpdas/patches/001-flags.patch new file mode 100644 index 0000000..11a6a6d --- /dev/null +++ b/sound/mpdas/patches/001-flags.patch @@ -0,0 +1,20 @@ +Index: mpdas-0.3.0/Makefile +=================================================================== +--- mpdas-0.3.0.orig/Makefile 2010-11-22 02:15:12.000000000 +0100 ++++ mpdas-0.3.0/Makefile 2011-07-20 16:53:31.000000000 +0200 +@@ -3,12 +3,12 @@ + CXX ?= g++ + OBJ = main.o md5.o utils.o mpd.o audioscrobbler.o cache.o config.o + OUT = mpdas +-PREFIX ?= /usr/local ++PREFIX ?= / + MANPREFIX ?= ${PREFIX}/man/man1 + CONFIG ?= $(PREFIX)/etc + +-CXXFLAGS += `pkg-config --cflags libmpd libcurl` +-LIBS = `pkg-config --libs libmpd libcurl` ++CXXFLAGS += $(CPPFLAGS) `pkg-config --cflags libmpd libcurl` ++LIBS = $(LDFLAGS) `pkg-config --libs libmpd libcurl` + + CXXFLAGS += -DCONFDIR="\"$(CONFIG)\"" -DVERSION="\"$(VERSION)\"" + diff --git a/sound/mt-daapd/Makefile b/sound/mt-daapd/Makefile new file mode 100644 index 0000000..75e1664 --- /dev/null +++ b/sound/mt-daapd/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2005-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mt-daapd +PKG_VERSION:=0.2.4.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=67bef9fb14d487693b0dfb792c3f1b05 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/mt-daapd + SECTION:=sound + CATEGORY:=Sound + DEPENDS:=+libgdbm +libhowl +libid3tag +libpthread + TITLE:=A multi-threaded DAAP (Digital Audio Access Protocol) daemon + URL:=http://www.fireflymediaserver.org/ +endef + +define Package/mt-daapd/description + mt-daapd is a program which acts as an iTunes (DAAP) server for Linux. +endef + +define Package/mt-daapd/conffiles +/etc/mt-daapd.conf +/etc/mt-daapd.playlist +endef + +CONFIGURE_ARGS += \ + --enable-mdns \ + --enable-howl \ + --with-id3tag="$(STAGING_DIR)/usr" \ + --with-gdbm-includes="$(STAGING_DIR)/usr/include" \ + --with-gdbm-libs="$(STAGING_DIR)/usr/lib" \ + --with-howl-includes="$(STAGING_DIR)/usr/include/howl" \ + --with-howl-libs="$(STAGING_DIR)/usr/lib" \ + --without-static-libs \ + +define Package/mt-daapd/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/contrib/mt-daapd.conf $(1)/etc/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/contrib/mt-daapd.playlist $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/mt-daapd $(1)/usr/share/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mt-daapd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mt-daapd.init $(1)/etc/init.d/mt-daapd +endef + +$(eval $(call BuildPackage,mt-daapd)) diff --git a/sound/mt-daapd/files/mt-daapd.init b/sound/mt-daapd/files/mt-daapd.init new file mode 100644 index 0000000..720c7d8 --- /dev/null +++ b/sound/mt-daapd/files/mt-daapd.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 + +BIN=mt-daapd +DEFAULT=/etc/default/$BIN +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid + +start() { + [ -f $DEFAULT ] && . $DEFAULT + [ -d $RUN_D ] || mkdir -p $RUN_D + $BIN $OPTIONS +} + +stop() { + [ -f $PID_F ] && kill -INT $(cat $PID_F) +} + diff --git a/sound/pianobar/Makefile b/sound/pianobar/Makefile new file mode 100644 index 0000000..e9c3e8e --- /dev/null +++ b/sound/pianobar/Makefile @@ -0,0 +1,82 @@ +# +# Copyright (C) 2012 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:=pianobar +PKG_VERSION:=2012.01.10 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://6xq.net/static/projects/pianobar +PKG_MD5SUM:=448c57d65c71158674e8b30a8cfa217e + +PKG_BUILD_DEPENDS:=libao libfaad2 libmad +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/pianobar/Default + DEPENDS:=+libgnutls + TITLE:=Pandora radio + URL:=http://6xq.net/projects/pianobar/ +endef + +define Package/pianobar/Default/description + Pianobar is a free/open-source, console-based replacement for Pandora’s flash + player. +endef + +define Package/pianobar + $(call Package/pianobar/Default) + SECTION:=sound + CATEGORY:=Sound + DEPENDS+= +libao +libfaad2 +libmad +libpiano +libpthread + TITLE+= console client +endef + +define Package/pianobar/description + $(call Package/pianobar/Default/description) +endef + +define Package/libpiano + $(call Package/pianobar/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= library +endef + +define Package/libpiano/description + $(call Package/pianobar/Default/description) + This package contains the libpiano shared library. +endef + +TARGET_CFLAGS += -std=c99 + +MAKE_FLAGS += \ + DYNLINK="1" \ + PREFIX="/usr" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpiano.{a,so*} $(1)/usr/lib/ +endef + +define Package/pianobar/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pianobar $(1)/usr/bin/ +endef + +define Package/libpiano/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpiano.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,pianobar)) +$(eval $(call BuildPackage,libpiano)) diff --git a/sound/pianobar/patches/001-verbose.patch b/sound/pianobar/patches/001-verbose.patch new file mode 100644 index 0000000..ae4c4b5 --- /dev/null +++ b/sound/pianobar/patches/001-verbose.patch @@ -0,0 +1,57 @@ +--- a/Makefile ++++ b/Makefile +@@ -91,14 +91,12 @@ LIBGNUTLS_LDFLAGS=-lgnutls + # build pianobar + ifeq (${DYNLINK},1) + pianobar: ${PIANOBAR_OBJ} ${PIANOBAR_HDR} libpiano.so.0 +- @echo " LINK $@" +- @${CC} -o $@ ${PIANOBAR_OBJ} ${LDFLAGS} -lao -lpthread -lm -L. -lpiano \ ++ ${CC} -o $@ ${PIANOBAR_OBJ} ${LDFLAGS} -lao -lpthread -lm -L. -lpiano \ + ${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} ${LIBGNUTLS_LDFLAGS} + else + pianobar: ${PIANOBAR_OBJ} ${PIANOBAR_HDR} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} \ + ${LIBWAITRESS_HDR} ${LIBEZXML_OBJ} ${LIBEZXML_HDR} +- @echo " LINK $@" +- @${CC} ${CFLAGS} ${LDFLAGS} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} \ ++ ${CC} ${CFLAGS} ${LDFLAGS} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} \ + ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ} -lao -lpthread -lm \ + ${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} ${LIBGNUTLS_LDFLAGS} -o $@ + endif +@@ -107,30 +105,25 @@ endif + libpiano.so.0: ${LIBPIANO_RELOBJ} ${LIBPIANO_HDR} ${LIBWAITRESS_RELOBJ} \ + ${LIBWAITRESS_HDR} ${LIBEZXML_RELOBJ} ${LIBEZXML_HDR} \ + ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ} +- @echo " LINK $@" +- @${CC} -shared -Wl,-soname,libpiano.so.0 ${CFLAGS} ${LDFLAGS} ${LIBGNUTLS_LDFLAGS} \ ++ ${CC} -shared -Wl,-soname,libpiano.so.0 ${CFLAGS} ${LDFLAGS} ${LIBGNUTLS_LDFLAGS} \ + -o libpiano.so.0.0.0 ${LIBPIANO_RELOBJ} \ + ${LIBWAITRESS_RELOBJ} ${LIBEZXML_RELOBJ} +- @ln -s libpiano.so.0.0.0 libpiano.so.0 +- @ln -s libpiano.so.0 libpiano.so +- @echo " AR libpiano.a" +- @${AR} rcs libpiano.a ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ} ++ ln -s libpiano.so.0.0.0 libpiano.so.0 ++ ln -s libpiano.so.0 libpiano.so ++ ${AR} rcs libpiano.a ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ} + + %.o: %.c +- @echo " CC $<" +- @${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \ ++ ${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \ + -I ${LIBEZXML_INCLUDE} ${LIBFAAD_CFLAGS} \ + ${LIBMAD_CFLAGS} ${LIBGNUTLS_CFLAGS} -c -o $@ $< + + # create position independent code (for shared libraries) + %.lo: %.c +- @echo " CC $< (PIC)" +- @${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \ ++ ${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \ + -I ${LIBEZXML_INCLUDE} -c -fPIC -o $@ $< + + clean: +- @echo " CLEAN" +- @${RM} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBWAITRESS_OBJ}/test.o \ ++ ${RM} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBWAITRESS_OBJ}/test.o \ + ${LIBEZXML_OBJ} ${LIBPIANO_RELOBJ} ${LIBWAITRESS_RELOBJ} \ + ${LIBEZXML_RELOBJ} pianobar libpiano.so* libpiano.a waitress-test + diff --git a/sound/pianobar/patches/002-force-symlinks.patch b/sound/pianobar/patches/002-force-symlinks.patch new file mode 100644 index 0000000..cacaa49 --- /dev/null +++ b/sound/pianobar/patches/002-force-symlinks.patch @@ -0,0 +1,24 @@ +--- a/Makefile ++++ b/Makefile +@@ -108,8 +108,8 @@ libpiano.so.0: ${LIBPIANO_RELOBJ} ${LIBP + ${CC} -shared -Wl,-soname,libpiano.so.0 ${CFLAGS} ${LDFLAGS} ${LIBGNUTLS_LDFLAGS} \ + -o libpiano.so.0.0.0 ${LIBPIANO_RELOBJ} \ + ${LIBWAITRESS_RELOBJ} ${LIBEZXML_RELOBJ} +- ln -s libpiano.so.0.0.0 libpiano.so.0 +- ln -s libpiano.so.0 libpiano.so ++ ln -sf libpiano.so.0.0.0 libpiano.so.0 ++ ln -sf libpiano.so.0 libpiano.so + ${AR} rcs libpiano.a ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ} + + %.o: %.c +@@ -177,8 +177,8 @@ endif + install-libpiano: + install -d ${DESTDIR}/${LIBDIR}/ + install -m644 libpiano.so.0.0.0 ${DESTDIR}/${LIBDIR}/ +- ln -s libpiano.so.0.0.0 ${DESTDIR}/${LIBDIR}/libpiano.so.0 +- ln -s libpiano.so.0 ${DESTDIR}/${LIBDIR}/libpiano.so ++ ln -sf libpiano.so.0.0.0 ${DESTDIR}/${LIBDIR}/libpiano.so.0 ++ ln -sf libpiano.so.0 ${DESTDIR}/${LIBDIR}/libpiano.so + install -m644 libpiano.a ${DESTDIR}/${LIBDIR}/ + install -d ${DESTDIR}/${INCDIR}/ + install -m644 src/libpiano/piano.h ${DESTDIR}/${INCDIR}/ diff --git a/sound/pulseaudio/Makefile b/sound/pulseaudio/Makefile new file mode 100644 index 0000000..3cbbaa4 --- /dev/null +++ b/sound/pulseaudio/Makefile @@ -0,0 +1,265 @@ +# +# Copyright (C) 2011 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:=pulseaudio +PKG_VERSION:=2.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=http://freedesktop.org/software/pulseaudio/releases/ +PKG_MD5SUM:=33e85023259d530f0a763d5204e8bad9 + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_DEPENDS:=intltool/host + +PKG_FIXUP:=autoreconf + +PKG_INSTALL = 1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +#TODO: split pulse into executable and library (or even better into several libraries since they're used as loadable modules, so not linked into) +define Package/pulseaudio/Default + SECTION:=sound + CATEGORY:=Sound + DEPENDS:=+libspeexdsp +libsndfile +libltdl +libpthread \ + +librt +alsa-lib +libjson +libopenssl +udev $(ICONV_DEPENDS) $(INTL_DEPENDS) + TITLE:=Network sound server + URL:=http://www.pulseaudio.org + PROVIDES:=pulseaudio +endef + +define Package/pulseaudio-daemon + $(call Package/pulseaudio/Default) + VARIANT:=noavahi +endef + +define Package/pulseaudio-daemon-avahi + $(call Package/pulseaudio/Default) + DEPENDS+=+dbus +libavahi-client +avahi-daemon + TITLE+= (avahi) + VARIANT:=avahi +endef + +define Package/pulseaudio/Default/description + PulseAudio (formerly Polypaudio) is a cross-platform, networked sound server. +endef + +define Package/pulseaudio-daemon/description + $(call Package/pulseaudio/Default/description) +endef + +define Package/pulseaudio-daemon-avahi/description + $(call Package/pulseaudio/Default/description) + This package is compiled against dbus and avahi. +endef + +define Package/pulseaudio-daemon/conffiles +/etc/pulse/client.conf +/etc/pulse/daemon.conf +/etc/pulse/default.pa +/etc/pulse/system.pa +endef + +define Package/pulseaudio-daemon-avahi/conffiles +/etc/pulse/client.conf +/etc/pulse/daemon.conf +/etc/pulse/default.pa +/etc/pulse/system.pa +endef + +define Package/pulseaudio-tools + SECTION:=sound + CATEGORY:=Sound + DEPENDS:=+libsndfile pulseaudio + TITLE:=Tools for Pulseaudio + URL:=http://www.pulseaudio.org + VARIANT:=noavahi +endef + +define Package/pulseaudio-profiles + SECTION:=sound + CATEGORY:=Sound + DEPENDS:=pulseaudio + TITLE:=Profiles for Pulseaudio + URL:=http://www.pulseaudio.org +endef + +CONFIGURE_ARGS += \ + --with-system-user=pulse \ + --with-system-group=pulse \ + --with-access-group=audio \ + --with-database=simple \ + --enable-alsa \ + --disable-hal \ + --disable-gconf \ + --disable-tcpwrap \ + --disable-nls \ + --disable-manpages \ + --enable-oss-output \ + --disable-oss-wrapper \ + --disable-samplerate \ + --disable-per-user-esound-socket \ + --disable-solaris \ + --disable-gtk2 \ + --disable-glib2 \ + --disable-jack \ + --disable-asyncns \ + --disable-lirc \ + --disable-bluez \ + --without-caps \ + --without-fftw + +ifeq ($(BUILD_VARIANT),avahi) +CONFIGURE_ARGS += \ + --enable-avahi \ + --enable-dbus +endif + +ifeq ($(BUILD_VARIANT),noavahi) +CONFIGURE_ARGS += \ + --disable-avahi \ + --disable-dbus +endif + +CONFIGURE_VARS += \ + PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig" + +#SUPP_LIBS:=-L$(INTL_PREFIX)/lib -L$(ICONV_PREFIX)/lib +TARGET_CFLAGS += -std=gnu99 + +define Build/InstallDev + $(INSTALL_DIR) \ + $(1)/usr/lib/pkgconfig \ + $(1)/usr/include/pulse \ + $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/pulse/* \ + $(1)/usr/include/pulse + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \ + $(1)/usr/lib/pkgconfig + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.so* \ + $(1)/usr/lib/ +endef + +define Package/pulseaudio-daemon/install + $(INSTALL_DIR) \ + $(1)/etc/pulse \ + $(1)/etc/init.d \ + $(1)/usr/bin \ + $(1)/usr/lib \ + $(1)/usr/lib/pulseaudio \ + $(1)/usr/lib/pulse-$(PKG_VERSION)/modules + + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/pulseaudio \ + $(1)/usr/bin/pulseaudio + + $(INSTALL_BIN) \ + ./files/pulseaudio.init \ + $(1)/etc/init.d/pulseaudio + + $(INSTALL_CONF) \ + $(PKG_INSTALL_DIR)/etc/pulse/* \ + $(1)/etc/pulse + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.so* \ + $(1)/usr/lib/ + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/* \ + $(1)/usr/lib/pulseaudio/ + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/lib*.so \ + $(1)/usr/lib/ + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/module*.so \ + $(1)/usr/lib/pulse-$(PKG_VERSION)/modules/ + + chmod -R 0644 $(1)/etc/pulse/* +endef + +define Package/pulseaudio-daemon-avahi/install + $(INSTALL_DIR) \ + $(1)/etc/pulse \ + $(1)/etc/init.d \ + $(1)/usr/bin \ + $(1)/usr/lib \ + $(1)/usr/lib/pulseaudio \ + $(1)/usr/lib/pulse-$(PKG_VERSION)/modules \ + $(1)/etc/dbus-1/system.d + + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/pulseaudio \ + $(1)/usr/bin/pulseaudio + + $(INSTALL_BIN) \ + ./files/pulseaudio.init \ + $(1)/etc/init.d/pulseaudio + + $(INSTALL_CONF) \ + $(PKG_INSTALL_DIR)/etc/pulse/* \ + $(1)/etc/pulse + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/*.so* \ + $(1)/usr/lib/ + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/* \ + $(1)/usr/lib/pulseaudio/ + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/lib*.so \ + $(1)/usr/lib/ + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/module*.so \ + $(1)/usr/lib/pulse-$(PKG_VERSION)/modules/ + + $(INSTALL_CONF) \ + $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/pulseaudio-system.conf \ + $(1)/etc/dbus-1/system.d/pulseaudio-system.conf + + chmod -R 0644 $(1)/etc/pulse/* $(1)/etc/dbus-1/system.d/pulseaudio-system.conf +endef + +define Package/pulseaudio-tools/install + $(INSTALL_DIR) \ + $(1)/usr/bin + + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/pa* \ + $(1)/usr/bin/ +endef + +define Package/pulseaudio-profiles/install + $(INSTALL_DIR) \ + $(1)/usr/share/pulseaudio/alsa-mixer/paths \ + $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets + + $(INSTALL_CONF) \ + $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/paths/* \ + $(1)/usr/share/pulseaudio/alsa-mixer/paths + + $(INSTALL_CONF) \ + $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/profile-sets/* \ + $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets +endef + +$(eval $(call BuildPackage,pulseaudio-daemon)) +$(eval $(call BuildPackage,pulseaudio-daemon-avahi)) +$(eval $(call BuildPackage,pulseaudio-tools)) +$(eval $(call BuildPackage,pulseaudio-profiles)) diff --git a/sound/pulseaudio/files/pulseaudio.init b/sound/pulseaudio/files/pulseaudio.init new file mode 100644 index 0000000..0ae8f1b --- /dev/null +++ b/sound/pulseaudio/files/pulseaudio.init @@ -0,0 +1,27 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2011 OpenWrt.org + +START=65 + +SERVICE_USE_PID=1 +SERVICE_PID_FILE=/var/run/pulse/pid + +start() { + user_exists pulse 51 || user_add pulse 51 + group_exists pulse 51 || group_add pulse 51 + [ -d /var/run/pulse ] || { + mkdir -m 0755 -p /var/run/pulse + chmod 0750 /var/run/pulse + chown pulse:pulse /var/run/pulse + } + [ -d /var/lib/pulse ] || { + mkdir -m 0755 -p /var/lib/pulse + chmod 0750 /var/lib/pulse + chown pulse:pulse /var/lib/pulse + } + service_start /usr/bin/pulseaudio --daemonize --system --disallow-exit --disallow-module-loading --disable-shm --exit-idle-time=-1 +} + +stop() { + service_stop /usr/bin/pulseaudio +} diff --git a/sound/pulseaudio/patches/001-no_default_64mb_alloc.patch b/sound/pulseaudio/patches/001-no_default_64mb_alloc.patch new file mode 100644 index 0000000..8762554 --- /dev/null +++ b/sound/pulseaudio/patches/001-no_default_64mb_alloc.patch @@ -0,0 +1,13 @@ +Index: pulseaudio-0.99.2/src/pulsecore/memblock.c +=================================================================== +--- pulseaudio-0.99.2.orig/src/pulsecore/memblock.c 2011-08-15 10:41:56.000000000 +0200 ++++ pulseaudio-0.99.2/src/pulsecore/memblock.c 2011-08-18 13:54:53.000000000 +0200 +@@ -57,7 +57,7 @@ + * stored in SHM and our OS does not commit the memory before we use + * it for the first time. */ + #define PA_MEMPOOL_SLOTS_MAX 1024 +-#define PA_MEMPOOL_SLOT_SIZE (64*1024) ++#define PA_MEMPOOL_SLOT_SIZE 64 + + #define PA_MEMEXPORT_SLOTS_MAX 128 + diff --git a/sound/scmpc/Makefile b/sound/scmpc/Makefile new file mode 100644 index 0000000..a067f82 --- /dev/null +++ b/sound/scmpc/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2006-2011 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:=scmpc +PKG_VERSION:=0.2.2 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://download.berlios.de/scmpc +PKG_MD5SUM:=f42482e4dbf398df92a36d5610b403e5 + +include $(INCLUDE_DIR)/package.mk + +define Package/scmpc + SECTION:=sound + CATEGORY:=Sound + TITLE:=A MPD client which submits your tracks to Last.Fm + DEPENDS:=+libcurl +libdaemon +argtable +confuse +libpthread + URL:=http://scmpc.berlios.de/ +endef + +define Package/scmpc/description + scmpc is a multithreaded, robust client for MPD to submit tracks to Audioscrobbler (Last.fm). +endef + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-rpath \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + +MAKE_FLAGS += \ + $(TARGET_CONFIGURE_OPTS) \ + $(1) \ + +TARGET_LDFLAGS += \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +define Package/scmpc/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/src/scmpc $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/scmpc.init $(1)/etc/init.d/scmpc + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_BUILD_DIR)/examples/scmpc.conf $(1)/etc/ +endef + +define Package/scmpc/conffiles +/etc/scmpc.conf +endef + +$(eval $(call BuildPackage,scmpc)) diff --git a/sound/scmpc/files/scmpc.init b/sound/scmpc/files/scmpc.init new file mode 100644 index 0000000..5327b6b --- /dev/null +++ b/sound/scmpc/files/scmpc.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=94 + +SERVICE_USE_PID=1 + +start() { + mkdir -m 0755 -p /var/lib/scmpc + service_start /usr/bin/scmpc +} + +stop() { + service_stop /usr/bin/scmpc +} diff --git a/sound/scmpc/patches/100-Rules.patch b/sound/scmpc/patches/100-Rules.patch new file mode 100644 index 0000000..f9ad44d --- /dev/null +++ b/sound/scmpc/patches/100-Rules.patch @@ -0,0 +1,11 @@ +--- scmpc-0.2.2/src/Rules.mkorig 2007-10-31 23:32:48.000000000 +0100 ++++ scmpc-0.2.2/src/Rules.mk 2007-10-31 23:19:00.000000000 +0100 +@@ -16,7 +16,7 @@ + -include $(DEPENDS) + + DEFINES := -DHAVE_CONFIG_H -D_GNU_SOURCE +-INCLUDES := -I$(src_d) -I$(src_b) ++INCLUDES := -I$(src_d) -I$(src_b) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include + LDLIBS := $(LIBS) + + CLEAN += $(OBJS) $(PROGRAM) diff --git a/sound/shell-fm/Makefile b/sound/shell-fm/Makefile new file mode 100644 index 0000000..2c08ca4 --- /dev/null +++ b/sound/shell-fm/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=shell-fm +PKG_REV:=c274aa51b52185b289ac22f0cb95420a1c19868b +PKG_VERSION:=0.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://github.com/jkramer/shell-fm.git +PKG_SOURCE_VERSION:=$(PKG_REV) + +include $(INCLUDE_DIR)/package.mk + +define Package/shell-fm + SECTION:=sound + CATEGORY:=Sound + DEPENDS:=+libao +libpthread +libmad + TITLE:=Console Based Last.FM Radio Player + URL:=http://nex.scrapping.cc +endef + +define Package/shell-fm/description + Shell.FM is a console based player for the streams provided + by Last.FM for the Linux platform. It's lightweight and easy to use. +endef + +define Package/shell-fm/conffiles +/etc/shell-fm.rc +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) -I./include/ -DLIBAO $(TARGET_CPPFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + LDFLAGS="$(TARGET_LDFLAGS) -lmad -lao -lpthread" \ + all install +endef + +define Package/shell-fm/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/shell-fm $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/shell-fm.rc $(1)/etc/shell-fm.rc + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/shell-fm.init $(1)/etc/init.d/shell-fm +endef + +$(eval $(call BuildPackage,shell-fm)) diff --git a/sound/shell-fm/files/shell-fm.init b/sound/shell-fm/files/shell-fm.init new file mode 100644 index 0000000..f0403b6 --- /dev/null +++ b/sound/shell-fm/files/shell-fm.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +START=99 +start() { + [ -d /tmp/.shell-fm ] || mkdir /tmp/.shell-fm + [ -L /tmp/.shell-fm/shell-fm.rc ] || ln -s /etc/shell-fm.rc /tmp/.shell-fm/shell-fm.rc + [ -L /tmp/.libao ] || ln -s /etc/libao.conf /tmp/.libao + HOME=/tmp shell-fm -d +} + +stop() { + echo "quit" | telnet localhost 54311 +} diff --git a/sound/shell-fm/files/shell-fm.rc b/sound/shell-fm/files/shell-fm.rc new file mode 100644 index 0000000..b3f6a2d --- /dev/null +++ b/sound/shell-fm/files/shell-fm.rc @@ -0,0 +1,9 @@ +username = username +password = password +#np-cmd = netmsg "%a - %t" +default-radio = lastfm://artist/Nightwish/similarartists +t-color = 1;32 # light green track titles +a-color = 0;32 # dark green track artist names +s-color = 1;37 # white station names +bind = 0.0.0.0 +#extern = madplay -q - diff --git a/sound/sox/Makefile b/sound/sox/Makefile new file mode 100644 index 0000000..1f0a736 --- /dev/null +++ b/sound/sox/Makefile @@ -0,0 +1,89 @@ +# +# Copyright (C) 2008 David Cooper +# Copyright (C) 2006-2012 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:=sox +PKG_VERSION:=14.4.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/sox +PKG_MD5SUM:=813807c6d6fcd4b0af5c995e61f46687 + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_LDFLAGS+= \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +# NOTE: libflac is out of date for 8.09's freeze and can't be compiled in + +define Package/sox + SECTION:=sound + CATEGORY:=Sound + DEPENDS:=+BUILD_PATENTED:lame-lib +BUILD_PATENTED:libmad +BUILD_PATENTED:libid3tag +libvorbis +libvorbisidec +libgsm +alsa-lib +libsndfile +libflac +ffmpeg +libmagic +libpng + TITLE:=Sox is a general purpose sound converter/player/recorder + URL:=http://sox.sourceforge.net/ + MAINTAINER:=Hamish Guthrie +endef + +define Package/sox/description + SoX is a command line utility that can convert various formats + of computer audio files in to other formats. It can also apply + various effects to these sound files during the conversion. + As an added bonus, SoX can play and record audio files on + several unix-style platforms. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-external-gsm \ + --disable-oss \ + --enable-alsa \ + --disable-libao \ + --without-libltdl \ + --with-ogg \ + --with-flac \ + --with-ffmpeg \ + --without-amr-wb \ + --without-amr-nb \ + --without-samplerate \ + --without-ladspa \ + --$(if $(CONFIG_BUILD_PATENTED),with-mad,without-mad) \ + --$(if $(CONFIG_BUILD_PATENTED),with-lame,without-lame) \ + --$(if $(CONFIG_BUILD_PATENTED),with-id3tag,without-id3tag) \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include \ + $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libsox.{a,so*,la} \ + $(1)/usr/lib/ + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/sox/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/bin/{play,rec,sox} $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsox.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,sox)) + diff --git a/sound/sox/patches/001-cross_compile.patch b/sound/sox/patches/001-cross_compile.patch new file mode 100644 index 0000000..2d7fe5d --- /dev/null +++ b/sound/sox/patches/001-cross_compile.patch @@ -0,0 +1,22 @@ +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -144,7 +144,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 + + play rec: sox$(EXEEXT) + if test "$(PLAYRECLINKS)" = "yes"; then \ +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -2849,7 +2849,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 + + play rec: sox$(EXEEXT) + if test "$(PLAYRECLINKS)" = "yes"; then \ diff --git a/sound/sox/patches/010-fix_uclibc_build_issue.patch b/sound/sox/patches/010-fix_uclibc_build_issue.patch new file mode 100644 index 0000000..410d295 --- /dev/null +++ b/sound/sox/patches/010-fix_uclibc_build_issue.patch @@ -0,0 +1,20 @@ +--- a/src/formats.c ++++ b/src/formats.c +@@ -408,7 +408,7 @@ static void UNUSED rewind_pipe(FILE * fp + #if defined _FSTDIO || defined _NEWLIB_VERSION || defined __APPLE__ + fp->_p -= AUTO_DETECT_SIZE; + fp->_r += AUTO_DETECT_SIZE; +-#elif defined __GLIBC__ ++#elif defined __GLIBC__ && ! defined __UCLIBC__ + fp->_IO_read_ptr = fp->_IO_read_base; + #elif defined _MSC_VER || defined __MINGW_H || defined _ISO_STDIO_ISO_H + fp->_ptr = fp->_base; +@@ -416,7 +416,7 @@ 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.au | ./sox --info - */ +- #error FIX NEEDED HERE ++/* #error FIX NEEDED HERE */ + #define NO_REWIND_PIPE + (void)fp; + #endif diff --git a/sound/streamripper/Makefile b/sound/streamripper/Makefile new file mode 100644 index 0000000..cf238ab --- /dev/null +++ b/sound/streamripper/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=streamripper +PKG_VERSION:=1.62.0 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=1a8353af3c36d56f2d8ee8552f632071 + +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf +PKG_LIBTOOL_PATHS:=. tre-0.7.2 + +include $(INCLUDE_DIR)/package.mk + +define Package/streamripper + SECTION:=multimedia + CATEGORY:=Multimedia + DEPENDS:=+libmad +libfaad2 +libpthread + TITLE:=streamripper + URL:=http://streamripper.sourceforge.net/ +endef + +define Package/streamripper/description + Streamripper is an Open Source application that lets you record streaming mp3 to your hard drive. +endef + + +EXTRA_CFLAGS += $(TARGET_CPPFLAGS) + +CONFIGURE_ARGS+= \ + --without-ogg \ + --with-included-argv \ + --without-included-libmad \ + --without-libiconv-prefix \ + --with-included-tre \ + --with-gnu-ld \ + +define Package/streamripper/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/streamripper $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/agrep $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtre.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,streamripper)) diff --git a/utils/acpid/Makefile b/utils/acpid/Makefile new file mode 100644 index 0000000..23a07ec --- /dev/null +++ b/utils/acpid/Makefile @@ -0,0 +1,65 @@ +# +# Copyright (C) 2012 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:=acpid +PKG_VERSION:=2.0.10 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://tedfelix.com/linux/ +PKG_MD5SUM:=d5dd88bcfaa4a0bf51905e95115da6df + +include $(INCLUDE_DIR)/package.mk + +define Package/acpid + SECTION:=utils + CATEGORY:=Utilities + TITLE:=The ACPI Daemon (acpid) With Netlink Support + URL:=http://tedfelix.com/linux/acpid-netlink.html + DEPENDS:=+kmod-input-evdev +kmod-acpi-button +endef + +define Package/acpid/description + The ACPI Daemon (acpid) With Netlink Support +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + LD="$(TARGET_CC)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + all +endef + +define Package/acpid/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/acpid $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/acpi_listen $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/acpi/events + $(INSTALL_CONF) ./files/default $(1)/etc/acpi/events/default + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_CONF) ./files/acpid.init $(1)/etc/init.d/acpid + chmod 0750 $(1)/etc/init.d/acpid + $(INSTALL_DIR) $(1)/etc/hotplug.d/input/ + $(INSTALL_CONF) ./files/acpid.hotplug $(1)/etc/hotplug.d/input/ +endef + +define Package/acpid/postinst +#!/bin/sh +[ -n "$${IPKG_INSTROOT}" ] || { + echo "waiting for input devices to come up" + /etc/init.d/acpid enable + sleep 5 + /etc/init.d/acpid start + echo "please try the power button" + exit 0 +} +endef + +$(eval $(call BuildPackage,acpid)) diff --git a/utils/acpid/files/acpid.hotplug b/utils/acpid/files/acpid.hotplug new file mode 100644 index 0000000..6e08d01 --- /dev/null +++ b/utils/acpid/files/acpid.hotplug @@ -0,0 +1,7 @@ +#!/bin/sh + +. /lib/functions.sh + +if [ "$ACTION" = add ] && [ "$DEVICENAME" = event0 ]; then + ( /etc/init.d/acpid/stop; sleep 3; /usr/sbin/acpid )& +fi diff --git a/utils/acpid/files/acpid.init b/utils/acpid/files/acpid.init new file mode 100644 index 0000000..3365aa0 --- /dev/null +++ b/utils/acpid/files/acpid.init @@ -0,0 +1,25 @@ +#!/bin/ash /etc/rc.common +# Copyright (C) 2009-2010 OpenWrt.org + +START=99 +STOP=80 + +ACPID_BIN="/usr/sbin/acpid" +ACPID_PID="/var/run/acpid.pid" + +start() { + [ -x "$ACPID_BIN" ] || return 1 + start-stop-daemon -S -x $ACPID_BIN -p $ACPID_PID +} + +boot() { + # Do nothing on boot + [ -x "$ACPID_BIN" ] || return 1 + start-stop-daemon -S -x $ACPID_BIN -p $ACPID_PID + exit 0 +} + +stop() { + service_kill ${ACPID_BIN##*/} $ACPID_PID + rm -f $ACPID_PID +} diff --git a/utils/acpid/files/default b/utils/acpid/files/default new file mode 100644 index 0000000..cf8d9a3 --- /dev/null +++ b/utils/acpid/files/default @@ -0,0 +1,5 @@ +# This is a sample ACPID configuration + +event=button/power.* +action=/sbin/poweroff + diff --git a/utils/alsa-utils/Makefile b/utils/alsa-utils/Makefile new file mode 100644 index 0000000..f203ecb --- /dev/null +++ b/utils/alsa-utils/Makefile @@ -0,0 +1,92 @@ +# +# Copyright (C) 2006-2012 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:=alsa-utils +PKG_VERSION:=1.0.24.2 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/utils/ \ + http://alsa.cybermirror.org/utils/ +PKG_MD5SUM:=8238cd57cb301d1c36bcf0ecb59ce6b2 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/alsa-utils + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+alsa-lib +libncurses +libpthread + TITLE:=ALSA (Advanced Linux Sound Architecture) utilities + URL:=http://www.alsa-project.org/ +endef + +define Package/alsa-utils-seq + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+alsa-lib +libpthread + TITLE:=ALSA sequencer utilities + URL:=http://www.alsa-project.org/ +endef + +define Package/alsa-utils-tests + $(call Package/alsa-utils/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE:=ALSA utilities test data (adds ~1.3M to image) + DEPENDS:=+alsa-lib +libpthread +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-rpath \ + --disable-alsatest \ + --disable-xmlto \ + , \ + ac_cv_prog_ncurses5_config=no \ + ac_cv_prog_ncursesw5_config=no \ + ) +endef + +define Package/alsa-utils/install + $(INSTALL_DIR) $(1)/usr/{s,}bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amixer $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/alsamixer $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aplay $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/arecord $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/alsactl $(1)/usr/sbin/ + + $(INSTALL_DIR) $(1)/usr/share/alsa/init + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/alsa/init/* \ + $(1)/usr/share/alsa/init/ +endef + +define Package/alsa-utils-seq/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aconnect $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amidi $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aplaymidi $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/arecordmidi $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aseqdump $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aseqnet $(1)/usr/bin/ +endef + +define Package/alsa-utils-tests/install + $(INSTALL_DIR) $(1)/usr/{s,}bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/speaker-test $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/share/sounds/alsa + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/sounds/alsa/* \ + $(1)/usr/share/sounds/alsa/ +endef + +$(eval $(call BuildPackage,alsa-utils)) +$(eval $(call BuildPackage,alsa-utils-seq)) +$(eval $(call BuildPackage,alsa-utils-tests)) diff --git a/utils/alsa-utils/patches/100-uClibc-compat.patch b/utils/alsa-utils/patches/100-uClibc-compat.patch new file mode 100644 index 0000000..9766125 --- /dev/null +++ b/utils/alsa-utils/patches/100-uClibc-compat.patch @@ -0,0 +1,25 @@ +Index: alsa-utils-1.0.24.2/alsamixer/volume_mapping.c +=================================================================== +--- alsa-utils-1.0.24.2.orig/alsamixer/volume_mapping.c 2011-03-11 13:26:29.000000000 +0100 ++++ alsa-utils-1.0.24.2/alsamixer/volume_mapping.c 2011-03-11 13:27:58.000000000 +0100 +@@ -109,9 +109,9 @@ + if (use_linear_dB_scale(min, max)) + return (value - min) / (double)(max - min); + +- normalized = exp10((value - max) / 6000.0); ++ normalized = pow(10, (value - max) / 6000.0); + if (min != SND_CTL_TLV_DB_GAIN_MUTE) { +- min_norm = exp10((min - max) / 6000.0); ++ min_norm = pow(10, (min - max) / 6000.0); + normalized = (normalized - min_norm) / (1 - min_norm); + } + +@@ -144,7 +144,7 @@ + } + + if (min != SND_CTL_TLV_DB_GAIN_MUTE) { +- min_norm = exp10((min - max) / 6000.0); ++ min_norm = pow(10, (min - max) / 6000.0); + volume = volume * (1 - min_norm) + min_norm; + } + value = lrint_dir(6000.0 * log10(volume), dir) + max; diff --git a/utils/anyremote/Makefile b/utils/anyremote/Makefile new file mode 100644 index 0000000..bf2930d --- /dev/null +++ b/utils/anyremote/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2008-2011 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:=anyremote +PKG_VERSION:=4.7.1 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/${PKG_NAME} +PKG_MD5SUM:=bd177156faa8a59a5d3e02cada243fc3 + +include $(INCLUDE_DIR)/package.mk + +define Package/anyremote + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A bluetooth remote control app + DEPENDS:=+bluez-libs + URL:=http://anyremote.sourceforge.net/ +endef + +define Package/anyremote/description + Remote control your machine via bluetooth +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-xtest \ + ) +endef + +define Package/anyremote/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/anyremote.cfg $(1)/etc/anyremote.cfg + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/anyremote.init $(1)/etc/init.d/anyremote +endef + +define Package/anyremote/conffiles +/etc/anyremote.cfg +endef + +$(eval $(call BuildPackage,anyremote)) diff --git a/utils/anyremote/files/anyremote.cfg b/utils/anyremote/files/anyremote.cfg new file mode 100644 index 0000000..cd94999 --- /dev/null +++ b/utils/anyremote/files/anyremote.cfg @@ -0,0 +1,66 @@ +% +% anyremote configuration file for sound management. (Server-mode) +% prerequisites: amixer utility +% + +% STATUS stable +% XTEST no +% SOUND mixer +% ENV no + +% Uncomment if needed +%AutoRepeat=false +%Baudrate=19200 +Device=bluetooth:19 +%Log=true +Screen=true + +GuiAppName=Sound volume test +GuiAppIcon=sound.png +GuiAppType=Example +GuiAppBinary=true + +% 1 - increase sound volume +% 2 - mute/unmute +% 3 - increase sound volume +% 5 - show list of available controls + +[Aliases] + +% Aliases for AverMedia IR remote +VOLUMEDOWN=1 +MIN_INTERESTING=2 +VOLUMEUP=3 +TEXT=* + +[End] + +[Keys] + +(Init) =Macro(SET_CARD);Macro(TEST_MIXER);Macro(INIT_CONTROL); +(Connect)=Set(parameter,debug,on);\ + Set(icons,SoundControl,1,minus,2,mute,3,plus,4,default,5,configure,6,default,7,default,8,default,9,default,0,default,*,question,#,default);\ + Macro(SET_VIEW); + +SET_CARD =Make(var,mixer_card,echo 'if [ -f $HOME/.anyRemote/amixer.card ]; then cat $HOME/.anyRemote/amixer.card; else true; fi;'|bash -f -s); +TEST_MIXER =Exec(echo 'TEST=`amixer $(mixer_card) sget Master,0`;U=`echo $TEST|grep "Usage: amixer" |wc -l`;KD=`which kdialog|grep kdialog|grep -v not|wc -l`;if [ "x$KD" == "x1" ]; then M="kdialog --msgbox"; else M="echo";fi;if [ "x$U" != "x0" ]; then $M "ERROR: You have to correct example according to Your system configuration !"; fi;'|bash -f -s); +INIT_CONTROL=Exec(echo 'if [ -f $HOME/.anyRemote/amixer.control ]; then true; else echo "Master@0" > $HOME/.anyRemote/amixer.control; fi;'|bash -f -s) +SET_VIEW =Set(menu,add,Controls);ExecAndSet(title,cat $HOME/.anyRemote/amixer.control|sed "s/@/,/"); + +Cancel=Exit + +Controls=ExecAndSet(list,replace,Mixer Controls,amixer scontrols|sed 's/Simple mixer control //;s/,/@/;s/$/,/');Set(menu,replace,Choose); +Choose($$)=Exec(echo $(Param) > $HOME/.anyRemote/amixer.control);Set(list,close);Macro(SET_VIEW); +Back=Set(text,close);Macro(SET_VIEW); +Back($$)=Set(list,close);Macro(SET_VIEW); + +1=Exec(amixer $(mixer_card) sset `cat $HOME/.anyRemote/amixer.control|sed "s/@/,/"` 5%- -q) +2=Exec(amixer $(mixer_card) sset `cat $HOME/.anyRemote/amixer.control|sed "s/@/,/"` toggle -q) +3=Exec(amixer $(mixer_card) sset `cat $HOME/.anyRemote/amixer.control|sed "s/@/,/"` 5%+ -q) + +5=Macro(Controls); + +* *=Set(text,replace,Help,1 - Vol-\n2 - Mute/Unmute\n3 - Vol+\n5 - Choose mixer control) + +[End] + diff --git a/utils/anyremote/files/anyremote.init b/utils/anyremote/files/anyremote.init new file mode 100644 index 0000000..af05f49 --- /dev/null +++ b/utils/anyremote/files/anyremote.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2011 OpenWrt.org + +START=95 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +start() { + service_start /usr/sbin/anyremote -f /etc/anyremote.cfg +} + +stop() { + service_stop /usr/sbin/anyremote +} diff --git a/utils/anyremote/patches/010-dont-add-host-includes.patch b/utils/anyremote/patches/010-dont-add-host-includes.patch new file mode 100644 index 0000000..d4e6477 --- /dev/null +++ b/utils/anyremote/patches/010-dont-add-host-includes.patch @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index 2a4e2a4..396d5a2 100755 +--- a/configure ++++ b/configure +@@ -3940,7 +3940,7 @@ _ACEOF + fi + + +-CFLAGS="$CFLAGS -I/usr/local/include -Wall -D_REENTRANT -O2 -g" ++CFLAGS="$CFLAGS -Wall -D_REENTRANT -O2 -g" + + # On IRIX 5.3, sys/types and inttypes.h are conflicting. + diff --git a/utils/ap51-flash/Makefile b/utils/ap51-flash/Makefile new file mode 100644 index 0000000..30868ae --- /dev/null +++ b/utils/ap51-flash/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2010-2011 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:=ap51-flash +PKG_REV:=232 +PKG_VERSION:=r$(PKG_REV) +PKG_RELEASE:=3 + +PKG_SOURCE_PROTO:=svn +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=ap51-flash-$(PKG_VERSION) +PKG_SOURCE_URL:=http://dev.cloudtrax.com/downloads/svn/ap51-flash/trunk +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +PKG_MIRROR_MD5SUM:=3bff5b2ffa77ee80a807f3d24165b7cf + +include $(INCLUDE_DIR)/package.mk + +ifeq ($(CONFIG_BIG_ENDIAN),y) + STAMP_BUILT:=$(STAMP_BUILT)_big +endif + +define Package/ap51-flash + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A tool for flashing (nearly) all ap51/ap61 based routers + URL:=http://dev.cloudtrax.com/wiki/ap51-flash-station +endef + +TARGET_EXTRA_CFLAGS:=-DFLASH_FROM_FILE -DNO_LIBPCAP +ifeq ($(CONFIG_BIG_ENDIAN),y) + TARGET_EXTRA_CFLAGS:=$(TARGET_EXTRA_CFLAGS) -DUIP_CONF_BYTE_ORDER=1234 +endif + +# pass optimization flags +MAKE_FLAGS += \ + OFLAGS="$(TARGET_CFLAGS)" \ + EXTRA_CFLAGS="$(TARGET_EXTRA_CFLAGS)" \ + REVISION="$(PKG_VERSION)" \ + +define Package/ap51-flash/install + $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d $(1)/usr/sbin \ + $(1)/usr/lib/ap51-flash + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ap51-flash $(1)/usr/sbin/ + $(INSTALL_BIN) ./files/ap51-flash.init $(1)/etc/init.d/ap51-flash + $(INSTALL_BIN) ./files/ap51-flash.sh $(1)/usr/lib/ap51-flash/ap51-flash.sh + $(INSTALL_DATA) ./files/ap51-flash.config $(1)/etc/config/ap51-flash +endef + +define Package/ap51-flash/conffiles +/etc/config/ap51-flash +endef + +$(eval $(call BuildPackage,ap51-flash)) diff --git a/utils/ap51-flash/files/ap51-flash.config b/utils/ap51-flash/files/ap51-flash.config new file mode 100644 index 0000000..f66973f --- /dev/null +++ b/utils/ap51-flash/files/ap51-flash.config @@ -0,0 +1,6 @@ +#config flash +# option ifname eth0.1 +# option rootfs /tmp/images/openwrt-atheros-root.squashfs +# option kernel /tmp/images/openwrt-atheros-vmlinux.lzma +# option ubnt /tmp/images/openwrt-atheros-ubnt5-squashfs.bin +## option loop '1' diff --git a/utils/ap51-flash/files/ap51-flash.init b/utils/ap51-flash/files/ap51-flash.init new file mode 100644 index 0000000..1633ac4 --- /dev/null +++ b/utils/ap51-flash/files/ap51-flash.init @@ -0,0 +1,50 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010 OpenWrt.org + +START=20 + +NAME=ap51-flash + +start_daemon() { + local cfg="$1" + + config_get_bool loop "$cfg" loop + config_get ifname "$cfg" ifname + config_get rootfs "$cfg" rootfs + config_get kernel "$cfg" kernel + config_get ubnt "$cfg" ubnt + [ "$loop" != "1" ] && loop=0 + if [ -n "$ifname" -a -n "$rootfs" -a -n "$kernel" ] || \ + [ -n "$ifname" -a -n "$ubnt" ]; then + PID="`cat /var/run/$NAME.sh-$ifname.pid 2> /dev/null`" + [ -z "`ps | grep "^.[ ]*$PID "`" ] && \ + rm /var/run/$NAME.sh-$ifname.pid + [ -n "`ls /var/run/$NAME.sh-$ifname.pid 2> /dev/null`" ] && { + echo "Can't start more than one ap51-flash for interface $ifname!" + return 0 + } + start-stop-daemon -S -b -m -p /var/run/$NAME.sh-$ifname.pid -n $NAME.sh \ + -x /usr/lib/ap51-flash/$NAME.sh -- "$loop" "$ifname" "$rootfs" "$kernel" "$ubnt" + fi +} + +start() { + config_load ap51-flash + config_foreach start_daemon flash +} + +stop() { + # Terminating all ap51-flash processes + echo "WARNING: Going to teminate all ap51-flash processes! (hope you made sure that they're not flashing right now)" + echo "OR you can stop this with Ctrl+c within 10 seconds" + sleep 10 + local pidfile + for pidfile in `ls /var/run/${NAME}.sh-*.pid 2> /dev/null`; do + start-stop-daemon -K -s TERM -p "${pidfile}" -n "${NAME}.sh" >/dev/null + rm -f "${pidfile}" + done + for pidfile in `ls /var/run/${NAME}-*.pid 2> /dev/null`; do + start-stop-daemon -K -s TERM -p "${pidfile}" -n "${NAME}" >/dev/null + rm -f "${pidfile}" + done +} diff --git a/utils/ap51-flash/files/ap51-flash.sh b/utils/ap51-flash/files/ap51-flash.sh new file mode 100755 index 0000000..9ac33ee --- /dev/null +++ b/utils/ap51-flash/files/ap51-flash.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +NAME=ap51-flash +rootfs="" +kernel="" +ubnt="" + +[ $1 -eq "1" ] && loop="1" +ifname="$2" +[ -n "$3" ] && rootfs="--rootfs $3" +[ -n "$4" ] && kernel="--kernel $4" +[ -n "$5" ] && ubnt="--ubnt $5" + +while [ 1 ]; do + start-stop-daemon -S -m -p /var/run/$NAME-$ifname.pid -n $NAME \ + -x /usr/sbin/$NAME -- --flash-from-file $rootfs $kernel $ubnt $ifname + + rm /var/run/$NAME-$ifname.pid + [ "$loop" != "1" ] && break + sleep 15 +done diff --git a/utils/at/Makefile b/utils/at/Makefile new file mode 100644 index 0000000..faa8e51 --- /dev/null +++ b/utils/at/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2008-2012 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:=at +PKG_VERSION:=3.1.13 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/a/at +PKG_MD5SUM:=1da61af6c29e323abaaf13ee1a8dad79 + +include $(INCLUDE_DIR)/package.mk + +define Package/at + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libelf + TITLE:=Delayed job execution and batch processing + URL:=http://packages.debian.org/stable/at + MAINTAINER:=Luka Perkov +endef + +define Package/at/description + At and batch read shell commands from standard input storing them as a job to + be scheduled for execution in the future. +endef + +export SENDMAIL=/bin/true +EXTRA_CFLAGS:=-DNEED_YYWRAP -I$(PKG_BUILD_DIR) -I$(STAGING_DIR)/usr/include/libelf \ + $(TARGET_LDFLAGS) + +CONFIGURE_ARGS+=--prefix=/usr \ + --with-daemon_username=nobody \ + --with-daemon_groupname=nogroup \ + --with-jobdir=/var/spool/cron/atjobs \ + --with-atspool=/var/spool/cron/atspool + +define Package/at/install + $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/sbin $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/atd.init $(1)/etc/init.d/atd + $(INSTALL_BIN) $(PKG_BUILD_DIR)/at $(1)/usr/bin + ln -sf at $(1)/usr/bin/atq + ln -sf at $(1)/usr/bin/atrm + $(INSTALL_BIN) $(PKG_BUILD_DIR)/atd $(1)/usr/sbin +endef + +$(eval $(call BuildPackage,at)) diff --git a/utils/at/files/atd.init b/utils/at/files/atd.init new file mode 100755 index 0000000..6254d29 --- /dev/null +++ b/utils/at/files/atd.init @@ -0,0 +1,23 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2011 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +start() { + [ -d /var/spool/cron/atjobs ] || { + mkdir -m 0755 -p /var/spool/cron/atjobs + touch /var/spool/cron/atjobs/.SEQ + chown -R nobody:nogroup /var/spool/cron/atjobs + } + [ -d /var/spool/cron/atspool ] || { + mkdir -m 0755 -p /var/spool/cron/atspool + chown -R nobody:nogroup /var/spool/cron/atspool + } + service_start /usr/sbin/atd +} + +stop() { + service_stop /usr/sbin/atd +} diff --git a/utils/at/patches/100-cross-compile.patch b/utils/at/patches/100-cross-compile.patch new file mode 100644 index 0000000..fbbc7e4 --- /dev/null +++ b/utils/at/patches/100-cross-compile.patch @@ -0,0 +1,30 @@ +--- a/configure ++++ b/configure +@@ -3458,27 +3458,6 @@ $as_echo "yes" >&6; } + $as_echo "no" >&6; } + ;; + esac +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Trying to compile a trivial ANSI C program" >&5 +-$as_echo_n "checking Trying to compile a trivial ANSI C program... " >&6; } +-if test "$cross_compiling" = yes; then : +- as_fn_error $? "Could not compile and run even a trivial ANSI C program - check CC." "$LINENO" 5 +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- main(int ac, char **av) { return 0; } +-_ACEOF +-if ac_fn_c_try_run "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +- as_fn_error $? "Could not compile and run even a trivial ANSI C program - check CC." "$LINENO" 5 +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ +- conftest.$ac_objext conftest.beam conftest.$ac_ext +-fi +- + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking __attribute__((noreturn))" >&5 + $as_echo_n "checking __attribute__((noreturn))... " >&6; } diff --git a/utils/at/patches/110-getloadavg.patch b/utils/at/patches/110-getloadavg.patch new file mode 100644 index 0000000..0faef97 --- /dev/null +++ b/utils/at/patches/110-getloadavg.patch @@ -0,0 +1,14 @@ +--- a/getloadavg.c ++++ b/getloadavg.c +@@ -69,8 +69,9 @@ Boston, MA 02110-1301 USA */ + #include + #endif + +-#include "lisp.h" +-#include "sysfile.h" /* for encapsulated open, close, read, write */ ++#include ++#include ++#include + + #ifndef HAVE_GETLOADAVG + diff --git a/utils/avrdude/Makefile b/utils/avrdude/Makefile new file mode 100644 index 0000000..d3b0f13 --- /dev/null +++ b/utils/avrdude/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2008 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:=avrdude +PKG_VERSION:=5.8 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/avrdude +PKG_MD5SUM:=d459dcf47fa7fc2a29a70d68ebff4886 + +include $(INCLUDE_DIR)/package.mk + +define Package/avrdude + SECTION:=utils + CATEGORY:=Utilities + TITLE:=AVR Downloader/UploaDEr + URL:=http://www.bsdhome.com/avrdude/ + DEPENDS:=+libncurses +libreadline +libusb +endef + +define Package/avrdude/description + AVRDUDE is a full featured program for programming Atmel's AVR CPU's. +endef + +define Build/Prepare + $(call Build/Prepare/Default) + chmod -R u+w $(PKG_BUILD_DIR) +endef + +CONFIGURE_ARGS+= \ + --enable-shared \ + --disable-static \ + --disable-parport \ + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install-exec +endef + +define Package/avrdude/conffiles +/etc/avrdude.conf +endef + +define Package/avrdude/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/avrdude.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/avrdude $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,avrdude)) diff --git a/utils/avrusbboot/Makefile b/utils/avrusbboot/Makefile new file mode 100644 index 0000000..2d3eb21 --- /dev/null +++ b/utils/avrusbboot/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2008-2011 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:=avrusbboot +PKG_VERSION:=2006-06-25 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.fischl.de/avrusbboot/ +PKG_MD5SUM:=3e2f5e2c257918410a66c3463f583fdf + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION) + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/avrusbboot + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libusb $(CXX_DEPENDS) + TITLE:=USB bootloader for Atmel AVR controllers + URL:=http://www.fischl.de/avrusbboot/ +endef + +define Package/avrusbboot/description + AVRUSBBoot is a bootloader for the Atmel AVR controllers. + It uses a firmware-only USB driver to transfer binary data + from the PC to the flash of the controller. Once the AVR + is flashed with the bootloader, no other ISP programmer is + needed; then the microcontroller can be reprogrammed over USB. +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/software \ + CXX="$(TARGET_CXX)" \ + CPPFLAGS="$(TARGET_CPPFLAGS) -fno-rtti" \ + LFLAGS="$(TARGET_LDFLAGS) -lusb" \ + all +endef + +define Package/avrusbboot/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/software/avrusbboot $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,avrusbboot)) diff --git a/utils/avrusbboot/patches/001-fix_makefile.patch b/utils/avrusbboot/patches/001-fix_makefile.patch new file mode 100644 index 0000000..4439b62 --- /dev/null +++ b/utils/avrusbboot/patches/001-fix_makefile.patch @@ -0,0 +1,18 @@ +diff -urN avrusbboot.2006-06-25/software/Makefile avrusbboot.2006-06-25.new/software/Makefile +--- avrusbboot.2006-06-25/software/Makefile 2006-06-25 11:09:03.000000000 +0200 ++++ avrusbboot.2006-06-25.new/software/Makefile 2008-05-20 12:54:22.000000000 +0200 +@@ -1,6 +1,5 @@ +-LIBUSB_CONFIG = libusb-config +-CFLAGS+=-g -Wall -pedantic `$(LIBUSB_CONFIG) --cflags` +-LFLAGS+=`$(LIBUSB_CONFIG) --libs` -lusb ++CFLAGS=-I$(STAGING_DIR)/usr/include ++LFLAGS=-L$(STAGING_DIR)/usr/lib -lusb + + all: + make avrusbboot +@@ -10,4 +9,4 @@ + rm avrusbboot + + avrusbboot: main.cpp cflashmem.o cpage.o cbootloader.o +- g++ $(CFLAGS) main.cpp cflashmem.o cpage.o cbootloader.o -o avrusbboot $(LFLAGS) ++ $(CXX) $(CFLAGS) main.cpp cflashmem.o cpage.o cbootloader.o -o avrusbboot $(LFLAGS) diff --git a/utils/avrusbboot/patches/002-fix_compilation.patch b/utils/avrusbboot/patches/002-fix_compilation.patch new file mode 100644 index 0000000..bd8bcd9 --- /dev/null +++ b/utils/avrusbboot/patches/002-fix_compilation.patch @@ -0,0 +1,9 @@ +diff -ruN avrusbboot.2006-06-25-orig/software/main.cpp avrusbboot.2006-06-25-work/software/main.cpp +--- avrusbboot.2006-06-25-orig/software/main.cpp 2006-06-25 09:33:13.000000000 +0200 ++++ avrusbboot.2006-06-25-work/software/main.cpp 2008-05-01 17:25:30.000000000 +0200 +@@ -39,4 +39,4 @@ + } + + return 0; +-}; ++} diff --git a/utils/bandwidthd/Makefile b/utils/bandwidthd/Makefile new file mode 100644 index 0000000..3ae7d51 --- /dev/null +++ b/utils/bandwidthd/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2006-2011 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 +PKG_VERSION:=2.0.1 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/bandwidthd +PKG_MD5SUM:=aa79aad7bd489fd2cae1f7dc086ca8b6 + +include $(INCLUDE_DIR)/package.mk + +define Package/bandwidthd + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Bandwidthd + URL:=http://bandwidthd.sourceforge.net/ + DEPENDS:=+libgd +libpcap +endef + +define Package/bandwidthd/daemon + This package contains bandwidthd a bandwith tracking utility. +endef + +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 \ + +EXTRA_CFLAGS+= $(TARGET_CPPFLAGS) +EXTRA_LDFLAGS+= $(TARGET_LDFLAGS) -Wl,-rpath-link,$(STAGING_DIR)/usr/lib + +define Package/bandwidthd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bandwidthd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/bandwidthd.config $(1)/etc/config/bandwidthd + $(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/ +endef + +define Package/bandwidthd/conffiles +/etc/config/bandwidthd +endef + +$(eval $(call BuildPackage,bandwidthd)) diff --git a/utils/bandwidthd/files/bandwidthd.config b/utils/bandwidthd/files/bandwidthd.config new file mode 100644 index 0000000..4bb18cf --- /dev/null +++ b/utils/bandwidthd/files/bandwidthd.config @@ -0,0 +1,11 @@ +config bandwidthd + option dev br-lan + option subnets "192.168.0.0/16 10.0.0.0/8 172.16.0.0/12" + 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 diff --git a/utils/bandwidthd/files/bandwidthd.init b/utils/bandwidthd/files/bandwidthd.init new file mode 100644 index 0000000..6483daa --- /dev/null +++ b/utils/bandwidthd/files/bandwidthd.init @@ -0,0 +1,88 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2011 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 + [ -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/logo.gif b/utils/bandwidthd/files/logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..7b17cc6cbc70b45aa4b21bcf6bb3f6d6462760e7 GIT binary patch literal 7573 zcmYLq2{@GB7ymm8hS1AcvovGNl6?&^Gj`c!DU`8iDP&*A5<_+(`&hE?TT;qSB1@9B zLe@l5AvAw|fB*mUKhJaSIp;m+^EvOi_qos2($Q3q$J0Wyfdk;5kjVh-H?_1=c6i~d zk^esE1wJ8@$?VN~BO@b%3BI!!Ok82xhYugfzc-Dj@`MrKx}rO7v< zLZr#kuVQk`*p5g`M@B|^HJ1vJh0@EO9ew&l zCSL%_Aen5=L&9Uom@abHf{_uK+;nho5KWFYH#euHrS(g%S4@bhudiPtukF^?V>}D# zW(95%GkOPJXE%=^$OyG+O6z?ik&1EHu8C$du;xeXwn?Q?d+vtI8<&thIQWi=0HXJ=2MP(`MP z{waGW{xN43^_3X_&NRcD^}mDpw_N_i2s{!w^w++A=zn%5WaYCM0FVIHzvNjR;Y=ZC zF2ofHfZtF2OOF@noDOf=06|!d>W1euz&%e z{vYSRn!K|j?K2$hncqNW1kBmC{B6%T{{6>4UTX`r|7!mq59%N2j2{}-3(VD7po|u9=5aW|Lgs)@BbI|Idvf5jIVT_83;MEAu-x#n@=YH>rwE3 zbN9#9fqyaj2>u`N^1t=poxmW-00V+kyMfdlg+K~h4>c6^#)7=MdD@M|{SVosT^EKL zO9qosYVn*pO{K5X1x>50UpGB@lOV35(yIkn7FJ`*lwzsDg!jv#mW%XR~>Ki%qY@w5vtLMb@id8FY zd0HcfrTzoaJ$~Ryutn{y+zT{)bG%F5)AKYJC*DkE~-9G0L zYZ1))j8G6@j6g@9ljRgF2u4s77o!bY4`8fJPKVdAjIKkoln9%RqFAVYcQ*AQwNGJ4 zu^cWw0AyT^}iRq6*3P>+D0I1zzs+=)K36coc4I(idev*PM z?0#N0uWvk}HkLrg&TOWD>;Qe~6Gv;FFOJ##-U2ZgX4LnnSR9RylZ6AV4;55ar9URYM!MMHq%cK1yvR<= zwK7kWkY8SWlicQ7S?4`{r>3cCZmYT=tb3MK=QDp)db?l$11PI@CcL75S=O!j?ben< zZDuG9q`n3>|GtJ~B9dM1tzI>A@piz42kr4X)ne7?Rf$|T8a{vHVgoMHxbF-d|9JFo zf#~`Y)wD7&*$qvI;zH;VDX`k8u09O;W=u*P_vB{@?70Ai!7y0A&aR;+D1$FRlzJNV zrLn6wm`ZC7ee81QR)+>`uo%IqA8|i6JI5SK%V%^~uw`LPa{uTD2G2A_;THfW42G#8 zJ+ea#s})iJCK}T6JCWt3eM9QcTE2jgcYdQI^}@PLn7lTf1ePs8yJ-R{Z6*`V;rm@3 zA@s9D)Chs_?1CWi(cQA|?W{(BVfD|ew}m*IZ@IW^u4OPD?^u4wFv#f^7KlCK3TuB? zoOSolW<`13pRJ1Yw|~Ai48CmNbTkwjU!nA^Yya{{y!7}R!qVVqwOwQiuGwK#VDy8o z(gqBXfS^u)PFdVL{WarUfBJjDfA{p@bFBE^!!KF){vK_V*Z=*q{dD*5fqBC?mP!ah zI5<6AuP6UKIXHV!09q12rQHR+@ST9rBSBf&kcE~B5g<8%1b>Jt9M}6E$u>gLG5?LE z3zCS$B6_G~d%Cw1jHG##mn=JQC}x$?Xfb6SyZ|rjz(N8+#SKr}>MbABrz3zRc2i2U zM6i*xQFQx6!^pNY&NV(~#Bw3hUz>qV6HX_7G}n`{kwvBWg-XW7xO>|4X)b0Ddz`xr z(Lgb#)AhxJI?KI2&)zC&du8^!;pZtv~ab-otZD0FRLylY+aW_-ep=7ik`K!KYQ=j4 zzrhfO_i_@!xtO#qt!wB9DaJXB58BBXfc7y!d+O?!;5ObcdO;3q!ht9eUMWLvSdCql)DjRhLk67&{ERjCniA{ku7c;wy2vcwl&~ z4XrDf97HJuI`MR!fAivzL*00#h5_-}@JXa_p^~WkFDZ+fNq&n`ej6H_BI~(O8vl3C z>MRvC9(PEI8#&EZZ`!Rtf7BvY@e+V&dY8fTOm+=t<}1G|@;?LU8wiQPj3P`sT}{`% zZ}G`1_hAh*O5fx~F`zofMj!cG<+{DE7+4xvN@{JL&xzC;k=;x^>=QJQ+|nCSY%~+~ zLVj!@My=yV_1Om4UM_6&ZC}adyw7&tyaD$u#vfdbNE(!S%bBb?D7iFyIAqC*=&3ML zjkw;9wiswS;u7b!H;@psDof{7_kYQ#W-OyC}Gm(WWe?Iv2$~MH- zg0!C4*z}l{hQ!2eo3V!3RP(mF!c+Br^$0jk9{z!{=(iY`BEcfZhi!LU2BxNL5zvGS z{_Tss54Ph384nQ^R>eCIvtvwpknk;~MUNQU-~5Rt*RHS4q}GmH;O~?jz4&g(O#dJl zt>gas1B>U^a?c`17KlCJf&ucSn3HV%oy7FwS?MIhAc=eKPjM1o=N_fJH)I|>hddt% zfx=sA92O3AVp1q6Pa-5~JtOQ9%X|ExiVYE>4uoGyz+d{qO{3(FsluJxB)!wE7@u8J z(!*aiv%{ucC+0z+v%UuWmE?Ms0IbxTq>N}J7=%JAK)LI{kiRj7kYzqEfwKMVVVM(VxB#~nwYFq}3N}OxTmAi!B~An-$ByXo6cKRJWpz$*c8(2- z7{v|cHK8heRK?#P2^R0Zijt#7$HHJ37sTeN_jbnpm>*e&Ar^{-WgjDNNp)HbvGn=w zL`nE8X;GKDGokns4!8F%EaSH6q;{w~LlPj(`Uk69ET~20mkrQ4zq^v-2I~I z^4&C(!IeVNjIy0TPGgXQdtCw#nGP`-+By^R?rHT;7DxmX=eW3?JbR={I(}T2$=nwqt z3r*2^MGp#oMF048&0Zlo4-H$ji`H(p$-_x&EJL@7{d7(I-~&jNUJ6==m^6lICRg<>j|1I7Et=dR1~A3vJU~@=?7N$M+SiY zmP9~}PuB!Si$}p+m_$GGsbT`AoxLfrreP60x1-!A*ZlU41p>SLVQK6XsWLBF;}M^U z241}6079q%76N}KHN3$TKBV+x{b5YETf$JRuskvJ!1!KsBt4WM#Y?ERWTOAfM=ufj zUS7PZ{h_1x!|4sybjJWKUqQP25AFJs`YaPl@vwj*+54B+iI+^CsU=#cn!;Z*w| zYy^EhOb%KNC$JjReh8!4OR(uyKc-^35CFO%!l<5kbZ43fHNe@AkTw`lr}-jRAUhR4 zVQBpd{{|DK4tRT2TAl~wzXJT>NuX>@TUH18XK@`03FoeWcV{e?H!QRwgc|YIP^T!E z1oX~^5X&sHMg?Ftqi;GZbnDRfNW*WD=k|?k1FP3jI7?xZ3QK$?npMJYW|hxg$jH}m zlh5XcXc-Re;0ZZ2gBJAp7+BccsuU6T%vd&ti+2fmTk`p|GrpB%5UfByGy~13Blg$&paqKwCI3fuBoE^{zc{XIm*_&h9tkAWe$BU!H zbjg&ODjU9&%PWG}l;i{$;e5yOhAWDOyt!eia$*8SUS> zpMeKZD4xoXkPXF?5P*Wtb!B*?9PG}eN@p()63oNV;Z@X?01!@%LRm``&Brom#(;S% z3b9CKRr6xC0a=k0VCM)a=m|r1$uhLzQ%dYASL`aHN~%gqs(K5WO%+?4p|<12FalJv zA(b`LUTYc@7%w$YWO`-laJ4Ngqq|VN8ycDZrDWO?*Wf1R6B2+5m*5Ww0VD1%j1@K(jDRq&>ooNtt!>68Humy$*CE+ zS@UYEW^$|MeNOG5Yt3uj+BuqW1n2Jj8(H-aI->g zv*Pn+<@sin<7Ny;3r?v;-Ks@1xJ5g+MfZ7&-h7L}af=a0tBF!;f)kWpyVWunqwm#v zW4;y0V0pCBYWGH!6j5p)+_r<|s*P!Lzs7#*<>^7@cFvwVG|z0<&BG z+$=W{vFD-QU1=xz;?;9D*#-(|OL*UNmvWA~%6knr(4C_XFQ|P`eR<p zREN$n8lB`SScA(}{UVat#!vc#e2D^l@dgPD+@H19o%*&phEAjhFGBq3vy;z3t}>4> zVgX7H45cImr3driNm0t*?E9J2j8UAaI+fC7^vP?==uR%LSBcgc=One1Hp8)3hhG-5zNRbhaz8<@k8R?5hqd&J5ga8Jl96EGfB|G0 zUNK`Km06Y?wxePU@cC_~#RSN!%M6n*APerJ-PVIFEKj7C-ZpE$-rOcEYQFJz90udx zE?ZmDr@q-RhJ6+U`93E;4`HHDfr+N{93;oWbz%=VYg^aIco&Y zUj-acI0=VBnRNX;aD1H5v? zWWx3CuJk+TyQxK{iK{kz>?Ba_^YteQx!m~{-lJ*U8?0QlEco1PUs2Gs6K$wz&o2~6 z6)|nt%`eK;-_D*s5%?h>^@9yVTbU(aMLT$0 z=tXu9FPk4}a}_L(wqWr$xrAC4r^VTXSUn9!3fjhy6-%Zjs{mdYrR`_R%0=cz=NTUU zg+9?63GZjgrB=u$svbI6f2|qf`-dY>3U&aqmkrMN#z~YWW*wibKBBSn894>L(7LkA4`i^3`|Zn zY3d?Vai0+QPf8FjD$%K~(O|>G#F+>$l`FuxTcF6t*Sm|%Lz`Cjq`znwfLdbxeB4Y% zoNNfAEY9_8p`RXT1JIxjG#2Z_>4imCuD^U0z7t_PcFB?bJ_^*4{$h<5tmMkpu}?2c z3O@(=+WB_aQ6<7>lvq^5SDXu~ewbI^o2T`76Pm=z^CjtO;}l(``%|_zRSO>DS9k+3 z<~^e9Z}&nU1(@dHQ>JchYpbmF6nrt9z)cE>X^_DDoz0rZz? z&HFT;TK4G9d6?d!LJ(wK@v!4%Rx_zfTpQ-=D%%L^@9Fg0uW7$kzu0j_iG_PUr%2s= zoIe1K70=q)GtXfE%~lcbv536O&SsS3ni^a$#*QU?RGr9MOOj(D z@31BBZ@=6jXC#eLOnA78am%JatVobM4ci+(My$Jowss0{_x8JlB|>it$i{KOJ(K0h z{f%|J4k;G}1ld35^SnEhwI(b5a(`i8XyvdlQhKtv*#|a$;|;5MAMf&Q_+&%qfkssF zZz#i>tKpm?4sx_K7|^5efWK$Z2`j+D5VA*KJf&xF%#@nIZlpXssK4Y3x>RJ{};+}m7+C^2Lh>k#&nZ%cy5pcphW z(Fy!CkYp%}3@1jni zmZ&O@X_IpiVjB;IpX@c@TyU{<9Em-WMr&kwCS;@xpbVf+!-_FCS1hM)yJUybS5Wqut7IkvXVEH z*Yj0{U>7d{U8g}2mKttO4)Lz*rd4QPq9Ymh=w_rBJrWF%t|BQv|AAU#-10$*TR58W zXAh{8%Ayh!i1Ac6JHDZq!W6sI;Y@TriKV|uK#7u-&zor7`*XHa*ZXx{bYtqCOB)qC zT%VF>e{MNlOwr*Y0=R|eWK57xT85}mZ}QJ66t78Sz2<%1x-qE}y3(fQY^KaoB;+y! z8_sJdW@^B0)2CfpVm8HIDG&+hn`0ZKZALP3w9XJ=oW@g#s$ExIPc&E$x8|O!%OkO5` z%b2x%rDN3}j~KmSghee}iv(f#iuooLP{IZpM4 zVhyWd?CJpBo1KI}r`}UjMX!EV=NDds7e8fhzI1kY=2m<9(e!H_e~*&2hsD|j-tK3} zD{j^LpK_NQ&6*;qKg_;NwjW~Mee5)1zjLw=g#d)D^j!nNdH2|J@`JbQ#k^hTo$uxO zuNB4?1g<~WQJz>*nqFK{-)~!Z`Zbx{sgZm9_eFnZHfA|axJp9x=fIGBf!MaMyfWGG zEp;dIJ5kt@iy%=PUJ#z5^)h$jomdy}&2)w%2OKUg#h5!SJyn@s_-gjBPE%7_UHJ>X%aSI# z@Qk#~rx~jP7Fjx`a#C5OlP7{vI>Y$ilUdd3PM4CO={d^nr}o$I%XkRsy9&I^u5wtD zZjKvuYxB+`$&|@G-5m9LIhnJ(?R0tUwZ2bVdj2k7xzdV|;r&e0{NH(wl3vf=28JPX zKEYiu6pBWXEK?*Z4Hq19hf$2&RMGhdF6#V>#_{G;#jO1;Y&{{v&Vf3W}n literal 0 HcmV?d00001 diff --git a/utils/bandwidthd/patches/010-dont-add-host-paths.patch b/utils/bandwidthd/patches/010-dont-add-host-paths.patch new file mode 100644 index 0000000..59a5737 --- /dev/null +++ b/utils/bandwidthd/patches/010-dont-add-host-paths.patch @@ -0,0 +1,36 @@ +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/100-fix_config_file_location b/utils/bandwidthd/patches/100-fix_config_file_location new file mode 100644 index 0000000..ae44cd2 --- /dev/null +++ b/utils/bandwidthd/patches/100-fix_config_file_location @@ -0,0 +1,31 @@ +--- 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(); diff --git a/utils/bash-completion/Makefile b/utils/bash-completion/Makefile new file mode 100644 index 0000000..f5c4392 --- /dev/null +++ b/utils/bash-completion/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2009-2011 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:=bash-completion +PKG_VERSION:=20080705 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/b/bash-completion/ +PKG_MD5SUM:=8bc36281bb0567bc67a9083c4c5595a9 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/bash-completion + SECTION:=utils + CATEGORY:=Utilities + TITLE:=bash completion scripts + DEPENDS:=+libncurses +bash + URL:=http://www.caliban.org/bash/ + PKGARCH:=all +endef + +define Package/bash-completion/description + bash completion extends bashs standard completion behavior + to achieve complex command lines with just a few keystrokes. +endef + + +define Build/Configure +endef + + +define Build/Compile +endef + +define Package/bash-completion/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bash_completion $(1)/etc/ +endef + +define Package/bash-completion/conffiles +/etc/bash_completion +endef + +$(eval $(call BuildPackage,bash-completion)) diff --git a/utils/bash/Makefile b/utils/bash/Makefile new file mode 100644 index 0000000..d877441 --- /dev/null +++ b/utils/bash/Makefile @@ -0,0 +1,65 @@ +# +# Copyright (C) 2007-2012 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:=bash +PKG_VERSION:=4.2 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/bash +PKG_MD5SUM:=3fb927c7c33022f1c327f14a81c0d4b0 + +include $(INCLUDE_DIR)/package.mk + +define Package/bash + SECTION:=utils + CATEGORY:=Utilities + TITLE:=The GNU Bourne Again SHell + DEPENDS:=+libncurses + URL:=http://www.gnu.org/software/bash/ +endef + +define Package/bash/description + Bash is an sh-compatible command language interpreter that executes + commands read from the standard input or from a file. Bash also + incorporates useful features from the Korn and C shells (ksh and csh). +endef + + +define Build/Configure + $(call Build/Configure/Default, \ + --without-bash-malloc \ + --bindir=/bin \ + ) +endef + + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/builtins LDFLAGS_FOR_BUILD= mkbuiltins + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + SHELL="/bin/bash" \ + all install +endef + +define Package/bash/postinst +#!/bin/sh +grep bash $${IPKG_INSTROOT}/etc/shells || \ + echo "/bin/bash" >> $${IPKG_INSTROOT}/etc/shells + echo "/bin/rbash" >> $${IPKG_INSTROOT}/etc/shells +endef + +define Package/bash/install + $(INSTALL_DIR) $(1)/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/bash $(1)/bin/ + ln -sf bash $(1)/bin/rbash +endef + +$(eval $(call BuildPackage,bash)) + diff --git a/utils/bash/patches/001-compile-fix.patch b/utils/bash/patches/001-compile-fix.patch new file mode 100644 index 0000000..8f4090b --- /dev/null +++ b/utils/bash/patches/001-compile-fix.patch @@ -0,0 +1,15 @@ +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -2202,7 +2202,11 @@ execute_pipeline (command, asynchronous, + /* If the `lastpipe' option is set with shopt, and job control is not + enabled, execute the last element of non-async pipelines in the + current shell environment. */ +- if (lastpipe_opt && job_control == 0 && asynchronous == 0 && pipe_out == NO_PIPE && prev > 0) ++ if (lastpipe_opt && ++#if defined(JOB_CONTROL) ++ job_control == 0 && ++#endif ++ asynchronous == 0 && pipe_out == NO_PIPE && prev > 0) + { + lstdin = move_to_high_fd (0, 0, 255); + if (lstdin > 0) diff --git a/utils/bash/patches/002-force-internal-readline.patch b/utils/bash/patches/002-force-internal-readline.patch new file mode 100644 index 0000000..ecb8375 --- /dev/null +++ b/utils/bash/patches/002-force-internal-readline.patch @@ -0,0 +1,24 @@ +--- a/configure ++++ b/configure +@@ -5748,8 +5748,7 @@ _ACEOF + # static version specified as -llibname to override the + # dynamic version + case "${host_os}" in +- darwin[89]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;; +- *) READLINE_LIB=-lreadline ;; ++ *) READLINE_LIB='${READLINE_LIBRARY}' ;; + esac + fi + else +--- a/configure.in ++++ b/configure.in +@@ -540,8 +540,7 @@ if test $opt_readline = yes; then + # static version specified as -llibname to override the + # dynamic version + case "${host_os}" in +- darwin[[89]]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;; +- *) READLINE_LIB=-lreadline ;; ++ *) READLINE_LIB='${READLINE_LIBRARY}' ;; + esac + fi + else diff --git a/utils/bash/patches/101-upstream-bash42-001.patch b/utils/bash/patches/101-upstream-bash42-001.patch new file mode 100644 index 0000000..8aca815 --- /dev/null +++ b/utils/bash/patches/101-upstream-bash42-001.patch @@ -0,0 +1,65 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-001 + +Bug-Reported-by: Juergen Daubert +Bug-Reference-ID: <20110214175132.GA19813@jue.netz> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00125.html + +Bug-Description: + +When running in Posix mode, bash does not correctly expand the right-hand +side of a double-quoted word expansion containing single quotes. + +Patch (apply with `patch -p0'): + +--- a/subst.c ++++ b/subst.c +@@ -1379,10 +1379,12 @@ extract_dollar_brace_string (string, sin + slen = strlen (string + *sindex) + *sindex; + + /* The handling of dolbrace_state needs to agree with the code in parse.y: +- parse_matched_pair() */ +- dolbrace_state = 0; +- if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) +- dolbrace_state = (flags & SX_POSIXEXP) ? DOLBRACE_QUOTE : DOLBRACE_PARAM; ++ parse_matched_pair(). The different initial value is to handle the ++ case where this function is called to parse the word in ++ ${param op word} (SX_WORD). */ ++ dolbrace_state = (flags & SX_WORD) ? DOLBRACE_WORD : DOLBRACE_PARAM; ++ if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && (flags & SX_POSIXEXP)) ++ dolbrace_state = DOLBRACE_QUOTE; + + i = *sindex; + while (c = string[i]) +@@ -7176,7 +7178,7 @@ parameter_brace_expand (string, indexp, + { + /* Extract the contents of the ${ ... } expansion + according to the Posix.2 rules. */ +- value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#') ? SX_POSIXEXP : 0); ++ value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#' || c =='/' || c == '^' || c == ',' || c ==':') ? SX_POSIXEXP|SX_WORD : SX_WORD); + if (string[sindex] == RBRACE) + sindex++; + else +--- a/subst.h ++++ b/subst.h +@@ -56,6 +56,7 @@ + #define SX_NOLONGJMP 0x0040 /* don't longjmp on fatal error */ + #define SX_ARITHSUB 0x0080 /* extracting $(( ... )) (currently unused) */ + #define SX_POSIXEXP 0x0100 /* extracting new Posix pattern removal expansions in extract_dollar_brace_string */ ++#define SX_WORD 0x0200 /* extracting word in ${param op word} */ + + /* Remove backslashes which are quoting backquotes from STRING. Modifies + STRING, and returns a pointer to it. */ +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 0 ++#define PATCHLEVEL 1 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/102-upstream-bash42-002.patch b/utils/bash/patches/102-upstream-bash42-002.patch new file mode 100644 index 0000000..3756ac1 --- /dev/null +++ b/utils/bash/patches/102-upstream-bash42-002.patch @@ -0,0 +1,50 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-002 + +Bug-Reported-by: Clark J. Wang +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00157.html + +Bug-Description: + +The readline vi-mode `cc', `dd', and `yy' commands failed to modify the +entire line. + +Patch (apply with `patch -p0'): + +--- a/lib/readline/vi_mode.c ++++ b/lib/readline/vi_mode.c +@@ -1114,7 +1114,7 @@ rl_domove_read_callback (m) + rl_beg_of_line (1, c); + _rl_vi_last_motion = c; + RL_UNSETSTATE (RL_STATE_VIMOTION); +- return (0); ++ return (vidomove_dispatch (m)); + } + #if defined (READLINE_CALLBACKS) + /* XXX - these need to handle rl_universal_argument bindings */ +--- a/lib/readline/callback.c ++++ b/lib/readline/callback.c +@@ -148,6 +148,9 @@ rl_callback_read_char () + eof = _rl_vi_domove_callback (_rl_vimvcxt); + /* Should handle everything, including cleanup, numeric arguments, + and turning off RL_STATE_VIMOTION */ ++ if (RL_ISSTATE (RL_STATE_NUMERICARG) == 0) ++ _rl_internal_char_cleanup (); ++ + return; + } + #endif +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 1 ++#define PATCHLEVEL 2 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/103-upstream-bash42-003.patch b/utils/bash/patches/103-upstream-bash42-003.patch new file mode 100644 index 0000000..ad82635 --- /dev/null +++ b/utils/bash/patches/103-upstream-bash42-003.patch @@ -0,0 +1,231 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-003 + +Bug-Reported-by: Clark J. Wang +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00136.html + +Bug-Description: + +When using the pattern replacement and pattern removal word expansions, bash +miscalculates the possible match length in the presence of an unescaped left +bracket without a closing right bracket, resulting in a failure to match +the pattern. + +Patch (apply with `patch -p0'): + +--- a/lib/glob/gmisc.c ++++ b/lib/glob/gmisc.c +@@ -77,8 +77,8 @@ wmatchlen (wpat, wmax) + wchar_t *wpat; + size_t wmax; + { +- wchar_t wc, *wbrack; +- int matlen, t, in_cclass, in_collsym, in_equiv; ++ wchar_t wc; ++ int matlen, bracklen, t, in_cclass, in_collsym, in_equiv; + + if (*wpat == 0) + return (0); +@@ -118,58 +118,80 @@ wmatchlen (wpat, wmax) + break; + case L'[': + /* scan for ending `]', skipping over embedded [:...:] */ +- wbrack = wpat; ++ bracklen = 1; + wc = *wpat++; + do + { + if (wc == 0) + { +- matlen += wpat - wbrack - 1; /* incremented below */ +- break; ++ wpat--; /* back up to NUL */ ++ matlen += bracklen; ++ goto bad_bracket; + } + else if (wc == L'\\') + { +- wc = *wpat++; +- if (*wpat == 0) +- break; ++ /* *wpat == backslash-escaped character */ ++ bracklen++; ++ /* If the backslash or backslash-escape ends the string, ++ bail. The ++wpat skips over the backslash escape */ ++ if (*wpat == 0 || *++wpat == 0) ++ { ++ matlen += bracklen; ++ goto bad_bracket; ++ } + } + else if (wc == L'[' && *wpat == L':') /* character class */ + { + wpat++; ++ bracklen++; + in_cclass = 1; + } + else if (in_cclass && wc == L':' && *wpat == L']') + { + wpat++; ++ bracklen++; + in_cclass = 0; + } + else if (wc == L'[' && *wpat == L'.') /* collating symbol */ + { + wpat++; ++ bracklen++; + if (*wpat == L']') /* right bracket can appear as collating symbol */ +- wpat++; ++ { ++ wpat++; ++ bracklen++; ++ } + in_collsym = 1; + } + else if (in_collsym && wc == L'.' && *wpat == L']') + { + wpat++; ++ bracklen++; + in_collsym = 0; + } + else if (wc == L'[' && *wpat == L'=') /* equivalence class */ + { + wpat++; ++ bracklen++; + if (*wpat == L']') /* right bracket can appear as equivalence class */ +- wpat++; ++ { ++ wpat++; ++ bracklen++; ++ } + in_equiv = 1; + } + else if (in_equiv && wc == L'=' && *wpat == L']') + { + wpat++; ++ bracklen++; + in_equiv = 0; + } ++ else ++ bracklen++; + } + while ((wc = *wpat++) != L']'); + matlen++; /* bracket expression can only match one char */ ++bad_bracket: + break; + } + } +@@ -213,8 +235,8 @@ umatchlen (pat, max) + char *pat; + size_t max; + { +- char c, *brack; +- int matlen, t, in_cclass, in_collsym, in_equiv; ++ char c; ++ int matlen, bracklen, t, in_cclass, in_collsym, in_equiv; + + if (*pat == 0) + return (0); +@@ -254,58 +276,80 @@ umatchlen (pat, max) + break; + case '[': + /* scan for ending `]', skipping over embedded [:...:] */ +- brack = pat; ++ bracklen = 1; + c = *pat++; + do + { + if (c == 0) + { +- matlen += pat - brack - 1; /* incremented below */ +- break; ++ pat--; /* back up to NUL */ ++ matlen += bracklen; ++ goto bad_bracket; + } + else if (c == '\\') + { +- c = *pat++; +- if (*pat == 0) +- break; ++ /* *pat == backslash-escaped character */ ++ bracklen++; ++ /* If the backslash or backslash-escape ends the string, ++ bail. The ++pat skips over the backslash escape */ ++ if (*pat == 0 || *++pat == 0) ++ { ++ matlen += bracklen; ++ goto bad_bracket; ++ } + } + else if (c == '[' && *pat == ':') /* character class */ + { + pat++; ++ bracklen++; + in_cclass = 1; + } + else if (in_cclass && c == ':' && *pat == ']') + { + pat++; ++ bracklen++; + in_cclass = 0; + } + else if (c == '[' && *pat == '.') /* collating symbol */ + { + pat++; ++ bracklen++; + if (*pat == ']') /* right bracket can appear as collating symbol */ +- pat++; ++ { ++ pat++; ++ bracklen++; ++ } + in_collsym = 1; + } + else if (in_collsym && c == '.' && *pat == ']') + { + pat++; ++ bracklen++; + in_collsym = 0; + } + else if (c == '[' && *pat == '=') /* equivalence class */ + { + pat++; ++ bracklen++; + if (*pat == ']') /* right bracket can appear as equivalence class */ +- pat++; ++ { ++ pat++; ++ bracklen++; ++ } + in_equiv = 1; + } + else if (in_equiv && c == '=' && *pat == ']') + { + pat++; ++ bracklen++; + in_equiv = 0; + } ++ else ++ bracklen++; + } + while ((c = *pat++) != ']'); + matlen++; /* bracket expression can only match one char */ ++bad_bracket: + break; + } + } +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 2 ++#define PATCHLEVEL 3 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/104-upstream-bash42-004.patch b/utils/bash/patches/104-upstream-bash42-004.patch new file mode 100644 index 0000000..e353c5b --- /dev/null +++ b/utils/bash/patches/104-upstream-bash42-004.patch @@ -0,0 +1,40 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-004 + +Bug-Reported-by: Mike Frysinger +Bug-Reference-ID: <201102182106.17834.vapier@gentoo.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00222.html + +Bug-Description: + +When used in contexts where word splitting and quote removal were not +performed, such as pattern removal or pattern substitution, empty strings +(either literal or resulting from quoted variables that were unset or +null) were not matched correctly, resulting in failure. + +Patch (apply with `patch -p0'): + +--- a/subst.c ++++ b/subst.c +@@ -3373,7 +3373,7 @@ expand_string_for_rhs (string, quoted, d + if (string == 0 || *string == '\0') + return (WORD_LIST *)NULL; + +- td.flags = 0; ++ td.flags = W_NOSPLIT2; /* no splitting, remove "" and '' */ + td.word = string; + tresult = call_expand_word_internal (&td, quoted, 1, dollar_at_p, has_dollar_at); + return (tresult); +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 3 ++#define PATCHLEVEL 4 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/105-upstream-bash42-005.patch b/utils/bash/patches/105-upstream-bash42-005.patch new file mode 100644 index 0000000..5df63c7 --- /dev/null +++ b/utils/bash/patches/105-upstream-bash42-005.patch @@ -0,0 +1,114 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-005 + +Bug-Reported-by: Dennis Williamson +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00147.html + +Bug-Description: + +Systems that use tzset() to set the local timezone require the TZ variable +to be in the environment. Bash must make sure the environment has been +modified with any updated value for TZ before calling tzset(). This +affects prompt string expansions and the `%T' printf conversion specification +on systems that do not allow bash to supply a replacement for getenv(3). + +Patch (apply with `patch -p0'): + +--- a/variables.h ++++ b/variables.h +@@ -313,6 +313,7 @@ extern void set_func_auto_export __P((co + + extern void sort_variables __P((SHELL_VAR **)); + ++extern int chkexport __P((char *)); + extern void maybe_make_export_env __P((void)); + extern void update_export_env_inplace __P((char *, int, char *)); + extern void put_command_name_into_env __P((char *)); +--- a/variables.c ++++ b/variables.c +@@ -3653,6 +3653,22 @@ n_shell_variables () + return n; + } + ++int ++chkexport (name) ++ char *name; ++{ ++ SHELL_VAR *v; ++ ++ v = find_variable (name); ++ if (exported_p (v)) ++ { ++ array_needs_making = 1; ++ maybe_make_export_env (); ++ return 1; ++ } ++ return 0; ++} ++ + void + maybe_make_export_env () + { +@@ -4214,7 +4230,7 @@ static struct name_and_function special_ + { "TEXTDOMAIN", sv_locale }, + { "TEXTDOMAINDIR", sv_locale }, + +-#if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE) ++#if defined (HAVE_TZSET) + { "TZ", sv_tz }, + #endif + +@@ -4558,12 +4574,13 @@ sv_histtimefmt (name) + } + #endif /* HISTORY */ + +-#if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE) ++#if defined (HAVE_TZSET) + void + sv_tz (name) + char *name; + { +- tzset (); ++ if (chkexport (name)) ++ tzset (); + } + #endif + +--- a/parse.y ++++ b/parse.y +@@ -5135,6 +5135,9 @@ decode_prompt_string (string) + case 'A': + /* Make the current time/date into a string. */ + (void) time (&the_time); ++#if defined (HAVE_TZSET) ++ sv_tz ("TZ"); /* XXX -- just make sure */ ++#endif + tm = localtime (&the_time); + + if (c == 'd') +--- a/builtins/printf.def ++++ b/builtins/printf.def +@@ -465,6 +465,9 @@ printf_builtin (list) + secs = shell_start_time; /* roughly $SECONDS */ + else + secs = arg; ++#if defined (HAVE_TZSET) ++ sv_tz ("TZ"); /* XXX -- just make sure */ ++#endif + tm = localtime (&secs); + n = strftime (timebuf, sizeof (timebuf), timefmt, tm); + free (timefmt); +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 4 ++#define PATCHLEVEL 5 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/106-upstream-bash42-006.patch b/utils/bash/patches/106-upstream-bash42-006.patch new file mode 100644 index 0000000..89c887e --- /dev/null +++ b/utils/bash/patches/106-upstream-bash42-006.patch @@ -0,0 +1,37 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-006 + +Bug-Reported-by: Allan McRae +Bug-Reference-ID: <4D6D0D0B.50908@archlinux.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-03/msg00001.html + +Bug-Description: + +A problem with bash42-005 caused it to dump core if TZ was unset. + +Patch (apply with `patch -p0'): + +--- a/variables.c ++++ b/variables.c +@@ -3660,7 +3660,7 @@ chkexport (name) + SHELL_VAR *v; + + v = find_variable (name); +- if (exported_p (v)) ++ if (v && exported_p (v)) + { + array_needs_making = 1; + maybe_make_export_env (); +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 5 ++#define PATCHLEVEL 6 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/107-upstream-bash42-007.patch b/utils/bash/patches/107-upstream-bash42-007.patch new file mode 100644 index 0000000..7587195 --- /dev/null +++ b/utils/bash/patches/107-upstream-bash42-007.patch @@ -0,0 +1,39 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-007 + +Bug-Reported-by: Matthias Klose +Bug-Reference-ID: <4D6FD2AC.1010500@debian.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-03/msg00015.html + +Bug-Description: + +When used in contexts where word splitting and quote removal were not +performed, such as case statement word expansion, empty strings +(either literal or resulting from quoted variables that were unset or +null) were not expanded correctly, resulting in failure. + +Patch (apply with `patch -p0'): + +--- a/subst.c ++++ b/subst.c +@@ -4609,6 +4609,7 @@ expand_word_unsplit (word, quoted) + if (ifs_firstc == 0) + #endif + word->flags |= W_NOSPLIT; ++ word->flags |= W_NOSPLIT2; + result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + expand_no_split_dollar_star = 0; + +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 6 ++#define PATCHLEVEL 7 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/108-upstream-bash42-008.patch b/utils/bash/patches/108-upstream-bash42-008.patch new file mode 100644 index 0000000..29493b5 --- /dev/null +++ b/utils/bash/patches/108-upstream-bash42-008.patch @@ -0,0 +1,65 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-008 + +Bug-Reported-by: Doug McMahon +Bug-Reference-ID: <1299441211.2535.11.camel@doug-XPS-M1330> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-03/msg00050.html + +Bug-Description: + +Bash-4.2 does not attempt to save the shell history on receipt of a +terminating signal that is handled synchronously. Unfortunately, the +`close' button on most X11 terminal emulators sends SIGHUP, which +kills the shell. + +This is a very small patch to save the history in the case that an +interactive shell receives a SIGHUP or SIGTERM while in readline and +reading a command. + +The next version of bash will do this differently. + +Patch (apply with `patch -p0'): + +--- a/sig.c ++++ b/sig.c +@@ -46,6 +46,7 @@ + + #if defined (READLINE) + # include "bashline.h" ++# include + #endif + + #if defined (HISTORY) +@@ -62,6 +63,7 @@ extern int parse_and_execute_level, shel + #if defined (HISTORY) + extern int history_lines_this_session; + #endif ++extern int no_line_editing; + + extern void initialize_siglist (); + +@@ -505,7 +507,10 @@ termsig_sighandler (sig) + { + #if defined (HISTORY) + /* XXX - will inhibit history file being written */ +- history_lines_this_session = 0; ++# if defined (READLINE) ++ if (interactive_shell == 0 || interactive == 0 || (sig != SIGHUP && sig != SIGTERM) || no_line_editing || (RL_ISSTATE (RL_STATE_READCMD) == 0)) ++# endif ++ history_lines_this_session = 0; + #endif + terminate_immediately = 0; + termsig_handler (sig); +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 7 ++#define PATCHLEVEL 8 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/109-upstream-bash42-009.patch b/utils/bash/patches/109-upstream-bash42-009.patch new file mode 100644 index 0000000..d05f499 --- /dev/null +++ b/utils/bash/patches/109-upstream-bash42-009.patch @@ -0,0 +1,65 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-009 + +Bug-Reported-by: +Bug-Reference-ID: <4DAAC0DB.7060606@piumalab.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-04/msg00075.html + +Bug-Description: + +Under certain circumstances, running `fc -l' two times in succession with a +relative history offset at the end of the history will result in an incorrect +calculation of the last history entry and a seg fault. + +Patch (apply with `patch -p0'): + +--- a/builtins/fc.def ++++ b/builtins/fc.def +@@ -304,7 +304,7 @@ fc_builtin (list) + last_hist = i - rh - hist_last_line_added; + + /* XXX */ +- if (saved_command_line_count > 0 && i == last_hist && hlist[last_hist] == 0) ++ if (i == last_hist && hlist[last_hist] == 0) + while (last_hist >= 0 && hlist[last_hist] == 0) + last_hist--; + if (last_hist < 0) +@@ -475,7 +475,7 @@ fc_gethnum (command, hlist) + HIST_ENTRY **hlist; + { + int sign, n, clen, rh; +- register int i, j; ++ register int i, j, last_hist; + register char *s; + + sign = 1; +@@ -495,7 +495,15 @@ fc_gethnum (command, hlist) + has been enabled (interactive or not) should use it in the last_hist + calculation as if it were on. */ + rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list); +- i -= rh + hist_last_line_added; ++ last_hist = i - rh - hist_last_line_added; ++ ++ if (i == last_hist && hlist[last_hist] == 0) ++ while (last_hist >= 0 && hlist[last_hist] == 0) ++ last_hist--; ++ if (last_hist < 0) ++ return (-1); ++ ++ i = last_hist; + + /* No specification defaults to most recent command. */ + if (command == NULL) +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 8 ++#define PATCHLEVEL 9 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/110-upstream-bash42-010.patch b/utils/bash/patches/110-upstream-bash42-010.patch new file mode 100644 index 0000000..06cdb61 --- /dev/null +++ b/utils/bash/patches/110-upstream-bash42-010.patch @@ -0,0 +1,56 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-010 + +Bug-Reported-by: Mike Frysinger +Bug-Reference-ID: <201104122356.20160.vapier@gentoo.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-04/msg00058.html + +Bug-Description: + +Bash did not correctly print/reproduce here documents attached to commands +inside compound commands such as arithmetic for loops and user-specified +subshells. This affected the execution of such commands inside a shell +function when the function definition is saved and later restored using +`.' or `eval'. + +Patch (apply with `patch -p0'): + +--- a/print_cmd.c ++++ b/print_cmd.c +@@ -315,6 +315,7 @@ make_command_string_internal (command) + cprintf ("( "); + skip_this_indent++; + make_command_string_internal (command->value.Subshell->command); ++ PRINT_DEFERRED_HEREDOCS (""); + cprintf (" )"); + break; + +@@ -592,6 +593,7 @@ print_arith_for_command (arith_for_comma + newline ("do\n"); + indentation += indentation_amount; + make_command_string_internal (arith_for_command->action); ++ PRINT_DEFERRED_HEREDOCS (""); + semicolon (); + indentation -= indentation_amount; + newline ("done"); +@@ -653,6 +655,7 @@ print_group_command (group_command) + } + + make_command_string_internal (group_command->command); ++ PRINT_DEFERRED_HEREDOCS (""); + + if (inside_function_def) + { +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 9 ++#define PATCHLEVEL 10 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/111-upstream-bash42-011.patch b/utils/bash/patches/111-upstream-bash42-011.patch new file mode 100644 index 0000000..bb84a8d --- /dev/null +++ b/utils/bash/patches/111-upstream-bash42-011.patch @@ -0,0 +1,41 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-011 + +Bug-Reported-by: "David Parks" +Bug-Reference-ID: <014101cc82c6$46ac1540$d4043fc0$@com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-10/msg00031.html + +Bug-Description: + +Overwriting a value in an associative array causes the memory allocated to +store the key on the second and subsequent assignments to leak. + +Patch (apply with `patch -p0'): + +--- a/assoc.c ++++ b/assoc.c +@@ -77,6 +77,11 @@ assoc_insert (hash, key, value) + b = hash_search (key, hash, HASH_CREATE); + if (b == 0) + return -1; ++ /* If we are overwriting an existing element's value, we're not going to ++ use the key. Nothing in the array assignment code path frees the key ++ string, so we can free it here to avoid a memory leak. */ ++ if (b->key != key) ++ free (key); + FREE (b->data); + b->data = value ? savestring (value) : (char *)0; + return (0); +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 10 ++#define PATCHLEVEL 11 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/112-upstream-bash42-012.patch b/utils/bash/patches/112-upstream-bash42-012.patch new file mode 100644 index 0000000..697ed1a --- /dev/null +++ b/utils/bash/patches/112-upstream-bash42-012.patch @@ -0,0 +1,145 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-012 + +Bug-Reported-by: Rui Santos +Bug-Reference-ID: <4E04C6D0.2020507@grupopie.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-06/msg00079.html + +Bug-Description: + +When calling the parser to recursively parse a command substitution within +an arithmetic expansion, the shell overwrote the saved shell input line and +associated state, resulting in a garbled command. + +Patch (apply with `patch -p0'): + +--- a/parse.y ++++ b/parse.y +@@ -3842,6 +3842,7 @@ xparse_dolparen (base, string, indp, fla + int flags; + { + sh_parser_state_t ps; ++ sh_input_line_state_t ls; + int orig_ind, nc, sflags; + char *ret, *s, *ep, *ostring; + +@@ -3849,10 +3850,12 @@ xparse_dolparen (base, string, indp, fla + orig_ind = *indp; + ostring = string; + ++/*itrace("xparse_dolparen: size = %d shell_input_line = `%s'", shell_input_line_size, shell_input_line);*/ + sflags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOFREE; + if (flags & SX_NOLONGJMP) + sflags |= SEVAL_NOLONGJMP; + save_parser_state (&ps); ++ save_input_line_state (&ls); + + /*(*/ + parser_state |= PST_CMDSUBST|PST_EOFTOKEN; /* allow instant ')' */ /*(*/ +@@ -3861,6 +3864,8 @@ xparse_dolparen (base, string, indp, fla + + restore_parser_state (&ps); + reset_parser (); ++ /* reset_parser clears shell_input_line and associated variables */ ++ restore_input_line_state (&ls); + if (interactive) + token_to_read = 0; + +@@ -5908,6 +5913,12 @@ save_parser_state (ps) + ps->expand_aliases = expand_aliases; + ps->echo_input_at_read = echo_input_at_read; + ++ ps->token = token; ++ ps->token_buffer_size = token_buffer_size; ++ /* Force reallocation on next call to read_token_word */ ++ token = 0; ++ token_buffer_size = 0; ++ + return (ps); + } + +@@ -5949,6 +5960,42 @@ restore_parser_state (ps) + + expand_aliases = ps->expand_aliases; + echo_input_at_read = ps->echo_input_at_read; ++ ++ FREE (token); ++ token = ps->token; ++ token_buffer_size = ps->token_buffer_size; ++} ++ ++sh_input_line_state_t * ++save_input_line_state (ls) ++ sh_input_line_state_t *ls; ++{ ++ if (ls == 0) ++ ls = (sh_input_line_state_t *)xmalloc (sizeof (sh_input_line_state_t)); ++ if (ls == 0) ++ return ((sh_input_line_state_t *)NULL); ++ ++ ls->input_line = shell_input_line; ++ ls->input_line_size = shell_input_line_size; ++ ls->input_line_len = shell_input_line_len; ++ ls->input_line_index = shell_input_line_index; ++ ++ /* force reallocation */ ++ shell_input_line = 0; ++ shell_input_line_size = shell_input_line_len = shell_input_line_index = 0; ++} ++ ++void ++restore_input_line_state (ls) ++ sh_input_line_state_t *ls; ++{ ++ FREE (shell_input_line); ++ shell_input_line = ls->input_line; ++ shell_input_line_size = ls->input_line_size; ++ shell_input_line_len = ls->input_line_len; ++ shell_input_line_index = ls->input_line_index; ++ ++ set_line_mbstate (); + } + + /************************************************ +--- a/shell.h ++++ b/shell.h +@@ -136,6 +136,9 @@ typedef struct _sh_parser_state_t { + int parser_state; + int *token_state; + ++ char *token; ++ int token_buffer_size; ++ + /* input line state -- line number saved elsewhere */ + int input_line_terminator; + int eof_encountered; +@@ -166,6 +169,16 @@ typedef struct _sh_parser_state_t { + + } sh_parser_state_t; + ++typedef struct _sh_input_line_state_t { ++ char *input_line; ++ int input_line_index; ++ int input_line_size; ++ int input_line_len; ++} sh_input_line_state_t; ++ + /* Let's try declaring these here. */ + extern sh_parser_state_t *save_parser_state __P((sh_parser_state_t *)); + extern void restore_parser_state __P((sh_parser_state_t *)); ++ ++extern sh_input_line_state_t *save_input_line_state __P((sh_input_line_state_t *)); ++extern void restore_input_line_state __P((sh_input_line_state_t *)); +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 11 ++#define PATCHLEVEL 12 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/113-upstream-bash42-013.patch b/utils/bash/patches/113-upstream-bash42-013.patch new file mode 100644 index 0000000..aee78a2 --- /dev/null +++ b/utils/bash/patches/113-upstream-bash42-013.patch @@ -0,0 +1,43 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-013 + +Bug-Reported-by: Marten Wikstrom +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-05/msg00049.html + +Bug-Description: + +An off-by-one error caused the shell to skip over CTLNUL characters, +which are used internally to mark quoted null strings. The effect +was to have stray 0x7f characters left after expanding words like +""""""""aa. + +Patch (apply with `patch -p0'): + +--- a/subst.c ++++ b/subst.c +@@ -3706,7 +3706,10 @@ remove_quoted_nulls (string) + break; + } + else if (string[i] == CTLNUL) +- i++; ++ { ++ i++; ++ continue; ++ } + + prev_i = i; + ADVANCE_CHAR (string, slen, i); +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 12 ++#define PATCHLEVEL 13 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/114-upstream-bash42-014.patch b/utils/bash/patches/114-upstream-bash42-014.patch new file mode 100644 index 0000000..dfbc990 --- /dev/null +++ b/utils/bash/patches/114-upstream-bash42-014.patch @@ -0,0 +1,38 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-014 + +Bug-Reported-by: Shawn Bohrer +Bug-Reference-ID: <20110504152320.6E8F28130527@dev1.rgmadvisors.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-05/msg00018.html + +Bug-Description: + +The regular expression matching operator did not correctly match +expressions with an embedded ^A. + +Patch (apply with `patch -p0'): + +--- a/pathexp.c ++++ b/pathexp.c +@@ -196,7 +196,7 @@ quote_string_for_globbing (pathname, qfl + { + if ((qflags & QGLOB_FILENAME) && pathname[i+1] == '/') + continue; +- if ((qflags & QGLOB_REGEXP) && ere_char (pathname[i+1]) == 0) ++ if (pathname[i+1] != CTLESC && (qflags & QGLOB_REGEXP) && ere_char (pathname[i+1]) == 0) + continue; + temp[j++] = '\\'; + i++; +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 13 ++#define PATCHLEVEL 14 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/115-upstream-bash42-015.patch b/utils/bash/patches/115-upstream-bash42-015.patch new file mode 100644 index 0000000..49c7a82 --- /dev/null +++ b/utils/bash/patches/115-upstream-bash42-015.patch @@ -0,0 +1,71 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-015 + +Bug-Reported-by: +Bug-Reference-ID: <728_1312188080_4E3666B0_728_118711_1_3B5D3E0F95CC5C478D6500CDCE8B691F7AAAA4AA3D@PUEXCB2B.nanterre.francetelecom.fr> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-08/msg00000.html + +Bug-Description: + +When in a context where arithmetic evaluation is not taking place, the +evaluator should not check for division by 0. + +Patch (apply with `patch -p0'): + +--- a/expr.c ++++ b/expr.c +@@ -476,19 +476,23 @@ expassign () + + if (special) + { ++ if ((op == DIV || op == MOD) && value == 0) ++ { ++ if (noeval == 0) ++ evalerror (_("division by 0")); ++ else ++ value = 1; ++ } ++ + switch (op) + { + case MUL: + lvalue *= value; + break; + case DIV: +- if (value == 0) +- evalerror (_("division by 0")); + lvalue /= value; + break; + case MOD: +- if (value == 0) +- evalerror (_("division by 0")); + lvalue %= value; + break; + case PLUS: +@@ -804,7 +808,12 @@ exp2 () + val2 = exppower (); + + if (((op == DIV) || (op == MOD)) && (val2 == 0)) +- evalerror (_("division by 0")); ++ { ++ if (noeval == 0) ++ evalerror (_("division by 0")); ++ else ++ val2 = 1; ++ } + + if (op == MUL) + val1 *= val2; +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 14 ++#define PATCHLEVEL 15 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/116-upstream-bash42-016.patch b/utils/bash/patches/116-upstream-bash42-016.patch new file mode 100644 index 0000000..0848cfc --- /dev/null +++ b/utils/bash/patches/116-upstream-bash42-016.patch @@ -0,0 +1,37 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-016 + +Bug-Reported-by: Martin von Gagern +Bug-Reference-ID: <4E43AD9E.8060501@gmx.net> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-08/msg00141.html + +Bug-Description: + +Bash should not check for mail while executing the `eval' builtin. + +Patch (apply with `patch -p0'): + +--- a/parse.y ++++ b/parse.y +@@ -2499,7 +2499,7 @@ yylex () + We do this only if it is time to do so. Notice that only here + is the mail alarm reset; nothing takes place in check_mail () + except the checking of mail. Please don't change this. */ +- if (prompt_is_ps1 && time_to_check_mail ()) ++ if (prompt_is_ps1 && parse_and_execute_level == 0 && time_to_check_mail ()) + { + check_mail (); + reset_mail_timer (); +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 15 ++#define PATCHLEVEL 16 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/117-upstream-bash42-017.patch b/utils/bash/patches/117-upstream-bash42-017.patch new file mode 100644 index 0000000..90f71c6 --- /dev/null +++ b/utils/bash/patches/117-upstream-bash42-017.patch @@ -0,0 +1,42 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-017 + +Bug-Reported-by: Curtis Doty +Bug-Reference-ID: <20110621035324.A4F70849F59@mx1.iParadigms.net> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-06/msg00053.html + +Bug-Description: + +Using `read -a foo' where foo was an already-declared associative array +caused the shell to die with a segmentation fault. + +Patch (apply with `patch -p0'): + +--- a/builtins/read.def ++++ b/builtins/read.def +@@ -642,6 +642,12 @@ assign_vars: + xfree (input_string); + return EXECUTION_FAILURE; /* readonly or noassign */ + } ++ if (assoc_p (var)) ++ { ++ builtin_error (_("%s: cannot convert associative to indexed array"), arrayname); ++ xfree (input_string); ++ return EXECUTION_FAILURE; /* existing associative array */ ++ } + array_flush (array_cell (var)); + + alist = list_string (input_string, ifs_chars, 0); +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 16 ++#define PATCHLEVEL 17 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/118-upstream-bash42-018.patch b/utils/bash/patches/118-upstream-bash42-018.patch new file mode 100644 index 0000000..82654c8 --- /dev/null +++ b/utils/bash/patches/118-upstream-bash42-018.patch @@ -0,0 +1,57 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-018 + +Bug-Reported-by: Thomas Cort +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-06/msg00110.html + +Bug-Description: + +Bash fails to compile unless JOB_CONTROL is defined. + +Patch (apply with `patch -p0'): + +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -2196,6 +2196,7 @@ execute_pipeline (command, asynchronous, + if (ignore_return && cmd) + cmd->flags |= CMD_IGNORE_RETURN; + ++#if defined (JOB_CONTROL) + lastpipe_flag = 0; + begin_unwind_frame ("lastpipe-exec"); + lstdin = -1; +@@ -2219,15 +2220,19 @@ execute_pipeline (command, asynchronous, + lastpipe_jid = stop_pipeline (0, (COMMAND *)NULL); /* XXX */ + add_unwind_protect (lastpipe_cleanup, lastpipe_jid); + } +- cmd->flags |= CMD_LASTPIPE; ++ if (cmd) ++ cmd->flags |= CMD_LASTPIPE; + } + if (prev >= 0) + add_unwind_protect (close, prev); ++#endif + + exec_result = execute_command_internal (cmd, asynchronous, prev, pipe_out, fds_to_close); + ++#if defined (JOB_CONTROL) + if (lstdin > 0) + restore_stdin (lstdin); ++#endif + + if (prev >= 0) + close (prev); +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 17 ++#define PATCHLEVEL 18 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/119-upstream-bash42-019.patch b/utils/bash/patches/119-upstream-bash42-019.patch new file mode 100644 index 0000000..215ae67 --- /dev/null +++ b/utils/bash/patches/119-upstream-bash42-019.patch @@ -0,0 +1,42 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-019 + +Bug-Reported-by: Diego Augusto Molina +Bug-Reference-ID: +Bug-Reference-URL: lists.gnu.org/archive/html/bug-bash/2011-09/msg00047.html + +Bug-Description: + +Using `declare' with attributes and an invalid array variable name or +assignment reference resulted in a segmentation fault instead of a +declaration error. + +Patch (apply with `patch -p0'): + +--- a/builtins/declare.def ++++ b/builtins/declare.def +@@ -513,6 +513,11 @@ declare_internal (list, local_var) + *subscript_start = '['; /* ] */ + var = assign_array_element (name, value, 0); /* XXX - not aflags */ + *subscript_start = '\0'; ++ if (var == 0) /* some kind of assignment error */ ++ { ++ assign_error++; ++ NEXT_VARIABLE (); ++ } + } + else if (simple_array_assign) + { +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 18 ++#define PATCHLEVEL 19 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/120-upstream-bash42-020.patch b/utils/bash/patches/120-upstream-bash42-020.patch new file mode 100644 index 0000000..a91c950 --- /dev/null +++ b/utils/bash/patches/120-upstream-bash42-020.patch @@ -0,0 +1,47 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-020 + +Bug-Reported-by: Vincent Sheffer +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-readline/2011-08/msg00000.html + +Bug-Description: + +The shared object helper script needs to be updated for Mac OS X 10.7 +(Lion, darwin11). + +Patch (apply with `patch -p0'): + +--- a/support/shobj-conf ++++ b/support/shobj-conf +@@ -157,7 +157,7 @@ freebsd[4-9]*|freebsdelf*|dragonfly*) + ;; + + # Darwin/MacOS X +-darwin[89]*|darwin10*) ++darwin[89]*|darwin1[012]*) + SHOBJ_STATUS=supported + SHLIB_STATUS=supported + +@@ -186,7 +186,7 @@ darwin*|macosx*) + SHLIB_LIBSUFF='dylib' + + case "${host_os}" in +- darwin[789]*|darwin10*) SHOBJ_LDFLAGS='' ++ darwin[789]*|darwin1[012]*) SHOBJ_LDFLAGS='' + SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v' + ;; + *) SHOBJ_LDFLAGS='-dynamic' +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 19 ++#define PATCHLEVEL 20 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/121-upstream-bash42-021.patch b/utils/bash/patches/121-upstream-bash42-021.patch new file mode 100644 index 0000000..38c3ae4 --- /dev/null +++ b/utils/bash/patches/121-upstream-bash42-021.patch @@ -0,0 +1,48 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-021 + +Bug-Reported-by: Dan Douglas +Bug-Reference-ID: <4585554.nZWb4q7YoZ@smorgbox> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-12/msg00084.html + +Bug-Description: + +Using `read -N' to assign values to an array can result in NUL values being +assigned to some array elements. These values cause seg faults when referenced +later. + +Patch (apply with `patch -p0'): + +--- a/builtins/read.def ++++ b/builtins/read.def +@@ -737,7 +737,7 @@ assign_vars: + xfree (t1); + } + else +- var = bind_read_variable (varname, t); ++ var = bind_read_variable (varname, t ? t : ""); + } + else + { +@@ -798,7 +798,7 @@ assign_vars: + xfree (t); + } + else +- var = bind_read_variable (list->word->word, input_string); ++ var = bind_read_variable (list->word->word, input_string ? input_string : ""); + + if (var) + { +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 20 ++#define PATCHLEVEL 21 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/122-upstream-bash42-022.patch b/utils/bash/patches/122-upstream-bash42-022.patch new file mode 100644 index 0000000..30020ba --- /dev/null +++ b/utils/bash/patches/122-upstream-bash42-022.patch @@ -0,0 +1,46 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-022 + +Bug-Reported-by: Gregory Margo +Bug-Reference-ID: <20110727174529.GA3333@pacbell.net> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-07/msg00102.html + +Bug-Description: + +The return value from lseek is `off_t'. This can cause corrupted return +values when the file offset is greater than 2**31 - 1. + +Patch (apply with `patch -p0'): + +--- a/lib/sh/zread.c ++++ b/lib/sh/zread.c +@@ -160,14 +160,13 @@ void + zsyncfd (fd) + int fd; + { +- off_t off; +- int r; ++ off_t off, r; + + off = lused - lind; + r = 0; + if (off > 0) + r = lseek (fd, -off, SEEK_CUR); + +- if (r >= 0) ++ if (r != -1) + lused = lind = 0; + } +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 21 ++#define PATCHLEVEL 22 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/123-upstream-bash42-023.patch b/utils/bash/patches/123-upstream-bash42-023.patch new file mode 100644 index 0000000..6c6fdb3 --- /dev/null +++ b/utils/bash/patches/123-upstream-bash42-023.patch @@ -0,0 +1,53 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-023 + +Bug-Reported-by: Ewan Mellor +Bug-Reference-ID: <6005BE083BF501439A84DC3523BAC82DC4B964FD12@LONPMAILBOX01.citrite.net> +Bug-Reference-URL: + +Bug-Description: + +Under some circumstances, an exit trap triggered by a bad substitution +error when errexit is enabled will cause the shell to exit with an +incorrect exit status (0). + +Patch (apply with `patch -p0'): + +--- a/subst.c ++++ b/subst.c +@@ -7274,6 +7274,7 @@ parameter_brace_expand (string, indexp, + default: + case '\0': + bad_substitution: ++ last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: bad substitution"), string ? string : "??"); + FREE (value); + FREE (temp); +--- a/error.c ++++ b/error.c +@@ -200,7 +200,11 @@ report_error (format, va_alist) + + va_end (args); + if (exit_immediately_on_error) +- exit_shell (1); ++ { ++ if (last_command_exit_value == 0) ++ last_command_exit_value = 1; ++ exit_shell (last_command_exit_value); ++ } + } + + void +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 22 ++#define PATCHLEVEL 23 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/124-upstream-bash42-024.patch b/utils/bash/patches/124-upstream-bash42-024.patch new file mode 100644 index 0000000..2137c02 --- /dev/null +++ b/utils/bash/patches/124-upstream-bash42-024.patch @@ -0,0 +1,40 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-024 + +Bug-Reported-by: Jim Avera +Bug-Reference-ID: <4F29E07A.80405@yahoo.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-02/msg00001.html + +Bug-Description: + +When `printf -v' is used to set an array element, the format string contains +`%b', and the corresponding argument is the empty string, the buffer used +to store the value to be assigned can be NULL, which results in NUL being +assigned to the array element. This causes a seg fault when it's used later. + +Patch (apply with `patch -p0'): + +--- a/builtins/printf.def ++++ b/builtins/printf.def +@@ -255,6 +255,8 @@ printf_builtin (list) + #endif + { + vflag = 1; ++ if (vbsize == 0) ++ vbuf = xmalloc (vbsize = 16); + vblen = 0; + if (vbuf) + vbuf[0] = 0; +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 23 ++#define PATCHLEVEL 24 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/125-upstream-bash42-025.patch b/utils/bash/patches/125-upstream-bash42-025.patch new file mode 100644 index 0000000..3983ff5 --- /dev/null +++ b/utils/bash/patches/125-upstream-bash42-025.patch @@ -0,0 +1,111 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-025 + +Bug-Reported-by: Bill Gradwohl +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/help-bash/2012-03/msg00078.html + +Bug-Description: + +When used in a shell function, `declare -g -a array=(compound assignment)' +creates a local variable instead of a global one. + +Patch (apply with `patch -p0'): + +--- a/command.h ++++ b/command.h +@@ -97,6 +97,7 @@ enum command_type { cm_for, cm_case, cm_ + #define W_HASCTLESC 0x200000 /* word contains literal CTLESC characters */ + #define W_ASSIGNASSOC 0x400000 /* word looks like associative array assignment */ + #define W_ARRAYIND 0x800000 /* word is an array index being expanded */ ++#define W_ASSNGLOBAL 0x1000000 /* word is a global assignment to declare (declare/typeset -g) */ + + /* Possible values for subshell_environment */ + #define SUBSHELL_ASYNC 0x01 /* subshell caused by `command &' */ +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -3584,13 +3584,13 @@ fix_assignment_words (words) + { + WORD_LIST *w; + struct builtin *b; +- int assoc; ++ int assoc, global; + + if (words == 0) + return; + + b = 0; +- assoc = 0; ++ assoc = global = 0; + + for (w = words; w; w = w->next) + if (w->word->flags & W_ASSIGNMENT) +@@ -3607,12 +3607,17 @@ fix_assignment_words (words) + #if defined (ARRAY_VARS) + if (assoc) + w->word->flags |= W_ASSIGNASSOC; ++ if (global) ++ w->word->flags |= W_ASSNGLOBAL; + #endif + } + #if defined (ARRAY_VARS) + /* Note that we saw an associative array option to a builtin that takes + assignment statements. This is a bit of a kludge. */ +- else if (w->word->word[0] == '-' && strchr (w->word->word, 'A')) ++ else if (w->word->word[0] == '-' && (strchr (w->word->word+1, 'A') || strchr (w->word->word+1, 'g'))) ++#else ++ else if (w->word->word[0] == '-' && strchr (w->word->word+1, 'g')) ++#endif + { + if (b == 0) + { +@@ -3622,10 +3627,11 @@ fix_assignment_words (words) + else if (b && (b->flags & ASSIGNMENT_BUILTIN)) + words->word->flags |= W_ASSNBLTIN; + } +- if (words->word->flags & W_ASSNBLTIN) ++ if ((words->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'A')) + assoc = 1; ++ if ((words->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'g')) ++ global = 1; + } +-#endif + } + + /* Return 1 if the file found by searching $PATH for PATHNAME, defaulting +--- a/subst.c ++++ b/subst.c +@@ -366,6 +366,11 @@ dump_word_flags (flags) + f &= ~W_ASSNBLTIN; + fprintf (stderr, "W_ASSNBLTIN%s", f ? "|" : ""); + } ++ if (f & W_ASSNGLOBAL) ++ { ++ f &= ~W_ASSNGLOBAL; ++ fprintf (stderr, "W_ASSNGLOBAL%s", f ? "|" : ""); ++ } + if (f & W_COMPASSIGN) + { + f &= ~W_COMPASSIGN; +@@ -2803,7 +2808,7 @@ do_assignment_internal (word, expand) + } + else if (assign_list) + { +- if (word->flags & W_ASSIGNARG) ++ if ((word->flags & W_ASSIGNARG) && (word->flags & W_ASSNGLOBAL) == 0) + aflags |= ASS_MKLOCAL; + if (word->flags & W_ASSIGNASSOC) + aflags |= ASS_MKASSOC; +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 24 ++#define PATCHLEVEL 25 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/126-upstream-bash42-026.patch b/utils/bash/patches/126-upstream-bash42-026.patch new file mode 100644 index 0000000..b0efc0c --- /dev/null +++ b/utils/bash/patches/126-upstream-bash42-026.patch @@ -0,0 +1,48 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-026 + +Bug-Reported-by: Greg Wooledge +Bug-Reference-ID: <20120425180443.GO22241@eeg.ccf.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-04/msg00172.html + +Bug-Description: + +The `lastpipe' option does not behave correctly on machines where the +open file limit is less than 256. + +Patch (apply with `patch -p0'): + +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -2209,7 +2209,7 @@ execute_pipeline (command, asynchronous, + #endif + asynchronous == 0 && pipe_out == NO_PIPE && prev > 0) + { +- lstdin = move_to_high_fd (0, 0, 255); ++ lstdin = move_to_high_fd (0, 1, -1); + if (lstdin > 0) + { + do_piping (prev, pipe_out); +@@ -2255,7 +2255,9 @@ execute_pipeline (command, asynchronous, + unfreeze_jobs_list (); + } + ++#if defined (JOB_CONTROL) + discard_unwind_frame ("lastpipe-exec"); ++#endif + + return (exec_result); + } +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 25 ++#define PATCHLEVEL 26 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/127-upstream-bash42-027.patch b/utils/bash/patches/127-upstream-bash42-027.patch new file mode 100644 index 0000000..525abe0 --- /dev/null +++ b/utils/bash/patches/127-upstream-bash42-027.patch @@ -0,0 +1,38 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-027 + +Bug-Reported-by: Mike Frysinger +Bug-Reference-ID: <201204211243.30163.vapier@gentoo.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-04/msg00134.html + +Bug-Description: + +When the `extglob' shell option is enabled, pattern substitution does not +work correctly in the presence of multibyte characters. + +Patch (apply with `patch -p0'): + +--- a/subst.c ++++ b/subst.c +@@ -4166,7 +4166,7 @@ match_wpattern (wstring, indices, wstrle + simple = (wpat[0] != L'\\' && wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'['); + #if defined (EXTENDED_GLOB) + if (extended_glob) +- simple |= (wpat[1] != L'(' || (wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'+' && wpat[0] != L'!' && wpat[0] != L'@')); /*)*/ ++ simple &= (wpat[1] != L'(' || (wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'+' && wpat[0] != L'!' && wpat[0] != L'@')); /*)*/ + #endif + + /* If the pattern doesn't match anywhere in the string, go ahead and +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 26 ++#define PATCHLEVEL 27 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/128-upstream-bash42-028.patch b/utils/bash/patches/128-upstream-bash42-028.patch new file mode 100644 index 0000000..8b5b1b2 --- /dev/null +++ b/utils/bash/patches/128-upstream-bash42-028.patch @@ -0,0 +1,46 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-028 + +Bug-Reported-by: Mark Edgar +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-03/msg00109.html + +Bug-Description: + +When using a word expansion for which the right hand side is evaluated, +certain expansions of quoted null strings include spurious ^? characters. + +Patch (apply with `patch -p0'): + +--- a/subst.c ++++ b/subst.c +@@ -5809,6 +5809,16 @@ parameter_brace_expand_rhs (name, value, + is the only expansion that creates more than one word. */ + if (qdollaratp && ((hasdol && quoted) || l->next)) + *qdollaratp = 1; ++ /* If we have a quoted null result (QUOTED_NULL(temp)) and the word is ++ a quoted null (l->next == 0 && QUOTED_NULL(l->word->word)), the ++ flags indicate it (l->word->flags & W_HASQUOTEDNULL), and the ++ expansion is quoted (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ++ (which is more paranoia than anything else), we need to return the ++ quoted null string and set the flags to indicate it. */ ++ if (l->next == 0 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL(temp) && QUOTED_NULL(l->word->word) && (l->word->flags & W_HASQUOTEDNULL)) ++ { ++ w->flags |= W_HASQUOTEDNULL; ++ } + dispose_words (l); + } + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && hasdol) +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 27 ++#define PATCHLEVEL 28 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/129-no_doc.patch b/utils/bash/patches/129-no_doc.patch new file mode 100644 index 0000000..442cd22 --- /dev/null +++ b/utils/bash/patches/129-no_doc.patch @@ -0,0 +1,14 @@ +diff -urN bash-4.2/Makefile.in bash-4.2.new/Makefile.in +--- bash-4.2/Makefile.in 2010-12-01 01:22:42.000000000 +0100 ++++ bash-4.2.new/Makefile.in 2012-07-30 16:24:01.325057998 +0200 +@@ -724,10 +724,8 @@ + # $(MAKE) -f $(srcdir)/Makefile $(MFLAGS) srcdir=$(srcdir) + + doc documentation: force +- @(cd $(DOCDIR) ; $(MAKE) $(MFLAGS) ) + + info dvi ps: force +- @(cd $(DOCDIR) ; $(MAKE) $(MFLAGS) CFLAGS='$(CCFLAGS)' $@ ) + + force: + diff --git a/utils/bc/Makefile b/utils/bc/Makefile new file mode 100644 index 0000000..9f59be3 --- /dev/null +++ b/utils/bc/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bc +PKG_VERSION:=1.06.95 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=ftp://ftp.debian.org/debian/pool/main/b/bc +PKG_MD5SUM:=24d0831812d8262b6cac8316b0bac483 + +include $(INCLUDE_DIR)/package.mk + +define Package/bc/Default + SECTION:=utils + CATEGORY:=Utilities + URL:=http://packages.debian.org/bc +endef + +define Package/bc + $(call Package/bc/Default) + TITLE:=Arbitrary precision calculator language + DEPENDS:=+libreadline +libncurses +endef + +define Package/bc/description + bc is a language that supports arbitrary precision numbers with + interactive execution of statements. +endef + +define Package/dc + $(call Package/bc/Default) + TITLE:=Arbitrary precision reverse-polish calculator + DEPENDS:=bc +endef + +define Package/dc/description + dc is a reverse-polish desk calculator which supports unlimited + precision arithmetic. +endef + +CONFIGURE_ARGS += --with-readline + +define Package/bc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bc/bc $(1)/usr/bin/ +endef + +define Package/dc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dc/dc $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,bc)) +$(eval $(call BuildPackage,dc)) diff --git a/utils/bc/patches/001-disable-doc.patch b/utils/bc/patches/001-disable-doc.patch new file mode 100644 index 0000000..a6ecd6e --- /dev/null +++ b/utils/bc/patches/001-disable-doc.patch @@ -0,0 +1,21 @@ +--- bc-1.06.95/Makefile.in 2010-07-03 10:48:13.422725147 +0000 ++++ bc-1.06.95/Makefile.in 2010-07-03 10:50:09.714725197 +0000 +@@ -149,7 +149,7 @@ + sharedstatedir = @sharedstatedir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ +-SUBDIRS = lib bc dc doc ++SUBDIRS = lib bc dc + MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \ + stamp-h $(distdir).tar.gz h/number.h depcomp missing + +--- bc-1.06.95/Makefile.am 2010-07-03 10:48:32.522725037 +0000 ++++ bc-1.06.95/Makefile.am 2010-07-03 10:48:38.114725024 +0000 +@@ -1,6 +1,6 @@ + ## Process this file with automake to produce Makefile.in + +-SUBDIRS = lib bc dc doc ++SUBDIRS = lib bc dc + + MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \ + stamp-h $(distdir).tar.gz h/number.h depcomp missing diff --git a/utils/bemused/Makefile b/utils/bemused/Makefile new file mode 100644 index 0000000..61cc101 --- /dev/null +++ b/utils/bemused/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (C) 2008-2011 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:=bemused-mpd +PKG_VERSION:=r062 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.origo.ethz.ch/bemused-lnx-mpdhack/526 +PKG_MD5SUM:=aed8b41aed530e9177e43d9bebad10b7 + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/bemusedlinuxserver + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+bluez-libs +glib1 +mpd +libstdcpp $(ICONV_DEPENDS) + TITLE:=Bemused linux server + URL:=http://bemused-lnx-mpdhack.origo.ethz.ch/ +endef + +define Package/bemusedlinuxserver/description + Bemused is a system which allows you to control your music collection + from your phone, using Bluetooth. + This is the MPD hack version. + Check http://jamse.sourceforge.net/ for a mobile phone client. +endef + +EXTRA_CPPFLAGS:= \ + -I$(STAGING_DIR)/usr/include/glib-1.2 \ + -I$(STAGING_DIR)/usr/lib/glib/include + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \ + CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \ + LDLIBS="-lbluetooth -lglib -liconv" +endef + +define Package/bemusedlinuxserver/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bemusedlinuxserver $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/bemused.conf $(1)/etc/bemused.conf + $(INSTALL_CONF) ./files/bemused-bookmarks $(1)/etc/bemused-bookmarks + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/bemused.init $(1)/etc/init.d/bemused +endef + +define Package/bemusedlinuxserver/conffiles +/etc/bemused.conf +/etc/bemused-bookmarks +endef + +$(eval $(call BuildPackage,bemusedlinuxserver)) diff --git a/utils/bemused/files/bemused-bookmarks b/utils/bemused/files/bemused-bookmarks new file mode 100644 index 0000000..5f132b5 --- /dev/null +++ b/utils/bemused/files/bemused-bookmarks @@ -0,0 +1,8 @@ +# Bemused stream file +# This is quite a simple format file +# Stream Title = URL +# +# IMPORTANT: stream name MUST contain the ".mp3" extension, else jamse will not display the file! + +UnitedBreaks.mp3 = http://74.52.13.138:8000 +nubreaks.mp3 = http://208.100.38.52:8419 diff --git a/utils/bemused/files/bemused.conf b/utils/bemused/files/bemused.conf new file mode 100644 index 0000000..95acd46 --- /dev/null +++ b/utils/bemused/files/bemused.conf @@ -0,0 +1,43 @@ +# bemused config file Version 1.73 (no changes since 1.71) +# lines with a # at the beinning are for comments and not readen by the bemusedserver +# You only need to set up options which have no default and which ware not optinal + +# this is a mpd-hack version by michu@neophob.com + +# Path to mpd (if mpd is in path only mpd) (default is mpd) +mpddir=/usr/local/bin/mpd + +# channel for what the serial port service is registered (with sdptool look in README) (default 10) +# example: +# root@OpenWrt:~# sdptool browse +# Inquiring ... +# <...> +# Service Name: COM 1 +# Service RecHandle: 0x10005 +# Service Class ID List: +# "Serial Port" (0x1101) +# Protocol Descriptor List: +# "L2CAP" (0x0100) +# "RFCOMM" (0x0003) +# Channel: 3 <<< +# Language Base Attr List: +# code_ISO639: 0x656e +# encoding: 0x6a +# base_offset: 0x100 +channel=3 + +# directorys where the mp3s are. If more than one seperate them by a m semicolon (must be set) +# point this directory to the mpd music directory! +mp3dir=/ + +# bookmarks file for URLs of net radio stations (optional) +bookmarkfile=/etc/bemused-bookmarks + +# speed setting for fast forward and rewind. time for every jump in milliseconds 10000 is default +#fastforbackspeed=10000 + +# set to 1 to use connection over TCP/IP (for bluetooth pan or maybe LAN oder internet) set to 0 for normal rfcomm bluetooth (default) +#tcp=1 + +# port to use if you set tcp to 1 for your incomming TCP/IP Connection. (default is 7654 and at the moment the only one useable by the client on the phone) +#tcpport=7654 diff --git a/utils/bemused/files/bemused.init b/utils/bemused/files/bemused.init new file mode 100644 index 0000000..a4ab2c7 --- /dev/null +++ b/utils/bemused/files/bemused.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2011 OpenWrt.org + +START=95 + +start() { + service_start /usr/sbin/bemusedlinuxserver -d +} + +stop() { + service_stop /usr/sbin/bemusedlinuxserver +} diff --git a/utils/bemused/patches/110-missing_includes.patch b/utils/bemused/patches/110-missing_includes.patch new file mode 100644 index 0000000..c049e36 --- /dev/null +++ b/utils/bemused/patches/110-missing_includes.patch @@ -0,0 +1,11 @@ +diff -urN bemused-mpd-r062/main.cpp bemused-mpd-r062.new/main.cpp +--- bemused-mpd-r062/main.cpp 2008-02-23 08:01:38.000000000 +0100 ++++ bemused-mpd-r062.new/main.cpp 2010-03-29 13:00:07.000000000 +0200 +@@ -16,6 +16,7 @@ + ***************************************************************************/ + + #include ++#include + #include + + #include "BemusedServerDlg.h" diff --git a/utils/bemused/patches/200-cxx-compile-fixes.patch b/utils/bemused/patches/200-cxx-compile-fixes.patch new file mode 100644 index 0000000..4a6ef0e --- /dev/null +++ b/utils/bemused/patches/200-cxx-compile-fixes.patch @@ -0,0 +1,71 @@ +Index: bemused-mpd-r062/Makefile +=================================================================== +--- bemused-mpd-r062.orig/Makefile 2008-03-31 09:43:54.000000000 +0200 ++++ bemused-mpd-r062/Makefile 2011-03-06 14:19:07.933096517 +0100 +@@ -1,8 +1,15 @@ +-SHELL = /bin/sh ++LDLIBS = -lbluetooth -lglib -liconv ++CPPFLAGS = -I/usr/include -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I./ ++CFLAGS = -Os ++CXXFLAGS = -Os + +-#optimized for openwrt use! mylibs should be -lbluetooth, liconv and -lglib +-MYLIBS = -lbluetooth -lglib -liconv +-INCL = -I/usr/include -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I./ ++%.o: %.c ++ $(CC) -c $(CFLAGS) $(CPPFLAGS) $^ -o $@ + +-bemusedlinuxserver: main.cpp BemusedServerDlg.cpp mpdctrl.c +- $(CXX) -Os -o bemusedlinuxserver $(INCL) $(LDFLAGS) $(MYLIBS) main.cpp BemusedServerDlg.cpp mpdctrl.c libmpdclient.c ++%.o: %.cpp ++ $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $^ -o $@ ++ ++bemusedlinuxserver: main.o BemusedServerDlg.o mpdctrl.o libmpdclient.o ++ $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@ ++ ++all: bemusedlinuxserver +Index: bemused-mpd-r062/libmpdclient.h +=================================================================== +--- bemused-mpd-r062.orig/libmpdclient.h 2008-04-28 23:03:52.000000000 +0200 ++++ bemused-mpd-r062/libmpdclient.h 2011-03-06 14:15:34.821307043 +0100 +@@ -68,11 +68,10 @@ + #define MPD_ACK_ERROR_EXIST 56 + + #include +-#include + +-//#ifdef __cplusplus +-//extern "C" { +-//#endif ++#ifdef __cplusplus ++extern "C" { ++#endif + + typedef enum mpd_TagItems { + MPD_TAG_ITEM_ARTIST, +@@ -654,8 +653,8 @@ void mpd_sendPlaylistAddCommand(mpd_Conn + void mpd_sendPlaylistMoveCommand(mpd_Connection * connection, char *playlist, int from, int to); + + void mpd_sendPlaylistDeleteCommand(mpd_Connection * connection, char *playlist, int pos); +-//#ifdef __cplusplus +-//} +-//#endif ++#ifdef __cplusplus ++} ++#endif + + #endif +Index: bemused-mpd-r062/mpdctrl.c +=================================================================== +--- bemused-mpd-r062.orig/mpdctrl.c 2008-04-28 23:03:52.000000000 +0200 ++++ bemused-mpd-r062/mpdctrl.c 2011-03-06 14:15:34.821307043 +0100 +@@ -59,6 +59,9 @@ + + #define ERROR_DISPLAY 5 + ++#define false 0 ++#define true (!false) ++ + static int l_totalTimeSec; + static int l_elapsedTimeSec; + static int l_bitRate; diff --git a/utils/bluelog/Makefile b/utils/bluelog/Makefile new file mode 100644 index 0000000..8da62d4 --- /dev/null +++ b/utils/bluelog/Makefile @@ -0,0 +1,88 @@ +# +# Copyright (C) 2012 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:=bluelog +PKG_VERSION:=1.0.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.digifail.com/downloads/software/bluelog +PKG_MD5SUM:=2791fbb0333b0b414a4d2230c1e9e8e6 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/bluelog/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Bluetooth scanner and logger + URL:=http://www.digifail.com/software/bluelog.shtml + DEPENDS:=+bluez-utils +kmod-bluetooth +endef + +define Package/bluelog/Default/description + Bluelog is a simple Bluetooth scanner designed to tell you how many + discoverable devices there are in an area as quickly as possible. It is + intended to be used as a site survey tool, identifying the number of possible + Bluetooth targets there are in the surrounding environment. +endef + +define Package/bluelog + $(call Package/bluelog/Default) +endef + +define Package/bluelog/description + $(call Package/bluelog/Default/description) +endef + +define Package/bluelog-live + $(call Package/bluelog/Default) + TITLE+= (live output) + DEPENDS+= bluelog +endef + +define Package/bluelog-live/description + $(call Package/bluelog/Default/description) + This package contains the files for "Bluelog Live", an optional mode of + Bluelog which creates a real-time webpage of discovered Bluetooth devices. +endef + +TARGET_CFLAGS += -DOPENWRT + +MAKE_FLAGS += \ + LIBS="$(TARGET_LDFLAGS) -lbluetooth" + +define Package/bluelog/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/bluelog $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/bluelog.init $(1)/etc/init.d/bluelog +endef + +define Package/bluelog-live/install + $(INSTALL_DIR) $(1)/www/bluelog + $(CP) $(PKG_INSTALL_DIR)/var/lib/bluelog/*.html $(1)/www/bluelog/ + $(CP) \ + $(PKG_INSTALL_DIR)/var/lib/bluelog/openwrt.css \ + $(1)/www/bluelog/style.css + $(INSTALL_DIR) $(1)/www/bluelog/images + $(CP) \ + $(PKG_INSTALL_DIR)/var/lib/bluelog/images/digifail_logo.png \ + $(PKG_INSTALL_DIR)/var/lib/bluelog/images/email.png \ + $(PKG_INSTALL_DIR)/var/lib/bluelog/images/favicon.png \ + $(PKG_INSTALL_DIR)/var/lib/bluelog/images/openwrt_logo.png \ + $(PKG_INSTALL_DIR)/var/lib/bluelog/images/qrcontact.png \ + $(1)/www/bluelog/images/ + $(INSTALL_DIR) $(1)/www/cgi-bin + $(CP) $(PKG_INSTALL_DIR)/var/lib/bluelog/cgi-bin/* $(1)/www/cgi-bin/ +endef + +$(eval $(call BuildPackage,bluelog)) +$(eval $(call BuildPackage,bluelog-live)) diff --git a/utils/bluelog/files/bluelog.init b/utils/bluelog/files/bluelog.init new file mode 100644 index 0000000..efae288 --- /dev/null +++ b/utils/bluelog/files/bluelog.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common + +START=65 + +SERVICE_DAEMONIZE=1 + +start() { + service_start /usr/bin/bluelog +} + +stop() { + service_stop /usr/bin/bluelog +} diff --git a/utils/bluez-hcidump/Makefile b/utils/bluez-hcidump/Makefile new file mode 100644 index 0000000..0385553 --- /dev/null +++ b/utils/bluez-hcidump/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bluez-hcidump +PKG_VERSION:=1.42 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://bluez.sourceforge.net/download +PKG_MD5SUM:=5704737aaf72104eeaf77335218a1827 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/bluez-hcidump + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+bluez-libs + TITLE:=Bluetooth packet analyzer + URL:=http://www.bluez.org/ +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --with-bluez="$(STAGING_DIR)/usr/include" \ + ) +endef + +define Package/bluez-hcidump/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/hcidump $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,bluez-hcidump)) diff --git a/utils/bluez-utils/Makefile b/utils/bluez-utils/Makefile new file mode 100644 index 0000000..4f3f787 --- /dev/null +++ b/utils/bluez-utils/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2006-2012 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:=bluez-utils +PKG_VERSION:=3.36 +PKG_RELEASE:=12 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://bluez.sourceforge.net/download +PKG_MD5SUM:=4fc292b635ba7b442c7aaf5680199012 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/bluez-utils + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+bluez-libs +libpthread +dbus $(INTL_DEPENDS) $(ICONV_DEPENDS) + TITLE:=Bluetooth utilities + URL:=http://www.bluez.org/ +endef + +define Package/bluez-utils/conffiles +/etc/bluetooth/hcid.conf +/etc/bluetooth/rfcomm.conf +/etc/config/bluetooth +endef + +CONFIGURE_ARGS += \ + --disable-glib \ + --enable-pand \ + --enable-rfcomm \ + --enable-dund \ + --enable-serial \ + --enable-network \ + --enable-usb \ + --enable-input \ + --disable-audio \ + --with-bluez="$(STAGING_DIR)/usr/include" \ + --with-usb=yes \ + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + LDFLAGS="$(TARGET_LDFLAGS) \ + -L$(ICONV_PREFIX)/lib \ + -L$(INTL_PREFIX)/lib -lm" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/bluez-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/bluetooth + $(CP) $(PKG_INSTALL_DIR)/etc/bluetooth/hcid.conf $(1)/etc/bluetooth/ + $(CP) $(PKG_INSTALL_DIR)/etc/bluetooth/rfcomm.conf $(1)/etc/bluetooth/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth + $(INSTALL_DIR) $(1)/etc/dbus-1/system.d/ + $(INSTALL_DATA) ./files/bluetooth.dbus $(1)/etc/dbus-1/system.d/bluetooth.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/bluez-utils.init $(1)/etc/init.d/bluez-utils +endef + +$(eval $(call BuildPackage,bluez-utils)) diff --git a/utils/bluez-utils/files/bluetooth.config b/utils/bluez-utils/files/bluetooth.config new file mode 100644 index 0000000..42f390c --- /dev/null +++ b/utils/bluez-utils/files/bluetooth.config @@ -0,0 +1,32 @@ +config hcid +# option config /etc/bluetooth/hcid.conf + option enabled 1 + +config hciattach + option initspeed 115200 + option tty ttyS1 + option type csr + option speed 115200 + option flow noflow + option enabled 0 + +config rfcomm +# option config /etc/bluetooth/rfcomm.conf + option enabled 0 + +config dund + option listen true + option persist true + option msdun true + option interface dund + option unit 1 + option pppdopts "ktune proxyarp 192.168.1.1:192.168.1.2 ms-dns 192.168.1.1" + option enabled 0 + +config pand + option listen true + option autozap true + option role "NAP" + option master true + option persist true + option enabled 0 diff --git a/utils/bluez-utils/files/bluetooth.dbus b/utils/bluez-utils/files/bluetooth.dbus new file mode 100644 index 0000000..88545fa --- /dev/null +++ b/utils/bluez-utils/files/bluetooth.dbus @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/utils/bluez-utils/files/bluez-utils.init b/utils/bluez-utils/files/bluez-utils.init new file mode 100644 index 0000000..e9320ae --- /dev/null +++ b/utils/bluez-utils/files/bluez-utils.init @@ -0,0 +1,131 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007 OpenWrt.org + +#start after dbus (60) +START=62 + +append_bool() { + local section="$1" + local option="$2" + local value="$3" + local _val + config_get_bool _val "$section" "$option" '0' + [ $_val -gt 0 ] && append args "$3" +} + +append_string() { + local section="$1" + local option="$2" + local value="$3" + local default="$4" + local _val + config_get _val "$section" "$option" "$default" + [ -n "$_val" ] && append args "$3 $_val" +} + +hcid_config() { + local cfg="$1" + config_get_bool enabled "$cfg" "enabled" '1' + [ $enabled -gt 0 ] || return 1 + args="" + append_bool "$cfg" nodaemon "-n" + append_string "$cfg" config "-f" + service_start /usr/sbin/hcid $args +} + +hciattach_config() { + local cfg="$1" + config_get_bool enabled "$cfg" "enabled" '1' + [ $enabled -gt 0 ] || return 1 + args="" + append_string "$cfg" initspeed "-s" "115200" + append_string "$cfg" tty " " "ttyS1" + append_string "$cfg" type " " "csr" + append_string "$cfg" speed " " "115200" + append_string "$cfg" flow " " "noflow" + service_start /usr/sbin/hciattach $args +} + +rfcomm_config() { + local cfg="$1" + config_get_bool enabled "$cfg" "enabled" '1' + [ $enabled -gt 0 ] || return 1 + args="" + append_string "$cfg" config "-f" + /usr/bin/rfcomm $args bind all +} + +dund_config() { + local cfg="$1" + config_get_bool enabled "$cfg" "enabled" '1' + [ $enabled -gt 0 ] || return 1 + args="" + append_bool "$cfg" listen "--listen" + append_string "$cfg" connect "--connect" + append_string "$cfg" mrouter "--mrouter" + append_bool "$cfg" search "--search" + append_string "$cfg" channel "--channel" + append_string "$cfg" device "--device" + append_bool "$cfg" nosdp "--nosdp" + append_bool "$cfg" auth "--auth" + append_bool "$cfg" encrypt "--encrypt" + append_bool "$cfg" secure "--secure" + append_bool "$cfg" master "--master" + append_bool "$cfg" nodetach "--nodetach" + append_bool "$cfg" persist "--persist" + append_string "$cfg" pppd "--pppd" + append_bool "$cfg" msdun "--msdun" + append_bool "$cfg" activesync "--activesync" + append_bool "$cfg" cache "--cache" + + append_string "$cfg" pppdopts "" + config_get ifn "$cfg" interface + if [ -n "$ifn" ]; then + config_get unit "$cfg" unit + [ -z "$unit" ] || append args "unit $unit ipparam $ifn linkname $ifn" + fi + + service_start /usr/bin/dund $args +} + +pand_config() { + local cfg="$1" + config_get_bool enabled "$cfg" "enabled" '1' + [ $enabled -gt 0 ] || return 1 + args="" + append_bool "$cfg" listen "--listen" + append_string "$cfg" connect "--connect" + append_bool "$cfg" autozap "--autozap" + append_bool "$cfg" search "--search" + append_string "$cfg" role "--role" + append_string "$cfg" service "--service" + append_string "$cfg" ethernet "--ethernet" + append_string "$cfg" device "--device" + append_bool "$cfg" nosdp "-D" + append_bool "$cfg" auth "-A" + append_bool "$cfg" encrypt "-E" + append_bool "$cfg" secure "-S" + append_bool "$cfg" master "-M" + append_bool "$cfg" nodetach "-n" + append_bool "$cfg" persist "--persist" + append_bool "$cfg" cache "--cache" + append_string "$cfg" pidfile "--pidfile" + service_start /usr/bin/pand $args +} + +start() { + config_load bluetooth + config_foreach hcid_config hcid + config_foreach hciattach_config hciattach + config_foreach rfcomm_config rfcomm + config_foreach dund_config dund + config_foreach pand_config pand +} + +stop() { + service_stop /usr/bin/dund + service_stop /usr/bin/pand + /usr/bin/rfcomm release all + service_stop /usr/sbin/hciattach + service_stop /usr/sbin/hcid +} diff --git a/utils/bluez-utils/files/givepin b/utils/bluez-utils/files/givepin new file mode 100644 index 0000000..e52a338 --- /dev/null +++ b/utils/bluez-utils/files/givepin @@ -0,0 +1,14 @@ +#!/bin/sh + +# Write bluetooth PIN number here: +pin= + +if [ -z "$pin" ]; then + msg="Set bluetooth PIN in file $0" + logger -p user.err "$msg" + for i in /dev/pts/* ; do + [ -w $i ] && echo "$msg" > $i + done +else + echo "PIN:$pin" +fi diff --git a/utils/bluez-utils/patches/001-include_limits.patch b/utils/bluez-utils/patches/001-include_limits.patch new file mode 100644 index 0000000..2617306 --- /dev/null +++ b/utils/bluez-utils/patches/001-include_limits.patch @@ -0,0 +1,20 @@ +--- a/hidd/sdp.c ++++ b/hidd/sdp.c +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #include + #include +--- a/tools/hciconfig.c ++++ b/tools/hciconfig.c +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + + #include + #include diff --git a/utils/bluez-utils/patches/002-hcid_pin_helper.patch b/utils/bluez-utils/patches/002-hcid_pin_helper.patch new file mode 100644 index 0000000..c236e4d --- /dev/null +++ b/utils/bluez-utils/patches/002-hcid_pin_helper.patch @@ -0,0 +1,20 @@ +--- a/hcid/hcid.conf ++++ b/hcid/hcid.conf +@@ -12,7 +12,7 @@ + # auto - Use local PIN for incoming connections + # user - Always ask user for a PIN + # +- security user; ++ security auto; + + # Pairing mode + # none - Pairing disabled +@@ -29,7 +29,7 @@ + # Local device name + # %d - device id + # %h - host name +- name "BlueZ (%d)"; ++ name "%h"; + + # Local device class + class 0x000100; diff --git a/utils/bluez-utils/patches/100-enokey.patch b/utils/bluez-utils/patches/100-enokey.patch new file mode 100644 index 0000000..6273e17 --- /dev/null +++ b/utils/bluez-utils/patches/100-enokey.patch @@ -0,0 +1,22 @@ +--- a/input/device.c ++++ b/input/device.c +@@ -25,6 +25,8 @@ + #include + #endif + ++#define ENOKEY 161 /* Required key not available */ ++ + #include + #include + #include +--- a/input/storage.c ++++ b/input/storage.c +@@ -25,6 +25,8 @@ + #include + #endif + ++#define ENOKEY 161 /* Required key not available */ ++ + #include + #include + #include diff --git a/utils/bluez-utils/patches/200-uart-speed.patch b/utils/bluez-utils/patches/200-uart-speed.patch new file mode 100644 index 0000000..cb7d0e8 --- /dev/null +++ b/utils/bluez-utils/patches/200-uart-speed.patch @@ -0,0 +1,40 @@ +--- a/tools/hciattach.c ++++ b/tools/hciattach.c +@@ -111,20 +111,37 @@ + return B230400; + case 460800: + return B460800; ++/* FIX: Not all platform support this high serial speed ++ claudyus84 @gamil.com ++*/ ++#ifdef B500000 + case 500000: + return B500000; ++#endif ++#ifdef B576000 + case 576000: + return B576000; ++#endif ++#ifdef B921600 + case 921600: + return B921600; ++#endif ++#ifdef B1000000 + case 1000000: + return B1000000; ++#endif ++#ifdef B1152000 + case 1152000: + return B1152000; ++#endif ++#ifdef B1500000 + case 1500000: + return B1500000; ++#endif ++#ifdef B2000000 + case 2000000: + return B2000000; ++#endif + #ifdef B2500000 + case 2500000: + return B2500000; diff --git a/utils/boblight/Makefile b/utils/boblight/Makefile new file mode 100644 index 0000000..0b53370 --- /dev/null +++ b/utils/boblight/Makefile @@ -0,0 +1,124 @@ +# +# Copyright (C) 2011-2012 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:=boblight +PKG_REV:=412 +PKG_VERSION:=$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://boblight.googlecode.com/svn/trunk +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_PROTO:=svn +PKG_SOURCE_VERSION:=$(PKG_REV) + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/boblight/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Tools for driving lights connected to an external controller + URL:=http://code.google.com/p/boblight/ + DEPENDS:=+librt $(CXX_DEPENDS) +endef + +define Package/boblight/Default/description + Its main purpose is to create light effects from an external input, such as a + video stream (desktop capture, video player, tv card), an audio stream (jack, + alsa), or user input (lirc, http). Currently it only handles video input by + desktop capture with xlib, video capture from v4l/v4l2 devices and user input + from the commandline with boblight-constant. + + Boblight uses a client/server model, where clients are responsible for + translating an external input to light data, and boblightd is responsible for + translating the light data into commands for external light controllers. +endef + +define Package/boblight-client + $(call Package/boblight/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= (constant color client) + DEPENDS+= +libboblight +endef + +define Package/boblight-client/description + $(call Package/boblight/Default/description) + + This package contains the boblight constant color client. +endef + +define Package/boblight-daemon + $(call Package/boblight/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= (daemon) + DEPENDS+= +libboblight +endef + +define Package/boblight-daemon/conffiles +/etc/boblight.conf +endef + +define Package/boblight-daemon/description + $(call Package/boblight/Default/description) + + This package contains the boblight daemon. +endef + +define Package/libboblight + $(call Package/boblight/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= (library) +endef + +define Package/libboblight/description + $(call Package/boblight/Default/description) + + This package contains the libboblight shared library. +endef + +CONFIGURE_ARGS += \ + --without-portaudio \ + --without-x11 + + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/libboblight + $(CP) $(PKG_INSTALL_DIR)/usr/include/libboblight $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libboblight.{a,so*} $(1)/usr/lib/ +endef + +define Package/boblight-client/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/boblight-constant $(1)/usr/bin/ +endef + +define Package/boblight-daemon/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/boblight.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/boblight.init $(1)/etc/init.d/boblight + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/boblightd $(1)/usr/bin/ +endef + +define Package/libboblight/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libboblight.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,boblight-client)) +$(eval $(call BuildPackage,boblight-daemon)) +$(eval $(call BuildPackage,libboblight)) diff --git a/utils/boblight/files/boblight.init b/utils/boblight/files/boblight.init new file mode 100644 index 0000000..73705e7 --- /dev/null +++ b/utils/boblight/files/boblight.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common + +START=65 + +SERVICE_DAEMONIZE=1 + +start() { + service_start /usr/bin/boblightd +} + +stop() { + service_stop /usr/bin/boblightd +} diff --git a/utils/bonnie++/Makefile b/utils/bonnie++/Makefile new file mode 100644 index 0000000..bb77113 --- /dev/null +++ b/utils/bonnie++/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2009 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:=bonnie++ +PKG_VERSION:=1.96 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://www.coker.com.au/bonnie++/experimental/ +PKG_MD5SUM:=7b8594559f00887d2865de1838328b35 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/bonniexx + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libstdcpp +libpthread + TITLE:=Bonnie++ - hard drive bottleneck testing program. + URL:=http://www.coker.com.au/bonnie++/ +endef + +define Package/bonniexx/description + Bonnie++ is a benchmark suite that is aimed at performing a number of simple + tests of hard drive and file system performance. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + TARGET_CXX="$(TARGET_CXX)" \ + TARGET_LINK="$(TARGET_CXX)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all +endef + +define Package/bonniexx/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/bonnie++ $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/bon_csv2html $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,bonniexx)) diff --git a/utils/bonnie++/patches/001-cross_compile_fix.patch b/utils/bonnie++/patches/001-cross_compile_fix.patch new file mode 100644 index 0000000..98a933a --- /dev/null +++ b/utils/bonnie++/patches/001-cross_compile_fix.patch @@ -0,0 +1,32 @@ +--- a/configure ++++ b/configure +@@ -4372,7 +4372,7 @@ if test "$cross_compiling" = yes; then + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ { (exit 0); exit 0; }; } + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +--- a/Makefile ++++ b/Makefile +@@ -1,5 +1,7 @@ + EXES=bonnie++ zcav getc_putc getc_putc_helper + EXE=bon_csv2html generate_randfile ++TARGET_CXX=g++ ++TARGET_LINK=g++ + + all: $(EXE) $(EXES) + +@@ -10,8 +12,8 @@ eprefix=${prefix} + #MORE_WARNINGS=-Weffc++ + WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -Wcast-align -Wsign-compare -Wpointer-arith -Wwrite-strings -Wformat-security -Wswitch-enum -Winit-self $(MORE_WARNINGS) + CFLAGS=-O2 -DNDEBUG $(WFLAGS) $(MORECFLAGS) +-CXX=g++ $(CFLAGS) +-LINK=g++ ++CXX=$(TARGET_CXX) $(CFLAGS) ++LINK=$(TARGET_LINK) + THREAD_LFLAGS=-lpthread + + INSTALL=/usr/bin/install -c diff --git a/utils/bonnie++/patches/002-add-verbose-error-messages.patch b/utils/bonnie++/patches/002-add-verbose-error-messages.patch new file mode 100644 index 0000000..ccec8e8 --- /dev/null +++ b/utils/bonnie++/patches/002-add-verbose-error-messages.patch @@ -0,0 +1,47 @@ +--- a/bon_file.cpp ++++ b/bon_file.cpp +@@ -464,25 +464,37 @@ int COpenTest::delete_sequential(BonTime + } + if(m_number_directories != 1) + { +- if(chdir("..") || rmdir(buf)) ++ if(chdir("..")) + { ++ io_error("chdir"); ++ return -1; ++ } ++ if(rmdir(buf)) ++ { ++ fprintf(stderr, "Unable to delete directory '%s'\n", buf); + io_error("rmdir"); + return -1; + } + } + } +- if(chdir("..") || rmdir(m_dirname)) ++ if(count != m_number) + { +- io_error("rmdir"); ++ fprintf(stderr, "Expected %d files but only got %d\n", m_number, count); + return -1; + } +- delete m_dirname; +- m_dirname = NULL; +- if(count != m_number) ++ if(chdir("..")) + { +- fprintf(stderr, "Expected %d files but only got %d\n", m_number, count); ++ io_error("chdir"); ++ return -1; ++ } ++ if(rmdir(m_dirname)) ++ { ++ fprintf(stderr, "Unable to delete directory '%s'\n", m_dirname); ++ io_error("rmdir"); + return -1; + } ++ delete m_dirname; ++ m_dirname = NULL; + sync(); + timer.stop_and_record(DelSeq); + timer.add_latency(DelSeq, dur.getMax()); diff --git a/utils/boxbackup/Makefile b/utils/boxbackup/Makefile new file mode 100644 index 0000000..15c2cdb --- /dev/null +++ b/utils/boxbackup/Makefile @@ -0,0 +1,140 @@ +# +# Copyright (C) 2006-2011 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:=boxbackup +PKG_VERSION:=0.11.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://www.boxbackup.org/trac/export/2998/box/packages +PKG_MD5SUM:=c4c4786a918a9c026f80833614c40a6b + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/boxbackup/Default + SUBMENU:=backup + SECTION:=utils + CATEGORY:=Utilities + URL:=http://www.boxbackup.org/ + MAINTAINER:=Daniel Dickinson +endef + +define Package/boxbackup + $(call Package/boxbackup/Default) + TITLE:=Secure network backup + MENU:=1 +endef + +define Package/bbstored + $(call Package/boxbackup/Default) + TITLE:=Server for secure network backup + DEPENDS:=boxbackup +libopenssl +zlib +libdb47 +libopenssl +libstdcpp +libreadline +libncurses +endef + +define Package/bbstored/description + Boxbackup is an open source, completely automatic, on-line backup system. + This package is for the server (where the backups are stored). The + server is known as bbstored. +endef + +define Package/bbstored/conffiles +/etc/config/bbbstored +endef + + +define Package/bbstored-config-external + $(call Package/boxbackup/Default) + TITLE:=Configure network backup server + DEPENDS:=boxbackup +openssl-util +microperl +endef + +define Package/boxbackup-certs + $(call Package/boxbackup/Default) + TITLE:=Manage network backup security certificates + DEPENDS:=boxbackup +openssl-util +microperl +endef + +define Package/bbackupd + $(call Package/boxbackup/Default) + TITLE:=Client for secure network backup + DEPENDS:=boxbackup +libopenssl +zlib +libdb47 +libopenssl +libreadline +libstdcpp +libncurses +openssl-util +microperl +endef + +define Package/bbackupd/description + Box Backup is an open source, completely automatic, on-line backup system. + This package is for the client (host to be backed up). +endef + + +TARGET_CFLAGS += $(FPIC) -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib + +CONFIGURE_ARGS += \ + --sysconfdir=/var/etc \ + --enable-gnu-readline \ + --with-bdb-headers=$(STAGING_DIR)/usr/include \ + --with-bdb-lib=$(STAGING_DIR)/usr/lib \ + --with-ssl-header=$(STAGING_DIR)/usr/include \ + --with-ssl-lib=$(STAGING_DIR)/usr/lib \ + --with-random=/dev/urandom \ + --disable-static-bin + +define Build/Install + mkdir -p $(PKG_INSTALL_DIR) + tar -C $(PKG_INSTALL_DIR) -xzf $(PKG_BUILD_DIR)/parcels/$(PKG_NAME)-$(PKG_VERSION)-backup-server-linux-gnu.tgz + tar -C $(PKG_INSTALL_DIR) -xzf $(PKG_BUILD_DIR)/parcels/$(PKG_NAME)-$(PKG_VERSION)-backup-client-linux-gnu.tgz +endef + +BXBK_SRV_INSTALL_DIR = $(PKG_INSTALL_DIR)/$(PKG_NAME)-$(PKG_VERSION)-backup-server-linux-gnu +BXBK_CLIENT_INSTALL_DIR = $(PKG_INSTALL_DIR)/$(PKG_NAME)-$(PKG_VERSION)-backup-client-linux-gnu + +define Package/boxbackup/install + true +endef + +define Package/bbstored/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(BXBK_SRV_INSTALL_DIR)/bbstored $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/boxbackup + $(INSTALL_BIN) $(BXBK_SRV_INSTALL_DIR)/bbstoreaccounts $(1)/usr/lib/boxbackup/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/bbstored.init $(1)/etc/init.d/bbstored + $(INSTALL_DIR) $(1)/lib/functions + $(INSTALL_DATA) ./files/bbstored.sh $(1)/lib/functions/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/bbstored.config $(1)/etc/config/bbstored + $(INSTALL_BIN) ./files/bbstoreaccounts $(1)/usr/sbin/ +endef + +define Package/bbstored-config-external/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(BXBK_SRV_INSTALL_DIR)/bbstored-config $(1)/usr/sbin/ + $(INSTALL_BIN) $(BXBK_SRV_INSTALL_DIR)/raidfile-config $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/bbstored +endef + +define Package/boxbackup-certs/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(BXBK_SRV_INSTALL_DIR)/bbstored-certs $(1)/usr/sbin/ +endef + +define Package/bbackupd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(BXBK_CLIENT_INSTALL_DIR)/bbackupd $(1)/usr/sbin/ + $(INSTALL_BIN) $(BXBK_CLIENT_INSTALL_DIR)/bbackupquery $(1)/usr/sbin/ + $(INSTALL_BIN) $(BXBK_CLIENT_INSTALL_DIR)/bbackupctl $(1)/usr/sbin/ + $(INSTALL_BIN) $(BXBK_CLIENT_INSTALL_DIR)/bbackupd-config $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,boxbackup)) +$(eval $(call BuildPackage,bbstored)) +$(eval $(call BuildPackage,boxbackup-certs)) +$(eval $(call BuildPackage,bbstored-config-external)) +$(eval $(call BuildPackage,bbackupd)) diff --git a/utils/boxbackup/files/bbstoreaccounts b/utils/boxbackup/files/bbstoreaccounts new file mode 100755 index 0000000..ec38fc0 --- /dev/null +++ b/utils/boxbackup/files/bbstoreaccounts @@ -0,0 +1,34 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/bbstored.sh + +bxbk_config_file= +NORUN= + +if [ "$1" = "-c" ]; then + shift + bxbk_config_file="$1" + shift +else + if [ -z "$1" ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]; then + /usr/lib/boxbackup/bbstoreaccounts -h + exit 1 + fi + if [ -z "$2" ] || [ -z "$3" ] || [ -z "$4" ] || [ -z "$5" ]; then + /usr/lib/boxbackup/bbstoreaccounts -h + exit 1 + fi + config_load bbstored + create_config + if [ "$EXTERNAL_CONFIG" = "1" ]; then + bxbk_config_file="$EXTERNAL_CONF_FILE" + else + bxbk_config_file="$BXBK_CONFIG_PATH/bbstored.conf" + fi +fi + +[ "$NORUN" != "1" ] && [ -n "$bxbk_config_file" ] && /usr/lib/boxbackup/bbstoreaccounts -c "$bxbk_config_file" "$@" || { + echo "Error managing account using '$bxbk_config_file'" + exit 1 +} diff --git a/utils/boxbackup/files/bbstored.config b/utils/boxbackup/files/bbstored.config new file mode 100644 index 0000000..d53a4b9 --- /dev/null +++ b/utils/boxbackup/files/bbstored.config @@ -0,0 +1,26 @@ + +# Example config using defaults used of no option supplied +# or for values that have no default....the <> would +# need to be removed. + +# config bbstored +# option config_path '/var/etc/boxbackup' +# option raidfileconf '/var/etc/boxbackup/raidfile.conf' +# option accountdb 'etc/bbstored/accounts.txt' +# option extlog 1 +# option housekeep_time 900 +# option user nobody +# option group nogroup +# option address <192.168.1.1> +# OR option address +# option certfile +# option keyfile +# option cafile +# option pidfile /var/run/bbstored.pid + +#config raidfile +# option setnum <0> +# option blocksize 1024 +# option path + +# There can be many raidfile section, but each must have a unique setnum diff --git a/utils/boxbackup/files/bbstored.init b/utils/boxbackup/files/bbstored.init new file mode 100644 index 0000000..91e677e --- /dev/null +++ b/utils/boxbackup/files/bbstored.init @@ -0,0 +1,22 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 Openwrt.org + +START=90 + +start() { + . /lib/functions/bbstored.sh + + create_config + + if [ "$EXTERNAL_CONFIG" -eq 1 ] + then + BXBK_CONFIG_FILE="$EXTERNAL_CONF_FILE" + fi + service_start /usr/sbin/bbstored "$BXBK_CONFIG_FILE" +} + +stop() { + . /lib/functions/bbstored.sh + + service_stop /usr/sbin/bbstored +} diff --git a/utils/boxbackup/files/bbstored.sh b/utils/boxbackup/files/bbstored.sh new file mode 100644 index 0000000..91bc1ad --- /dev/null +++ b/utils/boxbackup/files/bbstored.sh @@ -0,0 +1,164 @@ +#!/bin/sh +# Copyright (C) 2011 Openwrt.org +# Copyright (C) 2011 Daniel Dickinson + +BXBK_CONFIG_PATH=/var/etc/boxbackup +PID_FILE=/var/run/bbstored.pid + +EXTERNAL_CONFIG=0 + +EXTERNAL_CONF_FILE= +RUNAS_USER= +RUNAS_GROUP= +BXBK_RAIDFILE_CONF= + +bbstored_global() { + local cfg="$1" + local get_config="$2" + + local external_config + local raidfileconf + local user + local group + local config_path + local pidfile + local accountdb + local extended_logging + local housekeep_time + local address + local certfile + local keyfile + local cafile + + config_get external_config "$cfg" external_config + if [ -n "$external_config" ]; then + EXTERNAL_CONFIG=1 + EXTERNAL_CONF_FILE="$external_config" + fi + + config_get config_path "$cfg" config_path + [ -n "$config_path" ] && { + BXBK_CONFIG_PATH="$config_path" + } + + [ "$get_config" = "1" ] && return 0 + [ -z "$BXBK_CONFIG_FILE" ] && return 1 + + rm -f "$BXBK_CONFIG_FILE" + touch "$BXBK_CONFIG_FILE" + + config_get raidfileconf "$cfg" raidfileconf "$BXBK_CONFIG_PATH/raidfile.conf" + echo "RaidFileConf = $raidfileconf" >>$BXBK_CONFIG_FILE + BXBK_RAIDFILE_CONF="$raidfileconf" + + config_get accountdb "$cfg" accountdb "/etc/bbstored/accounts.txt" + echo "AccountDatabase = $accountdb" >>$BXBK_CONFIG_FILE + [ ! -r "$accountdb" ] && { + echo "Account database missing" + NORUN=1 + return 1 + } + + local extlog + config_get extended_logging "$cfg" extended_logging 1 + if [ "$extended_logging" = "1" ]; then + extlog=yes + else + extlog=no + fi + echo "ExtendedLogging = $extlog" >>$BXBK_CONFIG_FILE + + config_get housekeep_time "$cfg" housekeep_time 900 + echo "TimeBetweenHousekeeping = $housekeep_time" >>$BXBK_CONFIG_FILE + + echo "" >>$BXBK_CONFIG_FILE + echo "Server" >>$BXBK_CONFIG_FILE + echo "{" >>$BXBK_CONFIG_FILE + + config_get user "$cfg" user + config_get group "$cfg" group + [ -n "$user" ] && [ "$group" ] && { + RUNAS_USER=$user + RUNAS_GROUP=$group + } + echo " User = ${RUNAS_USER:-nobody}" >>$BXBK_CONFIG_FILE + + config_get address "$cfg" address + [ -z "$address" ] && NORUN=1 + + echo " ListenAddresses = inet:$address" >>$BXBK_CONFIG_FILE + + config_get certfile "$cfg" certfile + [ -z "$certfile" ] && NORUN=1 + + echo " CertificateFile = $certfile" >>$BXBK_CONFIG_FILE + + config_get keyfile "$cfg" keyfile + [ -z "$keyfile" ] && NORUN=1 + + echo " PrivateKeyFile = $keyfile" >>$BXBK_CONFIG_FILE + + config_get cafile "$cfg" cafile + [ -z "$cafile" ] && NORUN=1 + + echo " TrustedCAsFile = $cafile" >>$BXBK_CONFIG_FILE + + config_get pidfile "$cfg" pidfile + [ -n "$pidfile" ] && { + PID_FILE="$pidfile" + } + echo " PidFile = $PID_FILE" >>$BXBK_CONFIG_FILE + + echo "}" >>$BXBK_CONFIG_FILE +} + +raidfile_section() { + local cfg="$1" + + local setnum + local blocksize + local path + + config_get setnum "$cfg" setnum + [ -z "$setnum" ] && return 1 + + config_get blocksize "$cfg" blocksize + + config_get path "$cfg" path + [ -z "$path" ] && return 1 + + echo "disc${setnum}" >>$BXBK_RAIDFILE_CONF + echo "{" >>$BXBK_RAIDFILE_CONF + echo " SetNumber = ${setnum}" >>$BXBK_RAIDFILE_CONF + [ -n "$blocksize" ] && echo " BlockSize = ${blocksize}" >>$BXBK_RAIDFILE_CONF + for i in 0 1 2; do + echo " Dir${i} = $path" >>$BXBK_RAIDFILE_CONF + done + + echo "}" >>$BXBK_RAIDFILE_CONF + +} + +create_config() { + config_load bbstored + config_foreach bbstored_global bbstored 1 + + if [ "$EXTERNAL_CONFIG" -eq 0 ] + then + mkdir -p "$BXBK_CONFIG_PATH/bbstored" + BXBK_CONFIG_FILE="$BXBK_CONFIG_PATH/bbstored.conf" + touch "$BXBK_CONFIG_FILE" + + config_load bbstored + config_foreach bbstored_global bbstored + + [ -z "$BXBK_RAIDFILE_CONF" ] && return 1 + rm -f "$BXBK_RAIDFILE_CONF" + touch "$BXBK_RAIDFILE_CONF" + + config_foreach raidfile_section raidfile + + chown -R ${RUNAS_USER:-nobody}:${RUNAS_GROUP:-nogroup} "$BXBK_CONFIG_PATH" + fi +} + diff --git a/utils/bsdiff/Makefile b/utils/bsdiff/Makefile new file mode 100644 index 0000000..2dab0ac --- /dev/null +++ b/utils/bsdiff/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2011 Alexander Gordeev +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bsdiff +PKG_VERSION:=4.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.daemonology.net/bsdiff +PKG_MD5SUM:=e6d812394f0e0ecc8d5df255aa1db22a + +include $(INCLUDE_DIR)/package.mk + +define Package/bsdiff + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libbz2 + URL:=http://www.daemonology.net/bsdiff + TITLE:=Tools for building and applying patches to binary files +endef + +define Package/bsdiff/description + bsdiff and bspatch are tools for building and applying patches to binary + files. By using suffix sorting (specifically, Larsson and Sadakane's + qsufsort) and taking advantage of how executable files change, bsdiff + routinely produces binary patches 50-80% smaller than those produced by + Xdelta, and 15% smaller than those produced by .RTPatch (a $2750/seat + commercial patch tool). +endef + +define Package/bsdiff/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bsdiff $(PKG_BUILD_DIR)/bspatch $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,bsdiff)) diff --git a/utils/bsdiff/patches/001-makefile.patch b/utils/bsdiff/patches/001-makefile.patch new file mode 100644 index 0000000..45f3d6a --- /dev/null +++ b/utils/bsdiff/patches/001-makefile.patch @@ -0,0 +1,11 @@ +diff --git a/Makefile b/Makefile +index a522607..7da4463 100644 +--- a/Makefile ++++ b/Makefile +@@ -10,6 +10,3 @@ bspatch: bspatch.c + + install: + ${INSTALL_PROGRAM} bsdiff bspatch ${PREFIX}/bin +-.ifndef WITHOUT_MAN +- ${INSTALL_MAN} bsdiff.1 bspatch.1 ${PREFIX}/man/man1 +-.endif diff --git a/utils/btrfs-progs/Makefile b/utils/btrfs-progs/Makefile new file mode 100644 index 0000000..4ee46c1 --- /dev/null +++ b/utils/btrfs-progs/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=btrfs-progs +PKG_VERSION:=0.19 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.kernel.org/pub/linux/kernel/people/mason/btrfs/ +PKG_MD5SUM:=69e29ecd922e3f9dcb74a3a8f80b4f68 + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/btrfs-progs + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Filesystem + DEPENDS:=+libuuid +zlib + TITLE:=Btrfs filesystems utilities + URL:=http://btrfs.wiki.kernel.org/ +endef + +define Package/btrfs-progs/description + Btrfs is a new copy on write filesystem for Linux aimed at implementing + advanced features while focusing on fault tolerance, repair and easy + administration. Initially developed by Oracle, Btrfs is licensed under the + GPL and open for contribution from anyone. +endef + +progs = btrfsctl mkfs.btrfs btrfs-debug-tree btrfs-show btrfs-vol btrfsck + +MAKE_FLAGS+=\ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + prefix=/usr \ + DESTDIR=$(PKG_INSTALL_DIR) + +define Package/btrfs-progs/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(addprefix $(PKG_INSTALL_DIR)/usr/bin/, $(progs)) $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/btrfs-scan.init $(1)/etc/init.d/btrfs-scan +endef + +$(eval $(call BuildPackage,btrfs-progs)) diff --git a/utils/btrfs-progs/files/btrfs-scan.init b/utils/btrfs-progs/files/btrfs-scan.init new file mode 100644 index 0000000..f1264ee --- /dev/null +++ b/utils/btrfs-progs/files/btrfs-scan.init @@ -0,0 +1,9 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009 OpenWrt.org + +START=19 + +start() { + grep -q btrfs /proc/modules && /usr/bin/btrfsctl -a +} + diff --git a/utils/btrfs-progs/patches/001-Makefile-gcc-fix b/utils/btrfs-progs/patches/001-Makefile-gcc-fix new file mode 100644 index 0000000..37da622 --- /dev/null +++ b/utils/btrfs-progs/patches/001-Makefile-gcc-fix @@ -0,0 +1,53 @@ +diff --git a/Makefile b/Makefile +index 8097b5a..63a734b 100644 +--- a/Makefile ++++ b/Makefile +@@ -36,37 +36,37 @@ version: + bash version.sh + + btrfsctl: $(objects) btrfsctl.o +- gcc $(CFLAGS) -o btrfsctl btrfsctl.o $(objects) $(LDFLAGS) $(LIBS) ++ $(CC) $(CFLAGS) -o btrfsctl btrfsctl.o $(objects) $(LDFLAGS) $(LIBS) + + btrfs-vol: $(objects) btrfs-vol.o +- gcc $(CFLAGS) -o btrfs-vol btrfs-vol.o $(objects) $(LDFLAGS) $(LIBS) ++ $(CC) $(CFLAGS) -o btrfs-vol btrfs-vol.o $(objects) $(LDFLAGS) $(LIBS) + + btrfs-show: $(objects) btrfs-show.o +- gcc $(CFLAGS) -o btrfs-show btrfs-show.o $(objects) $(LDFLAGS) $(LIBS) ++ $(CC) $(CFLAGS) -o btrfs-show btrfs-show.o $(objects) $(LDFLAGS) $(LIBS) + + btrfsck: $(objects) btrfsck.o +- gcc $(CFLAGS) -o btrfsck btrfsck.o $(objects) $(LDFLAGS) $(LIBS) ++ $(CC) $(CFLAGS) -o btrfsck btrfsck.o $(objects) $(LDFLAGS) $(LIBS) + + mkfs.btrfs: $(objects) mkfs.o +- gcc $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o $(LDFLAGS) $(LIBS) ++ $(CC) $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o $(LDFLAGS) $(LIBS) + + btrfs-debug-tree: $(objects) debug-tree.o +- gcc $(CFLAGS) -o btrfs-debug-tree $(objects) debug-tree.o $(LDFLAGS) $(LIBS) ++ $(CC) $(CFLAGS) -o btrfs-debug-tree $(objects) debug-tree.o $(LDFLAGS) $(LIBS) + + btrfstune: $(objects) btrfstune.o +- gcc $(CFLAGS) -o btrfstune $(objects) btrfstune.o $(LDFLAGS) $(LIBS) ++ $(CC) $(CFLAGS) -o btrfstune $(objects) btrfstune.o $(LDFLAGS) $(LIBS) + + btrfs-image: $(objects) btrfs-image.o +- gcc $(CFLAGS) -o btrfs-image $(objects) btrfs-image.o -lpthread -lz $(LDFLAGS) $(LIBS) ++ $(CC) $(CFLAGS) -o btrfs-image $(objects) btrfs-image.o -lpthread -lz $(LDFLAGS) $(LIBS) + + dir-test: $(objects) dir-test.o +- gcc $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS) $(LIBS) ++ $(CC) $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS) $(LIBS) + + quick-test: $(objects) quick-test.o +- gcc $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS) ++ $(CC) $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS) + + convert: $(objects) convert.o +- gcc $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs $(LDFLAGS) $(LIBS) ++ $(CC) $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs $(LDFLAGS) $(LIBS) + + manpages: + cd man; make diff --git a/utils/byobu/Makefile b/utils/byobu/Makefile new file mode 100644 index 0000000..5d046db --- /dev/null +++ b/utils/byobu/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2009 Sharim At Work, Ltd. +# Author: Xiangfu Liu +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=byobu +PKG_VERSION:=3.6 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://launchpad.net/byobu/trunk/3.6/+download/ +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/byobu + MAINTAINER:="Xiangfu Liu" + SECTION:=utils + CATEGORY:=Utilities + TITLE:=a Japanese term for decorative, multi-panel screens that serve as folding room dividers + URL:=https://launchpad.net/byobu +endef + +define Package/byobu/description + Byobu is a Japanese term for decorative, multi-panel screens that serve + as folding room dividers. As an open source project, Byobu is an elegant + enhancement of the otherwise functional, plain, practical GNU Screen. + Byobu includes an enhanced profile and configuration utilities for the + GNU screen window manager, such as toggle-able system status notifications. +endef + +define Package/byobu/install + $(INSTALL_DIR) \ + $(1)/usr/bin \ + $(1)/usr/lib/byobu \ + $(1)/usr/share + + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/* \ + $(1)/usr/bin/ + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/byobu \ + $(1)/usr/lib/ + + $(CP) \ + $(PKG_INSTALL_DIR)/usr/share/byobu \ + $(1)/usr/share/ +endef + +$(eval $(call BuildPackage,byobu)) diff --git a/utils/bzip2/Makefile b/utils/bzip2/Makefile new file mode 100644 index 0000000..1cdfaa4 --- /dev/null +++ b/utils/bzip2/Makefile @@ -0,0 +1,76 @@ +# +# Copyright (C) 2007-2008 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:=bzip2 +PKG_VERSION:=1.0.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.bzip.org/$(PKG_VERSION) +PKG_MD5SUM:=00b516f4704d4a7cb50a1d97e6e8e15b + +include $(INCLUDE_DIR)/package.mk + +define Package/libbz2 + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:= + TITLE:=bzip2 library. + URL:=http://www.bzip.org/ +endef + +define Package/libbz2/description + bzip2 is a freely available, patent free, high-quality + data compressor. This packages provides libbz2 library. +endef + +define Package/bzip2 + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libbz2 + TITLE:=bzip2 is a compression utility. + URL:=http://www.bzip.org/ +endef + +define Package/bzip2/description + bzip2 is a freely available, patent free, high-quality + data compressor. This package provides the binary. +endef + +TARGET_CFLAGS += $(FPIC) +CONFIGURE_ARGS += --prefix=/usr + +MAKE_FLAGS += \ + -f Makefile-libbz2_so \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDLAGS)" \ + all + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/bzlib.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libbz2.so.$(PKG_VERSION) $(1)/usr/lib/ + $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so.1.0 + $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so +endef + +define Package/libbz2/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_BUILD_DIR)/libbz2.so.$(PKG_VERSION) $(1)/usr/lib/ + $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so.1.0 +endef + +define Package/bzip2/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bzip2-shared $(1)/usr/bin/bzip2 +endef + +$(eval $(call BuildPackage,libbz2)) +$(eval $(call BuildPackage,bzip2)) diff --git a/utils/calcurse/Makefile b/utils/calcurse/Makefile new file mode 100644 index 0000000..4295ade --- /dev/null +++ b/utils/calcurse/Makefile @@ -0,0 +1,39 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=calcurse +PKG_VERSION:=2.8 +PKG_RELEASE:=1 + +PKG_SOURCE:=get.cgi?calcurse-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://culot.org/cgi-bin +PKG_MD5SUM:=124d40c0912b12021996220f02b759cc +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/calcurse-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/calcurse + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Calcurse + DEPENDS:=+libncursesw +libreadline +libpthread + URL:=http://culot.org/calcurse +endef + +define Package/calcurse/description + Fullscreen curses based calendar. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --prefix=/usr \ + ) +endef + +define Package/calcurse/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/calcurse $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,calcurse)) diff --git a/utils/calvaria/Makefile b/utils/calvaria/Makefile new file mode 100644 index 0000000..f8574fa --- /dev/null +++ b/utils/calvaria/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2011 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:=calvaria +PKG_RELEASE:=1 + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/calvaria + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Maemo CAL partition access tool + MAINTAINER:=Michael Buesch +endef + +define Package/calvaria/description + Calvaria - Maemo CAL partition variable access tool + The CAL partition (/dev/mtdblock1) is used to store configuration + and calibration data. +endef + +define Build/Prepare + $(CP) ./files/src/* $(PKG_BUILD_DIR)/ +endef + +define Package/calvaria/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/calvaria $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cal2p54 $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,calvaria)) diff --git a/utils/calvaria/files/src/Makefile b/utils/calvaria/files/src/Makefile new file mode 100644 index 0000000..6d42bf1 --- /dev/null +++ b/utils/calvaria/files/src/Makefile @@ -0,0 +1,32 @@ +DESTDIR ?= +PREFIX ?= /usr +CFLAGS ?= -O2 -Wall +LDFLAGS ?= +LDLIBS ?= + +STRIP ?= strip +INSTALL ?= install + +CALVARIA_BIN := calvaria +CAL2P54_BIN := cal2p54 + +all: $(CALVARIA_BIN) $(CAL2P54_BIN) + +$(CALVARIA_BIN): calvaria.o + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@ + $(STRIP) $@ + +$(CAL2P54_BIN): cal2p54.o + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@ + $(STRIP) $@ + +%.o: %.c + $(CC) -c $(CFLAGS) $^ -o $@ + +install: $(CALVARIA_BIN) $(CAL2P54_BIN) + $(INSTALL) -d $(DESTDIR)/$(PREFIX)/bin + $(INSTALL) -m 0755 $(CALVARIA_BIN) $(DESTDIR)/$(PREFIX)/bin/ + $(INSTALL) -m 0755 $(CAL2P54_BIN) $(DESTDIR)/$(PREFIX)/bin/ + +clean: + rm -f $(CALVARIA_BIN) $(CAL2P54_BIN) *.o diff --git a/utils/calvaria/files/src/cal2p54.c b/utils/calvaria/files/src/cal2p54.c new file mode 100644 index 0000000..cac4436 --- /dev/null +++ b/utils/calvaria/files/src/cal2p54.c @@ -0,0 +1,940 @@ +/* + * cal2p54 - CAL to p54spi EEPROM converter + * + * Copyright (c) 2011 Michael Buesch + * + * Licensed under the GNU General Public License version 2. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + + +/* Template data from Linux p54spi_eeprom.h: + * + * Copyright (C) 2003 Conexant Americas Inc. All Rights Reserved. + * Copyright (C) 2004, 2005, 2006 Nokia Corporation + * Copyright 2008 Johannes Berg + * Copyright 2008 Christian Lamparter + * + * based on: + * - cx3110x's pda.h from Nokia + * - cx3110-transfer.log by Johannes Berg + */ + +static const uint8_t template_eeprom_pda_wrap[] = { + /* struct eeprom_pda_wrap */ + 0x47, 0x4d, 0x55, 0xaa, /* magic */ + 0x00, 0x00, /* pad */ + 0x00, 0x00, /* eeprom_pda_data_wrap length */ + 0x00, 0x00, 0x00, 0x00, /* arm opcode */ +}; + +static const uint8_t template_mac_address[] = { + /* bogus MAC address */ + 0x04, 0x00, 0x01, 0x01, /* PDR_MAC_ADDRESS */ + 0x00, 0x02, 0xee, 0xc0, 0xff, 0xee, +}; + +static const uint8_t template_bootrec_exp_if[] = { + /* struct bootrec_exp_if */ + 0x06, 0x00, 0x01, 0x10, /* PDR_INTERFACE_LIST */ + 0x00, 0x00, /* role */ + 0x0f, 0x00, /* if_id */ + 0x85, 0x00, /* variant = Longbow RF, 2GHz */ + 0x01, 0x00, /* btm_compat */ + 0x1f, 0x00, /* top_compat */ + + 0x03, 0x00, 0x02, 0x10, /* PDR_HARDWARE_PLATFORM_COMPONENT_ID */ + 0x03, 0x20, 0x00, 0x43, +}; + +static const uint8_t template_pda_country_list[] = { + /* struct pda_country[6] */ + 0x0d, 0x00, 0x07, 0x10, /* PDR_COUNTRY_LIST */ + 0x10, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, + 0x31, 0x00, 0x00, 0x00, + 0x32, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, +}; + +static const uint8_t template_pda_country[] = { + /* struct pda_country */ + 0x03, 0x00, 0x08, 0x10, /* PDR_DEFAULT_COUNTRY */ + 0x30, 0x00, 0x00, 0x00, /* ETSI */ +}; + +static const uint8_t template_antenna_gain[] = { + 0x03, 0x00, 0x00, 0x11, /* PDR_ANTENNA_GAIN */ + 0x08, 0x08, 0x08, 0x08, +}; + +static const uint8_t template_rssi_linear_approx_custom2[] = { + 0x0a, 0x00, 0xff, 0xca, /* PDR_RSSI_LINEAR_APPROXIMATION_CUSTOMV2 */ + 0x01, 0x00, 0x0a, 0x00, + 0x00, 0x00, 0x0a, 0x00, + 0x85, 0x09, 0x0a, 0x01, 0x72, 0xfe, 0x1a, 0x00, 0x00, 0x00, +}; + +static const uint8_t template_pa_cal_curve[] = { + /* struct pda_custom_wrapper */ + 0x10, 0x06, 0x5d, 0xb0, /* PDR_PRISM_PA_CAL_CURVE_DATA_CUSTOM */ + 0x0d, 0x00, 0xee, 0x00, /* 13 entries, 238 bytes per entry */ + 0x00, 0x00, 0x16, 0x0c, /* no offset, 3094 total len */ + /* 2412 MHz */ + 0x6c, 0x09, + 0x10, 0x01, 0x9a, 0x84, + 0xaa, 0x8a, 0xaa, 0x8a, 0xaa, 0x8a, 0xaa, 0x8a, + 0x3c, 0xb6, 0x3c, 0xb6, 0x3c, 0xb6, 0x3c, 0xb6, + 0x3c, 0xb6, 0x3c, 0xb6, 0x3c, 0xb6, 0x3c, 0xb6, + 0xf0, 0x00, 0x94, 0x6c, + 0x99, 0x82, 0x99, 0x82, 0x99, 0x82, 0x99, 0x82, + 0x2b, 0xae, 0x2b, 0xae, 0x2b, 0xae, 0x2b, 0xae, + 0x2b, 0xae, 0x2b, 0xae, 0x2b, 0xae, 0x2b, 0xae, + 0xd0, 0x00, 0xaa, 0x5a, + 0x88, 0x7a, 0x88, 0x7a, 0x88, 0x7a, 0x88, 0x7a, + 0x1a, 0xa6, 0x1a, 0xa6, 0x1a, 0xa6, 0x1a, 0xa6, + 0x1a, 0xa6, 0x1a, 0xa6, 0x1a, 0xa6, 0x1a, 0xa6, + 0xa0, 0x00, 0xf3, 0x47, + 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, + 0x00, 0x9a, 0x00, 0x9a, 0x00, 0x9a, 0x00, 0x9a, + 0x00, 0x9a, 0x00, 0x9a, 0x00, 0x9a, 0x00, 0x9a, + 0x50, 0x00, 0x59, 0x36, + 0x43, 0x5a, 0x43, 0x5a, 0x43, 0x5a, 0x43, 0x5a, + 0xd5, 0x85, 0xd5, 0x85, 0xd5, 0x85, 0xd5, 0x85, + 0xd5, 0x85, 0xd5, 0x85, 0xd5, 0x85, 0xd5, 0x85, + 0x00, 0x00, 0xe4, 0x2d, + 0x18, 0x46, 0x18, 0x46, 0x18, 0x46, 0x18, 0x46, + 0xaa, 0x71, 0xaa, 0x71, 0xaa, 0x71, 0xaa, 0x71, + 0xaa, 0x71, 0xaa, 0x71, 0xaa, 0x71, 0xaa, 0x71, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, + + /* 2417 MHz */ + 0x71, 0x09, + 0x10, 0x01, 0xb9, 0x83, + 0x7d, 0x8a, 0x7d, 0x8a, 0x7d, 0x8a, 0x7d, 0x8a, + 0x0f, 0xb6, 0x0f, 0xb6, 0x0f, 0xb6, 0x0f, 0xb6, + 0x0f, 0xb6, 0x0f, 0xb6, 0x0f, 0xb6, 0x0f, 0xb6, + 0xf0, 0x00, 0x2e, 0x6c, + 0x68, 0x82, 0x68, 0x82, 0x68, 0x82, 0x68, 0x82, + 0xfa, 0xad, 0xfa, 0xad, 0xfa, 0xad, 0xfa, 0xad, + 0xfa, 0xad, 0xfa, 0xad, 0xfa, 0xad, 0xfa, 0xad, + 0xd0, 0x00, 0x8d, 0x5a, + 0x52, 0x7a, 0x52, 0x7a, 0x52, 0x7a, 0x52, 0x7a, + 0xe4, 0xa5, 0xe4, 0xa5, 0xe4, 0xa5, 0xe4, 0xa5, + 0xe4, 0xa5, 0xe4, 0xa5, 0xe4, 0xa5, 0xe4, 0xa5, + 0xa0, 0x00, 0x0a, 0x48, + 0x32, 0x6e, 0x32, 0x6e, 0x32, 0x6e, 0x32, 0x6e, + 0xc4, 0x99, 0xc4, 0x99, 0xc4, 0x99, 0xc4, 0x99, + 0xc4, 0x99, 0xc4, 0x99, 0xc4, 0x99, 0xc4, 0x99, + 0x50, 0x00, 0x7c, 0x36, + 0xfc, 0x59, 0xfc, 0x59, 0xfc, 0x59, 0xfc, 0x59, + 0x8e, 0x85, 0x8e, 0x85, 0x8e, 0x85, 0x8e, 0x85, + 0x8e, 0x85, 0x8e, 0x85, 0x8e, 0x85, 0x8e, 0x85, + 0x00, 0x00, 0xf5, 0x2d, + 0xc6, 0x45, 0xc6, 0x45, 0xc6, 0x45, 0xc6, 0x45, + 0x58, 0x71, 0x58, 0x71, 0x58, 0x71, 0x58, 0x71, + 0x58, 0x71, 0x58, 0x71, 0x58, 0x71, 0x58, 0x71, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, + + /* 2422 MHz */ + 0x76, 0x09, + 0x10, 0x01, 0xb9, 0x83, + 0x7d, 0x8a, 0x7d, 0x8a, 0x7d, 0x8a, 0x7d, 0x8a, + 0x0f, 0xb6, 0x0f, 0xb6, 0x0f, 0xb6, 0x0f, 0xb6, + 0x0f, 0xb6, 0x0f, 0xb6, 0x0f, 0xb6, 0x0f, 0xb6, + 0xf0, 0x00, 0x2e, 0x6c, + 0x68, 0x82, 0x68, 0x82, 0x68, 0x82, 0x68, 0x82, + 0xfa, 0xad, 0xfa, 0xad, 0xfa, 0xad, 0xfa, 0xad, + 0xfa, 0xad, 0xfa, 0xad, 0xfa, 0xad, 0xfa, 0xad, + 0xd0, 0x00, 0x8d, 0x5a, + 0x52, 0x7a, 0x52, 0x7a, 0x52, 0x7a, 0x52, 0x7a, + 0xe4, 0xa5, 0xe4, 0xa5, 0xe4, 0xa5, 0xe4, 0xa5, + 0xe4, 0xa5, 0xe4, 0xa5, 0xe4, 0xa5, 0xe4, 0xa5, + 0xa0, 0x00, 0x0a, 0x48, + 0x32, 0x6e, 0x32, 0x6e, 0x32, 0x6e, 0x32, 0x6e, + 0xc4, 0x99, 0xc4, 0x99, 0xc4, 0x99, 0xc4, 0x99, + 0xc4, 0x99, 0xc4, 0x99, 0xc4, 0x99, 0xc4, 0x99, + 0x50, 0x00, 0x7c, 0x36, + 0xfc, 0x59, 0xfc, 0x59, 0xfc, 0x59, 0xfc, 0x59, + 0x8e, 0x85, 0x8e, 0x85, 0x8e, 0x85, 0x8e, 0x85, + 0x8e, 0x85, 0x8e, 0x85, 0x8e, 0x85, 0x8e, 0x85, + 0x00, 0x00, 0xf5, 0x2d, + 0xc6, 0x45, 0xc6, 0x45, 0xc6, 0x45, 0xc6, 0x45, + 0x58, 0x71, 0x58, 0x71, 0x58, 0x71, 0x58, 0x71, + 0x58, 0x71, 0x58, 0x71, 0x58, 0x71, 0x58, 0x71, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, + + /* 2427 MHz */ + 0x7b, 0x09, + 0x10, 0x01, 0x48, 0x83, + 0x67, 0x8a, 0x67, 0x8a, 0x67, 0x8a, 0x67, 0x8a, + 0xf9, 0xb5, 0xf9, 0xb5, 0xf9, 0xb5, 0xf9, 0xb5, + 0xf9, 0xb5, 0xf9, 0xb5, 0xf9, 0xb5, 0xf9, 0xb5, + 0xf0, 0x00, 0xfb, 0x6b, + 0x50, 0x82, 0x50, 0x82, 0x50, 0x82, 0x50, 0x82, + 0xe2, 0xad, 0xe2, 0xad, 0xe2, 0xad, 0xe2, 0xad, + 0xe2, 0xad, 0xe2, 0xad, 0xe2, 0xad, 0xe2, 0xad, + 0xd0, 0x00, 0x7e, 0x5a, + 0x38, 0x7a, 0x38, 0x7a, 0x38, 0x7a, 0x38, 0x7a, + 0xca, 0xa5, 0xca, 0xa5, 0xca, 0xa5, 0xca, 0xa5, + 0xca, 0xa5, 0xca, 0xa5, 0xca, 0xa5, 0xca, 0xa5, + 0xa0, 0x00, 0x15, 0x48, + 0x14, 0x6e, 0x14, 0x6e, 0x14, 0x6e, 0x14, 0x6e, + 0xa6, 0x99, 0xa6, 0x99, 0xa6, 0x99, 0xa6, 0x99, + 0xa6, 0x99, 0xa6, 0x99, 0xa6, 0x99, 0xa6, 0x99, + 0x50, 0x00, 0x8e, 0x36, + 0xd9, 0x59, 0xd9, 0x59, 0xd9, 0x59, 0xd9, 0x59, + 0x6b, 0x85, 0x6b, 0x85, 0x6b, 0x85, 0x6b, 0x85, + 0x6b, 0x85, 0x6b, 0x85, 0x6b, 0x85, 0x6b, 0x85, + 0x00, 0x00, 0xfe, 0x2d, + 0x9d, 0x45, 0x9d, 0x45, 0x9d, 0x45, 0x9d, 0x45, + 0x2f, 0x71, 0x2f, 0x71, 0x2f, 0x71, 0x2f, 0x71, + 0x2f, 0x71, 0x2f, 0x71, 0x2f, 0x71, 0x2f, 0x71, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, + + /* 2432 MHz */ + 0x80, 0x09, + 0x10, 0x01, 0xd7, 0x82, + 0x51, 0x8a, 0x51, 0x8a, 0x51, 0x8a, 0x51, 0x8a, + 0xe3, 0xb5, 0xe3, 0xb5, 0xe3, 0xb5, 0xe3, 0xb5, + 0xe3, 0xb5, 0xe3, 0xb5, 0xe3, 0xb5, 0xe3, 0xb5, + 0xf0, 0x00, 0xc8, 0x6b, + 0x37, 0x82, 0x37, 0x82, 0x37, 0x82, 0x37, 0x82, + 0xc9, 0xad, 0xc9, 0xad, 0xc9, 0xad, 0xc9, 0xad, + 0xc9, 0xad, 0xc9, 0xad, 0xc9, 0xad, 0xc9, 0xad, + 0xd0, 0x00, 0x6f, 0x5a, + 0x1d, 0x7a, 0x1d, 0x7a, 0x1d, 0x7a, 0x1d, 0x7a, + 0xaf, 0xa5, 0xaf, 0xa5, 0xaf, 0xa5, 0xaf, 0xa5, + 0xaf, 0xa5, 0xaf, 0xa5, 0xaf, 0xa5, 0xaf, 0xa5, + 0xa0, 0x00, 0x20, 0x48, + 0xf6, 0x6d, 0xf6, 0x6d, 0xf6, 0x6d, 0xf6, 0x6d, + 0x88, 0x99, 0x88, 0x99, 0x88, 0x99, 0x88, 0x99, + 0x88, 0x99, 0x88, 0x99, 0x88, 0x99, 0x88, 0x99, + 0x50, 0x00, 0x9f, 0x36, + 0xb5, 0x59, 0xb5, 0x59, 0xb5, 0x59, 0xb5, 0x59, + 0x47, 0x85, 0x47, 0x85, 0x47, 0x85, 0x47, 0x85, + 0x47, 0x85, 0x47, 0x85, 0x47, 0x85, 0x47, 0x85, + 0x00, 0x00, 0x06, 0x2e, + 0x74, 0x45, 0x74, 0x45, 0x74, 0x45, 0x74, 0x45, + 0x06, 0x71, 0x06, 0x71, 0x06, 0x71, 0x06, 0x71, + 0x06, 0x71, 0x06, 0x71, 0x06, 0x71, 0x06, 0x71, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, + + /* 2437 MHz */ + 0x85, 0x09, + 0x10, 0x01, 0x67, 0x82, + 0x3a, 0x8a, 0x3a, 0x8a, 0x3a, 0x8a, 0x3a, 0x8a, + 0xcc, 0xb5, 0xcc, 0xb5, 0xcc, 0xb5, 0xcc, 0xb5, + 0xcc, 0xb5, 0xcc, 0xb5, 0xcc, 0xb5, 0xcc, 0xb5, + 0xf0, 0x00, 0x95, 0x6b, + 0x1f, 0x82, 0x1f, 0x82, 0x1f, 0x82, 0x1f, 0x82, + 0xb1, 0xad, 0xb1, 0xad, 0xb1, 0xad, 0xb1, 0xad, + 0xb1, 0xad, 0xb1, 0xad, 0xb1, 0xad, 0xb1, 0xad, + 0xd0, 0x00, 0x61, 0x5a, + 0x02, 0x7a, 0x02, 0x7a, 0x02, 0x7a, 0x02, 0x7a, + 0x94, 0xa5, 0x94, 0xa5, 0x94, 0xa5, 0x94, 0xa5, + 0x94, 0xa5, 0x94, 0xa5, 0x94, 0xa5, 0x94, 0xa5, + 0xa0, 0x00, 0x2c, 0x48, + 0xd8, 0x6d, 0xd8, 0x6d, 0xd8, 0x6d, 0xd8, 0x6d, + 0x6a, 0x99, 0x6a, 0x99, 0x6a, 0x99, 0x6a, 0x99, + 0x6a, 0x99, 0x6a, 0x99, 0x6a, 0x99, 0x6a, 0x99, + 0x50, 0x00, 0xb1, 0x36, + 0x92, 0x59, 0x92, 0x59, 0x92, 0x59, 0x92, 0x59, + 0x24, 0x85, 0x24, 0x85, 0x24, 0x85, 0x24, 0x85, + 0x24, 0x85, 0x24, 0x85, 0x24, 0x85, 0x24, 0x85, + 0x00, 0x00, 0x0f, 0x2e, + 0x4b, 0x45, 0x4b, 0x45, 0x4b, 0x45, 0x4b, 0x45, + 0xdd, 0x70, 0xdd, 0x70, 0xdd, 0x70, 0xdd, 0x70, + 0xdd, 0x70, 0xdd, 0x70, 0xdd, 0x70, 0xdd, 0x70, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, + + /* 2442 MHz */ + 0x8a, 0x09, + 0x10, 0x01, 0xf6, 0x81, + 0x24, 0x8a, 0x24, 0x8a, 0x24, 0x8a, 0x24, 0x8a, + 0xb6, 0xb5, 0xb6, 0xb5, 0xb6, 0xb5, 0xb6, 0xb5, + 0xb6, 0xb5, 0xb6, 0xb5, 0xb6, 0xb5, 0xb6, 0xb5, + 0xf0, 0x00, 0x62, 0x6b, + 0x06, 0x82, 0x06, 0x82, 0x06, 0x82, 0x06, 0x82, + 0x98, 0xad, 0x98, 0xad, 0x98, 0xad, 0x98, 0xad, + 0x98, 0xad, 0x98, 0xad, 0x98, 0xad, 0x98, 0xad, + 0xd0, 0x00, 0x52, 0x5a, + 0xe7, 0x79, 0xe7, 0x79, 0xe7, 0x79, 0xe7, 0x79, + 0x79, 0xa5, 0x79, 0xa5, 0x79, 0xa5, 0x79, 0xa5, + 0x79, 0xa5, 0x79, 0xa5, 0x79, 0xa5, 0x79, 0xa5, + 0xa0, 0x00, 0x37, 0x48, + 0xba, 0x6d, 0xba, 0x6d, 0xba, 0x6d, 0xba, 0x6d, + 0x4c, 0x99, 0x4c, 0x99, 0x4c, 0x99, 0x4c, 0x99, + 0x4c, 0x99, 0x4c, 0x99, 0x4c, 0x99, 0x4c, 0x99, + 0x50, 0x00, 0xc2, 0x36, + 0x6e, 0x59, 0x6e, 0x59, 0x6e, 0x59, 0x6e, 0x59, + 0x00, 0x85, 0x00, 0x85, 0x00, 0x85, 0x00, 0x85, + 0x00, 0x85, 0x00, 0x85, 0x00, 0x85, 0x00, 0x85, + 0x00, 0x00, 0x17, 0x2e, + 0x22, 0x45, 0x22, 0x45, 0x22, 0x45, 0x22, 0x45, + 0xb4, 0x70, 0xb4, 0x70, 0xb4, 0x70, 0xb4, 0x70, + 0xb4, 0x70, 0xb4, 0x70, 0xb4, 0x70, 0xb4, 0x70, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, + + /* 2447 MHz */ + 0x8f, 0x09, + 0x10, 0x01, 0x75, 0x83, + 0x61, 0x8a, 0x61, 0x8a, 0x61, 0x8a, 0x61, 0x8a, + 0xf3, 0xb5, 0xf3, 0xb5, 0xf3, 0xb5, 0xf3, 0xb5, + 0xf3, 0xb5, 0xf3, 0xb5, 0xf3, 0xb5, 0xf3, 0xb5, + 0xf0, 0x00, 0x4b, 0x6c, + 0x3f, 0x82, 0x3f, 0x82, 0x3f, 0x82, 0x3f, 0x82, + 0xd1, 0xad, 0xd1, 0xad, 0xd1, 0xad, 0xd1, 0xad, + 0xd1, 0xad, 0xd1, 0xad, 0xd1, 0xad, 0xd1, 0xad, + 0xd0, 0x00, 0xda, 0x5a, + 0x1c, 0x7a, 0x1c, 0x7a, 0x1c, 0x7a, 0x1c, 0x7a, + 0xae, 0xa5, 0xae, 0xa5, 0xae, 0xa5, 0xae, 0xa5, + 0xae, 0xa5, 0xae, 0xa5, 0xae, 0xa5, 0xae, 0xa5, + 0xa0, 0x00, 0x6d, 0x48, + 0xe9, 0x6d, 0xe9, 0x6d, 0xe9, 0x6d, 0xe9, 0x6d, + 0x7b, 0x99, 0x7b, 0x99, 0x7b, 0x99, 0x7b, 0x99, + 0x7b, 0x99, 0x7b, 0x99, 0x7b, 0x99, 0x7b, 0x99, + 0x50, 0x00, 0xc6, 0x36, + 0x92, 0x59, 0x92, 0x59, 0x92, 0x59, 0x92, 0x59, + 0x24, 0x85, 0x24, 0x85, 0x24, 0x85, 0x24, 0x85, + 0x24, 0x85, 0x24, 0x85, 0x24, 0x85, 0x24, 0x85, + 0x00, 0x00, 0x15, 0x2e, + 0x3c, 0x45, 0x3c, 0x45, 0x3c, 0x45, 0x3c, 0x45, + 0xce, 0x70, 0xce, 0x70, 0xce, 0x70, 0xce, 0x70, + 0xce, 0x70, 0xce, 0x70, 0xce, 0x70, 0xce, 0x70, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, + + /* 2452 MHz */ + 0x94, 0x09, + 0x10, 0x01, 0xf4, 0x84, + 0x9e, 0x8a, 0x9e, 0x8a, 0x9e, 0x8a, 0x9e, 0x8a, + 0x30, 0xb6, 0x30, 0xb6, 0x30, 0xb6, 0x30, 0xb6, + 0x30, 0xb6, 0x30, 0xb6, 0x30, 0xb6, 0x30, 0xb6, + 0xf0, 0x00, 0x34, 0x6d, + 0x77, 0x82, 0x77, 0x82, 0x77, 0x82, 0x77, 0x82, + 0x09, 0xae, 0x09, 0xae, 0x09, 0xae, 0x09, 0xae, + 0x09, 0xae, 0x09, 0xae, 0x09, 0xae, 0x09, 0xae, + 0xd0, 0x00, 0x62, 0x5b, + 0x50, 0x7a, 0x50, 0x7a, 0x50, 0x7a, 0x50, 0x7a, + 0xe2, 0xa5, 0xe2, 0xa5, 0xe2, 0xa5, 0xe2, 0xa5, + 0xe2, 0xa5, 0xe2, 0xa5, 0xe2, 0xa5, 0xe2, 0xa5, + 0xa0, 0x00, 0xa2, 0x48, + 0x17, 0x6e, 0x17, 0x6e, 0x17, 0x6e, 0x17, 0x6e, + 0xa9, 0x99, 0xa9, 0x99, 0xa9, 0x99, 0xa9, 0x99, + 0xa9, 0x99, 0xa9, 0x99, 0xa9, 0x99, 0xa9, 0x99, + 0x50, 0x00, 0xc9, 0x36, + 0xb7, 0x59, 0xb7, 0x59, 0xb7, 0x59, 0xb7, 0x59, + 0x49, 0x85, 0x49, 0x85, 0x49, 0x85, 0x49, 0x85, + 0x49, 0x85, 0x49, 0x85, 0x49, 0x85, 0x49, 0x85, + 0x00, 0x00, 0x12, 0x2e, + 0x57, 0x45, 0x57, 0x45, 0x57, 0x45, 0x57, 0x45, + 0xe9, 0x70, 0xe9, 0x70, 0xe9, 0x70, 0xe9, 0x70, + 0xe9, 0x70, 0xe9, 0x70, 0xe9, 0x70, 0xe9, 0x70, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, + + /* 2452 MHz */ + 0x99, 0x09, + 0x10, 0x01, 0x74, 0x86, + 0xdb, 0x8a, 0xdb, 0x8a, 0xdb, 0x8a, 0xdb, 0x8a, + 0x6d, 0xb6, 0x6d, 0xb6, 0x6d, 0xb6, 0x6d, 0xb6, + 0x6d, 0xb6, 0x6d, 0xb6, 0x6d, 0xb6, 0x6d, 0xb6, + 0xf0, 0x00, 0x1e, 0x6e, + 0xb0, 0x82, 0xb0, 0x82, 0xb0, 0x82, 0xb0, 0x82, + 0x42, 0xae, 0x42, 0xae, 0x42, 0xae, 0x42, 0xae, + 0x42, 0xae, 0x42, 0xae, 0x42, 0xae, 0x42, 0xae, + 0xd0, 0x00, 0xeb, 0x5b, + 0x85, 0x7a, 0x85, 0x7a, 0x85, 0x7a, 0x85, 0x7a, + 0x17, 0xa6, 0x17, 0xa6, 0x17, 0xa6, 0x17, 0xa6, + 0x17, 0xa6, 0x17, 0xa6, 0x17, 0xa6, 0x17, 0xa6, + 0xa0, 0x00, 0xd8, 0x48, + 0x46, 0x6e, 0x46, 0x6e, 0x46, 0x6e, 0x46, 0x6e, + 0xd8, 0x99, 0xd8, 0x99, 0xd8, 0x99, 0xd8, 0x99, + 0xd8, 0x99, 0xd8, 0x99, 0xd8, 0x99, 0xd8, 0x99, + 0x50, 0x00, 0xcd, 0x36, + 0xdb, 0x59, 0xdb, 0x59, 0xdb, 0x59, 0xdb, 0x59, + 0x6d, 0x85, 0x6d, 0x85, 0x6d, 0x85, 0x6d, 0x85, + 0x6d, 0x85, 0x6d, 0x85, 0x6d, 0x85, 0x6d, 0x85, + 0x00, 0x00, 0x10, 0x2e, + 0x71, 0x45, 0x71, 0x45, 0x71, 0x45, 0x71, 0x45, + 0x03, 0x71, 0x03, 0x71, 0x03, 0x71, 0x03, 0x71, + 0x03, 0x71, 0x03, 0x71, 0x03, 0x71, 0x03, 0x71, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, + + /* 2557 MHz */ + 0x9e, 0x09, + 0x10, 0x01, 0xf3, 0x87, + 0x17, 0x8b, 0x17, 0x8b, 0x17, 0x8b, 0x17, 0x8b, + 0xa9, 0xb6, 0xa9, 0xb6, 0xa9, 0xb6, 0xa9, 0xb6, + 0xa9, 0xb6, 0xa9, 0xb6, 0xa9, 0xb6, 0xa9, 0xb6, + 0xf0, 0x00, 0x07, 0x6f, + 0xe9, 0x82, 0xe9, 0x82, 0xe9, 0x82, 0xe9, 0x82, + 0x7b, 0xae, 0x7b, 0xae, 0x7b, 0xae, 0x7b, 0xae, + 0x7b, 0xae, 0x7b, 0xae, 0x7b, 0xae, 0x7b, 0xae, + 0xd0, 0x00, 0x73, 0x5c, + 0xba, 0x7a, 0xba, 0x7a, 0xba, 0x7a, 0xba, 0x7a, + 0x4c, 0xa6, 0x4c, 0xa6, 0x4c, 0xa6, 0x4c, 0xa6, + 0x4c, 0xa6, 0x4c, 0xa6, 0x4c, 0xa6, 0x4c, 0xa6, + 0xa0, 0x00, 0x0d, 0x49, + 0x74, 0x6e, 0x74, 0x6e, 0x74, 0x6e, 0x74, 0x6e, + 0x06, 0x9a, 0x06, 0x9a, 0x06, 0x9a, 0x06, 0x9a, + 0x06, 0x9a, 0x06, 0x9a, 0x06, 0x9a, 0x06, 0x9a, + 0x50, 0x00, 0xd1, 0x36, + 0xff, 0x59, 0xff, 0x59, 0xff, 0x59, 0xff, 0x59, + 0x91, 0x85, 0x91, 0x85, 0x91, 0x85, 0x91, 0x85, + 0x91, 0x85, 0x91, 0x85, 0x91, 0x85, 0x91, 0x85, + 0x00, 0x00, 0x0e, 0x2e, + 0x8b, 0x45, 0x8b, 0x45, 0x8b, 0x45, 0x8b, 0x45, + 0x1d, 0x71, 0x1d, 0x71, 0x1d, 0x71, 0x1d, 0x71, + 0x1d, 0x71, 0x1d, 0x71, 0x1d, 0x71, 0x1d, 0x71, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, + + /* 2562 MHz */ + 0xa3, 0x09, + 0x10, 0x01, 0x72, 0x89, + 0x54, 0x8b, 0x54, 0x8b, 0x54, 0x8b, 0x54, 0x8b, + 0xe6, 0xb6, 0xe6, 0xb6, 0xe6, 0xb6, 0xe6, 0xb6, + 0xe6, 0xb6, 0xe6, 0xb6, 0xe6, 0xb6, 0xe6, 0xb6, + 0xf0, 0x00, 0xf0, 0x6f, + 0x21, 0x83, 0x21, 0x83, 0x21, 0x83, 0x21, 0x83, + 0xb3, 0xae, 0xb3, 0xae, 0xb3, 0xae, 0xb3, 0xae, + 0xb3, 0xae, 0xb3, 0xae, 0xb3, 0xae, 0xb3, 0xae, + 0xd0, 0x00, 0xfb, 0x5c, + 0xee, 0x7a, 0xee, 0x7a, 0xee, 0x7a, 0xee, 0x7a, + 0x80, 0xa6, 0x80, 0xa6, 0x80, 0xa6, 0x80, 0xa6, + 0x80, 0xa6, 0x80, 0xa6, 0x80, 0xa6, 0x80, 0xa6, + 0xa0, 0x00, 0x43, 0x49, + 0xa3, 0x6e, 0xa3, 0x6e, 0xa3, 0x6e, 0xa3, 0x6e, + 0x35, 0x9a, 0x35, 0x9a, 0x35, 0x9a, 0x35, 0x9a, + 0x35, 0x9a, 0x35, 0x9a, 0x35, 0x9a, 0x35, 0x9a, + 0x50, 0x00, 0xd4, 0x36, + 0x24, 0x5a, 0x24, 0x5a, 0x24, 0x5a, 0x24, 0x5a, + 0xb6, 0x85, 0xb6, 0x85, 0xb6, 0x85, 0xb6, 0x85, + 0xb6, 0x85, 0xb6, 0x85, 0xb6, 0x85, 0xb6, 0x85, + 0x00, 0x00, 0x0b, 0x2e, + 0xa6, 0x45, 0xa6, 0x45, 0xa6, 0x45, 0xa6, 0x45, + 0x38, 0x71, 0x38, 0x71, 0x38, 0x71, 0x38, 0x71, + 0x38, 0x71, 0x38, 0x71, 0x38, 0x71, 0x38, 0x71, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, + + /* 2572 MHz */ + 0xa8, 0x09, + 0x10, 0x01, 0xf1, 0x8a, + 0x91, 0x8b, 0x91, 0x8b, 0x91, 0x8b, 0x91, 0x8b, + 0x23, 0xb7, 0x23, 0xb7, 0x23, 0xb7, 0x23, 0xb7, + 0x23, 0xb7, 0x23, 0xb7, 0x23, 0xb7, 0x23, 0xb7, + 0xf0, 0x00, 0xd9, 0x70, + 0x5a, 0x83, 0x5a, 0x83, 0x5a, 0x83, 0x5a, 0x83, + 0xec, 0xae, 0xec, 0xae, 0xec, 0xae, 0xec, 0xae, + 0xec, 0xae, 0xec, 0xae, 0xec, 0xae, 0xec, 0xae, + 0xd0, 0x00, 0x83, 0x5d, + 0x23, 0x7b, 0x23, 0x7b, 0x23, 0x7b, 0x23, 0x7b, + 0xb5, 0xa6, 0xb5, 0xa6, 0xb5, 0xa6, 0xb5, 0xa6, + 0xb5, 0xa6, 0xb5, 0xa6, 0xb5, 0xa6, 0xb5, 0xa6, + 0xa0, 0x00, 0x78, 0x49, + 0xd1, 0x6e, 0xd1, 0x6e, 0xd1, 0x6e, 0xd1, 0x6e, + 0x63, 0x9a, 0x63, 0x9a, 0x63, 0x9a, 0x63, 0x9a, + 0x63, 0x9a, 0x63, 0x9a, 0x63, 0x9a, 0x63, 0x9a, + 0x50, 0x00, 0xd8, 0x36, + 0x48, 0x5a, 0x48, 0x5a, 0x48, 0x5a, 0x48, 0x5a, + 0xda, 0x85, 0xda, 0x85, 0xda, 0x85, 0xda, 0x85, + 0xda, 0x85, 0xda, 0x85, 0xda, 0x85, 0xda, 0x85, + 0x00, 0x00, 0x09, 0x2e, + 0xc0, 0x45, 0xc0, 0x45, 0xc0, 0x45, 0xc0, 0x45, + 0x52, 0x71, 0x52, 0x71, 0x52, 0x71, 0x52, 0x71, + 0x52, 0x71, 0x52, 0x71, 0x52, 0x71, 0x52, 0x71, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, +}; + +/* + * Not really sure if this is actually the power_limit database, + * it looks a bit "related" to PDR_PRISM_ZIF_TX_IQ_CALIBRATION + */ +static const uint8_t template_pa_cal_output_power_limits[] = { + /* struct pda_custom_wrapper */ + 0xae, 0x00, 0xef, 0xbe, /* PDR_PRISM_PA_CAL_OUTPUT_POWER_LIMITS_CUSTOM */ + 0x0d, 0x00, 0x1a, 0x00, /* 13 entries, 26 bytes per entry */ + 0x00, 0x00, 0x52, 0x01, /* no offset, 338 bytes total */ + + /* 2412 MHz */ + 0x6c, 0x09, + 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, + 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, + 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, + + /* 2417 MHz */ + 0x71, 0x09, + 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, + 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, + 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, + + /* 2422 MHz */ + 0x76, 0x09, + 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, + 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, + 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, + + /* 2427 MHz */ + 0x7b, 0x09, + 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, + 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, + 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, + + /* 2432 MHz */ + 0x80, 0x09, + 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, + 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, + 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, + + /* 2437 MHz */ + 0x85, 0x09, + 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, + 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, + 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, + + /* 2442 MHz */ + 0x8a, 0x09, + 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, + 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, + 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, + + /* 2447 MHz */ + 0x8f, 0x09, + 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, + 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, + 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, + + /* 2452 MHz */ + 0x94, 0x09, + 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, + 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, + 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, + + /* 2457 MHz */ + 0x99, 0x09, + 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, + 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, + 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, + + /* 2462 MHz */ + 0x9e, 0x09, + 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, + 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, + 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, + + /* 2467 MHz */ + 0xa3, 0x09, + 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, + 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, + 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, + + /* 2472 MHz */ + 0xa8, 0x09, + 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, + 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, + 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, +}; + +static const uint8_t template_pda_iq_autocal[] = { + /* struct pda_iq_autocal_entry[13] */ + 0x42, 0x00, 0x06, 0x19, /* PDR_PRISM_ZIF_TX_IQ_CALIBRATION */ + /* 2412 MHz */ + 0x6c, 0x09, 0x26, 0x00, 0xf8, 0xff, 0xf7, 0xff, 0xff, 0x00, + /* 2417 MHz */ + 0x71, 0x09, 0x26, 0x00, 0xf8, 0xff, 0xf7, 0xff, 0xff, 0x00, + /* 2422 MHz */ + 0x76, 0x09, 0x26, 0x00, 0xf8, 0xff, 0xf7, 0xff, 0xff, 0x00, + /* 2427 MHz */ + 0x7b, 0x09, 0x26, 0x00, 0xf8, 0xff, 0xf7, 0xff, 0xff, 0x00, + /* 2432 MHz */ + 0x80, 0x09, 0x25, 0x00, 0xf7, 0xff, 0xf7, 0xff, 0xff, 0x00, + /* 2437 MHz */ + 0x85, 0x09, 0x25, 0x00, 0xf7, 0xff, 0xf7, 0xff, 0xff, 0x00, + /* 2442 MHz */ + 0x8a, 0x09, 0x25, 0x00, 0xf7, 0xff, 0xf7, 0xff, 0xff, 0x00, + /* 2447 MHz */ + 0x8f, 0x09, 0x25, 0x00, 0xf7, 0xff, 0xf7, 0xff, 0xff, 0x00, + /* 2452 MHz */ + 0x94, 0x09, 0x25, 0x00, 0xf7, 0xff, 0xf7, 0xff, 0xff, 0x00, + /* 2457 MHz */ + 0x99, 0x09, 0x25, 0x00, 0xf5, 0xff, 0xf9, 0xff, 0x00, 0x01, + /* 2462 MHz */ + 0x9e, 0x09, 0x25, 0x00, 0xf5, 0xff, 0xf9, 0xff, 0x00, 0x01, + /* 2467 MHz */ + 0xa3, 0x09, 0x25, 0x00, 0xf5, 0xff, 0xf9, 0xff, 0x00, 0x01, + /* 2472 MHz */ + 0xa8, 0x09, 0x25, 0x00, 0xf5, 0xff, 0xf9, 0xff, 0x00, 0x01, +}; + +static const uint8_t template_pdr_end[] = { + 0x02, 0x00, 0x00, 0x00, /* PDR_END */ +}; + +/* linux/lib/crc-ccitt.c + * + * This mysterious table is just the CRC of each possible byte. It can be + * computed using the standard bit-at-a-time methods. The polynomial can + * be seen in entry 128, 0x8408. This corresponds to x^0 + x^5 + x^12. + * Add the implicit x^16, and you have the standard CRC-CCITT. + */ +static uint16_t const crc_ccitt_table[256] = { + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 +}; + +static inline uint16_t crc_ccitt_byte(uint16_t crc, const uint8_t c) +{ + return (crc >> 8) ^ crc_ccitt_table[(crc ^ c) & 0xff]; +} + +static uint16_t crc_ccitt(uint16_t crc, uint8_t const *buffer, size_t len) +{ + while (len--) + crc = crc_ccitt_byte(crc, *buffer++); + return crc; +} + +static int generate_pa_cal_curve(uint8_t *buffer, + const uint8_t *txgen_image, + size_t txgen_image_size) +{ + memcpy(buffer, template_pa_cal_curve, sizeof(template_pa_cal_curve)); + + //TODO + + return 0; +} + +static int generate_iq_autocal(uint8_t *buffer, + const uint8_t *iqalign_image, + size_t iqalign_image_size) +{ + unsigned int expected_size; + uint8_t *out; + const uint8_t *in; + unsigned int i; + + expected_size = 13 * 8 + 4; + if (iqalign_image_size != expected_size) { + fprintf(stderr, "ERROR: Unknown wlan-iq-align image size. " + "Got %u, but expected %u\n", + (unsigned int)iqalign_image_size, expected_size); + return -EINVAL; + } + + in = iqalign_image; + out = buffer; + + memcpy(out, template_pda_iq_autocal, sizeof(template_pda_iq_autocal)); + + in += 4; /* Skip zero padding */ + out += 4; /* Skip header */ + for (i = 0; i < 13; i++) { + out += 2; /* Skip little endian 16bit Mhz number */ + memcpy(out, in, 8); + out += 8; /* Next element */ + in += 8; /* Next element */ + } + + return 0; +} + +static int generate_eeprom(FILE *outstream, + const uint8_t *txgen_image, + size_t txgen_image_size, + const uint8_t *iqalign_image, + size_t iqalign_image_size) +{ + int err, res = 0; + uint16_t crc = ~0; + uint8_t crc_buf[2]; + uint8_t gen_pda_iq_autocal[sizeof(template_pda_iq_autocal)]; + uint8_t gen_pa_cal_curve[sizeof(template_pa_cal_curve)]; + + err = generate_iq_autocal(gen_pda_iq_autocal, + iqalign_image, iqalign_image_size); + if (err) + return err; + err = generate_pa_cal_curve(gen_pa_cal_curve, + txgen_image, txgen_image_size); + if (err) + return err; + +#define writebuf(buffer, do_crc) do { \ + if (do_crc) \ + crc = crc_ccitt(crc, buffer, sizeof(buffer)); \ + res = fwrite(buffer, sizeof(buffer), 1, outstream); \ + if (res != 1) { \ + fprintf(stderr, "Failed to write output data\n"); \ + return -EIO; \ + } \ + } while (0) + + writebuf(template_eeprom_pda_wrap, 0); + writebuf(template_mac_address, 1); + writebuf(template_bootrec_exp_if, 1); + writebuf(template_pda_country_list, 1); + writebuf(template_pda_country, 1); + writebuf(template_antenna_gain, 1); + writebuf(template_rssi_linear_approx_custom2, 1); + writebuf(gen_pa_cal_curve, 1); + writebuf(template_pa_cal_output_power_limits, 1); + writebuf(gen_pda_iq_autocal, 1); + writebuf(template_pdr_end, 1); + + crc = ~crc; + crc_buf[0] = crc & 0xFF; + crc_buf[1] = (crc >> 8) & 0xFF; + res = fwrite(crc_buf, sizeof(crc_buf), 1, outstream); + if (res != 1) { + fprintf(stderr, "Failed to write CRC\n"); + return -EIO; + } + + return 0; +} + +static void * map_file(const char *filepath, int readonly, + uint64_t *filelen) +{ + int fd; + off_t len; + void *data; + + fd = open(filepath, readonly ? O_RDONLY : O_RDWR); + if (fd < 0) { + fprintf(stderr, "Failed to open file %s: %s\n", + filepath, strerror(errno)); + return NULL; + } + len = lseek(fd, 0, SEEK_END); + if (len < 0 || lseek(fd, 0, SEEK_SET)) { + fprintf(stderr, "Failed to calculate file length of %s: %s\n", + filepath, strerror(errno)); + close(fd); + return NULL; + } + + data = mmap(NULL, len, + readonly ? PROT_READ : (PROT_READ | PROT_WRITE), + readonly ? MAP_PRIVATE : 0, + fd, 0); + close(fd); + if (data == MAP_FAILED) { + fprintf(stderr, "Failed to MMAP file %s: %s\n", + filepath, strerror(errno)); + return NULL; + } + madvise(data, len, MADV_SEQUENTIAL); + + *filelen = len; + + return data; +} + +static void unmap_file(void *mapping, uint64_t len) +{ + if (mapping) + munmap(mapping, len); +} + +static void usage(FILE *fd) +{ + fprintf(fd, "cal2p54 - CAL to p54spi EEPROM converter\n"); + fprintf(fd, "\n"); + fprintf(fd, "Usage: cal2p54 WLAN-TX-GEN2-IMAGE WLAN-IQ-ALIGN-IMAGE\n"); +} + +int main(int argc, char **argv) +{ + int err, ret = 0; + uint8_t *txgen_image = NULL; + uint64_t txgen_image_len = 0; + uint8_t *iqalign_image = NULL; + uint64_t iqalign_image_len = 0; + + const char *txgen_filepath; + const char *iqalign_filepath; + + if (argc != 3) { + usage(stderr); + return 1; + } + txgen_filepath = argv[1]; + iqalign_filepath = argv[2]; + + txgen_image = map_file(txgen_filepath, 1, &txgen_image_len); + iqalign_image = map_file(iqalign_filepath, 1, &iqalign_image_len); + if (!txgen_image || !iqalign_image) { + ret = 1; + goto out; + } + + err = generate_eeprom(stdout, txgen_image, txgen_image_len, + iqalign_image, iqalign_image_len); + if (err) { + ret = 1; + goto out; + } + +out: + unmap_file(txgen_image, txgen_image_len); + unmap_file(iqalign_image, iqalign_image_len); + + return ret; +} diff --git a/utils/calvaria/files/src/calvaria.c b/utils/calvaria/files/src/calvaria.c new file mode 100644 index 0000000..2438e34 --- /dev/null +++ b/utils/calvaria/files/src/calvaria.c @@ -0,0 +1,514 @@ +/* + * Calvaria - Maemo CAL partition variable access tool. + * + * Copyright (c) 2011 Michael Buesch + * + * Licensed under the GNU General Public License version 2. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define _packed __attribute__((__packed__)) + +typedef uint16_t le16_t; +typedef uint32_t le32_t; + +struct header { + char magic[4]; /* Magic sequence */ + uint8_t type; /* Type number */ + uint8_t index; /* Index number */ + le16_t flags; /* Flags */ + char name[16]; /* Human readable section name */ + le32_t length; /* Payload length */ + le32_t datasum; /* Data CRC32 checksum */ + le32_t hdrsum; /* Header CRC32 checksum */ +} _packed; + +#define HDR_MAGIC "ConF" + +#define INDEX_LAST (0xFF + 1) + + +static char toAscii(char c) +{ + if (c >= 32 && c <= 126) + return c; + return '.'; +} + +static void dump_bytes(FILE *outstream, const void *_buf, size_t size) +{ + const char *buf = _buf; + size_t i, ascii_cnt = 0; + char ascii[17] = { 0, }; + + for (i = 0; i < size; i++) { + if (i % 16 == 0) { + if (i != 0) { + fprintf(outstream, " |%s|\n", ascii); + ascii[0] = 0; + ascii_cnt = 0; + } + fprintf(outstream, "[%04X]: ", (unsigned int)i); + } + fprintf(outstream, " %02X", buf[i] & 0xFF); + ascii[ascii_cnt] = toAscii(buf[i]); + ascii[ascii_cnt + 1] = 0; + ascii_cnt++; + } + if (ascii[0]) { + if (size % 16) { + for (i = 0; i < 16 - (size % 16); i++) + fprintf(outstream, " "); + } + fprintf(outstream, " |%s|\n", ascii); + } +} + +static uint32_t crc32(uint32_t crc, const void *_data, size_t size) +{ + const uint8_t *data = _data; + uint8_t value; + unsigned int bit; + size_t i; + const uint32_t poly = 0xEDB88320; + + for (i = 0; i < size; i++) { + value = data[i]; + for (bit = 8; bit; bit--) { + if ((crc & 1) != (value & 1)) + crc = (crc >> 1) ^ poly; + else + crc >>= 1; + value >>= 1; + } + } + + return crc; +} + +static inline uint16_t le16_to_cpu(le16_t x) +{ + uint8_t *bytes = (uint8_t *)&x; + uint16_t ret; + + ret = bytes[0]; + ret |= (uint16_t)(bytes[1]) << 8; + + return ret; +} + +static inline uint32_t le32_to_cpu(le32_t x) +{ + uint8_t *bytes = (uint8_t *)&x; + uint32_t ret; + + ret = bytes[0]; + ret |= (uint32_t)(bytes[1]) << 8; + ret |= (uint32_t)(bytes[2]) << 16; + ret |= (uint32_t)(bytes[3]) << 24; + + return ret; +} + +static int is_header(void *data, size_t size) +{ + struct header *hdr = data; + + if (size < sizeof(struct header)) + return 0; + if (memcmp(hdr->magic, HDR_MAGIC, sizeof(hdr->magic)) != 0) + return 0; + return 1; +} + +void dump_bme_payload(FILE *outstream, const void *payload, size_t len) +{ + const uint8_t *pmm_area = payload; + unsigned int group, element, pmm_offset; + uint8_t active_group_mask; + static const uint8_t zero_element[16] = { 0, }; + + if (len != 0x600 || memcmp(payload, "BME-PMM-BLOCK01", 15) != 0) { + fprintf(outstream, "ERROR: The section payload is not " + "a BME PMM block\n"); + return; + } + + active_group_mask = pmm_area[16]; + + for (group = 0; group < 3; group++) { + for (element = 0; element < 32; element++) { + pmm_offset = group * 512 + element * 16; + if (memcmp(pmm_area + pmm_offset, zero_element, 16) == 0) + continue; + fprintf(outstream, "-- BME-PMM area -- group %u%s, element %u:\n", + group, + (active_group_mask & (1 << group)) ? "" : " (INACTIVE)", + element); + dump_bytes(outstream, pmm_area + pmm_offset, 16); + } + } +} + +typedef void (*payload_dumper_t)(FILE *, const void *payload, size_t len); + +static payload_dumper_t get_payload_dumper(const char *section_name, int raw) +{ + if (!raw) { + if (strcmp(section_name, "bme") == 0) + return dump_bme_payload; + } + + return dump_bytes; +} + +static int dump_section(const struct header *hdr, + const void *payload, size_t payload_len, + int dump_payload, + int dump_raw_payload, + FILE *outstream) +{ + char name[sizeof(hdr->name) + 1] = { 0, }; + int hdrsum_ok, datasum_ok; + payload_dumper_t dumper; + + memcpy(name, hdr->name, sizeof(hdr->name)); + hdrsum_ok = (crc32(0, hdr, sizeof(*hdr) - 4) == le32_to_cpu(hdr->hdrsum)); + datasum_ok = (crc32(0, payload, payload_len) == le32_to_cpu(hdr->datasum)); + + fprintf(outstream, "Section: %s\n", name); + fprintf(outstream, "Type: %u (0x%X)\n", hdr->type, hdr->type); + fprintf(outstream, "Index: %u (0x%X)\n", hdr->index, hdr->index); + fprintf(outstream, "Flags: 0x%04X\n", le16_to_cpu(hdr->flags)); + fprintf(outstream, "Length: %u (0x%X)\n", + le32_to_cpu(hdr->length), le32_to_cpu(hdr->length)); + fprintf(outstream, "Data CRC32: 0x%08X (%s)\n", le32_to_cpu(hdr->datasum), + datasum_ok ? "Ok" : "MISMATCH"); + fprintf(outstream, "Header CRC32: 0x%08X (%s)\n", le32_to_cpu(hdr->hdrsum), + hdrsum_ok ? "Ok" : "MISMATCH"); + if (dump_payload) { + dumper = get_payload_dumper(name, dump_raw_payload); + dumper(outstream, payload, payload_len); + } + fprintf(outstream, "\n"); + + return 0; +} + +static void * map_file(const char *filepath, int readonly, + uint64_t *filelen) +{ + int fd; + off_t len; + void *data; + + fd = open(filepath, readonly ? O_RDONLY : O_RDWR); + if (fd < 0) { + fprintf(stderr, "Failed to open file %s: %s\n", + filepath, strerror(errno)); + return NULL; + } + len = lseek(fd, 0, SEEK_END); + if (len < 0 || lseek(fd, 0, SEEK_SET)) { + fprintf(stderr, "Failed to calculate file length of %s: %s\n", + filepath, strerror(errno)); + close(fd); + return NULL; + } + + data = mmap(NULL, len, + readonly ? PROT_READ : (PROT_READ | PROT_WRITE), + readonly ? MAP_PRIVATE : 0, + fd, 0); + close(fd); + if (data == MAP_FAILED) { + fprintf(stderr, "Failed to MMAP file %s: %s\n", + filepath, strerror(errno)); + return NULL; + } + madvise(data, len, MADV_SEQUENTIAL); + + *filelen = len; + + return data; +} + +static void unmap_file(void *mapping, uint64_t len) +{ + if (mapping) + munmap(mapping, len); +} + +static int64_t find_section(void *start, uint64_t count, + int want_index, const char *want_name) +{ + int64_t offset = 0, found_offset = -1; + uint8_t *data = start; + struct header *hdr; + char sectname[sizeof(hdr->name) + 1] = { 0, }; + uint32_t payload_len; + int previous_index = -1; + + while (1) { + /* Find header start */ + if (count < sizeof(struct header)) + break; + if (!is_header(data + offset, count)) { + count--; + offset++; + continue; + } + hdr = (struct header *)(data + offset); + payload_len = le32_to_cpu(hdr->length); + if (count - sizeof(struct header) < payload_len) { + fprintf(stderr, "Premature EOF\n"); + return -1; + } + memcpy(sectname, hdr->name, sizeof(hdr->name)); + + if (want_index == INDEX_LAST) { + if ((int)hdr->index <= previous_index) + goto next; + } else { + if (want_index >= 0 && want_index != hdr->index) + goto next; + } + if (want_name && strcmp(sectname, want_name) != 0) + goto next; + + /* Found it */ + found_offset = offset; + if (want_index == INDEX_LAST) + previous_index = hdr->index; + else + break; + +next: + count -= sizeof(struct header) + payload_len; + offset += sizeof(struct header) + payload_len; + } + + return found_offset; +} + +static int dump_image(const char *filepath, + int want_section_index, const char *want_section_name, + int want_headers_only, + int dump_raw_payload, + FILE *outstream) +{ + int err, ret = 0; + uint64_t filelen; + uint64_t count, offset; + int64_t find_offset; + uint8_t *data, *section; + struct header *hdr; + uint32_t payload_len; + + data = map_file(filepath, 1, &filelen); + if (!data) + return -EIO; + + count = filelen; + offset = 0; + while (1) { + find_offset = find_section(data + offset, count, + want_section_index, want_section_name); + if (find_offset < 0) + break; + offset += find_offset; + count -= find_offset; + + section = data + offset; + hdr = (struct header *)section; + payload_len = le32_to_cpu(hdr->length); + + err = dump_section(hdr, section + sizeof(struct header), + payload_len, + !want_headers_only, + dump_raw_payload, + outstream); + if (err) { + ret = err; + goto out; + } + + count -= sizeof(struct header) + payload_len; + offset += sizeof(struct header) + payload_len; + } +out: + unmap_file(data, filelen); + + return ret; +} + +static int write_payload(const char *filepath, + int want_section_index, const char *want_section_name, + FILE *outstream) +{ + int64_t find_offset; + uint64_t filelen; + uint8_t *data; + struct header *hdr; + + data = map_file(filepath, 1, &filelen); + if (!data) + return -EIO; + + find_offset = find_section(data, filelen, + want_section_index, want_section_name); + if (find_offset < 0) { + fprintf(stderr, "Section %s, index %d not found\n", + want_section_name, want_section_index); + unmap_file(data, filelen); + return -ESRCH; + } + + hdr = (struct header *)(data + find_offset); + if (fwrite(data + find_offset + sizeof(struct header), + le32_to_cpu(hdr->length), 1, outstream) != 1) { + fprintf(stderr, "Could not write output data\n"); + unmap_file(data, filelen); + return -EIO; + } + + unmap_file(data, filelen); + + return 0; +} + +static void usage(FILE *fd) +{ + fprintf(fd, "Calvaria - Maemo CAL partition variable access tool\n"); + fprintf(fd, "\n"); + fprintf(fd, "Usage: calvaria [OPTIONS] FILE\n"); + fprintf(fd, "\n"); + fprintf(fd, "Actions:\n"); + fprintf(fd, " -d|--dump Dump the contents of the image\n"); + fprintf(fd, " -H|--headers Dump the headers of the image, only\n"); + fprintf(fd, " -p|--payload Write the binary payload to stdout.\n"); + fprintf(fd, " Requires -i and -n to be set, too\n"); + fprintf(fd, "\n"); + fprintf(fd, "Options:\n"); + fprintf(fd, " -i|--index NUMBER Use this section index number\n"); + fprintf(fd, " -n|--name STRING Use this section name\n"); + fprintf(fd, " -r|--raw Dump raw data (for -d|--dump only)\n"); + fprintf(fd, "\n"); + fprintf(fd, " -h|--help Print this help text\n"); +} + +enum action { + ACTION_NONE, + ACTION_DUMP, + ACTION_DUMPHDRS, + ACTION_GETPAYLOAD, +}; + +int main(int argc, char **argv) +{ + int err, c, idx = 0; + const char *filepath; + enum action action = ACTION_NONE; + int opt_index = -1; + const char *opt_name = NULL; + int opt_raw_payload = 0; + + static struct option long_options[] = { + { "dump", no_argument, 0, 'd', }, + { "headers", no_argument, 0, 'H', }, + { "payload", no_argument, 0, 'p', }, + { "index", required_argument, 0, 'i', }, + { "name", required_argument, 0, 'n', }, + { "raw", no_argument, 0, 'r', }, + { "help", no_argument, 0, 'h', }, + { }, + }; + + while (1) { + c = getopt_long(argc, argv, "dHphi:n:r", + long_options, &idx); + if (c == -1) + break; + switch (c) { + case 'h': + usage(stdout); + return 0; + case 'd': + action = ACTION_DUMP; + break; + case 'H': + action = ACTION_DUMPHDRS; + break; + case 'p': + action = ACTION_GETPAYLOAD; + break; + case 'i': + if (strcasecmp(optarg, "last") == 0) { + opt_index = INDEX_LAST; + } else { + if (sscanf(optarg, "%d", &opt_index) != 1 || opt_index < 0) { + fprintf(stderr, "-i|--index is not a positive integer\n"); + return 1; + } + } + break; + case 'n': + opt_name = optarg; + break; + case 'r': + opt_raw_payload = 1; + break; + default: + return 1; + } + } + argc -= optind; + argv += optind; + if (action == ACTION_NONE) { + fprintf(stderr, "No action specified.\n"); + return 1; + } + if (action == ACTION_GETPAYLOAD) { + if (opt_index < 0 || !opt_name) { + fprintf(stderr, "Required options -i|--index or -n|--name " + "not specified for action -p|--payload\n"); + return 1; + } + } + if (argc != 1) { + usage(stderr); + return 1; + } + filepath = argv[0]; + + switch (action) { + case ACTION_NONE: + break; + case ACTION_DUMP: + case ACTION_DUMPHDRS: + err = dump_image(filepath, opt_index, opt_name, + (action == ACTION_DUMPHDRS), + opt_raw_payload, + stdout); + if (err) + return 1; + break; + case ACTION_GETPAYLOAD: + err = write_payload(filepath, opt_index, opt_name, stdout); + if (err) + return 1; + break; + } + + return 0; +} diff --git a/utils/ccid/Makefile b/utils/ccid/Makefile new file mode 100644 index 0000000..237b50a --- /dev/null +++ b/utils/ccid/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2009-2012 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:=ccid +PKG_VERSION:=1.4.5 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://alioth.debian.org/frs/download.php/3672 +PKG_MD5SUM:=cb9a77194ac335c39b262ea83a5b7d2e + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ccid + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libusb-1.0 +libpcsclite + TITLE:=Generic USB CCID smart card reader driver + URL:=http://pcsclite.alioth.debian.org/ccid.html +endef + +define Package/ccid/description + Generic USB CCID (Chip/Smart Card Interface Devices) driver and ICCD + (Integrated Circuit(s) Card Devices). +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-embedded \ + --enable-usbdropdir=/usr/lib/pcsc/drivers + +define Package/ccid/install + $(INSTALL_DIR) $(1)/usr/lib/pcsc + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pcsc/drivers $(1)/usr/lib/pcsc/ +endef + +$(eval $(call BuildPackage,ccid)) diff --git a/utils/ccrypt/Makefile b/utils/ccrypt/Makefile new file mode 100644 index 0000000..9301205 --- /dev/null +++ b/utils/ccrypt/Makefile @@ -0,0 +1,37 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ccrypt +PKG_VERSION:=1.9 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/ccrypt +PKG_MD5SUM:=c3f78019d7a166dd66f1d4b1390c62c2 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/ccrypt + SECTION:=utils + CATEGORY:=Utilities + TITLE:=ccrypt is a utility for encrypting and decrypting files and streams + URL:=http://ccrypt.sourceforge.net/ +endef + +define Package/ccrypt/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ccrypt $(1)/usr/bin/ + ln -s ccrypt $(1)/usr/bin/ccencrypt + ln -s ccrypt $(1)/usr/bin/ccdecrypt + ln -s ccrypt $(1)/usr/bin/ccat +endef + +$(eval $(call BuildPackage,ccrypt)) diff --git a/utils/ccrypt/patches/001-no-intl.patch b/utils/ccrypt/patches/001-no-intl.patch new file mode 100644 index 0000000..4f24c84 --- /dev/null +++ b/utils/ccrypt/patches/001-no-intl.patch @@ -0,0 +1,104 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -106,17 +106,6 @@ AC_MSG_RESULT($UINT32_TYPE) + AC_DEFINE_UNQUOTED(UINT32_TYPE,$UINT32_TYPE,unsigned 32 bit integer type) + + dnl ---------------------------------------------------------------------- +-dnl Internationalization +- +-GETTEXT_PACKAGE=ccrypt +-AC_SUBST(GETTEXT_PACKAGE) +-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext]) +- +-AM_GNU_GETTEXT +-AM_GNU_GETTEXT_VERSION([0.14.3]) +-IT_PROG_INTLTOOL([0.34.2], [no-xml]) +- +-dnl ---------------------------------------------------------------------- + dnl Libtool (needed by intl/) + + AC_PROG_LIBTOOL +@@ -135,9 +124,7 @@ AC_SUBST(TAR) + + dnl ---------------------------------------------------------------------- + AC_OUTPUT([doc/ccrypt.1 +- po/Makefile.in + m4/Makefile +- intl/Makefile + Makefile + src/Makefile + emacs/Makefile +--- a/Makefile.am ++++ b/Makefile.am +@@ -4,11 +4,10 @@ + + ## Process this file with automake to produce Makefile.in + +-SUBDIRS = m4 po intl src emacs doc check ++SUBDIRS = m4 src emacs doc check + +-EXTRA_DIST = m4/ChangeLog config.rpath README-WIN intltool-extract.in \ +- intltool-merge.in intltool-update.in +-DISTCLEANFILES = intltool-extract intltool-merge intltool-update ++EXTRA_DIST = m4/ChangeLog config.rpath README-WIN ++DISTCLEANFILES = + + + TAR = @TAR@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -37,7 +37,7 @@ build_triplet = @build@ + host_triplet = @host@ + DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ +- $(top_srcdir)/configure $(top_srcdir)/intl/Makefile.in \ ++ $(top_srcdir)/configure \ + ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS config.guess \ + config.rpath config.sub depcomp elisp-comp install-sh \ + ltmain.sh missing mkinstalldirs +@@ -64,7 +64,7 @@ am__CONFIG_DISTCLEAN_FILES = config.stat + configure.lineno configure.status.lineno + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = config.h +-CONFIG_CLEAN_FILES = intl/Makefile ++CONFIG_CLEAN_FILES = + SOURCES = + DIST_SOURCES = + RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ +@@ -251,11 +251,10 @@ sbindir = @sbindir@ + sharedstatedir = @sharedstatedir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ +-SUBDIRS = m4 po intl src emacs doc check +-EXTRA_DIST = m4/ChangeLog config.rpath README-WIN intltool-extract.in \ +- intltool-merge.in intltool-update.in ++SUBDIRS = m4 src emacs doc check ++EXTRA_DIST = m4/ChangeLog config.rpath README-WIN + +-DISTCLEANFILES = intltool-extract intltool-merge intltool-update ++DISTCLEANFILES = + ACLOCAL_AMFLAGS = -I m4 + all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -17,7 +17,7 @@ ccrypt_DEPENDENCIES = @EXTRA_OBJS@ + + localedir = $(datadir)/locale + INCLUDES = -I../intl -I$(top_srcdir)/intl -DLOCALEDIR=\"$(localedir)\" +-LIBS = @LIBINTL@ @LIBS@ ++LIBS = @LIBS@ + + maketables: maketables.c + +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -170,7 +170,7 @@ LDFLAGS = @LDFLAGS@ + LIBICONV = @LIBICONV@ + LIBINTL = @LIBINTL@ + LIBOBJS = @LIBOBJS@ +-LIBS = @LIBINTL@ @LIBS@ ++LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ + LN_S = @LN_S@ + LTLIBICONV = @LTLIBICONV@ diff --git a/utils/cdparanoia/Makefile b/utils/cdparanoia/Makefile new file mode 100644 index 0000000..046e1b3 --- /dev/null +++ b/utils/cdparanoia/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cdparanoia-III +PKG_VERSION:=10.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).src.tgz +PKG_SOURCE_URL:=http://downloads.xiph.org/releases/cdparanoia/ +PKG_SOURCE_TARGETDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_MD5SUM:=b304bbe8ab63373924a744eac9ebc652 + +PKG_BUILD_PARALLEL:=0 + +include $(INCLUDE_DIR)/package.mk + +define Package/cdparanoia + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Cdparanoia + DEPENDS:=+librt + URL:=http://www.xiph.org/paranoia/index.html +endef + +#define Build/Configure +# echo "Build/Configure" +# $(call Build/Configure/Default) +#endef + +#define Build/Compile +#endef + +define Build/InstallDev + echo "Build/InstallDev" +endef + +define Package/cdparanoia/install + echo "package/cdparanoia/install" + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/cdparanoia $(1)/usr/bin +# $(CP) $(PKG_BUILD_DIR)/paranoia/libcdda_paranoia.so.0.$(PKG_VERSION) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/paranoia/libcdda_paranoia.so.* $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/interface/libcdda_interface.so.* $(1)/usr/lib +endef + +$(eval $(call BuildPackage,cdparanoia)) diff --git a/utils/cdparanoia/patches/002-fixbecrash-private-keyword.patch b/utils/cdparanoia/patches/002-fixbecrash-private-keyword.patch new file mode 100644 index 0000000..9cf28fc --- /dev/null +++ b/utils/cdparanoia/patches/002-fixbecrash-private-keyword.patch @@ -0,0 +1,908 @@ +diff -ur cdparanoia-III-10.2/interface/cdda_interface.h cdparanoia/interface/cdda_interface.h +--- cdparanoia-III-10.2/interface/cdda_interface.h 2008-09-11 12:43:52.000000000 +0200 ++++ cdparanoia/interface/cdda_interface.h 2009-01-28 18:02:11.000000000 +0100 +@@ -84,7 +84,7 @@ + int is_atapi; + int is_mmc; + +- cdda_private_data_t *private; ++ cdda_private_data_t *private_data; + void *reserved; + unsigned char inqbytes[4]; + +diff -ur cdparanoia-III-10.2/interface/cooked_interface.c cdparanoia/interface/cooked_interface.c +--- cdparanoia-III-10.2/interface/cooked_interface.c 2008-08-26 11:55:22.000000000 +0200 ++++ cdparanoia/interface/cooked_interface.c 2009-01-28 18:02:11.000000000 +0100 +@@ -13,13 +13,13 @@ + static int timed_ioctl(cdrom_drive *d, int fd, int command, void *arg){ + struct timespec tv1; + struct timespec tv2; +- int ret1=clock_gettime(d->private->clock,&tv1); ++ int ret1=clock_gettime(d->private_data->clock,&tv1); + int ret2=ioctl(fd, command,arg); +- int ret3=clock_gettime(d->private->clock,&tv2); ++ int ret3=clock_gettime(d->private_data->clock,&tv2); + if(ret1<0 || ret3<0){ +- d->private->last_milliseconds=-1; ++ d->private_data->last_milliseconds=-1; + }else{ +- d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; ++ d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; + } + return ret2; + } +diff -ur cdparanoia-III-10.2/interface/interface.c cdparanoia/interface/interface.c +--- cdparanoia-III-10.2/interface/interface.c 2008-09-11 12:43:52.000000000 +0200 ++++ cdparanoia/interface/interface.c 2009-01-28 18:02:11.000000000 +0100 +@@ -39,9 +39,9 @@ + if(d->drive_model)free(d->drive_model); + if(d->cdda_fd!=-1)close(d->cdda_fd); + if(d->ioctl_fd!=-1 && d->ioctl_fd!=d->cdda_fd)close(d->ioctl_fd); +- if(d->private){ +- if(d->private->sg_hd)free(d->private->sg_hd); +- free(d->private); ++ if(d->private_data){ ++ if(d->private_data->sg_hd)free(d->private_data->sg_hd); ++ free(d->private_data); + } + + free(d); +@@ -90,11 +90,11 @@ + } + } + ++ if(d->bigendianp==-1)d->bigendianp=data_bigendianp(d); ++ + if((ret=d->enable_cdda(d,1))) + return(ret); + +- /* d->select_speed(d,d->maxspeed); most drives are full speed by default */ +- if(d->bigendianp==-1)d->bigendianp=data_bigendianp(d); + return(0); + } + +@@ -118,7 +118,7 @@ + if(d->bigendianp==-1) /* not determined yet */ + d->bigendianp=data_bigendianp(d); + +- if(d->bigendianp!=bigendianp()){ ++ if(buffer && d->bigendianp!=bigendianp()){ + int i; + u_int16_t *p=(u_int16_t *)buffer; + long els=sectors*CD_FRAMESIZE_RAW/2; +@@ -127,7 +127,7 @@ + } + } + } +- if(ms)*ms=d->private->last_milliseconds; ++ if(ms)*ms=d->private_data->last_milliseconds; + return(sectors); + } + +diff -ur cdparanoia-III-10.2/interface/scan_devices.c cdparanoia/interface/scan_devices.c +--- cdparanoia-III-10.2/interface/scan_devices.c 2008-08-26 11:55:22.000000000 +0200 ++++ cdparanoia/interface/scan_devices.c 2009-01-28 18:02:11.000000000 +0100 +@@ -264,11 +264,11 @@ + d->interface=COOKED_IOCTL; + d->bigendianp=-1; /* We don't know yet... */ + d->nsectors=-1; +- d->private=calloc(1,sizeof(*d->private)); ++ d->private_data=calloc(1,sizeof(*d->private_data)); + { + /* goddamnit */ + struct timespec tv; +- d->private->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); ++ d->private_data->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); + } + idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",description); + return(d); +@@ -674,15 +674,15 @@ + d->bigendianp=-1; /* We don't know yet... */ + d->nsectors=-1; + d->messagedest = messagedest; +- d->private=calloc(1,sizeof(*d->private)); ++ d->private_data=calloc(1,sizeof(*d->private_data)); + { + /* goddamnit */ + struct timespec tv; +- d->private->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); ++ d->private_data->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); + } + if(use_sgio){ + d->interface=SGIO_SCSI; +- d->private->sg_buffer=(unsigned char *)(d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE)); ++ d->private_data->sg_buffer=(unsigned char *)(d->private_data->sg_hd=malloc(MAX_BIG_BUFF_SIZE)); + g_fd=d->cdda_fd=dup(d->ioctl_fd); + }else{ + version=verify_SG_version(d,messagedest,messages); +@@ -696,8 +696,8 @@ + } + + /* malloc our big buffer for scsi commands */ +- d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE); +- d->private->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF; ++ d->private_data->sg_hd=malloc(MAX_BIG_BUFF_SIZE); ++ d->private_data->sg_buffer=((unsigned char *)d->private_data->sg_hd)+SG_OFF; + } + + { +@@ -772,9 +772,9 @@ + if(i_fd!=-1)close(i_fd); + if(g_fd!=-1)close(g_fd); + if(d){ +- if(d->private){ +- if(d->private->sg_hd)free(d->private->sg_hd); +- free(d->private); ++ if(d->private_data){ ++ if(d->private_data->sg_hd)free(d->private_data->sg_hd); ++ free(d->private_data); + } + free(d); + } +@@ -821,7 +821,7 @@ + d->interface=TEST_INTERFACE; + d->bigendianp=-1; /* We don't know yet... */ + d->nsectors=-1; +- d->private=calloc(1,sizeof(*d->private)); ++ d->private_data=calloc(1,sizeof(*d->private_data)); + d->drive_model=copystring("File based test interface"); + idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",d->drive_model); + +diff -ur cdparanoia-III-10.2/interface/scsi_interface.c cdparanoia/interface/scsi_interface.c +--- cdparanoia-III-10.2/interface/scsi_interface.c 2008-09-11 22:33:30.000000000 +0200 ++++ cdparanoia/interface/scsi_interface.c 2009-01-28 18:02:11.000000000 +0100 +@@ -15,13 +15,13 @@ + static int timed_ioctl(cdrom_drive *d, int fd, int command, void *arg){ + struct timespec tv1; + struct timespec tv2; +- int ret1=clock_gettime(d->private->clock,&tv1); ++ int ret1=clock_gettime(d->private_data->clock,&tv1); + int ret2=ioctl(fd, command,arg); +- int ret3=clock_gettime(d->private->clock,&tv2); ++ int ret3=clock_gettime(d->private_data->clock,&tv2); + if(ret1<0 || ret3<0){ +- d->private->last_milliseconds=-1; ++ d->private_data->last_milliseconds=-1; + }else{ +- d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; ++ d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; + } + return ret2; + } +@@ -96,7 +96,7 @@ + static void clear_garbage(cdrom_drive *d){ + fd_set fdset; + struct timeval tv; +- struct sg_header *sg_hd=d->private->sg_hd; ++ struct sg_header *sg_hd=d->private_data->sg_hd; + int flag=0; + + /* clear out any possibly preexisting garbage */ +@@ -185,7 +185,7 @@ + struct timespec tv2; + int tret1,tret2; + int status = 0; +- struct sg_header *sg_hd=d->private->sg_hd; ++ struct sg_header *sg_hd=d->private_data->sg_hd; + long writebytes=SG_OFF+cmd_len+in_size; + + /* generic scsi device services */ +@@ -195,7 +195,7 @@ + + memset(sg_hd,0,sizeof(sg_hd)); + memset(sense_buffer,0,SG_MAX_SENSE); +- memcpy(d->private->sg_buffer,cmd,cmd_len+in_size); ++ memcpy(d->private_data->sg_buffer,cmd,cmd_len+in_size); + sg_hd->twelve_byte = cmd_len == 12; + sg_hd->result = 0; + sg_hd->reply_len = SG_OFF + out_size; +@@ -209,7 +209,7 @@ + tell if the command failed. Scared yet? */ + + if(bytecheck && out_size>in_size){ +- memset(d->private->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size); ++ memset(d->private_data->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size); + /* the size does not remove cmd_len due to the way the kernel + driver copies buffers */ + writebytes+=(out_size-in_size); +@@ -243,7 +243,7 @@ + } + + sigprocmask (SIG_BLOCK, &(d->sigset), NULL ); +- tret1=clock_gettime(d->private->clock,&tv1); ++ tret1=clock_gettime(d->private_data->clock,&tv1); + errno=0; + status = write(d->cdda_fd, sg_hd, writebytes ); + +@@ -289,7 +289,7 @@ + } + } + +- tret2=clock_gettime(d->private->clock,&tv2); ++ tret2=clock_gettime(d->private_data->clock,&tv2); + errno=0; + status = read(d->cdda_fd, sg_hd, SG_OFF + out_size); + sigprocmask ( SIG_UNBLOCK, &(d->sigset), NULL ); +@@ -313,7 +313,7 @@ + if(bytecheck && in_size+cmd_lenprivate->sg_buffer[i]!=bytefill){ ++ if(d->private_data->sg_buffer[i]!=bytefill){ + flag=1; + break; + } +@@ -326,9 +326,9 @@ + + errno=0; + if(tret1<0 || tret2<0){ +- d->private->last_milliseconds=-1; ++ d->private_data->last_milliseconds=-1; + }else{ +- d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000; ++ d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000; + } + return(0); + } +@@ -347,7 +347,7 @@ + + memset(&hdr,0,sizeof(hdr)); + memset(sense,0,sizeof(sense)); +- memcpy(d->private->sg_buffer,cmd+cmd_len,in_size); ++ memcpy(d->private_data->sg_buffer,cmd+cmd_len,in_size); + + hdr.cmdp = cmd; + hdr.cmd_len = cmd_len; +@@ -355,7 +355,7 @@ + hdr.mx_sb_len = SG_MAX_SENSE; + hdr.timeout = 50000; + hdr.interface_id = 'S'; +- hdr.dxferp = d->private->sg_buffer; ++ hdr.dxferp = d->private_data->sg_buffer; + hdr.flags = SG_FLAG_DIRECT_IO; /* direct IO if we can get it */ + + /* scary buffer fill hack */ +@@ -400,7 +400,7 @@ + if(bytecheck && in_sizeprivate->sg_buffer[i]!=bytefill){ ++ if(d->private_data->sg_buffer[i]!=bytefill){ + flag=1; + break; + } +@@ -412,7 +412,7 @@ + } + + /* Can't rely on .duration because we can't be certain kernel has HZ set to something useful */ +- /* d->private->last_milliseconds = hdr.duration; */ ++ /* d->private_data->last_milliseconds = hdr.duration; */ + + errno = 0; + return 0; +@@ -445,9 +445,9 @@ + + handle_scsi_cmd(d, cmd, 6, 0, 56, 0,0, sense); + +- key = d->private->sg_buffer[2] & 0xf; +- ASC = d->private->sg_buffer[12]; +- ASCQ = d->private->sg_buffer[13]; ++ key = d->private_data->sg_buffer[2] & 0xf; ++ ASC = d->private_data->sg_buffer[12]; ++ ASCQ = d->private_data->sg_buffer[13]; + + if(key == 2 && ASC == 4 && ASCQ == 1) return 0; + return 1; +@@ -492,7 +492,7 @@ + if (handle_scsi_cmd (d, cmd, 10, 0, size+4,'\377',1,sense)) return(1); + + { +- unsigned char *b=d->private->sg_buffer; ++ unsigned char *b=d->private_data->sg_buffer; + if(b[0])return(1); /* Handles only up to 256 bytes */ + if(b[6])return(1); /* Handles only up to 256 bytes */ + +@@ -604,8 +604,8 @@ + static unsigned int get_orig_sectorsize(cdrom_drive *d){ + if(mode_sense(d,12,0x01))return(-1); + +- d->orgdens = d->private->sg_buffer[4]; +- return(d->orgsize = ((int)(d->private->sg_buffer[10])<<8)+d->private->sg_buffer[11]); ++ d->orgdens = d->private_data->sg_buffer[4]; ++ return(d->orgsize = ((int)(d->private_data->sg_buffer[10])<<8)+d->private_data->sg_buffer[11]); + } + + /* switch CDROM scsi drives to given sector size */ +@@ -664,8 +664,8 @@ + return(-4); + } + +- first=d->private->sg_buffer[2]; +- last=d->private->sg_buffer[3]; ++ first=d->private_data->sg_buffer[2]; ++ last=d->private_data->sg_buffer[3]; + tracks=last-first+1; + + if (last > MAXTRK || first > MAXTRK || last<0 || first<0) { +@@ -683,7 +683,7 @@ + return(-5); + } + { +- scsi_TOC *toc=(scsi_TOC *)(d->private->sg_buffer+4); ++ scsi_TOC *toc=(scsi_TOC *)(d->private_data->sg_buffer+4); + + d->disc_toc[i-first].bFlags=toc->bFlags; + d->disc_toc[i-first].bTrack=i; +@@ -704,7 +704,7 @@ + return(-2); + } + { +- scsi_TOC *toc=(scsi_TOC *)(d->private->sg_buffer+4); ++ scsi_TOC *toc=(scsi_TOC *)(d->private_data->sg_buffer+4); + + d->disc_toc[i-first].bFlags=toc->bFlags; + d->disc_toc[i-first].bTrack=0xAA; +@@ -738,7 +738,7 @@ + } + + /* copy to our structure and convert start sector */ +- tracks = d->private->sg_buffer[1]; ++ tracks = d->private_data->sg_buffer[1]; + if (tracks > MAXTRK) { + cderror(d,"003: CDROM reporting illegal number of tracks\n"); + return(-3); +@@ -754,33 +754,33 @@ + return(-5); + } + +- d->disc_toc[i].bFlags = d->private->sg_buffer[10]; ++ d->disc_toc[i].bFlags = d->private_data->sg_buffer[10]; + d->disc_toc[i].bTrack = i + 1; + + d->disc_toc[i].dwStartSector= d->adjust_ssize * +- (((signed char)(d->private->sg_buffer[2])<<24) | +- (d->private->sg_buffer[3]<<16)| +- (d->private->sg_buffer[4]<<8)| +- (d->private->sg_buffer[5])); ++ (((signed char)(d->private_data->sg_buffer[2])<<24) | ++ (d->private_data->sg_buffer[3]<<16)| ++ (d->private_data->sg_buffer[4]<<8)| ++ (d->private_data->sg_buffer[5])); + } + + d->disc_toc[i].bFlags = 0; + d->disc_toc[i].bTrack = i + 1; +- memcpy (&foo, d->private->sg_buffer+2, 4); +- memcpy (&bar, d->private->sg_buffer+6, 4); ++ memcpy (&foo, d->private_data->sg_buffer+2, 4); ++ memcpy (&bar, d->private_data->sg_buffer+6, 4); + d->disc_toc[i].dwStartSector = d->adjust_ssize * (be32_to_cpu(foo) + + be32_to_cpu(bar)); + + d->disc_toc[i].dwStartSector= d->adjust_ssize * +- ((((signed char)(d->private->sg_buffer[2])<<24) | +- (d->private->sg_buffer[3]<<16)| +- (d->private->sg_buffer[4]<<8)| +- (d->private->sg_buffer[5]))+ ++ ((((signed char)(d->private_data->sg_buffer[2])<<24) | ++ (d->private_data->sg_buffer[3]<<16)| ++ (d->private_data->sg_buffer[4]<<8)| ++ (d->private_data->sg_buffer[5]))+ + +- ((((signed char)(d->private->sg_buffer[6])<<24) | +- (d->private->sg_buffer[7]<<16)| +- (d->private->sg_buffer[8]<<8)| +- (d->private->sg_buffer[9])))); ++ ((((signed char)(d->private_data->sg_buffer[6])<<24) | ++ (d->private_data->sg_buffer[7]<<16)| ++ (d->private_data->sg_buffer[8]<<8)| ++ (d->private_data->sg_buffer[9])))); + + + d->cd_extra = FixupTOC(d,tracks+1); +@@ -817,7 +817,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -836,7 +836,7 @@ + cmd[9] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -854,7 +854,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -872,7 +872,7 @@ + cmd[9] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -890,7 +890,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -908,7 +908,7 @@ + cmd[9] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -922,7 +922,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -936,7 +936,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -950,7 +950,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -964,7 +964,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -978,7 +978,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -992,7 +992,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -1026,7 +1026,7 @@ + + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -1039,7 +1039,7 @@ + + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -1052,7 +1052,7 @@ + + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -1275,7 +1275,7 @@ + static int count_2352_bytes(cdrom_drive *d){ + long i; + for(i=2351;i>=0;i--) +- if(d->private->sg_buffer[i]!=(unsigned char)'\177') ++ if(d->private_data->sg_buffer[i]!=(unsigned char)'\177') + return(((i+3)>>2)<<2); + + return(0); +@@ -1284,7 +1284,7 @@ + static int verify_nonzero(cdrom_drive *d){ + long i,flag=0; + for(i=0;i<2352;i++) +- if(d->private->sg_buffer[i]!=0){ ++ if(d->private_data->sg_buffer[i]!=0){ + flag=1; + break; + } +@@ -1298,7 +1298,7 @@ + + static int verify_read_command(cdrom_drive *d){ + int i,j,k; +- int audioflag=0; ++ int audioflag=1; + + int (*enablecommand) (struct cdrom_drive *d, int speed); + long (*readcommand) (struct cdrom_drive *d, void *p, long begin, +@@ -1313,7 +1313,7 @@ + for data */ + + if(d->enable_cdda(d,1)==0){ +- ++ audioflag=0; + for(i=1;i<=d->tracks;i++){ + if(cdda_track_audiop(d,i)==1){ + long firstsector=cdda_track_firstsector(d,i); +@@ -1358,115 +1358,111 @@ + /* NEC test must come before sony; the nec drive expects d8 to be + 10 bytes, and a 12 byte verson (Sony) crashes the drive */ + +- for(j=0;j<15;j++){ +- int densitypossible=1; +- +- switch(j){ ++ for(i=0;i<5;i++){ ++ switch(i){ + case 0: +- d->read_audio=scsi_read_28; +- rs="28 0x,00"; ++ d->density=0; ++ d->enable_cdda=Dummy; ++ es="none "; + break; + case 1: +- d->read_audio=scsi_read_A8; +- rs="a8 0x,00"; ++ d->density=0; ++ d->enable_cdda=scsi_enable_cdda; ++ es="yes/0x00"; + break; +- + case 2: +- d->read_audio=scsi_read_mmcB; +- rs="be 02,10"; +- densitypossible=0; ++ d->density=0x04; ++ d->enable_cdda=scsi_enable_cdda; ++ es="yes/0x04"; + break; + case 3: +- d->read_audio=scsi_read_mmc2B; +- rs="be 02,f8"; +- densitypossible=0; ++ d->density=0x82; ++ d->enable_cdda=scsi_enable_cdda; ++ es="yes/0x82"; + break; + case 4: +- d->read_audio=scsi_read_mmc3B; +- rs="be 06,f8"; +- densitypossible=0; +- break; +- +- case 5: +- d->read_audio=scsi_read_mmc; +- rs="be 00,10"; +- densitypossible=0; +- break; +- case 6: +- d->read_audio=scsi_read_mmc2; +- rs="be 00,f8"; +- densitypossible=0; +- break; +- case 7: +- d->read_audio=scsi_read_mmc3; +- rs="be 04,f8"; +- densitypossible=0; +- break; +- +- case 8: +- d->read_audio=scsi_read_msf; +- rs="b9 00,10"; +- densitypossible=0; +- break; +- case 9: +- d->read_audio=scsi_read_msf2; +- rs="b9 00,f8"; +- densitypossible=0; +- break; +- case 10: +- d->read_audio=scsi_read_msf3; +- rs="b9 04,f8"; +- densitypossible=0; +- break; +- +- case 11: +- d->read_audio=scsi_read_D4_10; +- rs="d4(10)0x"; +- break; +- case 12: +- d->read_audio=scsi_read_D4_12; +- rs="d4(12)0x"; +- break; +- case 13: +- d->read_audio=scsi_read_D5; +- rs="d5 0x,00"; +- break; +- case 14: +- d->read_audio=scsi_read_D8; +- rs="d8 0x,00"; ++ d->density=0x81; ++ d->enable_cdda=scsi_enable_cdda; ++ es="yes/0x81"; + break; + } +- +- for(i=0;i<5;i++){ +- switch(i){ ++ ++ for(j=0;j<15;j++){ ++ ++ switch(j){ + case 0: +- d->density=0; +- d->enable_cdda=Dummy; +- es="none "; +- if(!densitypossible)i=5; /* short circuit MMC style commands */ ++ d->read_audio=scsi_read_28; ++ rs="28 0x,00"; + break; + case 1: +- d->density=0; +- d->enable_cdda=scsi_enable_cdda; +- es="yes/0x00"; ++ d->read_audio=scsi_read_A8; ++ rs="a8 0x,00"; + break; ++ ++ /* 2 through 10 do not allow/require density */ + case 2: +- d->density=0x04; +- d->enable_cdda=scsi_enable_cdda; +- es="yes/0x04"; +- break; ++ d->read_audio=scsi_read_mmcB; ++ rs="be 02,10"; ++ if(i==0)break; + case 3: +- d->density=0x82; +- d->enable_cdda=scsi_enable_cdda; +- es="yes/0x82"; +- break; ++ j=3; ++ d->read_audio=scsi_read_mmc2B; ++ rs="be 02,f8"; ++ if(i==0)break; + case 4: +- d->density=0x81; +- d->enable_cdda=scsi_enable_cdda; +- es="yes/0x81"; ++ j=4; ++ d->read_audio=scsi_read_mmc3B; ++ rs="be 06,f8"; ++ if(i==0)break; ++ case 5: ++ j=5; ++ d->read_audio=scsi_read_mmc; ++ rs="be 00,10"; ++ if(i==0)break; ++ case 6: ++ j=6; ++ d->read_audio=scsi_read_mmc2; ++ rs="be 00,f8"; ++ if(i==0)break; ++ case 7: ++ j=7; ++ d->read_audio=scsi_read_mmc3; ++ rs="be 04,f8"; ++ if(i==0)break; ++ case 8: ++ j=8; ++ d->read_audio=scsi_read_msf; ++ rs="b9 00,10"; ++ if(i==0)break; ++ case 9: ++ j=9; ++ d->read_audio=scsi_read_msf2; ++ rs="b9 00,f8"; ++ if(i==0)break; ++ case 10: ++ j=10; ++ d->read_audio=scsi_read_msf3; ++ rs="b9 04,f8"; ++ if(i==0)break; ++ ++ case 11: ++ d->read_audio=scsi_read_D4_10; ++ rs="d4(10)0x"; ++ break; ++ case 12: ++ d->read_audio=scsi_read_D4_12; ++ rs="d4(12)0x"; ++ break; ++ case 13: ++ d->read_audio=scsi_read_D5; ++ rs="d5 0x,00"; ++ break; ++ case 14: ++ d->read_audio=scsi_read_D8; ++ rs="d8 0x,00"; + break; + } +- ++ + cdmessage(d,"\ttest -> density: ["); + cdmessage(d,es); + cdmessage(d,"] command: ["); +@@ -1525,21 +1521,21 @@ + if(zeroflag){ + char buffer[256]; + sprintf(buffer,"\t\tDrive returned %d packet(s), but contents\n" +- "\t\twere entirely zero\n",zeroflag); ++ "\t\twere entirely zero\n",zeroflag); + cdmessage(d,buffer); + } + } + } + } +- ++ + /* D'oh. */ + d->density=density; + d->read_audio=readcommand; + d->enable_cdda=enablecommand; +- ++ + cdmessage(d,"\tUnable to find any suitable command set from probe;\n" + "\tdrive probably not CDDA capable.\n"); +- ++ + cderror(d,"006: Could not read any data from drive\n"); + + } +@@ -1625,7 +1621,7 @@ + d->is_mmc=0; + if(mode_sense(d,22,0x2A)==0){ + +- b=d->private->sg_buffer; ++ b=d->private_data->sg_buffer; + b+=b[3]+4; + + if((b[0]&0x3F)==0x2A){ +@@ -1673,7 +1669,7 @@ + cderror(d,"008: Unable to identify CDROM model\n"); + return(NULL); + } +- return (d->private->sg_buffer); ++ return (d->private_data->sg_buffer); + } + + int scsi_init_drive(cdrom_drive *d){ +@@ -1690,33 +1686,20 @@ + if(d->is_atapi)d->lun=0; /* it should already be; just to make sure */ + + if(d->is_mmc){ +- + d->read_audio = scsi_read_mmc2B; + d->bigendianp=0; +- + check_exceptions(d,mmc_list); +- + }else{ +- + if(d->is_atapi){ + /* Not MMC maybe still uses 0xbe */ +- + d->read_audio = scsi_read_mmc2B; + d->bigendianp=0; +- + check_exceptions(d,atapi_list); +- + }else{ +- + check_exceptions(d,scsi_list); +- + } + } + +- if(!d->is_atapi)set_sectorsize(d,2048); /* we really do want the +- sector size at 2048 to begin.*/ +- d->enable_cdda(d,0); +- + d->read_toc = (!memcmp(d->drive_model, "IMS", 3) && !d->is_atapi) ? scsi_read_toc2 : + scsi_read_toc; + d->set_speed = scsi_set_speed; +@@ -1742,8 +1725,8 @@ + check_cache(d); + + d->error_retry=1; +- d->private->sg_hd=realloc(d->private->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128); +- d->private->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF; ++ d->private_data->sg_hd=realloc(d->private_data->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128); ++ d->private_data->sg_buffer=((unsigned char *)d->private_data->sg_hd)+SG_OFF; + d->report_all=1; + return(0); + } +diff -ur cdparanoia-III-10.2/interface/test_interface.c cdparanoia/interface/test_interface.c +--- cdparanoia-III-10.2/interface/test_interface.c 2008-09-11 22:33:30.000000000 +0200 ++++ cdparanoia/interface/test_interface.c 2009-01-28 18:02:11.000000000 +0100 +@@ -66,9 +66,9 @@ + if(!fd)fd=fdopen(d->cdda_fd,"r"); + + if(beginprivate->last_milliseconds=20; ++ d->private_data->last_milliseconds=20; + else +- d->private->last_milliseconds=sectors; ++ d->private_data->last_milliseconds=sectors; + + #ifdef CDDA_TEST_UNDERRUN + sectors-=1; +diff -ur cdparanoia-III-10.2/main.c cdparanoia/main.c +--- cdparanoia-III-10.2/main.c 2008-09-11 23:11:02.000000000 +0200 ++++ cdparanoia/main.c 2009-01-28 18:02:11.000000000 +0100 +@@ -746,7 +746,7 @@ + break; + case 'p': + output_type=0; +- output_endian=-1; ++ output_endian=bigendianp(); + break; + case 'r': + output_type=0; +diff -ur cdparanoia-III-10.2/version.h cdparanoia/version.h +--- cdparanoia-III-10.2/version.h 2008-09-11 22:33:30.000000000 +0200 ++++ cdparanoia/version.h 2009-01-28 18:02:11.000000000 +0100 +@@ -1,11 +1,11 @@ + /****************************************************************** + * CopyPolicy: GNU Public License 2 applies + * +- * cdda_paranoia generation III release 10.2 ++ * cdda_paranoia generation III release 10.3 + * Copyright (C) 2008 Monty monty@xiph.org + * + ******************************************************************/ + + +-#define VERSIONNUM "10.2" +-#define VERSION "cdparanoia III release " VERSIONNUM " (September 11, 2008)\n" ++#define VERSIONNUM "10.3pre" ++#define VERSION "cdparanoia III release " VERSIONNUM " (September 16, 2008)\n" diff --git a/utils/cdparanoia/patches/010-fix_configure.patch b/utils/cdparanoia/patches/010-fix_configure.patch new file mode 100644 index 0000000..3fa76a0 --- /dev/null +++ b/utils/cdparanoia/patches/010-fix_configure.patch @@ -0,0 +1,40 @@ +Index: cdparanoia-10.2/Makefile.in +=================================================================== +--- cdparanoia-10.2.orig/Makefile.in 2008-11-06 15:17:28.000000000 +0100 ++++ cdparanoia-10.2/Makefile.in 2008-11-06 15:19:12.000000000 +0100 +@@ -8,12 +8,12 @@ + srcdir=@srcdir@ + + @SET_MAKE@ +-FLAGS=@TYPESIZES@ @CFLAGS@ +-OPT=@OPT@ $(FLAGS) +-DEBUG=@DEBUG@ $(FLAGS) ++#FLAGS=@TYPESIZES@ @CFLAGS@ ++#OPT=@OPT@ $(FLAGS) ++#DEBUG=@DEBUG@ $(FLAGS) + CC=@CC@ + LD=@CC@ +-LDFLAGS=@LDFLAGS@ $(FLAGS) ++LDFLAGS=@LDFLAGS@ + AR=@AR@ + RANLIB=@RANLIB@ + INSTALL=@INSTALL@ +@@ -43,7 +43,8 @@ + all: + cd interface && $(MAKE) all + cd paranoia && $(MAKE) all +- $(MAKE) cdparanoia CFLAGS="$(OPT)" ++ $(MAKE) cdparanoia ++#CFLAGS="$(OPT)" + + debug: + cd interface && $(MAKE) debug +@@ -87,7 +88,7 @@ + $(LIBDIR)/libcdda_paranoia.so + + cdparanoia: $(OFILES) $(LIBDEP) +- $(LD) $(CFLAGS) $(LDFLAGS) $(OFILES) \ ++ $(CC) $(CFLAGS) $(LDFLAGS) $(OFILES) \ + -L$(PWD)/paranoia -L$(PWD)/interface \ + -o cdparanoia $(LIBS) + diff --git a/utils/cksfv/Makefile b/utils/cksfv/Makefile new file mode 100644 index 0000000..ca40189 --- /dev/null +++ b/utils/cksfv/Makefile @@ -0,0 +1,36 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cksfv +PKG_VERSION:=1.3.14 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://zakalwe.fi/~shd/foss/cksfv/files +PKG_MD5SUM:=2e15289753ea0b90b6ea86993f93b383 + +include $(INCLUDE_DIR)/package.mk + +define Package/cksfv + SECTION:=utils + CATEGORY:=Utilities + TITLE:=cksfv CRC32 checksum verification tool + URL:=http://zakalwe.fi/~shd/foss/cksfv/ +endef + +define Package/cksfv/description + cksfv is a tool for verifying CRC32 checksums. +endef + +define Package/cksfv/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/cksfv $(1)/usr/sbin/cksfv +endef + +$(eval $(call BuildPackage,cksfv)) diff --git a/utils/clish/Makefile b/utils/clish/Makefile new file mode 100644 index 0000000..f1774e5 --- /dev/null +++ b/utils/clish/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2012 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:=clish +PKG_VERSION:=0.7.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=81e20f7a888bcd8e2280e37804d342e4 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/clish + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libstdcpp +libpthread + TITLE:=Command Line Interface SHell + URL:=http://clish.sourceforge.net/ +endef + +define Package/clish/description + A modular framework for implementing a CISCO-like CLI on a *NIX system. + Arbitary command menus and actions can be defined using XML files. + This software handles the user interaction, + and forks the appropriate system commands to perform any actions. +endef + +CONFIGURE_VARS += \ + ac_cv_header_bfd_h=no + +MAKE_FLAGS += \ + bin_PROGRAMS=bin/clish + +define Package/clish/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/etc/clish + $(CP) $(PKG_BUILD_DIR)/xml-examples/*.xml $(1)/etc/clish/ +endef + +$(eval $(call BuildPackage,clish)) diff --git a/utils/cmdpad/Makefile b/utils/cmdpad/Makefile new file mode 100644 index 0000000..6b33e8b --- /dev/null +++ b/utils/cmdpad/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2007-2011 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:=cmdpad +PKG_VERSION:=0.0.3 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/cmdpad +PKG_MD5SUM:=6633b2354b7f23f9cd8e2bfb6e735965 + +include $(INCLUDE_DIR)/package.mk + +define Package/cmdpad + SECTION:=utils + CATEGORY:=Utilities + TITLE:=execute commands when a key is pressed, released or hold down + URL:=http://cmdpad.sourceforge.net/index.php +endef + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared + +define Package/cmdpad/description + cmdpad - execute commands when a key is pressed, released or hold down. + Should be started from /etc/rc or /etc/rc.local. To run it as deamon you + need to start it with '&'. All logs are printed to standard out and standard + error (to write the log to disk use cmdpad > /var/log/cmdpad). Cmdpad + searches for /etc/cmdpad.conf and load the key bindings. Then wait for + key event and check each command to see if it should be run. +endef + +MAKE_FLAGS += \ + $(TARGET_CONFIGURE_OPTS) \ + $(1) + +define Package/cmdpad/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/cmdpad $(1)/usr/sbin/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/cmdpad.conf $(1)/etc/ + $(INSTALL_BIN) ./files/cmdpad.init $(1)/etc/init.d/cmdpad +endef + +define Package/cmdpad/conffiles +/etc/cmdpad.conf +endef + +$(eval $(call BuildPackage,cmdpad)) diff --git a/utils/cmdpad/files/cmdpad.init b/utils/cmdpad/files/cmdpad.init new file mode 100644 index 0000000..f612033 --- /dev/null +++ b/utils/cmdpad/files/cmdpad.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=93 + +SSD_DAEMONIZE=1 + +start() { + service_start /usr/sbin/cmdpad --quiet +} + +stop() { + service_stop /usr/sbin/cmdpad +} diff --git a/utils/cmdpad/patches/100-Makefile.patch b/utils/cmdpad/patches/100-Makefile.patch new file mode 100644 index 0000000..61a6c8f --- /dev/null +++ b/utils/cmdpad/patches/100-Makefile.patch @@ -0,0 +1,35 @@ +--- cmdpad-0.0.3/src/Makefile.orig 2008-01-05 23:29:44.000000000 +0100 ++++ cmdpad-0.0.3/src/Makefile 2008-01-05 23:30:23.000000000 +0100 +@@ -5,25 +5,25 @@ + TOP=.. + include $(TOP)/Makefile.common + +-INCLUDE= -I/usr/include +-LIBS= -L/usr/lib -lc +-CFLAGS= -g3 +-LDFLAGS= -Xlinker -Map -Xlinker $(PROG).map #,--stack,16Mb ++#INCLUDE= -I/usr/include ++#LIBS= -L/usr/lib -lc ++#CFLAGS= -g3 ++#LDFLAGS= -Xlinker -Map -Xlinker $(PROG).map #,--stack,16Mb + OBJ= main.o command.o parse.o + SCRIPTS= *.sh + + build: $(PROG) + + $(PROG): $(OBJ) +- gcc -o $(PROG) $(OBJ) $(LIBS) $(LDFLAGS) ++ $(GCC) -o $(PROG) $(OBJ) $(LIBS) $(LDFLAGS) + @echo "===============================================" + @echo "edit $(PROG).conf file to set default preferences" + + %.o : %.c +- gcc $(CFLAGS) -D__COPYLEFT__='$(COPYLEFT)' -c $< ++ $(GCC) $(CFLAGS) -D__COPYLEFT__='$(COPYLEFT)' -c $< + + %.o : %.c %.h +- gcc $(CFLAGS) -D__COPYLEFT__='$(COPYLEFT)' -c $< ++ $(GCC) $(CFLAGS) -D__COPYLEFT__='$(COPYLEFT)' -c $< + + distclean clean: + rm $(PROG) *~ *.o -vf diff --git a/utils/cmdpad/patches/120-kernel26-compat.patch b/utils/cmdpad/patches/120-kernel26-compat.patch new file mode 100644 index 0000000..eb7beeb --- /dev/null +++ b/utils/cmdpad/patches/120-kernel26-compat.patch @@ -0,0 +1,15 @@ +--- cmdpad-0.0.3/src/parse.orig 2008-01-05 23:55:32.000000000 +0100 ++++ cmdpad-0.0.3/src/parse.c 2008-01-05 23:56:07.000000000 +0100 +@@ -289,6 +289,12 @@ + pchEventDevice = strdup( pchValue) ; + return 1 ; + } ++ if( (pchValue != NULL) && ++ (strncmp( pchValue, "/dev/event", 6) == 0) ) ++ { ++ pchEventDevice = strdup( pchValue) ; ++ return 1 ; ++ } + printf( "Option 'device' expects a /dev/input/eventX argument\n"); + return -1 ; + } diff --git a/utils/cmdpad/patches/130-no_zombie.patch b/utils/cmdpad/patches/130-no_zombie.patch new file mode 100644 index 0000000..aa4fc6a --- /dev/null +++ b/utils/cmdpad/patches/130-no_zombie.patch @@ -0,0 +1,18 @@ +--- cmdpad-0.0.3/src/command.c.orig 2003-03-29 17:54:12.000000000 +0100 ++++ cmdpad-0.0.3/src/command.c 2008-01-12 05:41:22.000000000 +0100 +@@ -68,6 +68,7 @@ + + void exec( char * command) + { ++ int status; + if( fork() == 0) { + char ** tmp ; + int i ; +@@ -88,6 +89,7 @@ + perror( "ERROR: execv") ; + exit( 1) ; + } // end if( fork()) ++ wait(&status); + } + + int getNumberofEntry() diff --git a/utils/cmdpad/patches/140-compile_fix.patch b/utils/cmdpad/patches/140-compile_fix.patch new file mode 100644 index 0000000..c7a9bb3 --- /dev/null +++ b/utils/cmdpad/patches/140-compile_fix.patch @@ -0,0 +1,11 @@ +--- a/src/parse.c ++++ b/src/parse.c +@@ -125,7 +125,7 @@ int readCommandLine( int argc, char *arg + + d2printf( "command line command %s found\n", pchCommandTranslations[ iCmd+1]) ; + +- vsnprintf( achCommand, sizeof( achCommand), ++ snprintf( achCommand, sizeof( achCommand), + pchCommandTranslations[ iCmd+1], + &argv[ i+1]) ; + diff --git a/utils/collectd/Makefile b/utils/collectd/Makefile new file mode 100644 index 0000000..84d3f44 --- /dev/null +++ b/utils/collectd/Makefile @@ -0,0 +1,310 @@ +# +# Copyright (C) 2006-2012 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:=collectd +PKG_VERSION:=4.10.7 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://collectd.org/files/ +PKG_MD5SUM:=f4193fdb5002ddac8159c88032a726bc + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4 + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +COLLECTD_PLUGINS_DISABLED:= \ + apple_sensors \ + battery \ + cpufreq \ + curl_json \ + entropy \ + genericjmx \ + gmond \ + hddtemp \ + ipmi \ + ipvs \ + java \ + libvirt \ + mbmon \ + memcachec \ + memcached \ + monitorus \ + multimeter \ + netapp \ + nfs \ + notify_desktop \ + notify_email \ + openvz \ + oracle \ + perl \ + pinba \ + python \ + routeros \ + rrdcached \ + serial \ + swap \ + tape \ + tokyotyrant \ + uuid \ + vserver \ + xmms \ + zfs_arc \ + +COLLECTD_PLUGINS_SELECTED:= \ + apache \ + apcups \ + ascent \ + bind \ + conntrack \ + contextswitch \ + cpu \ + csv \ + curl \ + dbi \ + df \ + disk \ + dns \ + email \ + exec \ + filecount \ + fscache \ + interface \ + iptables \ + irq \ + iwinfo \ + load \ + logfile \ + madwifi \ + memory \ + modbus \ + mysql \ + netlink \ + network \ + nginx \ + ntpd \ + nut \ + olsrd \ + onewire \ + openvpn \ + ping \ + postgresql \ + powerdns \ + processes \ + protocols \ + rrdtool \ + sensors \ + snmp \ + syslog \ + tail \ + table \ + ted \ + tcpconns \ + teamspeak2 \ + thermal \ + unixsock \ + uptime \ + users \ + vmem \ + wireless \ + write_http \ + +PKG_CONFIG_DEPENDS:= \ + $(patsubst %,CONFIG_PACKAGE_collectd-mod-%,$(subst _,-,$(COLLECTD_PLUGINS_SELECTED))) \ + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/kernel.mk + +define Package/collectd/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Lightweight system statistics collection daemon + URL:=http://verplant.org/collectd/ +endef + +define Package/collectd +$(call Package/collectd/Default) + DEPENDS:= +libpthread +zlib +libltdl +libip4tc + MENU:=1 +endef + +define Package/collectd/description + collectd is a small daemon which collects system information periodically + and provides mechanismns to store the values in a variety of ways. +endef + +ifneq ($(CONFIG_avr32),) + TARGET_CFLAGS += -fsigned-char +endif + +# common configure args +CONFIGURE_ARGS+= \ + --disable-debug \ + --enable-daemon \ + --enable-getifaddrs \ + --with-nan-emulation \ + --without-libgcrypt + +CONFIGURE_VARS+= \ + CFLAGS="$$$$CFLAGS $(FPIC)" \ + LDFLAGS="$$$$LDFLAGS -lm -lz" \ + KERNEL_DIR="$(LINUX_DIR)" \ + +CONFIGURE_PLUGIN= \ + $(foreach m, $(1), \ + $(if $(CONFIG_PACKAGE_collectd-mod-$(subst _,-,$(m))),--enable-$(m),--disable-$(m)) \ + ) + +CONFIGURE_ARGS+= \ + $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_SELECTED)) \ + $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_DISABLED)) \ + +# exception: mod-ascent needs libxml2 +ifneq ($(CONFIG_PACKAGE_collectd-mod-ascent),) + CONFIGURE_VARS+= \ + CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/libxml2" +endif + +ifneq ($(CONFIG_BIG_ENDIAN),) + CONFIGURE_ARGS+= --with-fp-layout=endianflip +else + CONFIGURE_ARGS+= --with-fp-layout=nothing +endif + +ifneq ($(CONFIG_PACKAGE_collectd-mod-postgresql),) + CONFIGURE_ARGS+= --with-libpq="$(STAGING_DIR)/usr/" +endif + +ifneq ($(CONFIG_PACKAGE_collectd-mod-mysql),) + CONFIGURE_ARGS+= --with-libmysql="$(STAGING_DIR)/usr/" +endif + +# exception: mod-netlink needs libnetlink from iproute +ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink),) + CONFIGURE_ARGS+= --with-libnetlink="$(STAGING_DIR)/usr" +endif + +# exception: mod-modbus needs libmodbus +ifneq ($(CONFIG_PACKAGE_collectd-mod-modbus),) + CONFIGURE_ARGS+= --with-libmodbus="$(STAGING_DIR)/usr" +endif + +# exception: mod-onewire needs libow-capi +ifneq ($(CONFIG_PACKAGE_collectd-mod-onewire),) + CONFIGURE_ARGS+= --with-libowcapi="$(STAGING_DIR)/usr" +endif + +# exception: mod-rrdtool needs rrdtool-1.0.x +ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool),) + CONFIGURE_ARGS+= --with-librrd="$(STAGING_DIR)/usr/lib/rrdtool-1.0" +endif + +define Package/collectd/conffiles +/etc/collectd.conf +endef + +define Package/collectd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/share/collectd + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/collectd/types.db $(1)/usr/share/collectd/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/collectd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/collectd.init $(1)/etc/init.d/collectd +endef + +# 1: plugin name +# 2: plugin title/description +# 3: files +# 4: extra dependency +define BuildPlugin + + PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_collectd-mod-$(1) + + define Package/collectd-mod-$(1) + $$(call Package/collectd/Default) + TITLE:=$(2) plugin + DEPENDS:= collectd $(4) + endef + + define Package/collectd-mod-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/collectd + for m in $(3); do \ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/collectd/$$$$$$$${m}.so \ + $$(1)/usr/lib/collectd/ ; \ + done + endef + + $$(eval $$(call BuildPackage,collectd-mod-$(1))) + +endef + +$(eval $(call BuildPackage,collectd)) + +#$(eval $(call BuildPlugin,NAME,DESCRIPTION,FILES,DEPENDENCIES)) +$(eval $(call BuildPlugin,apache,apache status input,apache,+PACKAGE_collectd-mod-apache:libcurl)) +$(eval $(call BuildPlugin,apcups,apcups status input,apcups,)) +$(eval $(call BuildPlugin,ascent,ascent status input,ascent,+PACKAGE_collectd-mod-ascent:libcurl +PACKAGE_collectd-mod-ascent:libxml2)) +$(eval $(call BuildPlugin,bind,BIND server/zone input,bind,+PACKAGE_collectd-mod-bind:libcurl +PACKAGE_collectd-mod-bind:libxml2)) +$(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,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)) +$(eval $(call BuildPlugin,df,disk space input,df,)) +$(eval $(call BuildPlugin,disk,disk usage/timing input,disk,)) +$(eval $(call BuildPlugin,dns,DNS traffic input,dns,+PACKAGE_collectd-mod-dns:libpcap)) +$(eval $(call BuildPlugin,email,email output,email,)) +$(eval $(call BuildPlugin,exec,process exec input,exec,)) +$(eval $(call BuildPlugin,filecount,file count input,filecount,)) +$(eval $(call BuildPlugin,fscache,file-system based caching framework input,fscache,)) +$(eval $(call BuildPlugin,interface,network interfaces input,interface,)) +$(eval $(call BuildPlugin,iptables,iptables status input,iptables,+PACKAGE_collectd-mod-iptables:iptables +libiptc)) +$(eval $(call BuildPlugin,irq,interrupt usage input,irq,)) +$(eval $(call BuildPlugin,iwinfo,libiwinfo wireless statistics,iwinfo,+PACKAGE_collectd-mod-iwinfo:libiwinfo)) +$(eval $(call BuildPlugin,load,system load input,load,)) +$(eval $(call BuildPlugin,logfile,log files output,logfile,)) +$(eval $(call BuildPlugin,madwifi,MadWifi status input,madwifi,)) +$(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+PACKAGE_collectd-mod-mysql:libmysqlclient-r)) +$(eval $(call BuildPlugin,memory,physical memory usage input,memory,)) +$(eval $(call BuildPlugin,modbus,read variables through libmodbus,modbus,+PACKAGE_collectd-mod-modbus:libmodbus @BROKEN)) +$(eval $(call BuildPlugin,netlink,netlink input,netlink,+PACKAGE_collectd-mod-netlink:ip)) +$(eval $(call BuildPlugin,network,network input/output,network)) +$(eval $(call BuildPlugin,nginx,nginx status input,nginx,+PACKAGE_collectd-mod-nginx:libcurl)) +$(eval $(call BuildPlugin,ntpd,NTP daemon status input,ntpd,)) +$(eval $(call BuildPlugin,nut,UPS monitoring input,nut,@BROKEN)) +$(eval $(call BuildPlugin,olsrd,OLSRd status input,olsrd,)) +$(eval $(call BuildPlugin,onewire,onewire sensor input,onewire,+PACKAGE_collectd-mod-onewire:libow-capi @BROKEN)) +$(eval $(call BuildPlugin,openvpn,OpenVPN traffic/compression input,openvpn,)) +$(eval $(call BuildPlugin,ping,ping status input,ping,+PACKAGE_collectd-mod-ping:liboping)) +$(eval $(call BuildPlugin,postgresql,PostgreSQL status input,postgresql,+PACKAGE_collectd-mod-postgresql:libpq)) +$(eval $(call BuildPlugin,powerdns,PowerDNS server status input,powerdns,)) +$(eval $(call BuildPlugin,processes,process status input,processes,)) +$(eval $(call BuildPlugin,protocols,network protocols input,protocols,)) +$(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+PACKAGE_collectd-mod-rrdtool:librrd1)) +$(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors @BROKEN)) +$(eval $(call BuildPlugin,snmp,SNMP input,snmp,+PACKAGE_collectd-mod-snmp:libnetsnmp)) +$(eval $(call BuildPlugin,syslog,syslog output,syslog,)) +$(eval $(call BuildPlugin,tail,tail input,tail,)) +$(eval $(call BuildPlugin,table,table-like structured file input,table,)) +$(eval $(call BuildPlugin,teamspeak2,TeamSpeak2 input,teamspeak2,)) +$(eval $(call BuildPlugin,ted,The Energy Detective input,ted,@((!TARGET_avr32)||BROKEN))) # fails on avr32 because of warnings treated as errors +$(eval $(call BuildPlugin,tcpconns,TCP connection tracking input,tcpconns,)) +$(eval $(call BuildPlugin,thermal,system temperatures input,thermal,)) +$(eval $(call BuildPlugin,unixsock,unix socket output,unixsock,)) +$(eval $(call BuildPlugin,uptime,uptime status input,uptime,)) +$(eval $(call BuildPlugin,users,user logged in status input,users,)) +$(eval $(call BuildPlugin,vmem,virtual memory usage input,vmem,)) +$(eval $(call BuildPlugin,wireless,wireless status input,wireless,)) +$(eval $(call BuildPlugin,write-http,HTTP POST output,write_http,+PACKAGE_collectd-mod-write-http:libcurl)) diff --git a/utils/collectd/files/collectd.conf b/utils/collectd/files/collectd.conf new file mode 100644 index 0000000..2ef78fe --- /dev/null +++ b/utils/collectd/files/collectd.conf @@ -0,0 +1,90 @@ +# +# OpenWrt Config file for collectd(1). +# Please read collectd.conf(5) for a list of options. +# http://collectd.org/ +# + +#Hostname "localhost" +#FQDNLookup true +BaseDir "/var/lib/collectd" +PIDFile "/var/run/collectd.pid" +#PluginDir "/usr/lib/collectd" +#TypesDB "/usr/share/collectd/types.db" +Interval 30 +ReadThreads 2 + +#LoadPlugin syslog +#LoadPlugin logfile + +# +# LogLevel info +# + +# +# LogLevel info +# File STDOUT +# Timestamp true +# + +LoadPlugin cpu +LoadPlugin df +LoadPlugin disk +LoadPlugin interface +LoadPlugin load +LoadPlugin memory +LoadPlugin network +#LoadPlugin ping +#LoadPlugin processes +#LoadPlugin rrdtool +#LoadPlugin serial +LoadPlugin wireless + +# +# FSType tmpfs +# IgnoreSelected true +# ReportByDevice false +# ReportReserved false +# ReportInodes false +# + +# +# Disk "/^[hs]d[a-f][0-9]?$/" +# IgnoreSelected false +# + +# +# Interface "eth0" +# Interface "br-lan" +# IgnoreSelected false +# + + +# Server "ff18::efc0:4a42" "25826" + Server "239.192.74.66" "25826" +# Listen "ff18::efc0:4a42" "25826" +# Listen "239.192.74.66" "25826" +# TimeToLive "128" +# Forward false +# CacheFlush 1800 +# ReportStats false + + +# +# Host "host.foo.bar" +# Interval 1.0 +# Timeout 0.9 +# TTL 255 +# SourceAddress "1.2.3.4" +# Device "eth0" +# MaxMissed -1 +# + +# +# Process "name" +# + +# +# DataDir "/var/lib/collectd/rrd" +# CacheTimeout 120 +# CacheFlush 900 +# diff --git a/utils/collectd/files/collectd.init b/utils/collectd/files/collectd.init new file mode 100644 index 0000000..8204c38 --- /dev/null +++ b/utils/collectd/files/collectd.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=80 + +SERVICE_USE_PID=1 + +start() { + mkdir -m 0755 -p /var/lib/collectd + service_start /usr/sbin/collectd +} + +stop() { + service_stop /usr/sbin/collectd +} diff --git a/utils/collectd/patches/001-undefined-AM_PATH_LIBGCRYPT.patch b/utils/collectd/patches/001-undefined-AM_PATH_LIBGCRYPT.patch new file mode 100644 index 0000000..0e01744 --- /dev/null +++ b/utils/collectd/patches/001-undefined-AM_PATH_LIBGCRYPT.patch @@ -0,0 +1,4 @@ +--- /dev/null ++++ b/fake-am_path_libgcrypt.m4 +@@ -0,0 +1 @@ ++AC_DEFUN([AM_PATH_LIBGCRYPT],[:]) diff --git a/utils/collectd/patches/003-remove-werror.patch b/utils/collectd/patches/003-remove-werror.patch new file mode 100644 index 0000000..5a4fb53 --- /dev/null +++ b/utils/collectd/patches/003-remove-werror.patch @@ -0,0 +1,66 @@ +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -7,7 +7,7 @@ SUBDIRS += liboconfig + endif + + if COMPILER_IS_GCC +-AM_CFLAGS = -Wall -Werror ++AM_CFLAGS = -Wall + endif + + AM_CPPFLAGS = -DPREFIX='"${prefix}"' +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -1836,7 +1836,7 @@ top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + SUBDIRS = libcollectdclient $(am__append_1) $(am__append_2) +-@COMPILER_IS_GCC_TRUE@AM_CFLAGS = -Wall -Werror ++@COMPILER_IS_GCC_TRUE@AM_CFLAGS = -Wall + AM_CPPFLAGS = -DPREFIX='"${prefix}"' \ + -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"' \ + -DLOCALSTATEDIR='"${localstatedir}"' \ +--- a/src/libcollectdclient/Makefile.am ++++ b/src/libcollectdclient/Makefile.am +@@ -1,7 +1,7 @@ + AUTOMAKE_OPTIONS = foreign no-dependencies + + if COMPILER_IS_GCC +-AM_CFLAGS = -Wall -Werror ++AM_CFLAGS = -Wall + endif + + pkginclude_HEADERS = client.h lcc_features.h +--- a/src/libcollectdclient/Makefile.in ++++ b/src/libcollectdclient/Makefile.in +@@ -329,7 +329,7 @@ top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AUTOMAKE_OPTIONS = foreign no-dependencies +-@COMPILER_IS_GCC_TRUE@AM_CFLAGS = -Wall -Werror ++@COMPILER_IS_GCC_TRUE@AM_CFLAGS = -Wall + pkginclude_HEADERS = client.h lcc_features.h + lib_LTLIBRARIES = libcollectdclient.la + nodist_pkgconfig_DATA = libcollectdclient.pc +--- a/src/owniptc/Makefile.am ++++ b/src/owniptc/Makefile.am +@@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS = foreign no-dependenci + EXTRA_DIST = libiptc.c README.collectd + + if COMPILER_IS_GCC +-AM_CFLAGS = -Wall -Werror ++AM_CFLAGS = -Wall + endif + + noinst_LTLIBRARIES = libiptc.la +--- a/src/owniptc/Makefile.in ++++ b/src/owniptc/Makefile.in +@@ -298,7 +298,7 @@ top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AUTOMAKE_OPTIONS = foreign no-dependencies + EXTRA_DIST = libiptc.c README.collectd +-@COMPILER_IS_GCC_TRUE@AM_CFLAGS = -Wall -Werror ++@COMPILER_IS_GCC_TRUE@AM_CFLAGS = -Wall + noinst_LTLIBRARIES = libiptc.la + libiptc_la_SOURCES = libip4tc.c libip6tc.c \ + ipt_kernel_headers.h libip6tc.h libiptc.h linux_list.h \ diff --git a/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch b/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch new file mode 100644 index 0000000..ce1daa4 --- /dev/null +++ b/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch @@ -0,0 +1,57 @@ +--- a/src/rrdtool.c ++++ b/src/rrdtool.c +@@ -80,6 +80,7 @@ static const char *config_keys[] = + "HeartBeat", + "RRARows", + "RRATimespan", ++ "RRASingle", + "XFF", + "WritesPerSecond", + "RandomTimeout" +@@ -101,6 +102,8 @@ static rrdcreate_config_t rrdcreate_conf + /* timespans = */ NULL, + /* timespans_num = */ 0, + ++ /* rrasingle = */ 0, ++ + /* consolidation_functions = */ NULL, + /* consolidation_functions_num = */ 0 + }; +@@ -1027,6 +1030,14 @@ static int rrd_config (const char *key, + + free (value_copy); + } ++ else if (strcasecmp ("RRASingle", key) == 0) ++ { ++ if (IS_TRUE (value)) ++ { ++ rrdcreate_config.rrasingle = 1; ++ NOTICE ("rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs"); ++ } ++ } + else if (strcasecmp ("XFF", key) == 0) + { + double tmp = atof (value); +--- a/src/utils_rrdcreate.c ++++ b/src/utils_rrdcreate.c +@@ -122,6 +122,9 @@ static int rra_get (char ***ret, const v + rts_num = rra_timespans_num; + } + ++ if (cfg->rrasingle) ++ rra_types_num = 1; ++ + rra_max = rts_num * rra_types_num; + + if ((rra_def = (char **) malloc ((rra_max + 1) * sizeof (char *))) == NULL) +--- a/src/utils_rrdcreate.h ++++ b/src/utils_rrdcreate.h +@@ -36,6 +36,8 @@ struct rrdcreate_config_s + int *timespans; + size_t timespans_num; + ++ int rrasingle; ++ + char **consolidation_functions; + size_t consolidation_functions_num; + }; diff --git a/utils/collectd/patches/110-net-device-stats.patch b/utils/collectd/patches/110-net-device-stats.patch new file mode 100644 index 0000000..91e73aa --- /dev/null +++ b/utils/collectd/patches/110-net-device-stats.patch @@ -0,0 +1,46 @@ +--- + src/interface.c | 33 ++++++++++++++++++++++++++++++++- + 1 file changed, 32 insertions(+), 1 deletion(-) + +--- a/src/interface.c ++++ b/src/interface.c +@@ -203,7 +203,38 @@ static int interface_read (void) + # define IFA_RX_ERROR rx_errors + # define IFA_TX_ERROR tx_errors + #else +-# error "No suitable type for `struct ifaddrs->ifa_data' found." ++struct net_device_stats { ++ unsigned long rx_packets; ++ unsigned long tx_packets; ++ unsigned long rx_bytes; ++ unsigned long tx_bytes; ++ unsigned long rx_errors; ++ unsigned long tx_errors; ++ unsigned long rx_dropped; ++ unsigned long tx_dropped; ++ unsigned long multicast; ++ unsigned long collisions; ++ unsigned long rx_length_errors; ++ unsigned long rx_over_errors; ++ unsigned long rx_crc_errors; ++ unsigned long rx_frame_errors; ++ unsigned long rx_fifo_errors; ++ unsigned long rx_missed_errors; ++ unsigned long tx_aborted_errors; ++ unsigned long tx_carrier_errors; ++ unsigned long tx_fifo_errors; ++ unsigned long tx_heartbeat_errors; ++ unsigned long tx_window_errors; ++ unsigned long rx_compressed; ++ unsigned long tx_compressed; ++}; ++# define IFA_DATA net_device_stats ++# define IFA_RX_BYTES rx_bytes ++# define IFA_TX_BYTES tx_bytes ++# define IFA_RX_PACKT rx_packets ++# define IFA_TX_PACKT tx_packets ++# define IFA_RX_ERROR rx_errors ++# define IFA_TX_ERROR tx_errors + #endif + + struct IFA_DATA *if_data; diff --git a/utils/collectd/patches/120-fix_kernel_2.6.37.patch b/utils/collectd/patches/120-fix_kernel_2.6.37.patch new file mode 100644 index 0000000..cca445a --- /dev/null +++ b/utils/collectd/patches/120-fix_kernel_2.6.37.patch @@ -0,0 +1,78 @@ +--- a/src/owniptc/libiptc.c ++++ b/src/owniptc/libiptc.c +@@ -81,11 +81,11 @@ static const char *hooknames[] = { + }; + + /* Convenience structures */ +-struct ipt_error_target ++ struct ipt_error_target2 + { + STRUCT_ENTRY_TARGET t; + char error[TABLE_MAXNAMELEN]; +-}; ++}; + + struct chain_head; + struct rule_head; +@@ -1007,10 +1007,10 @@ static int parse_table(TC_HANDLE_T h) + /* Convenience structures */ + struct iptcb_chain_start{ + STRUCT_ENTRY e; +- struct ipt_error_target name; ++ struct ipt_error_target2 name; + }; + #define IPTCB_CHAIN_START_SIZE (sizeof(STRUCT_ENTRY) + \ +- ALIGN(sizeof(struct ipt_error_target))) ++ ALIGN(sizeof(struct ipt_error_target2))) + + struct iptcb_chain_foot { + STRUCT_ENTRY e; +@@ -1021,10 +1021,10 @@ struct iptcb_chain_foot { + + struct iptcb_chain_error { + STRUCT_ENTRY entry; +- struct ipt_error_target target; ++ struct ipt_error_target2 target; + }; + #define IPTCB_CHAIN_ERROR_SIZE (sizeof(STRUCT_ENTRY) + \ +- ALIGN(sizeof(struct ipt_error_target))) ++ ALIGN(sizeof(struct ipt_error_target2))) + + + +@@ -1069,7 +1069,7 @@ static int iptcc_compile_chain(TC_HANDLE + head->e.next_offset = IPTCB_CHAIN_START_SIZE; + strcpy(head->name.t.u.user.name, ERROR_TARGET); + head->name.t.u.target_size = +- ALIGN(sizeof(struct ipt_error_target)); ++ ALIGN(sizeof(struct ipt_error_target2)); + strcpy(head->name.error, c->name); + } else { + repl->hook_entry[c->hooknum-1] = c->head_offset; +@@ -1113,7 +1113,7 @@ static int iptcc_compile_chain_offsets(T + if (!iptcc_is_builtin(c)) { + /* Chain has header */ + *offset += sizeof(STRUCT_ENTRY) +- + ALIGN(sizeof(struct ipt_error_target)); ++ + ALIGN(sizeof(struct ipt_error_target2)); + (*num)++; + } + +@@ -1153,7 +1153,7 @@ static int iptcc_compile_table_prep(TC_H + /* Append one error rule at end of chain */ + num++; + offset += sizeof(STRUCT_ENTRY) +- + ALIGN(sizeof(struct ipt_error_target)); ++ + ALIGN(sizeof(struct ipt_error_target2)); + + /* ruleset size is now in offset */ + *size = offset; +@@ -1177,7 +1177,7 @@ static int iptcc_compile_table(TC_HANDLE + error->entry.target_offset = sizeof(STRUCT_ENTRY); + error->entry.next_offset = IPTCB_CHAIN_ERROR_SIZE; + error->target.t.u.user.target_size = +- ALIGN(sizeof(struct ipt_error_target)); ++ ALIGN(sizeof(struct ipt_error_target2)); + strcpy((char *)&error->target.t.u.user.name, ERROR_TARGET); + strcpy((char *)&error->target.error, "ERROR"); + diff --git a/utils/collectd/patches/130-fix_netlink_kernel_3.3-patch b/utils/collectd/patches/130-fix_netlink_kernel_3.3-patch new file mode 100644 index 0000000..9cb8830 --- /dev/null +++ b/utils/collectd/patches/130-fix_netlink_kernel_3.3-patch @@ -0,0 +1,50 @@ +Index: collectd-4.10.7/src/netlink.c +=================================================================== +--- collectd-4.10.7.orig/src/netlink.c 2012-04-01 16:20:24.000000000 +0200 ++++ collectd-4.10.7/src/netlink.c 2012-06-07 17:22:16.212616882 +0200 +@@ -223,7 +223,7 @@ + + msg = NLMSG_DATA (nmh); + +- msg_len = nmh->nlmsg_len - sizeof (struct ifinfomsg); ++ msg_len = nmh->nlmsg_len - NLMSG_LENGTH(sizeof (struct ifinfomsg)); + if (msg_len < 0) + { + ERROR ("netlink plugin: link_filter: msg_len = %i < 0;", msg_len); +@@ -554,24 +554,19 @@ + + static int ir_read (void) + { +- struct ifinfomsg im; + struct tcmsg tm; + int ifindex; + + static const int type_id[] = { RTM_GETQDISC, RTM_GETTCLASS, RTM_GETTFILTER }; + static const char *type_name[] = { "qdisc", "class", "filter" }; + +- memset (&im, '\0', sizeof (im)); +- im.ifi_type = AF_UNSPEC; +- +- if (rtnl_dump_request (&rth, RTM_GETLINK, &im, sizeof (im)) < 0) ++ if (rtnl_wilddump_request (&rth, AF_UNSPEC, RTM_GETLINK) < 0) + { + ERROR ("netlink plugin: ir_read: rtnl_dump_request failed."); + return (-1); + } + +- if (rtnl_dump_filter (&rth, link_filter, /* arg1 = */ NULL, +- NULL, NULL) != 0) ++ if (rtnl_dump_filter (&rth, link_filter, /* arg1 = */ NULL) != 0) + { + ERROR ("netlink plugin: ir_read: rtnl_dump_filter failed."); + return (-1); +@@ -608,8 +603,7 @@ + continue; + } + +- if (rtnl_dump_filter (&rth, qos_filter, (void *) &ifindex, +- NULL, NULL) != 0) ++ if (rtnl_dump_filter (&rth, qos_filter, (void *) &ifindex) != 0) + { + ERROR ("netlink plugin: ir_read: rtnl_dump_filter failed."); + continue; diff --git a/utils/collectd/patches/200-fix-git-describe-error.patch b/utils/collectd/patches/200-fix-git-describe-error.patch new file mode 100644 index 0000000..09e914a --- /dev/null +++ b/utils/collectd/patches/200-fix-git-describe-error.patch @@ -0,0 +1,11 @@ +--- a/version-gen.sh ++++ b/version-gen.sh +@@ -2,7 +2,7 @@ + + DEFAULT_VERSION="4.10.7.git" + +-VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`" ++#VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`" + + if test -z "$VERSION"; then + VERSION="$DEFAULT_VERSION" diff --git a/utils/collectd/patches/400-fix-olsrd-get-all.patch b/utils/collectd/patches/400-fix-olsrd-get-all.patch new file mode 100644 index 0000000..b49a0e7 --- /dev/null +++ b/utils/collectd/patches/400-fix-olsrd-get-all.patch @@ -0,0 +1,11 @@ +--- a/src/olsrd.c ++++ b/src/olsrd.c +@@ -653,7 +653,7 @@ static int olsrd_read (void) /* {{{ */ + if (fh == NULL) + return (-1); + +- fputs ("\r\n", fh); ++ fputs ("/all \r\n", fh); + fflush (fh); + + while (fgets (buffer, sizeof (buffer), fh) != NULL) diff --git a/utils/collectd/patches/900-add-iwinfo-plugin.patch b/utils/collectd/patches/900-add-iwinfo-plugin.patch new file mode 100644 index 0000000..9894586 --- /dev/null +++ b/utils/collectd/patches/900-add-iwinfo-plugin.patch @@ -0,0 +1,275 @@ +--- a/configure.in ++++ b/configure.in +@@ -490,6 +490,9 @@ AC_CHECK_HEADERS(netinet/if_ether.h, [], + have_termios_h="no" + AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"]) + ++# For the iwinfo plugin ++AC_CHECK_LIB(iwinfo, iwinfo_backend, [with_iwinfo="yes"], [with_iwinfo="no (libiwinfo not found)"], []) ++ + # + # Checks for typedefs, structures, and compiler characteristics. + # +@@ -4008,6 +4011,7 @@ plugin_interface="no" + plugin_ipmi="no" + plugin_ipvs="no" + plugin_irq="no" ++plugin_iwinfo="no" + plugin_libvirt="no" + plugin_load="no" + plugin_memory="no" +@@ -4315,6 +4319,7 @@ AC_PLUGIN([ipmi], [$plugin_ipmi], + AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters]) + AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics]) + AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics]) ++AC_PLUGIN([iwinfo], [$with_iwinfo], [Common iwinfo wireless statistics]) + AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine]) + AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics]) + AC_PLUGIN([load], [$plugin_load], [System load]) +@@ -4593,6 +4598,7 @@ Configuration: + protobuf-c . . . . . $have_protoc_c + oracle . . . . . . . $with_oracle + python . . . . . . . $with_python ++ iwinfo . . . . . . . $with_iwinfo + + Features: + daemon mode . . . . . $enable_daemon +@@ -4632,6 +4638,7 @@ Configuration: + iptables . . . . . . $enable_iptables + ipvs . . . . . . . . $enable_ipvs + irq . . . . . . . . . $enable_irq ++ iwinfo . . . . . . . $enable_iwinfo + java . . . . . . . . $enable_java + libvirt . . . . . . . $enable_libvirt + load . . . . . . . . $enable_load +--- a/src/collectd.conf.in ++++ b/src/collectd.conf.in +@@ -82,6 +82,7 @@ FQDNLookup true + #@BUILD_PLUGIN_IPMI_TRUE@LoadPlugin ipmi + #@BUILD_PLUGIN_IPVS_TRUE@LoadPlugin ipvs + #@BUILD_PLUGIN_IRQ_TRUE@LoadPlugin irq ++#@BUILD_PLUGIN_IWINFO_TRUE@LoadPlugin iwinfo + #@BUILD_PLUGIN_JAVA_TRUE@LoadPlugin java + #@BUILD_PLUGIN_LIBVIRT_TRUE@LoadPlugin libvirt + @BUILD_PLUGIN_LOAD_TRUE@@BUILD_PLUGIN_LOAD_TRUE@LoadPlugin load +@@ -376,6 +377,12 @@ FQDNLookup true + # IgnoreSelected true + # + ++# ++# Interface "ath0" ++# Interface "ra0" ++# Interface "wlan0" ++# ++ + # + # JVMArg "-verbose:jni" + # JVMArg "-Djava.class.path=@prefix@/share/collectd/java/collectd-api.jar" +--- a/src/collectd.conf.pod ++++ b/src/collectd.conf.pod +@@ -1468,6 +1468,27 @@ and all other interrupts are collected. + + =back + ++=head2 Plugin C ++ ++=over 4 ++ ++=item B I ++ ++Select this interface. By default all detected wireless interfaces will be ++collected. For a more detailed description see B below. ++ ++=item B I|I ++ ++If no configuration if given, the B-plugin will collect data from all ++detected wireless interfaces. You can use the B-option to pick the ++interfaces you're interested in. Sometimes, however, it's easier/preferred to ++collect all interfaces I a few ones. This option enables you to do ++that: By setting B to I the effect of B is ++inverted: All selected interfaces are ignored and all other interfaces are ++collected. ++ ++=back ++ + =head2 Plugin C + + The I plugin makes it possible to write extensions for collectd in Java. +--- /dev/null ++++ b/src/iwinfo.c +@@ -0,0 +1,150 @@ ++/** ++ * collectd - src/iwinfo.c ++ * Copyright (C) 2011 Jo-Philipp Wich ++ * ++ * 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; only version 2 of the License is applicable. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License along ++ * with this program; if not, write to the Free Software Foundation, Inc., ++ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ **/ ++ ++#include "collectd.h" ++#include "common.h" ++#include "plugin.h" ++#include "utils_ignorelist.h" ++ ++#include ++#include ++ ++#define PROCNETDEV "/proc/net/dev" ++ ++static const char *config_keys[] = { ++ "Interface", ++ "IgnoreSelected" ++}; ++static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); ++ ++static ignorelist_t *ignorelist = NULL; ++ ++static int iwinfo_config(const char *key, const char *value) ++{ ++ if (ignorelist == NULL) ++ ignorelist = ignorelist_create(1); ++ ++ if (ignorelist == NULL) ++ return 1; ++ ++ if (strcasecmp(key, "Interface") == 0) ++ ignorelist_add(ignorelist, value); ++ else if (strcasecmp(key, "IgnoreSelected") == 0) ++ ignorelist_set_invert(ignorelist, IS_TRUE(value) ? 0 : 1); ++ else ++ return -1; ++ ++ return 0; ++} ++ ++static void iwinfo_submit(const char *ifname, const char *type, int value) ++{ ++ value_t values[1]; ++ value_list_t vl = VALUE_LIST_INIT; ++ ++ values[0].gauge = value; ++ ++ vl.values = values; ++ vl.values_len = 1; ++ ++ sstrncpy(vl.host, hostname_g, sizeof(vl.host)); ++ sstrncpy(vl.plugin, "iwinfo", sizeof(vl.plugin)); ++ sstrncpy(vl.plugin_instance, ifname, sizeof(vl.plugin_instance)); ++ sstrncpy(vl.type, type, sizeof(vl.type)); ++ /*sstrncpy(vl.type_instance, "", sizeof(vl.type_instance));*/ ++ ++ plugin_dispatch_values(&vl); ++} ++ ++static void iwinfo_process(const char *ifname) ++{ ++ int val; ++ char buf[IWINFO_BUFSIZE]; ++ const struct iwinfo_ops *iw = iwinfo_backend(ifname); ++ ++ /* does appear to be a wifi iface */ ++ if (iw) ++ { ++ if (iw->bitrate(ifname, &val)) ++ val = 0; ++ iwinfo_submit(ifname, "bitrate", val * 1000); ++ ++ if (iw->signal(ifname, &val)) ++ val = 0; ++ iwinfo_submit(ifname, "signal_power", val); ++ ++ if (iw->noise(ifname, &val)) ++ val = 0; ++ iwinfo_submit(ifname, "signal_noise", val); ++ ++ if (iw->quality(ifname, &val)) ++ val = 0; ++ iwinfo_submit(ifname, "signal_quality", val); ++ ++ if (iw->assoclist(ifname, buf, &val)) ++ val = 0; ++ iwinfo_submit(ifname, "stations", ++ val / sizeof(struct iwinfo_assoclist_entry)); ++ } ++ ++ iwinfo_finish(); ++} ++ ++static int iwinfo_read(void) ++{ ++ char line[1024]; ++ char ifname[128]; ++ FILE *f; ++ ++ f = fopen(PROCNETDEV, "r"); ++ if (f == NULL) ++ { ++ char err[1024]; ++ WARNING("iwinfo: Unable to open " PROCNETDEV ": %s", ++ sstrerror(errno, err, sizeof(err))); ++ return -1; ++ } ++ ++ while (fgets(line, sizeof(line), f)) ++ { ++ if (!strchr(line, ':')) ++ continue; ++ ++ if (!sscanf(line, " %127[^:]", ifname)) ++ continue; ++ ++ if (ignorelist_match(ignorelist, ifname)) ++ continue; ++ ++ if (strstr(ifname, "mon.") || strstr(ifname, ".sta") || ++ strstr(ifname, "tmp.") || strstr(ifname, "wifi")) ++ continue; ++ ++ iwinfo_process(ifname); ++ } ++ ++ fclose(f); ++ ++ return 0; ++} ++ ++void module_register(void) ++{ ++ plugin_register_config("iwinfo", iwinfo_config, config_keys, config_keys_num); ++ plugin_register_read("iwinfo", iwinfo_read); ++} +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -454,6 +454,15 @@ collectd_LDADD += "-dlopen" irq.la + collectd_DEPENDENCIES += irq.la + endif + ++if BUILD_PLUGIN_IWINFO ++pkglib_LTLIBRARIES += iwinfo.la ++iwinfo_la_SOURCES = iwinfo.c ++iwinfo_la_LDFLAGS = -module -avoid-version ++iwinfo_la_LIBADD = -liwinfo ++collectd_LDADD += "-dlopen" iwinfo.la ++collectd_DEPENDENCIES += iwinfo.la ++endif ++ + if BUILD_PLUGIN_JAVA + pkglib_LTLIBRARIES += java.la + java_la_SOURCES = java.c +--- a/src/types.db ++++ b/src/types.db +@@ -171,3 +171,4 @@ voltage value:GAUGE:U:U + vs_memory value:GAUGE:0:9223372036854775807 + vs_processes value:GAUGE:0:65535 + vs_threads value:GAUGE:0:65535 ++stations value:GAUGE:0:256 diff --git a/utils/coreutils/Makefile b/utils/coreutils/Makefile new file mode 100644 index 0000000..a3f3c0a --- /dev/null +++ b/utils/coreutils/Makefile @@ -0,0 +1,109 @@ +# +# Copyright (C) 2008-2012 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:=coreutils +PKG_VERSION:=8.16 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@GNU/coreutils +PKG_MD5SUM:=89b06f91634208dceba7b36ad1f9e8b9 +PKG_BUILD_DEPENDS:=libpthread + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +COREUTILS_APPLETS := \ + base64 basename cat chcon chgrp chmod chown chroot cksum comm cp csplit \ + cut date dd dir dircolors dirname du echo env expand expr factor \ + false fmt fold groups head hostid id install join kill link ln logname \ + ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc od paste \ + pathchk pinky pr printenv printf ptx pwd readlink realpath rm rmdir \ + runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred \ + shuf sleep sort split stat stdbuf stty sum sync tac tail tee test \ + timeout touch tr true truncate tsort tty uname unexpand uniq unlink \ + uptime users vdir wc who whoami yes + +DEPENDS_sort = +libpthread +DEPENDS_timeout = +librt +DEPENDS_uptime = +libelf +DEPENDS_expr = +libgmp +DEPENDS_factor = +libgmp + +define Package/coreutils/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=The GNU core utilities + URL:=http://www.gnu.org/software/coreutils/ +endef + +define Package/coreutils + $(call Package/coreutils/Default) + TITLE:=The GNU core utilities + MENU:=1 +endef + +define Package/coreutils/description + Full versions of standard GNU utilities. Normally, you would not use this + package, since the functionality in BusyBox is more than sufficient and + smaller. +endef + +define GenPlugin + define Package/$(1) + $(call Package/coreutils/Default) + DEPENDS:=coreutils $(DEPENDS_$(2)) + TITLE:=Utility $(2) from the GNU core utilities + endef + + define Package/$(1)/description + Full version of standard GNU $(2) utility. Normally, you would not use this + package, since the functionality in BusyBox is more than sufficient. + endef +endef + +$(foreach a,$(COREUTILS_APPLETS),$(eval $(call GenPlugin,coreutils-$(a),$(a)))) + +CONFIGURE_VARS += \ + gl_cv_func_mbrtowc_incomplete_state=yes \ + gl_cv_func_mbrtowc_retval=yes \ + gl_cv_func_wcrtomb_retval=yes + +ifneq ($(CONFIG_USE_UCLIBC),) + CONFIGURE_VARS += \ + ac_cv_type_pthread_spinlock_t=$(if $(filter 0.9.30% 0.9.2% 0.9.31%,$(call qstrip,$(CONFIG_UCLIBC_VERSION))),no,yes) +endif + +CONFIGURE_ARGS += \ + --enable-install-program=su + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + SHELL="/bin/bash" \ + all install install-root +endef + +define Package/coreutils/install + true +endef + +define BuildPlugin + define Package/$(1)/install + $(INSTALL_DIR) $$(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/ + endef + + $$(eval $$(call BuildPackage,$(1))) +endef + +$(eval $(call BuildPackage,coreutils)) + +$(foreach a,$(COREUTILS_APPLETS),$(eval $(call BuildPlugin,coreutils-$(a),$(a)))) diff --git a/utils/coreutils/patches/001-no_docs_man_tests.patch b/utils/coreutils/patches/001-no_docs_man_tests.patch new file mode 100644 index 0000000..2c04117 --- /dev/null +++ b/utils/coreutils/patches/001-no_docs_man_tests.patch @@ -0,0 +1,22 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -17,7 +17,7 @@ + + ALL_RECURSIVE_TARGETS = + +-SUBDIRS = lib src doc man po tests gnulib-tests ++SUBDIRS = lib src po + + changelog_etc = \ + ChangeLog-2005 \ +--- a/Makefile.in ++++ b/Makefile.in +@@ -1639,7 +1639,7 @@ top_srcdir = @top_srcdir@ + + # Some tests always need root privileges, others need them only sometimes. + ALL_RECURSIVE_TARGETS = install-root check-root distcheck-hook +-SUBDIRS = lib src doc man po tests gnulib-tests ++SUBDIRS = lib src po + changelog_etc = \ + ChangeLog-2005 \ + ChangeLog-2006 \ diff --git a/utils/coreutils/patches/002-fix_compile_with_uclibc.patch b/utils/coreutils/patches/002-fix_compile_with_uclibc.patch new file mode 100644 index 0000000..bee8a56 --- /dev/null +++ b/utils/coreutils/patches/002-fix_compile_with_uclibc.patch @@ -0,0 +1,12 @@ +--- a/lib/pthread.in.h ++++ b/lib/pthread.in.h +@@ -232,6 +232,9 @@ pthread_mutex_unlock (pthread_mutex_t *m + + /* Approximate spinlocks with mutexes. */ + ++#ifdef __UCLIBC__ ++#define pthread_spinlock_t original_pthread_spinlock_t ++#endif + typedef pthread_mutex_t pthread_spinlock_t; + + static inline int diff --git a/utils/cpusage/Makefile b/utils/cpusage/Makefile new file mode 100644 index 0000000..10b5ec5 --- /dev/null +++ b/utils/cpusage/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2005 Fabian Schneider, 2010 Florian Sesser, TU Muenchen +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cpusage +PKG_VERSION:=0.31 + +PKG_BUILD_DIR:=$(BUILD_DIR)/cpusage + +include $(INCLUDE_DIR)/package.mk + +define Package/cpusage + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Outputs CPU usage statistics once per second + URL:=http://www.net.t-labs.tu-berlin.de/~fabian/software_en.html\#cpusage +endef + +define Package/cpusage/description + CPUsage outputs CPU usage statistics once per second. + Optionally writes CSV output (see '-o' option). + Written by Fabian Schneider (TUM, TUB) in 2005. + Timestamp and CSV-compliance by Florian Sesser (TUM), 2010. +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) src/* $(PKG_BUILD_DIR)/ +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) -D__Linux26__ -D_BSD_SOURCE=1 -c -I$(PKG_BUILD_DIR) -I$(STAGING_DIR)/usr/include -o $(PKG_BUILD_DIR)/cpusage.o $(PKG_BUILD_DIR)/cpusage.c + $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/cpusage -L$(STAGING_DIR)/usr/lib $(PKG_BUILD_DIR)/cpusage.o +endef + +define Package/cpusage/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/cpusage $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,cpusage)) diff --git a/utils/cpusage/src/cpusage.c b/utils/cpusage/src/cpusage.c new file mode 100644 index 0000000..a027e4f --- /dev/null +++ b/utils/cpusage/src/cpusage.c @@ -0,0 +1,426 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __FreeBSD__ +#include +#else +#include +#include +#include +#endif + +#ifdef __FreeBSD__ +static void getsysctl(char *, void *, size_t); +#define CPUSTATES 5 +#define IDLEI 3 +char *cpustatenames[] = { + "user", "nice", "system", "idle", "interrupt", NULL +}; +#endif + +#ifdef __Linux24__ +#define CPUSTATES 4 +#define IDLEI 3 +char *cpustatenames[] = { + "user", "nice", "system", "idle", NULL +}; +#endif + +#ifdef __Linux26__ +#define CPUSTATES 7 +#define IDLEI 3 +/* long names: + * user - nice - system - idle - iowait - irq - soft irq */ +char *cpustatenames[] = { + "user", "nice", "system", "idle", "iowait", "irq", "softirq", NULL +}; +#endif + +#define LIMIT 95 + +static const char usage[] = + "\n usage: cpusage [ -hos ] [ -a | -l limit ] [ -c CPU ]\n"; + +char* appname; + +static float cpu_perc[CPUSTATES]; +static float cpu_max[CPUSTATES]; +static float cpu_min[CPUSTATES]; + +int cpunum; /* -1 all, 0-n CPU/Core 0-n */ + +int output; + +int breakloop; + +/* returns 1-n yielding the number of CPU's/Cores */ +int getNumCPU() +{ +#ifdef __FreeBSD__ + return 0; +#else + + char buffer[32768]; + int fd, len, i; + char * test; + + fd = open("/proc/stat", O_RDONLY); + if(fd<=0) + fprintf(stderr, "%s: cannot open /proc/stat \n", appname); + + len = read(fd, buffer, sizeof(buffer)-1); + close(fd); + buffer[len] = '\0'; + + i=0; + + test = strstr(buffer, "cpu"); + if (test != NULL ) { + test += sizeof("cpu"); + test = strstr(test, "cpu"); + } + + while ( test != NULL ) { + test += sizeof("cpu"); + /* fprintf(stderr, "%s: DEBUG: %s\n", appname, test); */ + i++; + test = strstr(test, "cpu"); + } + return i; +#endif +} + +#ifdef __FreeBSD__ +static void getsysctl (char *name, void *ptr, size_t len) { + size_t nlen = len; + long save; + + if (sysctlbyname(name, ptr, &nlen, NULL, 0) == -1) { + fprintf(stderr, "%s: sysctl(%s...) failed: %s\n", + appname, name, strerror(errno)); + exit(1); + } + if (nlen != len) { + fprintf(stderr, "%s: sysctl(%s...) expected %lu, got %lu\n", + appname, name, (unsigned long)len, (unsigned long)nlen); + exit(1); + } + + /* swapping idle and interrupt to look like linux */ + save = ((long*) ptr)[4]; + ((long*) ptr)[4] = ((long*) ptr)[3]; + ((long*) ptr)[3] = save; +} +#else +void getSysinfo(unsigned long *ptr, size_t size) +{ + char buffer[4096]; + char match[100]; + char * start; + int fd, len, j; + + for (j = 0; j cpu_max[i] ) + cpu_max[i] = cpu_perc[i]; + /* new min ? */ + if ( cpu_perc[i] < cpu_min[i] ) + cpu_min[i] = cpu_perc[i]; + } + + return total; +} + +void print_perc(float *perc, const char *head){ + int i; + time_t Zeitstempel; + struct tm *now; + + /* human readable */ + if ( (output == 0) && (head != "")) + printf("%s: ", head); + + /* machine readable */ + if ( (output == 1) && (head != "")) + printf("%s;", head); + + /* timestamp */ + time(&Zeitstempel); + now = localtime(&Zeitstempel); + if ( output == 0 ) + printf("timestamp: %04d-%02d-%02d %02d.%02d.%02d, ", now->tm_year+1900, now->tm_mon+1, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec); + else + printf("%04d-%02d-%02d;%02d:%02d:%02d;", now->tm_year+1900, now->tm_mon+1, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec); + + if ( output == 0 ) + printf("%s: %5.1f%%, ", cpustatenames[0], perc[0]); + else + printf("%.1f", perc[0]); + + /* print out calculated information in percentages */ + for ( i = 1; i < CPUSTATES; i++) { + if ( output == 0 ) + printf("%s: %5.1f%%, ", cpustatenames[i], perc[i]); + else + printf(";%.1f", perc[i]); + } + printf("\n"); +} + +/* to catch Strg+C when looping */ +void loop_term_handler (int signum) { + breakloop = 1; +} + +int main(int argc, char** argv) { + + appname = argv[0]; + + int i,c,limit; + int runonce; /* run just once and exit */ + int avg; /* is avg measurement allready running */ + int avg_run; /* did we allready had an avg measurement */ + static long cp_time1[CPUSTATES]; + static long cp_time2[CPUSTATES]; + static long cp_avg_start[CPUSTATES]; + static long cp_avg_stop[CPUSTATES]; + static long cp_diff[CPUSTATES]; + + struct sigaction sigold, signew; + + long *old = cp_time2; + long *new = cp_time1; + + long total; + limit = LIMIT; + output = 0; /* 0: human readable; 1: machine readable */ + runonce = 0; /* 0: run continuesly; 1: run once */ + + cpunum = -1; /* -1: all CPUs/Cores, 0-n: special CPU/Core */ + + /* reading commandline options */ + while (1) { + c = getopt(argc, argv, "saohl:c:"); + + if (c == -1){ + break; + } + + switch(c){ + /*run once and exit */ + case 's': + runonce = 1; + break; + /* use avg from begin to end -> same as "-l 100" */ + case 'a': + limit = 100; + break; + case 'o': + output = 1; /* machine readable */ + // header for CSV output + printf("date;time;user;nice;system;idle;iowait;irq;softirq\n"); + break; + /* print usage */ + case 'h': + fprintf(stderr, "%s: %s", appname, usage); + exit(0); + break; + /* set limit */ + case 'l': + if ( !(sscanf(optarg, "%d", &limit) == 1) ) { + fprintf(stderr, "%s: option for -l should be integer (is %s)\n", + appname, optarg); + exit(1); + } + break; + /* select CPU/Core */ + case 'c': + if ( !(sscanf(optarg, "%d", &cpunum) == 1) ) { + fprintf(stderr, "%s: option for -c should be integer (is %s)\n", + appname, optarg); + exit(1); + } + break; + + } + } + + if (cpunum != -1) { +#ifdef __FreeBSD__ + fprintf(stderr, "%s: No CPU/Core selection available for FreeBSD\n", + appname); + exit (1); +#else + int numcpu = getNumCPU(); + if ( cpunum < numcpu ) { + printf("-- Selected CPU %d\n", cpunum ); + } else { + if (numcpu == 1) { + fprintf(stderr, "%s: CPU %d not available (found %d CPU: [0])\n", + appname, cpunum, numcpu ); + } else { + fprintf(stderr, "%s: CPU %d not available (found %d CPU's: [0]-[%d])\n ", + appname, cpunum, numcpu, numcpu - 1 ); + } + exit(1); + } + +#endif + } + + breakloop = 0; + + for (i=0; i < CPUSTATES; i++){ + cpu_max[i] = 0; + cpu_min[i] = 100; + } + + /* get information */ +#ifdef __FreeBSD__ + getsysctl("kern.cp_time", new, sizeof(cp_time1)); +#else + getSysinfo((unsigned long*)new, CPUSTATES); +#endif + + /* catch Strg+C when capturing to call pcap_breakloop() */ + memset(&signew, 0, sizeof(signew)); + signew.sa_handler = loop_term_handler; + if (sigaction(SIGINT, &signew, &sigold) < 0 ){ + fprintf(stderr, "Could not set signal handler -> exiting"); + } + + avg = 0; + avg_run = 0; + + if ( runonce ) { + breakloop=1; + } + + while(1) { + usleep( 1000000 ); + + if ( new == cp_time1 ) { + new = cp_time2; + old = cp_time1; + } else{ + new = cp_time1; + old = cp_time2; + } + + /* get information again */ +#ifdef __FreeBSD__ + getsysctl("kern.cp_time", new, sizeof(cp_time1)); +#else + getSysinfo((unsigned long*)new, CPUSTATES); +#endif + + /* convert cp_time counts to percentages */ + total = perc(CPUSTATES, new, old, cp_diff); + + /* check for avg measurement start */ + if ( !avg_run && !avg && (cpu_perc[IDLEI] <= limit) ){ + avg = 1; + for ( i = 0; i < CPUSTATES; i++ ) + cp_avg_start[i] = new[i]; + } + + /* check for avg measurement stop */ + if ( !avg_run && avg && (cpu_perc[IDLEI] > limit) ){ + avg = 0; + for ( i = 0; i < CPUSTATES; i++ ) + cp_avg_stop[i] = new[i]; + avg_run = 1; + } + + print_perc(cpu_perc, ""); + + if (breakloop) { + if (avg) { + avg = 0; + for ( i = 0; i < CPUSTATES; i++ ) + cp_avg_stop[i] = new[i]; + } + break; + } + } + + /* Set default behaviour when loop is done */ + if (sigaction(SIGINT, &sigold, &signew) < 0 ){ + fprintf(stderr, "%s: Could not restore signal handler -> exiting", appname); + } + + if ( ! runonce && output == 0) { + // print avg only when not making a one-shot msg and + // when not writing CSV output + printf("---Summary----\n"); + + print_perc(cpu_min, "Min"); + + print_perc(cpu_max, "Max"); + + perc(CPUSTATES, cp_avg_start, cp_avg_stop, cp_diff); + + print_perc(cpu_perc, "Avg"); + } + + return 0; +} + + + diff --git a/utils/crypto-tools/Makefile b/utils/crypto-tools/Makefile new file mode 100644 index 0000000..1bfcde4 --- /dev/null +++ b/utils/crypto-tools/Makefile @@ -0,0 +1,37 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=crypto-tools +PKG_VERSION:=20100325 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/ocf-linux +PKG_MD5SUM:=51e0ef8918a8cf15f78f0631341d826c + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +PKG_BUILD_DEPENDS:=libopenssl ocf-crypto-headers + +include $(INCLUDE_DIR)/package.mk + +define Package/crypto-tools + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libopenssl + TITLE:=OCF-Linux's crypto-tools + URL:=http://ocf-linux.sourceforge.net/ +endef + +define Package/crypto-tools/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/cryptotest $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/cryptokeytest $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,crypto-tools)) diff --git a/utils/cryptsetup/Makefile b/utils/cryptsetup/Makefile new file mode 100644 index 0000000..015ddf7 --- /dev/null +++ b/utils/cryptsetup/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cryptsetup +PKG_VERSION:=1.4.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://cryptsetup.googlecode.com/files/ +PKG_MD5SUM:=9253b3f29abf5c6f333eb74128b0df1c + +include $(INCLUDE_DIR)/package.mk + +TARGET_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +define Package/cryptsetup/Default + URL:=http://code.google.com/p/cryptsetup/ +endef + +define Package/cryptsetup +$(call Package/cryptsetup/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Cryptsetup + DEPENDS:=+libblkid +libuuid +libpopt +lvm2 +libgcrypt +libdevmapper +endef + +define Package/cryptsetup/description + Cryptsetup-luks +endef + +define Build/Compile + $(call Build/Configure/Default) + $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install +endef + +define Package/cryptsetup/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/cryptsetup $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcryptsetup.so.* $(1)/usr/lib +endef + +$(eval $(call BuildPackage,cryptsetup)) diff --git a/utils/cwiid/Makefile b/utils/cwiid/Makefile new file mode 100644 index 0000000..4a79f9d --- /dev/null +++ b/utils/cwiid/Makefile @@ -0,0 +1,108 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cwiid +PKG_VERSION:=0.6.00 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://abstrakraft.org/cwiid/downloads/ +PKG_SOURCE_VERSION:=2100f14c612471084434b364501e3818c7f4144e + +PKG_BUILD_DEPENDS:=python + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/cwiid/Default + TITLE:=Linux Nintendo Wiimote interface + URL:=http://abstrakraft.org/cwiid/ +endef + +define Package/libcwiid +$(call Package/cwiid/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= (library) + DEPENDS+= +bluez-libs +libpthread +librt +endef + +define Package/wminput +$(call Package/cwiid/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= (utility) + DEPENDS+= +libcwiid +endef + +define Package/python-cwiid +$(call Package/cwiid/Default) + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Python bindings for the cwiid libs + DEPENDS:= +python-mini +libcwiid +endef + +CONFIGURE_ARGS += \ + --without-python \ + --disable-ldconfig \ + --enable-shared \ + --enable-static \ + +TARGET_CFLAGS += $(FPIC) +TARGET_CPPFLAGS += -I$(PKG_BUILD_DIR)/libcwiid/ +TARGET_LDFLAGS += -lpthread -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +define Build/Prepare + $(call Build/Prepare/Default) + ( cd $(PKG_BUILD_DIR) ; \ + autoconf ; \ + ) +endef + +define Build/Compile + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + CC="$(TARGET_CC)" \ + OFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS) -L../libcwiid/" \ + all + $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false) + $(call Build/Compile/PyMod,./python/, \ + install --prefix="$(PKG_INSTALL_DIR)/usr", \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/libcwiid/*.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libcwiid/*.so $(1)/usr/lib/ +endef + +define Package/libcwiid/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libcwiid/libcwiid.so.1.0 $(1)/usr/lib/ +endef + +define Package/wminput/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/wminput/wminput $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/lswm/lswm $(1)/usr/bin/ +endef + +define PyPackage/python-cwiid/filespec ++|$(PYTHON_PKG_DIR)/cwiid.so +endef + +$(eval $(call BuildPackage,libcwiid)) +$(eval $(call BuildPackage,wminput)) +$(eval $(call PyPackage,python-cwiid)) +$(eval $(call BuildPackage,python-cwiid)) diff --git a/utils/cwiid/patches/100-dump_gtk_wmdemo.patch b/utils/cwiid/patches/100-dump_gtk_wmdemo.patch new file mode 100644 index 0000000..ebfdeeb --- /dev/null +++ b/utils/cwiid/patches/100-dump_gtk_wmdemo.patch @@ -0,0 +1,69 @@ +Index: cwiid-0.6.00/Makefile.in +=================================================================== +--- cwiid-0.6.00.orig/Makefile.in 2010-06-20 19:32:38.000000000 +0200 ++++ cwiid-0.6.00/Makefile.in 2010-06-20 19:32:46.000000000 +0200 +@@ -3,7 +3,7 @@ + include @top_builddir@/defs.mak + + LIB_DIRS = libcwiid +-BIN_DIRS = wmgui wminput lswm ++BIN_DIRS = wminput lswm + DOC_DIRS = man doc + ifdef PYTHON + BIND_DIRS = python +Index: cwiid-0.6.00/configure.ac +=================================================================== +--- cwiid-0.6.00.orig/configure.ac 2010-06-20 19:31:22.000000000 +0200 ++++ cwiid-0.6.00/configure.ac 2010-06-20 19:31:35.000000000 +0200 +@@ -124,11 +124,6 @@ + fi + AC_SUBST(LDCONFIG) + +-pkg_modules="gtk+-2.0 >= 2.0.0 gthread-2.0" +-PKG_CHECK_MODULES([GTK], [$pkg_modules]) +-AC_SUBST(GTK_CFLAGS) +-AC_SUBST(GTK_LIBS) +- + AC_OUTPUT( + [Makefile] + [defs.mak] +Index: cwiid-0.6.00/wminput/Makefile.in +=================================================================== +--- cwiid-0.6.00.orig/wminput/Makefile.in 2010-06-20 19:47:06.000000000 +0200 ++++ cwiid-0.6.00/wminput/Makefile.in 2010-06-20 19:47:13.000000000 +0200 +@@ -14,7 +14,7 @@ + -DWMINPUT_CONFIG_DIR=\"$(WMINPUT_CONFIG_DIR)\" \ + -DCWIID_PLUGINS_DIR=\"$(CWIID_PLUGINS_DIR)\" + +-LDLIBS += -lcwiid -ldl ++LDLIBS += -lcwiid -ldl -lbluetooth + LDFLAGS += -L@top_builddir@/libcwiid -rdynamic + INST_DIR = @bindir@ + +Index: cwiid-0.6.00/lswm/Makefile.in +=================================================================== +--- cwiid-0.6.00.orig/lswm/Makefile.in 2010-06-20 19:50:13.000000000 +0200 ++++ cwiid-0.6.00/lswm/Makefile.in 2010-06-20 19:50:22.000000000 +0200 +@@ -8,7 +8,7 @@ + + CFLAGS += -I@top_builddir@/libcwiid + LDFLAGS += -L@top_builddir@/libcwiid +-LDLIBS += -lcwiid ++LDLIBS += -lcwiid -lbluetooth + INST_DIR = @bindir@ + + include $(COMMON)/include/app.mak +Index: cwiid-0.6.00/Makefile.in +=================================================================== +--- cwiid-0.6.00.orig/Makefile.in 2010-06-20 19:53:45.000000000 +0200 ++++ cwiid-0.6.00/Makefile.in 2010-06-20 19:53:54.000000000 +0200 +@@ -9,7 +9,7 @@ + BIND_DIRS = python + endif + +-SUB_DIRS = $(LIB_DIRS) $(BIN_DIRS) $(DOC_DIRS) $(BIND_DIRS) wmdemo ++SUB_DIRS = $(LIB_DIRS) $(BIN_DIRS) $(DOC_DIRS) $(BIND_DIRS) + + all install clean distclean uninstall: TARGET += $(MAKECMDGOALS) + + diff --git a/utils/daemontools/Makefile b/utils/daemontools/Makefile new file mode 100644 index 0000000..e667ce4 --- /dev/null +++ b/utils/daemontools/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2007 OpenWrt.org +# Original port by FreeWRT project. +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# Alexander Tsvyashchenko Created OpenWRT package as per Trac ticket 2497 +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=daemontools +PKG_VERSION:=0.76 +PKG_RELEASE:=1 + +PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz +PKG_SOURCE_URL:=http://cr.yp.to/daemontools/ +PKG_MD5SUM:=1871af2453d6e464034968a0fbcb2bfc + +include $(INCLUDE_DIR)/package.mk + +PKG_UNPACK += && mv $(PKG_BUILD_DIR)/../admin/* $(PKG_BUILD_DIR)/.. && rmdir $(PKG_BUILD_DIR)/../admin + +define Package/daemontools + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:= + TITLE:=Tools for managing UNIX services + URL:=http://cr.yp.to/daemontools.html +endef + +define Package/daemontools/description + Daemontools is a collection of tools for managing UNIX services by DJ Bernstein. +endef + +define Build/Compile + cd $(PKG_BUILD_DIR) && \ + TARGET_CC="$(TARGET_CC)" \ + TARGET_CFLAGS="$(TARGET_CFLAGS)" \ + TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \ + $(PKG_BUILD_DIR)/package/compile +endef + +define Package/daemontools/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/command/* $(1)/usr/bin +endef + +$(eval $(call BuildPackage,daemontools)) + diff --git a/utils/daemontools/patches/crosscompile.patch b/utils/daemontools/patches/crosscompile.patch new file mode 100644 index 0000000..2abb466 --- /dev/null +++ b/utils/daemontools/patches/crosscompile.patch @@ -0,0 +1,205 @@ +diff -urN daemontools-0.76/src/Makefile daemontools-0.76.new/src/Makefile +--- daemontools-0.76/src/Makefile 2001-07-12 19:49:49.000000000 +0300 ++++ daemontools-0.76.new/src/Makefile 2007-09-30 16:27:25.000000000 +0300 +@@ -101,9 +101,6 @@ + uint64.h + ./compile deepsleep.c + +-direntry.h: choose compile direntry.h1 direntry.h2 trydrent.c +- ./choose c trydrent direntry.h1 direntry.h2 > direntry.h +- + env.o: compile env.c env.h str.h + ./compile env.c + +@@ -151,29 +148,6 @@ + fmt_ulong.o: compile fmt.h fmt_ulong.c + ./compile fmt_ulong.c + +-hasflock.h: choose compile hasflock.h1 hasflock.h2 load tryflock.c +- ./choose cl tryflock hasflock.h1 hasflock.h2 > hasflock.h +- +-hasmkffo.h: choose compile hasmkffo.h1 hasmkffo.h2 load trymkffo.c +- ./choose cl trymkffo hasmkffo.h1 hasmkffo.h2 > hasmkffo.h +- +-hassgact.h: choose compile hassgact.h1 hassgact.h2 load trysgact.c +- ./choose cl trysgact hassgact.h1 hassgact.h2 > hassgact.h +- +-hassgprm.h: choose compile hassgprm.h1 hassgprm.h2 load trysgprm.c +- ./choose cl trysgprm hassgprm.h1 hassgprm.h2 > hassgprm.h +- +-hasshsgr.h: chkshsgr choose compile hasshsgr.h1 hasshsgr.h2 load \ +-tryshsgr.c warn-shsgr +- ./chkshsgr || ( cat warn-shsgr; exit 1 ) +- ./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h +- +-haswaitp.h: choose compile haswaitp.h1 haswaitp.h2 load trywaitp.c +- ./choose cl trywaitp haswaitp.h1 haswaitp.h2 > haswaitp.h +- +-iopause.h: choose compile iopause.h1 iopause.h2 load trypoll.c +- ./choose clr trypoll iopause.h1 iopause.h2 > iopause.h +- + iopause.o: compile iopause.c iopause.h select.h tai.h taia.h uint64.h + ./compile iopause.c + +@@ -265,7 +239,6 @@ + rts: envdir envuidgid fghack matchtest multilog pgrphack \ + readproctitle rts.tests setlock setuidgid softlimit supervise svc \ + svok svscan svscanboot svstat tai64n tai64nlocal +- env - /bin/sh rts.tests 2>&1 | cat -v > rts + + scan_ulong.o: compile scan.h scan_ulong.c + ./compile scan_ulong.c +@@ -273,9 +246,6 @@ + seek_set.o: compile seek.h seek_set.c + ./compile seek_set.c + +-select.h: choose compile select.h1 select.h2 trysysel.c +- ./choose c trysysel select.h1 select.h2 > select.h +- + setlock: byte.a load setlock.o unix.a + ./load setlock unix.a byte.a + +@@ -478,9 +448,6 @@ + timestamp.o: compile tai.h taia.h timestamp.c timestamp.h uint64.h + ./compile timestamp.c + +-uint64.h: choose compile load tryulong64.c uint64.h1 uint64.h2 +- ./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h +- + unix.a: alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o buffer_2.o \ + buffer_get.o buffer_put.o buffer_read.o buffer_write.o coe.o env.o \ + error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o lock_exnb.o \ +diff -urN daemontools-0.76/src/conf-cc daemontools-0.76.new/src/conf-cc +--- daemontools-0.76/src/conf-cc 2007-09-30 13:58:40.000000000 +0300 ++++ daemontools-0.76.new/src/conf-cc 2007-09-30 15:15:32.000000000 +0300 +@@ -1,3 +1,3 @@ +-gcc -O2 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings ++$TARGET_CC $TARGET_CFLAGS -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings -include errno.h + + This will be used to compile .c files. +diff -urN daemontools-0.76/src/conf-ld daemontools-0.76.new/src/conf-ld +--- daemontools-0.76/src/conf-ld 2001-07-12 19:49:49.000000000 +0300 ++++ daemontools-0.76.new/src/conf-ld 2007-09-30 15:15:42.000000000 +0300 +@@ -1,3 +1,3 @@ +-gcc -s ++$TARGET_CC -s $TARGET_LDFLAGS + + This will be used to link .o files into an executable. +diff -urN daemontools-0.76/src/direntry.h daemontools-0.76.new/src/direntry.h +--- daemontools-0.76/src/direntry.h 1970-01-01 03:00:00.000000000 +0300 ++++ daemontools-0.76.new/src/direntry.h 2007-09-30 13:52:11.000000000 +0300 +@@ -0,0 +1,12 @@ ++/* Public domain. */ ++ ++#ifndef DIRENTRY_H ++#define DIRENTRY_H ++ ++/* sysdep: +dirent */ ++ ++#include ++#include ++#define direntry struct dirent ++ ++#endif +diff -urN daemontools-0.76/src/hasflock.h daemontools-0.76.new/src/hasflock.h +--- daemontools-0.76/src/hasflock.h 1970-01-01 03:00:00.000000000 +0300 ++++ daemontools-0.76.new/src/hasflock.h 2007-09-30 13:52:55.000000000 +0300 +@@ -0,0 +1,4 @@ ++/* Public domain. */ ++ ++/* sysdep: +flock */ ++#define HASFLOCK 1 +diff -urN daemontools-0.76/src/hasmkffo.h daemontools-0.76.new/src/hasmkffo.h +--- daemontools-0.76/src/hasmkffo.h 1970-01-01 03:00:00.000000000 +0300 ++++ daemontools-0.76.new/src/hasmkffo.h 2007-09-30 13:53:16.000000000 +0300 +@@ -0,0 +1,4 @@ ++/* Public domain. */ ++ ++/* sysdep: +mkfifo */ ++#define HASMKFIFO 1 +diff -urN daemontools-0.76/src/hassgact.h daemontools-0.76.new/src/hassgact.h +--- daemontools-0.76/src/hassgact.h 1970-01-01 03:00:00.000000000 +0300 ++++ daemontools-0.76.new/src/hassgact.h 2007-09-30 13:53:47.000000000 +0300 +@@ -0,0 +1,4 @@ ++/* Public domain. */ ++ ++/* sysdep: +sigaction */ ++#define HASSIGACTION 1 +diff -urN daemontools-0.76/src/hassgprm.h daemontools-0.76.new/src/hassgprm.h +--- daemontools-0.76/src/hassgprm.h 1970-01-01 03:00:00.000000000 +0300 ++++ daemontools-0.76.new/src/hassgprm.h 2007-09-30 13:54:13.000000000 +0300 +@@ -0,0 +1,4 @@ ++/* Public domain. */ ++ ++/* sysdep: +sigprocmask */ ++#define HASSIGPROCMASK 1 +diff -urN daemontools-0.76/src/hasshsgr.h daemontools-0.76.new/src/hasshsgr.h +--- daemontools-0.76/src/hasshsgr.h 1970-01-01 03:00:00.000000000 +0300 ++++ daemontools-0.76.new/src/hasshsgr.h 2007-09-30 13:54:41.000000000 +0300 +@@ -0,0 +1,3 @@ ++/* Public domain. */ ++ ++/* sysdep: -shortsetgroups */ +diff -urN daemontools-0.76/src/haswaitp.h daemontools-0.76.new/src/haswaitp.h +--- daemontools-0.76/src/haswaitp.h 1970-01-01 03:00:00.000000000 +0300 ++++ daemontools-0.76.new/src/haswaitp.h 2007-09-30 13:54:57.000000000 +0300 +@@ -0,0 +1,4 @@ ++/* Public domain. */ ++ ++/* sysdep: +waitpid */ ++#define HASWAITPID 1 +diff -urN daemontools-0.76/src/iopause.h daemontools-0.76.new/src/iopause.h +--- daemontools-0.76/src/iopause.h 1970-01-01 03:00:00.000000000 +0300 ++++ daemontools-0.76.new/src/iopause.h 2007-09-30 13:55:14.000000000 +0300 +@@ -0,0 +1,20 @@ ++/* Public domain. */ ++ ++#ifndef IOPAUSE_H ++#define IOPAUSE_H ++ ++/* sysdep: +poll */ ++#define IOPAUSE_POLL ++ ++#include ++#include ++ ++typedef struct pollfd iopause_fd; ++#define IOPAUSE_READ POLLIN ++#define IOPAUSE_WRITE POLLOUT ++ ++#include "taia.h" ++ ++extern void iopause(iopause_fd *,unsigned int,struct taia *,struct taia *); ++ ++#endif +diff -urN daemontools-0.76/src/select.h daemontools-0.76.new/src/select.h +--- daemontools-0.76/src/select.h 1970-01-01 03:00:00.000000000 +0300 ++++ daemontools-0.76.new/src/select.h 2007-09-30 13:55:32.000000000 +0300 +@@ -0,0 +1,13 @@ ++/* Public domain. */ ++ ++#ifndef SELECT_H ++#define SELECT_H ++ ++/* sysdep: +sysselect */ ++ ++#include ++#include ++#include ++extern int select(); ++ ++#endif +diff -urN daemontools-0.76/src/uint64.h daemontools-0.76.new/src/uint64.h +--- daemontools-0.76/src/uint64.h 1970-01-01 03:00:00.000000000 +0300 ++++ daemontools-0.76.new/src/uint64.h 2007-09-30 13:55:54.000000000 +0300 +@@ -0,0 +1,10 @@ ++/* Public domain. */ ++ ++#ifndef UINT64_H ++#define UINT64_H ++ ++/* sysdep: -ulong64 */ ++ ++typedef unsigned long long uint64; ++ ++#endif diff --git a/utils/daemontools/patches/svscanboot.patch b/utils/daemontools/patches/svscanboot.patch new file mode 100644 index 0000000..ae59ea7 --- /dev/null +++ b/utils/daemontools/patches/svscanboot.patch @@ -0,0 +1,16 @@ +--- daemontools-0.76/src/svscanboot.sh.orig 2007-01-27 11:49:38.000000000 +0100 ++++ daemontools-0.76/src/svscanboot.sh 2007-01-27 11:52:07.000000000 +0100 +@@ -1,11 +1,11 @@ + +-PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin ++PATH=/bin:/sbin:/usr/bin:/usr/sbin + + exec /dev/null + exec 2>/dev/null + +-/command/svc -dx /service/* /service/*/log ++/usr/bin/svc -dx /service/* /service/*/log + + env - PATH=$PATH svscan /service 2>&1 | \ + env - PATH=$PATH readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................ diff --git a/utils/dash/Makefile b/utils/dash/Makefile new file mode 100644 index 0000000..1a88db4 --- /dev/null +++ b/utils/dash/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2006-2011 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:=dash +PKG_VERSION:=0.5.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://gondor.apana.org.au/~herbert/dash/files +PKG_MD5SUM:=f6cedb10ae7258adb5ab17a10ae80d51 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/dash + SECTION:=base + CATEGORY:=Base system + TITLE:=Debian Almquist shell + URL:=http://gondor.apana.org.au/~herbert/dash/ +endef + +define Package/dash/description + A small footprint, POSIX complied unix shell +endef + +MAKE_FLAGS += \ + AWK="awk" + +define Package/dash/install + $(INSTALL_DIR) $(1)/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dash $(1)/bin/ +endef + +$(eval $(call BuildPackage,dash)) diff --git a/utils/dbus/Makefile b/utils/dbus/Makefile new file mode 100644 index 0000000..acaac2c --- /dev/null +++ b/utils/dbus/Makefile @@ -0,0 +1,187 @@ +# +# Copyright (C) 2007-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +# Make sure to also update the dbus-x package +PKG_NAME:=dbus +PKG_VERSION:=1.4.14 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://dbus.freedesktop.org/releases/dbus/ +PKG_MD5SUM:=ae6de2562a57516cfabaf56903375ba9 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_LDFLAGS+= \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \ + -Wl,-rpath=/usr/lib/ + +define Package/dbus/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Simple interprocess messaging system + URL:=http://dbus.freedesktop.org/ +endef + +define Package/dbus/Default/description + D-Bus is a message bus system, a simple way for applications to talk to one + another. In addition to interprocess communication, D-Bus helps coordinate + process lifecycle; it makes it simple and reliable to code a "single instance" + application or daemon, and to launch applications and daemons on demand when + their services are needed. +endef + +define Package/libdbus +$(call Package/dbus/Default) + CATEGORY:=Libraries + TITLE+= (library) + DEPENDS:= +librt +endef + +define Package/libdbus/Description +$(call Package/dbus/Default/description) + This package contains the D-Bus shared library. +endef + +define Package/dbus +$(call Package/dbus/Default) + TITLE+= (daemon) + DEPENDS:= +libexpat +libdbus +endef + +define Package/dbus/Description +$(call Package/dbus/Default/description) + This package contains the D-Bus daemon. +endef + +define Package/dbus-utils +$(call Package/dbus/Default) + TITLE+= (utilities) + DEPENDS:= dbus +endef + +define Package/dbus-utils/Description +$(call Package/dbus/Default/description) + This package contains D-Bus utilities. +endef + + +define Build/Prepare + $(Build/Prepare/Default) + $(SED) 's/-Wl,--gc-sections/--gc-sections/' $(PKG_BUILD_DIR)/configure +endef + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-abstract-sockets \ + --disable-ansi \ + --disable-asserts \ + --disable-console-owner-file \ + --disable-doxygen-docs \ + --disable-compiler_coverage \ + --disable-selinux \ + --disable-tests \ + --disable-verbose-mode \ + --disable-xml-docs \ + --with-xml="expat" \ + --with-dbus-user=root \ + --with-dbus-daemondir="/usr/sbin" \ + --with-system-socket="/var/run/dbus/system_bus_socket" \ + --with-system-pid-file="/var/run/dbus.pid" \ + --without-x \ + --libexecdir=/usr/lib/dbus-1 + +CONFIGURE_VARS+= \ + ac_cv_have_abstract_sockets="yes" \ + ac_cv_lib_expat_XML_ParserCreate_MM="yes" \ + + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/dbus-1.0 \ + $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib/dbus-1.0/include/dbus/ + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/dbus-1.0/include/dbus/*.h \ + $(1)/usr/lib/dbus-1.0/include/dbus/ + + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/libdbus-1.{so*,la,a} \ + $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/dbus-1.0 \ + $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/dbus-1.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/dbus/conffiles +/etc/dbus-1/session.conf +/etc/dbus-1/system.conf +endef + +define Package/libdbus/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libdbus-1.so.* \ + $(1)/usr/lib/ +endef + +define Package/dbus/install + $(INSTALL_DIR) $(1)/etc + $(CP) \ + $(PKG_INSTALL_DIR)/etc/dbus-1 \ + $(1)/etc/ + + $(INSTALL_DIR) $(1)/usr/lib/dbus-1 + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/lib/dbus-1/dbus-daemon-launch-helper \ + $(1)/usr/lib/dbus-1/ + + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/sbin/dbus-daemon \ + $(1)/usr/sbin/ + + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/dbus-uuidgen \ + $(1)/usr/bin/ + + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/dbus-launch \ + $(1)/usr/bin/dbus-launch.real + $(INSTALL_BIN) \ + ./files/dbus-launch \ + $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) \ + ./files/dbus.init \ + $(1)/etc/init.d/dbus +endef + +define Package/dbus-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/dbus-{send,monitor,cleanup-sockets} \ + $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libdbus)) +$(eval $(call BuildPackage,dbus)) +$(eval $(call BuildPackage,dbus-utils)) diff --git a/utils/dbus/files/dbus-launch b/utils/dbus/files/dbus-launch new file mode 100644 index 0000000..7c3f922 --- /dev/null +++ b/utils/dbus/files/dbus-launch @@ -0,0 +1,12 @@ +#!/bin/sh +# +# Simple wrapper script which allows us to build dbus without general x support +# If an application needs x support in dbus-launch it has to depend on the +# dbus-launch-x package. The script is used to prefer dbus-launch with x over +# the dbus-lauch without x. + +if [ -f /usr/bin/dbus-launch-x ]; then + exec /usr/bin/dbus-launch-x $@ +else + exec /usr/bin/dbus-launch.real $@ +fi diff --git a/utils/dbus/files/dbus.init b/utils/dbus/files/dbus.init new file mode 100644 index 0000000..4294083 --- /dev/null +++ b/utils/dbus/files/dbus.init @@ -0,0 +1,17 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=60 + +SERVICE_PID_FILE=/var/run/dbus.pid + +start() { + mkdir -m 0755 -p /var/lib/dbus + mkdir -m 0755 -p /var/run/dbus + [ -x /usr/bin/dbus-uuidgen ] && /usr/bin/dbus-uuidgen --ensure + service_start /usr/sbin/dbus-daemon --system +} + +stop() { + service_stop /usr/sbin/dbus-daemon && rm $SERVICE_PID_FILE +} diff --git a/utils/deco/Makefile b/utils/deco/Makefile new file mode 100644 index 0000000..70253ae --- /dev/null +++ b/utils/deco/Makefile @@ -0,0 +1,48 @@ +# +# 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:=deco +PKG_VERSION:=39 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/deco +PKG_MD5SUM:=f77f60e8be0cae1f814cba1ef61bf4d0 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/deco + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncurses + TITLE:=Text-based, full featured file manager + URL:=http://deco.sourceforge.net/ + SUBMENU:=filemanager +endef + +define Package/deco/description + A clone of Norton Commander for Unix. Text-based, full featured + file manager. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +define Package/deco/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/deco $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/deco + $(INSTALL_DATA) $(PKG_BUILD_DIR)/menu $(1)/usr/lib/deco/menu + $(INSTALL_DATA) $(PKG_BUILD_DIR)/profile $(1)/usr/lib/deco/profile +endef + +$(eval $(call BuildPackage,deco)) diff --git a/utils/deco/patches/100-tty.c.patch b/utils/deco/patches/100-tty.c.patch new file mode 100644 index 0000000..f37e4e2 --- /dev/null +++ b/utils/deco/patches/100-tty.c.patch @@ -0,0 +1,11 @@ +--- src/tty.c 2005-09-25 00:23:41.671022039 -0700 ++++ str_new/tty.c 2005-09-25 01:09:37.189119615 -0700 +@@ -14,7 +14,7 @@ + #if HAVE_TERMIOS_H + # include + # if HAVE_SYS_IOCTL_H +-# include ++/*# include */ + # endif + # define HAVE_TERMIO_H 1 + # define termio termios diff --git a/utils/devio/Makefile b/utils/devio/Makefile new file mode 100644 index 0000000..9c0a974 --- /dev/null +++ b/utils/devio/Makefile @@ -0,0 +1,38 @@ +# +# Copyright (C) 2007 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:=devio +PKG_VERSION:=1.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/devio +PKG_MD5SUM:=5d332c2bffc0791367bcf3368ba1a0d1 + +include $(INCLUDE_DIR)/package.mk + +define Package/devio + SUBMENU:=disc + SECTION:=utils + CATEGORY:=Utilities + TITLE:=correctly read (or write) a region of a block device + URL:=http://sourceforge.net/projects/devio/ +endef + +define Package/devio/description + A command line program to correctly read (or write) a region of a block device. + Primary use is for extracting formatted data from MTD partitions. +endef + +define Package/devio/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/devio $(1)/usr/sbin +endef + +$(eval $(call BuildPackage,devio)) diff --git a/utils/devmem2/Makefile b/utils/devmem2/Makefile new file mode 100644 index 0000000..baa1337 --- /dev/null +++ b/utils/devmem2/Makefile @@ -0,0 +1,37 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=devmem2 +PKG_RELEASE:=1 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/devmem2 + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Simple program to read/write from memory. +endef + +define Package/devmem2/description + Simple program to read/write from/to any location in memory. +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Package/devmem2/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/devmem2 $(1)/usr/sbin/devmem2 +endef + +$(eval $(call BuildPackage,devmem2)) diff --git a/utils/devmem2/src/Makefile b/utils/devmem2/src/Makefile new file mode 100644 index 0000000..1db49ca --- /dev/null +++ b/utils/devmem2/src/Makefile @@ -0,0 +1,13 @@ +OBJ = devmem2.o + +all: compile + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +compile: $(OBJ) + $(CC) -o devmem2 $(LDFLAGS) $(OBJ) + +clean: + rm -f *.o *.so devmem2 + diff --git a/utils/devmem2/src/devmem2.c b/utils/devmem2/src/devmem2.c new file mode 100644 index 0000000..0c1b5b3 --- /dev/null +++ b/utils/devmem2/src/devmem2.c @@ -0,0 +1,132 @@ +/* + * devmem2.c: Simple program to read/write from/to any location in memory. + * + * Copyright (C) 2000, Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl) + * + * + * This software has been developed for the LART computing board + * (http://www.lart.tudelft.nl/). The development has been sponsored by + * the Mobile MultiMedia Communications (http://www.mmc.tudelft.nl/) + * and Ubiquitous Communications (http://www.ubicom.tudelft.nl/) + * projects. + * + * The author can be reached at: + * + * Jan-Derk Bakker + * Information and Communication Theory Group + * Faculty of Information Technology and Systems + * Delft University of Technology + * P.O. Box 5031 + * 2600 GA Delft + * The Netherlands + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define FATAL do { fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", \ + __LINE__, __FILE__, errno, strerror(errno)); exit(1); } while(0) + +#define MAP_SIZE 4096UL +#define MAP_MASK (MAP_SIZE - 1) + +int main(int argc, char **argv) { + int fd; + void *map_base, *virt_addr; + unsigned long read_result, writeval; + off_t target; + int access_type = 'w'; + + if(argc < 2) { + fprintf(stderr, "\nUsage:\t%s { address } [ type [ data ] ]\n" + "\taddress : memory address to act upon\n" + "\ttype : access operation type : [b]yte, [h]alfword, [w]ord\n" + "\tdata : data to be written\n\n", + argv[0]); + exit(1); + } + target = strtoul(argv[1], 0, 0); + + if(argc > 2) + access_type = tolower(argv[2][0]); + + + if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1) FATAL; + printf("/dev/mem opened.\n"); + fflush(stdout); + + /* Map one page */ + map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, target & ~MAP_MASK); + if(map_base == (void *) -1) FATAL; + printf("Memory mapped at address %p.\n", map_base); + fflush(stdout); + + virt_addr = map_base + (target & MAP_MASK); + switch(access_type) { + case 'b': + read_result = *((unsigned char *) virt_addr); + break; + case 'h': + read_result = *((unsigned short *) virt_addr); + break; + case 'w': + read_result = *((unsigned long *) virt_addr); + break; + default: + fprintf(stderr, "Illegal data type '%c'.\n", access_type); + exit(2); + } + printf("Value at address 0x%lX (%p): 0x%lX\n", target, virt_addr, read_result); + fflush(stdout); + + if(argc > 3) { + writeval = strtoul(argv[3], 0, 0); + switch(access_type) { + case 'b': + *((unsigned char *) virt_addr) = writeval; + read_result = *((unsigned char *) virt_addr); + break; + case 'h': + *((unsigned short *) virt_addr) = writeval; + read_result = *((unsigned short *) virt_addr); + break; + case 'w': + *((unsigned long *) virt_addr) = writeval; + read_result = *((unsigned long *) virt_addr); + break; + } + printf("Written 0x%lX; readback 0x%lX\n", writeval, read_result); + fflush(stdout); + } + + if(munmap(map_base, MAP_SIZE) == -1) FATAL; + close(fd); + return 0; +} + + diff --git a/utils/dfu-util/Makefile b/utils/dfu-util/Makefile new file mode 100644 index 0000000..4faa5e9 --- /dev/null +++ b/utils/dfu-util/Makefile @@ -0,0 +1,51 @@ +# +# 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:=dfu-util +PKG_VERSION:=r3095 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://sources.nslu2-linux.org/sources +PKG_MD5SUM:=2346dddceeab0e7090109f04d9c3a6be + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/dfu-util + SECTION:=utils + CATEGORY:=Utilities + TITLE:=OpenMoko device flash utility + URL:=http://wiki.openmoko.org/wiki/Dfu-util + DEPENDS:=+libusb +endef + +define Package/dfu-util/description + Dfu-util is a program that implements the host side of the USB DFU + (Universal Serial Bus Device Firmware Upgrade) protocol. + This version is specifically used to flash the FIC Neo 1973 mobile phone. +endef + +# CONFIGURE_VARS += USB_CFLAGS="-I $(STAGING_DIR)/usr/include" \ +# USB_LIBS="-L $(STAGING_DIR)/usr/lib" + +define Build/Configure + (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \ + ./autogen.sh \ + ); + $(call Build/Configure/Default) +endef + +define Package/dfu-util/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dfu-util $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,dfu-util)) diff --git a/utils/dfu-util/patches/001-no_static_binary.patch b/utils/dfu-util/patches/001-no_static_binary.patch new file mode 100644 index 0000000..2efa15e --- /dev/null +++ b/utils/dfu-util/patches/001-no_static_binary.patch @@ -0,0 +1,12 @@ +diff -urN dfu-util/src/Makefile.am dfu-util.new/src/Makefile.am +--- dfu-util/src/Makefile.am 2007-10-06 23:36:18.000000000 +0200 ++++ dfu-util.new/src/Makefile.am 2012-07-30 15:13:04.020948991 +0200 +@@ -6,7 +6,7 @@ + '\n#endif' > dfu-version.h + BUILT_SOURCES = dfu-version.h + +-bin_PROGRAMS = dfu-util dfu-util_static ++bin_PROGRAMS = dfu-util + dfu_util_SOURCES = main.c sam7dfu.c dfu.c dfu.h + + dfu_util_static_SOURCES = main.c sam7dfu.c dfu.c dfu.h diff --git a/utils/dialog/Makefile b/utils/dialog/Makefile new file mode 100644 index 0000000..d407ead --- /dev/null +++ b/utils/dialog/Makefile @@ -0,0 +1,37 @@ +# +# Copyright (C) 2006-2011 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:=dialog +PKG_VERSION:=1.1-20080819 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=ftp://invisible-island.net/dialog +PKG_MD5SUM:=3caebd641a9f337b980becb4444336c5 + +include $(INCLUDE_DIR)/package.mk + +define Package/dialog + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncurses + TITLE:=Dialog + URL:=http://invisible-island.net/dialog/ +endef + +define Package/dialog/description + A script-interpreter which provides a set of curses widgets. +endef + +define Package/dialog/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dialog $(1)/usr/bin +endef + +$(eval $(call BuildPackage,dialog)) diff --git a/utils/digitemp/Makefile b/utils/digitemp/Makefile new file mode 100644 index 0000000..cdbabaf --- /dev/null +++ b/utils/digitemp/Makefile @@ -0,0 +1,83 @@ +# +# Copyright (C) 2009-2011 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:=digitemp +PKG_VERSION:=3.6.0 +PKG_RELEASE:=5 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.digitemp.com/software/linux +PKG_MD5SUM:=9be2e48db37920f21925ae6e88f83b84 + +include $(INCLUDE_DIR)/package.mk + +define Package/digitemp/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=DigiTemp is a simple to use program for reading values from 1-wire devices. + URL:=http://www.digitemp.com +endef + +define Package/digitemp/Default/description + DigiTemp is a simple to use program for reading values from 1-wire devices. + Its main use is for reading temperature sensors, but it also reads counters, + and understands the 1-wire hubs with devices on different branches of the network. +endef + +define Package/digitemp +$(call Package/digitemp/Default) + TITLE += (serial version) +endef + +define Package/digitemp/description +$(call Package/digitemp/Default/description) + This package is build without USB support. +endef + +define Package/digitemp-usb +$(call Package/digitemp/Default) + TITLE += (USB version) + DEPENDS += +libusb +endef + +define Package/digitemp-usb/description +$(call Package/digitemp/Default/description) + This package is build with USB support. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) -DLINUX $(TARGET_CPPFLAGS) \ + -I./src -I./userial" \ + LIBS="$(TARGET_LDFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + ds9097 ds9097u + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) -DLINUX $(TARGET_CPPFLAGS) \ + -I./src -I./userial -DOWUSB" \ + LIBS="$(TARGET_LDFLAGS) -lusb -lm -DOWUSB" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + clean ds2490 +endef + +define Package/digitemp/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/digitemp_{DS9097,DS9097U} $(1)/usr/bin/ +endef + +define Package/digitemp-usb/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/digitemp_DS2490 $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,digitemp)) +$(eval $(call BuildPackage,digitemp-usb)) diff --git a/utils/dir300-flash/Makefile b/utils/dir300-flash/Makefile new file mode 100644 index 0000000..c271212 --- /dev/null +++ b/utils/dir300-flash/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2008 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:=dir300-flash +PKG_VERSION:=0.9.9 +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://x-alina.freifunk-potsdam.de/downloads/dir300-flash +PKG_MD5SUM:=84ad98c36393d7d238a229da67e23903 + +include $(INCLUDE_DIR)/package.mk + +define Package/dir300-flash + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Flashes a custom firmware on the DIR-300 wireless router + URL:=http://x-alina.freifunk-potsdam.de/ + PKGARCH:=all +endef + +define Download/ap61.ram + URL:=http://www.dd-wrt.com/dd-wrtv2/downloads/v24/Atheros%20WiSoc/Airlink%20101%20AR430W + FILE:=ap61.ram + MD5SUM:=4aaec2bff1edffe8c49003ed9363ad8b +endef + +define Download/ap61.rom + URL:=http://www.dd-wrt.com/dd-wrtv2/downloads/v24/Atheros%20WiSoc/Airlink%20101%20AR430W + FILE:=ap61.rom + MD5SUM:=eb7817d202c297ae5dc6b6b897632601 +endef + +define Download/dir300redboot.zip + URL:=http://www.shadowandy.net/wp/wp-content/uploads + FILE:=dir300redboot.zip + MD5SUM:=5fdb24432aa200b508026215d821e126 +endef + +define Build/Compile + unzip -n '$(DL_DIR)/dir300redboot.zip' -d '$(PKG_BUILD_DIR)' +endef + +define Package/dir300-flash/install + $(INSTALL_DIR) -- '$(1)/usr/sbin' + $(INSTALL_BIN) -- '$(PKG_BUILD_DIR)/dir300-flash.sh' '$(1)/usr/sbin/dir300-flash' + $(INSTALL_DIR) -- '$(1)/usr/share/dir300-flash' + $(INSTALL_DATA) -- '$(DL_DIR)/ap61.ram' '$(1)/usr/share/dir300-flash' + $(INSTALL_DATA) -- '$(DL_DIR)/ap61.rom' '$(1)/usr/share/dir300-flash' + $(INSTALL_DATA) -- '$(PKG_BUILD_DIR)/dir300redboot.rom' '$(1)/usr/share/dir300-flash' +endef + +$(eval $(call BuildPackage,dir300-flash)) +$(eval $(call Download,ap61.ram)) +$(eval $(call Download,ap61.rom)) +$(eval $(call Download,dir300redboot.zip)) diff --git a/utils/disktype/Makefile b/utils/disktype/Makefile new file mode 100644 index 0000000..667efde --- /dev/null +++ b/utils/disktype/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=disktype +PKG_VERSION:=9 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME)/ +PKG_MD5SUM:=25a673f162b9c01cd565109202559489 + +include $(INCLUDE_DIR)/package.mk + +define Package/disktype + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Disk format detection + SUBMENU:=Filesystem + URL:=http://disktype.sourceforge.net +endef + +define Package/disktype/description + The purpose of disktype is to detect the content format of a disk or disk image. + It knows about common file systems, partition tables, and boot codes. + The program is written in C and is designed to compile on any modern Unix flavour. + It is self-contained and in general works without special libraries or headers. + Some system-dependant features can be used to gather additional information. +endef + +MAKE_FLAGS += CC="$(TARGET_CC) $(TARGET_CFLAGS)" + +define Package/disktype/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,disktype)) diff --git a/utils/dmidecode/Makefile b/utils/dmidecode/Makefile new file mode 100644 index 0000000..c1f4a9f --- /dev/null +++ b/utils/dmidecode/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2007-2011 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:=dmidecode +PKG_VERSION:=2.11 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/dmidecode +PKG_MD5SUM:=535487cc041f2db746587cf40a2059f0 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/dmidecode + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=@TARGET_x86 + TITLE:=Displays BIOS informations. + URL:=http://www.nongnu.org/dmidecode/ +endef + +define Package/dmidecode/description + Dmidecode reports information about your system's hardware + as described in your system BIOS according to the SMBIOS/DMI + standard. +endef + +MAKE_FLAGS += \ + prefix="/usr" + +define Package/dmidecode/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/$(PKG_NAME) $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,dmidecode)) diff --git a/utils/dosfstools/Makefile b/utils/dosfstools/Makefile new file mode 100644 index 0000000..031cb85 --- /dev/null +++ b/utils/dosfstools/Makefile @@ -0,0 +1,96 @@ +# +# Copyright (C) 2006-2012 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:=dosfstools +PKG_VERSION:=3.0.12 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.daniel-baumann.ch/software/dosfstools +PKG_MD5SUM:=4c1f1e72b82371704f93ebdd3c7b6259 + +include $(INCLUDE_DIR)/package.mk + +define Package/dosfstools/Default + SECTION:=utils + CATEGORY:=Utilities + URL:=http://www.daniel-baumann.ch/software/dosfstools/ + SUBMENU:=Filesystem +endef + +define Package/dosfsck + $(call Package/dosfstools/Default) + TITLE:=dosfsck +endef + +define Package/dosfslabel + $(call Package/dosfstools/Default) + TITLE:=dosfslabel +endef + +define Package/mkdosfs + $(call Package/dosfstools/Default) + TITLE:=mkdosfs +endef + +define Package/dosfsck/description + Utilities to create and check MS-DOS FAT filesystems. + (fsck.vfat and fsck.msdos for checking integrity of FAT volumes) +endef + +define Package/dosfslabel/description + Utilities to create and check MS-DOS FAT filesystems. + (dosfslabel for reading and writing labels of FAT volumes) +endef + +define Package/mkdosfs/description + Utilities to create and check MS-DOS FAT filesystems. + (mkfs.vfat and mkfs.msdos for creating FAT volumes) +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + OPTFLAGS="$(TARGET_CFLAGS) -D_FILE_OFFSET_BITS=64" \ + PREFIX="/usr" \ + SBINDIR="/usr/sbin" \ + all + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + OPTFLAGS="$(TARGET_CFLAGS) -D_FILE_OFFSET_BITS=64" \ + PREFIX="$(PKG_INSTALL_DIR)/usr" \ + SBINDIR="$(PKG_INSTALL_DIR)/usr/sbin" \ + install-bin +endef + +define Package/dosfsck/install + $(INSTALL_DIR) $(1)/lib/functions/fsck + $(INSTALL_DATA) ./files/dosfsck.sh $(1)/lib/functions/fsck/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dosfsck $(1)/usr/sbin/ + (cd $(1)/usr/sbin; ln -sf dosfsck fsck.msdos; ln -sf dosfsck fsck.vfat) +endef + +define Package/dosfslabel/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dosfslabel $(1)/usr/sbin/ +endef + +define Package/mkdosfs/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkdosfs $(1)/usr/sbin/ + (cd $(1)/usr/sbin; ln -sf mkdosfs mkfs.msdos; ln -sf mkdosfs mkfs.vfat) +endef + +$(eval $(call BuildPackage,dosfsck)) +$(eval $(call BuildPackage,dosfslabel)) +$(eval $(call BuildPackage,mkdosfs)) diff --git a/utils/dosfstools/files/dosfsck.sh b/utils/dosfstools/files/dosfsck.sh new file mode 100644 index 0000000..bcc29b9 --- /dev/null +++ b/utils/dosfstools/files/dosfsck.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Copyright 2010 Vertical Communications +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +fsck_dosfsck() { + dosfsck -p "$device" 2>&1 | logger -t "fstab: dosfsck ($device)" + local status="$?" + case "$status" in + 0|1) ;; #success + 2) reboot;; + 4) echo "dosfsck ($device): Warning! Uncorrected errors."| logger -t fstab + return 1 + ;; + *) echo "dosfsck ($device): Error $status. Check not complete."| logger -t fstab;; + esac + return 0 +} + +fsck_dos() { + fsck_dosfsck "$@" +} + +fsck_vfat() { + fsck_dosfsck "$@" +} + +append libmount_known_fsck "dos" +append libmount_known_fsck "vfat" diff --git a/utils/dosfstools/patches/002-linux_26_headers.patch b/utils/dosfstools/patches/002-linux_26_headers.patch new file mode 100644 index 0000000..b55a7c8 --- /dev/null +++ b/utils/dosfstools/patches/002-linux_26_headers.patch @@ -0,0 +1,54 @@ +--- a/src/common.h ++++ b/src/common.h +@@ -19,7 +19,7 @@ + can be found in /usr/share/common-licenses/GPL-3 file. + */ + +-#include ++#include + + #ifndef _COMMON_H + #define _COMMON_H +--- a/src/dosfsck.h ++++ b/src/dosfsck.h +@@ -31,7 +31,7 @@ + #define _LINUX_STRING_H_ /* hack to avoid inclusion of */ + #define _LINUX_FS_H /* hack to avoid inclusion of */ + +-#include ++#include + #include + + #include +--- a/src/file.c ++++ b/src/file.c +@@ -33,7 +33,7 @@ + #define _LINUX_STRING_H_ /* hack to avoid inclusion of */ + #define _LINUX_FS_H /* hack to avoid inclusion of */ + +-#include ++#include + + #include + +--- a/src/io.c ++++ b/src/io.c +@@ -39,6 +39,7 @@ + #include + #include + #include ++#include + #include + + #include "dosfsck.h" +--- a/src/mkdosfs.c ++++ b/src/mkdosfs.c +@@ -63,7 +63,7 @@ + #include + #include + +-#include ++#include + + #if __BYTE_ORDER == __BIG_ENDIAN + diff --git a/utils/dstat/Makefile b/utils/dstat/Makefile new file mode 100644 index 0000000..c05d405 --- /dev/null +++ b/utils/dstat/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2012 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:=dstat +PKG_VERSION:=0.7.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://dag.wieers.com/home-made/dstat/ +PKG_MD5SUM:=bfea4dc8037a0b18fc40a4dfc104dcc8 + +include $(INCLUDE_DIR)/package.mk + +define Package/dstat + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Versatile resource statistics tool + URL:=http://dag.wieers.com/home-made/dstat/ + DEPENDS:=+python +endef + +define Package/dstat/description + Dstat is a versatile replacement for vmstat, iostat, netstat + and ifstat. Dstat overcomes some of their limitations and + adds some extra features, more counters and flexibility. + Dstat is handy for monitoring systems during performance + tuning tests, benchmarks or troubleshooting. +endef + +define Build/Compile +endef + +define Package/dstat/install + $(INSTALL_DIR) $(1)/usr/share/dstat + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dstat $(1)/usr/share/dstat/dstat.py + $(INSTALL_DATA) $(PKG_BUILD_DIR)/plugins/dstat_*.py $(1)/usr/share/dstat/ + $(INSTALL_DIR) $(1)/usr/bin + $(LN) -sf ../share/dstat/dstat.py $(1)/usr/bin/dstat +endef + +$(eval $(call BuildPackage,dstat)) diff --git a/utils/dt/Makefile b/utils/dt/Makefile new file mode 100644 index 0000000..d3a0147 --- /dev/null +++ b/utils/dt/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2009 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:=dt +PKG_VERSION:=15.14 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-source.tar.gz +PKG_SOURCE_URL:=http://home.comcast.net/~SCSIguy/SCSI_FAQ/RMiller_Tools/ftp/$(PKG_NAME)/ +PKG_MD5SUM:=5776233a2d301a50b314306538257a45 + +include $(INCLUDE_DIR)/package.mk + +PKG_UNPACK= \ + zcat $(DL_DIR)/$(PKG_SOURCE) | \ + $(TAR) -C $(PKG_BUILD_DIR) --strip-components 2 $(TAR_OPTIONS); + +define Package/dt + CATEGORY:=Utilities + SECTION:=utils + TITLE:=A generic data test program + URL:=http://www.scsifaq.org/RMiller_Tools/index.html + DEPENDS:=+libpthread +librt +endef + +define Package/dt/description + dt is a generic data test program used to verify proper operation of peripherals, + file systems, device drivers, or any data stream supported by the operating system. + In its' simplest mode of operation, dt writes and then verifys its' default data pattern, + then displays performance statisics and other test parameters before exiting. + Since verification of data is performed, dt can be thought of as a generic diagnostic tool. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) -f Makefile.linux \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -DFIFO -DMMAP -DTTY -D__linux__ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" \ + dt +endef + +define Package/dt/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dt $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,dt)) diff --git a/utils/dtach/Makefile b/utils/dtach/Makefile new file mode 100644 index 0000000..e027420 --- /dev/null +++ b/utils/dtach/Makefile @@ -0,0 +1,48 @@ +# +# 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:=dtach +PKG_VERSION:=0.8 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/dtach +PKG_MD5SUM:=ec5999f3b6bb67da19754fcb2e5221f3 + +include $(INCLUDE_DIR)/package.mk + +define Package/dtach + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A program that emulates the dtach feature of screen + URL:=http://dtach.sourceforge.net/ +endef + +define Package/dtach/description + dtach is a tiny program that emulates the detach feature of screen, + allowing you to run a program in an environment that is protected from + the controlling terminal and attach to it later. dtach does not keep + track of the contents of the screen, and thus works best with programs + that know how to redraw themselves. +endef + +define Build/Configure + $(call Build/Configure/Default) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +define Package/dtach/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dtach $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,dtach)) diff --git a/utils/empty/Makefile b/utils/empty/Makefile new file mode 100644 index 0000000..9c3b3c9 --- /dev/null +++ b/utils/empty/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2007 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:=empty +PKG_VERSION:=0.6.18b +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/empty +PKG_MD5SUM:=2cf5e1b8ff58c41b63738bdc7c24fbc2 + +include $(INCLUDE_DIR)/package.mk + +define Package/empty + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Run applications under pseudo-terminal sessions + URL:=http://empty.sourceforge.net +endef + +define Package/empty/description + empty is an utility that provides an interface to execute and/or interact + with processes under pseudo-terminal sessions (PTYs). This tool is + definitely useful in programming of shell scripts designed to communicate + with interactive programs like telnet, ssh, ftp, etc. In some cases, empty + can be the simplest replacement for TCL/expect or other similar + programming tools. +endef + +define Package/empty/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,empty)) diff --git a/utils/event_test/Makefile b/utils/event_test/Makefile new file mode 100644 index 0000000..c10fe4b --- /dev/null +++ b/utils/event_test/Makefile @@ -0,0 +1,37 @@ +# +# Copyright (C) 2008 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:=event_test +PKG_VERSION:=0.01 +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/event_test + +include $(INCLUDE_DIR)/package.mk + +define Package/event_test + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Event device test program +endef + +define Package/event_test/description + This package contains an utility for testing event devices. +endef + +define Build/Prepare + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Package/event_test/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/event_test $(1)/sbin/ +endef + +$(eval $(call BuildPackage,event_test)) diff --git a/utils/event_test/src/Makefile b/utils/event_test/src/Makefile new file mode 100644 index 0000000..74eedbf --- /dev/null +++ b/utils/event_test/src/Makefile @@ -0,0 +1,17 @@ +# +# Copyright (C) 2008 OpenWrt.org +# +# This is free software, licensed under GNU General Public Licese v2. +# See /LICENSE for more information. +# + +all: event_test + +%.o: %.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $^ + +event_test: evtest.o + $(CC) -o $@ $^ + +clean: + rm -f *.o event_test diff --git a/utils/event_test/src/evtest.c b/utils/event_test/src/evtest.c new file mode 100644 index 0000000..b62209b --- /dev/null +++ b/utils/event_test/src/evtest.c @@ -0,0 +1,309 @@ +/* + * + * Copyright (c) 1999-2000 Vojtech Pavlik + * + * As modified by Rene van Paassen, May 19, 2005 + * Event device test program + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Should you need to contact me, the author, you can do so either by + * e-mail - mail your message to , or by paper mail: + * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic + */ + +#include +#include +#include +#include +#include +#include +#include + +char *events[EV_MAX + 1] = { "Reset", "Key", "Relative", "Absolute", "MSC", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL, "LED", "Sound", NULL, "Repeat", "ForceFeedback", "Power", "ForceFeedbackStatus"}; + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 0) + +/* Keys updated with version 2.6.11, am assuming this is 2.6 style */ +char *keys[KEY_MAX + 1] = + { "Reserved", "Esc", /* 0, 1 */ + "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", /* 2 - 11 */ + "Minus", "Equal", "Backspace", "Tab", /* 12 - 15 */ + "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", /* 16 - 25 */ + "LeftBrace", "RightBrace", "Enter", "LeftControl", /* 26 - 29 */ + "A", "S", "D", "F", "G", "H", "J", "K", "L", /* 30 - 38 */ + "Semicolon", "Apostrophe", "Grave", "LeftShift", "BackSlash", /* 39 - 43 */ + "Z", "X", "C", "V", "B", "N", "M", /* 44 - 50 */ + "Comma", "Dot", "Slash", "RightShift", "KPAsterisk", + "LeftAlt", "Space", "CapsLock", /* 51 - 58 */ + "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", /* 59 - 68 */ + "NumLock", "ScrollLock", /* 69, 70 */ + "KP7", "KP8", "KP9", "KPMinus", /* 71 - 74 */ + "KP4", "KP5", "KP6", "KPPlus", /* 75 - 78 */ + "KP1", "KP2", "KP3", "KP0", "KPDot", /* 79 - 83 */ + NULL, + "ZENKAKUHANKAKU", /* 85 */ + "102nd", "F11", "F12", /* 86 - 88 */ + "R0", "KATAKANA", "HIRAGANA", "HENKAN", /* 89 - 92 */ + "KATAKANAHIRAGANA", "MUHENKAN", "KPJPCOMMA", /* 93 - 95 */ + "KPEnter", "RightCtrl", "KPSlash", "SysRq", /* 96 - 99 */ + "RightAlt", "LineFeed", /*100 - 101 */ + "Home", "Up", "PageUp", "Left", "Right", "End", "Down", + "PageDown", "Insert", "Delete", /* 102 - 111 */ + "Macro", "Mute", "VolumeDown", "VolumeUp", "Power", /* 112 - 116 */ + "KPEqual", "KPPlusMinus", "Pause", /* 117 - 119 */ + NULL, + "KPComma", /* 121 */ + "Hanguel", "Hanja", "Yen", /* 122 - 124 */ + "LeftMeta", "RightMeta", "Compose", /* 125 - 127 */ + "Stop", "Again", "Props", "Undo", "Front", "Copy", "Open", + "Paste", "Find", "Cut", "Help", "Menu", "Calc", "Setup", + "Sleep", "WakeUp", "File", "SendFile", "DeleteFile", "X-fer", + "Prog1", "Prog2", "WWW", "MSDOS", "Coffee", "Direction", + "CycleWindows", "Mail", "Bookmarks", "Computer", + "Back", "Forward", "CloseCD", "EjectCD", "EjectCloseCD", + "NextSong", "PlayPause", "PreviousSong", "StopCD", + "Record", "Rewind", "Phone", /* 128 - 169 */ + "ISOKey", "Config", "HomePage", "Refresh", "Exit", + "Move", "Edit", "ScrollUp", "ScrollDown", /* 170 - 178 */ + "KPLeftParenthesis", "KPRightParenthesis", /* 179 - 180 */ + NULL, NULL, + "F13", "F14", "F15", "F16", "F17", "F18", + "F19", "F20", "F21", "F22", "F23", "F24", /* 183 - 194 */ + NULL, NULL, NULL, NULL, NULL, + "PlayCD", "PauseCD", "Prog3", "Prog4", NULL, + "Suspend", "Close", /* 200 - 206 */ + "Play", "FastForward", "BassBoost", "Print", "HP", "Camera", + "Sound", "Question", "Email", "Chat", "Search", + "Connect", "Finance", "Sport", "Shop", "AltErase", + "Cancel", "BrightnessDown", "BrightnessUp", "Media", /* 207 - 226 */ + "SwitchVideoMode", + "KBDIllumToggle", "KBDIllumDown", "KBDIllumUp", /* 227 - 230 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + "Unknown", /* 240 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, + "Btn0", "Btn1", "Btn2", "Btn3", "Btn4", + "Btn5", "Btn6", "Btn7", "Btn8", "Btn9", /* 256 - 265 */ + NULL, NULL, NULL, NULL, NULL, NULL, + "LeftBtn", "RightBtn", "MiddleBtn", "SideBtn", + "ExtraBtn", "ForwardBtn", "BackBtn", "TaskBtn", /* 0x110 - 0x117 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + "Trigger", "ThumbBtn", "ThumbBtn2", "TopBtn", + "TopBtn2", "PinkieBtn", "BaseBtn", "BaseBtn2", + "BaseBtn3", "BaseBtn4", "BaseBtn5", "BaseBtn6", + NULL, NULL, NULL, "BtnDead", /* 0x120 - 0x12f */ + "BtnA", "BtnB", "BtnC", "BtnX", + "BtnY", "BtnZ", "BtnTL", "BtnTR", + "BtnTL2", "BtnTR2", "BtnSelect", "BtnStart", + "BtnMode", "BtnThumbL", "BtnThumbR", /* 0x130 - 0x13e */ NULL, + "ToolPen", "ToolRubber", "ToolBrush", "ToolPencil", + "ToolAirbrush", "ToolFinger", "ToolMouse", "ToolLens", /* 0x140-0x147 */ + NULL, NULL, "Touch", "Stylus", + "Stylus2", "DoubleTap", "TripleTap", /* 0x14a - 0x14e */ NULL, + "GearUp", "GearDown", /* 0x150, 0x151 */ + NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + "Ok", "Select", "Goto", "Clear", "Power2", "Option", "Info", "Time", + "Vendor", "Archive", "Program", "Channel", + "Favorites", "Epg", "Pvr", "Mhp", + "Language", "Title", "Subtitle", "Angle", + "Zoom", "Mode", "Keyboard", "Screen", + "Pc", "Tv", "Tv2", "Vcr", "Vcr2", "Sat", "Sat2", "Cd", + "Tape", "Radio", "Tuner", "Player", "Text", "Dvd", "Aux", "Mp3", + "Audio", "Video", "Directory", "List", + "Memo", "Calendar", "Red", "Green", + "Yellow", "Blue", "Channelup", "Channeldown", + "First", "Last", "Ab", "Next", + "Restart", "Slow", "Shuffle", "Break", + "Previous", "Digits", "Teen", "Twen", /* 160 - 19f */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + "DelEol", "DelEos", "InsLine", "DelLine", /* 1c0 - 1c3 */ + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + "FN", "FN_ESC", + "FN_F1", "FN_F2", "FN_F3", "FN_F4", "FN_F5", + "FN_F6", "FN_F7", "FN_F8", "FN_F9", "FN_F10", + "FN_F11", "FN_F12", + "FN_1", "FN_2", "FN_D", "FN_E", "FN_F", "FN_S", "FN_B" /* 0x1d0 - 0x1e4 */ + }; + +#else + +/* Keys I used with 2.4 kernels. */ +char *keys[KEY_MAX + 1] = { "Reserved", "Esc", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "Minus", "Equal", "Backspace", +"Tab", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "LeftBrace", "RightBrace", "Enter", "LeftControl", "A", "S", "D", "F", "G", +"H", "J", "K", "L", "Semicolon", "Apostrophe", "Grave", "LeftShift", "BackSlash", "Z", "X", "C", "V", "B", "N", "M", "Comma", "Dot", +"Slash", "RightShift", "KPAsterisk", "LeftAlt", "Space", "CapsLock", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", +"NumLock", "ScrollLock", "KP7", "KP8", "KP9", "KPMinus", "KP4", "KP5", "KP6", "KPPlus", "KP1", "KP2", "KP3", "KP0", "KPDot", "103rd", +"F13", "102nd", "F11", "F12", "F14", "F15", "F16", "F17", "F18", "F19", "F20", "KPEnter", "RightCtrl", "KPSlash", "SysRq", +"RightAlt", "LineFeed", "Home", "Up", "PageUp", "Left", "Right", "End", "Down", "PageDown", "Insert", "Delete", "Macro", "Mute", +"VolumeDown", "VolumeUp", "Power", "KPEqual", "KPPlusMinus", "Pause", "F21", "F22", "F23", "F24", "KPComma", "LeftMeta", "RightMeta", +"Compose", "Stop", "Again", "Props", "Undo", "Front", "Copy", "Open", "Paste", "Find", "Cut", "Help", "Menu", "Calc", "Setup", +"Sleep", "WakeUp", "File", "SendFile", "DeleteFile", "X-fer", "Prog1", "Prog2", "WWW", "MSDOS", "Coffee", "Direction", +"CycleWindows", "Mail", "Bookmarks", "Computer", "Back", "Forward", "CloseCD", "EjectCD", "EjectCloseCD", "NextSong", "PlayPause", +"PreviousSong", "StopCD", "Record", "Rewind", "Phone", "ISOKey", "Config", "HomePage", "Refresh", "Exit", "Move", "Edit", "ScrollUp", +"ScrollDown", "KPLeftParenthesis", "KPRightParenthesis", +"International1", "International2", "International3", "International4", "International5", +"International6", "International7", "International8", "International9", +"Language1", "Language2", "Language3", "Language4", "Language5", "Language6", "Language7", "Language8", "Language9", +NULL, +"PlayCD", "PauseCD", "Prog3", "Prog4", "Suspend", "Close", +NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +"Btn0", "Btn1", "Btn2", "Btn3", "Btn4", "Btn5", "Btn6", "Btn7", "Btn8", "Btn9", +NULL, NULL, NULL, NULL, NULL, NULL, +"LeftBtn", "RightBtn", "MiddleBtn", "SideBtn", "ExtraBtn", "ForwardBtn", "BackBtn", +NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +"Trigger", "ThumbBtn", "ThumbBtn2", "TopBtn", "TopBtn2", "PinkieBtn", +"BaseBtn", "BaseBtn2", "BaseBtn3", "BaseBtn4", "BaseBtn5", "BaseBtn6", +NULL, NULL, NULL, "BtnDead", +"BtnA", "BtnB", "BtnC", "BtnX", "BtnY", "BtnZ", "BtnTL", "BtnTR", "BtnTL2", "BtnTR2", "BtnSelect", "BtnStart", "BtnMode", +"BtnThumbL", "BtnThumbR", NULL, +"ToolPen", "ToolRubber", "ToolBrush", "ToolPencil", "ToolAirbrush", "ToolFinger", "ToolMouse", "ToolLens", NULL, NULL, +"Touch", "Stylus", "Stylus2" }; +#endif + +char *absval[5] = { "Value", "Min ", "Max ", "Fuzz ", "Flat " }; +char *relatives[REL_MAX + 1] = + { "X", "Y", "Z", NULL, + NULL, NULL, "HWheel", "Dial", + /* 0x08: */ "Wheel", "MISC" }; +char *absolutes[ABS_MAX + 1] = + { "X", "Y", "Z", "Rx", "Ry", "Rz", "Throttle", "Rudder", + "Wheel", "Gas", "Brake", NULL, NULL, NULL, NULL, NULL, + /* 0x10: */ "Hat0X", "Hat0Y", "Hat1X", "Hat1Y", + "Hat2X", "Hat2Y", "Hat3X", "Hat 3Y", + "Pressure", "Distance", "XTilt", "YTilt", + "ToolWidth", NULL, NULL, NULL, + /* 0x20: */ "Volume", NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + /* 0x28: */ "Misc" }; +char *leds[LED_MAX + 1] = { "NumLock", "CapsLock", "ScrollLock", "Compose", "Kana", "Sleep", "Suspend", "Mute" }; +char *repeats[REP_MAX + 1] = { "Delay", "Period" }; +char *sounds[SND_MAX + 1] = { "Bell", "Click" }; + +char **names[EV_MAX + 1] = { events, keys, relatives, absolutes, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, leds, sounds, NULL, repeats, NULL, NULL, NULL }; + +#define BITS_PER_LONG (sizeof(long) * 8) +#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) +#define OFF(x) ((x)%BITS_PER_LONG) +#define BIT(x) (1UL<> OFF(bit)) & 1) + +int main (int argc, char **argv) +{ + int fd, rd, i, j, k; + struct input_event ev[64]; + int version; + unsigned short id[4]; + unsigned long bit[EV_MAX][NBITS(KEY_MAX)]; + char name[256] = "Unknown"; + int abs[5]; + +#if 0 + for (i = 0; i < KEY_MAX; i++) { + printf("Key %d, name \"%s\"\n", i, keys[i] ? keys[i]: "?"); + } +#endif + + if (argc < 2) { + printf ("Usage: evtest /dev/inputX\n"); + printf ("Where X = input device number\n"); + exit (1); + } + + if ((fd = open(argv[argc - 1], O_RDONLY)) < 0) { + perror("evtest"); + exit(1); + } + + ioctl(fd, EVIOCGVERSION, &version); + printf("Input driver version is %d.%d.%d\n", + version >> 16, (version >> 8) & 0xff, version & 0xff); + + ioctl(fd, EVIOCGID, id); + printf("Input device ID: bus 0x%x vendor 0x%x product 0x%x version 0x%x\n", + id[ID_BUS], id[ID_VENDOR], id[ID_PRODUCT], id[ID_VERSION]); + + ioctl(fd, EVIOCGNAME(sizeof(name)), name); + printf("Input device name: \"%s\"\n", name); + + memset(bit, 0, sizeof(bit)); + ioctl(fd, EVIOCGBIT(0, EV_MAX), bit[0]); + printf("Supported events:\n"); + + for (i = 0; i < EV_MAX; i++) + { + if (test_bit(i, bit[0])) + { + printf(" Event type %d (%s)\n", i, events[i] ? events[i] : "?"); + ioctl(fd, EVIOCGBIT(i, KEY_MAX), bit[i]); + for (j = 0; j < KEY_MAX; j++) + { + if (test_bit(j, bit[i])) + { + printf(" Event code %d (%s)\n", j, names[i] ? (names[i][j] ? names[i][j] : "?") : "?"); + if (i == EV_ABS) + { + ioctl(fd, EVIOCGABS(j), abs); + for (k = 0; k < 5; k++) + { + if ((k < 3) || abs[k]) + { + printf(" %s %6d\n", absval[k], abs[k]); + } + } + } + } + } + } + } + + printf("Testing ... (interrupt to exit)\n"); + + while (1) + { + rd = read(fd, ev, sizeof(struct input_event) * 64); + + if (rd < (int) sizeof(struct input_event)) + { + printf("yyy\n"); + perror("\nevtest: error reading"); + exit (1); + } + + for (i = 0; i < rd / sizeof(struct input_event); i++) + { + printf("Event: time %ld.%06ld, type %d (%s), code %d (%s), value %d\n", + ev[i].time.tv_sec, + ev[i].time.tv_usec, + ev[i].type, + events[ev[i].type] ? events[ev[i].type] : "?", + ev[i].code, + names[ev[i].type] ? (names[ev[i].type][ev[i].code] ? names[ev[i].type][ev[i].code] : "?") : "?", + ev[i].value); + } + } +} diff --git a/utils/fancontroled/Makefile b/utils/fancontroled/Makefile new file mode 100644 index 0000000..c308800 --- /dev/null +++ b/utils/fancontroled/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2010-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=fancontroled +PKG_VERSION:=0.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar +PKG_SOURCE_URL:=http://code.lukaperkov.net/fancontroled/ +PKG_MD5SUM:=8c3a7efa99e58216ad4633d1e6ed1358 + +include $(INCLUDE_DIR)/package.mk + +define Package/fancontroled + SECTION:=utils + CATEGORY:=Utilities + TITLE:=fancontroled + DEPENDS:=+libsensors + URL:=http://fancontroled.lukaperkov.net/ +endef + +define Package/fancontroled/description + fancontroled is linux daemon written in C implementing a temperature dependent fan speed control. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + INC_PATH="-I$(STAGING_DIR)/usr/include/ -I$(STAGING_DIR)/usr/lib/" + + $(STRIP) $(PKG_BUILD_DIR)/$(PKG_NAME) + + mkdir -p $(PKG_INSTALL_DIR)/usr/sbin + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install +endef + +define Package/fancontroled/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/$(PKG_NAME) $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/fancontroled.init $(1)/etc/init.d/fancontroled +endef + +$(eval $(call BuildPackage,fancontroled)) diff --git a/utils/fancontroled/files/fancontroled.init b/utils/fancontroled/files/fancontroled.init new file mode 100644 index 0000000..b872553 --- /dev/null +++ b/utils/fancontroled/files/fancontroled.init @@ -0,0 +1,25 @@ +#!/bin/sh /etc/rc.common + +START=75 +STOP=75 + +SERVICE_NAME="fancontroled" +SERVICE_COMMAND="/usr/sbin/$SERVICE_NAME" +SERVICE_PID_FILE="/var/run/$SERVICE_NAME.pid" + +TEMP_SENSOR_CHIP=lm75 +TEMP_READ_FIELD=temp1_input +MIN_TEMP=30 +MAX_TEMP=50 +FAN_SENSOR_CHIP=g760a +FAN_CONTROL_FIELD=pwm1 +PWM_FAN_MIN=1 +PWM_FAN_MAX=180 + +start() { + service_start $SERVICE_COMMAND -t $TEMP_SENSOR_CHIP -r $TEMP_READ_FIELD -m $MIN_TEMP -M $MAX_TEMP -f $FAN_SENSOR_CHIP -c $FAN_CONTROL_FIELD -p $PWM_FAN_MIN -P $PWM_FAN_MAX -z $SERVICE_PID_FILE +} + +stop() { + service_stop $SERVICE_COMMAND +} diff --git a/utils/firmwarehotplug/Makefile b/utils/firmwarehotplug/Makefile new file mode 100644 index 0000000..22756cc --- /dev/null +++ b/utils/firmwarehotplug/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2006-2009 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:=firmwarehotplug +PKG_VERSION:=0.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/linux-hotplug +PKG_MD5SUM:=e5cf352b172f498e27b160167b981f24 + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +# workaround for fedora sdcc naming changes +ifneq ($(wildcard /usr/libexec/sdcc),) + export PATH:=$(PATH):/usr/libexec +endif + +define Package/firmwarehotplug + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=@USB_SUPPORT +fxload + TITLE:=Hotplug firmware for EZ-USB microcontrollers + URL:=http://linux-hotplug.sourceforge.net/ +endef + +MAKE_PATH:=ezusb/midi/original + +MAKE_FLAGS+=\ + OPT="$(TARGET_CFLAGS)" + +define Package/firmwarehotplug/install + $(INSTALL_DIR) $(1)/etc/hotplug.d/usb + install -m755 $(PKG_BUILD_DIR)/ezusb/midi/original/Hotplug/ezusbmidi $(1)/etc/hotplug.d/usb + install -m644 $(PKG_BUILD_DIR)/ezusb/midi/original/Hotplug/ezusbmidi.usermap $(1)/etc/hotplug.d + $(INSTALL_DIR) $(1)/usr/share/usb/ezusbmidi + install -m644 $(PKG_BUILD_DIR)/ezusb/midi/original/ezusbmidi1x1.ihx $(1)/usr/share/usb/ezusbmidi + install -m644 $(PKG_BUILD_DIR)/ezusb/midi/original/ezusbmidi2x2.ihx $(1)/usr/share/usb/ezusbmidi +endef + +$(eval $(call BuildPackage,firmwarehotplug)) + diff --git a/utils/firmwarehotplug/patches/001-no_documentation.patch b/utils/firmwarehotplug/patches/001-no_documentation.patch new file mode 100644 index 0000000..0079fdd --- /dev/null +++ b/utils/firmwarehotplug/patches/001-no_documentation.patch @@ -0,0 +1,12 @@ +diff -urN firmwarehotplug-0.1/ezusb/midi/original/Makefile firmwarehotplug-0.1.new/ezusb/midi/original/Makefile +--- firmwarehotplug-0.1/ezusb/midi/original/Makefile 2003-05-19 02:10:28.000000000 +0200 ++++ firmwarehotplug-0.1.new/ezusb/midi/original/Makefile 2007-01-01 23:07:42.000000000 +0100 +@@ -1,7 +1,7 @@ + VERSION = $(shell date +%Y_%m_%d) + RELEASE_NAME = ezusbmidi-$(VERSION) + +-all: ezusbmidi1x1.ihx ezusbmidi2x2.ihx ezusbmidi.html ezusbmidi.ps ++all: ezusbmidi1x1.ihx ezusbmidi2x2.ihx + + ezusbmidi1x1.ihx: ezusbmidi.c ezusb_reg.h bufsync.h + rm -rf sdcc; mkdir sdcc; cp $^ sdcc diff --git a/utils/firmwarehotplug/patches/100-compile-fixes.patch b/utils/firmwarehotplug/patches/100-compile-fixes.patch new file mode 100644 index 0000000..056a9c6 --- /dev/null +++ b/utils/firmwarehotplug/patches/100-compile-fixes.patch @@ -0,0 +1,36 @@ +Index: firmwarehotplug-0.1/ezusb/midi/original/Makefile +=================================================================== +--- firmwarehotplug-0.1.orig/ezusb/midi/original/Makefile 2010-10-29 19:21:43.867000023 +0200 ++++ firmwarehotplug-0.1/ezusb/midi/original/Makefile 2010-10-29 19:27:09.590002911 +0200 +@@ -1,15 +1,18 @@ + VERSION = $(shell date +%Y_%m_%d) + RELEASE_NAME = ezusbmidi-$(VERSION) + ++SDCC = sdcc ++PACKIHX = packihx ++ + all: ezusbmidi1x1.ihx ezusbmidi2x2.ihx + + ezusbmidi1x1.ihx: ezusbmidi.c ezusb_reg.h bufsync.h +- rm -rf sdcc; mkdir sdcc; cp $^ sdcc +- cd sdcc; sdcc -DCONFIG_MidiSport1x1 -I. $<; packihx ezusbmidi.ihx > ../$@ ++ rm -rf sdcc.1x1 && mkdir sdcc.1x1 && cp $^ sdcc.1x1/ ++ cd sdcc.1x1 && $(SDCC) -DCONFIG_MidiSport1x1 -I. $< && $(PACKIHX) ezusbmidi.ihx > ../$@ + + ezusbmidi2x2.ihx: ezusbmidi.c ezusb_reg.h bufsync.h +- rm -rf sdcc; mkdir sdcc; cp $^ sdcc +- cd sdcc; sdcc -DCONFIG_MidiSport2x2 -I. $<; packihx ezusbmidi.ihx > ../$@ ++ rm -rf sdcc.2x2 && mkdir sdcc.2x2 && cp $^ sdcc.2x2/ ++ cd sdcc.2x2 && $(SDCC) -DCONFIG_MidiSport2x2 -I. $< && $(PACKIHX) ezusbmidi.ihx > ../$@ + + ezusbmidi.ps: ezusbmidi.sgml descriptor.png + sgml2latex --output=ps $< +@@ -27,7 +30,7 @@ + fakeroot dpkg-buildpackage + + clean: +- rm -rf sdcc ++ rm -rf sdcc* + rm -f [1-9] *.pdf *.html *.ps *.ihx *.tar.gz *.tar.bz2 ezusbmidi.spec + rm -rf debian/ezusbmidi debian/files build-stamp configure-stamp + diff --git a/utils/flashrom/Makefile b/utils/flashrom/Makefile new file mode 100644 index 0000000..354b991 --- /dev/null +++ b/utils/flashrom/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2010-2011 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:=flashrom +PKG_VERSION:=0.9.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://download.flashrom.org/releases +PKG_MD5SUM:=d739a91aece12cc1e622038bb199541c + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/flashrom + SECTION:=utils + CATEGORY:=Utilities + TITLE:=FlashROM Utility + URL:=http://www.flashrom.org/ +# XXX: needs , only available on these arch right now + DEPENDS:=+zlib +pciutils +dmidecode +libftdi +libusb @(arm||armeb||i386||i686||x86_64) +endef + +define Package/flashrom/description + flashrom is a utility for identifying, reading, writing, verifying + and erasing flash chips. It's often used to flash BIOS/EFI/coreboot + /firmware images. +endef + +MAKE_FLAGS += \ + PREFIX="/usr" + +define Package/flashrom/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,flashrom)) diff --git a/utils/flashrom/patches/001-msr_dev_path.patch b/utils/flashrom/patches/001-msr_dev_path.patch new file mode 100644 index 0000000..d018c72 --- /dev/null +++ b/utils/flashrom/patches/001-msr_dev_path.patch @@ -0,0 +1,21 @@ +--- a/physmap.c ++++ b/physmap.c +@@ -352,7 +352,7 @@ int setup_cpu_msr(int cpu) + { + char msrfilename[64]; + memset(msrfilename, 0, sizeof(msrfilename)); +- snprintf(msrfilename, sizeof(msrfilename), "/dev/cpu/%d/msr", cpu); ++ snprintf(msrfilename, sizeof(msrfilename), "/dev/msr%d", cpu); + + if (fd_msr != -1) { + msg_pinfo("MSR was already initialized\n"); +@@ -362,7 +362,8 @@ int setup_cpu_msr(int cpu) + fd_msr = open(msrfilename, O_RDWR); + + if (fd_msr < 0) { +- perror("Error while opening /dev/cpu/0/msr"); ++ fprintf(stderr, "Error while opening %s: %s\n", msrfilename, ++ strerror(errno)); + msg_pinfo("Did you run 'modprobe msr'?\n"); + return -1; + } diff --git a/utils/fortune-mod/Makefile b/utils/fortune-mod/Makefile new file mode 100644 index 0000000..e3482c7 --- /dev/null +++ b/utils/fortune-mod/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2007 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:=fortune-mod +PKG_VERSION:=1.2.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://freeware.sgi.com/source/fortune-mod +PKG_MD5SUM:=383b1de06b35450235732c7ae7b5f0e3 + +include $(INCLUDE_DIR)/package.mk + +define Package/fortune-mod + SECTION:=utils + CATEGORY:=Utilities + TITLE:=display fortune cookies on demand. + URL:=http://packages.debian.org/fortune-mod +endef + +define Package/fortune-mod/description +Fortune mod displays fortune cookies on demand +endef + +define Build/Compile + $(HOSTCC) -Wall -o $(PKG_BUILD_DIR)/util/strfile-host $(PKG_BUILD_DIR)/util/strfile.c -DVERSION=\"$(PKG_VERSION)\" + $(PKG_BUILD_DIR)/util/strfile-host $(PKG_BUILD_DIR)/datfiles/fortunes $(PKG_BUILD_DIR)/datfiles/fortunes.dat + $(MAKE) -C $(PKG_BUILD_DIR)/fortune +endef + +define Package/fortune-mod/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/fortune/fortune $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/share/games/fortunes + $(INSTALL_BIN) $(PKG_BUILD_DIR)/datfiles/fortunes $(1)/usr/share/games/fortunes + $(INSTALL_BIN) $(PKG_BUILD_DIR)/datfiles/fortunes.dat $(1)/usr/share/games/fortunes +endef + +$(eval $(call BuildPackage,fortune-mod)) diff --git a/utils/fortune-mod/patches/01-strfile-64bit-fix b/utils/fortune-mod/patches/01-strfile-64bit-fix new file mode 100644 index 0000000..9bd3da9 --- /dev/null +++ b/utils/fortune-mod/patches/01-strfile-64bit-fix @@ -0,0 +1,156 @@ +--- fortune-mod-1.2.1/util/strfile.c.orig 2007-07-27 00:40:54.687140050 +0100 ++++ fortune-mod-1.2.1/util/strfile.c 2007-07-27 00:41:14.184165656 +0100 +@@ -144,7 +135,7 @@ + typedef struct + { + char first; +- off_t pos; ++ int32_t pos; + } + STR; + +@@ -159,7 +150,7 @@ + int Xflag = FALSE; /* set rotated bit */ + long Num_pts = 0; /* number of pointers/strings */ + +-off_t *Seekpts; ++int32_t *Seekpts; + + FILE *Sort_1, *Sort_2; /* pointers for sorting */ + +@@ -237,9 +228,9 @@ + * add_offset: + * Add an offset to the list, or write it out, as appropriate. + */ +-void add_offset(FILE * fp, off_t off) ++void add_offset(FILE * fp, int32_t off) + { +- off_t net; ++ int32_t net; + + if (!STORING_PTRS) + { +@@ -258,9 +249,9 @@ + * fix_last_offset: + * Used when we have two separators in a row. + */ +-void fix_last_offset(FILE * fp, off_t off) ++void fix_last_offset(FILE * fp, int32_t off) + { +- off_t net; ++ int32_t net; + + if (!STORING_PTRS) + { +@@ -333,7 +324,7 @@ + do_order(void) + { + register long i; +- register off_t *lp; ++ register int32_t *lp; + register STR *fp; + + Sort_1 = fopen(Infile, "r"); +@@ -384,8 +375,8 @@ + void randomize(void) + { + register int cnt, i; +- register off_t tmp; +- register off_t *sp; ++ register int32_t tmp; ++ register int32_t *sp; + extern time_t time(time_t *); + + srandom((int) (time((time_t *) NULL) + getpid())); +@@ -422,7 +413,7 @@ + { + register unsigned char *sp; + register FILE *inf, *outf; +- register off_t last_off, length, pos, *p; ++ register int32_t last_off, length, pos, *p; + register int first, cnt; + register char *nsp; + register STR *fp; +@@ -514,14 +505,19 @@ + if (!Sflag) + { + printf("\"%s\" created\n", Outfile); +- if (Num_pts == 2) +- puts("There was 1 string"); ++ if (Num_pts == 1) ++ puts("There was no string"); + else +- printf("There were %ld strings\n", Num_pts - 1); +- printf("Longest string: %lu byte%s\n", Tbl.str_longlen, +- Tbl.str_longlen == 1 ? "" : "s"); +- printf("Shortest string: %lu byte%s\n", Tbl.str_shortlen, +- Tbl.str_shortlen == 1 ? "" : "s"); ++ { ++ if (Num_pts == 2) ++ puts("There was 1 string"); ++ else ++ printf("There were %ld strings\n", Num_pts - 1); ++ printf("Longest string: %lu byte%s\n", Tbl.str_longlen, ++ Tbl.str_longlen == 1 ? "" : "s"); ++ printf("Shortest string: %lu byte%s\n", Tbl.str_shortlen, ++ Tbl.str_shortlen == 1 ? "" : "s"); ++ } + } + + fseek(outf, (off_t) 0, 0); +@@ -533,12 +529,19 @@ + Tbl.str_longlen = htonl(Tbl.str_longlen); + Tbl.str_shortlen = htonl(Tbl.str_shortlen); + Tbl.str_flags = htonl(Tbl.str_flags); +- fwrite((char *) &Tbl, sizeof Tbl, 1, outf); ++ fwrite(&Tbl.str_version, sizeof Tbl.str_version, 1, outf); ++ fwrite(&Tbl.str_numstr, sizeof Tbl.str_numstr, 1, outf); ++ fwrite(&Tbl.str_longlen, sizeof Tbl.str_longlen, 1, outf); ++ fwrite(&Tbl.str_shortlen, sizeof Tbl.str_shortlen, 1, outf); ++ fwrite(&Tbl.str_flags, sizeof Tbl.str_flags, 1, outf); ++ fwrite( Tbl.stuff, sizeof Tbl.stuff, 1, outf); + if (STORING_PTRS) + { + for (p = Seekpts, cnt = Num_pts; cnt--; ++p) ++ { + *p = htonl(*p); +- fwrite((char *) Seekpts, sizeof *Seekpts, (int) Num_pts, outf); ++ fwrite(p, sizeof *p, 1, outf); ++ } + } + fclose(outf); + exit(0); +--- fortune-mod-1.2.1/util/strfile.h 2000-01-29 11:14:34.000000000 +0000 ++++ fortune-mod-1.2.1/util/strfile.h 2007-07-27 00:25:46.825640014 +0100 +@@ -38,24 +38,19 @@ + * @(#)strfile.h 8.1 (Berkeley) 5/31/93 + */ + +-/* Modified Jan 2000, Chris Ausbrooks +- * + Changed VERSION to FILE_VERSION to avoid warnings caused by +- * automake/autoconf. +- */ +- + #define STR_ENDSTRING(line,tbl) \ + ((line)[0] == (tbl).str_delim && (line)[1] == '\n') + + typedef struct { /* information table */ +-#define FILE_VERSION 1 +- unsigned long str_version; /* version number */ +- unsigned long str_numstr; /* # of strings in the file */ +- unsigned long str_longlen; /* length of longest string */ +- unsigned long str_shortlen; /* length of shortest string */ ++#define FILE_VERSION 2 ++ u_int32_t str_version; /* version number */ ++ u_int32_t str_numstr; /* # of strings in the file */ ++ u_int32_t str_longlen; /* length of longest string */ ++ u_int32_t str_shortlen; /* length of shortest string */ + #define STR_RANDOM 0x1 /* randomized pointers */ + #define STR_ORDERED 0x2 /* ordered pointers */ + #define STR_ROTATED 0x4 /* rot-13'd text */ +- unsigned long str_flags; /* bit field for flags */ +- unsigned char stuff[4]; /* long aligned space */ ++ u_int32_t str_flags; /* bit field for flags */ ++ u_int8_t stuff[4]; /* long aligned space */ + #define str_delim stuff[0] /* delimiting character */ + } STRFILE; diff --git a/utils/fowsr/Makefile b/utils/fowsr/Makefile new file mode 100644 index 0000000..353bdb7 --- /dev/null +++ b/utils/fowsr/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2010-2012 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:=fowsr +PKG_VERSION:=1.0-20110904 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://fowsr.googlecode.com/files +PKG_MD5SUM:=3dbe93a59d85bf89f9c1d20d54f5e983 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-1.0 + +include $(INCLUDE_DIR)/package.mk + +define Package/fowsr + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libusb + TITLE:=Fine Offset Wireless Weather Station Reader + URL:=http://fowsr.googlecode.com/ +endef + +define Package/fowsr/description + fowsr is a USB Data Collector application for WH1080 compatible + weather stations. + Output formats includes XML, Wunderground.com and pywws. +endef + +define Package/fowsr/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/fowsr $(1)/usr/bin/ + $(INSTALL_BIN) \ + $(PKG_BUILD_DIR)/{fowsr,pwsweather,pywws,wunderground,xml}.sh \ + $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,fowsr)) diff --git a/utils/foxboard-utils/Makefile b/utils/foxboard-utils/Makefile new file mode 100644 index 0000000..fcdcef9 --- /dev/null +++ b/utils/foxboard-utils/Makefile @@ -0,0 +1,47 @@ +# +# 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:=foxboard-utils +PKG_VERSION:=1 +PKG_RELEASE:=1 + +PKG_SOURCE:=foxboard-utils.tar.bz2 +PKG_SOURCE_URL:=http://www.acmesystems.it/download/owrt +PKG_MD5SUM:= + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/foxboard-utils + SECTION:=utils + CATEGORY:=Base system + TITLE:=Foxboard base tools + URL:=http://www.acmesystems.it + DEPENDS:=@TARGET_etrax +endef + +define Package/foxboard-utils/description + This package contains a collection of tools for configuring the foxboard + gpio pins/leds. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) CFLAGS="$(TARGET_CFLAGS)" CC="$(TARGET_CC)" + $(MAKE) -C $(PKG_BUILD_DIR) PREFIX="$(PKG_INSTALL_DIR)" install +endef + +define Package/foxboard-utils/install + $(INSTALL_DIR) $(1)/ + $(CP) $(PKG_INSTALL_DIR)/* $(1) + $(INSTALL_DIR) $(1)/www/cgi-bin + cd $(1)/www/cgi-bin; ln -s ../../bin/editcgi.cgi . +endef + +$(eval $(call BuildPackage,foxboard-utils)) diff --git a/utils/freecwmp/Config.in b/utils/freecwmp/Config.in new file mode 100644 index 0000000..95f3583 --- /dev/null +++ b/utils/freecwmp/Config.in @@ -0,0 +1,26 @@ +if PACKAGE_freecwmp-curl || PACKAGE_freecwmp-zstream + +config FREECWMP_SCRIPTS_FULL + bool "Install all freecwmp scripts" + default y + +choice + prompt "Select ACS sever" + default FREECWMP_ACS_MULTI + +config FREECWMP_ACS_MULTI + bool "No specific ACS, follow standard" + +config FREECWMP_ACS_HDM + bool "HDM" +endchoice + +config FREECWMP_DEBUG + bool "Compile with debug options" + default n + +config FREECWMP_DEVEL_DEBUG + bool "Compile with development debug options" + default n + +endif diff --git a/utils/freecwmp/Makefile b/utils/freecwmp/Makefile new file mode 100644 index 0000000..6b70fa4 --- /dev/null +++ b/utils/freecwmp/Makefile @@ -0,0 +1,133 @@ +# +# Copyright (C) 2012 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:=freecwmp +PKG_VERSION:=2012-09-25 +PKG_RELEASE=$(PKG_SOURCE_VERSION) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://dev.freecwmp.org/freecwmp +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=4bfbd994921dee06a7a28bed1f2dee3d527490f4 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz + +PKG_FIXUP:=autoreconf + +PKG_CONFIG_DEPENDS:= \ + CONFIG_FREECWMP_ACS_MULTI \ + CONFIG_FREECWMP_ACS_HDM \ + CONFIG_FREECWMP_DEBUG \ + CONFIG_FREECWMP_DEVEL_DEBUG + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/freecwmp/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=CWMP client + DEPENDS:=+libfreecwmp +libuci +libubox +libubus +libmicroxml +shflags +endef + +define Package/freecwmp/description + A free client implementation of CWMP (TR-069) protocol +endef + +define Package/freecwmp-curl + $(call Package/freecwmp/Default) + TITLE+= (using libcurl) + DEPENDS+= +libcurl + VARIANT:=curl +endef + +define Package/freecwmp-zstream + $(call Package/freecwmp/Default) + TITLE+= (using libzstream) + DEPENDS+= +libzstream + VARIANT:=zstream +endef + +define Package/freecwmp-zstream/config + source "$(SOURCE)/Config.in" +endef + +USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1) +ifneq ($(USE_LOCAL),) +define Build/Prepare + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef +endif + +TARGET_CFLAGS += \ + -D_GNU_SOURCE + +TARGET_LDFLAGS += \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +CONFIGURE_ARGS += \ + --with-libfreecwmp-include-path=$(STAGING_DIR)/usr/include \ + --with-uci-include-path=$(STAGING_DIR)/usr/include \ + --with-libubox-include-path=$(STAGING_DIR)/usr/include \ + --with-libubus-include-path=$(STAGING_DIR)/usr/include + +ifeq ($(BUILD_VARIANT),zstream) +CONFIGURE_ARGS += \ + --enable-http=zstream \ + --with-zstream-include-path=$(STAGING_DIR)/usr/include +endif + +ifeq ($(BUILD_VARIANT),curl) +CONFIGURE_ARGS += \ + --enable-http=curl +endif + +ifeq ($(CONFIG_FREECWMP_ACS_MULTI),y) +CONFIGURE_ARGS += \ + --enable-acs=multi +endif + +ifeq ($(CONFIG_FREECWMP_ACS_HDM),y) +CONFIGURE_ARGS += \ + --enable-acs=hdm +endif + +ifeq ($(CONFIG_FREECWMP_DEBUG),y) +CONFIGURE_ARGS += \ + --enable-debug +endif + +ifeq ($(CONFIG_FREECWMP_DEVEL_DEBUG),y) +CONFIGURE_ARGS += \ + --enable-devel +endif + +define Package/freecwmp-$(BUILD_VARIANT)/conffiles +/etc/config/freecwmp +/usr/share/freecwmp/defaults +endef + +define Package/freecwmp-$(BUILD_VARIANT)/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/bin/freecwmpd $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) $(PKG_BUILD_DIR)/ext/openwrt/config/freecwmp $(1)/etc/config + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/freecwmpd.init $(1)/etc/init.d/freecwmpd +ifeq ($(CONFIG_FREECWMP_SCRIPTS_FULL),y) + $(INSTALL_DIR) $(1)/usr/share/freecwmp + $(CP) $(PKG_BUILD_DIR)/ext/openwrt/scripts/defaults $(1)/usr/share/freecwmp + $(CP) $(PKG_BUILD_DIR)/ext/openwrt/scripts/functions $(1)/usr/share/freecwmp + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ext/openwrt/scripts/freecwmp.sh $(1)/usr/sbin/freecwmp +endif +endef + +$(eval $(call BuildPackage,freecwmp-curl)) +$(eval $(call BuildPackage,freecwmp-zstream)) diff --git a/utils/freecwmp/files/freecwmpd.init b/utils/freecwmp/files/freecwmpd.init new file mode 100644 index 0000000..2c4b347 --- /dev/null +++ b/utils/freecwmp/files/freecwmpd.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2012 OpenWrt.org + +START=90 + +start() { + freecwmpd 2>/dev/null >/dev/null & +} + +stop() { + killall -9 freecwmpd 2>/dev/null >/dev/null +} diff --git a/utils/fxload/Makefile b/utils/fxload/Makefile new file mode 100644 index 0000000..f961d52 --- /dev/null +++ b/utils/fxload/Makefile @@ -0,0 +1,42 @@ +# +# 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 +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=fxload +PKG_VERSION:=2008_10_13 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/linux-hotplug +PKG_MD5SUM:=4477a2457f064228bef4a93ba2f21692 + +include $(INCLUDE_DIR)/package.mk + +define Package/fxload + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=@USB_SUPPORT +udev + TITLE:=Downloading firmware into EZ-USB microcontrollers + URL:=http://linux-hotplug.sourceforge.net/ +endef + +define Build/Compile + $(call Build/Compile/Default, \ + CFLAGS="$(TARGET_CFLAGS) -I$(LINUX_DIR)/include" \ + ) +endef + +define Package/fxload/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/sbin/ + $(INSTALL_DIR) $(1)/usr/share/usb + $(INSTALL_DATA) $(PKG_BUILD_DIR)/a3load.hex $(1)/usr/share/usb/ +endef + +$(eval $(call BuildPackage,fxload)) diff --git a/utils/fxload/patches/010-compile_fix.patch b/utils/fxload/patches/010-compile_fix.patch new file mode 100644 index 0000000..39ab9dc --- /dev/null +++ b/utils/fxload/patches/010-compile_fix.patch @@ -0,0 +1,18 @@ +--- a/ezusb.c ++++ b/ezusb.c +@@ -30,8 +30,14 @@ + # include + + # include +-# include ++typedef unsigned long kernel_ulong_t; ++ ++#ifndef BITS_PER_LONG ++#define BITS_PER_LONG 32 ++#endif ++ + # include ++# include + + # include "ezusb.h" + diff --git a/utils/gadgetfs-test/Makefile b/utils/gadgetfs-test/Makefile new file mode 100644 index 0000000..3dfc298 --- /dev/null +++ b/utils/gadgetfs-test/Makefile @@ -0,0 +1,112 @@ +# +# Copyright (C) 2007 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:=gadgetfs-test +PKG_VERSION:=2007-11-29 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME).tar.bz2 +PKG_SOURCE_URL:=http://avr32linux.org/twiki/pub/Main/GadgetFsTest +PKG_MD5SUM:=49476a74c29f1281c8a4c035aa57a5bd + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/gadgetfs-test + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Filesystem + TITLE:=Test program for gadgetfs + DEPENDS:=@DEVEL +libpthread + URL:=http://linux-usb.org/gadget +endef + +define Package/gadgetfs-test/description + Test program for gadgetfs from linux-usb.org. +endef + +define Package/gadgetfs-test-bulk +$(call Package/gadgetfs-test) + TITLE+= (BULK transfer) +endef + +define Package/gadgetfs-test-bulk/description +$(call Package/gadgetfs-test/description) + This package is built with BULK transfer support. +endef + +define Package/gadgetfs-test-isoc +$(call Package/gadgetfs-test) + DEPENDS+= +libaio + TITLE+= (ISOCHRONOUS transfer) +endef + +define Package/gadgetfs-test-isoc/description +$(call Package/gadgetfs-test/description) + This package is built with ISOCHRONOUS transfer support using libaio. +endef + + +GADGETFS_CFLAGS:=$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS) +GADGETFS_LDFLAGS:=$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS) +GADGETFS_LIBS:=-lpthread + +define Build/Template + +$(STAMP_BUILT)-$(1): $(STAMP_PREPARED) + -$(MAKE) -C $(PKG_BUILD_DIR) clean + $(MAKE_VARS) \ + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CC="$(TARGET_CC)" \ + LDFLAGS="$(GADGETFS_LDFLAGS)" \ + $(2) \ + all + mv -f $(PKG_BUILD_DIR)/gadgetfs-test $(PKG_BUILD_DIR)/gadgetfs-test-$(1) + touch $$@ + +$(STAMP_BUILT): $(STAMP_BUILT)-$(1) + +define Package/gadgetfs-test-$(1)/install + $(INSTALL_DIR) $$(1)/usr/sbin + $(INSTALL_BIN) $$(PKG_BUILD_DIR)/gadgetfs-test-$(1) $$(1)/usr/sbin/ +endef + +endef + +define Build/Configure +endef + +define Build/Compile +endef + +ifneq ($(SDK)$(CONFIG_PACKAGE_gadgetfs-test-bulk),) + define Build/bulk + $(call Build/Template,bulk, \ + CFLAGS="$(GADGETFS_CFLAGS)" \ + LIBS="$(GADGETFS_LIBS)" \ + ) + endef +endif +$(eval $(Build/bulk)) + +ifneq ($(SDK)$(CONFIG_PACKAGE_gadgetfs-test-isoc),) + define Build/isoc + $(call Build/Template,isoc, \ + CFLAGS="$(GADGETFS_CFLAGS) -DAIO" \ + LIBS="$(GADGETFS_LIBS) -laio" \ + ) + endef +endif +$(eval $(Build/isoc)) + +$(eval $(call BuildPackage,gadgetfs-test-bulk)) +$(eval $(call BuildPackage,gadgetfs-test-isoc)) + diff --git a/utils/gadgetfs-test/patches/001-linux_usb_org_2007_11_29.patch b/utils/gadgetfs-test/patches/001-linux_usb_org_2007_11_29.patch new file mode 100644 index 0000000..fce5b68 --- /dev/null +++ b/utils/gadgetfs-test/patches/001-linux_usb_org_2007_11_29.patch @@ -0,0 +1,214 @@ +diff -Nur gadgetfs-test.orig/usb.c gadgetfs-test.2007-11-29/usb.c +--- gadgetfs-test.orig/usb.c 2007-06-21 16:36:32.000000000 +0200 ++++ gadgetfs-test.2007-11-29/usb.c 2007-09-25 09:01:48.000000000 +0200 +@@ -34,8 +34,8 @@ + #include + + #include +-#include +-#include ++#include ++#include + + #ifdef AIO + /* this aio code works with libaio-0.3.106 */ +@@ -402,6 +402,26 @@ + fs_status_desc.bEndpointAddress = USB_DIR_IN | 3; + EP_STATUS_NAME = "ep3in-int"; + ++ /* Atmel AT32AP700x processors, high/full speed */ ++ } else if (stat (DEVNAME = "atmel_usba_udc", &statb) == 0) { ++ HIGHSPEED = 1; ++ device_desc.bcdDevice = __constant_cpu_to_le16 (0x0108); ++ ++ fs_source_desc.bEndpointAddress ++ = hs_source_desc.bEndpointAddress ++ = USB_DIR_IN | 1; ++ EP_IN_NAME = "ep1in-bulk"; ++ fs_sink_desc.bEndpointAddress ++ = hs_sink_desc.bEndpointAddress ++ = USB_DIR_OUT | 2; ++ EP_OUT_NAME = "ep2out-bulk"; ++ ++ source_sink_intf.bNumEndpoints = 3; ++ fs_status_desc.bEndpointAddress ++ = hs_status_desc.bEndpointAddress ++ = USB_DIR_IN | 3; ++ EP_STATUS_NAME = "ep3in-int"; ++ + } else { + DEVNAME = 0; + return -ENODEV; +@@ -597,18 +617,58 @@ + fs_status_desc.bEndpointAddress = USB_DIR_IN | 3; + EP_STATUS_NAME = "ep3-int"; + ++ /* Atmel AT32AP700x processors, high/full speed */ ++ } else if (stat (DEVNAME = "atmel_usba_udc", &statb) == 0){ ++ HIGHSPEED = 1; ++ ++ device_desc.bcdDevice = __constant_cpu_to_le16 (0x0105); ++ ++ fs_source_desc.bEndpointAddress ++ = hs_source_desc.bEndpointAddress ++ = USB_DIR_IN | 5; ++ fs_source_desc.bmAttributes ++ = hs_source_desc.bmAttributes ++ = USB_ENDPOINT_XFER_ISOC; ++ fs_source_desc.wMaxPacketSize ++ = hs_source_desc.wMaxPacketSize ++ = __cpu_to_le16(min (bufsize, 1024)); ++ fs_source_desc.bInterval ++ = hs_source_desc.bInterval ++ = interval; ++ EP_IN_NAME = "ep5in-iso"; ++ ++ fs_sink_desc.bEndpointAddress ++ = hs_sink_desc.bEndpointAddress ++ = USB_DIR_OUT | 6; ++ fs_sink_desc.bmAttributes ++ = hs_sink_desc.bmAttributes ++ = USB_ENDPOINT_XFER_ISOC; ++ fs_sink_desc.wMaxPacketSize ++ = hs_sink_desc.wMaxPacketSize ++ = __cpu_to_le16(min (bufsize, 1024)); ++ fs_sink_desc.bInterval ++ = hs_sink_desc.bInterval ++ = interval; ++ EP_OUT_NAME = "ep6out-iso"; ++ ++ source_sink_intf.bNumEndpoints = 3; ++ fs_status_desc.bEndpointAddress ++ = hs_status_desc.bEndpointAddress ++ = USB_DIR_IN | 3; ++ EP_STATUS_NAME = "ep3in-int"; ++ + } else { + DEVNAME = 0; + return -ENODEV; + } + if (verbose) { + fprintf (stderr, "iso fs wMaxPacket %04x bInterval %02x\n", +- fs_sink_desc.wMaxPacketSize, ++ __le16_to_cpu(fs_sink_desc.wMaxPacketSize), + fs_sink_desc.bInterval); + if (HIGHSPEED) + fprintf (stderr, + "iso hs wMaxPacket %04x bInterval %02x\n", +- hs_sink_desc.wMaxPacketSize, ++ __le16_to_cpu(hs_sink_desc.wMaxPacketSize), + hs_sink_desc.bInterval); + } + return 0; +@@ -1285,13 +1345,17 @@ + { + int status, tmp; + __u8 buf [256]; ++ __u16 value, index, length; ++ ++ value = __le16_to_cpu(setup->wValue); ++ index = __le16_to_cpu(setup->wIndex); ++ length = __le16_to_cpu(setup->wLength); + + if (verbose) + fprintf (stderr, "SETUP %02x.%02x " + "v%04x i%04x %d\n", + setup->bRequestType, setup->bRequest, +- setup->wValue, setup->wIndex, +- setup->wLength); ++ value, index, length); + + /* + if ((setup->bRequestType & USB_TYPE_MASK) != USB_TYPE_STANDARD) +@@ -1302,21 +1366,21 @@ + case USB_REQ_GET_DESCRIPTOR: + if (setup->bRequestType != USB_DIR_IN) + goto stall; +- switch (setup->wValue >> 8) { ++ switch (value >> 8) { + case USB_DT_STRING: +- tmp = setup->wValue & 0x0ff; ++ tmp = value & 0x0ff; + if (verbose > 1) + fprintf (stderr, + "... get string %d lang %04x\n", +- tmp, setup->wIndex); +- if (tmp != 0 && setup->wIndex != strings.language) ++ tmp, index); ++ if (tmp != 0 && index != strings.language) + goto stall; + status = usb_gadget_get_string (&strings, tmp, buf); + if (status < 0) + goto stall; + tmp = status; +- if (setup->wLength < tmp) +- tmp = setup->wLength; ++ if (length < tmp) ++ tmp = length; + status = write (fd, buf, tmp); + if (status < 0) { + if (errno == EIDRM) +@@ -1336,7 +1400,7 @@ + if (setup->bRequestType != USB_DIR_OUT) + goto stall; + if (verbose) +- fprintf (stderr, "CONFIG #%d\n", setup->wValue); ++ fprintf (stderr, "CONFIG #%d\n", value); + + /* Kernel is normally waiting for us to finish reconfiguring + * the device. +@@ -1349,7 +1413,7 @@ + * the endpoints always active and don't rely on seeing any + * config change events, either this or SET_INTERFACE. + */ +- switch (setup->wValue) { ++ switch (value) { + case CONFIG_VALUE: + start_io (); + break; +@@ -1369,27 +1433,27 @@ + return; + case USB_REQ_GET_INTERFACE: + if (setup->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE) +- || setup->wIndex != 0 +- || setup->wLength > 1) ++ || index != 0 ++ || length > 1) + goto stall; + + /* only one altsetting in this driver */ + buf [0] = 0; +- status = write (fd, buf, setup->wLength); ++ status = write (fd, buf, length); + if (status < 0) { + if (errno == EIDRM) + fprintf (stderr, "GET_INTERFACE timeout\n"); + else + perror ("write GET_INTERFACE data"); +- } else if (status != setup->wLength) { ++ } else if (status != length) { + fprintf (stderr, "short GET_INTERFACE write, %d\n", + status); + } + return; + case USB_REQ_SET_INTERFACE: + if (setup->bRequestType != USB_RECIP_INTERFACE +- || setup->wIndex != 0 +- || setup->wValue != 0) ++ || index != 0 ++ || value != 0) + goto stall; + + /* just reset toggle/halt for the interface's endpoints */ +diff -Nur gadgetfs-test.orig/usbstring.c gadgetfs-test.2007-11-29/usbstring.c +--- gadgetfs-test.orig/usbstring.c 2007-06-21 16:36:32.000000000 +0200 ++++ gadgetfs-test.2007-11-29/usbstring.c 2007-09-25 09:01:48.000000000 +0200 +@@ -11,7 +11,7 @@ + #include + + #include +-#include ++#include + + #include "usbstring.h" + diff --git a/utils/gawk/Makefile b/utils/gawk/Makefile new file mode 100644 index 0000000..1105b39 --- /dev/null +++ b/utils/gawk/Makefile @@ -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:=gawk +PKG_VERSION:=3.1.8 +PKG_RELEASE:=2 + +PKG_SOURCE:=gawk-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/gawk/ +PKG_MD5SUM:=35937a0f83f0efe7a8c2dee635624784 +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/gawk-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/gawk + SECTION:=utils + CATEGORY:=Utilities + TITLE:=GAWK + URL:=http://www.gnu.org/software/gawk/ +endef + +define Package/gawk/description + GNU version of AWK. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --prefix=/usr --with-linux-headers="$(LINUX_DIR)" \ + ) +endef + +define Package/gawk/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/gawk $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/awklib/igawk $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/pgawk $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/libexec/ + $(INSTALL_DIR) $(1)/usr/libexec/awk/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/awklib/grcat $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/awklib/pwcat $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/share/ + $(INSTALL_DIR) $(1)/usr/share/awk/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/awklib/eg/lib/* $(1)/usr/share/awk +endef + +$(eval $(call BuildPackage,gawk)) diff --git a/utils/gnokii/Makefile b/utils/gnokii/Makefile new file mode 100644 index 0000000..8f62abe --- /dev/null +++ b/utils/gnokii/Makefile @@ -0,0 +1,68 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=gnokii +PKG_VERSION:=0.6.21 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://gnokii.org/download/gnokii/0.6.x +PKG_MD5SUM:=bbf0aabe2436d8e927f3e2edb4efcac8 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=0 + +include $(INCLUDE_DIR)/package.mk + +define Package/gnokii + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libusb + TITLE:=Gnokii - Datasuite for the mobile phones + URL:=http://www.gnokii.org/ +endef + +define Package/gnokii/description + Gnokii is a suite of programs linked against a backend + library that allows communication with the phones. It + currently supports the most mobile phones, all AT + capable mobiles as well as Symbian phones. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + --disable-rlpdebug \ + --disable-xdebug \ + --disable-debug \ + --enable-shared \ + --disable-static \ + --disable-libpcsclite \ + --disable-libical \ + --disable-irda \ + --disable-bluetooth \ + --without-x \ + ) +endef + +define Package/gnokii/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnokii $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/gnokiid $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mgnokiidev $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnokii.so.3.5.0 $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnokii.so.3 $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnokii.so $(1)/usr/lib +endef + +$(eval $(call BuildPackage,gnokii)) diff --git a/utils/gnupg/Makefile b/utils/gnupg/Makefile new file mode 100644 index 0000000..1782f01 --- /dev/null +++ b/utils/gnupg/Makefile @@ -0,0 +1,65 @@ +# +# Copyright (C) 2006-2012 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:=gnupg +PKG_VERSION:=1.4.12 +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:=ce3742e5c7912559cab7894ad8ba7f6b + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/gnupg + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+zlib +libncurses +libreadline + TITLE:=GNU privacy guard - a free PGP replacement + URL:=http://www.gnupg.org/ +endef + +define Package/gnupg/description + GnuPG is GNU's tool for secure communication and data storage. + It can be used to encrypt data and to create digital signatures. + It includes an advanced key management facility and is compliant + with the proposed OpenPGP Internet standard as described in RFC2440. + . + GnuPG does not use any patented algorithms so it cannot be compatible + with PGP2 because it uses IDEA (which is patented worldwide). +endef + +CONFIGURE_ARGS += \ + --disable-rpath \ + --disable-asm \ + --disable-gnupg-iconv \ + --disable-card-support \ + --disable-agent-support \ + --disable-bzip2 \ + --disable-exec \ + --disable-ldap \ + --disable-hkp \ + --disable-finger \ + --disable-ftp \ + --disable-dns-srv \ + --enable-fake-curl \ + --disable-regex \ + +MAKE_FLAGS += \ + SUBDIRS="m4 intl zlib util mpi cipher tools g10 keyserver ${checks}" \ + +define Package/gnupg/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpg $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,gnupg)) diff --git a/utils/gnuplot/Makefile b/utils/gnuplot/Makefile new file mode 100644 index 0000000..ec50a4e --- /dev/null +++ b/utils/gnuplot/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2010-2012 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:=gnuplot +PKG_VERSION:=4.6.0 +PKG_RELEASE:=2 + +PKG_INSTALL:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/gnuplot +PKG_MD5SUM:=8e6e92b4596ea0eb75e16a57fc79efec + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +TARGET_LDFLAGS+= \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +CONFIGURE_VARS += \ + CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \ + LIBS="-lpthread" + +define Package/gnuplot + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncurses $(CXX_DEPENDS) +zlib +libpng +libfreetype +libgd \ + $(INTL_DEPENDS) $(ICONV_DEPENDS) +libpthread +libreadline + TITLE:=A portable command-line driven graphing utility + URL:=http://sourceforge.net/projects/gnuplot/ +endef + +define Package/gnuplot/description + Gnuplot is a portable command-line driven graphing utility for linux, OS/2, + MS Windows, OSX, VMS, and many other platforms. +endef + +CONFIGURE_ARGS += \ + --without-x \ + --disable-mouse \ + --without-tutorial \ + --without-row-help \ + --without-lisp-files \ + --disable-wxwidgets \ + --without-lua \ + --without-cairo + +define Package/gnuplot/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnuplot $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,gnuplot)) diff --git a/utils/gnuplot/patches/010-Makefile.in.patch b/utils/gnuplot/patches/010-Makefile.in.patch new file mode 100644 index 0000000..8a83fd6 --- /dev/null +++ b/utils/gnuplot/patches/010-Makefile.in.patch @@ -0,0 +1,11 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -250,7 +250,7 @@ top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AUTOMAKE_OPTIONS = foreign 1.2h +-SUBDIRS = config m4 term src docs $(LISPDIR) man demo tutorial share ++SUBDIRS = config m4 term src $(LISPDIR) share + EXTRA_DIST = BUGS CodeStyle Copyright FAQ.pdf GNUmakefile INSTALL INSTALL.gnu \ + Makefile.maint PATCHLEVEL PGPKEYS PORTING README README.1ST \ + VERSION configure.vms pm3d win diff --git a/utils/gpiotoggling/Makefile b/utils/gpiotoggling/Makefile new file mode 100644 index 0000000..84360b4 --- /dev/null +++ b/utils/gpiotoggling/Makefile @@ -0,0 +1,38 @@ +# +# Copyright (C) 2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=gpiotoggling +PKG_RELEASE:=1 +PKG_REV:=b57866441932eabc75b6c4252103121f606dc820 +PKG_VERSION:=$(PKG_REV) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=git://github.com/mirko/gpio-toggling---linux-kernel-module.git +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_PROTO:=git + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/gpiotoggling + SUBMENU:=Other modules + TITLE:=Toggle GPIOs in kernel space + FILES:=$(PKG_BUILD_DIR)/gpiotoggling.ko +endef + +define Build/Compile + $(MAKE) -C $(LINUX_DIR) \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + SUBDIRS="$(PKG_BUILD_DIR)" \ + modules +endef + +$(eval $(call KernelPackage,gpiotoggling)) diff --git a/utils/gzip/Makefile b/utils/gzip/Makefile new file mode 100644 index 0000000..12943fb --- /dev/null +++ b/utils/gzip/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2006-2012 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:=gzip +PKG_VERSION:=1.4 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/gzip +PKG_MD5SUM:=e381b8506210c794278f5527cba0e765 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/gzip + SECTION:=utils + CATEGORY:=Utilities + TITLE:=gzip (GNU zip) is a compression utility. + URL:=http://www.gzip.org/ +endef + +define Package/gzip/description + gzip (GNU zip) is a compression utility designed to be a \ + replacement for compress. +endef + +CONFIGURE_VARS += \ + gl_cv_func_getopt_gnu=yes \ + ac_cv_search_clock_gettime=no + +define Package/gzip/install + $(SED) 's,/bin/bash,/bin/sh,g' $(PKG_INSTALL_DIR)/usr/bin/{gunzip,zcat} + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{gunzip,gzip,zcat} $(1)/usr/bin/ +endef + +define Package/gzip/postinst +#!/bin/sh +for app in gunzip gzip zcat; do + ln -sf ../usr/bin/$$app $${IPKG_INSTROOT}/bin/$$app +done +endef + +define Package/gzip/postrm +#!/bin/sh +for app in gunzip gzip zcat; do + ln -sf busybox $${IPKG_INSTROOT}/bin/$$app + $${IPKG_INSTROOT}/bin/$$app 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/bin/$$app +done +exit 0 +endef + +$(eval $(call BuildPackage,gzip)) + diff --git a/utils/gzip/patches/001-rsyncable.patch b/utils/gzip/patches/001-rsyncable.patch new file mode 100644 index 0000000..ddaffc8 --- /dev/null +++ b/utils/gzip/patches/001-rsyncable.patch @@ -0,0 +1,248 @@ +--- a/deflate.c ++++ b/deflate.c +@@ -131,6 +131,14 @@ + #endif + /* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ + ++#ifndef RSYNC_WIN ++# define RSYNC_WIN 8192 ++#endif ++/* Size of rsync window, must be < MAX_DIST */ ++ ++#define RSYNC_SUM_MATCH(sum) (((sum) & (RSYNC_WIN - 1)) == 0) ++/* Whether window sum matches magic value */ ++ + /* =========================================================================== + * Local data used by the "longest match" routines. + */ +@@ -212,6 +220,8 @@ local int compr_level; + unsigned near good_match; + /* Use a faster search when the previous match is longer than this */ + ++local ulg rsync_sum; /* rolling sum of rsync window */ ++local ulg rsync_chunk_end; /* next rsync sequence point */ + + /* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to +@@ -307,6 +317,10 @@ void lm_init (pack_level, flags) + #endif + /* prev will be initialized on the fly */ + ++ /* rsync params */ ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ rsync_sum = 0; ++ + /* Set the default configuration parameters: + */ + max_lazy_match = configuration_table[pack_level].max_lazy; +@@ -324,6 +338,7 @@ void lm_init (pack_level, flags) + + strstart = 0; + block_start = 0L; ++ rsync_chunk_end = 0xFFFFFFFFUL; + #ifdef ASMV + match_init(); /* initialize the asm code */ + #endif +@@ -543,6 +558,8 @@ local void fill_window() + memcpy((char*)window, (char*)window+WSIZE, (unsigned)WSIZE); + match_start -= WSIZE; + strstart -= WSIZE; /* we now have strstart >= MAX_DIST: */ ++ if (rsync_chunk_end != 0xFFFFFFFFUL) ++ rsync_chunk_end -= WSIZE; + + block_start -= (long) WSIZE; + +@@ -570,6 +587,39 @@ local void fill_window() + } + } + ++local void rsync_roll(start, num) ++ unsigned start; ++ unsigned num; ++{ ++ unsigned i; ++ ++ if (start < RSYNC_WIN) { ++ /* before window fills. */ ++ for (i = start; i < RSYNC_WIN; i++) { ++ if (i == start + num) return; ++ rsync_sum += (ulg)window[i]; ++ } ++ num -= (RSYNC_WIN - start); ++ start = RSYNC_WIN; ++ } ++ ++ /* buffer after window full */ ++ for (i = start; i < start+num; i++) { ++ /* New character in */ ++ rsync_sum += (ulg)window[i]; ++ /* Old character out */ ++ rsync_sum -= (ulg)window[i - RSYNC_WIN]; ++ if (rsync_chunk_end == 0xFFFFFFFFUL && RSYNC_SUM_MATCH(rsync_sum)) ++ rsync_chunk_end = i; ++ } ++} ++ ++/* =========================================================================== ++ * Set rsync_chunk_end if window sum matches magic value. ++ */ ++#define RSYNC_ROLL(s, n) \ ++ do { if (rsync) rsync_roll((s), (n)); } while(0) ++ + /* =========================================================================== + * Flush the current block, with given end-of-file flag. + * IN assertion: strstart is set to the end of the current match. +@@ -617,6 +667,7 @@ local off_t deflate_fast() + + lookahead -= match_length; + ++ RSYNC_ROLL(strstart, match_length); + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ +@@ -645,9 +696,18 @@ local off_t deflate_fast() + /* No match, output a literal byte */ + Tracevv((stderr,"%c",window[strstart])); + flush = ct_tally (0, window[strstart]); ++ RSYNC_ROLL(strstart, 1); + lookahead--; + strstart++; + } ++ if (rsync && strstart > rsync_chunk_end) { ++ ush attr = 0; /* ascii/binary flag */ ++ ++ flush = 1; ++ /* Reset huffman tree */ ++ ct_init(&attr, &method); ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ } + if (flush) FLUSH_BLOCK(0), block_start = strstart; + + /* Make sure that we always have enough lookahead, except +@@ -721,6 +781,7 @@ off_t deflate() + */ + lookahead -= prev_length-1; + prev_length -= 2; ++ RSYNC_ROLL(strstart, prev_length+1); + do { + strstart++; + INSERT_STRING(strstart, hash_head); +@@ -733,24 +794,51 @@ off_t deflate() + match_available = 0; + match_length = MIN_MATCH-1; + strstart++; +- if (flush) FLUSH_BLOCK(0), block_start = strstart; + ++ if (rsync && strstart > rsync_chunk_end) { ++ ush attr = 0; /* ascii/binary flag */ ++ ++ /* Reset huffman tree */ ++ ct_init(&attr, &method); ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ flush = 1; ++ } ++ if (flush) FLUSH_BLOCK(0), block_start = strstart; + } else if (match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + Tracevv((stderr,"%c",window[strstart-1])); +- if (ct_tally (0, window[strstart-1])) { +- FLUSH_BLOCK(0), block_start = strstart; +- } ++ flush = ct_tally (0, window[strstart-1]); ++ if (rsync && strstart > rsync_chunk_end) { ++ ush attr = 0; /* ascii/binary flag */ ++ ++ /* Reset huffman tree */ ++ ct_init(&attr, &method); ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ ++ flush = 1; ++ } ++ if (flush) FLUSH_BLOCK(0), block_start = strstart; ++ RSYNC_ROLL(strstart, 1); + strstart++; + lookahead--; + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ ++ if (rsync && strstart > rsync_chunk_end) { ++ ush attr = 0; /* ascii/binary flag */ ++ ++ /* Reset huffman tree */ ++ ct_init(&attr, &method); ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ ++ FLUSH_BLOCK(0), block_start = strstart; ++ } + match_available = 1; ++ RSYNC_ROLL(strstart, 1); + strstart++; + lookahead--; + } +--- a/doc/gzip.texi ++++ b/doc/gzip.texi +@@ -353,6 +353,14 @@ specified on the command line are direct + into the directory and compress all the files it finds there (or + decompress them in the case of @command{gunzip}). + ++@item --rsyncable ++While compressing, synchronize the output occasionally based on the ++input. This can reduce the compression slightly in some cases, but ++means that the @code{rsync} program can take advantage of similarities ++in the uncompressed input when syncronizing two files compressed with ++this flag. @code{gunzip} cannot tell the difference between a ++compressed file created with this option, and one created without it. ++ + @item --suffix @var{suf} + @itemx -S @var{suf} + Use suffix @var{suf} instead of @samp{.gz}. Any suffix can be +--- a/gzip.c ++++ b/gzip.c +@@ -218,6 +218,7 @@ int ofd; /* output fil + unsigned insize; /* valid bytes in inbuf */ + unsigned inptr; /* index of next byte to be processed in inbuf */ + unsigned outcnt; /* bytes in output buffer */ ++int rsync = 0; /* make ryncable chunks */ + + static int handled_sig[] = + { +@@ -271,6 +272,7 @@ struct option longopts[] = + {"best", 0, 0, '9'}, /* compress better */ + {"lzw", 0, 0, 'Z'}, /* make output compatible with old compress */ + {"bits", 1, 0, 'b'}, /* max number of bits per code (implies -Z) */ ++ {"rsyncable", 0, 0, 'R'}, /* make rsync-friendly archive */ + { 0, 0, 0, 0 } + }; + +@@ -352,6 +354,7 @@ local void help() + " -Z, --lzw produce output compatible with old compress", + " -b, --bits=BITS max number of bits per code (implies -Z)", + #endif ++ " --rsyncable Make rsync-friendly archive", + "", + "With no FILE, or when FILE is -, read standard input.", + "", +@@ -479,6 +482,9 @@ int main (int argc, char **argv) + recursive = 1; + #endif + break; ++ case 'R': ++ rsync = 1; break; ++ + case 'S': + #ifdef NO_MULTIPLE_DOTS + if (*optarg == '.') optarg++; +--- a/gzip.h ++++ b/gzip.h +@@ -146,6 +146,7 @@ EXTERN(uch, window); /* Sliding + extern unsigned insize; /* valid bytes in inbuf */ + extern unsigned inptr; /* index of next byte to be processed in inbuf */ + extern unsigned outcnt; /* bytes in output buffer */ ++extern int rsync; /* deflate into rsyncable chunks */ + + extern off_t bytes_in; /* number of input bytes */ + extern off_t bytes_out; /* number of output bytes */ diff --git a/utils/haserl/Makefile b/utils/haserl/Makefile new file mode 100644 index 0000000..91980e9 --- /dev/null +++ b/utils/haserl/Makefile @@ -0,0 +1,32 @@ +# +# Copyright (C) 2006-2009 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:=haserl +PKG_VERSION:=0.9.27 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/haserl +PKG_MD5SUM:=1f692db8939858338a44e25d0190aa9e + +include $(INCLUDE_DIR)/package.mk + +define Package/haserl + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A CGI wrapper to embed shell scripts in HTML documents + URL:=http://haserl.sourceforge.net/ +endef + +define Package/haserl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/haserl $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,haserl)) diff --git a/utils/haveged/Makefile b/utils/haveged/Makefile new file mode 100644 index 0000000..b963e4a --- /dev/null +++ b/utils/haveged/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2006-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id: Makefile 1 2012-01-12 03:50:18Z Olipro $ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=haveged +PKG_VERSION:=1.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.issihosts.com/$(PKG_NAME) +PKG_MD5SUM:=39a03d4b8a4225706f78dbef3f623b0e + +#ensure this is consistent with the dir in the tarball!!! +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/haveged + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Feeds the kernel entropy pool by timing CPU loops. + DEPENDS:=+librt + URL:=http://www.issihosts.com/haveged/ +endef + +define Package/haveged/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/haveged.init $(1)/etc/init.d/haveged + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/haveged $(1)/sbin/ +endef + +$(eval $(call BuildPackage,haveged)) diff --git a/utils/haveged/files/haveged.init b/utils/haveged/files/haveged.init new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/utils/haveged/files/haveged.init @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2012 OpenWrt.org + +START=98 + +HAVEGED_THRESHOLD=1024 +HAVEGED_DCACHE=32 +HAVEGED_ICACHE=32 + +start() { + service_start /sbin/haveged -w $HAVEGED_THRESHOLD -d $HAVEGED_DCACHE -i $HAVEGED_ICACHE -v 1 +} + +stop() { + service_stop /sbin/haveged +} diff --git a/utils/hd-idle/Makefile b/utils/hd-idle/Makefile new file mode 100644 index 0000000..981b884 --- /dev/null +++ b/utils/hd-idle/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2008-2012 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:=hd-idle +PKG_VERSION:=1.04 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=41e52e669fc59fa82ee0c2bcce1336d3 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/hd-idle + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Another idle-daemon for attached hard drives + SUBMENU:=disc + URL:=http://hd-idle.sourceforge.net/ +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/$(PKG_NAME) $(PKG_BUILD_DIR)/$(PKG_NAME).c +endef + +define Package/hd-idle/conffiles +/etc/config/hd-idle +endef + +define Package/hd-idle/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) +endef + +$(eval $(call BuildPackage,hd-idle)) diff --git a/utils/hd-idle/files/hd-idle.config b/utils/hd-idle/files/hd-idle.config new file mode 100644 index 0000000..4e22c3b --- /dev/null +++ b/utils/hd-idle/files/hd-idle.config @@ -0,0 +1,6 @@ +config 'hd-idle' + option 'disk' 'sda' + option 'enable_debug' '0' + option 'enabled' '0' + option 'idle_time_unit' 'minutes' + option 'idle_time_interval' '10' diff --git a/utils/hd-idle/files/hd-idle.init b/utils/hd-idle/files/hd-idle.init new file mode 100644 index 0000000..1abf232 --- /dev/null +++ b/utils/hd-idle/files/hd-idle.init @@ -0,0 +1,80 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2011 OpenWrt.org + +START=50 + +append_bool() { + local section="$1" + local option="$2" + local value="$3" + local _val + config_get_bool _val "$section" "$option" '0' + [ "$_val" -gt 0 ] && append args "$3" +} + +append_string() { + local section="$1" + local option="$2" + local value="$3" + local _val + config_get _val "$section" "$option" + [ -n "$_val" ] && append args "$3 $_val" +} + +compute_seconds() { + local interval="$1" + local unit="$2" + + if [ -z "$interval" ] + then + interval=10 + fi + + if [ -z "$unit" ] + then + unit="minutes" + fi + + # compute interval in seconds + case "$unit" in + "days" ) + interval_seconds=$(($interval*60*60*24)) + ;; + "hours" ) + interval_seconds=$(($interval*60*60)) + ;; + "minutes" ) + interval_seconds=$(($interval*60)) + ;; + "seconds" ) + interval_seconds=$interval + ;; + * ) + # default is minutes + interval_seconds=$(($interval*60)) + ;; + esac + + echo $interval_seconds +} + +start_service() { + local section="$1" + args="" + config_get "interval" "$section" "idle_time_interval" + config_get "unit" "$section" "idle_time_unit" + append_string "$section" "disk" "-a" + append_bool "$section" "enable_debug" "-d" + config_get_bool "enabled" "$section" "enabled" '1' + [ "$enabled" -gt 0 ] || return 1 + service_start /usr/bin/hd-idle $args -i "$(compute_seconds $interval $unit)" +} + +start() { + config_load "hd-idle" + config_foreach start_service "hd-idle" +} + +stop() { + service_stop /usr/bin/hd-idle +} diff --git a/utils/hdparm/Makefile b/utils/hdparm/Makefile new file mode 100644 index 0000000..b3a0f6b --- /dev/null +++ b/utils/hdparm/Makefile @@ -0,0 +1,37 @@ +# +# Copyright (C) 2006-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=hdparm +PKG_VERSION:=9.39 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=2bc17b72403885d4faf959682944243b + +include $(INCLUDE_DIR)/package.mk + +define Package/hdparm + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=disc + TITLE:=Hard disk drive configuration utilitity + URL:=http://sourceforge.net/projects/hdparm/ +endef + +define Package/hdparm/description + get/set SATA/IDE device parameters +endef + +define Package/hdparm/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/sbin +endef + +$(eval $(call BuildPackage,hdparm)) diff --git a/utils/heyu/Makefile b/utils/heyu/Makefile new file mode 100644 index 0000000..6694a26 --- /dev/null +++ b/utils/heyu/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=heyu +PKG_VERSION:=2.9.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://heyu.tanj.com/download/ +PKG_MD5SUM:=89d20d7f45109e7add5f0a141eac04eb + +include $(INCLUDE_DIR)/package.mk + +define Package/heyu + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+setserial + TITLE:=X10 home automation control using a CM11A + URL:=http://heyu.tanj.com/heyu2/ +endef + +define Package/heyu/description + HEYU is a text-based console program for remotely controlling lights + and appliances in the home or office. It is made available under a + free and open source license. + + Heyu uses the CM11A computer interface to send and receive X10 control + signals over the AC power lines to modules which can turn On, Off, or + Dim attached lamps or appliances. It can store a schedule of timed + events in the CM11A memory for execution when the computer is turned + off or disconnected. +endef + +define Package/heyu/conffiles +/etc/heyu/x10.conf +endef + +define Build/Compile + $(call Build/Compile/Default, \ + CFLAGS="$(TARGET_CFLAGS) \$$$$(DFLAGS)" \ + ) +endef + +define Package/heyu/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/heyu $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) + $(INSTALL_DATA) ./files/x10.conf $(1)/etc/$(PKG_NAME)/x10.conf +endef + +$(eval $(call BuildPackage,heyu)) diff --git a/utils/heyu/files/x10.conf b/utils/heyu/files/x10.conf new file mode 100644 index 0000000..3cacaf5 --- /dev/null +++ b/utils/heyu/files/x10.conf @@ -0,0 +1,24 @@ +# this file should contain x10 appliance aliases, one per line, as: +# appliance-name housecode modulenumber +# for example: +# mydesklamp A 4 +# atticfan B 3 +# sumppump C 3 +# manythings J 1-4 +# +# IMPORTANT! disable the serial console if you need to use heyu +# on /dev/tts/0. Read http://forum.openwrt.org/viewtopic.php?id=1767 +# +# NOTE: using /dev/tts/1 requires the setserial package to +# set the port to use irq 3, otherwise performance will be +# unbearable as it is polled. +# +TTY /dev/tts/1 +# +# give your location - for computing sunrise and sunset times +# Boston, MA USA: +#LATITUDE N42:20 +#LONGITUDE W71:05 +# Menlo Park, CA USA: +LATITUDE N37:43 +LONGITUDE W122:20 diff --git a/utils/heyu/patches/001-avoid_configure.patch b/utils/heyu/patches/001-avoid_configure.patch new file mode 100644 index 0000000..ca895e4 --- /dev/null +++ b/utils/heyu/patches/001-avoid_configure.patch @@ -0,0 +1,261 @@ +--- /dev/null ++++ b/Makefile +@@ -0,0 +1,252 @@ ++# Makefile for HEYU, a program to control an X10 CM11A computer interface. ++# This makefile is generated by the Configure program. ++# ++BIN = /usr/bin ++MAN = /usr/man/man1 ++MAN5 = /usr/man/man5 ++GROUP = sys ++OWNER = root ++ ++# set DFLAGS equal to: ++# -DSYSV if using SYSTEM V ++# -DVOID if compiler doesn't understand 'void' ++ ++#This makefile is built for linux ++DFLAGS = -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A ++LIBS = -lm -lc ++# # The rest of the makefile should need no changes ++ ++## Makefile template for Heyu, a program to control an X10 CM11A computer ++## interface. From this point on the Makefile is copied from Makefile.in ++## by the Configure program ++ ++SRCS = date.c erase.c info.c message.c relay.c \ ++ monitor.c reset.c setclock.c stop.c \ ++ tty.c x10.c xread.c xwrite.c status.c cm11a.c \ ++ eeprom.c process.c sun.c cmd.c config.c x10state.c \ ++ poll.c modules.c cm17a.c xsync.c timing.c cm10a.c \ ++ tty_aux.c relay_aux.c x10aux.c rfxcom.c digimax.c oregon.c ++OBJS = date.o erase.o info.o message.o relay.o \ ++ monitor.o reset.o setclock.o stop.o \ ++ tty.o x10.o xread.o xwrite.o status.o cm11a.o \ ++ eeprom.o process.o sun.o cmd.o config.o x10state.o \ ++ poll.o modules.o cm17a.o xsync.o timing.o cm10a.o \ ++ tty_aux.o relay_aux.o x10aux.o rfxcom.o digimax.o oregon.o ++ ++OTHERSRC = README README2 Makefile x10config.sample protocol.txt eeprom.h \ ++ x10.sched.sample heyu.1 x10.h x10config.5 x10cm17a.5 \ ++ history.txt version.h heyufaq.txt x10sched.5 process.h sun.h \ ++ x10scripts.5 Configure Makefile.in install.sh INSTALL LICENSE \ ++ README.cm10a x10aux.5 x10state.h rfxcom.h digimax.h oregon.h x10rfxsensors.5\ ++ x10rfxmeters.5 x10digimax.5 x10oregon.5 ++ ++EVERYTHING = $(OTHERSRC) $(SRCS) ++ ++all: heyu ++ ++heyu: $(OBJS) version.h ++ $(CC) $(LDFLAGS) -o heyu $(OBJS) $(LIBS) ++ @echo `id` >usergroup.tmp ++ @echo ${HOME} >userhome.tmp ++ @echo "" ++ @echo "** Now become root and run 'make install' **" ++ @echo "" ++ ++$(OBJS): x10.h process.h sun.h Makefile ++ ++eeprom.o: eeprom.h ++info.o: version.h ++x10state.o: x10state.c x10state.h rfxcom.h digimax.h oregon.h ++rfxcom.o: rfxcom.c x10state.h rfxcom.h ++digimax.o: digimax.c x10state.h digimax.h ++oregon.o: oregon.c x10state.h oregon.h ++modules.o: modules.c oregon.h ++poll.o: poll.c oregon.h ++ ++install: $(BIN)/heyu $(MAN)/heyu.1 $(MAN5)/x10config.5 $(MAN5)/x10sched.5 \ ++ $(MAN5)/x10scripts.5 $(MAN5)/x10cm17a.5 $(MAN5)/x10aux.5 \ ++ $(MAN5)/x10rfxsensors.5 $(MAN5)/x10rfxmeters.5 $(MAN5)/x10digimax.5 \ ++ $(MAN5)/x10oregon.5 ++ ++maninstall: $(MAN)/heyu.1 $(MAN5)/x10config.5 $(MAN5)/x10sched.5 \ ++ $(MAN5)/x10scripts.5 $(MAN5)/x10cm17a.5 $(MAN5)/x10aux.5 \ ++ $(MAN5)/x10rfxsensors.5 $(MAN5)/x10rfxmeters.5 \ ++ $(MAN5)/x10digimax.5 $(MAN5)/x10oregon.5 ++ ++uninstall: ++ rm -f $(BIN)/heyu ++ rm -f $(MAN)/heyu.1 ++ rm -f $(MAN5)/x10config.5 ++ rm -f $(MAN5)/x10sched.5 ++ rm -f $(MAN5)/x10scripts.5 ++ rm -f $(MAN5)/x10cm17a.5 ++ rm -f $(MAN5)/x10aux.5 ++ rm -f $(MAN5)/x10rfxsensors.5 ++ rm -f $(MAN5)/x10rfxmeters.5 ++ rm -f $(MAN5)/x10digimax.5 ++ rm -f $(MAN5)/x10oregon.5 ++ ++$(BIN)/heyu: heyu ++ mkdir -p -m 755 $(BIN) ++ cp heyu $(BIN) ++ chgrp $(GROUP) $(BIN)/heyu ++ chmod 755 $(BIN)/heyu ++ chown $(OWNER) $(BIN)/heyu ++ ./install.sh ++ ++$(MAN)/heyu.1: heyu.1 ++ mkdir -p -m 755 $(MAN) ++ cp heyu.1 $(MAN) ++ chmod 644 $(MAN)/heyu.1 ++ ++$(MAN5)/x10config.5: x10config.5 ++ mkdir -p -m 755 $(MAN5) ++ cp x10config.5 $(MAN5) ++ chmod 644 $(MAN5)/x10config.5 ++ ++$(MAN5)/x10sched.5: x10sched.5 ++ mkdir -p -m 755 $(MAN5) ++ cp x10sched.5 $(MAN5) ++ chmod 644 $(MAN5)/x10sched.5 ++ ++$(MAN5)/x10scripts.5: x10scripts.5 ++ mkdir -p -m 755 $(MAN5) ++ cp x10scripts.5 $(MAN5) ++ chmod 644 $(MAN5)/x10scripts.5 ++ ++$(MAN5)/x10cm17a.5: x10cm17a.5 ++ mkdir -p -m 755 $(MAN5) ++ cp x10cm17a.5 $(MAN5) ++ chmod 644 $(MAN5)/x10cm17a.5 ++ ++$(MAN5)/x10aux.5: x10aux.5 ++ mkdir -p -m 755 $(MAN5) ++ cp x10aux.5 $(MAN5) ++ chmod 644 $(MAN5)/x10aux.5 ++ ++$(MAN5)/x10rfxsensors.5: x10rfxsensors.5 ++ mkdir -p -m 755 $(MAN5) ++ cp x10rfxsensors.5 $(MAN5) ++ chmod 644 $(MAN5)/x10rfxsensors.5 ++ ++$(MAN5)/x10rfxmeters.5: x10rfxmeters.5 ++ mkdir -p -m 755 $(MAN5) ++ cp x10rfxmeters.5 $(MAN5) ++ chmod 644 $(MAN5)/x10rfxmeters.5 ++ ++$(MAN5)/x10digimax.5: x10digimax.5 ++ mkdir -p -m 755 $(MAN5) ++ cp x10digimax.5 $(MAN5) ++ chmod 644 $(MAN5)/x10digimax.5 ++ ++$(MAN5)/x10oregon.5: x10oregon.5 ++ mkdir -p -m 755 $(MAN5) ++ cp x10oregon.5 $(MAN5) ++ chmod 644 $(MAN5)/x10oregon.5 ++ ++lint: ++ lint $(DFLAGS) $(SRCS) ++ ++shar: x10_heyu.shar.1 x10_heyu.shar.2 ++ ++x10.o: x10.c version.h ++process.o: process.c version.h ++xread.o: xread.c local.h ++ ++ci: $(SRCS) index.html Makefile ++ @ for FL in $+ ; do \ ++ if test -w $$FL ; then \ ++ ci -l $$FL ;\ ++ fi ;\ ++ done ++ ++x10_heyu.shar.1: ++ shar $(OTHERSRC) >x10_heyu.shar.1 ++ ++x10_heyu.shar.2: ++ shar $(SRCS) > x10_heyu.shar.2 ++ ++bigshar: ++ shar $(EVERYTHING) > x10_heyu.shar ++ ++tar: x10_heyu.tgz ++ ++x10_heyu.tgz: $(EVERYTHING) ++ rm -fr heyu.dir ++ mkdir heyu.dir ++ cp -p $(EVERYTHING) heyu.dir ++ cp Makefile.dist heyu.dir/Makefile ++ tar -czvf x10_heyu.tgz heyu.dir ++ ++heyudistro: $(EVERYTHING) ++ rm -rf distro.dir ++ mkdir distro.dir ++ cp -p $(EVERYTHING) distro.dir ++ cp -p release_notes.txt distro.dir ++ cp -p INSTALL distro.dir/README.INSTALL ++ rm distro.dir/Makefile ++ ++man2html: ++ man2html heyu.1 >./html/heyu.1.html ++ man2html x10config.5 >./html/x10config.5.html ++ man2html x10scripts.5 > ./html/x10scripts.5.html ++ man2html x10sched.5 > ./html/x10sched.5.html ++ man2html x10aux.5 > ./html/x10aux.5.html ++ man2html x10cm17a.5 > ./html/x10cm17a.5.html ++ man2html x10rfxsensors.5 > ./html/x10rfxsensors.5.html ++ man2html x10rfxmeters.5 > ./html/x10rfxmeters.5.html ++ man2html x10digimax.5 > ./html/x10digimax.5.html ++ man2html x10oregon.5 > ./html/x10oregon.5.html ++ ++beta: x10_beta.tgz ++ ++x10_beta.tgz: $(EVERYTHING) ++ rm -fr heyu.beta ++ mkdir heyu.beta ++ cp -p $(EVERYTHING) heyu.beta ++ cp Makefile.dist heyu.dir/Makefile ++ tar -czvf x10_beta.tgz heyu.beta ++ ++zip: x10_heyu.zip ++ ++x10_heyu.zip: $(EVERYTHING) ++ rm -f x10_heyu.zip ++ zip -kl x10_heyu.zip $(EVERYTHING) ++ ++touch: ++ touch $(OTHERSRC) ++ touch $(SRCS) ++ ++clean: ++ rm -f *.o ++ ++clobber: clean ++ rm -f heyu ++ ++upload: heyu index.html x10_heyu.tgz x10_heyu.zip ++ /bin/sh -c ./upload.sh ++ ++rcsdiffrw: ++ @-for x in `$(MAKE) rw` ;\ ++ do \ ++ echo ;\ ++ echo $$x ;\ ++ echo ========= ;\ ++ rcsdiff $$x ;\ ++ done 2>&1 ;\ ++ echo ;\ ++ echo all done ++ ++list: ++ @ls $(EVERYTHING) | more ++ ++rw: ++ @ls -l $(EVERYTHING) | \ ++ egrep '^[^l].w' | \ ++ sed 's;.* ;;' # strip to last space ++ ++populate: $(EVERYTHING) ++ ++$(EVERYTHING): ++## co -r$(revision) $@ ++ +--- /dev/null ++++ b/local.h +@@ -0,0 +1,3 @@ ++#define USESIGINT 1' ++#define SPOOLDIR "/tmp" ++#define LOCKDIR "/tmp" diff --git a/utils/hplip/Makefile b/utils/hplip/Makefile new file mode 100644 index 0000000..8408555 --- /dev/null +++ b/utils/hplip/Makefile @@ -0,0 +1,80 @@ +# +# Copyright (C) 2006-2011 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:=hplip +PKG_VERSION:=3.9.12 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/hplip +PKG_MD5SUM:=2b0906b4a57b437988829557ca62adfd + +PKG_BUILD_DEPENDS := python +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/hplip + SECTION:=utils + CATEGORY:=Utilities + TITLE:=HP Linux Imaging and Printing + URL:=http://sourceforge.net/projects/hplip/ + DEPENDS+=+libjpeg +libtiff +libusb +cups +sane-libs +endef + +define Package/hplip/description + HPLIP is an HP developed solution for printing, scanning, and faxing with HP inkjet and laser based printers in Linux. +endef + +CONFIGURE_ARGS += \ + --disable-gui-build \ + --disable-network-build \ + --disable-fax-build \ + --disable-pp-build \ + --disable-doc-build \ + --disable-foomatic-xml-install \ + --disable-dbus-build + +define Build/Configure + $(call Build/Configure/Default,\ + $(CONFIGURE_ARGS),\ + ac_cv_lib_cups_cupsDoFileRequest=yes \ + LIBS="-lz -ljpeg -lusb -lcups -lpng -ltiff" \ + ) +endef + +define Package/hplip/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/.libs/libhpip.so* $(1)/usr/lib/ + $(CP) $(PKG_BUILD_DIR)/.libs/libhpmud.so* $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/cups/backend + $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/hp $(1)/usr/lib/cups/backend + + $(INSTALL_DIR) $(1)/usr/lib/sane + $(CP) $(PKG_BUILD_DIR)/.libs/libsane-hpaio.so* $(1)/usr/lib/sane + + $(INSTALL_DIR) $(1)/etc/hp + $(CP) $(PKG_BUILD_DIR)/hplip.conf $(1)/etc/hp/hplip.conf + + $(INSTALL_DIR) $(1)/usr/share/hplip/data/models/ + $(CP) $(PKG_BUILD_DIR)/data/models/models.dat $(1)/usr/share/hplip/data/models/ + + $(INSTALL_DIR) $(1)/etc/hotplug.d/usb/ + $(INSTALL_BIN) ./files/20-hplip $(1)/etc/hotplug.d/usb/ + + $(INSTALL_DIR) $(1)/etc/sane.d/dll.d/ + $(INSTALL_DATA) ./files/hplib.conf $(1)/etc/sane.d/dll.d/hplib +endef + +define Package/hplip/conffiles +/etc/hp/hplip.conf +endef + +$(eval $(call BuildPackage,hplip)) diff --git a/utils/hplip/files/20-hplip b/utils/hplip/files/20-hplip new file mode 100644 index 0000000..6066cc5 --- /dev/null +++ b/utils/hplip/files/20-hplip @@ -0,0 +1,20 @@ +#!/bin/sh + +# Copyright (C) 2009 OpenWrt.org + + +case "$ACTION" in + add) + # You have to figure out your PRODUCT id. Uncomment the line below, + # attach and detach your HP USB printer to find your id in /tmp/hplip.test. + # It will look like "Found 3f0/1717/100 on /proc/bus/usb/002/009" + # Replace 3f0/1717/100 below with your id. + # + # echo "Found $PRODUCT on $DEVICE" > /tmp/hplip.test + + [ "$PRODUCT" = "3f0/1717/100" ] && chown nobody $DEVICE && chmod 666 $DEVICE + ;; + remove) + # device is gone + ;; +esac diff --git a/utils/hplip/files/hplib.conf b/utils/hplip/files/hplib.conf new file mode 100644 index 0000000..d67d370 --- /dev/null +++ b/utils/hplip/files/hplib.conf @@ -0,0 +1,2 @@ +# Load the hplib driver +hpaio diff --git a/utils/huaweiaktbbo/Makefile b/utils/huaweiaktbbo/Makefile new file mode 100644 index 0000000..bb9b3c3 --- /dev/null +++ b/utils/huaweiaktbbo/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2008-2009 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:=huaweiaktbbo +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/huaweiaktbbo + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libusb + TITLE:=Huawei E156/E169/E220 activation tool +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR) +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) \ + -lusb \ + -o $(PKG_BUILD_DIR)/huaweiAktBbo \ + $(PKG_BUILD_DIR)/huaweiAktBbo.c +endef + +define Package/huaweiaktbbo/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/huaweiAktBbo $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,huaweiaktbbo)) diff --git a/utils/huaweiaktbbo/src/huaweiAktBbo.c b/utils/huaweiaktbbo/src/huaweiAktBbo.c new file mode 100644 index 0000000..09c9050 --- /dev/null +++ b/utils/huaweiaktbbo/src/huaweiAktBbo.c @@ -0,0 +1,95 @@ +/* HUAWEI 3G modems activator + Copyright (C) 2006 bobovsky bobovsky@kanoistika.sk GPL + Copyright (C) 2009 Nuno Goncalves nunojpg@gmail.com GPL + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License2. +*/ + +#include +#include +#include +#include +#include +#include +#include + +struct usb_dev_handle *devh; + +void release_usb_device(int dummy) { + int ret; + ret = usb_release_interface(devh, 0); + + if (!ret) + printf("failed to release interface: %d\n", ret); + + usb_close(devh); + + if (!ret) + printf("failed to close interface: %d\n", ret); + + exit(1); +} + +void list_devices() { + struct usb_bus *bus; + for (bus = usb_get_busses(); bus; bus = bus->next) { + struct usb_device *dev; + + for (dev = bus->devices; dev; dev = dev->next) + printf("0x%04x 0x%04x\n", dev->descriptor.idVendor, dev->descriptor.idProduct); + } +} + +struct usb_device *find_device() { + struct usb_bus *bus; + + for (bus = usb_get_busses(); bus; bus = bus->next) { + struct usb_device *dev; + + for (dev = bus->devices; dev; dev = dev->next) { + if (dev->descriptor.idVendor == 0x12d1 && dev->descriptor.idProduct == 0x1001 || //Huawei E169, Huawei E169G + dev->descriptor.idVendor == 0x12d1 && dev->descriptor.idProduct == 0x1003) //Huawei E220, Huawei E156G + return dev; + } + } + return NULL; +} + +int main(int argc, char **argv) { + int ret, vendor, product; + struct usb_device *dev; + char buf[65535], *endptr; + + usb_init(); + usb_find_busses(); + usb_find_devices(); + + printf("Searching modem..."); + dev = find_device(); + + if(dev == NULL){ + printf("No supported modem found\n"); + return 1; + } + + printf("found supported modem!\n"); + + assert(dev); + devh = usb_open(dev); + assert(devh); + + signal(SIGTERM, release_usb_device); + + ret = usb_get_descriptor(devh, 0x0000001, 0x0000000, buf, 0x0000012); + usleep(1*1000); + ret = usb_get_descriptor(devh, 0x0000002, 0x0000000, buf, 0x0000009); + usleep(1*1000); + ret = usb_get_descriptor(devh, 0x0000002, 0x0000000, buf, 0x0000020); + usleep(1*1000); + ret = usb_control_msg(devh, USB_TYPE_STANDARD + USB_RECIP_DEVICE, USB_REQ_SET_FEATURE, 00000001, 0, buf, 0, 1000); + + ret = usb_close(devh); + assert(ret == 0); + + printf("Modem poked!\n"); + return 0; +} diff --git a/utils/i2c-tools/Makefile b/utils/i2c-tools/Makefile new file mode 100644 index 0000000..d67d8bb --- /dev/null +++ b/utils/i2c-tools/Makefile @@ -0,0 +1,89 @@ +# +# Copyright (C) 2007-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=i2c-tools +PKG_VERSION:=3.0.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://dl.lm-sensors.org/i2c-tools/releases +PKG_MD5SUM:=511376eed04455cdb277ef19c5f73bb4 + +PKG_BUILD_DEPENDS:=PACKAGE_python-smbus:python + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/i2c-tools + SECTION:=utils + CATEGORY:=Utilities + TITLE:=I2C tools for Linux + URL:=http://www.lm-sensors.org/wiki/I2CTools +endef + +define Package/python-smbus + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Python bindings for the SMBUS + URL:=http://www.lm-sensors.org/wiki/I2CTools + DEPENDS:= +PACKAGE_python-smbus:python-mini +i2c-tools +endef + +define Package/i2c-tools/description + This package contains an heterogeneous set of I2C tools for Linux. These tools + were originally part of the lm-sensors package. + Includes: + - i2cdetect + - i2cdump + - i2cget + - i2cset +endef + +define Package/python-smbus/description + This package contains an heterogeneous set of I2C tools for Linux. + + This package contain the python bindings for Linux SMBus access through i2c-dev. +endef + +TARGET_CPPFLAGS += -I$(LINUX_DIR)/include + +ifdef CONFIG_PACKAGE_python-smbus + define Build/Compile/python-smbus + $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false) + $(call Build/Compile/PyMod,./py-smbus/, \ + install --prefix="$(PKG_INSTALL_DIR)/usr", \ + ) + endef +endif + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + LINUX="$(LINUX_DIR)" \ + CC="$(TARGET_CC)" \ + STAGING_DIR="$(STAGING_DIR)" + $(Build/Compile/python-smbus) +endef + +define Package/i2c-tools/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cdetect $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cdump $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cset $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cget $(1)/usr/sbin/ +endef + +define PyPackage/python-smbus/filespec ++|$(PYTHON_PKG_DIR)/smbus.so +endef + +$(eval $(call BuildPackage,i2c-tools)) +$(eval $(call PyPackage,python-smbus)) +$(eval $(call BuildPackage,python-smbus)) diff --git a/utils/i2c-tools/patches/100-linux_include.patch b/utils/i2c-tools/patches/100-linux_include.patch new file mode 100644 index 0000000..addfc5b --- /dev/null +++ b/utils/i2c-tools/patches/100-linux_include.patch @@ -0,0 +1,10 @@ +--- a/py-smbus/smbusmodule.c ++++ b/py-smbus/smbusmodule.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + + /* diff --git a/utils/ink/Makefile b/utils/ink/Makefile new file mode 100644 index 0000000..cc617b7 --- /dev/null +++ b/utils/ink/Makefile @@ -0,0 +1,33 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ink +PKG_VERSION:=0.5.1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/ink +PKG_MD5SUM:=df09c4a1a404dd37ffff80ce2491ab6d + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ink + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A utility for reading ink levels + URL:=http://ink.sourceforge.net/ + DEPENDS:=+libinklevel +endef + +define Package/ink/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/ink $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,ink)) diff --git a/utils/input-utils/Makefile b/utils/input-utils/Makefile new file mode 100644 index 0000000..dca3330 --- /dev/null +++ b/utils/input-utils/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2007,2008 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:=input-utils +PKG_VERSION:=20081014-101501 +PKG_RELEASE:=2 + +PKG_BUILD_DIR:=$(BUILD_DIR)/input/ +PKG_SOURCE:=input-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://dl.bytesex.org/cvs-snapshots/ +PKG_MD5SUM:=a6854dc5218301b67324b483d26f1bee + +include $(INCLUDE_DIR)/package.mk + +define Package/input-utils + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Utilities for the input layer of the Linux kernel +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + STRIP="true" \ + build +endef + +define Package/input-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/input-events $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/input-kbd $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lsinput $(1)/usr/bin/ + +endef + +$(eval $(call BuildPackage,input-utils)) diff --git a/utils/input-utils/patches/001-EVIOCGKEYCODE2.patch b/utils/input-utils/patches/001-EVIOCGKEYCODE2.patch new file mode 100644 index 0000000..d282f6b --- /dev/null +++ b/utils/input-utils/patches/001-EVIOCGKEYCODE2.patch @@ -0,0 +1,220 @@ +From 52f533a6c32f8e1e376c5a335cc067da16d59b61 Mon Sep 17 00:00:00 2001 +From: Dmitry Torokhov +Date: Wed, 26 Jan 2011 15:49:39 +0100 +Subject: [PATCH] input-kbd - switch to using EVIOCGKEYCODE2 when available + +[mchehab@redhat.com: Ported it to the -git version] + +Signed-off-by: Dmitry Torokhov +Signed-off-by: Mauro Carvalho Chehab +--- + input-kbd.c | 110 +++++++++++++++++++++++++++++++++++++++-------------------- + input.c | 4 +- + 2 files changed, 75 insertions(+), 39 deletions(-) + +diff --git a/input-kbd.c b/input-kbd.c +index c432d0d..aaf23b9 100644 +--- a/input-kbd.c ++++ b/input-kbd.c +@@ -9,9 +9,22 @@ + + #include "input.h" + ++struct input_keymap_entry_v2 { ++#define KEYMAP_BY_INDEX (1 << 0) ++ uint8_t flags; ++ uint8_t len; ++ uint16_t index; ++ uint32_t keycode; ++ uint8_t scancode[32]; ++}; ++ ++#ifndef EVIOCGKEYCODE_V2 ++#define EVIOCGKEYCODE_V2 _IOR('E', 0x04, struct input_keymap_entry_v2) ++#endif ++ + struct kbd_entry { +- int scancode; +- int keycode; ++ unsigned int scancode; ++ unsigned int keycode; + }; + + struct kbd_map { +@@ -23,7 +36,7 @@ struct kbd_map { + + /* ------------------------------------------------------------------ */ + +-static struct kbd_map* kbd_map_read(int fd) ++static struct kbd_map* kbd_map_read(int fd, unsigned int version) + { + struct kbd_entry entry; + struct kbd_map *map; +@@ -32,17 +45,35 @@ static struct kbd_map* kbd_map_read(int fd) + map = malloc(sizeof(*map)); + memset(map,0,sizeof(*map)); + for (map->size = 0; map->size < 65536; map->size++) { +- entry.scancode = map->size; +- entry.keycode = KEY_RESERVED; +- rc = ioctl(fd, EVIOCGKEYCODE, &entry); +- if (rc < 0) { +- map->size--; +- break; ++ if (version < 0x10001) { ++ entry.scancode = map->size; ++ entry.keycode = KEY_RESERVED; ++ rc = ioctl(fd, EVIOCGKEYCODE, &entry); ++ if (rc < 0) { ++ map->size--; ++ break; ++ } ++ } else { ++ struct input_keymap_entry_v2 ke = { ++ .index = map->size, ++ .flags = KEYMAP_BY_INDEX, ++ .len = sizeof(uint32_t), ++ .keycode = KEY_RESERVED, ++ }; ++ ++ rc = ioctl(fd, EVIOCGKEYCODE_V2, &ke); ++ if (rc < 0) ++ break; ++ memcpy(&entry.scancode, ke.scancode, ++ sizeof(entry.scancode)); ++ entry.keycode = ke.keycode; + } ++ + if (map->size >= map->alloc) { + map->alloc += 64; + map->map = realloc(map->map, map->alloc * sizeof(entry)); + } ++ + map->map[map->size] = entry; + + if (KEY_RESERVED != entry.keycode) +@@ -156,37 +187,25 @@ static void kbd_print_bits(int fd) + } + } + +-static void show_kbd(int nr) ++static void show_kbd(int fd, unsigned int protocol_version) + { + struct kbd_map *map; +- int fd; + +- fd = device_open(nr,1); +- if (-1 == fd) +- return; + device_info(fd); + +- map = kbd_map_read(fd); +- if (NULL != map) { +- kbd_map_print(stdout,map,0); +- } else { ++ map = kbd_map_read(fd, protocol_version); ++ if (map) ++ kbd_map_print(stdout, map, 0); ++ else + kbd_print_bits(fd); +- } +- +- close(fd); + } + +-static int set_kbd(int nr, char *mapfile) ++static int set_kbd(int fd, unsigned int protocol_version, char *mapfile) + { + struct kbd_map *map; + FILE *fp; +- int fd; + +- fd = device_open(nr,1); +- if (-1 == fd) +- return -1; +- +- map = kbd_map_read(fd); ++ map = kbd_map_read(fd, protocol_version); + if (NULL == map) { + fprintf(stderr,"device has no map\n"); + close(fd); +@@ -203,14 +222,12 @@ static int set_kbd(int nr, char *mapfile) + return -1; + } + } +- ++ + if (0 != kbd_map_parse(fp,map) || + 0 != kbd_map_write(fd,map)) { +- close(fd); + return -1; + } + +- close(fd); + return 0; + } + +@@ -224,8 +241,10 @@ static int usage(char *prog, int error) + + int main(int argc, char *argv[]) + { +- int c,devnr; ++ int c, devnr, fd; + char *mapfile = NULL; ++ unsigned int protocol_version; ++ int rc = EXIT_FAILURE; + + for (;;) { + if (-1 == (c = getopt(argc, argv, "hf:"))) +@@ -245,12 +264,29 @@ int main(int argc, char *argv[]) + usage(argv[0],1); + + devnr = atoi(argv[optind]); +- if (mapfile) { +- set_kbd(devnr,mapfile); +- } else { +- show_kbd(devnr); ++ ++ fd = device_open(devnr, 1); ++ if (fd < 0) ++ goto out; ++ ++ if (ioctl(fd, EVIOCGVERSION, &protocol_version) < 0) { ++ fprintf(stderr, ++ "Unable to query evdev protocol version: %s\n", ++ strerror(errno)); ++ goto out_close; + } +- return 0; ++ ++ if (mapfile) ++ set_kbd(fd, protocol_version, mapfile); ++ else ++ show_kbd(fd, protocol_version); ++ ++ rc = EXIT_SUCCESS; ++ ++out_close: ++ close(fd); ++out: ++ return rc; + } + + /* --------------------------------------------------------------------- +diff --git a/input.c b/input.c +index d57a31e..a9bd5e8 100644 +--- a/input.c ++++ b/input.c +@@ -101,8 +101,8 @@ int device_open(int nr, int verbose) + close(fd); + return -1; + } +- if (EV_VERSION != version) { +- fprintf(stderr, "protocol version mismatch (expected %d, got %d)\n", ++ if (EV_VERSION > version) { ++ fprintf(stderr, "protocol version mismatch (expected >= %d, got %d)\n", + EV_VERSION, version); + close(fd); + return -1; +-- +1.7.2.3 + diff --git a/utils/input-utils/patches/002-version-check.patch b/utils/input-utils/patches/002-version-check.patch new file mode 100644 index 0000000..03358eb --- /dev/null +++ b/utils/input-utils/patches/002-version-check.patch @@ -0,0 +1,34 @@ +From d99f056745e53cd2518ca169af474f8c45c1436d Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Wed, 26 Jan 2011 21:01:05 +0100 +Subject: [PATCH] remove version check + +--- + input.c | 11 ----------- + 1 files changed, 0 insertions(+), 11 deletions(-) + +diff --git a/input.c b/input.c +index a9bd5e8..9a6a810 100644 +--- a/input.c ++++ b/input.c +@@ -96,17 +96,6 @@ int device_open(int nr, int verbose) + if (verbose) + fprintf(stderr,"%s\n",filename); + +- if (-1 == ioctl(fd,EVIOCGVERSION,&version)) { +- perror("ioctl EVIOCGVERSION"); +- close(fd); +- return -1; +- } +- if (EV_VERSION > version) { +- fprintf(stderr, "protocol version mismatch (expected >= %d, got %d)\n", +- EV_VERSION, version); +- close(fd); +- return -1; +- } + return fd; + } + +-- +1.7.2.3 + diff --git a/utils/io/Makefile b/utils/io/Makefile new file mode 100644 index 0000000..ddf9440 --- /dev/null +++ b/utils/io/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2007 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:=io +PKG_RELEASE:=1 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +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/Prepare + $(INSTALL_DIR) $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) -Os $(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 index 0000000..caa23e0 --- /dev/null +++ b/utils/io/src/io.c @@ -0,0 +1,425 @@ +/* + * Simple app. to do memory accesses via /dev/mem. + * + * + * Copyright (c) Richard Hirst + * Copyright (c) Thomas Langer + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#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 ] [-f ] []\n\n" +" -v Verbose, asks for confirmation\n" +" -1|2|4 Sets memory access size in bytes (default byte)\n" +" -l 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 to write on memory read, or\n" +" to read on memory write\n" +" The memory address to access\n" +" 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 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 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 '%s'\n", argv[optind]); + exit(1); + } + if ((iosize == 1 && (req_value & 0xffffff00)) || + (iosize == 2 && (req_value & 0xffff0000))) { + fprintf(stderr, " 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 for access size\n"); + exit(1); + } + if ((iosize == 2 && (req_len & 1)) || + (iosize == 4 && (req_len & 3))) { + fprintf(stderr, "Badly aligned 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"); + 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; + } + } + + if (filename) + close(ffd); + close (mfd); + + return 0; +} + diff --git a/utils/ipmitool/Makefile b/utils/ipmitool/Makefile new file mode 100644 index 0000000..2a4fd5f --- /dev/null +++ b/utils/ipmitool/Makefile @@ -0,0 +1,49 @@ +# Copyright (C) 2008-2010, OpenWrt.org +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ipmitool +PKG_VERSION:=1.8.11 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/ipmitool +PKG_MD5SUM:=1d0da20add7388d64c549f95538b6858 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/ipmitool + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libopenssl +libncurses +libreadline + TITLE:=IPMI remote computer management utility + URL:=http://ipmitool.sourceforge.net/ +endef + +define Package/ipmitool/description + IPMItool is a utility for managing and configuring devices + that support the Intelligent Platform Management Interface + (IPMI) version 1.5 and version 2.0 specifications. +endef + +CONFIGURE_ARGS += \ + --enable-static=no \ + --enable-internal-md5 \ + --enable-intf-lan=yes \ + --enable-intf-lanplus=no \ + --enable-intf-free=no \ + --enable-intf-open=no \ + --enable-intf-imb=no \ + --enable-intf-lipmi=no \ + --enable-intf-bmc=no + +define Package/ipmitool/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ipmitool $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,ipmitool)) + diff --git a/utils/ipmitool/patches/100-cubic_root.patch b/utils/ipmitool/patches/100-cubic_root.patch new file mode 100644 index 0000000..11ebffa --- /dev/null +++ b/utils/ipmitool/patches/100-cubic_root.patch @@ -0,0 +1,149 @@ +--- a/lib/ipmi_sdr.c ++++ b/lib/ipmi_sdr.c +@@ -4399,3 +4399,146 @@ ipmi_sdr_main(struct ipmi_intf *intf, in + + return rc; + } ++ ++/* cbrt.c ++ * ++ * Cube root ++ * ++ * ++ * ++ * SYNOPSIS: ++ * ++ * double x, y, cbrt(); ++ * ++ * y = cbrt( x ); ++ * ++ * ++ * ++ * DESCRIPTION: ++ * ++ * Returns the cube root of the argument, which may be negative. ++ * ++ * Range reduction involves determining the power of 2 of ++ * the argument. A polynomial of degree 2 applied to the ++ * mantissa, and multiplication by the cube root of 1, 2, or 4 ++ * approximates the root to within about 0.1%. Then Newton's ++ * iteration is used three times to converge to an accurate ++ * result. ++ * ++ * ++ * ++ * ACCURACY: ++ * ++ * Relative error: ++ * arithmetic domain # trials peak rms ++ * DEC -10,10 200000 1.8e-17 6.2e-18 ++ * IEEE 0,1e308 30000 1.5e-16 5.0e-17 ++ * ++ */ ++/* cbrt.c */ ++ ++/* ++Cephes Math Library Release 2.8: June, 2000 ++Copyright 1984, 1991, 2000 by Stephen L. Moshier ++*/ ++ ++ ++static double CBRT2 = 1.2599210498948731647672; ++static double CBRT4 = 1.5874010519681994747517; ++static double CBRT2I = 0.79370052598409973737585; ++static double CBRT4I = 0.62996052494743658238361; ++ ++#ifdef ANSIPROT ++extern double frexp ( double, int * ); ++extern double ldexp ( double, int ); ++extern int isnan ( double ); ++extern int isfinite ( double ); ++#else ++/* ++double frexp(), ldexp(); ++int isnan(double), isfinite(double); ++*/ ++#endif ++ ++double cbrt(double x) ++{ ++/* double x; */ ++int e, rem, sign; ++double z; ++ ++#ifdef NANS ++if( isnan(x) ) ++ return x; ++#endif ++#ifdef INFINITIES ++if( !isfinite(x) ) ++ return x; ++#endif ++if( x == 0 ) ++ return( x ); ++if( x > 0 ) ++ sign = 1; ++else ++ { ++ sign = -1; ++ x = -x; ++ } ++ ++z = x; ++/* extract power of 2, leaving ++ * mantissa between 0.5 and 1 ++ */ ++x = frexp( x, &e ); ++ ++/* Approximate cube root of number between .5 and 1, ++ * peak relative error = 9.2e-6 ++ */ ++x = (((-1.3466110473359520655053e-1 * x ++ + 5.4664601366395524503440e-1) * x ++ - 9.5438224771509446525043e-1) * x ++ + 1.1399983354717293273738e0 ) * x ++ + 4.0238979564544752126924e-1; ++ ++/* exponent divided by 3 */ ++if( e >= 0 ) ++ { ++ rem = e; ++ e /= 3; ++ rem -= 3*e; ++ if( rem == 1 ) ++ x *= CBRT2; ++ else if( rem == 2 ) ++ x *= CBRT4; ++ } ++ ++ ++/* argument less than 1 */ ++ ++else ++ { ++ e = -e; ++ rem = e; ++ e /= 3; ++ rem -= 3*e; ++ if( rem == 1 ) ++ x *= CBRT2I; ++ else if( rem == 2 ) ++ x *= CBRT4I; ++ e = -e; ++ } ++ ++/* multiply by power of 2 */ ++x = ldexp( x, e ); ++ ++/* Newton iteration */ ++x -= ( x - (z/(x*x)) )*0.33333333333333333333; ++#ifdef DEC ++x -= ( x - (z/(x*x)) )/3.0; ++#else ++x -= ( x - (z/(x*x)) )*0.33333333333333333333; ++#endif ++ ++if( sign < 0 ) ++ x = -x; ++return(x); ++} diff --git a/utils/ipmitool/patches/101-cross_compile.patch b/utils/ipmitool/patches/101-cross_compile.patch new file mode 100644 index 0000000..319fe63 --- /dev/null +++ b/utils/ipmitool/patches/101-cross_compile.patch @@ -0,0 +1,44 @@ +--- a/configure ++++ b/configure +@@ -24315,8 +24315,7 @@ if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++See \`config.log' for more details." >&2;} } + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +--- a/configure.in ++++ b/configure.in +@@ -489,29 +489,6 @@ AC_ARG_ENABLE([file-security], + fi], []) + + +-AC_TRY_RUN([ +- #include +- +- struct packstruct { +- unsigned char t0 :5; +- unsigned char t1 :5; +- unsigned char t2 :5; +- unsigned char t3 :5; +- unsigned char t4 :4; +- } __attribute__ ((packed)); +- +- int +- main(int argc, char ** argv) +- { +- if(sizeof(struct packstruct) != 3) +- return(1); +- else +- return(0); +- } +- ],[],[AC_DEFINE(HAVE_PRAGMA_PACK,[1],[Define to 1 if you need to use #pragma pack instead of __attribute__ ((packed))])] +-) +- +- + dnl Generate files for build + AC_CONFIG_FILES([Makefile + doc/Makefile diff --git a/utils/joe/Makefile b/utils/joe/Makefile new file mode 100644 index 0000000..875a7fd --- /dev/null +++ b/utils/joe/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2007 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +# changes by David Kuehling : +# +# - include support for all emulation modes jmacs jpico etc. +# - see patches/002-builtinrc.patch + +include $(TOPDIR)/rules.mk + +PKG_NAME:=joe +PKG_VERSION:=3.7 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/joe-editor +PKG_MD5SUM:=66de1b073e869ba12abbfcde3885c577 + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/joe + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncurses + TITLE:=JOE - Joes own editor + URL:=http://sourceforge.net/projects/joe-editor/ + SUBMENU:=Editors +endef + +define Package/joe/description +Joe is world-famous Wordstar like text editor, that also features +Emacs and Pico emulation +endef + +define Package/joe/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/joe $(1)/usr/bin/ + for i in jmacs jstar rjoe jpico; do \ + ln -sf joe $(1)/usr/bin/$$$$i; \ + done +endef + +$(eval $(call BuildPackage,joe)) diff --git a/utils/joe/patches/001-mathaway.patch b/utils/joe/patches/001-mathaway.patch new file mode 100644 index 0000000..99fc930 --- /dev/null +++ b/utils/joe/patches/001-mathaway.patch @@ -0,0 +1,58 @@ +--- a/umath.c ++++ b/umath.c +@@ -378,7 +378,6 @@ double m_cos(double n) { return cos(n); + double m_tan(double n) { return tan(n); } + double m_exp(double n) { return exp(n); } + double m_sqrt(double n) { return sqrt(n); } +-double m_cbrt(double n) { return cbrt(n); } + double m_log(double n) { return log(n); } + double m_log10(double n) { return log10(n); } + double m_asin(double n) { return asin(n); } +@@ -387,19 +386,10 @@ double m_atan(double n) { return atan(n) + double m_sinh(double n) { return sinh(n); } + double m_cosh(double n) { return cosh(n); } + double m_tanh(double n) { return tanh(n); } +-double m_asinh(double n) { return asinh(n); } +-double m_acosh(double n) { return acosh(n); } +-double m_atanh(double n) { return atanh(n); } + double m_int(double n) { return (int)(n); } + double m_floor(double n) { return floor(n); } + double m_ceil(double n) { return ceil(n); } + double m_fabs(double n) { return fabs(n); } +-double m_erf(double n) { return erf(n); } +-double m_erfc(double n) { return erfc(n); } +-double m_j0(double n) { return j0(n); } +-double m_j1(double n) { return j1(n); } +-double m_y0(double n) { return y0(n); } +-double m_y1(double n) { return y1(n); } + + double calc(BW *bw, unsigned char *s) + { +@@ -414,7 +404,6 @@ double calc(BW *bw, unsigned char *s) + v = get(USTR "tan"); v->func = m_tan; + v = get(USTR "exp"); v->func = m_exp; + v = get(USTR "sqrt"); v->func = m_sqrt; +- v = get(USTR "cbrt"); v->func = m_cbrt; + v = get(USTR "ln"); v->func = m_log; + v = get(USTR "log"); v->func = m_log10; + v = get(USTR "asin"); v->func = m_asin; +@@ -425,19 +414,10 @@ double calc(BW *bw, unsigned char *s) + v = get(USTR "sinh"); v->func = m_sinh; + v = get(USTR "cosh"); v->func = m_cosh; + v = get(USTR "tanh"); v->func = m_tanh; +- v = get(USTR "asinh"); v->func = m_asinh; +- v = get(USTR "acosh"); v->func = m_acosh; +- v = get(USTR "atanh"); v->func = m_atanh; + v = get(USTR "int"); v->func = m_int; + v = get(USTR "floor"); v->func = m_floor; + v = get(USTR "ceil"); v->func = m_ceil; + v = get(USTR "abs"); v->func = m_fabs; +- v = get(USTR "erf"); v->func = m_erf; +- v = get(USTR "erfc"); v->func = m_erfc; +- v = get(USTR "j0"); v->func = m_j0; +- v = get(USTR "j1"); v->func = m_j1; +- v = get(USTR "y0"); v->func = m_y0; +- v = get(USTR "y1"); v->func = m_y1; + } + + v = get(USTR "top"); diff --git a/utils/klish/Makefile b/utils/klish/Makefile new file mode 100644 index 0000000..78ccbe0 --- /dev/null +++ b/utils/klish/Makefile @@ -0,0 +1,96 @@ +# +# Copyright (C) 2012 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:=klish +PKG_VERSION:=1.5.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://klish.googlecode.com/files +PKG_MD5SUM:=c98a1c65f7538c3f4687c6f8039295df + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/klish/default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Kommand Line Interface SHell ($(1)) + URL:=http://code.google.com/p/klish/ +endef + +define Package/klish +$(call Package/klish/default,main tool) + DEPENDS:=+libstdcpp +endef + +define Package/konf +$(call Package/klish/default,konf tool) + DEPENDS:=klish +endef + +define Package/klish/description + The klish is a framework for implementing a CISCO-like CLI on a UNIX + systems. It is configurable by XML files. The KLISH stands for Kommand + Line Interface Shell. + The klish is a fork of clish 0.7.3 developed by Graeme McKerrell. + It defines new features but it's compatible (as much as possible) with + clish's XML configuration files. + klish is able to run using clish XML configuration files although + current clish users may expect some changes in behavior. +endef + +define Package/konf/description + The klish is a framework for implementing a CISCO-like CLI on a UNIX + systems. It is configurable by XML files. The KLISH stands for Kommand + Line Interface Shell. + Konf and konfd are klish utilities that are used to store configuration + informations in a way which is similar to what's found on CISCO devices. + More information about these tools is to be found on the klish web site. +endef + +define Package/klish/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clish $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/ +endef + +define Package/konf/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/konf $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/konfd $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libkonf.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblub.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,klish)) +$(eval $(call BuildPackage,konf)) + +define Package/klish-xml-files + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=klish + TITLE:=klish sample XML files + URL:=http://code.google.com/p/klish/ +endef + +define Package/klish-xml-files/description + This is a set of sample XML files for klish. This specific sample set + is compatible with the original clish. +endef + +define Package/klish-xml-files/install + $(INSTALL_DIR) $(1)/etc/clish + $(CP) $(PKG_BUILD_DIR)/xml-examples/clish $(1)/etc/clish/ +endef + +$(eval $(call BuildPackage,klish-xml-files)) diff --git a/utils/kmemtrace-user/Makefile b/utils/kmemtrace-user/Makefile new file mode 100644 index 0000000..4b09633 --- /dev/null +++ b/utils/kmemtrace-user/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2006-2009 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:=kmemtrace-user +PKG_VERSION:=20100102 +PKG_RELEASE:=1 +PKG_REV:=92878e602489d6a6ffd6e50b94f425c3149c86bd + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=git://repo.or.cz/kmemtrace-user.git +PKG_SOURCE_SUBDIR:=kmemtrace-user-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=git + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/kmemtrace-user + SECTION:=utils + CATEGORY:=Utilities + TITLE:=trace slab allocator functions + URL:=http://repo.or.cz/w/kmemtrace-user.git + DEPENDS:=+libpthread + KCONFIG:= \ + CONFIG_KMEMTRACE=y +endef + +define Package/kmemtrace-user/description + kmemtrace provides tracing for slab allocator functions, such as + kmalloc, kfree, kmem_cache_alloc, kmem_cache_free etc.. Collected + data is then fed to the userspace application in order to analyse + allocation hotspots, internal fragmentation and so on, making it + possible to see how well an allocator performs, as well as debug + and profile kernel code. +endef + +define Build/Configure + (cd $(PKG_BUILD_DIR); ./autogen.sh; ./configure ); + $(call Build/Configure/Default) +endef + + +define Package/kmemtrace-user/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/kmemtrace-check $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/kmemtrace-report $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/kmemtrace-show $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/kmemtraced $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,kmemtrace-user)) diff --git a/utils/lcd4linux-tew673gru/Makefile b/utils/lcd4linux-tew673gru/Makefile new file mode 100644 index 0000000..036e6be --- /dev/null +++ b/utils/lcd4linux-tew673gru/Makefile @@ -0,0 +1,33 @@ +# +# Copyright (C) 2012 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:=lcd4linux-tew673gru +PKG_VERSION:=1 +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/lcd4linux-tew673gru + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=@TARGET_ar71xx +kmod-spi-gpio +kmod-spi-dev +lcd4linux-custom + TITLE:=TRENDnet TEW673GRU LCD support +endef + +define Build/Compile +endef + +define Package/lcd4linux-tew673gru/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/openwrt_220x176.png $(1)/etc/ + $(INSTALL_BIN) ./files/lcd4linux_tew673gru.conf $(1)/etc/ + $(INSTALL_BIN) ./files/tew673gru-lcd $(1)/etc/uci-defaults +endef + +$(eval $(call BuildPackage,lcd4linux-tew673gru)) diff --git a/utils/lcd4linux-tew673gru/files/lcd4linux_tew673gru.conf b/utils/lcd4linux-tew673gru/files/lcd4linux_tew673gru.conf new file mode 100644 index 0000000..a3b3ece --- /dev/null +++ b/utils/lcd4linux-tew673gru/files/lcd4linux_tew673gru.conf @@ -0,0 +1,243 @@ +# LCD4Linux configuration file for the TRENDnet TEW-673GRU board + +Variables { + tick 1500 + tack 3000 + minute 60000 + barstyle 'H' +} + +Display Image { + Driver 'Image' + Format 'PNG' + Size '220x176' + Font '6x8' + Pixel '1+0' + Gap '0x0' + Border 0 + background 'ffffff00' + foreground 'ffffffff' + basecolor '000000' +} + +Display TEW673GRU { + Driver 'TEW673GRU' + Port '/dev/spidev1.0' + Mode 1 + Font '6x8' + background 'ffffff00' + foreground 'ffffffff' + basecolor '000000' +} + +Display TEW673GRU_Text { + Driver 'TEW673GRU' + Port '/dev/spidev1.0' + Mode 0 + background 'ffffff00' + foreground 'ffffffff' + basecolor '000000' +} + +Widget OS { + class 'Text' + expression '*** '.uname('sysname').' '.uname('release').' ***' + width 20 + align 'M' + style 'bold' + speed 0 + update tick +} + +Widget CPU { + class 'Text' + expression uname('machine') + prefix 'CPU ' + width 9 + align 'L' + style 'norm' + update tick +} + +Widget CPUinfo { + class 'Text' + expression cpuinfo('model name') + prefix '' + width 20 + align 'M' + speed 0 + update tick +} + +Widget RAM { + class 'Text' + expression meminfo('MemTotal')/1024 + postfix 'MB RAM' + width 12 + precision 1 + align 'R' + update 0 +} + +Widget Uptime { + class 'Text' + expression uptime('%d days %H:%M:%S') + width 21 + align 'R' + prefix 'Up ' + update 1000 +} + +Widget Busy { + class 'Text' + expression proc_stat::cpu('busy', 500) + prefix 'Busy' + postfix '%' + width 10 + precision 1 + align 'R' + update tick +} + +Widget BusyBar { + class 'Bar' + expression proc_stat::cpu('busy', 500) + expression2 proc_stat::cpu('system', 500) + length 10 + direction 'E' + update tack + style barstyle +} + +Widget Load { + class 'Text' + expression loadavg(1) + prefix 'Load' + postfix ' ' + width 11 + precision 1 + align 'R' + update tick +} + +Widget LoadBar { + class 'Bar' + expression loadavg(1) + max 2.0 + length 10 + direction 'E' + update tack + style barstyle +} + +Widget LAN { + class 'Text' + expression (netdev('eth0.1', 'Rx_bytes', 500)+netdev('eth0.1', 'Tx_bytes', 500))/1024 + prefix 'LAN' + postfix ' ' + width 11 + precision 0 + align 'R' + update tick +} + +Widget LANBar { + class 'Bar' + expression netdev('eth0.1', 'Rx_bytes', 500) + expression2 netdev('eth0.1', 'Tx_bytes', 500) + length 10 + direction 'E' + update tack + style barstyle +} + +Widget WAN { + class 'Text' + expression (netdev('eth2', 'Rx_bytes', 500)+netdev('eth2', 'Tx_bytes', 500))/1024 + prefix 'WAN' + postfix ' ' + width 11 + precision 0 + align 'R' + update tick +} + +Widget WANBar { + class 'Bar' + expression netdev('eth2', 'Rx_bytes', 500) + expression2 netdev('eth2', 'Tx_bytes', 500) + length 10 + direction 'E' + update tack + style barstyle +} + +Widget Background { + class 'Image' + file '/etc/openwrt_220x176.png' + update 0 + visible 1 +} + +Layout TEW673GRU { + Row5 { + Col1 'CPU' + Col10 'RAM' + } + Row7 { + Col1 'Busy' + Col12 'BusyBar' + } + Row9 { + Col1 'Load' + Col12 'LoadBar' + } + Row11 { + Col1 'LAN' + Col12 'LANBar' + } + Row13 { + Col1 'WAN' + Col12 'WANBar' + } + Row22 { + Col1 'Uptime' + } + Layer 2 { + X1.Y1 'Background' + } +} + +Layout TEW673GRU_Text { + Row1 { + Col1 'CPU' + Col10 'RAM' + } + Row2 { + Col1 'Busy' + Col12 'BusyBar' + } + Row3 { + Col1 'Load' + Col12 'LoadBar' + } + Row4 { + Col1 'LAN' + Col12 'LANBar' + } + Row5 { + Col1 'WAN' + Col12 'WANBar' + } + Row11 { + Col1 'Uptime' + } +} + +#Display 'Image' + +Display 'TEW673GRU' +Layout 'TEW673GRU' + +#Display 'TEW673GRU_Text' +#Layout 'TEW673GRU_Text' diff --git a/utils/lcd4linux-tew673gru/files/openwrt_220x176.png b/utils/lcd4linux-tew673gru/files/openwrt_220x176.png new file mode 100644 index 0000000000000000000000000000000000000000..e9f5b9871bedbcf1029c2a55c6e231a29ca8a9ac GIT binary patch literal 13128 zcmV-OGq=o%P)Px#32;bRa{vGh*8l(w*8xH(n|J^KAOJ~3K~#9!?R|N)Bv*OgckivO*SF4lv+tu7 z!Ds}CAR&-6I+7)XL0}|^47SOMjpLXk$3`NYI61O|mEgqZfCEnOiP;>4;UL*U0ttZt z2}x+Ak=IU0vPpy?HZFL*4VvOfOZ{)m6X#ec$ittO1m6OHv}NiV5dvJ_cfGc^5Q4O20SL$S8RwyIsu4m6_I#?&DL4qh zjB!ZDLdQSedlyzuD)oA)TGKVMW^C9r8lXggTA)PT|Jvb;5actNv7tc#F*#eLjJ4iX zhec>8p8){QMWt?s&J1HD(F_2#j2eG=@p& z%kw4?5)y$U&ILdOWEJ=KX-1N<5M0XtrshgQ!1(Z>p=)6bp*A?SNU`~}4ZeYW5rV;7 zCYMfmKAkI9LLV%*$)(c(z!I~At>bv)|!Tc;11eT zLU1JVx`MAkijjN?-QH@VHi7J-aapR?d`k0~blS3%`3~VMXrqIF;SD;VIXaZr2q{%- zK4qOp&SfllcWbsAy2}WGsT)no^h1QIem@EnJWvm@f z#^P})geX+17^9JaTsKe#;TWd9c64^`NH885$O!?3N(5yhgwmD)0FLKM_6mN4X*9s+ z`82ev9fX>6D>sHQQ+uK+y6srDb&56fpt-Q`Z$E@^H3ZSwsk`Ot1KEraP^sC_aWJL39nT9LTGup1W0bYI znC-Z1gL{}SgSdB00hOT)&bv+-UHnKqoG(x2N zNGa!j?Z@B!hJuAPFnsYlub-PZzHish6|-LU&i9P1+r0OgpA{xgDEfTQ2R@R@Ld(mhroj9e=Ib@Lwr%%ql_{2B=_6uMC z`qwsW+}K^+pzcm&!i!78m%2u9SIr3ki27dP$ZMbb-;b)Bdg$RI4G)a1X}Fk< zQ!Pw4%&UOm@l~@YkDWSkJe?n0xnUDPHZwGO=01*Ih6E;-|lOX)o-aWVH*w#~a*!wa76s9Lg_)(yRF-H>zmWo!DtUB7$#&6jU|<~v`x>1~&8-@aXLdC`Rz-g)zN+T{Lf zVYVM-Eg-SqOE}Oc?)k!sp#g+C^Vf|H9{PvBd-BnT)9Dldyt-%4C;#L>UibbF1HkSl z9{+=neBkDrZ$cxE zW)6Mvi(dqQYOOYq&!0LyIksX{2*DWBG_6vt4h;@YoH{+WViW-GzWeTY zKlw=jc=+LmZ@lp)LU6fUUbSk~zJ0H+UArcDCimWZ@8kO?2Ue_$hI`{PWMN%?5LALi_gHZ?|p7 zZ^py#y6dieyPhnZI(hqVTrWXctJgpK+0TCd^PlHjV2tj)_uf=(ng-(MciwrY0wnQi!q&)j|YgFpWH|N6VXzyE>zr6T$G$A0_7!M$zZzT+crz49G%g+|%O zmMvS#bFn%_)IeyVx2M<03Q(MKN%y~w#Za%wvCbw2yq&t7`@+y44*zO-fgJFdQV z=XbyRUHSTt9(!!Vwu}DuYyY4%gf>01TrS50iR>La zcI@1_bLY;Tn>KBduM7?<@DsFmdVL*L2~bxH7+|n`j8a8_=+pP@%69E$75q-fBHv%@Pn^?`Qfj9 z>DKqW^DWH?%Oj6Gvi^cgg1g`H-uM3O!S5V=>G{i>g7?UgBizg==zR2}AKiH2C2O}_ zfSP0d`t>vbLC!fsxKk33uifz6bI%1|+4bCW`LQ)CH*S66$tT)g-?eLa)!LvbC>9Hb zm2Q1`-1^xVhA}sB{8vADD45!5?i=BTCYi=1$E8%1T||IbyJ_qH`_A`fXJ-|jo_*@c zT~9rE*Ijohvi!^c_W299zcskqyRW(CJ7535k3IbTp`oFMW_s~g>)&+6x93f*UcIUToyQ(K zU1zJeUi{a8^W}pF4*|fIEt?;H==PTDd%rB722iJ{T)i>|rphMV8}8#}MN<(6C4tX-S3tYgQIKmL=SeEYlK z+kWlMYc_2S-J#EY?sKVB>gHQ+Nm;4;@BiL6zH|RY@3|Eda_xtH`!_#)$45W-{u^() zY4z&Wwr!s}b?Slp@4x@i$FI2YHUM_uz=6jedkg?xdF2%VV2r=8d$*zM>J=eiZ0-8L z`^r}?z4TH5V2mA|DqN^x04Tcb!3Q5qrBc#u$PAB3Z0+5r;Z#v zxbL-UxkNNAlN&HcSLa8^^O;nZz}}Z$P_}!`=B+cO>gmG=03e&TG(t99cxiTUxK=Kn zKDf79w*kQR{K1uLF1YYw0GOLRHF0D=rCeHo@lD$@14D>7`Oz`; z{ZpnneeA%=gZo^^F*EseesFx_RwI>`fKFQ`fUsRpWwrw0GYw-DnnkHt79-T@fh42P z@sIc3rR6fIVx?B8+XLBjH%e$&Gl20m8^+gc=-ecdJT7?ijyJviDg(op{_~&Q{%=10 zz!(4GU;fdbKJcyobKA%M)$GyzSKsuTlrcb1cifpmnQ@*^ncw;!|K$_^>GO`~A%r;R zK4mVkGK0fHz^c(P9v&UdWOJ9k=T?_-gb){eWaa9?v6Xeltve1v zNP;OpICSFq;~U@n*4+4d$Me)gB8(B|Lf6QeEf=ode4*`nAqlAXGLjVIoya6&zgRmy zkWH7WwPK~3OQ$eKjk$#a0D+ok7zl8R9u}?R9{L=uSheQ(-j~*_T{m~~@YLxEBb%Ez zer#KD>ZM=&ba=%Is->on9b^Kw-g295+lcwkK6qa$l^WZ)&2in@%;{7*J+%3f*M9o_ zbUM9d`<2wl0D$AVqZ_sjuUtEOWM6H1!rXe{#ED~w`AD}`UbOw_FMeoR*3kNG)V24& z_F}P6*!bqR9^3uo?5X3~(Un81*3TT;Gdndox_a%)M-N?b!>!iH>dtf`YC=95L~#am55Xj#N&A!)D>V@mJ*ojgvt>Z!U68NKx6;|{E$@5(wL5RPcIOS>`=F0tEj<0^=M-N|f)2%=K;X~^;Z*zURfA1d8bq^ohzxB#%fA!Q)2Zl$SYT2t60bu(0 z;n}Iv*<60=$bK%w)TxuxvvWv@a{{@&Z4{mBmr_h)8i)?NITx^1uCeBsQ* zacG|g)VMSV0YF!4j1tka#JXoFpRLxNLZy;PnWmvjI4ag`J?-x1OYC0r-VcTpy$~>0 zuI5I^?RtHD^F@Orqbt_50^Qkxp+cp$degSasp*w#*AI-21HjPA)s%7Drx(2Cim9oo z6>B#f+4t&>cU+Yn81g;0JTsLVZWL7vtXc=T5tuk;W%Cqk8@6maJw5Z*tFJ}*QP1;i zpKZSQGKR>mAO8Tj?=i7q%LTh0d0^uO7dw>chQSyknhqE>PB@w`yO1U7A$k%$v{>D9 z*B8DD05!*%oGt1aSvxkW=Ep=%A`69G+8im-_M#9_cbwC+g|wls8O}4J>%cjH0F0Oi zngNU+oi0&E4eqa6xl&+4nCoK$bH;qfL&i*@g#9`;QbR+78uI}J*DdKa)+=s(;W++_d& zCL+KD1ZG8c@+B8tlRYAV-qQJ(>e0wRK5dzf=S@t{DH;#~4vhPQuruno-o(r-=VEj) zAK5nx01D-*w2Aq2I&_PL0M!{QWrcFtA~>Vh(A#DUdF`577DLH{ho+fBb9$r@5E;{v zKh93SGhpJox}FJQ&j2nJ_{K*DB{WY=&A6T~0@5cw@DbcV2q;x+5|k^3^0{<$_^DcN zbXUu!QgRZHYS#t;b*I(lAY~c~?s7PR1eKxbZSp_VMk|nYjF>#s^jLTYE>(Sg7b@)< zok+y^8Ny|Nz!0F7BSTW2pO~7ND^)me87t8e-{C)nNYAGe({r-J;P}X(0%eFS8RN2J z5yogRm+52|)k(`TjL@WS&!>vsFh;tr8WjO!JP0F=5EO7f7-!+=cN2V_e2Ec`3lbqD zi>kV?WrC|Sp~pkf%F)5RW$LrVN}*CM*Xo10OfHimn8df2a6P|NtyOJX2rvzOY-q66 z+N#5XPZ!D(K!e$AsPiQN1Vh}}wAHR~MKGIh8AfAHFaQMF7zK^E9F(#Uj8t0=Aw(xB z%6B8lQsR<#2_PYq1l7+JE<2!^O{G$%StwU4_4;h7GFPrxhMBeuL)Q(RV1y-MP{uv# zJFZ`MT!|z?@NhmGwB1o|Wlgr$NSQ`1V|B7lxmjXt>bjxn!P_iETU!np)lwsr6_iuz z!hh-SKOe&kU zR3NEMGc}*qY^PMML8G5mzTv_K$g*a;s!Nt4OLfO>*Hs)wFjn0zr4bJ*n_w?O0PtD3 z%v3qGoq7l%*2WDw70|+0t{U< z+Gm!yD6QKaPCcmLd$wVx=}+D9iefk%3$$ zWp-L{$Mcj7&!kM9Xd$u;resp4i4j&C_>=}|4`URJ5OvNKQE|;qBd+2{JleSgS-aFN zbeV{rGp2hO=aX}V!CW?u%}XBZ2;v11dVtIe6mekL#KClE*BtrFhWWG@yy^-rXPiXLb+PE z-I2kZwAXFugf@)E!!ZcrYTcPDR~ilUF$r+g@9_^ zso74-G;`^cWg37)FbL9B{ZZ?VTX$T7v1J-EqOK7V#ApC#!t$+$NYv zBOZy%rV;NRxlD}snf5PRvC0rSCC6k^RyMY*FbajCjEHEugI=*xWvzu7@n{57f)HY^ zTn$1epGgO;ybvNpmWHk=K?49G`woGOxva6p4cJdo}1DFHwfD%Bv{r7bfUDwh^Kh+2doV_6U=P47gWTGcO7 z@gRfkHA+lFY*HC64cvQ9RO5F~M ziA>5G$fi5gw-n&@V8xoL>$!B;f`?*5mSF^AmhG#cHgKcJvNNIyjm)GF0%DbT5+OQ^ zcHF0Qwp6avwR|QW5Ec>3*NA@d<&7Bt@&qk(KjrFP_~*-prDOqpg-?l@6Bt}Me)Wa-gJ zBd*Ewk6v5?W9X7Dhvr(O;W}RDgl-%iD{FD%^ zJWHoJ$uo2i*@`GKI*Skxj3eg&HC@l7hG+?JDQ|qnvNDz>jc+KIDDO9A4BYu0nqZu^ z%(T_yv-bKR_0aMBVx<px!{q=(=|F;EJL>poeS=`zT^3x?=PTyogp=+|>O?L2#Y9rX_ZA9CX&w1iweEBpXo9htN)efp zguq1J$akSp#t{=9YEX58p(Vj3=b}=#D|Op6beV<@Hu_(LoodVnue)xrSS}B=J)oiCTm#Awbn@-_?^;CU6LWohzYjm^V1Y=DjvXrh{l}0m`-n|t}0?MWKF9E>y zeAn|4LWZuHx^5bJu<#ptFYnc6e_h{qJ=#s=VvHn7hXlKfiK?pP5GZr$bdV_>&x^#I zWtagC?nT;YL)T^fZ{$=8(GtQ%;ehZ1)=^C+2!!itvB7>TuX1kG4GYvgswfU5; z@7HW6lH`Q;d;}4N=CsMawlpK*Y#!00f*RxLitH=F+Kb+HyVWxL!B@h>|${ z-W80IsT*m_XtiGH2x`iNXD3Y}1Zm5%noZl9p!6c6LKvfzWhl2&&h3mqxo*hQ_x$d$ zA=I_72$It@_#yxR65&ZiK~z}!S&9>ZK!BQ=9^v`a^QlMuZd}sOkTcYzpBikc)`>{Y zdChja5nC>u3N#XG_>_^HiZRNhEG3C-r<+@;$*6<+RlJ{U_u$MJD%gY-6j^MEmOLQYA;!n5gBMi2r?;4A=vf(E}J3CXlU?m*&Twh zj19%i5Kj`1X9<^-F=Z=b(mWD;7@=-)_HLP>V4;TVQOEPT#j&MQ&Ne}&_GO$`ZJTvz zfRRaAs(QnxEOH@H08mb<>wDdP4^r;LkR?VqiCLZ{To%ezjS$P!Ozr=e5;|7P ze8+%NRy0euGBTVQwBRvyeHbMc{OsaV4aT|Mgn|sJ6N06bkwNt+unIXBjB(x+Nt|)k zk2pXGEW@mP%{#d0)*{&-Mm1_f2{&G0Y0VOIF(?mv`(n|dgy?FKz0jD zVnfRvm)#vliN%HB5g{-%-89;Rnt>z9>|zYpnvF0PDD~Y<=wOU2Q&*9rZkUskdl=&} zABqu9Vnb&emjl_1=lj7$#Fk>{8ZmS&G_^8_6`#>=Wk-sq)0U}9NrY%yekuZ#&4i@m zdEHo@U`z<+T*O=OMDCmeTxtYs#7tWz=fb1Zr<5{wM(BYMtP`y{krH)NOFpBH>vdBk ziq%@BYXXE2b=U1?SS2Xs#;)hbtXZaMJ>1HqZs?rhQpMFVR>>aVTu{y!_IMRNpbCS*8i%1voUz(GvrHj&T_>!9Ha^ zu%JbgJ&BqD_10=B^46)@6kIH@szEkp4@`M$)unsBAFsDe-H`oMITudUeB2-?H9~|C zl+l=DHu?f50n25D%P412Fd>%6(UKW?wRQ;vmJ5%s^N{;C$yHFs;}I-D2_i19({L*R zvBZKee_SrbKnQeA(={zPjwex6GalY^4AoXvO+?t ztDx7aII^EkU9!SgE-flkk?~%vVoI+EQzp^M<%G*zCM9P|$SC?!P@_~)p_Ry50U!{* z&pH>(>#n;SYiP(4p?Dn0k|^2eKYmMD^P8Y@x!@8bgf*f%mom;|b2HBQ!gP%6`b-+R zAB++1R<+4E^L!SsLV|LnS-C82H;qqSLL*Ko)pw7NkZlbUP%a}}2Iu!Q1DS0AVw}rT zF*&hE$#A91F+u>1xjqEr?)pi^k{G4DXT5NzGYTN2?(Uf@QcDK*14>z2nF#RZg-h4- zH4S5oCCWnFhEQXDSs)8JdT^bnMo$jL=0!`oMw)6}#I(=|5w@-oS#QyEV~i64zC3a1 z`>x+uH%Y?;V@wE=%hd$Y**^puPeE|brAyFf`Ff{os2a8a0A<|sds8gNNN?u8dq(x+ z8~P{X-0N{6Aeb+f;#7Ky(m_Pc>I{j|_Vu6y=OFu1b1tLni!zJth!l(opY~NADpd{u z#4JLPfbtC-ClUgfoMXk#-l<5ZP@3STD+zse{!k8OKhhhTNu30gZ!lb*|`?-duPz0p%M9mqGwSjdh|3K?I223Ldq(w>7&>wAxMwmj}Sj%1qhht=X0%2!h5k z0Fs+y)~1a!+yrZw0FqJqeq*9Ca=x%nOvX9GW!-UQ{!p4)gphD^N!baK=n}6rvej7Xn11d|gJ@7f(?w zL;}pq4VAWgkrDo6EF(SMvp_vmTfQ_Qq()v;GWC3gk^E65w)@vBPPC*q8zH0-tU7Vd zU#d54cQVEH*A16TN04gzr4V8P@~BCZiSABtxp+7tjAfl&Ln=wZF6MchM)`4KyAxb4 z%2+G;--M%BScQB;lL1O*L7Z2(B=~I1Yf+VQGSaSIUt|bL8g6OylY4ny;Zke$0Fv>Y zRxEunCjge4?<$N&wpG}${I|D5kl>C>H<`nC)j7Y4Ii!97mWvj zejKgisMO|Suoy<9NDz7c;xcFf8@IffQ4ECB`_A_W;DN;DVtTO0A~JC$f1PxXjHpK$ zWdP{e5T!LgIxJ*Ve7H7wo+u%`+hB3jR(!69O zxLooLt zVf6C~m$EH(FH9_lX+47Zeiz?^){2Gf&`5%_^T>`1!8z-R-DN`U-QMy&Cjr^{#h0Qt zUji%(T*jQING58Yhqx4PgqtdQx)Wml4e=6OE@v~|)4yB>c3c*W#-Aj@2`XKhMsSbnTj3tF^vnQWk2@n^B z%hQMUQO^?~FveCUKRCXcXiLSovZ2-j>^P%7(eyLrOUPMqy?#PH^?00ALP-(fB5_GQ zPsWfL=e5!t*2vKKnx*1P)|)RQ%R)<2r-xUsTg*q#o;>Q>HAbmC0Za(d^sxJuFHD)@q%t0nNpF4HD)1T3FL$@q5mDLPmQMeR>w_VVs z>=i8pTUZ{FF@KRC?b>zUY2|4c=gjx1=SJg_^ImqGM~b@O^OLW?8hkpma&0<4(2FBn zw_bJanwicB&TFNDy73re6`9fu)3DO#7MG0CYGF2J1ET5q732Alu?6Cia~90GEk+K9 zAPxW_pOrJ#I}aH}HNNWtfL$ru)iNfe-3TMxbmp?dqd^1B8LgFyjC#6hG3s}Iv=A_T z{E&1O<;f#V#y4)AK7KgVx zYd7Xc#{xj0^iD zzkOwPCiol^0sv06GJjG>J-%8WrrpY9OVg(fD^;%)>*dmX*!rB9axt&a%6xIz7Q2zh zsupIaj~|-X*)ZR;E2a3m!8z+0C$cL=yHZq7YsIUqQRSKQweC>E!tXndHY;86F z&`O6IXb+cgM(1B%$%WvI`nA$re_9(jXVmkk=he%_p5gKE2At1M9PQ(S<}KkPC8{rCu@n4{U1 z^5K`B8(zI`aBS7Ns!$f9w?t-i5qv44_!7GF<&l?nuUNM!7`2%?cCa*cI+9}Bttv1& zZ@xqv_4CtgN)3Ddnr|Vvp!_*A(>_fBXrL!yLi36{#-g@yubx+WXZ!|*aT976LP~UAkKgwtq z&o6{a&ggvgzTkKPd(FqUUJx!j#5E>b&qGn)n>~3fog17xeIkx#d=DYq&xsx1`?AuP zQlSeWJiG2WHlrTKL^BMc8@g%XMdY7^5Y@tLZg{kxh+a56SF1+w<=$t0CLgR=ziDLk z`fi*dI^#q_i0)AUg~EEdIC*%#Q?GX0IOJb4%0#a?QTX)aT50p#tN$y$up@UWVuboS zN$Rm`VJ3b{-*Yk1=5=D_nJJ0O(}!L!oIW0Uch#1QhE}d!@KvIoYgdXLxa{lF1zk)n zXc3f9?bG*{7Aju%FyCj?2LQKTt(6Ngrxo%q8TICE$1z`k_3zspFVKz`PETY8hl9aw zgh`)=>ba#|E@_%EuM_iKTRFa+J9bL01G}H{UB^siHgCVO=fN4JQ9&5g&lv_eRg3sp z2hMEf#8K+G%@PX1{5C6DEzX`gxX*W;m>^kk>Qr&+R6p0N)4!Z=?5(*j(9+`Vew@eQWVnW3HaOnun5yp{MxNv%+JTvLL?%>#} z73(((A#+`xZdkJu$7W6(=@!C57;Sjd4(5B3hC+9?pEC>sIs%u$nc6ca4tsXJ>o;`l z>0<}a)Qu0uGG2T7ao@G)n>ps3_mx#&pdnv)jM}qnd!PQPG~uIbH_lBQ@9RDxOuZfm zHc}bR{P~`k@41GR>P)!-K&?2d*lT3%hNG|ScI!0&z?$Y%%Rv{ga~ym1#TDx}v8aft zSTJ8Irky@^xHvh{a7F92vs2?pG$POb#OtpBfalZ~P{W2At4uBlE*bUD$dTtJj?-Q- z|K=U>CXeio|Io=J`xkHyzH3Wd^4J-3rw;5bO;0v}qU${a)wNQ=-|u7wh8Cd5L)g_+ z3QN7}+4UHXT(Y4{A9v>Xkwr)o-cPm1!Vi8Xj_kYhn7O+|>t0q1vsOA6@AJ5J&2#LQ z6%``hVN*nArqhwaWPW_P_nDu-G8i(3Og+D6!YV#a#3)BQ_y;9t_>*s{%jQI#5!^%j{zaM$f!sU|IP|i2Vw}9MZ+ZRKWE$#?C z#6CNJa7jI%FXcC)%mn}e;B+a#>)~H6limSXBZ70z*<#Lz`J8&*5`CkI1AE{+8cw~! z8CzDJBZ3Nhx!7^RMPYJc=J?@7o{#6$c+z^Mk5QhPT5hN0yUx_n15LhM9(R#5TA7=g zojA7GD9ou7NlTzN=y2=RgD?D2@#V76nC022^6VM-1=q{P + TITLE:=LCD display utility + URL:=http://lcd4linux.bulix.org/ +endef + +define Package/lcd4linux/Default/description + LCD4Linux is a small program that grabs information from the kernel and + some subsystems and displays it on an external liquid crystal display. +endef + + +define Package/lcd4linux-custom +$(call Package/lcd4linux/Default) + DEPENDS:= \ + +LCD4LINUX_CUSTOM_NEEDS_libdbus:libdbus \ + +LCD4LINUX_CUSTOM_NEEDS_libdpf:libdpf \ + +LCD4LINUX_CUSTOM_NEEDS_libgd:libgd \ + $(if $(ICONV_FULL),+LCD4LINUX_CUSTOM_NEEDS_libiconv:libiconv-full) \ + +LCD4LINUX_CUSTOM_NEEDS_libjpeg:libjpeg \ + +LCD4LINUX_CUSTOM_NEEDS_libmpdclient:libmpdclient \ + +LCD4LINUX_CUSTOM_NEEDS_libmysqlclient:libmysqlclient \ + +LCD4LINUX_CUSTOM_NEEDS_libncurses:libncurses \ + +LCD4LINUX_CUSTOM_NEEDS_libsqlite3:libsqlite3 \ + +LCD4LINUX_CUSTOM_NEEDS_libusb:libusb \ + +LCD4LINUX_CUSTOM_NEEDS_libvncserver:libvncserver \ + +LCD4LINUX_CUSTOM_NEEDS_serdisplib:serdisplib \ + +LCD4LINUX_CUSTOM_NEEDS_st2205tool:st2205tool \ +# +LCD4LINUX_CUSTOM_NEEDS_libftdi:libftdi \ +# +LCD4LINUX_CUSTOM_NEEDS_libX11:libX11 \ +# +LCD4LINUX_CUSTOM_NEEDS_python:python + MENU:=1 + PROVIDES:=lcd4linux + VARIANT=custom +endef + +define Package/lcd4linux-custom/config + source "$(SOURCE)/Config.in" +endef + +define Package/lcd4linux-custom/description +$(call Package/lcd4linux/Default/description) + . + This package contains a customized version of LCD4Linux. +endef + + +define Package/lcd4linux-full +$(call Package/lcd4linux/Default) + DEPENDS:= @DEVEL \ + +libdbus \ + +libdpf \ + +libgd \ + $(if $(ICONV_FULL),+libiconv-full) \ + +libmpdclient \ + +libmysqlclient \ + +libncurses \ + +libsqlite3 \ + +libusb \ + +libvncserver \ + +serdisplib \ + +st2205tool \ +# +libftdi \ +# +libX11 \ +# +python + PROVIDES:=lcd4linux + VARIANT=full +endef + +define Package/lcd4linux-full/description +$(call Package/lcd4linux/Default/description) + . + This package contains a version of LCD4Linux built with all supported + drivers and plugins. +endef + + +CONFIGURE_ARGS+= \ + --disable-rpath \ + +EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib + +ifeq ($(BUILD_VARIANT),custom) + + LCD4LINUX_CUSTOM_DRIVERS:= $(strip $(foreach c, $(LCD4LINUX_DRIVERS), \ + $(if $(CONFIG_LCD4LINUX_CUSTOM_DRIVER_$(c)),$(c),) \ + )) + ifeq ($(LCD4LINUX_CUSTOM_DRIVERS),) + LCD4LINUX_CUSTOM_DRIVERS:=Sample + endif + + LCD4LINUX_CUSTOM_PLUGINS:= $(strip $(foreach c, $(LCD4LINUX_PLUGINS), \ + $(if $(CONFIG_LCD4LINUX_CUSTOM_PLUGIN_$(c)),$(c)) \ + )) + ifeq ($(LCD4LINUX_CUSTOM_PLUGINS),) + LCD4LINUX_CUSTOM_PLUGINS:=sample + endif + + CONFIGURE_ARGS+= \ + --with-drivers="$(LCD4LINUX_CUSTOM_DRIVERS)" \ + --with-plugins="$(LCD4LINUX_CUSTOM_PLUGINS)" \ + + ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libiconv),) + CONFIGURE_ARGS+= --with-libiconv-prefix="$(ICONV_PREFIX)" + else + CONFIGURE_ARGS+= --without-libiconv-prefix + endif + + ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libmysqlclient),) + EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql + endif + +# ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_python),) +# CONFIGURE_ARGS+= --with-python +# else + CONFIGURE_ARGS+= --without-python +# endif + +# ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libX11),) +# CONFIGURE_ARGS+= --with-x +# else + CONFIGURE_ARGS+= --without-x +# endif + +endif + +ifeq ($(BUILD_VARIANT),full) + + LCD4LINUX_FULL_DRIVERS:= $(strip $(foreach c, $(LCD4LINUX_DRIVERS), \ + $(c) \ + )) + + LCD4LINUX_FULL_PLUGINS:= $(strip $(foreach c, $(LCD4LINUX_PLUGINS), \ + $(c) \ + )) + + CONFIGURE_ARGS+= \ + --with-drivers="$(LCD4LINUX_FULL_DRIVERS)" \ + --with-plugins="$(LCD4LINUX_FULL_PLUGINS)" \ + --with-libiconv-prefix="$(ICONV_PREFIX)" \ + --without-python \ + --without-x \ + + EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql + +endif + + +define Package/lcd4linux/conffiles +/etc/lcd4linux.conf +endef + +define Package/lcd4linux/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/lcd4linux $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/lcd4linux.conf.sample $(1)/etc/lcd4linux.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/lcd4linux.init $(1)/etc/init.d/lcd4linux + $(SED) "s|^\(Display 'GLCD2USB'\)|#\1|g" \ + -e "s|^\(Layout 'TestLayer'\)|#\1|g" \ + -e "s|^#\(Display 'Image'\)|\1|g" \ + -e "s|^#\(Layout 'Default'\)|\1|g" \ + $(1)/etc/lcd4linux.conf +endef + +Package/lcd4linux-custom/conffiles = $(Package/lcd4linux/conffiles) +Package/lcd4linux-custom/install = $(Package/lcd4linux/install) + +Package/lcd4linux-full/conffiles = $(Package/lcd4linux/conffiles) +Package/lcd4linux-full/install = $(Package/lcd4linux/install) + +$(eval $(call BuildPackage,lcd4linux-custom)) +$(eval $(call BuildPackage,lcd4linux-full)) diff --git a/utils/lcd4linux/files/lcd4linux.init b/utils/lcd4linux/files/lcd4linux.init new file mode 100644 index 0000000..ec56a09 --- /dev/null +++ b/utils/lcd4linux/files/lcd4linux.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=98 + +SERVICE_USE_PID=1 + +start() { + service_start /usr/bin/lcd4linux -o /tmp/lcd4linux.png -q +} + +stop() { + service_stop /usr/bin/lcd4linux +} + diff --git a/utils/lcd4linux/patches/100-drv_RouterBoard.patch b/utils/lcd4linux/patches/100-drv_RouterBoard.patch new file mode 100644 index 0000000..9780f5a --- /dev/null +++ b/utils/lcd4linux/patches/100-drv_RouterBoard.patch @@ -0,0 +1,11 @@ +--- a/drv_RouterBoard.c ++++ b/drv_RouterBoard.c +@@ -106,7 +106,7 @@ + #include + #include + #include +-#include ++#include + + #include "debug.h" + #include "cfg.h" diff --git a/utils/lcd4linux/patches/110-uclibc-logarithm-fix.patch b/utils/lcd4linux/patches/110-uclibc-logarithm-fix.patch new file mode 100644 index 0000000..8f6d861 --- /dev/null +++ b/utils/lcd4linux/patches/110-uclibc-logarithm-fix.patch @@ -0,0 +1,11 @@ +--- a/plugin_netinfo.c ++++ b/plugin_netinfo.c +@@ -264,7 +264,7 @@ static void my_netmask_short(RESULT * re + sin = get_netmask(arg1); + if (NULL != sin) { + logval = (long double) (get_netmask(arg1)->sin_addr.s_addr); +- netlen = (int) rint(log2l(logval) / log2l(2.0)); ++ netlen = (int) rint(log2f(logval) / log2f(2.0)); + qprintf(value, sizeof(value), "/%d", netlen); + } else { + qprintf(value, sizeof(value), "/?"); diff --git a/utils/lcd4linux/patches/120-remove-as-needed-linker-option.patch b/utils/lcd4linux/patches/120-remove-as-needed-linker-option.patch new file mode 100644 index 0000000..b5e56fe --- /dev/null +++ b/utils/lcd4linux/patches/120-remove-as-needed-linker-option.patch @@ -0,0 +1,11 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -18,7 +18,7 @@ ACLOCAL_AMFLAGS=-I m4 + # use this for lots of warnings + #AM_CFLAGS = -D_GNU_SOURCE -std=c99 -m64 -Wall -W -pedantic -Wno-variadic-macros -fno-strict-aliasing + +-lcd4linux_LDFLAGS ="-Wl,--as-needed" ++lcd4linux_LDFLAGS = + lcd4linux_LDADD = @DRIVERS@ @PLUGINS@ @DRVLIBS@ @PLUGINLIBS@ + lcd4linux_DEPENDENCIES = @DRIVERS@ @PLUGINS@ + diff --git a/utils/lcd4linux/patches/140-no_repnop_T6963.patch b/utils/lcd4linux/patches/140-no_repnop_T6963.patch new file mode 100644 index 0000000..85be2c3 --- /dev/null +++ b/utils/lcd4linux/patches/140-no_repnop_T6963.patch @@ -0,0 +1,22 @@ +--- a/drv_T6963.c ++++ b/drv_T6963.c +@@ -114,7 +114,9 @@ static void drv_T6_status1(void) + /* wait for STA0=1 and STA1=1 */ + n = 0; + do { ++#if 0 + rep_nop(); ++#endif + if (++n > 1000) { + debug("hang in status1"); + bug = 1; +@@ -150,7 +152,9 @@ static void drv_T6_status2(void) + /* wait for STA3=1 */ + n = 0; + do { ++#if 0 + rep_nop(); ++#endif + if (++n > 1000) { + debug("hang in status2"); + bug = 1; diff --git a/utils/lcd4linux/patches/150-addlibmpdclient.patch b/utils/lcd4linux/patches/150-addlibmpdclient.patch new file mode 100644 index 0000000..0e51f67 --- /dev/null +++ b/utils/lcd4linux/patches/150-addlibmpdclient.patch @@ -0,0 +1,2624 @@ +--- /dev/null ++++ b/libmpdclient.c +@@ -0,0 +1,1957 @@ ++/* libmpdclient ++ (c)2003-2006 by Warren Dukes (warren.dukes@gmail.com) ++ This project's homepage is: http://www.musicpd.org ++ ++ Redistribution and use in source and binary forms, with or without ++ modification, are permitted provided that the following conditions ++ are met: ++ ++ - Redistributions of source code must retain the above copyright ++ notice, this list of conditions and the following disclaimer. ++ ++ - Redistributions in binary form must reproduce the above copyright ++ notice, this list of conditions and the following disclaimer in the ++ documentation and/or other materials provided with the distribution. ++ ++ - Neither the name of the Music Player Daemon nor the names of its ++ contributors may be used to endorse or promote products derived from ++ this software without specific prior written permission. ++ ++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ++ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR ++ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ++ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++*/ ++ ++#include "libmpdclient.h" ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef WIN32 ++# include ++# include ++#else ++# include ++# include ++# include ++# include ++#endif ++ ++/* (bits+1)/3 (plus the sign character) */ ++#define INTLEN ((sizeof(int) * CHAR_BIT + 1) / 3 + 1) ++#define LONGLONGLEN ((sizeof(long long) * CHAR_BIT + 1) / 3 + 1) ++ ++#define COMMAND_LIST 1 ++#define COMMAND_LIST_OK 2 ++ ++#ifndef MPD_NO_GAI ++# ifdef AI_ADDRCONFIG ++# define MPD_HAVE_GAI ++# endif ++#endif ++ ++#ifndef MSG_DONTWAIT ++# define MSG_DONTWAIT 0 ++#endif ++ ++#ifdef WIN32 ++# define SELECT_ERRNO_IGNORE (errno == WSAEINTR || errno == WSAEINPROGRESS) ++# define SENDRECV_ERRNO_IGNORE SELECT_ERRNO_IGNORE ++#else ++# define SELECT_ERRNO_IGNORE (errno == EINTR) ++# define SENDRECV_ERRNO_IGNORE (errno == EINTR || errno == EAGAIN) ++# define winsock_dll_error(c) 0 ++# define closesocket(s) close(s) ++# define WSACleanup() do { /* nothing */ } while (0) ++#endif ++ ++#ifdef WIN32 ++static int winsock_dll_error(mpd_Connection * connection) ++{ ++ WSADATA wsaData; ++ if ((WSAStartup(MAKEWORD(2, 2), &wsaData)) != 0 || LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2) { ++ strcpy(connection->errorStr, "Could not find usable WinSock DLL."); ++ connection->error = MPD_ERROR_SYSTEM; ++ return 1; ++ } ++ return 0; ++} ++ ++static int do_connect_fail(mpd_Connection * connection, const struct sockaddr *serv_addr, int addrlen) ++{ ++ int iMode = 1; /* 0 = blocking, else non-blocking */ ++ ioctlsocket(connection->sock, FIONBIO, (u_long FAR *) & iMode); ++ return (connect(connection->sock, serv_addr, addrlen) == SOCKET_ERROR && WSAGetLastError() != WSAEWOULDBLOCK); ++} ++#else /* !WIN32 (sane operating systems) */ ++static int do_connect_fail(mpd_Connection * connection, const struct sockaddr *serv_addr, int addrlen) ++{ ++ int flags = fcntl(connection->sock, F_GETFL, 0); ++ fcntl(connection->sock, F_SETFL, flags | O_NONBLOCK); ++ return (connect(connection->sock, serv_addr, addrlen) < 0 && errno != EINPROGRESS); ++} ++#endif /* !WIN32 */ ++ ++#ifdef MPD_HAVE_GAI ++static int mpd_connect(mpd_Connection * connection, const char *host, int port, float timeout) ++{ ++ int error; ++ char service[INTLEN + 1]; ++ struct addrinfo hints; ++ struct addrinfo *res = NULL; ++ struct addrinfo *addrinfo = NULL; ++ ++ /** ++ * Setup hints ++ */ ++ hints.ai_flags = AI_ADDRCONFIG; ++ hints.ai_family = PF_UNSPEC; ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_protocol = IPPROTO_TCP; ++ hints.ai_addrlen = 0; ++ hints.ai_addr = NULL; ++ hints.ai_canonname = NULL; ++ hints.ai_next = NULL; ++ ++ snprintf(service, sizeof(service), "%i", port); ++ ++ error = getaddrinfo(host, service, &hints, &addrinfo); ++ ++ if (error) { ++ snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "host \"%s\" not found: %s", host, gai_strerror(error)); ++ connection->error = MPD_ERROR_UNKHOST; ++ return -1; ++ } ++ ++ for (res = addrinfo; res; res = res->ai_next) { ++ /* create socket */ ++ connection->sock = socket(res->ai_family, SOCK_STREAM, res->ai_protocol); ++ if (connection->sock < 0) { ++ snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "problems creating socket: %s", strerror(errno)); ++ connection->error = MPD_ERROR_SYSTEM; ++ freeaddrinfo(addrinfo); ++ return -1; ++ } ++ ++ mpd_setConnectionTimeout(connection, timeout); ++ ++ /* connect stuff */ ++ if (do_connect_fail(connection, res->ai_addr, res->ai_addrlen)) { ++ /* try the next address family */ ++ closesocket(connection->sock); ++ connection->sock = -1; ++ continue; ++ } ++ } ++ ++ freeaddrinfo(addrinfo); ++ ++ if (connection->sock < 0) { ++ snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, ++ "problems connecting to \"%s\" on port %i: %s", host, port, strerror(errno)); ++ connection->error = MPD_ERROR_CONNPORT; ++ ++ return -1; ++ } ++ ++ return 0; ++} ++#else /* !MPD_HAVE_GAI */ ++static int mpd_connect(mpd_Connection * connection, const char *host, int port, float timeout) ++{ ++ struct hostent *he; ++ struct sockaddr *dest; ++ int destlen; ++ struct sockaddr_in sin; ++ ++ if (!(he = gethostbyname(host))) { ++ snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "host \"%s\" not found", host); ++ connection->error = MPD_ERROR_UNKHOST; ++ return -1; ++ } ++ ++ memset(&sin, 0, sizeof(struct sockaddr_in)); ++ /*dest.sin_family = he->h_addrtype; */ ++ sin.sin_family = AF_INET; ++ sin.sin_port = htons(port); ++ ++ switch (he->h_addrtype) { ++ case AF_INET: ++ memcpy((char *) &sin.sin_addr.s_addr, (char *) he->h_addr, he->h_length); ++ dest = (struct sockaddr *) &sin; ++ destlen = sizeof(struct sockaddr_in); ++ break; ++ default: ++ strcpy(connection->errorStr, "address type is not IPv4"); ++ connection->error = MPD_ERROR_SYSTEM; ++ return -1; ++ break; ++ } ++ ++ if ((connection->sock = socket(dest->sa_family, SOCK_STREAM, 0)) < 0) { ++ strcpy(connection->errorStr, "problems creating socket"); ++ connection->error = MPD_ERROR_SYSTEM; ++ return -1; ++ } ++ ++ mpd_setConnectionTimeout(connection, timeout); ++ ++ /* connect stuff */ ++ if (do_connect_fail(connection, dest, destlen)) { ++ snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, ++ "problems connecting to \"%s\" on port" " %i", host, port); ++ connection->error = MPD_ERROR_CONNPORT; ++ return -1; ++ } ++ ++ return 0; ++} ++#endif /* !MPD_HAVE_GAI */ ++ ++char *mpdTagItemKeys[MPD_TAG_NUM_OF_ITEM_TYPES] = { ++ "Artist", ++ "Album", ++ "Title", ++ "Track", ++ "Name", ++ "Genre", ++ "Date", ++ "Composer", ++ "Performer", ++ "Comment", ++ "Disc", ++ "Filename", ++ "Any" ++}; ++ ++static char *mpd_sanitizeArg(const char *arg) ++{ ++ size_t i; ++ char *ret; ++ register const char *c; ++ register char *rc; ++ ++ /* instead of counting in that loop above, just ++ * use a bit more memory and half running time ++ */ ++ ret = malloc(strlen(arg) * 2 + 1); ++ ++ c = arg; ++ rc = ret; ++ for (i = strlen(arg) + 1; i != 0; --i) { ++ if (*c == '"' || *c == '\\') ++ *rc++ = '\\'; ++ *(rc++) = *(c++); ++ } ++ ++ return ret; ++} ++ ++static mpd_ReturnElement *mpd_newReturnElement(const char *name, const char *value) ++{ ++ mpd_ReturnElement *ret = malloc(sizeof(mpd_ReturnElement)); ++ ++ ret->name = strdup(name); ++ ret->value = strdup(value); ++ ++ return ret; ++} ++ ++static void mpd_freeReturnElement(mpd_ReturnElement * re) ++{ ++ free(re->name); ++ free(re->value); ++ free(re); ++} ++ ++void mpd_setConnectionTimeout(mpd_Connection * connection, float timeout) ++{ ++ connection->timeout.tv_sec = (int) timeout; ++ connection->timeout.tv_usec = (int) (timeout * 1e6 - connection->timeout.tv_sec * 1000000 + 0.5); ++} ++ ++static int mpd_parseWelcome(mpd_Connection * connection, const char *host, int port, char *rt, char *output) ++{ ++ char *tmp; ++ char *test; ++ int i; ++ ++ if (strncmp(output, MPD_WELCOME_MESSAGE, strlen(MPD_WELCOME_MESSAGE))) { ++ snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, ++ "mpd not running on port %i on host \"%s\"", port, host); ++ connection->error = MPD_ERROR_NOTMPD; ++ return 1; ++ } ++ ++ tmp = &output[strlen(MPD_WELCOME_MESSAGE)]; ++ ++ for (i = 0; i < 3; i++) { ++ if (tmp) ++ connection->version[i] = strtol(tmp, &test, 10); ++ ++ if (!tmp || (test[0] != '.' && test[0] != '\0')) { ++ snprintf(connection->errorStr, ++ MPD_ERRORSTR_MAX_LENGTH, ++ "error parsing version number at " "\"%s\"", &output[strlen(MPD_WELCOME_MESSAGE)]); ++ connection->error = MPD_ERROR_NOTMPD; ++ return 1; ++ } ++ tmp = ++test; ++ } ++ ++ return 0; ++} ++ ++mpd_Connection *mpd_newConnection(const char *host, int port, float timeout) ++{ ++ int err; ++ char *rt; ++ char *output = NULL; ++ mpd_Connection *connection = malloc(sizeof(mpd_Connection)); ++ struct timeval tv; ++ fd_set fds; ++ strcpy(connection->buffer, ""); ++ connection->buflen = 0; ++ connection->bufstart = 0; ++ strcpy(connection->errorStr, ""); ++ connection->error = 0; ++ connection->doneProcessing = 0; ++ connection->commandList = 0; ++ connection->listOks = 0; ++ connection->doneListOk = 0; ++ connection->returnElement = NULL; ++ connection->request = NULL; ++ ++ if (winsock_dll_error(connection)) ++ return connection; ++ ++ if (mpd_connect(connection, host, port, timeout) < 0) ++ return connection; ++ ++ while (!(rt = strstr(connection->buffer, "\n"))) { ++ tv.tv_sec = connection->timeout.tv_sec; ++ tv.tv_usec = connection->timeout.tv_usec; ++ FD_ZERO(&fds); ++ FD_SET(connection->sock, &fds); ++ if ((err = select(connection->sock + 1, &fds, NULL, NULL, &tv)) == 1) { ++ int readed; ++ readed = recv(connection->sock, ++ &(connection->buffer[connection->buflen]), MPD_BUFFER_MAX_LENGTH - connection->buflen, 0); ++ if (readed <= 0) { ++ snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, ++ "problems getting a response from" " \"%s\" on port %i : %s", host, port, strerror(errno)); ++ connection->error = MPD_ERROR_NORESPONSE; ++ return connection; ++ } ++ connection->buflen += readed; ++ connection->buffer[connection->buflen] = '\0'; ++ } else if (err < 0) { ++ if (SELECT_ERRNO_IGNORE) ++ continue; ++ snprintf(connection->errorStr, ++ MPD_ERRORSTR_MAX_LENGTH, "problems connecting to \"%s\" on port" " %i", host, port); ++ connection->error = MPD_ERROR_CONNPORT; ++ return connection; ++ } else { ++ snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, ++ "timeout in attempting to get a response from" " \"%s\" on port %i", host, port); ++ connection->error = MPD_ERROR_NORESPONSE; ++ return connection; ++ } ++ } ++ ++ *rt = '\0'; ++ output = strdup(connection->buffer); ++ strcpy(connection->buffer, rt + 1); ++ connection->buflen = strlen(connection->buffer); ++ ++ if (mpd_parseWelcome(connection, host, port, rt, output) == 0) ++ connection->doneProcessing = 1; ++ ++ free(output); ++ ++ return connection; ++} ++ ++void mpd_clearError(mpd_Connection * connection) ++{ ++ connection->error = 0; ++ connection->errorStr[0] = '\0'; ++} ++ ++void mpd_closeConnection(mpd_Connection * connection) ++{ ++ closesocket(connection->sock); ++ if (connection->returnElement) ++ free(connection->returnElement); ++ if (connection->request) ++ free(connection->request); ++ free(connection); ++ WSACleanup(); ++} ++ ++static void mpd_executeCommand(mpd_Connection * connection, char *command) ++{ ++ int ret; ++ struct timeval tv; ++ fd_set fds; ++ char *commandPtr = command; ++ int commandLen = strlen(command); ++ ++ if (!connection->doneProcessing && !connection->commandList) { ++ strcpy(connection->errorStr, "not done processing current command"); ++ connection->error = 1; ++ return; ++ } ++ ++ mpd_clearError(connection); ++ ++ FD_ZERO(&fds); ++ FD_SET(connection->sock, &fds); ++ tv.tv_sec = connection->timeout.tv_sec; ++ tv.tv_usec = connection->timeout.tv_usec; ++ ++ while ((ret = select(connection->sock + 1, NULL, &fds, NULL, &tv) == 1) || (ret == -1 && SELECT_ERRNO_IGNORE)) { ++ ret = send(connection->sock, commandPtr, commandLen, MSG_DONTWAIT); ++ if (ret <= 0) { ++ if (SENDRECV_ERRNO_IGNORE) ++ continue; ++ snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "problems giving command \"%s\"", command); ++ connection->error = MPD_ERROR_SENDING; ++ return; ++ } else { ++ commandPtr += ret; ++ commandLen -= ret; ++ } ++ ++ if (commandLen <= 0) ++ break; ++ } ++ ++ if (commandLen > 0) { ++ perror(""); ++ snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "timeout sending command \"%s\"", command); ++ connection->error = MPD_ERROR_TIMEOUT; ++ return; ++ } ++ ++ if (!connection->commandList) ++ connection->doneProcessing = 0; ++ else if (connection->commandList == COMMAND_LIST_OK) { ++ connection->listOks++; ++ } ++} ++ ++static void mpd_getNextReturnElement(mpd_Connection * connection) ++{ ++ char *output = NULL; ++ char *rt = NULL; ++ char *name = NULL; ++ char *value = NULL; ++ fd_set fds; ++ struct timeval tv; ++ char *tok = NULL; ++ int readed; ++ char *bufferCheck = NULL; ++ int err; ++ int pos; ++ ++ if (connection->returnElement) ++ mpd_freeReturnElement(connection->returnElement); ++ connection->returnElement = NULL; ++ ++ if (connection->doneProcessing || (connection->listOks && connection->doneListOk)) { ++ strcpy(connection->errorStr, "already done processing current command"); ++ connection->error = 1; ++ return; ++ } ++ ++ bufferCheck = connection->buffer + connection->bufstart; ++ while (connection->bufstart >= connection->buflen || !(rt = strchr(bufferCheck, '\n'))) { ++ if (connection->buflen >= MPD_BUFFER_MAX_LENGTH) { ++ memmove(connection->buffer, ++ connection->buffer + connection->bufstart, connection->buflen - connection->bufstart + 1); ++ connection->buflen -= connection->bufstart; ++ connection->bufstart = 0; ++ } ++ if (connection->buflen >= MPD_BUFFER_MAX_LENGTH) { ++ strcpy(connection->errorStr, "buffer overrun"); ++ connection->error = MPD_ERROR_BUFFEROVERRUN; ++ connection->doneProcessing = 1; ++ connection->doneListOk = 0; ++ return; ++ } ++ bufferCheck = connection->buffer + connection->buflen; ++ tv.tv_sec = connection->timeout.tv_sec; ++ tv.tv_usec = connection->timeout.tv_usec; ++ FD_ZERO(&fds); ++ FD_SET(connection->sock, &fds); ++ if ((err = select(connection->sock + 1, &fds, NULL, NULL, &tv) == 1)) { ++ readed = recv(connection->sock, ++ connection->buffer + connection->buflen, ++ MPD_BUFFER_MAX_LENGTH - connection->buflen, MSG_DONTWAIT); ++ if (readed < 0 && SENDRECV_ERRNO_IGNORE) { ++ continue; ++ } ++ if (readed <= 0) { ++ strcpy(connection->errorStr, "connection" " closed"); ++ connection->error = MPD_ERROR_CONNCLOSED; ++ connection->doneProcessing = 1; ++ connection->doneListOk = 0; ++ return; ++ } ++ connection->buflen += readed; ++ connection->buffer[connection->buflen] = '\0'; ++ } else if (err < 0 && SELECT_ERRNO_IGNORE) ++ continue; ++ else { ++ strcpy(connection->errorStr, "connection timeout"); ++ connection->error = MPD_ERROR_TIMEOUT; ++ connection->doneProcessing = 1; ++ connection->doneListOk = 0; ++ return; ++ } ++ } ++ ++ *rt = '\0'; ++ output = connection->buffer + connection->bufstart; ++ connection->bufstart = rt - connection->buffer + 1; ++ ++ if (strcmp(output, "OK") == 0) { ++ if (connection->listOks > 0) { ++ strcpy(connection->errorStr, "expected more list_OK's"); ++ connection->error = 1; ++ } ++ connection->listOks = 0; ++ connection->doneProcessing = 1; ++ connection->doneListOk = 0; ++ return; ++ } ++ ++ if (strcmp(output, "list_OK") == 0) { ++ if (!connection->listOks) { ++ strcpy(connection->errorStr, "got an unexpected list_OK"); ++ connection->error = 1; ++ } else { ++ connection->doneListOk = 1; ++ connection->listOks--; ++ } ++ return; ++ } ++ ++ if (strncmp(output, "ACK", strlen("ACK")) == 0) { ++ char *test; ++ char *needle; ++ int val; ++ ++ strcpy(connection->errorStr, output); ++ connection->error = MPD_ERROR_ACK; ++ connection->errorCode = MPD_ACK_ERROR_UNK; ++ connection->errorAt = MPD_ERROR_AT_UNK; ++ connection->doneProcessing = 1; ++ connection->doneListOk = 0; ++ ++ needle = strchr(output, '['); ++ if (!needle) ++ return; ++ val = strtol(needle + 1, &test, 10); ++ if (*test != '@') ++ return; ++ connection->errorCode = val; ++ val = strtol(test + 1, &test, 10); ++ if (*test != ']') ++ return; ++ connection->errorAt = val; ++ return; ++ } ++ ++ tok = strchr(output, ':'); ++ if (!tok) ++ return; ++ pos = tok - output; ++ value = ++tok; ++ name = output; ++ name[pos] = '\0'; ++ ++ if (value[0] == ' ') { ++ connection->returnElement = mpd_newReturnElement(name, &(value[1])); ++ } else { ++ snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "error parsing: %s:%s", name, value); ++ connection->error = 1; ++ } ++} ++ ++void mpd_finishCommand(mpd_Connection * connection) ++{ ++ while (!connection->doneProcessing) { ++ if (connection->doneListOk) ++ connection->doneListOk = 0; ++ mpd_getNextReturnElement(connection); ++ } ++} ++ ++static void mpd_finishListOkCommand(mpd_Connection * connection) ++{ ++ while (!connection->doneProcessing && connection->listOks && !connection->doneListOk) { ++ mpd_getNextReturnElement(connection); ++ } ++} ++ ++int mpd_nextListOkCommand(mpd_Connection * connection) ++{ ++ mpd_finishListOkCommand(connection); ++ if (!connection->doneProcessing) ++ connection->doneListOk = 0; ++ if (connection->listOks == 0 || connection->doneProcessing) ++ return -1; ++ return 0; ++} ++ ++void mpd_sendStatusCommand(mpd_Connection * connection) ++{ ++ mpd_executeCommand(connection, "status\n"); ++} ++ ++mpd_Status *mpd_getStatus(mpd_Connection * connection) ++{ ++ mpd_Status *status; ++ ++ /*mpd_executeCommand(connection,"status\n"); ++ ++ if(connection->error) return NULL; */ ++ ++ if (connection->doneProcessing || (connection->listOks && connection->doneListOk)) { ++ return NULL; ++ } ++ ++ if (!connection->returnElement) ++ mpd_getNextReturnElement(connection); ++ ++ status = malloc(sizeof(mpd_Status)); ++ status->volume = -1; ++ status->repeat = 0; ++ status->random = 0; ++ status->playlist = -1; ++ status->playlistLength = -1; ++ status->state = -1; ++ status->song = 0; ++ status->songid = 0; ++ status->elapsedTime = 0; ++ status->totalTime = 0; ++ status->bitRate = 0; ++ status->sampleRate = 0; ++ status->bits = 0; ++ status->channels = 0; ++ status->crossfade = -1; ++ status->error = NULL; ++ status->updatingDb = 0; ++ ++ if (connection->error) { ++ free(status); ++ return NULL; ++ } ++ while (connection->returnElement) { ++ mpd_ReturnElement *re = connection->returnElement; ++ if (strcmp(re->name, "volume") == 0) { ++ status->volume = atoi(re->value); ++ } else if (strcmp(re->name, "repeat") == 0) { ++ status->repeat = atoi(re->value); ++ } else if (strcmp(re->name, "random") == 0) { ++ status->random = atoi(re->value); ++ } else if (strcmp(re->name, "playlist") == 0) { ++ status->playlist = strtol(re->value, NULL, 10); ++ } else if (strcmp(re->name, "playlistlength") == 0) { ++ status->playlistLength = atoi(re->value); ++ } else if (strcmp(re->name, "bitrate") == 0) { ++ status->bitRate = atoi(re->value); ++ } else if (strcmp(re->name, "state") == 0) { ++ if (strcmp(re->value, "play") == 0) { ++ status->state = MPD_STATUS_STATE_PLAY; ++ } else if (strcmp(re->value, "stop") == 0) { ++ status->state = MPD_STATUS_STATE_STOP; ++ } else if (strcmp(re->value, "pause") == 0) { ++ status->state = MPD_STATUS_STATE_PAUSE; ++ } else { ++ status->state = MPD_STATUS_STATE_UNKNOWN; ++ } ++ } else if (strcmp(re->name, "song") == 0) { ++ status->song = atoi(re->value); ++ } else if (strcmp(re->name, "songid") == 0) { ++ status->songid = atoi(re->value); ++ } else if (strcmp(re->name, "time") == 0) { ++ char *tok = strchr(re->value, ':'); ++ /* the second strchr below is a safety check */ ++ if (tok && (strchr(tok, 0) > (tok + 1))) { ++ /* atoi stops at the first non-[0-9] char: */ ++ status->elapsedTime = atoi(re->value); ++ status->totalTime = atoi(tok + 1); ++ } ++ } else if (strcmp(re->name, "error") == 0) { ++ status->error = strdup(re->value); ++ } else if (strcmp(re->name, "xfade") == 0) { ++ status->crossfade = atoi(re->value); ++ } else if (strcmp(re->name, "updating_db") == 0) { ++ status->updatingDb = atoi(re->value); ++ } else if (strcmp(re->name, "audio") == 0) { ++ char *tok = strchr(re->value, ':'); ++ if (tok && (strchr(tok, 0) > (tok + 1))) { ++ status->sampleRate = atoi(re->value); ++ status->bits = atoi(++tok); ++ tok = strchr(tok, ':'); ++ if (tok && (strchr(tok, 0) > (tok + 1))) ++ status->channels = atoi(tok + 1); ++ } ++ } ++ ++ mpd_getNextReturnElement(connection); ++ if (connection->error) { ++ free(status); ++ return NULL; ++ } ++ } ++ ++ if (connection->error) { ++ free(status); ++ return NULL; ++ } else if (status->state < 0) { ++ strcpy(connection->errorStr, "state not found"); ++ connection->error = 1; ++ free(status); ++ return NULL; ++ } ++ ++ return status; ++} ++ ++void mpd_freeStatus(mpd_Status * status) ++{ ++ if (status->error) ++ free(status->error); ++ free(status); ++} ++ ++void mpd_sendStatsCommand(mpd_Connection * connection) ++{ ++ mpd_executeCommand(connection, "stats\n"); ++} ++ ++mpd_Stats *mpd_getStats(mpd_Connection * connection) ++{ ++ mpd_Stats *stats; ++ ++ /*mpd_executeCommand(connection,"stats\n"); ++ ++ if(connection->error) return NULL; */ ++ ++ if (connection->doneProcessing || (connection->listOks && connection->doneListOk)) { ++ return NULL; ++ } ++ ++ if (!connection->returnElement) ++ mpd_getNextReturnElement(connection); ++ ++ stats = malloc(sizeof(mpd_Stats)); ++ stats->numberOfArtists = 0; ++ stats->numberOfAlbums = 0; ++ stats->numberOfSongs = 0; ++ stats->uptime = 0; ++ stats->dbUpdateTime = 0; ++ stats->playTime = 0; ++ stats->dbPlayTime = 0; ++ ++ if (connection->error) { ++ free(stats); ++ return NULL; ++ } ++ while (connection->returnElement) { ++ mpd_ReturnElement *re = connection->returnElement; ++ if (strcmp(re->name, "artists") == 0) { ++ stats->numberOfArtists = atoi(re->value); ++ } else if (strcmp(re->name, "albums") == 0) { ++ stats->numberOfAlbums = atoi(re->value); ++ } else if (strcmp(re->name, "songs") == 0) { ++ stats->numberOfSongs = atoi(re->value); ++ } else if (strcmp(re->name, "uptime") == 0) { ++ stats->uptime = strtol(re->value, NULL, 10); ++ } else if (strcmp(re->name, "db_update") == 0) { ++ stats->dbUpdateTime = strtol(re->value, NULL, 10); ++ } else if (strcmp(re->name, "playtime") == 0) { ++ stats->playTime = strtol(re->value, NULL, 10); ++ } else if (strcmp(re->name, "db_playtime") == 0) { ++ stats->dbPlayTime = strtol(re->value, NULL, 10); ++ } ++ ++ mpd_getNextReturnElement(connection); ++ if (connection->error) { ++ free(stats); ++ return NULL; ++ } ++ } ++ ++ if (connection->error) { ++ free(stats); ++ return NULL; ++ } ++ ++ return stats; ++} ++ ++void mpd_freeStats(mpd_Stats * stats) ++{ ++ free(stats); ++} ++ ++mpd_SearchStats *mpd_getSearchStats(mpd_Connection * connection) ++{ ++ mpd_SearchStats *stats; ++ mpd_ReturnElement *re; ++ ++ if (connection->doneProcessing || (connection->listOks && connection->doneListOk)) { ++ return NULL; ++ } ++ ++ if (!connection->returnElement) ++ mpd_getNextReturnElement(connection); ++ ++ if (connection->error) ++ return NULL; ++ ++ stats = malloc(sizeof(mpd_SearchStats)); ++ stats->numberOfSongs = 0; ++ stats->playTime = 0; ++ ++ while (connection->returnElement) { ++ re = connection->returnElement; ++ ++ if (strcmp(re->name, "songs") == 0) { ++ stats->numberOfSongs = atoi(re->value); ++ } else if (strcmp(re->name, "playtime") == 0) { ++ stats->playTime = strtol(re->value, NULL, 10); ++ } ++ ++ mpd_getNextReturnElement(connection); ++ if (connection->error) { ++ free(stats); ++ return NULL; ++ } ++ } ++ ++ if (connection->error) { ++ free(stats); ++ return NULL; ++ } ++ ++ return stats; ++} ++ ++void mpd_freeSearchStats(mpd_SearchStats * stats) ++{ ++ free(stats); ++} ++ ++static void mpd_initSong(mpd_Song * song) ++{ ++ song->file = NULL; ++ song->artist = NULL; ++ song->album = NULL; ++ song->track = NULL; ++ song->title = NULL; ++ song->name = NULL; ++ song->date = NULL; ++ /* added by Qball */ ++ song->genre = NULL; ++ song->composer = NULL; ++ song->performer = NULL; ++ song->disc = NULL; ++ song->comment = NULL; ++ ++ song->time = MPD_SONG_NO_TIME; ++ song->pos = MPD_SONG_NO_NUM; ++ song->id = MPD_SONG_NO_ID; ++} ++ ++static void mpd_finishSong(mpd_Song * song) ++{ ++ if (song->file) ++ free(song->file); ++ if (song->artist) ++ free(song->artist); ++ if (song->album) ++ free(song->album); ++ if (song->title) ++ free(song->title); ++ if (song->track) ++ free(song->track); ++ if (song->name) ++ free(song->name); ++ if (song->date) ++ free(song->date); ++ if (song->genre) ++ free(song->genre); ++ if (song->composer) ++ free(song->composer); ++ if (song->disc) ++ free(song->disc); ++ if (song->comment) ++ free(song->comment); ++} ++ ++mpd_Song *mpd_newSong(void) ++{ ++ mpd_Song *ret = malloc(sizeof(mpd_Song)); ++ ++ mpd_initSong(ret); ++ ++ return ret; ++} ++ ++void mpd_freeSong(mpd_Song * song) ++{ ++ mpd_finishSong(song); ++ free(song); ++} ++ ++mpd_Song *mpd_songDup(mpd_Song * song) ++{ ++ mpd_Song *ret = mpd_newSong(); ++ ++ if (song->file) ++ ret->file = strdup(song->file); ++ if (song->artist) ++ ret->artist = strdup(song->artist); ++ if (song->album) ++ ret->album = strdup(song->album); ++ if (song->title) ++ ret->title = strdup(song->title); ++ if (song->track) ++ ret->track = strdup(song->track); ++ if (song->name) ++ ret->name = strdup(song->name); ++ if (song->date) ++ ret->date = strdup(song->date); ++ if (song->genre) ++ ret->genre = strdup(song->genre); ++ if (song->composer) ++ ret->composer = strdup(song->composer); ++ if (song->disc) ++ ret->disc = strdup(song->disc); ++ if (song->comment) ++ ret->comment = strdup(song->comment); ++ ret->time = song->time; ++ ret->pos = song->pos; ++ ret->id = song->id; ++ ++ return ret; ++} ++ ++static void mpd_initDirectory(mpd_Directory * directory) ++{ ++ directory->path = NULL; ++} ++ ++static void mpd_finishDirectory(mpd_Directory * directory) ++{ ++ if (directory->path) ++ free(directory->path); ++} ++ ++mpd_Directory *mpd_newDirectory(void) ++{ ++ mpd_Directory *directory = malloc(sizeof(mpd_Directory));; ++ ++ mpd_initDirectory(directory); ++ ++ return directory; ++} ++ ++void mpd_freeDirectory(mpd_Directory * directory) ++{ ++ mpd_finishDirectory(directory); ++ ++ free(directory); ++} ++ ++mpd_Directory *mpd_directoryDup(mpd_Directory * directory) ++{ ++ mpd_Directory *ret = mpd_newDirectory(); ++ ++ if (directory->path) ++ ret->path = strdup(directory->path); ++ ++ return ret; ++} ++ ++static void mpd_initPlaylistFile(mpd_PlaylistFile * playlist) ++{ ++ playlist->path = NULL; ++} ++ ++static void mpd_finishPlaylistFile(mpd_PlaylistFile * playlist) ++{ ++ if (playlist->path) ++ free(playlist->path); ++} ++ ++mpd_PlaylistFile *mpd_newPlaylistFile(void) ++{ ++ mpd_PlaylistFile *playlist = malloc(sizeof(mpd_PlaylistFile)); ++ ++ mpd_initPlaylistFile(playlist); ++ ++ return playlist; ++} ++ ++void mpd_freePlaylistFile(mpd_PlaylistFile * playlist) ++{ ++ mpd_finishPlaylistFile(playlist); ++ free(playlist); ++} ++ ++mpd_PlaylistFile *mpd_playlistFileDup(mpd_PlaylistFile * playlist) ++{ ++ mpd_PlaylistFile *ret = mpd_newPlaylistFile(); ++ ++ if (playlist->path) ++ ret->path = strdup(playlist->path); ++ ++ return ret; ++} ++ ++static void mpd_initInfoEntity(mpd_InfoEntity * entity) ++{ ++ entity->info.directory = NULL; ++} ++ ++static void mpd_finishInfoEntity(mpd_InfoEntity * entity) ++{ ++ if (entity->info.directory) { ++ if (entity->type == MPD_INFO_ENTITY_TYPE_DIRECTORY) { ++ mpd_freeDirectory(entity->info.directory); ++ } else if (entity->type == MPD_INFO_ENTITY_TYPE_SONG) { ++ mpd_freeSong(entity->info.song); ++ } else if (entity->type == MPD_INFO_ENTITY_TYPE_PLAYLISTFILE) { ++ mpd_freePlaylistFile(entity->info.playlistFile); ++ } ++ } ++} ++ ++mpd_InfoEntity *mpd_newInfoEntity(void) ++{ ++ mpd_InfoEntity *entity = malloc(sizeof(mpd_InfoEntity)); ++ ++ mpd_initInfoEntity(entity); ++ ++ return entity; ++} ++ ++void mpd_freeInfoEntity(mpd_InfoEntity * entity) ++{ ++ mpd_finishInfoEntity(entity); ++ free(entity); ++} ++ ++static void mpd_sendInfoCommand(mpd_Connection * connection, char *command) ++{ ++ mpd_executeCommand(connection, command); ++} ++ ++mpd_InfoEntity *mpd_getNextInfoEntity(mpd_Connection * connection) ++{ ++ mpd_InfoEntity *entity = NULL; ++ ++ if (connection->doneProcessing || (connection->listOks && connection->doneListOk)) { ++ return NULL; ++ } ++ ++ if (!connection->returnElement) ++ mpd_getNextReturnElement(connection); ++ ++ if (connection->returnElement) { ++ if (strcmp(connection->returnElement->name, "file") == 0) { ++ entity = mpd_newInfoEntity(); ++ entity->type = MPD_INFO_ENTITY_TYPE_SONG; ++ entity->info.song = mpd_newSong(); ++ entity->info.song->file = strdup(connection->returnElement->value); ++ } else if (strcmp(connection->returnElement->name, "directory") == 0) { ++ entity = mpd_newInfoEntity(); ++ entity->type = MPD_INFO_ENTITY_TYPE_DIRECTORY; ++ entity->info.directory = mpd_newDirectory(); ++ entity->info.directory->path = strdup(connection->returnElement->value); ++ } else if (strcmp(connection->returnElement->name, "playlist") == 0) { ++ entity = mpd_newInfoEntity(); ++ entity->type = MPD_INFO_ENTITY_TYPE_PLAYLISTFILE; ++ entity->info.playlistFile = mpd_newPlaylistFile(); ++ entity->info.playlistFile->path = strdup(connection->returnElement->value); ++ } else if (strcmp(connection->returnElement->name, "cpos") == 0) { ++ entity = mpd_newInfoEntity(); ++ entity->type = MPD_INFO_ENTITY_TYPE_SONG; ++ entity->info.song = mpd_newSong(); ++ entity->info.song->pos = atoi(connection->returnElement->value); ++ } else { ++ connection->error = 1; ++ strcpy(connection->errorStr, "problem parsing song info"); ++ return NULL; ++ } ++ } else ++ return NULL; ++ ++ mpd_getNextReturnElement(connection); ++ while (connection->returnElement) { ++ mpd_ReturnElement *re = connection->returnElement; ++ ++ if (strcmp(re->name, "file") == 0) ++ return entity; ++ else if (strcmp(re->name, "directory") == 0) ++ return entity; ++ else if (strcmp(re->name, "playlist") == 0) ++ return entity; ++ else if (strcmp(re->name, "cpos") == 0) ++ return entity; ++ ++ if (entity->type == MPD_INFO_ENTITY_TYPE_SONG && strlen(re->value)) { ++ if (!entity->info.song->artist && strcmp(re->name, "Artist") == 0) { ++ entity->info.song->artist = strdup(re->value); ++ } else if (!entity->info.song->album && strcmp(re->name, "Album") == 0) { ++ entity->info.song->album = strdup(re->value); ++ } else if (!entity->info.song->title && strcmp(re->name, "Title") == 0) { ++ entity->info.song->title = strdup(re->value); ++ } else if (!entity->info.song->track && strcmp(re->name, "Track") == 0) { ++ entity->info.song->track = strdup(re->value); ++ } else if (!entity->info.song->name && strcmp(re->name, "Name") == 0) { ++ entity->info.song->name = strdup(re->value); ++ } else if (entity->info.song->time == MPD_SONG_NO_TIME && strcmp(re->name, "Time") == 0) { ++ entity->info.song->time = atoi(re->value); ++ } else if (entity->info.song->pos == MPD_SONG_NO_NUM && strcmp(re->name, "Pos") == 0) { ++ entity->info.song->pos = atoi(re->value); ++ } else if (entity->info.song->id == MPD_SONG_NO_ID && strcmp(re->name, "Id") == 0) { ++ entity->info.song->id = atoi(re->value); ++ } else if (!entity->info.song->date && strcmp(re->name, "Date") == 0) { ++ entity->info.song->date = strdup(re->value); ++ } else if (!entity->info.song->genre && strcmp(re->name, "Genre") == 0) { ++ entity->info.song->genre = strdup(re->value); ++ } else if (!entity->info.song->composer && strcmp(re->name, "Composer") == 0) { ++ entity->info.song->composer = strdup(re->value); ++ } else if (!entity->info.song->performer && strcmp(re->name, "Performer") == 0) { ++ entity->info.song->performer = strdup(re->value); ++ } else if (!entity->info.song->disc && strcmp(re->name, "Disc") == 0) { ++ entity->info.song->disc = strdup(re->value); ++ } else if (!entity->info.song->comment && strcmp(re->name, "Comment") == 0) { ++ entity->info.song->comment = strdup(re->value); ++ } ++ } else if (entity->type == MPD_INFO_ENTITY_TYPE_DIRECTORY) { ++ } else if (entity->type == MPD_INFO_ENTITY_TYPE_PLAYLISTFILE) { ++ } ++ ++ mpd_getNextReturnElement(connection); ++ } ++ ++ return entity; ++} ++ ++static char *mpd_getNextReturnElementNamed(mpd_Connection * connection, const char *name) ++{ ++ if (connection->doneProcessing || (connection->listOks && connection->doneListOk)) { ++ return NULL; ++ } ++ ++ mpd_getNextReturnElement(connection); ++ while (connection->returnElement) { ++ mpd_ReturnElement *re = connection->returnElement; ++ ++ if (strcmp(re->name, name) == 0) ++ return strdup(re->value); ++ mpd_getNextReturnElement(connection); ++ } ++ ++ return NULL; ++} ++ ++char *mpd_getNextTag(mpd_Connection * connection, int type) ++{ ++ if (type < 0 || type >= MPD_TAG_NUM_OF_ITEM_TYPES || type == MPD_TAG_ITEM_ANY) ++ return NULL; ++ if (type == MPD_TAG_ITEM_FILENAME) ++ return mpd_getNextReturnElementNamed(connection, "file"); ++ return mpd_getNextReturnElementNamed(connection, mpdTagItemKeys[type]); ++} ++ ++char *mpd_getNextArtist(mpd_Connection * connection) ++{ ++ return mpd_getNextReturnElementNamed(connection, "Artist"); ++} ++ ++char *mpd_getNextAlbum(mpd_Connection * connection) ++{ ++ return mpd_getNextReturnElementNamed(connection, "Album"); ++} ++ ++void mpd_sendPlaylistInfoCommand(mpd_Connection * connection, int songPos) ++{ ++ int len = strlen("playlistinfo") + 2 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "playlistinfo \"%i\"\n", songPos); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendPlaylistIdCommand(mpd_Connection * connection, int id) ++{ ++ int len = strlen("playlistid") + 2 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "playlistid \"%i\"\n", id); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendPlChangesCommand(mpd_Connection * connection, long long playlist) ++{ ++ int len = strlen("plchanges") + 2 + LONGLONGLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "plchanges \"%lld\"\n", playlist); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendPlChangesPosIdCommand(mpd_Connection * connection, long long playlist) ++{ ++ int len = strlen("plchangesposid") + 2 + LONGLONGLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "plchangesposid \"%lld\"\n", playlist); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendListallCommand(mpd_Connection * connection, const char *dir) ++{ ++ char *sDir = mpd_sanitizeArg(dir); ++ int len = strlen("listall") + 2 + strlen(sDir) + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "listall \"%s\"\n", sDir); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++ free(sDir); ++} ++ ++void mpd_sendListallInfoCommand(mpd_Connection * connection, const char *dir) ++{ ++ char *sDir = mpd_sanitizeArg(dir); ++ int len = strlen("listallinfo") + 2 + strlen(sDir) + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "listallinfo \"%s\"\n", sDir); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++ free(sDir); ++} ++ ++void mpd_sendLsInfoCommand(mpd_Connection * connection, const char *dir) ++{ ++ char *sDir = mpd_sanitizeArg(dir); ++ int len = strlen("lsinfo") + 2 + strlen(sDir) + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "lsinfo \"%s\"\n", sDir); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++ free(sDir); ++} ++ ++void mpd_sendCurrentSongCommand(mpd_Connection * connection) ++{ ++ mpd_executeCommand(connection, "currentsong\n"); ++} ++ ++void mpd_sendSearchCommand(mpd_Connection * connection, int table, const char *str) ++{ ++ mpd_startSearch(connection, 0); ++ mpd_addConstraintSearch(connection, table, str); ++ mpd_commitSearch(connection); ++} ++ ++void mpd_sendFindCommand(mpd_Connection * connection, int table, const char *str) ++{ ++ mpd_startSearch(connection, 1); ++ mpd_addConstraintSearch(connection, table, str); ++ mpd_commitSearch(connection); ++} ++ ++void mpd_sendListCommand(mpd_Connection * connection, int table, const char *arg1) ++{ ++ char st[10]; ++ int len; ++ char *string; ++ if (table == MPD_TABLE_ARTIST) ++ strcpy(st, "artist"); ++ else if (table == MPD_TABLE_ALBUM) ++ strcpy(st, "album"); ++ else { ++ connection->error = 1; ++ strcpy(connection->errorStr, "unknown table for list"); ++ return; ++ } ++ if (arg1) { ++ char *sanitArg1 = mpd_sanitizeArg(arg1); ++ len = strlen("list") + 1 + strlen(sanitArg1) + 2 + strlen(st) + 3; ++ string = malloc(len); ++ snprintf(string, len, "list %s \"%s\"\n", st, sanitArg1); ++ free(sanitArg1); ++ } else { ++ len = strlen("list") + 1 + strlen(st) + 2; ++ string = malloc(len); ++ snprintf(string, len, "list %s\n", st); ++ } ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendAddCommand(mpd_Connection * connection, const char *file) ++{ ++ char *sFile = mpd_sanitizeArg(file); ++ int len = strlen("add") + 2 + strlen(sFile) + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "add \"%s\"\n", sFile); ++ mpd_executeCommand(connection, string); ++ free(string); ++ free(sFile); ++} ++ ++int mpd_sendAddIdCommand(mpd_Connection * connection, const char *file) ++{ ++ int retval = -1; ++ char *sFile = mpd_sanitizeArg(file); ++ int len = strlen("addid") + 2 + strlen(sFile) + 3; ++ char *string = malloc(len); ++ ++ snprintf(string, len, "addid \"%s\"\n", sFile); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++ free(sFile); ++ ++ string = mpd_getNextReturnElementNamed(connection, "Id"); ++ if (string) { ++ retval = atoi(string); ++ free(string); ++ } ++ ++ return retval; ++} ++ ++void mpd_sendDeleteCommand(mpd_Connection * connection, int songPos) ++{ ++ int len = strlen("delete") + 2 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "delete \"%i\"\n", songPos); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendDeleteIdCommand(mpd_Connection * connection, int id) ++{ ++ int len = strlen("deleteid") + 2 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "deleteid \"%i\"\n", id); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendSaveCommand(mpd_Connection * connection, const char *name) ++{ ++ char *sName = mpd_sanitizeArg(name); ++ int len = strlen("save") + 2 + strlen(sName) + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "save \"%s\"\n", sName); ++ mpd_executeCommand(connection, string); ++ free(string); ++ free(sName); ++} ++ ++void mpd_sendLoadCommand(mpd_Connection * connection, const char *name) ++{ ++ char *sName = mpd_sanitizeArg(name); ++ int len = strlen("load") + 2 + strlen(sName) + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "load \"%s\"\n", sName); ++ mpd_executeCommand(connection, string); ++ free(string); ++ free(sName); ++} ++ ++void mpd_sendRmCommand(mpd_Connection * connection, const char *name) ++{ ++ char *sName = mpd_sanitizeArg(name); ++ int len = strlen("rm") + 2 + strlen(sName) + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "rm \"%s\"\n", sName); ++ mpd_executeCommand(connection, string); ++ free(string); ++ free(sName); ++} ++ ++void mpd_sendRenameCommand(mpd_Connection * connection, const char *from, const char *to) ++{ ++ char *sFrom = mpd_sanitizeArg(from); ++ char *sTo = mpd_sanitizeArg(to); ++ int len = strlen("rename") + 2 + strlen(sFrom) + 3 + strlen(sTo) + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "rename \"%s\" \"%s\"\n", sFrom, sTo); ++ mpd_executeCommand(connection, string); ++ free(string); ++ free(sFrom); ++ free(sTo); ++} ++ ++void mpd_sendShuffleCommand(mpd_Connection * connection) ++{ ++ mpd_executeCommand(connection, "shuffle\n"); ++} ++ ++void mpd_sendClearCommand(mpd_Connection * connection) ++{ ++ mpd_executeCommand(connection, "clear\n"); ++} ++ ++void mpd_sendPlayCommand(mpd_Connection * connection, int songPos) ++{ ++ int len = strlen("play") + 2 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "play \"%i\"\n", songPos); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendPlayIdCommand(mpd_Connection * connection, int id) ++{ ++ int len = strlen("playid") + 2 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "playid \"%i\"\n", id); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendStopCommand(mpd_Connection * connection) ++{ ++ mpd_executeCommand(connection, "stop\n"); ++} ++ ++void mpd_sendPauseCommand(mpd_Connection * connection, int pauseMode) ++{ ++ int len = strlen("pause") + 2 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "pause \"%i\"\n", pauseMode); ++ mpd_executeCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendNextCommand(mpd_Connection * connection) ++{ ++ mpd_executeCommand(connection, "next\n"); ++} ++ ++void mpd_sendMoveCommand(mpd_Connection * connection, int from, int to) ++{ ++ int len = strlen("move") + 2 + INTLEN + 3 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "move \"%i\" \"%i\"\n", from, to); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendMoveIdCommand(mpd_Connection * connection, int id, int to) ++{ ++ int len = strlen("moveid") + 2 + INTLEN + 3 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "moveid \"%i\" \"%i\"\n", id, to); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendSwapCommand(mpd_Connection * connection, int song1, int song2) ++{ ++ int len = strlen("swap") + 2 + INTLEN + 3 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "swap \"%i\" \"%i\"\n", song1, song2); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendSwapIdCommand(mpd_Connection * connection, int id1, int id2) ++{ ++ int len = strlen("swapid") + 2 + INTLEN + 3 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "swapid \"%i\" \"%i\"\n", id1, id2); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendSeekCommand(mpd_Connection * connection, int song, int time) ++{ ++ int len = strlen("seek") + 2 + INTLEN + 3 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "seek \"%i\" \"%i\"\n", song, time); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendSeekIdCommand(mpd_Connection * connection, int id, int time) ++{ ++ int len = strlen("seekid") + 2 + INTLEN + 3 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "seekid \"%i\" \"%i\"\n", id, time); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendUpdateCommand(mpd_Connection * connection, char *path) ++{ ++ char *sPath = mpd_sanitizeArg(path); ++ int len = strlen("update") + 2 + strlen(sPath) + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "update \"%s\"\n", sPath); ++ mpd_sendInfoCommand(connection, string); ++ free(string); ++ free(sPath); ++} ++ ++int mpd_getUpdateId(mpd_Connection * connection) ++{ ++ char *jobid; ++ int ret = 0; ++ ++ jobid = mpd_getNextReturnElementNamed(connection, "updating_db"); ++ if (jobid) { ++ ret = atoi(jobid); ++ free(jobid); ++ } ++ ++ return ret; ++} ++ ++void mpd_sendPrevCommand(mpd_Connection * connection) ++{ ++ mpd_executeCommand(connection, "previous\n"); ++} ++ ++void mpd_sendRepeatCommand(mpd_Connection * connection, int repeatMode) ++{ ++ int len = strlen("repeat") + 2 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "repeat \"%i\"\n", repeatMode); ++ mpd_executeCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendRandomCommand(mpd_Connection * connection, int randomMode) ++{ ++ int len = strlen("random") + 2 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "random \"%i\"\n", randomMode); ++ mpd_executeCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendSetvolCommand(mpd_Connection * connection, int volumeChange) ++{ ++ int len = strlen("setvol") + 2 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "setvol \"%i\"\n", volumeChange); ++ mpd_executeCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendVolumeCommand(mpd_Connection * connection, int volumeChange) ++{ ++ int len = strlen("volume") + 2 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "volume \"%i\"\n", volumeChange); ++ mpd_executeCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendCrossfadeCommand(mpd_Connection * connection, int seconds) ++{ ++ int len = strlen("crossfade") + 2 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "crossfade \"%i\"\n", seconds); ++ mpd_executeCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendPasswordCommand(mpd_Connection * connection, const char *pass) ++{ ++ char *sPass = mpd_sanitizeArg(pass); ++ int len = strlen("password") + 2 + strlen(sPass) + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "password \"%s\"\n", sPass); ++ mpd_executeCommand(connection, string); ++ free(string); ++ free(sPass); ++} ++ ++void mpd_sendCommandListBegin(mpd_Connection * connection) ++{ ++ if (connection->commandList) { ++ strcpy(connection->errorStr, "already in command list mode"); ++ connection->error = 1; ++ return; ++ } ++ connection->commandList = COMMAND_LIST; ++ mpd_executeCommand(connection, "command_list_begin\n"); ++} ++ ++void mpd_sendCommandListOkBegin(mpd_Connection * connection) ++{ ++ if (connection->commandList) { ++ strcpy(connection->errorStr, "already in command list mode"); ++ connection->error = 1; ++ return; ++ } ++ connection->commandList = COMMAND_LIST_OK; ++ mpd_executeCommand(connection, "command_list_ok_begin\n"); ++ connection->listOks = 0; ++} ++ ++void mpd_sendCommandListEnd(mpd_Connection * connection) ++{ ++ if (!connection->commandList) { ++ strcpy(connection->errorStr, "not in command list mode"); ++ connection->error = 1; ++ return; ++ } ++ connection->commandList = 0; ++ mpd_executeCommand(connection, "command_list_end\n"); ++} ++ ++void mpd_sendOutputsCommand(mpd_Connection * connection) ++{ ++ mpd_executeCommand(connection, "outputs\n"); ++} ++ ++mpd_OutputEntity *mpd_getNextOutput(mpd_Connection * connection) ++{ ++ mpd_OutputEntity *output = NULL; ++ ++ if (connection->doneProcessing || (connection->listOks && connection->doneListOk)) { ++ return NULL; ++ } ++ ++ if (connection->error) ++ return NULL; ++ ++ output = malloc(sizeof(mpd_OutputEntity)); ++ output->id = -10; ++ output->name = NULL; ++ output->enabled = 0; ++ ++ if (!connection->returnElement) ++ mpd_getNextReturnElement(connection); ++ ++ while (connection->returnElement) { ++ mpd_ReturnElement *re = connection->returnElement; ++ if (strcmp(re->name, "outputid") == 0) { ++ if (output != NULL && output->id >= 0) ++ return output; ++ output->id = atoi(re->value); ++ } else if (strcmp(re->name, "outputname") == 0) { ++ output->name = strdup(re->value); ++ } else if (strcmp(re->name, "outputenabled") == 0) { ++ output->enabled = atoi(re->value); ++ } ++ ++ mpd_getNextReturnElement(connection); ++ if (connection->error) { ++ free(output); ++ return NULL; ++ } ++ ++ } ++ ++ return output; ++} ++ ++void mpd_sendEnableOutputCommand(mpd_Connection * connection, int outputId) ++{ ++ int len = strlen("enableoutput") + 2 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "enableoutput \"%i\"\n", outputId); ++ mpd_executeCommand(connection, string); ++ free(string); ++} ++ ++void mpd_sendDisableOutputCommand(mpd_Connection * connection, int outputId) ++{ ++ int len = strlen("disableoutput") + 2 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "disableoutput \"%i\"\n", outputId); ++ mpd_executeCommand(connection, string); ++ free(string); ++} ++ ++void mpd_freeOutputElement(mpd_OutputEntity * output) ++{ ++ free(output->name); ++ free(output); ++} ++ ++/** ++ * mpd_sendNotCommandsCommand ++ * odd naming, but it gets the not allowed commands ++ */ ++ ++void mpd_sendNotCommandsCommand(mpd_Connection * connection) ++{ ++ mpd_executeCommand(connection, "notcommands\n"); ++} ++ ++/** ++ * mpd_sendCommandsCommand ++ * odd naming, but it gets the allowed commands ++ */ ++void mpd_sendCommandsCommand(mpd_Connection * connection) ++{ ++ mpd_executeCommand(connection, "commands\n"); ++} ++ ++/** ++ * Get the next returned command ++ */ ++char *mpd_getNextCommand(mpd_Connection * connection) ++{ ++ return mpd_getNextReturnElementNamed(connection, "command"); ++} ++ ++void mpd_sendUrlHandlersCommand(mpd_Connection * connection) ++{ ++ mpd_executeCommand(connection, "urlhandlers\n"); ++} ++ ++char *mpd_getNextHandler(mpd_Connection * connection) ++{ ++ return mpd_getNextReturnElementNamed(connection, "handler"); ++} ++ ++void mpd_sendTagTypesCommand(mpd_Connection * connection) ++{ ++ mpd_executeCommand(connection, "tagtypes\n"); ++} ++ ++char *mpd_getNextTagType(mpd_Connection * connection) ++{ ++ return mpd_getNextReturnElementNamed(connection, "tagtype"); ++} ++ ++void mpd_startSearch(mpd_Connection * connection, int exact) ++{ ++ if (connection->request) { ++ strcpy(connection->errorStr, "search already in progress"); ++ connection->error = 1; ++ return; ++ } ++ ++ if (exact) ++ connection->request = strdup("find"); ++ else ++ connection->request = strdup("search"); ++} ++ ++void mpd_startStatsSearch(mpd_Connection * connection) ++{ ++ if (connection->request) { ++ strcpy(connection->errorStr, "search already in progress"); ++ connection->error = 1; ++ return; ++ } ++ ++ connection->request = strdup("count"); ++} ++ ++void mpd_startPlaylistSearch(mpd_Connection * connection, int exact) ++{ ++ if (connection->request) { ++ strcpy(connection->errorStr, "search already in progress"); ++ connection->error = 1; ++ return; ++ } ++ ++ if (exact) ++ connection->request = strdup("playlistfind"); ++ else ++ connection->request = strdup("playlistsearch"); ++} ++ ++void mpd_startFieldSearch(mpd_Connection * connection, int type) ++{ ++ char *strtype; ++ int len; ++ ++ if (connection->request) { ++ strcpy(connection->errorStr, "search already in progress"); ++ connection->error = 1; ++ return; ++ } ++ ++ if (type < 0 || type >= MPD_TAG_NUM_OF_ITEM_TYPES) { ++ strcpy(connection->errorStr, "invalid type specified"); ++ connection->error = 1; ++ return; ++ } ++ ++ strtype = mpdTagItemKeys[type]; ++ ++ len = 5 + strlen(strtype) + 1; ++ connection->request = malloc(len); ++ ++ snprintf(connection->request, len, "list %c%s", tolower(strtype[0]), strtype + 1); ++} ++ ++void mpd_addConstraintSearch(mpd_Connection * connection, int type, const char *name) ++{ ++ char *strtype; ++ char *arg; ++ int len; ++ char *string; ++ ++ if (!connection->request) { ++ strcpy(connection->errorStr, "no search in progress"); ++ connection->error = 1; ++ return; ++ } ++ ++ if (type < 0 || type >= MPD_TAG_NUM_OF_ITEM_TYPES) { ++ strcpy(connection->errorStr, "invalid type specified"); ++ connection->error = 1; ++ return; ++ } ++ ++ if (name == NULL) { ++ strcpy(connection->errorStr, "no name specified"); ++ connection->error = 1; ++ return; ++ } ++ ++ string = strdup(connection->request); ++ strtype = mpdTagItemKeys[type]; ++ arg = mpd_sanitizeArg(name); ++ ++ len = strlen(string) + 1 + strlen(strtype) + 2 + strlen(arg) + 2; ++ connection->request = realloc(connection->request, len); ++ snprintf(connection->request, len, "%s %c%s \"%s\"", string, tolower(strtype[0]), strtype + 1, arg); ++ ++ free(string); ++ free(arg); ++} ++ ++void mpd_commitSearch(mpd_Connection * connection) ++{ ++ int len; ++ ++ if (!connection->request) { ++ strcpy(connection->errorStr, "no search in progress"); ++ connection->error = 1; ++ return; ++ } ++ ++ len = strlen(connection->request) + 2; ++ connection->request = realloc(connection->request, len); ++ connection->request[len - 2] = '\n'; ++ connection->request[len - 1] = '\0'; ++ mpd_sendInfoCommand(connection, connection->request); ++ ++ free(connection->request); ++ connection->request = NULL; ++} ++ ++/** ++ * @param connection a MpdConnection ++ * @param path the path to the playlist. ++ * ++ * List the content, with full metadata, of a stored playlist. ++ * ++ */ ++void mpd_sendListPlaylistInfoCommand(mpd_Connection * connection, char *path) ++{ ++ char *arg = mpd_sanitizeArg(path); ++ int len = strlen("listplaylistinfo") + 2 + strlen(arg) + 3; ++ char *query = malloc(len); ++ snprintf(query, len, "listplaylistinfo \"%s\"\n", arg); ++ mpd_sendInfoCommand(connection, query); ++ free(arg); ++ free(query); ++} ++ ++/** ++ * @param connection a MpdConnection ++ * @param path the path to the playlist. ++ * ++ * List the content of a stored playlist. ++ * ++ */ ++void mpd_sendListPlaylistCommand(mpd_Connection * connection, char *path) ++{ ++ char *arg = mpd_sanitizeArg(path); ++ int len = strlen("listplaylist") + 2 + strlen(arg) + 3; ++ char *query = malloc(len); ++ snprintf(query, len, "listplaylist \"%s\"\n", arg); ++ mpd_sendInfoCommand(connection, query); ++ free(arg); ++ free(query); ++} ++ ++void mpd_sendPlaylistClearCommand(mpd_Connection * connection, char *path) ++{ ++ char *sPath = mpd_sanitizeArg(path); ++ int len = strlen("playlistclear") + 2 + strlen(sPath) + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "playlistclear \"%s\"\n", sPath); ++ mpd_executeCommand(connection, string); ++ free(sPath); ++ free(string); ++} ++ ++void mpd_sendPlaylistAddCommand(mpd_Connection * connection, char *playlist, char *path) ++{ ++ char *sPlaylist = mpd_sanitizeArg(playlist); ++ char *sPath = mpd_sanitizeArg(path); ++ int len = strlen("playlistadd") + 2 + strlen(sPlaylist) + 3 + strlen(sPath) + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "playlistadd \"%s\" \"%s\"\n", sPlaylist, sPath); ++ mpd_executeCommand(connection, string); ++ free(sPlaylist); ++ free(sPath); ++ free(string); ++} ++ ++void mpd_sendPlaylistMoveCommand(mpd_Connection * connection, char *playlist, int from, int to) ++{ ++ char *sPlaylist = mpd_sanitizeArg(playlist); ++ int len = strlen("playlistmove") + 2 + strlen(sPlaylist) + 3 + INTLEN + 3 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "playlistmove \"%s\" \"%i\" \"%i\"\n", sPlaylist, from, to); ++ mpd_executeCommand(connection, string); ++ free(sPlaylist); ++ free(string); ++} ++ ++void mpd_sendPlaylistDeleteCommand(mpd_Connection * connection, char *playlist, int pos) ++{ ++ char *sPlaylist = mpd_sanitizeArg(playlist); ++ int len = strlen("playlistdelete") + 2 + strlen(sPlaylist) + 3 + INTLEN + 3; ++ char *string = malloc(len); ++ snprintf(string, len, "playlistdelete \"%s\" \"%i\"\n", sPlaylist, pos); ++ mpd_executeCommand(connection, string); ++ free(sPlaylist); ++ free(string); ++} +--- /dev/null ++++ b/libmpdclient.h +@@ -0,0 +1,661 @@ ++/* libmpdclient ++ (c)2003-2006 by Warren Dukes (warren.dukes@gmail.com) ++ This project's homepage is: http://www.musicpd.org ++ ++ Redistribution and use in source and binary forms, with or without ++ modification, are permitted provided that the following conditions ++ are met: ++ ++ - Redistributions of source code must retain the above copyright ++ notice, this list of conditions and the following disclaimer. ++ ++ - Redistributions in binary form must reproduce the above copyright ++ notice, this list of conditions and the following disclaimer in the ++ documentation and/or other materials provided with the distribution. ++ ++ - Neither the name of the Music Player Daemon nor the names of its ++ contributors may be used to endorse or promote products derived from ++ this software without specific prior written permission. ++ ++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ++ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 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. ++*/ ++ ++#ifndef LIBMPDCLIENT_H ++#define LIBMPDCLIENT_H ++ ++#ifdef WIN32 ++# define __W32API_USE_DLLIMPORT__ 1 ++#endif ++ ++#include ++#include ++#define MPD_BUFFER_MAX_LENGTH 50000 ++#define MPD_ERRORSTR_MAX_LENGTH 1000 ++#define MPD_WELCOME_MESSAGE "OK MPD " ++ ++#define MPD_ERROR_TIMEOUT 10 /* timeout trying to talk to mpd */ ++#define MPD_ERROR_SYSTEM 11 /* system error */ ++#define MPD_ERROR_UNKHOST 12 /* unknown host */ ++#define MPD_ERROR_CONNPORT 13 /* problems connecting to port on host */ ++#define MPD_ERROR_NOTMPD 14 /* mpd not running on port at host */ ++#define MPD_ERROR_NORESPONSE 15 /* no response on attempting to connect */ ++#define MPD_ERROR_SENDING 16 /* error sending command */ ++#define MPD_ERROR_CONNCLOSED 17 /* connection closed by mpd */ ++#define MPD_ERROR_ACK 18 /* ACK returned! */ ++#define MPD_ERROR_BUFFEROVERRUN 19 /* Buffer was overrun! */ ++ ++#define MPD_ACK_ERROR_UNK -1 ++#define MPD_ERROR_AT_UNK -1 ++ ++#define MPD_ACK_ERROR_NOT_LIST 1 ++#define MPD_ACK_ERROR_ARG 2 ++#define MPD_ACK_ERROR_PASSWORD 3 ++#define MPD_ACK_ERROR_PERMISSION 4 ++#define MPD_ACK_ERROR_UNKNOWN_CMD 5 ++ ++#define MPD_ACK_ERROR_NO_EXIST 50 ++#define MPD_ACK_ERROR_PLAYLIST_MAX 51 ++#define MPD_ACK_ERROR_SYSTEM 52 ++#define MPD_ACK_ERROR_PLAYLIST_LOAD 53 ++#define MPD_ACK_ERROR_UPDATE_ALREADY 54 ++#define MPD_ACK_ERROR_PLAYER_SYNC 55 ++#define MPD_ACK_ERROR_EXIST 56 ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ typedef enum mpd_TagItems { ++ MPD_TAG_ITEM_ARTIST, ++ MPD_TAG_ITEM_ALBUM, ++ MPD_TAG_ITEM_TITLE, ++ MPD_TAG_ITEM_TRACK, ++ MPD_TAG_ITEM_NAME, ++ MPD_TAG_ITEM_GENRE, ++ MPD_TAG_ITEM_DATE, ++ MPD_TAG_ITEM_COMPOSER, ++ MPD_TAG_ITEM_PERFORMER, ++ MPD_TAG_ITEM_COMMENT, ++ MPD_TAG_ITEM_DISC, ++ MPD_TAG_ITEM_FILENAME, ++ MPD_TAG_ITEM_ANY, ++ MPD_TAG_NUM_OF_ITEM_TYPES ++ } mpd_TagItems; ++ ++ extern char *mpdTagItemKeys[MPD_TAG_NUM_OF_ITEM_TYPES]; ++ ++/* internal stuff don't touch this struct */ ++ typedef struct _mpd_ReturnElement { ++ char *name; ++ char *value; ++ } mpd_ReturnElement; ++ ++/* mpd_Connection ++ * holds info about connection to mpd ++ * use error, and errorStr to detect errors ++ */ ++ typedef struct _mpd_Connection { ++ /* use this to check the version of mpd */ ++ int version[3]; ++ /* IMPORTANT, you want to get the error messages from here */ ++ char errorStr[MPD_ERRORSTR_MAX_LENGTH + 1]; ++ int errorCode; ++ int errorAt; ++ /* this will be set to MPD_ERROR_* if there is an error, 0 if not */ ++ int error; ++ /* DON'T TOUCH any of the rest of this stuff */ ++ int sock; ++ char buffer[MPD_BUFFER_MAX_LENGTH + 1]; ++ int buflen; ++ int bufstart; ++ int doneProcessing; ++ int listOks; ++ int doneListOk; ++ int commandList; ++ mpd_ReturnElement *returnElement; ++ struct timeval timeout; ++ char *request; ++ } mpd_Connection; ++ ++/* mpd_newConnection ++ * use this to open a new connection ++ * you should use mpd_closeConnection, when your done with the connection, ++ * even if an error has occurred ++ * _timeout_ is the connection timeout period in seconds ++ */ ++ mpd_Connection *mpd_newConnection(const char *host, int port, float timeout); ++ ++ void mpd_setConnectionTimeout(mpd_Connection * connection, float timeout); ++ ++/* mpd_closeConnection ++ * use this to close a connection and free'ing subsequent memory ++ */ ++ void mpd_closeConnection(mpd_Connection * connection); ++ ++/* mpd_clearError ++ * clears error ++ */ ++ void mpd_clearError(mpd_Connection * connection); ++ ++/* STATUS STUFF */ ++ ++/* use these with status.state to determine what state the player is in */ ++#define MPD_STATUS_STATE_UNKNOWN 0 ++#define MPD_STATUS_STATE_STOP 1 ++#define MPD_STATUS_STATE_PLAY 2 ++#define MPD_STATUS_STATE_PAUSE 3 ++ ++/* us this with status.volume to determine if mpd has volume support */ ++#define MPD_STATUS_NO_VOLUME -1 ++ ++/* mpd_Status ++ * holds info return from status command ++ */ ++ typedef struct mpd_Status { ++ /* 0-100, or MPD_STATUS_NO_VOLUME when there is no volume support */ ++ int volume; ++ /* 1 if repeat is on, 0 otherwise */ ++ int repeat; ++ /* 1 if random is on, 0 otherwise */ ++ int random; ++ /* playlist length */ ++ int playlistLength; ++ /* playlist, use this to determine when the playlist has changed */ ++ long long playlist; ++ /* use with MPD_STATUS_STATE_* to determine state of player */ ++ int state; ++ /* crossfade setting in seconds */ ++ int crossfade; ++ /* if a song is currently selected (always the case when state is ++ * PLAY or PAUSE), this is the position of the currently ++ * playing song in the playlist, beginning with 0 ++ */ ++ int song; ++ /* Song ID of the currently selected song */ ++ int songid; ++ /* time in seconds that have elapsed in the currently playing/paused ++ * song ++ */ ++ int elapsedTime; ++ /* length in seconds of the currently playing/paused song */ ++ int totalTime; ++ /* current bit rate in kbs */ ++ int bitRate; ++ /* audio sample rate */ ++ unsigned int sampleRate; ++ /* audio bits */ ++ int bits; ++ /* audio channels */ ++ int channels; ++ /* 1 if mpd is updating, 0 otherwise */ ++ int updatingDb; ++ /* error */ ++ char *error; ++ } mpd_Status; ++ ++ void mpd_sendStatusCommand(mpd_Connection * connection); ++ ++/* mpd_getStatus ++ * returns status info, be sure to free it with mpd_freeStatus() ++ * call this after mpd_sendStatusCommand() ++ */ ++ mpd_Status *mpd_getStatus(mpd_Connection * connection); ++ ++/* mpd_freeStatus ++ * free's status info malloc'd and returned by mpd_getStatus ++ */ ++ void mpd_freeStatus(mpd_Status * status); ++ ++ typedef struct _mpd_Stats { ++ int numberOfArtists; ++ int numberOfAlbums; ++ int numberOfSongs; ++ unsigned long uptime; ++ unsigned long dbUpdateTime; ++ unsigned long playTime; ++ unsigned long dbPlayTime; ++ } mpd_Stats; ++ ++ typedef struct _mpd_SearchStats { ++ int numberOfSongs; ++ unsigned long playTime; ++ } mpd_SearchStats; ++ ++ void mpd_sendStatsCommand(mpd_Connection * connection); ++ ++ mpd_Stats *mpd_getStats(mpd_Connection * connection); ++ ++ void mpd_freeStats(mpd_Stats * stats); ++ ++ mpd_SearchStats *mpd_getSearchStats(mpd_Connection * connection); ++ ++ void mpd_freeSearchStats(mpd_SearchStats * stats); ++ ++/* SONG STUFF */ ++ ++#define MPD_SONG_NO_TIME -1 ++#define MPD_SONG_NO_NUM -1 ++#define MPD_SONG_NO_ID -1 ++ ++/* mpd_Song ++ * for storing song info returned by mpd ++ */ ++ typedef struct _mpd_Song { ++ /* filename of song */ ++ char *file; ++ /* artist, maybe NULL if there is no tag */ ++ char *artist; ++ /* title, maybe NULL if there is no tag */ ++ char *title; ++ /* album, maybe NULL if there is no tag */ ++ char *album; ++ /* track, maybe NULL if there is no tag */ ++ char *track; ++ /* name, maybe NULL if there is no tag; it's the name of the current ++ * song, f.e. the icyName of the stream */ ++ char *name; ++ /* date */ ++ char *date; ++ ++ /* added by qball */ ++ /* Genre */ ++ char *genre; ++ /* Composer */ ++ char *composer; ++ /* Performer */ ++ char *performer; ++ /* Disc */ ++ char *disc; ++ /* Comment */ ++ char *comment; ++ ++ /* length of song in seconds, check that it is not MPD_SONG_NO_TIME */ ++ int time; ++ /* if plchanges/playlistinfo/playlistid used, is the position of the ++ * song in the playlist */ ++ int pos; ++ /* song id for a song in the playlist */ ++ int id; ++ } mpd_Song; ++ ++/* mpd_newSong ++ * use to allocate memory for a new mpd_Song ++ * file, artist, etc all initialized to NULL ++ * if your going to assign values to file, artist, etc ++ * be sure to malloc or strdup the memory ++ * use mpd_freeSong to free the memory for the mpd_Song, it will also ++ * free memory for file, artist, etc, so don't do it yourself ++ */ ++ mpd_Song *mpd_newSong(void); ++ ++/* mpd_freeSong ++ * use to free memory allocated by mpd_newSong ++ * also it will free memory pointed to by file, artist, etc, so be careful ++ */ ++ void mpd_freeSong(mpd_Song * song); ++ ++/* mpd_songDup ++ * works like strDup, but for a mpd_Song ++ */ ++ mpd_Song *mpd_songDup(mpd_Song * song); ++ ++/* DIRECTORY STUFF */ ++ ++/* mpd_Directory ++ * used to store info fro directory (right now that just the path) ++ */ ++ typedef struct _mpd_Directory { ++ char *path; ++ } mpd_Directory; ++ ++/* mpd_newDirectory ++ * allocates memory for a new directory ++ * use mpd_freeDirectory to free this memory ++ */ ++ mpd_Directory *mpd_newDirectory(void); ++ ++/* mpd_freeDirectory ++ * used to free memory allocated with mpd_newDirectory, and it frees ++ * path of mpd_Directory, so be careful ++ */ ++ void mpd_freeDirectory(mpd_Directory * directory); ++ ++/* mpd_directoryDup ++ * works like strdup, but for mpd_Directory ++ */ ++ mpd_Directory *mpd_directoryDup(mpd_Directory * directory); ++ ++/* PLAYLISTFILE STUFF */ ++ ++/* mpd_PlaylistFile ++ * stores info about playlist file returned by lsinfo ++ */ ++ typedef struct _mpd_PlaylistFile { ++ char *path; ++ } mpd_PlaylistFile; ++ ++/* mpd_newPlaylistFile ++ * allocates memory for new mpd_PlaylistFile, path is set to NULL ++ * free this memory with mpd_freePlaylistFile ++ */ ++ mpd_PlaylistFile *mpd_newPlaylistFile(void); ++ ++/* mpd_freePlaylist ++ * free memory allocated for freePlaylistFile, will also free ++ * path, so be careful ++ */ ++ void mpd_freePlaylistFile(mpd_PlaylistFile * playlist); ++ ++/* mpd_playlistFileDup ++ * works like strdup, but for mpd_PlaylistFile ++ */ ++ mpd_PlaylistFile *mpd_playlistFileDup(mpd_PlaylistFile * playlist); ++ ++/* INFO ENTITY STUFF */ ++ ++/* the type of entity returned from one of the commands that generates info ++ * use in conjunction with mpd_InfoEntity.type ++ */ ++#define MPD_INFO_ENTITY_TYPE_DIRECTORY 0 ++#define MPD_INFO_ENTITY_TYPE_SONG 1 ++#define MPD_INFO_ENTITY_TYPE_PLAYLISTFILE 2 ++ ++/* mpd_InfoEntity ++ * stores info on stuff returned info commands ++ */ ++ typedef struct mpd_InfoEntity { ++ /* the type of entity, use with MPD_INFO_ENTITY_TYPE_* to determine ++ * what this entity is (song, directory, etc...) ++ */ ++ int type; ++ /* the actual data you want, mpd_Song, mpd_Directory, etc */ ++ union { ++ mpd_Directory *directory; ++ mpd_Song *song; ++ mpd_PlaylistFile *playlistFile; ++ } info; ++ } mpd_InfoEntity; ++ ++ mpd_InfoEntity *mpd_newInfoEntity(void); ++ ++ void mpd_freeInfoEntity(mpd_InfoEntity * entity); ++ ++/* INFO COMMANDS AND STUFF */ ++ ++/* use this function to loop over after calling Info/Listall functions */ ++ mpd_InfoEntity *mpd_getNextInfoEntity(mpd_Connection * connection); ++ ++/* fetches the currently seeletect song (the song referenced by status->song ++ * and status->songid*/ ++ void mpd_sendCurrentSongCommand(mpd_Connection * connection); ++ ++/* songNum of -1, means to display the whole list */ ++ void mpd_sendPlaylistInfoCommand(mpd_Connection * connection, int songNum); ++ ++/* songId of -1, means to display the whole list */ ++ void mpd_sendPlaylistIdCommand(mpd_Connection * connection, int songId); ++ ++/* use this to get the changes in the playlist since version _playlist_ */ ++ void mpd_sendPlChangesCommand(mpd_Connection * connection, long long playlist); ++ ++/** ++ * @param connection: A valid and connected mpd_Connection. ++ * @param playlist: The playlist version you want the diff with. ++ * A more bandwidth efficient version of the mpd_sendPlChangesCommand. ++ * It only returns the pos+id of the changes song. ++ */ ++ void mpd_sendPlChangesPosIdCommand(mpd_Connection * connection, long long playlist); ++ ++/* recursivel fetches all songs/dir/playlists in "dir* (no metadata is ++ * returned) */ ++ void mpd_sendListallCommand(mpd_Connection * connection, const char *dir); ++ ++/* same as sendListallCommand, but also metadata is returned */ ++ void mpd_sendListallInfoCommand(mpd_Connection * connection, const char *dir); ++ ++/* non-recursive version of ListallInfo */ ++ void mpd_sendLsInfoCommand(mpd_Connection * connection, const char *dir); ++ ++#define MPD_TABLE_ARTIST MPD_TAG_ITEM_ARTIST ++#define MPD_TABLE_ALBUM MPD_TAG_ITEM_ALBUM ++#define MPD_TABLE_TITLE MPD_TAG_ITEM_TITLE ++#define MPD_TABLE_FILENAME MPD_TAG_ITEM_FILENAME ++ ++ void mpd_sendSearchCommand(mpd_Connection * connection, int table, const char *str); ++ ++ void mpd_sendFindCommand(mpd_Connection * connection, int table, const char *str); ++ ++/* LIST TAG COMMANDS */ ++ ++/* use this function fetch next artist entry, be sure to free the returned ++ * string. NULL means there are no more. Best used with sendListArtists ++ */ ++ char *mpd_getNextArtist(mpd_Connection * connection); ++ ++ char *mpd_getNextAlbum(mpd_Connection * connection); ++ ++ char *mpd_getNextTag(mpd_Connection * connection, int type); ++ ++/* list artist or albums by artist, arg1 should be set to the artist if ++ * listing albums by a artist, otherwise NULL for listing all artists or albums ++ */ ++ void mpd_sendListCommand(mpd_Connection * connection, int table, const char *arg1); ++ ++/* SIMPLE COMMANDS */ ++ ++ void mpd_sendAddCommand(mpd_Connection * connection, const char *file); ++ ++ int mpd_sendAddIdCommand(mpd_Connection * connection, const char *file); ++ ++ void mpd_sendDeleteCommand(mpd_Connection * connection, int songNum); ++ ++ void mpd_sendDeleteIdCommand(mpd_Connection * connection, int songNum); ++ ++ void mpd_sendSaveCommand(mpd_Connection * connection, const char *name); ++ ++ void mpd_sendLoadCommand(mpd_Connection * connection, const char *name); ++ ++ void mpd_sendRmCommand(mpd_Connection * connection, const char *name); ++ ++ void mpd_sendRenameCommand(mpd_Connection * connection, const char *from, const char *to); ++ ++ void mpd_sendShuffleCommand(mpd_Connection * connection); ++ ++ void mpd_sendClearCommand(mpd_Connection * connection); ++ ++/* use this to start playing at the beginning, useful when in random mode */ ++#define MPD_PLAY_AT_BEGINNING -1 ++ ++ void mpd_sendPlayCommand(mpd_Connection * connection, int songNum); ++ ++ void mpd_sendPlayIdCommand(mpd_Connection * connection, int songNum); ++ ++ void mpd_sendStopCommand(mpd_Connection * connection); ++ ++ void mpd_sendPauseCommand(mpd_Connection * connection, int pauseMode); ++ ++ void mpd_sendNextCommand(mpd_Connection * connection); ++ ++ void mpd_sendPrevCommand(mpd_Connection * connection); ++ ++ void mpd_sendMoveCommand(mpd_Connection * connection, int from, int to); ++ ++ void mpd_sendMoveIdCommand(mpd_Connection * connection, int from, int to); ++ ++ void mpd_sendSwapCommand(mpd_Connection * connection, int song1, int song2); ++ ++ void mpd_sendSwapIdCommand(mpd_Connection * connection, int song1, int song2); ++ ++ void mpd_sendSeekCommand(mpd_Connection * connection, int song, int time); ++ ++ void mpd_sendSeekIdCommand(mpd_Connection * connection, int song, int time); ++ ++ void mpd_sendRepeatCommand(mpd_Connection * connection, int repeatMode); ++ ++ void mpd_sendRandomCommand(mpd_Connection * connection, int randomMode); ++ ++ void mpd_sendSetvolCommand(mpd_Connection * connection, int volumeChange); ++ ++/* WARNING: don't use volume command, its depreacted */ ++ void mpd_sendVolumeCommand(mpd_Connection * connection, int volumeChange); ++ ++ void mpd_sendCrossfadeCommand(mpd_Connection * connection, int seconds); ++ ++ void mpd_sendUpdateCommand(mpd_Connection * connection, char *path); ++ ++/* returns the update job id, call this after a update command*/ ++ int mpd_getUpdateId(mpd_Connection * connection); ++ ++ void mpd_sendPasswordCommand(mpd_Connection * connection, const char *pass); ++ ++/* after executing a command, when your done with it to get its status ++ * (you want to check connection->error for an error) ++ */ ++ void mpd_finishCommand(mpd_Connection * connection); ++ ++/* command list stuff, use this to do things like add files very quickly */ ++ void mpd_sendCommandListBegin(mpd_Connection * connection); ++ ++ void mpd_sendCommandListOkBegin(mpd_Connection * connection); ++ ++ void mpd_sendCommandListEnd(mpd_Connection * connection); ++ ++/* advance to the next listOk ++ * returns 0 if advanced to the next list_OK, ++ * returns -1 if it advanced to an OK or ACK */ ++ int mpd_nextListOkCommand(mpd_Connection * connection); ++ ++ typedef struct _mpd_OutputEntity { ++ int id; ++ char *name; ++ int enabled; ++ } mpd_OutputEntity; ++ ++ void mpd_sendOutputsCommand(mpd_Connection * connection); ++ ++ mpd_OutputEntity *mpd_getNextOutput(mpd_Connection * connection); ++ ++ void mpd_sendEnableOutputCommand(mpd_Connection * connection, int outputId); ++ ++ void mpd_sendDisableOutputCommand(mpd_Connection * connection, int outputId); ++ ++ void mpd_freeOutputElement(mpd_OutputEntity * output); ++ ++/** ++ * @param connection a #mpd_Connection ++ * ++ * Queries mpd for the allowed commands ++ */ ++ void mpd_sendCommandsCommand(mpd_Connection * connection); ++ ++/** ++ * @param connection a #mpd_Connection ++ * ++ * Queries mpd for the not allowed commands ++ */ ++ void mpd_sendNotCommandsCommand(mpd_Connection * connection); ++ ++/** ++ * @param connection a #mpd_Connection ++ * ++ * returns the next supported command. ++ * ++ * @returns a string, needs to be free'ed ++ */ ++ char *mpd_getNextCommand(mpd_Connection * connection); ++ ++ void mpd_sendUrlHandlersCommand(mpd_Connection * connection); ++ ++ char *mpd_getNextHandler(mpd_Connection * connection); ++ ++ void mpd_sendTagTypesCommand(mpd_Connection * connection); ++ ++ char *mpd_getNextTagType(mpd_Connection * connection); ++ ++/** ++ * @param connection a MpdConnection ++ * @param path the path to the playlist. ++ * ++ * List the content, with full metadata, of a stored playlist. ++ * ++ */ ++ void mpd_sendListPlaylistInfoCommand(mpd_Connection * connection, char *path); ++ ++/** ++ * @param connection a MpdConnection ++ * @param path the path to the playlist. ++ * ++ * List the content of a stored playlist. ++ * ++ */ ++ void mpd_sendListPlaylistCommand(mpd_Connection * connection, char *path); ++ ++/** ++ * @param connection a #mpd_Connection ++ * @param exact if to match exact ++ * ++ * starts a search, use mpd_addConstraintSearch to add ++ * a constraint to the search, and mpd_commitSearch to do the actual search ++ */ ++ void mpd_startSearch(mpd_Connection * connection, int exact); ++ ++/** ++ * @param connection a #mpd_Connection ++ * @param type ++ * @param name ++ */ ++ void mpd_addConstraintSearch(mpd_Connection * connection, int type, const char *name); ++ ++/** ++ * @param connection a #mpd_Connection ++ */ ++ void mpd_commitSearch(mpd_Connection * connection); ++ ++/** ++ * @param connection a #mpd_Connection ++ * @param type The type to search for ++ * ++ * starts a search for fields... f.e. get a list of artists would be: ++ * @code ++ * mpd_startFieldSearch(connection, MPD_TAG_ITEM_ARTIST); ++ * mpd_commitSearch(connection); ++ * @endcode ++ * ++ * or get a list of artist in genre "jazz" would be: ++ * @code ++ * mpd_startFieldSearch(connection, MPD_TAG_ITEM_ARTIST); ++ * mpd_addConstraintSearch(connection, MPD_TAG_ITEM_GENRE, "jazz") ++ * mpd_commitSearch(connection); ++ * @endcode ++ * ++ * mpd_startSearch will return a list of songs (and you need mpd_getNextInfoEntity) ++ * this one will return a list of only one field (the one specified with type) and you need ++ * mpd_getNextTag to get the results ++ */ ++ void mpd_startFieldSearch(mpd_Connection * connection, int type); ++ ++ void mpd_startPlaylistSearch(mpd_Connection * connection, int exact); ++ ++ void mpd_startStatsSearch(mpd_Connection * connection); ++ ++ void mpd_sendPlaylistClearCommand(mpd_Connection * connection, char *path); ++ ++ void mpd_sendPlaylistAddCommand(mpd_Connection * connection, char *playlist, char *path); ++ ++ void mpd_sendPlaylistMoveCommand(mpd_Connection * connection, char *playlist, int from, int to); ++ ++ void mpd_sendPlaylistDeleteCommand(mpd_Connection * connection, char *playlist, int pos); ++#ifdef __cplusplus ++} ++#endif ++#endif diff --git a/utils/lcd4linux/patches/160-uinput_defs.patch b/utils/lcd4linux/patches/160-uinput_defs.patch new file mode 100644 index 0000000..44b24b3 --- /dev/null +++ b/utils/lcd4linux/patches/160-uinput_defs.patch @@ -0,0 +1,24 @@ +--- a/drv_G15.c ++++ b/drv_G15.c +@@ -42,6 +42,7 @@ + + #include + #include ++#include + #include + #include + +@@ -269,8 +270,13 @@ void drv_G15_initKeyHandling(char *devic + } + memset(&device, 0, sizeof(device)); + strncpy(device.name, "G15 Keys", UINPUT_MAX_NAME_SIZE); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + device.id.bustype = BUS_USB; + device.id.version = 4; ++#else ++ device.idbus = BUS_USB; ++ device.idversion = 4; ++#endif + + ioctl(uinput_fd, UI_SET_EVBIT, EV_KEY); + diff --git a/utils/lcd4linux/patches/170-add-generic-spidev-driver.patch b/utils/lcd4linux/patches/170-add-generic-spidev-driver.patch new file mode 100644 index 0000000..9dcf1cb --- /dev/null +++ b/utils/lcd4linux/patches/170-add-generic-spidev-driver.patch @@ -0,0 +1,195 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -71,6 +71,8 @@ drv_generic_i2c.c \ + drv_generic_i2c.h \ + drv_generic_keypad.c \ + drv_generic_keypad.h \ ++drv_generic_spidev.c \ ++drv_generic_spidev.h \ + drv_ASTUSB.c \ + drv_BeckmannEgle.c \ + drv_BWCT.c \ +--- /dev/null ++++ b/drv_generic_spidev.c +@@ -0,0 +1,89 @@ ++/* $Id$ ++ * $URL$ ++ * ++ * generic driver helper for displays connected via SPI bus ++ * ++ * Copyright (C) 2012 Gabor Juhos ++ * ++ * This file is part of LCD4Linux. ++ * ++ * LCD4Linux is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * LCD4Linux is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#include "config.h" ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "debug.h" ++#include "qprintf.h" ++#include "cfg.h" ++#include "drv_generic_spidev.h" ++ ++static char *generic_spidev_section = ""; ++static char *generic_spidev_driver = ""; ++static int generic_spidev_fd; ++ ++int drv_generic_spidev_open(const char *section, const char *driver) ++{ ++ char *spidev; ++ ++ udelay_init(); ++ ++ generic_spidev_section = (char *) section; ++ generic_spidev_driver = (char *) driver; ++ ++ spidev = cfg_get(generic_spidev_section, "Port", NULL); ++ ++ info("%s: initializing SPI device %s", generic_spidev_driver, spidev); ++ generic_spidev_fd = open(spidev, O_WRONLY); ++ if (generic_spidev_fd < 0) { ++ error("%s: unable to open SPI device %s!\n", generic_spidev_driver, spidev); ++ goto exit_error; ++ } ++ ++ return 0; ++ ++ exit_error: ++ free(spidev); ++ return -1; ++} ++ ++int drv_generic_spidev_close(void) ++{ ++ close(generic_spidev_fd); ++ return 0; ++} ++ ++int drv_generic_spidev_transfer(const int count, struct spi_ioc_transfer *tr) ++{ ++ int ret; ++ ++ ret = ioctl(generic_spidev_fd, SPI_IOC_MESSAGE(count), tr); ++ if (ret < count) { ++ error("%s: can't send SPI message! (%s)\n", ++ generic_spidev_driver, strerror(errno)); ++ return -1; ++ } ++ ++ return 0; ++} +--- /dev/null ++++ b/drv_generic_spidev.h +@@ -0,0 +1,54 @@ ++/* $Id$ ++ * $URL$ ++ * ++ * generic driver helper for displays connected via SPI bus ++ * ++ * Copyright (C) 2012 Gabor Juhos ++ * Copyright (C) 2012 The LCD4Linux Team ++ * ++ * This file is part of LCD4Linux. ++ * ++ * LCD4Linux is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * LCD4Linux is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++/* ++ * ++ * exported fuctions: ++ * ++ * int drv_generic_spidev_open (const char *section, const char *driver) ++ * reads 'Port' entry from config and opens ++ * the SPI device ++ * returns 0 if ok, -1 on failure ++ * ++ * int drv_generic_spidev_close (void) ++ * closes SPI device ++ * returns 0 if ok, -1 on failure ++ * ++ * void drv_generic_spidev_transfer (int count, struct spi_ioc_transfer *tr) ++ * transfer data to/from the SPI device ++ * ++ */ ++ ++#ifndef _DRV_GENERIC_SPIDEV_H_ ++#define _DRV_GENERIC_SPIDEV_H_ ++ ++#include ++ ++int drv_generic_spidev_open(const char *section, const char *driver); ++int drv_generic_spidev_close(void); ++int drv_generic_spidev_transfer(const int count, struct spi_ioc_transfer *tr); ++ ++#endif /* _DRV_GENERIC_SPIDEV_H_ */ +--- a/drivers.m4 ++++ b/drivers.m4 +@@ -301,6 +301,7 @@ PARPORT="no" + SERIAL="no" + I2C="no" + KEYPAD="no" ++SPIDEV="no" + + # generic libraries + LIBUSB="no" +@@ -940,6 +941,12 @@ if test "$LIBJPEG" = "yes"; then + DRVLIBS="$DRVLIBS -ljpeg" + fi + ++# generic spidev driver ++if test "$SPIDEV" = "yes"; then ++ DRIVERS="$DRIVERS drv_generic_spidev.o" ++ AC_DEFINE(WITH_SPIDEV, 1, [SPIDEV driver]) ++fi ++ + # libusb + if test "$LIBUSB" = "yes"; then + DRVLIBS="$DRVLIBS -lusb" +--- a/configure.in ++++ b/configure.in +@@ -118,6 +118,9 @@ AC_ARG_WITH(outb, + + AC_CHECK_HEADERS([asm/io.h] [linux/parport.h linux/ppdev.h], [has_parport="true"], [has_parport="false"]) + ++# check for spidev ++AC_CHECK_HEADERS([linux/spi/spidev.h], [has_spidev="true"], [has_spidev="false"]) ++ + # drivers + sinclude(drivers.m4) + diff --git a/utils/lcd4linux/patches/171-allow-to-specify-drv_generic_graphic_real_clear.patch b/utils/lcd4linux/patches/171-allow-to-specify-drv_generic_graphic_real_clear.patch new file mode 100644 index 0000000..5a26643 --- /dev/null +++ b/utils/lcd4linux/patches/171-allow-to-specify-drv_generic_graphic_real_clear.patch @@ -0,0 +1,45 @@ +--- a/drv_generic_graphic.c ++++ b/drv_generic_graphic.c +@@ -24,7 +24,7 @@ + * + */ + +-/* ++/* + * + * exported functions: + * +@@ -98,6 +98,9 @@ static int INVERTED = 0; + /* must be implemented by the real driver */ + void (*drv_generic_graphic_real_blit) () = NULL; + ++/* can be implemented by the real driver */ ++void (*drv_generic_graphic_real_clear) () = NULL; ++ + + /****************************************/ + /*** generic Framebuffer stuff ***/ +@@ -691,7 +694,10 @@ int drv_generic_graphic_clear(void) + for (i = 0; i < LCOLS * LROWS; i++) + drv_generic_graphic_FB[l][i] = NO_COL; + +- drv_generic_graphic_blit(0, 0, LROWS, LCOLS); ++ if (drv_generic_graphic_real_clear) ++ drv_generic_graphic_real_clear(NO_COL); ++ else ++ drv_generic_graphic_blit(0, 0, LROWS, LCOLS); + + return 0; + } +--- a/drv_generic_graphic.h ++++ b/drv_generic_graphic.h +@@ -40,6 +40,9 @@ extern RGBA NO_COL; /* no color (comple + /* these functions must be implemented by the real driver */ + extern void (*drv_generic_graphic_real_blit) (const int row, const int col, const int height, const int width); + ++/* these functions can be implemented by the real driver */ ++void (*drv_generic_graphic_real_clear) (const RGBA rgba); ++ + /* helper function to get pixel color or gray value */ + extern RGBA drv_generic_graphic_rgb(const int row, const int col); + extern unsigned char drv_generic_graphic_gray(const int row, const int col); diff --git a/utils/lcd4linux/patches/172-add-TEW673GRU-driver.patch b/utils/lcd4linux/patches/172-add-TEW673GRU-driver.patch new file mode 100644 index 0000000..29a4bf3 --- /dev/null +++ b/utils/lcd4linux/patches/172-add-TEW673GRU-driver.patch @@ -0,0 +1,552 @@ +--- a/drivers.m4 ++++ b/drivers.m4 +@@ -39,7 +39,7 @@ AC_ARG_WITH( + [ Newhaven, Noritake, NULL, Pertelian, PHAnderson,] + [ PICGraphic, picoLCD, picoLCDGraphic, PNG, PPM, RouterBoard,] + [ Sample, SamsungSPF, serdisplib, ShuttleVFD, SimpleLCD, st2205, T6963,] +- [ TeakLCM, Trefon, ULA200, USBHUB, USBLCD, VNC, WincorNixdorf, X11], ++ [ TeakLCM, TEW673GRU, Trefon, ULA200, USBHUB, USBLCD, VNC, WincorNixdorf, X11], + drivers=$withval, + drivers=all + ) +@@ -107,6 +107,7 @@ for driver in $drivers; do + SHUTTLEVFD="yes" + SIMPLELCD="yes" + T6963="yes" ++ TEW673GRU="yes" + TeakLCM="yes" + Trefon="yes" + ULA200="yes" +@@ -260,6 +261,9 @@ for driver in $drivers; do + TeakLCM) + TeakLCM=$val + ;; ++ TEW673GRU) ++ TEW673GRU=$val ++ ;; + Trefon) + Trefon=$val + ;; +@@ -801,6 +805,18 @@ if test "$TeakLCM" = "yes"; then + AC_DEFINE(WITH_TEAK_LCM,1,[TeakLCM driver]) + fi + ++if test "$TEW673GRU" = "yes"; then ++ if test "$has_spidev" = "true"; then ++ GRAPHIC="yes" ++ TEXT="yes" ++ SPIDEV="yes" ++ DRIVERS="$DRIVERS drv_TEW673GRU.o" ++ AC_DEFINE(WITH_TEW673GRU,1,[TEW673GRU driver]) ++ else ++ AC_MSG_WARN(linux/spi/spidev.h not found: TEW673GRU driver disabled) ++ fi ++fi ++ + if test "$Trefon" = "yes"; then + if test "$has_usb" = "true"; then + TEXT="yes" +--- a/drv.c ++++ b/drv.c +@@ -92,6 +92,7 @@ extern DRIVER drv_serdisplib; + extern DRIVER drv_ShuttleVFD; + extern DRIVER drv_SimpleLCD; + extern DRIVER drv_T6963; ++extern DRIVER drv_TEW673GRU; + extern DRIVER drv_TeakLCM; + extern DRIVER drv_Trefon; + extern DRIVER drv_ula200; +@@ -248,6 +249,9 @@ DRIVER *Driver[] = { + #ifdef WITH_TEAK_LCM + &drv_TeakLCM, + #endif ++#ifdef WITH_TEW673GRU ++ &drv_TEW673GRU, ++#endif + #ifdef WITH_TREFON + &drv_Trefon, + #endif +--- a/Makefile.am ++++ b/Makefile.am +@@ -119,6 +119,7 @@ drv_ShuttleVFD.c \ + drv_SimpleLCD.c \ + drv_T6963.c \ + drv_TeakLCM.c \ ++drv_TEW673GRU.c \ + drv_Trefon.c \ + drv_ula200.c \ + drv_USBHUB.c \ +--- /dev/null ++++ b/drv_TEW673GRU.c +@@ -0,0 +1,457 @@ ++/* $Id$ ++ * $URL$ ++ * ++ * TRENDnet TEW673GRU LCD4linux driver ++ * ++ * Copyright (C) 2012 Gabor Juhos ++ * ++ * based on the Sample driver which is: ++ * Copyright (C) 2005 Michael Reinelt ++ * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team ++ * ++ * This file is part of LCD4Linux. ++ * ++ * LCD4Linux is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * LCD4Linux is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++/* ++ * exported fuctions: ++ * ++ * struct DRIVER drv_TEW673GRU ++ */ ++ ++#include "config.h" ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "debug.h" ++#include "cfg.h" ++#include "qprintf.h" ++#include "udelay.h" ++#include "plugin.h" ++#include "widget.h" ++#include "widget_text.h" ++#include "widget_icon.h" ++#include "widget_bar.h" ++#include "drv.h" ++ ++#include "drv_generic_text.h" ++#include "drv_generic_graphic.h" ++#include "drv_generic_spidev.h" ++ ++#ifdef WITH_DMALLOC ++#include ++#endif ++ ++#define TEW673GRU_NUM_COLS 220 ++#define TEW673GRU_NUM_ROWS 176 ++#define TEW673GRU_BPP 2 /* bytes per pixel */ ++ ++#define TEW673GRU_CMD_SIZE 9 ++#define TEW673GRU_NUM_ROW_BYTES (TEW673GRU_NUM_COLS * TEW673GRU_BPP) ++ ++enum { ++ CMD_SHOW_STRING = 49, ++ CMD_SHOW_IMAGE_DIR = 52, ++ CMD_SCREEN_COLOR = 54, ++}; ++ ++static char Name[] = "TEW673GRU"; ++ ++static char *drv_TEW673GRU_FB; ++static long FB_SIZE; ++static int MODE; ++ ++static unsigned int RGBAto16(RGBA rgb) ++{ ++ return (((rgb.R >> 3) << 11) | ((rgb.G >> 2) << 5) | (rgb.B >> 3)); ++} ++ ++static unsigned char color_msb(unsigned int color) ++{ ++ return color >> 8; ++} ++ ++static unsigned char color_lsb(unsigned int color) ++{ ++ return color & 0xff; ++} ++ ++static void drv_TEW673GRU_hw_clear(const unsigned int color) ++{ ++ unsigned char cmd[TEW673GRU_CMD_SIZE]; ++ struct spi_ioc_transfer tr[1]; ++ ++ memset(tr, '\0', sizeof(tr)); ++ memset(cmd, '\0', sizeof(cmd)); ++ ++ cmd[0] = CMD_SCREEN_COLOR; ++ cmd[7] = color_msb(color); ++ cmd[8] = color_lsb(color); ++ ++ tr[0].tx_buf = (unsigned long) cmd; ++ tr[0].len = sizeof(cmd); ++ ++ drv_generic_spidev_transfer(1, tr); ++} ++ ++static void drv_TEW673GRU_hw_send_row(const int row, const int col, const char *data, const int width) ++{ ++ unsigned char cmd[TEW673GRU_CMD_SIZE]; ++ struct spi_ioc_transfer tr[2]; ++ int datasize; ++ ++ memset(tr, '\0', sizeof(tr)); ++ memset(cmd, '\0', sizeof(cmd)); ++ ++ datasize = width * TEW673GRU_BPP; ++ ++ cmd[0] = CMD_SHOW_IMAGE_DIR; ++ cmd[1] = col; ++ cmd[2] = col + width; ++ cmd[3] = row; ++ cmd[4] = row; ++ cmd[5] = datasize >> 8; ++ cmd[6] = datasize & 0xff; ++ ++ tr[0].tx_buf = (unsigned long) cmd; ++ tr[0].len = sizeof(cmd); ++ tr[1].tx_buf = (unsigned long) data; ++ tr[1].len = datasize; ++ ++ drv_generic_spidev_transfer(2, tr); ++} ++ ++static void drv_TEW673GRU_hw_write_string(const int row, const int col, const char *data, const int datasize) ++{ ++ unsigned char cmd[TEW673GRU_CMD_SIZE]; ++ struct spi_ioc_transfer tr[2]; ++ unsigned char len; ++ ++ memset(tr, '\0', sizeof(tr)); ++ memset(cmd, '\0', sizeof(cmd)); ++ ++ len = datasize & 0xff; ++ cmd[0] = CMD_SHOW_STRING; ++ cmd[1] = col; ++ cmd[2] = col + (XRES * len); ++ cmd[3] = row; ++ cmd[4] = row + YRES; ++ cmd[7] = 0; ++ cmd[8] = len; ++ ++ tr[0].tx_buf = (unsigned long) cmd; ++ tr[0].len = sizeof(cmd); ++ tr[1].tx_buf = (unsigned long) data; ++ tr[1].len = datasize; ++ ++ drv_generic_spidev_transfer(2, tr); ++} ++ ++static void drv_TEW673GRU_FB_set_pixel(const int col, const unsigned int color) ++{ ++ int pos; ++ ++ pos = col * TEW673GRU_BPP; ++ drv_TEW673GRU_FB[pos] = color_msb(color); ++ drv_TEW673GRU_FB[pos + 1] = color_lsb(color); ++} ++ ++static void drv_TEW673GRU_blit(const int row, const int col, const int height, const int width) ++{ ++ int r, c; ++ ++ debug("%s: update area r:%d c:%d w:%d h:%d", Name, row, col, height, width); ++ ++ for (r = row; r < row + height; r++) { ++ for (c = col; c < col + width; c++) { ++ unsigned int color; ++ RGBA rgb; ++ ++ rgb = drv_generic_graphic_rgb(r, c); ++ color = RGBAto16(rgb); ++ drv_TEW673GRU_FB_set_pixel(c, color); ++ } ++ ++ if (width) { ++ char *data; ++ ++ data = &drv_TEW673GRU_FB[col * TEW673GRU_BPP]; ++ drv_TEW673GRU_hw_send_row(r, col, data, width); ++ udelay(100 + width * 50); ++ } ++ } ++} ++ ++static void drv_TEW673GRU_clear(RGBA rgba) ++{ ++ unsigned int color; ++ ++ color = RGBAto16(rgba); ++ drv_TEW673GRU_hw_clear(color); ++} ++ ++static void drv_TEW673GRU_write(const int row, const int col, const char *data, const int len) ++{ ++ int i; ++ ++ for (i = 0; i < len; i++) { ++ drv_TEW673GRU_hw_write_string(row * YRES, (col + i) * XRES, " ", 1); ++ udelay(10000); ++ drv_TEW673GRU_hw_write_string(row * YRES, 2 + (col + i) * XRES, " ", 1); ++ udelay(10000); ++ drv_TEW673GRU_hw_write_string(row * YRES, (col + i) * XRES, &data[i], 1); ++ udelay(10000); ++ } ++} ++ ++static int drv_TEW673GRU_open(const char *section) ++{ ++ int err; ++ ++ err = drv_generic_spidev_open(section, Name); ++ if (err < 0) ++ return err; ++ ++ return 0; ++} ++ ++static int drv_TEW673GRU_close(void) ++{ ++ drv_generic_spidev_close(); ++ return 0; ++} ++ ++static void drv_TEW673GRU_clear_screen(void) ++{ ++ if (MODE) { ++ drv_generic_graphic_clear(); ++ } else { ++ memset(drv_TEW673GRU_FB, ' ', FB_SIZE); ++ drv_TEW673GRU_hw_clear(0x0000); ++ } ++} ++ ++static int drv_TEW673GRU_init_font(const char *section) ++{ ++ char *font; ++ int ret = -1; ++ ++ font = cfg_get(section, "Font", "6x8"); ++ if (font == NULL) { ++ error("%s: no '%s.Font' entry from %s", Name, section, cfg_source()); ++ goto out; ++ } ++ ++ if (*font == '\0') { ++ error("%s: invalid '%s.Font' entry in %s", Name, section, cfg_source()); ++ goto out_free; ++ } ++ ++ XRES = -1; ++ YRES = -1; ++ if (sscanf(font, "%dx%d", &XRES, &YRES) != 2 || ++ XRES < 1 || ++ YRES < 1) { ++ error("%s: bad Font '%s' from %s", Name, font, cfg_source()); ++ goto out_free; ++ } ++ ++ if (XRES != 6 && YRES != 8) { ++ error("%s: bad Font '%s' from %s (only 6x8 at the moment)", ++ Name, font, cfg_source()); ++ goto out_free; ++ } ++ ++ error("%s: font '%s' selected", Name, font); ++ ++ ret = 0; ++ ++out_free: ++ free(font); ++out: ++ return ret; ++} ++ ++static int drv_TEW673GRU_start(const char *section) ++{ ++ int ret; ++ ++ DCOLS = TEW673GRU_NUM_COLS; ++ DROWS = TEW673GRU_NUM_ROWS; ++ ++ if (MODE) { ++ ret = drv_TEW673GRU_init_font(section); ++ if (ret) ++ goto err; ++ ++ FB_SIZE = DCOLS * TEW673GRU_BPP; ++ } else { ++ XRES = 10; ++ YRES = 16; ++ DCOLS = DCOLS / XRES; ++ DROWS = DROWS / YRES; ++ ++ FB_SIZE = DCOLS * DROWS; ++ } ++ ++ if (FB_SIZE) { ++ drv_TEW673GRU_FB = malloc(FB_SIZE); ++ if (drv_TEW673GRU_FB == NULL) { ++ error("%s: framebuffer could not be allocated", Name); ++ goto err; ++ } ++ } ++ ++ ret = drv_TEW673GRU_open(section); ++ if (ret < 0) ++ goto err_free; ++ ++ if (MODE == 0) ++ drv_TEW673GRU_clear_screen(); ++ ++ return 0; ++ ++ err_free: ++ if (drv_TEW673GRU_FB) ++ free(drv_TEW673GRU_FB); ++ err: ++ return -1; ++} ++ ++static int drv_TEW673GRU_greet(const char *msg1, const char *msg2) ++{ ++ if (MODE) ++ return drv_generic_graphic_greet(msg1, msg2); ++ ++ return drv_generic_text_greet(msg1, msg2); ++} ++ ++ ++/****************************************/ ++/*** widget callbacks ***/ ++/****************************************/ ++ ++ ++/* using drv_generic_text_draw(W) */ ++/* using drv_generic_text_icon_draw(W) */ ++/* using drv_generic_text_bar_draw(W) */ ++/* using drv_generic_gpio_draw(W) */ ++ ++ ++/****************************************/ ++/*** exported functions ***/ ++/****************************************/ ++ ++int drv_TEW673GRU_list(void) ++{ ++ printf("TEW673GRU driver"); ++ return 0; ++} ++ ++int drv_TEW673GRU_init(const char *section, const int quiet) ++{ ++ WIDGET_CLASS wc; ++ int ret; ++ ++ cfg_number(section, "Mode", 0, 0, 1, &MODE); ++ ++ if (MODE) { ++ drv_generic_graphic_real_blit = drv_TEW673GRU_blit; ++ drv_generic_graphic_real_clear = drv_TEW673GRU_clear; ++ } else { ++ drv_generic_text_real_write = drv_TEW673GRU_write; ++ } ++ ++ ret = drv_TEW673GRU_start(section); ++ if (ret) ++ return ret; ++ ++ if (MODE) { ++ ret = drv_generic_graphic_init(section, Name); ++ if (ret) ++ return ret; ++ } else { ++ ret = drv_generic_text_init(section, Name); ++ if (ret) ++ return ret; ++ ++ ret = drv_generic_text_icon_init(); ++ if (ret != 0) ++ return ret; ++ ++ ret = drv_generic_text_bar_init(1); ++ if (ret != 0) ++ return ret; ++ ++ drv_generic_text_bar_add_segment(0, 0, 255, ' '); ++ drv_generic_text_bar_add_segment(255, 255, 255, '#'); ++ ++ wc = Widget_Text; ++ wc.draw = drv_generic_text_draw; ++ widget_register(&wc); ++ ++ wc = Widget_Icon; ++ wc.draw = drv_generic_text_icon_draw; ++ widget_register(&wc); ++ ++ wc = Widget_Bar; ++ wc.draw = drv_generic_text_bar_draw; ++ widget_register(&wc); ++ } ++ ++ if (!quiet) { ++ char buffer[40]; ++ qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); ++ drv_TEW673GRU_greet(buffer, "www.openwrt.org"); ++ sleep(3); ++ drv_TEW673GRU_clear_screen(); ++ } ++ ++ return 0; ++} ++ ++int drv_TEW673GRU_quit(const int quiet) ++{ ++ ++ info("%s: shutting down.", Name); ++ ++ drv_TEW673GRU_clear_screen(); ++ ++ if (!quiet) ++ drv_TEW673GRU_greet("goodbye!", NULL); ++ ++ if (MODE) ++ drv_generic_graphic_quit(); ++ else ++ drv_generic_text_quit(); ++ ++ debug("closing connection"); ++ drv_TEW673GRU_close(); ++ ++ return (0); ++} ++ ++DRIVER drv_TEW673GRU = { ++ .name = Name, ++ .list = drv_TEW673GRU_list, ++ .init = drv_TEW673GRU_init, ++ .quit = drv_TEW673GRU_quit, ++}; +--- a/lcd4linux.conf.sample ++++ b/lcd4linux.conf.sample +@@ -571,6 +571,11 @@ Display FutabaVFD { + } + } + ++Display TEW673GRU { ++ Driver 'TEW673GRU' ++ Font '6x8' ++ Port '/dev/spidev1.0' ++} + + #Plugin KVV { + # StationID '12_701' diff --git a/utils/lcdproc/Makefile b/utils/lcdproc/Makefile new file mode 100644 index 0000000..b69ba51 --- /dev/null +++ b/utils/lcdproc/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2007-2012 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:=lcdproc +PKG_VERSION:=0.5.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/lcdproc +PKG_MD5SUM:=4d075c3928e84a90bfccf07313b13721 + +include $(INCLUDE_DIR)/package.mk + + +define Package/lcdproc + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libusb +libncurses +libftdi + TITLE:=LCD Display daemon and client + URL:=http://sourceforge.net/projects/lcdproc/ +endef + +define Package/lcdproc/description + LCDProc is a daemon and client for displaying system information on various displays. +endef + +define Package/lcdproc/conffiles +/etc/LCDd.conf +/etc/lcdproc.conf +/etc/lcdexec.conf +/etc/lcdvc.conf +endef + +define Build/Configure + $(call Build/Configure/Default,--enable-drivers=all) +endef + +define Package/lcdproc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/lib/lcdproc + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/server/LCDd $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/clients/lcdproc/lcdproc $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/clients/lcdexec/lcdexec $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/clients/lcdvc/lcdvc $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/server/drivers/*.so $(1)/usr/lib/lcdproc/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/LCDd.conf $(1)/etc/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/clients/lcdproc/lcdproc.conf $(1)/etc/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/clients/lcdexec/lcdexec.conf $(1)/etc/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/clients/lcdvc/lcdvc.conf $(1)/etc/ + $(INSTALL_BIN) ./files/* $(1)/etc/init.d +endef + +$(eval $(call BuildPackage,lcdproc)) diff --git a/utils/lcdproc/files/LCDd b/utils/lcdproc/files/LCDd new file mode 100755 index 0000000..5bec7bc --- /dev/null +++ b/utils/lcdproc/files/LCDd @@ -0,0 +1,11 @@ +#!/bin/sh /etc/rc.common + +START=50 + +start() { + LCDd -c /etc/LCDd.conf +} + +stop() { + killall LCDd +} diff --git a/utils/lcdproc/files/lcdexec b/utils/lcdproc/files/lcdexec new file mode 100755 index 0000000..0d5a3f3 --- /dev/null +++ b/utils/lcdproc/files/lcdexec @@ -0,0 +1,11 @@ +#!/bin/sh /etc/rc.common. + +START=50 + +start() { + lcdexec -c /etc/lcdexec.conf +} + +stop() { + killall lcdexec +} diff --git a/utils/lcdproc/files/lcdproc b/utils/lcdproc/files/lcdproc new file mode 100755 index 0000000..eb86134 --- /dev/null +++ b/utils/lcdproc/files/lcdproc @@ -0,0 +1,11 @@ +#!/bin/sh /etc/rc.common. + +START=50 + +start() { + lcdproc -c /etc/lcdproc.conf +} + +stop() { + killall lcdproc +} diff --git a/utils/lcdproc/files/lcdvc b/utils/lcdproc/files/lcdvc new file mode 100755 index 0000000..026fd04 --- /dev/null +++ b/utils/lcdproc/files/lcdvc @@ -0,0 +1,11 @@ +#!/bin/sh /etc/rc.common. + +START=50 + +start() { + lcdvc -c /etc/lcdvc.conf +} + +stop() { + killall lcdvc +} diff --git a/utils/less/Makefile b/utils/less/Makefile new file mode 100644 index 0000000..2e9f3fa --- /dev/null +++ b/utils/less/Makefile @@ -0,0 +1,88 @@ +# +# Copyright (C) 2010-2012 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:=less +PKG_VERSION:=444 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.greenwoodsoftware.com/less +PKG_MD5SUM:=56f9f76ffe13f70155f47f6b3c87d421 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/less/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Pager program similar to more + URL:=http://www.greenwoodsoftware.com/less/ +endef + +define Package/less/Default/description + Full version of GNU less utility +endef + +define Package/less + $(call Package/less/Default) + DEPENDS:=+libncurses + VARIANT:=narrow +endef + +define Package/less/description + $(call Package/less/Default/description) +endef + +define Package/less-wide + $(call Package/less/Default) + TITLE+= (Unicode) + DEPENDS:=+libncursesw + VARIANT:=wide +endef + +define Package/less-wide/description + $(call Package/less/Default/description) + This package contains the Unicode enabled version of less. +endef + +ifeq ($(BUILD_VARIANT),narrow) + CONFIGURE_VARS += \ + ac_cv_lib_ncursesw_initscr=no +endif + +ifeq ($(BUILD_VARIANT),wide) + CONFIGURE_VARS += \ + ac_cv_lib_ncursesw_initscr=yes +endif + +define Package/less/install + $(INSTALL_DIR) $(1)/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/less $(1)/bin/less +endef + +define Package/less/postinst +#!/bin/sh +[ -L "$${IPKG_INSTROOT}/usr/bin/less" ] && rm -f "$${IPKG_INSTROOT}/usr/bin/less" +exit 0 +endef + +define Package/less/postrm +#!/bin/sh +/bin/busybox less -h 2>&1 | grep -q BusyBox && ln -sf ../../bin/busybox /usr/bin/less +exit 0 +endef + +Package/less-wide/install = $(Package/less/install) +Package/less-wide/postinst = $(Package/less/postinst) +Package/less-wide/postrm = $(Package/less/postrm) + +$(eval $(call BuildPackage,less)) +$(eval $(call BuildPackage,less-wide)) diff --git a/utils/lilo/Makefile b/utils/lilo/Makefile new file mode 100644 index 0000000..35f6da5 --- /dev/null +++ b/utils/lilo/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=lilo +PKG_VERSION:=22.8 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).src.tar.gz +PKG_SOURCE_URL:=ftp://metalab.unc.edu/pub/Linux/system/boot/lilo/ +PKG_MD5SUM:=72765f2aafd20e23ecf07ebd22baeec7 + +include $(INCLUDE_DIR)/package.mk + +define Package/lilo + SECTION:=base + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_x86 + TITLE:=lilo + URL:=ftp://metalab.unc.edu/pub/Linux/system/boot/lilo/ +endef + +define Package/lilo/conffiles +/etc/lilo.conf +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(HOSTCC) -m32" \ + alles +endef + +define Package/lilo/install + $(INSTALL_DIR) $(1)/sbin + $(CP) $(PKG_BUILD_DIR)/lilo.static $(1)/sbin/lilo + $(INSTALL_DIR) $(1)/etc + $(CP) ./files/lilo.conf $(1)/etc/ + $(CP) ./files/boot.msg $(1)/etc/ +endef + +$(foreach command, as86 ld86, \ + $(eval $(call RequireCommand,$(command), \ + $(PKG_NAME) requires $(command). \ + )) \ +) + +$(eval $(call BuildPackage,lilo)) + diff --git a/utils/lilo/files/README b/utils/lilo/files/README new file mode 100644 index 0000000..1315e8b --- /dev/null +++ b/utils/lilo/files/README @@ -0,0 +1,35 @@ +Using this package to create a bootable usb stick for openwrt. + +The status of this package is currently 'it works for me', and it will +require more effort before it's generic across the board. Currently +only tested to be working on x86-2.6 using an initramfs image. +My development environment for this is a via epia with a +serial console (no monitors or keyboards attached). + +To create the images that are bootable, configure your buildroot to include +the lilo package in the image, as well as e2fsprogs. Have it create an +ext2 file system as the target file system. Let it build the works. + +When the build is finished, you will need to run the script 'mkbootable' +located in the lilo package directory, it requires root privileges to +loop mount the fs for installing lilo. When it's done, you have an +8 meg ext2fs root file system ready to run. + +To use the image, dd it directly onto a usb stick. It should go onto +/dev/sda not /dev/sda1, it's assuming the stick is not partitioned. +When you boot the stick, you will get a lilo menu on the serial terminal. +The three options allow you to boot with the stick itself as the root file +system, or, to boot into a ramdisk, and not mount the stick at all. The +stick will likely show up at /dev/disc + +Boot the unit, and select the ramdisk. Once up in the ramdisk, you can +use the e2fstools to expand the image to fill the stick and add a journal +to use it as ext3. + +e2fsck -f /dev/disc +tune2fs -j /dev/disc +resize2fs /dev/disc + +Reboot the box, and, have fun with openwrt on your x86 using the usb +stick to boot and run from. + diff --git a/utils/lilo/files/bdlilo.conf b/utils/lilo/files/bdlilo.conf new file mode 100644 index 0000000..cbb26d6 --- /dev/null +++ b/utils/lilo/files/bdlilo.conf @@ -0,0 +1,30 @@ +serial=0,115200n8 +boot =/dev/loop1 +disk =/dev/loop1 + bios =0x80 + sectors =63 + heads =255 + cylinders =999 +lba32 +compact +install =mount/boot/boot.b +map =mount/boot/map + +prompt +delay =1 +timeout =100 +message =mount/etc/boot.msg + + +image =mount/vmlinuz + label =openwrt + append =" rootfs=/dev/discs/disc0/disc console=ttyS0,115200n81 " + +image =mount/vmlinuz + label =ramdisk + append =" console=ttyS0,115200n81" + +image =mount/vmlinuz + label =failsafe + append =" FAILSAFE=MenuRequest console=ttyS0,115200n81" + diff --git a/utils/lilo/files/boot.msg b/utils/lilo/files/boot.msg new file mode 100644 index 0000000..a7c5119 --- /dev/null +++ b/utils/lilo/files/boot.msg @@ -0,0 +1,7 @@ + +Boot Options:- + +openwrt - OpenWrt with usb stick root +ramdisk - OpenWrt with ramdisk root +failsafe - OpenWrt failsafe + diff --git a/utils/lilo/files/lilo.conf b/utils/lilo/files/lilo.conf new file mode 100644 index 0000000..d4a769e --- /dev/null +++ b/utils/lilo/files/lilo.conf @@ -0,0 +1,26 @@ +serial=0,115200n8 +disk=/dev/discs/disc0/disc +bios=0x80 +lba32 +compact +install =/boot/boot.b +map =/boot/map +backup =/dev/null +prompt +delay =1 +timeout =100 +message =/etc/boot.msg + +image =/vmlinuz + label =openwrt + append =" rootfs=/dev/discs/disc0/disc console=ttyS0,115200n81 " + +image =/vmlinuz + label =ramdisk + append =" console=ttyS0,115200n81" + +image =/vmlinuz + label =failsafe + append =" FAILSAFE=MenuRequest console=ttyS0,115200n81" + + diff --git a/utils/lilo/files/mkbootable b/utils/lilo/files/mkbootable new file mode 100755 index 0000000..30ea2f1 --- /dev/null +++ b/utils/lilo/files/mkbootable @@ -0,0 +1,15 @@ +#!/bin/sh +# Copyright (C) 2006 OpenWrt.org +LOOPDEV="/dev/loop1" + +mkdir mount +cp bin/openwrt-x86-ext2.img bin/boot.img +sudo losetup $LOOPDEV bin/boot.img +sudo mount $LOOPDEV mount +sudo cp build_i386/linux/arch/i386/boot/bzImage mount/vmlinuz +sudo mkdir mount/boot +sudo build_i386/lilo-22.8/lilo -C package/lilo/bdlilo.conf +sudo umount mount +echo releasing $LOOPDEV +sudo losetup -d $LOOPDEV +rm -r -f mount diff --git a/utils/lirc/Makefile b/utils/lirc/Makefile new file mode 100644 index 0000000..00273b7 --- /dev/null +++ b/utils/lirc/Makefile @@ -0,0 +1,142 @@ +# +# 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 +# we use the $LINUX_DIR variable, which is defined in kernel.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=lirc +PKG_VERSION:=0.8.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/${PKG_NAME} +PKG_MD5SUM:=fb1dcddbc8ca3d03c7f3a2d40cf28b71 + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/lirc/Default + SECTION:=utils + CATEGORY:=Utilities + URL:=http://lirc.org/ +endef + +define Package/lirc + $(call Package/lirc/Default) + TITLE:=LIRC - Linux Infrared Remote Control + MENU:=1 +endef + +define Package/lirc/description + LIRC is a package that allows you to decode and send + infra-red signals of many (but not all) commonly used + remote controls. + + This package contains only lircd and lircd.conf! + +tested drivers +-------------- +ok: +userspace,accent,act200l,act220l,adaptec,alsa_usb,animax,asusdh, +atilibusb,atiusb,audio_alsa,breakoutbox,bte,bw6130,cmdir,creative, +creative_infracd,devinput,digimatrix,dsp,dvico,ea65,exaudiohauppauge, +hauppauge_dvb,hercules_smarttv_stereo,i2cuser,igorplugusb,imon, +imon_24g,imon_knob,imon_pad,imon_rsc,irdeo,irdeo_remote,it87,knc_one, +leadtek_pvr2000,livedrive_midi,livedrive_seq,logitech,macmini,mceusb, +mceusb2,mediafocusI,mouseremote,mouseremote_ps2,mp3anywhere, +packard_bell,parallel,pcmak,pcmak_usb,pctv,pixelview_bt878,provideo, +realmagic,remotemaster,sasem,sb0540,serial,silitek,sir,streamzap,tekram, +tekram_bt829,tira,ttusbir,tuxbox,tvbox,udp,uirt2,uirt2_raw,usb_uirt_raw, +usbx,serial + +nok: +avermedia,avermedia_vdomate,avermedia98,bestbuy,bestbuy2,chronos,comX, +cph06x,flyvideo,gvbctv5pci,irreal,kworld,leadtek_0007,leadtek_0010,lptX, +nslu2,pixelview_pak,pixelview_pro,sa1100, + +unknown: +audio (no portaudio), caraca (no caraca package), iguanaIR (missing headers), +irman (no libirman) + +endef + + +define Package/lircdaemonadd + $(call Package/lirc/Default) + DEPENDS:=lirc + TITLE:=Daemon Additional Files +endef + +define Package/lircdaemonadd/description + Contains those additional daemon-tools: + -irrecord + -lircmd +endef + +define Package/lirctools + $(call Package/lirc/Default) + DEPENDS:=lirc + TITLE:=LIRC tools +endef + +define Package/lirctools/description + This package contains those lirc-tools: + -ircat: prints config strings to standard output, can be used to provide remote control input to scripts + -irexec: execute programs according to the pressed remote control buttons + -irpty: pseudo tty driver. Connects to lircd via socket to receive infra-red codes and converts them to key strokes + -irsend: application for sending IR-codes via lirc + -irw: watch the codes as lircd recognize them + -lircrcd: daemon that manages current mode for all applications + -mode2: shows the pulse/space length of a remote button +endef + +CONFIGURE_ARGS += \ + --disable-nls \ + --disable-static \ + --with-kerneldir="$(LINUX_DIR)" \ + --with-driver="mceusb" \ + --without-x \ + --with-pic \ + --with-gnu-ld \ + --enable-sandboxed + +define Package/lirc/conffiles +/etc/lircd.conf +endef + +MAKE_FLAGS += \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + SUBDIRS="daemons tools" + +define Package/lirc/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/daemons/lircd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/contrib/lircd.conf $(1)/etc/ +endef +#todo: +# $(CP) $(PKG_BUILD_DIR)/drivers/lirc_dev/lirc_dev.ko +# $(CP) $(PKG_BUILD_DIR)/drivers/lirc_mceusb2/lirc_mceusb2.ko +#depends on the selected module + +define Package/lircdaemonadd/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/daemons/{irrecord,lircmd} $(1)/usr/sbin/ +endef + +define Package/lirctools/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/irsend $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/irw $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/mode2 $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,lirc)) +$(eval $(call BuildPackage,lircdaemonadd)) +$(eval $(call BuildPackage,lirctools)) diff --git a/utils/lm-sensors/Makefile b/utils/lm-sensors/Makefile new file mode 100644 index 0000000..b9039d5 --- /dev/null +++ b/utils/lm-sensors/Makefile @@ -0,0 +1,112 @@ +# +# Copyright (C) 2006-2012 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:=lm-sensors +PKG_VERSION:=3.3.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=lm_sensors-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://dl.lm-sensors.org/lm-sensors/releases +PKG_MD5SUM:=f357ba00b080ab102a170f7bf8bb2578 + +PKG_BUILD_DIR:=$(BUILD_DIR)/lm_sensors-$(PKG_VERSION) +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/lm-sensors/Default + DEPENDS:=+sysfsutils + URL:=http://www.lm-sensors.org/ +endef + +define Package/lm-sensors + $(call Package/lm-sensors/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE:=lm-sensors + DEPENDS+=+libsensors +endef + +define Package/lm-sensors-detect + $(call Package/lm-sensors/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE:=lm-sensors-detect + DEPENDS+=+lm-sensors +perl +perlbase-essential +perlbase-fcntl +perlbase-file +perlbase-xsloader +endef + +define Package/libsensors + $(call Package/lm-sensors/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE:=libsensors +endef + +define Package/lm-sensors/description + utility to read hardware sensor data +endef + +define Package/lm-sensors-detect/description + script to autodetect sensor hardware +endef + +define Package/libsensors/description + lm-sensors libraries +endef + +define Package/lm-sensors/conffiles +/etc/sensors.conf +endef + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + KERNELVERSION="$(LINUX_VERSION)" \ + LINUX="$(LINUX_DIR)" \ + CC="$(TARGET_CC)" \ + STAGING_DIR="$(STAGING_DIR)" \ + PREFIX="/usr" \ + MACHINE="$(ARCH)" \ + EXLDFLAGS="" \ + user +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/sensors + $(CP) \ + $(PKG_BUILD_DIR)/lib/sensors.h \ + $(1)/usr/include/sensors + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_BUILD_DIR)/lib/libsensors.{a,so*} \ + $(1)/usr/lib +endef + +define Package/lm-sensors/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/prog/sensors/sensors $(1)/usr/sbin +ifeq ($(ARCH),i386) + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/sensors.conf $(1)/etc/sensors.conf +endif +endef + +define Package/lm-sensors-detect/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/prog/detect/sensors-detect $(1)/usr/sbin +endef + +define Package/libsensors/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_BUILD_DIR)/lib/libsensors.so* $(1)/usr/lib +endef + +$(eval $(call BuildPackage,lm-sensors)) +$(eval $(call BuildPackage,lm-sensors-detect)) +$(eval $(call BuildPackage,libsensors)) diff --git a/utils/lm-sensors/files/sensors.conf b/utils/lm-sensors/files/sensors.conf new file mode 100644 index 0000000..505b9d9 --- /dev/null +++ b/utils/lm-sensors/files/sensors.conf @@ -0,0 +1,117 @@ +chip "pc87366-*" + +# Soekris net4801 configuration + +# Written by Henrik Brix Andersen +# Latest version can be found at http://www.brixandersen.dk/ + +# The configuration is partly based on the PC87366 datasheet and +# partly borrowed from the env4801 utility by Poul-Henning +# Kamp + +# Datasheet: http://www.winbond.com/PDF/APCsheet/PC87366.pdf +# env4801: http://phk.freebsd.dk/soekris/env4801/ + + +# Voltage inputs + ignore vid + + # Unknown + # label in0 "avi0" + ignore in0 + + + # Core Voltage, +2.0V + label in1 "VCORE" + set in1_min 1.9 + set in1_max 2.1 + + + # VCC, +5.0V + label in2 "VCC" + compute in2 @*2, @/2 + + + # Power Supply Input, +6.0V - +28.0V + label in3 "VPWR" + compute in3 @*20.1, @/20.1 + set in3_min 6.0 + set in3_max 28.0 + + + # +12V + label in4 "+12V" + compute in4 @*4.83, @/4.83 + set in4_min 11 + set in4_max 13 + + + # -12V + label in5 "-12V" + # If in10 on your net4801 doesn't have the 3.3V reference, use this + # compute line instead: + # compute in5 (@-3.3)*19.2+3.3, (@-3.3)/19.2+3.3 + compute in5 (@-in10)*19.2+in10, (@-in10)/19.2+in10 + set in5_min -13 + set in5_max -11 + + + # GND, 0V + label in6 "GND" + set in6_min 0 + set in6_max 0 + + + # Standby Voltage, +3.3V + # Internally divided by 2 + label in7 "Vsb" + compute in7 @*2, @/2 + set in7_min 3.0 + set in7_max 3.6 + + + # Supply Voltage, +3.3V + # Internally divided by 2 + label in8 "Vdd" + compute in8 @*2, @/2 + set in8_min 3.0 + set in8_max 3.6 + + + # Battery Backup Supply Voltage, +3.0V + label in9 "Vbat" + set in9_min 2.4 + set in9_max 3.6 + + + # Analog Supply Voltage, +3.3V + # Internally divided by 2 + label in10 "AVdd" + compute in10 @*2, @/2 + set in10_min 3.0 + set in10_max 3.6 + + +# Temperature inputs + ignore temp1 + ignore temp2 + + # PC87366 Internal Temperature + # PC87366 Recommended Operating Conditions: 0 - 70C + # SC1100 Recommended Operating Conditions: 0 - 85C + label temp3 "Temp" + label temp3_crit "Critical" + set temp3_min 0 + set temp3_max 70 + set temp3_crit 85 + + + ignore temp4 + ignore temp5 + ignore temp6 + + +# Fan inputs + ignore fan1 + ignore fan2 + ignore fan3 diff --git a/utils/lmbench/Makefile b/utils/lmbench/Makefile new file mode 100644 index 0000000..91866a1 --- /dev/null +++ b/utils/lmbench/Makefile @@ -0,0 +1,122 @@ +# +# Copyright (C) 2012 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:=lmbench +PKG_VERSION:=3.0-a9 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/lmbench/ +PKG_MD5SUM:=b3351a3294db66a72e2864a199d37cbf + +PKG_BUILD_DEPENDS:=librpc + +include $(INCLUDE_DIR)/package.mk + +define Package/lmbench + SECTION:=utils + CATEGORY:=Utilities + TITLE:=lmbench microbenchmarks + URL:=http://sourceforge.net/projects/lmbench + MENU:=1 +endef + +define Package/lmbench/description + lmbench is a series of micro benchmarks intended to measure basic operating + system and hardware system metrics. +endef + +define Package/lmbench/install + true +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/src \ + CC="$(TARGET_CC)" \ + AR="$(TARGET_CROSS)ar" \ + OS="$(ARCH)" \ + BASE="$(PKG_INSTALL_DIR)" \ + LDLIBS="-lrpc" \ + COMPILE="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)" \ + lmbench install +endef + +define PartGen +define Package/lmbench-$(subst _,-,$(1)) + SECTION:=utils + CATEGORY:=Utilities + TITLE:=$(1) microbenchmark + URL:=http://sourceforge.net/projects/lmbench + DEPENDS:=lmbench +librpc +endef +endef + +define PartInstall +define Package/lmbench-$(subst _,-,$(1))/install + $(INSTALL_DIR) $$(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/$(1) $$(1)/usr/sbin/$(1) +endef +endef + +LMBENCH_FILES:= \ + bw_file_rd \ + bw_mem \ + bw_mmap_rd \ + bw_pipe \ + bw_tcp \ + bw_unix \ + cache \ + disk \ + enough \ + flushdisk \ + hello \ + lat_cmd \ + lat_connect \ + lat_ctx \ + lat_dram_page \ + lat_fcntl \ + lat_fifo \ + lat_fs \ + lat_http \ + lat_mem_rd \ + lat_mmap \ + lat_ops \ + lat_pagefault \ + lat_pipe \ + lat_pmake \ + lat_proc \ + lat_rand \ + lat_rpc \ + lat_select \ + lat_sem \ + lat_sig \ + lat_syscall \ + lat_tcp \ + lat_udp \ + lat_unix \ + lat_unix_connect \ + lat_usleep \ + line \ + lmdd \ + lmhttp \ + loop_o \ + memsize \ + mhz \ + msleep \ + par_mem \ + par_ops \ + stream \ + timing_o \ + tlb + +$(foreach file,$(LMBENCH_FILES),$(eval $(call PartGen,$(file)))) +$(foreach file,$(LMBENCH_FILES),$(eval $(call PartInstall,$(file)))) + +$(eval $(call BuildPackage,lmbench)) +$(foreach file,$(LMBENCH_FILES),$(eval $(call BuildPackage,lmbench-$(subst _,-,$(file))))) diff --git a/utils/lmbench/patches/001-fix_socklen_t_define.patch b/utils/lmbench/patches/001-fix_socklen_t_define.patch new file mode 100644 index 0000000..967e207 --- /dev/null +++ b/utils/lmbench/patches/001-fix_socklen_t_define.patch @@ -0,0 +1,11 @@ +--- a/src/bench.h ++++ b/src/bench.h +@@ -77,7 +77,7 @@ typedef long long int64; + #endif /* HAVE_int64_t */ + #endif /* HAVE_int64 */ + +-#ifndef HAVE_socklen_t ++#if (!defined(HAVE_socklen_t) && !defined(__socklen_t_defined)) + typedef int socklen_t; + #endif + diff --git a/utils/lmbench/patches/002-install-cache.patch b/utils/lmbench/patches/002-install-cache.patch new file mode 100644 index 0000000..89543b8 --- /dev/null +++ b/utils/lmbench/patches/002-install-cache.patch @@ -0,0 +1,10 @@ +--- a/src/Makefile ++++ b/src/Makefile +@@ -144,6 +144,7 @@ install-target: + if [ ! -d $(BASE)/include ]; then mkdir $(BASE)/include; fi + if [ ! -d $(BASE)/lib ]; then mkdir $(BASE)/lib; fi + cp $(EXES) $(BASE)/bin ++ cp $(OPT_EXES) $(BASE)/bin + cp $(INCS) $(BASE)/include + cp $O/lmbench.a $(BASE)/lib/libmbench.a + cd ../doc; env MAKEFLAGS="$(MAKEFLAGS)" make CC="${CC}" OS="${OS}" BASE="$(BASE)" install diff --git a/utils/lmbench/patches/003-add-LDLIBS.patch b/utils/lmbench/patches/003-add-LDLIBS.patch new file mode 100644 index 0000000..66a7243 --- /dev/null +++ b/utils/lmbench/patches/003-add-LDLIBS.patch @@ -0,0 +1,30 @@ +--- a/scripts/build ++++ b/scripts/build +@@ -18,7 +18,7 @@ done + + trap 'rm -f ${BASE}$$.s ${BASE}$$.c ${BASE}$$.o ${BASE}$$; exit 1' 1 2 15 + +-LDLIBS=-lm ++LDLIBS=${LDLIBS-"-lm -lrpc"} + + # check for HP-UX's ANSI compiler + echo "main(int ac, char *av[]) { int i; }" > ${BASE}$$.c +--- a/src/Makefile ++++ b/src/Makefile +@@ -38,6 +38,7 @@ CC=`../scripts/compiler` + MAKE=`../scripts/make` + AR=ar + ARCREATE=cr ++LDLIBS= + + # base of installation location + BASE=/usr/local +@@ -111,7 +112,7 @@ LIBOBJS= $O/lib_tcp.o $O/lib_udp.o $O/li + $O/lib_sched.o + + lmbench: $(UTILS) +- @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all ++ @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" LDLIBS="$(LDLIBS)" ../scripts/build all + -@env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="k$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt + + results: lmbench diff --git a/utils/lmbench/patches/100-bw_mem-add-newline-after-usage.patch b/utils/lmbench/patches/100-bw_mem-add-newline-after-usage.patch new file mode 100644 index 0000000..d03ad4a --- /dev/null +++ b/utils/lmbench/patches/100-bw_mem-add-newline-after-usage.patch @@ -0,0 +1,11 @@ +--- a/src/bw_mem.c ++++ b/src/bw_mem.c +@@ -65,7 +65,7 @@ main(int ac, char **av) + size_t nbytes; + state_t state; + int c; +- char *usage = "[-P ] [-W ] [-N ] what [conflict]\nwhat: rd wr rdwr cp fwr frd fcp bzero bcopy\n must be larger than 512"; ++ char *usage = "[-P ] [-W ] [-N ] what [conflict]\nwhat: rd wr rdwr cp fwr frd fcp bzero bcopy\n must be larger than 512\n"; + + state.overhead = 0; + diff --git a/utils/logrotate/Makefile b/utils/logrotate/Makefile new file mode 100644 index 0000000..9e62f56 --- /dev/null +++ b/utils/logrotate/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2006-2012 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:=logrotate +PKG_VERSION:=3.8.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:= \ + http://ftp.debian.org/debian/pool/main/l/logrotate \ + http://ftp.de.debian.org/debian/pool/main/l/logrotate \ + http://ftp.fr.debian.org/debian/pool/main/l/logrotate \ + http://ftp.us.debian.org/debian/pool/main/l/logrotate +PKG_MD5SUM:=bd2e20d8dc644291b08f9215397d28a5 + +include $(INCLUDE_DIR)/package.mk + +define Package/logrotate + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libpopt + TITLE:=rotates, compresses, and mails system logs + URL:=http://packages.debian.org/unstable/admin/logrotate +endef + +define Package/logrotate/description + logrotate is designed to ease administration of systems that generate large + numbers of log files. It allows auto-matic rotation, compression, removal and + mailing of log files. Each log file may be handled daily, weekly, monthly or + when it grows too large. +endef + +define Package/logrotate/conffiles +/etc/logrotate.conf +endef + +EXTRA_CFLAGS += $(TARGET_CPPFLAGS) +EXTRA_LDFLAGS += $(TARGET_LDFLAGS) + +define Build/Compile + $(call Build/Compile/Default, \ + RPM_OPT_FLAGS:="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \ + LDFLAGS="$(EXTRA_LDFLAGS)" \ + logrotate \ + ) +endef + +define Package/logrotate/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) ${PKG_BUILD_DIR}/logrotate $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/logrotate.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/logrotate.d +endef + +$(eval $(call BuildPackage,logrotate)) diff --git a/utils/logrotate/files/logrotate.conf b/utils/logrotate/files/logrotate.conf new file mode 100644 index 0000000..9a91db9 --- /dev/null +++ b/utils/logrotate/files/logrotate.conf @@ -0,0 +1,30 @@ +# rotate log files weekly +weekly +#daily + +# keep 4 weeks worth of backlogs +rotate 4 + +# create new (empty) log files after rotating old ones +create + +notifempty +nomail +#olddir /var/log/backup/ +missingok +#dateext + +# uncomment this if you want your log files compressed +#compress + +# packages can drop log rotation information into this directory +include /etc/logrotate.d + +# no packages own lastlog or wtmp -- we'll rotate them here +#/var/log/wtmp { +# monthly +# create 0664 root utmp +# rotate 1 +#} + +# system-specific logs may be also be configured here. diff --git a/utils/loop-aes/Makefile b/utils/loop-aes/Makefile new file mode 100644 index 0000000..5e23601 --- /dev/null +++ b/utils/loop-aes/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2007-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=loop-aes +PKG_VERSION:=3.6e +PKG_RELEASE:=1 + +PKG_SOURCE:=loop-AES-v$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=b8bf83f3d21a6ad1ea49ac30f9ec130d + +PKG_BUILD_DIR:=$(BUILD_DIR)/loop-AES-v$(PKG_VERSION) +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/loop-aes + SUBMENU:=Cryptographic API modules + DEPENDS:=@!PACKAGE_kmod-loop + TITLE:=loopback module with built-in AES + FILES:=$(PKG_BUILD_DIR)/loop.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,30,loop) + URL:=http://loop-aes.sourceforge.net +endef + +define KernelPackage/loop-aes/description + This package provides loadable Linux kernel module (loop.o or loop.ko on 2.6 + kernels) that has AES cipher built-in. The AES cipher can be used to encrypt + local file systems and disk partitions. +endef + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + CC="$(TARGET_CC)" \ + CPP="$(TARGET_CC)" \ + LD="$(TARGET_CROSS)ld" \ + LINUX_SOURCE="$(LINUX_DIR)" \ + KR="$(LINUX_DIR)" \ + MODINST="n" \ + all +endef + +$(eval $(call KernelPackage,loop-aes)) diff --git a/utils/loop-aes/patches/001-no_sync.patch b/utils/loop-aes/patches/001-no_sync.patch new file mode 100644 index 0000000..e01b9b2 --- /dev/null +++ b/utils/loop-aes/patches/001-no_sync.patch @@ -0,0 +1,13 @@ +--- a/Makefile ++++ b/Makefile +@@ -208,10 +208,8 @@ endif + ifeq ($(EXTRA_CIPHERS),y) + ln -s tmp-d-kbuild/loop_twofish.ko tmp-d-kbuild/loop_serpent.ko tmp-d-kbuild/loop_blowfish.ko . + endif +- sync + else + cd $(LS) && make SUBDIRS=$(TD) modules +- sync + endif + + # 2.6 kernels older than 2.6.17 do not run depmod in "modules_install" stage, diff --git a/utils/lrzsz/Makefile b/utils/lrzsz/Makefile new file mode 100644 index 0000000..6ca2083 --- /dev/null +++ b/utils/lrzsz/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2006-2011 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:=lrzsz +PKG_VERSION:=0.12.20 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.ohse.de/uwe/releases/ +PKG_MD5SUM:=b5ce6a74abc9b9eb2af94dffdfd372a4 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/lrzsz + SECTION:=utils + CATEGORY:=Utilities + TITLE:=X,Y and Z-modem protocols + URL:=http://www.ohse.de/uwe/software/lrzsz.html +endef + +define Package/lrzsz/description + Transfer files in your login sessions. + Very leightweight and straight forward. + You just need a terminal client that can do + either X, Y or Z-modem file transfers. +endef + +# uses GNU configure + +define Package/lrzsz/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lrz $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lsz $(1)/usr/bin/ + (cd $(1)/usr/bin; \ + ln -fs lrz lrx; \ + ln -fs lrz lrb; \ + ln -fs lrz rz; \ + ln -fs lrz rx; \ + ln -fs lrz rb; \ + ln -fs lsz lsx; \ + ln -fs lsz lsb; \ + ln -fs lsz sz; \ + ln -fs lsz sx; \ + ln -fs lsz sb; \ + ); +endef + +$(eval $(call BuildPackage,lrzsz)) diff --git a/utils/lrzsz/patches/100-install_delete_fix.patch b/utils/lrzsz/patches/100-install_delete_fix.patch new file mode 100644 index 0000000..edd0e89 --- /dev/null +++ b/utils/lrzsz/patches/100-install_delete_fix.patch @@ -0,0 +1,20 @@ +diff -ur lrzsz.old/src/Makefile.in lrzsz.dev/src/Makefile.in +--- lrzsz.old/src/Makefile.in 1998-12-30 17:31:46.000000000 +0100 ++++ lrzsz.dev/src/Makefile.in 2006-08-20 19:10:09.000000000 +0200 +@@ -372,13 +372,13 @@ + rm -f $(DESTDIR)/$(bindir)/`echo lsb | sed -e '$(transform)'` + ln $(DESTDIR)/$(bindir)/`echo lsz |sed -e '$(transform)'` \ + $(DESTDIR)/$(bindir)/`echo lsb |sed -e '$(transform)'` +- rm -f $(bindir)/`echo lsx | sed -e '$(transform)'` ++ rm -f $(DESTDIR)/$(bindir)/`echo lsx | sed -e '$(transform)'` + ln $(DESTDIR)/$(bindir)/`echo lsz |sed -e '$(transform)'` \ + $(DESTDIR)/$(bindir)/`echo lsx |sed -e '$(transform)'` +- rm -f $(bindir)/`echo lrb | sed -e '$(transform)'` ++ rm -f $(DESTDIR)/$(bindir)/`echo lrb | sed -e '$(transform)'` + ln $(DESTDIR)/$(bindir)/`echo lrz |sed -e '$(transform)'` \ + $(DESTDIR)/$(bindir)/`echo lrb |sed -e '$(transform)'` +- rm -f $(bindir)/`echo lrx | sed -e '$(transform)'` ++ rm -f $(DESTDIR)/$(bindir)/`echo lrx | sed -e '$(transform)'` + ln $(DESTDIR)/$(bindir)/`echo lrz |sed -e '$(transform)'` \ + $(DESTDIR)/$(bindir)/`echo lrx |sed -e '$(transform)'` + # rm -f $(bindir)/`echo lrzszbug | sed -e '$(transform)'` diff --git a/utils/lsof/Makefile b/utils/lsof/Makefile new file mode 100644 index 0000000..bcf6b80 --- /dev/null +++ b/utils/lsof/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2007-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=lsof +PKG_VERSION:=4.86 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION)+dfsg.orig.tar.gz +PKG_SOURCE_URL:=http://ftp2.de.debian.org/debian/pool/main/l/lsof +PKG_MD5SUM:=23420509564a897b76055f9d84d19068 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)+dfsg.orig + +include $(INCLUDE_DIR)/package.mk + +TARGET_LDFLAGS += $(LIBRPC) + +define Package/lsof + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=$(LIBRPC_DEPENDS) + TITLE:=LiSt Open Files - a diagnostic tool + URL:=http://people.freebsd.org/~abe/ +endef + +define Build/Configure + cd $(PKG_BUILD_DIR); \ + LINUX_CLIB="-DGLIBCV=2" \ + LSOF_CC="$(TARGET_CC)" \ + LSOF_INCLUDE="-I$(STAGING_DIR)/usr/include" \ + LSOF_VSTR="$(LINUX_VERSION)" \ + LSOF_CFGC="$(TARGET_CFLAGS)" \ + LSOF_CFGL="$(TARGET_LDFLAGS)" \ + LSOF_AR="$(TARGET_CROSS)ar cr" \ + LSOF_RANLIB="$(TARGET_CROSS)ranlib" \ + ./Configure -n linux +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +define Package/lsof/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lsof $(1)/usr/bin +endef + +$(eval $(call BuildPackage,lsof)) diff --git a/utils/lsof/patches/001-lsof_makefile.patch b/utils/lsof/patches/001-lsof_makefile.patch new file mode 100644 index 0000000..eb2b735 --- /dev/null +++ b/utils/lsof/patches/001-lsof_makefile.patch @@ -0,0 +1,13 @@ +--- a/lib/Makefile.skel ++++ b/lib/Makefile.skel +@@ -21,8 +21,8 @@ OBJ= ckkv.o cvfs.o dvch.o fino.o isfn.o + all: ${LIB} + + ${LIB}: ${OBJ} +- ${AR} +- ${RANLIB} ++ ${AR} ${LIB} ${OBJ} ++ ${RANLIB} ${LIB} + + clean: FRC + rm -f ${LIB} ${OBJ} errs Makefile.bak a.out core diff --git a/utils/lsof/patches/002-lsof_noportmap.patch b/utils/lsof/patches/002-lsof_noportmap.patch new file mode 100644 index 0000000..d0e8889 --- /dev/null +++ b/utils/lsof/patches/002-lsof_noportmap.patch @@ -0,0 +1,18 @@ +--- a/print.c ++++ b/print.c +@@ -161,6 +161,7 @@ endnm(sz) + static void + fill_portmap() + { ++#if !defined __UCLIBC__ || (defined __UCLIBC__ && defined __UCLIBC_HAS_RPC__) + char buf[128], *cp, *nm; + CLIENT *c; + int h, port, pr; +@@ -279,6 +280,7 @@ fill_portmap() + Pth[pr][h] = pt; + } + clnt_destroy(c); ++#endif + } + #endif /* !defined(HASNORPC_H) */ + diff --git a/utils/lsof/patches/003-lsof_selinux.patch b/utils/lsof/patches/003-lsof_selinux.patch new file mode 100644 index 0000000..c74c1e3 --- /dev/null +++ b/utils/lsof/patches/003-lsof_selinux.patch @@ -0,0 +1,11 @@ +--- a/Configure ++++ b/Configure +@@ -2806,7 +2806,7 @@ return(0); } + LSOF_TMP1=1 + fi # } + fi # } +- if test $LSOF_TMP1 -eq 1 # { ++ if test 0 -eq 1 # { + then + LSOF_CFGF="$LSOF_CFGF -DHASSELINUX" + LSOF_CFGL="$LSOF_CFGL -lselinux" diff --git a/utils/lsof/patches/004-lsof_ccv.patch b/utils/lsof/patches/004-lsof_ccv.patch new file mode 100644 index 0000000..8f1867d --- /dev/null +++ b/utils/lsof/patches/004-lsof_ccv.patch @@ -0,0 +1,12 @@ +--- a/Configure ++++ b/Configure +@@ -2682,6 +2682,9 @@ LOCKF_OWNER4 + if test "X$LSOF_CC" = "X" # { + then + LSOF_CC=cc ++ fi # } ++ if test "X$LSOF_CCV" = "X" # { ++ then + LSOF_CCV=`$LSOF_CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'` + fi # } + if test "X$LINUX_CONF_CC" = "X" # { diff --git a/utils/lvm2/Makefile b/utils/lvm2/Makefile new file mode 100644 index 0000000..ba93e89 --- /dev/null +++ b/utils/lvm2/Makefile @@ -0,0 +1,87 @@ +# +# Copyright (C) 2009-2010 Stefan Monnier +# Copyright (C) 2011-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v3+. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=LVM2 +PKG_VERSION:=2.02.96 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz +PKG_SOURCE_URL:=ftp://sources.redhat.com/pub/lvm2 +PKG_MD5SUM:=4637503d792e9ee35a9b71387bcd8a93 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/libdevmapper + SECTION:=libs + CATEGORY:=Libraries + TITLE:=The Linux Kernel Device Mapper userspace library + URL:=http://sourceware.org/dm/ + DEPENDS:=+kmod-dm +endef + +define Package/libdevmapper/description + The device-mapper is a component of the 2.6 linux kernel that supports logical + volume management. It is required by LVM2 and EVMS. +endef + +define Package/lvm2 + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=disc + TITLE:=The Linux Logical Volume Manager + URL:=http://sourceware.org/lvm2/ + DEPENDS:=+libdevmapper +libreadline +libncurses +endef + +define Package/lvm2/description + LVM2 refers to a new userspace toolset that provide logical volume management + facilities on linux. It is reasonably backwards-compatible with the original + LVM toolset. +endef + +CONFIGURE_ARGS += --disable-o_direct + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libdevmapper.h $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so* $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_BUILD_DIR)/libdm/libdevmapper.pc $(1)/usr/lib/pkgconfig +endef + +define Package/libdevmapper/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so.* $(1)/usr/lib +endef + +define Package/lvm2/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/lvm $(1)/sbin + $(INSTALL_DIR) $(1)/etc/lvm + $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/example.conf $(1)/etc/lvm/lvm.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/lvm2.init $(1)/etc/init.d/lvm2 +endef + +define Package/lvm2/conffiles +/etc/lvm/lvm.conf +endef + +$(eval $(call BuildPackage,libdevmapper)) +$(eval $(call BuildPackage,lvm2)) diff --git a/utils/lvm2/files/lvm2.init b/utils/lvm2/files/lvm2.init new file mode 100644 index 0000000..3b542d0 --- /dev/null +++ b/utils/lvm2/files/lvm2.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009 Stefan Monnier +START=15 + +start () { + /sbin/lvm vgscan --ignorelockingfailure --mknodes || : + /sbin/lvm vgchange -aly --ignorelockingfailure || return 2 +} + +stop () { + /sbin/lvm vgchange -aln --ignorelockingfailure || return 2 +} diff --git a/utils/lvm2/patches/000-compile.patch b/utils/lvm2/patches/000-compile.patch new file mode 100644 index 0000000..ec22983 --- /dev/null +++ b/utils/lvm2/patches/000-compile.patch @@ -0,0 +1,11 @@ +--- a/make.tmpl.in ++++ b/make.tmpl.in +@@ -17,7 +17,7 @@ SHELL = /bin/sh + + @SET_MAKE@ + +-CC ?= @CC@ ++CC = @CC@ + RANLIB = @RANLIB@ + INSTALL = @INSTALL@ + MKDIR_P = @MKDIR_P@ diff --git a/utils/macchanger/Makefile b/utils/macchanger/Makefile new file mode 100644 index 0000000..acd3bc9 --- /dev/null +++ b/utils/macchanger/Makefile @@ -0,0 +1,41 @@ +# +# 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:=macchanger +PKG_VERSION:=1.5.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/macchanger +PKG_MD5SUM:=79b7cdaeca3d8ebafa764c4b0dd03ab7 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/macchanger + SECTION:=utils + CATEGORY:=Utilities + TITLE:=utility for viewing/manipulating the MAC address + URL:=http://www.alobbs.com/macchanger +endef + +define Package/macchanger/description + This is a GNU/Linux utility for viewing/manipulating the MAC address + of network interfaces. +endef + +define Package/macchanger/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/macchanger $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/macchanger $(1)/usr/share/ +endef + +$(eval $(call BuildPackage,macchanger)) diff --git a/utils/maemo-kexec/Config.in b/utils/maemo-kexec/Config.in new file mode 100644 index 0000000..74c8c86 --- /dev/null +++ b/utils/maemo-kexec/Config.in @@ -0,0 +1,20 @@ +config MAEMO_KEXEC_DOWNLOAD_KERNEL + bool "Download latest Maemo kernel" + default y + depends on PACKAGE_maemo-kexec + +config MAEMO_KEXEC_KERNEL_PATH + string + prompt "Path to the Maemo kernel image" + default "PLEASE_CONFIGURE_MAEMO_ZIMAGE" + depends on PACKAGE_maemo-kexec && !MAEMO_KEXEC_DOWNLOAD_KERNEL + help + Defines the path to the Maemo kernel zImage. + + The image can be extracted from the Fiasco firmware image. + Use the proprietary flasher to extract the image. The + opensource tool "0xFFFF" is not able to extract the zImage correctly. + + The zImage defined here will be included in the OpenWrt rootfs + for kexec-ing of the Maemo operating system. The Maemo rootfs + has to be installed on the n810's "rootfs" MTD partition (MTD4). diff --git a/utils/maemo-kexec/Makefile b/utils/maemo-kexec/Makefile new file mode 100644 index 0000000..3f31c97 --- /dev/null +++ b/utils/maemo-kexec/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=maemo-kexec +PKG_VERSION:=1.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=maemo-rx44-2008.43-7.kernel +PKG_SOURCE_URL:=http://bu3sch.de/misc/ +PKG_MD5SUM:=3cbf571c0618bfe20a69babab6b33bea +UNPACK_CMD=$(CP) $(DL_DIR)/$(PKG_SOURCE) $(PKG_BUILD_DIR)/ + +PKG_CONFIG_DEPENDS:= \ + CONFIG_MAEMO_KEXEC_DOWNLOAD_KERNEL \ + CONFIG_MAEMO_KEXEC_KERNEL_PATH + +include $(INCLUDE_DIR)/package.mk + +define Package/maemo-kexec + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=@TARGET_omap24xx +kexec-tools + TITLE:=Kexec Maemo from OpenWRT +endef + +define Package/maemo-kexec/description + Kexec Maemo from OpenWRT. + The Maemo rootfs must be in the rootfs MTD partition. +endef + +define Package/maemo-kexec/config + source "$(SOURCE)/Config.in" +endef + +define Build/Configure +endef + +define Build/Compile +endef + +MAEMO_KRNL_SRC:=$(if $(CONFIG_MAEMO_KEXEC_DOWNLOAD_KERNEL),\ + $(PKG_BUILD_DIR)/$(PKG_SOURCE),\ + $(CONFIG_MAEMO_KEXEC_KERNEL_PATH)) + +define Package/maemo-kexec/install + $(INSTALL_DIR) $(1)/boot $(1)/sbin + $(INSTALL_BIN) ./files/sbin/bootmaemo $(1)/sbin/ + $(INSTALL_DATA) $(MAEMO_KRNL_SRC) $(1)/boot/maemo.zImage +endef + +$(eval $(call BuildPackage,maemo-kexec)) diff --git a/utils/maemo-kexec/files/sbin/bootmaemo b/utils/maemo-kexec/files/sbin/bootmaemo new file mode 100755 index 0000000..14f85b1 --- /dev/null +++ b/utils/maemo-kexec/files/sbin/bootmaemo @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +sync + +killall -q watchdog || true +echo 1 >/dev/watchdog + +/usr/sbin/kexec --load /boot/maemo.zImage --append "root=1f03 rootfstype=jffs2 ro console=tty0 console=ttyMTD5" +/usr/sbin/kexec --exec diff --git a/utils/mc/Config.in b/utils/mc/Config.in new file mode 100644 index 0000000..7d6abf8 --- /dev/null +++ b/utils/mc/Config.in @@ -0,0 +1,20 @@ +menu "Configuration" + depends on PACKAGE_mc + +config MC_DIFF_VIEWER + bool "Compile with diff viewer" + default n + +config MC_EDITOR + bool "Enable internal editor" + default n + +config MC_SUBSHELL + bool "Compile in concurrent subshell" + default n + +config MC_DISABLE_VFS + bool "Disable VFS" + default y + +endmenu diff --git a/utils/mc/Makefile b/utils/mc/Makefile new file mode 100644 index 0000000..41e35be --- /dev/null +++ b/utils/mc/Makefile @@ -0,0 +1,96 @@ +# +# Copyright (C) 2006-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mc +PKG_VERSION:=4.7.5.3 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.midnight-commander.org/downloads/ +PKG_MD5SUM:=6a67e139e0032d8a871455a80d490941 + +PKG_BUILD_PARALLEL:=1 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/mc + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+glib2 +libncurses $(LIBRPC_DEPENDS) $(ICONV_DEPENDS) + TITLE:=midnight commander - a powerful file manager + URL:=http://www.midnight-commander.org/ + SUBMENU:=filemanager + MAINTAINER:=Luka Perkov + MENU:=1 +endef + +define Package/mc/config + source "$(SOURCE)/Config.in" +endef + +define Package/mc/description + GNU Midnight Commander is a visual file manager, licensed under GNU General + Public License and therefore qualifies as Free Software. It's a feature rich + full-screen text mode application that allows you to copy, move and delete + files and whole directory trees, search for files and run commands in the + subshell. +endef + +CONFIGURE_ARGS += \ + --enable-utf8 \ + --disable-doxygen-doc \ + --with-screen=ncurses \ + --without-gpm-mouse \ + --without-x \ + ac_cv_search_addwstr=no + +ifeq ($(CONFIG_MC_DIFF_VIEWER),n) +CONFIGURE_ARGS += \ + --without-diff-viewer +endif + +ifeq ($(CONFIG_MC_EDITOR),n) +CONFIGURE_ARGS += \ + --without-edit +endif + +ifeq ($(CONFIG_MC_SUBSHELL),n) +CONFIGURE_ARGS += \ + --without-subshell +endif + +ifeq ($(CONFIG_MC_DISABLE_VFS),y) +CONFIGURE_ARGS += \ + --without-vfs +endif + +define Package/mc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mc $(1)/usr/bin + $(INSTALL_DIR) $(1)/etc/mc +ifeq ($(CONFIG_MC_DIFF_VIEWER),y) + ln -sf mc $(1)/usr/bin/mcdiff +endif +ifeq ($(CONFIG_MC_EDITOR),y) + ln -sf mc $(1)/usr/bin/mcedit +endif + $(INSTALL_DATA) $(PKG_BUILD_DIR)/misc/mc.menu $(1)/etc/mc + $(INSTALL_DIR) $(1)/etc/mc/skins + $(INSTALL_DATA) $(PKG_BUILD_DIR)/misc/skins/default.ini $(1)/etc/mc/skins + $(INSTALL_DIR) $(1)/root/.mc/cedit/Syntax +endef + +define Package/mc/conffiles +/etc/mc/mc.menu +/etc/mc/skins/default.ini +endef + +$(eval $(call BuildPackage,mc)) diff --git a/utils/md5deep/Makefile b/utils/md5deep/Makefile new file mode 100644 index 0000000..b868ae7 --- /dev/null +++ b/utils/md5deep/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2011 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:=md5deep +PKG_VERSION:=3.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=d103b738721c54a9bf535470b63d49dc + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/md5deep + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A program to compute, match and audit hashsets + URL:=http://md5deep.sourceforge.net/ +endef + +define Package/md5deep/description + md5deep is a set of programs to compute MD5, SHA-1, SHA-256, Tiger, or + Whirlpool message digests on an arbitrary number of files. +endef + +define Package/md5deep/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/{hash,md5,sha1,sha256,tiger,whirlpool}deep $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,md5deep)) diff --git a/utils/md5deep/patches/101-cross_compile.patch b/utils/md5deep/patches/101-cross_compile.patch new file mode 100644 index 0000000..540ba4c --- /dev/null +++ b/utils/md5deep/patches/101-cross_compile.patch @@ -0,0 +1,20 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -19,17 +19,6 @@ AC_PROG_INSTALL + AC_CONFIG_FILES([Makefile hashdeep/Makefile md5deep/Makefile]) + AM_CONFIG_HEADER([config.h]) + +-# Bring additional directories where things might be found into our +-# search path. I don't know why autoconf doesn't do this by default +-for spfx in /usr/local /opt/local /sw ; do +- echo checking ${spfx}/include +- if test -d ${spfx}/include; then +- CFLAGS="-I${spfx}/include $CFLAGS" +- CPPFLAGS="-I${spfx}/include $CPPFLAGS" +- LDFLAGS="-L${spfx}/lib $LDFLAGS" +- fi +-done +- + # Checks for header files. + AC_HEADER_DIRENT + AC_HEADER_STDC diff --git a/utils/mdadm/Makefile b/utils/mdadm/Makefile new file mode 100644 index 0000000..89615b4 --- /dev/null +++ b/utils/mdadm/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2008-2012 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:=mdadm +PKG_VERSION:=3.2.5 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=@KERNEL/linux/utils/raid/mdadm +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_MD5SUM:=2fd33dedcdb06f0d1461f50ddabb7e4a + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/mdadm + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A tool for managing Soft RAID under Linux + URL:=http://www.kernel.org/pub/linux/utils/raid/mdadm/ +endef + +define Package/mdadm/description + A tool for managing Linux Software RAID arrays. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -DHAVE_STDINT_H" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + mdadm mdassemble +endef + +define Package/mdadm/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mdadm $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mdassemble $(1)/sbin +endef + +$(eval $(call BuildPackage,mdadm)) diff --git a/utils/mdadm/patches/000-compile.patch b/utils/mdadm/patches/000-compile.patch new file mode 100644 index 0000000..6d47489 --- /dev/null +++ b/utils/mdadm/patches/000-compile.patch @@ -0,0 +1,11 @@ +--- a/sha1.h ++++ b/sha1.h +@@ -26,8 +26,6 @@ + # include + #endif + +-#include "ansidecl.h" +- + /* The following contortions are an attempt to use the C preprocessor + to determine an unsigned integral type that is 32 bits wide. An + alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but diff --git a/utils/mdadm/patches/100-cross_compile.patch b/utils/mdadm/patches/100-cross_compile.patch new file mode 100644 index 0000000..8709e57 --- /dev/null +++ b/utils/mdadm/patches/100-cross_compile.patch @@ -0,0 +1,19 @@ +--- a/Makefile ++++ b/Makefile +@@ -76,7 +76,6 @@ FAILED_SLOTS_DIR = /run/mdadm/failed-slo + DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\" + DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\" + DIRFLAGS += -DFAILED_SLOTS_DIR=\"$(FAILED_SLOTS_DIR)\" +-CFLAGS = $(CWFLAGS) $(CXFLAGS) -DSendmail=\""$(MAILCMD)"\" $(CONFFILEFLAGS) $(DIRFLAGS) + + # The glibc TLS ABI requires applications that call clone(2) to set up + # TLS data structures, use pthreads until mdmon implements this support +@@ -183,7 +182,7 @@ raid6check : raid6check.o mdadm.h $(CHEC + + mdassemble : $(ASSEMBLE_SRCS) $(INCL) + rm -f $(OBJS) +- $(DIET_GCC) $(ASSEMBLE_FLAGS) -o mdassemble $(ASSEMBLE_SRCS) $(STATICSRC) ++ $(CC) $(ASSEMBLE_FLAGS) -o mdassemble $(ASSEMBLE_SRCS) $(STATICSRC) + + mdassemble.static : $(ASSEMBLE_SRCS) $(INCL) + rm -f $(OBJS) diff --git a/utils/memtester/Makefile b/utils/memtester/Makefile new file mode 100644 index 0000000..132ada2 --- /dev/null +++ b/utils/memtester/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=memtester +PKG_VERSION:=4.1.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://pyropus.ca/software/memtester/old-versions/ +PKG_MD5SUM:=e562451620cf5343016950462bc0dc38 + +include $(INCLUDE_DIR)/package.mk + +define Package/memtester + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Userspace utility for testing the memory subsystem for faults + URL:=http://pyropus.ca/software/memtester/ +endef + +define Package/memtester/description + A userspace utility for testing the memory subsystem for faults. +endef + +define Build/Configure + $(SED) 's,cc -O2,$(TARGET_CC) $(TARGET_CFLAGS),' $(PKG_BUILD_DIR)/conf-cc + $(SED) "s,cc,$(TARGET_CC)," $(PKG_BUILD_DIR)/conf-ld +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) all +endef + +define Package/memtester/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/memtester $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,memtester)) diff --git a/utils/memtester/patches/100-quiet.diff b/utils/memtester/patches/100-quiet.diff new file mode 100644 index 0000000..93661a9 --- /dev/null +++ b/utils/memtester/patches/100-quiet.diff @@ -0,0 +1,331 @@ +--- a/memtester.c ++++ b/memtester.c +@@ -123,7 +123,7 @@ int main(int argc, char **argv) { + pagesizemask = (ptrdiff_t) ~(pagesize - 1); + printf("pagesizemask is 0x%tx\n", pagesizemask); + +- while ((opt = getopt(argc, argv, "p:")) != -1) { ++ while ((opt = getopt(argc, argv, "qp:")) != -1) { + switch (opt) { + case 'p': + errno = 0; +@@ -150,6 +150,9 @@ int main(int argc, char **argv) { + /* okay, got address */ + use_phys = 1; + break; ++ case 'q': ++ quiet = 1; ++ break; + default: /* '?' */ + usage(argv[0]); /* doesn't return */ + } +--- a/tests.c ++++ b/tests.c +@@ -17,12 +17,23 @@ + #include + #include + #include ++#include + + #include "types.h" + #include "sizes.h" + #include "memtester.h" + ++int quiet = 0; + char progress[] = "-\\|/"; ++ ++void inline __dprintf(const char *format, ...) { ++ if(!quiet) { ++ va_list ap; ++ va_start(ap, format); ++ vprintf(format, ap); ++ } ++} ++ + #define PROGRESSLEN 4 + #define PROGRESSOFTEN 2500 + #define ONE 0x00000001L +@@ -65,16 +76,16 @@ int test_stuck_address(ulv *bufa, size_t + printf(" "); + fflush(stdout); + for (j = 0; j < 16; j++) { +- printf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); + p1 = (ulv *) bufa; +- printf("setting %3u", j); ++ __dprintf("setting %3u", j); + fflush(stdout); + for (i = 0; i < count; i++) { + *p1 = ((j + i) % 2) == 0 ? (ul) p1 : ~((ul) p1); + *p1++; + } +- printf("\b\b\b\b\b\b\b\b\b\b\b"); +- printf("testing %3u", j); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("testing %3u", j); + fflush(stdout); + p1 = (ulv *) bufa; + for (i = 0; i < count; i++, p1++) { +@@ -97,7 +108,7 @@ int test_stuck_address(ulv *bufa, size_t + } + } + } +- printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); + fflush(stdout); + return 0; + } +@@ -112,13 +123,13 @@ int test_random_value(ulv *bufa, ulv *bu + fflush(stdout); + for (i = 0; i < count; i++) { + *p1++ = *p2++ = rand_ul(); +- if (!(i % PROGRESSOFTEN)) { ++ if (!quiet && !(i % PROGRESSOFTEN)) { + putchar('\b'); + putchar(progress[++j % PROGRESSLEN]); + fflush(stdout); + } + } +- printf("\b \b"); ++ __dprintf("\b \b"); + fflush(stdout); + return compare_regions(bufa, bufb, count); + } +@@ -226,23 +237,23 @@ int test_solidbits_comparison(ulv *bufa, + printf(" "); + fflush(stdout); + for (j = 0; j < 64; j++) { +- printf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); + q = (j % 2) == 0 ? UL_ONEBITS : 0; +- printf("setting %3u", j); ++ __dprintf("setting %3u", j); + fflush(stdout); + p1 = (ulv *) bufa; + p2 = (ulv *) bufb; + for (i = 0; i < count; i++) { + *p1++ = *p2++ = (i % 2) == 0 ? q : ~q; + } +- printf("\b\b\b\b\b\b\b\b\b\b\b"); +- printf("testing %3u", j); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("testing %3u", j); + fflush(stdout); + if (compare_regions(bufa, bufb, count)) { + return -1; + } + } +- printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); + fflush(stdout); + return 0; + } +@@ -257,23 +268,23 @@ int test_checkerboard_comparison(ulv *bu + printf(" "); + fflush(stdout); + for (j = 0; j < 64; j++) { +- printf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); + q = (j % 2) == 0 ? CHECKERBOARD1 : CHECKERBOARD2; +- printf("setting %3u", j); ++ __dprintf("setting %3u", j); + fflush(stdout); + p1 = (ulv *) bufa; + p2 = (ulv *) bufb; + for (i = 0; i < count; i++) { + *p1++ = *p2++ = (i % 2) == 0 ? q : ~q; + } +- printf("\b\b\b\b\b\b\b\b\b\b\b"); +- printf("testing %3u", j); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("testing %3u", j); + fflush(stdout); + if (compare_regions(bufa, bufb, count)) { + return -1; + } + } +- printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); + fflush(stdout); + return 0; + } +@@ -284,25 +295,25 @@ int test_blockseq_comparison(ulv *bufa, + unsigned int j; + size_t i; + +- printf(" "); ++ __dprintf(" "); + fflush(stdout); + for (j = 0; j < 256; j++) { +- printf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); + p1 = (ulv *) bufa; + p2 = (ulv *) bufb; +- printf("setting %3u", j); ++ __dprintf("setting %3u", j); + fflush(stdout); + for (i = 0; i < count; i++) { + *p1++ = *p2++ = (ul) UL_BYTE(j); + } +- printf("\b\b\b\b\b\b\b\b\b\b\b"); +- printf("testing %3u", j); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("testing %3u", j); + fflush(stdout); + if (compare_regions(bufa, bufb, count)) { + return -1; + } + } +- printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); + fflush(stdout); + return 0; + } +@@ -316,10 +327,10 @@ int test_walkbits0_comparison(ulv *bufa, + printf(" "); + fflush(stdout); + for (j = 0; j < UL_LEN * 2; j++) { +- printf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); + p1 = (ulv *) bufa; + p2 = (ulv *) bufb; +- printf("setting %3u", j); ++ __dprintf("setting %3u", j); + fflush(stdout); + for (i = 0; i < count; i++) { + if (j < UL_LEN) { /* Walk it up. */ +@@ -328,14 +339,14 @@ int test_walkbits0_comparison(ulv *bufa, + *p1++ = *p2++ = ONE << (UL_LEN * 2 - j - 1); + } + } +- printf("\b\b\b\b\b\b\b\b\b\b\b"); +- printf("testing %3u", j); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("testing %3u", j); + fflush(stdout); + if (compare_regions(bufa, bufb, count)) { + return -1; + } + } +- printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); + fflush(stdout); + return 0; + } +@@ -346,13 +357,13 @@ int test_walkbits1_comparison(ulv *bufa, + unsigned int j; + size_t i; + +- printf(" "); ++ __dprintf(" "); + fflush(stdout); + for (j = 0; j < UL_LEN * 2; j++) { +- printf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); + p1 = (ulv *) bufa; + p2 = (ulv *) bufb; +- printf("setting %3u", j); ++ __dprintf("setting %3u", j); + fflush(stdout); + for (i = 0; i < count; i++) { + if (j < UL_LEN) { /* Walk it up. */ +@@ -361,14 +372,14 @@ int test_walkbits1_comparison(ulv *bufa, + *p1++ = *p2++ = UL_ONEBITS ^ (ONE << (UL_LEN * 2 - j - 1)); + } + } +- printf("\b\b\b\b\b\b\b\b\b\b\b"); +- printf("testing %3u", j); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("testing %3u", j); + fflush(stdout); + if (compare_regions(bufa, bufb, count)) { + return -1; + } + } +- printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); + fflush(stdout); + return 0; + } +@@ -379,13 +390,13 @@ int test_bitspread_comparison(ulv *bufa, + unsigned int j; + size_t i; + +- printf(" "); ++ __dprintf(" "); + fflush(stdout); + for (j = 0; j < UL_LEN * 2; j++) { +- printf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); + p1 = (ulv *) bufa; + p2 = (ulv *) bufb; +- printf("setting %3u", j); ++ __dprintf("setting %3u", j); + fflush(stdout); + for (i = 0; i < count; i++) { + if (j < UL_LEN) { /* Walk it up. */ +@@ -400,14 +411,14 @@ int test_bitspread_comparison(ulv *bufa, + | (ONE << (UL_LEN * 2 + 1 - j))); + } + } +- printf("\b\b\b\b\b\b\b\b\b\b\b"); +- printf("testing %3u", j); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("testing %3u", j); + fflush(stdout); + if (compare_regions(bufa, bufb, count)) { + return -1; + } + } +- printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); + fflush(stdout); + return 0; + } +@@ -419,29 +430,29 @@ int test_bitflip_comparison(ulv *bufa, u + ul q; + size_t i; + +- printf(" "); ++ __dprintf(" "); + fflush(stdout); + for (k = 0; k < UL_LEN; k++) { + q = ONE << k; + for (j = 0; j < 8; j++) { +- printf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); + q = ~q; +- printf("setting %3u", k * 8 + j); ++ __dprintf("setting %3u", k * 8 + j); + fflush(stdout); + p1 = (ulv *) bufa; + p2 = (ulv *) bufb; + for (i = 0; i < count; i++) { + *p1++ = *p2++ = (i % 2) == 0 ? q : ~q; + } +- printf("\b\b\b\b\b\b\b\b\b\b\b"); +- printf("testing %3u", k * 8 + j); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("testing %3u", k * 8 + j); + fflush(stdout); + if (compare_regions(bufa, bufb, count)) { + return -1; + } + } + } +- printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); ++ __dprintf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b"); + fflush(stdout); + return 0; + } +--- a/tests.h ++++ b/tests.h +@@ -14,6 +14,8 @@ + * + */ + ++extern int quiet; ++ + /* Function declaration. */ + + int test_stuck_address(unsigned long volatile *bufa, size_t count); diff --git a/utils/mg/Makefile b/utils/mg/Makefile new file mode 100644 index 0000000..de5265c --- /dev/null +++ b/utils/mg/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2008-2011 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:=mg +PKG_VERSION:=20110120 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://homepage.boetes.org/software/mg +PKG_MD5SUM:=f2fa8016a491aa2a9d4c5698c593f31b + +include $(INCLUDE_DIR)/package.mk + +define Package/mg + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncurses + TITLE:=microscopic GNU Emacs-style editor + URL:=http://homepage.boetes.org/software/mg/ + SUBMENU:=Editors +endef + +define Package/mg/description + This program is intended to be a small, fast, and portable + editor for people who can't (or don't want to) run real + Emacs for one reason or another. It is compatible with GNU + because there shouldn't be any reason to learn more than + one Emacs flavor. +endef + +define Build/Configure + (cd $(PKG_BUILD_DIR); \ + $(TARGET_CONFIGURE_OPTS) \ + ./configure \ + ); +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + LDFLAGS="$(TARGET_LDFLAGS) -lncurses" \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + CC="$(TARGET_CC)" +endef + +define Package/mg/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,mg)) diff --git a/utils/mgetty/Makefile b/utils/mgetty/Makefile new file mode 100644 index 0000000..8e2aec4 --- /dev/null +++ b/utils/mgetty/Makefile @@ -0,0 +1,131 @@ +# +# 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:=mgetty +PKG_VERSION:=1.1.36 +PKG_XVERSION:=Jun15 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION)-$(PKG_XVERSION).tar.gz +PKG_SOURCE_URL:=ftp://alpha.greenie.net/pub/mgetty/source/1.1 +PKG_MD5SUM:=0320e98c6b86bcca48fc5f355b94ead4 + +include $(INCLUDE_DIR)/package.mk + +define Package/mgetty + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A data/fax solution for your analog modem + URL:=http://mgetty.greenie.net/ +endef + +define Package/mgetty/description +A data/fax solution for your analog modem. +endef + +define Build/Configure + cp $(PKG_BUILD_DIR)/policy.h-dist $(PKG_BUILD_DIR)/policy.h + echo "#define AUTO_PPP" >> $(PKG_BUILD_DIR)/policy.h + echo "#undef FAX_NOTIFY_PROGRAM" >> $(PKG_BUILD_DIR)/policy.h + echo "#define FAX_NOTIFY_PROGRAM \"/usr/lib/mgetty+sendfax/new_fax\"" >> $(PKG_BUILD_DIR)/policy.h + echo "#undef DATA_FLOW" >> $(PKG_BUILD_DIR)/policy.h + echo "#define DATA_FLOW FLOW_HARD" >> $(PKG_BUILD_DIR)/policy.h + echo "#undef DEVICE_GROUP" >> $(PKG_BUILD_DIR)/policy.h + echo "#undef DEVICE_OWNER" >> $(PKG_BUILD_DIR)/policy.h + echo "#define DEVICE_OWNER \"root\"" >> $(PKG_BUILD_DIR)/policy.h + echo "#undef FAXREC_FLOW" >> $(PKG_BUILD_DIR)/policy.h + echo "#define FAXREC_FLOW FLOW_SOFT" >> $(PKG_BUILD_DIR)/policy.h + echo "#undef FAXSEND_FLOW" >> $(PKG_BUILD_DIR)/policy.h + echo "#define FAXSEND_FLOW FLOW_SOFT" >> $(PKG_BUILD_DIR)/policy.h +endef + +#FIXME: don't manually install, use upstream Makefile instead +define Build/Compile + rm -rf $(PKG_INSTALL_DIR) + mkdir -p $(PKG_INSTALL_DIR)/usr/bin + mkdir -p $(PKG_INSTALL_DIR)/usr/sbin + mkdir -p $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax + mkdir -p $(PKG_INSTALL_DIR)/etc/mgetty+sendfax + $(MAKE) -C $(PKG_BUILD_DIR) \ + mksed + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + prefix="$(PKG_INSTALL_DIR)/usr" \ + CONFDIR=/etc/mgetty+sendfax \ + bin-all + $(CP) $(PKG_BUILD_DIR)/mgetty $(PKG_INSTALL_DIR)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/sendfax $(PKG_INSTALL_DIR)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/fax/faxrunqd $(PKG_INSTALL_DIR)/usr/sbin + chmod 755 $(PKG_INSTALL_DIR)/usr/sbin/* + $(CP) $(PKG_BUILD_DIR)/fax/faxq-helper $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax + chmod u+s $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/faxq-helper + $(CP) $(PKG_BUILD_DIR)/fax/cour25n.pbm $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax + $(CP) $(PKG_BUILD_DIR)/fax/cour25.pbm $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax + $(CP) $(PKG_BUILD_DIR)/fax/faxq $(PKG_INSTALL_DIR)/usr/bin + $(CP) $(PKG_BUILD_DIR)/fax/faxrm $(PKG_INSTALL_DIR)/usr/bin + $(CP) $(PKG_BUILD_DIR)/fax/faxrunq $(PKG_INSTALL_DIR)/usr/bin + $(CP) $(PKG_BUILD_DIR)/fax/faxspool $(PKG_INSTALL_DIR)/usr/bin + $(CP) $(PKG_BUILD_DIR)/g3/g32pbm $(PKG_INSTALL_DIR)/usr/bin + (cd $(PKG_INSTALL_DIR)/usr/bin;\ + ln -snf g32pbm g3topbm;\ + ); + $(CP) $(PKG_BUILD_DIR)/g3/g3cat $(PKG_INSTALL_DIR)/usr/bin + $(CP) $(PKG_BUILD_DIR)/g3/pbm2g3 $(PKG_INSTALL_DIR)/usr/bin + $(CP) $(PKG_BUILD_DIR)/g3/sff2g3 $(PKG_INSTALL_DIR)/usr/bin + chmod 755 $(PKG_INSTALL_DIR)/usr/bin/* +# Installation into /etc + $(CP) $(PKG_BUILD_DIR)/dialin.config $(PKG_INSTALL_DIR)/etc/mgetty+sendfax + $(CP) $(PKG_BUILD_DIR)/fax/faxheader $(PKG_INSTALL_DIR)/etc/mgetty+sendfax + $(CP) $(PKG_BUILD_DIR)/faxrunq.config $(PKG_INSTALL_DIR)/etc/mgetty+sendfax + $(CP) $(PKG_BUILD_DIR)/fax/faxspool.rules $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxspool.rules.sample + $(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/login.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/login.config + $(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/mgetty.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/mgetty.config + $(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/sendfax.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/sendfax.config +endef + +define Package/mgetty/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/faxq \ + $(PKG_INSTALL_DIR)/usr/bin/faxrm \ + $(PKG_INSTALL_DIR)/usr/bin/faxrunq \ + $(PKG_INSTALL_DIR)/usr/bin/faxspool \ + $(PKG_INSTALL_DIR)/usr/bin/g32pbm \ + $(PKG_INSTALL_DIR)/usr/bin/g3cat \ + $(PKG_INSTALL_DIR)/usr/bin/pbm2g3 \ + $(PKG_INSTALL_DIR)/usr/bin/sff2g3 \ + $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/sbin/mgetty \ + $(PKG_INSTALL_DIR)/usr/sbin/sendfax \ + $(PKG_INSTALL_DIR)/usr/sbin/faxrunqd \ + $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/mgetty+sendfax + install -m4755 \ + $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/faxq-helper \ + $(1)/usr/lib/mgetty+sendfax/ + install -m644 \ + $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/cour25n.pbm \ + $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/cour25.pbm \ + $(1)/usr/lib/mgetty+sendfax/ + $(INSTALL_DIR) $(1)/etc/mgetty+sendfax + install -m600 \ + $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/dialin.config \ + $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxheader \ + $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxrunq.config \ + $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxspool.rules.sample \ + $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/login.config \ + $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/mgetty.config \ + $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/sendfax.config \ + $(1)/etc/mgetty+sendfax/ +endef + +$(eval $(call BuildPackage,mgetty)) diff --git a/utils/mgetty/patches/001-mgetty.patch b/utils/mgetty/patches/001-mgetty.patch new file mode 100644 index 0000000..427fe9c --- /dev/null +++ b/utils/mgetty/patches/001-mgetty.patch @@ -0,0 +1,88 @@ +--- a/Makefile ++++ b/Makefile +@@ -164,7 +164,9 @@ + # + # if your systems doesn't have one, use the shell script that I provide + # in "inst.sh" (taken from X11R5). Needed on IRIX5.2 +-INSTALL=install -c -o bin -g bin ++STRIP=$(STAGING_DIR)sstrip ++INSTALL=install -c -o root -g root ++#INSTALL=install -c -o bin -g bin + #INSTALL=install -c -o root -g wheel # NeXT/BSD + #INSTALL=/usr/ucb/install -c -o bin -g bin # AIX, Solaris 2.x + #INSTALL=installbsd -c -o bin -g bin # OSF/1, AIX 4.1, 4.2 +@@ -216,7 +218,7 @@ + # (it's possible to run faxrunq(d) as root, but the FAX_OUT_USER + # MUST NOT BE root or any other privileged account). + # +-FAX_OUT_USER=fax ++FAX_OUT_USER=root + # + # + # Where section 1 manual pages should be placed +@@ -421,7 +423,12 @@ + ./mksed >sedscript + chmod +x sedscript + +-mksed: mksed.c policy.h Makefile ++REALGCC:=/usr/bin/gcc ++mksed: mksed.c policy.h Makefile ++ ( echo $(REALGCC); $(MAKE) "CC=$(REALGCC)" "CFLAGS=$(CFLAGS)" mksed-wrong;\ ++ ); ++ ++mksed-wrong: mksed.c policy.h Makefile + $(CC) $(CFLAGS) -DBINDIR=\"$(BINDIR)\" -DSBINDIR=\"$(SBINDIR)\" \ + -DLIBDIR=\"$(LIBDIR)\" \ + -DCONFDIR=\"$(CONFDIR)\" \ +@@ -586,8 +593,10 @@ + -test -d $(SBINDIR) || ( ./mkidirs $(SBINDIR) ; chmod 755 $(SBINDIR) ) + -mv -f $(SBINDIR)/mgetty $(SBINDIR)/mgetty.old + -mv -f $(SBINDIR)/sendfax $(SBINDIR)/sendfax.old +- $(INSTALL) -s -m 700 mgetty $(SBINDIR) +- $(INSTALL) -s -m 755 sendfax $(SBINDIR) ++ $(INSTALL) -m 700 mgetty $(SBINDIR) ++ $(STRIP) $(SBINDIR)/mgetty ++ $(INSTALL) -m 755 sendfax $(SBINDIR) ++ $(STRIP) $(SBINDIR)/sendfax + # + # data files + directories + # +@@ -649,7 +658,8 @@ + if [ ! -z "$(INSTALL_MECHO)" ] ; then \ + cd compat ; \ + $(CC) $(CFLAGS) -o mg.echo mg.echo.c && \ +- $(INSTALL) -s -m 755 mg.echo $(BINDIR) ; \ ++ $(INSTALL) -m 755 mg.echo $(BINDIR) && \ ++ $(STRIP) $(BINDIR)/mg.echo ; \ + fi + + # +--- a/g3/Makefile ++++ b/g3/Makefile +@@ -37,7 +37,8 @@ + # install programs + # + for f in $(G3_PROGRAMS) ; do \ +- $(INSTALL) -s -m 755 $$f $(BINDIR) ; \ ++ $(INSTALL) -m 755 $$f $(BINDIR) ; \ ++ $(STRIP) $(BINDIR)/$$f ; \ + done + # + # make symlink for "g3topbm" (so third-party fax viewers won't fail) +--- a/logfile.c ++++ b/logfile.c +@@ -327,12 +327,11 @@ + } + else /* ERROR or FATAL */ + { +- fprintf(log_fp, "\n%02d/%02d %02d:%02d:%02d %s %s: %s", ++ fprintf(log_fp, "\n%02d/%02d %02d:%02d:%02d %s %s: #%d", + tm->tm_mon+1, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec, + log_infix, ws, +- ( errnr <= sys_nerr ) ? sys_errlist[errnr]: +- "" ); ++ errnr ); + #ifdef SYSLOG + syslog( level == L_FATAL? LOG_ALERT: LOG_ERR, "%s: %m", ws ); + #endif diff --git a/utils/microcom/Makefile b/utils/microcom/Makefile new file mode 100644 index 0000000..6315cfa --- /dev/null +++ b/utils/microcom/Makefile @@ -0,0 +1,47 @@ +# +# 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:=microcom +PKG_VERSION:=1.02 +PKG_RELEASE:=1 + +PKG_SOURCE:=m102.tar.gz +PKG_SOURCE_URL:=http://microcom.port5.com/ +PKG_MD5SUM:=c7817035dc41cb02e7cfb565cf9b7401 + +include $(INCLUDE_DIR)/package.mk + +PKG_UNPACK:=zcat $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS) + +define Package/microcom + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A serial terminal emulation program + URL:=http://microcomlinux.homestead.com/ + SUBMENU:=Terminal +endef + +define Package/microcom/description + microcom is a minicom-like serial terminal emulator with scripting + support. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + microcom +endef + +define Package/microcom/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/microcom $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,microcom)) diff --git a/utils/microcom/patches/001-cross_compile.patch b/utils/microcom/patches/001-cross_compile.patch new file mode 100644 index 0000000..f6e44a8 --- /dev/null +++ b/utils/microcom/patches/001-cross_compile.patch @@ -0,0 +1,29 @@ +diff -ruN microcom-1.02-old/Makefile microcom-1.02-new/Makefile +--- microcom-1.02-old/Makefile 2006-10-29 21:55:45.000000000 +0100 ++++ microcom-1.02-new/Makefile 2006-10-29 22:00:09.000000000 +0100 +@@ -19,19 +19,19 @@ + #** Rev. 0.91 - Jan. 2000 - minor fixes, compiled under Mandrake 6.0 + #****************************************************************************/ + microcom: microcom.o mux.o script.o help.o autodet.o +- gcc -o microcom microcom.o mux.o script.o help.o autodet.o ++ $(CC) -o microcom microcom.o mux.o script.o help.o autodet.o + + autodet.o: autodet.c microcom.h +- gcc -O -c autodet.c ++ $(CC) $(CFLAGS) -c autodet.c + + script.o: script.c script.h microcom.h +- gcc -O -c script.c ++ $(CC) $(CFLAGS) -c script.c + + mux.o: mux.c microcom.h +- gcc -O -c mux.c ++ $(CC) $(CFLAGS) -c mux.c + + microcom.o: microcom.c microcom.h +- gcc -O -c microcom.c ++ $(CC) $(CFLAGS) -c microcom.c + + help.o: help.c microcom.h +- gcc -O -c help.c ++ $(CC) $(CFLAGS) -c help.c diff --git a/utils/minicom/Makefile b/utils/minicom/Makefile new file mode 100644 index 0000000..104e477 --- /dev/null +++ b/utils/minicom/Makefile @@ -0,0 +1,37 @@ +# +# Copyright (C) 2006-2008 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:=minicom +PKG_VERSION:=2.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://alioth.debian.org/download.php/2332/ +PKG_MD5SUM:=0ebe7a91898384ca906787cc4e2c3f25 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/minicom + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncurses + TITLE:=Terminal emulation program + URL:=http://alioth.debian.org/projects/minicom/ + SUBMENU:=Terminal +endef + +define Package/minicom/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ascii-xfr $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,minicom)) diff --git a/utils/minicom/patches/010-resolve-getline-conflict.patch b/utils/minicom/patches/010-resolve-getline-conflict.patch new file mode 100644 index 0000000..041353d --- /dev/null +++ b/utils/minicom/patches/010-resolve-getline-conflict.patch @@ -0,0 +1,111 @@ +--- a/src/minicom.c ++++ b/src/minicom.c +@@ -167,7 +167,7 @@ static void shjump(int sig) + #endif /*SIGTSTP*/ + + /* Get a line from either window or scroll back buffer. */ +-static ELM *getline(WIN *w, int no) ++static ELM *mc_getline(WIN *w, int no) + { + int i; + static ELM outofrange[MAXCOLS] = {{0,0,0}}; +@@ -205,7 +205,7 @@ static void drawhist(WIN *w, int y, int + + w->direct = 0; + for (f = 0; f < w->ys; f++) +- mc_wdrawelm(w, f, getline(w, y++)); ++ mc_wdrawelm(w, f, mc_getline(w, y++)); + if (r) + mc_wredraw(w, 1); + w->direct = 1; +@@ -227,7 +227,7 @@ void drawhist_look(WIN *w, int y, int r, + tmp_line[0]='\0'; + w->direct = 0; + for (f = 0; f < w->ys; f++) { +- tmp_e = getline(w, y++); ++ tmp_e = mc_getline(w, y++); + + /* First we "accumulate" the line into a variable */ + mc_wdrawelm_var(w, tmp_e, tmp_line); +@@ -324,7 +324,7 @@ int find_next(WIN *w, WIN *w_hist, + + for (next_line = hit_line; next_line <= all_lines; next_line++) { + /* we do 'something' here... :-) */ +- tmp_e = getline(w_hist, next_line); ++ tmp_e = mc_getline(w_hist, next_line); + + /* + * First we "accumulate" the line into a variable. +@@ -379,9 +379,9 @@ wchar_t *StrStr(wchar_t *str1, wchar_t * + static void drawcite(WIN *w, int y, int citey, int start, int end) + { + if (y+citey >= start && y+citey <= end) +- mc_wdrawelm_inverse(w, y, getline(w, y+citey)); ++ mc_wdrawelm_inverse(w, y, mc_getline(w, y+citey)); + else +- mc_wdrawelm(w, y, getline(w, y+citey)); ++ mc_wdrawelm(w, y, mc_getline(w, y+citey)); + } + + static void drawcite_whole(WIN *w, int y, int start, int end) +@@ -400,7 +400,7 @@ static void do_cite(WIN *w, int start, i + for (y=start; y<=end; y++) { + vt_send('>'); + vt_send(' '); +- tmp_e = getline(w, y); ++ tmp_e = mc_getline(w, y); + mc_wdrawelm_var(w, tmp_e, tmp_line); + tmp_line[w->xs] = 0; + for (x = w->xs-1; x >= 0; x--) { +@@ -600,7 +600,7 @@ static void scrollback(void) + if (citemode) { + inverse = (y+cite_y >= cite_ystart && y+cite_y <= cite_yend); + } else { +- tmp_e = getline(b_us, y); ++ tmp_e = mc_getline(b_us, y); + if (wcslen(look_for) > 1) { + /* quick scan for pattern match */ + mc_wdrawelm_var(b_us, tmp_e, tmp_line); +@@ -611,9 +611,9 @@ static void scrollback(void) + } + + if (inverse) +- mc_wdrawelm_inverse(b_us, 0, getline(b_us, y)); ++ mc_wdrawelm_inverse(b_us, 0, mc_getline(b_us, y)); + else +- mc_wdrawelm(b_us, 0, getline(b_us, y)); ++ mc_wdrawelm(b_us, 0, mc_getline(b_us, y)); + if (citemode) + mc_wlocate(b_us, 0, cite_y); + mc_wflush(); +@@ -648,7 +648,7 @@ static void scrollback(void) + if (citemode) { + inverse = (y+cite_y >= cite_ystart && y+cite_y <= cite_yend); + } else { +- tmp_e = getline(b_us, y + b_us->ys - 1); ++ tmp_e = mc_getline(b_us, y + b_us->ys - 1); + if (wcslen(look_for) > 1) { + /* quick scan for pattern match */ + mc_wdrawelm_var(b_us, tmp_e, tmp_line); +@@ -660,10 +660,10 @@ static void scrollback(void) + + if (inverse) + mc_wdrawelm_inverse(b_us, b_us->ys - 1, +- getline(b_us, y + b_us->ys - 1)); ++ mc_getline(b_us, y + b_us->ys - 1)); + else + mc_wdrawelm(b_us, b_us->ys - 1, +- getline(b_us, y + b_us->ys - 1)); ++ mc_getline(b_us, y + b_us->ys - 1)); + if (citemode) + mc_wlocate(b_us, 0, cite_y); + mc_wflush(); +@@ -753,7 +753,7 @@ static void scrollback(void) + mc_wlocate(b_st, 0, 0); + mc_wprintf(b_st, hline); + mc_wredraw(b_st, 1); +- mc_wdrawelm_inverse(b_us, cite_y, getline(b_us, cite_ystart)); ++ mc_wdrawelm_inverse(b_us, cite_y, mc_getline(b_us, cite_ystart)); + mc_wlocate(b_us, 0, cite_y); + break; + case K_ESC: diff --git a/utils/mksh/Makefile b/utils/mksh/Makefile new file mode 100644 index 0000000..e9a3bf3 --- /dev/null +++ b/utils/mksh/Makefile @@ -0,0 +1,81 @@ +# +# Copyright (C) 2007-2011 OpenWrt.org +# Copyright (c) 2009 Thorsten Glaser +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mksh +PKG_VERSION:=40d +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-R$(PKG_VERSION).cpio.gz +PKG_SOURCE_URL:=http://www.mirbsd.org/MirOS/dist/mir/mksh +PKG_MD5SUM:=c6428401103367730a95b99284bf47dc + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/mksh + SECTION:=shells + CATEGORY:=Base system + TITLE:=MirBSD Korn Shell + DEPENDS:=$(DEP) + URL:=http://mirbsd.de/mksh +endef + +define Package/mksh/description +mksh is the MirBSD enhanced version of the Public Domain Korn +shell (pdksh), a Bourne-compatible shell which is largely si- +milar to the original AT&T Korn shell; mksh is the only pdksh +derivate currently being actively developed. It includes bug +fixes and feature improvements, in order to produce a modern, +robust shell good for interactive and especially script use. +mksh has UTF-8 support (in substring operations and the Emacs +editing mode) and, while R40d corresponds to OpenBSD 5.0-cur- +rent ksh (without GNU bash-like PS1 and fancy character clas- +ses), adheres to SUSv4 and is much more robust. The code has +been cleaned up and simplified, bugs fixed, standards compli- +ance added, and several enhancements (for extended compatibi- +lity to other modern shells - as well as a couple of its own) +are available. It has sensible defaults as usual with BSD. +endef + +define Build/Compile + # -DMKSH_SMALL=1 ⇒ reduce functionality quite a lot + # -DMKSH_ASSUME_UTF8=0 ⇒ never automatically enable + # UTF-8 mode, neither use setlocale/nl_langinfo + # nor look at $LC_* and $LANG (not recommended) + # HAVE_CAN_FSTACKPROTECTORALL=0 ⇒ nuke libssp dependency + cd $(PKG_BUILD_DIR); \ + CC="$(TARGET_CC)" \ + TARGET_OS="$(shell uname -s)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="-DMKSH_SMALL=1 -DMKSH_ASSUME_UTF8=0" \ + HAVE_CAN_FSTACKPROTECTORALL=0 \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + $(BASH) Build.sh -Q -r -c lto +endef + +define Package/mksh/postinst +#!/bin/sh +grep mksh $${IPKG_INSTROOT}/etc/shells || \ + echo "/bin/mksh" >> $${IPKG_INSTROOT}/etc/shells +endef + +define Package/mksh/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/dot.mkshrc $(1)/etc/mkshrc + $(INSTALL_DIR) $(1)/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mksh $(1)/bin/ +endef + +define Package/mksh/conffiles +/etc/mkshrc +endef + +$(eval $(call BuildPackage,mksh)) diff --git a/utils/mksh/patches/100-dot_mkshrc b/utils/mksh/patches/100-dot_mkshrc new file mode 100644 index 0000000..f326ae7 --- /dev/null +++ b/utils/mksh/patches/100-dot_mkshrc @@ -0,0 +1,38 @@ +$Id$ + + • Part of the FreeWRT patches: + – no hostname(1) + – ls(1) has no -o option + • OpenWrt and FreeWRT-1.0 fix: + – since this is not ~/.mkshrc make sure subshells find it + +--- a/dot.mkshrc Sat Nov 26 18:15:38 2011 ++++ b/dot.mkshrc Sun Dec 11 21:31:27 2011 +@@ -21,7 +21,7 @@ + #- + # ${ENV:-~/.mkshrc}: mksh initialisation file for interactive shells + +-: ${EDITOR:=/bin/ed} ${TERM:=vt100} ${HOSTNAME:=$(ulimit -c 0;hostname -s 2>&-)} ++: ${EDITOR:=/bin/ed} ${TERM:=vt100} ${HOSTNAME:=$(&-) + : ${HOSTNAME:=nil}; if (( USER_ID )); then PS1='$'; else PS1='#'; fi + function precmd { +@@ -40,7 +40,7 @@ unalias ls + alias l='ls -F' + alias la='l -a' + alias ll='l -l' +-alias lo='l -alo' ++alias lo='l -al' + whence -p rot13 >&- || alias rot13='tr \ + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \ + nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM' +@@ -365,5 +365,9 @@ alias cls='print -n \\033c' + #export LANG=C LC_CTYPE=$p LC_MEASUREMENT=$p LC_MESSAGES=$p LC_PAPER=$p + + unset p ++ ++# we need this in OpenWrt for subshells that are not login shells ++: ${ENV=/etc/mkshrc} ++[[ -z $ENV ]] || export ENV + + : place customisations above this line diff --git a/utils/msr-tools/Makefile b/utils/msr-tools/Makefile new file mode 100644 index 0000000..5be0fd0 --- /dev/null +++ b/utils/msr-tools/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2011 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:=msr-tools +PKG_VERSION:=1.1.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.kernel.org/pub/linux/utils/cpu/msr-tools +PKG_MD5SUM:=2452d2233556aa0fb8b53208361a2c94 + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += -fomit-frame-pointer -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 + +define Package/msr-tools + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:= + TITLE:=x86 MSR utilities. + URL:=http://www.kernel.org/pub/linux/utils/cpu/msr-tools + SUBMENU:=CPU tools +endef + +define Package/msr-tools/description + Manipulate the MSR (machine state registers) on i386 and x86_64 + processors. +endef + +define Build/Configure +endef + +define Build/Compile + $(INSTALL_DIR) "$(PKG_INSTALL_DIR)/usr/sbin" + $(MAKE) -C $(PKG_BUILD_DIR) all \ + $(TARGET_CONFIGURE_OPTS) \ + sbindir="$(PKG_INSTALL_DIR)/usr/sbin" \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="" \ + install +endef + +define Package/msr-tools/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,msr-tools)) diff --git a/utils/msr-tools/patches/100-multiprocessor.patch b/utils/msr-tools/patches/100-multiprocessor.patch new file mode 100644 index 0000000..8795b8b --- /dev/null +++ b/utils/msr-tools/patches/100-multiprocessor.patch @@ -0,0 +1,28 @@ +--- msr-tools-1.1.2/wrmsr.c.orig 2004-07-20 09:54:59.000000000 -0600 ++++ msr-tools-1.1.2/wrmsr.c 2011-12-27 14:07:24.505887313 -0700 +@@ -90,7 +90,11 @@ int main(int argc, char *argv[]) + + reg = strtoul(argv[optind++], NULL, 0); + ++#ifdef SMP + sprintf(msr_file_name, "/dev/cpu/%d/msr", cpu); ++#else ++ sprintf(msr_file_name, "/dev/msr%d", cpu); ++#endif + fd = open(msr_file_name, O_WRONLY); + if ( fd < 0 ) { + if ( errno == ENXIO ) { +--- msr-tools-1.1.2/rdmsr.c.orig 2004-07-20 09:54:59.000000000 -0600 ++++ msr-tools-1.1.2/rdmsr.c 2011-12-27 14:06:37.831584784 -0700 +@@ -167,7 +167,11 @@ int main(int argc, char *argv[]) + + reg = strtoul(argv[optind], NULL, 0); + ++#ifdef SMP + sprintf(msr_file_name, "/dev/cpu/%d/msr", cpu); ++#else ++ sprintf(msr_file_name, "/dev/msr%d", cpu); ++#endif + fd = open(msr_file_name, O_RDONLY); + if ( fd < 0 ) { + if ( errno == ENXIO ) { diff --git a/utils/mtd-utils/Makefile b/utils/mtd-utils/Makefile new file mode 100644 index 0000000..18723b1 --- /dev/null +++ b/utils/mtd-utils/Makefile @@ -0,0 +1,115 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mtd-utils +PKG_REV:=5319b84974fcb71504aed2d1b8285e9c0a4a4bb8 +PKG_VERSION:=1.4.5 +PKG_RELEASE:=1 +PKG_INSTALL:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=git://git.infradead.org/mtd-utils.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) + +PKG_BUILD_DEPENDS:=util-linux + +include $(INCLUDE_DIR)/package.mk + +FILES:= \ + doc_loadbios \ + docfdisk \ + flash_erase \ + flash_eraseall \ + flash_info \ + flash_lock \ + flash_otp_dump \ + flash_otp_info \ + flash_unlock \ + flashcp \ + ftl_check \ + ftl_format \ + jffs2dump \ + mkfs.jffs2:+zlib \ + mkfs.ubifs:+libuuid:+zlib \ + mtd_debug \ + mtdinfo \ + nanddump \ + nandtest \ + nandwrite \ + nftldump \ + nftl_format \ + recv_image \ + rfddump \ + rfdformat \ + serve_image \ + sumtool \ + ubiattach \ + ubicrc32 \ + ubidetach \ + ubiformat \ + ubimkvol \ + ubinfo \ + ubinize \ + ubirename \ + ubirmvol \ + ubirsvol \ + ubiupdatevol + +define PartGen +define Package/mtd-utils-$(subst _,-,$(firstword $(subst :, ,$(1)))) + TITLE:=$(firstword $(subst :, ,$(1))) package from mtd-utils + URL:=http://www.linux-mtd.infradead.org/ + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=mtd-utils $(wordlist 2,$(words $(subst :, ,$(1))),$(subst :, ,$(1))) +endef +endef + +define Package/mtd-utils + TITLE:=Utilities for flash info/debug + SECTION:=utils + CATEGORY:=Utilities + URL:=http://www.linux-mtd.infradead.org/ + MENU:=1 +endef + +define Package/mtd-utils/description + Utilities for manipulating memory technology devices. +endef + +define Package/mtd-utils/install + true +endef + +$(foreach file,$(FILES),$(eval $(call PartGen,$(file)))) + +MAKE_FLAGS += \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + BUILDDIR="$(PKG_BUILD_DIR)" \ + LDLIBS+="$(LIBGCC_S)" \ + WITHOUT_XATTR=1 \ + WITHOUT_LZO=1 + +define PartInstall +define Package/mtd-utils-$(subst _,-,$(firstword $(subst :, ,$(1))))/install + $(INSTALL_DIR) \ + $$(1)/usr/sbin + + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/sbin/$(firstword $(subst :, ,$(1))) \ + $$(1)/usr/sbin/ +endef +endef + +$(foreach file,$(FILES),$(eval $(call PartInstall,$(file)))) + +$(eval $(call BuildPackage,mtd-utils)) +$(foreach file,$(FILES),$(eval $(call BuildPackage,mtd-utils-$(subst _,-,$(firstword $(subst :, ,$(file))))))) diff --git a/utils/mtd-utils/patches/100-mtd-debug-add-bad-block-counter.patch b/utils/mtd-utils/patches/100-mtd-debug-add-bad-block-counter.patch new file mode 100644 index 0000000..dbe6ccc --- /dev/null +++ b/utils/mtd-utils/patches/100-mtd-debug-add-bad-block-counter.patch @@ -0,0 +1,73 @@ +--- a/mtd_debug.c ++++ b/mtd_debug.c +@@ -238,6 +238,7 @@ int showinfo (int fd) + int i,err,n; + struct mtd_info_user mtd; + static struct region_info_user region[1024]; ++ int iNumOfBadBlocks = 0; + + err = getmeminfo (fd,&mtd); + if (err < 0) +@@ -330,6 +331,11 @@ int showinfo (int fd) + printf ("\nmtd.oobsize = "); + printsize (mtd.oobsize); + ++ printf ("\nmtd.badblockscount = "); ++ iNumOfBadBlocks = get_bb_number(fd, &mtd); ++ if (iNumOfBadBlocks > -1) ++ printf ("%d", iNumOfBadBlocks); ++ + printf ("\n" + "regions = %d\n" + "\n", +@@ -349,6 +355,50 @@ int showinfo (int fd) + return (0); + } + ++int get_bb_number(int fd, struct mtd_info_user *meminfo) ++{ ++ int isNAND = (meminfo->type == MTD_NANDFLASH); ++ int ibbCounter = 0; ++ /* Last 4 blocks of any MTD device are protected and ++ MTD reports them as badblocks. */ ++ int usablesize = meminfo->size - (4 * meminfo->erasesize); ++ erase_info_t erase; ++ erase.length = meminfo->erasesize; ++ ++ for (erase.start = 0; ++ erase.start < usablesize; ++ erase.start += meminfo->erasesize) ++ { ++ loff_t offset = erase.start; ++ int ret = ioctl(fd, MEMGETBADBLOCK, &offset); ++ ++ if (ret > 0) ++ { ++ ibbCounter++; ++ continue; ++ } ++ else if (ret < 0) ++ { ++ if (errno == EOPNOTSUPP) ++ { ++ if (isNAND) ++ { ++ printf("Bad block check not available"); ++ return -1; ++ } ++ } ++ else ++ { ++ printf("MTD get bad block failed: %s", ++ strerror(errno)); ++ return -1; ++ } ++ } ++ } ++ ++ return ibbCounter; ++} ++ + void showusage(void) + { + fprintf (stderr, diff --git a/utils/mtd-utils/patches/130-lzma_jffs2.patch b/utils/mtd-utils/patches/130-lzma_jffs2.patch new file mode 100644 index 0000000..9a1c122 --- /dev/null +++ b/utils/mtd-utils/patches/130-lzma_jffs2.patch @@ -0,0 +1,5031 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,7 @@ + + # -*- sh -*- + +-CPPFLAGS += -I./include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) ++CPPFLAGS += -I./include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) -I./include/linux/lzma + + ifeq ($(WITHOUT_XATTR), 1) + CPPFLAGS += -DWITHOUT_XATTR +@@ -50,7 +50,9 @@ $(SYMLINKS): + ln -sf ../fs/jffs2/$@ $@ + + $(BUILDDIR)/mkfs.jffs2: $(addprefix $(BUILDDIR)/,\ +- compr_rtime.o mkfs.jffs2.o compr_zlib.o compr_lzo.o \ ++ compr_rtime.o mkfs.jffs2.o compr_zlib.o \ ++ $(if $(WITHOUT_LZO),,compr_lzo.o) \ ++ compr_lzma.o lzma/LzFind.o lzma/LzmaEnc.o lzma/LzmaDec.o \ + compr.o rbtree.o) + LDFLAGS_mkfs.jffs2 = $(ZLIBLDFLAGS) $(LZOLDFLAGS) + LDLIBS_mkfs.jffs2 = -lz $(LZOLDLIBS) +--- a/compr.c ++++ b/compr.c +@@ -520,6 +520,9 @@ int jffs2_compressors_init(void) + #ifdef CONFIG_JFFS2_LZO + jffs2_lzo_init(); + #endif ++#ifdef CONFIG_JFFS2_LZMA ++ jffs2_lzma_init(); ++#endif + return 0; + } + +@@ -534,5 +537,8 @@ int jffs2_compressors_exit(void) + #ifdef CONFIG_JFFS2_LZO + jffs2_lzo_exit(); + #endif ++#ifdef CONFIG_JFFS2_LZMA ++ jffs2_lzma_exit(); ++#endif + return 0; + } +--- a/compr.h ++++ b/compr.h +@@ -18,13 +18,14 @@ + + #define CONFIG_JFFS2_ZLIB + #define CONFIG_JFFS2_RTIME +-#define CONFIG_JFFS2_LZO ++#define CONFIG_JFFS2_LZMA + + #define JFFS2_RUBINMIPS_PRIORITY 10 + #define JFFS2_DYNRUBIN_PRIORITY 20 + #define JFFS2_RTIME_PRIORITY 50 +-#define JFFS2_ZLIB_PRIORITY 60 +-#define JFFS2_LZO_PRIORITY 80 ++#define JFFS2_LZMA_PRIORITY 70 ++#define JFFS2_ZLIB_PRIORITY 80 ++#define JFFS2_LZO_PRIORITY 90 + + #define JFFS2_COMPR_MODE_NONE 0 + #define JFFS2_COMPR_MODE_PRIORITY 1 +@@ -115,5 +116,10 @@ void jffs2_rtime_exit(void); + int jffs2_lzo_init(void); + void jffs2_lzo_exit(void); + #endif ++#ifdef CONFIG_JFFS2_LZMA ++int jffs2_lzma_init(void); ++void jffs2_lzma_exit(void); ++#endif ++ + + #endif /* __JFFS2_COMPR_H__ */ +--- /dev/null ++++ b/compr_lzma.c +@@ -0,0 +1,128 @@ ++/* ++ * JFFS2 -- Journalling Flash File System, Version 2. ++ * ++ * For licensing information, see the file 'LICENCE' in this directory. ++ * ++ * JFFS2 wrapper to the LZMA C SDK ++ * ++ */ ++ ++#include ++#include "compr.h" ++ ++#ifdef __KERNEL__ ++ static DEFINE_MUTEX(deflate_mutex); ++#endif ++ ++CLzmaEncHandle *p; ++Byte propsEncoded[LZMA_PROPS_SIZE]; ++SizeT propsSize = sizeof(propsEncoded); ++ ++STATIC void lzma_free_workspace(void) ++{ ++ LzmaEnc_Destroy(p, &lzma_alloc, &lzma_alloc); ++} ++ ++STATIC int INIT lzma_alloc_workspace(CLzmaEncProps *props) ++{ ++ if ((p = (CLzmaEncHandle *)LzmaEnc_Create(&lzma_alloc)) == NULL) ++ { ++ PRINT_ERROR("Failed to allocate lzma deflate workspace\n"); ++ return -ENOMEM; ++ } ++ ++ if (LzmaEnc_SetProps(p, props) != SZ_OK) ++ { ++ lzma_free_workspace(); ++ return -1; ++ } ++ ++ if (LzmaEnc_WriteProperties(p, propsEncoded, &propsSize) != SZ_OK) ++ { ++ lzma_free_workspace(); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++STATIC int jffs2_lzma_compress(unsigned char *data_in, unsigned char *cpage_out, ++ uint32_t *sourcelen, uint32_t *dstlen, void *model) ++{ ++ SizeT compress_size = (SizeT)(*dstlen); ++ int ret; ++ ++ #ifdef __KERNEL__ ++ mutex_lock(&deflate_mutex); ++ #endif ++ ++ ret = LzmaEnc_MemEncode(p, cpage_out, &compress_size, data_in, *sourcelen, ++ 0, NULL, &lzma_alloc, &lzma_alloc); ++ ++ #ifdef __KERNEL__ ++ mutex_unlock(&deflate_mutex); ++ #endif ++ ++ if (ret != SZ_OK) ++ return -1; ++ ++ *dstlen = (uint32_t)compress_size; ++ ++ return 0; ++} ++ ++STATIC int jffs2_lzma_decompress(unsigned char *data_in, unsigned char *cpage_out, ++ uint32_t srclen, uint32_t destlen, void *model) ++{ ++ int ret; ++ SizeT dl = (SizeT)destlen; ++ SizeT sl = (SizeT)srclen; ++ ELzmaStatus status; ++ ++ ret = LzmaDecode(cpage_out, &dl, data_in, &sl, propsEncoded, ++ propsSize, LZMA_FINISH_ANY, &status, &lzma_alloc); ++ ++ if (ret != SZ_OK || status == LZMA_STATUS_NOT_FINISHED || dl != (SizeT)destlen) ++ return -1; ++ ++ return 0; ++} ++ ++static struct jffs2_compressor jffs2_lzma_comp = { ++ .priority = JFFS2_LZMA_PRIORITY, ++ .name = "lzma", ++ .compr = JFFS2_COMPR_LZMA, ++ .compress = &jffs2_lzma_compress, ++ .decompress = &jffs2_lzma_decompress, ++ .disabled = 0, ++}; ++ ++int INIT jffs2_lzma_init(void) ++{ ++ int ret; ++ CLzmaEncProps props; ++ LzmaEncProps_Init(&props); ++ ++ props.dictSize = LZMA_BEST_DICT(0x2000); ++ props.level = LZMA_BEST_LEVEL; ++ props.lc = LZMA_BEST_LC; ++ props.lp = LZMA_BEST_LP; ++ props.pb = LZMA_BEST_PB; ++ props.fb = LZMA_BEST_FB; ++ ++ ret = lzma_alloc_workspace(&props); ++ if (ret < 0) ++ return ret; ++ ++ ret = jffs2_register_compressor(&jffs2_lzma_comp); ++ if (ret) ++ lzma_free_workspace(); ++ ++ return ret; ++} ++ ++void jffs2_lzma_exit(void) ++{ ++ jffs2_unregister_compressor(&jffs2_lzma_comp); ++ lzma_free_workspace(); ++} +--- a/include/linux/jffs2.h ++++ b/include/linux/jffs2.h +@@ -47,6 +47,7 @@ + #define JFFS2_COMPR_DYNRUBIN 0x05 + #define JFFS2_COMPR_ZLIB 0x06 + #define JFFS2_COMPR_LZO 0x07 ++#define JFFS2_COMPR_LZMA 0x08 + /* Compatibility flags. */ + #define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ + #define JFFS2_NODE_ACCURATE 0x2000 +--- /dev/null ++++ b/include/linux/lzma.h +@@ -0,0 +1,61 @@ ++#ifndef __LZMA_H__ ++#define __LZMA_H__ ++ ++#ifdef __KERNEL__ ++ #include ++ #include ++ #include ++ #include ++ #include ++ #define LZMA_MALLOC vmalloc ++ #define LZMA_FREE vfree ++ #define PRINT_ERROR(msg) printk(KERN_WARNING #msg) ++ #define INIT __init ++ #define STATIC static ++#else ++ #include ++ #include ++ #include ++ #include ++ #include ++ #include ++ #include ++ #ifndef PAGE_SIZE ++ extern int page_size; ++ #define PAGE_SIZE page_size ++ #endif ++ #define LZMA_MALLOC malloc ++ #define LZMA_FREE free ++ #define PRINT_ERROR(msg) fprintf(stderr, msg) ++ #define INIT ++ #define STATIC ++#endif ++ ++#include "lzma/LzmaDec.h" ++#include "lzma/LzmaEnc.h" ++ ++#define LZMA_BEST_LEVEL (9) ++#define LZMA_BEST_LC (0) ++#define LZMA_BEST_LP (0) ++#define LZMA_BEST_PB (0) ++#define LZMA_BEST_FB (273) ++ ++#define LZMA_BEST_DICT(n) (((int)((n) / 2)) * 2) ++ ++static void *p_lzma_malloc(void *p, size_t size) ++{ ++ if (size == 0) ++ return NULL; ++ ++ return LZMA_MALLOC(size); ++} ++ ++static void p_lzma_free(void *p, void *address) ++{ ++ if (address != NULL) ++ LZMA_FREE(address); ++} ++ ++static ISzAlloc lzma_alloc = {p_lzma_malloc, p_lzma_free}; ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/LzFind.h +@@ -0,0 +1,116 @@ ++/* LzFind.h -- Match finder for LZ algorithms ++2008-04-04 ++Copyright (c) 1999-2008 Igor Pavlov ++You can use any of the following license options: ++ 1) GNU Lesser General Public License (GNU LGPL) ++ 2) Common Public License (CPL) ++ 3) Common Development and Distribution License (CDDL) Version 1.0 ++ 4) Igor Pavlov, as the author of this code, expressly permits you to ++ statically or dynamically link your code (or bind by name) to this file, ++ while you keep this file unmodified. ++*/ ++ ++#ifndef __LZFIND_H ++#define __LZFIND_H ++ ++#include "Types.h" ++ ++typedef UInt32 CLzRef; ++ ++typedef struct _CMatchFinder ++{ ++ Byte *buffer; ++ UInt32 pos; ++ UInt32 posLimit; ++ UInt32 streamPos; ++ UInt32 lenLimit; ++ ++ UInt32 cyclicBufferPos; ++ UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */ ++ ++ UInt32 matchMaxLen; ++ CLzRef *hash; ++ CLzRef *son; ++ UInt32 hashMask; ++ UInt32 cutValue; ++ ++ Byte *bufferBase; ++ ISeqInStream *stream; ++ int streamEndWasReached; ++ ++ UInt32 blockSize; ++ UInt32 keepSizeBefore; ++ UInt32 keepSizeAfter; ++ ++ UInt32 numHashBytes; ++ int directInput; ++ int btMode; ++ /* int skipModeBits; */ ++ int bigHash; ++ UInt32 historySize; ++ UInt32 fixedHashSize; ++ UInt32 hashSizeSum; ++ UInt32 numSons; ++ SRes result; ++ UInt32 crc[256]; ++} CMatchFinder; ++ ++#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer) ++#define Inline_MatchFinder_GetIndexByte(p, index) ((p)->buffer[(Int32)(index)]) ++ ++#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos) ++ ++int MatchFinder_NeedMove(CMatchFinder *p); ++Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p); ++void MatchFinder_MoveBlock(CMatchFinder *p); ++void MatchFinder_ReadIfRequired(CMatchFinder *p); ++ ++void MatchFinder_Construct(CMatchFinder *p); ++ ++/* Conditions: ++ historySize <= 3 GB ++ keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB ++*/ ++int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, ++ UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ++ ISzAlloc *alloc); ++void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc); ++void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems); ++void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue); ++ ++UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son, ++ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, ++ UInt32 *distances, UInt32 maxLen); ++ ++/* ++Conditions: ++ Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func. ++ Mf_GetPointerToCurrentPos_Func's result must be used only before any other function ++*/ ++ ++typedef void (*Mf_Init_Func)(void *object); ++typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index); ++typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object); ++typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object); ++typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances); ++typedef void (*Mf_Skip_Func)(void *object, UInt32); ++ ++typedef struct _IMatchFinder ++{ ++ Mf_Init_Func Init; ++ Mf_GetIndexByte_Func GetIndexByte; ++ Mf_GetNumAvailableBytes_Func GetNumAvailableBytes; ++ Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos; ++ Mf_GetMatches_Func GetMatches; ++ Mf_Skip_Func Skip; ++} IMatchFinder; ++ ++void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable); ++ ++void MatchFinder_Init(CMatchFinder *p); ++UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); ++UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); ++void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); ++void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/LzHash.h +@@ -0,0 +1,56 @@ ++/* LzHash.h -- HASH functions for LZ algorithms ++2008-03-26 ++Copyright (c) 1999-2008 Igor Pavlov ++Read LzFind.h for license options */ ++ ++#ifndef __LZHASH_H ++#define __LZHASH_H ++ ++#define kHash2Size (1 << 10) ++#define kHash3Size (1 << 16) ++#define kHash4Size (1 << 20) ++ ++#define kFix3HashSize (kHash2Size) ++#define kFix4HashSize (kHash2Size + kHash3Size) ++#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size) ++ ++#define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8); ++ ++#define HASH3_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; } ++ ++#define HASH4_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ ++ hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; } ++ ++#define HASH5_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ ++ hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \ ++ hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \ ++ hash4Value &= (kHash4Size - 1); } ++ ++/* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */ ++#define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF; ++ ++ ++#define MT_HASH2_CALC \ ++ hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1); ++ ++#define MT_HASH3_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); } ++ ++#define MT_HASH4_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ ++ hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); } ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/LzmaDec.h +@@ -0,0 +1,232 @@ ++/* LzmaDec.h -- LZMA Decoder ++2008-04-29 ++Copyright (c) 1999-2008 Igor Pavlov ++You can use any of the following license options: ++ 1) GNU Lesser General Public License (GNU LGPL) ++ 2) Common Public License (CPL) ++ 3) Common Development and Distribution License (CDDL) Version 1.0 ++ 4) Igor Pavlov, as the author of this code, expressly permits you to ++ statically or dynamically link your code (or bind by name) to this file, ++ while you keep this file unmodified. ++*/ ++ ++#ifndef __LZMADEC_H ++#define __LZMADEC_H ++ ++#include "Types.h" ++ ++/* #define _LZMA_PROB32 */ ++/* _LZMA_PROB32 can increase the speed on some CPUs, ++ but memory usage for CLzmaDec::probs will be doubled in that case */ ++ ++#ifdef _LZMA_PROB32 ++#define CLzmaProb UInt32 ++#else ++#define CLzmaProb UInt16 ++#endif ++ ++ ++/* ---------- LZMA Properties ---------- */ ++ ++#define LZMA_PROPS_SIZE 5 ++ ++typedef struct _CLzmaProps ++{ ++ unsigned lc, lp, pb; ++ UInt32 dicSize; ++} CLzmaProps; ++ ++/* LzmaProps_Decode - decodes properties ++Returns: ++ SZ_OK ++ SZ_ERROR_UNSUPPORTED - Unsupported properties ++*/ ++ ++SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size); ++ ++ ++/* ---------- LZMA Decoder state ---------- */ ++ ++/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case. ++ Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */ ++ ++#define LZMA_REQUIRED_INPUT_MAX 20 ++ ++typedef struct ++{ ++ CLzmaProps prop; ++ CLzmaProb *probs; ++ Byte *dic; ++ const Byte *buf; ++ UInt32 range, code; ++ SizeT dicPos; ++ SizeT dicBufSize; ++ UInt32 processedPos; ++ UInt32 checkDicSize; ++ unsigned state; ++ UInt32 reps[4]; ++ unsigned remainLen; ++ int needFlush; ++ int needInitState; ++ UInt32 numProbs; ++ unsigned tempBufSize; ++ Byte tempBuf[LZMA_REQUIRED_INPUT_MAX]; ++} CLzmaDec; ++ ++#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; } ++ ++void LzmaDec_Init(CLzmaDec *p); ++ ++/* There are two types of LZMA streams: ++ 0) Stream with end mark. That end mark adds about 6 bytes to compressed size. ++ 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */ ++ ++typedef enum ++{ ++ LZMA_FINISH_ANY, /* finish at any point */ ++ LZMA_FINISH_END /* block must be finished at the end */ ++} ELzmaFinishMode; ++ ++/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!! ++ ++ You must use LZMA_FINISH_END, when you know that current output buffer ++ covers last bytes of block. In other cases you must use LZMA_FINISH_ANY. ++ ++ If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK, ++ and output value of destLen will be less than output buffer size limit. ++ You can check status result also. ++ ++ You can use multiple checks to test data integrity after full decompression: ++ 1) Check Result and "status" variable. ++ 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize. ++ 3) Check that output(srcLen) = compressedSize, if you know real compressedSize. ++ You must use correct finish mode in that case. */ ++ ++typedef enum ++{ ++ LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */ ++ LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */ ++ LZMA_STATUS_NOT_FINISHED, /* stream was not finished */ ++ LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */ ++ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */ ++} ELzmaStatus; ++ ++/* ELzmaStatus is used only as output value for function call */ ++ ++ ++/* ---------- Interfaces ---------- */ ++ ++/* There are 3 levels of interfaces: ++ 1) Dictionary Interface ++ 2) Buffer Interface ++ 3) One Call Interface ++ You can select any of these interfaces, but don't mix functions from different ++ groups for same object. */ ++ ++ ++/* There are two variants to allocate state for Dictionary Interface: ++ 1) LzmaDec_Allocate / LzmaDec_Free ++ 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs ++ You can use variant 2, if you set dictionary buffer manually. ++ For Buffer Interface you must always use variant 1. ++ ++LzmaDec_Allocate* can return: ++ SZ_OK ++ SZ_ERROR_MEM - Memory allocation error ++ SZ_ERROR_UNSUPPORTED - Unsupported properties ++*/ ++ ++SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc); ++void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc); ++ ++SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc); ++void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc); ++ ++/* ---------- Dictionary Interface ---------- */ ++ ++/* You can use it, if you want to eliminate the overhead for data copying from ++ dictionary to some other external buffer. ++ You must work with CLzmaDec variables directly in this interface. ++ ++ STEPS: ++ LzmaDec_Constr() ++ LzmaDec_Allocate() ++ for (each new stream) ++ { ++ LzmaDec_Init() ++ while (it needs more decompression) ++ { ++ LzmaDec_DecodeToDic() ++ use data from CLzmaDec::dic and update CLzmaDec::dicPos ++ } ++ } ++ LzmaDec_Free() ++*/ ++ ++/* LzmaDec_DecodeToDic ++ ++ The decoding to internal dictionary buffer (CLzmaDec::dic). ++ You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!! ++ ++finishMode: ++ It has meaning only if the decoding reaches output limit (dicLimit). ++ LZMA_FINISH_ANY - Decode just dicLimit bytes. ++ LZMA_FINISH_END - Stream must be finished after dicLimit. ++ ++Returns: ++ SZ_OK ++ status: ++ LZMA_STATUS_FINISHED_WITH_MARK ++ LZMA_STATUS_NOT_FINISHED ++ LZMA_STATUS_NEEDS_MORE_INPUT ++ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK ++ SZ_ERROR_DATA - Data error ++*/ ++ ++SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, ++ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); ++ ++ ++/* ---------- Buffer Interface ---------- */ ++ ++/* It's zlib-like interface. ++ See LzmaDec_DecodeToDic description for information about STEPS and return results, ++ but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need ++ to work with CLzmaDec variables manually. ++ ++finishMode: ++ It has meaning only if the decoding reaches output limit (*destLen). ++ LZMA_FINISH_ANY - Decode just destLen bytes. ++ LZMA_FINISH_END - Stream must be finished after (*destLen). ++*/ ++ ++SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, ++ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); ++ ++ ++/* ---------- One Call Interface ---------- */ ++ ++/* LzmaDecode ++ ++finishMode: ++ It has meaning only if the decoding reaches output limit (*destLen). ++ LZMA_FINISH_ANY - Decode just destLen bytes. ++ LZMA_FINISH_END - Stream must be finished after (*destLen). ++ ++Returns: ++ SZ_OK ++ status: ++ LZMA_STATUS_FINISHED_WITH_MARK ++ LZMA_STATUS_NOT_FINISHED ++ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK ++ SZ_ERROR_DATA - Data error ++ SZ_ERROR_MEM - Memory allocation error ++ SZ_ERROR_UNSUPPORTED - Unsupported properties ++ SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). ++*/ ++ ++SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ++ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, ++ ELzmaStatus *status, ISzAlloc *alloc); ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/LzmaEnc.h +@@ -0,0 +1,74 @@ ++/* LzmaEnc.h -- LZMA Encoder ++2008-04-27 ++Copyright (c) 1999-2008 Igor Pavlov ++Read LzFind.h for license options */ ++ ++#ifndef __LZMAENC_H ++#define __LZMAENC_H ++ ++#include "Types.h" ++ ++#define LZMA_PROPS_SIZE 5 ++ ++typedef struct _CLzmaEncProps ++{ ++ int level; /* 0 <= level <= 9 */ ++ UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version ++ (1 << 12) <= dictSize <= (1 << 30) for 64-bit version ++ default = (1 << 24) */ ++ int lc; /* 0 <= lc <= 8, default = 3 */ ++ int lp; /* 0 <= lp <= 4, default = 0 */ ++ int pb; /* 0 <= pb <= 4, default = 2 */ ++ int algo; /* 0 - fast, 1 - normal, default = 1 */ ++ int fb; /* 5 <= fb <= 273, default = 32 */ ++ int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */ ++ int numHashBytes; /* 2, 3 or 4, default = 4 */ ++ UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */ ++ unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */ ++ int numThreads; /* 1 or 2, default = 2 */ ++} CLzmaEncProps; ++ ++void LzmaEncProps_Init(CLzmaEncProps *p); ++void LzmaEncProps_Normalize(CLzmaEncProps *p); ++UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2); ++ ++ ++/* ---------- CLzmaEncHandle Interface ---------- */ ++ ++/* LzmaEnc_* functions can return the following exit codes: ++Returns: ++ SZ_OK - OK ++ SZ_ERROR_MEM - Memory allocation error ++ SZ_ERROR_PARAM - Incorrect paramater in props ++ SZ_ERROR_WRITE - Write callback error. ++ SZ_ERROR_PROGRESS - some break from progress callback ++ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) ++*/ ++ ++typedef void * CLzmaEncHandle; ++ ++CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc); ++void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig); ++SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props); ++SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size); ++SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream, ++ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); ++SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, ++ int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); ++ ++/* ---------- One Call Interface ---------- */ ++ ++/* LzmaEncode ++Return code: ++ SZ_OK - OK ++ SZ_ERROR_MEM - Memory allocation error ++ SZ_ERROR_PARAM - Incorrect paramater ++ SZ_ERROR_OUTPUT_EOF - output buffer overflow ++ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) ++*/ ++ ++SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, ++ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, ++ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/Types.h +@@ -0,0 +1,130 @@ ++/* Types.h -- Basic types ++2008-04-11 ++Igor Pavlov ++Public domain */ ++ ++#ifndef __7Z_TYPES_H ++#define __7Z_TYPES_H ++ ++#define SZ_OK 0 ++ ++#define SZ_ERROR_DATA 1 ++#define SZ_ERROR_MEM 2 ++#define SZ_ERROR_CRC 3 ++#define SZ_ERROR_UNSUPPORTED 4 ++#define SZ_ERROR_PARAM 5 ++#define SZ_ERROR_INPUT_EOF 6 ++#define SZ_ERROR_OUTPUT_EOF 7 ++#define SZ_ERROR_READ 8 ++#define SZ_ERROR_WRITE 9 ++#define SZ_ERROR_PROGRESS 10 ++#define SZ_ERROR_FAIL 11 ++#define SZ_ERROR_THREAD 12 ++ ++#define SZ_ERROR_ARCHIVE 16 ++#define SZ_ERROR_NO_ARCHIVE 17 ++ ++typedef int SRes; ++ ++#ifndef RINOK ++#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } ++#endif ++ ++typedef unsigned char Byte; ++typedef short Int16; ++typedef unsigned short UInt16; ++ ++#ifdef _LZMA_UINT32_IS_ULONG ++typedef long Int32; ++typedef unsigned long UInt32; ++#else ++typedef int Int32; ++typedef unsigned int UInt32; ++#endif ++ ++/* #define _SZ_NO_INT_64 */ ++/* define it if your compiler doesn't support 64-bit integers */ ++ ++#ifdef _SZ_NO_INT_64 ++ ++typedef long Int64; ++typedef unsigned long UInt64; ++ ++#else ++ ++#if defined(_MSC_VER) || defined(__BORLANDC__) ++typedef __int64 Int64; ++typedef unsigned __int64 UInt64; ++#else ++typedef long long int Int64; ++typedef unsigned long long int UInt64; ++#endif ++ ++#endif ++ ++#ifdef _LZMA_NO_SYSTEM_SIZE_T ++typedef UInt32 SizeT; ++#else ++#include ++typedef size_t SizeT; ++#endif ++ ++typedef int Bool; ++#define True 1 ++#define False 0 ++ ++ ++#ifdef _MSC_VER ++ ++#if _MSC_VER >= 1300 ++#define MY_NO_INLINE __declspec(noinline) ++#else ++#define MY_NO_INLINE ++#endif ++ ++#define MY_CDECL __cdecl ++#define MY_STD_CALL __stdcall ++#define MY_FAST_CALL MY_NO_INLINE __fastcall ++ ++#else ++ ++#define MY_CDECL ++#define MY_STD_CALL ++#define MY_FAST_CALL ++ ++#endif ++ ++ ++/* The following interfaces use first parameter as pointer to structure */ ++ ++typedef struct ++{ ++ SRes (*Read)(void *p, void *buf, size_t *size); ++ /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. ++ (output(*size) < input(*size)) is allowed */ ++} ISeqInStream; ++ ++typedef struct ++{ ++ size_t (*Write)(void *p, const void *buf, size_t size); ++ /* Returns: result - the number of actually written bytes. ++ (result < size) means error */ ++} ISeqOutStream; ++ ++typedef struct ++{ ++ SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize); ++ /* Returns: result. (result != SZ_OK) means break. ++ Value (UInt64)(Int64)-1 for size means unknown value. */ ++} ICompressProgress; ++ ++typedef struct ++{ ++ void *(*Alloc)(void *p, size_t size); ++ void (*Free)(void *p, void *address); /* address can be 0 */ ++} ISzAlloc; ++ ++#define IAlloc_Alloc(p, size) (p)->Alloc((p), size) ++#define IAlloc_Free(p, a) (p)->Free((p), a) ++ ++#endif +--- /dev/null ++++ b/lzma/LzFind.c +@@ -0,0 +1,753 @@ ++/* LzFind.c -- Match finder for LZ algorithms ++2008-04-04 ++Copyright (c) 1999-2008 Igor Pavlov ++Read LzFind.h for license options */ ++ ++#include ++ ++#include "LzFind.h" ++#include "LzHash.h" ++ ++#define kEmptyHashValue 0 ++#define kMaxValForNormalize ((UInt32)0xFFFFFFFF) ++#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */ ++#define kNormalizeMask (~(kNormalizeStepMin - 1)) ++#define kMaxHistorySize ((UInt32)3 << 30) ++ ++#define kStartMaxLen 3 ++ ++static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc) ++{ ++ if (!p->directInput) ++ { ++ alloc->Free(alloc, p->bufferBase); ++ p->bufferBase = 0; ++ } ++} ++ ++/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */ ++ ++static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc) ++{ ++ UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv; ++ if (p->directInput) ++ { ++ p->blockSize = blockSize; ++ return 1; ++ } ++ if (p->bufferBase == 0 || p->blockSize != blockSize) ++ { ++ LzInWindow_Free(p, alloc); ++ p->blockSize = blockSize; ++ p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize); ++ } ++ return (p->bufferBase != 0); ++} ++ ++Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } ++Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; } ++ ++UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } ++ ++void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue) ++{ ++ p->posLimit -= subValue; ++ p->pos -= subValue; ++ p->streamPos -= subValue; ++} ++ ++static void MatchFinder_ReadBlock(CMatchFinder *p) ++{ ++ if (p->streamEndWasReached || p->result != SZ_OK) ++ return; ++ for (;;) ++ { ++ Byte *dest = p->buffer + (p->streamPos - p->pos); ++ size_t size = (p->bufferBase + p->blockSize - dest); ++ if (size == 0) ++ return; ++ p->result = p->stream->Read(p->stream, dest, &size); ++ if (p->result != SZ_OK) ++ return; ++ if (size == 0) ++ { ++ p->streamEndWasReached = 1; ++ return; ++ } ++ p->streamPos += (UInt32)size; ++ if (p->streamPos - p->pos > p->keepSizeAfter) ++ return; ++ } ++} ++ ++void MatchFinder_MoveBlock(CMatchFinder *p) ++{ ++ memmove(p->bufferBase, ++ p->buffer - p->keepSizeBefore, ++ (size_t)(p->streamPos - p->pos + p->keepSizeBefore)); ++ p->buffer = p->bufferBase + p->keepSizeBefore; ++} ++ ++int MatchFinder_NeedMove(CMatchFinder *p) ++{ ++ /* if (p->streamEndWasReached) return 0; */ ++ return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter); ++} ++ ++void MatchFinder_ReadIfRequired(CMatchFinder *p) ++{ ++ if (p->streamEndWasReached) ++ return; ++ if (p->keepSizeAfter >= p->streamPos - p->pos) ++ MatchFinder_ReadBlock(p); ++} ++ ++static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p) ++{ ++ if (MatchFinder_NeedMove(p)) ++ MatchFinder_MoveBlock(p); ++ MatchFinder_ReadBlock(p); ++} ++ ++static void MatchFinder_SetDefaultSettings(CMatchFinder *p) ++{ ++ p->cutValue = 32; ++ p->btMode = 1; ++ p->numHashBytes = 4; ++ /* p->skipModeBits = 0; */ ++ p->directInput = 0; ++ p->bigHash = 0; ++} ++ ++#define kCrcPoly 0xEDB88320 ++ ++void MatchFinder_Construct(CMatchFinder *p) ++{ ++ UInt32 i; ++ p->bufferBase = 0; ++ p->directInput = 0; ++ p->hash = 0; ++ MatchFinder_SetDefaultSettings(p); ++ ++ for (i = 0; i < 256; i++) ++ { ++ UInt32 r = i; ++ int j; ++ for (j = 0; j < 8; j++) ++ r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1)); ++ p->crc[i] = r; ++ } ++} ++ ++static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->hash); ++ p->hash = 0; ++} ++ ++void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc) ++{ ++ MatchFinder_FreeThisClassMemory(p, alloc); ++ LzInWindow_Free(p, alloc); ++} ++ ++static CLzRef* AllocRefs(UInt32 num, ISzAlloc *alloc) ++{ ++ size_t sizeInBytes = (size_t)num * sizeof(CLzRef); ++ if (sizeInBytes / sizeof(CLzRef) != num) ++ return 0; ++ return (CLzRef *)alloc->Alloc(alloc, sizeInBytes); ++} ++ ++int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, ++ UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ++ ISzAlloc *alloc) ++{ ++ UInt32 sizeReserv; ++ if (historySize > kMaxHistorySize) ++ { ++ MatchFinder_Free(p, alloc); ++ return 0; ++ } ++ sizeReserv = historySize >> 1; ++ if (historySize > ((UInt32)2 << 30)) ++ sizeReserv = historySize >> 2; ++ sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19); ++ ++ p->keepSizeBefore = historySize + keepAddBufferBefore + 1; ++ p->keepSizeAfter = matchMaxLen + keepAddBufferAfter; ++ /* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */ ++ if (LzInWindow_Create(p, sizeReserv, alloc)) ++ { ++ UInt32 newCyclicBufferSize = (historySize /* >> p->skipModeBits */) + 1; ++ UInt32 hs; ++ p->matchMaxLen = matchMaxLen; ++ { ++ p->fixedHashSize = 0; ++ if (p->numHashBytes == 2) ++ hs = (1 << 16) - 1; ++ else ++ { ++ hs = historySize - 1; ++ hs |= (hs >> 1); ++ hs |= (hs >> 2); ++ hs |= (hs >> 4); ++ hs |= (hs >> 8); ++ hs >>= 1; ++ /* hs >>= p->skipModeBits; */ ++ hs |= 0xFFFF; /* don't change it! It's required for Deflate */ ++ if (hs > (1 << 24)) ++ { ++ if (p->numHashBytes == 3) ++ hs = (1 << 24) - 1; ++ else ++ hs >>= 1; ++ } ++ } ++ p->hashMask = hs; ++ hs++; ++ if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size; ++ if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size; ++ if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size; ++ hs += p->fixedHashSize; ++ } ++ ++ { ++ UInt32 prevSize = p->hashSizeSum + p->numSons; ++ UInt32 newSize; ++ p->historySize = historySize; ++ p->hashSizeSum = hs; ++ p->cyclicBufferSize = newCyclicBufferSize; ++ p->numSons = (p->btMode ? newCyclicBufferSize * 2 : newCyclicBufferSize); ++ newSize = p->hashSizeSum + p->numSons; ++ if (p->hash != 0 && prevSize == newSize) ++ return 1; ++ MatchFinder_FreeThisClassMemory(p, alloc); ++ p->hash = AllocRefs(newSize, alloc); ++ if (p->hash != 0) ++ { ++ p->son = p->hash + p->hashSizeSum; ++ return 1; ++ } ++ } ++ } ++ MatchFinder_Free(p, alloc); ++ return 0; ++} ++ ++static void MatchFinder_SetLimits(CMatchFinder *p) ++{ ++ UInt32 limit = kMaxValForNormalize - p->pos; ++ UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos; ++ if (limit2 < limit) ++ limit = limit2; ++ limit2 = p->streamPos - p->pos; ++ if (limit2 <= p->keepSizeAfter) ++ { ++ if (limit2 > 0) ++ limit2 = 1; ++ } ++ else ++ limit2 -= p->keepSizeAfter; ++ if (limit2 < limit) ++ limit = limit2; ++ { ++ UInt32 lenLimit = p->streamPos - p->pos; ++ if (lenLimit > p->matchMaxLen) ++ lenLimit = p->matchMaxLen; ++ p->lenLimit = lenLimit; ++ } ++ p->posLimit = p->pos + limit; ++} ++ ++void MatchFinder_Init(CMatchFinder *p) ++{ ++ UInt32 i; ++ for(i = 0; i < p->hashSizeSum; i++) ++ p->hash[i] = kEmptyHashValue; ++ p->cyclicBufferPos = 0; ++ p->buffer = p->bufferBase; ++ p->pos = p->streamPos = p->cyclicBufferSize; ++ p->result = SZ_OK; ++ p->streamEndWasReached = 0; ++ MatchFinder_ReadBlock(p); ++ MatchFinder_SetLimits(p); ++} ++ ++static UInt32 MatchFinder_GetSubValue(CMatchFinder *p) ++{ ++ return (p->pos - p->historySize - 1) & kNormalizeMask; ++} ++ ++void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems) ++{ ++ UInt32 i; ++ for (i = 0; i < numItems; i++) ++ { ++ UInt32 value = items[i]; ++ if (value <= subValue) ++ value = kEmptyHashValue; ++ else ++ value -= subValue; ++ items[i] = value; ++ } ++} ++ ++static void MatchFinder_Normalize(CMatchFinder *p) ++{ ++ UInt32 subValue = MatchFinder_GetSubValue(p); ++ MatchFinder_Normalize3(subValue, p->hash, p->hashSizeSum + p->numSons); ++ MatchFinder_ReduceOffsets(p, subValue); ++} ++ ++static void MatchFinder_CheckLimits(CMatchFinder *p) ++{ ++ if (p->pos == kMaxValForNormalize) ++ MatchFinder_Normalize(p); ++ if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos) ++ MatchFinder_CheckAndMoveAndRead(p); ++ if (p->cyclicBufferPos == p->cyclicBufferSize) ++ p->cyclicBufferPos = 0; ++ MatchFinder_SetLimits(p); ++} ++ ++static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, ++ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, ++ UInt32 *distances, UInt32 maxLen) ++{ ++ son[_cyclicBufferPos] = curMatch; ++ for (;;) ++ { ++ UInt32 delta = pos - curMatch; ++ if (cutValue-- == 0 || delta >= _cyclicBufferSize) ++ return distances; ++ { ++ const Byte *pb = cur - delta; ++ curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)]; ++ if (pb[maxLen] == cur[maxLen] && *pb == *cur) ++ { ++ UInt32 len = 0; ++ while(++len != lenLimit) ++ if (pb[len] != cur[len]) ++ break; ++ if (maxLen < len) ++ { ++ *distances++ = maxLen = len; ++ *distances++ = delta - 1; ++ if (len == lenLimit) ++ return distances; ++ } ++ } ++ } ++ } ++} ++ ++UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, ++ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, ++ UInt32 *distances, UInt32 maxLen) ++{ ++ CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; ++ CLzRef *ptr1 = son + (_cyclicBufferPos << 1); ++ UInt32 len0 = 0, len1 = 0; ++ for (;;) ++ { ++ UInt32 delta = pos - curMatch; ++ if (cutValue-- == 0 || delta >= _cyclicBufferSize) ++ { ++ *ptr0 = *ptr1 = kEmptyHashValue; ++ return distances; ++ } ++ { ++ CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); ++ const Byte *pb = cur - delta; ++ UInt32 len = (len0 < len1 ? len0 : len1); ++ if (pb[len] == cur[len]) ++ { ++ if (++len != lenLimit && pb[len] == cur[len]) ++ while(++len != lenLimit) ++ if (pb[len] != cur[len]) ++ break; ++ if (maxLen < len) ++ { ++ *distances++ = maxLen = len; ++ *distances++ = delta - 1; ++ if (len == lenLimit) ++ { ++ *ptr1 = pair[0]; ++ *ptr0 = pair[1]; ++ return distances; ++ } ++ } ++ } ++ if (pb[len] < cur[len]) ++ { ++ *ptr1 = curMatch; ++ ptr1 = pair + 1; ++ curMatch = *ptr1; ++ len1 = len; ++ } ++ else ++ { ++ *ptr0 = curMatch; ++ ptr0 = pair; ++ curMatch = *ptr0; ++ len0 = len; ++ } ++ } ++ } ++} ++ ++static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, ++ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue) ++{ ++ CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; ++ CLzRef *ptr1 = son + (_cyclicBufferPos << 1); ++ UInt32 len0 = 0, len1 = 0; ++ for (;;) ++ { ++ UInt32 delta = pos - curMatch; ++ if (cutValue-- == 0 || delta >= _cyclicBufferSize) ++ { ++ *ptr0 = *ptr1 = kEmptyHashValue; ++ return; ++ } ++ { ++ CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); ++ const Byte *pb = cur - delta; ++ UInt32 len = (len0 < len1 ? len0 : len1); ++ if (pb[len] == cur[len]) ++ { ++ while(++len != lenLimit) ++ if (pb[len] != cur[len]) ++ break; ++ { ++ if (len == lenLimit) ++ { ++ *ptr1 = pair[0]; ++ *ptr0 = pair[1]; ++ return; ++ } ++ } ++ } ++ if (pb[len] < cur[len]) ++ { ++ *ptr1 = curMatch; ++ ptr1 = pair + 1; ++ curMatch = *ptr1; ++ len1 = len; ++ } ++ else ++ { ++ *ptr0 = curMatch; ++ ptr0 = pair; ++ curMatch = *ptr0; ++ len0 = len; ++ } ++ } ++ } ++} ++ ++#define MOVE_POS \ ++ ++p->cyclicBufferPos; \ ++ p->buffer++; \ ++ if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); ++ ++#define MOVE_POS_RET MOVE_POS return offset; ++ ++static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; } ++ ++#define GET_MATCHES_HEADER2(minLen, ret_op) \ ++ UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \ ++ lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \ ++ cur = p->buffer; ++ ++#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0) ++#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue) ++ ++#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue ++ ++#define GET_MATCHES_FOOTER(offset, maxLen) \ ++ offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \ ++ distances + offset, maxLen) - distances); MOVE_POS_RET; ++ ++#define SKIP_FOOTER \ ++ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS; ++ ++static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 offset; ++ GET_MATCHES_HEADER(2) ++ HASH2_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ offset = 0; ++ GET_MATCHES_FOOTER(offset, 1) ++} ++ ++UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 offset; ++ GET_MATCHES_HEADER(3) ++ HASH_ZIP_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ offset = 0; ++ GET_MATCHES_FOOTER(offset, 2) ++} ++ ++static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 hash2Value, delta2, maxLen, offset; ++ GET_MATCHES_HEADER(3) ++ ++ HASH3_CALC; ++ ++ delta2 = p->pos - p->hash[hash2Value]; ++ curMatch = p->hash[kFix3HashSize + hashValue]; ++ ++ p->hash[hash2Value] = ++ p->hash[kFix3HashSize + hashValue] = p->pos; ++ ++ ++ maxLen = 2; ++ offset = 0; ++ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) ++ { ++ for (; maxLen != lenLimit; maxLen++) ++ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) ++ break; ++ distances[0] = maxLen; ++ distances[1] = delta2 - 1; ++ offset = 2; ++ if (maxLen == lenLimit) ++ { ++ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); ++ MOVE_POS_RET; ++ } ++ } ++ GET_MATCHES_FOOTER(offset, maxLen) ++} ++ ++static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; ++ GET_MATCHES_HEADER(4) ++ ++ HASH4_CALC; ++ ++ delta2 = p->pos - p->hash[ hash2Value]; ++ delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; ++ curMatch = p->hash[kFix4HashSize + hashValue]; ++ ++ p->hash[ hash2Value] = ++ p->hash[kFix3HashSize + hash3Value] = ++ p->hash[kFix4HashSize + hashValue] = p->pos; ++ ++ maxLen = 1; ++ offset = 0; ++ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) ++ { ++ distances[0] = maxLen = 2; ++ distances[1] = delta2 - 1; ++ offset = 2; ++ } ++ if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) ++ { ++ maxLen = 3; ++ distances[offset + 1] = delta3 - 1; ++ offset += 2; ++ delta2 = delta3; ++ } ++ if (offset != 0) ++ { ++ for (; maxLen != lenLimit; maxLen++) ++ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) ++ break; ++ distances[offset - 2] = maxLen; ++ if (maxLen == lenLimit) ++ { ++ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); ++ MOVE_POS_RET; ++ } ++ } ++ if (maxLen < 3) ++ maxLen = 3; ++ GET_MATCHES_FOOTER(offset, maxLen) ++} ++ ++static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; ++ GET_MATCHES_HEADER(4) ++ ++ HASH4_CALC; ++ ++ delta2 = p->pos - p->hash[ hash2Value]; ++ delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; ++ curMatch = p->hash[kFix4HashSize + hashValue]; ++ ++ p->hash[ hash2Value] = ++ p->hash[kFix3HashSize + hash3Value] = ++ p->hash[kFix4HashSize + hashValue] = p->pos; ++ ++ maxLen = 1; ++ offset = 0; ++ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) ++ { ++ distances[0] = maxLen = 2; ++ distances[1] = delta2 - 1; ++ offset = 2; ++ } ++ if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) ++ { ++ maxLen = 3; ++ distances[offset + 1] = delta3 - 1; ++ offset += 2; ++ delta2 = delta3; ++ } ++ if (offset != 0) ++ { ++ for (; maxLen != lenLimit; maxLen++) ++ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) ++ break; ++ distances[offset - 2] = maxLen; ++ if (maxLen == lenLimit) ++ { ++ p->son[p->cyclicBufferPos] = curMatch; ++ MOVE_POS_RET; ++ } ++ } ++ if (maxLen < 3) ++ maxLen = 3; ++ offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), ++ distances + offset, maxLen) - (distances)); ++ MOVE_POS_RET ++} ++ ++UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 offset; ++ GET_MATCHES_HEADER(3) ++ HASH_ZIP_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), ++ distances, 2) - (distances)); ++ MOVE_POS_RET ++} ++ ++static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ SKIP_HEADER(2) ++ HASH2_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ SKIP_FOOTER ++ } ++ while (--num != 0); ++} ++ ++void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ SKIP_HEADER(3) ++ HASH_ZIP_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ SKIP_FOOTER ++ } ++ while (--num != 0); ++} ++ ++static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ UInt32 hash2Value; ++ SKIP_HEADER(3) ++ HASH3_CALC; ++ curMatch = p->hash[kFix3HashSize + hashValue]; ++ p->hash[hash2Value] = ++ p->hash[kFix3HashSize + hashValue] = p->pos; ++ SKIP_FOOTER ++ } ++ while (--num != 0); ++} ++ ++static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ UInt32 hash2Value, hash3Value; ++ SKIP_HEADER(4) ++ HASH4_CALC; ++ curMatch = p->hash[kFix4HashSize + hashValue]; ++ p->hash[ hash2Value] = ++ p->hash[kFix3HashSize + hash3Value] = p->pos; ++ p->hash[kFix4HashSize + hashValue] = p->pos; ++ SKIP_FOOTER ++ } ++ while (--num != 0); ++} ++ ++static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ UInt32 hash2Value, hash3Value; ++ SKIP_HEADER(4) ++ HASH4_CALC; ++ curMatch = p->hash[kFix4HashSize + hashValue]; ++ p->hash[ hash2Value] = ++ p->hash[kFix3HashSize + hash3Value] = ++ p->hash[kFix4HashSize + hashValue] = p->pos; ++ p->son[p->cyclicBufferPos] = curMatch; ++ MOVE_POS ++ } ++ while (--num != 0); ++} ++ ++void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ SKIP_HEADER(3) ++ HASH_ZIP_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ p->son[p->cyclicBufferPos] = curMatch; ++ MOVE_POS ++ } ++ while (--num != 0); ++} ++ ++void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable) ++{ ++ vTable->Init = (Mf_Init_Func)MatchFinder_Init; ++ vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte; ++ vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes; ++ vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos; ++ if (!p->btMode) ++ { ++ vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches; ++ vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip; ++ } ++ else if (p->numHashBytes == 2) ++ { ++ vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches; ++ vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip; ++ } ++ else if (p->numHashBytes == 3) ++ { ++ vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches; ++ vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip; ++ } ++ else ++ { ++ vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches; ++ vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip; ++ } ++} +--- /dev/null ++++ b/lzma/LzmaDec.c +@@ -0,0 +1,1014 @@ ++/* LzmaDec.c -- LZMA Decoder ++2008-04-29 ++Copyright (c) 1999-2008 Igor Pavlov ++Read LzmaDec.h for license options */ ++ ++#include "LzmaDec.h" ++ ++#include ++ ++#define kNumTopBits 24 ++#define kTopValue ((UInt32)1 << kNumTopBits) ++ ++#define kNumBitModelTotalBits 11 ++#define kBitModelTotal (1 << kNumBitModelTotalBits) ++#define kNumMoveBits 5 ++ ++#define RC_INIT_SIZE 5 ++ ++#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); } ++ ++#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) ++#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); ++#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits)); ++#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \ ++ { UPDATE_0(p); i = (i + i); A0; } else \ ++ { UPDATE_1(p); i = (i + i) + 1; A1; } ++#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;) ++ ++#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); } ++#define TREE_DECODE(probs, limit, i) \ ++ { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; } ++ ++/* #define _LZMA_SIZE_OPT */ ++ ++#ifdef _LZMA_SIZE_OPT ++#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i) ++#else ++#define TREE_6_DECODE(probs, i) \ ++ { i = 1; \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ i -= 0x40; } ++#endif ++ ++#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); } ++ ++#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) ++#define UPDATE_0_CHECK range = bound; ++#define UPDATE_1_CHECK range -= bound; code -= bound; ++#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \ ++ { UPDATE_0_CHECK; i = (i + i); A0; } else \ ++ { UPDATE_1_CHECK; i = (i + i) + 1; A1; } ++#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;) ++#define TREE_DECODE_CHECK(probs, limit, i) \ ++ { i = 1; do { GET_BIT_CHECK(probs + i, i) } while(i < limit); i -= limit; } ++ ++ ++#define kNumPosBitsMax 4 ++#define kNumPosStatesMax (1 << kNumPosBitsMax) ++ ++#define kLenNumLowBits 3 ++#define kLenNumLowSymbols (1 << kLenNumLowBits) ++#define kLenNumMidBits 3 ++#define kLenNumMidSymbols (1 << kLenNumMidBits) ++#define kLenNumHighBits 8 ++#define kLenNumHighSymbols (1 << kLenNumHighBits) ++ ++#define LenChoice 0 ++#define LenChoice2 (LenChoice + 1) ++#define LenLow (LenChoice2 + 1) ++#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits)) ++#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits)) ++#define kNumLenProbs (LenHigh + kLenNumHighSymbols) ++ ++ ++#define kNumStates 12 ++#define kNumLitStates 7 ++ ++#define kStartPosModelIndex 4 ++#define kEndPosModelIndex 14 ++#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) ++ ++#define kNumPosSlotBits 6 ++#define kNumLenToPosStates 4 ++ ++#define kNumAlignBits 4 ++#define kAlignTableSize (1 << kNumAlignBits) ++ ++#define kMatchMinLen 2 ++#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) ++ ++#define IsMatch 0 ++#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax)) ++#define IsRepG0 (IsRep + kNumStates) ++#define IsRepG1 (IsRepG0 + kNumStates) ++#define IsRepG2 (IsRepG1 + kNumStates) ++#define IsRep0Long (IsRepG2 + kNumStates) ++#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax)) ++#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits)) ++#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex) ++#define LenCoder (Align + kAlignTableSize) ++#define RepLenCoder (LenCoder + kNumLenProbs) ++#define Literal (RepLenCoder + kNumLenProbs) ++ ++#define LZMA_BASE_SIZE 1846 ++#define LZMA_LIT_SIZE 768 ++ ++#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp))) ++ ++#if Literal != LZMA_BASE_SIZE ++StopCompilingDueBUG ++#endif ++ ++/* ++#define LZMA_STREAM_WAS_FINISHED_ID (-1) ++#define LZMA_SPEC_LEN_OFFSET (-3) ++*/ ++ ++Byte kLiteralNextStates[kNumStates * 2] = ++{ ++ 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5, ++ 7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10 ++}; ++ ++#define LZMA_DIC_MIN (1 << 12) ++ ++/* First LZMA-symbol is always decoded. ++And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization ++Out: ++ Result: ++ 0 - OK ++ 1 - Error ++ p->remainLen: ++ < kMatchSpecLenStart : normal remain ++ = kMatchSpecLenStart : finished ++ = kMatchSpecLenStart + 1 : Flush marker ++ = kMatchSpecLenStart + 2 : State Init Marker ++*/ ++ ++static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit) ++{ ++ CLzmaProb *probs = p->probs; ++ ++ unsigned state = p->state; ++ UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3]; ++ unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1; ++ unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1; ++ unsigned lc = p->prop.lc; ++ ++ Byte *dic = p->dic; ++ SizeT dicBufSize = p->dicBufSize; ++ SizeT dicPos = p->dicPos; ++ ++ UInt32 processedPos = p->processedPos; ++ UInt32 checkDicSize = p->checkDicSize; ++ unsigned len = 0; ++ ++ const Byte *buf = p->buf; ++ UInt32 range = p->range; ++ UInt32 code = p->code; ++ ++ do ++ { ++ CLzmaProb *prob; ++ UInt32 bound; ++ unsigned ttt; ++ unsigned posState = processedPos & pbMask; ++ ++ prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; ++ IF_BIT_0(prob) ++ { ++ unsigned symbol; ++ UPDATE_0(prob); ++ prob = probs + Literal; ++ if (checkDicSize != 0 || processedPos != 0) ++ prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) + ++ (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc)))); ++ ++ if (state < kNumLitStates) ++ { ++ symbol = 1; ++ do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100); ++ } ++ else ++ { ++ unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; ++ unsigned offs = 0x100; ++ symbol = 1; ++ do ++ { ++ unsigned bit; ++ CLzmaProb *probLit; ++ matchByte <<= 1; ++ bit = (matchByte & offs); ++ probLit = prob + offs + bit + symbol; ++ GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit) ++ } ++ while (symbol < 0x100); ++ } ++ dic[dicPos++] = (Byte)symbol; ++ processedPos++; ++ ++ state = kLiteralNextStates[state]; ++ /* if (state < 4) state = 0; else if (state < 10) state -= 3; else state -= 6; */ ++ continue; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ prob = probs + IsRep + state; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ state += kNumStates; ++ prob = probs + LenCoder; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ if (checkDicSize == 0 && processedPos == 0) ++ return SZ_ERROR_DATA; ++ prob = probs + IsRepG0 + state; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; ++ dicPos++; ++ processedPos++; ++ state = state < kNumLitStates ? 9 : 11; ++ continue; ++ } ++ UPDATE_1(prob); ++ } ++ else ++ { ++ UInt32 distance; ++ UPDATE_1(prob); ++ prob = probs + IsRepG1 + state; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ distance = rep1; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ prob = probs + IsRepG2 + state; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ distance = rep2; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ distance = rep3; ++ rep3 = rep2; ++ } ++ rep2 = rep1; ++ } ++ rep1 = rep0; ++ rep0 = distance; ++ } ++ state = state < kNumLitStates ? 8 : 11; ++ prob = probs + RepLenCoder; ++ } ++ { ++ unsigned limit, offset; ++ CLzmaProb *probLen = prob + LenChoice; ++ IF_BIT_0(probLen) ++ { ++ UPDATE_0(probLen); ++ probLen = prob + LenLow + (posState << kLenNumLowBits); ++ offset = 0; ++ limit = (1 << kLenNumLowBits); ++ } ++ else ++ { ++ UPDATE_1(probLen); ++ probLen = prob + LenChoice2; ++ IF_BIT_0(probLen) ++ { ++ UPDATE_0(probLen); ++ probLen = prob + LenMid + (posState << kLenNumMidBits); ++ offset = kLenNumLowSymbols; ++ limit = (1 << kLenNumMidBits); ++ } ++ else ++ { ++ UPDATE_1(probLen); ++ probLen = prob + LenHigh; ++ offset = kLenNumLowSymbols + kLenNumMidSymbols; ++ limit = (1 << kLenNumHighBits); ++ } ++ } ++ TREE_DECODE(probLen, limit, len); ++ len += offset; ++ } ++ ++ if (state >= kNumStates) ++ { ++ UInt32 distance; ++ prob = probs + PosSlot + ++ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits); ++ TREE_6_DECODE(prob, distance); ++ if (distance >= kStartPosModelIndex) ++ { ++ unsigned posSlot = (unsigned)distance; ++ int numDirectBits = (int)(((distance >> 1) - 1)); ++ distance = (2 | (distance & 1)); ++ if (posSlot < kEndPosModelIndex) ++ { ++ distance <<= numDirectBits; ++ prob = probs + SpecPos + distance - posSlot - 1; ++ { ++ UInt32 mask = 1; ++ unsigned i = 1; ++ do ++ { ++ GET_BIT2(prob + i, i, ; , distance |= mask); ++ mask <<= 1; ++ } ++ while(--numDirectBits != 0); ++ } ++ } ++ else ++ { ++ numDirectBits -= kNumAlignBits; ++ do ++ { ++ NORMALIZE ++ range >>= 1; ++ ++ { ++ UInt32 t; ++ code -= range; ++ t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */ ++ distance = (distance << 1) + (t + 1); ++ code += range & t; ++ } ++ /* ++ distance <<= 1; ++ if (code >= range) ++ { ++ code -= range; ++ distance |= 1; ++ } ++ */ ++ } ++ while (--numDirectBits != 0); ++ prob = probs + Align; ++ distance <<= kNumAlignBits; ++ { ++ unsigned i = 1; ++ GET_BIT2(prob + i, i, ; , distance |= 1); ++ GET_BIT2(prob + i, i, ; , distance |= 2); ++ GET_BIT2(prob + i, i, ; , distance |= 4); ++ GET_BIT2(prob + i, i, ; , distance |= 8); ++ } ++ if (distance == (UInt32)0xFFFFFFFF) ++ { ++ len += kMatchSpecLenStart; ++ state -= kNumStates; ++ break; ++ } ++ } ++ } ++ rep3 = rep2; ++ rep2 = rep1; ++ rep1 = rep0; ++ rep0 = distance + 1; ++ if (checkDicSize == 0) ++ { ++ if (distance >= processedPos) ++ return SZ_ERROR_DATA; ++ } ++ else if (distance >= checkDicSize) ++ return SZ_ERROR_DATA; ++ state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3; ++ /* state = kLiteralNextStates[state]; */ ++ } ++ ++ len += kMatchMinLen; ++ ++ { ++ SizeT rem = limit - dicPos; ++ unsigned curLen = ((rem < len) ? (unsigned)rem : len); ++ SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0); ++ ++ processedPos += curLen; ++ ++ len -= curLen; ++ if (pos + curLen <= dicBufSize) ++ { ++ Byte *dest = dic + dicPos; ++ ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos; ++ const Byte *lim = dest + curLen; ++ dicPos += curLen; ++ do ++ *(dest) = (Byte)*(dest + src); ++ while (++dest != lim); ++ } ++ else ++ { ++ do ++ { ++ dic[dicPos++] = dic[pos]; ++ if (++pos == dicBufSize) ++ pos = 0; ++ } ++ while (--curLen != 0); ++ } ++ } ++ } ++ } ++ while (dicPos < limit && buf < bufLimit); ++ NORMALIZE; ++ p->buf = buf; ++ p->range = range; ++ p->code = code; ++ p->remainLen = len; ++ p->dicPos = dicPos; ++ p->processedPos = processedPos; ++ p->reps[0] = rep0; ++ p->reps[1] = rep1; ++ p->reps[2] = rep2; ++ p->reps[3] = rep3; ++ p->state = state; ++ ++ return SZ_OK; ++} ++ ++static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit) ++{ ++ if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart) ++ { ++ Byte *dic = p->dic; ++ SizeT dicPos = p->dicPos; ++ SizeT dicBufSize = p->dicBufSize; ++ unsigned len = p->remainLen; ++ UInt32 rep0 = p->reps[0]; ++ if (limit - dicPos < len) ++ len = (unsigned)(limit - dicPos); ++ ++ if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len) ++ p->checkDicSize = p->prop.dicSize; ++ ++ p->processedPos += len; ++ p->remainLen -= len; ++ while (len-- != 0) ++ { ++ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; ++ dicPos++; ++ } ++ p->dicPos = dicPos; ++ } ++} ++ ++/* LzmaDec_DecodeReal2 decodes LZMA-symbols and sets p->needFlush and p->needInit, if required. */ ++ ++static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit) ++{ ++ do ++ { ++ SizeT limit2 = limit; ++ if (p->checkDicSize == 0) ++ { ++ UInt32 rem = p->prop.dicSize - p->processedPos; ++ if (limit - p->dicPos > rem) ++ limit2 = p->dicPos + rem; ++ } ++ RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit)); ++ if (p->processedPos >= p->prop.dicSize) ++ p->checkDicSize = p->prop.dicSize; ++ LzmaDec_WriteRem(p, limit); ++ } ++ while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart); ++ ++ if (p->remainLen > kMatchSpecLenStart) ++ { ++ p->remainLen = kMatchSpecLenStart; ++ } ++ return 0; ++} ++ ++typedef enum ++{ ++ DUMMY_ERROR, /* unexpected end of input stream */ ++ DUMMY_LIT, ++ DUMMY_MATCH, ++ DUMMY_REP ++} ELzmaDummy; ++ ++static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize) ++{ ++ UInt32 range = p->range; ++ UInt32 code = p->code; ++ const Byte *bufLimit = buf + inSize; ++ CLzmaProb *probs = p->probs; ++ unsigned state = p->state; ++ ELzmaDummy res; ++ ++ { ++ CLzmaProb *prob; ++ UInt32 bound; ++ unsigned ttt; ++ unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1); ++ ++ prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK ++ ++ /* if (bufLimit - buf >= 7) return DUMMY_LIT; */ ++ ++ prob = probs + Literal; ++ if (p->checkDicSize != 0 || p->processedPos != 0) ++ prob += (LZMA_LIT_SIZE * ++ ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) + ++ (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc)))); ++ ++ if (state < kNumLitStates) ++ { ++ unsigned symbol = 1; ++ do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); ++ } ++ else ++ { ++ unsigned matchByte = p->dic[p->dicPos - p->reps[0] + ++ ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)]; ++ unsigned offs = 0x100; ++ unsigned symbol = 1; ++ do ++ { ++ unsigned bit; ++ CLzmaProb *probLit; ++ matchByte <<= 1; ++ bit = (matchByte & offs); ++ probLit = prob + offs + bit + symbol; ++ GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit) ++ } ++ while (symbol < 0x100); ++ } ++ res = DUMMY_LIT; ++ } ++ else ++ { ++ unsigned len; ++ UPDATE_1_CHECK; ++ ++ prob = probs + IsRep + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ state = 0; ++ prob = probs + LenCoder; ++ res = DUMMY_MATCH; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ res = DUMMY_REP; ++ prob = probs + IsRepG0 + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ NORMALIZE_CHECK; ++ return DUMMY_REP; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ } ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ prob = probs + IsRepG1 + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ prob = probs + IsRepG2 + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ } ++ } ++ } ++ state = kNumStates; ++ prob = probs + RepLenCoder; ++ } ++ { ++ unsigned limit, offset; ++ CLzmaProb *probLen = prob + LenChoice; ++ IF_BIT_0_CHECK(probLen) ++ { ++ UPDATE_0_CHECK; ++ probLen = prob + LenLow + (posState << kLenNumLowBits); ++ offset = 0; ++ limit = 1 << kLenNumLowBits; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ probLen = prob + LenChoice2; ++ IF_BIT_0_CHECK(probLen) ++ { ++ UPDATE_0_CHECK; ++ probLen = prob + LenMid + (posState << kLenNumMidBits); ++ offset = kLenNumLowSymbols; ++ limit = 1 << kLenNumMidBits; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ probLen = prob + LenHigh; ++ offset = kLenNumLowSymbols + kLenNumMidSymbols; ++ limit = 1 << kLenNumHighBits; ++ } ++ } ++ TREE_DECODE_CHECK(probLen, limit, len); ++ len += offset; ++ } ++ ++ if (state < 4) ++ { ++ unsigned posSlot; ++ prob = probs + PosSlot + ++ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << ++ kNumPosSlotBits); ++ TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); ++ if (posSlot >= kStartPosModelIndex) ++ { ++ int numDirectBits = ((posSlot >> 1) - 1); ++ ++ /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */ ++ ++ if (posSlot < kEndPosModelIndex) ++ { ++ prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1; ++ } ++ else ++ { ++ numDirectBits -= kNumAlignBits; ++ do ++ { ++ NORMALIZE_CHECK ++ range >>= 1; ++ code -= range & (((code - range) >> 31) - 1); ++ /* if (code >= range) code -= range; */ ++ } ++ while (--numDirectBits != 0); ++ prob = probs + Align; ++ numDirectBits = kNumAlignBits; ++ } ++ { ++ unsigned i = 1; ++ do ++ { ++ GET_BIT_CHECK(prob + i, i); ++ } ++ while(--numDirectBits != 0); ++ } ++ } ++ } ++ } ++ } ++ NORMALIZE_CHECK; ++ return res; ++} ++ ++ ++static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data) ++{ ++ p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]); ++ p->range = 0xFFFFFFFF; ++ p->needFlush = 0; ++} ++ ++void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState) ++{ ++ p->needFlush = 1; ++ p->remainLen = 0; ++ p->tempBufSize = 0; ++ ++ if (initDic) ++ { ++ p->processedPos = 0; ++ p->checkDicSize = 0; ++ p->needInitState = 1; ++ } ++ if (initState) ++ p->needInitState = 1; ++} ++ ++void LzmaDec_Init(CLzmaDec *p) ++{ ++ p->dicPos = 0; ++ LzmaDec_InitDicAndState(p, True, True); ++} ++ ++static void LzmaDec_InitStateReal(CLzmaDec *p) ++{ ++ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp)); ++ UInt32 i; ++ CLzmaProb *probs = p->probs; ++ for (i = 0; i < numProbs; i++) ++ probs[i] = kBitModelTotal >> 1; ++ p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1; ++ p->state = 0; ++ p->needInitState = 0; ++} ++ ++SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, ++ ELzmaFinishMode finishMode, ELzmaStatus *status) ++{ ++ SizeT inSize = *srcLen; ++ (*srcLen) = 0; ++ LzmaDec_WriteRem(p, dicLimit); ++ ++ *status = LZMA_STATUS_NOT_SPECIFIED; ++ ++ while (p->remainLen != kMatchSpecLenStart) ++ { ++ int checkEndMarkNow; ++ ++ if (p->needFlush != 0) ++ { ++ for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--) ++ p->tempBuf[p->tempBufSize++] = *src++; ++ if (p->tempBufSize < RC_INIT_SIZE) ++ { ++ *status = LZMA_STATUS_NEEDS_MORE_INPUT; ++ return SZ_OK; ++ } ++ if (p->tempBuf[0] != 0) ++ return SZ_ERROR_DATA; ++ ++ LzmaDec_InitRc(p, p->tempBuf); ++ p->tempBufSize = 0; ++ } ++ ++ checkEndMarkNow = 0; ++ if (p->dicPos >= dicLimit) ++ { ++ if (p->remainLen == 0 && p->code == 0) ++ { ++ *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK; ++ return SZ_OK; ++ } ++ if (finishMode == LZMA_FINISH_ANY) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_OK; ++ } ++ if (p->remainLen != 0) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_ERROR_DATA; ++ } ++ checkEndMarkNow = 1; ++ } ++ ++ if (p->needInitState) ++ LzmaDec_InitStateReal(p); ++ ++ if (p->tempBufSize == 0) ++ { ++ SizeT processed; ++ const Byte *bufLimit; ++ if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) ++ { ++ int dummyRes = LzmaDec_TryDummy(p, src, inSize); ++ if (dummyRes == DUMMY_ERROR) ++ { ++ memcpy(p->tempBuf, src, inSize); ++ p->tempBufSize = (unsigned)inSize; ++ (*srcLen) += inSize; ++ *status = LZMA_STATUS_NEEDS_MORE_INPUT; ++ return SZ_OK; ++ } ++ if (checkEndMarkNow && dummyRes != DUMMY_MATCH) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_ERROR_DATA; ++ } ++ bufLimit = src; ++ } ++ else ++ bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX; ++ p->buf = src; ++ if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0) ++ return SZ_ERROR_DATA; ++ processed = p->buf - src; ++ (*srcLen) += processed; ++ src += processed; ++ inSize -= processed; ++ } ++ else ++ { ++ unsigned rem = p->tempBufSize, lookAhead = 0; ++ while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize) ++ p->tempBuf[rem++] = src[lookAhead++]; ++ p->tempBufSize = rem; ++ if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) ++ { ++ int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem); ++ if (dummyRes == DUMMY_ERROR) ++ { ++ (*srcLen) += lookAhead; ++ *status = LZMA_STATUS_NEEDS_MORE_INPUT; ++ return SZ_OK; ++ } ++ if (checkEndMarkNow && dummyRes != DUMMY_MATCH) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_ERROR_DATA; ++ } ++ } ++ p->buf = p->tempBuf; ++ if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0) ++ return SZ_ERROR_DATA; ++ lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf)); ++ (*srcLen) += lookAhead; ++ src += lookAhead; ++ inSize -= lookAhead; ++ p->tempBufSize = 0; ++ } ++ } ++ if (p->code == 0) ++ *status = LZMA_STATUS_FINISHED_WITH_MARK; ++ return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA; ++} ++ ++SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status) ++{ ++ SizeT outSize = *destLen; ++ SizeT inSize = *srcLen; ++ *srcLen = *destLen = 0; ++ for (;;) ++ { ++ SizeT inSizeCur = inSize, outSizeCur, dicPos; ++ ELzmaFinishMode curFinishMode; ++ SRes res; ++ if (p->dicPos == p->dicBufSize) ++ p->dicPos = 0; ++ dicPos = p->dicPos; ++ if (outSize > p->dicBufSize - dicPos) ++ { ++ outSizeCur = p->dicBufSize; ++ curFinishMode = LZMA_FINISH_ANY; ++ } ++ else ++ { ++ outSizeCur = dicPos + outSize; ++ curFinishMode = finishMode; ++ } ++ ++ res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status); ++ src += inSizeCur; ++ inSize -= inSizeCur; ++ *srcLen += inSizeCur; ++ outSizeCur = p->dicPos - dicPos; ++ memcpy(dest, p->dic + dicPos, outSizeCur); ++ dest += outSizeCur; ++ outSize -= outSizeCur; ++ *destLen += outSizeCur; ++ if (res != 0) ++ return res; ++ if (outSizeCur == 0 || outSize == 0) ++ return SZ_OK; ++ } ++} ++ ++void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->probs); ++ p->probs = 0; ++} ++ ++static void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->dic); ++ p->dic = 0; ++} ++ ++void LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc) ++{ ++ LzmaDec_FreeProbs(p, alloc); ++ LzmaDec_FreeDict(p, alloc); ++} ++ ++SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size) ++{ ++ UInt32 dicSize; ++ Byte d; ++ ++ if (size < LZMA_PROPS_SIZE) ++ return SZ_ERROR_UNSUPPORTED; ++ else ++ dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24); ++ ++ if (dicSize < LZMA_DIC_MIN) ++ dicSize = LZMA_DIC_MIN; ++ p->dicSize = dicSize; ++ ++ d = data[0]; ++ if (d >= (9 * 5 * 5)) ++ return SZ_ERROR_UNSUPPORTED; ++ ++ p->lc = d % 9; ++ d /= 9; ++ p->pb = d / 5; ++ p->lp = d % 5; ++ ++ return SZ_OK; ++} ++ ++static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc) ++{ ++ UInt32 numProbs = LzmaProps_GetNumProbs(propNew); ++ if (p->probs == 0 || numProbs != p->numProbs) ++ { ++ LzmaDec_FreeProbs(p, alloc); ++ p->probs = (CLzmaProb *)alloc->Alloc(alloc, numProbs * sizeof(CLzmaProb)); ++ p->numProbs = numProbs; ++ if (p->probs == 0) ++ return SZ_ERROR_MEM; ++ } ++ return SZ_OK; ++} ++ ++SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) ++{ ++ CLzmaProps propNew; ++ RINOK(LzmaProps_Decode(&propNew, props, propsSize)); ++ RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); ++ p->prop = propNew; ++ return SZ_OK; ++} ++ ++SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) ++{ ++ CLzmaProps propNew; ++ SizeT dicBufSize; ++ RINOK(LzmaProps_Decode(&propNew, props, propsSize)); ++ RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); ++ dicBufSize = propNew.dicSize; ++ if (p->dic == 0 || dicBufSize != p->dicBufSize) ++ { ++ LzmaDec_FreeDict(p, alloc); ++ p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize); ++ if (p->dic == 0) ++ { ++ LzmaDec_FreeProbs(p, alloc); ++ return SZ_ERROR_MEM; ++ } ++ } ++ p->dicBufSize = dicBufSize; ++ p->prop = propNew; ++ return SZ_OK; ++} ++ ++SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ++ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, ++ ELzmaStatus *status, ISzAlloc *alloc) ++{ ++ CLzmaDec p; ++ SRes res; ++ SizeT inSize = *srcLen; ++ SizeT outSize = *destLen; ++ *srcLen = *destLen = 0; ++ if (inSize < RC_INIT_SIZE) ++ return SZ_ERROR_INPUT_EOF; ++ ++ LzmaDec_Construct(&p); ++ res = LzmaDec_AllocateProbs(&p, propData, propSize, alloc); ++ if (res != 0) ++ return res; ++ p.dic = dest; ++ p.dicBufSize = outSize; ++ ++ LzmaDec_Init(&p); ++ ++ *srcLen = inSize; ++ res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status); ++ ++ if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT) ++ res = SZ_ERROR_INPUT_EOF; ++ ++ (*destLen) = p.dicPos; ++ LzmaDec_FreeProbs(&p, alloc); ++ return res; ++} +--- /dev/null ++++ b/lzma/LzmaEnc.c +@@ -0,0 +1,2335 @@ ++/* LzmaEnc.c -- LZMA Encoder ++2008-04-28 ++Copyright (c) 1999-2008 Igor Pavlov ++Read LzmaEnc.h for license options */ ++ ++#if defined(SHOW_STAT) || defined(SHOW_STAT2) ++#include ++#endif ++ ++#include ++ ++#include "LzmaEnc.h" ++ ++#include "LzFind.h" ++#ifdef COMPRESS_MF_MT ++#include "LzFindMt.h" ++#endif ++ ++/* #define SHOW_STAT */ ++/* #define SHOW_STAT2 */ ++ ++#ifdef SHOW_STAT ++static int ttt = 0; ++#endif ++ ++#define kBlockSizeMax ((1 << LZMA_NUM_BLOCK_SIZE_BITS) - 1) ++ ++#define kBlockSize (9 << 10) ++#define kUnpackBlockSize (1 << 18) ++#define kMatchArraySize (1 << 21) ++#define kMatchRecordMaxSize ((LZMA_MATCH_LEN_MAX * 2 + 3) * LZMA_MATCH_LEN_MAX) ++ ++#define kNumMaxDirectBits (31) ++ ++#define kNumTopBits 24 ++#define kTopValue ((UInt32)1 << kNumTopBits) ++ ++#define kNumBitModelTotalBits 11 ++#define kBitModelTotal (1 << kNumBitModelTotalBits) ++#define kNumMoveBits 5 ++#define kProbInitValue (kBitModelTotal >> 1) ++ ++#define kNumMoveReducingBits 4 ++#define kNumBitPriceShiftBits 4 ++#define kBitPrice (1 << kNumBitPriceShiftBits) ++ ++void LzmaEncProps_Init(CLzmaEncProps *p) ++{ ++ p->level = 5; ++ p->dictSize = p->mc = 0; ++ p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1; ++ p->writeEndMark = 0; ++} ++ ++void LzmaEncProps_Normalize(CLzmaEncProps *p) ++{ ++ int level = p->level; ++ if (level < 0) level = 5; ++ p->level = level; ++ if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level == 6 ? (1 << 25) : (1 << 26))); ++ if (p->lc < 0) p->lc = 3; ++ if (p->lp < 0) p->lp = 0; ++ if (p->pb < 0) p->pb = 2; ++ if (p->algo < 0) p->algo = (level < 5 ? 0 : 1); ++ if (p->fb < 0) p->fb = (level < 7 ? 32 : 64); ++ if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1); ++ if (p->numHashBytes < 0) p->numHashBytes = 4; ++ if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1); ++ if (p->numThreads < 0) p->numThreads = ((p->btMode && p->algo) ? 2 : 1); ++} ++ ++UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2) ++{ ++ CLzmaEncProps props = *props2; ++ LzmaEncProps_Normalize(&props); ++ return props.dictSize; ++} ++ ++/* #define LZMA_LOG_BSR */ ++/* Define it for Intel's CPU */ ++ ++ ++#ifdef LZMA_LOG_BSR ++ ++#define kDicLogSizeMaxCompress 30 ++ ++#define BSR2_RET(pos, res) { unsigned long i; _BitScanReverse(&i, (pos)); res = (i + i) + ((pos >> (i - 1)) & 1); } ++ ++UInt32 GetPosSlot1(UInt32 pos) ++{ ++ UInt32 res; ++ BSR2_RET(pos, res); ++ return res; ++} ++#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } ++#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); } ++ ++#else ++ ++#define kNumLogBits (9 + (int)sizeof(size_t) / 2) ++#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7) ++ ++void LzmaEnc_FastPosInit(Byte *g_FastPos) ++{ ++ int c = 2, slotFast; ++ g_FastPos[0] = 0; ++ g_FastPos[1] = 1; ++ ++ for (slotFast = 2; slotFast < kNumLogBits * 2; slotFast++) ++ { ++ UInt32 k = (1 << ((slotFast >> 1) - 1)); ++ UInt32 j; ++ for (j = 0; j < k; j++, c++) ++ g_FastPos[c] = (Byte)slotFast; ++ } ++} ++ ++#define BSR2_RET(pos, res) { UInt32 i = 6 + ((kNumLogBits - 1) & \ ++ (0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \ ++ res = p->g_FastPos[pos >> i] + (i * 2); } ++/* ++#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \ ++ p->g_FastPos[pos >> 6] + 12 : \ ++ p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; } ++*/ ++ ++#define GetPosSlot1(pos) p->g_FastPos[pos] ++#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } ++#define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos]; else BSR2_RET(pos, res); } ++ ++#endif ++ ++ ++#define LZMA_NUM_REPS 4 ++ ++typedef unsigned CState; ++ ++typedef struct _COptimal ++{ ++ UInt32 price; ++ ++ CState state; ++ int prev1IsChar; ++ int prev2; ++ ++ UInt32 posPrev2; ++ UInt32 backPrev2; ++ ++ UInt32 posPrev; ++ UInt32 backPrev; ++ UInt32 backs[LZMA_NUM_REPS]; ++} COptimal; ++ ++#define kNumOpts (1 << 12) ++ ++#define kNumLenToPosStates 4 ++#define kNumPosSlotBits 6 ++#define kDicLogSizeMin 0 ++#define kDicLogSizeMax 32 ++#define kDistTableSizeMax (kDicLogSizeMax * 2) ++ ++ ++#define kNumAlignBits 4 ++#define kAlignTableSize (1 << kNumAlignBits) ++#define kAlignMask (kAlignTableSize - 1) ++ ++#define kStartPosModelIndex 4 ++#define kEndPosModelIndex 14 ++#define kNumPosModels (kEndPosModelIndex - kStartPosModelIndex) ++ ++#define kNumFullDistances (1 << (kEndPosModelIndex / 2)) ++ ++#ifdef _LZMA_PROB32 ++#define CLzmaProb UInt32 ++#else ++#define CLzmaProb UInt16 ++#endif ++ ++#define LZMA_PB_MAX 4 ++#define LZMA_LC_MAX 8 ++#define LZMA_LP_MAX 4 ++ ++#define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX) ++ ++ ++#define kLenNumLowBits 3 ++#define kLenNumLowSymbols (1 << kLenNumLowBits) ++#define kLenNumMidBits 3 ++#define kLenNumMidSymbols (1 << kLenNumMidBits) ++#define kLenNumHighBits 8 ++#define kLenNumHighSymbols (1 << kLenNumHighBits) ++ ++#define kLenNumSymbolsTotal (kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) ++ ++#define LZMA_MATCH_LEN_MIN 2 ++#define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1) ++ ++#define kNumStates 12 ++ ++typedef struct ++{ ++ CLzmaProb choice; ++ CLzmaProb choice2; ++ CLzmaProb low[LZMA_NUM_PB_STATES_MAX << kLenNumLowBits]; ++ CLzmaProb mid[LZMA_NUM_PB_STATES_MAX << kLenNumMidBits]; ++ CLzmaProb high[kLenNumHighSymbols]; ++} CLenEnc; ++ ++typedef struct ++{ ++ CLenEnc p; ++ UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal]; ++ UInt32 tableSize; ++ UInt32 counters[LZMA_NUM_PB_STATES_MAX]; ++} CLenPriceEnc; ++ ++typedef struct _CRangeEnc ++{ ++ UInt32 range; ++ Byte cache; ++ UInt64 low; ++ UInt64 cacheSize; ++ Byte *buf; ++ Byte *bufLim; ++ Byte *bufBase; ++ ISeqOutStream *outStream; ++ UInt64 processed; ++ SRes res; ++} CRangeEnc; ++ ++typedef struct _CSeqInStreamBuf ++{ ++ ISeqInStream funcTable; ++ const Byte *data; ++ SizeT rem; ++} CSeqInStreamBuf; ++ ++static SRes MyRead(void *pp, void *data, size_t *size) ++{ ++ size_t curSize = *size; ++ CSeqInStreamBuf *p = (CSeqInStreamBuf *)pp; ++ if (p->rem < curSize) ++ curSize = p->rem; ++ memcpy(data, p->data, curSize); ++ p->rem -= curSize; ++ p->data += curSize; ++ *size = curSize; ++ return SZ_OK; ++} ++ ++typedef struct ++{ ++ CLzmaProb *litProbs; ++ ++ CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; ++ CLzmaProb isRep[kNumStates]; ++ CLzmaProb isRepG0[kNumStates]; ++ CLzmaProb isRepG1[kNumStates]; ++ CLzmaProb isRepG2[kNumStates]; ++ CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; ++ ++ CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; ++ CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; ++ CLzmaProb posAlignEncoder[1 << kNumAlignBits]; ++ ++ CLenPriceEnc lenEnc; ++ CLenPriceEnc repLenEnc; ++ ++ UInt32 reps[LZMA_NUM_REPS]; ++ UInt32 state; ++} CSaveState; ++ ++typedef struct _CLzmaEnc ++{ ++ IMatchFinder matchFinder; ++ void *matchFinderObj; ++ ++ #ifdef COMPRESS_MF_MT ++ Bool mtMode; ++ CMatchFinderMt matchFinderMt; ++ #endif ++ ++ CMatchFinder matchFinderBase; ++ ++ #ifdef COMPRESS_MF_MT ++ Byte pad[128]; ++ #endif ++ ++ UInt32 optimumEndIndex; ++ UInt32 optimumCurrentIndex; ++ ++ Bool longestMatchWasFound; ++ UInt32 longestMatchLength; ++ UInt32 numDistancePairs; ++ ++ COptimal opt[kNumOpts]; ++ ++ #ifndef LZMA_LOG_BSR ++ Byte g_FastPos[1 << kNumLogBits]; ++ #endif ++ ++ UInt32 ProbPrices[kBitModelTotal >> kNumMoveReducingBits]; ++ UInt32 matchDistances[LZMA_MATCH_LEN_MAX * 2 + 2 + 1]; ++ UInt32 numFastBytes; ++ UInt32 additionalOffset; ++ UInt32 reps[LZMA_NUM_REPS]; ++ UInt32 state; ++ ++ UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax]; ++ UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances]; ++ UInt32 alignPrices[kAlignTableSize]; ++ UInt32 alignPriceCount; ++ ++ UInt32 distTableSize; ++ ++ unsigned lc, lp, pb; ++ unsigned lpMask, pbMask; ++ ++ CLzmaProb *litProbs; ++ ++ CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; ++ CLzmaProb isRep[kNumStates]; ++ CLzmaProb isRepG0[kNumStates]; ++ CLzmaProb isRepG1[kNumStates]; ++ CLzmaProb isRepG2[kNumStates]; ++ CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; ++ ++ CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; ++ CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; ++ CLzmaProb posAlignEncoder[1 << kNumAlignBits]; ++ ++ CLenPriceEnc lenEnc; ++ CLenPriceEnc repLenEnc; ++ ++ unsigned lclp; ++ ++ Bool fastMode; ++ ++ CRangeEnc rc; ++ ++ Bool writeEndMark; ++ UInt64 nowPos64; ++ UInt32 matchPriceCount; ++ Bool finished; ++ Bool multiThread; ++ ++ SRes result; ++ UInt32 dictSize; ++ UInt32 matchFinderCycles; ++ ++ ISeqInStream *inStream; ++ CSeqInStreamBuf seqBufInStream; ++ ++ CSaveState saveState; ++} CLzmaEnc; ++ ++void LzmaEnc_SaveState(CLzmaEncHandle pp) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ CSaveState *dest = &p->saveState; ++ int i; ++ dest->lenEnc = p->lenEnc; ++ dest->repLenEnc = p->repLenEnc; ++ dest->state = p->state; ++ ++ for (i = 0; i < kNumStates; i++) ++ { ++ memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); ++ memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); ++ } ++ for (i = 0; i < kNumLenToPosStates; i++) ++ memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); ++ memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); ++ memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); ++ memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); ++ memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); ++ memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); ++ memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); ++ memcpy(dest->reps, p->reps, sizeof(p->reps)); ++ memcpy(dest->litProbs, p->litProbs, (0x300 << p->lclp) * sizeof(CLzmaProb)); ++} ++ ++void LzmaEnc_RestoreState(CLzmaEncHandle pp) ++{ ++ CLzmaEnc *dest = (CLzmaEnc *)pp; ++ const CSaveState *p = &dest->saveState; ++ int i; ++ dest->lenEnc = p->lenEnc; ++ dest->repLenEnc = p->repLenEnc; ++ dest->state = p->state; ++ ++ for (i = 0; i < kNumStates; i++) ++ { ++ memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); ++ memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); ++ } ++ for (i = 0; i < kNumLenToPosStates; i++) ++ memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); ++ memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); ++ memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); ++ memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); ++ memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); ++ memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); ++ memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); ++ memcpy(dest->reps, p->reps, sizeof(p->reps)); ++ memcpy(dest->litProbs, p->litProbs, (0x300 << dest->lclp) * sizeof(CLzmaProb)); ++} ++ ++SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ CLzmaEncProps props = *props2; ++ LzmaEncProps_Normalize(&props); ++ ++ if (props.lc > LZMA_LC_MAX || props.lp > LZMA_LP_MAX || props.pb > LZMA_PB_MAX || ++ props.dictSize > (1 << kDicLogSizeMaxCompress) || props.dictSize > (1 << 30)) ++ return SZ_ERROR_PARAM; ++ p->dictSize = props.dictSize; ++ p->matchFinderCycles = props.mc; ++ { ++ unsigned fb = props.fb; ++ if (fb < 5) ++ fb = 5; ++ if (fb > LZMA_MATCH_LEN_MAX) ++ fb = LZMA_MATCH_LEN_MAX; ++ p->numFastBytes = fb; ++ } ++ p->lc = props.lc; ++ p->lp = props.lp; ++ p->pb = props.pb; ++ p->fastMode = (props.algo == 0); ++ p->matchFinderBase.btMode = props.btMode; ++ { ++ UInt32 numHashBytes = 4; ++ if (props.btMode) ++ { ++ if (props.numHashBytes < 2) ++ numHashBytes = 2; ++ else if (props.numHashBytes < 4) ++ numHashBytes = props.numHashBytes; ++ } ++ p->matchFinderBase.numHashBytes = numHashBytes; ++ } ++ ++ p->matchFinderBase.cutValue = props.mc; ++ ++ p->writeEndMark = props.writeEndMark; ++ ++ #ifdef COMPRESS_MF_MT ++ /* ++ if (newMultiThread != _multiThread) ++ { ++ ReleaseMatchFinder(); ++ _multiThread = newMultiThread; ++ } ++ */ ++ p->multiThread = (props.numThreads > 1); ++ #endif ++ ++ return SZ_OK; ++} ++ ++static const int kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5}; ++static const int kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10}; ++static const int kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11}; ++static const int kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11}; ++ ++/* ++ void UpdateChar() { Index = kLiteralNextStates[Index]; } ++ void UpdateMatch() { Index = kMatchNextStates[Index]; } ++ void UpdateRep() { Index = kRepNextStates[Index]; } ++ void UpdateShortRep() { Index = kShortRepNextStates[Index]; } ++*/ ++ ++#define IsCharState(s) ((s) < 7) ++ ++ ++#define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1) ++ ++#define kInfinityPrice (1 << 30) ++ ++static void RangeEnc_Construct(CRangeEnc *p) ++{ ++ p->outStream = 0; ++ p->bufBase = 0; ++} ++ ++#define RangeEnc_GetProcessed(p) ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize) ++ ++#define RC_BUF_SIZE (1 << 16) ++static int RangeEnc_Alloc(CRangeEnc *p, ISzAlloc *alloc) ++{ ++ if (p->bufBase == 0) ++ { ++ p->bufBase = (Byte *)alloc->Alloc(alloc, RC_BUF_SIZE); ++ if (p->bufBase == 0) ++ return 0; ++ p->bufLim = p->bufBase + RC_BUF_SIZE; ++ } ++ return 1; ++} ++ ++static void RangeEnc_Free(CRangeEnc *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->bufBase); ++ p->bufBase = 0; ++} ++ ++static void RangeEnc_Init(CRangeEnc *p) ++{ ++ /* Stream.Init(); */ ++ p->low = 0; ++ p->range = 0xFFFFFFFF; ++ p->cacheSize = 1; ++ p->cache = 0; ++ ++ p->buf = p->bufBase; ++ ++ p->processed = 0; ++ p->res = SZ_OK; ++} ++ ++static void RangeEnc_FlushStream(CRangeEnc *p) ++{ ++ size_t num; ++ if (p->res != SZ_OK) ++ return; ++ num = p->buf - p->bufBase; ++ if (num != p->outStream->Write(p->outStream, p->bufBase, num)) ++ p->res = SZ_ERROR_WRITE; ++ p->processed += num; ++ p->buf = p->bufBase; ++} ++ ++static void MY_FAST_CALL RangeEnc_ShiftLow(CRangeEnc *p) ++{ ++ if ((UInt32)p->low < (UInt32)0xFF000000 || (int)(p->low >> 32) != 0) ++ { ++ Byte temp = p->cache; ++ do ++ { ++ Byte *buf = p->buf; ++ *buf++ = (Byte)(temp + (Byte)(p->low >> 32)); ++ p->buf = buf; ++ if (buf == p->bufLim) ++ RangeEnc_FlushStream(p); ++ temp = 0xFF; ++ } ++ while (--p->cacheSize != 0); ++ p->cache = (Byte)((UInt32)p->low >> 24); ++ } ++ p->cacheSize++; ++ p->low = (UInt32)p->low << 8; ++} ++ ++static void RangeEnc_FlushData(CRangeEnc *p) ++{ ++ int i; ++ for (i = 0; i < 5; i++) ++ RangeEnc_ShiftLow(p); ++} ++ ++static void RangeEnc_EncodeDirectBits(CRangeEnc *p, UInt32 value, int numBits) ++{ ++ do ++ { ++ p->range >>= 1; ++ p->low += p->range & (0 - ((value >> --numBits) & 1)); ++ if (p->range < kTopValue) ++ { ++ p->range <<= 8; ++ RangeEnc_ShiftLow(p); ++ } ++ } ++ while (numBits != 0); ++} ++ ++static void RangeEnc_EncodeBit(CRangeEnc *p, CLzmaProb *prob, UInt32 symbol) ++{ ++ UInt32 ttt = *prob; ++ UInt32 newBound = (p->range >> kNumBitModelTotalBits) * ttt; ++ if (symbol == 0) ++ { ++ p->range = newBound; ++ ttt += (kBitModelTotal - ttt) >> kNumMoveBits; ++ } ++ else ++ { ++ p->low += newBound; ++ p->range -= newBound; ++ ttt -= ttt >> kNumMoveBits; ++ } ++ *prob = (CLzmaProb)ttt; ++ if (p->range < kTopValue) ++ { ++ p->range <<= 8; ++ RangeEnc_ShiftLow(p); ++ } ++} ++ ++static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol) ++{ ++ symbol |= 0x100; ++ do ++ { ++ RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1); ++ symbol <<= 1; ++ } ++ while (symbol < 0x10000); ++} ++ ++static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol, UInt32 matchByte) ++{ ++ UInt32 offs = 0x100; ++ symbol |= 0x100; ++ do ++ { ++ matchByte <<= 1; ++ RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1); ++ symbol <<= 1; ++ offs &= ~(matchByte ^ symbol); ++ } ++ while (symbol < 0x10000); ++} ++ ++void LzmaEnc_InitPriceTables(UInt32 *ProbPrices) ++{ ++ UInt32 i; ++ for (i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits)) ++ { ++ const int kCyclesBits = kNumBitPriceShiftBits; ++ UInt32 w = i; ++ UInt32 bitCount = 0; ++ int j; ++ for (j = 0; j < kCyclesBits; j++) ++ { ++ w = w * w; ++ bitCount <<= 1; ++ while (w >= ((UInt32)1 << 16)) ++ { ++ w >>= 1; ++ bitCount++; ++ } ++ } ++ ProbPrices[i >> kNumMoveReducingBits] = ((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount); ++ } ++} ++ ++ ++#define GET_PRICE(prob, symbol) \ ++ p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; ++ ++#define GET_PRICEa(prob, symbol) \ ++ ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; ++ ++#define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits] ++#define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] ++ ++#define GET_PRICE_0a(prob) ProbPrices[(prob) >> kNumMoveReducingBits] ++#define GET_PRICE_1a(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] ++ ++static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 symbol, UInt32 *ProbPrices) ++{ ++ UInt32 price = 0; ++ symbol |= 0x100; ++ do ++ { ++ price += GET_PRICEa(probs[symbol >> 8], (symbol >> 7) & 1); ++ symbol <<= 1; ++ } ++ while (symbol < 0x10000); ++ return price; ++}; ++ ++static UInt32 LitEnc_GetPriceMatched(const CLzmaProb *probs, UInt32 symbol, UInt32 matchByte, UInt32 *ProbPrices) ++{ ++ UInt32 price = 0; ++ UInt32 offs = 0x100; ++ symbol |= 0x100; ++ do ++ { ++ matchByte <<= 1; ++ price += GET_PRICEa(probs[offs + (matchByte & offs) + (symbol >> 8)], (symbol >> 7) & 1); ++ symbol <<= 1; ++ offs &= ~(matchByte ^ symbol); ++ } ++ while (symbol < 0x10000); ++ return price; ++}; ++ ++ ++static void RcTree_Encode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) ++{ ++ UInt32 m = 1; ++ int i; ++ for (i = numBitLevels; i != 0 ;) ++ { ++ UInt32 bit; ++ i--; ++ bit = (symbol >> i) & 1; ++ RangeEnc_EncodeBit(rc, probs + m, bit); ++ m = (m << 1) | bit; ++ } ++}; ++ ++static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) ++{ ++ UInt32 m = 1; ++ int i; ++ for (i = 0; i < numBitLevels; i++) ++ { ++ UInt32 bit = symbol & 1; ++ RangeEnc_EncodeBit(rc, probs + m, bit); ++ m = (m << 1) | bit; ++ symbol >>= 1; ++ } ++} ++ ++static UInt32 RcTree_GetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices) ++{ ++ UInt32 price = 0; ++ symbol |= (1 << numBitLevels); ++ while (symbol != 1) ++ { ++ price += GET_PRICEa(probs[symbol >> 1], symbol & 1); ++ symbol >>= 1; ++ } ++ return price; ++} ++ ++static UInt32 RcTree_ReverseGetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices) ++{ ++ UInt32 price = 0; ++ UInt32 m = 1; ++ int i; ++ for (i = numBitLevels; i != 0; i--) ++ { ++ UInt32 bit = symbol & 1; ++ symbol >>= 1; ++ price += GET_PRICEa(probs[m], bit); ++ m = (m << 1) | bit; ++ } ++ return price; ++} ++ ++ ++static void LenEnc_Init(CLenEnc *p) ++{ ++ unsigned i; ++ p->choice = p->choice2 = kProbInitValue; ++ for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumLowBits); i++) ++ p->low[i] = kProbInitValue; ++ for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumMidBits); i++) ++ p->mid[i] = kProbInitValue; ++ for (i = 0; i < kLenNumHighSymbols; i++) ++ p->high[i] = kProbInitValue; ++} ++ ++static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState) ++{ ++ if (symbol < kLenNumLowSymbols) ++ { ++ RangeEnc_EncodeBit(rc, &p->choice, 0); ++ RcTree_Encode(rc, p->low + (posState << kLenNumLowBits), kLenNumLowBits, symbol); ++ } ++ else ++ { ++ RangeEnc_EncodeBit(rc, &p->choice, 1); ++ if (symbol < kLenNumLowSymbols + kLenNumMidSymbols) ++ { ++ RangeEnc_EncodeBit(rc, &p->choice2, 0); ++ RcTree_Encode(rc, p->mid + (posState << kLenNumMidBits), kLenNumMidBits, symbol - kLenNumLowSymbols); ++ } ++ else ++ { ++ RangeEnc_EncodeBit(rc, &p->choice2, 1); ++ RcTree_Encode(rc, p->high, kLenNumHighBits, symbol - kLenNumLowSymbols - kLenNumMidSymbols); ++ } ++ } ++} ++ ++static void LenEnc_SetPrices(CLenEnc *p, UInt32 posState, UInt32 numSymbols, UInt32 *prices, UInt32 *ProbPrices) ++{ ++ UInt32 a0 = GET_PRICE_0a(p->choice); ++ UInt32 a1 = GET_PRICE_1a(p->choice); ++ UInt32 b0 = a1 + GET_PRICE_0a(p->choice2); ++ UInt32 b1 = a1 + GET_PRICE_1a(p->choice2); ++ UInt32 i = 0; ++ for (i = 0; i < kLenNumLowSymbols; i++) ++ { ++ if (i >= numSymbols) ++ return; ++ prices[i] = a0 + RcTree_GetPrice(p->low + (posState << kLenNumLowBits), kLenNumLowBits, i, ProbPrices); ++ } ++ for (; i < kLenNumLowSymbols + kLenNumMidSymbols; i++) ++ { ++ if (i >= numSymbols) ++ return; ++ prices[i] = b0 + RcTree_GetPrice(p->mid + (posState << kLenNumMidBits), kLenNumMidBits, i - kLenNumLowSymbols, ProbPrices); ++ } ++ for (; i < numSymbols; i++) ++ prices[i] = b1 + RcTree_GetPrice(p->high, kLenNumHighBits, i - kLenNumLowSymbols - kLenNumMidSymbols, ProbPrices); ++} ++ ++static void MY_FAST_CALL LenPriceEnc_UpdateTable(CLenPriceEnc *p, UInt32 posState, UInt32 *ProbPrices) ++{ ++ LenEnc_SetPrices(&p->p, posState, p->tableSize, p->prices[posState], ProbPrices); ++ p->counters[posState] = p->tableSize; ++} ++ ++static void LenPriceEnc_UpdateTables(CLenPriceEnc *p, UInt32 numPosStates, UInt32 *ProbPrices) ++{ ++ UInt32 posState; ++ for (posState = 0; posState < numPosStates; posState++) ++ LenPriceEnc_UpdateTable(p, posState, ProbPrices); ++} ++ ++static void LenEnc_Encode2(CLenPriceEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState, Bool updatePrice, UInt32 *ProbPrices) ++{ ++ LenEnc_Encode(&p->p, rc, symbol, posState); ++ if (updatePrice) ++ if (--p->counters[posState] == 0) ++ LenPriceEnc_UpdateTable(p, posState, ProbPrices); ++} ++ ++ ++ ++ ++static void MovePos(CLzmaEnc *p, UInt32 num) ++{ ++ #ifdef SHOW_STAT ++ ttt += num; ++ printf("\n MovePos %d", num); ++ #endif ++ if (num != 0) ++ { ++ p->additionalOffset += num; ++ p->matchFinder.Skip(p->matchFinderObj, num); ++ } ++} ++ ++static UInt32 ReadMatchDistances(CLzmaEnc *p, UInt32 *numDistancePairsRes) ++{ ++ UInt32 lenRes = 0, numDistancePairs; ++ numDistancePairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matchDistances); ++ #ifdef SHOW_STAT ++ printf("\n i = %d numPairs = %d ", ttt, numDistancePairs / 2); ++ if (ttt >= 61994) ++ ttt = ttt; ++ ++ ttt++; ++ { ++ UInt32 i; ++ for (i = 0; i < numDistancePairs; i += 2) ++ printf("%2d %6d | ", p->matchDistances[i], p->matchDistances[i + 1]); ++ } ++ #endif ++ if (numDistancePairs > 0) ++ { ++ lenRes = p->matchDistances[numDistancePairs - 2]; ++ if (lenRes == p->numFastBytes) ++ { ++ UInt32 numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) + 1; ++ const Byte *pby = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ UInt32 distance = p->matchDistances[numDistancePairs - 1] + 1; ++ if (numAvail > LZMA_MATCH_LEN_MAX) ++ numAvail = LZMA_MATCH_LEN_MAX; ++ ++ { ++ const Byte *pby2 = pby - distance; ++ for (; lenRes < numAvail && pby[lenRes] == pby2[lenRes]; lenRes++); ++ } ++ } ++ } ++ p->additionalOffset++; ++ *numDistancePairsRes = numDistancePairs; ++ return lenRes; ++} ++ ++ ++#define MakeAsChar(p) (p)->backPrev = (UInt32)(-1); (p)->prev1IsChar = False; ++#define MakeAsShortRep(p) (p)->backPrev = 0; (p)->prev1IsChar = False; ++#define IsShortRep(p) ((p)->backPrev == 0) ++ ++static UInt32 GetRepLen1Price(CLzmaEnc *p, UInt32 state, UInt32 posState) ++{ ++ return ++ GET_PRICE_0(p->isRepG0[state]) + ++ GET_PRICE_0(p->isRep0Long[state][posState]); ++} ++ ++static UInt32 GetPureRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 state, UInt32 posState) ++{ ++ UInt32 price; ++ if (repIndex == 0) ++ { ++ price = GET_PRICE_0(p->isRepG0[state]); ++ price += GET_PRICE_1(p->isRep0Long[state][posState]); ++ } ++ else ++ { ++ price = GET_PRICE_1(p->isRepG0[state]); ++ if (repIndex == 1) ++ price += GET_PRICE_0(p->isRepG1[state]); ++ else ++ { ++ price += GET_PRICE_1(p->isRepG1[state]); ++ price += GET_PRICE(p->isRepG2[state], repIndex - 2); ++ } ++ } ++ return price; ++} ++ ++static UInt32 GetRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 len, UInt32 state, UInt32 posState) ++{ ++ return p->repLenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN] + ++ GetPureRepPrice(p, repIndex, state, posState); ++} ++ ++static UInt32 Backward(CLzmaEnc *p, UInt32 *backRes, UInt32 cur) ++{ ++ UInt32 posMem = p->opt[cur].posPrev; ++ UInt32 backMem = p->opt[cur].backPrev; ++ p->optimumEndIndex = cur; ++ do ++ { ++ if (p->opt[cur].prev1IsChar) ++ { ++ MakeAsChar(&p->opt[posMem]) ++ p->opt[posMem].posPrev = posMem - 1; ++ if (p->opt[cur].prev2) ++ { ++ p->opt[posMem - 1].prev1IsChar = False; ++ p->opt[posMem - 1].posPrev = p->opt[cur].posPrev2; ++ p->opt[posMem - 1].backPrev = p->opt[cur].backPrev2; ++ } ++ } ++ { ++ UInt32 posPrev = posMem; ++ UInt32 backCur = backMem; ++ ++ backMem = p->opt[posPrev].backPrev; ++ posMem = p->opt[posPrev].posPrev; ++ ++ p->opt[posPrev].backPrev = backCur; ++ p->opt[posPrev].posPrev = cur; ++ cur = posPrev; ++ } ++ } ++ while (cur != 0); ++ *backRes = p->opt[0].backPrev; ++ p->optimumCurrentIndex = p->opt[0].posPrev; ++ return p->optimumCurrentIndex; ++} ++ ++#define LIT_PROBS(pos, prevByte) (p->litProbs + ((((pos) & p->lpMask) << p->lc) + ((prevByte) >> (8 - p->lc))) * 0x300) ++ ++static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes) ++{ ++ UInt32 numAvailableBytes, lenMain, numDistancePairs; ++ const Byte *data; ++ UInt32 reps[LZMA_NUM_REPS]; ++ UInt32 repLens[LZMA_NUM_REPS]; ++ UInt32 repMaxIndex, i; ++ UInt32 *matchDistances; ++ Byte currentByte, matchByte; ++ UInt32 posState; ++ UInt32 matchPrice, repMatchPrice; ++ UInt32 lenEnd; ++ UInt32 len; ++ UInt32 normalMatchPrice; ++ UInt32 cur; ++ if (p->optimumEndIndex != p->optimumCurrentIndex) ++ { ++ const COptimal *opt = &p->opt[p->optimumCurrentIndex]; ++ UInt32 lenRes = opt->posPrev - p->optimumCurrentIndex; ++ *backRes = opt->backPrev; ++ p->optimumCurrentIndex = opt->posPrev; ++ return lenRes; ++ } ++ p->optimumCurrentIndex = p->optimumEndIndex = 0; ++ ++ numAvailableBytes = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); ++ ++ if (!p->longestMatchWasFound) ++ { ++ lenMain = ReadMatchDistances(p, &numDistancePairs); ++ } ++ else ++ { ++ lenMain = p->longestMatchLength; ++ numDistancePairs = p->numDistancePairs; ++ p->longestMatchWasFound = False; ++ } ++ ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ if (numAvailableBytes < 2) ++ { ++ *backRes = (UInt32)(-1); ++ return 1; ++ } ++ if (numAvailableBytes > LZMA_MATCH_LEN_MAX) ++ numAvailableBytes = LZMA_MATCH_LEN_MAX; ++ ++ repMaxIndex = 0; ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ { ++ UInt32 lenTest; ++ const Byte *data2; ++ reps[i] = p->reps[i]; ++ data2 = data - (reps[i] + 1); ++ if (data[0] != data2[0] || data[1] != data2[1]) ++ { ++ repLens[i] = 0; ++ continue; ++ } ++ for (lenTest = 2; lenTest < numAvailableBytes && data[lenTest] == data2[lenTest]; lenTest++); ++ repLens[i] = lenTest; ++ if (lenTest > repLens[repMaxIndex]) ++ repMaxIndex = i; ++ } ++ if (repLens[repMaxIndex] >= p->numFastBytes) ++ { ++ UInt32 lenRes; ++ *backRes = repMaxIndex; ++ lenRes = repLens[repMaxIndex]; ++ MovePos(p, lenRes - 1); ++ return lenRes; ++ } ++ ++ matchDistances = p->matchDistances; ++ if (lenMain >= p->numFastBytes) ++ { ++ *backRes = matchDistances[numDistancePairs - 1] + LZMA_NUM_REPS; ++ MovePos(p, lenMain - 1); ++ return lenMain; ++ } ++ currentByte = *data; ++ matchByte = *(data - (reps[0] + 1)); ++ ++ if (lenMain < 2 && currentByte != matchByte && repLens[repMaxIndex] < 2) ++ { ++ *backRes = (UInt32)-1; ++ return 1; ++ } ++ ++ p->opt[0].state = (CState)p->state; ++ ++ posState = (position & p->pbMask); ++ ++ { ++ const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); ++ p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) + ++ (!IsCharState(p->state) ? ++ LitEnc_GetPriceMatched(probs, currentByte, matchByte, p->ProbPrices) : ++ LitEnc_GetPrice(probs, currentByte, p->ProbPrices)); ++ } ++ ++ MakeAsChar(&p->opt[1]); ++ ++ matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]); ++ repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]); ++ ++ if (matchByte == currentByte) ++ { ++ UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, p->state, posState); ++ if (shortRepPrice < p->opt[1].price) ++ { ++ p->opt[1].price = shortRepPrice; ++ MakeAsShortRep(&p->opt[1]); ++ } ++ } ++ lenEnd = ((lenMain >= repLens[repMaxIndex]) ? lenMain : repLens[repMaxIndex]); ++ ++ if (lenEnd < 2) ++ { ++ *backRes = p->opt[1].backPrev; ++ return 1; ++ } ++ ++ p->opt[1].posPrev = 0; ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ p->opt[0].backs[i] = reps[i]; ++ ++ len = lenEnd; ++ do ++ p->opt[len--].price = kInfinityPrice; ++ while (len >= 2); ++ ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ { ++ UInt32 repLen = repLens[i]; ++ UInt32 price; ++ if (repLen < 2) ++ continue; ++ price = repMatchPrice + GetPureRepPrice(p, i, p->state, posState); ++ do ++ { ++ UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][repLen - 2]; ++ COptimal *opt = &p->opt[repLen]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = 0; ++ opt->backPrev = i; ++ opt->prev1IsChar = False; ++ } ++ } ++ while (--repLen >= 2); ++ } ++ ++ normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]); ++ ++ len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2); ++ if (len <= lenMain) ++ { ++ UInt32 offs = 0; ++ while (len > matchDistances[offs]) ++ offs += 2; ++ for (; ; len++) ++ { ++ COptimal *opt; ++ UInt32 distance = matchDistances[offs + 1]; ++ ++ UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN]; ++ UInt32 lenToPosState = GetLenToPosState(len); ++ if (distance < kNumFullDistances) ++ curAndLenPrice += p->distancesPrices[lenToPosState][distance]; ++ else ++ { ++ UInt32 slot; ++ GetPosSlot2(distance, slot); ++ curAndLenPrice += p->alignPrices[distance & kAlignMask] + p->posSlotPrices[lenToPosState][slot]; ++ } ++ opt = &p->opt[len]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = 0; ++ opt->backPrev = distance + LZMA_NUM_REPS; ++ opt->prev1IsChar = False; ++ } ++ if (len == matchDistances[offs]) ++ { ++ offs += 2; ++ if (offs == numDistancePairs) ++ break; ++ } ++ } ++ } ++ ++ cur = 0; ++ ++ #ifdef SHOW_STAT2 ++ if (position >= 0) ++ { ++ unsigned i; ++ printf("\n pos = %4X", position); ++ for (i = cur; i <= lenEnd; i++) ++ printf("\nprice[%4X] = %d", position - cur + i, p->opt[i].price); ++ } ++ #endif ++ ++ for (;;) ++ { ++ UInt32 numAvailableBytesFull, newLen, numDistancePairs; ++ COptimal *curOpt; ++ UInt32 posPrev; ++ UInt32 state; ++ UInt32 curPrice; ++ Bool nextIsChar; ++ const Byte *data; ++ Byte currentByte, matchByte; ++ UInt32 posState; ++ UInt32 curAnd1Price; ++ COptimal *nextOpt; ++ UInt32 matchPrice, repMatchPrice; ++ UInt32 numAvailableBytes; ++ UInt32 startLen; ++ ++ cur++; ++ if (cur == lenEnd) ++ return Backward(p, backRes, cur); ++ ++ numAvailableBytesFull = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); ++ newLen = ReadMatchDistances(p, &numDistancePairs); ++ if (newLen >= p->numFastBytes) ++ { ++ p->numDistancePairs = numDistancePairs; ++ p->longestMatchLength = newLen; ++ p->longestMatchWasFound = True; ++ return Backward(p, backRes, cur); ++ } ++ position++; ++ curOpt = &p->opt[cur]; ++ posPrev = curOpt->posPrev; ++ if (curOpt->prev1IsChar) ++ { ++ posPrev--; ++ if (curOpt->prev2) ++ { ++ state = p->opt[curOpt->posPrev2].state; ++ if (curOpt->backPrev2 < LZMA_NUM_REPS) ++ state = kRepNextStates[state]; ++ else ++ state = kMatchNextStates[state]; ++ } ++ else ++ state = p->opt[posPrev].state; ++ state = kLiteralNextStates[state]; ++ } ++ else ++ state = p->opt[posPrev].state; ++ if (posPrev == cur - 1) ++ { ++ if (IsShortRep(curOpt)) ++ state = kShortRepNextStates[state]; ++ else ++ state = kLiteralNextStates[state]; ++ } ++ else ++ { ++ UInt32 pos; ++ const COptimal *prevOpt; ++ if (curOpt->prev1IsChar && curOpt->prev2) ++ { ++ posPrev = curOpt->posPrev2; ++ pos = curOpt->backPrev2; ++ state = kRepNextStates[state]; ++ } ++ else ++ { ++ pos = curOpt->backPrev; ++ if (pos < LZMA_NUM_REPS) ++ state = kRepNextStates[state]; ++ else ++ state = kMatchNextStates[state]; ++ } ++ prevOpt = &p->opt[posPrev]; ++ if (pos < LZMA_NUM_REPS) ++ { ++ UInt32 i; ++ reps[0] = prevOpt->backs[pos]; ++ for (i = 1; i <= pos; i++) ++ reps[i] = prevOpt->backs[i - 1]; ++ for (; i < LZMA_NUM_REPS; i++) ++ reps[i] = prevOpt->backs[i]; ++ } ++ else ++ { ++ UInt32 i; ++ reps[0] = (pos - LZMA_NUM_REPS); ++ for (i = 1; i < LZMA_NUM_REPS; i++) ++ reps[i] = prevOpt->backs[i - 1]; ++ } ++ } ++ curOpt->state = (CState)state; ++ ++ curOpt->backs[0] = reps[0]; ++ curOpt->backs[1] = reps[1]; ++ curOpt->backs[2] = reps[2]; ++ curOpt->backs[3] = reps[3]; ++ ++ curPrice = curOpt->price; ++ nextIsChar = False; ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ currentByte = *data; ++ matchByte = *(data - (reps[0] + 1)); ++ ++ posState = (position & p->pbMask); ++ ++ curAnd1Price = curPrice + GET_PRICE_0(p->isMatch[state][posState]); ++ { ++ const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); ++ curAnd1Price += ++ (!IsCharState(state) ? ++ LitEnc_GetPriceMatched(probs, currentByte, matchByte, p->ProbPrices) : ++ LitEnc_GetPrice(probs, currentByte, p->ProbPrices)); ++ } ++ ++ nextOpt = &p->opt[cur + 1]; ++ ++ if (curAnd1Price < nextOpt->price) ++ { ++ nextOpt->price = curAnd1Price; ++ nextOpt->posPrev = cur; ++ MakeAsChar(nextOpt); ++ nextIsChar = True; ++ } ++ ++ matchPrice = curPrice + GET_PRICE_1(p->isMatch[state][posState]); ++ repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]); ++ ++ if (matchByte == currentByte && !(nextOpt->posPrev < cur && nextOpt->backPrev == 0)) ++ { ++ UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, state, posState); ++ if (shortRepPrice <= nextOpt->price) ++ { ++ nextOpt->price = shortRepPrice; ++ nextOpt->posPrev = cur; ++ MakeAsShortRep(nextOpt); ++ nextIsChar = True; ++ } ++ } ++ ++ { ++ UInt32 temp = kNumOpts - 1 - cur; ++ if (temp < numAvailableBytesFull) ++ numAvailableBytesFull = temp; ++ } ++ numAvailableBytes = numAvailableBytesFull; ++ ++ if (numAvailableBytes < 2) ++ continue; ++ if (numAvailableBytes > p->numFastBytes) ++ numAvailableBytes = p->numFastBytes; ++ if (!nextIsChar && matchByte != currentByte) /* speed optimization */ ++ { ++ /* try Literal + rep0 */ ++ UInt32 temp; ++ UInt32 lenTest2; ++ const Byte *data2 = data - (reps[0] + 1); ++ UInt32 limit = p->numFastBytes + 1; ++ if (limit > numAvailableBytesFull) ++ limit = numAvailableBytesFull; ++ ++ for (temp = 1; temp < limit && data[temp] == data2[temp]; temp++); ++ lenTest2 = temp - 1; ++ if (lenTest2 >= 2) ++ { ++ UInt32 state2 = kLiteralNextStates[state]; ++ UInt32 posStateNext = (position + 1) & p->pbMask; ++ UInt32 nextRepMatchPrice = curAnd1Price + ++ GET_PRICE_1(p->isMatch[state2][posStateNext]) + ++ GET_PRICE_1(p->isRep[state2]); ++ /* for (; lenTest2 >= 2; lenTest2--) */ ++ { ++ UInt32 curAndLenPrice; ++ COptimal *opt; ++ UInt32 offset = cur + 1 + lenTest2; ++ while (lenEnd < offset) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); ++ opt = &p->opt[offset]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur + 1; ++ opt->backPrev = 0; ++ opt->prev1IsChar = True; ++ opt->prev2 = False; ++ } ++ } ++ } ++ } ++ ++ startLen = 2; /* speed optimization */ ++ { ++ UInt32 repIndex; ++ for (repIndex = 0; repIndex < LZMA_NUM_REPS; repIndex++) ++ { ++ UInt32 lenTest; ++ UInt32 lenTestTemp; ++ UInt32 price; ++ const Byte *data2 = data - (reps[repIndex] + 1); ++ if (data[0] != data2[0] || data[1] != data2[1]) ++ continue; ++ for (lenTest = 2; lenTest < numAvailableBytes && data[lenTest] == data2[lenTest]; lenTest++); ++ while (lenEnd < cur + lenTest) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ lenTestTemp = lenTest; ++ price = repMatchPrice + GetPureRepPrice(p, repIndex, state, posState); ++ do ++ { ++ UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][lenTest - 2]; ++ COptimal *opt = &p->opt[cur + lenTest]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur; ++ opt->backPrev = repIndex; ++ opt->prev1IsChar = False; ++ } ++ } ++ while (--lenTest >= 2); ++ lenTest = lenTestTemp; ++ ++ if (repIndex == 0) ++ startLen = lenTest + 1; ++ ++ /* if (_maxMode) */ ++ { ++ UInt32 lenTest2 = lenTest + 1; ++ UInt32 limit = lenTest2 + p->numFastBytes; ++ UInt32 nextRepMatchPrice; ++ if (limit > numAvailableBytesFull) ++ limit = numAvailableBytesFull; ++ for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); ++ lenTest2 -= lenTest + 1; ++ if (lenTest2 >= 2) ++ { ++ UInt32 state2 = kRepNextStates[state]; ++ UInt32 posStateNext = (position + lenTest) & p->pbMask; ++ UInt32 curAndLenCharPrice = ++ price + p->repLenEnc.prices[posState][lenTest - 2] + ++ GET_PRICE_0(p->isMatch[state2][posStateNext]) + ++ LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), ++ data[lenTest], data2[lenTest], p->ProbPrices); ++ state2 = kLiteralNextStates[state2]; ++ posStateNext = (position + lenTest + 1) & p->pbMask; ++ nextRepMatchPrice = curAndLenCharPrice + ++ GET_PRICE_1(p->isMatch[state2][posStateNext]) + ++ GET_PRICE_1(p->isRep[state2]); ++ ++ /* for (; lenTest2 >= 2; lenTest2--) */ ++ { ++ UInt32 curAndLenPrice; ++ COptimal *opt; ++ UInt32 offset = cur + lenTest + 1 + lenTest2; ++ while (lenEnd < offset) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); ++ opt = &p->opt[offset]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur + lenTest + 1; ++ opt->backPrev = 0; ++ opt->prev1IsChar = True; ++ opt->prev2 = True; ++ opt->posPrev2 = cur; ++ opt->backPrev2 = repIndex; ++ } ++ } ++ } ++ } ++ } ++ } ++ /* for (UInt32 lenTest = 2; lenTest <= newLen; lenTest++) */ ++ if (newLen > numAvailableBytes) ++ { ++ newLen = numAvailableBytes; ++ for (numDistancePairs = 0; newLen > matchDistances[numDistancePairs]; numDistancePairs += 2); ++ matchDistances[numDistancePairs] = newLen; ++ numDistancePairs += 2; ++ } ++ if (newLen >= startLen) ++ { ++ UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]); ++ UInt32 offs, curBack, posSlot; ++ UInt32 lenTest; ++ while (lenEnd < cur + newLen) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ ++ offs = 0; ++ while (startLen > matchDistances[offs]) ++ offs += 2; ++ curBack = matchDistances[offs + 1]; ++ GetPosSlot2(curBack, posSlot); ++ for (lenTest = /*2*/ startLen; ; lenTest++) ++ { ++ UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][lenTest - LZMA_MATCH_LEN_MIN]; ++ UInt32 lenToPosState = GetLenToPosState(lenTest); ++ COptimal *opt; ++ if (curBack < kNumFullDistances) ++ curAndLenPrice += p->distancesPrices[lenToPosState][curBack]; ++ else ++ curAndLenPrice += p->posSlotPrices[lenToPosState][posSlot] + p->alignPrices[curBack & kAlignMask]; ++ ++ opt = &p->opt[cur + lenTest]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur; ++ opt->backPrev = curBack + LZMA_NUM_REPS; ++ opt->prev1IsChar = False; ++ } ++ ++ if (/*_maxMode && */lenTest == matchDistances[offs]) ++ { ++ /* Try Match + Literal + Rep0 */ ++ const Byte *data2 = data - (curBack + 1); ++ UInt32 lenTest2 = lenTest + 1; ++ UInt32 limit = lenTest2 + p->numFastBytes; ++ UInt32 nextRepMatchPrice; ++ if (limit > numAvailableBytesFull) ++ limit = numAvailableBytesFull; ++ for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); ++ lenTest2 -= lenTest + 1; ++ if (lenTest2 >= 2) ++ { ++ UInt32 state2 = kMatchNextStates[state]; ++ UInt32 posStateNext = (position + lenTest) & p->pbMask; ++ UInt32 curAndLenCharPrice = curAndLenPrice + ++ GET_PRICE_0(p->isMatch[state2][posStateNext]) + ++ LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), ++ data[lenTest], data2[lenTest], p->ProbPrices); ++ state2 = kLiteralNextStates[state2]; ++ posStateNext = (posStateNext + 1) & p->pbMask; ++ nextRepMatchPrice = curAndLenCharPrice + ++ GET_PRICE_1(p->isMatch[state2][posStateNext]) + ++ GET_PRICE_1(p->isRep[state2]); ++ ++ /* for (; lenTest2 >= 2; lenTest2--) */ ++ { ++ UInt32 offset = cur + lenTest + 1 + lenTest2; ++ UInt32 curAndLenPrice; ++ COptimal *opt; ++ while (lenEnd < offset) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); ++ opt = &p->opt[offset]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur + lenTest + 1; ++ opt->backPrev = 0; ++ opt->prev1IsChar = True; ++ opt->prev2 = True; ++ opt->posPrev2 = cur; ++ opt->backPrev2 = curBack + LZMA_NUM_REPS; ++ } ++ } ++ } ++ offs += 2; ++ if (offs == numDistancePairs) ++ break; ++ curBack = matchDistances[offs + 1]; ++ if (curBack >= kNumFullDistances) ++ GetPosSlot2(curBack, posSlot); ++ } ++ } ++ } ++ } ++} ++ ++#define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist)) ++ ++static UInt32 GetOptimumFast(CLzmaEnc *p, UInt32 *backRes) ++{ ++ UInt32 numAvailableBytes = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); ++ UInt32 lenMain, numDistancePairs; ++ const Byte *data; ++ UInt32 repLens[LZMA_NUM_REPS]; ++ UInt32 repMaxIndex, i; ++ UInt32 *matchDistances; ++ UInt32 backMain; ++ ++ if (!p->longestMatchWasFound) ++ { ++ lenMain = ReadMatchDistances(p, &numDistancePairs); ++ } ++ else ++ { ++ lenMain = p->longestMatchLength; ++ numDistancePairs = p->numDistancePairs; ++ p->longestMatchWasFound = False; ++ } ++ ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ if (numAvailableBytes > LZMA_MATCH_LEN_MAX) ++ numAvailableBytes = LZMA_MATCH_LEN_MAX; ++ if (numAvailableBytes < 2) ++ { ++ *backRes = (UInt32)(-1); ++ return 1; ++ } ++ ++ repMaxIndex = 0; ++ ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ { ++ const Byte *data2 = data - (p->reps[i] + 1); ++ UInt32 len; ++ if (data[0] != data2[0] || data[1] != data2[1]) ++ { ++ repLens[i] = 0; ++ continue; ++ } ++ for (len = 2; len < numAvailableBytes && data[len] == data2[len]; len++); ++ if (len >= p->numFastBytes) ++ { ++ *backRes = i; ++ MovePos(p, len - 1); ++ return len; ++ } ++ repLens[i] = len; ++ if (len > repLens[repMaxIndex]) ++ repMaxIndex = i; ++ } ++ matchDistances = p->matchDistances; ++ if (lenMain >= p->numFastBytes) ++ { ++ *backRes = matchDistances[numDistancePairs - 1] + LZMA_NUM_REPS; ++ MovePos(p, lenMain - 1); ++ return lenMain; ++ } ++ ++ backMain = 0; /* for GCC */ ++ if (lenMain >= 2) ++ { ++ backMain = matchDistances[numDistancePairs - 1]; ++ while (numDistancePairs > 2 && lenMain == matchDistances[numDistancePairs - 4] + 1) ++ { ++ if (!ChangePair(matchDistances[numDistancePairs - 3], backMain)) ++ break; ++ numDistancePairs -= 2; ++ lenMain = matchDistances[numDistancePairs - 2]; ++ backMain = matchDistances[numDistancePairs - 1]; ++ } ++ if (lenMain == 2 && backMain >= 0x80) ++ lenMain = 1; ++ } ++ ++ if (repLens[repMaxIndex] >= 2) ++ { ++ if (repLens[repMaxIndex] + 1 >= lenMain || ++ (repLens[repMaxIndex] + 2 >= lenMain && (backMain > (1 << 9))) || ++ (repLens[repMaxIndex] + 3 >= lenMain && (backMain > (1 << 15)))) ++ { ++ UInt32 lenRes; ++ *backRes = repMaxIndex; ++ lenRes = repLens[repMaxIndex]; ++ MovePos(p, lenRes - 1); ++ return lenRes; ++ } ++ } ++ ++ if (lenMain >= 2 && numAvailableBytes > 2) ++ { ++ UInt32 i; ++ numAvailableBytes = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); ++ p->longestMatchLength = ReadMatchDistances(p, &p->numDistancePairs); ++ if (p->longestMatchLength >= 2) ++ { ++ UInt32 newDistance = matchDistances[p->numDistancePairs - 1]; ++ if ((p->longestMatchLength >= lenMain && newDistance < backMain) || ++ (p->longestMatchLength == lenMain + 1 && !ChangePair(backMain, newDistance)) || ++ (p->longestMatchLength > lenMain + 1) || ++ (p->longestMatchLength + 1 >= lenMain && lenMain >= 3 && ChangePair(newDistance, backMain))) ++ { ++ p->longestMatchWasFound = True; ++ *backRes = (UInt32)(-1); ++ return 1; ++ } ++ } ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ { ++ UInt32 len; ++ const Byte *data2 = data - (p->reps[i] + 1); ++ if (data[1] != data2[1] || data[2] != data2[2]) ++ { ++ repLens[i] = 0; ++ continue; ++ } ++ for (len = 2; len < numAvailableBytes && data[len] == data2[len]; len++); ++ if (len + 1 >= lenMain) ++ { ++ p->longestMatchWasFound = True; ++ *backRes = (UInt32)(-1); ++ return 1; ++ } ++ } ++ *backRes = backMain + LZMA_NUM_REPS; ++ MovePos(p, lenMain - 2); ++ return lenMain; ++ } ++ *backRes = (UInt32)(-1); ++ return 1; ++} ++ ++static void WriteEndMarker(CLzmaEnc *p, UInt32 posState) ++{ ++ UInt32 len; ++ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); ++ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); ++ p->state = kMatchNextStates[p->state]; ++ len = LZMA_MATCH_LEN_MIN; ++ LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); ++ RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, (1 << kNumPosSlotBits) - 1); ++ RangeEnc_EncodeDirectBits(&p->rc, (((UInt32)1 << 30) - 1) >> kNumAlignBits, 30 - kNumAlignBits); ++ RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask); ++} ++ ++static SRes CheckErrors(CLzmaEnc *p) ++{ ++ if (p->result != SZ_OK) ++ return p->result; ++ if (p->rc.res != SZ_OK) ++ p->result = SZ_ERROR_WRITE; ++ if (p->matchFinderBase.result != SZ_OK) ++ p->result = SZ_ERROR_READ; ++ if (p->result != SZ_OK) ++ p->finished = True; ++ return p->result; ++} ++ ++static SRes Flush(CLzmaEnc *p, UInt32 nowPos) ++{ ++ /* ReleaseMFStream(); */ ++ p->finished = True; ++ if (p->writeEndMark) ++ WriteEndMarker(p, nowPos & p->pbMask); ++ RangeEnc_FlushData(&p->rc); ++ RangeEnc_FlushStream(&p->rc); ++ return CheckErrors(p); ++} ++ ++static void FillAlignPrices(CLzmaEnc *p) ++{ ++ UInt32 i; ++ for (i = 0; i < kAlignTableSize; i++) ++ p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices); ++ p->alignPriceCount = 0; ++} ++ ++static void FillDistancesPrices(CLzmaEnc *p) ++{ ++ UInt32 tempPrices[kNumFullDistances]; ++ UInt32 i, lenToPosState; ++ for (i = kStartPosModelIndex; i < kNumFullDistances; i++) ++ { ++ UInt32 posSlot = GetPosSlot1(i); ++ UInt32 footerBits = ((posSlot >> 1) - 1); ++ UInt32 base = ((2 | (posSlot & 1)) << footerBits); ++ tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base - posSlot - 1, footerBits, i - base, p->ProbPrices); ++ } ++ ++ for (lenToPosState = 0; lenToPosState < kNumLenToPosStates; lenToPosState++) ++ { ++ UInt32 posSlot; ++ const CLzmaProb *encoder = p->posSlotEncoder[lenToPosState]; ++ UInt32 *posSlotPrices = p->posSlotPrices[lenToPosState]; ++ for (posSlot = 0; posSlot < p->distTableSize; posSlot++) ++ posSlotPrices[posSlot] = RcTree_GetPrice(encoder, kNumPosSlotBits, posSlot, p->ProbPrices); ++ for (posSlot = kEndPosModelIndex; posSlot < p->distTableSize; posSlot++) ++ posSlotPrices[posSlot] += ((((posSlot >> 1) - 1) - kNumAlignBits) << kNumBitPriceShiftBits); ++ ++ { ++ UInt32 *distancesPrices = p->distancesPrices[lenToPosState]; ++ UInt32 i; ++ for (i = 0; i < kStartPosModelIndex; i++) ++ distancesPrices[i] = posSlotPrices[i]; ++ for (; i < kNumFullDistances; i++) ++ distancesPrices[i] = posSlotPrices[GetPosSlot1(i)] + tempPrices[i]; ++ } ++ } ++ p->matchPriceCount = 0; ++} ++ ++void LzmaEnc_Construct(CLzmaEnc *p) ++{ ++ RangeEnc_Construct(&p->rc); ++ MatchFinder_Construct(&p->matchFinderBase); ++ #ifdef COMPRESS_MF_MT ++ MatchFinderMt_Construct(&p->matchFinderMt); ++ p->matchFinderMt.MatchFinder = &p->matchFinderBase; ++ #endif ++ ++ { ++ CLzmaEncProps props; ++ LzmaEncProps_Init(&props); ++ LzmaEnc_SetProps(p, &props); ++ } ++ ++ #ifndef LZMA_LOG_BSR ++ LzmaEnc_FastPosInit(p->g_FastPos); ++ #endif ++ ++ LzmaEnc_InitPriceTables(p->ProbPrices); ++ p->litProbs = 0; ++ p->saveState.litProbs = 0; ++} ++ ++CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc) ++{ ++ void *p; ++ p = alloc->Alloc(alloc, sizeof(CLzmaEnc)); ++ if (p != 0) ++ LzmaEnc_Construct((CLzmaEnc *)p); ++ return p; ++} ++ ++void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->litProbs); ++ alloc->Free(alloc, p->saveState.litProbs); ++ p->litProbs = 0; ++ p->saveState.litProbs = 0; ++} ++ ++void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ #ifdef COMPRESS_MF_MT ++ MatchFinderMt_Destruct(&p->matchFinderMt, allocBig); ++ #endif ++ MatchFinder_Free(&p->matchFinderBase, allocBig); ++ LzmaEnc_FreeLits(p, alloc); ++ RangeEnc_Free(&p->rc, alloc); ++} ++ ++void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig); ++ alloc->Free(alloc, p); ++} ++ ++static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize, UInt32 maxUnpackSize) ++{ ++ UInt32 nowPos32, startPos32; ++ if (p->inStream != 0) ++ { ++ p->matchFinderBase.stream = p->inStream; ++ p->matchFinder.Init(p->matchFinderObj); ++ p->inStream = 0; ++ } ++ ++ if (p->finished) ++ return p->result; ++ RINOK(CheckErrors(p)); ++ ++ nowPos32 = (UInt32)p->nowPos64; ++ startPos32 = nowPos32; ++ ++ if (p->nowPos64 == 0) ++ { ++ UInt32 numDistancePairs; ++ Byte curByte; ++ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) ++ return Flush(p, nowPos32); ++ ReadMatchDistances(p, &numDistancePairs); ++ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][0], 0); ++ p->state = kLiteralNextStates[p->state]; ++ curByte = p->matchFinder.GetIndexByte(p->matchFinderObj, 0 - p->additionalOffset); ++ LitEnc_Encode(&p->rc, p->litProbs, curByte); ++ p->additionalOffset--; ++ nowPos32++; ++ } ++ ++ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0) ++ for (;;) ++ { ++ UInt32 pos, len, posState; ++ ++ if (p->fastMode) ++ len = GetOptimumFast(p, &pos); ++ else ++ len = GetOptimum(p, nowPos32, &pos); ++ ++ #ifdef SHOW_STAT2 ++ printf("\n pos = %4X, len = %d pos = %d", nowPos32, len, pos); ++ #endif ++ ++ posState = nowPos32 & p->pbMask; ++ if (len == 1 && pos == 0xFFFFFFFF) ++ { ++ Byte curByte; ++ CLzmaProb *probs; ++ const Byte *data; ++ ++ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 0); ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; ++ curByte = *data; ++ probs = LIT_PROBS(nowPos32, *(data - 1)); ++ if (IsCharState(p->state)) ++ LitEnc_Encode(&p->rc, probs, curByte); ++ else ++ LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0] - 1)); ++ p->state = kLiteralNextStates[p->state]; ++ } ++ else ++ { ++ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); ++ if (pos < LZMA_NUM_REPS) ++ { ++ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 1); ++ if (pos == 0) ++ { ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 0); ++ RangeEnc_EncodeBit(&p->rc, &p->isRep0Long[p->state][posState], ((len == 1) ? 0 : 1)); ++ } ++ else ++ { ++ UInt32 distance = p->reps[pos]; ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 1); ++ if (pos == 1) ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 0); ++ else ++ { ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 1); ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG2[p->state], pos - 2); ++ if (pos == 3) ++ p->reps[3] = p->reps[2]; ++ p->reps[2] = p->reps[1]; ++ } ++ p->reps[1] = p->reps[0]; ++ p->reps[0] = distance; ++ } ++ if (len == 1) ++ p->state = kShortRepNextStates[p->state]; ++ else ++ { ++ LenEnc_Encode2(&p->repLenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); ++ p->state = kRepNextStates[p->state]; ++ } ++ } ++ else ++ { ++ UInt32 posSlot; ++ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); ++ p->state = kMatchNextStates[p->state]; ++ LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); ++ pos -= LZMA_NUM_REPS; ++ GetPosSlot(pos, posSlot); ++ RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, posSlot); ++ ++ if (posSlot >= kStartPosModelIndex) ++ { ++ UInt32 footerBits = ((posSlot >> 1) - 1); ++ UInt32 base = ((2 | (posSlot & 1)) << footerBits); ++ UInt32 posReduced = pos - base; ++ ++ if (posSlot < kEndPosModelIndex) ++ RcTree_ReverseEncode(&p->rc, p->posEncoders + base - posSlot - 1, footerBits, posReduced); ++ else ++ { ++ RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits); ++ RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask); ++ p->alignPriceCount++; ++ } ++ } ++ p->reps[3] = p->reps[2]; ++ p->reps[2] = p->reps[1]; ++ p->reps[1] = p->reps[0]; ++ p->reps[0] = pos; ++ p->matchPriceCount++; ++ } ++ } ++ p->additionalOffset -= len; ++ nowPos32 += len; ++ if (p->additionalOffset == 0) ++ { ++ UInt32 processed; ++ if (!p->fastMode) ++ { ++ if (p->matchPriceCount >= (1 << 7)) ++ FillDistancesPrices(p); ++ if (p->alignPriceCount >= kAlignTableSize) ++ FillAlignPrices(p); ++ } ++ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) ++ break; ++ processed = nowPos32 - startPos32; ++ if (useLimits) ++ { ++ if (processed + kNumOpts + 300 >= maxUnpackSize || ++ RangeEnc_GetProcessed(&p->rc) + kNumOpts * 2 >= maxPackSize) ++ break; ++ } ++ else if (processed >= (1 << 15)) ++ { ++ p->nowPos64 += nowPos32 - startPos32; ++ return CheckErrors(p); ++ } ++ } ++ } ++ p->nowPos64 += nowPos32 - startPos32; ++ return Flush(p, nowPos32); ++} ++ ++#define kBigHashDicLimit ((UInt32)1 << 24) ++ ++static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ UInt32 beforeSize = kNumOpts; ++ Bool btMode; ++ if (!RangeEnc_Alloc(&p->rc, alloc)) ++ return SZ_ERROR_MEM; ++ btMode = (p->matchFinderBase.btMode != 0); ++ #ifdef COMPRESS_MF_MT ++ p->mtMode = (p->multiThread && !p->fastMode && btMode); ++ #endif ++ ++ { ++ unsigned lclp = p->lc + p->lp; ++ if (p->litProbs == 0 || p->saveState.litProbs == 0 || p->lclp != lclp) ++ { ++ LzmaEnc_FreeLits(p, alloc); ++ p->litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb)); ++ p->saveState.litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb)); ++ if (p->litProbs == 0 || p->saveState.litProbs == 0) ++ { ++ LzmaEnc_FreeLits(p, alloc); ++ return SZ_ERROR_MEM; ++ } ++ p->lclp = lclp; ++ } ++ } ++ ++ p->matchFinderBase.bigHash = (p->dictSize > kBigHashDicLimit); ++ ++ if (beforeSize + p->dictSize < keepWindowSize) ++ beforeSize = keepWindowSize - p->dictSize; ++ ++ #ifdef COMPRESS_MF_MT ++ if (p->mtMode) ++ { ++ RINOK(MatchFinderMt_Create(&p->matchFinderMt, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)); ++ p->matchFinderObj = &p->matchFinderMt; ++ MatchFinderMt_CreateVTable(&p->matchFinderMt, &p->matchFinder); ++ } ++ else ++ #endif ++ { ++ if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)) ++ return SZ_ERROR_MEM; ++ p->matchFinderObj = &p->matchFinderBase; ++ MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder); ++ } ++ return SZ_OK; ++} ++ ++void LzmaEnc_Init(CLzmaEnc *p) ++{ ++ UInt32 i; ++ p->state = 0; ++ for(i = 0 ; i < LZMA_NUM_REPS; i++) ++ p->reps[i] = 0; ++ ++ RangeEnc_Init(&p->rc); ++ ++ ++ for (i = 0; i < kNumStates; i++) ++ { ++ UInt32 j; ++ for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++) ++ { ++ p->isMatch[i][j] = kProbInitValue; ++ p->isRep0Long[i][j] = kProbInitValue; ++ } ++ p->isRep[i] = kProbInitValue; ++ p->isRepG0[i] = kProbInitValue; ++ p->isRepG1[i] = kProbInitValue; ++ p->isRepG2[i] = kProbInitValue; ++ } ++ ++ { ++ UInt32 num = 0x300 << (p->lp + p->lc); ++ for (i = 0; i < num; i++) ++ p->litProbs[i] = kProbInitValue; ++ } ++ ++ { ++ for (i = 0; i < kNumLenToPosStates; i++) ++ { ++ CLzmaProb *probs = p->posSlotEncoder[i]; ++ UInt32 j; ++ for (j = 0; j < (1 << kNumPosSlotBits); j++) ++ probs[j] = kProbInitValue; ++ } ++ } ++ { ++ for(i = 0; i < kNumFullDistances - kEndPosModelIndex; i++) ++ p->posEncoders[i] = kProbInitValue; ++ } ++ ++ LenEnc_Init(&p->lenEnc.p); ++ LenEnc_Init(&p->repLenEnc.p); ++ ++ for (i = 0; i < (1 << kNumAlignBits); i++) ++ p->posAlignEncoder[i] = kProbInitValue; ++ ++ p->longestMatchWasFound = False; ++ p->optimumEndIndex = 0; ++ p->optimumCurrentIndex = 0; ++ p->additionalOffset = 0; ++ ++ p->pbMask = (1 << p->pb) - 1; ++ p->lpMask = (1 << p->lp) - 1; ++} ++ ++void LzmaEnc_InitPrices(CLzmaEnc *p) ++{ ++ if (!p->fastMode) ++ { ++ FillDistancesPrices(p); ++ FillAlignPrices(p); ++ } ++ ++ p->lenEnc.tableSize = ++ p->repLenEnc.tableSize = ++ p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN; ++ LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, p->ProbPrices); ++ LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, p->ProbPrices); ++} ++ ++static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ UInt32 i; ++ for (i = 0; i < (UInt32)kDicLogSizeMaxCompress; i++) ++ if (p->dictSize <= ((UInt32)1 << i)) ++ break; ++ p->distTableSize = i * 2; ++ ++ p->finished = False; ++ p->result = SZ_OK; ++ RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig)); ++ LzmaEnc_Init(p); ++ LzmaEnc_InitPrices(p); ++ p->nowPos64 = 0; ++ return SZ_OK; ++} ++ ++static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqInStream *inStream, ISeqOutStream *outStream, ++ ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ p->inStream = inStream; ++ p->rc.outStream = outStream; ++ return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig); ++} ++ ++SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, ++ ISeqInStream *inStream, UInt32 keepWindowSize, ++ ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ p->inStream = inStream; ++ return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); ++} ++ ++static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen) ++{ ++ p->seqBufInStream.funcTable.Read = MyRead; ++ p->seqBufInStream.data = src; ++ p->seqBufInStream.rem = srcLen; ++} ++ ++SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, ++ UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ LzmaEnc_SetInputBuf(p, src, srcLen); ++ p->inStream = &p->seqBufInStream.funcTable; ++ return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); ++} ++ ++void LzmaEnc_Finish(CLzmaEncHandle pp) ++{ ++ #ifdef COMPRESS_MF_MT ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ if (p->mtMode) ++ MatchFinderMt_ReleaseStream(&p->matchFinderMt); ++ #endif ++} ++ ++typedef struct _CSeqOutStreamBuf ++{ ++ ISeqOutStream funcTable; ++ Byte *data; ++ SizeT rem; ++ Bool overflow; ++} CSeqOutStreamBuf; ++ ++static size_t MyWrite(void *pp, const void *data, size_t size) ++{ ++ CSeqOutStreamBuf *p = (CSeqOutStreamBuf *)pp; ++ if (p->rem < size) ++ { ++ size = p->rem; ++ p->overflow = True; ++ } ++ memcpy(p->data, data, size); ++ p->rem -= size; ++ p->data += size; ++ return size; ++} ++ ++ ++UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp) ++{ ++ const CLzmaEnc *p = (CLzmaEnc *)pp; ++ return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); ++} ++ ++const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) ++{ ++ const CLzmaEnc *p = (CLzmaEnc *)pp; ++ return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; ++} ++ ++SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit, ++ Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ UInt64 nowPos64; ++ SRes res; ++ CSeqOutStreamBuf outStream; ++ ++ outStream.funcTable.Write = MyWrite; ++ outStream.data = dest; ++ outStream.rem = *destLen; ++ outStream.overflow = False; ++ ++ p->writeEndMark = False; ++ p->finished = False; ++ p->result = SZ_OK; ++ ++ if (reInit) ++ LzmaEnc_Init(p); ++ LzmaEnc_InitPrices(p); ++ nowPos64 = p->nowPos64; ++ RangeEnc_Init(&p->rc); ++ p->rc.outStream = &outStream.funcTable; ++ ++ res = LzmaEnc_CodeOneBlock(pp, True, desiredPackSize, *unpackSize); ++ ++ *unpackSize = (UInt32)(p->nowPos64 - nowPos64); ++ *destLen -= outStream.rem; ++ if (outStream.overflow) ++ return SZ_ERROR_OUTPUT_EOF; ++ ++ return res; ++} ++ ++SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress, ++ ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ SRes res = SZ_OK; ++ ++ #ifdef COMPRESS_MF_MT ++ Byte allocaDummy[0x300]; ++ int i = 0; ++ for (i = 0; i < 16; i++) ++ allocaDummy[i] = (Byte)i; ++ #endif ++ ++ RINOK(LzmaEnc_Prepare(pp, inStream, outStream, alloc, allocBig)); ++ ++ for (;;) ++ { ++ res = LzmaEnc_CodeOneBlock(pp, False, 0, 0); ++ if (res != SZ_OK || p->finished != 0) ++ break; ++ if (progress != 0) ++ { ++ res = progress->Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc)); ++ if (res != SZ_OK) ++ { ++ res = SZ_ERROR_PROGRESS; ++ break; ++ } ++ } ++ } ++ LzmaEnc_Finish(pp); ++ return res; ++} ++ ++SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ int i; ++ UInt32 dictSize = p->dictSize; ++ if (*size < LZMA_PROPS_SIZE) ++ return SZ_ERROR_PARAM; ++ *size = LZMA_PROPS_SIZE; ++ props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc); ++ ++ for (i = 11; i <= 30; i++) ++ { ++ if (dictSize <= ((UInt32)2 << i)) ++ { ++ dictSize = (2 << i); ++ break; ++ } ++ if (dictSize <= ((UInt32)3 << i)) ++ { ++ dictSize = (3 << i); ++ break; ++ } ++ } ++ ++ for (i = 0; i < 4; i++) ++ props[1 + i] = (Byte)(dictSize >> (8 * i)); ++ return SZ_OK; ++} ++ ++SRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, ++ int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ SRes res; ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ ++ CSeqOutStreamBuf outStream; ++ ++ LzmaEnc_SetInputBuf(p, src, srcLen); ++ ++ outStream.funcTable.Write = MyWrite; ++ outStream.data = dest; ++ outStream.rem = *destLen; ++ outStream.overflow = False; ++ ++ p->writeEndMark = writeEndMark; ++ res = LzmaEnc_Encode(pp, &outStream.funcTable, &p->seqBufInStream.funcTable, ++ progress, alloc, allocBig); ++ ++ *destLen -= outStream.rem; ++ if (outStream.overflow) ++ return SZ_ERROR_OUTPUT_EOF; ++ return res; ++} ++ ++SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, ++ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, ++ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc); ++ SRes res; ++ if (p == 0) ++ return SZ_ERROR_MEM; ++ ++ res = LzmaEnc_SetProps(p, props); ++ if (res == SZ_OK) ++ { ++ res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize); ++ if (res == SZ_OK) ++ res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen, ++ writeEndMark, progress, alloc, allocBig); ++ } ++ ++ LzmaEnc_Destroy(p, alloc, allocBig); ++ return res; ++} +--- a/mkfs.jffs2.c ++++ b/mkfs.jffs2.c +@@ -1658,11 +1658,11 @@ int main(int argc, char **argv) + } + erase_block_size *= units; + +- /* If it's less than 8KiB, they're not allowed */ +- if (erase_block_size < 0x2000) { +- fprintf(stderr, "Erase size 0x%x too small. Increasing to 8KiB minimum\n", ++ /* If it's less than 4KiB, they're not allowed */ ++ if (erase_block_size < 0x1000) { ++ fprintf(stderr, "Erase size 0x%x too small. Increasing to 4KiB minimum\n", + erase_block_size); +- erase_block_size = 0x2000; ++ erase_block_size = 0x1000; + } + break; + } diff --git a/utils/mtd-utils/patches/131-fix_lib_compile.patch b/utils/mtd-utils/patches/131-fix_lib_compile.patch new file mode 100644 index 0000000..8c977c1 --- /dev/null +++ b/utils/mtd-utils/patches/131-fix_lib_compile.patch @@ -0,0 +1,11 @@ +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -7,7 +7,7 @@ SUBDIRS = + # CFLAGS += -Werror + CPPFLAGS += -I../include + LIBS = libmtd +-TARGETS = libmtd.a ++override TARGETS = libmtd.a + + include ../common.mk + diff --git a/utils/mtd-utils/patches/135-mkubifs_optional_lzo.patch b/utils/mtd-utils/patches/135-mkubifs_optional_lzo.patch new file mode 100644 index 0000000..82b6c2f --- /dev/null +++ b/utils/mtd-utils/patches/135-mkubifs_optional_lzo.patch @@ -0,0 +1,119 @@ +--- a/mkfs.ubifs/compr.c ++++ b/mkfs.ubifs/compr.c +@@ -24,7 +24,6 @@ + #include + #include + #include +-#include + #include + + #define crc32 __zlib_crc32 +@@ -35,7 +34,6 @@ + #include "ubifs-media.h" + #include "mkfs.ubifs.h" + +-static void *lzo_mem; + static unsigned long long errcnt = 0; + static struct ubifs_info *c = &info_; + +@@ -86,6 +84,25 @@ static int zlib_deflate(void *in_buf, si + return 0; + } + ++#ifndef WITHOUT_LZO ++#include ++ ++static void *lzo_mem; ++ ++static int lzo_init(void) ++{ ++ lzo_mem = malloc(LZO1X_999_MEM_COMPRESS); ++ if (!lzo_mem) ++ return -1; ++ ++ return 0; ++} ++ ++static void lzo_fini(void) ++{ ++ free(lzo_mem); ++} ++ + static int lzo_compress(void *in_buf, size_t in_len, void *out_buf, + size_t *out_len) + { +@@ -103,6 +120,12 @@ static int lzo_compress(void *in_buf, si + + return 0; + } ++#else ++static inline int lzo_compress(void *in_buf, size_t in_len, void *out_buf, ++ size_t *out_len) { return -1; } ++static inline int lzo_init(void) { return 0; } ++static inline void lzo_fini(void) { } ++#endif + + static int no_compress(void *in_buf, size_t in_len, void *out_buf, + size_t *out_len) +@@ -123,7 +146,6 @@ static int favor_lzo_compress(void *in_b + lzo_len = zlib_len = *out_len; + lzo_ret = lzo_compress(in_buf, in_len, out_buf, &lzo_len); + zlib_ret = zlib_deflate(in_buf, in_len, zlib_buf, &zlib_len); +- + if (lzo_ret && zlib_ret) + /* Both compressors failed */ + return -1; +@@ -198,23 +220,28 @@ int compress_data(void *in_buf, size_t i + + int init_compression(void) + { +- lzo_mem = malloc(LZO1X_999_MEM_COMPRESS); +- if (!lzo_mem) +- return -1; ++ int ret; ++ ++ ret = lzo_init(); ++ if (ret) ++ goto err; + + zlib_buf = malloc(UBIFS_BLOCK_SIZE * WORST_COMPR_FACTOR); +- if (!zlib_buf) { +- free(lzo_mem); +- return -1; +- } ++ if (!zlib_buf) ++ goto err_lzo; + + return 0; ++ ++err_lzo: ++ lzo_fini(); ++err: ++ return ret; + } + + void destroy_compression(void) + { + free(zlib_buf); +- free(lzo_mem); ++ lzo_fini(); + if (errcnt) + fprintf(stderr, "%llu compression errors occurred\n", errcnt); + } +--- a/mkfs.ubifs/Makefile ++++ b/mkfs.ubifs/Makefile +@@ -6,7 +6,13 @@ ALL_SOURCES=*.[ch] hashtable/*.[ch] + + TARGETS = mkfs.ubifs + +-LDLIBS_mkfs.ubifs = -lz -llzo2 -lm -luuid -L$(BUILDDIR)/../ubi-utils/ -lubi ++ifeq ($(WITHOUT_LZO), 1) ++ CPPFLAGS += -DWITHOUT_LZO ++else ++ LZOLDLIBS = -llzo2 ++endif ++ ++LDLIBS_mkfs.ubifs = -lz $(LZOLDLIBS) -lm -luuid -L$(BUILDDIR)/../ubi-utils/ -lubi + LDLIBS_mkfs.ubifs += -L$(BUILDDIR)/../lib -lmtd + LDLIBS_mkfs.ubifs += $(ZLIBLDFLAGS) $(LZOLDFLAGS) + diff --git a/utils/mtd-utils/patches/136-mkubifs-fix-rinoperm-options.patch b/utils/mtd-utils/patches/136-mkubifs-fix-rinoperm-options.patch new file mode 100644 index 0000000..dd7c74c --- /dev/null +++ b/utils/mtd-utils/patches/136-mkubifs-fix-rinoperm-options.patch @@ -0,0 +1,28 @@ +--- a/mkfs.ubifs/mkfs.ubifs.c ++++ b/mkfs.ubifs/mkfs.ubifs.c +@@ -109,7 +109,7 @@ static char *output; + static int out_fd; + static int out_ubi; + static int squash_owner; +-static int squash_rino_perm; ++static int squash_rino_perm = -1; + + /* The 'head' (position) which nodes are written */ + static int head_lnum; +@@ -683,6 +683,7 @@ static int get_options(int argc, char**a + printf("WARNING: --squash-rino-perm is depricated, do not use it\n"); + break; + case 'q': ++ squash_rino_perm = 0; + printf("WARNING: --nosquash-rino-perm is depricated, do not use it\n"); + break; + } +@@ -1686,7 +1687,7 @@ static int write_data(void) + if (err) + return sys_err_msg("bad root file-system directory '%s'", + root); +- if (squash_rino_perm) { ++ if (squash_rino_perm > 0) { + root_st.st_uid = root_st.st_gid = 0; + root_st.st_mode = mode; + } diff --git a/utils/mtd-utils/patches/137-mkubifs-allow-to-overwrite-volume-data.patch b/utils/mtd-utils/patches/137-mkubifs-allow-to-overwrite-volume-data.patch new file mode 100644 index 0000000..33f6f30 --- /dev/null +++ b/utils/mtd-utils/patches/137-mkubifs-allow-to-overwrite-volume-data.patch @@ -0,0 +1,61 @@ +--- a/mkfs.ubifs/mkfs.ubifs.c ++++ b/mkfs.ubifs/mkfs.ubifs.c +@@ -110,6 +110,7 @@ static int out_fd; + static int out_ubi; + static int squash_owner; + static int squash_rino_perm = -1; ++static int overwrite_volume; + + /* The 'head' (position) which nodes are written */ + static int head_lnum; +@@ -132,7 +133,7 @@ static struct inum_mapping **hash_table; + /* Inode creation sequence number */ + static unsigned long long creat_sqnum; + +-static const char *optstring = "d:r:m:o:D:h?vVe:c:g:f:Fp:k:x:X:j:R:l:j:UQq"; ++static const char *optstring = "d:r:m:o:OD:h?vVe:c:g:f:Fp:k:x:X:j:R:l:j:UQq"; + + static const struct option longopts[] = { + {"root", 1, NULL, 'r'}, +@@ -140,6 +141,7 @@ static const struct option longopts[] = + {"leb-size", 1, NULL, 'e'}, + {"max-leb-cnt", 1, NULL, 'c'}, + {"output", 1, NULL, 'o'}, ++ {"overwrite", 0, NULL, 'O'}, + {"devtable", 1, NULL, 'D'}, + {"help", 0, NULL, 'h'}, + {"verbose", 0, NULL, 'v'}, +@@ -176,6 +178,7 @@ static const char *helptext = + "-e, --leb-size=SIZE logical erase block size\n" + "-c, --max-leb-cnt=COUNT maximum logical erase block count\n" + "-o, --output=FILE output to FILE\n" ++"-O, --overwrite force overwriting of the existing volume\n" + "-j, --jrn-size=SIZE journal size\n" + "-R, --reserved=SIZE how much space should be reserved for the super-user\n" + "-x, --compr=TYPE compression type - \"lzo\", \"favor_lzo\", \"zlib\" or\n" +@@ -594,6 +597,9 @@ static int get_options(int argc, char**a + case 'o': + output = strdup(optarg); + break; ++ case 'O': ++ overwrite_volume = 1; ++ break; + case 'D': + tbl_file = optarg; + if (stat(tbl_file, &st) < 0) +@@ -2180,8 +2186,13 @@ static int open_target(void) + if (ubi_set_property(out_fd, UBI_PROP_DIRECT_WRITE, 1)) + return sys_err_msg("ubi_set_property failed"); + +- if (check_volume_empty()) +- return err_msg("UBI volume is not empty"); ++ if (check_volume_empty()) { ++ if (overwrite_volume) ++ if (verbose) ++ printf("Warning: overwriting existing data\n"); ++ else ++ return err_msg("UBI volume is not empty"); ++ } + } else { + out_fd = open(output, O_CREAT | O_RDWR | O_TRUNC, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); diff --git a/utils/mtd-utils/patches/150-fix_ubi-utils_static.patch b/utils/mtd-utils/patches/150-fix_ubi-utils_static.patch new file mode 100644 index 0000000..1413a98 --- /dev/null +++ b/utils/mtd-utils/patches/150-fix_ubi-utils_static.patch @@ -0,0 +1,32 @@ +--- a/ubi-utils/Makefile ++++ b/ubi-utils/Makefile +@@ -22,7 +22,7 @@ $(TARGETS): $(addprefix $(BUILDDIR)/,\ + # $(CC) $(CFLAGS) $(filter %.o, $^) -L. -lubi -o $@ + + $(BUILDDIR)/ubicrc32: $(addprefix $(BUILDDIR)/,\ +- ubicrc32.o) ++ ../lib/libcrc32.o ubicrc32.o) + # $(CC) $(CFLAGS) -o $@ $^ + + $(BUILDDIR)/ubinize: $(addprefix $(BUILDDIR)/,\ +@@ -30,16 +30,17 @@ $(BUILDDIR)/ubinize: $(addprefix $(BUILD + # $(CC) $(CFLAGS) $(filter %.o, $^) -L. -liniparser -lubigen -o $@ + + $(BUILDDIR)/mtdinfo: $(addprefix $(BUILDDIR)/,\ +- libubigen.a ubiutils-common.o) ++ ../lib/libmtd.o ../lib/libmtd_legacy.o libubigen.a ubiutils-common.o) + # $(CC) $(CFLAGS) $(filter %.o, $^) -L. -lmtd -lubigen -o $@ + + $(BUILDDIR)/ubiformat: $(addprefix $(BUILDDIR)/,\ +- ubiformat.o ubiutils-common.o libscan.a libubi.a libubigen.a) ++ ../lib/libmtd.o ../lib/libmtd_legacy.o ubiformat.o ubiutils-common.o libscan.a libubi.a libubigen.a) + # $(CC) $(CFLAGS) $(filter %.o, $^) -L. -lmtd -lscan -lubi -lubigen -o $@ + + $(BUILDDIR)/libubi.a: $(BUILDDIR)/libubi.o + +-$(BUILDDIR)/libubigen.a: $(BUILDDIR)/libubigen.o ++$(BUILDDIR)/libubigen.a: $(addprefix $(BUILDDIR)/,\ ++ ../lib/libcrc32.o libubigen.o) + + $(BUILDDIR)/libiniparser.a: $(addprefix $(BUILDDIR)/,\ + libiniparser.o dictionary.o) diff --git a/utils/nano/Makefile b/utils/nano/Makefile new file mode 100644 index 0000000..cff2bc7 --- /dev/null +++ b/utils/nano/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=nano +PKG_VERSION:=2.2.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.nano-editor.org/dist/v2.2 +PKG_MD5SUM:=03233ae480689a008eb98feb1b599807 + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/nano + SUBMENU:=Editors + SECTION:=utils + CATEGORY:=Utilities + TITLE:=An enhanced clone of the Pico text editor + URL:=http://www.nano-editor.org/ + MAINTAINER:=Bernhard Loos + DEPENDS:=+libncurses +endef + +define Package/nano/description + GNU nano (Nano's ANOther editor, or Not ANOther editor) is an enhanced clone + of the Pico text editor. +endef + +CONFIGURE_ARGS += \ + --enable-tiny \ + --disable-glibtest \ + --disable-utf8 \ + --without-slang \ + +CONFIGURE_VARS += \ + ac_cv_header_regex_h=no \ + +define Package/nano/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,nano)) diff --git a/utils/ntfs-3g/Makefile b/utils/ntfs-3g/Makefile new file mode 100644 index 0000000..4650344 --- /dev/null +++ b/utils/ntfs-3g/Makefile @@ -0,0 +1,235 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ntfs-3g +PKG_RELEASE:=1 + +# 2011.4.12 integrates ntfsprogs and changed srcfile name +PKG_VERSION:=2011.4.12 +# disable next line and do _not_ select ntfsprogs_ntfs-3g to build an older version +PKG_SOURCE:=$(PKG_NAME)_ntfsprogs-$(PKG_VERSION).tgz + +## 2010.3.6 needs a recent uclibc 0.9.30.2 or greater +## this has been fixed in 2010.5.16, keeping this in case this happens again +#PKG_UCLIBC_VERSION:=$(call qstrip,$(CONFIG_UCLIBC_VERSION)) +#ifneq (,$(or $(findstring !0.9.29,!$(PKG_UCLIBC_VERSION)),$(findstring !0.9.30.1!,!$(PKG_UCLIBC_VERSION)!) )) +# PKG_VERSION:=2010.1.16 +#endif + +PATCH_DIR:=./patches-$(PKG_VERSION) + +PKG_SOURCE?=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://www.tuxera.com/opensource/ + +PKG_MD5SUM_2010.1.16:=e104c914e8d7d29ee83e63d46afbba25 +PKG_MD5SUM_2010.3.6:=12ce21aa044c6068a4df6e8cbd3c5cfa +PKG_MD5SUM_2010.5.16:=aeff7659a4943c9223d79116f051a863 +PKG_MD5SUM_2010.5.22:=caa08c73220a7106c76f697b7a7915ec +PKG_MD5SUM_2010.8.8:=6c109746c2708f679725a2ea441c61c6 +PKG_MD5SUM_2010.10.2:=91405690f25822142cdcb43d03e62d3f +PKG_MD5SUM_2011.1.15:=15a5cf5752012269fa168c24191f00e2 +PKG_MD5SUM_2011.4.12:=9c4ce318373b15332239a77a9d2a39fe +PKG_MD5SUM:=$(PKG_MD5SUM_$(PKG_VERSION)) + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +# release contains fuseext/int hint +PKG_RELEASE:=$(PKG_RELEASE)$(if $(CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE),-fuseext,-fuseint) + +# define build dir, respect fuseext/int +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE) + +include $(INCLUDE_DIR)/package.mk + +define Package/ntfs-3g/common + SECTION:=utils + CATEGORY:=Utilities + URL:=http://www.tuxera.com + SUBMENU:=Filesystem + TITLE:=Stable Read/Write NTFS Driver + MAINTAINER:=Bud +endef + +define Package/ntfs-3g + $(call Package/ntfs-3g/common) + DEPENDS+= +kmod-fuse +PACKAGE_NTFS-3G_USE_LIBFUSE:libfuse +libpthread +endef + +define Package/ntfs-3g/description + Ntfs-3g is a NTFS driver, which can create, remove, rename, + move files, directories, hard links, and streams. It can read + and write files, including streams and sparse files. It can + handle special files like symbolic links, devices, and FIFOs. + Moreover it can also read transparently compressed files. + + Contains: + - ntfs-3g + - ntfs-3g.probe + - mount.ntfs-3g (symlink to ntfs-3g) + +endef + +define Package/ntfs-3g/config +config PACKAGE_NTFS-3G_USE_LIBFUSE + bool "use external FUSE library, selects package libfuse" + depends on PACKAGE_ntfs-3g + ---help--- + Ntfs-3g by default uses a minimalized lite version of FUSE. + If libfuse is part of your filesystem anyway (because of sshfs, owfs + etc.) it makes sense to activate this option and save some kilobytes + of space. + +endef + +define Package/ntfs-3g-low + $(call Package/ntfs-3g/common) + TITLE:=lowntfs-3g (alternative using the fuse low-level interface) + DEPENDS+= +ntfs-3g +endef + +define Package/ntfs-3g-low/description + Contains: + - lowntfs-3g + - mount.lowntfs-3g (symlink to lowntfs-3g) + + A driver variant using the fuse low-level interface missing some of the + enhanced functionality for streams or the like. You might want to check: + http://www.tuxera.com/community/ntfs-3g-manual/ + +endef + +define Package/ntfs-3g-utils + $(call Package/ntfs-3g/common) + TITLE:=ntfs-3g utilities (ntfs-3g.secaudit, ntfs-3g.usermap) + DEPENDS+= +ntfs-3g +endef + +define Package/ntfs-3g-utils/description + Additional ntfs-3g utilities. Not included by default for size + considerations. All binaries except ntfs-3g, ntfs-3g.probe. + + Currently: + - ntfs-3g.secaudit + - ntfs-3g.usermap + +endef + +# TODO: write a proper description +# new in 2001.4.12 +define Package/ntfsprogs_ntfs-3g + $(call Package/ntfs-3g/common) + TITLE:=ntfsprogs (ntfs-3g) + DEPENDS+= +ntfs-3g +libgcrypt +endef + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static + +# configure/make according selection +ifdef CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE + CONFIGURE_ARGS += --with-fuse=external + TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include/fuse $(TARGET_CPPFLAGS) +else + CONFIGURE_ARGS += --with-fuse=internal + TARGET_CPPFLAGS:=-I../include/fuse-lite $(TARGET_CPPFLAGS) +endif + +# enable disable ntfsprogs +ifneq ($(CONFIG_PACKAGE_ntfsprogs_ntfs-3g)$(SDK)$(DEVELOPER),) + CONFIGURE_ARGS += --enable-ntfsprogs +else + CONFIGURE_ARGS += --disable-ntfsprogs +endif + +# redefine prepare to extract to our build dir +# apply patches +define Build/Prepare + rm -rf $(PKG_BUILD_DIR)/ + mkdir -p $(PKG_BUILD_DIR)/ + $(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1 + $(Build/Patch) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/ntfs-3g $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.{la,a,so*} $(1)/usr/lib/ +endef + +define Package/ntfs-3g/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g{,.probe} $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/sbin + $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/ +endef + +define Package/ntfs-3g/postinst +#!/bin/sh +FILE="$${IPKG_INSTROOT}/etc/filesystems" +ID="ntfs-3g" + +if ! [ -f '/etc/filesystems' ]; then + echo "Create '$$FILE'." + touch "$$FILE" +fi + +if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then + echo "Add '$$ID' to known filesystems." + echo "$$ID" >> "$$FILE" +fi + +endef + +define Package/ntfs-3g-low/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lowntfs-3g $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/sbin + $(CP) $(PKG_INSTALL_DIR)/sbin/mount.lowntfs-3g $(1)/sbin/ +endef + +define Package/ntfs-3g-low/postinst +#!/bin/sh +FILE="$${IPKG_INSTROOT}/etc/filesystems" +ID="lowntfs-3g" + +if ! [ -f '/etc/filesystems' ]; then + echo "Create '$$FILE'." + touch "$$FILE" +fi + +if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then + echo "Add '$$ID' to known filesystems." + echo "$$ID" >> "$$FILE" +fi + +endef + +define Package/ntfs-3g-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -name ntfs-3g.probe ! -name ntfs-3g -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \; +endef + +define Package/ntfsprogs_ntfs-3g/install + $(INSTALL_DIR) $(1)/sbin + $(CP) $(PKG_INSTALL_DIR)/sbin/mkfs.ntfs $(1)/sbin/ + $(INSTALL_DIR) $(1)/usr/bin + $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -regex '.*[^/]*ntfs-3g[^/]*' -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \; + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,ntfs-3g)) +$(eval $(call BuildPackage,ntfs-3g-low)) +$(eval $(call BuildPackage,ntfs-3g-utils)) +$(eval $(call BuildPackage,ntfsprogs_ntfs-3g)) diff --git a/utils/ntfs-3g/patches-2011.4.12/001-options.patch b/utils/ntfs-3g/patches-2011.4.12/001-options.patch new file mode 100644 index 0000000..e0d7ac8 --- /dev/null +++ b/utils/ntfs-3g/patches-2011.4.12/001-options.patch @@ -0,0 +1,20 @@ +--- a/src/ntfs-3g_common.c.ref 2011-04-23 08:25:28.000000000 +0200 ++++ b/src/ntfs-3g_common.c 2011-04-23 08:32:16.000000000 +0200 +@@ -58,8 +58,6 @@ + + static const char nf_ns_alt_xattr_efsinfo[] = "user.ntfs.efsinfo"; + +-#ifdef HAVE_SETXATTR +- + static const char def_opts[] = "allow_other,nonempty,"; + + /* +@@ -573,6 +571,8 @@ + return 0; + } + ++#ifdef HAVE_SETXATTR ++ + int ntfs_fuse_listxattr_common(ntfs_inode *ni, ntfs_attr_search_ctx *actx, + char *list, size_t size, BOOL prefixing) + { diff --git a/utils/ntfsprogs/Makefile b/utils/ntfsprogs/Makefile new file mode 100644 index 0000000..78ae9f6 --- /dev/null +++ b/utils/ntfsprogs/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2010-2011 OpenWrt.org +# Copyright (C) 2010 Gianluigi Tiesi +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ntfsprogs +PKG_VERSION:=2.0.0 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/linux-ntfs +PKG_MD5SUM:=2c402b647bb7aeb1d3f8ce1cc354fd68 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_DEPENDS:=libgcrypt + +include $(INCLUDE_DIR)/package.mk + +define Package/ntfsprogs + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Filesystem + TITLE:=Linux-NTFS + URL:=http://www.linux-ntfs.org/ + MAINTAINER:=Gianluigi Tiesi +endef + +define Package/ntfsprogs/description + Tools for managing NTFS volumes from Linux +endef + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-crypto \ + --disable-gnome-vfs \ + --disable-ntfsmount + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/ntfs $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs.{la,a,so*} $(1)/usr/lib/ +endef + +define Package/ntfsprogs/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs.so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/ntfsfix $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,ntfsprogs)) diff --git a/utils/ntfsprogs/patches/001-autoconf_fixes.patch b/utils/ntfsprogs/patches/001-autoconf_fixes.patch new file mode 100644 index 0000000..0055159 --- /dev/null +++ b/utils/ntfsprogs/patches/001-autoconf_fixes.patch @@ -0,0 +1,52 @@ +--- a/libntfs/Makefile.am ++++ b/libntfs/Makefile.am +@@ -38,8 +38,8 @@ libntfs_la_CFLAGS = $(LIBNTFS_CFLAGS) \ + -DLTVERSION_LIBNTFS=\"$(LTVERSION_LIBNTFS)\" + + if ENABLE_CRYPTO +-libntfs_la_LDFLAGS += `libgnutls-config --libs` `pkg-config --libs libconfig` +-libntfs_la_CFLAGS += `libgnutls-config --cflags` `pkg-config --cflags libconfig` ++libntfs_la_LDFLAGS += $(GNUTLS_LIBS) $(libconfig_LIBS) ++libntfs_la_CFLAGS += $(GNUTLS_CFLAGS) $(libconfig_CFLAGS) + endif + + libntfs_la_SOURCES = \ +--- a/libntfs/Makefile.in ++++ b/libntfs/Makefile.in +@@ -61,8 +61,8 @@ POST_UNINSTALL = : + build_triplet = @build@ + host_triplet = @host@ + target_triplet = @target@ +-@ENABLE_CRYPTO_TRUE@am__append_1 = `libgnutls-config --libs` `pkg-config --libs libconfig` +-@ENABLE_CRYPTO_TRUE@am__append_2 = `libgnutls-config --cflags` `pkg-config --cflags libconfig` ++@ENABLE_CRYPTO_TRUE@am__append_1 = $(GNUTLS_LIBS) $(libconfig_LIBS) ++@ENABLE_CRYPTO_TRUE@am__append_2 = $(GNUTLS_CFLAGS) $(libconfig_CFLAGS) + subdir = libntfs + DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/libntfs-gnomevfs.8.in $(srcdir)/libntfs.8.in \ +--- a/ntfsprogs/Makefile.am ++++ b/ntfsprogs/Makefile.am +@@ -125,8 +125,8 @@ ntfsdump_logfile_LDFLAGS= $(AM_LFLAGS) + if ENABLE_CRYPTO + ntfsdecrypt_SOURCES = ntfsdecrypt.c utils.c utils.h + ntfsdecrypt_LDADD = $(AM_LIBS) +-ntfsdecrypt_LDFLAGS = $(AM_LFLAGS) `libgnutls-config --libs` +-ntfsdecrypt_CFLAGS = `libgnutls-config --cflags` ++ntfsdecrypt_LDFLAGS = $(AM_LFLAGS) $(GNUTLS_LIBS) ++ntfsdecrypt_CFLAGS = $(GNUTLS_CFLAGS) + endif + + # Extra targets +--- a/ntfsprogs/Makefile.in ++++ b/ntfsprogs/Makefile.in +@@ -449,8 +449,8 @@ ntfsdump_logfile_LDADD = $(AM_LIBS) + ntfsdump_logfile_LDFLAGS = $(AM_LFLAGS) + @ENABLE_CRYPTO_TRUE@ntfsdecrypt_SOURCES = ntfsdecrypt.c utils.c utils.h + @ENABLE_CRYPTO_TRUE@ntfsdecrypt_LDADD = $(AM_LIBS) +-@ENABLE_CRYPTO_TRUE@ntfsdecrypt_LDFLAGS = $(AM_LFLAGS) `libgnutls-config --libs` +-@ENABLE_CRYPTO_TRUE@ntfsdecrypt_CFLAGS = `libgnutls-config --cflags` ++@ENABLE_CRYPTO_TRUE@ntfsdecrypt_LDFLAGS = $(AM_LFLAGS) $(GNUTLS_LIBS) ++@ENABLE_CRYPTO_TRUE@ntfsdecrypt_CFLAGS = $(GNUTLS_CFLAGS) + all: all-am + + .SUFFIXES: diff --git a/utils/nvramtool/Makefile b/utils/nvramtool/Makefile new file mode 100644 index 0000000..2818b1e --- /dev/null +++ b/utils/nvramtool/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=nvramtool +PKG_REV:=4887 +PKG_VERSION:=$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=svn +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_URL:=svn://coreboot.org/coreboot/trunk/util/nvramtool +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz + +include $(INCLUDE_DIR)/package.mk + +define Package/nvramtool + SECTION:=utils + CATEGORY:=Utilities + URL:=http://www.coreboot.org/Nvramtool + TITLE:=Coreboot nvramtool + DEPENDS:=@TARGET_x86 +@PACKAGE_pciutils +zlib +endef + +define Package/nvramtool/description +nvramtool (previously known as lxbios and cmos_util) is a utility for +reading/writing coreboot parameters and displaying information from the coreboot +table in CMOS/NVRAM. +The program is intended only for x86-based Linux systems that use coreboot, but +can also be used for non-coreboot systems (e.g. for dumping all NVRAM bytes). +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \ + LDFLAGS="-L$(STAGING_DIR)/usr/lib" \ + LIBS="-lpci -lz" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + nvramtool +endef + +define Package/nvramtool/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/nvramtool $(1)/sbin/nvramtool +endef + +$(eval $(call BuildPackage,nvramtool)) diff --git a/utils/open2300/Makefile b/utils/open2300/Makefile new file mode 100644 index 0000000..a874069 --- /dev/null +++ b/utils/open2300/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2010 segal.di.ubi.pt +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=open2300 +PKG_RELEASE:=1.11 +PKG_VERSION:=1.11 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.ccccoimbra.com/open2300/ +PKG_MD5SUM:=804576790840c3bc4a288f3e0f83ce4d + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + + +include $(INCLUDE_DIR)/package.mk + + +define Package/open2300 + SECTION:=utils + CATEGORY:=Utilities + TITLE:=WS23XX weather station utilities + URL:=http://www.lavrsen.dk/twiki/bin/view/Open2300/WebHome + MAINTAINER:=Nuno Goncalves +endef + +define Package/open2300/description + This is an utility suite used to communicate with and collect data from a WS23XX wheather station. +endef + +define Package/open2300/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/open2300 $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dump2300 $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/log2300 $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/fetch2300 $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/wu2300 $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/cw2300 $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/history2300 $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/histlog2300 $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin2300 $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/xml2300 $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/light2300 $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/interval2300 $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/minmax2300 $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/open2300-dist.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib2300.so.1.11 $(1)/usr/lib/ + ln -sf /usr/lib/lib2300.so.1.11 $(1)/usr/lib/lib2300.so +endef + +$(eval $(call BuildPackage,open2300)) diff --git a/utils/open2300/patches/x1.patch b/utils/open2300/patches/x1.patch new file mode 100644 index 0000000..86654f6 --- /dev/null +++ b/utils/open2300/patches/x1.patch @@ -0,0 +1,68 @@ +--- a/open2300.conf ++++ b/open2300.conf +@@ -0,0 +1,65 @@ ++# open2300.conf ++# ++# Configuration files for open2300 weather station tools ++# ++# Default locations in which the programs will search for this file: ++# Programs search in this sequence: ++# 1. Path to config file including filename given as parameter (not supported by all tools) ++# 2. ./open2300.conf (current working directory) ++# 3. /jffs/etc/open2300.conf (typical DD-WRT location) ++# 4. /etc/open2300.conf (typical Linux location) ++# ++# All names are case sensitive!!! ++ ++ ++# Set to your serial port and time zone ++# For Windows use COM1, COM2, COM2 etc ++# For Linux use /dev/ttyS0, /dev/ttyS1 etc ++ ++SERIAL_DEVICE /dev/tts/1 # /dev/ttyS0, /dev/ttyS1, COM1, COM2 etc ++TIMEZONE 1 # Hours Relative to UTC. East is positive, west is negative ++ ++ ++# Units of measure (set them to your preference) ++# The units of measure are ignored by wu2300 and cw2300 because both requires specific units ++ ++WIND_SPEED m/s # select MPH (miles/hour), m/s, or km/h ++TEMPERATURE C # Select C or F ++RAIN mm # Select mm or IN ++PRESSURE hPa # Select hPa, mb or INHG ++ ++ ++#### Citizens Weather variables (used only by cw2300) ++# Format for latitude is ++# [2 digit degrees][2 digit minutes].[2 decimals minutes - NOT seconds][N for north or S for south] ++# Format for longitude is ++# [3 digit degrees][2 digit minutes].[2 decimals minutes - NOT seconds][E for east or W for west] ++# Use leading zeros to get the format ####.##N (lat) and #####.##E (long) ++ ++CITIZEN_WEATHER_ID CW0000 # CW0000 should be replaced by HAM call or actual CW number ++CITIZEN_WEATHER_LATITUDE 5540.12N # DDMM.mmN or S - example 55 deg, 40.23 minutes north ++CITIZEN_WEATHER_LONGITUDE 01224.60E # DDDMM.mmE or W - example 12 deg, 24.60 minutes east ++ ++APRS_SERVER rotate.aprs.net 14580 # These are the APRS servers and ports for ++APRS_SERVER first.aprs.net 14580 # Citizens Weather reporting. ++APRS_SERVER second.aprs.net 14580 # They they are tried in the entered order ++APRS_SERVER third.aprs.net 14580 # you may enter up to 5 alternate servers ++ ++ ++#### WEATHER UNDERGROUND variables (used only by wu2300) ++ ++WEATHER_UNDERGROUND_ID WUID # ID received from Weather Underground ++WEATHER_UNDERGROUND_PASSWORD WUPASSWORD # Password for Weather Underground ++ ++ ++### MYSQL Settings (only used by mysql2300) ++ ++#MYSQL_HOST localhost # Localhost or IP address/host name ++#MYSQL_USERNAME open2300 # Name of the MySQL user that has access to the database ++#MYSQL_PASSWORD mysql2300 # Password for the MySQL user ++#MYSQL_DATABASE open2300 # Named of your database ++#MYSQL_PORT 0 # TCP/IP Port number. Zero means default ++ ++#PGSQL_CONNECT hostaddr='127.0.0.1'dbname='open2300'user='postgres'password='sql' # Connection string ++#PGSQL_TABLE weather # Table name ++#PGSQL_STATION open2300 # Unique station id diff --git a/utils/open2300/patches/x2.patch b/utils/open2300/patches/x2.patch new file mode 100644 index 0000000..7e43e6f --- /dev/null +++ b/utils/open2300/patches/x2.patch @@ -0,0 +1,168 @@ +--- a/Makefile ++++ b/Makefile +@@ -15,91 +15,91 @@ + prefix = /usr/local + exec_prefix = ${prefix} + bindir = ${exec_prefix}/bin ++libdir = ${prefix}/lib + + ######################################### + + CC = gcc +-OBJ = open2300.o rw2300.o linux2300.o win2300.o +-LOGOBJ = log2300.o rw2300.o linux2300.o win2300.o +-FETCHOBJ = fetch2300.o rw2300.o linux2300.o win2300.o +-WUOBJ = wu2300.o rw2300.o linux2300.o win2300.o +-CWOBJ = cw2300.o rw2300.o linux2300.o win2300.o +-DUMPOBJ = dump2300.o rw2300.o linux2300.o win2300.o +-HISTOBJ = history2300.o rw2300.o linux2300.o win2300.o +-HISTLOGOBJ = histlog2300.o rw2300.o linux2300.o win2300.o +-DUMPBINOBJ = bin2300.o rw2300.o linux2300.o win2300.o +-XMLOBJ = xml2300.o rw2300.o linux2300.o win2300.o +-PGSQLOBJ = pgsql2300.o rw2300.o linux2300.o win2300.o +-LIGHTOBJ = light2300.o rw2300.o linux2300.o win2300.o +-INTERVALOBJ = interval2300.o rw2300.o linux2300.o win2300.o +-MINMAXOBJ = minmax2300.o rw2300.o linux2300.o win2300.o +-MYSQLHISTLOGOBJ = mysqlhistlog2300.o rw2300.o linux2300.o win2300.o ++LIB = lib2300 ++LIB_C = rw2300.c linux2300.c ++LIBOBJ = rw2300.o linux2300.o + + VERSION = 1.11 + + CFLAGS = -Wall -O3 -DVERSION=\"$(VERSION)\" +-CC_LDFLAGS = -lm +-CC_WINFLAG = +-# For Windows - comment the two line above and un-comment the two lines below. +-#CC_LDFLAGS = -lm -lwsock32 +-#CC_WINFLAG = -mwindows ++CC_LDFLAGS = -L. -lm -l2300 ++LFLAGS = -shared -Wl,-soname + INSTALL = install ++MAKE_EXEC = $(CC) $(CFLAGS) $@.c -o $@ $(CC_LDFLAGS) + + ####### Build rules + +-all: open2300 dump2300 log2300 fetch2300 wu2300 cw2300 history2300 histlog2300 bin2300 xml2300 light2300 interval2300 minmax2300 mysql2300 mysqlhistlog2300 ++all: open2300 dump2300 log2300 fetch2300 wu2300 cw2300 history2300 histlog2300 bin2300 xml2300 light2300 interval2300 minmax2300 ++#mysql2300 mysqlhistlog2300 + +-open2300 : $(OBJ) +- $(CC) $(CFLAGS) -o $@ $(OBJ) $(CC_LDFLAGS) +- +-dump2300 : $(DUMPOBJ) +- $(CC) $(CFLAGS) -o $@ $(DUMPOBJ) $(CC_LDFLAGS) ++lib2300 : ++ $(CC) -c -fPIC $(CFLAGS) $(LIB_C) ++ $(CC) $(LFLAGS),$@.so -o $@.so.$(VERSION) $(LIBOBJ) ++ ln -sf $@.so.$(VERSION) $@.so ++ ++open2300 : $(LIB) ++ $(MAKE_EXEC) + +-log2300 : $(LOGOBJ) +- $(CC) $(CFLAGS) -o $@ $(LOGOBJ) $(CC_LDFLAGS) $(CC_WINFLAG) ++dump2300 : $(LIB) ++ $(MAKE_EXEC) + +-fetch2300 : $(FETCHOBJ) +- $(CC) $(CFLAGS) -o $@ $(FETCHOBJ) $(CC_LDFLAGS) ++log2300 : $(LIB) ++ $(MAKE_EXEC) + +-wu2300 : $(WUOBJ) +- $(CC) $(CFLAGS) -o $@ $(WUOBJ) $(CC_LDFLAGS) $(CC_WINFLAG) ++fetch2300 : $(LIB) ++ $(MAKE_EXEC) ++ ++srv2300 : $(LIB) ++ $(MAKE_EXEC) ++ ++wu2300 : $(LIB) ++ $(MAKE_EXEC) + +-cw2300 : $(CWOBJ) +- $(CC) $(CFLAGS) -o $@ $(CWOBJ) $(CC_LDFLAGS) $(CC_WINFLAG) ++cw2300 : $(LIB) ++ $(MAKE_EXEC) + +-history2300 : $(HISTOBJ) +- $(CC) $(CFLAGS) -o $@ $(HISTOBJ) $(CC_LDFLAGS) ++history2300 : $(LIB) ++ $(MAKE_EXEC) + +-histlog2300 : $(HISTLOGOBJ) +- $(CC) $(CFLAGS) -o $@ $(HISTLOGOBJ) $(CC_LDFLAGS) $(CC_WINFLAG) ++histlog2300 : $(LIB) ++ $(MAKE_EXEC) + +-bin2300 : $(DUMPBINOBJ) +- $(CC) $(CFLAGS) -o $@ $(DUMPBINOBJ) $(CC_LDFLAGS) ++bin2300 : $(LIB) ++ $(MAKE_EXEC) + +-xml2300 : $(XMLOBJ) +- $(CC) $(CFLAGS) -o $@ $(XMLOBJ) $(CC_LDFLAGS) $(CC_WINFLAG) ++xml2300 : $(LIB) ++ $(MAKE_EXEC) + +-mysql2300: +- $(CC) $(CFLAGS) -o mysql2300 mysql2300.c rw2300.c linux2300.c $(CC_LDFLAGS) $(CC_WINFLAG) -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient ++mysql2300: $(LIB) ++ $(CC) $(CFLAGS) $@.c -o $@ -I/usr/include/mysql -L/usr/lib/mysql $(CC_LDFLAGS) -lmysqlclient + +-pgsql2300: $(PGSQLOBJ) +- $(CC) $(CFLAGS) -o $@ $(PGSQLOBJ) $(CC_LDFLAGS) $(CC_WINFLAG) -I/usr/include/pgsql -L/usr/lib/pgsql -lpq ++pgsql2300: $(LIB) ++ $(CC) $(CFLAGS) $@.c -o $@ -I/usr/include/pgsql -L/usr/lib/pgsql $(CC_LDFLAGS) -lpq + +-light2300: $(LIGHTOBJ) +- $(CC) $(CFLAGS) -o $@ $(LIGHTOBJ) $(CC_LDFLAGS) ++light2300: $(LIB) ++ $(MAKE_EXEC) + +-interval2300: $(INTERVALOBJ) +- $(CC) $(CFLAGS) -o $@ $(INTERVALOBJ) $(CC_LDFLAGS) ++interval2300: $(LIB) ++ $(MAKE_EXEC) + +-minmax2300: $(MINMAXOBJ) +- $(CC) $(CFLAGS) -o $@ $(MINMAXOBJ) $(CC_LDFLAGS) $(CC_WINFLAG) ++minmax2300: $(LIB) ++ $(MAKE_EXEC) + +-mysqlhistlog2300 : +- $(CC) $(CFLAGS) -o mysqlhistlog2300 mysqlhistlog2300.c rw2300.c linux2300.c $(CC_LDFLAGS) $(CC_WINFLAG) -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient ++mysqlhistlog2300 : $(LIB) ++ $(CC) $(CFLAGS) $@.c -o $@ -I/usr/include/mysql -L/usr/lib/mysql $(CC_LDFLAGS) -lmysqlclient + + + install: + mkdir -p $(bindir) ++ mkdir -p $(libdir) ++ $(INSTALL) $(LIB).so.$(VERSION) $(libdir) ++ ln -sf $(libdir)/$(LIB).so.$(VERSION) $(libdir)/$(LIB).so ++ $(INSTALL) srv2300 $(bindir) + $(INSTALL) open2300 $(bindir) + $(INSTALL) dump2300 $(bindir) + $(INSTALL) log2300 $(bindir) +@@ -111,14 +111,11 @@ + $(INSTALL) light2300 $(bindir) + $(INSTALL) interval2300 $(bindir) + $(INSTALL) minmax2300 $(bindir) +- $(INSTALL) mysql2300 $(bindir) +- $(INSTALL) mysqlhistlog2300 $(bindir) ++# $(INSTALL) mysql2300 $(bindir) ++# $(INSTALL) mysqlhistlog2300 $(bindir) + + uninstall: +- rm -f $(bindir)/open2300 $(bindir)/dump2300 $(bindir)/log2300 $(bindir)/fetch2300 $(bindir)/wu2300 $(bindir)/cw2300 $(bindir)/xml2300 $(bindir)/light2300 $(bindir)/interval2300 $(bindir)/minmax2300 $(bindir)/mysql2300 $(bindir)/mysqlhistlog2300 ++ rm -f $(libdir)/$(LIB).* $(bindir)/open2300 $(bindir)/dump2300 $(bindir)/log2300 $(bindir)/fetch2300 $(bindir)/srv2300 $(bindir)/wu2300 $(bindir)/cw2300 $(bindir)/xml2300 $(bindir)/light2300 $(bindir)/interval2300 $(bindir)/minmax2300 $(bindir)/histlog2300 $(bindir)/mysql2300 $(bindir)/mysqlhistlog2300 + + clean: +- rm -f *~ *.o open2300 dump2300 log2300 fetch2300 wu2300 cw2300 history2300 histlog2300 bin2300 xml2300 mysql2300 pgsql2300 light2300 interval2300 minmax2300 mysql2300 mysqlhistlog2300 +- +-cleanexe: +- rm -f *~ *.o open2300.exe dump2300.exe log2300.exe fetch2300.exe wu2300.exe cw2300.exe history2300.exe histlog2300.exe bin2300.exe xml2300.exe mysql2300.exe pgsql2300.exe light2300.exe interval2300.exe minmax2300.exe +\ No newline at end of file ++ rm -f *~ *.o *.so* open2300 dump2300 log2300 fetch2300 wu2300 cw2300 history2300 histlog2300 bin2300 xml2300 mysql2300 pgsql2300 light2300 interval2300 minmax2300 mysql2300 mysqlhistlog2300 diff --git a/utils/owfs/Makefile b/utils/owfs/Makefile new file mode 100644 index 0000000..7362a98 --- /dev/null +++ b/utils/owfs/Makefile @@ -0,0 +1,246 @@ +# +# Copyright (C) 2008-2011 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:=owfs +PKG_VERSION:=2.8p13 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=cc3e2542aed41c753bffca13f2a0a84e + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +# +# templates +# + +define Package/$(PKG_NAME)/Default + TITLE:=OWFS (1-Wire File System) + URL:=http://owfs.sourceforge.net/ + SECTION:=net + CATEGORY:=Network + SUBMENU:=Filesystem +endef + +define Package/$(PKG_NAME)/Default/description + OWFS is a suite of programs that designed to make the 1-wire bus and its + devices easily accessible. The underlying priciple is to create a virtual + filesystem, with the unique ID being the directory, and the individual + properties of the device are represented as simple files that can be read + and written. + + Details of the individual slave or master design are hidden behind a + consistent interface. The goal is to provide an easy set of tools for a + software designer to create monitoring or control applications. There are + some performance enhancements in the implementation, including data caching, + parallel access to bus masters, and aggregation of device communication. + Still the fundemental goal has been ease of use, flexibility and correctness + rather than speed. +endef + +define Package/owfs/Server + $(call Package/owfs/Default) + DEPENDS:=+libow +libpthread +endef + +define Package/owfs/Library + $(call Package/owfs/Default) + SECTION:=libs + CATEGORY:=Libraries +endef + +define Package/owfs/Utility + $(call Package/owfs/Default) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libow +endef + +# +# shared libraries +# + +define Package/libow + $(call Package/owfs/Library) + DEPENDS:=+libusb +libpthread + TITLE:=OWFS - common shared library +endef + +define Package/libow/description + $(call Package/$(PKG_NAME)/Default/description) + + This package contains the OWFS library. +endef + +define Package/libow-capi + $(call Package/owfs/Library) + DEPENDS:=+libow + TITLE:=OWFS - C-API library +endef + +define Package/libow-capi/description + $(call Package/$(PKG_NAME)/Default/description) + + This package contains the OWFS C-API library. +endef + +# +# utilities +# + +define Package/owshell + $(call Package/owfs/Utility) + TITLE:=OWFS - shell utilities + DEPENDS+= +USE_UCLIBC:librpc +endef + +define Package/owshell/description + $(call Package/$(PKG_NAME)/Default/description) + + This package contains the OWFS shell utilities. +endef + +define Package/owfs + $(call Package/owfs/Utility) + # libfuse depends on kmod-fuse, no need to declare dependency + DEPENDS+= +libfuse +fuse-utils + TITLE:=OWFS - fuse file system +endef + +define Package/owfs/description + $(call Package/$(PKG_NAME)/Default/description) + + This package contains the OWFS fuse filesystem. +endef + +# +# network daemons +# + +define Package/owhttpd + $(call Package/owfs/Server) + TITLE:=OWFS - http server +endef + +define Package/owhttpd/description + $(call Package/$(PKG_NAME)/Default/description) + + This package contains the OWFS http server. +endef + +define Package/owftpd + $(call Package/owfs/Server) + TITLE:=OWFS - ftp server +endef + +define Package/owftpd/description + $(call Package/$(PKG_NAME)/Default/description) + + This package contains the OWFS ftp server. +endef + +define Package/owserver + $(call Package/owfs/Server) + TITLE:=OWFS - network server +endef + +define Package/owserver/description + $(call Package/$(PKG_NAME)/Default/description) + + This package contains the OWFS network server. +endef + +CONFIGURE_ARGS += \ + --enable-owftpd \ + --enable-owserver \ + --enable-owhttpd \ + --enable-owfs \ + --with-fuseinclude="$(STAGING_DIR)/usr/include" \ + --with-fuselib="$(STAGING_DIR)/usr/lib" \ + --enable-shared \ + --enable-zero \ + --disable-parport \ + --disable-ownet \ + --disable-owpython \ + --disable-owphp \ + --disable-owtcl \ + --disable-swig \ + +CONFIGURE_VARS += \ + LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -Wl,-rpath-link=$(TOOLCHAIN_DIR)/usr/lib" \ + lt_cv_sys_lib_dlsearch_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \ + lt_cv_sys_lib_search_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \ + shrext_cmds=".so" \ + +MAKE_FLAGS += \ + CC="$(TARGET_CC)" \ + HOST_CPU="$(PKGARCH)" + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/ow{capi,fs_config}.h $(STAGING_DIR)/usr/include/ + $(INSTALL_DIR) $(STAGING_DIR)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libow{,capi}*.so* $(STAGING_DIR)/usr/lib/ +endef + +define Package/owfs/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owfs $(1)/usr/bin/ +endef + +define Package/owshell/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owget $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owread $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owwrite $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owdir $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owpresent $(1)/usr/bin/ +endef + + +define Package/owserver/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owserver $(1)/usr/bin/ +endef + +define Package/owhttpd/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owhttpd $(1)/usr/bin/ +endef + +define Package/owftpd/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owftpd $(1)/usr/bin/ +endef + + +define Package/libow/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libow-*.so.* $(1)/usr/lib/ +endef + +define Package/libow-capi/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libowcapi-*.so.* $(1)/usr/lib/ +endef + + +$(eval $(call BuildPackage,owfs)) +$(eval $(call BuildPackage,owshell)) + +$(eval $(call BuildPackage,owserver)) +$(eval $(call BuildPackage,owhttpd)) +$(eval $(call BuildPackage,owftpd)) + +$(eval $(call BuildPackage,libow)) +$(eval $(call BuildPackage,libow-capi)) diff --git a/utils/oww/Makefile b/utils/oww/Makefile new file mode 100644 index 0000000..1de2414 --- /dev/null +++ b/utils/oww/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2012 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:=oww +PKG_VERSION:=0.86.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/oww +PKG_MD5SUM:=8e51ffcd6008c9dc8a03a1a65f80092e + +PKG_BUILD_DEPENDS:=intltool/host +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/oww + SECTION:=utils + CATEGORY:=Utilities + TITLE:=One-wire weather + URL:=http://oww.sourceforge.net/ + DEPENDS:=+libcurl +libusb +endef + +define Package/oww/description + Oww is a software project, to communicate with the Dallas 1-wire weather + station and other 1-wire sensors, presenting live weather readings, logging + data to file, uploading data to weather Web sites, and sending data to other + programs through a command line interface. +endef + +CONFIGURE_ARGS += \ + --disable-gui + +define Package/oww/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/oww.init $(1)/etc/init.d/oww + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owwnogui $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,oww)) diff --git a/utils/oww/files/oww.init b/utils/oww/files/oww.init new file mode 100644 index 0000000..74684c6 --- /dev/null +++ b/utils/oww/files/oww.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common + +START=65 + +SERVICE_DAEMONIZE=1 + +start() { + service_start /usr/bin/owwnogui +} + +stop() { + service_stop /usr/bin/owwnogui +} diff --git a/utils/pciutils/Makefile b/utils/pciutils/Makefile new file mode 100644 index 0000000..f6af923 --- /dev/null +++ b/utils/pciutils/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (C) 2007-2012 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:=pciutils +PKG_VERSION:=3.1.10 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils +PKG_MD5SUM:=3a5d8b2784c8571dc5557efda4a8c157 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/pciutils + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Linux PCI Utilities + URL:=http://mj.ucw.cz/pciutils.shtml + DEPENDS:=+zlib +endef + +define Package/pciutils/description + contains collection of programs for inspecting and manipulating configuration + of PCI devices +endef + +define Package/pciutils/postinst +#!/bin/sh +[ -z "$${IPKG_INSTROOT}" ] || \ +(cd $${PKG_ROOT}/usr/share; $${PKG_ROOT}/usr/sbin/update-pciids; rm pci.ids.gz.old) +exit 0 +endef + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \ + PREFIX="/usr" \ + HOST="$(GNU_TARGET_NAME)" \ + ZLIB="yes" \ + +ifneq ($(CONFIG_USE_EGLIBC),) +TARGET_LDFLAGS += -lresolv +endif + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/lib/libpci.a $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/include/pci + $(CP) $(foreach i,pci.h config.h header.h types.h, \ + $(PKG_BUILD_DIR)/lib/$(i)) $(1)/usr/include/pci +endef + +define Package/pciutils/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{lspci,setpci,update-pciids} $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/share + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pci.ids.gz $(1)/usr/share/ +endef + +$(eval $(call BuildPackage,pciutils)) diff --git a/utils/pciutils/patches/100-remove-no-timestamping.patch b/utils/pciutils/patches/100-remove-no-timestamping.patch new file mode 100644 index 0000000..93bc85f --- /dev/null +++ b/utils/pciutils/patches/100-remove-no-timestamping.patch @@ -0,0 +1,11 @@ +--- a/update-pciids.sh ++++ b/update-pciids.sh +@@ -33,7 +33,7 @@ if which curl >/dev/null 2>&1 ; then + DL="curl -o $DEST.new $SRC" + ${quiet} && DL="$DL -s -S" + elif which wget >/dev/null 2>&1 ; then +- DL="wget --no-timestamping -O $DEST.new $SRC" ++ DL="wget -O $DEST.new $SRC" + ${quiet} && DL="$DL -q" + elif which lynx >/dev/null 2>&1 ; then + DL="eval lynx -source $SRC >$DEST.new" diff --git a/utils/pciutils/patches/101-no-strip.patch b/utils/pciutils/patches/101-no-strip.patch new file mode 100644 index 0000000..032118c --- /dev/null +++ b/utils/pciutils/patches/101-no-strip.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -101,7 +101,7 @@ distclean: clean + install: all + # -c is ignored on Linux, but required on FreeBSD + $(DIRINSTALL) -m 755 $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8 $(DESTDIR)$(MANDIR)/man7 +- $(INSTALL) -c -m 755 $(STRIP) lspci setpci $(DESTDIR)$(SBINDIR) ++ $(INSTALL) -c -m 755 lspci setpci $(DESTDIR)$(SBINDIR) + $(INSTALL) -c -m 755 update-pciids $(DESTDIR)$(SBINDIR) + $(INSTALL) -c -m 644 $(PCI_IDS) $(DESTDIR)$(IDSDIR) + $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(DESTDIR)$(MANDIR)/man8 diff --git a/utils/pciutils/patches/102-compressed-ids.patch b/utils/pciutils/patches/102-compressed-ids.patch new file mode 100644 index 0000000..9b31938 --- /dev/null +++ b/utils/pciutils/patches/102-compressed-ids.patch @@ -0,0 +1,31 @@ +--- a/update-pciids.sh ++++ b/update-pciids.sh +@@ -6,9 +6,8 @@ set -e + SRC="http://pci-ids.ucw.cz/v2.2/pci.ids" + DEST=pci.ids + PCI_COMPRESSED_IDS= +-GREP=grep + +-# if pci.ids is read-only (because the filesystem is read-only), ++# if pci.ids.gz is read-only (because the filesystem is read-only), + # then just skip this whole process. + if ! touch ${DEST} >/dev/null 2>&1 ; then + ${quiet} || echo "${DEST} is read-only, exiting." 1>&2 +@@ -18,7 +17,7 @@ fi + if [ "$PCI_COMPRESSED_IDS" = 1 ] ; then + DECOMP="cat" + SRC="$SRC.gz" +- GREP=zgrep ++ DEST="$DEST.gz" + elif which bzip2 >/dev/null 2>&1 ; then + DECOMP="bzip2 -d" + SRC="$SRC.bz2" +@@ -53,7 +52,7 @@ if ! $DECOMP <$DEST.new >$DEST.neww ; th + exit 1 + fi + +-if ! $GREP >/dev/null "^C " $DEST.neww ; then ++if ! zcat $DEST.neww | grep >/dev/null "^C " ; then + echo >&2 "update-pciids: missing class info, probably truncated file" + exit 1 + fi diff --git a/utils/pciutils/patches/103-relative-path-ids.patch b/utils/pciutils/patches/103-relative-path-ids.patch new file mode 100644 index 0000000..6ccea29 --- /dev/null +++ b/utils/pciutils/patches/103-relative-path-ids.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -78,7 +78,7 @@ setpci.o: setpci.c pciutils.h $(PCIINC) + common.o: common.c pciutils.h $(PCIINC) + + update-pciids: update-pciids.sh +- sed <$< >$@ "s@^DEST=.*@DEST=$(IDSDIR)/$(PCI_IDS)@;s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=$(PCI_COMPRESSED_IDS)@" ++ sed <$< >$@ "s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=$(PCI_COMPRESSED_IDS)@" + chmod +x $@ + + # The example of use of libpci diff --git a/utils/pciutils/patches/104-resolv.patch b/utils/pciutils/patches/104-resolv.patch new file mode 100644 index 0000000..dbd46aa --- /dev/null +++ b/utils/pciutils/patches/104-resolv.patch @@ -0,0 +1,11 @@ +--- a/lib/configure ++++ b/lib/configure +@@ -57,7 +57,7 @@ echo >>$c "#define PCI_OS_`echo $sys | t + echo >$m 'WITH_LIBS=' + + echo_n "Looking for access methods..." +-LIBRESOLV=-lresolv ++LIBRESOLV= + + case $sys in + linux*) diff --git a/utils/pcmciautils/Makefile b/utils/pcmciautils/Makefile new file mode 100644 index 0000000..992ba7b --- /dev/null +++ b/utils/pcmciautils/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2008-2011 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:=pcmciautils +PKG_VERSION:=018 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/pcmcia +PKG_MD5SUM:=5d85669b3440baa4532363da6caaf1b4 + +include $(INCLUDE_DIR)/package.mk + +define Package/pcmciautils + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libsysfs @PCMCIA_SUPPORT + TITLE:=PCMCIA Utilities + URL:=http://www.kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html +endef + +define Build/Compile + $(call Build/Compile/Default, \ + LD="$(TARGET_CC)" UDEV=false \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) \ + -DPCMCIAUTILS_VERSION=\\\"$(PKG_VERSION)\\\"" \ + prefix=/usr all \ + ) +endef + +define Package/pcmciautils/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(CP) $(PKG_BUILD_DIR)/pccardctl $(1)/usr/sbin/ + $(CP) $(PKG_BUILD_DIR)/pcmcia-check-broken-cis $(1)/usr/sbin/ + $(CP) $(PKG_BUILD_DIR)/pcmcia-socket-startup $(1)/usr/sbin/ + rm -f $(1)/usr/sbin/lspcmcia + ln -s pccardctl $(1)/usr/sbin/lspcmcia + $(INSTALL_DIR) $(1)/etc/pcmcia/ + $(CP) $(PKG_BUILD_DIR)/config/config.opts $(1)/etc/pcmcia/ + $(CP) files/* $(1)/ +endef + +define Package/pcmciautils/conffiles +/etc/pcmcia/config.opts +endef + +$(eval $(call BuildPackage,pcmciautils)) diff --git a/utils/pcmciautils/files/etc/hotplug.d/pcmcia/pcmcia.agent b/utils/pcmciautils/files/etc/hotplug.d/pcmcia/pcmcia.agent new file mode 100644 index 0000000..537c50a --- /dev/null +++ b/utils/pcmciautils/files/etc/hotplug.d/pcmcia/pcmcia.agent @@ -0,0 +1,28 @@ +#!/bin/sh +# Copyright (C) 2008 OpenWrt.org + +case "$ACTION" in + add) + SYSFS=/sys/bus/pcmcia/devices/ + DEVPATH=$SOCKET_NO.$((0x$DEVICE_NO)) + + # check whether the CIS is completely broken + if [ ! -h $SYSFS$DEVPATH/driver ]; then + CISFILE=$(/usr/sbin/pcmcia-check-broken-cis $SOCKET_NO) + echo PCMCIA: $CISFILE; + if [ ! -z $CISFILE ]; then + if [ -f /lib/firmware/$CISFILE ]; then + cat /lib/firmware/$CISFILE > $SYSFS/class/pcmcia_socket/pcmcia_socket$(SOCKET_NO)/cis + fi; + fi; + fi; + + # allow a match solely based on the "function ID" field + if [ ! -h $SYSFS$DEVPATH/driver ]; then + if [ -w $SYSFS$DEVPATH/allow_func_id_match ]; then + echo PCMCIA: allowing func_id based match for PCMCIA device $SOCKET_NO.$DEVICE_NO + echo -n "42" > $SYSFS$DEVPATH/allow_func_id_match; + fi; + fi; + ;; +esac diff --git a/utils/pcmciautils/files/etc/hotplug.d/pcmcia_socket/pcmcia_socket.agent b/utils/pcmciautils/files/etc/hotplug.d/pcmcia_socket/pcmcia_socket.agent new file mode 100644 index 0000000..79b3524 --- /dev/null +++ b/utils/pcmciautils/files/etc/hotplug.d/pcmcia_socket/pcmcia_socket.agent @@ -0,0 +1,18 @@ +#!/bin/sh +# Copyright (C) 2008 OpenWrt.org + +case "$ACTION" in + add) + echo PCMCIA: socket number: $SOCKET_NO + + sleep 1; + /usr/sbin/pcmcia-socket-startup $SOCKET_NO + DONE_FILE=/sys/class/pcmcia_socket/pcmcia_socket$SOCKET_NO/available_resources_setup_done + if [ -f $DONE_FILE ]; then + if [ -w $DONE_FILE ]; then + echo -n "42" > $DONE_FILE + fi; + fi; + ;; + +esac diff --git a/utils/pcmciautils/files/etc/init.d/pcmcia b/utils/pcmciautils/files/etc/init.d/pcmcia new file mode 100755 index 0000000..16f2276 --- /dev/null +++ b/utils/pcmciautils/files/etc/init.d/pcmcia @@ -0,0 +1,25 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008 OpenWrt.org + +START=42 +start() { + if [ -d /sys/bus/pcmcia/devices/ ]; then + # 2.6 kernels + cd /sys/bus/pcmcia/devices/ + for PCMCIA_DEVICE in *; do + if [ $PCMCIA_DEVICE == \* ]; then + continue; + fi; + MODALIAS=$(cat $PCMCIA_DEVICE/modalias) + echo PCMCIA: $MODALIAS $PCMCIA_DEVICE + if [ -z $MODALIAS ]; then + continue; + fi; + ACTION=add + SOCKET_NO=$(echo $PCMCIA_DEVICE | cut -d. -f1) + DEVICE_NO=$(echo $MODALIAS | sed 's/.*pfn\(..\).*/\1/') + export MODALIAS ACTION SOCKET_NO DEVICE_NO + /sbin/hotplug-call pcmcia + done; + fi; +} diff --git a/utils/pcmciautils/files/etc/init.d/pcmcia_socket b/utils/pcmciautils/files/etc/init.d/pcmcia_socket new file mode 100755 index 0000000..fdd0b8c --- /dev/null +++ b/utils/pcmciautils/files/etc/init.d/pcmcia_socket @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008 OpenWrt.org + +START=41 +start() { + if [ -d /sys/class/pcmcia_socket/ ]; then + # 2.6 kernels + cd /sys/class/pcmcia_socket/ + for PCMCIA_SOCKET in *; do + if [ $PCMCIA_SOCKET == \* ]; then + continue; + fi; + SOCKET_NO=$(echo $PCMCIA_SOCKET | cut -b14-) + ACTION=add + export SOCKET_NO ACTION + /sbin/hotplug-call pcmcia_socket + done; + fi; +} diff --git a/utils/pcsc-lite/Makefile b/utils/pcsc-lite/Makefile new file mode 100644 index 0000000..db3eeec --- /dev/null +++ b/utils/pcsc-lite/Makefile @@ -0,0 +1,98 @@ +# +# Copyright (C) 2009-2012 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:=pcsc-lite +PKG_VERSION:=1.8.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://alioth.debian.org/frs/download.php/3695 +PKG_MD5SUM:=cb7156346e9478c19085c918b605ed43 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/pcsc-lite/Default + TITLE:=Middleware to access a smart card using SCard API (PC/SC). + URL:=http://pcsclite.alioth.debian.org/ +endef + +define Package/pcsc-lite/Default/description + The purpose of PC/SC Lite is to provide a Windows(R) SCard + interface in a very small form factor for communicating to + smart cards and smart cards readers. +endef + +define Package/libpcsclite + $(call Package/pcsc-lite/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= (library) + DEPENDS:=+libusb-1.0 +libpthread +librt +endef + +define Package/libpcsclite/description + $(call Package/pcsc-lite/Default/description) + . + This package contains the PC/SC shared library. +endef + +define Package/pcscd + $(call Package/pcsc-lite/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= (daemon) + DEPENDS:=+libpcsclite +endef + +define Package/pcscd/description + $(call Package/pcsc-lite/Default/description) + . + This package contains the PC/SC daemon. +endef + +TARGET_CFLAGS += $(FPIC) +TARGET_LDFLAGS += -lpthread + +CONFIGURE_ARGS += \ + --disable-libudev \ + --enable-libusb \ + --enable-static \ + --enable-usbdropdir=/usr/lib/pcsc/drivers + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/PCSC + $(CP) $(PKG_INSTALL_DIR)/usr/include/PCSC/* $(1)/usr/include/PCSC/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcsclite.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpcsclite.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libpcsclite/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcsclite.so.* $(1)/usr/lib/ +endef + +define Package/pcscd/conffiles +/etc/reader.conf.d/reader.conf +endef + +define Package/pcscd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pcscd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/pcscd.init $(1)/etc/init.d/pcscd + $(INSTALL_DIR) $(1)/etc/reader.conf.d +endef + +$(eval $(call BuildPackage,libpcsclite)) +$(eval $(call BuildPackage,pcscd)) diff --git a/utils/pcsc-lite/files/pcscd.init b/utils/pcsc-lite/files/pcscd.init new file mode 100644 index 0000000..9a7a905 --- /dev/null +++ b/utils/pcsc-lite/files/pcscd.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2011 OpenWrt.org + +START=50 + +SERVICE_PID_FILE=/var/run/pcscd/pcscd.pid + +start() { + service_start /usr/sbin/pcscd +} + +stop() { + service_stop /usr/sbin/pcscd +} diff --git a/utils/petitboot/Makefile b/utils/petitboot/Makefile new file mode 100644 index 0000000..fb78afe --- /dev/null +++ b/utils/petitboot/Makefile @@ -0,0 +1,113 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=petitboot +PKG_REV:=93b2c2e0f0ca46d2a823b33cdfa44d082e9e8d10 +PKG_VERSION:=20090709 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=git://ozlabs.org/home/jk/git/petitboot +PKG_SOURCE_PROTO:=git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) + +PKG_INSTALL=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/petitboot + SECTION:=boot + CATEGORY:=Boot Loaders + TITLE:=A kexec based bootloader + URL:=http://ozlabs.org/~jk/projects/petitboot/ + MAINTAINER:=Geoff Levand + DEPENDS:=@TARGET_ps3 +kexec-tools +libncurses +libtwin +udev +ps3-utils +endef + +define Package/petitboot/description + Petitboot is a Linux kexec based bootloader with both + graphical and command-line user interfaces. The OpenWRT + Petitboot package has configuration options that can be + used to specify which Petitboot components to build, and + can also be used to specify that Petitboot should be run + automatically at system start-up. + + Petitboot supports loading Linux kernel and initrd images + from any device that can be mounted by Linux. It can + handle gzipped images and can also load images from the + network using TFTP, NFS, HTTP, HTTPS, and SFTP. Petitboot + looks for bootloader config files on mountable devices in + the system, and also uses the boot configuration sent to + it from a DHCP server. +endef + +define Package/petitboot/config + source "$(SOURCE)/petitboot-config.in" +endef + +petitboot-config-args-y$(CONFIG_PETITBOOT_CUI) += --without-ncurses +petitboot-config-args-y$(CONFIG_PETITBOOT_GUI) += --without-twin +petitboot-config-args-y$(CONFIG_PETITBOOT_PS3) += --enable-ps3=no + +petitboot-cppflags-$(CONFIG_PETITBOOT_DEBUG) += -DDEBUG +petitboot-cppflags-y$(CONFIG_PETITBOOT_DEBUG) += -DNDEBUG + +petitboot-extra-bin-$(CONFIG_PETITBOOT_CUI) += /usr/sbin/pb-cui +petitboot-extra-bin-$(CONFIG_PETITBOOT_GUI) += /usr/sbin/pb-twin +petitboot-extra-data-$(CONFIG_PETITBOOT_GUI) += /usr/share/petitboot/artwork/* + +# The platform inittab and/or initrun should check for /usr/sbin/petitboot +# and run it on startup if found. + +petitboot-install-autorun-$(CONFIG_PETITBOOT_AUTORUN_CUI) = \ + ln -sf pb-cui $(1)/usr/sbin/petitboot +petitboot-install-autorun-$(CONFIG_PETITBOOT_AUTORUN_GUI) = \ + ln -sf pb-twin $(1)/usr/sbin/petitboot + +CONFIGURE_ARGS += $(petitboot-config-args-y) \ + PACKAGE_VERSION=$(shell echo ${HOSTNAME})-$(shell date +%y.%m.%d-%H.%M) + +EXTRA_CPPFLAGS += $(petitboot-cppflags-y) + +define Build/Prepare + $(call Build/Prepare/Default) + (cd $(PKG_BUILD_DIR) && $(BASH) -x ./bootstrap) +endef + +define Package/petitboot/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) \ + $(addprefix $(PKG_INSTALL_DIR),$(petitboot-extra-bin-y)) \ + $(PKG_INSTALL_DIR)/usr/sbin/pb-discover \ + $(PKG_INSTALL_DIR)/usr/sbin/pb-event \ + $(1)/usr/sbin/ + + $(INSTALL_DIR) $(1)/usr/share/petitboot/ + $(INSTALL_DATA) \ + $(addprefix $(PKG_INSTALL_DIR),$(petitboot-extra-data-y)) \ + $(1)/usr/share/petitboot/ + + $(INSTALL_DIR) $(1)/etc/udev/rules.d + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/utils/99-petitboot.rules \ + $(1)/etc/udev/rules.d/ + + $(INSTALL_DIR) $(1)/etc/ + $(INSTALL_DATA) -T $(PKG_BUILD_DIR)/utils/udhcpc $(1)/etc/udhcpc.user + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) \ + ./files/petitboot.init \ + $(1)/etc/init.d/petitboot + + $(petitboot-install-autorun-y) +endef + +$(eval $(call BuildPackage,petitboot)) diff --git a/utils/petitboot/files/petitboot.init b/utils/petitboot/files/petitboot.init new file mode 100644 index 0000000..336d47a --- /dev/null +++ b/utils/petitboot/files/petitboot.init @@ -0,0 +1,22 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +START=90 + +kill_discover() { + killall -q -KILL pb-discover + umount -f -d /var/petitboot/mnt/* 2>/dev/null +} + +start() { + kill_discover + /usr/sbin/pb-discover 2>&- >&- & +} + +stop() { + # first signal pb-discover to exit + killall -q -INT pb-discover + sleep 3 + # now force it + kill_discover +} diff --git a/utils/petitboot/patches/010-petitboot-fixups.diff b/utils/petitboot/patches/010-petitboot-fixups.diff new file mode 100644 index 0000000..cdc0c74 --- /dev/null +++ b/utils/petitboot/patches/010-petitboot-fixups.diff @@ -0,0 +1,391 @@ + 12 files changed, 96 insertions(+), 40 deletions(-) + +diff --git a/discover/kboot-parser.c b/discover/kboot-parser.c +index 23d48a4..7c7cb5d 100644 +--- a/discover/kboot-parser.c ++++ b/discover/kboot-parser.c +@@ -133,7 +133,7 @@ static int kboot_parse(struct discover_context *dc) + conf = talloc_zero(dc, struct conf_context); + + if (!conf) +- return -1; ++ return 0; + + conf->dc = dc; + conf->global_options = kboot_global_options, +diff --git a/discover/parser.c b/discover/parser.c +index 2b4ddd2..8f2735c 100644 +--- a/discover/parser.c ++++ b/discover/parser.c +@@ -13,16 +13,16 @@ extern struct parser __start_parsers[], __stop_parsers[]; + void iterate_parsers(struct discover_context *ctx) + { + struct parser *parser; ++ unsigned int count = 0; + + pb_log("trying parsers for %s\n", ctx->device_path); + + for (parser = __start_parsers; parser < __stop_parsers; parser++) { + pb_log("\ttrying parser '%s'\n", parser->name); +- /* just use a dummy device path for now */ +- if (parser->parse(ctx)) +- return; ++ count += parser->parse(ctx); + } +- pb_log("\tno boot_options found\n"); ++ if (!count) ++ pb_log("\tno boot_options found\n"); + } + + static int compare_parsers(const void *a, const void *b) +diff --git a/discover/yaboot-parser.c b/discover/yaboot-parser.c +index 1000505..6101cd8 100644 +--- a/discover/yaboot-parser.c ++++ b/discover/yaboot-parser.c +@@ -295,7 +295,7 @@ static int yaboot_parse(struct discover_context *dc) + conf = talloc_zero(dc, struct conf_context); + + if (!conf) +- return -1; ++ return 0; + + conf->dc = dc; + conf->global_options = yaboot_global_options, +diff --git a/lib/log/log.h b/lib/log/log.h +index 2a5d375..6f44bea 100644 +--- a/lib/log/log.h ++++ b/lib/log/log.h +@@ -3,7 +3,7 @@ + + #include + +-void pb_log(const char *fmt, ...); ++void __attribute__ ((format (printf, 1, 2))) pb_log(const char *fmt, ...); + void pb_log_set_stream(FILE *stream); + FILE * pb_log_get_stream(void); + void pb_log_always_flush(int state); +diff --git a/lib/system/system.c b/lib/system/system.c +index 65bd6bf..7371445 100644 +--- a/lib/system/system.c ++++ b/lib/system/system.c +@@ -20,6 +20,7 @@ const struct pb_system_apps pb_system_apps = { + .cp = "/bin/cp", + .kexec = "/sbin/kexec", + .mount = "/bin/mount", ++ .shutdown = "/sbin/shutdown", + .sftp = "/usr/bin/sftp", + .tftp = "/usr/bin/tftp", + .umount = "/bin/umount", +diff --git a/lib/system/system.h b/lib/system/system.h +index 47c7c02..1918309 100644 +--- a/lib/system/system.h ++++ b/lib/system/system.h +@@ -5,6 +5,7 @@ struct pb_system_apps { + const char *cp; + const char *kexec; + const char *mount; ++ const char *shutdown; + const char *sftp; + const char *tftp; + const char *umount; +diff --git a/ui/common/discover-client.c b/ui/common/discover-client.c +index e8ce4dd..5b42b6c 100644 +--- a/ui/common/discover-client.c ++++ b/ui/common/discover-client.c +@@ -46,7 +46,7 @@ struct discover_client* discover_client_init( + client->ops.cb_arg = cb_arg; + + client->fd = socket(AF_UNIX, SOCK_STREAM, 0); +- if (!client->fd < 0) { ++ if (client->fd < 0) { + pb_log("%s: socket: %s\n", __func__, strerror(errno)); + goto out_err; + } +diff --git a/ui/common/loader.c b/ui/common/loader.c +index 0fe62a0..5c69533 100644 +--- a/ui/common/loader.c ++++ b/ui/common/loader.c +@@ -263,16 +263,22 @@ fail: + /** + * pb_load_file - Loads a remote file and returns the local file path. + * @ctx: The talloc context to associate with the returned string. ++ * @remote: The remote file URL. ++ * @tempfile: An optional variable pointer to be set when a temporary local ++ * file is created. + * + * Returns the local file path in a talloc'ed character string on success, + * or NULL on error. + */ + +-char *pb_load_file(void *ctx, const char *remote) ++char *pb_load_file(void *ctx, const char *remote, unsigned int *tempfile) + { + char *local; + struct pb_url *url = pb_url_parse(NULL, remote); + ++ if (tempfile) ++ *tempfile = 0; ++ + if (!url) + return NULL; + +@@ -280,19 +286,28 @@ char *pb_load_file(void *ctx, const char *remote) + case pb_url_ftp: + case pb_url_http: + local = pb_load_wget(ctx, url, 0); ++ if (tempfile && local) ++ *tempfile = 1; + break; + case pb_url_https: +- local = pb_load_wget(ctx, url, +- wget_no_check_certificate); ++ local = pb_load_wget(ctx, url, wget_no_check_certificate); ++ if (tempfile && local) ++ *tempfile = 1; + break; + case pb_url_nfs: + local = pb_load_nfs(ctx, url); ++ if (tempfile && local) ++ *tempfile = 1; + break; + case pb_url_sftp: + local = pb_load_sftp(ctx, url); ++ if (tempfile && local) ++ *tempfile = 1; + break; + case pb_url_tftp: + local = pb_load_tftp(ctx, url); ++ if (tempfile && local) ++ *tempfile = 1; + break; + default: + local = talloc_strdup(ctx, url->full); +diff --git a/ui/common/loader.h b/ui/common/loader.h +index b06bb43..42d4d4b 100644 +--- a/ui/common/loader.h ++++ b/ui/common/loader.h +@@ -19,6 +19,6 @@ + #if !defined(_PB_FILE_LOADER_H) + #define _PB_FILE_LOADER_H + +-char *pb_load_file(void *ctx, const char *remote); ++char *pb_load_file(void *ctx, const char *remote, unsigned int *tempfile); + + #endif +diff --git a/ui/common/ps3.c b/ui/common/ps3.c +index cb1c8d1..c62a10d 100644 +--- a/ui/common/ps3.c ++++ b/ui/common/ps3.c +@@ -87,7 +87,7 @@ static int ps3_flash_open(struct ps3_flash_ctx *fc, const char *mode) + result = os_area_fixed_read(&fc->header, &fc->params, fc->dev); + + if (result) { +- pb_log("%s: os_area_fixed_read failed: %s\n", __func__); ++ pb_log("%s: os_area_fixed_read failed\n", __func__); + goto fail; + } + +@@ -114,7 +114,7 @@ int ps3_flash_get_values(struct ps3_flash_values *values) + result = ps3_flash_open(&fc, "r"); + + if (result) +- goto done; ++ goto fail; + + result = os_area_db_read(&fc.db, &fc.header, fc.dev); + +@@ -123,7 +123,7 @@ int ps3_flash_get_values(struct ps3_flash_values *values) + if (result) { + pb_log("%s: os_area_db_read failed: %s\n", __func__, + strerror(errno)); +- goto done; ++ goto fail; + } + + sum = result = os_area_db_get(&fc.db, &id_default_item, &tmp); +@@ -141,14 +141,13 @@ int ps3_flash_get_values(struct ps3_flash_values *values) + if (!result) + values->video_mode = (uint16_t)tmp; + +-done: + pb_log("%s: default_item: %x\n", __func__, + (unsigned int)values->default_item); + pb_log("%s: timeout: %u\n", __func__, + (unsigned int)values->timeout); + pb_log("%s: video_mode: %u\n", __func__, + (unsigned int)values->video_mode); +- ++fail: + return (result || sum) ? -1 : 0; + } + +diff --git a/ui/common/ui-system.c b/ui/common/ui-system.c +index bd6dd31..0140f0e 100644 +--- a/ui/common/ui-system.c ++++ b/ui/common/ui-system.c +@@ -33,13 +33,13 @@ + #include "ui-system.h" + + /** +- * run_kexec_local - Final kexec helper. ++ * kexec_load - kexec load helper. + * @l_image: The local image file for kexec to execute. + * @l_initrd: Optional local initrd file for kexec --initrd, can be NULL. + * @args: Optional command line args for kexec --append, can be NULL. + */ + +-static int run_kexec_local(const char *l_image, const char *l_initrd, ++static int kexec_load(const char *l_image, const char *l_initrd, + const char *args) + { + int result; +@@ -49,34 +49,64 @@ static int run_kexec_local(const char *l_image, const char *l_initrd, + char *s_args = NULL; + + p = argv; +- *p++ = pb_system_apps.kexec; /* 1 */ ++ *p++ = pb_system_apps.kexec; /* 1 */ ++ *p++ = "-l"; /* 2 */ + + if (l_initrd) { + s_initrd = talloc_asprintf(NULL, "--initrd=%s", l_initrd); + assert(s_initrd); +- *p++ = s_initrd; /* 2 */ ++ *p++ = s_initrd; /* 3 */ + } + + if (args) { + s_args = talloc_asprintf(NULL, "--append=%s", args); + assert(s_args); +- *p++ = s_args; /* 3 */ ++ *p++ = s_args; /* 4 */ + } + +- /* First try by telling kexec to run shutdown */ ++ *p++ = l_image; /* 5 */ ++ *p++ = NULL; /* 6 */ + +- *(p + 0) = l_image; +- *(p + 1) = NULL; ++ result = pb_run_cmd(argv); ++ ++ if (result) ++ pb_log("%s: failed: (%d)\n", __func__, result); ++ ++ talloc_free(s_initrd); ++ talloc_free(s_args); ++ ++ return result; ++} ++ ++/** ++ * kexec_reboot - Helper to boot the new kernel. ++ * ++ * Must only be called after a successful call to kexec_load(). ++ */ ++ ++static int kexec_reboot(void) ++{ ++ int result; ++ const char *argv[4]; ++ const char **p; ++ ++ /* First try running shutdown. Init scripts should run 'exec -e' */ ++ ++ p = argv; ++ *p++ = pb_system_apps.shutdown; /* 1 */ ++ *p++ = "-r"; /* 2 */ ++ *p++ = "now"; /* 3 */ ++ *p++ = NULL; /* 4 */ + + result = pb_run_cmd(argv); + +- /* kexec will return zero on success */ +- /* On error, force a kexec with the -f option */ ++ /* On error, force a kexec with the -e option */ + + if (result) { +- *(p + 0) = "-f"; /* 4 */ +- *(p + 1) = l_image; /* 5 */ +- *(p + 2) = NULL; /* 6 */ ++ p = argv; ++ *p++ = pb_system_apps.kexec; /* 1 */ ++ *p++ = "-e"; /* 2 */ ++ *p++ = NULL; /* 3 */ + + result = pb_run_cmd(argv); + } +@@ -84,9 +114,6 @@ static int run_kexec_local(const char *l_image, const char *l_initrd, + if (result) + pb_log("%s: failed: (%d)\n", __func__, result); + +- talloc_free(s_initrd); +- talloc_free(s_args); +- + return result; + } + +@@ -99,31 +126,44 @@ int pb_run_kexec(const struct pb_kexec_data *kd) + int result; + char *l_image = NULL; + char *l_initrd = NULL; ++ unsigned int clean_image = 0; ++ unsigned int clean_initrd = 0; + + pb_log("%s: image: '%s'\n", __func__, kd->image); + pb_log("%s: initrd: '%s'\n", __func__, kd->initrd); + pb_log("%s: args: '%s'\n", __func__, kd->args); + ++ result = -1; ++ + if (kd->image) { +- l_image = pb_load_file(NULL, kd->image); ++ l_image = pb_load_file(NULL, kd->image, &clean_image); + if (!l_image) +- return -1; ++ goto no_load; + } + + if (kd->initrd) { +- l_initrd = pb_load_file(NULL, kd->initrd); ++ l_initrd = pb_load_file(NULL, kd->initrd, &clean_initrd); + if (!l_initrd) +- return -1; ++ goto no_load; + } + + if (!l_image && !l_initrd) +- return -1; ++ goto no_load; ++ ++ result = kexec_load(l_image, l_initrd, kd->args); + +- result = run_kexec_local(l_image, l_initrd, kd->args); ++no_load: ++ if (clean_image) ++ unlink(l_image); ++ if (clean_initrd) ++ unlink(l_initrd); + + talloc_free(l_image); + talloc_free(l_initrd); + ++ if (!result) ++ result = kexec_reboot(); ++ + return result; + } + +diff --git a/ui/common/url.c b/ui/common/url.c +index 0de0f58..544eee2 100644 +--- a/ui/common/url.c ++++ b/ui/common/url.c +@@ -140,7 +140,7 @@ struct pb_url *pb_url_parse(void *ctx, const char *url_str) + path = strchr(p, '/'); + + if (!path) { +- pb_log("%s: parse path failed '%s'\n", p); ++ pb_log("%s: parse path failed '%s'\n", __func__ , p); + goto fail; + } + diff --git a/utils/petitboot/patches/020-petitboot-fix-pb-twin.diff b/utils/petitboot/patches/020-petitboot-fix-pb-twin.diff new file mode 100644 index 0000000..aa24f56 --- /dev/null +++ b/utils/petitboot/patches/020-petitboot-fix-pb-twin.diff @@ -0,0 +1,1521 @@ +a work-in-progress + +Subject: Update PS3 twin GUI program + +Update the PS3 twin GUI program to work with petitboot-multi-ui. + +Signed-off-by: Geoff Levand +--- + Makefile.in | 1 + configure.ac | 12 + rules.mk | 14 + ui/twin/ps3-twin.c | 1441 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 1463 insertions(+), 5 deletions(-) + +--- a/Makefile.in ++++ b/Makefile.in +@@ -18,6 +18,7 @@ twin_LDFLAGS = @twin_LIBS@ + + # build target + ENABLE_PS3 = @ENABLE_PS3@ ++ENABLE_X11 = @ENABLE_X11@ + + # other programs + INSTALL = @INSTALL@ +--- a/configure.ac ++++ b/configure.ac +@@ -56,7 +56,17 @@ AS_IF([test "x$with_twin" != xno], + [if test "x$with_twin" != xcheck; then + AC_MSG_FAILURE([--with-twin was given, but test for twin failed]) + fi], +- [${twin_LIBS}])]) ++ [${twin_LIBS}]) ++ AC_CHECK_HEADERS([libtwin/twin_x11.h])]) ++ ++AC_ARG_ENABLE([x11], ++ [AS_HELP_STRING([--enable-x11], ++ [build for x11])], ++ [], ++ [enable_x11=check]) ++ ++AS_IF([test "x$enable_x11" != xno], [AC_SUBST([ENABLE_X11], ["y"])], []) ++ + + mkdir -p discover lib/list lib/log lib/pb-protocol lib/system lib/talloc \ + lib/waiter test ui/common ui/ncurses ui/test ui/twin utils +--- a/rules.mk ++++ b/rules.mk +@@ -54,7 +54,7 @@ ui_common_objs = ui/common/discover-clie + ui/common/url.o + ncurses_objs = ui/ncurses/nc-scr.o ui/ncurses/nc-menu.o ui/ncurses/nc-ked.o \ + ui/ncurses/nc-cui.o +-twin_objs = ui/twin/pb-twin.o ++twin_objs = + + # Makefiles + makefiles = Makefile $(top_srcdir)/rules.mk +@@ -89,11 +89,17 @@ $(pb_test): $(pb_test_objs) + $(LINK.o) -o $@ $^ + + # twin gui +-pb_twin_objs = $(client_objs) $(twin_objs) ui/twin/ps3-twin.o ++pb_twin_objs-y$(ENABLE_PS3) += ui/twin/pb-twin.o ++pb_twin_objs-$(ENABLE_PS3) += ui/twin/ps3-twin.o ui/common/ps3.o ++pb_twin_cflags-$(ENABLE_X11) += -DUSE_X11 ++pb_twin_ldflags-$(ENABLE_PS3) += -lps3-utils ++ ++pb_twin_objs = $(client_objs) $(twin_objs) $(pb_twin_objs-y) + $(pb_twin_objs): $(makefiles) + +-$(pb_twin): LDFLAGS+=$(twin_LDFLAGS) $(LIBTWIN) +-$(pb_twin): CFLAGS+=$(twin_CFLAGS) ++$(pb_twin): LDFLAGS += $(pb_twin_ldflags-y) $(twin_LDFLAGS) $(LIBTWIN) ++$(pb_twin): CFLAGS += $(pb_twin_cflags-y) $(twin_CFLAGS) \ ++ -DPB_ARTWORK_PATH='"$(pkgdatadir)/artwork/"' + + $(pb_twin): $(pb_twin_objs) + $(LINK.o) -o $@ $^ +--- /dev/null ++++ b/ui/twin/ps3-twin.c +@@ -0,0 +1,1441 @@ ++/* ++ * Petitboot twin bootloader for the PS3 game console ++ * ++ * Copyright (C) 2009 Sony Computer Entertainment Inc. ++ * Copyright 2009 Sony Corp. ++ * ++ * 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; version 2 of the License. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#if defined(HAVE_CONFIG_H) ++#include "config.h" ++#endif ++ ++#define _GNU_SOURCE ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#if defined(HAVE_LIBTWIN_TWIN_X11_H) ++# include ++#endif ++#include ++ ++#include "log/log.h" ++#include "talloc/talloc.h" ++#include "waiter/waiter.h" ++#include "ui/common/discover-client.h" ++#include "ui/common/ps3.h" ++#include "ui/common/timer.h" ++ ++//------------------------------------------------------------------------------ ++// twin-ui.c/h ++ ++#define DBG(fmt, args...) pb_log("DBG: " fmt, ## args) ++#define DBGS(fmt, args...) \ ++ pb_log("DBG:%s:%d: " fmt, __func__, __LINE__, ## args) ++ ++/* control to keyboard mappings for the sixaxis controller */ ++uint8_t sixaxis_map[] = { ++ 0, /* 0 Select */ ++ 0, /* 1 L3 */ ++ 0, /* 2 R3 */ ++ 0, /* 3 Start */ ++ KEY_UP, /* 4 Dpad Up */ ++ KEY_RIGHT, /* 5 Dpad Right */ ++ KEY_DOWN, /* 6 Dpad Down */ ++ KEY_LEFT, /* 7 Dpad Left */ ++ 0, /* 8 L2 */ ++ 0, /* 9 R2 */ ++ 0, /* 10 L1 */ ++ 0, /* 11 R1 */ ++ 0, /* 12 Triangle */ ++ KEY_ENTER, /* 13 Circle */ ++ 0, /* 14 Cross */ ++ KEY_DELETE, /* 15 Square */ ++ 0, /* 16 PS Button */ ++ 0, /* 17 nothing */ ++ 0, /* 18 nothing */ ++}; ++ ++#define PBOOT_LEFT_PANE_SIZE 160 ++#define PBOOT_LEFT_PANE_COLOR 0x80000000 ++#define PBOOT_LEFT_LINE_COLOR 0xff000000 ++ ++#define PBOOT_LEFT_FOCUS_WIDTH 80 ++#define PBOOT_LEFT_FOCUS_HEIGHT 80 ++#define PBOOT_LEFT_FOCUS_XOFF 40 ++#define PBOOT_LEFT_FOCUS_YOFF 40 ++#define PBOOT_LEFT_FOCUS_XRAD (6 * TWIN_FIXED_ONE) ++#define PBOOT_LEFT_FOCUS_YRAD (6 * TWIN_FIXED_ONE) ++ ++#define PBOOT_RIGHT_FOCUS_XOFF 20 ++#define PBOOT_RIGHT_FOCUS_YOFF 60 ++#define PBOOT_RIGHT_FOCUS_HEIGHT 80 ++#define PBOOT_RIGHT_FOCUS_XRAD (6 * TWIN_FIXED_ONE) ++#define PBOOT_RIGHT_FOCUS_YRAD (6 * TWIN_FIXED_ONE) ++ ++#define PBOOT_LEFT_ICON_WIDTH 64 ++#define PBOOT_LEFT_ICON_HEIGHT 64 ++#define PBOOT_LEFT_ICON_XOFF 50 ++#define PBOOT_LEFT_ICON_YOFF 50 ++#define PBOOT_LEFT_ICON_STRIDE 100 ++ ++#define PBOOT_RIGHT_OPTION_LMARGIN 30 ++#define PBOOT_RIGHT_OPTION_RMARGIN 30 ++#define PBOOT_RIGHT_OPTION_TMARGIN 70 ++#define PBOOT_RIGHT_OPTION_HEIGHT 64 ++#define PBOOT_RIGHT_OPTION_STRIDE 100 ++#define PBOOT_RIGHT_TITLE_TEXT_SIZE (30 * TWIN_FIXED_ONE) ++#define PBOOT_RIGHT_SUBTITLE_TEXT_SIZE (18 * TWIN_FIXED_ONE) ++#define PBOOT_RIGHT_TITLE_XOFFSET 80 ++#define PBOOT_RIGHT_TITLE_YOFFSET 30 ++#define PBOOT_RIGHT_SUBTITLE_XOFFSET 100 ++#define PBOOT_RIGHT_SUBTITLE_YOFFSET 50 ++#define PBOOT_RIGHT_BADGE_XOFFSET 2 ++#define PBOOT_RIGHT_BADGE_YOFFSET 0 ++ ++ ++#define PBOOT_RIGHT_TITLE_COLOR 0xff000000 ++#define PBOOT_RIGHT_SUBTITLE_COLOR 0xff400000 ++ ++#define PBOOT_FOCUS_COLOR 0x10404040 ++ ++#define PBOOT_STATUS_PANE_COLOR 0x60606060 ++#define PBOOT_STATUS_PANE_HEIGHT 20 ++#define PBOOT_STATUS_PANE_XYMARGIN 20 ++#define PBOOT_STATUS_TEXT_MARGIN 10 ++#define PBOOT_STATUS_TEXT_SIZE (16 * TWIN_FIXED_ONE) ++#define PBOOT_STATUS_TEXT_COLOR 0xff000000 ++ ++#define PBOOT_MAX_OPTION 100 ++#define PBOOT_MAX_DEV 10 ++ ++struct pbt_option ++{ ++ char *title; ++ char *subtitle; ++ twin_pixmap_t *badge; ++ twin_pixmap_t *cache; ++ twin_rect_t box; ++ void *data; ++}; ++ ++struct pbt_device ++{ ++ char *id; ++ twin_pixmap_t *badge; ++ twin_rect_t box; ++ int option_count; ++ struct pbt_option options[PBOOT_MAX_OPTION]; ++}; ++ ++enum pbt_sig { ++ pbt_scr_sig = 111, ++ pbt_menu_sig = 222, ++ pbt_pane_sig = 333, ++ pb_removed_sig = -555, ++}; ++ ++struct pbt_cursor { ++ twin_pixmap_t *pixmap; ++ int hx; ++ int hy; ++}; ++ ++struct pbt_scr { ++ enum pbt_sig sig; ++ struct pbt_cursor cursor; ++ twin_screen_t *tscreen; ++#if defined(HAVE_LIBTWIN_TWIN_X11_H) ++ twin_x11_t *x11; ++#endif ++ twin_fbdev_t *fbdev; ++}; ++ ++struct pbt_frame { ++ twin_label_t *title; ++ twin_label_t *help; ++ twin_label_t *status; ++}; ++ ++/** ++ * struct pbt_pane - A twin menu pane. ++ */ ++ ++struct pbt_pane { ++ enum pbt_sig sig; ++ twin_window_t *window; ++ twin_rect_t focus_box; ++ int focus_start; ++ int focus_target; ++ int focus_curindex; ++ int mouse_target; ++ int has_focus; ++}; ++ ++/** ++ * struct pbt_menu - A twin menu. ++ * @sig: Sanity check signature. ++ * @scr: The screen this menu is associated with. ++ * @dp: The device pane instance. ++ * @op: The option pane instance. ++ */ ++ ++struct pbt_menu { ++ enum pbt_sig sig; ++ struct pbt_scr *scr; ++ struct pbt_pane *dp; ++ struct pbt_pane *op; ++}; ++ ++//============================================================================== ++// helper ++//============================================================================== ++ ++static struct pbt_scr *pbt_scr_from_tscreen(twin_screen_t *tscreen); ++ ++static struct pbt_menu *pbt_menu_from_twindow(twin_window_t *twindow) ++{ ++ struct pbt_menu *menu = twindow->client_data; ++ ++ assert(menu); ++ assert(menu->sig == pbt_menu_sig); ++ return menu; ++} ++ ++/* ++static struct pbt_menu *pbt_menu_from_arg(void *arg) ++{ ++ struct pbt_menu *menu = arg; ++ ++ assert(menu); ++ assert(menu->sig == pbt_menu_sig); ++ return menu; ++} ++*/ ++ ++static struct pbt_pane *pbt_pane_from_arg(void *arg) ++{ ++ struct pbt_pane *pane = arg; ++ ++ assert(pane); ++ assert(pane->sig == pbt_pane_sig); ++ return pane; ++} ++ ++static twin_bool_t pbt_rect_intersect(twin_rect_t r1, twin_rect_t r2) ++{ ++ // FIXME: move this to twin!!! ++ return !(r1.left > r2.right || ++ r1.right < r2.left || ++ r1.top > r2.bottom || ++ r1.bottom < r2.top); ++} ++ ++static twin_pixmap_t * pbt_load_background(twin_screen_t *tscreen) ++{ ++ static const char *bgd = PB_ARTWORK_PATH "/background.jpg"; ++ twin_pixmap_t *rawpix; ++ twin_pixmap_t *scaledpix; ++ ++ rawpix = twin_jpeg_to_pixmap(bgd, TWIN_ARGB32); ++ ++ if (!rawpix) { ++ pb_log("%s: loading image %s failed\n", __func__, bgd); ++ return twin_make_pattern(); ++ } ++ ++ if (tscreen->height == rawpix->height && ++ tscreen->width == rawpix->width) ++ return rawpix; ++ ++ /* Scale as needed. */ ++ ++ twin_fixed_t sx, sy; ++ twin_operand_t srcop; ++ ++ scaledpix = twin_pixmap_create(TWIN_ARGB32, ++ tscreen->width, ++ tscreen->height); ++ if (!scaledpix) { ++ pb_log("%s: scale %s failed\n", __func__, bgd); ++ twin_pixmap_destroy(rawpix); ++ return twin_make_pattern(); ++ } ++ sx = twin_fixed_div(twin_int_to_fixed(rawpix->width), ++ twin_int_to_fixed(tscreen->width)); ++ sy = twin_fixed_div(twin_int_to_fixed(rawpix->height), ++ twin_int_to_fixed(tscreen->height)); ++ ++ twin_matrix_scale(&rawpix->transform, sx, sy); ++ srcop.source_kind = TWIN_PIXMAP; ++ srcop.u.pixmap = rawpix; ++ twin_composite(scaledpix, 0, 0, &srcop, 0, 0, ++ NULL, 0, 0, TWIN_SOURCE, ++ tscreen->width, tscreen->height); ++ ++ twin_pixmap_destroy(rawpix); ++ return scaledpix; ++} ++ ++//============================================================================== ++// option ++//============================================================================== ++ ++static void pbt_option_execute(struct pbt_menu *menu) ++{ ++#if 0 ++ pboot_device_t *dev = pboot_devices[pboot_dev_sel]; ++ pboot_option_t *opt = &dev->options[menu->op->focus_curindex]; ++ ++ pb_log("Selected device %s\n", opt->title); ++ pboot_message("booting %s...", opt->title); ++ ++ /* Give user feedback, make sure errors and panics will be seen */ ++ pboot_exec_option(opt->data); ++#endif ++} ++ ++//============================================================================== ++// device ++//============================================================================== ++ ++//============================================================================== ++// scr ++//============================================================================== ++ ++static twin_bool_t pbt_scr_event(twin_screen_t *tscreen, twin_event_t *event) ++{ ++ struct pbt_scr *scr = pbt_scr_from_tscreen(tscreen); ++ ++ switch(event->kind) { ++ case TwinEventEnter: ++ case TwinEventMotion: ++ case TwinEventLeave: ++ case TwinEventButtonDown: ++ case TwinEventButtonUp: ++ if (scr->cursor.pixmap) ++ twin_screen_set_cursor(tscreen, scr->cursor.pixmap, ++ scr->cursor.hx, scr->cursor.hy); ++ break; ++ case TwinEventJoyButton: ++ /* map joystick events into key events */ ++ if (event->u.js.control >= sizeof(sixaxis_map)) ++ break; ++ ++ event->u.key.key = sixaxis_map[event->u.js.control]; ++ if (event->u.js.value == 0) { ++ event->kind = TwinEventKeyUp; ++ break; ++ } else { ++ event->kind = TwinEventKeyDown; ++ } ++ /* fall through.. */ ++ case TwinEventKeyDown: ++ switch(event->u.key.key) { ++ case KEY_0: ++ return TWIN_TRUE; ++ case KEY_BACKSPACE: ++ case KEY_DELETE: ++ return TWIN_FALSE; ++ } ++ case TwinEventKeyUp: ++ twin_screen_set_cursor(tscreen, NULL, 0, 0); ++ break; ++ default: ++ break; ++ } ++ return TWIN_FALSE; ++} ++ ++//============================================================================== ++// pane ++//============================================================================== ++ ++static int pbt_pane_has_focus(const struct pbt_pane *pane) ++{ ++ return pane->has_focus; ++} ++ ++static twin_time_t pbt_pane_timeout(twin_time_t now, void *closure) ++{ ++ const int accel[11] = { 7, 4, 2, 1, 1, 1, 1, 1, 2, 2, 3 }; ++ struct pbt_pane *pane = pbt_pane_from_arg(closure); ++ int dir = 1, dist, pos; ++ ++ dist = abs(pane->focus_target - pane->focus_start); ++ dir = dist > 5 ? 5 : dist; ++ pos = pane->focus_target - (int)pane->focus_box.top; ++ if (pos == 0) { ++ return -1; ++ } ++ if (pos < 0) { ++ dir = -dir; ++ pos = -pos; ++ } ++ twin_window_damage(pane->window, ++ pane->focus_box.left, ++ pane->focus_box.top, ++ pane->focus_box.right, ++ pane->focus_box.bottom); ++ ++ pane->focus_box.top += dir; ++ pane->focus_box.bottom += dir; ++ ++ twin_window_damage(pane->window, ++ pane->focus_box.left, ++ pane->focus_box.top, ++ pane->focus_box.right, ++ pane->focus_box.bottom); ++ ++ twin_window_queue_paint(pane->window); ++ ++ return accel[(pos * 10) / dist]; ++} ++ ++//============================================================================== ++// menu ++//============================================================================== ++ ++/** ++ * pbt_menu_set_focus - Set the menu's pane of focus. ++ * @menu: The menu to operate on. ++ * @pane: The pane that will have the focus. ++ */ ++ ++static void pbt_menu_set_focus(struct pbt_menu *menu, struct pbt_pane *pane) ++{ ++ assert(!pane->has_focus); ++ ++ if (pane == menu->dp) { ++ menu->dp->has_focus = 1; ++ menu->op->has_focus = 0; ++ } else if (pane == menu->op) { ++ menu->dp->has_focus = 0; ++ menu->op->has_focus = 1; ++// pbt_menu_set_option_focus(menu, 0); ++ } else ++ assert(0 && "bad logic"); ++} ++ ++static void pbt_menu_pane_select(struct pbt_menu *menu, struct pbt_pane *pane) ++{ ++ if(pbt_pane_has_focus(pane)) ++ return; ++ ++ twin_screen_set_active(menu->scr->tscreen, pane->window->pixmap); ++ ++ twin_window_damage(menu->dp->window, ++ menu->dp->focus_box.left, ++ menu->dp->focus_box.top, ++ menu->dp->focus_box.right, ++ menu->dp->focus_box.bottom); ++ twin_window_damage(menu->op->window, ++ menu->op->focus_box.left, ++ menu->op->focus_box.top, ++ menu->op->focus_box.right, ++ menu->op->focus_box.bottom); ++ ++ twin_window_queue_paint(menu->dp->window); ++ twin_window_queue_paint(menu->op->window); ++ ++ pbt_menu_set_focus(menu, pane); ++} ++ ++ ++static struct pbt_pane *pbt_device_pane_create(struct pbt_menu *menu); ++static struct pbt_pane *pbt_option_pane_create(struct pbt_menu *menu); ++ ++static struct pbt_menu *pbt_menu_create(void *ctx, struct pbt_scr *scr) ++{ ++ struct pbt_menu *menu = talloc_zero(ctx, struct pbt_menu); ++ ++ if (!menu) ++ return NULL; ++ ++ assert(scr && scr->sig == pbt_scr_sig); ++ ++ menu->sig = pbt_menu_sig; ++ menu->scr = scr; ++ ++ menu->dp = pbt_device_pane_create(menu); ++ ++ if (!menu->dp) ++ goto fail_dp; ++ ++ menu->op = pbt_option_pane_create(menu); ++ ++ if (!menu->op) ++ goto fail_op; ++ ++ return menu; ++ ++fail_op: ++ //clean dp ++fail_dp: ++ talloc_free(menu); ++ return NULL; ++} ++ ++//============================================================================== ++// device_pane ++//============================================================================== ++ ++static void pbt_device_pane_draw(twin_window_t *window) ++{ ++ struct pbt_pane *dp = pbt_menu_from_twindow(window)->dp; ++ twin_pixmap_t *px = window->pixmap; ++ twin_path_t *path; ++ twin_fixed_t x, y, w, h; ++ int i; ++ ++ /* Fill background */ ++ twin_fill(px, PBOOT_LEFT_PANE_COLOR, TWIN_SOURCE, 0, 0, px->width, ++ px->height); ++ ++ /* Create a path for use later */ ++ path = twin_path_create(); ++ assert(path); ++ ++ /* Draw right line if needed */ ++ if (px->clip.right > (PBOOT_LEFT_PANE_SIZE - 4)) { ++ x = twin_int_to_fixed(PBOOT_LEFT_PANE_SIZE - 4); ++ y = twin_int_to_fixed(px->height); ++ twin_path_rectangle(path, x, 0, 0x40000, y); ++ twin_paint_path(px, PBOOT_LEFT_LINE_COLOR, path); ++ twin_path_empty(path); ++ } ++ ++ /* Draw focus box */ ++ if (dp->focus_curindex >= 0 && ++ pbt_rect_intersect(dp->focus_box, px->clip)) { ++ x = twin_int_to_fixed(dp->focus_box.left + 2); ++ y = twin_int_to_fixed(dp->focus_box.top + 2); ++ w = twin_int_to_fixed(dp->focus_box.right - ++ dp->focus_box.left - 4); ++ h = twin_int_to_fixed(dp->focus_box.bottom - ++ dp->focus_box.top - 4); ++ twin_path_rounded_rectangle(path, x, y, w, h, ++ PBOOT_LEFT_FOCUS_XRAD, ++ PBOOT_LEFT_FOCUS_YRAD); ++ if (pbt_pane_has_focus(dp)) ++ twin_paint_path(px, PBOOT_FOCUS_COLOR, path); ++ else ++ twin_paint_stroke(px, PBOOT_FOCUS_COLOR, path, ++ 4 * TWIN_FIXED_ONE); ++ } ++ ++#if 0 ++ /* Draw icons */ ++ for (i = 0; i < pboot_dev_count; i++) { ++ pboot_device_t *dev = pboot_devices[i]; ++ twin_operand_t src; ++ ++ if (!twin_rect_intersect(dev->box, px->clip)) ++ continue; ++ ++ src.source_kind = TWIN_PIXMAP; ++ src.u.pixmap = dev->badge; ++ ++ twin_composite(px, dev->box.left, dev->box.top, ++ &src, 0, 0, NULL, 0, 0, TWIN_OVER, ++ dev->box.right - dev->box.left, ++ dev->box.bottom - dev->box.top); ++ } ++#endif ++ ++ /* Destroy path */ ++ twin_path_destroy(path); ++} ++ ++ ++static void pbt_device_pane_set_focus(struct pbt_menu *menu, int index) ++{ ++#if 0 ++ if (index >= pboot_dev_count) ++ return; ++#endif ++ ++ menu->dp->focus_start = menu->dp->focus_box.top; ++ ++ if (index < 0) ++ menu->dp->focus_target = 0 - PBOOT_LEFT_FOCUS_HEIGHT; ++ else ++ menu->dp->focus_target = PBOOT_LEFT_FOCUS_YOFF + ++ PBOOT_LEFT_ICON_STRIDE * index; ++ ++ menu->dp->focus_curindex = index; ++ ++ twin_set_timeout(pbt_pane_timeout, 0, menu->dp); ++} ++ ++static void pbt_device_pane_mousetrack(struct pbt_menu *menu, twin_coord_t x, ++ twin_coord_t y) ++{ ++ int candidate = -1; ++ twin_coord_t icon_top; ++ ++ if (x < PBOOT_LEFT_ICON_XOFF || ++ x > (PBOOT_LEFT_ICON_XOFF + PBOOT_LEFT_ICON_WIDTH)) ++ goto miss; ++ ++ if (y < PBOOT_LEFT_ICON_YOFF) ++ goto miss; ++ ++ candidate = (y - PBOOT_LEFT_ICON_YOFF) / PBOOT_LEFT_ICON_STRIDE; ++ ++#if 0 ++ if (candidate >= pboot_dev_count) { ++ candidate = -1; ++ goto miss; ++ } ++#endif ++ if (candidate == menu->dp->mouse_target) ++ return; ++ ++ icon_top = PBOOT_LEFT_ICON_YOFF + candidate * PBOOT_LEFT_ICON_STRIDE; ++ ++ if (y > (icon_top + PBOOT_LEFT_ICON_HEIGHT)) { ++ candidate = -1; ++ goto miss; ++ } ++ ++ /* The mouse hit an icon that wasn't the same ++ * as the previous one, trigger a focus change. ++ */ ++ ++ pbt_device_pane_set_focus(menu, candidate); ++ ++ miss: ++ menu->dp->mouse_target = candidate; ++} ++ ++static twin_bool_t pbt_device_pane_event(twin_window_t *window, ++ twin_event_t *event) ++{ ++ struct pbt_menu *menu = pbt_menu_from_twindow(window); ++ ++ /* filter out all mouse events */ ++ switch(event->kind) { ++ case TwinEventEnter: ++ case TwinEventMotion: ++ case TwinEventLeave: ++ pbt_menu_pane_select(menu, menu->dp); ++ pbt_device_pane_mousetrack(menu, event->u.pointer.x, ++ event->u.pointer.y); ++ return TWIN_TRUE; ++ case TwinEventButtonDown: ++ case TwinEventButtonUp: ++ return TWIN_TRUE; ++ case TwinEventKeyDown: ++ switch(event->u.key.key) { ++ case KEY_UP: ++ if (menu->dp->focus_curindex > 0) ++ pbt_device_pane_set_focus(menu, ++ menu->dp->focus_curindex - 1); ++ return TWIN_TRUE; ++ case KEY_DOWN: ++ pbt_device_pane_set_focus(menu, menu->dp->focus_curindex + 1); ++ return TWIN_TRUE; ++ case KEY_RIGHT: ++ pbt_menu_pane_select(menu, menu->op); ++ return TWIN_TRUE; ++ default: ++ break; ++ } ++ break; ++ default: ++ break; ++ } ++ return TWIN_FALSE; ++} ++ ++static struct pbt_pane *pbt_device_pane_create(struct pbt_menu *menu) ++{ ++ struct pbt_pane *pane = talloc_zero(menu, struct pbt_pane); ++ ++ if (!pane) ++ return NULL; ++ ++ pane->sig = pbt_pane_sig; ++ pane->window = twin_window_create(menu->scr->tscreen, TWIN_ARGB32, ++ TwinWindowPlain, 0, 0, PBOOT_LEFT_PANE_SIZE, ++ menu->scr->tscreen->height); ++ ++ if (!pane->window) ++ goto fail_window; ++ ++ pane->window->draw = pbt_device_pane_draw; ++ pane->window->event = pbt_device_pane_event; ++ pane->window->client_data = menu; ++ ++ pane->focus_curindex = -1; ++ pane->focus_box.left = PBOOT_LEFT_FOCUS_XOFF; ++ pane->focus_box.top = -2 * PBOOT_LEFT_FOCUS_HEIGHT; ++ pane->focus_box.right = pane->focus_box.left + PBOOT_LEFT_FOCUS_WIDTH; ++ pane->focus_box.bottom = pane->focus_box.top + PBOOT_LEFT_FOCUS_HEIGHT; ++ ++ pane->mouse_target = -1; ++ ++ twin_window_show(pane->window); ++ twin_window_queue_paint(pane->window); ++ ++ return pane; ++ ++fail_window: ++ talloc_free(pane); ++ return NULL; ++} ++ ++//============================================================================== ++// option_pane ++//============================================================================== ++ ++static void pbt_option_pane_set_focus(struct pbt_menu *menu, int index) ++{ ++#if 0 ++ pboot_device_t *dev; ++ ++ if (pboot_dev_sel < 0 || pboot_dev_sel >= pboot_dev_count) ++ return; ++ dev = pboot_devices[pboot_dev_sel]; ++ if (index < 0 || index >= dev->option_count) ++ return; ++#endif ++ ++ menu->op->focus_start = menu->op->focus_box.top; ++ menu->op->focus_target = PBOOT_RIGHT_FOCUS_YOFF + ++ PBOOT_RIGHT_OPTION_STRIDE * index; ++ menu->op->focus_curindex = index; ++ ++ twin_set_timeout(pbt_pane_timeout, 0, menu->op); ++} ++ ++static void pbt_option_pane_draw(twin_window_t *window) ++{ ++ struct pbt_pane *op = pbt_menu_from_twindow(window)->op; ++ twin_pixmap_t *px = window->pixmap; ++// pboot_device_t *dev; ++ twin_path_t *path; ++ twin_fixed_t x, y, w, h; ++ int i; ++ ++ /* Fill background */ ++ twin_fill(px, 0x00000000, TWIN_SOURCE, 0, 0, px->width, px->height); ++ ++ /* Nothing to draw, return */ ++// if (pboot_dev_sel < 0) ++// return; ++ ++ /* Create a path for use later */ ++ path = twin_path_create(); ++ assert(path); ++ ++ /* Draw focus box */ ++ if (op->focus_curindex >= 0 && ++ pbt_rect_intersect(op->focus_box, px->clip)) { ++ x = twin_int_to_fixed(op->focus_box.left + 2); ++ y = twin_int_to_fixed(op->focus_box.top + 2); ++ w = twin_int_to_fixed(op->focus_box.right - ++ op->focus_box.left - 4); ++ h = twin_int_to_fixed(op->focus_box.bottom - ++ op->focus_box.top - 4); ++ twin_path_rounded_rectangle(path, x, y, w, h, ++ PBOOT_RIGHT_FOCUS_XRAD, ++ PBOOT_RIGHT_FOCUS_YRAD); ++ if (pbt_pane_has_focus(op)) ++ twin_paint_path(px, PBOOT_FOCUS_COLOR, path); ++ else ++ twin_paint_stroke(px, PBOOT_FOCUS_COLOR, path, ++ 4 * TWIN_FIXED_ONE); ++ } ++ ++ /* Get device and iterate through options */ ++/* ++ dev = pboot_devices[pboot_dev_sel]; ++ for (i = 0; i < dev->option_count; i++) { ++ pboot_option_t *opt = &dev->options[i]; ++ twin_operand_t src; ++ ++ if (opt->title == NULL) ++ continue; ++ if (!pbt_rect_intersect(opt->box, px->clip)) ++ continue; ++ if (opt->cache == NULL) ++ pboot_draw_option_cache(dev, opt, i); ++ ++ src.source_kind = TWIN_PIXMAP; ++ src.u.pixmap = opt->cache; ++ ++ twin_composite(px, opt->box.left, opt->box.top, ++ &src, 0, 0, NULL, 0, 0, TWIN_OVER, ++ opt->box.right - opt->box.left, ++ opt->box.bottom - opt->box.top); ++ } ++*/ ++ /* Destroy path */ ++ twin_path_destroy(path); ++} ++ ++static void pbt_option_pane_mousetrack(struct pbt_menu *menu, twin_coord_t x, ++ twin_coord_t y) ++{ ++ int candidate = -1; ++ ++ if (y < PBOOT_RIGHT_OPTION_TMARGIN) ++ goto miss; ++ ++#if 0 ++ pboot_device_t *dev; ++ pboot_option_t *opt; ++ ++ if (pboot_dev_sel < 0 || pboot_dev_sel >= pboot_dev_count) ++ return; ++ ++ dev = pboot_devices[pboot_dev_sel]; ++ ++ candidate = (y - PBOOT_RIGHT_OPTION_TMARGIN) / ++ PBOOT_RIGHT_OPTION_STRIDE; ++ ++ if (candidate >= dev->option_count) { ++ candidate = -1; ++ goto miss; ++ } ++ ++ if (candidate == op->mouse_target) ++ return; ++ ++ opt = &dev->options[candidate]; ++ ++ if (x < opt->box.left || x > opt->box.right || ++ y < opt->box.top || y > opt->box.bottom) { ++ candidate = -1; ++ goto miss; ++ } ++#endif ++ ++ pbt_option_pane_set_focus(menu, candidate); ++ ++miss: ++ menu->op->mouse_target = candidate; ++} ++ ++static twin_bool_t pbt_option_pane_event(twin_window_t *window, ++ twin_event_t *event) ++{ ++ struct pbt_menu *menu = pbt_menu_from_twindow(window); ++ ++ /* filter out all mouse events */ ++ switch(event->kind) { ++ case TwinEventEnter: ++ case TwinEventMotion: ++ case TwinEventLeave: ++ pbt_menu_pane_select(menu, menu->op); ++ pbt_option_pane_mousetrack(menu, event->u.pointer.x, ++ event->u.pointer.y); ++ return TWIN_TRUE; ++ case TwinEventButtonDown: ++ pbt_menu_pane_select(menu, menu->op); ++ pbt_option_pane_mousetrack(menu, event->u.pointer.x, ++ event->u.pointer.y); ++ pbt_option_execute(menu); ++ return TWIN_TRUE; ++ case TwinEventButtonUp: ++ return TWIN_TRUE; ++ case TwinEventKeyDown: ++ switch(event->u.key.key) { ++ case KEY_UP: ++ //pbt_menu_set_option_focus(menu, menu->op->focus_curindex - 1); ++ return TWIN_TRUE; ++ case KEY_DOWN: ++ //pbt_menu_set_option_focus(menu, menu->op->focus_curindex + 1); ++ return TWIN_TRUE; ++ case KEY_LEFT: ++ pbt_menu_pane_select(menu, menu->dp); ++ return TWIN_TRUE; ++ case KEY_ENTER: ++ pbt_option_execute(menu); ++ default: ++ break; ++ } ++ break; ++ default: ++ break; ++ } ++ return TWIN_FALSE; ++} ++ ++static struct pbt_pane *pbt_option_pane_create(struct pbt_menu *menu) ++{ ++ struct pbt_pane *pane = talloc_zero(menu, struct pbt_pane); ++ ++ if (!pane) ++ return NULL; ++ ++ pane->sig = pbt_pane_sig; ++ pane->window = twin_window_create(menu->scr->tscreen, TWIN_ARGB32, ++ TwinWindowPlain, PBOOT_LEFT_PANE_SIZE, 0, ++ menu->scr->tscreen->width - PBOOT_LEFT_PANE_SIZE, ++ menu->scr->tscreen->height); ++ ++ if (!pane->window) ++ goto fail_window; ++ ++ pane->window->draw = pbt_option_pane_draw; ++ pane->window->event = pbt_option_pane_event; ++ pane->window->client_data = menu; ++ ++ pane->focus_curindex = -1; ++ pane->focus_box.left = PBOOT_RIGHT_FOCUS_XOFF; ++ pane->focus_box.top = -2 * PBOOT_RIGHT_FOCUS_HEIGHT; ++ pane->focus_box.right = pane->window->pixmap->width ++ - 2 * PBOOT_RIGHT_FOCUS_XOFF; ++ pane->focus_box.bottom = pane->focus_box.top + PBOOT_RIGHT_FOCUS_HEIGHT; ++ ++ pane->mouse_target = -1; ++ ++ twin_window_show(pane->window); ++ twin_window_queue_paint(pane->window); ++ ++ return pane; ++ ++fail_window: ++ talloc_free(pane); ++ return NULL; ++} ++ ++//============================================================================== ++// junk ++//============================================================================== ++ ++#if 0 ++ ++static pboot_device_t *pboot_devices[PBOOT_MAX_DEV]; ++static int pboot_dev_count; ++static int pboot_dev_sel = -1; ++ ++ ++ ++ ++static int pboot_vmode_change = -1; ++ ++static void pboot_message(const char *fmt, ...) ++{ ++ va_list ap; ++ char *msg; ++ ++ va_start(ap, fmt); ++ vasprintf(&msg, fmt, ap); ++ va_end(ap); ++ ++ pb_log(msg); ++} ++ ++static void pboot_draw_option_cache(pboot_device_t *dev, pboot_option_t *opt, ++ int index) ++{ ++ twin_pixmap_t *px; ++ twin_path_t *path; ++ twin_fixed_t tx, ty; ++ ++ /* Create pixmap */ ++ px = twin_pixmap_create(TWIN_ARGB32, opt->box.right - opt->box.left, ++ opt->box.bottom - opt->box.top); ++ assert(px); ++ opt->cache = px; ++ ++ /* Fill background */ ++ twin_fill(px, 0x00000000, TWIN_SOURCE, 0, 0, px->width, px->height); ++ ++ /* Allocate a path for drawing */ ++ path = twin_path_create(); ++ assert(path); ++ ++#if 0 ++ /* TEST - Bounding rectangle */ ++ twin_path_rectangle(path, 0, 0, ++ twin_int_to_fixed(px->width), ++ twin_int_to_fixed(px->height)); ++ twin_paint_path(px, PBOOT_RIGHT_TITLE_COLOR, path); ++ twin_path_empty(path); ++ twin_fill(px, 0x00000000, TWIN_SOURCE, 2, 2, ++ px->width - 3, px->height - 3); ++#endif ++ ++ /* Draw texts */ ++ twin_path_set_font_size(path, PBOOT_RIGHT_TITLE_TEXT_SIZE); ++ twin_path_set_font_style(path, TWIN_TEXT_UNHINTED); ++ tx = twin_int_to_fixed(PBOOT_RIGHT_TITLE_XOFFSET); ++ ty = twin_int_to_fixed(PBOOT_RIGHT_TITLE_YOFFSET); ++ twin_path_move (path, tx, ty); ++ twin_path_utf8 (path, opt->title); ++ twin_paint_path (px, PBOOT_RIGHT_TITLE_COLOR, path); ++ twin_path_empty (path); ++ ++ if (opt->subtitle) { ++ twin_path_set_font_size(path, PBOOT_RIGHT_SUBTITLE_TEXT_SIZE); ++ twin_path_set_font_style(path, TWIN_TEXT_UNHINTED); ++ tx = twin_int_to_fixed(PBOOT_RIGHT_SUBTITLE_XOFFSET); ++ ty = twin_int_to_fixed(PBOOT_RIGHT_SUBTITLE_YOFFSET); ++ twin_path_move (path, tx, ty); ++ twin_path_utf8 (path, opt->subtitle); ++ twin_paint_path (px, PBOOT_RIGHT_SUBTITLE_COLOR, path); ++ twin_path_empty (path); ++ } ++ ++ if (opt->badge) { ++ twin_operand_t src; ++ ++ src.source_kind = TWIN_PIXMAP; ++ src.u.pixmap = opt->badge; ++ ++ twin_composite(px, PBOOT_RIGHT_BADGE_XOFFSET, ++ PBOOT_RIGHT_BADGE_YOFFSET, ++ &src, 0, 0, NULL, 0, 0, TWIN_OVER, ++ opt->badge->width, opt->badge->height); ++ } ++ ++ ++ /* Destroy path */ ++ twin_path_destroy(path); ++} ++ ++ ++ ++static int pboot_add_option(int devindex, const char *title, ++ const char *subtitle, twin_pixmap_t *badge, void *data) ++{ ++ pboot_device_t *dev; ++ pboot_option_t *opt; ++ twin_coord_t width; ++ int index; ++ struct pbt_menu *menu = NULL; ++ ++ if (devindex < 0 || devindex >= pboot_dev_count) ++ return -1; ++ dev = pboot_devices[devindex]; ++ ++ if (dev->option_count >= PBOOT_MAX_OPTION) ++ return -1; ++ index = dev->option_count++; ++ opt = &dev->options[index]; ++ ++ opt->title = malloc(strlen(title) + 1); ++ strcpy(opt->title, title); ++ ++ if (subtitle) { ++ opt->subtitle = malloc(strlen(subtitle) + 1); ++ strcpy(opt->subtitle, subtitle); ++ } else ++ opt->subtitle = NULL; ++ ++ opt->badge = badge; ++ opt->cache = NULL; ++ ++ width = menu->op->window->pixmap->width - ++ (PBOOT_RIGHT_OPTION_LMARGIN + PBOOT_RIGHT_OPTION_RMARGIN); ++ ++ opt->box.left = PBOOT_RIGHT_OPTION_LMARGIN; ++ opt->box.right = opt->box.left + width; ++ opt->box.top = PBOOT_RIGHT_OPTION_TMARGIN + ++ index * PBOOT_RIGHT_OPTION_STRIDE; ++ opt->box.bottom = opt->box.top + PBOOT_RIGHT_OPTION_HEIGHT; ++ ++ opt->data = data; ++ return index; ++} ++ ++static void pboot_set_device_select(struct pbt_menu *menu, int sel, int force) ++{ ++ pb_log("%s: %d -> %d\n", __FUNCTION__, pboot_dev_sel, sel); ++ if (!force && sel == pboot_dev_sel) ++ return; ++ if (sel >= pboot_dev_count) ++ return; ++ pboot_dev_sel = sel; ++ if (force) { ++ menu->dp->focus_curindex = sel; ++ if (sel < 0) ++ menu->dp->focus_target = 0 - PBOOT_LEFT_FOCUS_HEIGHT; ++ else ++ menu->dp->focus_target = PBOOT_LEFT_FOCUS_YOFF + ++ PBOOT_LEFT_ICON_STRIDE * sel; ++ menu->op->focus_box.bottom = menu->dp->focus_target; ++ menu->op->focus_box.bottom = menu->op->focus_box.top + ++ PBOOT_RIGHT_FOCUS_HEIGHT; ++ twin_window_damage(menu->dp->window, ++ 0, 0, ++ menu->dp->window->pixmap->width, ++ menu->dp->window->pixmap->height); ++ twin_window_queue_paint(menu->dp->window); ++ } ++ menu->op->focus_curindex = -1; ++ menu->op->mouse_target = -1; ++ menu->op->focus_box.top = -2*PBOOT_RIGHT_FOCUS_HEIGHT; ++ menu->op->focus_box.bottom = menu->op->focus_box.top + ++ PBOOT_RIGHT_FOCUS_HEIGHT; ++ twin_window_damage(menu->op->window, 0, 0, ++ menu->op->window->pixmap->width, ++ menu->op->window->pixmap->height); ++ twin_window_queue_paint(menu->op->window); ++} ++ ++static void pboot_quit(void) ++{ ++ kill(0, SIGINT); ++} ++ ++ ++static int pboot_add_device(const char *dev_id, twin_pixmap_t *pixmap) ++{ ++ int index; ++ pboot_device_t *dev; ++ ++ struct pbt_menu *menu = NULL; ++ ++ if (pboot_dev_count >= PBOOT_MAX_DEV) ++ return -1; ++ ++ index = pboot_dev_count++; ++ ++ dev = malloc(sizeof(*dev)); ++ memset(dev, 0, sizeof(*dev)); ++ dev->id = malloc(strlen(dev_id) + 1); ++ strcpy(dev->id, dev_id); ++ dev->badge = pixmap; ++ dev->box.left = PBOOT_LEFT_ICON_XOFF; ++ dev->box.right = dev->box.left + PBOOT_LEFT_ICON_WIDTH; ++ dev->box.top = PBOOT_LEFT_ICON_YOFF + ++ PBOOT_LEFT_ICON_STRIDE * index; ++ dev->box.bottom = dev->box.top + PBOOT_LEFT_ICON_HEIGHT; ++ ++ pboot_devices[index] = dev; ++ ++ twin_window_damage(menu->dp->window, ++ dev->box.left, dev->box.top, ++ dev->box.right, dev->box.bottom); ++ twin_window_queue_paint(menu->dp->window); ++ ++ return index; ++} ++ ++static int pboot_remove_device(const char *dev_id) ++{ ++ pboot_device_t *dev = NULL; ++ int i, newsel = pboot_dev_sel; ++ ++ struct pbt_menu *menu = NULL; ++ ++ /* find the matching device */ ++ for (i = 0; i < pboot_dev_count; i++) { ++ if (!strcmp(pboot_devices[i]->id, dev_id)) { ++ dev = pboot_devices[i]; ++ break; ++ } ++ } ++ ++ if (!dev) ++ return TWIN_FALSE; ++ ++ memmove(pboot_devices + i, pboot_devices + i + 1, ++ sizeof(*pboot_devices) * (pboot_dev_count + i - 1)); ++ pboot_devices[--pboot_dev_count] = NULL; ++ ++ /* select the newly-focussed device */ ++ if (pboot_dev_sel > i) ++ newsel = pboot_dev_sel - 1; ++ else if (pboot_dev_sel == i && i >= pboot_dev_count) ++ newsel = pboot_dev_count - 1; ++ pboot_set_device_select(menu, newsel, 1); ++ ++ /* todo: free device & options */ ++ ++ return TWIN_TRUE; ++} ++#endif ++ ++//------------------------------------------------------------------------------ ++ ++static void print_version(void) ++{ ++ printf("pb-twin (" PACKAGE_NAME ") " PACKAGE_VERSION "\n"); ++} ++ ++static void print_usage(void) ++{ ++ print_version(); ++ printf( ++"Usage: pb-twin [-h, --help] [-l, --log log-file] [-r, --reset-defaults]\n" ++" [-t, --timeout] [-V, --version]\n"); ++} ++ ++/** ++ * enum opt_value - Tri-state options variables. ++ */ ++ ++enum opt_value {opt_undef = 0, opt_yes, opt_no}; ++ ++/** ++ * struct opts - Values from command line options. ++ */ ++ ++struct opts { ++ enum opt_value show_help; ++ const char *log_file; ++ enum opt_value reset_defaults; ++ enum opt_value use_timeout; ++ enum opt_value show_version; ++}; ++ ++/** ++ * opts_parse - Parse the command line options. ++ */ ++ ++static int opts_parse(struct opts *opts, int argc, char *argv[]) ++{ ++ static const struct option long_options[] = { ++ {"help", no_argument, NULL, 'h'}, ++ {"log", required_argument, NULL, 'l'}, ++ {"reset-defaults", no_argument, NULL, 'r'}, ++ {"timeout", no_argument, NULL, 't'}, ++ {"version", no_argument, NULL, 'V'}, ++ { NULL, 0, NULL, 0}, ++ }; ++ static const char short_options[] = "hl:trV"; ++ static const struct opts default_values = { ++ .log_file = "pb-twin.log", ++ }; ++ ++ *opts = default_values; ++ ++ while (1) { ++ int c = getopt_long(argc, argv, short_options, long_options, ++ NULL); ++ ++ if (c == EOF) ++ break; ++ ++ switch (c) { ++ case 'h': ++ opts->show_help = opt_yes; ++ break; ++ case 'l': ++ opts->log_file = optarg; ++ break; ++ case 't': ++ opts->use_timeout = opt_yes; ++ break; ++ case 'r': ++ opts->reset_defaults = opt_yes; ++ break; ++ case 'V': ++ opts->show_version = opt_yes; ++ break; ++ default: ++ opts->show_help = opt_yes; ++ return -1; ++ } ++ } ++ ++ return optind != argc; ++} ++ ++/** ++ * struct ps3_gui - Main gui program instance. ++ */ ++ ++ ++struct ps3_gui { ++ struct ui_timer timer; ++ struct ps3_flash_values values; ++ int dirty_values; ++ ++ struct pbt_scr scr; ++ struct pbt_frame frame; ++ struct pbt_menu *menu; ++}; ++ ++static struct ps3_gui ps3; ++ ++static struct pbt_scr *pbt_scr_from_tscreen(twin_screen_t *tscreen) ++{ ++ assert(ps3.scr.sig == pbt_scr_sig); ++ assert(ps3.scr.tscreen == tscreen); ++ return &ps3.scr; ++} ++ ++static void sig_handler(int signum) ++{ ++ DBGS("%d\n", signum); ++ ++ switch (signum) { ++ case SIGALRM: ++ ui_timer_sigalrm(&ps3.timer); ++ break; ++ case SIGWINCH: ++// if (ps3.gui) ++// gui_resize(ps3.gui); ++ break; ++ default: ++ assert(0 && "unknown sig"); ++ /* fall through */ ++ case SIGINT: ++ case SIGHUP: ++ case SIGTERM: ++ exit(EXIT_FAILURE); ++// if (ps3.gui) ++// gui_abort(ps3.gui); ++ break; ++ } ++} ++ ++/** ++ * main - twin bootloader main routine. ++ */ ++ ++int main(int argc, char *argv[]) ++{ ++ static struct sigaction sa; ++ static struct opts opts; ++ int result; ++ int ui_result; ++ unsigned int mode; ++ FILE *log; ++ ++ result = opts_parse(&opts, argc, argv); ++ ++ if (result) { ++ print_usage(); ++ return EXIT_FAILURE; ++ } ++ ++ if (opts.show_help == opt_yes) { ++ print_usage(); ++ return EXIT_SUCCESS; ++ } ++ ++ if (opts.show_version == opt_yes) { ++ print_version(); ++ return EXIT_SUCCESS; ++ } ++ ++ log = fopen(opts.log_file, "a"); ++ assert(log); ++ pb_log_set_stream(log); ++ ++#if defined(DEBUG) ++ pb_log_always_flush(1); ++#endif ++ ++ pb_log("--- pb-twin ---\n"); ++ ++ sa.sa_handler = sig_handler; ++ result = sigaction(SIGALRM, &sa, NULL); ++ result += sigaction(SIGHUP, &sa, NULL); ++ result += sigaction(SIGINT, &sa, NULL); ++ result += sigaction(SIGTERM, &sa, NULL); ++ result += sigaction(SIGWINCH, &sa, NULL); ++ ++ if (result) { ++ pb_log("%s sigaction failed.\n", __func__); ++ return EXIT_FAILURE; ++ } ++ ++ ps3.values = ps3_flash_defaults; ++ ++ if (opts.reset_defaults != opt_yes) ++ ps3.dirty_values = ps3_flash_get_values(&ps3.values); ++ ++ twin_feature_init(); // need it??? ++ ++ /* Setup screen. */ ++ ++ ps3.scr.sig = pbt_scr_sig; ++ ++#if defined(HAVE_LIBTWIN_TWIN_X11_H) ++# if defined(USE_X11) ++ if (1) { ++# else ++ if (0) { ++# endif ++ ps3.scr.x11 = twin_x11_create(XOpenDisplay(0), 1024, 768); ++ ++ if (!ps3.scr.x11) { ++ perror("failed to create x11 screen !\n"); ++ return EXIT_FAILURE; ++ } ++ ++ ps3.scr.tscreen = ps3.scr.x11->screen; ++ } else { ++#else ++ if (1) { ++#endif ++ result = ps3_get_video_mode(&mode); ++ ++ /* Current becomes default if ps3_flash_get_values() failed. */ ++ ++ if (ps3.dirty_values && !result) ++ ps3.values.video_mode = mode; ++ ++ /* Set mode if not at default. */ ++ ++ if (!result && (ps3.values.video_mode != (uint16_t)mode)) ++ ps3_set_video_mode(ps3.values.video_mode); ++ ++ ps3.scr.fbdev = twin_fbdev_create(-1, SIGUSR1); ++ ++ if (!ps3.scr.fbdev) { ++ perror("failed to create fbdev screen !\n"); ++ return EXIT_FAILURE; ++ } ++ ++ ps3.scr.tscreen = ps3.scr.fbdev->screen; ++ } ++ ++ ps3.scr.tscreen->event_filter = pbt_scr_event; ++ ++ twin_screen_set_background(ps3.scr.tscreen, ++ pbt_load_background(ps3.scr.tscreen)); ++ ++ /* setup menu */ ++ ++ ps3.menu = pbt_menu_create(NULL, &ps3.scr); ++ ++ pbt_device_pane_set_focus(ps3.menu, 0); ++ twin_screen_set_active(ps3.scr.tscreen, ps3.menu->dp->window->pixmap); ++ ++ /* Console switch */ ++ ++ if (ps3.scr.fbdev) ++ twin_fbdev_activate(ps3.scr.fbdev); ++ ++ /* run twin */ ++ ++// twin_toplevel_show(ps3.toplevel); ++ twin_dispatch(); ++ ++ pb_log("--- end ---\n"); ++ ++ return ui_result ? EXIT_FAILURE : EXIT_SUCCESS; ++} diff --git a/utils/petitboot/petitboot-config.in b/utils/petitboot/petitboot-config.in new file mode 100644 index 0000000..c5213c2 --- /dev/null +++ b/utils/petitboot/petitboot-config.in @@ -0,0 +1,65 @@ +# petitboot package config + +config PETITBOOT_GUI + bool "Enable Graphical UI support" + depends on PACKAGE_petitboot + select PACKAGE_libtwin + default y + help + Enable support a petitboot graphical front end based on + the twin windowing package. + +config PETITBOOT_CUI + bool "Enable Command-line UI support" + depends on PACKAGE_petitboot + select PACKAGE_libncurses + default y + help + Enable support a petitboot command-line front end based on + the ncurses package. + +config PETITBOOT_DEBUG + bool "Build debug versions of petitboot binaries" + depends on PACKAGE_petitboot + default n + help + Enable additional petitboot runtime checks and debug messages. + +config PETITBOOT_PS3 + bool "Build in extra support for the PS3 game console" + depends on PACKAGE_petitboot + default n + help + Enable additional petitboot runtime checks and debug messages. + +choice + prompt "Startup behavior" + default PETITBOOT_AUTORUN_GUI + depends on PETITBOOT_GUI || PETITBOOT_CUI + +config PETITBOOT_AUTORUN_GUI + bool "Auto run Petitboot GUI" + depends on PETITBOOT_GUI + help + Automatically run Petitboot in graphical mode at + system startup. Note that the Petitboot program has a menu item + 'Exit to Shell' that can be used to exit the program when + it is running. + +config PETITBOOT_AUTORUN_CUI + bool "Auto run Petitboot CUI" + depends on PETITBOOT_CUI + help + Automatically run Petitboot in command-line mode at system + startup. Note that the Petitboot program has a menu item + 'Exit to Shell' that can be used to exit the program when + it is running. + +config PETITBOOT_AUTORUN_NONE + bool "Disable Petitboot auto run" + help + Disable Petitboot from running automatically at system startup. + The system will boot into a shell. Petitboot can still be run + manually from the shell prompt when this option is selected. + +endchoice diff --git a/utils/picocom/Makefile b/utils/picocom/Makefile new file mode 100644 index 0000000..3e24c03 --- /dev/null +++ b/utils/picocom/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2006-2012 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:=picocom +PKG_VERSION:=1.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://picocom.googlecode.com/files +PKG_MD5SUM:=8eaba1d31407e8408674d6e57af447ef + +include $(INCLUDE_DIR)/package.mk + +define Package/picocom + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A minimal dumb-terminal emulation program + URL:=http://code.google.com/p/picocom/ + SUBMENU:=Terminal +endef + +define Package/picocom/description + minimal dumb-terminal emulation program +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" \ + picocom +endef + +define Package/picocom/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/picocom $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,picocom)) diff --git a/utils/pipacs/Makefile b/utils/pipacs/Makefile new file mode 100644 index 0000000..5d1b08f --- /dev/null +++ b/utils/pipacs/Makefile @@ -0,0 +1,39 @@ +# +# Copyright (C) 2006-2009 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:=pipacs +PKG_RELEASE:=2 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/pipacs + SECTION:=utils + CATEGORY:=Utilities + TITLE:=UNIX socket accounting/wiewer program +endef + +define Build/Prepare + $(CP) ./src/* $(PKG_BUILD_DIR) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + all +endef + +define Package/pipacs/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/pipacs $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,pipacs)) diff --git a/utils/pipacs/src/Makefile b/utils/pipacs/src/Makefile new file mode 100644 index 0000000..3a48e88 --- /dev/null +++ b/utils/pipacs/src/Makefile @@ -0,0 +1,14 @@ + +EXTRA_CFLAGS := -c -I. +PIPACS_OBJS := pipacs.o parser.o + +all: pipacs + +%.o: %.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $^ + +pipacs: $(PIPACS_OBJS) + $(CC) -o $@ $^ + +clean: + rm -f *.o *.so pipacs diff --git a/utils/pipacs/src/parser.c b/utils/pipacs/src/parser.c new file mode 100644 index 0000000..330d7cd --- /dev/null +++ b/utils/pipacs/src/parser.c @@ -0,0 +1,907 @@ +#include +#include +#include +#include +//#include +#include "parser.h" + +#define printit + +extern BOOL bFilter; +extern int iline; +extern char * author; +extern char myipname[]; +extern int justheader; +extern int gre,sortbysize,fromip,toip; +int nomac=1; +int mostird=0; +char mypbuff[2048]; +// accounting variables +#define MAXHASH 0xffff +#define MAXTCPPORT 4096 +unsigned long *iph=NULL; //[MAXHASH]; + +typedef struct { + unsigned short from; + unsigned short to; + unsigned long byte; + unsigned short pkt; + unsigned short sport; + unsigned short dport; +} ta; + +ta *acc = NULL; +unsigned long tcppb[MAXTCPPORT]; +unsigned long tcppp[MAXTCPPORT]; +unsigned long typp[255]; +unsigned long typb[255]; +unsigned long udpb,tcpb,udpp,tcpp; +time_t elapsed=0; +int iCycle=10; +int iScreen=1; +int iFile=0; +long lNum=0; +char filename[128]; +char intlist[128]; +int iRun=1; +int iDetail=0; +FILE *f=NULL; +int iProto=0; +int iSum=0; +char execname[255]; +char pbuf[8196]; +char str[255]; +extern char pattern[]; +#ifndef LINUX +int iLnxplus=0; // Windows buffer without the MAC frame ! +#else +int iLnxplus=14; // Linux plus IP header len =14 !!! +#endif +// +// A list of protocol types in the IP protocol header +// +char *szProto[255] = {"IP", // 0 + "ICMP", // 1 + "IGMP", // 2 + "GGP", // 3 + "IP", // 4 + "ST", // 5 + "TCP", // 6 + "UCL", // 7 + "EGP", // 8 + "IGP", // 9 + "BBN-RCC-MON", // 10 + "NVP-II", // 11 + "PUP", // 12 + "ARGUS", // 13 + "EMCON", // 14 + "XNET", // 15 + "CHAOS", // 16 + "UDP", // 17 + "MUX", // 18 + "DCN-MEAS", // 19 + "HMP", // 20 + "PRM", // 21 + "XNS-IDP", // 22 + "TRUNK-1", // 23 + "TRUNK-2", // 24 + "LEAF-1", // 25 + "LEAF-2", // 26 + "RDP", // 27 + "IRTP", // 28 + "ISO-TP4", // 29 + "NETBLT", // 30 + "MFE-NSP", // 31 + "MERIT-INP", // 32 + "SEP", // 33 + "3PC", // 34 + "IDPR", // 35 + "XTP", // 36 + "DDP", // 37 + "IDPR-CMTP", // 38 + "TP++", // 39 + "IL", // 40 + "SIP", // 41 + "SDRP", // 42 + "SIP-SR", // 43 + "SIP-FRAG", // 44 + "IDRP", // 45 + "RSVP", // 46 + "GRE", // 47 + "MHRP", // 48 + "BNA", // 49 + "IPSEC-ESP", // 50 + "IPSEC-AH", // 51 + "I-NLSP", // 52 + "SWIPE", // 53 + "NHRP", // 54 + "?55?", // 55 + "?56?", // 56 + "SKIO", // 57 + "V6ICMP", // 58 + "V6NoNXT", // 59 + "V6OPT", // 60 + "int.host", // 61 + "CFTP", // 62 + "loc.net", // 63 + "SAT-EXPAK", // 64 + "KRYPTOLAN", // 65 + "RVD", // 66 + "IPPC", // 67 + "dist.fs", // 68 + "SAT-MON", // 69 + "VISA", // 70 + "IPCV", // 71 + "CPNX", // 72 + "CPHB", // 73 + "WSN", // 74 + "PVP", // 75 + "BR-SAT-MON", // 76 + "SUN-ND", // 77 + "WB-MON", // 78 + "WB-EXPAK", // 79 + "ISO-IP", // 80 + "VMTP", // 81 + "SECURE-VMTP",// 82 + "VINES", // 83 + "TTP", // 84 + "NSFNET-IGP", // 85 + "DGP", // 86 + "TCF", // 87 + "IGRP", // 88 + "OSPF", // 89 + "Sprite-RPC", // 90 + "LARP", // 91 + "MTP", // 92 + "AX.25", // 93 + "IPIP", // 94 + "MICP", // 95 + "SCC-SP", // 96 + "ETHERIP", // 97 + "ENCAP", // 98 + "priv.enc", // 99 + "GMTP" // 99 + }; +// +// The types of IGMP messages +// +char *szIgmpType[] = {"", + "Host Membership Query", + "HOst Membership Report", + "", + "", + "", + "Version 2 Membership Report", + "Leave Group", + "", + "" + }; + +// +// Function: PrintRawBytes +// +// Description: +// This function simply prints out a series of bytes +// as hexadecimal digits. +// +void PrintRawBytes(BYTE *ptr, DWORD len) +{ + int i,j; +// if (! iFile) { +*(ptr+len)=0; +if ((*pattern==0) || strstr(ptr,pattern) ) { + fprintf(iFile?f:stdout,"%s",pbuf); + fprintf(iFile?f:stdout," " ); + while (len > 0) { + for(i=0; i < 16; i++) { + fprintf(iFile?f:stdout,"%x%x ", HI_WORD(*ptr), LO_WORD(*ptr)); + len--; + ptr++; + if (len == 0) {j=i++; while(++j < 16) fprintf(iFile?f:stdout," "); break; } + } + fprintf(iFile?f:stdout," "); + for(j=0; j < i; j++) fprintf(iFile?f:stdout,"%c",isprint(*(ptr-i+j))?*(ptr-i+j):'.'); + if (len) fprintf(iFile?f:stdout,"\n "); + } +// } else { +// fwrite(ptr,sizeof(BYTE),len,f); +// } +} +} + +static char *ICMPTypeTable[]={ + "Echo Reply", "ICMP 1", "ICMP 2", "Dest Unreachable","SrcQuench", "Redirect", "6", "7","Echo Request","9","10", + "Time Exceed", "ParamPrblm", "Timestamp", "Timestamp reply","InfoRqst", "InfoRply" +}; +static char *Dstunreach[]={ +"net unreach.","host unreach.","protocol unreach.","port unreach.", +"frag needed","source route?","","" +}; +int DecodeICMPHeader(WSABUF *wsabuf, DWORD iphdrlen) { + BYTE *hdr = (BYTE *)((BYTE *)wsabuf->buf + iphdrlen + iLnxplus ); + unsigned short type,code,chksum, + id, + seq; + unsigned long resptime,r1,r2; + BYTE *hhh; + SOCKADDR_IN addr; + type=*hdr++; code=*hdr++; + sprintf(str," Type:%-12s Code:%3d,",ICMPTypeTable[type],code); + + strcat(pbuf,str); + memcpy(&chksum, hdr, 2); + hdr += 2; hhh=hdr; + memcpy(&id, hdr, 2); + hdr += 2; + memcpy(&seq, hdr, 2); + hdr+=2; +// memcpy(&resptime, hdr, 4); +// hdr+=4; + switch (type) { + case 3: + memcpy(&addr.sin_addr.s_addr, hdr+16, 4); + if (code==4 ) sprintf(str,"frag needed-Max MTU:%u at %-15s\n",ntohs(seq), inet_ntoa(addr.sin_addr)); + else sprintf(str,"%s at %-15s\n",Dstunreach[code&7],inet_ntoa(addr.sin_addr)); + hdr+=iphdrlen; + break; + case 11: + memcpy(&addr.sin_addr.s_addr, hdr+16, 4); + sprintf(str,"%s at %-15s\n",code?"frag reass. exceed":"ttl exceed",inet_ntoa(addr.sin_addr)); + hdr+=iphdrlen; + break; + case 12: + memcpy(&addr.sin_addr.s_addr, hdr+16, 4); + sprintf(str," err:%d at %-15s\n",id,inet_ntoa(addr.sin_addr)); + hdr+=iphdrlen; + break; + case 4: + memcpy(&addr.sin_addr.s_addr, hdr+16, 4); + sprintf(str," wait for %-15s\n",ntohs(id),inet_ntoa(addr.sin_addr)); + hdr+=iphdrlen; + break; + case 5: + memcpy(&addr.sin_addr.s_addr, hhh, 4); + sprintf(str," from gw: %-15s\n",inet_ntoa(addr.sin_addr)); + hdr+=iphdrlen; + break; + case 0: + case 8: + sprintf(str," Id:%3u Seq:%3u\n",ntohs(id),ntohs(seq)); + break; + case 13: + case 14: + memcpy(&resptime, hdr, 4); + hdr+=4; + memcpy(&r1, hdr, 4); + hdr+=4; + memcpy(&r2, hdr, 4); + hdr+=4; + sprintf(str," Id:%3u Seq:%3d Rec/Tr %ld/%ld ms\n",ntohs(id),ntohs(seq),ntohl(r1)-ntohl(resptime),ntohl(r2)-ntohl(resptime)); + break; + case 15: + case 16: + sprintf(str," Id:%3u Seq:%3d\n",ntohs(id),ntohs(seq)); + break; + } + strcat(pbuf,str); + return hdr-(BYTE *)(wsabuf->buf + iphdrlen + iLnxplus); +} + +// +// Function: DecodeIGMPHeader +// +// Description: +// This function takes a pointer to a buffer containing +// an IGMP packet and prints it out in a readable form. +// + +int DecodeIGMPHeader(WSABUF *wsabuf, DWORD iphdrlen) { + BYTE *hdr = (BYTE *)((BYTE *)wsabuf->buf + iphdrlen + iLnxplus); + unsigned short chksum, + version, + type, + maxresptime; + SOCKADDR_IN addr; + version = HI_WORD(*hdr); + type = LO_WORD(*hdr); + + hdr++; + maxresptime = *hdr; + hdr++; + + memcpy(&chksum, hdr, 2); + chksum = ntohs(chksum); + hdr += 2; + + memcpy(&(addr.sin_addr.s_addr), hdr, 4); + sprintf(str," IGMP HEADER:\n"); + strcat(pbuf,str); + if ((type == 1) || (type == 2)) version = 1; + else version = 2; + sprintf(str," IGMP Version = %d\n IGMP Type = %s\n",version, szIgmpType[type]); + strcat(pbuf,str); + if (version == 2) { + sprintf(str," Max Resp Time = %d\n", maxresptime); + strcat(pbuf,str); + } + sprintf(str," IGMP Grp Addr = %s\n", inet_ntoa(addr.sin_addr)); + strcat(pbuf,str); + + return 8; +} + +// +// Function: DecodeUDPHeader +// +// Description: +// This function takes a buffer which points to a UDP +// header and prints it out in a readable form. +// +int DecodeUDPHeader(WSABUF *wsabuf, DWORD iphdrlen) { + BYTE *hdr = (BYTE *)((BYTE *)wsabuf->buf + iphdrlen + iLnxplus); + unsigned short shortval, + udp_src_port, + udp_dest_port, + udp_len, + udp_chksum; + memcpy(&shortval, hdr, 2); + udp_src_port = ntohs(shortval); + hdr += 2; + + memcpy(&shortval, hdr, 2); + udp_dest_port = ntohs(shortval); + hdr += 2; + + memcpy(&shortval, hdr, 2); + udp_len = ntohs(shortval); + hdr += 2; + + memcpy(&shortval, hdr, 2); + udp_chksum = ntohs(shortval); + hdr += 2; + + sprintf(str," UDP: SPort: %-05d | DPort: %-05d",udp_src_port, udp_dest_port); + strcat(pbuf,str); + sprintf(str," | Len: %-05d | CSum: 0x%08x\n",udp_len, udp_chksum); + strcat(pbuf,str); + return hdr-(BYTE *)(wsabuf->buf + iphdrlen + iLnxplus); +} + +// +// Function: DecodeTCPHeader +// +// Description: +// This function takes a buffer pointing to a TCP header +// and prints it out in a readable form. +// +int DecodeTCPHeader(WSABUF *wsabuf, DWORD iphdrlen) { + BYTE *hdr = (BYTE *)((BYTE *)wsabuf->buf + iphdrlen + iLnxplus); + unsigned short shortval; + unsigned long longval; + + memcpy(&shortval, hdr, 2); + shortval = ntohs(shortval); + sprintf(str," TCP: SPort: %u", shortval); + strcat(pbuf,str); + hdr += 2; + + memcpy(&shortval, hdr, 2); + shortval = ntohs(shortval); + sprintf(str," DPort: %u", shortval); + strcat(pbuf,str); + hdr += 2; + + memcpy(&longval, hdr, 4); + longval = ntohl(longval); + sprintf(str," Seq: %lX", longval); + strcat(pbuf,str); + hdr += 4; + + memcpy(&longval, hdr, 4); + longval = ntohl(longval); + sprintf(str," ACK: %lX", longval); + strcat(pbuf,str); + hdr += 4; +// printf(" Header Len : %d (bytes %d)\n", HI_WORD(*hdr), (HI_WORD(*hdr) * 4)); + + memcpy(&shortval, hdr, 2); + shortval = ntohs(shortval) & 0x3F; + sprintf(str," Flags: "); + strcat(pbuf,str); + if (shortval & 0x20) strcat(pbuf,"URG "); + if (shortval & 0x10) strcat(pbuf,"ACK "); + if (shortval & 0x08) strcat(pbuf,"PSH "); + if (shortval & 0x04) strcat(pbuf,"RST "); + if (shortval & 0x02) strcat(pbuf,"SYN "); + if (shortval & 0x01) strcat(pbuf,"FIN "); + strcat(pbuf,"\n"); + hdr += 2; + + memcpy(&shortval, hdr, 2); + shortval = ntohs(shortval); +// printf(" Window size: %d\n", shortval); + hdr += 2; + + memcpy(&shortval, hdr, 2); + shortval = ntohs(shortval); +// printf(" TCP Chksum : %d\n", shortval); + hdr += 2; + + memcpy(&shortval, hdr, 2); + shortval = ntohs(shortval); + hdr += 2; +// printf(" Urgent ptr : %d\n", shortval); + + return hdr-(BYTE *)(wsabuf->buf + iphdrlen + iLnxplus); +} + +int DecodeGREHeader(WSABUF *wsabuf, DWORD iphdrlen,DWORD bytesret, + unsigned int srcip, unsigned short srcport, unsigned long srcnet,unsigned int destip, unsigned short destport, unsigned long destnet, + unsigned short xport,unsigned int xip, unsigned long xnet) + { + BYTE *hdr = (BYTE *)((BYTE *)wsabuf->buf + iphdrlen + iLnxplus); + unsigned short shortval; + unsigned long longval; + int ipe; + BYTE *orihdr; + char *sstr; + SOCKADDR_IN srcaddr; + + orihdr=hdr; + memcpy(&shortval, hdr, 2); + shortval = ntohs(shortval); + sprintf(str," GRE Flag: %u Prot:", shortval); + strcat(mypbuff,str); + hdr += 2; + + memcpy(&shortval, hdr, 2); + shortval = ntohs(shortval); + ipe=0; + sstr=str; +// sprintf(str," Prot: %u", shortval); + switch ( shortval ) { + case 4: sstr="SNA"; + break; + case 0xfe: sstr="OSI"; + break; + case 0x200: sstr="PUP"; + break; + case 0x600: sstr="XNS"; + break; + case 0x800: sstr="IP"; + ipe=1; + break; + case 0x804: sstr="Chaos"; + break; + case 0x806: sstr="ARP"; + break; + case 0x6558: sstr="Tr.bridge"; + break; + default: sprintf(str,"%u", shortval); + break; + } + hdr += 2; + strcat(mypbuff,sstr); + if (ipe && gre) { + int plusment,jj,protoment; + plusment=iLnxplus; + protoment=iProto; + if (iProto==47) iProto=0; + iLnxplus+=4; + nomac=0; + iLnxplus=plusment+24; + DecodeIPHeader(wsabuf,srcip,srcport,srcnet,destip,destport,destnet,bytesret,xport,xip,xnet); + nomac=1; + iLnxplus=plusment; + iProto=protoment; + } +return -1; +// return hdr-(BYTE *)(wsabuf->buf + iphdrlen + iLnxplus); +} + + +int ClearIPAcc() { + unsigned long i; + ta *tai; + for(i=0;ifrom=tai->to=0; tai++; } + for (i=0;ibyte > d2->byte) return -1; + if (d1->byte < d2->byte) return 1; + return 0; +} +int countsort(const void *s1, const void *s2) { // sorting tale in packet count order + ta *d1; + ta *d2; + d1= (ta *)s1; d2=(ta *)s2; + if (d1->pkt > d2->pkt) return -1; + if (d1->pkt < d2->pkt) return 1; + return 0; +} +int CloseIPAcc( long ti) { + unsigned long i; + ta *tai; + SOCKADDR_IN srcaddr; + SOCKADDR_IN dstaddr; + float ff; + char str[16]; + unsigned long j,k,l; + int lin=0; + int linn; + + time(&elapsed); + if (iFile) f=fopen(filename,"w+"); + k=0; + if (sortbysize) qsort(acc,MAXHASH,sizeof(ta),bytesort); + else qsort(acc,MAXHASH,sizeof(ta),countsort); + ff=0.0; + for (i=0;i<255;i++) ff+=typb[i]; + for (i=0; ifrom!=0) && (tai->to!=0)) ++k; + } + if (iScreen) { +#ifndef LINUX + system("cls"); +#else + system("clear"); +// printf("\033[1~"); +#endif + printf("%-16s Speed: %5.2f Kbit/s , %ld IP pairs / %ld secs. %s@%s.hu",myipname,ff/ti/1024*8,k,ti,author,author); + printf("\nProt:"); j=0; ++lin; + while (1) { + l=k=0; + for (i=0;i<100;i++) if ( typb[i]>k) { k=typb[i]; l=i; } + if (k==0) break; + if ((j>0) && ((j%3)==0)) { printf("\n "); ++lin; } + if (k>1024*1024) printf(" %-8.8s:%5.1fk/%-6.1f M",szProto[l],(float)typp[l]/1024,(float)k/(1024*1024)); + else if (k>1024) printf(" %-8.8s:%5ld/%-6.1f k",szProto[l],typp[l],(float)k/1024); + else printf(" %-8.8s:%5ld/%-8ld",szProto[l],typp[l],k); + typb[l]=0; + ++j; + } + printf("\nPort:"); j=0; ++lin; + k=0; linn=lin; + while (1) { + l=k=0; + for (i=0;ik) { k=tcppb[i]; l=i; } + if (k==0) break; + if (j && (j%4)==0) { + if (lin >= linn+1) break; + printf("\n "); + ++lin; + } + if (k>1024*1024) printf(" %04d:%4.1fk/%-5.1f M",l,(float)tcppp[l]/1024,(float)k/(1024*1024)); + else if (k>1024) printf(" %04d:%4ld/%-5.1f k",l,tcppp[l],(float)k/1024); + else printf(" %04d:%4ld/%-7ld",l,tcppp[l],k); + tcppb[l]=0; + ++j; + } + } else if (f) { + fprintf(f,"%-16s Speed: %5.2f Kbit/s , %ld IP pairs / %ld secs. %s@%s.hu",myipname,ff/ti/1024*8,k,ti,author,author); + fprintf(f,"\nProt:"); j=0; + while (1) { + l=k=0; + for (i=0;i<100;i++) if ( typb[i]>k) { k=typb[i]; l=i; } + if (k==0) break; + if (k>1024*1024) fprintf(f," %-8.8s:%5.1fk/%-6.1f M",szProto[l],(float)typp[l]/1024,(float)k/(1024*1024)); + else if (k>1024) fprintf(f," %-8.8s:%5ld/%-6.1f k",szProto[l],typp[l],(float)k/1024); + else fprintf(f," %-8.8s:%5ld/%-8ld",szProto[l],typp[l],k); + typb[l]=0; + ++j; + } + printf("\nPort:"); j=0; + k=0; linn=lin; + while (1) { + l=k=0; + for (i=0;ik) { k=tcppb[i]; l=i; } + if (k==0) break; + if (k>1024*1024) fprintf(f," %04d:%4.1fk/%-5.1f M",l,(float)tcppp[l]/1024,(float)k/(1024*1024)); + else if (k>1024) fprintf(f," %04d:%4ld/%-5.1f k",l,tcppp[l],(float)k/1024); + else fprintf(f," %04d:%4ld/%-7ld",l,tcppp[l],k); + tcppb[l]=0; + ++j; + } + } + + for (i=0; ifrom!=0) && (tai->to!=0)) { ++k; + if (!iSum) { + dstaddr.sin_addr.s_addr = htonl(*(iph+tai->from)); + srcaddr.sin_addr.s_addr = htonl(*(iph+(tai->to))); + strcpy(str,inet_ntoa(dstaddr.sin_addr)); + if (iScreen && (++linpkt,tai->byte,((float)tai->byte)/ti/1024*8); + if (f) fprintf(f,"%-15s\t%-15s\t%d\t%ld\n",str,inet_ntoa(srcaddr.sin_addr),tai->pkt,tai->byte); + } + } + } + if (iScreen) printf("\n"); +#ifdef LINUX + if (iScreen) fflush(stdout); +#endif + ClearIPAcc(); + if (f) { + char cmdline[255]; + fclose(f); +// if (*execname) _spawnle(_P_NOWAIT,execname,execname,filename); +// if (*execname) _execl(execname,execname); + if (*execname) { +#ifndef LINUX + sprintf(cmdline,"%s %s",execname,filename); +#else + sprintf(cmdline,"%s %s",execname,filename); +#endif + system(cmdline); +// iRun=0; + } + } + f=NULL; + return 0; +} + +unsigned short FindIPHash( unsigned long ip ) { + unsigned short hashval; + unsigned long *ipt; + + hashval = (unsigned short)(((ip&0xFFFF0000)>>16) ^ (ip&0x0000FFFF)); + ipt=iph + hashval; + while (*ipt != 0 && (*ipt!=ip)) { ipt++; hashval++; } + if (*ipt==0) *ipt=ip; + return hashval; +} + +unsigned short SetIPAcc( unsigned long src, unsigned long dst, unsigned long byte, unsigned short typ, unsigned short sport, unsigned short dport) { + unsigned short from,to,hash; + ta *tai; + hash=0; + if (src) { + + if (fromip) from=FindIPHash(src); else from=-1; + if (toip) to=FindIPHash(dst); else to=-1; + hash=from^to; + tai=acc + hash; + while ( ((tai->from!=from) && (tai->to!=to)) && ((tai->from!=0) && (tai->to!=0)) ) {tai++; hash++; } + if ((tai->from==0)&&(tai->to==0)) { + tai->byte=byte; tai->from=from; tai->to=to; tai->pkt=1; + } else { tai->byte+=byte; tai->pkt++; } + + typp[typ]++; + typb[typ]+=byte; + if ((sport>0) && (sport0) && (dportbuf, + *nexthdr = NULL, + *ohdr; + unsigned short shortval; + SOCKADDR_IN srcaddr, + destaddr; + + unsigned short ip_version, + ip_hdr_len, + ip_tos, + ip_total_len, + ip_id, + ip_flags, + ip_ttl, + ip_frag_offset, + ip_proto, + ip_hdr_chksum, + ip_src_port, + ip_dest_port; + unsigned int ip_src, + ip_dest; + BOOL bPrint = FALSE; + char ip_prtype=0; + int j; + time_t tt; + struct tm *tmm; + + ohdr=hdr; + if (iLnxplus) ip_prtype=*(hdr+iLnxplus-1); + if (ip_prtype) return 0; + hdr += iLnxplus; + ip_version = HI_WORD(*hdr); + ip_hdr_len = LO_WORD(*hdr) * 4; + nexthdr = (BYTE *)((BYTE *)hdr + ip_hdr_len); + hdr++; + + ip_tos = *hdr; + hdr++; + + memcpy(&shortval, hdr, 2); + ip_total_len = ntohs(shortval); + hdr += 2; + + memcpy(&shortval, hdr, 2); + ip_id = ntohs(shortval); + hdr += 2; + + ip_flags = ((*hdr) >> 5); + + memcpy(&shortval, hdr, 2); + ip_frag_offset = ((ntohs(shortval)) & 0x1FFF); + hdr += 2; + + ip_ttl = *hdr; + hdr++; + + ip_proto = *hdr; + hdr++; + + memcpy(&shortval, hdr, 2); + ip_hdr_chksum = ntohs(shortval); + hdr += 2; + + memcpy(&srcaddr.sin_addr.s_addr, hdr, 4); + ip_src = ntohl(srcaddr.sin_addr.s_addr); + hdr += 4; + + memcpy(&destaddr.sin_addr.s_addr, hdr, 4); + ip_dest = ntohl(destaddr.sin_addr.s_addr); + hdr += 4; + // + // If packet is UDP, TCP, or IGMP read ahead and + // get the port values. + // + ip_src_port=ip_dest_port=0; + if (((ip_proto == 2) || + (ip_proto == 6) || + (ip_proto == 17)) ) //&& bFilter) + { + memcpy(&ip_src_port, nexthdr, 2); + ip_src_port = ntohs(ip_src_port); + memcpy(&ip_dest_port, nexthdr+2, 2); + ip_dest_port = ntohs(ip_dest_port); + + }; + bPrint = 0; +// xaok= (xip!=0) && (((xip&xnet)==(ip_src&xnet))||((xip&xnet)==(ip_dest&xnet))); +// saok= ((srcip==0)||((srcip&srcnet)==(ip_src&srcnet))); +// daok = ((destip==0)||((destip&destnet)==(ip_dest&destnet))); +// xpok=(xport!=0) && ((xport==ip_src_port)||(xport==ip_dest_port)); +// spok=((srcport==0)||(srcport == ip_src_port)); +// dpok=((destport==0)||(destport == ip_dest_port)); +//printf("\nf:%d xa:%d sa:%d da:%d xp:%d sp:%d dp:%d",bFilter,xaok,saok,daok,xpok,spok,dpok); +// if (!bFilter || ( (xaok||(saok&&daok)) && (xpok||(spok&&dpok)))) { +if ((!bFilter) || ((ip_proto==47)&&gre) || + ( + ((iProto==0)||(ip_proto==iProto)) && + ( + ((xip!=0) && (((xip&xnet)==(ip_src&xnet))||((xip&xnet)==(ip_dest&xnet))) + ) || ( + ((srcip==0) || ((srcip&srcnet)==(ip_src&srcnet))) && ((destip==0)||((destip&destnet)==(ip_dest&destnet))) + ) + ) + && + ( + ((xport!=0) && ((xport==ip_src_port)||(xport==ip_dest_port)) + ) || ( + ((srcport==0)||(srcport == ip_src_port))&&((destport==0)||(destport == ip_dest_port)) + ) + ) + ) + ) { + if (! iDetail) { + if ((ip_proto==47)&&gre) { + *mypbuff=0; + DecodeGREHeader(wsabuf, ip_hdr_len, bytesret, + srcip,srcport,srcnet,destip,destport,destnet,xport,xip,xnet); +// SetIPAcc(0,0,0,0,0,0); + return ip_hdr_len; + } + SetIPAcc(ip_src,ip_dest,ip_total_len,ip_proto,ip_src_port,ip_dest_port); + } + else bPrint=TRUE; +// printf("%d %ld %ld %ld %ld",ip_proto,xip,xip&xnet,ip_src&xnet,ip_dest&xnet); + } else { + if (! iDetail) SetIPAcc(0,0,0,0,0,0); +// else bPrint=TRUE; + } + time(&tt); + if ((!iSum && ( tt-elapsed > iCycle)) || !iRun || mostird) { + mostird=0; + if (! iDetail) CloseIPAcc(tt-elapsed-1); + else { + time(&elapsed); + if (f) fclose(f); + if (iFile) f=fopen(filename,"a"); + } + } + if (lNum) { if (--lNum <= 0) iRun=0; } + + // + *pbuf=0; + if (bPrint) { + tmm=localtime(&tt); +if (! nomac ) { + strcpy(pbuf,mypbuff); +} else { + sprintf(str,"\n%4.4d.%2.2d.%2.2d %2.2d:%2.2d:%2.2d ", + tmm->tm_year+1900,tmm->tm_mon+1,tmm->tm_mday,tmm->tm_hour,tmm->tm_min,tmm->tm_sec); + strcat(pbuf,str); +#ifdef LINUX + sprintf(str,"%x:%x:%x:%x:%x:%x > %x:%x:%x:%x:%x:%x",*ohdr,*(ohdr+1),*(ohdr+2),*(ohdr+3),*(ohdr+4),*(ohdr+5), + *(ohdr+6),*(ohdr+7),*(ohdr+8),*(ohdr+9),*(ohdr+10),*(ohdr+11)); + strcat(pbuf,str); +#endif +} + sprintf(str," %d bytes\n%-15s>", ip_total_len, inet_ntoa(srcaddr.sin_addr)); + strcat(pbuf,str); + sprintf(str,"%-15s", inet_ntoa(destaddr.sin_addr)); + strcat(pbuf,str); + sprintf(str," TTL:%-3d Proto:%-6s F:%d/%d TOS:%X%X\n", + ip_ttl, szProto[ip_proto],ip_flags,ip_frag_offset,HI_WORD(ip_tos), LO_WORD(ip_tos)); + strcat(pbuf,str); + if (iFile) strcat(pbuf,"."); + strcpy(mypbuff,pbuf); + + } + else return ip_hdr_len; + + if (justheader) { if (*pbuf) fprintf(iFile?f:stdout,"%s",pbuf); return ip_hdr_len; } + if (iDetail) { + switch (ip_proto) { + case 1: // ICMP + j=DecodeICMPHeader(wsabuf, ip_hdr_len); + break; + case 2: // IGMP + j=DecodeIGMPHeader(wsabuf, ip_hdr_len); + break; + case 6: // TCP + j=DecodeTCPHeader(wsabuf, ip_hdr_len); + break; + case 17: // UDP + j=DecodeUDPHeader(wsabuf, ip_hdr_len); + break; + case 47: // UDP + j=DecodeGREHeader(wsabuf, ip_hdr_len, bytesret, + srcip,srcport,srcnet,destip,destport,destnet,xport,xip,xnet); + break; + default: + j=0; hdr=(BYTE *)wsabuf->buf; + sprintf(str," No decoder installed for protocol\n"); + strcat(pbuf,str); + break; + } + if (j>=0) PrintRawBytes(hdr+j,bytesret-j-ip_hdr_len-12); //(hdr-(BYTE *)(wsabuf->buf + iLnxplus))); + } + else if (*pbuf) fprintf(iFile?f:stdout,"%s",pbuf); + + return ip_hdr_len; +} diff --git a/utils/pipacs/src/parser.h b/utils/pipacs/src/parser.h new file mode 100644 index 0000000..aedaeaf --- /dev/null +++ b/utils/pipacs/src/parser.h @@ -0,0 +1,60 @@ +#define LINUX 1 +#ifdef LINUX +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define BYTE unsigned char +#define DWORD unsigned long +#define BOOL char +#define TRUE 1 +#define FALSE 0 +#define WSADATA int +#define SOCKET int +#define SOCKADDR struct sockaddr +#define SOCKADDR_IN struct sockaddr_in +typedef struct _WSABUF { + unsigned long len; + unsigned char *buf; +} WSABUF; +#define SIO_RCVALL 0 +#define SIO_RCVALL_IGMPMCAST 0 +#define SIO_RCVALL_MCAST 0 +#define ETH_P_ALL 0x0003 +#else // WINDOWS + +#include +#include + +#endif + +#ifndef _RCVALL_H_ +#define _RCVALL_H_ + + +#define MAX_IP_SIZE 65535 +#define MIN_IP_HDR_SIZE 20 + +#define HI_WORD(byte) (((byte) >> 4) & 0x0F) +#define LO_WORD(byte) ((byte) & 0x0F) + +extern char *szProto[]; + + + +void PrintRawBytes (BYTE *ptr, DWORD len); +int DecodeIGMPHeader(WSABUF *wsabuf, DWORD iphdrlen); +int DecodeUDPHeader (WSABUF *wsabuf, DWORD iphdrlen); +int DecodeTCPHeader (WSABUF *wsabuf, DWORD iphdrlenz); +int DecodeIPHeader (WSABUF *wasbuf, unsigned int srcaddr, unsigned short srcport, unsigned long srcnet, + unsigned int destaddr, unsigned short destport, unsigned long destnet, DWORD bytesret, + unsigned short xport, unsigned int xip, unsigned long xnet); + +#endif diff --git a/utils/pipacs/src/pipacs.c b/utils/pipacs/src/pipacs.c new file mode 100644 index 0000000..4087cd3 --- /dev/null +++ b/utils/pipacs/src/pipacs.c @@ -0,0 +1,589 @@ +// http://www.phj.hu/freesoft.asp +#include +#include +#include "parser.h" + +#ifndef LINUX +#include +#include +#else +#include +struct promisc_device +{ + char name[16]; /* name (e.g. eth0) */ + + int reset; /* do we have to reset it on exit ? */ + struct ifreq oldifr; /* old settings */ + + struct promisc_device *next; +}; + +#endif + +DWORD dwIoControlCode=SIO_RCVALL; +DWORD dwProtocol=IPPROTO_IP, dwInterface=0; + +#define MAXVER 2 +#define MINVER 6 +SOCKET s; + +// +// Filters (Globals) +// +unsigned int uiSourceAddr=0, uiDestAddr=0, uiXAddr=0; +unsigned short usSourcePort = 0, usDestPort = 0, usXPort = 0; +unsigned short usSourceNet = 32, usDestNet = 32, usXNet = 32; +unsigned long ulDestNet=0xffffffff, ulSourceNet=0xffffffff, ulXNet=0xffffffff; +BOOL bFilter=FALSE; +int iline=25; +char myipname[64]; +char pattern[1024]; +int justheader=0; +int gre=0; +int sortbysize,fromip,toip; +int skipvlan=0; + +extern char filename[128]; + +extern char intlist[128]; + +#ifndef LINUX +void PrintInterfaceList( void ); +int GetInterface(SOCKET , SOCKADDR_IN *, int ); +#endif +extern int InitIPAcc( void ); +extern int CloseIPAcc( void ); +extern int iCycle; +extern int iScreen; +extern int iFile; +extern int iDetail; +extern int iRun; +extern long lNum; +extern FILE *f; +extern int iProto; +extern int iSum; +extern char execname[]; +extern int mostird; +extern int iLnxplus; + +int set_raw_mode(void) +{ + int fd = STDIN_FILENO; + struct termios t; + + if (tcgetattr(fd, &t) < 0) { perror("tcgetattr"); return -1; } + t.c_lflag &= ~ICANON; + if (tcsetattr(fd, TCSANOW, &t) < 0) { perror("tcsetattr"); return -1; } + setbuf(stdin, NULL); + return 0; +}// +// Function: usage +// +// Description: +// Prints usage information. +// +char *author = "phj"; + +void usage(char *progname) +{ + printf(" usage: %s options\n where options:\n", progname); + printf(" [-c:sec] Dump cycle in sec (10)\n"); + printf(" [-f:file[-e:program]] Results into a file [and exec program](-)\n"); + printf(" [-n:db] Execute just db cycle (0)\n"); + printf(" [-l:lineno] Print lineno lines of hosts(25)\n"); + printf(" [-k] Sort result by packet count (size)\n"); + printf(" [-1] Ignore source IP (don't ignore)\n"); + printf(" [-2] Ignore destination IP (don't ignore)\n"); + printf(" [-h] Print just the header(use -a!)\n"); + printf(" [-a] Print packet info&data (-)\n"); + printf(" [-p] Print just summary info (-)\n"); + printf(" Otherwise print sum&ip pairs\n"); +//#ifndef LINUX + printf(" [-t:[tcp|udp|icmp|....|number]] Filter on IP protocoll (ALL)\n"); +//#endif + printf(" [-g] Make GRE encapsulation trasparent (-)\n"); + printf(" [-v] Skip VLAN headers (-)\n"); + printf(" [-sa:IP[/Net]] Filter on source address (-)/net\n"); + printf(" [-sp:Port] Filter on source port (-)\n"); + printf(" [-da:IP[/Net]] Filter on dest address/net (-)\n"); + printf(" [-dp:Port] Filter on dest port(-)\n"); + printf(" [-xa:IP[/Net]] Filter on src|dest address/net (-)\n"); + printf(" [-xp:Port] Filter on src|dest port (-)\n"); + printf(" [-pa:pattern] String match (0), last param!!!\n"); +#ifndef LINUX + printf(" [-i:int] Capture on this interface (0)\n"); + printf(" Available interfaces:\n"); + PrintInterfaceList(); +#else + printf(" [-i:int[,int]] Capture on this interface (eth0)\n"); +#endif + printf(" Filtering rules: t && (sa|da|xa) && (sp|dp|xp)"); + printf("\nVer. %d.%d (c):2000-2006, P l¢czi-Horv th J nos\n",MAXVER,MINVER); +#ifndef LINUX + WSACleanup(); + ExitProcess(-1); +#else + exit(5); +#endif +} + +// +// Function: ValidateArgs +// +// Description: +// This function parses the command line arguments and +// sets global variables to indicate how the app should act. +// +void ValidateArgs(int argc, char **argv) +{ + int i,j; + char *ptr; + + sortbysize=1; fromip=1; toip=1; + + if (argc <2) { usage(argv[0]); return; } + if (*(author+2) != 'j') { usage(argv[0]); return; } + for(i=1; i < argc ;i++) { + if ((argv[i][0] == '-') || (argv[i][0] == '/')) { + switch (tolower(argv[i][1])) { + case 't': // traffic type + ptr = &argv[i][2]; + while (*++ptr) *ptr = toupper(*ptr); + ptr = &argv[i][3]; + for ( j=0;j<134;j++) { + if (!strcmp(ptr, szProto[j])) { +// dwIoControlCode = SIO_RCVALL; +#ifdef LINUX + dwProtocol = j; +#endif + iProto=j; + break; + } + } + if ((j>133) && atoi(&argv[i][3])) { +// dwIoControlCode = SIO_RCVALL; +#ifdef LINUX + dwProtocol = atoi(&argv[i][3]); +#endif + iProto=atoi(&argv[i][3]); + } else if (j>133) usage(argv[0]); + break; + case 'i': // interface number +#ifndef LINUX + dwInterface = atoi(&argv[i][3]); +#else + strcpy(intlist,&argv[i][3]); + ptr=strchr(intlist,' '); + if (ptr) *ptr=0; +#endif + break; + case 'g': // gre + gre=1; + break; + case 'c': // cycle time + iCycle = atoi(&argv[i][3]); + break; + case 'a': // cycle time + iDetail = 1; + break; + case 'h': // cycle time + iDetail = justheader = 1; + break; + case 'n': // just n cycle + lNum = atol(&argv[i][3]); + break; + case 'l': // lineno lines + iline = atoi(&argv[i][3]); + break; + case 'p': // just summary + if ((tolower(argv[i][2]) == 'a')) { + strcpy(pattern,&argv[i][4]); printf("\n Pattern: \'%s",&argv[i][4]); + while (++iiAddressCount ;i++) { + printf(" %-2d ........ [%s]\n", i, + inet_ntoa(((SOCKADDR_IN *)slist->Address[i].lpSockaddr)->sin_addr)); + } + closesocket(s); + return; +} + +// +// Function: GetInterface +// +// Description: +// This function retrieves a zero based index and returns +// the IP interface corresponding to that. +// +int GetInterface(SOCKET s, SOCKADDR_IN *ifx, int num) +{ + SOCKET_ADDRESS_LIST *slist=NULL; + char buf[2048]; + DWORD dwBytesRet; + int ret; + + ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, buf, 2048,&dwBytesRet, NULL, NULL); + if (ret == SOCKET_ERROR) { + printf("WSAIoctl(SIO_ADDRESS_LIST_QUERY) failed: %d\n",WSAGetLastError()); + return -1; + } + slist = (SOCKET_ADDRESS_LIST *)buf; + if (num >= slist->iAddressCount) return -1; + ifx->sin_addr.s_addr = ((SOCKADDR_IN *)slist->Address[num].lpSockaddr)->sin_addr.s_addr; + if (*author != 'p') return -1; + return 0; +} +#endif +#ifdef LINUX +struct promisc_device *prom; + +void init_capture( void ) +/* + * 1) Open our capture socket + * 2) Set all the promisc devices to promiscous mode + */ +{ + struct ifreq ifr; + struct promisc_device *p,*pp; + struct protoent *pr; + char *p1,*p2; + + if ((s = socket (AF_INET, SOCK_PACKET, htons (ETH_P_ALL))) < 0) + { + printf(" can't get socket: \n"); + exit(1); + } + strcpy(myipname,intlist); + p1=intlist; p=NULL; + while (p1) { + pp=p; + p = malloc(sizeof(struct promisc_device)); + if (pp) pp->next=p; else prom=p; + if ( (p2=strchr(p1,','))) *p2++=0; + strcpy(&p->name,p1); p->next=NULL; + printf(" %s",p->name); fflush(stdout); + p1=p2; +// while(p!=NULL) { + strcpy (p -> oldifr.ifr_name, p -> name); + + if (ioctl (s, SIOCGIFFLAGS, &(p -> oldifr)) < 0) { + printf(" can't get flags: \n"); + exit(2); + } + p -> reset = 1; + ifr = p -> oldifr; + if (ifr.ifr_flags & IFF_PROMISC) printf(" already promisc! \n"); + ifr.ifr_flags |= IFF_PROMISC; + if (ioctl (s, SIOCSIFFLAGS, &ifr) < 0) { + printf(" can't set flags: \n"); + exit(3); + } +// p = p -> next; + } +} + +void exit_capture(void) +{ + struct promisc_device *p; + + /* do we have to check (capture_sd >= 0) ? */ + + p = prom; + + while(p != NULL) { + if (ioctl (s, SIOCSIFFLAGS, &(p -> oldifr)) < 0) { + printf("can't reset flags: \n"); + } + + p = p -> next; + } + + close (s); +} +#endif +// +// Function: main +// +int main(int argc, char **argv) { + WSADATA wsd; + SOCKADDR_IN if0; + int ret,count; + unsigned int optval; + DWORD dwBytesRet, + dwFlags, + nproc; + char rcvbuf[MAX_IP_SIZE]; + WSABUF wbuf; + unsigned long i; +#ifndef LINUX + // Load Winsock + // + if (WSAStartup(MAKEWORD(2,2), &wsd) != 0) { + printf(" WSAStartup() failed: %d\n", GetLastError()); + return -1; + } +#else + SOCKADDR ssaddr; + struct promisc_device *p; + fd_set ready; + struct timeval tv; +#endif + char Key; + int status; + FILE *input; +// Parse the command line +// + strcpy(intlist,"eth0"); + for(i=100;i<255;i++) szProto[i]="?!?"; + szProto[103]="PIM"; + szProto[108]="IPCOMP"; + szProto[112]="VRRP"; + szProto[115]="L2TP"; + szProto[124]="ISIS"; + szProto[132]="SCTP"; + szProto[133]="FC"; + *execname=0; + ValidateArgs(argc, argv); + if (bFilter) { + i=uiSourceAddr; + if ( i || usSourcePort) + printf(" Source: %03d.%03d.%03d.%03d/%d:%d\n",(i&0xff000000)>>24,(i&0x00ff0000)>>16,(i&0x0000ff00)>>8,i&0xff,uiSourceAddr?usSourceNet:0, usSourcePort); + i=uiDestAddr; + if ( i || usDestPort) + printf(" Dest. : %03d.%03d.%03d.%03d/%d:%d\n",(i&0xff000000)>>24,(i&0x00ff0000)>>16,(i&0x0000ff00)>>8,i&0xff,uiDestAddr?usDestNet:0, usDestPort); + i=uiXAddr; + if ( i || usXPort) + printf(" IP. : %03d.%03d.%03d.%03d/%d:%d\n",(i&0xff000000)>>24,(i&0x00ff0000)>>16,(i&0x0000ff00)>>8,i&0xff,uiXAddr?usXNet:0, usXPort); + } + if (iFile) printf(" To file : %s\n",filename); + if (iProto) printf(" Protocol: %s (%d)\n",szProto[iProto],iProto); + // Create a raw socket for receiving IP datagrams + // +#ifndef LINUX + s = WSASocket(AF_INET, SOCK_RAW, dwProtocol, NULL, 0, WSA_FLAG_OVERLAPPED); + if (s == INVALID_SOCKET) + { + printf("WSASocket() failed: %d\n", WSAGetLastError()); + return -1; + } + // Get an interface to read IP packets on + // + memset(&if0,0,sizeof(if0)); + if0.sin_family = AF_INET; + if0.sin_port = htons(0); + if (GetInterface(s, &if0, dwInterface) != 0) + { + printf("Unable to obtain an interface\n"); + return -1; + } + sprintf(myipname,"%-16s",inet_ntoa(if0.sin_addr)); +#else + printf("starting capture ...."); fflush(stdout); + init_capture(); + printf(" capture started ....\n"); fflush(stdout); +#endif + printf(" Binding to IF: %s\n", myipname); +#ifndef LINUX +// +// This socket MUST be bound before calling the ioctl +// + + if (bind(s, (SOCKADDR *)&if0, sizeof(if0)) == SOCKET_ERROR) { + printf("bind() failed: %d\n", WSAGetLastError()); + return -1; + } +// +// Set the SIO_RCVALLxxx ioctl +// + optval = 1; + if (WSAIoctl(s, dwIoControlCode, &optval, sizeof(optval), + NULL, 0, &dwBytesRet, NULL, NULL) == SOCKET_ERROR) { + printf("WSAIotcl() set raw socket failed; %d\n", WSAGetLastError()); +// return -1; + optval = 2; + if (WSAIoctl(s, dwIoControlCode, &optval, sizeof(optval), + NULL, 0, &dwBytesRet, NULL, NULL) == SOCKET_ERROR) { + printf("WSAIotcl() set raw socket only failed; %d\n", WSAGetLastError()); + return -1; + } + } + system("cls"); +#else + tv.tv_sec=0; tv.tv_usec=0; + set_raw_mode(); + FD_ZERO(&ready); + FD_SET(STDIN_FILENO,&ready); +#endif + input = fopen("/dev/tty", "r"); //open the terminal keyboard + if (uiSourceAddr==0) ulSourceNet=0; + else for ( i=0; i<32-usSourceNet; i++) ulSourceNet <<= 1; + if (uiDestAddr==0) ulDestNet=0; + else for ( i=0; i<32-usDestNet; i++) ulDestNet <<= 1; + if (uiXAddr==0) ulXNet=0; + else for ( i=0; i<32-usXNet; i++) ulXNet <<= 1; + if (uiXAddr) uiSourceAddr=uiDestAddr=uiXAddr; + if (usXPort) usSourcePort=usDestPort=usXPort; + if (ulXNet) ulSourceNet=ulDestNet=ulXNet; + InitIPAcc(); +// Start receiving IP datagrams until interrupted +// + count = 0; + if (iFile && iDetail) f=fopen(filename,"w+"); + if (iProto) bFilter=1; + if (*(author+1) != 'h') iRun=0; + while (iRun) { + rcvbuf[MAX_IP_SIZE]=0; + wbuf.len = MAX_IP_SIZE; + wbuf.buf = rcvbuf; +#ifndef LINUX + dwFlags = 0; + ret = WSARecv(s, &wbuf, 1, &dwBytesRet, &dwFlags, NULL, NULL); + if (ret == SOCKET_ERROR) { + printf("WSARecv() failed: %d\n", WSAGetLastError()); + return -1; + } + if (kbhit()) { +#else + dwFlags = sizeof(ssaddr); + + ret = recvfrom (s, wbuf.buf, MAX_IP_SIZE, 0, &ssaddr, (int *) &dwFlags); + if (ret == -1) continue; + dwBytesRet=wbuf.len=ret; + p=prom; + while(p!=NULL) { + if (!strcmp(p -> name, ssaddr.sa_data)) break; + p=p->next; + } + if (!p) { +// printf("\n%s: ignored",ssaddr.sa_data); fflush(stdout); + continue; + } + FD_ZERO(&ready); + FD_SET(STDIN_FILENO,&ready); + if (select(STDIN_FILENO+1,&ready,NULL,NULL,&tv)>0) { +// if (FD_ISSET(STDIN_FILENO,&ready)) { +#endif + switch (getchar()) { /* branch to appropiate key handler */ + case 0x1b: /* Esc */ + iRun=0; + break; + default: + mostird=1; + break; + } //end of switch key + } + +// Deccode the IP header +// + if (!(nproc = DecodeIPHeader(&wbuf, uiSourceAddr, usSourcePort, ulSourceNet, + uiDestAddr, usDestPort, ulDestNet, dwBytesRet,usXPort,uiXAddr,ulXNet))) + { +// printf("Error decoding IP header!\n"); +// break; + } + } + // Cleanup + // + if (iRun && !iDetail) CloseIPAcc(); + if (f) fclose(f); +#ifndef LINUX + closesocket(s); + WSACleanup(); +#else + exit_capture(); +#endif + return 0; +} diff --git a/utils/powertop/Makefile b/utils/powertop/Makefile new file mode 100644 index 0000000..96f6854 --- /dev/null +++ b/utils/powertop/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2006-2011 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:=powertop +PKG_VERSION:=1.11 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.lesswatts.org/projects/powertop/download/ +PKG_MD5SUM:=3498f5983c683c3a57dce7379a722082 + +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/powertop + SECTION:=utils + CATEGORY:=Utilities + TITLE:=PowerTOP + DEPENDS:=+libncurses + URL:=http://www.lesswatts.org +endef + +define Package/powertop/description + PowerTOP is a Linux tool that helps you find those programs that are + misbehaving while your computer is idle. +endef + +define Package/powertop/install + $(CP) $(PKG_INSTALL_DIR)/* $(1) +endef + +$(eval $(call BuildPackage,powertop)) diff --git a/utils/powertop/patches/100-no-wide-ncurses.patch b/utils/powertop/patches/100-no-wide-ncurses.patch new file mode 100644 index 0000000..61c93a3 --- /dev/null +++ b/utils/powertop/patches/100-no-wide-ncurses.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -20,7 +20,7 @@ OBJS = powertop.o config.o process.o mis + + + powertop: $(OBJS) Makefile powertop.h +- $(CC) ${CFLAGS} $(OBJS) -lncursesw -o powertop ++ $(CC) ${LDFLAGS} $(OBJS) -lncurses -o powertop + @(cd po/ && $(MAKE)) + + powertop.1.gz: powertop.1 diff --git a/utils/powertop/patches/200-no-gettext.patch b/utils/powertop/patches/200-no-gettext.patch new file mode 100644 index 0000000..623f240 --- /dev/null +++ b/utils/powertop/patches/200-no-gettext.patch @@ -0,0 +1,48 @@ +--- a/powertop.c ++++ b/powertop.c +@@ -30,7 +30,9 @@ + #include + #include + #include ++#ifdef ENABLE_GETTEXT + #include ++#endif + #include + #include + #include +@@ -783,9 +785,11 @@ int main(int argc, char **argv) + uint64_t cur_usage[8], cur_duration[8]; + double wakeups_per_second = 0; + ++#ifdef ENABLE_GETTEXT + setlocale (LC_ALL, ""); + bindtextdomain ("powertop", "/usr/share/locale"); + textdomain ("powertop"); ++#endif + + while (1) { + static struct option opts[] = { +--- a/powertop.h ++++ b/powertop.h +@@ -26,7 +26,9 @@ + #ifndef __INCLUDE_GUARD_POWERTOP_H_ + #define __INCLUDE_GUARD_POWERTOP_H_ + ++#ifdef ENABLE_GETTEXT + #include ++#endif + + struct line { + char *string; +@@ -86,7 +88,11 @@ extern suggestion_func *suggestion_activ + _x < _y ? _x : _y; }) + + ++#ifdef ENABLE_GETTEXT + #define _(STRING) gettext(STRING) ++#else ++#define _(STRING) STRING ++#endif + + + #define PT_COLOR_DEFAULT 1 diff --git a/utils/pps-tools/Makefile b/utils/pps-tools/Makefile new file mode 100644 index 0000000..d152363 --- /dev/null +++ b/utils/pps-tools/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=pps-tools +PKG_VERSION:=2.6.23 +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/pps-tools + SUBMENU:=Time Synchronization + SECTION:=net + CATEGORY:=Network + DEPENDS:=@LINUX_2_6_23 + TITLE:=PPS (Pulse Per Second) Userland tools + URL:=http://wiki.enneenne.com/index.php/LinuxPPS_support +endef + + +define Package/pps-tools/description + Userland tools for GPS and DCF-77 Clock syncronization. PPS support in Kernel must be enabled. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/timepps.h $(1)/usr/include/ +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) -DHAVE_ISC_READER=1 -I$(LINUX_DIR)/include -I ." \ + BINDIR="/usr/sbin" MANDIR="/usr/man" +endef + +define Package/pps-tools/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ppstest $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ppsctl $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,pps-tools)) diff --git a/utils/pps-tools/patches/001-source.patch b/utils/pps-tools/patches/001-source.patch new file mode 100644 index 0000000..6707478 --- /dev/null +++ b/utils/pps-tools/patches/001-source.patch @@ -0,0 +1,480 @@ +diff --git a/Makefile b/Makefile +new file mode 100644 +index 0000000..a2660a2 +--- /dev/null ++++ b/Makefile +@@ -0,0 +1,27 @@ ++TARGETS = ppstest ppsctl ++ ++CFLAGS += -Wall -O2 -D_GNU_SOURCE ++CFLAGS += -I . ++CFLAGS += -ggdb ++ ++# -- Actions section ---------------------------------------------------------- ++ ++.PHONY : all depend dep ++ ++all : .depend $(TARGETS) ++ ++.depend depend dep : ++ $(CC) $(CFLAGS) -M $(TARGETS:=.c) > .depend ++ ++ifeq (.depend,$(wildcard .depend)) ++include .depend ++endif ++ ++ ++# -- Clean section ------------------------------------------------------------ ++ ++.PHONY : clean ++ ++clean : ++ rm -f *.o *~ core .depend ++ rm -f ${TARGETS} +diff --git a/ppsctl.c b/ppsctl.c +new file mode 100644 +index 0000000..83fd08a +--- /dev/null ++++ b/ppsctl.c +@@ -0,0 +1,62 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++void usage(char *name) ++{ ++ fprintf(stderr, "usage: %s [enable|disable]\n", name); ++ ++ exit(EXIT_FAILURE); ++} ++ ++int main(int argc, char *argv[]) ++{ ++ int fd; ++ int ret; ++ struct serial_struct ss; ++ ++ if (argc < 2) ++ usage(argv[0]); ++ ++ fd = open(argv[1], O_RDWR); ++ if (fd < 0) { ++ perror("open"); ++ exit(EXIT_FAILURE); ++ } ++ ++ ret = ioctl(fd, TIOCGSERIAL, &ss); ++ if (ret < 0) { ++ perror("ioctl(TIOCGSERIAL)"); ++ exit(EXIT_FAILURE); ++ } ++ ++ if (argc < 3) { /* just read PPS status */ ++ printf("PPS is %sabled\n", ++ ss.flags & ASYNC_HARDPPS_CD ? "en" : "dis"); ++ exit(EXIT_SUCCESS); ++ } ++ ++ if (argv[2][0] == 'e' || argv[2][0] == '1') ++ ss.flags |= ASYNC_HARDPPS_CD; ++ else if (argv[2][0] == 'd' || argv[2][0] == '0') ++ ss.flags &= ~ASYNC_HARDPPS_CD; ++ else { ++ fprintf(stderr, "invalid state argument \"%s\"\n", argv[2]); ++ exit(EXIT_FAILURE); ++ } ++ ++ ret = ioctl(fd, TIOCSSERIAL, &ss); ++ if (ret < 0) { ++ perror("ioctl(TIOCSSERIAL)"); ++ exit(EXIT_FAILURE); ++ } ++ ++ return 0; ++} +diff --git a/ppsfind b/ppsfind +new file mode 100755 +index 0000000..93c0e17 +--- /dev/null ++++ b/ppsfind +@@ -0,0 +1,17 @@ ++#!/bin/sh ++ ++SYS="/sys/class/pps/" ++ ++if [ $# -lt 1 ] ; then ++ echo "usage: ppsfind " >&2 ++ exit 1 ++fi ++ ++for d in $(ls $SYS) ; do ++ if grep $1 $SYS/$d/name >& /dev/null || \ ++ grep $1 $SYS/$d/path >& /dev/null ; then ++ echo "$d: name=$(cat $SYS/$d/name) path=$(cat $SYS/$d/path)" ++ fi ++done ++ ++exit 0 +diff --git a/ppstest.c b/ppstest.c +new file mode 100644 +index 0000000..d125ffa +--- /dev/null ++++ b/ppstest.c +@@ -0,0 +1,151 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++int find_source(char *path, pps_handle_t *handle, int *avail_mode) ++{ ++ pps_params_t params; ++ int ret; ++ ++ printf("trying PPS source \"%s\"\n", path); ++ ++ /* Try to find the source by using the supplied "path" name */ ++ ret = open(path, O_RDWR); ++ if (ret < 0) { ++ fprintf(stderr, "unable to open device \"%s\" (%m)\n", path); ++ return ret; ++ } ++ ++ /* Open the PPS source (and check the file descriptor) */ ++ ret = time_pps_create(ret, handle); ++ if (ret < 0) { ++ fprintf(stderr, "cannot create a PPS source from device " ++ "\"%s\" (%m)\n", path); ++ return -1; ++ } ++ printf("found PPS source \"%s\"\n", path); ++ ++ /* Find out what features are supported */ ++ ret = time_pps_getcap(*handle, avail_mode); ++ if (ret < 0) { ++ fprintf(stderr, "cannot get capabilities (%m)\n"); ++ return -1; ++ } ++ if ((*avail_mode & PPS_CAPTUREASSERT) == 0) { ++ fprintf(stderr, "cannot CAPTUREASSERT\n"); ++ return -1; ++ } ++ if ((*avail_mode & PPS_OFFSETASSERT) == 0) { ++ fprintf(stderr, "cannot OFFSETASSERT\n"); ++ return -1; ++ } ++ ++ /* Capture assert timestamps, and compensate for a 675 nsec ++ * propagation delay */ ++ ret = time_pps_getparams(*handle, ¶ms); ++ if (ret < 0) { ++ fprintf(stderr, "cannot get parameters (%m)\n"); ++ return -1; ++ } ++ params.assert_offset.tv_sec = 0; ++ params.assert_offset.tv_nsec = 675; ++ params.mode |= PPS_CAPTUREASSERT | PPS_OFFSETASSERT; ++ ret = time_pps_setparams(*handle, ¶ms); ++ if (ret < 0) { ++ fprintf(stderr, "cannot set parameters (%m)\n"); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++int fetch_source(int i, pps_handle_t *handle, int *avail_mode) ++{ ++ struct timespec timeout; ++ pps_info_t infobuf; ++ int ret; ++ ++ /* create a zero-valued timeout */ ++ timeout.tv_sec = 3; ++ timeout.tv_nsec = 0; ++ ++retry: ++ if (*avail_mode & PPS_CANWAIT) /* waits for the next event */ ++ ret = time_pps_fetch(*handle, PPS_TSFMT_TSPEC, &infobuf, ++ &timeout); ++ else { ++ sleep(1); ++ ret = time_pps_fetch(*handle, PPS_TSFMT_TSPEC, &infobuf, ++ &timeout); ++ } ++ if (ret < 0) { ++ if (ret == -EINTR) { ++ fprintf(stderr, "time_pps_fetch() got a signal!\n"); ++ goto retry; ++ } ++ ++ fprintf(stderr, "time_pps_fetch() error %d (%m)\n", ret); ++ return -1; ++ } ++ ++ printf("source %d - " ++ "assert %ld.%09ld, sequence: %ld - " ++ "clear %ld.%09ld, sequence: %ld\n", ++ i, ++ infobuf.assert_timestamp.tv_sec, ++ infobuf.assert_timestamp.tv_nsec, ++ infobuf.assert_sequence, ++ infobuf.clear_timestamp.tv_sec, ++ infobuf.clear_timestamp.tv_nsec, infobuf.clear_sequence); ++ ++ return 0; ++} ++ ++void usage(char *name) ++{ ++ fprintf(stderr, "usage: %s [ ...]\n", name); ++ exit(EXIT_FAILURE); ++} ++ ++int main(int argc, char *argv[]) ++{ ++ int num; ++ pps_handle_t handle[4]; ++ int avail_mode[4]; ++ int i = 0; ++ int ret; ++ ++ /* Check the command line */ ++ if (argc < 2) ++ usage(argv[0]); ++ ++ for (i = 1; i < argc && i <= 4; i++) { ++ ret = find_source(argv[i], &handle[i - 1], &avail_mode[i - 1]); ++ if (ret < 0) ++ exit(EXIT_FAILURE); ++ } ++ ++ num = i - 1; ++ printf("ok, found %d source(s), now start fetching data...\n", num); ++ ++ /* loop, printing the most recent timestamp every second or so */ ++ while (1) { ++ for (i = 0; i < num; i++) { ++ ret = fetch_source(i, &handle[i], &avail_mode[i]); ++ if (ret < 0 && errno != ETIMEDOUT) ++ exit(EXIT_FAILURE); ++ } ++ } ++ ++ for (; i >= 0; i--) ++ time_pps_destroy(handle[i]); ++ ++ return 0; ++} +diff --git a/timepps.h b/timepps.h +new file mode 100644 +index 0000000..28ebf4c +--- /dev/null ++++ b/timepps.h +@@ -0,0 +1,193 @@ ++/* ++ * timepps.h -- PPS API main header ++ * ++ * Copyright (C) 2005-2007 Rodolfo Giometti ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++#ifndef _SYS_TIMEPPS_H_ ++#define _SYS_TIMEPPS_H_ ++ ++#include ++#include ++#include ++#include ++ ++/* ++ * New data structures ++ */ ++ ++struct ntp_fp { ++ unsigned int integral; ++ unsigned int fractional; ++}; ++ ++union pps_timeu { ++ struct timespec tspec; ++ struct ntp_fp ntpfp; ++ unsigned long longpad[3]; ++}; ++ ++struct pps_info { ++ unsigned long assert_sequence; /* seq. num. of assert event */ ++ unsigned long clear_sequence; /* seq. num. of clear event */ ++ union pps_timeu assert_tu; /* time of assert event */ ++ union pps_timeu clear_tu; /* time of clear event */ ++ int current_mode; /* current mode bits */ ++}; ++ ++struct pps_params { ++ int api_version; /* API version # */ ++ int mode; /* mode bits */ ++ union pps_timeu assert_off_tu; /* offset compensation for assert */ ++ union pps_timeu clear_off_tu; /* offset compensation for clear */ ++}; ++ ++typedef int pps_handle_t; /* represents a PPS source */ ++typedef unsigned long pps_seq_t; /* sequence number */ ++typedef struct ntp_fp ntp_fp_t; /* NTP-compatible time stamp */ ++typedef union pps_timeu pps_timeu_t; /* generic data type for time stamps */ ++typedef struct pps_info pps_info_t; ++typedef struct pps_params pps_params_t; ++ ++#define assert_timestamp assert_tu.tspec ++#define clear_timestamp clear_tu.tspec ++ ++#define assert_timestamp_ntpfp assert_tu.ntpfp ++#define clear_timestamp_ntpfp clear_tu.ntpfp ++ ++#define assert_offset assert_off_tu.tspec ++#define clear_offset clear_off_tu.tspec ++ ++#define assert_offset_ntpfp assert_off_tu.ntpfp ++#define clear_offset_ntpfp clear_off_tu.ntpfp ++ ++/* ++ * The PPS API ++ */ ++ ++static __inline int time_pps_create(int source, pps_handle_t *handle) ++{ ++ int ret; ++ ++ if (!handle) { ++ errno = EINVAL; ++ return -1; ++ } ++ ++ /* First we check if current device is a PPS valid PPS one... ++ */ ++ ret = ioctl(source, PPS_CHECK); ++ if (ret) { ++ errno = EOPNOTSUPP; ++ return -1; ++ } ++ ++ /* ... then since in LinuxPPS there are no differences between a ++ * "PPS source" and a "PPS handle", we simply return the same value. ++ */ ++ *handle = source; ++ ++ return 0; ++} ++ ++static __inline int time_pps_destroy(pps_handle_t handle) ++{ ++ return close(handle); ++} ++ ++static __inline int time_pps_getparams(pps_handle_t handle, ++ pps_params_t *ppsparams) ++{ ++ int ret; ++ struct pps_kparams __ppsparams; ++ ++ ret = ioctl(handle, PPS_GETPARAMS, &__ppsparams); ++ ++ ppsparams->api_version = __ppsparams.api_version; ++ ppsparams->mode = __ppsparams.mode; ++ ppsparams->assert_off_tu.tspec.tv_sec = __ppsparams.assert_off_tu.sec; ++ ppsparams->assert_off_tu.tspec.tv_nsec = __ppsparams.assert_off_tu.nsec; ++ ppsparams->clear_off_tu.tspec.tv_sec = __ppsparams.clear_off_tu.sec; ++ ppsparams->clear_off_tu.tspec.tv_nsec = __ppsparams.clear_off_tu.nsec; ++ ++ return ret; ++} ++ ++static __inline int time_pps_setparams(pps_handle_t handle, ++ const pps_params_t *ppsparams) ++{ ++ struct pps_kparams __ppsparams; ++ ++ __ppsparams.api_version = ppsparams->api_version; ++ __ppsparams.mode = ppsparams->mode; ++ __ppsparams.assert_off_tu.sec = ppsparams->assert_off_tu.tspec.tv_sec; ++ __ppsparams.assert_off_tu.nsec = ppsparams->assert_off_tu.tspec.tv_nsec; ++ __ppsparams.clear_off_tu.sec = ppsparams->clear_off_tu.tspec.tv_sec; ++ __ppsparams.clear_off_tu.nsec = ppsparams->clear_off_tu.tspec.tv_nsec; ++ ++ return ioctl(handle, PPS_SETPARAMS, &__ppsparams); ++} ++ ++/* Get capabilities for handle */ ++static __inline int time_pps_getcap(pps_handle_t handle, int *mode) ++{ ++ return ioctl(handle, PPS_GETCAP, mode); ++} ++ ++static __inline int time_pps_fetch(pps_handle_t handle, const int tsformat, ++ pps_info_t *ppsinfobuf, ++ const struct timespec *timeout) ++{ ++ struct pps_fdata __fdata; ++ int ret; ++ ++ /* Sanity checks */ ++ if (tsformat != PPS_TSFMT_TSPEC) { ++ errno = EINVAL; ++ return -1; ++ } ++ ++ if (timeout) { ++ __fdata.timeout.sec = timeout->tv_sec; ++ __fdata.timeout.nsec = timeout->tv_nsec; ++ __fdata.timeout.flags = ~PPS_TIME_INVALID; ++ } else ++ __fdata.timeout.flags = PPS_TIME_INVALID; ++ ++ ret = ioctl(handle, PPS_FETCH, &__fdata); ++ ++ ppsinfobuf->assert_sequence = __fdata.info.assert_sequence; ++ ppsinfobuf->clear_sequence = __fdata.info.clear_sequence; ++ ppsinfobuf->assert_tu.tspec.tv_sec = __fdata.info.assert_tu.sec; ++ ppsinfobuf->assert_tu.tspec.tv_nsec = __fdata.info.assert_tu.nsec; ++ ppsinfobuf->clear_tu.tspec.tv_sec = __fdata.info.clear_tu.sec; ++ ppsinfobuf->clear_tu.tspec.tv_nsec = __fdata.info.clear_tu.nsec; ++ ppsinfobuf->current_mode = __fdata.info.current_mode; ++ ++ return ret; ++} ++ ++static __inline int time_pps_kcbind(pps_handle_t handle, ++ const int kernel_consumer, ++ const int edge, const int tsformat) ++{ ++ /* LinuxPPS doesn't implement kernel consumer feature */ ++ errno = EOPNOTSUPP; ++ return -1; ++} ++ ++#endif /* _SYS_TIMEPPS_H_ */ diff --git a/utils/procps/Makefile b/utils/procps/Makefile new file mode 100644 index 0000000..8e16706 --- /dev/null +++ b/utils/procps/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=procps +PKG_VERSION:=3.2.8 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://procps.sourceforge.net +PKG_MD5SUM:=9532714b6846013ca9898984ba4cd7e0 + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/procps + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncurses + TITLE:=proc utilities + URL:=http://procps.sourceforge.net/ +endef + +define Package/procps/description + procps is the package that has a bunch of small useful utilities that give + information about processes using the /proc filesystem. The package + includes the programs ps, top, vmstat, w, kill, free, slabtop, and skill. +endef + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + +define Package/procps/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/free $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ps/ps $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/pgrep $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/pkill $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/pmap $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/pwdx $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/skill $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/slabtop $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/snice $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tload $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/top $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/vmstat $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/w $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/watch $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_BUILD_DIR)/proc/libproc-$(PKG_VERSION).so $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,procps)) diff --git a/utils/procps/patches/010-make_fix.patch b/utils/procps/patches/010-make_fix.patch new file mode 100644 index 0000000..74b1d3c --- /dev/null +++ b/utils/procps/patches/010-make_fix.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -174,7 +174,7 @@ INSTALL := $(BINFILES) $(MANFILES) + # want this rule first, use := on ALL, and ALL not filled in yet + all: do_all + +--include */module.mk ++-include proc/module.mk ps/module.mk + + do_all: $(ALL) + diff --git a/utils/procps/patches/020_hz_fix.patch b/utils/procps/patches/020_hz_fix.patch new file mode 100644 index 0000000..1954453 --- /dev/null +++ b/utils/procps/patches/020_hz_fix.patch @@ -0,0 +1,41 @@ +--- a/proc/sysinfo.c ++++ b/proc/sysinfo.c +@@ -209,7 +209,12 @@ static int check_for_privs(void){ + return !!rc; + } + ++#if __GNUC__ < 4 || __GNUC_MINOR__ < 3 + static void init_libproc(void) __attribute__((constructor)); ++#else ++static void init_libproc(void) __attribute__((constructor(200))); ++#endif ++ + static void init_libproc(void){ + have_privs = check_for_privs(); + // ought to count CPUs in /proc/stat instead of relying +--- a/proc/version.c ++++ b/proc/version.c +@@ -33,7 +33,12 @@ void display_version(void) { + + int linux_version_code; + ++#if __GNUC__ < 4 || __GNUC_MINOR__ < 3 + static void init_Linux_version(void) __attribute__((constructor)); ++#else ++static void init_Linux_version(void) __attribute__((constructor(100))); ++#endif ++ + static void init_Linux_version(void) { + static struct utsname uts; + int x = 0, y = 0, z = 0; /* cleared in case sscanf() < 3 */ +--- a/proc/module.mk ++++ b/proc/module.mk +@@ -76,7 +76,7 @@ proc/$(ANAME): $(LIBOBJ) + + #proc/$(SONAME): proc/library.map + proc/$(SONAME): $(LIBOBJ) +- $(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -shared -Wl,-soname,$(SONAME) -Wl,--version-script=proc/library.map -o $@ $^ -lc ++ $(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -shared -Wl,-soname,$(SONAME) -Wl,--version-script=proc/library.map -o $@ $(sort $^) -lc + + + # AUTOMATIC DEPENDENCY GENERATION -- GCC AND GNUMAKE DEPENDENT diff --git a/utils/psmisc/Makefile b/utils/psmisc/Makefile new file mode 100644 index 0000000..cd06b08 --- /dev/null +++ b/utils/psmisc/Makefile @@ -0,0 +1,65 @@ +# +# Copyright (C) 2006-2012 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:=psmisc +PKG_VERSION:=22.16 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/psmisc +PKG_MD5SUM:=d52caf26159c905574c2ce4bd792b9ee + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/psmisc + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncurses + TITLE:=proc utilities + URL:=http://psmisc.sourceforge.net/ +endef + +define Package/psmisc/description + psmisc is a set of additional small useful utilities that use + the proc filesystem: fuser, killall, pstree, and prtstat +endef + +CONFIGURE_ARGS += \ + --disable-harden-flags + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" + +define Package/psmisc/preinst +#!/bin/sh +if [ -e $${IPKG_INSTROOT}/usr/bin/killall ]; then + rm $${IPKG_INSTROOT}/usr/bin/killall; +fi +endef + +define Package/psmisc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/{fuser,killall,prtstat,pstree} \ + $(1)/usr/bin/ +endef + +define Package/psmisc/postrm +#!/bin/sh +ln -sf ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/killall +$${IPKG_INSTROOT}/usr/bin/killall 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/killall +exit 0 +endef + +$(eval $(call BuildPackage,psmisc)) diff --git a/utils/psplash/Makefile b/utils/psplash/Makefile new file mode 100644 index 0000000..0b56383 --- /dev/null +++ b/utils/psplash/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2007-2011 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:=psplash +PKG_VERSION:=0.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://projects.o-hand.com/sources/psplash/ +PKG_MD5SUM:=7649b7e0fac573eca2048a2a267e242b + +PKG_INSTALL:=1 + +IMAGE_FILE:=generic +ifeq ($(CONFIG_TARGET_s3c24xx),y) + IMAGE_FILE:=480x640 +endif + +include $(INCLUDE_DIR)/package.mk + +define Package/psplash + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A boot splash screen + URL:=http://projects.o-hand.com/psplash +endef + +define Package/psplash/description +PSplash is a userspace graphical boot splash screen. +endef + +define Build/Configure + $(CP) \ + ./files/image_$(IMAGE_FILE).h \ + $(PKG_BUILD_DIR)/psplash-owrt-img.h + $(call Build/Configure/Default) +endef + +define Package/psplash/install + $(INSTALL_DIR) $(1)/bin $(1)/etc/init.d + $(CP) \ + $(PKG_INSTALL_DIR)/usr/bin/psplash* \ + $(1)/bin/ + $(INSTALL_BIN) \ + ./files/psplash.init \ + $(1)/etc/init.d/psplash +endef + +$(eval $(call BuildPackage,psplash)) diff --git a/utils/psplash/files/image_480x640.h b/utils/psplash/files/image_480x640.h new file mode 100644 index 0000000..c26996b --- /dev/null +++ b/utils/psplash/files/image_480x640.h @@ -0,0 +1,9452 @@ +/* GdkPixbuf RGBA C-Source image dump 1-byte-run-length-encoded */ + +#define OWRT_IMG_ROWSTRIDE (1920) +#define OWRT_IMG_WIDTH (480) +#define OWRT_IMG_HEIGHT (640) +#define OWRT_IMG_BYTES_PER_PIXEL (4) /* 3:RGB, 4:RGBA */ +#define OWRT_IMG_RLE_PIXEL_DATA ((uint8*) \ + "\206FT\203\377\2ES\202\377FT\203\377\210GU\204\377\202FU\204\377\5GU\204" \ + "\377HT\203\377HU\204\377FS\203\377+:p\377\211\31*e\377\202\30)d\377\2" \ + "\"2k\377CQ\201\377\204IV\205\377\202HU\204\377\1IV\205\377\214JW\206" \ + "\377\1IV\206\377\204JW\206\377\264KX\206\377\202JW\206\377\202IV\206" \ + "\377\214JW\206\377\202IV\205\377\1HU\204\377\203IV\205\377\3IW\206\377" \ + "3Bv\377\31*e\377\202\30)d\377\207\31*e\377\3\30)d\377\31+f\377=K|\377" \ + "\202HU\204\377\3HT\203\377GU\204\377FU\204\377\210GU\204\377\2FT\203" \ + "\377ES\202\377\210FT\203\377\2ES\203\377DR\203\377\207ES\203\377\1DR" \ + "\202\377\202CQ\201\377\205DR\202\377\3CP\201\377#3l\377\30)d\377\212" \ + "\31*e\377\10\30)d\377\34,g\377AO\200\377BP\201\377AO\200\377BP\201\377" \ + "BP\200\377BP\177\377\206BP\200\377\1AO\200\377\202@N\200\377\206AO\200" \ + "\377\1@N\177\377\202\77M~\377\206@N\177\377\202\77M~\377\3""0@t\377\27" \ + "(c\377\30)d\377\214\31*e\377\3\30)d\377,;q\377>L}\377\205=K}\377\210" \ + "L}\377;I{\377\36.h\377\30)d\377\214\31*e\377\3\30" \ + ")d\377\37/i\377s\377\26'c\377\213\31*e\377\7\34-g" \ + "\377;I|\377BP\201\377AO\200\377BP\201\377BP\200\377BP\177\377\206BP\200" \ + "\377\202AO\200\377\1@N\200\377\206AO\200\377\207@N\177\377\5\77M~\377" \ + "@N\177\377\77M~\377>L}\377*:p\377\202\30)d\377\214\31*e\377\4\33,f\377" \ + "2Av\377=K}\377s\377\30)d\377\224" \ + "\31*e\377\5\30)d\377!2k\3771Av\3772Av\3771@u\377\2062Av\377\1""0At\377" \ + "\2071Au\377\4/\77u\377,L}\377HU\204\377GT\203\377HU\204\377FU\204\377\210GU\204" \ + "\377\2FT\203\377ES\202\377\206FT\203\377\4ES\203\377FT\203\377ES\203" \ + "\377DR\203\377\205ES\203\377\4DR\202\377ES\203\377DR\202\377CQ\201\377" \ + "\204DR\202\377\5CQ\201\377DR\202\377CQ\201\377\37/h\377\30)d\377\212" \ + "\31*e\377\3\30)d\377+:q\377BP\200\377\203BP\201\377\2BP\200\377BP\177" \ + "\377\204BP\200\377\4AO\200\377BP\200\377AO\200\377@N\200\377\205AO\200" \ + "\377\2@N\177\377AO\200\377\210@N\177\377\5>L}\377\77M~\3775Cw\377\33" \ + ",f\377\30)d\377\214\31*e\377\2\30)d\377)8o\377\204=K}\377\3s\377\36/h\377\30" \ + ")d\377\230\31*e\377\5\30)d\377\36/h\377.=s\377-t\377" \ + "2Av\3771@u\377\2062Av\377\2""1Au\3770At\377\2051Au\377\5""0@u\3771Au" \ + "\377/\77u\377\"2k\377\30)d\377\230\31*e\377\5\30)d\377\35-g\377,;r\377" \ + ".=s\377,;q\377\205-s\377\30)d\377\214\31*e\377\202\30)d\377\2""4Bw\377" \ + "L~\377\203BP\201\377\2BP\200\377BP\177\377\205BP\200\377\3AO\200\377" \ + "BP\200\377@N\200\377\207AO\200\377\2@N\177\377\77M~\377\205@N\177\377" \ + "\203\77M~\377\3>K}\377\32+e\377\30)d\377\214\31*e\377\3\27(d\377(8o\377" \ + "L}\377@N\177\377(7n\377\27)d\377\214" \ + "\31*e\377\4\30)d\377\32+f\377=K}\377M\177\377BP\201\377AO" \ + "\200\377\202BP\200\377\1BP\177\377\206BP\200\377\1AO\200\377\202@N\200" \ + "\377\206AO\200\377\2@N\177\377\77M~\377\206@N\177\377\202\77M~\377\3" \ + "9Hz\377\27(c\377\30)d\377\214\31*e\377\2\27(c\3772Av\377\205=K}\377\1" \ + "s\377\27(c\377\220\31*e\377" \ + "\2\27(c\377,;q\377\2058Fz\377\2""7Fy\3778Fz\377\2077Fy\377\2076Ex\377" \ + "\3""0@t\377\31*e\377\30)d\377\223\31*e\377\5\30)d\377#4l\3774Cw\3772" \ + "Av\3771@u\377\2052Av\377\2021Au\377\1""0At\377\2051Au\377\2020@u\377" \ + "\2%6m\377\30)d\377\230\31*e\377\5\30)d\377\34,g\377,;q\377-t\377\203" \ + "BP\201\377\2BP\200\377BP\177\377\207BP\200\377\2AO\200\377@N\200\377" \ + "\204AO\200\377\4@N\177\377AO\200\377@N\177\377\77M~\377\206@N\177\377" \ + "\202\77M~\377\3""9Hz\377\33,f\377\30)d\377\214\31*e\377\3\30)d\377/=" \ + "s\377>L}\377\204=K}\377\210M~\377BP\201\377BP\200\377BP\201\377BP\200" \ + "\377BP\177\377\206BP\200\377\210AO\200\377\207@N\177\377\5\77M~\377@" \ + "N\177\377\77M~\377=K|\377$5m\377\202\30)d\377\213\31*e\377\3\30)d\377" \ + "\"3k\377>L~\377\205=K}\377\210L}" \ + "\377\77M~\377.>s\377\31*e\377\30)d\377\214\31*e\377\2\35.g\3779Gz\377" \ + "\205=K}\377\1;K}\377\207L}\377\77M~\377\40""1j\377" \ + "\215\31*e\377\2\30)d\377)9p\377\204=K}\377\3s\377\202" \ + "HU\204\377\1GU\204\377\202FU\204\377\206GU\204\377\1FT\203\377\202ES" \ + "\202\377\204FT\203\377\2ES\203\377FT\203\377\207ES\203\377\2DR\202\377" \ + "ES\203\377\205DR\202\377\5CQ\201\377ES\202\3775Ex\377\31*e\377\31)d\377" \ + "\211\31*e\377\7\27(c\377-=s\377CQ\201\377AO\200\377BP\200\377BP\201\377" \ + "BP\177\377\207BP\200\377\1@N\200\377\207AO\200\377\2@N\177\377\77M~\377" \ + "\206@N\177\377\3\77M~\377@N\177\377+;q\377\215\31*e\377\3\30)d\377\"" \ + "2k\377:H{\377\205=K}\377\2L}\377GT" \ + "\203\377HU\204\377GU\204\377FU\204\377\205GU\204\377\4FT\203\377GU\204" \ + "\377FT\203\377ES\202\377\205FT\203\377\3ES\203\377FT\203\377DR\203\377" \ + "\207ES\203\377\2DR\202\377CQ\201\377\205DR\202\377\3ES\202\377\36/i\377" \ + "\30)d\377\211\31*e\377\2\30)d\377\33-g\377\204BP\201\377\2BP\200\377" \ + "BP\177\377\206BP\200\377\2AO\200\377@N\200\377\205AO\200\377\202@N\177" \ + "\377\1\77M~\377\205@N\177\377\203\77M~\377\2""8Gz\377\30)d\377\214\31" \ + "*e\377\3\30)d\377\33+f\3777Fy\377\204=K}\377\202L}\377@N\177\377\35.g\377\30)d\377\213\31*e\377\4\30)d\377\27" \ + "(c\3771@t\377s\377-" \ + "L}\377\77M~\377\34-f\377\30)d\377" \ + "\213\31*e\377\3\30)d\377\26(c\3777Fz\377\205=K}\377\2s\377\210-t\377\27" \ + ")d\377\30)d\377\205\31*e\377\3\27)d\377!2j\377FS\203\377\203IV\205\377" \ + "\2HU\204\377IV\205\377\207JW\206\377\4IV\206\377JW\206\377KX\206\377" \ + "JW\206\377\206KX\206\377\4JW\205\377KX\206\377LY\207\377KX\206\377\207" \ + "LY\207\377\1LX\207\377\202LY\207\377\2LZ\207\377LY\207\377\211LZ\207" \ + "\377\1KZ\206\377\203LZ\207\377\202MZ\210\377\1LZ\207\377\236MZ\210\377" \ + "\1LZ\207\377\203MZ\210\377\202LZ\207\377\202KZ\206\377\210LZ\207\377" \ + "\1LY\207\377\202LZ\207\377\2LY\207\377LX\207\377\207LY\207\377\4KX\206" \ + "\377LY\207\377KX\206\377JW\205\377\207KX\206\377\4JW\206\377KX\206\377" \ + "JW\206\377IV\206\377\205JW\206\377\11IV\205\377JW\206\377IV\205\377H" \ + "U\204\377IV\205\377HU\204\377KX\206\3777Dy\377\26'c\377\207\31*e\377" \ + "\6\34,g\377>K}\377HU\204\377HT\203\377GU\204\377FU\204\377\205GU\204" \ + "\377\202FT\203\377\1ES\202\377\206FT\203\377\202ES\203\377\1DR\203\377" \ + "\206ES\203\377\2DR\202\377CQ\201\377\204DR\202\377\4CQ\201\377AO\200" \ + "\377%5m\377\30)d\377\211\31*e\377\3\30)d\377&6n\377@N\200\377\202BP\201" \ + "\377\202BP\200\377\1BP\177\377\205BP\200\377\202AO\200\377\1@N\200\377" \ + "\205AO\200\377\202@N\177\377\1\77M~\377\205@N\177\377\203\77M~\377\2" \ + "(7o\377\27(d\377\214\31*e\377\3\27(d\377,L}\377\204=K}\377\2<" \ + "K}\377;K}\377\206s\377\2068Fz\377\2""7Fy\3776Fx\377\2067Fy\377\2""6Ex\3775Dw\377\203" \ + "6Ex\377\4""5Dw\3777Fx\377\37""0i\377\30)d\377\223\31*e\377\5\30)d\377" \ + "\40""1i\3771@u\3773Bw\3771@u\377\2062Av\377\1""0At\377\2071Au\377\2/" \ + "\77u\377*:q\377\202\30)d\377\227\31*e\377\2\30)d\377\31*e\377\202.=s" \ + "\377\207-L~\377K}\377\202HU\204\377\2GU\204" \ + "\377FU\204\377\206GU\204\377\1FT\203\377\202ES\202\377\204FT\203\377" \ + "\4ES\203\377FT\203\377ES\203\377DR\203\377\206ES\203\377\2DR\202\377" \ + "CQ\201\377\205DR\202\377\3;I|\377\35.g\377\30)d\377\210\31*e\377\4\30" \ + ")d\377\26(c\3776Dy\377AO\200\377\202BP\201\377\210BP\200\377\210AO\200" \ + "\377\210@N\177\377\5\77M~\377>L}\3779Gz\377\33+f\377\30)d\377\213\31" \ + "*e\377\2\30)d\377\31*e\377\206=K}\377\2t\3772Av\3771@u\377\2062Av\377\2""1" \ + "Au\3770At\377\2061Au\377\4/\77u\377-=s\377\34-g\377\30)d\377\231\31*" \ + "e\377\2(8o\377.=s\377\206-s\377\36/i\377\30)d\377" \ + "\231\31*e\377\2%5m\377.=s\377\210-L}\377(8o\377\30)d" \ + "\377\214\31*e\377\3\30)d\377+:q\377>L}\377\204=K}\377\210K}\377\33,f\377\30)" \ + "d\377\205\31*e\377\202\30)d\377\3FS\203\377IV\205\377HU\204\377\202I" \ + "V\205\377\207JW\206\377\2IV\206\377JW\206\377\210KX\206\377\4JW\205\377" \ + "KX\206\377LY\207\377KX\206\377\206LY\207\377\2LX\207\377LY\207\377\215" \ + "LZ\207\377\214MZ\210\377\202LY\207\377\204MZ\210\377\204N[\211\377\1" \ + "MZ\210\377\206N[\211\377\1MZ\210\377\205N[\211\377\203MZ\210\377\203" \ + "LY\207\377\212MZ\210\377\1LZ\207\377\202MZ\210\377\2LZ\207\377KZ\206" \ + "\377\207LZ\207\377\4LY\207\377LZ\207\377LY\207\377LX\207\377\206LY\207" \ + "\377\1KX\206\377\202LY\207\377\1JW\205\377\206KX\206\377\4JW\206\377" \ + "KX\206\377JW\206\377IV\206\377\207JW\206\377\2IV\205\377HU\204\377\202" \ + "IV\205\377\2JW\206\377-L}\377\77M~\377/>t\377\31*e\377\30)d" \ + "\377\213\31*e\377\4\30)d\377\"2k\377\77M~\377s\377" \ + "\27(c\377\217\31*e\377\4\30)d\377\32+f\3773Av\3777Fz\377\2058Fz\377\2" \ + "7Fy\3776Fx\377\2067Fy\377\2""6Ex\3775Dw\377\2046Ex\377\3""5Dw\377\36" \ + "/h\377\30)d\377\223\31*e\377\5\27)d\377&5m\3773Bw\3772Av\3771@u\377\205" \ + "2Av\377\2""1Au\3770At\377\2061Au\377\2020@u\377\2#3k\377\30)d\377\231" \ + "\31*e\377\4\40""0j\377/=s\377-L}\377@N\177" \ + "\377\"2j\377\215\31*e\377\4\32+e\3770\77t\377=K}\377L}\377@N\177\377*:p\377\215\31*e\377\4\30)d\377+;q\377=K}\377=J|\377" \ + "\202=K}\377\3L}\377\26'c\377\30)d\377\205\31*e\377" \ + "\2\30)d\377*9p\377\202IV\205\377\202HU\204\377\1IV\205\377\206JW\206" \ + "\377\202IV\206\377\1JW\206\377\206KX\206\377\2JW\205\377KX\206\377\210" \ + "LY\207\377\2LX\207\377LY\207\377\207LZ\207\377\202KZ\206\377\202LZ\207" \ + "\377\207MZ\210\377\203LY\207\377\3MZ\210\377N[\211\377MZ\210\377\215" \ + "N[\211\377\215MZ\211\377\214N[\211\377\1MZ\210\377\202N[\211\377\1MZ" \ + "\210\377\202LY\207\377\207MZ\210\377\4LZ\207\377MZ\210\377LZ\207\377" \ + "KZ\206\377\210LZ\207\377\2LY\207\377LX\207\377\207LY\207\377\2KX\206" \ + "\377JW\205\377\207KX\206\377\2JW\206\377IV\206\377\207JW\206\377\7IV" \ + "\205\377HU\204\377IV\205\377HU\204\377DQ\201\377\34-g\377\30)d\377\205" \ + "\31*e\377\6\30)d\377%4l\377DQ\201\377HU\204\377GU\204\377FU\204\377\206" \ + "GU\204\377\1FT\203\377\202ES\202\377\205FT\203\377\1ES\203\377\202DR" \ + "\203\377\205ES\203\377\1DR\202\377\202CQ\201\377\205DR\202\377\3""1@" \ + "u\377\27(c\377\30)e\377\210\31*e\377\3\30)d\377\"2k\377DR\202\377\202" \ + "BP\201\377\2BP\200\377BP\177\377\206BP\200\377\2AO\200\377@N\200\377" \ + "\206AO\200\377\2@N\177\377\77M~\377\205@N\177\377\203\77M~\377\1""3A" \ + "v\377\215\31*e\377\3\30)d\377&6n\377L~\377\202BP\201\377\202BP\200\377\1BP\177\377\205BP\200\377\202AO\200" \ + "\377\1@N\200\377\205AO\200\377\2@N\177\377\77M~\377\206@N\177\377\202" \ + "\77M~\377\2;I{\377\30)d\377\214\31*e\377\3\30)d\377\"2j\377:H{\377\205" \ + "=K}\377\1;K}\377\206s\377GT\203\377HU\204\377GU\204\377" \ + "FU\204\377\206GU\204\377\2FT\203\377ES\202\377\206FT\203\377\2ES\203" \ + "\377DR\203\377\206ES\203\377\2DR\202\377CQ\201\377\204DR\202\377\4CQ" \ + "\201\377\77N\177\377\40""0i\377\30)d\377\211\31*e\377\2\33,f\3776Dy\377" \ + "\203BP\201\377\2BP\200\377BP\177\377\206BP\200\377\2AO\200\377@N\200" \ + "\377\205AO\200\377\202@N\177\377\1\77M~\377\205@N\177\377\5\77M~\377" \ + ">L}\377@N\177\377\33,f\377\30)d\377\213\31*e\377\3\30)d\377\35.h\377" \ + "8Fy\377\205=K}\377\2t\377CP\201\377AO\200" \ + "\377BP\201\377BP\200\377BP\177\377\206BP\200\377\2AO\200\377@N\200\377" \ + "\206AO\200\377\2@N\177\377\77M~\377\206@N\177\377\4\77M~\377@N\177\377" \ + "$4l\377\30)d\377\213\31*e\377\3\30)d\377\31)e\3776Ex\377\204=K}\377\202" \ + "t\377JW\205\377HU\204" \ + "\377IV\205\377HU\204\377JW\206\377IV\205\377\205JW\206\377\2IV\206\377" \ + "JW\206\377\210KX\206\377\2LY\207\377KX\206\377\205LY\207\377\4LX\207" \ + "\377LY\207\377LZ\207\377LY\207\377\205LZ\207\377\4KZ\206\377LZ\207\377" \ + "MZ\210\377LZ\207\377\207MZ\210\377\4LY\207\377MZ\210\377N[\211\377MZ" \ + "\210\377\210N[\211\377\1MZ\211\377\202N[\211\377\2O\\\211\377N[\211\377" \ + "\203O\\\211\377\12JV\201\377ALq\3779Cc\37708S\377$*\77\377\32\37.\377" \ + "\23\26!\377\15\17\26\377\10\12\17\377\5\6\12\377\202\4\5\10\377\12\6" \ + "\7\13\377\11\13\20\377\16\20\30\377\24\27#\377\34!1\377&,B\37719U\377" \ + ":Ce\377ALr\377JV\202\377\202O\\\211\377\202N[\211\377\202MZ\211\377\207" \ + "N[\211\377\203MZ\210\377\1LY\207\377\206MZ\210\377\4LZ\207\377MZ\210" \ + "\377LZ\207\377KZ\206\377\206LZ\207\377\202LY\207\377\1LX\207\377\207" \ + "LY\207\377\2KX\206\377JW\205\377\206KX\206\377\202JW\206\377\1IV\206" \ + "\377\204JW\206\377\4IV\205\377JW\206\377IV\205\377HU\204\377\202IV\205" \ + "\377\3CQ\201\377\32+e\377\30)d\377\205\31*e\377\4\27(d\377'7o\377JW\205" \ + "\377HT\203\377\210GU\204\377\210FT\203\377\210ES\203\377\2DR\202\377" \ + "CQ\201\377\205DR\202\377\3""7Fy\377\33,f\377\30)d\377\210\31*e\377\10" \ + "\30)d\377\"3k\377>L~\377BP\201\377BP\200\377BP\201\377BP\200\377BP\177" \ + "\377\205BP\200\377\202AO\200\377\1@N\200\377\205AO\200\377\2@N\177\377" \ + "\77M~\377\206@N\177\377\202\77M~\377\2""5Dx\377\27(c\377\214\31*e\377" \ + "\3\27(c\377,;q\377l\377" \ + "6Ex\3776Ew\3776Ex\377&6n\377\30)d\377\204\31*e\377\1\24\"S\377\216\24" \ + "\"R\377\10\23!Q\377\25#S\377*6a\377(5`\377'4_\377(5`\377(4_\377+8g\377" \ + "\2032Av\377\2""1Au\3770At\377\2051Au\377\2020@u\377\2&6n\377\30)d\377" \ + "\230\31*e\377\2\30)d\377!2j\377\202-\377JV\200\377N[\211\377MZ\211" \ + "\377\207N[\211\377\1MZ\210\377\202N[\211\377\1LY\207\377\207MZ\210\377" \ + "\202LZ\207\377\1KZ\206\377\210LZ\207\377\2LY\207\377LX\207\377\204LY" \ + "\207\377\4KX\206\377LY\207\377KX\206\377JW\205\377\207KX\206\377\206" \ + "JW\206\377\2IV\205\377JW\206\377\202IV\205\377\4HU\204\377JW\205\377" \ + ":I{\377\26'c\377\206\31*e\377\5\30)d\3777Fy\377IV\204\377HU\204\377F" \ + "U\204\377\207GU\204\377\210FT\203\377\206ES\203\377\2DR\202\377ES\203" \ + "\377\207DR\202\377\2!2j\377\30)d\377\210\31*e\377\3\30)d\377\27(d\377" \ + "8G{\377\203BP\201\377\2BP\200\377BP\177\377\206BP\200\377\2AO\200\377" \ + "@N\200\377\204AO\200\377\4@N\177\377AO\200\377@N\177\377\77M~\377\205" \ + "@N\177\377\5\77M~\377>L}\377\77M~\377\33-g\377\30)d\377\213\31*e\377" \ + "\3\30)d\377\40""0i\377m\377\2026Ex\377\2+;q\377\32*e\377\203\31*e\377" \ + "\2\24\"S\377\0\0\2\377\224\0\0\0\377\2\0\1\1\377\33#@\377\2032Av\377" \ + "\2""1Au\3770At\377\2041Au\377\5""0@u\3771Au\3770@u\377*:q\377\30)d\377" \ + "\230\31*e\377\5\30)d\377\37/i\377,s\377\27(c\377\214\31*e\377\2\26(c\3774Cx\377\205=K}\377\5s\377\205=K}\377\5L}\3778Gy\377\202\30)d\377\213\31*e\377\3\27(d\377)9p\377>L}\377" \ + "\204=K}\377\2\377\0\0\1\377\0\0\0\377DDD\377\355\355\355" \ + "\377\217\377\377\377\377\3\376\376\376\377\377\377\377\377\"\"\"\377" \ + "\202\0\0\0\377\1,9c\377\2026Ex\377\1\35.g\377\202\31*e\377\5\24\"S\377" \ + "\3\5\15\377\0\0\0\377\25\25\25\377\327\327\327\377\216\377\377\377\377" \ + "\2\363\363\363\377QQQ\377\202\0\0\0\377\1\40*M\377\2052Av\377\2071Au" \ + "\377\4""0@u\3771Au\377\35-g\377\30)d\377\227\31*e\377\202\30)d\377\6" \ + "+:q\377.=s\377-L~\377\204=K}\377\204" \ + "L}\377(8o\377\30)d\377\214\31*e\377" \ + "\2\30)d\3779Gz\377\205=K}\377\204q\377\2062Av\377\2101Au\377\3""0@u\377(8o\377\27(d\377" \ + "\227\31*e\377\2\30)c\377\12\22,\377\202\0\0\0\377\1\225\225\225\377\216" \ + "\377\377\377\377\1\367\367\367\377\202\0\0\0\377\2\3\6\17\377\27'_\377" \ + "\225\31*e\377\2\30)d\377\36/i\377\203(8o\377\207'7o\377\2\36/h\377\30" \ + ")d\377\233\31*e\377\6\27(d\377%5m\377JW\206\377HU\204\377IV\205\377H" \ + "U\204\377\207JW\206\377\1IV\206\377\206KX\206\377\2JW\205\377KX\206\377" \ + "\206LY\207\377\2LX\207\377LY\207\377\206LZ\207\377\2KZ\206\377LZ\207" \ + "\377\207MZ\210\377\1LY\207\377\207N[\211\377\5MZ\211\377N[\211\377O\\" \ + "\211\377MZ\206\377\4\5\10\377\202\0\0\0\377\3\212\212\212\377\377\377" \ + "\377\377\376\376\376\377\254\377\377\377\377\3\376\376\376\377\377\377" \ + "\377\377\222\222\222\377\202\0\0\0\377\2\3\3\5\377IV\203\377\207N[\211" \ + "\377\210MZ\210\377\210LZ\207\377\210LY\207\377\207KX\206\377\2JW\206" \ + "\377IV\206\377\206JW\206\377\5IV\205\377HU\204\377IV\205\377JW\205\377" \ + ";I|\377\206\31*e\377\7\30)d\377\26(c\377FS\203\377HU\203\377HU\204\377" \ + "GU\204\377FU\204\377\205GU\204\377\2FT\203\377ES\202\377\206FT\203\377" \ + "\2ES\203\377DR\203\377\206ES\203\377\2DR\202\377CQ\201\377\205DR\202" \ + "\377\2&6n\377\27(d\377\211\31*e\377\2\30)d\377;J|\377\203BP\201\377\2" \ + "BP\200\377BP\177\377\206BP\200\377\1@N\200\377\207AO\200\377\1\77M~\377" \ + "\206@N\177\377\202\77M~\377\1-\377" \ + "\202\31*e\377\1\24#T\377\202\0\0\0\377\1\16\16\16\377\225\377\377\377" \ + "\377\10\337\337\337\377'''\377\0\0\0\377\3\4\7\377&0U\377-;r\377\30)" \ + "d\377\23\40M\377\202\0\0\0\377\3CCC\377\377\377\377\377\376\376\376\377" \ + "\215\377\377\377\377\1\264\264\264\377\202\0\0\0\377\2\17\24$\3770>r" \ + "\377\2062Av\377\2101Au\377\3""0@u\377):p\377\27(d\377\227\31*e\377\2" \ + "\30)c\377\12\22,\377\202\0\0\0\377\1\225\225\225\377\216\377\377\377" \ + "\377\1\367\367\367\377\202\0\0\0\377\2\3\6\17\377\27'_\377\225\31*e\377" \ + "\2\30)d\377\36.h\377\203(8o\377\2'7o\377&6o\377\203'7o\377\4'6n\377'" \ + "7o\377\36/h\377\30)d\377\233\31*e\377\3\27(c\377.=s\377JW\205\377\202" \ + "IV\205\377\1HU\204\377\206JW\206\377\1IV\206\377\202JW\206\377\205KX" \ + "\206\377\2JW\205\377KX\206\377\206LY\207\377\2LX\207\377LY\207\377\206" \ + "LZ\207\377\2KZ\206\377LZ\207\377\206MZ\210\377\1LY\207\377\202MZ\210" \ + "\377\205N[\211\377\2MZ\211\377N[\211\377\202O\\\211\377\1$*\77\377\202" \ + "\0\0\0\377\4""222\377\360\360\360\377\377\377\377\377\376\376\376\377" \ + "\221\377\377\377\377\1\376\376\376\377\210\377\377\377\377\1\376\376" \ + "\376\377\221\377\377\377\377\4\376\376\376\377\377\377\377\377\365\365" \ + "\365\377666\377\202\0\0\0\377\1!';\377\207N[\211\377\210MZ\210\377\210" \ + "LZ\207\377\210LY\207\377\11KX\206\377>Io\37719W\377(/I\377$+A\377%,C" \ + "\377*1L\3774=]\377AMv\377\206JW\206\377\204IV\205\377\1CP\201\377\207" \ + "\31*e\377\2\26'c\377\77M}\377\202HU\204\377\2GU\204\377FU\204\377\205" \ + "GU\204\377\1FT\203\377\202ES\202\377\204FT\203\377\14=Ir\3771;^\377)" \ + "2P\377%,F\377\")A\377!(@\377\")A\377%,F\377)2O\377.8Y\3775@g\377@Mz\377" \ + "\204DR\202\377\2,t\377\31*e\377\30" \ + ")d\377\31*e\377\26%Y\377\21\35G\377\16\30;\377\14\25""3\377\14\24""1" \ + "\377\14\25""4\377\16\31<\377\22\37K\377\27'_\377\31*e\377\30)d\377/>" \ + "t\377>L}\377\204=K}\377\205s\377\30)d\377\16\27""8\377\202\0\0\0\377\1\200\200\200\377" \ + "\217\377\377\377\377\1ooo\377\202\0\0\0\377\2\32\">\3770\77t\377\206" \ + "2Av\377\2101Au\377\3""0@u\377+;q\377\27(d\377\207\31*e\377\7\24\"S\377" \ + "\17\31=\377\14\25""3\377\14\24""1\377\16\27""9\377\22\36J\377\27(`\377" \ + "\211\31*e\377\2\30)c\377\12\22,\377\202\0\0\0\377\1\225\225\225\377\216" \ + "\377\377\377\377\1\367\367\367\377\202\0\0\0\377\2\3\6\17\377\27(`\377" \ + "\225\31*e\377\2\30)d\377\35.h\377\204(8o\377\1&6o\377\205'7o\377\2\37" \ + "/i\377\30)e\377\233\31*e\377\2\26'c\3778Fy\377\202IV\205\377\2HU\204" \ + "\377IV\205\377\206JW\206\377\2IV\206\377JW\206\377\206KX\206\377\2JW" \ + "\205\377KX\206\377\206LY\207\377\2LX\207\377LY\207\377\205LZ\207\377" \ + "\1KZ\206\377\202LZ\207\377\205MZ\210\377\1LY\207\377\202MZ\210\377\206" \ + "N[\211\377\5MZ\211\377O\\\211\377N[\211\377IU\177\377\4\5\10\377\202" \ + "\0\0\0\377\1\247\247\247\377\223\377\377\377\377\14\370\370\370\377\341" \ + "\341\341\377\251\251\251\377ggg\377\77\77\77\377...\377222\377III\377" \ + "uuu\377\275\275\275\377\345\345\345\377\374\374\374\377\223\377\377\377" \ + "\377\1\260\260\260\377\202\0\0\0\377\2\2\3\4\377HT\177\377\203N[\211" \ + "\377\5MY\207\3772:X\377%+A\377$+A\377$*@\377\206$+A\377\2$+@\377#+@\377" \ + "\206$+@\377\3$*@\377#)\77\377/7S\377\202JW\204\377\3BMv\377/7T\377\24" \ + "\27$\377\211\0\0\0\377\4\3\4\6\377\32\36/\3775>`\377CNy\377\202IV\205" \ + "\377\1JW\206\377\203IV\205\377\3JW\206\377\32+f\377\30)d\377\205\31*" \ + "e\377\6\26'c\3776Ex\377IU\204\377HU\204\377GU\204\377FU\204\377\204G" \ + "U\204\377\7FT\203\377GU\204\377BP}\377L|\377,8h\377\20\33A\377\7\14" \ + "\36\377\0\1\3\377\211\0\0\0\377\4\3\5\15\377\13\22.\377#0\\\377:Hv\377" \ + "\204=K}\377\205s\377IV\205\377HU\204\377GU\204\377F" \ + "U\204\377\204GU\204\377\4@Mw\377,5R\377\27\34,\377\4\5\11\377\224\0\0" \ + "\0\377\4\4\5\10\377\7\15!\377\17\31>\377\26%Y\377\207\31*e\377\3\30)" \ + "d\377-=s\377CQ\202\377\202BP\201\377\2BP\200\377\37%;\377\223\0\0\0\377" \ + "\5\13\15\26\377\377\223\0\0\0\377\3\15\20\33\377" \ + "\37%=\377\10\11\17\377\205\0\0\0\377\11...\377YYY\377vvv\377\207\207" \ + "\207\377\214\214\214\377\207\207\207\377uuu\377SSS\377\37\37\37\377\204" \ + "\0\0\0\377\4\2\3\5\377\23\30(\3779Fu\377=K}\377\206Hk\377\7\10\14\377\0\0\0\377\15\15\15" \ + "\377\335\335\335\377\377\377\377\377\376\376\376\377\215\377\377\377" \ + "\377\3\376\376\376\377\377\377\377\377\264\264\264\377\204\0\0\0\377" \ + "\10\24\27#\3775=Z\377GRy\377MY\203\377KX\201\377BMq\377.5N\377\13\15" \ + "\24\377\203\0\0\0\377\4\6\6\6\377\330\330\330\377\377\377\377\377\376" \ + "\376\376\377\215\377\377\377\377\7\376\376\376\377\377\377\377\377\327" \ + "\327\327\377\22\22\22\377\0\0\0\377\7\10\14\377\377\202\0\0\0\377\2DDD\377\241\241\241\377\213\232\232" \ + "\232\377\2\234\234\234\377\207\207\207\377\202\0\0\0\377\202\0\0\1\377" \ + "\203\0\0\0\377\12...\377\240\240\240\377\360\360\360\377\370\370\370" \ + "\377\372\372\372\377\373\373\373\377\374\374\374\377\375\375\375\377" \ + "\374\374\374\377\373\373\373\377\202\371\371\371\377\3\332\332\332\377" \ + "ppp\377\1\1\1\377\203\0\0\0\377\3\11\14\24\3775Am\377=K}\377\205>>\377\204\0\0\0\377\7aaa\377\346\346\346\377\371\371\371\377" \ + "\373\373\373\377\374\374\374\377\375\375\375\377\373\373\373\377\202" \ + "\371\371\371\377\2\306\306\306\377SSS\377\205\0\0\0\377\2\77\77\77\377" \ + "\227\227\227\377\203\232\232\232\377\2\230\230\230\377\324\324\324\377" \ + "\216\377\377\377\377\2\374\374\374\377\225\225\225\377\206\232\232\232" \ + "\377\2\235\235\235\377OOO\377\202\0\0\0\377\1\16\31<\377\215\31*e\377" \ + "\2\30)d\377\33+g\377\204(8o\377\1&6o\377\205'7o\377\1\40""1j\377\233" \ + "\31*e\377\3\30)d\377\"3k\377FS\203\377\202IV\205\377\2HU\204\377IV\205" \ + "\377\205JW\206\377\2IV\206\377JW\206\377\206KX\206\377\2JW\205\377KX" \ + "\206\377\206LY\207\377\2LX\207\377LY\207\377\205LZ\207\377\1KZ\206\377" \ + "\202LZ\207\377\205MZ\210\377\4LY\207\377MZ\210\377N[\211\377MZ\210\377" \ + "\204N[\211\377\5MZ\211\377N[\211\377O\\\211\377N[\211\37708S\377\202" \ + "\0\0\0\377\3""888\377\377\377\377\377\376\376\376\377\215\377\377\377" \ + "\377\4\376\376\376\377\377\377\377\377\327\327\327\377\13\13\13\377\202" \ + "\0\0\0\377\2\10\12\17\377=Gh\377\202R_\213\377\1Q^\212\377\202R_\213" \ + "\377\203Q^\212\377\2""2:V\377\4\5\10\377\202\0\0\0\377\4\24\24\24\377" \ + "\355\355\355\377\377\377\377\377\376\376\376\377\217\377\377\377\377" \ + "\1""444\377\202\0\0\0\377\1.6R\377\202N[\211\377\5LX\205\377\30\34+\377" \ + "\0\0\0\377\4\4\4\377\241\241\241\377\215\377\377\377\377\1\320\320\320" \ + "\377\204\0\0\0\377\2%%%\377\265\265\265\377\203\377\377\377\377\1\376" \ + "\376\376\377\206\377\377\377\377\1\376\376\376\377\203\377\377\377\377" \ + "\2\241\241\241\377\32\32\32\377\203\0\0\0\377\5\30\35,\377FS\201\377" \ + "JW\205\3778Fy\377\27(c\377\205\31*e\377\7\30)d\377\33+f\377JW\205\377" \ + "GT\203\377HU\204\377DQ~\377&-F\377\203\0\0\0\377\4\2\2\2\377\32\32\32" \ + "\377vvv\377\351\351\351\377\203\377\377\377\377\1\376\376\376\377\213" \ + "\377\377\377\377\1\376\376\376\377\204\377\377\377\377\4\346\346\346" \ + "\377qqq\377\35\35\35\377\2\2\2\377\203\0\0\0\377\2\16\27""9\377\30)c" \ + "\377\202\31*e\377\3\30)d\377#3k\377DR\202\377\202BP\201\377\2BP\200\377" \ + "\40'>\377\202\0\0\0\377\1rrr\377\215\377\377\377\377\1\345\345\345\377" \ + "\204\0\0\0\377\3\1\1\1\377'''\377\257\257\257\377\203\377\377\377\377" \ + "\1\376\376\376\377\207\377\377\377\377\1\376\376\376\377\202\377\377" \ + "\377\377\3\355\355\355\377UUU\377\5\5\5\377\202\0\0\0\377\2\14\17\32" \ + "\3776Bo\377\205>>\377\203\0\0\0\377\1kkk\377\206\377\377\377\377\1\376\376\376" \ + "\377\214\377\377\377\377\1\376\376\376\377\211\377\377\377\377\1\205" \ + "\205\205\377\202\0\0\0\377\1\16\31<\377\215\31*e\377\2\30)d\377\32+f" \ + "\377\204(8o\377\1&6o\377\205'7o\377\1\40""1j\377\233\31*e\377\3\27)d" \ + "\377'7n\377GT\203\377\202IV\205\377\2HU\204\377IV\205\377\205JW\206\377" \ + "\2IV\206\377JW\206\377\206KX\206\377\2JW\205\377KX\206\377\205LY\207" \ + "\377\1LX\207\377\202LY\207\377\205LZ\207\377\4KZ\206\377LZ\207\377MZ" \ + "\210\377LZ\207\377\204MZ\210\377\2LY\207\377MZ\210\377\206N[\211\377" \ + "\5MZ\211\377N[\211\377O\\\211\377LY\205\377\34!1\377\202\0\0\0\377\3" \ + "\231\231\231\377\377\377\377\377\376\376\376\377\216\377\377\377\377" \ + "\2\371\371\371\377SSS\377\202\0\0\0\377\3\13\15\24\377DOt\377Q^\212\377" \ + "\207R_\213\377\4Q^\212\377P]\211\377=Gi\377\10\11\16\377\202\0\0\0\377" \ + "\1aaa\377\217\377\377\377\377\3\376\376\376\377\377\377\377\377\214\214" \ + "\214\377\202\0\0\0\377\10\35\"4\377KX\204\377N[\211\377LX\205\377\30" \ + "\34+\377\0\0\0\377\4\4\4\377\235\235\235\377\215\377\377\377\377\1\314" \ + "\314\314\377\202\0\0\0\377\3\2\2\2\377fff\377\367\367\367\377\202\377" \ + "\377\377\377\1\376\376\376\377\212\377\377\377\377\202\376\376\376\377" \ + "\3\377\377\377\377\350\350\350\377XXX\377\203\0\0\0\377\4\36#6\377GT" \ + "\202\377=L}\377\26'c\377\205\31*e\377\202\30)d\377\4HV\204\377HU\204" \ + "\377AMw\377\31\36.\377\203\0\0\0\377\3!!!\377\177\177\177\377\354\354" \ + "\354\377\202\377\377\377\377\1\376\376\376\377\225\377\377\377\377\3" \ + "\353\353\353\377\177\177\177\377!!!\377\203\0\0\0\377\12\11\17&\377\27" \ + "'^\377\31*e\377\30)d\377\40""1j\377DR\202\377AO\200\377BP\201\377BP\200" \ + "\377\40'>\377\202\0\0\0\377\1ppp\377\215\377\377\377\377\1\340\340\340" \ + "\377\203\0\0\0\377\3\7\7\7\377nnn\377\363\363\363\377\202\377\377\377" \ + "\377\1\376\376\376\377\213\377\377\377\377\1\376\376\376\377\202\377" \ + "\377\377\377\2\223\223\223\377\12\12\12\377\202\0\0\0\377\2\23\30(\377" \ + ";J|\377\204\377\202\0\0\0\377\1ppp\377\215\377\377\377\377\1\340" \ + "\340\340\377\202\0\0\0\377\2\20\20\20\377\246\246\246\377\202\377\377" \ + "\377\377\1\376\376\376\377\216\377\377\377\377\1\376\376\376\377\202" \ + "\377\377\377\377\1\261\261\261\377\203\0\0\0\377\1\40)D\377\204\377\202\0\0\0\377" \ + "\1ppp\377\215\377\377\377\377\4\340\340\340\377\0\0\0\377\15\15\15\377" \ + "\262\262\262\377\202\377\377\377\377\1\376\376\376\377\220\377\377\377" \ + "\377\1\376\376\376\377\202\377\377\377\377\1\232\232\232\377\202\0\0" \ + "\0\377\2\1\1\2\3777Dr\377\203\377\202\0\0\0\377" \ + "\1ppp\377\215\377\377\377\377\5\337\337\337\377\6\6\6\377\237\237\237" \ + "\377\377\377\377\377\376\376\376\377\224\377\377\377\377\3\376\376\376" \ + "\377\357\357\357\377CCC\377\202\0\0\0\377\1\31\37""4\377\203\377\202\0\0\0\377\1ppp\377\215\377\377" \ + "\377\377\4\336\336\336\377\215\215\215\377\377\377\377\377\376\376\376" \ + "\377\227\377\377\377\377\5\242\242\242\377\6\6\6\377\0\0\0\377\7\11\17" \ + "\3778Ft\377\203\377N[\211\377LX\205\377\30\34+\377\0\0\0\377\4\4\4\377\235\235" \ + "\235\377\214\377\377\377\377\1\376\376\376\377\202\377\377\377\377\1" \ + "\376\376\376\377\230\377\377\377\377\5yyy\377\1\1\1\377\0\0\0\377\4\7" \ + "\22\377\25%[\377\204\31*e\377\2\27'^\377\1\3\7\377\202\0\0\0\377\1oo" \ + "o\377\202\377\377\377\377\1\376\376\376\377\222\377\377\377\377\202\376" \ + "\376\376\377\214\377\377\377\377\4\376\376\376\377\377\377\377\377\361" \ + "\361\361\377FFF\377\202\0\0\0\377\2\6\12\30\377\377\202\0\0\0\377\1ppp\377\215\377\377\377\377\2\367\367\367" \ + "\377\377\377\377\377\202\376\376\376\377\227\377\377\377\377\5\352\352" \ + "\352\377%%%\377\0\0\0\377\3\3\6\377(2T\377\203\377\204R_\213\377\3Q_\212\377R_\213\377" \ + "S_\214\377\207R_\213\377\3Q^\212\377R_\213\377\35\"2\377\202\0\0\0\377" \ + "\1\261\261\261\377\220\377\377\377\377\1\304\304\304\377\202\0\0\0\377" \ + "\7\32\36.\377MZ\211\377LX\205\377\30\34+\377\0\0\0\377\4\4\4\377\235" \ + "\235\235\377\246\377\377\377\377\7\376\376\376\377\377\377\377\377\346" \ + "\346\346\377\30\30\30\377\0\0\0\377\0\0\1\377\17\31\77\377\204\31*e\377" \ + "\1\11\17%\377\202\0\0\0\377\4""999\377\350\350\350\377\377\377\377\377" \ + "\376\376\376\377\213\377\377\377\377\202\376\376\376\377\202\377\377" \ + "\377\377\4\351\351\351\377\305\305\305\377\307\307\307\377\352\352\352" \ + "\377\221\377\377\377\377\5\304\304\304\377\23\23\23\377\0\0\0\377\0\0" \ + "\2\377&0N\377\203BP\201\377\1\40'>\377\202\0\0\0\377\1ppp\377\214\377" \ + "\377\377\377\1\376\376\376\377\202\377\377\377\377\1\376\376\376\377" \ + "\231\377\377\377\377\1WWW\377\202\0\0\0\377\1\34#;\377\203\377\202\0\0\0\377\1p" \ + "pp\377\251\377\377\377\377\5\234\234\234\377\1\1\1\377\0\0\0\377\23\30" \ + "(\3779Gw\377\203\377\202\0\0\0\377\1ppp\377\222\377\377\377\377\1\376\376\376\377" \ + "\205\377\377\377\377\1\376\376\376\377\220\377\377\377\377\5\323\323" \ + "\323\377\1\1\1\377\0\0\0\377\14\17\31\3776Cp\377\203\377\202\0\0\0\377\1ppp\377\220\377\377\377\377\1\376\376\376\377" \ + "\202\377\377\377\377\5\346\346\346\377\266\266\266\377\255\255\255\377" \ + "\302\302\302\377\366\366\366\377\202\377\377\377\377\1\376\376\376\377" \ + "\216\377\377\377\377\5\376\376\376\377\1\1\1\377\0\0\0\377\6\10\16\377" \ + "3@j\377\203Kw\377'/J\377\202\0\0\0\377\4\1\1\1\377\237\237\237\377\377\377" \ + "\377\377\376\376\376\377\212\377\377\377\377\3\376\376\376\377\377\377" \ + "\377\377\334\334\334\377\202\0\0\0\377\1\5\7\13\377\202BP\201\377\1\40" \ + "'>\377\202\0\0\0\377\1ppp\377\217\377\377\377\377\12\376\376\376\377" \ + "\377\377\377\377\370\370\370\377]]]\377\24\24\24\377\16\16\16\377\14" \ + "\14\14\377\20\20\20\377$$$\377\243\243\243\377\221\377\377\377\377\4" \ + "\17\17\17\377\0\0\0\377\2\3\5\3771>g\377\203h\377\0\0\1" \ + "\377\0\0\0\377+++\377\340\340\340\377\216\377\377\377\377\3}}}\377\0" \ + "\0\0\377\330\330\330\377\214\377\377\377\377\2\355\355\355\377===\377" \ + "\202\0\0\0\377\2###\377\371\371\371\377\212\377\377\377\377\7\376\376" \ + "\376\377\377\377\377\377\245\245\245\377\2\2\2\377hhh\377\377\377\377" \ + "\377\376\376\376\377\215\377\377\377\377\202\0\0\0\377\6\0\1\3\377\27" \ + "'`\377\31*e\377)9p\3773Bw\377*6d\377\202\0\0\0\377\2EEE\377\370\370\370" \ + "\377\221\377\377\377\377\17\367\367\367\377kkk\377\27\27\27\377\12\12" \ + "\12\377\6\6\6\377\12\12\12\377\25\25\25\377222\377{{{\377\40\40\40\377" \ + "\0\0\0\377\0\1\3\377\20\33A\377\31*e\377\17\32@\377\202\0\0\0\377\1\6" \ + "\6\6\377\204\17\17\17\377\2\12\12\12\377\233\233\233\377\216\377\377" \ + "\377\377\2\367\367\367\377\4\4\4\377\207\17\17\17\377\1\7\7\7\377\202" \ + "\0\0\0\377\1\16\31<\377\215\31*e\377\2\30)d\377\31*e\377\204(8o\377\1" \ + "&6o\377\205'7o\377\1!2k\377\233\31*e\377\6\27(c\3773Bv\377HU\204\377" \ + "IV\205\377HU\204\377IV\205\377\206JW\206\377\2IV\206\377JW\206\377\205" \ + "KX\206\377\2JW\205\377KX\206\377\206LY\207\377\2LX\207\377LY\207\377" \ + "\206LZ\207\377\2KZ\206\377LZ\207\377\207MZ\210\377\210N[\211\377\202" \ + "O\\\211\377\202\0\0\0\377\2\33\33\33\377\357\357\357\377\220\377\377" \ + "\377\377\1BBB\377\202\0\0\0\377\1DOt\377\205R_\213\377\202Q_\212\377" \ + "\206R_\213\377\4Q^\212\377R_\213\377Q^\212\3775>[\377\202\0\0\0\377\1" \ + "qqq\377\217\377\377\377\377\2\376\376\376\377\362\362\362\377\202\0\0" \ + "\0\377\7\12\14\22\377N[\211\377LX\205\377\30\34+\377\0\0\0\377\4\4\4" \ + "\377\235\235\235\377\220\377\377\377\377\2\242\242\242\377\7\7\7\377" \ + "\202\0\0\0\377\4\1\1\2\377\2\2\3\377\1\2\3\377\0\0\1\377\202\0\0\0\377" \ + "\1kkk\377\217\377\377\377\377\1\367\367\367\377\202\0\0\0\377\3\1\2\5" \ + "\377\31*e\377\16\30""9\377\202\0\0\0\377\3}}}\377\377\377\377\377\376" \ + "\376\376\377\215\377\377\377\377\1\6\6\6\377\202\0\0\0\377\2(1M\377C" \ + "Q\201\377\204CQ\200\377\2CP\177\377\32\37""2\377\202\0\0\0\377\1:::\377" \ + "\215\377\377\377\377\202\376\376\376\377\1&&&\377\202\0\0\0\377\3""8" \ + "Dn\377BP\200\377\40'>\377\202\0\0\0\377\1ppp\377\220\377\377\377\377" \ + "\2\352\352\352\377...\377\207\0\0\0\377\1\254\254\254\377\202\376\376" \ + "\376\377\216\377\377\377\377\1%%%\377\202\0\0\0\377\1""0\377\202\0\0\0\377\1ppp\377\216\377\377\377\377\3" \ + "\376\376\376\377\371\371\371\377ddd\377\202\0\0\0\377\4\1\1\2\377\13" \ + "\15\26\377\6\11\25\377\3\5\16\377\202\0\0\0\377\2\26\26\26\377\370\370" \ + "\370\377\217\377\377\377\377\1""222\377\202\0\0\0\377\1/;c\377\203t\377HU\204\377IV\205\377HU\204\377" \ + "IV\205\377\206JW\206\377\2IV\206\377JW\206\377\205KX\206\377\202JW\205" \ + "\377\1KX\206\377\205LY\207\377\2LX\207\377LY\207\377\206LZ\207\377\2" \ + "KZ\206\377LZ\207\377\207MZ\210\377\2N[\211\377MZ\210\377\206N[\211\377" \ + "\202O\\\211\377\4\5\6\11\377\0\0\0\377\16\16\16\377\355\355\355\377\220" \ + "\377\377\377\377\1UUU\377\202\0\0\0\377\1>Gi\377\216R_\213\377\3Q^\212" \ + "\377P]\211\377,3K\377\202\0\0\0\377\1\210\210\210\377\220\377\377\377" \ + "\377\1\350\350\350\377\202\0\0\0\377\7\20\23\35\377N[\211\377LX\205\377" \ + "\30\34+\377\0\0\0\377\4\4\4\377\235\235\235\377\216\377\377\377\377\2" \ + "\376\376\376\377\254\254\254\377\202\0\0\0\377\2\5\6\12\377BMu\377\202" \ + "LY\207\377\3KX\206\377HU\202\377\25\31'\377\202\0\0\0\377\1TTT\377\216" \ + "\377\377\377\377\2\374\374\374\377ooo\377\202\0\0\0\377\6\20\34C\377" \ + "\3\5\14\377\0\0\0\377\15\15\15\377\377\377\377\377\376\376\376\377\213" \ + "\377\377\377\377\3\376\376\376\377\377\377\377\377hhh\377\215\0\0\0\377" \ + "\2\13\13\13\377\254\254\254\377\215\377\377\377\377\2\376\376\376\377" \ + "\256\256\256\377\202\0\0\0\377\3\23\30&\377BP\200\377\40'>\377\202\0" \ + "\0\0\377\1ppp\377\216\377\377\377\377\3\376\376\376\377\327\327\327\377" \ + "\14\14\14\377\202\0\0\0\377\5#*F\3777Ds\377\35-e\377\24#V\377\4\7\21" \ + "\377\202\0\0\0\377\1\273\273\273\377\217\377\377\377\377\1""555\377\202" \ + "\0\0\0\377\1/;b\377\203[\377\213R_\213\377\6Q^\212\377R_\213\377" \ + "Q^\212\377P]\211\377Q^\212\377#)=\377\202\0\0\0\377\1\236\236\236\377" \ + "\220\377\377\377\377\1\324\324\324\377\202\0\0\0\377\7\25\31&\377N[\211" \ + "\377LX\205\377\30\34+\377\0\0\0\377\4\4\4\377\235\235\235\377\216\377" \ + "\377\377\377\2\373\373\373\377ggg\377\202\0\0\0\377\1$*A\377\204LY\207" \ + "\377\6JW\205\3772:Y\377\3\4\6\377\0\0\0\377+++\377\346\346\346\377\215" \ + "\377\377\377\377\2\376\376\376\377\231\231\231\377\202\0\0\0\377\1\13" \ + "\23.\377\202\0\0\0\377\3EEE\377\377\377\377\377\376\376\376\377\215\377" \ + "\377\377\377\1+++\377\216\0\0\0\377\1\213\213\213\377\216\377\377\377" \ + "\377\1\316\316\316\377\202\0\0\0\377\3\5\6\13\377BP\200\377\40'>\377" \ + "\202\0\0\0\377\1ppp\377\217\377\377\377\377\1\235\235\235\377\202\0\0" \ + "\0\377\6\15\20\33\377\77M~\377;J{\377\36/h\377\30)d\377\15\26""7\377" \ + "\202\0\0\0\377\1www\377\217\377\377\377\377\1""555\377\202\0\0\0\377" \ + "\1/;b\377\203h\377\202\0\0\0\377\3""444\377\374\374" \ + "\374\377\376\376\376\377\214\377\377\377\377\2\371\371\371\377\373\373" \ + "\373\377\213\377\377\377\377\3\376\376\376\377\377\377\377\377\12\12" \ + "\12\377\204\0\0\0\377\2///\377\341\341\341\377\214\377\377\377\377\3" \ + "\363\363\363\377\377\377\377\377\376\376\376\377\215\377\377\377\377" \ + "\11\15\15\15\377\0\0\0\377\1\2\5\377\23!P\377\30)d\377\31*e\377*9p\377" \ + "3Bw\377*6d\377\202\0\0\0\377\2EEE\377\370\370\370\377\217\377\377\377" \ + "\377\1\263\263\263\377\202\0\0\0\377\2\4\6\20\377\27'_\377\205\31*e\377" \ + "\3\26&\\\377\20\34D\377\17\32@\377\210\31*e\377\2\30)c\377\12\22,\377" \ + "\202\0\0\0\377\1\225\225\225\377\216\377\377\377\377\1\367\367\367\377" \ + "\202\0\0\0\377\2\3\6\17\377\27(`\377\225\31*e\377\2\30)d\377\31+f\377" \ + "\204(8o\377\1&6o\377\205'7o\377\1!1j\377\233\31*e\377\3\27(d\377(8o\377" \ + "GT\203\377\202IV\205\377\2HU\204\377IV\205\377\205JW\206\377\2IV\206" \ + "\377JW\206\377\206KX\206\377\2JW\205\377KX\206\377\205LY\207\377\1LX" \ + "\207\377\202LY\207\377\205LZ\207\377\2KZ\206\377LZ\207\377\206MZ\210" \ + "\377\2LY\207\377MZ\210\377\206N[\211\377\4MZ\211\377N[\211\377O\\\211" \ + "\377\21\24\37\377\202\0\0\0\377\1\346\346\346\377\220\377\377\377\377" \ + "\1\213\213\213\377\202\0\0\0\377\1)0G\377\202R_\213\377\1Q^\212\377\206" \ + "R_\213\377\1Q^\212\377\202R_\213\377\2Q^\212\377P]\211\377\202Q^\212" \ + "\377\1\30\34)\377\202\0\0\0\377\1\275\275\275\377\220\377\377\377\377" \ + "\1\272\272\272\377\202\0\0\0\377\7\34!2\377N[\211\377LX\205\377\30\34" \ + "+\377\0\0\0\377\4\4\4\377\235\235\235\377\216\377\377\377\377\2\370\370" \ + "\370\377000\377\202\0\0\0\377\1@Kq\377\204LY\207\377\6JW\205\377CNw\377" \ + "\7\10\15\377\0\0\0\377\30\30\30\377\307\307\307\377\216\377\377\377\377" \ + "\1\270\270\270\377\202\0\0\0\377\1\4\7\21\377\202\0\0\0\377\1ppp\377" \ + "\217\377\377\377\377\1\335\335\335\377\215\327\327\327\377\2\326\326" \ + "\326\377\353\353\353\377\216\377\377\377\377\6\332\332\332\377\33\33" \ + "\33\377\0\0\0\377\0\0\1\377BP\200\377\40'\77\377\202\0\0\0\377\1ppp\377" \ + "\217\377\377\377\377\1```\377\202\0\0\0\377\6$,I\377\77M~\377:Hz\377" \ + "\36.h\377\30)d\377\22\36H\377\202\0\0\0\377\1TTT\377\217\377\377\377" \ + "\377\1""555\377\202\0\0\0\377\1/;b\377\203K{\377\77M~\3778Fy\377\35-g\377\30)d\377\24" \ + "!P\377\202\0\0\0\377\1DDD\377\217\377\377\377\377\1""555\377\202\0\0" \ + "\0\377\1/;b\377\203>>\377\202\0\0\0\377\7>In\377N[\211\377LX\205\377\30" \ + "\34+\377\0\0\0\377\4\4\4\377\235\235\235\377\216\377\377\377\377\1\364" \ + "\364\364\377\202\0\0\0\377\1\13\15\24\377\203LY\207\377\10KX\206\377" \ + "LY\207\377JW\205\377KX\206\377\21\24\37\377\0\0\0\377\3\3\3\377\244\244" \ + "\244\377\216\377\377\377\377\2\315\315\315\377\15\15\15\377\204\0\0\0" \ + "\377\1\252\252\252\377\255\377\377\377\377\2\360\360\360\377KKK\377\202" \ + "\0\0\0\377\2""1;_\377\")A\377\202\0\0\0\377\1ppp\377\217\377\377\377" \ + "\377\1\16\16\16\377\202\0\0\0\377\6@N\177\377\77M~\3776Ex\377\34-g\377" \ + "\30)d\377\24!P\377\202\0\0\0\377\1DDD\377\217\377\377\377\377\1""555" \ + "\377\202\0\0\0\377\1/;b\377\203\377\31*e\377\30" \ + ")d\377\33+f\377,;r\3773Bw\377*6d\377\202\0\0\0\377\2EEE\377\370\370\370" \ + "\377\216\377\377\377\377\5\270\270\270\377\7\7\7\377\0\0\0\377\5\11\25" \ + "\377\26%[\377\221\31*e\377\2\30)c\377\12\22,\377\202\0\0\0\377\1\225" \ + "\225\225\377\216\377\377\377\377\1\367\367\367\377\202\0\0\0\377\2\3" \ + "\6\17\377\27'_\377\225\31*e\377\2\30)d\377\33,g\377\204(8o\377\1&6o\377" \ + "\205'7o\377\1\40""1j\377\233\31*e\377\3\30)d\377\26(c\377DQ\201\377\202" \ + "IV\205\377\2HU\204\377IV\205\377\206JW\206\377\2IV\206\377JW\206\377" \ + "\206KX\206\377\2JW\205\377KX\206\377\205LY\207\377\2LX\207\377LY\207" \ + "\377\206LZ\207\377\2KZ\206\377LZ\207\377\206MZ\210\377\2LY\207\377MZ" \ + "\210\377\206N[\211\377\3MZ\211\377N[\211\377DOv\377\202\0\0\0\377\3," \ + ",,\377\377\377\377\377\376\376\376\377\216\377\377\377\377\2\371\371" \ + "\371\377hhh\377\202\0\0\0\377\1!&8\377\216Q^\212\377\1\27\33(\377\202" \ + "\0\0\0\377\2\177\177\177\377\374\374\374\377\220\377\377\377\377\12\5" \ + "\5\5\377\0\0\0\377\1\1\2\377FQ{\377N[\211\377LX\205\377\30\34+\377\0" \ + "\0\0\377\4\4\4\377\235\235\235\377\216\377\377\377\377\1\364\364\364" \ + "\377\202\0\0\0\377\1\12\14\23\377\204LY\207\377\7KX\206\377JW\205\377" \ + "KX\206\377\17\22\34\377\0\0\0\377\4\4\4\377\246\246\246\377\216\377\377" \ + "\377\377\2\316\316\316\377\16\16\16\377\204\0\0\0\377\1\251\251\251\377" \ + "\255\377\377\377\377\2\363\363\363\377SSS\377\202\0\0\0\377\2.8Z\377" \ + "\")A\377\202\0\0\0\377\1ppp\377\217\377\377\377\377\11\11\11\11\377\0" \ + "\0\0\377\1\2\3\377@N\177\377\77M~\3774Cw\377\33,f\377\30)d\377\24!P\377" \ + "\202\0\0\0\377\1DDD\377\217\377\377\377\377\1""555\377\202\0\0\0\377" \ + "\1/;b\377\203L}\377\77M~\377/=s\377\31)e\377\30)d\377\24!P\377\202\0\0" \ + "\0\377\1DDD\377\217\377\377\377\377\1""555\377\202\0\0\0\377\1/;b\377" \ + "\203l\377\2028Fz\377\2""2@o\377\11\14\26\377\202\0" \ + "\0\0\377\1\320\320\320\377\227\377\377\377\377\2\371\371\371\377kkk\377" \ + "\202\0\0\0\377\1\15\25""4\377\202\31*e\377\5\30)d\377\34-g\377.>t\377" \ + "3Bw\377*6d\377\202\0\0\0\377\2EEE\377\370\370\370\377\216\377\377\377" \ + "\377\1ccc\377\202\0\0\0\377\1\13\23/\377\222\31*e\377\2\30)c\377\12\22" \ + ",\377\202\0\0\0\377\1\225\225\225\377\216\377\377\377\377\1\367\367\367" \ + "\377\202\0\0\0\377\2\3\6\17\377\27'_\377\225\31*e\377\2\30)d\377\35." \ + "h\377\202(8o\377\3'7o\377(8o\377&6o\377\203'7o\377\4&6o\377'7o\377\36" \ + "/h\377\30)d\377\233\31*e\377\6\30)d\377\37""0i\377KW\206\377HU\204\377" \ + "IV\205\377HU\204\377\207JW\206\377\1IV\206\377\207KX\206\377\1JW\205" \ + "\377\206LY\207\377\2LX\207\377LY\207\377\207LZ\207\377\1KZ\206\377\207" \ + "MZ\210\377\3LY\207\377N[\211\377MZ\210\377\205N[\211\377\6MZ\211\377" \ + "9Ce\377\3\4\6\377\0\0\0\377\21\21\21\377\354\354\354\377\216\377\377" \ + "\377\377\1\376\376\376\377\202\377\377\377\377\1hhh\377\203\0\0\0\377" \ + "\3\6\7\12\377-4M\377KW\200\377\204Q^\212\377\3JV\177\377-4M\377\6\7\13" \ + "\377\203\0\0\0\377\1fff\377\202\377\377\377\377\1\376\376\376\377\216" \ + "\377\377\377\377\5\336\336\336\377\24\24\24\377\0\0\0\377\6\7\12\377" \ + ";Dg\377\202N[\211\377\5LX\205\377\30\34+\377\0\0\0\377\4\4\4\377\235" \ + "\235\235\377\216\377\377\377\377\2\375\375\375\377\212\212\212\377\202" \ + "\0\0\0\377\1\20\23\35\377\202LY\207\377\203KX\206\377\5*1K\377\1\1\2" \ + "\377\0\0\0\377666\377\367\367\367\377\215\377\377\377\377\2\376\376\376" \ + "\377\257\257\257\377\202\0\0\0\377\4\11\20(\377\1\3\7\377\0\0\0\377;" \ + ";;\377\217\377\377\377\377\1""666\377\236\3\3\3\377\1\1\1\1\377\202\0" \ + "\0\0\377\2-6W\377\")B\377\202\0\0\0\377\1ppp\377\217\377\377\377\377" \ + "\3\10\10\10\377\0\0\0\377\2\2\3\377\202\77M~\377\1,;q\377\202\30)d\377" \ + "\1\24!P\377\202\0\0\0\377\1DDD\377\217\377\377\377\377\1""555\377\202" \ + "\0\0\0\377\1/;b\377\203h\377\7\11\17\377\0\0\0\377\27\27\27\377" \ + "\316\316\316\377\226\377\377\377\377\2\365\365\365\377ZZZ\377\202\0\0" \ + "\0\377\1\35$\77\377\2038Fz\377\2""7Fy\377\40*H\377\202\0\0\0\377\1""3" \ + "33\377\227\377\377\377\377\2\344\344\344\377\17\17\17\377\202\0\0\0\377" \ + "\203\31*e\377\5\30)d\377\35.h\3771@u\3772Av\377*6d\377\202\0\0\0\377" \ + "\2EEE\377\370\370\370\377\216\377\377\377\377\4UUU\377\0\0\0\377\0\0" \ + "\1\377\15\26""5\377\222\31*e\377\2\30)c\377\12\22,\377\202\0\0\0\377" \ + "\1\222\222\222\377\216\377\377\377\377\1\367\367\367\377\202\0\0\0\377" \ + "\2\3\6\17\377\27(`\377\202\31*e\377\6\30)b\377\26&\\\377\24!P\377\12" \ + "\20(\377\17\32\77\377\30)d\377\215\31*e\377\2\30)d\377\37""0i\377\203" \ + "(8o\377\207'7o\377\2\36.h\377\30)d\377\234\31*e\377\6\27(c\377=K|\377" \ + "JV\205\377IV\205\377HU\204\377IV\205\377\206JW\206\377\3IV\206\377KX" \ + "\206\377JW\206\377\205KX\206\377\3JW\205\377LY\207\377KX\206\377\205" \ + "LY\207\377\3LX\207\377LZ\207\377LY\207\377\205LZ\207\377\2KZ\206\377" \ + "LZ\207\377\210MZ\210\377\2N[\211\377MZ\210\377\205N[\211\377\6MZ\211" \ + "\377\"(=\377\0\0\1\377\0\0\0\377@@@\377\363\363\363\377\217\377\377\377" \ + "\377\202\376\376\376\377\3\377\377\377\377\236\236\236\377111\377\212" \ + "\0\0\0\377\3...\377\227\227\227\377\377\377\377\377\202\376\376\376\377" \ + "\217\377\377\377\377\5\362\362\362\377CCC\377\0\0\0\377\0\0\1\377$*\77" \ + "\377\203N[\211\377\5LX\205\377\30\34+\377\0\0\0\377\4\4\4\377\235\235" \ + "\235\377\217\377\377\377\377\2\372\372\372\377mmm\377\203\0\0\0\377\4" \ + "\23\26\"\377\"(=\377!';\377\14\16\26\377\202\0\0\0\377\2\23\23\23\377" \ + "\343\343\343\377\216\377\377\377\377\2\373\373\373\377```\377\202\0\0" \ + "\0\377\2\22\37L\377\12\21)\377\202\0\0\0\377\1\313\313\313\377\216\377" \ + "\377\377\377\1\266\266\266\377\203\0\0\0\377\2\22\26$\377\26\33*\377" \ + "\205\26\32*\377\2\25\32)\377\3\4\7\377\223\0\0\0\377\4\2\3\5\377\6\7" \ + "\14\377)1O\377\36$:\377\202\0\0\0\377\1ppp\377\217\377\377\377\377\11" \ + "\10\10\10\377\0\0\0\377\2\2\3\377\77M~\377>K}\377'7n\377\30)d\377\31" \ + "*e\377\24!P\377\202\0\0\0\377\1DDD\377\217\377\377\377\377\1""555\377" \ + "\202\0\0\0\377\1/;b\377\202c\377" \ + "\27\33,\377\1\1\2\377\202\0\0\0\377\11(((\377\311\311\311\377\271\271" \ + "\271\377\233\233\233\377~~~\377bbb\377EEE\377(((\377\13\13\13\377\213" \ + "\0\0\0\377\2\35#8\377\"*C\377\202\0\0\0\377\1ppp\377\217\377\377\377" \ + "\377\11\10\10\10\377\0\0\0\377\2\2\3\377\77M~\377;J{\377!1j\377\30)d" \ + "\377\31*e\377\24!P\377\202\0\0\0\377\1DDD\377\217\377\377\377\377\1""5" \ + "55\377\202\0\0\0\377\1/;b\377\202\377\202\0\0\0\377\1ppp\377\217\377\377" \ + "\377\377\11\10\10\10\377\0\0\0\377\1\2\3\377\77M~\3779Gz\377\32+e\377" \ + "\30)d\377\31*e\377\24!P\377\202\0\0\0\377\1DDD\377\217\377\377\377\377" \ + "\1""555\377\202\0\0\0\377\1/;b\377\202s\377JW\206\377IV\205\377HU\204\377IV\205\377" \ + "\206JW\206\377\2IV\206\377JW\206\377\206KX\206\377\2JW\205\377KX\206" \ + "\377\207LY\207\377\2LX\207\377LY\207\377\206LZ\207\377\4KZ\206\377LZ" \ + "\207\377MZ\210\377LZ\207\377\206MZ\210\377\3LY\207\377N[\211\377MZ\210" \ + "\377\205N[\211\377\2JW\203\377\23\26!\377\202\0\0\0\377\4///\377\356" \ + "\356\356\377\377\377\377\377\376\376\376\377\250\377\377\377\377\4\376" \ + "\376\376\377\377\377\377\377\365\365\365\377;;;\377\202\0\0\0\377\4\20" \ + "\23\35\377IU\200\377N[\211\377MZ\210\377\202N[\211\377\6MZ\210\377KW" \ + "\204\377\30\34+\377\0\0\0\377\4\4\4\377\235\235\235\377\247\377\377\377" \ + "\377\3\376\376\376\377\377\377\377\377\273\273\273\377\202\0\0\0\377" \ + "\13\4\6\20\377\26&\\\377\31*e\377\30)d\377&2`\377\5\6\12\377\0\0\0\377" \ + "\4\4\4\377\234\234\234\377\377\377\377\377\376\376\376\377\213\377\377" \ + "\377\377\16\376\376\376\377\377\377\377\377\376\376\376\377\311\311\311" \ + "\377\204\204\204\377III\377---\377,,,\377DDD\377yyy\377\272\272\272\377" \ + "\367\367\367\377\377\377\377\377\376\376\376\377\213\377\377\377\377" \ + "\1\376\376\376\377\202\377\377\377\377\1===\377\202\0\0\0\377\1\22\26" \ + "#\377\202BP\200\377\1\40'>\377\202\0\0\0\377\1ppp\377\217\377\377\377" \ + "\377\11\10\10\10\377\0\0\0\377\1\2\3\377\77M~\3777Fy\377\27(c\377\30" \ + ")d\377\31*e\377\24!P\377\202\0\0\0\377\1DDD\377\217\377\377\377\377\1" \ + "555\377\202\0\0\0\377\1/;b\377\202\377\202\0" \ + "\0\0\377\1ppp\377\217\377\377\377\377\6\10\10\10\377\0\0\0\377\1\2\3" \ + "\377\77M~\3772Au\377\26(c\377\202\31*e\377\1\24!P\377\202\0\0\0\377\1" \ + "DDD\377\217\377\377\377\377\1""555\377\202\0\0\0\377\5/;b\377;J|\377" \ + "\377\202\0\0\0\377\1ppp\377\217\377\377\377\377\6\10\10\10\377" \ + "\0\0\0\377\1\2\3\377\77M~\377,;q\377\27(c\377\202\31*e\377\1\24!P\377" \ + "\202\0\0\0\377\1DDD\377\217\377\377\377\377\1""555\377\202\0\0\0\377" \ + "\2/;b\377\377\202\0\0\0\377\1ppp\377" \ + "\217\377\377\377\377\6\10\10\10\377\0\0\0\377\1\2\3\377\77M~\377&6n\377" \ + "\27(d\377\202\31*e\377\1\24!P\377\202\0\0\0\377\1DDD\377\217\377\377" \ + "\377\377\1""555\377\202\0\0\0\377\4/;b\377l\377\2038Fz\377" \ + "\3""7Fy\3778Fz\3776Fx\377\2037Fy\377\1\5\7\14\377\202\0\0\0\377\1\341" \ + "\341\341\377\222\377\377\377\377\5\335\335\335\377\6\6\6\377\0\0\0\377" \ + "\3\6\17\377\25#V\377\205\31*e\377\4,\377\202\0\0\0\377\1ppp\377\217" \ + "\377\377\377\377\6\10\10\10\377\0\0\0\377\1\2\3\377\77M~\377\40""0i\377" \ + "\30)d\377\202\31*e\377\1\24!P\377\202\0\0\0\377\1DDD\377\217\377\377" \ + "\377\377\1""555\377\202\0\0\0\377\4/;b\377t\3773Bw\3772A" \ + "v\377*7e\377\202\0\0\0\377\2EEE\377\370\370\370\377\216\377\377\377\377" \ + "\4SSS\377\0\0\0\377\0\0\1\377\15\26""7\377\222\31*e\377\7\30)d\377\36" \ + ".h\377\30\40\77\377\0\1\2\377\0\0\0\377666\377\352\352\352\377\225\377" \ + "\377\377\377\1\244\244\244\377\202\0\0\0\377\1\14\24""0\377\214\31*e" \ + "\377\3\30)d\377\32+f\377&6n\377\203(8o\377\206'7o\377\3#4l\377\31*e\377" \ + "\30)d\377\236\31*e\377\7\30)d\377\34-g\377ES\202\377HV\205\377IV\205" \ + "\377HU\204\377IV\205\377\207JW\206\377\1IV\206\377\207KX\206\377\3JW" \ + "\205\377LY\207\377KX\206\377\207LY\207\377\2LZ\207\377LY\207\377\205" \ + "LZ\207\377\1KZ\206\377\202LZ\207\377\207MZ\210\377\4LY\207\377MZ\210" \ + "\377N[\211\377MZ\210\377\205N[\211\377\2JW\203\377\40%8\377\203\0\0\0" \ + "\377\2$$$\377\275\275\275\377\202\377\377\377\377\1\376\376\376\377\234" \ + "\377\377\377\377\1\376\376\376\377\202\377\377\377\377\2\275\275\275" \ + "\377$$$\377\203\0\0\0\377\7\36#5\377JV\202\377N[\211\377MZ\210\377N[" \ + "\211\377MZ\210\377LY\207\377\204MZ\210\377\5KW\204\377\30\34+\377\0\0" \ + "\0\377\4\4\4\377\235\235\235\377\216\377\377\377\377\2\372\372\372\377" \ + "\260\260\260\377\223\377\377\377\377\1\376\376\376\377\202\377\377\377" \ + "\377\1JJJ\377\203\0\0\0\377\1\22\37K\377\203\31*e\377\2\30)d\377\77M" \ + "~\377\202HU\204\377\3GU\204\377CQ~\377\27\34+\377\202\0\0\0\377\5\3\3" \ + "\3\377ttt\377\376\376\376\377\377\377\377\377\376\376\376\377\232\377" \ + "\377\377\377\1\376\376\376\377\202\377\377\377\377\2\261\261\261\377" \ + "\22\22\22\377\203\0\0\0\377\1""6Ai\377\202BP\201\377\4BP\200\377BP\177" \ + "\377BP\200\377\40'>\377\202\0\0\0\377\1ppp\377\217\377\377\377\377\6" \ + "\10\10\10\377\0\0\0\377\1\2\3\377\77M}\377\30*e\377\30)d\377\202\31*" \ + "e\377\1\24!P\377\202\0\0\0\377\1DDD\377\217\377\377\377\377\1""555\377" \ + "\202\0\0\0\377\4/;b\377>>\377\203\0\0\0\377\1\16\27""8\377\203\31*e\377\4" \ + "\30)d\377\37/h\377IV\205\377HU\204\377\203GU\204\377\2CP}\377\16\21\33" \ + "\377\203\0\0\0\377\3JJJ\377\357\357\357\377\376\376\376\377\202\377\377" \ + "\377\377\1\376\376\376\377\224\377\377\377\377\1\376\376\376\377\203" \ + "\377\377\377\377\3\366\366\366\377\206\206\206\377\4\4\4\377\202\0\0" \ + "\0\377\2\1\1\3\377-8^\377\203BP\201\377\4BP\200\377BP\177\377BP\200\377" \ + "\40'>\377\202\0\0\0\377\1ppp\377\217\377\377\377\377\5\10\10\10\377\0" \ + "\0\0\377\1\2\3\377:Hz\377\26'c\377\203\31*e\377\1\24!P\377\202\0\0\0" \ + "\377\1DDD\377\217\377\377\377\377\1""555\377\202\0\0\0\377\4/;b\377<" \ + "K}\377;J|\377:I{\377\205;J|\377\2:I{\377*5Y\377\202\0\0\0\377\3\77\77" \ + "\77\377\377\377\377\377\376\376\376\377\217\377\377\377\377\5\323\323" \ + "\323\377\37\37\37\377\0\0\0\377\4\5\11\377+6_\377\2058Fz\377\1""6Fx\377" \ + "\2047Fy\377\2""0>k\377\4\5\11\377\202\0\0\0\377\1\365\365\365\377\221" \ + "\377\377\377\377\4@@@\377\0\0\0\377\0\0\2\377\16\30:\377\204\31*e\377" \ + "\6\30)d\377\32*e\3774Cx\3772Av\3771@u\377*7e\377\202\0\0\0\377\2EEE\377" \ + "\370\370\370\377\216\377\377\377\377\4SSS\377\0\0\0\377\0\0\1\377\15" \ + "\26""7\377\222\31*e\377\4\30)d\377!1j\377->>\377" \ + "\203\0\0\0\377\12\2\4\13\377\32%L\377\77M\177\377BP\201\377BP\200\377" \ + "BP\201\377BP\200\377BP\177\377BP\200\377\40'>\377\202\0\0\0\377\1ppp" \ + "\377\217\377\377\377\377\5\10\10\10\377\0\0\0\377\1\2\3\3772@u\377\27" \ + "(c\377\203\31*e\377\1\24!P\377\202\0\0\0\377\1EEE\377\217\377\377\377" \ + "\377\1""555\377\202\0\0\0\377\4/;b\377i\377\1\2\3\377\0\0\0\377\4\4\4\377\221\377\377\377\377\5" \ + "\247\247\247\377\6\6\6\377\0\0\0\377\10\12\22\3777Ex\377\2058Fz\377\1" \ + "6Fx\377\2047Fy\377\2""4Br\377\20\24#\377\202\0\0\0\377\1\244\244\244" \ + "\377\220\377\377\377\377\5\342\342\342\377***\377\0\0\0\377\1\2\6\377" \ + "\22\37L\377\204\31*e\377\6\30)d\377\34-g\3774Cx\3772Av\3771@u\377*7e" \ + "\377\202\0\0\0\377\2EEE\377\371\371\371\377\216\377\377\377\377\4SSS" \ + "\377\0\0\0\377\0\0\1\377\15\26""7\377\222\31*e\377\2\30)d\377\"2k\377" \ + "\202->>\377\204\0\0\0\377\3\6\13\33\377\23\40P\377+;q\377" \ + "\203BP\201\377\2BP\200\377BP\177\377\202BP\200\377\1\40'>\377\202\0\0" \ + "\0\377\1rrr\377\217\377\377\377\377\5\10\10\10\377\0\0\0\377\2\2\3\377" \ + "(8o\377\27)d\377\203\31*e\377\1\24!P\377\202\0\0\0\377\1EEE\377\217\377" \ + "\377\377\377\1""666\377\202\0\0\0\377\3/;b\377;J|\377:I{\377\206;J|\377" \ + "\3:I{\3774Ao\377\13\16\30\377\202\0\0\0\377\1\317\317\317\377\220\377" \ + "\377\377\377\1vvv\377\202\0\0\0\377\1\24\31,\377\2068Fz\377\1""6Fx\377" \ + "\2057Fy\377\1\34#>\377\202\0\0\0\377\1RRR\377\220\377\377\377\377\5\303" \ + "\303\303\377\24\24\24\377\0\0\0\377\2\4\11\377\27'_\377\204\31*e\377" \ + "\6\30)d\377\37""0i\3774Cx\3772Av\3771@u\377*7e\377\202\0\0\0\377\2FF" \ + "F\377\374\374\374\377\216\377\377\377\377\4TTT\377\0\0\0\377\0\0\1\377" \ + "\15\26""7\377\221\31*e\377\7\30)e\377\30)d\377$4l\377.=s\377-b\377\11\13\21\377\204\0\0\0\377" \ + "\7\17\17\17\377\37\37\37\377@@@\377www\377\246\246\246\377\314\314\314" \ + "\377\352\352\352\377\207\377\377\377\377\10\372\372\372\377\343\343\343" \ + "\377\305\305\305\377\241\241\241\377ttt\377===\377\40\40\40\377\21\21" \ + "\21\377\204\0\0\0\377\12\0\0\2\377\16\30:\377\27'^\377\32+e\3772Av\377" \ + "BP\201\377AO\200\377BP\201\377BP\200\377BP\177\377\202BP\200\377\1\40" \ + "'>\377\202\0\0\0\377\2\20\20\20\377&&&\377\216%%%\377\5\1\1\1\377\0\0" \ + "\0\377\2\2\3\377\37""0i\377\30)d\377\203\31*e\377\1\24!P\377\202\0\0" \ + "\0\377\2\12\12\12\377'''\377\215%%%\377\2'''\377\7\7\7\377\202\0\0\0" \ + "\377\3/;b\377;J|\377:I{\377\206;J|\377\3:I{\3777Ev\377\25\32-\377\202" \ + "\0\0\0\377\2\32\32\32\377&&&\377\216%%%\377\2$$$\377\16\16\16\377\202" \ + "\0\0\0\377\1&/S\377\2048Fz\377\3""7Fy\3778Fz\3776Fx\377\2057Fy\377\5" \ + "&0T\377\2\3\5\377\0\0\0\377\7\7\7\377'''\377\217%%%\377\4\32\32\32\377" \ + "\1\1\1\377\0\0\0\377\5\10\24\377\205\31*e\377\6\30)d\377#3l\3774Cw\377" \ + "2Av\3771@u\377*7e\377\202\0\0\0\377\2\12\12\12\377$$$\377\215%%%\377" \ + "\5'''\377\14\14\14\377\0\0\0\377\0\0\1\377\15\26""7\377\221\31*e\377" \ + "\202\30)d\377\6%5m\377.=s\377->>\377\206\206\206\377\274\274\274\377" \ + "\343\343\343\377\206\377\377\377\377\11\371\371\371\377\340\340\340\377" \ + "\301\301\301\377\234\234\234\377rrr\377AAA\377$$$\377\27\27\27\377\2" \ + "\2\2\377\202\0\0\0\377\214\31*e\377\3\30)d\377\37/i\377'7n\377\202(8" \ + "o\377\2'7o\377&6o\377\204'7o\377\3&6n\377\37""0i\377\30)d\377\232\31" \ + "*e\377\2\37""0i\377\30)d\377\205\31*e\377\3\30)d\377\34-g\377ER\202\377" \ + "\202IV\205\377\4HU\204\377IV\205\377JW\206\377IV\205\377\204JW\206\377" \ + "\1IV\206\377\202JW\206\377\206KX\206\377\1JW\205\377\202KX\206\377\207" \ + "LY\207\377\3LX\207\377LZ\207\377LY\207\377\206LZ\207\377\1KZ\206\377" \ + "\202LZ\207\377\210MZ\210\377\202LY\207\377\3MZ\210\377N[\211\377MZ\210" \ + "\377\207N[\211\377\4;Eh\377\22\26!\377\0\1\1\377\0\0\1\377\212\0\0\0" \ + "\377\5\13\13\13\377\24\24\24\377\27\27\27\377\23\23\23\377\11\11\11\377" \ + "\211\0\0\0\377\202\0\0\1\377\2\17\22\33\3778Bc\377\204N[\211\377\203" \ + "MZ\210\377\202LY\207\377\206MZ\210\377\7LZ\207\377MZ\210\377JW\203\377" \ + "\27\34*\377\0\0\0\377\4\4\4\377\235\235\235\377\216\377\377\377\377\2" \ + "\366\366\366\377\13\13\13\377\202\0\0\0\377\1\0\0\1\377\207\0\0\0\377" \ + "\2\11\11\11\377\5\5\5\377\207\0\0\0\377\4\1\1\2\377\22\27*\377\27'_\377" \ + "\30)d\377\204\31*e\377\7\30)d\377\27(c\3777Fx\377GT\203\377HU\204\377" \ + "GU\204\377FU\204\377\206GU\204\377\4FT\203\377ES\202\377&.H\377\4\5\10" \ + "\377\213\0\0\0\377\4\6\6\6\377\13\13\13\377\11\11\11\377\3\3\3\377\213" \ + "\0\0\0\377\3\0\0\1\377\11\17%\377\26&[\377\202\31*e\377\2\34-g\377:H" \ + "{\377\203BP\201\377\2BP\200\377BP\177\377\202BP\200\377\1\40'>\377\224" \ + "\0\0\0\377\3\1\2\3\377\31*e\377\30)d\377\203\31*e\377\1\24!P\377\225" \ + "\0\0\0\377\3/;b\377;J|\377:I{\377\206;J|\377\3:I{\3779Hz\377\36&A\377" \ + "\226\0\0\0\377\1""7Ex\377\2058Fz\377\2""7Fy\3776Fx\377\2057Fy\377\2/" \ + "\377" \ + "\32\37/\377\23\27\"\377\16\20\30\377\11\13\20\377\5\6\12\377\3\3\5\377" \ + "\2\2\3\377\1\1\2\377\2\2\3\377\3\4\6\377\6\7\13\377\12\14\22\377\20\22" \ + "\34\377\26\32(\377\36$6\377(/G\3773;Z\377\77Jp\377\205N[\211\377\1MZ" \ + "\210\377\202N[\211\377\2MZ\210\377LY\207\377\212MZ\210\377\7LZ\207\377" \ + "KZ\206\377JW\203\377\30\34*\377\0\0\0\377\4\4\4\377\235\235\235\377\216" \ + "\377\377\377\377\30\366\366\366\377\13\13\13\377\0\0\0\377\3\4\6\377" \ + "KX\206\377GT\200\3774=_\377&-D\377\31\35.\377\20\23\35\377\11\12\20\377" \ + "\5\6\11\377\3\4\6\377\4\4\7\377\6\10\14\377\14\16\26\377\25\30&\377\37" \ + "%9\377-5R\377L}\377\27(c\377\30)d\377\205\31*e\377" \ + "\6\30)d\377*:p\377GT\203\377HU\204\377GU\204\377FU\204\377\205GU\204" \ + "\377\202FT\203\377\1ES\202\377\205FT\203\377\26" \ + "t\3773Bv\3771@u\3772Av\3770>q\377\"-Q\377\203#.S\377\2\".S\377\".R\377" \ + "\206\".S\377\3\"-S\377\37*P\377\23\37H\377\205\21\35G\377\2\21\35H\377" \ + "\25$W\377\221\31*e\377\5\30)d\377\33,f\377)9p\377.=s\377,;q\377\205-" \ + "Ip\377>Iq\377\77K" \ + "s\377BMw\377DP|\377GT\202\377IV\205\377HU\204\377JW\205\377&6m\377\27" \ + "(d\377\206\31*e\377\6\32+f\3778Gz\377IU\204\377HT\203\377GU\204\377F" \ + "U\204\377\206GU\204\377\2FT\203\377ES\202\377\205FT\203\377\202ES\203" \ + "\377\21DR\203\377DR\201\377AN|\377\77Kw\377=It\377Kw\377\32*a\377\27(c\377\211" \ + "\31*e\377\4\30)d\3773Bw\377CQ\201\377BP\201\377\202BP\200\377\1BP\177" \ + "\377\205BP\200\377\202AO\200\377\1@N\200\377\206AO\200\377\2@N\177\377" \ + "\77M~\377\206@N\177\377\3>L}\377@N\177\377&5m\377\216\31*e\377\3-=s\377" \ + "=K}\377s\377\27(d\377\30)d\377\222\31*e\377\2\30)d\377\30(d\377\2022Av\377" \ + "\1""1@u\377\2062Av\377\2""1Au\3770At\377\2051Au\377\2020@u\377\2*;q\377" \ + "\32+f\377\230\31*e\377\5\30)d\377\34,g\377+:q\377.=s\377,;q\377\205-" \ + "L}\377" \ + "\37""0i\377\30)d\377\214\31*e\377\2\33,f\3773Bv\377\205=K}\377\2t\377CQ\201\377\202BP\201\377\2BP\200\377BP\177" \ + "\377\206BP\200\377\2AO\200\377@N\200\377\206AO\200\377\2@N\177\377\77" \ + "M~\377\206@N\177\377\5>L}\377\77M~\3772Av\377\32+f\377\30)d\377\213\31" \ + "*e\377\2\30)d\377\37""0i\377\204=K}\377\2s\377-L~\377L}\377\204=K}\377\2t\377\37""0j\377\30)d\377\231\31*e\377\2$4l\377.=s\377\210-" \ + "Js\377vvv\377\33\33" \ + "\33\377\202\23\23\23\377\25\21\21\21\377***\377\224\225\226\377NZ\205" \ + "\377GU\204\377HV\204\377\217\217\217\377+++\377\21\21\21\377\23\23\23" \ + "\377\24\24\24\377LLL\377z\200\222\377FT\203\377\211\212\217\377<<<\377" \ + "\17\17\17\377\23\23\23\377\24\24\24\377XXY\377iq\216\377\204ES\203\377" \ + "\207DR\202\377\3@N\177\377\40""0i\377\30)d\377\211\31*e\377\17\27(c\377" \ + ".>s\377AO\200\377BP\201\377BP\200\377BP\201\377BP\200\377Wa\205\377i" \ + "ii\377\24\24\24\377\23\23\23\377\22\22\22\377222\377ux\203\377CQ\200" \ + "\377\205AO\200\377\2@N\177\377AO\200\377\207@N\177\377\202\77M~\377\3" \ + ":I{\377\36/i\377\30)d\377\214\31*e\377\2\30)d\3779Gz\377\205=K}\377\2" \ + "t\3772Av\3771@u\377\2042Av\377\3n" \ + "t\207\377PPP\377\16\16\16\377\202\23\23\23\377\2===\377ov\214\377\203" \ + "1Au\377\4""0@u\377-=s\377\35.h\377\30)d\377\231\31*e\377\2'6o\377.=s" \ + "\377\210-L~\377BP\201\377BP\200\377BP\201" \ + "\377BP\200\377BP\177\377Wb\206\377ccc\377\1\1\1\377\202\0\0\0\377\3#" \ + "##\377sw\201\377BP\200\377\204AO\200\377\4@N\177\377AO\200\377@N\177" \ + "\377\77M~\377\204@N\177\377\2\77M~\377@N\177\377\202\77M~\377\2.=r\377" \ + "\27(c\377\214\31*e\377\3\27)d\377'7o\377>L}\377\204=K}\377\202L~\377IV\205\377HU\204\377IV\205\377HU\204\377" \ + "IV\205\377\207JW\206\377\1IV\206\377\202JW\206\377\210KX\206\377\4JW" \ + "\205\377KX\206\377LY\207\377KX\206\377\207LY\207\377\4LX\207\377LY\207" \ + "\377LZ\207\377LY\207\377\212LZ\207\377\1KZ\206\377\202LZ\207\377\203" \ + "MZ\210\377\1LZ\207\377\240MZ\210\377\202LZ\207\377\202KZ\206\377\211" \ + "LZ\207\377\11LY\207\377LZ\207\377LY\207\377LX\207\377JU\203\377\30\34" \ + "*\377\0\0\0\377\4\4\4\377\235\235\235\377\216\377\377\377\377\4\366\366" \ + "\366\377\13\13\13\377\0\0\0\377\3\4\6\377\206JW\206\377\202IV\205\377" \ + "\1HU\204\377\202IV\205\377\4JW\206\377@Lv\377sss\377\12\12\12\377\202" \ + "\0\0\0\377\6\14\14\14\377sss\3771>n\377\37/g\377\203\203\203\377\36\36" \ + "\36\377\205\0\0\0\377\5///\377\212\215\227\377GU\204\377{\200\220\377" \ + "]]]\377\203\0\0\0\377\6\7\7\7\377\220\222\227\377S_\205\377FT\203\377" \ + "qw\213\377uz\212\377\203sx\212\377\2uz\213\377Yc\207\377\203ES\203\377" \ + "\2DR\202\377CQ\201\377\204DR\202\377\4IV\202\377ES\200\377\40""0h\377" \ + "\30)d\377\206\31*e\377\5\40""0g\377#2h\377\"2h\377\37/f\377+;q\377\203" \ + "BP\201\377\202BP\200\377\4BP\177\377Wb\206\377ccc\377\1\1\1\377\202\0" \ + "\0\0\377\3###\377sw\201\377BP\200\377\205AO\200\377\202@N\177\377\3E" \ + "R\177\377FS\200\377GS\200\377\203@N\177\377\203\77M~\377\2\"2k\377\30" \ + ")d\377\205\31*e\377\1\"1h\377\203\"2h\377\203\31*e\377\2\26(c\3772Bv" \ + "\377\205=K}\377\6s\377.=s\377\202-r\377+>>\377\203\0\0\0\377\7$$$\377\216\216\216\377>Jr\377\31*e\377W`}\377" \ + "\206\206\206\377\21\21\21\377\203\0\0\0\377\4JJJ\377xxx\377yyy\377OO" \ + "O\377\203\0\0\0\377\6\20\20\20\377\213\213\213\377X`}\377\30)d\377ot" \ + "\206\377sss\377\205\0\0\0\377\1\20\20\20\377\202\0\0\0\377\1\16\16\16" \ + "\377\203\0\0\0\377\6""111\377pw\215\3771Au\377;Ix\377\215\215\216\377" \ + "DDD\377\203\0\0\0\377\4\2\2\2\377000\377\77\77\77\377\27\27\27\377\203" \ + "\0\0\0\377\7\20\20\20\377rrr\377]e\200\377\31*e\377)8l\377mmm\377\14" \ + "\14\14\377\202\0\0\0\377\2&&&\377###\377\207\0\0\0\377\2\"\"\"\377\6" \ + "\6\6\377\207\0\0\0\377\2\203\203\203\377+K{\377\206\207\214\377***\377" \ + "\203\0\0\0\377\6WWW\377\216\216\220\377Wa\202\377bj\205\377\223\223\225" \ + "\377###\377\203\0\0\0\377\5```\377z~\212\377\34-f\377\201\204\221\377" \ + "111\377\203\0\0\0\377\6DDE\377\221\221\221\377PYz\377LVx\377\220\221" \ + "\223\377CCD\377\203\0\0\0\377\5;;;\377\200\203\217\377%4i\377\211\213" \ + "\223\377+++\377\203\0\0\0\377\5\5\5\5\377qqq\377\217\217\217\377\211" \ + "\211\211\377&&&\377\204\0\0\0\377\5""111\377pw\215\3771Au\377ho\206\377" \ + "www\377\203\0\0\0\377\6\7\7\7\377bbb\377\216\216\217\377\202\204\212" \ + "\377\206\206\206\377,,-\377\203\0\0\0\377\6""222\377\210\211\213\377" \ + "\32+e\377)8l\377mmm\377\14\14\14\377\203\0\0\0\377\5\7\7\7\377jjj\377" \ + "\212\212\212\377[[[\377\7\7\7\377\204\0\0\0\377\4\27\27\27\377zzz\377" \ + "\206\206\206\377/00\377\204\0\0\0\377\1fff\377\203,s\377\27(c\377Ya\200\377BBB\377" \ + "\204\0\0\0\377\3ppp\377ou\212\377PZ}\377\204S\\~\377\6Q[{\377.M}\377]f\205\377\223\224\231\377555\377\202\0\0\0\377\4\2\2\2\377" \ + "|||\377O[\201\377;J|\377\205:I{\377\5""5Dw\377\26'c\377\31*e\377Ya\200" \ + "\377BBB\377\204\0\0\0\377\2lll\377JTx\377\207\31*e\377\4\27(d\377bi\205" \ + "\377HHH\377\1\1\1\377\202\0\0\0\377\3>>>\377|\177\212\3778Fz\377\203" \ + "7Fy\377\3\77M{\377\203\203\203\377\34\34\34\377\202\0\0\0\377\17\7\7" \ + "\7\377mmm\377uz\212\3777Fx\377=Kz\377z~\214\377\215\215\215\377\214\214" \ + "\214\377}\200\210\377rv\204\377in\202\377T]{\377&5j\377\206\210\221\377" \ + "\30\30\30\377\203\0\0\0\377\16kkk\377\201\203\214\377\37/g\377\32+e\377" \ + "lr\205\377\216\216\216\377\214\214\214\377\177\201\210\377vy\205\377" \ + "fl\200\377QZz\377,:n\377\214\216\225\377(((\377\203\0\0\0\377\5\"\"\"" \ + "\377\222\222\222\377~\201\213\377\216\216\220\377nno\377\204\0\0\0\377" \ + "\5""111\377pw\215\3770@u\377z~\213\377```\377\203\0\0\0\377\6\25\25\25" \ + "\377\211\211\211\377fl\202\377ISw\377\216\216\221\377RRR\377\203\0\0" \ + "\0\377\6###\377\206\206\206\377\40""0g\377)8k\377mmm\377\14\14\14\377" \ + "\202\0\0\0\377\7\23\23\23\377wxy\377\36.g\377\31*e\377NY|\377KKK\377" \ + "\1\1\1\377\202\0\0\0\377\2///\377y|\207\377\202-t\377KW\206\377IV\205" \ + "\377HU\204\377IV\205\377HU\204\377IV\205\377JW\206\377IV\205\377\207" \ + "JW\206\377\1IV\206\377\202JW\206\377\2KX\206\377JW\206\377\210KX\206" \ + "\377\202JW\205\377\202KX\206\377\202LY\207\377\1KX\206\377\220LY\207" \ + "\377\207LX\207\377\205LY\207\377\207LX\207\377\220LY\207\377\2KX\206" \ + "\377LY\207\377\202KX\206\377\202JW\205\377\211KX\206\377\4JW\206\377" \ + "KX\206\377JW\206\377IV\206\377\207JW\206\377\1IV\205\377\202JW\206\377" \ + "\2IV\205\377HU\204\377\203IV\205\377\3CP\201\377\"2k\377\30)d\377\207" \ + "\31*e\377\5\30)d\377!1j\377DQ\201\377\214\216\224\377@@@\377\205\0\0" \ + "\0\377\2SSS\377y}\215\377\202GU\204\377\3NZ\204\377\224\225\231\377\34" \ + "\34\34\377\204\0\0\0\377\3\2\2\2\377bbb\377go\213\377\204ES\203\377\2" \ + "\210\212\217\377333\377\203\0\0\0\377\5OPP\377iq\216\377DR\202\377bj" \ + "\210\377ttt\377\203\0\0\0\377\3\33\33\33\377vz\207\377$3i\377\204\31" \ + "*e\377\2sx\207\377ooo\377\203\0\0\0\377\17\20\20\20\377sss\377\202\203" \ + "\210\377\201\202\210\377yyy\377666\377\37\37\37\377111\377\77\77\77\377" \ + "uuu\377\210\212\221\377CQ\200\377Wb\206\377ccc\377\1\1\1\377\202\0\0" \ + "\0\377\6###\377sw\201\377CQ\200\377FS\201\377\212\213\222\377<<<\377" \ + "\203\0\0\0\377\26""444\377~~~\377\201\203\211\377\204\204\207\377lll" \ + "\377\40\40\40\377$$$\377555\377HHH\377\215\215\215\377lq\204\377[c\177" \ + "\377fff\377\36\36\36\377\20\20\20\377\0\0\0\377\21\21\21\377www\377\177" \ + "\202\214\377dk\204\377\205\206\214\377JJJ\377\203\0\0\0\377\15uuu\377" \ + "jq\210\377\201\203\214\377NNN\377\26\26\26\377\12\12\12\377\0\0\0\377" \ + "///\377\206\206\206\377x}\216\377w|\216\377\206\207\210\377\"\"\"\377" \ + "\202\0\0\0\377\4\33\33\33\377\205\205\205\377DQ}\377;J|\377\204:I{\377" \ + "\6;J{\377(8p\377\27(d\377\31*e\377Ya\200\377BBB\377\204\0\0\0\377\2l" \ + "ll\377JTx\377\206\31*e\377\5\30)d\377\27(c\377fm\210\377HHH\377\1\1\1" \ + "\377\202\0\0\0\377\2>>>\377|\177\212\377\2047Fy\377\3;Iz\377~\202\220" \ + "\377OOO\377\203\0\0\0\377\16(((\377yyy\377\202\204\210\377\200\202\207" \ + "\377uuu\377###\377$$$\377222\377@@@\377\206\206\206\377\207\210\216\377" \ + "\31*e\377ms\207\377eee\377\203\0\0\0\377\16\21\21\21\377www\377\203\204" \ + "\207\377~\200\206\377~~~\377--.\377\40\40\40\377...\377;;;\377{{{\377" \ + "\203\205\216\377+:o\377z~\215\377mmm\377\204\0\0\0\377\6\"\"\"\377WW" \ + "W\377CCC\377\0\0\0\377$$$\377\4\4\4\377\202\0\0\0\377\6""111\377pw\215" \ + "\3770@u\377MY}\377\210\210\210\377\40\40\40\377\203\0\0\0\377\5)**\377" \ + "mmm\377ttt\377UUU\377\7\7\7\377\202\0\0\0\377\7\2\2\2\377\\\\\\\377o" \ + "u\207\377\31*e\377)8l\377mmm\377\14\14\14\377\202\0\0\0\377\7\23\23\23" \ + "\377wxy\377\36.g\377\31*e\377NY|\377KKK\377\1\1\1\377\202\0\0\0\377\2" \ + "///\377y|\207\377\202-m\377>Js\377\205\205\205\377" \ + "\34\34\34\377\203\0\0\0\377\5\30\30\30\377CCC\377LLL\377777\377\3\3\3" \ + "\377\202\0\0\0\377\6;;;\377\216\216\216\377KV\200\377mt\213\377mmm\377" \ + "\6\6\6\377\203\0\0\0\377\4)))\377HHH\377III\377$$$\377\202\0\0\0\377" \ + "\6\1\1\1\377]]]\377\201\204\215\377;J|\377:I{\3779Hz\377\202:I{\377\7" \ + "9Hz\377>>\377|\177\212\3777Fy\3776Fx\377\2037Fy\377" \ + "\3T^\201\377\214\215\216\377888\377\203\0\0\0\377\4\22\22\22\377222\377" \ + "///\377\12\12\12\377\203\0\0\0\377\7""999\377\215\215\215\377>Js\377" \ + "\31*e\3776Cp\377\222\223\225\377HHH\377\203\0\0\0\377\4\7\7\7\377111" \ + "\377222\377\20\20\20\377\203\0\0\0\377\7())\377\212\212\212\377PYy\377" \ + ".=s\377HS}\377\223\223\223\377000\377\206\0\0\0\377\3---\377ttt\377\2" \ + "\2\2\377\202\0\0\0\377\7""000\377pw\215\3770@t\3771Av\377ns\206\377v" \ + "vv\377\27\27\27\377\204\0\0\0\377\1\2\2\2\377\204\0\0\0\377\7III\377" \ + "\212\213\217\3774Ao\377\31*e\377)8l\377mmm\377\14\14\14\377\202\0\0\0" \ + "\377\7\23\23\23\377wxy\377\36.g\377\31*e\377NY|\377KKK\377\1\1\1\377" \ + "\202\0\0\0\377\2///\377y|\207\377\202->>\377\204\0\0\0\377\2kkk\377JTx\377\206\31*e\377\4\30)d\377" \ + "!1j\377iq\213\377CCC\377\203\0\0\0\377\4""888\377|\177\212\3777Fy\377" \ + "6Fx\377\2047Fy\377\4fm\207\377\214\214\214\377UUU\377\20\20\20\377\206" \ + "\0\0\0\377\4\30\30\30\377[[[\377\215\215\215\377LVx\377\203\31*e\377" \ + "\4DOu\377\221\221\221\377___\377\27\27\27\377\206\0\0\0\377\12\20\20" \ + "\20\377RRR\377\212\212\212\377]e~\377\30)e\3773Bw\3772Av\377io\206\377" \ + "\204\204\204\377222\377\204\0\0\0\377\3""9::\377\211\211\211\377uuu\377" \ + "\203\0\0\0\377\11+++\377ov\215\3770@u\377.\77t\377'6k\377sx\210\377\177" \ + "\177\177\377AAA\377\7\7\7\377\205\0\0\0\377\4#$$\377hhh\377\216\216\217" \ + "\377GRw\377\202\31*e\377\3)8l\377kkk\377\3\3\3\377\202\0\0\0\377\6\12" \ + "\12\12\377vwx\377\36.g\377\31*e\377NX|\377GGG\377\203\0\0\0\377\2)))" \ + "\377y|\207\377\202-L}\377" \ + "\202s\377GT\203\377HU\204\377\202" \ + "GU\204\377\1FU\204\377\207GU\204\377\2FT\203\377ES\202\377\206FT\203" \ + "\377\4ES\203\377FT\203\377ES\203\377DR\203\377\206ES\203\377\202DR\202" \ + "\377\1CQ\201\377\205DR\202\377\4CQ\201\3770\77t\377\31*e\377\30)d\377" \ + "\211\31*e\377\4\30)d\377!2k\377AO\200\377AP\200\377\202BP\201\377\2B" \ + "P\200\377BP\177\377\205BP\200\377\3AO\200\377BP\200\377@N\200\377\207" \ + "AO\200\377\2@N\177\377\77M~\377\206@N\177\377\202\77M~\377\3""7Fy\377" \ + "\31*e\377\31*d\377\213\31*e\377\4\31*d\377\27(c\377/>t\377L}\377\36.h" \ + "\377\30)d\377\207\31*e\377\3\30)d\377\32*e\377/=s\377\204IV\205\377\2" \ + "HU\204\377IV\205\377\202JW\206\377\1IV\205\377\210JW\206\377\1IV\206" \ + "\377\202JW\206\377\216KX\206\377\202JW\205\377\204KX\206\377\203LY\207" \ + "\377\1KX\206\377\226LY\207\377\1KX\206\377\203LY\207\377\204KX\206\377" \ + "\203JW\205\377\213KX\206\377\2JW\206\377KX\206\377\203JW\206\377\1IV" \ + "\206\377\212JW\206\377\2IV\205\377HU\204\377\202IV\205\377\4HU\204\377" \ + "IV\205\377DR\202\377!1j\377\202\30)d\377\207\31*e\377\2\30)d\377(8o\377" \ + "\202HU\204\377\3HT\203\377GU\204\377FU\204\377\206GU\204\377\4FT\203" \ + "\377GU\204\377FT\203\377ES\202\377\207FT\203\377\2ES\203\377DR\203\377" \ + "\206ES\203\377\202DR\202\377\1CQ\201\377\205DR\202\377\4CQ\201\377\77" \ + "N\177\377\36.h\377\30)d\377\211\31*e\377\3\30)d\377\27(d\3775Dy\377\202" \ + "AO\200\377\2BP\200\377BP\201\377\210BP\200\377\2AO\200\377@N\200\377" \ + "\205AO\200\377\3@N\177\377AO\200\377\77M~\377\207@N\177\377\3>L}\377" \ + "AN\177\377&7n\377\215\31*e\377\4\30)d\377\33,f\3777Ey\377=J}\377\203" \ + "=K}\377\202t\377GT\203\377IV\205\377HU\204\377\202IV\205\377\2HU\204\377" \ + "IV\205\377\213JW\206\377\202IV\206\377\202JW\206\377\202KX\206\377\1" \ + "JW\206\377\215KX\206\377\203JW\205\377\206KX\206\377\216LY\207\377\206" \ + "KX\206\377\203JW\205\377\216KX\206\377\2JW\206\377KX\206\377\202JW\206" \ + "\377\202IV\206\377\211JW\206\377\3IV\205\377JW\206\377IV\205\377\202" \ + "HU\204\377\2IV\205\377HU\204\377\202IV\205\377\3BP\200\377\35-h\377\30" \ + ")d\377\207\31*e\377\202\30)d\377\5%5m\377IV\205\377HU\204\377HT\203\377" \ + "FU\204\377\207GU\204\377\4FT\203\377GU\204\377FT\203\377ES\202\377\205" \ + "FT\203\377\1ES\203\377\202FT\203\377\207ES\203\377\3DR\202\377ES\203" \ + "\377CQ\201\377\205DR\202\377\4DQ\201\377DR\202\377-=r\377\26(c\377\212" \ + "\31*e\377\10\30)d\377#3l\377>M~\377BP\201\377BP\200\377BP\201\377BP\200" \ + "\377BP\177\377\207BP\200\377\206AO\200\377\3@N\177\377AO\200\377\77M" \ + "~\377\207@N\177\377\202\77M~\377\3:I{\377\36.h\377\30)d\377\214\31*e" \ + "\377\3\30)d\377$4l\377;I{\377\205=K}\377\1;K}\377\207L}\377\77" \ + "M~\3770\77t\377\31*e\377\30)d\377\215\31*e\377\3.=s\377=K}\377s\377-L~\377JW\206\377\203IV\205\377\1HU\204\377\202IV\205\377\2J" \ + "W\206\377IV\205\377\211JW\206\377\202IV\206\377\202JW\206\377\202KX\206" \ + "\377\1JW\206\377\222KX\206\377\220JW\205\377\225KX\206\377\202JW\206" \ + "\377\202IV\206\377\213JW\206\377\202IV\205\377\1HU\204\377\202IV\205" \ + "\377\1HU\204\377\202IV\205\377\3""2Av\377\33+f\377\30)d\377\210\31*e" \ + "\377\7\30)d\377'7n\377DR\202\377HU\204\377HT\203\377GU\204\377FU\204" \ + "\377\210GU\204\377\2FT\203\377ES\202\377\210FT\203\377\2ES\203\377DR" \ + "\203\377\207ES\203\377\2DR\202\377CQ\201\377\207DR\202\377\2\40""1j\377" \ + "\30)d\377\212\31*e\377\10\30)d\377!1j\377AO\200\377BP\201\377AO\200\377" \ + "BP\201\377BP\200\377BP\177\377\206BP\200\377\202AO\200\377\1@N\200\377" \ + "\204AO\200\377\4@N\177\377AO\200\377@N\177\377\77M~\377\206@N\177\377" \ + "\202\77M~\377\4=K|\377%4l\377\30)d\377\31*d\377\214\31*e\377\4\35-g\377" \ + "8Fy\377=K}\377L~\377\205=K}\377\1;K}\377\207L}\377\77M~\377)9p\377\27(c\377\214\31*e\377\202\30)" \ + "d\377\1""3Bv\377\205=K}\377\210L~\377=K|\377\202" \ + "=K}\377\4s\377\33+f\377\224\31*e\377\3\30)d\377\35.h\3771@v\377\2102Av\377" \ + "\2101Au\377\4""0@t\377/\77t\377\35-g\377\30)d\377\230\31*e\377\5\30)" \ + "d\377\35-g\377/>t\377-t\377GT\203\377HU\204\377HT\203\377\202GU\204\377\1FU\204\377\206" \ + "GU\204\377\4FT\203\377GU\204\377FT\203\377ES\202\377\206FT\203\377\4" \ + "ES\203\377FT\203\377ES\203\377DR\203\377\206ES\203\377\3DR\202\377ES" \ + "\203\377CQ\201\377\205DR\202\377\5CQ\201\377DR\202\3777Fy\377\31*d\377" \ + "\30)d\377\212\31*e\377\7\27(c\377.>s\377BP\201\377AO\200\377BP\200\377" \ + "BP\201\377BP\177\377\206BP\200\377\3AO\200\377BP\200\377@N\200\377\207" \ + "AO\200\377\2@N\177\377\77M~\377\206@N\177\377\202\77M~\377\3@N\177\377" \ + "):p\377\27(d\377\215\31*e\377\4\26(c\377/>t\377=K}\377t\377\202\30" \ + ")d\377\230\31*e\377\5\30)d\377#2k\377.=s\377-L}\377@N~\377*:q\377\215" \ + "\31*e\377\4\30)d\377\27(d\377*;q\377r\377\202\30)d\377\223\31*e\377\5\30)d\377\34-g\377" \ + "4Cw\3772Av\3771@u\377\2062Av\377\2""1Au\3770At\377\2041Au\377\2""0@u" \ + "\3771Au\377\2020@u\377\2\32+f\377\30)d\377\230\31*e\377\5\30)d\377\35" \ + ".h\377.=s\377-L}\377\77M~\377.>s\377\31*e\377\30)d\377" \ + "\214\31*e\377\3\30)d\377%5m\377;J|\377\205=K}\377\2K}\377" \ + "\"2k\377\31*e\377\202\30)d\377\211\31*e\377\5\30)d\377\31*e\3779Gy\377" \ + "GT\203\377HU\204\377\202HT\203\377\2GU\204\377FU\204\377\207GU\204\377" \ + "\4FT\203\377GU\204\377FT\203\377ES\202\377\210FT\203\377\1ES\203\377" \ + "\202DR\203\377\206ES\203\377\4DR\202\377ES\203\377DR\202\377CQ\201\377" \ + "\205DR\202\377\3CQ\201\377AO\200\377%5m\377\202\30)d\377\212\31*e\377" \ + "\3\26'c\377/>t\377CP\201\377\203BP\201\377\2BP\200\377BP\177\377\206" \ + "BP\200\377\1AO\200\377\202@N\200\377\206AO\200\377\1@N\177\377\202\77" \ + "M~\377\206@N\177\377\6\77M~\377>L}\377;J|\377!1j\377\30)d\377\31*d\377" \ + "\214\31*e\377\2\32+f\3770\77u\377\204=K}\377\3L}\377\36.h\377" \ + "\30)d\377\215\31*e\377\4\30)d\377.=s\377>L}\377s\377\33,f\377\231\31*e\377\5\30)d\377\36.h\377,;r\377-r\377\30)d\377\224\31*e\377\5\30)d\377\33,g\377/\77t\3772Av\377" \ + "1@u\377\2062Av\377\2""1Au\3770At\377\2051Au\377\5""0@u\3771At\3770@u" \ + "\377$4m\377\30)d\377\230\31*e\377\6\30)d\377\31*e\377&5m\377.=s\377-" \ + "L}\377@N~\377)9p\377\216\31*e\377\4\30)d\377\34.g\377=K}\377<" \ + "J|\377\204=K}\377\2t\377\37""0i\377\30)d\377\230\31*e\377\5\30)d\377\32+f\377" \ + ")8p\377.=s\377,;q\377\205-L}\377\77M~\3778Gy\377\34-g\377\30)d\377\214\31*e\377\4\30)d\377" \ + "\27(d\377/>t\377L~\377-L~\3773Bw\377)9p\377\"2k\377\34,f\377\202\27" \ + "(d\377\1\30)d\377\215\31*e\377\10\30)d\377\26'b\377\40""0j\3776Dx\377" \ + "DQ\201\377IV\204\377HU\204\377HT\204\377\202GU\204\377\1FU\204\377\210" \ + "GU\204\377\1FT\203\377\202GU\204\377\2FT\203\377ES\202\377\207FT\203" \ + "\377\2ES\203\377FT\203\377\202ES\203\377\1DR\203\377\210ES\203\377\202" \ + "DR\202\377\1CQ\201\377\205DR\202\377\5CQ\201\377FT\203\3773Bv\377\31" \ + "*e\377\30)d\377\213\31*e\377\4\27(c\377*9p\377BP\201\377AO\200\377\202" \ + "BP\201\377\2BP\200\377BP\177\377\206BP\200\377\203AO\200\377\1@N\200" \ + "\377\206AO\200\377\202@N\177\377\1\77M~\377\206@N\177\377\202\77M~\377" \ + "\2>L}\377)9p\377\202\30)d\377\214\31*e\377\3\30)d\377\37""0i\3779Hz\377" \ + "\204=K}\377\202t\3776Ex\377=K}\377BP\200\377\202ER\202\377\1FS\202\377" \ + "\211FS\203\377\11ES\202\377ER\202\377DR\202\377@N\177\377:H{\3774Bw\377" \ + "+;r\377#3k\377\32+f\377\202\27(c\377\203\30)d\377\220\31*e\377\202\30" \ + ")d\377\4\31*e\377\34-g\3770\77t\377GT\203\377\204HU\204\377\2GU\204\377" \ + "FU\204\377\211GU\204\377\1FT\203\377\202GU\204\377\2FT\203\377ES\202" \ + "\377\210FT\203\377\4ES\203\377FT\203\377ES\203\377DR\203\377\207ES\203" \ + "\377\4DR\202\377ES\203\377DR\202\377CQ\201\377\206DR\202\377\5CQ\201" \ + "\377DR\202\377;J|\377\35.h\377\30)d\377\213\31*e\377\5\30)d\377\33,f" \ + "\3776Ey\377BP\201\377AO\200\377\202BP\201\377\2BP\200\377BP\177\377\205" \ + "BP\200\377\4AO\200\377BP\200\377AO\200\377@N\200\377\207AO\200\377\2" \ + "@N\177\377\77M~\377\207@N\177\377\5\77M~\377>L}\377\77L~\377&5m\377\27" \ + "(d\377\215\31*e\377\3\30)d\377\36.h\3779Gz\377\205=K}\377\2M~\377!2j\377\30)d\377\214\31*e\377\5\30)d\377/>t\377CQ\202\377AO\200" \ + "\377BP\201\377\202BP\200\377\1BP\177\377\205BP\200\377\4AO\200\377BP" \ + "\200\377AO\200\377@N\200\377\206AO\200\377\3@N\177\377AO\200\377\77M" \ + "~\377\206@N\177\377\203\77M~\377\4@N~\3774Cw\377\27(c\377\31)e\377\215" \ + "\31*e\377\4\30)d\377,:q\377>L~\377s\377\202\30)d\377\225\31*e\377\2,L}\377@N\177\377)8o\377\31)d\377\216\31*e\377\4\26" \ + "'c\3772Av\377=K}\377L}\377\77M~\3776Ex\377" \ + "\34-g\377\30)d\377\214\31*e\377\5\31*d\377\30)d\377\"2k\377=K}\377L}\377=K}\377&6m\377\30)d\377\31)e\377\214\31*e\377\4\30)d\377\31*e" \ + "\3774Cw\377L}\377\33+g\377\30)d\377\216" \ + "\31*e\377\2\33,f\3775Cw\377\204=K}\377\4t\3772Av\3771@u\377\2062Av\377\2""1Au\3770At\377\2061Au\377\2020@u\377" \ + "\2*:q\377\32+f\377\231\31*e\377\4\30)d\377\32+f\377+:q\377-K}\377GT\203\377JW\205\377IV\204\377\202" \ + "HU\204\377\1GT\203\377\202HU\204\377\204GU\204\377\203FU\204\377\217" \ + "GU\204\377\202FT\203\377\202ES\202\377\211FT\203\377\1ES\203\377\202" \ + "FT\203\377\2ES\203\377DR\203\377\210ES\203\377\1DR\202\377\202ES\203" \ + "\377\1CQ\201\377\207DR\202\377\5CQ\201\377DR\202\377@N\177\377\"3k\377" \ + "\30)d\377\214\31*e\377\202\30)d\377\7,;r\377BP\201\377AO\200\377BP\200" \ + "\377BP\201\377BP\200\377BP\177\377\210BP\200\377\2AO\200\377@N\200\377" \ + "\210AO\200\377\1\77M~\377\206@N\177\377\7\77M~\377@N\177\377\77M~\377" \ + ">L}\377@N~\377%5m\377\30)d\377\216\31*e\377\4\30)d\377&7n\377>M~\377" \ + "=J|\377\202=K}\377\3L}\377AO\177\377" \ + "ER\202\377IU\204\377KW\206\377JW\205\377JV\205\377IV\204\377\202HU\204" \ + "\377\1GT\203\377\203HU\204\377\204GU\204\377\203FU\204\377\216GU\204" \ + "\377\2FT\203\377GU\204\377\203FT\203\377\1ES\202\377\212FT\203\377\2" \ + "ES\203\377FT\203\377\202ES\203\377\1DR\203\377\212ES\203\377\202DR\202" \ + "\377\1CQ\201\377\206DR\202\377\6CQ\201\377DR\202\377>L~\377$4l\377\27" \ + ")d\377\30)d\377\214\31*e\377\10\30)d\377'7n\377@N\177\377BP\201\377B" \ + "P\200\377BP\201\377BP\200\377BP\177\377\207BP\200\377\202AO\200\377\1" \ + "@N\200\377\206AO\200\377\4@N\177\377AO\200\377@N\177\377\77M~\377\207" \ + "@N\177\377\5\77M~\377>L}\377@N~\3771@u\377\30)d\377\216\31*e\377\5\30" \ + ")d\377\34,g\377:I{\377=K}\377t\377" \ + "\37""0i\377\30)d\377\230\31*e\377\202\30)d\377\4$4m\377.=s\377-L}\377\77M~\3779Hz\377\36.h\377\30*e\377\215\31*e\377\5\30*e\377" \ + "\27'c\3772@u\377>L}\377L}\377\1(7o\377\202\30)d\377\215\31*e\377" \ + "\3\27(d\377$5m\377L}\377\77M~\3774Bv\377\27" \ + ")d\377\30)d\377\215\31*e\377\3\30)d\377\33,f\3776Ey\377\204=K}\377\4" \ + "s\377\210-" \ + "L~\377BP\201\377AO\200\377" \ + "BP\200\377BP\201\377BP\200\377BP\177\377\210BP\200\377\2AO\200\377@N" \ + "\200\377\206AO\200\377\4@N\177\377AO\200\377@N\177\377\77M~\377\206@" \ + "N\177\377\204\77M~\377\3;I{\377\34,g\377\30)d\377\216\31*e\377\3\31*" \ + "d\377*9p\377L~\377\40""1j\377\31)e\377\30)d\377\215\31*e\377\3" \ + "\30)d\377\37""0i\377@N\200\377\202BP\201\377\3AO\200\377BP\201\377BP" \ + "\200\377\202BP\177\377\206BP\200\377\4AO\200\377BP\200\377AO\200\377" \ + "@N\200\377\207AO\200\377\1@N\177\377\202\77M~\377\207@N\177\377\6\77" \ + "M~\377>L}\377@N~\377)9p\377\31*e\377\30*e\377\216\31*e\377\4\30)d\377" \ + "2Av\377=K}\377=K|\377\204=K}\377\2L}\377@N~\377$5m\377\27(d\377\216\31*e\377\5\30)d\377\31+e\377" \ + "3Bv\377=K}\377s\377\32+f\377\225\31" \ + "*e\377\5\30)d\377\35-g\3770\77u\3773Bw\3771@u\377\2062Av\377\2""1Au\377" \ + "0At\377\2061Au\377\2020@u\377\2-=s\377\33,f\377\232\31*e\377\5\30)d\377" \ + "\"3k\377.=s\377-L}\377AN\177\377*9p\377\202\30)d\377\216\31*e\377\3\30)d\377(" \ + "8o\377L}\377\77M~\377" \ + "2Au\377\30)d\377\217\31*e\377\5\30)d\377\36/h\3779Hz\377=K}\377L~\377\212" \ + "DR\202\377\202CQ\201\377\1DR\202\377\202ES\203\377\1DR\202\377\214ES" \ + "\203\377\202DR\203\377\203ES\203\377\203FT\203\377\1ES\203\377\300FT" \ + "\203\377\203ES\203\377\202DR\203\377\214ES\203\377\1DR\202\377\202ES" \ + "\203\377\202DR\202\377\1CQ\201\377\210DR\202\377\6CQ\201\377DR\202\377" \ + "CQ\202\3776Ex\377\37""0i\377\27(d\377\217\31*e\377\3\30)d\377\33,f\377" \ + "2Av\377\202BP\201\377\2BP\200\377BP\201\377\202BP\200\377\1BP\177\377" \ + "\210BP\200\377\202AO\200\377\1@N\200\377\210AO\200\377\2@N\177\377\77" \ + "M~\377\206@N\177\377\10\77M~\377@N\177\377\77M~\377>L}\377\77M~\3777" \ + "Fy\377\34-g\377\30)d\377\216\31*e\377\5\30)d\377\31*e\3773Bv\377>L}\377" \ + "L}\377" \ + "L}\377L}\377\2@N~\377$4l\377\202\30)d\377\216\31*e\377\5\27(d\377$5l\377<" \ + "J|\377=K}\377M~\377$5m\377\202\30)d\377\217\31*e\377\4\30)" \ + "d\377\31*e\377(8n\377@N\200\377\202BP\201\377\4BP\200\377BP\201\377B" \ + "P\200\377BP\177\377\207BP\200\377\1AO\200\377\202BP\200\377\1@N\200\377" \ + "\212AO\200\377\2@N\177\377\77M~\377\206@N\177\377\7\77M~\377@N\177\377" \ + "\77M~\377\77M}\377\77M~\377*:p\377\27(c\377\217\31*e\377\3\30)d\377\35" \ + ".g\3778Gy\377\206=K}\377\2s\377" \ + "\210-L~\377.>s\377\31+e\377\27(c\377\30)d\377\217\31*e\377\3\27)d\377" \ + "\33,f\377.=s\377\202BP\201\377\1AO\200\377\202BP\201\377\2BP\200\377" \ + "BP\177\377\211BP\200\377\202AO\200\377\1@N\200\377\207AO\200\377\203" \ + "@N\177\377\1\77M~\377\206@N\177\377\7\77M~\377@N\177\377\77M~\377>L}" \ + "\377\77M~\377.>s\377\27(d\377\221\31*e\377\1""0\77t\377\205=K}\377\202" \ + "L}\377" \ + "\77M~\3773Av\377\32+f\377\30)d\377\217\31*e\377\2\30)d\377(7o\377\202" \ + "=K}\377\1L~\377\202BP\201\377\4AO\200\377BP\200\377BP\201\377" \ + "BP\200\377\202BP\177\377\207BP\200\377\4AO\200\377BP\200\377AO\200\377" \ + "@N\200\377\207AO\200\377\4@N\177\377AO\200\377@N\177\377\77M~\377\210" \ + "@N\177\377\5\77M~\377>L}\377\77M~\3778Fy\377\33,f\377\202\30)d\377\216" \ + "\31*e\377\2\30)d\377\40""0i\377\202=K}\377\1t\3772Av\3771@u\377\2062Av\377\1""1Au" \ + "\377\2020At\377\2061Au\377\4""0@t\3771Au\377\"3k\377\30)d\377\232\31" \ + "*e\377\5\30)d\377&5m\377.=s\377-L}\377\77M~\377;J{\377\34,g\377\30)d\377\217\31*e\377\3\30)d\377" \ + "\33,g\377;H{\377\204=K}\377\4s\377\33,f\377\232\31*e\377\6\30" \ + ")d\377\31*e\377-s\377L}\377\77M~\377:H{\377\36/h\377\30)d\377\217\31*e\377\5\30" \ + ")d\377\32+f\3773Bw\377=K}\377L}\377\77M~\377" \ + ";I{\377!1j\377\30)d\377\221\31*e\377\1,;r\377\205=K}\377\203t\377\40""0j\377\30)d\377\231\31" \ + "*e\377\202\30)d\377\4)9p\377.=r\377-L}\377\2=K|\377#3k\377\202\30)d\377\217\31*e\377\2\30)d\377%5m\377\202" \ + "=K}\377\1s\377\32+f\377\202" \ + "\30)d\377\222\31*e\377\202\30)d\377\6\32+e\377,L}\377\77M~\377>L}\377" \ + "&6m\377\27(c\377\217\31*e\377\3\30)e\377\30)d\377\36/i\377\202=K}\377" \ + "\1t\377:I{\377BP\200\377ES\202" \ + "\377DR\202\377CQ\201\377\217DR\202\377\204CQ\201\377\204DR\202\377\232" \ + "ES\203\377\1DR\202\377\207ES\203\377\205DR\202\377\204CQ\201\377\216" \ + "DR\202\377\1CQ\201\377\202DR\202\377\6ES\202\377\77M~\3776Ex\377(8o\377" \ + "\31*e\377\26'c\377\202\30)d\377\222\31*e\377\202\30)d\377\3$4l\3778F" \ + "z\377CQ\202\377\202BP\201\377\2BP\200\377BP\201\377\202BP\200\377\1B" \ + "P\177\377\210BP\200\377\2AO\200\377BP\200\377\202AO\200\377\1@N\200\377" \ + "\207AO\200\377\3@N\177\377AO\200\377@N\177\377\202\77M~\377\206@N\177" \ + "\377\10\77M~\377@N\177\377\77M~\377>L}\377\77M~\377=K|\377&6m\377\26" \ + "'c\377\220\31*e\377\5\27)d\377\36/h\3779H{\377=K}\377t\377\32" \ + "*e\377\30)d\377\231\31*e\377\5\30)d\377\33+f\377)9o\377.=s\377,;q\377" \ + "\207-L~\377GT\204\377ES\202" \ + "\377DR\202\377CQ\201\377\220DR\202\377\204CQ\201\377\207DR\202\377\224" \ + "ES\203\377\210DR\202\377\205CQ\201\377\217DR\202\377\12CQ\201\377DR\202" \ + "\377FT\203\377DR\202\3777Gy\377*9p\377\40""1j\377\31*e\377\27(d\377\30" \ + ")d\377\223\31*e\377\10\30)d\377\26(c\377\37""0i\3773Bw\377@N\177\377" \ + "CQ\201\377BP\201\377AO\200\377\202BP\201\377\1BP\200\377\202BP\177\377" \ + "\210BP\200\377\2AO\200\377BP\200\377\202AO\200\377\1@N\200\377\207AO" \ + "\200\377\4@N\177\377AO\200\377@N\177\377\77M~\377\207@N\177\377\10\77" \ + "M~\377@N\177\377\77M~\377>L}\377\77M~\377=K|\377%5m\377\30)d\377\220" \ + "\31*e\377\5\30)d\377\34-g\3775Dx\377=K}\377M~\377\202BP\201\377\2AO\200\377BP\201\377\204BP\200\377" \ + "\1BP\177\377\210BP\200\377\3AO\200\377BP\200\377AO\200\377\202@N\200" \ + "\377\207AO\200\377\4@N\177\377AO\200\377@N\177\377\77M~\377\211@N\177" \ + "\377\1\77M~\377\202>L}\377\2=L}\377&6m\377\202\30)d\377\220\31*e\377" \ + "\2\32+e\3770@t\377\205=K}\377\202M~\3771@t\377\40""0i\377\26'c\377\202\30)d\377" \ + "\225\31*e\377\202\30)d\377\10\31*e\377\"2k\377;J|\377CQ\202\377BP\201" \ + "\377AO\200\377BP\200\377BP\201\377\202BP\200\377\1BP\177\377\211BP\200" \ + "\377\2AO\200\377BP\200\377\202AO\200\377\1@N\200\377\210AO\200\377\4" \ + "@N\177\377AO\200\377@N\177\377\77M~\377\207@N\177\377\10\77M~\377@N\177" \ + "\377\77M~\377>L}\377\77M~\377=L}\377&7n\377\27(c\377\220\31*e\377\5\30" \ + ")d\377\31*e\377+:q\377\77L~\377L~\377" \ + "*:q\377\35.h\377\27)d\377\30)d\377\226\31*e\377\12\30)d\377\27(d\377" \ + "\26'c\377\33,f\377'7n\3772Au\3779H{\377\77M~\377DR\202\377ES\202\377" \ + "\203DR\202\377\1CQ\201\377\266DR\202\377\12ES\202\377ES\203\377BP\200" \ + "\377L}\377\77M~\377L~\3775Dw\377+;q\377$4l\377\36/i\377\30*d\377\27(d\377\202\30)d\377" \ + "\227\31*e\377\11\30)d\377\26'c\377\"2k\3774Cw\377\77M\177\377CP\201\377" \ + "BP\201\377AO\201\377BP\200\377\202BP\201\377\202BP\200\377\1BP\177\377" \ + "\213BP\200\377\2AO\200\377@N\200\377\210AO\200\377\2@N\177\377AO\200" \ + "\377\202@N\177\377\1\77M~\377\207@N\177\377\10\77M~\377@N\177\377\77" \ + "M~\377>L}\377\77M~\377;I{\377#3k\377\30)d\377\220\31*e\377\6\30)d\377" \ + "\27(d\377(9o\377M~\377):p\377\203\30)d\377\227\31*e\377\1\30)e\377\203\30" \ + ")d\377\11\31*e\377\32+f\377\34,g\377!2k\377-;r\3777Fy\377AO\200\377E" \ + "S\203\377ES\202\377\203DR\202\377\1CQ\201\377\243DR\202\377\1CQ\201\377" \ + "\202DR\202\377\1ER\202\377\202ES\203\377\7=L~\3772Bv\377'7o\377\35.g" \ + "\377\33,f\377\32+e\377\31*e\377\204\30)d\377\227\31*e\377\5\30)d\377" \ + "\27(d\377\35.h\3775Dx\377\77N\177\377\202BP\201\377\202AO\200\377\202" \ + "BP\201\377\202BP\200\377\202BP\177\377\211BP\200\377\204AO\200\377\1" \ + "@N\200\377\211AO\200\377\1@N\177\377\202\77M~\377\211@N\177\377\5\77" \ + "M~\377>L}\377\77M~\377t\377\37""0i\377\30)d\377\232\31*e\377\5\30)d\377!1j\377" \ + ".=s\377-s\3777Fy\377\77M~" \ + "\377\202AO\200\377\3BP\200\377BQ\201\377CQ\201\377\232DR\202\377\202" \ + "CQ\201\377\13BP\201\377BP\200\377AO\200\377@O\177\377L}\377\77M~\377t\3773Bv\3776Ex\3778Fy\3779H{\377;I|\377L}\377\77M~" \ + "\377\77N\177\377@N\177\377\203AO\200\377\1BO\200\377\202AO\200\377\23" \ + "@O\200\377@N\177\377\77M\177\377>M~\377=K}\377L}" \ + "\377\77M~\3776Ex\377\35-g\377\30)d\377\221\31*e\377\5\27(d\377!1j\377" \ + ":H{\377=K}\377L}\377\77M~\3772Au\377\34" \ + "-g\377\30)d\377\221\31*e\377\5\27(c\377!1j\3779Gz\377=K}\377L}\377\3\77M~\3770\77t\377\31*e\377\202" \ + "\30)d\377\220\31*e\377\5\30)d\377\40""0i\3778Fz\377=K}\377L}\377\77M~\377>L~\377,;p\377\26'c\377\222\31*e\377" \ + "\5\30)d\377\36.h\3777Fy\377=K}\377s\377" \ + "\210-L}\377\77" \ + "M~\377;I|\377&5m\377\27(d\377\222\31*e\377\5\27(d\377\36/i\3777Ey\377" \ + ">L}\377s\377\27(d\377\30)d\377\225" \ + "\31*e\377\5\30)d\377\31*e\377*9p\3773Bw\3771@u\377\2062Av\377\3""1Au" \ + "\3772Av\3770At\377\2061Au\377\2030@u\377\2\37/i\377\30)d\377\232\31*" \ + "e\377\4\30*d\377\31*e\377*:q\377.=s\377\210-L~\377CQ\201\377" \ + "\202BP\201\377\3AO\200\377BP\201\377BP\200\377\202BP\201\377\203BP\200" \ + "\377\1BP\177\377\213BP\200\377\2AO\200\377BP\200\377\202AO\200\377\1" \ + "@N\200\377\211AO\200\377\1@N\177\377\202AO\200\377\1@N\177\377\202\77" \ + "M~\377\210@N\177\377\203\77M~\377\4>L}\377@M~\3778Gy\377\40""1j\377\202" \ + "\30)d\377\221\31*e\377\5\27(c\377\40""1j\3777Fy\377=K}\377t\377\2078Fz\377\2107Fy\377\3""6Ex\3777Fy\3775Dw\377" \ + "\2066Ex\377\3""5Dw\377\34-g\377\30)d\377\227\31*e\377\1\37/i\377\202" \ + "2Av\377\1""1@u\377\2052Av\377\4""1Au\3772Av\3771Au\3770At\377\2051Au" \ + "\377\5""0@u\3771At\3770@u\377*9p\377\32+e\377\233\31*e\377\3\30)d\377" \ + "\40""0i\377/=s\377\207-L}\377@N\177\3774Bv\377\32+f\377\202\30)d\377\221\31*e\377\5\30" \ + ")d\377\40""0j\3778Gz\377=K}\377L}\377\77M~\377>L}\377" \ + ",;r\377\30)d\377\222\31*e\377\202\30)d\377\4\37""0i\3779Gz\377=K}\377" \ + "s\377\33,f\377\227\31*e\377\5\30)d\377\40""0j\377" \ + "4Cx\3772Av\3771@u\377\2072Av\377\2101Au\377\5""0@u\377/\77u\377+;q\377" \ + "\32*e\377\30)d\377\232\31*e\377\5\30)d\377\37""0j\377.=s\377-L}\377\77M~\377:H{\377&6m\377\202" \ + "\30)d\377\221\31*e\377\6\30)d\377\27)d\377\"2k\377:H{\377=K}\377L~\377\202CQ\201\377\202BP\201\377\1AO\200\377\202BP\201\377\1BP\200" \ + "\377\202BP\201\377\203BP\200\377\203BP\177\377\214BP\200\377\2AO\200" \ + "\377BP\200\377\202AO\200\377\202@N\200\377\212AO\200\377\2@N\177\377" \ + "AO\200\377\202@N\177\377\1\77M~\377\211@N\177\377\2\77M~\377@N\177\377" \ + "\202\77M~\377\4\77M}\377AN\177\3773Bv\377\37/i\377\202\30)d\377\221\31" \ + "*e\377\6\30)d\377\27(d\377&6m\377:H{\377=K}\377L~\3778Fz\377" \ + "->s\377%4m\377\33,g\377\27(c\377\27(d\377\27)d\377\203\30)d\377\243\31" \ + "*e\377\203\30)d\377\12\27(d\377\27(c\377\30)e\377\37""0i\377)9p\3773" \ + "Av\377L}\377\202\77M~\377\2+:q\377\32+f\377\202\30)d\377\222" \ + "\31*e\377\5\30)d\377'6n\377;I{\377=K}\377" \ + "K}\377=K}\377t\377+;q\377" \ + "(8o\377&6n\377%5m\377$4l\377#3k\377\"2k\377!1j\377\40""1j\377\40""0j" \ + "\377\204\37""0i\377\20\40""0i\377\40""0j\377\40""1j\377!1j\377\"2k\377" \ + "#3l\377$4m\377%5n\377'7o\377*9q\377-L}\377\77M~\377>L}\3772Av\377\35.g\377\27" \ + "(c\377\31*d\377\222\31*e\377\6\30)d\377\32+e\377+;r\377>L~\377=K}\377" \ + "s\377\31*e\377\30)d\377\223\31*e\377\5\30)d\377\32+f\377" \ + "2@u\3778Fz\3777Ey\377\2058Fz\377\2027Fy\377\1""6Fx\377\2057Fy\377\2""6" \ + "Ex\3777Fy\377\2066Ex\377\4""5Ew\3776Ex\377+:p\377\30)d\377\230\31*e\377" \ + "\4\36/i\3771Av\3772Av\3771@u\377\2072Av\377\2""1Au\3770At\377\2051Au" \ + "\377\6""0@u\3771At\3770@u\377/\77t\377\35.g\377\30)d\377\234\31*e\377" \ + "\2$4l\377/=s\377\207-M~\377=L~\377=K}\377\202L~\377\77M\177\377@N\177\377AO\200\377BP" \ + "\201\377\202CQ\202\377\202CQ\201\377\214BP\201\377\1BP\200\377\204BP" \ + "\201\377\203BP\200\377\204BP\177\377\217BP\200\377\2AO\200\377BP\200" \ + "\377\203AO\200\377\202@N\200\377\213AO\200\377\2@N\177\377AO\200\377" \ + "\202@N\177\377\202\77M~\377\213@N\177\377\202\77M~\377\6>L}\377@M~\377" \ + ";I{\377&6n\377\31*e\377\30)d\377\223\31*e\377\6\30)d\377\34,g\3771@u" \ + "\377=K}\377=K|\377L}\377" \ + "\3@N~\3775Cw\377\35.g\377\202\30)d\377\223\31*e\377\3\30)d\377\34,g\377" \ + "5Dx\377\202=K}\377\1s\377\36/h\377" \ + "\30)d\377\233\31*e\377\5\30)d\377&5m\377.=s\377-L}\377\77M}\377>M~\377=K|\377(8n\377" \ + "\27(c\377\30)d\377\223\31*e\377\202\30)d\377\4\37.i\3779I{\377=K}\377" \ + "L}\377\77M~\377\214@N\177\377\202\77M" \ + "~\377\202@N\177\377\202AO\200\377\1@N\177\377\214AO\200\377\203@N\200" \ + "\377\203AO\200\377\202BP\200\377\1AO\200\377\225BP\200\377\205BP\177" \ + "\377\212BP\200\377\216BP\201\377\212BP\200\377\206BP\177\377\225BP\200" \ + "\377\1AO\200\377\202BP\200\377\203AO\200\377\202@N\200\377\215AO\200" \ + "\377\2@N\177\377AO\200\377\203@N\177\377\1\77M~\377\212@N\177\377\2\77" \ + "M~\377@N\177\377\202\77M~\377\6>L}\377\77M~\377>L}\3772Au\377\35.h\377" \ + "\27(d\377\224\31*e\377\6\30)d\377\31*e\377&5m\377t\377\33,f\377\30)d\377\232" \ + "\31*e\377\202\30)d\377\4&6n\377.=s\377-t\3779Fz\3777Ey\377\2068Fz\377\2""7Fy\377" \ + "6Fx\377\2077Fy\377\2""6Ex\3775Dw\377\2076Ex\377\2\40""1i\377\30)d\377" \ + "\227\31*e\377\2\30)d\377\40""1j\377\2022Av\377\1""1@u\377\2072Av\377" \ + "\2""1Au\3770At\377\2051Au\377\6""0@u\3771Au\3770@t\3771Au\377#4l\377" \ + "\27(d\377\233\31*e\377\3\30)d\377\35-g\377,;r\377\202-L}\377\77M~\377>L~\377*;p\377" \ + "\33,f\377\202\30)d\377\224\31*e\377\3\30)d\377\31+e\3774Cw\377\210=K" \ + "}\377\1L~\377\77" \ + "M~\377>L}\377\77M~\377\202@N\177\377\1\77M~\377\213@N\177\377\202\77" \ + "M~\377\202@N\177\377\222AO\200\377\202@N\200\377\204AO\200\377\203BP" \ + "\200\377\1AO\200\377\300BP\200\377\1AO\200\377\203BP\200\377\204AO\200" \ + "\377\203@N\200\377\216AO\200\377\1@N\177\377\202AO\200\377\202@N\177" \ + "\377\202\77M~\377\213@N\177\377\1\77M~\377\202@N\177\377\202\77M~\377" \ + "\5>L}\377\77M~\377>L}\3777Ey\377\37/i\377\202\30)d\377\224\31*e\377\202" \ + "\30)d\377\4\37""0j\377:I{\377=K}\377s\377\33,f\377\230\31*e\377\3\30)d\377#2k\3774Cw\377" \ + "\2072Av\377\3""1Au\3772Av\3770At\377\2061Au\377\2""0@u\3771At\377\202" \ + "0@u\377\2\36/i\377\30)d\377\233\31*e\377\5\30)d\377\34-g\377+;q\377." \ + "=s\377,;q\377\207-L}\377\202\77M~\377\4""7" \ + "Fy\377'7n\377\27(d\377\30)d\377\225\31*e\377\6\30)d\377\31*e\377(8o\377" \ + ";I|\377=K}\377s\377-L}\377\202\77M~\377\2@N\177\377\77M~\377\213@N\177\377\203\77M~\377" \ + "\202@N\177\377\223AO\200\377\204@N\200\377\204AO\200\377\204BP\200\377" \ + "\1AO\200\377\260BP\200\377\1AO\200\377\205BP\200\377\204AO\200\377\203" \ + "@N\200\377\220AO\200\377\1@N\177\377\202AO\200\377\202@N\177\377\203" \ + "\77M~\377\213@N\177\377\1\77M~\377\202@N\177\377\202\77M~\377\5\77M}" \ + "\377@N\177\377;I{\377(8o\377\33,g\377\202\30)d\377\225\31*e\377\6\27" \ + "(d\377\33-f\3771@u\377s\377\36/i\377\30)d\377\233\31*e\377\2\30" \ + ")d\377\33,f\377\212-L}\377\202\77M~\377\3+;q\377\33" \ + ",f\377\31*e\377\202\30)d\377\224\31*e\377\4\30)d\377\27(c\377\"2j\377" \ + "9G{\377\202=K}\377\1L}\377" \ + "\77M~\377>L}\377\203\77M~\377\2@N\177\377\77M~\377\215@N\177\377\1\77" \ + "M~\377\203@N\177\377\203AO\200\377\1@N\177\377\225AO\200\377\204@N\200" \ + "\377\207AO\200\377\234BP\200\377\207AO\200\377\205@N\200\377\230AO\200" \ + "\377\203@N\177\377\202\77M~\377\214@N\177\377\1\77M~\377\202@N\177\377" \ + "\202\77M~\377\1>L}\377\202\77M~\377\5=K|\3772Au\377\34,g\377\30)d\377" \ + "\31)d\377\225\31*e\377\7\31)e\377\30)d\377\32+f\377)9p\377L}\377\202\77M~\377\202@N\177\377\1\77M~\377" \ + "\214@N\177\377\203\77M~\377\203@N\177\377\203AO\200\377\1@N\177\377\226" \ + "AO\200\377\207@N\200\377\234AO\200\377\207@N\200\377\227AO\200\377\1" \ + "@N\177\377\202AO\200\377\203@N\177\377\203\77M~\377\215@N\177\377\2\77" \ + "M~\377@N\177\377\202\77M~\377\7>L}\377\77M~\377@N~\377;I{\3772@u\377" \ + "!2j\377\26(c\377\202\30)d\377\225\31*e\377\7\30)d\377\27)d\377\37/i\377" \ + "1@u\377>L}\377=K}\377L}\377\202" \ + "\77M~\377\202@N\177\377\1\77M~\377\215@N\177\377\202\77M~\377\204@N\177" \ + "\377\236AO\200\377\235@N\200\377\232AO\200\377\1@N\177\377\203AO\200" \ + "\377\203@N\177\377\203\77M~\377\214@N\177\377\1\77M~\377\203@N\177\377" \ + "\202\77M~\377\5\77M}\377@N~\377>L}\377.=s\377!1j\377\202\30)d\377\1\31" \ + ")d\377\226\31*e\377\7\30)d\377\30*d\377)9o\3779Gz\377>L}\377=J}\377<" \ + "J|\377\203=K}\377\2M~\377.=s\377\34-f\377\31*e\377\202\30)d\377\227\31*e\377" \ + "\6\30)d\377\34,f\3773Bv\377L}\377\202\77M~\377\203" \ + "@N\177\377\1\77M~\377\217@N\177\377\203\77M~\377\204@N\177\377\203AO" \ + "\200\377\1@N\177\377\276AO\200\377\1@N\177\377\204AO\200\377\204@N\177" \ + "\377\203\77M~\377\217@N\177\377\1\77M~\377\202@N\177\377\202\77M~\377" \ + "\1>L}\377\202\77M~\377\4>L}\377;J{\377/>s\377\33,f\377\202\30)d\377\227" \ + "\31*e\377\202\30)d\377\5\31*e\377$3l\377;J|\377=K}\377" \ + "L}\377\203\77M~\377\202@N\177\377\1\77M~\377\220@N\177\377\203\77M~\377" \ + "\204@N\177\377\204AO\200\377\1@N\177\377\266AO\200\377\1@N\177\377\204" \ + "AO\200\377\205@N\177\377\203\77M~\377\220@N\177\377\1\77M~\377\202@N" \ + "\177\377\204\77M~\377\6@M~\377>L}\3776Ex\377+:p\377\34,g\377\26'c\377" \ + "\202\30)d\377\227\31*e\377\202\30)d\377\5\37""0i\3771@t\377>L~\377=K" \ + "}\377L}\377\77M~\377AN\177\377=L}\3770\77t\377$3" \ + "l\377\33,f\377\27(d\377\30)d\377\231\31*e\377\4\27)d\377\31*e\377+:q" \ + "\3779Gz\377\206=K}\377\1L~\377\77M~\377" \ + "@N~\377;I|\377*9p\377\33,g\377\32*e\377\203\30)d\377\230\31*e\377\5\30" \ + ")d\377\27(d\377!2k\3777Gy\377L}\377\77M~\377>L}\377" \ + "\203\77M~\377\203@N\177\377\1\77M~\377\226@N\177\377\206\77M~\377\210" \ + "@N\177\377\224AO\200\377\211@N\177\377\206\77M~\377\231@N\177\377\203" \ + "\77M~\377\1>L}\377\202\77M~\377\4>L}\377=K|\3775Dx\377$4l\377\203\30" \ + ")d\377\232\31*e\377\4\30)d\377\31*e\377\34,g\377.t\377\32*f\377\30)d\377\230\31*e\377\3\30)d\377\"2k\3773Cw\377" \ + "\2112Av\377\2""1Au\3770At\377\2071Au\377\5""0@t\3770@u\377/\77t\377\32" \ + "+f\377\30)d\377\233\31*e\377\202\30)d\377\4%5m\377.=s\377-L~\377@N~\377\77M~\377>L}\377\203\77M~\377\203" \ + "@N\177\377\1\77M~\377\231@N\177\377\210\77M~\377\224@N\177\377\211\77" \ + "M~\377\231@N\177\377\1\77M~\377\202@N\177\377\203\77M~\377\1>L}\377\202" \ + "\77M~\377\10@N~\377;J{\3775Cw\377,;q\377\36/h\377\26'c\377\27)d\377\30" \ + ")d\377\232\31*e\377\10\30)d\377\27(d\377\33,g\377'7n\3778Fz\377>L~\377" \ + "=K}\377s\377\32,f\377\30)d\377\226\31*" \ + "e\377\5\30)d\377\35.h\3773Bw\3778Fz\3777Ey\377\2058Fz\377\2037Fy\377" \ + "\1""6Fx\377\2077Fy\377\2""6Ex\3775Dw\377\2056Ex\377\5""5Dw\3776Ex\377" \ + "2Au\377\34-g\377\30)d\377\230\31*e\377\4\30)d\377\34-g\3772Av\3773Bw" \ + "\377\2072Av\377\3""1Au\3772Av\3770At\377\2061Au\377\2""0@u\3771Au\377" \ + "\2020@u\377\2!2k\377\30)d\377\234\31*e\377\5\30)d\377\35.h\377,;r\377" \ + ".=s\377,;q\377\207-L}\377\77M~\377@N\177\377\77M~\3774Cw\377(8o\377" \ + "\40""1j\377\32+f\377\27(d\377\202\30)d\377\233\31*e\377\4\30)d\377\27" \ + "(d\377%5m\3774Cw\377\202=K}\377\1t\3773Bw\3772Av\3771@u\377\2052Av" \ + "\377\4""1Au\3772Av\3771Au\3770At\377\2071Au\377\3""0@t\3770@u\377)9p" \ + "\377\235\31*e\377\6\30)d\377\31*e\377&6n\377.=s\377-s\377" \ + "=J|\377@N\177\377\206\77M~\377\203@N\177\377\1\77M~\377\313@N\177\377" \ + "\1\77M~\377\203@N\177\377\203\77M~\377\1>M~\377\203\77M~\377\5""6Ex\377" \ + "(8o\377\34,g\377\32+e\377\31*e\377\202\30)d\377\1\31*d\377\233\31*e\377" \ + "\5\30)d\377\27(c\377\36/i\3774Cw\377s\377\36.h\377\30)d\377\234\31*e\377\5\30)e" \ + "\377\35.h\377-=r\377.=s\377,;q\377\206-L}\377\203\77M~\377\1>L}\377\204\77M~" \ + "\377\204@N\177\377\1\77M~\377\301@N\177\377\204\77M~\377\202>L}\377\202" \ + "\77M~\377\7>L}\377=K}\377s\377>K}\377" \ + "=K}\377L~\3773Bw" \ + "\377$4l\377\32+e\377\27)d\377\30)d\377\236\31*e\377\202\30)d\377\13\26" \ + "(c\377\27)d\377\40""1j\377*:p\3772Au\3778Fy\377L}\377\202\77M~\377\13@N~\377\77M}\377:H{\3775Dw\377" \ + "/>t\377%6m\377\34-f\377\26'c\377\27(d\377\30)d\377\30)e\377\235\31*e" \ + "\377\202\30)d\377\5\27)d\377\36/h\377*:p\377:H{\377>L~\377\206=K}\377" \ + "\1t\3773Bw\3771@u\377\2062" \ + "Av\377\4""1Au\3772Av\3771Au\3770At\377\2051Au\377\7""0@u\3771Au\3770" \ + "@t\3770@u\377+t\377\207-t\377" \ + "7Fy\377\77M~\377AO\177\377@N~\377\77M~\377>L}\377\205\77M~\377\260@N" \ + "\177\377\1\77M~\377\205@N\177\377\205\77M~\377\1>L}\377\202\77M~\377" \ + "\11@N\177\377AN\177\377L}\377=K}\377L}\377\202" \ + "\77M~\377\11@N~\377@N\177\377=K|\3773Bu\377)9o\377\37""0i\377\33,f\377" \ + "\32+f\377\31*e\377\204\30)d\377\240\31*e\377\11\30)d\377\27)d\377\32" \ + "*e\377-L~\3774Dw\377!2j\377" \ + "\32*e\377\31*d\377\202\30)d\377\243\31*e\377\203\30)d\377\12\27(d\377" \ + "\30)e\377\40""0i\377)9o\3771@u\3779Hz\377L}\377" \ + "\205\77M~\377\1\77M}\377\202>L}\377\240\77M~\377\203>L}\377\205\77M~" \ + "\377\202>L}\377\7=K}\377L~\3774Bw\377&6m\377\35-g\377\27(d\377\202\30)d\377\245\31*e\377\202" \ + "\30)d\377\17\27(d\377\27(c\377\26'c\377\32,f\377\40""1j\377&6m\377+:" \ + "q\3770\77t\3773Bv\3776Dx\3778Gy\377:I{\377=K|\377\77M~\377@N\177\377" \ + "\202@N~\377\210\77M~\377\1\77L}\377\213>L}\377\210\77M~\377\22@M~\377" \ + "@N~\377@N\177\377@N~\377>L}\377L~\377=K}\377s\377\35.h\377\30)d\377\234\31*e\377\6\30" \ + ")d\377\32+e\377(8o\377.=s\377-K}\377\77M~\377@N\177\377\213AO\177\377\24@N~\377" \ + ">L}\377=K|\377;I{\3779Gz\3777Ey\3774Cw\3771Au\377/>s\377,;q\377(8o\377" \ + "&5m\377#3l\377!1j\377\37""0i\377\35-g\377\32+e\377\30)d\377\27(c\377" \ + "\27(d\377\203\30)d\377\250\31*e\377\12\30)d\377\27(d\377\30)d\377$5m" \ + "\3771@u\377:H{\377>L}\377=K}\377L~\3774Cw\377\"2k\377\32+f\377\31*e\377\202\30)d\377\1\31*d\377\271" \ + "\31*e\377\212\30)d\377\272\31*e\377\203\30)d\377\4\32+e\377\34-g\377" \ + "+:p\377;I|\377\202=K}\377\1L~\3777Ey\377*9p\377!1j\377\32+e\377\27(d\377\30)d\377" \ + "\372\31*e\377\203\30)d\377\7\35.h\377$4l\3770\77t\377L~\377=" \ + "K}\377=K|\377\206=K}\377\2L}\377:H{\3773Bv\377)9p\377\35.h\377\26'c\377\202\30)d\377\365\31*e" \ + "\377\7\30)d\377\27(c\377\30)d\377#3l\377/>s\3777Ey\377=K|\377\202=K}" \ + "\377\1L}\377:I|\377" \ + "-=s\377\37""0i\377\32+f\377\31*e\377\203\30)d\377\346\31*e\377\203\30" \ + ")d\377\6\31*d\377\32+e\377\34-g\377%6n\3775Cw\377>L~\377\202=K}\377\1" \ + "L}\377>L~\3777Ey\377,;r\377#3l\377" \ + "\36/h\377\31*d\377\27(d\377\202\30)d\377\340\31*e\377\1\31*d\377\202" \ + "\30)d\377\11\27(d\377\33,f\377\40""1j\377'7n\3772@u\377L}\377L}\377" \ + "\202=K}\377\1s\377\31*e\377\202\30)d\377\231\31*e\377\4" \ + "\30)d\377\37/i\3770\77u\3773Bw\377\2021@u\377\2052Av\377\4""1Au\3772" \ + "Av\3771Au\3770At\377\2101Au\377\5""0@t\3770@u\377)9p\377\32+e\377\30" \ + ")d\377\235\31*e\377\2\30)d\377\36.h\377\202-L}\377" \ + "=K}\3772Av\377'8o\377\35.h\377\33+f\377\32+e\377\31*e\377\204\30)d\377" \ + "\306\31*e\377\205\30)d\377\7\31*e\377\32+f\377\33,f\377\"2k\377-L}\377\202=K}\377\2r\377\31*e\377\30)d\377\232\31*e\377\5\30)d\377\34,g\377" \ + ".=s\3773Bw\3771@u\377\2102Av\377\2""1Au\3770At\377\2061Au\377\7""0@u" \ + "\3771Au\3770@t\3770@u\377-=s\377\35.h\377\30)d\377\235\31*e\377\6\30" \ + ")d\377\32*e\377*9p\377.=s\377-L~\377\10""9Gz\3770@u\377" \ + ")8p\377#3l\377\37""0i\377\34,g\377\30)d\377\27(d\377\204\30)d\377\275" \ + "\31*e\377\203\30)d\377\202\27(d\377\11\32+e\377\36.h\377!2j\377&6n\377" \ + ",L}\377\214=K}\377\1s\377\2108Fz\377\4""7Fy\3778Fz\3777Fy\3776Fx\377\2077Fy\377" \ + "\4""6Ex\3777Fy\3776Ex\3775Dw\377\2066Ex\377\5""5Dw\3776Ex\377-=r\377" \ + "\32+f\377\30)d\377\232\31*e\377\4\30)d\377\32+e\377+;r\3774Cw\377\210" \ + "2Av\377\4""1Au\3772Av\3771Au\3770At\377\2051Au\377\7""0@u\3771Au\377" \ + "0@u\3770@t\377/\77u\377!2j\377\30)d\377\235\31*e\377\6\30)d\377\31*e" \ + "\377$4l\377-L}\377s\3773Bv\3777Ey\377:I{\377\202>L}" \ + "\377\202=K}\377\1L}\377>L~\377L}\377\1>K}\377\203" \ + "=K}\377\1t\377\33,f\377" \ + "\202\30)d\377\232\31*e\377\4\30)e\377\30)d\377\33+f\377+;r\377\2108F" \ + "z\377\3""7Fy\3778Fz\3777Fy\377\2026Fx\377\2077Fy\377\4""6Ex\3777Fy\377" \ + "6Ex\3775Dw\377\2106Ex\377\2+;q\377\30)d\377\233\31*e\377\3\30)d\377\31" \ + "*e\377$5m\377\2022Av\377\1""1@u\377\2062Av\377\4""1Au\3772Av\3771Au\377" \ + "0At\377\2061Au\377\2""0@u\3771Au\377\2020@u\377\2+;r\377\32+f\377\236" \ + "\31*e\377\202\30)d\377\4$4m\377.=s\377-K}\377" \ + "\202>L~\377\17\77M~\377>L~\377;I{\3777Fy\3775Cw\3771@v\377.>t\377,L~\377>L}\377\227=K}\377\203" \ + "s\377\36/h\377\30" \ + ")d\377\235\31*e\377\4\31*d\377\30)d\377\37""0i\377.=s\377\202-K}\377\203>L}\377\5>L~\377=K}\377L~\377\203>L}\377\1>K}\377\205=K}\377\1t\3773Bw\3771@u\377\210" \ + "2Av\377\2021Au\377\1""0At\377\2061Au\377\2""0@u\3771Au\377\2020@u\377" \ + "\2+;q\377\32+f\377\237\31*e\377\4\30)d\377\33,f\377,t\377\2028Fz\377\1""7Ey\377\2068Fz\377\2047Fy\377\1""6Fx\377\2077F" \ + "y\377\2""6Ex\3777Fy\377\2026Ex\377\1""5Dw\377\2056Ex\377\4""5Dw\3776" \ + "Ex\3773Bv\377\40""0i\377\202\30)d\377\233\31*e\377\4\30)d\377\33,f\377" \ + ".>s\3773Bw\377\2112Av\377\2021Au\377\1""0At\377\2061Au\377\7""0@u\377" \ + "1Au\3770@u\377/\77u\377-=s\377\34-g\377\30)d\377\236\31*e\377\6\30)d" \ + "\377\31*e\377)9p\377.=s\377-t\3778Fz\3777Ey\377\2108Fz\377\2027Fy\377" \ + "\1""6Fx\377\2107Fy\377\1""6Ex\377\2027Fy\377\1""5Dw\377\2066Ex\377\1" \ + "5Dw\377\2026Ex\377\3.>s\377\32+f\377\30)d\377\233\31*e\377\202\30)d\377" \ + "\5\33+f\377.=t\3773Bw\3772Av\3771@u\377\2062Av\377\1""1Au\377\2022Av" \ + "\377\1""0At\377\2101Au\377\5""0@t\377/\77u\3770@u\377!1j\377\30)d\377" \ + "\236\31*e\377\202\30)d\377\1\40""0j\377\202-t\3777Ey\3778Fz\3777Ey\3777Fz\377\2058Fz\377\1""7Fy\377\2028Fz\377\2" \ + "7Fy\3776Fx\377\2107Fy\377\2""6Ex\3777Fy\377\2026Ex\377\1""5Dw\377\205" \ + "6Ex\377\6""5Dw\3776Ex\3777Ex\377&6n\377\31*e\377\30)d\377\234\31*e\377" \ + "\6\30)d\377\32*f\377,;r\3773Bw\3772Av\3771@u\377\2102Av\377\2021Au\377" \ + "\1""0At\377\2061Au\377\2""0@u\3771Au\377\2020@u\377\1&7n\377\240\31*" \ + "e\377\6\31*d\377\30*e\377(8o\377.=s\377-s\377\36.h\377\32+e\377\203\30)d\377\237\31*e\377\4\30)d\377\30*" \ + "d\377'7n\3776Dx\377\2028Fz\377\1""7Ey\377\2068Fz\377\2""7Fy\3778Fz\377" \ + "\2027Fy\377\1""6Fx\377\2107Fy\377\3""6Ex\3777Fy\3776Ex\377\2025Dw\377" \ + "\2076Ex\377\4""4Dw\377\"2k\377\31*e\377\30)d\377\234\31*e\377\6\30)d" \ + "\377\31*d\377.=s\3773Bw\3772Av\3771@u\377\2072Av\377\2""1Au\3772Av\377" \ + "\2020At\377\2061Au\377\7""0@u\3771Au\3770@t\3770@u\377*:q\377\31*e\377" \ + "\30)d\377\237\31*e\377\5\27(d\377$5m\377.=s\377-s\377\35.h\377\27(d\377\235" \ + "\31*e\377\6\30)d\377\33,f\377+;r\3773Bw\3772Av\3771@u\377\2062Av\377" \ + "\2""1Au\3772Av\377\2111Au\377\7""0@u\3771Au\3770@t\3770@u\377,t\3773Bw\3772Av\3771@u\377\207" \ + "2Av\377\2""1Au\3772Av\377\2020At\377\2061Au\377\7""0@u\3771Au\3770@u" \ + "\377/\77u\377.>t\377\36/i\377\30)d\377\240\31*e\377\5\30)d\377%4m\377" \ + ".=s\377-s\377\210-s\377%5m\377\37""0i\377\32+e\377\27(d\377\202\30)d" \ + "\377\245\31*e\377\202\30)d\377\2%4m\3771\77u\377\2028Fz\377\1""7Ey\377" \ + "\2078Fz\377\1""7Fy\377\2028Fz\377\1""7Fy\377\2026Fx\377\2127Fy\377\202" \ + "6Ex\377\1""5Dw\377\2066Ex\377\6""5Dw\3776Ex\3776Ew\377&6m\377\31*e\377" \ + "\30)d\377\236\31*e\377\6\27)d\377\35.h\377/>t\3773Bw\3772Av\3771@u\377" \ + "\2102Av\377\2021Au\377\1""0At\377\2071Au\377\6""0@u\3771At\3770@u\377" \ + "/\77t\377\"2k\377\30)d\377\240\31*e\377\6\30)d\377\34-g\377+:q\377.=" \ + "s\377-s\377\"" \ + "2k\377\33,f\377\32+e\377\204\30)d\377\245\31*e\377\5\30)d\377\27(c\377" \ + "\37""0i\3772@u\3777Ey\377\2028Fz\377\1""7Ey\377\2118Fz\377\2027Fy\377" \ + "\1""6Fx\377\2117Fy\377\3""6Ex\3777Fy\3776Ex\377\2025Dw\377\2066Ex\377" \ + "\4""5Dw\3776Ex\3774Cw\377\40""0i\377\203\30)d\377\235\31*e\377\4\30)" \ + "d\377\37/i\3771@v\3773Bv\377\2021@u\377\2072Av\377\2""1Au\3772Av\377" \ + "\2020At\377\2071Au\377\7""0@u\3771Au\3770@u\377/\77t\377#3l\377\31*e" \ + "\377\30)d\377\237\31*e\377\3\30)d\377\32+e\377(7n\377\202.=s\377\1,;" \ + "q\377\206-s\377\32*f\377\30)d\377\236\31*e\377\202\30)d\377\4\40""0j\377" \ + "1@v\3772Av\3771@u\377\2072Av\377\1""1Au\377\2022Av\377\1""0At\377\207" \ + "1Au\377\6""0@u\3771Au\3771At\3770@u\377/\77t\377&6n\377\202\30)d\377" \ + "\237\31*e\377\6\30)d\377\31*e\377$3l\377/>s\377-s\377'8n\377\37""0i\377\30" \ + ")d\377\27(c\377\202\30)d\377\250\31*e\377\203\30)d\377\4\37/i\377*9p" \ + "\3777Ey\3779Fz\377\2138Fz\377\2027Fy\377\1""6Fx\377\2127Fy\377\2046E" \ + "x\377\1""5Dw\377\2066Ex\377\6""5Dw\3776Ex\3774Cw\377'7n\377\30)e\377" \ + "\30)d\377\236\31*e\377\202\30)d\377\4\"2k\3771@v\3773Bw\3771@u\377\207" \ + "2Av\377\2""1Au\3772Av\377\2131Au\377\1""0@t\377\2020@u\377\1%6n\377\202" \ + "\30)d\377\240\31*e\377\3\30)d\377!1j\377/>s\377\212-s\3776Ex\377s\377'7n\377\37""0i\377" \ + "\30)d\377\27(d\377\203\30)d\377\256\31*e\377\202\30)d\377\6\31*e\377" \ + "\35-g\377+:q\3779Fz\3778Fz\3777Ey\377\2108Fz\377\2""7Fy\3778Fz\377\203" \ + "7Fy\377\1""6Fx\377\2117Fy\377\1""6Ex\377\2027Fy\377\1""6Ex\377\2025D" \ + "w\377\2066Ex\377\1""5Dw\377\2026Ex\377\2""3Bv\377#3k\377\202\30)d\377" \ + "\237\31*e\377\6\30)d\377\32+f\377)9p\3773Bw\3772Av\3771@u\377\2072Av" \ + "\377\1""1Au\377\2022Av\377\1""0At\377\2071Au\377\6""0@u\3771Au\3771A" \ + "t\3770@u\377/\77t\377'7o\377\202\30)d\377\240\31*e\377\6\30)d\377\33" \ + ",f\377)9p\377.=s\377-s\377-<" \ + "r\377,;q\377\207-t\3776Dx\3779Fz\3778Fz\3777Ey\377\210" \ + "8Fz\377\2""7Fy\3778Fz\377\2027Fy\377\2026Fx\377\2127Fy\377\2""6Ex\377" \ + "7Fy\377\2026Ex\377\1""5Dw\377\2076Ex\377\6""5Dw\3776Ex\3772Au\377#3l" \ + "\377\31*e\377\30)d\377\237\31*e\377\5\30)e\377\27(d\377\37/i\377.=s\377" \ + "3Bw\377\2022Av\377\1""1@u\377\2102Av\377\2021Au\377\1""0At\377\2071A" \ + "u\377\2""0@u\3771At\377\2020@u\377\3%5m\377\31*e\377\30)d\377\240\31" \ + "*e\377\202\30)d\377\2&6m\377.=s\377\211-t\377" \ + "3Bw\3772Av\377\2021@u\377\2072Av\377\4""1Au\3772Av\3771Au\3770At\377" \ + "\2071Au\377\10""0@u\3771Au\3770@u\377/\77u\377/\77t\377#3l\377\31*e\377" \ + "\30)d\377\241\31*e\377\6\30)d\377\33,f\377-s\377!1j\377\27(c\377\242\31*e\377\6\30)d\377\32+e\377(7o\377" \ + ".=s\377-t\377\2038Fz\377\1""7Ey\377\2138Fz\377\1""7Fy\377\202" \ + "8Fz\377\2037Fy\377\2026Fx\377\2167Fy\377\2026Ex\377\2025Dw\377\2076E" \ + "x\377\1""5Dw\377\2026Ex\377\3""5Dw\3771Au\377!2j\377\202\30)d\377\243" \ + "\31*e\377\4\30)d\377\31*e\377%6m\3773Bw\377\2022Av\377\1""1@u\377\210" \ + "2Av\377\4""1Au\3772Av\3771Au\3770At\377\2071Au\377\3""0@u\3771Au\377" \ + "1At\377\2020@u\377\3-=r\377\33+f\377\30)d\377\242\31*e\377\6\30)d\377" \ + "\31*d\377&6m\377.=s\377-t\3777Ey\3779G{\377\2028Fz\377\1""7Ey\377\2138" \ + "Fz\377\1""7Fy\377\2028Fz\377\2027Fy\377\2036Fx\377\2147Fy\377\2""6Ex" \ + "\3777Fy\377\2036Ex\377\1""5Dw\377\2106Ex\377\1""5Dx\377\2026Ex\377\3" \ + "1@u\377'6n\377\32*e\377\202\30)d\377\242\31*e\377\6\31*d\377\30)d\377" \ + "\34-g\377*:p\3773Bw\3772Av\377\2021@u\377\2072Av\377\1""1Au\377\2022" \ + "Av\377\2""1Au\3770At\377\2071Au\377\2""0@u\3771Au\377\2030@u\377\3*:" \ + "p\377\32+f\377\30)d\377\242\31*e\377\6\30)d\377\31*e\377$4l\377-=r\377" \ + ".=s\377,;q\377\207-t\377*:q\377#3l\377\33,f\377\26'c\377\27(d\377" \ + "\202\30)d\377\353\31*e\377\202\30)d\377\10\27(c\377\31)d\377\37/i\377" \ + "'6n\377.=s\3772Av\3776Ey\3779Gz\377\2178Fz\377\1""7Fy\377\2028Fz\377" \ + "\2037Fy\377\2026Fx\377\2147Fy\377\1""6Ex\377\2027Fy\377\2026Ex\377\202" \ + "5Dw\377\2106Ex\377\5""5Dw\3777Fx\3773Cv\377&6m\377\34-g\377\202\30)d" \ + "\377\243\31*e\377\7\30)d\377\27(d\377!2j\377/>t\3773Bw\3772Av\3771@u" \ + "\377\2102Av\377\2""1Au\3772Av\377\2021Au\377\1""0At\377\2071Au\377\10" \ + "0@u\3771Au\3770@u\377/\77u\3770@u\377&7n\377\32+e\377\30)d\377\243\31" \ + "*e\377\6\30)d\377#3k\377-t\377+:q\377&6m\377!1j\377\33,f\377\27(d\377\27(c\377\27(d\377\203" \ + "\30)d\377\303\31*e\377\202\30)d\377\14\27(d\377\27(c\377\26(c\377\30" \ + ")e\377\36.h\377#3k\377(8o\377-=s\3771\77u\3773Bw\3776Ey\3779Gz\377\203" \ + "8Fz\377\1""7Ey\377\2178Fz\377\1""7Fy\377\2038Fz\377\2037Fy\377\2026F" \ + "x\377\2167Fy\377\1""6Ex\377\2027Fy\377\2026Ex\377\2025Dw\377\2116Ex\377" \ + "\6""5Dw\3776Ex\3775Dw\377*:p\377\40""0i\377\31*e\377\202\30)d\377\245" \ + "\31*e\377\6\30)d\377\34,g\377*:p\3773Bv\3773Bw\3772Av\377\2021@u\377" \ + "\2112Av\377\2021Au\377\1""0At\377\2111Au\377\6""0@u\3770@t\3770@u\377" \ + ",s\377)8p\377#3k" \ + "\377\34-g\377\202\27(d\377\204\30)d\377\1\30)e\377\267\31*e\377\204\30" \ + ")d\377\11\27)d\377\27(c\377\32+e\377\40""0i\377&5m\377,;r\3772@v\377" \ + "5Dx\3776Dx\377\2027Ey\377\2048Fz\377\1""7Ey\377\2218Fz\377\1""7Fy\377" \ + "\2028Fz\377\2037Fy\377\2036Fx\377\2167Fy\377\1""6Ex\377\2027Fy\377\203" \ + "6Ex\377\1""5Dw\377\2116Ex\377\6""5Dw\3776Ex\3777Fx\377,;q\377\35-g\377" \ + "\31*e\377\202\30)d\377\245\31*e\377\5\31*d\377\30)d\377\40""0j\3770@" \ + "u\3773Bw\377\2022Av\377\1""1@u\377\2102Av\377\3""1Au\3772Av\3771Au\377" \ + "\2020At\377\2101Au\377\2020@u\377\4/\77t\3770@u\377*:p\377\32*e\377\202" \ + "\30)d\377\243\31*e\377\2\30)d\377\40""0j\377\202.=s\377\2-t\377,;r\377)8p\377&6n\377$4l\377\"2k\377" \ + "!1j\377\37""0i\377\36/i\377\35.h\377\34-g\377\33,f\377\33+f\377\32+e" \ + "\377\31*e\377\30)d\377\27)d\377\221\27(d\377\23\30)d\377\31)d\377\31" \ + "*e\377\32+e\377\33,f\377\34,g\377\35-h\377\36.h\377\37/i\377\40""0j\377" \ + "!1k\377#3k\377%5m\377'7o\377*9p\377-t\3773Bw\3772Av\377\2021@u\377\2102Av\377" \ + "\2""1Au\3772Av\377\2021Au\377\1""0At\377\2111Au\377\5""0@u\3770@t\377" \ + "0@u\377.>t\377\"3k\377\202\30)d\377\243\31*e\377\202\30)d\377\5!1j\377" \ + "-t\377.>t\377.=s\377-s\3770>t\3771\77u\3771@u\3772Av\3774Bw\3775Cw\3776Dx\377" \ + "7Ey\3778Fz\3779Gz\3779Fz\377\2058Fz\377\2""8Fy\3777Ez\377\2278Fz\377" \ + "\1""7Fy\377\2038Fz\377\2047Fy\377\2026Fx\377\2207Fy\377\1""6Ex\377\203" \ + "7Fy\377\2036Ex\377\1""5Dw\377\2126Ex\377\6""5Dw\3776Ex\3777Fx\3771@u" \ + "\377%5m\377\35.h\377\203\30)d\377\247\31*e\377\7\27)d\377\33+f\377)9" \ + "p\3772Av\3773Bw\3772Av\3771@u\377\2112Av\377\2""1Au\3772Av\377\2021A" \ + "u\377\1""0At\377\2101Au\377\2020@u\377\4""0@t\3770@u\377,s\377\40""0i\377\202" \ + "\30)d\377\251\31*e\377\5\30)d\377\31*e\377\33,f\377)9p\3773Bw\377\202" \ + "2Av\377\1""1@u\377\2112Av\377\3""1Au\3772Av\3771Au\377\2020At\377\211" \ + "1Au\377\7""0@u\3770@t\3770@u\377/\77t\377&6n\377\31*e\377\30)d\377\244" \ + "\31*e\377\202\30)d\377\2\"2k\377.=s\377\202-t\377#3k\377\202\30)d\377\244\31*e\377\202\30)" \ + "d\377\3\31*e\377'6m\377.=s\377\202-s\377&5m\377\37""0i\377\32+f\377\27)d\377\202\30)d\377\254\31*e\377" \ + "\7\30)d\377\27(c\377\33-g\377)8o\3770\77u\3774Bw\3772Av\377\2021@u\377" \ + "\2112Av\377\2""1Au\3772Av\377\2021Au\377\2020At\377\2121Au\377\1""0@" \ + "t\377\2020@u\377\3%6m\377\32+f\377\30)d\377\246\31*e\377\6\30)d\377\32" \ + "+e\377(7o\377.=s\377-s\3774Cv\3775Dw\377\2036E" \ + "x\377\1""5Dw\377\2176Ex\377\2035Dw\377\2046Ex\377\2057Fy\377\1""6Ex\377" \ + "\3207Fy\377\1""6Ex\377\2057Fy\377\2046Ex\377\2045Dw\377\2166Ex\377\1" \ + "5Dw\377\2036Ex\377\5""5Dw\3774Cw\3772Bv\377)9p\377\35.g\377\203\30)d" \ + "\377\257\31*e\377\202\30)d\377\5\31*e\377\36.i\377.=s\3774Cw\3773Bw\377" \ + "\2021@u\377\2112Av\377\2""1Au\3772Av\377\2031Au\377\1""0At\377\2101A" \ + "u\377\11""0@u\3771Au\3770@u\3770@t\377/\77u\377/\77t\377*:q\377\31+f" \ + "\377\30)d\377\246\31*e\377\202\30)d\377\5\34-g\377+;r\377.=s\377-s\377#4l\377\202\30)d\377\246\31*e" \ + "\377\7\31*d\377\30)d\377\37/i\377+:q\377.=s\377-t\377%6m\377\34-g\377\32" \ + "+e\377\31*e\377\203\30)d\377\1\30)e\377\262\31*e\377\5\30)d\377\33+f" \ + "\377*9p\3771@v\3773Bw\377\2022Av\377\2021@u\377\2122Av\377\2041Au\377" \ + "\1""0At\377\2111Au\377\2""0@u\3771Au\377\2030@u\377\2#3k\377\31*e\377" \ + "\202\30)d\377\246\31*e\377\202\30)d\377\5$4l\377-s\3774Cv\3774Cw\3775Dw\377\2046Ex" \ + "\377\1""5Dw\377\2256Ex\377\2065Dw\377\2136Ex\377\2357Fy\377\2126Ex\377" \ + "\2075Dw\377\2246Ex\377\2""5Ex\3776Dw\377\2036Ex\377\2025Dw\377\6""4C" \ + "v\3772Au\377+;q\377!1k\377\31*e\377\27(d\377\202\30)d\377\264\31*e\377" \ + "\202\30)d\377\6\31*e\377\32+f\377$5m\3772Av\3773Bw\3772Av\377\2021@u" \ + "\377\2142Av\377\2021Au\377\1""0At\377\2111Au\377\10""0@u\3771Au\3770" \ + "@u\3770@t\3770@u\377/\77t\377,s\377*:p\377$4l\377\35.g\377\27(d\377\27(c\377\202\30" \ + ")d\377\266\31*e\377\202\30)d\377\4\34-g\377$4m\3770\77u\3774Cw\377\202" \ + "2Av\377\1""1@u\377\2122Av\377\2""1Au\3772Av\377\2031Au\377\1""0At\377" \ + "\2111Au\377\2""0@u\3771Au\377\2030@u\377\5.>s\377&6n\377\31*e\377\30" \ + ")d\377\31*d\377\247\31*e\377\5\30)d\377\33+f\377&6n\377/=s\377-t\3773Bw\377\2022Av\377\2021@u\377\2122Av\377\2""1" \ + "Au\3772Av\377\2021Au\377\2020At\377\2131Au\377\5""0@u\377/\77t\3770@" \ + "u\377*:q\377\36/i\377\202\30)d\377\250\31*e\377\4\27)d\377\35-h\377)" \ + "9p\377.=s\377\214-s\377" \ + "0@t\3772Bu\3774Cw\3776Ex\3777Fx\377\2076Ex\377\1""5Dw\377\2536Ex\377" \ + "\1""5Dx\377\2066Ex\377\14""7Ex\3777Fx\3775Dw\3773Bv\3771Au\377/\77t\377" \ + ".=r\377+;q\377(8n\377$3k\377\37""0i\377\33,f\377\202\27(c\377\1\27(d" \ + "\377\203\30)d\377\276\31*e\377\202\30)d\377\5\30)e\377\36/h\377&6n\377" \ + "1@v\3774Cw\377\2022Av\377\1""1@u\377\2152Av\377\2021Au\377\2020At\377" \ + "\2121Au\377\2020@u\377\1""0@t\377\2020@u\377\2-=r\377#3l\377\202\30)" \ + "d\377\251\31*e\377\7\30)d\377\32+e\377#4l\377.>s\377.s\377,;q\377)9p\377&6n\377#3k\377!1j\377\37""0i\377\35" \ + ".h\377\33,f\377\31*e\377\30)d\377\27(d\377\204\30)d\377\301\31*e\377" \ + "\203\30)d\377\4!1j\377*:q\3770@u\3773Bw\377\2022Av\377\2021@u\377\213" \ + "2Av\377\2""1Au\3772Av\377\2021Au\377\2020At\377\2111Au\377\1""0@u\377" \ + "\2021Au\377\1""0@t\377\2020@u\377\2&6n\377\34-g\377\202\30)d\377\250" \ + "\31*e\377\202\30)d\377\3\34,f\377(7o\377.=s\377\202-s\3770@t\3772Bu\3774Cw\3776Ex\377\2067Fx\377\2027Ex\377" \ + "\2076Ex\377\2027Ex\377\2067Fx\377\14""6Dw\3774Cv\3771Au\3770\77s\377" \ + "-=r\377+;p\377)8o\377&6n\377#4k\377\40""1j\377\35.h\377\33,f\377\202" \ + "\32+f\377\1\32+e\377\203\31*e\377\207\30)d\377\305\31*e\377\202\30)d" \ + "\377\4!1j\377/>t\3772Av\3773Bw\377\2022Av\377\2021@u\377\2132Av\377\1" \ + "1Au\377\2022Av\377\2021Au\377\1""0At\377\2141Au\377\6""0@u\3770@t\377" \ + "0@u\377,u\3774Cw\3773Bw\3772Av\377\2021@u\377" \ + "\2132Av\377\1""1Au\377\2022Av\377\2021Au\377\2020At\377\2111Au\377\1" \ + "0@u\377\2021Au\377\1""0@u\377\202/\77u\377\2.>t\377%5m\377\203\30)d\377" \ + "\250\31*e\377\10\31*d\377\30)d\377\31*e\377\37""0i\377.s\377.=r\377-t\377\40""0j\377\31*e\377\203\30)d\377\252\31*e\377\3" \ + "\30)d\377\36.i\377,;q\377\202.=s\377\2-t\377'7n\377\31*e\377\30)d\377\254" \ + "\31*e\377\3\30)d\377\31*e\377#3k\377\202.=s\377\2-t\3774Cw\3773Bw\377\2022Av\377\2021@u\377" \ + "\2142Av\377\1""1Au\377\2022Av\377\2021Au\377\2020At\377\2121Au\377\1" \ + "0@u\377\2021Au\377\2030@u\377\5.>t\377(8o\377\35.h\377\27(d\377\30)d" \ + "\377\253\31*e\377\202\30)d\377\2\34,f\377'6n\377\202.=s\377\2-t\3771@v\3772Av\3773Bw\377\2032Av\377\2021@u\377\2172Av\377\2021Au" \ + "\377\2030At\377\2121Au\377\1""0@u\377\2021Au\377\1""0@t\377\2020@u\377" \ + "\3,s\377&6n\377\40""0i\377\34" \ + "-g\377\203\30)d\377\377\31*e\377\233\31*e\377\203\30)d\377\7\31*e\377" \ + "\36.h\377\"2k\377):p\3771@u\3774Cx\3773Bw\377\2022Av\377\2021@u\377\216" \ + "2Av\377\2""1Au\3772Av\377\2031Au\377\2020At\377\2131Au\377\1""0@u\377" \ + "\2021Au\377\2040@u\377\3+;q\377#3l\377\31*e\377\202\30)d\377\255\31*" \ + "e\377\6\30)d\377\31*e\377\37""0i\377,;q\377.=s\377-t\377*9p\377#3l\377\34-g\377\27(c\377\27" \ + ")d\377\202\30)d\377\377\31*e\377\224\31*e\377\202\30)d\377\6\27(c\377" \ + "\30*e\377\37/i\377&6n\377,;r\3770\77u\377\2023Bw\377\2022Av\377\2031" \ + "@u\377\2212Av\377\2021Au\377\2030At\377\2131Au\377\4""0@u\3771Au\377" \ + "0@u\3770@t\377\2020@u\377\3,s\377!1j\377\32*e\377\30*e\377\30)d\377\257\31*e\377\3" \ + "\30)d\377\35.h\377+:q\377\202.=s\377\202-t\377%6n\377\35.h\377\32+e\377" \ + "\202\31*e\377\203\30)d\377\377\31*e\377\203\31*e\377\204\30)d\377\6\31" \ + "*e\377\32+e\377\33,f\377\40""1j\377*9p\3773Av\377\2023Bw\377\2022Av\377" \ + "\2031@u\377\2172Av\377\2""1Au\3772Av\377\2031Au\377\2020At\377\2151A" \ + "u\377\4""0@u\3771Au\3770@u\3770@t\377\2020@u\377\3/\77t\377-=s\377\"" \ + "3l\377\202\30)d\377\1\30*e\377\256\31*e\377\202\30)d\377\6\31*e\377#" \ + "3k\377.=t\377.=s\377-t\3773Bw\3774Bw\3773Bw\377" \ + "\2032Av\377\2031@u\377\2172Av\377\1""1Au\377\2022Av\377\2031Au\377\202" \ + "0At\377\2151Au\377\1""0@u\377\2021Au\377\2""0@u\3770@t\377\2020@u\377" \ + "\3(9o\377\40""1i\377\32+f\377\202\30)d\377\260\31*e\377\5\30)d\377\31" \ + "*d\377#3l\377,;q\377.=s\377\202-t\377(8o\377\33,f\377\202\30)d\377\261\31*e\377\202\30)d\377\5" \ + "\31*e\377\"2k\377-t\377*9q\377%5m\377!2j\377" \ + "\37/i\377\34-g\377\32+e\377\206\30)d\377\323\31*e\377\204\30)d\377\14" \ + "\27)d\377\30)d\377\33,f\377\35.h\377\37""0i\377#3l\377'7o\377,;r\377" \ + "1\77v\3775Cx\3774Cw\3773Bw\377\2042Av\377\2031@u\377\2222Av\377\1""1" \ + "Au\377\2032Av\377\2031Au\377\2020At\377\2161Au\377\4""0@u\3771Au\377" \ + "0@u\3770@t\377\2020@u\377\5/\77t\377+;q\377%5m\377\34-g\377\27(d\377" \ + "\202\30)d\377\261\31*e\377\202\30)d\377\3\35.h\377(7n\377/>s\377\202" \ + "-t\377,t\3773Bv\3774Cw\377\2043Bw\377\2042Av\377\2051@u\377" \ + "\2252Av\377\1""1Au\377\2032Av\377\2031Au\377\2030At\377\2171Au\377\1" \ + "0@u\377\2021Au\377\3""0@u\3770@t\3770@u\377\202/\77u\377\4/\77t\377-" \ + "=r\377#3l\377\31*e\377\202\30)d\377\264\31*e\377\10\30)d\377\31*d\377" \ + "\32+f\377%5l\377/>s\377.=s\377-t\377,t\377.=s\377\202-s\377/>t\3770\77t\3770@u\377\2022Av\377" \ + "\3""4Bw\3774Cw\3774Bw\377\2043Bw\377\1""3Bv\377\2062Av\377\2061@u\377" \ + "\2352Av\377\2041Au\377\2030At\377\2201Au\377\1""0@u\377\2021Au\377\10" \ + "0@u\3770@t\3770@u\3771Au\377/\77t\377'8o\377!1j\377\34,g\377\203\30)" \ + "d\377\265\31*e\377\6\30)d\377\30(c\377\36/h\377(7o\377-s\377(9o\377\35.h\377\203\30)d\377\267\31*e\377\202\30)d\377\4\31*" \ + "e\377\36/i\377,:q\377.=s\377\202-t\377/\77t\377\2060@u\377\202" \ + "1Au\377\1""0@u\377\2271Au\377\2050At\377\2061Au\377\2062Av\377\1""1A" \ + "u\377\2762Av\377\1""1Au\377\2072Av\377\2051Au\377\2050At\377\2271Au\377" \ + "\1""0@u\377\2031Au\377\5""0@u\3770@t\3770@u\377/\77u\3770@u\377\202/" \ + "\77t\377\3-=s\377'7o\377\36/i\377\203\30)d\377\1\30)e\377\273\31*e\377" \ + "\202\30)d\377\4\31*e\377\37/i\377,;q\377.=s\377\202-t\377\2040@u\377\1""0@t\377\235" \ + "1Au\377\2050At\377\2071Au\377\2072Av\377\1""1Au\377\2602Av\377\1""1A" \ + "u\377\2072Av\377\2071Au\377\2050At\377\2311Au\377\1""0@u\377\2031Au\377" \ + "\2060@u\377\6-=r\377*:p\377%6m\377\36/i\377\30)d\377\27(d\377\202\30" \ + ")d\377\274\31*e\377\202\30)d\377\3\31*e\377\36.h\377'7n\377\202.=s\377" \ + "\202-s\3771Au\377\2020@u\377" \ + "\2""0@t\3770@u\377\2041Au\377\1""0@u\377\2321Au\377\2070At\377\2071A" \ + "u\377\2142Av\377\1""1Au\377\2312Av\377\1""1Au\377\2132Av\377\2101Au\377" \ + "\2060At\377\2331Au\377\1""0@u\377\2031Au\377\2""0@u\3770@t\377\2020@" \ + "u\377\2021Au\377\5+;q\377%5m\377\40""0j\377\34-g\377\31*e\377\203\30" \ + ")d\377\276\31*e\377\202\30)d\377\4\35.h\377'7n\377-s\377.>t\377/\77t\377/\77u\377\2060@u\377\2041Au\377\1""0@u\377\251" \ + "1Au\377\2340At\377\2541Au\377\2020@u\377\1""0@t\377\2020@u\377\2/\77" \ + "u\3770@u\377\202/\77t\377\4.>t\377+;r\377%5n\377\36.i\377\204\30)d\377" \ + "\301\31*e\377\202\30)d\377\3\31*e\377\32+e\377$4l\377\202.=s\377\3-=" \ + "s\377-s\377+;r\377)9p\377%5m\377" \ + "\40""0i\377\33+f\377\27(d\377\27)d\377\202\30)d\377\302\31*e\377\1\31" \ + "*d\377\202\30)d\377\3\34,g\377\"3k\377,;r\377\202.=s\377\202-s\377)9p\377$5m\377\40""1j\377" \ + "\36.h\377\33,f\377\30)e\377\204\30)d\377\304\31*e\377\202\30)d\377\3" \ + "\33,f\377%4l\377*:p\377\202.=s\377\202-s\377\2100@u\377\3271Au\377\1""0@u\377\2051" \ + "Au\377\2020@u\377\1""0@t\377\2040@u\377\6""1Au\377,s\377.>t\377\203/\77t\377\2020@u\377\1/\77" \ + "u\377\2020@u\377\1""0@t\377\2030@u\377\3011Au\377\1""0@u\377\2061Au\377" \ + "\2030@u\377\3""0@t\3770@u\3771Au\377\2040@u\377\202/\77t\377\7.>t\377" \ + ".>s\377-=r\377(8o\377#3k\377\35.g\377\31*e\377\204\30)d\377\312\31*e" \ + "\377\202\30)d\377\5\31*e\377\32+f\377\"2k\377-s\377/\77t\377\2040@u\377\1""1Au\377\2050@u\377\2111" \ + "Au\377\1""0@u\377\2501Au\377\1""0@u\377\2111Au\377\2030@u\377\1""0@t" \ + "\377\2070@u\377\13.>t\377-=s\377+;q\377):p\377(8o\377$4m\377!2j\377\36" \ + ".h\377\32+e\377\27(c\377\27(d\377\203\30)d\377\314\31*e\377\203\30)d" \ + "\377\3\35-g\377#3k\377,;r\377\202.=s\377\202-t\377\2021Av\377\3""1Au\3770@u\3771Au\377\2100@u\377\2241Au" \ + "\377\2020@u\377\2241Au\377\2040@u\377\1""0@t\377\2030@u\377\2""1@u\377" \ + "0@u\377\2021Au\377\14""1Av\3770@u\377-=s\377+;q\377(8p\377%6n\377\"3" \ + "k\377\40""1j\377\36/i\377\35-g\377\33,f\377\31*e\377\206\30)d\377\317" \ + "\31*e\377\202\30)d\377\3\35.h\377&6m\377+;q\377\202.=s\377\202-s\377\206.>t\377\204.\77t\377\1/\77" \ + "t\377\203.\77t\377\207.>t\377\204.>s\377\14,=r\377+;q\377)9p\377(8o\377" \ + "&7n\377$5l\377\"3k\377\40""1j\377\36/h\377\33,f\377\31*e\377\27)d\377" \ + "\210\30)d\377\331\31*e\377\202\30)d\377\4\31)d\377\31*e\377\36.h\377" \ + ")8p\377\202.=s\377\202-s\377.=s\377\202-s\377.=s\377\203-s\377\202." \ + "=s\377\203-s\377\203.=s\377\203-t\377-s\377\202.=s\377\204-s\377,;q\377'7o\377" \ + "$4l\377\40""0i\377\34,g\377\32+f\377\32+e\377\203\31*e\377\1\30)e\377" \ + "\207\30)d\377\300\31*e\377\210\30)d\377\203\31*e\377\10\32*e\377\32+" \ + "e\377\33,f\377\36.h\377\"1k\377%5m\377)9p\377-s\377\14-=s\377+:q\377)8o\377&5n\377#3l\377!" \ + "1j\377\37""0i\377\36.h\377\35-g\377\33,f\377\32+f\377\31*e\377\212\30" \ + ")d\377\256\31*e\377\212\30)d\377\14\30*e\377\31+e\377\33,f\377\34,g\377" \ + "\35.h\377\37/i\377\40""0i\377\"2k\377$4m\377'6n\377*9p\377,;r\377\202" \ + "/>s\377\1/=s\377\203.=s\377\205-\377\10\15\37\377\202\7\15!\377\2\12\20)\377\23\40O\377" \ + "\314\31*e\377\202\30)d\377\4\31*e\377\33,f\377\34-g\377\35.g\377\202" \ + "\36.h\377\1\35-g\377\206\36.h\377\3\34-g\377\33+f\377\31*e\377\202\30" \ + ")d\377\1\30)e\377\377\31*e\377\377\31*e\377\257\31*e\377\3\21\34E\377" \ + "\7\13\32\377\6\13\33\377\243\7\13\33\377\1\6\13\33\377\244\31*e\377\2" \ + "\27'_\377\12\23.\377\205\7\13\33\377\1\20\33C\377\310\31*e\377\203\30" \ + ")d\377\4\32,f\377\34-g\377\35-g\377\35.h\377\202\36.h\377\1\35-g\377" \ + "\203\36.h\377\4\35-g\377\36.h\377\36-g\377\34,f\377\203\31*e\377\202" \ + "\30)d\377\377\31*e\377\377\31*e\377\261\31*e\377\3\21\34E\377\7\13\32" \ + "\377\6\13\33\377\243\7\13\33\377\1\6\13\33\377\244\31*e\377\2\26%Z\377" \ + "\10\15#\377\205\7\13\33\377\1\15\26""6\377\304\31*e\377\202\30)d\377" \ + "\1\31*d\377\202\31*e\377\1\33,f\377\203\36.h\377\1\35-g\377\203\36.h" \ + "\377\1\35-g\377\202\36.h\377\202\35-g\377\2\33,f\377\31*e\377\202\30" \ + ")d\377\377\31*e\377\377\31*e\377\265\31*e\377\3\21\34E\377\7\13\32\377" \ + "\7\12\33\377\244\7\13\33\377\244\31*e\377\1\25#U\377\206\7\13\33\377" \ + "\1\16\27""8\377\302\31*e\377\202\30)d\377\4\31*e\377\32*e\377\33,f\377" \ + "\34-g\377\212\36.h\377\3\35-g\377\34,g\377\32+e\377\203\30)d\377\377" \ + "\31*e\377\377\31*e\377\267\31*e\377\3\20\33C\377\7\13\33\377\6\12\32" \ + "\377\243\7\13\33\377\1\7\12\33\377\244\31*e\377\3\26%Y\377\10\15!\377" \ + "\6\12\32\377\204\7\13\33\377\1\14\24""0\377\277\31*e\377\203\30)d\377" \ + "\4\32+e\377\33,f\377\34-g\377\35-g\377\202\36.h\377\2\36-g\377\35.h\377" \ + "\203\36.h\377\1\35-g\377\202\36.h\377\2\34,g\377\33+f\377\202\31*e\377" \ + "\202\30)d\377\377\31*e\377\377\31*e\377\271\31*e\377\2\17\32\77\377\6" \ + "\12\32\377\244\7\13\33\377\1\7\12\33\377\244\31*e\377\3\27'_\377\12\22" \ + "-\377\7\12\32\377\204\7\13\33\377\1\12\22.\377\275\31*e\377\202\30)d" \ + "\377\2\31*e\377\33,f\377\203\35-g\377\202\36.h\377\1\36-g\377\207\36" \ + ".h\377\3\34,f\377\32+e\377\31*e\377\203\30)d\377\377\31*e\377\377\31" \ + "*e\377\273\31*e\377\2\20\32@\377\6\12\33\377\244\7\13\33\377\1\6\13\33" \ + "\377\227\31*e\377\1\30)b\377\214\27'^\377\2\27'_\377\15\27""8\377\204" \ + "\7\13\33\377\2\6\12\32\377\13\22-\377\270\31*e\377\203\30)d\377\202\31" \ + "*e\377\2\32*e\377\34-g\377\203\36.h\377\1\35-g\377\203\36.h\377\1\35" \ + "-g\377\202\36.h\377\203\35-g\377\4\32+f\377\30)e\377\30)d\377\30)e\377" \ + "\377\31*e\377\377\31*e\377\277\31*e\377\2\20\32@\377\6\12\33\377\244" \ + "\7\13\33\377\1\6\13\33\377\227\31*e\377\2\23\40O\377\12\20)\377\212\13" \ + "\22+\377\4\13\21+\377\13\22,\377\10\16\"\377\6\12\32\377\204\7\13\33" \ + "\377\1\12\17'\377\266\31*e\377\202\30)d\377\202\31*e\377\3\32+f\377\33" \ + ",f\377\35.g\377\202\36.h\377\1\35-g\377\203\36.h\377\1\35-g\377\203\36" \ + ".h\377\4\35-g\377\34-g\377\33,f\377\32*e\377\203\30)d\377\377\31*e\377" \ + "\377\31*e\377\301\31*e\377\2\17\32@\377\6\12\33\377\244\7\13\33\377\1" \ + "\7\12\33\377\227\31*e\377\2\21\35G\377\7\13\32\377\213\7\12\33\377\206" \ + "\7\13\33\377\2\6\12\32\377\11\17$\377\263\31*e\377\203\30)d\377\4\32" \ + "+e\377\33,f\377\34-g\377\35-g\377\203\36.h\377\1\35-g\377\204\36.h\377" \ + "\7\35-g\377\36.h\377\36-g\377\35-f\377\33,f\377\32*e\377\31*e\377\202" \ + "\30)d\377\377\31*e\377\377\31*e\377\304\31*e\377\2\17\32\77\377\6\13" \ + "\33\377\244\7\13\33\377\1\7\12\33\377\227\31*e\377\2\22\37L\377\7\13" \ + "\32\377\221\7\13\33\377\2\7\13\32\377\11\17%\377\260\31*e\377\203\30" \ + ")d\377\2\31*d\377\33,f\377\203\35-g\377\207\36.h\377\1\35-g\377\203\36" \ + ".h\377\1\33+f\377\202\31*e\377\1\31*d\377\202\30)d\377\1\30*e\377\377" \ + "\31*e\377\377\31*e\377\305\31*e\377\2\20\32@\377\6\12\33\377\244\7\13" \ + "\33\377\1\6\13\33\377\227\31*e\377\1\24\"R\377\224\7\13\33\377\253\31" \ + "*e\377\203\30)d\377\203\31*e\377\3\33+f\377\35.h\377\36.h\377\202\36" \ + ".g\377\1\35-h\377\207\36.h\377\202\35-g\377\2\34,g\377\32+f\377\203\30" \ + ")d\377\377\31*e\377\377\31*e\377\312\31*e\377\2\20\32@\377\6\12\33\377" \ + "\244\7\13\33\377\1\6\13\33\377\227\31*e\377\1\24!Q\377\223\7\13\33\377" \ + "\1\7\13\34\377\250\31*e\377\203\30)d\377\6\31*d\377\31*e\377\32+f\377" \ + "\33,f\377\35-g\377\35.h\377\202\36.h\377\1\35-g\377\203\36.h\377\2\35" \ + "-h\377\36.g\377\203\36.h\377\4\35-g\377\34,g\377\32+f\377\31*e\377\203" \ + "\30)d\377\377\31*e\377\377\31*e\377\314\31*e\377\2\17\32@\377\6\12\33" \ + "\377\244\7\13\33\377\1\7\12\33\377\227\31*e\377\2\26%Y\377\7\13\32\377" \ + "\222\7\13\33\377\1\6\13\34\377\245\31*e\377\1\30)e\377\202\30)d\377\5" \ + "\30)e\377\32+f\377\33,f\377\34-g\377\35-g\377\203\36.h\377\2\36-g\377" \ + "\35.h\377\203\36.h\377\1\35-g\377\202\36.h\377\5\36-h\377\35-g\377\33" \ + ",f\377\32+e\377\31*e\377\203\30)d\377\377\31*e\377\377\31*e\377\317\31" \ + "*e\377\2\17\32\77\377\6\13\33\377\244\7\13\33\377\1\7\12\33\377\227\31" \ + "*e\377\1\26%[\377\223\7\13\33\377\1\6\13\34\377\243\31*e\377\202\30)" \ + "d\377\3\31*d\377\32+f\377\34,g\377\202\35-g\377\1\35.h\377\202\36.h\377" \ + "\2\36.g\377\35-h\377\207\36.h\377\2\35-g\377\33,e\377\203\31*e\377\203" \ + "\30)d\377\377\31*e\377\377\31*e\377\321\31*e\377\2\20\32@\377\6\12\33" \ + "\377\244\7\13\33\377\2\7\13\32\377\30(a\377\226\31*e\377\1\26&\\\377" \ + "\223\7\13\33\377\1\7\13\34\377\234\31*e\377\204\30)d\377\203\31*e\377" \ + "\2\33,f\377\34-g\377\202\36.h\377\2\36.g\377\35-h\377\204\36.h\377\1" \ + "\35-g\377\203\36.h\377\203\35-g\377\2\33,f\377\31*e\377\202\30)d\377" \ + "\1\30)e\377\377\31*e\377\377\31*e\377\243\31*e\377\6\30)b\377\27'^\377" \ + "\26%Y\377\25$W\377\24\"S\377\23\40O\377\202\22\36J\377\6\23!P\377\24" \ + "#T\377\25$W\377\26%Y\377\27'^\377\30)d\377\245\31*e\377\2\20\32@\377" \ + "\6\12\33\377\245\7\13\33\377\1\30(b\377\226\31*e\377\1\30(b\377\224\7" \ + "\13\33\377\231\31*e\377\203\30)d\377\2\30)e\377\31*e\377\202\32+f\377" \ + "\3\34,g\377\35.h\377\36/h\377\202\36.h\377\2\36-g\377\35-g\377\207\36" \ + ".h\377\202\35-g\377\3\34,g\377\33,f\377\32*e\377\203\30)d\377\1\30*e" \ + "\377\377\31*e\377\377\31*e\377\236\31*e\377\32\23\40M\377\22\36J\377" \ + "\20\33B\377\16\30;\377\15\25""3\377\13\22.\377\13\21,\377\11\21*\377" \ + "\12\20'\377\10\17%\377\10\16#\377\10\15!\377\7\13\37\377\7\12\33\377" \ + "\7\13\33\377\7\14\37\377\7\15!\377\11\16#\377\11\17$\377\11\17(\377\12" \ + "\21*\377\12\22,\377\13\22.\377\15\25""4\377\16\30<\377\25#V\377\240\31" \ + "*e\377\2\20\32\77\377\6\12\33\377\244\7\13\33\377\2\6\13\33\377\30(b" \ + "\377\226\31*e\377\1\30)d\377\224\7\13\33\377\1\30(b\377\225\31*e\377" \ + "\203\30)d\377\6\31*e\377\32+f\377\33,g\377\34,g\377\35-g\377\35.h\377" \ + "\203\36.h\377\1\36-g\377\204\36.h\377\1\35-g\377\204\36.h\377\5\34-g" \ + "\377\33+f\377\32+e\377\31*e\377\30*e\377\202\30)d\377\215\31*e\377\2" \ + "\27'^\377\22\36J\377\205\22\37L\377\1\23\37L\377\377\31*e\377\377\31" \ + "*e\377\215\31*e\377\2\6\12\35\377\7\13\34\377\202\7\12\33\377\3\6\12" \ + "\32\377\6\12\33\377\7\13\32\377\202\6\13\32\377\16\7\13\33\377\6\13\33" \ + "\377\6\13\32\377\7\13\33\377\7\12\33\377\6\12\32\377\7\13\33\377\6\12" \ + "\32\377\7\12\32\377\7\13\33\377\6\13\33\377\7\13\33\377\7\12\33\377\6" \ + "\13\32\377\202\7\13\33\377\2\11\21*\377\30)c\377\237\31*e\377\2\17\32" \ + "\77\377\6\13\33\377\244\7\13\33\377\2\6\12\32\377\30(b\377\226\31*e\377" \ + "\1\30)d\377\224\7\13\33\377\1\30(b\377\221\31*e\377\204\30)d\377\2\32" \ + "+e\377\33,f\377\202\35-h\377\2\35-g\377\35.h\377\203\36.h\377\1\35.h" \ + "\377\205\36.h\377\1\35-g\377\202\36.h\377\3\35-g\377\34,g\377\32+f\377" \ + "\202\31*e\377\1\31*d\377\203\30)d\377\217\31*e\377\2\24\"S\377\7\12\33" \ + "\377\205\7\13\34\377\1\7\14\36\377\377\31*e\377\320\31*e\377\2\20\33" \ + "B\377\7\13\32\377\216\7\13\35\377\2\7\14\35\377\6\13\35\377\207\7\13" \ + "\35\377\6\7\13\34\377\10\17&\377\16\27""8\377\20\33D\377\25#U\377\30" \ + ")d\377\235\31*e\377\1\6\12\33\377\231\7\13\33\377\1\21\34E\377\237\31" \ + "*e\377\2\20\32@\377\6\12\33\377\245\7\13\33\377\1\30(a\377\226\31*e\377" \ + "\1\30)d\377\223\7\13\33\377\2\6\12\32\377\26&\\\377\212\31*e\377\204" \ + "\30)d\377\203\31*e\377\4\32+f\377\33,f\377\34-g\377\36/h\377\202\36." \ + "h\377\2\36-g\377\35.g\377\211\36.h\377\203\35-g\377\3\33,f\377\32*e\377" \ + "\31)d\377\202\30)d\377\225\31*e\377\1\24\"R\377\206\7\13\33\377\1\7\13" \ + "\35\377\377\31*e\377\317\31*e\377\2\23\40M\377\7\13\32\377\217\7\13\33" \ + "\377\3\6\13\33\377\7\13\33\377\6\13\32\377\206\7\13\33\377\13\6\13\33" \ + "\377\7\13\33\377\6\12\32\377\7\13\33\377\6\12\33\377\7\13\33\377\7\14" \ + "!\377\14\24""2\377\17\31>\377\23!Q\377\26%[\377\230\31*e\377\1\6\12\33" \ + "\377\231\7\13\33\377\1\17\31>\377\237\31*e\377\2\20\32@\377\6\12\33\377" \ + "\245\7\13\33\377\1\26&\\\377\226\31*e\377\2\30)d\377\7\12\33\377\223" \ + "\7\13\33\377\2\23\40N\377\25$X\377\205\25$W\377\204\24#V\377\202\25$" \ + "W\377\4\26%W\377\26%X\377\27%X\377\30&X\377\203\31'Y\377\3\36.h\377\36" \ + "-g\377\35-g\377\204\36.h\377\1\35-g\377\204\36.h\377\5\35-g\377\34-g" \ + "\377\34,f\377\33+f\377\31*e\377\203\30)d\377\1\30*e\377\227\31*e\377" \ + "\1\24\"R\377\206\7\13\33\377\1\7\13\35\377\377\31*e\377\317\31*e\377" \ + "\1\21\34D\377\235\7\13\33\377\1\6\12\33\377\203\7\13\33\377\3\6\13\33" \ + "\377\7\13\33\377\6\13\32\377\203\30)d\377\225\31*e\377\1\6\12\33\377" \ + "\231\7\13\33\377\1\17\31>\377\237\31*e\377\2\20\32\77\377\6\12\33\377" \ + "\244\7\13\33\377\2\6\12\32\377\26%Z\377\226\31*e\377\3\30)d\377\7\13" \ + "\33\377\6\13\33\377\222\7\13\33\377\3\10\16\"\377\10\16#\377\11\15#\377" \ + "\204\11\15\"\377\1\11\15#\377\213\11\16#\377\1\12\17%\377\204\36.h\377" \ + "\1\35-g\377\203\36.h\377\6\36.g\377\35-g\377\33,f\377\32+e\377\32*e\377" \ + "\31*e\377\204\30)d\377\232\31*e\377\1\24\"R\377\206\7\13\33\377\1\6\12" \ + "\34\377\377\31*e\377\317\31*e\377\2\21\34E\377\6\12\33\377\242\7\13\33" \ + "\377\4\7\12\33\377\33,g\377\32+f\377\31*e\377\205\30)d\377\220\31*e\377" \ + "\1\6\12\33\377\231\7\13\33\377\1\17\31>\377\237\31*e\377\2\17\32\77\377" \ + "\6\13\33\377\244\7\13\33\377\2\6\12\33\377\26%Z\377\226\31*e\377\3\30" \ + ")d\377\6\13\35\377\6\13\32\377\221\7\13\33\377\2\7\12\33\377\6\13\33" \ + "\377\222\7\13\33\377\3\7\13\34\377\36.h\377\35-g\377\203\36.h\377\3\35" \ + "-g\377\33,g\377\32+e\377\203\31*e\377\204\30)d\377\235\31*e\377\1\24" \ + "\"R\377\206\7\13\33\377\3\6\12\34\377\21\34D\377\25$W\377\210\31*e\377" \ + "\4\17\32\77\377\16\27""9\377\17\31>\377\20\33C\377\212\20\33B\377\205" \ + "\22\37K\377\2\23\40N\377\24\"T\377\203\25#U\377\2\24\"T\377\25$X\377" \ + "\205\27'^\377\1\30)c\377\377\31*e\377\245\31*e\377\2\21\34E\377\6\13" \ + "\33\377\243\7\13\33\377\203\36.h\377\202\35.h\377\2\33,f\377\32+f\377" \ + "\205\31*e\377\205\30)d\377\207\31*e\377\1\6\12\33\377\231\7\13\33\377" \ + "\1\17\32>\377\237\31*e\377\1\16\30;\377\245\7\13\33\377\2\7\13\32\377" \ + "\26%Z\377\226\31*e\377\2\30)d\377\6\14\35\377\246\7\13\33\377\1\7\13" \ + "\34\377\202\35-g\377\3\33,f\377\32+e\377\31*e\377\203\30)d\377\244\31" \ + "*e\377\1\24\"R\377\206\7\13\33\377\3\6\12\33\377\7\14\36\377\24\"R\377" \ + "\206\31*e\377\2\30(a\377\15\25""5\377\202\7\13\33\377\1\6\13\32\377\212" \ + "\7\13\33\377\3\6\12\33\377\7\13\33\377\6\13\33\377\202\7\13\33\377\3" \ + "\7\12\32\377\7\12\33\377\6\13\32\377\212\7\13\33\377\2\11\17$\377\27" \ + "'^\377\377\31*e\377\244\31*e\377\2\21\34E\377\6\12\33\377\243\7\13\33" \ + "\377\202\36.h\377\2\35-g\377\36-g\377\204\36.h\377\6\35.h\377\34-g\377" \ + "\34,f\377\33,g\377\32+e\377\32+f\377\203\31*e\377\206\30)d\377\2\31*" \ + "e\377\6\12\33\377\231\7\13\33\377\1\17\32>\377\203\31*e\377\203\30)d" \ + "\377\1\30(b\377\203\27(`\377\1\27'^\377\203\26&\\\377\1\26%Y\377\203" \ + "\25$W\377\1\25$X\377\203\25$W\377\3\25#U\377\24\"R\377\30(a\377\203\31" \ + "*e\377\1\26%Z\377\202\25$W\377\2\14\26""5\377\6\12\32\377\245\7\13\33" \ + "\377\1\25#U\377\226\31*e\377\2\30)d\377\7\15!\377\246\7\13\33\377\2\7" \ + "\13\34\377\31*e\377\204\30)d\377\247\31*e\377\1\24\"R\377\207\7\13\33" \ + "\377\2\11\17&\377\27'_\377\205\31*e\377\3\30(b\377\14\26""5\377\6\13" \ + "\32\377\236\7\13\33\377\3\7\13\32\377\11\20&\377\27'^\377\377\31*e\377" \ + "\244\31*e\377\2\21\34E\377\6\12\33\377\243\7\13\33\377\206\36.h\377\2" \ + "\36-g\377\35-g\377\205\36.h\377\11\35.h\377\35-g\377\30%V\377\24\40K" \ + "\377\23\37I\377\25\"Q\377\30'^\377\31+f\377\31*e\377\202\30)d\377\1\6" \ + "\12\33\377\231\7\13\33\377\1\17\31>\377\202\31*e\377\2\17\31\77\377\13" \ + "\21,\377\202\12\22-\377\14\13\22,\377\12\21)\377\12\20*\377\12\20)\377" \ + "\11\20(\377\12\20'\377\12\20&\377\11\17'\377\11\17%\377\10\16#\377\11" \ + "\17$\377\10\17#\377\203\11\17$\377\4\10\16$\377\10\15#\377\7\13\35\377" \ + "\25$W\377\203\31*e\377\4\14\23""1\377\11\17$\377\11\17#\377\7\13\37\377" \ + "\246\7\13\33\377\1\24\"R\377\224\31*e\377\202\30)d\377\2\27(c\377\11" \ + "\16%\377\246\7\13\33\377\1\7\13\34\377\202\30)d\377\252\31*e\377\1\24" \ + "\"R\377\207\7\13\33\377\1\13\24""2\377\205\31*e\377\4\30(a\377\13\22" \ + "-\377\7\13\33\377\6\13\32\377\236\7\13\33\377\3\7\13\32\377\11\17#\377" \ + "\27&]\377\377\31*e\377\244\31*e\377\2\21\34E\377\6\12\33\377\243\7\13" \ + "\33\377\203\36.h\377\1\36-g\377\207\36.h\377\5\26!M\377\17\30:\377\11" \ + "\20%\377\10\14\36\377\7\13\35\377\202\7\12\33\377\7\7\13\35\377\6\13" \ + "\35\377\7\14\37\377\12\17&\377\17\30""8\377\23\37H\377\7\12\33\377\231" \ + "\7\13\33\377\1\17\31>\377\202\31*e\377\2\13\22-\377\6\12\32\377\202\7" \ + "\13\33\377\6\6\12\32\377\6\12\33\377\7\13\33\377\6\13\33\377\7\12\32" \ + "\377\6\13\33\377\202\7\13\33\377\5\6\13\32\377\6\12\33\377\7\13\33\377" \ + "\6\12\33\377\6\13\33\377\202\7\13\33\377\4\7\12\33\377\7\13\33\377\6" \ + "\12\32\377\25#U\377\203\31*e\377\3\12\20)\377\7\12\33\377\7\13\32\377" \ + "\246\7\13\33\377\2\6\13\33\377\24!R\377\216\31*e\377\206\30)d\377\203" \ + "\31*e\377\1\10\16$\377\246\7\13\33\377\1\7\13\34\377\254\31*e\377\1\24" \ + "!R\377\206\7\13\33\377\2\6\13\32\377\21\35G\377\204\31*e\377\5\27&]\377" \ + "\12\20(\377\6\13\33\377\6\12\32\377\6\13\32\377\236\7\13\33\377\3\6\13" \ + "\33\377\7\15!\377\27&]\377\377\31*e\377\244\31*e\377\2\21\34E\377\6\13" \ + "\33\377\243\7\13\33\377\3\31*e\377\33,f\377\34-g\377\204\35-g\377\204" \ + "\36.h\377\1\12\21*\377\210\7\13\33\377\1\7\13\32\377\203\7\13\33\377" \ + "\1\6\13\32\377\231\7\13\33\377\5\16\31>\377\30)d\377\31*e\377\13\23." \ + "\377\6\12\32\377\224\7\13\33\377\1\25#U\377\203\31*e\377\1\11\20)\377" \ + "\251\7\13\33\377\1\23!P\377\206\30)d\377\210\31*e\377\12\32+f\377\33" \ + "+f\377\34,g\377\34-h\377\35.h\377\36.h\377\36/i\377\36.h\377\35-g\377" \ + "\14\22,\377\246\7\13\33\377\1\7\13\34\377\254\31*e\377\2\26%[\377\11" \ + "\17&\377\205\7\13\33\377\2\6\13\34\377\26&\\\377\203\31*e\377\4\27(`" \ + "\377\13\23.\377\7\13\33\377\6\13\33\377\241\7\13\33\377\2\7\15\40\377" \ + "\26&]\377\377\31*e\377\244\31*e\377\2\21\34E\377\6\12\33\377\243\7\13" \ + "\33\377\204\30)d\377\4\31*e\377\32+e\377\33+f\377\34,f\377\202\34-g\377" \ + "\2\35-g\377\13\22,\377\246\7\13\33\377\5\17\32>\377\31*e\377\30)d\377" \ + "\13\22.\377\6\12\32\377\224\7\13\33\377\1\25#U\377\203\31*e\377\1\11" \ + "\20)\377\251\7\13\33\377\1\22\36K\377\202\31*e\377\204\32+f\377\6\33" \ + ",g\377\33,f\377\34,g\377\34-g\377\35-h\377\35.h\377\206\36.h\377\2\36" \ + "-h\377\35-g\377\202\36-g\377\2\35-g\377\13\22-\377\246\7\13\33\377\1" \ + "\7\13\34\377\255\31*e\377\2\17\31>\377\6\12\32\377\203\7\13\33\377\2" \ + "\6\12\32\377\10\15\40\377\204\31*e\377\3\26%Y\377\10\16\"\377\6\12\32" \ + "\377\241\7\13\33\377\3\6\13\32\377\6\13\34\377\26&[\377\377\31*e\377" \ + "\244\31*e\377\2\21\34E\377\6\12\33\377\243\7\13\33\377\204\31*e\377\204" \ + "\30)d\377\203\31*e\377\1\12\22+\377\246\7\13\33\377\5\20\33\77\377\34" \ + "-h\377\34-g\377\13\20)\377\7\12\33\377\224\7\13\33\377\1\24\"T\377\203" \ + "\30)d\377\2\11\20)\377\7\12\33\377\250\7\13\33\377\1\25\40K\377\202\35" \ + "-g\377\2\35-h\377\35.h\377\206\36.h\377\4\36.g\377\36-h\377\36.h\377" \ + "\35-g\377\202\36-g\377\206\36.h\377\3\35-g\377\15\24/\377\6\12\33\377" \ + "\245\7\13\33\377\1\7\13\34\377\255\31*e\377\2\23!P\377\10\14\37\377\203" \ + "\7\13\33\377\2\6\13\33\377\7\14\37\377\204\31*e\377\2\25#V\377\7\14\36" \ + "\377\242\7\13\33\377\3\7\12\32\377\6\13\33\377\26&\\\377\377\31*e\377" \ + "\244\31*e\377\2\21\34E\377\6\12\33\377\243\7\13\33\377\210\31*e\377\203" \ + "\30)d\377\1\12\21+\377\246\7\13\33\377\1\21\33\77\377\202\36.h\377\2" \ + "\11\17%\377\6\13\32\377\223\7\13\33\377\3\7\12\32\377\27%W\377\34,g\377" \ + "\202\33,g\377\2\13\21*\377\7\12\33\377\247\7\13\33\377\2\6\13\33\377" \ + "\25!L\377\202\36.h\377\4\36.g\377\36-h\377\36.h\377\35-g\377\202\36-" \ + "g\377\212\36.h\377\2\35.h\377\36-g\377\202\36.h\377\3\35-g\377\17\27" \ + "5\377\6\12\32\377\245\7\13\33\377\1\7\13\34\377\255\31*e\377\2\27'_\377" \ + "\11\16#\377\204\7\13\33\377\1\7\13\35\377\204\31*e\377\3\24\"S\377\6" \ + "\13\32\377\6\12\32\377\241\7\13\33\377\3\7\12\32\377\7\13\33\377\26%" \ + "Z\377\377\31*e\377\244\31*e\377\2\21\34E\377\6\13\33\377\243\7\13\33" \ + "\377\213\31*e\377\1\12\22+\377\246\7\13\33\377\1\21\34@\377\202\36.h" \ + "\377\2\12\17&\377\6\13\32\377\224\7\13\33\377\1\31%W\377\202\36.h\377" \ + "\2\35,e\377\12\21(\377\251\7\13\33\377\1\25!L\377\204\36.h\377\2\35." \ + "h\377\36-h\377\207\36.h\377\1\35-h\377\206\35-g\377\5\34,g\377\33,f\377" \ + "\32*e\377\15\26""5\377\7\13\32\377\245\7\13\33\377\1\7\13\34\377\256" \ + "\31*e\377\1\12\20(\377\204\7\13\33\377\2\7\12\33\377\30(a\377\203\31" \ + "*e\377\1\24!Q\377\245\7\13\33\377\1\26%Z\377\377\31*e\377\244\31*e\377" \ + "\2\21\34E\377\6\12\33\377\243\7\13\33\377\213\31*e\377\1\12\22+\377\246" \ + "\7\13\33\377\5\21\34@\377\36.h\377\36-h\377\12\17&\377\6\12\33\377\223" \ + "\7\13\33\377\5\7\12\33\377\31'Y\377\36.h\377\30%V\377\13\23,\377\252" \ + "\7\13\33\377\1\25!L\377\205\36.h\377\2\35.h\377\35-h\377\203\35-g\377" \ + "\202\34,g\377\1\34,f\377\202\33+f\377\2\32+f\377\32+e\377\202\31*e\377" \ + "\203\30)d\377\3\27(c\377\15\25""4\377\7\13\32\377\245\7\13\33\377\1\7" \ + "\13\34\377\256\31*e\377\1\16\27""9\377\204\7\13\33\377\2\6\13\34\377" \ + "\26%Y\377\203\31*e\377\2\21\36I\377\7\12\33\377\243\7\13\33\377\2\7\12" \ + "\32\377\26%Z\377\377\31*e\377\244\31*e\377\2\21\34E\377\6\12\33\377\243" \ + "\7\13\33\377\213\31*e\377\1\12\22+\377\246\7\13\33\377\5\21\33\77\377" \ + "\35-h\377\35.h\377\10\16!\377\7\12\33\377\223\7\13\33\377\5\7\13\32\377" \ + "\22\34A\377\20\31""9\377\11\16\"\377\7\12\33\377\252\7\13\33\377\1\24" \ + "\40K\377\202\34,f\377\2\33,f\377\33+f\377\202\32+f\377\1\32*e\377\205" \ + "\31*e\377\207\30)d\377\203\31*e\377\3\30)d\377\15\25""5\377\7\13\32\377" \ + "\245\7\13\33\377\1\7\13\34\377\256\31*e\377\2\21\35F\377\6\12\33\377" \ + "\203\7\13\33\377\2\6\13\34\377\24\"R\377\202\31*e\377\2\30)d\377\17\32" \ + "@\377\244\7\13\33\377\2\7\12\33\377\26%Z\377\377\31*e\377\244\31*e\377" \ + "\2\21\34E\377\6\12\33\377\243\7\13\33\377\213\31*e\377\1\12\21+\377\246" \ + "\7\13\33\377\1\17\31>\377\202\31*e\377\2\6\13\34\377\7\12\33\377\223" \ + "\7\13\33\377\5\6\12\32\377\6\13\34\377\6\13\33\377\7\13\33\377\6\13\33" \ + "\377\251\7\13\33\377\2\7\12\32\377\20\33B\377\204\31*e\377\210\30)d\377" \ + "\212\31*e\377\2\30)d\377\14\25""4\377\246\7\13\33\377\1\7\13\34\377\256" \ + "\31*e\377\1\24\"R\377\204\7\13\33\377\2\7\13\34\377\22\37L\377\202\31" \ + "*e\377\3\30)d\377\16\27""8\377\6\13\32\377\243\7\13\33\377\2\6\12\32" \ + "\377\26%Z\377\377\31*e\377\244\31*e\377\2\21\34E\377\6\13\33\377\243" \ + "\7\13\33\377\213\31*e\377\1\13\22,\377\246\7\13\33\377\1\17\32>\377\202" \ + "\31*e\377\1\7\14\35\377\303\7\13\33\377\1\20\33B\377\227\31*e\377\1\17" \ + "\31=\377\246\7\13\33\377\1\7\13\34\377\256\31*e\377\3\27'`\377\7\13\32" \ + "\377\6\13\32\377\202\7\13\33\377\2\7\13\34\377\22\37K\377\202\31*e\377" \ + "\2\30)d\377\14\25""3\377\245\7\13\33\377\1\25#T\377\377\31*e\377\244" \ + "\31*e\377\2\21\34E\377\6\12\33\377\243\7\13\33\377\205\31*e\377\7\30" \ + ")c\377\27'^\377\26%Z\377\25$W\377\24\"R\377\23!P\377\11\16%\377\246\7" \ + "\13\33\377\1\17\32>\377\202\31*e\377\1\7\13\35\377\303\7\13\33\377\1" \ + "\20\32@\377\227\31*e\377\1\17\31<\377\246\7\13\33\377\1\7\13\34\377\234" \ + "\31*e\377\1\25$X\377\221\26%Y\377\1\27'^\377\205\7\13\33\377\1\20\33" \ + "A\377\202\31*e\377\2\30)d\377\15\25""4\377\244\7\13\33\377\3\7\12\32" \ + "\377\22\36I\377\26%[\377\377\31*e\377\243\31*e\377\2\21\34E\377\6\12" \ + "\33\377\243\7\13\33\377\14\24!P\377\22\36I\377\20\32@\377\15\26""7\377" \ + "\15\25""4\377\13\23""0\377\12\21*\377\12\20'\377\11\16$\377\7\13\37\377" \ + "\7\13\33\377\6\12\33\377\246\7\13\33\377\1\17\31>\377\202\31*e\377\1" \ + "\6\12\33\377\302\7\13\33\377\2\7\13\32\377\16\30:\377\227\31*e\377\2" \ + "\20\32@\377\6\12\32\377\245\7\13\33\377\1\7\13\34\377\233\31*e\377\2" \ + "\30)c\377\10\15!\377\221\11\17&\377\2\11\20'\377\6\12\33\377\204\7\13" \ + "\33\377\1\16\30""9\377\202\31*e\377\3\30)d\377\13\23/\377\6\12\33\377" \ + "\244\7\13\33\377\4\11\16#\377\11\17'\377\16\30:\377\27'`\377\377\31*" \ + "e\377\241\31*e\377\2\21\34E\377\6\12\33\377\243\7\13\33\377\11\7\13\36" \ + "\377\7\13\35\377\7\13\34\377\7\13\32\377\6\13\33\377\6\13\32\377\7\12" \ + "\33\377\7\13\33\377\7\12\32\377\202\7\13\33\377\1\7\12\33\377\246\7\13" \ + "\33\377\1\17\31>\377\202\31*e\377\2\6\13\32\377\7\12\33\377\301\7\13" \ + "\33\377\2\6\12\32\377\16\30:\377\227\31*e\377\1\21\34D\377\246\7\13\33" \ + "\377\1\7\13\34\377\233\31*e\377\2\30)c\377\7\13\33\377\221\6\13\33\377" \ + "\202\7\13\33\377\1\6\13\33\377\202\7\13\33\377\2\7\13\32\377\14\24""3" \ + "\377\202\31*e\377\2\30)c\377\13\21,\377\244\7\13\33\377\1\6\12\33\377" \ + "\202\7\13\33\377\3\7\13\32\377\11\17&\377\26%Y\377\377\31*e\377\240\31" \ + "*e\377\2\21\34E\377\6\13\33\377\325\7\13\33\377\1\17\32>\377\202\31*" \ + "e\377\304\7\13\33\377\1\13\24""2\377\227\31*e\377\1\20\34D\377\246\7" \ + "\13\33\377\1\7\13\34\377\233\31*e\377\1\30)c\377\227\7\13\33\377\2\6" \ + "\13\32\377\12\22,\377\202\31*e\377\2\30)c\377\10\17%\377\252\7\13\33" \ + "\377\4\24!Q\377\30)c\377\30)b\377\30(b\377\377\31*e\377\234\31*e\377" \ + "\2\21\34E\377\6\12\33\377\325\7\13\33\377\1\17\32>\377\202\31*e\377\304" \ + "\7\13\33\377\1\14\24""2\377\227\31*e\377\2\22\37J\377\6\13\32\377\245" \ + "\7\13\33\377\4\7\13\34\377\26%[\377\26&\\\377\30(b\377\230\31*e\377\1" \ + "\26&[\377\230\7\13\33\377\1\13\22,\377\202\31*e\377\2\30)c\377\11\17" \ + "$\377\253\7\13\33\377\3\13\22/\377\14\24""1\377\13\23.\377\377\31*e\377" \ + "\234\31*e\377\2\21\34E\377\6\12\33\377\325\7\13\33\377\1\17\31>\377\202" \ + "\31*e\377\1\7\13\32\377\302\7\13\33\377\2\7\13\32\377\13\22-\377\227" \ + "\31*e\377\2\23\37L\377\7\12\32\377\245\7\13\33\377\7\6\13\32\377\10\15" \ + "#\377\12\20(\377\13\22.\377\15\26""7\377\21\34E\377\26%Z\377\223\31*" \ + "e\377\3\30)b\377\20\33B\377\12\20)\377\230\7\13\33\377\6\12\21)\377\30" \ + "(b\377\31*e\377\30)c\377\10\14\37\377\7\13\32\377\250\7\13\33\377\3\6" \ + "\12\33\377\7\13\33\377\6\12\32\377\202\7\13\33\377\377\31*e\377\234\31" \ + "*e\377\2\21\34E\377\6\12\33\377\325\7\13\33\377\1\17\31>\377\202\31*" \ + "e\377\303\7\13\33\377\2\6\12\33\377\12\21*\377\227\31*e\377\1\23\40O" \ + "\377\247\7\13\33\377\1\7\13\32\377\203\7\13\33\377\4\7\13\35\377\10\13" \ + "\37\377\13\22,\377\26%Z\377\206\31*e\377\205\27(`\377\3\27'`\377\27'" \ + "_\377\25$X\377\202\25$W\377\2\22\36J\377\10\16$\377\231\7\13\33\377\7" \ + "\6\13\32\377\11\20&\377\27&]\377\31*e\377\30)c\377\7\13\35\377\6\12\32" \ + "\377\255\7\13\33\377\377\31*e\377\234\31*e\377\2\21\34E\377\6\13\33\377" \ + "\325\7\13\33\377\1\17\32>\377\202\31*e\377\304\7\13\33\377\1\12\20*\377" \ + "\227\31*e\377\1\24#T\377\255\7\13\33\377\3\6\13\33\377\7\13\33\377\21" \ + "\35F\377\204\31*e\377\1\16\30<\377\205\6\13\32\377\206\7\13\33\377\1" \ + "\7\12\33\377\231\7\13\33\377\6\6\13\33\377\10\16$\377\26%Y\377\31*e\377" \ + "\30)c\377\7\12\34\377\256\7\13\33\377\1\31*e\377\204\30)b\377\202\30" \ + ")c\377\1\30)d\377\377\31*e\377\224\31*e\377\2\21\34E\377\6\12\33\377" \ + "\325\7\13\33\377\3\17\32>\377\31*e\377\30)c\377\304\7\13\33\377\1\12" \ + "\20*\377\227\31*e\377\1\24\"T\377\257\7\13\33\377\2\10\16\"\377\26%Y" \ + "\377\202\31*e\377\2\30(a\377\14\24""0\377\246\7\13\33\377\5\11\15#\377" \ + "\25$V\377\31*e\377\30)c\377\6\13\32\377\256\7\13\33\377\205\14\24""1" \ + "\377\7\14\25""3\377\16\27""8\377\20\33A\377\22\37K\377\23!Q\377\25$W" \ + "\377\27&\\\377\377\31*e\377\220\31*e\377\2\21\34E\377\6\13\33\377\325" \ + "\7\13\33\377\3\17\31>\377\31*e\377\27&]\377\303\7\13\33\377\2\7\12\33" \ + "\377\11\21)\377\227\31*e\377\1\24\"T\377\256\7\13\33\377\3\7\13\32\377" \ + "\10\13\37\377\23\40N\377\202\31*e\377\3\26%Z\377\10\16#\377\6\12\32\377" \ + "\244\7\13\33\377\6\7\12\33\377\10\15!\377\24\"S\377\31*e\377\30)c\377" \ + "\6\12\32\377\266\7\13\33\377\5\6\12\32\377\7\13\32\377\10\16\"\377\12" \ + "\20'\377\27'^\377\366\31*e\377\1\23\40O\377\227\31*e\377\1\22\37L\377" \ + "\326\7\13\33\377\3\17\31>\377\31*e\377\26&\\\377\303\7\13\33\377\2\7" \ + "\12\32\377\12\20(\377\227\31*e\377\1\24\"T\377\202\7\12\32\377\254\7" \ + "\13\33\377\3\7\13\32\377\6\12\32\377\21\33D\377\202\31*e\377\1\24\"S" \ + "\377\202\6\12\32\377\245\7\13\33\377\5\7\14\36\377\23\40N\377\31*e\377" \ + "\30)c\377\6\12\33\377\271\7\13\33\377\2\6\12\33\377\12\22-\377\365\31" \ + "*e\377\2\27'^\377\10\15\37\377\227\31*e\377\2\23\40N\377\7\13\32\377" \ + "\325\7\13\33\377\4\17\32>\377\31*e\377\26&\\\377\6\12\33\377\303\7\13" \ + "\33\377\2\12\20(\377\30)d\377\226\31*e\377\1\25#V\377\260\7\13\33\377" \ + "\5\15\27""7\377\30)b\377\30)d\377\17\32\77\377\6\12\32\377\245\7\13\33" \ + "\377\6\7\12\33\377\7\13\34\377\22\36I\377\31*e\377\30)c\377\6\12\32\377" \ + "\273\7\13\33\377\1\22\36H\377\212\31*e\377\25\30)d\377\30)c\377\30(b" \ + "\377\30(a\377\27'`\377\25\"T\377\22\36J\377\17\32>\377\17\31=\377\15" \ + "\26""5\377\12\22-\377\10\16\"\377\12\20'\377\13\23/\377\16\30:\377\17" \ + "\31=\377\21\34D\377\23\40M\377\25#V\377\27(`\377\30(a\377\202\30(b\377" \ + "\1\30)b\377\202\30)c\377\317\31*e\377\3\30)b\377\14\24""2\377\6\12\33" \ + "\377\227\31*e\377\1\23\40N\377\326\7\13\33\377\3\17\32>\377\31*e\377" \ + "\26%Y\377\303\7\13\33\377\3\6\13\33\377\11\17&\377\27(`\377\226\31*e" \ + "\377\3\25$V\377\7\13\33\377\6\12\33\377\255\7\13\33\377\5\7\13\32\377" \ + "\12\21*\377\27'_\377\30)d\377\12\21+\377\247\7\13\33\377\5\6\12\33\377" \ + "\21\35F\377\31*e\377\30)c\377\6\12\32\377\272\7\13\33\377\3\7\12\32\377" \ + "\12\20(\377\30(a\377\210\31*e\377\10\27'`\377\20\32@\377\13\23""0\377" \ + "\11\16#\377\7\13\33\377\6\13\33\377\7\13\33\377\6\13\32\377\203\7\13" \ + "\33\377\3\6\13\33\377\7\13\33\377\7\12\33\377\206\7\13\33\377\7\6\13" \ + "\32\377\7\13\33\377\7\13\35\377\11\17$\377\12\21+\377\14\24""2\377\20" \ + "\33A\377\317\31*e\377\1\23\40N\377\202\7\13\33\377\227\31*e\377\1\23" \ + "\40N\377\326\7\13\33\377\3\17\31>\377\31*e\377\24\"S\377\304\7\13\33" \ + "\377\2\11\17%\377\27'_\377\226\31*e\377\3\25$X\377\7\14\35\377\6\12\32" \ + "\377\256\7\13\33\377\4\7\14\35\377\26%Z\377\30)d\377\7\13\32\377\250" \ + "\7\13\33\377\4\20\34D\377\31*e\377\30)c\377\6\12\32\377\272\7\13\33\377" \ + "\3\6\13\32\377\10\16#\377\25$X\377\210\31*e\377\4\20\34C\377\7\12\33" \ + "\377\7\13\33\377\7\13\32\377\220\7\13\33\377\1\6\13\33\377\202\7\12\33" \ + "\377\203\7\13\33\377\1\13\23/\377\316\31*e\377\4\30)d\377\21\35F\377" \ + "\6\12\32\377\7\13\33\377\227\31*e\377\2\23\40N\377\7\13\32\377\325\7" \ + "\13\33\377\4\17\31>\377\31*e\377\24\"S\377\6\12\33\377\302\7\13\33\377" \ + "\3\6\12\32\377\11\17%\377\26&\\\377\226\31*e\377\3\26%Y\377\10\15\40" \ + "\377\6\13\32\377\255\7\13\33\377\5\6\13\33\377\6\12\32\377\25$X\377\27" \ + "'^\377\6\12\33\377\250\7\13\33\377\4\17\32\77\377\31*e\377\30)c\377\6" \ + "\12\33\377\272\7\13\33\377\3\6\12\32\377\10\16\"\377\25#U\377\210\31" \ + "*e\377\2\17\31>\377\7\12\33\377\230\7\13\33\377\1\13\23""0\377\316\31" \ + "*e\377\4\30)d\377\21\34F\377\7\12\32\377\7\13\33\377\227\31*e\377\2\23" \ + "\40N\377\6\12\32\377\325\7\13\33\377\3\17\32>\377\31*e\377\24\"S\377" \ + "\304\7\13\33\377\2\10\16#\377\26%Z\377\226\31*e\377\2\26%Z\377\10\16" \ + "#\377\256\7\13\33\377\2\6\13\33\377\7\12\32\377\202\26%Z\377\251\7\13" \ + "\33\377\1\16\27""8\377\202\30)c\377\1\6\12\32\377\272\7\13\33\377\3\6" \ + "\12\32\377\10\14\36\377\23!P\377\210\31*e\377\2\17\31>\377\7\13\32\377" \ + "\230\7\13\33\377\1\13\23""0\377\225\31*e\377\205\30)c\377\204\30)d\377" \ + "\260\31*e\377\4\30)d\377\21\35F\377\7\13\33\377\6\12\32\377\227\31*e" \ + "\377\1\23\40N\377\326\7\13\33\377\3\17\32>\377\31*e\377\23\40O\377\304" \ + "\7\13\33\377\2\10\16\"\377\25$X\377\226\31*e\377\2\26&[\377\11\17$\377" \ + "\257\7\13\33\377\3\7\14\36\377\26%[\377\26%Z\377\250\7\13\33\377\5\6" \ + "\12\32\377\14\23/\377\30(a\377\30)c\377\6\12\32\377\272\7\13\33\377\3" \ + "\6\13\33\377\7\13\33\377\22\36J\377\210\31*e\377\2\17\31>\377\7\13\32" \ + "\377\230\7\13\33\377\1\13\23""0\377\225\31*e\377\13\14\24""2\377\13\22" \ + ",\377\15\25""3\377\14\24""3\377\14\25""3\377\16\30""9\377\17\30<\377" \ + "\17\33A\377\21\35E\377\22\36J\377\26&]\377\256\31*e\377\4\30)d\377\21" \ + "\34E\377\6\12\33\377\6\13\32\377\227\31*e\377\1\23\40N\377\326\7\13\33" \ + "\377\3\17\31>\377\31*e\377\22\36I\377\304\7\13\33\377\3\7\12\33\377\14" \ + "\23""0\377\25#U\377\225\31*e\377\3\26&\\\377\12\20'\377\7\12\32\377\256" \ + "\7\13\33\377\3\11\16$\377\27&]\377\26%Z\377\252\7\13\33\377\3\21\34E" \ + "\377\30)d\377\7\12\33\377\274\7\13\33\377\1\21\35F\377\210\31*e\377\1" \ + "\17\32>\377\231\7\13\33\377\1\13\23""0\377\225\31*e\377\5\10\15\"\377" \ + "\7\13\33\377\6\13\33\377\6\12\33\377\6\13\32\377\205\7\13\33\377\1\22" \ + "\37L\377\256\31*e\377\5\30)d\377\20\32@\377\6\12\32\377\7\13\33\377\27" \ + "'^\377\226\31*e\377\2\23\40N\377\7\13\32\377\325\7\13\33\377\4\17\31" \ + ">\377\31*e\377\21\36I\377\6\13\33\377\302\7\13\33\377\1\6\13\32\377\202" \ + "\7\13\33\377\3\7\14\37\377\16\27""8\377\30)b\377\223\31*e\377\3\27&]" \ + "\377\11\20)\377\6\13\32\377\256\7\13\33\377\4\13\22+\377\27'_\377\26" \ + "%Z\377\6\13\32\377\247\7\13\33\377\203\6\13\32\377\2\27&]\377\7\12\33" \ + "\377\273\7\13\33\377\2\6\12\32\377\20\33A\377\210\31*e\377\1\16\30;\377" \ + "\231\7\13\33\377\1\13\23""0\377\225\31*e\377\1\11\16#\377\210\7\13\33" \ + "\377\2\6\13\35\377\23\37M\377\256\31*e\377\5\30)d\377\17\31>\377\6\12" \ + "\32\377\7\13\33\377\27'_\377\226\31*e\377\2\23\40N\377\6\12\32\377\325" \ + "\7\13\33\377\3\17\32>\377\31*e\377\22\36I\377\306\7\13\33\377\5\7\13" \ + "\32\377\7\13\33\377\10\15!\377\23\40N\377\30)d\377\221\31*e\377\2\27" \ + "']\377\12\21*\377\257\7\13\33\377\3\12\21+\377\27'`\377\26%Z\377\247" \ + "\7\13\33\377\1\6\12\33\377\202\7\13\33\377\2\15\26""4\377\30)d\377\275" \ + "\7\13\33\377\2\16\30:\377\30)c\377\207\31*e\377\1\15\26""5\377\231\7" \ + "\13\33\377\1\14\23""0\377\205\31*e\377\204\30)d\377\214\31*e\377\1\11" \ + "\16#\377\210\7\13\33\377\2\7\13\34\377\23\37M\377\203\31*e\377\245\30" \ + ")d\377\206\31*e\377\2\30)c\377\15\27""7\377\202\7\13\33\377\1\25%X\377" \ + "\226\31*e\377\1\23\40N\377\326\7\13\33\377\3\17\32>\377\31*e\377\21\34" \ + "D\377\311\7\13\33\377\2\6\13\32\377\25#V\377\221\31*e\377\2\27']\377" \ + "\12\20*\377\257\7\13\33\377\3\13\24""0\377\30(a\377\26%Z\377\247\7\13" \ + "\33\377\6\6\13\33\377\7\13\33\377\11\17%\377\27'_\377\30)c\377\6\12\32" \ + "\377\274\7\13\33\377\2\14\24""2\377\30(a\377\207\31*e\377\2\15\26""5" \ + "\377\7\12\33\377\227\7\13\33\377\16\7\13\32\377\12\22.\377\27(`\377\26" \ + "%Y\377\25#V\377\24\"R\377\23\37L\377\20\32A\377\15\26""5\377\14\23""0" \ + "\377\14\25""3\377\23\40N\377\26&\\\377\30)d\377\211\31*e\377\1\11\16" \ + "$\377\210\7\13\33\377\7\7\13\35\377\23\40N\377\31*e\377\27&\\\377\23" \ + "!Q\377\16\27""8\377\14\24""3\377\243\15\25""3\377\1\23\40N\377\205\31" \ + "*e\377\5\30)b\377\14\25""3\377\7\13\33\377\7\12\33\377\25#U\377\226\31" \ + "*e\377\1\23\40N\377\326\7\13\33\377\4\17\31>\377\31*e\377\20\32\77\377" \ + "\7\12\33\377\307\7\13\33\377\3\6\12\32\377\7\12\32\377\26$X\377\221\31" \ + "*e\377\3\30(a\377\12\22,\377\7\12\32\377\256\7\13\33\377\3\15\26""7\377" \ + "\30)c\377\26%Z\377\247\7\13\33\377\6\7\13\32\377\7\14\37\377\23\40M\377" \ + "\31*e\377\30)c\377\6\12\32\377\274\7\13\33\377\2\13\22-\377\27'`\377" \ + "\207\31*e\377\2\15\26""5\377\7\12\33\377\230\7\13\33\377\5\10\14\37\377" \ + "\12\20*\377\11\16$\377\7\13\35\377\6\12\32\377\206\7\13\33\377\3\11\17" \ + "&\377\15\26""8\377\26$X\377\210\31*e\377\1\11\16#\377\210\7\13\33\377" \ + "\5\7\13\35\377\24\"S\377\31*e\377\13\22.\377\6\12\32\377\202\7\12\32" \ + "\377\242\7\13\33\377\3\6\13\32\377\7\14\37\377\25$X\377\204\31*e\377" \ + "\5\30)b\377\14\24""1\377\6\12\33\377\7\13\33\377\24!Q\377\226\31*e\377" \ + "\2\23\40M\377\7\13\32\377\325\7\13\33\377\4\17\31>\377\31*e\377\20\32" \ + "\77\377\7\12\33\377\311\7\13\33\377\1\17\31\77\377\211\22\36H\377\2\21" \ + "\35G\377\25$X\377\202\31*e\377\1\21\35F\377\202\22\36H\377\4\21\35H\377" \ + "\22\36I\377\14\24""1\377\6\12\33\377\256\7\13\33\377\4\16\30<\377\31" \ + "*e\377\26%Z\377\6\13\32\377\247\7\13\33\377\1\13\22,\377\202\31*e\377" \ + "\2\30)c\377\6\12\33\377\273\7\13\33\377\3\7\12\33\377\12\20&\377\27'" \ + "_\377\207\31*e\377\2\15\26""5\377\6\12\32\377\233\7\13\33\377\3\7\12" \ + "\33\377\7\13\33\377\6\13\33\377\205\7\13\33\377\3\6\12\33\377\6\13\33" \ + "\377\21\35G\377\206\31*e\377\2\30)d\377\16\27:\377\211\7\13\33\377\4" \ + "\7\14\34\377\26%Z\377\31*e\377\10\15#\377\245\7\13\33\377\202\6\12\32" \ + "\377\1\11\17&\377\204\31*e\377\5\30(b\377\12\21+\377\7\13\33\377\7\12" \ + "\32\377\22\37M\377\226\31*e\377\2\24#T\377\6\12\32\377\325\7\13\33\377" \ + "\3\17\32>\377\31*e\377\20\32\77\377\325\7\13\33\377\3\15\25""4\377\30" \ + ")b\377\26%[\377\204\7\13\33\377\2\10\16\"\377\12\22,\377\256\7\13\33" \ + "\377\4\7\12\33\377\20\33C\377\31*e\377\26%Z\377\247\7\13\33\377\2\6\13" \ + "\32\377\13\22-\377\202\31*e\377\2\30)c\377\6\12\32\377\273\7\13\33\377" \ + "\3\6\13\32\377\10\14\37\377\27&]\377\207\31*e\377\2\15\26""5\377\7\12" \ + "\33\377\245\7\13\33\377\1\21\35G\377\205\31*e\377\2\30)c\377\16\26""8" \ + "\377\202\6\12\32\377\210\7\13\33\377\4\7\14\36\377\30(b\377\31*e\377" \ + "\10\15#\377\246\7\13\33\377\3\6\13\33\377\7\13\33\377\14\24""0\377\203" \ + "\31*e\377\5\30(a\377\10\16\"\377\7\13\32\377\7\13\33\377\21\34E\377\226" \ + "\31*e\377\2\25$W\377\7\13\32\377\325\7\13\33\377\3\17\32>\377\31*e\377" \ + "\20\32\77\377\325\7\13\33\377\3\10\16#\377\26&\\\377\26%[\377\203\7\13" \ + "\33\377\3\7\12\32\377\7\14\34\377\7\15\40\377\257\7\13\33\377\3\20\32" \ + "@\377\31*e\377\26%Z\377\247\7\13\33\377\2\6\13\32\377\13\22-\377\202" \ + "\31*e\377\2\30)c\377\6\12\32\377\273\7\13\33\377\3\7\12\33\377\7\13\33" \ + "\377\26%[\377\207\31*e\377\1\14\24""1\377\246\7\13\33\377\1\21\35G\377" \ + "\204\31*e\377\4\27'`\377\14\24""2\377\7\13\33\377\7\13\32\377\210\7\13" \ + "\33\377\2\7\12\33\377\7\14\35\377\202\31*e\377\1\10\15#\377\251\7\13" \ + "\33\377\1\20\34D\377\202\31*e\377\5\30(`\377\6\13\32\377\7\13\33\377" \ + "\6\13\33\377\20\34C\377\226\31*e\377\2\25$W\377\7\13\32\377\325\7\13" \ + "\33\377\3\17\32>\377\31*e\377\20\32\77\377\324\7\13\33\377\4\7\13\32" \ + "\377\7\13\33\377\26%Y\377\24!P\377\264\7\13\33\377\4\7\13\32\377\11\17" \ + "$\377\26%[\377\26%Z\377\247\7\13\33\377\2\6\13\33\377\13\23.\377\203" \ + "\31*e\377\1\6\12\32\377\275\7\13\33\377\1\26$Y\377\207\31*e\377\2\13" \ + "\22-\377\6\13\33\377\245\7\13\33\377\1\21\35G\377\203\31*e\377\3\26%" \ + "[\377\13\22-\377\7\12\32\377\212\7\13\33\377\2\6\13\33\377\10\15!\377" \ + "\202\31*e\377\1\10\15#\377\250\7\13\33\377\5\7\12\33\377\10\15\37\377" \ + "\24\"S\377\31*e\377\26&\\\377\203\7\13\33\377\1\20\34D\377\226\31*e\377" \ + "\2\25$W\377\7\13\32\377\325\7\13\33\377\4\17\31>\377\31*e\377\20\32\77" \ + "\377\7\12\33\377\323\7\13\33\377\4\7\13\32\377\6\12\32\377\25$W\377\16" \ + "\27""9\377\265\7\13\33\377\4\7\13\32\377\12\21*\377\26%[\377\6\13\32" \ + "\377\247\7\13\33\377\5\11\17&\377\22\37K\377\22\35I\377\21\35G\377\6" \ + "\13\33\377\275\7\13\33\377\1\23\40O\377\207\31*e\377\2\12\22,\377\6\13" \ + "\33\377\244\7\13\33\377\2\7\12\32\377\21\35G\377\202\31*e\377\2\26%Z" \ + "\377\11\20'\377\214\7\13\33\377\2\6\13\32\377\13\22-\377\202\31*e\377" \ + "\1\10\15#\377\250\7\13\33\377\5\6\12\33\377\6\12\32\377\11\17&\377\30" \ + ")b\377\23\40M\377\203\7\13\33\377\1\17\31>\377\226\31*e\377\2\25$W\377" \ + "\7\13\32\377\325\7\13\33\377\3\17\32>\377\31*e\377\17\32\77\377\325\7" \ + "\13\33\377\4\6\12\33\377\22\36J\377\7\13\33\377\7\12\32\377\266\7\13" \ + "\33\377\2\13\21-\377\6\12\32\377\351\7\13\33\377\1\20\33C\377\207\31" \ + "*e\377\2\13\22-\377\6\13\33\377\245\7\13\33\377\4\21\35G\377\31*e\377" \ + "\27'^\377\10\14\37\377\216\7\13\33\377\1\16\27""9\377\202\31*e\377\1" \ + "\10\15#\377\252\7\13\33\377\7\6\12\32\377\15\26""6\377\20\32A\377\7\13" \ + "\32\377\7\13\33\377\6\13\32\377\15\27""8\377\226\31*e\377\2\25$W\377" \ + "\7\13\32\377\325\7\13\33\377\3\17\32>\377\31*e\377\15\26""7\377\325\7" \ + "\13\33\377\3\6\13\33\377\10\15\40\377\6\13\33\377\377\7\13\33\377\243" \ + "\7\13\33\377\1\15\27""8\377\207\31*e\377\1\13\22-\377\246\7\13\33\377" \ + "\3\21\35G\377\31*e\377\21\34E\377\217\7\13\33\377\1\21\34D\377\202\31" \ + "*e\377\1\10\15#\377\253\7\13\33\377\6\7\12\32\377\11\16#\377\7\12\33" \ + "\377\7\13\33\377\7\13\32\377\13\23""0\377\226\31*e\377\2\25$W\377\7\13" \ + "\32\377\325\7\13\33\377\3\17\32>\377\31*e\377\15\26""7\377\325\7\13\33" \ + "\377\202\7\13\32\377\377\7\13\33\377\243\7\13\33\377\2\7\13\32\377\15" \ + "\26""5\377\207\31*e\377\2\12\21*\377\6\13\33\377\245\7\13\33\377\3\21" \ + "\35G\377\31*e\377\14\23.\377\217\7\13\33\377\1\22\37K\377\202\31*e\377" \ + "\1\10\15#\377\253\7\13\33\377\2\7\13\32\377\6\13\33\377\203\7\13\33\377" \ + "\1\12\21+\377\226\31*e\377\2\25$W\377\7\13\32\377\325\7\13\33\377\3\17" \ + "\31>\377\31*e\377\15\26""7\377\377\7\13\33\377\373\7\13\33\377\1\12\20" \ + "(\377\207\31*e\377\2\11\17%\377\6\13\33\377\244\7\13\33\377\3\7\12\32" \ + "\377\22\36I\377\31*e\377\202\6\13\32\377\215\7\13\33\377\2\7\12\33\377" \ + "\25$X\377\202\31*e\377\1\10\15#\377\257\7\13\33\377\2\6\12\32\377\10" \ + "\15!\377\226\31*e\377\2\25$W\377\7\13\32\377\325\7\13\33\377\3\17\32" \ + ">\377\31*e\377\14\25""3\377\377\7\13\33\377\373\7\13\33\377\1\7\12\34" \ + "\377\207\31*e\377\1\11\17%\377\246\7\13\33\377\2\14\24""1\377\15\27""8" \ + "\377\220\7\13\33\377\203\31*e\377\1\10\15#\377\260\7\13\33\377\1\10\15" \ + "\37\377\226\31*e\377\2\25$W\377\7\13\32\377\325\7\13\33\377\3\17\32>" \ + "\377\31*e\377\13\22-\377\377\7\13\33\377\373\7\13\33\377\5\6\12\32\377" \ + "\26&\\\377\27'^\377\30(`\377\30)b\377\203\31*e\377\1\11\17%\377\246\7" \ + "\13\33\377\3\6\13\33\377\7\13\33\377\7\12\33\377\217\7\13\33\377\4\30" \ + "(`\377\27'^\377\30)c\377\10\15\"\377\260\7\13\33\377\1\10\15\37\377\226" \ + "\31*e\377\2\25$W\377\7\13\32\377\325\7\13\33\377\3\17\32>\377\31*e\377" \ + "\13\22-\377\377\7\13\33\377\374\7\13\33\377\5\7\15\40\377\13\22,\377" \ + "\13\24""1\377\15\25""6\377\23\40M\377\202\31*e\377\1\11\17%\377\267\7" \ + "\13\33\377\5\7\13\34\377\13\22,\377\13\21*\377\12\22,\377\7\13\35\377" \ + "\260\7\13\33\377\2\7\14\37\377\30(a\377\225\31*e\377\2\25$W\377\7\13" \ + "\32\377\325\7\13\33\377\3\17\31>\377\31*e\377\13\23.\377\377\7\13\33" \ + "\377\373\7\13\33\377\3\6\13\33\377\7\13\33\377\6\12\32\377\202\7\13\33" \ + "\377\1\15\27""8\377\202\31*e\377\1\11\17%\377\270\7\13\33\377\3\6\12" \ + "\32\377\7\13\33\377\6\13\32\377\261\7\13\33\377\2\7\13\36\377\27&]\377" \ + "\225\31*e\377\2\25$V\377\7\13\32\377\325\7\13\33\377\4\17\31>\377\31" \ + "*e\377\11\17$\377\7\12\33\377\377\7\13\33\377\377\7\13\33\377\1\16\27" \ + "7\377\202\31*e\377\1\11\17%\377\354\7\13\33\377\2\6\13\34\377\25#U\377" \ + "\225\31*e\377\1\26&[\377\326\7\13\33\377\3\17\32>\377\31*e\377\11\17" \ + "$\377\377\7\13\33\377\377\7\13\33\377\2\7\13\33\377\14\23/\377\202\31" \ + "*e\377\1\11\17%\377\354\7\13\33\377\20\7\13\34\377\14\24""0\377\15\26" \ + "7\377\15\26""6\377\15\26""5\377\21\34D\377\31*e\377\30)c\377\27'^\377" \ + "\24\"S\377\15\26""7\377\11\17%\377\17\30;\377\24\"R\377\27&]\377\30(" \ + "b\377\207\31*e\377\1\30(a\377\326\7\13\33\377\4\17\32>\377\31*e\377\11" \ + "\17$\377\6\13\33\377\377\7\13\33\377\377\7\13\33\377\1\14\23/\377\202" \ + "\31*e\377\1\11\17%\377\354\7\13\33\377\1\7\13\32\377\203\7\13\33\377" \ + "\6\6\13\33\377\10\16#\377\21\35F\377\16\30""9\377\12\20)\377\7\13\32" \ + "\377\202\7\13\33\377\7\6\12\33\377\6\13\33\377\11\17$\377\15\25""4\377" \ + "\21\34D\377\24\"R\377\25#V\377\203\25#U\377\2\25#V\377\24!Q\377\326\7" \ + "\13\33\377\4\17\31>\377\31*e\377\10\14\36\377\6\13\33\377\377\7\13\33" \ + "\377\376\7\13\33\377\2\6\13\33\377\12\20(\377\202\31*e\377\1\11\17%\377" \ + "\360\7\13\33\377\7\7\13\32\377\7\12\33\377\6\13\33\377\7\13\33\377\6" \ + "\12\32\377\6\13\32\377\6\12\32\377\203\7\13\33\377\5\6\13\33\377\7\13" \ + "\32\377\7\13\33\377\7\14!\377\10\16!\377\204\10\16\"\377\2\10\16!\377" \ + "\7\13\32\377\325\7\13\33\377\2\17\31>\377\31*e\377\202\6\13\33\377\377" \ + "\7\13\33\377\376\7\13\33\377\2\7\12\32\377\11\17&\377\202\31*e\377\1" \ + "\11\17%\377\360\7\13\33\377\2\7\13\32\377\6\13\32\377\211\7\13\33\377" \ + "\202\7\12\33\377\2\7\13\33\377\7\13\32\377\333\7\13\33\377\2\17\32>\377" \ + "\31*e\377\377\7\13\33\377\377\7\13\33\377\202\7\13\33\377\1\10\16\"\377" \ + "\202\31*e\377\1\11\17$\377\377\7\13\33\377\333\7\13\33\377\2\17\32>\377" \ + "\31*e\377\377\7\13\33\377\377\7\13\33\377\6\7\13\33\377\7\13\32\377\7" \ + "\13\35\377\31*e\377\30)d\377\10\15#\377\377\7\13\33\377\333\7\13\33\377" \ + "\2\17\31>\377\31*e\377\377\7\13\33\377\377\7\13\33\377\202\7\13\33\377" \ + "\4\7\14\35\377\31*e\377\30)d\377\11\16#\377\377\7\13\33\377\333\7\13" \ + "\33\377\2\17\31>\377\31*e\377\377\7\13\33\377\377\7\13\33\377\202\7\13" \ + "\33\377\4\7\14\35\377\31*e\377\30)d\377\11\16#\377\377\7\13\33\377\333" \ + "\7\13\33\377\3\12\20)\377\16\30:\377\7\13\32\377\377\7\13\33\377\377" \ + "\7\13\33\377\5\7\13\33\377\7\14\35\377\31*e\377\30)d\377\11\16#\377\377" \ + "\7\13\33\377\332\7\13\33\377\1\7\13\32\377\377\7\13\33\377\377\7\13\33" \ + "\377\204\7\13\33\377\1\7\14\34\377\202\31*e\377\1\11\16#\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\337\7\13\33\377\4\6\12\33\377" \ + "\22\37K\377\22\36I\377\10\15\40\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\340\7\13\33\377\202\7\13\34\377\1\7\13\32\377\377\7\13\33" \ + "\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13" \ + "\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377" \ + "\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377\7\13\33\377\377" \ + "\7\13\33\377\377\7\13\33\377\344\7\13\33\377") + + diff --git a/utils/psplash/files/image_generic.h b/utils/psplash/files/image_generic.h new file mode 100644 index 0000000..8db52fc --- /dev/null +++ b/utils/psplash/files/image_generic.h @@ -0,0 +1,5475 @@ +/* GdkPixbuf RGBA C-Source image dump 1-byte-run-length-encoded */ + +#define OWRT_IMG_ROWSTRIDE (1280) +#define OWRT_IMG_WIDTH (320) +#define OWRT_IMG_HEIGHT (320) +#define OWRT_IMG_BYTES_PER_PIXEL (4) /* 3:RGB, 4:RGBA */ +#define OWRT_IMG_RLE_PIXEL_DATA ((uint8*) \ + "\2ES\203\377DS\203\377\202FS\203\377\2FR\203\377FS\203\377\203FT\203\377" \ + "\10ET\202\377FT\203\377GS\204\377FT\203\377GT\204\377FT\203\377+;q\377" \ + "\30)d\377\205\31*e\377\3\30)d\377\36/h\377M}\377\77M~\377\35.h\377\30)d\377\207\31*e\377\12\30)d\377\32+f\377" \ + ">M~\377=J}\377L}\377BP\200\377\202AO\200\377\1@N" \ + "\200\377\204AO\200\377\3@O\177\377\77N~\377@M\177\377\203@N\177\377\11" \ + "\77M\177\377@N\177\377>L\177\377\77M\177\377\77M~\377\77M}\377\77M~\377" \ + "+;q\377\30)d\377\210\31*e\377\10\27(d\3771Au\377=K}\377t\377\30)d\377\204\31*e\377\3" \ + "\30)d\377\27(d\3770\77t\377\203HV\205\377\5GV\205\377HV\205\377IV\205" \ + "\377HV\205\377IU\205\377\202IV\205\377\202IW\205\377\1HW\204\377\202" \ + "IW\205\377\2JW\206\377IW\205\377\203JW\206\377\202JV\206\377\202JW\206" \ + "\377\203JX\206\377\2JW\206\377JX\206\377\204IX\206\377\213JX\206\377" \ + "\204IX\206\377\205JX\206\377\202JW\206\377\202JV\206\377\205JW\206\377" \ + "\202IW\205\377\202HW\204\377\202IW\205\377\13IV\205\377IU\205\377HV\205" \ + "\377IV\205\377HV\205\377GV\205\377GU\204\377HV\205\377AP\200\377\"2j" \ + "\377\27(c\377\204\31*e\377\6\30)d\377\33,f\377>M~\377GU\204\377FT\203" \ + "\377FS\203\377\205FT\203\377\14FS\203\377FR\203\377ES\203\377FS\203\377" \ + "ES\203\377DS\203\377ES\203\377ER\202\377ES\201\377ER\202\377DQ\202\377" \ + "CR\202\377\204DR\202\377\5DQ\201\377CP\200\377BP\200\377\37""0i\377\30" \ + ")d\377\206\31*e\377\4\27(d\3772@u\377BP\200\377AO\177\377\202AO\200\377" \ + "\1@N\200\377\202AO\200\377\3@O\177\377AO\200\377\77O~\377\206@N\177\377" \ + "\7\77M\177\377>L\177\377\77M\177\377\77M~\377>L}\3776Ex\377\32+e\377" \ + "\210\31*e\377\3\30)d\377!2j\377=K}\377\202" \ + "L\177\377\202\77M\177\377\3\77M~\377\77L~\377\34-g\377\211\31*e\377\6" \ + "\33,g\3778Gz\377=K}\377M}\377\202BP\200\377\2AO\200\377@N\200\377\204AO\200\377" \ + "\202@N\177\377\1@M\177\377\204@N\177\377\202\77M\177\377\6\77M~\377\77" \ + "M\177\377\77M~\377=K}\377\27(c\377\30)d\377\207\31*e\377\2\30)d\377#" \ + "3k\377\202=K}\377\1;K}\377\202L\177\377\202\77M\177\377\4>L~\377@N~\377%5m\377\30)d" \ + "\377\207\31*e\377\3\30)d\377\27(d\377;J|\377\202=K}\377\1;K}\377\202" \ + "s\377\33,f\377\221\31*e\377\1\27(c\377\202-=r\377\2-;q\377-" \ + "L\177\377\77M\177" \ + "\377\203\77M~\377\2""4Cw\377\30)d\377\210\31*e\377\10\27(d\377*9p\377" \ + ">L}\377=K}\377;K}\377L\177\377\77M\177\377\77M~\377>M~\377" \ + ";I{\377\35-g\377\210\31*e\377\6\30)d\377\34-f\377>L~\377=K}\377L\177" \ + "\377\202\77M\177\377\202\77M~\377\2$4l\377\30)d\377\210\31*e\377\6\32" \ + "+e\3778Fz\377=K}\377L\177\377\77M\177\377\202\77M~\377\2""4Cv\377\27(d\377" \ + "\211\31*e\377\7""1@t\377=K}\377L\177\377\77M~\377\77M\177\377\77M" \ + "}\377@N\177\377\31*e\377\30)d\377\207\31*e\377\22\30)d\377)9p\377M~\377" \ + "\30)d\377\204\31*e\377\7\30)d\377/\77t\377GU\204\377FU\203\377FS\203" \ + "\377FT\203\377ET\202\377\203FT\203\377\3FS\203\377ES\203\377FS\203\377" \ + "\203ES\203\377\5ES\202\377ES\201\377EQ\202\377DR\202\377CR\202\377\202" \ + "DR\202\377\6DQ\201\377DR\202\377DP\200\377CQ\201\377\30)e\377\30)d\377" \ + "\205\31*e\377\3\30)d\377#3k\377AO\177\377\202BP\200\377\2AO\200\377@" \ + "N\200\377\204AO\200\377\3@O\177\377@N\177\377@M\177\377\204@N\177\377" \ + "\203\77M\177\377\4>L}\377@N\177\377%4l\377\30)d\377\207\31*e\377\4\30" \ + ")d\377\"1k\377M~\377\202BP\200\377\2AO\200\377@N\200\377\204AO\200\377\3@O\177\377" \ + "@N\177\377@M\177\377\204@N\177\377\2>L\177\377\77M\177\377\203\77M~\377" \ + "\2""1@u\377\27(c\377\207\31*e\377\11\30)d\377\31+e\377L\177" \ + "\377\77M\177\377\77M~\377\77M}\377;I{\377\210\31*e\377\3\30)e\377\27" \ + "(c\3774Cw\377\202=K}\377\1;K}\377\202L\177\377\77M\177\377\202\77M~\377\2=K|\377\37/i\377\210\31*e\377" \ + "\10\30)d\377&6n\377>L~\377=J|\377;K}\377L\177\377\77M\177\377\77M~\377>L}\377%5" \ + "m\377\210\31*e\377\6\30)d\377\32+e\377>L}\377=K}\377L\177\377" \ + "\77M\177\377\202\77M~\377\2-L~\377\27(c\377\204\31*e\377\2\32+f\377@N\177\377\202HV\205\377" \ + "\3GV\205\377IV\205\377HV\205\377\202IV\205\377\4IW\205\377HW\204\377" \ + "JW\206\377IW\205\377\202JW\206\377\3JV\206\377JX\206\377JW\206\377\203" \ + "JX\206\377\10KX\205\377KX\206\377KW\207\377KX\206\377JY\207\377KX\207" \ + "\377LY\207\377KY\207\377\204LY\207\377\5LX\207\377LY\207\377KY\206\377" \ + "KZ\206\377LY\207\377\202MZ\210\377\1LZ\207\377\230MZ\210\377\7LZ\207" \ + "\377MZ\210\377LZ\207\377KZ\206\377KY\206\377LY\207\377LX\207\377\205" \ + "LY\207\377\202KY\207\377\14JX\207\377KX\206\377KX\207\377KX\206\377K" \ + "X\205\377KX\206\377JX\206\377IX\206\377JW\206\377JX\206\377JW\206\377" \ + "JV\206\377\203JW\206\377\3IW\205\377HW\204\377IW\205\377\203IV\205\377" \ + "\5HV\205\377GU\204\377HV\205\377/>t\377\30)d\377\203\31*e\377\24\30)" \ + "d\377!1j\377IV\205\377GU\204\377GT\204\377FS\203\377ET\202\377FT\203" \ + "\377FS\203\377FT\203\377FR\203\377ES\203\377FS\203\377DS\203\377ES\203" \ + "\377ES\202\377ES\201\377EQ\202\377DR\202\377CR\202\377\204DR\202\377" \ + "\4DQ\201\377ER\202\377\37""0i\377\30)d\377\206\31*e\377\2!1j\377@N~\377" \ + "\202BP\200\377\2AO\200\377@N\200\377\203AO\200\377\3@O\177\377\77O~\377" \ + "@M\177\377\204@N\177\377\7\77M\177\377>L\177\377\77M~\377\77M\177\377" \ + "\77M~\3777Fy\377\30)d\377\210\31*e\377\6\30)d\377-=r\377=K}\377s\377\34," \ + "g\377\220\31*e\377\4\30)d\377\34,g\377,L}\377AO\177\377\202AO\200" \ + "\377\1@N\200\377\204AO\200\377\3@O\177\377@N\177\377@M\177\377\204@N" \ + "\177\377\203\77M\177\377\4\77M}\377@M~\377\31*e\377\30)d\377\207\31*" \ + "e\377\4\30)d\377%5m\377=J}\377=K}\377\202L}\377@N\177\377" \ + "%4m\377\30)d\377\210\31*e\377\7!1j\377;I|\377=K}\377L\177\377\77M\177\377\77M~\377\77M}\377=K}\377\27" \ + "(c\377\30)d\377\207\31*e\377\7\32+e\3779Hz\377=J|\377M}\377\30)d\377\203\31*e\377" \ + "\7\30)d\377\37/i\377JX\206\377FT\203\377GT\204\377FS\203\377ET\202\377" \ + "\202FT\203\377\203FS\203\377\10ES\203\377DS\203\377ES\203\377ES\202\377" \ + "ER\201\377ER\202\377DR\202\377CR\202\377\203DR\202\377\202DQ\201\377" \ + "\2""7Ex\377\30*d\377\206\31*e\377\2\27(c\377L\177\377\77M\177\377\77M~\377" \ + "\202>L}\377\2\33,f\377\30)d\377\207\31*e\377\2\27(d\3777Fy\377\202=K" \ + "}\377\2;K}\377;J|\377\204>M\201\377\203=M\201\377\203=L\201\377\203<" \ + "L\200\377\4=M\201\377\30*h\377\32+i\377\30)d\377\204\31*e\377\2\30)d" \ + "\377\31*f\377\203\32+i\377\3!2n\3779H}\377:I~\377\2049I~\377\1""9H~\377" \ + "\2038H~\377\7""6Fy\3775Dw\3776Dx\3775Cx\3775Dx\377\32+e\377\30)d\377" \ + "\214\32+i\377\5\31+i\377#4p\3776F|\3773Cy\3771@u\377\2022Av\377\3""2" \ + "Au\3771@u\3770\77u\377\2041@u\377\2'7n\377\30)d\377\220\31*e\377\10\30" \ + ")d\377#3l\377-=s\377-=q\377-;r\377-s\377HV\205\377GV\205\377HV\205\377\203IV\205\377\203IW\205\377\205" \ + "JW\206\377\2JX\206\377IX\206\377\202JX\206\377\3KX\205\377KW\207\377" \ + "KX\206\377\202KY\207\377\205LY\207\377\5LX\207\377KY\206\377LZ\207\377" \ + "MZ\210\377LZ\207\377\204MZ\210\377\4LY\210\377MZ\210\377N[\210\377MZ" \ + "\207\377\202N[\210\377\4IU\200\377EPw\377.6R\377\22\26!\377\213\0\0\0" \ + "\377\5\30\33*\3772;Y\377FR{\377IV\201\377N[\211\377\202N[\210\377\5N" \ + "[\207\377MZ\210\377N[\210\377MZ\210\377LY\210\377\204MZ\210\377\6LZ\207" \ + "\377MZ\210\377LY\207\377KZ\206\377LY\207\377LX\207\377\203LY\207\377" \ + "\13KY\207\377LY\207\377JY\207\377KX\206\377KW\207\377KX\206\377KX\205" \ + "\377JX\206\377IX\206\377JW\206\377JX\206\377\204JW\206\377\5IW\205\377" \ + "HW\204\377IW\205\377IV\205\377IU\205\377\202HV\205\377\3GV\204\377DR" \ + "\202\377\40""0i\377\204\31*e\377\6\26(c\377\77M~\377GU\204\377GT\204" \ + "\377GS\204\377ET\202\377\203FT\203\377\203FS\203\377\1DS\203\377\202" \ + "ES\203\377\4ES\201\377ER\202\377DR\202\377CR\202\377\204DR\202\377\3" \ + "DQ\201\377=K|\377\33,f\377\206\31*e\377\6\30)d\377/\77t\377BP\200\377" \ + "AO\200\377BP\200\377@N\200\377\204AO\200\377\3@O\177\377\77N~\377@M\177" \ + "\377\204@N\177\377\1>L\177\377\202\77M\177\377\4\77M~\377>L}\377\40""0" \ + "i\377\30)d\377\207\31*e\377\2\27(d\3771\77u\377\202=K}\377\4;K}\377>" \ + "N\202\377\31\37""4\377\20\25#\377\205\21\26$\377\206\21\25$\377\5\22" \ + "\26%\377\10\15\36\377\10\16\"\377\31*e\377\30)d\377\204\31*e\377\2\21" \ + "\34E\377\6\14\35\377\202\7\14\36\377\1\10\16\36\377\202\20\24#\377\207" \ + "\17\24#\377\11\16\23\40\377(3Z\3776Ey\3776Dx\3776Cx\3775Dx\377\36.h\377" \ + "\31+g\377\6\13\32\377\213\7\14\36\377\5\6\14\36\377\11\16\36\377\16\23" \ + "!\377\34%C\3773By\377\2022Av\377\4""2Au\3771@t\3771@u\3770\77u\377\203" \ + "1@u\377\2+;q\377\30)d\377\220\31*e\377\17\30)d\377\40""1j\377-=s\377" \ + "-=q\377-;r\377-L\177\377\77M\177\377" \ + "\77M~\377>L}\377%5m\377\30)d\377\207\31*e\377\7\30)d\377)9p\377>L}\377" \ + "=K}\377;K}\377>M\201\377\32\40""7\377\217\0\0\0\377\1\30(a\377\205\31" \ + "*e\377\1\7\14\36\377\216\0\0\0\377\7\20\25%\3777G|\3776Dx\3776Cx\377" \ + "5Dx\377\"2l\377\25$V\377\217\0\0\0\377\10\40*K\3772Bx\3772Av\3772Au\377" \ + "2Av\3772At\3771@u\3770\77u\377\2031@u\377\2-L\177\377" \ + "\77M\177\377\77M~\377>L}\377*:p\377\30)d\377\207\31*e\377\12\30)d\377" \ + "\"2k\377>L~\377=K}\377;K}\377s\377\30)d\377\220\31*e\377\10\30)d\377" \ + "\34-g\377.>s\377,=q\377-;r\377,;q\377+9n\377\22\32""1\377\202\0\0\0\377" \ + "\5\1\1\1\377***\377\20\20\20\377\0\0\1\377\23\37L\377\220\31*e\377\2" \ + "\30)d\377!1j\377\203(8o\377\5'7o\377&6o\377'7o\377\36/h\377\30)d\377" \ + "\207\31*e\377\7\26'c\3778Gz\377IV\205\377HV\204\377HV\205\377IV\205\377" \ + "IU\205\377\202IV\205\377\11HW\204\377JW\206\377IW\205\377JW\206\377J" \ + "V\206\377JW\206\377JX\206\377IX\206\377JX\206\377\203KX\206\377\4KW\207" \ + "\377JY\207\377KX\207\377KY\207\377\205LY\207\377\4KZ\206\377LZ\207\377" \ + "MZ\210\377LZ\207\377\203MZ\210\377\1LY\210\377\202MZ\207\377\3P^\214" \ + "\3772;X\377\1\2\3\377\202\0\0\0\377\3III\377\255\255\255\377\372\372" \ + "\372\377\203\377\377\377\377\1\376\376\376\377\207\377\377\377\377\1" \ + "\376\376\376\377\203\377\377\377\377\3\367\367\367\377\245\245\245\377" \ + "DDD\377\202\0\0\0\377\3\3\3\5\3772;Y\377Q_\217\377\202N[\210\377\4MZ" \ + "\210\377N[\210\377MZ\210\377LY\210\377\203MZ\210\377\5LZ\207\377MZ\210" \ + "\377KZ\206\377LY\207\377LX\207\377\204LY\207\377\202KY\207\377\6KX\207" \ + "\377KW\206\377KX\205\377JX\206\377KX\206\377IX\206\377\202JW\206\377" \ + "\1JV\206\377\202JW\206\377\6IW\205\377HW\204\377IW\205\377IV\205\377" \ + "IU\205\377IV\205\377\202HV\205\377\3JX\206\377\35.h\377\30)d\377\203" \ + "\31*e\377\6\33,f\377\77N\177\377FU\203\377GT\204\377FT\203\377ET\202" \ + "\377\203FT\203\377\10FR\203\377FS\203\377ES\203\377DS\203\377ES\203\377" \ + "ES\202\377ES\201\377EQ\202\377\206DR\202\377\3DQ\201\3774Cw\377\27(c" \ + "\377\206\31*e\377\2\35-g\377=K}\377\202BP\200\377\2AO\200\377@N\200\377" \ + "\203AO\200\377\3@O\177\377\77O~\377@M\177\377\204@N\177\377\3\77M\177" \ + "\377>L\177\377\77M\177\377\202\77M~\377\1/>s\377\210\31*e\377\7\30)d" \ + "\377\32+e\377\77M~\377s\377.\77v\377(5f\377\25\35""7\377\2\3" \ + "\7\377\202\0\0\0\377\6HHH\377\264\264\264\377\377\377\377\377\"\"\"\377" \ + "\0\0\1\377\23\37L\377\220\31*e\377\3\30)d\377\40""0i\377'7n\377\202(" \ + "8o\377\5'7o\377&6o\377'7o\377&6n\377\30)d\377\206\31*e\377\3\30)d\377" \ + "\31*e\377GU\203\377\203HV\205\377\6IV\205\377IU\205\377IV\205\377IW\205" \ + "\377HW\204\377IW\205\377\202JW\206\377\1JV\206\377\202JW\206\377\1IX" \ + "\206\377\202JX\206\377\4KX\205\377KW\207\377KX\207\377KY\207\377\205" \ + "LY\207\377\5LX\207\377KZ\206\377LZ\207\377MZ\210\377LZ\207\377\203MZ" \ + "\210\377\5LY\210\377MZ\210\377N[\210\377Q^\216\377\37%6\377\202\0\0\0" \ + "\377\3""333\377\333\333\333\377\372\372\372\377\202\377\377\377\377\1" \ + "\376\376\376\377\215\377\377\377\377\1\376\376\376\377\202\377\377\377" \ + "\377\3\371\371\371\377\326\326\326\377***\377\202\0\0\0\377\4\34!3\377" \ + "N\\\213\377MZ\207\377N[\210\377\202MZ\210\377\1LY\210\377\205MZ\210\377" \ + "\3LY\207\377KZ\206\377LX\207\377\203LY\207\377\11KY\207\377LY\207\377" \ + "KX\207\377KX\206\377KW\207\377KX\205\377KX\206\377JX\206\377IX\206\377" \ + "\202JX\206\377\204JW\206\377\203IW\205\377\203IV\205\377\4GU\204\377" \ + "IW\206\3771@u\377\27(c\377\203\31*e\377\2\27(d\377:H{\377\202GU\204\377" \ + "\3FS\203\377FT\203\377ET\202\377\202FT\203\377\10FS\203\377FR\203\377" \ + "FS\203\377ES\203\377DS\203\377ES\203\377ES\202\377EQ\202\377\206DR\202" \ + "\377\3DQ\201\377\77L~\377\26'c\377\206\31*e\377\3\32+f\377;I{\377BP\200" \ + "\377\202AO\200\377\1@N\200\377\203AO\200\377\3@O\177\377\77O~\377@M\177" \ + "\377\204@N\177\377\2\77M\177\377>L\177\377\202\77M\177\377\2\77M}\377" \ + "3Bv\377\210\31*e\377\12\30)d\377\27(c\377;J|\377=K}\377L\177\377\202\77M\177" \ + "\377\3\77M}\3777Fy\377\32+e\377\210\31*e\377\11\27(d\3775Dx\377=K}\377" \ + "s\377=K}\377L}\377@N\177\377\"2j\377\30)d\377\207\31*e\377\13\30)d\377#3l\377=K" \ + "}\377L~\377\77M\177\377\77M~\377@N~\377)9p\377\30" \ + ")d\377\31*e\377\31)d\377\30)d\377\205\31*e\377\1!1j\377\202=K}\377\202" \ + "\377\35\"6\377\33!4\377\40&=\377%,F\377)2P\377/9Z\3774\77c\377\77" \ + "Ly\377HW\212\377ES\204\377=K|\377\31)d\377\205\31*e\377\5\30)d\377\26" \ + "'c\377BO\200\377@M|\377M\201\377\27\35" \ + "1\377\0\0\0\377vvv\377\212\377\377\377\377\11\246\246\246\377\0\0\0\377" \ + "\5\11\26\377\30(b\377\24\"S\377\1\2\5\377\23\23\23\377\335\335\335\377" \ + "\376\376\376\377\214\377\377\377\377\11\376\376\376\377\342\342\342\377" \ + "\16\16\16\377\1\2\3\377-8d\3776Dy\377\11\14\25\377\0\0\0\377\277\277" \ + "\277\377\210\377\377\377\377\7\376\376\376\377\377\377\377\377III\377" \ + "\0\0\0\377\16\27""9\377!1i\377-s\377IW\206\377HV\204\377HV\205\377IV\205\377IU\205\377IV\205\377I" \ + "W\205\377HW\204\377\203JW\206\377\4JV\206\377JW\206\377JX\206\377IX\206" \ + "\377\202KX\206\377\4KX\205\377KW\207\377KX\207\377KY\207\377\204LY\207" \ + "\377\3LX\207\377LY\207\377LZ\207\377\204MZ\210\377\10LY\210\377MZ\210" \ + "\377N\\\211\377\12\14\22\377\0\0\0\377\217\217\217\377\377\377\377\377" \ + "\376\376\376\377\211\377\377\377\377\5\376\376\376\377\377\377\377\377" \ + "\325\325\325\377555\377\3\3\3\377\203\2\2\2\377\5\6\6\6\377UUU\377\357" \ + "\357\357\377\377\377\377\377\376\376\376\377\211\377\377\377\377\202" \ + "\376\376\376\377\10nnn\377\0\0\0\377\25\30$\377MZ\207\377N[\207\377Q" \ + "_\216\377\25\30%\377\0\0\0\377\213\0\1\1\377\5\0\0\0\377\27\35+\377D" \ + "Q{\377\34!3\377\1\1\2\377\207\0\0\0\377\6\1\1\1\377\24\31%\377>Ip\377" \ + "JW\206\377HU\204\377IV\205\377\202HV\205\377\1GU\204\377\204\31*e\377" \ + "\13\30)e\377\35-g\377FT\203\377GU\204\377FT\203\377GT\204\377GU\204\377" \ + "2<_\377\23\30%\377\2\2\4\377\0\0\1\377\211\0\0\0\377\202\0\0\1\377\5" \ + "\12\15\25\377(/L\377\77M\177\377\34-g\377\30)d\377\205\31*e\377\5\26" \ + "'c\377;I|\377/8[\377\0\0\0\377\0\1\1\377\213\0\0\1\377\5\2\2\4\377BQ" \ + "\205\3778Dr\377\32\40""5\377\2\2\4\377\210\0\0\0\377\5\1\1\4\377\16\30" \ + ";\377\40""1l\377M\200\377M\177" \ + "\377ANz\377\12\14\23\377\202\0\0\0\377\6\6\6\6\377\222\222\222\377\337" \ + "\337\337\377\356\356\356\377\371\371\371\377\375\375\375\377\204\377" \ + "\377\377\377\7\375\375\375\377\371\371\371\377\366\366\366\377\361\361" \ + "\361\377\336\336\336\377www\377\6\6\6\377\202\0\0\0\377\4\2\3\11\377" \ + "\23\40O\377\31*e\377\30)d\377\202\31*e\377\6\27(c\3774Cx\377/8Z\377\0" \ + "\0\0\377666\377\344\344\344\377\207\351\351\351\377\2\352\352\352\377" \ + "\333\333\333\377\204\0\0\0\377\4TTT\377\316\316\316\377\361\361\361\377" \ + "\373\373\373\377\204\377\377\377\377\16\372\372\372\377\357\357\357\377" \ + "\267\267\267\377\16\16\16\377\0\0\0\377\0\0\1\377'1Q\377>M\200\377\377\30)c\377\202\31*e" \ + "\377\6\27(c\3772Bv\377/9Z\377\0\0\0\377;;;\377\370\370\370\377\210\377" \ + "\377\377\377\1\357\357\357\377\202\0\0\0\377\2\27\27\27\377\245\245\245" \ + "\377\202\377\377\377\377\1\376\376\376\377\206\377\377\377\377\1\376" \ + "\376\376\377\202\377\377\377\377\4GGG\377\0\0\0\377\1\1\1\3771=e\377" \ + "\203\377Tb\223\377\24\27" \ + "#\377\0\0\0\377\253\253\253\377\213\377\377\377\377\202\376\376\376\377" \ + "\217\377\377\377\377\6\301\301\301\377\0\0\0\377\5\6\12\377FT\201\377" \ + "\25'c\377\26%[\377\202\0\0\0\377\1\320\320\320\377\210\377\377\377\377" \ + "\13\376\376\376\377\377\377\377\377\345\345\345\377___\377)))\377\0\0" \ + "\0\377\25\25\25\377DDD\377\274\274\274\377\377\377\377\377\376\376\376" \ + "\377\207\377\377\377\377\12\376\376\376\377\324\324\324\377\12\12\12" \ + "\377\0\0\2\377\23!Q\377$4l\37709[\377\0\0\0\377;;;\377\370\370\370\377" \ + "\233\377\377\377\377\11\365\365\365\377777\377\0\0\0\377'1R\377\377\10\16#\377\0\0\0\377\227\227\227\377\224\377\377" \ + "\377\377\3***\377\0\0\0\377\23!O\377\213\31*e\377\3\30)d\377'7n\377(" \ + "8n\377\202(8o\377\203'7o\377\2\32+e\377\30)d\377\203\31*e\377\2\30)d" \ + "\377*:q\377\202HV\205\377\1GV\205\377\203IV\205\377\202IW\205\377\203" \ + "JW\206\377\1JV\206\377\203JX\206\377\6KX\206\377KX\205\377KX\206\377" \ + "KW\207\377JY\207\377KY\207\377\203LY\207\377\3LX\207\377KZ\206\377LZ" \ + "\207\377\204MZ\210\377\6LY\210\377N[\210\377R_\217\377\16\22\32\377\0" \ + "\0\0\377\267\267\267\377\213\377\377\377\377\4ttt\377\0\0\0\377$*\77" \ + "\377Ta\217\377\202Q^\212\377\13Q^\213\377P^\213\377Q^\213\377R]\213\377" \ + "R^\213\377Q^\213\377Q^\212\377Sa\217\377\40$6\377\0\0\0\377\212\212\212" \ + "\377\213\377\377\377\377\7\210\210\210\377\0\0\0\377\34\40""0\377Tb\224" \ + "\377\24\27#\377\0\0\0\377\253\253\253\377\215\377\377\377\377\6\276\276" \ + "\276\377ppp\377sss\377\312\312\312\377\377\377\377\377\376\376\376\377" \ + "\212\377\377\377\377\7\26\26\26\377\0\0\0\3775Ac\377\31+i\377\12\21)" \ + "\377\0\0\0\377]]]\377\212\377\377\377\377\2\321\321\321\377\15\15\15" \ + "\377\206\0\0\0\377\3\262\262\262\377\377\377\377\377\376\376\376\377" \ + "\206\377\377\377\377\12\376\376\376\377\377\377\377\377111\377\0\0\0" \ + "\377\12\21)\377\"3m\37709[\377\0\0\0\377;;;\377\370\370\370\377\220\377" \ + "\377\377\377\202\376\376\376\377\212\377\377\377\377\10YYY\377\0\0\0" \ + "\377\35%=\377\377'/J\377\202&.I\377\4%,F\377\5\6\12\377\0\0\0\377" \ + "\227\227\227\377\212\377\377\377\377\202\0\0\0\377\5\35*W\3770:\\\377" \ + "\0\0\0\377;;;\377\370\370\370\377\212\377\377\377\377\2\302\302\302\377" \ + "\10\10\10\377\204\0\0\0\377\3\36\36\36\377\353\353\353\377\376\376\376" \ + "\377\211\377\377\377\377\11{{{\377\0\0\0\377\27\34""0\377;I{\377;J|\377" \ + "\77M\202\377\5\7\14\377\0\0\0\377\313\313\313\377\211\377\377\377\377" \ + "\4\335\335\335\377CCC\377\377\377\377\377\376\376\376\377\207\377\377" \ + "\377\377\1sss\377\202\0\0\0\377\1{{{\377\211\377\377\377\377\2\23\23" \ + "\23\377\374\374\374\377\211\377\377\377\377\11\245\245\245\377\0\0\0" \ + "\377\5\11\26\377\31+g\377\30)d\377\31*e\377\12\21*\377\0\0\0\377xxx\377" \ + "\213\377\377\377\377\2\352\352\352\377\36\36\36\377\207\0\0\0\377\3\23" \ + "\40N\377\31*g\377\7\14\34\377\205\0\0\0\377\1\273\273\273\377\211\377" \ + "\377\377\377\2\365\365\365\377\40\40\40\377\207\0\0\0\377\2\22\40M\377" \ + "\31*f\377\212\31*e\377\3\30)d\377'7n\377(8n\377\202(8o\377\203'7o\377" \ + "\2\35.f\377\30)d\377\203\31*e\377\2\30)d\377&5m\377\202HV\205\377\1G" \ + "V\205\377\203IV\205\377\3IW\205\377HW\204\377IW\205\377\202JW\206\377" \ + "\1JV\206\377\203JX\206\377\6KX\206\377KX\205\377KX\206\377KW\207\377" \ + "JY\207\377KY\207\377\203LY\207\377\3LX\207\377KZ\206\377LY\207\377\204" \ + "MZ\210\377\6LY\210\377N[\210\377R`\217\377\16\20\30\377\0\0\0\377\274" \ + "\274\274\377\213\377\377\377\377\5zzz\377\0\0\0\377!':\377Ta\217\377" \ + "P]\212\377\203Q^\212\377\203P^\213\377\202Q^\213\377\4Tb\220\377\23\27" \ + "!\377\0\0\0\377\260\260\260\377\213\377\377\377\377\7iii\377\0\0\0\377" \ + "&-D\377Sa\223\377\24\27#\377\0\0\0\377\253\253\253\377\212\377\377\377" \ + "\377\1\341\341\341\377\202\0\0\0\377\10ANw\377M[\214\377LZ\211\3773<" \ + "\\\377\1\1\2\377\32\32\32\377\345\345\345\377\376\376\376\377\207\377" \ + "\377\377\377\7\376\376\376\377\364\364\364\377\26\27\27\377\0\0\0\377" \ + "\20\33C\377\0\0\0\377\77\77\77\377\212\377\377\377\377\1}}}\377\211\0" \ + "\0\0\377\2fff\377\376\376\376\377\211\377\377\377\377\7]]]\377\0\0\0" \ + "\377\25\35""9\3771;^\377\0\0\0\377;;;\377\370\370\370\377\212\377\377" \ + "\377\377\10DDD\377\0\0\0\377\21\25#\377;Hx\377=Jz\377\10\12\20\377\0" \ + "\0\0\377\243\243\243\377\212\377\377\377\377\13\207\207\207\377\0\0\0" \ + "\377\25\32+\377;Iz\377L\200\377\26\33/\377\0\0\0\377zzz\377\377" \ + "\377\377\377\376\376\376\377\207\377\377\377\377\2\371\371\371\377\256" \ + "\256\256\377\211\377\377\377\377\1\35\35\35\377\202\0\0\0\377\3""444" \ + "\377\377\377\377\377\376\376\376\377\207\377\377\377\377\3\231\231\231" \ + "\377\377\377\377\377\376\376\376\377\210\377\377\377\377\4\\\\\\\377" \ + "\0\0\0\377\13\23.\377\31*f\377\202\31*e\377\3\12\21*\377\0\0\0\377xx" \ + "x\377\213\377\377\377\377\14|||\377\0\0\0\377\3\5\15\377\30(a\377\31" \ + "+f\377\20\34D\377\6\13\34\377\1\2\6\377\4\6\20\377\32,j\377\31*e\377" \ + "\30)d\377\202\30)b\377\4\32+h\377\5\7\24\377\0\0\0\377\273\273\273\377" \ + "\211\377\377\377\377\4\365\365\365\377!!!\377\0\0\1\377\22\37J\377\205" \ + "\30)b\377\2\30*d\377\31)e\377\212\31*e\377\2\27)d\377'7n\377\203(8o\377" \ + "\202'7o\377\2(7o\377\30)d\377\204\31*e\377\5\30)d\377#3l\377IW\205\377" \ + "HV\205\377GV\205\377\203IV\205\377\3IW\205\377HW\204\377IW\205\377\202" \ + "JW\206\377\1JV\206\377\203JX\206\377\6KX\206\377KX\205\377KX\206\377" \ + "KW\207\377JY\207\377KY\207\377\203LY\207\377\2LX\207\377KY\206\377\202" \ + "LZ\207\377\203MZ\210\377\6LY\210\377N[\210\377Q_\216\377\23\27#\377\0" \ + "\0\0\377\253\253\253\377\213\377\377\377\377\21\240\240\240\377\0\0\0" \ + "\377\25\32&\377Tb\221\377Q^\212\377Q^\211\377Q^\212\377Q^\213\377Q^\212" \ + "\377Q^\213\377Q^\212\377Q^\213\377Q^\212\377Ub\221\377\11\13\20\377\0" \ + "\0\0\377\324\324\324\377\213\377\377\377\377\7NNN\377\0\0\0\37708T\377" \ + "Sa\222\377\24\27#\377\0\0\0\377\253\253\253\377\212\377\377\377\377\13" \ + "nnn\377\0\0\0\377\35\"4\377LZ\212\377JW\206\377JW\205\377IV\203\377\6" \ + "\7\13\377\0\0\0\377\306\306\306\377\376\376\376\377\210\377\377\377\377" \ + "\6\370\370\370\377:::\377\0\0\0\377\7\15\37\377\0\0\0\377ttt\377\212" \ + "\377\377\377\377\2\213\213\213\377^^^\377\210aaa\377\2\214\214\214\377" \ + "\374\374\374\377\211\377\377\377\377\7\206\206\206\377\0\0\0\377\22\30" \ + "-\3771;_\377\0\0\0\377;;;\377\370\370\370\377\211\377\377\377\377\11" \ + "\337\337\337\377\25\25\25\377\2\3\4\3772>f\377\77M\177\377AP\202\377" \ + "\36%>\377\0\0\0\377ooo\377\212\377\377\377\377\13\210\210\210\377\0\0" \ + "\0\377\24\32+\377;Iz\377L~\377\77M~\377@N\200\377'" \ + "2U\377\0\0\0\377DDD\377\212\377\377\377\377\4\210\210\210\377\0\0\0\377" \ + "\24\32+\377;Iz\377\202l\377\0\0\0\377\3\3\3\377\362\362\362\377" \ + "\221\377\377\377\377\4\245\245\245\377\0\0\0\377\3\7\21\377\31*g\377" \ + "\203\31*e\377\3\12\21*\377\0\0\0\377xxx\377\212\377\377\377\377\5\254" \ + "\254\254\377\0\0\0\377\5\11\26\377\32,j\377\30)d\377\212\31*e\377\4\32" \ + ",j\377\4\10\24\377\0\0\0\377\273\273\273\377\211\377\377\377\377\4\365" \ + "\365\365\377!!!\377\0\0\1\377\23\37L\377\220\31*e\377\3\30)d\377\31*" \ + "d\377'7n\377\203(8o\377\202'7o\377\2(7o\377\30)d\377\205\31*e\377\5\25" \ + "&b\377DR\202\377HV\205\377GV\205\377HV\205\377\202IV\205\377\3IW\205" \ + "\377HW\204\377IW\205\377\204JW\206\377\10JX\206\377IX\206\377JX\206\377" \ + "KX\206\377KX\205\377KX\206\377KX\207\377JY\207\377\205LY\207\377\2KY" \ + "\206\377LZ\207\377\205MZ\210\377\2MZ\207\377O\\\211\377\202\0\0\0\377" \ + "\1\353\353\353\377\212\377\377\377\377\7\375\375\375\377fff\377\0\0\0" \ + "\377\20\22\34\377O\\\211\377P]\212\377O\\\211\377\203P]\212\377\6P]\211" \ + "\377P]\212\377LX\203\377\7\10\14\377\0\0\0\377\227\227\227\377\213\377" \ + "\377\377\377\10\317\317\317\377\0\0\0\377\4\4\6\377R`\221\377R_\217\377" \ + "\24\27#\377\0\0\0\377\253\253\253\377\212\377\377\377\377\12""888\377" \ + "\0\0\0\377/8V\377KX\207\377KX\206\377KX\205\377N[\214\377\20\22\35\377" \ + "\0\0\0\377\250\250\250\377\211\377\377\377\377\2\373\373\373\377SSS\377" \ + "\203\0\0\0\377\1\213\213\213\377\211\377\377\377\377\1\376\376\376\377" \ + "\225\377\377\377\377\7\323\323\323\377\7\7\7\377\5\7\13\377+4T\377\0" \ + "\0\0\377;;;\377\370\370\370\377\211\377\377\377\377\11\265\265\265\377" \ + "\0\0\0\377\11\12\21\377AP\205\377\77M~\377@N\200\377$/S\377\0\0\0\377" \ + "DDD\377\212\377\377\377\377\4\210\210\210\377\0\0\0\377\24\32+\377;I" \ + "z\377\202M" \ + "\202\377\2\2\4\377\0\0\0\377\330\330\330\377\217\377\377\377\377\1\374" \ + "\374\374\377\202\0\0\0\377\10""3Aq\3778Fy\3777Fy\377/L}\377AO\201" \ + "\377\30$K\377\0\0\0\377DDD\377\212\377\377\377\377\4\210\210\210\377" \ + "\0\0\0\377\24\31+\377;Iz\377\202>>\377\0\0\0\377\17\30""7\377:H}\3778Fx" \ + "\3776Ex\3779H}\377\31!9\377\0\0\0\377[[[\377\377\377\377\377\376\376" \ + "\376\377\215\377\377\377\377\3\36\36\36\377\0\0\0\377\22\36H\377\205" \ + "\31*e\377\3\15\24,\377\0\0\0\377xxx\377\212\377\377\377\377\4<<<\377" \ + "\0\0\0\377\21\35F\377\31*g\377\213\31*e\377\4\31+i\377\12\21)\377\0\0" \ + "\0\377\203\203\203\377\212\377\377\377\377\1\265\265\265\377\202\0\0" \ + "\0\377\6\13\13\13\377AAA\377XXX\377\0\0\0\377\4\7\22\377\32,j\377\212" \ + "\31*e\377\3\30)d\377\33,f\377'7n\377\202(8o\377\5'7o\377&6o\377'7o\377" \ + "(7o\377\30)d\377\207\31*e\377\3""9Hz\377HV\205\377GV\205\377\202HV\205" \ + "\377\22IU\205\377IW\205\377IV\205\377IW\205\377JW\206\377IW\205\377J" \ + "W\206\377JV\206\377JX\206\377JW\206\377JX\206\377KX\206\377JX\206\377" \ + "KX\206\377KW\207\377JY\207\377KX\207\377KY\207\377\203LY\207\377\3LX" \ + "\207\377KZ\206\377LZ\207\377\205MZ\210\377\10MZ\207\377P]\213\377\33" \ + "!0\377\0\0\0\377\17\17\17\377\344\344\344\377\377\377\377\377\376\376" \ + "\376\377\236\377\377\377\377\12\16\16\16\377\0\0\0\377\40%9\377Q^\216" \ + "\377MZ\207\377N[\210\377Q^\216\377\24\27#\377\0\0\0\377\253\253\253\377" \ + "\214\377\377\377\377\1\376\376\376\377\220\377\377\377\377\7\25\25\25" \ + "\377\0\0\0\377\21\35H\377\31+h\377\23\37M\377\0\0\0\377\2\2\2\377\211" \ + "\377\377\377\377\5\376\376\376\377\377\377\377\377\237\237\237\377\0" \ + "\0\0\377\1\1\1\377\202\0\0\0\377\5\1\1\1\377\40\40\40\377\367\367\367" \ + "\377\377\377\377\377\376\376\376\377\202\377\377\377\377\1\376\376\376" \ + "\377\205\377\377\377\377\1\332\332\332\377\202\0\0\0\377\5.7Y\377/9\\" \ + "\377\0\0\0\377;;;\377\370\370\370\377\211\377\377\377\377\11\266\266" \ + "\266\377\0\0\0\377\10\12\20\377AP\205\377\77M}\377AO\201\377\24\37H\377" \ + "\0\0\0\377DDD\377\212\377\377\377\377\4\210\210\210\377\0\0\0\377\24" \ + "\31+\377;Iz\377\202^" \ + "\377\202\0\0\0\377\3___\377\377\377\377\377\376\376\376\377\231\377\377" \ + "\377\377\3\376\376\376\377\377\377\377\377\177\177\177\377\202\0\0\0" \ + "\377\11""8Bc\377N[\210\377MZ\207\377N[\210\377LY\210\377P^\216\377\24" \ + "\27#\377\0\0\0\377\253\253\253\377\232\377\377\377\377\5\376\376\376" \ + "\377\367\367\367\377888\377\0\0\0\377\14\24""1\377\202\30)d\377\7\31" \ + "*e\377\21\35G\377\0\0\0\377\4\4\4\377\261\261\261\377\377\377\377\377" \ + "\376\376\376\377\207\377\377\377\377\1\376\376\376\377\216\377\377\377" \ + "\377\13\376\376\376\377\377\377\377\377___\377\0\0\0\377\2\4\14\3776" \ + "Cr\377BP\200\377.8Z\377\0\0\0\377;;;\377\370\370\370\377\211\377\377" \ + "\377\377\11\266\266\266\377\0\0\0\377\10\12\20\377AP\205\377\77M}\377" \ + "9G{\377\22\37G\377\0\0\0\377DDD\377\212\377\377\377\377\4\210\210\210" \ + "\377\0\0\0\377\24\31+\377;Iz\377\202L}\377+;s\377\21\35F\377\0\0\0\377DDD\377\212\377\377\377\377\4" \ + "\210\210\210\377\0\0\0\377\24\31+\377;Iz\377\202L}\377&6o\377\21\35F\377\0\0\0\377HHH\377\212" \ + "\377\377\377\377\4\220\220\220\377\0\0\0\377\24\31+\377;Iz\377\202L}\377!2l\377\21\35F\377\0\0\0\377" \ + "\14\14\14\377...\377\211---\377\15\27\27\27\377\0\0\0\377\24\31+\377" \ + ";Iz\377;J|\377>>\377\245\245\245\377\314\314\314\377\346\346\346\377\360\360\360" \ + "\377\361\361\361\377\355\355\355\377\332\332\332\377\302\302\302\377" \ + "\214\214\214\377OOO\377\22\22\22\377\202\0\0\0\377\2\6\12\30\377\31+" \ + "g\377\212\31*e\377\1\"3k\377\203(8o\377\4'7o\377&6o\377'7n\377\36.h\377" \ + "\205\31*e\377\1\30)d\377\204\31*e\377\4#3l\377FT\204\377GU\204\377GV" \ + "\205\377\202IV\205\377\4IU\205\377IW\205\377IV\205\377IW\205\377\205" \ + "JW\206\377\2JX\206\377IX\206\377\202JX\206\377\5KX\205\377KW\206\377" \ + "KX\207\377JY\207\377KX\207\377\205LY\207\377\4LX\207\377LY\207\377KZ" \ + "\206\377LZ\207\377\205MZ\210\377\10LY\210\377MZ\210\377MZ\207\377P]\213" \ + "\377KX\203\3774=\\\377\34!2\377\12\13\21\377\207\0\0\0\377\1\4\4\4\377" \ + "\207\0\0\0\377\6\10\12\20\377\35\"3\3774=\\\377MY\206\377O]\213\377M" \ + "Z\207\377\202N[\210\377\2MZ\210\377LY\210\377\204MZ\210\377\5LZ\207\377" \ + "P^\217\377\24\27#\377\0\0\0\377\253\253\253\377\212\377\377\377\377\4" \ + "***\377\0\0\0\377\21\24\37\377\1\1\2\377\211\0\0\0\377\6\4\5\10\377!" \ + "'<\377@Lv\377IX\210\377\77M~\377\30)e\377\203\31*e\377\14\30)d\377\35" \ + ".h\377IW\205\377GU\204\377FT\203\377GS\204\377ET\202\377HW\207\377;G" \ + "p\377'/J\377\25\31(\377\3\3\6\377\216\0\0\0\377\11\2\3\11\377\11\17$" \ + "\377\21\35G\377\31*e\377\31*f\377\30)d\377\31*e\377\27(c\377;I|\377\202" \ + "BP\200\377\1-6X\377\216\0\0\0\377\5\6\6\13\377BP\204\377>L}\377\34-i" \ + "\377\20\35E\377\216\0\0\0\377\11\22\27&\377;Iz\377h\377;I{\377Kz\377\16'7n\377BQ\201\377IW\205\377^i\220\377cm\224\377bm\223\377" \ + "`k\221\377Q^\212\377S`\214\377al\222\377bl\223\377al\223\377Ye\220\377" \ + "GV\210\377\202HW\211\377\13IX\212\377GU\207\377BP\177\377GV\210\377H" \ + "W\212\377GV\211\377GU\210\377FT\206\377GT\205\377\"3l\377\30)d\377\205" \ + "\31*e\377\4\30)d\377'7n\377N[\207\377^i\220\377\202^i\221\377\2Yd\217" \ + "\377@N\201\377\203BP\202\377\1@P\200\377\205AO\201\377\10@N\201\377\77" \ + "N\201\377@N\201\377\77N\200\377\77M~\3775Dw\377\27(c\377\31*e\377\207" \ + "\31*f\377\2\35.i\377;J}\377\202=L~\377\4L|\377\3>L{\377.=s\377\30)e\377\203\31*f\377" \ + "\5\30)e\377%4m\3778Fy\3777Fy\3776Fy\377\2027Fy\377\5""6Ey\3777Dy\377" \ + "6Dx\3776Ez\3776Fz\377\2026Fy\377\4""6Dy\3776Ez\3772Aw\377\27(e\377\207" \ + "\31*f\377\206\31*e\377\12\27(d\377+:q\3771Bv\377FT\204\377R^\212\377" \ + "S_\212\377R^\212\377DQ\201\3772Av\3771@v\377\2031Av\377\2""2Aw\377\"" \ + "2l\377\202\31*f\377\2\31*e\377\30)d\377\215\31*e\377\15\27(d\377(8o\377" \ + "-=r\377-=q\377,;q\377-A\377))+\377'()\377\207\215\237\377Ly\377##%\377\203\0\0\0\377\4kq\203" \ + "\377JX\206\377Ze\216\377/04\377\202\0\0\0\377\13OPS\377Yf\223\377v\200" \ + "\242\377&%\"\377\5\4\4\377\16\16\15\377jp\207\377CQ\201\377ES\202\377" \ + "ES\201\377EQ\202\377\203DR\202\377\10CQ\201\377DR\202\377CQ\201\377D" \ + "Q\201\3775Dw\377\26(c\377\31*e\377\30)d\377\205\31*e\377\3=L}\377_i\215" \ + "\377\32\32\34\377\202\0\0\0\377\2\210\215\236\377s\3778Fy\3777Fy\377" \ + "6Fy\377\2027Fy\377\4""7Dy\3776Ey\3775Dx\3776Ey\377\2036Ex\377\4""6Cx" \ + "\3776Dx\377'7n\377\27)d\377\203\31*e\377\1\30)d\377\210\31*e\377\13\30" \ + ")d\377\30*d\3772Au\377.>t\377y\200\233\377\11\10\7\377\0\0\0\377\10\10" \ + "\11\377]f\203\3771@t\3770\77u\377\2031@u\377\2/\77t\377\35.h\377\214" \ + "\31*e\377\202\30)d\377\202\31*e\377\4\30)d\377\31*e\377,L~\377\202\77M\177\377\11\77M~\3778Fy\377\23%a" \ + "\377\22$a\377\22$b\377\21#a\377\22$a\377\24&b\377\30)d\377\202\31*e\377" \ + "\10\30)d\377,;q\3779G{\3777Fz\3776F{\3776Fz\3777Fz\3778Gz\377\202L~\377\202\77M~\377\10>L}\377\\f\206\377kq\206\377x{\207" \ + "\377w{\210\377mr\206\377Va\204\377#3k\377\203\30)d\377\22HU\204\377o" \ + "v\221\377x}\216\377\177\203\214\377\177\202\216\377w|\216\377iq\222\377" \ + "@N\177\377M~\377HV\205\377GV\205\377" \ + "HV\205\377IV\205\377IU\205\377IV\205\377\203IW\205\377\2JW\206\377IW" \ + "\205\377\203JW\206\377\202JX\206\377\3IX\206\377KX\206\377JX\206\377" \ + "\202KX\206\377\6KW\206\377KX\206\377JY\207\377KY\207\377LY\207\377KY" \ + "\207\377\204LY\207\377\202LX\207\377\7LY\207\377KY\206\377KZ\206\377" \ + "LY\207\377LZ\207\377MZ\210\377LZ\207\377\223MZ\210\377\1LZ\207\377\202" \ + "MZ\210\377\202LZ\207\377\1KZ\206\377\202LY\207\377\1LX\207\377\203LY" \ + "\207\377\4O]\215\377\24\27#\377\0\0\0\377\253\253\253\377\212\377\377" \ + "\377\377\7***\377\0\0\0\3773<^\377IW\205\377JW\206\377IW\205\377HW\204" \ + "\377\202IV\205\377\4IU\205\377HU\204\377\\i\225\377Y[_\377\202\0\0\0" \ + "\377\"68>\377O\\\212\377FFH\377\0\0\0\377\4\4\4\377666\377\0\0\0\377" \ + "\27\27\26\377ox\225\377kp\203\377\6\6\5\377\0\0\0\377))'\377ny\235\377" \ + "@N\177\377v\200\242\377'&#\377\6\6\5\377\20\17\15\377jp\207\377CQ\201" \ + "\377qx\221\377\11\11\10\377\5\4\3\377.-+\377\203\206\222\377\15\15\14" \ + "\377\0\0\0\377fhp\377IV\205\377^i\217\377OQZ\377\31\31\30\377\2\1\0\377" \ + "\202\0\0\0\377\7\10\7\6\377(((\377ch{\377DR\203\377@N\177\377_i\215\377" \ + "\34\34\35\377\202\0\0\0\377\6\210\215\236\377A\377q" \ + "t~\377\6\5\3\377\0\0\0\377cen\377>M~\377cn\221\377QSZ\377\25\24\22\377" \ + "\203\0\0\0\377\11\11\10\7\377*+,\377ot\207\377;I|\3772Av\377\26'c\377" \ + "Q\\\201\377FHN\377\23\23\21\377\203\0\0\0\377\10\14\13\12\377123\377" \ + "ho\211\377\35/j\377\30)d\377%5m\377[_n\377\31\30\30\377\202\0\0\0\377" \ + "\13\24\24\23\377dej\377\15\15\15\377\0\0\0\377\12\12\12\377]f\203\377" \ + "0\77t\3773Cx\377ox\224\377ABF\377\20\17\16\377\202\0\0\0\377\22\6\6\4" \ + "\377\30\30\26\377PR[\377O[\205\377\31*e\377$4m\377UYf\377\4\4\2\377\2" \ + "\2\0\377]^b\377Z]i\377\20\20\16\377\0\0\0\377\2\2\1\377!!\40\377jr\211" \ + "\377TW`\377\22\22\20\377\202\0\0\0\377\4\35\34\34\377ot\213\3771@u\377" \ + "+\377\202\0\0\0\377\3UW]\3779H~\377}\203\226\377\202" \ + "\0\0\0\377\5\34\34\36\377^i\217\377!3o\377an\231\377.-.\377\202\0\0\0" \ + "\377\3MQ^\377\36/j\377ru\177\377\202\0\0\0\377\4\37\37\37\377pw\217\377" \ + "lu\225\377CEJ\377\202\0\0\0\377\4\12\12\12\377]f\203\3771@u\377]an\377" \ + "\202\0\0\0\377\12\"\"!\377s{\230\377DR\201\377ms\210\377\13\12\11\377" \ + "\0\0\0\377\21\20\17\377bi\207\377\36/j\377RWd\377\203\0\0\0\377\3Z_n" \ + "\377^h\214\377FGM\377\203\0\0\0\377\3cfq\377ir\220\377ACF\377\202\0\0" \ + "\0\377\3\"#%\377HU\201\377+;q\377\203,M\177\377chv\377\202\0\0\0" \ + "\377\5###\377kmu\377ehr\377gjs\377WWZ\377\202\0\0\0\377\3))*\377R_\214" \ + "\377gkv\377\202\0\0\0\377\5--.\377cfp\377`co\377beq\377TUW\377\202\0" \ + "\0\0\377\3""68=\3776Fy\377_`h\377\202\0\0\0\377\4LMQ\377:J{\3770@v\377" \ + "\202\206\230\377\202\0\0\0\377\4\12\12\12\377\\e\203\3773Bv\377QRW\377" \ + "\202\0\0\0\377\5abf\3773Cy\377\24%b\377AN}\377,,.\377\202\0\0\0\377\3" \ + "uy\210\377\34-j\377RWd\377\202\0\0\0\377\12\17\17\17\377Wb\210\377\25" \ + "'c\377\\`q\377\4\3\3\377\0\0\0\377!\40\36\377\\h\220\377\40""1l\377\207" \ + "\213\230\377\202\0\0\0\377\3\36\36\40\377LX\202\377+;q\377\203,F\377))-\377\31\31\30" \ + "\377\7\7\6\377\202\0\0\0\377\11\37\37\36\377u|\227\377\34-g\377CQ\202" \ + "\377qx\216\377@AH\377((+\377\26\26\26\377\5\5\4\377\202\0\0\0\377\13" \ + "--,\377oy\227\3776Fy\377;J|\377;H|\377;I|\377:I{\3779Iz\3779Hz\377ag" \ + "~\377\6\6\6\377\202\0\0\0\377\2kp\201\377\34-j\377\203\26(e\377\13\26" \ + "(d\377\24%b\377Wa\201\377\20\17\16\377\0\0\0\377\21\20\16\377t{\227\377" \ + "3Bv\3777Fy\377BQ\202\377TWb\377\202\0\0\0\377\2\13\13\13\377\36\36\40" \ + "\377\202\36\37\40\377\6\36\37!\377%&(\377$%'\377:;>\377`l\224\377TV_" \ + "\377\202\0\0\0\377\2\15\15\15\377\35\36\37\377\202\36\36\37\377\1\36" \ + "\36\40\377\202%%'\377\3IKO\377>L~\377XZ`\377\202\0\0\0\377\12SU\\\377" \ + "4Cw\377.>t\377~\205\233\377\5\4\3\377\0\0\0\377\12\12\12\377\\d\202\377" \ + "t\377x}\222\377\3\3\1\377\0\0\0\377\34\34\34\377_i\212\3774Br\377" \ + "3Br\377Vb\214\377^i\221\377_i\220\377Wb\213\377JW\205\377^h\215\377\34" \ + "\34\35\377\202\0\0\0\377\3\210\215\236\377CQ\204\377y}\207\377\202\0" \ + "\0\0\377\20##%\377py\227\377Vb\211\377Xc\213\377s|\240\377gr\227\377" \ + "Ze\216\377S_\210\377HU\203\377'7p\377;J\177\377Xe\221\377^i\220\377L" \ + "W\177\377fl\201\377457\377\202\0\0\0\377\11VXa\377@N\202\377LY\211\377" \ + "]j\226\377t\177\244\377w\201\241\377cm\215\377pu\204\377//1\377\202\0" \ + "\0\0\377\12~\201\215\377;J}\377:I{\377;H|\377;I|\377:I{\3779Iz\3779H" \ + "z\377ag~\377\6\6\6\377\202\0\0\0\377\2ko\200\377\36/i\377\204\30)d\377" \ + "\12\24&b\377Wa\201\377\20\17\16\377\0\0\0\377\30\27\25\377nw\227\377" \ + "3Bv\3777Fy\377L}\377\26(c\377\30)d\377\203\31*e" \ + "\377\3\30)d\377\35.h\377GT\204\377\204HV\205\377\10IU\205\377IV\205\377" \ + "IW\205\377IV\205\377HW\204\377IW\205\377JW\206\377IW\205\377\202JW\206" \ + "\377\5JV\206\377JW\206\377JX\206\377JW\206\377IX\206\377\202JX\206\377" \ + "\202KX\206\377\5KX\205\377KX\206\377KW\206\377KW\207\377KX\206\377\202" \ + "JY\207\377\2KX\207\377KY\207\377\202LY\207\377\1KY\207\377\223LY\207" \ + "\377\1KY\207\377\202LY\207\377\10KY\207\377KX\207\377KY\207\377JY\207" \ + "\377KX\207\377KW\206\377KW\207\377KX\206\377\202KX\205\377\202KX\206" \ + "\377\1JX\206\377\202IX\206\377\3JX\206\377JW\206\377JV\206\377\203JW" \ + "\206\377\203IW\205\377\4IV\205\377IW\205\377IV\205\377IU\205\377\202" \ + "HV\205\377\10GV\205\377IV\205\3776Dx\377\27(d\377\30*e\377\31*e\377S" \ + "]\202\377\4\4\4\377\202\0\0\0\377\6\13\13\13\377ks\215\377ES\203\377" \ + "ER\203\377\\h\222\377DDF\377\203\0\0\0\377\13ps\177\377MZ\212\377ES\203" \ + "\377BP\201\377u\200\242\377\36\36\33\377\0\0\0\377\5\4\4\377hn\205\377" \ + "CQ\201\377px\221\377\203\0\0\0\377\7\206\215\243\377BO\200\377=K}\377" \ + "\31*e\377\32+e\377]f\204\377...\377\202\0\0\0\377\2\31\30\30\377\27\27" \ + "\27\377\202\0\0\0\377\5@AB\377nv\225\377@N\177\377_h\215\377\30\31\32" \ + "\377\202\0\0\0\377\5\210\215\236\377;J}\377FT\203\377qx\215\377\31\31" \ + "\31\377\202\0\0\0\377\2\36\36\37\377\21\21\20\377\202\0\0\0\377\31UV" \ + "X\377fp\225\377#2l\377ip\207\377\21\20\16\377\0\0\0\377\1\1\1\377\"#" \ + "%\377'(+\377\5\5\5\377\0\0\0\377EEF\377\\g\214\377:I}\377w{\207\377\7" \ + "\6\3\377\0\0\0\377\2\2\2\377'')\377%&(\377\3\3\3\377\0\0\0\377PQS\377" \ + "\\h\217\3778Gz\377\203;I|\377\5""9Iz\377:I{\3779Hz\377`f}\377\2\2\1\377" \ + "\202\0\0\0\377\2jo\177\377\36/j\377\204\31*e\377\14\24&b\377Wa\200\377" \ + "\14\13\12\377\0\0\0\377\27\26\24\377lv\227\3773Bv\3776Fy\3776Ex\377;" \ + "I|\377mu\220\377(((\377\202\0\0\0\377\2\35\35\36\377\24\24\24\377\202" \ + "\0\0\0\377\6HHH\377]h\217\377\25&b\377\37""0j\377bh\202\377\31\31\30" \ + "\377\202\0\0\0\377\2\35\36\36\377\22\21\21\377\202\0\0\0\377\5SSW\377" \ + "HT\201\377\30)d\3770\77r\377RTY\377\204\0\0\0\377\11VY_\377122\377\0" \ + "\0\0\377\6\6\6\377\\e\203\3770\77t\377\77M\177\377uy\205\377\20\20\15" \ + "\377\202\0\0\0\377\1\2\2\1\377\202\0\0\0\377\5///\377ck\205\377\32+f" \ + "\377$4m\377QVc\377\202\0\0\0\377\4&&'\377FS\201\377\25&c\377Y^p\377\202" \ + "\0\0\0\377\4""667\377DR\204\377%6n\377\212\216\235\377\202\0\0\0\377" \ + "\6\32\33\34\377LX\202\377+;q\377,\377" \ + "\207\214\237\377BP\201\377ES\203\377BP\201\377r}\240\377RQQ\377AAC\377" \ + "FFG\377qw\217\377BQ\201\377px\222\377BCE\377ABD\377\77\77A\377\200\207" \ + "\236\377CP\201\377&7n\377\202\30)d\377\77\27(d\377mu\224\377fis\377B" \ + "CF\377$%&\377#$%\37778:\377wy\204\377nz\235\377>L}\377@N\177\377_i\216" \ + "\377QQU\377ABD\377@@A\377\206\213\235\377;K|\377@N\177\377ES\203\377" \ + "\203\212\237\377egp\377\77@B\377\40\40!\377&'(\377<>@\377|\200\215\377" \ + "\\g\221\3779Gz\377\36.h\377\35.h\377s{\225\377QSX\377-./\377\37\40!\377" \ + "((*\377DDH\377dgs\377LY\204\377\30)d\377=K}\377DR\202\377\206\213\236" \ + "\377LMQ\377-./\377\37\37\40\377--/\377HIM\377qu\177\377bm\224\377:I{" \ + "\377;J|\377;I|\377:I{\377;I|\3779Iz\377:I{\3779Hz\377jq\211\377CDF\377" \ + "@@C\377<<>\377qu\206\377\35.i\377\204\31*e\377\7\24&b\377[e\206\377H" \ + "HI\377\77@C\377NNN\377lv\227\3773Bv\377\2037Fy\377D8Fz\377w\177\232\377" \ + "gjs\377BCE\377\"\"#\377%&'\37799;\377tw\204\377]i\221\377%5m\377\30)" \ + "d\377\31*e\377\36/i\377u|\225\377^ak\377==@\377\40\40!\377&'(\377;<>" \ + "\377sw\210\377;I|\377\25&b\377\31*e\377\27(d\377KX\206\377iks\377../" \ + "\377113\377ehq\377y\204\247\377Z[\\\377@@B\377FGI\377`i\210\3770\77t" \ + "\377/\77t\377:I|\377z\201\233\377PRW\377./0\377!\"#\3779:<\377fhr\377" \ + "[f\216\377\27(d\377\30)d\377\"3l\377bfu\377=>@\377>\77A\377STW\377BO" \ + "}\377\25'c\377fl\177\377BCE\377\77@B\377]^`\377GU\205\377%6n\377\207" \ + "\214\234\377;<=\377@AC\377QRU\377KX\202\377+;q\377,M~\377@N\177\377\77M~\377>M\177\377M[\212\377Zf\222\377cn\223\377`k" \ + "\223\377[g\222\377CQ\203\377=K|\3775Dx\377\30)e\377\30)d\377\25&c\377" \ + "1@w\377\77M}\377FR\200\377BP~\3775Dz\377%6o\377\26'c\377'7o\377>L}\377" \ + "L~\3770\77t\3771@u\377" \ + "0\77t\3770\77u\3775E{\377\77M~\377ER\177\3779H|\377'7q\377\25&b\377\30" \ + ")d\377\31*e\377\32+f\377/\77u\377\2026F{\377\4""4Dz\377!2j\377\30)d\377" \ + "/>u\377\2026F{\377\14""4Dz\377/>s\377+;q\377CR\201\377IV\207\377HU\207" \ + "\377HU\206\3773Cw\377+;q\377,s\377HV\204\377\202FT\203" \ + "\377\4FS\203\377FT\203\377ET\202\377FT\203\377\203ES\202\377\202ER\202" \ + "\377\11ES\203\377DS\203\377ES\202\377DR\203\377DS\201\377DR\201\377D" \ + "Q\201\377CQ\201\377DR\202\377\203CQ\201\377\4CR\202\377DQ\201\377%4m" \ + "\377\30)d\377\203\31*e\377\204\30)d\377\2""1Au\377BP\200\377\202AO\177" \ + "\377\2AO\200\377@N\200\377\203@N\177\377\5AN\200\377\77N~\377@N\177\377" \ + "@M\177\377@N\177\377\202\77M~\377\1@N~\377\204>L~\377\4\77M~\377'6n\377" \ + "\30)d\377\31*e\377\207\30)d\377\2\26'c\377:Iz\377\202=K}\377\203;J|\377" \ + "\204;I{\377\5:J|\377;J|\377;I|\377;H|\377;I|\377\204:I{\377\1'7n\377" \ + "\205\30)d\377\205\31*e\377\202\30)d\377\20%5l\3779Gz\3778Ex\3776Fy\377" \ + "7Fy\3777Ey\3777Fy\3777Dy\3776Dx\3775Dx\3775Dy\3775Dx\3775Ew\3775Dw\377" \ + "5Dx\3774Cw\377\202\30)d\377\202\31*e\377\210\30)d\377\202\31*e\377\4" \ + "\30)d\377\35.h\3773Bv\3771Bu\377\2031@u\377\4""1@v\3771@u\3771@t\377" \ + "0\77t\377\2031@u\377\2/>s\377\33,f\377\205\30)d\377\202\31*e\377\206" \ + "\30)d\377\1\31*e\377\203\30)d\377\4\27(d\377,L}\377AO\177\377AO\200\377BP\200\377@N\200" \ + "\377\204AO\200\377\4@O\177\377\77N~\377@N\177\377@M\177\377\203@N\177" \ + "\377\2\77M\177\377>L\177\377\202\77M\177\377\2\77M}\377>L}\377\202\30" \ + ")d\377\207\31*e\377\11\30)d\377!2j\377>K}\377=J|\377s\377CP\200\377AO\177\377BP\200\377AO\200\377@N\200\377\204A" \ + "O\200\377\3@N\177\377\77O~\377@M\177\377\203@N\177\377\202\77M\177\377" \ + "\6>L\177\377\77M~\377\77M\177\377>L~\3777Ex\377\32+e\377\210\31*e\377" \ + "\2\30)d\377\40""1j\377\202=K}\377\3" \ + "L}\377AO\177\377BP\200\377\202AO\200\377\1@N\200\377\202AO\200\377\3" \ + "@O\177\377AO\200\377\77O~\377\206@N\177\377\1>L\177\377\202\77M\177\377" \ + "\202\77M~\377\2-=s\377\30)d\377\210\31*e\377\3\27(d\3770>t\377=K}\377" \ + "\202L\177\377\77M\177\377" \ + "\77M~\377>L~\377@M~\377\37/i\377\30)d\377\207\31*e\377\2\30)d\377\31" \ + "*e\377\202=K}\377\5L~\377\77M~\3775Dx\377\26(c\377\210" \ + "\31*e\377\11\30)d\377(9o\377>K}\377=K}\377s\3778Fy\3777Fy\3776Fy\377\2027Fy\377\2""7Ey\3776" \ + "Dy\377\2026Ey\377\10""6Ex\3776Ew\3776Ex\3776Dx\3775Dx\3775Cw\377\30(" \ + "d\377\30)d\377\214\31*e\377\5\30)d\377\27(d\3772Au\3772Bv\3772@v\377" \ + "\2032Av\377\3""2Au\3771@u\3770\77u\377\2021@u\377\4""0\77t\3772Au\377" \ + "\36/h\377\30)d\377\220\31*e\377\5\30)d\377\37/i\377-=r\377-L\177\377\77M\177\377\202\77M~\377\1""2Au\377\212\31*e\377\17" \ + "\37/i\377:I{\377=J|\377L\177\377\202\77M\177\377\4>L~\377>L}\377#3k\377\30)d" \ + "\377\210\31*e\377\2\30)d\377(8n\377\202=K}\377\3L\177\377\77M\177\377\202\77M~\377\3""9Gz\377" \ + "\27)d\377\30)d\377\207\31*e\377\4\31)d\377\27(d\377:I{\377=K}\377\203" \ + "s\3771Bv\377\2042Av\377" \ + "\3""2Au\3772At\3770\77u\377\2041@u\377\1(8o\377\221\31*e\377\6\30)d\377" \ + "\32+f\377.=s\377-=r\377-L~\377=J|\377t\377\32+e\377\216\31*e\377\3\35-g\377" \ + "1@u\3771Av\377\2042Av\377\3""2Au\3771@t\3770\77u\377\2031@u\377\3""0" \ + "\77t\377#3k\377\30)d\377\220\31*e\377\5\30)d\377\40""0j\377-=s\377-=" \ + "q\377-;r\377\202-t\377\26'b\377\30)d\377\205\31*e\377\10" \ + "\30)d\377\27(d\377\37""0i\377/\77t\377GU\204\377IW\206\377HV\205\377" \ + "GV\205\377\203HV\205\377\3IV\205\377HV\205\377IV\205\377\202IU\205\377" \ + "\204IV\205\377\205IW\205\377\1IV\205\377\215IW\205\377\204IV\205\377" \ + "\202IU\205\377\2IV\205\377HV\205\377\202IV\205\377\202HV\205\377\10G" \ + "U\204\377HV\205\377JX\206\377>L~\377'7n\377\32+f\377\27)d\377\30)e\377" \ + "\205\31*e\377\6\30)d\377\34-g\377L\177\377\77M~\377\77" \ + "M\177\377\77M~\3775Cw\377\27)d\377\210\31*e\377\3\30)d\377\32+f\377:" \ + "H{\377\202=K}\377\4;K}\377L\177\377\202\77M\177\377\4>L~\377>L}\377#3l\377" \ + "\30)d\377\210\31*e\377\4\30)d\377'7n\377s\3778Fy\3777Fy\3776Fy\377\2027Fy\377\14""7Ey\3777Dy\3776Ey\3776Ex" \ + "\3776Ey\3776Ew\3776Dx\3775Dx\3776Cw\3775Dx\377\37/i\377\30)d\377\215" \ + "\31*e\377\11\30)d\377(8o\3772Bv\3772Av\3772@v\3772Av\3772Au\3772Av\377" \ + "2At\377\2051@u\377\3/>t\377\27)d\377\30)d\377\221\31*e\377\2*:q\377," \ + "=q\377\202-L\177\377\203\77M~\377\2""9Gz\377\32" \ + "*e\377\211\31*e\377\2\30)d\3776Ex\377\202=K}\377\4L~\377%5m\377\202\31*e\377\202" \ + "\30)d\377\206\31*e\377\4\30)d\377\27(d\377-=r\377FT\204\377\202GU\204" \ + "\377\2FU\203\377GT\204\377\202FS\203\377\202ET\202\377\202FT\203\377" \ + "\10FS\203\377FT\203\377FS\203\377FR\203\377ES\203\377FS\203\377ES\203" \ + "\377DS\203\377\202ES\203\377\4ES\202\377ES\201\377DR\202\377EQ\202\377" \ + "\202CR\202\377\204DR\202\377\5DQ\201\377DP\200\377DR\202\377\36/h\377" \ + "\30)d\377\207\31*e\377\7\31*d\3776Ey\377BP\200\377AO\177\377BP\200\377" \ + "AO\200\377@N\200\377\204AO\200\377\4@O\177\377\77N~\377\77O~\377@M\177" \ + "\377\203@N\177\377\3\77M\177\377@N\177\377>L\177\377\202\77M\177\377" \ + "\4>L}\377@N~\377'7n\377\30)d\377\210\31*e\377\11\30)d\377#3l\377>L~\377" \ + "=K}\377M~\377HV\205\377" \ + "FT\203\377FU\203\377GT\204\377FT\203\377FS\203\377FT\203\377ET\202\377" \ + "\203FT\203\377\203FS\203\377\14FR\203\377ES\203\377FS\203\377ES\203\377" \ + "DS\203\377ES\202\377ES\203\377ES\202\377ES\201\377ER\202\377DQ\202\377" \ + "CR\202\377\204DR\202\377\6DQ\201\377DR\202\377DQ\201\377BO\200\377$4" \ + "l\377\27(d\377\207\31*e\377\10\27)d\377)8o\377BP\200\377AO\177\377AO" \ + "\200\377BP\200\377AO\200\377@N\200\377\202AO\200\377\5@O\177\377AO\200" \ + "\377@O\177\377\77N~\377@M\177\377\204@N\177\377\204\77M\177\377\202\77" \ + "M~\377\2""6Ex\377\26'c\377\210\31*e\377\202\30)d\377\1""9H{\377\202=" \ + "K}\377\2s\377\30)d\377\221\31*e\377\7\30)d\377" \ + "\"2k\377-=r\377-L~\3774Cw\377&6n\377\35-g\377\33+f\377" \ + "\30*d\377\203\30)d\377\207\31*e\377\10\30)d\377\26'c\377$5l\377\77N\177" \ + "\377FS\203\377GU\204\377FT\203\377GU\204\377\202GT\204\377\3GS\204\377" \ + "FT\203\377ET\202\377\205FT\203\377\6FS\203\377FR\203\377ES\203\377FS" \ + "\203\377ES\203\377DS\203\377\202ES\203\377\4ER\202\377ER\201\377DR\202" \ + "\377EQ\202\377\202CR\202\377\205DR\202\377\4CQ\201\377DQ\201\377(8o\377" \ + "\30)d\377\207\31*e\377\2\30)d\377\37/i\377\204BP\200\377\2AO\200\377" \ + "@N\200\377\204AO\200\377\4@O\177\377\77O~\377@N\177\377@M\177\377\203" \ + "@N\177\377\202\77M\177\377\7>L\177\377\77M~\377\77M\177\377>L~\377=K" \ + "}\377\36/h\377\30)d\377\210\31*e\377\6\30)d\377&6n\377=K}\377s\3772Bv\3775Dw\3778Fy\377;J{\377=K}\377=L}\377L~\377B" \ + "P\177\377\202BP\200\377\2AO\200\377@N\200\377\203AO\200\377\203@O\177" \ + "\377\2@N\177\377@M\177\377\203@N\177\377\3\77M\177\377@N\177\377>L\177" \ + "\377\202\77M\177\377\4>L~\377\77M~\377/\77s\377\30)d\377\212\31*e\377" \ + "\7""5Cw\377s\377-=r\377-s\377\77M~\377FT\203\377GU\204\377FT\203\377GU\204\377GT\204\377" \ + "FT\203\377GS\204\377FS\203\377FT\203\377ET\202\377\205FT\203\377\2FS" \ + "\203\377FR\203\377\202FS\203\377\1ES\203\377\202DS\203\377\2ES\203\377" \ + "ES\202\377\202ER\201\377\1DQ\202\377\210DR\202\377\4CQ\201\377DQ\201" \ + "\377.=s\377\30)d\377\210\31*e\377\4\27(d\3772Bv\377BP\200\377AO\177\377" \ + "\210AO\200\377\3@N\177\377\77O~\377@M\177\377\205@N\177\377\10\77M\177" \ + "\377>L\177\377\77M~\377\77M\177\377\77M~\377=K|\377\31*e\377\30)d\377" \ + "\210\31*e\377\2\30)d\377\40""0i\377\202=K}\377\203L\177\377\77" \ + "M~\377\77M\177\377\77M}\377@N~\377\"2k\377\30)d\377\210\31*e\377\3\30" \ + ")d\377\27(d\3775Dx\377\202=K}\377\3s\377#3k\377\30)d\377\26'c\377\27)d\377\30)d\377\233" \ + "\31*e\377\10\30)d\377\27(c\377\26'c\377\33,g\377(8o\3774Cw\377\77N\177" \ + "\377HV\204\377\202GU\204\377\10FU\203\377GU\204\377GT\204\377FT\203\377" \ + "GS\204\377FS\203\377FT\203\377ET\202\377\203FT\203\377\2FS\203\377FT" \ + "\203\377\202FS\203\377\2FR\203\377FS\203\377\202ES\203\377\202DS\203" \ + "\377\6ES\202\377ES\203\377ER\202\377ES\201\377DR\202\377EQ\202\377\210" \ + "DR\202\377\3CQ\201\377DQ\201\3774Cw\377\202\30)d\377\207\31*e\377\2\30" \ + ")d\377$4l\377\202AO\177\377\202BP\200\377\2AO\200\377@N\200\377\204A" \ + "O\200\377\1@O\177\377\202@N\177\377\1@M\177\377\203@N\177\377\5\77M\177" \ + "\377@N\177\377\77M\177\377>L\177\377\77M\177\377\202\77M~\377\1""3Bv" \ + "\377\212\31*e\377\6\30)d\377(7o\377>L}\377=J|\377t\377\77M\177\377HV\204\377\202GU\204\377\10FT\203\377G" \ + "U\204\377GT\204\377FT\203\377GT\204\377GS\204\377FT\203\377GT\204\377" \ + "\202ET\202\377\203FT\203\377\1FS\203\377\202FT\203\377\2FS\203\377FR" \ + "\203\377\202FS\203\377\202ES\203\377\2DS\203\377ES\202\377\202ES\203" \ + "\377\202ES\201\377\202EQ\202\377\2DR\202\377CR\202\377\204DR\202\377" \ + "\2DQ\201\377DR\202\377\202DQ\201\377\2""8Fy\377\32*e\377\207\31*e\377" \ + "\202\30)d\377\7\35.g\377@N\177\377BP\200\377AO\200\377BP\200\377AO\200" \ + "\377@N\200\377\203AO\200\377\5@O\177\377AO\200\377@O\177\377\77O~\377" \ + "@M\177\377\205@N\177\377\202\77M\177\377\6\77M~\377>M~\377\77M}\377>" \ + "L}\377\40""0i\377\30)d\377\210\31*e\377\11\30)d\377\34-g\3778Gz\377<" \ + "J|\377=K}\377;K}\377L~\3777Fy\377" \ + "2Au\377,;r\377'6n\377!2j\377\34-g\377\31*e\377\27(d\377\203\26'c\377" \ + "\2\26(c\377\27(c\377\203\26'c\377\16\27'c\377\30)d\377\32+e\377\36/h" \ + "\377#4l\377)9o\377.=s\3774Cw\377:I{\377BP\201\377JW\206\377HV\205\377" \ + "GU\204\377FT\203\377\202GU\204\377\5GT\204\377FT\203\377GT\204\377GS" \ + "\204\377FS\203\377\202FT\203\377\1ET\202\377\206FT\203\377\202FS\203" \ + "\377\2FR\203\377ES\203\377\202FS\203\377\5ES\203\377DS\203\377ES\202" \ + "\377ES\203\377ER\202\377\202ES\202\377\4DR\202\377ER\202\377DR\202\377" \ + "CR\202\377\204DR\202\377\5DQ\201\377DR\202\377CQ\201\377DQ\201\3771A" \ + "v\377\202\30)d\377\207\31*e\377\10\30)d\377\37/i\377\77M~\377BP\200\377" \ + "AO\177\377BP\200\377AO\200\377@N\200\377\203AO\200\377\4@O\177\377AO" \ + "\200\377@O\177\377\77O~\377\205@N\177\377\203\77M\177\377\6\77M~\377" \ + "\77M\177\377>L~\377@N\177\377-t\3778Ex\3777Fy\3776Fy\377\2027Fy\377\202" \ + "7Ey\377\12""6Ey\3775Ey\3776Ey\3776Ex\3776Ew\3776Dx\3775Dx\3776Dx\377" \ + "(7o\377\30)d\377\215\31*e\377\202\30)d\377\3""1@u\3771Bv\3772@v\377\203" \ + "2Av\377\4""2Au\3771@t\3771@u\3770\77u\377\2031@u\377\2,t\377\31*e\377\30)d\377\210\31*e\377\7\33,f\377<" \ + "J|\377BP\200\377AO\177\377BP\200\377AO\200\377@N\200\377\205AO\200\377" \ + "\4@O\177\377\77N~\377@N\177\377@M\177\377\205@N\177\377\202>L\177\377" \ + "\1\77M\177\377\202\77M~\377\3""8Gz\377\31*e\377\30)d\377\210\31*e\377" \ + "\10\30)d\377\37/i\377>L}\377=K}\377L\177\377\202" \ + "\77M~\377\4>L~\377>L}\377#3k\377\30)d\377\212\31*e\377\1""7Fy\377\202" \ + "=K}\377\5L\177\377\202\77M\177\377\4>L" \ + "~\377@N~\377-=r\377\30)d\377\211\31*e\377\2\30)d\377'7n\377\202s\377\30)d\377" \ + "\213\31*e\377\6\30)d\377\33,g\3778Fz\3778Fx\3777Fy\3776Fy\377\2027Fy" \ + "\377\14""7Ey\3776Dy\3776Ey\3776Ex\3776Ey\3776Ew\3776Dx\3776Ex\3776Cx" \ + "\3776Dx\377%6m\377\30)d\377\216\31*e\377\12\32+f\377/>t\3771Bu\3772A" \ + "v\3772@v\3772Av\3772Au\3771@u\3772At\3770\77u\377\2031@u\377\2""0\77" \ + "t\377-L\177\377\202\77M\177\377\202\77M~\377\2""5Dx\377\26'c\377\211" \ + "\31*e\377\4\30)d\377\32+e\377:I{\377=K}\377\202L\177\377\202\77M~\377\4>L}\377;J|\377\34-g\377" \ + "\30)d\377\210\31*e\377\12\30)e\377\27(c\3772Au\377=K}\377L~\377\202DQ\201\377\3CQ\201\377DR\202\377DQ\201\377\205" \ + "DR\202\377\1CR\202\377\202DR\202\377\6EQ\202\377ER\202\377ER\201\377" \ + "ES\201\377ER\202\377ES\202\377\202ES\203\377\1ES\202\377\202DS\203\377" \ + "\2FS\203\377ES\203\377\202FS\203\377\1ES\203\377\202FR\203\377\204FS" \ + "\203\377\242FT\203\377\203FS\203\377\202FR\203\377\3FS\203\377ES\203" \ + "\377FS\203\377\203ES\203\377\12DS\203\377ES\203\377ES\202\377ES\203\377" \ + "ES\202\377ER\202\377ES\201\377ER\201\377DR\202\377EQ\202\377\202DR\202" \ + "\377\1CR\202\377\205DR\202\377\10DQ\201\377DR\202\377CR\202\377DQ\201" \ + "\377CQ\201\3771@t\377\26'c\377\30)d\377\210\31*e\377\4\30)d\377\32+e" \ + "\3776Ex\377BP\200\377\202AO\200\377\1BP\200\377\207AO\200\377\2AN\200" \ + "\377\77O~\377\205@N\177\377\2\77M\177\377@N\177\377\202\77M\177\377\6" \ + "\77M~\377\77M\177\377\77M}\377\77M~\377$5l\377\30)d\377\211\31*e\377" \ + "\2\30)d\377#3l\377\202L\177\377\77M~\377\77M\177\377\77M" \ + "~\377@M~\377+;q\377\27(c\377\212\31*e\377\2\30)d\3775Ex\377\202=K}\377" \ + "\203L\177\377\202\77M\177\377\5\77M~\377>L}\377" \ + "5Cw\377\31*e\377\30)d\377\211\31*e\377\3\27(d\377,K}\377\202<" \ + "K}\377\4;K}\377L~\377\77M~\377=K|\377" \ + "\35.h\377\30)d\377\211\31*e\377\7\30)d\377$4l\377>L~\377t\377\26(c\377\216\31*e\377\3\30)" \ + "d\377\40""0i\3772Bv\377\2052Av\377\3""2Au\3771@t\3770\77u\377\2041@u" \ + "\377\1(7o\377\222\31*e\377\7\30)d\377\40""0i\377-=s\377-L\177\377\77M~\377\77M\177\377\77M~\377@N~\377\40""1j\377\30)d\377\212" \ + "\31*e\377\2\33,f\3779H{\377\202=K}\377\2L\177\377\77M\177\377\77M" \ + "~\377\77M\177\377>L~\377\77M~\377*:p\377\30)d\377\211\31*e\377\202\30" \ + ")d\377\1""4Bw\377\202=K}\377\5t\377\32*e\377\216\31*e\377" \ + "\5\30)d\377\34,g\3774Cw\3771Bu\3772@v\377\2032Av\377\2""2Au\3771@t\377" \ + "\2051@u\377\1.=s\377\202\30)d\377\220\31*e\377\6\30)d\377\33,f\377.>" \ + "s\377,=q\377-;r\377-L\177" \ + "\377\77M~\377\77M\177\377>L~\377AO\177\377,s\377=K}\377L}\377\40""1j\377\30)d\377\212\31*e\377\202\30)d\377\10!1j\377@" \ + "N\200\377BP\200\377AO\177\377AO\200\377BP\200\377AO\200\377@N\200\377" \ + "\206AO\200\377\4@O\177\377\77O~\377@O\177\377@M\177\377\206@N\177\377" \ + "\10>L\177\377\77M\177\377\77M~\377\77M\177\377>L~\377\77M~\377/\77t\377" \ + "\27(d\377\212\31*e\377\2\30)d\377\"3k\377\202L~\377@M~\3774Cw\377\213" \ + "\31*e\377\3\30)d\377\33,f\377:H{\377\202=K}\377\5L\177\377\77M\177\377\77M~\377\77M\177\377" \ + ">L~\377\77M~\3777Fy\377\27(d\377\30)d\377\211\31*e\377\202\30)d\377\1" \ + "7Fy\377\202=K}\377\2s\377" \ + "\217\31*e\377\202\30)d\377\10""0@u\3772Bv\3772Av\3772@v\3772Av\3772A" \ + "u\3771@u\3772At\377\2041@u\377\2020\77t\377\2\37""0i\377\30)d\377\221" \ + "\31*e\377\7\30)d\377$4l\377-=r\377-L~\377\77M~\3778Gz\377" \ + "\32+f\377\30)d\377\212\31*e\377\7\30)d\377+:q\377=K}\377L\177\377\7\77M\177\377\77" \ + "M~\377>L\177\377\77M~\377=L}\377\33,f\377\30)d\377\212\31*e\377\3\30" \ + ")d\377!1j\377=L}\377\202=K}\377\202L~\377\77M}\377;J|\377\35-h\377\30)d\377\212\31*e\377\12" \ + "\30)d\377!1j\377=K}\377=J|\377=K}\377L\177\377\77M~\377\77M\177\377>L~\377\77M" \ + "~\377=L~\377\37""0i\377\30)d\377\212\31*e\377\7\30)d\377\34-g\377:H{" \ + "\377=K}\377=J|\377L}\377" \ + "AO\177\377\207DQ\201\377\240DR\202\377\2DQ\201\377CQ\201\377\203DQ\201" \ + "\377\10CP\200\377@M~\377=K}\3772Av\377\40""1i\377\27(c\377\30)d\377\31" \ + "*d\377\215\31*e\377\202\30)d\377\7\34,g\3772@u\377CQ\201\377AO\177\377" \ + "BP\200\377AO\200\377BP\200\377\202AO\200\377\1@N\200\377\207AO\200\377" \ + "\4@N\177\377\77O~\377@N\177\377@M\177\377\206@N\177\377\12\77M\177\377" \ + ">L\177\377\77M\177\377\77M~\377\77M\177\377>L~\377\77M~\377:I{\377\34" \ + ",g\377\30)d\377\212\31*e\377\3\30)d\377\33,f\377:I{\377\202=K}\377\5" \ + "s\377\33,f\377\222\31*e\377\10\30)d\377#3l\377-=r" \ + "\377-M}\377FS\202\377ER\201\377DQ\201\377DQ\200\377CQ\201\377\203" \ + "DQ\201\377\227DR\202\377\203DQ\201\377\1CQ\201\377\202DQ\201\377\10F" \ + "R\202\377DR\201\3779G{\377-L\177\377\77M~\377\77" \ + "M\177\377>L~\377\77M~\3778Gz\377\34-g\377\30)d\377\213\31*e\377\17\32" \ + "+f\3777Ey\377=K}\377L~\377" \ + "#3k\377\32*e\377\202\30)d\377\220\31*e\377\202\30)d\377\7\27(d\377\34" \ + "-g\377+;q\3778Fy\377\77M\177\377BO\177\377BO\200\377\202CP\200\377\204" \ + "DQ\201\377\2DQ\200\377DP\200\377\203DQ\201\377\1CQ\201\377\202DQ\201" \ + "\377\1CQ\201\377\204DQ\201\377\2DP\200\377DQ\200\377\204DQ\201\377\2" \ + "CP\200\377BP\200\377\202BO\177\377\5=K}\3774Bv\377&6m\377\30)d\377\27" \ + ")d\377\202\30)d\377\220\31*e\377\4\30)d\377\31*e\377\32+f\3770\77t\377" \ + "\202BP\200\377\2AO\177\377AO\200\377\202BP\200\377\210AO\200\377\202" \ + "@O\177\377\3@N\177\377\77O~\377@O\177\377\202@M\177\377\204@N\177\377" \ + "\202\77M\177\377\10@N\177\377>L\177\377\77M\177\377\77M~\377\77M\177" \ + "\377>L~\377\77M~\3777Fy\377\202\30)d\377\212\31*e\377\202\30)d\377\1" \ + "4Cw\377\203=K}\377\5;K}\377L}\377@M~\377AO\177\377CP\201\377ER\202\377\205" \ + "FS\202\377\17DQ\202\377BP\200\377AN\177\377\77L~\377=K}\377;I{\3777F" \ + "y\3772Au\377,;r\377'8o\377\"3k\377\36/h\377\31*e\377\26'c\377\27(c\377" \ + "\202\30)d\377\221\31*e\377\6\30)d\377\26'c\377\40""1j\3771@u\377@N\177" \ + "\377CQ\200\377\202BP\200\377\2AO\200\377BP\200\377\202AO\200\377\202" \ + "@N\200\377\204AO\200\377\1@O\177\377\202AO\200\377\2@N\177\377\77O~\377" \ + "\207@N\177\377\14\77M\177\377@N\177\377\77M\177\377>L\177\377\77M\177" \ + "\377\77M~\377\77M\177\377>L~\377@N\177\3772Av\377\32+e\377\30)d\377\214" \ + "\31*e\377\11""2Av\377>L}\377L\177\377\77M\177\377\77" \ + "M~\377\77M\177\377>M~\377@M~\377.>s\377\27)d\377\30)d\377\213\31*e\377" \ + "\5\30)d\377.=s\377=K}\377K}\377.>s\377" \ + "#3k\377\32*e\377\27(d\377\30)d\377\235\31*e\377\205\30)d\377\234\31*" \ + "e\377\13\31*d\377\30)d\377\27(d\377\36.h\377'7n\3775Dw\377CP\201\377" \ + "BP\200\377AO\177\377BP\200\377AO\200\377\202BP\200\377\212AO\200\377" \ + "\202@O\177\377\2\77O~\377@N\177\377\202@M\177\377\204@N\177\377\2\77" \ + "M\177\377@N\177\377\202\77M\177\377\10>L\177\377\77M~\377\77M\177\377" \ + ">L~\377\77M~\377@M~\377,L~\377s\377\30" \ + ")d\377\215\31*e\377\4\30)d\377(7o\3777Ey\3777Fx\377\2047Fy\377\2027E" \ + "y\377\13""6Ey\3775Ey\3776Ey\3776Ex\3776Ew\3776Ex\3775Dx\3776Cw\3775D" \ + "x\377$4l\377\30)d\377\216\31*e\377\202\30)d\377\12/\77t\3772Bv\3772A" \ + "v\3772@v\3772Av\3772Au\3772Av\3772At\3771@u\3770\77u\377\2041@u\377\1" \ + ")9p\377\224\31*e\377\3&6n\377-=r\377-L\177\377\202\77M\177\377\202\77M~\377\2@N~\377&6m\377\202\30)d\377" \ + "\213\31*e\377\12\30)d\377+:p\377L~\377" \ + "CQ\201\377BP\200\377BP\177\377\204BP\200\377\202AO\200\377\1@N\200\377" \ + "\206AO\200\377\1@O\177\377\202AO\200\377\5@N\177\377@O\177\377\77N~\377" \ + "@N\177\377@M\177\377\207@N\177\377\202\77M\177\377\1>L\177\377\202\77" \ + "M\177\377\203\77M~\377\3:Hz\377\"2k\377\30)d\377\213\31*e\377\5\30)d" \ + "\377\31*e\377*9p\377>L~\377=K}\377\203L}\3778Gz" \ + "\377-L\177\377\77M\177" \ + "\377\202\77M~\377\4>L}\377@M~\3771@u\377\34-g\377\202\30)d\377\213\31" \ + "*e\377\13\30*e\3770@u\377=K}\377L\177\377\202\77M\177\377\6\77M~\377>L~\377" \ + "\77M~\377>L}\377,K}\377\202=K}\377\4;K}\377s\3776Ex\377=K}\377" \ + "\202CQ\200\377\204BP\200\377\1AO\200\377\203BP\200\377\202AO\200\377" \ + "\202@N\200\377\212AO\200\377\4@N\177\377@O\177\377\77O~\377@N\177\377" \ + "\202@M\177\377\207@N\177\377\202\77M\177\377\2>L\177\377\77M~\377\202" \ + "\77M\177\377\6>L~\377\77M~\377:H{\377\"2k\377\27(c\377\30)d\377\213\31" \ + "*e\377\14\30)d\377\33,f\3775Cw\377>L}\377s\377\31)e" \ + "\377\30)d\377\214\31*e\377\6\30)d\377\34-g\3776Ey\3778Fy\3777Fy\3776" \ + "Fy\377\2027Fy\377\16""7Ey\3776Ey\3777Dy\3776Ey\3775Ey\3776Ey\3776Ex\377" \ + "6Ew\3776Ex\3776Dx\3775Cx\3776Dx\377\36/h\377\30)d\377\216\31*e\377\202" \ + "\30)d\377\4,;r\3772Bv\3771Bu\3772@v\377\2032Av\377\2""2Au\3771@t\377" \ + "\2041@u\377\4""0\77t\3771@u\377\35-h\377\30)d\377\222\31*e\377\3\32+" \ + "e\377*:q\377,L\177\377\2@N\177\377\77M\177\377\207@N\177\377\202@M\177\377\7@N\177" \ + "\377\77N~\377\77O~\377AN\200\377@O\177\377AO\200\377@O\177\377\210AO" \ + "\200\377\202@N\200\377\3AO\200\377BP\200\377AO\200\377\203BP\200\377" \ + "\1AO\200\377\207BP\200\377\5>K}\3775Dw\377+;p\377#2k\377\32+f\377\225" \ + "\31*e\377\5\35.g\377&6m\377/>t\3778Gz\377@O\177\377\204BP\200\377\1A" \ + "O\177\377\202BP\200\377\1AO\200\377\203BP\200\377\3AO\200\377BP\200\377" \ + "AO\200\377\202@N\200\377\210AO\200\377\2@O\177\377AO\200\377\203@O\177" \ + "\377\1\77O~\377\202@N\177\377\1@M\177\377\210@N\177\377\202\77M\177\377" \ + "\2>L\177\377\77M~\377\202\77M\177\377\6>L~\377\77M}\377\77M~\3775Dx\377" \ + "\31*e\377\30)d\377\213\31*e\377\202\30)d\377\2\32+e\3779Gz\377\203=K" \ + "}\377\4;K}\377L\177\377\77M\177\377\202@N\177\377\1\77M\177\377\206@N\177\377" \ + "\1@M\177\377\202@N\177\377\1\77O~\377\202@O\177\377\202AO\200\377\1@" \ + "O\177\377\210AO\200\377\202@N\200\377\204AO\200\377\212BP\200\377\33" \ + "CQ\201\377DQ\201\377DR\201\377\77M~\377=K|\377:I{\3779Hz\3777Fy\3775" \ + "Dx\3774Cv\3772Au\3770\77t\377.>s\377-=r\377/\77s\3771@t\3772Bv\3774C" \ + "w\3776Ex\3778Gy\3779H{\377;J|\377=K}\377AO\177\377DR\201\377CQ\201\377" \ + "CQ\200\377\212BP\200\377\204AO\200\377\202@N\200\377\213AO\200\377\5" \ + "@O\177\377@N\177\377\77O~\377\77N~\377@N\177\377\202@M\177\377\206@N" \ + "\177\377\3\77M\177\377@N\177\377\77M\177\377\202>L\177\377\202\77M\177" \ + "\377\7\77M~\377>L~\377\77M~\377>M~\377*:p\377\27(d\377\30)d\377\214\31" \ + "*e\377\5\30)d\377\37/i\3779Hz\377=K}\377L\177\377\202\77M\177\377\2@N\177\377\77" \ + "M\177\377\206@N\177\377\202@M\177\377\5@N\177\377\77N~\377\77O~\377@" \ + "N\177\377@O\177\377\213AO\200\377\203@N\200\377\204AO\200\377\203BP\200" \ + "\377\1AO\200\377\241BP\200\377\1AO\200\377\203BP\200\377\204AO\200\377" \ + "\203@N\200\377\213AO\200\377\2@O\177\377@N\177\377\202\77O~\377\202@" \ + "N\177\377\1@M\177\377\211@N\177\377\1\77M\177\377\202>L\177\377\7\77" \ + "M~\377\77M\177\377\77M~\377>L}\377\77M~\3778Gz\377\35.h\377\202\30)d" \ + "\377\214\31*e\377\6\30)d\377\37/h\377L\177\377\203\77M\177\377\207@N\177\377" \ + "\202@M\177\377\202@N\177\377\1\77O~\377\203@O\177\377\215AO\200\377\203" \ + "@N\200\377\205AO\200\377\207BP\200\377\1AO\200\377\223BP\200\377\204" \ + "AO\200\377\204@N\200\377\213AO\200\377\1@O\177\377\202AO\200\377\202" \ + "@O\177\377\202\77O~\377\1@N\177\377\203@M\177\377\206@N\177\377\2\77" \ + "M\177\377@N\177\377\202\77M\177\377\11>L\177\377\77M\177\377\77M~\377" \ + "\77M\177\377\77M~\377>L}\377\77M~\377;I{\377+;q\377\202\30)d\377\214" \ + "\31*e\377\3\30*d\377\30)d\377$4l\377\202=K}\377\1=J|\377\202s\377\33,f\377\224\31*e\377\4+:p\377,=r\377-L}\377\77M~\377\204\77M\177" \ + "\377\2>L\177\377\77M\177\377\211@N\177\377\203@M\177\377\3@N\177\377" \ + "\77N~\377\77O~\377\203@O\177\377\202AO\200\377\1@O\177\377\213AO\200" \ + "\377\205@N\200\377\207AO\200\377\216BP\200\377\206AO\200\377\205@N\200" \ + "\377\214AO\200\377\1@O\177\377\202AO\200\377\4@O\177\377@N\177\377@O" \ + "\177\377\77N~\377\202@N\177\377\202@M\177\377\206@N\177\377\1\77M\177" \ + "\377\202@N\177\377\202\77M\177\377\1>L\177\377\203\77M\177\377\202\77" \ + "M~\377\3AO\177\3770\77u\377\34-g\377\202\30)d\377\214\31*e\377\6\30)" \ + "d\377\27(d\377/\77t\377L~\377\77M~\377\77M\177\377\77M~\377\77M\177\377>L\177\377\202" \ + "\77M\177\377\202@N\177\377\1\77M\177\377\207@N\177\377\202@M\177\377" \ + "\202@N\177\377\5\77N~\377\77O~\377@O\177\377@N\177\377@O\177\377\226" \ + "AO\200\377\216@N\200\377\222AO\200\377\1@O\177\377\202AO\200\377\202" \ + "@O\177\377\1@N\177\377\202\77O~\377\1\77N~\377\202@N\177\377\1@M\177" \ + "\377\212@N\177\377\202\77M\177\377\1>L\177\377\203\77M\177\377\10\77" \ + "M~\377>L~\377\77M}\377\77M~\3779Hz\377!2k\377\27(c\377\30)d\377\214\31" \ + "*e\377\15\30*d\377\30)d\377\35.h\3776Ex\377=K}\377s\3778Fz" \ + "\3778Ex\3776Fy\377\2027Fy\377\17""7Ey\3777Fy\3777Ey\3776Dy\3775Ey\377" \ + "6Ex\3776Ey\3776Ex\3776Dx\3776Ex\3775Dx\3776Cx\3775Dx\377\37""0j\377\30" \ + ")d\377\217\31*e\377\14\30)d\377\35.g\3772Bu\3771Av\3772Av\3772@v\377" \ + "2Av\3772Au\3772Av\3772Au\3771@u\3770\77u\377\2041@u\377\2-L\177\377\202\77M\177\377\212@N\177\377" \ + "\202@M\177\377\202@N\177\377\4\77N~\377\77O~\377@O\177\377@N\177\377" \ + "\202@O\177\377\202AO\200\377\1@O\177\377\255AO\200\377\1@O\177\377\203" \ + "AO\200\377\3@O\177\377@N\177\377@O\177\377\202\77O~\377\202@N\177\377" \ + "\203@M\177\377\207@N\177\377\2\77M\177\377@N\177\377\202\77M\177\377" \ + "\202>L\177\377\12\77M\177\377\77M~\377\77M\177\377\77M~\377>L~\377\77" \ + "M~\377=K}\377(7n\377\32+f\377\30)d\377\216\31*e\377\10\27(d\377&7n\377" \ + ":H{\377=K}\377L}\377\77M~\377>L}\377\202\77M~\377\2\77M\177\377\77M~\377\202\77M\177" \ + "\377\1>L\177\377\202\77M\177\377\2@N\177\377\77M\177\377\211@N\177\377" \ + "\202@M\177\377\203@N\177\377\2\77N~\377\77O~\377\204@O\177\377\244AO" \ + "\200\377\1@O\177\377\204AO\200\377\202@O\177\377\2@N\177\377@O\177\377" \ + "\202\77O~\377\1\77N~\377\202@N\177\377\202@M\177\377\211@N\177\377\2" \ + "\77M\177\377@N\177\377\203\77M\177\377\3>L\177\377\77M\177\377\77M~\377" \ + "\202\77M\177\377\1>L~\377\202\77M~\377\4>L}\3776Ex\377\33,f\377\30)d" \ + "\377\215\31*e\377\202\30)d\377\11\31*e\377,M}\377\77M" \ + "~\377\202\77M\177\377\3\77M~\377\77M\177\377>L\177\377\202\77M\177\377" \ + "\214@N\177\377\203@M\177\377\202@N\177\377\1\77N~\377\203\77O~\377\1" \ + "@N\177\377\203@O\177\377\241AO\200\377\203@O\177\377\1@N\177\377\203" \ + "\77O~\377\1\77N~\377\202@N\177\377\203@M\177\377\214@N\177\377\1\77M" \ + "\177\377\203>L\177\377\1\77M~\377\202\77M\177\377\10\77M~\377>L~\377" \ + "\77M~\377@M~\3771Au\377#3k\377\27(d\377\30)d\377\216\31*e\377\4\30)d" \ + "\377\37/h\3774Cw\377>L~\377\202=K}\377\2L}\377\202\77M~\377\3\77M\177\377\77M~\377\77M\177\377\202>L\177\377" \ + "\3\77M\177\377>L\177\377\77M\177\377\214@N\177\377\203@M\177\377\202" \ + "@N\177\377\1@M\177\377\203\77O~\377\2@O\177\377@N\177\377\202@O\177\377" \ + "\2\77O~\377@O\177\377\212AO\200\377\3@O\177\377AO\200\377@O\177\377\212" \ + "AO\200\377\2@O\177\377\77O~\377\202@O\177\377\2@N\177\377@O\177\377\203" \ + "\77O~\377\1@M\177\377\203@N\177\377\203@M\177\377\211@N\177\377\5\77" \ + "M\177\377@N\177\377\77M\177\377>L\177\377\77M\177\377\202>L\177\377\5" \ + "\77M\177\377\77M~\377\77M\177\377\77M~\377>L~\377\202\77M~\377\3""5C" \ + "w\377\34-g\377\31*e\377\202\30)d\377\216\31*e\377\11\30)d\377\"3k\377" \ + "L\177\377\202\77" \ + "M\177\377\202@N\177\377\1\77M\177\377\214@N\177\377\204@M\177\377\204" \ + "@N\177\377\1\77N~\377\211\77O~\377\204@O\177\377\212\77O~\377\1\77N~" \ + "\377\205@N\177\377\203@M\177\377\214@N\177\377\1\77M\177\377\202@N\177" \ + "\377\203\77M\177\377\1>L\177\377\202\77M\177\377\2\77M~\377\77M\177\377" \ + "\202\77M~\377\7\77M}\377@N~\377=K|\3771@u\377\40""1j\377\26(c\377\30" \ + ")d\377\217\31*e\377\6\30)d\377\33+f\377-M~\377=K}\377=J|\377\202" \ + "s\377,=r\377-<" \ + "r\377-;r\377-L~\377\202\77M~\377\2\77M\177\377\77M~\377\202" \ + "\77M\177\377\1>L\177\377\203\77M\177\377\203@N\177\377\1\77M\177\377" \ + "\215@N\177\377\205@M\177\377\211@N\177\377\205\77N~\377\211@N\177\377" \ + "\206@M\177\377\215@N\177\377\1\77M\177\377\202@N\177\377\203\77M\177" \ + "\377\202>L\177\377\2\77M\177\377\77M~\377\202\77M\177\377\2\77M~\377" \ + ">L~\377\202\77M~\377\4.=s\377\34,g\377\31*e\377\30)d\377\220\31*e\377" \ + "\6\27(d\377%4m\377:Hz\377=K}\377=J|\377=K}\377\202L}\377\202" \ + "\77M~\377\202\77M\177\377\2\77M~\377\77M\177\377\203>L\177\377\203\77" \ + "M\177\377\271@N\177\377\203\77M\177\377\203>L\177\377\204\77M\177\377" \ + "\3\77M~\377>L~\377\77M}\377\202\77M~\377\4;I{\3771@u\377\34-g\377\27" \ + "(c\377\220\31*e\377\202\30)d\377\5\35.h\3770\77t\377>L}\377L\177\377\204\77M\177\377\263@N\177\377" \ + "\204\77M\177\377\202>L\177\377\205\77M\177\377\202\77M~\377\6\77M}\377" \ + "@N~\377@N\177\3773Bv\377#3l\377\34-g\377\202\30)d\377\220\31*e\377\4" \ + "\30)d\377\27(d\377,s\377" \ + "\32+e\377\30)d\377\222\31*e\377\4\30)d\377\32+f\377,L}\377\77M~\377\77M}\377>L}\377\202\77M~\377\206\77M\177\377\203" \ + ">L\177\377\204\77M\177\377\204@N\177\377\1\77M\177\377\235@N\177\377" \ + "\1\77M\177\377\204@N\177\377\204\77M\177\377\203>L\177\377\206\77M\177" \ + "\377\203\77M~\377\10\77M}\377\77M~\377=K}\377;I{\377,L~\377@N\177" \ + "\377\77M~\377>L}\377\202\77M~\377\203\77M\177\377\1\77M~\377\203\77M" \ + "\177\377\203>L\177\377\205\77M\177\377\206@N\177\377\1\77M\177\377\221" \ + "@N\177\377\1\77M\177\377\206@N\177\377\205\77M\177\377\203>L\177\377" \ + "\203\77M\177\377\1\77M~\377\202\77M\177\377\202\77M~\377\12>L~\377>L" \ + "}\377\77M~\377@N\177\377:Hz\377,;r\377!1j\377\31*e\377\27(d\377\30)d" \ + "\377\222\31*e\377\3\27(d\377\36.h\3771Au\377\202=K}\377\2t\3771Bv\377\2052Av\377\4""2Au\3771@t\3771@u\377" \ + "0\77u\377\2021@u\377\5""0\77t\3771@u\377,L}\377\1>L~\377\203\77M}\377\1\77M\177\377\202\77M~\377\210\77M" \ + "\177\377\207>L\177\377\1@N\177\377\222\77M\177\377\206>L\177\377\211" \ + "\77M\177\377\202\77M~\377\1>M\177\377\203\77M}\377\202>L}\377\3>L~\377" \ + "4Cw\377!1j\377\202\30)d\377\223\31*e\377\7\30)d\377\31*e\377\30)d\377" \ + "'7o\377s\377\32*e\377\220\31*e\377\6\30" \ + ")d\377\27(d\377*:q\3773Bv\3771Bu\3772@v\377\2022Av\377\5""2Au\3771@u" \ + "\3772At\3771@u\3770\77u\377\2051@u\377\2\32+f\377\30)d\377\223\31*e\377" \ + "\5\32*e\377)9p\377,L}\377\203\77M~\377\214\77M\177\377\223>L\177\377\206\77M\177" \ + "\377\1\77M~\377\204\77M\177\377\204\77M~\377\14>L}\377\77M~\377@N~\377" \ + "\77N~\3779Hz\3772Au\377*:p\377\"2k\377\31*e\377\27(c\377\30)d\377\30" \ + "*d\377\222\31*e\377\6\30)d\377\27(d\377\32+f\377'7n\3776Ex\377\77L~\377" \ + "\202=K}\377\202L}\377\205\77M~\377\205\77" \ + "M\177\377\1\77M~\377\233\77M\177\377\204\77M~\377\2>M~\377\77L}\377\202" \ + "\77M~\377\6@N~\3776Ex\377(8o\377\34-g\377\32+e\377\31*e\377\204\30)d" \ + "\377\223\31*e\377\202\30)d\377\6)8p\377;I{\377L~" \ + "\3772@u\377!2j\377\31*e\377\202\30)d\377\226\31*e\377\14\30)d\377\27" \ + "(c\377\26'c\377\35.h\377(8o\3771@u\3775Dw\3778Fy\377;I{\377>L}\377@N" \ + "~\377@M~\377\202\77M~\377\3\77M}\377>L}\377\77M}\377\227\77M~\377\2>" \ + "L~\377\77M}\377\203\77M~\377\12@N~\377\77M~\377=J|\3779Hz\3776Ex\377" \ + "3Cw\377.=s\377#3l\377\31*e\377\26'c\377\202\30)d\377\226\31*e\377\6\30" \ + ")d\377\27(d\377\34-g\377'7o\377:H{\377>L~\377\203=K}\377\203M~\377AO\177\377@N\177\377\202@N~\377\1@M~\377\205\77M~" \ + "\377\205\77M}\377\2>M}\377\77M}\377\205\77M~\377\203@N~\377\12@N\177" \ + "\377AN\177\377;J{\3774Cw\377,s\377:H{\377" \ + "\202=K}\377\2s\3778Fz\3778Fy\377" \ + "\2067Fy\377\2""6Ey\3776Dy\377\2026Ey\377\11""6Ex\3776Ey\3776Ex\3776E" \ + "w\3776Ex\3775Dx\3775Cw\3776Ex\377\40""1j\377\202\30)d\377\220\31*e\377" \ + "\14\30)e\377+;q\3773Bv\3771Bu\3772Av\3772@v\3772Av\3772Au\3772Av\377" \ + "1@u\3772At\3770\77u\377\2051@u\377\2!1k\377\30)d\377\224\31*e\377\6\35" \ + ".h\377,L}\3776Ex\377!1j\377\32+f\377\203\30)d\377" \ + "\233\31*e\377\202\30)d\377\40\27(d\377\27(c\377\26'c\377\32,f\377\"2" \ + "k\377%5m\377'8n\377*9p\377,t\3771@u\3773Cv\3776Ey\3778Fy\377" \ + "9Gz\3779Hz\377:Hz\3779Gz\3778Gy\3777Fy\3775Dx\3772Bu\3771\77t\377.=s" \ + "\377+;q\377)8o\377&7n\377$4l\377\37""0i\377\30)d\377\26'c\377\27(c\377" \ + "\203\30)d\377\233\31*e\377\203\30)d\377\2\34-g\377*:q\377\202=K}\377" \ + "\1L~\3775Dw\377#3l\377\32+e\377\31*e\377\202\30)d\377\320" \ + "\31*e\377\1\30*d\377\202\30)d\377\4\31*e\377\34,g\377*:p\377s\377\222\31" \ + "*e\377\5\30)d\377\32+f\3772Au\3778Fy\3778Fx\377\2047Fy\377\5""7Ey\377" \ + "6Fy\3777Ey\3776Dy\3775Ey\377\2036Ey\377\10""6Ew\3776Dx\3776Ex\3775Dx" \ + "\3776Cw\3776Dx\377)8p\377\27)d\377\221\31*e\377\6\30)d\377\33,g\3771" \ + "Au\3772Au\3771Bv\3772@v\377\2032Av\377\4""2Au\3772At\3772Au\3770\77u" \ + "\377\2051@u\377\2\36.h\377\30)d\377\223\31*e\377\6\30)d\377\34-g\377" \ + "-=s\377,L~\3779Hz\377/>s\377$5l\377\31*e\377\27(c\377\30)d\377\315\31" \ + "*e\377\12\30)d\377\27(c\377\36.h\377)9p\3774Bv\377=K}\377>L}\377=K}\377" \ + "=J|\377=K}\377\202K}\377>M~\3774Cw\377(8o\377\"2k\377\34-g\377\202" \ + "\27(d\377\2\30)d\377\30)e\377\275\31*e\377\202\30)d\377\7\27(c\377\31" \ + "*e\377\37/i\377$4l\377-L~\377\204=K}\377\202t\377\33,f\377\30)e\377" \ + "\30)d\377\221\31*e\377\7\27(d\377)9p\3777Fy\3778Fy\3777Ex\3777Fy\377" \ + "6Fy\377\2027Fy\377\2027Ey\377\17""6Dy\3776Ey\3775Ey\3776Ey\3776Ex\377" \ + "6Ey\3776Ex\3776Ew\3776Ex\3776Dx\3776Cw\3776Dx\3770\77t\377\31*d\377\30" \ + ")d\377\221\31*e\377\6\30)d\377\37/i\3773Av\3771Au\3772Av\3772@v\377\202" \ + "2Av\377\5""2Au\3772Av\3772At\3771@u\3770\77u\377\2031@u\377\2020\77t" \ + "\377\2!1j\377\30)d\377\225\31*e\377\6'7n\377-=s\377,=q\377-K}\377\77L~\377;I{\3770\77t\377$5m\377\37/i\377" \ + "\33,f\377\205\30)d\377\252\31*e\377\205\30)d\377\7\31*e\377\35-g\377" \ + "\40""1j\377)9p\3775Cx\377>L}\377>L~\377\204=K}\377\203t\3779Gz\3778Ex\3777Fy\3776Fy\377\2047Fy\377\20""7Ey\3777Dy\3776Ey" \ + "\3775Ey\3776Ex\3776Ey\3776Ex\3776Ew\3776Dx\3776Ex\3775Dx\3776Cw\3775" \ + "Dx\377.=s\377\30)d\377\30)e\377\221\31*e\377\6\30)d\377\35.g\3773Bv\377" \ + "2Bu\3772Av\3772@v\377\2022Av\377\5""2Au\3772Av\3772Au\3771@u\3770\77" \ + "u\377\2031@u\377\4""0\77t\3771@u\377(8o\377\30)d\377\224\31*e\377\16" \ + "\30)d\377\36.h\377-=r\377-=q\377-K}\377>L}\377>L~\377" \ + "9Fz\3771@u\377)9p\377!2j\377\34-g\377\33,f\377\32+f\377\31*e\377\30)" \ + "e\377\231\30)d\377\13\31*e\377\32+e\377\33,f\377\34,g\377\36/h\377%5" \ + "m\377-L~\377>L}\377\202=K}\377\1L}\377>L~\377" \ + "=K}\377:H{\3777Ey\3773Bv\3770\77t\377.>s\377,t\3771@u\3775Cw\3778Fy\377;J|\377\202>L}\377\203" \ + "=K}\377\1t\3777Ez\3778Fx\3778Ex\377\2026Fy\377\2047Fy\377\2027Ey\377\3""6Dy\377" \ + "6Ey\3775Ey\377\2036Ex\377\1""6Ew\377\2026Dx\377\4""5Cx\3776Cx\3776Ex" \ + "\377\"3k\377\202\30)d\377\222\31*e\377\6\30*e\377&6n\3772Au\3771Bv\377" \ + "1Au\3772@v\377\2022Av\377\4""2Au\3772Av\3771@t\3772At\377\2020\77u\377" \ + "\2021@u\377\5""0\77t\3771@u\377-=r\377\30)e\377\30)d\377\225\31*e\377" \ + "\7#3l\377-s\377$4l\377" \ + "\30)d\377\27(d\377\30)d\377\230\31*e\377\7\30)d\377\31*e\377$4l\3774" \ + "Cw\3779Gz\3778Ex\3777Fy\377\2026Fy\377\2057Fy\377\5""7Ey\3777Dy\3776" \ + "Dy\3776Ey\3775Ey\377\2026Ey\377\1""6Ex\377\2026Ew\377\1""6Ex\377\202" \ + "6Dx\377\5""6Cw\3776Dx\377,s\377" \ + "6Dy\377\2028Fy\377\2027Fy\377\1""6Fy\377\2057Fy\377\2027Ey\377\2""7D" \ + "y\3776Ey\377\2025Ey\377\2026Ey\377\3""6Ex\3776Ew\3776Dx\377\2026Ex\377" \ + "\6""5Dx\3776Cw\3776Ex\377+:q\377\33,f\377\30)d\377\226\31*e\377\3*9p" \ + "\3773Bv\3772Bu\377\2022Av\377\1""2@v\377\2032Av\377\4""2Au\3772At\377" \ + "1@u\3770\77u\377\2051@u\377\3,;q\377\32+e\377\30)d\377\225\31*e\377\12" \ + "\30)d\377\32+f\377+;q\377-=r\377,=r\377-t\377\36/h\377\27(d\377\30)d\377\224\31*e\377\7\30)d\377\34-g\377." \ + ">s\3772Bv\3771Bu\3772Av\3772@v\377\2042Av\377\4""1@u\3771@t\3771@u\377" \ + "0\77u\377\2051@u\377\3.=s\377\34,g\377\30)d\377\225\31*e\377\202\30)" \ + "d\377\3&6m\377-=s\377,s\3778Fz\3778Fy\3777Fx\3778Fy\377\2026Fy" \ + "\377\2037Fy\377\1""7Ey\377\2027Fy\377\7""6Ey\3777Dy\3777Ey\3776Ey\377" \ + "5Ey\3776Ex\3776Ey\377\2026Ex\377\1""6Ew\377\2026Ex\377\2026Dx\377\1""6" \ + "Cw\377\2025Dx\377\1*:p\377\202\30)d\377\224\31*e\377\202\30)d\377\2\34" \ + "-g\3772@u\377\2022Bv\377\2032Av\377\1""2Au\377\2022Av\377\3""2Au\377" \ + "2At\3770\77u\377\2041@u\377\4""0\77t\3771@u\377.>s\377\33,f\377\227\31" \ + "*e\377\6\30)e\377$4l\377-=s\377,s\377,t\377\37/i\377\27)d\377\226\31*e\377\6\30)d\377\32+e\377(8n\3773" \ + "Cv\3771Au\3771Av\377\2022@v\377\2032Av\377\4""2Au\3772At\3771@u\3770" \ + "\77u\377\2041@u\377\5""1@t\3771@u\377-t\377\37/i\377\27(d\377\202\30)d\377" \ + "\351\31*e\377\203\30)d\377\3&6n\3773Av\3776Dx\377\2028Fy\377\1""8Ex\377" \ + "\2027Fy\377\2026Fy\377\2037Fy\377\1""7Ey\377\2027Fy\377\4""6Ey\3777D" \ + "y\3776Dy\3776Ey\377\2025Ey\377\2""6Ex\3776Ey\377\2026Ex\377\6""6Ew\377" \ + "6Dx\3776Ex\3776Dx\3775Dx\3776Cw\377\2025Dx\377\3#4l\377\31*e\377\30)" \ + "d\377\226\31*e\377\7\30)d\377\32+f\377.>s\3772Bv\3771Bu\3772Av\3772@" \ + "v\377\2032Av\377\2022Au\377\4""1@u\3772Au\3771@u\3770\77u\377\2031@u" \ + "\377\5""0\77t\3771@u\377*:q\377\32+e\377\30)d\377\226\31*e\377\7\30)" \ + "d\377\31*e\377+;q\377-=r\377-=q\377-t\377" \ + "\40""1i\377\31*e\377\30)d\377\226\31*e\377\202\30)d\377\6&6n\3772Au\377" \ + "2Bv\3771Av\3772Av\3772@v\377\2022Av\377\4""2Au\3772Av\3771@u\3772Au\377" \ + "\2061@u\377\5""0\77t\3771@u\377(8o\377\31*e\377\30)d\377\227\31*e\377" \ + "\6\30)d\377'8o\377-=s\377,=q\377-s\377(7o\377" \ + "\"2k\377\35.h\377\31*e\377\27(d\377\202\30)d\377\276\31*e\377\203\30" \ + ")d\377\6\27)c\377\33,f\377\37""0i\377$4l\377+:q\3773Au\377\2029Gz\377" \ + "\3""8Fy\3778Ex\3777Fx\377\2027Fy\377\2026Fy\377\2057Fy\377\1""7Ey\377" \ + "\2027Fy\377\4""7Ey\3776Ey\3777Ey\3776Dy\377\2026Ey\377\4""5Ey\3776Ey" \ + "\3776Ex\3776Ey\377\2026Ex\377\2026Ew\377\1""6Dx\377\2026Ex\377\11""6" \ + "Dx\3775Dx\3776Cx\3776Dx\3775Dx\377-s\377\37/i\377\27)d\377\231\31*e\377" \ + "\5$5m\377-=s\377,s\377\34,f\377\30)d\377\230\31*e\377\7\30)d\377#3l\377-=s\377,s\377,t\3772@v\3774Bw\3776Dx\377\205" \ + "8Fy\377\2""8Fx\3777Fx\377\2037Fy\377\2026Fy\377\2127Fy\377\2""7Ey\377" \ + "6Ey\377\2027Dy\377\2026Ey\377\2035Ey\377\1""6Ex\377\2026Ey\377\2026E" \ + "x\377\2026Ew\377\1""6Dx\377\2026Ex\377\2026Dx\377\6""6Cw\3775Dx\3776" \ + "Ey\377-s\3773Bv\3772Bv\377\2022Av\377\1""2@v\377\2022Av\377\4""2" \ + "Au\3772Av\3772Au\3771@t\377\2021@u\377\1""0\77u\377\2041@u\377\5""1\77" \ + "t\3772Av\377&6n\377\31*e\377\30)d\377\230\31*e\377\13\30)d\377\"3k\377" \ + "-=r\377," \ + "s\377+;q\377(8o\377%4m\377!2k\377\36/h\377\34-g\377\205\33,f\377\204" \ + "\32+f\377\1\32+e\377\203\32+f\377\1\33+f\377\204\33,f\377\11\34,g\377" \ + "\35-g\377\37""0i\377#3l\377'6n\377)9p\377-s\377" \ + ",s\3773Bv\3771Bu\3771Av\3772Av\377" \ + "2@v\377\2042Av\377\2022Au\377\2""2At\3771@u\377\2020\77u\377\2061@u\377" \ + "\3%5m\377\31*e\377\30)d\377\231\31*e\377\13\30*d\377%6m\377-=s\377,<" \ + "r\377-=q\377-s\377" \ + "4Cw\377\2035Dx\377\2026Cx\377\2""5Dx\3776Dx\377\2026Ex\377\2""6Dx\377" \ + "6Ex\377\2036Ew\377\2036Ex\377\2036Ey\377\2""6Ex\3776Ey\377\2045Ey\377" \ + "\2036Ey\377\1""6Dy\377\2037Dy\377\2""7Ey\3776Ey\377\2047Ey\377\2467F" \ + "y\377\2037Ey\377\2""6Ey\3777Ey\377\2047Dy\377\1""6Dy\377\2036Ey\377\204" \ + "5Ey\377\2""6Ey\3776Ex\377\2036Ey\377\2026Ex\377\2036Ew\377\2046Ex\377" \ + "\2036Dx\377\2026Cx\377\2026Dx\377\4""1Av\377,t\377$4l\377\30)d\377\27" \ + "(d\377\30)d\377\237\31*e\377\10\30)d\377\31*e\377\34-g\377,;r\3773Bv" \ + "\3771Au\3771Av\3772Av\377\2022@v\377\2022Av\377\7""2Au\3772Av\3771@u" \ + "\3772Au\3772At\3771@u\3770\77u\377\2041@u\377\6""0\77t\3771@t\3771@u" \ + "\377.=r\377\36.h\377\30)d\377\232\31*e\377\14\30)d\377\33+f\377*:p\377" \ + "-=s\377,=r\377-s\3773Bw\3774Cw\3774Dx\3776Dx\3775Dx\3775Cw\377\2026Cx\377\2""6Dx\377" \ + "5Dx\377\2026Dx\377\2046Ex\377\1""6Dx\377\2026Ex\377\2046Ew\377\2066E" \ + "x\377\2106Ey\377\1""6Ex\377\2336Ey\377\2066Ex\377\2046Ew\377\2026Ex\377" \ + "\1""6Dx\377\2036Ex\377\2026Dx\377\4""5Dx\3776Dx\3776Cx\3776Cw\377\202" \ + "5Dx\377\1""6Dx\377\2024Cw\377\4""2Bv\377)9p\377\36.i\377\27(d\377\202" \ + "\30)d\377\241\31*e\377\7\30)d\377\31*e\377\32+e\377$5l\3773Bv\3772Bv" \ + "\3771Bu\377\2062Av\377\2022Au\377\5""1@v\3772At\3771@t\3771@u\3770\77" \ + "u\377\2071@u\377\3""0\77t\377!2k\377\30)d\377\232\31*e\377\13\31*d\377" \ + "\30)d\377\36/h\377-=r\377,s\3772Av\3775Dx\3776Ex\377\2026Dx\377" \ + "\2""5Dx\3775Cw\377\2046Cx\377\1""5Dx\377\2056Dx\377\2416Ex\377\2056D" \ + "x\377\2""5Dx\3776Dx\377\2036Cx\377\2""6Cw\3775Dx\377\2026Dx\377\7""6" \ + "Ex\3774Cw\3770@u\377-=s\377)9p\377#3k\377\34-g\377\202\27(d\377\202\30" \ + ")d\377\245\31*e\377\202\30)d\377\7\32+f\377#3l\377/\77t\3773Bv\3771B" \ + "u\3771Av\3772Av\377\2022@v\377\2032Av\377\6""2Au\3772Av\3772Au\3772A" \ + "t\3771@t\3771@u\377\2020\77u\377\2071@u\377\3)9o\377\33,f\377\30)d\377" \ + "\233\31*e\377\6\30)d\377\31*e\377%5m\377-=s\377,t\377\36/h\377\31" \ + "*e\377\30)d\377\233\31*e\377\7\30)e\377\32+f\377*:p\377-=r\377-=q\377" \ + "-t\3770@u\3772Av\3773Bw\3775Dw\3775Dx\377\2066Dx\377\203" \ + "5Dx\377\2025Cx\377\2136Cx\377\2""5Cw\3775Cx\377\2035Dx\377\2066Dx\377" \ + "\15""5Dx\3774Cw\3772Bv\3771@u\3770\77t\377.>t\377,;q\377'7n\377#3l\377" \ + "\36/h\377\31)d\377\27(c\377\27(d\377\202\30)d\377\252\31*e\377\1\31*" \ + "d\377\202\30)d\377\10\34-g\377%5m\3771Au\3773Bv\3771Bu\3771Av\3772Av" \ + "\3772@v\377\2042Av\377\2""2Au\3772Av\377\2022Au\377\1""2At\377\2021@" \ + "u\377\1""0\77u\377\2051@u\377\6""0\77t\3771@u\3770\77t\377)8o\377\31" \ + "*e\377\30)d\377\233\31*e\377\202\30)d\377\6\35.g\377+;q\377-=s\377-=" \ + "q\377-s\377,;q\377)8o\377&6n\377#4l\377!1j\377" \ + "\37/i\377\36.h\377\34-g\377\33,f\377\32*e\377\206\30)d\377\255\31*e\377" \ + "\5\30)d\377\27(d\377\36/h\377+;q\3771@u\377\2022Bv\377\2""1Bv\3772Av" \ + "\377\2022@v\377\2032Av\377\1""2Au\377\2022Av\377\4""1@u\3772Au\3771@" \ + "t\3771@u\377\2020\77u\377\2061@u\377\3""2@u\377-=s\377\36/h\377\202\30" \ + ")d\377\234\31*e\377\5\30)d\377\"2k\377,s\377$4l\377\27(d\377\30)d\377\234\31*e\377\4\30)d\377\31*e\377%" \ + "5l\377-=s\377\202-=q\377\2-t\377%5m\377\35.g\377\33+f\377\31*e\377\203\30" \ + ")d\377\341\31*e\377\203\30)d\377\10\31*e\377\33,f\377\40""0i\377(9o\377" \ + "2Av\3773Bv\3772Bv\3771Bu\377\2022Av\377\2022@v\377\2052Av\377\1""2Au" \ + "\377\2022Av\377\4""2Au\3771@u\3772At\3771@t\377\2021@u\377\1""0\77u\377" \ + "\2061@u\377\1""0\77t\377\2021@u\377\4/>t\377(8o\377\32+e\377\30)d\377" \ + "\237\31*e\377\7\30)e\377\30)d\377\34,f\377*:q\377-=s\377-s\377\2032Au\377\2032Bv\377\4""1Bu\3771Av\3772@v\3772" \ + "Av\377\2032@v\377\2102Av\377\1""2Au\377\2032At\377\1""1@t\377\2021@u" \ + "\377\2020\77u\377\2111@u\377\2.=s\377\37/i\377\202\31*e\377\1\30)d\377" \ + "\241\31*e\377\7\30)d\377\32+f\377)9o\377,t\377)9p\377$4l\377" \ + "\40""0j\377\33,f\377\27(c\377\27(d\377\204\30)d\377\246\31*e\377\204" \ + "\30)d\377\13\27)d\377\27(d\377\31*d\377\35.h\377\"2k\377&6n\377,t\377+:q\377!1j\377\27)d\377\202\30)d\377\242\31" \ + "*e\377\202\30)d\377\5\32+f\377\"2k\377-=s\377-=r\377,=q\377\202-s\377" \ + ".>s\377-=r\377,s\377/>s\3770\77t\3771@t" \ + "\3771@u\3771Au\377\2062Bv\377\2031Bv\377\1""1Av\377\2042Av\377\2042@" \ + "v\377\2072Av\377\1""2Au\377\2032Av\377\2022Au\377\1""1@u\377\2022At\377" \ + "\1""1@t\377\2021@u\377\2020\77u\377\2111@u\377\6""0\77t\3771@u\3772@" \ + "u\377.=s\377#3k\377\34,g\377\203\30)d\377\243\31*e\377\202\30)d\377\6" \ + "\37""0i\377*:q\377-=s\377-=r\377-=q\377-t\377" \ + "+:q\377\40""0i\377\202\30)d\377\245\31*e\377\202\30)d\377\6\33,f\377" \ + "&6n\377.>s\377-=r\377-s\377-=r\377-=q\377-t\377%5m\377" \ + "\34-g\377\202\31*e\377\202\30)d\377\251\31*e\377\7\30)d\377\32+f\377" \ + "(7o\377,s\377\2041@u\377\1""0\77t\377\216" \ + "1@u\377\2050\77u\377\2051@u\377\1""1@t\377\2072At\377\2312Au\377\2""1" \ + "@u\3772Au\377\2072At\377\1""1@t\377\2061@u\377\2040\77u\377\2161@u\377" \ + "\1""0\77t\377\2041@u\377\5-=s\377*:p\377$4l\377\34-g\377\27(c\377\202" \ + "\30)d\377\252\31*e\377\202\30)d\377\13\33,f\377\"3l\377,t\377.=s\377+:q\377$4m\377\35" \ + ".g\377\27)d\377\203\30)d\377\255\31*e\377\202\30)d\377\7\32+f\377!1k" \ + "\377-=r\377-=s\377,s\377*9p\377" \ + "%5m\377\37""0i\377\35-g\377\32+e\377\204\30)d\377\256\31*e\377\202\30" \ + ")d\377\10\31*d\377$4l\377*:q\377-=s\377-=r\377-=q\377-s\377+;q\377%5m\377\36/h\377" \ + "\31*e\377\204\30)d\377\262\31*e\377\11\30)d\377\31)e\377\31*e\377!1j" \ + "\377-s\377,;q\377)9p\377'6n\377$4l\377\"2k\377\36/h\377\33,g" \ + "\377\30)d\377\27(d\377\203\30)d\377\264\31*e\377\13\30)d\377\27)d\377" \ + "\33,f\377#3k\377*:q\377-=s\377,=r\377-=q\377-t\377\2151@u\377\2""1@t\3770" \ + "\77u\377\2051@u\377\1""1\77t\377\2151@u\377\7""1\77t\377.=s\377+;q\377" \ + "(8o\377$5l\377\40""1i\377\34-g\377\205\31*e\377\1\30*d\377\204\30)d\377" \ + "\266\31*e\377\20\30)e\377\30)d\377\32+f\377&6m\377-=s\377,s\377\202-=r\377\2-=q\377-s\377-=s\377,s\377-=s\377-=r" \ + "\377,=q\377-=q\377\203-r\377+;q\377'7o\377#4l\377\40""1" \ + "j\377\36.h\377\34-g\377\33+f\377\31*e\377\206\30)d\377\261\31*e\377\206" \ + "\30)d\377\12\32*e\377\33,f\377\35-g\377\37/i\377\"2k\377%5m\377)9p\377" \ + ",s\377-=s\377\202-=r\377\1,=r\377\202-=q\377\204-s\377\15,s\377\203" \ + "-=s\377\2-=r\377,=r\377\204-=q\377\204-width, fb->height, 0xec, 0xec, 0xe1); ++ /* Clear the background with #192a65 */ ++ psplash_fb_draw_rect (fb, 0, 0, fb->width, fb->height, 0x19, 0x2a, 0x65); + + /* Draw the OH logo */ + psplash_fb_draw_image (fb, +- (fb->width - HAND_IMG_WIDTH)/2, +- (fb->height - HAND_IMG_HEIGHT)/2, +- HAND_IMG_WIDTH, +- HAND_IMG_HEIGHT, +- HAND_IMG_BYTES_PER_PIXEL, +- HAND_IMG_RLE_PIXEL_DATA); ++ 0, ++ 0, ++ OWRT_IMG_WIDTH, ++ OWRT_IMG_HEIGHT, ++ OWRT_IMG_BYTES_PER_PIXEL, ++ OWRT_IMG_RLE_PIXEL_DATA); + + /* Draw progress bar border */ + psplash_fb_draw_image (fb, diff --git a/utils/psplash/patches/001-hide-msgfield-and-progressbar.patch b/utils/psplash/patches/001-hide-msgfield-and-progressbar.patch new file mode 100644 index 0000000..e62213e --- /dev/null +++ b/utils/psplash/patches/001-hide-msgfield-and-progressbar.patch @@ -0,0 +1,25 @@ +diff -ruN psplash.x/psplash.c psplash/psplash.c +--- psplash.x/psplash.c 2009-05-12 10:11:25.000000000 +0200 ++++ psplash/psplash.c 2009-05-12 10:24:09.000000000 +0200 +@@ -276,17 +276,17 @@ + OWRT_IMG_RLE_PIXEL_DATA); + + /* Draw progress bar border */ +- psplash_fb_draw_image (fb, ++ /* psplash_fb_draw_image (fb, + (fb->width - BAR_IMG_WIDTH)/2, + fb->height - (fb->height/6), + BAR_IMG_WIDTH, + BAR_IMG_HEIGHT, + BAR_IMG_BYTES_PER_PIXEL, +- BAR_IMG_RLE_PIXEL_DATA); ++ BAR_IMG_RLE_PIXEL_DATA); */ + +- psplash_draw_progress (fb, 0); ++ // psplash_draw_progress (fb, 0); + +- psplash_draw_msg (fb, MSG); ++ // psplash_draw_msg (fb, MSG); + + psplash_main (fb, pipe_fd, 0); + diff --git a/utils/pv/Makefile b/utils/pv/Makefile new file mode 100644 index 0000000..eecda86 --- /dev/null +++ b/utils/pv/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2008 David Cooper +# Copyright (C) 2008-2011 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:=pv +PKG_VERSION:=1.2.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://pipeviewer.googlecode.com/files +PKG_MD5SUM:=67aedf6dbcd068d5feeaa76156153f4f + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/pv + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Shell pipeline element to meter data passing through + URL:=http://www.ivarch.com/programs/pv.shtml +endef + +define Package/pv/description + Pipe Viewer is a terminal-based tool for monitoring the progress of data + through a pipeline. It can be inserted into any normal pipeline between + two processes to give a visual indication of how quickly data is passing + through, how long it has taken, how near to completion it is, and an + estimate of how long it will be until completion. +endef + +define Package/pv/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pv $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,pv)) + diff --git a/utils/pwcrypt/Makefile b/utils/pwcrypt/Makefile new file mode 100644 index 0000000..75e33fc --- /dev/null +++ b/utils/pwcrypt/Makefile @@ -0,0 +1,36 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=pwcrypt +PKG_VERSION:=1.2.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://xjack.org/pwcrypt/downloads +PKG_MD5SUM:=381a60c8debe5b21c935b19684de + +include $(INCLUDE_DIR)/package.mk + +define Package/pwcrypt + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A utility to create crypted passwords from plaintext + URL:=http://xjack.org/pwcrypt +endef + +define Package/pwcrypt/description + A wrapper for the unix crypt() function. Supports crypt and MD5 hashing +endef + +define Package/pwcrypt/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pwcrypt $(1)/sbin/ +endef + +$(eval $(call BuildPackage,pwcrypt)) diff --git a/utils/pwgen/Makefile b/utils/pwgen/Makefile new file mode 100644 index 0000000..84e40c6 --- /dev/null +++ b/utils/pwgen/Makefile @@ -0,0 +1,45 @@ +# +# 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:=pwgen +PKG_VERSION:=2.06 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=935aebcbe610fbc9de8125e7b7d71297 + +include $(INCLUDE_DIR)/package.mk + +define Package/pwgen + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Automatic Password generator + URL:=http://sourceforge.net/projects/pwgen/ +endef + +define Package/pwgen/description + pwgen generates random, meaningless but pronounceable passwords. + These passwords contain either only lowercase letters, or upper + and lower case mixed, or digits thrown in. + Uppercase letters and digits are placed in a way that eases + remembering their position when memorizing only the word. + + E.g. to generate a WPA preshared-key do: + pwgen -c -n -s 63 1 +endef + +# uses GNU configure + +define Package/pwgen/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/pwgen $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,pwgen)) diff --git a/utils/rcs/Makefile b/utils/rcs/Makefile new file mode 100644 index 0000000..dcab7d5 --- /dev/null +++ b/utils/rcs/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2006-2009 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:=rcs +PKG_VERSION:=5.7 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/$(PKG_NAME) +PKG_MD5SUM:=4c8e896f2d2446fa593c6f1601a4fb75 + +include $(INCLUDE_DIR)/package.mk + +define Package/$(PKG_NAME) + SECTION:=utils + CATEGORY:=Utilities + TITLE:=The GNU Revision Control System + URL:=http://www.gnu.org/software/$(PKG_NAME)/ +endef + +define Package/$(PKG_NAME)/desctiption + The Revision Control System (RCS) manages multiple revisions of files. RCS + automates the storing, retrieval, logging, identification, and merging of + revisions. RCS is useful for text that is revised frequently, for example + programs, documentation, graphics, papers, and form letters. +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/{ci,co,ident,merge,rcs,rcsclean,rcsdiff,rcsmerge,rlog} $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/rcsfreeze.sh $(1)/usr/bin/rcsfreeze +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/utils/rcs/patches/000-debian.patch b/utils/rcs/patches/000-debian.patch new file mode 100644 index 0000000..96df338 --- /dev/null +++ b/utils/rcs/patches/000-debian.patch @@ -0,0 +1,4879 @@ +--- rcs-5.7.orig/debian/rules ++++ rcs-5.7/debian/rules +@@ -0,0 +1,91 @@ ++#!/usr/bin/make -f ++# Derived from: Sample debian.rules file - for GNU Hello (1.3). ++# Copyright 1994,1995 by Ian Jackson. ++# I hereby give you perpetual unlimited permission to copy, ++# modify and relicense this file, provided that you do not remove ++# my name from the file itself. (I assert my moral right of ++# paternity under the Copyright, Designs and Patents Act 1988.) ++# This file may have to be extensively modified ++ ++# There used to be `source' and `diff' targets in this file, and many ++# packages also had `changes' and `dist' targets. These functions ++# have been taken over by dpkg-source, dpkg-genchanges and ++# dpkg-buildpackage in a package-independent way, and so these targets ++# are obsolete. ++ ++package=rcs ++ ++CFLAGS = -g ++ ++ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) ++CFLAGS += -O0 ++else ++CFLAGS += -O2 ++endif ++ ++# The next section may have to be extensively modified ++ ++build: ++ $(checkdir) ++ ./configure --prefix=/usr --with-diffutils ++ $(MAKE) CFLAGS="$(CFLAGS)" ++ groff -t -p -Tps -ms rcs.ms >rcs.ps ++ touch build ++ ++clean: ++ $(checkdir) ++ -rm -f build ++ [ ! -f Makefile ] || $(MAKE) -i distclean ++ -rm -f *.ps man/index.db man/rcsfile.5 ++ -rm -rf debian/tmp debian/*~ debian/files autom4te.cache \ ++ debian/substvars ++ ++binary-indep: checkroot build ++ $(checkdir) ++# There are no architecture-independent files to be uploaded ++# generated by this package. If there were any they would be ++# made here. ++ ++binary-arch: checkroot build ++ -rm -rf debian/tmp ++ install -d debian/tmp/DEBIAN ++ install -d debian/tmp/usr/share/doc/$(package) ++ $(MAKE) prefix=`pwd`/debian/tmp/usr install ++ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) ++ for f in debian/tmp/usr/bin/*; do \ ++ strip -s -R.comment $$f; \ ++ done ++endif ++ cp debian/copyright debian/tmp/usr/share/doc/$(package)/ ++ cp debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian ++ cp ChangeLog debian/tmp/usr/share/doc/$(package)/changelog ++ gzip -9f debian/tmp/usr/share/doc/$(package)/changelog* ++ cp *.ps debian/tmp/usr/share/doc/$(package)/ ++ gzip -9f debian/tmp/usr/share/doc/$(package)/*.ps ++ mv debian/tmp/usr/man debian/tmp/usr/share/man ++ gzip -9f debian/tmp/usr/share/man/man*/* ++ (cd debian/tmp; find . -type f ! -regex '.*/DEBIAN/.*' \ ++ -printf '%P\0' | xargs -r0 md5sum > DEBIAN/md5sums) ++ dpkg-shlibdeps src/rcs ++ dpkg-gencontrol -isp ++ chown -R root.root debian/tmp ++ chmod -R u+w debian/tmp ++ chmod -R g-ws debian/tmp ++ dpkg --build debian/tmp .. ++ ++define checkdir ++ test -f man/rcs.1 ++endef ++ ++# Below here is fairly generic really ++ ++binary: binary-indep binary-arch ++ ++source diff: ++ @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false ++ ++checkroot: ++ $(checkdir) ++ test root = "`whoami`" ++ ++.PHONY: binary binary-arch binary-indep clean checkroot +--- rcs-5.7.orig/debian/control ++++ rcs-5.7/debian/control +@@ -0,0 +1,16 @@ ++Source: rcs ++Section: devel ++Priority: optional ++Maintainer: Romain Francoise ++Standards-Version: 3.7.2 ++Build-Depends: groff, autoconf ++ ++Package: rcs ++Architecture: any ++Depends: ${shlibs:Depends} ++Description: The GNU Revision Control System ++ The Revision Control System (RCS) manages multiple ++ revisions of files. RCS automates the storing, retrieval, ++ logging, identification, and merging of revisions. RCS is ++ useful for text that is revised frequently, for example ++ programs, documentation, graphics, papers, and form letters. +--- rcs-5.7.orig/debian/copyright ++++ rcs-5.7/debian/copyright +@@ -0,0 +1,28 @@ ++This is Debian GNU/Linux's prepackaged version of the FSF's Revision ++Control System (RCS) utilities. These utilities allow you to keep ++multiple revisions of one or more files in a very compact manner. RCS ++is similar to, and in most respects better than, the non-free Source ++Code Control System (SCCS). ++ ++This package was assembled by Sven Rudolph ++from the GNU sources available from prep.ai.mit.edu (and its numerous ++mirrors) as /pub/gnu/rcs-5.7.tar.gz. It is currently maintained by ++Romain Francoise . ++ ++The upstream URL is: http://www.gnu.org/software/rcs/ ++ ++Copyright (C) 1991,1992,1993 Free Software Foundation, Inc. ++ ++RCS is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++RCS 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. ++ ++On Debian GNU/Linux systems, the complete text of the GNU General ++Public License can be found in `/usr/share/common-licenses/GPL'. ++ +--- rcs-5.7.orig/debian/changelog ++++ rcs-5.7/debian/changelog +@@ -0,0 +1,216 @@ ++rcs (5.7-20) unstable; urgency=low ++ ++ * debian/control: Add support for DEB_BUILD_OPTIONS (closes: #437885). ++ ++ -- Romain Francoise Tue, 14 Aug 2007 21:24:54 +0200 ++ ++rcs (5.7-19) unstable; urgency=low ++ ++ * debian/control: Bump Standards-Version to 3.7.2, no changes needed. ++ * debian/copyright: Mention the current upstream URL (closes: #436739). ++ * debian/rules: ++ + Don't ignore errors from 'make distclean'. ++ + Generate DEBIAN/md5sums. ++ * Apply patch from Brendan O'Dea adding support for ++ diff's '-U' option to rcsdiff (closes: #428445). ++ ++ -- Romain Francoise Sun, 12 Aug 2007 18:40:04 +0200 ++ ++rcs (5.7-18) unstable; urgency=low ++ ++ * Apply patch from Mark D. Baushke adding support for the ++ new 'commitid' phrase used by newer version of CVS and CVSNT. Note ++ that this patch does not include support for *generating* the ids at ++ check in time; it only makes RCS recognize them (closes: #352527). ++ ++ -- Romain Francoise Tue, 14 Feb 2006 22:41:33 +0100 ++ ++rcs (5.7-17) unstable; urgency=low ++ ++ * Apply patch from Aaron S. Hawley making the diff strategy of rcsdiff a ++ bit more subtle: previously rcsdiff considered any long option as a ++ case where diff(1) can produce output when the revisions are ++ identical, when in fact it is only the case if either the ++ --side-by-side or --ifdef options are used (closes: #334004). ++ ++ * Patch man/co.1 to not use 'asteriskmath', thanks to LI Daobing ++ (closes: #345507). ++ ++ * debian/control: Bump Standards-Version to 3.6.2.2, no changes needed. ++ * debian/changelog: Change formatting of entries from 1995 and 1996 to ++ avoid lintian warnings. ++ * debian/rules: `install' no longer strips .comment sections from ++ binaries (since version 5.93-1), so revert previous fix and strip these ++ sections manually. ++ ++ -- Romain Francoise Sun, 5 Feb 2006 16:34:21 +0100 ++ ++rcs (5.7-16) unstable; urgency=low ++ ++ * Tenth anniversary release: RCS 5.7 was released on June 16th, 1995. ++ ++ * rcs.c: Check delta pointer in scanlogtext() before dereferencing it to ++ prevent a segmentation fault in some rare cases (discovered while ++ investigating #69193). ++ ++ * Ship docs in PostScript format (instead of DVI). Drop the ``Functions ++ of RCS'' paper since it's quite obsolete nowadays. ++ ++ * debian/rules: Delete substvars file in clean target. ++ * debian/changelog: Facelift previous entry. ++ ++ -- Romain Francoise Thu, 16 Jun 2005 08:14:01 +0200 ++ ++rcs (5.7-15) unstable; urgency=low ++ ++ * Adopting this package with Mark's blessing. ++ * debian/control: ++ + Bump Standard-Version to 3.6.1.0. ++ + Update maintainer contact info. ++ * debian/copyright: Ditto. ++ * debian/rules: ++ + Adjust CFLAGS to include -g and remove useless -I directive. ++ + Remove LDFLAGS. ++ ++ * Patch upstream Makefile.in to use install -s (which has the nice ++ effect of also deleting .comment sections from the binaries). ++ ++ * Patch man/rlog.1 to document option -q which does nothing, it's ++ provided for consistency with other commands (closes: #69257). ++ ++ * Remove a few unneeded files from the Debian diff (.orig files, Emacs ++ lock files). ++ ++ -- Romain Francoise Wed, 11 May 2005 17:51:01 +0200 ++ ++rcs (5.7-14) unstable; urgency=high ++ ++ * Fixes tmp file race (patch from OpenBSD) (Closes: #291542) ++ ++ -- Mark Baker Fri, 21 Jan 2005 18:16:20 +0000 ++ ++rcs (5.7-13.3) unstable; urgency=high ++ ++ * NMU ++ * Add build-dep on autoconf. Closes: #246566. ++ * Fix up quoting in src/Makefile.in to make $SHELL not complain, as \" ++ is not interpolated inside single-quoted strings. ++ * Make ident accept numbers as well as letters in identifiers. ++ Closes: #157891 ++ * Remove emacs variables from the changelog as they are no longer ++ needed. ++ * Add -isp to the dpkg-gencontrol call in debian/rules to get Section ++ and Priority included. Closes: #190383. ++ ++ -- Tollef Fog Heen Thu, 29 Jul 2004 19:09:32 +0200 ++ ++rcs (5.7-13.2) unstable; urgency=low ++ ++ * NMU ++ * can build now as root. Closes: #249106 ++ * priority dumped down to optional. Closes: #64438 ++ * fixed spelling error in debian/copyright, and location of the GPL. ++ ++ -- Andreas Barth Wed, 26 May 2004 22:21:05 +0200 ++ ++rcs (5.7-13.1) unstable; urgency=low ++ ++ * NMU. ++ * Rebuild so that the .dsc file will have Build-Depends. ++ Closes: #187853, #176344. ++ * Remove /usr/doc symlink. ++ ++ -- Daniel Schepler Mon, 28 Jul 2003 16:28:32 -0700 ++ ++rcs (5.7-13) unstable; urgency=low ++ ++ * debian/rules: install docs and manpages in /usr/share, as in FHS ++ * debian/control: standards version 3.1.0 ++ * debian/rules: format docs into dvi instead of leaving groff source. I ++ chose dvi as it is easier to view on screen than PS (Closes: 42277) ++ ++ -- Mark Baker Sun, 28 Nov 1999 18:31:21 +0000 ++ ++rcs (5.7-12) unstable; urgency=low ++ ++ * man/Makefile: use sed filter to fix .lf requests on output of pic, ++ so zsoelim doesn't complain about them (#26150) ++ * debian/rules: clean target deletes rcsfile.5 so it is always rebuilt ++ using fix above ++ ++ -- Mark Baker Mon, 5 Jul 1999 23:24:17 +0100 ++ ++rcs (5.7-11) unstable; urgency=low ++ ++ * Fixed temp file security hole in rcsfreeze script (#27845) ++ ++ -- Mark Baker Wed, 14 Oct 1998 22:43:47 +0100 ++ ++rcs (5.7-10) unstable; urgency=low ++ ++ * Included rcsfreeze script (#26743) ++ ++ -- Mark Baker Wed, 16 Sep 1998 20:57:00 +0000 ++ ++rcs (5.7-9) unstable; urgency=low ++ ++ * Fixed permissions ++ ++ -- Mark Baker Mon, 16 Feb 1998 00:07:52 +0000 ++ ++rcs (5.7-8) unstable; urgency=low ++ ++ * Updated standards-version to 2.4.0.0 (no changes) ++ ++ -- Mark Baker Tue, 10 Feb 1998 10:54:36 +0000 ++ ++rcs (5.7-7) unstable; urgency=low ++ ++ * Corrected maintainer field in debian/control ++ * Flushed configure cache and recompiled, to fix bug #11305/#11308) ++ ++ -- Mark Baker Thu, 17 Jul 1997 10:54:36 +0100 ++ ++rcs (5.7-6) unstable; urgency=low ++ ++ * Renamed changelog.upstream to changelog, as per policy (fixes #9657) ++ ++ -- Mark Baker Sat, 12 Jul 1997 16:55:37 +0100 ++ ++rcs (5.7-5) unstable; urgency=low ++ ++ * New maintainer ++ * Compiled with libc6 ++ * Use canonical path for sendmail (configure.in changed) ++ ++ -- Mark Baker Fri, 11 Jul 1997 21:24:48 +0100 ++ ++rcs (5.7-4) unstable; urgency=low ++ ++ * Updated to Standards-Version 2.1.2.2. ++ ++ -- Sven Rudolph Sun, 26 Jan 1997 22:34:57 +0100 ++ ++rcs (5.7-3) unstable; urgency=low ++ ++ * debian.rules: added multi-architecture support ++ ++ * debian.control: added Priority: and Section: ++ ++ * debian.control: corrected extended description (Bug#3619) ++ ++ -- Sven Rudolph Wed, 24 Jul 1996 23:48:20 +0100 ++ ++rcs (5.7-2) unstable; urgency=low ++ ++ * rebuilt for elf ++ ++ -- Sven Rudolph Thu, 23 Nov 1995 23:27:13 +0100 ++ ++rcs (5.7-1) unstable; urgency=low ++ ++ * created new Debian GNU/Linux package maintenance system files ++ * updated from rcs5.6.0.1 to rcs-5.7 ++ * received this package from Robert Sanders ++ ++ -- Sven Rudolph Tue, 5 Sep 1995 04:38:07 +0100 +--- rcs-5.7.orig/man/co.1 ++++ rcs-5.7/man/co.1 +@@ -597,7 +597,7 @@ + .RB \*(lq "//\ " \*(rq. + This is useful for languages with comments that go to the end of the line. + The convention for other languages is to use a +-.RB \*(lq " \(** " \(rq ++.RB \*(lq " * " \(rq + prefix inside a multiline comment. + For example, the initial log comment of a C program + conventionally is of the following form: +@@ -606,19 +606,19 @@ + .nf + .ft 3 + .ne 3 +-/\(** ++/* + .in +\w'/'u +-\(** $\&Log$ +-\(**/ ++* $\&Log$ ++*/ + .in + .ft + .fi + .RE + .LP + For backwards compatibility with older versions of \*r, if the log prefix is +-.B /\(** ++.B /* + or +-.B (\(** ++.B (* + surrounded by optional white space, inserted log lines contain a space + instead of + .B / +--- rcs-5.7.orig/man/rlog.1 ++++ rcs-5.7/man/rlog.1 +@@ -187,6 +187,10 @@ + .I logins + is omitted, the user's login is assumed. + .TP ++.B \-q ++This option has no effect; ++it is provided for consistency with other commands. ++.TP + .B \-T + This option has no effect; + it is present for compatibility with other \*r commands. +--- rcs-5.7.orig/man/rcsfile.5in ++++ rcs-5.7/man/rcsfile.5in +@@ -68,6 +68,7 @@ + \f3state\fP {\f2id\fP}\f3;\fP + \f3branches\fP {\f2num\fP}*\f3;\fP + \f3next\fP {\f2num\fP}\f3;\fP ++ { \f3commitid\fP \f2id\fP\f3;\fP } + { \f2newphrase\fP }* + .LP + \f2desc\fP ::= \f3desc\fP \f2string\fP +@@ -127,6 +128,18 @@ + Dates use the Gregorian calendar; times use UTC. + .PP + The ++.I commitid ++is followed by an ++.I id ++token. This token is intended to be unique across ++multiple files and is used to help group files as ++being a part of the same logical commit. ++This token must uniquely identify the commit ++operation that was applied to a set of RCS files. ++In particular, it must be unique among all the ++commitids in this file. ++.PP ++The + .I newphrase + productions in the grammar are reserved for future extensions + to the format of \*r files. +--- rcs-5.7.orig/man/Makefile.in ++++ rcs-5.7/man/Makefile.in +@@ -44,14 +44,16 @@ + all default :: rcsfile.5 + + rcsfile.5 : rcsfile.5in +- $(PIC) $(PICFLAGS) $(srcdir)/$@in >$@ ++ $(PIC) $(PICFLAGS) $(srcdir)/$@in \ ++ | sed "s%\.lf \([0-9]*\)%\.lf \1 foo%" >$@ + + check dvi info TAGS :: + + installdirs :: ../mkinstalldirs + -$(srcdir)/../mkinstalldirs $(man1dir) $(man5dir) + +-man1pages = ci co ident merge rcs rcsclean rcsdiff rcsintro rcsmerge rlog ++man1pages = ci co ident merge rcs rcsclean rcsdiff rcsintro rcsmerge rlog \ ++ rcsfreeze + + install :: installdirs + -for m in $(man1pages); do \ +--- rcs-5.7.orig/configure ++++ rcs-5.7/configure +@@ -1,28 +1,288 @@ + #! /bin/sh +- + # Guess values for system-dependent variables and create Makefiles. +-# Generated automatically using autoconf version 2.4 +-# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. ++# Generated by GNU Autoconf 2.59. + # ++# Copyright (C) 2003 Free Software Foundation, Inc. + # This configure script is free software; the Free Software Foundation + # gives unlimited permission to copy, distribute and modify it. ++## --------------------- ## ++## M4sh Initialization. ## ++## --------------------- ## ++ ++# Be Bourne compatible ++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 ++ # is contrary to our usage. Disable this feature. ++ alias -g '${1+"$@"}'='"$@"' ++elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then ++ set -o posix ++fi ++DUALCASE=1; export DUALCASE # for MKS sh ++ ++# Support unset when possible. ++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then ++ as_unset=unset ++else ++ as_unset=false ++fi ++ ++ ++# Work around bugs in pre-3.0 UWIN ksh. ++$as_unset ENV MAIL MAILPATH ++PS1='$ ' ++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 ++ fi ++done ++ ++# Required to use basename. ++if expr a : '\(a\)' >/dev/null 2>&1; then ++ as_expr=expr ++else ++ as_expr=false ++fi ++ ++if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then ++ as_basename=basename ++else ++ as_basename=false ++fi ++ ++ ++# Name of the executable. ++as_me=`$as_basename "$0" || ++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ ++ X"$0" : 'X\(//\)$' \| \ ++ X"$0" : 'X\(/\)$' \| \ ++ . : '\(.\)' 2>/dev/null || ++echo X/"$0" | ++ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } ++ /^X\/\(\/\/\)$/{ s//\1/; q; } ++ /^X\/\(\/\).*/{ s//\1/; q; } ++ s/.*/./; q'` ++ ++ ++# PATH needs CR, and LINENO needs CR and PATH. ++# Avoid depending upon Character Ranges. ++as_cr_letters='abcdefghijklmnopqrstuvwxyz' ++as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' ++as_cr_Letters=$as_cr_letters$as_cr_LETTERS ++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=';' ++ else ++ PATH_SEPARATOR=: ++ fi ++ rm -f conf$$.sh ++fi ++ ++ ++ as_lineno_1=$LINENO ++ as_lineno_2=$LINENO ++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` ++ test "x$as_lineno_1" != "x$as_lineno_2" && ++ test "x$as_lineno_3" = "x$as_lineno_2" || { ++ # Find who we are. Look in the path if we contain no path at all ++ # relative or not. ++ case $0 in ++ *[\\/]* ) as_myself=$0 ;; ++ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break ++done ++ ++ ;; ++ esac ++ # We did not find ourselves, most probably we were run as `sh COMMAND' ++ # in which case we are not to be found in the path. ++ if test "x$as_myself" = x; then ++ as_myself=$0 ++ fi ++ if test ! -f "$as_myself"; then ++ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 ++ { (exit 1); exit 1; }; } ++ fi ++ case $CONFIG_SHELL in ++ '') ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for as_base in sh bash ksh sh5; do ++ case $as_dir in ++ /*) ++ if ("$as_dir/$as_base" -c ' ++ as_lineno_1=$LINENO ++ as_lineno_2=$LINENO ++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` ++ test "x$as_lineno_1" != "x$as_lineno_2" && ++ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then ++ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } ++ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } ++ CONFIG_SHELL=$as_dir/$as_base ++ export CONFIG_SHELL ++ exec "$CONFIG_SHELL" "$0" ${1+"$@"} ++ fi;; ++ esac ++ done ++done ++;; ++ esac ++ ++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO ++ # uniformly replaced by the line number. The first 'sed' inserts a ++ # line-number line before each line; the second 'sed' does the real ++ # work. The second script uses 'N' to pair each line-number line ++ # with the numbered line, and appends trailing '-' during ++ # substitution so that $LINENO is not a special case at line end. ++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the ++ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) ++ sed '=' <$as_myself | ++ sed ' ++ N ++ s,$,-, ++ : loop ++ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, ++ t loop ++ s,-$,, ++ s,^['$as_cr_digits']*\n,, ++ ' >$as_me.lineno && ++ chmod +x $as_me.lineno || ++ { 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 ++ # (the dirname of $[0] is not the place where we might find the ++ # original and so on. Autoconf is especially sensible to this). ++ . ./$as_me.lineno ++ # Exit status is that of the last command. ++ exit ++} ++ ++ ++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in ++ *c*,-n*) ECHO_N= ECHO_C=' ++' ECHO_T=' ' ;; ++ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; ++ *) ECHO_N= ECHO_C='\c' ECHO_T= ;; ++esac ++ ++if expr a : '\(a\)' >/dev/null 2>&1; then ++ as_expr=expr ++else ++ as_expr=false ++fi ++ ++rm -f conf$$ conf$$.exe conf$$.file ++echo >conf$$.file ++if ln -s conf$$.file conf$$ 2>/dev/null; then ++ # We could just check for DJGPP; but this test a) works b) is more generic ++ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). ++ if test -f conf$$.exe; then ++ # Don't use ln at all; we don't have any links ++ as_ln_s='cp -p' ++ else ++ as_ln_s='ln -s' ++ fi ++elif ln conf$$.file conf$$ 2>/dev/null; then ++ as_ln_s=ln ++else ++ as_ln_s='cp -p' ++fi ++rm -f conf$$ conf$$.exe conf$$.file ++ ++if mkdir -p . 2>/dev/null; then ++ as_mkdir_p=: ++else ++ test -d ./-p && rmdir ./-p ++ as_mkdir_p=false ++fi ++ ++as_executable_p="test -f" ++ ++# Sed expression to map a string onto a valid CPP name. ++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" ++ ++# Sed expression to map a string onto a valid variable name. ++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" ++ ++ ++# IFS ++# We need space, tab and new line, in precisely that order. ++as_nl=' ++' ++IFS=" $as_nl" ++ ++# CDPATH. ++$as_unset CDPATH + +-# Defaults: +-ac_help= ++ ++# Name of the host. ++# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, ++# so uname gets run too. ++ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` ++ ++exec 6>&1 ++ ++# ++# Initializations. ++# + ac_default_prefix=/usr/local +-# Any additions from configure.in: +-ac_help="$ac_help +- --with-diffutils assume GNU diffutils is similarly installed" ++ac_config_libobj_dir=. ++cross_compiling=no ++subdirs= ++MFLAGS= ++MAKEFLAGS= ++SHELL=${CONFIG_SHELL-/bin/sh} ++ ++# Maximum number of lines to put in a shell here document. ++# This variable seems obsolete. It should probably be removed, and ++# only ac_max_sed_lines should be used. ++: ${ac_max_here_lines=38} ++ ++# Identity of this package. ++PACKAGE_NAME= ++PACKAGE_TARNAME= ++PACKAGE_VERSION= ++PACKAGE_STRING= ++PACKAGE_BUGREPORT= ++ ++ac_unique_file="src/rcsbase.h" ++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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS DIFF DIFF_SUCCESS DIFF_FAILURE DIFF_TROUBLE DIFFFLAGS DIFF_L DIFF3 DIFF3_BIN ED SENDMAIL PIC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE LIBOBJS LTLIBOBJS' ++ac_subst_files='' + + # Initialize some variables set by options. ++ac_init_help= ++ac_init_version=false + # The variables have the same names as the options, with + # dashes changed to underlines. +-build=NONE +-cache_file=./config.cache ++cache_file=/dev/null + exec_prefix=NONE +-host=NONE + no_create= +-nonopt=NONE + no_recursion= + prefix=NONE + program_prefix=NONE +@@ -31,18 +291,31 @@ + silent= + site= + srcdir= +-target=NONE + verbose= + x_includes=NONE + x_libraries=NONE + +-# Initialize some other variables. +-subdirs= ++# Installation directory options. ++# These are left unexpanded so users can "make install exec_prefix=/foo" ++# and all the variables that are supposed to be based on exec_prefix ++# by default will actually change. ++# Use braces instead of parens because sh, perl, etc. also accept them. ++bindir='${exec_prefix}/bin' ++sbindir='${exec_prefix}/sbin' ++libexecdir='${exec_prefix}/libexec' ++datadir='${prefix}/share' ++sysconfdir='${prefix}/etc' ++sharedstatedir='${prefix}/com' ++localstatedir='${prefix}/var' ++libdir='${exec_prefix}/lib' ++includedir='${prefix}/include' ++oldincludedir='/usr/include' ++infodir='${prefix}/info' ++mandir='${prefix}/man' + + ac_prev= + for ac_option + do +- + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" +@@ -50,48 +323,59 @@ + continue + fi + +- case "$ac_option" in +- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; +- *) ac_optarg= ;; +- esac ++ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + +- case "$ac_option" in ++ case $ac_option in + +- -build | --build | --buil | --bui | --bu | --b) +- ac_prev=build ;; +- -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*) +- build="$ac_optarg" ;; ++ -bindir | --bindir | --bindi | --bind | --bin | --bi) ++ ac_prev=bindir ;; ++ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) ++ bindir=$ac_optarg ;; ++ ++ -build | --build | --buil | --bui | --bu) ++ ac_prev=build_alias ;; ++ -build=* | --build=* | --buil=* | --bui=* | --bu=*) ++ build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) +- cache_file="$ac_optarg" ;; ++ cache_file=$ac_optarg ;; ++ ++ --config-cache | -C) ++ cache_file=config.cache ;; ++ ++ -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ++ ac_prev=datadir ;; ++ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ ++ | --da=*) ++ datadir=$ac_optarg ;; + + -disable-* | --disable-*) +- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` ++ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. +- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then +- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } +- fi +- ac_feature=`echo $ac_feature| sed 's/-/_/g'` +- eval "enable_${ac_feature}=no" ;; ++ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && ++ { echo "$as_me: error: invalid feature name: $ac_feature" >&2 ++ { (exit 1); exit 1; }; } ++ ac_feature=`echo $ac_feature | sed 's/-/_/g'` ++ eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) +- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` ++ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. +- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then +- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } +- fi +- ac_feature=`echo $ac_feature| sed 's/-/_/g'` +- case "$ac_option" in +- *=*) ;; ++ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && ++ { echo "$as_me: error: invalid feature name: $ac_feature" >&2 ++ { (exit 1); exit 1; }; } ++ ac_feature=`echo $ac_feature | sed 's/-/_/g'` ++ case $ac_option in ++ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac +- eval "enable_${ac_feature}='$ac_optarg'" ;; ++ eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ +@@ -100,83 +384,101 @@ + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) +- exec_prefix="$ac_optarg" ;; ++ exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + +- -help | --help | --hel | --he) +- # Omit some internal or obsolete options to make the list less imposing. +- # This message is too long to be a string in the A/UX 3.1 sh. +- cat << EOF +-Usage: configure [options] [host] +-Options: [defaults in brackets after descriptions] +-Configuration: +- --cache-file=FILE cache test results in FILE +- --help print this message +- --no-create do not create output files +- --quiet, --silent do not print \`checking...' messages +- --version print the version of autoconf that created configure +-Directory and file names: +- --prefix=PREFIX install architecture-independent files in PREFIX +- [$ac_default_prefix] +- --exec-prefix=PREFIX install architecture-dependent files in PREFIX +- [same as prefix] +- --srcdir=DIR find the sources in DIR [configure dir or ..] +- --program-prefix=PREFIX prepend PREFIX to installed program names +- --program-suffix=SUFFIX append SUFFIX to installed program names +- --program-transform-name=PROGRAM run sed PROGRAM on installed program names +-Host type: +- --build=BUILD configure for building on BUILD [BUILD=HOST] +- --host=HOST configure for HOST [guessed] +- --target=TARGET configure for TARGET [TARGET=HOST] +-Features and packages: +- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) +- --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] +- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) +- --x-includes=DIR X include files are in DIR +- --x-libraries=DIR X library files are in DIR +---enable and --with options recognized:$ac_help +-EOF +- exit 0 ;; ++ -help | --help | --hel | --he | -h) ++ ac_init_help=long ;; ++ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ++ ac_init_help=recursive ;; ++ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ++ ac_init_help=short ;; + + -host | --host | --hos | --ho) +- ac_prev=host ;; ++ ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) +- host="$ac_optarg" ;; ++ host_alias=$ac_optarg ;; ++ ++ -includedir | --includedir | --includedi | --included | --include \ ++ | --includ | --inclu | --incl | --inc) ++ ac_prev=includedir ;; ++ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ ++ | --includ=* | --inclu=* | --incl=* | --inc=*) ++ includedir=$ac_optarg ;; ++ ++ -infodir | --infodir | --infodi | --infod | --info | --inf) ++ ac_prev=infodir ;; ++ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) ++ infodir=$ac_optarg ;; ++ ++ -libdir | --libdir | --libdi | --libd) ++ ac_prev=libdir ;; ++ -libdir=* | --libdir=* | --libdi=* | --libd=*) ++ libdir=$ac_optarg ;; ++ ++ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ ++ | --libexe | --libex | --libe) ++ ac_prev=libexecdir ;; ++ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ ++ | --libexe=* | --libex=* | --libe=*) ++ libexecdir=$ac_optarg ;; ++ ++ -localstatedir | --localstatedir | --localstatedi | --localstated \ ++ | --localstate | --localstat | --localsta | --localst \ ++ | --locals | --local | --loca | --loc | --lo) ++ ac_prev=localstatedir ;; ++ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ ++ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ ++ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) ++ localstatedir=$ac_optarg ;; ++ ++ -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ++ ac_prev=mandir ;; ++ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) ++ mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ +- | --no-cr | --no-c) ++ | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + ++ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ ++ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ ++ | --oldin | --oldi | --old | --ol | --o) ++ ac_prev=oldincludedir ;; ++ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ ++ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ ++ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) ++ oldincludedir=$ac_optarg ;; ++ + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) +- prefix="$ac_optarg" ;; ++ prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) +- program_prefix="$ac_optarg" ;; ++ program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) +- program_suffix="$ac_optarg" ;; ++ program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ +@@ -193,55 +495,78 @@ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) +- program_transform_name="$ac_optarg" ;; ++ program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + ++ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ++ ac_prev=sbindir ;; ++ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ ++ | --sbi=* | --sb=*) ++ sbindir=$ac_optarg ;; ++ ++ -sharedstatedir | --sharedstatedir | --sharedstatedi \ ++ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ ++ | --sharedst | --shareds | --shared | --share | --shar \ ++ | --sha | --sh) ++ ac_prev=sharedstatedir ;; ++ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ ++ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ ++ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ ++ | --sha=* | --sh=*) ++ sharedstatedir=$ac_optarg ;; ++ + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) +- site="$ac_optarg" ;; ++ site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) +- srcdir="$ac_optarg" ;; ++ srcdir=$ac_optarg ;; ++ ++ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ ++ | --syscon | --sysco | --sysc | --sys | --sy) ++ ac_prev=sysconfdir ;; ++ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ ++ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) ++ sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) +- ac_prev=target ;; ++ ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) +- target="$ac_optarg" ;; ++ target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + +- -version | --version | --versio | --versi | --vers) +- echo "configure generated by autoconf version 2.4" +- exit 0 ;; ++ -version | --version | --versio | --versi | --vers | -V) ++ ac_init_version=: ;; + + -with-* | --with-*) +- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` ++ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. +- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then +- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } +- fi ++ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && ++ { echo "$as_me: error: invalid package name: $ac_package" >&2 ++ { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` +- case "$ac_option" in +- *=*) ;; ++ case $ac_option in ++ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac +- eval "with_${ac_package}='$ac_optarg'" ;; ++ eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) +- ac_package=`echo $ac_option|sed -e 's/-*without-//'` ++ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. +- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then +- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } +- fi +- ac_package=`echo $ac_package| sed 's/-/_/g'` +- eval "with_${ac_package}=no" ;; ++ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && ++ { echo "$as_me: error: invalid package name: $ac_package" >&2 ++ { (exit 1); exit 1; }; } ++ ac_package=`echo $ac_package | sed 's/-/_/g'` ++ eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. +@@ -252,96 +577,110 @@ + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) +- x_includes="$ac_optarg" ;; ++ x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) +- x_libraries="$ac_optarg" ;; ++ x_libraries=$ac_optarg ;; + +- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ++ -*) { echo "$as_me: error: unrecognized option: $ac_option ++Try \`$0 --help' for more information." >&2 ++ { (exit 1); exit 1; }; } + ;; + +- *) +- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then +- echo "configure: warning: $ac_option: invalid host type" 1>&2 +- fi +- if test "x$nonopt" != xNONE; then +- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } +- fi +- nonopt="$ac_option" ++ *=*) ++ 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 ++ { (exit 1); exit 1; }; } ++ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ++ 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 ++ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && ++ echo "$as_me: WARNING: invalid host type: $ac_option" >&2 ++ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac + done + + if test -n "$ac_prev"; then +- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +-fi +- +-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 +- +-# File descriptor usage: +-# 0 standard input +-# 1 file creation +-# 2 errors and warnings +-# 3 some systems may open it to /dev/tty +-# 4 used on the Kubota Titan +-# 6 checking for... messages and results +-# 5 compiler messages saved in config.log +-if test "$silent" = yes; then +- exec 6>/dev/null +-else +- exec 6>&1 ++ ac_option=--`echo $ac_prev | sed 's/_/-/g'` ++ { echo "$as_me: error: missing argument to $ac_option" >&2 ++ { (exit 1); exit 1; }; } + fi +-exec 5>./config.log + +-echo "\ +-This file contains any messages produced by compilers while +-running configure, to aid debugging if configure makes a mistake. +-" 1>&5 ++# Be sure to have absolute paths. ++for ac_var in exec_prefix prefix ++do ++ eval ac_val=$`echo $ac_var` ++ case $ac_val in ++ [\\/$]* | ?:[\\/]* | NONE | '' ) ;; ++ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 ++ { (exit 1); exit 1; }; };; ++ esac ++done + +-# Strip out --no-create and --no-recursion so they do not pile up. +-# Also quote any args containing shell metacharacters. +-ac_configure_args= +-for ac_arg ++# Be sure to have absolute paths. ++for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ ++ localstatedir libdir includedir oldincludedir infodir mandir + do +- case "$ac_arg" in +- -no-create | --no-create | --no-creat | --no-crea | --no-cre \ +- | --no-cr | --no-c) ;; +- -no-recursion | --no-recursion | --no-recursio | --no-recursi \ +- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; +- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) +- ac_configure_args="$ac_configure_args '$ac_arg'" ;; +- *) ac_configure_args="$ac_configure_args $ac_arg" ;; ++ eval ac_val=$`echo $ac_var` ++ case $ac_val in ++ [\\/$]* | ?:[\\/]* ) ;; ++ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 ++ { (exit 1); exit 1; }; };; + esac + done + +-# NLS nuisances. +-# Only set LANG and LC_ALL to C if already set. +-# These must not be set unconditionally because not all systems understand +-# e.g. LANG=C (notably SCO). +-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +-if test "${LANG+set}" = set; then LANG=C; export LANG; fi ++# There might be people who depend on the old broken behavior: `$host' ++# used to hold the argument of --host etc. ++# FIXME: To remove some day. ++build=$build_alias ++host=$host_alias ++target=$target_alias ++ ++# FIXME: To remove some day. ++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. ++ 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 ++ fi ++fi + +-# confdefs.h avoids OS command line length limits that DEFS can exceed. +-rm -rf conftest* confdefs.h +-# AIX cpp loses on an empty file, so make sure it contains at least a newline. +-echo > confdefs.h ++ac_tool_prefix= ++test -n "$host_alias" && ac_tool_prefix=$host_alias- ++ ++test "$silent" = yes && exec 6>/dev/null + +-# A filename unique to this package, relative to the directory that +-# configure is in, which we can look for to find out if srcdir is correct. +-ac_unique_file=src/rcsbase.h + + # Find the source files, if location was not specified. + if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. +- ac_prog=$0 +- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` +- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. ++ ac_confdir=`(dirname "$0") 2>/dev/null || ++$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ ++ X"$0" : 'X\(//\)[^/]' \| \ ++ X"$0" : 'X\(//\)$' \| \ ++ X"$0" : 'X\(/\)' \| \ ++ . : '\(.\)' 2>/dev/null || ++echo X"$0" | ++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } ++ /^X\(\/\/\)[^/].*/{ s//\1/; q; } ++ /^X\(\/\/\)$/{ s//\1/; q; } ++ /^X\(\/\).*/{ s//\1/; q; } ++ s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. +@@ -351,13 +690,454 @@ + fi + if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then +- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } ++ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 ++ { (exit 1); exit 1; }; } + else +- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } ++ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 ++ { (exit 1); exit 1; }; } + fi + fi +-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` ++(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || ++ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 ++ { (exit 1); exit 1; }; } ++srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ++ac_env_build_alias_set=${build_alias+set} ++ac_env_build_alias_value=$build_alias ++ac_cv_env_build_alias_set=${build_alias+set} ++ac_cv_env_build_alias_value=$build_alias ++ac_env_host_alias_set=${host_alias+set} ++ac_env_host_alias_value=$host_alias ++ac_cv_env_host_alias_set=${host_alias+set} ++ac_cv_env_host_alias_value=$host_alias ++ac_env_target_alias_set=${target_alias+set} ++ac_env_target_alias_value=$target_alias ++ac_cv_env_target_alias_set=${target_alias+set} ++ac_cv_env_target_alias_value=$target_alias ++ac_env_CC_set=${CC+set} ++ac_env_CC_value=$CC ++ac_cv_env_CC_set=${CC+set} ++ac_cv_env_CC_value=$CC ++ac_env_CFLAGS_set=${CFLAGS+set} ++ac_env_CFLAGS_value=$CFLAGS ++ac_cv_env_CFLAGS_set=${CFLAGS+set} ++ac_cv_env_CFLAGS_value=$CFLAGS ++ac_env_LDFLAGS_set=${LDFLAGS+set} ++ac_env_LDFLAGS_value=$LDFLAGS ++ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ++ac_cv_env_LDFLAGS_value=$LDFLAGS ++ac_env_CPPFLAGS_set=${CPPFLAGS+set} ++ac_env_CPPFLAGS_value=$CPPFLAGS ++ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ++ac_cv_env_CPPFLAGS_value=$CPPFLAGS ++ ++# ++# Report the --help message. ++# ++if test "$ac_init_help" = "long"; then ++ # Omit some internal or obsolete options to make the list less imposing. ++ # This message is too long to be a string in the A/UX 3.1 sh. ++ cat <<_ACEOF ++\`configure' configures this package to adapt to many kinds of systems. ++ ++Usage: $0 [OPTION]... [VAR=VALUE]... ++ ++To assign environment variables (e.g., CC, CFLAGS...), specify them as ++VAR=VALUE. See below for descriptions of some of the useful variables. ++ ++Defaults for the options are specified in brackets. ++ ++Configuration: ++ -h, --help display this help and exit ++ --help=short display options specific to this package ++ --help=recursive display the short help of all the included packages ++ -V, --version display version information and exit ++ -q, --quiet, --silent do not print \`checking...' messages ++ --cache-file=FILE cache test results in FILE [disabled] ++ -C, --config-cache alias for \`--cache-file=config.cache' ++ -n, --no-create do not create output files ++ --srcdir=DIR find the sources in DIR [configure dir or \`..'] ++ ++_ACEOF ++ ++ cat <<_ACEOF ++Installation directories: ++ --prefix=PREFIX install architecture-independent files in PREFIX ++ [$ac_default_prefix] ++ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX ++ [PREFIX] ++ ++By default, \`make install' will install all the files in ++\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify ++an installation prefix other than \`$ac_default_prefix' using \`--prefix', ++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] ++ --datadir=DIR read-only architecture-independent data [PREFIX/share] ++ --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] ++ --infodir=DIR info documentation [PREFIX/info] ++ --mandir=DIR man documentation [PREFIX/man] ++_ACEOF ++ ++ cat <<\_ACEOF ++_ACEOF ++fi ++ ++if test -n "$ac_init_help"; then ++ ++ cat <<\_ACEOF ++ ++Optional Packages: ++ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] ++ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) ++ --with-diffutils assume GNU diffutils is similarly installed ++ ++Some influential environment variables: ++ CC C compiler command ++ CFLAGS C compiler flags ++ LDFLAGS linker flags, e.g. -L if you have libraries in a ++ nonstandard directory ++ CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have ++ headers in a nonstandard directory ++ ++Use these variables to override the choices made by `configure' or to help ++it to find libraries and programs with nonstandard names/locations. ++ ++_ACEOF ++fi ++ ++if test "$ac_init_help" = "recursive"; then ++ # If there are subdirs, report their specific --help. ++ ac_popdir=`pwd` ++ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue ++ test -d $ac_dir || continue ++ ac_builddir=. ++ ++if test "$ac_dir" != .; then ++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` ++ # A "../" for each directory in $ac_dir_suffix. ++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` ++else ++ ac_dir_suffix= ac_top_builddir= ++fi ++ ++case $srcdir in ++ .) # No --srcdir option. We are building in place. ++ ac_srcdir=. ++ if test -z "$ac_top_builddir"; then ++ ac_top_srcdir=. ++ else ++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` ++ fi ;; ++ [\\/]* | ?:[\\/]* ) # Absolute path. ++ ac_srcdir=$srcdir$ac_dir_suffix; ++ ac_top_srcdir=$srcdir ;; ++ *) # Relative path. ++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ++ ac_top_srcdir=$ac_top_builddir$srcdir ;; ++esac ++ ++# Do not use `cd foo && pwd` to compute absolute paths, because ++# the directories may not exist. ++case `pwd` in ++.) ac_abs_builddir="$ac_dir";; ++*) ++ case "$ac_dir" in ++ .) ac_abs_builddir=`pwd`;; ++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; ++ *) ac_abs_builddir=`pwd`/"$ac_dir";; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_builddir=${ac_top_builddir}.;; ++*) ++ case ${ac_top_builddir}. in ++ .) ac_abs_top_builddir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; ++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_srcdir=$ac_srcdir;; ++*) ++ case $ac_srcdir in ++ .) ac_abs_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; ++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_srcdir=$ac_top_srcdir;; ++*) ++ case $ac_top_srcdir in ++ .) ac_abs_top_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; ++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; ++ esac;; ++esac ++ ++ cd $ac_dir ++ # Check for guested configure; otherwise get Cygnus style configure. ++ if test -f $ac_srcdir/configure.gnu; then ++ echo ++ $SHELL $ac_srcdir/configure.gnu --help=recursive ++ elif test -f $ac_srcdir/configure; then ++ echo ++ $SHELL $ac_srcdir/configure --help=recursive ++ elif test -f $ac_srcdir/configure.ac || ++ test -f $ac_srcdir/configure.in; then ++ echo ++ $ac_configure --help ++ else ++ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 ++ fi ++ cd "$ac_popdir" ++ done ++fi ++ ++test -n "$ac_init_help" && exit 0 ++if $ac_init_version; then ++ cat <<\_ACEOF ++ ++Copyright (C) 2003 Free Software Foundation, Inc. ++This configure script is free software; the Free Software Foundation ++gives unlimited permission to copy, distribute and modify it. ++_ACEOF ++ exit 0 ++fi ++exec 5>config.log ++cat >&5 <<_ACEOF ++This file contains any messages produced by compilers while ++running configure, to aid debugging if configure makes a mistake. ++ ++It was created by $as_me, which was ++generated by GNU Autoconf 2.59. Invocation command line was ++ ++ $ $0 $@ ++ ++_ACEOF ++{ ++cat <<_ASUNAME ++## --------- ## ++## Platform. ## ++## --------- ## ++ ++hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` ++uname -m = `(uname -m) 2>/dev/null || echo unknown` ++uname -r = `(uname -r) 2>/dev/null || echo unknown` ++uname -s = `(uname -s) 2>/dev/null || echo unknown` ++uname -v = `(uname -v) 2>/dev/null || echo unknown` ++ ++/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` ++/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` ++ ++/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` ++/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` ++/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` ++hostinfo = `(hostinfo) 2>/dev/null || echo unknown` ++/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` ++/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` ++/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` ++ ++_ASUNAME ++ ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ echo "PATH: $as_dir" ++done ++ ++} >&5 ++ ++cat >&5 <<_ACEOF ++ ++ ++## ----------- ## ++## Core tests. ## ++## ----------- ## ++ ++_ACEOF ++ ++ ++# Keep a trace of the command line. ++# Strip out --no-create and --no-recursion so they do not pile up. ++# Strip out --silent because we don't want to record it for future runs. ++# Also quote any args containing shell meta-characters. ++# Make two passes to allow for proper duplicate-argument suppression. ++ac_configure_args= ++ac_configure_args0= ++ac_configure_args1= ++ac_sep= ++ac_must_keep_next=false ++for ac_pass in 1 2 ++do ++ for ac_arg ++ do ++ case $ac_arg in ++ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; ++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ ++ | -silent | --silent | --silen | --sile | --sil) ++ continue ;; ++ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ++ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; ++ esac ++ case $ac_pass in ++ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; ++ 2) ++ ac_configure_args1="$ac_configure_args1 '$ac_arg'" ++ if test $ac_must_keep_next = true; then ++ ac_must_keep_next=false # Got value, back to normal. ++ else ++ case $ac_arg in ++ *=* | --config-cache | -C | -disable-* | --disable-* \ ++ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ ++ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ ++ | -with-* | --with-* | -without-* | --without-* | --x) ++ case "$ac_configure_args0 " in ++ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; ++ esac ++ ;; ++ -* ) ac_must_keep_next=true ;; ++ esac ++ fi ++ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ++ # Get rid of the leading space. ++ ac_sep=" " ++ ;; ++ esac ++ done ++done ++$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } ++$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } ++ ++# When interrupted or exit'd, cleanup temporary files, and complete ++# config.log. We remove comments because anyway the quotes in there ++# would cause problems or look ugly. ++# WARNING: Be sure not to use single quotes in there, as some shells, ++# such as our DU 5.0 friend, will then `close' the trap. ++trap 'exit_status=$? ++ # Save into config.log some information that might help in debugging. ++ { ++ echo ++ ++ cat <<\_ASBOX ++## ---------------- ## ++## Cache variables. ## ++## ---------------- ## ++_ASBOX ++ echo ++ # The following way of writing the cache mishandles newlines in values, ++{ ++ (set) 2>&1 | ++ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in ++ *ac_space=\ *) ++ sed -n \ ++ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; ++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ++ ;; ++ *) ++ sed -n \ ++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ++ ;; ++ esac; ++} ++ echo ++ ++ cat <<\_ASBOX ++## ----------------- ## ++## Output variables. ## ++## ----------------- ## ++_ASBOX ++ echo ++ for ac_var in $ac_subst_vars ++ do ++ eval ac_val=$`echo $ac_var` ++ echo "$ac_var='"'"'$ac_val'"'"'" ++ done | sort ++ echo ++ ++ if test -n "$ac_subst_files"; then ++ cat <<\_ASBOX ++## ------------- ## ++## Output files. ## ++## ------------- ## ++_ASBOX ++ echo ++ for ac_var in $ac_subst_files ++ do ++ eval ac_val=$`echo $ac_var` ++ echo "$ac_var='"'"'$ac_val'"'"'" ++ done | sort ++ echo ++ fi ++ ++ if test -s confdefs.h; then ++ cat <<\_ASBOX ++## ----------- ## ++## confdefs.h. ## ++## ----------- ## ++_ASBOX ++ echo ++ sed "/^$/d" confdefs.h | sort ++ echo ++ fi ++ test "$ac_signal" != 0 && ++ echo "$as_me: caught signal $ac_signal" ++ echo "$as_me: exit $exit_status" ++ } >&5 ++ rm -f core *.core && ++ rm -rf conftest* confdefs* conf$$* $ac_clean_files && ++ exit $exit_status ++ ' 0 ++for ac_signal in 1 2 13 15; do ++ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal ++done ++ac_signal=0 ++ ++# confdefs.h avoids OS command line length limits that DEFS can exceed. ++rm -rf conftest* confdefs.h ++# AIX cpp loses on an empty file, so make sure it contains at least a newline. ++echo >confdefs.h ++ ++# Predefined preprocessor variables. ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_NAME "$PACKAGE_NAME" ++_ACEOF ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_TARNAME "$PACKAGE_TARNAME" ++_ACEOF ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_VERSION "$PACKAGE_VERSION" ++_ACEOF + ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_STRING "$PACKAGE_STRING" ++_ACEOF ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" ++_ACEOF ++ ++ ++# Let the site file select an alternate cache file if it wants to. + # Prefer explicitly selected file to automatically selected ones. + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then +@@ -368,36 +1148,103 @@ + fi + for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then +- echo "loading site script $ac_site_file" ++ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 ++echo "$as_me: loading site script $ac_site_file" >&6;} ++ sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi + done + + if test -r "$cache_file"; then +- echo "loading cache $cache_file" +- . $cache_file ++ # 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;} ++ case $cache_file in ++ [\\/]* | ?:[\\/]* ) . $cache_file;; ++ *) . ./$cache_file;; ++ esac ++ fi + else +- echo "creating cache $cache_file" +- > $cache_file ++ { echo "$as_me:$LINENO: creating cache $cache_file" >&5 ++echo "$as_me: creating cache $cache_file" >&6;} ++ >$cache_file ++fi ++ ++# Check that the precious variables saved in the cache have kept the same ++# value. ++ac_cache_corrupted=false ++for ac_var in `(set) 2>&1 | ++ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do ++ eval ac_old_set=\$ac_cv_env_${ac_var}_set ++ eval ac_new_set=\$ac_env_${ac_var}_set ++ eval ac_old_val="\$ac_cv_env_${ac_var}_value" ++ 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;} ++ 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;} ++ 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=: ++ 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=$ac_new_val ;; ++ esac ++ case " $ac_configure_args " in ++ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. ++ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; ++ esac ++ 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;} ++ { (exit 1); exit 1; }; } + fi + + ac_ext=c +-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' +-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5' +-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + +-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then +- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. +- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then +- ac_n= ac_c=' +-' ac_t=' ' +- else +- ac_n=-n ac_c= ac_t= +- fi +-else +- ac_n= ac_c='\c' ac_t= +-fi + + + +@@ -411,15 +1258,15 @@ + 1 + EOF + ++ + # Check whether --with-diffutils or --without-diffutils was given. +-withval="$with_diffutils" +-if test -n "$withval"; then ++if test "${with_diffutils+set}" = set; then ++ withval="$with_diffutils" + with_diffutils=$withval + else + with_diffutils=no + +-fi +- ++fi; + + case $with_diffutils in + yes) +@@ -437,11 +1284,12 @@ + # On some systems, the RCS-compatible diff program is called `rdiff'; + # use it if it works and `diff' doesn't. + +-echo $ac_n "checking diff basename""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'rcs_cv_prog_diff'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking diff basename" >&5 ++echo $ECHO_N "checking diff basename... $ECHO_C" >&6 ++if test "${rcs_cv_prog_diff+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- ++ + rcs_cv_prog_diff=$DIFF + case $rcs_cv_prog_diff in + '') +@@ -463,49 +1311,62 @@ + + DIFF=$rcs_cv_prog_diff + case $DIFF in +-'') { echo "configure: error: cannot find RCS-compatible diff" 1>&2; exit 1; };; ++'') { { echo "$as_me:$LINENO: error: cannot find RCS-compatible diff" >&5 ++echo "$as_me: error: cannot find RCS-compatible diff" >&2;} ++ { (exit 1); exit 1; }; };; + esac +-echo "$ac_t""$DIFF" 1>&6 ++echo "$as_me:$LINENO: result: $DIFF" >&5 ++echo "${ECHO_T}$DIFF" >&6 + # Extract the first word of "$DIFF", so it can be a program name with args. + set dummy $DIFF; ac_word=$2 +-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'ac_cv_path_DIFF'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 ++if test "${ac_cv_path_DIFF+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- case "$DIFF" in +- /*) ++ case $DIFF in ++ [\\/]* | ?:[\\/]*) + ac_cv_path_DIFF="$DIFF" # Let the user override the test with a path. + ;; + *) +- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +- for ac_dir in $PATH; do +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$ac_word; then +- ac_cv_path_DIFF="$ac_dir/$ac_word" +- break +- fi +- done +- IFS="$ac_save_ifs" ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_path_DIFF="$as_dir/$ac_word$ac_exec_ext" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ + test -z "$ac_cv_path_DIFF" && ac_cv_path_DIFF="$DIFF" + ;; + esac + fi +-DIFF="$ac_cv_path_DIFF" ++DIFF=$ac_cv_path_DIFF ++ + if test -n "$DIFF"; then +- echo "$ac_t""$DIFF" 1>&6 ++ echo "$as_me:$LINENO: result: $DIFF" >&5 ++echo "${ECHO_T}$DIFF" >&6 + else +- echo "$ac_t""no" 1>&6 ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 + fi + + + # Set DIFF_SUCCESS, DIFF_FAILURE, DIFF_TROUBLE to diff's exit status + # when it finds no differences, some differences, or trouble. + +-echo $ac_n "checking diff success status""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'rcs_cv_status_diff_success'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking diff success status" >&5 ++echo $ECHO_N "checking diff success status... $ECHO_C" >&6 ++if test "${rcs_cv_status_diff_success+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- ++ + rcs_cv_status_diff_success=$DIFF_SUCCESS + case $rcs_cv_status_diff_success in + '') +@@ -519,14 +1380,16 @@ + fi + + DIFF_SUCCESS=$rcs_cv_status_diff_success +-echo "$ac_t""$DIFF_SUCCESS" 1>&6 ++echo "$as_me:$LINENO: result: $DIFF_SUCCESS" >&5 ++echo "${ECHO_T}$DIFF_SUCCESS" >&6 + # + +-echo $ac_n "checking diff failure status""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'rcs_cv_status_diff_failure'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking diff failure status" >&5 ++echo $ECHO_N "checking diff failure status... $ECHO_C" >&6 ++if test "${rcs_cv_status_diff_failure+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- ++ + rcs_cv_status_diff_failure=$DIFF_FAILURE + case $rcs_cv_status_diff_failure in + '') +@@ -538,14 +1401,16 @@ + fi + + DIFF_FAILURE=$rcs_cv_status_diff_failure +-echo "$ac_t""$DIFF_FAILURE" 1>&6 ++echo "$as_me:$LINENO: result: $DIFF_FAILURE" >&5 ++echo "${ECHO_T}$DIFF_FAILURE" >&6 + # + +-echo $ac_n "checking diff trouble status""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'rcs_cv_status_diff_trouble'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking diff trouble status" >&5 ++echo $ECHO_N "checking diff trouble status... $ECHO_C" >&6 ++if test "${rcs_cv_status_diff_trouble+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- ++ + rcs_cv_status_diff_trouble=$DIFF_TROUBLE + case $rcs_cv_status_diff_trouble in + '') +@@ -557,16 +1422,18 @@ + fi + + DIFF_TROUBLE=$rcs_cv_status_diff_trouble +-echo "$ac_t""$DIFF_TROUBLE" 1>&6 ++echo "$as_me:$LINENO: result: $DIFF_TROUBLE" >&5 ++echo "${ECHO_T}$DIFF_TROUBLE" >&6 + + # Set DIFFFLAGS to the options of the `diff' program to be run. + # Use -an if possible, -n otherwise. + +-echo $ac_n "checking diff options for RCS""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'rcs_cv_options_diff'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking diff options for RCS" >&5 ++echo $ECHO_N "checking diff options for RCS... $ECHO_C" >&6 ++if test "${rcs_cv_options_diff+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- ++ + rcs_cv_options_diff=$DIFFFLAGS + case $rcs_cv_options_diff in + '') +@@ -585,15 +1452,17 @@ + fi + + DIFFFLAGS=$rcs_cv_options_diff +-echo "$ac_t""$DIFFFLAGS" 1>&6 ++echo "$as_me:$LINENO: result: $DIFFFLAGS" >&5 ++echo "${ECHO_T}$DIFFFLAGS" >&6 + + # Set DIFF_L to 1 if diff understands the L option, 0 otherwise. + +-echo $ac_n "checking diff -L""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'rcs_cv_options_diff_l'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking diff -L" >&5 ++echo $ECHO_N "checking diff -L... $ECHO_C" >&6 ++if test "${rcs_cv_options_diff_l+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- ++ + rcs_cv_options_diff_l=$DIFF_L + case $rcs_cv_options_diff_l in + '') +@@ -621,19 +1490,22 @@ + + DIFF_L=$rcs_cv_options_diff_l + case $DIFF_L in +-1) echo "$ac_t""yes" 1>&6;; +-*) echo "$ac_t""no" 1>&6;; ++1) echo "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6;; ++*) echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6;; + esac + + # Set DIFF3 to the name of the diff3 program. + # In some systems (e.g. BSD/OS 2.0), diffutils diff3 lives in /usr/libexec. + diff3PATH=$PATH:/usr/libexec + +-echo $ac_n "checking diff3 -m""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'rcs_cv_prog_diff3_bin'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking diff3 -m" >&5 ++echo $ECHO_N "checking diff3 -m... $ECHO_C" >&6 ++if test "${rcs_cv_prog_diff3_bin+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- ++ + rcs_cv_prog_diff3_bin=$DIFF3 + case $rcs_cv_prog_diff3_bin in + '') +@@ -657,49 +1529,61 @@ + + case $rcs_cv_prog_diff3_bin in + ?*) +- echo "$ac_t""yes" 1>&6 ++ echo "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6 + ac_save_path=$PATH + PATH=$diff3PATH + # Extract the first word of "$rcs_cv_prog_diff3_bin", so it can be a program name with args. + set dummy $rcs_cv_prog_diff3_bin; ac_word=$2 +-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'ac_cv_path_DIFF3'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 ++if test "${ac_cv_path_DIFF3+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- case "$DIFF3" in +- /*) ++ case $DIFF3 in ++ [\\/]* | ?:[\\/]*) + ac_cv_path_DIFF3="$DIFF3" # Let the user override the test with a path. + ;; + *) +- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +- for ac_dir in $PATH; do +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$ac_word; then +- ac_cv_path_DIFF3="$ac_dir/$ac_word" +- break +- fi +- done +- IFS="$ac_save_ifs" ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_path_DIFF3="$as_dir/$ac_word$ac_exec_ext" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ + test -z "$ac_cv_path_DIFF3" && ac_cv_path_DIFF3="$rcs_cv_prog_diff3_bin" + ;; + esac + fi +-DIFF3="$ac_cv_path_DIFF3" ++DIFF3=$ac_cv_path_DIFF3 ++ + if test -n "$DIFF3"; then +- echo "$ac_t""$DIFF3" 1>&6 ++ echo "$as_me:$LINENO: result: $DIFF3" >&5 ++echo "${ECHO_T}$DIFF3" >&6 + else +- echo "$ac_t""no" 1>&6 ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 + fi + + PATH=$ac_save_path + ;; + '') +- echo "$ac_t""no" 1>&6 +- echo $ac_n "checking diff3 library program""... $ac_c" 1>&6 +- if eval "test \"`echo '$''{'rcs_cv_path_diff3_lib'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++ echo "$as_me:$LINENO: checking diff3 library program" >&5 ++echo $ECHO_N "checking diff3 library program... $ECHO_C" >&6 ++ if test "${rcs_cv_path_diff3_lib+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- ++ + $DIFF conftest0 conftest1 >conftest01 + $DIFF /dev/null conftest1 >conftestn1 + for i in /usr/*lib*/*diff3*; do +@@ -714,13 +1598,16 @@ + break + fi + done +- ++ + fi + + DIFF3=$rcs_cv_path_diff3_lib + case $DIFF3 in +- '') { echo "configure: error: cannot find a working diff3 library program" 1>&2; exit 1; };; +- ?*) echo "$ac_t""$DIFF3" 1>&6;; ++ '') { { echo "$as_me:$LINENO: error: cannot find a working diff3 library program" >&5 ++echo "$as_me: error: cannot find a working diff3 library program" >&2;} ++ { (exit 1); exit 1; }; };; ++ ?*) echo "$as_me:$LINENO: result: $DIFF3" >&5 ++echo "${ECHO_T}$DIFF3" >&6;; + esac + ;; + esac +@@ -740,71 +1627,89 @@ + + # Extract the first word of "ed", so it can be a program name with args. + set dummy ed; ac_word=$2 +-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'ac_cv_path_ED'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 ++if test "${ac_cv_path_ED+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- case "$ED" in +- /*) ++ case $ED in ++ [\\/]* | ?:[\\/]*) + ac_cv_path_ED="$ED" # Let the user override the test with a path. + ;; + *) +- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +- for ac_dir in $PATH; do +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$ac_word; then +- ac_cv_path_ED="$ac_dir/$ac_word" +- break +- fi +- done +- IFS="$ac_save_ifs" ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_path_ED="$as_dir/$ac_word$ac_exec_ext" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ + test -z "$ac_cv_path_ED" && ac_cv_path_ED="ed" + ;; + esac + fi +-ED="$ac_cv_path_ED" ++ED=$ac_cv_path_ED ++ + if test -n "$ED"; then +- echo "$ac_t""$ED" 1>&6 ++ echo "$as_me:$LINENO: result: $ED" >&5 ++echo "${ECHO_T}$ED" >&6 + else +- echo "$ac_t""no" 1>&6 ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 + fi + + + ac_save_path=$PATH +-PATH=/usr/lib:/usr/bin:/bin:/usr/sbin:/sbin:$PATH ++PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/lib:$PATH + for ac_prog in sendmail mail mailx + do +-# Extract the first word of "$ac_prog", so it can be a program name with args. ++ # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 +-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 ++if test "${ac_cv_path_SENDMAIL+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- case "$SENDMAIL" in +- /*) ++ case $SENDMAIL in ++ [\\/]* | ?:[\\/]*) + ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path. + ;; + *) +- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +- for ac_dir in $PATH; do +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$ac_word; then +- ac_cv_path_SENDMAIL="$ac_dir/$ac_word" +- break +- fi +- done +- IFS="$ac_save_ifs" ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_path_SENDMAIL="$as_dir/$ac_word$ac_exec_ext" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ + ;; + esac + fi +-SENDMAIL="$ac_cv_path_SENDMAIL" ++SENDMAIL=$ac_cv_path_SENDMAIL ++ + if test -n "$SENDMAIL"; then +- echo "$ac_t""$SENDMAIL" 1>&6 ++ echo "$as_me:$LINENO: result: $SENDMAIL" >&5 ++echo "${ECHO_T}$SENDMAIL" >&6 + else +- echo "$ac_t""no" 1>&6 ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 + fi + +-test -n "$SENDMAIL" && break ++ test -n "$SENDMAIL" && break + done + + PATH=$ac_save_path +@@ -817,110 +1722,969 @@ + # Similarly, if using traditional pic, use its -D option. + for ac_prog in "pic -n" "gpic -n" "pic -D" "pic" + do +-# Extract the first word of "$ac_prog", so it can be a program name with args. ++ # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 +-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'ac_cv_prog_PIC'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 ++if test "${ac_cv_prog_PIC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$PIC"; then + ac_cv_prog_PIC="$PIC" # Let the user override the test. + else +- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +- for ac_dir in $PATH; do +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$ac_word; then +- ac_cv_prog_PIC="$ac_prog" +- break +- fi +- done +- IFS="$ac_save_ifs" ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_PIC="$ac_prog" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ + fi + fi +-PIC="$ac_cv_prog_PIC" ++PIC=$ac_cv_prog_PIC + if test -n "$PIC"; then +- echo "$ac_t""$PIC" 1>&6 ++ echo "$as_me:$LINENO: result: $PIC" >&5 ++echo "${ECHO_T}$PIC" >&6 + else +- echo "$ac_t""no" 1>&6 ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 + fi + +-test -n "$PIC" && break ++ test -n "$PIC" && break + done + test -n "$PIC" || PIC="pic" + + +-# Extract the first word of "gcc", so it can be a program name with args. ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++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 ++if test "${ac_cv_prog_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if test -n "$CC"; then ++ ac_cv_prog_CC="$CC" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$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 ++ break 2 ++ fi ++done ++done ++ ++fi ++fi ++CC=$ac_cv_prog_CC ++if test -n "$CC"; then ++ echo "$as_me:$LINENO: result: $CC" >&5 ++echo "${ECHO_T}$CC" >&6 ++else ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++fi ++ ++fi ++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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 ++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if test -n "$ac_ct_CC"; then ++ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$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 ++ break 2 ++ fi ++done ++done ++ ++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 ++else ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++fi ++ ++ CC=$ac_ct_CC ++else ++ CC="$ac_cv_prog_CC" ++fi ++ ++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 ++if test "${ac_cv_prog_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else +- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +- for ac_dir in $PATH; do +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$ac_word; then +- ac_cv_prog_CC="gcc" +- break +- fi +- done +- IFS="$ac_save_ifs" +- test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc" ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$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 ++ break 2 ++ fi ++done ++done ++ + fi + fi +-CC="$ac_cv_prog_CC" ++CC=$ac_cv_prog_CC + if test -n "$CC"; then +- echo "$ac_t""$CC" 1>&6 ++ echo "$as_me:$LINENO: result: $CC" >&5 ++echo "${ECHO_T}$CC" >&6 + else +- echo "$ac_t""no" 1>&6 ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 + fi + ++fi ++if test -z "$ac_cv_prog_CC"; then ++ ac_ct_CC=$CC ++ # 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 ++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if test -n "$ac_ct_CC"; then ++ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_CC="cc" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done + +-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++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 + else +- cat > conftest.c <&5 | egrep yes >/dev/null 2>&1; then +- ac_cv_prog_gcc=yes ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++fi ++ ++ CC=$ac_ct_CC + else +- ac_cv_prog_gcc=no ++ CC="$ac_cv_prog_CC" + fi ++ + fi +-echo "$ac_t""$ac_cv_prog_gcc" 1>&6 +-if test $ac_cv_prog_gcc = yes; then +- GCC=yes +- if test "${CFLAGS+set}" != set; then +- echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +-if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++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 ++if test "${ac_cv_prog_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- echo 'void f(){}' > conftest.c +-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then +- ac_cv_prog_gcc_g=yes ++ if test -n "$CC"; then ++ ac_cv_prog_CC="$CC" # Let the user override the test. ++else ++ ac_prog_rejected=no ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ++ ac_prog_rejected=yes ++ continue ++ fi ++ ac_cv_prog_CC="cc" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ ++if test $ac_prog_rejected = yes; then ++ # We found a bogon in the path, so make sure we never use it. ++ set dummy $ac_cv_prog_CC ++ shift ++ if test $# != 0; then ++ # We chose a different compiler from the bogus one. ++ # However, it has the same basename, so the bogon will be chosen ++ # first if we set CC to just the basename; use the full file name. ++ shift ++ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" ++ fi ++fi ++fi ++fi ++CC=$ac_cv_prog_CC ++if test -n "$CC"; then ++ echo "$as_me:$LINENO: result: $CC" >&5 ++echo "${ECHO_T}$CC" >&6 + else +- ac_cv_prog_gcc_g=no ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++fi ++ ++fi ++if test -z "$CC"; then ++ if test -n "$ac_tool_prefix"; then ++ for ac_prog in cl ++ 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 ++if test "${ac_cv_prog_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if test -n "$CC"; then ++ ac_cv_prog_CC="$CC" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$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 ++ break 2 ++ fi ++done ++done ++ ++fi ++fi ++CC=$ac_cv_prog_CC ++if test -n "$CC"; then ++ echo "$as_me:$LINENO: result: $CC" >&5 ++echo "${ECHO_T}$CC" >&6 ++else ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++fi ++ ++ test -n "$CC" && break ++ done ++fi ++if test -z "$CC"; then ++ ac_ct_CC=$CC ++ for ac_prog in cl ++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 ++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if test -n "$ac_ct_CC"; then ++ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$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 ++ break 2 ++ fi ++done ++done ++ ++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 ++else ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++fi ++ ++ test -n "$ac_ct_CC" && break ++done ++ ++ CC=$ac_ct_CC + fi +-rm -f conftest* + + fi +- echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 +- if test $ac_cv_prog_gcc_g = yes; then +- CFLAGS="-g -O" ++ ++ ++test -z "$CC" && { { 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 ++See \`config.log' for more details." >&2;} ++ { (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` ++{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 ++ (eval $ac_compiler --version &5) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } ++{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 ++ (eval $ac_compiler -v &5) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } ++{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 ++ (eval $ac_compiler -V &5) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } ++ ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++ac_clean_files_save=$ac_clean_files ++ac_clean_files="$ac_clean_files a.out 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[^ ]*//'` ++if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 ++ (eval $ac_link_default) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; then ++ # Find the output, starting from the most likely. This scheme is ++# not robust to junk in `.', hence go to wildcards (a.*) only as a last ++# resort. ++ ++# Be careful to initialize this variable, since it used to be cached. ++# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ++ac_cv_exeext= ++# b.out is created by i960 compilers. ++for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out ++do ++ test -f "$ac_file" || continue ++ case $ac_file in ++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ++ ;; ++ conftest.$ac_ext ) ++ # This is the source file. ++ ;; ++ [ab].out ) ++ # We found the default executable, but exeext='' is most ++ # certainly right. ++ break;; ++ *.* ) ++ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` ++ # FIXME: I believe we export ac_cv_exeext for Libtool, ++ # but it would be cool to find out if it's true. Does anybody ++ # maintain Libtool? --akim. ++ export ac_cv_exeext ++ break;; ++ * ) ++ break;; ++ esac ++done ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++{ { 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 ++See \`config.log' for more details." >&2;} ++ { (exit 77); exit 77; }; } ++fi ++ ++ac_exeext=$ac_cv_exeext ++echo "$as_me:$LINENO: result: $ac_file" >&5 ++echo "${ECHO_T}$ac_file" >&6 ++ ++# Check 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 ++# 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 ++ if { ac_try='./$ac_file' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ 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 +- CFLAGS="-O" ++ { { 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. ++If you meant to cross compile, use \`--host'. ++See \`config.log' for more details." >&2;} ++ { (exit 1); exit 1; }; } + fi + fi ++fi ++echo "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6 ++ ++rm -f a.out a.exe conftest$ac_cv_exeext b.out ++ac_clean_files=$ac_clean_files_save ++# Check 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 ++ ++echo "$as_me:$LINENO: checking for suffix of executables" >&5 ++echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 ++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ (eval $ac_link) 2>&5 ++ ac_status=$? ++ 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 ++# work properly (i.e., refer to `conftest.exe'), while it won't with ++# `rm'. ++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 | *.o | *.obj ) ;; ++ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` ++ export ac_cv_exeext ++ break;; ++ * ) break;; ++ esac ++done ++else ++ { { 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 ++See \`config.log' for more details." >&2;} ++ { (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 ++ ++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 ++if test "${ac_cv_objext+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.o conftest.obj ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; then ++ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do ++ case $ac_file in ++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; ++ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` ++ break;; ++ esac ++done ++else ++ 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 ++See \`config.log' for more details." >&5 ++echo "$as_me: error: cannot compute suffix of object files: cannot compile ++See \`config.log' for more details." >&2;} ++ { (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 ++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 ++if test "${ac_cv_c_compiler_gnu+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++#ifndef __GNUC__ ++ choke me ++#endif ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_compiler_gnu=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_compiler_gnu=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++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` ++ac_test_CFLAGS=${CFLAGS+set} ++ac_save_CFLAGS=$CFLAGS ++CFLAGS="-g" ++echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 ++echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 ++if test "${ac_cv_prog_cc_g+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_prog_cc_g=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_prog_cc_g=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 ++echo "${ECHO_T}$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 ++ if test "$GCC" = yes; then ++ CFLAGS="-g -O2" ++ else ++ CFLAGS="-g" ++ fi ++else ++ if test "$GCC" = yes; then ++ CFLAGS="-O2" ++ else ++ CFLAGS= ++ fi ++fi ++echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 ++echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 ++if test "${ac_cv_prog_cc_stdc+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_prog_cc_stdc=no ++ac_save_CC=$CC ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++#include ++#include ++#include ++/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ ++struct buf { int x; }; ++FILE * (*rcsopen) (struct buf *, struct stat *, int); ++static char *e (p, i) ++ char **p; ++ int i; ++{ ++ return p[i]; ++} ++static char *f (char * (*g) (char **, int), char **p, ...) ++{ ++ char *s; ++ va_list v; ++ va_start (v,p); ++ s = g (p, va_arg (v,int)); ++ va_end (v); ++ return s; ++} ++ ++/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has ++ function prototypes and stuff, but not '\xHH' hex character constants. ++ These don't provoke an error unfortunately, instead are silently treated ++ as 'x'. The following induces an error, until -std1 is added to get ++ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an ++ array size at least. It's necessary to write '\x00'==0 to get something ++ that's true only with -std1. */ ++int osf4_cc_array ['\x00' == 0 ? 1 : -1]; ++ ++int test (int i, double x); ++struct s1 {int (*f) (int a);}; ++struct s2 {int (*f) (double a);}; ++int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); ++int argc; ++char **argv; ++int ++main () ++{ ++return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ++ ; ++ return 0; ++} ++_ACEOF ++# Don't try gcc -ansi; that turns off useful extensions and ++# breaks some systems' header files. ++# AIX -qlanglvl=ansi ++# Ultrix and OSF/1 -std1 ++# HP-UX 10.20 and later -Ae ++# HP-UX older versions -Aa -D_HPUX_SOURCE ++# SVR4 -Xc -D__EXTENSIONS__ ++for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" ++do ++ CC="$ac_save_CC $ac_arg" ++ rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_prog_cc_stdc=$ac_arg ++break ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext ++done ++rm -f conftest.$ac_ext conftest.$ac_objext ++CC=$ac_save_CC ++ ++fi ++ ++case "x$ac_cv_prog_cc_stdc" in ++ x|xno) ++ echo "$as_me:$LINENO: result: none needed" >&5 ++echo "${ECHO_T}none needed" >&6 ;; ++ *) ++ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 ++echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 ++ CC="$CC $ac_cv_prog_cc_stdc" ;; ++esac ++ ++# Some people use a C++ compiler to compile C. Since we use `exit', ++# in C++ we need to declare it. In case someone uses the same compiler ++# for both compiling C and C++ we need to have the C++ compiler decide ++# the declaration of exit, since it's the most demanding environment. ++cat >conftest.$ac_ext <<_ACEOF ++#ifndef __cplusplus ++ choke me ++#endif ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ for ac_declaration in \ ++ '' \ ++ 'extern "C" void std::exit (int) throw (); using std::exit;' \ ++ 'extern "C" void std::exit (int); using std::exit;' \ ++ 'extern "C" void exit (int) throw ();' \ ++ 'extern "C" void exit (int);' \ ++ 'void exit (int);' ++do ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_declaration ++#include ++int ++main () ++{ ++exit (42); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ : + else +- GCC= +- test "${CFLAGS+set}" = set || CFLAGS="-g" ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++continue + fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_declaration ++int ++main () ++{ ++exit (42); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ break ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++done ++rm -f conftest* ++if test -n "$ac_declaration"; then ++ echo '#ifdef __cplusplus' >>confdefs.h ++ echo $ac_declaration >>confdefs.h ++ echo '#endif' >>confdefs.h ++fi ++ ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_aux_dir= + for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do +@@ -932,14 +2696,20 @@ + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break ++ elif test -f $ac_dir/shtool; then ++ ac_aux_dir=$ac_dir ++ ac_install_sh="$ac_aux_dir/shtool install -c" ++ break + fi + done + if test -z "$ac_aux_dir"; then +- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +-fi +-ac_config_guess=$ac_aux_dir/config.guess +-ac_config_sub=$ac_aux_dir/config.sub +-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. ++ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 ++echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ac_config_guess="$SHELL $ac_aux_dir/config.guess" ++ac_config_sub="$SHELL $ac_aux_dir/config.sub" ++ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + + # Find a good install program. We prefer a C program (faster), + # so one script is as good as another. But avoid the broken or +@@ -948,274 +2718,1036 @@ + # SunOS /usr/etc/install + # IRIX /sbin/install + # AIX /bin/install ++# AmigaOS /C/install, which installs bootblocks on floppy discs ++# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag + # AFS /usr/afsws/bin/install, which mishandles nonexistent args + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" ++# OS/2's system install, which has a completely different semantic + # ./install, which can be erroneously created by make from ./install.sh. +-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 ++echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 + if test -z "$INSTALL"; then +-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++if test "${ac_cv_path_install+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +- for ac_dir in $PATH; do +- # Account for people who put trailing slashes in PATH elements. +- case "$ac_dir/" in +- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; +- *) +- # OSF1 and SCO ODT 3.0 have their own names for install. +- for ac_prog in ginstall installbsd scoinst install; do +- if test -f $ac_dir/$ac_prog; then ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ # Account for people who put trailing slashes in PATH elements. ++case $as_dir/ in ++ ./ | .// | /cC/* | \ ++ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ++ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ ++ /usr/ucb/* ) ;; ++ *) ++ # OSF1 and SCO ODT 3.0 have their own names for install. ++ # Don't use installbsd from OSF since it installs stuff as root ++ # by default. ++ for ac_prog in ginstall scoinst install; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && +- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then ++ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. +- # OSF/1 installbsd also uses dspmsg, but is usable. ++ : ++ elif test $ac_prog = install && ++ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then ++ # program-specific install script used by HP pwplus--don't use. + : + else +- ac_cv_path_install="$ac_dir/$ac_prog -c" +- break 2 ++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" ++ break 3 + fi + fi + done +- ;; +- esac +- done +- IFS="$ac_save_ifs" +- # As a last resort, use the slow shell script. +- test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh" ++ done ++ ;; ++esac ++done ++ ++ + fi +- INSTALL="$ac_cv_path_install" ++ if test "${ac_cv_path_install+set}" = set; then ++ INSTALL=$ac_cv_path_install ++ else ++ # As a last resort, use the slow shell script. We don't cache a ++ # path for INSTALL within a source directory, because that will ++ # break other packages using the cache if that directory is ++ # removed, or if the path is relative. ++ INSTALL=$ac_install_sh ++ fi + fi +-echo "$ac_t""$INSTALL" 1>&6 ++echo "$as_me:$LINENO: result: $INSTALL" >&5 ++echo "${ECHO_T}$INSTALL" >&6 + + # Use test -z because SunOS4 sh mishandles braces in ${var-val}. + # It thinks the first close brace ends the variable substitution. + test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + ++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' ++ + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +-set dummy ${MAKE-make}; ac_make=$2 +-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 ++echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 ++set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` ++if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- cat > conftestmake <<\EOF ++ cat >conftest.make <<\_ACEOF + all: +- @echo 'ac_maketemp="${MAKE}"' +-EOF ++ @echo 'ac_maketemp="$(MAKE)"' ++_ACEOF + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. +-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` ++eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` + if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes + else + eval ac_cv_prog_make_${ac_make}_set=no + fi +-rm -f conftestmake ++rm -f conftest.make + fi + if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then +- echo "$ac_t""yes" 1>&6 ++ echo "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6 + SET_MAKE= + else +- echo "$ac_t""no" 1>&6 ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" + fi + + +-trap '' 1 2 15 +-cat > confcache <<\EOF ++ ac_config_files="$ac_config_files Makefile man/Makefile src/Makefile" ++cat >confcache <<\_ACEOF + # This file is a shell script that caches the results of configure + # tests run on this system so they can be shared between configure +-# scripts and configure runs. It is not useful on other systems. +-# If it contains results you don't want to keep, you may remove or edit it. ++# scripts and configure runs, see configure's option --config-cache. ++# It is not useful on other systems. If it contains results you don't ++# want to keep, you may remove or edit it. + # +-# By default, configure uses ./config.cache as the cache file, +-# creating it if it does not exist already. You can give configure +-# the --cache-file=FILE option to use a different cache file; that is +-# what configure does when it calls configure scripts in +-# subdirectories, so they share the cache. +-# Giving --cache-file=/dev/null disables caching, for debugging configure. +-# config.status only pays attention to the cache file if you give it the +-# --recheck option to rerun configure. ++# config.status only pays attention to the cache file if you give it ++# the --recheck option to rerun configure. + # +-EOF ++# `ac_cv_env_foo' variables (set or unset) will be overridden when ++# loading this file, other *unset* `ac_cv_foo' will be assigned the ++# following values. ++ ++_ACEOF ++ ++# The following way of writing the cache mishandles newlines in values, ++# but we know of no workaround that is simple, portable, and efficient. ++# So, don't put newlines in cache variables' values. + # Ultrix sh set writes to stderr and can't be redirected directly, + # and sets the high bit in the cache file unless we assign to the vars. +-(set) 2>&1 | +- sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ +- >> confcache +-if cmp -s $cache_file confcache; then +- : +-else ++{ ++ (set) 2>&1 | ++ case `(ac_space=' '; set | grep ac_space) 2>&1` in ++ *ac_space=\ *) ++ # `set' does not quote correctly, so add quotes (double-quote ++ # substitution turns \\\\ into \\, and sed turns \\ into \). ++ sed -n \ ++ "s/'/'\\\\''/g; ++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ++ ;; ++ *) ++ # `set' quotes correctly as required by POSIX, so do not add quotes. ++ sed -n \ ++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ++ ;; ++ esac; ++} | ++ sed ' ++ t clear ++ : clear ++ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ ++ t end ++ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ ++ : end' >>confcache ++if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then +- echo "updating cache $cache_file" +- cat confcache > $cache_file ++ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" ++ cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi + fi + rm -f confcache + +-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 +- + test "x$prefix" = xNONE && prefix=$ac_default_prefix + # Let make expand exec_prefix. + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +-# Any assignment to VPATH causes Sun make to only execute +-# the first set of double-colon rules, so remove it if not needed. +-# If there is a colon in the path, we need to keep it. ++# VPATH may cause trouble with some makes, so we remove $(srcdir), ++# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and ++# trailing colons and then remove the whole line if VPATH becomes empty ++# (actually we leave an empty line to preserve line numbers). + if test "x$srcdir" = x.; then +- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' ++ ac_vpsub='/^[ ]*VPATH[ ]*=/{ ++s/:*\$(srcdir):*/:/; ++s/:*\${srcdir}:*/:/; ++s/:*@srcdir@:*/:/; ++s/^\([^=]*=[ ]*\):*/\1/; ++s/:*$//; ++s/^[^=]*=[ ]*$//; ++}' + fi + +-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 +- + # Transform confdefs.h into DEFS. + # Protect against shell expansion while executing Makefile rules. + # Protect against Makefile macro expansion. +-cat > conftest.defs <<\EOF +-s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g +-s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +-s%\[%\\&%g +-s%\]%\\&%g +-s%\$%$$%g +-EOF +-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +-rm -f conftest.defs ++# ++# If the first sed substitution is executed (which looks for macros that ++# take arguments), then we branch to the quote section. Otherwise, ++# look for a macro that doesn't take arguments. ++cat >confdef2opt.sed <<\_ACEOF ++t clear ++: clear ++s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g ++t quote ++s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g ++t quote ++d ++: quote ++s,[ `~#$^&*(){}\\|;'"<>?],\\&,g ++s,\[,\\&,g ++s,\],\\&,g ++s,\$,$$,g ++p ++_ACEOF ++# We use echo to avoid assuming a particular line-breaking character. ++# The extra dot is to prevent the shell from consuming trailing ++# line-breaks from the sub-command output. A line-break within ++# single-quotes doesn't work because, if this script is created in a ++# platform that uses two characters for line-breaks (e.g., DOS), tr ++# would break. ++ac_LF_and_DOT=`echo; echo .` ++DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` ++rm -f confdef2opt.sed ++ ++ ++ac_libobjs= ++ac_ltlibobjs= ++for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue ++ # 1. Remove the extension, and $U if already installed. ++ ac_i=`echo "$ac_i" | ++ sed 's/\$U\././;s/\.o$//;s/\.obj$//'` ++ # 2. Add them. ++ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ++ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' ++done ++LIBOBJS=$ac_libobjs + ++LTLIBOBJS=$ac_ltlibobjs + +-# Without the "./", some shells look in PATH for config.status. +-: ${CONFIG_STATUS=./config.status} + +-echo creating $CONFIG_STATUS +-rm -f $CONFIG_STATUS +-cat > $CONFIG_STATUS <&5 ++echo "$as_me: creating $CONFIG_STATUS" >&6;} ++cat >$CONFIG_STATUS <<_ACEOF ++#! $SHELL ++# Generated by $as_me. + # Run this file to recreate the current configuration. +-# This directory was configured as follows, +-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +-# +-# $0 $ac_configure_args +-# + # Compiler output produced by configure, useful for debugging +-# configure, is in ./config.log if it exists. ++# configure, is in config.log if it exists. + +-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +-for ac_option ++debug=false ++ac_cs_recheck=false ++ac_cs_silent=false ++SHELL=\${CONFIG_SHELL-$SHELL} ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<\_ACEOF ++## --------------------- ## ++## M4sh Initialization. ## ++## --------------------- ## ++ ++# Be Bourne compatible ++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 ++ # is contrary to our usage. Disable this feature. ++ alias -g '${1+"$@"}'='"$@"' ++elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then ++ set -o posix ++fi ++DUALCASE=1; export DUALCASE # for MKS sh ++ ++# Support unset when possible. ++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then ++ as_unset=unset ++else ++ as_unset=false ++fi ++ ++ ++# Work around bugs in pre-3.0 UWIN ksh. ++$as_unset ENV MAIL MAILPATH ++PS1='$ ' ++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 ++ fi ++done ++ ++# Required to use basename. ++if expr a : '\(a\)' >/dev/null 2>&1; then ++ as_expr=expr ++else ++ as_expr=false ++fi ++ ++if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then ++ as_basename=basename ++else ++ as_basename=false ++fi ++ ++ ++# Name of the executable. ++as_me=`$as_basename "$0" || ++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ ++ X"$0" : 'X\(//\)$' \| \ ++ X"$0" : 'X\(/\)$' \| \ ++ . : '\(.\)' 2>/dev/null || ++echo X/"$0" | ++ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } ++ /^X\/\(\/\/\)$/{ s//\1/; q; } ++ /^X\/\(\/\).*/{ s//\1/; q; } ++ s/.*/./; q'` ++ ++ ++# PATH needs CR, and LINENO needs CR and PATH. ++# Avoid depending upon Character Ranges. ++as_cr_letters='abcdefghijklmnopqrstuvwxyz' ++as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' ++as_cr_Letters=$as_cr_letters$as_cr_LETTERS ++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=';' ++ else ++ PATH_SEPARATOR=: ++ fi ++ rm -f conf$$.sh ++fi ++ ++ ++ as_lineno_1=$LINENO ++ as_lineno_2=$LINENO ++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` ++ test "x$as_lineno_1" != "x$as_lineno_2" && ++ test "x$as_lineno_3" = "x$as_lineno_2" || { ++ # Find who we are. Look in the path if we contain no path at all ++ # relative or not. ++ case $0 in ++ *[\\/]* ) as_myself=$0 ;; ++ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break ++done ++ ++ ;; ++ esac ++ # We did not find ourselves, most probably we were run as `sh COMMAND' ++ # in which case we are not to be found in the path. ++ if test "x$as_myself" = x; then ++ as_myself=$0 ++ fi ++ if test ! -f "$as_myself"; then ++ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 ++echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} ++ { (exit 1); exit 1; }; } ++ fi ++ case $CONFIG_SHELL in ++ '') ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for as_base in sh bash ksh sh5; do ++ case $as_dir in ++ /*) ++ if ("$as_dir/$as_base" -c ' ++ as_lineno_1=$LINENO ++ as_lineno_2=$LINENO ++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` ++ test "x$as_lineno_1" != "x$as_lineno_2" && ++ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then ++ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } ++ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } ++ CONFIG_SHELL=$as_dir/$as_base ++ export CONFIG_SHELL ++ exec "$CONFIG_SHELL" "$0" ${1+"$@"} ++ fi;; ++ esac ++ done ++done ++;; ++ esac ++ ++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO ++ # uniformly replaced by the line number. The first 'sed' inserts a ++ # line-number line before each line; the second 'sed' does the real ++ # work. The second script uses 'N' to pair each line-number line ++ # with the numbered line, and appends trailing '-' during ++ # substitution so that $LINENO is not a special case at line end. ++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the ++ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) ++ sed '=' <$as_myself | ++ sed ' ++ N ++ s,$,-, ++ : loop ++ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, ++ t loop ++ s,-$,, ++ s,^['$as_cr_digits']*\n,, ++ ' >$as_me.lineno && ++ chmod +x $as_me.lineno || ++ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 ++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 ++ # (the dirname of $[0] is not the place where we might find the ++ # original and so on. Autoconf is especially sensible to this). ++ . ./$as_me.lineno ++ # Exit status is that of the last command. ++ exit ++} ++ ++ ++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in ++ *c*,-n*) ECHO_N= ECHO_C=' ++' ECHO_T=' ' ;; ++ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; ++ *) ECHO_N= ECHO_C='\c' ECHO_T= ;; ++esac ++ ++if expr a : '\(a\)' >/dev/null 2>&1; then ++ as_expr=expr ++else ++ as_expr=false ++fi ++ ++rm -f conf$$ conf$$.exe conf$$.file ++echo >conf$$.file ++if ln -s conf$$.file conf$$ 2>/dev/null; then ++ # We could just check for DJGPP; but this test a) works b) is more generic ++ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). ++ if test -f conf$$.exe; then ++ # Don't use ln at all; we don't have any links ++ as_ln_s='cp -p' ++ else ++ as_ln_s='ln -s' ++ fi ++elif ln conf$$.file conf$$ 2>/dev/null; then ++ as_ln_s=ln ++else ++ as_ln_s='cp -p' ++fi ++rm -f conf$$ conf$$.exe conf$$.file ++ ++if mkdir -p . 2>/dev/null; then ++ as_mkdir_p=: ++else ++ test -d ./-p && rmdir ./-p ++ as_mkdir_p=false ++fi ++ ++as_executable_p="test -f" ++ ++# Sed expression to map a string onto a valid CPP name. ++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" ++ ++# Sed expression to map a string onto a valid variable name. ++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" ++ ++ ++# IFS ++# We need space, tab and new line, in precisely that order. ++as_nl=' ++' ++IFS=" $as_nl" ++ ++# CDPATH. ++$as_unset CDPATH ++ ++exec 6>&1 ++ ++# Open the log real soon, to keep \$[0] and so on meaningful, and to ++# report actual input values of CONFIG_FILES etc. instead of their ++# values after options handling. Logging --version etc. is OK. ++exec 5>>config.log ++{ ++ echo ++ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ++## Running $as_me. ## ++_ASBOX ++} >&5 ++cat >&5 <<_CSEOF ++ ++This file was extended by $as_me, which was ++generated by GNU Autoconf 2.59. Invocation command line was ++ ++ CONFIG_FILES = $CONFIG_FILES ++ CONFIG_HEADERS = $CONFIG_HEADERS ++ CONFIG_LINKS = $CONFIG_LINKS ++ CONFIG_COMMANDS = $CONFIG_COMMANDS ++ $ $0 $@ ++ ++_CSEOF ++echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 ++echo >&5 ++_ACEOF ++ ++# Files that config.status was made for. ++if test -n "$ac_config_files"; then ++ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS ++fi ++ ++if test -n "$ac_config_headers"; then ++ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS ++fi ++ ++if test -n "$ac_config_links"; then ++ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS ++fi ++ ++if test -n "$ac_config_commands"; then ++ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS ++fi ++ ++cat >>$CONFIG_STATUS <<\_ACEOF ++ ++ac_cs_usage="\ ++\`$as_me' instantiates files from templates according to the ++current configuration. ++ ++Usage: $0 [OPTIONS] [FILE]... ++ ++ -h, --help print this help, then exit ++ -V, --version print version number, then exit ++ -q, --quiet 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 ++ ++Configuration files: ++$config_files ++ ++Report bugs to ." ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<_ACEOF ++ac_cs_version="\\ ++config.status ++configured by $0, generated by GNU Autoconf 2.59, ++ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" ++ ++Copyright (C) 2003 Free Software Foundation, Inc. ++This config.status script is free software; the Free Software Foundation ++gives unlimited permission to copy, distribute and modify it." ++srcdir=$srcdir ++INSTALL="$INSTALL" ++_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. ++ac_need_defaults=: ++while test $# != 0 + do +- case "\$ac_option" in ++ case $1 in ++ --*=*) ++ ac_option=`expr "x$1" : 'x\([^=]*\)='` ++ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ++ ac_shift=: ++ ;; ++ -*) ++ ac_option=$1 ++ ac_optarg=$2 ++ ac_shift=shift ++ ;; ++ *) # This is not an option, so the user has probably given explicit ++ # arguments. ++ ac_option=$1 ++ ac_need_defaults=false;; ++ esac ++ ++ case $ac_option in ++ # Handling of the options. ++_ACEOF ++cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) +- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" +- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; +- -version | --version | --versio | --versi | --vers | --ver | --ve | --v) +- echo "$CONFIG_STATUS generated by autoconf version 2.4" +- exit 0 ;; +- -help | --help | --hel | --he | --h) +- echo "\$ac_cs_usage"; exit 0 ;; +- *) echo "\$ac_cs_usage"; exit 1 ;; ++ ac_cs_recheck=: ;; ++ --version | --vers* | -V ) ++ echo "$ac_cs_version"; exit 0 ;; ++ --he | --h) ++ # Conflict between --help and --header ++ { { echo "$as_me:$LINENO: error: ambiguous option: $1 ++Try \`$0 --help' for more information." >&5 ++echo "$as_me: error: ambiguous option: $1 ++Try \`$0 --help' for more information." >&2;} ++ { (exit 1); exit 1; }; };; ++ --help | --hel | -h ) ++ echo "$ac_cs_usage"; exit 0 ;; ++ --debug | --d* | -d ) ++ debug=: ;; ++ --file | --fil | --fi | --f ) ++ $ac_shift ++ CONFIG_FILES="$CONFIG_FILES $ac_optarg" ++ ac_need_defaults=false;; ++ --header | --heade | --head | --hea ) ++ $ac_shift ++ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ++ ac_need_defaults=false;; ++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ ++ | -silent | --silent | --silen | --sile | --sil | --si | --s) ++ ac_cs_silent=: ;; ++ ++ # This is an error. ++ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 ++Try \`$0 --help' for more information." >&5 ++echo "$as_me: error: unrecognized option: $1 ++Try \`$0 --help' for more information." >&2;} ++ { (exit 1); exit 1; }; } ;; ++ ++ *) ac_config_targets="$ac_config_targets $1" ;; ++ + esac ++ shift + done + +-ac_given_srcdir=$srcdir +-ac_given_INSTALL="$INSTALL" +- +-trap 'rm -fr `echo "Makefile man/Makefile src/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +- +-# Protect against being on the right side of a sed subst in config.status. +-sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; +- s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF +-$ac_vpsub +-$extrasub +-s%@CFLAGS@%$CFLAGS%g +-s%@CPPFLAGS@%$CPPFLAGS%g +-s%@CXXFLAGS@%$CXXFLAGS%g +-s%@DEFS@%$DEFS%g +-s%@LDFLAGS@%$LDFLAGS%g +-s%@LIBS@%$LIBS%g +-s%@exec_prefix@%$exec_prefix%g +-s%@prefix@%$prefix%g +-s%@program_transform_name@%$program_transform_name%g +-s%@DIFF@%$DIFF%g +-s%@DIFF_SUCCESS@%$DIFF_SUCCESS%g +-s%@DIFF_FAILURE@%$DIFF_FAILURE%g +-s%@DIFF_TROUBLE@%$DIFF_TROUBLE%g +-s%@DIFFFLAGS@%$DIFFFLAGS%g +-s%@DIFF_L@%$DIFF_L%g +-s%@DIFF3@%$DIFF3%g +-s%@DIFF3_BIN@%$DIFF3_BIN%g +-s%@ED@%$ED%g +-s%@SENDMAIL@%$SENDMAIL%g +-s%@PIC@%$PIC%g +-s%@CC@%$CC%g +-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +-s%@INSTALL_DATA@%$INSTALL_DATA%g +-s%@SET_MAKE@%$SET_MAKE%g ++ac_configure_extra_args= ++ ++if $ac_cs_silent; then ++ exec 6>/dev/null ++ ac_configure_extra_args="$ac_configure_extra_args --silent" ++fi ++ ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF ++if \$ac_cs_recheck; then ++ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 ++ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion ++fi ++ ++_ACEOF ++ ++ ++ ++ ++ ++cat >>$CONFIG_STATUS <<\_ACEOF ++for ac_config_target in $ac_config_targets ++do ++ case "$ac_config_target" in ++ # Handling of arguments. ++ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; ++ "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; ++ "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; ++ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 ++echo "$as_me: error: invalid argument: $ac_config_target" >&2;} ++ { (exit 1); exit 1; }; };; ++ esac ++done ++ ++# If the user did not use the arguments to specify the items to instantiate, ++# then the envvar interface is used. Set only those that are not. ++# We use the long form for the default assignment because of an extremely ++# bizarre bug on SunOS 4.1.3. ++if $ac_need_defaults; then ++ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files ++fi ++ ++# Have a temporary directory for convenience. Make it in the build tree ++# simply because there is no reason to put it here, and in addition, ++# creating and moving files from /tmp can sometimes cause problems. ++# Create a temporary directory, and hook for its removal unless debugging. ++$debug || ++{ ++ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 ++ trap '{ (exit 1); exit 1; }' 1 2 13 15 ++} ++ ++# Create a (secure) tmp directory for tmp files. ++ ++{ ++ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && ++ test -n "$tmp" && test -d "$tmp" ++} || ++{ ++ tmp=./confstat$$-$RANDOM ++ (umask 077 && mkdir $tmp) ++} || ++{ ++ echo "$me: cannot create a temporary directory in ." >&2 ++ { (exit 1); exit 1; } ++} + ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<_ACEOF ++ ++# ++# CONFIG_FILES section. ++# ++ ++# No need to generate the scripts if there are no CONFIG_FILES. ++# This happens for instance when ./config.status config.h ++if test -n "\$CONFIG_FILES"; then ++ # Protect against being on the right side of a sed subst in config.status. ++ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; ++ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF ++s,@SHELL@,$SHELL,;t t ++s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t ++s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t ++s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t ++s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t ++s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t ++s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t ++s,@exec_prefix@,$exec_prefix,;t t ++s,@prefix@,$prefix,;t t ++s,@program_transform_name@,$program_transform_name,;t t ++s,@bindir@,$bindir,;t t ++s,@sbindir@,$sbindir,;t t ++s,@libexecdir@,$libexecdir,;t t ++s,@datadir@,$datadir,;t t ++s,@sysconfdir@,$sysconfdir,;t t ++s,@sharedstatedir@,$sharedstatedir,;t t ++s,@localstatedir@,$localstatedir,;t t ++s,@libdir@,$libdir,;t t ++s,@includedir@,$includedir,;t t ++s,@oldincludedir@,$oldincludedir,;t t ++s,@infodir@,$infodir,;t t ++s,@mandir@,$mandir,;t t ++s,@build_alias@,$build_alias,;t t ++s,@host_alias@,$host_alias,;t t ++s,@target_alias@,$target_alias,;t t ++s,@DEFS@,$DEFS,;t t ++s,@ECHO_C@,$ECHO_C,;t t ++s,@ECHO_N@,$ECHO_N,;t t ++s,@ECHO_T@,$ECHO_T,;t t ++s,@LIBS@,$LIBS,;t t ++s,@DIFF@,$DIFF,;t t ++s,@DIFF_SUCCESS@,$DIFF_SUCCESS,;t t ++s,@DIFF_FAILURE@,$DIFF_FAILURE,;t t ++s,@DIFF_TROUBLE@,$DIFF_TROUBLE,;t t ++s,@DIFFFLAGS@,$DIFFFLAGS,;t t ++s,@DIFF_L@,$DIFF_L,;t t ++s,@DIFF3@,$DIFF3,;t t ++s,@DIFF3_BIN@,$DIFF3_BIN,;t t ++s,@ED@,$ED,;t t ++s,@SENDMAIL@,$SENDMAIL,;t t ++s,@PIC@,$PIC,;t t ++s,@CC@,$CC,;t t ++s,@CFLAGS@,$CFLAGS,;t t ++s,@LDFLAGS@,$LDFLAGS,;t t ++s,@CPPFLAGS@,$CPPFLAGS,;t t ++s,@ac_ct_CC@,$ac_ct_CC,;t t ++s,@EXEEXT@,$EXEEXT,;t t ++s,@OBJEXT@,$OBJEXT,;t t ++s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t ++s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t ++s,@INSTALL_DATA@,$INSTALL_DATA,;t t ++s,@SET_MAKE@,$SET_MAKE,;t t ++s,@LIBOBJS@,$LIBOBJS,;t t ++s,@LTLIBOBJS@,$LTLIBOBJS,;t t + CEOF +-EOF +-cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then +- # Support "outfile[:infile]", defaulting infile="outfile.in". +- case "$ac_file" in +- *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` +- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; +- *) ac_file_in="${ac_file}.in" ;; +- esac +- +- # Adjust relative srcdir, etc. for subdirectories. +- +- # Remove last slash and all that follows it. Not all systems have dirname. +- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` +- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then +- # The file is in a subdirectory. +- test ! -d "$ac_dir" && mkdir "$ac_dir" +- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" +- # A "../" for each directory in $ac_dir_suffix. +- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` +- else +- ac_dir_suffix= ac_dots= ++_ACEOF ++ ++ cat >>$CONFIG_STATUS <<\_ACEOF ++ # Split the substitutions into bite-sized pieces for seds with ++ # small command number limits, like on Digital OSF/1 and HP-UX. ++ ac_max_sed_lines=48 ++ ac_sed_frag=1 # Number of current file. ++ ac_beg=1 # First line for current file. ++ ac_end=$ac_max_sed_lines # Line after last line for current file. ++ ac_more_lines=: ++ ac_sed_cmds= ++ while $ac_more_lines; do ++ if test $ac_beg -gt 1; then ++ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag ++ else ++ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag ++ fi ++ if test ! -s $tmp/subs.frag; then ++ ac_more_lines=false ++ else ++ # The purpose of the label and of the branching condition is to ++ # speed up the sed processing (if there are no `@' at all, there ++ # is no need to browse any of the substitutions). ++ # These are the two extra sed commands mentioned above. ++ (echo ':t ++ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed ++ if test -z "$ac_sed_cmds"; then ++ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" ++ else ++ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" ++ fi ++ ac_sed_frag=`expr $ac_sed_frag + 1` ++ ac_beg=$ac_end ++ ac_end=`expr $ac_end + $ac_max_sed_lines` ++ fi ++ done ++ if test -z "$ac_sed_cmds"; then ++ ac_sed_cmds=cat + fi ++fi # test -n "$CONFIG_FILES" ++ ++_ACEOF ++cat >>$CONFIG_STATUS <<\_ACEOF ++for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue ++ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". ++ case $ac_file in ++ - | *:- | *:-:* ) # input from stdin ++ cat >$tmp/stdin ++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; ++ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; ++ * ) ac_file_in=$ac_file.in ;; ++ esac + +- case "$ac_given_srcdir" in +- .) srcdir=. +- if test -z "$ac_dots"; then top_srcdir=. +- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; +- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; ++ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ++ ac_dir=`(dirname "$ac_file") 2>/dev/null || ++$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" | ++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } ++ /^X\(\/\/\)[^/].*/{ s//\1/; q; } ++ /^X\(\/\/\)$/{ s//\1/; q; } ++ /^X\(\/\).*/{ s//\1/; q; } ++ s/.*/./; q'` ++ { if $as_mkdir_p; then ++ mkdir -p "$ac_dir" ++ else ++ as_dir="$ac_dir" ++ as_dirs= ++ while test ! -d "$as_dir"; do ++ as_dirs="$as_dir $as_dirs" ++ as_dir=`(dirname "$as_dir") 2>/dev/null || ++$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" | ++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } ++ /^X\(\/\/\)[^/].*/{ s//\1/; q; } ++ /^X\(\/\/\)$/{ s//\1/; q; } ++ /^X\(\/\).*/{ s//\1/; q; } ++ s/.*/./; q'` ++ done ++ test ! -n "$as_dirs" || mkdir $as_dirs ++ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 ++echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} ++ { (exit 1); exit 1; }; }; } ++ ++ ac_builddir=. ++ ++if test "$ac_dir" != .; then ++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` ++ # A "../" for each directory in $ac_dir_suffix. ++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` ++else ++ ac_dir_suffix= ac_top_builddir= ++fi ++ ++case $srcdir in ++ .) # No --srcdir option. We are building in place. ++ ac_srcdir=. ++ if test -z "$ac_top_builddir"; then ++ ac_top_srcdir=. ++ else ++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` ++ fi ;; ++ [\\/]* | ?:[\\/]* ) # Absolute path. ++ ac_srcdir=$srcdir$ac_dir_suffix; ++ ac_top_srcdir=$srcdir ;; + *) # Relative path. +- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" +- top_srcdir="$ac_dots$ac_given_srcdir" ;; ++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ++ ac_top_srcdir=$ac_top_builddir$srcdir ;; ++esac ++ ++# Do not use `cd foo && pwd` to compute absolute paths, because ++# the directories may not exist. ++case `pwd` in ++.) ac_abs_builddir="$ac_dir";; ++*) ++ case "$ac_dir" in ++ .) ac_abs_builddir=`pwd`;; ++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; ++ *) ac_abs_builddir=`pwd`/"$ac_dir";; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_builddir=${ac_top_builddir}.;; ++*) ++ case ${ac_top_builddir}. in ++ .) ac_abs_top_builddir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; ++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_srcdir=$ac_srcdir;; ++*) ++ case $ac_srcdir in ++ .) ac_abs_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; ++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_srcdir=$ac_top_srcdir;; ++*) ++ case $ac_top_srcdir in ++ .) ac_abs_top_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; ++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; ++ esac;; ++esac ++ ++ ++ case $INSTALL in ++ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; ++ *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + +- case "$ac_given_INSTALL" in +- [/$]*) INSTALL="$ac_given_INSTALL" ;; +- *) INSTALL="$ac_dots$ac_given_INSTALL" ;; +- esac +- echo creating "$ac_file" +- rm -f "$ac_file" +- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." +- case "$ac_file" in +- *Makefile*) ac_comsub="1i\\ +-# $configure_input" ;; +- *) ac_comsub= ;; +- esac +- sed -e "$ac_comsub +-s%@configure_input@%$configure_input%g +-s%@srcdir@%$srcdir%g +-s%@top_srcdir@%$top_srcdir%g +-s%@INSTALL@%$INSTALL%g +-" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file +-fi; done +-rm -f conftest.subs ++ # 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. */ ++ if test x"$ac_file" = x-; then ++ configure_input= ++ else ++ configure_input="$ac_file. " ++ fi ++ configure_input=$configure_input"Generated from `echo $ac_file_in | ++ sed 's,.*/,,'` by configure." + ++ # First look for the input files in the build tree, otherwise in the ++ # src tree. ++ ac_file_inputs=`IFS=: ++ for f in $ac_file_in; do ++ case $f in ++ -) echo $tmp/stdin ;; ++ [\\/$]*) ++ # Absolute (can't be DOS-style, as IFS=:) ++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 ++echo "$as_me: error: cannot find input file: $f" >&2;} ++ { (exit 1); exit 1; }; } ++ echo "$f";; ++ *) # Relative ++ if test -f "$f"; then ++ # Build tree ++ echo "$f" ++ elif test -f "$srcdir/$f"; then ++ # Source tree ++ echo "$srcdir/$f" ++ else ++ # /dev/null tree ++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 ++echo "$as_me: error: cannot find input file: $f" >&2;} ++ { (exit 1); exit 1; }; } ++ fi;; ++ esac ++ done` || { (exit 1); exit 1; } + ++ if test x"$ac_file" != x-; then ++ { echo "$as_me:$LINENO: creating $ac_file" >&5 ++echo "$as_me: creating $ac_file" >&6;} ++ rm -f "$ac_file" ++ fi ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF ++ sed "$ac_vpsub ++$extrasub ++_ACEOF ++cat >>$CONFIG_STATUS <<\_ACEOF ++:t ++/@[a-zA-Z_][a-zA-Z_0-9]*@/!b ++s,@configure_input@,$configure_input,;t t ++s,@srcdir@,$ac_srcdir,;t t ++s,@abs_srcdir@,$ac_abs_srcdir,;t t ++s,@top_srcdir@,$ac_top_srcdir,;t t ++s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t ++s,@builddir@,$ac_builddir,;t t ++s,@abs_builddir@,$ac_abs_builddir,;t t ++s,@top_builddir@,$ac_top_builddir,;t t ++s,@abs_top_builddir@,$ac_abs_top_builddir,;t t ++s,@INSTALL@,$ac_INSTALL,;t t ++" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out ++ rm -f $tmp/stdin ++ if test x"$ac_file" != x-; then ++ mv $tmp/out $ac_file ++ else ++ cat $tmp/out ++ rm -f $tmp/out ++ fi + +-exit 0 +-EOF ++done ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<\_ACEOF ++ ++{ (exit 0); exit 0; } ++_ACEOF + chmod +x $CONFIG_STATUS +-rm -fr confdefs* $ac_clean_files +-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 ++ac_clean_files=$ac_clean_files_save ++ ++ ++# configure is writing to config.log, and then calls config.status. ++# config.status does its own redirection, appending to config.log. ++# Unfortunately, on DOS this fails, as config.log is still kept open ++# by configure, so config.status won't be able to write to it; its ++# output is simply discarded. So we exec the FD to /dev/null, ++# effectively closing config.log, so it can be properly (re)opened and ++# appended to by config.status. When coming back to configure, we ++# need to make the FD available again. ++if test "$no_create" != yes; then ++ ac_cs_success=: ++ ac_config_status_args= ++ test "$silent" = yes && ++ ac_config_status_args="$ac_config_status_args --quiet" ++ exec 5>/dev/null ++ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false ++ exec 5>>config.log ++ # Use ||, not &&, to avoid exiting from the if with $? = 1, which ++ # would make configure fail if this is the last instruction. ++ $ac_cs_success || { (exit 1); exit 1; } ++fi + +--- rcs-5.7.orig/configure.in ++++ rcs-5.7/configure.in +@@ -243,7 +243,7 @@ + AC_PATH_PROG(ED, ed, ed) + + ac_save_path=$PATH +-PATH=/usr/lib:/usr/bin:/bin:/usr/sbin:/sbin:$PATH ++PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/lib:$PATH + AC_PATH_PROGS(SENDMAIL, sendmail mail mailx) + PATH=$ac_save_path + case $SENDMAIL in +--- rcs-5.7.orig/src/rcs.c ++++ rcs-5.7/src/rcs.c +@@ -916,10 +916,11 @@ + getkeystring(Klog); + if (nextdelta == cuttail) { + cb = savestring(&curlogbuf); +- if (!delta->log.string) ++ if (delta && !delta->log.string) + delta->log = cleanlogmsg(curlogbuf.string, cb.size); + nextlex(); +- delta->igtext = getphrases(Ktext); ++ if (delta) ++ delta->igtext = getphrases(Ktext); + } else { + if (nextdelta->log.string && nextdelta->selector) { + foutptr = 0; +--- rcs-5.7.orig/src/rcsfreeze.sh ++++ rcs-5.7/src/rcsfreeze.sh +@@ -59,8 +59,7 @@ + + # Stamp the logfile. Because we order the logfile the most recent + # first we will have to save everything right now in a temporary file. +-TMPLOG=/tmp/rcsfrz$$ +-trap 'rm -f $TMPLOG; exit 1' 1 2 13 15 ++TMPLOG=$(tempfile) + # Now ask for a log message, continously add to the log file + ( + echo "Version: $SYMREVNAME($SYMREV), Date: $DATE +--- rcs-5.7.orig/src/rcsbase.h ++++ rcs-5.7/src/rcsbase.h +@@ -358,6 +358,7 @@ + char const * lockedby; /* who locks the revision */ + char const * state; /* state of revision (Exp by default) */ + char const * name; /* name (if any) by which retrieved */ ++ char const * commitid; /* text string to associate commits */ + struct cbuf log; /* log message requested at checkin */ + struct branchhead * branches; /* list of first revisions on branches*/ + struct cbuf ig; /* ignored phrases in admin part */ +@@ -662,6 +663,7 @@ + extern char const *const expand_names[]; + extern char const + Kaccess[], Kauthor[], Kbranch[], Kcomment[], ++ Kcommitid[], + Kdate[], Kdesc[], Kexpand[], Khead[], Klocks[], Klog[], + Knext[], Kstate[], Kstrict[], Ksymbols[], Ktext[]; + void unexpected_EOF P((void)) exiting; +--- rcs-5.7.orig/src/rcssyn.c ++++ rcs-5.7/src/rcssyn.c +@@ -171,6 +171,7 @@ + Kauthor[] = "author", + Kbranch[] = "branch", + Kcomment[] = "comment", ++ Kcommitid[] = "commitid", + Kdate[] = "date", + Kdesc[] = "desc", + Kexpand[] = "expand", +@@ -433,6 +434,14 @@ + Delta->lockedby = 0; + Delta->log.string = 0; + Delta->selector = true; ++ ++ if (getkeyopt(Kcommitid)) { ++ Delta->commitid = NextString; ++ nextlex(); ++ getsemi(Kcommitid); ++ } else ++ Delta->commitid = NULL; ++ + Delta->ig = getphrases(Kdesc); + TotalDeltas++; + return (true); +--- rcs-5.7.orig/src/rcsdiff.c ++++ rcs-5.7/src/rcsdiff.c +@@ -212,9 +212,13 @@ + } + goto option_handled; + case '-': case 'D': +- no_diff_means_no_output = false; ++ if (c == 'D' ++ || strcmp(*argv, "--side-by-side") == 0 ++ || strcmp(*argv, "--ifdef") == 0) { ++ no_diff_means_no_output = false; ++ } + /* fall into */ +- case 'C': case 'F': case 'I': case 'L': case 'W': ++ case 'C': case 'F': case 'I': case 'L': case 'U': case 'W': + #if DIFF_L + if (c == 'L' && ++file_labels == 2) + faterror("too many -L options"); +--- rcs-5.7.orig/src/ident.c ++++ rcs-5.7/src/ident.c +@@ -234,7 +234,7 @@ + if (c == EOF && feof(fp) | ferror(fp)) + return c; + switch (ctab[c]) { +- case LETTER: case Letter: ++ case LETTER: case Letter: case DIGIT: + *tp++ = c; + if (tp < line+sizeof(line)-4) + break; +--- rcs-5.7.orig/src/conf.sh ++++ rcs-5.7/src/conf.sh +@@ -73,17 +73,6 @@ + ech='echo -n' dots='... ' + esac + +-$ech >&3 "$0: testing permissions $dots" +-rm -f a.d && +-date >a.d && +-chmod 0 a.d && +-{ test -w a.d || cp /dev/null a.d 2>/dev/null; } && { +- echo >&3 "$n$0: This command should not be run with superuser permissions." +- exit 1 +-} +-echo >&3 OK +-rm -f a.d || exit +- + $ech >&3 "$0: testing compiler for plausibility $dots" + echo 'main() { return 0; }' >a.c + rm -f a.exe a.out || exit +--- rcs-5.7.orig/src/rcsgen.c ++++ rcs-5.7/src/rcsgen.c +@@ -547,6 +547,9 @@ + + aprintf(fout, ";\n%s\t%s;\n", Knext, node->next?node->next->num:""); + awrite(node->ig.string, node->ig.size, fout); ++ ++ if (node->commitid) ++ aprintf(fout, "%s\t%s;\n", Kcommitid, node->commitid); + } + + +--- rcs-5.7.orig/src/rcsfnms.c ++++ rcs-5.7/src/rcsfnms.c +@@ -285,6 +285,9 @@ + { + char *p; + char const *t = tpnames[n]; ++# if has_mktemp ++ int fd; ++# endif + + if (t) + return t; +@@ -296,10 +299,12 @@ + size_t tplen = dir_useful_len(tp); + p = testalloc(tplen + 10); + VOID sprintf(p, "%.*s%cT%cXXXXXX", (int)tplen, tp, SLASH, '0'+n); +- if (!mktemp(p) || !*p) ++ fd = mkstemp(p); ++ if (fd < 0 || !*p) + faterror("can't make temporary pathname `%.*s%cT%cXXXXXX'", + (int)tplen, tp, SLASH, '0'+n + ); ++ close(fd); + # else + static char tpnamebuf[TEMPNAMES][L_tmpnam]; + p = tpnamebuf[n]; +--- rcs-5.7.orig/src/rcsedit.c ++++ rcs-5.7/src/rcsedit.c +@@ -1503,6 +1503,9 @@ + register size_t dl; + register struct buf *bn; + register char const *name = isworkfile ? workname : RCSname; ++# if has_mktemp ++ int fd; ++# endif + + dl = basefilename(name) - name; + bn = &dirtpname[newRCSdirtp_index + isworkfile]; +@@ -1521,10 +1524,12 @@ + catchints(); + # if has_mktemp + VOID strcpy(tp, "XXXXXX"); +- if (!mktemp(np) || !*np) ++ fd = mkstemp(np); ++ if (fd < 0 || !*np) + faterror("can't make temporary pathname `%.*s_%cXXXXXX'", + (int)dl, name, '0'+isworkfile + ); ++ close(fd); + # else + /* + * Posix 1003.1-1990 has no reliable way +--- rcs-5.7.orig/src/Makefile.in ++++ rcs-5.7/src/Makefile.in +@@ -116,16 +116,18 @@ + for p in $(PROGRAMS); do \ + $(INSTALL_PROGRAM) $$p $(bindir)/$$p; \ + done ++ $(INSTALL_PROGRAM) rcsfreeze.sh $(bindir)/rcsfreeze + + uninstall :: + for p in $(PROGRAMS); do \ + $(REMOVE) $(bindir)/$$p; \ + done ++ $(REMOVE) $(bindir)/rcsfreeze + + # Install RCS and (if applicable) GNU diff before running these tests. + # To test RCS before installing it, see the file INSTALL.RCS. + RCSTEST = \ +- ALL_CFLAGS='$(ALL_CFLAGS)' CC='$(CC)' DIFF='$(DIFF)' \ ++ ALL_CFLAGS="$(ALL_CFLAGS)" CC='$(CC)' DIFF='$(DIFF)' \ + LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' \ + PATH=$(bindir):$$PATH \ + sh $(srcdir)/rcstest +@@ -153,7 +155,7 @@ + #(Unix + conf.h : conf.sh Makefile + $(REMOVE) a.* +- ALL_CFLAGS='$(ALL_CFLAGS)' \ ++ ALL_CFLAGS="$(ALL_CFLAGS)" \ + CC='$(CC)' \ + COMPAT2='$(COMPAT2)' \ + DIFF3='$(DIFF3)' DIFF3_BIN='$(DIFF3_BIN)' \ +--- rcs-5.7.orig/src/rlog.c ++++ rcs-5.7/src/rlog.c +@@ -591,6 +591,10 @@ + aprintf(out, insDelFormat, + editscript->insertlns, editscript->deletelns); + ++ if ( node->commitid ) ++ aprintf(out, "%s commitid: %s", (editscript) ? ";" : "", ++ node->commitid); ++ + newbranch = node->branches; + if ( newbranch ) { + bufautobegin(&branchnum); diff --git a/utils/rcs/patches/100-cross_compile.patch b/utils/rcs/patches/100-cross_compile.patch new file mode 100644 index 0000000..665ca0f --- /dev/null +++ b/utils/rcs/patches/100-cross_compile.patch @@ -0,0 +1,413 @@ +--- /dev/null ++++ b/src/conf.h +@@ -0,0 +1,399 @@ ++/* RCS compile-time configuration */ ++ ++ /* $Id: conf.sh,v 5.25 1995/06/16 06:19:24 eggert Exp $ */ ++ ++/* ++ * This file is generated automatically. ++ * If you edit it by hand your changes may be lost. ++ * Instead, please try to fix conf.sh, ++ * and send your fixes to rcs-bugs@cs.purdue.edu. ++ */ ++ ++#define exitmain(n) return n /* how to exit from main() */ ++/* #define _POSIX_C_SOURCE 2147483647L */ /* if strict C + Posix 1003.1b-1993 or later */ ++/* #define _POSIX_SOURCE */ /* if strict C + Posix 1003.1-1990 */ ++ ++#include ++#include ++#include ++ ++/* Comment out #include lines below that do not work. */ ++#include ++#include ++#include ++#include ++#include ++/* #include */ ++/* #include */ ++#include ++/* #include */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++/* #include */ ++ ++/* Define boolean symbols to be 0 (false, the default), or 1 (true). */ ++#define has_sys_param_h 1 /* Does #include work? */ ++/* extern int errno; */ /* Uncomment if doesn't declare errno. */ ++#define has_readlink 1 /* Does readlink() work? */ ++#define readlink_isreg_errno EINVAL /* errno after readlink on regular file */ ++ ++#if has_readlink && !defined(MAXSYMLINKS) ++# if has_sys_param_h ++# include ++# endif ++# ifndef MAXSYMLINKS ++# define MAXSYMLINKS 20 /* BSD; not standard yet */ ++# endif ++#endif ++ ++/* Comment out the typedefs below if the types are already declared. */ ++/* Fix any uncommented typedefs that are wrong. */ ++/* typedef int mode_t; */ ++/* typedef long off_t; */ ++/* typedef int pid_t; */ ++/* typedef int sig_atomic_t; */ ++/* typedef unsigned size_t; */ ++/* typedef int ssize_t; */ ++/* typedef long time_t; */ ++/* typedef int uid_t; */ ++ ++/* Comment out the keyword definitions below if the keywords work. */ ++/* #define const */ ++/* #define volatile */ ++ ++/* Define boolean symbols to be 0 (false, the default), or 1 (true). */ ++#define has_prototypes 1 /* Do function prototypes work? */ ++#define has_stdarg 1 /* Does work? */ ++/* #define has_varargs ? */ /* Does work? */ ++#define va_start_args 2 /* How many args does va_start() take? */ ++ ++#if O_BINARY ++ /* Text and binary i/o behave differently. */ ++ /* This is incompatible with Posix and Unix. */ ++# define FOPEN_RB "rb" ++# define FOPEN_R_WORK (Expand==BINARY_EXPAND ? "r" : "rb") ++# define FOPEN_WB "wb" ++# define FOPEN_W_WORK (Expand==BINARY_EXPAND ? "w" : "wb") ++# define FOPEN_WPLUS_WORK (Expand==BINARY_EXPAND ? "w+" : "w+b") ++# define OPEN_O_BINARY O_BINARY ++#else ++ /* ++ * Text and binary i/o behave the same. ++ * Omit "b", since some nonstandard hosts reject it. ++ */ ++# define FOPEN_RB "r" ++# define FOPEN_R_WORK "r" ++# define FOPEN_WB "w" ++# define FOPEN_W_WORK "w" ++# define FOPEN_WPLUS_WORK "w+" ++# define OPEN_O_BINARY 0 ++#endif ++ ++/* This may need changing on non-Unix systems (notably DOS). */ ++#define OPEN_CREAT_READONLY (S_IRUSR|S_IRGRP|S_IROTH) /* lock file mode */ ++#define OPEN_O_LOCK 0 /* extra open flags for creating lock file */ ++#define OPEN_O_WRONLY O_WRONLY /* main open flag for creating a lock file */ ++ ++/* Define or comment out the following symbols as needed. */ ++#if has_prototypes ++# define P(params) params ++#else ++# define P(params) () ++#endif ++#if has_stdarg ++# include ++#else ++# if has_varargs ++# include ++# else ++ typedef char *va_list; ++# define va_dcl int va_alist; ++# define va_start(ap) ((ap) = (va_list)&va_alist) ++# define va_arg(ap,t) (((t*) ((ap)+=sizeof(t))) [-1]) ++# define va_end(ap) ++# endif ++#endif ++#if va_start_args == 2 ++# define vararg_start va_start ++#else ++# define vararg_start(ap,p) va_start(ap) ++#endif ++#define bad_chmod_close 0 /* Can chmod() close file descriptors? */ ++#define bad_creat0 0 /* Do writes fail after creat(f,0)? */ ++#define bad_fopen_wplus 0 /* Does fopen(f,"w+") fail to truncate f? */ ++#define getlogin_is_secure 0 /* Is getlogin() secure? Usually it's not. */ ++#define has_attribute_noreturn 1 /* Does __attribute__((noreturn)) work? */ ++#if has_attribute_noreturn ++# define exiting __attribute__((noreturn)) ++#else ++# define exiting ++#endif ++#define has_dirent 1 /* Do opendir(), readdir(), closedir() work? */ ++#define void_closedir 0 /* Does closedir() yield void? */ ++#define has_fchmod 1 /* Does fchmod() work? */ ++#define has_fflush_input 1 /* Does fflush() work on input files? */ ++#define has_fputs 1 /* Does fputs() work? */ ++#define has_ftruncate 1 /* Does ftruncate() work? */ ++#define has_getuid 1 /* Does getuid() work? */ ++#define has_getpwuid 1 /* Does getpwuid() work? */ ++#define has_memcmp 1 /* Does memcmp() work? */ ++#define has_memcpy 1 /* Does memcpy() work? */ ++#define has_memmove 1 /* Does memmove() work? */ ++#define has_map_fd 0 /* Does map_fd() work? */ ++#define has_mmap 1 /* Does mmap() work on regular files? */ ++#define has_madvise 1 /* Does madvise() work? */ ++#define mmap_signal SIGBUS /* signal received if you reference nonexistent part of mmapped file */ ++#define has_rename 1 /* Does rename() work? */ ++#define bad_a_rename 0 /* Does rename(A,B) fail if A is unwritable? */ ++#define bad_b_rename 0 /* Does rename(A,B) fail if B is unwritable? */ ++#define bad_NFS_rename 0 /* Can rename(A,B) falsely report success? */ ++/* typedef int void; */ /* Some ancient compilers need this. */ ++#define VOID (void) /* 'VOID e;' discards the value of an expression 'e'. */ ++#define has_seteuid 1 /* Does seteuid() work? See ../INSTALL.RCS. */ ++#define has_setreuid 0 /* Does setreuid() work? See ../INSTALL.RCS. */ ++#define has_setuid 1 /* Does setuid() exist? */ ++#define has_sigaction 1 /* Does struct sigaction work? */ ++#define has_sa_sigaction 1 /* Does struct sigaction have sa_sigaction? */ ++#define has_signal 1 /* Does signal() work? */ ++#define signal_type void /* type returned by signal handlers */ ++#define sig_zaps_handler 0 /* Must a signal handler reinvoke signal()? */ ++/* #define has_sigblock ? */ /* Does sigblock() work? */ ++/* #define sigmask(s) (1 << ((s)-1)) */ /* Yield mask for signal number. */ ++typedef size_t fread_type; /* type returned by fread() and fwrite() */ ++typedef size_t freadarg_type; /* type of their size arguments */ ++typedef void *malloc_type; /* type returned by malloc() */ ++#define has_getcwd 1 /* Does getcwd() work? */ ++/* #define has_getwd ? */ /* Does getwd() work? */ ++#define needs_getabsname 0 /* Must we define getabsname? */ ++#define has_mktemp 1 /* Does mktemp() work? */ ++#define has_NFS 1 /* Might NFS be used? */ ++#define has_psiginfo 0 /* Does psiginfo() work? */ ++#define has_psignal 1 /* Does psignal() work? */ ++/* #define has_si_errno ? */ /* Does siginfo_t have si_errno? */ ++/* #define has_sys_siglist ? */ /* Does sys_siglist[] work? */ ++/* #define strchr index */ /* Use old-fashioned name for strchr()? */ ++/* #define strrchr rindex */ /* Use old-fashioned name for strrchr()? */ ++#define bad_unlink 0 /* Does unlink() fail on unwritable files? */ ++#define has_vfork 1 /* Does vfork() work? */ ++#define has_fork 1 /* Does fork() work? */ ++#define has_spawn 0 /* Does spawn*() work? */ ++#define has_waitpid 1 /* Does waitpid() work? */ ++#define bad_wait_if_SIGCHLD_ignored 1 /* Does ignoring SIGCHLD break wait()? */ ++#define RCS_SHELL "/bin/sh" /* shell to run RCS subprograms */ ++#define has_printf_dot 1 /* Does "%.2d" print leading 0? */ ++#define has_vfprintf 1 /* Does vfprintf() work? */ ++#define has_attribute_format_printf 1 /* Does __attribute__((format(printf,N,N+1))) work? */ ++#if has_attribute_format_printf ++# define printf_string(m, n) __attribute__((format(printf, m, n))) ++#else ++# define printf_string(m, n) ++#endif ++#if has_attribute_format_printf && has_attribute_noreturn ++ /* Work around a bug in GCC 2.5.x. */ ++# define printf_string_exiting(m, n) __attribute__((format(printf, m, n), noreturn)) ++#else ++# define printf_string_exiting(m, n) printf_string(m, n) exiting ++#endif ++/* #define has__doprintf ? */ /* Does _doprintf() work? */ ++/* #define has__doprnt ? */ /* Does _doprnt() work? */ ++/* #undef EXIT_FAILURE */ /* Uncomment this if EXIT_FAILURE is broken. */ ++#define large_memory 1 /* Can main memory hold entire RCS files? */ ++#ifndef LONG_MAX ++#define LONG_MAX 2147483647L /* long maximum */ ++#endif ++/* Do struct stat s and t describe the same file? Answer d if unknown. */ ++#define same_file(s,t,d) ((s).st_ino==(t).st_ino && (s).st_dev==(t).st_dev) ++#define has_utimbuf 1 /* Does struct utimbuf work? */ ++#define CO "/usr/bin/co" /* name of 'co' program */ ++#define COMPAT2 0 /* Are version 2 files supported? */ ++#define DIFF "/usr/bin/diff" /* name of 'diff' program */ ++#define DIFF3 "/usr/bin/diff3" /* name of 'diff3' program */ ++#define DIFF3_BIN 1 /* Is diff3 user-visible (not the /usr/lib auxiliary)? */ ++#define DIFFFLAGS "-an" /* Make diff output suitable for RCS. */ ++#define DIFF_L 1 /* Does diff -L work? */ ++#define DIFF_SUCCESS 0 /* DIFF status if no differences are found */ ++#define DIFF_FAILURE 1 /* DIFF status if differences are found */ ++#define DIFF_TROUBLE 2 /* DIFF status if trouble */ ++#define ED "/bin/ed" /* name of 'ed' program (used only if !DIFF3_BIN) */ ++#define MERGE "/usr/bin/merge" /* name of 'merge' program */ ++#define TMPDIR "/tmp" /* default directory for temporary files */ ++#define SLASH '/' /* principal filename separator */ ++#define SLASHes '/' /* `case SLASHes:' labels all filename separators */ ++#define isSLASH(c) ((c) == SLASH) /* Is arg a filename separator? */ ++#define ROOTPATH(p) isSLASH((p)[0]) /* Is p an absolute pathname? */ ++#define X_DEFAULT ",v/" /* default value for -x option */ ++#define SLASHSLASH_is_SLASH 1 /* Are // and / the same directory? */ ++#define ALL_ABSOLUTE 1 /* Do all subprograms satisfy ROOTPATH? */ ++#define DIFF_ABSOLUTE 1 /* Is ROOTPATH(DIFF) true? */ ++#define SENDMAIL "/usr/sbin/sendmail" /* how to send mail */ ++#define TZ_must_be_set 0 /* Must TZ be set for gmtime() to work? */ ++ ++ ++ ++/* Adjust the following declarations as needed. */ ++ ++ ++/* The rest is for the benefit of non-standard, traditional hosts. */ ++/* Don't bother to declare functions that in traditional hosts do not appear, */ ++/* or are declared in .h files, or return int or void. */ ++ ++ ++/* traditional BSD */ ++ ++#if has_sys_siglist && !defined(sys_siglist) ++ extern char const * const sys_siglist[]; ++#endif ++ ++ ++/* Posix (ISO/IEC 9945-1: 1990 / IEEE Std 1003.1-1990) */ ++ ++/* */ ++#ifdef O_CREAT ++# define open_can_creat 1 ++#else ++# define open_can_creat 0 ++# define O_RDONLY 0 ++# define O_WRONLY 1 ++# define O_RDWR 2 ++# define O_CREAT 01000 ++# define O_TRUNC 02000 ++#endif ++#ifndef O_EXCL ++#define O_EXCL 0 ++#endif ++ ++/* */ ++#ifndef S_IRUSR ++# ifdef S_IREAD ++# define S_IRUSR S_IREAD ++# else ++# define S_IRUSR 0400 ++# endif ++# ifdef S_IWRITE ++# define S_IWUSR S_IWRITE ++# else ++# define S_IWUSR (S_IRUSR/2) ++# endif ++#endif ++#ifndef S_IRGRP ++# if has_getuid ++# define S_IRGRP (S_IRUSR / 0010) ++# define S_IWGRP (S_IWUSR / 0010) ++# define S_IROTH (S_IRUSR / 0100) ++# define S_IWOTH (S_IWUSR / 0100) ++# else ++ /* single user OS -- not Posix or Unix */ ++# define S_IRGRP 0 ++# define S_IWGRP 0 ++# define S_IROTH 0 ++# define S_IWOTH 0 ++# endif ++#endif ++#ifndef S_ISREG ++#define S_ISREG(n) (((n) & S_IFMT) == S_IFREG) ++#endif ++ ++/* */ ++#ifndef WEXITSTATUS ++#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) ++#undef WIFEXITED /* Avoid 4.3BSD incompatibility with Posix. */ ++#endif ++#ifndef WIFEXITED ++#define WIFEXITED(stat_val) (((stat_val) & 0377) == 0) ++#endif ++#ifndef WTERMSIG ++#define WTERMSIG(stat_val) ((stat_val) & 0177) ++#undef WIFSIGNALED /* Avoid 4.3BSD incompatibility with Posix. */ ++#endif ++#ifndef WIFSIGNALED ++#define WIFSIGNALED(stat_val) ((unsigned)(stat_val) - 1 < 0377) ++#endif ++ ++/* */ ++char *getlogin P((void)); ++#ifndef STDIN_FILENO ++# define STDIN_FILENO 0 ++# define STDOUT_FILENO 1 ++# define STDERR_FILENO 2 ++#endif ++#if has_fork && !has_vfork ++# undef vfork ++# define vfork fork ++#endif ++#if has_getcwd || !has_getwd ++ char *getcwd P((char*,size_t)); ++#else ++ char *getwd P((char*)); ++#endif ++#if has_setuid && !has_seteuid ++# undef seteuid ++# define seteuid setuid ++#endif ++#if has_spawn ++# if ALL_ABSOLUTE ++# define spawn_RCS spawnv ++# else ++# define spawn_RCS spawnvp ++# endif ++#else ++# if ALL_ABSOLUTE ++# define exec_RCS execv ++# else ++# define exec_RCS execvp ++# endif ++#endif ++ ++/* utime.h */ ++#if !has_utimbuf ++ struct utimbuf { time_t actime, modtime; }; ++#endif ++ ++ ++/* Standard C library */ ++ ++/* */ ++#ifndef L_tmpnam ++#define L_tmpnam 32 /* power of 2 > sizeof("/usr/tmp/xxxxxxxxxxxxxxx") */ ++#endif ++#ifndef SEEK_SET ++#define SEEK_SET 0 ++#endif ++#ifndef SEEK_CUR ++#define SEEK_CUR 1 ++#endif ++#if has_mktemp ++ char *mktemp P((char*)); /* traditional */ ++#else ++ char *tmpnam P((char*)); ++#endif ++ ++/* */ ++char *getenv P((char const*)); ++void _exit P((int)) exiting; ++void exit P((int)) exiting; ++malloc_type malloc P((size_t)); ++malloc_type realloc P((malloc_type,size_t)); ++#ifndef EXIT_FAILURE ++#define EXIT_FAILURE 1 ++#endif ++#ifndef EXIT_SUCCESS ++#define EXIT_SUCCESS 0 ++#endif ++ ++/* */ ++char *strcpy P((char*,char const*)); ++char *strchr P((char const*,int)); ++char *strrchr P((char const*,int)); ++void *memcpy P((void*,void const*,size_t)); ++#if has_memmove ++ void *memmove P((void*,void const*,size_t)); ++#endif ++ ++/* */ ++time_t time P((time_t*)); +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -153,7 +153,7 @@ + $(REMOVE) TAGS + + #(Unix +-conf.h : conf.sh Makefile ++conf.h : + $(REMOVE) a.* + ALL_CFLAGS="$(ALL_CFLAGS)" \ + CC='$(CC)' \ diff --git a/utils/rdiff-backup/Makefile b/utils/rdiff-backup/Makefile new file mode 100644 index 0000000..33ec189 --- /dev/null +++ b/utils/rdiff-backup/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2006-2009 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:=rdiff-backup +PKG_VERSION:=1.2.8 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://savannah.nongnu.org/download/rdiff-backup/ +PKG_MD5SUM:=1a94dc537fcf74d6a3a80bd27808e77b + +PKG_BUILD_DEPENDS:=python + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/rdiff-backup + SUBMENU:=backup + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Incremental backup utility + URL:=http://www.nongnu.org/rdiff-backup + DEPENDS:=+python +librsync +libpopt +openssl-util +endef + +define Package/rdiff-backup/description + rdiff-backup backs up one directory to another, possibly over a + network. The target directory ends up a copy of the source directory, + but extra reverse diffs are stored in a special subdirectory of that + target directory, so you can still recover files lost some time ago. + The idea is to combine the best features of a mirror and an incremental + backup. +endef + +define PyPackage/rdiff-backup/filespec ++|/usr/bin/rdiff-backup ++|$(PYTHON_PKG_DIR)/rdiff_backup +endef + +define Build/Compile + $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false) + $(call Build/Compile/PyMod,., \ + build --librsync-dir="$(STAGING_DIR)/usr" , \ + ) + $(call Build/Compile/PyMod,., \ + install --prefix="$(PKG_INSTALL_DIR)/usr", \ + ) +endef + +$(eval $(call PyPackage,rdiff-backup)) +$(eval $(call BuildPackage,rdiff-backup)) diff --git a/utils/rdiff-backup/patches/001-python_path.patch b/utils/rdiff-backup/patches/001-python_path.patch new file mode 100644 index 0000000..5142645 --- /dev/null +++ b/utils/rdiff-backup/patches/001-python_path.patch @@ -0,0 +1,8 @@ +--- a/rdiff-backup ++++ b/rdiff-backup +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python + # rdiff-backup -- Mirror files while keeping incremental changes + # Version 1.0.5 released November 11, 2006 + # Copyright (C) 2001-2005 Ben Escoto diff --git a/utils/reiserfsprogs/Makefile b/utils/reiserfsprogs/Makefile new file mode 100644 index 0000000..228b687 --- /dev/null +++ b/utils/reiserfsprogs/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2006-2009 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:=reiserfsprogs +PKG_VERSION:=3.6.21 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@KERNEL/linux/utils/fs/reiserfs/ +PKG_MD5SUM:=bc00c7c4e047902575dc4e1c64ab3ba4 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/reiserfsprogs + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Filesystem + TITLE:=ReiserFS filesystems utilities + URL:=http://www.namesys.com/ +endef + +define Package/reiserfsprogs/description + This package contains utilities to create, check, + resize, and debug ReiserFS filesystems. +endef + +define Package/reiserfsprogs/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(foreach bin,debugreiserfs mkreiserfs reiserfsck reiserfstune resize_reiserfs,$(PKG_INSTALL_DIR)/usr/sbin/$(bin)) $(1)/usr/sbin/ + ln -sf mkreiserfs $(1)/usr/sbin/mkfs.reiserfs + ln -sf reiserfsck $(1)/usr/sbin/fsck.reiserfs +endef + +$(eval $(call BuildPackage,reiserfsprogs)) diff --git a/utils/remind/Makefile b/utils/remind/Makefile new file mode 100644 index 0000000..8f28b3c --- /dev/null +++ b/utils/remind/Makefile @@ -0,0 +1,45 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=remind +PKG_VERSION:=03.01.12 +PKG_RELEASE:=1 + +PKG_SOURCE:=remind-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.roaringpenguin.com/files/download/ +PKG_MD5SUM:=de16cbfc3ee94defcb1abdf78b2ebcd1 +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/remind-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/remind + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Reminder + URL:=http://www.roaringpenguin.com/files/download/ +endef + +define Package/remind/description + Remind is a powerfull commadline reminder. +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --prefix=/usr --with-linux-headers="$(LINUX_DIR)" \ + ) +endef + +define Package/remind/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/remind $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/rem2ps $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/www/rem2html $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,remind)) diff --git a/utils/restorefactory/Makefile b/utils/restorefactory/Makefile new file mode 100644 index 0000000..577592b --- /dev/null +++ b/utils/restorefactory/Makefile @@ -0,0 +1,38 @@ +# +# Copyright (C) 2010 segal.di.ubi.pt +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=restorefactory +PKG_VERSION:=1 +PKG_RELEASE:=6 + +include $(INCLUDE_DIR)/package.mk + +define Package/restorefactory + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Mimic original functionality of the reset button + MAINTAINER:=Nuno Goncalves +endef + +define Package/restorefactory/description +RestoreFactory handles the reset button event and issues a "firstboot" command. +Button and wait time can be configured with a UCI file. +endef + +define Build/Compile +endef + +define Package/restorefactory/install + $(INSTALL_DIR) $(1)/etc/hotplug.d/button + $(INSTALL_BIN) ./files/hotplug_restorefactory $(1)/etc/hotplug.d/button/50-restorefactory + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/uci_defaults_restorefactory $(1)/etc/uci-defaults/50-restorefactory +endef + +$(eval $(call BuildPackage,restorefactory)) diff --git a/utils/restorefactory/files/hotplug_restorefactory b/utils/restorefactory/files/hotplug_restorefactory new file mode 100755 index 0000000..5273499 --- /dev/null +++ b/utils/restorefactory/files/hotplug_restorefactory @@ -0,0 +1,31 @@ +#!/bin/sh + +system_config() { + config_get button "$1" button "reset" + config_get action "$1" action "pressed" + config_get timeout "$1" timeout "5" +} + +config_load system +config_foreach system_config restorefactory + +[ "$BUTTON" = "$button" ] && { + + [ -f /tmp/run/restorefactory.pid ] && read PID < /tmp/run/restorefactory.pid && kill $PID && rm /tmp/run/restorefactory.pid && logger -p user.info -t "restorefactory" "restore to factory defaults aborted" + + [ "$ACTION" = "$action" ] && { + + if [ "$timeout" -gt 0 ] + then + sleep "$timeout" && firstboot && reboot & + echo $! > /tmp/run/restorefactory.pid + logger -p user.info -t "restorefactory" "restoring to factory defaults in $timeout seconds" + elif [ "$timeout" -eq 0 ] + then + firstboot && reboot & + else + logger -p user.info -t "restorefactory" "invalid timeout value ($timeout)" + fi + } +} + diff --git a/utils/restorefactory/files/uci_defaults_restorefactory b/utils/restorefactory/files/uci_defaults_restorefactory new file mode 100755 index 0000000..1af088e --- /dev/null +++ b/utils/restorefactory/files/uci_defaults_restorefactory @@ -0,0 +1,10 @@ +#!/bin/sh + +uci -q show system.@restorefactory[0] || { + uci add system restorefactory + uci set system.@restorefactory[0].button=reset + uci set system.@restorefactory[0].action=pressed + uci set system.@restorefactory[0].timeout=5 + uci commit +} + diff --git a/utils/rng-tools/Makefile b/utils/rng-tools/Makefile new file mode 100644 index 0000000..474589c --- /dev/null +++ b/utils/rng-tools/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2011 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:=rng-tools +PKG_VERSION:=3 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.sourceforge.net/project/gkernel/rng-tools/3/ +PKG_MD5SUM:=fa305916ec101c85c0065aeceb81a38d + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/rng-tools + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+USE_UCLIBC:argp-standalone + TITLE:=Daemon for adding entropy to kernel entropy pool + URL:=http://sourceforge.net/projects/gkernel/ +endef + +ifdef CONFIG_USE_UCLIBC +CONFIGURE_VARS += \ + LIBS="-largp" +endif + +define Package/rng-tools/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/rngd.init $(1)/etc/init.d/rngd + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/rngtest $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/rngd $(1)/sbin/ +endef + +$(eval $(call BuildPackage,rng-tools)) diff --git a/utils/rng-tools/files/rngd.init b/utils/rng-tools/files/rngd.init new file mode 100644 index 0000000..74d23b3 --- /dev/null +++ b/utils/rng-tools/files/rngd.init @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2011 OpenWrt.org + +START=98 + +RNGD_INTERVAL=30 +RNGD_AMOUNT=4000 +RNGD_DEVICE="/dev/urandom" + +start() { + service_start /sbin/rngd -r $RNGD_DEVICE -W $RNGD_AMOUNT -t $RNGD_INTERVAL +} + +stop() { + service_stop /sbin/rngd +} diff --git a/utils/rrdcollect/Makefile b/utils/rrdcollect/Makefile new file mode 100644 index 0000000..c79d388 --- /dev/null +++ b/utils/rrdcollect/Makefile @@ -0,0 +1,158 @@ +# +# Copyright (C) 2006-2011 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:=rrdcollect +PKG_VERSION:=0.2.4 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/rrdcollect +PKG_MD5SUM:=fd7ac95195e3e5cbab0677629505d9be + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/rrdcollect/Default + SECTION:=utils + CATEGORY:=Utilities + URL:=http://rrdcollect.sourceforge.net/ +endef + +define Package/rrdcollect/Default/description + RRDcollect is a daemon which polls ceratin files in /proc/ + directory, gathering data and storing it inside RRDtool's + database files. Being written in C should be both fast + and resources-friendly. Supports both scanf(3)-style + pattern matches and perl compatible regular expressions. +endef + +define Package/rrdcollect10 +$(call Package/rrdcollect/Default) + TITLE:=Round-Robin Database (RRD) collecting daemon + PROVIDES:=rrdcollect + DEPENDS:=+librrd1 + VARIANT:=rrdtool10 +endef + +define Package/rrdcollect10/description +$(call Package/rrdcollect/Default/description) + . + This package contains the RRD collecting daemon, linked against + rrdtool-1.0.x shared library. +endef + +define Package/rrdcollect12 +$(call Package/rrdcollect/Default) + TITLE:=Round-Robin Database (RRD) collecting daemon + PROVIDES:=rrdcollect + DEPENDS:=+librrd + VARIANT:=rrdtool12 +endef + +define Package/rrdcollect12/description +$(call Package/rrdcollect/Default/description) + . + This package contains the RRD collecting daemon, linked against + rrdtool-1.2.x shared library. +endef + + +define Package/rrdcollect10-example +$(call Package/rrdcollect/Default) + TITLE:=Example setup for RRD collecting daemon above + DEPENDS:=rrdcollect +rrdtool1 + VARIANT:=rrdtool12 +endef + +define Package/rrdcollect10-example/description +$(call Package/rrdcollect/Default/description) + . + This package contains examples for the RRD collecting daemon, using + rrdtool-1.0.x shared library and utilities. +endef + +define Package/rrdcollect12-example +$(call Package/rrdcollect/Default) + TITLE:=Example setup for RRD collecting daemon above + DEPENDS:=rrdcollect +rrdtool + VARIANT:=rrdtool12 +endef + +define Package/rrdcollect12-example/description +$(call Package/rrdcollect/Default/description) + This package contains examples for the RRD collecting daemon, using + rrdtool-1.2.x shared library and utilities. +endef + + +CONFIGURE_ARGS+= \ + --enable-shared \ + --disable-static \ + --disable-rpath \ + --enable-exec \ + --without-rrdtool \ + --with-librrd \ + --without-libpcre \ + --without-libpcap \ + +CONFIGURE_VARS+= \ + CFLAGS="$(TARGET_CFLAGS) -DSOCKET_COMM" \ + +EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib + +ifeq ($(BUILD_VARIANT),rrdtool10) + + TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/lib/rrdtool-1.0/include $(TARGET_CPPFLAGS) + TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib/rrdtool-1.0/lib $(TARGET_CPPFLAGS) + +endif + +ifeq ($(BUILD_VARIANT),rrdtool12) + + TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/lib/rrdtool-1.2/include $(TARGET_CPPFLAGS) + TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib/rrdtool-1.2/lib $(TARGET_CPPFLAGS) + +endif + +define Package/rrdcollect/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rrdcollect $(1)/usr/sbin/ +endef + +Package/rrdcollect10/install = $(Package/rrdcollect/install) +Package/rrdcollect12/install = $(Package/rrdcollect/install) + +define Package/rrdcollect-example/conffiles +/etc/rrd.conf +/etc/rrdcollect.conf +endef + +define Package/rrdcollect-example/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/rrd.conf $(1)/etc/ + $(INSTALL_DATA) ./files/rrdcollect.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/rrdcollect.init $(1)/etc/init.d/rrdcollect + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/rrd.sh $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/www/cgi-bin + ln -sf /var/lib/rrdcollect/rrd.cgi $(1)/www/cgi-bin/rrd.cgi + ln -sf /var/lib/rrdcollect/img $(1)/www/img +endef + +Package/rrdcollect10-example/install = $(Package/rrdcollect-example/install) +Package/rrdcollect12-example/install = $(Package/rrdcollect-example/install) + +$(eval $(call BuildPackage,rrdcollect10)) +$(eval $(call BuildPackage,rrdcollect10-example)) +$(eval $(call BuildPackage,rrdcollect12)) +$(eval $(call BuildPackage,rrdcollect12-example)) diff --git a/utils/rrdcollect/files/rrd.conf b/utils/rrdcollect/files/rrd.conf new file mode 100644 index 0000000..4ee13ce --- /dev/null +++ b/utils/rrdcollect/files/rrd.conf @@ -0,0 +1,381 @@ +# +# Author: Christian Rost (chr@baltic-online.de) +# Purpose: Shell-Interface to rrdtool +# +# Configuration-File for rrd.sh +# +DATADIR=/var/lib/rrdcollect +# Location of *.rrd-data-files +RRDDIR=$DATADIR/rrd +# Location of *.png-files +IMGDIR=$DATADIR/img +# Hostname used in title of png-images +HOSTNAME="WRT54GS" +# Location of rrdtool +RRDTOOL=/usr/bin/rrdtool +# Location of rrdcgi +RRDCGI=/usr/bin/rrdcgi +# Location of generated cgi-script +RRDCGISCRIPT=$DATADIR/rrd.cgi +# Image-Path relative to webserver-root +RRDCGIIMGPATH="/img" +# Location of netcat (used for fetching data from rrdcollect-daemon) +NETCAT=/usr/bin/nc + +# Alternative settings for use on external machines +#RRDDIR=/home/webm/htdocs/stats/rrd/rrd +#IMGDIR=/home/webm/htdocs/stats/rrd/web +#RRDTOOL=/opt/rrd/bin/rrdtool +#RRDCGI=/opt/rrd/bin/rrdcgi +#RRDCGISCRIPT=/home/webm/cgi-bin/rrd.cgi +#RRDCGIIMGPATH="/stats/rrd/web" +#NETCAT=/opt/bin/nc + + +#################################################################################### +# Configuration of statistic sources: +# +# Column 1: Time-periods +# I'm interrested in last-24hour-, last-week- and last-month-plots. +# Column 2: Define precision/resolution of above three intervalls +# These values have an impact on the size of your rrd-files, +# and on the sharpness of your plots +# RES=1 means maximum precision (every pixel in the plot is individual) +# RES=4 -> 4 pixel represents one interval + +# Optimized values for storing rather small rrd-files on the openwrt-box +HOURS=24;H_RES=2;DAYS=7;D_RES=4;WEEKS=4;W_RES=4; +# Measure-Step (Same value should be in the rrdcollect.conf) Optimal: STEP=$HOURS / $PIXWIDTH * 3600 * $H_RES +STEP=360; MAXSTEP=`expr $STEP \* 2` + +# Values for storing rrd-files externally outside the router allowing better resolution +#HOURS=24;H_RES=1;DAYS=32;D_RES=2;WEEKS=50;W_RES=2; +#STEP=180; MAXSTEP=`expr $STEP \* 2` +# Even better resolution +#HOURS=8;H_RES=1;DAYS=32;D_RES=2;WEEKS=50;W_RES=2; +#STEP=60; MAXSTEP=`expr $STEP \* 2` + +# Format and size of the plots PIXWIDTH will be used in +# calculating rrd-data-file dimensions during init of rrd-files +# If you change the size you must change NCGIPIXWIDTH too +PIXWIDTH=480 +PIXHEIGHT=120 +PIXFORMAT=PNG + +# Image-Size of the thumbnail for rrdcgi +SCGIPIXWIDTH=400 +# Normal Image-Size for rrdcgi (480px plotsize in rrd) +NCGIPIXWIDTH=571 + +# Predefined colors +RED0=#ff0000; RED1=#ff5555; +GRN0=#009828; GRN1=#81ffa2; +ORG0=#ff9900; ORG1=#ffc571; +BLU0=#0030ff; BLU1=#8ba1ff; +CYA0=#ff00FF; CYA1=#ffbcfe; +YEL0=#ffff00; YEL1=#e0df76; +BLK0=#000000; BLK1=#7d7d7d; +WHI0=#FFFFFF; WHI1=#c1c1c1; + +# Date-String used when creating images with rrd.sh +DATE=`/bin/date "+%d.%m.%Y %H:%M:%S"` + +# Max-Values bytes/second and packets/second for WAN/Wifi/LAN Interfaces +MAXWANB=130000 +MAXWANP=500 +MAXWIFB=600000 +MAXWIFP=800 +MAXLANB=1200000 +MAXLANP=1000 + +# RRD-Types: +# GAUGE=save the value itself, no calculations at all +# COUNTER=continuously increasing value. difference between last 2 values must be positive ! (Traffic-Counter) +# DERIVE=like counter but can store negative values (rate of change in free disk-space) +# +# General syntax: PREFIX_POSTFIX=[-]|Legend|RRD-Type|Maximum|Color|RRD-Plot-Type|Printf-Precision|Optional rrdgraph def-arguments + +################ +# Sys-Statistics +################ +SYS_L01=" l1|System Load (1 min)|GAUGE|U|$YEL0|AREA|%6.2lf" +SYS_L05=" l2|System Load (5 min)|GAUGE|U|$ORG0|STACK|%6.2lf" +SYS_L15=" l3|System Load (15 min)|GAUGE|U|$RED0|STACK|%6.2lf" + +SYS_CPN=" cn|CPU nice |COUNTER|U|$YEL0|AREA|%6.2lf%%" +SYS_CPU=" cu|CPU user |COUNTER|U|$ORG0|STACK|%6.2lf%%" +SYS_CPS=" cs|CPU system |COUNTER|U|$RED0|STACK|%6.2lf%%" +SYS_CPI=" ci|CPU idle |COUNTER|U|$GRN0|STACK|%6.2lf%%" + +SYS_MEU=" mu|Memory used |GAUGE|U|$BLU0|AREA" +SYS_MEF=" mf|Memory free |GAUGE|U|$GRN0|STACK" +#SYS_MES=" ms|Memory shared |GAUGE|U|$BLK0|LINE1" +SYS_MEB=" mb|Memory buffer |GAUGE|U|$YEL0|LINE1" +SYS_MEC=" mc|Memory cached |GAUGE|U|$RED0|LINE1" + +SYS_FUS=" us|Flash Disk Used |GAUGE|U|$BLU0|AREA|%6.2lf%s|CDEF:usC=us,1024,* CDEF:MAXusC=us,1024,*" +SYS_FAV=" av|Flash Disk Available|GAUGE|U|$GRN0|STACK|%6.2lf%s|CDEF:avC=av,1024,* CDEF:MAXavC=av,1024,*" + +SYS_IRA="ira|Interrupts total |COUNTER|U|$RED0|AREA" +SYS_IRE="ire|Interrupts eth0 |COUNTER|U|$ORG0|AREA" +SYS_IRW="irw|Interrupts wifi |COUNTER|U|$YEL0|STACK" + +SYS_PRT=" pt|Processes total |GAUGE|U|$BLU0|AREA|%6.0lf" +SYS_CTX=" ct|Context switches |COUNTER|U|$RED0|LINE2|%6.0lf" +SYS_PRR=" pr|Processes active |GAUGE|U|$ORG0|AREA|%6.0lf" +SYS_ARP="arp|Arp Entries |GAUGE|U|$YEL0|LINE2|%6.0lf" +SYS_PFK=" fk|Forks |COUNTER|U|$GRN0|LINE2|%6.0lf" +SYS_CON="con|NAT-Connections |GAUGE|U|$CYA0|LINE2|%6.0lf" + +# Plot-Titles +MISC_STATS="Misc ($HOSTNAME)" +DSK_STATS="Flash Disk Usage ($HOSTNAME)" +USG_STATS="System Load ($HOSTNAME)" +MEM_STATS="Memory Usage ($HOSTNAME)" +CPU_STATS="CPU Usage ($HOSTNAME)" +IRQ_STATS="Interrupts ($HOSTNAME)" + +# Plot-Definitions (sort-order is relevant) +SYS_CPU_STATS="CPN CPU CPS CPI" +#SYS_MEM_STATS="MEU MEF MES MEB MEC" +SYS_MEM_STATS="MEU MEF MEB MEC" +SYS_USG_STATS="L01 L05 L15" +SYS_DSK_STATS="FUS FAV" +SYS_MISC_STATS="PRT PRR ARP PFK CTX CON" +SYS_IRQ_STATS="IRA IRE IRW" + +# Data-Definition needed by init() +SYS_ALL="$SYS_CPU_STATS $SYS_MEM_STATS $SYS_USG_STATS $SYS_DSK_STATS $SYS_MISC_STATS $SYS_IRQ_STATS" + +################################################################################################# +# Wifi Traffic & Wan Traffic & Tunnel Traffic Statistics ; # LAN: vlan0 , WAN: vlan1 , eth1: WIFI +################################################################################################# +IF_WLOBY="Wibo |Outgoing Traffic Wifi |COUNTER|$MAXWIFB|$GRN1|AREA" +IF_WLIBY="-Wibi|Incoming Traffic Wifi |COUNTER|$MAXWIFB|$RED0|AREA" +IF_WLOPK="Wipo |Outgoing Packets Wifi |COUNTER|$MAXWIFP|$GRN1|AREA|%6.0lf" +IF_WLIPK="-Wipi|Incoming Packets Wifi |COUNTER|$MAXWIFP|$RED0|AREA|%6.0lf" + +IF_WAIBY="-Wabi|Incoming Traffic Wan |COUNTER|$MAXWANB|$BLU0|AREA" +IF_WAOBY="Wabo |Outgoing Traffic Wan |COUNTER|$MAXWANB|$ORG1|AREA" +IF_WAIPK="-Wapi|Incoming Packets Wan |COUNTER|$MAXWANP|$BLU0|AREA|%6.0lf" +IF_WAOPK="Wapo |Outgoing Packets Wan |COUNTER|$MAXWANP|$ORG1|AREA|%6.0lf" + +IF_LAIBY="-Labi|Incoming Traffic Lan |COUNTER|$MAXLANB|$BLU0|AREA" +IF_LAOBY="Labo |Outgoing Traffic Lan |COUNTER|$MAXLANB|$ORG1|AREA" +IF_LAIPK="-Lapi|Incoming Packets Lan |COUNTER|$MAXLANP|$BLU0|AREA|%6.0lf" +IF_LAOPK="Lapo |Outgoing Packets Lan |COUNTER|$MAXLANP|$ORG1|AREA|%6.0lf" + +#IF_TUIBY="-tbi|Incoming Traffic VPN-Tunnel|COUNTER|$MAXWANB|$CYA0|AREA" +#IF_TUOBY="tbo |Outgoing Traffic VPN-Tunnel|COUNTER|$MAXWANB|$YEL1|AREA" +#IF_TUIPK="-tpi|Incoming Packets VPN-Tunnel|COUNTER|$MAXWANP|$CYA0|AREA|%6.0lf" +#IF_TUOPK="tpo |Outgoing Packets VPN-Tunnel|COUNTER|$MAXWANP|$YEL1|AREA|%6.0lf" + +# Plot-Titles +WIFI_TRAFFIC="Wifi Interface Traffic Statistics ($HOSTNAME)" +WIFI_PACKETS="Wifi Interface Packets Statistics ($HOSTNAME)" +WAN_TRAFFIC="Wan Interface Traffic Statistics ($HOSTNAME)" +WAN_PACKETS="Wan Interface Packets Statistics ($HOSTNAME)" +LAN_TRAFFIC="Lan Interface Traffic Statistics ($HOSTNAME)" +LAN_PACKETS="Lan Interface Packets Statistics ($HOSTNAME)" + +#TUN_TRAFFIC="VPN-Tunnel Interface Traffic Statistics ($HOSTNAME)" +#TUN_PACKETS="VPN-Tunnel Interface Packets Statistics ($HOSTNAME)" + +# Plot-Definitions (sort-order is relevant) +IF_WIFI_TRAFFIC="WLOBY WLIBY" +IF_WIFI_PACKETS="WLOPK WLIPK" +IF_WAN_TRAFFIC="WAIBY WAOBY" +IF_WAN_PACKETS="WAIPK WAOPK" +IF_LAN_TRAFFIC="LAIBY LAOBY" +IF_LAN_PACKETS="LAIPK LAOPK" +#IF_TUN_TRAFFIC="TUIBY TUOBY" +#IF_TUN_PACKETS="TUIPK TUOPK" + +# Data-Definition needed by init() +#IF_ALL="$IF_WIFI_TRAFFIC $IF_WIFI_PACKETS $IF_WAN_TRAFFIC $IF_WAN_PACKETS $IF_TUN_TRAFFIC $IF_TUN_PACKETS" +IF_ALL="$IF_LAN_TRAFFIC $IF_LAN_PACKETS $IF_WAN_TRAFFIC $IF_WAN_PACKETS $IF_WIFI_TRAFFIC $IF_WIFI_PACKETS" + +############################################## +# Port Traffic Statistics for Port 1 - Port 4 +############################################## +#PT_OPK1="po1 |Port 1 Outgoing Packets |COUNTER|U|$ORG1|AREA|%6.0lf" +#PT_IPK1="-pi1|Port 1 Incoming Packets |COUNTER|U|$GRN0|AREA|%6.0lf" +#PT_COL1="cl1 |Port 1 Collisions |COUNTER|U|$BLU0|AREA|%6.0lf" +#PT_ERR1="er1 |Port 1 Errors |COUNTER|U|$CYA0|AREA|%6.0lf" +#PT_OBY1="bo1 |Port 1 Outgoing Traffic |COUNTER|U|$ORG1|AREA" +#PT_IBY1="-bi1|Port 1 Incoming Traffic |COUNTER|U|$GRN0|AREA" +#PT_OPK2="po2 |Port 2 Outgoing Packets |COUNTER|U|$RED1|AREA|%6.0lf" +#PT_IPK2="-pi2|Port 2 Incoming Packets |COUNTER|U|$BLK0|AREA|%6.0lf" +#PT_COL2="cl2 |Port 2 Collisions |COUNTER|U|$GRN0|AREA|%6.0lf" +#PT_ERR2="er2 |Port 2 Errors |COUNTER|U|$ORG0|AREA|%6.0lf" +#PT_OBY2="bo2 |Port 2 Outgoing Traffic |COUNTER|U|$RED1|AREA" +#PT_IBY2="-bi2|Port 2 Incoming Traffic |COUNTER|U|$BLK0|AREA" +#PT_OPK3="po3 |Port 3 Outgoing Packets |COUNTER|U|$BLU1|AREA|%6.0lf" +#PT_IPK3="-pi3|Port 3 Incoming Packets |COUNTER|U|$CYA0|AREA|%6.0lf" +#PT_COL3="cl3 |Port 3 Collisions |COUNTER|U|$GRN0|AREA|%6.0lf" +#PT_ERR3="er3 |Port 3 Errors |COUNTER|U|$ORG0|AREA|%6.0lf" +#PT_OBY3="bo3 |Port 3 Outgoing Traffic |COUNTER|U|$BLU1|AREA" +#PT_IBY3="-bi3|Port 3 Incoming Traffic |COUNTER|U|$CYA0|AREA" +#PT_OPK4="po4 |Port 4 Outgoing Packets |COUNTER|U|$YEL1|AREA|%6.0lf" +#PT_IPK4="-pi4|Port 4 Incoming Packets |COUNTER|U|$CYA0|AREA|%6.0lf" +#PT_COL4="cl4 |Port 4 Collisions |COUNTER|U|$BLK0|AREA|%6.0lf" +#PT_ERR4="er4 |Port 4 Errors |COUNTER|U|$RED0|AREA|%6.0lf" +#PT_OBY4="bo4 |Port 4 Outgoing Traffic |COUNTER|U|$YEL1|AREA" +#PT_IBY4="-bi4|Port 4 Incoming Traffic |COUNTER|U|$CYA0|AREA" + +# Plot-Titles +#TRAFFIC_1="Traffic Statistics Port 1 ($HOSTNAME)" +#TRAFFIC_2="Traffic Statistics Port 2 ($HOSTNAME)" +#TRAFFIC_3="Traffic Statistics Port 3 ($HOSTNAME)" +#TRAFFIC_4="Traffic Statistics Port 4 ($HOSTNAME)" +#PACKETS_1="Packet Statistics Port 1 ($HOSTNAME)" +#PACKETS_2="Packet Statistics Port 2 ($HOSTNAME)" +#PACKETS_3="Packet Statistics Port 3 ($HOSTNAME)" +#PACKETS_4="Packet Statistics Port 4 ($HOSTNAME)" + +# Plot-Definitions (sort-order is relevant) +#PT_TRAFFIC_1="OBY1 IBY1" +#PT_TRAFFIC_2="OBY2 IBY2" +#PT_TRAFFIC_3="OBY3 IBY3" +#PT_TRAFFIC_4="OBY4 IBY4" +#PT_PACKETS_1="OPK1 IPK1 COL1 ERR1" +#PT_PACKETS_2="OPK2 IPK2 COL2 ERR2" +#PT_PACKETS_3="OPK3 IPK3 COL3 ERR3" +#PT_PACKETS_4="OPK4 IPK4 COL4 ERR4" +#PT_PACKETS_1="OPK1 IPK1" +#PT_PACKETS_2="OPK2 IPK2" +#PT_PACKETS_3="OPK3 IPK3" +#PT_PACKETS_4="OPK4 IPK4" + +# Data Definition needed by init() +#PT_ALL="$PT_TRAFFIC_1 $PT_TRAFFIC_2 $PT_TRAFFIC_3 $PT_TRAFFIC_4 $PT_PACKETS_1 $PT_PACKETS_2 $PT_PACKETS_3 $PT_PACKETS_4" + +################################# +# Traffic Priorisation Statistics +################################# +#TC_APRIB="bwa|Ack Priority Queue Bandwidth |COUNTER|$MAXWANB|$YEL0|AREA" +#TC_DPRIB="bwd|Default Priority Queue Bandwidth |COUNTER|$MAXWANB|$ORG0|STACK" +#TC_HPRIB="bwh|High Priority Queue Bandwidth |COUNTER|$MAXWANB|$RED0|STACK" +#TC_LPRIB="bwl|Low Priority Queue Bandwidth |COUNTER|$MAXWANB|$GRN0|STACK" +#TC_APRID="dra|Ack Priority Queue Packet Dropped |COUNTER|100|$YEL0|AREA" +#TC_DPRID="drd|Default Priority Queue Packet Dropped|COUNTER|100|$ORG0|STACK" +#TC_HPRID="drh|High Priority Queue Packet Dropped |COUNTER|100|$RED0|STACK" +#TC_LPRID="drl|Low Priority Queue Packet Dropped |COUNTER|100|$GRN0|STACK" + +# Plot-Titles +#TRAFFIC="Traffic Priorisation Stats" +#PACKETS="Packet Priorisation Stats" + +# Plot-Definitions (sort-order is relevant) +#TC_TRAFFIC="APRIB DPRIB HPRIB LPRIB" +#TC_PACKETS="APRID DPRID HPRID LPRID" + +# Data Definition needed by init() +#TC_ALL="$TC_TRAFFIC $TC_PACKETS" + +################################# +# Firewall Packet Drop Statistics +################################# +#PC_WIN="win|Windows Traffic |COUNTER|U|$YEL0|AREA" +#PC_INV="inv|Invalid State Traffic |COUNTER|U|$ORG0|STACK" +#PC_TCP="tcp|TCP Packets |COUNTER|U|$RED0|STACK" +#PC_OTH="oth|Other Packets |COUNTER|U|$BLU0|STACK" + +# Plot-Titles +#DROPPED="Firewall Packet Drop Statistics" + +# Plot-Definitions (sort-order is relevant) +#PC_DROPPED="WIN INV TCP OTH" + +# Data Definition needed by init() +#PC_ALL="$PC_DROPPED" + +########################## +# Traffic Accounting Stats +########################## +#ACI="Incoming for "; ACO="Outgoing for " +#IP14="notebook"; COL14=$ORG0; COL_14=$ORG1 +#IP15="saugi "; COL15=$RED0; COL_15=$RED1 +#IP20="aplink "; COL20=$GRN0; COL_20=$GRN1 +#IP50="sunny "; COL50=$BLU0; COL_50=$BLU1 + +#TYPE=AREA +#for i in 15 50 20 14 +#do +# # Packet-Statistics +# eval AC_TIP$i='-TIP$i\|$ACI'"\$IP$i\|COUNTER\|$MAXWANP\|\$COL$i\|$TYPE" +# eval AC_TOP$i='TOP$i\|$ACO'"\$IP$i\|COUNTER\|$MAXWANP\|\$COL_$i\|$TYPE" +# eval AC_UIP$i='-UIP$i\|$ACI'"\$IP$i\|COUNTER\|$MAXWANP\|\$COL$i\|$TYPE" +# eval AC_UOP$i='UOP$i\|$ACO'"\$IP$i\|COUNTER\|$MAXWANP\|\$COL_$i\|$TYPE" +# eval AC_IIP$i='-IIP$i\|$ACI'"\$IP$i\|COUNTER\|$MAXWANP\|\$COL$i\|$TYPE" +# eval AC_IOP$i='IOP$i\|$ACO'"\$IP$i\|COUNTER\|$MAXWANP\|\$COL_$i\|$TYPE" +# # Traffic Statistics +# eval AC_TIB$i='-TIB$i\|$ACI'"\$IP$i\|COUNTER\|$MAXWANB\|\$COL$i\|$TYPE" +# eval AC_TOB$i='TOB$i\|$ACO'"\$IP$i\|COUNTER\|$MAXWANB\|\$COL_$i\|$TYPE" +# eval AC_UIB$i='-UIB$i\|$ACI'"\$IP$i\|COUNTER\|$MAXWANB\|\$COL$i\|$TYPE" +# eval AC_UOB$i='UOB$i\|$ACO'"\$IP$i\|COUNTER\|$MAXWANB\|\$COL_$i\|$TYPE" +# eval AC_IIB$i='-IIB$i\|$ACI'"\$IP$i\|COUNTER\|$MAXWANB\|\$COL$i\|$TYPE" +# eval AC_IOB$i='IOB$i\|$ACO'"\$IP$i\|COUNTER\|$MAXWANB\|\$COL_$i\|$TYPE" +# # Plot-Definitions (sort-order is relevant) +# AC_TB_O="$AC_TB_O TOB$i"; AC_TB_I="$AC_TB_I TIB$i" +# AC_TP_O="$AC_TP_O TOP$i"; AC_TP_I="$AC_TP_I TIP$i" +# AC_UB_O="$AC_UB_O UOB$i"; AC_UB_I="$AC_UB_I UIB$i" +# AC_UP_O="$AC_UP_O UOP$i"; AC_UP_I="$AC_UP_I UIP$i" +# AC_IB_O="$AC_IB_O IOB$i"; AC_IB_I="$AC_IB_I IIB$i" +# AC_IP_O="$AC_IP_O IOP$i"; AC_IP_I="$AC_IP_I IIP$i" +# TYPE=STACK +#done +#AC_TB="$AC_TB_O $AC_TB_I"; AC_TP="$AC_TP_O $AC_TP_I" +#AC_UB="$AC_UB_O $AC_UB_I"; AC_UP="$AC_UP_O $AC_UP_I" +#AC_IB="$AC_IB_O $AC_IB_I"; AC_IP="$AC_IP_O $AC_IP_I"; + +# Plot-Titles +#TB="TCP Traffic Accounting Stats ($HOSTNAME)"; TP="TCP Packet Accounting Stats ($HOSTNAME)" +#UB="UDP Traffic Accounting Stats ($HOSTNAME)"; UP="UDP Packet Accounting Stats ($HOSTNAME)" +#IB="ICMP Traffic Accounting Stats ($HOSTNAME)";IP="ICMP Packet Accounting Stats ($HOSTNAME)" + +# Data Definition needed by init() +#AC_ALL="$AC_TB $AC_TP $AC_UB $AC_UP $AC_IB $AC_IP" + + +# System Statistics +GRAPH_1="SYS|USG_STATS|$USG_STATS|Load" +GRAPH_2="SYS|CPU_STATS|$CPU_STATS|CPU-Time_in_%|1000|--upper-limit 100 --rigid --logarithmic --lower-limit 0.1" +GRAPH_3="SYS|MEM_STATS|$MEM_STATS|Bytes|1024" +GRAPH_4="SYS|DSK_STATS|$DSK_STATS|Bytes|1024" +GRAPH_5="SYS|MISC_STATS|$MISC_STATS|_|1000|--logarithmic" +GRAPH_6="SYS|IRQ_STATS|$IRQ_STATS|IRQ_per_second|1000" +# Interface Traffic Statistics +GRAPH_7="IF|LAN_TRAFFIC|$LAN_TRAFFIC|Bytes_per_second" +GRAPH_8="IF|LAN_PACKETS|$LAN_PACKETS|Packets_per_second" +GRAPH_9="IF|WAN_TRAFFIC|$WAN_TRAFFIC|Bytes_per_second" +GRAPH_10="IF|WAN_PACKETS|$WAN_PACKETS|Packets_per_second" +GRAPH_11="IF|WIFI_TRAFFIC|$WIFI_TRAFFIC|Bytes_per_second" +GRAPH_12="IF|WIFI_PACKETS|$WIFI_PACKETS|Packets_per_second" +#GRAPH_11="IF|TUN_TRAFFIC|$TUN_TRAFFIC|Bytes_per_second" +#GRAPH_12="IF|TUN_PACKETS|$TUN_PACKETS|Packets_per_second" +# Port Traffic Statistics +#GRAPH_13="PT|TRAFFIC_1|$TRAFFIC_1|Bytes_per_second" +#GRAPH_14="PT|PACKETS_1|$PACKETS_1|Packets_per_second" +#GRAPH_15="PT|TRAFFIC_2|$TRAFFIC_2|Bytes_per_second" +#GRAPH_16="PT|PACKETS_2|$PACKETS_2|Packets_per_second" +#GRAPH_17="PT|TRAFFIC_3|$TRAFFIC_3|Bytes_per_second" +#GRAPH_18="PT|PACKETS_3|$PACKETS_3|Packets_per_second" +#GRAPH_19="PT|TRAFFIC_4|$TRAFFIC_4|Bytes_per_second" +#GRAPH_20="PT|PACKETS_4|$PACKETS_4|Packets_per_second" +# Traffic Priorisation Statistics +# GRAPH_21="TC|TRAFFIC|$TRAFFIC|Bytes_per_second|1000|--logarithmic" +# GRAPH_22="TC|PACKETS|$PACKETS|Packets_per_second" +# Accounting Statistics +#GRAPH_23="AC|TB|$TB|Bytes_per_second" +#GRAPH_24="AC|TP|$TP|Packets_per_second" +#GRAPH_25="AC|UB|$UB|Bytes_per_second" +#GRAPH_26="AC|UP|$UP|Packets_per_second" +#GRAPH_27="AC|IB|$IB|Bytes_per_second" +#GRAPH_28="AC|IP|$IP|Packets_per_second" +# Firewall Drop Statistics +#GRAPH_29="PC|DROPPED|$DROPPED|Packets_per_second" + +#ALL_PRAEFIXES="SYS IF PT TC AC PC" +ALL_PRAEFIXES="SYS IF" +GRAPH_MAX=12 diff --git a/utils/rrdcollect/files/rrd.sh b/utils/rrdcollect/files/rrd.sh new file mode 100644 index 0000000..3faa4fb --- /dev/null +++ b/utils/rrdcollect/files/rrd.sh @@ -0,0 +1,288 @@ +#!/bin/sh +# +# Author: Christian Rost (chr@baltic-online.de) +# Purpose: Shell-Interface to rrdtool +# +RRDCNF=/etc/rrd.conf +. $RRDCNF + +###################################### +# init() function to create .rrd-file +# $1=VAR-PRAEFIX $2=VAR-POSTFIX +###################################### +init() +{ + # Calculate optimal step by assuming highest precision on the last-xhour plot + OPTSTEP=`expr $HOURS \* 3600 \/ $PIXWIDTH \* $H_RES` + [ $OPTSTEP != $STEP ] && echo "WARNING: Your optimal step is: $OPTSTEP. But you are using: $STEP" + + ARH_AVG=`expr $HOURS \* 3600 \/ $PIXWIDTH \* $H_RES \/ $STEP`; ARH_CNT=`expr $HOURS \* 3600 \/ $ARH_AVG \/ $STEP` + ARD_AVG=`expr $DAYS \* 86400 \/ $PIXWIDTH \* $D_RES \/ $STEP`; ARD_CNT=`expr $DAYS \* 86400 \/ $ARD_AVG \/ $STEP` + ARW_AVG=`expr $WEEKS \* 604800 \/ $PIXWIDTH \* $W_RES \/ $STEP`; ARW_CNT=`expr $WEEKS \* 604800 \/ $ARW_AVG \/ $STEP` + + PRAEFIX=$1; POSTFIX=$2 + DSOURCE="" + + echo "Init storage for $HOURS hours on averages: $ARH_AVG x $STEP seconds ($ARH_CNT total values)" + echo "Init storage for $DAYS days on averages: $ARD_AVG x $STEP seconds ($ARD_CNT total values)" + echo "Init storage for $WEEKS weeks on averages: $ARW_AVG x $STEP seconds ($ARW_CNT total values)" + + eval SOURCE=\$${PRAEFIX}_${POSTFIX} + for i in $SOURCE + do + eval var=\$${PRAEFIX}_${i} + ifs="$IFS"; IFS="|"; set -- $var + if [ "`echo ${1} | cut -b1`" = "-" ] + then + VAR="`echo ${1} | cut -b2-`" + else + VAR=`echo $1 | sed "s/ //g"` + fi + DSOURCE="$DSOURCE DS:${VAR}:${3}:$MAXSTEP:0:${4}" + IFS="$ifs" + done + $DEBUG $RRDTOOL create $RRDDIR/$PRAEFIX.rrd \ + --step ${STEP} \ + $DSOURCE \ + RRA:AVERAGE:0.5:$ARH_AVG:$ARH_CNT \ + RRA:AVERAGE:0.5:$ARD_AVG:$ARD_CNT \ + RRA:AVERAGE:0.5:$ARW_AVG:$ARW_CNT \ + RRA:MAX:0.5:$ARH_AVG:$ARH_CNT \ + RRA:MAX:0.5:$ARD_AVG:$ARD_CNT \ + RRA:MAX:0.5:$ARW_AVG:$ARW_CNT + return $? +} + +################################################################################################################# +# graph() function to create png-graphics +# $1=IMG-DIR $2=VAR-PRAEFIX, $3=VAR-POSTFIX, $4=Headline, $5=end, $6=start, $7=base, +# $8=DEFS/ENTRIES $9=other rrdgraph options (Vertlabel,...) +################################################################################################################# +# COMMENT:"$DATE\c" +do_rrdgraph() +{ + $DEBUG $NICE $RRDTOOL graph "$1/$2_$3.png" \ + --title "$4" \ + --imgformat $PIXFORMAT \ + --width $PIXWIDTH \ + --height $PIXHEIGHT \ + --end "$5" \ + --start "$6" \ + --base "$7" \ + $8 $9 +} + +################################################################################################################# +# graph() function to create png-graphics +# $1=IMG-DIR $2=VAR-PRAEFIX, $3=VAR-POSTFIX, $4=Headline, $5=end, $6=start, $7=base, +# $8=DEFS/ENTRIES $9=other rrdgraph options (Vertlabel,...) +################################################################################################################# +# COMMENT:"\c" +do_rrdcgi() +{ + cat << EOF > $1/$2_$3.def + +$2_$3.png \ +--title "$4" \ +--imgformat $PIXFORMAT \ +--width $PIXWIDTH \ +--height $PIXHEIGHT \ +--end "$5" \ +--start \ +--base $7 \ +--imginfo "" \ +--lazy \ +$8 $9 > +EOF + + cat << EOF >> $RRDCGISCRIPT +$NEWLINE $4
    + + +EOF +} + + + +gen_cgi_header() +{ + cat << EOF > $RRDCGISCRIPT +#!$RRDCGI +RRDCGI Router Statistics + + +

    RRDCGI Router Statistics ()

    +
    + ${HOURS} hours ago + ${DAYS} days ago + ${WEEKS} weeks ago + +
    +

    + +EOF +} + +gen_cgi_footer() +{ + cat << EOF >> $RRDCGISCRIPT +
    +

    + + +EOF + chmod +x $RRDCGISCRIPT +} + +################################################################################################################# +# $1=mode $2=VAR-PRAEFIX, $3=VAR-POSTFIX, $4=Headline, $5=Vertlabel, $6=start, $7=end, $8=base, $9=other rrdgraph options +################################################################################################################# +do_graph() +{ + MODE=$1; PRAEFIX=$2; POSTFIX=$3; HEADLINE=$4; VERTLABEL=$5; START=$6; END=$7; BASE=$8; SRC=${RRDDIR}/${PRAEFIX}.rrd + if [ ! -r "$SRC" ] + then + echo "$SRC not found. Aborting all operations now..." + exit 1 + fi + + # For Graphing Memory BASE should be set to 1024, default is 1000 + [ -n "$8" ] && BASE=$8 || BASE=1000 + [ -n "$9" ] && OPTS=$9 || OPTS="--lower-limit 0" + DEFS=""; ENTRIES="" + eval SOURCE=\$${PRAEFIX}_${POSTFIX} + for i in $SOURCE + do + eval var=\$${PRAEFIX}_${i} + ifs="$IFS"; IFS="|"; set -- $var + if [ "`echo ${1} | cut -b1`" = "-" ] + then + VAR="`echo ${1} | cut -b2-`" + NEG=1 + else + VAR=`echo $1 | sed "s/ //g"` + NEG=0 + fi + + if [ "$NEG" = 1 ] + then + [ -n "${8}" ] && DEFS="$DEFS DEF:${VAR}=$SRC:${VAR}:AVERAGE DEF:MAX${VAR}=$SRC:${VAR}:MAX ${8} CDEF:N${VAR}C=${VAR}C,-1,* " \ + || DEFS="$DEFS DEF:${VAR}=$SRC:${VAR}:AVERAGE DEF:MAX${VAR}=$SRC:${VAR}:MAX CDEF:N${VAR}=${VAR},-1,*" + else + [ -n "${8}" ] && DEFS="$DEFS DEF:${VAR}=$SRC:${VAR}:AVERAGE DEF:MAX${VAR}=$SRC:${VAR}:MAX ${8}" \ + || DEFS="$DEFS DEF:${VAR}=$SRC:${VAR}:AVERAGE DEF:MAX${VAR}=$SRC:${VAR}:MAX" + fi + # Now this is a bit ugly, but i don't know how to escape the blanks in a proper way. + # If you know any better way to keep the blanks in the legend of the graphics please inform me. + #L=`echo ${2} | tr -s "[= =]" '\014'` + #L=`echo ${2} | tr -s "[= =]" '_'` + L=`echo ${2} | sed "s/ /_/g"` + if [ -n "${7}" ] + then + if [ -n "${8}" ] + then + [ "$NEG" = 1 ] && ENTRIES="$ENTRIES ${6}:N${VAR}C${5}:${L}: GPRINT:${VAR}C:AVERAGE:Average\:${7} GPRINT:MAX${VAR}C:MAX:Max\:${7} GPRINT:${VAR}C:LAST:Last\:${7}\\j" \ + || ENTRIES="$ENTRIES ${6}:${VAR}C${5}:${L}: GPRINT:${VAR}C:AVERAGE:Average\:${7} GPRINT:MAX${VAR}C:MAX:Max\:${7} GPRINT:${VAR}C:LAST:Last\:${7}\\j" + else + [ "$NEG" = 1 ] && ENTRIES="$ENTRIES ${6}:N${VAR}${5}:${L}: GPRINT:${VAR}:AVERAGE:Average\:${7} GPRINT:MAX${VAR}:MAX:Max\:${7} GPRINT:${VAR}:LAST:Last\:${7}\\j" \ + || ENTRIES="$ENTRIES ${6}:${VAR}${5}:${L}: GPRINT:${VAR}:AVERAGE:Average\:${7} GPRINT:MAX${VAR}:MAX:Max\:${7} GPRINT:${VAR}:LAST:Last\:${7}\\j" + fi + else + [ "$NEG" = 1 ] && ENTRIES="$ENTRIES ${6}:N${VAR}${5}:${L}: GPRINT:${VAR}:AVERAGE:Average\:%6.2lf%s GPRINT:MAX${VAR}:MAX:Max\:%6.0lf%s GPRINT:${VAR}:LAST:Last\:%6.2lf%s\\j" \ + || ENTRIES="$ENTRIES ${6}:${VAR}${5}:${L}: GPRINT:${VAR}:AVERAGE:Average\:%6.2lf%s GPRINT:MAX${VAR}:MAX:Max\:%6.0lf%s GPRINT:${VAR}:LAST:Last\:%6.2lf%s\\j" + fi + IFS="$ifs" + done + + #[ "$POSTFIX" = "CPU_STATS" ] && (echo $OPTS; echo $DEFS ; echo $ENTRIES; echo $OPTS) + + $MODE "$IMGDIR" "$PRAEFIX" "$POSTFIX" "$HEADLINE" "$END" "$START" "$BASE" "$DEFS $ENTRIES" "--vertical-label $VERTLABEL $OPTS" +} + +# Check if all rrd-files are present +# and create them if not +init_loop() +{ + for j in $ALL_PRAEFIXES + do + if [ ! -f $RRDDIR/$j.rrd ] + then + echo "Creating $RRDDIR/$j.rrd ..." + init $j ALL + [ ! -f $RRDDIR/$j.rrd ] && EXIT=1 + fi + done + [ "$EXIT" = 1 ] && return 1 || return 0 +} + + +graph_loop() +{ + mode=$1; start=$2; end=$3; c=1 + while [ $c -le $GRAPH_MAX ] + do + eval var=\$GRAPH_${c} + # $1=VAR-PRAEFIX $2=VAR-POSTFIX $3=Headline $4=Vertlabel $5=base $6=other rrdgraph options + ifs="$IFS"; IFS="|"; set -- $var + IFS="$ifs" + [ "$1" != "$OLD" -o "`expr \( $c - 1 \) % 2`" = 0 ] && NEWLINE="" || NEWLINE="" + do_graph $mode $1 $2 "$3" "$4" $start $end $5 "$6" + c=`expr $c + 1`; OLD=$1 + done +} + + +case "$1" in + init) + if init_loop + then + exit 0 + else + echo "Initialisation of rrd-database-files failed" + exit 1 + fi + ;; + cgi) + echo "Updating $RRDCGISCRIPT and $IMGDIR/*.def" + gen_cgi_header + # The start-time will be not used + graph_loop do_rrdcgi end now + gen_cgi_footer + ;; + images) + # Create the graphs + [ -n "$2" ] && STH=$2 || STH=24h + echo "Updating Graphs ($STH ago -> now) for $RRDDIR/*.rrd" + graph_loop do_rrdgraph "end-${STH}" now + ;; + fetch) + # Fetch data from rrdcollect daemon + if [ ! -n "$3" ] + then + echo "Usage: $0 fetch " + exit 1 + else + echo "Fetching ascii-logs from rrdcollect daemon" + (cd $RRDDIR && $NETCAT $2 $3 | sed -n "s:^\(update .*\):$RRDTOOL \1:p" | sh -x ) 2>&1 | wc -l #>/dev/null + exit 0 + fi + ;; + *) echo "Usage: $0 " + echo " init: Initialize rrd-datafiles if neeeded" + echo " cgi: Creates cgi-script for use with rrdcgi" + echo " fetch: Fetching data from rrdcollect via netcat" + echo " images: Generates images" + exit 1 + ;; +esac +exit 0 diff --git a/utils/rrdcollect/files/rrdcollect.conf b/utils/rrdcollect/files/rrdcollect.conf new file mode 100644 index 0000000..e34c9bf --- /dev/null +++ b/utils/rrdcollect/files/rrdcollect.conf @@ -0,0 +1,33 @@ +step = 360 +directory = /var/lib/rrdcollect/rrd + +file:///proc/stat +"cpu0 %d %d %d %d" SYS.rrd:cu,cn,cs,ci +"ctxt %u" SYS.rrd:ct +"processes %u" SYS.rrd:fk +"intr %u" SYS.rrd:ira + +file:///proc/meminfo +#"Mem: %*d %d %d %d %d %d" SYS.rrd:mu,mf,ms,mb,mc +"Mem: %*d %d %d %*d %d %d" SYS.rrd:mu,mf,mb,mc + +file:///proc/loadavg +"%f %f %f %d/%d %*d" SYS.rrd:l1,l2,l3,pr,pt + +exec:///bin/df +"/dev/mtdblock/4 %*d %d %d" SYS.rrd:us,av + +# LAN: vlan0, WAN: vlan1, WIFI: eth1 +file:///proc/net/dev +" vlan0:%d %d %*d %*d %*d %*d %*d %*d %d %d" IF.rrd:Labi,Lapi,Labo,Lapo +" vlan1:%d %d %*d %*d %*d %*d %*d %*d %d %d" IF.rrd:Wabi,Wapi,Wabo,Wapo +" eth1:%d %d %*d %*d %*d %*d %*d %*d %d %d" IF.rrd:Wibi,Wipi,Wibo,Wipo +#" tun0:%d %d %*d %*d %*d %*d %*d %*d %d %d" IF.rrd:tbi,tpi,tbo,tpo + +file:///proc/slabinfo +"ip_conntrack %d %*d %*d %*d %*d %*d" SYS.rrd:con +"arp_cache %d %*d %*d %*d %*d %*d" SYS.rrd:arp + +file:///proc/interrupts +" 4: %d MIPS eth1" SYS.rrd:irw +" 5: %d MIPS eth0" SYS.rrd:ire diff --git a/utils/rrdcollect/files/rrdcollect.init b/utils/rrdcollect/files/rrdcollect.init new file mode 100644 index 0000000..9099c4b --- /dev/null +++ b/utils/rrdcollect/files/rrdcollect.init @@ -0,0 +1,25 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=98 + +SERVICE_USE_PID=1 + +LIB_D=/var/lib/rrdcollect +CGI_S=$LIB_D/rrd.cgi +IMG_D=$LIB_D/img +RRD_D=$LIB_D/rrd + +start() { + RRD_F=$(find $RRD_D -name "*.rrd" 2>/dev/null) + mkdir -m 0755 -p $IMG_D + mkdir -m 0755 -p $RRD_D + [ -n "$RRD_F" ] || /usr/bin/rrd.sh init + [ -x $CGI_S ] || /usr/bin/rrd.sh cgi + service_start /usr/sbin/rrdcollect +} + +stop() { + service_stop /usr/sbin/rrdcollect +} + diff --git a/utils/rrdtool/Makefile b/utils/rrdtool/Makefile new file mode 100644 index 0000000..74f063a --- /dev/null +++ b/utils/rrdtool/Makefile @@ -0,0 +1,141 @@ +# +# Copyright (C) 2007-2012 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:=rrdtool +PKG_VERSION:=1.2.30 +PKG_RELEASE:=3 + +PKG_SOURCE_URL:=http://oss.oetiker.ch/rrdtool/pub/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=19b24f7184a8dbf7b48c1bbb565ad9fb + +PKG_BUILD_DEPENDS:=python + +PKG_CONFIG_DEPENDS:= \ + CONFIG_PACKAGE_python-rrd \ + CONFIG_PACKAGE_rrdcgi \ + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/rrdtool/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Round Robin Database (RRD) + URL:=http://oss.oetiker.ch/rrdtool/ +endef + +define Package/librrd +$(call Package/rrdtool/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= management library (v1.2.x) + DEPENDS+= +libart +libfreetype +libpng +zlib +libpthread +endef + +define Package/rrdcgi +$(call Package/rrdtool/Default) + TITLE+= CGI graphing tool (v1.2.x) + DEPENDS+= +librrd +cgilib +endef + +define Package/rrdtool +$(call Package/rrdtool/Default) + TITLE+= management tools (v1.2.x) + DEPENDS+= +librrd +endef + +define Package/python-rrd +$(call Package/rrdtool/Default) + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE+= python bindings (v1.2.x) + DEPENDS+= +python-mini +librrd +endef + +CONFIGURE_ARGS += \ + --enable-shared=yes \ + --enable-static=yes \ + --disable-rpath \ + --with-gnu-ld \ + --disable-mmap \ + --disable-perl \ + --disable-tcl \ + --disable-ruby \ + --without-x \ + --with-rrd-default-font="/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf" \ + +CONFIGURE_VARS += \ + rd_cv_ieee_works=yes \ + rd_cv_null_realloc=nope \ + ac_cv_func_mmap_fixed_mapped=yes \ + +ifneq ($(SDK)$(CONFIG_PACKAGE_rrdcgi),) + CONFIGURE_ARGS += --enable-rrdcgi +else + CONFIGURE_ARGS += --disable-rrdcgi +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_python-rrd),) + CONFIGURE_ARGS += \ + --enable-python + CONFIGURE_VARS += \ + PYTHON="$(PYTHON)" +else + CONFIGURE_ARGS += --disable-python +endif + +define Build/Compile + $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false) + $(call Build/Compile/Default) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib/rrdtool-1.2/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/rrd.h $(1)/usr/lib/rrdtool-1.2/include/ + $(INSTALL_DIR) $(1)/usr/lib/rrdtool-1.2/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd{,_th}.{a,so*} $(1)/usr/lib/rrdtool-1.2/lib/ +endef + +define Package/librrd/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.so.* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd_th.so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/share/rrdtool/fonts + $(CP) $(PKG_BUILD_DIR)/src/DejaVuSansMono-Roman.ttf \ + $(1)/usr/share/rrdtool/fonts/ +endef + +define Package/rrdcgi/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rrdcgi $(1)/usr/bin/ +endef + +define Package/rrdtool/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rrdtool $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rrdupdate $(1)/usr/bin/ +endef + +define PyPackage/python-rrd/install + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR) + $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* $(1)$(PYTHON_PKG_DIR)/ +endef + +$(eval $(call BuildPackage,librrd)) +$(eval $(call BuildPackage,rrdcgi)) +$(eval $(call BuildPackage,rrdtool)) + +#$(eval $(call PyPackage,python-rrd)) +#$(eval $(call BuildPackage,python-rrd)) diff --git a/utils/rrdtool/patches/010-dont-add-host-include-paths.patch b/utils/rrdtool/patches/010-dont-add-host-include-paths.patch new file mode 100644 index 0000000..507a0e9 --- /dev/null +++ b/utils/rrdtool/patches/010-dont-add-host-include-paths.patch @@ -0,0 +1,34 @@ +--- a/configure ++++ b/configure +@@ -26319,9 +26319,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ex_check_save_LIBS=${LIBS} + ex_check_save_CPPFLAGS=${CPPFLAGS} + ex_check_save_LDFLAGS=${LDFLAGS} +- if test "x/usr/include/libart-2.0" != "x"; then +- CPPFLAGS="$CPPFLAGS -I/usr/include/libart-2.0" +- fi + { echo "$as_me:$LINENO: checking for art_vpath_add_point in -lart_lgpl_2" >&5 + echo $ECHO_N "checking for art_vpath_add_point in -lart_lgpl_2... $ECHO_C" >&6; } + if test "${ac_cv_lib_art_lgpl_2_art_vpath_add_point+set}" = set; then +@@ -27915,9 +27912,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ex_check_save_LIBS=${LIBS} + ex_check_save_CPPFLAGS=${CPPFLAGS} + ex_check_save_LDFLAGS=${LDFLAGS} +- if test "x/usr/include/freetype2" != "x"; then +- CPPFLAGS="$CPPFLAGS -I/usr/include/freetype2" +- fi + { echo "$as_me:$LINENO: checking for FT_Init_FreeType in -lfreetype" >&5 + echo $ECHO_N "checking for FT_Init_FreeType in -lfreetype... $ECHO_C" >&6; } + if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -20,9 +20,6 @@ AC_DEFUN([EX_CHECK_ALL], + ex_check_save_LIBS=${LIBS} + ex_check_save_CPPFLAGS=${CPPFLAGS} + ex_check_save_LDFLAGS=${LDFLAGS} +- if test "x$7" != "x"; then +- CPPFLAGS="$CPPFLAGS -I$7" +- fi + dnl try compiling naked first + AC_CHECK_LIB($1,$2, [ + AC_CHECK_HEADER($3,[LIBS="-l$1 ${LIBS}";EX_CHECK_STATE=YES],[])],[]) diff --git a/utils/rrdtool/patches/020-x86-float-cast.patch b/utils/rrdtool/patches/020-x86-float-cast.patch new file mode 100644 index 0000000..f382404 --- /dev/null +++ b/utils/rrdtool/patches/020-x86-float-cast.patch @@ -0,0 +1,13 @@ +Index: rrdtool-1.2.30/src/rrd_format.h +=================================================================== +--- rrdtool-1.2.30.orig/src/rrd_format.h ++++ rrdtool-1.2.30/src/rrd_format.h +@@ -22,7 +22,7 @@ + /* #define RRD_VERSION "0002" */ + /* changed because microsecond precision requires another field */ + #define RRD_VERSION "0003" +-#define FLOAT_COOKIE 8.642135E130 ++#define FLOAT_COOKIE ((double)8.642135E130) + + #include "rrd_nan_inf.h" + diff --git a/utils/rrdtool/patches/030-automake-compat.patch b/utils/rrdtool/patches/030-automake-compat.patch new file mode 100644 index 0000000..df51205 --- /dev/null +++ b/utils/rrdtool/patches/030-automake-compat.patch @@ -0,0 +1,13 @@ +--- a/bindings/tcl/Makefile.am ++++ b/bindings/tcl/Makefile.am +@@ -26,8 +26,8 @@ tclpkgdir = @TCL_PACKAGE_DIR@ + tclpkg_DATA = pkgIndex.tcl + tclpkg_SCRIPTS = ifOctets.tcl + else +-pkglib_DATA = pkgIndex.tcl +-pkglib_SCRIPTS = ifOctets.tcl ++pkgdata_DATA = pkgIndex.tcl ++pkgdata_SCRIPTS = ifOctets.tcl + endif + + # Automake doen't like `tclrrd$(VERSION)$(TCL_SHLIB_SUFFIX)' as diff --git a/utils/rsyncrypto/Makefile b/utils/rsyncrypto/Makefile new file mode 100644 index 0000000..bb1b6e5 --- /dev/null +++ b/utils/rsyncrypto/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2012 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:=rsyncrypto +PKG_VERSION:=1.12 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/rsyncrypto +PKG_MD5SUM:=62367d5458ceaab58bbe73030880f538 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/rsyncrypto + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Rsync friendly encryption + URL:=http://rsyncrypto.lingnu.com/ + DEPENDS:=+argtable +gzip +libopenssl +libstdcpp +endef + +define Package/rsyncrypto/description + rsyncrypto is a utility that encrypts a file (or a directory structure) in a + way that ensures that local changes to the plain text file will result in + local changes to the cipher text file. This, in turn, ensures that doing rsync + to synchronize the encrypted files to another machine will have only a small + impact on rsync's efficiency. +endef + +CONFIGURE_ARGS += \ + --with-openssl="$(STAGING_DIR)/usr" + +define Package/rsyncrypto/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rsyncrypto $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,rsyncrypto)) diff --git a/utils/sane-backends/Makefile b/utils/sane-backends/Makefile new file mode 100644 index 0000000..958ac85 --- /dev/null +++ b/utils/sane-backends/Makefile @@ -0,0 +1,122 @@ +# +# Copyright (C) 2006-2012 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:=sane-backends +PKG_VERSION:=1.0.22 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.sane-project.org/pub/sane/$(PKG_NAME)-$(PKG_VERSION) \ + https://alioth.debian.org/frs/download.php/3503 +PKG_MD5SUM:=fadf56a60f4776bfb24491f66b617cf5 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/sane-backends/Default + TITLE:=Scanner Access Now Easy + URL:=http://www.sane-project.org/ +endef + +define Package/sane-backends/Default/description + SANE (Scanner Access Now Easy) is a universal scanner interface. +endef + +define Package/sane-backends +$(call Package/sane-backends/Default) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+sane-libs + TITLE+= (backends) +endef + +define Package/sane-backends/description +$(call Package/sane-backends/Default/description) + This package contains the SANE daemon. +endef + +define Package/sane-libs + $(call Package/sane-backends/Default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libjpeg +libtiff +libusb +libv4l + TITLE+= (libraries) +endef + +define Package/sane-libs/description +$(call Package/sane-backends/Default/description) + This package contains the SANE shared libraries. +endef + +define Package/sane-frontends + $(call Package/sane-backends/Default) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+sane-backends + TITLE+= (frontends) +endef + +define Package/sane-frontends/description +$(call Package/sane-backends/Default/description) + This package contains the SANE frontends. +endef + +TARGET_LDFLAGS += \ + -Wl,-rpath-link $(STAGING_DIR)/usr/lib \ + -Wl,-rpath-link $(PKG_BUILD_DIR)/backend/.libs + +CONFIGURE_ARGS+= \ + --enable-shared \ + --enable-static \ + --disable-translations \ + --disable-latex \ + --without-gphoto2 \ + --disable-debug \ + --without-snmp + +define Build/Configure + mkdir -p $(PKG_BUILD_DIR)/backend/.libs + $(Build/Configure/Default) +endef + +define Package/sane-backends/conffiles +/etc/sane.d/saned.conf +endef + +define Package/sane-backends/install + $(INSTALL_DIR) $(1)/etc/sane.d + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/sane.d/*.conf $(1)/etc/sane.d/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/ +endef + +define Package/sane-libs/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsane.so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/sane + $(CP) $(PKG_INSTALL_DIR)/usr/lib/sane/libsane-*.so.* $(1)/usr/lib/sane/ +endef + +define Package/sane-frontends/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/sane $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsane.{a,so*} $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,sane-backends)) +$(eval $(call BuildPackage,sane-libs)) +$(eval $(call BuildPackage,sane-frontends)) diff --git a/utils/sane-backends/patches/000-upstream-libv4l.patch b/utils/sane-backends/patches/000-upstream-libv4l.patch new file mode 100644 index 0000000..4bf2b4d --- /dev/null +++ b/utils/sane-backends/patches/000-upstream-libv4l.patch @@ -0,0 +1,32 @@ +--- a/backend/v4l.c ++++ b/backend/v4l.c +@@ -84,9 +84,8 @@ + #include "../include/sane/sanei_config.h" + #define V4L_CONFIG_FILE "v4l.conf" + +-#include "v4l.h" +- + #include ++#include "v4l.h" + + static const SANE_Device **devlist = NULL; + static int num_devices; +--- a/backend/v4l.h ++++ b/backend/v4l.h +@@ -29,6 +29,7 @@ + #ifndef v4l_h + #define v4l_h + ++#ifndef __LINUX_VIDEODEV_H + /* Kernel interface */ + /* Only the stuff we need. For more features, more defines are needed */ + +@@ -165,7 +166,7 @@ struct video_channel + + + /* end of kernel interface */ +- ++#endif /* !__LINUX_VIDEODEV_H */ + + #include <../include/sane/sane.h> + diff --git a/utils/sane-backends/patches/001-upstream-keep-usb-device.patch b/utils/sane-backends/patches/001-upstream-keep-usb-device.patch new file mode 100644 index 0000000..9e1e7f4 --- /dev/null +++ b/utils/sane-backends/patches/001-upstream-keep-usb-device.patch @@ -0,0 +1,68 @@ +From 5ea227caeacd504b64eef301e83fa63e0a25b3f7 Mon Sep 17 00:00:00 2001 +From: Alex Belkin +Date: Tue, 8 Mar 2011 17:57:19 +0300 +Subject: [PATCH] keep usb device by default (correct for bug introduced by tcp sub-backend + +--- + backend/xerox_mfp.c | 27 +++++++++++---------------- + 1 files changed, 11 insertions(+), 16 deletions(-) + +--- a/backend/xerox_mfp.c ++++ b/backend/xerox_mfp.c +@@ -37,10 +37,10 @@ + static const SANE_Device **devlist = NULL; /* sane_get_devices array */ + static struct device *devices_head = NULL; /* sane_get_devices list */ + +-transport available_transports[] = { ++enum { TRANSPORT_USB, TRANSPORT_TCP, TRANSPORTS_MAX }; ++transport available_transports[TRANSPORTS_MAX] = { + { "usb", usb_dev_request, usb_dev_open, usb_dev_close, usb_configure_device }, + { "tcp", tcp_dev_request, tcp_dev_open, tcp_dev_close, tcp_configure_device }, +- { 0 } + }; + + static int resolv_state(int state) +@@ -824,7 +824,13 @@ free_devices (void) + devices_head = NULL; + } + +-/* SANE API ignores return code of this callback */ ++static transport *tr_from_devname(SANE_String_Const devname) ++{ ++ if (strncmp("tcp", devname, 3) == 0) ++ return &available_transports[TRANSPORT_TCP]; ++ return &available_transports[TRANSPORT_USB]; ++} ++ + static SANE_Status + list_one_device (SANE_String_Const devname) + { +@@ -839,12 +845,7 @@ list_one_device (SANE_String_Const devna + return SANE_STATUS_GOOD; + } + +- for (tr = available_transports; tr->ttype; tr++) { +- if (!strncmp (devname, tr->ttype, strlen(tr->ttype))) +- break; +- } +- if (!tr->ttype) +- return SANE_STATUS_INVAL; ++ tr = tr_from_devname(devname); + + dev = calloc (1, sizeof (struct device)); + if (dev == NULL) +@@ -878,13 +879,7 @@ list_one_device (SANE_String_Const devna + static SANE_Status + list_conf_devices (UNUSED (SANEI_Config * config), const char *devname) + { +- transport *tr; +- +- for (tr = available_transports; tr->ttype; tr++) { +- if (!strncmp (devname, tr->ttype, strlen(tr->ttype))) +- return tr->configure_device(devname, list_one_device); +- } +- return SANE_STATUS_INVAL; ++ return tr_from_devname(devname)->configure_device(devname, list_one_device); + } + + SANE_Status diff --git a/utils/sane-backends/patches/002-remove-uneeded.patch b/utils/sane-backends/patches/002-remove-uneeded.patch new file mode 100644 index 0000000..3eeca3d --- /dev/null +++ b/utils/sane-backends/patches/002-remove-uneeded.patch @@ -0,0 +1,11 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -293,7 +293,7 @@ target_alias = @target_alias@ + top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ +-SUBDIRS = include lib sanei backend frontend tools doc po ++SUBDIRS = include lib sanei backend frontend + DIST_SUBDIRS = include lib sanei backend frontend tools doc po japi testsuite + dist_doc_DATA = AUTHORS ChangeLog COPYING LICENSE NEWS PROBLEMS PROJECTS \ + README README.aix README.beos README.darwin README.djpeg README.freebsd \ diff --git a/utils/sane-backends/patches/010-dont-add-host-include-path.patch b/utils/sane-backends/patches/010-dont-add-host-include-path.patch new file mode 100644 index 0000000..c7caf25 --- /dev/null +++ b/utils/sane-backends/patches/010-dont-add-host-include-path.patch @@ -0,0 +1,12 @@ +--- a/configure ++++ b/configure +@@ -5070,9 +5070,6 @@ else + fi + + +-INCLUDES="${INCLUDES} -I/usr/local/include" +- +- + if test "${ac_cv_c_compiler_gnu}" = "yes"; then + NORMAL_CFLAGS="\ + -W \ diff --git a/utils/sane-backends/patches/020-non-i386-qcam.patch b/utils/sane-backends/patches/020-non-i386-qcam.patch new file mode 100644 index 0000000..aa64d43 --- /dev/null +++ b/utils/sane-backends/patches/020-non-i386-qcam.patch @@ -0,0 +1,20 @@ +--- a/backend/qcam.c ++++ b/backend/qcam.c +@@ -105,6 +105,17 @@ + + #include "qcam.h" + ++#if !defined( __i386__) && !defined(__arm__) ++static inline unsigned char inb(unsigned int port) ++{ ++ return 0; ++} ++ ++static inline void outb(unsigned char value, unsigned int port) ++{ ++} ++#endif ++ + /* status bits */ + #define NeedRamTable (1 << 1) + #define BlackBalanceInProgress (1 << 6) diff --git a/utils/schedtools/Makefile b/utils/schedtools/Makefile new file mode 100644 index 0000000..2dad559 --- /dev/null +++ b/utils/schedtools/Makefile @@ -0,0 +1,38 @@ +# +# Copyright (C) 2009 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:=schedtool +PKG_VERSION:=1.3.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://freequaos.host.sk/schedtool/ +PKG_MD5SUM:=0d968f05d3ad7675f1f33ef1f6d0a3fb + +include $(INCLUDE_DIR)/package.mk + +define Package/schedtool + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Scheduler control utility + URL:=http://freequaos.host.sk/schedtool/ +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) -c $(PKG_BUILD_DIR)/schedtool.c -o $(PKG_BUILD_DIR)/schedtool.o + $(TARGET_CC) $(TARGET_CFLAGS) -c $(PKG_BUILD_DIR)/error.c -o $(PKG_BUILD_DIR)/error.o + $(TARGET_CC) $(PKG_BUILD_DIR)/schedtool.o $(PKG_BUILD_DIR)/error.o -o $(PKG_BUILD_DIR)/schedtool +endef + +define Package/schedtool/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/schedtool $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,schedtool)) diff --git a/utils/scponly/Makefile b/utils/scponly/Makefile new file mode 100644 index 0000000..52a14a2 --- /dev/null +++ b/utils/scponly/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=scponly +PKG_VERSION:=4.8 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=139ac9abd7f3b8dbc5c5520745318f8a + +include $(INCLUDE_DIR)/package.mk + +define Package/scponly + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Alternative 'shell' (of sorts) for sysadmins + URL:=http://sourceforge.net/projects/scponly +endef + +define Package/scponly/description + "scponly" is an alternative 'shell' (of sorts) for system + administrators who would like to provide access to remote + users to both read and write local files without providing + any remote execution priviledges. Functionally, it is best + described as a wrapper to the mostly trusted suite of ssh + applications. +endef + +CONFIGURE_ARGS += \ + ac_cv_path_scponly_PROG_SFTP_SERVER="/usr/libexec/sftp-server" \ + \ + --enable-winscp-compat \ + --enable-scp-compat \ + --disable-rsync-compat \ + --with-sftp-server="/usr/libexec/sftp-server" \ + +define Package/scponly/postinst +#!/bin/sh +echo "/usr/bin/scponly" >> $${IPKG_INSTROOT}/etc/shells +endef + +define Package/scponly/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,scponly)) diff --git a/utils/scponly/patches/001-elif_else_replacement.patch b/utils/scponly/patches/001-elif_else_replacement.patch new file mode 100644 index 0000000..e817e3e --- /dev/null +++ b/utils/scponly/patches/001-elif_else_replacement.patch @@ -0,0 +1,12 @@ +diff -urN scponly-4.8/helper.c scponly-4.8.new/helper.c +--- scponly-4.8/helper.c 2008-01-15 07:26:13.000000000 +0100 ++++ scponly-4.8.new/helper.c 2010-03-29 09:48:33.000000000 +0200 +@@ -230,7 +230,7 @@ + return 1; + } + } +-#elif ++#else + /* + * make sure that processing doesn't continue if we can't validate a rsync check + * and if the getopt flag is set. diff --git a/utils/screen/Makefile b/utils/screen/Makefile new file mode 100644 index 0000000..df22deb --- /dev/null +++ b/utils/screen/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2006-2011 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:=screen +PKG_VERSION:=4.0.3 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.uni-erlangen.de/pub/utilities/screen \ + @GNU/screen +PKG_MD5SUM:=8506fd205028a96c741e4037de6e3c42 + +include $(INCLUDE_DIR)/package.mk + +define Package/screen + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncurses + TITLE:=Full-screen terminal window manager + URL:=http://www.gnu.org/software/screen/ +endef + +define Package/screen/description + Screen is a full-screen window manager that multiplexes a physical + terminal between several processes, typically interactive shells. +endef + +define Build/Configure + $(call Build/Configure/Default,\ + --with-sys-screenrc=/etc/screenrc,\ + LIBS="-lcrypt" \ + ) +endef + +define Package/screen/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/screen $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/etc/screenrc $(1)/etc/screenrc +endef + +define Package/screen/conffiles +/etc/screenrc +endef + +$(eval $(call BuildPackage,screen)) diff --git a/utils/screen/files/etc/screenrc b/utils/screen/files/etc/screenrc new file mode 100644 index 0000000..3337674 --- /dev/null +++ b/utils/screen/files/etc/screenrc @@ -0,0 +1 @@ +startup_message off diff --git a/utils/screen/patches/100-cross_compile_fix.patch b/utils/screen/patches/100-cross_compile_fix.patch new file mode 100644 index 0000000..80833a6 --- /dev/null +++ b/utils/screen/patches/100-cross_compile_fix.patch @@ -0,0 +1,530 @@ +Binary files screen-4.0.2.old/.configure.swp and screen-4.0.2.dev/.configure.swp differ +diff -urN screen-4.0.2.old/configure screen-4.0.2.dev/configure +--- screen-4.0.2.old/configure 2003-12-05 14:46:53.000000000 +0100 ++++ screen-4.0.2.dev/configure 2005-05-05 12:13:03.000000000 +0200 +@@ -124,7 +124,7 @@ + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 +- { (exit 1); exit 1; }; } ++ } + fi + case $CONFIG_SHELL in + '') +@@ -174,7 +174,7 @@ + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { 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 + # (the dirname of $[0] is not the place where we might find the +@@ -397,7 +397,7 @@ + # 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 +- { (exit 1); exit 1; }; } ++ } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + +@@ -406,7 +406,7 @@ + # 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 +- { (exit 1); exit 1; }; } ++ } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; +@@ -588,7 +588,7 @@ + # 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 +- { (exit 1); exit 1; }; } ++ } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; +@@ -601,7 +601,7 @@ + # 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 +- { (exit 1); exit 1; }; } ++ } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + +@@ -625,7 +625,7 @@ + + -*) { echo "$as_me: error: unrecognized option: $ac_option + Try \`$0 --help' for more information." >&2 +- { (exit 1); exit 1; }; } ++ } + ;; + + *=*) +@@ -633,7 +633,7 @@ + # 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 +- { (exit 1); exit 1; }; } ++ } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; +@@ -652,7 +652,7 @@ + if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 +- { (exit 1); exit 1; }; } ++ } + fi + + # Be sure to have absolute paths. +@@ -662,7 +662,7 @@ + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 +- { (exit 1); exit 1; }; };; ++ };; + esac + done + +@@ -674,7 +674,7 @@ + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 +- { (exit 1); exit 1; }; };; ++ };; + esac + done + +@@ -728,15 +728,15 @@ + if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 +- { (exit 1); exit 1; }; } ++ } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +- { (exit 1); exit 1; }; } ++ } + fi + fi + (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +- { (exit 1); exit 1; }; } ++ } + srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` + ac_env_build_alias_set=${build_alias+set} + ac_env_build_alias_value=$build_alias +@@ -1243,7 +1243,7 @@ + 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;} +- { (exit 1); exit 1; }; } ++ } + fi + + ac_ext=c +@@ -1734,7 +1734,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: no acceptable C compiler found in \$PATH + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + + # Provide some information about the compiler. + echo "$as_me:$LINENO:" \ +@@ -1856,7 +1856,7 @@ + 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; }; } ++ } + fi + fi + fi +@@ -1898,7 +1898,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot compute suffix of executables: cannot compile and link + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + fi + + rm -f conftest$ac_cv_exeext +@@ -1950,7 +1950,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot compute suffix of object files: cannot compile + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + fi + + rm -f conftest.$ac_cv_objext conftest.$ac_ext +@@ -2514,7 +2514,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + fi + + ac_ext=c +@@ -2704,7 +2704,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -2753,7 +2753,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -2790,7 +2790,7 @@ + + { { echo "$as_me:$LINENO: error: Can't run the compiler - sorry" >&5 + echo "$as_me: error: Can't run the compiler - sorry" >&2;} +- { (exit 1); exit 1; }; } ++ } + fi + rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi +@@ -2800,7 +2800,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -2830,7 +2830,7 @@ + (exit $ac_status); }; }; then + { { echo "$as_me:$LINENO: error: Your compiler does not set the exit status - sorry" >&5 + echo "$as_me: error: Your compiler does not set the exit status - sorry" >&2;} +- { (exit 1); exit 1; }; } ++ } + else + echo "$as_me: program exited with status $ac_status" >&5 + echo "$as_me: failed program was:" >&5 +@@ -2900,7 +2900,7 @@ + if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 + echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} +- { (exit 1); exit 1; }; } ++ } + fi + ac_config_guess="$SHELL $ac_aux_dir/config.guess" + ac_config_sub="$SHELL $ac_aux_dir/config.sub" +@@ -4149,7 +4149,7 @@ + + { { echo "$as_me:$LINENO: error: !!! no select - no screen" >&5 + echo "$as_me: error: !!! no select - no screen" >&2;} +- { (exit 1); exit 1; }; } ++ } + fi + rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +@@ -4163,7 +4163,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -4272,7 +4272,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -4365,7 +4365,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -4460,7 +4460,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -4562,7 +4562,7 @@ + else + { { echo "$as_me:$LINENO: error: you have neither usable sockets nor usable pipes -> no screen" >&5 + echo "$as_me: error: you have neither usable sockets nor usable pipes -> no screen" >&2;} +- { (exit 1); exit 1; }; } ++ } + fi + + +@@ -4573,7 +4573,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -4898,7 +4898,7 @@ + + { { echo "$as_me:$LINENO: error: !!! no tgetent - no screen" >&5 + echo "$as_me: error: !!! no tgetent - no screen" >&2;} +- { (exit 1); exit 1; }; } ++ } + fi + rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + fi +@@ -4915,7 +4915,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -5359,7 +5356,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -6206,7 +6203,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -6482,7 +6479,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -7004,7 +7001,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -7056,7 +7053,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -7110,7 +7107,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -7951,7 +7948,7 @@ + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++ } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" +@@ -7982,7 +7979,7 @@ + ( exit $ac_status ) + { { echo "$as_me:$LINENO: error: Can't run the compiler - internal error. Sorry." >&5 + echo "$as_me: error: Can't run the compiler - internal error. Sorry." >&2;} +- { (exit 1); exit 1; }; } ++ } + fi + rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi +@@ -8251,7 +8248,7 @@ + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 + echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} +- { (exit 1); exit 1; }; } ++ } + fi + case $CONFIG_SHELL in + '') +@@ -8302,7 +8299,7 @@ + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 + 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 + # (the dirname of $[0] is not the place where we might find the +@@ -8494,7 +8491,7 @@ + Try \`$0 --help' for more information." >&5 + echo "$as_me: error: ambiguous option: $1 + Try \`$0 --help' for more information." >&2;} +- { (exit 1); exit 1; }; };; ++ };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) +@@ -8516,7 +8513,7 @@ + Try \`$0 --help' for more information." >&5 + echo "$as_me: error: unrecognized option: $1 + Try \`$0 --help' for more information." >&2;} +- { (exit 1); exit 1; }; } ;; ++ } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + +@@ -8555,7 +8552,7 @@ + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 + echo "$as_me: error: invalid argument: $ac_config_target" >&2;} +- { (exit 1); exit 1; }; };; ++ };; + esac + done + +@@ -8750,7 +8747,7 @@ + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 + echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} +- { (exit 1); exit 1; }; }; } ++ }; } + + ac_builddir=. + +@@ -8816,7 +8813,7 @@ + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + echo "$as_me: error: cannot find input file: $f" >&2;} +- { (exit 1); exit 1; }; } ++ } + echo $f;; + *) # Relative + if test -f "$f"; then +@@ -8829,7 +8826,7 @@ + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + echo "$as_me: error: cannot find input file: $f" >&2;} +- { (exit 1); exit 1; }; } ++ } + fi;; + esac + done` || { (exit 1); exit 1; } +@@ -8907,7 +8904,7 @@ + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + echo "$as_me: error: cannot find input file: $f" >&2;} +- { (exit 1); exit 1; }; } ++ } + echo $f;; + *) # Relative + if test -f "$f"; then +@@ -8920,7 +8917,7 @@ + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + echo "$as_me: error: cannot find input file: $f" >&2;} +- { (exit 1); exit 1; }; } ++ } + fi;; + esac + done` || { (exit 1); exit 1; } +@@ -9073,7 +9070,7 @@ + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 + echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} +- { (exit 1); exit 1; }; }; } ++ }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file +diff -urN screen-4.0.2.old/pty.c screen-4.0.2.dev/pty.c +--- screen-4.0.2.old/pty.c 2003-09-08 16:26:18.000000000 +0200 ++++ screen-4.0.2.dev/pty.c 2005-05-05 12:32:20.000000000 +0200 +@@ -34,9 +34,9 @@ + #endif + + /* for solaris 2.1, Unixware (SVR4.2) and possibly others */ +-#ifdef HAVE_SVR4_PTYS +-# include +-#endif ++//#ifdef HAVE_SVR4_PTYS ++//# include ++//#endif + + #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL) + # include +--- screen-4.0.2/configure.old 2005-05-24 18:49:30.000000000 +0200 ++++ screen-4.0.2/configure 2005-05-24 18:49:54.000000000 +0200 +@@ -6598,8 +6598,6 @@ + LIBS="$oldlibs" + fi + rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +-test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec" +-test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow" + oldlibs="$LIBS" + LIBS="$LIBS -lsun" + { echo "$as_me:$LINENO: checking IRIX sun library..." >&5 +diff -ur screen.old/sched.h screen.dev/sched.h +--- screen.old/sched.h 2002-01-08 16:42:43.000000000 +0100 ++++ screen.dev/sched.h 2007-03-02 17:03:48.475830776 +0100 +@@ -22,6 +22,11 @@ + * $Id: 100-cross_compile_fix.patch 6458 2007-03-02 16:12:30Z nbd $ FAU + */ + ++#ifndef __SCHED_H ++#define __SCHED_H ++ ++#include ++ + struct event + { + struct event *next; +@@ -41,3 +46,5 @@ + #define EV_READ 1 + #define EV_WRITE 2 + #define EV_ALWAYS 3 ++ ++#endif diff --git a/utils/sdparm/Makefile b/utils/sdparm/Makefile new file mode 100644 index 0000000..bde487f --- /dev/null +++ b/utils/sdparm/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2007-2008 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:=sdparm +PKG_VERSION:=1.04 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://sg.danny.cz/sg/p +PKG_MD5SUM:=f4b8c7bfc1cd27d30fbdc066a65a44ea + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/sdparm + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Read or modify SCSI or USB disk parameters + DEPENDS:=+kmod-scsi-generic + SUBMENU:=disc + URL:=http://sg.danny.cz/sg/sdparm.html +endef + +define Package/sdparm/description + The sdparm utility outputs and in some cases modifies SCSI device + parameters. +endef + +define Package/sdparm/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,sdparm)) diff --git a/utils/sed/Makefile b/utils/sed/Makefile new file mode 100644 index 0000000..5a60bb0 --- /dev/null +++ b/utils/sed/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sed +PKG_VERSION:=4.2.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@GNU/$(PKG_NAME) +PKG_MD5SUM:=7d310fbd76e01a01115075c1fd3f455a + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/sed + SECTION:=utils + CATEGORY:=Utilities + TITLE:=GNU streams editor + URL:=http://ftp.gnu.org/gnu/sed/ +endef + +define Package/sed/description + Sed (streams editor) takes text input and performs some operation + (or set of operations) on it and outputs the modified text. +endef + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \ + PREFIX="/usr" \ + HOST="$(GNU_TARGET_NAME)" \ + +define Package/sed/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sed $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,sed)) diff --git a/utils/setpwc/Makefile b/utils/setpwc/Makefile new file mode 100644 index 0000000..638f10e --- /dev/null +++ b/utils/setpwc/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2006-2012 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:=setpwc +PKG_VERSION:=1.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://www.vanheusden.com/setpwc +PKG_MD5SUM:=79d5ee468c0076feb3cac473bef661d2 + +include $(INCLUDE_DIR)/package.mk + +define Package/setpwc + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Philips (and compatibles) WebCams (PWC) control utility + URL:=http://www.vanheusden.com/setpwc/ + DEPENDS:=+kmod-video-pwc +endef + +define Package/setpwc/description + With setpwc you can set and list various settings of Philips (and + compatibles) WebCams with the 'PWC chipset'. +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) -DVERSION=\"$(PKG_VERSION)\" -o $(PKG_BUILD_DIR)/setpwc $(PKG_BUILD_DIR)/setpwc.c +endef + +define Package/setpwc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/setpwc $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,setpwc)) diff --git a/utils/setserial/Makefile b/utils/setserial/Makefile new file mode 100644 index 0000000..a154499 --- /dev/null +++ b/utils/setserial/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2006-2011 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:=setserial +PKG_VERSION:=2.17 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/setserial +PKG_MD5SUM:=c4867d72c41564318e0107745eb7a0f2 + +include $(INCLUDE_DIR)/package.mk + +define Package/setserial + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Serial port configuration utility + URL:=http://setserial.sourceforge.net/ + SUBMENU:=Terminal +endef + +define Package/setserial/description + setserial is a program designed to set and/or report the + configuration information associated with a serial port. This + information includes what I/O port and IRQ a particular + serial port is using, and whether or not the break key should + be interpreted as the Secure Attention Key, and so on. +endef + +# uses GNU configure + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + setserial +endef + +define Package/setserial/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/setserial $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/setserial.config $(1)/etc/config/setserial + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/setserial.init $(1)/etc/init.d/setserial +endef + +define Package/setserial/conffiles +/etc/config/setserial +endef + +$(eval $(call BuildPackage,setserial)) diff --git a/utils/setserial/files/setserial.config b/utils/setserial/files/setserial.config new file mode 100644 index 0000000..ba2957f --- /dev/null +++ b/utils/setserial/files/setserial.config @@ -0,0 +1,6 @@ +package 'setserial' + +config 'setserial' + option enabled 0 + option device '/dev/ttyS1' + option parameters 'irq 3' diff --git a/utils/setserial/files/setserial.init b/utils/setserial/files/setserial.init new file mode 100644 index 0000000..db38ce2 --- /dev/null +++ b/utils/setserial/files/setserial.init @@ -0,0 +1,34 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=15 + +section_enabled() { + local enabled + config_get_bool enabled "$1" 'enabled' 0 + [ $enabled -gt 0 ] || return 1 +} + +start_instance() { + local section="$1" + local device + local parameters + local args="" + + section_enabled "$section" || return 1 + + config_get device "$section" 'device' + [ -n "$device" ] || return 1 + append args "$device" + + config_get parameters "$section" 'parameters' + [ -n "$parameters" ] || return 1 + append args "$parameters" + + /usr/sbin/setserial $device $parameters +} + +boot() { + config_load 'setserial' + config_foreach start_instance 'setserial' +} diff --git a/utils/setserial/patches/100-compile-fixes.patch b/utils/setserial/patches/100-compile-fixes.patch new file mode 100644 index 0000000..4adc7cb --- /dev/null +++ b/utils/setserial/patches/100-compile-fixes.patch @@ -0,0 +1,70 @@ +Index: setserial-2.17/setserial.c +=================================================================== +--- setserial-2.17.orig/setserial.c 2010-10-24 11:21:21.000000000 +0200 ++++ setserial-2.17/setserial.c 2010-10-24 11:26:55.000000000 +0200 +@@ -15,14 +15,19 @@ + #include + #include + #include ++#include ++ ++#include + + #ifdef HAVE_ASM_IOCTLS_H + #include + #endif + #ifdef HAVE_LINUX_HAYESESP_H + #include ++#ifdef TIOCGHAYESESP ++#define HAVE_HAYESESP ++#endif + #endif +-#include + + #include "version.h" + +@@ -118,7 +123,7 @@ + CMD_CONFIG, "autoconfigure",0, 0, 0, 0, + CMD_GETMULTI, "get_multiport",0, 0, 0, 0, + CMD_SETMULTI, "set_multiport",0, 0, 0, 0, +-#ifdef TIOCGHAYESESP ++#ifdef HAVE_HAYESESP + CMD_RX_TRIG, "rx_trigger", 0, 0, 0, FLAG_NEED_ARG, + CMD_TX_TRIG, "tx_trigger", 0, 0, 0, FLAG_NEED_ARG, + CMD_FLOW_OFF, "flow_off", 0, 0, 0, FLAG_NEED_ARG, +@@ -356,7 +361,7 @@ + } + #endif + +-#ifdef TIOCGHAYESESP ++#ifdef HAVE_HAYESESP + void print_hayesesp(int fd) + { + struct hayes_esp_config esp; +@@ -453,7 +458,7 @@ + print_flags(&serinfo, "\tFlags: ", ""); + printf("\n\n"); + +-#ifdef TIOCGHAYESESP ++#ifdef HAVE_HAYESESP + print_hayesesp(fd); + #endif + } else if (verbosity==0) { +@@ -593,7 +598,7 @@ + } + set_multiport(device, fd, &arg); + break; +-#ifdef TIOCGHAYESESP ++#ifdef HAVE_HAYESESP + case CMD_RX_TRIG: + case CMD_TX_TRIG: + case CMD_FLOW_OFF: +@@ -692,7 +697,7 @@ + fprintf(stderr, "\t get_multiport\tDisplay the multiport configuration\n"); + fprintf(stderr, "\t set_multiport\tSet the multiport configuration\n"); + fprintf(stderr, "\n"); +-#ifdef TIOCGHAYESESP ++#ifdef HAVE_HAYESESP + fprintf(stderr, "\t* rx_trigger\tSet RX trigger level (ESP-only)\n"); + fprintf(stderr, "\t* tx_trigger\tSet TX trigger level (ESP-only)\n"); + fprintf(stderr, "\t* flow_off\tSet hardware flow off level (ESP-only)\n"); diff --git a/utils/sg3-utils/Makefile b/utils/sg3-utils/Makefile new file mode 100644 index 0000000..b8c960a --- /dev/null +++ b/utils/sg3-utils/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2009 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:=sg3-utils +PKG_VERSION:=1.24 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/s/$(PKG_NAME) +PKG_MD5SUM:=9e1b8811b013d8f97d8ea2e0942cebad + +include $(INCLUDE_DIR)/package.mk + +define Package/sg3-utils + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+kmod-usb-storage + TITLE:=sg3 scsi utilities + URL:=http://sg.danny.cz/sg/sg3_utils.html +endef + +define Package/sg3-utils/description + The package includes a number of utilities to allow a user + to use the sg interface to find out low-level information + about any SCSI device. +endef + +define Build/Configure +endef + + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) -f no_lib/Makefile.linux \ + DESTDIR=$(STAGING_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -DSG3_UTILS_LINUX" \ + sg_start +endef + + +define Package/sg3-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/sg_start $(1)/usr/bin +endef + + +$(eval $(call BuildPackage,sg3-utils)) diff --git a/utils/shadow/Makefile b/utils/shadow/Makefile new file mode 100644 index 0000000..fd0735c --- /dev/null +++ b/utils/shadow/Makefile @@ -0,0 +1,102 @@ +# +# Copyright (C) 2008-2012 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:=shadow +PKG_VERSION:=4.1.5.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://pkg-shadow.alioth.debian.org/releases +PKG_MD5SUM:=a00449aa439c69287b6d472191dc2247 + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +UTILS := \ + groupadd groupdel groupmod useradd userdel usermod \ + su passwd groups + +CONFIGURE_ARGS += \ + --without-audit \ + --without-libpam \ + --without-selinux \ + --without-acl \ + --without-attr \ + --without-tcb \ + --without-nscd + +define Package/shadow + SECTION:=utils + CATEGORY:=Utilities + TITLE:=The PLD Linux shadow utilities + URL:=http://pkg-shadow.alioth.debian.org/ + DEPENDS:=$(foreach u,$(UTILS),+shadow-$(u)) +endef + +define Package/shadow/description + Full versions of standard shadow utilities. Normally, you would not + use this package, since the functionality in BusyBox is more than + sufficient and much smaller. +endef + +define Package/shadow/install + true +endef + + +define Package/shadow-common + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Shared definitions for the shadow utilities + URL:=http://pkg-shadow.alioth.debian.org/ +endef + +define Package/shadow-common/conffiles +/etc/login.defs +endef + +define Package/shadow-common/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/login.defs $(1)/etc/ +endef + + +define program + define Package/shadow-$(1) + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Utility $(1) from the PLD Linux shadow utilities + URL:=http://pkg-shadow.alioth.debian.org/ + DEPENDS:=+shadow-common + endef + + define Package/shadow-$(1)/description + Full version of standard $(1) utility. Normally, you would not use this + package, since the functionality in BusyBox is more than sufficient. + endef + + define Package/shadow-$(1)/install + [ -x "$(PKG_INSTALL_DIR)/usr/sbin/$(1)" ] && { \ + $(INSTALL_DIR) $$(1)/usr/sbin; \ + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/$(1) $$(1)/usr/sbin/; \ + } || { \ + $(INSTALL_DIR) $$(1)/usr/bin; \ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/; \ + } + endef + + $$(eval $$(call BuildPackage,shadow-$(1))) +endef + +$(eval $(call BuildPackage,shadow)) +$(eval $(call BuildPackage,shadow-common)) +$(foreach u,$(UTILS),$(eval $(call program,$(u)))) diff --git a/utils/shadow/patches/004-disable-ruser-lookup.patch b/utils/shadow/patches/004-disable-ruser-lookup.patch new file mode 100644 index 0000000..7a6f38e --- /dev/null +++ b/utils/shadow/patches/004-disable-ruser-lookup.patch @@ -0,0 +1,10 @@ +--- a/configure.in ++++ b/configure.in +@@ -195,7 +195,6 @@ AC_DEFINE_UNQUOTED(PASSWD_PROGRAM, "$sha + dnl XXX - quick hack, should disappear before anyone notices :). + AC_DEFINE(USE_SYSLOG, 1, [Define to use syslog().]) + AC_DEFINE(RLOGIN, 1, [Define if login should support the -r flag for rlogind.]) +-AC_DEFINE(RUSEROK, 0, [Define to the ruserok() "success" return value (0 or 1).]) + + AC_ARG_ENABLE(shadowgrp, + [AC_HELP_STRING([--enable-shadowgrp], [enable shadow group support @<:@default=yes@:>@])], diff --git a/utils/sierra-pcmcia/Makefile b/utils/sierra-pcmcia/Makefile new file mode 100644 index 0000000..3b25b18 --- /dev/null +++ b/utils/sierra-pcmcia/Makefile @@ -0,0 +1,39 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=sierra-pcmcia +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=http://www.sierrawireless.com/resources/faq/PC_Card/AirCard850_860/ +PKG_SOURCE:=Aircard_Linux.tar +PKG_MD5SUM:=9562b626d958ea02d737feb6a85f0920 + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/pcmcia-serial-sierra + SUBMENU:=Other modules + TITLE:=Sierra AirCard PCMCIA support + DEPENDS:=kmod-pcmcia-serial + URL:=http://www.sierrawireless.com/faq/ShowFAQ.aspx?ID=118 +endef + +define KernelPackage/pcmcia-serial-sierra/description + Support files for the Sierra AirCard 555, 7xx, and 8x0 +endef + +define Build/Compile +endef + +define Package/kmod-pcmcia-serial-sierra/install + $(INSTALL_DIR) $(1)/lib/firmware + $(INSTALL_DATA) $(PKG_BUILD_DIR)/../Aircard_Linux/*.cis $(1)/lib/firmware/ +endef + +$(eval $(call KernelPackage,pcmcia-serial-sierra)) diff --git a/utils/sispmctl/Makefile b/utils/sispmctl/Makefile new file mode 100644 index 0000000..6c65156 --- /dev/null +++ b/utils/sispmctl/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2008-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sispmctl +PKG_VERSION:=3.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=eca3d5803a29617432ef9f609be59bad + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/sispmctl + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Silver Shield PM Control for Linux + URL:=http://sispmctl.sourceforge.net/ + DEPENDS:=+libusb +endef + +define Package/sispmctl/description + The sispmctl tool can control Gembird SIS-PM Silver Shield + programmable power outlet strips (also known under the name + Revolt Intelli-Plug) from the command line. + . + It can be used to switch on or off any of the programmable + power sockets of the SIS-PM via USB. It can also show the + current status of each power socket, and it can handle + multiple SIS-PM devices, too. +endef + +CONFIGURE_ARGS += \ + --enable-webless \ + --disable-dependency-tracking + +define Package/sispmctl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,sispmctl)) diff --git a/utils/smartmontools/Makefile b/utils/smartmontools/Makefile new file mode 100644 index 0000000..a69ab93 --- /dev/null +++ b/utils/smartmontools/Makefile @@ -0,0 +1,92 @@ +# +# Copyright (C) 2006-2011 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:=smartmontools +PKG_VERSION:=5.40 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/smartmontools +PKG_MD5SUM:=0f0be0239914ad87830a4fff594bda5b + +include $(INCLUDE_DIR)/package.mk + +define Package/smartmontools/Default + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+uclibcxx + TITLE:=S.M.A.R.T Monitoring + URL:=http://smartmontools.sourceforge.net/ +endef + +define Package/smartmontools + $(call Package/smartmontools/Default) + TITLE+= Tool +endef + +define Package/smartmontools/description + smartmontools contains utility programs (smartctl) to + control/monitor storage systems using the Self-Monitoring, Analysis + and Reporting Technology System (S.M.A.R.T.) built into most modern + ATA and SCSI disks. It is derived from smartsuite. +endef + +define Package/smartd + $(call Package/smartmontools/Default) + DEPENDS+= +rsync + TITLE+= Daemon +endef + +define Package/smartd/description + smartmontools contains utility programs (smartd) to + control/monitor storage systems using the Self-Monitoring, Analysis + and Reporting Technology System (S.M.A.R.T.) built into most modern + ATA and SCSI disks. It is derived from smartsuite. +endef + +# uses GNU configure + +CONFIGURE_VARS += \ + CXXFLAGS="$$$$CXXFLAGS -fno-builtin -fno-rtti -nostdinc++" \ + CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/uClibc++ -I$(LINUX_DIR)/include" \ + LDFLAGS="$$$$LDFLAGS" \ + LIBS="-nodefaultlibs -lc -luClibc++ -lm $(LIBGCC_S) -lc" \ + +define Build/Configure + (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \ + ./autogen.sh \ + ); + $(call Build/Configure/Default) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + LD="$(TARGET_CXX)" +endef + +define Package/smartmontools/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/smartctl $(1)/usr/sbin/ +endef + +define Package/smartd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/smartd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/smartd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/smartd.init $(1)/etc/init.d/smartd +endef + +define Package/smartd/conffiles +/etc/smartd.conf +endef + +$(eval $(call BuildPackage,smartmontools)) +$(eval $(call BuildPackage,smartd)) diff --git a/utils/smartmontools/files/smartd.conf b/utils/smartmontools/files/smartd.conf new file mode 100644 index 0000000..0740fcf --- /dev/null +++ b/utils/smartmontools/files/smartd.conf @@ -0,0 +1 @@ +/dev/hdb -H diff --git a/utils/smartmontools/files/smartd.init b/utils/smartmontools/files/smartd.init new file mode 100644 index 0000000..f1453f2 --- /dev/null +++ b/utils/smartmontools/files/smartd.init @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=95 + +start() { + service_start /usr/sbin/smartd -q never +} + +stop() { + service_stop /usr/sbin/smartd +} + +reload() { + service_reload /usr/sbin/smartd +} diff --git a/utils/ssldump/Makefile b/utils/ssldump/Makefile new file mode 100644 index 0000000..4700e11 --- /dev/null +++ b/utils/ssldump/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2008 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:=ssldump +PKG_VERSION:=0.9b3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.rtfm.com/ssldump/ +PKG_MD5SUM:=ac8c28fe87508d6bfb06344ec496b1dd + +include $(INCLUDE_DIR)/package.mk + +define Package/ssldump + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libopenssl +libpcap + TITLE:=a SSLv3/TLS network protocol analyzer + URL:=http://www.rtfm.com/ssldump/ +endef + +define Package/ssldump/description + ssldump is an SSLv3/TLS network protocol analyzer. It identifies TCP connections on the chosen network interface + and attempts to interpret them as SSLv3/TLS traffic. When it identifies SSLv3/TLS traffic, it decodes the records + and displays them in a textual form to stdout. If provided with the appropriate keying material, it will also decrypt + the connections and display the application data traffic. +endef + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared \ + --with-openssl-inc="$(STAGING_DIR)/usr/include" \ + --with-openssl-lib="$(STAGING_DIR)/usr/lib" \ + --with-pcap-inc="$(STAGING_DIR)/usr/include" \ + --with-pcap-lib="$(STAGING_DIR)/usr/lib" \ + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all +endef + + +define Package/ssldump/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ssldump $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,ssldump)) diff --git a/utils/ssldump/patches/001-missing_headers.patch b/utils/ssldump/patches/001-missing_headers.patch new file mode 100644 index 0000000..70ac11c --- /dev/null +++ b/utils/ssldump/patches/001-missing_headers.patch @@ -0,0 +1,23 @@ +diff -urN ssldump-0.9b3/base/pcap-snoop.c ssldump-0.9b3.new/base/pcap-snoop.c +--- ssldump-0.9b3/base/pcap-snoop.c 2002-09-09 23:02:58.000000000 +0200 ++++ ssldump-0.9b3.new/base/pcap-snoop.c 2008-12-14 18:43:48.000000000 +0100 +@@ -49,7 +49,7 @@ + + #include + #include +-#include ++#include + #ifndef _WIN32 + #include + #endif +diff -urN ssldump-0.9b3/ssl/ssldecode.c ssldump-0.9b3.new/ssl/ssldecode.c +--- ssldump-0.9b3/ssl/ssldecode.c 2002-08-17 03:33:17.000000000 +0200 ++++ ssldump-0.9b3.new/ssl/ssldecode.c 2008-12-14 18:44:11.000000000 +0100 +@@ -52,6 +52,7 @@ + #include + #include + #include ++#include + #endif + #include "ssldecode.h" + #include "ssl_rec.h" diff --git a/utils/strace/Makefile b/utils/strace/Makefile new file mode 100644 index 0000000..c68a48e --- /dev/null +++ b/utils/strace/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=strace + +PKG_VERSION:=4.5.20 +PKG_RELEASE:=1 +PKG_MD5SUM:=64dfe10d9db0c1e34030891695ffca4b + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/$(PKG_NAME) + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/strace + SECTION:=utils + CATEGORY:=Utilities + TITLE:=System call tracer + URL:=http://strace.sourceforge.net/ +endef + +define Package/strace/description +A useful diagnostic, instructional, and debugging tool. Allows you to track what +system calls a program makes while it is running. +endef + +# needed when compiling against Linux 2.4 +CONFIGURE_VARS += \ + ac_cv_header_linux_netlink_h=yes + +ifneq ($(CONFIG_EXTERNAL_TOOLCHAIN),) + TARGET_CPPFLAGS += -I$(LINUX_DIR)/include +endif + +MAKE_FLAGS := \ + CCOPT="$(TARGET_CFLAGS)" + +define Package/strace/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/strace $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,strace)) diff --git a/utils/strace/patches-4.5.16/001-arm_eabi_syscalls.patch b/utils/strace/patches-4.5.16/001-arm_eabi_syscalls.patch new file mode 100644 index 0000000..52234c5 --- /dev/null +++ b/utils/strace/patches-4.5.16/001-arm_eabi_syscalls.patch @@ -0,0 +1,64 @@ +Index: strace-4.5.16/linux/syscallent.h +=================================================================== +--- strace-4.5.16.orig/linux/syscallent.h 2007-08-02 03:37:55.000000000 +0200 ++++ strace-4.5.16/linux/syscallent.h 2008-05-11 15:35:45.000000000 +0200 +@@ -130,7 +130,10 @@ + { 2, TF, sys_statfs, "statfs" }, /* 99 */ + { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ + { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ +- { 2, TD, sys_socketcall, "socketcall", SYS_socketcall }, /* 102 */ ++ { 2, TD, sys_socketcall, "socketcall", ++#ifdef __NR_socketcall ++ SYS_socketcall }, /* 102 */ ++#endif + { 3, 0, sys_syslog, "syslog" }, /* 103 */ + { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ + { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ +@@ -145,7 +148,10 @@ + { 4, TP, sys_wait4, "wait4", SYS_wait4 }, /* 114 */ + { 1, 0, sys_swapoff, "swapoff" }, /* 115 */ + { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ +- { 6, 0, sys_ipc, "ipc", SYS_ipc }, /* 117 */ ++ { 6, 0, sys_ipc, "ipc", ++#ifdef __NR_ipc ++ SYS_ipc }, /* 117 */ ++#endif + { 1, TD, sys_fsync, "fsync" }, /* 118 */ + { 1, TS, sys_sigreturn, "sigreturn" }, /* 119 */ + { 5, TP, sys_clone, "clone", SYS_clone }, /* 120 */ +@@ -282,7 +288,11 @@ + { 3, 0, sys_io_cancel, "io_cancel" }, /* 249 */ + { 5, 0, sys_fadvise64, "fadvise64" }, /* 250 */ + { 5, 0, printargs, "SYS_251" }, /* 251 */ +- { 1, TP, sys_exit, "exit_group", __NR_exit_group }, /* 252 */ ++ { 1, TP, sys_exit, "exit_group" ++#ifdef __NR_exit_group ++ , __NR_exit_group ++#endif ++ }, /* 252 */ + { 4, 0, printargs, "lookup_dcookie"}, /* 253 */ + { 1, 0, sys_epoll_create, "epoll_create" }, /* 254 */ + { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 255 */ +Index: strace-4.5.16/syscall.c +=================================================================== +--- strace-4.5.16.orig/syscall.c 2006-12-21 23:13:33.000000000 +0100 ++++ strace-4.5.16/syscall.c 2008-05-11 15:35:45.000000000 +0200 +@@ -2383,14 +2383,18 @@ + switch (known_scno(tcp)) { + #ifdef LINUX + #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA) ++#ifdef __NR_socketcall + case SYS_socketcall: + decode_subcall(tcp, SYS_socket_subcall, + SYS_socket_nsubcalls, deref_style); + break; ++#endif ++#ifdef __NR_ipc + case SYS_ipc: + decode_subcall(tcp, SYS_ipc_subcall, + SYS_ipc_nsubcalls, shift_style); + break; ++#endif + #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */ + #if defined (SPARC) || defined (SPARC64) + case SYS_socketcall: diff --git a/utils/strace/patches-4.5.16/002-arm_bad_syscall.patch b/utils/strace/patches-4.5.16/002-arm_bad_syscall.patch new file mode 100644 index 0000000..4eb8a73 --- /dev/null +++ b/utils/strace/patches-4.5.16/002-arm_bad_syscall.patch @@ -0,0 +1,20 @@ +Index: strace-4.5.16/syscall.c +=================================================================== +--- strace-4.5.16.orig/syscall.c 2008-05-11 15:35:45.000000000 +0200 ++++ strace-4.5.16/syscall.c 2008-05-11 15:36:09.000000000 +0200 +@@ -1045,6 +1045,15 @@ + /* + * Note: we only deal with only 32-bit CPUs here. + */ ++ ++ if (!(tcp->flags & TCB_INSYSCALL) && ++ (tcp->flags & TCB_WAITEXECVE)) { ++ /* caught a fake syscall from the execve's exit */ ++ tcp->flags &= ~TCB_WAITEXECVE; ++ return 0; ++ } ++ ++ + if (regs.ARM_cpsr & 0x20) { + /* + * Get the Thumb-mode system call number diff --git a/utils/strace/patches-4.5.16/003-avr32_support.patch b/utils/strace/patches-4.5.16/003-avr32_support.patch new file mode 100644 index 0000000..79d9add --- /dev/null +++ b/utils/strace/patches-4.5.16/003-avr32_support.patch @@ -0,0 +1,2080 @@ +--- strace-4.5.16/configure 2008-05-11 15:51:53.000000000 +0200 ++++ strace-4.5.16/configure 2008-05-11 15:54:52.000000000 +0200 +@@ -2531,6 +2531,14 @@ + _ACEOF + + ;; ++avr32*) ++ arch=avr32 ++ ++cat >>confdefs.h <<\_ACEOF ++#define AVR32 1 ++_ACEOF ++ ++ ;; + *) + { echo "$as_me:$LINENO: result: NO!" >&5 + echo "${ECHO_T}NO!" >&6; } +Index: strace-4.5.16/config.h.in +=================================================================== +--- strace-4.5.16.orig/config.h.in 2007-08-03 12:24:53.000000000 +0200 ++++ strace-4.5.16/config.h.in 2008-05-11 15:36:30.000000000 +0200 +@@ -6,6 +6,9 @@ + /* Define for the ARM architecture. */ + #undef ARM + ++/* Define for the AVR32 architecture. */ ++#undef AVR32 ++ + /* Define for the FreeBSD operating system. */ + #undef FREEBSD + +Index: strace-4.5.16/config.sub +=================================================================== +--- strace-4.5.16.orig/config.sub 2005-02-02 05:18:19.000000000 +0100 ++++ strace-4.5.16/config.sub 2008-05-11 15:38:53.000000000 +0200 +@@ -230,7 +230,7 @@ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ +- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ ++ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ +@@ -297,7 +297,7 @@ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ +- | avr-* \ ++ | avr-* | avr32-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ +Index: strace-4.5.16/configure.ac +=================================================================== +--- strace-4.5.16.orig/configure.ac 2007-08-03 12:06:42.000000000 +0200 ++++ strace-4.5.16/configure.ac 2008-05-11 15:36:30.000000000 +0200 +@@ -103,6 +103,10 @@ + arch=x86_64 + AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.]) + ;; ++avr32*) ++ arch=avr32 ++ AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.]) ++ ;; + *) + AC_MSG_RESULT([NO!]) + AC_MSG_ERROR([architecture $host_cpu is not supported by strace]) +Index: strace-4.5.16/defs.h +=================================================================== +--- strace-4.5.16.orig/defs.h 2007-07-24 03:57:11.000000000 +0200 ++++ strace-4.5.16/defs.h 2008-05-11 15:36:30.000000000 +0200 +@@ -94,6 +94,9 @@ + # if defined(X86_64) + # define LINUX_X86_64 + # endif ++# if defined(AVR32) ++# define LINUX_AVR32 ++# endif + #endif + + #if defined(SVR4) || defined(FREEBSD) +@@ -120,7 +123,7 @@ + #include + #endif /* FREEBSD */ + #else /* !USE_PROCFS */ +-#if (defined(LINUXSPARC) || defined (LINUX_X86_64)) && defined(__GLIBC__) ++#if (defined(LINUXSPARC) || defined (LINUX_X86_64) || defined (LINUX_AVR32)) && defined(__GLIBC__) + #include + #else + /* Work around awkward prototype in ptrace.h. */ +@@ -327,7 +330,7 @@ + #define TCB_FOLLOWFORK 00400 /* Process should have forks followed */ + #define TCB_REPRINT 01000 /* We should reprint this syscall on exit */ + #ifdef LINUX +-# if defined(ALPHA) || defined(SPARC) || defined(SPARC64) || defined(POWERPC) || defined(IA64) || defined(HPPA) || defined(SH) || defined(SH64) || defined(S390) || defined(S390X) || defined(ARM) ++# if defined(ALPHA) || defined(SPARC) || defined(SPARC64) || defined(POWERPC) || defined(IA64) || defined(HPPA) || defined(SH) || defined(SH64) || defined(S390) || defined(S390X) || defined(ARM) || defined(AVR32) + # define TCB_WAITEXECVE 02000 /* ignore SIGTRAP after exceve */ + # endif + # define TCB_CLONE_DETACHED 04000 /* CLONE_DETACHED set in creating syscall */ +Index: strace-4.5.16/linux/avr32/ioctlent.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-4.5.16/linux/avr32/ioctlent.h 2008-05-11 15:36:30.000000000 +0200 +@@ -0,0 +1,1268 @@ ++{"linux/fs.h", "FIBMAP", 0x1}, ++{"linux/fs.h", "FIGETBSZ", 0x2}, ++{"linux/fd.h", "FDCLRPRM", 0x241}, ++{"linux/fd.h", "FDMSGON", 0x245}, ++{"linux/fd.h", "FDMSGOFF", 0x246}, ++{"linux/fd.h", "FDFMTBEG", 0x247}, ++{"linux/fd.h", "FDFMTEND", 0x249}, ++{"linux/fd.h", "FDSETEMSGTRESH", 0x24a}, ++{"linux/fd.h", "FDFLUSH", 0x24b}, ++{"linux/fd.h", "FDRESET", 0x254}, ++{"linux/fd.h", "FDWERRORCLR", 0x256}, ++{"linux/fd.h", "FDRAWCMD", 0x258}, ++{"linux/fd.h", "FDTWADDLE", 0x259}, ++{"linux/fd.h", "FDEJECT", 0x25a}, ++{"linux/wireless.h", "IW_POWER_ALL_R", 0x300}, ++{"linux/in6.h", "IPV6_PRIORITY_RESERVED1", 0x300}, ++{"linux/apm_bios.h", "APM_DEVICE_PARALLEL", 0x300}, ++{"linux/hdreg.h", "HDIO_GETGEO", 0x301}, ++{"linux/ps2esdi.h", "HDIO_GETGEO", 0x301}, ++{"linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0x302}, ++{"linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0x304}, ++{"linux/hdreg.h", "HDIO_GET_QDMA", 0x305}, ++{"linux/hdreg.h", "HDIO_SET_XFER", 0x306}, ++{"linux/hdreg.h", "HDIO_OBSOLETE_IDENTITY", 0x307}, ++{"linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0x308}, ++{"linux/hdreg.h", "HDIO_GET_32BIT", 0x309}, ++{"linux/hdreg.h", "HDIO_GET_NOWERR", 0x30a}, ++{"linux/hdreg.h", "HDIO_GET_DMA", 0x30b}, ++{"linux/hdreg.h", "HDIO_GET_NICE", 0x30c}, ++{"linux/hdreg.h", "HDIO_GET_IDENTITY", 0x30d}, ++{"linux/hdreg.h", "HDIO_GET_WCACHE", 0x30e}, ++{"linux/hdreg.h", "HDIO_GET_ACOUSTIC", 0x30f}, ++{"linux/hdreg.h", "HDIO_GET_ADDRESS", 0x310}, ++{"linux/hdreg.h", "HDIO_GET_BUSSTATE", 0x31a}, ++{"linux/hdreg.h", "HDIO_TRISTATE_HWIF", 0x31b}, ++{"linux/hdreg.h", "HDIO_DRIVE_RESET", 0x31c}, ++{"linux/hdreg.h", "HDIO_DRIVE_TASKFILE", 0x31d}, ++{"linux/hdreg.h", "HDIO_DRIVE_TASK", 0x31e}, ++{"linux/hdreg.h", "HDIO_DRIVE_CMD", 0x31f}, ++{"linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0x321}, ++{"linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0x322}, ++{"linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0x323}, ++{"linux/hdreg.h", "HDIO_SET_32BIT", 0x324}, ++{"linux/hdreg.h", "HDIO_SET_NOWERR", 0x325}, ++{"linux/hdreg.h", "HDIO_SET_DMA", 0x326}, ++{"linux/hdreg.h", "HDIO_SET_PIO_MODE", 0x327}, ++{"linux/hdreg.h", "HDIO_SCAN_HWIF", 0x328}, ++{"linux/hdreg.h", "HDIO_SET_NICE", 0x329}, ++{"linux/hdreg.h", "HDIO_UNREGISTER_HWIF", 0x32a}, ++{"linux/hdreg.h", "HDIO_SET_WCACHE", 0x32b}, ++{"linux/hdreg.h", "HDIO_SET_ACOUSTIC", 0x32c}, ++{"linux/hdreg.h", "HDIO_SET_BUSSTATE", 0x32d}, ++{"linux/hdreg.h", "HDIO_SET_QDMA", 0x32e}, ++{"linux/hdreg.h", "HDIO_SET_ADDRESS", 0x32f}, ++{"linux/zorro_ids.h", "ZORRO_MANUF_CARDCO_1", 0x3ec}, ++{"linux/zorro_ids.h", "ZORRO_MANUF_A_SQUARED", 0x3ed}, ++{"linux/zorro_ids.h", "ZORRO_MANUF_COMSPEC_COMMUNICATIONS", 0x3ee}, ++{"linux/zorro_ids.h", "ZORRO_MANUF_ANAKIN_RESEARCH", 0x3f1}, ++{"linux/zorro_ids.h", "ZORRO_MANUF_MICROBOTICS", 0x3f2}, ++{"linux/zorro_ids.h", "ZORRO_MANUF_ACCESS_ASSOCIATES_ALEGRA", 0x3f4}, ++{"linux/zorro_ids.h", "ZORRO_MANUF_EXPANSION_TECHNOLOGIES", 0x3f6}, ++{"linux/zorro_ids.h", "ZORRO_MANUF_ASDG", 0x3ff}, ++{"linux/apm_bios.h", "APM_DEVICE_PCMCIA", 0x600}, ++{"linux/ixjuser.h", "MIXER_PORT_CD_L", 0x600}, ++{"linux/in6.h", "IPV6_PRIORITY_INTERACTIVE", 0x600}, ++{"linux/lp.h", "LPCHAR", 0x601}, ++{"linux/lp.h", "LPTIME", 0x602}, ++{"linux/lp.h", "LPABORT", 0x604}, ++{"linux/lp.h", "LPSETIRQ", 0x605}, ++{"linux/lp.h", "LPGETIRQ", 0x606}, ++{"linux/lp.h", "LPWAIT", 0x608}, ++{"linux/lp.h", "LPCAREFUL", 0x609}, ++{"linux/lp.h", "LPABORTOPEN", 0x60a}, ++{"linux/lp.h", "LPGETSTATUS", 0x60b}, ++{"linux/lp.h", "LPRESET", 0x60c}, ++{"linux/lp.h", "LPGETSTATS", 0x60d}, ++{"linux/lp.h", "LPGETFLAGS", 0x60e}, ++{"linux/lp.h", "LPSETTIMEOUT", 0x60f}, ++{"linux/som.h", "SOM_LIB_RELOC", 0x619}, ++{"linux/zorro_ids.h", "ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_1", 0x6e1}, ++{"linux/fs.h", "BLKROSET", 0x125d}, ++{"linux/fs.h", "BLKROGET", 0x125e}, ++{"linux/fs.h", "BLKRRPART", 0x125f}, ++{"linux/fs.h", "BLKGETSIZE", 0x1260}, ++{"linux/fs.h", "BLKFLSBUF", 0x1261}, ++{"linux/fs.h", "BLKRASET", 0x1262}, ++{"linux/fs.h", "BLKRAGET", 0x1263}, ++{"linux/fs.h", "BLKFRASET", 0x1264}, ++{"linux/fs.h", "BLKFRAGET", 0x1265}, ++{"linux/fs.h", "BLKSECTSET", 0x1266}, ++{"linux/fs.h", "BLKSECTGET", 0x1267}, ++{"linux/fs.h", "BLKSSZGET", 0x1268}, ++{"linux/blkpg.h", "BLKPG", 0x1269}, ++{"linux/fs.h", "BLKTRACESTART", 0x1274}, ++{"linux/fs.h", "BLKTRACESTOP", 0x1275}, ++{"linux/fs.h", "BLKTRACETEARDOWN", 0x1276}, ++{"linux/zorro_ids.h", "ZORRO_MANUF_APOLLO_2", 0x2200}, ++{"scsi/sg.h", "SG_SET_TIMEOUT", 0x2201}, ++{"scsi/sg.h", "SG_GET_TIMEOUT", 0x2202}, ++{"scsi/sg.h", "SG_EMULATED_HOST", 0x2203}, ++{"scsi/sg.h", "SG_SET_TRANSFORM", 0x2204}, ++{"scsi/sg.h", "SG_GET_TRANSFORM", 0x2205}, ++{"linux/zorro_ids.h", "ZORRO_MANUF_APOLLO_3", 0x2222}, ++{"scsi/sg.h", "SG_GET_COMMAND_Q", 0x2270}, ++{"scsi/sg.h", "SG_SET_COMMAND_Q", 0x2271}, ++{"scsi/sg.h", "SG_GET_RESERVED_SIZE", 0x2272}, ++{"scsi/sg.h", "SG_SET_RESERVED_SIZE", 0x2275}, ++{"scsi/sg.h", "SG_GET_SCSI_ID", 0x2276}, ++{"scsi/sg.h", "SG_SET_FORCE_LOW_DMA", 0x2279}, ++{"scsi/sg.h", "SG_GET_LOW_DMA", 0x227a}, ++{"scsi/sg.h", "SG_SET_FORCE_PACK_ID", 0x227b}, ++{"scsi/sg.h", "SG_GET_PACK_ID", 0x227c}, ++{"scsi/sg.h", "SG_GET_NUM_WAITING", 0x227d}, ++{"scsi/sg.h", "SG_SET_DEBUG", 0x227e}, ++{"scsi/sg.h", "SG_GET_SG_TABLESIZE", 0x227f}, ++{"scsi/sg.h", "SG_GET_VERSION_NUM", 0x2282}, ++{"scsi/sg.h", "SG_NEXT_CMD_LEN", 0x2283}, ++{"scsi/sg.h", "SG_SCSI_RESET", 0x2284}, ++{"scsi/sg.h", "SG_IO", 0x2285}, ++{"scsi/sg.h", "SG_GET_REQUEST_TABLE", 0x2286}, ++{"scsi/sg.h", "SG_SET_KEEP_ORPHAN", 0x2287}, ++{"scsi/sg.h", "SG_GET_KEEP_ORPHAN", 0x2288}, ++{"linux/apm_bios.h", "APM_IOC_STANDBY", 0x4101}, ++{"linux/agpgart.h", "AGPIOC_ACQUIRE", 0x4101}, ++{"linux/apm_bios.h", "APM_IOC_SUSPEND", 0x4102}, ++{"linux/agpgart.h", "AGPIOC_RELEASE", 0x4102}, ++{"linux/pmu.h", "PMU_IOC_SLEEP", 0x4200}, ++{"linux/cciss_ioctl.h", "CCISS_REVALIDVOLS", 0x420a}, ++{"linux/cciss_ioctl.h", "CCISS_DEREGDISK", 0x420c}, ++{"linux/cciss_ioctl.h", "CCISS_REGNEWD", 0x420e}, ++{"linux/cciss_ioctl.h", "CCISS_RESCANDISK", 0x4210}, ++{"linux/fb.h", "FBIOGET_VSCREENINFO", 0x4600}, ++{"linux/fb.h", "FBIOPUT_VSCREENINFO", 0x4601}, ++{"linux/ps2esdi.h", "CMD_READ", 0x4601}, ++{"linux/fb.h", "FBIOGET_FSCREENINFO", 0x4602}, ++{"linux/ps2esdi.h", "CMD_WRITE", 0x4602}, ++{"linux/fb.h", "FBIOGETCMAP", 0x4604}, ++{"linux/fb.h", "FBIOPUTCMAP", 0x4605}, ++{"linux/fb.h", "FBIOPAN_DISPLAY", 0x4606}, ++{"linux/fb.h", "FBIOGET_CON2FBMAP", 0x460f}, ++{"linux/fb.h", "FBIOPUT_CON2FBMAP", 0x4610}, ++{"linux/fb.h", "FBIOBLANK", 0x4611}, ++{"linux/fb.h", "FBIO_ALLOC", 0x4613}, ++{"linux/fb.h", "FBIO_FREE", 0x4614}, ++{"linux/fb.h", "FBIOGET_GLYPH", 0x4615}, ++{"linux/fb.h", "FBIOGET_HWCINFO", 0x4616}, ++{"linux/fb.h", "FBIOPUT_MODEINFO", 0x4617}, ++{"linux/fb.h", "FBIOGET_DISPINFO", 0x4618}, ++{"linux/arcfb.h", "FBIO_WAITEVENT", 0x4688}, ++{"linux/hiddev.h", "HIDIOCAPPLICATION", 0x4802}, ++{"linux/hiddev.h", "HIDIOCINITREPORT", 0x4805}, ++{"linux/isdn.h", "IIOCNETAIF", 0x4901}, ++{"linux/isdn.h", "IIOCNETDIF", 0x4902}, ++{"linux/isdn.h", "IIOCNETSCF", 0x4903}, ++{"linux/isdn.h", "IIOCNETGCF", 0x4904}, ++{"linux/isdn.h", "IIOCNETANM", 0x4905}, ++{"linux/isdn.h", "IIOCNETDNM", 0x4906}, ++{"linux/isdn.h", "IIOCNETGNM", 0x4907}, ++{"linux/isdn.h", "IIOCGETSET", 0x4908}, ++{"linux/isdn.h", "IIOCSETSET", 0x4909}, ++{"linux/isdn.h", "IIOCSETVER", 0x490a}, ++{"linux/isdn.h", "IIOCNETHUP", 0x490b}, ++{"linux/isdn.h", "IIOCSETGST", 0x490c}, ++{"linux/isdn.h", "IIOCSETBRJ", 0x490d}, ++{"linux/isdn.h", "IIOCSIGPRF", 0x490e}, ++{"linux/isdn.h", "IIOCGETPRF", 0x490f}, ++{"linux/isdn.h", "IIOCSETPRF", 0x4910}, ++{"linux/isdn.h", "IIOCGETMAP", 0x4911}, ++{"linux/isdn.h", "IIOCSETMAP", 0x4912}, ++{"linux/isdn.h", "IIOCNETASL", 0x4913}, ++{"linux/isdn.h", "IIOCNETDIL", 0x4914}, ++{"linux/isdn.h", "IIOCGETCPS", 0x4915}, ++{"linux/isdn.h", "IIOCGETDVR", 0x4916}, ++{"linux/isdn.h", "IIOCNETLCR", 0x4917}, ++{"linux/isdn.h", "IIOCNETDWRSET", 0x4918}, ++{"linux/isdn.h", "IIOCNETALN", 0x4920}, ++{"linux/isdn.h", "IIOCNETDLN", 0x4921}, ++{"linux/isdn.h", "IIOCNETGPN", 0x4922}, ++{"linux/isdn.h", "IIOCDBGVAR", 0x497f}, ++{"linux/isdn.h", "IIOCDRVCTL", 0x4980}, ++{"linux/kd.h", "KIOCSOUND", 0x4b2f}, ++{"linux/kd.h", "KDMKTONE", 0x4b30}, ++{"linux/kd.h", "KDGETLED", 0x4b31}, ++{"linux/kd.h", "KDSETLED", 0x4b32}, ++{"linux/kd.h", "KDGKBTYPE", 0x4b33}, ++{"linux/kd.h", "KDADDIO", 0x4b34}, ++{"linux/kd.h", "KDDELIO", 0x4b35}, ++{"linux/kd.h", "KDENABIO", 0x4b36}, ++{"linux/kd.h", "KDDISABIO", 0x4b37}, ++{"linux/kd.h", "KDSETMODE", 0x4b3a}, ++{"linux/kd.h", "KDGETMODE", 0x4b3b}, ++{"linux/kd.h", "KDMAPDISP", 0x4b3c}, ++{"linux/kd.h", "KDUNMAPDISP", 0x4b3d}, ++{"linux/kd.h", "GIO_SCRNMAP", 0x4b40}, ++{"linux/kd.h", "PIO_SCRNMAP", 0x4b41}, ++{"linux/kd.h", "KDGKBMODE", 0x4b44}, ++{"linux/kd.h", "KDSKBMODE", 0x4b45}, ++{"linux/kd.h", "KDGKBENT", 0x4b46}, ++{"linux/kd.h", "KDSKBENT", 0x4b47}, ++{"linux/kd.h", "KDGKBSENT", 0x4b48}, ++{"linux/kd.h", "KDSKBSENT", 0x4b49}, ++{"linux/kd.h", "KDGKBDIACR", 0x4b4a}, ++{"linux/kd.h", "KDSKBDIACR", 0x4b4b}, ++{"linux/kd.h", "KDGETKEYCODE", 0x4b4c}, ++{"linux/kd.h", "KDSETKEYCODE", 0x4b4d}, ++{"linux/kd.h", "KDSIGACCEPT", 0x4b4e}, ++{"linux/kd.h", "KDKBDREP", 0x4b52}, ++{"linux/kd.h", "GIO_FONT", 0x4b60}, ++{"linux/kd.h", "PIO_FONT", 0x4b61}, ++{"linux/kd.h", "KDGKBMETA", 0x4b62}, ++{"linux/kd.h", "KDSKBMETA", 0x4b63}, ++{"linux/kd.h", "KDGKBLED", 0x4b64}, ++{"linux/kd.h", "KDSKBLED", 0x4b65}, ++{"linux/kd.h", "GIO_UNIMAP", 0x4b66}, ++{"linux/kd.h", "PIO_UNIMAP", 0x4b67}, ++{"linux/kd.h", "PIO_UNIMAPCLR", 0x4b68}, ++{"linux/kd.h", "GIO_UNISCRNMAP", 0x4b69}, ++{"linux/kd.h", "PIO_UNISCRNMAP", 0x4b6a}, ++{"linux/kd.h", "GIO_FONTX", 0x4b6b}, ++{"linux/kd.h", "PIO_FONTX", 0x4b6c}, ++{"linux/kd.h", "PIO_FONTRESET", 0x4b6d}, ++{"linux/kd.h", "GIO_CMAP", 0x4b70}, ++{"linux/kd.h", "PIO_CMAP", 0x4b71}, ++{"linux/kd.h", "KDFONTOP", 0x4b72}, ++{"linux/loop.h", "LOOP_SET_FD", 0x4c00}, ++{"linux/loop.h", "LOOP_CLR_FD", 0x4c01}, ++{"linux/loop.h", "LOOP_SET_STATUS", 0x4c02}, ++{"linux/loop.h", "LOOP_GET_STATUS", 0x4c03}, ++{"linux/loop.h", "LOOP_SET_STATUS64", 0x4c04}, ++{"linux/loop.h", "LOOP_GET_STATUS64", 0x4c05}, ++{"linux/loop.h", "LOOP_CHANGE_FD", 0x4c06}, ++{"mtd/mtd-abi.h", "MTDFILEMODE", 0x4d13}, ++{"linux/random.h", "RNDZAPENTCNT", 0x5204}, ++{"linux/random.h", "RNDCLEARPOOL", 0x5206}, ++{"linux/cdrom.h", "CDROMPAUSE", 0x5301}, ++{"linux/n_r3964.h", "R3964_ENABLE_SIGNALS", 0x5301}, ++{"linux/n_r3964.h", "R3964_SETPRIORITY", 0x5302}, ++{"linux/cdrom.h", "CDROMRESUME", 0x5302}, ++{"linux/n_r3964.h", "R3964_USE_BCC", 0x5303}, ++{"linux/cdrom.h", "CDROMPLAYMSF", 0x5303}, ++{"linux/n_r3964.h", "R3964_READ_TELEGRAM", 0x5304}, ++{"linux/cdrom.h", "CDROMPLAYTRKIND", 0x5304}, ++{"linux/cdrom.h", "CDROMREADTOCHDR", 0x5305}, ++{"linux/cdrom.h", "CDROMREADTOCENTRY", 0x5306}, ++{"linux/cdrom.h", "CDROMSTOP", 0x5307}, ++{"linux/cdrom.h", "CDROMSTART", 0x5308}, ++{"linux/cdrom.h", "CDROMEJECT", 0x5309}, ++{"linux/cdrom.h", "CDROMVOLCTRL", 0x530a}, ++{"linux/cdrom.h", "CDROMSUBCHNL", 0x530b}, ++{"linux/cdrom.h", "CDROMREADMODE2", 0x530c}, ++{"linux/cdrom.h", "CDROMREADMODE1", 0x530d}, ++{"linux/cdrom.h", "CDROMREADAUDIO", 0x530e}, ++{"linux/cdrom.h", "CDROMEJECT_SW", 0x530f}, ++{"linux/cdrom.h", "CDROMMULTISESSION", 0x5310}, ++{"linux/cdrom.h", "CDROM_GET_MCN", 0x5311}, ++{"linux/cdrom.h", "CDROMRESET", 0x5312}, ++{"linux/cdrom.h", "CDROMVOLREAD", 0x5313}, ++{"linux/cdrom.h", "CDROMREADRAW", 0x5314}, ++{"linux/cdrom.h", "CDROMREADCOOKED", 0x5315}, ++{"linux/cdrom.h", "CDROMSEEK", 0x5316}, ++{"linux/cdrom.h", "CDROMPLAYBLK", 0x5317}, ++{"linux/cdrom.h", "CDROMREADALL", 0x5318}, ++{"linux/cdrom.h", "CDROMCLOSETRAY", 0x5319}, ++{"linux/cdrom.h", "CDROMGETSPINDOWN", 0x531d}, ++{"linux/cdrom.h", "CDROMSETSPINDOWN", 0x531e}, ++{"linux/cdrom.h", "CDROM_SET_OPTIONS", 0x5320}, ++{"linux/cdrom.h", "CDROM_CLEAR_OPTIONS", 0x5321}, ++{"linux/cdrom.h", "CDROM_SELECT_SPEED", 0x5322}, ++{"linux/cdrom.h", "CDROM_SELECT_DISC", 0x5323}, ++{"linux/cdrom.h", "CDROM_MEDIA_CHANGED", 0x5325}, ++{"linux/cdrom.h", "CDROM_DRIVE_STATUS", 0x5326}, ++{"linux/cdrom.h", "CDROM_DISC_STATUS", 0x5327}, ++{"linux/cdrom.h", "CDROM_CHANGER_NSLOTS", 0x5328}, ++{"linux/cdrom.h", "CDROM_LOCKDOOR", 0x5329}, ++{"linux/cdrom.h", "CDROM_DEBUG", 0x5330}, ++{"linux/cdrom.h", "CDROM_GET_CAPABILITY", 0x5331}, ++{"scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORLOCK", 0x5380}, ++{"scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORUNLOCK", 0x5381}, ++{"linux/cdrom.h", "CDROMAUDIOBUFSIZ", 0x5382}, ++{"scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0x5382}, ++{"scsi/scsi.h", "SCSI_IOCTL_TAGGED_ENABLE", 0x5383}, ++{"scsi/scsi.h", "SCSI_IOCTL_TAGGED_DISABLE", 0x5384}, ++{"scsi/scsi.h", "SCSI_IOCTL_PROBE_HOST", 0x5385}, ++{"scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0x5386}, ++{"linux/cdrom.h", "DVD_READ_STRUCT", 0x5390}, ++{"linux/cdrom.h", "DVD_WRITE_STRUCT", 0x5391}, ++{"linux/cdrom.h", "DVD_AUTH", 0x5392}, ++{"linux/cdrom.h", "CDROM_SEND_PACKET", 0x5393}, ++{"linux/cdrom.h", "CDROM_NEXT_WRITABLE", 0x5394}, ++{"linux/cdrom.h", "CDROM_LAST_WRITTEN", 0x5395}, ++{"asm/ioctls.h", "TCGETS", 0x5401}, ++{"asm/ioctls.h", "TCSETS", 0x5402}, ++{"asm/ioctls.h", "TCSETSW", 0x5403}, ++{"asm/ioctls.h", "TCSETSF", 0x5404}, ++{"asm/ioctls.h", "TCGETA", 0x5405}, ++{"asm/ioctls.h", "TCSETA", 0x5406}, ++{"asm/ioctls.h", "TCSETAW", 0x5407}, ++{"asm/ioctls.h", "TCSETAF", 0x5408}, ++{"asm/ioctls.h", "TCSBRK", 0x5409}, ++{"asm/ioctls.h", "TCXONC", 0x540a}, ++{"asm/ioctls.h", "TCFLSH", 0x540b}, ++{"asm/ioctls.h", "TIOCEXCL", 0x540c}, ++{"asm/ioctls.h", "TIOCNXCL", 0x540d}, ++{"asm/ioctls.h", "TIOCSCTTY", 0x540e}, ++{"asm/ioctls.h", "TIOCGPGRP", 0x540f}, ++{"asm/ioctls.h", "TIOCSPGRP", 0x5410}, ++{"asm/ioctls.h", "TIOCOUTQ", 0x5411}, ++{"asm/ioctls.h", "TIOCSTI", 0x5412}, ++{"asm/ioctls.h", "TIOCGWINSZ", 0x5413}, ++{"asm/ioctls.h", "TIOCSWINSZ", 0x5414}, ++{"asm/ioctls.h", "TIOCMGET", 0x5415}, ++{"asm/ioctls.h", "TIOCMBIS", 0x5416}, ++{"asm/ioctls.h", "TIOCMBIC", 0x5417}, ++{"asm/ioctls.h", "TIOCMSET", 0x5418}, ++{"asm/ioctls.h", "TIOCGSOFTCAR", 0x5419}, ++{"asm/ioctls.h", "TIOCSSOFTCAR", 0x541a}, ++{"asm/ioctls.h", "FIONREAD", 0x541b}, ++{"asm/ioctls.h", "TIOCLINUX", 0x541c}, ++{"asm/ioctls.h", "TIOCCONS", 0x541d}, ++{"asm/ioctls.h", "TIOCGSERIAL", 0x541e}, ++{"asm/ioctls.h", "TIOCSSERIAL", 0x541f}, ++{"asm/ioctls.h", "TIOCPKT", 0x5420}, ++{"asm/ioctls.h", "FIONBIO", 0x5421}, ++{"asm/ioctls.h", "TIOCNOTTY", 0x5422}, ++{"asm/ioctls.h", "TIOCSETD", 0x5423}, ++{"asm/ioctls.h", "TIOCGETD", 0x5424}, ++{"asm/ioctls.h", "TCSBRKP", 0x5425}, ++{"asm/ioctls.h", "TIOCSBRK", 0x5427}, ++{"asm/ioctls.h", "TIOCCBRK", 0x5428}, ++{"asm/ioctls.h", "TIOCGSID", 0x5429}, ++{"asm/ioctls.h", "FIONCLEX", 0x5450}, ++{"asm/ioctls.h", "FIOCLEX", 0x5451}, ++{"asm/ioctls.h", "FIOASYNC", 0x5452}, ++{"asm/ioctls.h", "TIOCSERCONFIG", 0x5453}, ++{"asm/ioctls.h", "TIOCSERGWILD", 0x5454}, ++{"asm/ioctls.h", "TIOCSERSWILD", 0x5455}, ++{"asm/ioctls.h", "TIOCGLCKTRMIOS", 0x5456}, ++{"asm/ioctls.h", "TIOCSLCKTRMIOS", 0x5457}, ++{"asm/ioctls.h", "TIOCSERGSTRUCT", 0x5458}, ++{"asm/ioctls.h", "TIOCSERGETLSR", 0x5459}, ++{"asm/ioctls.h", "TIOCSERGETMULTI", 0x545a}, ++{"asm/ioctls.h", "TIOCSERSETMULTI", 0x545b}, ++{"asm/ioctls.h", "TIOCMIWAIT", 0x545c}, ++{"asm/ioctls.h", "TIOCGICOUNT", 0x545d}, ++{"asm/ioctls.h", "TIOCGHAYESESP", 0x545e}, ++{"asm/ioctls.h", "TIOCSHAYESESP", 0x545f}, ++{"asm/ioctls.h", "FIOQSIZE", 0x5460}, ++{"linux/uinput.h", "UI_DEV_CREATE", 0x5501}, ++{"linux/uinput.h", "UI_DEV_DESTROY", 0x5502}, ++{"linux/vt.h", "VT_OPENQRY", 0x5600}, ++{"linux/vt.h", "VT_GETMODE", 0x5601}, ++{"linux/videodev2.h", "VIDIOC_RESERVED", 0x5601}, ++{"linux/vt.h", "VT_SETMODE", 0x5602}, ++{"linux/vt.h", "VT_GETSTATE", 0x5603}, ++{"linux/vt.h", "VT_SENDSIG", 0x5604}, ++{"linux/vt.h", "VT_RELDISP", 0x5605}, ++{"linux/vt.h", "VT_ACTIVATE", 0x5606}, ++{"linux/vt.h", "VT_WAITACTIVE", 0x5607}, ++{"linux/vt.h", "VT_DISALLOCATE", 0x5608}, ++{"linux/vt.h", "VT_RESIZE", 0x5609}, ++{"linux/vt.h", "VT_RESIZEX", 0x560a}, ++{"linux/vt.h", "VT_LOCKSWITCH", 0x560b}, ++{"linux/vt.h", "VT_UNLOCKSWITCH", 0x560c}, ++{"linux/vt.h", "VT_GETHIFONTMASK", 0x560d}, ++{"linux/videodev2.h", "VIDIOC_LOG_STATUS", 0x5646}, ++{"linux/sonet.h", "SONET_SETFRAMING", 0x6115}, ++{"linux/atm_nicstar.h", "NS_ADJBUFLEV", 0x6163}, ++{"linux/atm_tcp.h", "SIOCSIFATMTCP", 0x6180}, ++{"linux/atm_tcp.h", "ATMTCP_CREATE", 0x618e}, ++{"linux/atm_tcp.h", "ATMTCP_REMOVE", 0x618f}, ++{"linux/atmlec.h", "ATMLEC_CTRL", 0x61d0}, ++{"linux/atmlec.h", "ATMLEC_DATA", 0x61d1}, ++{"linux/atmlec.h", "ATMLEC_MCAST", 0x61d2}, ++{"linux/atmmpc.h", "ATMMPC_CTRL", 0x61d8}, ++{"linux/atmmpc.h", "ATMMPC_DATA", 0x61d9}, ++{"linux/atmclip.h", "SIOCMKCLIP", 0x61e0}, ++{"linux/atmarp.h", "ATMARPD_CTRL", 0x61e1}, ++{"linux/atmarp.h", "ATMARP_MKIP", 0x61e2}, ++{"linux/atmarp.h", "ATMARP_SETENTRY", 0x61e3}, ++{"linux/atmarp.h", "ATMARP_ENCAP", 0x61e5}, ++{"linux/atmsvc.h", "ATMSIGD_CTRL", 0x61f0}, ++{"linux/cm4000_cs.h", "CM_IOCSRDR", 0x6303}, ++{"linux/cm4000_cs.h", "CM_IOCARDOFF", 0x6304}, ++{"linux/chio.h", "CHIOINITELEM", 0x6311}, ++{"linux/comstats.h", "COM_GETPORTSTATS", 0x631e}, ++{"linux/comstats.h", "COM_CLRPORTSTATS", 0x631f}, ++{"linux/comstats.h", "COM_GETBRDSTATS", 0x6320}, ++{"linux/comstats.h", "COM_READPORT", 0x6328}, ++{"linux/comstats.h", "COM_READBOARD", 0x6329}, ++{"linux/comstats.h", "COM_READPANEL", 0x632a}, ++{"linux/video_decoder.h", "DECODER_DUMP", 0x64c0}, ++{"linux/hpet.h", "HPET_IE_ON", 0x6801}, ++{"linux/hpet.h", "HPET_IE_OFF", 0x6802}, ++{"linux/hpet.h", "HPET_EPI", 0x6804}, ++{"linux/hpet.h", "HPET_DPI", 0x6805}, ++{"linux/mmtimer.h", "MMTIMER_GETOFFSET", 0x6d00}, ++{"linux/synclink.h", "MGSL_IOCSTXIDLE", 0x6d02}, ++{"linux/synclink.h", "MGSL_IOCGTXIDLE", 0x6d03}, ++{"linux/synclink.h", "MGSL_IOCTXENABLE", 0x6d04}, ++{"linux/mmtimer.h", "MMTIMER_GETBITS", 0x6d04}, ++{"linux/synclink.h", "MGSL_IOCRXENABLE", 0x6d05}, ++{"linux/mmtimer.h", "MMTIMER_MMAPAVAIL", 0x6d06}, ++{"linux/synclink.h", "MGSL_IOCTXABORT", 0x6d06}, ++{"linux/synclink.h", "MGSL_IOCGSTATS", 0x6d07}, ++{"linux/synclink.h", "MGSL_IOCLOOPTXDONE", 0x6d09}, ++{"linux/synclink.h", "MGSL_IOCSIF", 0x6d0a}, ++{"linux/synclink.h", "MGSL_IOCGIF", 0x6d0b}, ++{"linux/synclink.h", "MGSL_IOCCLRMODCOUNT", 0x6d0f}, ++{"linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", 0x6e03}, ++{"linux/rtc.h", "RTC_AIE_ON", 0x7001}, ++{"linux/rtc.h", "RTC_AIE_OFF", 0x7002}, ++{"linux/rtc.h", "RTC_UIE_ON", 0x7003}, ++{"linux/rtc.h", "RTC_UIE_OFF", 0x7004}, ++{"linux/rtc.h", "RTC_PIE_ON", 0x7005}, ++{"linux/rtc.h", "RTC_PIE_OFF", 0x7006}, ++{"linux/rtc.h", "RTC_WIE_ON", 0x700f}, ++{"linux/rtc.h", "RTC_WIE_OFF", 0x7010}, ++{"linux/nvram.h", "NVRAM_INIT", 0x7040}, ++{"linux/nvram.h", "NVRAM_SETCKS", 0x7041}, ++{"linux/ppdev.h", "PPCLAIM", 0x708b}, ++{"linux/ppdev.h", "PPRELEASE", 0x708c}, ++{"linux/ppdev.h", "PPYIELD", 0x708d}, ++{"linux/ppdev.h", "PPEXCL", 0x708f}, ++{"linux/telephony.h", "PHONE_CAPABILITIES", 0x7180}, ++{"linux/telephony.h", "PHONE_RING", 0x7183}, ++{"linux/telephony.h", "PHONE_HOOKSTATE", 0x7184}, ++{"linux/telephony.h", "OLD_PHONE_RING_START", 0x7187}, ++{"linux/telephony.h", "PHONE_RING_STOP", 0x7188}, ++{"linux/telephony.h", "PHONE_REC_START", 0x718a}, ++{"linux/telephony.h", "PHONE_REC_STOP", 0x718b}, ++{"linux/telephony.h", "PHONE_REC_LEVEL", 0x718f}, ++{"linux/telephony.h", "PHONE_PLAY_START", 0x7191}, ++{"linux/telephony.h", "PHONE_PLAY_STOP", 0x7192}, ++{"linux/telephony.h", "PHONE_PLAY_LEVEL", 0x7195}, ++{"linux/telephony.h", "PHONE_GET_TONE_ON_TIME", 0x719e}, ++{"linux/telephony.h", "PHONE_GET_TONE_OFF_TIME", 0x719f}, ++{"linux/telephony.h", "PHONE_GET_TONE_STATE", 0x71a0}, ++{"linux/telephony.h", "PHONE_BUSY", 0x71a1}, ++{"linux/telephony.h", "PHONE_RINGBACK", 0x71a2}, ++{"linux/telephony.h", "PHONE_DIALTONE", 0x71a3}, ++{"linux/telephony.h", "PHONE_CPT_STOP", 0x71a4}, ++{"linux/telephony.h", "PHONE_PSTN_GET_STATE", 0x71a5}, ++{"linux/telephony.h", "PHONE_PSTN_LINETEST", 0x71a8}, ++{"linux/ixjuser.h", "IXJCTL_DSP_RESET", 0x71c0}, ++{"linux/ixjuser.h", "IXJCTL_DSP_IDLE", 0x71c5}, ++{"linux/ixjuser.h", "IXJCTL_TESTRAM", 0x71c6}, ++{"linux/ixjuser.h", "IXJCTL_AEC_STOP", 0x71cc}, ++{"linux/ixjuser.h", "IXJCTL_AEC_GET_LEVEL", 0x71cd}, ++{"linux/ixjuser.h", "IXJCTL_PSTN_LINETEST", 0x71d3}, ++{"linux/ixjuser.h", "IXJCTL_PLAY_CID", 0x71d7}, ++{"linux/ixjuser.h", "IXJCTL_DRYBUFFER_CLEAR", 0x71e7}, ++{"linux/cdk.h", "STL_BINTR", 0x7314}, ++{"linux/cdk.h", "STL_BSTART", 0x7315}, ++{"linux/cdk.h", "STL_BSTOP", 0x7316}, ++{"linux/cdk.h", "STL_BRESET", 0x7317}, ++{"linux/cdk.h", "STL_GETPFLAG", 0x7350}, ++{"linux/cdk.h", "STL_SETPFLAG", 0x7351}, ++{"linux/if_ppp.h", "PPPIOCDISCONN", 0x7439}, ++{"linux/if_ppp.h", "PPPIOCXFERUNIT", 0x744e}, ++{"linux/meye.h", "MEYEIOC_STILLCAPT", 0x76c4}, ++{"linux/videotext.h", "VTXIOCPUTPAGE", 0x8108}, ++{"linux/videotext.h", "VTXIOCSETDISP", 0x8109}, ++{"linux/videotext.h", "VTXIOCPUTSTAT", 0x810a}, ++{"linux/videotext.h", "VTXIOCCLRCACHE", 0x810b}, ++{"asm/sockios.h", "FIOSETOWN", 0x8901}, ++{"asm/sockios.h", "SIOCSPGRP", 0x8902}, ++{"asm/sockios.h", "FIOGETOWN", 0x8903}, ++{"asm/sockios.h", "SIOCGPGRP", 0x8904}, ++{"asm/sockios.h", "SIOCATMARK", 0x8905}, ++{"asm/sockios.h", "SIOCGSTAMP", 0x8906}, ++{"linux/sockios.h", "SIOCADDRT", 0x890b}, ++{"linux/sockios.h", "SIOCDELRT", 0x890c}, ++{"linux/sockios.h", "SIOCRTMSG", 0x890d}, ++{"linux/sockios.h", "SIOCGIFNAME", 0x8910}, ++{"linux/sockios.h", "SIOCSIFLINK", 0x8911}, ++{"linux/sockios.h", "SIOCGIFCONF", 0x8912}, ++{"linux/sockios.h", "SIOCGIFFLAGS", 0x8913}, ++{"linux/sockios.h", "SIOCSIFFLAGS", 0x8914}, ++{"linux/sockios.h", "SIOCGIFADDR", 0x8915}, ++{"linux/sockios.h", "SIOCSIFADDR", 0x8916}, ++{"linux/sockios.h", "SIOCGIFDSTADDR", 0x8917}, ++{"linux/sockios.h", "SIOCSIFDSTADDR", 0x8918}, ++{"linux/sockios.h", "SIOCGIFBRDADDR", 0x8919}, ++{"linux/sockios.h", "SIOCSIFBRDADDR", 0x891a}, ++{"linux/sockios.h", "SIOCGIFNETMASK", 0x891b}, ++{"linux/sockios.h", "SIOCSIFNETMASK", 0x891c}, ++{"linux/sockios.h", "SIOCGIFMETRIC", 0x891d}, ++{"linux/sockios.h", "SIOCSIFMETRIC", 0x891e}, ++{"linux/sockios.h", "SIOCGIFMEM", 0x891f}, ++{"linux/sockios.h", "SIOCSIFMEM", 0x8920}, ++{"linux/sockios.h", "SIOCGIFMTU", 0x8921}, ++{"linux/sockios.h", "SIOCSIFMTU", 0x8922}, ++{"linux/sockios.h", "SIOCSIFNAME", 0x8923}, ++{"linux/sockios.h", "SIOCSIFHWADDR", 0x8924}, ++{"linux/sockios.h", "SIOCGIFENCAP", 0x8925}, ++{"linux/sockios.h", "SIOCSIFENCAP", 0x8926}, ++{"linux/sockios.h", "SIOCGIFHWADDR", 0x8927}, ++{"linux/sockios.h", "SIOCGIFSLAVE", 0x8929}, ++{"linux/sockios.h", "SIOCSIFSLAVE", 0x8930}, ++{"linux/sockios.h", "SIOCADDMULTI", 0x8931}, ++{"linux/sockios.h", "SIOCDELMULTI", 0x8932}, ++{"linux/sockios.h", "SIOCGIFINDEX", 0x8933}, ++{"linux/sockios.h", "SIOCSIFPFLAGS", 0x8934}, ++{"linux/sockios.h", "SIOCGIFPFLAGS", 0x8935}, ++{"linux/sockios.h", "SIOCDIFADDR", 0x8936}, ++{"linux/sockios.h", "SIOCSIFHWBROADCAST", 0x8937}, ++{"linux/sockios.h", "SIOCGIFCOUNT", 0x8938}, ++{"linux/sockios.h", "SIOCGIFBR", 0x8940}, ++{"linux/sockios.h", "SIOCSIFBR", 0x8941}, ++{"linux/sockios.h", "SIOCGIFTXQLEN", 0x8942}, ++{"linux/sockios.h", "SIOCSIFTXQLEN", 0x8943}, ++{"linux/sockios.h", "SIOCGIFDIVERT", 0x8944}, ++{"linux/sockios.h", "SIOCSIFDIVERT", 0x8945}, ++{"linux/sockios.h", "SIOCETHTOOL", 0x8946}, ++{"linux/sockios.h", "SIOCGMIIPHY", 0x8947}, ++{"linux/sockios.h", "SIOCGMIIREG", 0x8948}, ++{"linux/sockios.h", "SIOCSMIIREG", 0x8949}, ++{"linux/sockios.h", "SIOCWANDEV", 0x894a}, ++{"linux/sockios.h", "SIOCDARP", 0x8953}, ++{"linux/sockios.h", "SIOCGARP", 0x8954}, ++{"linux/sockios.h", "SIOCSARP", 0x8955}, ++{"linux/sockios.h", "SIOCDRARP", 0x8960}, ++{"linux/sockios.h", "SIOCGRARP", 0x8961}, ++{"linux/sockios.h", "SIOCSRARP", 0x8962}, ++{"linux/sockios.h", "SIOCGIFMAP", 0x8970}, ++{"linux/sockios.h", "SIOCSIFMAP", 0x8971}, ++{"linux/sockios.h", "SIOCADDDLCI", 0x8980}, ++{"linux/sockios.h", "SIOCDELDLCI", 0x8981}, ++{"linux/sockios.h", "SIOCGIFVLAN", 0x8982}, ++{"linux/sockios.h", "SIOCSIFVLAN", 0x8983}, ++{"linux/sockios.h", "SIOCBONDENSLAVE", 0x8990}, ++{"linux/sockios.h", "SIOCBONDRELEASE", 0x8991}, ++{"linux/sockios.h", "SIOCBONDSETHWADDR", 0x8992}, ++{"linux/sockios.h", "SIOCBONDSLAVEINFOQUERY", 0x8993}, ++{"linux/sockios.h", "SIOCBONDINFOQUERY", 0x8994}, ++{"linux/sockios.h", "SIOCBONDCHANGEACTIVE", 0x8995}, ++{"linux/sockios.h", "SIOCBRADDBR", 0x89a0}, ++{"linux/sockios.h", "SIOCBRDELBR", 0x89a1}, ++{"linux/sockios.h", "SIOCBRADDIF", 0x89a2}, ++{"linux/sockios.h", "SIOCBRDELIF", 0x89a3}, ++{"linux/sockios.h", "SIOCPROTOPRIVATE", 0x89e0}, ++{"linux/sockios.h", "SIOCDEVPRIVATE", 0x89f0}, ++{"linux/auto_fs.h", "AUTOFS_IOC_READY", 0x9360}, ++{"linux/auto_fs.h", "AUTOFS_IOC_FAIL", 0x9361}, ++{"linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", 0x9362}, ++{"linux/nbd.h", "NBD_SET_SOCK", 0xab00}, ++{"linux/nbd.h", "NBD_SET_BLKSIZE", 0xab01}, ++{"linux/nbd.h", "NBD_SET_SIZE", 0xab02}, ++{"linux/nbd.h", "NBD_DO_IT", 0xab03}, ++{"linux/nbd.h", "NBD_CLEAR_SOCK", 0xab04}, ++{"linux/nbd.h", "NBD_CLEAR_QUE", 0xab05}, ++{"linux/nbd.h", "NBD_PRINT_DEBUG", 0xab06}, ++{"linux/nbd.h", "NBD_SET_SIZE_BLOCKS", 0xab07}, ++{"linux/nbd.h", "NBD_DISCONNECT", 0xab08}, ++{"linux/raw.h", "RAW_SETBIND", 0xac00}, ++{"linux/raw.h", "RAW_GETBIND", 0xac01}, ++{"linux/if_pppox.h", "PPPOEIOCDFWD", 0xb101}, ++{"linux/cyclades.h", "CYGETMON", 0x435901}, ++{"linux/cyclades.h", "CYGETTHRESH", 0x435902}, ++{"linux/cyclades.h", "CYSETTHRESH", 0x435903}, ++{"linux/cyclades.h", "CYGETDEFTHRESH", 0x435904}, ++{"linux/cyclades.h", "CYSETDEFTHRESH", 0x435905}, ++{"linux/cyclades.h", "CYGETTIMEOUT", 0x435906}, ++{"linux/cyclades.h", "CYSETTIMEOUT", 0x435907}, ++{"linux/cyclades.h", "CYGETDEFTIMEOUT", 0x435908}, ++{"linux/cyclades.h", "CYSETDEFTIMEOUT", 0x435909}, ++{"linux/cyclades.h", "CYSETRFLOW", 0x43590a}, ++{"linux/cyclades.h", "CYGETRFLOW", 0x43590b}, ++{"linux/cyclades.h", "CYSETRTSDTR_INV", 0x43590c}, ++{"linux/cyclades.h", "CYGETRTSDTR_INV", 0x43590d}, ++{"linux/cyclades.h", "CYZSETPOLLCYCLE", 0x43590e}, ++{"linux/cyclades.h", "CYZGETPOLLCYCLE", 0x43590f}, ++{"linux/cyclades.h", "CYGETCD1400VER", 0x435910}, ++{"linux/cyclades.h", "CYGETCARDINFO", 0x435911}, ++{"linux/cyclades.h", "CYSETWAIT", 0x435912}, ++{"linux/cyclades.h", "CYGETWAIT", 0x435913}, ++{"linux/videodev2.h", "VIDIOC_S_PRIORITY", 0x40015644}, ++{"linux/ppdev.h", "PPWCONTROL", 0x40017084}, ++{"linux/ppdev.h", "PPWDATA", 0x40017086}, ++{"linux/ppdev.h", "PPWCTLONIRQ", 0x40017092}, ++{"linux/telephony.h", "PHONE_MAXRINGS", 0x40017185}, ++{"linux/telephony.h", "PHONE_PLAY_TONE", 0x4001719b}, ++{"linux/sonypi.h", "SONYPI_IOCSBRT", 0x40017600}, ++{"linux/sonypi.h", "SONYPI_IOCSBLUE", 0x40017609}, ++{"linux/sonypi.h", "SONYPI_IOCSFAN", 0x4001760b}, ++{"linux/atmdev.h", "ATM_SETBACKEND", 0x400261f2}, ++{"linux/atmdev.h", "ATM_NEWBACKENDIF", 0x400261f3}, ++{"linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", 0x40026e02}, ++{"linux/ppdev.h", "PPFCONTROL", 0x4002708e}, ++{"linux/telephony.h", "PHONE_RING_CADENCE", 0x40027186}, ++{"linux/fs.h", "BLKBSZSET", 0x40041271}, ++{"linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", 0x40044004}, ++{"linux/agpgart.h", "AGPIOC_SETUP", 0x40044103}, ++{"linux/agpgart.h", "AGPIOC_RESERVE", 0x40044104}, ++{"linux/agpgart.h", "AGPIOC_PROTECT", 0x40044105}, ++{"linux/agpgart.h", "AGPIOC_DEALLOCATE", 0x40044107}, ++{"linux/agpgart.h", "AGPIOC_BIND", 0x40044108}, ++{"linux/agpgart.h", "AGPIOC_UNBIND", 0x40044109}, ++{"linux/pmu.h", "PMU_IOC_SET_BACKLIGHT", 0x40044202}, ++{"linux/cciss_ioctl.h", "CCISS_REGNEWDISK", 0x4004420d}, ++{"linux/input.h", "EVIOCRMFF", 0x40044581}, ++{"linux/input.h", "EVIOCGRAB", 0x40044590}, ++{"linux/matroxfb.h", "FBIO_WAITFORVSYNC", 0x40044620}, ++{"linux/hiddev.h", "HIDIOCSFLAG", 0x4004480f}, ++{"mtd/mtd-abi.h", "OTPGETREGIONCOUNT", 0x40044d0e}, ++{"linux/ticable.h", "IOCTL_TIUSB_TIMEOUT", 0x40044e20}, ++{"linux/ticable.h", "IOCTL_TIUSB_RESET_DEVICE", 0x40044e21}, ++{"linux/ticable.h", "IOCTL_TIUSB_RESET_PIPES", 0x40044e22}, ++{"linux/random.h", "RNDADDTOENTCNT", 0x40045201}, ++{"asm/ioctls.h", "TIOCSPTLCK", 0x40045431}, ++{"linux/if_tun.h", "TUNSETNOCSUM", 0x400454c8}, ++{"linux/if_tun.h", "TUNSETDEBUG", 0x400454c9}, ++{"linux/if_tun.h", "TUNSETIFF", 0x400454ca}, ++{"linux/if_tun.h", "TUNSETPERSIST", 0x400454cb}, ++{"linux/if_tun.h", "TUNSETOWNER", 0x400454cc}, ++{"linux/if_tun.h", "TUNSETLINK", 0x400454cd}, ++{"linux/uinput.h", "UI_SET_EVBIT", 0x40045564}, ++{"linux/uinput.h", "UI_SET_KEYBIT", 0x40045565}, ++{"linux/uinput.h", "UI_SET_RELBIT", 0x40045566}, ++{"linux/uinput.h", "UI_SET_ABSBIT", 0x40045567}, ++{"linux/uinput.h", "UI_SET_MSCBIT", 0x40045568}, ++{"linux/uinput.h", "UI_SET_LEDBIT", 0x40045569}, ++{"linux/uinput.h", "UI_SET_SNDBIT", 0x4004556a}, ++{"linux/uinput.h", "UI_SET_FFBIT", 0x4004556b}, ++{"linux/uinput.h", "UI_SET_PHYS", 0x4004556c}, ++{"linux/uinput.h", "UI_SET_SWBIT", 0x4004556d}, ++{"linux/videodev2.h", "VIDIOC_OVERLAY", 0x4004560e}, ++{"linux/videodev2.h", "VIDIOC_STREAMON", 0x40045612}, ++{"linux/videodev2.h", "VIDIOC_STREAMOFF", 0x40045613}, ++{"linux/atmdev.h", "ATM_SETSC", 0x400461f1}, ++{"linux/atmdev.h", "ATM_DROPPARTY", 0x400461f5}, ++{"linux/cm4000_cs.h", "CM_IOCSPTS", 0x40046302}, ++{"linux/chio.h", "CHIOSPICKER", 0x40046305}, ++{"linux/cm4000_cs.h", "CM_IOSDBGLVL", 0x400463fa}, ++{"linux/video_decoder.h", "DECODER_SET_NORM", 0x40046403}, ++{"linux/video_decoder.h", "DECODER_SET_INPUT", 0x40046404}, ++{"linux/video_decoder.h", "DECODER_SET_OUTPUT", 0x40046405}, ++{"linux/video_decoder.h", "DECODER_ENABLE_OUTPUT", 0x40046406}, ++{"linux/video_decoder.h", "DECODER_SET_GPIO", 0x40046408}, ++{"linux/video_decoder.h", "DECODER_SET_VBI_BYPASS", 0x4004640a}, ++{"linux/video_encoder.h", "ENCODER_SET_NORM", 0x40046502}, ++{"linux/video_encoder.h", "ENCODER_SET_INPUT", 0x40046503}, ++{"linux/video_encoder.h", "ENCODER_SET_OUTPUT", 0x40046504}, ++{"linux/video_encoder.h", "ENCODER_ENABLE_OUTPUT", 0x40046505}, ++{"linux/ext3_fs.h", "EXT3_IOC_SETFLAGS", 0x40046602}, ++{"linux/ext2_fs.h", "EXT2_IOC_SETFLAGS", 0x40046602}, ++{"linux/iflags.h", "IFLAGS_SET_IOC", 0x40046602}, ++{"linux/ext3_fs.h", "EXT3_IOC_SETVERSION", 0x40046604}, ++{"linux/ext3_fs.h", "EXT3_IOC_SETRSVSZ", 0x40046606}, ++{"linux/ext3_fs.h", "EXT3_IOC_GROUP_EXTEND", 0x40046607}, ++{"linux/hpet.h", "HPET_IRQFREQ", 0x40046806}, ++{"linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID2", 0x40046e02}, ++{"linux/ncp_fs.h", "NCP_IOC_SET_SIGN_WANTED", 0x40046e06}, ++{"linux/ncp_fs.h", "NCP_IOC_GETDENTRYTTL", 0x40046e0c}, ++{"linux/matroxfb.h", "MATROXFB_SET_OUTPUT_CONNECTION", 0x40046ef8}, ++{"linux/matroxfb.h", "MATROXFB_SET_OUTPUT_MODE", 0x40046efa}, ++{"linux/rtc.h", "RTC_IRQP_SET", 0x4004700c}, ++{"linux/rtc.h", "RTC_EPOCH_SET", 0x4004700e}, ++{"linux/ppdev.h", "PPSETMODE", 0x40047080}, ++{"linux/ppdev.h", "PPDATADIR", 0x40047090}, ++{"linux/ppdev.h", "PPNEGOT", 0x40047091}, ++{"linux/ppdev.h", "PPSETPHASE", 0x40047094}, ++{"linux/ppdev.h", "PPSETFLAGS", 0x4004709b}, ++{"linux/ticable.h", "IOCTL_TISER_DELAY", 0x400470a0}, ++{"linux/ticable.h", "IOCTL_TISER_TIMEOUT", 0x400470a1}, ++{"linux/ticable.h", "IOCTL_TIPAR_DELAY", 0x400470a8}, ++{"linux/ticable.h", "IOCTL_TIPAR_TIMEOUT", 0x400470a9}, ++{"linux/serio.h", "SPIOCSTYPE", 0x40047101}, ++{"linux/telephony.h", "PHONE_CAPABILITIES_CHECK", 0x40047182}, ++{"linux/telephony.h", "PHONE_RING_START", 0x40047187}, ++{"linux/telephony.h", "PHONE_REC_CODEC", 0x40047189}, ++{"linux/telephony.h", "PHONE_REC_DEPTH", 0x4004718c}, ++{"linux/telephony.h", "PHONE_FRAME", 0x4004718d}, ++{"linux/telephony.h", "PHONE_REC_VOLUME", 0x4004718e}, ++{"linux/telephony.h", "PHONE_PLAY_CODEC", 0x40047190}, ++{"linux/telephony.h", "PHONE_PLAY_DEPTH", 0x40047193}, ++{"linux/telephony.h", "PHONE_PLAY_VOLUME", 0x40047194}, ++{"linux/telephony.h", "PHONE_DTMF_OOB", 0x40047199}, ++{"linux/telephony.h", "PHONE_SET_TONE_ON_TIME", 0x4004719c}, ++{"linux/telephony.h", "PHONE_SET_TONE_OFF_TIME", 0x4004719d}, ++{"linux/telephony.h", "PHONE_PSTN_SET_STATE", 0x400471a4}, ++{"linux/telephony.h", "PHONE_WINK_DURATION", 0x400471a6}, ++{"linux/telephony.h", "PHONE_VAD", 0x400471a9}, ++{"linux/telephony.h", "PHONE_WINK", 0x400471aa}, ++{"linux/ixjuser.h", "IXJCTL_SET_FILTER", 0x400471c7}, ++{"linux/ixjuser.h", "IXJCTL_GET_FILTER_HIST", 0x400471c8}, ++{"linux/ixjuser.h", "IXJCTL_INIT_TONE", 0x400471c9}, ++{"linux/ixjuser.h", "IXJCTL_TONE_CADENCE", 0x400471ca}, ++{"linux/ixjuser.h", "IXJCTL_AEC_START", 0x400471cb}, ++{"linux/ixjuser.h", "IXJCTL_SET_LED", 0x400471ce}, ++{"linux/ixjuser.h", "IXJCTL_MIXER", 0x400471cf}, ++{"linux/ixjuser.h", "IXJCTL_DAA_COEFF_SET", 0x400471d0}, ++{"linux/ixjuser.h", "IXJCTL_PORT", 0x400471d1}, ++{"linux/ixjuser.h", "IXJCTL_DAA_AGAIN", 0x400471d2}, ++{"linux/ixjuser.h", "IXJCTL_POTS_PSTN", 0x400471d5}, ++{"linux/ixjuser.h", "IXJCTL_FILTER_CADENCE", 0x400471d6}, ++{"linux/ixjuser.h", "IXJCTL_CIDCW", 0x400471d9}, ++{"linux/telephony.h", "PHONE_REC_VOLUME_LINEAR", 0x400471db}, ++{"linux/telephony.h", "PHONE_PLAY_VOLUME_LINEAR", 0x400471dc}, ++{"linux/ixjuser.h", "IXJCTL_SET_FILTER_RAW", 0x400471dd}, ++{"linux/ixjuser.h", "IXJCTL_HZ", 0x400471e0}, ++{"linux/ixjuser.h", "IXJCTL_RATE", 0x400471e1}, ++{"linux/ixjuser.h", "IXJCTL_DTMF_PRESCALE", 0x400471e8}, ++{"linux/ixjuser.h", "IXJCTL_SIGCTL", 0x400471e9}, ++{"linux/ixjuser.h", "IXJCTL_SC_RXG", 0x400471ea}, ++{"linux/ixjuser.h", "IXJCTL_SC_TXG", 0x400471eb}, ++{"linux/ixjuser.h", "IXJCTL_INTERCOM_START", 0x400471fd}, ++{"linux/ixjuser.h", "IXJCTL_INTERCOM_STOP", 0x400471fe}, ++{"linux/msdos_fs.h", "FAT_IOCTL_SET_ATTRIBUTES", 0x40047211}, ++{"linux/if_ppp.h", "PPPIOCATTCHAN", 0x40047438}, ++{"linux/if_ppp.h", "PPPIOCCONNECT", 0x4004743a}, ++{"linux/if_ppp.h", "PPPIOCSMRRU", 0x4004743b}, ++{"linux/if_ppp.h", "PPPIOCDETACH", 0x4004743c}, ++{"linux/if_ppp.h", "PPPIOCATTACH", 0x4004743d}, ++{"linux/if_ppp.h", "PPPIOCSDEBUG", 0x40047440}, ++{"linux/if_ppp.h", "PPPIOCSMAXCID", 0x40047451}, ++{"linux/if_ppp.h", "PPPIOCSMRU", 0x40047452}, ++{"linux/if_ppp.h", "PPPIOCSRASYNCMAP", 0x40047454}, ++{"linux/if_ppp.h", "PPPIOCSASYNCMAP", 0x40047457}, ++{"linux/if_ppp.h", "PPPIOCSFLAGS", 0x40047459}, ++{"linux/isdn_ppp.h", "PPPIOCBUNDLE", 0x40047481}, ++{"linux/isdn_ppp.h", "PPPIOCSMPFLAGS", 0x40047483}, ++{"linux/isdn_ppp.h", "PPPIOCSMPMTU", 0x40047484}, ++{"linux/isdn_ppp.h", "PPPIOCSMPMRU", 0x40047485}, ++{"linux/isdn_ppp.h", "PPPIOCSCOMPRESSOR", 0x40047487}, ++{"linux/ext2_fs.h", "EXT2_IOC_SETVERSION", 0x40047602}, ++{"linux/ext3_fs.h", "EXT3_IOC_SETVERSION_OLD", 0x40047602}, ++{"linux/videodev.h", "VIDIOCCAPTURE", 0x40047608}, ++{"linux/videodev.h", "VIDIOCSFREQ", 0x4004760f}, ++{"linux/videodev.h", "VIDIOCSYNC", 0x40047612}, ++{"linux/videodev.h", "VIDIOCSWRITEMODE", 0x40047619}, ++{"linux/meye.h", "MEYEIOC_QBUF_CAPT", 0x400476c2}, ++{"linux/videotext.h", "VTXIOCSETVIRT", 0x4004810c}, ++{"linux/dn.h", "OSIOCSNETADDR", 0x400489e0}, ++{"linux/dn.h", "SIOCSNETADDR", 0x400489e0}, ++{"linux/auto_fs4.h", "AUTOFS_IOC_EXPIRE_MULTI", 0x40049366}, ++{"linux/if_pppox.h", "PPPOEIOCSFWD", 0x4004b100}, ++{"linux/gigaset_dev.h", "GIGASET_BRKCHARS", 0x40064702}, ++{"linux/meye.h", "MEYEIOC_S_PARAMS", 0x400676c1}, ++{"linux/cciss_ioctl.h", "CCISS_SETINTINFO", 0x40084203}, ++{"linux/input.h", "EVIOCSREP", 0x40084503}, ++{"linux/input.h", "EVIOCSKEYCODE", 0x40084504}, ++{"mtd/mtd-abi.h", "MEMERASE", 0x40084d02}, ++{"mtd/mtd-abi.h", "MEMLOCK", 0x40084d05}, ++{"mtd/mtd-abi.h", "MEMUNLOCK", 0x40084d06}, ++{"mtd/mtd-abi.h", "MEMGETBADBLOCK", 0x40084d0b}, ++{"mtd/mtd-abi.h", "MEMSETBADBLOCK", 0x40084d0c}, ++{"linux/random.h", "RNDADDENTROPY", 0x40085203}, ++{"linux/videodev2.h", "VIDIOC_S_STD", 0x40085618}, ++{"linux/videodev2.h", "VIDIOC_S_CTRL_OLD", 0x4008561c}, ++{"linux/atmdev.h", "ATM_GETNAMES", 0x40086183}, ++{"linux/atmdev.h", "ATM_ADDPARTY", 0x400861f4}, ++{"linux/chio.h", "CHIOGSTATUS", 0x40086308}, ++{"linux/video_decoder.h", "DECODER_INIT", 0x40086409}, ++{"linux/mtio.h", "MTIOCTOP", 0x40086d01}, ++{"linux/ppdev.h", "PPSETTIME", 0x40087096}, ++{"linux/if_ppp.h", "PPPIOCSACTIVE", 0x40087446}, ++{"linux/if_ppp.h", "PPPIOCSPASS", 0x40087447}, ++{"linux/if_ppp.h", "PPPIOCSNPMODE", 0x4008744b}, ++{"linux/fd.h", "FDFMTTRK", 0x400c0248}, ++{"linux/capi.h", "CAPI_REGISTER", 0x400c4301}, ++{"linux/hiddev.h", "HIDIOCGREPORT", 0x400c4807}, ++{"linux/hiddev.h", "HIDIOCSREPORT", 0x400c4808}, ++{"mtd/mtd-abi.h", "OTPGETREGIONINFO", 0x400c4d0f}, ++{"linux/uinput.h", "UI_END_FF_ERASE", 0x400c55cb}, ++{"linux/ite_gpio.h", "ITE_GPIO_OUT", 0x400c5a01}, ++{"linux/ite_gpio.h", "ITE_GPIO_INT_CTRL", 0x400c5a02}, ++{"linux/ite_gpio.h", "ITE_GPIO_IN_STATUS", 0x400c5a03}, ++{"linux/ite_gpio.h", "ITE_GPIO_OUT_STATUS", 0x400c5a04}, ++{"linux/ite_gpio.h", "ITE_GPIO_GEN_CTRL", 0x400c5a05}, ++{"linux/ite_gpio.h", "ITE_GPIO_INT_WAIT", 0x400c5a06}, ++{"linux/atm_idt77105.h", "IDT77105_GETSTAT", 0x400c6132}, ++{"linux/atm_idt77105.h", "IDT77105_GETSTATZ", 0x400c6133}, ++{"linux/atmdev.h", "ATM_GETSTAT", 0x400c6150}, ++{"linux/atmdev.h", "ATM_GETSTATZ", 0x400c6151}, ++{"linux/atmdev.h", "ATM_GETLOOP", 0x400c6152}, ++{"linux/atmdev.h", "ATM_SETLOOP", 0x400c6153}, ++{"linux/atmdev.h", "ATM_QUERYLOOP", 0x400c6154}, ++{"linux/atm_eni.h", "ENI_MEMDUMP", 0x400c6160}, ++{"linux/atm_he.h", "HE_GET_REG", 0x400c6160}, ++{"linux/atm_zatm.h", "ZATM_GETPOOL", 0x400c6161}, ++{"linux/atm_zatm.h", "ZATM_GETPOOLZ", 0x400c6162}, ++{"linux/atm_nicstar.h", "NS_SETBUFLEV", 0x400c6162}, ++{"linux/atm_zatm.h", "ZATM_SETPOOL", 0x400c6163}, ++{"linux/atm_eni.h", "ENI_SETMULT", 0x400c6167}, ++{"linux/atmdev.h", "ATM_GETLINKRATE", 0x400c6181}, ++{"linux/atmdev.h", "ATM_GETTYPE", 0x400c6184}, ++{"linux/atmdev.h", "ATM_GETESI", 0x400c6185}, ++{"linux/atmdev.h", "ATM_GETADDR", 0x400c6186}, ++{"linux/atmdev.h", "ATM_RSTADDR", 0x400c6187}, ++{"linux/atmdev.h", "ATM_ADDADDR", 0x400c6188}, ++{"linux/atmdev.h", "ATM_DELADDR", 0x400c6189}, ++{"linux/atmdev.h", "ATM_GETCIRANGE", 0x400c618a}, ++{"linux/atmdev.h", "ATM_SETCIRANGE", 0x400c618b}, ++{"linux/atmdev.h", "ATM_SETESI", 0x400c618c}, ++{"linux/atmdev.h", "ATM_SETESIF", 0x400c618d}, ++{"linux/atmdev.h", "ATM_ADDLECSADDR", 0x400c618e}, ++{"linux/atmdev.h", "ATM_DELLECSADDR", 0x400c618f}, ++{"linux/atmdev.h", "ATM_GETLECSADDR", 0x400c6190}, ++{"linux/chio.h", "CHIOPOSITION", 0x400c6303}, ++{"linux/i2o-dev.h", "I2OEVTREG", 0x400c690a}, ++{"linux/ncp_fs.h", "NCP_IOC_GETROOT", 0x400c6e08}, ++{"linux/if_ppp.h", "PPPIOCSCOMPRESS", 0x400c744d}, ++{"linux/videodev.h", "VIDIOCSPLAYMODE", 0x400c7618}, ++{"linux/video_decoder.h", "DECODER_SET_PICTURE", 0x400e6407}, ++{"linux/videodev.h", "VIDIOCSPICT", 0x400e7607}, ++{"linux/cciss_ioctl.h", "CCISS_SETNODENAME", 0x40104205}, ++{"linux/synclink.h", "MGSL_IOCSGPIO", 0x40106d10}, ++{"linux/videodev.h", "VIDIOCMCAPTURE", 0x40107613}, ++{"linux/fd.h", "FDSETMAXERRS", 0x4014024c}, ++{"linux/videodev2.h", "VIDIOC_S_CROP", 0x4014563c}, ++{"linux/chio.h", "CHIOMOVE", 0x40146301}, ++{"linux/videodev.h", "VIDIOCSFBUF", 0x4014760c}, ++{"linux/videodev.h", "VIDIOCSCAPTURE", 0x40147617}, ++{"linux/hiddev.h", "HIDIOCSUSAGE", 0x4018480c}, ++{"linux/hiddev.h", "HIDIOCGCOLLECTIONINDEX", 0x40184810}, ++{"linux/ext3_fs.h", "EXT3_IOC_GROUP_ADD", 0x40186608}, ++{"linux/videodev.h", "VIDIOCSMICROCODE", 0x4018761b}, ++{"linux/fd.h", "FDSETPRM", 0x401c0242}, ++{"linux/fd.h", "FDDEFPRM", 0x401c0243}, ++{"linux/atmbr2684.h", "BR2684_SETFILT", 0x401c6190}, ++{"linux/chio.h", "CHIOEXCHANGE", 0x401c6302}, ++{"linux/rtc.h", "RTC_PLL_SET", 0x401c7012}, ++{"linux/synclink.h", "MGSL_IOCSPARAMS", 0x40206d00}, ++{"linux/if_ppp.h", "PPPIOCSXASYNCMAP", 0x4020744f}, ++{"linux/videodev.h", "VIDIOCSWIN", 0x4020760a}, ++{"linux/videodev.h", "VIDIOCSVBIFMT", 0x4020761d}, ++{"linux/videotext.h", "VTXIOCCLRPAGE", 0x40208102}, ++{"linux/videotext.h", "VTXIOCCLRFOUND", 0x40208103}, ++{"linux/videotext.h", "VTXIOCPAGEREQ", 0x40208104}, ++{"linux/videotext.h", "VTXIOCGETSTAT", 0x40208105}, ++{"linux/videotext.h", "VTXIOCGETPAGE", 0x40208106}, ++{"linux/videotext.h", "VTXIOCSTOPDAU", 0x40208107}, ++{"linux/joystick.h", "JSIOCSCORR", 0x40246a21}, ++{"linux/rtc.h", "RTC_ALM_SET", 0x40247007}, ++{"linux/rtc.h", "RTC_SET_TIME", 0x4024700a}, ++{"linux/rtc.h", "RTC_WKALM_SET", 0x4028700f}, ++{"linux/smb_fs.h", "SMB_IOC_NEWCONN", 0x40287502}, ++{"linux/videodev.h", "VIDIOCSAUDIO", 0x40287611}, ++{"linux/videodev2.h", "VIDIOC_S_FBUF", 0x402c560b}, ++{"linux/videodev2.h", "VIDIOC_S_FREQUENCY", 0x402c5639}, ++{"linux/chio.h", "CHIOSVOLTAG", 0x40306312}, ++{"linux/videodev.h", "VIDIOCSCHAN", 0x40307603}, ++{"linux/uinput.h", "UI_END_FF_UPLOAD", 0x403455c9}, ++{"linux/videodev2.h", "VIDIOC_S_AUDIO", 0x40345622}, ++{"linux/videodev2.h", "VIDIOC_S_AUDOUT", 0x40345632}, ++{"linux/videodev.h", "VIDIOCSTUNER", 0x40347605}, ++{"linux/joystick.h", "JSIOCSAXMAP", 0x40406a31}, ++{"linux/videodev2.h", "VIDIOC_S_MODULATOR", 0x40445637}, ++{"linux/videodev2.h", "VIDIOC_S_TUNER", 0x4054561e}, ++{"linux/fd.h", "FDSETDRVPRM", 0x40580290}, ++{"linux/chio.h", "CHIOGELEM", 0x406c6310}, ++{"linux/videodev2.h", "VIDIOC_S_JPEGCOMP", 0x408c563e}, ++{"mtd/mtd-abi.h", "MEMSETOOBSEL", 0x40c84d09}, ++{"linux/videodev2.h", "VIDIOC_S_PARM_OLD", 0x40cc5616}, ++{"linux/joystick.h", "JSIOCSBTNMAP", 0x42006a33}, ++{"linux/hiddev.h", "HIDIOCSUSAGES", 0x501c4814}, ++{"linux/videodev2.h", "VIDIOC_G_PRIORITY", 0x80015643}, ++{"linux/joystick.h", "JSIOCGAXES", 0x80016a11}, ++{"linux/joystick.h", "JSIOCGBUTTONS", 0x80016a12}, ++{"linux/ppdev.h", "PPRSTATUS", 0x80017081}, ++{"linux/ppdev.h", "PPRCONTROL", 0x80017083}, ++{"linux/ppdev.h", "PPRDATA", 0x80017085}, ++{"linux/sonypi.h", "SONYPI_IOCGBRT", 0x80017600}, ++{"linux/sonypi.h", "SONYPI_IOCGBATFLAGS", 0x80017607}, ++{"linux/sonypi.h", "SONYPI_IOCGBLUE", 0x80017608}, ++{"linux/sonypi.h", "SONYPI_IOCGFAN", 0x8001760a}, ++{"linux/sonypi.h", "SONYPI_IOCGTEMP", 0x8001760c}, ++{"linux/capi.h", "CAPI_GET_ERRCODE", 0x80024321}, ++{"linux/capi.h", "CAPI_INSTALLED", 0x80024322}, ++{"linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD", 0x8002690e}, ++{"linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", 0x8002690f}, ++{"linux/smb_fs.h", "SMB_IOC_GETMOUNTUID", 0x80027501}, ++{"linux/sonypi.h", "SONYPI_IOCGBAT1CAP", 0x80027602}, ++{"linux/sonypi.h", "SONYPI_IOCGBAT1REM", 0x80027603}, ++{"linux/sonypi.h", "SONYPI_IOCGBAT2CAP", 0x80027604}, ++{"linux/sonypi.h", "SONYPI_IOCGBAT2REM", 0x80027605}, ++{"linux/fs.h", "BLKBSZGET", 0x80041270}, ++{"linux/fs.h", "BLKGETSIZE64", 0x80041272}, ++{"linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", 0x80044003}, ++{"linux/agpgart.h", "AGPIOC_INFO", 0x80044100}, ++{"linux/pmu.h", "PMU_IOC_GET_BACKLIGHT", 0x80044201}, ++{"linux/pmu.h", "PMU_IOC_GET_MODEL", 0x80044203}, ++{"linux/pmu.h", "PMU_IOC_HAS_ADB", 0x80044204}, ++{"linux/pmu.h", "PMU_IOC_CAN_SLEEP", 0x80044205}, ++{"linux/pmu.h", "PMU_IOC_GRAB_BACKLIGHT", 0x80044206}, ++{"linux/cciss_ioctl.h", "CCISS_GETHEARTBEAT", 0x80044206}, ++{"linux/cciss_ioctl.h", "CCISS_GETBUSTYPES", 0x80044207}, ++{"linux/cciss_ioctl.h", "CCISS_GETFIRMVER", 0x80044208}, ++{"linux/cciss_ioctl.h", "CCISS_GETDRIVVER", 0x80044209}, ++{"linux/capi.h", "CAPI_GET_FLAGS", 0x80044323}, ++{"linux/capi.h", "CAPI_SET_FLAGS", 0x80044324}, ++{"linux/capi.h", "CAPI_CLR_FLAGS", 0x80044325}, ++{"linux/capi.h", "CAPI_NCCI_OPENCOUNT", 0x80044326}, ++{"linux/capi.h", "CAPI_NCCI_GETUNIT", 0x80044327}, ++{"linux/input.h", "EVIOCGVERSION", 0x80044501}, ++{"linux/input.h", "EVIOCGEFFECTS", 0x80044584}, ++{"linux/arcfb.h", "FBIO_GETCONTROL2", 0x80044689}, ++{"linux/hiddev.h", "HIDIOCGVERSION", 0x80044801}, ++{"linux/hiddev.h", "HIDIOCGFLAG", 0x8004480e}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_VOLUME", 0x80044d00}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_BASS", 0x80044d01}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_TREBLE", 0x80044d02}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_SYNTH", 0x80044d03}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_PCM", 0x80044d04}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_SPEAKER", 0x80044d05}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_LINE", 0x80044d06}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_MIC", 0x80044d07}, ++{"mtd/mtd-abi.h", "MEMGETREGIONCOUNT", 0x80044d07}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_CD", 0x80044d08}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_IMIX", 0x80044d09}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_ALTPCM", 0x80044d0a}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_RECLEV", 0x80044d0b}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_IGAIN", 0x80044d0c}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_OGAIN", 0x80044d0d}, ++{"mtd/mtd-abi.h", "OTPSELECT", 0x80044d0d}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_LINE1", 0x80044d0e}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_LINE2", 0x80044d0f}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_LINE3", 0x80044d10}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_LOUD", 0x80044d1f}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_ENHANCE", 0x80044d1f}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_MUTE", 0x80044d1f}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_STEREODEVS", 0x80044dfb}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_CAPS", 0x80044dfc}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_RECMASK", 0x80044dfd}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_DEVMASK", 0x80044dfe}, ++{"linux/soundcard.h", "SOUND_MIXER_READ_RECSRC", 0x80044dff}, ++{"linux/ticable.h", "IOCTL_TIUSB_GET_MAXPS", 0x80044e23}, ++{"linux/ticable.h", "IOCTL_TIUSB_GET_DEVID", 0x80044e24}, ++{"linux/random.h", "RNDGETENTCNT", 0x80045200}, ++{"asm/ioctls.h", "TIOCGPTN", 0x80045430}, ++{"linux/videodev2.h", "VIDIOC_G_INPUT", 0x80045626}, ++{"linux/videodev2.h", "VIDIOC_G_OUTPUT", 0x8004562e}, ++{"linux/watchdog.h", "WDIOC_GETSTATUS", 0x80045701}, ++{"linux/watchdog.h", "WDIOC_GETBOOTSTATUS", 0x80045702}, ++{"linux/watchdog.h", "WDIOC_GETTEMP", 0x80045703}, ++{"linux/watchdog.h", "WDIOC_SETOPTIONS", 0x80045704}, ++{"linux/watchdog.h", "WDIOC_KEEPALIVE", 0x80045705}, ++{"linux/watchdog.h", "WDIOC_GETTIMEOUT", 0x80045707}, ++{"linux/watchdog.h", "WDIOC_GETPRETIMEOUT", 0x80045709}, ++{"linux/watchdog.h", "WDIOC_GETTIMELEFT", 0x8004570a}, ++{"linux/sonet.h", "SONET_GETDIAG", 0x80046114}, ++{"linux/sonet.h", "SONET_GETFRAMING", 0x80046116}, ++{"linux/cm4000_cs.h", "CM_IOCGSTATUS", 0x80046300}, ++{"linux/chio.h", "CHIOGPICKER", 0x80046304}, ++{"linux/video_decoder.h", "DECODER_GET_STATUS", 0x80046402}, ++{"linux/iflags.h", "IFLAGS_GET_IOC", 0x80046601}, ++{"linux/ext3_fs.h", "EXT3_IOC_GETFLAGS", 0x80046601}, ++{"linux/ext2_fs.h", "EXT2_IOC_GETFLAGS", 0x80046601}, ++{"linux/ext3_fs.h", "EXT3_IOC_GETVERSION", 0x80046603}, ++{"linux/ext3_fs.h", "EXT3_IOC_GETRSVSZ", 0x80046605}, ++{"linux/ext3_fs.h", "EXT3_IOC_WAIT_FOR_READONLY", 0x80046663}, ++{"linux/i2o-dev.h", "I2OVALIDATE", 0x80046908}, ++{"linux/ipmi.h", "IPMICTL_SET_GETS_EVENTS_CMD", 0x80046910}, ++{"linux/ipmi.h", "IPMICTL_SET_MY_ADDRESS_CMD", 0x80046911}, ++{"linux/ipmi.h", "IPMICTL_GET_MY_ADDRESS_CMD", 0x80046912}, ++{"linux/ipmi.h", "IPMICTL_SET_MY_LUN_CMD", 0x80046913}, ++{"linux/ipmi.h", "IPMICTL_GET_MY_LUN_CMD", 0x80046914}, ++{"linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD", 0x80046918}, ++{"linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD", 0x80046919}, ++{"linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_LUN_CMD", 0x8004691a}, ++{"linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_LUN_CMD", 0x8004691b}, ++{"linux/i8k.h", "I8K_BIOS_VERSION", 0x80046980}, ++{"linux/i8k.h", "I8K_MACHINE_ID", 0x80046981}, ++{"linux/i8k.h", "I8K_POWER_STATUS", 0x80046982}, ++{"linux/i8k.h", "I8K_FN_STATUS", 0x80046983}, ++{"linux/i8k.h", "I8K_GET_TEMP", 0x80046984}, ++{"linux/joystick.h", "JSIOCGVERSION", 0x80046a01}, ++{"linux/udf_fs_i.h", "UDF_GETEASIZE", 0x80046c40}, ++{"linux/udf_fs_i.h", "UDF_GETEABLOCK", 0x80046c41}, ++{"linux/udf_fs_i.h", "UDF_GETVOLIDENT", 0x80046c42}, ++{"linux/mmtimer.h", "MMTIMER_GETRES", 0x80046d01}, ++{"linux/mmtimer.h", "MMTIMER_GETFREQ", 0x80046d02}, ++{"linux/mtio.h", "MTIOCPOS", 0x80046d03}, ++{"linux/mmtimer.h", "MMTIMER_GETCOUNTER", 0x80046d09}, ++{"linux/zftape.h", "MTIOC_ZFTAPE_GETBLKSZ", 0x80046d68}, ++{"linux/ncp_fs.h", "NCP_IOC_SIGN_WANTED", 0x80046e06}, ++{"linux/ncp_fs.h", "NCP_IOC_SETDENTRYTTL", 0x80046e0c}, ++{"linux/matroxfb.h", "MATROXFB_GET_OUTPUT_CONNECTION", 0x80046ef8}, ++{"linux/matroxfb.h", "MATROXFB_GET_AVAILABLE_OUTPUTS", 0x80046ef9}, ++{"linux/matroxfb.h", "MATROXFB_GET_ALL_OUTPUTS", 0x80046efb}, ++{"linux/rtc.h", "RTC_IRQP_READ", 0x8004700b}, ++{"linux/rtc.h", "RTC_EPOCH_READ", 0x8004700d}, ++{"linux/ppdev.h", "PPCLRIRQ", 0x80047093}, ++{"linux/ppdev.h", "PPGETMODES", 0x80047097}, ++{"linux/ppdev.h", "PPGETMODE", 0x80047098}, ++{"linux/ppdev.h", "PPGETPHASE", 0x80047099}, ++{"linux/ppdev.h", "PPGETFLAGS", 0x8004709a}, ++{"linux/telephony.h", "PHONE_CAPABILITIES_LIST", 0x80047181}, ++{"linux/telephony.h", "PHONE_DTMF_READY", 0x80047196}, ++{"linux/telephony.h", "PHONE_GET_DTMF", 0x80047197}, ++{"linux/telephony.h", "PHONE_GET_DTMF_ASCII", 0x80047198}, ++{"linux/telephony.h", "PHONE_EXCEPTION", 0x8004719a}, ++{"linux/ixjuser.h", "IXJCTL_CARDTYPE", 0x800471c1}, ++{"linux/ixjuser.h", "IXJCTL_SERIAL", 0x800471c2}, ++{"linux/ixjuser.h", "IXJCTL_DSP_TYPE", 0x800471c3}, ++{"linux/ixjuser.h", "IXJCTL_DSP_VERSION", 0x800471c4}, ++{"linux/ixjuser.h", "IXJCTL_CID", 0x800471d4}, ++{"linux/ixjuser.h", "IXJCTL_VMWI", 0x800471d8}, ++{"linux/ixjuser.h", "IXJCTL_VERSION", 0x800471da}, ++{"linux/ixjuser.h", "IXJCTL_FRAMES_READ", 0x800471e2}, ++{"linux/ixjuser.h", "IXJCTL_FRAMES_WRITTEN", 0x800471e3}, ++{"linux/ixjuser.h", "IXJCTL_READ_WAIT", 0x800471e4}, ++{"linux/ixjuser.h", "IXJCTL_WRITE_WAIT", 0x800471e5}, ++{"linux/ixjuser.h", "IXJCTL_DRYBUFFER_READ", 0x800471e6}, ++{"linux/msdos_fs.h", "FAT_IOCTL_GET_ATTRIBUTES", 0x80047210}, ++{"linux/if_ppp.h", "PPPIOCGCHAN", 0x80047437}, ++{"linux/if_ppp.h", "PPPIOCGDEBUG", 0x80047441}, ++{"linux/if_ppp.h", "PPPIOCGMRU", 0x80047453}, ++{"linux/if_ppp.h", "PPPIOCGRASYNCMAP", 0x80047455}, ++{"linux/if_ppp.h", "PPPIOCGUNIT", 0x80047456}, ++{"linux/if_ppp.h", "PPPIOCGASYNCMAP", 0x80047458}, ++{"linux/if_ppp.h", "PPPIOCGFLAGS", 0x8004745a}, ++{"linux/isdn_ppp.h", "PPPIOCGMPFLAGS", 0x80047482}, ++{"linux/smb_fs.h", "SMB_IOC_GETMOUNTUID32", 0x80047503}, ++{"linux/ext2_fs.h", "EXT2_IOC_GETVERSION", 0x80047601}, ++{"linux/ext3_fs.h", "EXT3_IOC_GETVERSION_OLD", 0x80047601}, ++{"linux/videodev.h", "VIDIOCGFREQ", 0x8004760e}, ++{"linux/meye.h", "MEYEIOC_STILLJCAPT", 0x800476c5}, ++{"linux/dn.h", "SIOCGNETADDR", 0x800489e1}, ++{"linux/dn.h", "OSIOCGNETADDR", 0x800489e1}, ++{"linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", 0x80049363}, ++{"linux/auto_fs4.h", "AUTOFS_IOC_PROTOSUBVER", 0x80049367}, ++{"linux/auto_fs4.h", "AUTOFS_IOC_ASKREGHOST", 0x80049368}, ++{"linux/auto_fs4.h", "AUTOFS_IOC_TOGGLEREGHOST", 0x80049369}, ++{"linux/auto_fs4.h", "AUTOFS_IOC_ASKUMOUNT", 0x80049370}, ++{"linux/sonet.h", "SONET_GETFRSENSE", 0x80066117}, ++{"linux/meye.h", "MEYEIOC_G_PARAMS", 0x800676c0}, ++{"linux/cciss_ioctl.h", "CCISS_GETPCIINFO", 0x80084201}, ++{"linux/cciss_ioctl.h", "CCISS_GETINTINFO", 0x80084202}, ++{"linux/input.h", "EVIOCGID", 0x80084502}, ++{"linux/input.h", "EVIOCGREP", 0x80084503}, ++{"linux/input.h", "EVIOCGKEYCODE", 0x80084504}, ++{"linux/random.h", "RNDGETPOOL", 0x80085202}, ++{"linux/videodev2.h", "VIDIOC_G_STD", 0x80085617}, ++{"linux/videodev2.h", "VIDIOC_QUERYSTD", 0x8008563f}, ++{"linux/i2o-dev.h", "I2OPASSTHRU", 0x8008690c}, ++{"linux/i2o-dev.h", "I2OPASSTHRU32", 0x8008690c}, ++{"linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", 0x80086916}, ++{"linux/ipmi.h", "IPMICTL_GET_TIMING_PARMS_CMD", 0x80086917}, ++{"linux/mtio.h", "MTIOCGETSIZE", 0x80086d09}, ++{"linux/ncp_fs.h", "NCP_IOC_SETPRIVATEDATA", 0x80086e0a}, ++{"linux/ppdev.h", "PPGETTIME", 0x80087095}, ++{"linux/if_ppp.h", "PPPIOCGIDLE", 0x8008743f}, ++{"linux/cciss_ioctl.h", "CCISS_GETLUNINFO", 0x800c4211}, ++{"mtd/mtd-abi.h", "OTPLOCK", 0x800c4d10}, ++{"linux/video_decoder.h", "DECODER_GET_CAPABILITIES", 0x800c6401}, ++{"linux/video_encoder.h", "ENCODER_GET_CAPABILITIES", 0x800c6501}, ++{"linux/hpet.h", "HPET_INFO", 0x800c6803}, ++{"linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", 0x800c6e01}, ++{"linux/ncp_fs.h", "NCP_IOC_SETROOT", 0x800c6e08}, ++{"linux/ncp_fs.h", "NCP_IOC_SETOBJECTNAME", 0x800c6e09}, ++{"linux/videodev.h", "VIDIOCKEY", 0x800c760d}, ++{"linux/videodev.h", "VIDIOCGPICT", 0x800e7606}, ++{"linux/fd.h", "FDGETDRVTYP", 0x8010020f}, ++{"linux/cciss_ioctl.h", "CCISS_GETNODENAME", 0x80104204}, ++{"mtd/mtd-abi.h", "ECCGETSTATS", 0x80104d12}, ++{"linux/synclink.h", "MGSL_IOCGGPIO", 0x80106d11}, ++{"linux/isdn_ppp.h", "PPPIOCGIFNAME", 0x80107488}, ++{"linux/videotext.h", "VTXIOCGETINFO", 0x80108101}, ++{"linux/fd.h", "FDGETMAXERRS", 0x8014020e}, ++{"linux/chio.h", "CHIOGPARAMS", 0x80146306}, ++{"linux/ipmi.h", "IPMICTL_SEND_COMMAND", 0x8014690d}, ++{"linux/mtio.h", "MTIOCVOLINFO", 0x80146d08}, ++{"linux/ncp_fs.h", "NCP_IOC_LOCKUNLOCK", 0x80146e07}, ++{"linux/videodev.h", "VIDIOCGFBUF", 0x8014760b}, ++{"linux/videodev.h", "VIDIOCGUNIT", 0x80147615}, ++{"linux/videodev.h", "VIDIOCGCAPTURE", 0x80147616}, ++{"linux/fd.h", "FDWERRORGET", 0x80180217}, ++{"linux/ncp_fs.h", "NCP_IOC_SIGN_INIT", 0x80186e05}, ++{"linux/fd.h", "FDGETPRM", 0x801c0204}, ++{"linux/hiddev.h", "HIDIOCGDEVINFO", 0x801c4803}, ++{"linux/ipmi.h", "IPMICTL_SEND_COMMAND_SETTIME", 0x801c6915}, ++{"linux/mtio.h", "MTIOCGET", 0x801c6d02}, ++{"linux/rtc.h", "RTC_PLL_GET", 0x801c7011}, ++{"linux/fd.h", "FDGETFDCSTAT", 0x80200215}, ++{"linux/fb.h", "FBIOGET_VBLANK", 0x80204612}, ++{"mtd/mtd-abi.h", "MEMGETINFO", 0x80204d01}, ++{"linux/i2o-dev.h", "I2OGETIOPS", 0x80206900}, ++{"linux/synclink.h", "MGSL_IOCGPARAMS", 0x80206d01}, ++{"linux/if_ppp.h", "PPPIOCGXASYNCMAP", 0x80207450}, ++{"linux/isdn_ppp.h", "PPPIOCGCOMPRESSORS", 0x80207486}, ++{"linux/videodev.h", "VIDIOCGWIN", 0x80207609}, ++{"linux/videodev.h", "VIDIOCGVBIFMT", 0x8020761c}, ++{"linux/sonet.h", "SONET_GETSTAT", 0x80246110}, ++{"linux/sonet.h", "SONET_GETSTATZ", 0x80246111}, ++{"linux/joystick.h", "JSIOCGCORR", 0x80246a22}, ++{"linux/rtc.h", "RTC_ALM_READ", 0x80247008}, ++{"linux/rtc.h", "RTC_RD_TIME", 0x80247009}, ++{"linux/watchdog.h", "WDIOC_GETSUPPORT", 0x80285700}, ++{"linux/rtc.h", "RTC_WKALM_RD", 0x80287010}, ++{"linux/videodev.h", "VIDIOCGAUDIO", 0x80287610}, ++{"linux/ncp_fs.h", "NCP_IOC_SETCHARSETS", 0x802a6e0b}, ++{"linux/videodev2.h", "VIDIOC_G_FBUF", 0x802c560a}, ++{"linux/videodev2.h", "VIDIOC_CROPCAP_OLD", 0x802c563a}, ++{"linux/fd.h", "FDGETDRVSTAT", 0x80340212}, ++{"linux/fd.h", "FDPOLLDRVSTAT", 0x80340213}, ++{"linux/videodev2.h", "VIDIOC_G_AUDIO", 0x80345621}, ++{"linux/videodev2.h", "VIDIOC_G_AUDOUT", 0x80345631}, ++{"linux/videodev.h", "VIDIOCGCAP", 0x803c7601}, ++{"linux/joystick.h", "JSIOCGAXMAP", 0x80406a32}, ++{"linux/fd.h", "FDGETDRVPRM", 0x80580211}, ++{"linux/videodev2.h", "VIDIOC_QUERYCAP", 0x80685600}, ++{"linux/i2o-dev.h", "I2OEVTGET", 0x8068690b}, ++{"linux/chio.h", "CHIOGVPARAMS", 0x80706313}, ++{"linux/videodev2.h", "VIDIOC_G_SLICED_VBI_CAP", 0x80745645}, ++{"linux/videodev.h", "VIDIOCGMBUF", 0x80887614}, ++{"linux/videodev2.h", "VIDIOC_G_JPEGCOMP", 0x808c563d}, ++{"mtd/mtd-abi.h", "MEMGETOOBSEL", 0x80c84d0a}, ++{"linux/hiddev.h", "HIDIOCGSTRING", 0x81044804}, ++{"linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", 0x810c9365}, ++{"linux/videodev.h", "VIDIOCGPLAYINFO", 0x8118761a}, ++{"mtd/mtd-abi.h", "ECCGETLAYOUT", 0x81484d11}, ++{"linux/joystick.h", "JSIOCGBTNMAP", 0x82006a34}, ++{"linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", 0x82187201}, ++{"linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", 0x82187202}, ++{"linux/agpgart.h", "AGPIOC_ALLOCATE", 0xc0044106}, ++{"linux/capi.h", "CAPI_GET_MANUFACTURER", 0xc0044306}, ++{"linux/capi.h", "CAPI_GET_SERIAL", 0xc0044308}, ++{"linux/gigaset_dev.h", "GIGASET_REDIR", 0xc0044700}, ++{"linux/gigaset_dev.h", "GIGASET_CONFIG", 0xc0044701}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_VOLUME", 0xc0044d00}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_BASS", 0xc0044d01}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_TREBLE", 0xc0044d02}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_SYNTH", 0xc0044d03}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_PCM", 0xc0044d04}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_SPEAKER", 0xc0044d05}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE", 0xc0044d06}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_MIC", 0xc0044d07}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_CD", 0xc0044d08}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_IMIX", 0xc0044d09}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_ALTPCM", 0xc0044d0a}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_RECLEV", 0xc0044d0b}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_IGAIN", 0xc0044d0c}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_OGAIN", 0xc0044d0d}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE1", 0xc0044d0e}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE2", 0xc0044d0f}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE3", 0xc0044d10}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_ENHANCE", 0xc0044d1f}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_LOUD", 0xc0044d1f}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_MUTE", 0xc0044d1f}, ++{"linux/soundcard.h", "SOUND_MIXER_WRITE_RECSRC", 0xc0044dff}, ++{"linux/videodev2.h", "VIDIOC_OVERLAY_OLD", 0xc004560e}, ++{"linux/videodev2.h", "VIDIOC_S_INPUT", 0xc0045627}, ++{"linux/videodev2.h", "VIDIOC_S_OUTPUT", 0xc004562f}, ++{"linux/watchdog.h", "WDIOC_SETTIMEOUT", 0xc0045706}, ++{"linux/watchdog.h", "WDIOC_SETPRETIMEOUT", 0xc0045708}, ++{"linux/sonet.h", "SONET_SETDIAG", 0xc0046112}, ++{"linux/sonet.h", "SONET_CLRDIAG", 0xc0046113}, ++{"linux/cm4000_cs.h", "CM_IOCGATR", 0xc0046301}, ++{"linux/coda.h", "CIOC_KERNEL_VERSION", 0xc004630a}, ++{"linux/i8k.h", "I8K_GET_SPEED", 0xc0046985}, ++{"linux/i8k.h", "I8K_GET_FAN", 0xc0046986}, ++{"linux/i8k.h", "I8K_SET_FAN", 0xc0046987}, ++{"linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", 0xc0046c43}, ++{"linux/synclink.h", "MGSL_IOCWAITEVENT", 0xc0046d08}, ++{"linux/matroxfb.h", "MATROXFB_GET_OUTPUT_MODE", 0xc0046efa}, ++{"linux/telephony.h", "PHONE_QUERY_CODEC", 0xc00471a7}, ++{"linux/if_ppp.h", "PPPIOCNEWUNIT", 0xc004743e}, ++{"linux/toshiba.h", "TOSH_SMM", 0xc0047490}, ++{"linux/meye.h", "MEYEIOC_SYNC", 0xc00476c3}, ++{"linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", 0xc0049364}, ++{"linux/capi.h", "CAPI_MANUFACTURER_CMD", 0xc0084320}, ++{"linux/videodev2.h", "VIDIOC_G_CTRL", 0xc008561b}, ++{"linux/videodev2.h", "VIDIOC_S_CTRL", 0xc008561c}, ++{"linux/ncp_fs.h", "NCP_IOC_GETPRIVATEDATA", 0xc0086e0a}, ++{"linux/if_ppp.h", "PPPIOCGNPMODE", 0xc008744c}, ++{"linux/hiddev.h", "HIDIOCGREPORTINFO", 0xc00c4809}, ++{"mtd/mtd-abi.h", "MEMWRITEOOB", 0xc00c4d03}, ++{"mtd/mtd-abi.h", "MEMREADOOB", 0xc00c4d04}, ++{"linux/uinput.h", "UI_BEGIN_FF_ERASE", 0xc00c55ca}, ++{"linux/ite_gpio.h", "ITE_GPIO_IN", 0xc00c5a00}, ++{"linux/atm_nicstar.h", "NS_GETPSTAT", 0xc00c6161}, ++{"linux/i2o-dev.h", "I2OHRTGET", 0xc00c6901}, ++{"linux/i2o-dev.h", "I2OLCTGET", 0xc00c6902}, ++{"linux/mtio.h", "MTIOCFTFORMAT", 0xc00c6d0a}, ++{"linux/ncp_fs.h", "NCP_IOC_GETOBJECTNAME", 0xc00c6e09}, ++{"linux/capi.h", "CAPI_GET_VERSION", 0xc0104307}, ++{"linux/gigaset_dev.h", "GIGASET_VERSION", 0xc0104703}, ++{"linux/hiddev.h", "HIDIOCGCOLLECTIONINFO", 0xc0104811}, ++{"mtd/mtd-abi.h", "MEMGETREGIONINFO", 0xc0104d08}, ++{"linux/videodev2.h", "VIDIOC_REQBUFS", 0xc0105608}, ++{"linux/mtio.h", "MTIOCRDFTSEG", 0xc0106d06}, ++{"linux/mtio.h", "MTIOCWRFTSEG", 0xc0106d07}, ++{"linux/synclink.h", "MGSL_IOCWAITGPIO", 0xc0106d12}, ++{"linux/videodev2.h", "VIDIOC_G_CROP", 0xc014563b}, ++{"linux/hiddev.h", "HIDIOCGUSAGE", 0xc018480b}, ++{"linux/hiddev.h", "HIDIOCGUCODE", 0xc018480d}, ++{"linux/videodev2.h", "VIDIOC_G_EXT_CTRLS", 0xc0185647}, ++{"linux/videodev2.h", "VIDIOC_S_EXT_CTRLS", 0xc0185648}, ++{"linux/videodev2.h", "VIDIOC_TRY_EXT_CTRLS", 0xc0185649}, ++{"linux/pktcdvd.h", "PACKET_CTRL_CMD", 0xc0185801}, ++{"linux/i2o-dev.h", "I2OPARMSET", 0xc0186903}, ++{"linux/i2o-dev.h", "I2OPARMGET", 0xc0186904}, ++{"linux/ipmi.h", "IPMICTL_RECEIVE_MSG_TRUNC", 0xc018690b}, ++{"linux/ipmi.h", "IPMICTL_RECEIVE_MSG", 0xc018690c}, ++{"linux/i2o-dev.h", "I2OSWDL", 0xc01c6905}, ++{"linux/i2o-dev.h", "I2OSWUL", 0xc01c6906}, ++{"linux/i2o-dev.h", "I2OSWDEL", 0xc01c6907}, ++{"linux/i2o-dev.h", "I2OHTML", 0xc01c6909}, ++{"linux/mtio.h", "MTIOCFTCMD", 0xc0206d0b}, ++{"linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO_V2", 0xc0246e04}, ++{"linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", 0xc0286e04}, ++{"linux/ncp_fs.h", "NCP_IOC_GETCHARSETS", 0xc02a6e0b}, ++{"linux/videodev2.h", "VIDIOC_QUERYMENU", 0xc02c5625}, ++{"linux/videodev2.h", "VIDIOC_G_FREQUENCY", 0xc02c5638}, ++{"linux/videodev2.h", "VIDIOC_CROPCAP", 0xc02c563a}, ++{"linux/videodev.h", "VIDIOCGCHAN", 0xc0307602}, ++{"linux/uinput.h", "UI_BEGIN_FF_UPLOAD", 0xc03455c8}, ++{"linux/videodev2.h", "VIDIOC_G_AUDIO_OLD", 0xc0345621}, ++{"linux/videodev2.h", "VIDIOC_G_AUDOUT_OLD", 0xc0345631}, ++{"linux/videodev2.h", "VIDIOC_ENUMAUDIO", 0xc0345641}, ++{"linux/videodev2.h", "VIDIOC_ENUMAUDOUT", 0xc0345642}, ++{"linux/videodev.h", "VIDIOCGTUNER", 0xc0347604}, ++{"linux/hiddev.h", "HIDIOCGFIELDINFO", 0xc038480a}, ++{"linux/capi.h", "CAPI_GET_PROFILE", 0xc0404309}, ++{"linux/videodev2.h", "VIDIOC_ENUM_FMT", 0xc0405602}, ++{"linux/videodev2.h", "VIDIOC_ENUMSTD", 0xc0405619}, ++{"linux/videodev2.h", "VIDIOC_QUERYBUF", 0xc0445609}, ++{"linux/videodev2.h", "VIDIOC_QBUF", 0xc044560f}, ++{"linux/videodev2.h", "VIDIOC_DQBUF", 0xc0445611}, ++{"linux/videodev2.h", "VIDIOC_QUERYCTRL", 0xc0445624}, ++{"linux/videodev2.h", "VIDIOC_G_MODULATOR", 0xc0445636}, ++{"linux/fb.h", "FBIO_CURSOR", 0xc0484608}, ++{"linux/videodev2.h", "VIDIOC_ENUMOUTPUT", 0xc0485630}, ++{"linux/videodev2.h", "VIDIOC_ENUMINPUT", 0xc04c561a}, ++{"linux/cciss_ioctl.h", "CCISS_PASSTHRU", 0xc054420b}, ++{"linux/videodev2.h", "VIDIOC_G_TUNER", 0xc054561d}, ++{"linux/cciss_ioctl.h", "CCISS_BIG_PASSTHRU", 0xc0584212}, ++{"linux/isdn_ppp.h", "PPPIOCGCALLINFO", 0xc0887480}, ++{"linux/videodev2.h", "VIDIOC_G_FMT", 0xc0cc5604}, ++{"linux/videodev2.h", "VIDIOC_S_FMT", 0xc0cc5605}, ++{"linux/videodev2.h", "VIDIOC_G_PARM", 0xc0cc5615}, ++{"linux/videodev2.h", "VIDIOC_S_PARM", 0xc0cc5616}, ++{"linux/videodev2.h", "VIDIOC_TRY_FMT", 0xc0cc5640}, ++{"linux/dm-ioctl.h", "DM_VERSION", 0xc134fd00}, ++{"linux/dm-ioctl.h", "DM_VERSION_32", 0xc134fd00}, ++{"linux/dm-ioctl.h", "DM_REMOVE_ALL_32", 0xc134fd01}, ++{"linux/dm-ioctl.h", "DM_REMOVE_ALL", 0xc134fd01}, ++{"linux/dm-ioctl.h", "DM_LIST_DEVICES_32", 0xc134fd02}, ++{"linux/dm-ioctl.h", "DM_LIST_DEVICES", 0xc134fd02}, ++{"linux/dm-ioctl.h", "DM_DEV_CREATE_32", 0xc134fd03}, ++{"linux/dm-ioctl.h", "DM_DEV_CREATE", 0xc134fd03}, ++{"linux/dm-ioctl.h", "DM_DEV_REMOVE", 0xc134fd04}, ++{"linux/dm-ioctl.h", "DM_DEV_REMOVE_32", 0xc134fd04}, ++{"linux/dm-ioctl.h", "DM_DEV_RENAME_32", 0xc134fd05}, ++{"linux/dm-ioctl.h", "DM_DEV_RENAME", 0xc134fd05}, ++{"linux/dm-ioctl.h", "DM_DEV_SUSPEND_32", 0xc134fd06}, ++{"linux/dm-ioctl.h", "DM_DEV_SUSPEND", 0xc134fd06}, ++{"linux/dm-ioctl.h", "DM_DEV_STATUS", 0xc134fd07}, ++{"linux/dm-ioctl.h", "DM_DEV_STATUS_32", 0xc134fd07}, ++{"linux/dm-ioctl.h", "DM_DEV_WAIT", 0xc134fd08}, ++{"linux/dm-ioctl.h", "DM_DEV_WAIT_32", 0xc134fd08}, ++{"linux/dm-ioctl.h", "DM_TABLE_LOAD", 0xc134fd09}, ++{"linux/dm-ioctl.h", "DM_TABLE_LOAD_32", 0xc134fd09}, ++{"linux/dm-ioctl.h", "DM_TABLE_CLEAR_32", 0xc134fd0a}, ++{"linux/dm-ioctl.h", "DM_TABLE_CLEAR", 0xc134fd0a}, ++{"linux/dm-ioctl.h", "DM_TABLE_DEPS_32", 0xc134fd0b}, ++{"linux/dm-ioctl.h", "DM_TABLE_DEPS", 0xc134fd0b}, ++{"linux/dm-ioctl.h", "DM_TABLE_STATUS", 0xc134fd0c}, ++{"linux/dm-ioctl.h", "DM_TABLE_STATUS_32", 0xc134fd0c}, ++{"linux/dm-ioctl.h", "DM_LIST_VERSIONS", 0xc134fd0d}, ++{"linux/dm-ioctl.h", "DM_LIST_VERSIONS_32", 0xc134fd0d}, ++{"linux/dm-ioctl.h", "DM_TARGET_MSG", 0xc134fd0e}, ++{"linux/dm-ioctl.h", "DM_TARGET_MSG_32", 0xc134fd0e}, ++{"linux/dm-ioctl.h", "DM_DEV_SET_GEOMETRY_32", 0xc134fd0f}, ++{"linux/dm-ioctl.h", "DM_DEV_SET_GEOMETRY", 0xc134fd0f}, ++{"linux/hiddev.h", "HIDIOCGUSAGES", 0xd01c4813}, +Index: strace-4.5.16/linux/avr32/ioctlent.sh +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-4.5.16/linux/avr32/ioctlent.sh 2008-05-11 15:36:30.000000000 +0200 +@@ -0,0 +1,124 @@ ++#!/bin/sh ++# Copyright (c) 1993, 1994, 1995 Rick Sladkey ++# All rights reserved. ++# ++# Copyright (c) 1995, 1996 Michael Elizabeth Chastain ++# All rights reserved. ++# ++# Redistribution and use in source and binary forms, with or without ++# modification, are permitted provided that the following conditions ++# are met: ++# 1. Redistributions of source code must retain the above copyright ++# notice, this list of conditions and the following disclaimer. ++# 2. Redistributions in binary form must reproduce the above copyright ++# notice, this list of conditions and the following disclaimer in the ++# documentation and/or other materials provided with the distribution. ++# 3. The name of the author may not be used to endorse or promote products ++# derived from this software without specific prior written permission. ++# ++# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ ++# Files to find. ++file_find='asm/*.h linux/*.h scsi/*.h mtd/*.h' ++ ++# Files to stop. ++file_stop='asm/byteorder.h linux/config.h linux/elf-em.h linux/pci_ids.h linux/xd.h linux/reiserfs_fs.h linux/usbdevice_fs.h' ++ ++# Defs to find. ++# Work on the kernel source to convert all to df_iowr. ++# Don't know how to find low-numbered ioctls in linux/mc146818rtc.h. ++df_name='^[ ]*#[ ]*define[ ]+[A-Z_][A-Z0-9_]*[ ]+' ++df_iowr='_IO|_IOR|_IOW|_IOWR' ++df_NNNN='0[Xx](03|06|22|46|4B|4C|53|54|56|89|90)[0-9A-Fa-f][0-9A-Fa-f]' ++df_4359='0[Xx]4359[0-9A-Fa-f][0-9A-Fa-f]' # linux/cyclades.h ++df_470N='470[0-9]' # linux/fs.h (only in 1.2.13) ++df_smix='MIXER_READ|MIXER_WRITE' # linux/soundcard.h ++df_12NN='12[3-4][0-9]' # linux/umsdos_fs.h (only in 1.2.13) ++df_tail='([() ]|$)' ++def_find="$df_name($df_iowr|$df_NNNN|$df_4359|$df_470N|$df_smix|$df_12NN)$df_tail" ++ ++# Defs to stop. ++ds_tail='_MAGIC|_PATCH' ++ds_fdmp='FD(DEF|GET|SET)MEDIAPRM' # linux/fd.h aliases (only in 1.2.13) ++ds_mtio='MTIOC(GET|SET)CONFIG' # linux/mtio.h needs config (only in 1.2.13) ++ds_soundcard='_SIO(RW?|W)?' ++def_stop="$ds_tail|$ds_fdmp|$ds_mtio|$ds_soundcard" ++ ++# Validate arg count. ++if [ $# -ne 1 ] ++then ++ echo "usage: $0 include-directory" >&2 ++ exit 1 ++fi ++ ++# Grep through the files. ++( ++ # Construct list: find files minus stop files. ++ cd $1 || exit ++ file_list=`(ls $file_find $file_stop $file_stop 2>/dev/null) | sort | uniq -u` ++ ++ # Grep matching #define lines. ++ # Transform to C structure form. ++ # Filter out stop list. ++ egrep "$def_find" $file_list | ++ sed -n -e 's/^\(.*\):#[ ]*define[ ]*\([A-Z_][A-Z0-9_]*\).*$/ { "\1", "\2", \2 },/p' | ++ egrep -v "$def_stop" ++) > ioctlent.tmp ++ ++# Generate the output file. ++echo '/* This file is automatically generated by ioctlent.sh */' ++echo ++echo '#include ' ++echo '#include ' ++echo '#include ' ++echo ++echo '/* Needed for */' ++echo '#define BAYCOM_DEBUG' ++echo ++echo '/* Needed for */' ++echo '#define CONFIG_COMPAT' ++echo ++echo '/* Needed for */' ++echo '#define CONFIG_JBD_DEBUG' ++echo ++echo '/* Needed for */' ++echo '#define LP_STATS' ++echo ++echo '/* Needed for */' ++echo '#define __OLD_VIDIOC_' ++echo ++echo '/* Needed for */' ++echo '#define ZFT_OBSOLETE' ++echo ++echo '/* Needed for */' ++echo '#include ' ++echo ++echo '/* Needed for */' ++echo '#include ' ++#echo '#include ' ++echo ++echo '/* Needed for */' ++echo '#include ' ++echo '#include ' ++echo ++echo '/* Needed for */' ++echo '#include ' ++echo ++awk '{ print "#include <" substr($2, 2, length($2) - 3) ">" }' ioctlent.tmp | sort -u ++echo ++echo 'struct ioctlent ioctlent [] =' ++echo '{' ++cat ioctlent.tmp ++echo '};' ++ ++# Clean up. ++rm -f ioctlent.tmp +Index: strace-4.5.16/linux/avr32/syscallent.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-4.5.16/linux/avr32/syscallent.h 2008-05-11 15:36:30.000000000 +0200 +@@ -0,0 +1,307 @@ ++/* ++ * Copyright (c) 2004-2006 Atmel Corporation ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ * $Id$ ++ */ ++ ++ { 0, 0, sys_setup, "setup" }, /* 0 */ ++ { 1, TP, sys_exit, "_exit" }, /* 1 */ ++ { 0, TP, sys_fork, "fork" }, /* 2 */ ++ { 3, 0, sys_read, "read" }, /* 3 */ ++ { 3, 0, sys_write, "write" }, /* 4 */ ++ { 3, TF, sys_open, "open" }, /* 5 */ ++ { 1, 0, sys_close, "close" }, /* 6 */ ++ { 1, 0, sys_umask, "umask" }, /* 7 */ ++ { 2, TF, sys_creat, "creat" }, /* 8 */ ++ { 2, TF, sys_link, "link" }, /* 9 */ ++ { 1, TF, sys_unlink, "unlink" }, /* 10 */ ++ { 3, TF|TP, sys_execve, "execve" }, /* 11 */ ++ { 1, TF, sys_chdir, "chdir" }, /* 12 */ ++ { 1, 0, sys_time, "time" }, /* 13 */ ++ { 3, TF, sys_mknod, "mknod" }, /* 14 */ ++ { 2, TF, sys_chmod, "chmod" }, /* 15 */ ++ { 3, TF, sys_chown, "chown" }, /* 16 */ ++ { 3, TF, sys_chown, "lchown" }, /* 17 */ ++ { 3, 0, sys_lseek, "lseek" }, /* 18 */ ++ { 5, 0, sys_llseek, "_llseek" }, /* 19 */ ++ { 0, 0, sys_getpid, "getpid" }, /* 20 */ ++ { 5, TF, sys_mount, "mount" }, /* 21 */ ++ { 2, TF, sys_umount, "umount" }, /* 22 */ ++ { 1, 0, sys_setuid, "setuid" }, /* 23 */ ++ { 0, 0, sys_getuid, "getuid" }, /* 24 */ ++ { 1, 0, sys_stime, "stime" }, /* 25 */ ++ { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ ++ { 1, 0, sys_alarm, "alarm" }, /* 27 */ ++ { 0, TS, sys_pause, "pause" }, /* 28 */ ++ { 2, TF, sys_utime, "utime" }, /* 29 */ ++ { 2, TF, sys_stat, "stat" }, /* 30 */ ++ { 2, 0, sys_fstat, "fstat" }, /* 31 */ ++ { 2, TF, sys_lstat, "lstat" }, /* 32 */ ++ { 2, TF, sys_access, "access" }, /* 33 */ ++ { 1, TF, sys_chroot, "chroot" }, /* 34 */ ++ { 0, 0, sys_sync, "sync" }, /* 35 */ ++ { 1, 0, sys_fsync, "fsync" }, /* 36 */ ++ { 2, TS, sys_kill, "kill" }, /* 37 */ ++ { 2, TF, sys_rename, "rename" }, /* 38 */ ++ { 2, TF, sys_mkdir, "mkdir" }, /* 39 */ ++ { 1, TF, sys_rmdir, "rmdir" }, /* 40 */ ++ { 1, 0, sys_dup, "dup" }, /* 41 */ ++ { 1, 0, sys_pipe, "pipe" }, /* 42 */ ++ { 1, 0, sys_times, "times" }, /* 43 */ ++ { 5, TP, sys_clone, "clone" }, /* 44 */ ++ { 1, 0, sys_brk, "brk" }, /* 45 */ ++ { 1, 0, sys_setgid, "setgid" }, /* 46 */ ++ { 0, 0, sys_getgid, "getgid" }, /* 47 */ ++ { 2, TF, sys_getcwd, "getcwd" }, /* 48 */ ++ { 0, 0, sys_geteuid, "geteuid" }, /* 49 */ ++ { 0, 0, sys_getegid, "getegid" }, /* 50 */ ++ { 1, TF, sys_acct, "acct" }, /* 51 */ ++ { 1, 0, sys_setfsuid, "setfsuid" }, /* 52 */ ++ { 1, 0, sys_setfsgid, "setfsgid" }, /* 53 */ ++ { 3, 0, sys_ioctl, "ioctl" }, /* 54 */ ++ { 3, 0, sys_fcntl, "fcntl" }, /* 55 */ ++ { 2, 0, sys_setpgid, "setpgid" }, /* 56 */ ++ { 4, 0, sys_mremap, "mremap" }, /* 57 */ ++ { 3, 0, sys_setresuid, "setresuid" }, /* 58 */ ++ { 3, 0, sys_getresuid, "getresuid" }, /* 59 */ ++ { 2, 0, sys_setreuid, "setreuid" }, /* 60 */ ++ { 2, 0, sys_setregid, "setregid" }, /* 61 */ ++ { 2, 0, sys_ustat, "ustat" }, /* 62 */ ++ { 2, 0, sys_dup2, "dup2" }, /* 63 */ ++ { 0, 0, sys_getppid, "getppid" }, /* 64 */ ++ { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */ ++ { 0, 0, sys_setsid, "setsid" }, /* 66 */ ++ { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 67 */ ++ { 1, TS, printargs, "rt_sigreturn" }, /* 68 */ ++ { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 69 */ ++ { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 70 */ ++ { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 71 */ ++ { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 72 */ ++ { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 73 */ ++ { 2, 0, sys_sethostname, "sethostname" }, /* 74 */ ++ { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */ ++ { 2, 0, sys_getrlimit, "old_getrlimit" }, /* 76 */ ++ { 2, 0, sys_getrusage, "getrusage" }, /* 77 */ ++ { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */ ++ { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */ ++ { 2, 0, sys_getgroups, "getgroups" }, /* 80 */ ++ { 2, 0, sys_setgroups, "setgroups" }, /* 81 */ ++ { 5, 0, sys_select, "select" }, /* 82 */ ++ { 2, TF, sys_symlink, "symlink" }, /* 83 */ ++ { 1, 0, sys_fchdir, "fchdir" }, /* 84 */ ++ { 3, TF, sys_readlink, "readlink" }, /* 85 */ ++ { 5, TF, sys_pread, "pread" }, /* 86 */ ++ { 5, TF, sys_pwrite, "pwrite" }, /* 87 */ ++ { 1, TF, sys_swapon, "swapon" }, /* 88 */ ++ { 3, 0, sys_reboot, "reboot" }, /* 89 */ ++ { 6, 0, sys_mmap, "mmap" }, /* 90 */ ++ { 2, 0, sys_munmap, "munmap" }, /* 91 */ ++ { 2, TF, sys_truncate, "truncate" }, /* 92 */ ++ { 2, 0, sys_ftruncate, "ftruncate" }, /* 93 */ ++ { 2, 0, sys_fchmod, "fchmod" }, /* 94 */ ++ { 3, 0, sys_fchown, "fchown" }, /* 95 */ ++ { 2, 0, sys_getpriority, "getpriority" }, /* 96 */ ++ { 3, 0, sys_setpriority, "setpriority" }, /* 97 */ ++ { 4, TP, sys_wait4, "wait4" }, /* 98 */ ++ { 2, TF, sys_statfs, "statfs" }, /* 99 */ ++ { 2, 0, sys_fstatfs, "fstatfs" }, /* 100 */ ++ { 0, 0, sys_vhangup, "vhangup" }, /* 101 */ ++ { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 102 */ ++ { 3, 0, sys_syslog, "syslog" }, /* 103 */ ++ { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ ++ { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ ++ { 1, 0, sys_swapoff, "swapoff" }, /* 106 */ ++ { 1, 0, sys_sysinfo, "sysinfo" }, /* 107 */ ++ { 6, 0, sys_ipc, "ipc" }, /* 108 */ ++ { 4, TF, sys_sendfile, "sendfile" }, /* 109 */ ++ { 2, 0, sys_setdomainname, "setdomainname" }, /* 110 */ ++ { 1, 0, sys_uname, "uname" }, /* 111 */ ++ { 1, 0, sys_adjtimex, "adjtimex" }, /* 112 */ ++ { 3, 0, sys_mprotect, "mprotect" }, /* 113 */ ++ { 0, TP, sys_vfork, "vfork" }, /* 114 */ ++ { 2, 0, sys_init_module, "init_module" }, /* 115 */ ++ { 1, 0, sys_delete_module, "delete_module" }, /* 116 */ ++ { 4, 0, sys_quotactl, "quotactl" }, /* 117 */ ++ { 1, 0, sys_getpgid, "getpgid" }, /* 118 */ ++ { 0, 0, sys_bdflush, "bdflush" }, /* 119 */ ++ { 3, 0, sys_sysfs, "sysfs" }, /* 120 */ ++ { 1, 0, sys_personality, "personality" }, /* 121 */ ++ { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 122 */ ++ { 3, 0, sys_getdents, "getdents" }, /* 123 */ ++ { 2, 0, sys_flock, "flock" }, /* 124 */ ++ { 3, 0, sys_msync, "msync" }, /* 125 */ ++ { 3, 0, sys_readv, "readv" }, /* 126 */ ++ { 3, 0, sys_writev, "writev" }, /* 127 */ ++ { 1, 0, sys_getsid, "getsid" }, /* 128 */ ++ { 1, 0, sys_fdatasync, "fdatasync" }, /* 129 */ ++ { 1, 0, sys_sysctl, "_sysctl" }, /* 130 */ ++ { 2, 0, sys_mlock, "mlock" }, /* 131 */ ++ { 2, 0, sys_munlock, "munlock" }, /* 132 */ ++ { 2, 0, sys_mlockall, "mlockall" }, /* 133 */ ++ { 0, 0, sys_munlockall, "munlockall" }, /* 134 */ ++ { 0, 0, sys_sched_setparam, "sched_setparam"}, /* 135 */ ++ { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 136 */ ++ { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 137 */ ++ { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 138 */ ++ { 0, 0, sys_sched_yield, "sched_yield"}, /* 139 */ ++ { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 140 */ ++ { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 141 */ ++ { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 142 */ ++ { 2, 0, sys_nanosleep, "nanosleep" }, /* 143 */ ++ { 3, 0, sys_poll, "poll" }, /* 144 */ ++ { 3, 0, printargs, "nfsservctl" }, /* 145 */ ++ { 3, 0, sys_setresgid, "setresgid" }, /* 146 */ ++ { 3, 0, sys_getresgid, "getresgid" }, /* 147 */ ++ { 5, 0, sys_prctl, "prctl" }, /* 148 */ ++ { 3, TN, sys_socket, "socket" }, /* 149 */ ++ { 3, TN, sys_bind, "bind" }, /* 150 */ ++ { 3, TN, sys_connect, "connect" }, /* 151 */ ++ { 2, TN, sys_listen, "listen" }, /* 152 */ ++ { 3, TN, sys_accept, "accept" }, /* 153 */ ++ { 3, TN, sys_getsockname, "getsockname" }, /* 154 */ ++ { 3, TN, sys_getpeername, "getpeername" }, /* 155 */ ++ { 4, TN, sys_socketpair, "socketpair" }, /* 156 */ ++ { 4, TN, sys_send, "send" }, /* 157 */ ++ { 4, TN, sys_recv, "recv" }, /* 158 */ ++ { 6, TN, sys_sendto, "sendto" }, /* 159 */ ++ { 6, TN, sys_recvfrom, "recvfrom" }, /* 160 */ ++ { 2, TN, sys_shutdown, "shutdown" }, /* 161 */ ++ { 5, TN, sys_setsockopt, "setsockopt" }, /* 162 */ ++ { 5, TN, sys_getsockopt, "getsockopt" }, /* 163 */ ++ { 3, TN, sys_sendmsg, "sendmsg" }, /* 164 */ ++ { 3, TN, sys_recvmsg, "recvmsg" }, /* 165 */ ++ { 3, TF, sys_truncate64, "truncate64" }, /* 166 */ ++ { 3, TF, sys_ftruncate64, "ftruncate64" }, /* 167 */ ++ { 2, TF, sys_stat64, "stat64" }, /* 168 */ ++ { 2, TF, sys_lstat64, "lstat64" }, /* 169 */ ++ { 2, TF, sys_fstat64, "fstat64" }, /* 170 */ ++ { 2, TF, sys_pivotroot, "pivot_root" }, /* 171 */ ++ { 3, 0, printargs, "mincore" }, /* 172 */ ++ { 3, 0, sys_madvise, "madvise" }, /* 173 */ ++ { 4, 0, sys_getdents64, "getdents64" }, /* 174 */ ++ { 3, 0, sys_fcntl, "fcntl64" }, /* 175 */ ++ { 0, 0, printargs, "gettid" }, /* 176 */ ++ { 4, 0, sys_readahead, "readahead" }, /* 177 */ ++ { 5, TF, sys_setxattr, "setxattr" }, /* 178 */ ++ { 5, TF, sys_setxattr, "lsetxattr" }, /* 179 */ ++ { 5, 0, sys_fsetxattr, "fsetxattr" }, /* 180 */ ++ { 4, TF, sys_getxattr, "getxattr" }, /* 181 */ ++ { 4, TF, sys_getxattr, "lgetxattr" }, /* 182 */ ++ { 4, 0, sys_fgetxattr, "fgetxattr" }, /* 183 */ ++ { 3, TF, sys_listxattr, "listxattr" }, /* 184 */ ++ { 3, TF, sys_listxattr, "llistxattr" }, /* 185 */ ++ { 3, 0, sys_flistxattr, "flistxattr" }, /* 186 */ ++ { 2, TF, sys_removexattr, "removexattr" }, /* 187 */ ++ { 2, TF, sys_removexattr, "lremovexattr" }, /* 188 */ ++ { 2, 0, sys_fremovexattr, "fremovexattr" }, /* 189 */ ++ { 2, TS, sys_kill, "tkill" }, /* 190 */ ++ { 4, TF, sys_sendfile64, "sendfile64" }, /* 191 */ ++ { 5, 0, sys_futex, "futex" }, /* 192 */ ++ { 3, 0, sys_sched_setaffinity, "sched_setaffinity" },/* 193 */ ++ { 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 194 */ ++ { 2, 0, sys_capget, "capget" }, /* 195 */ ++ { 2, 0, sys_capset, "capset" }, /* 196 */ ++ { 2, 0, sys_io_setup, "io_setup" }, /* 197 */ ++ { 1, 0, sys_io_destroy, "io_destroy" }, /* 198 */ ++ { 5, 0, sys_io_getevents, "io_getevents" }, /* 199 */ ++ { 3, 0, sys_io_submit, "io_submit" }, /* 200 */ ++ { 3, 0, sys_io_cancel, "io_cancel" }, /* 201 */ ++ { 6, 0, sys_fadvise64, "fadvise64" }, /* 202 */ ++ { 1, TP, sys_exit, "exit_group" }, /* 203 */ ++ { 4, 0, printargs, "lookup_dcookie"}, /* 204 */ ++ { 1, 0, sys_epoll_create, "epoll_create" }, /* 205 */ ++ { 4, 0, sys_epoll_ctl, "epoll_ctl" }, /* 206 */ ++ { 4, 0, sys_epoll_wait, "epoll_wait" }, /* 207 */ ++ { 5, 0, sys_remap_file_pages, "remap_file_pages"}, /* 208 */ ++ { 1, 0, printargs, "set_tid_address"}, /* 209 */ ++ { 3, 0, sys_timer_create, "timer_create" }, /* 210 */ ++ { 4, 0, sys_timer_settime, "timer_settime" }, /* 211 */ ++ { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 212 */ ++ { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 213 */ ++ { 1, 0, sys_timer_delete, "timer_delete" }, /* 214 */ ++ { 2, 0, sys_clock_settime, "clock_settime" }, /* 215 */ ++ { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 216 */ ++ { 2, 0, sys_clock_getres, "clock_getres" }, /* 217 */ ++ { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 218 */ ++ { 3, TF, sys_statfs64, "statfs64" }, /* 219 */ ++ { 3, 0, sys_fstatfs64, "fstatfs64" }, /* 220 */ ++ { 3, TS, sys_tgkill, "tgkill" }, /* 221 */ ++ { 5, 0, printargs, "SYS_222" }, /* 222 */ ++ { 2, TF, sys_utimes, "utimes" }, /* 223 */ ++ { 6, 0, sys_fadvise64_64, "fadvise64_64" }, /* 224 */ ++ { 3, 0, printargs, "cacheflush" }, /* 225 */ ++ { 0, 0, printargs, "vserver" }, /* 226 */ ++ { 4, 0, sys_mq_open, "mq_open" }, /* 227 */ ++ { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 228 */ ++ { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 229 */ ++ { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 230 */ ++ { 2, 0, sys_mq_notify, "mq_notify" }, /* 231 */ ++ { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 232 */ ++ { 4, 0, printargs, "kexec_load" }, /* 233 */ ++ { 1, 0, sys_waitid, "waitid" }, /* 234 */ ++ { 5, 0, printargs, "add_key" }, /* 235 */ ++ { 4, 0, printargs, "request_key" }, /* 236 */ ++ { 5, 0, printargs, "keyctl" }, /* 237 */ ++ { 3, 0, printargs, "ioprio_set" }, /* 238 */ ++ { 2, 0, printargs, "ioprio_get" }, /* 239 */ ++ { 1, 0, printargs, "inotify_init" }, /* 240 */ ++ { 3, 0, sys_inotify_add_watch, "inotify_add_watch" }, /* 241 */ ++ { 2, 0, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 242 */ ++ { 4, 0, sys_openat, "openat" }, /* 243 */ ++ { 3, 0, sys_mkdirat, "mkdirat" }, /* 244 */ ++ { 4, 0, sys_mknodat, "mknodat" }, /* 245 */ ++ { 5, 0, sys_fchownat, "fchownat" }, /* 246 */ ++ { 3, 0, sys_futimesat, "futimesat" }, /* 247 */ ++ { 4, 0, printargs, "fstatat64" }, /* 248 */ ++ { 3, 0, sys_unlinkat, "unlinkat" }, /* 249 */ ++ { 4, 0, sys_renameat, "renameat" }, /* 250 */ ++ { 5, 0, sys_linkat, "linkat" }, /* 251 */ ++ { 3, 0, sys_symlinkat, "symlinkat" }, /* 252 */ ++ { 4, 0, sys_readlinkat, "readlinkat" }, /* 253 */ ++ { 3, 0, sys_fchmodat, "fchmodat" }, /* 254 */ ++ { 3, 0, sys_faccessat, "faccessat" }, /* 255 */ ++ { 6, 0, sys_pselect6, "pselect6" }, /* 256 */ ++ { 5, 0, sys_ppoll, "ppoll" }, /* 257 */ ++ { 1, 0, sys_unshare, "unshare" }, /* 258 */ ++ { 2, 0, printargs, "set_robust_list" }, /* 259 */ ++ { 3, 0, printargs, "get_robust_list" }, /* 260 */ ++ { 6, 0, printargs, "splice" }, /* 261 */ ++ { 4, 0, printargs, "sync_file_range" }, /* 262 */ ++ { 4, 0, printargs, "tee" }, /* 263 */ ++ { 4, 0, printargs, "vmsplice" }, /* 264 */ ++ { 6, 0, printargs, "sys_epoll_pwait" }, /* 265 */ ++ { 2, TI, sys_msgget, "msgget" }, /* 266 */ ++ { 4, TI, sys_msgsnd, "msgsnd" }, /* 267 */ ++ { 5, TI, sys_msgrcv, "msgrcv" }, /* 268 */ ++ { 3, TI, sys_msgctl, "msgctl" }, /* 269 */ ++ { 3, TI, sys_semget, "semget" }, /* 270 */ ++ { 3, TI, sys_semop, "semop" }, /* 271 */ ++ { 4, TI, sys_semctl, "semctl" }, /* 272 */ ++ { 4, TI, sys_semtimedop, "semtimedop" }, /* 273 */ ++ { 3, TI, sys_shmat, "shmat" }, /* 274 */ ++ { 3, TI, sys_shmget, "shmget" }, /* 275 */ ++ { 1, TI, sys_shmdt, "shmdt" }, /* 276 */ ++ { 3, TI, sys_shmctl, "shmctl" }, /* 277 */ +Index: strace-4.5.16/Makefile.am +=================================================================== +--- strace-4.5.16.orig/Makefile.am 2007-07-03 04:07:28.000000000 +0200 ++++ strace-4.5.16/Makefile.am 2008-05-11 15:36:30.000000000 +0200 +@@ -29,6 +29,7 @@ + linux/alpha/errnoent.h linux/alpha/ioctlent.h \ + linux/alpha/signalent.h linux/alpha/syscallent.h \ + linux/arm/syscallent.h \ ++ linux/avr32/syscallent.h \ + linux/hppa/errnoent.h linux/hppa/ioctlent.h \ + linux/hppa/signalent.h linux/hppa/syscallent.h \ + linux/ia64/syscallent.h linux/ia64/errnoent.h \ +Index: strace-4.5.16/Makefile.in +=================================================================== +--- strace-4.5.16.orig/Makefile.in 2007-08-03 12:24:40.000000000 +0200 ++++ strace-4.5.16/Makefile.in 2008-05-11 15:36:30.000000000 +0200 +@@ -217,6 +217,7 @@ + linux/alpha/errnoent.h linux/alpha/ioctlent.h \ + linux/alpha/signalent.h linux/alpha/syscallent.h \ + linux/arm/syscallent.h \ ++ linux/avr32/syscallent.h \ + linux/hppa/errnoent.h linux/hppa/ioctlent.h \ + linux/hppa/signalent.h linux/hppa/syscallent.h \ + linux/ia64/syscallent.h linux/ia64/errnoent.h \ +Index: strace-4.5.16/process.c +=================================================================== +--- strace-4.5.16.orig/process.c 2007-08-02 04:13:05.000000000 +0200 ++++ strace-4.5.16/process.c 2008-05-11 15:36:30.000000000 +0200 +@@ -714,6 +714,10 @@ + return -1; + + return 0; ++#elif defined(AVR32) ++ if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_R8), new) < 0) ++ return -1; ++ return 0; + #else + #warning Do not know how to handle change_syscall for this architecture + #endif /* architecture */ +@@ -794,6 +798,28 @@ + if (errno) + return -1; + } ++#elif defined(AVR32) ++ { ++ errno = 0; ++ if (argnum == 0) ++ ptrace(PTRACE_POKEUSER, tcp->pid, ++ (char *)(REG_R12_ORIG), ++ tcp->u_arg[argnum]); ++ else if (argnum < 4) ++ /* r11 .. r9 */ ++ ptrace(PTRACE_POKEUSER, tcp->pid, ++ (char *)(REG_R12 - 4 * argnum), ++ tcp->u_arg[argnum]); ++ else if (argnum < 6) ++ /* r6 .. r5 */ ++ ptrace(PTRACE_POKEUSER, tcp->pid, ++ (char *)(REG_R10 - 4 * argnum), ++ tcp->u_arg[argnum]); ++ else ++ return -E2BIG; ++ if (errno) ++ return -1; ++ } + #else + # warning Sorry, setargs not implemented for this architecture. + #endif +@@ -2888,8 +2914,27 @@ + { uoff(regs.ARM_pc), "pc" }, + { uoff(regs.ARM_cpsr), "cpsr" }, + #endif +- +-#if !defined(S390) && !defined(S390X) && !defined(MIPS) && !defined(SPARC64) ++#ifdef AVR32 ++ { uoff(regs.sr), "sr" }, ++ { uoff(regs.pc), "pc" }, ++ { uoff(regs.lr), "lr" }, ++ { uoff(regs.sp), "sp" }, ++ { uoff(regs.r12), "r12" }, ++ { uoff(regs.r11), "r11" }, ++ { uoff(regs.r10), "r10" }, ++ { uoff(regs.r9), "r9" }, ++ { uoff(regs.r8), "r8" }, ++ { uoff(regs.r7), "r7" }, ++ { uoff(regs.r6), "r6" }, ++ { uoff(regs.r5), "r5" }, ++ { uoff(regs.r4), "r4" }, ++ { uoff(regs.r3), "r3" }, ++ { uoff(regs.r2), "r2" }, ++ { uoff(regs.r1), "r1" }, ++ { uoff(regs.r0), "r0" }, ++ { uoff(regs.r12_orig), "orig_r12" }, ++#endif ++#if !defined(S390) && !defined(S390X) && !defined(MIPS) && !defined(SPARC64) && !defined(AVR32) + { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" }, + #endif + #if defined(I386) || defined(X86_64) +@@ -2905,20 +2950,20 @@ + #if !defined(SPARC64) + { uoff(start_code), "offsetof(struct user, start_code)" }, + #endif +-#ifdef SH64 ++#if defined(SH64) || defined(AVR32) + { uoff(start_data), "offsetof(struct user, start_data)" }, + #endif + #if !defined(SPARC64) + { uoff(start_stack), "offsetof(struct user, start_stack)" }, + #endif + { uoff(signal), "offsetof(struct user, signal)" }, +-#if !defined(S390) && !defined(S390X) && !defined(MIPS) && !defined(SH) && !defined(SH64) && !defined(SPARC64) ++#if !defined(S390) && !defined(S390X) && !defined(MIPS) && !defined(SH) && !defined(SH64) && !defined(SPARC64) && !defined(AVR32) + { uoff(reserved), "offsetof(struct user, reserved)" }, + #endif + #if !defined(SPARC64) + { uoff(u_ar0), "offsetof(struct user, u_ar0)" }, + #endif +-#if !defined(ARM) && !defined(MIPS) && !defined(S390) && !defined(S390X) && !defined(SPARC64) ++#if !defined(ARM) && !defined(MIPS) && !defined(S390) && !defined(S390X) && !defined(SPARC64) && !defined(AVR32) + { uoff(u_fpstate), "offsetof(struct user, u_fpstate)" }, + #endif + { uoff(magic), "offsetof(struct user, magic)" }, +Index: strace-4.5.16/syscall.c +=================================================================== +--- strace-4.5.16.orig/syscall.c 2008-05-11 15:36:09.000000000 +0200 ++++ strace-4.5.16/syscall.c 2008-05-11 15:36:30.000000000 +0200 +@@ -809,6 +809,8 @@ + static long r9; + #elif defined(X86_64) + static long rax; ++#elif defined(AVR32) ++ static struct pt_regs regs; + #endif + #endif /* LINUX */ + #ifdef FREEBSD +@@ -1273,7 +1275,26 @@ + return 0; + } + } +-#endif /* SH64 */ ++#elif defined(AVR32) ++ /* ++ * Read complete register set in one go. ++ */ ++ if (ptrace(PTRACE_GETREGS, pid, NULL, ®s) < 0) ++ return -1; ++ ++ /* ++ * We only need to grab the syscall number on syscall entry. ++ */ ++ if (!(tcp->flags & TCB_INSYSCALL)) { ++ scno = regs.r8; ++ ++ /* Check if we return from execve. */ ++ if (tcp->flags & TCB_WAITEXECVE) { ++ tcp->flags &= ~TCB_WAITEXECVE; ++ return 0; ++ } ++ } ++#endif /* AVR32 */ + #endif /* LINUX */ + #ifdef SUNOS4 + if (upeek(pid, uoff(u_arg[7]), &scno) < 0) +@@ -1632,6 +1653,17 @@ + tcp->u_rval = r9; + u_error = 0; + } ++#else ++#ifdef AVR32 ++ if (regs.r12 && (unsigned) -regs.r12 < nerrnos) { ++ tcp->u_rval = -1; ++ u_error = -regs.r12; ++ } ++ else { ++ tcp->u_rval = regs.r12; ++ u_error = 0; ++ } ++#endif /* AVR32 */ + #endif /* SH64 */ + #endif /* SH */ + #endif /* HPPA */ +@@ -1857,6 +1889,12 @@ + r9 = error ? -error : rval; + if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)REG_GENERAL(9), r9) < 0) + return -1; ++#else ++#ifdef AVR32 ++ regs.r12 = error ? -error : rval; ++ if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)REG_R12, regs.r12) < 0) ++ return -1; ++#endif /* AVR32 */ + #endif /* SH64 */ + #endif /* SH */ + #endif /* HPPA */ +@@ -2129,6 +2167,14 @@ + return -1; + } + } ++#elif defined(AVR32) ++ tcp->u_nargs = sysent[tcp->scno].nargs; ++ tcp->u_arg[0] = regs.r12; ++ tcp->u_arg[1] = regs.r11; ++ tcp->u_arg[2] = regs.r10; ++ tcp->u_arg[3] = regs.r9; ++ tcp->u_arg[4] = regs.r5; ++ tcp->u_arg[5] = regs.r3; + #else /* Other architecture (like i386) (32bits specific) */ + { + int i; +@@ -2391,7 +2437,7 @@ + + switch (known_scno(tcp)) { + #ifdef LINUX +-#if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA) ++#if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA) && !defined(AVR32) + #ifdef __NR_socketcall + case SYS_socketcall: + decode_subcall(tcp, SYS_socket_subcall, +@@ -2404,7 +2450,7 @@ + SYS_ipc_nsubcalls, shift_style); + break; + #endif +-#endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */ ++#endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA && !AVR32 */ + #if defined (SPARC) || defined (SPARC64) + case SYS_socketcall: + sparc_socket_decode (tcp); +Index: strace-4.5.16/util.c +=================================================================== +--- strace-4.5.16.orig/util.c 2007-08-02 04:22:06.000000000 +0200 ++++ strace-4.5.16/util.c 2008-05-11 15:36:30.000000000 +0200 +@@ -1076,6 +1076,9 @@ + #elif defined(SH64) + if (upeek(tcp->pid, REG_PC ,&pc) < 0) + return -1; ++#elif defined(AVR32) ++ if (upeek(tcp->pid, REG_PC, &pc) < 0) ++ return -1; + #endif + return pc; + #endif /* LINUX */ +@@ -1224,6 +1227,14 @@ + return; + } + tprintf("[%08lx] ", pc); ++#elif defined(AVR32) ++ long pc; ++ ++ if (upeek(tcp->pid, REG_PC, &pc) < 0) { ++ tprintf("[????????] "); ++ return; ++ } ++ tprintf("[%08lx] ", pc); + #endif /* !architecture */ + #endif /* LINUX */ + +@@ -1405,6 +1416,9 @@ + # define arg0_offset (REG_OFFSET+16) + # define arg1_offset (REG_OFFSET+24) + # define restore_arg0(tcp, state, val) 0 ++# elif defined (AVR32) ++# define arg0_offset (REG_R12) ++# define arg1_offset (REG_R11) + # else + # define arg0_offset 0 + # define arg1_offset 4 diff --git a/utils/strace/patches-4.5.16/004-mips64_support.patch b/utils/strace/patches-4.5.16/004-mips64_support.patch new file mode 100644 index 0000000..f582054 --- /dev/null +++ b/utils/strace/patches-4.5.16/004-mips64_support.patch @@ -0,0 +1,3342 @@ +2007-08-26 Daniel Jacobowitz + + * defs.h: Include . + (MAX_QUALS): Update for MIPS. + (LINUX_MIPSO32, LINUX_MIPSN32, LINUX_MIPSN64, LINUX_MIPS64): Define. + (struct tcb): Add ext_arg for MIPS N32. + (TCB_WAITEXECVE): Define for MIPS. + (ALIGN64): Use LINUX_MIPSO32. + * file.c (sys_lseek): Use ext_arg for MIPS N32. + (sys_readahead, sys_fadvise64_64): Likewise. + * io.c (sys_pread64, sys_pwrite64): Likewise. + * mem.c (print_mmap): Take OFFSET argument. + (sys_old_mmap): Update call to print_mmap. + (sys_mmap): Use ext_arg for MIPS N32. + * process.c (struct_user_offsets): Add MIPS registers. + * signal.c (sys_sigreturn): Handle MIPS N32 and MIPS N64. Correct + MIPS O32 call to sprintsigmask. + * syscall.c (internal_syscall): Handle MIPS N32. Check for + TCB_WAITEXECVE on MIPS. + (force_result): Add a comment about MIPS N32. + (syscall_enter): Handle MIPS N32 and MIPS N64. + * linux/syscall.h (sys_pread64, sys_pwrite64): Declare. + * linux/mips/syscallent.h: Include "dummy.h". Handle alternate + MIPS ABIs. + +Index: defs.h +=================================================================== +RCS file: /cvsroot/strace/strace/defs.h,v +retrieving revision 1.75 +diff -u -p -r1.75 defs.h +--- strace/defs.h 24 Jul 2007 01:57:11 -0000 1.75 ++++ strace/defs.h 26 Aug 2007 19:13:45 -0000 +@@ -33,6 +33,10 @@ + #include "config.h" + #endif + ++#ifdef MIPS ++#include ++#endif ++ + #ifdef linux + #include + #endif +@@ -47,7 +51,7 @@ + /* configuration section */ + #ifndef MAX_QUALS + #if defined(LINUX) && defined(MIPS) +-#define MAX_QUALS 5000 /* maximum number of syscalls, signals, etc. */ ++#define MAX_QUALS 7000 /* maximum number of syscalls, signals, etc. */ + #else + #define MAX_QUALS 2048 /* maximum number of syscalls, signals, etc. */ + #endif +@@ -97,6 +101,17 @@ + # if defined(AVR32) + # define LINUX_AVR32 + # endif ++# if defined(MIPS) && _MIPS_SIM == _MIPS_SIM_ABI32 ++# define LINUX_MIPSO32 ++# endif ++# if defined(MIPS) && _MIPS_SIM == _MIPS_SIM_NABI32 ++# define LINUX_MIPSN32 ++# define LINUX_MIPS64 ++# endif ++# if defined(MIPS) && _MIPS_SIM == _MIPS_SIM_ABI64 ++# define LINUX_MIPSN64 ++# define LINUX_MIPS64 ++# endif + #endif + + #if defined(SVR4) || defined(FREEBSD) +@@ -277,6 +292,9 @@ struct tcb { + long scno; /* System call number */ + int u_nargs; /* System call arguments */ + long u_arg[MAX_ARGS]; /* System call arguments */ ++#if defined (LINUX_MIPSN32) ++ long long ext_arg[MAX_ARGS]; /* System call arguments */ ++#endif + int u_error; /* Error code */ + long u_rval; /* (first) return value */ + #ifdef HAVE_LONG_LONG +@@ -330,7 +348,7 @@ struct tcb { + #define TCB_FOLLOWFORK 00400 /* Process should have forks followed */ + #define TCB_REPRINT 01000 /* We should reprint this syscall on exit */ + #ifdef LINUX +-# if defined(ALPHA) || defined(SPARC) || defined(SPARC64) || defined(POWERPC) || defined(IA64) || defined(HPPA) || defined(SH) || defined(SH64) || defined(S390) || defined(S390X) || defined(ARM) || defined(AVR32) ++# if defined(ALPHA) || defined(SPARC) || defined(SPARC64) || defined(POWERPC) || defined(IA64) || defined(HPPA) || defined(SH) || defined(SH64) || defined(S390) || defined(S390X) || defined(ARM) || defined(MIPS) + # define TCB_WAITEXECVE 02000 /* ignore SIGTRAP after exceve */ + # endif + # define TCB_CLONE_DETACHED 04000 /* CLONE_DETACHED set in creating syscall */ +@@ -594,7 +612,7 @@ extern const int nsignals2; + + #if defined(FREEBSD) || (defined(LINUX) \ + && defined(POWERPC) && !defined(__powerpc64__)) \ +- || (defined (LINUX) && defined (MIPS) && !defined(__mips64)) ++ || defined (LINUX_MIPSO32) + /* ARRGH! off_t args are aligned on 64 bit boundaries! */ + #define ALIGN64(tcp,arg) \ + do { \ +Index: file.c +=================================================================== +RCS file: /cvsroot/strace/strace/file.c,v +retrieving revision 1.87 +diff -u -p -r1.87 file.c +--- strace/file.c 7 Aug 2007 01:22:49 -0000 1.87 ++++ strace/file.c 26 Aug 2007 19:13:46 -0000 +@@ -494,6 +494,27 @@ static const struct xlat whence[] = { + }; + + #ifndef HAVE_LONG_LONG_OFF_T ++#if defined (LINUX_MIPSN32) ++int ++sys_lseek(tcp) ++struct tcb *tcp; ++{ ++ long long offset; ++ int _whence; ++ ++ if (entering(tcp)) { ++ tprintf("%ld, ", tcp->u_arg[0]); ++ offset = tcp->ext_arg[1]; ++ _whence = tcp->u_arg[2]; ++ if (_whence == SEEK_SET) ++ tprintf("%llu, ", offset); ++ else ++ tprintf("%lld, ", offset); ++ printxval(whence, _whence, "SEEK_???"); ++ } ++ return RVAL_UDECIMAL; ++} ++#else /* !LINUX_MIPSN32 */ + int + sys_lseek(tcp) + struct tcb *tcp; +@@ -513,6 +534,7 @@ struct tcb *tcp; + } + return RVAL_UDECIMAL; + } ++#endif /* LINUX_MIPSN32 */ + #endif + + #ifdef LINUX +@@ -552,7 +574,9 @@ struct tcb *tcp; + { + if (entering(tcp)) { + tprintf("%ld, %lld, %ld", tcp->u_arg[0], +-# if defined IA64 || defined X86_64 || defined ALPHA ++# if defined LINUX_MIPSN32 ++ tcp->ext_arg[1], tcp->u_arg[2] ++# elif defined IA64 || defined X86_64 || defined ALPHA || defined LINUX_MIPSN64 + (long long int) tcp->u_arg[1], tcp->u_arg[2] + # else + LONG_LONG(tcp->u_arg[1], tcp->u_arg[2]), tcp->u_arg[3] +@@ -2822,7 +2846,10 @@ struct tcb *tcp; + if (entering(tcp)) { + tprintf("%ld, %lld, %lld, ", + tcp->u_arg[0], +-# if defined IA64 || defined X86_64 || defined ALPHA ++#if defined LINUX_MIPSN32 ++ tcp->ext_arg[1], tcp->ext_arg[2]); ++ printxval(advise, tcp->u_arg[3], "POSIX_FADV_???"); ++#elif defined IA64 || defined X86_64 || defined ALPHA || defined LINUX_MIPSN64 + (long long int) tcp->u_arg[1], (long long int) tcp->u_arg[2]); + printxval(advise, tcp->u_arg[3], "POSIX_FADV_???"); + #else +Index: io.c +=================================================================== +RCS file: /cvsroot/strace/strace/io.c,v +retrieving revision 1.21 +diff -u -p -r1.21 io.c +--- strace/io.c 13 Dec 2006 17:08:08 -0000 1.21 ++++ strace/io.c 26 Aug 2007 19:13:46 -0000 +@@ -360,8 +360,12 @@ struct tcb *tcp; + tprintf("%#lx", tcp->u_arg[1]); + else + printstr(tcp, tcp->u_arg[1], tcp->u_rval); ++#ifdef MIPS_LINUXN32 ++ tprintf(", %lu, %#llx", tcp->u_arg[2], tcp->ext_arg[3]); ++#else + tprintf(", %lu, %#llx", tcp->u_arg[2], + LONG_LONG(tcp->u_arg[3], tcp->u_arg[4])); ++#endif + } + return 0; + } +@@ -374,8 +378,12 @@ struct tcb *tcp; + ALIGN64 (tcp, 3); + tprintf("%ld, ", tcp->u_arg[0]); + printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); ++#ifdef MIPS_LINUXN32 ++ tprintf(", %lu, %#llx", tcp->u_arg[2], tcp->ext_arg[3]); ++#else + tprintf(", %lu, %#llx", tcp->u_arg[2], + LONG_LONG(tcp->u_arg[3], tcp->u_arg[4])); ++#endif + } + return 0; + } +Index: mem.c +=================================================================== +RCS file: /cvsroot/strace/strace/mem.c,v +retrieving revision 1.40 +diff -u -p -r1.40 mem.c +--- strace/mem.c 24 Jul 2007 01:52:58 -0000 1.40 ++++ strace/mem.c 26 Aug 2007 19:13:46 -0000 +@@ -191,9 +191,10 @@ static const struct xlat mmap_flags[] = + #if !HAVE_LONG_LONG_OFF_T + static + int +-print_mmap(tcp,u_arg) ++print_mmap(tcp,u_arg, offset) + struct tcb *tcp; + long *u_arg; ++long long offset; + { + if (entering(tcp)) { + /* addr */ +@@ -216,7 +217,7 @@ long *u_arg; + /* fd (is always int, not long) */ + tprintf(", %d, ", (int)u_arg[4]); + /* offset */ +- tprintf("%#lx", u_arg[5]); ++ tprintf("%#llx", offset); + } + return RVAL_HEX; + } +@@ -265,7 +266,7 @@ struct tcb *tcp; + if (umoven(tcp, tcp->u_arg[0], sizeof u_arg, (char *) u_arg) == -1) + return 0; + #endif // defined(IA64) +- return print_mmap(tcp, u_arg); ++ return print_mmap(tcp, u_arg, u_arg[5]); + + } + #endif +@@ -274,6 +275,8 @@ int + sys_mmap(tcp) + struct tcb *tcp; + { ++ long long offset = tcp->u_arg[5]; ++ + #if defined(LINUX) && defined(SH64) + /* + * Old mmap differs from new mmap in specifying the +@@ -281,9 +284,12 @@ struct tcb *tcp; + * pretend it's in byte units so the user only ever + * sees bytes in the printout. + */ +- tcp->u_arg[5] <<= PAGE_SHIFT; ++ offset <<= PAGE_SHIFT; ++#endif ++#if defined(LINUX_MIPSN32) ++ offset = tcp->ext_arg[5]; + #endif +- return print_mmap(tcp, tcp->u_arg); ++ return print_mmap(tcp, tcp->u_arg, offset); + } + #endif /* !HAVE_LONG_LONG_OFF_T */ + +Index: process.c +=================================================================== +RCS file: /cvsroot/strace/strace/process.c,v +retrieving revision 1.107 +diff -u -p -r1.107 process.c +--- strace/process.c 2 Aug 2007 02:13:05 -0000 1.107 ++++ strace/process.c 26 Aug 2007 19:13:47 -0000 +@@ -2934,6 +2934,79 @@ const struct xlat struct_user_offsets[] + { uoff(regs.r0), "r0" }, + { uoff(regs.r12_orig), "orig_r12" }, + #endif ++#ifdef MIPS ++ { 0, "r0" }, ++ { 1, "r1" }, ++ { 2, "r2" }, ++ { 3, "r3" }, ++ { 4, "r4" }, ++ { 5, "r5" }, ++ { 6, "r6" }, ++ { 7, "r7" }, ++ { 8, "r8" }, ++ { 9, "r9" }, ++ { 10, "r10" }, ++ { 11, "r11" }, ++ { 12, "r12" }, ++ { 13, "r13" }, ++ { 14, "r14" }, ++ { 15, "r15" }, ++ { 16, "r16" }, ++ { 17, "r17" }, ++ { 18, "r18" }, ++ { 19, "r19" }, ++ { 20, "r20" }, ++ { 21, "r21" }, ++ { 22, "r22" }, ++ { 23, "r23" }, ++ { 24, "r24" }, ++ { 25, "r25" }, ++ { 26, "r26" }, ++ { 27, "r27" }, ++ { 28, "r28" }, ++ { 29, "r29" }, ++ { 30, "r30" }, ++ { 31, "r31" }, ++ { 32, "f0" }, ++ { 33, "f1" }, ++ { 34, "f2" }, ++ { 35, "f3" }, ++ { 36, "f4" }, ++ { 37, "f5" }, ++ { 38, "f6" }, ++ { 39, "f7" }, ++ { 40, "f8" }, ++ { 41, "f9" }, ++ { 42, "f10" }, ++ { 43, "f11" }, ++ { 44, "f12" }, ++ { 45, "f13" }, ++ { 46, "f14" }, ++ { 47, "f15" }, ++ { 48, "f16" }, ++ { 49, "f17" }, ++ { 50, "f18" }, ++ { 51, "f19" }, ++ { 52, "f20" }, ++ { 53, "f21" }, ++ { 54, "f22" }, ++ { 55, "f23" }, ++ { 56, "f24" }, ++ { 57, "f25" }, ++ { 58, "f26" }, ++ { 59, "f27" }, ++ { 60, "f28" }, ++ { 61, "f29" }, ++ { 62, "f30" }, ++ { 63, "f31" }, ++ { 64, "pc" }, ++ { 65, "cause" }, ++ { 66, "badvaddr" }, ++ { 67, "mmhi" }, ++ { 68, "mmlo" }, ++ { 69, "fpcsr" }, ++ { 70, "fpeir" }, ++#endif + #if !defined(S390) && !defined(S390X) && !defined(MIPS) && !defined(SPARC64) && !defined(AVR32) + { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" }, + #endif +Index: signal.c +=================================================================== +RCS file: /cvsroot/strace/strace/signal.c,v +retrieving revision 1.61 +diff -u -p -r1.61 signal.c +--- strace/signal.c 2 Aug 2007 01:15:59 -0000 1.61 ++++ strace/signal.c 26 Aug 2007 19:13:47 -0000 +@@ -1424,6 +1424,32 @@ struct tcb *tcp; + } + return 0; + #else ++#if defined (LINUX_MIPSN32) || defined (LINUX_MIPSN64) ++ /* This decodes rt_sigreturn. The 64-bit ABIs do not have ++ sigreturn. */ ++ long sp; ++ struct ucontext uc; ++ ++ if(entering(tcp)) { ++ tcp->u_arg[0] = 0; ++ if (upeek(tcp->pid, REG_SP, &sp) < 0) ++ return 0; ++ /* There are six words followed by a 128-byte siginfo. */ ++ sp = sp + 6 * 4 + 128; ++ if (umove(tcp, sp, &uc) < 0) ++ return 0; ++ tcp->u_arg[0] = 1; ++ tcp->u_arg[1] = *(long *) &uc.uc_sigmask; ++ } else { ++ tcp->u_rval = tcp->u_error = 0; ++ if(tcp->u_arg[0] == 0) ++ return 0; ++ tcp->auxstr = sprintsigmask("mask now ", ++ (sigset_t *) &tcp->u_arg[1], 0); ++ return RVAL_NONE | RVAL_STR; ++ } ++ return 0; ++#else + #ifdef MIPS + long sp; + struct sigcontext sc; +@@ -1444,7 +1470,8 @@ struct tcb *tcp; + tcp->u_rval = tcp->u_error = 0; + if(tcp->u_arg[0] == 0) + return 0; +- tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1], 0); ++ tcp->auxstr = sprintsigmask("mask now ", ++ (sigset_t *) &tcp->u_arg[1], 0); + return RVAL_NONE | RVAL_STR; + } + return 0; +@@ -1453,6 +1480,7 @@ struct tcb *tcp; + #warning (no problem, just a reminder :-) + return 0; + #endif /* MIPS */ ++#endif /* LINUX_MIPSN32 || LINUX_MIPSN64 */ + #endif /* SPARC || SPARC64 */ + #endif /* ALPHA */ + #endif /* !M68K */ +Index: syscall.c +=================================================================== +RCS file: /cvsroot/strace/strace/syscall.c,v +retrieving revision 1.89 +diff -u -p -r1.89 syscall.c +--- strace/syscall.c 22 Aug 2007 21:43:30 -0000 1.89 ++++ strace/syscall.c 26 Aug 2007 19:13:48 -0000 +@@ -798,6 +798,9 @@ internal_syscall(struct tcb *tcp) + #elif defined (SPARC) || defined (SPARC64) + static struct regs regs; + static unsigned long trap; ++#elif defined(LINUX_MIPSN32) ++ static long long a3; ++ static long long r2; + #elif defined(MIPS) + static long a3; + static long r2; +@@ -1102,14 +1105,44 @@ struct tcb *tcp; + #elif defined (M68K) + if (upeek(pid, 4*PT_ORIG_D0, &scno) < 0) + return -1; ++#elif defined (LINUX_MIPSN32) ++ unsigned long long regs[38]; ++ ++ if (ptrace (PTRACE_GETREGS, pid, NULL, (long) ®s) < 0) ++ return -1; ++ a3 = regs[REG_A3]; ++ r2 = regs[REG_V0]; ++ ++ if(!(tcp->flags & TCB_INSYSCALL)) { ++ scno = r2; ++ ++ /* Check if we return from execve. */ ++ if (scno == 0 && tcp->flags & TCB_WAITEXECVE) { ++ tcp->flags &= ~TCB_WAITEXECVE; ++ return 0; ++ } ++ ++ if (scno < 0 || scno > nsyscalls) { ++ if(a3 == 0 || a3 == -1) { ++ if(debug) ++ fprintf (stderr, "stray syscall exit: v0 = %ld\n", scno); ++ return 0; ++ } ++ } ++ } + #elif defined (MIPS) + if (upeek(pid, REG_A3, &a3) < 0) + return -1; +- + if(!(tcp->flags & TCB_INSYSCALL)) { + if (upeek(pid, REG_V0, &scno) < 0) + return -1; + ++ /* Check if we return from execve. */ ++ if (scno == 0 && tcp->flags & TCB_WAITEXECVE) { ++ tcp->flags &= ~TCB_WAITEXECVE; ++ return 0; ++ } ++ + if (scno < 0 || scno > nsyscalls) { + if(a3 == 0 || a3 == -1) { + if(debug) +@@ -1768,6 +1801,7 @@ force_result(tcp, error, rval) + r2 = rval; + a3 = 0; + } ++ /* PTRACE_POKEUSER is OK even for n32 since rval is only a long. */ + if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_A3), a3) < 0 || + ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_V0), r2) < 0) + return -1; +@@ -1993,6 +2027,27 @@ struct tcb *tcp; + tcp->u_nargs = 5; + } + } ++#elif defined (LINUX_MIPSN32) || defined (LINUX_MIPSN64) ++ /* N32 and N64 both use up to six registers. */ ++ { ++ unsigned long long regs[38]; ++ int i, nargs; ++ ++ if (tcp->scno >= 0 && tcp->scno < nsyscalls && sysent[tcp->scno].nargs != -1) ++ nargs = tcp->u_nargs = sysent[tcp->scno].nargs; ++ else ++ nargs = tcp->u_nargs = MAX_ARGS; ++ ++ if (ptrace (PTRACE_GETREGS, pid, NULL, (long) ®s) < 0) ++ return -1; ++ ++ for(i = 0; i < nargs; i++) { ++ tcp->u_arg[i] = regs[REG_A0 + i]; ++# if defined (LINUX_MIPSN32) ++ tcp->ext_arg[i] = regs[REG_A0 + i]; ++# endif ++ } ++ } + #elif defined (MIPS) + { + long sp; +Index: linux/syscall.h +=================================================================== +RCS file: /cvsroot/strace/strace/linux/syscall.h,v +retrieving revision 1.55 +diff -u -p -r1.55 syscall.h +--- strace/linux/syscall.h 2 Aug 2007 01:37:55 -0000 1.55 ++++ strace/linux/syscall.h 26 Aug 2007 19:13:48 -0000 +@@ -317,3 +317,5 @@ int sys_capget(), sys_capset(); + #ifdef M68K + int sys_cacheflush(); + #endif ++ ++int sys_pread64(), sys_pwrite64(); +Index: linux/mips/syscallent.h +=================================================================== +RCS file: /cvsroot/strace/strace/linux/mips/syscallent.h,v +retrieving revision 1.28 +diff -u -p -r1.28 syscallent.h +--- strace/linux/mips/syscallent.h 2 Aug 2007 01:44:14 -0000 1.28 ++++ strace/linux/mips/syscallent.h 26 Aug 2007 19:13:51 -0000 +@@ -1,3 +1,5 @@ ++#include "dummy.h" ++ + { 0, 0, printargs, "svr4_syscall" }, /* 000 */ + { 0, 0, printargs, "svr4_exit" }, /* 001 */ + { 0, 0, printargs, "svr4_fork" }, /* 002 */ +@@ -3998,6 +4000,8 @@ + { 0, 0, printargs, "SYS_3997" }, /* 3997 */ + { 0, 0, printargs, "SYS_3998" }, /* 3998 */ + { 0, 0, printargs, "SYS_3999" }, /* 3999 */ /* end of POSIX */ ++#if !defined (LINUX_MIPSN32) && !defined (LINUX_MIPSN64) ++ /* For an O32 strace, decode the o32 syscalls. */ + { 8, 0, printargs, "syscall" }, /* 4000 */ /* start of Linux o32 */ + { 1, TP, sys_exit, "exit" }, /* 4001 */ + { 0, TP, sys_fork, "fork" }, /* 4002 */ +@@ -4161,8 +4165,8 @@ + { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 4160 */ + { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 4161 */ + { 0, 0, sys_sched_yield, "sched_yield" }, /* 4162 */ +- { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max" }, /* 4163 */ +- { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min" }, /* 4164 */ ++ { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 4163 */ ++ { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 4164 */ + { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 4165 */ + { 2, 0, sys_nanosleep, "nanosleep" }, /* 4166 */ + { 4, 0, sys_mremap, "mremap" }, /* 4167 */ +@@ -4318,6 +4322,328 @@ + { 3, TD|TS, sys_signalfd, "signalfd" }, /* 4317 */ + { 4, TD, sys_timerfd, "timerfd" }, /* 4318 */ + { 1, TD, sys_eventfd, "eventfd" }, /* 4319 */ ++#else ++ { 0, 0, printargs, "o32_syscall" }, /* 4000 */ ++ { 0, 0, printargs, "o32_exit" }, /* 4001 */ ++ { 0, 0, printargs, "o32_fork" }, /* 4002 */ ++ { 0, 0, printargs, "o32_read" }, /* 4003 */ ++ { 0, 0, printargs, "o32_write" }, /* 4004 */ ++ { 0, 0, printargs, "o32_open" }, /* 4005 */ ++ { 0, 0, printargs, "o32_close" }, /* 4006 */ ++ { 0, 0, printargs, "o32_waitpid" }, /* 4007 */ ++ { 0, 0, printargs, "o32_creat" }, /* 4008 */ ++ { 0, 0, printargs, "o32_link" }, /* 4009 */ ++ { 0, 0, printargs, "o32_unlink" }, /* 4010 */ ++ { 0, 0, printargs, "o32_execve" }, /* 4011 */ ++ { 0, 0, printargs, "o32_chdir" }, /* 4012 */ ++ { 0, 0, printargs, "o32_time" }, /* 4013 */ ++ { 0, 0, printargs, "o32_mknod" }, /* 4014 */ ++ { 0, 0, printargs, "o32_chmod" }, /* 4015 */ ++ { 0, 0, printargs, "o32_lchown" }, /* 4016 */ ++ { 0, 0, printargs, "o32_break" }, /* 4017 */ ++ { 0, 0, printargs, "o32_oldstat" }, /* 4018 */ ++ { 0, 0, printargs, "o32_lseek" }, /* 4019 */ ++ { 0, 0, printargs, "o32_getpid" }, /* 4020 */ ++ { 0, 0, printargs, "o32_mount" }, /* 4021 */ ++ { 0, 0, printargs, "o32_oldumount" }, /* 4022 */ ++ { 0, 0, printargs, "o32_setuid" }, /* 4023 */ ++ { 0, 0, printargs, "o32_getuid" }, /* 4024 */ ++ { 0, 0, printargs, "o32_stime" }, /* 4025 */ ++ { 0, 0, printargs, "o32_ptrace" }, /* 4026 */ ++ { 0, 0, printargs, "o32_alarm" }, /* 4027 */ ++ { 0, 0, printargs, "o32_oldfstat" }, /* 4028 */ ++ { 0, 0, printargs, "o32_pause" }, /* 4029 */ ++ { 0, 0, printargs, "o32_utime" }, /* 4030 */ ++ { 0, 0, printargs, "o32_stty" }, /* 4031 */ ++ { 0, 0, printargs, "o32_gtty" }, /* 4032 */ ++ { 0, 0, printargs, "o32_access" }, /* 4033 */ ++ { 0, 0, printargs, "o32_nice" }, /* 4034 */ ++ { 0, 0, printargs, "o32_ftime" }, /* 4035 */ ++ { 0, 0, printargs, "o32_sync" }, /* 4036 */ ++ { 0, 0, printargs, "o32_kill" }, /* 4037 */ ++ { 0, 0, printargs, "o32_rename" }, /* 4038 */ ++ { 0, 0, printargs, "o32_mkdir" }, /* 4039 */ ++ { 0, 0, printargs, "o32_rmdir" }, /* 4040 */ ++ { 0, 0, printargs, "o32_dup" }, /* 4041 */ ++ { 0, 0, printargs, "o32_pipe" }, /* 4042 */ ++ { 0, 0, printargs, "o32_times" }, /* 4043 */ ++ { 0, 0, printargs, "o32_prof" }, /* 4044 */ ++ { 0, 0, printargs, "o32_brk" }, /* 4045 */ ++ { 0, 0, printargs, "o32_setgid" }, /* 4046 */ ++ { 0, 0, printargs, "o32_getgid" }, /* 4047 */ ++ { 0, 0, printargs, "o32_signal" }, /* 4048 */ ++ { 0, 0, printargs, "o32_geteuid" }, /* 4049 */ ++ { 0, 0, printargs, "o32_getegid" }, /* 4050 */ ++ { 0, 0, printargs, "o32_acct" }, /* 4051 */ ++ { 0, 0, printargs, "o32_umount" }, /* 4052 */ ++ { 0, 0, printargs, "o32_lock" }, /* 4053 */ ++ { 0, 0, printargs, "o32_ioctl" }, /* 4054 */ ++ { 0, 0, printargs, "o32_fcntl" }, /* 4055 */ ++ { 0, 0, printargs, "o32_mpx" }, /* 4056 */ ++ { 0, 0, printargs, "o32_setpgid" }, /* 4057 */ ++ { 0, 0, printargs, "o32_ulimit" }, /* 4058 */ ++ { 0, 0, printargs, "o32_oldolduname" }, /* 4059 */ ++ { 0, 0, printargs, "o32_umask" }, /* 4060 */ ++ { 0, 0, printargs, "o32_chroot" }, /* 4061 */ ++ { 0, 0, printargs, "o32_ustat" }, /* 4062 */ ++ { 0, 0, printargs, "o32_dup2" }, /* 4063 */ ++ { 0, 0, printargs, "o32_getppid" }, /* 4064 */ ++ { 0, 0, printargs, "o32_getpgrp" }, /* 4065 */ ++ { 0, 0, printargs, "o32_setsid" }, /* 4066 */ ++ { 0, 0, printargs, "o32_sigaction" }, /* 4067 */ ++ { 0, 0, printargs, "o32_siggetmask" }, /* 4068 */ ++ { 0, 0, printargs, "o32_sigsetmask" }, /* 4069 */ ++ { 0, 0, printargs, "o32_setreuid" }, /* 4070 */ ++ { 0, 0, printargs, "o32_setregid" }, /* 4071 */ ++ { 0, 0, printargs, "o32_sigsuspend" }, /* 4072 */ ++ { 0, 0, printargs, "o32_sigpending" }, /* 4073 */ ++ { 0, 0, printargs, "o32_sethostname" }, /* 4074 */ ++ { 0, 0, printargs, "o32_setrlimit" }, /* 4075 */ ++ { 0, 0, printargs, "o32_getrlimit" }, /* 4076 */ ++ { 0, 0, printargs, "o32_getrusage" }, /* 4077 */ ++ { 0, 0, printargs, "o32_gettimeofday" }, /* 4078 */ ++ { 0, 0, printargs, "o32_settimeofday" }, /* 4079 */ ++ { 0, 0, printargs, "o32_getgroups" }, /* 4080 */ ++ { 0, 0, printargs, "o32_setgroups" }, /* 4081 */ ++ { 0, 0, printargs, "o32_reserved82" }, /* 4082 */ ++ { 0, 0, printargs, "o32_symlink" }, /* 4083 */ ++ { 0, 0, printargs, "o32_oldlstat" }, /* 4084 */ ++ { 0, 0, printargs, "o32_readlink" }, /* 4085 */ ++ { 0, 0, printargs, "o32_uselib" }, /* 4086 */ ++ { 0, 0, printargs, "o32_swapon" }, /* 4087 */ ++ { 0, 0, printargs, "o32_reboot" }, /* 4088 */ ++ { 0, 0, printargs, "o32_readdir" }, /* 4089 */ ++ { 0, 0, printargs, "o32_old_mmap" }, /* 4090 */ ++ { 0, 0, printargs, "o32_munmap" }, /* 4091 */ ++ { 0, 0, printargs, "o32_truncate" }, /* 4092 */ ++ { 0, 0, printargs, "o32_ftruncate" }, /* 4093 */ ++ { 0, 0, printargs, "o32_fchmod" }, /* 4094 */ ++ { 0, 0, printargs, "o32_fchown" }, /* 4095 */ ++ { 0, 0, printargs, "o32_getpriority" }, /* 4096 */ ++ { 0, 0, printargs, "o32_setpriority" }, /* 4097 */ ++ { 0, 0, printargs, "o32_profil" }, /* 4098 */ ++ { 0, 0, printargs, "o32_statfs" }, /* 4099 */ ++ { 0, 0, printargs, "o32_fstatfs" }, /* 4100 */ ++ { 0, 0, printargs, "o32_ioperm" }, /* 4101 */ ++ { 0, 0, printargs, "o32_socketcall" }, /* 4102 */ ++ { 0, 0, printargs, "o32_syslog" }, /* 4103 */ ++ { 0, 0, printargs, "o32_setitimer" }, /* 4104 */ ++ { 0, 0, printargs, "o32_getitimer" }, /* 4105 */ ++ { 0, 0, printargs, "o32_stat" }, /* 4106 */ ++ { 0, 0, printargs, "o32_lstat" }, /* 4107 */ ++ { 0, 0, printargs, "o32_fstat" }, /* 4108 */ ++ { 0, 0, printargs, "o32_olduname" }, /* 4109 */ ++ { 0, 0, printargs, "o32_iopl" }, /* 4110 */ ++ { 0, 0, printargs, "o32_vhangup" }, /* 4111 */ ++ { 0, 0, printargs, "o32_idle" }, /* 4112 */ ++ { 0, 0, printargs, "o32_vm86" }, /* 4113 */ ++ { 0, 0, printargs, "o32_wait4" }, /* 4114 */ ++ { 0, 0, printargs, "o32_swapoff" }, /* 4115 */ ++ { 0, 0, printargs, "o32_sysinfo" }, /* 4116 */ ++ { 0, 0, printargs, "o32_ipc" }, /* 4117 */ ++ { 0, 0, printargs, "o32_fsync" }, /* 4118 */ ++ { 0, 0, printargs, "o32_sigreturn" }, /* 4119 */ ++ { 0, 0, printargs, "o32_clone" }, /* 4120 */ ++ { 0, 0, printargs, "o32_setdomainname" }, /* 4121 */ ++ { 0, 0, printargs, "o32_uname" }, /* 4122 */ ++ { 0, 0, printargs, "o32_modify_ldt" }, /* 4123 */ ++ { 0, 0, printargs, "o32_adjtimex" }, /* 4124 */ ++ { 0, 0, printargs, "o32_mprotect" }, /* 4125 */ ++ { 0, 0, printargs, "o32_sigprocmask" }, /* 4126 */ ++ { 0, 0, printargs, "o32_create_module" }, /* 4127 */ ++ { 0, 0, printargs, "o32_init_module" }, /* 4128 */ ++ { 0, 0, printargs, "o32_delete_module" }, /* 4129 */ ++ { 0, 0, printargs, "o32_get_kernel_syms"}, /* 4130 */ ++ { 0, 0, printargs, "o32_quotactl" }, /* 4131 */ ++ { 0, 0, printargs, "o32_getpgid" }, /* 4132 */ ++ { 0, 0, printargs, "o32_fchdir" }, /* 4133 */ ++ { 0, 0, printargs, "o32_bdflush" }, /* 4134 */ ++ { 0, 0, printargs, "o32_sysfs" }, /* 4135 */ ++ { 0, 0, printargs, "o32_personality" }, /* 4136 */ ++ { 0, 0, printargs, "o32_afs_syscall" }, /* 4137 */ ++ { 0, 0, printargs, "o32_setfsuid" }, /* 4138 */ ++ { 0, 0, printargs, "o32_setfsgid" }, /* 4139 */ ++ { 0, 0, printargs, "o32__llseek" }, /* 4140 */ ++ { 0, 0, printargs, "o32_getdents" }, /* 4141 */ ++ { 0, 0, printargs, "o32__newselect" }, /* 4142 */ ++ { 0, 0, printargs, "o32_flock" }, /* 4143 */ ++ { 0, 0, printargs, "o32_msync" }, /* 4144 */ ++ { 0, 0, printargs, "o32_readv" }, /* 4145 */ ++ { 0, 0, printargs, "o32_writev" }, /* 4146 */ ++ { 0, 0, printargs, "o32_cacheflush" }, /* 4147 */ ++ { 0, 0, printargs, "o32_cachectl" }, /* 4148 */ ++ { 0, 0, printargs, "o32_sysmips" }, /* 4149 */ ++ { 0, 0, printargs, "o32_setup" }, /* 4150 */ ++ { 0, 0, printargs, "o32_getsid" }, /* 4151 */ ++ { 0, 0, printargs, "o32_fdatasync" }, /* 4152 */ ++ { 0, 0, printargs, "o32__sysctl" }, /* 4153 */ ++ { 0, 0, printargs, "o32_mlock" }, /* 4154 */ ++ { 0, 0, printargs, "o32_munlock" }, /* 4155 */ ++ { 0, 0, printargs, "o32_mlockall" }, /* 4156 */ ++ { 0, 0, printargs, "o32_munlockall" }, /* 4157 */ ++ { 0, 0, printargs, "o32_sched_setparam"}, /* 4158 */ ++ { 0, 0, printargs, "o32_sched_getparam"}, /* 4159 */ ++ { 0, 0, printargs, "o32_sched_setscheduler"}, /* 4160 */ ++ { 0, 0, printargs, "o32_sched_getscheduler"}, /* 4161 */ ++ { 0, 0, printargs, "o32_sched_yield" }, /* 4162 */ ++ { 0, 0, printargs, "o32_sched_get_priority_max"}, /* 4163 */ ++ { 0, 0, printargs, "o32_sched_get_priority_min"},/* 4164 */ ++ { 0, 0, printargs, "o32_sched_rr_get_interval"}, /* 4165 */ ++ { 0, 0, printargs, "o32_nanosleep" }, /* 4166 */ ++ { 0, 0, printargs, "o32_mremap" }, /* 4167 */ ++ { 0, 0, printargs, "o32_accept" }, /* 4168 */ ++ { 0, 0, printargs, "o32_bind" }, /* 4169 */ ++ { 0, 0, printargs, "o32_connect" }, /* 4170 */ ++ { 0, 0, printargs, "o32_getpeername" }, /* 4171 */ ++ { 0, 0, printargs, "o32_getsockname" }, /* 4172 */ ++ { 0, 0, printargs, "o32_getsockopt" }, /* 4173 */ ++ { 0, 0, printargs, "o32_listen" }, /* 4174 */ ++ { 0, 0, printargs, "o32_recv" }, /* 4175 */ ++ { 0, 0, printargs, "o32_recvfrom" }, /* 4176 */ ++ { 0, 0, printargs, "o32_recvmsg" }, /* 4177 */ ++ { 0, 0, printargs, "o32_send" }, /* 4178 */ ++ { 0, 0, printargs, "o32_sendmsg" }, /* 4179 */ ++ { 0, 0, printargs, "o32_sendto" }, /* 4180 */ ++ { 0, 0, printargs, "o32_setsockopt" }, /* 4181 */ ++ { 0, 0, printargs, "o32_shutdown" }, /* 4182 */ ++ { 0, 0, printargs, "o32_socket" }, /* 4183 */ ++ { 0, 0, printargs, "o32_socketpair" }, /* 4184 */ ++ { 0, 0, printargs, "o32_setresuid" }, /* 4185 */ ++ { 0, 0, printargs, "o32_getresuid" }, /* 4186 */ ++ { 0, 0, printargs, "o32_query_module" }, /* 4187 */ ++ { 0, 0, printargs, "o32_poll" }, /* 4188 */ ++ { 0, 0, printargs, "o32_nfsservctl" }, /* 4189 */ ++ { 0, 0, printargs, "o32_setresgid" }, /* 4190 */ ++ { 0, 0, printargs, "o32_getresgid" }, /* 4191 */ ++ { 0, 0, printargs, "o32_prctl" }, /* 4192 */ ++ { 0, 0, printargs, "o32_rt_sigreturn" }, /* 4193 */ ++ { 0, 0, printargs, "o32_rt_sigaction" }, /* 4194 */ ++ { 0, 0, printargs, "o32_rt_sigprocmask"}, /* 4195 */ ++ { 0, 0, printargs, "o32_rt_sigpending" }, /* 4196 */ ++ { 0, 0, printargs, "o32_rt_sigtimedwait"},/* 4197 */ ++ { 0, 0, printargs, "o32_rt_sigqueueinfo"},/* 4198 */ ++ { 0, 0, printargs, "o32_rt_siguspend" }, /* 4199 */ ++ { 0, 0, printargs, "o32_pread" }, /* 4200 */ ++ { 0, 0, printargs, "o32_pwrite" }, /* 4201 */ ++ { 0, 0, printargs, "o32_chown" }, /* 4202 */ ++ { 0, 0, printargs, "o32_getcwd" }, /* 4203 */ ++ { 0, 0, printargs, "o32_capget" }, /* 4204 */ ++ { 0, 0, printargs, "o32_capset" }, /* 4205 */ ++ { 0, 0, printargs, "o32_sigaltstatck" }, /* 4206 */ ++ { 0, 0, printargs, "o32_sendfile" }, /* 4207 */ ++ { 0, 0, printargs, "SYS_4208" }, /* 4208 */ ++ { 0, 0, printargs, "SYS_4209" }, /* 4209 */ ++ { 0, 0, printargs, "o32_mmap" }, /* 4210 */ ++ { 0, 0, printargs, "o32_truncate64" }, /* 4211 */ ++ { 0, 0, printargs, "o32_ftruncate64" }, /* 4212 */ ++ { 0, 0, printargs, "o32_stat64" }, /* 4213 */ ++ { 0, 0, printargs, "o32_lstat64" }, /* 4214 */ ++ { 0, 0, printargs, "o32_fstat64" }, /* 4215 */ ++ { 0, 0, printargs, "o32_pivot_root" }, /* 4216 */ ++ { 0, 0, printargs, "o32_mincore" }, /* 4217 */ ++ { 0, 0, printargs, "o32_madvise" }, /* 4218 */ ++ { 0, 0, printargs, "o32_getdents64" }, /* 4219 */ ++ { 0, 0, printargs, "o32_fcntl64" }, /* 4220 */ ++ { 0, 0, printargs, "SYS_4221" }, /* 4221 */ ++ { 0, 0, printargs, "o32_gettid" }, /* 4222 */ ++ { 5, TD, printargs, "o32_readahead" }, /* 4223 */ ++ { 5, TF, printargs, "o32_setxattr" }, /* 4224 */ ++ { 5, TF, printargs, "o32_lsetxattr" }, /* 4225 */ ++ { 5, TD, printargs, "o32_fsetxattr" }, /* 4226 */ ++ { 4, TF, printargs, "o32_getxattr" }, /* 4227 */ ++ { 4, TF, printargs, "o32_lgetxattr" }, /* 4228 */ ++ { 4, 0, printargs, "o32_fgetxattr" }, /* 4229 */ ++ { 3, TF, printargs, "o32_listxattr" }, /* 4230 */ ++ { 3, TF, printargs, "o32_llistxattr" }, /* 4231 */ ++ { 3, 0, printargs, "o32_flistxattr" }, /* 4232 */ ++ { 2, TF, printargs, "o32_removexattr" }, /* 4233 */ ++ { 2, TF, printargs, "o32_lremovexattr" }, /* 4234 */ ++ { 2, TD, printargs, "o32_fremovexattr" }, /* 4235 */ ++ { 2, TS, printargs, "o32_tkill" }, /* 4236 */ ++ { 5, TD, printargs, "o32_sendfile64" }, /* 4237 */ ++ { 6, 0, printargs, "o32_futex" }, /* 4238 */ ++ { 3, 0, printargs, "o32_sched_setaffinity"}, /* 4239 */ ++ { 3, 0, printargs, "o32_sched_getaffinity"}, /* 4240 */ ++ { 2, 0, printargs, "o32_io_setup" }, /* 4241 */ ++ { 1, 0, printargs, "o32_io_destroy" }, /* 4242 */ ++ { 5, 0, printargs, "o32_io_getevents" }, /* 4243 */ ++ { 3, 0, printargs, "o32_io_submit" }, /* 4244 */ ++ { 3, 0, printargs, "o32_io_cancel" }, /* 4245 */ ++ { 1, TP, printargs, "o32_exit_group" }, /* 4246 */ ++ { 3, 0, printargs, "o32_lookup_dcookie"}, /* 4247 */ ++ { 1, 0, printargs, "o32_epoll_create" }, /* 4248 */ ++ { 4, TD, printargs, "o32_epoll_ctl" }, /* 4249 */ ++ { 3, TD, printargs, "o32_epoll_wait" }, /* 4250 */ ++ { 5, 0, printargs, "o32_remap_file_pages"}, /* 4251 */ ++ { 1, 0, printargs, "o32_set_tid_address"}, /* 4252 */ ++ { 0, 0, printargs, "o32_restart_syscall"}, /* 4253 */ ++ { 7, 0, printargs, "o32_fadvise64_64" }, /* 4254 */ ++ { 3, TF, printargs, "o32_statfs64" }, /* 4255 */ ++ { 2, TD, printargs, "o32_fstatfs64" }, /* 4256 */ ++ { 3, 0, printargs, "o32_timer_create" }, /* 4257 */ ++ { 4, 0, printargs, "o32_timer_settime" }, /* 4258 */ ++ { 2, 0, printargs, "o32_timer_gettime" }, /* 4259 */ ++ { 1, 0, printargs, "o32_timer_getoverrun"}, /* 4260 */ ++ { 1, 0, printargs, "o32_timer_delete" }, /* 4261 */ ++ { 2, 0, printargs, "o32_clock_settime" }, /* 4262 */ ++ { 2, 0, printargs, "o32_clock_gettime" }, /* 4263 */ ++ { 2, 0, printargs, "o32_clock_getres" }, /* 4264 */ ++ { 4, 0, printargs, "o32_clock_nanosleep"}, /* 4265 */ ++ { 3, TS, printargs, "o32_tgkill" }, /* 4266 */ ++ { 2, TF, printargs, "o32_utimes" }, /* 4267 */ ++ { 4, 0, printargs, "o32_mbind" }, /* 4268 */ ++ { 0, 0, printargs, "o32_SYS_4269" }, /* 4269 */ ++ { 0, 0, printargs, "o32_SYS_4270" }, /* 4270 */ ++ { 4, 0, printargs, "o32_mq_open" }, /* 4271 */ ++ { 1, 0, printargs, "o32_mq_unlink" }, /* 4272 */ ++ { 5, 0, printargs, "o32_mq_timedsend" }, /* 4273 */ ++ { 5, 0, printargs, "o32_mq_timedreceive"}, /* 4274 */ ++ { 2, 0, printargs, "o32_mq_notify" }, /* 4275 */ ++ { 3, 0, printargs, "o32_mq_getsetattr" }, /* 4276 */ ++ { 0, 0, printargs, "o32_SYS_4277" }, /* 4277 */ ++ { 5, TP, printargs, "o32_waitid" }, /* 4278 */ ++ { 0, 0, printargs, "o32_SYS_4279" }, /* 4279 */ ++ { 5, 0, printargs, "o32_add_key" }, /* 4280 */ ++ { 4, 0, printargs, "o32_request_key" }, /* 4281 */ ++ { 5, 0, printargs, "o32_keyctl" }, /* 4282 */ ++ { 1, 0, printargs, "o32_set_thread_area" }, /* 4283 */ ++ { 0, TD, printargs, "o32_inotify_init" }, /* 4284 */ ++ { 3, TD, printargs, "o32_inotify_add_watch" }, /* 4285 */ ++ { 2, TD, printargs, "o32_inotify_rm_watch" }, /* 4286 */ ++ { 4, 0, printargs, "o32_migrate_pages" }, /* 4287 */ ++ { 4, TD|TF, printargs, "o32_openat" }, /* 4288 */ ++ { 3, TD|TF, printargs, "o32_mkdirat" }, /* 4289 */ ++ { 4, TD|TF, printargs, "o32_mknodat" }, /* 4290 */ ++ { 5, TD|TF, printargs, "o32_fchownat" }, /* 4291 */ ++ { 3, TD|TF, printargs, "o32_futimesat" }, /* 4292 */ ++ { 4, TD|TD, printargs, "o32_newfstatat" }, /* 4293 */ ++ { 3, TD|TF, printargs, "o32_unlinkat" }, /* 4294 */ ++ { 4, TD|TF, printargs, "o32_renameat" }, /* 4295 */ ++ { 5, TD|TF, printargs, "o32_linkat" }, /* 4296 */ ++ { 3, TD|TF, printargs, "o32_symlinkat" }, /* 4297 */ ++ { 4, TD|TF, printargs, "o32_readlinkat" }, /* 4298 */ ++ { 3, TD|TF, printargs, "o32_fchmodat" }, /* 4299 */ ++ { 3, TD|TF, printargs, "o32_faccessat" }, /* 4300 */ ++ { 6, TD, printargs, "o32_pselect6" }, /* 4301 */ ++ { 5, TD, printargs, "o32_ppoll" }, /* 4302 */ ++ { 1, TP, printargs, "o32_unshare" }, /* 4303 */ ++ { 6, TD, printargs, "o32_splice" }, /* 4304 */ ++ { 4, TD, printargs, "o32_sync_file_range" }, /* 4305 */ ++ { 0, 0, printargs, "o32_SYS_4306" }, /* 4306 */ ++ { 0, 0, printargs, "o32_SYS_4307" }, /* 4307 */ ++ { 6, 0, printargs, "o32_move_pages" }, /* 4308 */ ++ { 0, 0, printargs, "o32_SYS_4309" }, /* 4309 */ ++ { 0, 0, printargs, "o32_SYS_4310" }, /* 4310 */ ++ { 0, 0, printargs, "o32_SYS_4311" }, /* 4311 */ ++ { 3, 0, printargs, "o32_getcpu" }, /* 4312 */ ++ { 5, TD, printargs, "o32_epoll_pwait" }, /* 4313 */ ++ { 0, 0, printargs, "o32_SYS_4314" }, /* 4314 */ ++ { 0, 0, printargs, "o32_SYS_4315" }, /* 4315 */ ++ { 0, 0, printargs, "o32_SYS_4316" }, /* 4316 */ ++ { 3, TD|TS, printargs, "o32_signalfd" }, /* 4317 */ ++ { 4, TD, printargs, "o32_timerfd" }, /* 4318 */ ++ { 1, TD, printargs, "o32_eventfd" }, /* 4319 */ ++#endif + { 0, 0, printargs, "SYS_4320" }, /* 4320 */ + { 0, 0, printargs, "SYS_4321" }, /* 4321 */ + { 0, 0, printargs, "SYS_4322" }, /* 4322 */ +@@ -4998,3 +5324,2464 @@ + { 0, 0, printargs, "SYS_4997" }, /* 4997 */ + { 0, 0, printargs, "SYS_4998" }, /* 4998 */ + { 0, 0, printargs, "SYS_4999" }, /* 4999 */ /* end of Linux o32 */ ++#if defined (LINUX_MIPSN64) ++ /* For an N64 strace decode the N64 64-bit syscalls. */ ++ { 3, TF, sys_read, "read" }, /* 5000 */ /* start of Linux N64 */ ++ { 3, TF, sys_write, "write" }, /* 5001 */ ++ { 3, TF, sys_open, "open" }, /* 5002 */ ++ { 1, 0, sys_close, "close" }, /* 5003 */ ++ { 2, TF, sys_stat, "stat" }, /* 5004 */ ++ { 2, 0, sys_fstat, "fstat" }, /* 5005 */ ++ { 2, TF, sys_lstat, "lstat" }, /* 5006 */ ++ { 3, 0, sys_poll, "poll" }, /* 5007 */ ++ { 3, 0, sys_lseek, "lseek" }, /* 5008 */ ++ { 6, 0, sys_mmap, "mmap" }, /* 5009 */ ++ { 3, 0, sys_mprotect, "mprotect" }, /* 5010 */ ++ { 2, 0, sys_munmap, "munmap" }, /* 5011 */ ++ { 1, 0, sys_brk, "brk" }, /* 5012 */ ++ { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 5013 */ ++ { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 5014 */ ++ { 3, 0, sys_ioctl, "ioctl" }, /* 5015 */ ++ { 6, TF, sys_pread64, "pread" }, /* 5016 */ ++ { 6, TF, sys_pwrite64, "pwrite" }, /* 5017 */ ++ { 3, 0, sys_readv, "readv" }, /* 5018 */ ++ { 3, 0, sys_writev, "writev" }, /* 5019 */ ++ { 2, TF, sys_access, "access" }, /* 5020 */ ++ { 1, 0, sys_pipe, "pipe" }, /* 5021 */ ++ { 5, 0, sys_select, "_newselect" }, /* 5022 */ ++ { 0, 0, sys_sched_yield, "sched_yield" }, /* 5023 */ ++ { 4, 0, sys_mremap, "mremap" }, /* 5024 */ ++ { 3, 0, sys_msync, "msync" }, /* 5025 */ ++ { 3, 0, printargs, "mincore" }, /* 5026 */ ++ { 3, 0, sys_madvise, "madvise" }, /* 5027 */ ++ { 3, TI, sys_shmget, "shmget" }, /* 5028 */ ++ { 3, TI, sys_shmat, "shmgat" }, /* 5029 */ ++ { 3, TI, sys_shmctl, "shmctl" }, /* 5030 */ ++ { 1, 0, sys_dup, "dup" }, /* 5031 */ ++ { 2, 0, sys_dup2, "dup2" }, /* 5032 */ ++ { 0, TS, sys_pause, "pause" }, /* 5033 */ ++ { 2, 0, sys_nanosleep, "nanosleep" }, /* 5034 */ ++ { 2, 0, sys_getitimer, "getitimer" }, /* 5035 */ ++ { 3, 0, sys_setitimer, "setitimer" }, /* 5036 */ ++ { 1, 0, sys_alarm, "alarm" }, /* 5037 */ ++ { 0, 0, sys_getpid, "getpid" }, /* 5038 */ ++ { 4, TF, sys_sendfile, "sendfile" }, /* 5039 */ ++ { 2, 0, sys_socketcall, "socketcall" }, /* 5040 */ ++ { 3, TN, sys_connect, "connect" }, /* 5041 */ ++ { 3, TN, sys_accept, "accept" }, /* 5042 */ ++ { 6, TN, sys_sendto, "sendto" }, /* 5043 */ ++ { 6, TN, sys_recvfrom, "recvfrom" }, /* 5044 */ ++ { 3, TN, sys_sendmsg, "sendmsg" }, /* 5045 */ ++ { 3, TN, sys_recvmsg, "recvmsg" }, /* 5046 */ ++ { 2, TN, sys_shutdown, "shutdown" }, /* 5047 */ ++ { 3, TN, sys_bind, "bind" }, /* 5048 */ ++ { 2, TN, sys_listen, "listen" }, /* 5049 */ ++ { 3, TN, sys_getsockname, "getsockname" }, /* 5050 */ ++ { 3, TN, sys_getpeername, "getpeername" }, /* 5051 */ ++ { 4, TN, sys_socketpair, "socketpair" }, /* 5052 */ ++ { 5, TN, sys_setsockopt, "setsockopt" }, /* 5053 */ ++ { 5, TN, sys_getsockopt, "getsockopt" }, /* 5054 */ ++ { 2, TP, sys_clone, "clone" }, /* 5055 */ ++ { 0, TP, sys_fork, "fork" }, /* 5056 */ ++ { 3, TF|TP, sys_execve, "execve" }, /* 5057 */ ++ { 1, TP, sys_exit, "exit" }, /* 5058 */ ++ { 4, TP, sys_wait4, "wait4" }, /* 5059 */ ++ { 2, TS, sys_kill, "kill" }, /* 5060 */ ++ { 1, 0, sys_uname, "uname" }, /* 5061 */ ++ { 3, TI, sys_semget, "semget" }, /* 5062 */ ++ { 3, TI, printargs, "semop" }, /* 5063 */ ++ { 4, TI, sys_semctl, "semctl" }, /* 5064 */ ++ { 1, TI, sys_shmdt, "shmdt" }, /* 5065 */ ++ { 2, TI, sys_msgget, "msgget" }, /* 5066 */ ++ { 4, TI, sys_msgsnd, "msgsnd" }, /* 5067 */ ++ { 5, TI, sys_msgrcv, "msgrcv" }, /* 5068 */ ++ { 3, TI, sys_msgctl, "msgctl" }, /* 5069 */ ++ { 3, 0, sys_fcntl, "fcntl" }, /* 5070 */ ++ { 2, 0, sys_flock, "flock" }, /* 5071 */ ++ { 1, 0, sys_fsync, "fsync" }, /* 5072 */ ++ { 1, 0, sys_fdatasync, "fdatasync" }, /* 5073 */ ++ { 2, TF, sys_truncate, "truncate" }, /* 5074 */ ++ { 2, 0, sys_ftruncate, "ftruncate" }, /* 5075 */ ++ { 3, 0, sys_getdents, "getdents" }, /* 5076 */ ++ { 2, TF, sys_getcwd, "getcwd" }, /* 5077 */ ++ { 1, TF, sys_chdir, "chdir" }, /* 5078 */ ++ { 1, TF, sys_fchdir, "fchdir" }, /* 5079 */ ++ { 2, TF, sys_rename, "rename" }, /* 5080 */ ++ { 2, TF, sys_mkdir, "mkdir" }, /* 5081 */ ++ { 1, TF, sys_rmdir, "rmdir" }, /* 5082 */ ++ { 2, TF, sys_creat, "creat" }, /* 5083 */ ++ { 2, TF, sys_link, "link" }, /* 5084 */ ++ { 1, TF, sys_unlink, "unlink" }, /* 5085 */ ++ { 2, TF, sys_symlink, "symlink" }, /* 5086 */ ++ { 3, TF, sys_readlink, "readlink" }, /* 5087 */ ++ { 2, TF, sys_chmod, "chmod" }, /* 5088 */ ++ { 2, 0, sys_fchmod, "fchmod" }, /* 5089 */ ++ { 3, TF, sys_chown, "chown" }, /* 5090 */ ++ { 3, 0, sys_fchown, "fchown" }, /* 5091 */ ++ { 3, TF, sys_chown, "lchown" }, /* 5092 */ ++ { 1, 0, sys_umask, "umask" }, /* 5093 */ ++ { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 5094 */ ++ { 2, 0, sys_getrlimit, "getrlimit" }, /* 5095 */ ++ { 2, 0, sys_getrusage, "getrusage" }, /* 5096 */ ++ { 1, 0, sys_sysinfo, "sysinfo" }, /* 5097 */ ++ { 1, 0, sys_times, "times" }, /* 5098 */ ++ { 4, 0, sys_ptrace, "ptrace" }, /* 5099 */ ++ { 0, 0, sys_getuid, "getuid" }, /* 5100 */ ++ { 3, 0, sys_syslog, "syslog" }, /* 5101 */ ++ { 0, 0, sys_getgid, "getgid" }, /* 5102 */ ++ { 1, 0, sys_setuid, "setuid" }, /* 5103 */ ++ { 1, 0, sys_setgid, "setgid" }, /* 5104 */ ++ { 0, 0, sys_geteuid, "geteuid" }, /* 5105 */ ++ { 0, 0, sys_getegid, "getegid" }, /* 5106 */ ++ { 2, 0, sys_setpgid, "setpgid" }, /* 5107 */ ++ { 0, 0, sys_getppid, "getppid" }, /* 5108 */ ++ { 0, 0, sys_getpgrp, "getpgrp" }, /* 5109 */ ++ { 0, 0, sys_setsid, "setsid" }, /* 5110 */ ++ { 2, 0, sys_setreuid, "setreuid" }, /* 5111 */ ++ { 2, 0, sys_setregid, "setregid" }, /* 5112 */ ++ { 2, 0, sys_getgroups, "getgroups" }, /* 5113 */ ++ { 2, 0, sys_setgroups, "setgroups" }, /* 5114 */ ++ { 3, 0, sys_setresuid, "setresuid" }, /* 5115 */ ++ { 3, 0, sys_getresuid, "getresuid" }, /* 5116 */ ++ { 3, 0, sys_setresgid, "setresgid" }, /* 5117 */ ++ { 3, 0, sys_getresgid, "getresgid" }, /* 5118 */ ++ { 0, 0, sys_getpgid, "getpgid" }, /* 5119 */ ++ { 1, 0, sys_setfsuid, "setfsuid" }, /* 5120 */ ++ { 1, 0, sys_setfsgid, "setfsgid" }, /* 5121 */ ++ { 1, 0, sys_getsid, "getsid" }, /* 5122 */ ++ { 2, 0, sys_capget, "capget" }, /* 5123 */ ++ { 2, 0, sys_capset, "capset" }, /* 5124 */ ++ { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 5125 */ ++ { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"},/* 5126 */ ++ { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"},/* 5127 */ ++ { 2, TS, sys_rt_sigsuspend, "rt_siguspend" }, /* 5128 */ ++ { 2, TS, sys_sigaltstack, "sigaltstatck" }, /* 5129 */ ++ { 2, TF, sys_utime, "utime" }, /* 5130 */ ++ { 3, TF, sys_mknod, "mknod" }, /* 5131 */ ++ { 1, 0, sys_personality, "personality" }, /* 5132 */ ++ { 2, 0, sys_ustat, "ustat" }, /* 5133 */ ++ { 3, 0, sys_statfs, "statfs" }, /* 5134 */ ++ { 3, 0, sys_fstatfs, "fstatfs" }, /* 5135 */ ++ { 5, 0, sys_sysfs, "sysfs" }, /* 5136 */ ++ { 2, 0, sys_getpriority, "getpriority" }, /* 5137 */ ++ { 3, 0, sys_setpriority, "setpriority" }, /* 5138 */ ++ { 2, 0, sys_sched_setparam, "sched_setparam"}, /* 5139 */ ++ { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 5140 */ ++ { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 5141 */ ++ { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 5142 */ ++ { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 5143 */ ++ { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 5144 */ ++ { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 5145 */ ++ { 2, 0, sys_mlock, "mlock" }, /* 5146 */ ++ { 2, 0, sys_munlock, "munlock" }, /* 5147 */ ++ { 1, 0, sys_mlockall, "mlockall" }, /* 5148 */ ++ { 0, 0, sys_munlockall, "munlockall" }, /* 5149 */ ++ { 0, 0, sys_vhangup, "vhangup" }, /* 5150 */ ++ { 2, 0, sys_pivotroot, "pivot_root" }, /* 5151 */ ++ { 1, 0, sys_sysctl, "_sysctl" }, /* 5152 */ ++ { 5, 0, printargs, "prctl" }, /* 5153 */ ++ { 1, 0, sys_adjtimex, "adjtimex" }, /* 5154 */ ++ { 2, 0, sys_setrlimit, "setrlimit" }, /* 5155 */ ++ { 1, TF, sys_chroot, "chroot" }, /* 5156 */ ++ { 0, 0, sys_sync, "sync" }, /* 5157 */ ++ { 1, TF, sys_acct, "acct" }, /* 5158 */ ++ { 2, 0, sys_settimeofday, "settimeofday" }, /* 5159 */ ++ { 5, TF, sys_mount, "mount" }, /* 5160 */ ++ { 2, TF, sys_umount2, "umount" }, /* 5161 */ ++ { 1, TF, sys_swapon, "swapon" }, /* 5162 */ ++ { 1, 0, sys_swapoff, "swapoff" }, /* 5163 */ ++ { 3, 0, sys_reboot, "reboot" }, /* 5164 */ ++ { 2, 0, sys_sethostname, "sethostname" }, /* 5165 */ ++ { 2, 0, sys_setdomainname, "setdomainname" }, /* 5166 */ ++ { 2, 0, sys_create_module, "create_module" }, /* 5167 */ ++ { 4, 0, sys_init_module, "init_module" }, /* 5168 */ ++ { 1, 0, sys_delete_module, "delete_module" }, /* 5169 */ ++ { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 5170 */ ++ { 5, 0, sys_query_module, "query_module" }, /* 5171 */ ++ { 4, 0, sys_quotactl, "quotactl" }, /* 5172 */ ++ { 3, 0, printargs, "nfsservctl" }, /* 5173 */ ++ { 5, TN, printargs, "getpmsg" }, /* 5174 */ ++ { 5, TN, printargs, "putpmsg" }, /* 5175 */ ++ { 0, 0, sys_afs_syscall, "afs_syscall" }, /* 5176 */ ++ { 0, 0, printargs, "reserved177" }, /* 5177 */ ++ { 0, 0, printargs, "gettid" }, /* 5178 */ ++ { 3, 0, sys_readahead, "readahead" }, /* 5179 */ ++ { 5, 0, sys_setxattr, "setxattr" }, /* 5180 */ ++ { 5, 0, sys_setxattr, "lsetxattr" }, /* 5181 */ ++ { 5, 0, sys_fsetxattr, "fsetxattr" }, /* 5182 */ ++ { 4, 0, sys_getxattr, "getxattr" }, /* 5183 */ ++ { 4, 0, sys_getxattr, "lgetxattr" }, /* 5184 */ ++ { 4, 0, sys_fgetxattr, "fgetxattr" }, /* 5185 */ ++ { 3, 0, sys_listxattr, "listxattr" }, /* 5186 */ ++ { 3, 0, sys_listxattr, "llistxattr" }, /* 5187 */ ++ { 3, 0, sys_flistxattr, "flistxattr" }, /* 5188 */ ++ { 2, 0, sys_removexattr, "removexattr" }, /* 5189 */ ++ { 2, 0, sys_removexattr, "lremovexattr" }, /* 5190 */ ++ { 2, 0, sys_fremovexattr, "fremovexattr" }, /* 5191 */ ++ { 2, 0, sys_kill, "tkill" }, /* 5192 */ ++ { 1, 0, sys_time, "time" }, /* 5193 */ ++ { 5, 0, printargs, "futex" }, /* 5194 */ ++ { 3, 0, printargs, "sched_setaffinity"}, /* 5195 */ ++ { 3, 0, printargs, "sched_getaffinity"}, /* 5196 */ ++ { 3, 0, printargs, "cacheflush" }, /* 5197 */ ++ { 3, 0, printargs, "cachectl" }, /* 5198 */ ++ { 4, 0, sys_sysmips, "sysmips" }, /* 5199 */ ++ { 0, 0, printargs, "SYS_5200" }, /* 5200 */ ++ { 0, 0, printargs, "SYS_5201" }, /* 5201 */ ++ { 0, 0, printargs, "SYS_5202" }, /* 5202 */ ++ { 0, 0, printargs, "SYS_5203" }, /* 5203 */ ++ { 0, 0, printargs, "SYS_5204" }, /* 5204 */ ++ { 1, TP, sys_exit, "exit_group" }, /* 5205 */ ++ { 0, 0, printargs, "SYS_5206" }, /* 5206 */ ++ { 0, 0, printargs, "SYS_5207" }, /* 5207 */ ++ { 0, 0, printargs, "SYS_5208" }, /* 5208 */ ++ { 0, 0, printargs, "SYS_5209" }, /* 5209 */ ++ { 0, 0, printargs, "SYS_5210" }, /* 5210 */ ++ { 1, TS, printargs, "rt_sigreturn" }, /* 5211 */ ++ { 5, 0, printargs, "timer_create" }, /* 5212 */ ++ { 5, 0, printargs, "timer_settime" }, /* 5213 */ ++ { 5, 0, printargs, "timer_gettime" }, /* 5214 */ ++ { 5, 0, printargs, "timer_getoverrun"}, /* 5215 */ ++ { 5, 0, printargs, "timer_delete" }, /* 5216 */ ++ { 5, 0, printargs, "clock_settime" }, /* 5217 */ ++ { 5, 0, printargs, "clock_gettime" }, /* 5218 */ ++ { 5, 0, printargs, "clock_getres" }, /* 5219 */ ++ { 5, 0, printargs, "clock_nanosleep"}, /* 5220 */ ++#else ++ { 0, 0, printargs, "n64_read" }, /* 5000 */ ++ { 0, 0, printargs, "n64_write" }, /* 5001 */ ++ { 0, 0, printargs, "n64_open" }, /* 5002 */ ++ { 0, 0, printargs, "n64_close" }, /* 5003 */ ++ { 0, 0, printargs, "n64_stat" }, /* 5004 */ ++ { 0, 0, printargs, "n64_fstat" }, /* 5005 */ ++ { 0, 0, printargs, "n64_lstat" }, /* 5006 */ ++ { 0, 0, printargs, "n64_poll" }, /* 5007 */ ++ { 0, 0, printargs, "n64_lseek" }, /* 5008 */ ++ { 0, 0, printargs, "n64_mmap" }, /* 5009 */ ++ { 0, 0, printargs, "n64_mprotect" }, /* 5010 */ ++ { 0, 0, printargs, "n64_munmap" }, /* 5011 */ ++ { 0, 0, printargs, "n64_brk" }, /* 5012 */ ++ { 0, 0, printargs, "n64_rt_sigaction" }, /* 5013 */ ++ { 0, 0, printargs, "n64_rt_sigprocmask" }, /* 5014 */ ++ { 0, 0, printargs, "n64_ioctl" }, /* 5015 */ ++ { 0, 0, printargs, "n64_pread" }, /* 5016 */ ++ { 0, 0, printargs, "n64_pwrite" }, /* 5017 */ ++ { 0, 0, printargs, "n64_readv" }, /* 5018 */ ++ { 0, 0, printargs, "n64_writev" }, /* 5019 */ ++ { 0, 0, printargs, "n64_access" }, /* 5020 */ ++ { 0, 0, printargs, "n64_pipe" }, /* 5021 */ ++ { 0, 0, printargs, "n64__newselect" }, /* 5022 */ ++ { 0, 0, printargs, "n64_sched_yield" }, /* 5023 */ ++ { 0, 0, printargs, "n64_mremap" }, /* 5024 */ ++ { 0, 0, printargs, "n64_msync" }, /* 5025 */ ++ { 0, 0, printargs, "n64_mincore" }, /* 5026 */ ++ { 0, 0, printargs, "n64_madvise" }, /* 5027 */ ++ { 0, 0, printargs, "n64_shmget" }, /* 5028 */ ++ { 0, 0, printargs, "n64_shmgat" }, /* 5029 */ ++ { 0, 0, printargs, "n64_shmctl" }, /* 5030 */ ++ { 0, 0, printargs, "n64_dup" }, /* 5031 */ ++ { 0, 0, printargs, "n64_dup2" }, /* 5032 */ ++ { 0, 0, printargs, "n64_pause" }, /* 5033 */ ++ { 0, 0, printargs, "n64_nanosleep" }, /* 5034 */ ++ { 0, 0, printargs, "n64_getitimer" }, /* 5035 */ ++ { 0, 0, printargs, "n64_setitimer" }, /* 5036 */ ++ { 0, 0, printargs, "n64_alarm" }, /* 5037 */ ++ { 0, 0, printargs, "n64_getpid" }, /* 5038 */ ++ { 0, 0, printargs, "n64_sendfile" }, /* 5039 */ ++ { 0, 0, printargs, "n64_socketcall" }, /* 5040 */ ++ { 0, 0, printargs, "n64_connect" }, /* 5041 */ ++ { 0, 0, printargs, "n64_accept" }, /* 5042 */ ++ { 0, 0, printargs, "n64_sendto" }, /* 5043 */ ++ { 0, 0, printargs, "n64_recvfrom" }, /* 5044 */ ++ { 0, 0, printargs, "n64_sendmsg" }, /* 5045 */ ++ { 0, 0, printargs, "n64_recvmsg" }, /* 5046 */ ++ { 0, 0, printargs, "n64_shutdown" }, /* 5047 */ ++ { 0, 0, printargs, "n64_bind" }, /* 5048 */ ++ { 0, 0, printargs, "n64_listen" }, /* 5049 */ ++ { 0, 0, printargs, "n64_getsockname" }, /* 5050 */ ++ { 0, 0, printargs, "n64_getpeername" }, /* 5051 */ ++ { 0, 0, printargs, "n64_socketpair" }, /* 5052 */ ++ { 0, 0, printargs, "n64_setsockopt" }, /* 5053 */ ++ { 0, 0, printargs, "n64_getsockopt" }, /* 5054 */ ++ { 0, 0, printargs, "n64_clone" }, /* 5055 */ ++ { 0, 0, printargs, "n64_fork" }, /* 5056 */ ++ { 0, 0, printargs, "n64_execve" }, /* 5057 */ ++ { 0, 0, printargs, "n64_exit" }, /* 5058 */ ++ { 0, 0, printargs, "n64_wait4" }, /* 5059 */ ++ { 0, 0, printargs, "n64_kill" }, /* 5060 */ ++ { 0, 0, printargs, "n64_uname" }, /* 5061 */ ++ { 0, 0, printargs, "n64_semget" }, /* 5062 */ ++ { 0, 0, printargs, "n64_semop" }, /* 5063 */ ++ { 0, 0, printargs, "n64_semctl" }, /* 5064 */ ++ { 0, 0, printargs, "n64_shmdt" }, /* 5065 */ ++ { 0, 0, printargs, "n64_msgget" }, /* 5066 */ ++ { 0, 0, printargs, "n64_msgsnd" }, /* 5067 */ ++ { 0, 0, printargs, "n64_msgrcv" }, /* 5068 */ ++ { 0, 0, printargs, "n64_msgctl" }, /* 5069 */ ++ { 0, 0, printargs, "n64_fcntl" }, /* 5070 */ ++ { 0, 0, printargs, "n64_flock" }, /* 5071 */ ++ { 0, 0, printargs, "n64_fsync" }, /* 5072 */ ++ { 0, 0, printargs, "n64_fdatasync" }, /* 5073 */ ++ { 0, 0, printargs, "n64_truncate" }, /* 5074 */ ++ { 0, 0, printargs, "n64_ftruncate" }, /* 5075 */ ++ { 0, 0, printargs, "n64_getdents" }, /* 5076 */ ++ { 0, 0, printargs, "n64_getcwd" }, /* 5077 */ ++ { 0, 0, printargs, "n64_chdir" }, /* 5078 */ ++ { 0, 0, printargs, "n64_fchdir" }, /* 5079 */ ++ { 0, 0, printargs, "n64_rename" }, /* 5080 */ ++ { 0, 0, printargs, "n64_mkdir" }, /* 5081 */ ++ { 0, 0, printargs, "n64_rmdir" }, /* 5082 */ ++ { 0, 0, printargs, "n64_creat" }, /* 5083 */ ++ { 0, 0, printargs, "n64_link" }, /* 5084 */ ++ { 0, 0, printargs, "n64_unlink" }, /* 5085 */ ++ { 0, 0, printargs, "n64_symlink" }, /* 5086 */ ++ { 0, 0, printargs, "n64_readlink" }, /* 5087 */ ++ { 0, 0, printargs, "n64_chmod" }, /* 5088 */ ++ { 0, 0, printargs, "n64_fchmod" }, /* 5089 */ ++ { 0, 0, printargs, "n64_chown" }, /* 5090 */ ++ { 0, 0, printargs, "n64_fchown" }, /* 5091 */ ++ { 0, 0, printargs, "n64_lchown" }, /* 5092 */ ++ { 0, 0, printargs, "n64_umask" }, /* 5093 */ ++ { 0, 0, printargs, "n64_gettimeofday" }, /* 5094 */ ++ { 0, 0, printargs, "n64_getrlimit" }, /* 5095 */ ++ { 0, 0, printargs, "n64_getrusage" }, /* 5096 */ ++ { 0, 0, printargs, "n64_sysinfo" }, /* 5097 */ ++ { 0, 0, printargs, "n64_times" }, /* 5098 */ ++ { 0, 0, printargs, "n64_ptrace" }, /* 5099 */ ++ { 0, 0, printargs, "n64_getuid" }, /* 5100 */ ++ { 0, 0, printargs, "n64_syslog" }, /* 5101 */ ++ { 0, 0, printargs, "n64_getgid" }, /* 5102 */ ++ { 0, 0, printargs, "n64_setuid" }, /* 5103 */ ++ { 0, 0, printargs, "n64_setgid" }, /* 5104 */ ++ { 0, 0, printargs, "n64_geteuid" }, /* 5105 */ ++ { 0, 0, printargs, "n64_getegid" }, /* 5106 */ ++ { 0, 0, printargs, "n64_setpgid" }, /* 5107 */ ++ { 0, 0, printargs, "n64_getppid" }, /* 5108 */ ++ { 0, 0, printargs, "n64_getpgrp" }, /* 5109 */ ++ { 0, 0, printargs, "n64_setsid" }, /* 5110 */ ++ { 0, 0, printargs, "n64_setreuid" }, /* 5111 */ ++ { 0, 0, printargs, "n64_setregid" }, /* 5112 */ ++ { 0, 0, printargs, "n64_getgroups" }, /* 5113 */ ++ { 0, 0, printargs, "n64_setgroups" }, /* 5114 */ ++ { 0, 0, printargs, "n64_setresuid" }, /* 5115 */ ++ { 0, 0, printargs, "n64_getresuid" }, /* 5116 */ ++ { 0, 0, printargs, "n64_setresgid" }, /* 5117 */ ++ { 0, 0, printargs, "n64_getresgid" }, /* 5118 */ ++ { 0, 0, printargs, "n64_getpgid" }, /* 5119 */ ++ { 0, 0, printargs, "n64_setfsuid" }, /* 5120 */ ++ { 0, 0, printargs, "n64_setfsgid" }, /* 5121 */ ++ { 0, 0, printargs, "n64_getsid" }, /* 5122 */ ++ { 0, 0, printargs, "n64_capget" }, /* 5123 */ ++ { 0, 0, printargs, "n64_capset" }, /* 5124 */ ++ { 0, 0, printargs, "n64_rt_sigpending" }, /* 5125 */ ++ { 0, 0, printargs, "n64_rt_sigtimedwait" }, /* 5126 */ ++ { 0, 0, printargs, "n64_rt_sigqueueinfo" }, /* 5127 */ ++ { 0, 0, printargs, "n64_rt_siguspend" }, /* 5128 */ ++ { 0, 0, printargs, "n64_sigaltstatck" }, /* 5129 */ ++ { 0, 0, printargs, "n64_utime" }, /* 5130 */ ++ { 0, 0, printargs, "n64_mknod" }, /* 5131 */ ++ { 0, 0, printargs, "n64_personality" }, /* 5132 */ ++ { 0, 0, printargs, "n64_ustat" }, /* 5133 */ ++ { 0, 0, printargs, "n64_statfs" }, /* 5134 */ ++ { 0, 0, printargs, "n64_fstatfs" }, /* 5135 */ ++ { 0, 0, printargs, "n64_sysfs" }, /* 5136 */ ++ { 0, 0, printargs, "n64_getpriority" }, /* 5137 */ ++ { 0, 0, printargs, "n64_setpriority" }, /* 5138 */ ++ { 0, 0, printargs, "n64_sched_setparam" }, /* 5139 */ ++ { 0, 0, printargs, "n64_sched_getparam" }, /* 5140 */ ++ { 0, 0, printargs, "n64_sched_setscheduler"}, /* 5141 */ ++ { 0, 0, printargs, "n64_sched_getscheduler"}, /* 5142 */ ++ { 0, 0, printargs, "n64_sched_get_priority_max"}, /* 5143 */ ++ { 0, 0, printargs, "n64_sched_get_priority_min"}, /* 5144 */ ++ { 0, 0, printargs, "n64_sched_rr_get_interval"}, /* 5145 */ ++ { 0, 0, printargs, "n64_mlock" }, /* 5146 */ ++ { 0, 0, printargs, "n64_munlock" }, /* 5147 */ ++ { 0, 0, printargs, "n64_mlockall" }, /* 5148 */ ++ { 0, 0, printargs, "n64_munlockall" }, /* 5149 */ ++ { 0, 0, printargs, "n64_vhangup" }, /* 5150 */ ++ { 0, 0, printargs, "n64_pivot_root" }, /* 5151 */ ++ { 0, 0, printargs, "n64__sysctl" }, /* 5152 */ ++ { 0, 0, printargs, "n64_prctl" }, /* 5153 */ ++ { 0, 0, printargs, "n64_adjtimex" }, /* 5154 */ ++ { 0, 0, printargs, "n64_setrlimit" }, /* 5155 */ ++ { 0, 0, printargs, "n64_chroot" }, /* 5156 */ ++ { 0, 0, printargs, "n64_sync" }, /* 5157 */ ++ { 0, 0, printargs, "n64_acct" }, /* 5158 */ ++ { 0, 0, printargs, "n64_settimeofday" }, /* 5159 */ ++ { 0, 0, printargs, "n64_mount" }, /* 5160 */ ++ { 0, 0, printargs, "n64_umount" }, /* 5161 */ ++ { 0, 0, printargs, "n64_swapon" }, /* 5162 */ ++ { 0, 0, printargs, "n64_swapoff" }, /* 5163 */ ++ { 0, 0, printargs, "n64_reboot" }, /* 5164 */ ++ { 0, 0, printargs, "n64_sethostname" }, /* 5165 */ ++ { 0, 0, printargs, "n64_setdomainname" }, /* 5166 */ ++ { 0, 0, printargs, "n64_create_module" }, /* 5167 */ ++ { 0, 0, printargs, "n64_init_module" }, /* 5168 */ ++ { 0, 0, printargs, "n64_delete_module" }, /* 5169 */ ++ { 0, 0, printargs, "n64_get_kernel_syms" }, /* 5170 */ ++ { 0, 0, printargs, "n64_query_module" }, /* 5171 */ ++ { 0, 0, printargs, "n64_quotactl" }, /* 5172 */ ++ { 0, 0, printargs, "n64_nfsservctl" }, /* 5173 */ ++ { 0, 0, printargs, "n64_getpmsg" }, /* 5174 */ ++ { 0, 0, printargs, "n64_putpmsg" }, /* 5175 */ ++ { 0, 0, printargs, "n64_afs_syscall" }, /* 5176 */ ++ { 0, 0, printargs, "n64_reserved177" }, /* 5177 */ ++ { 0, 0, printargs, "n64_gettid" }, /* 5178 */ ++ { 0, 0, printargs, "n64_readahead" }, /* 5179 */ ++ { 0, 0, printargs, "n64_setxattr" }, /* 5180 */ ++ { 0, 0, printargs, "n64_lsetxattr" }, /* 5181 */ ++ { 0, 0, printargs, "n64_fsetxattr" }, /* 5182 */ ++ { 0, 0, printargs, "n64_getxattr" }, /* 5183 */ ++ { 0, 0, printargs, "n64_lgetxattr" }, /* 5184 */ ++ { 0, 0, printargs, "n64_fgetxattr" }, /* 5185 */ ++ { 0, 0, printargs, "n64_listxattr" }, /* 5186 */ ++ { 0, 0, printargs, "n64_llistxattr" }, /* 5187 */ ++ { 0, 0, printargs, "n64_flistxattr" }, /* 5188 */ ++ { 0, 0, printargs, "n64_removexattr" }, /* 5189 */ ++ { 0, 0, printargs, "n64_lremovexattr" }, /* 5190 */ ++ { 0, 0, printargs, "n64_fremovexattr" }, /* 5191 */ ++ { 0, 0, printargs, "n64_tkill" }, /* 5192 */ ++ { 0, 0, printargs, "n64_time" }, /* 5193 */ ++ { 0, 0, printargs, "n64_futex" }, /* 5194 */ ++ { 0, 0, printargs, "n64_sched_setaffinity" }, /* 5195 */ ++ { 0, 0, printargs, "n64_sched_getaffinity" }, /* 5196 */ ++ { 0, 0, printargs, "n64_cacheflush" }, /* 5197 */ ++ { 0, 0, printargs, "n64_cachectl" }, /* 5198 */ ++ { 0, 0, printargs, "n64_sysmips" }, /* 5199 */ ++ { 0, 0, printargs, "SYS_5200" }, /* 5200 */ ++ { 0, 0, printargs, "SYS_5201" }, /* 5201 */ ++ { 0, 0, printargs, "SYS_5202" }, /* 5202 */ ++ { 0, 0, printargs, "SYS_5203" }, /* 5203 */ ++ { 0, 0, printargs, "SYS_5204" }, /* 5204 */ ++ { 1, TP, printargs, "n64_exit_group" }, /* 5205 */ ++ { 0, 0, printargs, "SYS_5206" }, /* 5206 */ ++ { 0, 0, printargs, "SYS_5207" }, /* 5207 */ ++ { 0, 0, printargs, "SYS_5208" }, /* 5208 */ ++ { 0, 0, printargs, "SYS_5209" }, /* 5209 */ ++ { 0, 0, printargs, "SYS_5210" }, /* 5210 */ ++ { 0, 0, printargs, "n64_rt_sigreturn" }, /* 5211 */ ++ { 5, 0, printargs, "n64_timer_create" }, /* 5212 */ ++ { 5, 0, printargs, "n64_timer_settime" }, /* 5213 */ ++ { 5, 0, printargs, "n64_timer_gettime" }, /* 5214 */ ++ { 5, 0, printargs, "n64_timer_getoverrun"}, /* 5215 */ ++ { 5, 0, printargs, "n64_timer_delete" }, /* 5216 */ ++ { 5, 0, printargs, "n64_clock_settime" }, /* 5217 */ ++ { 5, 0, printargs, "n64_clock_gettime" }, /* 5218 */ ++ { 5, 0, printargs, "n64_clock_getres" }, /* 5219 */ ++ { 5, 0, printargs, "n64_clock_nanosleep"}, /* 5220 */ ++#endif ++ { 0, 0, printargs, "SYS_5221" }, /* 5221 */ ++ { 0, 0, printargs, "SYS_5222" }, /* 5222 */ ++ { 0, 0, printargs, "SYS_5223" }, /* 5223 */ ++ { 0, 0, printargs, "SYS_5224" }, /* 5224 */ ++ { 0, 0, printargs, "SYS_5225" }, /* 5225 */ ++ { 0, 0, printargs, "SYS_5226" }, /* 5226 */ ++ { 0, 0, printargs, "SYS_5227" }, /* 5227 */ ++ { 0, 0, printargs, "SYS_5228" }, /* 5228 */ ++ { 0, 0, printargs, "SYS_5229" }, /* 5229 */ ++ { 0, 0, printargs, "SYS_5230" }, /* 5230 */ ++ { 0, 0, printargs, "SYS_5231" }, /* 5231 */ ++ { 0, 0, printargs, "SYS_5232" }, /* 5232 */ ++ { 0, 0, printargs, "SYS_5233" }, /* 5233 */ ++ { 0, 0, printargs, "SYS_5234" }, /* 5234 */ ++ { 0, 0, printargs, "SYS_5235" }, /* 5235 */ ++ { 0, 0, printargs, "SYS_5236" }, /* 5236 */ ++ { 0, 0, printargs, "SYS_5237" }, /* 5237 */ ++ { 0, 0, printargs, "SYS_5238" }, /* 5238 */ ++ { 0, 0, printargs, "SYS_5239" }, /* 5239 */ ++ { 0, 0, printargs, "SYS_5240" }, /* 5240 */ ++ { 0, 0, printargs, "SYS_5241" }, /* 5241 */ ++ { 0, 0, printargs, "SYS_5242" }, /* 5242 */ ++ { 0, 0, printargs, "SYS_5243" }, /* 5243 */ ++ { 0, 0, printargs, "SYS_5244" }, /* 5244 */ ++ { 0, 0, printargs, "SYS_5245" }, /* 5245 */ ++ { 0, 0, printargs, "SYS_5246" }, /* 5246 */ ++ { 0, 0, printargs, "SYS_5247" }, /* 5247 */ ++ { 0, 0, printargs, "SYS_5248" }, /* 5248 */ ++ { 0, 0, printargs, "SYS_5249" }, /* 5249 */ ++ { 0, 0, printargs, "SYS_5250" }, /* 5250 */ ++ { 0, 0, printargs, "SYS_5251" }, /* 5251 */ ++ { 0, 0, printargs, "SYS_5252" }, /* 5252 */ ++ { 0, 0, printargs, "SYS_5253" }, /* 5253 */ ++ { 0, 0, printargs, "SYS_5254" }, /* 5254 */ ++ { 0, 0, printargs, "SYS_5255" }, /* 5255 */ ++ { 0, 0, printargs, "SYS_5256" }, /* 5256 */ ++ { 0, 0, printargs, "SYS_5257" }, /* 5257 */ ++ { 0, 0, printargs, "SYS_5258" }, /* 5258 */ ++ { 0, 0, printargs, "SYS_5259" }, /* 5259 */ ++ { 0, 0, printargs, "SYS_5260" }, /* 5260 */ ++ { 0, 0, printargs, "SYS_5261" }, /* 5261 */ ++ { 0, 0, printargs, "SYS_5262" }, /* 5262 */ ++ { 0, 0, printargs, "SYS_5263" }, /* 5263 */ ++ { 0, 0, printargs, "SYS_5264" }, /* 5264 */ ++ { 0, 0, printargs, "SYS_5265" }, /* 5265 */ ++ { 0, 0, printargs, "SYS_5266" }, /* 5266 */ ++ { 0, 0, printargs, "SYS_5267" }, /* 5267 */ ++ { 0, 0, printargs, "SYS_5268" }, /* 5268 */ ++ { 0, 0, printargs, "SYS_5269" }, /* 5269 */ ++ { 0, 0, printargs, "SYS_5270" }, /* 5270 */ ++ { 0, 0, printargs, "SYS_5271" }, /* 5271 */ ++ { 0, 0, printargs, "SYS_5272" }, /* 5272 */ ++ { 0, 0, printargs, "SYS_5273" }, /* 5273 */ ++ { 0, 0, printargs, "SYS_5274" }, /* 5274 */ ++ { 0, 0, printargs, "SYS_5275" }, /* 5275 */ ++ { 0, 0, printargs, "SYS_5276" }, /* 5276 */ ++ { 0, 0, printargs, "SYS_5277" }, /* 5277 */ ++ { 0, 0, printargs, "SYS_5278" }, /* 5278 */ ++ { 0, 0, printargs, "SYS_5279" }, /* 5279 */ ++ { 0, 0, printargs, "SYS_5280" }, /* 5280 */ ++ { 0, 0, printargs, "SYS_5281" }, /* 5281 */ ++ { 0, 0, printargs, "SYS_5282" }, /* 5282 */ ++ { 0, 0, printargs, "SYS_5283" }, /* 5283 */ ++ { 0, 0, printargs, "SYS_5284" }, /* 5284 */ ++ { 0, 0, printargs, "SYS_5285" }, /* 5285 */ ++ { 0, 0, printargs, "SYS_5286" }, /* 5286 */ ++ { 0, 0, printargs, "SYS_5287" }, /* 5287 */ ++ { 0, 0, printargs, "SYS_5288" }, /* 5288 */ ++ { 0, 0, printargs, "SYS_5289" }, /* 5289 */ ++ { 0, 0, printargs, "SYS_5290" }, /* 5290 */ ++ { 0, 0, printargs, "SYS_5291" }, /* 5291 */ ++ { 0, 0, printargs, "SYS_5292" }, /* 5292 */ ++ { 0, 0, printargs, "SYS_5293" }, /* 5293 */ ++ { 0, 0, printargs, "SYS_5294" }, /* 5294 */ ++ { 0, 0, printargs, "SYS_5295" }, /* 5295 */ ++ { 0, 0, printargs, "SYS_5296" }, /* 5296 */ ++ { 0, 0, printargs, "SYS_5297" }, /* 5297 */ ++ { 0, 0, printargs, "SYS_5298" }, /* 5298 */ ++ { 0, 0, printargs, "SYS_5299" }, /* 5299 */ ++ { 0, 0, printargs, "SYS_5300" }, /* 5300 */ ++ { 0, 0, printargs, "SYS_5301" }, /* 5301 */ ++ { 0, 0, printargs, "SYS_5302" }, /* 5302 */ ++ { 0, 0, printargs, "SYS_5303" }, /* 5303 */ ++ { 0, 0, printargs, "SYS_5304" }, /* 5304 */ ++ { 0, 0, printargs, "SYS_5305" }, /* 5305 */ ++ { 0, 0, printargs, "SYS_5306" }, /* 5306 */ ++ { 0, 0, printargs, "SYS_5307" }, /* 5307 */ ++ { 0, 0, printargs, "SYS_5308" }, /* 5308 */ ++ { 0, 0, printargs, "SYS_5309" }, /* 5309 */ ++ { 0, 0, printargs, "SYS_5310" }, /* 5310 */ ++ { 0, 0, printargs, "SYS_5311" }, /* 5311 */ ++ { 0, 0, printargs, "SYS_5312" }, /* 5312 */ ++ { 0, 0, printargs, "SYS_5313" }, /* 5313 */ ++ { 0, 0, printargs, "SYS_5314" }, /* 5314 */ ++ { 0, 0, printargs, "SYS_5315" }, /* 5315 */ ++ { 0, 0, printargs, "SYS_5316" }, /* 5316 */ ++ { 0, 0, printargs, "SYS_5317" }, /* 5317 */ ++ { 0, 0, printargs, "SYS_5318" }, /* 5318 */ ++ { 0, 0, printargs, "SYS_5319" }, /* 5319 */ ++ { 0, 0, printargs, "SYS_5320" }, /* 5320 */ ++ { 0, 0, printargs, "SYS_5321" }, /* 5321 */ ++ { 0, 0, printargs, "SYS_5322" }, /* 5322 */ ++ { 0, 0, printargs, "SYS_5323" }, /* 5323 */ ++ { 0, 0, printargs, "SYS_5324" }, /* 5324 */ ++ { 0, 0, printargs, "SYS_5325" }, /* 5325 */ ++ { 0, 0, printargs, "SYS_5326" }, /* 5326 */ ++ { 0, 0, printargs, "SYS_5327" }, /* 5327 */ ++ { 0, 0, printargs, "SYS_5328" }, /* 5328 */ ++ { 0, 0, printargs, "SYS_5329" }, /* 5329 */ ++ { 0, 0, printargs, "SYS_5330" }, /* 5330 */ ++ { 0, 0, printargs, "SYS_5331" }, /* 5331 */ ++ { 0, 0, printargs, "SYS_5332" }, /* 5332 */ ++ { 0, 0, printargs, "SYS_5333" }, /* 5333 */ ++ { 0, 0, printargs, "SYS_5334" }, /* 5334 */ ++ { 0, 0, printargs, "SYS_5335" }, /* 5335 */ ++ { 0, 0, printargs, "SYS_5336" }, /* 5336 */ ++ { 0, 0, printargs, "SYS_5337" }, /* 5337 */ ++ { 0, 0, printargs, "SYS_5338" }, /* 5338 */ ++ { 0, 0, printargs, "SYS_5339" }, /* 5339 */ ++ { 0, 0, printargs, "SYS_5340" }, /* 5340 */ ++ { 0, 0, printargs, "SYS_5341" }, /* 5341 */ ++ { 0, 0, printargs, "SYS_5342" }, /* 5342 */ ++ { 0, 0, printargs, "SYS_5343" }, /* 5343 */ ++ { 0, 0, printargs, "SYS_5344" }, /* 5344 */ ++ { 0, 0, printargs, "SYS_5345" }, /* 5345 */ ++ { 0, 0, printargs, "SYS_5346" }, /* 5346 */ ++ { 0, 0, printargs, "SYS_5347" }, /* 5347 */ ++ { 0, 0, printargs, "SYS_5348" }, /* 5348 */ ++ { 0, 0, printargs, "SYS_5349" }, /* 5349 */ ++ { 0, 0, printargs, "SYS_5350" }, /* 5350 */ ++ { 0, 0, printargs, "SYS_5351" }, /* 5351 */ ++ { 0, 0, printargs, "SYS_5352" }, /* 5352 */ ++ { 0, 0, printargs, "SYS_5353" }, /* 5353 */ ++ { 0, 0, printargs, "SYS_5354" }, /* 5354 */ ++ { 0, 0, printargs, "SYS_5355" }, /* 5355 */ ++ { 0, 0, printargs, "SYS_5356" }, /* 5356 */ ++ { 0, 0, printargs, "SYS_5357" }, /* 5357 */ ++ { 0, 0, printargs, "SYS_5358" }, /* 5358 */ ++ { 0, 0, printargs, "SYS_5359" }, /* 5359 */ ++ { 0, 0, printargs, "SYS_5360" }, /* 5360 */ ++ { 0, 0, printargs, "SYS_5361" }, /* 5361 */ ++ { 0, 0, printargs, "SYS_5362" }, /* 5362 */ ++ { 0, 0, printargs, "SYS_5363" }, /* 5363 */ ++ { 0, 0, printargs, "SYS_5364" }, /* 5364 */ ++ { 0, 0, printargs, "SYS_5365" }, /* 5365 */ ++ { 0, 0, printargs, "SYS_5366" }, /* 5366 */ ++ { 0, 0, printargs, "SYS_5367" }, /* 5367 */ ++ { 0, 0, printargs, "SYS_5368" }, /* 5368 */ ++ { 0, 0, printargs, "SYS_5369" }, /* 5369 */ ++ { 0, 0, printargs, "SYS_5370" }, /* 5370 */ ++ { 0, 0, printargs, "SYS_5371" }, /* 5371 */ ++ { 0, 0, printargs, "SYS_5372" }, /* 5372 */ ++ { 0, 0, printargs, "SYS_5373" }, /* 5373 */ ++ { 0, 0, printargs, "SYS_5374" }, /* 5374 */ ++ { 0, 0, printargs, "SYS_5375" }, /* 5375 */ ++ { 0, 0, printargs, "SYS_5376" }, /* 5376 */ ++ { 0, 0, printargs, "SYS_5377" }, /* 5377 */ ++ { 0, 0, printargs, "SYS_5378" }, /* 5378 */ ++ { 0, 0, printargs, "SYS_5379" }, /* 5379 */ ++ { 0, 0, printargs, "SYS_5380" }, /* 5380 */ ++ { 0, 0, printargs, "SYS_5381" }, /* 5381 */ ++ { 0, 0, printargs, "SYS_5382" }, /* 5382 */ ++ { 0, 0, printargs, "SYS_5383" }, /* 5383 */ ++ { 0, 0, printargs, "SYS_5384" }, /* 5384 */ ++ { 0, 0, printargs, "SYS_5385" }, /* 5385 */ ++ { 0, 0, printargs, "SYS_5386" }, /* 5386 */ ++ { 0, 0, printargs, "SYS_5387" }, /* 5387 */ ++ { 0, 0, printargs, "SYS_5388" }, /* 5388 */ ++ { 0, 0, printargs, "SYS_5389" }, /* 5389 */ ++ { 0, 0, printargs, "SYS_5390" }, /* 5390 */ ++ { 0, 0, printargs, "SYS_5391" }, /* 5391 */ ++ { 0, 0, printargs, "SYS_5392" }, /* 5392 */ ++ { 0, 0, printargs, "SYS_5393" }, /* 5393 */ ++ { 0, 0, printargs, "SYS_5394" }, /* 5394 */ ++ { 0, 0, printargs, "SYS_5395" }, /* 5395 */ ++ { 0, 0, printargs, "SYS_5396" }, /* 5396 */ ++ { 0, 0, printargs, "SYS_5397" }, /* 5397 */ ++ { 0, 0, printargs, "SYS_5398" }, /* 5398 */ ++ { 0, 0, printargs, "SYS_5399" }, /* 5399 */ ++ { 0, 0, printargs, "SYS_5400" }, /* 5400 */ ++ { 0, 0, printargs, "SYS_5401" }, /* 5401 */ ++ { 0, 0, printargs, "SYS_5402" }, /* 5402 */ ++ { 0, 0, printargs, "SYS_5403" }, /* 5403 */ ++ { 0, 0, printargs, "SYS_5404" }, /* 5404 */ ++ { 0, 0, printargs, "SYS_5405" }, /* 5405 */ ++ { 0, 0, printargs, "SYS_5406" }, /* 5406 */ ++ { 0, 0, printargs, "SYS_5407" }, /* 5407 */ ++ { 0, 0, printargs, "SYS_5408" }, /* 5408 */ ++ { 0, 0, printargs, "SYS_5409" }, /* 5409 */ ++ { 0, 0, printargs, "SYS_5410" }, /* 5410 */ ++ { 0, 0, printargs, "SYS_5411" }, /* 5411 */ ++ { 0, 0, printargs, "SYS_5412" }, /* 5412 */ ++ { 0, 0, printargs, "SYS_5413" }, /* 5413 */ ++ { 0, 0, printargs, "SYS_5414" }, /* 5414 */ ++ { 0, 0, printargs, "SYS_5415" }, /* 5415 */ ++ { 0, 0, printargs, "SYS_5416" }, /* 5416 */ ++ { 0, 0, printargs, "SYS_5417" }, /* 5417 */ ++ { 0, 0, printargs, "SYS_5418" }, /* 5418 */ ++ { 0, 0, printargs, "SYS_5419" }, /* 5419 */ ++ { 0, 0, printargs, "SYS_5420" }, /* 5420 */ ++ { 0, 0, printargs, "SYS_5421" }, /* 5421 */ ++ { 0, 0, printargs, "SYS_5422" }, /* 5422 */ ++ { 0, 0, printargs, "SYS_5423" }, /* 5423 */ ++ { 0, 0, printargs, "SYS_5424" }, /* 5424 */ ++ { 0, 0, printargs, "SYS_5425" }, /* 5425 */ ++ { 0, 0, printargs, "SYS_5426" }, /* 5426 */ ++ { 0, 0, printargs, "SYS_5427" }, /* 5427 */ ++ { 0, 0, printargs, "SYS_5428" }, /* 5428 */ ++ { 0, 0, printargs, "SYS_5429" }, /* 5429 */ ++ { 0, 0, printargs, "SYS_5430" }, /* 5430 */ ++ { 0, 0, printargs, "SYS_5431" }, /* 5431 */ ++ { 0, 0, printargs, "SYS_5432" }, /* 5432 */ ++ { 0, 0, printargs, "SYS_5433" }, /* 5433 */ ++ { 0, 0, printargs, "SYS_5434" }, /* 5434 */ ++ { 0, 0, printargs, "SYS_5435" }, /* 5435 */ ++ { 0, 0, printargs, "SYS_5436" }, /* 5436 */ ++ { 0, 0, printargs, "SYS_5437" }, /* 5437 */ ++ { 0, 0, printargs, "SYS_5438" }, /* 5438 */ ++ { 0, 0, printargs, "SYS_5439" }, /* 5439 */ ++ { 0, 0, printargs, "SYS_5440" }, /* 5440 */ ++ { 0, 0, printargs, "SYS_5441" }, /* 5441 */ ++ { 0, 0, printargs, "SYS_5442" }, /* 5442 */ ++ { 0, 0, printargs, "SYS_5443" }, /* 5443 */ ++ { 0, 0, printargs, "SYS_5444" }, /* 5444 */ ++ { 0, 0, printargs, "SYS_5445" }, /* 5445 */ ++ { 0, 0, printargs, "SYS_5446" }, /* 5446 */ ++ { 0, 0, printargs, "SYS_5447" }, /* 5447 */ ++ { 0, 0, printargs, "SYS_5448" }, /* 5448 */ ++ { 0, 0, printargs, "SYS_5449" }, /* 5449 */ ++ { 0, 0, printargs, "SYS_5450" }, /* 5450 */ ++ { 0, 0, printargs, "SYS_5451" }, /* 5451 */ ++ { 0, 0, printargs, "SYS_5452" }, /* 5452 */ ++ { 0, 0, printargs, "SYS_5453" }, /* 5453 */ ++ { 0, 0, printargs, "SYS_5454" }, /* 5454 */ ++ { 0, 0, printargs, "SYS_5455" }, /* 5455 */ ++ { 0, 0, printargs, "SYS_5456" }, /* 5456 */ ++ { 0, 0, printargs, "SYS_5457" }, /* 5457 */ ++ { 0, 0, printargs, "SYS_5458" }, /* 5458 */ ++ { 0, 0, printargs, "SYS_5459" }, /* 5459 */ ++ { 0, 0, printargs, "SYS_5460" }, /* 5460 */ ++ { 0, 0, printargs, "SYS_5461" }, /* 5461 */ ++ { 0, 0, printargs, "SYS_5462" }, /* 5462 */ ++ { 0, 0, printargs, "SYS_5463" }, /* 5463 */ ++ { 0, 0, printargs, "SYS_5464" }, /* 5464 */ ++ { 0, 0, printargs, "SYS_5465" }, /* 5465 */ ++ { 0, 0, printargs, "SYS_5466" }, /* 5466 */ ++ { 0, 0, printargs, "SYS_5467" }, /* 5467 */ ++ { 0, 0, printargs, "SYS_5468" }, /* 5468 */ ++ { 0, 0, printargs, "SYS_5469" }, /* 5469 */ ++ { 0, 0, printargs, "SYS_5470" }, /* 5470 */ ++ { 0, 0, printargs, "SYS_5471" }, /* 5471 */ ++ { 0, 0, printargs, "SYS_5472" }, /* 5472 */ ++ { 0, 0, printargs, "SYS_5473" }, /* 5473 */ ++ { 0, 0, printargs, "SYS_5474" }, /* 5474 */ ++ { 0, 0, printargs, "SYS_5475" }, /* 5475 */ ++ { 0, 0, printargs, "SYS_5476" }, /* 5476 */ ++ { 0, 0, printargs, "SYS_5477" }, /* 5477 */ ++ { 0, 0, printargs, "SYS_5478" }, /* 5478 */ ++ { 0, 0, printargs, "SYS_5479" }, /* 5479 */ ++ { 0, 0, printargs, "SYS_5480" }, /* 5480 */ ++ { 0, 0, printargs, "SYS_5481" }, /* 5481 */ ++ { 0, 0, printargs, "SYS_5482" }, /* 5482 */ ++ { 0, 0, printargs, "SYS_5483" }, /* 5483 */ ++ { 0, 0, printargs, "SYS_5484" }, /* 5484 */ ++ { 0, 0, printargs, "SYS_5485" }, /* 5485 */ ++ { 0, 0, printargs, "SYS_5486" }, /* 5486 */ ++ { 0, 0, printargs, "SYS_5487" }, /* 5487 */ ++ { 0, 0, printargs, "SYS_5488" }, /* 5488 */ ++ { 0, 0, printargs, "SYS_5489" }, /* 5489 */ ++ { 0, 0, printargs, "SYS_5490" }, /* 5490 */ ++ { 0, 0, printargs, "SYS_5491" }, /* 5491 */ ++ { 0, 0, printargs, "SYS_5492" }, /* 5492 */ ++ { 0, 0, printargs, "SYS_5493" }, /* 5493 */ ++ { 0, 0, printargs, "SYS_5494" }, /* 5494 */ ++ { 0, 0, printargs, "SYS_5495" }, /* 5495 */ ++ { 0, 0, printargs, "SYS_5496" }, /* 5496 */ ++ { 0, 0, printargs, "SYS_5497" }, /* 5497 */ ++ { 0, 0, printargs, "SYS_5498" }, /* 5498 */ ++ { 0, 0, printargs, "SYS_5499" }, /* 5499 */ ++ { 0, 0, printargs, "SYS_5500" }, /* 5500 */ ++ { 0, 0, printargs, "SYS_5501" }, /* 5501 */ ++ { 0, 0, printargs, "SYS_5502" }, /* 5502 */ ++ { 0, 0, printargs, "SYS_5503" }, /* 5503 */ ++ { 0, 0, printargs, "SYS_5504" }, /* 5504 */ ++ { 0, 0, printargs, "SYS_5505" }, /* 5505 */ ++ { 0, 0, printargs, "SYS_5506" }, /* 5506 */ ++ { 0, 0, printargs, "SYS_5507" }, /* 5507 */ ++ { 0, 0, printargs, "SYS_5508" }, /* 5508 */ ++ { 0, 0, printargs, "SYS_5509" }, /* 5509 */ ++ { 0, 0, printargs, "SYS_5510" }, /* 5510 */ ++ { 0, 0, printargs, "SYS_5511" }, /* 5511 */ ++ { 0, 0, printargs, "SYS_5512" }, /* 5512 */ ++ { 0, 0, printargs, "SYS_5513" }, /* 5513 */ ++ { 0, 0, printargs, "SYS_5514" }, /* 5514 */ ++ { 0, 0, printargs, "SYS_5515" }, /* 5515 */ ++ { 0, 0, printargs, "SYS_5516" }, /* 5516 */ ++ { 0, 0, printargs, "SYS_5517" }, /* 5517 */ ++ { 0, 0, printargs, "SYS_5518" }, /* 5518 */ ++ { 0, 0, printargs, "SYS_5519" }, /* 5519 */ ++ { 0, 0, printargs, "SYS_5520" }, /* 5520 */ ++ { 0, 0, printargs, "SYS_5521" }, /* 5521 */ ++ { 0, 0, printargs, "SYS_5522" }, /* 5522 */ ++ { 0, 0, printargs, "SYS_5523" }, /* 5523 */ ++ { 0, 0, printargs, "SYS_5524" }, /* 5524 */ ++ { 0, 0, printargs, "SYS_5525" }, /* 5525 */ ++ { 0, 0, printargs, "SYS_5526" }, /* 5526 */ ++ { 0, 0, printargs, "SYS_5527" }, /* 5527 */ ++ { 0, 0, printargs, "SYS_5528" }, /* 5528 */ ++ { 0, 0, printargs, "SYS_5529" }, /* 5529 */ ++ { 0, 0, printargs, "SYS_5530" }, /* 5530 */ ++ { 0, 0, printargs, "SYS_5531" }, /* 5531 */ ++ { 0, 0, printargs, "SYS_5532" }, /* 5532 */ ++ { 0, 0, printargs, "SYS_5533" }, /* 5533 */ ++ { 0, 0, printargs, "SYS_5534" }, /* 5534 */ ++ { 0, 0, printargs, "SYS_5535" }, /* 5535 */ ++ { 0, 0, printargs, "SYS_5536" }, /* 5536 */ ++ { 0, 0, printargs, "SYS_5537" }, /* 5537 */ ++ { 0, 0, printargs, "SYS_5538" }, /* 5538 */ ++ { 0, 0, printargs, "SYS_5539" }, /* 5539 */ ++ { 0, 0, printargs, "SYS_5540" }, /* 5540 */ ++ { 0, 0, printargs, "SYS_5541" }, /* 5541 */ ++ { 0, 0, printargs, "SYS_5542" }, /* 5542 */ ++ { 0, 0, printargs, "SYS_5543" }, /* 5543 */ ++ { 0, 0, printargs, "SYS_5544" }, /* 5544 */ ++ { 0, 0, printargs, "SYS_5545" }, /* 5545 */ ++ { 0, 0, printargs, "SYS_5546" }, /* 5546 */ ++ { 0, 0, printargs, "SYS_5547" }, /* 5547 */ ++ { 0, 0, printargs, "SYS_5548" }, /* 5548 */ ++ { 0, 0, printargs, "SYS_5549" }, /* 5549 */ ++ { 0, 0, printargs, "SYS_5550" }, /* 5550 */ ++ { 0, 0, printargs, "SYS_5551" }, /* 5551 */ ++ { 0, 0, printargs, "SYS_5552" }, /* 5552 */ ++ { 0, 0, printargs, "SYS_5553" }, /* 5553 */ ++ { 0, 0, printargs, "SYS_5554" }, /* 5554 */ ++ { 0, 0, printargs, "SYS_5555" }, /* 5555 */ ++ { 0, 0, printargs, "SYS_5556" }, /* 5556 */ ++ { 0, 0, printargs, "SYS_5557" }, /* 5557 */ ++ { 0, 0, printargs, "SYS_5558" }, /* 5558 */ ++ { 0, 0, printargs, "SYS_5559" }, /* 5559 */ ++ { 0, 0, printargs, "SYS_5560" }, /* 5560 */ ++ { 0, 0, printargs, "SYS_5561" }, /* 5561 */ ++ { 0, 0, printargs, "SYS_5562" }, /* 5562 */ ++ { 0, 0, printargs, "SYS_5563" }, /* 5563 */ ++ { 0, 0, printargs, "SYS_5564" }, /* 5564 */ ++ { 0, 0, printargs, "SYS_5565" }, /* 5565 */ ++ { 0, 0, printargs, "SYS_5566" }, /* 5566 */ ++ { 0, 0, printargs, "SYS_5567" }, /* 5567 */ ++ { 0, 0, printargs, "SYS_5568" }, /* 5568 */ ++ { 0, 0, printargs, "SYS_5569" }, /* 5569 */ ++ { 0, 0, printargs, "SYS_5570" }, /* 5570 */ ++ { 0, 0, printargs, "SYS_5571" }, /* 5571 */ ++ { 0, 0, printargs, "SYS_5572" }, /* 5572 */ ++ { 0, 0, printargs, "SYS_5573" }, /* 5573 */ ++ { 0, 0, printargs, "SYS_5574" }, /* 5574 */ ++ { 0, 0, printargs, "SYS_5575" }, /* 5575 */ ++ { 0, 0, printargs, "SYS_5576" }, /* 5576 */ ++ { 0, 0, printargs, "SYS_5577" }, /* 5577 */ ++ { 0, 0, printargs, "SYS_5578" }, /* 5578 */ ++ { 0, 0, printargs, "SYS_5579" }, /* 5579 */ ++ { 0, 0, printargs, "SYS_5580" }, /* 5580 */ ++ { 0, 0, printargs, "SYS_5581" }, /* 5581 */ ++ { 0, 0, printargs, "SYS_5582" }, /* 5582 */ ++ { 0, 0, printargs, "SYS_5583" }, /* 5583 */ ++ { 0, 0, printargs, "SYS_5584" }, /* 5584 */ ++ { 0, 0, printargs, "SYS_5585" }, /* 5585 */ ++ { 0, 0, printargs, "SYS_5586" }, /* 5586 */ ++ { 0, 0, printargs, "SYS_5587" }, /* 5587 */ ++ { 0, 0, printargs, "SYS_5588" }, /* 5588 */ ++ { 0, 0, printargs, "SYS_5589" }, /* 5589 */ ++ { 0, 0, printargs, "SYS_5590" }, /* 5590 */ ++ { 0, 0, printargs, "SYS_5591" }, /* 5591 */ ++ { 0, 0, printargs, "SYS_5592" }, /* 5592 */ ++ { 0, 0, printargs, "SYS_5593" }, /* 5593 */ ++ { 0, 0, printargs, "SYS_5594" }, /* 5594 */ ++ { 0, 0, printargs, "SYS_5595" }, /* 5595 */ ++ { 0, 0, printargs, "SYS_5596" }, /* 5596 */ ++ { 0, 0, printargs, "SYS_5597" }, /* 5597 */ ++ { 0, 0, printargs, "SYS_5598" }, /* 5598 */ ++ { 0, 0, printargs, "SYS_5599" }, /* 5599 */ ++ { 0, 0, printargs, "SYS_5600" }, /* 5600 */ ++ { 0, 0, printargs, "SYS_5601" }, /* 5601 */ ++ { 0, 0, printargs, "SYS_5602" }, /* 5602 */ ++ { 0, 0, printargs, "SYS_5603" }, /* 5603 */ ++ { 0, 0, printargs, "SYS_5604" }, /* 5604 */ ++ { 0, 0, printargs, "SYS_5605" }, /* 5605 */ ++ { 0, 0, printargs, "SYS_5606" }, /* 5606 */ ++ { 0, 0, printargs, "SYS_5607" }, /* 5607 */ ++ { 0, 0, printargs, "SYS_5608" }, /* 5608 */ ++ { 0, 0, printargs, "SYS_5609" }, /* 5609 */ ++ { 0, 0, printargs, "SYS_5610" }, /* 5610 */ ++ { 0, 0, printargs, "SYS_5611" }, /* 5611 */ ++ { 0, 0, printargs, "SYS_5612" }, /* 5612 */ ++ { 0, 0, printargs, "SYS_5613" }, /* 5613 */ ++ { 0, 0, printargs, "SYS_5614" }, /* 5614 */ ++ { 0, 0, printargs, "SYS_5615" }, /* 5615 */ ++ { 0, 0, printargs, "SYS_5616" }, /* 5616 */ ++ { 0, 0, printargs, "SYS_5617" }, /* 5617 */ ++ { 0, 0, printargs, "SYS_5618" }, /* 5618 */ ++ { 0, 0, printargs, "SYS_5619" }, /* 5619 */ ++ { 0, 0, printargs, "SYS_5620" }, /* 5620 */ ++ { 0, 0, printargs, "SYS_5621" }, /* 5621 */ ++ { 0, 0, printargs, "SYS_5622" }, /* 5622 */ ++ { 0, 0, printargs, "SYS_5623" }, /* 5623 */ ++ { 0, 0, printargs, "SYS_5624" }, /* 5624 */ ++ { 0, 0, printargs, "SYS_5625" }, /* 5625 */ ++ { 0, 0, printargs, "SYS_5626" }, /* 5626 */ ++ { 0, 0, printargs, "SYS_5627" }, /* 5627 */ ++ { 0, 0, printargs, "SYS_5628" }, /* 5628 */ ++ { 0, 0, printargs, "SYS_5629" }, /* 5629 */ ++ { 0, 0, printargs, "SYS_5630" }, /* 5630 */ ++ { 0, 0, printargs, "SYS_5631" }, /* 5631 */ ++ { 0, 0, printargs, "SYS_5632" }, /* 5632 */ ++ { 0, 0, printargs, "SYS_5633" }, /* 5633 */ ++ { 0, 0, printargs, "SYS_5634" }, /* 5634 */ ++ { 0, 0, printargs, "SYS_5635" }, /* 5635 */ ++ { 0, 0, printargs, "SYS_5636" }, /* 5636 */ ++ { 0, 0, printargs, "SYS_5637" }, /* 5637 */ ++ { 0, 0, printargs, "SYS_5638" }, /* 5638 */ ++ { 0, 0, printargs, "SYS_5639" }, /* 5639 */ ++ { 0, 0, printargs, "SYS_5640" }, /* 5640 */ ++ { 0, 0, printargs, "SYS_5641" }, /* 5641 */ ++ { 0, 0, printargs, "SYS_5642" }, /* 5642 */ ++ { 0, 0, printargs, "SYS_5643" }, /* 5643 */ ++ { 0, 0, printargs, "SYS_5644" }, /* 5644 */ ++ { 0, 0, printargs, "SYS_5645" }, /* 5645 */ ++ { 0, 0, printargs, "SYS_5646" }, /* 5646 */ ++ { 0, 0, printargs, "SYS_5647" }, /* 5647 */ ++ { 0, 0, printargs, "SYS_5648" }, /* 5648 */ ++ { 0, 0, printargs, "SYS_5649" }, /* 5649 */ ++ { 0, 0, printargs, "SYS_5650" }, /* 5650 */ ++ { 0, 0, printargs, "SYS_5651" }, /* 5651 */ ++ { 0, 0, printargs, "SYS_5652" }, /* 5652 */ ++ { 0, 0, printargs, "SYS_5653" }, /* 5653 */ ++ { 0, 0, printargs, "SYS_5654" }, /* 5654 */ ++ { 0, 0, printargs, "SYS_5655" }, /* 5655 */ ++ { 0, 0, printargs, "SYS_5656" }, /* 5656 */ ++ { 0, 0, printargs, "SYS_5657" }, /* 5657 */ ++ { 0, 0, printargs, "SYS_5658" }, /* 5658 */ ++ { 0, 0, printargs, "SYS_5659" }, /* 5659 */ ++ { 0, 0, printargs, "SYS_5660" }, /* 5660 */ ++ { 0, 0, printargs, "SYS_5661" }, /* 5661 */ ++ { 0, 0, printargs, "SYS_5662" }, /* 5662 */ ++ { 0, 0, printargs, "SYS_5663" }, /* 5663 */ ++ { 0, 0, printargs, "SYS_5664" }, /* 5664 */ ++ { 0, 0, printargs, "SYS_5665" }, /* 5665 */ ++ { 0, 0, printargs, "SYS_5666" }, /* 5666 */ ++ { 0, 0, printargs, "SYS_5667" }, /* 5667 */ ++ { 0, 0, printargs, "SYS_5668" }, /* 5668 */ ++ { 0, 0, printargs, "SYS_5669" }, /* 5669 */ ++ { 0, 0, printargs, "SYS_5670" }, /* 5670 */ ++ { 0, 0, printargs, "SYS_5671" }, /* 5671 */ ++ { 0, 0, printargs, "SYS_5672" }, /* 5672 */ ++ { 0, 0, printargs, "SYS_5673" }, /* 5673 */ ++ { 0, 0, printargs, "SYS_5674" }, /* 5674 */ ++ { 0, 0, printargs, "SYS_5675" }, /* 5675 */ ++ { 0, 0, printargs, "SYS_5676" }, /* 5676 */ ++ { 0, 0, printargs, "SYS_5677" }, /* 5677 */ ++ { 0, 0, printargs, "SYS_5678" }, /* 5678 */ ++ { 0, 0, printargs, "SYS_5679" }, /* 5679 */ ++ { 0, 0, printargs, "SYS_5680" }, /* 5680 */ ++ { 0, 0, printargs, "SYS_5681" }, /* 5681 */ ++ { 0, 0, printargs, "SYS_5682" }, /* 5682 */ ++ { 0, 0, printargs, "SYS_5683" }, /* 5683 */ ++ { 0, 0, printargs, "SYS_5684" }, /* 5684 */ ++ { 0, 0, printargs, "SYS_5685" }, /* 5685 */ ++ { 0, 0, printargs, "SYS_5686" }, /* 5686 */ ++ { 0, 0, printargs, "SYS_5687" }, /* 5687 */ ++ { 0, 0, printargs, "SYS_5688" }, /* 5688 */ ++ { 0, 0, printargs, "SYS_5689" }, /* 5689 */ ++ { 0, 0, printargs, "SYS_5690" }, /* 5690 */ ++ { 0, 0, printargs, "SYS_5691" }, /* 5691 */ ++ { 0, 0, printargs, "SYS_5692" }, /* 5692 */ ++ { 0, 0, printargs, "SYS_5693" }, /* 5693 */ ++ { 0, 0, printargs, "SYS_5694" }, /* 5694 */ ++ { 0, 0, printargs, "SYS_5695" }, /* 5695 */ ++ { 0, 0, printargs, "SYS_5696" }, /* 5696 */ ++ { 0, 0, printargs, "SYS_5697" }, /* 5697 */ ++ { 0, 0, printargs, "SYS_5698" }, /* 5698 */ ++ { 0, 0, printargs, "SYS_5699" }, /* 5699 */ ++ { 0, 0, printargs, "SYS_5700" }, /* 5700 */ ++ { 0, 0, printargs, "SYS_5701" }, /* 5701 */ ++ { 0, 0, printargs, "SYS_5702" }, /* 5702 */ ++ { 0, 0, printargs, "SYS_5703" }, /* 5703 */ ++ { 0, 0, printargs, "SYS_5704" }, /* 5704 */ ++ { 0, 0, printargs, "SYS_5705" }, /* 5705 */ ++ { 0, 0, printargs, "SYS_5706" }, /* 5706 */ ++ { 0, 0, printargs, "SYS_5707" }, /* 5707 */ ++ { 0, 0, printargs, "SYS_5708" }, /* 5708 */ ++ { 0, 0, printargs, "SYS_5709" }, /* 5709 */ ++ { 0, 0, printargs, "SYS_5710" }, /* 5710 */ ++ { 0, 0, printargs, "SYS_5711" }, /* 5711 */ ++ { 0, 0, printargs, "SYS_5712" }, /* 5712 */ ++ { 0, 0, printargs, "SYS_5713" }, /* 5713 */ ++ { 0, 0, printargs, "SYS_5714" }, /* 5714 */ ++ { 0, 0, printargs, "SYS_5715" }, /* 5715 */ ++ { 0, 0, printargs, "SYS_5716" }, /* 5716 */ ++ { 0, 0, printargs, "SYS_5717" }, /* 5717 */ ++ { 0, 0, printargs, "SYS_5718" }, /* 5718 */ ++ { 0, 0, printargs, "SYS_5719" }, /* 5719 */ ++ { 0, 0, printargs, "SYS_5720" }, /* 5720 */ ++ { 0, 0, printargs, "SYS_5721" }, /* 5721 */ ++ { 0, 0, printargs, "SYS_5722" }, /* 5722 */ ++ { 0, 0, printargs, "SYS_5723" }, /* 5723 */ ++ { 0, 0, printargs, "SYS_5724" }, /* 5724 */ ++ { 0, 0, printargs, "SYS_5725" }, /* 5725 */ ++ { 0, 0, printargs, "SYS_5726" }, /* 5726 */ ++ { 0, 0, printargs, "SYS_5727" }, /* 5727 */ ++ { 0, 0, printargs, "SYS_5728" }, /* 5728 */ ++ { 0, 0, printargs, "SYS_5729" }, /* 5729 */ ++ { 0, 0, printargs, "SYS_5730" }, /* 5730 */ ++ { 0, 0, printargs, "SYS_5731" }, /* 5731 */ ++ { 0, 0, printargs, "SYS_5732" }, /* 5732 */ ++ { 0, 0, printargs, "SYS_5733" }, /* 5733 */ ++ { 0, 0, printargs, "SYS_5734" }, /* 5734 */ ++ { 0, 0, printargs, "SYS_5735" }, /* 5735 */ ++ { 0, 0, printargs, "SYS_5736" }, /* 5736 */ ++ { 0, 0, printargs, "SYS_5737" }, /* 5737 */ ++ { 0, 0, printargs, "SYS_5738" }, /* 5738 */ ++ { 0, 0, printargs, "SYS_5739" }, /* 5739 */ ++ { 0, 0, printargs, "SYS_5740" }, /* 5740 */ ++ { 0, 0, printargs, "SYS_5741" }, /* 5741 */ ++ { 0, 0, printargs, "SYS_5742" }, /* 5742 */ ++ { 0, 0, printargs, "SYS_5743" }, /* 5743 */ ++ { 0, 0, printargs, "SYS_5744" }, /* 5744 */ ++ { 0, 0, printargs, "SYS_5745" }, /* 5745 */ ++ { 0, 0, printargs, "SYS_5746" }, /* 5746 */ ++ { 0, 0, printargs, "SYS_5747" }, /* 5747 */ ++ { 0, 0, printargs, "SYS_5748" }, /* 5748 */ ++ { 0, 0, printargs, "SYS_5749" }, /* 5749 */ ++ { 0, 0, printargs, "SYS_5750" }, /* 5750 */ ++ { 0, 0, printargs, "SYS_5751" }, /* 5751 */ ++ { 0, 0, printargs, "SYS_5752" }, /* 5752 */ ++ { 0, 0, printargs, "SYS_5753" }, /* 5753 */ ++ { 0, 0, printargs, "SYS_5754" }, /* 5754 */ ++ { 0, 0, printargs, "SYS_5755" }, /* 5755 */ ++ { 0, 0, printargs, "SYS_5756" }, /* 5756 */ ++ { 0, 0, printargs, "SYS_5757" }, /* 5757 */ ++ { 0, 0, printargs, "SYS_5758" }, /* 5758 */ ++ { 0, 0, printargs, "SYS_5759" }, /* 5759 */ ++ { 0, 0, printargs, "SYS_5760" }, /* 5760 */ ++ { 0, 0, printargs, "SYS_5761" }, /* 5761 */ ++ { 0, 0, printargs, "SYS_5762" }, /* 5762 */ ++ { 0, 0, printargs, "SYS_5763" }, /* 5763 */ ++ { 0, 0, printargs, "SYS_5764" }, /* 5764 */ ++ { 0, 0, printargs, "SYS_5765" }, /* 5765 */ ++ { 0, 0, printargs, "SYS_5766" }, /* 5766 */ ++ { 0, 0, printargs, "SYS_5767" }, /* 5767 */ ++ { 0, 0, printargs, "SYS_5768" }, /* 5768 */ ++ { 0, 0, printargs, "SYS_5769" }, /* 5769 */ ++ { 0, 0, printargs, "SYS_5770" }, /* 5770 */ ++ { 0, 0, printargs, "SYS_5771" }, /* 5771 */ ++ { 0, 0, printargs, "SYS_5772" }, /* 5772 */ ++ { 0, 0, printargs, "SYS_5773" }, /* 5773 */ ++ { 0, 0, printargs, "SYS_5774" }, /* 5774 */ ++ { 0, 0, printargs, "SYS_5775" }, /* 5775 */ ++ { 0, 0, printargs, "SYS_5776" }, /* 5776 */ ++ { 0, 0, printargs, "SYS_5777" }, /* 5777 */ ++ { 0, 0, printargs, "SYS_5778" }, /* 5778 */ ++ { 0, 0, printargs, "SYS_5779" }, /* 5779 */ ++ { 0, 0, printargs, "SYS_5780" }, /* 5780 */ ++ { 0, 0, printargs, "SYS_5781" }, /* 5781 */ ++ { 0, 0, printargs, "SYS_5782" }, /* 5782 */ ++ { 0, 0, printargs, "SYS_5783" }, /* 5783 */ ++ { 0, 0, printargs, "SYS_5784" }, /* 5784 */ ++ { 0, 0, printargs, "SYS_5785" }, /* 5785 */ ++ { 0, 0, printargs, "SYS_5786" }, /* 5786 */ ++ { 0, 0, printargs, "SYS_5787" }, /* 5787 */ ++ { 0, 0, printargs, "SYS_5788" }, /* 5788 */ ++ { 0, 0, printargs, "SYS_5789" }, /* 5789 */ ++ { 0, 0, printargs, "SYS_5790" }, /* 5790 */ ++ { 0, 0, printargs, "SYS_5791" }, /* 5791 */ ++ { 0, 0, printargs, "SYS_5792" }, /* 5792 */ ++ { 0, 0, printargs, "SYS_5793" }, /* 5793 */ ++ { 0, 0, printargs, "SYS_5794" }, /* 5794 */ ++ { 0, 0, printargs, "SYS_5795" }, /* 5795 */ ++ { 0, 0, printargs, "SYS_5796" }, /* 5796 */ ++ { 0, 0, printargs, "SYS_5797" }, /* 5797 */ ++ { 0, 0, printargs, "SYS_5798" }, /* 5798 */ ++ { 0, 0, printargs, "SYS_5799" }, /* 5799 */ ++ { 0, 0, printargs, "SYS_5800" }, /* 5800 */ ++ { 0, 0, printargs, "SYS_5801" }, /* 5801 */ ++ { 0, 0, printargs, "SYS_5802" }, /* 5802 */ ++ { 0, 0, printargs, "SYS_5803" }, /* 5803 */ ++ { 0, 0, printargs, "SYS_5804" }, /* 5804 */ ++ { 0, 0, printargs, "SYS_5805" }, /* 5805 */ ++ { 0, 0, printargs, "SYS_5806" }, /* 5806 */ ++ { 0, 0, printargs, "SYS_5807" }, /* 5807 */ ++ { 0, 0, printargs, "SYS_5808" }, /* 5808 */ ++ { 0, 0, printargs, "SYS_5809" }, /* 5809 */ ++ { 0, 0, printargs, "SYS_5810" }, /* 5810 */ ++ { 0, 0, printargs, "SYS_5811" }, /* 5811 */ ++ { 0, 0, printargs, "SYS_5812" }, /* 5812 */ ++ { 0, 0, printargs, "SYS_5813" }, /* 5813 */ ++ { 0, 0, printargs, "SYS_5814" }, /* 5814 */ ++ { 0, 0, printargs, "SYS_5815" }, /* 5815 */ ++ { 0, 0, printargs, "SYS_5816" }, /* 5816 */ ++ { 0, 0, printargs, "SYS_5817" }, /* 5817 */ ++ { 0, 0, printargs, "SYS_5818" }, /* 5818 */ ++ { 0, 0, printargs, "SYS_5819" }, /* 5819 */ ++ { 0, 0, printargs, "SYS_5820" }, /* 5820 */ ++ { 0, 0, printargs, "SYS_5821" }, /* 5821 */ ++ { 0, 0, printargs, "SYS_5822" }, /* 5822 */ ++ { 0, 0, printargs, "SYS_5823" }, /* 5823 */ ++ { 0, 0, printargs, "SYS_5824" }, /* 5824 */ ++ { 0, 0, printargs, "SYS_5825" }, /* 5825 */ ++ { 0, 0, printargs, "SYS_5826" }, /* 5826 */ ++ { 0, 0, printargs, "SYS_5827" }, /* 5827 */ ++ { 0, 0, printargs, "SYS_5828" }, /* 5828 */ ++ { 0, 0, printargs, "SYS_5829" }, /* 5829 */ ++ { 0, 0, printargs, "SYS_5830" }, /* 5830 */ ++ { 0, 0, printargs, "SYS_5831" }, /* 5831 */ ++ { 0, 0, printargs, "SYS_5832" }, /* 5832 */ ++ { 0, 0, printargs, "SYS_5833" }, /* 5833 */ ++ { 0, 0, printargs, "SYS_5834" }, /* 5834 */ ++ { 0, 0, printargs, "SYS_5835" }, /* 5835 */ ++ { 0, 0, printargs, "SYS_5836" }, /* 5836 */ ++ { 0, 0, printargs, "SYS_5837" }, /* 5837 */ ++ { 0, 0, printargs, "SYS_5838" }, /* 5838 */ ++ { 0, 0, printargs, "SYS_5839" }, /* 5839 */ ++ { 0, 0, printargs, "SYS_5840" }, /* 5840 */ ++ { 0, 0, printargs, "SYS_5841" }, /* 5841 */ ++ { 0, 0, printargs, "SYS_5842" }, /* 5842 */ ++ { 0, 0, printargs, "SYS_5843" }, /* 5843 */ ++ { 0, 0, printargs, "SYS_5844" }, /* 5844 */ ++ { 0, 0, printargs, "SYS_5845" }, /* 5845 */ ++ { 0, 0, printargs, "SYS_5846" }, /* 5846 */ ++ { 0, 0, printargs, "SYS_5847" }, /* 5847 */ ++ { 0, 0, printargs, "SYS_5848" }, /* 5848 */ ++ { 0, 0, printargs, "SYS_5849" }, /* 5849 */ ++ { 0, 0, printargs, "SYS_5850" }, /* 5850 */ ++ { 0, 0, printargs, "SYS_5851" }, /* 5851 */ ++ { 0, 0, printargs, "SYS_5852" }, /* 5852 */ ++ { 0, 0, printargs, "SYS_5853" }, /* 5853 */ ++ { 0, 0, printargs, "SYS_5854" }, /* 5854 */ ++ { 0, 0, printargs, "SYS_5855" }, /* 5855 */ ++ { 0, 0, printargs, "SYS_5856" }, /* 5856 */ ++ { 0, 0, printargs, "SYS_5857" }, /* 5857 */ ++ { 0, 0, printargs, "SYS_5858" }, /* 5858 */ ++ { 0, 0, printargs, "SYS_5859" }, /* 5859 */ ++ { 0, 0, printargs, "SYS_5860" }, /* 5860 */ ++ { 0, 0, printargs, "SYS_5861" }, /* 5861 */ ++ { 0, 0, printargs, "SYS_5862" }, /* 5862 */ ++ { 0, 0, printargs, "SYS_5863" }, /* 5863 */ ++ { 0, 0, printargs, "SYS_5864" }, /* 5864 */ ++ { 0, 0, printargs, "SYS_5865" }, /* 5865 */ ++ { 0, 0, printargs, "SYS_5866" }, /* 5866 */ ++ { 0, 0, printargs, "SYS_5867" }, /* 5867 */ ++ { 0, 0, printargs, "SYS_5868" }, /* 5868 */ ++ { 0, 0, printargs, "SYS_5869" }, /* 5869 */ ++ { 0, 0, printargs, "SYS_5870" }, /* 5870 */ ++ { 0, 0, printargs, "SYS_5871" }, /* 5871 */ ++ { 0, 0, printargs, "SYS_5872" }, /* 5872 */ ++ { 0, 0, printargs, "SYS_5873" }, /* 5873 */ ++ { 0, 0, printargs, "SYS_5874" }, /* 5874 */ ++ { 0, 0, printargs, "SYS_5875" }, /* 5875 */ ++ { 0, 0, printargs, "SYS_5876" }, /* 5876 */ ++ { 0, 0, printargs, "SYS_5877" }, /* 5877 */ ++ { 0, 0, printargs, "SYS_5878" }, /* 5878 */ ++ { 0, 0, printargs, "SYS_5879" }, /* 5879 */ ++ { 0, 0, printargs, "SYS_5880" }, /* 5880 */ ++ { 0, 0, printargs, "SYS_5881" }, /* 5881 */ ++ { 0, 0, printargs, "SYS_5882" }, /* 5882 */ ++ { 0, 0, printargs, "SYS_5883" }, /* 5883 */ ++ { 0, 0, printargs, "SYS_5884" }, /* 5884 */ ++ { 0, 0, printargs, "SYS_5885" }, /* 5885 */ ++ { 0, 0, printargs, "SYS_5886" }, /* 5886 */ ++ { 0, 0, printargs, "SYS_5887" }, /* 5887 */ ++ { 0, 0, printargs, "SYS_5888" }, /* 5888 */ ++ { 0, 0, printargs, "SYS_5889" }, /* 5889 */ ++ { 0, 0, printargs, "SYS_5890" }, /* 5890 */ ++ { 0, 0, printargs, "SYS_5891" }, /* 5891 */ ++ { 0, 0, printargs, "SYS_5892" }, /* 5892 */ ++ { 0, 0, printargs, "SYS_5893" }, /* 5893 */ ++ { 0, 0, printargs, "SYS_5894" }, /* 5894 */ ++ { 0, 0, printargs, "SYS_5895" }, /* 5895 */ ++ { 0, 0, printargs, "SYS_5896" }, /* 5896 */ ++ { 0, 0, printargs, "SYS_5897" }, /* 5897 */ ++ { 0, 0, printargs, "SYS_5898" }, /* 5898 */ ++ { 0, 0, printargs, "SYS_5899" }, /* 5899 */ ++ { 0, 0, printargs, "SYS_5900" }, /* 5900 */ ++ { 0, 0, printargs, "SYS_5901" }, /* 5901 */ ++ { 0, 0, printargs, "SYS_5902" }, /* 5902 */ ++ { 0, 0, printargs, "SYS_5903" }, /* 5903 */ ++ { 0, 0, printargs, "SYS_5904" }, /* 5904 */ ++ { 0, 0, printargs, "SYS_5905" }, /* 5905 */ ++ { 0, 0, printargs, "SYS_5906" }, /* 5906 */ ++ { 0, 0, printargs, "SYS_5907" }, /* 5907 */ ++ { 0, 0, printargs, "SYS_5908" }, /* 5908 */ ++ { 0, 0, printargs, "SYS_5909" }, /* 5909 */ ++ { 0, 0, printargs, "SYS_5910" }, /* 5910 */ ++ { 0, 0, printargs, "SYS_5911" }, /* 5911 */ ++ { 0, 0, printargs, "SYS_5912" }, /* 5912 */ ++ { 0, 0, printargs, "SYS_5913" }, /* 5913 */ ++ { 0, 0, printargs, "SYS_5914" }, /* 5914 */ ++ { 0, 0, printargs, "SYS_5915" }, /* 5915 */ ++ { 0, 0, printargs, "SYS_5916" }, /* 5916 */ ++ { 0, 0, printargs, "SYS_5917" }, /* 5917 */ ++ { 0, 0, printargs, "SYS_5918" }, /* 5918 */ ++ { 0, 0, printargs, "SYS_5919" }, /* 5919 */ ++ { 0, 0, printargs, "SYS_5920" }, /* 5920 */ ++ { 0, 0, printargs, "SYS_5921" }, /* 5921 */ ++ { 0, 0, printargs, "SYS_5922" }, /* 5922 */ ++ { 0, 0, printargs, "SYS_5923" }, /* 5923 */ ++ { 0, 0, printargs, "SYS_5924" }, /* 5924 */ ++ { 0, 0, printargs, "SYS_5925" }, /* 5925 */ ++ { 0, 0, printargs, "SYS_5926" }, /* 5926 */ ++ { 0, 0, printargs, "SYS_5927" }, /* 5927 */ ++ { 0, 0, printargs, "SYS_5928" }, /* 5928 */ ++ { 0, 0, printargs, "SYS_5929" }, /* 5929 */ ++ { 0, 0, printargs, "SYS_5930" }, /* 5930 */ ++ { 0, 0, printargs, "SYS_5931" }, /* 5931 */ ++ { 0, 0, printargs, "SYS_5932" }, /* 5932 */ ++ { 0, 0, printargs, "SYS_5933" }, /* 5933 */ ++ { 0, 0, printargs, "SYS_5934" }, /* 5934 */ ++ { 0, 0, printargs, "SYS_5935" }, /* 5935 */ ++ { 0, 0, printargs, "SYS_5936" }, /* 5936 */ ++ { 0, 0, printargs, "SYS_5937" }, /* 5937 */ ++ { 0, 0, printargs, "SYS_5938" }, /* 5938 */ ++ { 0, 0, printargs, "SYS_5939" }, /* 5939 */ ++ { 0, 0, printargs, "SYS_5940" }, /* 5940 */ ++ { 0, 0, printargs, "SYS_5941" }, /* 5941 */ ++ { 0, 0, printargs, "SYS_5942" }, /* 5942 */ ++ { 0, 0, printargs, "SYS_5943" }, /* 5943 */ ++ { 0, 0, printargs, "SYS_5944" }, /* 5944 */ ++ { 0, 0, printargs, "SYS_5945" }, /* 5945 */ ++ { 0, 0, printargs, "SYS_5946" }, /* 5946 */ ++ { 0, 0, printargs, "SYS_5947" }, /* 5947 */ ++ { 0, 0, printargs, "SYS_5948" }, /* 5948 */ ++ { 0, 0, printargs, "SYS_5949" }, /* 5949 */ ++ { 0, 0, printargs, "SYS_5950" }, /* 5950 */ ++ { 0, 0, printargs, "SYS_5951" }, /* 5951 */ ++ { 0, 0, printargs, "SYS_5952" }, /* 5952 */ ++ { 0, 0, printargs, "SYS_5953" }, /* 5953 */ ++ { 0, 0, printargs, "SYS_5954" }, /* 5954 */ ++ { 0, 0, printargs, "SYS_5955" }, /* 5955 */ ++ { 0, 0, printargs, "SYS_5956" }, /* 5956 */ ++ { 0, 0, printargs, "SYS_5957" }, /* 5957 */ ++ { 0, 0, printargs, "SYS_5958" }, /* 5958 */ ++ { 0, 0, printargs, "SYS_5959" }, /* 5959 */ ++ { 0, 0, printargs, "SYS_5960" }, /* 5960 */ ++ { 0, 0, printargs, "SYS_5961" }, /* 5961 */ ++ { 0, 0, printargs, "SYS_5962" }, /* 5962 */ ++ { 0, 0, printargs, "SYS_5963" }, /* 5963 */ ++ { 0, 0, printargs, "SYS_5964" }, /* 5964 */ ++ { 0, 0, printargs, "SYS_5965" }, /* 5965 */ ++ { 0, 0, printargs, "SYS_5966" }, /* 5966 */ ++ { 0, 0, printargs, "SYS_5967" }, /* 5967 */ ++ { 0, 0, printargs, "SYS_5968" }, /* 5968 */ ++ { 0, 0, printargs, "SYS_5969" }, /* 5969 */ ++ { 0, 0, printargs, "SYS_5970" }, /* 5970 */ ++ { 0, 0, printargs, "SYS_5971" }, /* 5971 */ ++ { 0, 0, printargs, "SYS_5972" }, /* 5972 */ ++ { 0, 0, printargs, "SYS_5973" }, /* 5973 */ ++ { 0, 0, printargs, "SYS_5974" }, /* 5974 */ ++ { 0, 0, printargs, "SYS_5975" }, /* 5975 */ ++ { 0, 0, printargs, "SYS_5976" }, /* 5976 */ ++ { 0, 0, printargs, "SYS_5977" }, /* 5977 */ ++ { 0, 0, printargs, "SYS_5978" }, /* 5978 */ ++ { 0, 0, printargs, "SYS_5979" }, /* 5979 */ ++ { 0, 0, printargs, "SYS_5980" }, /* 5980 */ ++ { 0, 0, printargs, "SYS_5981" }, /* 5981 */ ++ { 0, 0, printargs, "SYS_5982" }, /* 5982 */ ++ { 0, 0, printargs, "SYS_5983" }, /* 5983 */ ++ { 0, 0, printargs, "SYS_5984" }, /* 5984 */ ++ { 0, 0, printargs, "SYS_5985" }, /* 5985 */ ++ { 0, 0, printargs, "SYS_5986" }, /* 5986 */ ++ { 0, 0, printargs, "SYS_5987" }, /* 5987 */ ++ { 0, 0, printargs, "SYS_5988" }, /* 5988 */ ++ { 0, 0, printargs, "SYS_5989" }, /* 5989 */ ++ { 0, 0, printargs, "SYS_5990" }, /* 5990 */ ++ { 0, 0, printargs, "SYS_5991" }, /* 5991 */ ++ { 0, 0, printargs, "SYS_5992" }, /* 5992 */ ++ { 0, 0, printargs, "SYS_5993" }, /* 5993 */ ++ { 0, 0, printargs, "SYS_5994" }, /* 5994 */ ++ { 0, 0, printargs, "SYS_5995" }, /* 5995 */ ++ { 0, 0, printargs, "SYS_5996" }, /* 5996 */ ++ { 0, 0, printargs, "SYS_5997" }, /* 5997 */ ++ { 0, 0, printargs, "SYS_5998" }, /* 5998 */ ++ { 0, 0, printargs, "SYS_5999" }, /* 5999 */ /* end of Linux N64 */ ++ ++#if defined (LINUX_MIPSN32) ++ /* For an N32 strace decode the N32 64-bit syscalls. */ ++ { 3, TF, sys_read, "read" }, /* 6000 */ /* start of Linux N32 */ ++ { 3, TF, sys_write, "write" }, /* 6001 */ ++ { 3, TF, sys_open, "open" }, /* 6002 */ ++ { 1, 0, sys_close, "close" }, /* 6003 */ ++ { 2, TF, sys_stat64, "stat" }, /* 6004 */ ++ { 2, 0, sys_fstat64, "fstat" }, /* 6005 */ ++ { 2, TF, sys_lstat64, "lstat" }, /* 6006 */ ++ { 3, 0, sys_poll, "poll" }, /* 6007 */ ++ { 3, 0, sys_lseek, "lseek" }, /* 6008 */ ++ { 6, 0, sys_mmap, "mmap" }, /* 6009 */ ++ { 3, 0, sys_mprotect, "mprotect" }, /* 6010 */ ++ { 2, 0, sys_munmap, "munmap" }, /* 6011 */ ++ { 1, 0, sys_brk, "brk" }, /* 6012 */ ++ { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 6013 */ ++ { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 6014 */ ++ { 3, 0, sys_ioctl, "ioctl" }, /* 6015 */ ++ { 6, TF, sys_pread64, "pread" }, /* 6016 */ ++ { 6, TF, sys_pwrite64, "pwrite" }, /* 6017 */ ++ { 3, 0, sys_readv, "readv" }, /* 6018 */ ++ { 3, 0, sys_writev, "writev" }, /* 6019 */ ++ { 2, TF, sys_access, "access" }, /* 6020 */ ++ { 1, 0, sys_pipe, "pipe" }, /* 6021 */ ++ { 5, 0, sys_select, "_newselect" }, /* 6022 */ ++ { 0, 0, sys_sched_yield, "sched_yield" }, /* 6023 */ ++ { 4, 0, sys_mremap, "mremap" }, /* 6024 */ ++ { 3, 0, sys_msync, "msync" }, /* 6025 */ ++ { 3, 0, printargs, "mincore" }, /* 6026 */ ++ { 3, 0, sys_madvise, "madvise" }, /* 6027 */ ++ { 3, TI, sys_shmget, "shmget" }, /* 6028 */ ++ { 3, TI, sys_shmat, "shmgat" }, /* 6029 */ ++ { 3, TI, sys_shmctl, "shmctl" }, /* 6030 */ ++ { 1, 0, sys_dup, "dup" }, /* 6031 */ ++ { 2, 0, sys_dup2, "dup2" }, /* 6032 */ ++ { 0, TS, sys_pause, "pause" }, /* 6033 */ ++ { 2, 0, sys_nanosleep, "nanosleep" }, /* 6034 */ ++ { 2, 0, sys_getitimer, "getitimer" }, /* 6035 */ ++ { 3, 0, sys_setitimer, "setitimer" }, /* 6036 */ ++ { 1, 0, sys_alarm, "alarm" }, /* 6037 */ ++ { 0, 0, sys_getpid, "getpid" }, /* 6038 */ ++ { 4, TF, sys_sendfile, "sendfile" }, /* 6039 */ ++ { 2, 0, sys_socketcall, "socketcall" }, /* 6040 */ ++ { 3, TN, sys_connect, "connect" }, /* 6041 */ ++ { 3, TN, sys_accept, "accept" }, /* 6042 */ ++ { 6, TN, sys_sendto, "sendto" }, /* 6043 */ ++ { 6, TN, sys_recvfrom, "recvfrom" }, /* 6044 */ ++ { 3, TN, sys_sendmsg, "sendmsg" }, /* 6045 */ ++ { 3, TN, sys_recvmsg, "recvmsg" }, /* 6046 */ ++ { 2, TN, sys_shutdown, "shutdown" }, /* 6047 */ ++ { 3, TN, sys_bind, "bind" }, /* 6048 */ ++ { 2, TN, sys_listen, "listen" }, /* 6049 */ ++ { 3, TN, sys_getsockname, "getsockname" }, /* 6050 */ ++ { 3, TN, sys_getpeername, "getpeername" }, /* 6051 */ ++ { 4, TN, sys_socketpair, "socketpair" }, /* 6052 */ ++ { 5, TN, sys_setsockopt, "setsockopt" }, /* 6053 */ ++ { 5, TN, sys_getsockopt, "getsockopt" }, /* 6054 */ ++ { 2, TP, sys_clone, "clone" }, /* 6055 */ ++ { 0, TP, sys_fork, "fork" }, /* 6056 */ ++ { 3, TF|TP, sys_execve, "execve" }, /* 6057 */ ++ { 1, TP, sys_exit, "exit" }, /* 6058 */ ++ { 4, TP, sys_wait4, "wait4" }, /* 6059 */ ++ { 2, TS, sys_kill, "kill" }, /* 6060 */ ++ { 1, 0, sys_uname, "uname" }, /* 6061 */ ++ { 3, TI, sys_semget, "semget" }, /* 6062 */ ++ { 3, TI, printargs, "semop" }, /* 6063 */ ++ { 4, TI, sys_semctl, "semctl" }, /* 6064 */ ++ { 1, TI, sys_shmdt, "shmdt" }, /* 6065 */ ++ { 2, TI, sys_msgget, "msgget" }, /* 6066 */ ++ { 4, TI, sys_msgsnd, "msgsnd" }, /* 6067 */ ++ { 5, TI, sys_msgrcv, "msgrcv" }, /* 6068 */ ++ { 3, TI, sys_msgctl, "msgctl" }, /* 6069 */ ++ { 3, 0, sys_fcntl, "fcntl" }, /* 6070 */ ++ { 2, 0, sys_flock, "flock" }, /* 6071 */ ++ { 1, 0, sys_fsync, "fsync" }, /* 6072 */ ++ { 1, 0, sys_fdatasync, "fdatasync" }, /* 6073 */ ++ { 2, TF, sys_truncate, "truncate" }, /* 6074 */ ++ { 2, 0, sys_ftruncate, "ftruncate" }, /* 6075 */ ++ { 3, 0, sys_getdents, "getdents" }, /* 6076 */ ++ { 2, TF, sys_getcwd, "getcwd" }, /* 6077 */ ++ { 1, TF, sys_chdir, "chdir" }, /* 6078 */ ++ { 1, TF, sys_fchdir, "fchdir" }, /* 6079 */ ++ { 2, TF, sys_rename, "rename" }, /* 6080 */ ++ { 2, TF, sys_mkdir, "mkdir" }, /* 6081 */ ++ { 1, TF, sys_rmdir, "rmdir" }, /* 6082 */ ++ { 2, TF, sys_creat, "creat" }, /* 6083 */ ++ { 2, TF, sys_link, "link" }, /* 6084 */ ++ { 1, TF, sys_unlink, "unlink" }, /* 6085 */ ++ { 2, TF, sys_symlink, "symlink" }, /* 6086 */ ++ { 3, TF, sys_readlink, "readlink" }, /* 6087 */ ++ { 2, TF, sys_chmod, "chmod" }, /* 6088 */ ++ { 2, 0, sys_fchmod, "fchmod" }, /* 6089 */ ++ { 3, TF, sys_chown, "chown" }, /* 6090 */ ++ { 3, 0, sys_fchown, "fchown" }, /* 6091 */ ++ { 3, TF, sys_chown, "lchown" }, /* 6092 */ ++ { 1, 0, sys_umask, "umask" }, /* 6093 */ ++ { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 6094 */ ++ { 2, 0, sys_getrlimit, "getrlimit" }, /* 6095 */ ++ { 2, 0, sys_getrusage, "getrusage" }, /* 6096 */ ++ { 1, 0, sys_sysinfo, "sysinfo" }, /* 6097 */ ++ { 1, 0, sys_times, "times" }, /* 6098 */ ++ { 4, 0, sys_ptrace, "ptrace" }, /* 6099 */ ++ { 0, 0, sys_getuid, "getuid" }, /* 6100 */ ++ { 3, 0, sys_syslog, "syslog" }, /* 6101 */ ++ { 0, 0, sys_getgid, "getgid" }, /* 6102 */ ++ { 1, 0, sys_setuid, "setuid" }, /* 6103 */ ++ { 1, 0, sys_setgid, "setgid" }, /* 6104 */ ++ { 0, 0, sys_geteuid, "geteuid" }, /* 6105 */ ++ { 0, 0, sys_getegid, "getegid" }, /* 6106 */ ++ { 2, 0, sys_setpgid, "setpgid" }, /* 6107 */ ++ { 0, 0, sys_getppid, "getppid" }, /* 6108 */ ++ { 0, 0, sys_getpgrp, "getpgrp" }, /* 6109 */ ++ { 0, 0, sys_setsid, "setsid" }, /* 6110 */ ++ { 2, 0, sys_setreuid, "setreuid" }, /* 6111 */ ++ { 2, 0, sys_setregid, "setregid" }, /* 6112 */ ++ { 2, 0, sys_getgroups, "getgroups" }, /* 6113 */ ++ { 2, 0, sys_setgroups, "setgroups" }, /* 6114 */ ++ { 3, 0, sys_setresuid, "setresuid" }, /* 6115 */ ++ { 3, 0, sys_getresuid, "getresuid" }, /* 6116 */ ++ { 3, 0, sys_setresgid, "setresgid" }, /* 6117 */ ++ { 3, 0, sys_getresgid, "getresgid" }, /* 6118 */ ++ { 0, 0, sys_getpgid, "getpgid" }, /* 6119 */ ++ { 1, 0, sys_setfsuid, "setfsuid" }, /* 6120 */ ++ { 1, 0, sys_setfsgid, "setfsgid" }, /* 6121 */ ++ { 1, 0, sys_getsid, "getsid" }, /* 6122 */ ++ { 2, 0, sys_capget, "capget" }, /* 6123 */ ++ { 2, 0, sys_capset, "capset" }, /* 6124 */ ++ { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 6125 */ ++ { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"},/* 6126 */ ++ { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"},/* 6127 */ ++ { 2, TS, sys_rt_sigsuspend, "rt_siguspend" }, /* 6128 */ ++ { 2, TS, sys_sigaltstack, "sigaltstatck" }, /* 6129 */ ++ { 2, TF, sys_utime, "utime" }, /* 6130 */ ++ { 3, TF, sys_mknod, "mknod" }, /* 6131 */ ++ { 1, 0, sys_personality, "personality" }, /* 6132 */ ++ { 2, 0, sys_ustat, "ustat" }, /* 6133 */ ++ { 3, 0, sys_statfs, "statfs" }, /* 6134 */ ++ { 3, 0, sys_fstatfs, "fstatfs" }, /* 6135 */ ++ { 5, 0, sys_sysfs, "sysfs" }, /* 6136 */ ++ { 2, 0, sys_getpriority, "getpriority" }, /* 6137 */ ++ { 3, 0, sys_setpriority, "setpriority" }, /* 6138 */ ++ { 2, 0, sys_sched_setparam, "sched_setparam"}, /* 6139 */ ++ { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 6140 */ ++ { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 6141 */ ++ { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 6142 */ ++ { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 6143 */ ++ { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 6144 */ ++ { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 6145 */ ++ { 2, 0, sys_mlock, "mlock" }, /* 6146 */ ++ { 2, 0, sys_munlock, "munlock" }, /* 6147 */ ++ { 1, 0, sys_mlockall, "mlockall" }, /* 6148 */ ++ { 0, 0, sys_munlockall, "munlockall" }, /* 6149 */ ++ { 0, 0, sys_vhangup, "vhangup" }, /* 6150 */ ++ { 2, 0, sys_pivotroot, "pivot_root" }, /* 6151 */ ++ { 1, 0, sys_sysctl, "_sysctl" }, /* 6152 */ ++ { 5, 0, printargs, "prctl" }, /* 6153 */ ++ { 1, 0, sys_adjtimex, "adjtimex" }, /* 6154 */ ++ { 2, 0, sys_setrlimit, "setrlimit" }, /* 6155 */ ++ { 1, TF, sys_chroot, "chroot" }, /* 6156 */ ++ { 0, 0, sys_sync, "sync" }, /* 6157 */ ++ { 1, TF, sys_acct, "acct" }, /* 6158 */ ++ { 2, 0, sys_settimeofday, "settimeofday" }, /* 6159 */ ++ { 5, TF, sys_mount, "mount" }, /* 6160 */ ++ { 2, TF, sys_umount2, "umount" }, /* 6161 */ ++ { 1, TF, sys_swapon, "swapon" }, /* 6162 */ ++ { 1, 0, sys_swapoff, "swapoff" }, /* 6163 */ ++ { 3, 0, sys_reboot, "reboot" }, /* 6164 */ ++ { 2, 0, sys_sethostname, "sethostname" }, /* 6165 */ ++ { 2, 0, sys_setdomainname, "setdomainname" }, /* 6166 */ ++ { 2, 0, sys_create_module, "create_module" }, /* 6167 */ ++ { 4, 0, sys_init_module, "init_module" }, /* 6168 */ ++ { 1, 0, sys_delete_module, "delete_module" }, /* 6169 */ ++ { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 6170 */ ++ { 5, 0, sys_query_module, "query_module" }, /* 6171 */ ++ { 4, 0, sys_quotactl, "quotactl" }, /* 6172 */ ++ { 3, 0, printargs, "nfsservctl" }, /* 6173 */ ++ { 5, TN, printargs, "getpmsg" }, /* 6174 */ ++ { 5, TN, printargs, "putpmsg" }, /* 6175 */ ++ { 0, 0, sys_afs_syscall, "afs_syscall" }, /* 6176 */ ++ { 0, 0, printargs, "reserved177" }, /* 6177 */ ++ { 0, 0, printargs, "gettid" }, /* 6178 */ ++ { 3, 0, sys_readahead, "readahead" }, /* 6179 */ ++ { 5, 0, sys_setxattr, "setxattr" }, /* 6180 */ ++ { 5, 0, sys_setxattr, "lsetxattr" }, /* 6181 */ ++ { 5, 0, sys_fsetxattr, "fsetxattr" }, /* 6182 */ ++ { 4, 0, sys_getxattr, "getxattr" }, /* 6183 */ ++ { 4, 0, sys_getxattr, "lgetxattr" }, /* 6184 */ ++ { 4, 0, sys_fgetxattr, "fgetxattr" }, /* 6185 */ ++ { 3, 0, sys_listxattr, "listxattr" }, /* 6186 */ ++ { 3, 0, sys_listxattr, "llistxattr" }, /* 6187 */ ++ { 3, 0, sys_flistxattr, "flistxattr" }, /* 6188 */ ++ { 2, 0, sys_removexattr, "removexattr" }, /* 6189 */ ++ { 2, 0, sys_removexattr, "lremovexattr" }, /* 6190 */ ++ { 2, 0, sys_fremovexattr, "fremovexattr" }, /* 6191 */ ++ { 2, 0, sys_kill, "tkill" }, /* 6192 */ ++ { 1, 0, sys_time, "time" }, /* 6193 */ ++ { 5, 0, printargs, "futex" }, /* 6194 */ ++ { 3, 0, printargs, "sched_setaffinity"}, /* 6195 */ ++ { 3, 0, printargs, "sched_getaffinity"}, /* 6196 */ ++ { 3, 0, printargs, "cacheflush" }, /* 6197 */ ++ { 3, 0, printargs, "cachectl" }, /* 6198 */ ++ { 4, 0, sys_sysmips, "sysmips" }, /* 6199 */ ++ { 0, 0, printargs, "io_setup" }, /* 6200 */ ++ { 0, 0, printargs, "io_destroy" }, /* 6201 */ ++ { 0, 0, printargs, "io_getevents" }, /* 6202 */ ++ { 0, 0, printargs, "io_submit" }, /* 6203 */ ++ { 0, 0, printargs, "io_cancel" }, /* 6204 */ ++ { 1, TP, sys_exit, "exit_group"}, /* 6205 */ ++ { 3, 0, printargs, "lookup_dcookie" }, /* 6206 */ ++ { 1, 0, sys_epoll_create, "epoll_create" }, /* 6207 */ ++ { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 6208 */ ++ { 3, TD, sys_epoll_wait, "epoll_wait" }, /* 6209 */ ++ { 5, 0, sys_remap_file_pages, "remap_file_pages" }, /* 6210 */ ++ { 1, TS, printargs, "rt_sigreturn" }, /* 6211 */ ++ { 3, 0, sys_fcntl, "fcntl64" }, /* 6212 */ ++ { 0, 0, printargs, "set_tid_address" }, /* 6213 */ ++ { 0, 0, printargs, "restart_syscall" }, /* 6214 */ ++ { 0, 0, printargs, "semtimedop" }, /* 6215 */ ++ { 0, 0, printargs, "fadvise64" }, /* 6216 */ ++ { 0, 0, printargs, "statfs64" }, /* 6217 */ ++ { 0, 0, printargs, "fstatfs64" }, /* 6218 */ ++ { 4, 0, printargs, "sendfile64" }, /* 6219 */ ++ { 3, 0, printargs, "timer_create" }, /* 6220 */ ++ { 4, 0, printargs, "timer_settime" }, /* 6221 */ ++ { 2, 0, printargs, "timer_gettime" }, /* 6222 */ ++ { 1, 0, printargs, "timer_getoverrun" }, /* 6223 */ ++ { 1, 0, printargs, "timer_delete" }, /* 6224 */ ++ { 2, 0, printargs, "clock_settime" }, /* 6225 */ ++ { 2, 0, printargs, "clock_gettime" }, /* 6226 */ ++ { 2, 0, printargs, "clock_getres" }, /* 6227 */ ++ { 4, 0, printargs, "clock_nanosleep" }, /* 6228 */ ++ { 3, 0, printargs, "tgkill" }, /* 6229 */ ++ { 2, 0, printargs, "utimes" }, /* 6230 */ ++#else ++ { 0, 0, printargs, "n32_read" }, /* 6000 */ ++ { 0, 0, printargs, "n32_write" }, /* 6001 */ ++ { 0, 0, printargs, "n32_open" }, /* 6002 */ ++ { 0, 0, printargs, "n32_close" }, /* 6003 */ ++ { 0, 0, printargs, "n32_stat" }, /* 6004 */ ++ { 0, 0, printargs, "n32_fstat" }, /* 6005 */ ++ { 0, 0, printargs, "n32_lstat" }, /* 6006 */ ++ { 0, 0, printargs, "n32_poll" }, /* 6007 */ ++ { 0, 0, printargs, "n32_lseek" }, /* 6008 */ ++ { 0, 0, printargs, "n32_mmap" }, /* 6009 */ ++ { 0, 0, printargs, "n32_mprotect" }, /* 6010 */ ++ { 0, 0, printargs, "n32_munmap" }, /* 6011 */ ++ { 0, 0, printargs, "n32_brk" }, /* 6012 */ ++ { 0, 0, printargs, "n32_rt_sigaction" }, /* 6013 */ ++ { 0, 0, printargs, "n32_rt_sigprocmask" }, /* 6014 */ ++ { 0, 0, printargs, "n32_ioctl" }, /* 6015 */ ++ { 0, 0, printargs, "n32_pread" }, /* 6016 */ ++ { 0, 0, printargs, "n32_pwrite" }, /* 6017 */ ++ { 0, 0, printargs, "n32_readv" }, /* 6018 */ ++ { 0, 0, printargs, "n32_writev" }, /* 6019 */ ++ { 0, 0, printargs, "n32_access" }, /* 6020 */ ++ { 0, 0, printargs, "n32_pipe" }, /* 6021 */ ++ { 0, 0, printargs, "n32__newselect" }, /* 6022 */ ++ { 0, 0, printargs, "n32_sched_yield" }, /* 6023 */ ++ { 0, 0, printargs, "n32_mremap" }, /* 6024 */ ++ { 0, 0, printargs, "n32_msync" }, /* 6025 */ ++ { 0, 0, printargs, "n32_mincore" }, /* 6026 */ ++ { 0, 0, printargs, "n32_madvise" }, /* 6027 */ ++ { 0, 0, printargs, "n32_shmget" }, /* 6028 */ ++ { 0, 0, printargs, "n32_shmgat" }, /* 6029 */ ++ { 0, 0, printargs, "n32_shmctl" }, /* 6030 */ ++ { 0, 0, printargs, "n32_dup" }, /* 6031 */ ++ { 0, 0, printargs, "n32_dup2" }, /* 6032 */ ++ { 0, 0, printargs, "n32_pause" }, /* 6033 */ ++ { 0, 0, printargs, "n32_nanosleep" }, /* 6034 */ ++ { 0, 0, printargs, "n32_getitimer" }, /* 6035 */ ++ { 0, 0, printargs, "n32_setitimer" }, /* 6036 */ ++ { 0, 0, printargs, "n32_alarm" }, /* 6037 */ ++ { 0, 0, printargs, "n32_getpid" }, /* 6038 */ ++ { 0, 0, printargs, "n32_sendfile" }, /* 6039 */ ++ { 0, 0, printargs, "n32_socketcall" }, /* 6040 */ ++ { 0, 0, printargs, "n32_connect" }, /* 6041 */ ++ { 0, 0, printargs, "n32_accept" }, /* 6042 */ ++ { 0, 0, printargs, "n32_sendto" }, /* 6043 */ ++ { 0, 0, printargs, "n32_recvfrom" }, /* 6044 */ ++ { 0, 0, printargs, "n32_sendmsg" }, /* 6045 */ ++ { 0, 0, printargs, "n32_recvmsg" }, /* 6046 */ ++ { 0, 0, printargs, "n32_shutdown" }, /* 6047 */ ++ { 0, 0, printargs, "n32_bind" }, /* 6048 */ ++ { 0, 0, printargs, "n32_listen" }, /* 6049 */ ++ { 0, 0, printargs, "n32_getsockname" }, /* 6050 */ ++ { 0, 0, printargs, "n32_getpeername" }, /* 6051 */ ++ { 0, 0, printargs, "n32_socketpair" }, /* 6052 */ ++ { 0, 0, printargs, "n32_setsockopt" }, /* 6053 */ ++ { 0, 0, printargs, "n32_getsockopt" }, /* 6054 */ ++ { 0, 0, printargs, "n32_clone" }, /* 6055 */ ++ { 0, 0, printargs, "n32_fork" }, /* 6056 */ ++ { 0, 0, printargs, "n32_execve" }, /* 6057 */ ++ { 0, 0, printargs, "n32_exit" }, /* 6058 */ ++ { 0, 0, printargs, "n32_wait4" }, /* 6059 */ ++ { 0, 0, printargs, "n32_kill" }, /* 6060 */ ++ { 0, 0, printargs, "n32_uname" }, /* 6061 */ ++ { 0, 0, printargs, "n32_semget" }, /* 6062 */ ++ { 0, 0, printargs, "n32_semop" }, /* 6063 */ ++ { 0, 0, printargs, "n32_semctl" }, /* 6064 */ ++ { 0, 0, printargs, "n32_shmdt" }, /* 6065 */ ++ { 0, 0, printargs, "n32_msgget" }, /* 6066 */ ++ { 0, 0, printargs, "n32_msgsnd" }, /* 6067 */ ++ { 0, 0, printargs, "n32_msgrcv" }, /* 6068 */ ++ { 0, 0, printargs, "n32_msgctl" }, /* 6069 */ ++ { 0, 0, printargs, "n32_fcntl" }, /* 6070 */ ++ { 0, 0, printargs, "n32_flock" }, /* 6071 */ ++ { 0, 0, printargs, "n32_fsync" }, /* 6072 */ ++ { 0, 0, printargs, "n32_fdatasync" }, /* 6073 */ ++ { 0, 0, printargs, "n32_truncate" }, /* 6074 */ ++ { 0, 0, printargs, "n32_ftruncate" }, /* 6075 */ ++ { 0, 0, printargs, "n32_getdents" }, /* 6076 */ ++ { 0, 0, printargs, "n32_getcwd" }, /* 6077 */ ++ { 0, 0, printargs, "n32_chdir" }, /* 6078 */ ++ { 0, 0, printargs, "n32_fchdir" }, /* 6079 */ ++ { 0, 0, printargs, "n32_rename" }, /* 6080 */ ++ { 0, 0, printargs, "n32_mkdir" }, /* 6081 */ ++ { 0, 0, printargs, "n32_rmdir" }, /* 6082 */ ++ { 0, 0, printargs, "n32_creat" }, /* 6083 */ ++ { 0, 0, printargs, "n32_link" }, /* 6084 */ ++ { 0, 0, printargs, "n32_unlink" }, /* 6085 */ ++ { 0, 0, printargs, "n32_symlink" }, /* 6086 */ ++ { 0, 0, printargs, "n32_readlink" }, /* 6087 */ ++ { 0, 0, printargs, "n32_chmod" }, /* 6088 */ ++ { 0, 0, printargs, "n32_fchmod" }, /* 6089 */ ++ { 0, 0, printargs, "n32_chown" }, /* 6090 */ ++ { 0, 0, printargs, "n32_fchown" }, /* 6091 */ ++ { 0, 0, printargs, "n32_lchown" }, /* 6092 */ ++ { 0, 0, printargs, "n32_umask" }, /* 6093 */ ++ { 0, 0, printargs, "n32_gettimeofday" }, /* 6094 */ ++ { 0, 0, printargs, "n32_getrlimit" }, /* 6095 */ ++ { 0, 0, printargs, "n32_getrusage" }, /* 6096 */ ++ { 0, 0, printargs, "n32_sysinfo" }, /* 6097 */ ++ { 0, 0, printargs, "n32_times" }, /* 6098 */ ++ { 0, 0, printargs, "n32_ptrace" }, /* 6099 */ ++ { 0, 0, printargs, "n32_getuid" }, /* 6100 */ ++ { 0, 0, printargs, "n32_syslog" }, /* 6101 */ ++ { 0, 0, printargs, "n32_getgid" }, /* 6102 */ ++ { 0, 0, printargs, "n32_setuid" }, /* 6103 */ ++ { 0, 0, printargs, "n32_setgid" }, /* 6104 */ ++ { 0, 0, printargs, "n32_geteuid" }, /* 6105 */ ++ { 0, 0, printargs, "n32_getegid" }, /* 6106 */ ++ { 0, 0, printargs, "n32_setpgid" }, /* 6107 */ ++ { 0, 0, printargs, "n32_getppid" }, /* 6108 */ ++ { 0, 0, printargs, "n32_getpgrp" }, /* 6109 */ ++ { 0, 0, printargs, "n32_setsid" }, /* 6110 */ ++ { 0, 0, printargs, "n32_setreuid" }, /* 6111 */ ++ { 0, 0, printargs, "n32_setregid" }, /* 6112 */ ++ { 0, 0, printargs, "n32_getgroups" }, /* 6113 */ ++ { 0, 0, printargs, "n32_setgroups" }, /* 6114 */ ++ { 0, 0, printargs, "n32_setresuid" }, /* 6115 */ ++ { 0, 0, printargs, "n32_getresuid" }, /* 6116 */ ++ { 0, 0, printargs, "n32_setresgid" }, /* 6117 */ ++ { 0, 0, printargs, "n32_getresgid" }, /* 6118 */ ++ { 0, 0, printargs, "n32_getpgid" }, /* 6119 */ ++ { 0, 0, printargs, "n32_setfsuid" }, /* 6120 */ ++ { 0, 0, printargs, "n32_setfsgid" }, /* 6121 */ ++ { 0, 0, printargs, "n32_getsid" }, /* 6122 */ ++ { 0, 0, printargs, "n32_capget" }, /* 6123 */ ++ { 0, 0, printargs, "n32_capset" }, /* 6124 */ ++ { 0, 0, printargs, "n32_rt_sigpending" }, /* 6125 */ ++ { 0, 0, printargs, "n32_rt_sigtimedwait" }, /* 6126 */ ++ { 0, 0, printargs, "n32_rt_sigqueueinfo" }, /* 6127 */ ++ { 0, 0, printargs, "n32_rt_siguspend" }, /* 6128 */ ++ { 0, 0, printargs, "n32_sigaltstatck" }, /* 6129 */ ++ { 0, 0, printargs, "n32_utime" }, /* 6130 */ ++ { 0, 0, printargs, "n32_mknod" }, /* 6131 */ ++ { 0, 0, printargs, "n32_personality" }, /* 6132 */ ++ { 0, 0, printargs, "n32_ustat" }, /* 6133 */ ++ { 0, 0, printargs, "n32_statfs" }, /* 6134 */ ++ { 0, 0, printargs, "n32_fstatfs" }, /* 6135 */ ++ { 0, 0, printargs, "n32_sysfs" }, /* 6136 */ ++ { 0, 0, printargs, "n32_getpriority" }, /* 6137 */ ++ { 0, 0, printargs, "n32_setpriority" }, /* 6138 */ ++ { 0, 0, printargs, "n32_sched_setparam" }, /* 6139 */ ++ { 0, 0, printargs, "n32_sched_getparam" }, /* 6140 */ ++ { 0, 0, printargs, "n32_sched_setscheduler"}, /* 6141 */ ++ { 0, 0, printargs, "n32_sched_getscheduler"}, /* 6142 */ ++ { 0, 0, printargs, "n32_sched_get_priority_max"}, /* 6143 */ ++ { 0, 0, printargs, "n32_sched_get_priority_min"}, /* 6144 */ ++ { 0, 0, printargs, "n32_sched_rr_get_interval"}, /* 6145 */ ++ { 0, 0, printargs, "n32_mlock" }, /* 6146 */ ++ { 0, 0, printargs, "n32_munlock" }, /* 6147 */ ++ { 0, 0, printargs, "n32_mlockall" }, /* 6148 */ ++ { 0, 0, printargs, "n32_munlockall" }, /* 6149 */ ++ { 0, 0, printargs, "n32_vhangup" }, /* 6150 */ ++ { 0, 0, printargs, "n32_pivot_root" }, /* 6151 */ ++ { 0, 0, printargs, "n32__sysctl" }, /* 6152 */ ++ { 0, 0, printargs, "n32_prctl" }, /* 6153 */ ++ { 0, 0, printargs, "n32_adjtimex" }, /* 6154 */ ++ { 0, 0, printargs, "n32_setrlimit" }, /* 6155 */ ++ { 0, 0, printargs, "n32_chroot" }, /* 6156 */ ++ { 0, 0, printargs, "n32_sync" }, /* 6157 */ ++ { 0, 0, printargs, "n32_acct" }, /* 6158 */ ++ { 0, 0, printargs, "n32_settimeofday" }, /* 6159 */ ++ { 0, 0, printargs, "n32_mount" }, /* 6160 */ ++ { 0, 0, printargs, "n32_umount" }, /* 6161 */ ++ { 0, 0, printargs, "n32_swapon" }, /* 6162 */ ++ { 0, 0, printargs, "n32_swapoff" }, /* 6163 */ ++ { 0, 0, printargs, "n32_reboot" }, /* 6164 */ ++ { 0, 0, printargs, "n32_sethostname" }, /* 6165 */ ++ { 0, 0, printargs, "n32_setdomainname" }, /* 6166 */ ++ { 0, 0, printargs, "n32_create_module" }, /* 6167 */ ++ { 0, 0, printargs, "n32_init_module" }, /* 6168 */ ++ { 0, 0, printargs, "n32_delete_module" }, /* 6169 */ ++ { 0, 0, printargs, "n32_get_kernel_syms" }, /* 6170 */ ++ { 0, 0, printargs, "n32_query_module" }, /* 6171 */ ++ { 0, 0, printargs, "n32_quotactl" }, /* 6172 */ ++ { 0, 0, printargs, "n32_nfsservctl" }, /* 6173 */ ++ { 0, 0, printargs, "n32_getpmsg" }, /* 6174 */ ++ { 0, 0, printargs, "n32_putpmsg" }, /* 6175 */ ++ { 0, 0, printargs, "n32_afs_syscall" }, /* 6176 */ ++ { 0, 0, printargs, "n32_reserved177" }, /* 6177 */ ++ { 0, 0, printargs, "n32_gettid" }, /* 6178 */ ++ { 0, 0, printargs, "n32_readahead" }, /* 6179 */ ++ { 0, 0, printargs, "n32_setxattr" }, /* 6180 */ ++ { 0, 0, printargs, "n32_lsetxattr" }, /* 6181 */ ++ { 0, 0, printargs, "n32_fsetxattr" }, /* 6182 */ ++ { 0, 0, printargs, "n32_getxattr" }, /* 6183 */ ++ { 0, 0, printargs, "n32_lgetxattr" }, /* 6184 */ ++ { 0, 0, printargs, "n32_fgetxattr" }, /* 6185 */ ++ { 0, 0, printargs, "n32_listxattr" }, /* 6186 */ ++ { 0, 0, printargs, "n32_llistxattr" }, /* 6187 */ ++ { 0, 0, printargs, "n32_flistxattr" }, /* 6188 */ ++ { 0, 0, printargs, "n32_removexattr" }, /* 6189 */ ++ { 0, 0, printargs, "n32_lremovexattr" }, /* 6190 */ ++ { 0, 0, printargs, "n32_fremovexattr" }, /* 6191 */ ++ { 0, 0, printargs, "n32_tkill" }, /* 6192 */ ++ { 0, 0, printargs, "n32_time" }, /* 6193 */ ++ { 0, 0, printargs, "n32_futex" }, /* 6194 */ ++ { 0, 0, printargs, "n32_sched_setaffinity" }, /* 6195 */ ++ { 0, 0, printargs, "n32_sched_getaffinity" }, /* 6196 */ ++ { 0, 0, printargs, "n32_cacheflush" }, /* 6197 */ ++ { 0, 0, printargs, "n32_cachectl" }, /* 6198 */ ++ { 0, 0, printargs, "n32_sysmips" }, /* 6199 */ ++ { 0, 0, printargs, "n32_io_setup" }, /* 6200 */ ++ { 0, 0, printargs, "n32_io_destroy" }, /* 6201 */ ++ { 0, 0, printargs, "n32_io_getevents" }, /* 6202 */ ++ { 0, 0, printargs, "n32_io_submit" }, /* 6203 */ ++ { 0, 0, printargs, "n32_io_cancel" }, /* 6204 */ ++ { 1, TP, printargs, "n32_exit_group" }, /* 6205 */ ++ { 0, 0, printargs, "n32_lookup_dcookie" }, /* 6206 */ ++ { 0, 0, printargs, "n32_epoll_create" }, /* 6207 */ ++ { 0, 0, printargs, "n32_epoll_ctl" }, /* 6208 */ ++ { 0, 0, printargs, "n32_epoll_wait" }, /* 6209 */ ++ { 0, 0, printargs, "n32_remap_file_pages" }, /* 6210 */ ++ { 0, 0, printargs, "n32_rt_sigreturn" }, /* 6211 */ ++ { 0, 0, printargs, "n32_fcntl64" }, /* 6212 */ ++ { 0, 0, printargs, "n32_set_tid_address" }, /* 6213 */ ++ { 0, 0, printargs, "n32_restart_syscall" }, /* 6214 */ ++ { 0, 0, printargs, "n32_semtimedop" }, /* 6215 */ ++ { 0, 0, printargs, "n32_fadvise64" }, /* 6216 */ ++ { 0, 0, printargs, "n32_statfs64" }, /* 6217 */ ++ { 0, 0, printargs, "n32_fstatfs64" }, /* 6218 */ ++ { 0, 0, printargs, "n32_sendfile64" }, /* 6219 */ ++ { 3, 0, printargs, "n32_timer_create" }, /* 6220 */ ++ { 4, 0, printargs, "n32_timer_settime" }, /* 6221 */ ++ { 2, 0, printargs, "n32_timer_gettime" }, /* 6222 */ ++ { 1, 0, printargs, "n32_timer_getoverrun" }, /* 6223 */ ++ { 1, 0, printargs, "n32_timer_delete" }, /* 6224 */ ++ { 2, 0, printargs, "n32_clock_settime" }, /* 6225 */ ++ { 2, 0, printargs, "n32_clock_gettime" }, /* 6226 */ ++ { 2, 0, printargs, "n32_clock_getres" }, /* 6227 */ ++ { 4, 0, printargs, "n32_clock_nanosleep" }, /* 6228 */ ++ { 3, 0, printargs, "n32_tgkill" }, /* 6229 */ ++ { 2, 0, printargs, "n32_utimes" }, /* 6230 */ ++#endif ++ { 0, 0, printargs, "SYS_6231" }, /* 6231 */ ++ { 0, 0, printargs, "SYS_6232" }, /* 6232 */ ++ { 0, 0, printargs, "SYS_6233" }, /* 6233 */ ++ { 0, 0, printargs, "SYS_6234" }, /* 6234 */ ++ { 0, 0, printargs, "SYS_6235" }, /* 6235 */ ++ { 0, 0, printargs, "SYS_6236" }, /* 6236 */ ++ { 0, 0, printargs, "SYS_6237" }, /* 6237 */ ++ { 0, 0, printargs, "SYS_6238" }, /* 6238 */ ++ { 0, 0, printargs, "SYS_6239" }, /* 6239 */ ++ { 0, 0, printargs, "SYS_6240" }, /* 6240 */ ++ { 0, 0, printargs, "SYS_6241" }, /* 6241 */ ++ { 0, 0, printargs, "SYS_6242" }, /* 6242 */ ++ { 0, 0, printargs, "SYS_6243" }, /* 6243 */ ++ { 0, 0, printargs, "SYS_6244" }, /* 6244 */ ++ { 0, 0, printargs, "SYS_6245" }, /* 6245 */ ++ { 0, 0, printargs, "SYS_6246" }, /* 6246 */ ++ { 0, 0, printargs, "SYS_6247" }, /* 6247 */ ++ { 0, 0, printargs, "SYS_6248" }, /* 6248 */ ++ { 0, 0, printargs, "SYS_6249" }, /* 6249 */ ++ { 0, 0, printargs, "SYS_6250" }, /* 6250 */ ++ { 0, 0, printargs, "SYS_6251" }, /* 6251 */ ++ { 0, 0, printargs, "SYS_6252" }, /* 6252 */ ++ { 0, 0, printargs, "SYS_6253" }, /* 6253 */ ++ { 0, 0, printargs, "SYS_6254" }, /* 6254 */ ++ { 0, 0, printargs, "SYS_6255" }, /* 6255 */ ++ { 0, 0, printargs, "SYS_6256" }, /* 6256 */ ++ { 0, 0, printargs, "SYS_6257" }, /* 6257 */ ++ { 0, 0, printargs, "SYS_6258" }, /* 6258 */ ++ { 0, 0, printargs, "SYS_6259" }, /* 6259 */ ++ { 0, 0, printargs, "SYS_6260" }, /* 6260 */ ++ { 0, 0, printargs, "SYS_6261" }, /* 6261 */ ++ { 0, 0, printargs, "SYS_6262" }, /* 6262 */ ++ { 0, 0, printargs, "SYS_6263" }, /* 6263 */ ++ { 0, 0, printargs, "SYS_6264" }, /* 6264 */ ++ { 0, 0, printargs, "SYS_6265" }, /* 6265 */ ++ { 0, 0, printargs, "SYS_6266" }, /* 6266 */ ++ { 0, 0, printargs, "SYS_6267" }, /* 6267 */ ++ { 0, 0, printargs, "SYS_6268" }, /* 6268 */ ++ { 0, 0, printargs, "SYS_6269" }, /* 6269 */ ++ { 0, 0, printargs, "SYS_6270" }, /* 6270 */ ++ { 0, 0, printargs, "SYS_6271" }, /* 6271 */ ++ { 0, 0, printargs, "SYS_6272" }, /* 6272 */ ++ { 0, 0, printargs, "SYS_6273" }, /* 6273 */ ++ { 0, 0, printargs, "SYS_6274" }, /* 6274 */ ++ { 0, 0, printargs, "SYS_6275" }, /* 6275 */ ++ { 0, 0, printargs, "SYS_6276" }, /* 6276 */ ++ { 0, 0, printargs, "SYS_6277" }, /* 6277 */ ++ { 0, 0, printargs, "SYS_6278" }, /* 6278 */ ++ { 0, 0, printargs, "SYS_6279" }, /* 6279 */ ++ { 0, 0, printargs, "SYS_6280" }, /* 6280 */ ++ { 0, 0, printargs, "SYS_6281" }, /* 6281 */ ++ { 0, 0, printargs, "SYS_6282" }, /* 6282 */ ++ { 0, 0, printargs, "SYS_6283" }, /* 6283 */ ++ { 0, 0, printargs, "SYS_6284" }, /* 6284 */ ++ { 0, 0, printargs, "SYS_6285" }, /* 6285 */ ++ { 0, 0, printargs, "SYS_6286" }, /* 6286 */ ++ { 0, 0, printargs, "SYS_6287" }, /* 6287 */ ++ { 0, 0, printargs, "SYS_6288" }, /* 6288 */ ++ { 0, 0, printargs, "SYS_6289" }, /* 6289 */ ++ { 0, 0, printargs, "SYS_6290" }, /* 6290 */ ++ { 0, 0, printargs, "SYS_6291" }, /* 6291 */ ++ { 0, 0, printargs, "SYS_6292" }, /* 6292 */ ++ { 0, 0, printargs, "SYS_6293" }, /* 6293 */ ++ { 0, 0, printargs, "SYS_6294" }, /* 6294 */ ++ { 0, 0, printargs, "SYS_6295" }, /* 6295 */ ++ { 0, 0, printargs, "SYS_6296" }, /* 6296 */ ++ { 0, 0, printargs, "SYS_6297" }, /* 6297 */ ++ { 0, 0, printargs, "SYS_6298" }, /* 6298 */ ++ { 0, 0, printargs, "SYS_6299" }, /* 6299 */ ++ { 0, 0, printargs, "SYS_6300" }, /* 6300 */ ++ { 0, 0, printargs, "SYS_6301" }, /* 6301 */ ++ { 0, 0, printargs, "SYS_6302" }, /* 6302 */ ++ { 0, 0, printargs, "SYS_6303" }, /* 6303 */ ++ { 0, 0, printargs, "SYS_6304" }, /* 6304 */ ++ { 0, 0, printargs, "SYS_6305" }, /* 6305 */ ++ { 0, 0, printargs, "SYS_6306" }, /* 6306 */ ++ { 0, 0, printargs, "SYS_6307" }, /* 6307 */ ++ { 0, 0, printargs, "SYS_6308" }, /* 6308 */ ++ { 0, 0, printargs, "SYS_6309" }, /* 6309 */ ++ { 0, 0, printargs, "SYS_6310" }, /* 6310 */ ++ { 0, 0, printargs, "SYS_6311" }, /* 6311 */ ++ { 0, 0, printargs, "SYS_6312" }, /* 6312 */ ++ { 0, 0, printargs, "SYS_6313" }, /* 6313 */ ++ { 0, 0, printargs, "SYS_6314" }, /* 6314 */ ++ { 0, 0, printargs, "SYS_6315" }, /* 6315 */ ++ { 0, 0, printargs, "SYS_6316" }, /* 6316 */ ++ { 0, 0, printargs, "SYS_6317" }, /* 6317 */ ++ { 0, 0, printargs, "SYS_6318" }, /* 6318 */ ++ { 0, 0, printargs, "SYS_6319" }, /* 6319 */ ++ { 0, 0, printargs, "SYS_6320" }, /* 6320 */ ++ { 0, 0, printargs, "SYS_6321" }, /* 6321 */ ++ { 0, 0, printargs, "SYS_6322" }, /* 6322 */ ++ { 0, 0, printargs, "SYS_6323" }, /* 6323 */ ++ { 0, 0, printargs, "SYS_6324" }, /* 6324 */ ++ { 0, 0, printargs, "SYS_6325" }, /* 6325 */ ++ { 0, 0, printargs, "SYS_6326" }, /* 6326 */ ++ { 0, 0, printargs, "SYS_6327" }, /* 6327 */ ++ { 0, 0, printargs, "SYS_6328" }, /* 6328 */ ++ { 0, 0, printargs, "SYS_6329" }, /* 6329 */ ++ { 0, 0, printargs, "SYS_6330" }, /* 6330 */ ++ { 0, 0, printargs, "SYS_6331" }, /* 6331 */ ++ { 0, 0, printargs, "SYS_6332" }, /* 6332 */ ++ { 0, 0, printargs, "SYS_6333" }, /* 6333 */ ++ { 0, 0, printargs, "SYS_6334" }, /* 6334 */ ++ { 0, 0, printargs, "SYS_6335" }, /* 6335 */ ++ { 0, 0, printargs, "SYS_6336" }, /* 6336 */ ++ { 0, 0, printargs, "SYS_6337" }, /* 6337 */ ++ { 0, 0, printargs, "SYS_6338" }, /* 6338 */ ++ { 0, 0, printargs, "SYS_6339" }, /* 6339 */ ++ { 0, 0, printargs, "SYS_6340" }, /* 6340 */ ++ { 0, 0, printargs, "SYS_6341" }, /* 6341 */ ++ { 0, 0, printargs, "SYS_6342" }, /* 6342 */ ++ { 0, 0, printargs, "SYS_6343" }, /* 6343 */ ++ { 0, 0, printargs, "SYS_6344" }, /* 6344 */ ++ { 0, 0, printargs, "SYS_6345" }, /* 6345 */ ++ { 0, 0, printargs, "SYS_6346" }, /* 6346 */ ++ { 0, 0, printargs, "SYS_6347" }, /* 6347 */ ++ { 0, 0, printargs, "SYS_6348" }, /* 6348 */ ++ { 0, 0, printargs, "SYS_6349" }, /* 6349 */ ++ { 0, 0, printargs, "SYS_6350" }, /* 6350 */ ++ { 0, 0, printargs, "SYS_6351" }, /* 6351 */ ++ { 0, 0, printargs, "SYS_6352" }, /* 6352 */ ++ { 0, 0, printargs, "SYS_6353" }, /* 6353 */ ++ { 0, 0, printargs, "SYS_6354" }, /* 6354 */ ++ { 0, 0, printargs, "SYS_6355" }, /* 6355 */ ++ { 0, 0, printargs, "SYS_6356" }, /* 6356 */ ++ { 0, 0, printargs, "SYS_6357" }, /* 6357 */ ++ { 0, 0, printargs, "SYS_6358" }, /* 6358 */ ++ { 0, 0, printargs, "SYS_6359" }, /* 6359 */ ++ { 0, 0, printargs, "SYS_6360" }, /* 6360 */ ++ { 0, 0, printargs, "SYS_6361" }, /* 6361 */ ++ { 0, 0, printargs, "SYS_6362" }, /* 6362 */ ++ { 0, 0, printargs, "SYS_6363" }, /* 6363 */ ++ { 0, 0, printargs, "SYS_6364" }, /* 6364 */ ++ { 0, 0, printargs, "SYS_6365" }, /* 6365 */ ++ { 0, 0, printargs, "SYS_6366" }, /* 6366 */ ++ { 0, 0, printargs, "SYS_6367" }, /* 6367 */ ++ { 0, 0, printargs, "SYS_6368" }, /* 6368 */ ++ { 0, 0, printargs, "SYS_6369" }, /* 6369 */ ++ { 0, 0, printargs, "SYS_6370" }, /* 6370 */ ++ { 0, 0, printargs, "SYS_6371" }, /* 6371 */ ++ { 0, 0, printargs, "SYS_6372" }, /* 6372 */ ++ { 0, 0, printargs, "SYS_6373" }, /* 6373 */ ++ { 0, 0, printargs, "SYS_6374" }, /* 6374 */ ++ { 0, 0, printargs, "SYS_6375" }, /* 6375 */ ++ { 0, 0, printargs, "SYS_6376" }, /* 6376 */ ++ { 0, 0, printargs, "SYS_6377" }, /* 6377 */ ++ { 0, 0, printargs, "SYS_6378" }, /* 6378 */ ++ { 0, 0, printargs, "SYS_6379" }, /* 6379 */ ++ { 0, 0, printargs, "SYS_6380" }, /* 6380 */ ++ { 0, 0, printargs, "SYS_6381" }, /* 6381 */ ++ { 0, 0, printargs, "SYS_6382" }, /* 6382 */ ++ { 0, 0, printargs, "SYS_6383" }, /* 6383 */ ++ { 0, 0, printargs, "SYS_6384" }, /* 6384 */ ++ { 0, 0, printargs, "SYS_6385" }, /* 6385 */ ++ { 0, 0, printargs, "SYS_6386" }, /* 6386 */ ++ { 0, 0, printargs, "SYS_6387" }, /* 6387 */ ++ { 0, 0, printargs, "SYS_6388" }, /* 6388 */ ++ { 0, 0, printargs, "SYS_6389" }, /* 6389 */ ++ { 0, 0, printargs, "SYS_6390" }, /* 6390 */ ++ { 0, 0, printargs, "SYS_6391" }, /* 6391 */ ++ { 0, 0, printargs, "SYS_6392" }, /* 6392 */ ++ { 0, 0, printargs, "SYS_6393" }, /* 6393 */ ++ { 0, 0, printargs, "SYS_6394" }, /* 6394 */ ++ { 0, 0, printargs, "SYS_6395" }, /* 6395 */ ++ { 0, 0, printargs, "SYS_6396" }, /* 6396 */ ++ { 0, 0, printargs, "SYS_6397" }, /* 6397 */ ++ { 0, 0, printargs, "SYS_6398" }, /* 6398 */ ++ { 0, 0, printargs, "SYS_6399" }, /* 6399 */ ++ { 0, 0, printargs, "SYS_6400" }, /* 6400 */ ++ { 0, 0, printargs, "SYS_6401" }, /* 6401 */ ++ { 0, 0, printargs, "SYS_6402" }, /* 6402 */ ++ { 0, 0, printargs, "SYS_6403" }, /* 6403 */ ++ { 0, 0, printargs, "SYS_6404" }, /* 6404 */ ++ { 0, 0, printargs, "SYS_6405" }, /* 6405 */ ++ { 0, 0, printargs, "SYS_6406" }, /* 6406 */ ++ { 0, 0, printargs, "SYS_6407" }, /* 6407 */ ++ { 0, 0, printargs, "SYS_6408" }, /* 6408 */ ++ { 0, 0, printargs, "SYS_6409" }, /* 6409 */ ++ { 0, 0, printargs, "SYS_6410" }, /* 6410 */ ++ { 0, 0, printargs, "SYS_6411" }, /* 6411 */ ++ { 0, 0, printargs, "SYS_6412" }, /* 6412 */ ++ { 0, 0, printargs, "SYS_6413" }, /* 6413 */ ++ { 0, 0, printargs, "SYS_6414" }, /* 6414 */ ++ { 0, 0, printargs, "SYS_6415" }, /* 6415 */ ++ { 0, 0, printargs, "SYS_6416" }, /* 6416 */ ++ { 0, 0, printargs, "SYS_6417" }, /* 6417 */ ++ { 0, 0, printargs, "SYS_6418" }, /* 6418 */ ++ { 0, 0, printargs, "SYS_6419" }, /* 6419 */ ++ { 0, 0, printargs, "SYS_6420" }, /* 6420 */ ++ { 0, 0, printargs, "SYS_6421" }, /* 6421 */ ++ { 0, 0, printargs, "SYS_6422" }, /* 6422 */ ++ { 0, 0, printargs, "SYS_6423" }, /* 6423 */ ++ { 0, 0, printargs, "SYS_6424" }, /* 6424 */ ++ { 0, 0, printargs, "SYS_6425" }, /* 6425 */ ++ { 0, 0, printargs, "SYS_6426" }, /* 6426 */ ++ { 0, 0, printargs, "SYS_6427" }, /* 6427 */ ++ { 0, 0, printargs, "SYS_6428" }, /* 6428 */ ++ { 0, 0, printargs, "SYS_6429" }, /* 6429 */ ++ { 0, 0, printargs, "SYS_6430" }, /* 6430 */ ++ { 0, 0, printargs, "SYS_6431" }, /* 6431 */ ++ { 0, 0, printargs, "SYS_6432" }, /* 6432 */ ++ { 0, 0, printargs, "SYS_6433" }, /* 6433 */ ++ { 0, 0, printargs, "SYS_6434" }, /* 6434 */ ++ { 0, 0, printargs, "SYS_6435" }, /* 6435 */ ++ { 0, 0, printargs, "SYS_6436" }, /* 6436 */ ++ { 0, 0, printargs, "SYS_6437" }, /* 6437 */ ++ { 0, 0, printargs, "SYS_6438" }, /* 6438 */ ++ { 0, 0, printargs, "SYS_6439" }, /* 6439 */ ++ { 0, 0, printargs, "SYS_6440" }, /* 6440 */ ++ { 0, 0, printargs, "SYS_6441" }, /* 6441 */ ++ { 0, 0, printargs, "SYS_6442" }, /* 6442 */ ++ { 0, 0, printargs, "SYS_6443" }, /* 6443 */ ++ { 0, 0, printargs, "SYS_6444" }, /* 6444 */ ++ { 0, 0, printargs, "SYS_6445" }, /* 6445 */ ++ { 0, 0, printargs, "SYS_6446" }, /* 6446 */ ++ { 0, 0, printargs, "SYS_6447" }, /* 6447 */ ++ { 0, 0, printargs, "SYS_6448" }, /* 6448 */ ++ { 0, 0, printargs, "SYS_6449" }, /* 6449 */ ++ { 0, 0, printargs, "SYS_6450" }, /* 6450 */ ++ { 0, 0, printargs, "SYS_6451" }, /* 6451 */ ++ { 0, 0, printargs, "SYS_6452" }, /* 6452 */ ++ { 0, 0, printargs, "SYS_6453" }, /* 6453 */ ++ { 0, 0, printargs, "SYS_6454" }, /* 6454 */ ++ { 0, 0, printargs, "SYS_6455" }, /* 6455 */ ++ { 0, 0, printargs, "SYS_6456" }, /* 6456 */ ++ { 0, 0, printargs, "SYS_6457" }, /* 6457 */ ++ { 0, 0, printargs, "SYS_6458" }, /* 6458 */ ++ { 0, 0, printargs, "SYS_6459" }, /* 6459 */ ++ { 0, 0, printargs, "SYS_6460" }, /* 6460 */ ++ { 0, 0, printargs, "SYS_6461" }, /* 6461 */ ++ { 0, 0, printargs, "SYS_6462" }, /* 6462 */ ++ { 0, 0, printargs, "SYS_6463" }, /* 6463 */ ++ { 0, 0, printargs, "SYS_6464" }, /* 6464 */ ++ { 0, 0, printargs, "SYS_6465" }, /* 6465 */ ++ { 0, 0, printargs, "SYS_6466" }, /* 6466 */ ++ { 0, 0, printargs, "SYS_6467" }, /* 6467 */ ++ { 0, 0, printargs, "SYS_6468" }, /* 6468 */ ++ { 0, 0, printargs, "SYS_6469" }, /* 6469 */ ++ { 0, 0, printargs, "SYS_6470" }, /* 6470 */ ++ { 0, 0, printargs, "SYS_6471" }, /* 6471 */ ++ { 0, 0, printargs, "SYS_6472" }, /* 6472 */ ++ { 0, 0, printargs, "SYS_6473" }, /* 6473 */ ++ { 0, 0, printargs, "SYS_6474" }, /* 6474 */ ++ { 0, 0, printargs, "SYS_6475" }, /* 6475 */ ++ { 0, 0, printargs, "SYS_6476" }, /* 6476 */ ++ { 0, 0, printargs, "SYS_6477" }, /* 6477 */ ++ { 0, 0, printargs, "SYS_6478" }, /* 6478 */ ++ { 0, 0, printargs, "SYS_6479" }, /* 6479 */ ++ { 0, 0, printargs, "SYS_6480" }, /* 6480 */ ++ { 0, 0, printargs, "SYS_6481" }, /* 6481 */ ++ { 0, 0, printargs, "SYS_6482" }, /* 6482 */ ++ { 0, 0, printargs, "SYS_6483" }, /* 6483 */ ++ { 0, 0, printargs, "SYS_6484" }, /* 6484 */ ++ { 0, 0, printargs, "SYS_6485" }, /* 6485 */ ++ { 0, 0, printargs, "SYS_6486" }, /* 6486 */ ++ { 0, 0, printargs, "SYS_6487" }, /* 6487 */ ++ { 0, 0, printargs, "SYS_6488" }, /* 6488 */ ++ { 0, 0, printargs, "SYS_6489" }, /* 6489 */ ++ { 0, 0, printargs, "SYS_6490" }, /* 6490 */ ++ { 0, 0, printargs, "SYS_6491" }, /* 6491 */ ++ { 0, 0, printargs, "SYS_6492" }, /* 6492 */ ++ { 0, 0, printargs, "SYS_6493" }, /* 6493 */ ++ { 0, 0, printargs, "SYS_6494" }, /* 6494 */ ++ { 0, 0, printargs, "SYS_6495" }, /* 6495 */ ++ { 0, 0, printargs, "SYS_6496" }, /* 6496 */ ++ { 0, 0, printargs, "SYS_6497" }, /* 6497 */ ++ { 0, 0, printargs, "SYS_6498" }, /* 6498 */ ++ { 0, 0, printargs, "SYS_6499" }, /* 6499 */ ++ { 0, 0, printargs, "SYS_6500" }, /* 6500 */ ++ { 0, 0, printargs, "SYS_6501" }, /* 6501 */ ++ { 0, 0, printargs, "SYS_6502" }, /* 6502 */ ++ { 0, 0, printargs, "SYS_6503" }, /* 6503 */ ++ { 0, 0, printargs, "SYS_6504" }, /* 6504 */ ++ { 0, 0, printargs, "SYS_6505" }, /* 6505 */ ++ { 0, 0, printargs, "SYS_6506" }, /* 6506 */ ++ { 0, 0, printargs, "SYS_6507" }, /* 6507 */ ++ { 0, 0, printargs, "SYS_6508" }, /* 6508 */ ++ { 0, 0, printargs, "SYS_6509" }, /* 6509 */ ++ { 0, 0, printargs, "SYS_6510" }, /* 6510 */ ++ { 0, 0, printargs, "SYS_6511" }, /* 6511 */ ++ { 0, 0, printargs, "SYS_6512" }, /* 6512 */ ++ { 0, 0, printargs, "SYS_6513" }, /* 6513 */ ++ { 0, 0, printargs, "SYS_6514" }, /* 6514 */ ++ { 0, 0, printargs, "SYS_6515" }, /* 6515 */ ++ { 0, 0, printargs, "SYS_6516" }, /* 6516 */ ++ { 0, 0, printargs, "SYS_6517" }, /* 6517 */ ++ { 0, 0, printargs, "SYS_6518" }, /* 6518 */ ++ { 0, 0, printargs, "SYS_6519" }, /* 6519 */ ++ { 0, 0, printargs, "SYS_6520" }, /* 6520 */ ++ { 0, 0, printargs, "SYS_6521" }, /* 6521 */ ++ { 0, 0, printargs, "SYS_6522" }, /* 6522 */ ++ { 0, 0, printargs, "SYS_6523" }, /* 6523 */ ++ { 0, 0, printargs, "SYS_6524" }, /* 6524 */ ++ { 0, 0, printargs, "SYS_6525" }, /* 6525 */ ++ { 0, 0, printargs, "SYS_6526" }, /* 6526 */ ++ { 0, 0, printargs, "SYS_6527" }, /* 6527 */ ++ { 0, 0, printargs, "SYS_6528" }, /* 6528 */ ++ { 0, 0, printargs, "SYS_6529" }, /* 6529 */ ++ { 0, 0, printargs, "SYS_6530" }, /* 6530 */ ++ { 0, 0, printargs, "SYS_6531" }, /* 6531 */ ++ { 0, 0, printargs, "SYS_6532" }, /* 6532 */ ++ { 0, 0, printargs, "SYS_6533" }, /* 6533 */ ++ { 0, 0, printargs, "SYS_6534" }, /* 6534 */ ++ { 0, 0, printargs, "SYS_6535" }, /* 6535 */ ++ { 0, 0, printargs, "SYS_6536" }, /* 6536 */ ++ { 0, 0, printargs, "SYS_6537" }, /* 6537 */ ++ { 0, 0, printargs, "SYS_6538" }, /* 6538 */ ++ { 0, 0, printargs, "SYS_6539" }, /* 6539 */ ++ { 0, 0, printargs, "SYS_6540" }, /* 6540 */ ++ { 0, 0, printargs, "SYS_6541" }, /* 6541 */ ++ { 0, 0, printargs, "SYS_6542" }, /* 6542 */ ++ { 0, 0, printargs, "SYS_6543" }, /* 6543 */ ++ { 0, 0, printargs, "SYS_6544" }, /* 6544 */ ++ { 0, 0, printargs, "SYS_6545" }, /* 6545 */ ++ { 0, 0, printargs, "SYS_6546" }, /* 6546 */ ++ { 0, 0, printargs, "SYS_6547" }, /* 6547 */ ++ { 0, 0, printargs, "SYS_6548" }, /* 6548 */ ++ { 0, 0, printargs, "SYS_6549" }, /* 6549 */ ++ { 0, 0, printargs, "SYS_6550" }, /* 6550 */ ++ { 0, 0, printargs, "SYS_6551" }, /* 6551 */ ++ { 0, 0, printargs, "SYS_6552" }, /* 6552 */ ++ { 0, 0, printargs, "SYS_6553" }, /* 6553 */ ++ { 0, 0, printargs, "SYS_6554" }, /* 6554 */ ++ { 0, 0, printargs, "SYS_6555" }, /* 6555 */ ++ { 0, 0, printargs, "SYS_6556" }, /* 6556 */ ++ { 0, 0, printargs, "SYS_6557" }, /* 6557 */ ++ { 0, 0, printargs, "SYS_6558" }, /* 6558 */ ++ { 0, 0, printargs, "SYS_6559" }, /* 6559 */ ++ { 0, 0, printargs, "SYS_6560" }, /* 6560 */ ++ { 0, 0, printargs, "SYS_6561" }, /* 6561 */ ++ { 0, 0, printargs, "SYS_6562" }, /* 6562 */ ++ { 0, 0, printargs, "SYS_6563" }, /* 6563 */ ++ { 0, 0, printargs, "SYS_6564" }, /* 6564 */ ++ { 0, 0, printargs, "SYS_6565" }, /* 6565 */ ++ { 0, 0, printargs, "SYS_6566" }, /* 6566 */ ++ { 0, 0, printargs, "SYS_6567" }, /* 6567 */ ++ { 0, 0, printargs, "SYS_6568" }, /* 6568 */ ++ { 0, 0, printargs, "SYS_6569" }, /* 6569 */ ++ { 0, 0, printargs, "SYS_6570" }, /* 6570 */ ++ { 0, 0, printargs, "SYS_6571" }, /* 6571 */ ++ { 0, 0, printargs, "SYS_6572" }, /* 6572 */ ++ { 0, 0, printargs, "SYS_6573" }, /* 6573 */ ++ { 0, 0, printargs, "SYS_6574" }, /* 6574 */ ++ { 0, 0, printargs, "SYS_6575" }, /* 6575 */ ++ { 0, 0, printargs, "SYS_6576" }, /* 6576 */ ++ { 0, 0, printargs, "SYS_6577" }, /* 6577 */ ++ { 0, 0, printargs, "SYS_6578" }, /* 6578 */ ++ { 0, 0, printargs, "SYS_6579" }, /* 6579 */ ++ { 0, 0, printargs, "SYS_6580" }, /* 6580 */ ++ { 0, 0, printargs, "SYS_6581" }, /* 6581 */ ++ { 0, 0, printargs, "SYS_6582" }, /* 6582 */ ++ { 0, 0, printargs, "SYS_6583" }, /* 6583 */ ++ { 0, 0, printargs, "SYS_6584" }, /* 6584 */ ++ { 0, 0, printargs, "SYS_6585" }, /* 6585 */ ++ { 0, 0, printargs, "SYS_6586" }, /* 6586 */ ++ { 0, 0, printargs, "SYS_6587" }, /* 6587 */ ++ { 0, 0, printargs, "SYS_6588" }, /* 6588 */ ++ { 0, 0, printargs, "SYS_6589" }, /* 6589 */ ++ { 0, 0, printargs, "SYS_6590" }, /* 6590 */ ++ { 0, 0, printargs, "SYS_6591" }, /* 6591 */ ++ { 0, 0, printargs, "SYS_6592" }, /* 6592 */ ++ { 0, 0, printargs, "SYS_6593" }, /* 6593 */ ++ { 0, 0, printargs, "SYS_6594" }, /* 6594 */ ++ { 0, 0, printargs, "SYS_6595" }, /* 6595 */ ++ { 0, 0, printargs, "SYS_6596" }, /* 6596 */ ++ { 0, 0, printargs, "SYS_6597" }, /* 6597 */ ++ { 0, 0, printargs, "SYS_6598" }, /* 6598 */ ++ { 0, 0, printargs, "SYS_6599" }, /* 6599 */ ++ { 0, 0, printargs, "SYS_6600" }, /* 6600 */ ++ { 0, 0, printargs, "SYS_6601" }, /* 6601 */ ++ { 0, 0, printargs, "SYS_6602" }, /* 6602 */ ++ { 0, 0, printargs, "SYS_6603" }, /* 6603 */ ++ { 0, 0, printargs, "SYS_6604" }, /* 6604 */ ++ { 0, 0, printargs, "SYS_6605" }, /* 6605 */ ++ { 0, 0, printargs, "SYS_6606" }, /* 6606 */ ++ { 0, 0, printargs, "SYS_6607" }, /* 6607 */ ++ { 0, 0, printargs, "SYS_6608" }, /* 6608 */ ++ { 0, 0, printargs, "SYS_6609" }, /* 6609 */ ++ { 0, 0, printargs, "SYS_6610" }, /* 6610 */ ++ { 0, 0, printargs, "SYS_6611" }, /* 6611 */ ++ { 0, 0, printargs, "SYS_6612" }, /* 6612 */ ++ { 0, 0, printargs, "SYS_6613" }, /* 6613 */ ++ { 0, 0, printargs, "SYS_6614" }, /* 6614 */ ++ { 0, 0, printargs, "SYS_6615" }, /* 6615 */ ++ { 0, 0, printargs, "SYS_6616" }, /* 6616 */ ++ { 0, 0, printargs, "SYS_6617" }, /* 6617 */ ++ { 0, 0, printargs, "SYS_6618" }, /* 6618 */ ++ { 0, 0, printargs, "SYS_6619" }, /* 6619 */ ++ { 0, 0, printargs, "SYS_6620" }, /* 6620 */ ++ { 0, 0, printargs, "SYS_6621" }, /* 6621 */ ++ { 0, 0, printargs, "SYS_6622" }, /* 6622 */ ++ { 0, 0, printargs, "SYS_6623" }, /* 6623 */ ++ { 0, 0, printargs, "SYS_6624" }, /* 6624 */ ++ { 0, 0, printargs, "SYS_6625" }, /* 6625 */ ++ { 0, 0, printargs, "SYS_6626" }, /* 6626 */ ++ { 0, 0, printargs, "SYS_6627" }, /* 6627 */ ++ { 0, 0, printargs, "SYS_6628" }, /* 6628 */ ++ { 0, 0, printargs, "SYS_6629" }, /* 6629 */ ++ { 0, 0, printargs, "SYS_6630" }, /* 6630 */ ++ { 0, 0, printargs, "SYS_6631" }, /* 6631 */ ++ { 0, 0, printargs, "SYS_6632" }, /* 6632 */ ++ { 0, 0, printargs, "SYS_6633" }, /* 6633 */ ++ { 0, 0, printargs, "SYS_6634" }, /* 6634 */ ++ { 0, 0, printargs, "SYS_6635" }, /* 6635 */ ++ { 0, 0, printargs, "SYS_6636" }, /* 6636 */ ++ { 0, 0, printargs, "SYS_6637" }, /* 6637 */ ++ { 0, 0, printargs, "SYS_6638" }, /* 6638 */ ++ { 0, 0, printargs, "SYS_6639" }, /* 6639 */ ++ { 0, 0, printargs, "SYS_6640" }, /* 6640 */ ++ { 0, 0, printargs, "SYS_6641" }, /* 6641 */ ++ { 0, 0, printargs, "SYS_6642" }, /* 6642 */ ++ { 0, 0, printargs, "SYS_6643" }, /* 6643 */ ++ { 0, 0, printargs, "SYS_6644" }, /* 6644 */ ++ { 0, 0, printargs, "SYS_6645" }, /* 6645 */ ++ { 0, 0, printargs, "SYS_6646" }, /* 6646 */ ++ { 0, 0, printargs, "SYS_6647" }, /* 6647 */ ++ { 0, 0, printargs, "SYS_6648" }, /* 6648 */ ++ { 0, 0, printargs, "SYS_6649" }, /* 6649 */ ++ { 0, 0, printargs, "SYS_6650" }, /* 6650 */ ++ { 0, 0, printargs, "SYS_6651" }, /* 6651 */ ++ { 0, 0, printargs, "SYS_6652" }, /* 6652 */ ++ { 0, 0, printargs, "SYS_6653" }, /* 6653 */ ++ { 0, 0, printargs, "SYS_6654" }, /* 6654 */ ++ { 0, 0, printargs, "SYS_6655" }, /* 6655 */ ++ { 0, 0, printargs, "SYS_6656" }, /* 6656 */ ++ { 0, 0, printargs, "SYS_6657" }, /* 6657 */ ++ { 0, 0, printargs, "SYS_6658" }, /* 6658 */ ++ { 0, 0, printargs, "SYS_6659" }, /* 6659 */ ++ { 0, 0, printargs, "SYS_6660" }, /* 6660 */ ++ { 0, 0, printargs, "SYS_6661" }, /* 6661 */ ++ { 0, 0, printargs, "SYS_6662" }, /* 6662 */ ++ { 0, 0, printargs, "SYS_6663" }, /* 6663 */ ++ { 0, 0, printargs, "SYS_6664" }, /* 6664 */ ++ { 0, 0, printargs, "SYS_6665" }, /* 6665 */ ++ { 0, 0, printargs, "SYS_6666" }, /* 6666 */ ++ { 0, 0, printargs, "SYS_6667" }, /* 6667 */ ++ { 0, 0, printargs, "SYS_6668" }, /* 6668 */ ++ { 0, 0, printargs, "SYS_6669" }, /* 6669 */ ++ { 0, 0, printargs, "SYS_6670" }, /* 6670 */ ++ { 0, 0, printargs, "SYS_6671" }, /* 6671 */ ++ { 0, 0, printargs, "SYS_6672" }, /* 6672 */ ++ { 0, 0, printargs, "SYS_6673" }, /* 6673 */ ++ { 0, 0, printargs, "SYS_6674" }, /* 6674 */ ++ { 0, 0, printargs, "SYS_6675" }, /* 6675 */ ++ { 0, 0, printargs, "SYS_6676" }, /* 6676 */ ++ { 0, 0, printargs, "SYS_6677" }, /* 6677 */ ++ { 0, 0, printargs, "SYS_6678" }, /* 6678 */ ++ { 0, 0, printargs, "SYS_6679" }, /* 6679 */ ++ { 0, 0, printargs, "SYS_6680" }, /* 6680 */ ++ { 0, 0, printargs, "SYS_6681" }, /* 6681 */ ++ { 0, 0, printargs, "SYS_6682" }, /* 6682 */ ++ { 0, 0, printargs, "SYS_6683" }, /* 6683 */ ++ { 0, 0, printargs, "SYS_6684" }, /* 6684 */ ++ { 0, 0, printargs, "SYS_6685" }, /* 6685 */ ++ { 0, 0, printargs, "SYS_6686" }, /* 6686 */ ++ { 0, 0, printargs, "SYS_6687" }, /* 6687 */ ++ { 0, 0, printargs, "SYS_6688" }, /* 6688 */ ++ { 0, 0, printargs, "SYS_6689" }, /* 6689 */ ++ { 0, 0, printargs, "SYS_6690" }, /* 6690 */ ++ { 0, 0, printargs, "SYS_6691" }, /* 6691 */ ++ { 0, 0, printargs, "SYS_6692" }, /* 6692 */ ++ { 0, 0, printargs, "SYS_6693" }, /* 6693 */ ++ { 0, 0, printargs, "SYS_6694" }, /* 6694 */ ++ { 0, 0, printargs, "SYS_6695" }, /* 6695 */ ++ { 0, 0, printargs, "SYS_6696" }, /* 6696 */ ++ { 0, 0, printargs, "SYS_6697" }, /* 6697 */ ++ { 0, 0, printargs, "SYS_6698" }, /* 6698 */ ++ { 0, 0, printargs, "SYS_6699" }, /* 6699 */ ++ { 0, 0, printargs, "SYS_6700" }, /* 6700 */ ++ { 0, 0, printargs, "SYS_6701" }, /* 6701 */ ++ { 0, 0, printargs, "SYS_6702" }, /* 6702 */ ++ { 0, 0, printargs, "SYS_6703" }, /* 6703 */ ++ { 0, 0, printargs, "SYS_6704" }, /* 6704 */ ++ { 0, 0, printargs, "SYS_6705" }, /* 6705 */ ++ { 0, 0, printargs, "SYS_6706" }, /* 6706 */ ++ { 0, 0, printargs, "SYS_6707" }, /* 6707 */ ++ { 0, 0, printargs, "SYS_6708" }, /* 6708 */ ++ { 0, 0, printargs, "SYS_6709" }, /* 6709 */ ++ { 0, 0, printargs, "SYS_6710" }, /* 6710 */ ++ { 0, 0, printargs, "SYS_6711" }, /* 6711 */ ++ { 0, 0, printargs, "SYS_6712" }, /* 6712 */ ++ { 0, 0, printargs, "SYS_6713" }, /* 6713 */ ++ { 0, 0, printargs, "SYS_6714" }, /* 6714 */ ++ { 0, 0, printargs, "SYS_6715" }, /* 6715 */ ++ { 0, 0, printargs, "SYS_6716" }, /* 6716 */ ++ { 0, 0, printargs, "SYS_6717" }, /* 6717 */ ++ { 0, 0, printargs, "SYS_6718" }, /* 6718 */ ++ { 0, 0, printargs, "SYS_6719" }, /* 6719 */ ++ { 0, 0, printargs, "SYS_6720" }, /* 6720 */ ++ { 0, 0, printargs, "SYS_6721" }, /* 6721 */ ++ { 0, 0, printargs, "SYS_6722" }, /* 6722 */ ++ { 0, 0, printargs, "SYS_6723" }, /* 6723 */ ++ { 0, 0, printargs, "SYS_6724" }, /* 6724 */ ++ { 0, 0, printargs, "SYS_6725" }, /* 6725 */ ++ { 0, 0, printargs, "SYS_6726" }, /* 6726 */ ++ { 0, 0, printargs, "SYS_6727" }, /* 6727 */ ++ { 0, 0, printargs, "SYS_6728" }, /* 6728 */ ++ { 0, 0, printargs, "SYS_6729" }, /* 6729 */ ++ { 0, 0, printargs, "SYS_6730" }, /* 6730 */ ++ { 0, 0, printargs, "SYS_6731" }, /* 6731 */ ++ { 0, 0, printargs, "SYS_6732" }, /* 6732 */ ++ { 0, 0, printargs, "SYS_6733" }, /* 6733 */ ++ { 0, 0, printargs, "SYS_6734" }, /* 6734 */ ++ { 0, 0, printargs, "SYS_6735" }, /* 6735 */ ++ { 0, 0, printargs, "SYS_6736" }, /* 6736 */ ++ { 0, 0, printargs, "SYS_6737" }, /* 6737 */ ++ { 0, 0, printargs, "SYS_6738" }, /* 6738 */ ++ { 0, 0, printargs, "SYS_6739" }, /* 6739 */ ++ { 0, 0, printargs, "SYS_6740" }, /* 6740 */ ++ { 0, 0, printargs, "SYS_6741" }, /* 6741 */ ++ { 0, 0, printargs, "SYS_6742" }, /* 6742 */ ++ { 0, 0, printargs, "SYS_6743" }, /* 6743 */ ++ { 0, 0, printargs, "SYS_6744" }, /* 6744 */ ++ { 0, 0, printargs, "SYS_6745" }, /* 6745 */ ++ { 0, 0, printargs, "SYS_6746" }, /* 6746 */ ++ { 0, 0, printargs, "SYS_6747" }, /* 6747 */ ++ { 0, 0, printargs, "SYS_6748" }, /* 6748 */ ++ { 0, 0, printargs, "SYS_6749" }, /* 6749 */ ++ { 0, 0, printargs, "SYS_6750" }, /* 6750 */ ++ { 0, 0, printargs, "SYS_6751" }, /* 6751 */ ++ { 0, 0, printargs, "SYS_6752" }, /* 6752 */ ++ { 0, 0, printargs, "SYS_6753" }, /* 6753 */ ++ { 0, 0, printargs, "SYS_6754" }, /* 6754 */ ++ { 0, 0, printargs, "SYS_6755" }, /* 6755 */ ++ { 0, 0, printargs, "SYS_6756" }, /* 6756 */ ++ { 0, 0, printargs, "SYS_6757" }, /* 6757 */ ++ { 0, 0, printargs, "SYS_6758" }, /* 6758 */ ++ { 0, 0, printargs, "SYS_6759" }, /* 6759 */ ++ { 0, 0, printargs, "SYS_6760" }, /* 6760 */ ++ { 0, 0, printargs, "SYS_6761" }, /* 6761 */ ++ { 0, 0, printargs, "SYS_6762" }, /* 6762 */ ++ { 0, 0, printargs, "SYS_6763" }, /* 6763 */ ++ { 0, 0, printargs, "SYS_6764" }, /* 6764 */ ++ { 0, 0, printargs, "SYS_6765" }, /* 6765 */ ++ { 0, 0, printargs, "SYS_6766" }, /* 6766 */ ++ { 0, 0, printargs, "SYS_6767" }, /* 6767 */ ++ { 0, 0, printargs, "SYS_6768" }, /* 6768 */ ++ { 0, 0, printargs, "SYS_6769" }, /* 6769 */ ++ { 0, 0, printargs, "SYS_6770" }, /* 6770 */ ++ { 0, 0, printargs, "SYS_6771" }, /* 6771 */ ++ { 0, 0, printargs, "SYS_6772" }, /* 6772 */ ++ { 0, 0, printargs, "SYS_6773" }, /* 6773 */ ++ { 0, 0, printargs, "SYS_6774" }, /* 6774 */ ++ { 0, 0, printargs, "SYS_6775" }, /* 6775 */ ++ { 0, 0, printargs, "SYS_6776" }, /* 6776 */ ++ { 0, 0, printargs, "SYS_6777" }, /* 6777 */ ++ { 0, 0, printargs, "SYS_6778" }, /* 6778 */ ++ { 0, 0, printargs, "SYS_6779" }, /* 6779 */ ++ { 0, 0, printargs, "SYS_6780" }, /* 6780 */ ++ { 0, 0, printargs, "SYS_6781" }, /* 6781 */ ++ { 0, 0, printargs, "SYS_6782" }, /* 6782 */ ++ { 0, 0, printargs, "SYS_6783" }, /* 6783 */ ++ { 0, 0, printargs, "SYS_6784" }, /* 6784 */ ++ { 0, 0, printargs, "SYS_6785" }, /* 6785 */ ++ { 0, 0, printargs, "SYS_6786" }, /* 6786 */ ++ { 0, 0, printargs, "SYS_6787" }, /* 6787 */ ++ { 0, 0, printargs, "SYS_6788" }, /* 6788 */ ++ { 0, 0, printargs, "SYS_6789" }, /* 6789 */ ++ { 0, 0, printargs, "SYS_6790" }, /* 6790 */ ++ { 0, 0, printargs, "SYS_6791" }, /* 6791 */ ++ { 0, 0, printargs, "SYS_6792" }, /* 6792 */ ++ { 0, 0, printargs, "SYS_6793" }, /* 6793 */ ++ { 0, 0, printargs, "SYS_6794" }, /* 6794 */ ++ { 0, 0, printargs, "SYS_6795" }, /* 6795 */ ++ { 0, 0, printargs, "SYS_6796" }, /* 6796 */ ++ { 0, 0, printargs, "SYS_6797" }, /* 6797 */ ++ { 0, 0, printargs, "SYS_6798" }, /* 6798 */ ++ { 0, 0, printargs, "SYS_6799" }, /* 6799 */ ++ { 0, 0, printargs, "SYS_6800" }, /* 6800 */ ++ { 0, 0, printargs, "SYS_6801" }, /* 6801 */ ++ { 0, 0, printargs, "SYS_6802" }, /* 6802 */ ++ { 0, 0, printargs, "SYS_6803" }, /* 6803 */ ++ { 0, 0, printargs, "SYS_6804" }, /* 6804 */ ++ { 0, 0, printargs, "SYS_6805" }, /* 6805 */ ++ { 0, 0, printargs, "SYS_6806" }, /* 6806 */ ++ { 0, 0, printargs, "SYS_6807" }, /* 6807 */ ++ { 0, 0, printargs, "SYS_6808" }, /* 6808 */ ++ { 0, 0, printargs, "SYS_6809" }, /* 6809 */ ++ { 0, 0, printargs, "SYS_6810" }, /* 6810 */ ++ { 0, 0, printargs, "SYS_6811" }, /* 6811 */ ++ { 0, 0, printargs, "SYS_6812" }, /* 6812 */ ++ { 0, 0, printargs, "SYS_6813" }, /* 6813 */ ++ { 0, 0, printargs, "SYS_6814" }, /* 6814 */ ++ { 0, 0, printargs, "SYS_6815" }, /* 6815 */ ++ { 0, 0, printargs, "SYS_6816" }, /* 6816 */ ++ { 0, 0, printargs, "SYS_6817" }, /* 6817 */ ++ { 0, 0, printargs, "SYS_6818" }, /* 6818 */ ++ { 0, 0, printargs, "SYS_6819" }, /* 6819 */ ++ { 0, 0, printargs, "SYS_6820" }, /* 6820 */ ++ { 0, 0, printargs, "SYS_6821" }, /* 6821 */ ++ { 0, 0, printargs, "SYS_6822" }, /* 6822 */ ++ { 0, 0, printargs, "SYS_6823" }, /* 6823 */ ++ { 0, 0, printargs, "SYS_6824" }, /* 6824 */ ++ { 0, 0, printargs, "SYS_6825" }, /* 6825 */ ++ { 0, 0, printargs, "SYS_6826" }, /* 6826 */ ++ { 0, 0, printargs, "SYS_6827" }, /* 6827 */ ++ { 0, 0, printargs, "SYS_6828" }, /* 6828 */ ++ { 0, 0, printargs, "SYS_6829" }, /* 6829 */ ++ { 0, 0, printargs, "SYS_6830" }, /* 6830 */ ++ { 0, 0, printargs, "SYS_6831" }, /* 6831 */ ++ { 0, 0, printargs, "SYS_6832" }, /* 6832 */ ++ { 0, 0, printargs, "SYS_6833" }, /* 6833 */ ++ { 0, 0, printargs, "SYS_6834" }, /* 6834 */ ++ { 0, 0, printargs, "SYS_6835" }, /* 6835 */ ++ { 0, 0, printargs, "SYS_6836" }, /* 6836 */ ++ { 0, 0, printargs, "SYS_6837" }, /* 6837 */ ++ { 0, 0, printargs, "SYS_6838" }, /* 6838 */ ++ { 0, 0, printargs, "SYS_6839" }, /* 6839 */ ++ { 0, 0, printargs, "SYS_6840" }, /* 6840 */ ++ { 0, 0, printargs, "SYS_6841" }, /* 6841 */ ++ { 0, 0, printargs, "SYS_6842" }, /* 6842 */ ++ { 0, 0, printargs, "SYS_6843" }, /* 6843 */ ++ { 0, 0, printargs, "SYS_6844" }, /* 6844 */ ++ { 0, 0, printargs, "SYS_6845" }, /* 6845 */ ++ { 0, 0, printargs, "SYS_6846" }, /* 6846 */ ++ { 0, 0, printargs, "SYS_6847" }, /* 6847 */ ++ { 0, 0, printargs, "SYS_6848" }, /* 6848 */ ++ { 0, 0, printargs, "SYS_6849" }, /* 6849 */ ++ { 0, 0, printargs, "SYS_6850" }, /* 6850 */ ++ { 0, 0, printargs, "SYS_6851" }, /* 6851 */ ++ { 0, 0, printargs, "SYS_6852" }, /* 6852 */ ++ { 0, 0, printargs, "SYS_6853" }, /* 6853 */ ++ { 0, 0, printargs, "SYS_6854" }, /* 6854 */ ++ { 0, 0, printargs, "SYS_6855" }, /* 6855 */ ++ { 0, 0, printargs, "SYS_6856" }, /* 6856 */ ++ { 0, 0, printargs, "SYS_6857" }, /* 6857 */ ++ { 0, 0, printargs, "SYS_6858" }, /* 6858 */ ++ { 0, 0, printargs, "SYS_6859" }, /* 6859 */ ++ { 0, 0, printargs, "SYS_6860" }, /* 6860 */ ++ { 0, 0, printargs, "SYS_6861" }, /* 6861 */ ++ { 0, 0, printargs, "SYS_6862" }, /* 6862 */ ++ { 0, 0, printargs, "SYS_6863" }, /* 6863 */ ++ { 0, 0, printargs, "SYS_6864" }, /* 6864 */ ++ { 0, 0, printargs, "SYS_6865" }, /* 6865 */ ++ { 0, 0, printargs, "SYS_6866" }, /* 6866 */ ++ { 0, 0, printargs, "SYS_6867" }, /* 6867 */ ++ { 0, 0, printargs, "SYS_6868" }, /* 6868 */ ++ { 0, 0, printargs, "SYS_6869" }, /* 6869 */ ++ { 0, 0, printargs, "SYS_6870" }, /* 6870 */ ++ { 0, 0, printargs, "SYS_6871" }, /* 6871 */ ++ { 0, 0, printargs, "SYS_6872" }, /* 6872 */ ++ { 0, 0, printargs, "SYS_6873" }, /* 6873 */ ++ { 0, 0, printargs, "SYS_6874" }, /* 6874 */ ++ { 0, 0, printargs, "SYS_6875" }, /* 6875 */ ++ { 0, 0, printargs, "SYS_6876" }, /* 6876 */ ++ { 0, 0, printargs, "SYS_6877" }, /* 6877 */ ++ { 0, 0, printargs, "SYS_6878" }, /* 6878 */ ++ { 0, 0, printargs, "SYS_6879" }, /* 6879 */ ++ { 0, 0, printargs, "SYS_6880" }, /* 6880 */ ++ { 0, 0, printargs, "SYS_6881" }, /* 6881 */ ++ { 0, 0, printargs, "SYS_6882" }, /* 6882 */ ++ { 0, 0, printargs, "SYS_6883" }, /* 6883 */ ++ { 0, 0, printargs, "SYS_6884" }, /* 6884 */ ++ { 0, 0, printargs, "SYS_6885" }, /* 6885 */ ++ { 0, 0, printargs, "SYS_6886" }, /* 6886 */ ++ { 0, 0, printargs, "SYS_6887" }, /* 6887 */ ++ { 0, 0, printargs, "SYS_6888" }, /* 6888 */ ++ { 0, 0, printargs, "SYS_6889" }, /* 6889 */ ++ { 0, 0, printargs, "SYS_6890" }, /* 6890 */ ++ { 0, 0, printargs, "SYS_6891" }, /* 6891 */ ++ { 0, 0, printargs, "SYS_6892" }, /* 6892 */ ++ { 0, 0, printargs, "SYS_6893" }, /* 6893 */ ++ { 0, 0, printargs, "SYS_6894" }, /* 6894 */ ++ { 0, 0, printargs, "SYS_6895" }, /* 6895 */ ++ { 0, 0, printargs, "SYS_6896" }, /* 6896 */ ++ { 0, 0, printargs, "SYS_6897" }, /* 6897 */ ++ { 0, 0, printargs, "SYS_6898" }, /* 6898 */ ++ { 0, 0, printargs, "SYS_6899" }, /* 6899 */ ++ { 0, 0, printargs, "SYS_6900" }, /* 6900 */ ++ { 0, 0, printargs, "SYS_6901" }, /* 6901 */ ++ { 0, 0, printargs, "SYS_6902" }, /* 6902 */ ++ { 0, 0, printargs, "SYS_6903" }, /* 6903 */ ++ { 0, 0, printargs, "SYS_6904" }, /* 6904 */ ++ { 0, 0, printargs, "SYS_6905" }, /* 6905 */ ++ { 0, 0, printargs, "SYS_6906" }, /* 6906 */ ++ { 0, 0, printargs, "SYS_6907" }, /* 6907 */ ++ { 0, 0, printargs, "SYS_6908" }, /* 6908 */ ++ { 0, 0, printargs, "SYS_6909" }, /* 6909 */ ++ { 0, 0, printargs, "SYS_6910" }, /* 6910 */ ++ { 0, 0, printargs, "SYS_6911" }, /* 6911 */ ++ { 0, 0, printargs, "SYS_6912" }, /* 6912 */ ++ { 0, 0, printargs, "SYS_6913" }, /* 6913 */ ++ { 0, 0, printargs, "SYS_6914" }, /* 6914 */ ++ { 0, 0, printargs, "SYS_6915" }, /* 6915 */ ++ { 0, 0, printargs, "SYS_6916" }, /* 6916 */ ++ { 0, 0, printargs, "SYS_6917" }, /* 6917 */ ++ { 0, 0, printargs, "SYS_6918" }, /* 6918 */ ++ { 0, 0, printargs, "SYS_6919" }, /* 6919 */ ++ { 0, 0, printargs, "SYS_6920" }, /* 6920 */ ++ { 0, 0, printargs, "SYS_6921" }, /* 6921 */ ++ { 0, 0, printargs, "SYS_6922" }, /* 6922 */ ++ { 0, 0, printargs, "SYS_6923" }, /* 6923 */ ++ { 0, 0, printargs, "SYS_6924" }, /* 6924 */ ++ { 0, 0, printargs, "SYS_6925" }, /* 6925 */ ++ { 0, 0, printargs, "SYS_6926" }, /* 6926 */ ++ { 0, 0, printargs, "SYS_6927" }, /* 6927 */ ++ { 0, 0, printargs, "SYS_6928" }, /* 6928 */ ++ { 0, 0, printargs, "SYS_6929" }, /* 6929 */ ++ { 0, 0, printargs, "SYS_6930" }, /* 6930 */ ++ { 0, 0, printargs, "SYS_6931" }, /* 6931 */ ++ { 0, 0, printargs, "SYS_6932" }, /* 6932 */ ++ { 0, 0, printargs, "SYS_6933" }, /* 6933 */ ++ { 0, 0, printargs, "SYS_6934" }, /* 6934 */ ++ { 0, 0, printargs, "SYS_6935" }, /* 6935 */ ++ { 0, 0, printargs, "SYS_6936" }, /* 6936 */ ++ { 0, 0, printargs, "SYS_6937" }, /* 6937 */ ++ { 0, 0, printargs, "SYS_6938" }, /* 6938 */ ++ { 0, 0, printargs, "SYS_6939" }, /* 6939 */ ++ { 0, 0, printargs, "SYS_6940" }, /* 6940 */ ++ { 0, 0, printargs, "SYS_6941" }, /* 6941 */ ++ { 0, 0, printargs, "SYS_6942" }, /* 6942 */ ++ { 0, 0, printargs, "SYS_6943" }, /* 6943 */ ++ { 0, 0, printargs, "SYS_6944" }, /* 6944 */ ++ { 0, 0, printargs, "SYS_6945" }, /* 6945 */ ++ { 0, 0, printargs, "SYS_6946" }, /* 6946 */ ++ { 0, 0, printargs, "SYS_6947" }, /* 6947 */ ++ { 0, 0, printargs, "SYS_6948" }, /* 6948 */ ++ { 0, 0, printargs, "SYS_6949" }, /* 6949 */ ++ { 0, 0, printargs, "SYS_6950" }, /* 6950 */ ++ { 0, 0, printargs, "SYS_6951" }, /* 6951 */ ++ { 0, 0, printargs, "SYS_6952" }, /* 6952 */ ++ { 0, 0, printargs, "SYS_6953" }, /* 6953 */ ++ { 0, 0, printargs, "SYS_6954" }, /* 6954 */ ++ { 0, 0, printargs, "SYS_6955" }, /* 6955 */ ++ { 0, 0, printargs, "SYS_6956" }, /* 6956 */ ++ { 0, 0, printargs, "SYS_6957" }, /* 6957 */ ++ { 0, 0, printargs, "SYS_6958" }, /* 6958 */ ++ { 0, 0, printargs, "SYS_6959" }, /* 6959 */ ++ { 0, 0, printargs, "SYS_6960" }, /* 6960 */ ++ { 0, 0, printargs, "SYS_6961" }, /* 6961 */ ++ { 0, 0, printargs, "SYS_6962" }, /* 6962 */ ++ { 0, 0, printargs, "SYS_6963" }, /* 6963 */ ++ { 0, 0, printargs, "SYS_6964" }, /* 6964 */ ++ { 0, 0, printargs, "SYS_6965" }, /* 6965 */ ++ { 0, 0, printargs, "SYS_6966" }, /* 6966 */ ++ { 0, 0, printargs, "SYS_6967" }, /* 6967 */ ++ { 0, 0, printargs, "SYS_6968" }, /* 6968 */ ++ { 0, 0, printargs, "SYS_6969" }, /* 6969 */ ++ { 0, 0, printargs, "SYS_6970" }, /* 6970 */ ++ { 0, 0, printargs, "SYS_6971" }, /* 6971 */ ++ { 0, 0, printargs, "SYS_6972" }, /* 6972 */ ++ { 0, 0, printargs, "SYS_6973" }, /* 6973 */ ++ { 0, 0, printargs, "SYS_6974" }, /* 6974 */ ++ { 0, 0, printargs, "SYS_6975" }, /* 6975 */ ++ { 0, 0, printargs, "SYS_6976" }, /* 6976 */ ++ { 0, 0, printargs, "SYS_6977" }, /* 6977 */ ++ { 0, 0, printargs, "SYS_6978" }, /* 6978 */ ++ { 0, 0, printargs, "SYS_6979" }, /* 6979 */ ++ { 0, 0, printargs, "SYS_6980" }, /* 6980 */ ++ { 0, 0, printargs, "SYS_6981" }, /* 6981 */ ++ { 0, 0, printargs, "SYS_6982" }, /* 6982 */ ++ { 0, 0, printargs, "SYS_6983" }, /* 6983 */ ++ { 0, 0, printargs, "SYS_6984" }, /* 6984 */ ++ { 0, 0, printargs, "SYS_6985" }, /* 6985 */ ++ { 0, 0, printargs, "SYS_6986" }, /* 6986 */ ++ { 0, 0, printargs, "SYS_6987" }, /* 6987 */ ++ { 0, 0, printargs, "SYS_6988" }, /* 6988 */ ++ { 0, 0, printargs, "SYS_6989" }, /* 6989 */ ++ { 0, 0, printargs, "SYS_6990" }, /* 6990 */ ++ { 0, 0, printargs, "SYS_6991" }, /* 6991 */ ++ { 0, 0, printargs, "SYS_6992" }, /* 6992 */ ++ { 0, 0, printargs, "SYS_6993" }, /* 6993 */ ++ { 0, 0, printargs, "SYS_6994" }, /* 6994 */ ++ { 0, 0, printargs, "SYS_6995" }, /* 6995 */ ++ { 0, 0, printargs, "SYS_6996" }, /* 6996 */ ++ { 0, 0, printargs, "SYS_6997" }, /* 6997 */ ++ { 0, 0, printargs, "SYS_6998" }, /* 6998 */ ++ { 0, 0, printargs, "SYS_6999" }, /* 6999 */ /* end of Linux N32 */ diff --git a/utils/strace/patches-4.5.16/004-no_cacheflush.patch b/utils/strace/patches-4.5.16/004-no_cacheflush.patch new file mode 100644 index 0000000..0a13143 --- /dev/null +++ b/utils/strace/patches-4.5.16/004-no_cacheflush.patch @@ -0,0 +1,13 @@ +--- a/system.c ++++ b/system.c +@@ -70,10 +70,6 @@ + #include + #endif + +-#ifdef SYS_cacheflush +-#include +-#endif +- + #ifdef HAVE_LINUX_USTNAME_H + #include + #endif diff --git a/utils/strace/patches-4.5.16/010-cris_support.patch b/utils/strace/patches-4.5.16/010-cris_support.patch new file mode 100644 index 0000000..07aa964 --- /dev/null +++ b/utils/strace/patches-4.5.16/010-cris_support.patch @@ -0,0 +1,345 @@ +diff -Naur strace-4.5.16.ori/config.h.in strace-4.5.16/config.h.in +--- strace-4.5.16.ori/config.h.in 2008-08-04 20:11:11.000000000 +0200 ++++ strace-4.5.16/config.h.in 2008-08-04 20:48:28.000000000 +0200 +@@ -403,6 +403,12 @@ + /* Define for the AMD x86-64 architecture. */ + #undef X86_64 + ++/* Define for the CRISv10 architecture. */ ++#undef CRISV10 ++ ++/* Define for the CRISv32 architecture. */ ++#undef CRISV32 ++ + /* Enable GNU extensions on systems that have them. */ + #ifndef _GNU_SOURCE + # undef _GNU_SOURCE +diff -Naur strace-4.5.16.ori/configure strace-4.5.16/configure +--- strace-4.5.16.ori/configure 2008-08-04 20:11:11.000000000 +0200 ++++ strace-4.5.16/configure 2008-08-04 21:15:39.000000000 +0200 +@@ -2539,6 +2539,22 @@ + _ACEOF + + ;; ++cris|crisv10) ++ arch=crisv10 ++ ++cat >>confdefs.h <<\_ACEOF ++#define CRISV10 1 ++_ACEOF ++ ++ ;; ++crisv32) ++ arch=crisv32 ++ ++cat >>confdefs.h <<\_ACEOF ++#define CRISV32 1 ++_ACEOF ++ ++ ;; + *) + { echo "$as_me:$LINENO: result: NO!" >&5 + echo "${ECHO_T}NO!" >&6; } +diff -Naur strace-4.5.16.ori/configure.ac strace-4.5.16/configure.ac +--- strace-4.5.16.ori/configure.ac 2008-08-04 20:11:11.000000000 +0200 ++++ strace-4.5.16/configure.ac 2008-08-04 20:50:58.000000000 +0200 +@@ -111,6 +111,14 @@ + AC_MSG_RESULT([NO!]) + AC_MSG_ERROR([architecture $host_cpu is not supported by strace]) + ;; ++cris|crisv10) ++ arch=crisv10 ++ AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.]) ++ ;; ++crisv32) ++ arch=crisv32 ++ AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.]) ++ ;; + esac + AC_MSG_RESULT($arch) + +diff -Naur strace-4.5.16.ori/process.c strace-4.5.16/process.c +--- strace-4.5.16.ori/process.c 2008-08-04 20:11:11.000000000 +0200 ++++ strace-4.5.16/process.c 2008-08-04 21:18:30.000000000 +0200 +@@ -548,7 +548,7 @@ + # define ARG_PTID (known_scno(tcp) == SYS_clone2 ? 3 : 2) + # define ARG_CTID (known_scno(tcp) == SYS_clone2 ? 4 : 3) + # define ARG_TLS (known_scno(tcp) == SYS_clone2 ? 5 : 4) +-# elif defined S390 || defined S390X ++# elif defined S390 || defined S390X || defined CRISV10 || defined CRISV32 + # define ARG_STACK 0 + # define ARG_FLAGS 1 + # define ARG_PTID 2 +@@ -704,6 +704,10 @@ + 0x100000 | new) < 0) + return -1; + return 0; ++#elif defined(CRISV10) || defined(CRISV32) ++ if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*PT_R9), new) < 0) ++ return -1; ++ return 0; + #elif defined(ARM) + /* Some kernels support this, some (pre-2.6.16 or so) don't. */ + # ifndef PTRACE_SET_SYSCALL +@@ -2934,6 +2938,77 @@ + { uoff(regs.r0), "r0" }, + { uoff(regs.r12_orig), "orig_r12" }, + #endif ++#ifdef CRISV10 ++ { 4*PT_FRAMETYPE, "4*PT_FRAMETYPE" }, ++ { 4*PT_ORIG_R10, "4*PT_ORIG_R10" }, ++ { 4*PT_R13, "4*PT_R13" }, ++ { 4*PT_R12, "4*PT_R12" }, ++ { 4*PT_R11, "4*PT_R11" }, ++ { 4*PT_R10, "4*PT_R10" }, ++ { 4*PT_R9, "4*PT_R9" }, ++ { 4*PT_R8, "4*PT_R8" }, ++ { 4*PT_R7, "4*PT_R7" }, ++ { 4*PT_R6, "4*PT_R6" }, ++ { 4*PT_R5, "4*PT_R5" }, ++ { 4*PT_R4, "4*PT_R4" }, ++ { 4*PT_R3, "4*PT_R3" }, ++ { 4*PT_R2, "4*PT_R2" }, ++ { 4*PT_R1, "4*PT_R1" }, ++ { 4*PT_R0, "4*PT_R0" }, ++ { 4*PT_MOF, "4*PT_MOF" }, ++ { 4*PT_DCCR, "4*PT_DCCR" }, ++ { 4*PT_SRP, "4*PT_SRP" }, ++ { 4*PT_IRP, "4*PT_IRP" }, ++ { 4*PT_CSRINSTR, "4*PT_CSRINSTR" }, ++ { 4*PT_CSRADDR, "4*PT_CSRADDR" }, ++ { 4*PT_CSRDATA, "4*PT_CSRDATA" }, ++ { 4*PT_USP, "4*PT_USP" }, ++#endif ++#ifdef CRISV32 ++ { 4*PT_ORIG_R10, "4*PT_ORIG_R10" }, ++ { 4*PT_R0, "4*PT_R0" }, ++ { 4*PT_R1, "4*PT_R1" }, ++ { 4*PT_R2, "4*PT_R2" }, ++ { 4*PT_R3, "4*PT_R3" }, ++ { 4*PT_R4, "4*PT_R4" }, ++ { 4*PT_R5, "4*PT_R5" }, ++ { 4*PT_R6, "4*PT_R6" }, ++ { 4*PT_R7, "4*PT_R7" }, ++ { 4*PT_R8, "4*PT_R8" }, ++ { 4*PT_R9, "4*PT_R9" }, ++ { 4*PT_R10, "4*PT_R10" }, ++ { 4*PT_R11, "4*PT_R11" }, ++ { 4*PT_R12, "4*PT_R12" }, ++ { 4*PT_R13, "4*PT_R13" }, ++ { 4*PT_ACR, "4*PT_ACR" }, ++ { 4*PT_SRS, "4*PT_SRS" }, ++ { 4*PT_MOF, "4*PT_MOF" }, ++ { 4*PT_SPC, "4*PT_SPC" }, ++ { 4*PT_CCS, "4*PT_CCS" }, ++ { 4*PT_SRP, "4*PT_SRP" }, ++ { 4*PT_ERP, "4*PT_ERP" }, ++ { 4*PT_EXS, "4*PT_EXS" }, ++ { 4*PT_EDA, "4*PT_EDA" }, ++ { 4*PT_USP, "4*PT_USP" }, ++ { 4*PT_PPC, "4*PT_PPC" }, ++ { 4*PT_BP_CTRL, "4*PT_BP_CTRL" }, ++ { 4*PT_BP+4, "4*PT_BP+4" }, ++ { 4*PT_BP+8, "4*PT_BP+8" }, ++ { 4*PT_BP+12, "4*PT_BP+12" }, ++ { 4*PT_BP+16, "4*PT_BP+16" }, ++ { 4*PT_BP+20, "4*PT_BP+20" }, ++ { 4*PT_BP+24, "4*PT_BP+24" }, ++ { 4*PT_BP+28, "4*PT_BP+28" }, ++ { 4*PT_BP+32, "4*PT_BP+32" }, ++ { 4*PT_BP+36, "4*PT_BP+36" }, ++ { 4*PT_BP+40, "4*PT_BP+40" }, ++ { 4*PT_BP+44, "4*PT_BP+44" }, ++ { 4*PT_BP+48, "4*PT_BP+48" }, ++ { 4*PT_BP+52, "4*PT_BP+52" }, ++ { 4*PT_BP+56, "4*PT_BP+56" }, ++#endif ++ ++#if !defined(CRISV10) && !defined(CRISV32) + #if !defined(S390) && !defined(S390X) && !defined(MIPS) && !defined(SPARC64) && !defined(AVR32) + { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" }, + #endif +@@ -2971,6 +3046,7 @@ + #if defined(I386) || defined(X86_64) + { uoff(u_debugreg), "offsetof(struct user, u_debugreg)" }, + #endif /* I386 */ ++#endif /* !CRISV10/!CRISV32 */ + #endif /* !IA64 */ + #endif /* !ALPHA */ + #endif /* !POWERPC/!SPARC */ +diff -Naur strace-4.5.16.ori/signal.c strace-4.5.16/signal.c +--- strace-4.5.16.ori/signal.c 2007-08-02 03:15:59.000000000 +0200 ++++ strace-4.5.16/signal.c 2008-08-04 20:57:04.000000000 +0200 +@@ -1449,9 +1449,38 @@ + } + return 0; + #else ++#if defined(CRISV10) || defined(CRISV32) ++ struct sigcontext sc; ++ ++ if (entering(tcp)) { ++ long regs[PT_MAX+1]; ++ ++ tcp->u_arg[0] = 0; ++ ++ if (ptrace(PTRACE_GETREGS, tcp->pid, NULL, (long)regs) < 0) { ++ perror("sigreturn: PTRACE_GETREGS"); ++ return 0; ++ } ++ if (umove(tcp, regs[PT_USP], &sc) < 0) ++ return 0; ++ tcp->u_arg[0] = 1; ++ tcp->u_arg[1] = sc.oldmask; ++ } else { ++ sigset_t sigm; ++ ++ long_to_sigset(tcp->u_arg[1], &sigm); ++ tcp->u_rval = tcp->u_error = 0; ++ if (tcp->u_arg[0] == 0) ++ return 0; ++ tcp->auxstr = sprintsigmask("mask now ", &sigm, 0); ++ return RVAL_NONE | RVAL_STR; ++ } ++ return 0; ++#else + #warning No sys_sigreturn() for this architecture + #warning (no problem, just a reminder :-) + return 0; ++#endif /* !CRISV10/!CRISV32 */ + #endif /* MIPS */ + #endif /* SPARC || SPARC64 */ + #endif /* ALPHA */ +diff -Naur strace-4.5.16.ori/syscall.c strace-4.5.16/syscall.c +--- strace-4.5.16.ori/syscall.c 2008-08-04 20:11:11.000000000 +0200 ++++ strace-4.5.16/syscall.c 2008-08-04 21:02:28.000000000 +0200 +@@ -809,6 +809,8 @@ + static long r9; + #elif defined(X86_64) + static long rax; ++#elif defined(CRISV10) || defined(CRISV32) ++ static long r10; + #elif defined(AVR32) + static struct pt_regs regs; + #endif +@@ -1294,7 +1296,10 @@ + return 0; + } + } +-#endif /* AVR32 */ ++#elif defined(CRISV10) || defined(CRISV32) ++ if (upeek(pid, 4*PT_R9, &scno) < 0) ++ return -1; ++#endif /* CRISV10/CRISV32 */ + #endif /* LINUX */ + #ifdef SUNOS4 + if (upeek(pid, uoff(u_arg[7]), &scno) < 0) +@@ -1489,6 +1494,14 @@ + fprintf(stderr, "stray syscall exit: r8 = %ld\n", r8); + return 0; + } ++#elif defined(CRISV10) || defined(CRISV32) ++ if (upeek(pid, 4*PT_R10, &r10) < 0) ++ return -1; ++ if (r10 != -ENOSYS && !(tcp->flags & TCB_INSYSCALL)) { ++ if (debug) ++ fprintf(stderr, "stray syscall exit: r10 = %ld\n", r10); ++ return 0; ++ } + #endif + #endif /* LINUX */ + return 1; +@@ -1663,6 +1676,17 @@ + tcp->u_rval = regs.r12; + u_error = 0; + } ++#else ++#if defined(CRISV10) || defined(CRISV32) ++ if (r10 && (unsigned) -r10 < nerrnos) { ++ tcp->u_rval = -1; ++ u_error = -r10; ++ } ++ else { ++ tcp->u_rval = r10; ++ u_error = 0; ++ } ++#endif /* CRISV10/CRISV32 */ + #endif /* AVR32 */ + #endif /* SH64 */ + #endif /* SH */ +@@ -2175,6 +2199,23 @@ + tcp->u_arg[3] = regs.r9; + tcp->u_arg[4] = regs.r5; + tcp->u_arg[5] = regs.r3; ++#elif defined(CRISV10) || defined(CRISV32) ++ { ++ int i; ++ static const int crisregs[] = { ++ 4*PT_ORIG_R10, 4*PT_R11, 4*PT_R12, ++ 4*PT_R13, 4*PT_MOF, 4*PT_SRP ++ }; ++ ++ if (tcp->scno >= 0 && tcp->scno < nsyscalls) ++ tcp->u_nargs = sysent[tcp->scno].nargs; ++ else ++ tcp->u_nargs = 0; ++ for (i = 0; i < tcp->u_nargs; i++) { ++ if (upeek(pid, crisregs[i], &tcp->u_arg[i]) < 0) ++ return -1; ++ } ++ } + #else /* Other architecture (like i386) (32bits specific) */ + { + int i; +diff -Naur strace-4.5.16.ori/util.c strace-4.5.16/util.c +--- strace-4.5.16.ori/util.c 2008-08-04 20:11:11.000000000 +0200 ++++ strace-4.5.16/util.c 2008-08-04 21:05:37.000000000 +0200 +@@ -1079,6 +1079,12 @@ + #elif defined(AVR32) + if (upeek(tcp->pid, REG_PC, &pc) < 0) + return -1; ++#elif defined(CRISV10) ++ if (upeek(tcp->pid, 4*PT_IRP, &pc) < 0) ++ return -1; ++#elif defined(CRISV32) ++ if (upeek(tcp->pid, 4*PT_ERP, &pc) < 0) ++ return -1; + #endif + return pc; + #endif /* LINUX */ +@@ -1235,6 +1241,22 @@ + return; + } + tprintf("[%08lx] ", pc); ++#elif defined(CRISV10) ++ long pc; ++ ++ if (upeek(tcp->pid, 4*PT_IRP, &pc) < 0) { ++ PRINTBADPC; ++ return; ++ } ++ tprintf("[%08lx] ", (unsigned long)pc); ++#elif defined(CRISV32) ++ long pc; ++ ++ if (upeek(tcp->pid, 4*PT_ERP, &pc) < 0) { ++ PRINTBADPC; ++ return; ++ } ++ tprintf("[%08lx] ", (unsigned long)pc); + #endif /* !architecture */ + #endif /* LINUX */ + +@@ -1419,6 +1441,13 @@ + # elif defined (AVR32) + # define arg0_offset (REG_R12) + # define arg1_offset (REG_R11) ++# elif defined CRISV10 || defined CRISV32 ++# define arg0_offset (4*PT_R11) ++# define arg1_offset (4*PT_ORIG_R10) ++# define restore_arg0(tcp, state, val) 0 ++# define restore_arg1(tcp, state, val) 0 ++# define arg0_index 1 ++# define arg1_index 0 + # else + # define arg0_offset 0 + # define arg1_offset 4 diff --git a/utils/stress/Makefile b/utils/stress/Makefile new file mode 100644 index 0000000..12203fa --- /dev/null +++ b/utils/stress/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=stress +PKG_VERSION:=1.0.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://weather.ou.edu/~apw/projects/stress +PKG_MD5SUM:=a607afa695a511765b40993a64c6e2f4 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/stress + SECTION:=utils + CATEGORY:=Utilities + TITLE:=stress is a simple stress utility + URL:=http://weather.ou.edu/~apw/projects/stress/ +endef + +define Package/stress/description +stress is a simple tool that imposes certain types of compute \ stress on +UNIX-like operating systems. +endef + +CONFIGURE_ARGS += \ + --prefix="/usr" + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS)" + +define Package/stress/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/stress $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,stress)) diff --git a/utils/sysstat/Makefile b/utils/sysstat/Makefile new file mode 100644 index 0000000..4be0bb1 --- /dev/null +++ b/utils/sysstat/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sysstat +PKG_VERSION:=9.0.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://pagesperso-orange.fr/sebastien.godard +PKG_MD5SUM:=e069daf192d259de905d7f8cdd85dc4e + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/sysstat + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Sysstat performance monitoring tools + URL:=http://pagesperso-orange.fr/sebastien.godard/index.html +endef + +define Package/sysstat/description + The sysstat utilities are a collection of performance monitoring tools for + Linux. These include sar, sadf, mpstat, iostat, pidstat and sa tools. +endef + +define Package/sysstat/conffiles +/etc/sysstat/sysstat.ioconf +/etc/sysstat/config +endef + +CONFIGURE_VARS+= \ + sa_lib_dir="/usr/lib/sysstat" \ + sa_dir="/var/log/sysstat" \ + conf_dir="/etc/sysstat" \ + +CONFIGURE_ARGS+= \ + --disable-documentation \ + +define Package/sysstat/install + $(INSTALL_DIR) $(1)/usr/lib/sysstat + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/sysstat/{sadc,sa1,sa2} $(1)/usr/lib/sysstat/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{sar,sadf,iostat,mpstat,pidstat} $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/sysstat + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/sysstat/sysstat.ioconf $(1)/etc/sysstat/ + $(INSTALL_CONF) ./files/config $(1)/etc/sysstat/config + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/sysstat.init $(1)/etc/init.d/sysstat +endef + +$(eval $(call BuildPackage,sysstat)) diff --git a/utils/sysstat/files/config b/utils/sysstat/files/config new file mode 100644 index 0000000..2d2721a --- /dev/null +++ b/utils/sysstat/files/config @@ -0,0 +1,4 @@ +# How long to keep log files (days), maximum is a month +# Used by sa2(8) script +HISTORY=3 + diff --git a/utils/sysstat/files/sysstat.init b/utils/sysstat/files/sysstat.init new file mode 100755 index 0000000..02039d5 --- /dev/null +++ b/utils/sysstat/files/sysstat.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common + +# The init file runs the sadc command in order to write +# the "LINUX RESTART" mark to the daily data file + +START=99 + +start() { + mkdir -p /var/log/sysstat + /usr/lib/sysstat/sadc -S DISK -F -L - +} + diff --git a/utils/tar/Makefile b/utils/tar/Makefile new file mode 100644 index 0000000..7f346f6 --- /dev/null +++ b/utils/tar/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2008-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=tar +PKG_VERSION:=1.23 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@GNU/$(PKG_NAME) +PKG_MD5SUM:=41e2ca4b924ec7860e51b43ad06cdb7e + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/tar + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+bzip2 + TITLE:=GNU tar + URL:=http://www.gnu.org/software/tar/ +endef + +define Package/tar/description + Tar is a program for packaging a set of files as a + single archive in tar format. +endef + +define Package/tar/postinst +#!/bin/sh +if [ -e $${IPKG_INSTROOT}/bin/tar ]; then + rm -r $${IPKG_INSTROOT}/bin/tar; +fi +ln -sf /usr/bin/tar $${IPKG_INSTROOT}/bin/tar +endef + +define Package/tar/postrm +#!/bin/sh +rm $${IPKG_INSTROOT}/bin/tar +ln -s busybox $${IPKG_INSTROOT}/bin/tar +$${IPKG_INSTROOT}/bin/tar 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/bin/tar +exit 0 +endef + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDLAGS)" + +define Package/tar/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,tar)) diff --git a/utils/taskwarrior/Makefile b/utils/taskwarrior/Makefile new file mode 100644 index 0000000..26b1c80 --- /dev/null +++ b/utils/taskwarrior/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2012 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:=taskwarrior +PKG_VERSION:=2.0.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=task-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.taskwarrior.org/download/ +PKG_MD5SUM:=b850b49f8b69bb4049c07d0914a0f7af + +PKG_INSTALL:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/task-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/taskwarrior + TITLE:=taskwarrior + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncurses +libstdcpp + URL:=http://taskwarrior.org/projects/show/taskwarrior + MAINTAINER:=Xiangfu Liu +endef + +define Package/taskwarrior/description + taskwarrior is a command-line todo list manager +endef + +define Package/taskwarrior/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/task $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,taskwarrior)) diff --git a/utils/tcpser/Makefile b/utils/tcpser/Makefile new file mode 100644 index 0000000..c0df184 --- /dev/null +++ b/utils/tcpser/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2009 Marek Drapal +# Copyright (C) 2009 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:=tcpser +PKG_VERSION:=1.0rc12 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.jbrain.com/pub/linux/serial/ +PKG_MD5SUM:=e712ae9fe6893bc825026b6dee6da9c0 + + +include $(INCLUDE_DIR)/package.mk + +define Package/tcpser + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Hayes compatible modem emulator + URL:=http://www.jbrain.com/pub/linux/serial/ + DEPENDS:=+libpthread +endef + +define Package/tcpser/description + TCPSER turns a PC serial port into an emulated Hayes compatible modem + that uses TCP/IP for incoming and outgoing connections. It can be used + to allow older applications and systems designed for modem use + to operate on the Internet. TCPSER supports all standard Hayes commands, + and understands extended and vendor proprietary commands (though it does + not implement many of them). TCPSER can be used for both inbound and + outbound connections. +endef + +define Build/Prepare + $(call Build/Prepare/Default) + $(CP) $(PKG_BUILD_DIR)/../$(PKG_NAME)/* $(PKG_BUILD_DIR)/ +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) CFLAGS="$(TARGET_CFLAGS) -I$(LINUX_DIR)/include" +endef + +define Package/tcpser/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tcpser $(1)/usr/bin/ +endef + + +$(eval $(call BuildPackage,tcpser)) diff --git a/utils/tcsh/Makefile b/utils/tcsh/Makefile new file mode 100644 index 0000000..b1b431f --- /dev/null +++ b/utils/tcsh/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2011 Nuno Goncalves +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=tcsh +PKG_VERSION:=6.17.00 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/tcsh/ +PKG_MD5SUM:=c47de903e3d52f6824c8dd0c91eeb477 + +include $(INCLUDE_DIR)/package.mk + +define Package/tcsh + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Enhanced Berkeley UNIX C shell + DEPENDS:=+libncurses + URL:=http://www.tcsh.org/ + MAINTAINER:=Nuno Goncalves +endef + +define Package/tcsh/description + Tcsh is an enhanced, but completely compatible + version of the Berkeley UNIX C shell (csh). It + is a command language interpreter usable both + as an interactive login shell and a shell + script command processor. It includes a + command-line editor, programmable word + completion, spelling correction, a history + mechanism, job control and a C-like syntax. +endef + +define Package/tcsh/postinst +#!/bin/sh +grep tcsh $${IPKG_INSTROOT}/etc/shells || \ + echo "/bin/tcsh" >> $${IPKG_INSTROOT}/etc/shells + echo "/bin/csh" >> $${IPKG_INSTROOT}/etc/shells +endef + +define Package/tcsh/install + $(INSTALL_DIR) $(1)/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tcsh $(1)/bin/ + ln -sf tcsh $(1)/bin/csh +endef + +$(eval $(call BuildPackage,tcsh)) diff --git a/utils/tcsh/patches/001-gethost b/utils/tcsh/patches/001-gethost new file mode 100644 index 0000000..62342e2 --- /dev/null +++ b/utils/tcsh/patches/001-gethost @@ -0,0 +1,11 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -365,7 +365,7 @@ + + gethost: gethost.c sh.err.h tc.const.h sh.h + rm -f gethost +- ${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${CPPFLAGS} ${DFLAGS} $(srcdir)/gethost.c ${LIBES} ${EXTRALIBS} ++ gcc -o gethost -g -O2 -I. -I. -D_PATH_TCSHELL='"/usr/local/bin/tcsh"' $(srcdir)/gethost.c ${LIBES} ${EXTRALIBS} + + tc.defs.c: gethost host.defs + @rm -f $@.tmp diff --git a/utils/tcsh/patches/002-NLS b/utils/tcsh/patches/002-NLS new file mode 100644 index 0000000..9c52afd --- /dev/null +++ b/utils/tcsh/patches/002-NLS @@ -0,0 +1,9 @@ +--- a/config/linux ++++ b/config/linux +@@ -106,6 +106,4 @@ + #endif + #define ECHO_STYLE BOTH_ECHO + +-#define NLS_CATALOGS +- + #endif /* _h_config */ diff --git a/utils/tesseract/Makefile b/utils/tesseract/Makefile new file mode 100644 index 0000000..86c152b --- /dev/null +++ b/utils/tesseract/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2011 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:=tesseract +PKG_VERSION:=3.01 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://tesseract-ocr.googlecode.com/files/ +PKG_MD5SUM:=1ba496e51a42358fb9d3ffe781b2d20a + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/tesseract + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Tesseract Open Source OCR Engine + URL:=http://tesseract-ocr.googlecode.com/ + DEPENDS:=+libleptonica +libpthread +libstdcpp +endef + +CONFIGURE_ARGS += \ + LIBLEPT_HEADERSDIR="$(STAGING_DIR)/usr/include" \ + +TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +define Build/Prepare + $(call Build/Prepare/Default) + $(SED) '1s/^\xEF\xBB\xBF//' $(PKG_BUILD_DIR)/ccutil/strngs.h +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/tesseract $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtesseract.{a,so*} $(1)/usr/lib/ +endef + +define Package/tesseract/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/* $(1)/usr/share/ +endef + +$(eval $(call BuildPackage,tesseract)) diff --git a/utils/testusb/Makefile b/utils/testusb/Makefile new file mode 100644 index 0000000..4364799 --- /dev/null +++ b/utils/testusb/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2007 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:=testusb +PKG_RELEASE:=1 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) +PKG_BUILD_DEPENDS := libpthread + +include $(INCLUDE_DIR)/package.mk + +define Package/testusb + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=@DEVEL +libpthread + TITLE:=USB testing utility + URL:=http://www.linux-usb.org/usbtest/testusb.c +endef + +define Package/testusb/description + This tool can be used to perform various tests with use of the usbtest driver. +endef + +define Build/Prepare + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) -Os -lpthread $(PKG_BUILD_DIR)/testusb.c -o $(PKG_BUILD_DIR)/$(PKG_NAME) +endef + +define Package/testusb/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/testusb $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,testusb)) diff --git a/utils/testusb/src/testusb.c b/utils/testusb/src/testusb.c new file mode 100644 index 0000000..28e25ca --- /dev/null +++ b/utils/testusb/src/testusb.c @@ -0,0 +1,427 @@ +/* $(CROSS_COMPILE)cc -Wall -g -lpthread -o testusb testusb.c */ + +/* + * Copyright (c) 2002 by David Brownell + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +/*-------------------------------------------------------------------------*/ + +#define TEST_CASES 30 + +// FIXME make these public somewhere; usbdevfs.h? + +struct usbtest_param { + // inputs + unsigned test_num; /* 0..(TEST_CASES-1) */ + unsigned iterations; + unsigned length; + unsigned vary; + unsigned sglen; + + // outputs + struct timeval duration; +}; +#define USBTEST_REQUEST _IOWR('U', 100, struct usbtest_param) + +/*-------------------------------------------------------------------------*/ + +/* #include */ + +struct usb_device_descriptor { + __u8 bLength; + __u8 bDescriptorType; + __u16 bcdUSB; + __u8 bDeviceClass; + __u8 bDeviceSubClass; + __u8 bDeviceProtocol; + __u8 bMaxPacketSize0; + __u16 idVendor; + __u16 idProduct; + __u16 bcdDevice; + __u8 iManufacturer; + __u8 iProduct; + __u8 iSerialNumber; + __u8 bNumConfigurations; +} __attribute__ ((packed)); + +enum usb_device_speed { + USB_SPEED_UNKNOWN = 0, /* enumerating */ + USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ + USB_SPEED_HIGH /* usb 2.0 */ +}; + +/*-------------------------------------------------------------------------*/ + +static char *speed (enum usb_device_speed s) +{ + switch (s) { + case USB_SPEED_UNKNOWN: return "unknown"; + case USB_SPEED_LOW: return "low"; + case USB_SPEED_FULL: return "full"; + case USB_SPEED_HIGH: return "high"; + default: return "??"; + } +} + +struct testdev { + struct testdev *next; + char *name; + pthread_t thread; + enum usb_device_speed speed; + unsigned ifnum : 8; + unsigned forever : 1; + int test; + + struct usbtest_param param; +}; +static struct testdev *testdevs; + +static int is_testdev (struct usb_device_descriptor *dev) +{ + /* FX2 with (tweaked) bulksrc firmware */ + if (dev->idVendor == 0x0547 && dev->idProduct == 0x1002) + return 1; + + /*----------------------------------------------------*/ + + /* devices that start up using the EZ-USB default device and + * which we can use after loading simple firmware. hotplug + * can fxload it, and then run this test driver. + * + * we return false positives in two cases: + * - the device has a "real" driver (maybe usb-serial) that + * renumerates. the device should vanish quickly. + * - the device doesn't have the test firmware installed. + */ + + /* generic EZ-USB FX controller */ + if (dev->idVendor == 0x0547 && dev->idProduct == 0x2235) + return 1; + + /* generic EZ-USB FX2 controller */ + if (dev->idVendor == 0x04b4 && dev->idProduct == 0x8613) + return 1; + + /* CY3671 development board with EZ-USB FX */ + if (dev->idVendor == 0x0547 && dev->idProduct == 0x0080) + return 1; + + /* Keyspan 19Qi uses an21xx (original EZ-USB) */ + if (dev->idVendor == 0x06cd && dev->idProduct == 0x010b) + return 1; + + /*----------------------------------------------------*/ + + /* "gadget zero", Linux-USB test software */ + if (dev->idVendor == 0x0525 && dev->idProduct == 0xa4a0) + return 1; + + /* user mode subset of that */ + if (dev->idVendor == 0x0525 && dev->idProduct == 0xa4a4) + return 1; + + /* iso version of usermode code */ + if (dev->idVendor == 0x0525 && dev->idProduct == 0xa4a3) + return 1; + + /* some GPL'd test firmware uses these IDs */ + + if (dev->idVendor == 0xfff0 && dev->idProduct == 0xfff0) + return 1; + + /*----------------------------------------------------*/ + + /* iBOT2 high speed webcam */ + if (dev->idVendor == 0x0b62 && dev->idProduct == 0x0059) + return 1; + + return 0; +} + +static int find_testdev (const char *name, const struct stat *sb, int flag) +{ + int fd; + struct usb_device_descriptor dev; + + if (flag != FTW_F) + return 0; + /* ignore /proc/bus/usb/{devices,drivers} */ + if (strrchr (name, '/')[1] == 'd') + return 0; + + if ((fd = open (name, O_RDONLY)) < 0) { + perror ("can't open dev file r/o"); + return 0; + } + if (read (fd, &dev, sizeof dev) != sizeof dev) + fputs ("short devfile read!\n", stderr); + else if (is_testdev (&dev)) { + struct testdev *entry; + + if ((entry = calloc (1, sizeof *entry)) == 0) { + fputs ("no mem!\n", stderr); + goto done; + } + entry->name = strdup (name); + if (!entry->name) { + free (entry); + goto done; + } + + // FIXME better to look at each interface and ask if it's + // bound to 'usbtest', rather than assume interface 0 + entry->ifnum = 0; + + // FIXME ask usbfs what speed; update USBDEVFS_CONNECTINFO + // so it tells about high speed etc + + fprintf (stderr, "%s speed\t%s\n", + speed (entry->speed), entry->name); + + entry->next = testdevs; + testdevs = entry; + } + +done: + close (fd); + return 0; +} + +static int +usbdev_ioctl (int fd, int ifno, unsigned request, void *param) +{ + struct usbdevfs_ioctl wrapper; + + wrapper.ifno = ifno; + wrapper.ioctl_code = request; + wrapper.data = param; + + return ioctl (fd, USBDEVFS_IOCTL, &wrapper); +} + +static void *handle_testdev (void *arg) +{ + struct testdev *dev = arg; + int fd, i; + int status; + + if ((fd = open (dev->name, O_RDWR)) < 0) { + perror ("can't open dev file r/w"); + return 0; + } + +restart: + for (i = 0; i < TEST_CASES; i++) { + if (dev->test != -1 && dev->test != i) + continue; + dev->param.test_num = i; + + status = usbdev_ioctl (fd, dev->ifnum, + USBTEST_REQUEST, &dev->param); + if (status < 0 && errno == EOPNOTSUPP) + continue; + + /* FIXME need a "syslog it" option for background testing */ + + /* NOTE: each thread emits complete lines; no fragments! */ + if (status < 0) { + char buf [80]; + int err = errno; + + if (strerror_r (errno, buf, sizeof buf)) { + snprintf (buf, sizeof buf, "error %d", err); + errno = err; + } + printf ("%s test %d --> %d (%s)\n", + dev->name, i, errno, buf); + } else + printf ("%s test %d, %4d.%.06d secs\n", dev->name, i, + (int) dev->param.duration.tv_sec, + (int) dev->param.duration.tv_usec); + + fflush (stdout); + } + if (dev->forever) + goto restart; + + close (fd); + return arg; +} + +int main (int argc, char **argv) +{ + int c; + struct testdev *entry; + char *device; + int all = 0, forever = 0, not = 0; + int test = -1 /* all */; + struct usbtest_param param; + + /* pick defaults that works with all speeds, without short packets. + * + * Best per-frame data rates: + * high speed, bulk 512 * 13 * 8 = 53248 + * interrupt 1024 * 3 * 8 = 24576 + * full speed, bulk/intr 64 * 19 = 1216 + * interrupt 64 * 1 = 64 + * low speed, interrupt 8 * 1 = 8 + */ + param.iterations = 1000; + param.length = 512; + param.vary = 512; + param.sglen = 32; + + /* for easy use when hotplugging */ + device = getenv ("DEVICE"); + + while ((c = getopt (argc, argv, "D:ac:g:hns:t:v:")) != EOF) + switch (c) { + case 'D': /* device, if only one */ + device = optarg; + continue; + case 'a': /* use all devices */ + device = 0; + all = 1; + continue; + case 'c': /* count iterations */ + param.iterations = atoi (optarg); + if (param.iterations < 0) + goto usage; + continue; + case 'g': /* scatter/gather entries */ + param.sglen = atoi (optarg); + if (param.sglen < 0) + goto usage; + continue; + case 'l': /* loop forever */ + forever = 1; + continue; + case 'n': /* no test running! */ + not = 1; + continue; + case 's': /* size of packet */ + param.length = atoi (optarg); + if (param.length < 0) + goto usage; + continue; + case 't': /* run just one test */ + test = atoi (optarg); + if (test < 0) + goto usage; + continue; + case 'v': /* vary packet size by ... */ + param.vary = atoi (optarg); + if (param.vary < 0) + goto usage; + continue; + case '?': + case 'h': + default: +usage: + fprintf (stderr, "usage: %s [-an] [-D dev]\n" + "\t[-c iterations] [-t testnum]\n" + "\t[-s packetsize] [-g sglen] [-v vary]\n", + argv [0]); + return 1; + } + if (optind != argc) + goto usage; + if (!all && !device) { + fprintf (stderr, "must specify '-a' or '-D dev', " + "or DEVICE=/proc/bus/usb/BBB/DDD in env\n"); + goto usage; + } + + if ((c = open ("/proc/bus/usb/devices", O_RDONLY)) < 0) { + fputs ("usbfs files are missing\n", stderr); + return -1; + } + + /* collect and list the test devices */ + if (ftw ("/proc/bus/usb", find_testdev, 3) != 0) { + fputs ("ftw failed; is usbfs missing?\n", stderr); + return -1; + } + + /* quit, run single test, or create test threads */ + if (!testdevs && !device) { + fputs ("no test devices recognized\n", stderr); + return -1; + } + if (not) + return 0; + if (testdevs && testdevs->next == 0 && !device) + device = testdevs->name; + for (entry = testdevs; entry; entry = entry->next) { + int status; + + entry->param = param; + entry->forever = forever; + entry->test = test; + + if (device) { + if (strcmp (entry->name, device)) + continue; + return handle_testdev (entry) != entry; + } + status = pthread_create (&entry->thread, 0, handle_testdev, entry); + if (status) { + perror ("pthread_create"); + continue; + } + } + if (device) { + struct testdev dev; + + /* kernel can recognize test devices we don't */ + fprintf (stderr, "%s: %s may see only control tests\n", + argv [0], device); + + memset (&dev, 0, sizeof dev); + dev.name = device; + dev.param = param; + dev.forever = forever; + dev.test = test; + return handle_testdev (&dev) != &dev; + } + + /* wait for tests to complete */ + for (entry = testdevs; entry; entry = entry->next) { + void *retval; + + if (pthread_join (entry->thread, &retval)) + perror ("pthread_join"); + /* testing errors discarded! */ + } + + return 0; +} diff --git a/utils/time/Makefile b/utils/time/Makefile new file mode 100644 index 0000000..7c0e15a --- /dev/null +++ b/utils/time/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2011 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:=time +PKG_VERSION:=1.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/time +PKG_MD5SUM:=e38d2b8b34b1ca259cf7b053caac32b3 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/time + SECTION:=utils + CATEGORY:=Utilities + TITLE:=The GNU time utility + URL:=http://www.gnu.org/software/time/ +endef + +define Package/time/description + `time' is a program that measures many of the CPU resources, such as time and + memory, that other programs use. The GNU version can format the output in + arbitrary ways by using a printf-style format string to include various + resource measurements. Some systems do not provide much information about + program resource use; `time' reports unavailable information as zero values. +endef + +define Package/time/preinst +#!/bin/sh +if [ -e $${IPKG_INSTROOT}/usr/bin/time ]; then + rm $${IPKG_INSTROOT}/usr/bin/time; +fi +endef + +define Package/time/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/time $(1)/usr/bin/ +endef + +define Package/time/postrm +#!/bin/sh +ln -sf ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/time +$${IPKG_INSTROOT}/usr/bin/time 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/time +exit 0 +endef + +$(eval $(call BuildPackage,time)) diff --git a/utils/time/patches/001-fix-configure.patch b/utils/time/patches/001-fix-configure.patch new file mode 100644 index 0000000..6d4af09 --- /dev/null +++ b/utils/time/patches/001-fix-configure.patch @@ -0,0 +1,22 @@ +--- a/configure.in ++++ b/configure.in +@@ -1,9 +1,6 @@ + dnl Process this file with autoconf to produce a configure script. + AC_INIT(time.c) +-VERSION=1.7 +-AC_SUBST(VERSION) +-PACKAGE=time +-AC_SUBST(PACKAGE) ++AM_INIT_AUTOMAKE(time, 1.7) + + AC_ARG_PROGRAM + +@@ -15,7 +12,7 @@ AC_PROG_INSTALL + dnl Checks for header files. + AC_HEADER_STDC + AC_HEADER_SYS_WAIT +-AC_CHECK_HEADERS(unistd.h string.h sys/rusage.h) ++AC_CHECK_HEADERS(unistd.h string.h sys/rusage.h sys/resource.h) + + dnl Checks for typedefs, structures, and compiler characteristics. + AC_C_CONST diff --git a/utils/time/patches/002-fix-rusage.patch b/utils/time/patches/002-fix-rusage.patch new file mode 100644 index 0000000..714cf0c --- /dev/null +++ b/utils/time/patches/002-fix-rusage.patch @@ -0,0 +1,11 @@ +--- a/resuse.h ++++ b/resuse.h +@@ -36,7 +36,7 @@ struct timeval + # include + #else + # define TV_MSEC tv_usec / 1000 +-# if HAVE_WAIT3 ++# if HAVE_SYS_RESOURCE_H + # include + # else + /* Process resource usage structure. */ diff --git a/utils/tmux/Makefile b/utils/tmux/Makefile new file mode 100644 index 0000000..b704b01 --- /dev/null +++ b/utils/tmux/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2009-2012 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:=tmux +PKG_VERSION:=1.6 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/tmux +PKG_MD5SUM:=3e37db24aa596bf108a0442a81c845b3 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/tmux + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Terminal multiplexer + DEPENDS:=+libncurses +libevent2 +libpthread +librt + URL:=http://tmux.sourceforge.net/ +endef + +define Package/tmux/description + tmux is a modern, BSD-licensed alternative to GNU screen. +endef + +MAKE_FLAGS += \ + PREFIX="/usr" \ + PLATFORM="linux" + +define Package/tmux/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tmux $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,tmux)) diff --git a/utils/tmux/patches/100-b64_ntop-conflict.patch b/utils/tmux/patches/100-b64_ntop-conflict.patch new file mode 100644 index 0000000..8e7a8d7 --- /dev/null +++ b/utils/tmux/patches/100-b64_ntop-conflict.patch @@ -0,0 +1,41 @@ +Index: tmux-1.6/compat.h +=================================================================== +--- tmux-1.6.orig/compat.h ++++ tmux-1.6/compat.h +@@ -198,7 +198,9 @@ int daemon(int, int); + + #ifndef HAVE_B64_NTOP + /* b64_ntop.c */ +-int b64_ntop(const char *, size_t, char *, size_t); ++int local_b64_ntop(const char *, size_t, char *, size_t); ++#else ++#define local_b64_ntop b64_ntop + #endif + + #ifndef HAVE_FORKPTY +Index: tmux-1.6/compat/b64_ntop.c +=================================================================== +--- tmux-1.6.orig/compat/b64_ntop.c ++++ tmux-1.6/compat/b64_ntop.c +@@ -122,7 +122,7 @@ static const char Pad64 = '='; + */ + + int +-b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) { ++local_b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) { + size_t datalength = 0; + uint8_t input[3]; + uint8_t output[4]; +Index: tmux-1.6/tty.c +=================================================================== +--- tmux-1.6.orig/tty.c ++++ tmux-1.6/tty.c +@@ -1006,7 +1006,7 @@ tty_cmd_setselection(struct tty *tty, co + off = 4 * ((ctx->num + 2) / 3) + 1; /* storage for base64 */ + buf = xmalloc(off); + +- b64_ntop(ctx->ptr, ctx->num, buf, off); ++ local_b64_ntop(ctx->ptr, ctx->num, buf, off); + tty_putcode_ptr2(tty, TTYC_MS, "", buf); + + xfree(buf); diff --git a/utils/triggerhappy/Makefile b/utils/triggerhappy/Makefile new file mode 100644 index 0000000..aa3ea19 --- /dev/null +++ b/utils/triggerhappy/Makefile @@ -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:=triggerhappy +PKG_VERSION:=0.3.4 +PKG_REV:=cb3ed9ba849ff5926fa47fd1ae042fa0083edaf5 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=git://github.com/wertarbyte/triggerhappy +PKG_SOURCE_PROTO:=git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) + +include $(INCLUDE_DIR)/package.mk + +define Package/triggerhappy + SECTION:=utils + CATEGORY:=Utilities + TITLE:=handle input events and run configured programs + URL:=http://github.com/wertarbyte/triggerhappy +endef + +define Package/triggerhappy/description + triggerhappy - handle input events and run configured programs + The daemon thd can handle hotplugged input devices and is configured through + simple configuration files in /etc/triggerhappy/triggers.d/. +endef + +MAKE_FLAGS += \ + $(TARGET_CONFIGURE_OPTS) \ + $(1) + +define Package/triggerhappy/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/triggerhappy + $(INSTALL_DIR) $(1)/etc/triggerhappy/triggers.d/ + $(INSTALL_DIR) $(1)/etc/hotplug.d/input/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/thd $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/th-cmd $(1)/usr/sbin + $(INSTALL_BIN) ./files/triggerhappy.init $(1)/etc/init.d/triggerhappy + $(INSTALL_BIN) ./files/triggerhappy.hotplug $(1)/etc/hotplug.d/input/10-triggerhappy + $(INSTALL_BIN) ./files/triggerhappy-example.conf $(1)/etc/triggerhappy/triggers.d/example.conf +endef + +$(eval $(call BuildPackage,triggerhappy)) diff --git a/utils/triggerhappy/files/triggerhappy-example.conf b/utils/triggerhappy/files/triggerhappy-example.conf new file mode 100644 index 0000000..3a8017a --- /dev/null +++ b/utils/triggerhappy/files/triggerhappy-example.conf @@ -0,0 +1,14 @@ +# This is an example configuration for the triggerhappy daemon (thd) +# please note that every file to be processed must end in ".conf" +# +# To view a list of supported event codes, use "thd --listevents" or +# "thd --dump /dev/input/event*" +# +# Format: +# +# +# values for key events are 1 (pressed), 0 (released) or 2 (held) +# +## control an mpd instance +# KEY_NEXTSONG 1 /usr/bin/mpc next +# KEY_PREVSONG 1 /usr/bin/mpc prev diff --git a/utils/triggerhappy/files/triggerhappy.hotplug b/utils/triggerhappy/files/triggerhappy.hotplug new file mode 100644 index 0000000..78ad349 --- /dev/null +++ b/utils/triggerhappy/files/triggerhappy.hotplug @@ -0,0 +1,15 @@ +#!/bin/sh +THD_SOCKET=/tmp/triggerhappy.socket +[ -S "$THD_SOCKET" ] || exit + +case "$ACTION" in + add) + DEVICE="/dev/$DEVNAME" + [ -c "$DEVICE" ] || exit + # offer device to triggerhappy daemon + /usr/sbin/th-cmd --socket "$THD_SOCKET" --add "$DEVICE" + ;; + remove) + # nothing to do + ;; +esac diff --git a/utils/triggerhappy/files/triggerhappy.init b/utils/triggerhappy/files/triggerhappy.init new file mode 100644 index 0000000..e846d29 --- /dev/null +++ b/utils/triggerhappy/files/triggerhappy.init @@ -0,0 +1,10 @@ +#!/bin/sh /etc/rc.common +START=93 + +start() { + /usr/sbin/thd --socket /tmp/triggerhappy.socket --triggers /etc/triggerhappy/triggers.d/ --daemon /dev/input/event* +} + +stop() { + /usr/sbin/th-cmd --socket /tmp/triggerhappy.socket --quit +} diff --git a/utils/triggerhappy/patches/100-fix-LINUX_INPUT_H.patch b/utils/triggerhappy/patches/100-fix-LINUX_INPUT_H.patch new file mode 100644 index 0000000..13ecd8c --- /dev/null +++ b/utils/triggerhappy/patches/100-fix-LINUX_INPUT_H.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -10,7 +10,7 @@ THCMD_COMPS := th-cmd cmdsocket + + MAKEDEPEND = $(CC) -M -MG $(CPPFLAGS) -o $*.d $< + +-LINUX_INPUT_H := $(shell echo '\#include ' | $(CC) $(CPPFLAGS) -M -E - | awk 'NR==1 {print $$2}') ++LINUX_INPUT_H := $(shell for i in `echo | $(CC) $(CPPFLAGS) -M -E -include 'linux/input.h' -`; do test -f "$$i" && echo "$$i" && break; done) + + all: thd th-cmd man + diff --git a/utils/unrar/Makefile b/utils/unrar/Makefile new file mode 100644 index 0000000..373b1fe --- /dev/null +++ b/utils/unrar/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2006-2011 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:=unrar +PKG_VERSION:=4.0.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=unrarsrc-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.rarlab.com/rar +PKG_MD5SUM:=41b0a9bca945b4ae2608421afd8f606e + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/unrar +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/unrar + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=compression + TITLE:=unrar application + URL:=http://www.rarlab.com/ + DEPENDS:=$(CXX_DEPENDS) +endef + +define Package/unrar/description + unrar is an application that can decompress files and archives created using + the RAR compression scheme +endef + +define Build/Configure + $(call Build/Configure/Default, ) + ln -s $(PKG_BUILD_DIR)/makefile.unix $(PKG_BUILD_DIR)/Makefile +endef + +define Package/unrar/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/unrar $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,unrar)) diff --git a/utils/unzip/Makefile b/utils/unzip/Makefile new file mode 100644 index 0000000..f012816 --- /dev/null +++ b/utils/unzip/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2006-2009 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:=unzip +PKG_VERSION:=5.52 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)552.zip +PKG_SOURCE_URL:=@SF/infozip +PKG_MD5SUM:=3d55b4e7375c3d0b81feca52dc0e4d48 + +include $(INCLUDE_DIR)/package.mk + +PKG_UNPACK=unzip -d $(PKG_BUILD_DIR)/ $(DL_DIR)/$(PKG_SOURCE) + +define Package/unzip + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:= + TITLE:=De-archiver for .zip files + URL:=http://infozip.sourceforge.net/UnZip.html + SUBMENU:=compression +endef + +define Package/unzip/description + InfoZIP's unzip program. With the exception of multi-volume archives + (ie, .ZIP files that are split across several disks using PKZIP's /& option), + this can handle any file produced either by PKZIP, or the corresponding + InfoZIP zip program. +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) -f unix/Makefile generic \ + $(TARGET_CONFIGURE_OPTS) \ + prefix="$(PKG_INSTALL_DIR)/usr" \ + CFLAGS="$(TARGET_CFLAGS)" \ + CF="$(TARGET_CFLAGS) -O $(TARGET_CPPFLAGS) -I. -DUNIX" \ + LD="$(TARGET_CC) $(TARGET_LDFLAGS)" \ + install +endef + +define Package/unzip/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,unzip)) diff --git a/utils/upx/Makefile b/utils/upx/Makefile new file mode 100644 index 0000000..1d9faac --- /dev/null +++ b/utils/upx/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2006-2012 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:=upx +PKG_VERSION:=3.08 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.bz2 +PKG_SOURCE_URL:=http://upx.sourceforge.net/download \ + http://upx.sourceforge.net/download/00-OLD-VERSIONS +PKG_MD5SUM:=54c76fa52cad578ff23ef98aee91e3f5 + +include $(INCLUDE_DIR)/package.mk + +define Package/upx + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libucl +libstdcpp +zlib + TITLE:=The Ultimate Packer for eXecutables + URL:=http://upx.sourceforge.net/ +endef + +define Package/upx/description +UPX is a free, portable, extendable, high-performance executable packer for +several different executable formats. It achieves an excellent compression ratio +and offers very fast decompression. Your executables suffer no memory overhead +or other drawbacks for most of the formats supported, because of in-place +decompression. +endef + +MAKE_PATH := src +MAKE_VARS += \ + exeext="" + +TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components 1 $(TAR_OPTIONS) + +TARGET_CPPFLAGS += \ + -DUCL_NO_ASM \ + +define Package/upx/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/upx $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,upx)) diff --git a/utils/upx/patches/100-disable_doc.patch b/utils/upx/patches/100-disable_doc.patch new file mode 100644 index 0000000..d960c00 --- /dev/null +++ b/utils/upx/patches/100-disable_doc.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -35,7 +35,7 @@ ifeq ($(BUILD_STUB),1) + $(MAKE) -C src/stub $@ + endif + $(MAKE) -C src $@ +- $(MAKE) -C doc $@ ++# $(MAKE) -C doc $@ + + + .PHONY: default all mostlyclean clean distclean maintainer-clean diff --git a/utils/usb-modeswitch-data/Makefile b/utils/usb-modeswitch-data/Makefile new file mode 100644 index 0000000..ac3af15 --- /dev/null +++ b/utils/usb-modeswitch-data/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2010-2012 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:=usb-modeswitch-data +PKG_VERSION:=20120120 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.draisberghof.de/usb_modeswitch/ +PKG_MD5SUM:=c899cc9c71bb35f3ec600b7cd1455c65 + +include $(INCLUDE_DIR)/package.mk + +define Package/usb-modeswitch-data + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=usb-modeswitch + TITLE:=USB ModeSwitch - Dongle configuration database + URL:=http://packages.debian.org/de/sid/usb-modeswitch-data +endef + +define Package/usb-modeswitch-data/description + Configuration database for usb-modeswitch. + Contains definitions for many USB devices required to + autoswitch "flip flop" gear. +endef + +define Build/Compile +endef + +define Package/usb-modeswitch-data/install + $(INSTALL_DIR) $(1)/etc/usb_modeswitch.d/ + $(CP) $(PKG_BUILD_DIR)/usb_modeswitch.d/* $(1)/etc/usb_modeswitch.d/ +endef + +$(eval $(call BuildPackage,usb-modeswitch-data)) diff --git a/utils/usb-modeswitch/Makefile b/utils/usb-modeswitch/Makefile new file mode 100644 index 0000000..ade1a01 --- /dev/null +++ b/utils/usb-modeswitch/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2008-2012 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:=usb-modeswitch +PKG_VERSION:=1.2.3 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.draisberghof.de/usb_modeswitch +PKG_MD5SUM:=9b29e8b0d93d7604a9e5efc4696d37a3 + +include $(INCLUDE_DIR)/package.mk + +define Package/usb-modeswitch + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libusb + TITLE:=USB ModeSwitch + URL:=http://www.draisberghof.de/usb_modeswitch/ +endef + +define Package/usb-modeswitch/description + A mode switching tool for controlling + "flip flop" (multiple device) USB gear. +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) \ + -lusb \ + -o $(PKG_BUILD_DIR)/usb_modeswitch-OpenWrt \ + $(PKG_BUILD_DIR)/usb_modeswitch.c +endef + +define Package/usb-modeswitch/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/usb_modeswitch-OpenWrt $(1)/usr/bin/usb_modeswitch + $(INSTALL_DIR) $(1)/etc/hotplug.d/usb + $(INSTALL_DATA) ./files/modeswitch.hotplug $(1)/etc/hotplug.d/usb/20-modeswitch +endef + +$(eval $(call BuildPackage,usb-modeswitch)) diff --git a/utils/usb-modeswitch/files/modeswitch.hotplug b/utils/usb-modeswitch/files/modeswitch.hotplug new file mode 100644 index 0000000..eb71b30 --- /dev/null +++ b/utils/usb-modeswitch/files/modeswitch.hotplug @@ -0,0 +1,140 @@ +#!/bin/sh + +local uVid uPid uMa uPr uSe +local sVe sMo sRe + +local modeswitch="/usr/bin/usb_modeswitch" + + +log() { + logger -t "usb-modeswitch" "$@" +} + +sanitize() { + sed -e 's/[[:space:]]\+$//; s/[[:space:]]\+/_/g' "$@" +} + +find_scsi_attrs() { + [ -n "$DEVPATH" ] && [ -d /sys/$DEVPATH/host* ] && { + log "$DEVICENAME is a SCSI device, waiting for it to settle..." + local timeout=20 + while [ $((--timeout)) -ge 0 ]; do + [ -d /sys/$DEVPATH/host*/target* ] && { + local scsi_dir + for scsi_dir in /sys/$DEVPATH/host*/target*/*; do + [ -d "$scsi_dir" ] || break + case "$scsi_dir" in + */host*/target*/*:*:*:*) + sVe=$(sanitize "$scsi_dir/vendor") + sMo=$(sanitize "$scsi_dir/model") + sRe=$(sanitize "$scsi_dir/rev") + + log "$DEVICENAME: Vendor=${sVe:-?} Model=${sMo:-?} Revision=${sRe:-?}" + return 0 + ;; + esac + done + } || { + sleep 1 + } + done + log "$DEVICENAME: Failed to get SCSI attributes!" + } + + return 1 +} + +find_usb_attrs() { + local usb_dir="/sys/$DEVPATH" + [ -f "$usb_dir/idVendor" ] || usb_dir="${usb_dir%/*}" + + uVid=$(cat "$usb_dir/idVendor") + uPid=$(cat "$usb_dir/idProduct") + uMa=$(sanitize "$usb_dir/manufacturer") + uPr=$(sanitize "$usb_dir/product") + uSe=$(sanitize "$usb_dir/serial") + + log "$DEVICENAME: Manufacturer=${uMa:-?} Product=${uPr:-?} Serial=${uSe:-?}" +} + +match_config_tag() { + local conf="$1" + local tag="$2" + + case "${conf##*/}" in + *:*$tag=*) + local cmp; eval "cmp=\$$tag" + local pat="${conf#*:$tag=}"; pat="${pat%%:*}" + case "$cmp" in + *$pat*) return 0 ;; + *) return 1 ;; + esac + ;; + esac + + return 0 +} + +match_config() { + local conf="$1" + local tag + + for tag in uMa uPr uSe sVe sMo sRe; do + match_config_tag "$conf" "$tag" || return 1 + done + + return 0 +} + + + +if [ "$ACTION" = add ]; then + [ -d "/etc/usb_modeswitch.d" ] && [ -x "$modeswitch" ] && { + case "$DEVICENAME" in + *-*:*.*) : ;; + *) exit 0 ;; + esac + + find_usb_attrs + + local candidates=0 + local conf configs + for conf in /etc/usb_modeswitch.d/$uVid:$uPid*; do + [ -f "$conf" ] || break + configs="${configs:+$configs }$conf" + $((candidates++)) + done + + # Found more than one candidate, read SCSI attributes and find the best match + [ $candidates -gt 1 ] && { + find_scsi_attrs + for conf in $configs; do + match_config "$conf" && { + configs="$conf" + candidates=1 + break + } + done + } + + # If a candidate is remaining, start usb-modeswitch + [ -n "$configs" ] && { + log "$DEVICENAME: Selecting ${configs%% *} for mode switching" + # ugly workaround, but working for all hw we got for testing + switching_done=0 + switching_tries=0 + local usb_dir="/sys/$DEVPATH" + [ -f "$usb_dir/idVendor" ] || usb_dir="${usb_dir%/*}" + while [ $switching_done -lt 1 -a $switching_tries -le 6 ]; do + $modeswitch -v $uVid -p $uPid -I -D -n -s 30 -c "${configs%% *}" + if [ $(sanitize "$usb_dir/idProduct") = $uPid ]; then + log "$DEVICENAME: Switching seemingly failed" + sleep 1 + else + switching_done=1 + fi + switching_tries=$(( $switching_tries + 1 )) + done + } + } +fi diff --git a/utils/usbmuxd/Makefile b/utils/usbmuxd/Makefile new file mode 100644 index 0000000..7b3f03b --- /dev/null +++ b/utils/usbmuxd/Makefile @@ -0,0 +1,86 @@ +# +# Copyright (C) 2012 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:=usbmuxd +PKG_VERSION:=1.0.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://marcansoft.com/uploads/usbmuxd +PKG_MD5SUM:=6f431541f3177fa06aa6df9ceecb2da0 + +CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/usbmuxd/Default + TITLE:=USB multiplexing daemon + URL:=http://marcansoft.com/blog/iphonelinux/usbmuxd/ +endef + +define Package/usbmuxd/Default/description + This daemon is in charge of multiplexing connections over USB to an iPhone or + iPod touch. To users, it means you can sync your music, contacts, photos, etc. + over USB. To developers, it means you can connect to any listening localhost + socket on the device. usbmuxd is not used for tethering data transfer, which + uses a dedicated USB interface as a virtual network device. +endef + +define Package/usbmuxd + $(call Package/usbmuxd/Default) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+librt +libusb-1.0 +libusbmuxd +endef + +define Package/usbmuxd/description + $(call Package/usbmuxd/Default/description) +endef + +define Package/libusbmuxd + $(call Package/usbmuxd/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= library + DEPENDS:=+libplist +libpthread +libxml2 +zlib +endef + +define Package/libusbmuxd/description + $(call Package/usbmuxd/Default/description) + This package contains the usbmuxd shared library. +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib$(LIB_SUFFIX)/libusbmuxd.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib$(LIB_SUFFIX)/pkgconfig/libusbmuxd.pc $(1)/usr/lib/pkgconfig/ + $(SED) 's,lib$(LIB_SUFFIX),lib,g' $(1)/usr/lib/pkgconfig/libusbmuxd.pc + $(SED) 's,\-dirty,$(PKG_VERSION),g' $(1)/usr/lib/pkgconfig/libusbmuxd.pc +endef + +define Package/usbmuxd/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/iproxy $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbmuxd $(1)/usr/sbin/ +endef + +define Package/libusbmuxd/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib$(LIB_SUFFIX)/libusbmuxd.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,usbmuxd)) +$(eval $(call BuildPackage,libusbmuxd)) diff --git a/utils/usbutils/Makefile b/utils/usbutils/Makefile new file mode 100644 index 0000000..2670035 --- /dev/null +++ b/utils/usbutils/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2007-2012 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:=usbutils +PKG_VERSION:=005 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@KERNEL/linux/utils/usb/usbutils +PKG_MD5SUM:=6a21f7b6c02b76df5e8a7c208d746654 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/usbutils + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libusb-1.0 +zlib +librt +libpthread + TITLE:=USB devices listing utilities + URL:=http://www.linux-usb.org/ +endef + +define Package/usbutils/postinst +#!/bin/sh +[ -z "$${IPKG_INSTROOT}" ] || \ +(cd $${IPKG_INSTROOT}/usr/share; $${PKG_ROOT}/usr/sbin/update-usbids.sh ; rm usb.ids.gz.old) +exit 0 +endef + +define Package/usbutils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lsusb $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/update-usbids.sh $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/share + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/usb.ids.gz $(1)/usr/share/ +endef + +$(eval $(call BuildPackage,usbutils)) diff --git a/utils/usbutils/patches/100-ids-relative-path.patch b/utils/usbutils/patches/100-ids-relative-path.patch new file mode 100644 index 0000000..6117c36 --- /dev/null +++ b/utils/usbutils/patches/100-ids-relative-path.patch @@ -0,0 +1,11 @@ +--- a/update-usbids.sh.in ++++ b/update-usbids.sh.in +@@ -6,7 +6,7 @@ + + set -e + SRC="http://www.linux-usb.org/usb.ids" +-DEST=@usbids@ ++DEST=usb.ids + + # if usb.ids is read-only (because the filesystem is read-only), + # then just skip this whole process. diff --git a/utils/usbutils/patches/110-gzip-update-usbids.patch b/utils/usbutils/patches/110-gzip-update-usbids.patch new file mode 100644 index 0000000..0e25e5c --- /dev/null +++ b/utils/usbutils/patches/110-gzip-update-usbids.patch @@ -0,0 +1,36 @@ +--- a/update-usbids.sh.in ++++ b/update-usbids.sh.in +@@ -6,9 +6,9 @@ + + set -e + SRC="http://www.linux-usb.org/usb.ids" +-DEST=usb.ids ++DEST=usb.ids.gz + +-# if usb.ids is read-only (because the filesystem is read-only), ++# if usb.ids.gz is read-only (because the filesystem is read-only), + # then just skip this whole process. + if ! touch ${DEST} >&2 >/dev/null ; then + ${quiet} || echo "${DEST} is read-only, exiting." +@@ -16,10 +16,10 @@ if ! touch ${DEST} >&2 >/dev/null ; then + fi + + if which wget >/dev/null 2>&1 ; then +- DL="wget -O $DEST.new $SRC" ++ DL="eval wget -O- $SRC | gzip >$DEST.new" + ${quiet} && DL="$DL -q" + elif which lynx >/dev/null 2>&1 ; then +- DL="eval lynx -source $SRC >$DEST.new" ++ DL="eval lynx -source $SRC | gzip >$DEST.new" + else + echo >&2 "update-usbids: cannot find wget nor lynx" + exit 1 +@@ -31,7 +31,7 @@ if ! $DL ; then + exit 1 + fi + +-if ! grep >/dev/null "^C " $DEST.new ; then ++if ! zcat $DEST.new | grep >/dev/null "^C " ; then + echo >&2 "update-usbids: missing class info, probably truncated file" + exit 1 + fi diff --git a/utils/valgrind/Makefile b/utils/valgrind/Makefile new file mode 100644 index 0000000..3b6a2b2 --- /dev/null +++ b/utils/valgrind/Makefile @@ -0,0 +1,162 @@ +# +# Copyright (C) 2006-2012 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:=valgrind +PKG_VERSION:=3.8.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://valgrind.org/downloads/ +PKG_MD5SUM:=ec04dfd1256307432b2a7b520398c526 + +PKG_FIXUP = autoreconf +PKG_INSTALL := 1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/kernel.mk + +define Package/valgrind + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=@mips||mipsel||i386||powerpc||TARGET_omap4 +libpthread +librt + TITLE:=debugging and profiling tools for Linux + URL:=http://www.valgrind.org +endef + +define Package/valgrind/default + $(Package/valgrind) + DEPENDS := valgrind +endef + +define Package/valgrind-cachegrind + $(Package/valgrind/default) + TITLE += (cache profiling) +endef + +define Package/valgrind-callgrind + $(Package/valgrind/default) + TITLE += (callgraph profiling) +endef + +define Package/valgrind-drd + $(Package/valgrind/default) + TITLE += (thread error detection) +endef + +define Package/valgrind-massif + $(Package/valgrind/default) + TITLE += (heap profiling) +endef + +define Package/valgrind-helgrind + $(Package/valgrind/default) + TITLE += (thread debugging) +endef + +define Package/valgrind-vgdb + $(Package/valgrind/default) + TITLE += (GDB interface) +endef + +define Package/valgrind/description + Valgrind is an award-winning suite of tools for debugging and + profiling Linux programs. With the tools that come with Valgrind, + you can automatically detect many memory management and threading + bugs, avoiding hours of frustrating bug-hunting, making your + programs more stable. You can also perform detailed profiling, + to speed up and reduce memory use of your programs. +endef + +CPU := $(patsubst x86,i386,$(LINUX_KARCH)) + +CONFIGURE_VARS += \ + UNAME_R=$(LINUX_VERSION) + +CONFIGURE_ARGS += \ + --enable-only32bit \ + --enable-tls \ + --without-x \ + --without-uiout \ + --disable-valgrindmi \ + --disable-tui \ + --disable-valgrindtk \ + --without-included-gettext + +define Package/valgrind/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/valgrind* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/valgrind + $(CP) \ + ./files/default.supp \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/none-* \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_core*.so \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(CPU)-*.xml \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/32bit-core*.xml \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/32bit-linux*.xml \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/memcheck-* \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_memcheck*.so \ + $(1)/usr/lib/valgrind/ +endef + +define Package/valgrind-cachegrind/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cg_* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/valgrind + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/cachegrind-* \ + $(1)/usr/lib/valgrind/ +endef + +define Package/valgrind-callgrind/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/callgrind* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/valgrind + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/callgrind-* \ + $(1)/usr/lib/valgrind/ +endef + +define Package/valgrind-drd/install + $(INSTALL_DIR) $(1)/usr/lib/valgrind + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/drd-* \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_drd*.so \ + $(1)/usr/lib/valgrind/ +endef + +define Package/valgrind-massif/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ms_print $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/valgrind + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/massif-* \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_massif*.so \ + $(1)/usr/lib/valgrind/ +endef + +define Package/valgrind-helgrind/install + $(INSTALL_DIR) $(1)/usr/lib/valgrind + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/helgrind-* \ + $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_helgrind*.so \ + $(1)/usr/lib/valgrind/ +endef + +define Package/valgrind-vgdb/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vgdb $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,valgrind)) +$(eval $(call BuildPackage,valgrind-cachegrind)) +$(eval $(call BuildPackage,valgrind-callgrind)) +$(eval $(call BuildPackage,valgrind-drd)) +$(eval $(call BuildPackage,valgrind-massif)) +$(eval $(call BuildPackage,valgrind-helgrind)) +$(eval $(call BuildPackage,valgrind-vgdb)) diff --git a/utils/valgrind/files/default.supp b/utils/valgrind/files/default.supp new file mode 100644 index 0000000..beff559 --- /dev/null +++ b/utils/valgrind/files/default.supp @@ -0,0 +1,42 @@ +{ + ld(Addr1) + Memcheck:Addr1 + fun:* + obj:/lib/ld-* +} +{ + ld(Addr2) + Memcheck:Addr2 + fun:* + obj:/lib/ld-* +} +{ + ld(Addr4) + Memcheck:Addr4 + fun:* + obj:/lib/ld-* +} +{ + ld(Cond) + Memcheck:Cond + fun:* + obj:/lib/ld-* +} +{ + strlen(Cond) + Memcheck:Cond + fun:strlen + fun:* +} +{ + strnlen(Cond) + Memcheck:Cond + fun:strnlen + fun:* +} +{ + index(Cond) + Memcheck:Cond + fun:index + fun:* +} diff --git a/utils/valgrind/patches/100-fix_configure_check.patch b/utils/valgrind/patches/100-fix_configure_check.patch new file mode 100644 index 0000000..b06cc3b --- /dev/null +++ b/utils/valgrind/patches/100-fix_configure_check.patch @@ -0,0 +1,11 @@ +--- a/configure.in ++++ b/configure.in +@@ -260,7 +260,7 @@ case "${host_os}" in + # Ok, this is linux. Check the kernel version + AC_MSG_CHECKING([for the kernel version]) + +- kernel=`uname -r` ++ kernel=${UNAME_R:-`uname -r`} + + case "${kernel}" in + 2.6.*|3.*) diff --git a/utils/valgrind/patches/110-add_a_out_h.patch b/utils/valgrind/patches/110-add_a_out_h.patch new file mode 100644 index 0000000..7d95fb3 --- /dev/null +++ b/utils/valgrind/patches/110-add_a_out_h.patch @@ -0,0 +1,157 @@ +--- /dev/null ++++ b/include/a.out.h +@@ -0,0 +1,138 @@ ++#ifndef __A_OUT_GNU_H__ ++#define __A_OUT_GNU_H__ ++ ++#include ++ ++#define __GNU_EXEC_MACROS__ ++ ++struct exec ++{ ++ unsigned long a_info; /* Use macros N_MAGIC, etc for access. */ ++ unsigned int a_text; /* Length of text, in bytes. */ ++ unsigned int a_data; /* Length of data, in bytes. */ ++ unsigned int a_bss; /* Length of uninitialized data area for file, in bytes. */ ++ unsigned int a_syms; /* Length of symbol table data in file, in bytes. */ ++ unsigned int a_entry; /* Start address. */ ++ unsigned int a_trsize;/* Length of relocation info for text, in bytes. */ ++ unsigned int a_drsize;/* Length of relocation info for data, in bytes. */ ++}; ++ ++enum machine_type ++{ ++ M_OLDSUN2 = 0, ++ M_68010 = 1, ++ M_68020 = 2, ++ M_SPARC = 3, ++ M_386 = 100, ++ M_MIPS1 = 151, ++ M_MIPS2 = 152 ++}; ++ ++#define N_MAGIC(exec) ((exec).a_info & 0xffff) ++#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff)) ++#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff) ++#define N_SET_INFO(exec, magic, type, flags) \ ++ ((exec).a_info = ((magic) & 0xffff) \ ++ | (((int)(type) & 0xff) << 16) \ ++ | (((flags) & 0xff) << 24)) ++#define N_SET_MAGIC(exec, magic) \ ++ ((exec).a_info = ((exec).a_info & 0xffff0000) | ((magic) & 0xffff)) ++#define N_SET_MACHTYPE(exec, machtype) \ ++ ((exec).a_info = \ ++ ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16)) ++#define N_SET_FLAGS(exec, flags) \ ++ ((exec).a_info = \ ++ ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24)) ++ ++/* Code indicating object file or impure executable. */ ++#define OMAGIC 0407 ++/* Code indicating pure executable. */ ++#define NMAGIC 0410 ++/* Code indicating demand-paged executable. */ ++#define ZMAGIC 0413 ++/* This indicates a demand-paged executable with the header in the text. ++ The first page is unmapped to help trap NULL pointer references. */ ++#define QMAGIC 0314 ++/* Code indicating core file. */ ++#define CMAGIC 0421 ++ ++#define N_TRSIZE(a) ((a).a_trsize) ++#define N_DRSIZE(a) ((a).a_drsize) ++#define N_SYMSIZE(a) ((a).a_syms) ++#define N_BADMAG(x) \ ++ (N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC \ ++ && N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC) ++#define _N_HDROFF(x) (1024 - sizeof (struct exec)) ++#define N_TXTOFF(x) \ ++ (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \ ++ (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec))) ++#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text) ++#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data) ++#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x)) ++#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x)) ++#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x)) ++ ++/* Address of text segment in memory after it is loaded. */ ++#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? 4096 : 0) ++ ++/* Address of data segment in memory after it is loaded. */ ++#define SEGMENT_SIZE 1024 ++ ++#define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1)) ++#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text) ++ ++#define N_DATADDR(x) \ ++ (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \ ++ : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x)))) ++#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data) ++ ++#if !defined (N_NLIST_DECLARED) ++struct nlist ++{ ++ union ++ { ++ char *n_name; ++ struct nlist *n_next; ++ long n_strx; ++ } n_un; ++ unsigned char n_type; ++ char n_other; ++ short n_desc; ++ unsigned long n_value; ++}; ++#endif /* no N_NLIST_DECLARED. */ ++ ++#define N_UNDF 0 ++#define N_ABS 2 ++#define N_TEXT 4 ++#define N_DATA 6 ++#define N_BSS 8 ++#define N_FN 15 ++#define N_EXT 1 ++#define N_TYPE 036 ++#define N_STAB 0340 ++#define N_INDR 0xa ++#define N_SETA 0x14 /* Absolute set element symbol. */ ++#define N_SETT 0x16 /* Text set element symbol. */ ++#define N_SETD 0x18 /* Data set element symbol. */ ++#define N_SETB 0x1A /* Bss set element symbol. */ ++#define N_SETV 0x1C /* Pointer to set vector in data area. */ ++ ++#if !defined (N_RELOCATION_INFO_DECLARED) ++/* This structure describes a single relocation to be performed. ++ The text-relocation section of the file is a vector of these structures, ++ all of which apply to the text section. ++ Likewise, the data-relocation section applies to the data section. */ ++ ++struct relocation_info ++{ ++ int r_address; ++ unsigned int r_symbolnum:24; ++ unsigned int r_pcrel:1; ++ unsigned int r_length:2; ++ unsigned int r_extern:1; ++ unsigned int r_pad:4; ++}; ++#endif /* no N_RELOCATION_INFO_DECLARED. */ ++ ++#endif /* __A_OUT_GNU_H__ */ +--- /dev/null ++++ b/include/bits/a.out.h +@@ -0,0 +1,13 @@ ++#ifndef __A_OUT_GNU_H__ ++# error "Never use directly; include instead." ++#endif ++ ++#include ++ ++#if __WORDSIZE == 64 ++ ++/* Signal to users of this header that this architecture really doesn't ++ support a.out binary format. */ ++#define __NO_A_OUT_SUPPORT 1 ++ ++#endif diff --git a/utils/valgrind/src/abort.c b/utils/valgrind/src/abort.c new file mode 100644 index 0000000..0b4ad98 --- /dev/null +++ b/utils/valgrind/src/abort.c @@ -0,0 +1,3 @@ +void abort(void) +{ +} diff --git a/utils/vim/Makefile b/utils/vim/Makefile new file mode 100644 index 0000000..0f7a687 --- /dev/null +++ b/utils/vim/Makefile @@ -0,0 +1,192 @@ +# +# Copyright (C) 2006-2012 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:=vim +PKG_VERSION:=7.3 +PKG_RELEASE:=1 +VIMVER:=73 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.vim.org/pub/vim/unix/ +PKG_MD5SUM:=5b9510a17074e2b37d8bb38ae09edbf2 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)$(VIMVER) +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/vim/Default + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncurses + TITLE:=Vi IMproved - enhanced vi editor + URL:=http://www.vim.org/ + SUBMENU:=Editors +endef + +define Package/vim + $(call Package/vim/Default) + TITLE+= (Tiny) +endef + +define Package/vim-full + $(call Package/vim/Default) + TITLE+= (Normal) +endef + +define Package/vim-runtime + $(call Package/vim/Default) + TITLE+= (runtime files) +endef + +define Package/vim-help + $(call Package/vim/Default) + TITLE+= (help files) +endef + +define Package/xxd + SECTION:=utils + CATEGORY:=Utilities + TITLE:=make a hexdump or do the reverse + URL:=http://www.vim.org/ +endef + +define Package/vim-full/conffiles +/usr/share/vim/vimrc +endef + +define Package/vim/conffiles +/usr/share/vim/vimrc +endef + +define Package/vim/description + Vim is an almost compatible version of the UNIX editor Vi. + (Tiny build) +endef + +define Package/vim-full/description + Vim is an almost compatible version of the UNIX editor Vi. + (Normal build) +endef + +define Package/vim-runtime/description + Vim is an almost compatible version of the UNIX editor Vi. + (Runtime files) +endef + +define Package/vim-help/description + Vim is an almost compatible version of the UNIX editor Vi. + (Help files) +endef + +define Package/xxd/description + xxd creates a hex dump of a given file or standard input, it can also convert + a hex dump back to its original binary form. +endef + +CONFIGURE_ARGS += \ + --disable-gui \ + --disable-gtktest \ + --disable-xim \ + --without-x \ + --disable-netbeans \ + --disable-cscope \ + --disable-gpm \ + --with-tlib=ncurses + +CONFIGURE_VARS += \ + vim_cv_getcwd_broken=no \ + vim_cv_memmove_handles_overlap=yes \ + vim_cv_stat_ignores_slash=yes \ + vim_cv_tgetent=zero \ + vim_cv_terminfo=yes \ + vim_cv_toupper_broken=no \ + vim_cv_tty_group=root \ + vim_cv_tty_mode=0620 + +ifneq ($(CONFIG_PACKAGE_vim),) +define Build/Compile/vim + $(call Build/Configure/Default, \ + --with-features=tiny \ + --disable-multibyte \ + ) + $(MAKE) -C $(PKG_BUILD_DIR) clean + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" all + $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_tiny +endef +endif + +ifneq ($(CONFIG_PACKAGE_vim-full),) +define Build/Compile/vim-full + $(call Build/Configure/Default, \ + --with-features=normal \ + --enable-multibyte \ + ) + $(MAKE) -C $(PKG_BUILD_DIR) clean + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" all + $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_normal +endef +endif + +ifneq ($(CONFIG_PACKAGE_xxd),) +define Build/Compile/xxd + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" all +endef +endif + +define Build/Compile/vim-runtime + $(MAKE) -C $(PKG_BUILD_DIR)/src DESTDIR="$(PKG_INSTALL_DIR)" installrtbase + (cd $(PKG_INSTALL_DIR) && tar -cf $(PKG_BUILD_DIR)/docs.tar ./usr/share/vim/vim$(VIMVER)/doc) + rm -rf $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER)/doc + rm -rf $(PKG_INSTALL_DIR)/usr/man +endef + +define Build/Compile +$(call Build/Compile/vim) +$(call Build/Compile/vim-full) +$(call Build/Compile/vim-runtime) +$(call Build/Compile/xxd) +endef + +define Package/vim/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_tiny $(1)/usr/bin/vim + $(INSTALL_DIR) $(1)/usr/share/vim + $(INSTALL_CONF) ./files/vimrc $(1)/usr/share/vim/ +endef + +define Package/vim-full/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_normal $(1)/usr/bin/vim + $(INSTALL_DIR) $(1)/usr/share/vim + $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc +endef + +define Package/vim-runtime/install + $(CP) $(PKG_INSTALL_DIR)/* $(1) + rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc +endef + +define Package/vim-help/install + tar -C $(1) -xf $(PKG_BUILD_DIR)/docs.tar +endef + +define Package/xxd/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xxd/xxd $(1)/usr/bin +endef + +$(eval $(call BuildPackage,vim)) +$(eval $(call BuildPackage,vim-full)) +$(eval $(call BuildPackage,vim-runtime)) +$(eval $(call BuildPackage,vim-help)) +$(eval $(call BuildPackage,xxd)) diff --git a/utils/vim/files/vimrc b/utils/vim/files/vimrc new file mode 100644 index 0000000..00b952d --- /dev/null +++ b/utils/vim/files/vimrc @@ -0,0 +1,12 @@ +set showcmd " show (partial) command in status line +set showmatch " show matching brackets +set ignorecase " do case insensitive matching +set incsearch " incremental search +set autowrite " automatically save before commands like :next and :make +set nocompatible " use vim defaults instead of 100% vi compatibility +set backspace=indent,eol,start " more powerful backspacing +set autoindent " always set autoindenting on +set linebreak " don't wrap words by default +set textwidth=0 " don't wrap lines by default +set ruler " show the cursor position all the time + diff --git a/utils/vim/files/vimrc.full b/utils/vim/files/vimrc.full new file mode 100644 index 0000000..114cf07 --- /dev/null +++ b/utils/vim/files/vimrc.full @@ -0,0 +1,24 @@ +set showcmd " show (partial) command in status line +set showmatch " show matching brackets +set ignorecase " do case insensitive matching +set incsearch " incremental search +set autowrite " automatically save before commands like :next and :make +set nocompatible " use Vim defaults instead of 100% vi compatibility +set backspace=indent,eol,start " more powerful backspacing +set autoindent " always set autoindenting on +set linebreak " don't wrap words by default +set textwidth=0 " don't wrap lines by default +set ruler " show the cursor position all the time +if filereadable(expand("$VIMRUNTIME/syntax/synload.vim")) + syntax on +endif +if has("syntax") && &term =~ "xterm" + set t_Co=8 + if has("terminfo") + set t_Sf=[3%p1%dm + set t_Sb=[4%p1%dm + else + set t_Sf=[3%dm + set t_Sb=[4%dm + endif +endif diff --git a/utils/vim/patches/001-cross_compile.patch b/utils/vim/patches/001-cross_compile.patch new file mode 100644 index 0000000..553dde7 --- /dev/null +++ b/utils/vim/patches/001-cross_compile.patch @@ -0,0 +1,38 @@ +--- a/src/auto/configure ++++ b/src/auto/configure +@@ -11641,34 +11641,8 @@ _ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking uint32_t is 32 bits" >&5 + $as_echo_n "checking uint32_t is 32 bits... " >&6; } +-if test "$cross_compiling" = yes; then : +- as_fn_error "could not compile program using uint32_t." "$LINENO" 5 +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-#ifdef HAVE_STDINT_H +-# include +-#endif +-#ifdef HAVE_INTTYPES_H +-# include +-#endif +-main() { +- uint32_t nr1 = (uint32_t)-1; +- uint32_t nr2 = (uint32_t)0xffffffffUL; +- if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) exit(1); +- exit(0); +-} +-_ACEOF +-if ac_fn_c_try_run "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming ok" >&5 + $as_echo "ok" >&6; } +-else +- as_fn_error "WRONG! uint32_t not defined correctly." "$LINENO" 5 +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ +- conftest.$ac_objext conftest.beam conftest.$ac_ext +-fi + + + diff --git a/utils/watchcat/Makefile b/utils/watchcat/Makefile new file mode 100644 index 0000000..f03c6e7 --- /dev/null +++ b/utils/watchcat/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2010 segal.di.ubi.pt +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=watchcat +PKG_VERSION:=1 +PKG_RELEASE:=5 + +include $(INCLUDE_DIR)/package.mk + +define Package/watchcat + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Enable the configuration of programed reboots + MAINTAINER:=Nuno Goncalves +endef + +define Package/watchcat/description +Allows to configure a periodically reboot, or after loosing internet connectivity. Configured trough UCI /etc/config/system. +endef + +define Package/watchcat/conffiles +/etc/config/system +endef + +define Build/Compile +endef + +define Package/watchcat/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/initd_watchcat $(1)/etc/init.d/watchcat + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/watchcat.sh $(1)/usr/bin/watchcat.sh + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/uci_defaults_watchcat $(1)/etc/uci-defaults/50-watchcat +endef + +$(eval $(call BuildPackage,watchcat)) diff --git a/utils/watchcat/files/initd_watchcat b/utils/watchcat/files/initd_watchcat new file mode 100644 index 0000000..36e353f --- /dev/null +++ b/utils/watchcat/files/initd_watchcat @@ -0,0 +1,108 @@ +#!/bin/sh /etc/rc.common + +START=97 + +PIDFILE="/tmp/run/watchcat" + +append_string() { + local varname="$1"; local add="$2"; local separator="${3:- }"; local actual + eval "actual=\$$varname" + + new="${actual:+$actual$separator}$add" + eval "$varname=\$new" +} + +timetoseconds() { + local time=$1 + unset seconds + + { [ "$time" -ge 1 ] 2> /dev/null && seconds="$time"; } || \ + { [ "${time%s}" -ge 1 ] 2> /dev/null && seconds="${time%s}"; } || \ + { [ "${time%m}" -ge 1 ] 2> /dev/null && seconds=$((${time%m}*60)); } || \ + { [ "${time%h}" -ge 1 ] 2> /dev/null && seconds=$((${time%h}*3600)); } || \ + { [ "${time%d}" -ge 1 ] 2> /dev/null && seconds=$((${time%d}*86400)); } +} + +load_watchcat() { + config_get period $1 period + config_get mode $1 mode "allways" + config_get pinghosts $1 pinghosts "8.8.8.8" + config_get pingperiod $1 pingperiod + config_get forcedelay $1 forcedelay "0" + + error="" + + timetoseconds "$period" + period="$seconds" + [ "$period" -ge 1 ] \ + || append_string "error" 'period is not a valid time value (ex: "30"; "4m"; "6h"; "2d")' "; " + [ "$mode" = "allways" -o "$mode" = "ping" ] \ + || append_string "error" "mode must be 'allways' or 'ping'" "; " + [ -n "$pinghosts" -o "$mode" = "allways" ] \ + || append_string "error" "pinghosts must be set when in 'ping' mode" "; " + [ "$mode" = "ping" ] && { + if [ -n "$pingperiod" ] + then + timetoseconds "$pingperiod" + pingperiod="$seconds" + if [ "$pingperiod" -ge 0 ] + then + [ "$pingperiod" -le "$period" ] \ + || append_string "error" "pingperiod must be less than period" "; " + else + append_string "error" 'pingperiod is not a valid time value (ex: "30"; "4m"; "6h"; "2d")' "; " + fi + else + pingperiod="$((period/20))" + fi + } + [ "$pingperiod" -lt "$period" -o "$mode" = "allways" ] \ + || append_string "error" "pingperiod is not recognized" "; " + [ "$forcedelay" -ge 0 ] \ + || append_string "error" "forcedelay must be a integer greater or equal than 0, where 0 means disabled" "; " + + [ -n "$error" ] && { logger -p user.err -t "watchcat" "reboot program $1 not started - $error"; return; } + + if [ "$mode" = "allways" ] + then + /usr/bin/watchcat.sh "allways" "$period" "$forcedelay" & + logger -p user.info -t "wathchat" "started task (mode=$mode;period=$period;forcedelay=$forcedelay)" + else + /usr/bin/watchcat.sh "period" "$period" "$forcedelay" "$pinghosts" "$pingperiod" & + logger -p user.info -t "wathchat" "started task (mode=$mode;period=$period;pinghosts=$pinghosts;pingperiod=$pingperiod;forcedelay=$forcedelay)" + fi + + echo $! >> "${PIDFILE}.pids" +} + +stop() { + if [ -f "${PIDFILE}.pids" ] + then + logger -p user.info -t "watchcat" "stopping all tasks" + + while read pid + do + kill "$pid" + done < "${PIDFILE}.pids" + + rm "${PIDFILE}.pids" + + logger -p user.info -t "watchcat" "all tasks stopped" + else + logger -p user.info -t "watchcat" "no tasks running" + fi +} + +start() { + [ -f "${PIDFILE}.pids" ] && stop + + config_load system + if [ -n "$(uci show system.@watchcat[0])" ] # at least one watchcat section exists + then + logger -p user.info -t "watchcat" "starting all tasks" + config_foreach load_watchcat watchcat + logger -p user.info -t "watchcat" "all tasks started" + else + logger -p user.info -t "watchcat" "no tasks defined" + fi +} diff --git a/utils/watchcat/files/uci_defaults_watchcat b/utils/watchcat/files/uci_defaults_watchcat new file mode 100644 index 0000000..49def81 --- /dev/null +++ b/utils/watchcat/files/uci_defaults_watchcat @@ -0,0 +1,10 @@ +#!/bin/sh + +uci -q show system.@watchcat[0] || { + uci add system watchcat + uci set system.@watchcat[0].period=6h + uci set system.@watchcat[0].mode=ping + uci set system.@watchcat[0].pinghosts=8.8.8.8 + uci set system.@watchcat[0].forcedelay=30 + uci commit +} diff --git a/utils/watchcat/files/watchcat.sh b/utils/watchcat/files/watchcat.sh new file mode 100644 index 0000000..ee9b6bd --- /dev/null +++ b/utils/watchcat/files/watchcat.sh @@ -0,0 +1,69 @@ +#!/bin/sh + +mode="$1" + +shutdown_now() { + local forcedelay="$1" + + reboot & + + [ "$forcedelay" -ge 1 ] && { + sleep "$forcedelay" + + echo b > /proc/sysrq-trigger # Will immediately reboot the system without syncing or unmounting your disks. + } +} + +watchcat_allways() { + local period="$1"; local forcedelay="$2" + + sleep "$period" && shutdown_now "$forcedelay" +} + +watchcat_ping() { + local period="$1"; local forcedelay="$2"; local pinghosts="$3"; local pingperiod="$4" + + time_now="$(cat /proc/uptime)" + time_now="${time_now%%.*}" + time_lastcheck="$time_now" + time_lastcheck_withinternet="$time_now" + + while true + do + # account for the time ping took to return. With a ping time of 5s, ping might take more than that, so it is important to avoid even more delay. + time_now="$(cat /proc/uptime)" + time_now="${time_now%%.*}" + time_diff="$((time_now-time_lastcheck))" + + [ "$time_diff" -lt "$pingperiod" ] && { + sleep_time="$((pingperiod-time_diff))" + sleep "$sleep_time" + } + + time_now="$(cat /proc/uptime)" + time_now="${time_now%%.*}" + time_lastcheck="$time_now" + + for host in "$pinghosts" + do + if ping -c 1 "$host" &> /dev/null + then + time_lastcheck_withinternet="$time_now" + else + time_diff="$((time_now-time_lastcheck_withinternet))" + logger -p daemon.info -t "watchcat[$$]" "no internet connectivity for $time_diff seconds. Reseting when reaching $period" + fi + done + + time_diff="$((time_now-time_lastcheck_withinternet))" + [ "$time_diff" -ge "$period" ] && shutdown_now "$forcedelay" + + done +} + + if [ "$mode" = "allways" ] + then + watchcat_allways "$2" "$3" + else + watchcat_ping "$2" "$3" "$4" "$5" + fi diff --git a/utils/wattsup/Makefile b/utils/wattsup/Makefile new file mode 100644 index 0000000..ced69d8 --- /dev/null +++ b/utils/wattsup/Makefile @@ -0,0 +1,31 @@ +# 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:=wattsup +PKG_RELEASE:=1 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/wattsup + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Wattsup polling utility +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Package/wattsup/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/wattsup $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,wattsup)) diff --git a/utils/wattsup/src/Makefile b/utils/wattsup/src/Makefile new file mode 100644 index 0000000..b9a687a --- /dev/null +++ b/utils/wattsup/src/Makefile @@ -0,0 +1,8 @@ +wattsup: wattsup.o + $(CC) $(LDFLAGS) wattsup.o -o wattsup + +wattsup.o: wattsup.c + $(CC) $(CFLAGS) -c wattsup.c + +clean: + rm *.o wattsup diff --git a/utils/wattsup/src/wattsup.c b/utils/wattsup/src/wattsup.c new file mode 100644 index 0000000..8b26ad6 --- /dev/null +++ b/utils/wattsup/src/wattsup.c @@ -0,0 +1,1877 @@ +/* + * wattsup - Program for controlling the Watts Up? Pro Device + * + * + * Copyright (c) 2005 Patrick Mochel + * + * This program is released under the GPLv2 + * + * + * Compiled with: + * + * gcc -O2 -Wall -o wattsup wattsup.c + * + */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static const char * wu_version = "0.02"; + + +#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) + +static const char * prog_name = "wattsup"; + +static const char * sysfs_path_start = "/sys/class/tty"; + +static char * wu_device = "ttyUSB0"; +static int wu_fd = 0; +static int wu_count = 0; +static int wu_debug = 0; +static char *wu_delim = ", "; +static int wu_final = 0; +static int wu_interval = 1; +static int wu_label = 0; +static int wu_newline = 0; +static int wu_suppress = 0; + +static int wu_localtime = 0; +static int wu_gmtime = 0; + +static int wu_info_all = 0; +static int wu_no_data = 0; +static int wu_set_only = 0; + +#define wu_strlen 256 +#define wu_num_fields 18 +#define wu_param_len 16 + +struct wu_packet { + unsigned int cmd; + unsigned int sub_cmd; + unsigned int count; + char buf[wu_strlen]; + int len; + char * field[wu_num_fields]; + char * label[wu_num_fields]; +}; + + +struct wu_data { + unsigned int watts; + unsigned int volts; + unsigned int amps; + unsigned int watt_hours; + + unsigned int cost; + unsigned int mo_kWh; + unsigned int mo_cost; + unsigned int max_watts; + + unsigned int max_volts; + unsigned int max_amps; + unsigned int min_watts; + unsigned int min_volts; + + unsigned int min_amps; + unsigned int power_factor; + unsigned int duty_cycle; + unsigned int power_cycle; +}; + +struct wu_options { + char * longopt; + int shortopt; + int param; + int flag; + char * value; + + char * descr; + char * option; + char * format; + + int (*show)(int dev_fd); + int (*store)(int dev_fd); +}; + +enum { + wu_option_help = 0, + wu_option_version, + + wu_option_debug, + + wu_option_count, + wu_option_final, + + wu_option_delim, + wu_option_newline, + wu_option_localtime, + wu_option_gmtime, + wu_option_label, + + wu_option_suppress, + + wu_option_cal, + wu_option_header, + + wu_option_interval, + wu_option_mode, + wu_option_user, + + wu_option_info_all, + wu_option_no_data, + wu_option_set_only, +}; + + +static char * wu_option_value(unsigned int index); + + +enum { + wu_field_watts = 0, + wu_field_volts, + wu_field_amps, + + wu_field_watt_hours, + wu_field_cost, + wu_field_mo_kwh, + wu_field_mo_cost, + + wu_field_max_watts, + wu_field_max_volts, + wu_field_max_amps, + + wu_field_min_watts, + wu_field_min_volts, + wu_field_min_amps, + + wu_field_power_factor, + wu_field_duty_cycle, + wu_field_power_cycle, +}; + +struct wu_field { + unsigned int enable; + char * name; + char * descr; +}; + +static struct wu_field wu_fields[wu_num_fields] = { + [wu_field_watts] = { + .name = "watts", + .descr = "Watt Consumption", + }, + + [wu_field_min_watts] = { + .name = "min-watts", + .descr = "Minimum Watts Consumed", + }, + + [wu_field_max_watts] = { + .name = "max-watts", + .descr = "Maxium Watts Consumed", + }, + + [wu_field_volts] = { + .name = "volts", + .descr = "Volts Consumption", + }, + + [wu_field_min_volts] = { + .name = "max-volts", + .descr = "Minimum Volts Consumed", + }, + + [wu_field_max_volts] = { + .name = "min-volts", + .descr = "Maximum Volts Consumed", + }, + + [wu_field_amps] = { + .name = "amps", + .descr = "Amp Consumption", + }, + + [wu_field_min_amps] = { + .name = "min-amps", + .descr = "Minimum Amps Consumed", + }, + + [wu_field_max_amps] = { + .name = "max-amps", + .descr = "Maximum Amps Consumed", + }, + + [wu_field_watt_hours] = { + .name = "kwh", + .descr = "Average KWH", + }, + + [wu_field_mo_kwh] = { + .name = "mo-kwh", + .descr = "Average monthly KWH", + }, + + [wu_field_cost] = { + .name = "cost", + .descr = "Cost per watt", + }, + + [wu_field_mo_cost] = { + .name = "mo-cost", + .descr = "Monthly Cost", + }, + + [wu_field_power_factor] = { + .name = "power-factor", + .descr = "Ratio of Watts vs. Volt Amps", + }, + + [wu_field_duty_cycle] = { + .name = "duty-cycle", + .descr = "Percent of the Time On vs. Time Off", + }, + + [wu_field_power_cycle] = { + .name = "power-cycle", + .descr = "Indication of power cycle", + }, + +}; + + + +static void msg_start(const char * fmt, ...) +{ + va_list(ap); + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); +} + +static void msg_end(void) +{ + printf("\n"); +} + +static void msg(const char * fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); +} + +static void dbg(const char * fmt, ...) +{ + va_list ap; + + if (wu_debug) { + va_start(ap, fmt); + msg_start("%s: [debug] ", prog_name); + vprintf(fmt, ap); + msg_end(); + va_end(ap); + } +} + +static void err(const char * fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + fprintf(stderr, "%s: [error] ", prog_name); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); +} + +static void perr(const char * fmt, ...) +{ + char buf[1024]; + int n; + va_list ap; + + va_start(ap, fmt); + n = sprintf(buf, "%s: [error] ", prog_name); + vsnprintf(buf + n, sizeof(buf) - n, fmt, ap); + perror(buf); + va_end(ap); +} + +static int ret_err(int err) +{ + errno = err; + return -1; +} + + +static void print_packet(struct wu_packet * p, char * str) +{ + int i; + + if (!wu_suppress) + msg_start("Watts Up? %s\n", str); + for (i = 0; i< p->count; i++) { + if (i) + msg("%s", wu_newline ? "\n" : wu_delim); + if (wu_label) + msg("[%s] ", p->label[i]); + msg(p->field[i]); + } + msg_end(); +} + + +static void print_time(void) +{ + time_t t; + struct tm * tm; + + if (wu_localtime || wu_gmtime) { + time(&t); + + if (wu_localtime) + tm = localtime(&t); + else + tm = gmtime(&t); + + msg("[%02d:%02d:%02d] ", + tm->tm_hour, tm->tm_min, tm->tm_sec); + } +} + +static void print_packet_filter(struct wu_packet * p, + int (*filter_ok)(struct wu_packet * p, int i, char * str)) +{ + char buf[256]; + int printed; + int i; + + print_time(); + for (i = 0, printed = 0; i< p->count; i++) { + if (!filter_ok(p, i, buf)) + continue; + + if (printed++) + msg("%s", wu_newline ? "\n" : wu_delim); + if (wu_label) + msg("[%s] ", p->label[i]); + msg(buf); + } + msg_end(); +} + + +/* + * Device should be something like "ttyS0" + */ + +static int open_device(char * device_name, int * dev_fd) +{ + struct stat s; + int ret; + int cur_fd; + + cur_fd = open(".", O_RDONLY); + if (cur_fd< 0) { + perr("Could not open current directory."); + return cur_fd; + } + + ret = chdir(sysfs_path_start); + if (ret) { + perr(sysfs_path_start); + return ret; + } + + /* + * First, check if /sys/class/tty// exists. + */ + + dbg("Checking sysfs path: %s/%s", sysfs_path_start, device_name); + + ret = stat(device_name,&s); + if (ret< 0) { + perr(device_name); + goto Done; + } + + if (!S_ISDIR(s.st_mode)) { + errno = -ENOTDIR; + err("%s is not a TTY device.", device_name); + goto Done; + } + + dbg("%s is a registered TTY device", device_name); + + fchdir(cur_fd); + + + /* + * Check if device node exists and is writable + */ + chdir("/dev"); + + ret = stat(device_name,&s); + if (ret< 0) { + perr("/dev/%s (device node)", device_name); + goto Done; + } + + if (!S_ISCHR(s.st_mode)) { + errno = -ENOTTY; + ret = -1; + err("%s is not a TTY character device.", device_name); + goto Done; + } + + dbg("%s has a device node", device_name); + + ret = access(device_name, R_OK | W_OK); + if (ret) { + perr("%s: Not writable?", device_name); + goto Done; + } + + ret = open(device_name, O_RDWR | O_NONBLOCK); + if (ret< 0) { + perr("Could not open %s"); + goto Done; + } + *dev_fd = ret; + ret = 0; +Done: + fchdir(cur_fd); + close(cur_fd); + return ret; +} + + +static int setup_serial_device(int dev_fd) +{ + struct termios t; + int ret; + + ret = tcgetattr(dev_fd,&t); + if (ret) + return ret; + + cfmakeraw(&t); + cfsetispeed(&t, B115200); + cfsetospeed(&t, B115200); + tcflush(dev_fd, TCIFLUSH); + + t.c_iflag |= IGNPAR; + t.c_cflag&= ~CSTOPB; + ret = tcsetattr(dev_fd, TCSANOW,&t); + + if (ret) { + perr("setting terminal attributes"); + return ret; + } + + return 0; +} + + +static int wu_write(int fd, struct wu_packet * p) +{ + int ret; + int n; + int i; + char * s = p->buf; + + memset(p->buf, 0, sizeof(p->buf)); + n = sprintf(p->buf, "#%c,%c,%d", p->cmd, p->sub_cmd, p->count); + p->len = n; + s = p->buf + n; + + for (i = 0; i< p->count; i++) { + if ((p->len + strlen(p->field[i]) + 4)>= sizeof(p->buf)) { + err("Overflowed command string"); + return ret_err(EOVERFLOW); + } + n = sprintf(s, ",%s", p->field[i]); + s += n; + p->len += n; + } + p->buf[p->len++] = ';'; + + dbg("Writing '%s' (strlen = %d) (len = %d) to device", + p->buf, strlen(p->buf), p->len); + ret = write(fd, p->buf, p->len); + if (ret != p->len) + perr("Writing to device"); + + return ret>= 0 ? 0 : ret; +} + + +static void dump_packet(struct wu_packet * p) +{ + int i; + + dbg("Packet - Command '%c' %d parameters", p->cmd, p->count); + + for (i = 0; i< p->count; i++) + dbg("[%2d] [%20s] = \"%s\"", i, p->label[i], p->field[i]); +} + + +static int parse_packet(struct wu_packet * p) +{ + char * s, *next; + int i; + + p->buf[p->len] = '\0'; + + dbg("Parsing Packet, Raw buffer is (%d bytes) [%s]", + p->len, p->buf); + + s = p->buf; + + /* + * First character should be '#' + */ + if (s) { + s = strchr(s, '#'); + if (s) + s++; + else { + dbg("Invalid packet"); + return ret_err(EFAULT); + } + } else { + dbg("Invalid packet"); + return ret_err(EFAULT); + } + + /* + * Command character is first + */ + next = strchr(s, ','); + if (next) { + p->cmd = *s; + s = ++next; + } else { + dbg("Invalid Command field [%s]", s); + return ret_err(EFAULT); + } + + /* + * Next character is the subcommand, and should be '-' + * Though, it doesn't matter, because we just + * discard it anyway. + */ + next = strchr(s, ','); + if (next) { + p->sub_cmd = *s; + s = ++next; + } else { + dbg("Invalid 2nd field"); + return ret_err(EFAULT); + } + + /* + * Next is the number of parameters, + * which should always be> 0. + */ + next = strchr(s, ','); + if (next) { + *next++ = '\0'; + p->count = atoi(s); + s = next; + } else { + dbg("Couldn't determine number of parameters"); + return ret_err(EFAULT); + } + + dbg("Have %d parameter%s (cmd = '%c')", + p->count, p->count> 1 ? "s" : "", p->cmd); + + /* + * Now, we loop over the rest of the string, + * storing a pointer to each in p->field[]. + * + * The last character was originally a ';', but may have been + * overwritten with a '\0', so we make sure to catch + * that when converting the last parameter. + */ + for (i = 0; i< p->count; i++) { + next = strpbrk(s, ",;"); + if (next) { + *next++ = '\0'; + } else { + if (i< (p->count - 1)) { + dbg("Malformed parameter string [%s]", s); + return ret_err(EFAULT); + } + } + + /* + * Skip leading white space in fields + */ + while (isspace(*s)) + s++; + p->field[i] = s; + s = next; + } + dump_packet(p); + return 0; +} + + +static int wu_read(int fd, struct wu_packet * p) +{ + fd_set read_fd; + struct timeval tv; + int ret; + + FD_ZERO(&read_fd); + FD_SET(fd,&read_fd); + + tv.tv_sec = 2; + tv.tv_usec = 0; + + ret = select(fd + 1,&read_fd, NULL, NULL,&tv); + if (ret< 0) { + perr("select on terminal device"); + return ret; + } else if (ret> 0) { + + ret = read(fd, p->buf, wu_strlen); + if (ret< 0) { + perr("Reading from device"); + return ret; + } + p->len = ret; + } else { + dbg("Device timed out while reading"); + return ret_err(ETIME); + } + return parse_packet(p); +} + + +static int wu_show_header(int fd) +{ + struct wu_packet p = { + .cmd = 'H', + .sub_cmd = 'R', + .count = 0, + .label = { + [0] = "watts header", + [1] = "volts header", + [2] = "amps header", + [3] = "kWh header", + [4] = "cost header", + [5] = "mo. kWh header", + [6] = "mo. cost header", + [7] = "max watts header", + [8] = "max volts header", + [9] = "max amps header", + [10] = "min watts header", + [11] = "min volts header", + [12] = "min amps header", + [13] = "power factor header", + [14] = "duty cycle header", + [15] = "power cycle header", + } + }; + int ret; + + ret = wu_write(fd,&p); + if (ret) { + perr("Requesting header strings"); + return ret; + } + sleep(1); + + ret = wu_read(fd,&p); + if (ret) { + perr("Reading header strings"); + return ret; + } + + print_packet(&p, "Header Record"); + + return 0; +} + + +static int wu_show_cal(int fd) +{ + struct wu_packet p = { + .cmd = 'F', + .sub_cmd = 'R', + .count = 0, + .label = { + [0] = "flags", + [1] = "sample count", + [2] = "volts gain", + [3] = "volts bias", + [4] = "amps gain", + [5] = "amps bias", + [6] = "amps offset", + [7] = "low amps gain", + [8] = "low amps bias", + [9] = "low amps offset", + [10] = "watts gain", + [11] = "watts offset", + [12] = "low watts gain", + [13] = "low watts offset", + }, + }; + int ret; + + ret = wu_write(fd,&p); + if (ret) { + perr("Requesting calibration parameters"); + return ret; + } + sleep(1); + + ret = wu_read(fd,&p); + if (ret) { + perr("Reading header strings"); + return ret; + } + print_packet(&p, "Calibration Settings"); + + return 0; +} + +static int wu_start_log(void) +{ + struct wu_packet p = { + .cmd = 'L', + .sub_cmd = 'W', + .count = 3, + .field = { + [0] = "E", + [1] = "1", + [2] = "1", + }, + }; + int ret; + + /* + * Start up logging + */ + ret = wu_write(wu_fd,&p); + if (!ret) + sleep(1); + else { + perr("Starting External Logging"); + return ret; + } + return ret; +} + +static int wu_stop_log(void) +{ + struct wu_packet p = { + .cmd = 'L', + .sub_cmd = 'R', + .count = 0, + .label = { + [0] = "time stamp", + [1] = "interval", + }, + }; + int ret; + + /* + * Stop logging and read time stamp. + */ + ret = wu_write(wu_fd,&p); + if (ret) { + perr("Stopping External Logging"); + return ret; + } + sleep(1); + + ret = wu_read(wu_fd,&p); + if (ret) { + perr("Reading final time stamp"); + return ret; + } + if (wu_final) + print_packet(&p, "Final Time Stamp and Interval"); + return ret; +} + +static int filter_data(struct wu_packet * p, int i, char * buf) +{ + if (i< wu_num_fields) { + if (wu_fields[i].enable) { + double val = strtod(p->field[i], NULL); + snprintf(buf, 256, "%.1f", val / 10.0); + return 1; + } + } + return 0; +} + +static int wu_clear(int fd) +{ + struct wu_packet p = { + .cmd = 'R', + .sub_cmd = 'W', + .count = 0, + }; + int ret; + + /* + * Clear the memory + */ + ret = wu_write(fd,&p); + if (ret) + perr("Clearing memory"); + else + sleep(2); + + /* + * Dummy read + */ + wu_read(fd,&p); + return ret; + +} + +static int wu_read_data(int fd) +{ + struct wu_packet p = { + .label = { + [0] = "watts", + [1] = "volts", + [2] = "amps", + [3] = "watt hours", + [4] = "cost", + [5] = "mo. kWh", + [6] = "mo. cost", + [7] = "max watts", + [8] = "max volts", + [9] = "max amps", + [10] = "min watts", + [11] = "min volts", + [12] = "min amps", + [13] = "power factor", + [14] = "duty cycle", + [15] = "power cycle", + }, + }; + int num_read = 0; + int retry = 0; + int ret; + int i; + + static const int wu_max_retry = 2; + + i = 0; + while (1) { + + ret = wu_read(fd,&p); + if (ret) { + if (++retry< wu_max_retry) { + dbg("Bad record back, retrying\n"); + sleep(wu_interval); + continue; + } else if (retry == wu_max_retry) { + dbg("Still couldn't get a good record, resetting\n"); + wu_stop_log(); + wu_clear(fd); + wu_start_log(); + num_read = 0; + sleep(wu_interval); + continue; + } + perr("Blech. Giving up on read"); + break; + } else if (retry) + retry = 0; + + dbg("[%d] ", num_read); + num_read++; + print_packet_filter(&p, filter_data); + + if (wu_count&& (++i == wu_count)) + break; + + sleep(wu_interval); + } + return 0; + +} + + +static int wu_show_interval(int fd) +{ + struct wu_packet p = { + .cmd = 'S', + .sub_cmd = 'R', + .count = 0, + .label = { + [0] = "reserved", + [1] = "interval", + }, + }; + int ret; + + ret = wu_write(fd,&p); + if (ret) { + perr("Requesting interval"); + return ret; + } + sleep(1); + + ret = wu_read(fd,&p); + if (ret) { + perr("Reading interval"); + return ret; + } + print_packet(&p, "Interval Settings"); + + return 0; +} + +static int wu_write_interval(int fd, unsigned int seconds, + unsigned int interval) +{ + char str_seconds[wu_param_len]; + char str_interval[wu_param_len]; + struct wu_packet p = { + .cmd = 'S', + .sub_cmd = 'W', + .count = 2, + .field = { + [0] = str_seconds, + [1] = str_interval, + }, + }; + int ret; + + snprintf(str_seconds, wu_param_len, "%ud", seconds); + snprintf(str_interval, wu_param_len, "%ud", interval); + + ret = wu_write(fd,&p); + if (ret) { + perr("Setting Sampling Interval"); + return ret; + } + sleep(1); + return 0; +} + +static int wu_store_interval(int fd) +{ + char * s = wu_option_value(wu_option_interval); + char * end; + + wu_interval = strtol(s,&end, 0); + if (*end) { + err("Invalid interval: %s", s); + return ret_err(EINVAL); + } + return wu_write_interval(fd, 1, wu_interval); +} + +static int wu_show_mode(int fd) +{ + struct wu_packet p = { + .cmd = 'M', + .sub_cmd = 'R', + .count = 0, + .label = { + [0] = "display mode", + }, + }; + int ret; + + ret = wu_write(fd,&p); + if (ret) { + perr("Requesting device display mode"); + return ret; + } + + ret = wu_read(fd,&p); + if (ret) { + perr("Reaing device display mode"); + return ret; + } + dump_packet(&p); + return ret; +} + +static int wu_write_mode(int fd, int mode) +{ + char str_mode[wu_param_len]; + struct wu_packet p = { + .cmd = 'M', + .sub_cmd = 'W', + .count = 1, + .field = { + [0] = str_mode, + }, + }; + int ret; + + snprintf(str_mode, wu_param_len, "%ud", mode); + ret = wu_write(fd,&p); + if (ret) + perr("Setting device display mode"); + else + sleep(1); + return ret; +} + +static int wu_store_mode(int fd) +{ + char * s = wu_option_value(wu_option_mode); + char * end; + unsigned int mode; + + mode = strtol(s,&end, 0); + if (*end) { + err("Invalid mode: %s", s); + return ret_err(EINVAL); + } + return wu_write_mode(fd, mode); +} + + + +static int wu_show_user(int fd) +{ + struct wu_packet p = { + .cmd = 'U', + .sub_cmd = 'R', + .count = 0, + .label = { + [0] = "cost per kWh", + [1] = "2nd tier cost", + [2] = "2nd tier threshold", + [3] = "duty cycle threshold", + }, + }; + int ret; + + ret = wu_write(fd,&p); + if (ret) { + perr("Requesting user parameters"); + return ret; + } + sleep(1); + + ret = wu_read(fd,&p); + if (ret) { + perr("Reading user parameters"); + return ret; + } + print_packet(&p, "User Settings"); + return 0; +} + + +static int wu_write_user(int fd, unsigned int kwh_cost, + unsigned int second_tier_cost, + unsigned int second_tier_threshold, + unsigned int duty_cycle_threshold) +{ + char str_kwh_cost[wu_param_len]; + char str_2nd_tier_cost[wu_param_len]; + char str_2nd_tier_threshold[wu_param_len]; + char str_duty_cycle_threshold[wu_param_len]; + + struct wu_packet p = { + .cmd = 'U', + .sub_cmd = 'R', + .count = 0, + .label = { + [0] = str_kwh_cost, + [1] = str_2nd_tier_cost, + [2] = str_2nd_tier_threshold, + [3] = str_duty_cycle_threshold, + }, + }; + int ret; + + snprintf(str_kwh_cost, wu_param_len, "%ud", kwh_cost); + snprintf(str_2nd_tier_cost, wu_param_len, "%ud", + second_tier_cost); + snprintf(str_2nd_tier_threshold, wu_param_len, "%ud", + second_tier_threshold); + snprintf(str_duty_cycle_threshold, wu_param_len, "%ud", + duty_cycle_threshold); + + ret = wu_write(fd,&p); + if (ret) + perr("Writing user parameters"); + else + sleep(1); + return ret; +} + +static int wu_store_user(int fd) +{ + unsigned int kwh_cost; + unsigned int second_tier_cost; + unsigned int second_tier_threshold; + unsigned int duty_cycle_threshold; + char * buf = wu_option_value(wu_option_user); + char * s = buf; + char * next; + + if (!buf) { + err("No user parameters?"); + return ret_err(EINVAL); + } + + kwh_cost = strtoul(s,&next, 0); + if (next == s) { + err("Incomplete user parameters"); + return ret_err(EINVAL); + } + + s = next; + while (s&& !isdigit(*s)) + s++; + if (!s) { + err("Incomplete user parameters"); + return ret_err(EINVAL); + } + + + second_tier_cost = strtoul(s,&next, 0); + if (next == s) { + err("Incomplete user parameters"); + return ret_err(EINVAL); + } + + s = next; + while (s&& !isdigit(*s)) + s++; + if (!s) { + err("Incomplete user parameters"); + return ret_err(EINVAL); + } + + + second_tier_threshold = strtoul(s,&next, 0); + if (next == s) { + err("Incomplete user parameters"); + return ret_err(EINVAL); + } + + s = next; + while (s&& !isdigit(*s)) + s++; + if (!s) { + err("Incomplete user parameters"); + return ret_err(EINVAL); + } + + + duty_cycle_threshold = strtoul(s,&next, 0); + if (next == s) { + err("Incomplete user parameters"); + return ret_err(EINVAL); + } + + s = next; + while (s&& !isdigit(*s)) + s++; + if (!s) { + err("Incomplete user parameters"); + return ret_err(EINVAL); + } + + return wu_write_user(fd, kwh_cost, second_tier_cost, + second_tier_threshold, duty_cycle_threshold); +} + + +static void enable_field(char * name) +{ + int i; + + for (i = 0; i< wu_num_fields; i++) { + if (!strcasecmp(wu_fields[i].name, name)) { + wu_fields[i].enable = 1; + break; + } + } +} + +static void enable_all_fields(void) +{ + int i; + + for (i = 0; i< wu_num_fields; i++) + wu_fields[i].enable = 1; +} + + + +static int wu_show_help(int); +static int wu_show_version(int); + + + +static int wu_store_count(int unused) +{ + char * s = wu_option_value(wu_option_count); + char * end; + + if (s) { + wu_count = strtol(s,&end, 0); + if (*end) { + err("Bad count field"); + return ret_err(EINVAL); + } + } + return 0; +} + +static int wu_store_debug(int unused) +{ + wu_debug = 1; + return 0; +} + +static int wu_store_delim(int unused) +{ + char * s = wu_option_value(wu_option_delim); + + if (s) + wu_delim = s; + return 0; +} + +static int wu_store_final(int unused) +{ + wu_final = 1; + return 0; +} + +static int wu_store_label(int unused) +{ + wu_label = 1; + return 0; +} + +static int wu_store_newline(int unused) +{ + wu_newline = 1; + return 0; +} + +static int wu_store_suppress(int unused) +{ + wu_suppress = 1; + return 0; +} + +static int wu_store_localtime(int unused) +{ + wu_localtime = 1; + return 0; +} + +static int wu_store_gmtime(int unused) +{ + wu_gmtime = 1; + return 0; +} + +static int wu_store_info_all(int unused) +{ + wu_info_all = 1; + return 0; +} + +static int wu_store_no_data(int unused) +{ + wu_no_data = 1; + return 0; +} + +static int wu_store_set_only(int unused) +{ + wu_set_only = 1; + return 0; +} + + +/** + * wu_options - command line options and their associated flags + * + */ +static struct wu_options wu_options[] = { + + /* + * Help! + */ + [wu_option_help] = { + .longopt = "help", + .shortopt = 'h', + .param = 0, + .descr = "Display help text and exit", + .show = wu_show_help, + }, + + [wu_option_version] = { + .longopt = "version", + .shortopt = 'V', + .param = 0, + .descr = "Display version information and exit", + .show = wu_show_version, + }, + + /* + * Modifies the output for all other options + */ + [wu_option_debug] = { + .longopt = "debug", + .shortopt = 'd', + .param = 0, + .descr = "Print out debugging messages", + .store = wu_store_debug, + }, + + /* + * For data reading.. + */ + [wu_option_count] = { + .longopt = "count", + .shortopt = 'c', + .param = 1, + .descr = "Specify number of data samples", + .option = "", + .store = wu_store_count, + }, + + [wu_option_final] = { + .longopt = "final", + .shortopt = 'z', + .param = 0, + .descr = "Print final interval information", + .store = wu_store_final, + }, + + /* + * Modifies output for each option (most relevant for data) + */ + [wu_option_delim] = { + .longopt = "delim", + .shortopt = 'f', + .param = 1, + .descr = "Set field delimiter (default \", \")", + .option = "", + .store = wu_store_delim, + }, + + [wu_option_newline] = { + .longopt = "newline", + .shortopt = 'n', + .param = 0, + .descr = "Use '\\n' as delimter instead", + .store = wu_store_newline, + }, + + [wu_option_localtime] = { + .longopt = "localtime", + .shortopt = 't', + .param = 0, + .descr = "Print localtime with each data reading", + .store = wu_store_localtime, + }, + + [wu_option_gmtime] = { + .longopt = "gmtime", + .shortopt = 'g', + .param = 0, + .descr = "Print GMT time with each data reading", + .store = wu_store_gmtime, + }, + + [wu_option_label] = { + .longopt = "label", + .shortopt = 'l', + .param = 0, + .descr = "Show labels of each field", + .store = wu_store_label, + }, + + /* + * Relevant for each of the fields below + */ + [wu_option_suppress] = { + .longopt = "suppress", + .shortopt = 's', + .param = 0, + .descr = "Suppress printing of the field description", + .store = wu_store_suppress, + }, + + /* + * These options print values from the device and exit. + */ + [wu_option_cal] = { + .longopt = "calibrate", + .shortopt = 'b', + .param = 0, + .descr = "Print calibration parameters", + .show = wu_show_cal, + }, + + [wu_option_header] = { + .longopt = "header", + .shortopt = 'r', + .param = 0, + .descr = "Print data field names (as read from device)", + .show = wu_show_header, + }, + + /* + * These options have an optional parameter. + * W/o that parameter, they print values from the device. + * W/ that parameter, they set that option and read data. + * + * Except when the 'set-only' parameter is used, then the + * parameters are set, then re-read and printed. + */ + [wu_option_interval] = { + .longopt = "interval", + .shortopt = 'i', + .param = 2, + .descr = "Get/Set sampling interval", + .option = "", + .show = wu_show_interval, + .store = wu_store_interval, + }, + + [wu_option_mode] = { + .longopt = "mode", + .shortopt = 'm', + .param = 2, + .descr = "Get/Set display mode", + .option = "", + .show = wu_show_mode, + .store = wu_store_mode, + }, + + [wu_option_user] = { + .longopt = "user", + .shortopt = 'u', + .param = 2, + .descr = "Get/Set user parameters", + .option = "", + .format = ",<2nd tier cost>," + "<2nd tier threshold>," + "", + .show = wu_show_user, + .store = wu_store_user, + }, + + [wu_option_info_all] = { + .longopt = "show-all", + .shortopt = 'a', + .param = 0, + .descr = "Show all device parameters", + .store = wu_store_info_all, + }, + + [wu_option_no_data] = { + .longopt = "no-data", + .shortopt = 'N', + .param = 0, + .descr = "Don't read any data (just read device info)", + .store = wu_store_no_data, + }, + + [wu_option_set_only] = { + .longopt = "set-only", + .shortopt = 'S', + .param = 0, + .descr = "Set parameters only (don't read them back)", + .store = wu_store_set_only, + }, +}; + +#define wu_num_options ARRAY_SIZE(wu_options) + +static int wu_show_version(int unused) +{ + printf("%s Version %s\n", prog_name, wu_version); + return 0; +} + +static int wu_show_help(int unused) +{ + int i; + int n; + + wu_show_version(unused); + printf(" A program for interfacing with the Watts Up? Power Meter\n"); + printf("\n"); + + printf("Usage: %s [ ... ] [ ... ]\n", + prog_name); + printf("\n"); + + printf(" is the serial port the device is connected at.\n"); + printf("\n"); + + printf(" are any of the following:\n"); + for (i = 0; i< wu_num_options; i++) { + n = printf(" -%c", wu_options[i].shortopt); + + if (wu_options[i].param == 0) + n = printf(" "); + else if (wu_options[i].param == 1) + n = printf(" %s", wu_options[i].option); + else if (wu_options[i].param == 2) + n = printf(" [%s]", wu_options[i].option); + + n += printf("%*c| ", n - 12, ' '); + n += printf("--%s", wu_options[i].longopt); + + if (wu_options[i].param == 0) + n += printf(" "); + else if (wu_options[i].param == 1) + n += printf("=%s", wu_options[i].option); + else if (wu_options[i].param == 2) + n += printf("[=%s]", wu_options[i].option); + + printf("%*c%s\n", + 40 - n, ' ', wu_options[i].descr); + } + printf("\n"); + printf(" specifies which of these to print out (default: ALL)\n"); + for (i = 0; i< wu_num_fields; i++) { + printf("%12s -- %s\n", wu_fields[i].name, wu_fields[i].descr); + } + printf("\n"); + + return 0; +} + + +static char * wu_option_value(unsigned int index) +{ + return (index< wu_num_options) ? wu_options[index].value : NULL; +} + + +static int wu_check_option_show(int index) +{ + /* + * Return 1 if we need to print something out for + * a particular option. + */ + if (index< wu_num_options) { + if (wu_options[index].flag) { + return 1; + } + } + return 0; +} + +static int wu_check_option_store(int index) +{ + /* + * Return a 1 if this option is set. + */ + + if (index< wu_num_options) { + if (wu_options[index].flag) { + return 1; + } + } + return 0; +} + + +static int wu_show(int index, int dev_fd) +{ + if (wu_options[index].show) + return wu_options[index].show(dev_fd); + return 0; +} + +/* + * Check if the option is set, and call its method if so. + * Return whether or not we did anything.. + */ + +static int wu_check_show(int index, int dev_fd) +{ + if (wu_check_option_show(index)) { + wu_show(index, dev_fd); + return 1; + } + return 0; +} + + +/* + * Check if the option is set and if so, call it + * Return the value from the ->store() method. + */ + +static int wu_check_store(int index, int dev_fd) +{ + if (wu_check_option_store(index)) { + if (wu_options[index].store) + return wu_options[index].store(dev_fd); + } + return 0; +} + + +static void make_longopt(struct option * l) +{ + int i; + + for (i = 0; i< wu_num_options; i++) { + l[i].name = wu_options[i].longopt; + l[i].has_arg = wu_options[i].param; + l[i].flag =&wu_options[i].flag; + l[i].val = 0; + } +} + +static void make_shortopt(char * str) +{ + int i; + char * s = str; + + for (i = 0; i< wu_num_options; i++) { + *s++ = wu_options[i].shortopt; + if (wu_options[i].param) + *s++ = wu_options[i].param == 1 ? ':' : ';'; + } +} + +static void enable_short_option(int c, char * arg) +{ + int i; + + /* + * Friggin' getopt_long() will return the + * character if we get a short option (e.g. '-h'), + * instead of returning 0 like it does when it + * gets a long option (e.g. "--help"). Ugh. + */ + for (i = 0; i< wu_num_options; i++) { + if (wu_options[i].shortopt == c) { + wu_options[i].flag = 1; + if (arg) + wu_options[i].value = strdup(arg); + break; + } + } +} + +static int parse_args(int argc, char ** argv) +{ + struct option longopts[wu_num_options + 1] = { }; + char shortopts[wu_num_options * 2] = ""; + + make_longopt(longopts); + make_shortopt(shortopts); + + + while (1) { + int c; + int index; + + c = getopt_long(argc, argv, shortopts, + longopts,&index); + if (c == -1) + break; + + switch (c) { + case 0: + wu_options[index].flag = 1; + if (optarg) + wu_options[index].value = strdup(optarg); + + printf("long option: val = %c, optarg = %s\n", + wu_options[index].shortopt, optarg); + break; + case '?': + err("Bad parameter"); + return ret_err(EINVAL); + break; + default: + enable_short_option(c, optarg); + break; + } + } + + /* + * Check for help request now and bail after + * printing it, if it's set. + */ + if (wu_check_show(wu_option_help, 0)) + exit(0); + + if (wu_check_show(wu_option_version, 0)) + exit(0); + + /* + * Fields to print out + */ + if (optind< argc) { + int i; + + wu_device = argv[optind++]; + + if (optind< argc) { + for (i = optind; i< argc; i++) + enable_field(argv[i]); + } else + enable_all_fields(); + + } else { + wu_show(wu_option_help, 0); + return ret_err(EINVAL); + } + return 0; +} + + +int main(int argc, char ** argv) +{ + int ret; + int fd = 0; + + ret = parse_args(argc, argv); + if (ret) + return 0; + + /* + * Try to enable debugging early + */ + if ((ret = wu_check_store(wu_option_debug, 0))) + goto Close; + + ret = open_device(wu_device,&fd); + if (ret) + return ret; + + dbg("%s: Open for business", wu_device); + + ret = setup_serial_device(fd); + if (ret) + goto Close; + + wu_clear(fd); + + wu_fd = fd; + + /* + * Set delimeter before we print out any fields. + */ + if ((ret = wu_check_store(wu_option_delim, fd))) + goto Close; + + /* + * Ditto for 'label' and 'newline' flags. + */ + if ((ret = wu_check_store(wu_option_label, fd))) + goto Close; + + if ((ret = wu_check_store(wu_option_newline, fd))) + goto Close; + + if ((ret = wu_check_store(wu_option_suppress, fd))) + goto Close; + + if ((ret = wu_check_store(wu_option_localtime, fd))) + goto Close; + + if ((ret = wu_check_store(wu_option_gmtime, fd))) + goto Close; + + if ((ret = wu_check_store(wu_option_set_only, fd))) + goto Close; + + if ((ret = wu_check_store(wu_option_no_data, fd))) + goto Close; + + if ((ret = wu_check_store(wu_option_info_all, fd))) + goto Close; + + + /* + * Options to set device parameters. + */ + if ((ret = wu_check_store(wu_option_interval, fd))) + goto Close; + + if ((ret = wu_check_store(wu_option_mode, fd))) + goto Close; + + if ((ret = wu_check_store(wu_option_user, fd))) + goto Close; + + /* + * Check for options to print device info + */ + if (wu_info_all) { + wu_show(wu_option_cal, fd); + wu_show(wu_option_header, fd); + wu_show(wu_option_interval, fd); + wu_show(wu_option_mode, fd); + wu_show(wu_option_user, fd); + } else { + wu_check_show(wu_option_cal, fd); + wu_check_show(wu_option_header, fd); + + if (!wu_set_only) { + wu_check_show(wu_option_interval, fd); + wu_check_show(wu_option_mode, fd); + wu_check_show(wu_option_user, fd); + } + } + + if (!wu_no_data) { + + if ((ret = wu_check_store(wu_option_count, fd))) + goto Close; + + if ((ret = wu_check_store(wu_option_final, fd))) + goto Close; + + if ((ret = wu_start_log())) + goto Close; + + wu_read_data(fd); + + wu_stop_log(); + } +Close: + close(fd); + return ret; +} + + diff --git a/utils/wifitoggle/Makefile b/utils/wifitoggle/Makefile new file mode 100644 index 0000000..abf0fc8 --- /dev/null +++ b/utils/wifitoggle/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2010-2012 OpenWrt.org +# Copyright (C) 2010 segal.di.ubi.pt +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=wifitoggle +PKG_VERSION:=1 +PKG_RELEASE:=2 + +include $(INCLUDE_DIR)/package.mk + +define Package/wifitoggle + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Script to toggle Wi-Fi with a button and UCI config + MAINTAINER:=Nuno Goncalves +endef + +define Package/wifitoggle/description +Very versatile script to toggle Wi-Fi with a button. Allows to set +timeouts, persist changes after boot, and set LEDs according to the state. +endef + +define Package/wifitoggle/conffiles +/etc/config/wifitoggle +endef + +define Build/Compile +endef + +define Package/wifitoggle/install + $(INSTALL_DIR) $(1)/etc/hotplug.d/button + $(INSTALL_BIN) ./files/wifitoggle.hotplug $(1)/etc/hotplug.d/button/50-wifitoggle + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/wifitoggle.config $(1)/etc/config/wifitoggle +endef + +$(eval $(call BuildPackage,wifitoggle)) diff --git a/utils/wifitoggle/files/wifitoggle.config b/utils/wifitoggle/files/wifitoggle.config new file mode 100755 index 0000000..f3bec29 --- /dev/null +++ b/utils/wifitoggle/files/wifitoggle.config @@ -0,0 +1,11 @@ +config wifitoggle + option button 'wps' + + option persistent '0' + option timer '600' + + option led_sysfs 'wrt160nl:amber:wps' + option led_enable_trigger 'timer' + option led_enable_delayon '500' + option led_enable_delayoff '500' + option led_disable_default '0' diff --git a/utils/wifitoggle/files/wifitoggle.hotplug b/utils/wifitoggle/files/wifitoggle.hotplug new file mode 100755 index 0000000..fdeeb74 --- /dev/null +++ b/utils/wifitoggle/files/wifitoggle.hotplug @@ -0,0 +1,170 @@ +# /bin/sh + +setled() { + if [ -e /sys/class/leds/${led_sysfs}/brightness ] + then + [ $led_default -eq 1 ] && echo 1 >/sys/class/leds/${led_sysfs}/brightness + [ $led_default -eq 1 ] || echo 0 >/sys/class/leds/${led_sysfs}/brightness + + echo $led_trigger > /sys/class/leds/${led_sysfs}/trigger + + [ "$led_trigger" == "netdev" -a -n "$led_dev" ] && { + echo $led_dev > /sys/class/leds/${led_sysfs}/device_name + echo $led_mode > /sys/class/leds/${led_sysfs}/mode + } + + [ "$led_trigger" == "timer" ] && { + [ -n "$led_delayon" ] && echo $led_delayon > /sys/class/leds/${led_sysfs}/delay_on + [ -n "$led_delayoff" ] && echo $led_delayoff > /sys/class/leds/${led_sysfs}/delay_off + } + else + logger -p user.err -t "wifitoggle" "led: ${led_sysfs} not found" + fi +} + +load_wireless() { + disabled="$(uci get wireless.${1}.disabled)" +} + +save_wireless() { + [ "$device" = "all" -o "$device" = "${1}" ] && { + uci set "wireless.${1}.disabled=$disabled" + } +} + +setwifi() { + setled + + config_load wireless + config_foreach save_wireless wifi-device + wifi +} + + +save_system() { + config_get sysfs $1 sysfs + [ "$sysfs" = "$led_sysfs" ] && { + uci set "system.${1}.trigger=$led_trigger" + uci set "system.${1}.dev=$led_dev" + uci set "system.${1}.mode=$led_mode" + uci set "system.${1}.default=$led_default" + uci set "system.${1}.delayon=$led_delayon" + uci set "system.${1}.delayoff=$led_delayoff" + + ledset=1 + } +} + +commit_changes() { + ledset="" + + config_load system + config_foreach save_system led + + [ "$ledset" -eq 1 ] || { + section=$(uci add system led) + uci set "system.${section}.sysfs=$led_sysfs" + uci set "system.${section}.trigger=$led_trigger" + uci set "system.${section}.dev=$led_dev" + uci set "system.${section}.mode=$led_mode" + uci set "system.${section}.default=$led_default" + uci set "system.${section}.delayon=$led_delayon" + uci set "system.${section}.delayoff=$led_delayoff" + } + + uci commit +} + +enable() { + + led_trigger="$led_enable_trigger" + led_trigger="$led_enable_trigger" + led_dev="$led_enable_dev" + led_mode="$led_enable_mode" + led_default="$led_enable_default" + led_delayon="$led_enable_delayon" + led_delayoff="$led_enable_delayoff" + disabled=0 + + setwifi + + [ "$timer" -le 0 -a "$persistent" -eq 1 ] && commit_changes + + logger -p user.info -t "wifitoggle" "device($device) enabled" + + [ "$timer" -gt 0 ] && { + sleep "$timer" && disable && rm /tmp/run/wirelesstoggle_${1}.pid & + echo $! > /tmp/run/wirelesstoggle_${1}.pid + logger -p user.info -t "wifitoggle" "auto-disable timer started($timer seconds)" + } +} + +disable() { + + led_trigger="$led_disable_trigger" + led_trigger="$led_disable_trigger" + led_dev="$led_disable_dev" + led_mode="$led_disable_mode" + led_default="$led_disable_default" + led_delayon="$led_disable_delayon" + led_delayoff="$led_disable_delayoff" + disabled=1 + + setwifi + + [ "$timer" -le 0 -a "$persistent" -eq 1 ] && commit_changes + + logger -p user.info -t "wifitoggle" "device($device) disabled" +} + + +load_wifitoggle() { + config_get device $1 device "all" + config_get button $1 button "wps" + config_get action $1 action "pressed" + config_get_bool persistent $1 persistent "0" + config_get timer $1 timer "0" + + config_get led_sysfs $1 led_sysfs + + config_get led_enable_trigger $1 led_enable_trigger "none" + config_get led_enable_dev $1 led_enable_dev + config_get led_enable_mode $1 led_enable_mode "link" + config_get_bool led_enable_default $1 led_enable_default "1" + config_get led_enable_delayon $1 led_enable_delayon + config_get led_enable_delayoff $1 led_enable_delayoff + + config_get led_disable_trigger $1 led_disable_trigger "none" + config_get led_disable_dev $1 led_disable_dev + config_get led_disable_mode $1 led_disable_mode "link" + config_get_bool led_disable_default $1 led_disable_default "0" + config_get led_disable_delayon $1 led_disable_delayon + config_get led_disable_delayoff $1 led_disable_delayoff + + [ "$ACTION" = "$action" -a "$BUTTON" = "$button" ] && { + + [ -f /tmp/run/wirelesstoggle_${1}.pid ] && read PID < /tmp/run/wirelesstoggle_${1}.pid && kill $PID && rm /tmp/run/wirelesstoggle_${1}.pid + + if [ "$device" = "all" ] + then + config_load wireless + config_foreach load_wireless wifi-device + else + disabled="$(uci get wireless."$device".disabled)" + fi + + + if [ "$disabled" = "1" ] + then + enable $1 + elif [ "$disabled" = "0" ] + then + disable + else + logger -p user.err -t "wifitoggle" "device($device) not recognized" + fi + } +} + +config_load wifitoggle +config_foreach load_wifitoggle wifitoggle diff --git a/utils/wview/Makefile b/utils/wview/Makefile new file mode 100644 index 0000000..72fe4df --- /dev/null +++ b/utils/wview/Makefile @@ -0,0 +1,170 @@ +# +# Copyright (C) 2012 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:=wview +PKG_VERSION:=5.19.0-jgoerzen +PKG_RELEASE=$(PKG_SOURCE_VERSION) +PKG_SOURCE_URL:=git://github.com/jgoerzen/wview.git +PKG_SOURCE_VERSION:=7bfac6c11e756290c38e7b5862a4c51b6bc6c51e +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/wview + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libcurl +zlib +libpng +libgd +libreadline +libsqlite3 +libusb-1.0 +radlib +sqlite3-cli + TITLE:=Wview Weather Station Software + URL:=http://www.wviewweather.com/ +endef + +define Package/wview/description + Wview is a collection of linux/unix daemons which interface with a supported + weather station to retrieve archive records (if generated by the station) and + current conditions. If the station does not generate archive records + internally, wview will auto-generate archive records based on the sensor + readings collected for that interval. The archive records and High/Low (HILOW) + data are stored in SQLite3 databases. At a configurable interval, wview will + utilize the archive history and current conditions to generate weather images + (buckets, dials and graphs) and HTML web pages based on user-configurable HTML + templates. + + After install you need to create a directory holding archive and create the + database there by running there + sqlite3 wview-archive.sdb '.read /etc/wview/wview-archive.sql' + + Then copy all your theme files to the appropriate place (on a non-volatile + storage), and html-templates.conf to /etc/wview/; then wviewconfig to configure + the system. + + Read and amend /etc/init.d/wview appropriately for your particular setup! +endef + +define Package/wview/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + echo "Removing rc.d symlink for wview" + /etc/init.d/wview disable +fi +exit 0 +endef + +define Package/wview/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/cwop/wvcwopd $(1)/usr/bin/wvcwopd + $(INSTALL_BIN) $(PKG_BUILD_DIR)/http/wvhttpd $(1)/usr/bin/wvhttpd + $(INSTALL_BIN) $(PKG_BUILD_DIR)/procmon/wvpmond $(1)/usr/bin/wvpmond + $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/hilowcreate/hilowcreate $(1)/usr/bin/hilowcreate + $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/sqlite2wlk/sqlite2wlk $(1)/usr/bin/sqlite2wlk + $(INSTALL_BIN) $(PKG_BUILD_DIR)/htmlgenerator/htmlgend $(1)/usr/bin/htmlgend + $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/VantagePro/vpconfig/vpinstall $(1)/usr/bin/vpinstall + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ftp/wviewftpd $(1)/usr/bin/wviewftpd + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ssh/wviewsshd $(1)/usr/bin/wviewsshd + $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/Virtual/wviewd_virtual $(1)/usr/bin/wviewd_virtual + $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/archive-be2le/arc_be2le $(1)/usr/bin/arc_be2le + $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/archive-le2be/arc_le2be $(1)/usr/bin/arc_le2be + $(INSTALL_BIN) $(PKG_BUILD_DIR)/alarms/wvalarmd $(1)/usr/bin/wvalarmd + $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/wlk2sqlite/wlk2sqlite $(1)/usr/bin/wlk2sqlite + $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/Simulator/wviewd_sim $(1)/usr/bin/wviewd_sim + $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/TWI/wviewd_twi $(1)/usr/bin/wviewd_twi + $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/VantagePro/wviewd_vpro $(1)/usr/bin/wviewd_vpro + $(INSTALL_BIN) $(PKG_BUILD_DIR)/wviewconfig/wviewconfig $(1)/usr/bin/wviewconfig + $(INSTALL_BIN) $(PKG_BUILD_DIR)/wviewconfig/wviewhtmlconfig $(1)/usr/bin/wviewhtmlconfig + $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/WH1080/wviewd_wh1080 $(1)/usr/bin/wviewd_wh1080 + $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/WMR918/wviewd_wmr918 $(1)/usr/bin/wviewd_wmr918 + $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/WS-2300/wviewd_ws2300 $(1)/usr/bin/wviewd_ws2300 + $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/WMRUSB/wviewd_wmrusb $(1)/usr/bin/wviewd_wmrusb + $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/WXT510/wviewd_wxt510 $(1)/usr/bin/wviewd_wxt510 + $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/VantagePro/vpconfig/vpconfig $(1)/usr/bin/vpconfig + $(INSTALL_BIN) $(PKG_BUILD_DIR)/wviewconfig/wviewcleardata $(1)/usr/bin/wviewcleardata + $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/TE923/wviewd_te923 $(1)/usr/bin/wviewd_te923 + $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/WXT510/wxt510config/wxt510config $(1)/usr/bin/wxt510config + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/etc/init.d/wview $(1)/etc/init.d/ + $(INSTALL_DIR) $(1)/etc/wview + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/conf/wview-conf.sql $(1)/etc/wview/wview-conf.sql + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/graphics.conf $(1)/etc/wview/graphics.conf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/post-generate.sh $(1)/etc/wview/post-generate.sh + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/images.conf $(1)/etc/wview/images.conf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/images-user.conf $(1)/etc/wview/images-user.conf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/conf/arcrec-header.conf $(1)/etc/wview/arcrec-header.conf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/pre-generate.sh $(1)/etc/wview/pre-generate.sh + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/conf/wview-conf-update.sql $(1)/etc/wview/wview-conf-update.sql + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/conf/forecast.conf-no-forecast $(1)/etc/wview/forecast.conf-no-forecast + echo $(PKG_VERSION) > $(1)/etc/wview/wview-version + echo wviewd_sim > $(1)/etc/wview/wview-binary + +# This should never be defined as the user is expected to manually install all the +# theme files he wants to an appropriate place and to specify that place in the config. +# Leaving here for the future reference to be able to prepare a full variant of the package +ifdef INSTALL_TEMPLATES + $(INSTALL_DIR) $(1)/etc/wview/html + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/Template-Skins-HOWTO.txt $(1)/etc/wview/html/Template-Skins-HOWTO.txt + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/parameterlist.htx $(1)/etc/wview/html/parameterlist.htx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/parameterlist.txt $(1)/etc/wview/html/parameterlist.txt + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/awekas_wl.htx-metric $(1)/etc/wview/html/awekas_wl.htx-metric + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/Current.htx $(1)/etc/wview/html/Current.htx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/html-templates.conf $(1)/etc/wview/html/html-templates.conf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/Weekly.htx $(1)/etc/wview/html/Weekly.htx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/Monthly.htx $(1)/etc/wview/html/Monthly.htx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/data.htx $(1)/etc/wview/html/data.htx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/index-day.htx $(1)/etc/wview/html/index-day.htx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/Yearly.htx $(1)/etc/wview/html/Yearly.htx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/Daily.htx $(1)/etc/wview/html/Daily.htx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/almanac.htx $(1)/etc/wview/html/almanac.htx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/header-big.incx $(1)/etc/wview/html/header-big.incx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/index.htx $(1)/etc/wview/html/index.htx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/awekas_wl.htx-us $(1)/etc/wview/html/awekas_wl.htx-us + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/Current_Conditions.htx $(1)/etc/wview/html/Current_Conditions.htx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/header.incx $(1)/etc/wview/html/header.incx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/index-night.htx $(1)/etc/wview/html/index-night.htx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/wxrss.xtx $(1)/etc/wview/html/wxrss.xtx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/readings.incx $(1)/etc/wview/html/readings.incx + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/nav-buttons.incx $(1)/etc/wview/html/nav-buttons.incx + $(INSTALL_DIR) $(1)/etc/wview/alarms + $(INSTALL_BIN) $(PKG_BUILD_DIR)/examples/alarms/outtempMax.sh $(1)/etc/wview/alarms/outtempMax.sh + $(INSTALL_BIN) $(PKG_BUILD_DIR)/examples/alarms/outtempMin.sh $(1)/etc/wview/alarms/outtempMin.sh + $(INSTALL_BIN) $(PKG_BUILD_DIR)/examples/alarms/outtempMaxEmail.sh $(1)/etc/wview/alarms/outtempMaxEmail.sh + $(INSTALL_DIR) $(1)/var/run/wview + $(INSTALL_DIR) $(1)/var/wview/img + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-partlycloudy.gif $(1)/var/wview/img/fc-icon-partlycloudy.gif + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-rain.gif $(1)/var/wview/img/fc-icon-rain.gif + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/chart_bg.png $(1)/var/wview/img/chart_bg.png + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/dot_bg.png $(1)/var/wview/img/dot_bg.png + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-snowandrain.gif $(1)/var/wview/img/fc-icon-snowandrain.gif + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/Clouds.jpg $(1)/var/wview/img/Clouds.jpg + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/Clouds-blue.jpg $(1)/var/wview/img/Clouds-blue.jpg + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-partlycloudyandsnow.gif $(1)/var/wview/img/fc-icon-partlycloudyandsnow.gif + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/dial_bg.png $(1)/var/wview/img/dial_bg.png + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-snow.gif $(1)/var/wview/img/fc-icon-snow.gif + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/bucket_bg.png $(1)/var/wview/img/bucket_bg.png + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-cloudy.gif $(1)/var/wview/img/fc-icon-cloudy.gif + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/django_bg.jpg $(1)/var/wview/img/django_bg.jpg + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-sunny.gif $(1)/var/wview/img/fc-icon-sunny.gif + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-partlycloudyandrain.gif $(1)/var/wview/img/fc-icon-partlycloudyandrain.gif + $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/above-clouds.jpg $(1)/var/wview/img/above-clouds.jpg + +# These files and the directories should be created manually wherever the user is going to +# have her weather archive and the generated html files + $(INSTALL_DIR) $(1)/var/wview/img/NOAA + $(INSTALL_DIR) $(1)/var/wview/img/Archive + $(INSTALL_DIR) $(1)/var/wview/noaa + $(INSTALL_DIR) $(1)/var/wview/alarms + $(INSTALL_DIR) $(1)/var/wview/archive + $(INSTALL_DATA) $(PKG_BUILD_DIR)/bin/archive/wview-archive.sql $(1)/var/wview/archive/wview-archive.sql + $(INSTALL_DATA) $(PKG_BUILD_DIR)/bin/archive/readme.txt $(1)/var/wview/archive/readme.txt +endif + $(INSTALL_DATA) $(PKG_BUILD_DIR)/bin/archive/wview-archive.sql $(1)/etc/wview/wview-archive.sql +endef + +$(eval $(call BuildPackage,wview)) + diff --git a/utils/wview/files/etc/init.d/wview b/utils/wview/files/etc/init.d/wview new file mode 100644 index 0000000..b212d28 --- /dev/null +++ b/utils/wview/files/etc/init.d/wview @@ -0,0 +1,55 @@ +#!/bin/sh /etc/rc.common + +START=99 + +CONF_DIRECTORY=/etc/wview +RUN_DIRECTORY=/var/wview +WVIEW_INSTALL_DIR=/usr/bin + +WVIEWD_FILE=`cat $CONF_DIRECTORY/wview-binary` +WVIEWD_BIN=$WVIEW_INSTALL_DIR/$WVIEWD_FILE + +WVIEWD_FILE=`cat $CONF_DIRECTORY/wview-binary` +WVIEWD_BIN=$WVIEW_INSTALL_DIR/$WVIEWD_FILE +HTMLD_BIN=$WVIEW_INSTALL_DIR/htmlgend +FTPD_BIN=$WVIEW_INSTALL_DIR/wviewftpd +SSHD_BIN=$WVIEW_INSTALL_DIR/wviewsshd +ALARMD_BIN=$WVIEW_INSTALL_DIR/wvalarmd +CWOPD_BIN=$WVIEW_INSTALL_DIR/wvcwopd +HTTP_BIN=$WVIEW_INSTALL_DIR/wvhttpd +RADROUTER_BIN=$WVIEW_INSTALL_DIR/radmrouted +PMOND_BIN=$WVIEW_INSTALL_DIR/wvpmond + +RADROUTER_PID=$RUN_DIRECTORY/radmrouted.pid +WVIEWD_PID=$RUN_DIRECTORY/wviewd.pid +HTMLD_PID=$RUN_DIRECTORY/htmlgend.pid +FTPD_PID=$RUN_DIRECTORY/wviewftpd.pid +SSHD_PID=$RUN_DIRECTORY/wviewsshd.pid +ALARMD_PID=$RUN_DIRECTORY/wvalarmd.pid +CWOPD_PID=$RUN_DIRECTORY/wvcwopd.pid +HTTP_PID=$RUN_DIRECTORY/wvhttpd.pid +PMOND_PID=$RUN_DIRECTORY/wvpmond.pid + +start() { + mkdir /mnt/extusb 2> /dev/null + mount /dev/sda1 /mnt/extusb 2> /dev/null + mkdir $RUN_DIRECTORY 2> /dev/null + ln -snf /mnt/extusb/wview-html $CONF_DIRECTORY/html + ln -snf /mnt/extusb/wview-data/measurements-archive /var/wview/archive + start-stop-daemon -S -x $RADROUTER_BIN -- 1 $RUN_DIRECTORY + sleep 1 + start-stop-daemon -S -x $WVIEWD_BIN + sleep 1 + for i in HTMLD ALARMD CWOPD HTTP FTPD SSHD PMOND; do + start-stop-daemon -S -x $(eval echo \$$(echo ${i}_BIN)) + done +} + +stop() { + for i in RADROUTER WVIEWD HTMLD ALARMD CWOPD HTTP FTPD SSHD PMOND; do + PID_FILE=$(eval echo \$$(echo ${i}_PID)) + start-stop-daemon -K -s TERM -p $PID_FILE + rm -f $PID_FILE + done +} + diff --git a/utils/wview/patches/010-fix-cross-compile.patch b/utils/wview/patches/010-fix-cross-compile.patch new file mode 100644 index 0000000..59523bf --- /dev/null +++ b/utils/wview/patches/010-fix-cross-compile.patch @@ -0,0 +1,499 @@ +--- a/alarms/Makefile.am ++++ b/alarms/Makefile.am +@@ -8,7 +8,6 @@ bin_PROGRAMS = wvalarmd + # define include directories + INCLUDES = \ + -I$(top_srcdir)/common \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -36,9 +35,7 @@ wvalarmd_SOURCES = \ + wvalarmd_LDADD = + + # define library directories +-wvalarmd_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wvalarmd_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/cwop/Makefile.am ++++ b/cwop/Makefile.am +@@ -8,7 +8,6 @@ bin_PROGRAMS = wvcwopd + # define include directories + INCLUDES = \ + -I$(top_srcdir)/common \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -32,9 +31,7 @@ wvcwopd_SOURCES = \ + wvcwopd_LDADD = + + # define library directories +-wvcwopd_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wvcwopd_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/ftp/Makefile.am ++++ b/ftp/Makefile.am +@@ -7,7 +7,6 @@ bin_PROGRAMS = wviewftpd + + # define include directories + INCLUDES = -I$(top_srcdir)/common \ +- -I$(prefix)/include \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ + -D_GNU_SOURCE +@@ -33,9 +32,7 @@ wviewftpd_SOURCES = \ + wviewftpd_LDADD = -lssl -lcurl + + # define library directories +-wviewftpd_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wviewftpd_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/htmlgenerator/Makefile.am ++++ b/htmlgenerator/Makefile.am +@@ -8,7 +8,6 @@ bin_PROGRAMS = htmlgend + # define include directories + INCLUDES = \ + -I$(top_srcdir)/common \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -66,9 +65,7 @@ htmlgend_SOURCES = \ + htmlgend_LDADD = + + # define library directories +-htmlgend_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-htmlgend_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/http/Makefile.am ++++ b/http/Makefile.am +@@ -8,9 +8,6 @@ bin_PROGRAMS = wvhttpd + # define include directories + INCLUDES = \ + -I$(top_srcdir)/common \ +- -I$(prefix)/include \ +- -I/usr/include \ +- -I/usr/local/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -38,9 +35,7 @@ wvhttpd_SOURCES = \ + wvhttpd_LDADD = -lssl -lcurl + + # define library directories +-wvhttpd_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wvhttpd_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/procmon/Makefile.am ++++ b/procmon/Makefile.am +@@ -8,7 +8,6 @@ bin_PROGRAMS = wvpmond + # define include directories + INCLUDES = \ + -I$(top_srcdir)/common \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -33,9 +32,7 @@ wvpmond_SOURCES = \ + wvpmond_LDADD = + + # define library directories +-wvpmond_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wvpmond_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/ssh/Makefile.am ++++ b/ssh/Makefile.am +@@ -7,7 +7,6 @@ bin_PROGRAMS = wviewsshd + + # define include directories + INCLUDES = -I$(top_srcdir)/common \ +- -I$(prefix)/include \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ + -D_GNU_SOURCE +@@ -33,9 +32,7 @@ wviewsshd_SOURCES = \ + wviewsshd_LDADD = + + # define library directories +-wviewsshd_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wviewsshd_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/stations/Simulator/Makefile.am ++++ b/stations/Simulator/Makefile.am +@@ -7,7 +7,6 @@ bin_PROGRAMS = wviewd_sim + INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/common \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -52,9 +51,7 @@ wviewd_sim_SOURCES = \ + wviewd_sim_LDADD = + + # define library directories +-wviewd_sim_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wviewd_sim_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/stations/TE923/Makefile.am ++++ b/stations/TE923/Makefile.am +@@ -7,7 +7,6 @@ bin_PROGRAMS = wviewd_te923 + INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/common \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -53,11 +52,9 @@ wviewd_te923_SOURCES = \ + + if DARWIN + wviewd_te923_SOURCES += $(top_srcdir)/stations/common/hidapi-osx.c +-wviewd_te923_LDFLAGS = -L$(prefix)/lib -L/usr/lib -L/usr/local/lib -framework IOKit -framework CoreFoundation + wviewd_te923_LDADD = + else + wviewd_te923_SOURCES += $(top_srcdir)/stations/common/hidapi-linux.c +-wviewd_te923_LDFLAGS = -L$(prefix)/lib -L/usr/lib -L/usr/local/lib + if FREEBSD + wviewd_te923_LDADD = -lusb + else +--- a/stations/TWI/Makefile.am ++++ b/stations/TWI/Makefile.am +@@ -7,7 +7,6 @@ bin_PROGRAMS = wviewd_twi + INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/common \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -57,9 +56,7 @@ wviewd_twi_SOURCES = \ + wviewd_twi_LDADD = + + # define library directories +-wviewd_twi_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wviewd_twi_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/stations/VantagePro/Makefile.am ++++ b/stations/VantagePro/Makefile.am +@@ -9,7 +9,6 @@ bin_PROGRAMS = wviewd_vpro + INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/common \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -56,9 +55,7 @@ wviewd_vpro_SOURCES = \ + wviewd_vpro_LDADD = + + # define library directories +-wviewd_vpro_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wviewd_vpro_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/stations/VantagePro/vpconfig/Makefile.am ++++ b/stations/VantagePro/vpconfig/Makefile.am +@@ -13,7 +13,6 @@ INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/common \ + -I$(top_srcdir)/stations/VantagePro \ +- -I$(prefix)/include \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ + -D_VP_CONFIG_ONLY \ +@@ -40,10 +39,8 @@ vpconfig_SOURCES = \ + vpconfig_LDADD = + + # define library directories +-vpconfig_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-vpconfig_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + + CLEANFILES = $(bin_SCRIPTS) +--- a/stations/Virtual/Makefile.am ++++ b/stations/Virtual/Makefile.am +@@ -7,7 +7,6 @@ bin_PROGRAMS = wviewd_virtual + INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/common \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -58,9 +57,7 @@ wviewd_virtual_SOURCES = \ + wviewd_virtual_LDADD = + + # define library directories +-wviewd_virtual_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wviewd_virtual_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/stations/WH1080/Makefile.am ++++ b/stations/WH1080/Makefile.am +@@ -7,7 +7,6 @@ bin_PROGRAMS = wviewd_wh1080 + INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/common \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -53,11 +52,9 @@ wviewd_wh1080_SOURCES = \ + + if DARWIN + wviewd_wh1080_SOURCES += $(top_srcdir)/stations/common/hidapi-osx.c +-wviewd_wh1080_LDFLAGS = -L$(prefix)/lib -L/usr/lib -L/usr/local/lib -framework IOKit -framework CoreFoundation + wviewd_wh1080_LDADD = + else + wviewd_wh1080_SOURCES += $(top_srcdir)/stations/common/hidapi-linux.c +-wviewd_wh1080_LDFLAGS = -L$(prefix)/lib -L/usr/lib -L/usr/local/lib + if FREEBSD + wviewd_wh1080_LDADD = -lusb + else +--- a/stations/WMR918/Makefile.am ++++ b/stations/WMR918/Makefile.am +@@ -7,7 +7,6 @@ bin_PROGRAMS = wviewd_wmr918 + INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/common \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -56,9 +55,7 @@ wviewd_wmr918_SOURCES = \ + wviewd_wmr918_LDADD = + + # define library directories +-wviewd_wmr918_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wviewd_wmr918_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/stations/WMRUSB/Makefile.am ++++ b/stations/WMRUSB/Makefile.am +@@ -7,7 +7,6 @@ bin_PROGRAMS = wviewd_wmrusb + INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/common \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -52,11 +51,9 @@ wviewd_wmrusb_SOURCES = \ + + if DARWIN + wviewd_wmrusb_SOURCES += $(top_srcdir)/stations/common/hidapi-osx.c +-wviewd_wmrusb_LDFLAGS = -L$(prefix)/lib -L/usr/lib -L/usr/local/lib -framework IOKit -framework CoreFoundation + wviewd_wmrusb_LDADD = + else + wviewd_wmrusb_SOURCES += $(top_srcdir)/stations/common/hidapi-linux.c +-wviewd_wmrusb_LDFLAGS = -L$(prefix)/lib -L/usr/lib -L/usr/local/lib + if FREEBSD + wviewd_wmrusb_LDADD = -lusb + else +--- a/stations/WS-2300/Makefile.am ++++ b/stations/WS-2300/Makefile.am +@@ -7,7 +7,6 @@ bin_PROGRAMS = wviewd_ws2300 + INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/common \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -56,9 +55,7 @@ wviewd_ws2300_SOURCES = \ + wviewd_ws2300_LDADD = + + # define library directories +-wviewd_ws2300_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wviewd_ws2300_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/stations/WXT510/Makefile.am ++++ b/stations/WXT510/Makefile.am +@@ -10,7 +10,6 @@ bin_PROGRAMS = wviewd_wxt510 + INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/common \ +- -I$(prefix)/include \ + -D_GNU_SOURCE \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -59,9 +58,7 @@ wviewd_wxt510_SOURCES = \ + wviewd_wxt510_LDADD = + + # define library directories +-wviewd_wxt510_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wviewd_wxt510_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/stations/WXT510/wxt510config/Makefile.am ++++ b/stations/WXT510/wxt510config/Makefile.am +@@ -8,7 +8,6 @@ INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/common \ + -I$(top_srcdir)/stations/WXT510 \ +- -I$(prefix)/include \ + -D_WXT510_CONFIG_ONLY \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ +@@ -38,9 +37,7 @@ wxt510config_SOURCES = \ + wxt510config_LDADD = + + # define library directories +-wxt510config_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wxt510config_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/utilities/archive-be2le/Makefile.am ++++ b/utilities/archive-be2le/Makefile.am +@@ -8,7 +8,6 @@ INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/VantagePro \ + -I$(top_srcdir)/utilities \ +- -I$(prefix)/include \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ + -DBUILD_UTILITIES \ +@@ -31,9 +30,7 @@ arc_be2le_SOURCES = \ + arc_be2le_LDADD = + + # define library directories +-arc_be2le_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-arc_be2le_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/utilities/archive-le2be/Makefile.am ++++ b/utilities/archive-le2be/Makefile.am +@@ -8,7 +8,6 @@ INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/VantagePro \ + -I$(top_srcdir)/utilities \ +- -I$(prefix)/include \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ + -DBUILD_UTILITIES \ +@@ -31,9 +30,7 @@ arc_le2be_SOURCES = \ + arc_le2be_LDADD = + + # define library directories +-arc_le2be_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-arc_le2be_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/utilities/hilowcreate/Makefile.am ++++ b/utilities/hilowcreate/Makefile.am +@@ -6,7 +6,6 @@ bin_PROGRAMS = hilowcreate + # define include directories + INCLUDES = \ + -I$(top_srcdir)/common \ +- -I$(prefix)/include \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ + -DBUILD_UTILITIES=1 \ +@@ -28,9 +27,7 @@ hilowcreate_SOURCES = \ + hilowcreate_LDADD = + + # define library directories +-hilowcreate_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-hilowcreate_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/utilities/sqlite2wlk/Makefile.am ++++ b/utilities/sqlite2wlk/Makefile.am +@@ -8,7 +8,6 @@ INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/VantagePro \ + -I$(top_srcdir)/utilities \ +- -I$(prefix)/include \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ + -DBUILD_UTILITIES \ +@@ -29,9 +28,7 @@ sqlite2wlk_SOURCES = \ + sqlite2wlk_LDADD = + + # define library directories +-sqlite2wlk_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-sqlite2wlk_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/utilities/wlk2sqlite/Makefile.am ++++ b/utilities/wlk2sqlite/Makefile.am +@@ -8,7 +8,6 @@ INCLUDES = \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/stations/VantagePro \ + -I$(top_srcdir)/utilities \ +- -I$(prefix)/include \ + -DWV_CONFIG_DIR=\"$(sysconfdir)/wview\" \ + -DWV_RUN_DIR=\"$(localstatedir)/wview\" \ + -DBUILD_UTILITIES \ +@@ -29,9 +28,7 @@ wlk2sqlite_SOURCES = \ + wlk2sqlite_LDADD = + + # define library directories +-wlk2sqlite_LDFLAGS = -L$(prefix)/lib -L$(prefix)/usr/lib -L/usr/lib + + if CROSSCOMPILE +-wlk2sqlite_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o $(prefix)/lib/crtn.o + endif + +--- a/stations/common/hidapi-linux.c ++++ b/stations/common/hidapi-linux.c +@@ -79,7 +79,6 @@ + #else + #include "libusb-1.0/libusb.h" + #endif +-#include "iconv.h" + + #include "hidapi.h" + diff --git a/utils/wview/patches/020-use-standard-awk.patch b/utils/wview/patches/020-use-standard-awk.patch new file mode 100644 index 0000000..4959bf6 --- /dev/null +++ b/utils/wview/patches/020-use-standard-awk.patch @@ -0,0 +1,20 @@ +--- a/wviewconfig/wviewconfig.sh ++++ b/wviewconfig/wviewconfig.sh +@@ -206,7 +206,7 @@ get_wview_conf_interactive() + cd $WVIEW_CONF_DIR + + # Edit parms one at a time: +- gawk -F"|" '{ ++ awk -F"|" '{ + sysstring=sprintf("./editparm \"%s\" \"%s\" \"%s\" \"%s\"", $1, $2, $3, $4) + system(sysstring) + }' $WVIEW_CONF_DIR/parms.out +@@ -234,7 +234,7 @@ set_config_from_file() + cd $WVIEW_CONF_DIR + + # Update parms one at a time: +- gawk -F"=" '{ ++ awk -F"=" '{ + sysstring=sprintf("./updateparm \"%s\" \"%s\"", $1, $2) + system(sysstring) + }' $SET_FILE diff --git a/utils/wx200d/Makefile b/utils/wx200d/Makefile new file mode 100644 index 0000000..c33d071 --- /dev/null +++ b/utils/wx200d/Makefile @@ -0,0 +1,51 @@ +# +# 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:=wx200d +PKG_VERSION:=1.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/wx200d +PKG_MD5SUM:=0f90c099dddcdd46ac568d707822ec4c + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/wx200d + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libpq + TITLE:=weather station data collector + URL:=http://wx200d.sourceforge.net/ +endef + +define Package/wx200d/description + wx200d is a weather station data collector and server daemon + for the WX200, WM918, WMR918 and WMR968 weather station + hardware. +endef + +# uses GNU configure + +define Package/wx200d/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/wx200 \ + $(PKG_INSTALL_DIR)/usr/bin/wxstdout \ + $(PKG_INSTALL_DIR)/usr/bin/wxfilter \ + $(PKG_INSTALL_DIR)/usr/bin/wxdebug \ + $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/wx200d \ + $(PKG_INSTALL_DIR)/usr/sbin/wxread \ + $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,wx200d)) diff --git a/utils/xdelta3/Makefile b/utils/xdelta3/Makefile new file mode 100644 index 0000000..c330000 --- /dev/null +++ b/utils/xdelta3/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2011 Alexander Gordeev +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=xdelta3 +PKG_VERSION:=3.0.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=xdelta$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://xdelta.googlecode.com/files +PKG_MD5SUM:=5fe038be3a266d2a7913e10d1cec6d88 + +PKG_BUILD_DIR:=$(BUILD_DIR)/xdelta$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/xdelta3 + SECTION:=utils + CATEGORY:=Utilities + URL:=http://xdelta.org + TITLE:=A diff utility which works with binary files +endef + +define Package/xdelta3/description + Xdelta3 is a set of tools designed to compute changes between binary + files. These changes (delta files) are similar to the output of the + "diff" program, in that they may be used to store and transmit only + the changes between files. The "delta files" that Xdelta3 manages are + stored in RFC3284 (VCDIFF) format. +endef + +define Package/xdelta3/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/xdelta3 $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,xdelta3)) diff --git a/utils/xdelta3/patches/001-decrease-default-window-size.patch b/utils/xdelta3/patches/001-decrease-default-window-size.patch new file mode 100644 index 0000000..3fd134d --- /dev/null +++ b/utils/xdelta3/patches/001-decrease-default-window-size.patch @@ -0,0 +1,19 @@ +diff --git a/xdelta3.h b/xdelta3.h +index 5dafd8d..22bc37f 100644 +--- a/xdelta3.h ++++ b/xdelta3.h +@@ -38,12 +38,12 @@ + * buffer is used directly. + */ + #ifndef XD3_DEFAULT_WINSIZE +-#define XD3_DEFAULT_WINSIZE (1U << 23) ++#define XD3_DEFAULT_WINSIZE (1U << 16) + #endif + + /* Default total size of the source window used in xdelta3-main.h */ + #ifndef XD3_DEFAULT_SRCWINSZ +-#define XD3_DEFAULT_SRCWINSZ (1U << 26) ++#define XD3_DEFAULT_SRCWINSZ (1U << 19) + #endif + + /* When Xdelta requests a memory allocation for certain buffers, it diff --git a/utils/zile/Makefile b/utils/zile/Makefile new file mode 100644 index 0000000..d3071d0 --- /dev/null +++ b/utils/zile/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2006-2011 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:=zile +PKG_VERSION:=2.3.24 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/zile +PKG_MD5SUM:=fe77d801ba69e0fb9b4914a04b9ff506 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/zile + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncursesw + TITLE:=very small emacs-like editor + URL:=http://www.gnu.org/software/zile/ + SUBMENU:=Editors +endef + +define Package/zile/description + Zile is a small Emacs clone. Zile is a customizable, self-documenting + real-time display editor. Zile was written to be as similar as possible + to Emacs; every Emacs user should feel at home with Zile. +endef + +CONFIGURE_VARS += \ + gl_cv_func_getopt_gnu=yes + +define Package/zile/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,zile)) diff --git a/utils/zip/Makefile b/utils/zip/Makefile new file mode 100644 index 0000000..d0b5df7 --- /dev/null +++ b/utils/zip/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2007-2009 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:=zip +PKG_VERSION:=2.32 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)232.zip +PKG_SOURCE_URL:=@SF/infozip +PKG_MD5SUM:=da947ed356e5fdb30ff4bc3dc7698f33 + +include $(INCLUDE_DIR)/package.mk + +PKG_UNPACK=unzip -d $(PKG_BUILD_DIR)/ $(DL_DIR)/$(PKG_SOURCE) + +define Package/zip + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:= + TITLE:=Archiver for .zip files + URL:=http://infozip.sourceforge.net/Zip.html + SUBMENU:=compression +endef + +define Package/zip/description + This is InfoZIP's zip program. It produces files that are fully + compatible with the popular PKZIP program; however, the command line + options are not identical. In other words, the end result is the same, + but the methods differ. +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) -f unix/Makefile generic \ + $(TARGET_CONFIGURE_OPTS) \ + prefix="$(PKG_INSTALL_DIR)/usr" \ + CFLAGS="$(TARGET_CFLAGS)" \ + CF="$(TARGET_CFLAGS) -O $(TARGET_CPPFLAGS) -I. -DUNIX" \ + LD="$(TARGET_CC) $(TARGET_LDFLAGS)" \ + install +endef + +define Package/zip/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,zip)) diff --git a/utils/zoneinfo/Makefile b/utils/zoneinfo/Makefile new file mode 100644 index 0000000..741e64b --- /dev/null +++ b/utils/zoneinfo/Makefile @@ -0,0 +1,254 @@ +# +# Copyright (C) 2007-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# Author: Michael Geddes + +include $(TOPDIR)/rules.mk + +PKG_NAME:=zoneinfo +PKG_VERSION:=2011n +PKG_VERSION_CODE:=2011i +PKG_RELEASE:=1 + +PKG_SOURCE:=tzdata$(PKG_VERSION).tar.gz +PKG_SOURCE_CODE:=tzcode$(PKG_VERSION_CODE).tar.gz +PKG_SOURCE_URL:=http://www.iana.org/time-zones/repository/releases +PKG_MD5SUM:=20dbfb28efa008ddbf6dd34601ea40fa + +include $(INCLUDE_DIR)/package.mk + +define Download/tzcode + FILE=$(PKG_SOURCE_CODE) + URL=$(PKG_SOURCE_URL) + MD5SUM=cf7f4335b7c8682899fa2814e711c1b2 +endef + +$(eval $(call Download,tzcode)) + +define Package/zoneinfo/Default + SUBMENU:=zoneinfo + TITLE:=Zone Information + SECTION:=utils + CATEGORY:=Utilities +endef + +define Package/zoneinfo-core +$(call Package/zoneinfo/Default) + TITLE:=Zone Information (core) +endef + +define Package/zoneinfo-simple +$(call Package/zoneinfo/Default) + TITLE:=Zone Information (simple) +endef + +define Package/zoneinfo-africa +$(call Package/zoneinfo/Default) + TITLE:=Zone Information (Africa) +endef + +define Package/zoneinfo-northamerica +$(call Package/zoneinfo/Default) + TITLE:=Zone Information (NorthAmerica) +endef + +define Package/zoneinfo-southamerica +$(call Package/zoneinfo/Default) + TITLE:=Zone Information (SouthAmerica) +endef + +define Package/zoneinfo-poles +$(call Package/zoneinfo/Default) + TITLE:=Zone Information (Arctic, Antarctic) +endef + +define Package/zoneinfo-asia +$(call Package/zoneinfo/Default) + TITLE:=Zone Information (Asia) +endef + +define Package/zoneinfo-atlantic +$(call Package/zoneinfo/Default) + TITLE:=Zone Information (Atlantic) +endef + +define Package/zoneinfo-australia-nz +$(call Package/zoneinfo/Default) + TITLE:=Zone Information (Australia-NZ) +endef + +define Package/zoneinfo-pacific +$(call Package/zoneinfo/Default) + TITLE:=Zone Information (Pacific) +endef + +define Package/zoneinfo-europe +$(call Package/zoneinfo/Default) + TITLE:=Zone Information (Europe) +endef + +define Package/zoneinfo-india +$(call Package/zoneinfo/Default) + TITLE:=Zone Information (India) +endef + +define Package/zoneinfo-middleeast +$(call Package/zoneinfo/Default) + TITLE:=Zone Information (MiddleEast) +endef + +define Build/Prepare + (cd $(PKG_BUILD_DIR) && tar -xzf $(DL_DIR)/$(PKG_SOURCE_CODE) && tar -xzf $(DL_DIR)/$(PKG_SOURCE)) +endef + +define Build/Compile + CFLAGS="$(HOST_CFLAGS)" \ + $(MAKE) -C $(PKG_BUILD_DIR) -f Makefile \ + $(HOST_CONFIGURE_OPTS) \ + CC="$(HOSTCC)" \ + LD="\$$$$(CC)" \ + CPPFLAGS="$(HOST_CPPFLAGS)" \ + LDFLAGS="$(HOST_LDFLAGS)" \ + TOPDIR="$(PKG_INSTALL_DIR)" \ + TZDIR="$(PKG_INSTALL_DIR)/zoneinfo" \ + install +endef + + +define Package/zoneinfo-core/install + $(INSTALL_DIR) $(1)/usr/share/zoneinfo + for i in \ + CET CST6CDT EET EST EST5EDT GB-Eire Eire \ + GB GMT GMT+0 GMT-0 GMT0 Greenwich \ + HST MET MST MST7MDT \ + PRC PST8PDT ROC ROK UCT UTC \ + Universal W-SU WET Zulu Etc/* zone.tab ; do \ + $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \ + $(1)/usr/share/zoneinfo ; \ + done +endef + +define Package/zoneinfo-simple/install + $(INSTALL_DIR) $(1)/usr/share/zoneinfo + for i in Pacific/Honolulu \ + America/Anchorage America/Los_Angeles America/Denver \ + America/Chicago America/New_York America/Caracas \ + America/Sao_Paulo Europe/London Europe/Paris \ + Africa/Cairo Europe/Moscow Asia/Dubai \ + Asia/Karachi Asia/Dhaka Asia/Bankok \ + Asia/Hong_Kong Asia/Tokyo Australia/Darwin \ + Australia/Adelaide Australia/Brisbane Australia/Sydney \ + Australia/Perth Pacific/Noumea ; do \ + $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \ + $(1)/usr/share/zoneinfo ; \ + done +endef + +define Package/zoneinfo-africa/install + $(INSTALL_DIR) $(1)/usr/share/zoneinfo/Africa + $(CP) $(PKG_INSTALL_DIR)/zoneinfo/Africa/* \ + $(1)/usr/share/zoneinfo/Africa +endef + +define Package/zoneinfo-northamerica/install + $(INSTALL_DIR) $(1)/usr/share/zoneinfo + for i in US America Canada Mexico Cuba Jamaica Navajo ; do \ + $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \ + $(1)/usr/share/zoneinfo ; \ + done + rm -rf $(1)/usr/share/zoneinfo/America/Argentina +endef + +define Package/zoneinfo-southamerica/install + $(INSTALL_DIR) $(1)/usr/share/zoneinfo + for i in Brazil Chile ; do \ + $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \ + $(1)/usr/share/zoneinfo ; \ + done + $(INSTALL_DIR) $(1)/usr/share/zoneinfo/America/Argentina + $(CP) $(PKG_INSTALL_DIR)/zoneinfo/America/Argentina/* \ + $(1)/usr/share/zoneinfo/America/Argentina +endef + +define Package/zoneinfo-poles/install + $(INSTALL_DIR) $(1)/usr/share/zoneinfo + for i in Antarctica Arctic ; do \ + $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \ + $(1)/usr/share/zoneinfo ; \ + done +endef + +define Package/zoneinfo-asia/install + $(INSTALL_DIR) $(1)/usr/share/zoneinfo + for i in Asia Japan Singapore Hongkong ; do \ + $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \ + $(1)/usr/share/zoneinfo ; \ + done +endef + +define Package/zoneinfo-atlantic/install + $(INSTALL_DIR) $(1)/usr/share/zoneinfo + for i in Atlantic Iceland ; do \ + $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \ + $(1)/usr/share/zoneinfo ; \ + done +endef + +define Package/zoneinfo-australia-nz/install + $(INSTALL_DIR) $(1)/usr/share/zoneinfo + for i in NZ NZ-CHAT Australia ; do \ + $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \ + $(1)/usr/share/zoneinfo ; \ + done +endef + +define Package/zoneinfo-pacific/install + $(INSTALL_DIR) $(1)/usr/share/zoneinfo + for i in Pacific Kwajalein ; do \ + $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \ + $(1)/usr/share/zoneinfo ; \ + done +endef + +define Package/zoneinfo-europe/install + $(INSTALL_DIR) $(1)/usr/share/zoneinfo + for i in Europe Portugal Poland ; do \ + $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \ + $(1)/usr/share/zoneinfo ; \ + done +endef + + +define Package/zoneinfo-india/install + $(INSTALL_DIR) $(1)/usr/share/zoneinfo + for i in Indian ; do \ + $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \ + $(1)/usr/share/zoneinfo ; \ + done +endef + +define Package/zoneinfo-middleeast/install + $(INSTALL_DIR) $(1)/usr/share/zoneinfo + for i in Egypt Libya Iran Israel Turkey Mideast ; do \ + $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \ + $(1)/usr/share/zoneinfo ; \ + done +endef + +$(eval $(call BuildPackage,zoneinfo-simple)) +$(eval $(call BuildPackage,zoneinfo-core)) +$(eval $(call BuildPackage,zoneinfo-africa)) +$(eval $(call BuildPackage,zoneinfo-northamerica)) +$(eval $(call BuildPackage,zoneinfo-southamerica)) +$(eval $(call BuildPackage,zoneinfo-poles)) +$(eval $(call BuildPackage,zoneinfo-asia)) +$(eval $(call BuildPackage,zoneinfo-atlantic)) +$(eval $(call BuildPackage,zoneinfo-australia-nz)) +$(eval $(call BuildPackage,zoneinfo-pacific)) +$(eval $(call BuildPackage,zoneinfo-europe)) +$(eval $(call BuildPackage,zoneinfo-india)) +$(eval $(call BuildPackage,zoneinfo-middleeast)) + -- 2.11.0